From: support Date: Wed, 28 Dec 2022 14:49:12 +0000 (+0000) Subject: Built motion from commit 4d4d9a88.|2.6.26 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22javascript:;//%22my-avatar.png/%22?a=commitdiff_plain;h=3e5526eec46db05fd99421c8f5f9efa2c0af1fa2;p=motion2.git Built motion from commit 4d4d9a88.|2.6.26 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index c6cfd34..f8c8e85 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-12-28T13:08:35.011Z", + "time": "2022-12-28T14:41:25.678Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 0b91654..7b75e7d 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-12-28T13:08:35.011Z", + "time": "2022-12-28T14:41:25.678Z", "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 a534017..00d5f1b 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 _0x1f17=['urlForward[body]','sequelize','VIRTUAL','getDataValue','STRING','contactManager','motionbar','urlForward','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT'];(function(_0x6cfc5,_0x21eef4){var _0x400596=function(_0x247dcf){while(--_0x247dcf){_0x6cfc5['push'](_0x6cfc5['shift']());}};_0x400596(++_0x21eef4);}(_0x1f17,0x71));var _0x71f1=function(_0x1f6193,_0x2de9ff){_0x1f6193=_0x1f6193-0x0;var _0x160297=_0x1f17[_0x1f6193];return _0x160297;};'use strict';var Sequelize=require(_0x71f1('0x0'));module['exports']={'name':{'type':Sequelize[_0x71f1('0x1')],'get':function(_0x10abec){return this[_0x71f1('0x2')]('action');}},'action':{'type':Sequelize[_0x71f1('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x71f1('0x4'),'integration',_0x71f1('0x5'),'jscripty',_0x71f1('0x6'),'browser','bot',_0x71f1('0x7')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x71f1('0x8')},'data1':{'type':Sequelize[_0x71f1('0x3')](0x1000),'comment':_0x71f1('0x9')},'data2':{'type':Sequelize[_0x71f1('0x3')](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':_0x71f1('0xa')},'data4':{'type':Sequelize[_0x71f1('0x3')](0x1000),'comments':_0x71f1('0xb')},'data5':{'type':Sequelize[_0x71f1('0x3')](0x1000),'comments':_0x71f1('0xc')},'data6':{'type':Sequelize['STRING'],'comments':_0x71f1('0xd')},'data7':{'type':Sequelize[_0x71f1('0xe')],'comments':_0x71f1('0xf')}}; \ No newline at end of file +var _0x897a=['contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','getDataValue','action','STRING','contactManager','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'];(function(_0x37228e,_0x2f0c36){var _0x760077=function(_0x2ef6fb){while(--_0x2ef6fb){_0x37228e['push'](_0x37228e['shift']());}};_0x760077(++_0x2f0c36);}(_0x897a,0xe3));var _0xa897=function(_0x2cc6da,_0x477245){_0x2cc6da=_0x2cc6da-0x0;var _0x1b8b1d=_0x897a[_0x2cc6da];return _0x1b8b1d;};'use strict';var Sequelize=require(_0xa897('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x420ee0){return this[_0xa897('0x1')](_0xa897('0x2'));}},'action':{'type':Sequelize[_0xa897('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0xa897('0x4'),'integration',_0xa897('0x5'),_0xa897('0x6'),_0xa897('0x7'),_0xa897('0x8'),_0xa897('0x9'),_0xa897('0xa')]],'msg':_0xa897('0xb')}},'comment':_0xa897('0xb')},'data1':{'type':Sequelize[_0xa897('0x3')](0x1000),'comment':_0xa897('0xc')},'data2':{'type':Sequelize[_0xa897('0x3')](0x1000),'comment':_0xa897('0xd')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0xa897('0xe')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0xa897('0xf')},'data5':{'type':Sequelize[_0xa897('0x3')](0x1000),'comments':_0xa897('0x10')},'data6':{'type':Sequelize[_0xa897('0x3')],'comments':_0xa897('0x11')},'data7':{'type':Sequelize[_0xa897('0x12')],'comments':_0xa897('0x13')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 8d078cc..36b11cb 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 _0x17ae=['destroy','stack','name','send','find','body','catch','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','undefined','count','limit','status','set','Content-Range','apply','save','update','then'];(function(_0x234a15,_0x2758ce){var _0x39dcad=function(_0x2cdbcb){while(--_0x2cdbcb){_0x234a15['push'](_0x234a15['shift']());}};_0x39dcad(++_0x2758ce);}(_0x17ae,0x1ca));var _0xe17a=function(_0x1709a3,_0x2de081){_0x1709a3=_0x1709a3-0x0;var _0x1c141d=_0x17ae[_0x1709a3];return _0x1c141d;};'use strict';var emlformat=require(_0xe17a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe17a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe17a('0x2'));var moment=require(_0xe17a('0x3'));var BPromise=require(_0xe17a('0x4'));var Mustache=require(_0xe17a('0x5'));var util=require('util');var path=require(_0xe17a('0x6'));var sox=require(_0xe17a('0x7'));var csv=require(_0xe17a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe17a('0x9'));var _=require(_0xe17a('0xa'));var squel=require(_0xe17a('0xb'));var crypto=require(_0xe17a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe17a('0xd'));var toCsv=require(_0xe17a('0x8'));var querystring=require(_0xe17a('0xe'));var Papa=require(_0xe17a('0xf'));var Redis=require('ioredis');var authService=require(_0xe17a('0x10'));var qs=require(_0xe17a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xe17a('0x12'));var config=require(_0xe17a('0x13'));var licenseUtil=require(_0xe17a('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d12f2,_0x2af7ef){_0x2af7ef=_0x2af7ef||0xcc;return function(_0x39d668){if(_0x39d668){return _0x5d12f2[_0xe17a('0x15')](_0x2af7ef);}return _0x5d12f2['status'](_0x2af7ef)[_0xe17a('0x16')]();};}function respondWithResult(_0x4c8122,_0x3869a3){_0x3869a3=_0x3869a3||0xc8;return function(_0x23fba3){if(_0x23fba3){return _0x4c8122['status'](_0x3869a3)[_0xe17a('0x17')](_0x23fba3);}};}function respondWithFilteredResult(_0x1cd455,_0x4627fe){return function(_0x3d873f){if(_0x3d873f){var _0x456632=typeof _0x4627fe['offset']===_0xe17a('0x18')&&typeof _0x4627fe['limit']===_0xe17a('0x18');var _0x598bd6=_0x3d873f['count'];var _0x2ca913=_0x456632?0x0:_0x4627fe['offset'];var _0x2b3efc=_0x456632?_0x3d873f[_0xe17a('0x19')]:_0x4627fe['offset']+_0x4627fe[_0xe17a('0x1a')];var _0x3041f0;if(_0x2b3efc>=_0x598bd6){_0x2b3efc=_0x598bd6;_0x3041f0=0xc8;}else{_0x3041f0=0xce;}_0x1cd455[_0xe17a('0x1b')](_0x3041f0);return _0x1cd455[_0xe17a('0x1c')](_0xe17a('0x1d'),_0x2ca913+'-'+_0x2b3efc+'/'+_0x598bd6)[_0xe17a('0x17')](_0x3d873f);}return null;};}function patchUpdates(_0x2a30ed){return function(_0xed12e3){try{jsonpatch[_0xe17a('0x1e')](_0xed12e3,_0x2a30ed,!![]);}catch(_0x2704ec){return BPromise['reject'](_0x2704ec);}return _0xed12e3[_0xe17a('0x1f')]();};}function saveUpdates(_0x52fc8e,_0x5a4052){return function(_0x23711c){if(_0x23711c){return _0x23711c[_0xe17a('0x20')](_0x52fc8e)[_0xe17a('0x21')](function(_0x3e48de){return _0x3e48de;});}return null;};}function removeEntity(_0x2b0f2d,_0x397340){return function(_0x1e7db0){if(_0x1e7db0){return _0x1e7db0[_0xe17a('0x22')]()[_0xe17a('0x21')](function(){_0x2b0f2d[_0xe17a('0x1b')](0xcc)[_0xe17a('0x16')]();});}};}function handleEntityNotFound(_0x39e5fa,_0x418c30){return function(_0x41a179){if(!_0x41a179){_0x39e5fa[_0xe17a('0x15')](0x194);}return _0x41a179;};}function handleError(_0x4cfeeb,_0x1019f5){_0x1019f5=_0x1019f5||0x1f4;return function(_0x81e6c){logger['error'](_0x81e6c[_0xe17a('0x23')]);if(_0x81e6c['name']){delete _0x81e6c[_0xe17a('0x24')];}_0x4cfeeb[_0xe17a('0x1b')](_0x1019f5)[_0xe17a('0x25')](_0x81e6c);};}exports[_0xe17a('0x20')]=function(_0x420b94,_0x49a4b1){if(_0x420b94['body']['id']){delete _0x420b94['body']['id'];}return db['Action'][_0xe17a('0x26')]({'where':{'id':_0x420b94['params']['id']}})[_0xe17a('0x21')](handleEntityNotFound(_0x49a4b1,null))[_0xe17a('0x21')](saveUpdates(_0x420b94[_0xe17a('0x27')],null))[_0xe17a('0x21')](respondWithResult(_0x49a4b1,null))[_0xe17a('0x28')](handleError(_0x49a4b1,null));};exports[_0xe17a('0x22')]=function(_0x1bcfd3,_0x29b52e){return db['Action'][_0xe17a('0x26')]({'where':{'id':_0x1bcfd3['params']['id']}})[_0xe17a('0x21')](handleEntityNotFound(_0x29b52e,null))[_0xe17a('0x21')](removeEntity(_0x29b52e,null))[_0xe17a('0x28')](handleError(_0x29b52e,null));}; \ No newline at end of file +var _0xc20a=['path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','then','sendStatus','stack','name','send','body','find','catch','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xc20a,0xad));var _0xac20=function(_0x7c4037,_0x4e7dbc){_0x7c4037=_0x7c4037-0x0;var _0x3e9366=_0xc20a[_0x7c4037];return _0x3e9366;};'use strict';var emlformat=require(_0xac20('0x0'));var rimraf=require(_0xac20('0x1'));var zipdir=require(_0xac20('0x2'));var jsonpatch=require(_0xac20('0x3'));var rp=require(_0xac20('0x4'));var moment=require('moment');var BPromise=require(_0xac20('0x5'));var Mustache=require(_0xac20('0x6'));var util=require('util');var path=require(_0xac20('0x7'));var sox=require(_0xac20('0x8'));var csv=require(_0xac20('0x9'));var ejs=require(_0xac20('0xa'));var fs=require('fs');var fs_extra=require(_0xac20('0xb'));var _=require('lodash');var squel=require(_0xac20('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xac20('0xd'));var toCsv=require(_0xac20('0x9'));var querystring=require(_0xac20('0xe'));var Papa=require(_0xac20('0xf'));var Redis=require(_0xac20('0x10'));var authService=require(_0xac20('0x11'));var qs=require(_0xac20('0x12'));var as=require(_0xac20('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac20('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xac20('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xac20('0x16'))['db'];function respondWithStatusCode(_0x598f2c,_0xd0ac8c){_0xd0ac8c=_0xd0ac8c||0xcc;return function(_0xdb4124){if(_0xdb4124){return _0x598f2c['sendStatus'](_0xd0ac8c);}return _0x598f2c[_0xac20('0x17')](_0xd0ac8c)[_0xac20('0x18')]();};}function respondWithResult(_0x56549b,_0xf24bb6){_0xf24bb6=_0xf24bb6||0xc8;return function(_0x1aa3b6){if(_0x1aa3b6){return _0x56549b[_0xac20('0x17')](_0xf24bb6)[_0xac20('0x19')](_0x1aa3b6);}};}function respondWithFilteredResult(_0x192a90,_0x5d7640){return function(_0x19994b){if(_0x19994b){var _0xe75337=typeof _0x5d7640[_0xac20('0x1a')]===_0xac20('0x1b')&&typeof _0x5d7640['limit']===_0xac20('0x1b');var _0x424724=_0x19994b[_0xac20('0x1c')];var _0x1b38ac=_0xe75337?0x0:_0x5d7640[_0xac20('0x1a')];var _0x2e0a59=_0xe75337?_0x19994b['count']:_0x5d7640[_0xac20('0x1a')]+_0x5d7640[_0xac20('0x1d')];var _0x4d9518;if(_0x2e0a59>=_0x424724){_0x2e0a59=_0x424724;_0x4d9518=0xc8;}else{_0x4d9518=0xce;}_0x192a90[_0xac20('0x17')](_0x4d9518);return _0x192a90[_0xac20('0x1e')](_0xac20('0x1f'),_0x1b38ac+'-'+_0x2e0a59+'/'+_0x424724)[_0xac20('0x19')](_0x19994b);}return null;};}function patchUpdates(_0x2cfe60){return function(_0xe8cb86){try{jsonpatch[_0xac20('0x20')](_0xe8cb86,_0x2cfe60,!![]);}catch(_0x20973c){return BPromise['reject'](_0x20973c);}return _0xe8cb86[_0xac20('0x21')]();};}function saveUpdates(_0x5b26f0,_0x62683e){return function(_0x1be743){if(_0x1be743){return _0x1be743[_0xac20('0x22')](_0x5b26f0)['then'](function(_0x2a6544){return _0x2a6544;});}return null;};}function removeEntity(_0x18848e,_0x348a95){return function(_0x34beeb){if(_0x34beeb){return _0x34beeb[_0xac20('0x23')]()[_0xac20('0x24')](function(){_0x18848e[_0xac20('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45031b,_0x4e618c){return function(_0x4b2c74){if(!_0x4b2c74){_0x45031b[_0xac20('0x25')](0x194);}return _0x4b2c74;};}function handleError(_0x449825,_0x5b0ca2){_0x5b0ca2=_0x5b0ca2||0x1f4;return function(_0x3d0441){logger['error'](_0x3d0441[_0xac20('0x26')]);if(_0x3d0441[_0xac20('0x27')]){delete _0x3d0441[_0xac20('0x27')];}_0x449825[_0xac20('0x17')](_0x5b0ca2)[_0xac20('0x28')](_0x3d0441);};}exports[_0xac20('0x22')]=function(_0x35eee0,_0x3e42ef){if(_0x35eee0[_0xac20('0x29')]['id']){delete _0x35eee0[_0xac20('0x29')]['id'];}return db['Action'][_0xac20('0x2a')]({'where':{'id':_0x35eee0['params']['id']}})[_0xac20('0x24')](handleEntityNotFound(_0x3e42ef,null))[_0xac20('0x24')](saveUpdates(_0x35eee0[_0xac20('0x29')],null))[_0xac20('0x24')](respondWithResult(_0x3e42ef,null))[_0xac20('0x2b')](handleError(_0x3e42ef,null));};exports['destroy']=function(_0xfe102,_0x3e747d){return db['Action'][_0xac20('0x2a')]({'where':{'id':_0xfe102[_0xac20('0x2c')]['id']}})[_0xac20('0x24')](handleEntityNotFound(_0x3e747d,null))[_0xac20('0x24')](removeEntity(_0x3e747d,null))['catch'](handleError(_0x3e747d,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 2b08bdf..98eed0c 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 _0x92db=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./action.attributes','exports','define','Action','tools_actions'];(function(_0x22cb5f,_0x2cdd63){var _0x274d36=function(_0x421472){while(--_0x421472){_0x22cb5f['push'](_0x22cb5f['shift']());}};_0x274d36(++_0x2cdd63);}(_0x92db,0x111));var _0xb92d=function(_0x1bece9,_0x26bcfd){_0x1bece9=_0x1bece9-0x0;var _0x2a3685=_0x92db[_0x1bece9];return _0x2a3685;};'use strict';var _=require('lodash');var util=require(_0xb92d('0x0'));var logger=require(_0xb92d('0x1'))(_0xb92d('0x2'));var moment=require(_0xb92d('0x3'));var BPromise=require(_0xb92d('0x4'));var rp=require(_0xb92d('0x5'));var fs=require('fs');var path=require(_0xb92d('0x6'));var rimraf=require('rimraf');var config=require(_0xb92d('0x7'));var attributes=require(_0xb92d('0x8'));module[_0xb92d('0x9')]=function(_0x36c463,_0x534688){return _0x36c463[_0xb92d('0xa')](_0xb92d('0xb'),attributes,{'tableName':_0xb92d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x854e=['request-promise','path','../../config/environment','./action.attributes','exports','define','Action','tools_actions','lodash','util','moment','bluebird'];(function(_0x1a1032,_0x584887){var _0x200077=function(_0x59d99c){while(--_0x59d99c){_0x1a1032['push'](_0x1a1032['shift']());}};_0x200077(++_0x584887);}(_0x854e,0xa4));var _0xe854=function(_0x20ef83,_0xea60f9){_0x20ef83=_0x20ef83-0x0;var _0x18c673=_0x854e[_0x20ef83];return _0x18c673;};'use strict';var _=require(_0xe854('0x0'));var util=require(_0xe854('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe854('0x2'));var BPromise=require(_0xe854('0x3'));var rp=require(_0xe854('0x4'));var fs=require('fs');var path=require(_0xe854('0x5'));var rimraf=require('rimraf');var config=require(_0xe854('0x6'));var attributes=require(_0xe854('0x7'));module[_0xe854('0x8')]=function(_0x616c4f,_0x465450){return _0x616c4f[_0xe854('0x9')](_0xe854('0xa'),attributes,{'tableName':_0xe854('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 2c5c3d2..4ec6a01 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 _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0x53ec,0x192));var _0xc53e=function(_0x4534e3,_0x56de6e){_0x4534e3=_0x4534e3-0x0;var _0x50c3a3=_0x53ec[_0x4534e3];return _0x50c3a3;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});} \ No newline at end of file +var _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x2ccb62,_0x229005){var _0x2617b0=function(_0x1247f1){while(--_0x1247f1){_0x2ccb62['push'](_0x2ccb62['shift']());}};_0x2617b0(++_0x229005);}(_0xabce,0x103));var _0xeabc=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xabce[_0x311c35];return _0x5cc50c;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Action,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index a470e6f..c9fff72 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 _0xbc1b=['./action.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2cb210,_0x24a41a){var _0x47d172=function(_0x3ede13){while(--_0x3ede13){_0x2cb210['push'](_0x2cb210['shift']());}};_0x47d172(++_0x24a41a);}(_0xbc1b,0x1e8));var _0xbbc1=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0xbc1b[_0x54d4a8];return _0x3b321b;};'use strict';var multer=require(_0xbbc1('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xbbc1('0x1'));var express=require('express');var router=express[_0xbbc1('0x2')]();var fs_extra=require(_0xbbc1('0x3'));var auth=require(_0xbbc1('0x4'));var interaction=require(_0xbbc1('0x5'));var config=require(_0xbbc1('0x6'));var controller=require(_0xbbc1('0x7'));router[_0xbbc1('0x8')](_0xbbc1('0x9'),auth[_0xbbc1('0xa')](),controller[_0xbbc1('0xb')]);router[_0xbbc1('0xc')](_0xbbc1('0x9'),auth['isAuthenticated'](),controller[_0xbbc1('0xd')]);module[_0xbbc1('0xe')]=router; \ No newline at end of file +var _0x0d61=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','connect-timeout'];(function(_0x14b8fa,_0x53a624){var _0x28d552=function(_0x1dca3b){while(--_0x1dca3b){_0x14b8fa['push'](_0x14b8fa['shift']());}};_0x28d552(++_0x53a624);}(_0x0d61,0x1c0));var _0x10d6=function(_0x121985,_0x252db3){_0x121985=_0x121985-0x0;var _0x20bc79=_0x0d61[_0x121985];return _0x20bc79;};'use strict';var multer=require(_0x10d6('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x10d6('0x1'));var express=require(_0x10d6('0x2'));var router=express[_0x10d6('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x10d6('0x4'));var interaction=require(_0x10d6('0x5'));var config=require(_0x10d6('0x6'));var controller=require(_0x10d6('0x7'));router[_0x10d6('0x8')](_0x10d6('0x9'),auth[_0x10d6('0xa')](),controller[_0x10d6('0xb')]);router[_0x10d6('0xc')](_0x10d6('0x9'),auth['isAuthenticated'](),controller[_0x10d6('0xd')]);module[_0x10d6('0xe')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 889f013..51d9f10 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 _0xeff8=['STRING','TEXT','sequelize','exports'];(function(_0x2d2d4d,_0x2b4cd2){var _0x396a8d=function(_0x11835d){while(--_0x11835d){_0x2d2d4d['push'](_0x2d2d4d['shift']());}};_0x396a8d(++_0x2b4cd2);}(_0xeff8,0x186));var _0x8eff=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0xeff8[_0x50007c];return _0x5c1ec7;};'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 +var _0x425d=['sequelize','STRING','TEXT'];(function(_0x3a2942,_0xdc3983){var _0x246f0a=function(_0x1ffd23){while(--_0x1ffd23){_0x3a2942['push'](_0x3a2942['shift']());}};_0x246f0a(++_0xdc3983);}(_0x425d,0x1e0));var _0xd425=function(_0x4ca538,_0xe09873){_0x4ca538=_0x4ca538-0x0;var _0x3c2324=_0x425d[_0x4ca538];return _0x3c2324;};'use strict';var Sequelize=require(_0xd425('0x0'));module['exports']={'name':{'type':Sequelize[_0xd425('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xd425('0x1')]},'parent':{'type':Sequelize[_0xd425('0x1')]},'table':{'type':Sequelize[_0xd425('0x1')]},'conditions':{'type':Sequelize[_0xd425('0x2')]},'joins':{'type':Sequelize[_0xd425('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 30bea95..e5a1240 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 _0xf7e1=['format','groupBy','orderBy','joins','parse','foreignTable','foreignKey','parentKey','conditions','clone','debug','toString','sequelize','SELECT','right_join','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','from','DESC','output','web','fullPath','%s-%s.%s','csv','custom','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','countTable','COUNT(*)','QueryTypes','run','runReport','cross_join','%s.%s\x20=\x20%s.%s','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','squel','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','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','reject','save','then','destroy','UserProfileResource','name','send','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','keys','filters','attributes','intersection','model','fields','length','query','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','get','role','user','Reports','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','field','replace','function'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf7e1,0x170));var _0x1f7e=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0xf7e1[_0x1969a7];return _0x3d665f;};'use strict';var emlformat=require(_0x1f7e('0x0'));var rimraf=require(_0x1f7e('0x1'));var zipdir=require(_0x1f7e('0x2'));var jsonpatch=require(_0x1f7e('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1f7e('0x4'));var Mustache=require('mustache');var util=require(_0x1f7e('0x5'));var path=require(_0x1f7e('0x6'));var sox=require(_0x1f7e('0x7'));var csv=require('to-csv');var ejs=require(_0x1f7e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1f7e('0x9'));var crypto=require(_0x1f7e('0xa'));var jsforce=require(_0x1f7e('0xb'));var deskjs=require(_0x1f7e('0xc'));var toCsv=require(_0x1f7e('0xd'));var querystring=require(_0x1f7e('0xe'));var Papa=require('papaparse');var Redis=require(_0x1f7e('0xf'));var authService=require(_0x1f7e('0x10'));var qs=require(_0x1f7e('0x11'));var as=require(_0x1f7e('0x12'));var hardwareService=require(_0x1f7e('0x13'));var logger=require(_0x1f7e('0x14'))(_0x1f7e('0x15'));var utils=require(_0x1f7e('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1f7e('0x17'));var db=require(_0x1f7e('0x18'))['db'];var dbH=require(_0x1f7e('0x18'))[_0x1f7e('0x19')];function respondWithStatusCode(_0x447d64,_0xe7bed1){_0xe7bed1=_0xe7bed1||0xcc;return function(_0x25510c){if(_0x25510c){return _0x447d64[_0x1f7e('0x1a')](_0xe7bed1);}return _0x447d64[_0x1f7e('0x1b')](_0xe7bed1)[_0x1f7e('0x1c')]();};}function respondWithResult(_0x1eee34,_0x536761){_0x536761=_0x536761||0xc8;return function(_0x55493c){if(_0x55493c){return _0x1eee34['status'](_0x536761)[_0x1f7e('0x1d')](_0x55493c);}};}function respondWithFilteredResult(_0x1425bb,_0x3ca63a){return function(_0x1b2c0a){if(_0x1b2c0a){var _0x45ed5f=typeof _0x3ca63a['offset']==='undefined'&&typeof _0x3ca63a[_0x1f7e('0x1e')]===_0x1f7e('0x1f');var _0x268e7d=_0x1b2c0a[_0x1f7e('0x20')];var _0x264b2e=_0x45ed5f?0x0:_0x3ca63a[_0x1f7e('0x21')];var _0x466b35=_0x45ed5f?_0x1b2c0a[_0x1f7e('0x20')]:_0x3ca63a[_0x1f7e('0x21')]+_0x3ca63a[_0x1f7e('0x1e')];var _0x43cb41;if(_0x466b35>=_0x268e7d){_0x466b35=_0x268e7d;_0x43cb41=0xc8;}else{_0x43cb41=0xce;}_0x1425bb[_0x1f7e('0x1b')](_0x43cb41);return _0x1425bb[_0x1f7e('0x22')](_0x1f7e('0x23'),_0x264b2e+'-'+_0x466b35+'/'+_0x268e7d)[_0x1f7e('0x1d')](_0x1b2c0a);}return null;};}function patchUpdates(_0x2b1bac){return function(_0x1d341b){try{jsonpatch['apply'](_0x1d341b,_0x2b1bac,!![]);}catch(_0x4fe2b0){return BPromise[_0x1f7e('0x24')](_0x4fe2b0);}return _0x1d341b[_0x1f7e('0x25')]();};}function saveUpdates(_0x1fe475,_0x13fd01){return function(_0x81f52e){if(_0x81f52e){return _0x81f52e['update'](_0x1fe475)[_0x1f7e('0x26')](function(_0x55b875){return _0x55b875;});}return null;};}function removeEntity(_0x38a0d4,_0x179d01){return function(_0x175dc9){if(_0x175dc9){return _0x175dc9[_0x1f7e('0x27')]()[_0x1f7e('0x26')](function(){var _0x25c398=_0x175dc9['get']({'plain':!![]});var _0x29b7ca='CustomReports';return db[_0x1f7e('0x28')][_0x1f7e('0x27')]({'where':{'type':_0x29b7ca,'resourceId':_0x25c398['id']}})['then'](function(){return _0x175dc9;});})[_0x1f7e('0x26')](function(){_0x38a0d4[_0x1f7e('0x1b')](0xcc)[_0x1f7e('0x1c')]();});}};}function handleEntityNotFound(_0x1219f0,_0x3eaecf){return function(_0x543152){if(!_0x543152){_0x1219f0[_0x1f7e('0x1a')](0x194);}return _0x543152;};}function handleError(_0x5a8d22,_0x37ef72){_0x37ef72=_0x37ef72||0x1f4;return function(_0x57d55a){logger['error'](_0x57d55a['stack']);if(_0x57d55a[_0x1f7e('0x29')]){delete _0x57d55a[_0x1f7e('0x29')];}_0x5a8d22[_0x1f7e('0x1b')](_0x37ef72)[_0x1f7e('0x2a')](_0x57d55a);};}exports['index']=function(_0x4ef977,_0x310b08){var _0x2c2e41={},_0x40c33e={},_0x2bd5f0={'count':0x0,'rows':[]};var _0x273a4e=_[_0x1f7e('0x2b')](db[_0x1f7e('0x2c')][_0x1f7e('0x2d')],function(_0x4a8858){return{'name':_0x4a8858[_0x1f7e('0x2e')],'type':_0x4a8858[_0x1f7e('0x2f')][_0x1f7e('0x30')]};});_0x40c33e['model']=_[_0x1f7e('0x2b')](_0x273a4e,_0x1f7e('0x29'));_0x40c33e['query']=_[_0x1f7e('0x31')](_0x4ef977['query']);_0x40c33e[_0x1f7e('0x32')]=_['intersection'](_0x40c33e['model'],_0x40c33e['query']);_0x2c2e41[_0x1f7e('0x33')]=_[_0x1f7e('0x34')](_0x40c33e[_0x1f7e('0x35')],qs['fields'](_0x4ef977['query'][_0x1f7e('0x36')]));_0x2c2e41[_0x1f7e('0x33')]=_0x2c2e41['attributes'][_0x1f7e('0x37')]?_0x2c2e41['attributes']:_0x40c33e['model'];if(!_0x4ef977[_0x1f7e('0x38')][_0x1f7e('0x39')](_0x1f7e('0x3a'))){_0x2c2e41[_0x1f7e('0x1e')]=qs[_0x1f7e('0x1e')](_0x4ef977[_0x1f7e('0x38')]['limit']);_0x2c2e41[_0x1f7e('0x21')]=qs[_0x1f7e('0x21')](_0x4ef977[_0x1f7e('0x38')]['offset']);}_0x2c2e41[_0x1f7e('0x3b')]=qs[_0x1f7e('0x3c')](_0x4ef977[_0x1f7e('0x38')]['sort']);_0x2c2e41['where']=qs[_0x1f7e('0x32')](_[_0x1f7e('0x3d')](_0x4ef977['query'],_0x40c33e['filters']),_0x273a4e);if(_0x4ef977[_0x1f7e('0x38')][_0x1f7e('0x3e')]){_0x2c2e41[_0x1f7e('0x3f')]=_[_0x1f7e('0x40')](_0x2c2e41['where'],{'$or':_[_0x1f7e('0x2b')](_0x273a4e,function(_0x231937){if(_0x231937['type']!==_0x1f7e('0x41')){var _0xeb4b67={};_0xeb4b67[_0x231937[_0x1f7e('0x29')]]={'$like':'%'+_0x4ef977[_0x1f7e('0x38')][_0x1f7e('0x3e')]+'%'};return _0xeb4b67;}})});}_0x2c2e41=_[_0x1f7e('0x40')]({},_0x2c2e41,_0x4ef977[_0x1f7e('0x42')]);var _0x3f7428={'where':_0x2c2e41[_0x1f7e('0x3f')]};return db[_0x1f7e('0x2c')][_0x1f7e('0x20')](_0x3f7428)[_0x1f7e('0x26')](function(_0x3130eb){_0x2bd5f0[_0x1f7e('0x20')]=_0x3130eb;if(_0x4ef977[_0x1f7e('0x38')][_0x1f7e('0x43')]){_0x2c2e41[_0x1f7e('0x44')]=[{'all':!![]}];}return db[_0x1f7e('0x2c')][_0x1f7e('0x45')](_0x2c2e41);})[_0x1f7e('0x26')](function(_0x4f571e){_0x2bd5f0[_0x1f7e('0x46')]=_0x4f571e;return _0x2bd5f0;})[_0x1f7e('0x26')](respondWithFilteredResult(_0x310b08,_0x2c2e41))[_0x1f7e('0x47')](handleError(_0x310b08,null));};exports['show']=function(_0x59aa64,_0x28b0dd){var _0x38bbbb={'raw':![],'where':{'id':_0x59aa64[_0x1f7e('0x48')]['id']}},_0x10e163={};_0x10e163[_0x1f7e('0x35')]=_['keys'](db[_0x1f7e('0x2c')][_0x1f7e('0x2d')]);_0x10e163[_0x1f7e('0x38')]=_[_0x1f7e('0x31')](_0x59aa64['query']);_0x10e163[_0x1f7e('0x32')]=_[_0x1f7e('0x34')](_0x10e163[_0x1f7e('0x35')],_0x10e163[_0x1f7e('0x38')]);_0x38bbbb[_0x1f7e('0x33')]=_[_0x1f7e('0x34')](_0x10e163[_0x1f7e('0x35')],qs[_0x1f7e('0x36')](_0x59aa64[_0x1f7e('0x38')][_0x1f7e('0x36')]));_0x38bbbb['attributes']=_0x38bbbb['attributes'][_0x1f7e('0x37')]?_0x38bbbb[_0x1f7e('0x33')]:_0x10e163[_0x1f7e('0x35')];if(_0x59aa64[_0x1f7e('0x38')][_0x1f7e('0x43')]){_0x38bbbb[_0x1f7e('0x44')]=[{'all':!![]}];}_0x38bbbb=_[_0x1f7e('0x40')]({},_0x38bbbb,_0x59aa64[_0x1f7e('0x42')]);return db[_0x1f7e('0x2c')][_0x1f7e('0x49')](_0x38bbbb)[_0x1f7e('0x26')](handleEntityNotFound(_0x28b0dd,null))['then'](respondWithResult(_0x28b0dd,null))['catch'](handleError(_0x28b0dd,null));};exports['create']=function(_0x443454,_0x524c78){return db[_0x1f7e('0x2c')][_0x1f7e('0x4a')](_0x443454[_0x1f7e('0x4b')],{})['then'](function(_0x213776){var _0xf12cb6=_0x443454['user'][_0x1f7e('0x4c')]({'plain':!![]});if(!_0xf12cb6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xf12cb6[_0x1f7e('0x4d')]===_0x1f7e('0x4e')){var _0x52955e=_0x213776['get']({'plain':!![]});var _0x234c19=_0x1f7e('0x4f');return db['UserProfileSection'][_0x1f7e('0x49')]({'where':{'name':_0x234c19,'userProfileId':_0xf12cb6[_0x1f7e('0x50')]},'raw':!![]})[_0x1f7e('0x26')](function(_0x3c953e){if(_0x3c953e&&_0x3c953e['autoAssociation']===0x0){return db[_0x1f7e('0x28')][_0x1f7e('0x4a')]({'name':_0x52955e['name'],'resourceId':_0x52955e['id'],'type':'CustomReports','sectionId':_0x3c953e['id']},{})[_0x1f7e('0x26')](function(){return _0x213776;});}else{return _0x213776;}})[_0x1f7e('0x47')](function(_0x4bda50){logger['error'](_0x1f7e('0x51'),_0x4bda50);throw _0x4bda50;});}return _0x213776;})[_0x1f7e('0x26')](respondWithResult(_0x524c78,0xc9))[_0x1f7e('0x47')](handleError(_0x524c78,null));};exports[_0x1f7e('0x52')]=function(_0x427a4f,_0x17d528){if(_0x427a4f[_0x1f7e('0x4b')]['id']){delete _0x427a4f[_0x1f7e('0x4b')]['id'];}return db[_0x1f7e('0x2c')][_0x1f7e('0x49')]({'where':{'id':_0x427a4f['params']['id']}})['then'](handleEntityNotFound(_0x17d528,null))[_0x1f7e('0x26')](saveUpdates(_0x427a4f['body'],null))['then'](respondWithResult(_0x17d528,null))[_0x1f7e('0x47')](handleError(_0x17d528,null));};exports['destroy']=function(_0x28d124,_0x5176df){return db[_0x1f7e('0x2c')][_0x1f7e('0x49')]({'where':{'id':_0x28d124['params']['id']}})['then'](handleEntityNotFound(_0x5176df,null))['then'](removeEntity(_0x5176df,null))['catch'](handleError(_0x5176df,null));};exports[_0x1f7e('0x53')]=function(_0x5dcdda,_0x3ad11c){var _0x103513=0xa;var _0x141669=[_0x1f7e('0x54'),_0x1f7e('0x55'),'right_join','cross_join'];var _0xad2c04={'SUM':_0x1f7e('0x56'),'COUNT':_0x1f7e('0x57'),'COUNT DISTINCT':_0x1f7e('0x58'),'MAX':_0x1f7e('0x59'),'MIN':_0x1f7e('0x5a'),'AVG':_0x1f7e('0x5b'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x1f7e('0x5c'),'GROUP_CONCAT DESC':_0x1f7e('0x5d')};var _0x266178={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x1f7e('0x5e'),'HOUR':_0x1f7e('0x5f'),'ROUND':_0x1f7e('0x60'),'UNIX_TIMESTAMP':_0x1f7e('0x61')};var _0x56d58b=function(_0x2228e6){return!_[_0x1f7e('0x62')]([_0x1f7e('0x63'),_0x1f7e('0x64'),_0x1f7e('0x65'),_0x1f7e('0x66')],_0x2228e6);};var _0x333eb6=function(_0x323eef){if(!_0x323eef||!_0x323eef[_0x1f7e('0x67')][_0x1f7e('0x37')]){return'';}for(var _0x484c52='(',_0x2e3ec3=0x0;_0x2e3ec3<_0x323eef[_0x1f7e('0x67')][_0x1f7e('0x37')];_0x2e3ec3+=0x1){_0x2e3ec3>0x0&&(_0x484c52+='\x20'+_0x323eef[_0x1f7e('0x68')]+'\x20');_0x484c52+=_0x323eef[_0x1f7e('0x67')][_0x2e3ec3][_0x1f7e('0x69')]?_0x333eb6(_0x323eef[_0x1f7e('0x67')][_0x2e3ec3][_0x1f7e('0x69')]):_0x323eef[_0x1f7e('0x67')][_0x2e3ec3]['field']+'\x20'+_0x323eef['rules'][_0x2e3ec3][_0x1f7e('0x6a')]+(_0x56d58b(_0x323eef['rules'][_0x2e3ec3][_0x1f7e('0x6a')])?'\x20'+_0x323eef[_0x1f7e('0x67')][_0x2e3ec3][_0x1f7e('0x6b')]:'');}return _0x484c52+')';};var _0x47e6db={'where':{'id':_0x5dcdda[_0x1f7e('0x48')]['id']}},_0x2cb213,_0xa2756,_0x7a0c58,_0x1db4bd,_0x3a1637;_0x47e6db=_[_0x1f7e('0x40')]({},_0x47e6db,_0x5dcdda[_0x1f7e('0x42')]);return db[_0x1f7e('0x2c')][_0x1f7e('0x49')](_0x47e6db)[_0x1f7e('0x26')](function(_0x21ab7f){if(_0x21ab7f){_0x2cb213=_0x21ab7f;return _0x21ab7f[_0x1f7e('0x6c')]();}return null;})[_0x1f7e('0x26')](function(_0x5c9632){if(_0x5c9632){if(!_0x5c9632[_0x1f7e('0x37')]){throw new db[(_0x1f7e('0x6d'))][(_0x1f7e('0x6e'))](_0x1f7e('0x6f'),0x193);}_0xa2756=_0x5c9632;return db[_0x1f7e('0x70')][_0x1f7e('0x45')]({'raw':!![]});}return null;})[_0x1f7e('0x26')](function(_0x10fdd8){if(_0x10fdd8){_0x7a0c58=_[_0x1f7e('0x71')](_0x10fdd8,'id');var _0x49dbd3;var _0x108436=squel[_0x1f7e('0x72')]();_0x108436['from'](_0x2cb213[_0x1f7e('0x73')]);for(var _0x2f8515=0x0;_0x2f8515<_0xa2756[_0x1f7e('0x37')];_0x2f8515+=0x1){_0x49dbd3=_0xa2756[_0x2f8515][_0x1f7e('0x74')]?_0x7a0c58[_0xa2756[_0x2f8515][_0x1f7e('0x74')]][_0x1f7e('0x75')]:_0xa2756[_0x2f8515][_0x1f7e('0x76')];_0x49dbd3=_0xa2756[_0x2f8515]['function']?_[_0x1f7e('0x77')](_0xad2c04[_0xa2756[_0x2f8515][_0x1f7e('0x78')]],'%s',_0x49dbd3):_0x49dbd3;_0x49dbd3=_0xa2756[_0x2f8515][_0x1f7e('0x79')]?_['replace'](_0x266178[_0xa2756[_0x2f8515][_0x1f7e('0x79')]],'%s',_0x49dbd3):_0x49dbd3;if(_0xa2756[_0x2f8515][_0x1f7e('0x7a')]){_0x108436['group'](_0x49dbd3);}_0xa2756[_0x2f8515][_0x1f7e('0x7b')]&&_0x108436[_0x1f7e('0x3b')](_0x49dbd3,_0xa2756[_0x2f8515][_0x1f7e('0x7b')]==='DESC'?![]:!![]);_0x108436['field'](_0x49dbd3,_0xa2756[_0x2f8515]['alias']||_0x49dbd3);}if(_0x2cb213['joins']){_0x2cb213[_0x1f7e('0x7c')]=JSON[_0x1f7e('0x7d')](_0x2cb213[_0x1f7e('0x7c')]);for(var _0x59f384=0x0;_0x59f384<_0x2cb213[_0x1f7e('0x7c')][_0x1f7e('0x37')];_0x59f384+=0x1){if(_0x2cb213['joins'][_0x59f384][_0x1f7e('0x2f')]&&_[_0x1f7e('0x62')](_0x141669,_0x2cb213[_0x1f7e('0x7c')][_0x59f384][_0x1f7e('0x2f')])&&_0x2cb213[_0x1f7e('0x7c')][_0x59f384]['parentKey']&&_0x2cb213[_0x1f7e('0x7c')][_0x59f384][_0x1f7e('0x7e')]&&_0x2cb213['joins'][_0x59f384][_0x1f7e('0x7f')]){_0x108436[_0x2cb213[_0x1f7e('0x7c')][_0x59f384][_0x1f7e('0x2f')]](_0x2cb213[_0x1f7e('0x7c')][_0x59f384]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x2cb213[_0x1f7e('0x73')],_0x2cb213[_0x1f7e('0x7c')][_0x59f384][_0x1f7e('0x80')],_0x2cb213[_0x1f7e('0x7c')][_0x59f384][_0x1f7e('0x7e')],_0x2cb213[_0x1f7e('0x7c')][_0x59f384][_0x1f7e('0x7f')]));}}}if(_0x2cb213['conditions']){_0x2cb213[_0x1f7e('0x81')]=JSON['parse'](_0x2cb213['conditions']);_0x108436[_0x1f7e('0x3f')](_0x333eb6(_0x2cb213[_0x1f7e('0x81')]['group']));}_0x3a1637=_0x108436[_0x1f7e('0x82')]();_0x108436['limit'](_0x103513);_0x108436[_0x1f7e('0x21')](0x0);logger[_0x1f7e('0x83')]('Limited\x20Query:',_0x108436[_0x1f7e('0x84')]());return dbH[_0x1f7e('0x85')][_0x1f7e('0x38')](_0x108436[_0x1f7e('0x84')](),{'type':dbH['sequelize']['QueryTypes'][_0x1f7e('0x86')]});}})[_0x1f7e('0x26')](respondWithResult(_0x3ad11c,null))[_0x1f7e('0x47')](handleError(_0x3ad11c,null));};function runReport(_0x37287a,_0x31274a,_0x3f65cc){var _0x2ec868=_0x31274a[_0x1f7e('0x29')];var _0x698b91=0xa;var _0x81b1e8=[_0x1f7e('0x54'),_0x1f7e('0x55'),_0x1f7e('0x87'),'cross_join'];var _0x245eb9={'SUM':_0x1f7e('0x56'),'COUNT':_0x1f7e('0x57'),'COUNT DISTINCT':_0x1f7e('0x58'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x1f7e('0x5b'),'GROUP_CONCAT':_0x1f7e('0x88'),'GROUP_CONCAT ASC':_0x1f7e('0x5c'),'GROUP_CONCAT DESC':_0x1f7e('0x5d')};var _0x4299e4={'SEC_TO_TIME':_0x1f7e('0x89'),'DATE':'DATE(%s)','HOUR':_0x1f7e('0x5f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x1f7e('0x61')};var _0x4cafbf=function(_0x6d1ad3){return!_[_0x1f7e('0x62')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x1f7e('0x65'),'IS\x20NOT\x20EMPTY'],_0x6d1ad3);};var _0x83c5be=function(_0x118695){if(!_0x118695||!_0x118695[_0x1f7e('0x67')]['length']){return'';}for(var _0x40bd4e='(',_0x4fb672=0x0;_0x4fb672<_0x118695['rules']['length'];_0x4fb672+=0x1){_0x4fb672>0x0&&(_0x40bd4e+='\x20'+_0x118695[_0x1f7e('0x68')]+'\x20');_0x40bd4e+=_0x118695['rules'][_0x4fb672][_0x1f7e('0x69')]?_0x83c5be(_0x118695[_0x1f7e('0x67')][_0x4fb672]['group']):_0x118695[_0x1f7e('0x67')][_0x4fb672][_0x1f7e('0x76')]+'\x20'+_0x118695[_0x1f7e('0x67')][_0x4fb672]['condition']+(_0x4cafbf(_0x118695[_0x1f7e('0x67')][_0x4fb672][_0x1f7e('0x6a')])?'\x20'+_0x118695[_0x1f7e('0x67')][_0x4fb672][_0x1f7e('0x6b')]:'');}return _0x40bd4e+')';};var _0x551bb7={'where':{'id':_0x37287a['id']}},_0x3efbb6,_0x3c338d,_0x366f57,_0x4377aa,_0x5aaadf;_0x551bb7=_[_0x1f7e('0x40')]({},_0x551bb7,_0x3f65cc);return db[_0x1f7e('0x2c')][_0x1f7e('0x49')](_0x551bb7)[_0x1f7e('0x26')](function(_0x56d22e){if(_0x56d22e){_0x3efbb6=_0x56d22e;return _0x56d22e['getFields']();}return null;})[_0x1f7e('0x26')](function(_0x361da3){if(_0x361da3){if(!_0x361da3[_0x1f7e('0x37')]){throw new db[(_0x1f7e('0x6d'))][(_0x1f7e('0x6e'))](_0x1f7e('0x6f'),0x193);}_0x3c338d=_0x361da3;return db[_0x1f7e('0x70')][_0x1f7e('0x45')]({'raw':!![]});}return null;})[_0x1f7e('0x26')](function(_0x47edd2){if(_0x47edd2){_0x366f57=_['keyBy'](_0x47edd2,'id');var _0x407d99;var _0x353a9c=squel[_0x1f7e('0x72')]();_0x353a9c[_0x1f7e('0x8a')](_0x3efbb6[_0x1f7e('0x73')]);for(var _0x29423d=0x0;_0x29423d<_0x3c338d[_0x1f7e('0x37')];_0x29423d+=0x1){_0x407d99=_0x3c338d[_0x29423d][_0x1f7e('0x74')]?_0x366f57[_0x3c338d[_0x29423d]['MetricId']][_0x1f7e('0x75')]:_0x3c338d[_0x29423d][_0x1f7e('0x76')];_0x407d99=_0x3c338d[_0x29423d][_0x1f7e('0x78')]?_[_0x1f7e('0x77')](_0x245eb9[_0x3c338d[_0x29423d][_0x1f7e('0x78')]],'%s',_0x407d99):_0x407d99;_0x407d99=_0x3c338d[_0x29423d][_0x1f7e('0x79')]?_['replace'](_0x4299e4[_0x3c338d[_0x29423d][_0x1f7e('0x79')]],'%s',_0x407d99):_0x407d99;if(_0x3c338d[_0x29423d][_0x1f7e('0x7a')]){_0x353a9c[_0x1f7e('0x69')](_0x407d99);}_0x3c338d[_0x29423d][_0x1f7e('0x7b')]&&_0x353a9c['order'](_0x407d99,_0x3c338d[_0x29423d][_0x1f7e('0x7b')]===_0x1f7e('0x8b')?![]:!![]);_0x353a9c[_0x1f7e('0x76')](_0x407d99,_0x3c338d[_0x29423d]['alias']||_0x407d99);}if(_0x3efbb6['joins']){_0x3efbb6[_0x1f7e('0x7c')]=JSON[_0x1f7e('0x7d')](_0x3efbb6['joins']);for(var _0x31c9b8=0x0;_0x31c9b8<_0x3efbb6[_0x1f7e('0x7c')][_0x1f7e('0x37')];_0x31c9b8+=0x1){if(_0x3efbb6[_0x1f7e('0x7c')][_0x31c9b8][_0x1f7e('0x2f')]&&_[_0x1f7e('0x62')](_0x81b1e8,_0x3efbb6[_0x1f7e('0x7c')][_0x31c9b8][_0x1f7e('0x2f')])&&_0x3efbb6[_0x1f7e('0x7c')][_0x31c9b8]['parentKey']&&_0x3efbb6[_0x1f7e('0x7c')][_0x31c9b8][_0x1f7e('0x7e')]&&_0x3efbb6['joins'][_0x31c9b8][_0x1f7e('0x7f')]){_0x353a9c[_0x3efbb6[_0x1f7e('0x7c')][_0x31c9b8][_0x1f7e('0x2f')]](_0x3efbb6[_0x1f7e('0x7c')][_0x31c9b8][_0x1f7e('0x7e')],null,util[_0x1f7e('0x79')]('%s.%s\x20=\x20%s.%s',_0x3efbb6['table'],_0x3efbb6['joins'][_0x31c9b8][_0x1f7e('0x80')],_0x3efbb6['joins'][_0x31c9b8][_0x1f7e('0x7e')],_0x3efbb6['joins'][_0x31c9b8][_0x1f7e('0x7f')]));}}}if(_0x3efbb6[_0x1f7e('0x81')]){_0x3efbb6[_0x1f7e('0x81')]=JSON[_0x1f7e('0x7d')](_0x3efbb6[_0x1f7e('0x81')]);_0x353a9c[_0x1f7e('0x3f')](_0x83c5be(_0x3efbb6['conditions']['group']));}_0x5aaadf=_0x353a9c[_0x1f7e('0x82')]();_0x353a9c[_0x1f7e('0x1e')](_0x698b91);_0x353a9c[_0x1f7e('0x21')](0x0);return;}})[_0x1f7e('0x26')](function(){if(_0x31274a[_0x1f7e('0x8c')]===_0x1f7e('0x8d')){return null;}var _0x4b6ce3=_[_0x1f7e('0x40')](_0x31274a,{'name':_0x31274a[_0x1f7e('0x8e')]||_0x31274a[_0x1f7e('0x29')]||_0x3efbb6[_0x1f7e('0x29')],'basename':_0x2ec868,'savename':util[_0x1f7e('0x79')](_0x1f7e('0x8f'),_0x31274a[_0x1f7e('0x29')]||_0x3efbb6[_0x1f7e('0x29')],require('randomstring')['generate'](0x4),_0x31274a[_0x1f7e('0x8c')]||_0x1f7e('0x90')),'reportId':_0x3efbb6['id'],'reportType':_0x1f7e('0x91')});return db[_0x1f7e('0x92')][_0x1f7e('0x4a')](_0x4b6ce3,{'raw':!![]});})['then'](function(_0x6226bd){if(_0x3efbb6['table']===_0x1f7e('0x93')){_0x5aaadf[_0x1f7e('0x3f')](_0x3efbb6['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x31274a[_0x1f7e('0x94')],_0x31274a[_0x1f7e('0x95')]);}else{_0x5aaadf[_0x1f7e('0x3f')](_0x3efbb6['table']+_0x1f7e('0x96'),_0x31274a[_0x1f7e('0x94')],_0x31274a[_0x1f7e('0x95')]);}if(_0x6226bd){logger[_0x1f7e('0x97')](_0x1f7e('0x98'),_0x5aaadf[_0x1f7e('0x84')]());require(_0x1f7e('0x99'))[_0x1f7e('0x9a')](path['join'](__dirname,'../../components/export/',_0x6226bd[_0x1f7e('0x8c')]),[_0x6226bd['id'],_0x5aaadf['toString'](),path[_0x1f7e('0x54')](__dirname,_0x1f7e('0x9b'),_0x6226bd['savename']),_0x2ec868]);return _0x6226bd;}else{var _0x37f757=squel['select']();_0x37f757[_0x1f7e('0x8a')]('('+_0x5aaadf[_0x1f7e('0x84')]()+')',_0x1f7e('0x9c'));_0x37f757['field'](_0x1f7e('0x9d'),_0x1f7e('0x20'));_0x5aaadf[_0x1f7e('0x1e')](_0x31274a['limit']||_0x698b91);_0x5aaadf[_0x1f7e('0x21')](_0x31274a[_0x1f7e('0x21')]||0x0);return dbH[_0x1f7e('0x85')]['query'](_0x37f757[_0x1f7e('0x84')](),{'type':dbH[_0x1f7e('0x85')][_0x1f7e('0x9e')]['SELECT']})[_0x1f7e('0x26')](function(_0x48503c){if(!_0x48503c['length']){_0x4377aa=0x0;}else{_0x4377aa=_0x48503c[0x0]['count']||0x0;}return dbH['sequelize'][_0x1f7e('0x38')](_0x5aaadf[_0x1f7e('0x84')](),{'type':dbH[_0x1f7e('0x85')][_0x1f7e('0x9e')][_0x1f7e('0x86')]});})['then'](function(_0x2f5fe6){return{'rows':_0x2f5fe6||[],'count':_0x4377aa};});}});}exports[_0x1f7e('0x9f')]=function(_0x289066,_0x450c9b){return runReport(_0x289066[_0x1f7e('0x48')],_0x289066[_0x1f7e('0x38')],_0x289066[_0x1f7e('0x42')])[_0x1f7e('0x26')](respondWithResult(_0x450c9b,null))[_0x1f7e('0x47')](handleError(_0x450c9b,null));};exports[_0x1f7e('0xa0')]=runReport;exports['query']=function(_0x50e18a,_0x3fe8d4){var _0x2f3173=0xa;var _0x3ea287=['join',_0x1f7e('0x55'),_0x1f7e('0x87'),_0x1f7e('0xa1')];var _0x5266ff={'SUM':'SUM(%s)','COUNT':_0x1f7e('0x57'),'COUNT DISTINCT':_0x1f7e('0x58'),'MAX':_0x1f7e('0x59'),'MIN':_0x1f7e('0x5a'),'AVG':_0x1f7e('0x5b'),'GROUP_CONCAT':_0x1f7e('0x88'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x1f7e('0x5d')};var _0xe2ed3c={'SEC_TO_TIME':_0x1f7e('0x89'),'DATE':_0x1f7e('0x5e'),'HOUR':_0x1f7e('0x5f'),'ROUND':_0x1f7e('0x60'),'UNIX_TIMESTAMP':_0x1f7e('0x61')};var _0x18947a=function(_0x2defa0){return!_[_0x1f7e('0x62')]([_0x1f7e('0x63'),_0x1f7e('0x64'),_0x1f7e('0x65'),'IS\x20NOT\x20EMPTY'],_0x2defa0);};var _0x470bb9=function(_0x10d3c7){if(!_0x10d3c7||!_0x10d3c7['rules']['length']){return'';}for(var _0x397c82='(',_0x81e232=0x0;_0x81e232<_0x10d3c7['rules'][_0x1f7e('0x37')];_0x81e232+=0x1){_0x81e232>0x0&&(_0x397c82+='\x20'+_0x10d3c7[_0x1f7e('0x68')]+'\x20');_0x397c82+=_0x10d3c7[_0x1f7e('0x67')][_0x81e232][_0x1f7e('0x69')]?_0x470bb9(_0x10d3c7[_0x1f7e('0x67')][_0x81e232][_0x1f7e('0x69')]):_0x10d3c7['rules'][_0x81e232][_0x1f7e('0x76')]+'\x20'+_0x10d3c7[_0x1f7e('0x67')][_0x81e232]['condition']+(_0x18947a(_0x10d3c7[_0x1f7e('0x67')][_0x81e232][_0x1f7e('0x6a')])?'\x20'+_0x10d3c7[_0x1f7e('0x67')][_0x81e232][_0x1f7e('0x6b')]:'');}return _0x397c82+')';};var _0x3660b6={'where':{'id':_0x50e18a[_0x1f7e('0x48')]['id']}},_0x2de0aa,_0x493a9d,_0x4aa420,_0x5231ae,_0x3b646c;_0x3660b6=_['merge']({},_0x3660b6,_0x50e18a['options']);return db[_0x1f7e('0x2c')]['find'](_0x3660b6)['then'](function(_0x16dd79){if(_0x16dd79){_0x2de0aa=_0x16dd79;return _0x16dd79[_0x1f7e('0x6c')]();}return null;})['then'](function(_0x1d1672){if(_0x1d1672){if(!_0x1d1672[_0x1f7e('0x37')]){throw new db[(_0x1f7e('0x6d'))][(_0x1f7e('0x6e'))](_0x1f7e('0x6f'),0x193);}_0x493a9d=_0x1d1672;return db[_0x1f7e('0x70')][_0x1f7e('0x45')]({'raw':!![]});}return null;})[_0x1f7e('0x26')](function(_0x5303c0){if(_0x5303c0){_0x4aa420=_['keyBy'](_0x5303c0,'id');var _0x21ffe7;var _0x31396a=squel[_0x1f7e('0x72')]();_0x31396a[_0x1f7e('0x8a')](_0x2de0aa['table']);for(var _0x3ea907=0x0;_0x3ea907<_0x493a9d[_0x1f7e('0x37')];_0x3ea907+=0x1){_0x21ffe7=_0x493a9d[_0x3ea907][_0x1f7e('0x74')]?_0x4aa420[_0x493a9d[_0x3ea907][_0x1f7e('0x74')]][_0x1f7e('0x75')]:_0x493a9d[_0x3ea907][_0x1f7e('0x76')];_0x21ffe7=_0x493a9d[_0x3ea907][_0x1f7e('0x78')]?_['replace'](_0x5266ff[_0x493a9d[_0x3ea907][_0x1f7e('0x78')]],'%s',_0x21ffe7):_0x21ffe7;_0x21ffe7=_0x493a9d[_0x3ea907]['format']?_['replace'](_0xe2ed3c[_0x493a9d[_0x3ea907][_0x1f7e('0x79')]],'%s',_0x21ffe7):_0x21ffe7;if(_0x493a9d[_0x3ea907][_0x1f7e('0x7a')]){_0x31396a[_0x1f7e('0x69')](_0x21ffe7);}_0x493a9d[_0x3ea907][_0x1f7e('0x7b')]&&_0x31396a[_0x1f7e('0x3b')](_0x21ffe7,_0x493a9d[_0x3ea907][_0x1f7e('0x7b')]==='DESC'?![]:!![]);_0x31396a[_0x1f7e('0x76')](_0x21ffe7,_0x493a9d[_0x3ea907]['alias']||_0x21ffe7);}if(_0x2de0aa[_0x1f7e('0x7c')]){_0x2de0aa[_0x1f7e('0x7c')]=JSON[_0x1f7e('0x7d')](_0x2de0aa[_0x1f7e('0x7c')]);for(var _0x155245=0x0;_0x155245<_0x2de0aa[_0x1f7e('0x7c')][_0x1f7e('0x37')];_0x155245+=0x1){if(_0x2de0aa[_0x1f7e('0x7c')][_0x155245][_0x1f7e('0x2f')]&&_[_0x1f7e('0x62')](_0x3ea287,_0x2de0aa[_0x1f7e('0x7c')][_0x155245][_0x1f7e('0x2f')])&&_0x2de0aa[_0x1f7e('0x7c')][_0x155245]['parentKey']&&_0x2de0aa[_0x1f7e('0x7c')][_0x155245][_0x1f7e('0x7e')]&&_0x2de0aa[_0x1f7e('0x7c')][_0x155245][_0x1f7e('0x7f')]){_0x31396a[_0x2de0aa['joins'][_0x155245][_0x1f7e('0x2f')]](_0x2de0aa[_0x1f7e('0x7c')][_0x155245][_0x1f7e('0x7e')],null,util[_0x1f7e('0x79')](_0x1f7e('0xa2'),_0x2de0aa['table'],_0x2de0aa[_0x1f7e('0x7c')][_0x155245][_0x1f7e('0x80')],_0x2de0aa[_0x1f7e('0x7c')][_0x155245][_0x1f7e('0x7e')],_0x2de0aa['joins'][_0x155245][_0x1f7e('0x7f')]));}}}if(_0x2de0aa['conditions']){_0x2de0aa[_0x1f7e('0x81')]=JSON[_0x1f7e('0x7d')](_0x2de0aa[_0x1f7e('0x81')]);_0x31396a['where'](_0x470bb9(_0x2de0aa[_0x1f7e('0x81')]['group']));}_0x3b646c=_0x31396a[_0x1f7e('0x82')]();_0x31396a[_0x1f7e('0x1e')](_0x2f3173);_0x31396a[_0x1f7e('0x21')](0x0);logger[_0x1f7e('0x83')]('Limited\x20Query:',_0x31396a['toString']());return dbH[_0x1f7e('0x85')][_0x1f7e('0x38')](_0x31396a[_0x1f7e('0x84')](),{'type':dbH['sequelize']['QueryTypes'][_0x1f7e('0x86')]});}})['then'](function(){return{'sql':_0x3b646c[_0x1f7e('0x84')]()};})[_0x1f7e('0x26')](respondWithResult(_0x3fe8d4,null))[_0x1f7e('0x47')](handleError(_0x3fe8d4,null));}; \ No newline at end of file +var _0xd96c=['fork','../../components/export/','../../files/reports','savename','COUNT(*)','run','runReport','SUM(%s)','DATE(%s)','keyBy','Limited\x20Query:','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','dbH','end','status','json','offset','undefined','limit','count','set','reject','update','get','CustomReports','then','sendStatus','stack','name','send','index','map','fieldName','key','model','query','keys','filters','intersection','attributes','fields','order','sort','where','pick','merge','type','filter','options','AnalyticCustomReport','includeAll','findAll','catch','show','params','rawAttributes','length','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','join','right_join','cross_join','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','from','table','MetricId','metric','function','replace','format','orderBy','DESC','alias','parse','joins','parentKey','foreignTable','foreignKey','conditions','debug','sequelize','toString','QueryTypes','SELECT','left_join','COUNT(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','ValidationErrorItem','AnalyticMetric','select','groupBy','%s.%s\x20=\x20%s.%s','clone','output','fullPath','%s-%s.%s','randomstring','generate','custom','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process'];(function(_0x1f2d4f,_0x2e0a79){var _0x15c51=function(_0x5b460e){while(--_0x5b460e){_0x1f2d4f['push'](_0x1f2d4f['shift']());}};_0x15c51(++_0x2e0a79);}(_0xd96c,0xaf));var _0xcd96=function(_0x57b786,_0x22db7a){_0x57b786=_0x57b786-0x0;var _0x248894=_0xd96c[_0x57b786];return _0x248894;};'use strict';var emlformat=require(_0xcd96('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcd96('0x1'));var jsonpatch=require(_0xcd96('0x2'));var rp=require(_0xcd96('0x3'));var moment=require(_0xcd96('0x4'));var BPromise=require(_0xcd96('0x5'));var Mustache=require('mustache');var util=require(_0xcd96('0x6'));var path=require(_0xcd96('0x7'));var sox=require(_0xcd96('0x8'));var csv=require(_0xcd96('0x9'));var ejs=require(_0xcd96('0xa'));var fs=require('fs');var fs_extra=require(_0xcd96('0xb'));var _=require('lodash');var squel=require(_0xcd96('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xcd96('0x9'));var querystring=require(_0xcd96('0xd'));var Papa=require(_0xcd96('0xe'));var Redis=require(_0xcd96('0xf'));var authService=require(_0xcd96('0x10'));var qs=require(_0xcd96('0x11'));var as=require(_0xcd96('0x12'));var hardwareService=require(_0xcd96('0x13'));var logger=require(_0xcd96('0x14'))(_0xcd96('0x15'));var utils=require('../../config/utils');var config=require(_0xcd96('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xcd96('0x17'))['db'];var dbH=require(_0xcd96('0x17'))[_0xcd96('0x18')];function respondWithStatusCode(_0x1fa625,_0x57d9c2){_0x57d9c2=_0x57d9c2||0xcc;return function(_0x14d51c){if(_0x14d51c){return _0x1fa625['sendStatus'](_0x57d9c2);}return _0x1fa625['status'](_0x57d9c2)[_0xcd96('0x19')]();};}function respondWithResult(_0x47b2fa,_0x5aff48){_0x5aff48=_0x5aff48||0xc8;return function(_0x4d3fab){if(_0x4d3fab){return _0x47b2fa[_0xcd96('0x1a')](_0x5aff48)[_0xcd96('0x1b')](_0x4d3fab);}};}function respondWithFilteredResult(_0x33eecf,_0x138a1e){return function(_0xc57496){if(_0xc57496){var _0x3d7d87=typeof _0x138a1e[_0xcd96('0x1c')]===_0xcd96('0x1d')&&typeof _0x138a1e[_0xcd96('0x1e')]===_0xcd96('0x1d');var _0x34b229=_0xc57496['count'];var _0x495489=_0x3d7d87?0x0:_0x138a1e['offset'];var _0x34e560=_0x3d7d87?_0xc57496[_0xcd96('0x1f')]:_0x138a1e['offset']+_0x138a1e['limit'];var _0x3ab39a;if(_0x34e560>=_0x34b229){_0x34e560=_0x34b229;_0x3ab39a=0xc8;}else{_0x3ab39a=0xce;}_0x33eecf[_0xcd96('0x1a')](_0x3ab39a);return _0x33eecf[_0xcd96('0x20')]('Content-Range',_0x495489+'-'+_0x34e560+'/'+_0x34b229)[_0xcd96('0x1b')](_0xc57496);}return null;};}function patchUpdates(_0x273d29){return function(_0x4ff36c){try{jsonpatch['apply'](_0x4ff36c,_0x273d29,!![]);}catch(_0x2de363){return BPromise[_0xcd96('0x21')](_0x2de363);}return _0x4ff36c['save']();};}function saveUpdates(_0x468a24,_0x483347){return function(_0x2d0a54){if(_0x2d0a54){return _0x2d0a54[_0xcd96('0x22')](_0x468a24)['then'](function(_0x26a604){return _0x26a604;});}return null;};}function removeEntity(_0xe6a001,_0x27cc93){return function(_0x265d7f){if(_0x265d7f){return _0x265d7f['destroy']()['then'](function(){var _0x49c64d=_0x265d7f[_0xcd96('0x23')]({'plain':!![]});var _0x5b8560=_0xcd96('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x5b8560,'resourceId':_0x49c64d['id']}})[_0xcd96('0x25')](function(){return _0x265d7f;});})['then'](function(){_0xe6a001[_0xcd96('0x1a')](0xcc)[_0xcd96('0x19')]();});}};}function handleEntityNotFound(_0x2e1971,_0xda8143){return function(_0x4671f2){if(!_0x4671f2){_0x2e1971[_0xcd96('0x26')](0x194);}return _0x4671f2;};}function handleError(_0x55bc59,_0x199995){_0x199995=_0x199995||0x1f4;return function(_0x11b0a1){logger['error'](_0x11b0a1[_0xcd96('0x27')]);if(_0x11b0a1[_0xcd96('0x28')]){delete _0x11b0a1[_0xcd96('0x28')];}_0x55bc59[_0xcd96('0x1a')](_0x199995)[_0xcd96('0x29')](_0x11b0a1);};}exports[_0xcd96('0x2a')]=function(_0x457135,_0x34f1dd){var _0x5f317d={},_0x1d5c3a={},_0x5c8140={'count':0x0,'rows':[]};var _0x5000a9=_[_0xcd96('0x2b')](db['AnalyticCustomReport']['rawAttributes'],function(_0x5b6587){return{'name':_0x5b6587[_0xcd96('0x2c')],'type':_0x5b6587['type'][_0xcd96('0x2d')]};});_0x1d5c3a[_0xcd96('0x2e')]=_[_0xcd96('0x2b')](_0x5000a9,_0xcd96('0x28'));_0x1d5c3a[_0xcd96('0x2f')]=_[_0xcd96('0x30')](_0x457135['query']);_0x1d5c3a[_0xcd96('0x31')]=_[_0xcd96('0x32')](_0x1d5c3a[_0xcd96('0x2e')],_0x1d5c3a[_0xcd96('0x2f')]);_0x5f317d[_0xcd96('0x33')]=_[_0xcd96('0x32')](_0x1d5c3a[_0xcd96('0x2e')],qs[_0xcd96('0x34')](_0x457135[_0xcd96('0x2f')]['fields']));_0x5f317d[_0xcd96('0x33')]=_0x5f317d[_0xcd96('0x33')]['length']?_0x5f317d[_0xcd96('0x33')]:_0x1d5c3a[_0xcd96('0x2e')];if(!_0x457135[_0xcd96('0x2f')]['hasOwnProperty']('nolimit')){_0x5f317d[_0xcd96('0x1e')]=qs[_0xcd96('0x1e')](_0x457135[_0xcd96('0x2f')][_0xcd96('0x1e')]);_0x5f317d[_0xcd96('0x1c')]=qs[_0xcd96('0x1c')](_0x457135[_0xcd96('0x2f')][_0xcd96('0x1c')]);}_0x5f317d[_0xcd96('0x35')]=qs[_0xcd96('0x36')](_0x457135[_0xcd96('0x2f')]['sort']);_0x5f317d[_0xcd96('0x37')]=qs[_0xcd96('0x31')](_[_0xcd96('0x38')](_0x457135[_0xcd96('0x2f')],_0x1d5c3a['filters']),_0x5000a9);if(_0x457135[_0xcd96('0x2f')]['filter']){_0x5f317d[_0xcd96('0x37')]=_[_0xcd96('0x39')](_0x5f317d['where'],{'$or':_[_0xcd96('0x2b')](_0x5000a9,function(_0x198cce){if(_0x198cce[_0xcd96('0x3a')]!=='VIRTUAL'){var _0x257cd0={};_0x257cd0[_0x198cce[_0xcd96('0x28')]]={'$like':'%'+_0x457135[_0xcd96('0x2f')][_0xcd96('0x3b')]+'%'};return _0x257cd0;}})});}_0x5f317d=_['merge']({},_0x5f317d,_0x457135[_0xcd96('0x3c')]);var _0x40e1d6={'where':_0x5f317d[_0xcd96('0x37')]};return db[_0xcd96('0x3d')]['count'](_0x40e1d6)[_0xcd96('0x25')](function(_0x10abc2){_0x5c8140[_0xcd96('0x1f')]=_0x10abc2;if(_0x457135[_0xcd96('0x2f')][_0xcd96('0x3e')]){_0x5f317d['include']=[{'all':!![]}];}return db[_0xcd96('0x3d')][_0xcd96('0x3f')](_0x5f317d);})[_0xcd96('0x25')](function(_0x731c5){_0x5c8140['rows']=_0x731c5;return _0x5c8140;})[_0xcd96('0x25')](respondWithFilteredResult(_0x34f1dd,_0x5f317d))[_0xcd96('0x40')](handleError(_0x34f1dd,null));};exports[_0xcd96('0x41')]=function(_0x13697,_0x2e66e2){var _0x189d9a={'raw':![],'where':{'id':_0x13697[_0xcd96('0x42')]['id']}},_0x50f398={};_0x50f398['model']=_[_0xcd96('0x30')](db[_0xcd96('0x3d')][_0xcd96('0x43')]);_0x50f398['query']=_[_0xcd96('0x30')](_0x13697[_0xcd96('0x2f')]);_0x50f398['filters']=_[_0xcd96('0x32')](_0x50f398[_0xcd96('0x2e')],_0x50f398[_0xcd96('0x2f')]);_0x189d9a['attributes']=_[_0xcd96('0x32')](_0x50f398['model'],qs[_0xcd96('0x34')](_0x13697[_0xcd96('0x2f')][_0xcd96('0x34')]));_0x189d9a['attributes']=_0x189d9a[_0xcd96('0x33')][_0xcd96('0x44')]?_0x189d9a['attributes']:_0x50f398[_0xcd96('0x2e')];if(_0x13697[_0xcd96('0x2f')][_0xcd96('0x3e')]){_0x189d9a[_0xcd96('0x45')]=[{'all':!![]}];}_0x189d9a=_[_0xcd96('0x39')]({},_0x189d9a,_0x13697['options']);return db[_0xcd96('0x3d')]['find'](_0x189d9a)['then'](handleEntityNotFound(_0x2e66e2,null))[_0xcd96('0x25')](respondWithResult(_0x2e66e2,null))[_0xcd96('0x40')](handleError(_0x2e66e2,null));};exports[_0xcd96('0x46')]=function(_0x252728,_0x22e0e5){return db[_0xcd96('0x3d')][_0xcd96('0x46')](_0x252728[_0xcd96('0x47')],{})[_0xcd96('0x25')](function(_0x45f52e){var _0x3a37d9=_0x252728[_0xcd96('0x48')]['get']({'plain':!![]});if(!_0x3a37d9)throw new Error(_0xcd96('0x49'));if(_0x3a37d9[_0xcd96('0x4a')]===_0xcd96('0x48')){var _0xc1abd=_0x45f52e[_0xcd96('0x23')]({'plain':!![]});var _0x15d6e7=_0xcd96('0x4b');return db[_0xcd96('0x4c')][_0xcd96('0x4d')]({'where':{'name':_0x15d6e7,'userProfileId':_0x3a37d9[_0xcd96('0x4e')]},'raw':!![]})['then'](function(_0x2ea2ec){if(_0x2ea2ec&&_0x2ea2ec[_0xcd96('0x4f')]===0x0){return db[_0xcd96('0x50')][_0xcd96('0x46')]({'name':_0xc1abd['name'],'resourceId':_0xc1abd['id'],'type':_0xcd96('0x24'),'sectionId':_0x2ea2ec['id']},{})[_0xcd96('0x25')](function(){return _0x45f52e;});}else{return _0x45f52e;}})[_0xcd96('0x40')](function(_0x5bccd6){logger['error'](_0xcd96('0x51'),_0x5bccd6);throw _0x5bccd6;});}return _0x45f52e;})[_0xcd96('0x25')](respondWithResult(_0x22e0e5,0xc9))[_0xcd96('0x40')](handleError(_0x22e0e5,null));};exports['update']=function(_0x20e1af,_0x1b14be){if(_0x20e1af[_0xcd96('0x47')]['id']){delete _0x20e1af[_0xcd96('0x47')]['id'];}return db[_0xcd96('0x3d')][_0xcd96('0x4d')]({'where':{'id':_0x20e1af[_0xcd96('0x42')]['id']}})[_0xcd96('0x25')](handleEntityNotFound(_0x1b14be,null))[_0xcd96('0x25')](saveUpdates(_0x20e1af['body'],null))[_0xcd96('0x25')](respondWithResult(_0x1b14be,null))[_0xcd96('0x40')](handleError(_0x1b14be,null));};exports[_0xcd96('0x52')]=function(_0x273ebc,_0x38e258){return db[_0xcd96('0x3d')][_0xcd96('0x4d')]({'where':{'id':_0x273ebc[_0xcd96('0x42')]['id']}})[_0xcd96('0x25')](handleEntityNotFound(_0x38e258,null))['then'](removeEntity(_0x38e258,null))['catch'](handleError(_0x38e258,null));};exports['preview']=function(_0x3c156b,_0x5cdc98){var _0x3655b7=0xa;var _0x130455=[_0xcd96('0x53'),'left_join',_0xcd96('0x54'),_0xcd96('0x55')];var _0x17a9b4={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xcd96('0x56'),'MAX':_0xcd96('0x57'),'MIN':_0xcd96('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xcd96('0x59'),'GROUP_CONCAT ASC':_0xcd96('0x5a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x102424={'SEC_TO_TIME':_0xcd96('0x5b'),'DATE':'DATE(%s)','HOUR':_0xcd96('0x5c'),'ROUND':_0xcd96('0x5d'),'UNIX_TIMESTAMP':_0xcd96('0x5e')};var _0x18c3c9=function(_0xdc681b){return!_[_0xcd96('0x5f')]([_0xcd96('0x60'),_0xcd96('0x61'),_0xcd96('0x62'),_0xcd96('0x63')],_0xdc681b);};var _0x2f4d87=function(_0x30f228){if(!_0x30f228||!_0x30f228[_0xcd96('0x64')]['length']){return'';}for(var _0x4c4312='(',_0x151df6=0x0;_0x151df6<_0x30f228[_0xcd96('0x64')]['length'];_0x151df6+=0x1){_0x151df6>0x0&&(_0x4c4312+='\x20'+_0x30f228[_0xcd96('0x65')]+'\x20');_0x4c4312+=_0x30f228[_0xcd96('0x64')][_0x151df6]['group']?_0x2f4d87(_0x30f228[_0xcd96('0x64')][_0x151df6][_0xcd96('0x66')]):_0x30f228[_0xcd96('0x64')][_0x151df6][_0xcd96('0x67')]+'\x20'+_0x30f228[_0xcd96('0x64')][_0x151df6][_0xcd96('0x68')]+(_0x18c3c9(_0x30f228['rules'][_0x151df6][_0xcd96('0x68')])?'\x20'+_0x30f228['rules'][_0x151df6][_0xcd96('0x69')]:'');}return _0x4c4312+')';};var _0x256e30={'where':{'id':_0x3c156b['params']['id']}},_0x3c69ca,_0x309ea4,_0x338d17,_0x5be174,_0x321403;_0x256e30=_['merge']({},_0x256e30,_0x3c156b[_0xcd96('0x3c')]);return db[_0xcd96('0x3d')][_0xcd96('0x4d')](_0x256e30)[_0xcd96('0x25')](function(_0x51c73f){if(_0x51c73f){_0x3c69ca=_0x51c73f;return _0x51c73f[_0xcd96('0x6a')]();}return null;})[_0xcd96('0x25')](function(_0x54048c){if(_0x54048c){if(!_0x54048c['length']){throw new db[(_0xcd96('0x6b'))]['ValidationErrorItem'](_0xcd96('0x6c'),0x193);}_0x309ea4=_0x54048c;return db['AnalyticMetric'][_0xcd96('0x3f')]({'raw':!![]});}return null;})[_0xcd96('0x25')](function(_0x3e3f10){if(_0x3e3f10){_0x338d17=_['keyBy'](_0x3e3f10,'id');var _0x701a34;var _0x5bd67c=squel['select']();_0x5bd67c[_0xcd96('0x6d')](_0x3c69ca[_0xcd96('0x6e')]);for(var _0x484d46=0x0;_0x484d46<_0x309ea4[_0xcd96('0x44')];_0x484d46+=0x1){_0x701a34=_0x309ea4[_0x484d46][_0xcd96('0x6f')]?_0x338d17[_0x309ea4[_0x484d46][_0xcd96('0x6f')]][_0xcd96('0x70')]:_0x309ea4[_0x484d46]['field'];_0x701a34=_0x309ea4[_0x484d46][_0xcd96('0x71')]?_[_0xcd96('0x72')](_0x17a9b4[_0x309ea4[_0x484d46][_0xcd96('0x71')]],'%s',_0x701a34):_0x701a34;_0x701a34=_0x309ea4[_0x484d46]['format']?_['replace'](_0x102424[_0x309ea4[_0x484d46][_0xcd96('0x73')]],'%s',_0x701a34):_0x701a34;if(_0x309ea4[_0x484d46]['groupBy']){_0x5bd67c[_0xcd96('0x66')](_0x701a34);}_0x309ea4[_0x484d46][_0xcd96('0x74')]&&_0x5bd67c[_0xcd96('0x35')](_0x701a34,_0x309ea4[_0x484d46][_0xcd96('0x74')]===_0xcd96('0x75')?![]:!![]);_0x5bd67c[_0xcd96('0x67')](_0x701a34,_0x309ea4[_0x484d46][_0xcd96('0x76')]||_0x701a34);}if(_0x3c69ca['joins']){_0x3c69ca['joins']=JSON[_0xcd96('0x77')](_0x3c69ca[_0xcd96('0x78')]);for(var _0x22d00e=0x0;_0x22d00e<_0x3c69ca[_0xcd96('0x78')][_0xcd96('0x44')];_0x22d00e+=0x1){if(_0x3c69ca['joins'][_0x22d00e]['type']&&_[_0xcd96('0x5f')](_0x130455,_0x3c69ca[_0xcd96('0x78')][_0x22d00e]['type'])&&_0x3c69ca['joins'][_0x22d00e][_0xcd96('0x79')]&&_0x3c69ca['joins'][_0x22d00e][_0xcd96('0x7a')]&&_0x3c69ca[_0xcd96('0x78')][_0x22d00e][_0xcd96('0x7b')]){_0x5bd67c[_0x3c69ca[_0xcd96('0x78')][_0x22d00e][_0xcd96('0x3a')]](_0x3c69ca['joins'][_0x22d00e][_0xcd96('0x7a')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3c69ca[_0xcd96('0x6e')],_0x3c69ca[_0xcd96('0x78')][_0x22d00e][_0xcd96('0x79')],_0x3c69ca[_0xcd96('0x78')][_0x22d00e][_0xcd96('0x7a')],_0x3c69ca[_0xcd96('0x78')][_0x22d00e]['foreignKey']));}}}if(_0x3c69ca[_0xcd96('0x7c')]){_0x3c69ca['conditions']=JSON['parse'](_0x3c69ca[_0xcd96('0x7c')]);_0x5bd67c[_0xcd96('0x37')](_0x2f4d87(_0x3c69ca[_0xcd96('0x7c')]['group']));}_0x321403=_0x5bd67c['clone']();_0x5bd67c[_0xcd96('0x1e')](_0x3655b7);_0x5bd67c['offset'](0x0);logger[_0xcd96('0x7d')]('Limited\x20Query:',_0x5bd67c['toString']());return dbH[_0xcd96('0x7e')]['query'](_0x5bd67c[_0xcd96('0x7f')](),{'type':dbH[_0xcd96('0x7e')][_0xcd96('0x80')][_0xcd96('0x81')]});}})['then'](respondWithResult(_0x5cdc98,null))[_0xcd96('0x40')](handleError(_0x5cdc98,null));};function runReport(_0x109358,_0xca2a3d,_0x4c754e){var _0x1e03c9=_0xca2a3d[_0xcd96('0x28')];var _0x35650d=0xa;var _0x103004=[_0xcd96('0x53'),_0xcd96('0x82'),'right_join',_0xcd96('0x55')];var _0x13a182={'SUM':'SUM(%s)','COUNT':_0xcd96('0x83'),'COUNT DISTINCT':_0xcd96('0x56'),'MAX':_0xcd96('0x57'),'MIN':_0xcd96('0x58'),'AVG':_0xcd96('0x84'),'GROUP_CONCAT':_0xcd96('0x59'),'GROUP_CONCAT ASC':_0xcd96('0x5a'),'GROUP_CONCAT DESC':_0xcd96('0x85')};var _0x23d846={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xcd96('0x5c'),'ROUND':_0xcd96('0x5d'),'UNIX_TIMESTAMP':_0xcd96('0x5e')};var _0xd8c673=function(_0x3b0775){return!_[_0xcd96('0x5f')]([_0xcd96('0x60'),_0xcd96('0x61'),_0xcd96('0x62'),_0xcd96('0x63')],_0x3b0775);};var _0x34fb39=function(_0xf01f01){if(!_0xf01f01||!_0xf01f01['rules']['length']){return'';}for(var _0x4031f1='(',_0x4e979b=0x0;_0x4e979b<_0xf01f01[_0xcd96('0x64')][_0xcd96('0x44')];_0x4e979b+=0x1){_0x4e979b>0x0&&(_0x4031f1+='\x20'+_0xf01f01[_0xcd96('0x65')]+'\x20');_0x4031f1+=_0xf01f01[_0xcd96('0x64')][_0x4e979b][_0xcd96('0x66')]?_0x34fb39(_0xf01f01[_0xcd96('0x64')][_0x4e979b][_0xcd96('0x66')]):_0xf01f01[_0xcd96('0x64')][_0x4e979b][_0xcd96('0x67')]+'\x20'+_0xf01f01[_0xcd96('0x64')][_0x4e979b][_0xcd96('0x68')]+(_0xd8c673(_0xf01f01['rules'][_0x4e979b][_0xcd96('0x68')])?'\x20'+_0xf01f01['rules'][_0x4e979b][_0xcd96('0x69')]:'');}return _0x4031f1+')';};var _0x5ea8b3={'where':{'id':_0x109358['id']}},_0x46bab5,_0x5a2447,_0x58c697,_0x4f7ebe,_0x2c29de;_0x5ea8b3=_['merge']({},_0x5ea8b3,_0x4c754e);return db[_0xcd96('0x3d')][_0xcd96('0x4d')](_0x5ea8b3)[_0xcd96('0x25')](function(_0x3dcbf6){if(_0x3dcbf6){_0x46bab5=_0x3dcbf6;return _0x3dcbf6[_0xcd96('0x6a')]();}return null;})[_0xcd96('0x25')](function(_0x47daab){if(_0x47daab){if(!_0x47daab['length']){throw new db[(_0xcd96('0x6b'))][(_0xcd96('0x86'))](_0xcd96('0x6c'),0x193);}_0x5a2447=_0x47daab;return db[_0xcd96('0x87')][_0xcd96('0x3f')]({'raw':!![]});}return null;})[_0xcd96('0x25')](function(_0xf51f37){if(_0xf51f37){_0x58c697=_['keyBy'](_0xf51f37,'id');var _0x4305e7;var _0x51a595=squel[_0xcd96('0x88')]();_0x51a595[_0xcd96('0x6d')](_0x46bab5[_0xcd96('0x6e')]);for(var _0x2905aa=0x0;_0x2905aa<_0x5a2447[_0xcd96('0x44')];_0x2905aa+=0x1){_0x4305e7=_0x5a2447[_0x2905aa][_0xcd96('0x6f')]?_0x58c697[_0x5a2447[_0x2905aa]['MetricId']][_0xcd96('0x70')]:_0x5a2447[_0x2905aa]['field'];_0x4305e7=_0x5a2447[_0x2905aa][_0xcd96('0x71')]?_[_0xcd96('0x72')](_0x13a182[_0x5a2447[_0x2905aa][_0xcd96('0x71')]],'%s',_0x4305e7):_0x4305e7;_0x4305e7=_0x5a2447[_0x2905aa][_0xcd96('0x73')]?_[_0xcd96('0x72')](_0x23d846[_0x5a2447[_0x2905aa][_0xcd96('0x73')]],'%s',_0x4305e7):_0x4305e7;if(_0x5a2447[_0x2905aa][_0xcd96('0x89')]){_0x51a595[_0xcd96('0x66')](_0x4305e7);}_0x5a2447[_0x2905aa][_0xcd96('0x74')]&&_0x51a595[_0xcd96('0x35')](_0x4305e7,_0x5a2447[_0x2905aa]['orderBy']===_0xcd96('0x75')?![]:!![]);_0x51a595[_0xcd96('0x67')](_0x4305e7,_0x5a2447[_0x2905aa][_0xcd96('0x76')]||_0x4305e7);}if(_0x46bab5[_0xcd96('0x78')]){_0x46bab5[_0xcd96('0x78')]=JSON[_0xcd96('0x77')](_0x46bab5[_0xcd96('0x78')]);for(var _0x11aa28=0x0;_0x11aa28<_0x46bab5[_0xcd96('0x78')][_0xcd96('0x44')];_0x11aa28+=0x1){if(_0x46bab5['joins'][_0x11aa28][_0xcd96('0x3a')]&&_[_0xcd96('0x5f')](_0x103004,_0x46bab5[_0xcd96('0x78')][_0x11aa28][_0xcd96('0x3a')])&&_0x46bab5[_0xcd96('0x78')][_0x11aa28][_0xcd96('0x79')]&&_0x46bab5[_0xcd96('0x78')][_0x11aa28][_0xcd96('0x7a')]&&_0x46bab5[_0xcd96('0x78')][_0x11aa28]['foreignKey']){_0x51a595[_0x46bab5[_0xcd96('0x78')][_0x11aa28][_0xcd96('0x3a')]](_0x46bab5['joins'][_0x11aa28][_0xcd96('0x7a')],null,util['format'](_0xcd96('0x8a'),_0x46bab5['table'],_0x46bab5[_0xcd96('0x78')][_0x11aa28][_0xcd96('0x79')],_0x46bab5[_0xcd96('0x78')][_0x11aa28][_0xcd96('0x7a')],_0x46bab5[_0xcd96('0x78')][_0x11aa28][_0xcd96('0x7b')]));}}}if(_0x46bab5[_0xcd96('0x7c')]){_0x46bab5[_0xcd96('0x7c')]=JSON[_0xcd96('0x77')](_0x46bab5[_0xcd96('0x7c')]);_0x51a595['where'](_0x34fb39(_0x46bab5[_0xcd96('0x7c')][_0xcd96('0x66')]));}_0x2c29de=_0x51a595[_0xcd96('0x8b')]();_0x51a595[_0xcd96('0x1e')](_0x35650d);_0x51a595['offset'](0x0);return;}})[_0xcd96('0x25')](function(){if(_0xca2a3d[_0xcd96('0x8c')]==='web'){return null;}var _0x4e0ec2=_[_0xcd96('0x39')](_0xca2a3d,{'name':_0xca2a3d[_0xcd96('0x8d')]||_0xca2a3d[_0xcd96('0x28')]||_0x46bab5['name'],'basename':_0x1e03c9,'savename':util[_0xcd96('0x73')](_0xcd96('0x8e'),_0xca2a3d[_0xcd96('0x28')]||_0x46bab5[_0xcd96('0x28')],require(_0xcd96('0x8f'))[_0xcd96('0x90')](0x4),_0xca2a3d[_0xcd96('0x8c')]||'csv'),'reportId':_0x46bab5['id'],'reportType':_0xcd96('0x91')});return db[_0xcd96('0x92')][_0xcd96('0x46')](_0x4e0ec2,{'raw':!![]});})['then'](function(_0x509032){if(_0x46bab5[_0xcd96('0x6e')]===_0xcd96('0x93')){_0x2c29de[_0xcd96('0x37')](_0x46bab5[_0xcd96('0x6e')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0xca2a3d[_0xcd96('0x94')],_0xca2a3d[_0xcd96('0x95')]);}else{_0x2c29de[_0xcd96('0x37')](_0x46bab5[_0xcd96('0x6e')]+_0xcd96('0x96'),_0xca2a3d[_0xcd96('0x94')],_0xca2a3d[_0xcd96('0x95')]);}if(_0x509032){logger[_0xcd96('0x97')]('Run\x20Query:',_0x2c29de[_0xcd96('0x7f')]());require(_0xcd96('0x98'))[_0xcd96('0x99')](path['join'](__dirname,_0xcd96('0x9a'),_0x509032[_0xcd96('0x8c')]),[_0x509032['id'],_0x2c29de[_0xcd96('0x7f')](),path[_0xcd96('0x53')](__dirname,_0xcd96('0x9b'),_0x509032[_0xcd96('0x9c')]),_0x1e03c9]);return _0x509032;}else{var _0x3f8feb=squel[_0xcd96('0x88')]();_0x3f8feb['from']('('+_0x2c29de[_0xcd96('0x7f')]()+')','countTable');_0x3f8feb[_0xcd96('0x67')](_0xcd96('0x9d'),_0xcd96('0x1f'));_0x2c29de[_0xcd96('0x1e')](_0xca2a3d[_0xcd96('0x1e')]||_0x35650d);_0x2c29de['offset'](_0xca2a3d[_0xcd96('0x1c')]||0x0);return dbH['sequelize'][_0xcd96('0x2f')](_0x3f8feb[_0xcd96('0x7f')](),{'type':dbH[_0xcd96('0x7e')][_0xcd96('0x80')]['SELECT']})[_0xcd96('0x25')](function(_0x1046d8){if(!_0x1046d8[_0xcd96('0x44')]){_0x4f7ebe=0x0;}else{_0x4f7ebe=_0x1046d8[0x0]['count']||0x0;}return dbH[_0xcd96('0x7e')][_0xcd96('0x2f')](_0x2c29de[_0xcd96('0x7f')](),{'type':dbH[_0xcd96('0x7e')]['QueryTypes'][_0xcd96('0x81')]});})[_0xcd96('0x25')](function(_0x21bb3b){return{'rows':_0x21bb3b||[],'count':_0x4f7ebe};});}});}exports[_0xcd96('0x9e')]=function(_0x4b3e12,_0x2088d){return runReport(_0x4b3e12['params'],_0x4b3e12['query'],_0x4b3e12[_0xcd96('0x3c')])[_0xcd96('0x25')](respondWithResult(_0x2088d,null))['catch'](handleError(_0x2088d,null));};exports[_0xcd96('0x9f')]=runReport;exports[_0xcd96('0x2f')]=function(_0x5c793a,_0x3f2e14){var _0x2841d2=0xa;var _0x23797f=[_0xcd96('0x53'),'left_join',_0xcd96('0x54'),_0xcd96('0x55')];var _0x46858d={'SUM':_0xcd96('0xa0'),'COUNT':_0xcd96('0x83'),'COUNT DISTINCT':_0xcd96('0x56'),'MAX':_0xcd96('0x57'),'MIN':_0xcd96('0x58'),'AVG':_0xcd96('0x84'),'GROUP_CONCAT':_0xcd96('0x59'),'GROUP_CONCAT ASC':_0xcd96('0x5a'),'GROUP_CONCAT DESC':_0xcd96('0x85')};var _0x4c8c0={'SEC_TO_TIME':_0xcd96('0x5b'),'DATE':_0xcd96('0xa1'),'HOUR':_0xcd96('0x5c'),'ROUND':_0xcd96('0x5d'),'UNIX_TIMESTAMP':_0xcd96('0x5e')};var _0x1d530e=function(_0x5f5b27){return!_['includes'](['IS\x20NULL',_0xcd96('0x61'),_0xcd96('0x62'),_0xcd96('0x63')],_0x5f5b27);};var _0x561ba8=function(_0x4a5356){if(!_0x4a5356||!_0x4a5356[_0xcd96('0x64')][_0xcd96('0x44')]){return'';}for(var _0x302211='(',_0x19e089=0x0;_0x19e089<_0x4a5356['rules']['length'];_0x19e089+=0x1){_0x19e089>0x0&&(_0x302211+='\x20'+_0x4a5356[_0xcd96('0x65')]+'\x20');_0x302211+=_0x4a5356[_0xcd96('0x64')][_0x19e089][_0xcd96('0x66')]?_0x561ba8(_0x4a5356['rules'][_0x19e089][_0xcd96('0x66')]):_0x4a5356[_0xcd96('0x64')][_0x19e089][_0xcd96('0x67')]+'\x20'+_0x4a5356[_0xcd96('0x64')][_0x19e089][_0xcd96('0x68')]+(_0x1d530e(_0x4a5356[_0xcd96('0x64')][_0x19e089][_0xcd96('0x68')])?'\x20'+_0x4a5356[_0xcd96('0x64')][_0x19e089][_0xcd96('0x69')]:'');}return _0x302211+')';};var _0x9deef5={'where':{'id':_0x5c793a[_0xcd96('0x42')]['id']}},_0x2d97da,_0x339b40,_0x1ef3cb,_0x25d955,_0x10ea4e;_0x9deef5=_[_0xcd96('0x39')]({},_0x9deef5,_0x5c793a['options']);return db[_0xcd96('0x3d')][_0xcd96('0x4d')](_0x9deef5)['then'](function(_0x395fc5){if(_0x395fc5){_0x2d97da=_0x395fc5;return _0x395fc5[_0xcd96('0x6a')]();}return null;})[_0xcd96('0x25')](function(_0x484acd){if(_0x484acd){if(!_0x484acd[_0xcd96('0x44')]){throw new db[(_0xcd96('0x6b'))][(_0xcd96('0x86'))](_0xcd96('0x6c'),0x193);}_0x339b40=_0x484acd;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xcd96('0x25')](function(_0x3aaeaa){if(_0x3aaeaa){_0x1ef3cb=_[_0xcd96('0xa2')](_0x3aaeaa,'id');var _0x539834;var _0x4c16a8=squel[_0xcd96('0x88')]();_0x4c16a8[_0xcd96('0x6d')](_0x2d97da['table']);for(var _0x2d8a84=0x0;_0x2d8a84<_0x339b40[_0xcd96('0x44')];_0x2d8a84+=0x1){_0x539834=_0x339b40[_0x2d8a84][_0xcd96('0x6f')]?_0x1ef3cb[_0x339b40[_0x2d8a84][_0xcd96('0x6f')]]['metric']:_0x339b40[_0x2d8a84][_0xcd96('0x67')];_0x539834=_0x339b40[_0x2d8a84][_0xcd96('0x71')]?_[_0xcd96('0x72')](_0x46858d[_0x339b40[_0x2d8a84][_0xcd96('0x71')]],'%s',_0x539834):_0x539834;_0x539834=_0x339b40[_0x2d8a84]['format']?_[_0xcd96('0x72')](_0x4c8c0[_0x339b40[_0x2d8a84][_0xcd96('0x73')]],'%s',_0x539834):_0x539834;if(_0x339b40[_0x2d8a84][_0xcd96('0x89')]){_0x4c16a8['group'](_0x539834);}_0x339b40[_0x2d8a84][_0xcd96('0x74')]&&_0x4c16a8[_0xcd96('0x35')](_0x539834,_0x339b40[_0x2d8a84][_0xcd96('0x74')]===_0xcd96('0x75')?![]:!![]);_0x4c16a8[_0xcd96('0x67')](_0x539834,_0x339b40[_0x2d8a84][_0xcd96('0x76')]||_0x539834);}if(_0x2d97da[_0xcd96('0x78')]){_0x2d97da[_0xcd96('0x78')]=JSON[_0xcd96('0x77')](_0x2d97da['joins']);for(var _0x5ced99=0x0;_0x5ced99<_0x2d97da[_0xcd96('0x78')][_0xcd96('0x44')];_0x5ced99+=0x1){if(_0x2d97da[_0xcd96('0x78')][_0x5ced99]['type']&&_[_0xcd96('0x5f')](_0x23797f,_0x2d97da['joins'][_0x5ced99][_0xcd96('0x3a')])&&_0x2d97da[_0xcd96('0x78')][_0x5ced99][_0xcd96('0x79')]&&_0x2d97da[_0xcd96('0x78')][_0x5ced99][_0xcd96('0x7a')]&&_0x2d97da['joins'][_0x5ced99][_0xcd96('0x7b')]){_0x4c16a8[_0x2d97da[_0xcd96('0x78')][_0x5ced99][_0xcd96('0x3a')]](_0x2d97da[_0xcd96('0x78')][_0x5ced99][_0xcd96('0x7a')],null,util[_0xcd96('0x73')](_0xcd96('0x8a'),_0x2d97da['table'],_0x2d97da[_0xcd96('0x78')][_0x5ced99][_0xcd96('0x79')],_0x2d97da[_0xcd96('0x78')][_0x5ced99]['foreignTable'],_0x2d97da['joins'][_0x5ced99][_0xcd96('0x7b')]));}}}if(_0x2d97da[_0xcd96('0x7c')]){_0x2d97da[_0xcd96('0x7c')]=JSON[_0xcd96('0x77')](_0x2d97da[_0xcd96('0x7c')]);_0x4c16a8[_0xcd96('0x37')](_0x561ba8(_0x2d97da[_0xcd96('0x7c')][_0xcd96('0x66')]));}_0x10ea4e=_0x4c16a8[_0xcd96('0x8b')]();_0x4c16a8['limit'](_0x2841d2);_0x4c16a8[_0xcd96('0x1c')](0x0);logger[_0xcd96('0x7d')](_0xcd96('0xa3'),_0x4c16a8['toString']());return dbH[_0xcd96('0x7e')]['query'](_0x4c16a8[_0xcd96('0x7f')](),{'type':dbH[_0xcd96('0x7e')][_0xcd96('0x80')][_0xcd96('0x81')]});}})['then'](function(){return{'sql':_0x10ea4e[_0xcd96('0x7f')]()};})[_0xcd96('0x25')](respondWithResult(_0x3f2e14,null))['catch'](handleError(_0x3f2e14,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index c265b74..c89c85c 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 _0xaed3=['bluebird','request-promise','path','rimraf','./analyticCustomReport.attributes','define','analytics_custom_reports','lodash','util','../../config/logger','moment'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0xaed3,0x75));var _0x3aed=function(_0x7b173,_0x539d7f){_0x7b173=_0x7b173-0x0;var _0x1c598c=_0xaed3[_0x7b173];return _0x1c598c;};'use strict';var _=require(_0x3aed('0x0'));var util=require(_0x3aed('0x1'));var logger=require(_0x3aed('0x2'))('api');var moment=require(_0x3aed('0x3'));var BPromise=require(_0x3aed('0x4'));var rp=require(_0x3aed('0x5'));var fs=require('fs');var path=require(_0x3aed('0x6'));var rimraf=require(_0x3aed('0x7'));var config=require('../../config/environment');var attributes=require(_0x3aed('0x8'));module['exports']=function(_0x4a2e6a,_0x3353cf){return _0x4a2e6a[_0x3aed('0x9')]('AnalyticCustomReport',attributes,{'tableName':_0x3aed('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbf11=['lodash','util','api','bluebird','request-promise','path','../../config/environment','./analyticCustomReport.attributes','exports','define','analytics_custom_reports'];(function(_0x31acc7,_0x168431){var _0x10d549=function(_0x4b5412){while(--_0x4b5412){_0x31acc7['push'](_0x31acc7['shift']());}};_0x10d549(++_0x168431);}(_0xbf11,0x181));var _0x1bf1=function(_0x1ce575,_0xbcf48f){_0x1ce575=_0x1ce575-0x0;var _0x20118a=_0xbf11[_0x1ce575];return _0x20118a;};'use strict';var _=require(_0x1bf1('0x0'));var util=require(_0x1bf1('0x1'));var logger=require('../../config/logger')(_0x1bf1('0x2'));var moment=require('moment');var BPromise=require(_0x1bf1('0x3'));var rp=require(_0x1bf1('0x4'));var fs=require('fs');var path=require(_0x1bf1('0x5'));var rimraf=require('rimraf');var config=require(_0x1bf1('0x6'));var attributes=require(_0x1bf1('0x7'));module[_0x1bf1('0x8')]=function(_0x39807e,_0x5a051d){return _0x39807e[_0x1bf1('0x9')]('AnalyticCustomReport',attributes,{'tableName':_0x1bf1('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index 0051c39..c7ce254 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 _0xae95=['jayson/promise','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','AnalyticCustomReport,\x20%s,\x20%s','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0xfb2fe7,_0x2835dc){var _0x5b8a45=function(_0x4c05be){while(--_0x4c05be){_0xfb2fe7['push'](_0xfb2fe7['shift']());}};_0x5b8a45(++_0x2835dc);}(_0xae95,0x91));var _0x5ae9=function(_0x3286e9,_0x1f0391){_0x3286e9=_0x3286e9-0x0;var _0x3e6ebf=_0xae95[_0x3286e9];return _0x3e6ebf;};'use strict';var _=require(_0x5ae9('0x0'));var util=require(_0x5ae9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5ae9('0x2'));var fs=require('fs');var Redis=require(_0x5ae9('0x3'));var db=require(_0x5ae9('0x4'))['db'];var utils=require(_0x5ae9('0x5'));var logger=require(_0x5ae9('0x6'))(_0x5ae9('0x7'));var config=require(_0x5ae9('0x8'));var jayson=require(_0x5ae9('0x9'));var client=jayson[_0x5ae9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2402ea,_0x195b10,_0xd0fb7b){return new BPromise(function(_0x3747d3,_0x32bbaf){return client[_0x5ae9('0xb')](_0x2402ea,_0xd0fb7b)[_0x5ae9('0xc')](function(_0x582460){logger[_0x5ae9('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x195b10,'request\x20sent');logger['debug'](_0x5ae9('0xe'),_0x195b10,_0x5ae9('0xf'),JSON['stringify'](_0x582460));if(_0x582460['error']){if(_0x582460['error'][_0x5ae9('0x10')]===0x1f4){logger[_0x5ae9('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x195b10,_0x582460[_0x5ae9('0x11')][_0x5ae9('0x12')]);return _0x32bbaf(_0x582460[_0x5ae9('0x11')]['message']);}logger[_0x5ae9('0x11')](_0x5ae9('0x13'),_0x195b10,_0x582460[_0x5ae9('0x11')][_0x5ae9('0x12')]);return _0x3747d3(_0x582460[_0x5ae9('0x11')][_0x5ae9('0x12')]);}else{logger['info'](_0x5ae9('0x13'),_0x195b10,_0x5ae9('0xf'));_0x3747d3(_0x582460[_0x5ae9('0x14')]['message']);}})[_0x5ae9('0x15')](function(_0xb0d159){logger[_0x5ae9('0x11')](_0x5ae9('0x13'),_0x195b10,_0xb0d159);_0x32bbaf(_0xb0d159);});});} \ No newline at end of file +var _0xb845=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s'];(function(_0x2b80e0,_0x2eccc4){var _0x5e8c0d=function(_0x2b2a6c){while(--_0x2b2a6c){_0x2b80e0['push'](_0x2b80e0['shift']());}};_0x5e8c0d(++_0x2eccc4);}(_0xb845,0x13f));var _0x5b84=function(_0x5b8e9f,_0x20def9){_0x5b8e9f=_0x5b8e9f-0x0;var _0x367af0=_0xb845[_0x5b8e9f];return _0x367af0;};'use strict';var _=require(_0x5b84('0x0'));var util=require('util');var moment=require(_0x5b84('0x1'));var BPromise=require(_0x5b84('0x2'));var rs=require(_0x5b84('0x3'));var fs=require('fs');var Redis=require(_0x5b84('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5b84('0x5'))(_0x5b84('0x6'));var config=require(_0x5b84('0x7'));var jayson=require(_0x5b84('0x8'));var client=jayson[_0x5b84('0x9')][_0x5b84('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f2936,_0x5d98a9,_0x453e79){return new BPromise(function(_0x32dce0,_0xd53975){return client[_0x5b84('0xb')](_0x4f2936,_0x453e79)[_0x5b84('0xc')](function(_0x291bf1){logger[_0x5b84('0xd')](_0x5b84('0xe'),_0x5d98a9,_0x5b84('0xf'));logger['debug'](_0x5b84('0x10'),_0x5d98a9,'request\x20sent',JSON['stringify'](_0x291bf1));if(_0x291bf1[_0x5b84('0x11')]){if(_0x291bf1[_0x5b84('0x11')]['code']===0x1f4){logger[_0x5b84('0x11')](_0x5b84('0xe'),_0x5d98a9,_0x291bf1['error'][_0x5b84('0x12')]);return _0xd53975(_0x291bf1[_0x5b84('0x11')][_0x5b84('0x12')]);}logger[_0x5b84('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x5d98a9,_0x291bf1['error']['message']);return _0x32dce0(_0x291bf1['error'][_0x5b84('0x12')]);}else{logger[_0x5b84('0xd')](_0x5b84('0xe'),_0x5d98a9,_0x5b84('0xf'));_0x32dce0(_0x291bf1[_0x5b84('0x13')][_0x5b84('0x12')]);}})[_0x5b84('0x14')](function(_0x49c44d){logger[_0x5b84('0x11')](_0x5b84('0xe'),_0x5d98a9,_0x49c44d);_0xd53975(_0x49c44d);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index cc67639..e2c791c 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 _0x1a1f=['index','get','show','preview','run','query','post','create','put','/:id','update','delete','destroy','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','isAuthenticated'];(function(_0x1c961f,_0x4ef8e2){var _0x13a7e2=function(_0x208d22){while(--_0x208d22){_0x1c961f['push'](_0x1c961f['shift']());}};_0x13a7e2(++_0x4ef8e2);}(_0x1a1f,0x1c6));var _0xf1a1=function(_0x68e3a9,_0x77eb55){_0x68e3a9=_0x68e3a9-0x0;var _0x33b799=_0x1a1f[_0x68e3a9];return _0x33b799;};'use strict';var multer=require(_0xf1a1('0x0'));var util=require('util');var path=require(_0xf1a1('0x1'));var timeout=require('connect-timeout');var express=require(_0xf1a1('0x2'));var router=express['Router']();var fs_extra=require(_0xf1a1('0x3'));var auth=require(_0xf1a1('0x4'));var interaction=require(_0xf1a1('0x5'));var config=require('../../config/environment');var controller=require(_0xf1a1('0x6'));router['get']('/',auth[_0xf1a1('0x7')](),controller[_0xf1a1('0x8')]);router[_0xf1a1('0x9')]('/:id',auth[_0xf1a1('0x7')](),controller[_0xf1a1('0xa')]);router[_0xf1a1('0x9')]('/:id/preview',auth[_0xf1a1('0x7')](),controller[_0xf1a1('0xb')]);router[_0xf1a1('0x9')]('/:id/run',auth[_0xf1a1('0x7')](),controller[_0xf1a1('0xc')]);router[_0xf1a1('0x9')]('/:id/query',auth[_0xf1a1('0x7')](),controller[_0xf1a1('0xd')]);router[_0xf1a1('0xe')]('/',auth[_0xf1a1('0x7')](),controller[_0xf1a1('0xf')]);router[_0xf1a1('0x10')](_0xf1a1('0x11'),auth['isAuthenticated'](),controller[_0xf1a1('0x12')]);router[_0xf1a1('0x13')](_0xf1a1('0x11'),auth[_0xf1a1('0x7')](),controller[_0xf1a1('0x14')]);module[_0xf1a1('0x15')]=router; \ No newline at end of file +var _0x3266=['update','multer','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','get','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x3266,0xe8));var _0x6326=function(_0x1147ab,_0x10e72b){_0x1147ab=_0x1147ab-0x0;var _0x55cb5a=_0x3266[_0x1147ab];return _0x55cb5a;};'use strict';var multer=require(_0x6326('0x0'));var util=require(_0x6326('0x1'));var path=require('path');var timeout=require(_0x6326('0x2'));var express=require('express');var router=express[_0x6326('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6326('0x4'));var config=require(_0x6326('0x5'));var controller=require(_0x6326('0x6'));router['get']('/',auth[_0x6326('0x7')](),controller['index']);router[_0x6326('0x8')](_0x6326('0x9'),auth[_0x6326('0x7')](),controller[_0x6326('0xa')]);router[_0x6326('0x8')](_0x6326('0xb'),auth[_0x6326('0x7')](),controller[_0x6326('0xc')]);router[_0x6326('0x8')](_0x6326('0xd'),auth[_0x6326('0x7')](),controller[_0x6326('0xe')]);router[_0x6326('0x8')](_0x6326('0xf'),auth[_0x6326('0x7')](),controller[_0x6326('0x10')]);router[_0x6326('0x11')]('/',auth[_0x6326('0x7')](),controller[_0x6326('0x12')]);router[_0x6326('0x13')](_0x6326('0x9'),auth[_0x6326('0x7')](),controller[_0x6326('0x14')]);router['delete'](_0x6326('0x9'),auth[_0x6326('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 57e8675..fd0d96d 100644 --- a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js +++ b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x24ca=['sequelize','STRING','TEXT'];(function(_0x3d35a2,_0x1240da){var _0x539ed2=function(_0xf2c2e9){while(--_0xf2c2e9){_0x3d35a2['push'](_0x3d35a2['shift']());}};_0x539ed2(++_0x1240da);}(_0x24ca,0x1bc));var _0xa24c=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0x24ca[_0x2aecb2];return _0x3ebb80;};'use strict';var Sequelize=require(_0xa24c('0x0'));module['exports']={'name':{'type':Sequelize[_0xa24c('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa24c('0x1')]},'parent':{'type':Sequelize[_0xa24c('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0xa24c('0x2')]},'joins':{'type':Sequelize[_0xa24c('0x2')]}}; \ No newline at end of file +var _0x5075=['exports','STRING','TEXT','sequelize'];(function(_0x7611ce,_0x4a4441){var _0x67d3ab=function(_0x1456d8){while(--_0x1456d8){_0x7611ce['push'](_0x7611ce['shift']());}};_0x67d3ab(++_0x4a4441);}(_0x5075,0x73));var _0x5507=function(_0x2eb35d,_0x4a7a45){_0x2eb35d=_0x2eb35d-0x0;var _0x1f9854=_0x5075[_0x2eb35d];return _0x1f9854;};'use strict';var Sequelize=require(_0x5507('0x0'));module[_0x5507('0x1')]={'name':{'type':Sequelize[_0x5507('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5507('0x2')]},'parent':{'type':Sequelize[_0x5507('0x2')]},'table':{'type':Sequelize[_0x5507('0x2')]},'conditions':{'type':Sequelize[_0x5507('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index f1fbc74..c67ed8e 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 _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(_0x385c2f,_0x1211ff){var _0x275316=function(_0x490a23){while(--_0x490a23){_0x385c2f['push'](_0x385c2f['shift']());}};_0x275316(++_0x1211ff);}(_0x2675,0x75));var _0x5267=function(_0x7f153e,_0x511df6){_0x7f153e=_0x7f153e-0x0;var _0x210b4c=_0x2675[_0x7f153e];return _0x210b4c;};'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 +var _0x5fab=['debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(DISTINCT\x20%s)','from','function','order','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','run','params','runReport','AVG(%s)','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','limit','undefined','count','offset','Content-Range','apply','save','update','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','query','where','pick','filters','filter','VIRTUAL','merge','options','include','findAll','rows','catch','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone'];(function(_0x39d7c0,_0x3903a5){var _0x39abf1=function(_0x1a4676){while(--_0x1a4676){_0x39d7c0['push'](_0x39d7c0['shift']());}};_0x39abf1(++_0x3903a5);}(_0x5fab,0x177));var _0xb5fa=function(_0x21bf22,_0x16172a){_0x21bf22=_0x21bf22-0x0;var _0x144ee9=_0x5fab[_0x21bf22];return _0x144ee9;};'use strict';var emlformat=require(_0xb5fa('0x0'));var rimraf=require(_0xb5fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5fa('0x2'));var rp=require(_0xb5fa('0x3'));var moment=require(_0xb5fa('0x4'));var BPromise=require(_0xb5fa('0x5'));var Mustache=require(_0xb5fa('0x6'));var util=require(_0xb5fa('0x7'));var path=require(_0xb5fa('0x8'));var sox=require(_0xb5fa('0x9'));var csv=require(_0xb5fa('0xa'));var ejs=require(_0xb5fa('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb5fa('0xc'));var crypto=require(_0xb5fa('0xd'));var jsforce=require(_0xb5fa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb5fa('0xa'));var querystring=require(_0xb5fa('0xf'));var Papa=require(_0xb5fa('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb5fa('0x11'));var as=require(_0xb5fa('0x12'));var hardwareService=require(_0xb5fa('0x13'));var logger=require(_0xb5fa('0x14'))(_0xb5fa('0x15'));var utils=require(_0xb5fa('0x16'));var config=require(_0xb5fa('0x17'));var licenseUtil=require(_0xb5fa('0x18'));var db=require(_0xb5fa('0x19'))['db'];var dbH=require('../../mysqldb')[_0xb5fa('0x1a')];function respondWithStatusCode(_0x3dad4d,_0x56e8b0){_0x56e8b0=_0x56e8b0||0xcc;return function(_0x116849){if(_0x116849){return _0x3dad4d['sendStatus'](_0x56e8b0);}return _0x3dad4d[_0xb5fa('0x1b')](_0x56e8b0)[_0xb5fa('0x1c')]();};}function respondWithResult(_0x40c914,_0xca8d82){_0xca8d82=_0xca8d82||0xc8;return function(_0x8e9d1c){if(_0x8e9d1c){return _0x40c914['status'](_0xca8d82)['json'](_0x8e9d1c);}};}function respondWithFilteredResult(_0x38e964,_0x587043){return function(_0x31f252){if(_0x31f252){var _0x27c8f7=typeof _0x587043['offset']==='undefined'&&typeof _0x587043[_0xb5fa('0x1d')]===_0xb5fa('0x1e');var _0x32e9e5=_0x31f252[_0xb5fa('0x1f')];var _0x324ba5=_0x27c8f7?0x0:_0x587043[_0xb5fa('0x20')];var _0x3b0f69=_0x27c8f7?_0x31f252[_0xb5fa('0x1f')]:_0x587043[_0xb5fa('0x20')]+_0x587043[_0xb5fa('0x1d')];var _0x3c8d53;if(_0x3b0f69>=_0x32e9e5){_0x3b0f69=_0x32e9e5;_0x3c8d53=0xc8;}else{_0x3c8d53=0xce;}_0x38e964[_0xb5fa('0x1b')](_0x3c8d53);return _0x38e964['set'](_0xb5fa('0x21'),_0x324ba5+'-'+_0x3b0f69+'/'+_0x32e9e5)['json'](_0x31f252);}return null;};}function patchUpdates(_0x37ae06){return function(_0x4a6c04){try{jsonpatch[_0xb5fa('0x22')](_0x4a6c04,_0x37ae06,!![]);}catch(_0x43c09f){return BPromise['reject'](_0x43c09f);}return _0x4a6c04[_0xb5fa('0x23')]();};}function saveUpdates(_0x3a2ab9,_0x283a56){return function(_0x47f71a){if(_0x47f71a){return _0x47f71a[_0xb5fa('0x24')](_0x3a2ab9)[_0xb5fa('0x25')](function(_0x444237){return _0x444237;});}return null;};}function removeEntity(_0x542348,_0x224ec8){return function(_0x5d55f7){if(_0x5d55f7){return _0x5d55f7[_0xb5fa('0x26')]()[_0xb5fa('0x25')](function(){var _0x11053a=_0x5d55f7[_0xb5fa('0x27')]({'plain':!![]});var _0x2dbd22=_0xb5fa('0x28');return db[_0xb5fa('0x29')][_0xb5fa('0x26')]({'where':{'type':_0x2dbd22,'resourceId':_0x11053a['id']}})['then'](function(){return _0x5d55f7;});})['then'](function(){_0x542348['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x28a350,_0x460b54){return function(_0x12c0d4){if(!_0x12c0d4){_0x28a350[_0xb5fa('0x2a')](0x194);}return _0x12c0d4;};}function handleError(_0x534884,_0x3506a4){_0x3506a4=_0x3506a4||0x1f4;return function(_0x358549){logger[_0xb5fa('0x2b')](_0x358549[_0xb5fa('0x2c')]);if(_0x358549[_0xb5fa('0x2d')]){delete _0x358549[_0xb5fa('0x2d')];}_0x534884[_0xb5fa('0x1b')](_0x3506a4)[_0xb5fa('0x2e')](_0x358549);};}exports[_0xb5fa('0x2f')]=function(_0xed02e,_0x116773){var _0x5a0152={},_0x3fd1fb={},_0x21fc7e={'count':0x0,'rows':[]};var _0x319c48=_[_0xb5fa('0x30')](db[_0xb5fa('0x31')][_0xb5fa('0x32')],function(_0x25fc7c){return{'name':_0x25fc7c['fieldName'],'type':_0x25fc7c[_0xb5fa('0x33')]['key']};});_0x3fd1fb['model']=_['map'](_0x319c48,_0xb5fa('0x2d'));_0x3fd1fb['query']=_[_0xb5fa('0x34')](_0xed02e['query']);_0x3fd1fb['filters']=_[_0xb5fa('0x35')](_0x3fd1fb[_0xb5fa('0x36')],_0x3fd1fb['query']);_0x5a0152['attributes']=_[_0xb5fa('0x35')](_0x3fd1fb[_0xb5fa('0x36')],qs[_0xb5fa('0x37')](_0xed02e['query'][_0xb5fa('0x37')]));_0x5a0152[_0xb5fa('0x38')]=_0x5a0152['attributes'][_0xb5fa('0x39')]?_0x5a0152[_0xb5fa('0x38')]:_0x3fd1fb[_0xb5fa('0x36')];if(!_0xed02e['query'][_0xb5fa('0x3a')](_0xb5fa('0x3b'))){_0x5a0152[_0xb5fa('0x1d')]=qs['limit'](_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x1d')]);_0x5a0152[_0xb5fa('0x20')]=qs[_0xb5fa('0x20')](_0xed02e['query']['offset']);}_0x5a0152['order']=qs['sort'](_0xed02e['query']['sort']);_0x5a0152[_0xb5fa('0x3d')]=qs['filters'](_[_0xb5fa('0x3e')](_0xed02e[_0xb5fa('0x3c')],_0x3fd1fb[_0xb5fa('0x3f')]),_0x319c48);if(_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x40')]){_0x5a0152[_0xb5fa('0x3d')]=_['merge'](_0x5a0152['where'],{'$or':_['map'](_0x319c48,function(_0x534b38){if(_0x534b38['type']!==_0xb5fa('0x41')){var _0x5addd5={};_0x5addd5[_0x534b38['name']]={'$like':'%'+_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x40')]+'%'};return _0x5addd5;}})});}_0x5a0152=_[_0xb5fa('0x42')]({},_0x5a0152,_0xed02e[_0xb5fa('0x43')]);var _0x5bc93f={'where':_0x5a0152[_0xb5fa('0x3d')]};return db[_0xb5fa('0x31')][_0xb5fa('0x1f')](_0x5bc93f)[_0xb5fa('0x25')](function(_0x402a68){_0x21fc7e['count']=_0x402a68;if(_0xed02e[_0xb5fa('0x3c')]['includeAll']){_0x5a0152[_0xb5fa('0x44')]=[{'all':!![]}];}return db[_0xb5fa('0x31')][_0xb5fa('0x45')](_0x5a0152);})[_0xb5fa('0x25')](function(_0x1c706b){_0x21fc7e[_0xb5fa('0x46')]=_0x1c706b;return _0x21fc7e;})[_0xb5fa('0x25')](respondWithFilteredResult(_0x116773,_0x5a0152))[_0xb5fa('0x47')](handleError(_0x116773,null));};exports['show']=function(_0x1c3c2c,_0xc03e44){var _0x59ae64={'raw':!![],'where':{'id':_0x1c3c2c['params']['id']}},_0x293c19={};_0x293c19[_0xb5fa('0x36')]=_[_0xb5fa('0x34')](db['AnalyticDefaultReport']['rawAttributes']);_0x293c19[_0xb5fa('0x3c')]=_[_0xb5fa('0x34')](_0x1c3c2c[_0xb5fa('0x3c')]);_0x293c19[_0xb5fa('0x3f')]=_[_0xb5fa('0x35')](_0x293c19[_0xb5fa('0x36')],_0x293c19[_0xb5fa('0x3c')]);_0x59ae64[_0xb5fa('0x38')]=_['intersection'](_0x293c19[_0xb5fa('0x36')],qs[_0xb5fa('0x37')](_0x1c3c2c['query'][_0xb5fa('0x37')]));_0x59ae64[_0xb5fa('0x38')]=_0x59ae64[_0xb5fa('0x38')][_0xb5fa('0x39')]?_0x59ae64[_0xb5fa('0x38')]:_0x293c19[_0xb5fa('0x36')];if(_0x1c3c2c[_0xb5fa('0x3c')][_0xb5fa('0x48')]){_0x59ae64[_0xb5fa('0x44')]=[{'all':!![]}];}_0x59ae64=_[_0xb5fa('0x42')]({},_0x59ae64,_0x1c3c2c[_0xb5fa('0x43')]);return db[_0xb5fa('0x31')][_0xb5fa('0x49')](_0x59ae64)[_0xb5fa('0x25')](handleEntityNotFound(_0xc03e44,null))[_0xb5fa('0x25')](respondWithResult(_0xc03e44,null))[_0xb5fa('0x47')](handleError(_0xc03e44,null));};exports['create']=function(_0x56dceb,_0x46194d){return db['AnalyticDefaultReport'][_0xb5fa('0x4a')](_0x56dceb[_0xb5fa('0x4b')],{})['then'](function(_0x4ef1d0){var _0x2931a7=_0x56dceb[_0xb5fa('0x4c')][_0xb5fa('0x27')]({'plain':!![]});if(!_0x2931a7)throw new Error(_0xb5fa('0x4d'));if(_0x2931a7[_0xb5fa('0x4e')]==='user'){var _0x27a651=_0x4ef1d0['get']({'plain':!![]});var _0x251d36=_0xb5fa('0x4f');return db[_0xb5fa('0x50')]['find']({'where':{'name':_0x251d36,'userProfileId':_0x2931a7[_0xb5fa('0x51')]},'raw':!![]})[_0xb5fa('0x25')](function(_0x4dea87){if(_0x4dea87&&_0x4dea87['autoAssociation']===0x0){return db[_0xb5fa('0x29')][_0xb5fa('0x4a')]({'name':_0x27a651[_0xb5fa('0x2d')],'resourceId':_0x27a651['id'],'type':_0xb5fa('0x28'),'sectionId':_0x4dea87['id']},{})[_0xb5fa('0x25')](function(){return _0x4ef1d0;});}else{return _0x4ef1d0;}})[_0xb5fa('0x47')](function(_0x31c91f){logger[_0xb5fa('0x2b')](_0xb5fa('0x52'),_0x31c91f);throw _0x31c91f;});}return _0x4ef1d0;})[_0xb5fa('0x25')](respondWithResult(_0x46194d,0xc9))[_0xb5fa('0x47')](handleError(_0x46194d,null));};exports[_0xb5fa('0x24')]=function(_0x3ccfd1,_0x2799e7){if(_0x3ccfd1[_0xb5fa('0x4b')]['id']){delete _0x3ccfd1[_0xb5fa('0x4b')]['id'];}return db[_0xb5fa('0x31')][_0xb5fa('0x49')]({'where':{'id':_0x3ccfd1['params']['id']}})[_0xb5fa('0x25')](handleEntityNotFound(_0x2799e7,null))[_0xb5fa('0x25')](saveUpdates(_0x3ccfd1[_0xb5fa('0x4b')],null))[_0xb5fa('0x25')](respondWithResult(_0x2799e7,null))[_0xb5fa('0x47')](handleError(_0x2799e7,null));};exports[_0xb5fa('0x26')]=function(_0x4224cf,_0x24117e){return db[_0xb5fa('0x31')][_0xb5fa('0x49')]({'where':{'id':_0x4224cf['params']['id']}})['then'](handleEntityNotFound(_0x24117e,null))[_0xb5fa('0x25')](removeEntity(_0x24117e,null))[_0xb5fa('0x47')](handleError(_0x24117e,null));};exports[_0xb5fa('0x53')]=function(_0x5caf84,_0x441c41){var _0x367f7a=0xa;var _0x1572fb=[_0xb5fa('0x54'),_0xb5fa('0x55'),_0xb5fa('0x56'),_0xb5fa('0x57')];var _0x4f82f0={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xb5fa('0x5a'),'MIN':_0xb5fa('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':_0xb5fa('0x5e')};var _0x2b9a45={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':_0xb5fa('0x60'),'HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':_0xb5fa('0x63')};var _0x1c24e3=function(_0xfb88cc){return!_[_0xb5fa('0x64')]([_0xb5fa('0x65'),_0xb5fa('0x66'),_0xb5fa('0x67'),_0xb5fa('0x68')],_0xfb88cc);};var _0x41cce9=function(_0x23fb01){if(!_0x23fb01||!_0x23fb01[_0xb5fa('0x69')][_0xb5fa('0x39')]){return'';}for(var _0x421a93='(',_0x36fc0f=0x0;_0x36fc0f<_0x23fb01['rules'][_0xb5fa('0x39')];_0x36fc0f+=0x1){_0x36fc0f>0x0&&(_0x421a93+='\x20'+_0x23fb01[_0xb5fa('0x6a')]+'\x20');_0x421a93+=_0x23fb01[_0xb5fa('0x69')][_0x36fc0f]['group']?_0x41cce9(_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6b')]):_0x23fb01['rules'][_0x36fc0f][_0xb5fa('0x6c')]+'\x20'+_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6d')]+(_0x1c24e3(_0x23fb01['rules'][_0x36fc0f]['condition'])?'\x20'+_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6e')]:'');}return _0x421a93+')';};var _0x432f04={'where':{'id':_0x5caf84['params']['id']}},_0x57d8b7,_0x597206,_0x30d53b,_0x199555,_0x12b0a2;_0x432f04=_['merge']({},_0x432f04,_0x5caf84['options']);return db[_0xb5fa('0x31')][_0xb5fa('0x49')](_0x432f04)[_0xb5fa('0x25')](function(_0x4ce1bd){if(_0x4ce1bd){_0x57d8b7=_0x4ce1bd;return _0x4ce1bd[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x13ef3a){if(_0x13ef3a){if(!_0x13ef3a[_0xb5fa('0x39')]){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x597206=_0x13ef3a;return db[_0xb5fa('0x73')][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x3a1db9){if(_0x3a1db9){_0x30d53b=_[_0xb5fa('0x74')](_0x3a1db9,'id');var _0xecdff3;var _0x38faa6=squel[_0xb5fa('0x75')]();_0x38faa6['from'](_0x57d8b7[_0xb5fa('0x76')]);for(var _0x5a6f74=0x0;_0x5a6f74<_0x597206[_0xb5fa('0x39')];_0x5a6f74+=0x1){_0xecdff3=_0x597206[_0x5a6f74][_0xb5fa('0x77')]?_0x30d53b[_0x597206[_0x5a6f74][_0xb5fa('0x77')]][_0xb5fa('0x78')]:_0x597206[_0x5a6f74][_0xb5fa('0x6c')];_0xecdff3=_0x597206[_0x5a6f74]['function']?_[_0xb5fa('0x79')](_0x4f82f0[_0x597206[_0x5a6f74]['function']],'%s',_0xecdff3):_0xecdff3;_0xecdff3=_0x597206[_0x5a6f74][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x2b9a45[_0x597206[_0x5a6f74][_0xb5fa('0x7a')]],'%s',_0xecdff3):_0xecdff3;if(_0x597206[_0x5a6f74][_0xb5fa('0x7b')]){_0x38faa6['group'](_0xecdff3);}_0x597206[_0x5a6f74]['orderBy']&&_0x38faa6['order'](_0xecdff3,_0x597206[_0x5a6f74][_0xb5fa('0x7c')]===_0xb5fa('0x7d')?![]:!![]);_0x38faa6[_0xb5fa('0x6c')](_0xecdff3,_0x597206[_0x5a6f74][_0xb5fa('0x7e')]||_0xecdff3);}if(_0x57d8b7[_0xb5fa('0x7f')]){_0x57d8b7[_0xb5fa('0x7f')]=JSON['parse'](_0x57d8b7[_0xb5fa('0x7f')]);for(var _0x5c08e1=0x0;_0x5c08e1<_0x57d8b7['joins'][_0xb5fa('0x39')];_0x5c08e1+=0x1){if(_0x57d8b7['joins'][_0x5c08e1]['type']&&_['includes'](_0x1572fb,_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['type'])&&_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x80')]&&_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['foreignTable']&&_0x57d8b7['joins'][_0x5c08e1][_0xb5fa('0x81')]){_0x38faa6[_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['type']](_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')](_0xb5fa('0x83'),_0x57d8b7['table'],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x80')],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x82')],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x81')]));}}}if(_0x57d8b7[_0xb5fa('0x84')]){_0x57d8b7['conditions']=JSON[_0xb5fa('0x85')](_0x57d8b7['conditions']);_0x38faa6[_0xb5fa('0x3d')](_0x41cce9(_0x57d8b7[_0xb5fa('0x84')]['group']));}_0x12b0a2=_0x38faa6[_0xb5fa('0x86')]();_0x38faa6[_0xb5fa('0x1d')](_0x367f7a);_0x38faa6[_0xb5fa('0x20')](0x0);logger[_0xb5fa('0x87')](_0xb5fa('0x88'),_0x38faa6[_0xb5fa('0x89')]());return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x38faa6['toString'](),{'type':dbH[_0xb5fa('0x8a')][_0xb5fa('0x8b')][_0xb5fa('0x8c')]});}})[_0xb5fa('0x25')](respondWithResult(_0x441c41,null))['catch'](handleError(_0x441c41,null));};function runReport(_0x593386,_0x47d72b,_0x5557a3){var _0x1c60bd=_0x47d72b[_0xb5fa('0x2d')];var _0xff504d=0xa;var _0x188e66=['join','left_join',_0xb5fa('0x56'),'cross_join'];var _0x32eebd={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':_0xb5fa('0x8d'),'MAX':'MAX(%s)','MIN':_0xb5fa('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5e6852={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':_0xb5fa('0x60'),'HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':_0xb5fa('0x63')};var _0xa7fd3b=function(_0x42e210){return!_[_0xb5fa('0x64')]([_0xb5fa('0x65'),_0xb5fa('0x66'),_0xb5fa('0x67'),_0xb5fa('0x68')],_0x42e210);};var _0x86dfe9=function(_0x53c7b5){if(!_0x53c7b5||!_0x53c7b5['rules'][_0xb5fa('0x39')]){return'';}for(var _0x52384b='(',_0x1cb113=0x0;_0x1cb113<_0x53c7b5[_0xb5fa('0x69')]['length'];_0x1cb113+=0x1){_0x1cb113>0x0&&(_0x52384b+='\x20'+_0x53c7b5[_0xb5fa('0x6a')]+'\x20');_0x52384b+=_0x53c7b5[_0xb5fa('0x69')][_0x1cb113]['group']?_0x86dfe9(_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6b')]):_0x53c7b5['rules'][_0x1cb113][_0xb5fa('0x6c')]+'\x20'+_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6d')]+(_0xa7fd3b(_0x53c7b5['rules'][_0x1cb113]['condition'])?'\x20'+_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6e')]:'');}return _0x52384b+')';};var _0x3b5e1d={'where':{'id':_0x593386['id']}},_0x3d18a9,_0x397830,_0x234d9d,_0x10222c,_0x1eec65;_0x3b5e1d=_[_0xb5fa('0x42')]({},_0x3b5e1d,_0x5557a3);return db[_0xb5fa('0x31')]['find'](_0x3b5e1d)['then'](function(_0x3c5563){if(_0x3c5563){_0x3d18a9=_0x3c5563;return _0x3c5563[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x18498d){if(_0x18498d){if(!_0x18498d['length']){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x397830=_0x18498d;return db['AnalyticMetric'][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x109dd9){if(_0x109dd9){_0x234d9d=_[_0xb5fa('0x74')](_0x109dd9,'id');var _0x5ba2e7;var _0x1175da=squel[_0xb5fa('0x75')]();_0x1175da[_0xb5fa('0x8e')](_0x3d18a9[_0xb5fa('0x76')]);for(var _0x19717a=0x0;_0x19717a<_0x397830[_0xb5fa('0x39')];_0x19717a+=0x1){_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x77')]?_0x234d9d[_0x397830[_0x19717a][_0xb5fa('0x77')]][_0xb5fa('0x78')]:_0x397830[_0x19717a][_0xb5fa('0x6c')];_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x8f')]?_[_0xb5fa('0x79')](_0x32eebd[_0x397830[_0x19717a][_0xb5fa('0x8f')]],'%s',_0x5ba2e7):_0x5ba2e7;_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x5e6852[_0x397830[_0x19717a]['format']],'%s',_0x5ba2e7):_0x5ba2e7;if(_0x397830[_0x19717a][_0xb5fa('0x7b')]){_0x1175da[_0xb5fa('0x6b')](_0x5ba2e7);}_0x397830[_0x19717a][_0xb5fa('0x7c')]&&_0x1175da[_0xb5fa('0x90')](_0x5ba2e7,_0x397830[_0x19717a][_0xb5fa('0x7c')]===_0xb5fa('0x7d')?![]:!![]);_0x1175da[_0xb5fa('0x6c')](_0x5ba2e7,_0x397830[_0x19717a][_0xb5fa('0x7e')]||_0x5ba2e7);}if(_0x3d18a9['joins']){_0x3d18a9['joins']=JSON[_0xb5fa('0x85')](_0x3d18a9['joins']);for(var _0x5d0ca8=0x0;_0x5d0ca8<_0x3d18a9[_0xb5fa('0x7f')][_0xb5fa('0x39')];_0x5d0ca8+=0x1){if(_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['type']&&_[_0xb5fa('0x64')](_0x188e66,_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x33')])&&_0x3d18a9['joins'][_0x5d0ca8][_0xb5fa('0x80')]&&_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['foreignTable']&&_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x81')]){_0x1175da[_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x33')]](_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')]('%s.%s\x20=\x20%s.%s',_0x3d18a9[_0xb5fa('0x76')],_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x80')],_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['foreignTable'],_0x3d18a9['joins'][_0x5d0ca8][_0xb5fa('0x81')]));}}}if(_0x3d18a9[_0xb5fa('0x84')]){_0x3d18a9[_0xb5fa('0x84')]=JSON[_0xb5fa('0x85')](_0x3d18a9['conditions']);_0x1175da['where'](_0x86dfe9(_0x3d18a9['conditions']['group']));}_0x1eec65=_0x1175da[_0xb5fa('0x86')]();_0x1175da[_0xb5fa('0x1d')](_0xff504d);_0x1175da[_0xb5fa('0x20')](0x0);return;}})[_0xb5fa('0x25')](function(){if(_0x47d72b[_0xb5fa('0x91')]===_0xb5fa('0x92')){return null;}var _0x3c36a8=_[_0xb5fa('0x42')](_0x47d72b,{'name':_0x47d72b[_0xb5fa('0x93')]||_0x47d72b[_0xb5fa('0x2d')]||_0x3d18a9[_0xb5fa('0x2d')],'basename':_0x1c60bd,'savename':util['format'](_0xb5fa('0x94'),_0x47d72b[_0xb5fa('0x2d')]||_0x3d18a9['name'],require(_0xb5fa('0x95'))[_0xb5fa('0x96')](0x4),_0x47d72b['output']||_0xb5fa('0x97')),'reportId':_0x3d18a9['id'],'reportType':_0xb5fa('0x98')});return db[_0xb5fa('0x99')][_0xb5fa('0x4a')](_0x3c36a8,{'raw':!![]});})[_0xb5fa('0x25')](function(_0x2b449a){if(_0x3d18a9[_0xb5fa('0x76')]===_0xb5fa('0x9a')){_0x1eec65[_0xb5fa('0x3d')](_0x3d18a9['table']+_0xb5fa('0x9b'),_0x47d72b[_0xb5fa('0x9c')],_0x47d72b[_0xb5fa('0x9d')]);}else{_0x1eec65[_0xb5fa('0x3d')](_0x3d18a9[_0xb5fa('0x76')]+_0xb5fa('0x9e'),_0x47d72b[_0xb5fa('0x9c')],_0x47d72b[_0xb5fa('0x9d')]);}if(_0x2b449a){logger['info'](_0xb5fa('0x9f'),_0x1eec65['toString']());require(_0xb5fa('0xa0'))[_0xb5fa('0xa1')](path[_0xb5fa('0x54')](__dirname,_0xb5fa('0xa2'),_0x2b449a[_0xb5fa('0x91')]),[_0x2b449a['id'],_0x1eec65[_0xb5fa('0x89')](),path[_0xb5fa('0x54')](__dirname,_0xb5fa('0xa3'),_0x2b449a[_0xb5fa('0xa4')]),_0x1c60bd]);return _0x2b449a;}else{var _0x4bb9b4=squel['select']();_0x4bb9b4[_0xb5fa('0x8e')]('('+_0x1eec65[_0xb5fa('0x89')]()+')',_0xb5fa('0xa5'));_0x4bb9b4[_0xb5fa('0x6c')]('COUNT(*)',_0xb5fa('0x1f'));_0x1eec65['limit'](_0x47d72b[_0xb5fa('0x1d')]||_0xff504d);_0x1eec65[_0xb5fa('0x20')](_0x47d72b['offset']||0x0);return dbH[_0xb5fa('0x8a')]['query'](_0x4bb9b4[_0xb5fa('0x89')](),{'type':dbH['sequelize'][_0xb5fa('0x8b')][_0xb5fa('0x8c')]})[_0xb5fa('0x25')](function(_0x70e4ae){if(!_0x70e4ae[_0xb5fa('0x39')]){_0x10222c=0x0;}else{_0x10222c=_0x70e4ae[0x0][_0xb5fa('0x1f')]||0x0;}return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x1eec65[_0xb5fa('0x89')](),{'type':dbH[_0xb5fa('0x8a')][_0xb5fa('0x8b')]['SELECT']});})[_0xb5fa('0x25')](function(_0x284b34){return{'rows':_0x284b34||[],'count':_0x10222c};});}});}exports[_0xb5fa('0xa6')]=function(_0x497931,_0x2145d8){return runReport(_0x497931[_0xb5fa('0xa7')],_0x497931[_0xb5fa('0x3c')],_0x497931[_0xb5fa('0x43')])[_0xb5fa('0x25')](respondWithResult(_0x2145d8,null))[_0xb5fa('0x47')](handleError(_0x2145d8,null));};exports[_0xb5fa('0xa8')]=runReport;exports[_0xb5fa('0x3c')]=function(_0x59fd75,_0x245ee1){var _0x5c1e1f=0xa;var _0x3ba723=[_0xb5fa('0x54'),_0xb5fa('0x55'),_0xb5fa('0x56'),_0xb5fa('0x57')];var _0x105c0f={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':_0xb5fa('0x8d'),'MAX':_0xb5fa('0x5a'),'MIN':_0xb5fa('0x5b'),'AVG':_0xb5fa('0xa9'),'GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':_0xb5fa('0x5e')};var _0x41e086={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':'DATE(%s)','HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xd34c31=function(_0x2e614e){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0xb5fa('0x67'),_0xb5fa('0x68')],_0x2e614e);};var _0x1aae82=function(_0x474bb){if(!_0x474bb||!_0x474bb[_0xb5fa('0x69')][_0xb5fa('0x39')]){return'';}for(var _0x17ae50='(',_0x51c9ba=0x0;_0x51c9ba<_0x474bb['rules']['length'];_0x51c9ba+=0x1){_0x51c9ba>0x0&&(_0x17ae50+='\x20'+_0x474bb[_0xb5fa('0x6a')]+'\x20');_0x17ae50+=_0x474bb['rules'][_0x51c9ba]['group']?_0x1aae82(_0x474bb[_0xb5fa('0x69')][_0x51c9ba]['group']):_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6c')]+'\x20'+_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6d')]+(_0xd34c31(_0x474bb[_0xb5fa('0x69')][_0x51c9ba]['condition'])?'\x20'+_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6e')]:'');}return _0x17ae50+')';};var _0x2fe715={'where':{'id':_0x59fd75[_0xb5fa('0xa7')]['id']}},_0x3c5ac4,_0x23b70f,_0x488818,_0x15b228,_0x42fd84;_0x2fe715=_[_0xb5fa('0x42')]({},_0x2fe715,_0x59fd75[_0xb5fa('0x43')]);return db[_0xb5fa('0x31')]['find'](_0x2fe715)[_0xb5fa('0x25')](function(_0x390043){if(_0x390043){_0x3c5ac4=_0x390043;return _0x390043[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x32c191){if(_0x32c191){if(!_0x32c191[_0xb5fa('0x39')]){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x23b70f=_0x32c191;return db[_0xb5fa('0x73')][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x1d307c){if(_0x1d307c){_0x488818=_[_0xb5fa('0x74')](_0x1d307c,'id');var _0x3347eb;var _0x349e0b=squel[_0xb5fa('0x75')]();_0x349e0b[_0xb5fa('0x8e')](_0x3c5ac4[_0xb5fa('0x76')]);for(var _0x2b1c3f=0x0;_0x2b1c3f<_0x23b70f[_0xb5fa('0x39')];_0x2b1c3f+=0x1){_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x77')]?_0x488818[_0x23b70f[_0x2b1c3f]['MetricId']]['metric']:_0x23b70f[_0x2b1c3f][_0xb5fa('0x6c')];_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x8f')]?_[_0xb5fa('0x79')](_0x105c0f[_0x23b70f[_0x2b1c3f][_0xb5fa('0x8f')]],'%s',_0x3347eb):_0x3347eb;_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x41e086[_0x23b70f[_0x2b1c3f]['format']],'%s',_0x3347eb):_0x3347eb;if(_0x23b70f[_0x2b1c3f]['groupBy']){_0x349e0b['group'](_0x3347eb);}_0x23b70f[_0x2b1c3f][_0xb5fa('0x7c')]&&_0x349e0b[_0xb5fa('0x90')](_0x3347eb,_0x23b70f[_0x2b1c3f]['orderBy']===_0xb5fa('0x7d')?![]:!![]);_0x349e0b[_0xb5fa('0x6c')](_0x3347eb,_0x23b70f[_0x2b1c3f]['alias']||_0x3347eb);}if(_0x3c5ac4[_0xb5fa('0x7f')]){_0x3c5ac4[_0xb5fa('0x7f')]=JSON[_0xb5fa('0x85')](_0x3c5ac4[_0xb5fa('0x7f')]);for(var _0x10dbdf=0x0;_0x10dbdf<_0x3c5ac4[_0xb5fa('0x7f')][_0xb5fa('0x39')];_0x10dbdf+=0x1){if(_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['type']&&_[_0xb5fa('0x64')](_0x3ba723,_0x3c5ac4['joins'][_0x10dbdf][_0xb5fa('0x33')])&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x80')]&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignTable']&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x81')]){_0x349e0b[_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x33')]](_0x3c5ac4['joins'][_0x10dbdf][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')](_0xb5fa('0x83'),_0x3c5ac4[_0xb5fa('0x76')],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x80')],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignTable'],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignKey']));}}}if(_0x3c5ac4[_0xb5fa('0x84')]){_0x3c5ac4[_0xb5fa('0x84')]=JSON[_0xb5fa('0x85')](_0x3c5ac4[_0xb5fa('0x84')]);_0x349e0b[_0xb5fa('0x3d')](_0x1aae82(_0x3c5ac4[_0xb5fa('0x84')][_0xb5fa('0x6b')]));}_0x42fd84=_0x349e0b['clone']();_0x349e0b['limit'](_0x5c1e1f);_0x349e0b[_0xb5fa('0x20')](0x0);logger[_0xb5fa('0x87')](_0xb5fa('0x88'),_0x349e0b[_0xb5fa('0x89')]());return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x349e0b[_0xb5fa('0x89')](),{'type':dbH[_0xb5fa('0x8a')]['QueryTypes'][_0xb5fa('0x8c')]});}})[_0xb5fa('0x25')](function(){return{'sql':_0x42fd84[_0xb5fa('0x89')]()};})[_0xb5fa('0x25')](respondWithResult(_0x245ee1,null))[_0xb5fa('0x47')](handleError(_0x245ee1,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index d634a4f..1766348 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 _0x9e23=['rimraf','../../config/environment','exports','define','api','moment','bluebird','request-promise'];(function(_0x42f7da,_0xc4a31b){var _0x1ed6ff=function(_0x39c004){while(--_0x39c004){_0x42f7da['push'](_0x42f7da['shift']());}};_0x1ed6ff(++_0xc4a31b);}(_0x9e23,0x184));var _0x39e2=function(_0x430150,_0x13f693){_0x430150=_0x430150-0x0;var _0x3f6940=_0x9e23[_0x430150];return _0x3f6940;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x39e2('0x0'));var moment=require(_0x39e2('0x1'));var BPromise=require(_0x39e2('0x2'));var rp=require(_0x39e2('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x39e2('0x4'));var config=require(_0x39e2('0x5'));var attributes=require('./analyticDefaultReport.attributes');module[_0x39e2('0x6')]=function(_0x3b86e2,_0x4c095d){return _0x3b86e2[_0x39e2('0x7')]('AnalyticDefaultReport',attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0f62=['util','../../config/logger','api','moment','bluebird','rimraf','./analyticDefaultReport.attributes','analytics_default_reports'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x0f62,0x160));var _0x20f6=function(_0x450cef,_0x309639){_0x450cef=_0x450cef-0x0;var _0x337f5d=_0x0f62[_0x450cef];return _0x337f5d;};'use strict';var _=require('lodash');var util=require(_0x20f6('0x0'));var logger=require(_0x20f6('0x1'))(_0x20f6('0x2'));var moment=require(_0x20f6('0x3'));var BPromise=require(_0x20f6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x20f6('0x5'));var config=require('../../config/environment');var attributes=require(_0x20f6('0x6'));module['exports']=function(_0x56161f,_0x4fd2e9){return _0x56161f['define']('AnalyticDefaultReport',attributes,{'tableName':_0x20f6('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 f14fbad..1644216 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 _0xa54c=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird'];(function(_0x5160aa,_0xea9d41){var _0x4913ce=function(_0x47878e){while(--_0x47878e){_0x5160aa['push'](_0x5160aa['shift']());}};_0x4913ce(++_0xea9d41);}(_0xa54c,0x162));var _0xca54=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0xa54c[_0x122096];return _0x3d1966;};'use strict';var _=require('lodash');var util=require(_0xca54('0x0'));var moment=require(_0xca54('0x1'));var BPromise=require(_0xca54('0x2'));var rs=require(_0xca54('0x3'));var fs=require('fs');var Redis=require(_0xca54('0x4'));var db=require(_0xca54('0x5'))['db'];var utils=require(_0xca54('0x6'));var logger=require(_0xca54('0x7'))('rpc');var config=require(_0xca54('0x8'));var jayson=require(_0xca54('0x9'));var client=jayson[_0xca54('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54907a,_0x31064e,_0x385334){return new BPromise(function(_0x39a630,_0x54236e){return client[_0xca54('0xb')](_0x54907a,_0x385334)[_0xca54('0xc')](function(_0x106ec1){logger[_0xca54('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x31064e,_0xca54('0xe'));logger['debug'](_0xca54('0xf'),_0x31064e,_0xca54('0xe'),JSON['stringify'](_0x106ec1));if(_0x106ec1['error']){if(_0x106ec1[_0xca54('0x10')]['code']===0x1f4){logger['error'](_0xca54('0x11'),_0x31064e,_0x106ec1[_0xca54('0x10')][_0xca54('0x12')]);return _0x54236e(_0x106ec1[_0xca54('0x10')]['message']);}logger[_0xca54('0x10')](_0xca54('0x11'),_0x31064e,_0x106ec1[_0xca54('0x10')][_0xca54('0x12')]);return _0x39a630(_0x106ec1[_0xca54('0x10')][_0xca54('0x12')]);}else{logger[_0xca54('0xd')](_0xca54('0x11'),_0x31064e,_0xca54('0xe'));_0x39a630(_0x106ec1[_0xca54('0x13')][_0xca54('0x12')]);}})[_0xca54('0x14')](function(_0x237415){logger[_0xca54('0x10')](_0xca54('0x11'),_0x31064e,_0x237415);_0x54236e(_0x237415);});});} \ No newline at end of file +var _0x46c6=['error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x59d615,_0x46a59b){var _0x4b6bd0=function(_0x37667a){while(--_0x37667a){_0x59d615['push'](_0x59d615['shift']());}};_0x4b6bd0(++_0x46a59b);}(_0x46c6,0xf6));var _0x646c=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x46c6[_0x1e4360];return _0x31e6b4;};'use strict';var _=require('lodash');var util=require(_0x646c('0x0'));var moment=require(_0x646c('0x1'));var BPromise=require(_0x646c('0x2'));var rs=require(_0x646c('0x3'));var fs=require('fs');var Redis=require(_0x646c('0x4'));var db=require(_0x646c('0x5'))['db'];var utils=require(_0x646c('0x6'));var logger=require('../../config/logger')(_0x646c('0x7'));var config=require('../../config/environment');var jayson=require(_0x646c('0x8'));var client=jayson[_0x646c('0x9')][_0x646c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1cf739,_0x2abcb4,_0x428af6){return new BPromise(function(_0x4c5838,_0x3e6bdc){return client[_0x646c('0xb')](_0x1cf739,_0x428af6)[_0x646c('0xc')](function(_0x38d4e7){logger[_0x646c('0xd')](_0x646c('0xe'),_0x2abcb4,_0x646c('0xf'));logger['debug'](_0x646c('0x10'),_0x2abcb4,_0x646c('0xf'),JSON[_0x646c('0x11')](_0x38d4e7));if(_0x38d4e7[_0x646c('0x12')]){if(_0x38d4e7['error'][_0x646c('0x13')]===0x1f4){logger[_0x646c('0x12')](_0x646c('0xe'),_0x2abcb4,_0x38d4e7[_0x646c('0x12')][_0x646c('0x14')]);return _0x3e6bdc(_0x38d4e7[_0x646c('0x12')][_0x646c('0x14')]);}logger['error'](_0x646c('0xe'),_0x2abcb4,_0x38d4e7[_0x646c('0x12')][_0x646c('0x14')]);return _0x4c5838(_0x38d4e7[_0x646c('0x12')][_0x646c('0x14')]);}else{logger[_0x646c('0xd')](_0x646c('0xe'),_0x2abcb4,_0x646c('0xf'));_0x4c5838(_0x38d4e7['result'][_0x646c('0x14')]);}})[_0x646c('0x15')](function(_0x3e001c){logger['error'](_0x646c('0xe'),_0x2abcb4,_0x3e001c);_0x3e6bdc(_0x3e001c);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 43c1064..9158371 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 _0x991e=['../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','preview','/:id/run','/:id/query','query','post','create','put','update','delete','multer','fs-extra'];(function(_0x31ea6f,_0x5d2e87){var _0x164b40=function(_0x5d1924){while(--_0x5d1924){_0x31ea6f['push'](_0x31ea6f['shift']());}};_0x164b40(++_0x5d2e87);}(_0x991e,0x70));var _0xe991=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x991e[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0xe991('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xe991('0x1'));var auth=require(_0xe991('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xe991('0x3'));var controller=require(_0xe991('0x4'));router[_0xe991('0x5')]('/',auth[_0xe991('0x6')](),controller[_0xe991('0x7')]);router[_0xe991('0x5')](_0xe991('0x8'),auth[_0xe991('0x6')](),controller[_0xe991('0x9')]);router[_0xe991('0x5')]('/:id/preview',auth[_0xe991('0x6')](),controller[_0xe991('0xa')]);router[_0xe991('0x5')](_0xe991('0xb'),auth[_0xe991('0x6')](),controller['run']);router['get'](_0xe991('0xc'),auth[_0xe991('0x6')](),controller[_0xe991('0xd')]);router[_0xe991('0xe')]('/',auth[_0xe991('0x6')](),controller[_0xe991('0xf')]);router[_0xe991('0x10')](_0xe991('0x8'),auth[_0xe991('0x6')](),controller[_0xe991('0x11')]);router[_0xe991('0x12')](_0xe991('0x8'),auth[_0xe991('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xef0d=['show','/:id/preview','preview','/:id/run','run','query','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','get','/:id'];(function(_0x570699,_0x284d3d){var _0x5139b8=function(_0x55ae37){while(--_0x55ae37){_0x570699['push'](_0x570699['shift']());}};_0x5139b8(++_0x284d3d);}(_0xef0d,0xdc));var _0xdef0=function(_0x221dec,_0x1a8890){_0x221dec=_0x221dec-0x0;var _0x11be40=_0xef0d[_0x221dec];return _0x11be40;};'use strict';var multer=require(_0xdef0('0x0'));var util=require('util');var path=require(_0xdef0('0x1'));var timeout=require(_0xdef0('0x2'));var express=require(_0xdef0('0x3'));var router=express[_0xdef0('0x4')]();var fs_extra=require(_0xdef0('0x5'));var auth=require(_0xdef0('0x6'));var interaction=require(_0xdef0('0x7'));var config=require(_0xdef0('0x8'));var controller=require(_0xdef0('0x9'));router['get']('/',auth[_0xdef0('0xa')](),controller[_0xdef0('0xb')]);router[_0xdef0('0xc')](_0xdef0('0xd'),auth[_0xdef0('0xa')](),controller[_0xdef0('0xe')]);router[_0xdef0('0xc')](_0xdef0('0xf'),auth['isAuthenticated'](),controller[_0xdef0('0x10')]);router[_0xdef0('0xc')](_0xdef0('0x11'),auth[_0xdef0('0xa')](),controller[_0xdef0('0x12')]);router[_0xdef0('0xc')]('/:id/query',auth[_0xdef0('0xa')](),controller[_0xdef0('0x13')]);router['post']('/',auth[_0xdef0('0xa')](),controller[_0xdef0('0x14')]);router[_0xdef0('0x15')]('/:id',auth[_0xdef0('0xa')](),controller[_0xdef0('0x16')]);router[_0xdef0('0x17')](_0xdef0('0xd'),auth[_0xdef0('0xa')](),controller[_0xdef0('0x18')]);module[_0xdef0('0x19')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index aaa8dc1..e5ff2b9 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 _0x19ff=['scheduled','INTEGER','UNSIGNED','moment','xlsx','csv','STRING','DATE','Loading','ENUM','manual'];(function(_0x3aee25,_0x49e288){var _0x3b0442=function(_0x4c03cb){while(--_0x4c03cb){_0x3aee25['push'](_0x3aee25['shift']());}};_0x3b0442(++_0x49e288);}(_0x19ff,0x9d));var _0xf19f=function(_0x3204e4,_0x49a4d4){_0x3204e4=_0x3204e4-0x0;var _0x28e4d6=_0x19ff[_0x3204e4];return _0x28e4d6;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xf19f('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM']('csv','pdf',_0xf19f('0x1')),'allowNull':![],'defaultValue':_0xf19f('0x2')},'savename':{'type':Sequelize[_0xf19f('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xf19f('0x4')]},'endDate':{'type':Sequelize[_0xf19f('0x4')]},'status':{'type':Sequelize[_0xf19f('0x3')],'defaultValue':_0xf19f('0x5')},'type':{'type':Sequelize[_0xf19f('0x6')](_0xf19f('0x7'),_0xf19f('0x8')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xf19f('0x9')](0xb)[_0xf19f('0xa')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa130=['scheduled','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','xlsx','manual'];(function(_0x328483,_0x474554){var _0x398216=function(_0x1fa19c){while(--_0x1fa19c){_0x328483['push'](_0x328483['shift']());}};_0x398216(++_0x474554);}(_0xa130,0xf5));var _0x0a13=function(_0x3b6e23,_0x145906){_0x3b6e23=_0x3b6e23-0x0;var _0xf0db59=_0xa130[_0x3b6e23];return _0xf0db59;};'use strict';var Sequelize=require(_0x0a13('0x0'));var moment=require(_0x0a13('0x1'));module[_0x0a13('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x0a13('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x0a13('0x4')](_0x0a13('0x5'),'pdf',_0x0a13('0x6')),'allowNull':![],'defaultValue':_0x0a13('0x5')},'savename':{'type':Sequelize[_0x0a13('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM'](_0x0a13('0x7'),_0x0a13('0x8')),'allowNull':![],'defaultValue':_0x0a13('0x7')},'reportId':{'type':Sequelize[_0x0a13('0x9')](0xb)[_0x0a13('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 ad6b43f..e33a36a 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 _0x9e9f=['query','keys','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','includeAll','findAll','rows','catch','show','intersection','include','find','create','body','user','role','ExtractedReports','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','output','existsSync','join','root','server/files/reports','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','format','%s.%s','toLowerCase','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','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','get','UserProfileResource','destroy','end','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','model'];(function(_0x4e1be5,_0x304696){var _0x3d36d2=function(_0xd8946a){while(--_0xd8946a){_0x4e1be5['push'](_0x4e1be5['shift']());}};_0x3d36d2(++_0x304696);}(_0x9e9f,0xee));var _0xf9e9=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x9e9f[_0x3ff085];return _0x2b68c3;};'use strict';var emlformat=require(_0xf9e9('0x0'));var rimraf=require(_0xf9e9('0x1'));var zipdir=require(_0xf9e9('0x2'));var jsonpatch=require(_0xf9e9('0x3'));var rp=require(_0xf9e9('0x4'));var moment=require(_0xf9e9('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf9e9('0x6'));var util=require(_0xf9e9('0x7'));var path=require(_0xf9e9('0x8'));var sox=require('sox');var csv=require(_0xf9e9('0x9'));var ejs=require(_0xf9e9('0xa'));var fs=require('fs');var fs_extra=require(_0xf9e9('0xb'));var _=require(_0xf9e9('0xc'));var squel=require(_0xf9e9('0xd'));var crypto=require(_0xf9e9('0xe'));var jsforce=require(_0xf9e9('0xf'));var deskjs=require(_0xf9e9('0x10'));var toCsv=require(_0xf9e9('0x9'));var querystring=require(_0xf9e9('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf9e9('0x12'));var qs=require(_0xf9e9('0x13'));var as=require(_0xf9e9('0x14'));var hardwareService=require(_0xf9e9('0x15'));var logger=require('../../config/logger')(_0xf9e9('0x16'));var utils=require(_0xf9e9('0x17'));var config=require(_0xf9e9('0x18'));var licenseUtil=require(_0xf9e9('0x19'));var db=require(_0xf9e9('0x1a'))['db'];function respondWithStatusCode(_0x1189c9,_0x580d9c){_0x580d9c=_0x580d9c||0xcc;return function(_0x1e6220){if(_0x1e6220){return _0x1189c9[_0xf9e9('0x1b')](_0x580d9c);}return _0x1189c9['status'](_0x580d9c)['end']();};}function respondWithResult(_0x4049b9,_0x34b151){_0x34b151=_0x34b151||0xc8;return function(_0x270edb){if(_0x270edb){return _0x4049b9[_0xf9e9('0x1c')](_0x34b151)[_0xf9e9('0x1d')](_0x270edb);}};}function respondWithFilteredResult(_0x41d2d2,_0x38a15f){return function(_0x2132cf){if(_0x2132cf){var _0x35d8d6=typeof _0x38a15f[_0xf9e9('0x1e')]===_0xf9e9('0x1f')&&typeof _0x38a15f['limit']==='undefined';var _0x266289=_0x2132cf[_0xf9e9('0x20')];var _0x5afc2e=_0x35d8d6?0x0:_0x38a15f[_0xf9e9('0x1e')];var _0x105e55=_0x35d8d6?_0x2132cf[_0xf9e9('0x20')]:_0x38a15f[_0xf9e9('0x1e')]+_0x38a15f[_0xf9e9('0x21')];var _0x44ad65;if(_0x105e55>=_0x266289){_0x105e55=_0x266289;_0x44ad65=0xc8;}else{_0x44ad65=0xce;}_0x41d2d2[_0xf9e9('0x1c')](_0x44ad65);return _0x41d2d2[_0xf9e9('0x22')](_0xf9e9('0x23'),_0x5afc2e+'-'+_0x105e55+'/'+_0x266289)[_0xf9e9('0x1d')](_0x2132cf);}return null;};}function patchUpdates(_0x312831){return function(_0x7e4126){try{jsonpatch[_0xf9e9('0x24')](_0x7e4126,_0x312831,!![]);}catch(_0x1445e3){return BPromise['reject'](_0x1445e3);}return _0x7e4126['save']();};}function saveUpdates(_0x130906,_0x3c9d7e){return function(_0x5994e9){if(_0x5994e9){return _0x5994e9[_0xf9e9('0x25')](_0x130906)[_0xf9e9('0x26')](function(_0x3ed4b0){return _0x3ed4b0;});}return null;};}function removeEntity(_0x553786,_0x50a8bd){return function(_0x373af3){if(_0x373af3){return _0x373af3['destroy']()[_0xf9e9('0x26')](function(){var _0x8871d7=_0x373af3[_0xf9e9('0x27')]({'plain':!![]});var _0x41cb88='ExtractedReports';return db[_0xf9e9('0x28')][_0xf9e9('0x29')]({'where':{'type':_0x41cb88,'resourceId':_0x8871d7['id']}})[_0xf9e9('0x26')](function(){return _0x373af3;});})[_0xf9e9('0x26')](function(){_0x553786[_0xf9e9('0x1c')](0xcc)[_0xf9e9('0x2a')]();});}};}function handleEntityNotFound(_0x5787ea,_0x36ea33){return function(_0x29e981){if(!_0x29e981){_0x5787ea[_0xf9e9('0x1b')](0x194);}return _0x29e981;};}function handleError(_0x593518,_0x5ad8b3){_0x5ad8b3=_0x5ad8b3||0x1f4;return function(_0x2f2949){logger[_0xf9e9('0x2b')](_0x2f2949[_0xf9e9('0x2c')]);if(_0x2f2949[_0xf9e9('0x2d')]){delete _0x2f2949[_0xf9e9('0x2d')];}_0x593518[_0xf9e9('0x1c')](_0x5ad8b3)[_0xf9e9('0x2e')](_0x2f2949);};}exports[_0xf9e9('0x2f')]=function(_0x3cfe1e,_0x102f3c){var _0x18804f={},_0x10432e={},_0x5c6599={'count':0x0,'rows':[]};var _0xa05a76=_[_0xf9e9('0x30')](db[_0xf9e9('0x31')][_0xf9e9('0x32')],function(_0x3b9a2d){return{'name':_0x3b9a2d[_0xf9e9('0x33')],'type':_0x3b9a2d['type']['key']};});_0x10432e[_0xf9e9('0x34')]=_[_0xf9e9('0x30')](_0xa05a76,'name');_0x10432e[_0xf9e9('0x35')]=_[_0xf9e9('0x36')](_0x3cfe1e[_0xf9e9('0x35')]);_0x10432e['filters']=_['intersection'](_0x10432e[_0xf9e9('0x34')],_0x10432e['query']);_0x18804f['attributes']=_['intersection'](_0x10432e[_0xf9e9('0x34')],qs[_0xf9e9('0x37')](_0x3cfe1e['query'][_0xf9e9('0x37')]));_0x18804f[_0xf9e9('0x38')]=_0x18804f[_0xf9e9('0x38')][_0xf9e9('0x39')]?_0x18804f[_0xf9e9('0x38')]:_0x10432e[_0xf9e9('0x34')];if(!_0x3cfe1e[_0xf9e9('0x35')][_0xf9e9('0x3a')](_0xf9e9('0x3b'))){_0x18804f['limit']=qs['limit'](_0x3cfe1e[_0xf9e9('0x35')][_0xf9e9('0x21')]);_0x18804f[_0xf9e9('0x1e')]=qs[_0xf9e9('0x1e')](_0x3cfe1e[_0xf9e9('0x35')]['offset']);}_0x18804f[_0xf9e9('0x3c')]=qs[_0xf9e9('0x3d')](_0x3cfe1e[_0xf9e9('0x35')][_0xf9e9('0x3d')]);_0x18804f['where']=qs[_0xf9e9('0x3e')](_[_0xf9e9('0x3f')](_0x3cfe1e[_0xf9e9('0x35')],_0x10432e[_0xf9e9('0x3e')]),_0xa05a76);if(_0x3cfe1e[_0xf9e9('0x35')][_0xf9e9('0x40')]){_0x18804f[_0xf9e9('0x41')]=_['merge'](_0x18804f[_0xf9e9('0x41')],{'$or':_[_0xf9e9('0x30')](_0xa05a76,function(_0x5ece53){if(_0x5ece53['type']!=='VIRTUAL'){var _0x2abe61={};_0x2abe61[_0x5ece53['name']]={'$like':'%'+_0x3cfe1e[_0xf9e9('0x35')]['filter']+'%'};return _0x2abe61;}})});}_0x18804f=_[_0xf9e9('0x42')]({},_0x18804f,_0x3cfe1e[_0xf9e9('0x43')]);var _0x56c648={'where':_0x18804f[_0xf9e9('0x41')]};return db['AnalyticExtractedReport'][_0xf9e9('0x20')](_0x56c648)[_0xf9e9('0x26')](function(_0xd13717){_0x5c6599['count']=_0xd13717;if(_0x3cfe1e[_0xf9e9('0x35')][_0xf9e9('0x44')]){_0x18804f['include']=[{'all':!![]}];}return db[_0xf9e9('0x31')][_0xf9e9('0x45')](_0x18804f);})[_0xf9e9('0x26')](function(_0x4806a9){_0x5c6599[_0xf9e9('0x46')]=_0x4806a9;return _0x5c6599;})[_0xf9e9('0x26')](respondWithFilteredResult(_0x102f3c,_0x18804f))[_0xf9e9('0x47')](handleError(_0x102f3c,null));};exports[_0xf9e9('0x48')]=function(_0x2db461,_0x2f590d){var _0x125505={'raw':!![],'where':{'id':_0x2db461['params']['id']}},_0x358706={};_0x358706['model']=_[_0xf9e9('0x36')](db[_0xf9e9('0x31')][_0xf9e9('0x32')]);_0x358706[_0xf9e9('0x35')]=_[_0xf9e9('0x36')](_0x2db461[_0xf9e9('0x35')]);_0x358706[_0xf9e9('0x3e')]=_[_0xf9e9('0x49')](_0x358706[_0xf9e9('0x34')],_0x358706[_0xf9e9('0x35')]);_0x125505[_0xf9e9('0x38')]=_[_0xf9e9('0x49')](_0x358706[_0xf9e9('0x34')],qs['fields'](_0x2db461[_0xf9e9('0x35')]['fields']));_0x125505[_0xf9e9('0x38')]=_0x125505[_0xf9e9('0x38')][_0xf9e9('0x39')]?_0x125505[_0xf9e9('0x38')]:_0x358706[_0xf9e9('0x34')];if(_0x2db461[_0xf9e9('0x35')][_0xf9e9('0x44')]){_0x125505[_0xf9e9('0x4a')]=[{'all':!![]}];}_0x125505=_['merge']({},_0x125505,_0x2db461[_0xf9e9('0x43')]);return db[_0xf9e9('0x31')][_0xf9e9('0x4b')](_0x125505)[_0xf9e9('0x26')](handleEntityNotFound(_0x2f590d,null))[_0xf9e9('0x26')](respondWithResult(_0x2f590d,null))[_0xf9e9('0x47')](handleError(_0x2f590d,null));};exports[_0xf9e9('0x4c')]=function(_0x4ee0de,_0x4ede16){return db[_0xf9e9('0x31')][_0xf9e9('0x4c')](_0x4ee0de[_0xf9e9('0x4d')],{})['then'](function(_0x1f5d7b){var _0x49d4c6=_0x4ee0de[_0xf9e9('0x4e')]['get']({'plain':!![]});if(!_0x49d4c6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x49d4c6[_0xf9e9('0x4f')]===_0xf9e9('0x4e')){var _0x27df14=_0x1f5d7b[_0xf9e9('0x27')]({'plain':!![]});var _0x53022d=_0xf9e9('0x50');return db[_0xf9e9('0x51')]['find']({'where':{'name':_0x53022d,'userProfileId':_0x49d4c6['userProfileId']},'raw':!![]})[_0xf9e9('0x26')](function(_0x9f7fc2){if(_0x9f7fc2&&_0x9f7fc2['autoAssociation']===0x0){return db['UserProfileResource'][_0xf9e9('0x4c')]({'name':_0x27df14['name'],'resourceId':_0x27df14['id'],'type':_0x9f7fc2[_0xf9e9('0x2d')],'sectionId':_0x9f7fc2['id']},{})[_0xf9e9('0x26')](function(){return _0x1f5d7b;});}else{return _0x1f5d7b;}})[_0xf9e9('0x47')](function(_0x31d01a){logger[_0xf9e9('0x2b')](_0xf9e9('0x52'),_0x31d01a);throw _0x31d01a;});}return _0x1f5d7b;})[_0xf9e9('0x26')](respondWithResult(_0x4ede16,0xc9))[_0xf9e9('0x47')](handleError(_0x4ede16,null));};exports[_0xf9e9('0x25')]=function(_0x34298d,_0x2ac840){if(_0x34298d[_0xf9e9('0x4d')]['id']){delete _0x34298d[_0xf9e9('0x4d')]['id'];}return db[_0xf9e9('0x31')][_0xf9e9('0x4b')]({'where':{'id':_0x34298d[_0xf9e9('0x53')]['id']}})['then'](handleEntityNotFound(_0x2ac840,null))[_0xf9e9('0x26')](saveUpdates(_0x34298d[_0xf9e9('0x4d')],null))['then'](respondWithResult(_0x2ac840,null))[_0xf9e9('0x47')](handleError(_0x2ac840,null));};exports['destroy']=function(_0x23dd28,_0x1be653){return db[_0xf9e9('0x31')][_0xf9e9('0x4b')]({'where':{'id':_0x23dd28['params']['id']}})[_0xf9e9('0x26')](handleEntityNotFound(_0x1be653,null))[_0xf9e9('0x26')](removeEntity(_0x1be653,null))[_0xf9e9('0x47')](handleError(_0x1be653,null));};exports[_0xf9e9('0x54')]=function(_0x4cb926,_0x40d97f,_0x50d533){return db[_0xf9e9('0x31')]['find']({'where':{'id':_0x4cb926[_0xf9e9('0x53')]['id']},'attributes':[_0xf9e9('0x2d'),'basename','savename',_0xf9e9('0x55')],'raw':!![]})['then'](handleEntityNotFound(_0x40d97f,null))[_0xf9e9('0x26')](function(_0x332660){if(_0x332660){if(!fs[_0xf9e9('0x56')](path[_0xf9e9('0x57')](config[_0xf9e9('0x58')],_0xf9e9('0x59'),_0x332660[_0xf9e9('0x5a')]))){throw new db[(_0xf9e9('0x5b'))][(_0xf9e9('0x5c'))](_0xf9e9('0x5d'));}if(_0x4cb926[_0xf9e9('0x35')]['exists']){return _0x40d97f[_0xf9e9('0x1b')](0xc8);}return _0x40d97f['download'](path[_0xf9e9('0x57')](config[_0xf9e9('0x58')],'server/files/reports',_0x332660[_0xf9e9('0x5a')]),util[_0xf9e9('0x5e')](_0xf9e9('0x5f'),_0x332660['basename']||_0x332660['name'],_0x332660[_0xf9e9('0x55')][_0xf9e9('0x60')]()));}})['catch'](handleError(_0x40d97f,null));}; \ No newline at end of file +var _0xf900=['destroy','download','basename','savename','output','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','format','%s.%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','get','ExtractedReports','UserProfileResource','error','stack','name','send','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','rows','show','params','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body'];(function(_0x3feb4a,_0x537c6e){var _0x41f421=function(_0x46736b){while(--_0x46736b){_0x3feb4a['push'](_0x3feb4a['shift']());}};_0x41f421(++_0x537c6e);}(_0xf900,0x189));var _0x0f90=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xf900[_0x1928c9];return _0x51b5fb;};'use strict';var emlformat=require(_0x0f90('0x0'));var rimraf=require(_0x0f90('0x1'));var zipdir=require(_0x0f90('0x2'));var jsonpatch=require(_0x0f90('0x3'));var rp=require('request-promise');var moment=require(_0x0f90('0x4'));var BPromise=require(_0x0f90('0x5'));var Mustache=require('mustache');var util=require(_0x0f90('0x6'));var path=require(_0x0f90('0x7'));var sox=require('sox');var csv=require(_0x0f90('0x8'));var ejs=require(_0x0f90('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0f90('0xa'));var squel=require(_0x0f90('0xb'));var crypto=require('crypto');var jsforce=require(_0x0f90('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0f90('0x8'));var querystring=require(_0x0f90('0xd'));var Papa=require(_0x0f90('0xe'));var Redis=require(_0x0f90('0xf'));var authService=require(_0x0f90('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x0f90('0x11'));var hardwareService=require(_0x0f90('0x12'));var logger=require(_0x0f90('0x13'))(_0x0f90('0x14'));var utils=require(_0x0f90('0x15'));var config=require(_0x0f90('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x0f90('0x17'))['db'];function respondWithStatusCode(_0x48a4cc,_0xa24e6e){_0xa24e6e=_0xa24e6e||0xcc;return function(_0x290584){if(_0x290584){return _0x48a4cc[_0x0f90('0x18')](_0xa24e6e);}return _0x48a4cc[_0x0f90('0x19')](_0xa24e6e)[_0x0f90('0x1a')]();};}function respondWithResult(_0x3c5e22,_0x1c65b7){_0x1c65b7=_0x1c65b7||0xc8;return function(_0x17c01b){if(_0x17c01b){return _0x3c5e22[_0x0f90('0x19')](_0x1c65b7)[_0x0f90('0x1b')](_0x17c01b);}};}function respondWithFilteredResult(_0x1e475c,_0x162418){return function(_0x5d8539){if(_0x5d8539){var _0x25cdfe=typeof _0x162418['offset']===_0x0f90('0x1c')&&typeof _0x162418[_0x0f90('0x1d')]==='undefined';var _0x16f982=_0x5d8539[_0x0f90('0x1e')];var _0x2f9e7e=_0x25cdfe?0x0:_0x162418[_0x0f90('0x1f')];var _0x5bb3fd=_0x25cdfe?_0x5d8539[_0x0f90('0x1e')]:_0x162418[_0x0f90('0x1f')]+_0x162418[_0x0f90('0x1d')];var _0xff3020;if(_0x5bb3fd>=_0x16f982){_0x5bb3fd=_0x16f982;_0xff3020=0xc8;}else{_0xff3020=0xce;}_0x1e475c[_0x0f90('0x19')](_0xff3020);return _0x1e475c[_0x0f90('0x20')](_0x0f90('0x21'),_0x2f9e7e+'-'+_0x5bb3fd+'/'+_0x16f982)['json'](_0x5d8539);}return null;};}function patchUpdates(_0x337dab){return function(_0x3afef6){try{jsonpatch[_0x0f90('0x22')](_0x3afef6,_0x337dab,!![]);}catch(_0x40fd9b){return BPromise[_0x0f90('0x23')](_0x40fd9b);}return _0x3afef6[_0x0f90('0x24')]();};}function saveUpdates(_0x2dc3c5,_0x2bd804){return function(_0x5a74a3){if(_0x5a74a3){return _0x5a74a3[_0x0f90('0x25')](_0x2dc3c5)[_0x0f90('0x26')](function(_0x2df677){return _0x2df677;});}return null;};}function removeEntity(_0x29ccee,_0x2b4bc4){return function(_0x9fcdf3){if(_0x9fcdf3){return _0x9fcdf3['destroy']()[_0x0f90('0x26')](function(){var _0x5acbff=_0x9fcdf3[_0x0f90('0x27')]({'plain':!![]});var _0x30837c=_0x0f90('0x28');return db[_0x0f90('0x29')]['destroy']({'where':{'type':_0x30837c,'resourceId':_0x5acbff['id']}})['then'](function(){return _0x9fcdf3;});})[_0x0f90('0x26')](function(){_0x29ccee[_0x0f90('0x19')](0xcc)[_0x0f90('0x1a')]();});}};}function handleEntityNotFound(_0x2d6320,_0x140169){return function(_0x55bad0){if(!_0x55bad0){_0x2d6320[_0x0f90('0x18')](0x194);}return _0x55bad0;};}function handleError(_0x7ab9b8,_0x30b4c1){_0x30b4c1=_0x30b4c1||0x1f4;return function(_0x3f1cb0){logger[_0x0f90('0x2a')](_0x3f1cb0[_0x0f90('0x2b')]);if(_0x3f1cb0[_0x0f90('0x2c')]){delete _0x3f1cb0[_0x0f90('0x2c')];}_0x7ab9b8['status'](_0x30b4c1)[_0x0f90('0x2d')](_0x3f1cb0);};}exports['index']=function(_0x5af6c2,_0x42bcb8){var _0x596325={},_0x90f1a2={},_0x391e8e={'count':0x0,'rows':[]};var _0x3401df=_['map'](db[_0x0f90('0x2e')][_0x0f90('0x2f')],function(_0x279f32){return{'name':_0x279f32[_0x0f90('0x30')],'type':_0x279f32[_0x0f90('0x31')][_0x0f90('0x32')]};});_0x90f1a2[_0x0f90('0x33')]=_['map'](_0x3401df,_0x0f90('0x2c'));_0x90f1a2['query']=_[_0x0f90('0x34')](_0x5af6c2[_0x0f90('0x35')]);_0x90f1a2[_0x0f90('0x36')]=_[_0x0f90('0x37')](_0x90f1a2[_0x0f90('0x33')],_0x90f1a2[_0x0f90('0x35')]);_0x596325[_0x0f90('0x38')]=_[_0x0f90('0x37')](_0x90f1a2[_0x0f90('0x33')],qs['fields'](_0x5af6c2[_0x0f90('0x35')][_0x0f90('0x39')]));_0x596325[_0x0f90('0x38')]=_0x596325[_0x0f90('0x38')][_0x0f90('0x3a')]?_0x596325[_0x0f90('0x38')]:_0x90f1a2[_0x0f90('0x33')];if(!_0x5af6c2[_0x0f90('0x35')][_0x0f90('0x3b')](_0x0f90('0x3c'))){_0x596325['limit']=qs[_0x0f90('0x1d')](_0x5af6c2[_0x0f90('0x35')][_0x0f90('0x1d')]);_0x596325[_0x0f90('0x1f')]=qs[_0x0f90('0x1f')](_0x5af6c2['query'][_0x0f90('0x1f')]);}_0x596325[_0x0f90('0x3d')]=qs[_0x0f90('0x3e')](_0x5af6c2[_0x0f90('0x35')][_0x0f90('0x3e')]);_0x596325[_0x0f90('0x3f')]=qs[_0x0f90('0x36')](_['pick'](_0x5af6c2[_0x0f90('0x35')],_0x90f1a2[_0x0f90('0x36')]),_0x3401df);if(_0x5af6c2[_0x0f90('0x35')][_0x0f90('0x40')]){_0x596325[_0x0f90('0x3f')]=_[_0x0f90('0x41')](_0x596325['where'],{'$or':_['map'](_0x3401df,function(_0x2a37ff){if(_0x2a37ff['type']!==_0x0f90('0x42')){var _0x428fa0={};_0x428fa0[_0x2a37ff[_0x0f90('0x2c')]]={'$like':'%'+_0x5af6c2[_0x0f90('0x35')][_0x0f90('0x40')]+'%'};return _0x428fa0;}})});}_0x596325=_[_0x0f90('0x41')]({},_0x596325,_0x5af6c2[_0x0f90('0x43')]);var _0x5a6dd7={'where':_0x596325[_0x0f90('0x3f')]};return db['AnalyticExtractedReport'][_0x0f90('0x1e')](_0x5a6dd7)[_0x0f90('0x26')](function(_0x2b346e){_0x391e8e[_0x0f90('0x1e')]=_0x2b346e;if(_0x5af6c2[_0x0f90('0x35')][_0x0f90('0x44')]){_0x596325['include']=[{'all':!![]}];}return db[_0x0f90('0x2e')]['findAll'](_0x596325);})[_0x0f90('0x26')](function(_0x4b001a){_0x391e8e[_0x0f90('0x45')]=_0x4b001a;return _0x391e8e;})[_0x0f90('0x26')](respondWithFilteredResult(_0x42bcb8,_0x596325))['catch'](handleError(_0x42bcb8,null));};exports[_0x0f90('0x46')]=function(_0x3c05f8,_0x4ea748){var _0x23f919={'raw':!![],'where':{'id':_0x3c05f8[_0x0f90('0x47')]['id']}},_0x286d2f={};_0x286d2f['model']=_[_0x0f90('0x34')](db[_0x0f90('0x2e')][_0x0f90('0x2f')]);_0x286d2f[_0x0f90('0x35')]=_[_0x0f90('0x34')](_0x3c05f8['query']);_0x286d2f[_0x0f90('0x36')]=_['intersection'](_0x286d2f[_0x0f90('0x33')],_0x286d2f[_0x0f90('0x35')]);_0x23f919[_0x0f90('0x38')]=_['intersection'](_0x286d2f[_0x0f90('0x33')],qs[_0x0f90('0x39')](_0x3c05f8[_0x0f90('0x35')][_0x0f90('0x39')]));_0x23f919[_0x0f90('0x38')]=_0x23f919['attributes']['length']?_0x23f919[_0x0f90('0x38')]:_0x286d2f[_0x0f90('0x33')];if(_0x3c05f8['query'][_0x0f90('0x44')]){_0x23f919['include']=[{'all':!![]}];}_0x23f919=_[_0x0f90('0x41')]({},_0x23f919,_0x3c05f8['options']);return db[_0x0f90('0x2e')][_0x0f90('0x48')](_0x23f919)[_0x0f90('0x26')](handleEntityNotFound(_0x4ea748,null))[_0x0f90('0x26')](respondWithResult(_0x4ea748,null))[_0x0f90('0x49')](handleError(_0x4ea748,null));};exports[_0x0f90('0x4a')]=function(_0x239b95,_0x419641){return db[_0x0f90('0x2e')][_0x0f90('0x4a')](_0x239b95['body'],{})[_0x0f90('0x26')](function(_0xb20121){var _0x450d8f=_0x239b95[_0x0f90('0x4b')]['get']({'plain':!![]});if(!_0x450d8f)throw new Error(_0x0f90('0x4c'));if(_0x450d8f['role']==='user'){var _0x1f4dfd=_0xb20121[_0x0f90('0x27')]({'plain':!![]});var _0x439dbf=_0x0f90('0x28');return db[_0x0f90('0x4d')][_0x0f90('0x48')]({'where':{'name':_0x439dbf,'userProfileId':_0x450d8f[_0x0f90('0x4e')]},'raw':!![]})[_0x0f90('0x26')](function(_0x33c01a){if(_0x33c01a&&_0x33c01a[_0x0f90('0x4f')]===0x0){return db[_0x0f90('0x29')][_0x0f90('0x4a')]({'name':_0x1f4dfd[_0x0f90('0x2c')],'resourceId':_0x1f4dfd['id'],'type':_0x33c01a[_0x0f90('0x2c')],'sectionId':_0x33c01a['id']},{})[_0x0f90('0x26')](function(){return _0xb20121;});}else{return _0xb20121;}})[_0x0f90('0x49')](function(_0x5c4b66){logger['error'](_0x0f90('0x50'),_0x5c4b66);throw _0x5c4b66;});}return _0xb20121;})[_0x0f90('0x26')](respondWithResult(_0x419641,0xc9))[_0x0f90('0x49')](handleError(_0x419641,null));};exports[_0x0f90('0x25')]=function(_0x3e99bb,_0x5b9a5d){if(_0x3e99bb[_0x0f90('0x51')]['id']){delete _0x3e99bb['body']['id'];}return db['AnalyticExtractedReport'][_0x0f90('0x48')]({'where':{'id':_0x3e99bb[_0x0f90('0x47')]['id']}})[_0x0f90('0x26')](handleEntityNotFound(_0x5b9a5d,null))[_0x0f90('0x26')](saveUpdates(_0x3e99bb[_0x0f90('0x51')],null))['then'](respondWithResult(_0x5b9a5d,null))[_0x0f90('0x49')](handleError(_0x5b9a5d,null));};exports[_0x0f90('0x52')]=function(_0x3c049f,_0x170544){return db[_0x0f90('0x2e')][_0x0f90('0x48')]({'where':{'id':_0x3c049f['params']['id']}})['then'](handleEntityNotFound(_0x170544,null))['then'](removeEntity(_0x170544,null))[_0x0f90('0x49')](handleError(_0x170544,null));};exports[_0x0f90('0x53')]=function(_0x58a835,_0x2a35fe,_0x2e88c8){return db[_0x0f90('0x2e')][_0x0f90('0x48')]({'where':{'id':_0x58a835['params']['id']},'attributes':[_0x0f90('0x2c'),_0x0f90('0x54'),_0x0f90('0x55'),_0x0f90('0x56')],'raw':!![]})['then'](handleEntityNotFound(_0x2a35fe,null))[_0x0f90('0x26')](function(_0x398087){if(_0x398087){if(!fs['existsSync'](path[_0x0f90('0x57')](config[_0x0f90('0x58')],_0x0f90('0x59'),_0x398087['savename']))){throw new db[(_0x0f90('0x5a'))][(_0x0f90('0x5b'))](_0x0f90('0x5c'));}if(_0x58a835[_0x0f90('0x35')]['exists']){return _0x2a35fe['sendStatus'](0xc8);}return _0x2a35fe[_0x0f90('0x53')](path[_0x0f90('0x57')](config[_0x0f90('0x58')],_0x0f90('0x59'),_0x398087[_0x0f90('0x55')]),util[_0x0f90('0x5d')](_0x0f90('0x5e'),_0x398087[_0x0f90('0x54')]||_0x398087['name'],_0x398087['output']['toLowerCase']()));}})[_0x0f90('0x49')](handleError(_0x2a35fe,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index f7a3ef7..32f8421 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 _0x3143=['lodash','api','path','../../config/environment','exports','AnalyticExtractedReport','analytics_extracted_reports'];(function(_0x302eba,_0xc1ce6b){var _0x3aac5e=function(_0x14ca21){while(--_0x14ca21){_0x302eba['push'](_0x302eba['shift']());}};_0x3aac5e(++_0xc1ce6b);}(_0x3143,0xcb));var _0x3314=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0x3143[_0x3070dc];return _0x431489;};'use strict';var _=require(_0x3314('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3314('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3314('0x2'));var rimraf=require('rimraf');var config=require(_0x3314('0x3'));var attributes=require('./analyticExtractedReport.attributes');module[_0x3314('0x4')]=function(_0x3b4ca0,_0x4b546c){return _0x3b4ca0['define'](_0x3314('0x5'),attributes,{'tableName':_0x3314('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x03b5=['analytics_extracted_reports','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define'];(function(_0xe11b16,_0x1a7294){var _0x59bd29=function(_0x254c4d){while(--_0x254c4d){_0xe11b16['push'](_0xe11b16['shift']());}};_0x59bd29(++_0x1a7294);}(_0x03b5,0x91));var _0x503b=function(_0x1b7c93,_0x3e6b09){_0x1b7c93=_0x1b7c93-0x0;var _0x6c434d=_0x03b5[_0x1b7c93];return _0x6c434d;};'use strict';var _=require('lodash');var util=require(_0x503b('0x0'));var logger=require(_0x503b('0x1'))('api');var moment=require(_0x503b('0x2'));var BPromise=require(_0x503b('0x3'));var rp=require(_0x503b('0x4'));var fs=require('fs');var path=require(_0x503b('0x5'));var rimraf=require(_0x503b('0x6'));var config=require(_0x503b('0x7'));var attributes=require(_0x503b('0x8'));module[_0x503b('0x9')]=function(_0x27c494,_0x45e2ed){return _0x27c494[_0x503b('0xa')]('AnalyticExtractedReport',attributes,{'tableName':_0x503b('0xb'),'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 ae07f1a..b9c4002 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 _0x1932=['code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x3c9038,_0x8157ff){var _0x103439=function(_0x5f47eb){while(--_0x5f47eb){_0x3c9038['push'](_0x3c9038['shift']());}};_0x103439(++_0x8157ff);}(_0x1932,0xbb));var _0x2193=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x1932[_0x17b6e3];return _0x3906f3;};'use strict';var _=require(_0x2193('0x0'));var util=require(_0x2193('0x1'));var moment=require(_0x2193('0x2'));var BPromise=require(_0x2193('0x3'));var rs=require(_0x2193('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2193('0x5'))['db'];var utils=require(_0x2193('0x6'));var logger=require(_0x2193('0x7'))(_0x2193('0x8'));var config=require(_0x2193('0x9'));var jayson=require(_0x2193('0xa'));var client=jayson[_0x2193('0xb')][_0x2193('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3479ff,_0x1f9cb2,_0xe886ff){return new BPromise(function(_0x436b26,_0x3f4e40){return client[_0x2193('0xd')](_0x3479ff,_0xe886ff)['then'](function(_0x2b53d5){logger[_0x2193('0xe')](_0x2193('0xf'),_0x1f9cb2,_0x2193('0x10'));logger[_0x2193('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x1f9cb2,_0x2193('0x10'),JSON[_0x2193('0x12')](_0x2b53d5));if(_0x2b53d5[_0x2193('0x13')]){if(_0x2b53d5[_0x2193('0x13')][_0x2193('0x14')]===0x1f4){logger[_0x2193('0x13')](_0x2193('0xf'),_0x1f9cb2,_0x2b53d5[_0x2193('0x13')][_0x2193('0x15')]);return _0x3f4e40(_0x2b53d5['error'][_0x2193('0x15')]);}logger['error'](_0x2193('0xf'),_0x1f9cb2,_0x2b53d5[_0x2193('0x13')][_0x2193('0x15')]);return _0x436b26(_0x2b53d5[_0x2193('0x13')]['message']);}else{logger[_0x2193('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1f9cb2,_0x2193('0x10'));_0x436b26(_0x2b53d5['result'][_0x2193('0x15')]);}})[_0x2193('0x16')](function(_0x28de88){logger[_0x2193('0x13')](_0x2193('0xf'),_0x1f9cb2,_0x28de88);_0x3f4e40(_0x28de88);});});} \ No newline at end of file +var _0xd557=['../../config/utils','rpc','jayson/promise','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x24b504,_0x300231){var _0x4ebed9=function(_0x36c6e2){while(--_0x36c6e2){_0x24b504['push'](_0x24b504['shift']());}};_0x4ebed9(++_0x300231);}(_0xd557,0x18a));var _0x7d55=function(_0x2a1432,_0x3f09bb){_0x2a1432=_0x2a1432-0x0;var _0x359c02=_0xd557[_0x2a1432];return _0x359c02;};'use strict';var _=require(_0x7d55('0x0'));var util=require(_0x7d55('0x1'));var moment=require(_0x7d55('0x2'));var BPromise=require(_0x7d55('0x3'));var rs=require(_0x7d55('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7d55('0x5'))['db'];var utils=require(_0x7d55('0x6'));var logger=require('../../config/logger')(_0x7d55('0x7'));var config=require('../../config/environment');var jayson=require(_0x7d55('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x353fd9,_0x556884,_0x2511e0){return new BPromise(function(_0x1487a3,_0x3e2667){return client[_0x7d55('0x9')](_0x353fd9,_0x2511e0)[_0x7d55('0xa')](function(_0xcf66b){logger[_0x7d55('0xb')](_0x7d55('0xc'),_0x556884,'request\x20sent');logger[_0x7d55('0xd')](_0x7d55('0xe'),_0x556884,'request\x20sent',JSON['stringify'](_0xcf66b));if(_0xcf66b[_0x7d55('0xf')]){if(_0xcf66b[_0x7d55('0xf')][_0x7d55('0x10')]===0x1f4){logger['error'](_0x7d55('0xc'),_0x556884,_0xcf66b[_0x7d55('0xf')][_0x7d55('0x11')]);return _0x3e2667(_0xcf66b['error'][_0x7d55('0x11')]);}logger[_0x7d55('0xf')](_0x7d55('0xc'),_0x556884,_0xcf66b[_0x7d55('0xf')][_0x7d55('0x11')]);return _0x1487a3(_0xcf66b[_0x7d55('0xf')][_0x7d55('0x11')]);}else{logger[_0x7d55('0xb')](_0x7d55('0xc'),_0x556884,'request\x20sent');_0x1487a3(_0xcf66b[_0x7d55('0x12')][_0x7d55('0x11')]);}})[_0x7d55('0x13')](function(_0x2729d8){logger['error'](_0x7d55('0xc'),_0x556884,_0x2729d8);_0x3e2667(_0x2729d8);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 025cf24..4b4e0eb 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 _0x090d=['../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','index','get','/:id','show','/:id/download','download','post','create','put','update','delete','exports','util','path','connect-timeout','express','fs-extra'];(function(_0x5d04bc,_0x5662aa){var _0x29c6f1=function(_0x452dad){while(--_0x452dad){_0x5d04bc['push'](_0x5d04bc['shift']());}};_0x29c6f1(++_0x5662aa);}(_0x090d,0x1de));var _0xd090=function(_0x111c52,_0x3ffb50){_0x111c52=_0x111c52-0x0;var _0x455ab0=_0x090d[_0x111c52];return _0x455ab0;};'use strict';var multer=require('multer');var util=require(_0xd090('0x0'));var path=require(_0xd090('0x1'));var timeout=require(_0xd090('0x2'));var express=require(_0xd090('0x3'));var router=express['Router']();var fs_extra=require(_0xd090('0x4'));var auth=require(_0xd090('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd090('0x6'));var controller=require(_0xd090('0x7'));router['get']('/',auth[_0xd090('0x8')](),controller[_0xd090('0x9')]);router[_0xd090('0xa')](_0xd090('0xb'),auth[_0xd090('0x8')](),controller[_0xd090('0xc')]);router[_0xd090('0xa')](_0xd090('0xd'),auth['isAuthenticated'](),controller[_0xd090('0xe')]);router[_0xd090('0xf')]('/',auth[_0xd090('0x8')](),controller[_0xd090('0x10')]);router[_0xd090('0x11')]('/:id',auth[_0xd090('0x8')](),controller[_0xd090('0x12')]);router[_0xd090('0x13')]('/:id',auth[_0xd090('0x8')](),controller['destroy']);module[_0xd090('0x14')]=router; \ No newline at end of file +var _0x22a5=['/:id','isAuthenticated','show','/:id/download','download','post','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get'];(function(_0x5d8b34,_0x413fce){var _0x5599ba=function(_0x3d43a4){while(--_0x3d43a4){_0x5d8b34['push'](_0x5d8b34['shift']());}};_0x5599ba(++_0x413fce);}(_0x22a5,0xe1));var _0x522a=function(_0x5cc67e,_0x3e5960){_0x5cc67e=_0x5cc67e-0x0;var _0x8a4199=_0x22a5[_0x5cc67e];return _0x8a4199;};'use strict';var multer=require(_0x522a('0x0'));var util=require(_0x522a('0x1'));var path=require('path');var timeout=require(_0x522a('0x2'));var express=require(_0x522a('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x522a('0x4'));var interaction=require(_0x522a('0x5'));var config=require(_0x522a('0x6'));var controller=require(_0x522a('0x7'));router[_0x522a('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x522a('0x8')](_0x522a('0x9'),auth[_0x522a('0xa')](),controller[_0x522a('0xb')]);router['get'](_0x522a('0xc'),auth[_0x522a('0xa')](),controller[_0x522a('0xd')]);router[_0x522a('0xe')]('/',auth[_0x522a('0xa')](),controller['create']);router['put'](_0x522a('0x9'),auth[_0x522a('0xa')](),controller['update']);router[_0x522a('0xf')](_0x522a('0x9'),auth[_0x522a('0xa')](),controller[_0x522a('0x10')]);module[_0x522a('0x11')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 85f5f05..f310be2 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 _0x6b87=['exports','STRING','BOOLEAN','sequelize'];(function(_0x405d00,_0x395604){var _0xfa3103=function(_0x553cc2){while(--_0x553cc2){_0x405d00['push'](_0x405d00['shift']());}};_0xfa3103(++_0x395604);}(_0x6b87,0x163));var _0x76b8=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x6b87[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x76b8('0x0'));module[_0x76b8('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x76b8('0x2')]},'function':{'type':Sequelize[_0x76b8('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x76b8('0x2')]},'custom':{'type':Sequelize[_0x76b8('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x4fd8=['sequelize','exports','STRING','BOOLEAN'];(function(_0x8d065b,_0x4c6115){var _0x1244e3=function(_0x2555ff){while(--_0x2555ff){_0x8d065b['push'](_0x8d065b['shift']());}};_0x1244e3(++_0x4c6115);}(_0x4fd8,0x104));var _0x84fd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4fd8[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x84fd('0x0'));module[_0x84fd('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x84fd('0x2')]},'function':{'type':Sequelize[_0x84fd('0x2')]},'format':{'type':Sequelize[_0x84fd('0x2')]},'groupBy':{'type':Sequelize[_0x84fd('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x84fd('0x2')]},'custom':{'type':Sequelize[_0x84fd('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 4177442..1fe2d2f 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 _0xad53=['fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','find','create','bulkCreate','body','addFields','findOne','CustomReportId','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','key','model','query','keys','filters','attributes','intersection'];(function(_0x553ebf,_0x20d88c){var _0x3c0731=function(_0xa61a87){while(--_0xa61a87){_0x553ebf['push'](_0x553ebf['shift']());}};_0x3c0731(++_0x20d88c);}(_0xad53,0x1ed));var _0x3ad5=function(_0x5d23a9,_0x224bf8){_0x5d23a9=_0x5d23a9-0x0;var _0x43b5aa=_0xad53[_0x5d23a9];return _0x43b5aa;};'use strict';var emlformat=require(_0x3ad5('0x0'));var rimraf=require(_0x3ad5('0x1'));var zipdir=require(_0x3ad5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3ad5('0x3'));var moment=require(_0x3ad5('0x4'));var BPromise=require(_0x3ad5('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3ad5('0x6'));var sox=require(_0x3ad5('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3ad5('0x8'));var _=require(_0x3ad5('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3ad5('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x3ad5('0xb'));var querystring=require(_0x3ad5('0xc'));var Papa=require(_0x3ad5('0xd'));var Redis=require(_0x3ad5('0xe'));var authService=require(_0x3ad5('0xf'));var qs=require(_0x3ad5('0x10'));var as=require(_0x3ad5('0x11'));var hardwareService=require(_0x3ad5('0x12'));var logger=require(_0x3ad5('0x13'))(_0x3ad5('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3ad5('0x15'));var db=require(_0x3ad5('0x16'))['db'];function respondWithStatusCode(_0x3c0aa7,_0x511ea3){_0x511ea3=_0x511ea3||0xcc;return function(_0x342982){if(_0x342982){return _0x3c0aa7[_0x3ad5('0x17')](_0x511ea3);}return _0x3c0aa7['status'](_0x511ea3)[_0x3ad5('0x18')]();};}function respondWithResult(_0x12a820,_0x57d7e5){_0x57d7e5=_0x57d7e5||0xc8;return function(_0x237185){if(_0x237185){return _0x12a820[_0x3ad5('0x19')](_0x57d7e5)[_0x3ad5('0x1a')](_0x237185);}};}function respondWithFilteredResult(_0x364f7d,_0x14d44e){return function(_0xa2fe56){if(_0xa2fe56){var _0x25235b=typeof _0x14d44e['offset']===_0x3ad5('0x1b')&&typeof _0x14d44e[_0x3ad5('0x1c')]===_0x3ad5('0x1b');var _0x5a6959=_0xa2fe56[_0x3ad5('0x1d')];var _0x119ad2=_0x25235b?0x0:_0x14d44e['offset'];var _0x180a5a=_0x25235b?_0xa2fe56['count']:_0x14d44e[_0x3ad5('0x1e')]+_0x14d44e[_0x3ad5('0x1c')];var _0x5c8dd0;if(_0x180a5a>=_0x5a6959){_0x180a5a=_0x5a6959;_0x5c8dd0=0xc8;}else{_0x5c8dd0=0xce;}_0x364f7d[_0x3ad5('0x19')](_0x5c8dd0);return _0x364f7d[_0x3ad5('0x1f')](_0x3ad5('0x20'),_0x119ad2+'-'+_0x180a5a+'/'+_0x5a6959)[_0x3ad5('0x1a')](_0xa2fe56);}return null;};}function patchUpdates(_0x4585dc){return function(_0x140ea5){try{jsonpatch['apply'](_0x140ea5,_0x4585dc,!![]);}catch(_0x670dbc){return BPromise[_0x3ad5('0x21')](_0x670dbc);}return _0x140ea5[_0x3ad5('0x22')]();};}function saveUpdates(_0x59aace,_0x38c1f9){return function(_0x4776b1){if(_0x4776b1){return _0x4776b1[_0x3ad5('0x23')](_0x59aace)[_0x3ad5('0x24')](function(_0x1854a7){return _0x1854a7;});}return null;};}function removeEntity(_0xe7333e,_0x12cb75){return function(_0x1ac4cc){if(_0x1ac4cc){return _0x1ac4cc[_0x3ad5('0x25')]()[_0x3ad5('0x24')](function(){_0xe7333e['status'](0xcc)[_0x3ad5('0x18')]();});}};}function handleEntityNotFound(_0x1f173f,_0x3b6a5b){return function(_0x104e5b){if(!_0x104e5b){_0x1f173f[_0x3ad5('0x17')](0x194);}return _0x104e5b;};}function handleError(_0x2ab805,_0x52681f){_0x52681f=_0x52681f||0x1f4;return function(_0x18c151){logger[_0x3ad5('0x26')](_0x18c151[_0x3ad5('0x27')]);if(_0x18c151[_0x3ad5('0x28')]){delete _0x18c151['name'];}_0x2ab805[_0x3ad5('0x19')](_0x52681f)[_0x3ad5('0x29')](_0x18c151);};}exports[_0x3ad5('0x2a')]=function(_0x2a41ac,_0x41b7fa){var _0x52ea84={},_0x9b3725={},_0x3a9d32={'count':0x0,'rows':[]};var _0x2396c7=_[_0x3ad5('0x2b')](db[_0x3ad5('0x2c')][_0x3ad5('0x2d')],function(_0x351500){return{'name':_0x351500['fieldName'],'type':_0x351500['type'][_0x3ad5('0x2e')]};});_0x9b3725[_0x3ad5('0x2f')]=_[_0x3ad5('0x2b')](_0x2396c7,_0x3ad5('0x28'));_0x9b3725[_0x3ad5('0x30')]=_[_0x3ad5('0x31')](_0x2a41ac['query']);_0x9b3725[_0x3ad5('0x32')]=_['intersection'](_0x9b3725[_0x3ad5('0x2f')],_0x9b3725[_0x3ad5('0x30')]);_0x52ea84[_0x3ad5('0x33')]=_[_0x3ad5('0x34')](_0x9b3725[_0x3ad5('0x2f')],qs[_0x3ad5('0x35')](_0x2a41ac[_0x3ad5('0x30')][_0x3ad5('0x35')]));_0x52ea84[_0x3ad5('0x33')]=_0x52ea84[_0x3ad5('0x33')][_0x3ad5('0x36')]?_0x52ea84[_0x3ad5('0x33')]:_0x9b3725[_0x3ad5('0x2f')];if(!_0x2a41ac['query'][_0x3ad5('0x37')](_0x3ad5('0x38'))){_0x52ea84[_0x3ad5('0x1c')]=qs[_0x3ad5('0x1c')](_0x2a41ac[_0x3ad5('0x30')][_0x3ad5('0x1c')]);_0x52ea84[_0x3ad5('0x1e')]=qs[_0x3ad5('0x1e')](_0x2a41ac['query'][_0x3ad5('0x1e')]);}_0x52ea84[_0x3ad5('0x39')]=qs[_0x3ad5('0x3a')](_0x2a41ac[_0x3ad5('0x30')][_0x3ad5('0x3a')]);_0x52ea84[_0x3ad5('0x3b')]=qs[_0x3ad5('0x32')](_['pick'](_0x2a41ac[_0x3ad5('0x30')],_0x9b3725[_0x3ad5('0x32')]),_0x2396c7);if(_0x2a41ac['query'][_0x3ad5('0x3c')]){_0x52ea84[_0x3ad5('0x3b')]=_['merge'](_0x52ea84['where'],{'$or':_[_0x3ad5('0x2b')](_0x2396c7,function(_0x585bcf){if(_0x585bcf[_0x3ad5('0x3d')]!==_0x3ad5('0x3e')){var _0x41a696={};_0x41a696[_0x585bcf[_0x3ad5('0x28')]]={'$like':'%'+_0x2a41ac[_0x3ad5('0x30')][_0x3ad5('0x3c')]+'%'};return _0x41a696;}})});}_0x52ea84=_[_0x3ad5('0x3f')]({},_0x52ea84,_0x2a41ac[_0x3ad5('0x40')]);var _0x58f4f9={'where':_0x52ea84['where']};return db[_0x3ad5('0x2c')][_0x3ad5('0x1d')](_0x58f4f9)['then'](function(_0x58570e){_0x3a9d32[_0x3ad5('0x1d')]=_0x58570e;if(_0x2a41ac[_0x3ad5('0x30')]['includeAll']){_0x52ea84[_0x3ad5('0x41')]=[{'all':!![]}];}return db[_0x3ad5('0x2c')][_0x3ad5('0x42')](_0x52ea84);})[_0x3ad5('0x24')](function(_0x1a12b5){_0x3a9d32[_0x3ad5('0x43')]=_0x1a12b5;return _0x3a9d32;})['then'](respondWithFilteredResult(_0x41b7fa,_0x52ea84))[_0x3ad5('0x44')](handleError(_0x41b7fa,null));};exports[_0x3ad5('0x45')]=function(_0x2f1246,_0x1a3a46){var _0x187875={'raw':![],'where':{'id':_0x2f1246[_0x3ad5('0x46')]['id']}},_0x470af3={};_0x470af3[_0x3ad5('0x2f')]=_[_0x3ad5('0x31')](db[_0x3ad5('0x2c')][_0x3ad5('0x2d')]);_0x470af3[_0x3ad5('0x30')]=_[_0x3ad5('0x31')](_0x2f1246[_0x3ad5('0x30')]);_0x470af3[_0x3ad5('0x32')]=_[_0x3ad5('0x34')](_0x470af3[_0x3ad5('0x2f')],_0x470af3[_0x3ad5('0x30')]);_0x187875[_0x3ad5('0x33')]=_[_0x3ad5('0x34')](_0x470af3[_0x3ad5('0x2f')],qs[_0x3ad5('0x35')](_0x2f1246[_0x3ad5('0x30')][_0x3ad5('0x35')]));_0x187875[_0x3ad5('0x33')]=_0x187875[_0x3ad5('0x33')]['length']?_0x187875[_0x3ad5('0x33')]:_0x470af3[_0x3ad5('0x2f')];if(_0x2f1246[_0x3ad5('0x30')]['includeAll']){_0x187875[_0x3ad5('0x41')]=[{'all':!![]}];}_0x187875=_[_0x3ad5('0x3f')]({},_0x187875,_0x2f1246[_0x3ad5('0x40')]);return db[_0x3ad5('0x2c')][_0x3ad5('0x47')](_0x187875)[_0x3ad5('0x24')](handleEntityNotFound(_0x1a3a46,null))[_0x3ad5('0x24')](respondWithResult(_0x1a3a46,null))['catch'](handleError(_0x1a3a46,null));};exports[_0x3ad5('0x48')]=function(_0x324e71,_0x564f1b){return db[_0x3ad5('0x2c')][_0x3ad5('0x48')](_0x324e71['body'],{})[_0x3ad5('0x24')](respondWithResult(_0x564f1b,0xc9))[_0x3ad5('0x44')](handleError(_0x564f1b,null));};exports[_0x3ad5('0x49')]=function(_0x359510,_0x5a6676){return db[_0x3ad5('0x2c')][_0x3ad5('0x49')](_0x359510[_0x3ad5('0x4a')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x5a6676,0xc9))[_0x3ad5('0x44')](handleError(_0x5a6676,null));};exports[_0x3ad5('0x23')]=function(_0x5a8996,_0x179ab6){if(_0x5a8996[_0x3ad5('0x4a')]['id']){delete _0x5a8996[_0x3ad5('0x4a')]['id'];}return db[_0x3ad5('0x2c')][_0x3ad5('0x47')]({'where':{'id':_0x5a8996[_0x3ad5('0x46')]['id']}})[_0x3ad5('0x24')](handleEntityNotFound(_0x179ab6,null))[_0x3ad5('0x24')](saveUpdates(_0x5a8996['body'],null))['then'](respondWithResult(_0x179ab6,null))[_0x3ad5('0x44')](handleError(_0x179ab6,null));};exports[_0x3ad5('0x25')]=function(_0x1180c5,_0x1ccced){return db['AnalyticFieldReport']['find']({'where':{'id':_0x1180c5[_0x3ad5('0x46')]['id']}})[_0x3ad5('0x24')](handleEntityNotFound(_0x1ccced,null))['then'](removeEntity(_0x1ccced,null))[_0x3ad5('0x44')](handleError(_0x1ccced,null));};exports['bulkDestroy']=function(_0x3033b0,_0x2c37c2){return db[_0x3ad5('0x2c')]['destroy']({'where':{'id':_0x3033b0[_0x3ad5('0x30')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0x3ad5('0x24')](respondWithResult(_0x2c37c2,0xcc))['catch'](handleError(_0x2c37c2,null));};exports[_0x3ad5('0x4b')]=function(_0x5c4c47,_0x43de99,_0x68b63a){return db['AnalyticCustomReport'][_0x3ad5('0x4c')]({'where':{'id':_0x5c4c47['params']['id']}})[_0x3ad5('0x24')](handleEntityNotFound(_0x43de99,null))['then'](function(_0x4c2fe5){if(_0x4c2fe5){return db['sequelize']['transaction'](function(_0x304617){return db[_0x3ad5('0x2c')][_0x3ad5('0x25')]({'where':{'CustomReportId':_0x5c4c47[_0x3ad5('0x46')]['id']},'transaction':_0x304617})[_0x3ad5('0x24')](function(_0x58aa9a){var _0x17bbb6=_[_0x3ad5('0x2b')](_0x5c4c47[_0x3ad5('0x4a')],function(_0xe66bd1){delete _0xe66bd1['id'];_0xe66bd1[_0x3ad5('0x4d')]=_0x5c4c47['params']['id'];return _0xe66bd1;});return db['AnalyticFieldReport'][_0x3ad5('0x49')](_0x17bbb6,{'transaction':_0x304617});});})[_0x3ad5('0x24')](function(){return db[_0x3ad5('0x2c')][_0x3ad5('0x42')]({'where':{'CustomReportId':_0x5c4c47[_0x3ad5('0x46')]['id']}});});}})[_0x3ad5('0x24')](respondWithResult(_0x43de99,null))[_0x3ad5('0x44')](handleError(_0x43de99,null));}; \ No newline at end of file +var _0x5543=['addFields','findOne','sequelize','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','AnalyticFieldReport','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','options','includeAll','findAll','rows','catch','params','rawAttributes','include','create','body','bulkCreate','find','destroy','ids'];(function(_0x32c012,_0xe3c576){var _0x48562e=function(_0x505228){while(--_0x505228){_0x32c012['push'](_0x32c012['shift']());}};_0x48562e(++_0xe3c576);}(_0x5543,0x147));var _0x3554=function(_0x4bd06e,_0x593701){_0x4bd06e=_0x4bd06e-0x0;var _0x85ebb=_0x5543[_0x4bd06e];return _0x85ebb;};'use strict';var emlformat=require(_0x3554('0x0'));var rimraf=require(_0x3554('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3554('0x2'));var moment=require(_0x3554('0x3'));var BPromise=require(_0x3554('0x4'));var Mustache=require(_0x3554('0x5'));var util=require(_0x3554('0x6'));var path=require(_0x3554('0x7'));var sox=require(_0x3554('0x8'));var csv=require(_0x3554('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3554('0xa'));var squel=require(_0x3554('0xb'));var crypto=require(_0x3554('0xc'));var jsforce=require(_0x3554('0xd'));var deskjs=require(_0x3554('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3554('0xf'));var Papa=require('papaparse');var Redis=require(_0x3554('0x10'));var authService=require(_0x3554('0x11'));var qs=require(_0x3554('0x12'));var as=require(_0x3554('0x13'));var hardwareService=require(_0x3554('0x14'));var logger=require('../../config/logger')(_0x3554('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3554('0x16'))['db'];function respondWithStatusCode(_0x4ca6ad,_0x4f1cff){_0x4f1cff=_0x4f1cff||0xcc;return function(_0x38e587){if(_0x38e587){return _0x4ca6ad[_0x3554('0x17')](_0x4f1cff);}return _0x4ca6ad[_0x3554('0x18')](_0x4f1cff)[_0x3554('0x19')]();};}function respondWithResult(_0x1d86aa,_0x45e979){_0x45e979=_0x45e979||0xc8;return function(_0x7db94c){if(_0x7db94c){return _0x1d86aa[_0x3554('0x18')](_0x45e979)[_0x3554('0x1a')](_0x7db94c);}};}function respondWithFilteredResult(_0x5a02dd,_0x128c81){return function(_0x14db03){if(_0x14db03){var _0x4e9b58=typeof _0x128c81[_0x3554('0x1b')]===_0x3554('0x1c')&&typeof _0x128c81[_0x3554('0x1d')]===_0x3554('0x1c');var _0x3b6379=_0x14db03[_0x3554('0x1e')];var _0x5b632d=_0x4e9b58?0x0:_0x128c81[_0x3554('0x1b')];var _0xe1be12=_0x4e9b58?_0x14db03[_0x3554('0x1e')]:_0x128c81['offset']+_0x128c81[_0x3554('0x1d')];var _0x2dbf37;if(_0xe1be12>=_0x3b6379){_0xe1be12=_0x3b6379;_0x2dbf37=0xc8;}else{_0x2dbf37=0xce;}_0x5a02dd[_0x3554('0x18')](_0x2dbf37);return _0x5a02dd[_0x3554('0x1f')](_0x3554('0x20'),_0x5b632d+'-'+_0xe1be12+'/'+_0x3b6379)[_0x3554('0x1a')](_0x14db03);}return null;};}function patchUpdates(_0x179741){return function(_0xb96e6){try{jsonpatch[_0x3554('0x21')](_0xb96e6,_0x179741,!![]);}catch(_0x46a738){return BPromise[_0x3554('0x22')](_0x46a738);}return _0xb96e6[_0x3554('0x23')]();};}function saveUpdates(_0x48e88b,_0x2f197a){return function(_0x5ec2d9){if(_0x5ec2d9){return _0x5ec2d9[_0x3554('0x24')](_0x48e88b)[_0x3554('0x25')](function(_0x358a78){return _0x358a78;});}return null;};}function removeEntity(_0x1ae83c,_0x458324){return function(_0x361d52){if(_0x361d52){return _0x361d52['destroy']()[_0x3554('0x25')](function(){_0x1ae83c[_0x3554('0x18')](0xcc)[_0x3554('0x19')]();});}};}function handleEntityNotFound(_0x319288,_0xdc1180){return function(_0x448464){if(!_0x448464){_0x319288[_0x3554('0x17')](0x194);}return _0x448464;};}function handleError(_0x5a4337,_0x354b83){_0x354b83=_0x354b83||0x1f4;return function(_0x38707b){logger[_0x3554('0x26')](_0x38707b[_0x3554('0x27')]);if(_0x38707b[_0x3554('0x28')]){delete _0x38707b[_0x3554('0x28')];}_0x5a4337[_0x3554('0x18')](_0x354b83)[_0x3554('0x29')](_0x38707b);};}exports[_0x3554('0x2a')]=function(_0x4af3ad,_0x2637b2){var _0x5f3b07={},_0x51b139={},_0x28d773={'count':0x0,'rows':[]};var _0x36a8ec=_['map'](db[_0x3554('0x2b')]['rawAttributes'],function(_0x131b4b){return{'name':_0x131b4b[_0x3554('0x2c')],'type':_0x131b4b[_0x3554('0x2d')][_0x3554('0x2e')]};});_0x51b139['model']=_['map'](_0x36a8ec,_0x3554('0x28'));_0x51b139[_0x3554('0x2f')]=_[_0x3554('0x30')](_0x4af3ad[_0x3554('0x2f')]);_0x51b139['filters']=_[_0x3554('0x31')](_0x51b139[_0x3554('0x32')],_0x51b139[_0x3554('0x2f')]);_0x5f3b07[_0x3554('0x33')]=_[_0x3554('0x31')](_0x51b139[_0x3554('0x32')],qs['fields'](_0x4af3ad[_0x3554('0x2f')][_0x3554('0x34')]));_0x5f3b07[_0x3554('0x33')]=_0x5f3b07['attributes'][_0x3554('0x35')]?_0x5f3b07[_0x3554('0x33')]:_0x51b139['model'];if(!_0x4af3ad[_0x3554('0x2f')][_0x3554('0x36')](_0x3554('0x37'))){_0x5f3b07[_0x3554('0x1d')]=qs[_0x3554('0x1d')](_0x4af3ad[_0x3554('0x2f')][_0x3554('0x1d')]);_0x5f3b07['offset']=qs[_0x3554('0x1b')](_0x4af3ad[_0x3554('0x2f')][_0x3554('0x1b')]);}_0x5f3b07[_0x3554('0x38')]=qs[_0x3554('0x39')](_0x4af3ad['query']['sort']);_0x5f3b07[_0x3554('0x3a')]=qs[_0x3554('0x3b')](_[_0x3554('0x3c')](_0x4af3ad['query'],_0x51b139[_0x3554('0x3b')]),_0x36a8ec);if(_0x4af3ad[_0x3554('0x2f')][_0x3554('0x3d')]){_0x5f3b07[_0x3554('0x3a')]=_[_0x3554('0x3e')](_0x5f3b07[_0x3554('0x3a')],{'$or':_[_0x3554('0x3f')](_0x36a8ec,function(_0x4da091){if(_0x4da091[_0x3554('0x2d')]!=='VIRTUAL'){var _0x44a43a={};_0x44a43a[_0x4da091[_0x3554('0x28')]]={'$like':'%'+_0x4af3ad[_0x3554('0x2f')]['filter']+'%'};return _0x44a43a;}})});}_0x5f3b07=_[_0x3554('0x3e')]({},_0x5f3b07,_0x4af3ad[_0x3554('0x40')]);var _0x397c99={'where':_0x5f3b07['where']};return db[_0x3554('0x2b')][_0x3554('0x1e')](_0x397c99)[_0x3554('0x25')](function(_0x4413a0){_0x28d773[_0x3554('0x1e')]=_0x4413a0;if(_0x4af3ad[_0x3554('0x2f')][_0x3554('0x41')]){_0x5f3b07['include']=[{'all':!![]}];}return db[_0x3554('0x2b')][_0x3554('0x42')](_0x5f3b07);})[_0x3554('0x25')](function(_0x3bf7a9){_0x28d773[_0x3554('0x43')]=_0x3bf7a9;return _0x28d773;})[_0x3554('0x25')](respondWithFilteredResult(_0x2637b2,_0x5f3b07))[_0x3554('0x44')](handleError(_0x2637b2,null));};exports['show']=function(_0x317d57,_0x42549c){var _0x57564e={'raw':![],'where':{'id':_0x317d57[_0x3554('0x45')]['id']}},_0x31658c={};_0x31658c[_0x3554('0x32')]=_[_0x3554('0x30')](db[_0x3554('0x2b')][_0x3554('0x46')]);_0x31658c['query']=_[_0x3554('0x30')](_0x317d57[_0x3554('0x2f')]);_0x31658c['filters']=_[_0x3554('0x31')](_0x31658c[_0x3554('0x32')],_0x31658c['query']);_0x57564e[_0x3554('0x33')]=_[_0x3554('0x31')](_0x31658c[_0x3554('0x32')],qs[_0x3554('0x34')](_0x317d57[_0x3554('0x2f')][_0x3554('0x34')]));_0x57564e['attributes']=_0x57564e['attributes']['length']?_0x57564e[_0x3554('0x33')]:_0x31658c['model'];if(_0x317d57['query'][_0x3554('0x41')]){_0x57564e[_0x3554('0x47')]=[{'all':!![]}];}_0x57564e=_['merge']({},_0x57564e,_0x317d57[_0x3554('0x40')]);return db[_0x3554('0x2b')]['find'](_0x57564e)['then'](handleEntityNotFound(_0x42549c,null))['then'](respondWithResult(_0x42549c,null))[_0x3554('0x44')](handleError(_0x42549c,null));};exports['create']=function(_0xd67246,_0x26bdc3){return db[_0x3554('0x2b')][_0x3554('0x48')](_0xd67246[_0x3554('0x49')],{})[_0x3554('0x25')](respondWithResult(_0x26bdc3,0xc9))[_0x3554('0x44')](handleError(_0x26bdc3,null));};exports[_0x3554('0x4a')]=function(_0x4382f9,_0x10cc65){return db[_0x3554('0x2b')][_0x3554('0x4a')](_0x4382f9['body'],{'raw':![],'individualHooks':!![]})[_0x3554('0x25')](respondWithResult(_0x10cc65,0xc9))[_0x3554('0x44')](handleError(_0x10cc65,null));};exports[_0x3554('0x24')]=function(_0x508d52,_0x474bd5){if(_0x508d52[_0x3554('0x49')]['id']){delete _0x508d52['body']['id'];}return db[_0x3554('0x2b')][_0x3554('0x4b')]({'where':{'id':_0x508d52['params']['id']}})[_0x3554('0x25')](handleEntityNotFound(_0x474bd5,null))[_0x3554('0x25')](saveUpdates(_0x508d52['body'],null))[_0x3554('0x25')](respondWithResult(_0x474bd5,null))[_0x3554('0x44')](handleError(_0x474bd5,null));};exports[_0x3554('0x4c')]=function(_0x28d720,_0x28a05e){return db[_0x3554('0x2b')][_0x3554('0x4b')]({'where':{'id':_0x28d720['params']['id']}})[_0x3554('0x25')](handleEntityNotFound(_0x28a05e,null))['then'](removeEntity(_0x28a05e,null))[_0x3554('0x44')](handleError(_0x28a05e,null));};exports['bulkDestroy']=function(_0x955138,_0x304c0c){return db['AnalyticFieldReport'][_0x3554('0x4c')]({'where':{'id':_0x955138['query'][_0x3554('0x4d')]||[]},'raw':![],'individualHooks':!![]})[_0x3554('0x25')](respondWithResult(_0x304c0c,0xcc))[_0x3554('0x44')](handleError(_0x304c0c,null));};exports[_0x3554('0x4e')]=function(_0x85df6b,_0x507b76,_0x5c5f97){return db['AnalyticCustomReport'][_0x3554('0x4f')]({'where':{'id':_0x85df6b[_0x3554('0x45')]['id']}})[_0x3554('0x25')](handleEntityNotFound(_0x507b76,null))[_0x3554('0x25')](function(_0x1de011){if(_0x1de011){return db[_0x3554('0x50')]['transaction'](function(_0x4849fb){return db[_0x3554('0x2b')][_0x3554('0x4c')]({'where':{'CustomReportId':_0x85df6b[_0x3554('0x45')]['id']},'transaction':_0x4849fb})[_0x3554('0x25')](function(_0x643eb4){var _0x3d06a6=_[_0x3554('0x3f')](_0x85df6b[_0x3554('0x49')],function(_0x42c104){delete _0x42c104['id'];_0x42c104['CustomReportId']=_0x85df6b[_0x3554('0x45')]['id'];return _0x42c104;});return db[_0x3554('0x2b')]['bulkCreate'](_0x3d06a6,{'transaction':_0x4849fb});});})[_0x3554('0x25')](function(){return db[_0x3554('0x2b')]['findAll']({'where':{'CustomReportId':_0x85df6b['params']['id']}});});}})[_0x3554('0x25')](respondWithResult(_0x507b76,null))[_0x3554('0x44')](handleError(_0x507b76,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 8565ad4..3a254c9 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 _0x5115=['./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger','api','moment','request-promise'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0x5115,0x145));var _0x5511=function(_0x416483,_0x2e8e99){_0x416483=_0x416483-0x0;var _0x413ef6=_0x5115[_0x416483];return _0x413ef6;};'use strict';var _=require(_0x5511('0x0'));var util=require('util');var logger=require(_0x5511('0x1'))(_0x5511('0x2'));var moment=require(_0x5511('0x3'));var BPromise=require('bluebird');var rp=require(_0x5511('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5511('0x5'));module[_0x5511('0x6')]=function(_0x48419e,_0x50e64a){return _0x48419e[_0x5511('0x7')](_0x5511('0x8'),attributes,{'tableName':_0x5511('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6e14=['analytics_report_fields','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','define'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6e14,0x12d));var _0x46e1=function(_0x1ee5be,_0x5f46e3){_0x1ee5be=_0x1ee5be-0x0;var _0x177140=_0x6e14[_0x1ee5be];return _0x177140;};'use strict';var _=require(_0x46e1('0x0'));var util=require(_0x46e1('0x1'));var logger=require(_0x46e1('0x2'))('api');var moment=require(_0x46e1('0x3'));var BPromise=require('bluebird');var rp=require(_0x46e1('0x4'));var fs=require('fs');var path=require(_0x46e1('0x5'));var rimraf=require(_0x46e1('0x6'));var config=require(_0x46e1('0x7'));var attributes=require('./analyticFieldReport.attributes');module['exports']=function(_0x5c0d21,_0x3e7cb7){return _0x5c0d21[_0x46e1('0x8')]('AnalyticFieldReport',attributes,{'tableName':_0x46e1('0x9'),'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 cb69d50..808bf71 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 _0x1903=['request','then','AnalyticFieldReport,\x20%s,\x20%s','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1903,0xb4));var _0x3190=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1903[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x3190('0x0'));var util=require('util');var moment=require(_0x3190('0x1'));var BPromise=require(_0x3190('0x2'));var rs=require(_0x3190('0x3'));var fs=require('fs');var Redis=require(_0x3190('0x4'));var db=require(_0x3190('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3190('0x6'))(_0x3190('0x7'));var config=require('../../config/environment');var jayson=require(_0x3190('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x840245,_0x2864dc,_0xe59cd2){return new BPromise(function(_0x26b79b,_0x5c343d){return client[_0x3190('0x9')](_0x840245,_0xe59cd2)[_0x3190('0xa')](function(_0x243f6b){logger['info'](_0x3190('0xb'),_0x2864dc,'request\x20sent');logger['debug'](_0x3190('0xc'),_0x2864dc,_0x3190('0xd'),JSON[_0x3190('0xe')](_0x243f6b));if(_0x243f6b[_0x3190('0xf')]){if(_0x243f6b['error'][_0x3190('0x10')]===0x1f4){logger['error'](_0x3190('0xb'),_0x2864dc,_0x243f6b[_0x3190('0xf')][_0x3190('0x11')]);return _0x5c343d(_0x243f6b['error'][_0x3190('0x11')]);}logger[_0x3190('0xf')](_0x3190('0xb'),_0x2864dc,_0x243f6b[_0x3190('0xf')][_0x3190('0x11')]);return _0x26b79b(_0x243f6b['error']['message']);}else{logger[_0x3190('0x12')](_0x3190('0xb'),_0x2864dc,_0x3190('0xd'));_0x26b79b(_0x243f6b[_0x3190('0x13')]['message']);}})[_0x3190('0x14')](function(_0x31eeaf){logger[_0x3190('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2864dc,_0x31eeaf);_0x5c343d(_0x31eeaf);});});} \ No newline at end of file +var _0xe284=['jayson/promise','client','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe284,0x18d));var _0x4e28=function(_0x1e6951,_0x4d39ee){_0x1e6951=_0x1e6951-0x0;var _0x235723=_0xe284[_0x1e6951];return _0x235723;};'use strict';var _=require(_0x4e28('0x0'));var util=require(_0x4e28('0x1'));var moment=require(_0x4e28('0x2'));var BPromise=require(_0x4e28('0x3'));var rs=require(_0x4e28('0x4'));var fs=require('fs');var Redis=require(_0x4e28('0x5'));var db=require(_0x4e28('0x6'))['db'];var utils=require(_0x4e28('0x7'));var logger=require(_0x4e28('0x8'))(_0x4e28('0x9'));var config=require(_0x4e28('0xa'));var jayson=require(_0x4e28('0xb'));var client=jayson[_0x4e28('0xc')][_0x4e28('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x47424a,_0x4dcf55,_0x52308d){return new BPromise(function(_0x50da2c,_0x1b6d7f){return client[_0x4e28('0xe')](_0x47424a,_0x52308d)['then'](function(_0x198bc7){logger[_0x4e28('0xf')](_0x4e28('0x10'),_0x4dcf55,_0x4e28('0x11'));logger[_0x4e28('0x12')](_0x4e28('0x13'),_0x4dcf55,_0x4e28('0x11'),JSON['stringify'](_0x198bc7));if(_0x198bc7[_0x4e28('0x14')]){if(_0x198bc7['error']['code']===0x1f4){logger['error'](_0x4e28('0x10'),_0x4dcf55,_0x198bc7['error'][_0x4e28('0x15')]);return _0x1b6d7f(_0x198bc7['error'][_0x4e28('0x15')]);}logger['error'](_0x4e28('0x10'),_0x4dcf55,_0x198bc7[_0x4e28('0x14')][_0x4e28('0x15')]);return _0x50da2c(_0x198bc7[_0x4e28('0x14')][_0x4e28('0x15')]);}else{logger[_0x4e28('0xf')](_0x4e28('0x10'),_0x4dcf55,_0x4e28('0x11'));_0x50da2c(_0x198bc7[_0x4e28('0x16')][_0x4e28('0x15')]);}})[_0x4e28('0x17')](function(_0x2fe18c){logger[_0x4e28('0x14')](_0x4e28('0x10'),_0x4dcf55,_0x2fe18c);_0x1b6d7f(_0x2fe18c);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 17ffb57..b1f62f8 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(_0x4adfc2,_0x421414){var _0x32f0c1=function(_0xb5cedb){while(--_0xb5cedb){_0x4adfc2['push'](_0x4adfc2['shift']());}};_0x32f0c1(++_0x421414);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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(_0x36936d,_0x266864){var _0x2e57ba=function(_0x2ba593){while(--_0x2ba593){_0x36936d['push'](_0x36936d['shift']());}};_0x2e57ba(++_0x266864);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'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 a15ba95..ebd40d6 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 _0x0647=['sequelize','STRING','name','TEXT'];(function(_0x866832,_0x1aae61){var _0x2f1e5f=function(_0x5a3b56){while(--_0x5a3b56){_0x866832['push'](_0x866832['shift']());}};_0x2f1e5f(++_0x1aae61);}(_0x0647,0xd0));var _0x7064=function(_0x540dcb,_0x4eacb6){_0x540dcb=_0x540dcb-0x0;var _0x49353c=_0x0647[_0x540dcb];return _0x49353c;};'use strict';var Sequelize=require(_0x7064('0x0'));module['exports']={'name':{'type':Sequelize[_0x7064('0x1')],'allowNull':![],'unique':_0x7064('0x2')},'table':{'type':Sequelize[_0x7064('0x1')]},'metric':{'type':Sequelize[_0x7064('0x3')]},'description':{'type':Sequelize[_0x7064('0x1')]}}; \ No newline at end of file +var _0x6324=['name','TEXT','sequelize','exports','STRING'];(function(_0x58d092,_0x36a559){var _0xe2d411=function(_0x3b3c34){while(--_0x3b3c34){_0x58d092['push'](_0x58d092['shift']());}};_0xe2d411(++_0x36a559);}(_0x6324,0x142));var _0x4632=function(_0x207d4e,_0x5158dc){_0x207d4e=_0x207d4e-0x0;var _0x24b6f4=_0x6324[_0x207d4e];return _0x24b6f4;};'use strict';var Sequelize=require(_0x4632('0x0'));module[_0x4632('0x1')]={'name':{'type':Sequelize[_0x4632('0x2')],'allowNull':![],'unique':_0x4632('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x4632('0x4')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index b4692ec..cef7ed2 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 _0x5fc3=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','get','Metrics','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','catch','show','params','merge','create','body'];(function(_0x43627c,_0x58ce04){var _0x7b7979=function(_0x1d76aa){while(--_0x1d76aa){_0x43627c['push'](_0x43627c['shift']());}};_0x7b7979(++_0x58ce04);}(_0x5fc3,0xa8));var _0x35fc=function(_0x55ef8b,_0x5deb5e){_0x55ef8b=_0x55ef8b-0x0;var _0x359c84=_0x5fc3[_0x55ef8b];return _0x359c84;};'use strict';var emlformat=require(_0x35fc('0x0'));var rimraf=require(_0x35fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35fc('0x2'));var rp=require(_0x35fc('0x3'));var moment=require(_0x35fc('0x4'));var BPromise=require(_0x35fc('0x5'));var Mustache=require(_0x35fc('0x6'));var util=require('util');var path=require(_0x35fc('0x7'));var sox=require(_0x35fc('0x8'));var csv=require(_0x35fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0x9'));var querystring=require(_0x35fc('0xe'));var Papa=require(_0x35fc('0xf'));var Redis=require(_0x35fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x11'));var as=require(_0x35fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x13'))(_0x35fc('0x14'));var utils=require('../../config/utils');var config=require(_0x35fc('0x15'));var licenseUtil=require(_0x35fc('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cbe74,_0x409357){_0x409357=_0x409357||0xcc;return function(_0x5d462a){if(_0x5d462a){return _0x4cbe74[_0x35fc('0x17')](_0x409357);}return _0x4cbe74[_0x35fc('0x18')](_0x409357)[_0x35fc('0x19')]();};}function respondWithResult(_0x29730f,_0x38d9f2){_0x38d9f2=_0x38d9f2||0xc8;return function(_0x5cfe94){if(_0x5cfe94){return _0x29730f['status'](_0x38d9f2)['json'](_0x5cfe94);}};}function respondWithFilteredResult(_0x558364,_0x398b67){return function(_0x229d56){if(_0x229d56){var _0x53b898=typeof _0x398b67[_0x35fc('0x1a')]===_0x35fc('0x1b')&&typeof _0x398b67[_0x35fc('0x1c')]==='undefined';var _0x26ba54=_0x229d56[_0x35fc('0x1d')];var _0x553677=_0x53b898?0x0:_0x398b67[_0x35fc('0x1a')];var _0x363e47=_0x53b898?_0x229d56[_0x35fc('0x1d')]:_0x398b67['offset']+_0x398b67[_0x35fc('0x1c')];var _0x3c58ea;if(_0x363e47>=_0x26ba54){_0x363e47=_0x26ba54;_0x3c58ea=0xc8;}else{_0x3c58ea=0xce;}_0x558364[_0x35fc('0x18')](_0x3c58ea);return _0x558364['set'](_0x35fc('0x1e'),_0x553677+'-'+_0x363e47+'/'+_0x26ba54)[_0x35fc('0x1f')](_0x229d56);}return null;};}function patchUpdates(_0x3229d1){return function(_0x251a1f){try{jsonpatch[_0x35fc('0x20')](_0x251a1f,_0x3229d1,!![]);}catch(_0x21f1a9){return BPromise[_0x35fc('0x21')](_0x21f1a9);}return _0x251a1f[_0x35fc('0x22')]();};}function saveUpdates(_0x2405e8,_0x427eae){return function(_0x5bd2b8){if(_0x5bd2b8){return _0x5bd2b8[_0x35fc('0x23')](_0x2405e8)[_0x35fc('0x24')](function(_0x257719){return _0x257719;});}return null;};}function removeEntity(_0x2d8183,_0x3b4743){return function(_0x55e9e7){if(_0x55e9e7){return _0x55e9e7[_0x35fc('0x25')]()[_0x35fc('0x24')](function(){var _0x561bf8=_0x55e9e7[_0x35fc('0x26')]({'plain':!![]});var _0x5a93df=_0x35fc('0x27');return db['UserProfileResource'][_0x35fc('0x25')]({'where':{'type':_0x5a93df,'resourceId':_0x561bf8['id']}})['then'](function(){return _0x55e9e7;});})[_0x35fc('0x24')](function(){_0x2d8183[_0x35fc('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x519264,_0x47774c){return function(_0x58edb6){if(!_0x58edb6){_0x519264[_0x35fc('0x17')](0x194);}return _0x58edb6;};}function handleError(_0x1a5d92,_0x57001c){_0x57001c=_0x57001c||0x1f4;return function(_0x26b7cb){logger[_0x35fc('0x28')](_0x26b7cb[_0x35fc('0x29')]);if(_0x26b7cb[_0x35fc('0x2a')]){delete _0x26b7cb[_0x35fc('0x2a')];}_0x1a5d92[_0x35fc('0x18')](_0x57001c)[_0x35fc('0x2b')](_0x26b7cb);};}exports[_0x35fc('0x2c')]=function(_0x54aedc,_0x1cd1ae){var _0x220931={},_0x22af18={},_0x52acc5={'count':0x0,'rows':[]};var _0xe79f52=_[_0x35fc('0x2d')](db[_0x35fc('0x2e')][_0x35fc('0x2f')],function(_0xd8a4ca){return{'name':_0xd8a4ca[_0x35fc('0x30')],'type':_0xd8a4ca[_0x35fc('0x31')][_0x35fc('0x32')]};});_0x22af18[_0x35fc('0x33')]=_[_0x35fc('0x2d')](_0xe79f52,'name');_0x22af18['query']=_[_0x35fc('0x34')](_0x54aedc['query']);_0x22af18[_0x35fc('0x35')]=_[_0x35fc('0x36')](_0x22af18[_0x35fc('0x33')],_0x22af18[_0x35fc('0x37')]);_0x220931[_0x35fc('0x38')]=_[_0x35fc('0x36')](_0x22af18['model'],qs[_0x35fc('0x39')](_0x54aedc[_0x35fc('0x37')][_0x35fc('0x39')]));_0x220931[_0x35fc('0x38')]=_0x220931[_0x35fc('0x38')][_0x35fc('0x3a')]?_0x220931['attributes']:_0x22af18[_0x35fc('0x33')];if(!_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3b')]('nolimit')){_0x220931[_0x35fc('0x1c')]=qs['limit'](_0x54aedc[_0x35fc('0x37')][_0x35fc('0x1c')]);_0x220931[_0x35fc('0x1a')]=qs[_0x35fc('0x1a')](_0x54aedc['query']['offset']);}_0x220931['order']=qs[_0x35fc('0x3c')](_0x54aedc['query'][_0x35fc('0x3c')]);_0x220931['where']=qs[_0x35fc('0x35')](_[_0x35fc('0x3d')](_0x54aedc[_0x35fc('0x37')],_0x22af18[_0x35fc('0x35')]),_0xe79f52);if(_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3e')]){_0x220931[_0x35fc('0x3f')]=_['merge'](_0x220931[_0x35fc('0x3f')],{'$or':_[_0x35fc('0x2d')](_0xe79f52,function(_0x4e0ce3){if(_0x4e0ce3[_0x35fc('0x31')]!==_0x35fc('0x40')){var _0x1aac67={};_0x1aac67[_0x4e0ce3[_0x35fc('0x2a')]]={'$like':'%'+_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3e')]+'%'};return _0x1aac67;}})});}_0x220931=_['merge']({},_0x220931,_0x54aedc[_0x35fc('0x41')]);var _0x267858={'where':_0x220931[_0x35fc('0x3f')]};return db['AnalyticMetric'][_0x35fc('0x1d')](_0x267858)[_0x35fc('0x24')](function(_0x596919){_0x52acc5[_0x35fc('0x1d')]=_0x596919;if(_0x54aedc[_0x35fc('0x37')][_0x35fc('0x42')]){_0x220931[_0x35fc('0x43')]=[{'all':!![]}];}return db[_0x35fc('0x2e')][_0x35fc('0x44')](_0x220931);})[_0x35fc('0x24')](function(_0x3ec51f){_0x52acc5['rows']=_0x3ec51f;return _0x52acc5;})['then'](respondWithFilteredResult(_0x1cd1ae,_0x220931))[_0x35fc('0x45')](handleError(_0x1cd1ae,null));};exports[_0x35fc('0x46')]=function(_0x4fdc6d,_0x5c2e5c){var _0x4ff202={'raw':!![],'where':{'id':_0x4fdc6d[_0x35fc('0x47')]['id']}},_0x79677d={};_0x79677d['model']=_[_0x35fc('0x34')](db[_0x35fc('0x2e')][_0x35fc('0x2f')]);_0x79677d[_0x35fc('0x37')]=_['keys'](_0x4fdc6d['query']);_0x79677d['filters']=_['intersection'](_0x79677d['model'],_0x79677d[_0x35fc('0x37')]);_0x4ff202[_0x35fc('0x38')]=_['intersection'](_0x79677d[_0x35fc('0x33')],qs['fields'](_0x4fdc6d[_0x35fc('0x37')][_0x35fc('0x39')]));_0x4ff202[_0x35fc('0x38')]=_0x4ff202[_0x35fc('0x38')][_0x35fc('0x3a')]?_0x4ff202['attributes']:_0x79677d[_0x35fc('0x33')];if(_0x4fdc6d[_0x35fc('0x37')]['includeAll']){_0x4ff202[_0x35fc('0x43')]=[{'all':!![]}];}_0x4ff202=_[_0x35fc('0x48')]({},_0x4ff202,_0x4fdc6d[_0x35fc('0x41')]);return db[_0x35fc('0x2e')]['find'](_0x4ff202)[_0x35fc('0x24')](handleEntityNotFound(_0x5c2e5c,null))['then'](respondWithResult(_0x5c2e5c,null))['catch'](handleError(_0x5c2e5c,null));};exports[_0x35fc('0x49')]=function(_0x9db7e8,_0x18dc78){return db[_0x35fc('0x2e')][_0x35fc('0x49')](_0x9db7e8[_0x35fc('0x4a')],{})[_0x35fc('0x24')](function(_0x16afa6){var _0x4f555f=_0x9db7e8[_0x35fc('0x4b')][_0x35fc('0x26')]({'plain':!![]});if(!_0x4f555f)throw new Error(_0x35fc('0x4c'));if(_0x4f555f[_0x35fc('0x4d')]===_0x35fc('0x4b')){var _0x1e3221=_0x16afa6[_0x35fc('0x26')]({'plain':!![]});var _0x347a4a=_0x35fc('0x27');return db[_0x35fc('0x4e')][_0x35fc('0x4f')]({'where':{'name':_0x347a4a,'userProfileId':_0x4f555f[_0x35fc('0x50')]},'raw':!![]})[_0x35fc('0x24')](function(_0x3146e2){if(_0x3146e2&&_0x3146e2['autoAssociation']===0x0){return db['UserProfileResource'][_0x35fc('0x49')]({'name':_0x1e3221[_0x35fc('0x2a')],'resourceId':_0x1e3221['id'],'type':_0x3146e2[_0x35fc('0x2a')],'sectionId':_0x3146e2['id']},{})[_0x35fc('0x24')](function(){return _0x16afa6;});}else{return _0x16afa6;}})[_0x35fc('0x45')](function(_0x3e6494){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e6494);throw _0x3e6494;});}return _0x16afa6;})[_0x35fc('0x24')](respondWithResult(_0x18dc78,0xc9))[_0x35fc('0x45')](handleError(_0x18dc78,null));};exports[_0x35fc('0x23')]=function(_0x38bc78,_0x5b2595){if(_0x38bc78[_0x35fc('0x4a')]['id']){delete _0x38bc78[_0x35fc('0x4a')]['id'];}return db['AnalyticMetric'][_0x35fc('0x4f')]({'where':{'id':_0x38bc78[_0x35fc('0x47')]['id']}})['then'](handleEntityNotFound(_0x5b2595,null))[_0x35fc('0x24')](saveUpdates(_0x38bc78[_0x35fc('0x4a')],null))[_0x35fc('0x24')](respondWithResult(_0x5b2595,null))[_0x35fc('0x45')](handleError(_0x5b2595,null));};exports['destroy']=function(_0x4de34b,_0x502a15){return db[_0x35fc('0x2e')][_0x35fc('0x4f')]({'where':{'id':_0x4de34b['params']['id']}})[_0x35fc('0x24')](handleEntityNotFound(_0x502a15,null))[_0x35fc('0x24')](removeEntity(_0x502a15,null))[_0x35fc('0x45')](handleError(_0x502a15,null));}; \ No newline at end of file +var _0xa41a=['attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Metrics','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','set','save','update','destroy','then','error','stack','name','send','map','AnalyticMetric','type','key','model','query','keys','intersection','fields'];(function(_0x432316,_0x1ed0eb){var _0x459083=function(_0x249a29){while(--_0x249a29){_0x432316['push'](_0x432316['shift']());}};_0x459083(++_0x1ed0eb);}(_0xa41a,0x6b));var _0xaa41=function(_0x13296d,_0x5ded55){_0x13296d=_0x13296d-0x0;var _0x282e7b=_0xa41a[_0x13296d];return _0x282e7b;};'use strict';var emlformat=require(_0xaa41('0x0'));var rimraf=require(_0xaa41('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa41('0x2'));var rp=require(_0xaa41('0x3'));var moment=require(_0xaa41('0x4'));var BPromise=require(_0xaa41('0x5'));var Mustache=require(_0xaa41('0x6'));var util=require(_0xaa41('0x7'));var path=require(_0xaa41('0x8'));var sox=require(_0xaa41('0x9'));var csv=require('to-csv');var ejs=require(_0xaa41('0xa'));var fs=require('fs');var fs_extra=require(_0xaa41('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xaa41('0xc'));var jsforce=require(_0xaa41('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xaa41('0xe'));var querystring=require(_0xaa41('0xf'));var Papa=require(_0xaa41('0x10'));var Redis=require(_0xaa41('0x11'));var authService=require(_0xaa41('0x12'));var qs=require(_0xaa41('0x13'));var as=require(_0xaa41('0x14'));var hardwareService=require(_0xaa41('0x15'));var logger=require(_0xaa41('0x16'))('api');var utils=require(_0xaa41('0x17'));var config=require(_0xaa41('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d0a54,_0x518b5b){_0x518b5b=_0x518b5b||0xcc;return function(_0x19bd69){if(_0x19bd69){return _0x1d0a54[_0xaa41('0x19')](_0x518b5b);}return _0x1d0a54[_0xaa41('0x1a')](_0x518b5b)[_0xaa41('0x1b')]();};}function respondWithResult(_0x6f9ade,_0x4eaf81){_0x4eaf81=_0x4eaf81||0xc8;return function(_0x1e9d7f){if(_0x1e9d7f){return _0x6f9ade[_0xaa41('0x1a')](_0x4eaf81)[_0xaa41('0x1c')](_0x1e9d7f);}};}function respondWithFilteredResult(_0x1ef7d9,_0x2a6988){return function(_0x2005ae){if(_0x2005ae){var _0x1e1e02=typeof _0x2a6988['offset']===_0xaa41('0x1d')&&typeof _0x2a6988[_0xaa41('0x1e')]===_0xaa41('0x1d');var _0x391b01=_0x2005ae[_0xaa41('0x1f')];var _0xd20ddf=_0x1e1e02?0x0:_0x2a6988[_0xaa41('0x20')];var _0x46e6d3=_0x1e1e02?_0x2005ae[_0xaa41('0x1f')]:_0x2a6988['offset']+_0x2a6988['limit'];var _0x1f502a;if(_0x46e6d3>=_0x391b01){_0x46e6d3=_0x391b01;_0x1f502a=0xc8;}else{_0x1f502a=0xce;}_0x1ef7d9[_0xaa41('0x1a')](_0x1f502a);return _0x1ef7d9[_0xaa41('0x21')]('Content-Range',_0xd20ddf+'-'+_0x46e6d3+'/'+_0x391b01)[_0xaa41('0x1c')](_0x2005ae);}return null;};}function patchUpdates(_0x1f692b){return function(_0x4e768e){try{jsonpatch['apply'](_0x4e768e,_0x1f692b,!![]);}catch(_0x1b1910){return BPromise['reject'](_0x1b1910);}return _0x4e768e[_0xaa41('0x22')]();};}function saveUpdates(_0x209c83,_0x3e2175){return function(_0x1f27f3){if(_0x1f27f3){return _0x1f27f3[_0xaa41('0x23')](_0x209c83)['then'](function(_0x43c430){return _0x43c430;});}return null;};}function removeEntity(_0x43a85c,_0x448a21){return function(_0x21f596){if(_0x21f596){return _0x21f596[_0xaa41('0x24')]()[_0xaa41('0x25')](function(){var _0x5c3074=_0x21f596['get']({'plain':!![]});var _0x16aec5='Metrics';return db['UserProfileResource'][_0xaa41('0x24')]({'where':{'type':_0x16aec5,'resourceId':_0x5c3074['id']}})['then'](function(){return _0x21f596;});})['then'](function(){_0x43a85c[_0xaa41('0x1a')](0xcc)[_0xaa41('0x1b')]();});}};}function handleEntityNotFound(_0x392214,_0x632fd2){return function(_0x3f5272){if(!_0x3f5272){_0x392214[_0xaa41('0x19')](0x194);}return _0x3f5272;};}function handleError(_0x57ef96,_0x30a174){_0x30a174=_0x30a174||0x1f4;return function(_0x1f0275){logger[_0xaa41('0x26')](_0x1f0275[_0xaa41('0x27')]);if(_0x1f0275[_0xaa41('0x28')]){delete _0x1f0275[_0xaa41('0x28')];}_0x57ef96[_0xaa41('0x1a')](_0x30a174)[_0xaa41('0x29')](_0x1f0275);};}exports['index']=function(_0x377add,_0x48b48b){var _0x5dad80={},_0x714537={},_0x1176bd={'count':0x0,'rows':[]};var _0x534a85=_[_0xaa41('0x2a')](db[_0xaa41('0x2b')]['rawAttributes'],function(_0x5022fb){return{'name':_0x5022fb['fieldName'],'type':_0x5022fb[_0xaa41('0x2c')][_0xaa41('0x2d')]};});_0x714537[_0xaa41('0x2e')]=_[_0xaa41('0x2a')](_0x534a85,'name');_0x714537[_0xaa41('0x2f')]=_[_0xaa41('0x30')](_0x377add[_0xaa41('0x2f')]);_0x714537['filters']=_[_0xaa41('0x31')](_0x714537[_0xaa41('0x2e')],_0x714537[_0xaa41('0x2f')]);_0x5dad80['attributes']=_[_0xaa41('0x31')](_0x714537[_0xaa41('0x2e')],qs['fields'](_0x377add[_0xaa41('0x2f')][_0xaa41('0x32')]));_0x5dad80[_0xaa41('0x33')]=_0x5dad80['attributes'][_0xaa41('0x34')]?_0x5dad80['attributes']:_0x714537[_0xaa41('0x2e')];if(!_0x377add[_0xaa41('0x2f')][_0xaa41('0x35')]('nolimit')){_0x5dad80['limit']=qs['limit'](_0x377add[_0xaa41('0x2f')][_0xaa41('0x1e')]);_0x5dad80[_0xaa41('0x20')]=qs[_0xaa41('0x20')](_0x377add['query']['offset']);}_0x5dad80[_0xaa41('0x36')]=qs[_0xaa41('0x37')](_0x377add[_0xaa41('0x2f')][_0xaa41('0x37')]);_0x5dad80[_0xaa41('0x38')]=qs[_0xaa41('0x39')](_[_0xaa41('0x3a')](_0x377add['query'],_0x714537[_0xaa41('0x39')]),_0x534a85);if(_0x377add[_0xaa41('0x2f')][_0xaa41('0x3b')]){_0x5dad80[_0xaa41('0x38')]=_['merge'](_0x5dad80['where'],{'$or':_[_0xaa41('0x2a')](_0x534a85,function(_0x275fa3){if(_0x275fa3['type']!==_0xaa41('0x3c')){var _0x563687={};_0x563687[_0x275fa3[_0xaa41('0x28')]]={'$like':'%'+_0x377add[_0xaa41('0x2f')][_0xaa41('0x3b')]+'%'};return _0x563687;}})});}_0x5dad80=_[_0xaa41('0x3d')]({},_0x5dad80,_0x377add[_0xaa41('0x3e')]);var _0x12ba1a={'where':_0x5dad80[_0xaa41('0x38')]};return db[_0xaa41('0x2b')]['count'](_0x12ba1a)[_0xaa41('0x25')](function(_0x2abf39){_0x1176bd[_0xaa41('0x1f')]=_0x2abf39;if(_0x377add[_0xaa41('0x2f')][_0xaa41('0x3f')]){_0x5dad80[_0xaa41('0x40')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x5dad80);})[_0xaa41('0x25')](function(_0x4f9086){_0x1176bd[_0xaa41('0x41')]=_0x4f9086;return _0x1176bd;})[_0xaa41('0x25')](respondWithFilteredResult(_0x48b48b,_0x5dad80))[_0xaa41('0x42')](handleError(_0x48b48b,null));};exports[_0xaa41('0x43')]=function(_0x2aac10,_0x10bf09){var _0x2db8d6={'raw':!![],'where':{'id':_0x2aac10[_0xaa41('0x44')]['id']}},_0x5ee74c={};_0x5ee74c['model']=_['keys'](db[_0xaa41('0x2b')]['rawAttributes']);_0x5ee74c['query']=_['keys'](_0x2aac10[_0xaa41('0x2f')]);_0x5ee74c['filters']=_[_0xaa41('0x31')](_0x5ee74c[_0xaa41('0x2e')],_0x5ee74c['query']);_0x2db8d6['attributes']=_[_0xaa41('0x31')](_0x5ee74c[_0xaa41('0x2e')],qs[_0xaa41('0x32')](_0x2aac10[_0xaa41('0x2f')][_0xaa41('0x32')]));_0x2db8d6[_0xaa41('0x33')]=_0x2db8d6[_0xaa41('0x33')][_0xaa41('0x34')]?_0x2db8d6[_0xaa41('0x33')]:_0x5ee74c['model'];if(_0x2aac10[_0xaa41('0x2f')][_0xaa41('0x3f')]){_0x2db8d6[_0xaa41('0x40')]=[{'all':!![]}];}_0x2db8d6=_[_0xaa41('0x3d')]({},_0x2db8d6,_0x2aac10[_0xaa41('0x3e')]);return db[_0xaa41('0x2b')]['find'](_0x2db8d6)[_0xaa41('0x25')](handleEntityNotFound(_0x10bf09,null))[_0xaa41('0x25')](respondWithResult(_0x10bf09,null))[_0xaa41('0x42')](handleError(_0x10bf09,null));};exports[_0xaa41('0x45')]=function(_0x57d1f6,_0x23bc61){return db['AnalyticMetric']['create'](_0x57d1f6[_0xaa41('0x46')],{})[_0xaa41('0x25')](function(_0x3e16ef){var _0x4ca114=_0x57d1f6[_0xaa41('0x47')][_0xaa41('0x48')]({'plain':!![]});if(!_0x4ca114)throw new Error(_0xaa41('0x49'));if(_0x4ca114['role']===_0xaa41('0x47')){var _0x3c4f24=_0x3e16ef[_0xaa41('0x48')]({'plain':!![]});var _0x1378f9=_0xaa41('0x4a');return db[_0xaa41('0x4b')][_0xaa41('0x4c')]({'where':{'name':_0x1378f9,'userProfileId':_0x4ca114[_0xaa41('0x4d')]},'raw':!![]})['then'](function(_0x9f0a81){if(_0x9f0a81&&_0x9f0a81['autoAssociation']===0x0){return db['UserProfileResource'][_0xaa41('0x45')]({'name':_0x3c4f24[_0xaa41('0x28')],'resourceId':_0x3c4f24['id'],'type':_0x9f0a81[_0xaa41('0x28')],'sectionId':_0x9f0a81['id']},{})[_0xaa41('0x25')](function(){return _0x3e16ef;});}else{return _0x3e16ef;}})[_0xaa41('0x42')](function(_0x288db3){logger[_0xaa41('0x26')](_0xaa41('0x4e'),_0x288db3);throw _0x288db3;});}return _0x3e16ef;})['then'](respondWithResult(_0x23bc61,0xc9))[_0xaa41('0x42')](handleError(_0x23bc61,null));};exports[_0xaa41('0x23')]=function(_0x1d518f,_0x4f9e92){if(_0x1d518f[_0xaa41('0x46')]['id']){delete _0x1d518f[_0xaa41('0x46')]['id'];}return db['AnalyticMetric'][_0xaa41('0x4c')]({'where':{'id':_0x1d518f[_0xaa41('0x44')]['id']}})[_0xaa41('0x25')](handleEntityNotFound(_0x4f9e92,null))['then'](saveUpdates(_0x1d518f[_0xaa41('0x46')],null))[_0xaa41('0x25')](respondWithResult(_0x4f9e92,null))['catch'](handleError(_0x4f9e92,null));};exports['destroy']=function(_0x3745ed,_0x3cd14f){return db[_0xaa41('0x2b')]['find']({'where':{'id':_0x3745ed[_0xaa41('0x44')]['id']}})[_0xaa41('0x25')](handleEntityNotFound(_0x3cd14f,null))[_0xaa41('0x25')](removeEntity(_0x3cd14f,null))[_0xaa41('0x42')](handleError(_0x3cd14f,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 523b4ed..05b7800 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 _0x326f=['analytics_metrics','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric'];(function(_0x233e2d,_0x1673d8){var _0x50ec8f=function(_0x378c8a){while(--_0x378c8a){_0x233e2d['push'](_0x233e2d['shift']());}};_0x50ec8f(++_0x1673d8);}(_0x326f,0xd1));var _0xf326=function(_0x3b40f6,_0x3021b0){_0x3b40f6=_0x3b40f6-0x0;var _0x38160b=_0x326f[_0x3b40f6];return _0x38160b;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5419=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','moment'];(function(_0x143838,_0x59ccb8){var _0xc0f103=function(_0x368024){while(--_0x368024){_0x143838['push'](_0x143838['shift']());}};_0xc0f103(++_0x59ccb8);}(_0x5419,0x175));var _0x9541=function(_0x5dc198,_0x5389cb){_0x5dc198=_0x5dc198-0x0;var _0x4934e1=_0x5419[_0x5dc198];return _0x4934e1;};'use strict';var _=require(_0x9541('0x0'));var util=require(_0x9541('0x1'));var logger=require(_0x9541('0x2'))(_0x9541('0x3'));var moment=require(_0x9541('0x4'));var BPromise=require(_0x9541('0x5'));var rp=require(_0x9541('0x6'));var fs=require('fs');var path=require(_0x9541('0x7'));var rimraf=require(_0x9541('0x8'));var config=require(_0x9541('0x9'));var attributes=require('./analyticMetric.attributes');module[_0x9541('0xa')]=function(_0x1f9139,_0xbdabaf){return _0x1f9139[_0x9541('0xb')](_0x9541('0xc'),attributes,{'tableName':_0x9541('0xd'),'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 f47f733..97c308d 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 _0x067b=['lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x3e1350,_0x1d7b09){var _0x2faf1d=function(_0x236561){while(--_0x236561){_0x3e1350['push'](_0x3e1350['shift']());}};_0x2faf1d(++_0x1d7b09);}(_0x067b,0xc8));var _0xb067=function(_0x5b18ba,_0x5c2f2b){_0x5b18ba=_0x5b18ba-0x0;var _0x517334=_0x067b[_0x5b18ba];return _0x517334;};'use strict';var _=require(_0xb067('0x0'));var util=require(_0xb067('0x1'));var moment=require(_0xb067('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb067('0x3'));var db=require(_0xb067('0x4'))['db'];var utils=require(_0xb067('0x5'));var logger=require(_0xb067('0x6'))(_0xb067('0x7'));var config=require(_0xb067('0x8'));var jayson=require(_0xb067('0x9'));var client=jayson[_0xb067('0xa')][_0xb067('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b09e7,_0x33c137,_0x4301b8){return new BPromise(function(_0x3dad13,_0x3fd4f8){return client[_0xb067('0xc')](_0x1b09e7,_0x4301b8)[_0xb067('0xd')](function(_0x4213bb){logger[_0xb067('0xe')](_0xb067('0xf'),_0x33c137,_0xb067('0x10'));logger[_0xb067('0x11')](_0xb067('0x12'),_0x33c137,_0xb067('0x10'),JSON[_0xb067('0x13')](_0x4213bb));if(_0x4213bb[_0xb067('0x14')]){if(_0x4213bb[_0xb067('0x14')][_0xb067('0x15')]===0x1f4){logger[_0xb067('0x14')]('AnalyticMetric,\x20%s,\x20%s',_0x33c137,_0x4213bb[_0xb067('0x14')][_0xb067('0x16')]);return _0x3fd4f8(_0x4213bb[_0xb067('0x14')][_0xb067('0x16')]);}logger[_0xb067('0x14')]('AnalyticMetric,\x20%s,\x20%s',_0x33c137,_0x4213bb[_0xb067('0x14')]['message']);return _0x3dad13(_0x4213bb[_0xb067('0x14')][_0xb067('0x16')]);}else{logger['info'](_0xb067('0xf'),_0x33c137,_0xb067('0x10'));_0x3dad13(_0x4213bb[_0xb067('0x17')][_0xb067('0x16')]);}})[_0xb067('0x18')](function(_0x306f2c){logger[_0xb067('0x14')](_0xb067('0xf'),_0x33c137,_0x306f2c);_0x3fd4f8(_0x306f2c);});});} \ No newline at end of file +var _0xd3c6=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xd3c6,0xe2));var _0x6d3c=function(_0x1eddf1,_0x4f51b7){_0x1eddf1=_0x1eddf1-0x0;var _0xd0e46d=_0xd3c6[_0x1eddf1];return _0xd0e46d;};'use strict';var _=require(_0x6d3c('0x0'));var util=require('util');var moment=require(_0x6d3c('0x1'));var BPromise=require(_0x6d3c('0x2'));var rs=require(_0x6d3c('0x3'));var fs=require('fs');var Redis=require(_0x6d3c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6d3c('0x5'));var logger=require(_0x6d3c('0x6'))(_0x6d3c('0x7'));var config=require(_0x6d3c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6d3c('0x9')][_0x6d3c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e4789,_0x19bc51,_0x5a7808){return new BPromise(function(_0x2b8608,_0x583284){return client[_0x6d3c('0xb')](_0x4e4789,_0x5a7808)[_0x6d3c('0xc')](function(_0x4b4316){logger[_0x6d3c('0xd')](_0x6d3c('0xe'),_0x19bc51,_0x6d3c('0xf'));logger[_0x6d3c('0x10')](_0x6d3c('0x11'),_0x19bc51,_0x6d3c('0xf'),JSON['stringify'](_0x4b4316));if(_0x4b4316[_0x6d3c('0x12')]){if(_0x4b4316[_0x6d3c('0x12')][_0x6d3c('0x13')]===0x1f4){logger[_0x6d3c('0x12')](_0x6d3c('0xe'),_0x19bc51,_0x4b4316[_0x6d3c('0x12')][_0x6d3c('0x14')]);return _0x583284(_0x4b4316[_0x6d3c('0x12')][_0x6d3c('0x14')]);}logger[_0x6d3c('0x12')](_0x6d3c('0xe'),_0x19bc51,_0x4b4316[_0x6d3c('0x12')][_0x6d3c('0x14')]);return _0x2b8608(_0x4b4316['error'][_0x6d3c('0x14')]);}else{logger[_0x6d3c('0xd')](_0x6d3c('0xe'),_0x19bc51,_0x6d3c('0xf'));_0x2b8608(_0x4b4316[_0x6d3c('0x15')][_0x6d3c('0x14')]);}})[_0x6d3c('0x16')](function(_0xc91037){logger['error'](_0x6d3c('0xe'),_0x19bc51,_0xc91037);_0x583284(_0xc91037);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 87d0869..0a0a2d0 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 _0xce50=['index','show','put','/:id','update','destroy','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','get','isAuthenticated'];(function(_0xd7161f,_0x2ec134){var _0x4ad71f=function(_0x8b69ed){while(--_0x8b69ed){_0xd7161f['push'](_0xd7161f['shift']());}};_0x4ad71f(++_0x2ec134);}(_0xce50,0x1d8));var _0x0ce5=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0xce50[_0x1ccdf7];return _0x52a0ae;};'use strict';var multer=require('multer');var util=require(_0x0ce5('0x0'));var path=require(_0x0ce5('0x1'));var timeout=require(_0x0ce5('0x2'));var express=require(_0x0ce5('0x3'));var router=express[_0x0ce5('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0ce5('0x5'));var config=require('../../config/environment');var controller=require('./analyticMetric.controller');router[_0x0ce5('0x6')]('/',auth[_0x0ce5('0x7')](),controller[_0x0ce5('0x8')]);router[_0x0ce5('0x6')]('/:id',auth[_0x0ce5('0x7')](),controller[_0x0ce5('0x9')]);router['post']('/',auth[_0x0ce5('0x7')](),controller['create']);router[_0x0ce5('0xa')](_0x0ce5('0xb'),auth[_0x0ce5('0x7')](),controller[_0x0ce5('0xc')]);router['delete'](_0x0ce5('0xb'),auth[_0x0ce5('0x7')](),controller[_0x0ce5('0xd')]);module[_0x0ce5('0xe')]=router; \ No newline at end of file +var _0x9c48=['exports','multer','util','path','express','Router','fs-extra','../../config/environment','./analyticMetric.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy'];(function(_0x1f3b66,_0x4a2b08){var _0x49da97=function(_0x43d14a){while(--_0x43d14a){_0x1f3b66['push'](_0x1f3b66['shift']());}};_0x49da97(++_0x4a2b08);}(_0x9c48,0xa1));var _0x89c4=function(_0x5eda1d,_0x337454){_0x5eda1d=_0x5eda1d-0x0;var _0x1c4e09=_0x9c48[_0x5eda1d];return _0x1c4e09;};'use strict';var multer=require(_0x89c4('0x0'));var util=require(_0x89c4('0x1'));var path=require(_0x89c4('0x2'));var timeout=require('connect-timeout');var express=require(_0x89c4('0x3'));var router=express[_0x89c4('0x4')]();var fs_extra=require(_0x89c4('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x89c4('0x6'));var controller=require(_0x89c4('0x7'));router['get']('/',auth[_0x89c4('0x8')](),controller[_0x89c4('0x9')]);router[_0x89c4('0xa')](_0x89c4('0xb'),auth[_0x89c4('0x8')](),controller[_0x89c4('0xc')]);router[_0x89c4('0xd')]('/',auth[_0x89c4('0x8')](),controller[_0x89c4('0xe')]);router[_0x89c4('0xf')](_0x89c4('0xb'),auth[_0x89c4('0x8')](),controller[_0x89c4('0x10')]);router[_0x89c4('0x11')](_0x89c4('0xb'),auth[_0x89c4('0x8')](),controller[_0x89c4('0x12')]);module[_0x89c4('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 8de81a0..5a11636 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 _0x6b2e=['sequelize','exports'];(function(_0x2eaa62,_0x202c71){var _0xcad8fd=function(_0x5b2104){while(--_0x5b2104){_0x2eaa62['push'](_0x2eaa62['shift']());}};_0xcad8fd(++_0x202c71);}(_0x6b2e,0xa4));var _0xe6b2=function(_0x2d3310,_0x4699d8){_0x2d3310=_0x2d3310-0x0;var _0x4c8823=_0x6b2e[_0x2d3310];return _0x4c8823;};'use strict';var Sequelize=require(_0xe6b2('0x0'));module[_0xe6b2('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file +var _0x9cfd=['exports','TEXT'];(function(_0x34d981,_0x2f2c64){var _0x2a3805=function(_0x4e5906){while(--_0x4e5906){_0x34d981['push'](_0x34d981['shift']());}};_0x2a3805(++_0x2f2c64);}(_0x9cfd,0x134));var _0xd9cf=function(_0x46975e,_0x512f40){_0x46975e=_0x46975e-0x0;var _0x4feae6=_0x9cfd[_0x46975e];return _0x4feae6;};'use strict';var Sequelize=require('sequelize');module[_0xd9cf('0x0')]={'tree':{'type':Sequelize[_0xd9cf('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 910e073..3522e89 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 _0x3c1d=['nolimit','order','sort','pick','filter','where','merge','type','findAll','rows','catch','show','params','rawAttributes','includeAll','include','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','apply','save','update','destroy','then','error','stack','name','index','map','AnalyticTreeReport','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x3c1d,0x140));var _0xd3c1=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0x3c1d[_0x1b2ff7];return _0x31656a;};'use strict';var emlformat=require(_0xd3c1('0x0'));var rimraf=require(_0xd3c1('0x1'));var zipdir=require(_0xd3c1('0x2'));var jsonpatch=require(_0xd3c1('0x3'));var rp=require(_0xd3c1('0x4'));var moment=require(_0xd3c1('0x5'));var BPromise=require(_0xd3c1('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xd3c1('0x7'));var csv=require(_0xd3c1('0x8'));var ejs=require(_0xd3c1('0x9'));var fs=require('fs');var fs_extra=require(_0xd3c1('0xa'));var _=require(_0xd3c1('0xb'));var squel=require(_0xd3c1('0xc'));var crypto=require(_0xd3c1('0xd'));var jsforce=require(_0xd3c1('0xe'));var deskjs=require(_0xd3c1('0xf'));var toCsv=require(_0xd3c1('0x8'));var querystring=require(_0xd3c1('0x10'));var Papa=require('papaparse');var Redis=require(_0xd3c1('0x11'));var authService=require(_0xd3c1('0x12'));var qs=require(_0xd3c1('0x13'));var as=require(_0xd3c1('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd3c1('0x15'))(_0xd3c1('0x16'));var utils=require(_0xd3c1('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xd3c1('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21963c,_0x5733cb){_0x5733cb=_0x5733cb||0xcc;return function(_0x424c7c){if(_0x424c7c){return _0x21963c[_0xd3c1('0x19')](_0x5733cb);}return _0x21963c['status'](_0x5733cb)[_0xd3c1('0x1a')]();};}function respondWithResult(_0x1fa700,_0x37cc44){_0x37cc44=_0x37cc44||0xc8;return function(_0x2be833){if(_0x2be833){return _0x1fa700[_0xd3c1('0x1b')](_0x37cc44)[_0xd3c1('0x1c')](_0x2be833);}};}function respondWithFilteredResult(_0x1224d4,_0x4334f2){return function(_0x3eaa30){if(_0x3eaa30){var _0x5aa38f=typeof _0x4334f2['offset']===_0xd3c1('0x1d')&&typeof _0x4334f2[_0xd3c1('0x1e')]===_0xd3c1('0x1d');var _0x10e00c=_0x3eaa30[_0xd3c1('0x1f')];var _0x30a888=_0x5aa38f?0x0:_0x4334f2['offset'];var _0x3a2dd5=_0x5aa38f?_0x3eaa30['count']:_0x4334f2[_0xd3c1('0x20')]+_0x4334f2[_0xd3c1('0x1e')];var _0x2488f7;if(_0x3a2dd5>=_0x10e00c){_0x3a2dd5=_0x10e00c;_0x2488f7=0xc8;}else{_0x2488f7=0xce;}_0x1224d4[_0xd3c1('0x1b')](_0x2488f7);return _0x1224d4['set']('Content-Range',_0x30a888+'-'+_0x3a2dd5+'/'+_0x10e00c)[_0xd3c1('0x1c')](_0x3eaa30);}return null;};}function patchUpdates(_0x335f21){return function(_0x2fa205){try{jsonpatch[_0xd3c1('0x21')](_0x2fa205,_0x335f21,!![]);}catch(_0x538e75){return BPromise['reject'](_0x538e75);}return _0x2fa205[_0xd3c1('0x22')]();};}function saveUpdates(_0x4c0b8a,_0x56d642){return function(_0x5c0c5a){if(_0x5c0c5a){return _0x5c0c5a[_0xd3c1('0x23')](_0x4c0b8a)['then'](function(_0x15a8fb){return _0x15a8fb;});}return null;};}function removeEntity(_0x4bfe9e,_0x1a3f96){return function(_0x5d08d9){if(_0x5d08d9){return _0x5d08d9[_0xd3c1('0x24')]()[_0xd3c1('0x25')](function(){_0x4bfe9e[_0xd3c1('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd204e1,_0x388252){return function(_0x8b16){if(!_0x8b16){_0xd204e1[_0xd3c1('0x19')](0x194);}return _0x8b16;};}function handleError(_0xac02b5,_0x35db27){_0x35db27=_0x35db27||0x1f4;return function(_0x5d824e){logger[_0xd3c1('0x26')](_0x5d824e[_0xd3c1('0x27')]);if(_0x5d824e[_0xd3c1('0x28')]){delete _0x5d824e['name'];}_0xac02b5[_0xd3c1('0x1b')](_0x35db27)['send'](_0x5d824e);};}exports[_0xd3c1('0x29')]=function(_0x480454,_0x55be1d){var _0xb0f6c8={},_0xf96906={},_0x521b7d={'count':0x0,'rows':[]};var _0x332825=_[_0xd3c1('0x2a')](db[_0xd3c1('0x2b')]['rawAttributes'],function(_0x521b3d){return{'name':_0x521b3d[_0xd3c1('0x2c')],'type':_0x521b3d['type'][_0xd3c1('0x2d')]};});_0xf96906[_0xd3c1('0x2e')]=_['map'](_0x332825,_0xd3c1('0x28'));_0xf96906['query']=_[_0xd3c1('0x2f')](_0x480454[_0xd3c1('0x30')]);_0xf96906[_0xd3c1('0x31')]=_[_0xd3c1('0x32')](_0xf96906['model'],_0xf96906[_0xd3c1('0x30')]);_0xb0f6c8[_0xd3c1('0x33')]=_[_0xd3c1('0x32')](_0xf96906[_0xd3c1('0x2e')],qs[_0xd3c1('0x34')](_0x480454[_0xd3c1('0x30')][_0xd3c1('0x34')]));_0xb0f6c8[_0xd3c1('0x33')]=_0xb0f6c8[_0xd3c1('0x33')][_0xd3c1('0x35')]?_0xb0f6c8['attributes']:_0xf96906[_0xd3c1('0x2e')];if(!_0x480454[_0xd3c1('0x30')][_0xd3c1('0x36')](_0xd3c1('0x37'))){_0xb0f6c8[_0xd3c1('0x1e')]=qs[_0xd3c1('0x1e')](_0x480454[_0xd3c1('0x30')][_0xd3c1('0x1e')]);_0xb0f6c8[_0xd3c1('0x20')]=qs[_0xd3c1('0x20')](_0x480454[_0xd3c1('0x30')][_0xd3c1('0x20')]);}_0xb0f6c8[_0xd3c1('0x38')]=qs[_0xd3c1('0x39')](_0x480454[_0xd3c1('0x30')][_0xd3c1('0x39')]);_0xb0f6c8['where']=qs[_0xd3c1('0x31')](_[_0xd3c1('0x3a')](_0x480454[_0xd3c1('0x30')],_0xf96906[_0xd3c1('0x31')]),_0x332825);if(_0x480454['query'][_0xd3c1('0x3b')]){_0xb0f6c8[_0xd3c1('0x3c')]=_[_0xd3c1('0x3d')](_0xb0f6c8[_0xd3c1('0x3c')],{'$or':_[_0xd3c1('0x2a')](_0x332825,function(_0x359af7){if(_0x359af7[_0xd3c1('0x3e')]!=='VIRTUAL'){var _0x22c99b={};_0x22c99b[_0x359af7['name']]={'$like':'%'+_0x480454[_0xd3c1('0x30')][_0xd3c1('0x3b')]+'%'};return _0x22c99b;}})});}_0xb0f6c8=_[_0xd3c1('0x3d')]({},_0xb0f6c8,_0x480454['options']);var _0x2536c9={'where':_0xb0f6c8[_0xd3c1('0x3c')]};return db[_0xd3c1('0x2b')]['count'](_0x2536c9)[_0xd3c1('0x25')](function(_0x445ad1){_0x521b7d[_0xd3c1('0x1f')]=_0x445ad1;if(_0x480454[_0xd3c1('0x30')]['includeAll']){_0xb0f6c8['include']=[{'all':!![]}];}return db[_0xd3c1('0x2b')][_0xd3c1('0x3f')](_0xb0f6c8);})[_0xd3c1('0x25')](function(_0x501400){_0x521b7d[_0xd3c1('0x40')]=_0x501400;return _0x521b7d;})[_0xd3c1('0x25')](respondWithFilteredResult(_0x55be1d,_0xb0f6c8))[_0xd3c1('0x41')](handleError(_0x55be1d,null));};exports[_0xd3c1('0x42')]=function(_0x4aea17,_0xd424a9){var _0x3c91e2={'raw':!![],'where':{'id':_0x4aea17[_0xd3c1('0x43')]['id']}},_0x18f0a1={};_0x18f0a1[_0xd3c1('0x2e')]=_[_0xd3c1('0x2f')](db['AnalyticTreeReport'][_0xd3c1('0x44')]);_0x18f0a1[_0xd3c1('0x30')]=_[_0xd3c1('0x2f')](_0x4aea17[_0xd3c1('0x30')]);_0x18f0a1[_0xd3c1('0x31')]=_[_0xd3c1('0x32')](_0x18f0a1[_0xd3c1('0x2e')],_0x18f0a1[_0xd3c1('0x30')]);_0x3c91e2[_0xd3c1('0x33')]=_[_0xd3c1('0x32')](_0x18f0a1[_0xd3c1('0x2e')],qs['fields'](_0x4aea17[_0xd3c1('0x30')][_0xd3c1('0x34')]));_0x3c91e2[_0xd3c1('0x33')]=_0x3c91e2[_0xd3c1('0x33')][_0xd3c1('0x35')]?_0x3c91e2[_0xd3c1('0x33')]:_0x18f0a1['model'];if(_0x4aea17[_0xd3c1('0x30')][_0xd3c1('0x45')]){_0x3c91e2[_0xd3c1('0x46')]=[{'all':!![]}];}_0x3c91e2=_[_0xd3c1('0x3d')]({},_0x3c91e2,_0x4aea17[_0xd3c1('0x47')]);return db['AnalyticTreeReport'][_0xd3c1('0x48')](_0x3c91e2)[_0xd3c1('0x25')](handleEntityNotFound(_0xd424a9,null))[_0xd3c1('0x25')](respondWithResult(_0xd424a9,null))[_0xd3c1('0x41')](handleError(_0xd424a9,null));};exports[_0xd3c1('0x49')]=function(_0x106459,_0x3c1203){return db[_0xd3c1('0x2b')][_0xd3c1('0x49')](_0x106459[_0xd3c1('0x4a')],{})['then'](respondWithResult(_0x3c1203,0xc9))[_0xd3c1('0x41')](handleError(_0x3c1203,null));};exports['update']=function(_0x8fc248,_0x5452b7){if(_0x8fc248[_0xd3c1('0x4a')]['id']){delete _0x8fc248[_0xd3c1('0x4a')]['id'];}return db[_0xd3c1('0x2b')]['find']({'where':{'id':_0x8fc248['params']['id']}})[_0xd3c1('0x25')](handleEntityNotFound(_0x5452b7,null))['then'](saveUpdates(_0x8fc248[_0xd3c1('0x4a')],null))[_0xd3c1('0x25')](respondWithResult(_0x5452b7,null))['catch'](handleError(_0x5452b7,null));};exports[_0xd3c1('0x24')]=function(_0x4ff546,_0x458254){return db[_0xd3c1('0x2b')][_0xd3c1('0x48')]({'where':{'id':_0x4ff546[_0xd3c1('0x43')]['id']}})[_0xd3c1('0x25')](handleEntityNotFound(_0x458254,null))[_0xd3c1('0x25')](removeEntity(_0x458254,null))['catch'](handleError(_0x458254,null));}; \ No newline at end of file +var _0x876d=['keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','catch','show','params','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','index','map','AnalyticTreeReport','fieldName','type','key'];(function(_0x487496,_0x249683){var _0x539dc8=function(_0x2c38e1){while(--_0x2c38e1){_0x487496['push'](_0x487496['shift']());}};_0x539dc8(++_0x249683);}(_0x876d,0x67));var _0xd876=function(_0x26f50a,_0x15ad29){_0x26f50a=_0x26f50a-0x0;var _0x4bf8c3=_0x876d[_0x26f50a];return _0x4bf8c3;};'use strict';var emlformat=require(_0xd876('0x0'));var rimraf=require(_0xd876('0x1'));var zipdir=require(_0xd876('0x2'));var jsonpatch=require(_0xd876('0x3'));var rp=require(_0xd876('0x4'));var moment=require(_0xd876('0x5'));var BPromise=require(_0xd876('0x6'));var Mustache=require(_0xd876('0x7'));var util=require(_0xd876('0x8'));var path=require(_0xd876('0x9'));var sox=require(_0xd876('0xa'));var csv=require('to-csv');var ejs=require(_0xd876('0xb'));var fs=require('fs');var fs_extra=require(_0xd876('0xc'));var _=require(_0xd876('0xd'));var squel=require('squel');var crypto=require(_0xd876('0xe'));var jsforce=require(_0xd876('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xd876('0x10'));var querystring=require(_0xd876('0x11'));var Papa=require(_0xd876('0x12'));var Redis=require(_0xd876('0x13'));var authService=require(_0xd876('0x14'));var qs=require(_0xd876('0x15'));var as=require(_0xd876('0x16'));var hardwareService=require(_0xd876('0x17'));var logger=require('../../config/logger')(_0xd876('0x18'));var utils=require(_0xd876('0x19'));var config=require(_0xd876('0x1a'));var licenseUtil=require(_0xd876('0x1b'));var db=require(_0xd876('0x1c'))['db'];function respondWithStatusCode(_0x4b0cd2,_0x6c9e68){_0x6c9e68=_0x6c9e68||0xcc;return function(_0x587b84){if(_0x587b84){return _0x4b0cd2[_0xd876('0x1d')](_0x6c9e68);}return _0x4b0cd2[_0xd876('0x1e')](_0x6c9e68)[_0xd876('0x1f')]();};}function respondWithResult(_0x5577d8,_0x4713c4){_0x4713c4=_0x4713c4||0xc8;return function(_0x278644){if(_0x278644){return _0x5577d8[_0xd876('0x1e')](_0x4713c4)['json'](_0x278644);}};}function respondWithFilteredResult(_0x5300c9,_0x334cdd){return function(_0x572b4d){if(_0x572b4d){var _0x4b9696=typeof _0x334cdd[_0xd876('0x20')]===_0xd876('0x21')&&typeof _0x334cdd[_0xd876('0x22')]===_0xd876('0x21');var _0x419af6=_0x572b4d[_0xd876('0x23')];var _0x54df21=_0x4b9696?0x0:_0x334cdd['offset'];var _0x16c9d0=_0x4b9696?_0x572b4d['count']:_0x334cdd['offset']+_0x334cdd['limit'];var _0x3325b8;if(_0x16c9d0>=_0x419af6){_0x16c9d0=_0x419af6;_0x3325b8=0xc8;}else{_0x3325b8=0xce;}_0x5300c9[_0xd876('0x1e')](_0x3325b8);return _0x5300c9['set'](_0xd876('0x24'),_0x54df21+'-'+_0x16c9d0+'/'+_0x419af6)[_0xd876('0x25')](_0x572b4d);}return null;};}function patchUpdates(_0x390649){return function(_0x425e04){try{jsonpatch[_0xd876('0x26')](_0x425e04,_0x390649,!![]);}catch(_0x474a99){return BPromise[_0xd876('0x27')](_0x474a99);}return _0x425e04[_0xd876('0x28')]();};}function saveUpdates(_0x2ef192,_0x97a2e2){return function(_0x5d9958){if(_0x5d9958){return _0x5d9958['update'](_0x2ef192)[_0xd876('0x29')](function(_0x499836){return _0x499836;});}return null;};}function removeEntity(_0x35aa1f,_0x4453f1){return function(_0x5c3dd2){if(_0x5c3dd2){return _0x5c3dd2[_0xd876('0x2a')]()[_0xd876('0x29')](function(){_0x35aa1f[_0xd876('0x1e')](0xcc)[_0xd876('0x1f')]();});}};}function handleEntityNotFound(_0x59b06d,_0xcd633e){return function(_0xfb7b00){if(!_0xfb7b00){_0x59b06d[_0xd876('0x1d')](0x194);}return _0xfb7b00;};}function handleError(_0x2edf5e,_0xe6fd33){_0xe6fd33=_0xe6fd33||0x1f4;return function(_0x29b3a4){logger[_0xd876('0x2b')](_0x29b3a4[_0xd876('0x2c')]);if(_0x29b3a4[_0xd876('0x2d')]){delete _0x29b3a4['name'];}_0x2edf5e[_0xd876('0x1e')](_0xe6fd33)[_0xd876('0x2e')](_0x29b3a4);};}exports[_0xd876('0x2f')]=function(_0x4f8df5,_0x26aaa9){var _0x23496d={},_0x52d99e={},_0x25ba5f={'count':0x0,'rows':[]};var _0x19be29=_[_0xd876('0x30')](db[_0xd876('0x31')]['rawAttributes'],function(_0x4f1956){return{'name':_0x4f1956[_0xd876('0x32')],'type':_0x4f1956[_0xd876('0x33')][_0xd876('0x34')]};});_0x52d99e['model']=_['map'](_0x19be29,'name');_0x52d99e['query']=_[_0xd876('0x35')](_0x4f8df5[_0xd876('0x36')]);_0x52d99e['filters']=_[_0xd876('0x37')](_0x52d99e[_0xd876('0x38')],_0x52d99e[_0xd876('0x36')]);_0x23496d['attributes']=_[_0xd876('0x37')](_0x52d99e[_0xd876('0x38')],qs['fields'](_0x4f8df5['query'][_0xd876('0x39')]));_0x23496d[_0xd876('0x3a')]=_0x23496d['attributes'][_0xd876('0x3b')]?_0x23496d['attributes']:_0x52d99e[_0xd876('0x38')];if(!_0x4f8df5[_0xd876('0x36')][_0xd876('0x3c')](_0xd876('0x3d'))){_0x23496d[_0xd876('0x22')]=qs[_0xd876('0x22')](_0x4f8df5[_0xd876('0x36')]['limit']);_0x23496d[_0xd876('0x20')]=qs['offset'](_0x4f8df5['query'][_0xd876('0x20')]);}_0x23496d['order']=qs[_0xd876('0x3e')](_0x4f8df5[_0xd876('0x36')][_0xd876('0x3e')]);_0x23496d[_0xd876('0x3f')]=qs[_0xd876('0x40')](_[_0xd876('0x41')](_0x4f8df5[_0xd876('0x36')],_0x52d99e[_0xd876('0x40')]),_0x19be29);if(_0x4f8df5[_0xd876('0x36')][_0xd876('0x42')]){_0x23496d['where']=_['merge'](_0x23496d[_0xd876('0x3f')],{'$or':_[_0xd876('0x30')](_0x19be29,function(_0x46494b){if(_0x46494b[_0xd876('0x33')]!==_0xd876('0x43')){var _0x4d705a={};_0x4d705a[_0x46494b['name']]={'$like':'%'+_0x4f8df5[_0xd876('0x36')][_0xd876('0x42')]+'%'};return _0x4d705a;}})});}_0x23496d=_[_0xd876('0x44')]({},_0x23496d,_0x4f8df5[_0xd876('0x45')]);var _0x463605={'where':_0x23496d[_0xd876('0x3f')]};return db[_0xd876('0x31')][_0xd876('0x23')](_0x463605)[_0xd876('0x29')](function(_0x22ae79){_0x25ba5f[_0xd876('0x23')]=_0x22ae79;if(_0x4f8df5[_0xd876('0x36')][_0xd876('0x46')]){_0x23496d[_0xd876('0x47')]=[{'all':!![]}];}return db[_0xd876('0x31')]['findAll'](_0x23496d);})[_0xd876('0x29')](function(_0x195cdb){_0x25ba5f['rows']=_0x195cdb;return _0x25ba5f;})[_0xd876('0x29')](respondWithFilteredResult(_0x26aaa9,_0x23496d))[_0xd876('0x48')](handleError(_0x26aaa9,null));};exports[_0xd876('0x49')]=function(_0x4a65b2,_0x5e8d40){var _0x2a588b={'raw':!![],'where':{'id':_0x4a65b2[_0xd876('0x4a')]['id']}},_0x4d89cd={};_0x4d89cd[_0xd876('0x38')]=_[_0xd876('0x35')](db[_0xd876('0x31')]['rawAttributes']);_0x4d89cd['query']=_[_0xd876('0x35')](_0x4a65b2[_0xd876('0x36')]);_0x4d89cd['filters']=_[_0xd876('0x37')](_0x4d89cd['model'],_0x4d89cd[_0xd876('0x36')]);_0x2a588b[_0xd876('0x3a')]=_[_0xd876('0x37')](_0x4d89cd[_0xd876('0x38')],qs['fields'](_0x4a65b2[_0xd876('0x36')]['fields']));_0x2a588b[_0xd876('0x3a')]=_0x2a588b[_0xd876('0x3a')][_0xd876('0x3b')]?_0x2a588b[_0xd876('0x3a')]:_0x4d89cd['model'];if(_0x4a65b2['query'][_0xd876('0x46')]){_0x2a588b['include']=[{'all':!![]}];}_0x2a588b=_['merge']({},_0x2a588b,_0x4a65b2['options']);return db[_0xd876('0x31')]['find'](_0x2a588b)[_0xd876('0x29')](handleEntityNotFound(_0x5e8d40,null))[_0xd876('0x29')](respondWithResult(_0x5e8d40,null))[_0xd876('0x48')](handleError(_0x5e8d40,null));};exports['create']=function(_0x4d48ff,_0x1e3413){return db['AnalyticTreeReport'][_0xd876('0x4b')](_0x4d48ff[_0xd876('0x4c')],{})[_0xd876('0x29')](respondWithResult(_0x1e3413,0xc9))[_0xd876('0x48')](handleError(_0x1e3413,null));};exports[_0xd876('0x4d')]=function(_0x1bdf25,_0x44bd01){if(_0x1bdf25[_0xd876('0x4c')]['id']){delete _0x1bdf25[_0xd876('0x4c')]['id'];}return db[_0xd876('0x31')]['find']({'where':{'id':_0x1bdf25[_0xd876('0x4a')]['id']}})[_0xd876('0x29')](handleEntityNotFound(_0x44bd01,null))[_0xd876('0x29')](saveUpdates(_0x1bdf25[_0xd876('0x4c')],null))[_0xd876('0x29')](respondWithResult(_0x44bd01,null))[_0xd876('0x48')](handleError(_0x44bd01,null));};exports[_0xd876('0x2a')]=function(_0x4fefd7,_0x3e9bbd){return db[_0xd876('0x31')]['find']({'where':{'id':_0x4fefd7[_0xd876('0x4a')]['id']}})[_0xd876('0x29')](handleEntityNotFound(_0x3e9bbd,null))['then'](removeEntity(_0x3e9bbd,null))['catch'](handleError(_0x3e9bbd,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 2733aaa..a503fd5 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 _0x3f2e=['lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./analyticTreeReport.attributes','AnalyticTreeReport'];(function(_0x3b0adb,_0x2312f2){var _0x3f069b=function(_0x341465){while(--_0x341465){_0x3b0adb['push'](_0x3b0adb['shift']());}};_0x3f069b(++_0x2312f2);}(_0x3f2e,0x8c));var _0xe3f2=function(_0x3bad26,_0x1cf013){_0x3bad26=_0x3bad26-0x0;var _0x42e1ff=_0x3f2e[_0x3bad26];return _0x42e1ff;};'use strict';var _=require(_0xe3f2('0x0'));var util=require(_0xe3f2('0x1'));var logger=require(_0xe3f2('0x2'))(_0xe3f2('0x3'));var moment=require(_0xe3f2('0x4'));var BPromise=require('bluebird');var rp=require(_0xe3f2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe3f2('0x6'));var config=require(_0xe3f2('0x7'));var attributes=require(_0xe3f2('0x8'));module['exports']=function(_0x1bdc68,_0x5d9e7f){return _0x1bdc68['define'](_0xe3f2('0x9'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x117f=['rimraf','../../config/environment','./analyticTreeReport.attributes','define','analytics_report_trees','lodash','util','api','bluebird','path'];(function(_0x4400bf,_0x3dae8a){var _0x5aa062=function(_0x114528){while(--_0x114528){_0x4400bf['push'](_0x4400bf['shift']());}};_0x5aa062(++_0x3dae8a);}(_0x117f,0x131));var _0xf117=function(_0x7030b9,_0x31be49){_0x7030b9=_0x7030b9-0x0;var _0x5e2765=_0x117f[_0x7030b9];return _0x5e2765;};'use strict';var _=require(_0xf117('0x0'));var util=require(_0xf117('0x1'));var logger=require('../../config/logger')(_0xf117('0x2'));var moment=require('moment');var BPromise=require(_0xf117('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf117('0x4'));var rimraf=require(_0xf117('0x5'));var config=require(_0xf117('0x6'));var attributes=require(_0xf117('0x7'));module['exports']=function(_0x4d21f1,_0xb2d912){return _0x4d21f1[_0xf117('0x8')]('AnalyticTreeReport',attributes,{'tableName':_0xf117('0x9'),'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 b802913..693a4bb 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 _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(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0x2f4fcc,_0x341c75){_0x2f4fcc=_0x2f4fcc-0x0;var _0x22f9cf=_0x7a54[_0x2f4fcc];return _0x22f9cf;};'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 +var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x30392d,_0x4045fd){var _0x24e4be=function(_0x567956){while(--_0x567956){_0x30392d['push'](_0x30392d['shift']());}};_0x24e4be(++_0x4045fd);}(_0xdb28,0x106));var _0x8db2=function(_0x8d27dc,_0x30ba92){_0x8d27dc=_0x8d27dc-0x0;var _0xef9f86=_0xdb28[_0x8d27dc];return _0xef9f86;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 6afc1d9..b29ddc4 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 _0x1f6d=['get','isAuthenticated','index','/:id','post','create','put','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x1f6d,0xa1));var _0xd1f6=function(_0xbad322,_0x3e6b0b){_0xbad322=_0xbad322-0x0;var _0x2101cb=_0x1f6d[_0xbad322];return _0x2101cb;};'use strict';var multer=require('multer');var util=require(_0xd1f6('0x0'));var path=require('path');var timeout=require(_0xd1f6('0x1'));var express=require(_0xd1f6('0x2'));var router=express[_0xd1f6('0x3')]();var fs_extra=require(_0xd1f6('0x4'));var auth=require(_0xd1f6('0x5'));var interaction=require(_0xd1f6('0x6'));var config=require(_0xd1f6('0x7'));var controller=require(_0xd1f6('0x8'));router[_0xd1f6('0x9')]('/',auth[_0xd1f6('0xa')](),controller[_0xd1f6('0xb')]);router[_0xd1f6('0x9')](_0xd1f6('0xc'),auth[_0xd1f6('0xa')](),controller['show']);router[_0xd1f6('0xd')]('/',auth[_0xd1f6('0xa')](),controller[_0xd1f6('0xe')]);router[_0xd1f6('0xf')](_0xd1f6('0xc'),auth[_0xd1f6('0xa')](),controller['update']);router['delete'](_0xd1f6('0xc'),auth[_0xd1f6('0xa')](),controller[_0xd1f6('0x10')]);module['exports']=router; \ No newline at end of file +var _0x1f92=['util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','create','put','update','exports','multer'];(function(_0xb60a95,_0xdb478f){var _0x2c876c=function(_0x234c62){while(--_0x234c62){_0xb60a95['push'](_0xb60a95['shift']());}};_0x2c876c(++_0xdb478f);}(_0x1f92,0xfb));var _0x21f9=function(_0x4e74dd,_0x32f425){_0x4e74dd=_0x4e74dd-0x0;var _0x1b22f0=_0x1f92[_0x4e74dd];return _0x1b22f0;};'use strict';var multer=require(_0x21f9('0x0'));var util=require(_0x21f9('0x1'));var path=require(_0x21f9('0x2'));var timeout=require('connect-timeout');var express=require(_0x21f9('0x3'));var router=express[_0x21f9('0x4')]();var fs_extra=require(_0x21f9('0x5'));var auth=require(_0x21f9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x21f9('0x7'));var controller=require(_0x21f9('0x8'));router[_0x21f9('0x9')]('/',auth[_0x21f9('0xa')](),controller[_0x21f9('0xb')]);router[_0x21f9('0x9')](_0x21f9('0xc'),auth[_0x21f9('0xa')](),controller[_0x21f9('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x21f9('0xe')]);router[_0x21f9('0xf')]('/:id',auth[_0x21f9('0xa')](),controller[_0x21f9('0x10')]);router['delete']('/:id',auth[_0x21f9('0xa')](),controller['destroy']);module[_0x21f9('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 4d5ada6..00ff31e 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 _0xa101=['sequelize','exports','STRING'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0xa101,0x15f));var _0x1a10=function(_0x453e2b,_0x4f1258){_0x453e2b=_0x453e2b-0x0;var _0x50f306=_0xa101[_0x453e2b];return _0x50f306;};'use strict';var Sequelize=require(_0x1a10('0x0'));module[_0x1a10('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x1a10('0x2')]},'type':{'type':Sequelize[_0x1a10('0x2')]}}; \ No newline at end of file +var _0x6c4b=['sequelize','exports','STRING'];(function(_0xe8b9c7,_0x534838){var _0x4b606f=function(_0x355178){while(--_0x355178){_0xe8b9c7['push'](_0xe8b9c7['shift']());}};_0x4b606f(++_0x534838);}(_0x6c4b,0x93));var _0xb6c4=function(_0x412dd8,_0x355780){_0x412dd8=_0x412dd8-0x0;var _0x47b96=_0x6c4b[_0x412dd8];return _0x47b96;};'use strict';var Sequelize=require(_0xb6c4('0x0'));module[_0xb6c4('0x1')]={'name':{'type':Sequelize[_0xb6c4('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xb6c4('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index eb980a6..346157d 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 _0x04ed=['fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','clone','get','createdAt','updatedAt','body','omit','find','create','basename','download','ChatOfflineMessageId','server/files/attachments/','join','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','error','stack','name','send','index','map','Attachment','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x04ed,0x6f));var _0xd04e=function(_0x145862,_0x8356cd){_0x145862=_0x145862-0x0;var _0x215824=_0x04ed[_0x145862];return _0x215824;};'use strict';var emlformat=require(_0xd04e('0x0'));var rimraf=require(_0xd04e('0x1'));var zipdir=require(_0xd04e('0x2'));var jsonpatch=require(_0xd04e('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd04e('0x4'));var util=require(_0xd04e('0x5'));var path=require('path');var sox=require(_0xd04e('0x6'));var csv=require('to-csv');var ejs=require(_0xd04e('0x7'));var fs=require('fs');var fs_extra=require(_0xd04e('0x8'));var _=require(_0xd04e('0x9'));var squel=require('squel');var crypto=require(_0xd04e('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xd04e('0xb'));var toCsv=require(_0xd04e('0xc'));var querystring=require(_0xd04e('0xd'));var Papa=require('papaparse');var Redis=require(_0xd04e('0xe'));var authService=require(_0xd04e('0xf'));var qs=require(_0xd04e('0x10'));var as=require(_0xd04e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd04e('0x12'))(_0xd04e('0x13'));var utils=require(_0xd04e('0x14'));var config=require(_0xd04e('0x15'));var licenseUtil=require(_0xd04e('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42614d,_0x230c5c){_0x230c5c=_0x230c5c||0xcc;return function(_0x497551){if(_0x497551){return _0x42614d[_0xd04e('0x17')](_0x230c5c);}return _0x42614d[_0xd04e('0x18')](_0x230c5c)['end']();};}function respondWithResult(_0x1e05a3,_0x19ffaa){_0x19ffaa=_0x19ffaa||0xc8;return function(_0x1f138f){if(_0x1f138f){return _0x1e05a3[_0xd04e('0x18')](_0x19ffaa)[_0xd04e('0x19')](_0x1f138f);}};}function respondWithFilteredResult(_0x4ac303,_0xf548ea){return function(_0x7c1e79){if(_0x7c1e79){var _0x3f4672=typeof _0xf548ea[_0xd04e('0x1a')]===_0xd04e('0x1b')&&typeof _0xf548ea['limit']==='undefined';var _0x17d995=_0x7c1e79[_0xd04e('0x1c')];var _0x34bf42=_0x3f4672?0x0:_0xf548ea[_0xd04e('0x1a')];var _0x556e46=_0x3f4672?_0x7c1e79[_0xd04e('0x1c')]:_0xf548ea[_0xd04e('0x1a')]+_0xf548ea[_0xd04e('0x1d')];var _0x57617c;if(_0x556e46>=_0x17d995){_0x556e46=_0x17d995;_0x57617c=0xc8;}else{_0x57617c=0xce;}_0x4ac303['status'](_0x57617c);return _0x4ac303[_0xd04e('0x1e')]('Content-Range',_0x34bf42+'-'+_0x556e46+'/'+_0x17d995)['json'](_0x7c1e79);}return null;};}function patchUpdates(_0x481551){return function(_0x145016){try{jsonpatch[_0xd04e('0x1f')](_0x145016,_0x481551,!![]);}catch(_0x7f48b9){return BPromise['reject'](_0x7f48b9);}return _0x145016[_0xd04e('0x20')]();};}function saveUpdates(_0x4b7500,_0x51b021){return function(_0x590678){if(_0x590678){return _0x590678[_0xd04e('0x21')](_0x4b7500)[_0xd04e('0x22')](function(_0x2c2190){return _0x2c2190;});}return null;};}function removeEntity(_0x4a843e,_0x386d43){return function(_0x57fa52){if(_0x57fa52){return _0x57fa52[_0xd04e('0x23')]()[_0xd04e('0x22')](function(){_0x4a843e[_0xd04e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14e69e,_0x11dad1){return function(_0x6d4d5e){if(!_0x6d4d5e){_0x14e69e['sendStatus'](0x194);}return _0x6d4d5e;};}function handleError(_0x782ddf,_0x3cb4af){_0x3cb4af=_0x3cb4af||0x1f4;return function(_0x2e124a){logger[_0xd04e('0x24')](_0x2e124a[_0xd04e('0x25')]);if(_0x2e124a[_0xd04e('0x26')]){delete _0x2e124a[_0xd04e('0x26')];}_0x782ddf[_0xd04e('0x18')](_0x3cb4af)[_0xd04e('0x27')](_0x2e124a);};}exports[_0xd04e('0x28')]=function(_0x319b68,_0x4e9f7b){var _0x49fca7={},_0x44e360={},_0x35aaed={'count':0x0,'rows':[]};var _0x4a3f7e=_[_0xd04e('0x29')](db[_0xd04e('0x2a')][_0xd04e('0x2b')],function(_0x3b377f){return{'name':_0x3b377f[_0xd04e('0x2c')],'type':_0x3b377f[_0xd04e('0x2d')][_0xd04e('0x2e')]};});_0x44e360[_0xd04e('0x2f')]=_[_0xd04e('0x29')](_0x4a3f7e,_0xd04e('0x26'));_0x44e360[_0xd04e('0x30')]=_[_0xd04e('0x31')](_0x319b68[_0xd04e('0x30')]);_0x44e360[_0xd04e('0x32')]=_[_0xd04e('0x33')](_0x44e360['model'],_0x44e360['query']);_0x49fca7[_0xd04e('0x34')]=_[_0xd04e('0x33')](_0x44e360['model'],qs[_0xd04e('0x35')](_0x319b68[_0xd04e('0x30')][_0xd04e('0x35')]));_0x49fca7[_0xd04e('0x34')]=_0x49fca7['attributes'][_0xd04e('0x36')]?_0x49fca7['attributes']:_0x44e360[_0xd04e('0x2f')];if(!_0x319b68[_0xd04e('0x30')]['hasOwnProperty'](_0xd04e('0x37'))){_0x49fca7[_0xd04e('0x1d')]=qs['limit'](_0x319b68[_0xd04e('0x30')][_0xd04e('0x1d')]);_0x49fca7[_0xd04e('0x1a')]=qs[_0xd04e('0x1a')](_0x319b68[_0xd04e('0x30')]['offset']);}_0x49fca7[_0xd04e('0x38')]=qs[_0xd04e('0x39')](_0x319b68['query'][_0xd04e('0x39')]);_0x49fca7[_0xd04e('0x3a')]=qs['filters'](_['pick'](_0x319b68[_0xd04e('0x30')],_0x44e360[_0xd04e('0x32')]),_0x4a3f7e);if(_0x319b68['query'][_0xd04e('0x3b')]){_0x49fca7[_0xd04e('0x3a')]=_[_0xd04e('0x3c')](_0x49fca7[_0xd04e('0x3a')],{'$or':_[_0xd04e('0x29')](_0x4a3f7e,function(_0x4f316e){if(_0x4f316e['type']!==_0xd04e('0x3d')){var _0x35d564={};_0x35d564[_0x4f316e[_0xd04e('0x26')]]={'$like':'%'+_0x319b68[_0xd04e('0x30')][_0xd04e('0x3b')]+'%'};return _0x35d564;}})});}_0x49fca7=_[_0xd04e('0x3c')]({},_0x49fca7,_0x319b68[_0xd04e('0x3e')]);var _0x4d06f8={'where':_0x49fca7[_0xd04e('0x3a')]};return db['Attachment']['count'](_0x4d06f8)[_0xd04e('0x22')](function(_0x3b1e9e){_0x35aaed[_0xd04e('0x1c')]=_0x3b1e9e;if(_0x319b68[_0xd04e('0x30')][_0xd04e('0x3f')]){_0x49fca7[_0xd04e('0x40')]=[{'all':!![]}];}return db[_0xd04e('0x2a')][_0xd04e('0x41')](_0x49fca7);})['then'](function(_0x290128){_0x35aaed[_0xd04e('0x42')]=_0x290128;return _0x35aaed;})[_0xd04e('0x22')](respondWithFilteredResult(_0x4e9f7b,_0x49fca7))[_0xd04e('0x43')](handleError(_0x4e9f7b,null));};exports['show']=function(_0x57f7fc,_0x4b379b){var _0x1c6730={'raw':!![],'where':{'id':_0x57f7fc[_0xd04e('0x44')]['id']}},_0xa92426={};_0xa92426[_0xd04e('0x2f')]=_['keys'](db[_0xd04e('0x2a')]['rawAttributes']);_0xa92426[_0xd04e('0x30')]=_[_0xd04e('0x31')](_0x57f7fc['query']);_0xa92426[_0xd04e('0x32')]=_[_0xd04e('0x33')](_0xa92426[_0xd04e('0x2f')],_0xa92426[_0xd04e('0x30')]);_0x1c6730[_0xd04e('0x34')]=_[_0xd04e('0x33')](_0xa92426['model'],qs[_0xd04e('0x35')](_0x57f7fc[_0xd04e('0x30')][_0xd04e('0x35')]));_0x1c6730[_0xd04e('0x34')]=_0x1c6730[_0xd04e('0x34')][_0xd04e('0x36')]?_0x1c6730[_0xd04e('0x34')]:_0xa92426['model'];if(_0x57f7fc[_0xd04e('0x30')][_0xd04e('0x3f')]){_0x1c6730[_0xd04e('0x40')]=[{'all':!![]}];}_0x1c6730=_['merge']({},_0x1c6730,_0x57f7fc[_0xd04e('0x3e')]);return db['Attachment']['find'](_0x1c6730)['then'](handleEntityNotFound(_0x4b379b,null))['then'](respondWithResult(_0x4b379b,null))[_0xd04e('0x43')](handleError(_0x4b379b,null));};exports[_0xd04e('0x45')]=function(_0x5cc169,_0x3b0300){var _0x1838e3={'where':{'id':_0x5cc169['params']['id']}},_0x58718e={};_0x58718e['model']=_['keys'](db[_0xd04e('0x2a')][_0xd04e('0x2b')]);_0x1838e3['attributes']=_[_0xd04e('0x33')](_0x58718e[_0xd04e('0x2f')],qs['fields'](_0x5cc169[_0xd04e('0x30')][_0xd04e('0x35')]));_0x1838e3['attributes']=_0x1838e3[_0xd04e('0x34')][_0xd04e('0x36')]?_0x1838e3[_0xd04e('0x34')]:_0x58718e['model'];if(_0x5cc169['query'][_0xd04e('0x3f')]){_0x1838e3[_0xd04e('0x40')]=[{'all':!![]}];}_0x1838e3=_[_0xd04e('0x3c')]({},_0x1838e3,_0x5cc169[_0xd04e('0x3e')]);return db[_0xd04e('0x2a')]['find'](_0x1838e3)[_0xd04e('0x22')](handleEntityNotFound(_0x3b0300,null))[_0xd04e('0x22')](function(_0x476087){if(_0x476087){var _0x28ff9c=_0x476087[_0xd04e('0x46')]({'plain':!![]});_0x28ff9c=qs['omit'](_0x28ff9c,['id',_0xd04e('0x47'),_0xd04e('0x48')]);_0x5cc169[_0xd04e('0x49')]=_[_0xd04e('0x4a')](_0x5cc169[_0xd04e('0x49')],['id',_0xd04e('0x47'),_0xd04e('0x48')]);return db[_0xd04e('0x2a')]['create'](_[_0xd04e('0x3c')](_0x28ff9c,_0x5cc169[_0xd04e('0x49')]),{'include':_0x5cc169[_0xd04e('0x30')][_0xd04e('0x3f')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x3b0300,0xc9))[_0xd04e('0x43')](handleError(_0x3b0300,null));};exports['update']=function(_0x31ce84,_0x49a513){if(_0x31ce84[_0xd04e('0x49')]['id']){delete _0x31ce84[_0xd04e('0x49')]['id'];}return db[_0xd04e('0x2a')]['find']({'where':{'id':_0x31ce84[_0xd04e('0x44')]['id']}})['then'](handleEntityNotFound(_0x49a513,null))[_0xd04e('0x22')](saveUpdates(_0x31ce84[_0xd04e('0x49')],null))[_0xd04e('0x22')](respondWithResult(_0x49a513,null))[_0xd04e('0x43')](handleError(_0x49a513,null));};exports[_0xd04e('0x23')]=function(_0x542820,_0x1cc584){return db[_0xd04e('0x2a')][_0xd04e('0x4b')]({'where':{'id':_0x542820[_0xd04e('0x44')]['id']}})[_0xd04e('0x22')](handleEntityNotFound(_0x1cc584,null))[_0xd04e('0x22')](removeEntity(_0x1cc584,null))[_0xd04e('0x43')](handleError(_0x1cc584,null));};exports[_0xd04e('0x4c')]=function(_0x29686a,_0x5a8be0,_0x4aed72){_0x29686a['body'][_0xd04e('0x26')]=_0x29686a['file']['originalname'];_0x29686a['body'][_0xd04e('0x4d')]=_0x29686a['file']['filename'];_0x29686a[_0xd04e('0x49')][_0xd04e('0x2d')]=_0x29686a['file']['mimetype'];return db['Attachment'][_0xd04e('0x4c')](_0x29686a[_0xd04e('0x49')])['then'](respondWithResult(_0x5a8be0,0xc9))['catch'](handleError(_0x5a8be0,null));};exports[_0xd04e('0x4e')]=function(_0x21c40f,_0x48241e,_0x55085d){return db[_0xd04e('0x2a')]['findOne']({'where':{'id':_0x21c40f['params']['id']},'raw':!![]})[_0xd04e('0x22')](handleEntityNotFound(_0x48241e,null))['then'](function(_0x559c84){if(_0x559c84){var _0x2caae6=_0x559c84[_0xd04e('0x4f')]!==null;var _0x473165=path['join'](config['root'],_0xd04e('0x50'));if(_0x2caae6){_0x473165=path[_0xd04e('0x51')](_0x473165,'offline-chat/');}var _0x1b38c8=path['join'](_0x473165,_0x559c84['basename']);return _0x48241e[_0xd04e('0x4e')](_0x1b38c8);}})[_0xd04e('0x43')](handleError(_0x48241e,null));}; \ No newline at end of file +var _0x84ef=['get','omit','createdAt','updatedAt','body','create','originalname','basename','file','filename','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','error','stack','name','send','index','map','fieldName','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','Attachment','includeAll','findAll','rows','catch','params','keys','fields','include','rawAttributes'];(function(_0x19d1fc,_0x283cae){var _0x4194a1=function(_0x36b266){while(--_0x36b266){_0x19d1fc['push'](_0x19d1fc['shift']());}};_0x4194a1(++_0x283cae);}(_0x84ef,0xbb));var _0xf84e=function(_0x46ed5a,_0x540a37){_0x46ed5a=_0x46ed5a-0x0;var _0x35ab60=_0x84ef[_0x46ed5a];return _0x35ab60;};'use strict';var emlformat=require(_0xf84e('0x0'));var rimraf=require(_0xf84e('0x1'));var zipdir=require(_0xf84e('0x2'));var jsonpatch=require(_0xf84e('0x3'));var rp=require(_0xf84e('0x4'));var moment=require(_0xf84e('0x5'));var BPromise=require(_0xf84e('0x6'));var Mustache=require(_0xf84e('0x7'));var util=require('util');var path=require(_0xf84e('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(_0xf84e('0x9'));var squel=require(_0xf84e('0xa'));var crypto=require(_0xf84e('0xb'));var jsforce=require(_0xf84e('0xc'));var deskjs=require(_0xf84e('0xd'));var toCsv=require(_0xf84e('0xe'));var querystring=require('querystring');var Papa=require(_0xf84e('0xf'));var Redis=require(_0xf84e('0x10'));var authService=require(_0xf84e('0x11'));var qs=require(_0xf84e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf84e('0x13'))('api');var utils=require(_0xf84e('0x14'));var config=require(_0xf84e('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xf84e('0x16'))['db'];function respondWithStatusCode(_0x577645,_0x4b39a4){_0x4b39a4=_0x4b39a4||0xcc;return function(_0x39ea40){if(_0x39ea40){return _0x577645[_0xf84e('0x17')](_0x4b39a4);}return _0x577645[_0xf84e('0x18')](_0x4b39a4)[_0xf84e('0x19')]();};}function respondWithResult(_0x23e307,_0x2e27da){_0x2e27da=_0x2e27da||0xc8;return function(_0x80c77c){if(_0x80c77c){return _0x23e307[_0xf84e('0x18')](_0x2e27da)[_0xf84e('0x1a')](_0x80c77c);}};}function respondWithFilteredResult(_0xb76228,_0x3a20ec){return function(_0x4cac83){if(_0x4cac83){var _0x4bb21d=typeof _0x3a20ec[_0xf84e('0x1b')]===_0xf84e('0x1c')&&typeof _0x3a20ec[_0xf84e('0x1d')]===_0xf84e('0x1c');var _0x478f8c=_0x4cac83[_0xf84e('0x1e')];var _0x46431d=_0x4bb21d?0x0:_0x3a20ec[_0xf84e('0x1b')];var _0xd5c31=_0x4bb21d?_0x4cac83[_0xf84e('0x1e')]:_0x3a20ec['offset']+_0x3a20ec[_0xf84e('0x1d')];var _0x4b5106;if(_0xd5c31>=_0x478f8c){_0xd5c31=_0x478f8c;_0x4b5106=0xc8;}else{_0x4b5106=0xce;}_0xb76228[_0xf84e('0x18')](_0x4b5106);return _0xb76228[_0xf84e('0x1f')]('Content-Range',_0x46431d+'-'+_0xd5c31+'/'+_0x478f8c)[_0xf84e('0x1a')](_0x4cac83);}return null;};}function patchUpdates(_0x2aae96){return function(_0x1274cf){try{jsonpatch[_0xf84e('0x20')](_0x1274cf,_0x2aae96,!![]);}catch(_0x359bf5){return BPromise[_0xf84e('0x21')](_0x359bf5);}return _0x1274cf[_0xf84e('0x22')]();};}function saveUpdates(_0x756703,_0x4e118b){return function(_0x57320c){if(_0x57320c){return _0x57320c[_0xf84e('0x23')](_0x756703)[_0xf84e('0x24')](function(_0x1afd24){return _0x1afd24;});}return null;};}function removeEntity(_0x3f0b9d,_0x2e9446){return function(_0x5c8c2e){if(_0x5c8c2e){return _0x5c8c2e['destroy']()[_0xf84e('0x24')](function(){_0x3f0b9d[_0xf84e('0x18')](0xcc)[_0xf84e('0x19')]();});}};}function handleEntityNotFound(_0xb4e5be,_0x28eddf){return function(_0x38cea4){if(!_0x38cea4){_0xb4e5be[_0xf84e('0x17')](0x194);}return _0x38cea4;};}function handleError(_0x1fd885,_0x273a99){_0x273a99=_0x273a99||0x1f4;return function(_0x4b0c1d){logger[_0xf84e('0x25')](_0x4b0c1d[_0xf84e('0x26')]);if(_0x4b0c1d[_0xf84e('0x27')]){delete _0x4b0c1d['name'];}_0x1fd885[_0xf84e('0x18')](_0x273a99)[_0xf84e('0x28')](_0x4b0c1d);};}exports[_0xf84e('0x29')]=function(_0x24ab0d,_0x318a17){var _0x5b58d5={},_0x56d58d={},_0x229a86={'count':0x0,'rows':[]};var _0x550666=_[_0xf84e('0x2a')](db['Attachment']['rawAttributes'],function(_0x55a1d9){return{'name':_0x55a1d9[_0xf84e('0x2b')],'type':_0x55a1d9[_0xf84e('0x2c')][_0xf84e('0x2d')]};});_0x56d58d[_0xf84e('0x2e')]=_[_0xf84e('0x2a')](_0x550666,_0xf84e('0x27'));_0x56d58d[_0xf84e('0x2f')]=_['keys'](_0x24ab0d[_0xf84e('0x2f')]);_0x56d58d[_0xf84e('0x30')]=_[_0xf84e('0x31')](_0x56d58d[_0xf84e('0x2e')],_0x56d58d[_0xf84e('0x2f')]);_0x5b58d5[_0xf84e('0x32')]=_[_0xf84e('0x31')](_0x56d58d[_0xf84e('0x2e')],qs['fields'](_0x24ab0d[_0xf84e('0x2f')]['fields']));_0x5b58d5['attributes']=_0x5b58d5[_0xf84e('0x32')][_0xf84e('0x33')]?_0x5b58d5[_0xf84e('0x32')]:_0x56d58d['model'];if(!_0x24ab0d['query'][_0xf84e('0x34')](_0xf84e('0x35'))){_0x5b58d5[_0xf84e('0x1d')]=qs[_0xf84e('0x1d')](_0x24ab0d[_0xf84e('0x2f')]['limit']);_0x5b58d5[_0xf84e('0x1b')]=qs[_0xf84e('0x1b')](_0x24ab0d[_0xf84e('0x2f')][_0xf84e('0x1b')]);}_0x5b58d5[_0xf84e('0x36')]=qs[_0xf84e('0x37')](_0x24ab0d[_0xf84e('0x2f')][_0xf84e('0x37')]);_0x5b58d5[_0xf84e('0x38')]=qs[_0xf84e('0x30')](_[_0xf84e('0x39')](_0x24ab0d[_0xf84e('0x2f')],_0x56d58d['filters']),_0x550666);if(_0x24ab0d[_0xf84e('0x2f')][_0xf84e('0x3a')]){_0x5b58d5[_0xf84e('0x38')]=_[_0xf84e('0x3b')](_0x5b58d5[_0xf84e('0x38')],{'$or':_[_0xf84e('0x2a')](_0x550666,function(_0x57433a){if(_0x57433a[_0xf84e('0x2c')]!=='VIRTUAL'){var _0x1ebb52={};_0x1ebb52[_0x57433a[_0xf84e('0x27')]]={'$like':'%'+_0x24ab0d[_0xf84e('0x2f')]['filter']+'%'};return _0x1ebb52;}})});}_0x5b58d5=_[_0xf84e('0x3b')]({},_0x5b58d5,_0x24ab0d[_0xf84e('0x3c')]);var _0x3ffecd={'where':_0x5b58d5[_0xf84e('0x38')]};return db[_0xf84e('0x3d')]['count'](_0x3ffecd)[_0xf84e('0x24')](function(_0x52270b){_0x229a86[_0xf84e('0x1e')]=_0x52270b;if(_0x24ab0d['query'][_0xf84e('0x3e')]){_0x5b58d5['include']=[{'all':!![]}];}return db['Attachment'][_0xf84e('0x3f')](_0x5b58d5);})['then'](function(_0x952456){_0x229a86[_0xf84e('0x40')]=_0x952456;return _0x229a86;})[_0xf84e('0x24')](respondWithFilteredResult(_0x318a17,_0x5b58d5))[_0xf84e('0x41')](handleError(_0x318a17,null));};exports['show']=function(_0x25ca6e,_0x518556){var _0x1d5d33={'raw':!![],'where':{'id':_0x25ca6e[_0xf84e('0x42')]['id']}},_0x17905a={};_0x17905a[_0xf84e('0x2e')]=_[_0xf84e('0x43')](db[_0xf84e('0x3d')]['rawAttributes']);_0x17905a[_0xf84e('0x2f')]=_[_0xf84e('0x43')](_0x25ca6e[_0xf84e('0x2f')]);_0x17905a['filters']=_['intersection'](_0x17905a[_0xf84e('0x2e')],_0x17905a[_0xf84e('0x2f')]);_0x1d5d33['attributes']=_['intersection'](_0x17905a[_0xf84e('0x2e')],qs[_0xf84e('0x44')](_0x25ca6e[_0xf84e('0x2f')][_0xf84e('0x44')]));_0x1d5d33[_0xf84e('0x32')]=_0x1d5d33[_0xf84e('0x32')][_0xf84e('0x33')]?_0x1d5d33['attributes']:_0x17905a[_0xf84e('0x2e')];if(_0x25ca6e[_0xf84e('0x2f')][_0xf84e('0x3e')]){_0x1d5d33[_0xf84e('0x45')]=[{'all':!![]}];}_0x1d5d33=_[_0xf84e('0x3b')]({},_0x1d5d33,_0x25ca6e[_0xf84e('0x3c')]);return db[_0xf84e('0x3d')]['find'](_0x1d5d33)[_0xf84e('0x24')](handleEntityNotFound(_0x518556,null))[_0xf84e('0x24')](respondWithResult(_0x518556,null))[_0xf84e('0x41')](handleError(_0x518556,null));};exports['clone']=function(_0x1e8858,_0x3f2f9f){var _0x2d1a47={'where':{'id':_0x1e8858['params']['id']}},_0x1989a9={};_0x1989a9[_0xf84e('0x2e')]=_[_0xf84e('0x43')](db[_0xf84e('0x3d')][_0xf84e('0x46')]);_0x2d1a47[_0xf84e('0x32')]=_[_0xf84e('0x31')](_0x1989a9[_0xf84e('0x2e')],qs['fields'](_0x1e8858['query'][_0xf84e('0x44')]));_0x2d1a47[_0xf84e('0x32')]=_0x2d1a47[_0xf84e('0x32')][_0xf84e('0x33')]?_0x2d1a47[_0xf84e('0x32')]:_0x1989a9[_0xf84e('0x2e')];if(_0x1e8858['query'][_0xf84e('0x3e')]){_0x2d1a47[_0xf84e('0x45')]=[{'all':!![]}];}_0x2d1a47=_['merge']({},_0x2d1a47,_0x1e8858[_0xf84e('0x3c')]);return db[_0xf84e('0x3d')]['find'](_0x2d1a47)[_0xf84e('0x24')](handleEntityNotFound(_0x3f2f9f,null))['then'](function(_0x5cb08e){if(_0x5cb08e){var _0x3ef581=_0x5cb08e[_0xf84e('0x47')]({'plain':!![]});_0x3ef581=qs[_0xf84e('0x48')](_0x3ef581,['id',_0xf84e('0x49'),_0xf84e('0x4a')]);_0x1e8858[_0xf84e('0x4b')]=_[_0xf84e('0x48')](_0x1e8858[_0xf84e('0x4b')],['id',_0xf84e('0x49'),_0xf84e('0x4a')]);return db[_0xf84e('0x3d')][_0xf84e('0x4c')](_[_0xf84e('0x3b')](_0x3ef581,_0x1e8858['body']),{'include':_0x1e8858[_0xf84e('0x2f')][_0xf84e('0x3e')]?[{'all':!![]}]:undefined});}})[_0xf84e('0x24')](respondWithResult(_0x3f2f9f,0xc9))[_0xf84e('0x41')](handleError(_0x3f2f9f,null));};exports[_0xf84e('0x23')]=function(_0x40fe05,_0xcf6f3b){if(_0x40fe05[_0xf84e('0x4b')]['id']){delete _0x40fe05[_0xf84e('0x4b')]['id'];}return db['Attachment']['find']({'where':{'id':_0x40fe05[_0xf84e('0x42')]['id']}})[_0xf84e('0x24')](handleEntityNotFound(_0xcf6f3b,null))['then'](saveUpdates(_0x40fe05[_0xf84e('0x4b')],null))[_0xf84e('0x24')](respondWithResult(_0xcf6f3b,null))[_0xf84e('0x41')](handleError(_0xcf6f3b,null));};exports['destroy']=function(_0x56e4a8,_0x2641ac){return db['Attachment']['find']({'where':{'id':_0x56e4a8[_0xf84e('0x42')]['id']}})[_0xf84e('0x24')](handleEntityNotFound(_0x2641ac,null))[_0xf84e('0x24')](removeEntity(_0x2641ac,null))[_0xf84e('0x41')](handleError(_0x2641ac,null));};exports[_0xf84e('0x4c')]=function(_0x2188c1,_0x551229,_0x1e8f96){_0x2188c1[_0xf84e('0x4b')][_0xf84e('0x27')]=_0x2188c1['file'][_0xf84e('0x4d')];_0x2188c1[_0xf84e('0x4b')][_0xf84e('0x4e')]=_0x2188c1[_0xf84e('0x4f')][_0xf84e('0x50')];_0x2188c1['body'][_0xf84e('0x2c')]=_0x2188c1[_0xf84e('0x4f')]['mimetype'];return db[_0xf84e('0x3d')][_0xf84e('0x4c')](_0x2188c1['body'])[_0xf84e('0x24')](respondWithResult(_0x551229,0xc9))[_0xf84e('0x41')](handleError(_0x551229,null));};exports['download']=function(_0x4074ab,_0x264e16,_0x43be6b){return db['Attachment'][_0xf84e('0x51')]({'where':{'id':_0x4074ab['params']['id']},'raw':!![]})[_0xf84e('0x24')](handleEntityNotFound(_0x264e16,null))['then'](function(_0x245985){if(_0x245985){var _0x430e38=_0x245985[_0xf84e('0x52')]!==null;var _0x442c7c=path[_0xf84e('0x53')](config[_0xf84e('0x54')],_0xf84e('0x55'));if(_0x430e38){_0x442c7c=path[_0xf84e('0x53')](_0x442c7c,'offline-chat/');}var _0x55d7dd=path[_0xf84e('0x53')](_0x442c7c,_0x245985[_0xf84e('0x4e')]);return _0x264e16['download'](_0x55d7dd);}})[_0xf84e('0x41')](handleError(_0x264e16,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index c9d838f..500b6fe 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 _0xd512=['path','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','util','moment','bluebird','request-promise'];(function(_0x2d7c67,_0x358a79){var _0x523bd4=function(_0x131498){while(--_0x131498){_0x2d7c67['push'](_0x2d7c67['shift']());}};_0x523bd4(++_0x358a79);}(_0xd512,0x10f));var _0x2d51=function(_0x41b683,_0x10e5ab){_0x41b683=_0x41b683-0x0;var _0x3e8d91=_0xd512[_0x41b683];return _0x3e8d91;};'use strict';var _=require(_0x2d51('0x0'));var util=require(_0x2d51('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2d51('0x2'));var BPromise=require(_0x2d51('0x3'));var rp=require(_0x2d51('0x4'));var fs=require('fs');var path=require(_0x2d51('0x5'));var rimraf=require('rimraf');var config=require(_0x2d51('0x6'));var attributes=require(_0x2d51('0x7'));module[_0x2d51('0x8')]=function(_0x3c2561,_0x47dbc1){return _0x3c2561[_0x2d51('0x9')](_0x2d51('0xa'),attributes,{'tableName':_0x2d51('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x51be=['util','../../config/logger','request-promise','path','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash'];(function(_0x42f985,_0x168c69){var _0x3f00ea=function(_0x571a6f){while(--_0x571a6f){_0x42f985['push'](_0x42f985['shift']());}};_0x3f00ea(++_0x168c69);}(_0x51be,0x180));var _0xe51b=function(_0x420513,_0x30eae3){_0x420513=_0x420513-0x0;var _0x1b44ec=_0x51be[_0x420513];return _0x1b44ec;};'use strict';var _=require(_0xe51b('0x0'));var util=require(_0xe51b('0x1'));var logger=require(_0xe51b('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe51b('0x3'));var fs=require('fs');var path=require(_0xe51b('0x4'));var rimraf=require('rimraf');var config=require(_0xe51b('0x5'));var attributes=require(_0xe51b('0x6'));module[_0xe51b('0x7')]=function(_0x5a5dfb,_0x41a431){return _0x5a5dfb[_0xe51b('0x8')](_0xe51b('0x9'),attributes,{'tableName':_0xe51b('0xa'),'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 004c03a..6afcbee 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 _0xecd5=['options','raw','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','CreateAttachment','Attachment','create'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xecd5,0x110));var _0x5ecd=function(_0x4adf5a,_0x12e127){_0x4adf5a=_0x4adf5a-0x0;var _0x5f071f=_0xecd5[_0x4adf5a];return _0x5f071f;};'use strict';var _=require('lodash');var util=require(_0x5ecd('0x0'));var moment=require(_0x5ecd('0x1'));var BPromise=require(_0x5ecd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5ecd('0x3'));var db=require(_0x5ecd('0x4'))['db'];var utils=require(_0x5ecd('0x5'));var logger=require(_0x5ecd('0x6'))('rpc');var config=require(_0x5ecd('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5ecd('0x8')][_0x5ecd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a1870,_0x42c752,_0x26d951){return new BPromise(function(_0x2cb71b,_0x946412){return client[_0x5ecd('0xa')](_0x4a1870,_0x26d951)[_0x5ecd('0xb')](function(_0x305f1b){logger[_0x5ecd('0xc')](_0x5ecd('0xd'),_0x42c752,_0x5ecd('0xe'));logger[_0x5ecd('0xf')](_0x5ecd('0x10'),_0x42c752,'request\x20sent',JSON[_0x5ecd('0x11')](_0x305f1b));if(_0x305f1b['error']){if(_0x305f1b['error'][_0x5ecd('0x12')]===0x1f4){logger[_0x5ecd('0x13')]('Attachment,\x20%s,\x20%s',_0x42c752,_0x305f1b['error'][_0x5ecd('0x14')]);return _0x946412(_0x305f1b[_0x5ecd('0x13')][_0x5ecd('0x14')]);}logger[_0x5ecd('0x13')]('Attachment,\x20%s,\x20%s',_0x42c752,_0x305f1b[_0x5ecd('0x13')][_0x5ecd('0x14')]);return _0x2cb71b(_0x305f1b['error'][_0x5ecd('0x14')]);}else{logger[_0x5ecd('0xc')]('Attachment,\x20%s,\x20%s',_0x42c752,_0x5ecd('0xe'));_0x2cb71b(_0x305f1b['result'][_0x5ecd('0x14')]);}})[_0x5ecd('0x15')](function(_0x1e8e64){logger[_0x5ecd('0x13')](_0x5ecd('0xd'),_0x42c752,_0x1e8e64);_0x946412(_0x1e8e64);});});}exports[_0x5ecd('0x16')]=function(_0x231da2){var _0x189c3b=this;return new Promise(function(_0x3078ea,_0x1f7309){return db[_0x5ecd('0x17')][_0x5ecd('0x18')](_0x231da2['body'],{'raw':_0x231da2[_0x5ecd('0x19')]?_0x231da2[_0x5ecd('0x19')][_0x5ecd('0x1a')]===undefined?!![]:![]:!![]})[_0x5ecd('0xb')](function(_0xea18b7){logger['info'](_0x5ecd('0x16'),_0x231da2);logger['debug'](_0x5ecd('0x16'),_0x231da2,JSON[_0x5ecd('0x11')](_0xea18b7));_0x3078ea(_0xea18b7);})[_0x5ecd('0x15')](function(_0x3c8e2b){logger[_0x5ecd('0x13')]('CreateAttachment',_0x3c8e2b[_0x5ecd('0x14')],_0x231da2);_0x1f7309(_0x189c3b[_0x5ecd('0x13')](0x1f4,_0x3c8e2b[_0x5ecd('0x14')]));});});}; \ No newline at end of file +var _0x70e0=['options','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Attachment,\x20%s,\x20%s','message','result','catch','CreateAttachment','Attachment','create','body'];(function(_0x5e1aa7,_0x58c9d0){var _0x2caf29=function(_0x4f5c5e){while(--_0x4f5c5e){_0x5e1aa7['push'](_0x5e1aa7['shift']());}};_0x2caf29(++_0x58c9d0);}(_0x70e0,0x17b));var _0x070e=function(_0x528b90,_0x54de92){_0x528b90=_0x528b90-0x0;var _0x337124=_0x70e0[_0x528b90];return _0x337124;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('Attachment,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('Attachment,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('Attachment,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});}exports[_0x070e('0x16')]=function(_0x38f6e6){var _0x2060cc=this;return new Promise(function(_0x364b3f,_0x5037eb){return db[_0x070e('0x17')][_0x070e('0x18')](_0x38f6e6[_0x070e('0x19')],{'raw':_0x38f6e6[_0x070e('0x1a')]?_0x38f6e6[_0x070e('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4e958f){logger[_0x070e('0xb')](_0x070e('0x16'),_0x38f6e6);logger[_0x070e('0xc')]('CreateAttachment',_0x38f6e6,JSON[_0x070e('0xf')](_0x4e958f));_0x364b3f(_0x4e958f);})['catch'](function(_0xf8dd5d){logger[_0x070e('0x10')](_0x070e('0x16'),_0xf8dd5d[_0x070e('0x13')],_0x38f6e6);_0x5037eb(_0x2060cc[_0x070e('0x10')](0x1f4,_0xf8dd5d[_0x070e('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 2fd748e..f4d97f0 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 _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x4e0f18,_0x2e6bb8){var _0x40155d=function(_0x5036cd){while(--_0x5036cd){_0x4e0f18['push'](_0x4e0f18['shift']());}};_0x40155d(++_0x2e6bb8);}(_0xadb5,0xad));var _0x5adb=function(_0x3837ed,_0x1288ab){_0x3837ed=_0x3837ed-0x0;var _0x317850=_0xadb5[_0x3837ed];return _0x317850;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router; \ No newline at end of file +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(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xdb28,0x106));var _0x8db2=function(_0x22c481,_0x316d79){_0x22c481=_0x22c481-0x0;var _0x1023b3=_0xdb28[_0x22c481];return _0x1023b3;};'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 diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 33d45b9..54d8187 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 _0xa4b2=['minutes','clearBlockUser','getLicense','catch','status','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../config/utils','../../config/logger','api','activedirectory','undefined','baseDN','url','domain','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','salt','role','disabled','blockedAt','online','admin','agent','then','blocked'];(function(_0x40a9e2,_0x39a647){var _0x7f23d9=function(_0x2e4cc8){while(--_0x2e4cc8){_0x40a9e2['push'](_0x40a9e2['shift']());}};_0x7f23d9(++_0x39a647);}(_0xa4b2,0x195));var _0x2a4b=function(_0x1c48c2,_0x4e4cf6){_0x1c48c2=_0x1c48c2-0x0;var _0x2aa785=_0xa4b2[_0x1c48c2];return _0x2aa785;};'use strict';var passport=require(_0x2a4b('0x0'));var LocalStrategy=require(_0x2a4b('0x1'))[_0x2a4b('0x2')];var moment=require(_0x2a4b('0x3'));var ActiveDirectory=require(_0x2a4b('0x4'));var BPromise=require(_0x2a4b('0x5'));var util=require(_0x2a4b('0x6'));var db=require(_0x2a4b('0x7'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x2a4b('0x8'));var config=require('../../config/environment');var logger=require(_0x2a4b('0x9'))(_0x2a4b('0xa'));function isActiveDirectoryConfigured(_0x51f9f1){var _0x2dc69e=![];if(typeof _0x51f9f1[_0x2a4b('0xb')]!==_0x2a4b('0xc')){_0x2dc69e=_0x51f9f1[_0x2a4b('0xb')][_0x2a4b('0xd')]&&_0x51f9f1['activedirectory'][_0x2a4b('0xe')]&&_0x51f9f1['activedirectory'][_0x2a4b('0xf')];}return _0x2dc69e;}function adAuthenticate(_0x144063,_0x1ae675,_0x446121){return new BPromise(function(_0x87170e,_0x221fa9){try{var _0x12418a=new ActiveDirectory(_0x144063);_0x12418a[_0x2a4b('0x10')](_0x1ae675,_0x446121,function(_0x4a540f,_0x44e268){if(_0x4a540f){logger['error']('Error\x20authenticate\x20%s:\x20%s',_0x1ae675,util['inspect'](_0x4a540f,{'showHidden':![],'depth':null}));_0x221fa9(_0x2a4b('0x11'));}else if(!_0x44e268){logger[_0x2a4b('0x12')](_0x2a4b('0x13'),_0x1ae675);_0x221fa9('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x87170e(_0x44e268);}});}catch(_0x40f632){_0x221fa9(_0x40f632);}});}function ActiveDirectoryAuthenticate(_0x19e3c,_0x3388fa,_0x43b596,_0x3c40bc){var _0x1e0b0e,_0x37a13e;if(!isActiveDirectoryConfigured(config)){logger[_0x2a4b('0x12')](_0x2a4b('0x14'),_0x3388fa);return _0x3c40bc(null,![],{'message':_0x2a4b('0x11')});}return db[_0x2a4b('0x15')][_0x2a4b('0x16')]({'where':{'id':0x1},'attributes':[_0x2a4b('0x17'),_0x2a4b('0x18')],'raw':!![]})['then'](function(_0x177b5e){_0x1e0b0e=_0x177b5e;if(!_0x1e0b0e[_0x2a4b('0x17')]){logger[_0x2a4b('0x12')](_0x2a4b('0x19'),_0x3388fa);throw new Error(_0x2a4b('0x11'));}return _0x19e3c[_0x2a4b('0x16')]({'attributes':['id',_0x2a4b('0x1a'),'password',_0x2a4b('0x1b'),_0x2a4b('0x1c'),_0x2a4b('0x1d'),'blocked',_0x2a4b('0x1e'),_0x2a4b('0x1f')],'where':{'name':_0x3388fa,'role':{'$or':[_0x2a4b('0x20'),'user',_0x2a4b('0x21')]},'adSsoEnabled':!![]}});})['then'](function(_0x3886a0){if(!_0x3886a0||_0x3886a0&&_0x3886a0[_0x2a4b('0x1a')]!==_0x3388fa){throw new Error(_0x2a4b('0x11'));}_0x37a13e=_0x3886a0;var _0x319467=_0x37a13e[_0x2a4b('0x1a')]+'@'+config['activedirectory'][_0x2a4b('0xf')];return adAuthenticate(config[_0x2a4b('0xb')],_0x319467,_0x43b596);})[_0x2a4b('0x22')](function(_0x5aaedd){if(_0x37a13e[_0x2a4b('0x1d')]){throw new Error(_0x2a4b('0x11'));}if(_0x1e0b0e[_0x2a4b('0x18')]>0x0){if(_0x37a13e[_0x2a4b('0x23')]){if(moment(_0x37a13e['blockedAt'])['add'](_0x1e0b0e['blockDuration'],_0x2a4b('0x24'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x2a4b('0x25')](_0x37a13e,0x0,![],null)[_0x2a4b('0x22')](function(){return utils[_0x2a4b('0x26')](_0x37a13e);})[_0x2a4b('0x22')](function(){return _0x3c40bc(null,_0x37a13e);});}else{return utils[_0x2a4b('0x26')](_0x37a13e)['then'](function(){return _0x3c40bc(null,_0x37a13e);});}}else{return utils[_0x2a4b('0x26')](_0x37a13e)[_0x2a4b('0x22')](function(){return _0x3c40bc(null,_0x37a13e);});}})[_0x2a4b('0x27')](function(_0x2ad844){return _0x3c40bc(null,![],_0x2ad844);});}function handleError(_0xb8df7,_0x23bf86,_0x185404){return _0xb8df7[_0x2a4b('0x28')](_0x23bf86||0x1f4)[_0x2a4b('0x29')]({'message':_0x185404?_0x185404[_0x2a4b('0x2a')]||_0x185404:''});}exports[_0x2a4b('0x2b')]=function(_0x4c9139,_0x502589,_0x479eb9){passport[_0x2a4b('0x10')](_0x2a4b('0x2c'),function(_0x2aed30,_0x59f7ad,_0x497f0d){var _0x3c52b0=_0x2aed30||_0x497f0d;if(_0x3c52b0){return handleError(_0x502589,0x191,_0x3c52b0);}if(!_0x59f7ad){return handleError(_0x502589,0x194,{'message':_0x2a4b('0x2d')});}else{var _0x1d3c37={'payload':{'id':_0x59f7ad['id'],'role':_0x59f7ad[_0x2a4b('0x1c')]},'options':{'expiresIn':0x15180}};return authService[_0x2a4b('0x2e')](_0x1d3c37)['then'](function(_0x9b374d){_0x502589[_0x2a4b('0x2f')]({'id':_0x59f7ad['id'],'token':_0x9b374d,'statusCall':'','isAlreadyLogged':_0x59f7ad[_0x2a4b('0x1f')]});});}})(_0x4c9139,_0x502589,_0x479eb9);};passport[_0x2a4b('0x30')]('ad-login',new LocalStrategy({'usernameField':_0x2a4b('0x1a'),'passwordField':'password'},function(_0x42daa5,_0x4cdcd9,_0x2ed579){return ActiveDirectoryAuthenticate(db['User'],_0x42daa5,_0x4cdcd9,_0x2ed579);})); \ No newline at end of file +var _0xdc69=['Setting','findOne','adSsoEnabled','blockDuration','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','salt','role','blocked','blockedAt','admin','agent','name','then','disabled','getLicense','catch','status','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','use','User','passport','Strategy','moment','bluebird','util','../../mysqldb','../../config/utils','../../config/logger','activedirectory','undefined','baseDN','url','domain','authenticate','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured'];(function(_0x178d1a,_0xfe0877){var _0x1250fd=function(_0x4c24f5){while(--_0x4c24f5){_0x178d1a['push'](_0x178d1a['shift']());}};_0x1250fd(++_0xfe0877);}(_0xdc69,0x165));var _0x9dc6=function(_0xf51c06,_0x388e5b){_0xf51c06=_0xf51c06-0x0;var _0x1d5420=_0xdc69[_0xf51c06];return _0x1d5420;};'use strict';var passport=require(_0x9dc6('0x0'));var LocalStrategy=require('passport-local')[_0x9dc6('0x1')];var moment=require(_0x9dc6('0x2'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x9dc6('0x3'));var util=require(_0x9dc6('0x4'));var db=require(_0x9dc6('0x5'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x9dc6('0x6'));var config=require('../../config/environment');var logger=require(_0x9dc6('0x7'))('api');function isActiveDirectoryConfigured(_0x57566c){var _0x3fb2d4=![];if(typeof _0x57566c[_0x9dc6('0x8')]!==_0x9dc6('0x9')){_0x3fb2d4=_0x57566c['activedirectory'][_0x9dc6('0xa')]&&_0x57566c[_0x9dc6('0x8')][_0x9dc6('0xb')]&&_0x57566c[_0x9dc6('0x8')][_0x9dc6('0xc')];}return _0x3fb2d4;}function adAuthenticate(_0x2f7aa7,_0x9e9cc0,_0x470bca){return new BPromise(function(_0x580e2e,_0x402de7){try{var _0x151d2f=new ActiveDirectory(_0x2f7aa7);_0x151d2f[_0x9dc6('0xd')](_0x9e9cc0,_0x470bca,function(_0x4591f0,_0x2204eb){if(_0x4591f0){logger['error']('Error\x20authenticate\x20%s:\x20%s',_0x9e9cc0,util[_0x9dc6('0xe')](_0x4591f0,{'showHidden':![],'depth':null}));_0x402de7(_0x9dc6('0xf'));}else if(!_0x2204eb){logger[_0x9dc6('0x10')](_0x9dc6('0x11'),_0x9e9cc0);_0x402de7(_0x9dc6('0xf'));}else{_0x580e2e(_0x2204eb);}});}catch(_0x351d61){_0x402de7(_0x351d61);}});}function ActiveDirectoryAuthenticate(_0x13c92c,_0x67f6e1,_0xc66da6,_0x78776e){var _0xa55e99,_0xa177cf;if(!isActiveDirectoryConfigured(config)){logger[_0x9dc6('0x10')](_0x9dc6('0x12'),_0x67f6e1);return _0x78776e(null,![],{'message':_0x9dc6('0xf')});}return db[_0x9dc6('0x13')][_0x9dc6('0x14')]({'where':{'id':0x1},'attributes':[_0x9dc6('0x15'),_0x9dc6('0x16')],'raw':!![]})['then'](function(_0x2140ea){_0xa55e99=_0x2140ea;if(!_0xa55e99[_0x9dc6('0x15')]){logger[_0x9dc6('0x10')](_0x9dc6('0x17'),_0x67f6e1);throw new Error(_0x9dc6('0xf'));}return _0x13c92c['findOne']({'attributes':['id','name',_0x9dc6('0x18'),_0x9dc6('0x19'),_0x9dc6('0x1a'),'disabled',_0x9dc6('0x1b'),_0x9dc6('0x1c'),'online'],'where':{'name':_0x67f6e1,'role':{'$or':[_0x9dc6('0x1d'),'user',_0x9dc6('0x1e')]},'adSsoEnabled':!![]}});})['then'](function(_0x257499){if(!_0x257499||_0x257499&&_0x257499['name']!==_0x67f6e1){throw new Error(_0x9dc6('0xf'));}_0xa177cf=_0x257499;var _0x2a6bc6=_0xa177cf[_0x9dc6('0x1f')]+'@'+config[_0x9dc6('0x8')]['domain'];return adAuthenticate(config[_0x9dc6('0x8')],_0x2a6bc6,_0xc66da6);})[_0x9dc6('0x20')](function(_0x2afda8){if(_0xa177cf[_0x9dc6('0x21')]){throw new Error(_0x9dc6('0xf'));}if(_0xa55e99['blockDuration']>0x0){if(_0xa177cf[_0x9dc6('0x1b')]){if(moment(_0xa177cf[_0x9dc6('0x1c')])['add'](_0xa55e99[_0x9dc6('0x16')],'minutes')>moment()){throw new Error(_0x9dc6('0xf'));}return utils['clearBlockUser'](_0xa177cf,0x0,![],null)[_0x9dc6('0x20')](function(){return utils[_0x9dc6('0x22')](_0xa177cf);})[_0x9dc6('0x20')](function(){return _0x78776e(null,_0xa177cf);});}else{return utils[_0x9dc6('0x22')](_0xa177cf)[_0x9dc6('0x20')](function(){return _0x78776e(null,_0xa177cf);});}}else{return utils['getLicense'](_0xa177cf)[_0x9dc6('0x20')](function(){return _0x78776e(null,_0xa177cf);});}})[_0x9dc6('0x23')](function(_0x3926f5){return _0x78776e(null,![],_0x3926f5);});}function handleError(_0x132b68,_0x8a1da6,_0x52648d){return _0x132b68[_0x9dc6('0x24')](_0x8a1da6||0x1f4)[_0x9dc6('0x25')]({'message':_0x52648d?_0x52648d[_0x9dc6('0x26')]||_0x52648d:''});}exports[_0x9dc6('0x27')]=function(_0x16136e,_0x2c3f4c,_0x3adac1){passport[_0x9dc6('0xd')](_0x9dc6('0x28'),function(_0x1edc90,_0x1e2834,_0x2a3565){var _0x49d0c0=_0x1edc90||_0x2a3565;if(_0x49d0c0){return handleError(_0x2c3f4c,0x191,_0x49d0c0);}if(!_0x1e2834){return handleError(_0x2c3f4c,0x194,{'message':_0x9dc6('0x29')});}else{var _0x5ccc30={'payload':{'id':_0x1e2834['id'],'role':_0x1e2834[_0x9dc6('0x1a')]},'options':{'expiresIn':0x15180}};return authService[_0x9dc6('0x2a')](_0x5ccc30)[_0x9dc6('0x20')](function(_0x26407d){_0x2c3f4c[_0x9dc6('0x2b')]({'id':_0x1e2834['id'],'token':_0x26407d,'statusCall':'','isAlreadyLogged':_0x1e2834[_0x9dc6('0x2c')]});});}})(_0x16136e,_0x2c3f4c,_0x3adac1);};passport[_0x9dc6('0x2d')](_0x9dc6('0x28'),new LocalStrategy({'usernameField':_0x9dc6('0x1f'),'passwordField':'password'},function(_0x3925a3,_0x4b1503,_0x3bbad1){return ActiveDirectoryAuthenticate(db[_0x9dc6('0x2e')],_0x3925a3,_0x4b1503,_0x3bbad1);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index cf167ba..4367fef 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 _0x263d=['login','exports','express','Router','./authActiveDirectory.controller'];(function(_0x1fd675,_0x165dfe){var _0x16b554=function(_0x5761ff){while(--_0x5761ff){_0x1fd675['push'](_0x1fd675['shift']());}};_0x16b554(++_0x165dfe);}(_0x263d,0x7a));var _0xd263=function(_0x5a6961,_0xd41ca6){_0x5a6961=_0x5a6961-0x0;var _0x4af0a6=_0x263d[_0x5a6961];return _0x4af0a6;};'use strict';var express=require(_0xd263('0x0'));var router=express[_0xd263('0x1')]();var controller=require(_0xd263('0x2'));router['post']('/',controller[_0xd263('0x3')]);module[_0xd263('0x4')]=router; \ No newline at end of file +var _0xfb62=['login','exports','express','Router','./authActiveDirectory.controller','post'];(function(_0x9dbb75,_0x16bee2){var _0x2ec973=function(_0x2b58f2){while(--_0x2b58f2){_0x9dbb75['push'](_0x9dbb75['shift']());}};_0x2ec973(++_0x16bee2);}(_0xfb62,0xf8));var _0x2fb6=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xfb62[_0x53ccf2];return _0x5a2964;};'use strict';var express=require(_0x2fb6('0x0'));var router=express[_0x2fb6('0x1')]();var controller=require(_0x2fb6('0x2'));router[_0x2fb6('0x3')]('/',controller[_0x2fb6('0x4')]);module[_0x2fb6('0x5')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 69164c7..e976998 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(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x7a54,0x106));var _0x47a5=function(_0x20128f,_0x7f8167){_0x20128f=_0x20128f-0x0;var _0x5a00a4=_0x7a54[_0x20128f];return _0x5a00a4;};'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 _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(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0x7a54,0x106));var _0x47a5=function(_0x195af7,_0x31db9b){_0x195af7=_0x195af7-0x0;var _0x228f4a=_0x7a54[_0x195af7];return _0x228f4a;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index a55749b..422486f 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 _0x75ee=['../user/user.controller.js','../../components/auth/service','login','/callback','callback','setTokenCookie','exports','passport','Router','./authGoogle.controller'];(function(_0x54d24c,_0xaa64dd){var _0x160ddc=function(_0x30fbe6){while(--_0x30fbe6){_0x54d24c['push'](_0x54d24c['shift']());}};_0x160ddc(++_0xaa64dd);}(_0x75ee,0x183));var _0xe75e=function(_0x1c7889,_0x24cd26){_0x1c7889=_0x1c7889-0x0;var _0x2f14e5=_0x75ee[_0x1c7889];return _0x2f14e5;};'use strict';var express=require('express');var passport=require(_0xe75e('0x0'));var router=express[_0xe75e('0x1')]();var controller=require(_0xe75e('0x2'));var userController=require(_0xe75e('0x3'));var authService=require(_0xe75e('0x4'));router['get']('/',controller[_0xe75e('0x5')]);router['get'](_0xe75e('0x6'),controller[_0xe75e('0x7')],authService['isMiddleware'],userController[_0xe75e('0x5')],authService[_0xe75e('0x8')]);module[_0xe75e('0x9')]=router; \ No newline at end of file +var _0x6355=['exports','express','passport','Router','./authGoogle.controller','../../components/auth/service','login','get','/callback','callback','isMiddleware'];(function(_0x4f7c3e,_0x21b13a){var _0x4c9e84=function(_0x38b549){while(--_0x38b549){_0x4f7c3e['push'](_0x4f7c3e['shift']());}};_0x4c9e84(++_0x21b13a);}(_0x6355,0x16c));var _0x5635=function(_0x272f20,_0x16cf90){_0x272f20=_0x272f20-0x0;var _0x176fc9=_0x6355[_0x272f20];return _0x176fc9;};'use strict';var express=require(_0x5635('0x0'));var passport=require(_0x5635('0x1'));var router=express[_0x5635('0x2')]();var controller=require(_0x5635('0x3'));var userController=require('../user/user.controller.js');var authService=require(_0x5635('0x4'));router['get']('/',controller[_0x5635('0x5')]);router[_0x5635('0x6')](_0x5635('0x7'),controller[_0x5635('0x8')],authService[_0x5635('0x9')],userController[_0x5635('0x5')],authService['setTokenCookie']);module[_0x5635('0xa')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 9f75564..4b6ac36 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 _0x05df=['/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','reset','User','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','password','previousPasswords','resetPasswordToken','save','Password\x20reset!','use','util','passport-local','jayson/promise','lodash','randomstring','../../components/auth/service','../../config/utils','client','http','Setting','allowedLoginAttempts','then','findOne','name','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','minutes','clearBlockUser','blockDuration','getLicense','catch','find','email','MailServerOut','Smtp','CloudProvider','getSmtpOptions','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','send','message','login','local-login','json','online','body','Email\x20parameter\x20is\x20missing','trim','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host'];(function(_0x538175,_0xec25f3){var _0x5464bc=function(_0x1d568f){while(--_0x1d568f){_0x538175['push'](_0x538175['shift']());}};_0x5464bc(++_0xec25f3);}(_0x05df,0x154));var _0xf05d=function(_0x290626,_0x5d5d26){_0x290626=_0x290626-0x0;var _0x44dcb3=_0x05df[_0x290626];return _0x44dcb3;};'use strict';var util=require(_0xf05d('0x0'));var passport=require('passport');var LocalStrategy=require(_0xf05d('0x1'))['Strategy'];var jayson=require(_0xf05d('0x2'));var _=require(_0xf05d('0x3'));var rs=require(_0xf05d('0x4'));var moment=require('moment');var db=require('../../mysqldb')['db'];var authService=require(_0xf05d('0x5'));var utils=require(_0xf05d('0x6'));var client=jayson[_0xf05d('0x7')][_0xf05d('0x8')]({'port':0x232b});function localAuthenticate(_0x4c7a9c,_0x3deeef,_0x31bba5,_0x19e27b){var _0x36b612,_0x119480;return db[_0xf05d('0x9')]['findOne']({'where':{'id':0x1},'attributes':[_0xf05d('0xa'),'blockDuration'],'raw':!![]})[_0xf05d('0xb')](function(_0x372c6e){_0x36b612=_0x372c6e;return _0x4c7a9c[_0xf05d('0xc')]({'attributes':['id',_0xf05d('0xd'),'password',_0xf05d('0xe'),_0xf05d('0xf'),_0xf05d('0x10'),_0xf05d('0x11'),_0xf05d('0x12'),_0xf05d('0x13')],'where':{'name':_0x3deeef,'role':{'$or':[_0xf05d('0x14'),_0xf05d('0x15'),_0xf05d('0x16')]}}});})[_0xf05d('0xb')](function(_0x5b5d36){if(!_0x5b5d36||_0x5b5d36&&_0x5b5d36['name']!==_0x3deeef){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x119480=_0x5b5d36;return _0x119480;}})[_0xf05d('0xb')](function(){_0x119480[_0xf05d('0x17')](_0x31bba5,function(_0x4639c3,_0x179e80){var _0x51eacd=_0x119480[_0xf05d('0x13')]+0x1;if(_0x4639c3){return _0x19e27b(_0x4639c3);}else if(!_0x179e80){if(_0x119480[_0xf05d('0x10')]){return _0x19e27b(null,![],{'message':_0xf05d('0x18')});}else if(_0x36b612['allowedLoginAttempts']>0x0){if(_0x119480[_0xf05d('0x11')]){if(_0x36b612['blockDuration']>0x0){if(moment(_0x119480[_0xf05d('0x12')])[_0xf05d('0x19')](_0x36b612['blockDuration'],_0xf05d('0x1a'))>moment()){return _0x19e27b(null,![],{'message':_0xf05d('0x18')});}else{return utils[_0xf05d('0x1b')](_0x119480,_0x51eacd,![],null)[_0xf05d('0xb')](function(){return _0x19e27b(null,![],{'message':_0xf05d('0x18')});});}}else{return _0x19e27b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x51eacd>=_0x36b612[_0xf05d('0xa')]){return utils[_0xf05d('0x1b')](_0x119480,0x0,!![],moment())[_0xf05d('0xb')](function(){return _0x19e27b(null,![],{'message':_0xf05d('0x18')});});}else{return utils[_0xf05d('0x1b')](_0x119480,_0x51eacd,![],null)[_0xf05d('0xb')](function(){return _0x19e27b(null,![],{'message':_0xf05d('0x18')});});}}}else{return _0x19e27b(null,![],{'message':_0xf05d('0x18')});}}else{if(_0x119480[_0xf05d('0x10')]){return _0x19e27b(null,![],{'message':_0xf05d('0x18')});}else if(_0x36b612[_0xf05d('0xa')]>0x0){if(_0x119480[_0xf05d('0x11')]){if(_0x36b612[_0xf05d('0x1c')]>0x0){if(moment(_0x119480[_0xf05d('0x12')])[_0xf05d('0x19')](_0x36b612[_0xf05d('0x1c')],'minutes')>moment()){return _0x19e27b(null,![],{'message':_0xf05d('0x18')});}else{return utils[_0xf05d('0x1b')](_0x119480,0x0,![],null)[_0xf05d('0xb')](function(){return utils[_0xf05d('0x1d')](_0x119480);})['then'](function(){return _0x19e27b(null,_0x119480);});}}else{return _0x19e27b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0xf05d('0x1b')](_0x119480,0x0,![],null)['then'](function(){return utils[_0xf05d('0x1d')](_0x119480);})[_0xf05d('0xb')](function(){return _0x19e27b(null,_0x119480);})['catch'](function(_0x59c24e){return _0x19e27b(null,![],_0x59c24e);});}}else{if(_0x119480[_0xf05d('0x11')]){return _0x19e27b(null,![],{'message':_0xf05d('0x18')});}else{return utils[_0xf05d('0x1d')](_0x119480)[_0xf05d('0xb')](function(){return _0x19e27b(null,_0x119480);});}}}});})[_0xf05d('0x1e')](function(_0x6b07e7){return _0x19e27b(null,![],_0x6b07e7);});}function sendServiceMail(_0x3a4580){return db['MailAccount'][_0xf05d('0x1f')]({'where':{'service':!![]},'attributes':['id',_0xf05d('0xd'),_0xf05d('0x20')],'include':[{'model':db[_0xf05d('0x21')],'as':_0xf05d('0x22'),'include':[{'model':db['CloudProvider'],'as':_0xf05d('0x23')}]}]})[_0xf05d('0xb')](function(_0x1587b9){if(!_0x1587b9){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x2b4733=_0x1587b9[_0xf05d('0x24')]();var _0x154a61={'account':_0x2b4733,'message':_['merge']({'from':util[_0xf05d('0x25')](_0xf05d('0x26'),_0x1587b9[_0xf05d('0xd')],_0x1587b9[_0xf05d('0x20')]||_0x1587b9[_0xf05d('0x22')][_0xf05d('0x15')])},_0x3a4580)};return client[_0xf05d('0x27')](_0xf05d('0x28'),_0x154a61);})[_0xf05d('0xb')](function(_0x5f8954){if(_0x5f8954[_0xf05d('0x29')]){throw new Error(util[_0xf05d('0x25')](_0xf05d('0x2a'),_0x5f8954[_0xf05d('0x29')]['message']||JSON['stringify'](_0x5f8954[_0xf05d('0x29')])));}return!![];});}function handleError(_0x10e27a,_0x36b263,_0x54910a){return _0x10e27a['status'](_0x36b263||0x1f4)[_0xf05d('0x2b')]({'message':_0x54910a?_0x54910a[_0xf05d('0x2c')]||_0x54910a:''});}exports[_0xf05d('0x2d')]=function(_0x1c03a2,_0x31e3f0,_0x28468a){passport['authenticate'](_0xf05d('0x2e'),function(_0x3c8641,_0x7fdceb,_0x3cd052){var _0x5e3fc8=_0x3c8641||_0x3cd052;if(_0x5e3fc8){return handleError(_0x31e3f0,0x191,_0x5e3fc8);}if(!_0x7fdceb){return handleError(_0x31e3f0,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0xce8daa={'payload':{'id':_0x7fdceb['id'],'role':_0x7fdceb[_0xf05d('0xf')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0xce8daa)[_0xf05d('0xb')](function(_0x3783e7){_0x31e3f0[_0xf05d('0x2f')]({'id':_0x7fdceb['id'],'token':_0x3783e7,'statusCall':'','isAlreadyLogged':_0x7fdceb[_0xf05d('0x30')]});});}})(_0x1c03a2,_0x31e3f0,_0x28468a);};exports['forgot']=function(_0x4b64c3,_0xedeab6){if(!_0x4b64c3[_0xf05d('0x31')]['email']){return handleError(_0xedeab6,0x1f4,{'message':_0xf05d('0x32')});}var _0x49e742=rs['generate']();_0x4b64c3['body'][_0xf05d('0x20')]=_0x4b64c3[_0xf05d('0x31')]['email'][_0xf05d('0x33')]()['toLowerCase']();var _0x484a62;return db[_0xf05d('0x9')][_0xf05d('0xc')]({'where':{'id':0x1},'attributes':[_0xf05d('0xa'),_0xf05d('0x1c')],'raw':!![]})[_0xf05d('0xb')](function(_0x3ff169){_0x484a62=_0x3ff169;return db['User'][_0xf05d('0x1f')]({'where':{'email':_0x4b64c3[_0xf05d('0x31')][_0xf05d('0x20')]}});})[_0xf05d('0xb')](function(_0x3f190b){if(!_0x3f190b){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x3f190b['disabled']){throw new Error(_0xf05d('0x34'));}if(_0x3f190b[_0xf05d('0x11')]){if(moment(_0x3f190b['blockedAt'])['add'](_0x484a62[_0xf05d('0x1c')],'minutes')>moment()){throw new Error(_0xf05d('0x35'));}else{_0x3f190b[_0xf05d('0x11')]=![];_0x3f190b[_0xf05d('0x12')]=null;}}_0x3f190b['resetPasswordToken']=_0x49e742;_0x3f190b[_0xf05d('0x36')]=Date['now']()+0x36ee80;return _0x3f190b['save']();})[_0xf05d('0xb')](function(){return sendServiceMail({'to':_0x4b64c3['body'][_0xf05d('0x20')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xf05d('0x37')+_0xf05d('0x38')+_0xf05d('0x39')+_0x4b64c3[_0xf05d('0x3a')][_0xf05d('0x3b')]+_0xf05d('0x3c')+_0x49e742+'\x0a\x0a'+_0xf05d('0x3d')});})[_0xf05d('0xb')](function(){_0xedeab6[_0xf05d('0x3e')](0xc8)[_0xf05d('0x2b')]({'message':_0xf05d('0x3f')});})[_0xf05d('0x1e')](function(_0x1e17d2){return handleError(_0xedeab6,0x1f4,_0x1e17d2);});};exports[_0xf05d('0x40')]=function(_0x386c2a,_0x2d1116){return db[_0xf05d('0x41')][_0xf05d('0x1f')]({'where':{'resetPasswordToken':_0x386c2a[_0xf05d('0x42')][_0xf05d('0x43')],'resetPasswordExpires':{'$gt':Date[_0xf05d('0x44')]()}}})[_0xf05d('0xb')](function(_0x36d0c5){if(!_0x36d0c5){throw new Error(_0xf05d('0x45'));}return db[_0xf05d('0x9')][_0xf05d('0xc')]({'attributes':['id',_0xf05d('0x46'),_0xf05d('0x47'),_0xf05d('0x48')]})[_0xf05d('0xb')](function(_0x12a782){if(_0x12a782[_0xf05d('0x46')])authService[_0xf05d('0x49')](_0x386c2a[_0xf05d('0x31')][_0xf05d('0x4a')]);if(!_0x12a782[_0xf05d('0x47')]||!_0x36d0c5[_0xf05d('0x4b')])return _0x36d0c5;authService['validatePasswordHistory'](_0x386c2a['body'][_0xf05d('0x4a')],_0x36d0c5[_0xf05d('0x4b')],_0x12a782['passwordHistoryLimit']);return _0x36d0c5;})[_0xf05d('0xb')](function(){_0x36d0c5[_0xf05d('0x4a')]=_0x386c2a['body'][_0xf05d('0x4a')];_0x36d0c5[_0xf05d('0x4c')]=null;_0x36d0c5[_0xf05d('0x36')]=null;return _0x36d0c5[_0xf05d('0x4d')]();});})[_0xf05d('0xb')](function(){_0x2d1116[_0xf05d('0x3e')](0xc8)[_0xf05d('0x2b')]({'message':_0xf05d('0x4e')});})[_0xf05d('0x1e')](function(_0x27f0f6){return handleError(_0x2d1116,0x1f4,_0x27f0f6);});};passport[_0xf05d('0x4f')](_0xf05d('0x2e'),new LocalStrategy({'usernameField':_0xf05d('0xd'),'passwordField':_0xf05d('0x4a')},function(_0x46e87e,_0x55effd,_0x19ab59){return localAuthenticate(db[_0xf05d('0x41')],_0x46e87e,_0x55effd,_0x19ab59);})); \ No newline at end of file +var _0x41c5=['jayson/promise','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','Setting','allowedLoginAttempts','blockDuration','then','name','salt','blockedAt','user','agent','loginAttempts','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','add','minutes','clearBlockUser','getLicense','catch','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','format','email','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','send','login','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','forgot','body','generate','trim','findOne','User','find','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','status','params','token','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','password','previousPasswords','validatePasswordHistory','use','passport','passport-local','Strategy'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x41c5,0x179));var _0x541c=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x41c5[_0x40a045];return _0x1a687c;};'use strict';var util=require('util');var passport=require(_0x541c('0x0'));var LocalStrategy=require(_0x541c('0x1'))[_0x541c('0x2')];var jayson=require(_0x541c('0x3'));var _=require('lodash');var rs=require(_0x541c('0x4'));var moment=require(_0x541c('0x5'));var db=require(_0x541c('0x6'))['db'];var authService=require(_0x541c('0x7'));var utils=require(_0x541c('0x8'));var client=jayson[_0x541c('0x9')]['http']({'port':0x232b});function localAuthenticate(_0x226aef,_0x876cde,_0x2fc30b,_0x4167f5){var _0x38c13f,_0x254c41;return db[_0x541c('0xa')]['findOne']({'where':{'id':0x1},'attributes':[_0x541c('0xb'),_0x541c('0xc')],'raw':!![]})[_0x541c('0xd')](function(_0x268d31){_0x38c13f=_0x268d31;return _0x226aef['findOne']({'attributes':['id',_0x541c('0xe'),'password',_0x541c('0xf'),'role','disabled','blocked',_0x541c('0x10'),'loginAttempts'],'where':{'name':_0x876cde,'role':{'$or':['admin',_0x541c('0x11'),_0x541c('0x12')]}}});})[_0x541c('0xd')](function(_0x3d812e){if(!_0x3d812e||_0x3d812e&&_0x3d812e['name']!==_0x876cde){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x254c41=_0x3d812e;return _0x254c41;}})[_0x541c('0xd')](function(){_0x254c41['authenticate'](_0x2fc30b,function(_0x56cb21,_0x1cf3af){var _0x1e84dd=_0x254c41[_0x541c('0x13')]+0x1;if(_0x56cb21){return _0x4167f5(_0x56cb21);}else if(!_0x1cf3af){if(_0x254c41[_0x541c('0x14')]){return _0x4167f5(null,![],{'message':_0x541c('0x15')});}else if(_0x38c13f[_0x541c('0xb')]>0x0){if(_0x254c41[_0x541c('0x16')]){if(_0x38c13f[_0x541c('0xc')]>0x0){if(moment(_0x254c41[_0x541c('0x10')])[_0x541c('0x17')](_0x38c13f['blockDuration'],_0x541c('0x18'))>moment()){return _0x4167f5(null,![],{'message':_0x541c('0x15')});}else{return utils[_0x541c('0x19')](_0x254c41,_0x1e84dd,![],null)[_0x541c('0xd')](function(){return _0x4167f5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x4167f5(null,![],{'message':_0x541c('0x15')});}}else{if(_0x1e84dd>=_0x38c13f[_0x541c('0xb')]){return utils['clearBlockUser'](_0x254c41,0x0,!![],moment())['then'](function(){return _0x4167f5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils['clearBlockUser'](_0x254c41,_0x1e84dd,![],null)['then'](function(){return _0x4167f5(null,![],{'message':_0x541c('0x15')});});}}}else{return _0x4167f5(null,![],{'message':_0x541c('0x15')});}}else{if(_0x254c41[_0x541c('0x14')]){return _0x4167f5(null,![],{'message':_0x541c('0x15')});}else if(_0x38c13f['allowedLoginAttempts']>0x0){if(_0x254c41[_0x541c('0x16')]){if(_0x38c13f[_0x541c('0xc')]>0x0){if(moment(_0x254c41[_0x541c('0x10')])[_0x541c('0x17')](_0x38c13f['blockDuration'],'minutes')>moment()){return _0x4167f5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x541c('0x19')](_0x254c41,0x0,![],null)['then'](function(){return utils[_0x541c('0x1a')](_0x254c41);})[_0x541c('0xd')](function(){return _0x4167f5(null,_0x254c41);});}}else{return _0x4167f5(null,![],{'message':_0x541c('0x15')});}}else{return utils[_0x541c('0x19')](_0x254c41,0x0,![],null)[_0x541c('0xd')](function(){return utils['getLicense'](_0x254c41);})[_0x541c('0xd')](function(){return _0x4167f5(null,_0x254c41);})[_0x541c('0x1b')](function(_0x184e97){return _0x4167f5(null,![],_0x184e97);});}}else{if(_0x254c41[_0x541c('0x16')]){return _0x4167f5(null,![],{'message':_0x541c('0x15')});}else{return utils[_0x541c('0x1a')](_0x254c41)[_0x541c('0xd')](function(){return _0x4167f5(null,_0x254c41);});}}}});})[_0x541c('0x1b')](function(_0x3e2729){return _0x4167f5(null,![],_0x3e2729);});}function sendServiceMail(_0x353f3c){return db['MailAccount']['find']({'where':{'service':!![]},'attributes':['id',_0x541c('0xe'),'email'],'include':[{'model':db['MailServerOut'],'as':_0x541c('0x1c'),'include':[{'model':db[_0x541c('0x1d')],'as':'CloudProvider'}]}]})[_0x541c('0xd')](function(_0x42e3af){if(!_0x42e3af){throw new Error(_0x541c('0x1e'));}var _0x2dc0c3=_0x42e3af['getSmtpOptions']();var _0x12c62e={'account':_0x2dc0c3,'message':_[_0x541c('0x1f')]({'from':util[_0x541c('0x20')]('\x22%s\x22\x20<%s>',_0x42e3af[_0x541c('0xe')],_0x42e3af[_0x541c('0x21')]||_0x42e3af[_0x541c('0x1c')][_0x541c('0x11')])},_0x353f3c)};return client[_0x541c('0x22')](_0x541c('0x23'),_0x12c62e);})[_0x541c('0xd')](function(_0x2a5d48){if(_0x2a5d48[_0x541c('0x24')]){throw new Error(util[_0x541c('0x20')](_0x541c('0x25'),_0x2a5d48['error'][_0x541c('0x26')]||JSON[_0x541c('0x27')](_0x2a5d48[_0x541c('0x24')])));}return!![];});}function handleError(_0x37060d,_0x5945c8,_0x5aed25){return _0x37060d['status'](_0x5945c8||0x1f4)[_0x541c('0x28')]({'message':_0x5aed25?_0x5aed25['message']||_0x5aed25:''});}exports[_0x541c('0x29')]=function(_0x2ba9b2,_0x10bde5,_0x5794ee){passport[_0x541c('0x2a')](_0x541c('0x2b'),function(_0x1ca4a6,_0x3406b8,_0x43ec4d){var _0xa48e0=_0x1ca4a6||_0x43ec4d;if(_0xa48e0){return handleError(_0x10bde5,0x191,_0xa48e0);}if(!_0x3406b8){return handleError(_0x10bde5,0x194,{'message':_0x541c('0x2c')});}else{var _0x1a2ed3={'payload':{'id':_0x3406b8['id'],'role':_0x3406b8[_0x541c('0x2d')]},'options':{'expiresIn':0x15180}};return authService[_0x541c('0x2e')](_0x1a2ed3)[_0x541c('0xd')](function(_0x1109e1){_0x10bde5[_0x541c('0x2f')]({'id':_0x3406b8['id'],'token':_0x1109e1,'statusCall':'','isAlreadyLogged':_0x3406b8['online']});});}})(_0x2ba9b2,_0x10bde5,_0x5794ee);};exports[_0x541c('0x30')]=function(_0x24ff22,_0x148e33){if(!_0x24ff22[_0x541c('0x31')][_0x541c('0x21')]){return handleError(_0x148e33,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x554808=rs[_0x541c('0x32')]();_0x24ff22['body'][_0x541c('0x21')]=_0x24ff22[_0x541c('0x31')][_0x541c('0x21')][_0x541c('0x33')]()['toLowerCase']();var _0x18ee1d;return db['Setting'][_0x541c('0x34')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0x541c('0xd')](function(_0x4d6711){_0x18ee1d=_0x4d6711;return db[_0x541c('0x35')][_0x541c('0x36')]({'where':{'email':_0x24ff22[_0x541c('0x31')]['email']}});})[_0x541c('0xd')](function(_0x21d232){if(!_0x21d232){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x21d232[_0x541c('0x14')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x21d232[_0x541c('0x16')]){if(moment(_0x21d232[_0x541c('0x10')])['add'](_0x18ee1d[_0x541c('0xc')],_0x541c('0x18'))>moment()){throw new Error(_0x541c('0x37'));}else{_0x21d232[_0x541c('0x16')]=![];_0x21d232[_0x541c('0x10')]=null;}}_0x21d232[_0x541c('0x38')]=_0x554808;_0x21d232[_0x541c('0x39')]=Date[_0x541c('0x3a')]()+0x36ee80;return _0x21d232[_0x541c('0x3b')]();})[_0x541c('0xd')](function(){return sendServiceMail({'to':_0x24ff22[_0x541c('0x31')][_0x541c('0x21')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x541c('0x3c')+_0x541c('0x3d')+_0x541c('0x3e')+_0x24ff22[_0x541c('0x3f')][_0x541c('0x40')]+'/reset/'+_0x554808+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x541c('0xd')](function(){_0x148e33[_0x541c('0x41')](0xc8)[_0x541c('0x28')]({'message':'Reset\x20Email\x20sent!'});})[_0x541c('0x1b')](function(_0x1b1b48){return handleError(_0x148e33,0x1f4,_0x1b1b48);});};exports['reset']=function(_0x1be986,_0x462098){return db[_0x541c('0x35')]['find']({'where':{'resetPasswordToken':_0x1be986[_0x541c('0x42')][_0x541c('0x43')],'resetPasswordExpires':{'$gt':Date[_0x541c('0x3a')]()}}})[_0x541c('0xd')](function(_0x115c4f){if(!_0x115c4f){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting'][_0x541c('0x34')]({'attributes':['id',_0x541c('0x44'),_0x541c('0x45'),_0x541c('0x46')]})[_0x541c('0xd')](function(_0xfd358f){if(_0xfd358f[_0x541c('0x44')])authService[_0x541c('0x47')](_0x1be986['body'][_0x541c('0x48')]);if(!_0xfd358f['enforcePasswordHistory']||!_0x115c4f[_0x541c('0x49')])return _0x115c4f;authService[_0x541c('0x4a')](_0x1be986[_0x541c('0x31')][_0x541c('0x48')],_0x115c4f[_0x541c('0x49')],_0xfd358f[_0x541c('0x46')]);return _0x115c4f;})[_0x541c('0xd')](function(){_0x115c4f[_0x541c('0x48')]=_0x1be986[_0x541c('0x31')]['password'];_0x115c4f[_0x541c('0x38')]=null;_0x115c4f[_0x541c('0x39')]=null;return _0x115c4f[_0x541c('0x3b')]();});})[_0x541c('0xd')](function(){_0x462098['status'](0xc8)[_0x541c('0x28')]({'message':'Password\x20reset!'});})['catch'](function(_0x3155a5){return handleError(_0x462098,0x1f4,_0x3155a5);});};passport[_0x541c('0x4b')](_0x541c('0x2b'),new LocalStrategy({'usernameField':_0x541c('0xe'),'passwordField':_0x541c('0x48')},function(_0xb34857,_0x2dbd39,_0x4a8c86){return localAuthenticate(db['User'],_0xb34857,_0x2dbd39,_0x4a8c86);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index ff0e0da..8d9285f 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 _0x060f=['/forgot','forgot','/reset/:token','exports','express','Router','post','login'];(function(_0x1c3e42,_0x1a4fe9){var _0x348fdc=function(_0x597394){while(--_0x597394){_0x1c3e42['push'](_0x1c3e42['shift']());}};_0x348fdc(++_0x1a4fe9);}(_0x060f,0x19c));var _0xf060=function(_0x43f489,_0x2b4fea){_0x43f489=_0x43f489-0x0;var _0x4134b4=_0x060f[_0x43f489];return _0x4134b4;};'use strict';var express=require(_0xf060('0x0'));var router=express[_0xf060('0x1')]();var controller=require('./authLocal.controller');router[_0xf060('0x2')]('/',controller[_0xf060('0x3')]);router[_0xf060('0x2')](_0xf060('0x4'),controller[_0xf060('0x5')]);router[_0xf060('0x2')](_0xf060('0x6'),controller['reset']);module[_0xf060('0x7')]=router; \ No newline at end of file +var _0xf935=['reset','exports','express','Router','./authLocal.controller','post','login','forgot'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xf935,0x14a));var _0x5f93=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf935[_0x14add3];return _0x4a174f;};'use strict';var express=require(_0x5f93('0x0'));var router=express[_0x5f93('0x1')]();var controller=require(_0x5f93('0x2'));router[_0x5f93('0x3')]('/',controller[_0x5f93('0x4')]);router[_0x5f93('0x3')]('/forgot',controller[_0x5f93('0x5')]);router['post']('/reset/:token',controller[_0x5f93('0x6')]);module[_0x5f93('0x7')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index c55f7c2..94f0254 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 _0xefc3=['sequelize','STRING','BOOLEAN','INTEGER'];(function(_0x23eba0,_0x60bca1){var _0x42eb5e=function(_0x31bf86){while(--_0x31bf86){_0x23eba0['push'](_0x23eba0['shift']());}};_0x42eb5e(++_0x60bca1);}(_0xefc3,0xc0));var _0x3efc=function(_0x5709a2,_0x4137a3){_0x5709a2=_0x5709a2-0x0;var _0x10b990=_0xefc3[_0x5709a2];return _0x10b990;};'use strict';var Sequelize=require(_0x3efc('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3efc('0x1')]},'status':{'type':Sequelize[_0x3efc('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x3efc('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0xc620=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0xdefbc3,_0x1ea49a){var _0x367798=function(_0x594678){while(--_0x594678){_0xdefbc3['push'](_0xdefbc3['shift']());}};_0x367798(++_0x1ea49a);}(_0xc620,0x12a));var _0x0c62=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc620[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x0c62('0x0'));module[_0x0c62('0x1')]={'name':{'type':Sequelize[_0x0c62('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x0c62('0x2')]},'description':{'type':Sequelize[_0x0c62('0x2')]},'status':{'type':Sequelize[_0x0c62('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x0c62('0x4')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 44551e5..9a4316f 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 _0x7c66=['ejs','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','Automation','includeAll','include','findAll','show','params','catch','create','body','destroy','addConditions','ids','getConditions','Condition','order','options','addActions','find','omit','getActions','findOne','Action','rimraf','zip-dir','request-promise','bluebird','path','sox','to-csv'];(function(_0x84e719,_0x40ce69){var _0x3a190f=function(_0x12175f){while(--_0x12175f){_0x84e719['push'](_0x84e719['shift']());}};_0x3a190f(++_0x40ce69);}(_0x7c66,0x99));var _0x67c6=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x7c66[_0x1ac595];return _0x455fff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x67c6('0x0'));var zipdir=require(_0x67c6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x67c6('0x2'));var moment=require('moment');var BPromise=require(_0x67c6('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x67c6('0x4'));var sox=require(_0x67c6('0x5'));var csv=require(_0x67c6('0x6'));var ejs=require(_0x67c6('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x67c6('0x8'));var crypto=require('crypto');var jsforce=require(_0x67c6('0x9'));var deskjs=require(_0x67c6('0xa'));var toCsv=require(_0x67c6('0x6'));var querystring=require('querystring');var Papa=require(_0x67c6('0xb'));var Redis=require(_0x67c6('0xc'));var authService=require(_0x67c6('0xd'));var qs=require(_0x67c6('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x67c6('0xf'))(_0x67c6('0x10'));var utils=require(_0x67c6('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x67c6('0x12'))['db'];function respondWithStatusCode(_0x43aa28,_0x2d0a9e){_0x2d0a9e=_0x2d0a9e||0xcc;return function(_0x21c1df){if(_0x21c1df){return _0x43aa28[_0x67c6('0x13')](_0x2d0a9e);}return _0x43aa28[_0x67c6('0x14')](_0x2d0a9e)[_0x67c6('0x15')]();};}function respondWithResult(_0x13539f,_0x44183f){_0x44183f=_0x44183f||0xc8;return function(_0x5982d8){if(_0x5982d8){return _0x13539f[_0x67c6('0x14')](_0x44183f)[_0x67c6('0x16')](_0x5982d8);}};}function respondWithFilteredResult(_0x5872ff,_0x34f114){return function(_0x317234){if(_0x317234){var _0x474853=typeof _0x34f114['offset']===_0x67c6('0x17')&&typeof _0x34f114[_0x67c6('0x18')]===_0x67c6('0x17');var _0x1b680d=_0x317234[_0x67c6('0x19')];var _0x2109dc=_0x474853?0x0:_0x34f114[_0x67c6('0x1a')];var _0x58b2b7=_0x474853?_0x317234[_0x67c6('0x19')]:_0x34f114[_0x67c6('0x1a')]+_0x34f114[_0x67c6('0x18')];var _0x578bb6;if(_0x58b2b7>=_0x1b680d){_0x58b2b7=_0x1b680d;_0x578bb6=0xc8;}else{_0x578bb6=0xce;}_0x5872ff[_0x67c6('0x14')](_0x578bb6);return _0x5872ff['set'](_0x67c6('0x1b'),_0x2109dc+'-'+_0x58b2b7+'/'+_0x1b680d)['json'](_0x317234);}return null;};}function patchUpdates(_0xe6fdf7){return function(_0x18f0bb){try{jsonpatch['apply'](_0x18f0bb,_0xe6fdf7,!![]);}catch(_0x468953){return BPromise[_0x67c6('0x1c')](_0x468953);}return _0x18f0bb[_0x67c6('0x1d')]();};}function saveUpdates(_0x1a9984,_0x210d01){return function(_0x19e79b){if(_0x19e79b){return _0x19e79b[_0x67c6('0x1e')](_0x1a9984)[_0x67c6('0x1f')](function(_0x430de8){return _0x430de8;});}return null;};}function removeEntity(_0x419192,_0x275e99){return function(_0xaaacac){if(_0xaaacac){return _0xaaacac['destroy']()['then'](function(){_0x419192[_0x67c6('0x14')](0xcc)[_0x67c6('0x15')]();});}};}function handleEntityNotFound(_0x5bcd39,_0x52bed8){return function(_0x17a20f){if(!_0x17a20f){_0x5bcd39['sendStatus'](0x194);}return _0x17a20f;};}function handleError(_0x20e7d8,_0x52015f){_0x52015f=_0x52015f||0x1f4;return function(_0x4c6c9d){logger[_0x67c6('0x20')](_0x4c6c9d[_0x67c6('0x21')]);if(_0x4c6c9d[_0x67c6('0x22')]){delete _0x4c6c9d[_0x67c6('0x22')];}_0x20e7d8[_0x67c6('0x14')](_0x52015f)[_0x67c6('0x23')](_0x4c6c9d);};}exports[_0x67c6('0x24')]=function(_0x57be86,_0x41be15){var _0x1cb40b={},_0x374871={},_0x2bdb8a={'count':0x0,'rows':[]};var _0x5c42d1=_[_0x67c6('0x25')](db['Automation'][_0x67c6('0x26')],function(_0x112700){return{'name':_0x112700[_0x67c6('0x27')],'type':_0x112700['type'][_0x67c6('0x28')]};});_0x374871[_0x67c6('0x29')]=_[_0x67c6('0x25')](_0x5c42d1,'name');_0x374871[_0x67c6('0x2a')]=_[_0x67c6('0x2b')](_0x57be86[_0x67c6('0x2a')]);_0x374871[_0x67c6('0x2c')]=_[_0x67c6('0x2d')](_0x374871[_0x67c6('0x29')],_0x374871[_0x67c6('0x2a')]);_0x1cb40b[_0x67c6('0x2e')]=_[_0x67c6('0x2d')](_0x374871['model'],qs[_0x67c6('0x2f')](_0x57be86[_0x67c6('0x2a')]['fields']));_0x1cb40b[_0x67c6('0x2e')]=_0x1cb40b[_0x67c6('0x2e')][_0x67c6('0x30')]?_0x1cb40b[_0x67c6('0x2e')]:_0x374871[_0x67c6('0x29')];if(!_0x57be86[_0x67c6('0x2a')][_0x67c6('0x31')](_0x67c6('0x32'))){_0x1cb40b[_0x67c6('0x18')]=qs[_0x67c6('0x18')](_0x57be86[_0x67c6('0x2a')][_0x67c6('0x18')]);_0x1cb40b[_0x67c6('0x1a')]=qs[_0x67c6('0x1a')](_0x57be86['query'][_0x67c6('0x1a')]);}_0x1cb40b['order']=qs[_0x67c6('0x33')](_0x57be86[_0x67c6('0x2a')][_0x67c6('0x33')]);_0x1cb40b[_0x67c6('0x34')]=qs[_0x67c6('0x2c')](_[_0x67c6('0x35')](_0x57be86[_0x67c6('0x2a')],_0x374871[_0x67c6('0x2c')]),_0x5c42d1);if(_0x57be86[_0x67c6('0x2a')][_0x67c6('0x36')]){_0x1cb40b[_0x67c6('0x34')]=_['merge'](_0x1cb40b['where'],{'$or':_['map'](_0x5c42d1,function(_0x181f5b){if(_0x181f5b[_0x67c6('0x37')]!==_0x67c6('0x38')){var _0x3f117e={};_0x3f117e[_0x181f5b['name']]={'$like':'%'+_0x57be86[_0x67c6('0x2a')]['filter']+'%'};return _0x3f117e;}})});}_0x1cb40b=_[_0x67c6('0x39')]({},_0x1cb40b,_0x57be86['options']);var _0xd6a493={'where':_0x1cb40b[_0x67c6('0x34')]};return db[_0x67c6('0x3a')][_0x67c6('0x19')](_0xd6a493)[_0x67c6('0x1f')](function(_0x1d1235){_0x2bdb8a[_0x67c6('0x19')]=_0x1d1235;if(_0x57be86['query'][_0x67c6('0x3b')]){_0x1cb40b[_0x67c6('0x3c')]=[{'all':!![]}];}return db[_0x67c6('0x3a')][_0x67c6('0x3d')](_0x1cb40b);})[_0x67c6('0x1f')](function(_0x57d3b3){_0x2bdb8a['rows']=_0x57d3b3;return _0x2bdb8a;})[_0x67c6('0x1f')](respondWithFilteredResult(_0x41be15,_0x1cb40b))['catch'](handleError(_0x41be15,null));};exports[_0x67c6('0x3e')]=function(_0x37c16e,_0x2e52de){var _0x306c16={'raw':![],'where':{'id':_0x37c16e[_0x67c6('0x3f')]['id']}},_0x4a2ebb={};_0x4a2ebb[_0x67c6('0x29')]=_[_0x67c6('0x2b')](db[_0x67c6('0x3a')]['rawAttributes']);_0x4a2ebb[_0x67c6('0x2a')]=_['keys'](_0x37c16e[_0x67c6('0x2a')]);_0x4a2ebb[_0x67c6('0x2c')]=_[_0x67c6('0x2d')](_0x4a2ebb[_0x67c6('0x29')],_0x4a2ebb[_0x67c6('0x2a')]);_0x306c16['attributes']=_[_0x67c6('0x2d')](_0x4a2ebb[_0x67c6('0x29')],qs[_0x67c6('0x2f')](_0x37c16e['query'][_0x67c6('0x2f')]));_0x306c16[_0x67c6('0x2e')]=_0x306c16[_0x67c6('0x2e')]['length']?_0x306c16[_0x67c6('0x2e')]:_0x4a2ebb[_0x67c6('0x29')];if(_0x37c16e[_0x67c6('0x2a')][_0x67c6('0x3b')]){_0x306c16[_0x67c6('0x3c')]=[{'all':!![]}];}_0x306c16=_['merge']({},_0x306c16,_0x37c16e['options']);return db[_0x67c6('0x3a')]['find'](_0x306c16)['then'](handleEntityNotFound(_0x2e52de,null))[_0x67c6('0x1f')](respondWithResult(_0x2e52de,null))[_0x67c6('0x40')](handleError(_0x2e52de,null));};exports[_0x67c6('0x41')]=function(_0x4a728b,_0x3ba234){return db[_0x67c6('0x3a')][_0x67c6('0x41')](_0x4a728b[_0x67c6('0x42')],{})['then'](respondWithResult(_0x3ba234,0xc9))['catch'](handleError(_0x3ba234,null));};exports[_0x67c6('0x1e')]=function(_0xbf327f,_0x2c7f67){if(_0xbf327f[_0x67c6('0x42')]['id']){delete _0xbf327f['body']['id'];}return db[_0x67c6('0x3a')]['find']({'where':{'id':_0xbf327f[_0x67c6('0x3f')]['id']}})[_0x67c6('0x1f')](handleEntityNotFound(_0x2c7f67,null))[_0x67c6('0x1f')](saveUpdates(_0xbf327f[_0x67c6('0x42')],null))['then'](respondWithResult(_0x2c7f67,null))[_0x67c6('0x40')](handleError(_0x2c7f67,null));};exports[_0x67c6('0x43')]=function(_0xffa6f,_0x30dcae){return db[_0x67c6('0x3a')]['find']({'where':{'id':_0xffa6f[_0x67c6('0x3f')]['id']}})[_0x67c6('0x1f')](handleEntityNotFound(_0x30dcae,null))[_0x67c6('0x1f')](removeEntity(_0x30dcae,null))[_0x67c6('0x40')](handleError(_0x30dcae,null));};exports[_0x67c6('0x44')]=function(_0x4dda95,_0x414058,_0x3c2614){return db['Condition']['find']({'where':{'id':_0x4dda95[_0x67c6('0x3f')]['id']}})['then'](handleEntityNotFound(_0x414058,null))[_0x67c6('0x1f')](function(_0x88d761){if(_0x88d761){return _0x88d761[_0x67c6('0x44')](_0x4dda95[_0x67c6('0x42')][_0x67c6('0x45')],_['omit'](_0x4dda95[_0x67c6('0x42')],[_0x67c6('0x45'),'id'])||{});}})[_0x67c6('0x1f')](respondWithResult(_0x414058,null))[_0x67c6('0x40')](handleError(_0x414058,null));};exports[_0x67c6('0x46')]=function(_0xe50dd6,_0x431ef0,_0x7dae14){var _0xfa12f1={};var _0x29189e={};var _0x69d0eb;var _0x216f38;return db[_0x67c6('0x3a')]['findOne']({'where':{'id':_0xe50dd6[_0x67c6('0x3f')]['id']}})['then'](handleEntityNotFound(_0x431ef0,null))[_0x67c6('0x1f')](function(_0x47dc63){if(_0x47dc63){_0x69d0eb=_0x47dc63;_0x29189e[_0x67c6('0x29')]=_[_0x67c6('0x2b')](db[_0x67c6('0x47')]['rawAttributes']);_0x29189e['query']=_[_0x67c6('0x2b')](_0xe50dd6[_0x67c6('0x2a')]);_0x29189e['filters']=_[_0x67c6('0x2d')](_0x29189e[_0x67c6('0x29')],_0x29189e[_0x67c6('0x2a')]);_0xfa12f1[_0x67c6('0x2e')]=_['intersection'](_0x29189e[_0x67c6('0x29')],qs[_0x67c6('0x2f')](_0xe50dd6[_0x67c6('0x2a')][_0x67c6('0x2f')]));_0xfa12f1[_0x67c6('0x2e')]=_0xfa12f1[_0x67c6('0x2e')]['length']?_0xfa12f1[_0x67c6('0x2e')]:_0x29189e[_0x67c6('0x29')];_0xfa12f1[_0x67c6('0x48')]=qs['sort'](_0xe50dd6[_0x67c6('0x2a')][_0x67c6('0x33')]);_0xfa12f1['where']=qs[_0x67c6('0x2c')](_[_0x67c6('0x35')](_0xe50dd6[_0x67c6('0x2a')],_0x29189e['filters']));if(_0xe50dd6[_0x67c6('0x2a')][_0x67c6('0x36')]){_0xfa12f1['where']=_['merge'](_0xfa12f1[_0x67c6('0x34')],{'$or':_[_0x67c6('0x25')](_0xfa12f1[_0x67c6('0x2e')],function(_0x416760){var _0x2c7b3d={};_0x2c7b3d[_0x416760]={'$like':'%'+_0xe50dd6[_0x67c6('0x2a')][_0x67c6('0x36')]+'%'};return _0x2c7b3d;})});}_0xfa12f1=_[_0x67c6('0x39')]({},_0xfa12f1,_0xe50dd6[_0x67c6('0x49')]);return _0x69d0eb[_0x67c6('0x46')](_0xfa12f1);}})['then'](function(_0x23ec4f){if(_0x23ec4f){_0x216f38=_0x23ec4f['length'];if(!_0xe50dd6['query']['hasOwnProperty'](_0x67c6('0x32'))){_0xfa12f1[_0x67c6('0x18')]=qs[_0x67c6('0x18')](_0xe50dd6[_0x67c6('0x2a')][_0x67c6('0x18')]);_0xfa12f1[_0x67c6('0x1a')]=qs[_0x67c6('0x1a')](_0xe50dd6['query'][_0x67c6('0x1a')]);}return _0x69d0eb[_0x67c6('0x46')](_0xfa12f1);}})[_0x67c6('0x1f')](function(_0x3abc8c){if(_0x3abc8c){return _0x3abc8c?{'count':_0x216f38,'rows':_0x3abc8c}:null;}})['then'](respondWithResult(_0x431ef0,null))[_0x67c6('0x40')](handleError(_0x431ef0,null));};exports[_0x67c6('0x4a')]=function(_0x4233e4,_0x153266,_0x707dbe){return db['Action'][_0x67c6('0x4b')]({'where':{'id':_0x4233e4['params']['id']}})['then'](handleEntityNotFound(_0x153266,null))[_0x67c6('0x1f')](function(_0x31f3c5){if(_0x31f3c5){return _0x31f3c5['addActions'](_0x4233e4[_0x67c6('0x42')][_0x67c6('0x45')],_[_0x67c6('0x4c')](_0x4233e4[_0x67c6('0x42')],[_0x67c6('0x45'),'id'])||{});}})[_0x67c6('0x1f')](respondWithResult(_0x153266,null))[_0x67c6('0x40')](handleError(_0x153266,null));};exports[_0x67c6('0x4d')]=function(_0xced01a,_0x4284c1,_0x455f0d){var _0x37e6a5={};var _0x101958={};var _0x1160d9;var _0x17e8fc;return db[_0x67c6('0x3a')][_0x67c6('0x4e')]({'where':{'id':_0xced01a['params']['id']}})[_0x67c6('0x1f')](handleEntityNotFound(_0x4284c1,null))['then'](function(_0x4469c4){if(_0x4469c4){_0x1160d9=_0x4469c4;_0x101958[_0x67c6('0x29')]=_[_0x67c6('0x2b')](db[_0x67c6('0x4f')][_0x67c6('0x26')]);_0x101958[_0x67c6('0x2a')]=_[_0x67c6('0x2b')](_0xced01a[_0x67c6('0x2a')]);_0x101958['filters']=_[_0x67c6('0x2d')](_0x101958[_0x67c6('0x29')],_0x101958[_0x67c6('0x2a')]);_0x37e6a5[_0x67c6('0x2e')]=_[_0x67c6('0x2d')](_0x101958[_0x67c6('0x29')],qs[_0x67c6('0x2f')](_0xced01a[_0x67c6('0x2a')][_0x67c6('0x2f')]));_0x37e6a5[_0x67c6('0x2e')]=_0x37e6a5[_0x67c6('0x2e')][_0x67c6('0x30')]?_0x37e6a5['attributes']:_0x101958[_0x67c6('0x29')];_0x37e6a5['order']=qs[_0x67c6('0x33')](_0xced01a[_0x67c6('0x2a')][_0x67c6('0x33')]);_0x37e6a5['where']=qs[_0x67c6('0x2c')](_[_0x67c6('0x35')](_0xced01a[_0x67c6('0x2a')],_0x101958['filters']));if(_0xced01a[_0x67c6('0x2a')][_0x67c6('0x36')]){_0x37e6a5[_0x67c6('0x34')]=_[_0x67c6('0x39')](_0x37e6a5['where'],{'$or':_[_0x67c6('0x25')](_0x37e6a5[_0x67c6('0x2e')],function(_0x51a37c){var _0x3d888f={};_0x3d888f[_0x51a37c]={'$like':'%'+_0xced01a[_0x67c6('0x2a')]['filter']+'%'};return _0x3d888f;})});}_0x37e6a5=_['merge']({},_0x37e6a5,_0xced01a['options']);return _0x1160d9[_0x67c6('0x4d')](_0x37e6a5);}})[_0x67c6('0x1f')](function(_0x44ef5e){if(_0x44ef5e){_0x17e8fc=_0x44ef5e[_0x67c6('0x30')];if(!_0xced01a[_0x67c6('0x2a')][_0x67c6('0x31')](_0x67c6('0x32'))){_0x37e6a5['limit']=qs['limit'](_0xced01a[_0x67c6('0x2a')][_0x67c6('0x18')]);_0x37e6a5[_0x67c6('0x1a')]=qs[_0x67c6('0x1a')](_0xced01a[_0x67c6('0x2a')][_0x67c6('0x1a')]);}return _0x1160d9[_0x67c6('0x4d')](_0x37e6a5);}})['then'](function(_0xe88f28){if(_0xe88f28){return _0xe88f28?{'count':_0x17e8fc,'rows':_0xe88f28}:null;}})[_0x67c6('0x1f')](respondWithResult(_0x4284c1,null))[_0x67c6('0x40')](handleError(_0x4284c1,null));}; \ No newline at end of file +var _0xdba8=['keys','includeAll','find','create','body','addConditions','Condition','ids','omit','getConditions','findOne','filter','addActions','Action','getActions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','end','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','options','Automation','include','findAll','catch','params'];(function(_0x64c2e7,_0x4f757c){var _0x3ecb19=function(_0x53667d){while(--_0x53667d){_0x64c2e7['push'](_0x64c2e7['shift']());}};_0x3ecb19(++_0x4f757c);}(_0xdba8,0xb5));var _0x8dba=function(_0x105063,_0x36b9e4){_0x105063=_0x105063-0x0;var _0x92cd2b=_0xdba8[_0x105063];return _0x92cd2b;};'use strict';var emlformat=require(_0x8dba('0x0'));var rimraf=require(_0x8dba('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8dba('0x2'));var rp=require(_0x8dba('0x3'));var moment=require(_0x8dba('0x4'));var BPromise=require(_0x8dba('0x5'));var Mustache=require(_0x8dba('0x6'));var util=require(_0x8dba('0x7'));var path=require('path');var sox=require(_0x8dba('0x8'));var csv=require(_0x8dba('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8dba('0xa'));var _=require(_0x8dba('0xb'));var squel=require('squel');var crypto=require(_0x8dba('0xc'));var jsforce=require(_0x8dba('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8dba('0xe'));var Papa=require(_0x8dba('0xf'));var Redis=require('ioredis');var authService=require(_0x8dba('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8dba('0x11'));var hardwareService=require(_0x8dba('0x12'));var logger=require(_0x8dba('0x13'))('api');var utils=require(_0x8dba('0x14'));var config=require(_0x8dba('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x8dba('0x16'))['db'];function respondWithStatusCode(_0x279430,_0x4764b3){_0x4764b3=_0x4764b3||0xcc;return function(_0x55ba75){if(_0x55ba75){return _0x279430[_0x8dba('0x17')](_0x4764b3);}return _0x279430[_0x8dba('0x18')](_0x4764b3)['end']();};}function respondWithResult(_0x446f76,_0x5704aa){_0x5704aa=_0x5704aa||0xc8;return function(_0x28f1b0){if(_0x28f1b0){return _0x446f76['status'](_0x5704aa)['json'](_0x28f1b0);}};}function respondWithFilteredResult(_0x316b8a,_0x486b56){return function(_0x221600){if(_0x221600){var _0xd4ab42=typeof _0x486b56[_0x8dba('0x19')]===_0x8dba('0x1a')&&typeof _0x486b56[_0x8dba('0x1b')]==='undefined';var _0x57cdb2=_0x221600[_0x8dba('0x1c')];var _0x4da06d=_0xd4ab42?0x0:_0x486b56[_0x8dba('0x19')];var _0x526605=_0xd4ab42?_0x221600['count']:_0x486b56['offset']+_0x486b56[_0x8dba('0x1b')];var _0x49d058;if(_0x526605>=_0x57cdb2){_0x526605=_0x57cdb2;_0x49d058=0xc8;}else{_0x49d058=0xce;}_0x316b8a[_0x8dba('0x18')](_0x49d058);return _0x316b8a[_0x8dba('0x1d')](_0x8dba('0x1e'),_0x4da06d+'-'+_0x526605+'/'+_0x57cdb2)[_0x8dba('0x1f')](_0x221600);}return null;};}function patchUpdates(_0x42d948){return function(_0x4f51ce){try{jsonpatch[_0x8dba('0x20')](_0x4f51ce,_0x42d948,!![]);}catch(_0x27f3f1){return BPromise[_0x8dba('0x21')](_0x27f3f1);}return _0x4f51ce[_0x8dba('0x22')]();};}function saveUpdates(_0x30ac0d,_0x3cc0a8){return function(_0x1557bc){if(_0x1557bc){return _0x1557bc[_0x8dba('0x23')](_0x30ac0d)['then'](function(_0x5b6110){return _0x5b6110;});}return null;};}function removeEntity(_0x29f0c0,_0x3250c2){return function(_0x399404){if(_0x399404){return _0x399404[_0x8dba('0x24')]()[_0x8dba('0x25')](function(){_0x29f0c0[_0x8dba('0x18')](0xcc)[_0x8dba('0x26')]();});}};}function handleEntityNotFound(_0x5ea6e1,_0x440443){return function(_0x2b8b14){if(!_0x2b8b14){_0x5ea6e1[_0x8dba('0x17')](0x194);}return _0x2b8b14;};}function handleError(_0x13c87d,_0x516d90){_0x516d90=_0x516d90||0x1f4;return function(_0x30de2a){logger[_0x8dba('0x27')](_0x30de2a[_0x8dba('0x28')]);if(_0x30de2a['name']){delete _0x30de2a[_0x8dba('0x29')];}_0x13c87d[_0x8dba('0x18')](_0x516d90)['send'](_0x30de2a);};}exports[_0x8dba('0x2a')]=function(_0x22cb90,_0x529bed){var _0x328837={},_0x30adcb={},_0x44c23a={'count':0x0,'rows':[]};var _0x37c2a2=_[_0x8dba('0x2b')](db['Automation'][_0x8dba('0x2c')],function(_0x3add46){return{'name':_0x3add46[_0x8dba('0x2d')],'type':_0x3add46['type'][_0x8dba('0x2e')]};});_0x30adcb[_0x8dba('0x2f')]=_['map'](_0x37c2a2,_0x8dba('0x29'));_0x30adcb[_0x8dba('0x30')]=_['keys'](_0x22cb90['query']);_0x30adcb[_0x8dba('0x31')]=_[_0x8dba('0x32')](_0x30adcb['model'],_0x30adcb[_0x8dba('0x30')]);_0x328837[_0x8dba('0x33')]=_[_0x8dba('0x32')](_0x30adcb[_0x8dba('0x2f')],qs[_0x8dba('0x34')](_0x22cb90['query'][_0x8dba('0x34')]));_0x328837[_0x8dba('0x33')]=_0x328837[_0x8dba('0x33')][_0x8dba('0x35')]?_0x328837[_0x8dba('0x33')]:_0x30adcb[_0x8dba('0x2f')];if(!_0x22cb90[_0x8dba('0x30')][_0x8dba('0x36')](_0x8dba('0x37'))){_0x328837['limit']=qs[_0x8dba('0x1b')](_0x22cb90[_0x8dba('0x30')][_0x8dba('0x1b')]);_0x328837[_0x8dba('0x19')]=qs[_0x8dba('0x19')](_0x22cb90['query'][_0x8dba('0x19')]);}_0x328837[_0x8dba('0x38')]=qs['sort'](_0x22cb90[_0x8dba('0x30')][_0x8dba('0x39')]);_0x328837[_0x8dba('0x3a')]=qs[_0x8dba('0x31')](_[_0x8dba('0x3b')](_0x22cb90[_0x8dba('0x30')],_0x30adcb[_0x8dba('0x31')]),_0x37c2a2);if(_0x22cb90['query']['filter']){_0x328837[_0x8dba('0x3a')]=_[_0x8dba('0x3c')](_0x328837[_0x8dba('0x3a')],{'$or':_[_0x8dba('0x2b')](_0x37c2a2,function(_0x5823fb){if(_0x5823fb[_0x8dba('0x3d')]!=='VIRTUAL'){var _0x22f98a={};_0x22f98a[_0x5823fb[_0x8dba('0x29')]]={'$like':'%'+_0x22cb90[_0x8dba('0x30')]['filter']+'%'};return _0x22f98a;}})});}_0x328837=_[_0x8dba('0x3c')]({},_0x328837,_0x22cb90[_0x8dba('0x3e')]);var _0x153829={'where':_0x328837[_0x8dba('0x3a')]};return db[_0x8dba('0x3f')]['count'](_0x153829)['then'](function(_0x8b25cb){_0x44c23a['count']=_0x8b25cb;if(_0x22cb90[_0x8dba('0x30')]['includeAll']){_0x328837[_0x8dba('0x40')]=[{'all':!![]}];}return db[_0x8dba('0x3f')][_0x8dba('0x41')](_0x328837);})['then'](function(_0x58eb58){_0x44c23a['rows']=_0x58eb58;return _0x44c23a;})[_0x8dba('0x25')](respondWithFilteredResult(_0x529bed,_0x328837))[_0x8dba('0x42')](handleError(_0x529bed,null));};exports['show']=function(_0x1a6b36,_0x17e170){var _0xdd081b={'raw':![],'where':{'id':_0x1a6b36[_0x8dba('0x43')]['id']}},_0x579d24={};_0x579d24[_0x8dba('0x2f')]=_[_0x8dba('0x44')](db[_0x8dba('0x3f')][_0x8dba('0x2c')]);_0x579d24[_0x8dba('0x30')]=_[_0x8dba('0x44')](_0x1a6b36[_0x8dba('0x30')]);_0x579d24['filters']=_[_0x8dba('0x32')](_0x579d24[_0x8dba('0x2f')],_0x579d24[_0x8dba('0x30')]);_0xdd081b['attributes']=_[_0x8dba('0x32')](_0x579d24['model'],qs[_0x8dba('0x34')](_0x1a6b36[_0x8dba('0x30')]['fields']));_0xdd081b['attributes']=_0xdd081b[_0x8dba('0x33')][_0x8dba('0x35')]?_0xdd081b[_0x8dba('0x33')]:_0x579d24[_0x8dba('0x2f')];if(_0x1a6b36[_0x8dba('0x30')][_0x8dba('0x45')]){_0xdd081b[_0x8dba('0x40')]=[{'all':!![]}];}_0xdd081b=_[_0x8dba('0x3c')]({},_0xdd081b,_0x1a6b36[_0x8dba('0x3e')]);return db[_0x8dba('0x3f')][_0x8dba('0x46')](_0xdd081b)[_0x8dba('0x25')](handleEntityNotFound(_0x17e170,null))[_0x8dba('0x25')](respondWithResult(_0x17e170,null))[_0x8dba('0x42')](handleError(_0x17e170,null));};exports[_0x8dba('0x47')]=function(_0x539ea7,_0x5bee96){return db[_0x8dba('0x3f')][_0x8dba('0x47')](_0x539ea7[_0x8dba('0x48')],{})[_0x8dba('0x25')](respondWithResult(_0x5bee96,0xc9))[_0x8dba('0x42')](handleError(_0x5bee96,null));};exports['update']=function(_0x1208e9,_0x54b9ce){if(_0x1208e9['body']['id']){delete _0x1208e9['body']['id'];}return db[_0x8dba('0x3f')][_0x8dba('0x46')]({'where':{'id':_0x1208e9['params']['id']}})[_0x8dba('0x25')](handleEntityNotFound(_0x54b9ce,null))[_0x8dba('0x25')](saveUpdates(_0x1208e9[_0x8dba('0x48')],null))[_0x8dba('0x25')](respondWithResult(_0x54b9ce,null))['catch'](handleError(_0x54b9ce,null));};exports[_0x8dba('0x24')]=function(_0x1b8182,_0x168702){return db['Automation'][_0x8dba('0x46')]({'where':{'id':_0x1b8182[_0x8dba('0x43')]['id']}})[_0x8dba('0x25')](handleEntityNotFound(_0x168702,null))[_0x8dba('0x25')](removeEntity(_0x168702,null))['catch'](handleError(_0x168702,null));};exports[_0x8dba('0x49')]=function(_0x3d9dc1,_0x22c909,_0x5a2b96){return db[_0x8dba('0x4a')][_0x8dba('0x46')]({'where':{'id':_0x3d9dc1[_0x8dba('0x43')]['id']}})[_0x8dba('0x25')](handleEntityNotFound(_0x22c909,null))['then'](function(_0x480994){if(_0x480994){return _0x480994[_0x8dba('0x49')](_0x3d9dc1[_0x8dba('0x48')][_0x8dba('0x4b')],_[_0x8dba('0x4c')](_0x3d9dc1[_0x8dba('0x48')],[_0x8dba('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x22c909,null))[_0x8dba('0x42')](handleError(_0x22c909,null));};exports[_0x8dba('0x4d')]=function(_0x4fa8ab,_0x18ea6b,_0x315e93){var _0x44d63f={};var _0x588f29={};var _0x584592;var _0x5db280;return db[_0x8dba('0x3f')][_0x8dba('0x4e')]({'where':{'id':_0x4fa8ab[_0x8dba('0x43')]['id']}})[_0x8dba('0x25')](handleEntityNotFound(_0x18ea6b,null))[_0x8dba('0x25')](function(_0x4627d3){if(_0x4627d3){_0x584592=_0x4627d3;_0x588f29[_0x8dba('0x2f')]=_[_0x8dba('0x44')](db[_0x8dba('0x4a')][_0x8dba('0x2c')]);_0x588f29[_0x8dba('0x30')]=_[_0x8dba('0x44')](_0x4fa8ab[_0x8dba('0x30')]);_0x588f29[_0x8dba('0x31')]=_['intersection'](_0x588f29[_0x8dba('0x2f')],_0x588f29[_0x8dba('0x30')]);_0x44d63f[_0x8dba('0x33')]=_[_0x8dba('0x32')](_0x588f29[_0x8dba('0x2f')],qs[_0x8dba('0x34')](_0x4fa8ab[_0x8dba('0x30')][_0x8dba('0x34')]));_0x44d63f[_0x8dba('0x33')]=_0x44d63f['attributes'][_0x8dba('0x35')]?_0x44d63f[_0x8dba('0x33')]:_0x588f29[_0x8dba('0x2f')];_0x44d63f[_0x8dba('0x38')]=qs[_0x8dba('0x39')](_0x4fa8ab[_0x8dba('0x30')]['sort']);_0x44d63f['where']=qs[_0x8dba('0x31')](_['pick'](_0x4fa8ab[_0x8dba('0x30')],_0x588f29[_0x8dba('0x31')]));if(_0x4fa8ab['query'][_0x8dba('0x4f')]){_0x44d63f[_0x8dba('0x3a')]=_[_0x8dba('0x3c')](_0x44d63f[_0x8dba('0x3a')],{'$or':_[_0x8dba('0x2b')](_0x44d63f[_0x8dba('0x33')],function(_0x1a9fc9){var _0x2a4b8a={};_0x2a4b8a[_0x1a9fc9]={'$like':'%'+_0x4fa8ab['query'][_0x8dba('0x4f')]+'%'};return _0x2a4b8a;})});}_0x44d63f=_[_0x8dba('0x3c')]({},_0x44d63f,_0x4fa8ab['options']);return _0x584592[_0x8dba('0x4d')](_0x44d63f);}})[_0x8dba('0x25')](function(_0x4ac7df){if(_0x4ac7df){_0x5db280=_0x4ac7df[_0x8dba('0x35')];if(!_0x4fa8ab[_0x8dba('0x30')][_0x8dba('0x36')](_0x8dba('0x37'))){_0x44d63f[_0x8dba('0x1b')]=qs['limit'](_0x4fa8ab[_0x8dba('0x30')]['limit']);_0x44d63f['offset']=qs[_0x8dba('0x19')](_0x4fa8ab['query'][_0x8dba('0x19')]);}return _0x584592[_0x8dba('0x4d')](_0x44d63f);}})[_0x8dba('0x25')](function(_0x1fe002){if(_0x1fe002){return _0x1fe002?{'count':_0x5db280,'rows':_0x1fe002}:null;}})[_0x8dba('0x25')](respondWithResult(_0x18ea6b,null))[_0x8dba('0x42')](handleError(_0x18ea6b,null));};exports[_0x8dba('0x50')]=function(_0x25c07f,_0x45f18e,_0x155216){return db[_0x8dba('0x51')]['find']({'where':{'id':_0x25c07f[_0x8dba('0x43')]['id']}})[_0x8dba('0x25')](handleEntityNotFound(_0x45f18e,null))['then'](function(_0x16bcf0){if(_0x16bcf0){return _0x16bcf0['addActions'](_0x25c07f[_0x8dba('0x48')][_0x8dba('0x4b')],_[_0x8dba('0x4c')](_0x25c07f[_0x8dba('0x48')],[_0x8dba('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x45f18e,null))[_0x8dba('0x42')](handleError(_0x45f18e,null));};exports[_0x8dba('0x52')]=function(_0x1c7cbe,_0x3aab2e,_0x126a83){var _0xb3d799={};var _0x56f728={};var _0xc50342;var _0x27e3cb;return db[_0x8dba('0x3f')][_0x8dba('0x4e')]({'where':{'id':_0x1c7cbe[_0x8dba('0x43')]['id']}})[_0x8dba('0x25')](handleEntityNotFound(_0x3aab2e,null))['then'](function(_0x34d594){if(_0x34d594){_0xc50342=_0x34d594;_0x56f728[_0x8dba('0x2f')]=_['keys'](db['Action']['rawAttributes']);_0x56f728[_0x8dba('0x30')]=_[_0x8dba('0x44')](_0x1c7cbe['query']);_0x56f728[_0x8dba('0x31')]=_[_0x8dba('0x32')](_0x56f728['model'],_0x56f728[_0x8dba('0x30')]);_0xb3d799[_0x8dba('0x33')]=_[_0x8dba('0x32')](_0x56f728[_0x8dba('0x2f')],qs[_0x8dba('0x34')](_0x1c7cbe['query'][_0x8dba('0x34')]));_0xb3d799[_0x8dba('0x33')]=_0xb3d799[_0x8dba('0x33')][_0x8dba('0x35')]?_0xb3d799['attributes']:_0x56f728[_0x8dba('0x2f')];_0xb3d799['order']=qs[_0x8dba('0x39')](_0x1c7cbe[_0x8dba('0x30')][_0x8dba('0x39')]);_0xb3d799['where']=qs[_0x8dba('0x31')](_[_0x8dba('0x3b')](_0x1c7cbe[_0x8dba('0x30')],_0x56f728[_0x8dba('0x31')]));if(_0x1c7cbe[_0x8dba('0x30')][_0x8dba('0x4f')]){_0xb3d799['where']=_[_0x8dba('0x3c')](_0xb3d799[_0x8dba('0x3a')],{'$or':_['map'](_0xb3d799[_0x8dba('0x33')],function(_0x2747c9){var _0x376578={};_0x376578[_0x2747c9]={'$like':'%'+_0x1c7cbe[_0x8dba('0x30')][_0x8dba('0x4f')]+'%'};return _0x376578;})});}_0xb3d799=_[_0x8dba('0x3c')]({},_0xb3d799,_0x1c7cbe['options']);return _0xc50342[_0x8dba('0x52')](_0xb3d799);}})['then'](function(_0xa05c87){if(_0xa05c87){_0x27e3cb=_0xa05c87['length'];if(!_0x1c7cbe[_0x8dba('0x30')][_0x8dba('0x36')](_0x8dba('0x37'))){_0xb3d799[_0x8dba('0x1b')]=qs[_0x8dba('0x1b')](_0x1c7cbe[_0x8dba('0x30')][_0x8dba('0x1b')]);_0xb3d799['offset']=qs['offset'](_0x1c7cbe[_0x8dba('0x30')]['offset']);}return _0xc50342[_0x8dba('0x52')](_0xb3d799);}})['then'](function(_0x14d5d3){if(_0x14d5d3){return _0x14d5d3?{'count':_0x27e3cb,'rows':_0x14d5d3}:null;}})[_0x8dba('0x25')](respondWithResult(_0x3aab2e,null))[_0x8dba('0x42')](handleError(_0x3aab2e,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index f8c4cc3..b8c02f6 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 _0xab73=['Automation','tools_automations','lodash','util','api','bluebird','request-promise','path','../../config/environment','exports','define'];(function(_0x4f0212,_0x369712){var _0x23a3e5=function(_0x2acbfa){while(--_0x2acbfa){_0x4f0212['push'](_0x4f0212['shift']());}};_0x23a3e5(++_0x369712);}(_0xab73,0x1e6));var _0x3ab7=function(_0x1be748,_0xfaedd3){_0x1be748=_0x1be748-0x0;var _0x1005b6=_0xab73[_0x1be748];return _0x1005b6;};'use strict';var _=require(_0x3ab7('0x0'));var util=require(_0x3ab7('0x1'));var logger=require('../../config/logger')(_0x3ab7('0x2'));var moment=require('moment');var BPromise=require(_0x3ab7('0x3'));var rp=require(_0x3ab7('0x4'));var fs=require('fs');var path=require(_0x3ab7('0x5'));var rimraf=require('rimraf');var config=require(_0x3ab7('0x6'));var attributes=require('./automation.attributes');module[_0x3ab7('0x7')]=function(_0xe18ba4,_0x3e44b0){return _0xe18ba4[_0x3ab7('0x8')](_0x3ab7('0x9'),attributes,{'tableName':_0x3ab7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8b80=['api','moment','request-promise','path','../../config/environment','./automation.attributes','exports','define','tools_automations','lodash','util'];(function(_0x281c59,_0x58ea23){var _0x340fd6=function(_0x6956b0){while(--_0x6956b0){_0x281c59['push'](_0x281c59['shift']());}};_0x340fd6(++_0x58ea23);}(_0x8b80,0x13d));var _0x08b8=function(_0x54c9dd,_0x233a86){_0x54c9dd=_0x54c9dd-0x0;var _0x855156=_0x8b80[_0x54c9dd];return _0x855156;};'use strict';var _=require(_0x08b8('0x0'));var util=require(_0x08b8('0x1'));var logger=require('../../config/logger')(_0x08b8('0x2'));var moment=require(_0x08b8('0x3'));var BPromise=require('bluebird');var rp=require(_0x08b8('0x4'));var fs=require('fs');var path=require(_0x08b8('0x5'));var rimraf=require('rimraf');var config=require(_0x08b8('0x6'));var attributes=require(_0x08b8('0x7'));module[_0x08b8('0x8')]=function(_0x2518fc,_0x3e61a9){return _0x2518fc[_0x08b8('0x9')]('Automation',attributes,{'tableName':_0x08b8('0xa'),'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 5b286f1..2ba1ec0 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 _0xa49b=['../../config/logger','../../config/environment','jayson/promise','client','then','info','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0xa49b,0x126));var _0xba49=function(_0x50acbb,_0x1ac50b){_0x50acbb=_0x50acbb-0x0;var _0x2c9555=_0xa49b[_0x50acbb];return _0x2c9555;};'use strict';var _=require('lodash');var util=require(_0xba49('0x0'));var moment=require(_0xba49('0x1'));var BPromise=require(_0xba49('0x2'));var rs=require(_0xba49('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xba49('0x4'))['db'];var utils=require(_0xba49('0x5'));var logger=require(_0xba49('0x6'))('rpc');var config=require(_0xba49('0x7'));var jayson=require(_0xba49('0x8'));var client=jayson[_0xba49('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd5d20d,_0x4b29c0,_0x1f5909){return new BPromise(function(_0x47340c,_0x2bfae5){return client['request'](_0xd5d20d,_0x1f5909)[_0xba49('0xa')](function(_0x249dd6){logger[_0xba49('0xb')](_0xba49('0xc'),_0x4b29c0,'request\x20sent');logger[_0xba49('0xd')](_0xba49('0xe'),_0x4b29c0,_0xba49('0xf'),JSON['stringify'](_0x249dd6));if(_0x249dd6['error']){if(_0x249dd6[_0xba49('0x10')]['code']===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0x4b29c0,_0x249dd6[_0xba49('0x10')]['message']);return _0x2bfae5(_0x249dd6['error'][_0xba49('0x11')]);}logger[_0xba49('0x10')](_0xba49('0xc'),_0x4b29c0,_0x249dd6[_0xba49('0x10')]['message']);return _0x47340c(_0x249dd6[_0xba49('0x10')][_0xba49('0x11')]);}else{logger['info']('Automation,\x20%s,\x20%s',_0x4b29c0,_0xba49('0xf'));_0x47340c(_0x249dd6[_0xba49('0x12')][_0xba49('0x11')]);}})[_0xba49('0x13')](function(_0x56980f){logger[_0xba49('0x10')](_0xba49('0xc'),_0x4b29c0,_0x56980f);_0x2bfae5(_0x56980f);});});} \ No newline at end of file +var _0xb78e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird'];(function(_0xcc3caf,_0x11800f){var _0x5d1173=function(_0x398db1){while(--_0x398db1){_0xcc3caf['push'](_0xcc3caf['shift']());}};_0x5d1173(++_0x11800f);}(_0xb78e,0x1c9));var _0xeb78=function(_0x5b2bd1,_0x190f6d){_0x5b2bd1=_0x5b2bd1-0x0;var _0x47ab4f=_0xb78e[_0x5b2bd1];return _0x47ab4f;};'use strict';var _=require(_0xeb78('0x0'));var util=require(_0xeb78('0x1'));var moment=require('moment');var BPromise=require(_0xeb78('0x2'));var rs=require(_0xeb78('0x3'));var fs=require('fs');var Redis=require(_0xeb78('0x4'));var db=require(_0xeb78('0x5'))['db'];var utils=require(_0xeb78('0x6'));var logger=require(_0xeb78('0x7'))(_0xeb78('0x8'));var config=require(_0xeb78('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xeb78('0xa')][_0xeb78('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ccc2f,_0x30c884,_0x2b7925){return new BPromise(function(_0x36963f,_0x5259aa){return client['request'](_0x1ccc2f,_0x2b7925)[_0xeb78('0xc')](function(_0x1c941d){logger[_0xeb78('0xd')](_0xeb78('0xe'),_0x30c884,_0xeb78('0xf'));logger[_0xeb78('0x10')](_0xeb78('0x11'),_0x30c884,_0xeb78('0xf'),JSON[_0xeb78('0x12')](_0x1c941d));if(_0x1c941d['error']){if(_0x1c941d[_0xeb78('0x13')][_0xeb78('0x14')]===0x1f4){logger[_0xeb78('0x13')](_0xeb78('0xe'),_0x30c884,_0x1c941d[_0xeb78('0x13')][_0xeb78('0x15')]);return _0x5259aa(_0x1c941d[_0xeb78('0x13')][_0xeb78('0x15')]);}logger[_0xeb78('0x13')](_0xeb78('0xe'),_0x30c884,_0x1c941d['error'][_0xeb78('0x15')]);return _0x36963f(_0x1c941d[_0xeb78('0x13')]['message']);}else{logger['info']('Automation,\x20%s,\x20%s',_0x30c884,_0xeb78('0xf'));_0x36963f(_0x1c941d['result'][_0xeb78('0x15')]);}})[_0xeb78('0x16')](function(_0x49123d){logger[_0xeb78('0x13')]('Automation,\x20%s,\x20%s',_0x30c884,_0x49123d);_0x5259aa(_0x49123d);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index d239e00..2b4a3d2 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 _0xf58e=['/:id/actions','getActions','post','/:id/conditions','addConditions','addActions','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','index','get','/:id','show','getConditions'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xf58e,0xc1));var _0xef58=function(_0x3b8741,_0x192492){_0x3b8741=_0x3b8741-0x0;var _0x21650f=_0xf58e[_0x3b8741];return _0x21650f;};'use strict';var multer=require(_0xef58('0x0'));var util=require(_0xef58('0x1'));var path=require(_0xef58('0x2'));var timeout=require(_0xef58('0x3'));var express=require('express');var router=express[_0xef58('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xef58('0x5'));var config=require(_0xef58('0x6'));var controller=require(_0xef58('0x7'));router['get']('/',auth[_0xef58('0x8')](),controller[_0xef58('0x9')]);router[_0xef58('0xa')](_0xef58('0xb'),auth[_0xef58('0x8')](),controller[_0xef58('0xc')]);router[_0xef58('0xa')]('/:id/conditions',auth['isAuthenticated'](),controller[_0xef58('0xd')]);router['get'](_0xef58('0xe'),auth[_0xef58('0x8')](),controller[_0xef58('0xf')]);router[_0xef58('0x10')]('/',auth[_0xef58('0x8')](),controller['create']);router[_0xef58('0x10')](_0xef58('0x11'),auth[_0xef58('0x8')](),controller[_0xef58('0x12')]);router[_0xef58('0x10')](_0xef58('0xe'),auth[_0xef58('0x8')](),controller[_0xef58('0x13')]);router['put'](_0xef58('0xb'),auth[_0xef58('0x8')](),controller[_0xef58('0x14')]);router[_0xef58('0x15')](_0xef58('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xef58('0x16')]=router; \ No newline at end of file +var _0x54da=['/:id/actions','post','create','addConditions','addActions','put','/:id','update','destroy','exports','multer','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','index','get','/:id/conditions','isAuthenticated'];(function(_0x40c0dd,_0x171ea5){var _0x2d4984=function(_0x28088a){while(--_0x28088a){_0x40c0dd['push'](_0x40c0dd['shift']());}};_0x2d4984(++_0x171ea5);}(_0x54da,0x9d));var _0xa54d=function(_0x5af81e,_0x3a0d0b){_0x5af81e=_0x5af81e-0x0;var _0x198f7c=_0x54da[_0x5af81e];return _0x198f7c;};'use strict';var multer=require(_0xa54d('0x0'));var util=require('util');var path=require(_0xa54d('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa54d('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xa54d('0x3'));var interaction=require(_0xa54d('0x4'));var config=require(_0xa54d('0x5'));var controller=require(_0xa54d('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xa54d('0x7')]);router[_0xa54d('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xa54d('0x8')](_0xa54d('0x9'),auth[_0xa54d('0xa')](),controller['getConditions']);router[_0xa54d('0x8')](_0xa54d('0xb'),auth['isAuthenticated'](),controller['getActions']);router[_0xa54d('0xc')]('/',auth['isAuthenticated'](),controller[_0xa54d('0xd')]);router[_0xa54d('0xc')](_0xa54d('0x9'),auth['isAuthenticated'](),controller[_0xa54d('0xe')]);router['post']('/:id/actions',auth['isAuthenticated'](),controller[_0xa54d('0xf')]);router[_0xa54d('0x10')](_0xa54d('0x11'),auth[_0xa54d('0xa')](),controller[_0xa54d('0x12')]);router['delete'](_0xa54d('0x11'),auth[_0xa54d('0xa')](),controller[_0xa54d('0x13')]);module[_0xa54d('0x14')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 1207840..e55bf2e 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 _0xcd43=['#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','name','ENUM','ivr','STRING','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)'];(function(_0x19e928,_0x26a0e4){var _0x4e941f=function(_0x52a5cd){while(--_0x52a5cd){_0x19e928['push'](_0x19e928['shift']());}};_0x4e941f(++_0x26a0e4);}(_0xcd43,0x14a));var _0x3cd4=function(_0x50e410,_0x36bb68){_0x50e410=_0x50e410-0x0;var _0x3eb22c=_0xcd43[_0x50e410];return _0x3eb22c;};'use strict';var Sequelize=require('sequelize');module[_0x3cd4('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x3cd4('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x3cd4('0x2')](_0x3cd4('0x3')),'allowNull':![],'defaultValue':_0x3cd4('0x3')},'description':{'type':Sequelize[_0x3cd4('0x4')]},'active':{'type':Sequelize[_0x3cd4('0x5')],'defaultValue':0x0,'comment':_0x3cd4('0x6')},'limitCalls':{'type':Sequelize[_0x3cd4('0x7')](0x4)[_0x3cd4('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x3cd4('0x9')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x3cd4('0x4')]},'dialOriginateTimeout':{'type':Sequelize[_0x3cd4('0x7')](0x3)[_0x3cd4('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3cd4('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x3cd4('0x7')](0x3)[_0x3cd4('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3cd4('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3cd4('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x3cd4('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3cd4('0xc')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3cd4('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x3cd4('0x7')](0x3)[_0x3cd4('0x8')],'defaultValue':0x3,'comment':_0x3cd4('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x3cd4('0x7')](0x5)[_0x3cd4('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3cd4('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0x3cd4('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x3cd4('0x10')},'dialTimezone':{'type':Sequelize[_0x3cd4('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x3cd4('0x4')],'defaultValue':_0x3cd4('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0x3cd4('0x2')](_0x3cd4('0x12'),_0x3cd4('0x13'),_0x3cd4('0x14')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x3cd4('0x5')],'defaultValue':0x0,'comment':_0x3cd4('0x15')},'dialAMDInitialSilence':{'type':Sequelize[_0x3cd4('0x7')](0x9)[_0x3cd4('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x3cd4('0x16')},'dialAMDGreeting':{'type':Sequelize[_0x3cd4('0x7')](0x9)[_0x3cd4('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x3cd4('0x7')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x3cd4('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x3cd4('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3cd4('0x18')},'dialAMDMinWordLength':{'type':Sequelize[_0x3cd4('0x7')](0x9)[_0x3cd4('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x3cd4('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x3cd4('0x7')](0x9)[_0x3cd4('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x3cd4('0x1a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x3cd4('0x7')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x3cd4('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x3cd4('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x3cd4('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x3cd4('0x2')](_0x3cd4('0x1c'),_0x3cd4('0x1d')),'defaultValue':_0x3cd4('0x1c')},'dialPrefix':{'type':Sequelize[_0x3cd4('0x4')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x3cd4('0x7')](0x3)[_0x3cd4('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x3cd4('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3cd4('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x3cd4('0x7')](0x3)[_0x3cd4('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x3cd4('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x3cd4('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3cd4('0x1f')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3cd4('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3cd4('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x3cd4('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3cd4('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x3cd4('0x7')](0x5)[_0x3cd4('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x3cd4('0x7')](0x3)[_0x3cd4('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3cd4('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0x3cd4('0x7')](0x5)[_0x3cd4('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3cd4('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3cd4('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x3cd4('0x7')](0x5)[_0x3cd4('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3cd4('0x25')}}; \ No newline at end of file +var _0xed9d=['INTEGER','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\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)','sequelize','STRING','name','ENUM','ivr','BOOLEAN','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'];(function(_0xe84805,_0x2702d9){var _0x398efd=function(_0x37cfad){while(--_0x37cfad){_0xe84805['push'](_0xe84805['shift']());}};_0x398efd(++_0x2702d9);}(_0xed9d,0x101));var _0xded9=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xed9d[_0x46aff0];return _0x9d78cf;};'use strict';var Sequelize=require(_0xded9('0x0'));module['exports']={'name':{'type':Sequelize[_0xded9('0x1')],'unique':_0xded9('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xded9('0x3')]('ivr'),'allowNull':![],'defaultValue':_0xded9('0x4')},'description':{'type':Sequelize[_0xded9('0x1')]},'active':{'type':Sequelize[_0xded9('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xded9('0x6')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xded9('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xded9('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0xded9('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xded9('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0xded9('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xded9('0xb')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xded9('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xded9('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xded9('0x9')](0x3)[_0xded9('0x7')],'defaultValue':0x3,'comment':_0xded9('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xded9('0x9')](0x5)[_0xded9('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xded9('0xe')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xded9('0xf')},'dialTimezone':{'type':Sequelize[_0xded9('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xded9('0x10')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xded9('0x11'),_0xded9('0x12'),_0xded9('0x13')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xded9('0x5')],'defaultValue':0x0,'comment':_0xded9('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0xded9('0x9')](0x9)[_0xded9('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xded9('0x15')},'dialAMDGreeting':{'type':Sequelize[_0xded9('0x9')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xded9('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xded9('0x9')](0x9)[_0xded9('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xded9('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xded9('0x18')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xded9('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xded9('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xded9('0x9')](0x9)[_0xded9('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xded9('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xded9('0x9')](0x5)[_0xded9('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xded9('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xded9('0x9')](0x9)[_0xded9('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xded9('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC','ASC'),'defaultValue':_0xded9('0x1d')},'dialPrefix':{'type':Sequelize[_0xded9('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xded9('0x9')](0x3)[_0xded9('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xded9('0x1e')},'dialCutDigit':{'type':Sequelize[_0xded9('0x9')](0x3)[_0xded9('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xded9('0x1f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xded9('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xded9('0x20')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xded9('0x9')](0x5)[_0xded9('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xded9('0x21')},'dialDropMaxRetry':{'type':Sequelize[_0xded9('0x9')](0x3)[_0xded9('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xded9('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xded9('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xded9('0x9')](0x3)[_0xded9('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xded9('0x23')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xded9('0x9')](0x5)[_0xded9('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xded9('0x24')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xded9('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xded9('0x9')](0x5)[_0xded9('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xded9('0x9')](0x3)[_0xded9('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xded9('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index a61ef49..d71fb05 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 _0xe386=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','get','IvrCampaigns','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','where','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','Campaign','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','omit','updatedAt','createdAt','role','destroy','getHoppers','findOne','hasOwnProperty','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','into','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','cm_hopper','COALESCE(phone,\x27\x27)','insert','NOW()','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x40a0a4,_0x5d30d0){var _0x50cc17=function(_0x4ea52d){while(--_0x4ea52d){_0x40a0a4['push'](_0x40a0a4['shift']());}};_0x50cc17(++_0x5d30d0);}(_0xe386,0x11c));var _0x6e38=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe386[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6e38('0x0'));var zipdir=require(_0x6e38('0x1'));var jsonpatch=require(_0x6e38('0x2'));var rp=require('request-promise');var moment=require(_0x6e38('0x3'));var BPromise=require(_0x6e38('0x4'));var Mustache=require(_0x6e38('0x5'));var util=require(_0x6e38('0x6'));var path=require(_0x6e38('0x7'));var sox=require(_0x6e38('0x8'));var csv=require(_0x6e38('0x9'));var ejs=require(_0x6e38('0xa'));var fs=require('fs');var fs_extra=require(_0x6e38('0xb'));var _=require(_0x6e38('0xc'));var squel=require(_0x6e38('0xd'));var crypto=require(_0x6e38('0xe'));var jsforce=require(_0x6e38('0xf'));var deskjs=require(_0x6e38('0x10'));var toCsv=require('to-csv');var querystring=require(_0x6e38('0x11'));var Papa=require(_0x6e38('0x12'));var Redis=require(_0x6e38('0x13'));var authService=require(_0x6e38('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x6e38('0x15'));var hardwareService=require(_0x6e38('0x16'));var logger=require(_0x6e38('0x17'))(_0x6e38('0x18'));var utils=require(_0x6e38('0x19'));var config=require(_0x6e38('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x6e38('0x1b'))['db'];function respondWithStatusCode(_0x4c5fed,_0x15fe3d){_0x15fe3d=_0x15fe3d||0xcc;return function(_0xfb28a3){if(_0xfb28a3){return _0x4c5fed[_0x6e38('0x1c')](_0x15fe3d);}return _0x4c5fed[_0x6e38('0x1d')](_0x15fe3d)[_0x6e38('0x1e')]();};}function respondWithResult(_0x5998e1,_0xa36036){_0xa36036=_0xa36036||0xc8;return function(_0x4af0e7){if(_0x4af0e7){return _0x5998e1[_0x6e38('0x1d')](_0xa36036)['json'](_0x4af0e7);}};}function respondWithFilteredResult(_0x578594,_0x5aa051){return function(_0x2ef592){if(_0x2ef592){var _0x40bcac=typeof _0x5aa051[_0x6e38('0x1f')]===_0x6e38('0x20')&&typeof _0x5aa051[_0x6e38('0x21')]===_0x6e38('0x20');var _0x572564=_0x2ef592['count'];var _0x209dde=_0x40bcac?0x0:_0x5aa051['offset'];var _0x198f95=_0x40bcac?_0x2ef592[_0x6e38('0x22')]:_0x5aa051[_0x6e38('0x1f')]+_0x5aa051['limit'];var _0x4ef81a;if(_0x198f95>=_0x572564){_0x198f95=_0x572564;_0x4ef81a=0xc8;}else{_0x4ef81a=0xce;}_0x578594[_0x6e38('0x1d')](_0x4ef81a);return _0x578594[_0x6e38('0x23')](_0x6e38('0x24'),_0x209dde+'-'+_0x198f95+'/'+_0x572564)[_0x6e38('0x25')](_0x2ef592);}return null;};}function patchUpdates(_0x4cc727){return function(_0x22bb9f){try{jsonpatch['apply'](_0x22bb9f,_0x4cc727,!![]);}catch(_0x511877){return BPromise[_0x6e38('0x26')](_0x511877);}return _0x22bb9f[_0x6e38('0x27')]();};}function saveUpdates(_0x1efdca,_0x2efc9b){return function(_0x5dbc10){if(_0x5dbc10){return _0x5dbc10[_0x6e38('0x28')](_0x1efdca)[_0x6e38('0x29')](function(_0x2f47fb){return _0x2f47fb;});}return null;};}function removeEntity(_0x16f17d,_0x105bcf){return function(_0x55ff8d){if(_0x55ff8d){return _0x55ff8d['destroy']()[_0x6e38('0x29')](function(){var _0x2ca0cf=_0x55ff8d[_0x6e38('0x2a')]({'plain':!![]});var _0x48a5df=_0x6e38('0x2b');return db['UserProfileResource']['destroy']({'where':{'type':_0x48a5df,'resourceId':_0x2ca0cf['id']}})['then'](function(){return _0x55ff8d;});})['then'](function(){_0x16f17d[_0x6e38('0x1d')](0xcc)[_0x6e38('0x1e')]();});}};}function handleEntityNotFound(_0x5dfc01,_0x2fc92e){return function(_0x263044){if(!_0x263044){_0x5dfc01['sendStatus'](0x194);}return _0x263044;};}function handleError(_0x59d77a,_0x238e50){_0x238e50=_0x238e50||0x1f4;return function(_0x65c2c5){logger['error'](_0x65c2c5['stack']);if(_0x65c2c5['name']){delete _0x65c2c5[_0x6e38('0x2c')];}_0x59d77a[_0x6e38('0x1d')](_0x238e50)[_0x6e38('0x2d')](_0x65c2c5);};}exports[_0x6e38('0x2e')]=function(_0x3c330c,_0x3378bb){var _0x1b8364={},_0x55d31e={},_0x100f66={'count':0x0,'rows':[]};var _0x391b02=_[_0x6e38('0x2f')](db['Campaign'][_0x6e38('0x30')],function(_0x5e653d){return{'name':_0x5e653d[_0x6e38('0x31')],'type':_0x5e653d['type'][_0x6e38('0x32')]};});_0x55d31e[_0x6e38('0x33')]=_[_0x6e38('0x2f')](_0x391b02,'name');_0x55d31e[_0x6e38('0x34')]=_[_0x6e38('0x35')](_0x3c330c[_0x6e38('0x34')]);_0x55d31e[_0x6e38('0x36')]=_[_0x6e38('0x37')](_0x55d31e['model'],_0x55d31e[_0x6e38('0x34')]);_0x1b8364['attributes']=_['intersection'](_0x55d31e[_0x6e38('0x33')],qs[_0x6e38('0x38')](_0x3c330c[_0x6e38('0x34')][_0x6e38('0x38')]));_0x1b8364[_0x6e38('0x39')]=_0x1b8364[_0x6e38('0x39')][_0x6e38('0x3a')]?_0x1b8364[_0x6e38('0x39')]:_0x55d31e[_0x6e38('0x33')];if(!_0x3c330c[_0x6e38('0x34')]['hasOwnProperty'](_0x6e38('0x3b'))){_0x1b8364[_0x6e38('0x21')]=qs[_0x6e38('0x21')](_0x3c330c[_0x6e38('0x34')][_0x6e38('0x21')]);_0x1b8364[_0x6e38('0x1f')]=qs[_0x6e38('0x1f')](_0x3c330c[_0x6e38('0x34')][_0x6e38('0x1f')]);}_0x1b8364[_0x6e38('0x3c')]=qs[_0x6e38('0x3d')](_0x3c330c[_0x6e38('0x34')][_0x6e38('0x3d')]);_0x1b8364['where']=qs[_0x6e38('0x36')](_[_0x6e38('0x3e')](_0x3c330c['query'],_0x55d31e[_0x6e38('0x36')]),_0x391b02);if(_0x3c330c[_0x6e38('0x34')]['filter']){_0x1b8364[_0x6e38('0x3f')]=_['merge'](_0x1b8364[_0x6e38('0x3f')],{'$or':_[_0x6e38('0x2f')](_0x391b02,function(_0x2acda3){if(_0x2acda3[_0x6e38('0x40')]!==_0x6e38('0x41')){var _0x5b6527={};_0x5b6527[_0x2acda3[_0x6e38('0x2c')]]={'$like':'%'+_0x3c330c['query'][_0x6e38('0x42')]+'%'};return _0x5b6527;}})});}_0x1b8364=_[_0x6e38('0x43')]({},_0x1b8364,_0x3c330c[_0x6e38('0x44')]);var _0x4b8a2a={'where':_0x1b8364[_0x6e38('0x3f')]};return db['Campaign'][_0x6e38('0x22')](_0x4b8a2a)[_0x6e38('0x29')](function(_0x210c22){_0x100f66['count']=_0x210c22;if(_0x3c330c[_0x6e38('0x34')][_0x6e38('0x45')]){_0x1b8364[_0x6e38('0x46')]=[{'all':!![]}];}return db['Campaign'][_0x6e38('0x47')](_0x1b8364);})[_0x6e38('0x29')](function(_0x577d38){_0x100f66[_0x6e38('0x48')]=_0x577d38;return _0x100f66;})[_0x6e38('0x29')](respondWithFilteredResult(_0x3378bb,_0x1b8364))[_0x6e38('0x49')](handleError(_0x3378bb,null));};exports[_0x6e38('0x4a')]=function(_0x5d3594,_0x2e1218){var _0x56d798={'raw':![],'where':{'id':_0x5d3594[_0x6e38('0x4b')]['id']}},_0x3e3c7a={};_0x3e3c7a[_0x6e38('0x33')]=_[_0x6e38('0x35')](db['Campaign'][_0x6e38('0x30')]);_0x3e3c7a[_0x6e38('0x34')]=_['keys'](_0x5d3594['query']);_0x3e3c7a[_0x6e38('0x36')]=_[_0x6e38('0x37')](_0x3e3c7a[_0x6e38('0x33')],_0x3e3c7a['query']);_0x56d798[_0x6e38('0x39')]=_['intersection'](_0x3e3c7a[_0x6e38('0x33')],qs[_0x6e38('0x38')](_0x5d3594[_0x6e38('0x34')][_0x6e38('0x38')]));_0x56d798[_0x6e38('0x39')]=_0x56d798[_0x6e38('0x39')]['length']?_0x56d798[_0x6e38('0x39')]:_0x3e3c7a[_0x6e38('0x33')];if(_0x5d3594[_0x6e38('0x34')]['includeAll']){_0x56d798[_0x6e38('0x46')]=[{'all':!![]}];}_0x56d798=_[_0x6e38('0x43')]({},_0x56d798,_0x5d3594['options']);return db['Campaign']['find'](_0x56d798)[_0x6e38('0x29')](handleEntityNotFound(_0x2e1218,null))['then'](respondWithResult(_0x2e1218,null))[_0x6e38('0x49')](handleError(_0x2e1218,null));};exports['create']=function(_0x9c0e09,_0x277a12){return db[_0x6e38('0x4c')][_0x6e38('0x4d')](_0x9c0e09[_0x6e38('0x4e')],{})[_0x6e38('0x29')](function(_0xbcdfd5){var _0x1a348b=_0x9c0e09[_0x6e38('0x4f')][_0x6e38('0x2a')]({'plain':!![]});if(!_0x1a348b)throw new Error(_0x6e38('0x50'));if(_0x1a348b['role']===_0x6e38('0x4f')){var _0xed62c1=_0xbcdfd5[_0x6e38('0x2a')]({'plain':!![]});var _0x56e705='IvrCampaigns';return db[_0x6e38('0x51')]['find']({'where':{'name':_0x56e705,'userProfileId':_0x1a348b[_0x6e38('0x52')]},'raw':!![]})[_0x6e38('0x29')](function(_0x49be99){if(_0x49be99&&_0x49be99[_0x6e38('0x53')]===0x0){return db[_0x6e38('0x54')][_0x6e38('0x4d')]({'name':_0xed62c1['name'],'resourceId':_0xed62c1['id'],'type':_0x49be99[_0x6e38('0x2c')],'sectionId':_0x49be99['id']},{})[_0x6e38('0x29')](function(){return _0xbcdfd5;});}else{return _0xbcdfd5;}})['catch'](function(_0x4031a4){logger[_0x6e38('0x55')](_0x6e38('0x56'),_0x4031a4);throw _0x4031a4;});}return _0xbcdfd5;})['then'](respondWithResult(_0x277a12,0xc9))[_0x6e38('0x49')](handleError(_0x277a12,null));};exports['clone']=function(_0x48f542,_0x436340){var _0x5bcefc={'where':{'id':_0x48f542[_0x6e38('0x4b')]['id']}},_0x2ba790={};_0x2ba790[_0x6e38('0x33')]=_['keys'](db[_0x6e38('0x4c')][_0x6e38('0x30')]);_0x5bcefc['attributes']=_[_0x6e38('0x37')](_0x2ba790['model'],qs[_0x6e38('0x38')](_0x48f542[_0x6e38('0x34')][_0x6e38('0x38')]));_0x5bcefc['attributes']=_0x5bcefc[_0x6e38('0x39')][_0x6e38('0x3a')]?_0x5bcefc[_0x6e38('0x39')]:_0x2ba790[_0x6e38('0x33')];if(_0x48f542['query'][_0x6e38('0x45')]){_0x5bcefc['include']=[{'all':!![]}];}_0x5bcefc=_['merge']({},_0x5bcefc,_0x48f542['options']);return db['Campaign'][_0x6e38('0x57')](_0x5bcefc)[_0x6e38('0x29')](handleEntityNotFound(_0x436340,null))[_0x6e38('0x29')](function(_0x10d3f6){if(_0x10d3f6){var _0x4ca10c=_0x10d3f6[_0x6e38('0x2a')]({'plain':!![]});_0x4ca10c=qs[_0x6e38('0x58')](_0x4ca10c,['id','createdAt',_0x6e38('0x59')]);_0x48f542[_0x6e38('0x4e')]=_[_0x6e38('0x58')](_0x48f542['body'],['id',_0x6e38('0x5a'),_0x6e38('0x59')]);return db['Campaign'][_0x6e38('0x4d')](_[_0x6e38('0x43')](_0x4ca10c,_0x48f542[_0x6e38('0x4e')]),{'include':_0x48f542['query'][_0x6e38('0x45')]?[{'all':!![]}]:undefined})[_0x6e38('0x29')](function(_0x1de65a){var _0x1fb095=_0x48f542[_0x6e38('0x4f')][_0x6e38('0x2a')]({'plain':!![]});if(!_0x1fb095)throw new Error(_0x6e38('0x50'));if(_0x1fb095[_0x6e38('0x5b')]==='user'){var _0x217a6f=_0x1de65a[_0x6e38('0x2a')]({'plain':!![]});var _0x23363d=_0x6e38('0x2b');return db[_0x6e38('0x51')][_0x6e38('0x57')]({'where':{'name':_0x23363d,'userProfileId':_0x1fb095[_0x6e38('0x52')]},'raw':!![]})['then'](function(_0x5f47e4){if(_0x5f47e4&&_0x5f47e4[_0x6e38('0x53')]===0x0){return db['UserProfileResource'][_0x6e38('0x4d')]({'name':_0x217a6f['name'],'resourceId':_0x217a6f['id'],'type':_0x5f47e4[_0x6e38('0x2c')],'sectionId':_0x5f47e4['id']},{})['then'](function(){return _0x1de65a;});}else{return _0x1de65a;}})[_0x6e38('0x49')](function(_0x494342){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x494342);throw _0x494342;});}return _0x1de65a;});}})[_0x6e38('0x29')](respondWithResult(_0x436340,0xc9))[_0x6e38('0x49')](handleError(_0x436340,null));};exports[_0x6e38('0x28')]=function(_0x6e5989,_0x1a98d3){if(_0x6e5989[_0x6e38('0x4e')]['id']){delete _0x6e5989[_0x6e38('0x4e')]['id'];}return db[_0x6e38('0x4c')]['find']({'where':{'id':_0x6e5989[_0x6e38('0x4b')]['id']}})[_0x6e38('0x29')](handleEntityNotFound(_0x1a98d3,null))[_0x6e38('0x29')](saveUpdates(_0x6e5989['body'],null))[_0x6e38('0x29')](respondWithResult(_0x1a98d3,null))[_0x6e38('0x49')](handleError(_0x1a98d3,null));};exports[_0x6e38('0x5c')]=function(_0x26141f,_0x2571b7){return db[_0x6e38('0x4c')][_0x6e38('0x57')]({'where':{'id':_0x26141f[_0x6e38('0x4b')]['id']}})[_0x6e38('0x29')](handleEntityNotFound(_0x2571b7,null))['then'](removeEntity(_0x2571b7,null))[_0x6e38('0x49')](handleError(_0x2571b7,null));};exports[_0x6e38('0x5d')]=function(_0x34fdb5,_0x36c8a7,_0x270065){var _0x271f86={'raw':!![],'where':{}};var _0x20c34e={};var _0x21ad87={'count':0x0,'rows':[]};return db[_0x6e38('0x4c')][_0x6e38('0x5e')]({'where':{'id':_0x34fdb5[_0x6e38('0x4b')]['id']}})['then'](handleEntityNotFound(_0x36c8a7,null))[_0x6e38('0x29')](function(_0x5a27a9){if(_0x5a27a9){_0x20c34e[_0x6e38('0x33')]=_['keys'](db['CmHopper'][_0x6e38('0x30')]);_0x20c34e[_0x6e38('0x34')]=_[_0x6e38('0x35')](_0x34fdb5[_0x6e38('0x34')]);_0x20c34e[_0x6e38('0x36')]=_[_0x6e38('0x37')](_0x20c34e[_0x6e38('0x33')],_0x20c34e[_0x6e38('0x34')]);_0x271f86[_0x6e38('0x39')]=_[_0x6e38('0x37')](_0x20c34e[_0x6e38('0x33')],qs['fields'](_0x34fdb5[_0x6e38('0x34')][_0x6e38('0x38')]));_0x271f86[_0x6e38('0x39')]=_0x271f86[_0x6e38('0x39')][_0x6e38('0x3a')]?_0x271f86['attributes']:_0x20c34e[_0x6e38('0x33')];if(!_0x34fdb5[_0x6e38('0x34')][_0x6e38('0x5f')](_0x6e38('0x3b'))){_0x271f86[_0x6e38('0x21')]=qs['limit'](_0x34fdb5['query'][_0x6e38('0x21')]);_0x271f86[_0x6e38('0x1f')]=qs['offset'](_0x34fdb5['query'][_0x6e38('0x1f')]);}_0x271f86[_0x6e38('0x3c')]=qs['sort'](_0x34fdb5[_0x6e38('0x34')]['sort']);_0x271f86[_0x6e38('0x3f')]=qs[_0x6e38('0x36')](_[_0x6e38('0x3e')](_0x34fdb5[_0x6e38('0x34')],_0x20c34e[_0x6e38('0x36')]));_0x271f86['where'][_0x6e38('0x60')]=_0x5a27a9['id'];if(_0x34fdb5[_0x6e38('0x34')]['filter']){_0x271f86[_0x6e38('0x3f')]=_[_0x6e38('0x43')](_0x271f86['where'],{'$or':_['map'](_0x271f86['attributes'],function(_0x494b57){var _0x462499={};_0x462499[_0x494b57]={'$like':'%'+_0x34fdb5[_0x6e38('0x34')][_0x6e38('0x42')]+'%'};return _0x462499;})});}_0x271f86=_[_0x6e38('0x43')]({},_0x271f86,_0x34fdb5['options']);return db[_0x6e38('0x61')][_0x6e38('0x22')]({'where':_0x271f86[_0x6e38('0x3f')]})[_0x6e38('0x29')](function(_0x1785b7){_0x21ad87[_0x6e38('0x22')]=_0x1785b7;if(_0x34fdb5[_0x6e38('0x34')][_0x6e38('0x45')]){_0x271f86[_0x6e38('0x46')]=[{'all':!![]}];}return db[_0x6e38('0x61')][_0x6e38('0x47')](_0x271f86);})[_0x6e38('0x29')](function(_0x3bd792){_0x21ad87['rows']=_0x3bd792;return _0x21ad87;});}})[_0x6e38('0x29')](respondWithFilteredResult(_0x36c8a7,_0x271f86))[_0x6e38('0x49')](handleError(_0x36c8a7,null));};exports[_0x6e38('0x62')]=function(_0x342c8e,_0x465a2a,_0x218199){var _0x54a9f0={'raw':!![],'where':{}};var _0x4a2c25={};var _0x435c0d={'count':0x0,'rows':[]};return db['Campaign'][_0x6e38('0x5e')]({'where':{'id':_0x342c8e[_0x6e38('0x4b')]['id']}})['then'](handleEntityNotFound(_0x465a2a,null))['then'](function(_0xd2eb44){if(_0xd2eb44){_0x4a2c25['model']=_[_0x6e38('0x35')](db[_0x6e38('0x63')][_0x6e38('0x30')]);_0x4a2c25['query']=_[_0x6e38('0x35')](_0x342c8e[_0x6e38('0x34')]);_0x4a2c25['filters']=_[_0x6e38('0x37')](_0x4a2c25[_0x6e38('0x33')],_0x4a2c25['query']);_0x54a9f0[_0x6e38('0x39')]=_['intersection'](_0x4a2c25[_0x6e38('0x33')],qs[_0x6e38('0x38')](_0x342c8e['query'][_0x6e38('0x38')]));_0x54a9f0[_0x6e38('0x39')]=_0x54a9f0['attributes'][_0x6e38('0x3a')]?_0x54a9f0['attributes']:_0x4a2c25['model'];if(!_0x342c8e[_0x6e38('0x34')][_0x6e38('0x5f')](_0x6e38('0x3b'))){_0x54a9f0[_0x6e38('0x21')]=qs[_0x6e38('0x21')](_0x342c8e[_0x6e38('0x34')][_0x6e38('0x21')]);_0x54a9f0['offset']=qs['offset'](_0x342c8e[_0x6e38('0x34')][_0x6e38('0x1f')]);}_0x54a9f0[_0x6e38('0x3c')]=qs['sort'](_0x342c8e[_0x6e38('0x34')]['sort']);_0x54a9f0[_0x6e38('0x3f')]=qs['filters'](_[_0x6e38('0x3e')](_0x342c8e[_0x6e38('0x34')],_0x4a2c25[_0x6e38('0x36')]));_0x54a9f0[_0x6e38('0x3f')][_0x6e38('0x60')]=_0xd2eb44['id'];if(_0x342c8e['query'][_0x6e38('0x42')]){_0x54a9f0['where']=_[_0x6e38('0x43')](_0x54a9f0[_0x6e38('0x3f')],{'$or':_['map'](_0x54a9f0[_0x6e38('0x39')],function(_0x16a0b3){var _0x22fbfc={};_0x22fbfc[_0x16a0b3]={'$like':'%'+_0x342c8e[_0x6e38('0x34')][_0x6e38('0x42')]+'%'};return _0x22fbfc;})});}_0x54a9f0=_[_0x6e38('0x43')]({},_0x54a9f0,_0x342c8e[_0x6e38('0x44')]);return db['CmHopperHistory'][_0x6e38('0x22')]({'where':_0x54a9f0[_0x6e38('0x3f')]})[_0x6e38('0x29')](function(_0x52fc79){_0x435c0d['count']=_0x52fc79;if(_0x342c8e[_0x6e38('0x34')]['includeAll']){_0x54a9f0[_0x6e38('0x46')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x6e38('0x47')](_0x54a9f0);})[_0x6e38('0x29')](function(_0x44a9ab){_0x435c0d[_0x6e38('0x48')]=_0x44a9ab;return _0x435c0d;});}})[_0x6e38('0x29')](respondWithFilteredResult(_0x465a2a,_0x54a9f0))[_0x6e38('0x49')](handleError(_0x465a2a,null));};exports[_0x6e38('0x64')]=function(_0x272591,_0x3f3373,_0x91976a){var _0x5c63f6={'raw':!![],'where':{}};var _0x2d7df3={};var _0x43e521={'count':0x0,'rows':[]};return db[_0x6e38('0x4c')][_0x6e38('0x5e')]({'where':{'id':_0x272591[_0x6e38('0x4b')]['id']}})[_0x6e38('0x29')](handleEntityNotFound(_0x3f3373,null))[_0x6e38('0x29')](function(_0x2f0f4e){if(_0x2f0f4e){_0x2d7df3['model']=_[_0x6e38('0x35')](db[_0x6e38('0x65')][_0x6e38('0x30')]);_0x2d7df3['query']=_[_0x6e38('0x35')](_0x272591[_0x6e38('0x34')]);_0x2d7df3[_0x6e38('0x36')]=_['intersection'](_0x2d7df3[_0x6e38('0x33')],_0x2d7df3['query']);_0x5c63f6[_0x6e38('0x39')]=_['intersection'](_0x2d7df3[_0x6e38('0x33')],qs[_0x6e38('0x38')](_0x272591[_0x6e38('0x34')]['fields']));_0x5c63f6['attributes']=_0x5c63f6[_0x6e38('0x39')][_0x6e38('0x3a')]?_0x5c63f6[_0x6e38('0x39')]:_0x2d7df3[_0x6e38('0x33')];if(!_0x272591[_0x6e38('0x34')][_0x6e38('0x5f')](_0x6e38('0x3b'))){_0x5c63f6[_0x6e38('0x21')]=qs[_0x6e38('0x21')](_0x272591[_0x6e38('0x34')][_0x6e38('0x21')]);_0x5c63f6[_0x6e38('0x1f')]=qs[_0x6e38('0x1f')](_0x272591[_0x6e38('0x34')]['offset']);}_0x5c63f6['order']=qs[_0x6e38('0x3d')](_0x272591[_0x6e38('0x34')]['sort']);_0x5c63f6[_0x6e38('0x3f')]=qs[_0x6e38('0x36')](_['pick'](_0x272591[_0x6e38('0x34')],_0x2d7df3[_0x6e38('0x36')]));_0x5c63f6[_0x6e38('0x3f')][_0x6e38('0x60')]=_0x2f0f4e['id'];if(_0x272591[_0x6e38('0x34')]['filter']){_0x5c63f6['where']=_[_0x6e38('0x43')](_0x5c63f6[_0x6e38('0x3f')],{'$or':_[_0x6e38('0x2f')](_0x5c63f6['attributes'],function(_0x544c6c){var _0x5b98b9={};_0x5b98b9[_0x544c6c]={'$like':'%'+_0x272591[_0x6e38('0x34')]['filter']+'%'};return _0x5b98b9;})});}_0x5c63f6=_[_0x6e38('0x43')]({},_0x5c63f6,_0x272591[_0x6e38('0x44')]);return db['CmHopperFinal']['count']({'where':_0x5c63f6[_0x6e38('0x3f')]})['then'](function(_0x5517f7){_0x43e521[_0x6e38('0x22')]=_0x5517f7;if(_0x272591[_0x6e38('0x34')][_0x6e38('0x45')]){_0x5c63f6['include']=[{'all':!![]}];}return db[_0x6e38('0x65')][_0x6e38('0x47')](_0x5c63f6);})[_0x6e38('0x29')](function(_0x352627){_0x43e521[_0x6e38('0x48')]=_0x352627;return _0x43e521;});}})['then'](respondWithFilteredResult(_0x3f3373,_0x5c63f6))[_0x6e38('0x49')](handleError(_0x3f3373,null));};exports[_0x6e38('0x66')]=function(_0x25fe17,_0x526ab6,_0x1a503a){var _0x3d9a23={'raw':!![],'where':{}};var _0x4db941={};var _0x22bf7b={'count':0x0,'rows':[]};return db[_0x6e38('0x4c')][_0x6e38('0x5e')]({'where':{'id':_0x25fe17[_0x6e38('0x4b')]['id']}})[_0x6e38('0x29')](handleEntityNotFound(_0x526ab6,null))[_0x6e38('0x29')](function(_0x963e23){if(_0x963e23){_0x4db941[_0x6e38('0x33')]=_[_0x6e38('0x35')](db[_0x6e38('0x67')]['rawAttributes']);_0x4db941[_0x6e38('0x34')]=_['keys'](_0x25fe17[_0x6e38('0x34')]);_0x4db941[_0x6e38('0x36')]=_[_0x6e38('0x37')](_0x4db941[_0x6e38('0x33')],_0x4db941[_0x6e38('0x34')]);_0x3d9a23['attributes']=_['intersection'](_0x4db941[_0x6e38('0x33')],qs[_0x6e38('0x38')](_0x25fe17[_0x6e38('0x34')][_0x6e38('0x38')]));_0x3d9a23[_0x6e38('0x39')]=_0x3d9a23[_0x6e38('0x39')]['length']?_0x3d9a23[_0x6e38('0x39')]:_0x4db941[_0x6e38('0x33')];if(!_0x25fe17[_0x6e38('0x34')]['hasOwnProperty'](_0x6e38('0x3b'))){_0x3d9a23[_0x6e38('0x21')]=qs[_0x6e38('0x21')](_0x25fe17['query'][_0x6e38('0x21')]);_0x3d9a23['offset']=qs[_0x6e38('0x1f')](_0x25fe17[_0x6e38('0x34')][_0x6e38('0x1f')]);}_0x3d9a23[_0x6e38('0x3c')]=qs['sort'](_0x25fe17[_0x6e38('0x34')]['sort']);_0x3d9a23[_0x6e38('0x3f')]=qs['filters'](_[_0x6e38('0x3e')](_0x25fe17['query'],_0x4db941[_0x6e38('0x36')]));_0x3d9a23[_0x6e38('0x3f')][_0x6e38('0x60')]=_0x963e23['id'];if(_0x25fe17[_0x6e38('0x34')][_0x6e38('0x42')]){_0x3d9a23[_0x6e38('0x3f')]=_[_0x6e38('0x43')](_0x3d9a23[_0x6e38('0x3f')],{'$or':_[_0x6e38('0x2f')](_0x3d9a23['attributes'],function(_0x47d26f){var _0x13e8ce={};_0x13e8ce[_0x47d26f]={'$like':'%'+_0x25fe17[_0x6e38('0x34')]['filter']+'%'};return _0x13e8ce;})});}_0x3d9a23=_['merge']({},_0x3d9a23,_0x25fe17[_0x6e38('0x44')]);return db[_0x6e38('0x67')][_0x6e38('0x22')]({'where':_0x3d9a23[_0x6e38('0x3f')]})['then'](function(_0x87b03){_0x22bf7b[_0x6e38('0x22')]=_0x87b03;if(_0x25fe17[_0x6e38('0x34')][_0x6e38('0x45')]){_0x3d9a23[_0x6e38('0x46')]=[{'all':!![]}];}return db[_0x6e38('0x67')]['findAll'](_0x3d9a23);})[_0x6e38('0x29')](function(_0x3302a3){_0x22bf7b[_0x6e38('0x48')]=_0x3302a3;return _0x22bf7b;});}})['then'](respondWithFilteredResult(_0x526ab6,_0x3d9a23))['catch'](handleError(_0x526ab6,null));};exports[_0x6e38('0x68')]=function(_0x5d573f,_0x35d5b3,_0x102221){var _0x3b587c={};var _0x425403={};var _0x4f141d;var _0x16f3e7;return db[_0x6e38('0x4c')][_0x6e38('0x5e')]({'where':{'id':_0x5d573f['params']['id']}})['then'](handleEntityNotFound(_0x35d5b3,null))['then'](function(_0x4f7c4f){if(_0x4f7c4f){_0x4f141d=_0x4f7c4f;_0x425403[_0x6e38('0x33')]=_[_0x6e38('0x35')](db[_0x6e38('0x69')]['rawAttributes']);_0x425403[_0x6e38('0x34')]=_['keys'](_0x5d573f[_0x6e38('0x34')]);_0x425403[_0x6e38('0x36')]=_[_0x6e38('0x37')](_0x425403[_0x6e38('0x33')],_0x425403[_0x6e38('0x34')]);_0x3b587c[_0x6e38('0x39')]=_[_0x6e38('0x37')](_0x425403[_0x6e38('0x33')],qs[_0x6e38('0x38')](_0x5d573f[_0x6e38('0x34')][_0x6e38('0x38')]));_0x3b587c[_0x6e38('0x39')]=_0x3b587c['attributes'][_0x6e38('0x3a')]?_0x3b587c[_0x6e38('0x39')]:_0x425403[_0x6e38('0x33')];_0x3b587c[_0x6e38('0x3c')]=qs['sort'](_0x5d573f[_0x6e38('0x34')]['sort']);_0x3b587c['where']=qs[_0x6e38('0x36')](_[_0x6e38('0x3e')](_0x5d573f[_0x6e38('0x34')],_0x425403[_0x6e38('0x36')]));if(_0x5d573f[_0x6e38('0x34')][_0x6e38('0x42')]){_0x3b587c['where']=_[_0x6e38('0x43')](_0x3b587c[_0x6e38('0x3f')],{'$or':_[_0x6e38('0x2f')](_0x3b587c['attributes'],function(_0x4386ca){var _0x37f985={};_0x37f985[_0x4386ca]={'$like':'%'+_0x5d573f[_0x6e38('0x34')][_0x6e38('0x42')]+'%'};return _0x37f985;})});}_0x3b587c=_['merge']({},_0x3b587c,_0x5d573f[_0x6e38('0x44')]);return _0x4f141d[_0x6e38('0x68')](_0x3b587c);}})['then'](function(_0x3dc43f){if(_0x3dc43f){_0x16f3e7=_0x3dc43f[_0x6e38('0x3a')];if(!_0x5d573f['query'][_0x6e38('0x5f')]('nolimit')){_0x3b587c['limit']=qs[_0x6e38('0x21')](_0x5d573f[_0x6e38('0x34')][_0x6e38('0x21')]);_0x3b587c[_0x6e38('0x1f')]=qs['offset'](_0x5d573f[_0x6e38('0x34')][_0x6e38('0x1f')]);}return _0x4f141d['getLists'](_0x3b587c);}})[_0x6e38('0x29')](function(_0x268884){if(_0x268884){return _0x268884?{'count':_0x16f3e7,'rows':_0x268884}:null;}})['then'](respondWithResult(_0x35d5b3,null))[_0x6e38('0x49')](handleError(_0x35d5b3,null));};exports[_0x6e38('0x6a')]=function(_0xa8f246,_0x436475,_0x18175e){var _0x194e66,_0xbbb1ce;var _0x1e2fa1=[];var _0x3e322f=moment()[_0x6e38('0x6b')](_0x6e38('0x6c'));return db[_0x6e38('0x4c')][_0x6e38('0x57')]({'where':{'id':_0xa8f246['params']['id']}})[_0x6e38('0x29')](handleEntityNotFound(_0x436475,null))[_0x6e38('0x29')](function(_0x317891){if(_0x317891){_0xbbb1ce=_0x317891;return _0x317891[_0x6e38('0x6a')](_0xa8f246[_0x6e38('0x4e')][_0x6e38('0x6d')],_[_0x6e38('0x58')](_0xa8f246[_0x6e38('0x4e')],[_0x6e38('0x6d'),'id'])||{});}return null;})[_0x6e38('0x6e')](function(_0x22daed){var _0x1d2136;var _0xa60d1c;_0x194e66=_0x22daed||[];var _0x2c28c0=[];if(_0x22daed){for(var _0x2c3100=0x0;_0x2c3100<_0x22daed[_0x6e38('0x3a')];_0x2c3100+=0x1){var _0x5bd8e3=_0x22daed[_0x2c3100][_0x6e38('0x2a')]({'plain':!![]});_0xbbb1ce['dialCheckDuplicateType']=_0xa8f246['body']['dialCheckDuplicateType']?_0xa8f246['body'][_0x6e38('0x6f')]:_0xbbb1ce[_0x6e38('0x6f')];switch(_0xbbb1ce['dialCheckDuplicateType']){case _0x6e38('0x70'):_0x1d2136=squel['insert']()[_0x6e38('0x71')]('cm_hopper')[_0x6e38('0x72')]([_0x6e38('0x73'),_0x6e38('0x74'),_0x6e38('0x75'),_0x6e38('0x76'),'CampaignId','createdAt','updatedAt'],squel[_0x6e38('0x77')]()[_0x6e38('0x78')](_0x6e38('0x73'),_0x6e38('0x73'))[_0x6e38('0x78')]('NOW()',_0x6e38('0x74'))[_0x6e38('0x78')]('id',_0x6e38('0x75'))[_0x6e38('0x78')](_0x5bd8e3[_0x6e38('0x79')][_0x6e38('0x7a')](),_0x6e38('0x76'))[_0x6e38('0x78')](_0xa8f246[_0x6e38('0x4b')]['id'][_0x6e38('0x7a')](),'CampaignId')[_0x6e38('0x78')]('\x27'+_0x3e322f+'\x27',_0x6e38('0x5a'))[_0x6e38('0x78')]('\x27'+_0x3e322f+'\x27',_0x6e38('0x59'))[_0x6e38('0x7b')](_0x6e38('0x7c'))['where'](_0x6e38('0x7d'))[_0x6e38('0x3f')](_0x6e38('0x7e'),_0x5bd8e3[_0x6e38('0x79')][_0x6e38('0x7a')]())[_0x6e38('0x3f')](_0x6e38('0x7f'))[_0x6e38('0x3f')](_0x6e38('0x80'),squel[_0x6e38('0x77')]()[_0x6e38('0x78')](_0x6e38('0x81'))['from']('cm_hopper_final')[_0x6e38('0x3f')](_0x6e38('0x82'),_0xa8f246['params']['id'][_0x6e38('0x7a')]()))[_0x6e38('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel[_0x6e38('0x77')]()[_0x6e38('0x78')]('COALESCE(phone,\x27\x27)')[_0x6e38('0x7b')](_0x6e38('0x83'))[_0x6e38('0x3f')](_0x6e38('0x82'),_0xa8f246['params']['id']['toString']())))[_0x6e38('0x7a')]();break;case'onlyIfOpen':_0x1d2136=squel['insert']()[_0x6e38('0x71')](_0x6e38('0x83'))[_0x6e38('0x72')]([_0x6e38('0x73'),_0x6e38('0x74'),_0x6e38('0x75'),_0x6e38('0x76'),_0x6e38('0x60'),'createdAt','updatedAt'],squel[_0x6e38('0x77')]()[_0x6e38('0x78')](_0x6e38('0x73'),_0x6e38('0x73'))[_0x6e38('0x78')]('NOW()',_0x6e38('0x74'))[_0x6e38('0x78')]('id',_0x6e38('0x75'))['field'](_0x5bd8e3[_0x6e38('0x79')]['toString'](),_0x6e38('0x76'))['field'](_0xa8f246[_0x6e38('0x4b')]['id'][_0x6e38('0x7a')](),_0x6e38('0x60'))[_0x6e38('0x78')]('\x27'+_0x3e322f+'\x27','createdAt')['field']('\x27'+_0x3e322f+'\x27',_0x6e38('0x59'))[_0x6e38('0x7b')](_0x6e38('0x7c'))['where'](_0x6e38('0x7d'))[_0x6e38('0x3f')](_0x6e38('0x7e'),_0x5bd8e3['CmListId'][_0x6e38('0x7a')]())[_0x6e38('0x3f')](_0x6e38('0x7f'))[_0x6e38('0x3f')](_0x6e38('0x80'),squel[_0x6e38('0x77')]()['field'](_0x6e38('0x84'))['from'](_0x6e38('0x83'))[_0x6e38('0x3f')](_0x6e38('0x82'),_0xa8f246[_0x6e38('0x4b')]['id'][_0x6e38('0x7a')]())))[_0x6e38('0x7a')]();break;default:_0x1d2136=squel[_0x6e38('0x85')]()[_0x6e38('0x71')](_0x6e38('0x83'))[_0x6e38('0x72')](['phone','scheduledAt',_0x6e38('0x75'),'ListId',_0x6e38('0x60'),_0x6e38('0x5a'),_0x6e38('0x59')],squel['select']()[_0x6e38('0x78')]('phone',_0x6e38('0x73'))['field'](_0x6e38('0x86'),_0x6e38('0x74'))[_0x6e38('0x78')]('id','ContactId')[_0x6e38('0x78')](_0x5bd8e3[_0x6e38('0x79')][_0x6e38('0x7a')](),'ListId')[_0x6e38('0x78')](_0xa8f246['params']['id'][_0x6e38('0x7a')](),_0x6e38('0x60'))['field']('\x27'+_0x3e322f+'\x27',_0x6e38('0x5a'))[_0x6e38('0x78')]('\x27'+_0x3e322f+'\x27',_0x6e38('0x59'))[_0x6e38('0x7b')](_0x6e38('0x7c'))[_0x6e38('0x3f')](_0x6e38('0x7d'))[_0x6e38('0x3f')](_0x6e38('0x7e'),_0x5bd8e3['CmListId']['toString']())['where'](_0x6e38('0x7f')))[_0x6e38('0x7a')]();}_0xa60d1c=squel[_0x6e38('0x85')]()['into'](_0x6e38('0x87'))[_0x6e38('0x72')]([_0x6e38('0x88'),_0x6e38('0x74'),'phone',_0x6e38('0x89'),_0x6e38('0x5a'),'updatedAt'],squel['select']()['field'](_0x6e38('0x8a'),'id')[_0x6e38('0x78')](_0x6e38('0x86'),_0x6e38('0x74'))['field'](_0x6e38('0x8b'),_0x6e38('0x73'))[_0x6e38('0x78')](_0x6e38('0x8c'),_0x6e38('0x89'))[_0x6e38('0x78')]('\x27'+_0x3e322f+'\x27',_0x6e38('0x5a'))['field']('\x27'+_0x3e322f+'\x27',_0x6e38('0x59'))[_0x6e38('0x7b')](_0x6e38('0x8d'),'ci')['join'](_0x6e38('0x83'),'h',_0x6e38('0x8e'))[_0x6e38('0x3f')](_0x6e38('0x8f'),_0x5bd8e3['CmListId'][_0x6e38('0x7a')]())[_0x6e38('0x3f')](_0x6e38('0x90'),_0xa8f246['params']['id']['toString']())['where'](_0x6e38('0x91'),_0x3e322f))[_0x6e38('0x7a')]();_0x2c28c0[_0x6e38('0x92')](db[_0x6e38('0x93')][_0x6e38('0x34')](_0x1d2136));_0x1e2fa1[_0x6e38('0x92')](db[_0x6e38('0x93')]['query'](_0xa60d1c));}return BPromise['all'](_0x2c28c0);}})[_0x6e38('0x29')](function(){return BPromise[_0x6e38('0x94')](_0x1e2fa1);})[_0x6e38('0x29')](function(){return _0x194e66;})[_0x6e38('0x29')](respondWithResult(_0x436475,null))[_0x6e38('0x49')](handleError(_0x436475,null));};exports[_0x6e38('0x95')]=function(_0x14e306,_0x228fac,_0x424a86){return db['Campaign'][_0x6e38('0x57')]({'where':{'id':_0x14e306[_0x6e38('0x4b')]['id']}})[_0x6e38('0x29')](handleEntityNotFound(_0x228fac,null))['then'](function(_0x349332){if(_0x349332){return _0x349332[_0x6e38('0x95')](_0x14e306[_0x6e38('0x34')]['ids']);}})['then'](function(_0x1eaaab){if(_0x1eaaab){return db['CmHopper'][_0x6e38('0x5c')]({'where':{'ListId':_0x14e306[_0x6e38('0x34')][_0x6e38('0x6d')],'CampaignId':_0x14e306[_0x6e38('0x4b')]['id']}})[_0x6e38('0x29')](function(){return _0x1eaaab;});}})[_0x6e38('0x29')](respondWithStatusCode(_0x228fac,null))['catch'](handleError(_0x228fac,null));};exports[_0x6e38('0x96')]=function(_0x5071bd,_0xc434af,_0x1c74f9){var _0xc326b8={};var _0x3d2426={};var _0x54af9b;var _0x11f129;return db['Campaign']['findOne']({'where':{'id':_0x5071bd[_0x6e38('0x4b')]['id']}})[_0x6e38('0x29')](handleEntityNotFound(_0xc434af,null))[_0x6e38('0x29')](function(_0x470b0d){if(_0x470b0d){_0x54af9b=_0x470b0d;_0x3d2426[_0x6e38('0x33')]=_['keys'](db[_0x6e38('0x69')][_0x6e38('0x30')]);_0x3d2426[_0x6e38('0x34')]=_[_0x6e38('0x35')](_0x5071bd['query']);_0x3d2426[_0x6e38('0x36')]=_[_0x6e38('0x37')](_0x3d2426['model'],_0x3d2426[_0x6e38('0x34')]);_0xc326b8[_0x6e38('0x39')]=_[_0x6e38('0x37')](_0x3d2426[_0x6e38('0x33')],qs[_0x6e38('0x38')](_0x5071bd[_0x6e38('0x34')][_0x6e38('0x38')]));_0xc326b8[_0x6e38('0x39')]=_0xc326b8[_0x6e38('0x39')]['length']?_0xc326b8['attributes']:_0x3d2426[_0x6e38('0x33')];_0xc326b8[_0x6e38('0x3c')]=qs['sort'](_0x5071bd[_0x6e38('0x34')]['sort']);_0xc326b8[_0x6e38('0x3f')]=qs[_0x6e38('0x36')](_[_0x6e38('0x3e')](_0x5071bd[_0x6e38('0x34')],_0x3d2426[_0x6e38('0x36')]));if(_0x5071bd['query']['filter']){_0xc326b8[_0x6e38('0x3f')]=_[_0x6e38('0x43')](_0xc326b8['where'],{'$or':_['map'](_0xc326b8[_0x6e38('0x39')],function(_0x37b021){var _0x3d5d34={};_0x3d5d34[_0x37b021]={'$like':'%'+_0x5071bd[_0x6e38('0x34')]['filter']+'%'};return _0x3d5d34;})});}_0xc326b8=_[_0x6e38('0x43')]({},_0xc326b8,_0x5071bd[_0x6e38('0x44')]);return _0x54af9b[_0x6e38('0x96')](_0xc326b8);}})[_0x6e38('0x29')](function(_0x23ca84){if(_0x23ca84){_0x11f129=_0x23ca84[_0x6e38('0x3a')];if(!_0x5071bd['query'][_0x6e38('0x5f')]('nolimit')){_0xc326b8[_0x6e38('0x21')]=qs[_0x6e38('0x21')](_0x5071bd['query'][_0x6e38('0x21')]);_0xc326b8[_0x6e38('0x1f')]=qs[_0x6e38('0x1f')](_0x5071bd[_0x6e38('0x34')][_0x6e38('0x1f')]);}return _0x54af9b[_0x6e38('0x96')](_0xc326b8);}})[_0x6e38('0x29')](function(_0x24e76c){if(_0x24e76c){return _0x24e76c?{'count':_0x11f129,'rows':_0x24e76c}:null;}})['then'](respondWithResult(_0xc434af,null))[_0x6e38('0x49')](handleError(_0xc434af,null));};exports[_0x6e38('0x97')]=function(_0x4eb598,_0x9d474a,_0x3b0ae4){var _0x5b86ba,_0x3c9a4e;var _0x194a6c=[];var _0x48e8e0=moment()['format'](_0x6e38('0x6c'));return db[_0x6e38('0x4c')][_0x6e38('0x57')]({'where':{'id':_0x4eb598[_0x6e38('0x4b')]['id']}})['then'](handleEntityNotFound(_0x9d474a,null))[_0x6e38('0x29')](function(_0xbb26a5){if(_0xbb26a5){_0x3c9a4e=_0xbb26a5;return _0xbb26a5['addBlackLists'](_0x4eb598['body']['ids'],_[_0x6e38('0x58')](_0x4eb598[_0x6e38('0x4e')],['ids','id'])||{});}return null;})['spread'](function(_0xd31189){var _0x449b6f;var _0x43ac68;_0x5b86ba=_0xd31189||[];var _0x19a1b4=[];if(_0xd31189){for(var _0x58fc18=0x0;_0x58fc18<_0xd31189[_0x6e38('0x3a')];_0x58fc18+=0x1){var _0x44bd6e=_0xd31189[_0x58fc18][_0x6e38('0x2a')]({'plain':!![]});_0x449b6f=squel[_0x6e38('0x85')]()[_0x6e38('0x71')](_0x6e38('0x98'))[_0x6e38('0x72')]([_0x6e38('0x73'),_0x6e38('0x75'),_0x6e38('0x76'),_0x6e38('0x60'),'createdAt','updatedAt'],squel[_0x6e38('0x77')]()[_0x6e38('0x78')](_0x6e38('0x73'),'phone')[_0x6e38('0x78')]('id',_0x6e38('0x75'))[_0x6e38('0x78')](_0x44bd6e[_0x6e38('0x79')][_0x6e38('0x7a')](),_0x6e38('0x76'))[_0x6e38('0x78')](_0x4eb598[_0x6e38('0x4b')]['id'][_0x6e38('0x7a')](),_0x6e38('0x60'))[_0x6e38('0x78')](_0x6e38('0x86'),'createdAt')[_0x6e38('0x78')](_0x6e38('0x86'),_0x6e38('0x59'))[_0x6e38('0x7b')](_0x6e38('0x7c'))[_0x6e38('0x3f')](_0x6e38('0x7d'))[_0x6e38('0x3f')](_0x6e38('0x7e'),_0x44bd6e[_0x6e38('0x79')][_0x6e38('0x7a')]())[_0x6e38('0x3f')](_0x6e38('0x7f')))[_0x6e38('0x7a')]();_0x19a1b4[_0x6e38('0x92')](db['sequelize'][_0x6e38('0x34')](_0x449b6f));}return BPromise[_0x6e38('0x94')](_0x19a1b4);}})[_0x6e38('0x29')](function(){return _0x5b86ba;})['then'](respondWithResult(_0x9d474a,null))[_0x6e38('0x49')](handleError(_0x9d474a,null));};exports[_0x6e38('0x99')]=function(_0x2419e9,_0x254614,_0x19cdfb){return db[_0x6e38('0x4c')][_0x6e38('0x57')]({'where':{'id':_0x2419e9[_0x6e38('0x4b')]['id']}})[_0x6e38('0x29')](handleEntityNotFound(_0x254614,null))['then'](function(_0x586e93){if(_0x586e93){return _0x586e93[_0x6e38('0x99')](_0x2419e9[_0x6e38('0x34')][_0x6e38('0x6d')]);}})[_0x6e38('0x29')](function(_0x2ce514){if(_0x2ce514){return db[_0x6e38('0x67')][_0x6e38('0x5c')]({'where':{'ListId':_0x2419e9[_0x6e38('0x34')]['ids'],'CampaignId':_0x2419e9[_0x6e38('0x4b')]['id']}})[_0x6e38('0x29')](function(){return _0x2ce514;});}})[_0x6e38('0x29')](respondWithStatusCode(_0x254614,null))[_0x6e38('0x49')](handleError(_0x254614,null));}; \ No newline at end of file +var _0xb226=['zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','get','UserProfileResource','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','intersection','fields','attributes','hasOwnProperty','order','sort','filters','pick','merge','where','VIRTUAL','filter','options','Campaign','includeAll','include','findAll','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','destroy','getHoppers','findOne','nolimit','CmHopper','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CampaignId','getLists','CmList','addLists','format','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','phone','scheduledAt','ContactId','ListId','select','field','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','insert','fromQuery','ListId\x20=\x20?','OrderBy','h.id','NOW()','ci.item','ci.OrderBY','join','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','cm_hopper_black','removeBlackLists','eml-format','rimraf'];(function(_0x3b4c39,_0x264c16){var _0x1d3fe1=function(_0x3a9664){while(--_0x3a9664){_0x3b4c39['push'](_0x3b4c39['shift']());}};_0x1d3fe1(++_0x264c16);}(_0xb226,0x11c));var _0x6b22=function(_0xab567d,_0x1874c0){_0xab567d=_0xab567d-0x0;var _0x144513=_0xb226[_0xab567d];return _0x144513;};'use strict';var emlformat=require(_0x6b22('0x0'));var rimraf=require(_0x6b22('0x1'));var zipdir=require(_0x6b22('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6b22('0x3'));var moment=require('moment');var BPromise=require(_0x6b22('0x4'));var Mustache=require(_0x6b22('0x5'));var util=require(_0x6b22('0x6'));var path=require(_0x6b22('0x7'));var sox=require('sox');var csv=require(_0x6b22('0x8'));var ejs=require(_0x6b22('0x9'));var fs=require('fs');var fs_extra=require(_0x6b22('0xa'));var _=require(_0x6b22('0xb'));var squel=require(_0x6b22('0xc'));var crypto=require(_0x6b22('0xd'));var jsforce=require(_0x6b22('0xe'));var deskjs=require(_0x6b22('0xf'));var toCsv=require(_0x6b22('0x8'));var querystring=require(_0x6b22('0x10'));var Papa=require('papaparse');var Redis=require(_0x6b22('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x6b22('0x12'));var as=require(_0x6b22('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6b22('0x14'))('api');var utils=require(_0x6b22('0x15'));var config=require(_0x6b22('0x16'));var licenseUtil=require(_0x6b22('0x17'));var db=require(_0x6b22('0x18'))['db'];function respondWithStatusCode(_0x1d3e25,_0x2ad007){_0x2ad007=_0x2ad007||0xcc;return function(_0xe26e19){if(_0xe26e19){return _0x1d3e25[_0x6b22('0x19')](_0x2ad007);}return _0x1d3e25[_0x6b22('0x1a')](_0x2ad007)[_0x6b22('0x1b')]();};}function respondWithResult(_0x145c00,_0x5d08cb){_0x5d08cb=_0x5d08cb||0xc8;return function(_0x2e6200){if(_0x2e6200){return _0x145c00[_0x6b22('0x1a')](_0x5d08cb)['json'](_0x2e6200);}};}function respondWithFilteredResult(_0x1119c0,_0x47f1e6){return function(_0x51de96){if(_0x51de96){var _0x4b9e43=typeof _0x47f1e6[_0x6b22('0x1c')]===_0x6b22('0x1d')&&typeof _0x47f1e6[_0x6b22('0x1e')]===_0x6b22('0x1d');var _0x4c1ab8=_0x51de96[_0x6b22('0x1f')];var _0x46210a=_0x4b9e43?0x0:_0x47f1e6[_0x6b22('0x1c')];var _0x3666d4=_0x4b9e43?_0x51de96[_0x6b22('0x1f')]:_0x47f1e6[_0x6b22('0x1c')]+_0x47f1e6[_0x6b22('0x1e')];var _0x8af7b4;if(_0x3666d4>=_0x4c1ab8){_0x3666d4=_0x4c1ab8;_0x8af7b4=0xc8;}else{_0x8af7b4=0xce;}_0x1119c0[_0x6b22('0x1a')](_0x8af7b4);return _0x1119c0[_0x6b22('0x20')](_0x6b22('0x21'),_0x46210a+'-'+_0x3666d4+'/'+_0x4c1ab8)['json'](_0x51de96);}return null;};}function patchUpdates(_0x80c585){return function(_0x15882c){try{jsonpatch[_0x6b22('0x22')](_0x15882c,_0x80c585,!![]);}catch(_0x20e2ef){return BPromise[_0x6b22('0x23')](_0x20e2ef);}return _0x15882c['save']();};}function saveUpdates(_0x406b55,_0x81eaeb){return function(_0x2c8022){if(_0x2c8022){return _0x2c8022[_0x6b22('0x24')](_0x406b55)[_0x6b22('0x25')](function(_0x1df743){return _0x1df743;});}return null;};}function removeEntity(_0x29657e,_0x50a54d){return function(_0x2e9984){if(_0x2e9984){return _0x2e9984['destroy']()[_0x6b22('0x25')](function(){var _0x5b31f9=_0x2e9984[_0x6b22('0x26')]({'plain':!![]});var _0x3220fb='IvrCampaigns';return db[_0x6b22('0x27')]['destroy']({'where':{'type':_0x3220fb,'resourceId':_0x5b31f9['id']}})[_0x6b22('0x25')](function(){return _0x2e9984;});})[_0x6b22('0x25')](function(){_0x29657e['status'](0xcc)[_0x6b22('0x1b')]();});}};}function handleEntityNotFound(_0xa34588,_0xaa3c39){return function(_0x43dd3b){if(!_0x43dd3b){_0xa34588['sendStatus'](0x194);}return _0x43dd3b;};}function handleError(_0x4ebc70,_0x4cc9d1){_0x4cc9d1=_0x4cc9d1||0x1f4;return function(_0x5e6cd4){logger['error'](_0x5e6cd4['stack']);if(_0x5e6cd4['name']){delete _0x5e6cd4[_0x6b22('0x28')];}_0x4ebc70[_0x6b22('0x1a')](_0x4cc9d1)[_0x6b22('0x29')](_0x5e6cd4);};}exports[_0x6b22('0x2a')]=function(_0xdf32ca,_0x29568c){var _0xf5c953={},_0x509bbd={},_0x3a0070={'count':0x0,'rows':[]};var _0x339752=_[_0x6b22('0x2b')](db['Campaign'][_0x6b22('0x2c')],function(_0x2da62b){return{'name':_0x2da62b[_0x6b22('0x2d')],'type':_0x2da62b[_0x6b22('0x2e')]['key']};});_0x509bbd[_0x6b22('0x2f')]=_[_0x6b22('0x2b')](_0x339752,'name');_0x509bbd['query']=_[_0x6b22('0x30')](_0xdf32ca[_0x6b22('0x31')]);_0x509bbd['filters']=_[_0x6b22('0x32')](_0x509bbd[_0x6b22('0x2f')],_0x509bbd[_0x6b22('0x31')]);_0xf5c953['attributes']=_[_0x6b22('0x32')](_0x509bbd[_0x6b22('0x2f')],qs[_0x6b22('0x33')](_0xdf32ca[_0x6b22('0x31')][_0x6b22('0x33')]));_0xf5c953[_0x6b22('0x34')]=_0xf5c953[_0x6b22('0x34')]['length']?_0xf5c953[_0x6b22('0x34')]:_0x509bbd['model'];if(!_0xdf32ca[_0x6b22('0x31')][_0x6b22('0x35')]('nolimit')){_0xf5c953['limit']=qs[_0x6b22('0x1e')](_0xdf32ca['query'][_0x6b22('0x1e')]);_0xf5c953[_0x6b22('0x1c')]=qs[_0x6b22('0x1c')](_0xdf32ca[_0x6b22('0x31')]['offset']);}_0xf5c953[_0x6b22('0x36')]=qs[_0x6b22('0x37')](_0xdf32ca[_0x6b22('0x31')][_0x6b22('0x37')]);_0xf5c953['where']=qs[_0x6b22('0x38')](_[_0x6b22('0x39')](_0xdf32ca[_0x6b22('0x31')],_0x509bbd['filters']),_0x339752);if(_0xdf32ca[_0x6b22('0x31')]['filter']){_0xf5c953['where']=_[_0x6b22('0x3a')](_0xf5c953[_0x6b22('0x3b')],{'$or':_['map'](_0x339752,function(_0x272967){if(_0x272967[_0x6b22('0x2e')]!==_0x6b22('0x3c')){var _0x162840={};_0x162840[_0x272967[_0x6b22('0x28')]]={'$like':'%'+_0xdf32ca[_0x6b22('0x31')][_0x6b22('0x3d')]+'%'};return _0x162840;}})});}_0xf5c953=_[_0x6b22('0x3a')]({},_0xf5c953,_0xdf32ca[_0x6b22('0x3e')]);var _0x4c99fa={'where':_0xf5c953[_0x6b22('0x3b')]};return db[_0x6b22('0x3f')][_0x6b22('0x1f')](_0x4c99fa)['then'](function(_0x1e937f){_0x3a0070['count']=_0x1e937f;if(_0xdf32ca['query'][_0x6b22('0x40')]){_0xf5c953[_0x6b22('0x41')]=[{'all':!![]}];}return db[_0x6b22('0x3f')][_0x6b22('0x42')](_0xf5c953);})[_0x6b22('0x25')](function(_0x17b647){_0x3a0070['rows']=_0x17b647;return _0x3a0070;})[_0x6b22('0x25')](respondWithFilteredResult(_0x29568c,_0xf5c953))[_0x6b22('0x43')](handleError(_0x29568c,null));};exports[_0x6b22('0x44')]=function(_0x1e950b,_0x29fb5a){var _0x1dfbf0={'raw':![],'where':{'id':_0x1e950b[_0x6b22('0x45')]['id']}},_0xbacda7={};_0xbacda7[_0x6b22('0x2f')]=_[_0x6b22('0x30')](db[_0x6b22('0x3f')][_0x6b22('0x2c')]);_0xbacda7['query']=_[_0x6b22('0x30')](_0x1e950b[_0x6b22('0x31')]);_0xbacda7[_0x6b22('0x38')]=_[_0x6b22('0x32')](_0xbacda7[_0x6b22('0x2f')],_0xbacda7[_0x6b22('0x31')]);_0x1dfbf0[_0x6b22('0x34')]=_[_0x6b22('0x32')](_0xbacda7[_0x6b22('0x2f')],qs['fields'](_0x1e950b['query']['fields']));_0x1dfbf0[_0x6b22('0x34')]=_0x1dfbf0[_0x6b22('0x34')][_0x6b22('0x46')]?_0x1dfbf0['attributes']:_0xbacda7[_0x6b22('0x2f')];if(_0x1e950b[_0x6b22('0x31')][_0x6b22('0x40')]){_0x1dfbf0[_0x6b22('0x41')]=[{'all':!![]}];}_0x1dfbf0=_['merge']({},_0x1dfbf0,_0x1e950b[_0x6b22('0x3e')]);return db[_0x6b22('0x3f')][_0x6b22('0x47')](_0x1dfbf0)['then'](handleEntityNotFound(_0x29fb5a,null))[_0x6b22('0x25')](respondWithResult(_0x29fb5a,null))[_0x6b22('0x43')](handleError(_0x29fb5a,null));};exports[_0x6b22('0x48')]=function(_0x52ab18,_0x3bc72c){return db[_0x6b22('0x3f')][_0x6b22('0x48')](_0x52ab18[_0x6b22('0x49')],{})['then'](function(_0x4291db){var _0x46aa98=_0x52ab18[_0x6b22('0x4a')]['get']({'plain':!![]});if(!_0x46aa98)throw new Error(_0x6b22('0x4b'));if(_0x46aa98['role']===_0x6b22('0x4a')){var _0xf23059=_0x4291db[_0x6b22('0x26')]({'plain':!![]});var _0x55949c='IvrCampaigns';return db[_0x6b22('0x4c')][_0x6b22('0x47')]({'where':{'name':_0x55949c,'userProfileId':_0x46aa98[_0x6b22('0x4d')]},'raw':!![]})[_0x6b22('0x25')](function(_0x115c33){if(_0x115c33&&_0x115c33[_0x6b22('0x4e')]===0x0){return db[_0x6b22('0x27')][_0x6b22('0x48')]({'name':_0xf23059[_0x6b22('0x28')],'resourceId':_0xf23059['id'],'type':_0x115c33[_0x6b22('0x28')],'sectionId':_0x115c33['id']},{})[_0x6b22('0x25')](function(){return _0x4291db;});}else{return _0x4291db;}})[_0x6b22('0x43')](function(_0x5c5588){logger[_0x6b22('0x4f')](_0x6b22('0x50'),_0x5c5588);throw _0x5c5588;});}return _0x4291db;})[_0x6b22('0x25')](respondWithResult(_0x3bc72c,0xc9))[_0x6b22('0x43')](handleError(_0x3bc72c,null));};exports[_0x6b22('0x51')]=function(_0x47b58f,_0x9ec569){var _0x1391c2={'where':{'id':_0x47b58f[_0x6b22('0x45')]['id']}},_0x3c626b={};_0x3c626b[_0x6b22('0x2f')]=_[_0x6b22('0x30')](db[_0x6b22('0x3f')]['rawAttributes']);_0x1391c2['attributes']=_['intersection'](_0x3c626b['model'],qs[_0x6b22('0x33')](_0x47b58f[_0x6b22('0x31')][_0x6b22('0x33')]));_0x1391c2['attributes']=_0x1391c2['attributes'][_0x6b22('0x46')]?_0x1391c2[_0x6b22('0x34')]:_0x3c626b['model'];if(_0x47b58f[_0x6b22('0x31')][_0x6b22('0x40')]){_0x1391c2['include']=[{'all':!![]}];}_0x1391c2=_['merge']({},_0x1391c2,_0x47b58f[_0x6b22('0x3e')]);return db[_0x6b22('0x3f')][_0x6b22('0x47')](_0x1391c2)[_0x6b22('0x25')](handleEntityNotFound(_0x9ec569,null))[_0x6b22('0x25')](function(_0x54fba9){if(_0x54fba9){var _0x5a8bcb=_0x54fba9[_0x6b22('0x26')]({'plain':!![]});_0x5a8bcb=qs[_0x6b22('0x52')](_0x5a8bcb,['id',_0x6b22('0x53'),'updatedAt']);_0x47b58f[_0x6b22('0x49')]=_[_0x6b22('0x52')](_0x47b58f[_0x6b22('0x49')],['id',_0x6b22('0x53'),_0x6b22('0x54')]);return db['Campaign'][_0x6b22('0x48')](_[_0x6b22('0x3a')](_0x5a8bcb,_0x47b58f[_0x6b22('0x49')]),{'include':_0x47b58f[_0x6b22('0x31')]['includeAll']?[{'all':!![]}]:undefined})[_0x6b22('0x25')](function(_0x3d14f7){var _0x4c16dd=_0x47b58f[_0x6b22('0x4a')][_0x6b22('0x26')]({'plain':!![]});if(!_0x4c16dd)throw new Error(_0x6b22('0x4b'));if(_0x4c16dd['role']===_0x6b22('0x4a')){var _0x11d181=_0x3d14f7[_0x6b22('0x26')]({'plain':!![]});var _0x1143cc='IvrCampaigns';return db['UserProfileSection'][_0x6b22('0x47')]({'where':{'name':_0x1143cc,'userProfileId':_0x4c16dd[_0x6b22('0x4d')]},'raw':!![]})[_0x6b22('0x25')](function(_0x5c3533){if(_0x5c3533&&_0x5c3533[_0x6b22('0x4e')]===0x0){return db['UserProfileResource'][_0x6b22('0x48')]({'name':_0x11d181['name'],'resourceId':_0x11d181['id'],'type':_0x5c3533[_0x6b22('0x28')],'sectionId':_0x5c3533['id']},{})[_0x6b22('0x25')](function(){return _0x3d14f7;});}else{return _0x3d14f7;}})[_0x6b22('0x43')](function(_0x2e926b){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e926b);throw _0x2e926b;});}return _0x3d14f7;});}})[_0x6b22('0x25')](respondWithResult(_0x9ec569,0xc9))['catch'](handleError(_0x9ec569,null));};exports[_0x6b22('0x24')]=function(_0x54fcb9,_0x1c6a3b){if(_0x54fcb9[_0x6b22('0x49')]['id']){delete _0x54fcb9[_0x6b22('0x49')]['id'];}return db['Campaign'][_0x6b22('0x47')]({'where':{'id':_0x54fcb9[_0x6b22('0x45')]['id']}})[_0x6b22('0x25')](handleEntityNotFound(_0x1c6a3b,null))[_0x6b22('0x25')](saveUpdates(_0x54fcb9['body'],null))[_0x6b22('0x25')](respondWithResult(_0x1c6a3b,null))['catch'](handleError(_0x1c6a3b,null));};exports[_0x6b22('0x55')]=function(_0x149ad2,_0x20d36a){return db['Campaign'][_0x6b22('0x47')]({'where':{'id':_0x149ad2[_0x6b22('0x45')]['id']}})[_0x6b22('0x25')](handleEntityNotFound(_0x20d36a,null))[_0x6b22('0x25')](removeEntity(_0x20d36a,null))[_0x6b22('0x43')](handleError(_0x20d36a,null));};exports[_0x6b22('0x56')]=function(_0x1a4f5c,_0x53f532,_0x4b0e27){var _0x51a45f={'raw':!![],'where':{}};var _0x3a7b95={};var _0x41bbfd={'count':0x0,'rows':[]};return db[_0x6b22('0x3f')][_0x6b22('0x57')]({'where':{'id':_0x1a4f5c[_0x6b22('0x45')]['id']}})[_0x6b22('0x25')](handleEntityNotFound(_0x53f532,null))['then'](function(_0x2d79b4){if(_0x2d79b4){_0x3a7b95[_0x6b22('0x2f')]=_[_0x6b22('0x30')](db['CmHopper'][_0x6b22('0x2c')]);_0x3a7b95['query']=_[_0x6b22('0x30')](_0x1a4f5c[_0x6b22('0x31')]);_0x3a7b95['filters']=_[_0x6b22('0x32')](_0x3a7b95[_0x6b22('0x2f')],_0x3a7b95[_0x6b22('0x31')]);_0x51a45f[_0x6b22('0x34')]=_[_0x6b22('0x32')](_0x3a7b95[_0x6b22('0x2f')],qs['fields'](_0x1a4f5c['query'][_0x6b22('0x33')]));_0x51a45f[_0x6b22('0x34')]=_0x51a45f[_0x6b22('0x34')][_0x6b22('0x46')]?_0x51a45f[_0x6b22('0x34')]:_0x3a7b95[_0x6b22('0x2f')];if(!_0x1a4f5c[_0x6b22('0x31')][_0x6b22('0x35')](_0x6b22('0x58'))){_0x51a45f[_0x6b22('0x1e')]=qs[_0x6b22('0x1e')](_0x1a4f5c[_0x6b22('0x31')][_0x6b22('0x1e')]);_0x51a45f[_0x6b22('0x1c')]=qs[_0x6b22('0x1c')](_0x1a4f5c['query'][_0x6b22('0x1c')]);}_0x51a45f[_0x6b22('0x36')]=qs[_0x6b22('0x37')](_0x1a4f5c[_0x6b22('0x31')][_0x6b22('0x37')]);_0x51a45f[_0x6b22('0x3b')]=qs[_0x6b22('0x38')](_[_0x6b22('0x39')](_0x1a4f5c['query'],_0x3a7b95[_0x6b22('0x38')]));_0x51a45f[_0x6b22('0x3b')]['CampaignId']=_0x2d79b4['id'];if(_0x1a4f5c[_0x6b22('0x31')][_0x6b22('0x3d')]){_0x51a45f[_0x6b22('0x3b')]=_[_0x6b22('0x3a')](_0x51a45f[_0x6b22('0x3b')],{'$or':_[_0x6b22('0x2b')](_0x51a45f[_0x6b22('0x34')],function(_0x5157eb){var _0x4100dd={};_0x4100dd[_0x5157eb]={'$like':'%'+_0x1a4f5c[_0x6b22('0x31')][_0x6b22('0x3d')]+'%'};return _0x4100dd;})});}_0x51a45f=_[_0x6b22('0x3a')]({},_0x51a45f,_0x1a4f5c[_0x6b22('0x3e')]);return db[_0x6b22('0x59')][_0x6b22('0x1f')]({'where':_0x51a45f[_0x6b22('0x3b')]})['then'](function(_0x4656f0){_0x41bbfd[_0x6b22('0x1f')]=_0x4656f0;if(_0x1a4f5c[_0x6b22('0x31')][_0x6b22('0x40')]){_0x51a45f[_0x6b22('0x41')]=[{'all':!![]}];}return db[_0x6b22('0x59')][_0x6b22('0x42')](_0x51a45f);})['then'](function(_0x9ef97f){_0x41bbfd[_0x6b22('0x5a')]=_0x9ef97f;return _0x41bbfd;});}})[_0x6b22('0x25')](respondWithFilteredResult(_0x53f532,_0x51a45f))[_0x6b22('0x43')](handleError(_0x53f532,null));};exports[_0x6b22('0x5b')]=function(_0x52703c,_0x19ce26,_0x5e2d9e){var _0x115238={'raw':!![],'where':{}};var _0x5698b2={};var _0x3de7c7={'count':0x0,'rows':[]};return db['Campaign'][_0x6b22('0x57')]({'where':{'id':_0x52703c[_0x6b22('0x45')]['id']}})[_0x6b22('0x25')](handleEntityNotFound(_0x19ce26,null))[_0x6b22('0x25')](function(_0x2b7930){if(_0x2b7930){_0x5698b2[_0x6b22('0x2f')]=_['keys'](db[_0x6b22('0x5c')][_0x6b22('0x2c')]);_0x5698b2[_0x6b22('0x31')]=_[_0x6b22('0x30')](_0x52703c[_0x6b22('0x31')]);_0x5698b2[_0x6b22('0x38')]=_['intersection'](_0x5698b2[_0x6b22('0x2f')],_0x5698b2['query']);_0x115238[_0x6b22('0x34')]=_['intersection'](_0x5698b2[_0x6b22('0x2f')],qs['fields'](_0x52703c['query']['fields']));_0x115238[_0x6b22('0x34')]=_0x115238[_0x6b22('0x34')][_0x6b22('0x46')]?_0x115238[_0x6b22('0x34')]:_0x5698b2[_0x6b22('0x2f')];if(!_0x52703c[_0x6b22('0x31')][_0x6b22('0x35')]('nolimit')){_0x115238[_0x6b22('0x1e')]=qs['limit'](_0x52703c[_0x6b22('0x31')][_0x6b22('0x1e')]);_0x115238[_0x6b22('0x1c')]=qs[_0x6b22('0x1c')](_0x52703c[_0x6b22('0x31')]['offset']);}_0x115238[_0x6b22('0x36')]=qs[_0x6b22('0x37')](_0x52703c['query'][_0x6b22('0x37')]);_0x115238[_0x6b22('0x3b')]=qs[_0x6b22('0x38')](_['pick'](_0x52703c[_0x6b22('0x31')],_0x5698b2[_0x6b22('0x38')]));_0x115238[_0x6b22('0x3b')]['CampaignId']=_0x2b7930['id'];if(_0x52703c[_0x6b22('0x31')][_0x6b22('0x3d')]){_0x115238[_0x6b22('0x3b')]=_[_0x6b22('0x3a')](_0x115238[_0x6b22('0x3b')],{'$or':_[_0x6b22('0x2b')](_0x115238[_0x6b22('0x34')],function(_0xac1035){var _0x491948={};_0x491948[_0xac1035]={'$like':'%'+_0x52703c[_0x6b22('0x31')][_0x6b22('0x3d')]+'%'};return _0x491948;})});}_0x115238=_[_0x6b22('0x3a')]({},_0x115238,_0x52703c['options']);return db[_0x6b22('0x5c')][_0x6b22('0x1f')]({'where':_0x115238[_0x6b22('0x3b')]})['then'](function(_0x161b81){_0x3de7c7[_0x6b22('0x1f')]=_0x161b81;if(_0x52703c[_0x6b22('0x31')][_0x6b22('0x40')]){_0x115238[_0x6b22('0x41')]=[{'all':!![]}];}return db[_0x6b22('0x5c')][_0x6b22('0x42')](_0x115238);})[_0x6b22('0x25')](function(_0x21268a){_0x3de7c7[_0x6b22('0x5a')]=_0x21268a;return _0x3de7c7;});}})[_0x6b22('0x25')](respondWithFilteredResult(_0x19ce26,_0x115238))['catch'](handleError(_0x19ce26,null));};exports[_0x6b22('0x5d')]=function(_0x275086,_0x17223e,_0x2176b0){var _0x5cf4dc={'raw':!![],'where':{}};var _0x257576={};var _0x2b2319={'count':0x0,'rows':[]};return db[_0x6b22('0x3f')][_0x6b22('0x57')]({'where':{'id':_0x275086[_0x6b22('0x45')]['id']}})[_0x6b22('0x25')](handleEntityNotFound(_0x17223e,null))[_0x6b22('0x25')](function(_0x180ec7){if(_0x180ec7){_0x257576[_0x6b22('0x2f')]=_[_0x6b22('0x30')](db[_0x6b22('0x5e')][_0x6b22('0x2c')]);_0x257576['query']=_[_0x6b22('0x30')](_0x275086[_0x6b22('0x31')]);_0x257576[_0x6b22('0x38')]=_['intersection'](_0x257576[_0x6b22('0x2f')],_0x257576[_0x6b22('0x31')]);_0x5cf4dc[_0x6b22('0x34')]=_[_0x6b22('0x32')](_0x257576[_0x6b22('0x2f')],qs[_0x6b22('0x33')](_0x275086[_0x6b22('0x31')][_0x6b22('0x33')]));_0x5cf4dc[_0x6b22('0x34')]=_0x5cf4dc[_0x6b22('0x34')][_0x6b22('0x46')]?_0x5cf4dc['attributes']:_0x257576[_0x6b22('0x2f')];if(!_0x275086[_0x6b22('0x31')][_0x6b22('0x35')](_0x6b22('0x58'))){_0x5cf4dc[_0x6b22('0x1e')]=qs[_0x6b22('0x1e')](_0x275086['query']['limit']);_0x5cf4dc[_0x6b22('0x1c')]=qs[_0x6b22('0x1c')](_0x275086[_0x6b22('0x31')][_0x6b22('0x1c')]);}_0x5cf4dc[_0x6b22('0x36')]=qs[_0x6b22('0x37')](_0x275086[_0x6b22('0x31')][_0x6b22('0x37')]);_0x5cf4dc['where']=qs[_0x6b22('0x38')](_[_0x6b22('0x39')](_0x275086['query'],_0x257576[_0x6b22('0x38')]));_0x5cf4dc[_0x6b22('0x3b')]['CampaignId']=_0x180ec7['id'];if(_0x275086[_0x6b22('0x31')]['filter']){_0x5cf4dc['where']=_[_0x6b22('0x3a')](_0x5cf4dc[_0x6b22('0x3b')],{'$or':_[_0x6b22('0x2b')](_0x5cf4dc[_0x6b22('0x34')],function(_0xea7953){var _0x567691={};_0x567691[_0xea7953]={'$like':'%'+_0x275086[_0x6b22('0x31')]['filter']+'%'};return _0x567691;})});}_0x5cf4dc=_[_0x6b22('0x3a')]({},_0x5cf4dc,_0x275086[_0x6b22('0x3e')]);return db[_0x6b22('0x5e')][_0x6b22('0x1f')]({'where':_0x5cf4dc['where']})[_0x6b22('0x25')](function(_0x16bf7c){_0x2b2319[_0x6b22('0x1f')]=_0x16bf7c;if(_0x275086[_0x6b22('0x31')][_0x6b22('0x40')]){_0x5cf4dc['include']=[{'all':!![]}];}return db[_0x6b22('0x5e')][_0x6b22('0x42')](_0x5cf4dc);})[_0x6b22('0x25')](function(_0x3d904a){_0x2b2319[_0x6b22('0x5a')]=_0x3d904a;return _0x2b2319;});}})['then'](respondWithFilteredResult(_0x17223e,_0x5cf4dc))[_0x6b22('0x43')](handleError(_0x17223e,null));};exports[_0x6b22('0x5f')]=function(_0x2337f2,_0x373ba1,_0x199224){var _0x417c0d={'raw':!![],'where':{}};var _0x3984b6={};var _0x2e3615={'count':0x0,'rows':[]};return db[_0x6b22('0x3f')]['findOne']({'where':{'id':_0x2337f2[_0x6b22('0x45')]['id']}})[_0x6b22('0x25')](handleEntityNotFound(_0x373ba1,null))[_0x6b22('0x25')](function(_0x16735f){if(_0x16735f){_0x3984b6[_0x6b22('0x2f')]=_[_0x6b22('0x30')](db[_0x6b22('0x60')]['rawAttributes']);_0x3984b6[_0x6b22('0x31')]=_[_0x6b22('0x30')](_0x2337f2['query']);_0x3984b6[_0x6b22('0x38')]=_[_0x6b22('0x32')](_0x3984b6[_0x6b22('0x2f')],_0x3984b6[_0x6b22('0x31')]);_0x417c0d[_0x6b22('0x34')]=_[_0x6b22('0x32')](_0x3984b6[_0x6b22('0x2f')],qs[_0x6b22('0x33')](_0x2337f2[_0x6b22('0x31')][_0x6b22('0x33')]));_0x417c0d[_0x6b22('0x34')]=_0x417c0d[_0x6b22('0x34')][_0x6b22('0x46')]?_0x417c0d[_0x6b22('0x34')]:_0x3984b6[_0x6b22('0x2f')];if(!_0x2337f2['query']['hasOwnProperty'](_0x6b22('0x58'))){_0x417c0d[_0x6b22('0x1e')]=qs[_0x6b22('0x1e')](_0x2337f2['query'][_0x6b22('0x1e')]);_0x417c0d['offset']=qs[_0x6b22('0x1c')](_0x2337f2[_0x6b22('0x31')][_0x6b22('0x1c')]);}_0x417c0d[_0x6b22('0x36')]=qs[_0x6b22('0x37')](_0x2337f2[_0x6b22('0x31')]['sort']);_0x417c0d[_0x6b22('0x3b')]=qs[_0x6b22('0x38')](_[_0x6b22('0x39')](_0x2337f2[_0x6b22('0x31')],_0x3984b6[_0x6b22('0x38')]));_0x417c0d[_0x6b22('0x3b')][_0x6b22('0x61')]=_0x16735f['id'];if(_0x2337f2[_0x6b22('0x31')][_0x6b22('0x3d')]){_0x417c0d[_0x6b22('0x3b')]=_[_0x6b22('0x3a')](_0x417c0d[_0x6b22('0x3b')],{'$or':_[_0x6b22('0x2b')](_0x417c0d[_0x6b22('0x34')],function(_0x327d03){var _0x325a9e={};_0x325a9e[_0x327d03]={'$like':'%'+_0x2337f2['query'][_0x6b22('0x3d')]+'%'};return _0x325a9e;})});}_0x417c0d=_[_0x6b22('0x3a')]({},_0x417c0d,_0x2337f2[_0x6b22('0x3e')]);return db[_0x6b22('0x60')][_0x6b22('0x1f')]({'where':_0x417c0d[_0x6b22('0x3b')]})['then'](function(_0x3272f1){_0x2e3615[_0x6b22('0x1f')]=_0x3272f1;if(_0x2337f2[_0x6b22('0x31')]['includeAll']){_0x417c0d['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0x6b22('0x42')](_0x417c0d);})['then'](function(_0x371a9c){_0x2e3615[_0x6b22('0x5a')]=_0x371a9c;return _0x2e3615;});}})[_0x6b22('0x25')](respondWithFilteredResult(_0x373ba1,_0x417c0d))[_0x6b22('0x43')](handleError(_0x373ba1,null));};exports[_0x6b22('0x62')]=function(_0x1a6385,_0x382e5a,_0x52e072){var _0x221caf={};var _0x32aaaf={};var _0x4a3d10;var _0x3c68bb;return db[_0x6b22('0x3f')][_0x6b22('0x57')]({'where':{'id':_0x1a6385[_0x6b22('0x45')]['id']}})[_0x6b22('0x25')](handleEntityNotFound(_0x382e5a,null))[_0x6b22('0x25')](function(_0x5c07c1){if(_0x5c07c1){_0x4a3d10=_0x5c07c1;_0x32aaaf[_0x6b22('0x2f')]=_[_0x6b22('0x30')](db[_0x6b22('0x63')][_0x6b22('0x2c')]);_0x32aaaf[_0x6b22('0x31')]=_[_0x6b22('0x30')](_0x1a6385[_0x6b22('0x31')]);_0x32aaaf[_0x6b22('0x38')]=_[_0x6b22('0x32')](_0x32aaaf[_0x6b22('0x2f')],_0x32aaaf[_0x6b22('0x31')]);_0x221caf[_0x6b22('0x34')]=_[_0x6b22('0x32')](_0x32aaaf[_0x6b22('0x2f')],qs[_0x6b22('0x33')](_0x1a6385['query'][_0x6b22('0x33')]));_0x221caf[_0x6b22('0x34')]=_0x221caf['attributes'][_0x6b22('0x46')]?_0x221caf['attributes']:_0x32aaaf[_0x6b22('0x2f')];_0x221caf['order']=qs[_0x6b22('0x37')](_0x1a6385['query'][_0x6b22('0x37')]);_0x221caf[_0x6b22('0x3b')]=qs[_0x6b22('0x38')](_[_0x6b22('0x39')](_0x1a6385[_0x6b22('0x31')],_0x32aaaf['filters']));if(_0x1a6385[_0x6b22('0x31')][_0x6b22('0x3d')]){_0x221caf[_0x6b22('0x3b')]=_[_0x6b22('0x3a')](_0x221caf[_0x6b22('0x3b')],{'$or':_[_0x6b22('0x2b')](_0x221caf[_0x6b22('0x34')],function(_0x380dff){var _0x98af4f={};_0x98af4f[_0x380dff]={'$like':'%'+_0x1a6385[_0x6b22('0x31')][_0x6b22('0x3d')]+'%'};return _0x98af4f;})});}_0x221caf=_[_0x6b22('0x3a')]({},_0x221caf,_0x1a6385['options']);return _0x4a3d10[_0x6b22('0x62')](_0x221caf);}})[_0x6b22('0x25')](function(_0x3a33a6){if(_0x3a33a6){_0x3c68bb=_0x3a33a6[_0x6b22('0x46')];if(!_0x1a6385['query'][_0x6b22('0x35')](_0x6b22('0x58'))){_0x221caf['limit']=qs['limit'](_0x1a6385[_0x6b22('0x31')]['limit']);_0x221caf[_0x6b22('0x1c')]=qs[_0x6b22('0x1c')](_0x1a6385[_0x6b22('0x31')][_0x6b22('0x1c')]);}return _0x4a3d10[_0x6b22('0x62')](_0x221caf);}})[_0x6b22('0x25')](function(_0x509475){if(_0x509475){return _0x509475?{'count':_0x3c68bb,'rows':_0x509475}:null;}})[_0x6b22('0x25')](respondWithResult(_0x382e5a,null))['catch'](handleError(_0x382e5a,null));};exports[_0x6b22('0x64')]=function(_0x31dac8,_0x160f81,_0x26216b){var _0x1c5f81,_0x2b09de;var _0x32590c=[];var _0xfcb567=moment()[_0x6b22('0x65')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x6b22('0x3f')][_0x6b22('0x47')]({'where':{'id':_0x31dac8[_0x6b22('0x45')]['id']}})[_0x6b22('0x25')](handleEntityNotFound(_0x160f81,null))[_0x6b22('0x25')](function(_0x272287){if(_0x272287){_0x2b09de=_0x272287;return _0x272287[_0x6b22('0x64')](_0x31dac8['body'][_0x6b22('0x66')],_['omit'](_0x31dac8[_0x6b22('0x49')],[_0x6b22('0x66'),'id'])||{});}return null;})[_0x6b22('0x67')](function(_0xb9b3ec){var _0xbdbd08;var _0x196481;_0x1c5f81=_0xb9b3ec||[];var _0x198c5a=[];if(_0xb9b3ec){for(var _0x41f7ac=0x0;_0x41f7ac<_0xb9b3ec[_0x6b22('0x46')];_0x41f7ac+=0x1){var _0x1a12e4=_0xb9b3ec[_0x41f7ac][_0x6b22('0x26')]({'plain':!![]});_0x2b09de['dialCheckDuplicateType']=_0x31dac8[_0x6b22('0x49')][_0x6b22('0x68')]?_0x31dac8['body'][_0x6b22('0x68')]:_0x2b09de['dialCheckDuplicateType'];switch(_0x2b09de[_0x6b22('0x68')]){case _0x6b22('0x69'):_0xbdbd08=squel['insert']()[_0x6b22('0x6a')](_0x6b22('0x6b'))['fromQuery']([_0x6b22('0x6c'),_0x6b22('0x6d'),_0x6b22('0x6e'),_0x6b22('0x6f'),_0x6b22('0x61'),_0x6b22('0x53'),'updatedAt'],squel[_0x6b22('0x70')]()[_0x6b22('0x71')](_0x6b22('0x6c'),'phone')[_0x6b22('0x71')]('NOW()','scheduledAt')[_0x6b22('0x71')]('id',_0x6b22('0x6e'))['field'](_0x1a12e4[_0x6b22('0x72')]['toString'](),_0x6b22('0x6f'))[_0x6b22('0x71')](_0x31dac8['params']['id'][_0x6b22('0x73')](),_0x6b22('0x61'))['field']('\x27'+_0xfcb567+'\x27',_0x6b22('0x53'))['field']('\x27'+_0xfcb567+'\x27',_0x6b22('0x54'))['from'](_0x6b22('0x74'))[_0x6b22('0x3b')](_0x6b22('0x75'))[_0x6b22('0x3b')]('ListId\x20=\x20?',_0x1a12e4['CmListId']['toString']())[_0x6b22('0x3b')](_0x6b22('0x76'))[_0x6b22('0x3b')](_0x6b22('0x77'),squel[_0x6b22('0x70')]()[_0x6b22('0x71')](_0x6b22('0x78'))[_0x6b22('0x79')]('cm_hopper_final')[_0x6b22('0x3b')](_0x6b22('0x7a'),_0x31dac8['params']['id'][_0x6b22('0x73')]()))[_0x6b22('0x3b')](_0x6b22('0x77'),squel[_0x6b22('0x70')]()[_0x6b22('0x71')](_0x6b22('0x7b'))[_0x6b22('0x79')](_0x6b22('0x6b'))['where'](_0x6b22('0x7a'),_0x31dac8[_0x6b22('0x45')]['id'][_0x6b22('0x73')]())))[_0x6b22('0x73')]();break;case'onlyIfOpen':_0xbdbd08=squel[_0x6b22('0x7c')]()['into'](_0x6b22('0x6b'))['fromQuery']([_0x6b22('0x6c'),_0x6b22('0x6d'),'ContactId','ListId',_0x6b22('0x61'),_0x6b22('0x53'),_0x6b22('0x54')],squel[_0x6b22('0x70')]()['field'](_0x6b22('0x6c'),'phone')[_0x6b22('0x71')]('NOW()',_0x6b22('0x6d'))[_0x6b22('0x71')]('id','ContactId')['field'](_0x1a12e4['CmListId'][_0x6b22('0x73')](),_0x6b22('0x6f'))['field'](_0x31dac8[_0x6b22('0x45')]['id'][_0x6b22('0x73')](),_0x6b22('0x61'))[_0x6b22('0x71')]('\x27'+_0xfcb567+'\x27',_0x6b22('0x53'))['field']('\x27'+_0xfcb567+'\x27',_0x6b22('0x54'))[_0x6b22('0x79')]('cm_contacts')[_0x6b22('0x3b')](_0x6b22('0x75'))[_0x6b22('0x3b')]('ListId\x20=\x20?',_0x1a12e4[_0x6b22('0x72')][_0x6b22('0x73')]())['where'](_0x6b22('0x76'))['where'](_0x6b22('0x77'),squel[_0x6b22('0x70')]()[_0x6b22('0x71')](_0x6b22('0x7b'))[_0x6b22('0x79')](_0x6b22('0x6b'))[_0x6b22('0x3b')](_0x6b22('0x7a'),_0x31dac8[_0x6b22('0x45')]['id'][_0x6b22('0x73')]())))['toString']();break;default:_0xbdbd08=squel[_0x6b22('0x7c')]()['into'](_0x6b22('0x6b'))[_0x6b22('0x7d')](['phone','scheduledAt',_0x6b22('0x6e'),_0x6b22('0x6f'),_0x6b22('0x61'),'createdAt',_0x6b22('0x54')],squel['select']()[_0x6b22('0x71')](_0x6b22('0x6c'),_0x6b22('0x6c'))['field']('NOW()',_0x6b22('0x6d'))[_0x6b22('0x71')]('id',_0x6b22('0x6e'))[_0x6b22('0x71')](_0x1a12e4[_0x6b22('0x72')][_0x6b22('0x73')](),_0x6b22('0x6f'))[_0x6b22('0x71')](_0x31dac8[_0x6b22('0x45')]['id'][_0x6b22('0x73')](),_0x6b22('0x61'))['field']('\x27'+_0xfcb567+'\x27',_0x6b22('0x53'))[_0x6b22('0x71')]('\x27'+_0xfcb567+'\x27',_0x6b22('0x54'))[_0x6b22('0x79')](_0x6b22('0x74'))['where'](_0x6b22('0x75'))[_0x6b22('0x3b')](_0x6b22('0x7e'),_0x1a12e4['CmListId']['toString']())[_0x6b22('0x3b')]('phone\x20IS\x20NOT\x20NULL'))[_0x6b22('0x73')]();}_0x196481=squel[_0x6b22('0x7c')]()[_0x6b22('0x6a')]('cm_hopper_additional_phones')[_0x6b22('0x7d')](['cmHopperId',_0x6b22('0x6d'),_0x6b22('0x6c'),_0x6b22('0x7f'),'createdAt','updatedAt'],squel[_0x6b22('0x70')]()[_0x6b22('0x71')](_0x6b22('0x80'),'id')['field'](_0x6b22('0x81'),'scheduledAt')[_0x6b22('0x71')](_0x6b22('0x82'),'phone')[_0x6b22('0x71')](_0x6b22('0x83'),_0x6b22('0x7f'))[_0x6b22('0x71')]('\x27'+_0xfcb567+'\x27','createdAt')[_0x6b22('0x71')]('\x27'+_0xfcb567+'\x27',_0x6b22('0x54'))[_0x6b22('0x79')]('cm_contact_has_items','ci')[_0x6b22('0x84')](_0x6b22('0x6b'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0x6b22('0x3b')]('h.ListId\x20=\x20?',_0x1a12e4[_0x6b22('0x72')][_0x6b22('0x73')]())[_0x6b22('0x3b')]('h.CampaignId=?',_0x31dac8['params']['id'][_0x6b22('0x73')]())[_0x6b22('0x3b')](_0x6b22('0x85'),_0xfcb567))[_0x6b22('0x73')]();_0x198c5a[_0x6b22('0x86')](db[_0x6b22('0x87')][_0x6b22('0x31')](_0xbdbd08));_0x32590c[_0x6b22('0x86')](db[_0x6b22('0x87')][_0x6b22('0x31')](_0x196481));}return BPromise[_0x6b22('0x88')](_0x198c5a);}})[_0x6b22('0x25')](function(){return BPromise[_0x6b22('0x88')](_0x32590c);})['then'](function(){return _0x1c5f81;})[_0x6b22('0x25')](respondWithResult(_0x160f81,null))['catch'](handleError(_0x160f81,null));};exports[_0x6b22('0x89')]=function(_0x43a6d6,_0x1f7efa,_0x50a02e){return db[_0x6b22('0x3f')]['find']({'where':{'id':_0x43a6d6[_0x6b22('0x45')]['id']}})[_0x6b22('0x25')](handleEntityNotFound(_0x1f7efa,null))[_0x6b22('0x25')](function(_0x49c9f6){if(_0x49c9f6){return _0x49c9f6[_0x6b22('0x89')](_0x43a6d6['query'][_0x6b22('0x66')]);}})[_0x6b22('0x25')](function(_0x1baf96){if(_0x1baf96){return db[_0x6b22('0x59')]['destroy']({'where':{'ListId':_0x43a6d6[_0x6b22('0x31')][_0x6b22('0x66')],'CampaignId':_0x43a6d6[_0x6b22('0x45')]['id']}})['then'](function(){return _0x1baf96;});}})[_0x6b22('0x25')](respondWithStatusCode(_0x1f7efa,null))[_0x6b22('0x43')](handleError(_0x1f7efa,null));};exports[_0x6b22('0x8a')]=function(_0x4d1217,_0x5f2a3b,_0x4529ec){var _0x4b59ee={};var _0x32ac2e={};var _0x16b852;var _0x1b5a5f;return db['Campaign'][_0x6b22('0x57')]({'where':{'id':_0x4d1217[_0x6b22('0x45')]['id']}})[_0x6b22('0x25')](handleEntityNotFound(_0x5f2a3b,null))[_0x6b22('0x25')](function(_0x3ad18a){if(_0x3ad18a){_0x16b852=_0x3ad18a;_0x32ac2e[_0x6b22('0x2f')]=_[_0x6b22('0x30')](db[_0x6b22('0x63')][_0x6b22('0x2c')]);_0x32ac2e[_0x6b22('0x31')]=_['keys'](_0x4d1217[_0x6b22('0x31')]);_0x32ac2e['filters']=_['intersection'](_0x32ac2e[_0x6b22('0x2f')],_0x32ac2e['query']);_0x4b59ee['attributes']=_['intersection'](_0x32ac2e[_0x6b22('0x2f')],qs[_0x6b22('0x33')](_0x4d1217['query'][_0x6b22('0x33')]));_0x4b59ee[_0x6b22('0x34')]=_0x4b59ee[_0x6b22('0x34')][_0x6b22('0x46')]?_0x4b59ee['attributes']:_0x32ac2e['model'];_0x4b59ee[_0x6b22('0x36')]=qs[_0x6b22('0x37')](_0x4d1217[_0x6b22('0x31')][_0x6b22('0x37')]);_0x4b59ee[_0x6b22('0x3b')]=qs['filters'](_[_0x6b22('0x39')](_0x4d1217[_0x6b22('0x31')],_0x32ac2e[_0x6b22('0x38')]));if(_0x4d1217[_0x6b22('0x31')][_0x6b22('0x3d')]){_0x4b59ee[_0x6b22('0x3b')]=_[_0x6b22('0x3a')](_0x4b59ee[_0x6b22('0x3b')],{'$or':_[_0x6b22('0x2b')](_0x4b59ee[_0x6b22('0x34')],function(_0xc5d0b1){var _0x5adc83={};_0x5adc83[_0xc5d0b1]={'$like':'%'+_0x4d1217[_0x6b22('0x31')][_0x6b22('0x3d')]+'%'};return _0x5adc83;})});}_0x4b59ee=_[_0x6b22('0x3a')]({},_0x4b59ee,_0x4d1217['options']);return _0x16b852['getBlackLists'](_0x4b59ee);}})[_0x6b22('0x25')](function(_0x2d09ac){if(_0x2d09ac){_0x1b5a5f=_0x2d09ac[_0x6b22('0x46')];if(!_0x4d1217['query']['hasOwnProperty'](_0x6b22('0x58'))){_0x4b59ee[_0x6b22('0x1e')]=qs[_0x6b22('0x1e')](_0x4d1217[_0x6b22('0x31')][_0x6b22('0x1e')]);_0x4b59ee[_0x6b22('0x1c')]=qs[_0x6b22('0x1c')](_0x4d1217[_0x6b22('0x31')]['offset']);}return _0x16b852[_0x6b22('0x8a')](_0x4b59ee);}})[_0x6b22('0x25')](function(_0x12ae68){if(_0x12ae68){return _0x12ae68?{'count':_0x1b5a5f,'rows':_0x12ae68}:null;}})['then'](respondWithResult(_0x5f2a3b,null))[_0x6b22('0x43')](handleError(_0x5f2a3b,null));};exports[_0x6b22('0x8b')]=function(_0x3406ab,_0x2ff4db,_0xc35f32){var _0x6b7aa7,_0x437262;var _0x4825ae=[];var _0x5f10dc=moment()['format'](_0x6b22('0x8c'));return db[_0x6b22('0x3f')][_0x6b22('0x47')]({'where':{'id':_0x3406ab[_0x6b22('0x45')]['id']}})[_0x6b22('0x25')](handleEntityNotFound(_0x2ff4db,null))[_0x6b22('0x25')](function(_0x2289e7){if(_0x2289e7){_0x437262=_0x2289e7;return _0x2289e7[_0x6b22('0x8b')](_0x3406ab[_0x6b22('0x49')][_0x6b22('0x66')],_[_0x6b22('0x52')](_0x3406ab[_0x6b22('0x49')],['ids','id'])||{});}return null;})['spread'](function(_0xd0052b){var _0x2e51c9;var _0x11bdd5;_0x6b7aa7=_0xd0052b||[];var _0x167b35=[];if(_0xd0052b){for(var _0x38a4a3=0x0;_0x38a4a3<_0xd0052b[_0x6b22('0x46')];_0x38a4a3+=0x1){var _0x50c069=_0xd0052b[_0x38a4a3]['get']({'plain':!![]});_0x2e51c9=squel[_0x6b22('0x7c')]()['into'](_0x6b22('0x8d'))[_0x6b22('0x7d')](['phone',_0x6b22('0x6e'),_0x6b22('0x6f'),_0x6b22('0x61'),_0x6b22('0x53'),_0x6b22('0x54')],squel[_0x6b22('0x70')]()['field'](_0x6b22('0x6c'),_0x6b22('0x6c'))['field']('id',_0x6b22('0x6e'))[_0x6b22('0x71')](_0x50c069[_0x6b22('0x72')]['toString'](),_0x6b22('0x6f'))[_0x6b22('0x71')](_0x3406ab[_0x6b22('0x45')]['id'][_0x6b22('0x73')](),_0x6b22('0x61'))[_0x6b22('0x71')](_0x6b22('0x81'),_0x6b22('0x53'))[_0x6b22('0x71')](_0x6b22('0x81'),_0x6b22('0x54'))[_0x6b22('0x79')](_0x6b22('0x74'))[_0x6b22('0x3b')](_0x6b22('0x75'))[_0x6b22('0x3b')](_0x6b22('0x7e'),_0x50c069[_0x6b22('0x72')][_0x6b22('0x73')]())[_0x6b22('0x3b')]('phone\x20IS\x20NOT\x20NULL'))[_0x6b22('0x73')]();_0x167b35[_0x6b22('0x86')](db['sequelize'][_0x6b22('0x31')](_0x2e51c9));}return BPromise[_0x6b22('0x88')](_0x167b35);}})[_0x6b22('0x25')](function(){return _0x6b7aa7;})[_0x6b22('0x25')](respondWithResult(_0x2ff4db,null))[_0x6b22('0x43')](handleError(_0x2ff4db,null));};exports[_0x6b22('0x8e')]=function(_0x24d6f5,_0x149067,_0x406362){return db['Campaign'][_0x6b22('0x47')]({'where':{'id':_0x24d6f5[_0x6b22('0x45')]['id']}})['then'](handleEntityNotFound(_0x149067,null))['then'](function(_0x4dca95){if(_0x4dca95){return _0x4dca95[_0x6b22('0x8e')](_0x24d6f5[_0x6b22('0x31')][_0x6b22('0x66')]);}})[_0x6b22('0x25')](function(_0x2f00c4){if(_0x2f00c4){return db[_0x6b22('0x60')][_0x6b22('0x55')]({'where':{'ListId':_0x24d6f5['query'][_0x6b22('0x66')],'CampaignId':_0x24d6f5[_0x6b22('0x45')]['id']}})[_0x6b22('0x25')](function(){return _0x2f00c4;});}})[_0x6b22('0x25')](respondWithStatusCode(_0x149067,null))[_0x6b22('0x43')](handleError(_0x149067,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 3eca2b6..f7d951d 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(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0xdfd552,_0x5f39a0){var _0x598335=function(_0x1dc924){while(--_0x1dc924){_0xdfd552['push'](_0xdfd552['shift']());}};_0x598335(++_0x5f39a0);}(_0x7a54,0x106));var _0x47a5=function(_0x542446,_0x5a6f4f){_0x542446=_0x542446-0x0;var _0x636a98=_0x7a54[_0x542446];return _0x636a98;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 5676d78..608432c 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 _0x5668=['stringify','error','message','info','result','catch','GetCampaign','options','raw','where','attributes','include','map','model','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','Campaign,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x9d1e6b,_0x3bdc22){var _0x2b3070=function(_0x4c4ced){while(--_0x4c4ced){_0x9d1e6b['push'](_0x9d1e6b['shift']());}};_0x2b3070(++_0x3bdc22);}(_0x5668,0x8b));var _0x8566=function(_0x4a4538,_0x2ef602){_0x4a4538=_0x4a4538-0x0;var _0x610e35=_0x5668[_0x4a4538];return _0x610e35;};'use strict';var _=require(_0x8566('0x0'));var util=require(_0x8566('0x1'));var moment=require(_0x8566('0x2'));var BPromise=require(_0x8566('0x3'));var rs=require(_0x8566('0x4'));var fs=require('fs');var Redis=require(_0x8566('0x5'));var db=require(_0x8566('0x6'))['db'];var utils=require(_0x8566('0x7'));var logger=require(_0x8566('0x8'))(_0x8566('0x9'));var config=require(_0x8566('0xa'));var jayson=require(_0x8566('0xb'));var client=jayson[_0x8566('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x355fce,_0x2ffec4,_0x49f55a){return new BPromise(function(_0x4aaf3f,_0x4045ed){return client['request'](_0x355fce,_0x49f55a)['then'](function(_0x1a01a2){logger['info'](_0x8566('0xd'),_0x2ffec4,_0x8566('0xe'));logger[_0x8566('0xf')]('Campaign,\x20%s,\x20%s,\x20%s',_0x2ffec4,_0x8566('0xe'),JSON[_0x8566('0x10')](_0x1a01a2));if(_0x1a01a2['error']){if(_0x1a01a2['error']['code']===0x1f4){logger['error'](_0x8566('0xd'),_0x2ffec4,_0x1a01a2[_0x8566('0x11')][_0x8566('0x12')]);return _0x4045ed(_0x1a01a2[_0x8566('0x11')][_0x8566('0x12')]);}logger['error']('Campaign,\x20%s,\x20%s',_0x2ffec4,_0x1a01a2['error']['message']);return _0x4aaf3f(_0x1a01a2['error'][_0x8566('0x12')]);}else{logger[_0x8566('0x13')](_0x8566('0xd'),_0x2ffec4,_0x8566('0xe'));_0x4aaf3f(_0x1a01a2[_0x8566('0x14')]['message']);}})[_0x8566('0x15')](function(_0xe208c7){logger[_0x8566('0x11')]('Campaign,\x20%s,\x20%s',_0x2ffec4,_0xe208c7);_0x4045ed(_0xe208c7);});});}exports[_0x8566('0x16')]=function(_0x1a8ae0){var _0x2eed85=this;return new Promise(function(_0x526f23,_0x41cb27){return db['Campaign']['findAll']({'raw':_0x1a8ae0[_0x8566('0x17')]?_0x1a8ae0['options'][_0x8566('0x18')]===undefined?!![]:![]:!![],'where':_0x1a8ae0['options']?_0x1a8ae0[_0x8566('0x17')][_0x8566('0x19')]||null:null,'attributes':_0x1a8ae0[_0x8566('0x17')]?_0x1a8ae0[_0x8566('0x17')][_0x8566('0x1a')]||null:null,'limit':_0x1a8ae0[_0x8566('0x17')]?_0x1a8ae0[_0x8566('0x17')]['limit']||null:null,'include':_0x1a8ae0['options']?_0x1a8ae0[_0x8566('0x17')][_0x8566('0x1b')]?_[_0x8566('0x1c')](_0x1a8ae0[_0x8566('0x17')]['include'],function(_0x183435){return{'model':db[_0x183435[_0x8566('0x1d')]],'as':_0x183435['as'],'attributes':_0x183435['attributes'],'include':_0x183435[_0x8566('0x1b')]?_[_0x8566('0x1c')](_0x183435['include'],function(_0x3191f5){return{'model':db[_0x3191f5[_0x8566('0x1d')]],'as':_0x3191f5['as'],'attributes':_0x3191f5[_0x8566('0x1a')],'include':_0x3191f5['include']?_[_0x8566('0x1c')](_0x3191f5[_0x8566('0x1b')],function(_0x327f7d){return{'model':db[_0x327f7d[_0x8566('0x1d')]],'as':_0x327f7d['as'],'attributes':_0x327f7d[_0x8566('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8566('0x1e')](function(_0xa3cf58){logger['info'](_0x8566('0x16'),_0x1a8ae0);logger[_0x8566('0xf')](_0x8566('0x16'),_0x1a8ae0,JSON[_0x8566('0x10')](_0xa3cf58));_0x526f23(_0xa3cf58);})[_0x8566('0x15')](function(_0x3a3106){logger[_0x8566('0x11')](_0x8566('0x16'),_0x3a3106['message'],_0x1a8ae0);_0x41cb27(_0x2eed85[_0x8566('0x11')](0x1f4,_0x3a3106['message']));});});}; \ No newline at end of file +var _0xab3a=['request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','GetCampaign','Campaign','findAll','options','where','include','map','model','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xab3a,0x1d3));var _0xaab3=function(_0x479650,_0x2bee99){_0x479650=_0x479650-0x0;var _0x26b288=_0xab3a[_0x479650];return _0x26b288;};'use strict';var _=require(_0xaab3('0x0'));var util=require(_0xaab3('0x1'));var moment=require(_0xaab3('0x2'));var BPromise=require(_0xaab3('0x3'));var rs=require(_0xaab3('0x4'));var fs=require('fs');var Redis=require(_0xaab3('0x5'));var db=require(_0xaab3('0x6'))['db'];var utils=require(_0xaab3('0x7'));var logger=require(_0xaab3('0x8'))(_0xaab3('0x9'));var config=require(_0xaab3('0xa'));var jayson=require(_0xaab3('0xb'));var client=jayson[_0xaab3('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5760e8,_0x501657,_0x1fd19f){return new BPromise(function(_0x146453,_0x21527a){return client[_0xaab3('0xd')](_0x5760e8,_0x1fd19f)[_0xaab3('0xe')](function(_0x15841e){logger[_0xaab3('0xf')](_0xaab3('0x10'),_0x501657,_0xaab3('0x11'));logger[_0xaab3('0x12')]('Campaign,\x20%s,\x20%s,\x20%s',_0x501657,'request\x20sent',JSON[_0xaab3('0x13')](_0x15841e));if(_0x15841e[_0xaab3('0x14')]){if(_0x15841e[_0xaab3('0x14')][_0xaab3('0x15')]===0x1f4){logger['error'](_0xaab3('0x10'),_0x501657,_0x15841e['error'][_0xaab3('0x16')]);return _0x21527a(_0x15841e['error'][_0xaab3('0x16')]);}logger[_0xaab3('0x14')](_0xaab3('0x10'),_0x501657,_0x15841e['error'][_0xaab3('0x16')]);return _0x146453(_0x15841e[_0xaab3('0x14')]['message']);}else{logger[_0xaab3('0xf')](_0xaab3('0x10'),_0x501657,_0xaab3('0x11'));_0x146453(_0x15841e['result']['message']);}})['catch'](function(_0x484dc5){logger[_0xaab3('0x14')](_0xaab3('0x10'),_0x501657,_0x484dc5);_0x21527a(_0x484dc5);});});}exports[_0xaab3('0x17')]=function(_0x5a3ecc){var _0x3052a5=this;return new Promise(function(_0x46aefc,_0x3a06f2){return db[_0xaab3('0x18')][_0xaab3('0x19')]({'raw':_0x5a3ecc[_0xaab3('0x1a')]?_0x5a3ecc[_0xaab3('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x5a3ecc[_0xaab3('0x1a')]?_0x5a3ecc[_0xaab3('0x1a')][_0xaab3('0x1b')]||null:null,'attributes':_0x5a3ecc[_0xaab3('0x1a')]?_0x5a3ecc[_0xaab3('0x1a')]['attributes']||null:null,'limit':_0x5a3ecc['options']?_0x5a3ecc['options']['limit']||null:null,'include':_0x5a3ecc['options']?_0x5a3ecc[_0xaab3('0x1a')][_0xaab3('0x1c')]?_[_0xaab3('0x1d')](_0x5a3ecc[_0xaab3('0x1a')][_0xaab3('0x1c')],function(_0x1816ab){return{'model':db[_0x1816ab[_0xaab3('0x1e')]],'as':_0x1816ab['as'],'attributes':_0x1816ab[_0xaab3('0x1f')],'include':_0x1816ab[_0xaab3('0x1c')]?_[_0xaab3('0x1d')](_0x1816ab[_0xaab3('0x1c')],function(_0x3097ec){return{'model':db[_0x3097ec[_0xaab3('0x1e')]],'as':_0x3097ec['as'],'attributes':_0x3097ec['attributes'],'include':_0x3097ec[_0xaab3('0x1c')]?_['map'](_0x3097ec[_0xaab3('0x1c')],function(_0x2904f8){return{'model':db[_0x2904f8['model']],'as':_0x2904f8['as'],'attributes':_0x2904f8[_0xaab3('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xaab3('0xe')](function(_0x263362){logger['info']('GetCampaign',_0x5a3ecc);logger[_0xaab3('0x12')](_0xaab3('0x17'),_0x5a3ecc,JSON[_0xaab3('0x13')](_0x263362));_0x46aefc(_0x263362);})['catch'](function(_0x168eb0){logger[_0xaab3('0x14')](_0xaab3('0x17'),_0x168eb0[_0xaab3('0x16')],_0x5a3ecc);_0x3a06f2(_0x3052a5[_0xaab3('0x14')](0x1f4,_0x168eb0[_0xaab3('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 705b64c..e25e49c 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 _0x38a5=['getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','post','create','/:id/clone','clone','addLists','addBlackLists','delete','/:id','destroy','removeBlackLists','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','getHoppers','getHopperHistories','/:id/hopper_finals'];(function(_0x280007,_0x26e781){var _0x27b8f0=function(_0x565ebb){while(--_0x565ebb){_0x280007['push'](_0x280007['shift']());}};_0x27b8f0(++_0x26e781);}(_0x38a5,0x1eb));var _0x538a=function(_0x37bf1a,_0x2795cc){_0x37bf1a=_0x37bf1a-0x0;var _0x4b73c3=_0x38a5[_0x37bf1a];return _0x4b73c3;};'use strict';var multer=require(_0x538a('0x0'));var util=require(_0x538a('0x1'));var path=require('path');var timeout=require(_0x538a('0x2'));var express=require('express');var router=express[_0x538a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x538a('0x4'));var interaction=require(_0x538a('0x5'));var config=require(_0x538a('0x6'));var controller=require('./campaign.controller');router[_0x538a('0x7')]('/',auth[_0x538a('0x8')](),controller['index']);router[_0x538a('0x7')]('/:id',auth[_0x538a('0x8')](),controller[_0x538a('0x9')]);router[_0x538a('0x7')]('/:id/hoppers',auth[_0x538a('0x8')](),controller[_0x538a('0xa')]);router['get']('/:id/hopper_histories',auth['isAuthenticated'](),controller[_0x538a('0xb')]);router[_0x538a('0x7')](_0x538a('0xc'),auth[_0x538a('0x8')](),controller[_0x538a('0xd')]);router[_0x538a('0x7')](_0x538a('0xe'),auth[_0x538a('0x8')](),controller[_0x538a('0xf')]);router[_0x538a('0x7')](_0x538a('0x10'),auth['isAuthenticated'](),controller[_0x538a('0x11')]);router['get']('/:id/blacklists',auth[_0x538a('0x8')](),controller['getBlackLists']);router[_0x538a('0x12')]('/',auth['isAuthenticated'](),controller[_0x538a('0x13')]);router[_0x538a('0x12')](_0x538a('0x14'),auth['isAuthenticated'](),controller[_0x538a('0x15')]);router[_0x538a('0x12')](_0x538a('0x10'),auth[_0x538a('0x8')](),controller[_0x538a('0x16')]);router[_0x538a('0x12')]('/:id/blacklists',auth[_0x538a('0x8')](),controller[_0x538a('0x17')]);router['put']('/:id',auth[_0x538a('0x8')](),controller['update']);router[_0x538a('0x18')](_0x538a('0x19'),auth[_0x538a('0x8')](),controller[_0x538a('0x1a')]);router['delete']('/:id/lists',auth[_0x538a('0x8')](),controller['removeLists']);router[_0x538a('0x18')]('/:id/blacklists',auth[_0x538a('0x8')](),controller[_0x538a('0x1b')]);module['exports']=router; \ No newline at end of file +var _0xf5c4=['getHopperFinals','/:id/hopper_black','/:id/lists','getLists','getBlackLists','post','clone','addLists','/:id/blacklists','addBlackLists','put','update','delete','removeLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','/:id','show','get','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories'];(function(_0x133296,_0xe8ff9a){var _0x193517=function(_0x161ffd){while(--_0x161ffd){_0x133296['push'](_0x133296['shift']());}};_0x193517(++_0xe8ff9a);}(_0xf5c4,0x1a7));var _0x4f5c=function(_0x2e69fb,_0x4359e3){_0x2e69fb=_0x2e69fb-0x0;var _0x4d2404=_0xf5c4[_0x2e69fb];return _0x4d2404;};'use strict';var multer=require(_0x4f5c('0x0'));var util=require(_0x4f5c('0x1'));var path=require(_0x4f5c('0x2'));var timeout=require(_0x4f5c('0x3'));var express=require(_0x4f5c('0x4'));var router=express[_0x4f5c('0x5')]();var fs_extra=require(_0x4f5c('0x6'));var auth=require(_0x4f5c('0x7'));var interaction=require(_0x4f5c('0x8'));var config=require(_0x4f5c('0x9'));var controller=require(_0x4f5c('0xa'));router['get']('/',auth[_0x4f5c('0xb')](),controller['index']);router['get'](_0x4f5c('0xc'),auth[_0x4f5c('0xb')](),controller[_0x4f5c('0xd')]);router[_0x4f5c('0xe')](_0x4f5c('0xf'),auth['isAuthenticated'](),controller[_0x4f5c('0x10')]);router['get'](_0x4f5c('0x11'),auth[_0x4f5c('0xb')](),controller[_0x4f5c('0x12')]);router[_0x4f5c('0xe')]('/:id/hopper_finals',auth[_0x4f5c('0xb')](),controller[_0x4f5c('0x13')]);router[_0x4f5c('0xe')](_0x4f5c('0x14'),auth['isAuthenticated'](),controller['getHopperBlacks']);router[_0x4f5c('0xe')](_0x4f5c('0x15'),auth['isAuthenticated'](),controller[_0x4f5c('0x16')]);router['get']('/:id/blacklists',auth[_0x4f5c('0xb')](),controller[_0x4f5c('0x17')]);router[_0x4f5c('0x18')]('/',auth[_0x4f5c('0xb')](),controller['create']);router[_0x4f5c('0x18')]('/:id/clone',auth[_0x4f5c('0xb')](),controller[_0x4f5c('0x19')]);router[_0x4f5c('0x18')](_0x4f5c('0x15'),auth[_0x4f5c('0xb')](),controller[_0x4f5c('0x1a')]);router[_0x4f5c('0x18')](_0x4f5c('0x1b'),auth['isAuthenticated'](),controller[_0x4f5c('0x1c')]);router[_0x4f5c('0x1d')](_0x4f5c('0xc'),auth[_0x4f5c('0xb')](),controller[_0x4f5c('0x1e')]);router['delete'](_0x4f5c('0xc'),auth[_0x4f5c('0xb')](),controller['destroy']);router[_0x4f5c('0x1f')](_0x4f5c('0x15'),auth[_0x4f5c('0xb')](),controller[_0x4f5c('0x20')]);router['delete']('/:id/blacklists',auth[_0x4f5c('0xb')](),controller['removeBlackLists']);module[_0x4f5c('0x21')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index f6bcf4d..ff45fbe 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 _0xf54c=['getDataValue','key','sequelize','STRING','TEXT','medium'];(function(_0xfb42e6,_0x5f5d4b){var _0x27265b=function(_0x163e81){while(--_0x163e81){_0xfb42e6['push'](_0xfb42e6['shift']());}};_0x27265b(++_0x5f5d4b);}(_0xf54c,0xda));var _0xcf54=function(_0xa4f642,_0x96d2fb){_0xa4f642=_0xa4f642-0x0;var _0x2b325e=_0xf54c[_0xa4f642];return _0x2b325e;};'use strict';var Sequelize=require(_0xcf54('0x0'));module['exports']={'key':{'type':Sequelize[_0xcf54('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0xcf54('0x2')],'length':_0xcf54('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xcf54('0x1')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xcf54('0x4')](_0xcf54('0x5'));}}}; \ No newline at end of file +var _0x2d9d=['medium','VIRTUAL','getDataValue','key','sequelize','exports','STRING','TEXT'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x2d9d,0x134));var _0xd2d9=function(_0x21d0d7,_0x4c55a3){_0x21d0d7=_0x21d0d7-0x0;var _0x5e725b=_0x2d9d[_0x21d0d7];return _0x5e725b;};'use strict';var Sequelize=require(_0xd2d9('0x0'));module[_0xd2d9('0x1')]={'key':{'type':Sequelize[_0xd2d9('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xd2d9('0x3')],'length':_0xd2d9('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0xd2d9('0x2')]},'name':{'type':Sequelize[_0xd2d9('0x5')],'get':function(){return this[_0xd2d9('0x6')](_0xd2d9('0x7'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 217904e..f493f35 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 _0xd26e=['save','update','destroy','get','UserProfileResource','then','error','stack','name','send','map','CannedAnswer','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','options','includeAll','include','findAll','catch','params','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','CannedAnswers','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','ioredis','../../components/parsers/qs','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x4e0bef,_0x32e1dd){var _0x551581=function(_0x1a3ff5){while(--_0x1a3ff5){_0x4e0bef['push'](_0x4e0bef['shift']());}};_0x551581(++_0x32e1dd);}(_0xd26e,0x89));var _0xed26=function(_0x158e6c,_0xaab4ed){_0x158e6c=_0x158e6c-0x0;var _0x3c26db=_0xd26e[_0x158e6c];return _0x3c26db;};'use strict';var emlformat=require(_0xed26('0x0'));var rimraf=require(_0xed26('0x1'));var zipdir=require(_0xed26('0x2'));var jsonpatch=require(_0xed26('0x3'));var rp=require(_0xed26('0x4'));var moment=require(_0xed26('0x5'));var BPromise=require(_0xed26('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xed26('0x7'));var sox=require(_0xed26('0x8'));var csv=require('to-csv');var ejs=require(_0xed26('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xed26('0xa'));var squel=require(_0xed26('0xb'));var crypto=require(_0xed26('0xc'));var jsforce=require(_0xed26('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xed26('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xed26('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xed26('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xed26('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xed26('0x12'));var db=require(_0xed26('0x13'))['db'];function respondWithStatusCode(_0x4562bd,_0x3be467){_0x3be467=_0x3be467||0xcc;return function(_0x4eadf7){if(_0x4eadf7){return _0x4562bd[_0xed26('0x14')](_0x3be467);}return _0x4562bd[_0xed26('0x15')](_0x3be467)[_0xed26('0x16')]();};}function respondWithResult(_0x21221f,_0xa6dae2){_0xa6dae2=_0xa6dae2||0xc8;return function(_0x248beb){if(_0x248beb){return _0x21221f['status'](_0xa6dae2)[_0xed26('0x17')](_0x248beb);}};}function respondWithFilteredResult(_0x337794,_0x283253){return function(_0xa4855c){if(_0xa4855c){var _0x56b17f=typeof _0x283253[_0xed26('0x18')]===_0xed26('0x19')&&typeof _0x283253[_0xed26('0x1a')]===_0xed26('0x19');var _0x1d6509=_0xa4855c[_0xed26('0x1b')];var _0x3fc9f7=_0x56b17f?0x0:_0x283253['offset'];var _0x2f59f9=_0x56b17f?_0xa4855c['count']:_0x283253['offset']+_0x283253[_0xed26('0x1a')];var _0x2e82a0;if(_0x2f59f9>=_0x1d6509){_0x2f59f9=_0x1d6509;_0x2e82a0=0xc8;}else{_0x2e82a0=0xce;}_0x337794[_0xed26('0x15')](_0x2e82a0);return _0x337794[_0xed26('0x1c')]('Content-Range',_0x3fc9f7+'-'+_0x2f59f9+'/'+_0x1d6509)[_0xed26('0x17')](_0xa4855c);}return null;};}function patchUpdates(_0x32ba75){return function(_0x2bd758){try{jsonpatch['apply'](_0x2bd758,_0x32ba75,!![]);}catch(_0x286508){return BPromise['reject'](_0x286508);}return _0x2bd758[_0xed26('0x1d')]();};}function saveUpdates(_0x153bad,_0x14ee39){return function(_0x3f7102){if(_0x3f7102){return _0x3f7102[_0xed26('0x1e')](_0x153bad)['then'](function(_0x386c16){return _0x386c16;});}return null;};}function removeEntity(_0x65ba48,_0x15a0a3){return function(_0x24b5f2){if(_0x24b5f2){return _0x24b5f2[_0xed26('0x1f')]()['then'](function(){var _0x5388e6=_0x24b5f2[_0xed26('0x20')]({'plain':!![]});var _0x1e3944='CannedAnswers';return db[_0xed26('0x21')][_0xed26('0x1f')]({'where':{'type':_0x1e3944,'resourceId':_0x5388e6['id']}})['then'](function(){return _0x24b5f2;});})[_0xed26('0x22')](function(){_0x65ba48['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x252a04,_0x3b9c72){return function(_0x2b4bae){if(!_0x2b4bae){_0x252a04[_0xed26('0x14')](0x194);}return _0x2b4bae;};}function handleError(_0x301d89,_0x332d19){_0x332d19=_0x332d19||0x1f4;return function(_0x539ef5){logger[_0xed26('0x23')](_0x539ef5[_0xed26('0x24')]);if(_0x539ef5[_0xed26('0x25')]){delete _0x539ef5['name'];}_0x301d89['status'](_0x332d19)[_0xed26('0x26')](_0x539ef5);};}exports['index']=function(_0x193cdd,_0x2786df){var _0x5edb3b={},_0xf9c2db={},_0x556803={'count':0x0,'rows':[]};var _0x5d2648=_[_0xed26('0x27')](db[_0xed26('0x28')][_0xed26('0x29')],function(_0x39d3a9){return{'name':_0x39d3a9[_0xed26('0x2a')],'type':_0x39d3a9[_0xed26('0x2b')][_0xed26('0x2c')]};});_0xf9c2db[_0xed26('0x2d')]=_[_0xed26('0x27')](_0x5d2648,_0xed26('0x25'));_0xf9c2db['query']=_[_0xed26('0x2e')](_0x193cdd[_0xed26('0x2f')]);_0xf9c2db['filters']=_[_0xed26('0x30')](_0xf9c2db['model'],_0xf9c2db['query']);_0x5edb3b[_0xed26('0x31')]=_[_0xed26('0x30')](_0xf9c2db[_0xed26('0x2d')],qs['fields'](_0x193cdd[_0xed26('0x2f')][_0xed26('0x32')]));_0x5edb3b[_0xed26('0x31')]=_0x5edb3b[_0xed26('0x31')][_0xed26('0x33')]?_0x5edb3b[_0xed26('0x31')]:_0xf9c2db[_0xed26('0x2d')];if(!_0x193cdd[_0xed26('0x2f')][_0xed26('0x34')](_0xed26('0x35'))){_0x5edb3b[_0xed26('0x1a')]=qs[_0xed26('0x1a')](_0x193cdd[_0xed26('0x2f')][_0xed26('0x1a')]);_0x5edb3b[_0xed26('0x18')]=qs['offset'](_0x193cdd['query'][_0xed26('0x18')]);}_0x5edb3b[_0xed26('0x36')]=qs[_0xed26('0x37')](_0x193cdd[_0xed26('0x2f')][_0xed26('0x37')]);_0x5edb3b['where']=qs[_0xed26('0x38')](_['pick'](_0x193cdd['query'],_0xf9c2db['filters']),_0x5d2648);if(_0x193cdd['query'][_0xed26('0x39')]){_0x5edb3b[_0xed26('0x3a')]=_[_0xed26('0x3b')](_0x5edb3b['where'],{'$or':[{'key':{'$like':'%'+_0x193cdd['query']['filter']+'%'}},{'value':{'$like':'%'+_0x193cdd[_0xed26('0x2f')][_0xed26('0x39')]+'%'}}]});}_0x5edb3b=_['merge']({},_0x5edb3b,_0x193cdd[_0xed26('0x3c')]);var _0x154a5d={'where':_0x5edb3b[_0xed26('0x3a')]};return db[_0xed26('0x28')][_0xed26('0x1b')](_0x154a5d)[_0xed26('0x22')](function(_0x241359){_0x556803['count']=_0x241359;if(_0x193cdd['query'][_0xed26('0x3d')]){_0x5edb3b[_0xed26('0x3e')]=[{'all':!![]}];}return db['CannedAnswer'][_0xed26('0x3f')](_0x5edb3b);})[_0xed26('0x22')](function(_0x540030){_0x556803['rows']=_0x540030;return _0x556803;})[_0xed26('0x22')](respondWithFilteredResult(_0x2786df,_0x5edb3b))[_0xed26('0x40')](handleError(_0x2786df,null));};exports['show']=function(_0x3d926f,_0x1a7229){var _0x55327a={'raw':!![],'where':{'id':_0x3d926f[_0xed26('0x41')]['id']}},_0x13fcf8={};_0x13fcf8[_0xed26('0x2d')]=_['keys'](db[_0xed26('0x28')][_0xed26('0x29')]);_0x13fcf8[_0xed26('0x2f')]=_[_0xed26('0x2e')](_0x3d926f[_0xed26('0x2f')]);_0x13fcf8[_0xed26('0x38')]=_[_0xed26('0x30')](_0x13fcf8[_0xed26('0x2d')],_0x13fcf8[_0xed26('0x2f')]);_0x55327a[_0xed26('0x31')]=_[_0xed26('0x30')](_0x13fcf8[_0xed26('0x2d')],qs[_0xed26('0x32')](_0x3d926f['query'][_0xed26('0x32')]));_0x55327a['attributes']=_0x55327a[_0xed26('0x31')][_0xed26('0x33')]?_0x55327a[_0xed26('0x31')]:_0x13fcf8[_0xed26('0x2d')];if(_0x3d926f[_0xed26('0x2f')][_0xed26('0x3d')]){_0x55327a[_0xed26('0x3e')]=[{'all':!![]}];}_0x55327a=_['merge']({},_0x55327a,_0x3d926f[_0xed26('0x3c')]);return db['CannedAnswer'][_0xed26('0x42')](_0x55327a)[_0xed26('0x22')](handleEntityNotFound(_0x1a7229,null))[_0xed26('0x22')](respondWithResult(_0x1a7229,null))[_0xed26('0x40')](handleError(_0x1a7229,null));};exports[_0xed26('0x1e')]=function(_0x2c01ed,_0xb829e){if(_0x2c01ed['body']['id']){delete _0x2c01ed[_0xed26('0x43')]['id'];}return db['CannedAnswer'][_0xed26('0x42')]({'where':{'id':_0x2c01ed[_0xed26('0x41')]['id']}})[_0xed26('0x22')](handleEntityNotFound(_0xb829e,null))['then'](saveUpdates(_0x2c01ed[_0xed26('0x43')],null))['then'](respondWithResult(_0xb829e,null))['catch'](handleError(_0xb829e,null));};exports[_0xed26('0x1f')]=function(_0x36c406,_0x58ab22){return db['CannedAnswer']['find']({'where':{'id':_0x36c406[_0xed26('0x41')]['id']}})[_0xed26('0x22')](handleEntityNotFound(_0x58ab22,null))[_0xed26('0x22')](removeEntity(_0x58ab22,null))['catch'](handleError(_0x58ab22,null));};exports[_0xed26('0x44')]=function(_0x49a1ea,_0x8df202){var _0x2dcd56={'key':_0x49a1ea['body'][_0xed26('0x2c')]};if(_0x49a1ea[_0xed26('0x43')][_0xed26('0x45')]){_0x2dcd56[_0xed26('0x45')]=_0x49a1ea[_0xed26('0x43')]['MailAccountId'];}else if(_0x49a1ea[_0xed26('0x43')][_0xed26('0x46')]){_0x2dcd56['SmsAccountId']=_0x49a1ea[_0xed26('0x43')][_0xed26('0x46')];}else if(_0x49a1ea[_0xed26('0x43')][_0xed26('0x47')]){_0x2dcd56[_0xed26('0x47')]=_0x49a1ea[_0xed26('0x43')][_0xed26('0x47')];}else if(_0x49a1ea[_0xed26('0x43')]['ChatWebsiteId']){_0x2dcd56[_0xed26('0x48')]=_0x49a1ea[_0xed26('0x43')][_0xed26('0x48')];}return db['CannedAnswer'][_0xed26('0x42')]({'where':_0x2dcd56})[_0xed26('0x22')](function(_0x2831c8){if(_0x2831c8){throw new db[(_0xed26('0x49'))]['ValidationError'](_0xed26('0x4a'));}return db['CannedAnswer'][_0xed26('0x44')](_0x49a1ea[_0xed26('0x43')]);})['then'](function(_0x5081f9){var _0x59872d=_0x49a1ea[_0xed26('0x4b')]['get']({'plain':!![]});if(!_0x59872d)throw new Error(_0xed26('0x4c'));if(_0x59872d[_0xed26('0x4d')]===_0xed26('0x4b')){var _0x127d2b=_0x5081f9[_0xed26('0x20')]({'plain':!![]});return db[_0xed26('0x4e')]['find']({'where':{'name':_0xed26('0x4f'),'userProfileId':_0x59872d[_0xed26('0x50')]},'raw':!![]})['then'](function(_0x29a374){if(_0x29a374&&_0x29a374[_0xed26('0x51')]===0x0){return db[_0xed26('0x21')][_0xed26('0x44')]({'name':_0x127d2b['name'],'resourceId':_0x127d2b['id'],'type':_0x29a374[_0xed26('0x25')],'sectionId':_0x29a374['id']},{})[_0xed26('0x22')](function(){return _0x5081f9;});}else{return _0x5081f9;}})['catch'](function(_0x42783f){logger['error'](_0xed26('0x52'),_0x42783f);throw _0x42783f;});}return _0x5081f9;})[_0xed26('0x22')](respondWithResult(_0x8df202,0xc9))[_0xed26('0x40')](handleError(_0x8df202,null));}; \ No newline at end of file +var _0x0422=['OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','count','offset','set','Content-Range','json','apply','reject','update','then','destroy','get','CannedAnswers','UserProfileResource','error','stack','name','index','map','CannedAnswer','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','limit','order','sort','where','filter','merge','options','includeAll','include','rows','catch','params','body','find','create','MailAccountId','SmsAccountId'];(function(_0x1193f3,_0x384810){var _0xc266c2=function(_0x344bff){while(--_0x344bff){_0x1193f3['push'](_0x1193f3['shift']());}};_0xc266c2(++_0x384810);}(_0x0422,0xb4));var _0x2042=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0x0422[_0x17928f];return _0x500b63;};'use strict';var emlformat=require(_0x2042('0x0'));var rimraf=require(_0x2042('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2042('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2042('0x3'));var path=require(_0x2042('0x4'));var sox=require(_0x2042('0x5'));var csv=require(_0x2042('0x6'));var ejs=require(_0x2042('0x7'));var fs=require('fs');var fs_extra=require(_0x2042('0x8'));var _=require(_0x2042('0x9'));var squel=require('squel');var crypto=require(_0x2042('0xa'));var jsforce=require(_0x2042('0xb'));var deskjs=require(_0x2042('0xc'));var toCsv=require(_0x2042('0x6'));var querystring=require(_0x2042('0xd'));var Papa=require('papaparse');var Redis=require(_0x2042('0xe'));var authService=require(_0x2042('0xf'));var qs=require(_0x2042('0x10'));var as=require(_0x2042('0x11'));var hardwareService=require(_0x2042('0x12'));var logger=require(_0x2042('0x13'))('api');var utils=require(_0x2042('0x14'));var config=require(_0x2042('0x15'));var licenseUtil=require(_0x2042('0x16'));var db=require(_0x2042('0x17'))['db'];function respondWithStatusCode(_0x17f870,_0x903924){_0x903924=_0x903924||0xcc;return function(_0x2b2b1e){if(_0x2b2b1e){return _0x17f870['sendStatus'](_0x903924);}return _0x17f870[_0x2042('0x18')](_0x903924)[_0x2042('0x19')]();};}function respondWithResult(_0x42c77a,_0xc432f4){_0xc432f4=_0xc432f4||0xc8;return function(_0x4ab301){if(_0x4ab301){return _0x42c77a[_0x2042('0x18')](_0xc432f4)['json'](_0x4ab301);}};}function respondWithFilteredResult(_0x18ea10,_0x42a8bd){return function(_0x3afc91){if(_0x3afc91){var _0x5cfea6=typeof _0x42a8bd['offset']===_0x2042('0x1a')&&typeof _0x42a8bd['limit']===_0x2042('0x1a');var _0xc5044b=_0x3afc91[_0x2042('0x1b')];var _0x13ba00=_0x5cfea6?0x0:_0x42a8bd[_0x2042('0x1c')];var _0x5c4a53=_0x5cfea6?_0x3afc91[_0x2042('0x1b')]:_0x42a8bd[_0x2042('0x1c')]+_0x42a8bd['limit'];var _0x1ff2fc;if(_0x5c4a53>=_0xc5044b){_0x5c4a53=_0xc5044b;_0x1ff2fc=0xc8;}else{_0x1ff2fc=0xce;}_0x18ea10[_0x2042('0x18')](_0x1ff2fc);return _0x18ea10[_0x2042('0x1d')](_0x2042('0x1e'),_0x13ba00+'-'+_0x5c4a53+'/'+_0xc5044b)[_0x2042('0x1f')](_0x3afc91);}return null;};}function patchUpdates(_0x553d61){return function(_0x587885){try{jsonpatch[_0x2042('0x20')](_0x587885,_0x553d61,!![]);}catch(_0x478dea){return BPromise[_0x2042('0x21')](_0x478dea);}return _0x587885['save']();};}function saveUpdates(_0x42b395,_0x544055){return function(_0x3214de){if(_0x3214de){return _0x3214de[_0x2042('0x22')](_0x42b395)[_0x2042('0x23')](function(_0x21d537){return _0x21d537;});}return null;};}function removeEntity(_0x3512bd,_0x308794){return function(_0x47a043){if(_0x47a043){return _0x47a043[_0x2042('0x24')]()[_0x2042('0x23')](function(){var _0x18722d=_0x47a043[_0x2042('0x25')]({'plain':!![]});var _0x24cc00=_0x2042('0x26');return db[_0x2042('0x27')][_0x2042('0x24')]({'where':{'type':_0x24cc00,'resourceId':_0x18722d['id']}})[_0x2042('0x23')](function(){return _0x47a043;});})[_0x2042('0x23')](function(){_0x3512bd[_0x2042('0x18')](0xcc)[_0x2042('0x19')]();});}};}function handleEntityNotFound(_0x2845ad,_0x352e01){return function(_0x209cf8){if(!_0x209cf8){_0x2845ad['sendStatus'](0x194);}return _0x209cf8;};}function handleError(_0x47a54a,_0xfdaaa6){_0xfdaaa6=_0xfdaaa6||0x1f4;return function(_0x13db7e){logger[_0x2042('0x28')](_0x13db7e[_0x2042('0x29')]);if(_0x13db7e[_0x2042('0x2a')]){delete _0x13db7e[_0x2042('0x2a')];}_0x47a54a[_0x2042('0x18')](_0xfdaaa6)['send'](_0x13db7e);};}exports[_0x2042('0x2b')]=function(_0x542188,_0x7343a8){var _0x212d31={},_0x2a38fa={},_0x45e5fc={'count':0x0,'rows':[]};var _0x309e58=_[_0x2042('0x2c')](db[_0x2042('0x2d')][_0x2042('0x2e')],function(_0x549370){return{'name':_0x549370[_0x2042('0x2f')],'type':_0x549370['type'][_0x2042('0x30')]};});_0x2a38fa[_0x2042('0x31')]=_[_0x2042('0x2c')](_0x309e58,_0x2042('0x2a'));_0x2a38fa[_0x2042('0x32')]=_[_0x2042('0x33')](_0x542188['query']);_0x2a38fa[_0x2042('0x34')]=_['intersection'](_0x2a38fa[_0x2042('0x31')],_0x2a38fa['query']);_0x212d31[_0x2042('0x35')]=_[_0x2042('0x36')](_0x2a38fa[_0x2042('0x31')],qs[_0x2042('0x37')](_0x542188['query'][_0x2042('0x37')]));_0x212d31[_0x2042('0x35')]=_0x212d31[_0x2042('0x35')][_0x2042('0x38')]?_0x212d31[_0x2042('0x35')]:_0x2a38fa[_0x2042('0x31')];if(!_0x542188[_0x2042('0x32')]['hasOwnProperty'](_0x2042('0x39'))){_0x212d31['limit']=qs['limit'](_0x542188[_0x2042('0x32')][_0x2042('0x3a')]);_0x212d31[_0x2042('0x1c')]=qs[_0x2042('0x1c')](_0x542188[_0x2042('0x32')]['offset']);}_0x212d31[_0x2042('0x3b')]=qs[_0x2042('0x3c')](_0x542188[_0x2042('0x32')][_0x2042('0x3c')]);_0x212d31[_0x2042('0x3d')]=qs[_0x2042('0x34')](_['pick'](_0x542188['query'],_0x2a38fa['filters']),_0x309e58);if(_0x542188[_0x2042('0x32')][_0x2042('0x3e')]){_0x212d31[_0x2042('0x3d')]=_[_0x2042('0x3f')](_0x212d31[_0x2042('0x3d')],{'$or':[{'key':{'$like':'%'+_0x542188[_0x2042('0x32')][_0x2042('0x3e')]+'%'}},{'value':{'$like':'%'+_0x542188[_0x2042('0x32')]['filter']+'%'}}]});}_0x212d31=_[_0x2042('0x3f')]({},_0x212d31,_0x542188[_0x2042('0x40')]);var _0x4f6922={'where':_0x212d31[_0x2042('0x3d')]};return db['CannedAnswer'][_0x2042('0x1b')](_0x4f6922)[_0x2042('0x23')](function(_0x1020bf){_0x45e5fc[_0x2042('0x1b')]=_0x1020bf;if(_0x542188[_0x2042('0x32')][_0x2042('0x41')]){_0x212d31[_0x2042('0x42')]=[{'all':!![]}];}return db[_0x2042('0x2d')]['findAll'](_0x212d31);})['then'](function(_0x3a265a){_0x45e5fc[_0x2042('0x43')]=_0x3a265a;return _0x45e5fc;})[_0x2042('0x23')](respondWithFilteredResult(_0x7343a8,_0x212d31))[_0x2042('0x44')](handleError(_0x7343a8,null));};exports['show']=function(_0x5f28b5,_0x16c85e){var _0x4bac68={'raw':!![],'where':{'id':_0x5f28b5[_0x2042('0x45')]['id']}},_0x5a1b19={};_0x5a1b19[_0x2042('0x31')]=_[_0x2042('0x33')](db[_0x2042('0x2d')][_0x2042('0x2e')]);_0x5a1b19[_0x2042('0x32')]=_[_0x2042('0x33')](_0x5f28b5['query']);_0x5a1b19['filters']=_[_0x2042('0x36')](_0x5a1b19[_0x2042('0x31')],_0x5a1b19[_0x2042('0x32')]);_0x4bac68[_0x2042('0x35')]=_[_0x2042('0x36')](_0x5a1b19[_0x2042('0x31')],qs[_0x2042('0x37')](_0x5f28b5['query'][_0x2042('0x37')]));_0x4bac68[_0x2042('0x35')]=_0x4bac68[_0x2042('0x35')]['length']?_0x4bac68[_0x2042('0x35')]:_0x5a1b19[_0x2042('0x31')];if(_0x5f28b5[_0x2042('0x32')][_0x2042('0x41')]){_0x4bac68[_0x2042('0x42')]=[{'all':!![]}];}_0x4bac68=_[_0x2042('0x3f')]({},_0x4bac68,_0x5f28b5[_0x2042('0x40')]);return db[_0x2042('0x2d')]['find'](_0x4bac68)[_0x2042('0x23')](handleEntityNotFound(_0x16c85e,null))['then'](respondWithResult(_0x16c85e,null))[_0x2042('0x44')](handleError(_0x16c85e,null));};exports['update']=function(_0x503f91,_0x53fd2f){if(_0x503f91[_0x2042('0x46')]['id']){delete _0x503f91['body']['id'];}return db[_0x2042('0x2d')]['find']({'where':{'id':_0x503f91['params']['id']}})['then'](handleEntityNotFound(_0x53fd2f,null))[_0x2042('0x23')](saveUpdates(_0x503f91[_0x2042('0x46')],null))[_0x2042('0x23')](respondWithResult(_0x53fd2f,null))[_0x2042('0x44')](handleError(_0x53fd2f,null));};exports[_0x2042('0x24')]=function(_0x3aacc8,_0x388c90){return db[_0x2042('0x2d')][_0x2042('0x47')]({'where':{'id':_0x3aacc8[_0x2042('0x45')]['id']}})[_0x2042('0x23')](handleEntityNotFound(_0x388c90,null))[_0x2042('0x23')](removeEntity(_0x388c90,null))[_0x2042('0x44')](handleError(_0x388c90,null));};exports[_0x2042('0x48')]=function(_0x2b4e71,_0x4ebe48){var _0x5a655d={'key':_0x2b4e71[_0x2042('0x46')][_0x2042('0x30')]};if(_0x2b4e71[_0x2042('0x46')][_0x2042('0x49')]){_0x5a655d[_0x2042('0x49')]=_0x2b4e71[_0x2042('0x46')][_0x2042('0x49')];}else if(_0x2b4e71[_0x2042('0x46')]['SmsAccountId']){_0x5a655d[_0x2042('0x4a')]=_0x2b4e71['body'][_0x2042('0x4a')];}else if(_0x2b4e71[_0x2042('0x46')][_0x2042('0x4b')]){_0x5a655d[_0x2042('0x4b')]=_0x2b4e71[_0x2042('0x46')]['OpenchannelAccountId'];}else if(_0x2b4e71[_0x2042('0x46')]['ChatWebsiteId']){_0x5a655d[_0x2042('0x4c')]=_0x2b4e71[_0x2042('0x46')][_0x2042('0x4c')];}return db[_0x2042('0x2d')][_0x2042('0x47')]({'where':_0x5a655d})[_0x2042('0x23')](function(_0x2120a5){if(_0x2120a5){throw new db[(_0x2042('0x4d'))][(_0x2042('0x4e'))](_0x2042('0x4f'));}return db['CannedAnswer'][_0x2042('0x48')](_0x2b4e71['body']);})[_0x2042('0x23')](function(_0x2316ac){var _0x274c83=_0x2b4e71['user']['get']({'plain':!![]});if(!_0x274c83)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x274c83['role']===_0x2042('0x50')){var _0x2e3184=_0x2316ac[_0x2042('0x25')]({'plain':!![]});return db[_0x2042('0x51')][_0x2042('0x47')]({'where':{'name':_0x2042('0x26'),'userProfileId':_0x274c83[_0x2042('0x52')]},'raw':!![]})['then'](function(_0x3649ab){if(_0x3649ab&&_0x3649ab[_0x2042('0x53')]===0x0){return db[_0x2042('0x27')][_0x2042('0x48')]({'name':_0x2e3184[_0x2042('0x2a')],'resourceId':_0x2e3184['id'],'type':_0x3649ab['name'],'sectionId':_0x3649ab['id']},{})[_0x2042('0x23')](function(){return _0x2316ac;});}else{return _0x2316ac;}})[_0x2042('0x44')](function(_0x420c27){logger[_0x2042('0x28')](_0x2042('0x54'),_0x420c27);throw _0x420c27;});}return _0x2316ac;})[_0x2042('0x23')](respondWithResult(_0x4ebe48,0xc9))[_0x2042('0x44')](handleError(_0x4ebe48,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index bd41b8e..104b32f 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 _0xde0b=['utf8mb4','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cannedAnswer.attributes','exports','CannedAnswer'];(function(_0x5060c3,_0x1a7135){var _0x402214=function(_0x331443){while(--_0x331443){_0x5060c3['push'](_0x5060c3['shift']());}};_0x402214(++_0x1a7135);}(_0xde0b,0x91));var _0xbde0=function(_0x585c3a,_0x1143fc){_0x585c3a=_0x585c3a-0x0;var _0xd41316=_0xde0b[_0x585c3a];return _0xd41316;};'use strict';var _=require(_0xbde0('0x0'));var util=require('util');var logger=require(_0xbde0('0x1'))(_0xbde0('0x2'));var moment=require(_0xbde0('0x3'));var BPromise=require(_0xbde0('0x4'));var rp=require(_0xbde0('0x5'));var fs=require('fs');var path=require(_0xbde0('0x6'));var rimraf=require(_0xbde0('0x7'));var config=require('../../config/environment');var attributes=require(_0xbde0('0x8'));module[_0xbde0('0x9')]=function(_0x5d38f8,_0x410b16){return _0x5d38f8['define'](_0xbde0('0xa'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbde0('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xc374=['api','moment','bluebird','../../config/environment','./cannedAnswer.attributes','exports','define','utf8mb4','util','../../config/logger'];(function(_0x2ccb91,_0xa2c1b4){var _0x4136ca=function(_0x4326f0){while(--_0x4326f0){_0x2ccb91['push'](_0x2ccb91['shift']());}};_0x4136ca(++_0xa2c1b4);}(_0xc374,0x184));var _0x4c37=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc374[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x4c37('0x0'));var logger=require(_0x4c37('0x1'))(_0x4c37('0x2'));var moment=require(_0x4c37('0x3'));var BPromise=require(_0x4c37('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4c37('0x5'));var attributes=require(_0x4c37('0x6'));module[_0x4c37('0x7')]=function(_0x41eb49,_0x1443eb){return _0x41eb49[_0x4c37('0x8')]('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4c37('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 435ff44..2a6ce4b 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(_0x1b32e4,_0x1be67b){var _0x5094b6=function(_0x32d662){while(--_0x32d662){_0x1b32e4['push'](_0x1b32e4['shift']());}};_0x5094b6(++_0x1be67b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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(_0x89d5a2,_0x2ace47){var _0x34e507=function(_0x42d9ee){while(--_0x42d9ee){_0x89d5a2['push'](_0x89d5a2['shift']());}};_0x34e507(++_0x2ace47);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'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 17e33c0..8e582fc 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 _0xe5cc=['path','connect-timeout','express','fs-extra','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','index','/:id','post','update','exports','multer','util'];(function(_0x337c33,_0x508d9a){var _0x23f2da=function(_0x4f4030){while(--_0x4f4030){_0x337c33['push'](_0x337c33['shift']());}};_0x23f2da(++_0x508d9a);}(_0xe5cc,0x1ed));var _0xce5c=function(_0x31c20d,_0x1df533){_0x31c20d=_0x31c20d-0x0;var _0x36d712=_0xe5cc[_0x31c20d];return _0x36d712;};'use strict';var multer=require(_0xce5c('0x0'));var util=require(_0xce5c('0x1'));var path=require(_0xce5c('0x2'));var timeout=require(_0xce5c('0x3'));var express=require(_0xce5c('0x4'));var router=express['Router']();var fs_extra=require(_0xce5c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xce5c('0x6'));var config=require('../../config/environment');var controller=require(_0xce5c('0x7'));router[_0xce5c('0x8')]('/',auth[_0xce5c('0x9')](),controller[_0xce5c('0xa')]);router['get'](_0xce5c('0xb'),auth[_0xce5c('0x9')](),controller['show']);router[_0xce5c('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xce5c('0xb'),auth['isAuthenticated'](),controller[_0xce5c('0xd')]);router['delete'](_0xce5c('0xb'),auth[_0xce5c('0x9')](),controller['destroy']);module[_0xce5c('0xe')]=router; \ No newline at end of file +var _0xc018=['path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','create','update','delete','destroy','multer','util'];(function(_0x4b7362,_0x189886){var _0x33025e=function(_0x5874f6){while(--_0x5874f6){_0x4b7362['push'](_0x4b7362['shift']());}};_0x33025e(++_0x189886);}(_0xc018,0x174));var _0x8c01=function(_0x58d4f8,_0x71966d){_0x58d4f8=_0x58d4f8-0x0;var _0x178e25=_0xc018[_0x58d4f8];return _0x178e25;};'use strict';var multer=require(_0x8c01('0x0'));var util=require(_0x8c01('0x1'));var path=require(_0x8c01('0x2'));var timeout=require('connect-timeout');var express=require(_0x8c01('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8c01('0x4'));var interaction=require(_0x8c01('0x5'));var config=require(_0x8c01('0x6'));var controller=require(_0x8c01('0x7'));router[_0x8c01('0x8')]('/',auth[_0x8c01('0x9')](),controller[_0x8c01('0xa')]);router[_0x8c01('0x8')](_0x8c01('0xb'),auth[_0x8c01('0x9')](),controller[_0x8c01('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8c01('0xd')]);router['put']('/:id',auth[_0x8c01('0x9')](),controller[_0x8c01('0xe')]);router[_0x8c01('0xf')](_0x8c01('0xb'),auth[_0x8c01('0x9')](),controller[_0x8c01('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 1fd7dea..60c465d 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 _0x0545=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0x0545,0x17e));var _0x5054=function(_0x116552,_0x2fd568){_0x116552=_0x116552-0x0;var _0x14552d=_0x0545[_0x116552];return _0x14552d;};'use strict';var Sequelize=require(_0x5054('0x0'));module[_0x5054('0x1')]={'calldate':{'type':Sequelize[_0x5054('0x2')],'allowNull':![],'defaultValue':_0x5054('0x3')},'clid':{'type':Sequelize[_0x5054('0x4')]},'src':{'type':Sequelize[_0x5054('0x4')]},'dst':{'type':Sequelize[_0x5054('0x4')]},'dcontext':{'type':Sequelize[_0x5054('0x4')]},'channel':{'type':Sequelize[_0x5054('0x4')]},'dstchannel':{'type':Sequelize[_0x5054('0x4')]},'lastapp':{'type':Sequelize[_0x5054('0x4')]},'lastdata':{'type':Sequelize[_0x5054('0x4')]},'duration':{'type':Sequelize[_0x5054('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x5054('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x5054('0x4')]},'amaflags':{'type':Sequelize[_0x5054('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x5054('0x4')]},'userfield':{'type':Sequelize[_0x5054('0x4')]},'uniqueid':{'type':Sequelize[_0x5054('0x4')]},'linkedid':{'type':Sequelize[_0x5054('0x4')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x5054('0x4')]},'type':{'type':Sequelize[_0x5054('0x4')]},'tag':{'type':Sequelize[_0x5054('0x4')]}}; \ No newline at end of file +var _0x6916=['1970-01-01\x2000:00:01','STRING','INTEGER','exports','DATE'];(function(_0xc8129b,_0x2b7c4){var _0x1c0e80=function(_0x469f93){while(--_0x469f93){_0xc8129b['push'](_0xc8129b['shift']());}};_0x1c0e80(++_0x2b7c4);}(_0x6916,0x1ed));var _0x6691=function(_0x8217b7,_0x3fadbe){_0x8217b7=_0x8217b7-0x0;var _0x539db3=_0x6916[_0x8217b7];return _0x539db3;};'use strict';var Sequelize=require('sequelize');module[_0x6691('0x0')]={'calldate':{'type':Sequelize[_0x6691('0x1')],'allowNull':![],'defaultValue':_0x6691('0x2')},'clid':{'type':Sequelize[_0x6691('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x6691('0x3')]},'dcontext':{'type':Sequelize[_0x6691('0x3')]},'channel':{'type':Sequelize[_0x6691('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x6691('0x3')]},'duration':{'type':Sequelize[_0x6691('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x6691('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x6691('0x3')]},'amaflags':{'type':Sequelize[_0x6691('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x6691('0x3')]},'userfield':{'type':Sequelize[_0x6691('0x3')]},'uniqueid':{'type':Sequelize[_0x6691('0x3')]},'linkedid':{'type':Sequelize[_0x6691('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x6691('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x6691('0x3')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 33b670b..44efcc4 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 _0x5292=['rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','length','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','params','fields','options','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','lodash','squel','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','count','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','Cdr'];(function(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0x5292,0xf7));var _0x2529=function(_0x5bb9ac,_0x417c09){_0x5bb9ac=_0x5bb9ac-0x0;var _0x38fd65=_0x5292[_0x5bb9ac];return _0x38fd65;};'use strict';var emlformat=require(_0x2529('0x0'));var rimraf=require(_0x2529('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2529('0x2'));var rp=require('request-promise');var moment=require(_0x2529('0x3'));var BPromise=require(_0x2529('0x4'));var Mustache=require(_0x2529('0x5'));var util=require(_0x2529('0x6'));var path=require('path');var sox=require(_0x2529('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2529('0x8'));var squel=require(_0x2529('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2529('0xa'));var toCsv=require(_0x2529('0xb'));var querystring=require('querystring');var Papa=require(_0x2529('0xc'));var Redis=require(_0x2529('0xd'));var authService=require(_0x2529('0xe'));var qs=require(_0x2529('0xf'));var as=require(_0x2529('0x10'));var hardwareService=require(_0x2529('0x11'));var logger=require(_0x2529('0x12'))(_0x2529('0x13'));var utils=require('../../config/utils');var config=require(_0x2529('0x14'));var licenseUtil=require(_0x2529('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe333c9,_0x23bfaf){_0x23bfaf=_0x23bfaf||0xcc;return function(_0x149692){if(_0x149692){return _0xe333c9[_0x2529('0x16')](_0x23bfaf);}return _0xe333c9[_0x2529('0x17')](_0x23bfaf)[_0x2529('0x18')]();};}function respondWithResult(_0x3f3b40,_0x5245cf){_0x5245cf=_0x5245cf||0xc8;return function(_0x101668){if(_0x101668){return _0x3f3b40[_0x2529('0x17')](_0x5245cf)[_0x2529('0x19')](_0x101668);}};}function respondWithFilteredResult(_0x19e4bf,_0x1cc716){return function(_0x2598a1){if(_0x2598a1){var _0x1a1ccc=typeof _0x1cc716[_0x2529('0x1a')]==='undefined'&&typeof _0x1cc716[_0x2529('0x1b')]==='undefined';var _0x337720=_0x2598a1[_0x2529('0x1c')];var _0x89be58=_0x1a1ccc?0x0:_0x1cc716['offset'];var _0x5b4d0d=_0x1a1ccc?_0x2598a1[_0x2529('0x1c')]:_0x1cc716[_0x2529('0x1a')]+_0x1cc716[_0x2529('0x1b')];var _0x37204a;if(_0x5b4d0d>=_0x337720){_0x5b4d0d=_0x337720;_0x37204a=0xc8;}else{_0x37204a=0xce;}_0x19e4bf[_0x2529('0x17')](_0x37204a);return _0x19e4bf['set'](_0x2529('0x1d'),_0x89be58+'-'+_0x5b4d0d+'/'+_0x337720)[_0x2529('0x19')](_0x2598a1);}return null;};}function patchUpdates(_0x1ca15f){return function(_0xeff5a6){try{jsonpatch['apply'](_0xeff5a6,_0x1ca15f,!![]);}catch(_0x1fa873){return BPromise[_0x2529('0x1e')](_0x1fa873);}return _0xeff5a6[_0x2529('0x1f')]();};}function saveUpdates(_0x5b4760,_0x3d5d17){return function(_0x3f57da){if(_0x3f57da){return _0x3f57da[_0x2529('0x20')](_0x5b4760)[_0x2529('0x21')](function(_0x5540e4){return _0x5540e4;});}return null;};}function removeEntity(_0x2736f6,_0x2d0c6d){return function(_0x400a01){if(_0x400a01){return _0x400a01[_0x2529('0x22')]()[_0x2529('0x21')](function(){_0x2736f6[_0x2529('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5539ef,_0x856e50){return function(_0x40f42b){if(!_0x40f42b){_0x5539ef[_0x2529('0x16')](0x194);}return _0x40f42b;};}function handleError(_0x431c40,_0x24418a){_0x24418a=_0x24418a||0x1f4;return function(_0x2a8371){logger[_0x2529('0x23')](_0x2a8371[_0x2529('0x24')]);if(_0x2a8371[_0x2529('0x25')]){delete _0x2a8371[_0x2529('0x25')];}_0x431c40['status'](_0x24418a)[_0x2529('0x26')](_0x2a8371);};}exports[_0x2529('0x27')]=function(_0x4dd0fb,_0x1822ce){var _0x3c46c6={},_0x5bea2d={},_0x17bcbd={'count':0x0,'rows':[]};var _0x1d7e98=_['map'](db[_0x2529('0x28')][_0x2529('0x29')],function(_0x4a18f6){return{'name':_0x4a18f6[_0x2529('0x2a')],'type':_0x4a18f6[_0x2529('0x2b')][_0x2529('0x2c')]};});_0x5bea2d[_0x2529('0x2d')]=_[_0x2529('0x2e')](_0x1d7e98,'name');_0x5bea2d[_0x2529('0x2f')]=_[_0x2529('0x30')](_0x4dd0fb[_0x2529('0x2f')]);_0x5bea2d[_0x2529('0x31')]=_[_0x2529('0x32')](_0x5bea2d[_0x2529('0x2d')],_0x5bea2d[_0x2529('0x2f')]);_0x3c46c6['attributes']=_['intersection'](_0x5bea2d[_0x2529('0x2d')],qs['fields'](_0x4dd0fb[_0x2529('0x2f')]['fields']));_0x3c46c6['attributes']=_0x3c46c6['attributes'][_0x2529('0x33')]?_0x3c46c6[_0x2529('0x34')]:_0x5bea2d[_0x2529('0x2d')];if(!_0x4dd0fb['query'][_0x2529('0x35')]('nolimit')){_0x3c46c6['limit']=qs['limit'](_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x1b')]);_0x3c46c6[_0x2529('0x1a')]=qs[_0x2529('0x1a')](_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x1a')]);}_0x3c46c6[_0x2529('0x36')]=qs[_0x2529('0x37')](_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x37')]);_0x3c46c6[_0x2529('0x38')]=qs[_0x2529('0x31')](_[_0x2529('0x39')](_0x4dd0fb['query'],_0x5bea2d['filters']),_0x1d7e98);if(_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x3a')]){_0x3c46c6['where']=_[_0x2529('0x3b')](_0x3c46c6[_0x2529('0x38')],{'$or':_[_0x2529('0x2e')](_0x1d7e98,function(_0x1b1f81){if(_0x1b1f81[_0x2529('0x2b')]!==_0x2529('0x3c')){var _0x1b8226={};_0x1b8226[_0x1b1f81['name']]={'$like':'%'+_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x3a')]+'%'};return _0x1b8226;}})});}_0x3c46c6=_[_0x2529('0x3b')]({},_0x3c46c6,_0x4dd0fb['options']);var _0x1393b7={'where':_0x3c46c6[_0x2529('0x38')]};return db[_0x2529('0x28')][_0x2529('0x1c')](_0x1393b7)[_0x2529('0x21')](function(_0x33acbf){_0x17bcbd[_0x2529('0x1c')]=_0x33acbf;if(_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x3d')]){_0x3c46c6['include']=[{'all':!![]}];}return db[_0x2529('0x28')][_0x2529('0x3e')](_0x3c46c6);})[_0x2529('0x21')](function(_0x3b4e47){_0x17bcbd[_0x2529('0x3f')]=_0x3b4e47;return _0x17bcbd;})[_0x2529('0x21')](respondWithFilteredResult(_0x1822ce,_0x3c46c6))[_0x2529('0x40')](handleError(_0x1822ce,null));};exports['show']=function(_0x8ced2e,_0x33a13e){var _0x3f76e8={'raw':!![],'where':{'id':_0x8ced2e[_0x2529('0x41')]['id']}},_0x2aaecb={};_0x2aaecb['model']=_[_0x2529('0x30')](db[_0x2529('0x28')][_0x2529('0x29')]);_0x2aaecb[_0x2529('0x2f')]=_[_0x2529('0x30')](_0x8ced2e[_0x2529('0x2f')]);_0x2aaecb['filters']=_['intersection'](_0x2aaecb['model'],_0x2aaecb['query']);_0x3f76e8[_0x2529('0x34')]=_['intersection'](_0x2aaecb[_0x2529('0x2d')],qs[_0x2529('0x42')](_0x8ced2e[_0x2529('0x2f')][_0x2529('0x42')]));_0x3f76e8[_0x2529('0x34')]=_0x3f76e8['attributes'][_0x2529('0x33')]?_0x3f76e8['attributes']:_0x2aaecb[_0x2529('0x2d')];if(_0x8ced2e['query'][_0x2529('0x3d')]){_0x3f76e8['include']=[{'all':!![]}];}_0x3f76e8=_[_0x2529('0x3b')]({},_0x3f76e8,_0x8ced2e[_0x2529('0x43')]);return db['Cdr'][_0x2529('0x44')](_0x3f76e8)['then'](handleEntityNotFound(_0x33a13e,null))[_0x2529('0x21')](respondWithResult(_0x33a13e,null))[_0x2529('0x40')](handleError(_0x33a13e,null));};exports[_0x2529('0x45')]=function(_0x3c6d79,_0xdc4bef){return db[_0x2529('0x28')][_0x2529('0x45')](_0x3c6d79[_0x2529('0x46')],{})[_0x2529('0x21')](respondWithResult(_0xdc4bef,0xc9))['catch'](handleError(_0xdc4bef,null));};exports['update']=function(_0x5e72d1,_0x37a23a){if(_0x5e72d1[_0x2529('0x46')]['id']){delete _0x5e72d1[_0x2529('0x46')]['id'];}return db['Cdr']['find']({'where':{'id':_0x5e72d1[_0x2529('0x41')]['id']}})['then'](handleEntityNotFound(_0x37a23a,null))[_0x2529('0x21')](saveUpdates(_0x5e72d1[_0x2529('0x46')],null))[_0x2529('0x21')](respondWithResult(_0x37a23a,null))[_0x2529('0x40')](handleError(_0x37a23a,null));};exports[_0x2529('0x22')]=function(_0x196ee8,_0x4583ba){return db[_0x2529('0x28')]['find']({'where':{'id':_0x196ee8['params']['id']}})[_0x2529('0x21')](handleEntityNotFound(_0x4583ba,null))[_0x2529('0x21')](removeEntity(_0x4583ba,null))[_0x2529('0x40')](handleError(_0x4583ba,null));};exports[_0x2529('0x47')]=function(_0x1f76d3,_0x3ac799){return db[_0x2529('0x28')][_0x2529('0x47')]()[_0x2529('0x21')](respondWithResult(_0x3ac799,null))[_0x2529('0x40')](handleError(_0x3ac799,null));}; \ No newline at end of file +var _0xdc97=['api','../../config/utils','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','sendStatus','error','name','send','index','map','query','keys','filters','intersection','fields','attributes','length','model','hasOwnProperty','sort','where','filter','merge','type','VIRTUAL','options','Cdr','include','rows','catch','params','rawAttributes','includeAll','find','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x1e77c2,_0x56f35a){var _0x4a179c=function(_0x553e79){while(--_0x553e79){_0x1e77c2['push'](_0x1e77c2['shift']());}};_0x4a179c(++_0x56f35a);}(_0xdc97,0x13b));var _0x7dc9=function(_0x3d13fc,_0x249275){_0x3d13fc=_0x3d13fc-0x0;var _0x2013d4=_0xdc97[_0x3d13fc];return _0x2013d4;};'use strict';var emlformat=require(_0x7dc9('0x0'));var rimraf=require(_0x7dc9('0x1'));var zipdir=require(_0x7dc9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7dc9('0x3'));var moment=require('moment');var BPromise=require(_0x7dc9('0x4'));var Mustache=require(_0x7dc9('0x5'));var util=require('util');var path=require(_0x7dc9('0x6'));var sox=require(_0x7dc9('0x7'));var csv=require(_0x7dc9('0x8'));var ejs=require(_0x7dc9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7dc9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7dc9('0xb'));var deskjs=require(_0x7dc9('0xc'));var toCsv=require(_0x7dc9('0x8'));var querystring=require(_0x7dc9('0xd'));var Papa=require(_0x7dc9('0xe'));var Redis=require('ioredis');var authService=require(_0x7dc9('0xf'));var qs=require(_0x7dc9('0x10'));var as=require(_0x7dc9('0x11'));var hardwareService=require(_0x7dc9('0x12'));var logger=require(_0x7dc9('0x13'))(_0x7dc9('0x14'));var utils=require(_0x7dc9('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x599ef1,_0x94c75a){_0x94c75a=_0x94c75a||0xcc;return function(_0x14e5db){if(_0x14e5db){return _0x599ef1['sendStatus'](_0x94c75a);}return _0x599ef1[_0x7dc9('0x16')](_0x94c75a)[_0x7dc9('0x17')]();};}function respondWithResult(_0xaadf2,_0xf37bc7){_0xf37bc7=_0xf37bc7||0xc8;return function(_0x31d43d){if(_0x31d43d){return _0xaadf2[_0x7dc9('0x16')](_0xf37bc7)['json'](_0x31d43d);}};}function respondWithFilteredResult(_0x3a54f2,_0x278191){return function(_0x1b0aa1){if(_0x1b0aa1){var _0x442819=typeof _0x278191[_0x7dc9('0x18')]===_0x7dc9('0x19')&&typeof _0x278191[_0x7dc9('0x1a')]===_0x7dc9('0x19');var _0x4778d5=_0x1b0aa1['count'];var _0x22577e=_0x442819?0x0:_0x278191['offset'];var _0x1f5906=_0x442819?_0x1b0aa1[_0x7dc9('0x1b')]:_0x278191['offset']+_0x278191[_0x7dc9('0x1a')];var _0x3b738a;if(_0x1f5906>=_0x4778d5){_0x1f5906=_0x4778d5;_0x3b738a=0xc8;}else{_0x3b738a=0xce;}_0x3a54f2[_0x7dc9('0x16')](_0x3b738a);return _0x3a54f2[_0x7dc9('0x1c')](_0x7dc9('0x1d'),_0x22577e+'-'+_0x1f5906+'/'+_0x4778d5)[_0x7dc9('0x1e')](_0x1b0aa1);}return null;};}function patchUpdates(_0x2dad65){return function(_0x2895f5){try{jsonpatch[_0x7dc9('0x1f')](_0x2895f5,_0x2dad65,!![]);}catch(_0x2b38d6){return BPromise['reject'](_0x2b38d6);}return _0x2895f5['save']();};}function saveUpdates(_0x12954f,_0x5981e2){return function(_0x596e0f){if(_0x596e0f){return _0x596e0f[_0x7dc9('0x20')](_0x12954f)[_0x7dc9('0x21')](function(_0x5e9525){return _0x5e9525;});}return null;};}function removeEntity(_0xffc080,_0x43d31f){return function(_0x41110a){if(_0x41110a){return _0x41110a['destroy']()[_0x7dc9('0x21')](function(){_0xffc080[_0x7dc9('0x16')](0xcc)[_0x7dc9('0x17')]();});}};}function handleEntityNotFound(_0x55a482,_0x48c6bc){return function(_0x4b9ba6){if(!_0x4b9ba6){_0x55a482[_0x7dc9('0x22')](0x194);}return _0x4b9ba6;};}function handleError(_0x32d032,_0x5843bf){_0x5843bf=_0x5843bf||0x1f4;return function(_0x585eef){logger[_0x7dc9('0x23')](_0x585eef['stack']);if(_0x585eef[_0x7dc9('0x24')]){delete _0x585eef[_0x7dc9('0x24')];}_0x32d032[_0x7dc9('0x16')](_0x5843bf)[_0x7dc9('0x25')](_0x585eef);};}exports[_0x7dc9('0x26')]=function(_0x450124,_0x236d42){var _0x229f8e={},_0x1fcf0e={},_0x3c4379={'count':0x0,'rows':[]};var _0x14083d=_[_0x7dc9('0x27')](db['Cdr']['rawAttributes'],function(_0x513dd6){return{'name':_0x513dd6['fieldName'],'type':_0x513dd6['type']['key']};});_0x1fcf0e['model']=_['map'](_0x14083d,_0x7dc9('0x24'));_0x1fcf0e[_0x7dc9('0x28')]=_[_0x7dc9('0x29')](_0x450124[_0x7dc9('0x28')]);_0x1fcf0e[_0x7dc9('0x2a')]=_[_0x7dc9('0x2b')](_0x1fcf0e['model'],_0x1fcf0e['query']);_0x229f8e['attributes']=_[_0x7dc9('0x2b')](_0x1fcf0e['model'],qs[_0x7dc9('0x2c')](_0x450124[_0x7dc9('0x28')][_0x7dc9('0x2c')]));_0x229f8e[_0x7dc9('0x2d')]=_0x229f8e[_0x7dc9('0x2d')][_0x7dc9('0x2e')]?_0x229f8e[_0x7dc9('0x2d')]:_0x1fcf0e[_0x7dc9('0x2f')];if(!_0x450124['query'][_0x7dc9('0x30')]('nolimit')){_0x229f8e[_0x7dc9('0x1a')]=qs[_0x7dc9('0x1a')](_0x450124[_0x7dc9('0x28')][_0x7dc9('0x1a')]);_0x229f8e['offset']=qs[_0x7dc9('0x18')](_0x450124['query'][_0x7dc9('0x18')]);}_0x229f8e['order']=qs['sort'](_0x450124[_0x7dc9('0x28')][_0x7dc9('0x31')]);_0x229f8e[_0x7dc9('0x32')]=qs[_0x7dc9('0x2a')](_['pick'](_0x450124[_0x7dc9('0x28')],_0x1fcf0e[_0x7dc9('0x2a')]),_0x14083d);if(_0x450124[_0x7dc9('0x28')][_0x7dc9('0x33')]){_0x229f8e[_0x7dc9('0x32')]=_[_0x7dc9('0x34')](_0x229f8e[_0x7dc9('0x32')],{'$or':_[_0x7dc9('0x27')](_0x14083d,function(_0x166906){if(_0x166906[_0x7dc9('0x35')]!==_0x7dc9('0x36')){var _0x3a8d80={};_0x3a8d80[_0x166906['name']]={'$like':'%'+_0x450124[_0x7dc9('0x28')][_0x7dc9('0x33')]+'%'};return _0x3a8d80;}})});}_0x229f8e=_[_0x7dc9('0x34')]({},_0x229f8e,_0x450124[_0x7dc9('0x37')]);var _0x4bcdce={'where':_0x229f8e[_0x7dc9('0x32')]};return db[_0x7dc9('0x38')][_0x7dc9('0x1b')](_0x4bcdce)[_0x7dc9('0x21')](function(_0x295853){_0x3c4379[_0x7dc9('0x1b')]=_0x295853;if(_0x450124['query']['includeAll']){_0x229f8e[_0x7dc9('0x39')]=[{'all':!![]}];}return db[_0x7dc9('0x38')]['findAll'](_0x229f8e);})[_0x7dc9('0x21')](function(_0x4a37ec){_0x3c4379[_0x7dc9('0x3a')]=_0x4a37ec;return _0x3c4379;})[_0x7dc9('0x21')](respondWithFilteredResult(_0x236d42,_0x229f8e))[_0x7dc9('0x3b')](handleError(_0x236d42,null));};exports['show']=function(_0x1d5671,_0x1df27f){var _0x1929b6={'raw':!![],'where':{'id':_0x1d5671[_0x7dc9('0x3c')]['id']}},_0x95513c={};_0x95513c[_0x7dc9('0x2f')]=_[_0x7dc9('0x29')](db['Cdr'][_0x7dc9('0x3d')]);_0x95513c['query']=_['keys'](_0x1d5671[_0x7dc9('0x28')]);_0x95513c[_0x7dc9('0x2a')]=_[_0x7dc9('0x2b')](_0x95513c[_0x7dc9('0x2f')],_0x95513c[_0x7dc9('0x28')]);_0x1929b6[_0x7dc9('0x2d')]=_[_0x7dc9('0x2b')](_0x95513c[_0x7dc9('0x2f')],qs[_0x7dc9('0x2c')](_0x1d5671['query'][_0x7dc9('0x2c')]));_0x1929b6[_0x7dc9('0x2d')]=_0x1929b6[_0x7dc9('0x2d')][_0x7dc9('0x2e')]?_0x1929b6[_0x7dc9('0x2d')]:_0x95513c[_0x7dc9('0x2f')];if(_0x1d5671['query'][_0x7dc9('0x3e')]){_0x1929b6[_0x7dc9('0x39')]=[{'all':!![]}];}_0x1929b6=_['merge']({},_0x1929b6,_0x1d5671[_0x7dc9('0x37')]);return db[_0x7dc9('0x38')][_0x7dc9('0x3f')](_0x1929b6)['then'](handleEntityNotFound(_0x1df27f,null))[_0x7dc9('0x21')](respondWithResult(_0x1df27f,null))['catch'](handleError(_0x1df27f,null));};exports['create']=function(_0x303795,_0x30a315){return db[_0x7dc9('0x38')]['create'](_0x303795['body'],{})[_0x7dc9('0x21')](respondWithResult(_0x30a315,0xc9))['catch'](handleError(_0x30a315,null));};exports[_0x7dc9('0x20')]=function(_0x4ab558,_0x5e2d59){if(_0x4ab558[_0x7dc9('0x40')]['id']){delete _0x4ab558[_0x7dc9('0x40')]['id'];}return db[_0x7dc9('0x38')][_0x7dc9('0x3f')]({'where':{'id':_0x4ab558[_0x7dc9('0x3c')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x5e2d59,null))[_0x7dc9('0x21')](saveUpdates(_0x4ab558[_0x7dc9('0x40')],null))[_0x7dc9('0x21')](respondWithResult(_0x5e2d59,null))[_0x7dc9('0x3b')](handleError(_0x5e2d59,null));};exports[_0x7dc9('0x41')]=function(_0x13580b,_0x1658c0){return db['Cdr'][_0x7dc9('0x3f')]({'where':{'id':_0x13580b['params']['id']}})['then'](handleEntityNotFound(_0x1658c0,null))[_0x7dc9('0x21')](removeEntity(_0x1658c0,null))[_0x7dc9('0x3b')](handleError(_0x1658c0,null));};exports[_0x7dc9('0x42')]=function(_0x3902aa,_0x346d27){return db['Cdr'][_0x7dc9('0x42')]()[_0x7dc9('0x21')](respondWithResult(_0x346d27,null))[_0x7dc9('0x3b')](handleError(_0x346d27,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index da4b9bb..39b793f 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(_0x417c6d,_0x2f1520){var _0x20ce91=function(_0x430ec1){while(--_0x430ec1){_0x417c6d['push'](_0x417c6d['shift']());}};_0x20ce91(++_0x2f1520);}(_0x7a54,0x106));var _0x47a5=function(_0xf0952e,_0x45aa37){_0xf0952e=_0xf0952e-0x0;var _0x57cdf0=_0x7a54[_0xf0952e];return _0x57cdf0;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x3be1e3,_0x248d3c){var _0x8289bd=function(_0x2c22fd){while(--_0x2c22fd){_0x3be1e3['push'](_0x3be1e3['shift']());}};_0x8289bd(++_0x248d3c);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index d7060a3..efebe7d 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 _0x6e85=['Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','Cdr,\x20%s,\x20%s','request\x20sent'];(function(_0x5a0e2f,_0x50930a){var _0x1baeb8=function(_0x94d165){while(--_0x94d165){_0x5a0e2f['push'](_0x5a0e2f['shift']());}};_0x1baeb8(++_0x50930a);}(_0x6e85,0x16c));var _0x56e8=function(_0x2b0e35,_0x563999){_0x2b0e35=_0x2b0e35-0x0;var _0x14714a=_0x6e85[_0x2b0e35];return _0x14714a;};'use strict';var _=require(_0x56e8('0x0'));var util=require('util');var moment=require(_0x56e8('0x1'));var BPromise=require(_0x56e8('0x2'));var rs=require(_0x56e8('0x3'));var fs=require('fs');var Redis=require(_0x56e8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x56e8('0x5'));var logger=require(_0x56e8('0x6'))('rpc');var config=require(_0x56e8('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x56e8('0x8')][_0x56e8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c1501,_0x2e35d4,_0x196bcd){return new BPromise(function(_0x44dcad,_0x551a68){return client['request'](_0x4c1501,_0x196bcd)[_0x56e8('0xa')](function(_0x518ee3){logger[_0x56e8('0xb')](_0x56e8('0xc'),_0x2e35d4,_0x56e8('0xd'));logger['debug'](_0x56e8('0xe'),_0x2e35d4,_0x56e8('0xd'),JSON[_0x56e8('0xf')](_0x518ee3));if(_0x518ee3[_0x56e8('0x10')]){if(_0x518ee3['error'][_0x56e8('0x11')]===0x1f4){logger[_0x56e8('0x10')](_0x56e8('0xc'),_0x2e35d4,_0x518ee3[_0x56e8('0x10')]['message']);return _0x551a68(_0x518ee3[_0x56e8('0x10')]['message']);}logger['error']('Cdr,\x20%s,\x20%s',_0x2e35d4,_0x518ee3[_0x56e8('0x10')][_0x56e8('0x12')]);return _0x44dcad(_0x518ee3[_0x56e8('0x10')][_0x56e8('0x12')]);}else{logger[_0x56e8('0xb')](_0x56e8('0xc'),_0x2e35d4,'request\x20sent');_0x44dcad(_0x518ee3[_0x56e8('0x13')][_0x56e8('0x12')]);}})[_0x56e8('0x14')](function(_0x57490f){logger[_0x56e8('0x10')](_0x56e8('0xc'),_0x2e35d4,_0x57490f);_0x551a68(_0x57490f);});});} \ No newline at end of file +var _0x7ec9=['message','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x329fb5,_0x2f6c95){var _0x442197=function(_0x2674c4){while(--_0x2674c4){_0x329fb5['push'](_0x329fb5['shift']());}};_0x442197(++_0x2f6c95);}(_0x7ec9,0x153));var _0x97ec=function(_0x459423,_0x3416a8){_0x459423=_0x459423-0x0;var _0x42ed14=_0x7ec9[_0x459423];return _0x42ed14;};'use strict';var _=require('lodash');var util=require(_0x97ec('0x0'));var moment=require(_0x97ec('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x97ec('0x2'));var db=require(_0x97ec('0x3'))['db'];var utils=require(_0x97ec('0x4'));var logger=require(_0x97ec('0x5'))(_0x97ec('0x6'));var config=require('../../config/environment');var jayson=require(_0x97ec('0x7'));var client=jayson[_0x97ec('0x8')][_0x97ec('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x40c35f,_0x15b1c6,_0x151e5d){return new BPromise(function(_0x4b5484,_0x36154b){return client[_0x97ec('0xa')](_0x40c35f,_0x151e5d)['then'](function(_0x375de4){logger[_0x97ec('0xb')](_0x97ec('0xc'),_0x15b1c6,'request\x20sent');logger[_0x97ec('0xd')](_0x97ec('0xe'),_0x15b1c6,_0x97ec('0xf'),JSON['stringify'](_0x375de4));if(_0x375de4[_0x97ec('0x10')]){if(_0x375de4[_0x97ec('0x10')][_0x97ec('0x11')]===0x1f4){logger[_0x97ec('0x10')](_0x97ec('0xc'),_0x15b1c6,_0x375de4[_0x97ec('0x10')][_0x97ec('0x12')]);return _0x36154b(_0x375de4['error'][_0x97ec('0x12')]);}logger[_0x97ec('0x10')](_0x97ec('0xc'),_0x15b1c6,_0x375de4[_0x97ec('0x10')][_0x97ec('0x12')]);return _0x4b5484(_0x375de4[_0x97ec('0x10')][_0x97ec('0x12')]);}else{logger['info'](_0x97ec('0xc'),_0x15b1c6,_0x97ec('0xf'));_0x4b5484(_0x375de4[_0x97ec('0x13')][_0x97ec('0x12')]);}})[_0x97ec('0x14')](function(_0x4580c3){logger[_0x97ec('0x10')](_0x97ec('0xc'),_0x15b1c6,_0x4580c3);_0x36154b(_0x4580c3);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 8806892..7bc9f53 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x4aa350,_0x12a9eb){var _0x32a16f=function(_0x658038){while(--_0x658038){_0x4aa350['push'](_0x4aa350['shift']());}};_0x32a16f(++_0x12a9eb);}(_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'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x36331a,_0x4c4a5c){var _0x22b292=function(_0x5b0d6a){while(--_0x5b0d6a){_0x36331a['push'](_0x36331a['shift']());}};_0x22b292(++_0x4c4a5c);}(_0xb10b,0x12a));var _0xbb10=function(_0x1b2667,_0x279eb1){_0x1b2667=_0x1b2667-0x0;var _0x179ae8=_0xb10b[_0x1b2667];return _0x179ae8;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 530c9b0..235aa07 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 _0xf7d9=['noop','TEXT','STRING','*,*,*,*','exports','INTEGER'];(function(_0x37656f,_0x350ac6){var _0x5cd9d8=function(_0x12e27e){while(--_0x12e27e){_0x37656f['push'](_0x37656f['shift']());}};_0x5cd9d8(++_0x350ac6);}(_0xf7d9,0x1ba));var _0x9f7d=function(_0x5e629d,_0x1f8284){_0x5e629d=_0x5e629d-0x0;var _0x5ac309=_0xf7d9[_0x5e629d];return _0x5ac309;};'use strict';var Sequelize=require('sequelize');module[_0x9f7d('0x0')]={'priority':{'type':Sequelize[_0x9f7d('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9f7d('0x2')},'appdata':{'type':Sequelize[_0x9f7d('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x9f7d('0x4')],'defaultValue':_0x9f7d('0x5')}}; \ No newline at end of file +var _0xe29d=['STRING','*,*,*,*','sequelize','exports','INTEGER','noop','TEXT'];(function(_0x1caf71,_0x3f5acc){var _0x435251=function(_0x52e455){while(--_0x52e455){_0x1caf71['push'](_0x1caf71['shift']());}};_0x435251(++_0x3f5acc);}(_0xe29d,0x128));var _0xde29=function(_0x371815,_0x1d73c5){_0x371815=_0x371815-0x0;var _0x49a4a4=_0xe29d[_0x371815];return _0x49a4a4;};'use strict';var Sequelize=require(_0xde29('0x0'));module[_0xde29('0x1')]={'priority':{'type':Sequelize[_0xde29('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xde29('0x3')},'appdata':{'type':Sequelize[_0xde29('0x4')]()},'description':{'type':Sequelize[_0xde29('0x5')]},'interval':{'type':Sequelize[_0xde29('0x5')],'defaultValue':_0xde29('0x6')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 8067917..dc23940 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 _0xfa68=['intersection','model','fields','attributes','length','includeAll','include','merge','options','find','catch','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','show','params','ChatApplication','rawAttributes','query','keys','filters'];(function(_0x3ec501,_0x1d035a){var _0x5a3037=function(_0x383d66){while(--_0x383d66){_0x3ec501['push'](_0x3ec501['shift']());}};_0x5a3037(++_0x1d035a);}(_0xfa68,0x86));var _0x8fa6=function(_0x3159af,_0x4e8cf0){_0x3159af=_0x3159af-0x0;var _0x85b241=_0xfa68[_0x3159af];return _0x85b241;};'use strict';var emlformat=require(_0x8fa6('0x0'));var rimraf=require(_0x8fa6('0x1'));var zipdir=require(_0x8fa6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8fa6('0x3'));var moment=require(_0x8fa6('0x4'));var BPromise=require(_0x8fa6('0x5'));var Mustache=require('mustache');var util=require(_0x8fa6('0x6'));var path=require(_0x8fa6('0x7'));var sox=require(_0x8fa6('0x8'));var csv=require(_0x8fa6('0x9'));var ejs=require(_0x8fa6('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8fa6('0xb'));var squel=require(_0x8fa6('0xc'));var crypto=require('crypto');var jsforce=require(_0x8fa6('0xd'));var deskjs=require(_0x8fa6('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8fa6('0xf'));var Redis=require(_0x8fa6('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8fa6('0x11'));var as=require(_0x8fa6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8fa6('0x13'));var utils=require(_0x8fa6('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8fa6('0x15'));var db=require(_0x8fa6('0x16'))['db'];function respondWithStatusCode(_0x59b7f9,_0x1ed90e){_0x1ed90e=_0x1ed90e||0xcc;return function(_0x1c621f){if(_0x1c621f){return _0x59b7f9['sendStatus'](_0x1ed90e);}return _0x59b7f9[_0x8fa6('0x17')](_0x1ed90e)[_0x8fa6('0x18')]();};}function respondWithResult(_0x22d83f,_0x86f607){_0x86f607=_0x86f607||0xc8;return function(_0xd2cce0){if(_0xd2cce0){return _0x22d83f['status'](_0x86f607)['json'](_0xd2cce0);}};}function respondWithFilteredResult(_0x3426a7,_0x5eff0e){return function(_0x1425a7){if(_0x1425a7){var _0x22bb50=typeof _0x5eff0e[_0x8fa6('0x19')]==='undefined'&&typeof _0x5eff0e[_0x8fa6('0x1a')]===_0x8fa6('0x1b');var _0x300f68=_0x1425a7['count'];var _0x329f97=_0x22bb50?0x0:_0x5eff0e[_0x8fa6('0x19')];var _0x8de44e=_0x22bb50?_0x1425a7[_0x8fa6('0x1c')]:_0x5eff0e['offset']+_0x5eff0e[_0x8fa6('0x1a')];var _0x516d42;if(_0x8de44e>=_0x300f68){_0x8de44e=_0x300f68;_0x516d42=0xc8;}else{_0x516d42=0xce;}_0x3426a7[_0x8fa6('0x17')](_0x516d42);return _0x3426a7[_0x8fa6('0x1d')](_0x8fa6('0x1e'),_0x329f97+'-'+_0x8de44e+'/'+_0x300f68)[_0x8fa6('0x1f')](_0x1425a7);}return null;};}function patchUpdates(_0x50e633){return function(_0x3072f7){try{jsonpatch[_0x8fa6('0x20')](_0x3072f7,_0x50e633,!![]);}catch(_0x5b6acb){return BPromise[_0x8fa6('0x21')](_0x5b6acb);}return _0x3072f7[_0x8fa6('0x22')]();};}function saveUpdates(_0x29d361,_0x50f8d2){return function(_0x149ace){if(_0x149ace){return _0x149ace[_0x8fa6('0x23')](_0x29d361)[_0x8fa6('0x24')](function(_0x49225a){return _0x49225a;});}return null;};}function removeEntity(_0x59f0b6,_0x588001){return function(_0x283805){if(_0x283805){return _0x283805[_0x8fa6('0x25')]()['then'](function(){_0x59f0b6['status'](0xcc)[_0x8fa6('0x18')]();});}};}function handleEntityNotFound(_0x3f86d8,_0x5775b7){return function(_0x57db95){if(!_0x57db95){_0x3f86d8[_0x8fa6('0x26')](0x194);}return _0x57db95;};}function handleError(_0x1914bc,_0x424546){_0x424546=_0x424546||0x1f4;return function(_0x4efd81){logger[_0x8fa6('0x27')](_0x4efd81[_0x8fa6('0x28')]);if(_0x4efd81['name']){delete _0x4efd81[_0x8fa6('0x29')];}_0x1914bc[_0x8fa6('0x17')](_0x424546)['send'](_0x4efd81);};}exports[_0x8fa6('0x2a')]=function(_0x39cf7c,_0x4cdbdb){var _0x5e1a88={'raw':!![],'where':{'id':_0x39cf7c[_0x8fa6('0x2b')]['id']}},_0x23fdc9={};_0x23fdc9['model']=_['keys'](db[_0x8fa6('0x2c')][_0x8fa6('0x2d')]);_0x23fdc9[_0x8fa6('0x2e')]=_[_0x8fa6('0x2f')](_0x39cf7c[_0x8fa6('0x2e')]);_0x23fdc9[_0x8fa6('0x30')]=_[_0x8fa6('0x31')](_0x23fdc9[_0x8fa6('0x32')],_0x23fdc9['query']);_0x5e1a88['attributes']=_[_0x8fa6('0x31')](_0x23fdc9['model'],qs[_0x8fa6('0x33')](_0x39cf7c[_0x8fa6('0x2e')][_0x8fa6('0x33')]));_0x5e1a88['attributes']=_0x5e1a88[_0x8fa6('0x34')][_0x8fa6('0x35')]?_0x5e1a88['attributes']:_0x23fdc9[_0x8fa6('0x32')];if(_0x39cf7c[_0x8fa6('0x2e')][_0x8fa6('0x36')]){_0x5e1a88[_0x8fa6('0x37')]=[{'all':!![]}];}_0x5e1a88=_[_0x8fa6('0x38')]({},_0x5e1a88,_0x39cf7c[_0x8fa6('0x39')]);return db[_0x8fa6('0x2c')][_0x8fa6('0x3a')](_0x5e1a88)[_0x8fa6('0x24')](handleEntityNotFound(_0x4cdbdb,null))[_0x8fa6('0x24')](respondWithResult(_0x4cdbdb,null))[_0x8fa6('0x3b')](handleError(_0x4cdbdb,null));};exports[_0x8fa6('0x23')]=function(_0x4f86ae,_0x309d0c){if(_0x4f86ae[_0x8fa6('0x3c')]['id']){delete _0x4f86ae[_0x8fa6('0x3c')]['id'];}return db[_0x8fa6('0x2c')][_0x8fa6('0x3a')]({'where':{'id':_0x4f86ae[_0x8fa6('0x2b')]['id']}})[_0x8fa6('0x24')](handleEntityNotFound(_0x309d0c,null))['then'](saveUpdates(_0x4f86ae['body'],null))[_0x8fa6('0x24')](respondWithResult(_0x309d0c,null))['catch'](handleError(_0x309d0c,null));};exports['destroy']=function(_0x5b2d34,_0x5087d3){return db['ChatApplication']['find']({'where':{'id':_0x5b2d34[_0x8fa6('0x2b')]['id']}})[_0x8fa6('0x24')](handleEntityNotFound(_0x5087d3,null))[_0x8fa6('0x24')](removeEntity(_0x5087d3,null))['catch'](handleError(_0x5087d3,null));}; \ No newline at end of file +var _0xbe31=['catch','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','show','model','keys','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','ChatApplication','find'];(function(_0x372f05,_0x4fab9){var _0x3099fc=function(_0x3c3f19){while(--_0x3c3f19){_0x372f05['push'](_0x372f05['shift']());}};_0x3099fc(++_0x4fab9);}(_0xbe31,0x83));var _0x1be3=function(_0x2439d0,_0x34c4cf){_0x2439d0=_0x2439d0-0x0;var _0xbbfc41=_0xbe31[_0x2439d0];return _0xbbfc41;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1be3('0x0'));var zipdir=require(_0x1be3('0x1'));var jsonpatch=require(_0x1be3('0x2'));var rp=require(_0x1be3('0x3'));var moment=require(_0x1be3('0x4'));var BPromise=require(_0x1be3('0x5'));var Mustache=require(_0x1be3('0x6'));var util=require(_0x1be3('0x7'));var path=require(_0x1be3('0x8'));var sox=require('sox');var csv=require(_0x1be3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1be3('0xa'));var _=require(_0x1be3('0xb'));var squel=require(_0x1be3('0xc'));var crypto=require(_0x1be3('0xd'));var jsforce=require(_0x1be3('0xe'));var deskjs=require(_0x1be3('0xf'));var toCsv=require(_0x1be3('0x9'));var querystring=require(_0x1be3('0x10'));var Papa=require(_0x1be3('0x11'));var Redis=require(_0x1be3('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x1be3('0x13'));var as=require(_0x1be3('0x14'));var hardwareService=require(_0x1be3('0x15'));var logger=require(_0x1be3('0x16'))(_0x1be3('0x17'));var utils=require(_0x1be3('0x18'));var config=require(_0x1be3('0x19'));var licenseUtil=require(_0x1be3('0x1a'));var db=require(_0x1be3('0x1b'))['db'];function respondWithStatusCode(_0x50552d,_0x3601f7){_0x3601f7=_0x3601f7||0xcc;return function(_0x492f66){if(_0x492f66){return _0x50552d[_0x1be3('0x1c')](_0x3601f7);}return _0x50552d[_0x1be3('0x1d')](_0x3601f7)['end']();};}function respondWithResult(_0x26f888,_0x573684){_0x573684=_0x573684||0xc8;return function(_0xc7cc3){if(_0xc7cc3){return _0x26f888[_0x1be3('0x1d')](_0x573684)[_0x1be3('0x1e')](_0xc7cc3);}};}function respondWithFilteredResult(_0xd30cd,_0x1156bc){return function(_0x269ac3){if(_0x269ac3){var _0x567919=typeof _0x1156bc['offset']==='undefined'&&typeof _0x1156bc['limit']===_0x1be3('0x1f');var _0x4ebba6=_0x269ac3[_0x1be3('0x20')];var _0x6b7edf=_0x567919?0x0:_0x1156bc[_0x1be3('0x21')];var _0x1d0c2b=_0x567919?_0x269ac3[_0x1be3('0x20')]:_0x1156bc[_0x1be3('0x21')]+_0x1156bc[_0x1be3('0x22')];var _0x41c2af;if(_0x1d0c2b>=_0x4ebba6){_0x1d0c2b=_0x4ebba6;_0x41c2af=0xc8;}else{_0x41c2af=0xce;}_0xd30cd[_0x1be3('0x1d')](_0x41c2af);return _0xd30cd[_0x1be3('0x23')](_0x1be3('0x24'),_0x6b7edf+'-'+_0x1d0c2b+'/'+_0x4ebba6)[_0x1be3('0x1e')](_0x269ac3);}return null;};}function patchUpdates(_0x57c78c){return function(_0x49123f){try{jsonpatch[_0x1be3('0x25')](_0x49123f,_0x57c78c,!![]);}catch(_0x4cacb9){return BPromise[_0x1be3('0x26')](_0x4cacb9);}return _0x49123f[_0x1be3('0x27')]();};}function saveUpdates(_0x4366e8,_0x3bd167){return function(_0x3c0564){if(_0x3c0564){return _0x3c0564[_0x1be3('0x28')](_0x4366e8)[_0x1be3('0x29')](function(_0x57c192){return _0x57c192;});}return null;};}function removeEntity(_0x186b8a,_0x48862c){return function(_0x237a6c){if(_0x237a6c){return _0x237a6c[_0x1be3('0x2a')]()['then'](function(){_0x186b8a[_0x1be3('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x134d79,_0x12023d){return function(_0x393f98){if(!_0x393f98){_0x134d79[_0x1be3('0x1c')](0x194);}return _0x393f98;};}function handleError(_0x4ce12f,_0x1e2943){_0x1e2943=_0x1e2943||0x1f4;return function(_0x8d1f58){logger['error'](_0x8d1f58[_0x1be3('0x2b')]);if(_0x8d1f58[_0x1be3('0x2c')]){delete _0x8d1f58[_0x1be3('0x2c')];}_0x4ce12f[_0x1be3('0x1d')](_0x1e2943)[_0x1be3('0x2d')](_0x8d1f58);};}exports[_0x1be3('0x2e')]=function(_0x5d35cf,_0x5bb993){var _0x49f0e0={'raw':!![],'where':{'id':_0x5d35cf['params']['id']}},_0x25ed26={};_0x25ed26[_0x1be3('0x2f')]=_[_0x1be3('0x30')](db['ChatApplication']['rawAttributes']);_0x25ed26[_0x1be3('0x31')]=_[_0x1be3('0x30')](_0x5d35cf[_0x1be3('0x31')]);_0x25ed26[_0x1be3('0x32')]=_[_0x1be3('0x33')](_0x25ed26[_0x1be3('0x2f')],_0x25ed26['query']);_0x49f0e0['attributes']=_['intersection'](_0x25ed26['model'],qs[_0x1be3('0x34')](_0x5d35cf[_0x1be3('0x31')][_0x1be3('0x34')]));_0x49f0e0[_0x1be3('0x35')]=_0x49f0e0[_0x1be3('0x35')][_0x1be3('0x36')]?_0x49f0e0[_0x1be3('0x35')]:_0x25ed26['model'];if(_0x5d35cf[_0x1be3('0x31')][_0x1be3('0x37')]){_0x49f0e0[_0x1be3('0x38')]=[{'all':!![]}];}_0x49f0e0=_[_0x1be3('0x39')]({},_0x49f0e0,_0x5d35cf[_0x1be3('0x3a')]);return db[_0x1be3('0x3b')][_0x1be3('0x3c')](_0x49f0e0)['then'](handleEntityNotFound(_0x5bb993,null))[_0x1be3('0x29')](respondWithResult(_0x5bb993,null))[_0x1be3('0x3d')](handleError(_0x5bb993,null));};exports[_0x1be3('0x28')]=function(_0x4f7751,_0x55e5c2){if(_0x4f7751[_0x1be3('0x3e')]['id']){delete _0x4f7751[_0x1be3('0x3e')]['id'];}return db[_0x1be3('0x3b')]['find']({'where':{'id':_0x4f7751['params']['id']}})['then'](handleEntityNotFound(_0x55e5c2,null))[_0x1be3('0x29')](saveUpdates(_0x4f7751[_0x1be3('0x3e')],null))[_0x1be3('0x29')](respondWithResult(_0x55e5c2,null))['catch'](handleError(_0x55e5c2,null));};exports[_0x1be3('0x2a')]=function(_0x519902,_0x3aefa9){return db[_0x1be3('0x3b')]['find']({'where':{'id':_0x519902[_0x1be3('0x3f')]['id']}})[_0x1be3('0x29')](handleEntityNotFound(_0x3aefa9,null))[_0x1be3('0x29')](removeEntity(_0x3aefa9,null))[_0x1be3('0x3d')](handleError(_0x3aefa9,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index d2e34e5..652da62 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 _0x5c11=['ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define'];(function(_0x42fb7f,_0x5613f5){var _0x54f331=function(_0x20e7be){while(--_0x20e7be){_0x42fb7f['push'](_0x42fb7f['shift']());}};_0x54f331(++_0x5613f5);}(_0x5c11,0xa4));var _0x15c1=function(_0x319d77,_0x445f72){_0x319d77=_0x319d77-0x0;var _0x1dd41c=_0x5c11[_0x319d77];return _0x1dd41c;};'use strict';var _=require(_0x15c1('0x0'));var util=require(_0x15c1('0x1'));var logger=require(_0x15c1('0x2'))(_0x15c1('0x3'));var moment=require('moment');var BPromise=require(_0x15c1('0x4'));var rp=require(_0x15c1('0x5'));var fs=require('fs');var path=require(_0x15c1('0x6'));var rimraf=require(_0x15c1('0x7'));var config=require(_0x15c1('0x8'));var attributes=require(_0x15c1('0x9'));module[_0x15c1('0xa')]=function(_0x5f0e26,_0x14d42b){return _0x5f0e26[_0x15c1('0xb')](_0x15c1('0xc'),attributes,{'tableName':_0x15c1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x15c1('0xe'),'collate':_0x15c1('0xf')});}; \ No newline at end of file +var _0x78cd=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','define','chat_applications','utf8mb4_unicode_ci'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x78cd,0x114));var _0xd78c=function(_0x8e992d,_0x5dd91c){_0x8e992d=_0x8e992d-0x0;var _0x41dd7f=_0x78cd[_0x8e992d];return _0x41dd7f;};'use strict';var _=require('lodash');var util=require(_0xd78c('0x0'));var logger=require('../../config/logger')(_0xd78c('0x1'));var moment=require(_0xd78c('0x2'));var BPromise=require(_0xd78c('0x3'));var rp=require(_0xd78c('0x4'));var fs=require('fs');var path=require(_0xd78c('0x5'));var rimraf=require(_0xd78c('0x6'));var config=require(_0xd78c('0x7'));var attributes=require(_0xd78c('0x8'));module['exports']=function(_0x2866d3,_0x1d1ee2){return _0x2866d3[_0xd78c('0x9')]('ChatApplication',attributes,{'tableName':_0xd78c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xd78c('0xb')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index f47eb1c..4fbe530 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 _0x2cf8=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatApplication,\x20%s,\x20%s'];(function(_0x3d13bb,_0x262a54){var _0x4b5a1b=function(_0x53417e){while(--_0x53417e){_0x3d13bb['push'](_0x3d13bb['shift']());}};_0x4b5a1b(++_0x262a54);}(_0x2cf8,0x163));var _0x82cf=function(_0x1f6fd5,_0x399cb0){_0x1f6fd5=_0x1f6fd5-0x0;var _0x587d12=_0x2cf8[_0x1f6fd5];return _0x587d12;};'use strict';var _=require(_0x82cf('0x0'));var util=require(_0x82cf('0x1'));var moment=require(_0x82cf('0x2'));var BPromise=require(_0x82cf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x82cf('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x82cf('0x5'));var logger=require(_0x82cf('0x6'))('rpc');var config=require(_0x82cf('0x7'));var jayson=require(_0x82cf('0x8'));var client=jayson['client'][_0x82cf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x518e44,_0x12431e,_0x415bd3){return new BPromise(function(_0x4a9487,_0x52c4e0){return client['request'](_0x518e44,_0x415bd3)[_0x82cf('0xa')](function(_0x6770c){logger[_0x82cf('0xb')]('ChatApplication,\x20%s,\x20%s',_0x12431e,_0x82cf('0xc'));logger[_0x82cf('0xd')](_0x82cf('0xe'),_0x12431e,_0x82cf('0xc'),JSON[_0x82cf('0xf')](_0x6770c));if(_0x6770c[_0x82cf('0x10')]){if(_0x6770c[_0x82cf('0x10')][_0x82cf('0x11')]===0x1f4){logger[_0x82cf('0x10')](_0x82cf('0x12'),_0x12431e,_0x6770c[_0x82cf('0x10')][_0x82cf('0x13')]);return _0x52c4e0(_0x6770c[_0x82cf('0x10')]['message']);}logger[_0x82cf('0x10')]('ChatApplication,\x20%s,\x20%s',_0x12431e,_0x6770c['error'][_0x82cf('0x13')]);return _0x4a9487(_0x6770c[_0x82cf('0x10')][_0x82cf('0x13')]);}else{logger[_0x82cf('0xb')](_0x82cf('0x12'),_0x12431e,'request\x20sent');_0x4a9487(_0x6770c[_0x82cf('0x14')][_0x82cf('0x13')]);}})[_0x82cf('0x15')](function(_0x27b8fc){logger[_0x82cf('0x10')](_0x82cf('0x12'),_0x12431e,_0x27b8fc);_0x52c4e0(_0x27b8fc);});});} \ No newline at end of file +var _0x2d26=['code','error','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4dd89b,_0x4b4500){var _0x361679=function(_0x1a422a){while(--_0x1a422a){_0x4dd89b['push'](_0x4dd89b['shift']());}};_0x361679(++_0x4b4500);}(_0x2d26,0x16d));var _0x62d2=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0x2d26[_0xf0bcac];return _0x4e4c65;};'use strict';var _=require(_0x62d2('0x0'));var util=require(_0x62d2('0x1'));var moment=require(_0x62d2('0x2'));var BPromise=require('bluebird');var rs=require(_0x62d2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x62d2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x62d2('0x5'))('rpc');var config=require(_0x62d2('0x6'));var jayson=require(_0x62d2('0x7'));var client=jayson[_0x62d2('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14cd58,_0x1b8a8,_0x1959e0){return new BPromise(function(_0x1b70c5,_0x1f42d2){return client['request'](_0x14cd58,_0x1959e0)[_0x62d2('0x9')](function(_0x374319){logger[_0x62d2('0xa')](_0x62d2('0xb'),_0x1b8a8,_0x62d2('0xc'));logger['debug'](_0x62d2('0xd'),_0x1b8a8,'request\x20sent',JSON[_0x62d2('0xe')](_0x374319));if(_0x374319['error']){if(_0x374319['error'][_0x62d2('0xf')]===0x1f4){logger[_0x62d2('0x10')](_0x62d2('0xb'),_0x1b8a8,_0x374319[_0x62d2('0x10')][_0x62d2('0x11')]);return _0x1f42d2(_0x374319[_0x62d2('0x10')][_0x62d2('0x11')]);}logger['error'](_0x62d2('0xb'),_0x1b8a8,_0x374319['error'][_0x62d2('0x11')]);return _0x1b70c5(_0x374319[_0x62d2('0x10')]['message']);}else{logger['info'](_0x62d2('0xb'),_0x1b8a8,_0x62d2('0xc'));_0x1b70c5(_0x374319['result'][_0x62d2('0x11')]);}})[_0x62d2('0x12')](function(_0x2491ee){logger[_0x62d2('0x10')]('ChatApplication,\x20%s,\x20%s',_0x1b8a8,_0x2491ee);_0x1f42d2(_0x2491ee);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 09317cc..73dbf2c 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 _0x38e6=['./chatApplication.controller','/:id','isAuthenticated','show','put','update','delete','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x715d76,_0x402d60){var _0x48fe88=function(_0x4dd0ea){while(--_0x4dd0ea){_0x715d76['push'](_0x715d76['shift']());}};_0x48fe88(++_0x402d60);}(_0x38e6,0xca));var _0x638e=function(_0x77fcad,_0xeebb41){_0x77fcad=_0x77fcad-0x0;var _0x3d032e=_0x38e6[_0x77fcad];return _0x3d032e;};'use strict';var multer=require('multer');var util=require(_0x638e('0x0'));var path=require('path');var timeout=require(_0x638e('0x1'));var express=require(_0x638e('0x2'));var router=express[_0x638e('0x3')]();var fs_extra=require(_0x638e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x638e('0x5'));var config=require('../../config/environment');var controller=require(_0x638e('0x6'));router['get'](_0x638e('0x7'),auth[_0x638e('0x8')](),controller[_0x638e('0x9')]);router[_0x638e('0xa')](_0x638e('0x7'),auth[_0x638e('0x8')](),controller[_0x638e('0xb')]);router[_0x638e('0xc')](_0x638e('0x7'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x9e93=['express','Router','fs-extra','../../components/auth/service','get','/:id','isAuthenticated','show','put','update','destroy','multer','path','connect-timeout'];(function(_0x4e7cea,_0xc1b05a){var _0x4cefad=function(_0x139ef5){while(--_0x139ef5){_0x4e7cea['push'](_0x4e7cea['shift']());}};_0x4cefad(++_0xc1b05a);}(_0x9e93,0xb3));var _0x39e9=function(_0x540dcb,_0x4eacb6){_0x540dcb=_0x540dcb-0x0;var _0x49353c=_0x9e93[_0x540dcb];return _0x49353c;};'use strict';var multer=require(_0x39e9('0x0'));var util=require('util');var path=require(_0x39e9('0x1'));var timeout=require(_0x39e9('0x2'));var express=require(_0x39e9('0x3'));var router=express[_0x39e9('0x4')]();var fs_extra=require(_0x39e9('0x5'));var auth=require(_0x39e9('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatApplication.controller');router[_0x39e9('0x7')](_0x39e9('0x8'),auth[_0x39e9('0x9')](),controller[_0x39e9('0xa')]);router[_0x39e9('0xb')](_0x39e9('0x8'),auth[_0x39e9('0x9')](),controller[_0x39e9('0xc')]);router['delete'](_0x39e9('0x8'),auth[_0x39e9('0x9')](),controller[_0x39e9('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 2cf4d57..e65b045 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 _0xf105=['sequelize','exports','STRING','BOOLEAN'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf105,0x1b0));var _0x5f10=function(_0xd98741,_0x3f939a){_0xd98741=_0xd98741-0x0;var _0x3c1752=_0xf105[_0xd98741];return _0x3c1752;};'use strict';var Sequelize=require(_0x5f10('0x0'));module[_0x5f10('0x1')]={'name':{'type':Sequelize[_0x5f10('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5f10('0x2')]},'write':{'type':Sequelize[_0x5f10('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x3e65=['sequelize','STRING','BOOLEAN'];(function(_0xb49d15,_0x4cfe7b){var _0xb625b4=function(_0xd24c31){while(--_0xd24c31){_0xb49d15['push'](_0xb49d15['shift']());}};_0xb625b4(++_0x4cfe7b);}(_0x3e65,0xde));var _0x53e6=function(_0x477e62,_0x4db149){_0x477e62=_0x477e62-0x0;var _0xde0626=_0x3e65[_0x477e62];return _0xde0626;};'use strict';var Sequelize=require(_0x53e6('0x0'));module['exports']={'name':{'type':Sequelize[_0x53e6('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x53e6('0x1')]},'write':{'type':Sequelize[_0x53e6('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 8e27672..1ee0aba 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 _0xdaa6=['where','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','params','length','include','options','find','create','body','update','describe','ChatInternalMessage','user','toInteger','addMembers','omit','ids','getMembers','findOne','User','pick','removeMembers','addMessage','ChatGroupId','$gte','split','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','defaults','socket.io-emitter','redis','register','sendStatus','status','end','json','offset','limit','undefined','count','apply','reject','save','then','destroy','error','stack','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort'];(function(_0x5023cb,_0x5ae9a6){var _0x52c5d6=function(_0x4fe596){while(--_0x4fe596){_0x5023cb['push'](_0x5023cb['shift']());}};_0x52c5d6(++_0x5ae9a6);}(_0xdaa6,0xe0));var _0x6daa=function(_0x2b3501,_0x44f01c){_0x2b3501=_0x2b3501-0x0;var _0x9b2c33=_0xdaa6[_0x2b3501];return _0x9b2c33;};'use strict';var emlformat=require(_0x6daa('0x0'));var rimraf=require(_0x6daa('0x1'));var zipdir=require(_0x6daa('0x2'));var jsonpatch=require(_0x6daa('0x3'));var rp=require('request-promise');var moment=require(_0x6daa('0x4'));var BPromise=require(_0x6daa('0x5'));var Mustache=require('mustache');var util=require(_0x6daa('0x6'));var path=require(_0x6daa('0x7'));var sox=require(_0x6daa('0x8'));var csv=require('to-csv');var ejs=require(_0x6daa('0x9'));var fs=require('fs');var fs_extra=require(_0x6daa('0xa'));var _=require(_0x6daa('0xb'));var squel=require(_0x6daa('0xc'));var crypto=require('crypto');var jsforce=require(_0x6daa('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6daa('0xe'));var querystring=require('querystring');var Papa=require(_0x6daa('0xf'));var Redis=require(_0x6daa('0x10'));var authService=require(_0x6daa('0x11'));var qs=require(_0x6daa('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6daa('0x13'))('api');var utils=require(_0x6daa('0x14'));var config=require(_0x6daa('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x6daa('0x16')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6daa('0x17'))(new Redis(config[_0x6daa('0x18')]));require('./chatGroup.socket')[_0x6daa('0x19')](socket);function respondWithStatusCode(_0x177d75,_0x431f13){_0x431f13=_0x431f13||0xcc;return function(_0x11b1c2){if(_0x11b1c2){return _0x177d75[_0x6daa('0x1a')](_0x431f13);}return _0x177d75[_0x6daa('0x1b')](_0x431f13)[_0x6daa('0x1c')]();};}function respondWithResult(_0x369430,_0x585d80){_0x585d80=_0x585d80||0xc8;return function(_0x2deff6){if(_0x2deff6){return _0x369430[_0x6daa('0x1b')](_0x585d80)[_0x6daa('0x1d')](_0x2deff6);}};}function respondWithFilteredResult(_0x4bde0a,_0x5c438d){return function(_0x3174e8){if(_0x3174e8){var _0x5e9c78=typeof _0x5c438d[_0x6daa('0x1e')]==='undefined'&&typeof _0x5c438d[_0x6daa('0x1f')]===_0x6daa('0x20');var _0x113b62=_0x3174e8['count'];var _0x553728=_0x5e9c78?0x0:_0x5c438d[_0x6daa('0x1e')];var _0x339e0d=_0x5e9c78?_0x3174e8[_0x6daa('0x21')]:_0x5c438d[_0x6daa('0x1e')]+_0x5c438d[_0x6daa('0x1f')];var _0x531ef0;if(_0x339e0d>=_0x113b62){_0x339e0d=_0x113b62;_0x531ef0=0xc8;}else{_0x531ef0=0xce;}_0x4bde0a['status'](_0x531ef0);return _0x4bde0a['set']('Content-Range',_0x553728+'-'+_0x339e0d+'/'+_0x113b62)['json'](_0x3174e8);}return null;};}function patchUpdates(_0xc8fb5){return function(_0x446444){try{jsonpatch[_0x6daa('0x22')](_0x446444,_0xc8fb5,!![]);}catch(_0x4ac995){return BPromise[_0x6daa('0x23')](_0x4ac995);}return _0x446444[_0x6daa('0x24')]();};}function saveUpdates(_0x45959b,_0xa792f){return function(_0x2149a7){if(_0x2149a7){return _0x2149a7['update'](_0x45959b)[_0x6daa('0x25')](function(_0x3b333b){return _0x3b333b;});}return null;};}function removeEntity(_0x4d9908,_0x3cfc2b){return function(_0x38cf24){if(_0x38cf24){return _0x38cf24[_0x6daa('0x26')]()[_0x6daa('0x25')](function(){_0x4d9908['status'](0xcc)[_0x6daa('0x1c')]();});}};}function handleEntityNotFound(_0x34fec4,_0x45cc83){return function(_0x4d9f82){if(!_0x4d9f82){_0x34fec4[_0x6daa('0x1a')](0x194);}return _0x4d9f82;};}function handleError(_0x16ee77,_0x4a1ba1){_0x4a1ba1=_0x4a1ba1||0x1f4;return function(_0x1f1be2){logger[_0x6daa('0x27')](_0x1f1be2[_0x6daa('0x28')]);if(_0x1f1be2['name']){delete _0x1f1be2['name'];}_0x16ee77['status'](_0x4a1ba1)[_0x6daa('0x29')](_0x1f1be2);};}exports[_0x6daa('0x2a')]=function(_0x3684b7,_0x35b43f){var _0x5237dc={},_0x30c9a9={},_0x3db652={'count':0x0,'rows':[]};var _0xfd6f06=_[_0x6daa('0x2b')](db[_0x6daa('0x2c')][_0x6daa('0x2d')],function(_0x20bc4d){return{'name':_0x20bc4d[_0x6daa('0x2e')],'type':_0x20bc4d[_0x6daa('0x2f')][_0x6daa('0x30')]};});_0x30c9a9[_0x6daa('0x31')]=_['map'](_0xfd6f06,_0x6daa('0x32'));_0x30c9a9[_0x6daa('0x33')]=_[_0x6daa('0x34')](_0x3684b7['query']);_0x30c9a9[_0x6daa('0x35')]=_[_0x6daa('0x36')](_0x30c9a9[_0x6daa('0x31')],_0x30c9a9[_0x6daa('0x33')]);_0x5237dc[_0x6daa('0x37')]=_['intersection'](_0x30c9a9[_0x6daa('0x31')],qs['fields'](_0x3684b7[_0x6daa('0x33')][_0x6daa('0x38')]));_0x5237dc[_0x6daa('0x37')]=_0x5237dc[_0x6daa('0x37')]['length']?_0x5237dc[_0x6daa('0x37')]:_0x30c9a9['model'];if(!_0x3684b7['query'][_0x6daa('0x39')](_0x6daa('0x3a'))){_0x5237dc[_0x6daa('0x1f')]=qs[_0x6daa('0x1f')](_0x3684b7[_0x6daa('0x33')]['limit']);_0x5237dc[_0x6daa('0x1e')]=qs[_0x6daa('0x1e')](_0x3684b7[_0x6daa('0x33')][_0x6daa('0x1e')]);}_0x5237dc[_0x6daa('0x3b')]=qs[_0x6daa('0x3c')](_0x3684b7[_0x6daa('0x33')][_0x6daa('0x3c')]);_0x5237dc[_0x6daa('0x3d')]=qs[_0x6daa('0x35')](_['pick'](_0x3684b7[_0x6daa('0x33')],_0x30c9a9[_0x6daa('0x35')]),_0xfd6f06);if(_0x3684b7[_0x6daa('0x33')][_0x6daa('0x3e')]){_0x5237dc[_0x6daa('0x3d')]=_[_0x6daa('0x3f')](_0x5237dc[_0x6daa('0x3d')],{'$or':_['map'](_0xfd6f06,function(_0x430710){if(_0x430710[_0x6daa('0x2f')]!==_0x6daa('0x40')){var _0x2f4ed8={};_0x2f4ed8[_0x430710[_0x6daa('0x32')]]={'$like':'%'+_0x3684b7[_0x6daa('0x33')][_0x6daa('0x3e')]+'%'};return _0x2f4ed8;}})});}_0x5237dc=_[_0x6daa('0x3f')]({},_0x5237dc,_0x3684b7['options']);var _0x4c11a9={'where':_0x5237dc['where']};return db[_0x6daa('0x2c')][_0x6daa('0x21')](_0x4c11a9)[_0x6daa('0x25')](function(_0x5073f0){_0x3db652[_0x6daa('0x21')]=_0x5073f0;if(_0x3684b7[_0x6daa('0x33')][_0x6daa('0x41')]){_0x5237dc['include']=[{'all':!![]}];}return db[_0x6daa('0x2c')][_0x6daa('0x42')](_0x5237dc);})[_0x6daa('0x25')](function(_0xe544f2){_0x3db652[_0x6daa('0x43')]=_0xe544f2;return _0x3db652;})[_0x6daa('0x25')](respondWithFilteredResult(_0x35b43f,_0x5237dc))[_0x6daa('0x44')](handleError(_0x35b43f,null));};exports['show']=function(_0x35848a,_0x5cb98b){var _0x54f91e={'raw':!![],'where':{'id':_0x35848a[_0x6daa('0x45')]['id']}},_0x44aafd={};_0x44aafd[_0x6daa('0x31')]=_[_0x6daa('0x34')](db['ChatGroup'][_0x6daa('0x2d')]);_0x44aafd[_0x6daa('0x33')]=_[_0x6daa('0x34')](_0x35848a[_0x6daa('0x33')]);_0x44aafd[_0x6daa('0x35')]=_[_0x6daa('0x36')](_0x44aafd[_0x6daa('0x31')],_0x44aafd[_0x6daa('0x33')]);_0x54f91e[_0x6daa('0x37')]=_[_0x6daa('0x36')](_0x44aafd['model'],qs['fields'](_0x35848a[_0x6daa('0x33')][_0x6daa('0x38')]));_0x54f91e[_0x6daa('0x37')]=_0x54f91e[_0x6daa('0x37')][_0x6daa('0x46')]?_0x54f91e[_0x6daa('0x37')]:_0x44aafd[_0x6daa('0x31')];if(_0x35848a['query'][_0x6daa('0x41')]){_0x54f91e[_0x6daa('0x47')]=[{'all':!![]}];}_0x54f91e=_[_0x6daa('0x3f')]({},_0x54f91e,_0x35848a[_0x6daa('0x48')]);return db[_0x6daa('0x2c')][_0x6daa('0x49')](_0x54f91e)['then'](handleEntityNotFound(_0x5cb98b,null))[_0x6daa('0x25')](respondWithResult(_0x5cb98b,null))[_0x6daa('0x44')](handleError(_0x5cb98b,null));};exports[_0x6daa('0x4a')]=function(_0x4ad068,_0x114b30){return db['ChatGroup'][_0x6daa('0x4a')](_0x4ad068[_0x6daa('0x4b')],{})[_0x6daa('0x25')](respondWithResult(_0x114b30,0xc9))[_0x6daa('0x44')](handleError(_0x114b30,null));};exports[_0x6daa('0x4c')]=function(_0xe9bfed,_0x7c20e8){if(_0xe9bfed[_0x6daa('0x4b')]['id']){delete _0xe9bfed['body']['id'];}return db[_0x6daa('0x2c')][_0x6daa('0x49')]({'where':{'id':_0xe9bfed[_0x6daa('0x45')]['id']}})['then'](handleEntityNotFound(_0x7c20e8,null))['then'](saveUpdates(_0xe9bfed[_0x6daa('0x4b')],null))['then'](respondWithResult(_0x7c20e8,null))[_0x6daa('0x44')](handleError(_0x7c20e8,null));};exports[_0x6daa('0x26')]=function(_0x32bc7c,_0x29088a){return db[_0x6daa('0x2c')][_0x6daa('0x49')]({'where':{'id':_0x32bc7c[_0x6daa('0x45')]['id']}})[_0x6daa('0x25')](handleEntityNotFound(_0x29088a,null))['then'](removeEntity(_0x29088a,null))[_0x6daa('0x44')](handleError(_0x29088a,null));};exports['describe']=function(_0x5afaf7,_0x4a8a9c){return db['ChatGroup'][_0x6daa('0x4d')]()[_0x6daa('0x25')](respondWithResult(_0x4a8a9c,null))[_0x6daa('0x44')](handleError(_0x4a8a9c,null));};exports['getUnread']=function(_0x4d21f7,_0x2c315c,_0x422958){return db[_0x6daa('0x4e')][_0x6daa('0x21')]({'where':{'ChatGroupId':_0x4d21f7[_0x6daa('0x45')]['id'],'ToId':_0x4d21f7[_0x6daa('0x4f')]['id'],'read':![]}})['then'](function(_0x29ac71){return{'id':_[_0x6daa('0x50')](_0x4d21f7[_0x6daa('0x45')]['id']),'count':_0x29ac71};})[_0x6daa('0x25')](respondWithResult(_0x2c315c,null))[_0x6daa('0x44')](handleError(_0x2c315c,null));};exports[_0x6daa('0x51')]=function(_0x55bcb0,_0x4eb61c,_0x341b96){return db['ChatGroup'][_0x6daa('0x49')]({'where':{'id':_0x55bcb0['params']['id']}})[_0x6daa('0x25')](handleEntityNotFound(_0x4eb61c,null))[_0x6daa('0x25')](function(_0x5edc17){if(_0x5edc17){return _0x5edc17[_0x6daa('0x51')](_0x55bcb0[_0x6daa('0x4b')]['ids'],_[_0x6daa('0x52')](_0x55bcb0['body'],[_0x6daa('0x53'),'id'])||{});}})['then'](respondWithResult(_0x4eb61c,null))['catch'](handleError(_0x4eb61c,null));};exports[_0x6daa('0x54')]=function(_0x1b6f8e,_0x4bf5bf,_0x50cc48){var _0x3424c5={};var _0x5a336e={};var _0x4b9104;var _0x3fcc1b;return db[_0x6daa('0x2c')][_0x6daa('0x55')]({'where':{'id':_0x1b6f8e[_0x6daa('0x45')]['id']}})[_0x6daa('0x25')](handleEntityNotFound(_0x4bf5bf,null))['then'](function(_0x196e7d){if(_0x196e7d){_0x4b9104=_0x196e7d;_0x5a336e[_0x6daa('0x31')]=_['keys'](db[_0x6daa('0x56')][_0x6daa('0x2d')]);_0x5a336e[_0x6daa('0x33')]=_[_0x6daa('0x34')](_0x1b6f8e[_0x6daa('0x33')]);_0x5a336e['filters']=_['intersection'](_0x5a336e['model'],_0x5a336e[_0x6daa('0x33')]);_0x3424c5[_0x6daa('0x37')]=_[_0x6daa('0x36')](_0x5a336e[_0x6daa('0x31')],qs[_0x6daa('0x38')](_0x1b6f8e[_0x6daa('0x33')][_0x6daa('0x38')]));_0x3424c5[_0x6daa('0x37')]=_0x3424c5[_0x6daa('0x37')]['length']?_0x3424c5[_0x6daa('0x37')]:_0x5a336e[_0x6daa('0x31')];_0x3424c5[_0x6daa('0x3b')]=qs['sort'](_0x1b6f8e[_0x6daa('0x33')][_0x6daa('0x3c')]);_0x3424c5[_0x6daa('0x3d')]=qs[_0x6daa('0x35')](_[_0x6daa('0x57')](_0x1b6f8e['query'],_0x5a336e[_0x6daa('0x35')]));if(_0x1b6f8e[_0x6daa('0x33')][_0x6daa('0x3e')]){_0x3424c5[_0x6daa('0x3d')]=_['merge'](_0x3424c5[_0x6daa('0x3d')],{'$or':_['map'](_0x3424c5[_0x6daa('0x37')],function(_0x1ae946){var _0x3e2858={};_0x3e2858[_0x1ae946]={'$like':'%'+_0x1b6f8e['query'][_0x6daa('0x3e')]+'%'};return _0x3e2858;})});}_0x3424c5=_[_0x6daa('0x3f')]({},_0x3424c5,_0x1b6f8e[_0x6daa('0x48')]);return _0x4b9104['getMembers'](_0x3424c5);}})[_0x6daa('0x25')](function(_0x1175d8){if(_0x1175d8){_0x3fcc1b=_0x1175d8[_0x6daa('0x46')];if(!_0x1b6f8e['query'][_0x6daa('0x39')]('nolimit')){_0x3424c5[_0x6daa('0x1f')]=qs[_0x6daa('0x1f')](_0x1b6f8e[_0x6daa('0x33')][_0x6daa('0x1f')]);_0x3424c5[_0x6daa('0x1e')]=qs[_0x6daa('0x1e')](_0x1b6f8e[_0x6daa('0x33')][_0x6daa('0x1e')]);}return _0x4b9104[_0x6daa('0x54')](_0x3424c5);}})[_0x6daa('0x25')](function(_0x31f239){if(_0x31f239){return _0x31f239?{'count':_0x3fcc1b,'rows':_0x31f239}:null;}})[_0x6daa('0x25')](respondWithResult(_0x4bf5bf,null))[_0x6daa('0x44')](handleError(_0x4bf5bf,null));};exports[_0x6daa('0x58')]=function(_0x2e65e5,_0x4fef35,_0x568c69){return db[_0x6daa('0x2c')]['find']({'where':{'id':_0x2e65e5[_0x6daa('0x45')]['id']}})[_0x6daa('0x25')](handleEntityNotFound(_0x4fef35,null))[_0x6daa('0x25')](function(_0xdded65){if(_0xdded65){return _0xdded65['removeMembers'](_0x2e65e5[_0x6daa('0x33')][_0x6daa('0x53')]);}})['then'](respondWithStatusCode(_0x4fef35,null))[_0x6daa('0x44')](handleError(_0x4fef35,null));};exports[_0x6daa('0x59')]=function(_0x5d0015,_0x50fabf,_0x486c92){if(_0x5d0015[_0x6daa('0x4b')]['id']){delete _0x5d0015[_0x6daa('0x4b')]['id'];}return db[_0x6daa('0x2c')][_0x6daa('0x49')]({'where':{'id':_0x5d0015[_0x6daa('0x45')]['id']}})[_0x6daa('0x25')](handleEntityNotFound(_0x50fabf,null))[_0x6daa('0x25')](function(_0x15d5d7){if(_0x15d5d7){_0x5d0015[_0x6daa('0x4b')][_0x6daa('0x5a')]=_0x15d5d7['id'];return db[_0x6daa('0x4e')][_0x6daa('0x4a')](_0x5d0015['body']);}})['then'](respondWithResult(_0x50fabf,null))[_0x6daa('0x44')](handleError(_0x50fabf,null));};exports['getMessages']=function(_0x320660,_0x25ef02,_0xe3bac2){var _0x43bd30={};var _0x1c710b={};var _0x290e1c;var _0x4856a7;return db[_0x6daa('0x2c')][_0x6daa('0x55')]({'where':{'id':_0x320660['params']['id']}})[_0x6daa('0x25')](handleEntityNotFound(_0x25ef02,null))[_0x6daa('0x25')](function(_0x149573){if(_0x149573){_0x290e1c=_0x149573;_0x1c710b[_0x6daa('0x31')]=_[_0x6daa('0x34')](db['ChatInternalMessage']['rawAttributes']);_0x1c710b[_0x6daa('0x33')]=_[_0x6daa('0x34')](_0x320660[_0x6daa('0x33')]);_0x1c710b['filters']=_[_0x6daa('0x36')](_0x1c710b[_0x6daa('0x31')],_0x1c710b[_0x6daa('0x33')]);_0x43bd30[_0x6daa('0x37')]=_[_0x6daa('0x36')](_0x1c710b['model'],qs[_0x6daa('0x38')](_0x320660[_0x6daa('0x33')][_0x6daa('0x38')]));_0x43bd30['attributes']=_0x43bd30[_0x6daa('0x37')][_0x6daa('0x46')]?_0x43bd30[_0x6daa('0x37')]:_0x1c710b[_0x6daa('0x31')];_0x43bd30[_0x6daa('0x3b')]=qs[_0x6daa('0x3c')](_0x320660[_0x6daa('0x33')][_0x6daa('0x3c')]);_0x43bd30[_0x6daa('0x3d')]=qs['filters'](_[_0x6daa('0x57')](_0x320660[_0x6daa('0x33')],_0x1c710b[_0x6daa('0x35')]));if(_0x320660[_0x6daa('0x33')][_0x6daa('0x3e')]){_0x43bd30[_0x6daa('0x3d')]=_['merge'](_0x43bd30['where'],{'$or':_[_0x6daa('0x2b')](_0x43bd30[_0x6daa('0x37')],function(_0x56d676){var _0x2aa5a0={};_0x2aa5a0[_0x56d676]={'$like':'%'+_0x320660[_0x6daa('0x33')][_0x6daa('0x3e')]+'%'};return _0x2aa5a0;})});}if(_0x320660[_0x6daa('0x33')][_0x6daa('0x5b')]){var _0x1138c3=_0x320660['query']['$gte'][_0x6daa('0x5c')](',');var _0x58a841={};_0x58a841[_0x1138c3[0x0]]={'$gte':moment(_0x1138c3[0x1])['format'](_0x6daa('0x5d'))};_0x43bd30[_0x6daa('0x3d')]=_[_0x6daa('0x3f')](_0x43bd30['where'],_0x58a841);}_0x43bd30=_['merge']({},_0x43bd30,_0x320660['options']);return _0x290e1c[_0x6daa('0x5e')](_0x43bd30);}})[_0x6daa('0x25')](function(_0x4c5dc3){if(_0x4c5dc3){_0x4856a7=_0x4c5dc3[_0x6daa('0x46')];if(!_0x320660[_0x6daa('0x33')][_0x6daa('0x39')](_0x6daa('0x3a'))){_0x43bd30[_0x6daa('0x1f')]=qs['limit'](_0x320660[_0x6daa('0x33')][_0x6daa('0x1f')]);_0x43bd30[_0x6daa('0x1e')]=qs['offset'](_0x320660[_0x6daa('0x33')][_0x6daa('0x1e')]);}return _0x290e1c[_0x6daa('0x5e')](_0x43bd30);}})[_0x6daa('0x25')](function(_0x16edd2){if(_0x16edd2){return _0x16edd2?{'count':_0x4856a7,'rows':_0x16edd2}:null;}})[_0x6daa('0x25')](respondWithResult(_0x25ef02,null))[_0x6daa('0x44')](handleError(_0x25ef02,null));}; \ No newline at end of file +var _0x6717=['end','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatGroup','findAll','rows','catch','show','includeAll','include','find','body','params','describe','getUnread','toInteger','addMembers','ids','getMembers','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','create','getMessages','findOne','$gte','split','YYYY-MM-DD\x20HH:mm:ss','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus'];(function(_0x410fd3,_0x393742){var _0x4095e2=function(_0x411375){while(--_0x411375){_0x410fd3['push'](_0x410fd3['shift']());}};_0x4095e2(++_0x393742);}(_0x6717,0x9c));var _0x7671=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6717[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x7671('0x0'));var rimraf=require(_0x7671('0x1'));var zipdir=require(_0x7671('0x2'));var jsonpatch=require(_0x7671('0x3'));var rp=require(_0x7671('0x4'));var moment=require(_0x7671('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7671('0x6'));var path=require('path');var sox=require(_0x7671('0x7'));var csv=require(_0x7671('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7671('0x9'));var _=require('lodash');var squel=require(_0x7671('0xa'));var crypto=require(_0x7671('0xb'));var jsforce=require(_0x7671('0xc'));var deskjs=require(_0x7671('0xd'));var toCsv=require(_0x7671('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7671('0xe'));var authService=require(_0x7671('0xf'));var qs=require(_0x7671('0x10'));var as=require(_0x7671('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7671('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x7671('0x13'));var licenseUtil=require(_0x7671('0x14'));var db=require(_0x7671('0x15'))['db'];config['redis']=_['defaults'](config[_0x7671('0x16')],{'host':_0x7671('0x17'),'port':0x18eb});var socket=require(_0x7671('0x18'))(new Redis(config[_0x7671('0x16')]));require('./chatGroup.socket')['register'](socket);function respondWithStatusCode(_0x1fe34e,_0x49241d){_0x49241d=_0x49241d||0xcc;return function(_0x5319fc){if(_0x5319fc){return _0x1fe34e[_0x7671('0x19')](_0x49241d);}return _0x1fe34e['status'](_0x49241d)[_0x7671('0x1a')]();};}function respondWithResult(_0x2342d4,_0x4ad75a){_0x4ad75a=_0x4ad75a||0xc8;return function(_0x4d1a88){if(_0x4d1a88){return _0x2342d4[_0x7671('0x1b')](_0x4ad75a)[_0x7671('0x1c')](_0x4d1a88);}};}function respondWithFilteredResult(_0x54067b,_0x5d2c87){return function(_0x1edf41){if(_0x1edf41){var _0x1cc84a=typeof _0x5d2c87['offset']==='undefined'&&typeof _0x5d2c87['limit']==='undefined';var _0x2abd74=_0x1edf41[_0x7671('0x1d')];var _0x68ff56=_0x1cc84a?0x0:_0x5d2c87[_0x7671('0x1e')];var _0x9904a8=_0x1cc84a?_0x1edf41[_0x7671('0x1d')]:_0x5d2c87[_0x7671('0x1e')]+_0x5d2c87[_0x7671('0x1f')];var _0x4e27e3;if(_0x9904a8>=_0x2abd74){_0x9904a8=_0x2abd74;_0x4e27e3=0xc8;}else{_0x4e27e3=0xce;}_0x54067b[_0x7671('0x1b')](_0x4e27e3);return _0x54067b[_0x7671('0x20')](_0x7671('0x21'),_0x68ff56+'-'+_0x9904a8+'/'+_0x2abd74)['json'](_0x1edf41);}return null;};}function patchUpdates(_0x1a60b2){return function(_0x2f8feb){try{jsonpatch[_0x7671('0x22')](_0x2f8feb,_0x1a60b2,!![]);}catch(_0x26687f){return BPromise['reject'](_0x26687f);}return _0x2f8feb[_0x7671('0x23')]();};}function saveUpdates(_0x2bfb01,_0x202e9c){return function(_0x18a268){if(_0x18a268){return _0x18a268[_0x7671('0x24')](_0x2bfb01)[_0x7671('0x25')](function(_0x21e7cd){return _0x21e7cd;});}return null;};}function removeEntity(_0x23935c,_0x4db916){return function(_0x24dc59){if(_0x24dc59){return _0x24dc59[_0x7671('0x26')]()['then'](function(){_0x23935c['status'](0xcc)[_0x7671('0x1a')]();});}};}function handleEntityNotFound(_0x3ef7b3,_0x473813){return function(_0x55a2bd){if(!_0x55a2bd){_0x3ef7b3[_0x7671('0x19')](0x194);}return _0x55a2bd;};}function handleError(_0x321501,_0x195892){_0x195892=_0x195892||0x1f4;return function(_0x45648b){logger[_0x7671('0x27')](_0x45648b['stack']);if(_0x45648b[_0x7671('0x28')]){delete _0x45648b['name'];}_0x321501['status'](_0x195892)['send'](_0x45648b);};}exports[_0x7671('0x29')]=function(_0x2fa819,_0x3e8613){var _0x1d8679={},_0x3c8927={},_0x2c4083={'count':0x0,'rows':[]};var _0x1fe55c=_[_0x7671('0x2a')](db['ChatGroup'][_0x7671('0x2b')],function(_0x10cd16){return{'name':_0x10cd16[_0x7671('0x2c')],'type':_0x10cd16[_0x7671('0x2d')][_0x7671('0x2e')]};});_0x3c8927[_0x7671('0x2f')]=_[_0x7671('0x2a')](_0x1fe55c,_0x7671('0x28'));_0x3c8927[_0x7671('0x30')]=_[_0x7671('0x31')](_0x2fa819[_0x7671('0x30')]);_0x3c8927[_0x7671('0x32')]=_['intersection'](_0x3c8927[_0x7671('0x2f')],_0x3c8927['query']);_0x1d8679[_0x7671('0x33')]=_[_0x7671('0x34')](_0x3c8927['model'],qs[_0x7671('0x35')](_0x2fa819[_0x7671('0x30')][_0x7671('0x35')]));_0x1d8679[_0x7671('0x33')]=_0x1d8679[_0x7671('0x33')][_0x7671('0x36')]?_0x1d8679[_0x7671('0x33')]:_0x3c8927[_0x7671('0x2f')];if(!_0x2fa819[_0x7671('0x30')][_0x7671('0x37')]('nolimit')){_0x1d8679[_0x7671('0x1f')]=qs[_0x7671('0x1f')](_0x2fa819[_0x7671('0x30')][_0x7671('0x1f')]);_0x1d8679['offset']=qs['offset'](_0x2fa819[_0x7671('0x30')][_0x7671('0x1e')]);}_0x1d8679[_0x7671('0x38')]=qs[_0x7671('0x39')](_0x2fa819[_0x7671('0x30')][_0x7671('0x39')]);_0x1d8679[_0x7671('0x3a')]=qs[_0x7671('0x32')](_[_0x7671('0x3b')](_0x2fa819[_0x7671('0x30')],_0x3c8927[_0x7671('0x32')]),_0x1fe55c);if(_0x2fa819['query'][_0x7671('0x3c')]){_0x1d8679[_0x7671('0x3a')]=_[_0x7671('0x3d')](_0x1d8679[_0x7671('0x3a')],{'$or':_[_0x7671('0x2a')](_0x1fe55c,function(_0x3f59d0){if(_0x3f59d0[_0x7671('0x2d')]!==_0x7671('0x3e')){var _0x1171fa={};_0x1171fa[_0x3f59d0[_0x7671('0x28')]]={'$like':'%'+_0x2fa819[_0x7671('0x30')]['filter']+'%'};return _0x1171fa;}})});}_0x1d8679=_[_0x7671('0x3d')]({},_0x1d8679,_0x2fa819[_0x7671('0x3f')]);var _0x45a17d={'where':_0x1d8679['where']};return db[_0x7671('0x40')]['count'](_0x45a17d)[_0x7671('0x25')](function(_0x4f9132){_0x2c4083[_0x7671('0x1d')]=_0x4f9132;if(_0x2fa819[_0x7671('0x30')]['includeAll']){_0x1d8679['include']=[{'all':!![]}];}return db['ChatGroup'][_0x7671('0x41')](_0x1d8679);})[_0x7671('0x25')](function(_0x34318b){_0x2c4083[_0x7671('0x42')]=_0x34318b;return _0x2c4083;})[_0x7671('0x25')](respondWithFilteredResult(_0x3e8613,_0x1d8679))[_0x7671('0x43')](handleError(_0x3e8613,null));};exports[_0x7671('0x44')]=function(_0x435710,_0x1d74b7){var _0x3cfb08={'raw':!![],'where':{'id':_0x435710['params']['id']}},_0x142ef8={};_0x142ef8['model']=_['keys'](db[_0x7671('0x40')][_0x7671('0x2b')]);_0x142ef8[_0x7671('0x30')]=_[_0x7671('0x31')](_0x435710[_0x7671('0x30')]);_0x142ef8[_0x7671('0x32')]=_['intersection'](_0x142ef8[_0x7671('0x2f')],_0x142ef8[_0x7671('0x30')]);_0x3cfb08[_0x7671('0x33')]=_['intersection'](_0x142ef8[_0x7671('0x2f')],qs['fields'](_0x435710[_0x7671('0x30')]['fields']));_0x3cfb08[_0x7671('0x33')]=_0x3cfb08['attributes']['length']?_0x3cfb08[_0x7671('0x33')]:_0x142ef8[_0x7671('0x2f')];if(_0x435710[_0x7671('0x30')][_0x7671('0x45')]){_0x3cfb08[_0x7671('0x46')]=[{'all':!![]}];}_0x3cfb08=_[_0x7671('0x3d')]({},_0x3cfb08,_0x435710[_0x7671('0x3f')]);return db['ChatGroup'][_0x7671('0x47')](_0x3cfb08)[_0x7671('0x25')](handleEntityNotFound(_0x1d74b7,null))[_0x7671('0x25')](respondWithResult(_0x1d74b7,null))[_0x7671('0x43')](handleError(_0x1d74b7,null));};exports['create']=function(_0x3406d3,_0x7accb7){return db[_0x7671('0x40')]['create'](_0x3406d3[_0x7671('0x48')],{})['then'](respondWithResult(_0x7accb7,0xc9))[_0x7671('0x43')](handleError(_0x7accb7,null));};exports[_0x7671('0x24')]=function(_0x4e1c75,_0x1d22e8){if(_0x4e1c75[_0x7671('0x48')]['id']){delete _0x4e1c75['body']['id'];}return db[_0x7671('0x40')][_0x7671('0x47')]({'where':{'id':_0x4e1c75[_0x7671('0x49')]['id']}})[_0x7671('0x25')](handleEntityNotFound(_0x1d22e8,null))[_0x7671('0x25')](saveUpdates(_0x4e1c75[_0x7671('0x48')],null))[_0x7671('0x25')](respondWithResult(_0x1d22e8,null))[_0x7671('0x43')](handleError(_0x1d22e8,null));};exports[_0x7671('0x26')]=function(_0x12e7bf,_0x1c21e7){return db[_0x7671('0x40')][_0x7671('0x47')]({'where':{'id':_0x12e7bf[_0x7671('0x49')]['id']}})[_0x7671('0x25')](handleEntityNotFound(_0x1c21e7,null))[_0x7671('0x25')](removeEntity(_0x1c21e7,null))[_0x7671('0x43')](handleError(_0x1c21e7,null));};exports[_0x7671('0x4a')]=function(_0x59424d,_0x1dbdf8){return db[_0x7671('0x40')]['describe']()[_0x7671('0x25')](respondWithResult(_0x1dbdf8,null))[_0x7671('0x43')](handleError(_0x1dbdf8,null));};exports[_0x7671('0x4b')]=function(_0x52afff,_0x4d2b4b,_0x508337){return db['ChatInternalMessage'][_0x7671('0x1d')]({'where':{'ChatGroupId':_0x52afff[_0x7671('0x49')]['id'],'ToId':_0x52afff['user']['id'],'read':![]}})[_0x7671('0x25')](function(_0x18084d){return{'id':_[_0x7671('0x4c')](_0x52afff[_0x7671('0x49')]['id']),'count':_0x18084d};})[_0x7671('0x25')](respondWithResult(_0x4d2b4b,null))[_0x7671('0x43')](handleError(_0x4d2b4b,null));};exports[_0x7671('0x4d')]=function(_0xb720cc,_0x2bfff2,_0x3f464e){return db[_0x7671('0x40')][_0x7671('0x47')]({'where':{'id':_0xb720cc['params']['id']}})[_0x7671('0x25')](handleEntityNotFound(_0x2bfff2,null))[_0x7671('0x25')](function(_0x45a825){if(_0x45a825){return _0x45a825[_0x7671('0x4d')](_0xb720cc[_0x7671('0x48')][_0x7671('0x4e')],_['omit'](_0xb720cc['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x2bfff2,null))[_0x7671('0x43')](handleError(_0x2bfff2,null));};exports[_0x7671('0x4f')]=function(_0x59bbdd,_0x901451,_0x28ef74){var _0x22ec0e={};var _0x1eb204={};var _0x5333e3;var _0xbf4d3d;return db[_0x7671('0x40')]['findOne']({'where':{'id':_0x59bbdd[_0x7671('0x49')]['id']}})[_0x7671('0x25')](handleEntityNotFound(_0x901451,null))[_0x7671('0x25')](function(_0xc37a9f){if(_0xc37a9f){_0x5333e3=_0xc37a9f;_0x1eb204['model']=_[_0x7671('0x31')](db['User'][_0x7671('0x2b')]);_0x1eb204[_0x7671('0x30')]=_[_0x7671('0x31')](_0x59bbdd[_0x7671('0x30')]);_0x1eb204[_0x7671('0x32')]=_[_0x7671('0x34')](_0x1eb204[_0x7671('0x2f')],_0x1eb204[_0x7671('0x30')]);_0x22ec0e[_0x7671('0x33')]=_['intersection'](_0x1eb204['model'],qs[_0x7671('0x35')](_0x59bbdd[_0x7671('0x30')][_0x7671('0x35')]));_0x22ec0e[_0x7671('0x33')]=_0x22ec0e[_0x7671('0x33')][_0x7671('0x36')]?_0x22ec0e[_0x7671('0x33')]:_0x1eb204[_0x7671('0x2f')];_0x22ec0e[_0x7671('0x38')]=qs[_0x7671('0x39')](_0x59bbdd['query'][_0x7671('0x39')]);_0x22ec0e[_0x7671('0x3a')]=qs['filters'](_[_0x7671('0x3b')](_0x59bbdd[_0x7671('0x30')],_0x1eb204[_0x7671('0x32')]));if(_0x59bbdd[_0x7671('0x30')]['filter']){_0x22ec0e[_0x7671('0x3a')]=_[_0x7671('0x3d')](_0x22ec0e[_0x7671('0x3a')],{'$or':_[_0x7671('0x2a')](_0x22ec0e['attributes'],function(_0x5deb6b){var _0x21a82f={};_0x21a82f[_0x5deb6b]={'$like':'%'+_0x59bbdd[_0x7671('0x30')][_0x7671('0x3c')]+'%'};return _0x21a82f;})});}_0x22ec0e=_[_0x7671('0x3d')]({},_0x22ec0e,_0x59bbdd[_0x7671('0x3f')]);return _0x5333e3[_0x7671('0x4f')](_0x22ec0e);}})['then'](function(_0x5acba2){if(_0x5acba2){_0xbf4d3d=_0x5acba2[_0x7671('0x36')];if(!_0x59bbdd[_0x7671('0x30')][_0x7671('0x37')]('nolimit')){_0x22ec0e[_0x7671('0x1f')]=qs[_0x7671('0x1f')](_0x59bbdd[_0x7671('0x30')][_0x7671('0x1f')]);_0x22ec0e['offset']=qs['offset'](_0x59bbdd[_0x7671('0x30')]['offset']);}return _0x5333e3[_0x7671('0x4f')](_0x22ec0e);}})[_0x7671('0x25')](function(_0x5aa629){if(_0x5aa629){return _0x5aa629?{'count':_0xbf4d3d,'rows':_0x5aa629}:null;}})['then'](respondWithResult(_0x901451,null))[_0x7671('0x43')](handleError(_0x901451,null));};exports[_0x7671('0x50')]=function(_0x431fb5,_0x419907,_0x1bb8cd){return db['ChatGroup']['find']({'where':{'id':_0x431fb5['params']['id']}})[_0x7671('0x25')](handleEntityNotFound(_0x419907,null))['then'](function(_0x483d69){if(_0x483d69){return _0x483d69['removeMembers'](_0x431fb5[_0x7671('0x30')][_0x7671('0x4e')]);}})[_0x7671('0x25')](respondWithStatusCode(_0x419907,null))[_0x7671('0x43')](handleError(_0x419907,null));};exports[_0x7671('0x51')]=function(_0x48e7c8,_0x395b35,_0x4be74b){if(_0x48e7c8[_0x7671('0x48')]['id']){delete _0x48e7c8[_0x7671('0x48')]['id'];}return db[_0x7671('0x40')]['find']({'where':{'id':_0x48e7c8['params']['id']}})[_0x7671('0x25')](handleEntityNotFound(_0x395b35,null))['then'](function(_0x56a5a0){if(_0x56a5a0){_0x48e7c8[_0x7671('0x48')][_0x7671('0x52')]=_0x56a5a0['id'];return db[_0x7671('0x53')][_0x7671('0x54')](_0x48e7c8['body']);}})[_0x7671('0x25')](respondWithResult(_0x395b35,null))[_0x7671('0x43')](handleError(_0x395b35,null));};exports[_0x7671('0x55')]=function(_0x3a1c24,_0x3fc9da,_0x34199b){var _0x21b55d={};var _0x12dd15={};var _0x335559;var _0x4f7d7b;return db['ChatGroup'][_0x7671('0x56')]({'where':{'id':_0x3a1c24[_0x7671('0x49')]['id']}})[_0x7671('0x25')](handleEntityNotFound(_0x3fc9da,null))[_0x7671('0x25')](function(_0x326dc5){if(_0x326dc5){_0x335559=_0x326dc5;_0x12dd15['model']=_['keys'](db['ChatInternalMessage'][_0x7671('0x2b')]);_0x12dd15[_0x7671('0x30')]=_['keys'](_0x3a1c24[_0x7671('0x30')]);_0x12dd15[_0x7671('0x32')]=_[_0x7671('0x34')](_0x12dd15[_0x7671('0x2f')],_0x12dd15[_0x7671('0x30')]);_0x21b55d[_0x7671('0x33')]=_['intersection'](_0x12dd15['model'],qs[_0x7671('0x35')](_0x3a1c24[_0x7671('0x30')][_0x7671('0x35')]));_0x21b55d[_0x7671('0x33')]=_0x21b55d[_0x7671('0x33')]['length']?_0x21b55d['attributes']:_0x12dd15[_0x7671('0x2f')];_0x21b55d[_0x7671('0x38')]=qs[_0x7671('0x39')](_0x3a1c24['query'][_0x7671('0x39')]);_0x21b55d[_0x7671('0x3a')]=qs[_0x7671('0x32')](_[_0x7671('0x3b')](_0x3a1c24['query'],_0x12dd15[_0x7671('0x32')]));if(_0x3a1c24[_0x7671('0x30')][_0x7671('0x3c')]){_0x21b55d[_0x7671('0x3a')]=_[_0x7671('0x3d')](_0x21b55d[_0x7671('0x3a')],{'$or':_[_0x7671('0x2a')](_0x21b55d[_0x7671('0x33')],function(_0x41af64){var _0x8c70e6={};_0x8c70e6[_0x41af64]={'$like':'%'+_0x3a1c24[_0x7671('0x30')][_0x7671('0x3c')]+'%'};return _0x8c70e6;})});}if(_0x3a1c24[_0x7671('0x30')][_0x7671('0x57')]){var _0xa12a29=_0x3a1c24['query'][_0x7671('0x57')][_0x7671('0x58')](',');var _0x35d21a={};_0x35d21a[_0xa12a29[0x0]]={'$gte':moment(_0xa12a29[0x1])['format'](_0x7671('0x59'))};_0x21b55d[_0x7671('0x3a')]=_[_0x7671('0x3d')](_0x21b55d[_0x7671('0x3a')],_0x35d21a);}_0x21b55d=_['merge']({},_0x21b55d,_0x3a1c24[_0x7671('0x3f')]);return _0x335559[_0x7671('0x55')](_0x21b55d);}})['then'](function(_0xd27f4a){if(_0xd27f4a){_0x4f7d7b=_0xd27f4a[_0x7671('0x36')];if(!_0x3a1c24['query'][_0x7671('0x37')](_0x7671('0x5a'))){_0x21b55d[_0x7671('0x1f')]=qs[_0x7671('0x1f')](_0x3a1c24['query'][_0x7671('0x1f')]);_0x21b55d['offset']=qs['offset'](_0x3a1c24[_0x7671('0x30')]['offset']);}return _0x335559['getMessages'](_0x21b55d);}})[_0x7671('0x25')](function(_0x4569b0){if(_0x4569b0){return _0x4569b0?{'count':_0x4f7d7b,'rows':_0x4569b0}:null;}})['then'](respondWithResult(_0x3fc9da,null))[_0x7671('0x43')](handleError(_0x3fc9da,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index ef76e74..f90ec39 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 _0xa6c7=['setMaxListeners','save','update','emit','hook','exports','../../mysqldb'];(function(_0x34533,_0x531aeb){var _0x5810ff=function(_0x478ff1){while(--_0x478ff1){_0x34533['push'](_0x34533['shift']());}};_0x5810ff(++_0x531aeb);}(_0xa6c7,0x133));var _0x7a6c=function(_0x436f10,_0x514381){_0x436f10=_0x436f10-0x0;var _0x5acf9e=_0xa6c7[_0x436f10];return _0x5acf9e;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x7a6c('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x7a6c('0x1')](0x0);var events={'afterCreate':_0x7a6c('0x2'),'afterUpdate':_0x7a6c('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3c1c1f){return function(_0x2e691d,_0x2fe6c8,_0x214fc2){ChatGroupEvents[_0x7a6c('0x4')](_0x3c1c1f+':'+_0x2e691d['id'],_0x2e691d);ChatGroupEvents['emit'](_0x3c1c1f,_0x2e691d);_0x214fc2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x7a6c('0x5')](e,emitEvent(event));}}module[_0x7a6c('0x6')]=ChatGroupEvents; \ No newline at end of file +var _0x7e14=['hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x2fda1b,_0x401dfe){var _0x5d4369=function(_0x549b58){while(--_0x549b58){_0x2fda1b['push'](_0x2fda1b['shift']());}};_0x5d4369(++_0x401dfe);}(_0x7e14,0x174));var _0x47e1=function(_0x1292a4,_0x365ab4){_0x1292a4=_0x1292a4-0x0;var _0x315df7=_0x7e14[_0x1292a4];return _0x315df7;};'use strict';var EventEmitter=require(_0x47e1('0x0'));var ChatGroup=require(_0x47e1('0x1'))['db'][_0x47e1('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x47e1('0x3')](0x0);var events={'afterCreate':_0x47e1('0x4'),'afterUpdate':'update','afterDestroy':_0x47e1('0x5')};function emitEvent(_0x31ea5e){return function(_0x3ae82d,_0x194179,_0x5d2178){ChatGroupEvents['emit'](_0x31ea5e+':'+_0x3ae82d['id'],_0x3ae82d);ChatGroupEvents[_0x47e1('0x6')](_0x31ea5e,_0x3ae82d);_0x5d2178(null);};}for(var e in events){if(events[_0x47e1('0x7')](e)){var event=events[e];ChatGroup[_0x47e1('0x8')](e,emitEvent(event));}}module[_0x47e1('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 2b3275f..9b59766 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 _0xd076=['./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0xd076,0x67));var _0x6d07=function(_0x31b421,_0x38e820){_0x31b421=_0x31b421-0x0;var _0x8035cd=_0xd076[_0x31b421];return _0x8035cd;};'use strict';var _=require(_0x6d07('0x0'));var util=require('util');var logger=require(_0x6d07('0x1'))(_0x6d07('0x2'));var moment=require(_0x6d07('0x3'));var BPromise=require(_0x6d07('0x4'));var rp=require(_0x6d07('0x5'));var fs=require('fs');var path=require(_0x6d07('0x6'));var rimraf=require(_0x6d07('0x7'));var config=require(_0x6d07('0x8'));var attributes=require(_0x6d07('0x9'));module[_0x6d07('0xa')]=function(_0x4f4383,_0xe6f270){return _0x4f4383[_0x6d07('0xb')](_0x6d07('0xc'),attributes,{'tableName':_0x6d07('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1d36=['../../config/logger','moment','bluebird','request-promise','path','rimraf','exports','define','chat_groups','lodash','util'];(function(_0xd2f4f5,_0x341930){var _0x41fc10=function(_0x496824){while(--_0x496824){_0xd2f4f5['push'](_0xd2f4f5['shift']());}};_0x41fc10(++_0x341930);}(_0x1d36,0xfb));var _0x61d3=function(_0xa88306,_0x26272f){_0xa88306=_0xa88306-0x0;var _0x269ec3=_0x1d36[_0xa88306];return _0x269ec3;};'use strict';var _=require(_0x61d3('0x0'));var util=require(_0x61d3('0x1'));var logger=require(_0x61d3('0x2'))('api');var moment=require(_0x61d3('0x3'));var BPromise=require(_0x61d3('0x4'));var rp=require(_0x61d3('0x5'));var fs=require('fs');var path=require(_0x61d3('0x6'));var rimraf=require(_0x61d3('0x7'));var config=require('../../config/environment');var attributes=require('./chatGroup.attributes');module[_0x61d3('0x8')]=function(_0x23d9ec,_0x329abb){return _0x23d9ec[_0x61d3('0x9')]('ChatGroup',attributes,{'tableName':_0x61d3('0xa'),'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 d5b40c9..2cc6a67 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 _0xaa48=['ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x576094,_0xf6d258){var _0x497446=function(_0x74ca18){while(--_0x74ca18){_0x576094['push'](_0x576094['shift']());}};_0x497446(++_0xf6d258);}(_0xaa48,0x15a));var _0x8aa4=function(_0x4ab985,_0x54fe6){_0x4ab985=_0x4ab985-0x0;var _0x1387d6=_0xaa48[_0x4ab985];return _0x1387d6;};'use strict';var _=require(_0x8aa4('0x0'));var util=require(_0x8aa4('0x1'));var moment=require(_0x8aa4('0x2'));var BPromise=require(_0x8aa4('0x3'));var rs=require(_0x8aa4('0x4'));var fs=require('fs');var Redis=require(_0x8aa4('0x5'));var db=require(_0x8aa4('0x6'))['db'];var utils=require(_0x8aa4('0x7'));var logger=require(_0x8aa4('0x8'))(_0x8aa4('0x9'));var config=require(_0x8aa4('0xa'));var jayson=require(_0x8aa4('0xb'));var client=jayson[_0x8aa4('0xc')][_0x8aa4('0xd')]({'port':0x232a});config[_0x8aa4('0xe')]=_[_0x8aa4('0xf')](config[_0x8aa4('0xe')],{'host':_0x8aa4('0x10'),'port':0x18eb});var socket=require(_0x8aa4('0x11'))(new Redis(config['redis']));require(_0x8aa4('0x12'))[_0x8aa4('0x13')](socket);function respondWithRpcPromise(_0x55c899,_0x177fe5,_0xab07f2){return new BPromise(function(_0x557ffa,_0xc21580){return client[_0x8aa4('0x14')](_0x55c899,_0xab07f2)[_0x8aa4('0x15')](function(_0x38ecc6){logger[_0x8aa4('0x16')](_0x8aa4('0x17'),_0x177fe5,_0x8aa4('0x18'));logger[_0x8aa4('0x19')](_0x8aa4('0x1a'),_0x177fe5,_0x8aa4('0x18'),JSON['stringify'](_0x38ecc6));if(_0x38ecc6['error']){if(_0x38ecc6[_0x8aa4('0x1b')][_0x8aa4('0x1c')]===0x1f4){logger[_0x8aa4('0x1b')](_0x8aa4('0x17'),_0x177fe5,_0x38ecc6[_0x8aa4('0x1b')][_0x8aa4('0x1d')]);return _0xc21580(_0x38ecc6[_0x8aa4('0x1b')][_0x8aa4('0x1d')]);}logger[_0x8aa4('0x1b')](_0x8aa4('0x17'),_0x177fe5,_0x38ecc6['error']['message']);return _0x557ffa(_0x38ecc6['error'][_0x8aa4('0x1d')]);}else{logger[_0x8aa4('0x16')](_0x8aa4('0x17'),_0x177fe5,_0x8aa4('0x18'));_0x557ffa(_0x38ecc6['result'][_0x8aa4('0x1d')]);}})[_0x8aa4('0x1e')](function(_0x59d3a2){logger[_0x8aa4('0x1b')]('ChatGroup,\x20%s,\x20%s',_0x177fe5,_0x59d3a2);_0xc21580(_0x59d3a2);});});} \ No newline at end of file +var _0x3f2b=['localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','ChatGroup,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis'];(function(_0x2409f0,_0x2bd311){var _0x5ca407=function(_0x421d8d){while(--_0x421d8d){_0x2409f0['push'](_0x2409f0['shift']());}};_0x5ca407(++_0x2bd311);}(_0x3f2b,0x72));var _0xb3f2=function(_0x21eb63,_0x23e7d1){_0x21eb63=_0x21eb63-0x0;var _0x5183ae=_0x3f2b[_0x21eb63];return _0x5183ae;};'use strict';var _=require(_0xb3f2('0x0'));var util=require('util');var moment=require(_0xb3f2('0x1'));var BPromise=require(_0xb3f2('0x2'));var rs=require(_0xb3f2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb3f2('0x4'))['db'];var utils=require(_0xb3f2('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xb3f2('0x6'));var jayson=require(_0xb3f2('0x7'));var client=jayson[_0xb3f2('0x8')][_0xb3f2('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xb3f2('0xa')],{'host':_0xb3f2('0xb'),'port':0x18eb});var socket=require(_0xb3f2('0xc'))(new Redis(config[_0xb3f2('0xa')]));require(_0xb3f2('0xd'))[_0xb3f2('0xe')](socket);function respondWithRpcPromise(_0x415fd9,_0x314877,_0x94fada){return new BPromise(function(_0xf9b4be,_0x185c58){return client[_0xb3f2('0xf')](_0x415fd9,_0x94fada)[_0xb3f2('0x10')](function(_0xaf3b86){logger[_0xb3f2('0x11')]('ChatGroup,\x20%s,\x20%s',_0x314877,_0xb3f2('0x12'));logger['debug'](_0xb3f2('0x13'),_0x314877,_0xb3f2('0x12'),JSON['stringify'](_0xaf3b86));if(_0xaf3b86[_0xb3f2('0x14')]){if(_0xaf3b86[_0xb3f2('0x14')][_0xb3f2('0x15')]===0x1f4){logger['error'](_0xb3f2('0x16'),_0x314877,_0xaf3b86[_0xb3f2('0x14')][_0xb3f2('0x17')]);return _0x185c58(_0xaf3b86[_0xb3f2('0x14')][_0xb3f2('0x17')]);}logger[_0xb3f2('0x14')](_0xb3f2('0x16'),_0x314877,_0xaf3b86['error'][_0xb3f2('0x17')]);return _0xf9b4be(_0xaf3b86[_0xb3f2('0x14')][_0xb3f2('0x17')]);}else{logger[_0xb3f2('0x11')](_0xb3f2('0x16'),_0x314877,_0xb3f2('0x12'));_0xf9b4be(_0xaf3b86['result']['message']);}})[_0xb3f2('0x18')](function(_0x3a861a){logger[_0xb3f2('0x14')]('ChatGroup,\x20%s,\x20%s',_0x314877,_0x3a861a);_0x185c58(_0x3a861a);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 9ec96f4..4e6e254 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 _0x2ebd=['remove','emit','removeListener','register','length','chatGroup:','./chatGroup.events','save'];(function(_0x259ff5,_0x4ee571){var _0x274aa7=function(_0x16d9f2){while(--_0x16d9f2){_0x259ff5['push'](_0x259ff5['shift']());}};_0x274aa7(++_0x4ee571);}(_0x2ebd,0xf6));var _0xd2eb=function(_0x305474,_0x3ee61d){_0x305474=_0x305474-0x0;var _0x12335b=_0x2ebd[_0x305474];return _0x12335b;};'use strict';var ChatGroupEvents=require(_0xd2eb('0x0'));var events=[_0xd2eb('0x1'),_0xd2eb('0x2'),'update'];function createListener(_0x3f5486,_0x4e7b25){return function(_0x51f6b1){_0x4e7b25[_0xd2eb('0x3')](_0x3f5486,_0x51f6b1);};}function removeListener(_0x50ae06,_0x43c4bc){return function(){ChatGroupEvents[_0xd2eb('0x4')](_0x50ae06,_0x43c4bc);};}exports[_0xd2eb('0x5')]=function(_0xcffa76){for(var _0x1fa412=0x0,_0x1af5e3=events[_0xd2eb('0x6')];_0x1fa412<_0x1af5e3;_0x1fa412++){var _0x2899bb=events[_0x1fa412];var _0x340417=createListener(_0xd2eb('0x7')+_0x2899bb,_0xcffa76);ChatGroupEvents['on'](_0x2899bb,_0x340417);}}; \ No newline at end of file +var _0xfe6a=['remove','update','emit','removeListener','chatGroup:','save'];(function(_0x2928cc,_0x20ed48){var _0x526b37=function(_0x12c57d){while(--_0x12c57d){_0x2928cc['push'](_0x2928cc['shift']());}};_0x526b37(++_0x20ed48);}(_0xfe6a,0x1e5));var _0xafe6=function(_0xce3815,_0x10ceb9){_0xce3815=_0xce3815-0x0;var _0x865d2f=_0xfe6a[_0xce3815];return _0x865d2f;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0xafe6('0x0'),_0xafe6('0x1'),_0xafe6('0x2')];function createListener(_0xf02d38,_0x3bc59a){return function(_0x3c3d45){_0x3bc59a[_0xafe6('0x3')](_0xf02d38,_0x3c3d45);};}function removeListener(_0x3a6930,_0x58a060){return function(){ChatGroupEvents[_0xafe6('0x4')](_0x3a6930,_0x58a060);};}exports['register']=function(_0x538a96){for(var _0x4b94fe=0x0,_0x59ad46=events['length'];_0x4b94fe<_0x59ad46;_0x4b94fe++){var _0x4d10a6=events[_0x4b94fe];var _0x24362d=createListener(_0xafe6('0x5')+_0x4d10a6,_0x538a96);ChatGroupEvents['on'](_0x4d10a6,_0x24362d);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 5a115f7..47a67e3 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 _0x1e12=['/describe','isAuthenticated','/:id','show','getUnread','/:id/members','/:id/messages','post','addMembers','addMessage','delete','removeMembers','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatGroup.controller','index','get'];(function(_0x270598,_0xc9943f){var _0x317f11=function(_0x338e24){while(--_0x338e24){_0x270598['push'](_0x270598['shift']());}};_0x317f11(++_0xc9943f);}(_0x1e12,0x7f));var _0x21e1=function(_0x5cd6f4,_0x116dd3){_0x5cd6f4=_0x5cd6f4-0x0;var _0x515aca=_0x1e12[_0x5cd6f4];return _0x515aca;};'use strict';var multer=require(_0x21e1('0x0'));var util=require(_0x21e1('0x1'));var path=require(_0x21e1('0x2'));var timeout=require(_0x21e1('0x3'));var express=require(_0x21e1('0x4'));var router=express[_0x21e1('0x5')]();var fs_extra=require(_0x21e1('0x6'));var auth=require(_0x21e1('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x21e1('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x21e1('0x9')]);router[_0x21e1('0xa')](_0x21e1('0xb'),auth[_0x21e1('0xc')](),controller['describe']);router['get'](_0x21e1('0xd'),auth[_0x21e1('0xc')](),controller[_0x21e1('0xe')]);router[_0x21e1('0xa')]('/:id/unread',auth[_0x21e1('0xc')](),controller[_0x21e1('0xf')]);router[_0x21e1('0xa')](_0x21e1('0x10'),auth[_0x21e1('0xc')](),controller['getMembers']);router[_0x21e1('0xa')](_0x21e1('0x11'),auth[_0x21e1('0xc')](),controller['getMessages']);router[_0x21e1('0x12')]('/',auth[_0x21e1('0xc')](),controller['create']);router[_0x21e1('0x12')](_0x21e1('0x10'),auth['isAuthenticated'](),controller[_0x21e1('0x13')]);router[_0x21e1('0x12')](_0x21e1('0x11'),auth[_0x21e1('0xc')](),controller[_0x21e1('0x14')]);router['put'](_0x21e1('0xd'),auth[_0x21e1('0xc')](),controller['update']);router[_0x21e1('0x15')](_0x21e1('0xd'),auth[_0x21e1('0xc')](),controller['destroy']);router[_0x21e1('0x15')]('/:id/members',auth[_0x21e1('0xc')](),controller[_0x21e1('0x16')]);module['exports']=router; \ No newline at end of file +var _0x1c3a=['/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','create','addMembers','addMessage','update','delete','destroy','removeMembers','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','get','describe'];(function(_0xa43ede,_0x518b08){var _0x5ae2f5=function(_0x3e31e5){while(--_0x3e31e5){_0xa43ede['push'](_0xa43ede['shift']());}};_0x5ae2f5(++_0x518b08);}(_0x1c3a,0x84));var _0xa1c3=function(_0x463934,_0x1e38ec){_0x463934=_0x463934-0x0;var _0x44c1a2=_0x1c3a[_0x463934];return _0x44c1a2;};'use strict';var multer=require(_0xa1c3('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa1c3('0x1'));var express=require(_0xa1c3('0x2'));var router=express[_0xa1c3('0x3')]();var fs_extra=require(_0xa1c3('0x4'));var auth=require(_0xa1c3('0x5'));var interaction=require(_0xa1c3('0x6'));var config=require(_0xa1c3('0x7'));var controller=require(_0xa1c3('0x8'));router['get']('/',auth[_0xa1c3('0x9')](),controller[_0xa1c3('0xa')]);router[_0xa1c3('0xb')]('/describe',auth[_0xa1c3('0x9')](),controller[_0xa1c3('0xc')]);router[_0xa1c3('0xb')](_0xa1c3('0xd'),auth['isAuthenticated'](),controller[_0xa1c3('0xe')]);router[_0xa1c3('0xb')](_0xa1c3('0xf'),auth[_0xa1c3('0x9')](),controller[_0xa1c3('0x10')]);router['get'](_0xa1c3('0x11'),auth[_0xa1c3('0x9')](),controller[_0xa1c3('0x12')]);router[_0xa1c3('0xb')](_0xa1c3('0x13'),auth[_0xa1c3('0x9')](),controller[_0xa1c3('0x14')]);router['post']('/',auth[_0xa1c3('0x9')](),controller[_0xa1c3('0x15')]);router['post'](_0xa1c3('0x11'),auth[_0xa1c3('0x9')](),controller[_0xa1c3('0x16')]);router['post'](_0xa1c3('0x13'),auth[_0xa1c3('0x9')](),controller[_0xa1c3('0x17')]);router['put'](_0xa1c3('0xd'),auth['isAuthenticated'](),controller[_0xa1c3('0x18')]);router[_0xa1c3('0x19')](_0xa1c3('0xd'),auth['isAuthenticated'](),controller[_0xa1c3('0x1a')]);router[_0xa1c3('0x19')]('/:id/members',auth[_0xa1c3('0x9')](),controller[_0xa1c3('0x1b')]);module[_0xa1c3('0x1c')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 63feea6..325516b 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 _0xd935=['long','ENUM','out','sequelize','exports','BOOLEAN','INTEGER','star','thumb','TEXT','DATE','STRING'];(function(_0x434fd3,_0x16bc2f){var _0x46e020=function(_0x58dc28){while(--_0x58dc28){_0x434fd3['push'](_0x434fd3['shift']());}};_0x46e020(++_0x16bc2f);}(_0xd935,0x117));var _0x5d93=function(_0x2d65dd,_0x3469a8){_0x2d65dd=_0x2d65dd-0x0;var _0x502c39=_0xd935[_0x2d65dd];return _0x502c39;};'use strict';var Sequelize=require(_0x5d93('0x0'));module[_0x5d93('0x1')]={'closed':{'type':Sequelize[_0x5d93('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x5d93('0x3')]},'ratingType':{'type':Sequelize['ENUM'](_0x5d93('0x4'),_0x5d93('0x5')),'defaultValue':_0x5d93('0x4')},'ratingMessage':{'type':Sequelize[_0x5d93('0x6')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x5d93('0x7')]},'disposition':{'type':Sequelize[_0x5d93('0x8')]},'secondDisposition':{'type':Sequelize[_0x5d93('0x8')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x5d93('0x8')]},'browserName':{'type':Sequelize[_0x5d93('0x8')]},'browserVersion':{'type':Sequelize[_0x5d93('0x8')]},'osName':{'type':Sequelize[_0x5d93('0x8')]},'osVersion':{'type':Sequelize[_0x5d93('0x8')]},'deviceModel':{'type':Sequelize[_0x5d93('0x8')]},'deviceVendor':{'type':Sequelize[_0x5d93('0x8')]},'deviceType':{'type':Sequelize[_0x5d93('0x8')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x5d93('0x6')](_0x5d93('0x9'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x5d93('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x5d93('0xa')]('in',_0x5d93('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x5d93('0x8')]},'customerPort':{'type':Sequelize[_0x5d93('0x8')]},'vidaooSessionId':{'type':Sequelize[_0x5d93('0x6')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x420e=['TEXT','STRING','DATE','long','INTEGER','sequelize','BOOLEAN','ENUM','star','thumb'];(function(_0x1d6eb4,_0x2a20d7){var _0x1277f0=function(_0x38477d){while(--_0x38477d){_0x1d6eb4['push'](_0x1d6eb4['shift']());}};_0x1277f0(++_0x2a20d7);}(_0x420e,0xcd));var _0xe420=function(_0x1d00ca,_0x1de96a){_0x1d00ca=_0x1d00ca-0x0;var _0x597916=_0x420e[_0x1d00ca];return _0x597916;};'use strict';var Sequelize=require(_0xe420('0x0'));module['exports']={'closed':{'type':Sequelize[_0xe420('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xe420('0x2')](_0xe420('0x3'),_0xe420('0x4')),'defaultValue':_0xe420('0x3')},'ratingMessage':{'type':Sequelize[_0xe420('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0xe420('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xe420('0x7')]},'disposition':{'type':Sequelize[_0xe420('0x6')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xe420('0x6')]},'browserName':{'type':Sequelize[_0xe420('0x6')]},'browserVersion':{'type':Sequelize[_0xe420('0x6')]},'osName':{'type':Sequelize[_0xe420('0x6')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xe420('0x6')]},'deviceVendor':{'type':Sequelize[_0xe420('0x6')]},'deviceType':{'type':Sequelize[_0xe420('0x6')]},'referer':{'type':Sequelize[_0xe420('0x5')]},'customerIp':{'type':Sequelize[_0xe420('0x6')]},'formData':{'type':Sequelize[_0xe420('0x5')](_0xe420('0x8'))},'read1stAt':{'type':Sequelize[_0xe420('0x7')]},'lastMsgAt':{'type':Sequelize[_0xe420('0x7')]},'lastMsgDirection':{'type':Sequelize[_0xe420('0x2')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xe420('0x6')]},'customerPort':{'type':Sequelize[_0xe420('0x6')]},'vidaooSessionId':{'type':Sequelize[_0xe420('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0xe420('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xe420('0x9')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 5740c92..c026da7 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 _0x43a1=['toString','server','files','attachments','transcript-%d-%s.zip','firstName','lastName','read','Account','Owner','N.A.','closedAt','browserName','osName','referer','customerIp','customerPort','tail','createReadStream','pipe','createWriteStream','value','renderFile','downloadInteraction.ejs','transcript-','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','request-promise','bluebird','util','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','message','catch','sendStatus','end','status','json','offset','undefined','count','limit','update','stack','name','send','render','index','map','ChatInteraction','rawAttributes','fieldName','getOptions','query','user','show','model','keys','filters','intersection','attributes','fields','includeAll','include','merge','options','create','body','find','params','destroy','describe','createVidaooSession','ChatWebsite','findOne','vidaooApiKey','vidaooEscalation','vidaooNote','fullname','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','vidaooTopic','isNull','vidaooMetadata','parse','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Sequelize','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','file','originalname','basename','filename','type','Attachment','attachmentDownload','Unauthorized','root','server/files/attachments/','join','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','ChatWebsiteId','ContactId','length','%s%d','agentAlias','customer','Visitor','agentIdentifier','System','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','hasOwnProperty','nolimit','order','sort','where','pick','$gte','split','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','getMyMessages','ChatInteractionId','filter','push','addTags','setTags','spread','Tag','color','emit','chatInteractionTags:save','removeTags','unix'];(function(_0x47f58d,_0x4ff931){var _0x3cb1d6=function(_0xa26667){while(--_0xa26667){_0x47f58d['push'](_0x47f58d['shift']());}};_0x3cb1d6(++_0x4ff931);}(_0x43a1,0xec));var _0x143a=function(_0x565e14,_0x1bd0f2){_0x565e14=_0x565e14-0x0;var _0x5ada4a=_0x43a1[_0x565e14];return _0x5ada4a;};'use strict';var rimraf=require(_0x143a('0x0'));var zipdir=require(_0x143a('0x1'));var rp=require(_0x143a('0x2'));var moment=require('moment');var BPromise=require(_0x143a('0x3'));var Mustache=require('mustache');var util=require(_0x143a('0x4'));var path=require('path');var ejs=require(_0x143a('0x5'));var fs=require('fs');var _=require(_0x143a('0x6'));var Redis=require(_0x143a('0x7'));var interaction=require(_0x143a('0x8'));var qs=require(_0x143a('0x9'));var pdf=require(_0x143a('0xa'));var logger=require(_0x143a('0xb'))(_0x143a('0xc'));var config=require(_0x143a('0xd'));var db=require(_0x143a('0xe'))['db'];config[_0x143a('0xf')]=_['defaults'](config['redis'],{'host':_0x143a('0x10'),'port':0x18eb});var socket=require(_0x143a('0x11'))(new Redis(config['redis']));require(_0x143a('0x12'))[_0x143a('0x13')](socket);var jayson=require(_0x143a('0x14'));var client=jayson[_0x143a('0x15')][_0x143a('0x16')]({'port':0x232b});var client9004=jayson[_0x143a('0x15')][_0x143a('0x16')]({'port':0x232c});function respondWithRpcPromise(_0x2e34df,_0x2602d2,_0x134a4a,_0x2c8a90){return new BPromise(function(_0x4b3b46,_0x446641){var _0x2d0a86=_0x2c8a90||client;return _0x2d0a86[_0x143a('0x17')](_0x2e34df,_0x134a4a)[_0x143a('0x18')](function(_0x421b78){logger[_0x143a('0x19')](_0x143a('0x1a'),_0x2602d2,_0x143a('0x1b'));logger[_0x143a('0x1c')](_0x143a('0x1d'),_0x2602d2,_0x143a('0x1b'),JSON['stringify'](_0x421b78));if(_0x421b78[_0x143a('0x1e')]){if(_0x421b78[_0x143a('0x1e')]['code']===0x1f4){logger[_0x143a('0x1e')]('ChatInteraction,\x20%s,\x20%s',_0x2602d2,_0x421b78['error']['message']);return _0x446641(_0x421b78['error']['message']);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x2602d2,_0x421b78[_0x143a('0x1e')][_0x143a('0x1f')]);return _0x4b3b46(_0x421b78[_0x143a('0x1e')][_0x143a('0x1f')]);}else{logger[_0x143a('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x2602d2,_0x143a('0x1b'));_0x4b3b46(_0x421b78['result']['message']);}})[_0x143a('0x20')](function(_0x38f3b9){logger['error'](_0x143a('0x1a'),_0x2602d2,_0x38f3b9);_0x446641(_0x38f3b9);});});}function respondWithStatusCode(_0x3ddf73,_0x3b89b4){_0x3b89b4=_0x3b89b4||0xcc;return function(_0x53edba){if(_0x53edba){return _0x3ddf73[_0x143a('0x21')](_0x3b89b4);}return _0x3ddf73['status'](_0x3b89b4)[_0x143a('0x22')]();};}function respondWithResult(_0x27f1e6,_0x4c6c8c){_0x4c6c8c=_0x4c6c8c||0xc8;return function(_0x52726d){if(_0x52726d){return _0x27f1e6[_0x143a('0x23')](_0x4c6c8c)[_0x143a('0x24')](_0x52726d);}};}function respondWithFilteredResult(_0x4c43b8,_0x3ec41f){return function(_0x511868){if(_0x511868){var _0x3e3067=typeof _0x3ec41f[_0x143a('0x25')]==='undefined'&&typeof _0x3ec41f['limit']===_0x143a('0x26');var _0x4a3683=_0x511868[_0x143a('0x27')];var _0x54f958=_0x3e3067?0x0:_0x3ec41f[_0x143a('0x25')];var _0x3a91e7=_0x3e3067?_0x511868[_0x143a('0x27')]:_0x3ec41f[_0x143a('0x25')]+_0x3ec41f[_0x143a('0x28')];var _0x30d66e;if(_0x3a91e7>=_0x4a3683){_0x3a91e7=_0x4a3683;_0x30d66e=0xc8;}else{_0x30d66e=0xce;}_0x4c43b8[_0x143a('0x23')](_0x30d66e);return _0x4c43b8['set']('Content-Range',_0x54f958+'-'+_0x3a91e7+'/'+_0x4a3683)[_0x143a('0x24')](_0x511868);}return null;};}function saveUpdates(_0x1ff28b){return function(_0x19d37f){if(_0x19d37f){return _0x19d37f[_0x143a('0x29')](_0x1ff28b)['then'](function(_0x39f6c6){return _0x39f6c6;});}return null;};}function removeEntity(_0x1e2166){return function(_0x5e9d6){if(_0x5e9d6){return _0x5e9d6['destroy']()[_0x143a('0x18')](function(){_0x1e2166['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c398c){return function(_0x215e6c){if(!_0x215e6c){_0x2c398c[_0x143a('0x21')](0x194);}return _0x215e6c;};}function handleError(_0x4c293b,_0x51d7c4){_0x51d7c4=_0x51d7c4||0x1f4;return function(_0x41594c){logger[_0x143a('0x1e')](_0x41594c[_0x143a('0x2a')]);if(_0x41594c[_0x143a('0x2b')]){delete _0x41594c[_0x143a('0x2b')];}_0x4c293b[_0x143a('0x23')](_0x51d7c4)[_0x143a('0x2c')](_0x41594c);};}function getMustacheRender(_0x20b04d,_0x194c3f){return Mustache[_0x143a('0x2d')](_0x20b04d,_['merge'](_0x194c3f['body'],{'contact':_0x194c3f['contact'],'message':_0x194c3f[_0x143a('0x1f')],'agent':_0x194c3f['agent'],'interaction':_0x194c3f['interaction'],'account':_0x194c3f['account']}))||'';}exports[_0x143a('0x2e')]=function(_0x250f04,_0xe06df2){var _0x30caf3={};var _0x28f4ea=_[_0x143a('0x2f')](db[_0x143a('0x30')][_0x143a('0x31')],function(_0x3517e3){return{'name':_0x3517e3[_0x143a('0x32')],'type':_0x3517e3['type']['key']};});_0x30caf3=qs[_0x143a('0x33')](_0x28f4ea,_0x250f04);return interaction['findAll']('chat',_0x250f04[_0x143a('0x34')],_0x250f04[_0x143a('0x35')],_0x30caf3,_0x28f4ea)['then'](respondWithFilteredResult(_0xe06df2,_0x30caf3))[_0x143a('0x20')](handleError(_0xe06df2,null));};exports[_0x143a('0x36')]=function(_0x43e148,_0x5c5566){var _0x2fa1ad={'raw':![],'where':{'id':_0x43e148['params']['id']}},_0x28bb30={};_0x28bb30[_0x143a('0x37')]=_[_0x143a('0x38')](db[_0x143a('0x30')][_0x143a('0x31')]);_0x28bb30[_0x143a('0x34')]=_[_0x143a('0x38')](_0x43e148['query']);_0x28bb30[_0x143a('0x39')]=_[_0x143a('0x3a')](_0x28bb30[_0x143a('0x37')],_0x28bb30['query']);_0x2fa1ad[_0x143a('0x3b')]=_[_0x143a('0x3a')](_0x28bb30[_0x143a('0x37')],qs[_0x143a('0x3c')](_0x43e148[_0x143a('0x34')]['fields']));_0x2fa1ad[_0x143a('0x3b')]=_0x2fa1ad[_0x143a('0x3b')]['length']?_0x2fa1ad['attributes']:_0x28bb30[_0x143a('0x37')];if(_0x43e148[_0x143a('0x34')][_0x143a('0x3d')]){_0x2fa1ad[_0x143a('0x3e')]=[{'all':!![]}];}_0x2fa1ad=_[_0x143a('0x3f')]({},_0x2fa1ad,_0x43e148[_0x143a('0x40')]);return db['ChatInteraction']['find'](_0x2fa1ad)[_0x143a('0x18')](handleEntityNotFound(_0x5c5566,null))[_0x143a('0x18')](respondWithResult(_0x5c5566,null))[_0x143a('0x20')](handleError(_0x5c5566,null));};exports[_0x143a('0x41')]=function(_0x5193ce,_0x48fc38){return db[_0x143a('0x30')][_0x143a('0x41')](_0x5193ce[_0x143a('0x42')],{})['then'](respondWithResult(_0x48fc38,0xc9))[_0x143a('0x20')](handleError(_0x48fc38,null));};exports['update']=function(_0x4a0a88,_0x5f3596){if(_0x4a0a88[_0x143a('0x42')]['id']){delete _0x4a0a88[_0x143a('0x42')]['id'];}return db[_0x143a('0x30')][_0x143a('0x43')]({'where':{'id':_0x4a0a88[_0x143a('0x44')]['id']}})[_0x143a('0x18')](handleEntityNotFound(_0x5f3596,null))[_0x143a('0x18')](saveUpdates(_0x4a0a88[_0x143a('0x42')],null))[_0x143a('0x18')](respondWithResult(_0x5f3596,null))[_0x143a('0x20')](handleError(_0x5f3596,null));};exports[_0x143a('0x45')]=function(_0x5a1937,_0x109c05){return db[_0x143a('0x30')][_0x143a('0x43')]({'where':{'id':_0x5a1937[_0x143a('0x44')]['id']}})[_0x143a('0x18')](handleEntityNotFound(_0x109c05,null))[_0x143a('0x18')](removeEntity(_0x109c05,null))[_0x143a('0x20')](handleError(_0x109c05,null));};exports[_0x143a('0x46')]=function(_0xfb1a8d,_0x29104d){return db[_0x143a('0x30')][_0x143a('0x46')]()[_0x143a('0x18')](respondWithResult(_0x29104d,null))['catch'](handleError(_0x29104d,null));};exports[_0x143a('0x47')]=function(_0x922fe8,_0x1be931){var _0x1d42d6=_0x922fe8['params']['id'];var _0x2390e6;var _0x241372;var _0x4ce4e3;return db[_0x143a('0x30')]['findOne']({'where':{'id':_0x1d42d6}})[_0x143a('0x18')](function(_0x48624f){_0x2390e6=_0x48624f;return db[_0x143a('0x48')][_0x143a('0x49')]({'where':{'id':_0x48624f['ChatWebsiteId']},'attributes':['id',_0x143a('0x4a'),_0x143a('0x4b'),'vidaooTopic',_0x143a('0x4c'),'vidaooMetadata'],'raw':!![]});})[_0x143a('0x18')](function(_0x7640ae){if(_0x7640ae&&_0x7640ae[_0x143a('0x4a')]&&_0x7640ae[_0x143a('0x4b')]){_0x241372=_0x7640ae;var _0x12194e={'interaction':{'id':_0x1d42d6},'agent':{'id':_0x922fe8[_0x143a('0x35')]['id'],'name':_0x922fe8[_0x143a('0x35')]['name'],'fullname':_0x922fe8['user'][_0x143a('0x4d')],'email':_0x922fe8['user']['email']},'contact':_0x922fe8[_0x143a('0x42')][_0x143a('0x4e')],'account':_0x922fe8[_0x143a('0x42')]['account']};var _0x3e7927={'rejectUnauthorized':![],'method':_0x143a('0x4f'),'url':_0x143a('0x50'),'headers':{'X-APIKEY':_0x7640ae['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x922fe8[_0x143a('0x35')][_0x143a('0x51')]],'buttons':null,'topic':_0x241372[_0x143a('0x52')],'note':_[_0x143a('0x53')](_0x241372[_0x143a('0x4c')])?null:getMustacheRender(_0x241372[_0x143a('0x4c')],_0x12194e),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0x241372[_0x143a('0x54')])){var _0x4b5e26=getMustacheRender(_0x241372[_0x143a('0x54')],_0x12194e);var _0x598a55=JSON[_0x143a('0x55')](_0x4b5e26);_0x3e7927[_0x143a('0x42')]['metadata']=_0x598a55;}}catch(_0x44fe26){throw new db['Sequelize'][(_0x143a('0x56'))](_0x143a('0x57'));}return rp(_0x3e7927);}else{throw new db[(_0x143a('0x58'))][(_0x143a('0x56'))](_0x143a('0x59'));}})['then'](function(_0x16d2f4){_0x4ce4e3=_0x16d2f4;if(_0x4ce4e3['id']){var _0x2fece1={'body':_0x4ce4e3[_0x143a('0x5a')],'ChatWebsiteId':_0x241372['id'],'ChatInteractionId':_0x2390e6['id'],'direction':_0x143a('0x5b'),'UserId':_0x922fe8[_0x143a('0x35')]['id']};return db[_0x143a('0x5c')][_0x143a('0x41')](_0x2fece1,{});}else{throw new db[(_0x143a('0x58'))][(_0x143a('0x56'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x143a('0x18')](function(){return _0x2390e6[_0x143a('0x5d')]({'vidaooSessionId':_0x4ce4e3['id']});})['then'](respondWithResult(_0x1be931,null))[_0x143a('0x20')](handleError(_0x1be931,null));};exports[_0x143a('0x5e')]=function(_0x339294,_0x5d0651){if(_0x339294[_0x143a('0x42')]['id']){delete _0x339294[_0x143a('0x42')]['id'];}return db[_0x143a('0x30')]['find']({'where':{'id':_0x339294[_0x143a('0x44')]['id']},'include':[{'model':db[_0x143a('0x5f')],'as':_0x143a('0x60')}]})['then'](handleEntityNotFound(_0x5d0651,null))[_0x143a('0x18')](saveUpdates(_0x339294[_0x143a('0x42')],null))[_0x143a('0x18')](respondWithResult(_0x5d0651,null))[_0x143a('0x20')](handleError(_0x5d0651,null));};exports[_0x143a('0x61')]=function(_0x20a3a8,_0x124600){if(_0x20a3a8[_0x143a('0x42')]['id']){delete _0x20a3a8[_0x143a('0x42')]['id'];}return db['ChatInteraction'][_0x143a('0x43')]({'where':{'id':_0x20a3a8['params']['id']}})['then'](function(_0x321917){if(!_0x321917){logger[_0x143a('0x1e')](_0x143a('0x62'),_0x143a('0x61'),0x194,_0x143a('0x63'));_0x124600[_0x143a('0x21')](0x194);}else{if(_0x321917[_0x143a('0x64')]){throw new db[(_0x143a('0x58'))]['ValidationError'](_0x143a('0x65'));}}return _0x321917;})[_0x143a('0x18')](function(_0x4d321){if(_0x4d321){return _0x4d321[_0x143a('0x29')]({'closed':_0x20a3a8['body'][_0x143a('0x66')],'disposition':_0x20a3a8['body'][_0x143a('0x67')]})[_0x143a('0x18')](function(_0x23f883){return _0x23f883;});}})[_0x143a('0x18')](function(){return respondWithRpcPromise('AbandonInteraction',_0x143a('0x61'),_0x20a3a8[_0x143a('0x42')],client9004);})[_0x143a('0x18')](respondWithResult(_0x124600,null))[_0x143a('0x20')](handleError(_0x124600,null));};exports[_0x143a('0x68')]=function(_0x2ad53e,_0x2fbeb9){_0x2ad53e[_0x143a('0x42')][_0x143a('0x2b')]=_0x2ad53e[_0x143a('0x69')][_0x143a('0x6a')];_0x2ad53e[_0x143a('0x42')][_0x143a('0x6b')]=_0x2ad53e['file'][_0x143a('0x6c')];_0x2ad53e[_0x143a('0x42')][_0x143a('0x6d')]=_0x2ad53e['file']['mimetype'];return db[_0x143a('0x6e')][_0x143a('0x41')](_0x2ad53e[_0x143a('0x42')])['then'](respondWithResult(_0x2fbeb9,0xc9))[_0x143a('0x20')](handleError(_0x2fbeb9,null));};exports[_0x143a('0x6f')]=function(_0x45b4fe,_0x3812a4){return db[_0x143a('0x30')][_0x143a('0x49')]({'where':{'id':_0x45b4fe['params']['id']},'raw':!![]})[_0x143a('0x18')](handleEntityNotFound(_0x3812a4,null))['then'](function(_0x4651b7){if(_0x4651b7){if(_0x4651b7['closed']){return _0x3812a4[_0x143a('0x23')](0x193)[_0x143a('0x24')]({'status':0x193,'message':_0x143a('0x70')});}return db[_0x143a('0x6e')][_0x143a('0x49')]({'where':{'id':_0x45b4fe[_0x143a('0x34')]['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x3812a4,null));}})['then'](function(_0x4ddc6d){if(_0x4ddc6d){var _0x18bd4a=_0x4ddc6d['ChatOfflineMessageId']!==null;var _0x13e171=path['join'](config[_0x143a('0x71')],_0x143a('0x72'));if(_0x18bd4a){_0x13e171=path[_0x143a('0x73')](_0x13e171,_0x143a('0x74'));}var _0x501431=path[_0x143a('0x73')](_0x13e171,_0x4ddc6d[_0x143a('0x6b')]);return _0x3812a4[_0x143a('0x75')](_0x501431);}})['catch'](handleError(_0x3812a4,null));};exports[_0x143a('0x76')]=function(_0x513471,_0x21d783){var _0x4fce33=null;var _0x2bc46d=null;var _0x1ed51d=null;if(_0x513471[_0x143a('0x42')]['id']){delete _0x513471[_0x143a('0x42')]['id'];}if(_0x513471[_0x143a('0x42')][_0x143a('0x77')]){_0x1ed51d=path['join'](config[_0x143a('0x71')],_0x143a('0x78'),util[_0x143a('0x79')](_0x143a('0x7a'),Date[_0x143a('0x7b')]()));_0x513471[_0x143a('0x42')][_0x143a('0x7c')]=_0x1ed51d;}return db[_0x143a('0x30')][_0x143a('0x43')]({'where':{'id':_0x513471[_0x143a('0x44')]['id']},'include':[{'model':db[_0x143a('0x5c')],'as':_0x143a('0x7d'),'include':[{'model':db[_0x143a('0x7e')],'as':_0x143a('0x7e')}]}]})[_0x143a('0x18')](handleEntityNotFound(_0x21d783,null))[_0x143a('0x18')](saveUpdates(_0x513471[_0x143a('0x42')],null))[_0x143a('0x18')](function(_0x21fc87){if(_0x21fc87){_0x4fce33=_0x21fc87;return db[_0x143a('0x48')][_0x143a('0x43')]({'where':{'id':_0x4fce33[_0x143a('0x7f')]}});}})[_0x143a('0x18')](function(_0x2c5134){if(_0x2c5134){_0x2bc46d=_0x2c5134;return db[_0x143a('0x5f')][_0x143a('0x43')]({'where':{'id':_0x4fce33[_0x143a('0x80')]}});}})[_0x143a('0x18')](function(_0x2f04b0){if(_0x2f04b0){if(_0x1ed51d){var _0x295d29=null;for(var _0x38c2de=0x1;_0x38c2de<_0x4fce33[_0x143a('0x7d')][_0x143a('0x81')];++_0x38c2de){_0x295d29=_0x4fce33[_0x143a('0x7d')][_0x38c2de];var _0x333400=_0x295d29[_0x143a('0x64')]?util[_0x143a('0x79')](_0x143a('0x82'),_0x2bc46d[_0x143a('0x83')],_0x295d29[_0x143a('0x64')]):'System';var _0x244b1f=_0x513471[_0x143a('0x42')][_0x143a('0x84')]||util[_0x143a('0x79')](_0x143a('0x82'),_0x143a('0x85'),_0x295d29[_0x143a('0x80')]);switch(_0x2bc46d[_0x143a('0x86')]){case'website_alias':_0x333400=_0x295d29[_0x143a('0x64')]?util[_0x143a('0x79')](_0x143a('0x82'),_0x2bc46d[_0x143a('0x83')],_0x295d29[_0x143a('0x64')]):_0x143a('0x87');break;case _0x143a('0x88'):_0x333400=_0x295d29[_0x143a('0x64')]?_0x295d29[_0x143a('0x7e')][_0x143a('0x89')]||_0x295d29[_0x143a('0x7e')][_0x143a('0x4d')]:_0x143a('0x87');break;case'agent_fullname':_0x333400=_0x295d29[_0x143a('0x64')]?_0x295d29[_0x143a('0x7e')]['fullname']:_0x143a('0x87');break;default:_0x333400=_0x295d29[_0x143a('0x64')]?util['format'](_0x143a('0x82'),_0x2bc46d[_0x143a('0x83')],_0x295d29[_0x143a('0x64')]):'System';}var _0x5eca85=util[_0x143a('0x79')](_0x143a('0x8a'),moment(_0x295d29[_0x143a('0x8b')])[_0x143a('0x79')](_0x143a('0x8c')),_0x295d29[_0x143a('0x8d')]==='in'?_0x244b1f:_0x333400,_0x295d29[_0x143a('0x42')]);if(!_0x295d29[_0x143a('0x8e')]){fs[_0x143a('0x8f')](_0x1ed51d,_0x5eca85);}}return db[_0x143a('0x90')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x143a('0x91'),'raw':!![],'include':[{'model':db[_0x143a('0x92')],'as':_0x143a('0x92'),'raw':!![]}]}]});}}})[_0x143a('0x18')](function(_0x339ec0){if(!_0x339ec0||!_0x339ec0[_0x143a('0x91')]||!_0x513471[_0x143a('0x42')])return _0x4fce33;var _0x2b9186=_0x339ec0[_0x143a('0x93')]();return respondWithRpcPromise(_0x143a('0x94'),_0x143a('0x95'),{'account':_0x2b9186,'message':{'from':util[_0x143a('0x79')](_0x143a('0x96'),_0x339ec0[_0x143a('0x2b')],_0x339ec0['email']||_0x339ec0['Smtp'][_0x143a('0x35')]),'to':_0x513471['body']['mailTranscript'],'subject':'Mail\x20Transcript','text':util[_0x143a('0x79')](_0x143a('0x97'),_0x513471[_0x143a('0x42')]['mailTranscript']),'attachments':[{'path':_0x1ed51d}]}})[_0x143a('0x18')](function(){return _0x4fce33;})['catch'](function(_0x3e806b){logger['error'](_0x3e806b);});})['then'](respondWithStatusCode(_0x21d783,0xc8))[_0x143a('0x20')](handleError(_0x21d783,null));};exports[_0x143a('0x98')]=function(_0x19535f,_0x4d50e1){return db['ChatMessage'][_0x143a('0x43')]({'where':{'id':_0x19535f['params']['id']}})['then'](handleEntityNotFound(_0x4d50e1,null))[_0x143a('0x18')](function(_0x5c18c3){if(_0x5c18c3){return _0x5c18c3[_0x143a('0x98')](_0x19535f[_0x143a('0x42')][_0x143a('0x99')],_[_0x143a('0x9a')](_0x19535f[_0x143a('0x42')],[_0x143a('0x99'),'id'])||{});}})[_0x143a('0x18')](respondWithResult(_0x4d50e1,null))['catch'](handleError(_0x4d50e1,null));};exports[_0x143a('0x9b')]=function(_0x3490c3,_0x2c88d5){var _0x27d598={'raw':![],'where':{}};var _0x295a3a={};var _0x276b3b={'count':0x0,'rows':[]};return db[_0x143a('0x30')][_0x143a('0x49')]({'where':{'id':_0x3490c3[_0x143a('0x44')]['id']}})[_0x143a('0x18')](handleEntityNotFound(_0x2c88d5,null))[_0x143a('0x18')](function(_0x567919){if(_0x567919){_0x295a3a[_0x143a('0x37')]=_[_0x143a('0x38')](db[_0x143a('0x5c')]['rawAttributes']);_0x295a3a[_0x143a('0x34')]=_['keys'](_0x3490c3['query']);_0x295a3a[_0x143a('0x39')]=_[_0x143a('0x3a')](_0x295a3a['model'],_0x295a3a[_0x143a('0x34')]);_0x27d598[_0x143a('0x3b')]=_[_0x143a('0x3a')](_0x295a3a[_0x143a('0x37')],qs['fields'](_0x3490c3[_0x143a('0x34')][_0x143a('0x3c')]));_0x27d598['attributes']=_0x27d598[_0x143a('0x3b')]['length']?_0x27d598[_0x143a('0x3b')]:_0x295a3a['model'];if(!_0x3490c3[_0x143a('0x34')][_0x143a('0x9c')](_0x143a('0x9d'))){_0x27d598['limit']=qs[_0x143a('0x28')](_0x3490c3['query'][_0x143a('0x28')]);_0x27d598[_0x143a('0x25')]=qs[_0x143a('0x25')](_0x3490c3[_0x143a('0x34')][_0x143a('0x25')]);}_0x27d598[_0x143a('0x9e')]=qs[_0x143a('0x9f')](_0x3490c3['query']['sort']);_0x27d598[_0x143a('0xa0')]=qs[_0x143a('0x39')](_[_0x143a('0xa1')](_0x3490c3[_0x143a('0x34')],_0x295a3a[_0x143a('0x39')]));_0x27d598[_0x143a('0xa0')]['ChatInteractionId']=_0x567919['id'];if(_0x3490c3[_0x143a('0x34')]['filter']){_0x27d598[_0x143a('0xa0')]=_[_0x143a('0x3f')](_0x27d598[_0x143a('0xa0')],{'$or':_[_0x143a('0x2f')](_0x27d598['attributes'],function(_0x552df3){var _0x408bb2={};_0x408bb2[_0x552df3]={'$like':'%'+_0x3490c3[_0x143a('0x34')]['filter']+'%'};return _0x408bb2;})});}if(_0x3490c3['query'][_0x143a('0xa2')]){var _0x21eb34=_0x3490c3[_0x143a('0x34')][_0x143a('0xa2')][_0x143a('0xa3')](',');var _0x41d4f4={};_0x41d4f4[_0x21eb34[0x0]]={'$gte':moment(_0x21eb34[0x1])[_0x143a('0x79')](_0x143a('0xa4'))};_0x27d598[_0x143a('0xa0')]=_['merge'](_0x27d598['where'],_0x41d4f4);}_0x27d598=_[_0x143a('0x3f')]({},_0x27d598,_0x3490c3['options']);return db[_0x143a('0x5c')][_0x143a('0x27')]({'where':_0x27d598[_0x143a('0xa0')]})[_0x143a('0x18')](function(_0xfa1948){_0x276b3b['count']=_0xfa1948;if(_0x3490c3[_0x143a('0x34')][_0x143a('0x3d')]){_0x27d598[_0x143a('0x3e')]=[{'all':!![]}];}return db['ChatMessage'][_0x143a('0xa5')](_0x27d598);})['then'](function(_0x3c99c6){_0x276b3b[_0x143a('0xa6')]=_0x3c99c6;return _0x276b3b;});}})[_0x143a('0x18')](respondWithFilteredResult(_0x2c88d5,_0x27d598))[_0x143a('0x20')](handleError(_0x2c88d5,null));};exports[_0x143a('0xa7')]=function(_0x108127,_0x4804d8){var _0x43e2d1={'where':{}},_0x21074f={},_0x20ad20={'count':0x0,'rows':[]};return db[_0x143a('0x30')][_0x143a('0x49')]({'where':{'id':_0x108127[_0x143a('0x44')]['id']}})[_0x143a('0x18')](handleEntityNotFound(_0x4804d8,null))[_0x143a('0x18')](function(_0x3baa22){if(_0x3baa22){_0x21074f[_0x143a('0x37')]=_['keys'](db[_0x143a('0x5c')]['rawAttributes']);_0x21074f['query']=_['keys'](_0x108127[_0x143a('0x34')]);_0x21074f[_0x143a('0x39')]=_['intersection'](_0x21074f[_0x143a('0x37')],_0x21074f['query']);_0x43e2d1['attributes']=_['intersection'](_0x21074f['model'],qs[_0x143a('0x3c')](_0x108127[_0x143a('0x34')][_0x143a('0x3c')]));_0x43e2d1[_0x143a('0x3b')]=_0x43e2d1[_0x143a('0x3b')]['length']?_0x43e2d1[_0x143a('0x3b')]:_0x21074f[_0x143a('0x37')];if(!_0x108127[_0x143a('0x34')][_0x143a('0x9c')]('nolimit')){_0x43e2d1[_0x143a('0x28')]=qs[_0x143a('0x28')](_0x108127[_0x143a('0x34')][_0x143a('0x28')]);_0x43e2d1[_0x143a('0x25')]=qs[_0x143a('0x25')](_0x108127[_0x143a('0x34')][_0x143a('0x25')]);}_0x43e2d1['order']=qs['sort'](_0x108127[_0x143a('0x34')][_0x143a('0x9f')]);_0x43e2d1[_0x143a('0xa0')]=qs['filters'](_['pick'](_0x108127[_0x143a('0x34')],_0x21074f[_0x143a('0x39')]));_0x43e2d1[_0x143a('0xa0')][_0x143a('0xa8')]=_0x3baa22['id'];if(_0x108127[_0x143a('0x34')][_0x143a('0xa9')]){_0x43e2d1[_0x143a('0xa0')]=_[_0x143a('0x3f')](_0x43e2d1[_0x143a('0xa0')],{'$or':_[_0x143a('0x2f')](_0x43e2d1['attributes'],function(_0x8642ec){var _0x3a3d1c={};_0x3a3d1c[_0x8642ec]={'$like':'%'+_0x108127[_0x143a('0x34')][_0x143a('0xa9')]+'%'};return _0x3a3d1c;})});}_0x43e2d1['where'][_0x143a('0x8e')]=![];if(_0x108127[_0x143a('0x34')]['id']){_0x43e2d1[_0x143a('0xa0')]['id']={'$gt':_0x108127[_0x143a('0x34')]['id']};}_0x43e2d1=_[_0x143a('0x3f')]({},_0x43e2d1,_0x108127[_0x143a('0x40')]);return db[_0x143a('0x5c')][_0x143a('0x27')]({'where':_0x43e2d1[_0x143a('0xa0')]})[_0x143a('0x18')](function(_0x550787){_0x20ad20[_0x143a('0x27')]=_0x550787;_0x43e2d1[_0x143a('0x3e')]=[];if(_0x108127[_0x143a('0x34')]['includeAgent']){_0x43e2d1[_0x143a('0x3e')][_0x143a('0xaa')]({'model':db['User'],'as':_0x143a('0x7e'),'attributes':['id',_0x143a('0x4d'),_0x143a('0x89')]});}if(_0x108127[_0x143a('0x34')]['includeAll']){_0x43e2d1['include']=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x43e2d1);})[_0x143a('0x18')](function(_0x7af79d){_0x20ad20[_0x143a('0xa6')]=_0x7af79d;return _0x20ad20;});}})['then'](respondWithFilteredResult(_0x4804d8,_0x43e2d1))[_0x143a('0x20')](handleError(_0x4804d8,null));};exports[_0x143a('0xab')]=function(_0x58967e,_0x115e77){return db[_0x143a('0x30')][_0x143a('0x43')]({'where':{'id':_0x58967e[_0x143a('0x44')]['id']}})['then'](handleEntityNotFound(_0x115e77,null))[_0x143a('0x18')](function(_0x7dca62){if(_0x7dca62){return _0x7dca62[_0x143a('0xac')](_0x58967e['body']['ids'],_[_0x143a('0x9a')](_0x58967e[_0x143a('0x42')],[_0x143a('0x99'),'id'])||{})[_0x143a('0xad')](function(){return db[_0x143a('0xae')][_0x143a('0xa5')]({'attributes':['id',_0x143a('0x2b'),_0x143a('0xaf')],'where':{'id':_0x58967e[_0x143a('0x42')][_0x143a('0x99')]}});})['then'](function(_0x59ddeb){socket[_0x143a('0xb0')](_0x143a('0xb1'),{'id':Number(_0x58967e[_0x143a('0x44')]['id']),'tags':_0x59ddeb||[]});return{'id':Number(_0x58967e[_0x143a('0x44')]['id']),'tags':_0x59ddeb||[]};});}})['then'](respondWithResult(_0x115e77,null))['catch'](handleError(_0x115e77,null));};exports[_0x143a('0xb2')]=function(_0xfcac9c,_0x156c45){return db[_0x143a('0x30')]['find']({'where':{'id':_0xfcac9c['params']['id']}})[_0x143a('0x18')](handleEntityNotFound(_0x156c45,null))[_0x143a('0x18')](function(_0x2cd564){if(_0x2cd564){return _0x2cd564['removeTags'](_0xfcac9c[_0x143a('0x34')]['ids']);}})['then'](respondWithStatusCode(_0x156c45,null))[_0x143a('0x20')](handleError(_0x156c45,null));};exports[_0x143a('0x75')]=function(_0x1c94ca,_0x3ccc24){var _0x840ac1=moment()[_0x143a('0xb3')]()[_0x143a('0xb4')]();var _0x55ca00=path[_0x143a('0x73')](config['root'],_0x143a('0xb5'),_0x143a('0xb6'),'tmp');var _0xf963ad=path[_0x143a('0x73')](config['root'],_0x143a('0xb5'),_0x143a('0xb6'),_0x143a('0xb7'));var _0x36e81f=path['join'](_0x55ca00,_0x840ac1);var _0x20a8dc=util['format'](_0x143a('0xb8'),_0x1c94ca[_0x143a('0x44')]['id'],_0x840ac1);var _0x55033c=path[_0x143a('0x73')](_0x55ca00,_0x20a8dc);var _0x2e3b2b=[];_0x2e3b2b[_0x143a('0xaa')]({'model':db[_0x143a('0x7e')],'as':'User','attributes':['id',_0x143a('0x4d')],'raw':!![]});_0x2e3b2b['push']({'model':db['CmContact'],'as':_0x143a('0x60'),'attributes':['id',_0x143a('0xb9'),_0x143a('0xba')],'raw':!![]});if(_0x1c94ca[_0x143a('0x34')]['attachments']){_0x2e3b2b[_0x143a('0xaa')]({'model':db[_0x143a('0x6e')],'as':_0x143a('0x6e'),'raw':!![]});}var _0x25710a=[{'model':db[_0x143a('0x5c')],'as':_0x143a('0x7d'),'attributes':['id','body','createdAt','direction','secret',_0x143a('0xbb')],'include':_0x2e3b2b}];_0x25710a['push']({'model':db['ChatWebsite'],'as':_0x143a('0xbc'),'attributes':['id',_0x143a('0x2b')]});_0x25710a['push']({'model':db[_0x143a('0x7e')],'as':_0x143a('0xbd'),'attributes':['id',_0x143a('0x4d')]});return db[_0x143a('0x30')]['find']({'where':{'id':_0x1c94ca[_0x143a('0x44')]['id']},'include':_0x25710a})['then'](handleEntityNotFound(_0x3ccc24,null))[_0x143a('0x18')](function(_0x164ce5){if(_0x164ce5){var _0x3ce20c=_0x164ce5['get']({'plain':!![]});fs['mkdirSync'](_0x36e81f);var _0x477427={'channel':'Chat','account':_0x3ce20c['Account'][_0x143a('0x2b')],'agent':_0x3ce20c['Owner']?_0x3ce20c[_0x143a('0xbd')][_0x143a('0x4d')]:_0x143a('0xbe'),'createdAt':moment(_0x3ce20c['createdAt'])[_0x143a('0x79')](_0x143a('0xa4'))[_0x143a('0xb4')](),'closedAt':_0x3ce20c[_0x143a('0x66')]?moment(_0x3ce20c[_0x143a('0xbf')])[_0x143a('0x79')](_0x143a('0xa4'))[_0x143a('0xb4')]():'','disposition':_0x3ce20c[_0x143a('0x67')],'chatInfo':{'browser':_0x3ce20c[_0x143a('0xc0')],'os':_0x3ce20c[_0x143a('0xc1')],'referer':_0x3ce20c[_0x143a('0xc2')],'customerIp':_0x3ce20c[_0x143a('0xc3')],'customerPort':_0x3ce20c[_0x143a('0xc4')]?_0x3ce20c[_0x143a('0xc4')]:_0x143a('0xbe')},'messages':_(_0x3ce20c['Messages'])[_0x143a('0xc5')]()[_0x143a('0xa9')]({'secret':![]})[_0x143a('0x2f')](function(_0x95a2e1){if(_0x95a2e1[_0x143a('0x6e')]){var _0x39124d=path[_0x143a('0x73')](_0xf963ad,_0x95a2e1[_0x143a('0x6e')][_0x143a('0x6b')]);if(fs['existsSync'](_0x39124d)){fs[_0x143a('0xc6')](_0x39124d)[_0x143a('0xc7')](fs[_0x143a('0xc8')](path[_0x143a('0x73')](_0x36e81f,_0x95a2e1['Attachment'][_0x143a('0x6b')])));}}return{'date':moment(_0x95a2e1[_0x143a('0x8b')])[_0x143a('0x79')](_0x143a('0xa4'))[_0x143a('0xb4')](),'sender':_0x95a2e1[_0x143a('0x8d')]===_0x143a('0x5b')?_0x95a2e1[_0x143a('0x7e')]?_0x95a2e1[_0x143a('0x7e')][_0x143a('0x4d')]:'System':_0x95a2e1[_0x143a('0x60')]['firstName']+(_0x95a2e1['Contact'][_0x143a('0xba')]?'\x20'+_0x95a2e1[_0x143a('0x60')][_0x143a('0xba')]:''),'body':_0x95a2e1[_0x143a('0x6e')]?_0x95a2e1[_0x143a('0x6e')][_0x143a('0x6b')]:_0x95a2e1['body'],'direction':_0x95a2e1[_0x143a('0x8d')]===_0x143a('0x5b')?'A':'C','secret':_0x95a2e1['secret'],'read':_0x95a2e1['read'],'attachment':_0x95a2e1['Attachment']};})[_0x143a('0xc9')]()};return ejs[_0x143a('0xca')](path['join'](config[_0x143a('0x71')],_0x143a('0xb5'),'views',_0x143a('0xcb')),{'interaction':_0x477427})[_0x143a('0x18')](function(_0x518f99){var _0x401f1e=path[_0x143a('0x73')](_0x36e81f,_0x143a('0xcc')+_0x3ce20c['id']+'-'+_0x840ac1+'.pdf');var _0x2f142e={'path':_0x401f1e,'channel':'Chat','interactionId':_0x3ce20c['id']};return pdf[_0x143a('0xcd')](_0x518f99,_0x2f142e);})[_0x143a('0x18')](function(){return new Promise(function(_0x21f6d3,_0x103771){zipdir(_0x36e81f,{'saveTo':_0x55033c},function(_0x3d0f91,_0x404f7e){if(_0x3d0f91)return _0x103771(_0x3d0f91);return _0x21f6d3(_0x404f7e);});})['then'](function(){return new BPromise(function(_0x570d21,_0x2b75f1){rimraf(_0x36e81f,function(_0x33be89){if(_0x33be89)_0x2b75f1(_0x33be89);return _0x570d21();});});})[_0x143a('0x18')](function(){return _0x3ccc24[_0x143a('0x75')](_0x55033c,_0x20a8dc,function(_0x4577fb){if(_0x4577fb){logger[_0x143a('0x1e')](_0x143a('0xce'),_0x4577fb);}else{fs[_0x143a('0xcf')](_0x55033c);}});});});}else{return _0x3ccc24[_0x143a('0x21')](0xc8);}})[_0x143a('0x20')](handleError(_0x3ccc24,null));}; \ No newline at end of file +var _0xbffc=['originalname','basename','file','filename','mimetype','Attachment','attachmentDownload','Unauthorized','join','offline-chat/','mailTranscript','root','format','transcript-%s.txt','now','Messages','User','ContactId','UserId','agentAlias','System','customer','agentIdentifier','website_alias','%s%d','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','hasOwnProperty','nolimit','order','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','merge','getMyMessages','push','rows','addTags','setTags','spread','Tag','color','chatInteractionTags:save','removeTags','download','unix','toString','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','direction','read','Account','Owner','mkdirSync','N.A.','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','value','renderFile','views','transcript-','.pdf','Chat','createPdfFromHTML','rimraf','zip-dir','moment','mustache','util','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','end','status','json','undefined','limit','count','offset','Content-Range','update','destroy','sendStatus','stack','name','render','body','contact','agent','interaction','account','map','ChatInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','query','user','params','keys','filters','intersection','model','fields','attributes','length','includeAll','include','options','find','create','describe','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','abandon','attachmentUpload'];(function(_0x1891c8,_0x52ffd0){var _0x3d3dca=function(_0x4230d0){while(--_0x4230d0){_0x1891c8['push'](_0x1891c8['shift']());}};_0x3d3dca(++_0x52ffd0);}(_0xbffc,0x12f));var _0xcbff=function(_0x2201dc,_0x4394f4){_0x2201dc=_0x2201dc-0x0;var _0x39b5e9=_0xbffc[_0x2201dc];return _0x39b5e9;};'use strict';var rimraf=require(_0xcbff('0x0'));var zipdir=require(_0xcbff('0x1'));var rp=require('request-promise');var moment=require(_0xcbff('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xcbff('0x3'));var util=require(_0xcbff('0x4'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require(_0xcbff('0x5'));var interaction=require('../../components/interaction/service');var qs=require(_0xcbff('0x6'));var pdf=require(_0xcbff('0x7'));var logger=require(_0xcbff('0x8'))(_0xcbff('0x9'));var config=require(_0xcbff('0xa'));var db=require(_0xcbff('0xb'))['db'];config[_0xcbff('0xc')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xcbff('0xd'))(new Redis(config[_0xcbff('0xc')]));require(_0xcbff('0xe'))[_0xcbff('0xf')](socket);var jayson=require(_0xcbff('0x10'));var client=jayson[_0xcbff('0x11')][_0xcbff('0x12')]({'port':0x232b});var client9004=jayson[_0xcbff('0x11')][_0xcbff('0x12')]({'port':0x232c});function respondWithRpcPromise(_0x26b9ed,_0x37d115,_0x3666fa,_0x35c221){return new BPromise(function(_0x2c01e4,_0x2337b8){var _0x52851f=_0x35c221||client;return _0x52851f[_0xcbff('0x13')](_0x26b9ed,_0x3666fa)[_0xcbff('0x14')](function(_0x2090b9){logger[_0xcbff('0x15')](_0xcbff('0x16'),_0x37d115,_0xcbff('0x17'));logger[_0xcbff('0x18')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x37d115,'request\x20sent',JSON[_0xcbff('0x19')](_0x2090b9));if(_0x2090b9[_0xcbff('0x1a')]){if(_0x2090b9[_0xcbff('0x1a')][_0xcbff('0x1b')]===0x1f4){logger[_0xcbff('0x1a')](_0xcbff('0x16'),_0x37d115,_0x2090b9['error']['message']);return _0x2337b8(_0x2090b9[_0xcbff('0x1a')][_0xcbff('0x1c')]);}logger['error'](_0xcbff('0x16'),_0x37d115,_0x2090b9[_0xcbff('0x1a')][_0xcbff('0x1c')]);return _0x2c01e4(_0x2090b9[_0xcbff('0x1a')][_0xcbff('0x1c')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x37d115,_0xcbff('0x17'));_0x2c01e4(_0x2090b9[_0xcbff('0x1d')][_0xcbff('0x1c')]);}})[_0xcbff('0x1e')](function(_0x1a7d85){logger[_0xcbff('0x1a')](_0xcbff('0x16'),_0x37d115,_0x1a7d85);_0x2337b8(_0x1a7d85);});});}function respondWithStatusCode(_0x13a84f,_0x21ed68){_0x21ed68=_0x21ed68||0xcc;return function(_0x54516e){if(_0x54516e){return _0x13a84f['sendStatus'](_0x21ed68);}return _0x13a84f['status'](_0x21ed68)[_0xcbff('0x1f')]();};}function respondWithResult(_0x14998d,_0x495166){_0x495166=_0x495166||0xc8;return function(_0x2d5a43){if(_0x2d5a43){return _0x14998d[_0xcbff('0x20')](_0x495166)[_0xcbff('0x21')](_0x2d5a43);}};}function respondWithFilteredResult(_0x58d880,_0xa3b834){return function(_0x5cbe14){if(_0x5cbe14){var _0x1bf238=typeof _0xa3b834['offset']===_0xcbff('0x22')&&typeof _0xa3b834[_0xcbff('0x23')]===_0xcbff('0x22');var _0x416062=_0x5cbe14[_0xcbff('0x24')];var _0x5e577f=_0x1bf238?0x0:_0xa3b834[_0xcbff('0x25')];var _0x9631f3=_0x1bf238?_0x5cbe14[_0xcbff('0x24')]:_0xa3b834['offset']+_0xa3b834[_0xcbff('0x23')];var _0x140f43;if(_0x9631f3>=_0x416062){_0x9631f3=_0x416062;_0x140f43=0xc8;}else{_0x140f43=0xce;}_0x58d880[_0xcbff('0x20')](_0x140f43);return _0x58d880['set'](_0xcbff('0x26'),_0x5e577f+'-'+_0x9631f3+'/'+_0x416062)['json'](_0x5cbe14);}return null;};}function saveUpdates(_0x599a20){return function(_0x4b8fa2){if(_0x4b8fa2){return _0x4b8fa2[_0xcbff('0x27')](_0x599a20)[_0xcbff('0x14')](function(_0x3ed51d){return _0x3ed51d;});}return null;};}function removeEntity(_0x410e67){return function(_0x1e8edb){if(_0x1e8edb){return _0x1e8edb[_0xcbff('0x28')]()['then'](function(){_0x410e67[_0xcbff('0x20')](0xcc)[_0xcbff('0x1f')]();});}};}function handleEntityNotFound(_0x3571f9){return function(_0x27142b){if(!_0x27142b){_0x3571f9[_0xcbff('0x29')](0x194);}return _0x27142b;};}function handleError(_0x422eba,_0x5a924b){_0x5a924b=_0x5a924b||0x1f4;return function(_0x5690fb){logger[_0xcbff('0x1a')](_0x5690fb[_0xcbff('0x2a')]);if(_0x5690fb[_0xcbff('0x2b')]){delete _0x5690fb[_0xcbff('0x2b')];}_0x422eba[_0xcbff('0x20')](_0x5a924b)['send'](_0x5690fb);};}function getMustacheRender(_0xc062a8,_0x442942){return Mustache[_0xcbff('0x2c')](_0xc062a8,_['merge'](_0x442942[_0xcbff('0x2d')],{'contact':_0x442942[_0xcbff('0x2e')],'message':_0x442942[_0xcbff('0x1c')],'agent':_0x442942[_0xcbff('0x2f')],'interaction':_0x442942[_0xcbff('0x30')],'account':_0x442942[_0xcbff('0x31')]}))||'';}exports['index']=function(_0x3a9592,_0x56fb1e){var _0x3f4605={};var _0x2857d5=_[_0xcbff('0x32')](db[_0xcbff('0x33')][_0xcbff('0x34')],function(_0x5e0bf6){return{'name':_0x5e0bf6[_0xcbff('0x35')],'type':_0x5e0bf6[_0xcbff('0x36')][_0xcbff('0x37')]};});_0x3f4605=qs[_0xcbff('0x38')](_0x2857d5,_0x3a9592);return interaction[_0xcbff('0x39')]('chat',_0x3a9592[_0xcbff('0x3a')],_0x3a9592[_0xcbff('0x3b')],_0x3f4605,_0x2857d5)[_0xcbff('0x14')](respondWithFilteredResult(_0x56fb1e,_0x3f4605))[_0xcbff('0x1e')](handleError(_0x56fb1e,null));};exports['show']=function(_0x5ea95b,_0x5253f5){var _0x2efd55={'raw':![],'where':{'id':_0x5ea95b[_0xcbff('0x3c')]['id']}},_0x192e3e={};_0x192e3e['model']=_['keys'](db[_0xcbff('0x33')]['rawAttributes']);_0x192e3e[_0xcbff('0x3a')]=_[_0xcbff('0x3d')](_0x5ea95b[_0xcbff('0x3a')]);_0x192e3e[_0xcbff('0x3e')]=_[_0xcbff('0x3f')](_0x192e3e[_0xcbff('0x40')],_0x192e3e[_0xcbff('0x3a')]);_0x2efd55['attributes']=_[_0xcbff('0x3f')](_0x192e3e[_0xcbff('0x40')],qs['fields'](_0x5ea95b[_0xcbff('0x3a')][_0xcbff('0x41')]));_0x2efd55[_0xcbff('0x42')]=_0x2efd55[_0xcbff('0x42')][_0xcbff('0x43')]?_0x2efd55['attributes']:_0x192e3e[_0xcbff('0x40')];if(_0x5ea95b[_0xcbff('0x3a')][_0xcbff('0x44')]){_0x2efd55[_0xcbff('0x45')]=[{'all':!![]}];}_0x2efd55=_['merge']({},_0x2efd55,_0x5ea95b[_0xcbff('0x46')]);return db[_0xcbff('0x33')][_0xcbff('0x47')](_0x2efd55)[_0xcbff('0x14')](handleEntityNotFound(_0x5253f5,null))[_0xcbff('0x14')](respondWithResult(_0x5253f5,null))[_0xcbff('0x1e')](handleError(_0x5253f5,null));};exports[_0xcbff('0x48')]=function(_0x4617d9,_0x108788){return db[_0xcbff('0x33')][_0xcbff('0x48')](_0x4617d9['body'],{})[_0xcbff('0x14')](respondWithResult(_0x108788,0xc9))[_0xcbff('0x1e')](handleError(_0x108788,null));};exports[_0xcbff('0x27')]=function(_0x23ee6c,_0x5525bc){if(_0x23ee6c[_0xcbff('0x2d')]['id']){delete _0x23ee6c[_0xcbff('0x2d')]['id'];}return db[_0xcbff('0x33')]['find']({'where':{'id':_0x23ee6c[_0xcbff('0x3c')]['id']}})[_0xcbff('0x14')](handleEntityNotFound(_0x5525bc,null))[_0xcbff('0x14')](saveUpdates(_0x23ee6c[_0xcbff('0x2d')],null))[_0xcbff('0x14')](respondWithResult(_0x5525bc,null))[_0xcbff('0x1e')](handleError(_0x5525bc,null));};exports['destroy']=function(_0x1cae9f,_0x465596){return db[_0xcbff('0x33')]['find']({'where':{'id':_0x1cae9f[_0xcbff('0x3c')]['id']}})[_0xcbff('0x14')](handleEntityNotFound(_0x465596,null))[_0xcbff('0x14')](removeEntity(_0x465596,null))[_0xcbff('0x1e')](handleError(_0x465596,null));};exports[_0xcbff('0x49')]=function(_0x2fdac3,_0x2dc884){return db[_0xcbff('0x33')][_0xcbff('0x49')]()[_0xcbff('0x14')](respondWithResult(_0x2dc884,null))[_0xcbff('0x1e')](handleError(_0x2dc884,null));};exports['createVidaooSession']=function(_0x402383,_0x58a019){var _0x157131=_0x402383[_0xcbff('0x3c')]['id'];var _0x1d8544;var _0x4a9ee5;var _0x49f725;return db[_0xcbff('0x33')][_0xcbff('0x4a')]({'where':{'id':_0x157131}})['then'](function(_0x5cb9c3){_0x1d8544=_0x5cb9c3;return db[_0xcbff('0x4b')]['findOne']({'where':{'id':_0x5cb9c3[_0xcbff('0x4c')]},'attributes':['id',_0xcbff('0x4d'),_0xcbff('0x4e'),_0xcbff('0x4f'),_0xcbff('0x50'),_0xcbff('0x51')],'raw':!![]});})[_0xcbff('0x14')](function(_0x5481e1){if(_0x5481e1&&_0x5481e1[_0xcbff('0x4d')]&&_0x5481e1[_0xcbff('0x4e')]){_0x4a9ee5=_0x5481e1;var _0x9e6bf3={'interaction':{'id':_0x157131},'agent':{'id':_0x402383[_0xcbff('0x3b')]['id'],'name':_0x402383[_0xcbff('0x3b')][_0xcbff('0x2b')],'fullname':_0x402383[_0xcbff('0x3b')][_0xcbff('0x52')],'email':_0x402383[_0xcbff('0x3b')][_0xcbff('0x53')]},'contact':_0x402383[_0xcbff('0x2d')]['contact'],'account':_0x402383['body'][_0xcbff('0x31')]};var _0xfd3523={'rejectUnauthorized':![],'method':_0xcbff('0x54'),'url':_0xcbff('0x55'),'headers':{'X-APIKEY':_0x5481e1[_0xcbff('0x4d')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x402383['user']['email']],'buttons':null,'topic':_0x4a9ee5[_0xcbff('0x4f')],'note':_[_0xcbff('0x56')](_0x4a9ee5[_0xcbff('0x50')])?null:getMustacheRender(_0x4a9ee5[_0xcbff('0x50')],_0x9e6bf3),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0x4a9ee5['vidaooMetadata'])){var _0x3891dd=getMustacheRender(_0x4a9ee5[_0xcbff('0x51')],_0x9e6bf3);var _0x3fcf1c=JSON[_0xcbff('0x57')](_0x3891dd);_0xfd3523['body'][_0xcbff('0x58')]=_0x3fcf1c;}}catch(_0x4b754d){throw new db[(_0xcbff('0x59'))][(_0xcbff('0x5a'))](_0xcbff('0x5b'));}return rp(_0xfd3523);}else{throw new db[(_0xcbff('0x59'))][(_0xcbff('0x5a'))](_0xcbff('0x5c'));}})[_0xcbff('0x14')](function(_0x4eadef){_0x49f725=_0x4eadef;if(_0x49f725['id']){var _0x4eb7bc={'body':_0x49f725[_0xcbff('0x5d')],'ChatWebsiteId':_0x4a9ee5['id'],'ChatInteractionId':_0x1d8544['id'],'direction':_0xcbff('0x5e'),'UserId':_0x402383[_0xcbff('0x3b')]['id']};return db[_0xcbff('0x5f')][_0xcbff('0x48')](_0x4eb7bc,{});}else{throw new db[(_0xcbff('0x59'))][(_0xcbff('0x5a'))](_0xcbff('0x60'));}})[_0xcbff('0x14')](function(){return _0x1d8544[_0xcbff('0x61')]({'vidaooSessionId':_0x49f725['id']});})[_0xcbff('0x14')](respondWithResult(_0x58a019,null))[_0xcbff('0x1e')](handleError(_0x58a019,null));};exports[_0xcbff('0x62')]=function(_0x3423a2,_0x4426aa){if(_0x3423a2[_0xcbff('0x2d')]['id']){delete _0x3423a2[_0xcbff('0x2d')]['id'];}return db[_0xcbff('0x33')][_0xcbff('0x47')]({'where':{'id':_0x3423a2['params']['id']},'include':[{'model':db[_0xcbff('0x63')],'as':'Contact'}]})[_0xcbff('0x14')](handleEntityNotFound(_0x4426aa,null))[_0xcbff('0x14')](saveUpdates(_0x3423a2['body'],null))[_0xcbff('0x14')](respondWithResult(_0x4426aa,null))[_0xcbff('0x1e')](handleError(_0x4426aa,null));};exports['abandon']=function(_0xb3f226,_0x232731){if(_0xb3f226[_0xcbff('0x2d')]['id']){delete _0xb3f226[_0xcbff('0x2d')]['id'];}return db['ChatInteraction'][_0xcbff('0x47')]({'where':{'id':_0xb3f226['params']['id']}})['then'](function(_0x5440d4){if(!_0x5440d4){logger[_0xcbff('0x1a')]('abandonInteraction,\x20%s,\x20%s,\x20%s','abandon',0x194,_0xcbff('0x64'));_0x232731[_0xcbff('0x29')](0x194);}else{if(_0x5440d4['UserId']){throw new db[(_0xcbff('0x59'))][(_0xcbff('0x5a'))](_0xcbff('0x65'));}}return _0x5440d4;})['then'](function(_0x41d41b){if(_0x41d41b){return _0x41d41b[_0xcbff('0x27')]({'closed':_0xb3f226[_0xcbff('0x2d')][_0xcbff('0x66')],'disposition':_0xb3f226[_0xcbff('0x2d')][_0xcbff('0x67')]})['then'](function(_0x248e41){return _0x248e41;});}})[_0xcbff('0x14')](function(){return respondWithRpcPromise(_0xcbff('0x68'),_0xcbff('0x69'),_0xb3f226['body'],client9004);})[_0xcbff('0x14')](respondWithResult(_0x232731,null))[_0xcbff('0x1e')](handleError(_0x232731,null));};exports[_0xcbff('0x6a')]=function(_0xc0af63,_0x4e5c7d){_0xc0af63[_0xcbff('0x2d')]['name']=_0xc0af63['file'][_0xcbff('0x6b')];_0xc0af63[_0xcbff('0x2d')][_0xcbff('0x6c')]=_0xc0af63[_0xcbff('0x6d')][_0xcbff('0x6e')];_0xc0af63[_0xcbff('0x2d')][_0xcbff('0x36')]=_0xc0af63[_0xcbff('0x6d')][_0xcbff('0x6f')];return db[_0xcbff('0x70')][_0xcbff('0x48')](_0xc0af63['body'])[_0xcbff('0x14')](respondWithResult(_0x4e5c7d,0xc9))[_0xcbff('0x1e')](handleError(_0x4e5c7d,null));};exports[_0xcbff('0x71')]=function(_0x3041a1,_0x4475e2){return db[_0xcbff('0x33')][_0xcbff('0x4a')]({'where':{'id':_0x3041a1[_0xcbff('0x3c')]['id']},'raw':!![]})[_0xcbff('0x14')](handleEntityNotFound(_0x4475e2,null))[_0xcbff('0x14')](function(_0x171de1){if(_0x171de1){if(_0x171de1['closed']){return _0x4475e2[_0xcbff('0x20')](0x193)['json']({'status':0x193,'message':_0xcbff('0x72')});}return db[_0xcbff('0x70')][_0xcbff('0x4a')]({'where':{'id':_0x3041a1['query']['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x4475e2,null));}})[_0xcbff('0x14')](function(_0x45db9e){if(_0x45db9e){var _0x135a63=_0x45db9e['ChatOfflineMessageId']!==null;var _0x17f5a9=path[_0xcbff('0x73')](config['root'],'server/files/attachments/');if(_0x135a63){_0x17f5a9=path[_0xcbff('0x73')](_0x17f5a9,_0xcbff('0x74'));}var _0x42c414=path[_0xcbff('0x73')](_0x17f5a9,_0x45db9e[_0xcbff('0x6c')]);return _0x4475e2['download'](_0x42c414);}})[_0xcbff('0x1e')](handleError(_0x4475e2,null));};exports['close']=function(_0xaa9b40,_0x4f0bd6){var _0x15e63c=null;var _0x8da360=null;var _0x4a97d7=null;if(_0xaa9b40[_0xcbff('0x2d')]['id']){delete _0xaa9b40[_0xcbff('0x2d')]['id'];}if(_0xaa9b40[_0xcbff('0x2d')][_0xcbff('0x75')]){_0x4a97d7=path[_0xcbff('0x73')](config[_0xcbff('0x76')],'server/files/chat/upload/',util[_0xcbff('0x77')](_0xcbff('0x78'),Date[_0xcbff('0x79')]()));_0xaa9b40[_0xcbff('0x2d')]['pathTranscript']=_0x4a97d7;}return db[_0xcbff('0x33')][_0xcbff('0x47')]({'where':{'id':_0xaa9b40[_0xcbff('0x3c')]['id']},'include':[{'model':db[_0xcbff('0x5f')],'as':_0xcbff('0x7a'),'include':[{'model':db[_0xcbff('0x7b')],'as':'User'}]}]})[_0xcbff('0x14')](handleEntityNotFound(_0x4f0bd6,null))['then'](saveUpdates(_0xaa9b40[_0xcbff('0x2d')],null))[_0xcbff('0x14')](function(_0x2bd5cb){if(_0x2bd5cb){_0x15e63c=_0x2bd5cb;return db[_0xcbff('0x4b')]['find']({'where':{'id':_0x15e63c['ChatWebsiteId']}});}})['then'](function(_0x391782){if(_0x391782){_0x8da360=_0x391782;return db['CmContact']['find']({'where':{'id':_0x15e63c[_0xcbff('0x7c')]}});}})[_0xcbff('0x14')](function(_0x4f1585){if(_0x4f1585){if(_0x4a97d7){var _0x3db607=null;for(var _0xd5689e=0x1;_0xd5689e<_0x15e63c[_0xcbff('0x7a')][_0xcbff('0x43')];++_0xd5689e){_0x3db607=_0x15e63c[_0xcbff('0x7a')][_0xd5689e];var _0x31c386=_0x3db607[_0xcbff('0x7d')]?util['format']('%s%d',_0x8da360[_0xcbff('0x7e')],_0x3db607[_0xcbff('0x7d')]):_0xcbff('0x7f');var _0x1d0cda=_0xaa9b40[_0xcbff('0x2d')][_0xcbff('0x80')]||util[_0xcbff('0x77')]('%s%d','Visitor',_0x3db607[_0xcbff('0x7c')]);switch(_0x8da360[_0xcbff('0x81')]){case _0xcbff('0x82'):_0x31c386=_0x3db607['UserId']?util[_0xcbff('0x77')](_0xcbff('0x83'),_0x8da360['agentAlias'],_0x3db607['UserId']):_0xcbff('0x7f');break;case'agent_alias':_0x31c386=_0x3db607[_0xcbff('0x7d')]?_0x3db607['User'][_0xcbff('0x84')]||_0x3db607[_0xcbff('0x7b')]['fullname']:'System';break;case _0xcbff('0x85'):_0x31c386=_0x3db607[_0xcbff('0x7d')]?_0x3db607['User'][_0xcbff('0x52')]:_0xcbff('0x7f');break;default:_0x31c386=_0x3db607[_0xcbff('0x7d')]?util[_0xcbff('0x77')]('%s%d',_0x8da360['agentAlias'],_0x3db607[_0xcbff('0x7d')]):_0xcbff('0x7f');}var _0x1cee65=util[_0xcbff('0x77')](_0xcbff('0x86'),moment(_0x3db607[_0xcbff('0x87')])[_0xcbff('0x77')](_0xcbff('0x88')),_0x3db607['direction']==='in'?_0x1d0cda:_0x31c386,_0x3db607['body']);if(!_0x3db607[_0xcbff('0x89')]){fs[_0xcbff('0x8a')](_0x4a97d7,_0x1cee65);}}return db[_0xcbff('0x8b')][_0xcbff('0x4a')]({'where':{'service':!![]},'include':[{'model':db[_0xcbff('0x8c')],'as':_0xcbff('0x8d'),'raw':!![],'include':[{'model':db[_0xcbff('0x8e')],'as':_0xcbff('0x8e'),'raw':!![]}]}]});}}})[_0xcbff('0x14')](function(_0x49bebf){if(!_0x49bebf||!_0x49bebf[_0xcbff('0x8d')]||!_0xaa9b40[_0xcbff('0x2d')])return _0x15e63c;var _0x12cc2a=_0x49bebf[_0xcbff('0x8f')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x12cc2a,'message':{'from':util[_0xcbff('0x77')](_0xcbff('0x90'),_0x49bebf[_0xcbff('0x2b')],_0x49bebf[_0xcbff('0x53')]||_0x49bebf[_0xcbff('0x8d')]['user']),'to':_0xaa9b40[_0xcbff('0x2d')][_0xcbff('0x75')],'subject':_0xcbff('0x91'),'text':util['format'](_0xcbff('0x92'),_0xaa9b40['body'][_0xcbff('0x75')]),'attachments':[{'path':_0x4a97d7}]}})[_0xcbff('0x14')](function(){return _0x15e63c;})['catch'](function(_0x54c51d){logger[_0xcbff('0x1a')](_0x54c51d);});})[_0xcbff('0x14')](respondWithStatusCode(_0x4f0bd6,0xc8))[_0xcbff('0x1e')](handleError(_0x4f0bd6,null));};exports[_0xcbff('0x93')]=function(_0x387c27,_0x4d8d97){return db['ChatMessage']['find']({'where':{'id':_0x387c27['params']['id']}})[_0xcbff('0x14')](handleEntityNotFound(_0x4d8d97,null))[_0xcbff('0x14')](function(_0x181731){if(_0x181731){return _0x181731[_0xcbff('0x93')](_0x387c27[_0xcbff('0x2d')][_0xcbff('0x94')],_[_0xcbff('0x95')](_0x387c27[_0xcbff('0x2d')],['ids','id'])||{});}})[_0xcbff('0x14')](respondWithResult(_0x4d8d97,null))[_0xcbff('0x1e')](handleError(_0x4d8d97,null));};exports[_0xcbff('0x96')]=function(_0x12477f,_0x14510c){var _0xa50827={'raw':![],'where':{}};var _0x5cb681={};var _0xf6a720={'count':0x0,'rows':[]};return db[_0xcbff('0x33')][_0xcbff('0x4a')]({'where':{'id':_0x12477f[_0xcbff('0x3c')]['id']}})[_0xcbff('0x14')](handleEntityNotFound(_0x14510c,null))['then'](function(_0x473141){if(_0x473141){_0x5cb681['model']=_[_0xcbff('0x3d')](db[_0xcbff('0x5f')][_0xcbff('0x34')]);_0x5cb681[_0xcbff('0x3a')]=_['keys'](_0x12477f['query']);_0x5cb681[_0xcbff('0x3e')]=_[_0xcbff('0x3f')](_0x5cb681[_0xcbff('0x40')],_0x5cb681[_0xcbff('0x3a')]);_0xa50827['attributes']=_[_0xcbff('0x3f')](_0x5cb681['model'],qs[_0xcbff('0x41')](_0x12477f['query'][_0xcbff('0x41')]));_0xa50827['attributes']=_0xa50827[_0xcbff('0x42')][_0xcbff('0x43')]?_0xa50827[_0xcbff('0x42')]:_0x5cb681['model'];if(!_0x12477f[_0xcbff('0x3a')][_0xcbff('0x97')](_0xcbff('0x98'))){_0xa50827[_0xcbff('0x23')]=qs[_0xcbff('0x23')](_0x12477f[_0xcbff('0x3a')][_0xcbff('0x23')]);_0xa50827['offset']=qs[_0xcbff('0x25')](_0x12477f['query'][_0xcbff('0x25')]);}_0xa50827[_0xcbff('0x99')]=qs[_0xcbff('0x9a')](_0x12477f[_0xcbff('0x3a')]['sort']);_0xa50827[_0xcbff('0x9b')]=qs['filters'](_[_0xcbff('0x9c')](_0x12477f[_0xcbff('0x3a')],_0x5cb681[_0xcbff('0x3e')]));_0xa50827[_0xcbff('0x9b')][_0xcbff('0x9d')]=_0x473141['id'];if(_0x12477f['query']['filter']){_0xa50827[_0xcbff('0x9b')]=_['merge'](_0xa50827[_0xcbff('0x9b')],{'$or':_['map'](_0xa50827[_0xcbff('0x42')],function(_0xa79788){var _0x50ed81={};_0x50ed81[_0xa79788]={'$like':'%'+_0x12477f['query'][_0xcbff('0x9e')]+'%'};return _0x50ed81;})});}if(_0x12477f[_0xcbff('0x3a')][_0xcbff('0x9f')]){var _0x377de3=_0x12477f[_0xcbff('0x3a')][_0xcbff('0x9f')][_0xcbff('0xa0')](',');var _0x4d5605={};_0x4d5605[_0x377de3[0x0]]={'$gte':moment(_0x377de3[0x1])[_0xcbff('0x77')](_0xcbff('0xa1'))};_0xa50827['where']=_[_0xcbff('0xa2')](_0xa50827[_0xcbff('0x9b')],_0x4d5605);}_0xa50827=_[_0xcbff('0xa2')]({},_0xa50827,_0x12477f[_0xcbff('0x46')]);return db['ChatMessage'][_0xcbff('0x24')]({'where':_0xa50827[_0xcbff('0x9b')]})['then'](function(_0x38354d){_0xf6a720[_0xcbff('0x24')]=_0x38354d;if(_0x12477f[_0xcbff('0x3a')][_0xcbff('0x44')]){_0xa50827[_0xcbff('0x45')]=[{'all':!![]}];}return db[_0xcbff('0x5f')][_0xcbff('0x39')](_0xa50827);})['then'](function(_0x2aff8d){_0xf6a720['rows']=_0x2aff8d;return _0xf6a720;});}})[_0xcbff('0x14')](respondWithFilteredResult(_0x14510c,_0xa50827))[_0xcbff('0x1e')](handleError(_0x14510c,null));};exports[_0xcbff('0xa3')]=function(_0x4f4df9,_0x32ce93){var _0x545e72={'where':{}},_0x235b14={},_0x378381={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xcbff('0x4a')]({'where':{'id':_0x4f4df9[_0xcbff('0x3c')]['id']}})['then'](handleEntityNotFound(_0x32ce93,null))[_0xcbff('0x14')](function(_0x4d41de){if(_0x4d41de){_0x235b14[_0xcbff('0x40')]=_[_0xcbff('0x3d')](db[_0xcbff('0x5f')][_0xcbff('0x34')]);_0x235b14[_0xcbff('0x3a')]=_[_0xcbff('0x3d')](_0x4f4df9['query']);_0x235b14[_0xcbff('0x3e')]=_[_0xcbff('0x3f')](_0x235b14[_0xcbff('0x40')],_0x235b14[_0xcbff('0x3a')]);_0x545e72[_0xcbff('0x42')]=_[_0xcbff('0x3f')](_0x235b14[_0xcbff('0x40')],qs[_0xcbff('0x41')](_0x4f4df9[_0xcbff('0x3a')]['fields']));_0x545e72[_0xcbff('0x42')]=_0x545e72[_0xcbff('0x42')][_0xcbff('0x43')]?_0x545e72[_0xcbff('0x42')]:_0x235b14[_0xcbff('0x40')];if(!_0x4f4df9['query'][_0xcbff('0x97')]('nolimit')){_0x545e72[_0xcbff('0x23')]=qs[_0xcbff('0x23')](_0x4f4df9[_0xcbff('0x3a')][_0xcbff('0x23')]);_0x545e72['offset']=qs[_0xcbff('0x25')](_0x4f4df9[_0xcbff('0x3a')]['offset']);}_0x545e72['order']=qs[_0xcbff('0x9a')](_0x4f4df9['query']['sort']);_0x545e72[_0xcbff('0x9b')]=qs[_0xcbff('0x3e')](_[_0xcbff('0x9c')](_0x4f4df9[_0xcbff('0x3a')],_0x235b14['filters']));_0x545e72['where'][_0xcbff('0x9d')]=_0x4d41de['id'];if(_0x4f4df9[_0xcbff('0x3a')][_0xcbff('0x9e')]){_0x545e72[_0xcbff('0x9b')]=_[_0xcbff('0xa2')](_0x545e72[_0xcbff('0x9b')],{'$or':_['map'](_0x545e72[_0xcbff('0x42')],function(_0x37621a){var _0x5a5225={};_0x5a5225[_0x37621a]={'$like':'%'+_0x4f4df9[_0xcbff('0x3a')][_0xcbff('0x9e')]+'%'};return _0x5a5225;})});}_0x545e72[_0xcbff('0x9b')][_0xcbff('0x89')]=![];if(_0x4f4df9[_0xcbff('0x3a')]['id']){_0x545e72[_0xcbff('0x9b')]['id']={'$gt':_0x4f4df9['query']['id']};}_0x545e72=_['merge']({},_0x545e72,_0x4f4df9[_0xcbff('0x46')]);return db[_0xcbff('0x5f')][_0xcbff('0x24')]({'where':_0x545e72['where']})[_0xcbff('0x14')](function(_0x42fd5a){_0x378381[_0xcbff('0x24')]=_0x42fd5a;_0x545e72['include']=[];if(_0x4f4df9[_0xcbff('0x3a')]['includeAgent']){_0x545e72[_0xcbff('0x45')][_0xcbff('0xa4')]({'model':db[_0xcbff('0x7b')],'as':_0xcbff('0x7b'),'attributes':['id',_0xcbff('0x52'),'alias']});}if(_0x4f4df9[_0xcbff('0x3a')][_0xcbff('0x44')]){_0x545e72[_0xcbff('0x45')]=[{'all':!![]}];}return db[_0xcbff('0x5f')][_0xcbff('0x39')](_0x545e72);})['then'](function(_0x3565c2){_0x378381[_0xcbff('0xa5')]=_0x3565c2;return _0x378381;});}})[_0xcbff('0x14')](respondWithFilteredResult(_0x32ce93,_0x545e72))[_0xcbff('0x1e')](handleError(_0x32ce93,null));};exports[_0xcbff('0xa6')]=function(_0x3f65b5,_0x59d450){return db['ChatInteraction']['find']({'where':{'id':_0x3f65b5[_0xcbff('0x3c')]['id']}})['then'](handleEntityNotFound(_0x59d450,null))[_0xcbff('0x14')](function(_0x266053){if(_0x266053){return _0x266053[_0xcbff('0xa7')](_0x3f65b5[_0xcbff('0x2d')][_0xcbff('0x94')],_[_0xcbff('0x95')](_0x3f65b5[_0xcbff('0x2d')],[_0xcbff('0x94'),'id'])||{})[_0xcbff('0xa8')](function(){return db[_0xcbff('0xa9')][_0xcbff('0x39')]({'attributes':['id',_0xcbff('0x2b'),_0xcbff('0xaa')],'where':{'id':_0x3f65b5[_0xcbff('0x2d')][_0xcbff('0x94')]}});})['then'](function(_0x4d522a){socket['emit'](_0xcbff('0xab'),{'id':Number(_0x3f65b5[_0xcbff('0x3c')]['id']),'tags':_0x4d522a||[]});return{'id':Number(_0x3f65b5[_0xcbff('0x3c')]['id']),'tags':_0x4d522a||[]};});}})[_0xcbff('0x14')](respondWithResult(_0x59d450,null))['catch'](handleError(_0x59d450,null));};exports[_0xcbff('0xac')]=function(_0xbf5a2a,_0x4100e3){return db[_0xcbff('0x33')][_0xcbff('0x47')]({'where':{'id':_0xbf5a2a[_0xcbff('0x3c')]['id']}})[_0xcbff('0x14')](handleEntityNotFound(_0x4100e3,null))[_0xcbff('0x14')](function(_0x1d19b1){if(_0x1d19b1){return _0x1d19b1[_0xcbff('0xac')](_0xbf5a2a[_0xcbff('0x3a')][_0xcbff('0x94')]);}})[_0xcbff('0x14')](respondWithStatusCode(_0x4100e3,null))[_0xcbff('0x1e')](handleError(_0x4100e3,null));};exports[_0xcbff('0xad')]=function(_0x500d43,_0x273583){var _0x338bcc=moment()[_0xcbff('0xae')]()[_0xcbff('0xaf')]();var _0xf2cc33=path[_0xcbff('0x73')](config[_0xcbff('0x76')],_0xcbff('0xb0'),_0xcbff('0xb1'),_0xcbff('0xb2'));var _0x53f1c0=path['join'](config[_0xcbff('0x76')],'server',_0xcbff('0xb1'),_0xcbff('0xb3'));var _0x4e4809=path[_0xcbff('0x73')](_0xf2cc33,_0x338bcc);var _0x45b3f1=util[_0xcbff('0x77')](_0xcbff('0xb4'),_0x500d43['params']['id'],_0x338bcc);var _0x43e2a0=path[_0xcbff('0x73')](_0xf2cc33,_0x45b3f1);var _0x30c365=[];_0x30c365['push']({'model':db['User'],'as':_0xcbff('0x7b'),'attributes':['id',_0xcbff('0x52')],'raw':!![]});_0x30c365['push']({'model':db[_0xcbff('0x63')],'as':'Contact','attributes':['id',_0xcbff('0xb5'),_0xcbff('0xb6')],'raw':!![]});if(_0x500d43[_0xcbff('0x3a')][_0xcbff('0xb3')]){_0x30c365[_0xcbff('0xa4')]({'model':db[_0xcbff('0x70')],'as':_0xcbff('0x70'),'raw':!![]});}var _0x4c0cf2=[{'model':db['ChatMessage'],'as':'Messages','attributes':['id',_0xcbff('0x2d'),_0xcbff('0x87'),_0xcbff('0xb7'),_0xcbff('0x89'),_0xcbff('0xb8')],'include':_0x30c365}];_0x4c0cf2[_0xcbff('0xa4')]({'model':db['ChatWebsite'],'as':_0xcbff('0xb9'),'attributes':['id',_0xcbff('0x2b')]});_0x4c0cf2[_0xcbff('0xa4')]({'model':db[_0xcbff('0x7b')],'as':_0xcbff('0xba'),'attributes':['id','fullname']});return db['ChatInteraction'][_0xcbff('0x47')]({'where':{'id':_0x500d43[_0xcbff('0x3c')]['id']},'include':_0x4c0cf2})[_0xcbff('0x14')](handleEntityNotFound(_0x273583,null))[_0xcbff('0x14')](function(_0x59d441){if(_0x59d441){var _0xfa0235=_0x59d441['get']({'plain':!![]});fs[_0xcbff('0xbb')](_0x4e4809);var _0x188bc1={'channel':'Chat','account':_0xfa0235[_0xcbff('0xb9')][_0xcbff('0x2b')],'agent':_0xfa0235[_0xcbff('0xba')]?_0xfa0235[_0xcbff('0xba')][_0xcbff('0x52')]:_0xcbff('0xbc'),'createdAt':moment(_0xfa0235[_0xcbff('0x87')])[_0xcbff('0x77')](_0xcbff('0xa1'))['toString'](),'closedAt':_0xfa0235[_0xcbff('0x66')]?moment(_0xfa0235['closedAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0xfa0235[_0xcbff('0x67')],'chatInfo':{'browser':_0xfa0235['browserName'],'os':_0xfa0235[_0xcbff('0xbd')],'referer':_0xfa0235[_0xcbff('0xbe')],'customerIp':_0xfa0235[_0xcbff('0xbf')],'customerPort':_0xfa0235['customerPort']?_0xfa0235[_0xcbff('0xc0')]:_0xcbff('0xbc')},'messages':_(_0xfa0235[_0xcbff('0x7a')])[_0xcbff('0xc1')]()[_0xcbff('0x9e')]({'secret':![]})[_0xcbff('0x32')](function(_0x3f2b08){if(_0x3f2b08[_0xcbff('0x70')]){var _0x346abe=path['join'](_0x53f1c0,_0x3f2b08[_0xcbff('0x70')][_0xcbff('0x6c')]);if(fs[_0xcbff('0xc2')](_0x346abe)){fs[_0xcbff('0xc3')](_0x346abe)[_0xcbff('0xc4')](fs[_0xcbff('0xc5')](path[_0xcbff('0x73')](_0x4e4809,_0x3f2b08[_0xcbff('0x70')][_0xcbff('0x6c')])));}}return{'date':moment(_0x3f2b08[_0xcbff('0x87')])[_0xcbff('0x77')]('YYYY-MM-DD\x20HH:mm:ss')[_0xcbff('0xaf')](),'sender':_0x3f2b08[_0xcbff('0xb7')]===_0xcbff('0x5e')?_0x3f2b08[_0xcbff('0x7b')]?_0x3f2b08[_0xcbff('0x7b')][_0xcbff('0x52')]:_0xcbff('0x7f'):_0x3f2b08['Contact'][_0xcbff('0xb5')]+(_0x3f2b08['Contact'][_0xcbff('0xb6')]?'\x20'+_0x3f2b08['Contact']['lastName']:''),'body':_0x3f2b08[_0xcbff('0x70')]?_0x3f2b08[_0xcbff('0x70')][_0xcbff('0x6c')]:_0x3f2b08[_0xcbff('0x2d')],'direction':_0x3f2b08[_0xcbff('0xb7')]===_0xcbff('0x5e')?'A':'C','secret':_0x3f2b08[_0xcbff('0x89')],'read':_0x3f2b08[_0xcbff('0xb8')],'attachment':_0x3f2b08[_0xcbff('0x70')]};})[_0xcbff('0xc6')]()};return ejs[_0xcbff('0xc7')](path[_0xcbff('0x73')](config[_0xcbff('0x76')],_0xcbff('0xb0'),_0xcbff('0xc8'),'downloadInteraction.ejs'),{'interaction':_0x188bc1})['then'](function(_0xd4a280){var _0x46ecce=path[_0xcbff('0x73')](_0x4e4809,_0xcbff('0xc9')+_0xfa0235['id']+'-'+_0x338bcc+_0xcbff('0xca'));var _0x326965={'path':_0x46ecce,'channel':_0xcbff('0xcb'),'interactionId':_0xfa0235['id']};return pdf[_0xcbff('0xcc')](_0xd4a280,_0x326965);})['then'](function(){return new Promise(function(_0x5db8b6,_0x38d836){zipdir(_0x4e4809,{'saveTo':_0x43e2a0},function(_0x5f46c3,_0x2a0905){if(_0x5f46c3)return _0x38d836(_0x5f46c3);return _0x5db8b6(_0x2a0905);});})[_0xcbff('0x14')](function(){return new BPromise(function(_0x482659,_0x4b6419){rimraf(_0x4e4809,function(_0x237f26){if(_0x237f26)_0x4b6419(_0x237f26);return _0x482659();});});})['then'](function(){return _0x273583[_0xcbff('0xad')](_0x43e2a0,_0x45b3f1,function(_0x42fc51){if(_0x42fc51){logger[_0xcbff('0x1a')]('err',_0x42fc51);}else{fs['unlinkSync'](_0x43e2a0);}});});});}else{return _0x273583[_0xcbff('0x29')](0xc8);}})['catch'](handleError(_0x273583,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 6bedbbc..47028f8 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 _0xda30=['ChatMessage','setMaxListeners','save','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','ChatInteraction','../../mysqldb'];(function(_0x19715d,_0x1a2ce5){var _0x57f928=function(_0x283273){while(--_0x283273){_0x19715d['push'](_0x19715d['shift']());}};_0x57f928(++_0x1a2ce5);}(_0xda30,0x7b));var _0x0da3=function(_0x2bc3f4,_0x470b26){_0x2bc3f4=_0x2bc3f4-0x0;var _0x14ac53=_0xda30[_0x2bc3f4];return _0x14ac53;};'use strict';var EventEmitter=require(_0x0da3('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x0da3('0x1')];var ChatMessage=require(_0x0da3('0x2'))['db'][_0x0da3('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x0da3('0x4')](0x0);var events={'afterCreate':_0x0da3('0x5'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5b13e6){return function(_0x2fce2a,_0x5155b3,_0x1cd9f7){_0x2fce2a[_0x0da3('0x6')]({'attributes':['id'],'raw':!![]})[_0x0da3('0x7')](function(_0x3fd312){_0x2fce2a[_0x0da3('0x8')](_0x0da3('0x9'),_0x3fd312[_0x0da3('0xa')](function(_0x22c35b){return{'id':_0x22c35b['id']};}));return ChatMessage[_0x0da3('0xb')]({'where':{'ChatInteractionId':_0x2fce2a['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0da3('0x7')](function(_0x35902d){_0x2fce2a[_0x0da3('0x8')](_0x0da3('0xc'),_0x35902d[_0x0da3('0xd')]);ChatInteractionEvents[_0x0da3('0xe')](_0x5b13e6+':'+_0x2fce2a['id'],_0x2fce2a);ChatInteractionEvents[_0x0da3('0xe')](_0x5b13e6,_0x2fce2a);_0x1cd9f7(null);})[_0x0da3('0xf')](_0x1cd9f7(null));};}for(var e in events){if(events[_0x0da3('0x10')](e)){var event=events[e];ChatInteraction[_0x0da3('0x11')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file +var _0xb6c0=['setMaxListeners','save','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','hasOwnProperty','hook','../../mysqldb','ChatMessage'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xb6c0,0x139));var _0x0b6c=function(_0x116b1a,_0x224d8d){_0x116b1a=_0x116b1a-0x0;var _0x426eb7=_0xb6c0[_0x116b1a];return _0x426eb7;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x0b6c('0x0'))['db']['ChatInteraction'];var ChatMessage=require(_0x0b6c('0x0'))['db'][_0x0b6c('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x0b6c('0x2')](0x0);var events={'afterCreate':_0x0b6c('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x549346){return function(_0x3b5ee6,_0x2adf89,_0x3ff995){_0x3b5ee6[_0x0b6c('0x4')]({'attributes':['id'],'raw':!![]})[_0x0b6c('0x5')](function(_0x23b5a1){_0x3b5ee6[_0x0b6c('0x6')](_0x0b6c('0x7'),_0x23b5a1[_0x0b6c('0x8')](function(_0x2737e4){return{'id':_0x2737e4['id']};}));return ChatMessage[_0x0b6c('0x9')]({'where':{'ChatInteractionId':_0x3b5ee6['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x471b96){_0x3b5ee6[_0x0b6c('0x6')](_0x0b6c('0xa'),_0x471b96[_0x0b6c('0xb')]);ChatInteractionEvents[_0x0b6c('0xc')](_0x549346+':'+_0x3b5ee6['id'],_0x3b5ee6);ChatInteractionEvents[_0x0b6c('0xc')](_0x549346,_0x3b5ee6);_0x3ff995(null);})['catch'](_0x3ff995(null));};}for(var e in events){if(events[_0x0b6c('0xd')](e)){var event=events[e];ChatInteraction[_0x0b6c('0xe')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index d07c4f9..003b7b9 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 _0x6772=['util','../../config/logger','api','bluebird','./chatInteraction.attributes','exports','chat_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x6772,0x11d));var _0x2677=function(_0x400b16,_0x48bdd7){_0x400b16=_0x400b16-0x0;var _0x573b3c=_0x6772[_0x400b16];return _0x573b3c;};'use strict';var _=require(_0x2677('0x0'));var util=require(_0x2677('0x1'));var logger=require(_0x2677('0x2'))(_0x2677('0x3'));var moment=require('moment');var BPromise=require(_0x2677('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(_0x2677('0x5'));module[_0x2677('0x6')]=function(_0x37b22d,_0xc88da2){return _0x37b22d['define']('ChatInteraction',attributes,{'tableName':_0x2677('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5407b3,_0x5b48ce,_0x56ecf){if(_0x5407b3[_0x2677('0x8')](_0x2677('0x9'))){_0x5407b3['closedAt']=moment()[_0x2677('0xa')](_0x2677('0xb'));}_0x56ecf(null,_0x5407b3);}},'charset':_0x2677('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x8587=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x8587,0x12f));var _0x7858=function(_0x31f2dc,_0x4b13bd){_0x31f2dc=_0x31f2dc-0x0;var _0x2359b2=_0x8587[_0x31f2dc];return _0x2359b2;};'use strict';var _=require(_0x7858('0x0'));var util=require(_0x7858('0x1'));var logger=require(_0x7858('0x2'))(_0x7858('0x3'));var moment=require(_0x7858('0x4'));var BPromise=require(_0x7858('0x5'));var rp=require(_0x7858('0x6'));var fs=require('fs');var path=require(_0x7858('0x7'));var rimraf=require(_0x7858('0x8'));var config=require(_0x7858('0x9'));var attributes=require('./chatInteraction.attributes');module[_0x7858('0xa')]=function(_0x4d2fbf,_0x4ae348){return _0x4d2fbf[_0x7858('0xb')]('ChatInteraction',attributes,{'tableName':_0x7858('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4b48c2,_0x27410e,_0x31072d){if(_0x4b48c2[_0x7858('0xd')](_0x7858('0xe'))){_0x4b48c2[_0x7858('0xf')]=moment()[_0x7858('0x10')](_0x7858('0x11'));}_0x31072d(null,_0x4b48c2);}},'charset':'utf8mb4','collate':_0x7858('0x12')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index f6a7532..ddd3347 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 _0xcae3=['find','omit','ids','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','limit','then','catch','AddTagsToChatInteraction'];(function(_0x408d22,_0x53eef9){var _0x58effd=function(_0x4ab8ee){while(--_0x4ab8ee){_0x408d22['push'](_0x408d22['shift']());}};_0x58effd(++_0x53eef9);}(_0xcae3,0x10d));var _0x3cae=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xcae3[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x3cae('0x0'));var util=require(_0x3cae('0x1'));var moment=require(_0x3cae('0x2'));var BPromise=require('bluebird');var rs=require(_0x3cae('0x3'));var fs=require('fs');var Redis=require(_0x3cae('0x4'));var db=require(_0x3cae('0x5'))['db'];var utils=require(_0x3cae('0x6'));var logger=require(_0x3cae('0x7'))(_0x3cae('0x8'));var config=require(_0x3cae('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3cae('0xa')][_0x3cae('0xb')]({'port':0x232a});config[_0x3cae('0xc')]=_['defaults'](config[_0x3cae('0xc')],{'host':_0x3cae('0xd'),'port':0x18eb});var socket=require(_0x3cae('0xe'))(new Redis(config[_0x3cae('0xc')]));require(_0x3cae('0xf'))[_0x3cae('0x10')](socket);function respondWithRpcPromise(_0x1fd734,_0x3419d4,_0x24c77b){return new BPromise(function(_0x5e8aeb,_0x172074){return client['request'](_0x1fd734,_0x24c77b)['then'](function(_0x15a26b){logger[_0x3cae('0x11')](_0x3cae('0x12'),_0x3419d4,_0x3cae('0x13'));logger[_0x3cae('0x14')](_0x3cae('0x15'),_0x3419d4,_0x3cae('0x13'),JSON[_0x3cae('0x16')](_0x15a26b));if(_0x15a26b['error']){if(_0x15a26b[_0x3cae('0x17')][_0x3cae('0x18')]===0x1f4){logger[_0x3cae('0x17')](_0x3cae('0x12'),_0x3419d4,_0x15a26b[_0x3cae('0x17')][_0x3cae('0x19')]);return _0x172074(_0x15a26b[_0x3cae('0x17')][_0x3cae('0x19')]);}logger['error'](_0x3cae('0x12'),_0x3419d4,_0x15a26b[_0x3cae('0x17')][_0x3cae('0x19')]);return _0x5e8aeb(_0x15a26b[_0x3cae('0x17')][_0x3cae('0x19')]);}else{logger[_0x3cae('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x3419d4,_0x3cae('0x13'));_0x5e8aeb(_0x15a26b[_0x3cae('0x1a')][_0x3cae('0x19')]);}})['catch'](function(_0x38b855){logger[_0x3cae('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x3419d4,_0x38b855);_0x172074(_0x38b855);});});}exports[_0x3cae('0x1b')]=function(_0x4a4143){var _0x5d2ade=this;return new Promise(function(_0xf7752a,_0x454b1f){return db[_0x3cae('0x1c')][_0x3cae('0x1d')](_0x4a4143[_0x3cae('0x1e')],{'raw':_0x4a4143[_0x3cae('0x1f')]?_0x4a4143[_0x3cae('0x1f')][_0x3cae('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a4143[_0x3cae('0x1f')]?_0x4a4143['options'][_0x3cae('0x21')]||null:null,'attributes':_0x4a4143['options']?_0x4a4143[_0x3cae('0x1f')][_0x3cae('0x22')]||null:null,'limit':_0x4a4143[_0x3cae('0x1f')]?_0x4a4143[_0x3cae('0x1f')][_0x3cae('0x23')]||null:null})[_0x3cae('0x24')](function(_0x2dc6f9){logger[_0x3cae('0x11')]('UpdateChatInteraction',_0x4a4143);logger[_0x3cae('0x14')](_0x3cae('0x1b'),_0x4a4143,JSON[_0x3cae('0x16')](_0x2dc6f9));_0xf7752a(_0x2dc6f9);})[_0x3cae('0x25')](function(_0x1bcd7f){logger['error'](_0x3cae('0x1b'),_0x1bcd7f[_0x3cae('0x19')],_0x4a4143);_0x454b1f(_0x5d2ade[_0x3cae('0x17')](0x1f4,_0x1bcd7f[_0x3cae('0x19')]));});});};exports[_0x3cae('0x26')]=function(_0x1e6ed3){return new Promise(function(_0x1d2da6,_0x6dfeb6){return db['ChatInteraction'][_0x3cae('0x27')]({'where':_0x1e6ed3[_0x3cae('0x1f')]?_0x1e6ed3[_0x3cae('0x1f')]['where']||null:null})[_0x3cae('0x24')](function(_0x37b766){if(_0x37b766){return _0x37b766['addTags'](_0x1e6ed3[_0x3cae('0x1e')]['ids'],_[_0x3cae('0x28')](_0x1e6ed3['body'],[_0x3cae('0x29'),'id'])||{});}})[_0x3cae('0x2a')](function(_0x131825){logger['info'](_0x3cae('0x2b'),_0x1e6ed3);logger['debug'](_0x3cae('0x2b'),_0x1e6ed3,JSON[_0x3cae('0x16')](_0x131825));_0x1d2da6(_0x131825);})[_0x3cae('0x25')](function(_0x3d4fba){logger[_0x3cae('0x17')](_0x3cae('0x2b'),_0x3d4fba[_0x3cae('0x19')],_0x1e6ed3);_0x6dfeb6(_this['error'](0x1f4,_0x3d4fba[_0x3cae('0x19')]));});});}; \ No newline at end of file +var _0x9799=['where','addTags','omit','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateChatInteraction','ChatInteraction','body','options','raw','attributes','limit','AddTagsToChatInteraction','find'];(function(_0x98d0d,_0x3b80af){var _0x4f382f=function(_0x599a96){while(--_0x599a96){_0x98d0d['push'](_0x98d0d['shift']());}};_0x4f382f(++_0x3b80af);}(_0x9799,0xad));var _0x9979=function(_0x19e0a8,_0x5a01a1){_0x19e0a8=_0x19e0a8-0x0;var _0xb909de=_0x9799[_0x19e0a8];return _0xb909de;};'use strict';var _=require(_0x9979('0x0'));var util=require(_0x9979('0x1'));var moment=require('moment');var BPromise=require(_0x9979('0x2'));var rs=require(_0x9979('0x3'));var fs=require('fs');var Redis=require(_0x9979('0x4'));var db=require(_0x9979('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9979('0x6'))(_0x9979('0x7'));var config=require(_0x9979('0x8'));var jayson=require(_0x9979('0x9'));var client=jayson[_0x9979('0xa')][_0x9979('0xb')]({'port':0x232a});config[_0x9979('0xc')]=_['defaults'](config[_0x9979('0xc')],{'host':_0x9979('0xd'),'port':0x18eb});var socket=require(_0x9979('0xe'))(new Redis(config[_0x9979('0xc')]));require(_0x9979('0xf'))[_0x9979('0x10')](socket);function respondWithRpcPromise(_0x18b638,_0x220d31,_0x4ed791){return new BPromise(function(_0x21bdca,_0x406746){return client[_0x9979('0x11')](_0x18b638,_0x4ed791)[_0x9979('0x12')](function(_0x5bfd7b){logger[_0x9979('0x13')](_0x9979('0x14'),_0x220d31,_0x9979('0x15'));logger[_0x9979('0x16')](_0x9979('0x17'),_0x220d31,_0x9979('0x15'),JSON[_0x9979('0x18')](_0x5bfd7b));if(_0x5bfd7b[_0x9979('0x19')]){if(_0x5bfd7b[_0x9979('0x19')]['code']===0x1f4){logger[_0x9979('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x220d31,_0x5bfd7b[_0x9979('0x19')][_0x9979('0x1a')]);return _0x406746(_0x5bfd7b[_0x9979('0x19')]['message']);}logger[_0x9979('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x220d31,_0x5bfd7b[_0x9979('0x19')][_0x9979('0x1a')]);return _0x21bdca(_0x5bfd7b[_0x9979('0x19')][_0x9979('0x1a')]);}else{logger[_0x9979('0x13')](_0x9979('0x14'),_0x220d31,_0x9979('0x15'));_0x21bdca(_0x5bfd7b['result'][_0x9979('0x1a')]);}})[_0x9979('0x1b')](function(_0x3cba0b){logger[_0x9979('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x220d31,_0x3cba0b);_0x406746(_0x3cba0b);});});}exports[_0x9979('0x1c')]=function(_0x200a3f){var _0x9a8948=this;return new Promise(function(_0x44afc9,_0x3ea334){return db[_0x9979('0x1d')]['update'](_0x200a3f[_0x9979('0x1e')],{'raw':_0x200a3f[_0x9979('0x1f')]?_0x200a3f['options'][_0x9979('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x200a3f['options']?_0x200a3f[_0x9979('0x1f')]['where']||null:null,'attributes':_0x200a3f['options']?_0x200a3f[_0x9979('0x1f')][_0x9979('0x21')]||null:null,'limit':_0x200a3f[_0x9979('0x1f')]?_0x200a3f[_0x9979('0x1f')][_0x9979('0x22')]||null:null})[_0x9979('0x12')](function(_0x528ccc){logger[_0x9979('0x13')]('UpdateChatInteraction',_0x200a3f);logger['debug'](_0x9979('0x1c'),_0x200a3f,JSON[_0x9979('0x18')](_0x528ccc));_0x44afc9(_0x528ccc);})[_0x9979('0x1b')](function(_0x308c6b){logger[_0x9979('0x19')](_0x9979('0x1c'),_0x308c6b['message'],_0x200a3f);_0x3ea334(_0x9a8948[_0x9979('0x19')](0x1f4,_0x308c6b[_0x9979('0x1a')]));});});};exports[_0x9979('0x23')]=function(_0x549d48){return new Promise(function(_0x469f2f,_0x32baf9){return db['ChatInteraction'][_0x9979('0x24')]({'where':_0x549d48[_0x9979('0x1f')]?_0x549d48[_0x9979('0x1f')][_0x9979('0x25')]||null:null})[_0x9979('0x12')](function(_0x3bef78){if(_0x3bef78){return _0x3bef78[_0x9979('0x26')](_0x549d48[_0x9979('0x1e')]['ids'],_[_0x9979('0x27')](_0x549d48[_0x9979('0x1e')],['ids','id'])||{});}})[_0x9979('0x28')](function(_0x380e56){logger[_0x9979('0x13')](_0x9979('0x29'),_0x549d48);logger['debug'](_0x9979('0x29'),_0x549d48,JSON[_0x9979('0x18')](_0x380e56));_0x469f2f(_0x380e56);})['catch'](function(_0x5863be){logger[_0x9979('0x19')]('AddTags',_0x5863be['message'],_0x549d48);_0x32baf9(_this[_0x9979('0x19')](0x1f4,_0x5863be[_0x9979('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index b84f0d4..0feba9d 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 _0x24c5=['update','emit','removeListener','register','length','save','remove'];(function(_0x413812,_0x2ad176){var _0x51cb42=function(_0x37ce06){while(--_0x37ce06){_0x413812['push'](_0x413812['shift']());}};_0x51cb42(++_0x2ad176);}(_0x24c5,0x163));var _0x524c=function(_0x231926,_0x45a45e){_0x231926=_0x231926-0x0;var _0x45aaad=_0x24c5[_0x231926];return _0x45aaad;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x524c('0x0'),_0x524c('0x1'),_0x524c('0x2')];function createListener(_0x5c2cf3,_0x31927f){return function(_0x100e5f){_0x31927f[_0x524c('0x3')](_0x5c2cf3,_0x100e5f);};}function removeListener(_0x752702,_0x475c98){return function(){ChatInteractionEvents[_0x524c('0x4')](_0x752702,_0x475c98);};}exports[_0x524c('0x5')]=function(_0x19245d){for(var _0x452778=0x0,_0x1be1ed=events[_0x524c('0x6')];_0x452778<_0x1be1ed;_0x452778++){var _0x5e7e54=events[_0x452778];var _0x114d0b=createListener('chatInteraction:'+_0x5e7e54,_0x19245d);ChatInteractionEvents['on'](_0x5e7e54,_0x114d0b);}}; \ No newline at end of file +var _0xe9b4=['removeListener','length','chatInteraction:','./chatInteraction.events','remove','update','emit'];(function(_0x4f3551,_0x361e66){var _0x4e4979=function(_0x45af3b){while(--_0x45af3b){_0x4f3551['push'](_0x4f3551['shift']());}};_0x4e4979(++_0x361e66);}(_0xe9b4,0x153));var _0x4e9b=function(_0x1ffd29,_0x27ef55){_0x1ffd29=_0x1ffd29-0x0;var _0x249780=_0xe9b4[_0x1ffd29];return _0x249780;};'use strict';var ChatInteractionEvents=require(_0x4e9b('0x0'));var events=['save',_0x4e9b('0x1'),_0x4e9b('0x2')];function createListener(_0x3b6ea7,_0x3cae7b){return function(_0x267703){_0x3cae7b[_0x4e9b('0x3')](_0x3b6ea7,_0x267703);};}function removeListener(_0x30838a,_0x349c32){return function(){ChatInteractionEvents[_0x4e9b('0x4')](_0x30838a,_0x349c32);};}exports['register']=function(_0x1abe7e){for(var _0x114c7e=0x0,_0x3c1a59=events[_0x4e9b('0x5')];_0x114c7e<_0x3c1a59;_0x114c7e++){var _0x3158b6=events[_0x114c7e];var _0x5a76e1=createListener(_0x4e9b('0x6')+_0x3158b6,_0x1abe7e);ChatInteractionEvents['on'](_0x3158b6,_0x5a76e1);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 98cc1e3..44e0915 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 _0xe956=['/:id/attachment_download','attachmentDownload','/:id/my_messages','getMyMessages','download','/:id/vidaoo','createVidaooSession','diskStorage','join','format','%s-%s','now','replace','post','/:id/attachment_upload','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','put','chatinteraction:update','update','customUpdate','/:id/abandon','abandon','/:id/close','delete','chatinteraction:destroy','removeTags','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','isChatInteractionAuthorized','show'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe956,0x84));var _0x6e95=function(_0x34fed3,_0x371036){_0x34fed3=_0x34fed3-0x0;var _0x3f415d=_0xe956[_0x34fed3];return _0x3f415d;};'use strict';var multer=require(_0x6e95('0x0'));var util=require(_0x6e95('0x1'));var path=require(_0x6e95('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e95('0x3'));var router=express[_0x6e95('0x4')]();var fs_extra=require(_0x6e95('0x5'));var auth=require(_0x6e95('0x6'));var interaction=require(_0x6e95('0x7'));var config=require(_0x6e95('0x8'));var controller=require(_0x6e95('0x9'));router['get']('/',auth[_0x6e95('0xa')](),controller[_0x6e95('0xb')]);router[_0x6e95('0xc')](_0x6e95('0xd'),auth[_0x6e95('0xa')](),controller[_0x6e95('0xe')]);router[_0x6e95('0xc')](_0x6e95('0xf'),auth[_0x6e95('0x10')](),controller[_0x6e95('0x11')]);router['get'](_0x6e95('0x12'),auth[_0x6e95('0x10')](),controller[_0x6e95('0x13')]);router[_0x6e95('0xc')]('/:id/messages',auth[_0x6e95('0xa')](),controller['getMessages']);router['get'](_0x6e95('0x14'),auth[_0x6e95('0x10')](),controller[_0x6e95('0x15')]);router[_0x6e95('0xc')]('/:id/download',auth['isAuthenticated'](),controller[_0x6e95('0x16')]);router['post']('/',auth[_0x6e95('0xa')](),controller['create']);router['post'](_0x6e95('0x17'),auth[_0x6e95('0xa')](),controller[_0x6e95('0x18')]);var upload=multer({'storage':multer[_0x6e95('0x19')]({'destination':function(_0x57af33,_0x242952,_0x47f69a){_0x47f69a(null,path[_0x6e95('0x1a')](config['root'],'server/files/attachments/'));},'filename':function(_0x47d8a1,_0x22e6a6,_0x55ed9a){_0x55ed9a(null,util[_0x6e95('0x1b')](_0x6e95('0x1c'),Date[_0x6e95('0x1d')](),_0x22e6a6['originalname'][_0x6e95('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x6e95('0x1f')](_0x6e95('0x20'),upload['single'](_0x6e95('0x21')),controller[_0x6e95('0x22')]);router[_0x6e95('0x1f')]('/:id/messages',auth[_0x6e95('0x10')](),controller[_0x6e95('0x23')]);router[_0x6e95('0x1f')](_0x6e95('0x24'),auth['isAuthenticated'](),interaction[_0x6e95('0x25')](_0x6e95('0x26'),'chatinteraction:addtags'),controller['addTags']);router[_0x6e95('0x27')](_0x6e95('0xf'),auth[_0x6e95('0xa')](),interaction['tracked'](_0x6e95('0x26'),_0x6e95('0x28')),controller[_0x6e95('0x29')]);router[_0x6e95('0x27')]('/:id/custom_update',controller[_0x6e95('0x2a')]);router[_0x6e95('0x27')](_0x6e95('0x2b'),auth[_0x6e95('0x10')](),controller[_0x6e95('0x2c')]);router[_0x6e95('0x27')](_0x6e95('0x2d'),controller['close']);router[_0x6e95('0x2e')](_0x6e95('0xf'),auth[_0x6e95('0xa')](),interaction['tracked'](_0x6e95('0x26'),_0x6e95('0x2f')),controller['destroy']);router[_0x6e95('0x2e')](_0x6e95('0x24'),auth[_0x6e95('0xa')](),controller[_0x6e95('0x30')]);module[_0x6e95('0x31')]=router; \ No newline at end of file +var _0x7ee5=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','download','post','create','createVidaooSession','root','server/files/attachments/','format','now','originalname','/:id/attachment_upload','single','file','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','/:id/custom_update','customUpdate','abandon','/:id/close','close','delete','destroy','removeTags','multer','util'];(function(_0xeafd0c,_0x368ca7){var _0x5676ef=function(_0x5563cf){while(--_0x5563cf){_0xeafd0c['push'](_0xeafd0c['shift']());}};_0x5676ef(++_0x368ca7);}(_0x7ee5,0x16a));var _0x57ee=function(_0x4527d8,_0x59e349){_0x4527d8=_0x4527d8-0x0;var _0x1ec91d=_0x7ee5[_0x4527d8];return _0x1ec91d;};'use strict';var multer=require(_0x57ee('0x0'));var util=require(_0x57ee('0x1'));var path=require(_0x57ee('0x2'));var timeout=require(_0x57ee('0x3'));var express=require(_0x57ee('0x4'));var router=express[_0x57ee('0x5')]();var fs_extra=require(_0x57ee('0x6'));var auth=require(_0x57ee('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x57ee('0x8'));var controller=require(_0x57ee('0x9'));router[_0x57ee('0xa')]('/',auth[_0x57ee('0xb')](),controller[_0x57ee('0xc')]);router[_0x57ee('0xa')](_0x57ee('0xd'),auth[_0x57ee('0xb')](),controller[_0x57ee('0xe')]);router['get'](_0x57ee('0xf'),auth[_0x57ee('0x10')](),controller[_0x57ee('0x11')]);router[_0x57ee('0xa')](_0x57ee('0x12'),auth[_0x57ee('0x10')](),controller[_0x57ee('0x13')]);router[_0x57ee('0xa')](_0x57ee('0x14'),auth[_0x57ee('0xb')](),controller[_0x57ee('0x15')]);router[_0x57ee('0xa')](_0x57ee('0x16'),auth[_0x57ee('0x10')](),controller['getMyMessages']);router['get'](_0x57ee('0x17'),auth['isAuthenticated'](),controller[_0x57ee('0x18')]);router[_0x57ee('0x19')]('/',auth[_0x57ee('0xb')](),controller[_0x57ee('0x1a')]);router['post']('/:id/vidaoo',auth[_0x57ee('0xb')](),controller[_0x57ee('0x1b')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a44b1,_0x1fce0e,_0x89c20a){_0x89c20a(null,path['join'](config[_0x57ee('0x1c')],_0x57ee('0x1d')));},'filename':function(_0xbd998d,_0x21da63,_0x3db774){_0x3db774(null,util[_0x57ee('0x1e')]('%s-%s',Date[_0x57ee('0x1f')](),_0x21da63[_0x57ee('0x20')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x57ee('0x21'),upload[_0x57ee('0x22')](_0x57ee('0x23')),controller['attachmentUpload']);router['post'](_0x57ee('0x14'),auth['isChatInteractionAuthorized'](),controller[_0x57ee('0x24')]);router['post'](_0x57ee('0x25'),auth[_0x57ee('0xb')](),interaction[_0x57ee('0x26')](_0x57ee('0x27'),_0x57ee('0x28')),controller[_0x57ee('0x29')]);router[_0x57ee('0x2a')](_0x57ee('0xf'),auth[_0x57ee('0xb')](),interaction[_0x57ee('0x26')](_0x57ee('0x27'),_0x57ee('0x2b')),controller['update']);router['put'](_0x57ee('0x2c'),controller[_0x57ee('0x2d')]);router[_0x57ee('0x2a')]('/:id/abandon',auth[_0x57ee('0x10')](),controller[_0x57ee('0x2e')]);router[_0x57ee('0x2a')](_0x57ee('0x2f'),controller[_0x57ee('0x30')]);router[_0x57ee('0x31')](_0x57ee('0xf'),auth['isAuthenticated'](),interaction['tracked'](_0x57ee('0x27'),'chatinteraction:destroy'),controller[_0x57ee('0x32')]);router[_0x57ee('0x31')](_0x57ee('0x25'),auth['isAuthenticated'](),controller[_0x57ee('0x33')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 8044681..45512bf 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 _0x747d=['exports','BOOLEAN','INTEGER'];(function(_0x20a0d6,_0x27c4c4){var _0x245ccf=function(_0x2ec5c9){while(--_0x2ec5c9){_0x20a0d6['push'](_0x20a0d6['shift']());}};_0x245ccf(++_0x27c4c4);}(_0x747d,0xab));var _0xd747=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x747d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xd747('0x0')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xd747('0x1')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xd747('0x2')]}}; \ No newline at end of file +var _0x9403=['exports','TEXT','medium','BOOLEAN','sequelize'];(function(_0x2108fa,_0x39dbc0){var _0x5e26b9=function(_0x1ed1a2){while(--_0x1ed1a2){_0x2108fa['push'](_0x2108fa['shift']());}};_0x5e26b9(++_0x39dbc0);}(_0x9403,0x13f));var _0x3940=function(_0x258e20,_0x493043){_0x258e20=_0x258e20-0x0;var _0x154da1=_0x9403[_0x258e20];return _0x154da1;};'use strict';var Sequelize=require(_0x3940('0x0'));module[_0x3940('0x1')]={'body':{'type':Sequelize[_0x3940('0x2')](_0x3940('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x3940('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index b44eeec..998dfed 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 _0x2a67=['bluebird','mustache','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/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','save','update','then','destroy','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','VIRTUAL','includeAll','include','findAll','catch','params','find','create','body','describe','get','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','agent','user','fullname','userpic','online','allowmessenger','showWebBar','-online','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','userProfileId','UserProfileResource','isEmpty','push','FromId','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2a67,0xd3));var _0x72a6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2a67[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x72a6('0x0'));var rimraf=require(_0x72a6('0x1'));var zipdir=require(_0x72a6('0x2'));var jsonpatch=require(_0x72a6('0x3'));var rp=require(_0x72a6('0x4'));var moment=require('moment');var BPromise=require(_0x72a6('0x5'));var Mustache=require(_0x72a6('0x6'));var util=require('util');var path=require('path');var sox=require(_0x72a6('0x7'));var csv=require(_0x72a6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x72a6('0x9'));var _=require(_0x72a6('0xa'));var squel=require(_0x72a6('0xb'));var crypto=require(_0x72a6('0xc'));var jsforce=require(_0x72a6('0xd'));var deskjs=require(_0x72a6('0xe'));var toCsv=require('to-csv');var querystring=require(_0x72a6('0xf'));var Papa=require(_0x72a6('0x10'));var Redis=require(_0x72a6('0x11'));var authService=require(_0x72a6('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x72a6('0x13'));var hardwareService=require(_0x72a6('0x14'));var logger=require(_0x72a6('0x15'))(_0x72a6('0x16'));var utils=require(_0x72a6('0x17'));var config=require(_0x72a6('0x18'));var licenseUtil=require(_0x72a6('0x19'));var db=require('../../mysqldb')['db'];config[_0x72a6('0x1a')]=_[_0x72a6('0x1b')](config[_0x72a6('0x1a')],{'host':_0x72a6('0x1c'),'port':0x18eb});var socket=require(_0x72a6('0x1d'))(new Redis(config['redis']));require(_0x72a6('0x1e'))[_0x72a6('0x1f')](socket);function respondWithStatusCode(_0x23bdec,_0x4f47ce){_0x4f47ce=_0x4f47ce||0xcc;return function(_0x3bb8c7){if(_0x3bb8c7){return _0x23bdec[_0x72a6('0x20')](_0x4f47ce);}return _0x23bdec[_0x72a6('0x21')](_0x4f47ce)[_0x72a6('0x22')]();};}function respondWithResult(_0x20a47a,_0x1f2be8){_0x1f2be8=_0x1f2be8||0xc8;return function(_0x527a8f){if(_0x527a8f){return _0x20a47a['status'](_0x1f2be8)['json'](_0x527a8f);}};}function respondWithFilteredResult(_0xb9261e,_0x444b07){return function(_0x5897e9){if(_0x5897e9){var _0x432de0=typeof _0x444b07['offset']===_0x72a6('0x23')&&typeof _0x444b07[_0x72a6('0x24')]===_0x72a6('0x23');var _0x4fed36=_0x5897e9[_0x72a6('0x25')];var _0x591f94=_0x432de0?0x0:_0x444b07[_0x72a6('0x26')];var _0x5768a7=_0x432de0?_0x5897e9[_0x72a6('0x25')]:_0x444b07['offset']+_0x444b07[_0x72a6('0x24')];var _0x391050;if(_0x5768a7>=_0x4fed36){_0x5768a7=_0x4fed36;_0x391050=0xc8;}else{_0x391050=0xce;}_0xb9261e[_0x72a6('0x21')](_0x391050);return _0xb9261e['set'](_0x72a6('0x27'),_0x591f94+'-'+_0x5768a7+'/'+_0x4fed36)[_0x72a6('0x28')](_0x5897e9);}return null;};}function patchUpdates(_0x3b0b41){return function(_0x5796f6){try{jsonpatch['apply'](_0x5796f6,_0x3b0b41,!![]);}catch(_0x5e5ff6){return BPromise['reject'](_0x5e5ff6);}return _0x5796f6[_0x72a6('0x29')]();};}function saveUpdates(_0x399a22,_0x4a0ccf){return function(_0x56685f){if(_0x56685f){return _0x56685f[_0x72a6('0x2a')](_0x399a22)[_0x72a6('0x2b')](function(_0x2e670d){return _0x2e670d;});}return null;};}function removeEntity(_0x195df9,_0x4db435){return function(_0x4b3f56){if(_0x4b3f56){return _0x4b3f56[_0x72a6('0x2c')]()[_0x72a6('0x2b')](function(){_0x195df9[_0x72a6('0x21')](0xcc)[_0x72a6('0x22')]();});}};}function handleEntityNotFound(_0x56a49b,_0x1b4bbd){return function(_0x2e72b2){if(!_0x2e72b2){_0x56a49b['sendStatus'](0x194);}return _0x2e72b2;};}function handleError(_0x34cd56,_0x15e777){_0x15e777=_0x15e777||0x1f4;return function(_0x2bff0f){logger[_0x72a6('0x2d')](_0x2bff0f[_0x72a6('0x2e')]);if(_0x2bff0f[_0x72a6('0x2f')]){delete _0x2bff0f[_0x72a6('0x2f')];}_0x34cd56[_0x72a6('0x21')](_0x15e777)[_0x72a6('0x30')](_0x2bff0f);};}exports[_0x72a6('0x31')]=function(_0x1ec89a,_0xf1019){var _0x575f26={},_0x339b2e={},_0xf6a6b8={'count':0x0,'rows':[]};var _0x36e4b5=_[_0x72a6('0x32')](db[_0x72a6('0x33')][_0x72a6('0x34')],function(_0x4748fb){return{'name':_0x4748fb[_0x72a6('0x35')],'type':_0x4748fb[_0x72a6('0x36')][_0x72a6('0x37')]};});_0x339b2e[_0x72a6('0x38')]=_[_0x72a6('0x32')](_0x36e4b5,_0x72a6('0x2f'));_0x339b2e[_0x72a6('0x39')]=_[_0x72a6('0x3a')](_0x1ec89a[_0x72a6('0x39')]);_0x339b2e[_0x72a6('0x3b')]=_[_0x72a6('0x3c')](_0x339b2e[_0x72a6('0x38')],_0x339b2e[_0x72a6('0x39')]);_0x575f26[_0x72a6('0x3d')]=_[_0x72a6('0x3c')](_0x339b2e[_0x72a6('0x38')],qs['fields'](_0x1ec89a[_0x72a6('0x39')][_0x72a6('0x3e')]));_0x575f26[_0x72a6('0x3d')]=_0x575f26[_0x72a6('0x3d')][_0x72a6('0x3f')]?_0x575f26['attributes']:_0x339b2e[_0x72a6('0x38')];if(!_0x1ec89a[_0x72a6('0x39')][_0x72a6('0x40')](_0x72a6('0x41'))){_0x575f26[_0x72a6('0x24')]=qs[_0x72a6('0x24')](_0x1ec89a[_0x72a6('0x39')][_0x72a6('0x24')]);_0x575f26[_0x72a6('0x26')]=qs[_0x72a6('0x26')](_0x1ec89a[_0x72a6('0x39')][_0x72a6('0x26')]);}_0x575f26['order']=qs[_0x72a6('0x42')](_0x1ec89a[_0x72a6('0x39')][_0x72a6('0x42')]);_0x575f26['where']=qs[_0x72a6('0x3b')](_['pick'](_0x1ec89a['query'],_0x339b2e[_0x72a6('0x3b')]),_0x36e4b5);if(_0x1ec89a[_0x72a6('0x39')][_0x72a6('0x43')]){_0x575f26[_0x72a6('0x44')]=_[_0x72a6('0x45')](_0x575f26[_0x72a6('0x44')],{'$or':_[_0x72a6('0x32')](_0x36e4b5,function(_0x10e801){if(_0x10e801[_0x72a6('0x36')]!==_0x72a6('0x46')){var _0x36e640={};_0x36e640[_0x10e801[_0x72a6('0x2f')]]={'$like':'%'+_0x1ec89a[_0x72a6('0x39')]['filter']+'%'};return _0x36e640;}})});}_0x575f26=_[_0x72a6('0x45')]({},_0x575f26,_0x1ec89a['options']);var _0x5abc12={'where':_0x575f26[_0x72a6('0x44')]};return db[_0x72a6('0x33')][_0x72a6('0x25')](_0x5abc12)[_0x72a6('0x2b')](function(_0x3a60e2){_0xf6a6b8[_0x72a6('0x25')]=_0x3a60e2;if(_0x1ec89a['query'][_0x72a6('0x47')]){_0x575f26[_0x72a6('0x48')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x72a6('0x49')](_0x575f26);})[_0x72a6('0x2b')](function(_0x3c1633){_0xf6a6b8['rows']=_0x3c1633;return _0xf6a6b8;})['then'](respondWithFilteredResult(_0xf1019,_0x575f26))[_0x72a6('0x4a')](handleError(_0xf1019,null));};exports['show']=function(_0x13001f,_0x2c85dd){var _0x220f9f={'raw':!![],'where':{'id':_0x13001f[_0x72a6('0x4b')]['id']}},_0x957288={};_0x957288[_0x72a6('0x38')]=_[_0x72a6('0x3a')](db[_0x72a6('0x33')]['rawAttributes']);_0x957288[_0x72a6('0x39')]=_[_0x72a6('0x3a')](_0x13001f['query']);_0x957288[_0x72a6('0x3b')]=_[_0x72a6('0x3c')](_0x957288['model'],_0x957288['query']);_0x220f9f[_0x72a6('0x3d')]=_[_0x72a6('0x3c')](_0x957288[_0x72a6('0x38')],qs[_0x72a6('0x3e')](_0x13001f[_0x72a6('0x39')][_0x72a6('0x3e')]));_0x220f9f[_0x72a6('0x3d')]=_0x220f9f[_0x72a6('0x3d')]['length']?_0x220f9f['attributes']:_0x957288[_0x72a6('0x38')];if(_0x13001f[_0x72a6('0x39')][_0x72a6('0x47')]){_0x220f9f[_0x72a6('0x48')]=[{'all':!![]}];}_0x220f9f=_[_0x72a6('0x45')]({},_0x220f9f,_0x13001f['options']);return db['ChatInternalMessage'][_0x72a6('0x4c')](_0x220f9f)[_0x72a6('0x2b')](handleEntityNotFound(_0x2c85dd,null))[_0x72a6('0x2b')](respondWithResult(_0x2c85dd,null))[_0x72a6('0x4a')](handleError(_0x2c85dd,null));};exports[_0x72a6('0x4d')]=function(_0x1a693e,_0x285ab7){return db[_0x72a6('0x33')]['create'](_0x1a693e[_0x72a6('0x4e')],{})[_0x72a6('0x2b')](respondWithResult(_0x285ab7,0xc9))[_0x72a6('0x4a')](handleError(_0x285ab7,null));};exports[_0x72a6('0x2a')]=function(_0x59f8e2,_0x499c80){if(_0x59f8e2[_0x72a6('0x4e')]['id']){delete _0x59f8e2[_0x72a6('0x4e')]['id'];}return db[_0x72a6('0x33')][_0x72a6('0x4c')]({'where':{'id':_0x59f8e2[_0x72a6('0x4b')]['id']}})[_0x72a6('0x2b')](handleEntityNotFound(_0x499c80,null))[_0x72a6('0x2b')](saveUpdates(_0x59f8e2[_0x72a6('0x4e')],null))[_0x72a6('0x2b')](respondWithResult(_0x499c80,null))[_0x72a6('0x4a')](handleError(_0x499c80,null));};exports[_0x72a6('0x2c')]=function(_0x1ff04f,_0x393397){return db[_0x72a6('0x33')][_0x72a6('0x4c')]({'where':{'id':_0x1ff04f[_0x72a6('0x4b')]['id']}})['then'](handleEntityNotFound(_0x393397,null))[_0x72a6('0x2b')](removeEntity(_0x393397,null))[_0x72a6('0x4a')](handleError(_0x393397,null));};exports[_0x72a6('0x4f')]=function(_0x39cc9c,_0x4f4241){return db[_0x72a6('0x33')]['describe']()[_0x72a6('0x2b')](respondWithResult(_0x4f4241,null))[_0x72a6('0x4a')](handleError(_0x4f4241,null));};function wrapUser(_0x27e86e){return function(_0x138f7a){var _0x4ab688=_0x27e86e[_0x72a6('0x50')]({'plain':!![]});_0x4ab688[_0x72a6('0x51')]=[];if(_0x138f7a){_0x4ab688[_0x72a6('0x52')]=_0x138f7a[_0x72a6('0x53')];_0x4ab688['lastMessage']=_0x138f7a;}else{_0x4ab688['lastMessageAt']=moment(0x0)[_0x72a6('0x54')](_0x72a6('0x55'));_0x4ab688[_0x72a6('0x56')]={};}return _0x4ab688;};}exports[_0x72a6('0x57')]=function(_0x5953b4,_0x554736,_0xababa){var _0x19e60f=[];return db['User'][_0x72a6('0x49')]({'where':{'role':[_0x72a6('0x58'),'admin',_0x72a6('0x59')]},'attributes':['id',_0x72a6('0x5a'),'name','role',_0x72a6('0x5b'),'internal',_0x72a6('0x5c'),'lastLoginAt',_0x72a6('0x5d'),_0x72a6('0x5e')],'order':qs['sort'](_0x72a6('0x5f')),'include':[{'model':db['VoiceQueue'],'as':_0x72a6('0x60'),'attributes':['id',_0x72a6('0x2f'),_0x72a6('0x36')],'through':{'attributes':[]}}]})[_0x72a6('0x2b')](function(_0x4ad748){if(_0x4ad748){var _0x251190=_0x5953b4['user'][_0x72a6('0x50')]({'plain':!![]});if(!_0x251190)throw new Error(_0x72a6('0x61'));if(_0x251190[_0x72a6('0x62')]===_0x72a6('0x59')){return db[_0x72a6('0x63')]['find']({'where':{'name':_0x72a6('0x64'),'userProfileId':_0x251190[_0x72a6('0x65')]},'raw':!![]})[_0x72a6('0x2b')](function(_0x48eb76){if(_0x48eb76){if(_0x48eb76['autoAssociation']===0x0){return db[_0x72a6('0x66')][_0x72a6('0x49')]({'where':{'sectionId':_0x48eb76['id']},'raw':!![]})[_0x72a6('0x2b')](function(_0x9357f7){var _0x5b3f53=[];if(_[_0x72a6('0x67')](_0x9357f7)){_0x5b3f53=_[_0x72a6('0x43')](_0x4ad748,function(_0xc3411f){if(_0xc3411f[_0x72a6('0x62')]!=='agent'){return _0xc3411f;}});return _0x5b3f53;}else{for(var _0x3090a7=0x0;_0x3090a7<_0x4ad748[_0x72a6('0x3f')];_0x3090a7++){var _0x55dd80=_0x4ad748[_0x3090a7];if(_0x55dd80[_0x72a6('0x62')]===_0x72a6('0x58')){var _0x4e63ac=_[_0x72a6('0x4c')](_0x9357f7,function(_0x3d0d0c){return _0x3d0d0c['resourceId']===_0x55dd80['id'];});if(_0x4e63ac)_0x5b3f53['push'](_0x55dd80);}else{_0x5b3f53[_0x72a6('0x68')](_0x55dd80);}}return _0x5b3f53;}});}else{return _0x4ad748;}}else{var _0x48c59c=_['filter'](_0x4ad748,function(_0x221c0c){if(_0x221c0c['role']!==_0x72a6('0x58')){return _0x221c0c;}});return _0x48c59c;}});}else{return _0x4ad748;}}})[_0x72a6('0x2b')](function(_0x38d188){var _0x15617d=[];if(_0x38d188){_0x19e60f=_0x38d188;for(var _0x1dfbb8=0x0;_0x1dfbb8<_0x38d188[_0x72a6('0x3f')];_0x1dfbb8+=0x1){_0x19e60f[_0x1dfbb8]['messages']=[];_0x15617d['push'](db[_0x72a6('0x33')][_0x72a6('0x4c')]({'where':{'FromId':[_0x5953b4[_0x72a6('0x59')]['id'],_0x38d188[_0x1dfbb8]['id']],'ToId':[_0x5953b4[_0x72a6('0x59')]['id'],_0x38d188[_0x1dfbb8]['id']],'ChatGroupId':null},'attributes':['id',_0x72a6('0x53'),_0x72a6('0x69'),'ToId','read',_0x72a6('0x4e')],'order':qs[_0x72a6('0x42')](_0x72a6('0x6a')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x38d188[_0x1dfbb8])));}return BPromise[_0x72a6('0x6b')](_0x15617d);}return[];})[_0x72a6('0x2b')](function(_0x5aa9c7){return{'rows':_0x5aa9c7,'count':_0x5aa9c7[_0x72a6('0x3f')]};})[_0x72a6('0x2b')](respondWithResult(_0x554736,null))[_0x72a6('0x4a')](handleError(_0x554736,null));}; \ No newline at end of file +var _0x5656=['save','destroy','then','error','name','send','map','ChatInternalMessage','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','merge','filter','options','includeAll','findAll','show','params','include','find','catch','create','update','body','describe','get','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','User','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','resourceId','push','messages','FromId','ToId','read','-createdAt','all','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x3bfde7,_0x5b197c){var _0x1f170f=function(_0x3d57b6){while(--_0x3d57b6){_0x3bfde7['push'](_0x3bfde7['shift']());}};_0x1f170f(++_0x5b197c);}(_0x5656,0x192));var _0x6565=function(_0x2934cc,_0x27e03f){_0x2934cc=_0x2934cc-0x0;var _0x409637=_0x5656[_0x2934cc];return _0x409637;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6565('0x0'));var jsonpatch=require(_0x6565('0x1'));var rp=require(_0x6565('0x2'));var moment=require(_0x6565('0x3'));var BPromise=require(_0x6565('0x4'));var Mustache=require(_0x6565('0x5'));var util=require(_0x6565('0x6'));var path=require(_0x6565('0x7'));var sox=require(_0x6565('0x8'));var csv=require('to-csv');var ejs=require(_0x6565('0x9'));var fs=require('fs');var fs_extra=require(_0x6565('0xa'));var _=require(_0x6565('0xb'));var squel=require(_0x6565('0xc'));var crypto=require(_0x6565('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6565('0xe'));var toCsv=require(_0x6565('0xf'));var querystring=require(_0x6565('0x10'));var Papa=require('papaparse');var Redis=require(_0x6565('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6565('0x12'));var logger=require('../../config/logger')(_0x6565('0x13'));var utils=require(_0x6565('0x14'));var config=require(_0x6565('0x15'));var licenseUtil=require(_0x6565('0x16'));var db=require(_0x6565('0x17'))['db'];config['redis']=_[_0x6565('0x18')](config[_0x6565('0x19')],{'host':_0x6565('0x1a'),'port':0x18eb});var socket=require(_0x6565('0x1b'))(new Redis(config['redis']));require(_0x6565('0x1c'))[_0x6565('0x1d')](socket);function respondWithStatusCode(_0x2264a8,_0x37cae5){_0x37cae5=_0x37cae5||0xcc;return function(_0x3ae163){if(_0x3ae163){return _0x2264a8[_0x6565('0x1e')](_0x37cae5);}return _0x2264a8[_0x6565('0x1f')](_0x37cae5)[_0x6565('0x20')]();};}function respondWithResult(_0x58fdd9,_0xd06f4a){_0xd06f4a=_0xd06f4a||0xc8;return function(_0x22799d){if(_0x22799d){return _0x58fdd9['status'](_0xd06f4a)[_0x6565('0x21')](_0x22799d);}};}function respondWithFilteredResult(_0x42fc59,_0x28647a){return function(_0x33d53c){if(_0x33d53c){var _0x342ef9=typeof _0x28647a[_0x6565('0x22')]===_0x6565('0x23')&&typeof _0x28647a[_0x6565('0x24')]==='undefined';var _0x4b842f=_0x33d53c[_0x6565('0x25')];var _0x2c47f6=_0x342ef9?0x0:_0x28647a[_0x6565('0x22')];var _0x3c4ab5=_0x342ef9?_0x33d53c[_0x6565('0x25')]:_0x28647a[_0x6565('0x22')]+_0x28647a[_0x6565('0x24')];var _0x592920;if(_0x3c4ab5>=_0x4b842f){_0x3c4ab5=_0x4b842f;_0x592920=0xc8;}else{_0x592920=0xce;}_0x42fc59[_0x6565('0x1f')](_0x592920);return _0x42fc59[_0x6565('0x26')](_0x6565('0x27'),_0x2c47f6+'-'+_0x3c4ab5+'/'+_0x4b842f)[_0x6565('0x21')](_0x33d53c);}return null;};}function patchUpdates(_0x185bd6){return function(_0x481529){try{jsonpatch[_0x6565('0x28')](_0x481529,_0x185bd6,!![]);}catch(_0x59ecca){return BPromise[_0x6565('0x29')](_0x59ecca);}return _0x481529[_0x6565('0x2a')]();};}function saveUpdates(_0x5e9f33,_0x525230){return function(_0x3cdb63){if(_0x3cdb63){return _0x3cdb63['update'](_0x5e9f33)['then'](function(_0x3b16b5){return _0x3b16b5;});}return null;};}function removeEntity(_0x5abfd3,_0x4b4094){return function(_0x22cd82){if(_0x22cd82){return _0x22cd82[_0x6565('0x2b')]()[_0x6565('0x2c')](function(){_0x5abfd3[_0x6565('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54f644,_0x2079c6){return function(_0x19d330){if(!_0x19d330){_0x54f644[_0x6565('0x1e')](0x194);}return _0x19d330;};}function handleError(_0x2371e1,_0x46dc22){_0x46dc22=_0x46dc22||0x1f4;return function(_0x4f04c0){logger[_0x6565('0x2d')](_0x4f04c0['stack']);if(_0x4f04c0[_0x6565('0x2e')]){delete _0x4f04c0[_0x6565('0x2e')];}_0x2371e1[_0x6565('0x1f')](_0x46dc22)[_0x6565('0x2f')](_0x4f04c0);};}exports['index']=function(_0x43491b,_0x55f1c9){var _0x222396={},_0x2660e7={},_0x33c81b={'count':0x0,'rows':[]};var _0x25a5ac=_[_0x6565('0x30')](db[_0x6565('0x31')]['rawAttributes'],function(_0x4e2131){return{'name':_0x4e2131[_0x6565('0x32')],'type':_0x4e2131[_0x6565('0x33')]['key']};});_0x2660e7[_0x6565('0x34')]=_[_0x6565('0x30')](_0x25a5ac,'name');_0x2660e7[_0x6565('0x35')]=_[_0x6565('0x36')](_0x43491b['query']);_0x2660e7[_0x6565('0x37')]=_[_0x6565('0x38')](_0x2660e7['model'],_0x2660e7['query']);_0x222396['attributes']=_[_0x6565('0x38')](_0x2660e7[_0x6565('0x34')],qs[_0x6565('0x39')](_0x43491b[_0x6565('0x35')]['fields']));_0x222396[_0x6565('0x3a')]=_0x222396['attributes'][_0x6565('0x3b')]?_0x222396[_0x6565('0x3a')]:_0x2660e7['model'];if(!_0x43491b[_0x6565('0x35')][_0x6565('0x3c')]('nolimit')){_0x222396[_0x6565('0x24')]=qs[_0x6565('0x24')](_0x43491b[_0x6565('0x35')][_0x6565('0x24')]);_0x222396[_0x6565('0x22')]=qs[_0x6565('0x22')](_0x43491b[_0x6565('0x35')][_0x6565('0x22')]);}_0x222396['order']=qs[_0x6565('0x3d')](_0x43491b['query'][_0x6565('0x3d')]);_0x222396[_0x6565('0x3e')]=qs['filters'](_[_0x6565('0x3f')](_0x43491b[_0x6565('0x35')],_0x2660e7['filters']),_0x25a5ac);if(_0x43491b[_0x6565('0x35')]['filter']){_0x222396[_0x6565('0x3e')]=_[_0x6565('0x40')](_0x222396[_0x6565('0x3e')],{'$or':_[_0x6565('0x30')](_0x25a5ac,function(_0x477ec2){if(_0x477ec2[_0x6565('0x33')]!=='VIRTUAL'){var _0xdca0f8={};_0xdca0f8[_0x477ec2['name']]={'$like':'%'+_0x43491b[_0x6565('0x35')][_0x6565('0x41')]+'%'};return _0xdca0f8;}})});}_0x222396=_[_0x6565('0x40')]({},_0x222396,_0x43491b[_0x6565('0x42')]);var _0xbacfac={'where':_0x222396['where']};return db[_0x6565('0x31')]['count'](_0xbacfac)[_0x6565('0x2c')](function(_0x1a5637){_0x33c81b[_0x6565('0x25')]=_0x1a5637;if(_0x43491b['query'][_0x6565('0x43')]){_0x222396['include']=[{'all':!![]}];}return db[_0x6565('0x31')][_0x6565('0x44')](_0x222396);})[_0x6565('0x2c')](function(_0x1a2d74){_0x33c81b['rows']=_0x1a2d74;return _0x33c81b;})[_0x6565('0x2c')](respondWithFilteredResult(_0x55f1c9,_0x222396))['catch'](handleError(_0x55f1c9,null));};exports[_0x6565('0x45')]=function(_0x325deb,_0x2bec42){var _0x2218c1={'raw':!![],'where':{'id':_0x325deb[_0x6565('0x46')]['id']}},_0x6d0f0f={};_0x6d0f0f[_0x6565('0x34')]=_[_0x6565('0x36')](db['ChatInternalMessage']['rawAttributes']);_0x6d0f0f[_0x6565('0x35')]=_[_0x6565('0x36')](_0x325deb[_0x6565('0x35')]);_0x6d0f0f[_0x6565('0x37')]=_[_0x6565('0x38')](_0x6d0f0f['model'],_0x6d0f0f[_0x6565('0x35')]);_0x2218c1[_0x6565('0x3a')]=_['intersection'](_0x6d0f0f[_0x6565('0x34')],qs['fields'](_0x325deb[_0x6565('0x35')][_0x6565('0x39')]));_0x2218c1[_0x6565('0x3a')]=_0x2218c1[_0x6565('0x3a')]['length']?_0x2218c1[_0x6565('0x3a')]:_0x6d0f0f[_0x6565('0x34')];if(_0x325deb['query']['includeAll']){_0x2218c1[_0x6565('0x47')]=[{'all':!![]}];}_0x2218c1=_[_0x6565('0x40')]({},_0x2218c1,_0x325deb[_0x6565('0x42')]);return db['ChatInternalMessage'][_0x6565('0x48')](_0x2218c1)[_0x6565('0x2c')](handleEntityNotFound(_0x2bec42,null))[_0x6565('0x2c')](respondWithResult(_0x2bec42,null))[_0x6565('0x49')](handleError(_0x2bec42,null));};exports['create']=function(_0x3a41e8,_0x319209){return db['ChatInternalMessage'][_0x6565('0x4a')](_0x3a41e8['body'],{})[_0x6565('0x2c')](respondWithResult(_0x319209,0xc9))[_0x6565('0x49')](handleError(_0x319209,null));};exports[_0x6565('0x4b')]=function(_0xda9553,_0x8b79dd){if(_0xda9553[_0x6565('0x4c')]['id']){delete _0xda9553['body']['id'];}return db[_0x6565('0x31')][_0x6565('0x48')]({'where':{'id':_0xda9553[_0x6565('0x46')]['id']}})[_0x6565('0x2c')](handleEntityNotFound(_0x8b79dd,null))[_0x6565('0x2c')](saveUpdates(_0xda9553[_0x6565('0x4c')],null))[_0x6565('0x2c')](respondWithResult(_0x8b79dd,null))['catch'](handleError(_0x8b79dd,null));};exports[_0x6565('0x2b')]=function(_0x529bea,_0x4af56c){return db[_0x6565('0x31')][_0x6565('0x48')]({'where':{'id':_0x529bea['params']['id']}})[_0x6565('0x2c')](handleEntityNotFound(_0x4af56c,null))['then'](removeEntity(_0x4af56c,null))[_0x6565('0x49')](handleError(_0x4af56c,null));};exports['describe']=function(_0x5e024b,_0x51b6fc){return db[_0x6565('0x31')][_0x6565('0x4d')]()['then'](respondWithResult(_0x51b6fc,null))['catch'](handleError(_0x51b6fc,null));};function wrapUser(_0xb4321b){return function(_0x416ae7){var _0x1fdaf7=_0xb4321b[_0x6565('0x4e')]({'plain':!![]});_0x1fdaf7['messages']=[];if(_0x416ae7){_0x1fdaf7[_0x6565('0x4f')]=_0x416ae7[_0x6565('0x50')];_0x1fdaf7[_0x6565('0x51')]=_0x416ae7;}else{_0x1fdaf7[_0x6565('0x4f')]=moment(0x0)[_0x6565('0x52')](_0x6565('0x53'));_0x1fdaf7[_0x6565('0x51')]={};}return _0x1fdaf7;};}exports['getUsers']=function(_0x4f8b9c,_0x80c5dc,_0x21656){var _0x46c040=[];return db[_0x6565('0x54')]['findAll']({'where':{'role':[_0x6565('0x55'),_0x6565('0x56'),_0x6565('0x57')]},'attributes':['id',_0x6565('0x58'),_0x6565('0x2e'),_0x6565('0x59'),_0x6565('0x5a'),_0x6565('0x5b'),_0x6565('0x5c'),_0x6565('0x5d'),_0x6565('0x5e'),_0x6565('0x5f')],'order':qs[_0x6565('0x3d')](_0x6565('0x60')),'include':[{'model':db[_0x6565('0x61')],'as':_0x6565('0x62'),'attributes':['id',_0x6565('0x2e'),_0x6565('0x33')],'through':{'attributes':[]}}]})[_0x6565('0x2c')](function(_0x3b692c){if(_0x3b692c){var _0x547cd8=_0x4f8b9c[_0x6565('0x57')][_0x6565('0x4e')]({'plain':!![]});if(!_0x547cd8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x547cd8['role']===_0x6565('0x57')){return db[_0x6565('0x63')][_0x6565('0x48')]({'where':{'name':'Agents','userProfileId':_0x547cd8[_0x6565('0x64')]},'raw':!![]})[_0x6565('0x2c')](function(_0x5e32a0){if(_0x5e32a0){if(_0x5e32a0[_0x6565('0x65')]===0x0){return db[_0x6565('0x66')][_0x6565('0x44')]({'where':{'sectionId':_0x5e32a0['id']},'raw':!![]})[_0x6565('0x2c')](function(_0x10e393){var _0x151df4=[];if(_['isEmpty'](_0x10e393)){_0x151df4=_[_0x6565('0x41')](_0x3b692c,function(_0xa8c4ab){if(_0xa8c4ab[_0x6565('0x59')]!==_0x6565('0x55')){return _0xa8c4ab;}});return _0x151df4;}else{for(var _0x3c5473=0x0;_0x3c5473<_0x3b692c[_0x6565('0x3b')];_0x3c5473++){var _0x1fd4cd=_0x3b692c[_0x3c5473];if(_0x1fd4cd[_0x6565('0x59')]===_0x6565('0x55')){var _0x425ea9=_['find'](_0x10e393,function(_0x58ba0b){return _0x58ba0b[_0x6565('0x67')]===_0x1fd4cd['id'];});if(_0x425ea9)_0x151df4[_0x6565('0x68')](_0x1fd4cd);}else{_0x151df4[_0x6565('0x68')](_0x1fd4cd);}}return _0x151df4;}});}else{return _0x3b692c;}}else{var _0x354873=_[_0x6565('0x41')](_0x3b692c,function(_0x2ce64f){if(_0x2ce64f[_0x6565('0x59')]!==_0x6565('0x55')){return _0x2ce64f;}});return _0x354873;}});}else{return _0x3b692c;}}})['then'](function(_0x151dd0){var _0x2d30d3=[];if(_0x151dd0){_0x46c040=_0x151dd0;for(var _0x391b2d=0x0;_0x391b2d<_0x151dd0[_0x6565('0x3b')];_0x391b2d+=0x1){_0x46c040[_0x391b2d][_0x6565('0x69')]=[];_0x2d30d3[_0x6565('0x68')](db[_0x6565('0x31')][_0x6565('0x48')]({'where':{'FromId':[_0x4f8b9c[_0x6565('0x57')]['id'],_0x151dd0[_0x391b2d]['id']],'ToId':[_0x4f8b9c['user']['id'],_0x151dd0[_0x391b2d]['id']],'ChatGroupId':null},'attributes':['id',_0x6565('0x50'),_0x6565('0x6a'),_0x6565('0x6b'),_0x6565('0x6c'),_0x6565('0x4c')],'order':qs['sort'](_0x6565('0x6d')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x151dd0[_0x391b2d])));}return BPromise[_0x6565('0x6e')](_0x2d30d3);}return[];})['then'](function(_0x3f73ef){return{'rows':_0x3f73ef,'count':_0x3f73ef[_0x6565('0x3b')]};})[_0x6565('0x2c')](respondWithResult(_0x80c5dc,null))[_0x6565('0x49')](handleError(_0x80c5dc,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index df4aa25..5765840 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 _0x5586=['events','../../mysqldb','ChatInternalMessage','save','remove','emit','hasOwnProperty','exports'];(function(_0xfbdbd1,_0x2dc9d9){var _0x3e55b7=function(_0x1c569b){while(--_0x1c569b){_0xfbdbd1['push'](_0xfbdbd1['shift']());}};_0x3e55b7(++_0x2dc9d9);}(_0x5586,0x1a0));var _0x6558=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x5586[_0x4a9fb1];return _0x348672;};'use strict';var EventEmitter=require(_0x6558('0x0'));var ChatInternalMessage=require(_0x6558('0x1'))['db'][_0x6558('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6558('0x3'),'afterUpdate':'update','afterDestroy':_0x6558('0x4')};function emitEvent(_0x1d9e76){return function(_0x638fbd,_0x4bd814,_0x3e8f66){ChatInternalMessageEvents['emit'](_0x1d9e76+':'+_0x638fbd['id'],_0x638fbd);ChatInternalMessageEvents[_0x6558('0x5')](_0x1d9e76,_0x638fbd);_0x3e8f66(null);};}for(var e in events){if(events[_0x6558('0x6')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x6558('0x7')]=ChatInternalMessageEvents; \ No newline at end of file +var _0xdcec=['ChatInternalMessage','setMaxListeners','save','update','remove','emit','hook','exports','../../mysqldb'];(function(_0x56fbb6,_0x570f05){var _0x4e9a77=function(_0x320be4){while(--_0x320be4){_0x56fbb6['push'](_0x56fbb6['shift']());}};_0x4e9a77(++_0x570f05);}(_0xdcec,0xf2));var _0xcdce=function(_0x1bbc08,_0x444008){_0x1bbc08=_0x1bbc08-0x0;var _0x5d825b=_0xdcec[_0x1bbc08];return _0x5d825b;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xcdce('0x0'))['db'][_0xcdce('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xcdce('0x2')](0x0);var events={'afterCreate':_0xcdce('0x3'),'afterUpdate':_0xcdce('0x4'),'afterDestroy':_0xcdce('0x5')};function emitEvent(_0x4af314){return function(_0x499581,_0x340032,_0x13d0e0){ChatInternalMessageEvents[_0xcdce('0x6')](_0x4af314+':'+_0x499581['id'],_0x499581);ChatInternalMessageEvents['emit'](_0x4af314,_0x499581);_0x13d0e0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0xcdce('0x7')](e,emitEvent(event));}}module[_0xcdce('0x8')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index b14842a..52a2a70 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 _0xab92=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xab92,0x173));var _0x2ab9=function(_0x39b9ce,_0x1f44a5){_0x39b9ce=_0x39b9ce-0x0;var _0x5acf25=_0xab92[_0x39b9ce];return _0x5acf25;};'use strict';var _=require(_0x2ab9('0x0'));var util=require('util');var logger=require(_0x2ab9('0x1'))('api');var moment=require(_0x2ab9('0x2'));var BPromise=require(_0x2ab9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2ab9('0x4'));var rimraf=require(_0x2ab9('0x5'));var config=require(_0x2ab9('0x6'));var attributes=require(_0x2ab9('0x7'));module[_0x2ab9('0x8')]=function(_0x3b823c,_0x3ee596){return _0x3b823c[_0x2ab9('0x9')](_0x2ab9('0xa'),attributes,{'tableName':_0x2ab9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xc68f=['chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','path','../../config/environment','./chatInternalMessage.attributes','define'];(function(_0x5ee367,_0x5aff0b){var _0x145dde=function(_0x1a23d0){while(--_0x1a23d0){_0x5ee367['push'](_0x5ee367['shift']());}};_0x145dde(++_0x5aff0b);}(_0xc68f,0x179));var _0xfc68=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xc68f[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var util=require(_0xfc68('0x0'));var logger=require(_0xfc68('0x1'))(_0xfc68('0x2'));var moment=require('moment');var BPromise=require(_0xfc68('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfc68('0x4'));var rimraf=require('rimraf');var config=require(_0xfc68('0x5'));var attributes=require(_0xfc68('0x6'));module['exports']=function(_0x1eef5d,_0x23c03a){return _0x1eef5d[_0xfc68('0x7')]('ChatInternalMessage',attributes,{'tableName':_0xfc68('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfc68('0x9'),'collate':_0xfc68('0xa')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 1db0038..821f7de 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 _0xe64a=['../../mysqldb','../../config/utils','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','request\x20sent','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0xec7ad8,_0x230597){var _0x3f4211=function(_0x59391e){while(--_0x59391e){_0xec7ad8['push'](_0xec7ad8['shift']());}};_0x3f4211(++_0x230597);}(_0xe64a,0x1e0));var _0xae64=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe64a[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xae64('0x0'));var util=require(_0xae64('0x1'));var moment=require(_0xae64('0x2'));var BPromise=require(_0xae64('0x3'));var rs=require(_0xae64('0x4'));var fs=require('fs');var Redis=require(_0xae64('0x5'));var db=require(_0xae64('0x6'))['db'];var utils=require(_0xae64('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xae64('0x8')][_0xae64('0x9')]({'port':0x232a});config[_0xae64('0xa')]=_[_0xae64('0xb')](config[_0xae64('0xa')],{'host':_0xae64('0xc'),'port':0x18eb});var socket=require(_0xae64('0xd'))(new Redis(config[_0xae64('0xa')]));require(_0xae64('0xe'))[_0xae64('0xf')](socket);function respondWithRpcPromise(_0xba5ad8,_0x55dbe1,_0x17142d){return new BPromise(function(_0x497501,_0x58a16d){return client[_0xae64('0x10')](_0xba5ad8,_0x17142d)[_0xae64('0x11')](function(_0x32c521){logger[_0xae64('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x55dbe1,_0xae64('0x13'));logger['debug']('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x55dbe1,_0xae64('0x13'),JSON[_0xae64('0x14')](_0x32c521));if(_0x32c521[_0xae64('0x15')]){if(_0x32c521['error'][_0xae64('0x16')]===0x1f4){logger[_0xae64('0x15')](_0xae64('0x17'),_0x55dbe1,_0x32c521[_0xae64('0x15')][_0xae64('0x18')]);return _0x58a16d(_0x32c521['error'][_0xae64('0x18')]);}logger[_0xae64('0x15')](_0xae64('0x17'),_0x55dbe1,_0x32c521[_0xae64('0x15')][_0xae64('0x18')]);return _0x497501(_0x32c521['error'][_0xae64('0x18')]);}else{logger[_0xae64('0x12')](_0xae64('0x17'),_0x55dbe1,_0xae64('0x13'));_0x497501(_0x32c521[_0xae64('0x19')][_0xae64('0x18')]);}})[_0xae64('0x1a')](function(_0x1d4e1d){logger['error'](_0xae64('0x17'),_0x55dbe1,_0x1d4e1d);_0x58a16d(_0x1d4e1d);});});} \ No newline at end of file +var _0x0590=['socket.io-emitter','request','then','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','ChatInternalMessage,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','redis','defaults','localhost'];(function(_0x1f334e,_0x405c94){var _0x57ec46=function(_0x3aaf8a){while(--_0x3aaf8a){_0x1f334e['push'](_0x1f334e['shift']());}};_0x57ec46(++_0x405c94);}(_0x0590,0x1d3));var _0x0059=function(_0x68ac14,_0x1186f0){_0x68ac14=_0x68ac14-0x0;var _0x6700df=_0x0590[_0x68ac14];return _0x6700df;};'use strict';var _=require(_0x0059('0x0'));var util=require(_0x0059('0x1'));var moment=require('moment');var BPromise=require(_0x0059('0x2'));var rs=require(_0x0059('0x3'));var fs=require('fs');var Redis=require(_0x0059('0x4'));var db=require(_0x0059('0x5'))['db'];var utils=require(_0x0059('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x0059('0x7'));var jayson=require(_0x0059('0x8'));var client=jayson[_0x0059('0x9')]['http']({'port':0x232a});config[_0x0059('0xa')]=_[_0x0059('0xb')](config[_0x0059('0xa')],{'host':_0x0059('0xc'),'port':0x18eb});var socket=require(_0x0059('0xd'))(new Redis(config[_0x0059('0xa')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x1193d1,_0x422a29,_0x5d87bc){return new BPromise(function(_0x8e2d5,_0x35c80a){return client[_0x0059('0xe')](_0x1193d1,_0x5d87bc)[_0x0059('0xf')](function(_0x6f1f58){logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x422a29,_0x0059('0x10'));logger['debug'](_0x0059('0x11'),_0x422a29,_0x0059('0x10'),JSON[_0x0059('0x12')](_0x6f1f58));if(_0x6f1f58['error']){if(_0x6f1f58['error'][_0x0059('0x13')]===0x1f4){logger[_0x0059('0x14')](_0x0059('0x15'),_0x422a29,_0x6f1f58['error'][_0x0059('0x16')]);return _0x35c80a(_0x6f1f58[_0x0059('0x14')][_0x0059('0x16')]);}logger[_0x0059('0x14')](_0x0059('0x15'),_0x422a29,_0x6f1f58[_0x0059('0x14')][_0x0059('0x16')]);return _0x8e2d5(_0x6f1f58[_0x0059('0x14')][_0x0059('0x16')]);}else{logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x422a29,_0x0059('0x10'));_0x8e2d5(_0x6f1f58[_0x0059('0x17')]['message']);}})['catch'](function(_0x139fe3){logger[_0x0059('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x422a29,_0x139fe3);_0x35c80a(_0x139fe3);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index c3ffd30..3ba5d5a 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 _0xb1a1=['emit','removeListener','register','length','./chatInternalMessage.events','save','remove','update'];(function(_0x106420,_0x1baf1f){var _0x13f978=function(_0x24abd4){while(--_0x24abd4){_0x106420['push'](_0x106420['shift']());}};_0x13f978(++_0x1baf1f);}(_0xb1a1,0x1ac));var _0x1b1a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb1a1[_0x3dd15e];return _0x231fd0;};'use strict';var ChatInternalMessageEvents=require(_0x1b1a('0x0'));var events=[_0x1b1a('0x1'),_0x1b1a('0x2'),_0x1b1a('0x3')];function createListener(_0x5ed59e,_0x1d5eb2){return function(_0x16acfd){_0x1d5eb2[_0x1b1a('0x4')](_0x5ed59e,_0x16acfd);};}function removeListener(_0x18d8ce,_0x1b80e8){return function(){ChatInternalMessageEvents[_0x1b1a('0x5')](_0x18d8ce,_0x1b80e8);};}exports[_0x1b1a('0x6')]=function(_0x265a54){for(var _0x23b7ab=0x0,_0x26e417=events[_0x1b1a('0x7')];_0x23b7ab<_0x26e417;_0x23b7ab++){var _0xebe9fa=events[_0x23b7ab];var _0x3214f4=createListener('chatInternalMessage:'+_0xebe9fa,_0x265a54);ChatInternalMessageEvents['on'](_0xebe9fa,_0x3214f4);}}; \ No newline at end of file +var _0x5d65=['remove','update','emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save'];(function(_0x1e2993,_0x3ba58d){var _0x2faab4=function(_0x416233){while(--_0x416233){_0x1e2993['push'](_0x1e2993['shift']());}};_0x2faab4(++_0x3ba58d);}(_0x5d65,0x1d2));var _0x55d6=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0x5d65[_0xdc37a1];return _0x99b4fe;};'use strict';var ChatInternalMessageEvents=require(_0x55d6('0x0'));var events=[_0x55d6('0x1'),_0x55d6('0x2'),_0x55d6('0x3')];function createListener(_0x2ad00b,_0x15f9b3){return function(_0x391776){_0x15f9b3[_0x55d6('0x4')](_0x2ad00b,_0x391776);};}function removeListener(_0x3de187,_0xaa8555){return function(){ChatInternalMessageEvents[_0x55d6('0x5')](_0x3de187,_0xaa8555);};}exports[_0x55d6('0x6')]=function(_0xcb2699){for(var _0x29e411=0x0,_0x4aa430=events[_0x55d6('0x7')];_0x29e411<_0x4aa430;_0x29e411++){var _0x42abd8=events[_0x29e411];var _0x54593d=createListener(_0x55d6('0x8')+_0x42abd8,_0xcb2699);ChatInternalMessageEvents['on'](_0x42abd8,_0x54593d);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index f9c2a25..22255b0 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 _0x76b5=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','/users','/:id','post','create','put','delete','destroy','exports','multer','util','express','Router'];(function(_0x5cfdf2,_0x40cb00){var _0x24cc1e=function(_0x3d9095){while(--_0x3d9095){_0x5cfdf2['push'](_0x5cfdf2['shift']());}};_0x24cc1e(++_0x40cb00);}(_0x76b5,0x114));var _0x576b=function(_0x3ca829,_0xc55f17){_0x3ca829=_0x3ca829-0x0;var _0x3b416b=_0x76b5[_0x3ca829];return _0x3b416b;};'use strict';var multer=require(_0x576b('0x0'));var util=require(_0x576b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x576b('0x2'));var router=express[_0x576b('0x3')]();var fs_extra=require(_0x576b('0x4'));var auth=require(_0x576b('0x5'));var interaction=require(_0x576b('0x6'));var config=require(_0x576b('0x7'));var controller=require('./chatInternalMessage.controller');router[_0x576b('0x8')]('/',auth['isAuthenticated'](),controller[_0x576b('0x9')]);router[_0x576b('0x8')](_0x576b('0xa'),auth[_0x576b('0xb')](),controller['describe']);router[_0x576b('0x8')](_0x576b('0xc'),auth[_0x576b('0xb')](),controller['getUsers']);router['get'](_0x576b('0xd'),auth[_0x576b('0xb')](),controller['show']);router[_0x576b('0xe')]('/',auth[_0x576b('0xb')](),controller[_0x576b('0xf')]);router[_0x576b('0x10')](_0x576b('0xd'),controller['update']);router[_0x576b('0x11')](_0x576b('0xd'),auth[_0x576b('0xb')](),controller[_0x576b('0x12')]);module[_0x576b('0x13')]=router; \ No newline at end of file +var _0xc73b=['put','update','delete','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','/:id','post','create'];(function(_0x140711,_0x459b56){var _0x1229ce=function(_0xbc4172){while(--_0xbc4172){_0x140711['push'](_0x140711['shift']());}};_0x1229ce(++_0x459b56);}(_0xc73b,0x16c));var _0xbc73=function(_0x33a435,_0x39d5d3){_0x33a435=_0x33a435-0x0;var _0x4da327=_0xc73b[_0x33a435];return _0x4da327;};'use strict';var multer=require(_0xbc73('0x0'));var util=require(_0xbc73('0x1'));var path=require(_0xbc73('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbc73('0x3')]();var fs_extra=require(_0xbc73('0x4'));var auth=require(_0xbc73('0x5'));var interaction=require(_0xbc73('0x6'));var config=require(_0xbc73('0x7'));var controller=require(_0xbc73('0x8'));router[_0xbc73('0x9')]('/',auth[_0xbc73('0xa')](),controller[_0xbc73('0xb')]);router[_0xbc73('0x9')](_0xbc73('0xc'),auth[_0xbc73('0xa')](),controller['describe']);router[_0xbc73('0x9')]('/users',auth[_0xbc73('0xa')](),controller['getUsers']);router[_0xbc73('0x9')](_0xbc73('0xd'),auth[_0xbc73('0xa')](),controller['show']);router[_0xbc73('0xe')]('/',auth[_0xbc73('0xa')](),controller[_0xbc73('0xf')]);router[_0xbc73('0x10')]('/:id',controller[_0xbc73('0x11')]);router[_0xbc73('0x12')](_0xbc73('0xd'),auth[_0xbc73('0xa')](),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 9f6f136..fb6bfea 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 _0x4227=['TEXT','sequelize','medium','BOOLEAN','ENUM','out','DATE','STRING'];(function(_0x52a4fd,_0x2667eb){var _0x1c7a59=function(_0x28ec84){while(--_0x28ec84){_0x52a4fd['push'](_0x52a4fd['shift']());}};_0x1c7a59(++_0x2667eb);}(_0x4227,0x89));var _0x7422=function(_0x2a8c06,_0x1646f3){_0x2a8c06=_0x2a8c06-0x0;var _0x331eec=_0x4227[_0x2a8c06];return _0x331eec;};'use strict';var Sequelize=require(_0x7422('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x7422('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x7422('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7422('0x3')]('in',_0x7422('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x7422('0x5')]},'providerName':{'type':Sequelize[_0x7422('0x6')]},'providerResponse':{'type':Sequelize[_0x7422('0x7')]}}; \ No newline at end of file +var _0x082b=['BOOLEAN','ENUM','out','DATE','sequelize','exports','TEXT','medium'];(function(_0x36e24c,_0x548af9){var _0x2f4ccd=function(_0x5e9a81){while(--_0x5e9a81){_0x36e24c['push'](_0x36e24c['shift']());}};_0x2f4ccd(++_0x548af9);}(_0x082b,0x1ec));var _0xb082=function(_0xfa73ac,_0x2a7395){_0xfa73ac=_0xfa73ac-0x0;var _0x4e8e14=_0x082b[_0xfa73ac];return _0x4e8e14;};'use strict';var Sequelize=require(_0xb082('0x0'));module[_0xb082('0x1')]={'body':{'type':Sequelize[_0xb082('0x2')](_0xb082('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xb082('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb082('0x5')]('in','out'),'defaultValue':_0xb082('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xb082('0x7')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xb082('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index b7615e6..9951ca7 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 _0x5391=['ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','destroy','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','where','merge','VIRTUAL','filter','options','ChatMessage','includeAll','findAll','show','params','keys','include','find','create','body','update','describe','chat-interactions','chat','read','format','UserId','user','agent','get','ChatInteraction','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','acceptMessage','Sequelize','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','event','accept','EventManager','acceptmessage','formData','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','parse','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','client','request','then','info'];(function(_0x57fa7e,_0xd0b5ce){var _0x320671=function(_0x3392cc){while(--_0x3392cc){_0x57fa7e['push'](_0x57fa7e['shift']());}};_0x320671(++_0xd0b5ce);}(_0x5391,0xe9));var _0x1539=function(_0x58d147,_0x35e972){_0x58d147=_0x58d147-0x0;var _0x2adb21=_0x5391[_0x58d147];return _0x2adb21;};'use strict';var emlformat=require(_0x1539('0x0'));var rimraf=require(_0x1539('0x1'));var zipdir=require(_0x1539('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1539('0x3'));var moment=require('moment');var BPromise=require(_0x1539('0x4'));var Mustache=require(_0x1539('0x5'));var util=require('util');var path=require(_0x1539('0x6'));var sox=require(_0x1539('0x7'));var csv=require(_0x1539('0x8'));var ejs=require(_0x1539('0x9'));var fs=require('fs');var fs_extra=require(_0x1539('0xa'));var _=require(_0x1539('0xb'));var squel=require(_0x1539('0xc'));var crypto=require(_0x1539('0xd'));var jsforce=require(_0x1539('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1539('0x8'));var querystring=require(_0x1539('0xf'));var Papa=require(_0x1539('0x10'));var Redis=require(_0x1539('0x11'));var authService=require(_0x1539('0x12'));var qs=require(_0x1539('0x13'));var as=require(_0x1539('0x14'));var hardwareService=require(_0x1539('0x15'));var logger=require(_0x1539('0x16'))(_0x1539('0x17'));var utils=require(_0x1539('0x18'));var config=require(_0x1539('0x19'));var licenseUtil=require(_0x1539('0x1a'));var db=require('../../mysqldb')['db'];config[_0x1539('0x1b')]=_[_0x1539('0x1c')](config[_0x1539('0x1b')],{'host':_0x1539('0x1d'),'port':0x18eb});var socket=require(_0x1539('0x1e'))(new Redis(config[_0x1539('0x1b')]));require('./chatMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x1539('0x1f')]['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4b9ce6,_0x24f692,_0x399289,_0x4b9910){return new BPromise(function(_0x562866,_0x1fc43f){var _0x38272f=_0x4b9910||client;return _0x38272f[_0x1539('0x20')](_0x4b9ce6,_0x399289)[_0x1539('0x21')](function(_0x2aa4b8){logger[_0x1539('0x22')](_0x1539('0x23'),_0x24f692,_0x1539('0x24'));logger['debug'](_0x1539('0x25'),_0x24f692,_0x1539('0x24'),JSON[_0x1539('0x26')](_0x2aa4b8));if(_0x2aa4b8[_0x1539('0x27')]){if(_0x2aa4b8[_0x1539('0x27')]['code']===0x1f4){logger['error'](_0x1539('0x23'),_0x24f692,_0x2aa4b8[_0x1539('0x27')]['message']);return _0x1fc43f(_0x2aa4b8[_0x1539('0x27')]['message']);}logger[_0x1539('0x27')](_0x1539('0x23'),_0x24f692,_0x2aa4b8['error']['message']);return _0x562866(_0x2aa4b8['error'][_0x1539('0x28')]);}else{logger['info'](_0x1539('0x23'),_0x24f692,_0x1539('0x24'));_0x562866(_0x2aa4b8[_0x1539('0x29')][_0x1539('0x28')]);}})[_0x1539('0x2a')](function(_0x1ec3c6){logger['error'](_0x1539('0x23'),_0x24f692,_0x1ec3c6);_0x1fc43f(_0x1ec3c6);});});}function respondWithStatusCode(_0x4e35e4,_0x1ccf96){_0x1ccf96=_0x1ccf96||0xcc;return function(_0x1b7338){if(_0x1b7338){return _0x4e35e4[_0x1539('0x2b')](_0x1ccf96);}return _0x4e35e4[_0x1539('0x2c')](_0x1ccf96)[_0x1539('0x2d')]();};}function respondWithResult(_0x25a3f6,_0x2bbbf4){_0x2bbbf4=_0x2bbbf4||0xc8;return function(_0xcfa6ff){if(_0xcfa6ff){return _0x25a3f6[_0x1539('0x2c')](_0x2bbbf4)[_0x1539('0x2e')](_0xcfa6ff);}};}function respondWithFilteredResult(_0x594a87,_0x53435d){return function(_0x226262){if(_0x226262){var _0x44ae65=typeof _0x53435d[_0x1539('0x2f')]===_0x1539('0x30')&&typeof _0x53435d[_0x1539('0x31')]===_0x1539('0x30');var _0x3552f8=_0x226262[_0x1539('0x32')];var _0x1aed21=_0x44ae65?0x0:_0x53435d['offset'];var _0x4a0a7b=_0x44ae65?_0x226262[_0x1539('0x32')]:_0x53435d[_0x1539('0x2f')]+_0x53435d[_0x1539('0x31')];var _0x213026;if(_0x4a0a7b>=_0x3552f8){_0x4a0a7b=_0x3552f8;_0x213026=0xc8;}else{_0x213026=0xce;}_0x594a87[_0x1539('0x2c')](_0x213026);return _0x594a87[_0x1539('0x33')](_0x1539('0x34'),_0x1aed21+'-'+_0x4a0a7b+'/'+_0x3552f8)['json'](_0x226262);}return null;};}function patchUpdates(_0x3a547d){return function(_0x28c1fa){try{jsonpatch['apply'](_0x28c1fa,_0x3a547d,!![]);}catch(_0x5003f8){return BPromise[_0x1539('0x35')](_0x5003f8);}return _0x28c1fa[_0x1539('0x36')]();};}function saveUpdates(_0x13ef54,_0x42fa32){return function(_0x26398c){if(_0x26398c){return _0x26398c['update'](_0x13ef54)[_0x1539('0x21')](function(_0x1dfe4a){return _0x1dfe4a;});}return null;};}function removeEntity(_0xd959da,_0x24c1b2){return function(_0x8feafb){if(_0x8feafb){return _0x8feafb[_0x1539('0x37')]()[_0x1539('0x21')](function(){_0xd959da[_0x1539('0x2c')](0xcc)[_0x1539('0x2d')]();});}};}function handleEntityNotFound(_0x47a705,_0x2083d9){return function(_0x79977b){if(!_0x79977b){_0x47a705[_0x1539('0x2b')](0x194);}return _0x79977b;};}function handleError(_0x242d26,_0x780dfb){_0x780dfb=_0x780dfb||0x1f4;return function(_0x13da8f){logger[_0x1539('0x27')](_0x13da8f[_0x1539('0x38')]);if(_0x13da8f[_0x1539('0x39')]){delete _0x13da8f[_0x1539('0x39')];}_0x242d26[_0x1539('0x2c')](_0x780dfb)[_0x1539('0x3a')](_0x13da8f);};}exports[_0x1539('0x3b')]=function(_0x50d5bb,_0x528895){var _0x3c153a={},_0x2d6fe8={},_0x3e1565={'count':0x0,'rows':[]};var _0x5be312=_['map'](db['ChatMessage'][_0x1539('0x3c')],function(_0x3daa74){return{'name':_0x3daa74[_0x1539('0x3d')],'type':_0x3daa74[_0x1539('0x3e')][_0x1539('0x3f')]};});_0x2d6fe8[_0x1539('0x40')]=_[_0x1539('0x41')](_0x5be312,'name');_0x2d6fe8[_0x1539('0x42')]=_['keys'](_0x50d5bb[_0x1539('0x42')]);_0x2d6fe8['filters']=_[_0x1539('0x43')](_0x2d6fe8['model'],_0x2d6fe8[_0x1539('0x42')]);_0x3c153a['attributes']=_['intersection'](_0x2d6fe8[_0x1539('0x40')],qs[_0x1539('0x44')](_0x50d5bb['query'][_0x1539('0x44')]));_0x3c153a['attributes']=_0x3c153a[_0x1539('0x45')][_0x1539('0x46')]?_0x3c153a[_0x1539('0x45')]:_0x2d6fe8[_0x1539('0x40')];if(!_0x50d5bb[_0x1539('0x42')][_0x1539('0x47')](_0x1539('0x48'))){_0x3c153a['limit']=qs[_0x1539('0x31')](_0x50d5bb[_0x1539('0x42')]['limit']);_0x3c153a['offset']=qs['offset'](_0x50d5bb['query'][_0x1539('0x2f')]);}_0x3c153a[_0x1539('0x49')]=qs[_0x1539('0x4a')](_0x50d5bb['query'][_0x1539('0x4a')]);_0x3c153a['where']=qs['filters'](_['pick'](_0x50d5bb[_0x1539('0x42')],_0x2d6fe8[_0x1539('0x4b')]),_0x5be312);if(_0x50d5bb[_0x1539('0x42')]['filter']){_0x3c153a[_0x1539('0x4c')]=_[_0x1539('0x4d')](_0x3c153a[_0x1539('0x4c')],{'$or':_[_0x1539('0x41')](_0x5be312,function(_0x188a56){if(_0x188a56[_0x1539('0x3e')]!==_0x1539('0x4e')){var _0x5a4464={};_0x5a4464[_0x188a56[_0x1539('0x39')]]={'$like':'%'+_0x50d5bb[_0x1539('0x42')][_0x1539('0x4f')]+'%'};return _0x5a4464;}})});}_0x3c153a=_[_0x1539('0x4d')]({},_0x3c153a,_0x50d5bb[_0x1539('0x50')]);var _0x1aaa81={'where':_0x3c153a[_0x1539('0x4c')]};return db[_0x1539('0x51')]['count'](_0x1aaa81)[_0x1539('0x21')](function(_0xb8ad5c){_0x3e1565[_0x1539('0x32')]=_0xb8ad5c;if(_0x50d5bb['query'][_0x1539('0x52')]){_0x3c153a['include']=[{'all':!![]}];}return db[_0x1539('0x51')][_0x1539('0x53')](_0x3c153a);})[_0x1539('0x21')](function(_0x133afb){_0x3e1565['rows']=_0x133afb;return _0x3e1565;})[_0x1539('0x21')](respondWithFilteredResult(_0x528895,_0x3c153a))[_0x1539('0x2a')](handleError(_0x528895,null));};exports[_0x1539('0x54')]=function(_0x45509a,_0xd9082a){var _0x1219e1={'raw':!![],'where':{'id':_0x45509a[_0x1539('0x55')]['id']}},_0x1a105c={};_0x1a105c[_0x1539('0x40')]=_[_0x1539('0x56')](db['ChatMessage']['rawAttributes']);_0x1a105c[_0x1539('0x42')]=_[_0x1539('0x56')](_0x45509a['query']);_0x1a105c['filters']=_[_0x1539('0x43')](_0x1a105c[_0x1539('0x40')],_0x1a105c['query']);_0x1219e1[_0x1539('0x45')]=_[_0x1539('0x43')](_0x1a105c[_0x1539('0x40')],qs[_0x1539('0x44')](_0x45509a[_0x1539('0x42')]['fields']));_0x1219e1[_0x1539('0x45')]=_0x1219e1[_0x1539('0x45')][_0x1539('0x46')]?_0x1219e1[_0x1539('0x45')]:_0x1a105c[_0x1539('0x40')];if(_0x45509a[_0x1539('0x42')][_0x1539('0x52')]){_0x1219e1[_0x1539('0x57')]=[{'all':!![]}];}_0x1219e1=_[_0x1539('0x4d')]({},_0x1219e1,_0x45509a[_0x1539('0x50')]);return db[_0x1539('0x51')][_0x1539('0x58')](_0x1219e1)['then'](handleEntityNotFound(_0xd9082a,null))[_0x1539('0x21')](respondWithResult(_0xd9082a,null))[_0x1539('0x2a')](handleError(_0xd9082a,null));};exports[_0x1539('0x59')]=function(_0x5b17f9,_0x4721d1){return db['ChatMessage'][_0x1539('0x59')](_0x5b17f9[_0x1539('0x5a')],{})[_0x1539('0x21')](respondWithResult(_0x4721d1,0xc9))['catch'](handleError(_0x4721d1,null));};exports[_0x1539('0x5b')]=function(_0x10914e,_0x4c2d52){if(_0x10914e['body']['id']){delete _0x10914e['body']['id'];}return db[_0x1539('0x51')][_0x1539('0x58')]({'where':{'id':_0x10914e[_0x1539('0x55')]['id']}})[_0x1539('0x21')](handleEntityNotFound(_0x4c2d52,null))[_0x1539('0x21')](saveUpdates(_0x10914e[_0x1539('0x5a')],null))[_0x1539('0x21')](respondWithResult(_0x4c2d52,null))[_0x1539('0x2a')](handleError(_0x4c2d52,null));};exports[_0x1539('0x37')]=function(_0x174a55,_0x3beb74){return db[_0x1539('0x51')][_0x1539('0x58')]({'where':{'id':_0x174a55[_0x1539('0x55')]['id']}})[_0x1539('0x21')](handleEntityNotFound(_0x3beb74,null))[_0x1539('0x21')](removeEntity(_0x3beb74,null))[_0x1539('0x2a')](handleError(_0x3beb74,null));};exports[_0x1539('0x5c')]=function(_0x4b8873,_0x39565d){return db[_0x1539('0x51')][_0x1539('0x5c')]()[_0x1539('0x21')](respondWithResult(_0x39565d,null))[_0x1539('0x2a')](handleError(_0x39565d,null));};var interaction_log=require(_0x1539('0x16'))(_0x1539('0x5d'));exports['accept']=function(_0x23d534,_0x49d828,_0x54099a){var _0x1d7b5e={'agent':{},'channel':_0x1539('0x5e')};if(_0x23d534[_0x1539('0x5a')]['id']){delete _0x23d534[_0x1539('0x5a')]['id'];}_0x23d534[_0x1539('0x5a')][_0x1539('0x5f')]=!![];_0x23d534[_0x1539('0x5a')]['readAt']=moment()[_0x1539('0x60')]('YYYY-MM-DD\x20HH:mm:ss');_0x23d534[_0x1539('0x5a')][_0x1539('0x61')]=_0x23d534[_0x1539('0x5a')][_0x1539('0x61')]||_0x23d534[_0x1539('0x62')]['id'];_0x1d7b5e[_0x1539('0x63')]['id']=_0x23d534[_0x1539('0x5a')][_0x1539('0x61')];return db['ChatMessage']['find']({'where':{'id':_0x23d534['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x49d828,null))[_0x1539('0x21')](saveUpdates(_0x23d534[_0x1539('0x5a')],null))['then'](function(_0x1f0997){if(_0x1f0997){_0x1d7b5e[_0x1539('0x28')]=_0x1f0997[_0x1539('0x64')]({'plain':!![]});return db[_0x1539('0x65')][_0x1539('0x58')]({'where':{'id':_0x1f0997['ChatInteractionId']}});}return null;})[_0x1539('0x21')](handleEntityNotFound(_0x49d828,null))[_0x1539('0x21')](function(_0x448586){if(_0x448586){return _0x448586[_0x1539('0x5b')]({'UserId':_0x23d534['body']['UserId'],'read1stAt':_[_0x1539('0x66')](_0x448586['read1stAt'])?moment()[_0x1539('0x60')](_0x1539('0x67')):undefined});}return null;})[_0x1539('0x21')](function(_0x17d6c7){if(_0x17d6c7){_0x1d7b5e[_0x1539('0x68')]=_0x17d6c7['get']({'plain':!![]});interaction_log[_0x1539('0x22')](_0x1539('0x69'),_0x23d534['user']['id'],_0x23d534[_0x1539('0x62')][_0x1539('0x39')],_0x23d534[_0x1539('0x62')][_0x1539('0x6a')],_0x1d7b5e[_0x1539('0x68')]['id'],_0x23d534[_0x1539('0x5a')]?JSON['stringify'](_0x23d534[_0x1539('0x5a')]):'null');return respondWithRpcPromise('AcceptMessage',_0x1539('0x6b'),_0x1d7b5e);}return null;})['then'](function(_0x514e2a){var _0x4d6bf4='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x514e2a[_0x1539('0x28')]['ContactId'];return db['sequelize'][_0x1539('0x42')](_0x4d6bf4,{'type':db[_0x1539('0x6c')]['QueryTypes'][_0x1539('0x6d')],'raw':!![]})[_0x1539('0x21')](function(_0x421095){return _0x421095;});})[_0x1539('0x21')](function(_0x210a1c){if(_0x210a1c){_0x1d7b5e[_0x1539('0x28')][_0x1539('0x6e')]=_0x210a1c[0x0];if(!_0x23d534['body'][_0x1539('0x61')])return;return db[_0x1539('0x6f')][_0x1539('0x58')]({'where':{'id':_0x23d534[_0x1539('0x5a')][_0x1539('0x61')],'role':_0x1539('0x63')},'attributes':['id','name',_0x1539('0x70'),_0x1539('0x71'),_0x1539('0x72')],'raw':!![]});}return null;})[_0x1539('0x21')](function(_0x44a80b){if(!_0x44a80b)return null;_0x1d7b5e[_0x1539('0x28')][_0x1539('0x63')]=_0x44a80b;return _0x1d7b5e;})[_0x1539('0x21')](function(_0x12b86a){if(_0x12b86a){if(_0x23d534[_0x1539('0x5a')][_0x1539('0x73')]){_0x1d7b5e['message'][_0x1539('0x74')]=util[_0x1539('0x60')](_0x1539('0x75'),_0x23d534[_0x1539('0x62')]['name']);_0x1d7b5e[_0x1539('0x28')][_0x1539('0x76')]=_0x1d7b5e[_0x1539('0x76')];_0x1d7b5e[_0x1539('0x28')]['motionChannel']=_0x1d7b5e[_0x1539('0x76')];_0x1d7b5e[_0x1539('0x28')][_0x1539('0x77')]=_0x1539('0x78');return respondWithRpcPromise(_0x1539('0x79'),_0x1539('0x79'),{'event':_0x1539('0x7a'),'message':_[_0x1539('0x4d')](_0x1d7b5e[_0x1539('0x28')],JSON['parse'](_0x1d7b5e['interaction'][_0x1539('0x7b')]))},client9002)['then'](function(){return _0x1d7b5e;});}return _0x1d7b5e;}return null;})[_0x1539('0x21')](respondWithResult(_0x49d828,null))[_0x1539('0x2a')](handleError(_0x49d828,null));};var interaction_log=require(_0x1539('0x16'))(_0x1539('0x5d'));exports[_0x1539('0x35')]=function(_0x12a08e,_0x362a61,_0x22f2b2){var _0x5b2945={'agent':{},'channel':'chat'};if(_0x12a08e[_0x1539('0x5a')]['id']){delete _0x12a08e[_0x1539('0x5a')]['id'];}_0x12a08e[_0x1539('0x5a')][_0x1539('0x61')]=_0x12a08e[_0x1539('0x5a')][_0x1539('0x61')]||_0x12a08e[_0x1539('0x62')]['id'];_0x5b2945['agent']['id']=_0x12a08e[_0x1539('0x5a')][_0x1539('0x61')];return db[_0x1539('0x51')][_0x1539('0x58')]({'where':{'id':_0x12a08e['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x362a61,null))[_0x1539('0x21')](function(_0xc77afd){if(_0xc77afd){_0x5b2945[_0x1539('0x28')]=_0xc77afd[_0x1539('0x64')]({'plain':!![]});return db[_0x1539('0x65')][_0x1539('0x58')]({'where':{'id':_0xc77afd[_0x1539('0x7c')]}});}return null;})[_0x1539('0x21')](handleEntityNotFound(_0x362a61,null))[_0x1539('0x21')](function(_0x5d2499){if(_0x5d2499){_0x5b2945[_0x1539('0x68')]=_0x5d2499[_0x1539('0x64')]({'plain':!![]});interaction_log[_0x1539('0x22')](_0x1539('0x7d'),_0x12a08e['user']['id'],_0x12a08e[_0x1539('0x62')][_0x1539('0x39')],_0x12a08e[_0x1539('0x62')][_0x1539('0x6a')],_0x5b2945['interaction']['id'],_0x12a08e[_0x1539('0x5a')]?JSON['stringify'](_0x12a08e['body']):_0x1539('0x7e'));return respondWithRpcPromise(_0x1539('0x7f'),_0x1539('0x80'),_0x5b2945);}return null;})[_0x1539('0x21')](function(_0xb4531c){var _0x407f42=_0x1539('0x81')+_0xb4531c[_0x1539('0x28')][_0x1539('0x82')];return db[_0x1539('0x83')][_0x1539('0x42')](_0x407f42,{'type':db[_0x1539('0x6c')][_0x1539('0x84')][_0x1539('0x6d')],'raw':!![]})[_0x1539('0x21')](function(_0x460e93){return _0x460e93;});})['then'](function(_0x24a230){if(_0x24a230){_0x5b2945['message'][_0x1539('0x6e')]=_0x24a230[0x0];if(!_0x12a08e[_0x1539('0x5a')][_0x1539('0x61')])return;return db[_0x1539('0x6f')]['find']({'where':{'id':_0x12a08e[_0x1539('0x5a')][_0x1539('0x61')],'role':_0x1539('0x63')},'attributes':['id','name',_0x1539('0x70'),'email',_0x1539('0x72')],'raw':!![]});}return null;})['then'](function(_0x2db517){if(!_0x2db517)return null;_0x5b2945[_0x1539('0x28')][_0x1539('0x63')]=_0x2db517;return _0x5b2945;})['then'](function(_0x1cfefd){if(_0x1cfefd){_0x1cfefd[_0x1539('0x28')]['interface']=util[_0x1539('0x60')](_0x1539('0x75'),_0x12a08e[_0x1539('0x62')]['name']);_0x1cfefd[_0x1539('0x28')][_0x1539('0x76')]=_0x5b2945[_0x1539('0x76')];_0x1cfefd[_0x1539('0x28')]['motionChannel']=_0x5b2945[_0x1539('0x76')];_0x1cfefd[_0x1539('0x28')][_0x1539('0x77')]=_0x1539('0x35');respondWithRpcPromise('EventManager','EventManager',{'event':'rejectmessage','message':_[_0x1539('0x4d')](_0x5b2945[_0x1539('0x28')],JSON[_0x1539('0x85')](_0x5b2945['interaction'][_0x1539('0x7b')]))},client9002);return _0x5b2945;}return null;})[_0x1539('0x21')](respondWithResult(_0x362a61,null))[_0x1539('0x2a')](handleError(_0x362a61,null));}; \ No newline at end of file +var _0x7c71=['../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','request','then','info','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','save','update','destroy','stack','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','filter','merge','options','include','findAll','rows','show','includeAll','find','create','body','params','describe','chat-interactions','chat','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','contact','fullname','internal','agent','manual','SIP/%s','channel','motionChannel','accept','EventManager','parse','formData','reject','get','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','sequelize','SELECT','User','interface','event','rejectmessage','eml-format','rimraf','zip-dir','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api'];(function(_0x560c40,_0x18eba2){var _0x1158ff=function(_0x5f5b67){while(--_0x5f5b67){_0x560c40['push'](_0x560c40['shift']());}};_0x1158ff(++_0x18eba2);}(_0x7c71,0x162));var _0x17c7=function(_0x5ad771,_0x34186f){_0x5ad771=_0x5ad771-0x0;var _0x5b5dce=_0x7c71[_0x5ad771];return _0x5b5dce;};'use strict';var emlformat=require(_0x17c7('0x0'));var rimraf=require(_0x17c7('0x1'));var zipdir=require(_0x17c7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x17c7('0x3'));var Mustache=require(_0x17c7('0x4'));var util=require(_0x17c7('0x5'));var path=require('path');var sox=require(_0x17c7('0x6'));var csv=require('to-csv');var ejs=require(_0x17c7('0x7'));var fs=require('fs');var fs_extra=require(_0x17c7('0x8'));var _=require(_0x17c7('0x9'));var squel=require(_0x17c7('0xa'));var crypto=require('crypto');var jsforce=require(_0x17c7('0xb'));var deskjs=require(_0x17c7('0xc'));var toCsv=require(_0x17c7('0xd'));var querystring=require(_0x17c7('0xe'));var Papa=require(_0x17c7('0xf'));var Redis=require(_0x17c7('0x10'));var authService=require(_0x17c7('0x11'));var qs=require(_0x17c7('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x17c7('0x13'));var logger=require('../../config/logger')(_0x17c7('0x14'));var utils=require(_0x17c7('0x15'));var config=require(_0x17c7('0x16'));var licenseUtil=require(_0x17c7('0x17'));var db=require('../../mysqldb')['db'];config[_0x17c7('0x18')]=_['defaults'](config[_0x17c7('0x18')],{'host':_0x17c7('0x19'),'port':0x18eb});var socket=require(_0x17c7('0x1a'))(new Redis(config[_0x17c7('0x18')]));require(_0x17c7('0x1b'))[_0x17c7('0x1c')](socket);var jayson=require(_0x17c7('0x1d'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x17c7('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c8d90,_0x29104a,_0x4d400b,_0x38eaf6){return new BPromise(function(_0x35bcbb,_0xbda954){var _0x390f53=_0x38eaf6||client;return _0x390f53[_0x17c7('0x1f')](_0x4c8d90,_0x4d400b)[_0x17c7('0x20')](function(_0x31b5fd){logger[_0x17c7('0x21')](_0x17c7('0x22'),_0x29104a,'request\x20sent');logger['debug'](_0x17c7('0x23'),_0x29104a,_0x17c7('0x24'),JSON[_0x17c7('0x25')](_0x31b5fd));if(_0x31b5fd[_0x17c7('0x26')]){if(_0x31b5fd[_0x17c7('0x26')]['code']===0x1f4){logger[_0x17c7('0x26')](_0x17c7('0x22'),_0x29104a,_0x31b5fd[_0x17c7('0x26')][_0x17c7('0x27')]);return _0xbda954(_0x31b5fd[_0x17c7('0x26')][_0x17c7('0x27')]);}logger[_0x17c7('0x26')]('ChatMessage,\x20%s,\x20%s',_0x29104a,_0x31b5fd[_0x17c7('0x26')][_0x17c7('0x27')]);return _0x35bcbb(_0x31b5fd[_0x17c7('0x26')][_0x17c7('0x27')]);}else{logger[_0x17c7('0x21')](_0x17c7('0x22'),_0x29104a,_0x17c7('0x24'));_0x35bcbb(_0x31b5fd[_0x17c7('0x28')]['message']);}})[_0x17c7('0x29')](function(_0x192c6c){logger[_0x17c7('0x26')](_0x17c7('0x22'),_0x29104a,_0x192c6c);_0xbda954(_0x192c6c);});});}function respondWithStatusCode(_0x5cac80,_0x3aa862){_0x3aa862=_0x3aa862||0xcc;return function(_0x16ddb2){if(_0x16ddb2){return _0x5cac80[_0x17c7('0x2a')](_0x3aa862);}return _0x5cac80[_0x17c7('0x2b')](_0x3aa862)[_0x17c7('0x2c')]();};}function respondWithResult(_0xa45090,_0x32a33e){_0x32a33e=_0x32a33e||0xc8;return function(_0x5b955e){if(_0x5b955e){return _0xa45090[_0x17c7('0x2b')](_0x32a33e)['json'](_0x5b955e);}};}function respondWithFilteredResult(_0x5a82bb,_0x2c9798){return function(_0x29070b){if(_0x29070b){var _0x24996e=typeof _0x2c9798[_0x17c7('0x2d')]===_0x17c7('0x2e')&&typeof _0x2c9798[_0x17c7('0x2f')]===_0x17c7('0x2e');var _0x11e530=_0x29070b[_0x17c7('0x30')];var _0x4d3fe4=_0x24996e?0x0:_0x2c9798[_0x17c7('0x2d')];var _0x12c962=_0x24996e?_0x29070b[_0x17c7('0x30')]:_0x2c9798[_0x17c7('0x2d')]+_0x2c9798[_0x17c7('0x2f')];var _0x9b03ad;if(_0x12c962>=_0x11e530){_0x12c962=_0x11e530;_0x9b03ad=0xc8;}else{_0x9b03ad=0xce;}_0x5a82bb[_0x17c7('0x2b')](_0x9b03ad);return _0x5a82bb['set']('Content-Range',_0x4d3fe4+'-'+_0x12c962+'/'+_0x11e530)['json'](_0x29070b);}return null;};}function patchUpdates(_0x72f763){return function(_0x2917b4){try{jsonpatch['apply'](_0x2917b4,_0x72f763,!![]);}catch(_0x333d5e){return BPromise['reject'](_0x333d5e);}return _0x2917b4[_0x17c7('0x31')]();};}function saveUpdates(_0x5776af,_0x123d95){return function(_0x3df037){if(_0x3df037){return _0x3df037[_0x17c7('0x32')](_0x5776af)[_0x17c7('0x20')](function(_0x1008f6){return _0x1008f6;});}return null;};}function removeEntity(_0x34c2e8,_0xc5816e){return function(_0x95b412){if(_0x95b412){return _0x95b412[_0x17c7('0x33')]()[_0x17c7('0x20')](function(){_0x34c2e8[_0x17c7('0x2b')](0xcc)[_0x17c7('0x2c')]();});}};}function handleEntityNotFound(_0x4a3c73,_0x1944a0){return function(_0x262341){if(!_0x262341){_0x4a3c73[_0x17c7('0x2a')](0x194);}return _0x262341;};}function handleError(_0x14ea81,_0x4a4785){_0x4a4785=_0x4a4785||0x1f4;return function(_0x14f6f1){logger[_0x17c7('0x26')](_0x14f6f1[_0x17c7('0x34')]);if(_0x14f6f1['name']){delete _0x14f6f1['name'];}_0x14ea81[_0x17c7('0x2b')](_0x4a4785)['send'](_0x14f6f1);};}exports[_0x17c7('0x35')]=function(_0x3c50d4,_0xbe8cbb){var _0x472b49={},_0x14c9c0={},_0x86dffc={'count':0x0,'rows':[]};var _0x5aae01=_[_0x17c7('0x36')](db[_0x17c7('0x37')][_0x17c7('0x38')],function(_0x586fd8){return{'name':_0x586fd8[_0x17c7('0x39')],'type':_0x586fd8[_0x17c7('0x3a')][_0x17c7('0x3b')]};});_0x14c9c0[_0x17c7('0x3c')]=_[_0x17c7('0x36')](_0x5aae01,_0x17c7('0x3d'));_0x14c9c0[_0x17c7('0x3e')]=_[_0x17c7('0x3f')](_0x3c50d4[_0x17c7('0x3e')]);_0x14c9c0['filters']=_[_0x17c7('0x40')](_0x14c9c0['model'],_0x14c9c0[_0x17c7('0x3e')]);_0x472b49[_0x17c7('0x41')]=_[_0x17c7('0x40')](_0x14c9c0[_0x17c7('0x3c')],qs[_0x17c7('0x42')](_0x3c50d4[_0x17c7('0x3e')][_0x17c7('0x42')]));_0x472b49[_0x17c7('0x41')]=_0x472b49['attributes']['length']?_0x472b49['attributes']:_0x14c9c0['model'];if(!_0x3c50d4[_0x17c7('0x3e')][_0x17c7('0x43')](_0x17c7('0x44'))){_0x472b49[_0x17c7('0x2f')]=qs['limit'](_0x3c50d4[_0x17c7('0x3e')][_0x17c7('0x2f')]);_0x472b49[_0x17c7('0x2d')]=qs['offset'](_0x3c50d4[_0x17c7('0x3e')][_0x17c7('0x2d')]);}_0x472b49['order']=qs['sort'](_0x3c50d4['query'][_0x17c7('0x45')]);_0x472b49[_0x17c7('0x46')]=qs[_0x17c7('0x47')](_['pick'](_0x3c50d4[_0x17c7('0x3e')],_0x14c9c0[_0x17c7('0x47')]),_0x5aae01);if(_0x3c50d4[_0x17c7('0x3e')][_0x17c7('0x48')]){_0x472b49[_0x17c7('0x46')]=_[_0x17c7('0x49')](_0x472b49[_0x17c7('0x46')],{'$or':_[_0x17c7('0x36')](_0x5aae01,function(_0x24705f){if(_0x24705f[_0x17c7('0x3a')]!=='VIRTUAL'){var _0x20827f={};_0x20827f[_0x24705f[_0x17c7('0x3d')]]={'$like':'%'+_0x3c50d4[_0x17c7('0x3e')][_0x17c7('0x48')]+'%'};return _0x20827f;}})});}_0x472b49=_['merge']({},_0x472b49,_0x3c50d4[_0x17c7('0x4a')]);var _0x3447e5={'where':_0x472b49[_0x17c7('0x46')]};return db[_0x17c7('0x37')]['count'](_0x3447e5)[_0x17c7('0x20')](function(_0x505a04){_0x86dffc['count']=_0x505a04;if(_0x3c50d4[_0x17c7('0x3e')]['includeAll']){_0x472b49[_0x17c7('0x4b')]=[{'all':!![]}];}return db[_0x17c7('0x37')][_0x17c7('0x4c')](_0x472b49);})['then'](function(_0x43d913){_0x86dffc[_0x17c7('0x4d')]=_0x43d913;return _0x86dffc;})[_0x17c7('0x20')](respondWithFilteredResult(_0xbe8cbb,_0x472b49))[_0x17c7('0x29')](handleError(_0xbe8cbb,null));};exports[_0x17c7('0x4e')]=function(_0x58715e,_0x5ae834){var _0x13b485={'raw':!![],'where':{'id':_0x58715e['params']['id']}},_0x239a3d={};_0x239a3d[_0x17c7('0x3c')]=_[_0x17c7('0x3f')](db[_0x17c7('0x37')]['rawAttributes']);_0x239a3d['query']=_[_0x17c7('0x3f')](_0x58715e[_0x17c7('0x3e')]);_0x239a3d[_0x17c7('0x47')]=_[_0x17c7('0x40')](_0x239a3d[_0x17c7('0x3c')],_0x239a3d[_0x17c7('0x3e')]);_0x13b485[_0x17c7('0x41')]=_[_0x17c7('0x40')](_0x239a3d[_0x17c7('0x3c')],qs['fields'](_0x58715e[_0x17c7('0x3e')][_0x17c7('0x42')]));_0x13b485[_0x17c7('0x41')]=_0x13b485['attributes']['length']?_0x13b485['attributes']:_0x239a3d['model'];if(_0x58715e['query'][_0x17c7('0x4f')]){_0x13b485[_0x17c7('0x4b')]=[{'all':!![]}];}_0x13b485=_['merge']({},_0x13b485,_0x58715e['options']);return db[_0x17c7('0x37')][_0x17c7('0x50')](_0x13b485)[_0x17c7('0x20')](handleEntityNotFound(_0x5ae834,null))['then'](respondWithResult(_0x5ae834,null))['catch'](handleError(_0x5ae834,null));};exports[_0x17c7('0x51')]=function(_0x8b22d7,_0x1a26e4){return db['ChatMessage'][_0x17c7('0x51')](_0x8b22d7['body'],{})[_0x17c7('0x20')](respondWithResult(_0x1a26e4,0xc9))['catch'](handleError(_0x1a26e4,null));};exports['update']=function(_0x462602,_0x4d9ba3){if(_0x462602[_0x17c7('0x52')]['id']){delete _0x462602[_0x17c7('0x52')]['id'];}return db['ChatMessage'][_0x17c7('0x50')]({'where':{'id':_0x462602[_0x17c7('0x53')]['id']}})['then'](handleEntityNotFound(_0x4d9ba3,null))[_0x17c7('0x20')](saveUpdates(_0x462602[_0x17c7('0x52')],null))[_0x17c7('0x20')](respondWithResult(_0x4d9ba3,null))[_0x17c7('0x29')](handleError(_0x4d9ba3,null));};exports['destroy']=function(_0x2b55d0,_0x1ae3c9){return db[_0x17c7('0x37')][_0x17c7('0x50')]({'where':{'id':_0x2b55d0[_0x17c7('0x53')]['id']}})[_0x17c7('0x20')](handleEntityNotFound(_0x1ae3c9,null))[_0x17c7('0x20')](removeEntity(_0x1ae3c9,null))[_0x17c7('0x29')](handleError(_0x1ae3c9,null));};exports[_0x17c7('0x54')]=function(_0x171dd8,_0x34ab50){return db[_0x17c7('0x37')][_0x17c7('0x54')]()[_0x17c7('0x20')](respondWithResult(_0x34ab50,null))[_0x17c7('0x29')](handleError(_0x34ab50,null));};var interaction_log=require('../../config/logger')(_0x17c7('0x55'));exports['accept']=function(_0x2c9d59,_0x8621ef,_0x35fa3c){var _0x328a9a={'agent':{},'channel':_0x17c7('0x56')};if(_0x2c9d59[_0x17c7('0x52')]['id']){delete _0x2c9d59[_0x17c7('0x52')]['id'];}_0x2c9d59['body']['read']=!![];_0x2c9d59['body']['readAt']=moment()[_0x17c7('0x57')](_0x17c7('0x58'));_0x2c9d59[_0x17c7('0x52')][_0x17c7('0x59')]=_0x2c9d59[_0x17c7('0x52')][_0x17c7('0x59')]||_0x2c9d59[_0x17c7('0x5a')]['id'];_0x328a9a['agent']['id']=_0x2c9d59[_0x17c7('0x52')][_0x17c7('0x59')];return db[_0x17c7('0x37')]['find']({'where':{'id':_0x2c9d59[_0x17c7('0x53')]['id'],'UserId':null}})[_0x17c7('0x20')](handleEntityNotFound(_0x8621ef,null))[_0x17c7('0x20')](saveUpdates(_0x2c9d59[_0x17c7('0x52')],null))[_0x17c7('0x20')](function(_0x2e6e18){if(_0x2e6e18){_0x328a9a[_0x17c7('0x27')]=_0x2e6e18['get']({'plain':!![]});return db[_0x17c7('0x5b')][_0x17c7('0x50')]({'where':{'id':_0x2e6e18[_0x17c7('0x5c')]}});}return null;})[_0x17c7('0x20')](handleEntityNotFound(_0x8621ef,null))['then'](function(_0x3ab8c3){if(_0x3ab8c3){return _0x3ab8c3['update']({'UserId':_0x2c9d59[_0x17c7('0x52')][_0x17c7('0x59')],'read1stAt':_[_0x17c7('0x5d')](_0x3ab8c3[_0x17c7('0x5e')])?moment()[_0x17c7('0x57')](_0x17c7('0x58')):undefined});}return null;})[_0x17c7('0x20')](function(_0xc4ae65){if(_0xc4ae65){_0x328a9a[_0x17c7('0x5f')]=_0xc4ae65['get']({'plain':!![]});interaction_log[_0x17c7('0x21')](_0x17c7('0x60'),_0x2c9d59['user']['id'],_0x2c9d59[_0x17c7('0x5a')][_0x17c7('0x3d')],_0x2c9d59[_0x17c7('0x5a')][_0x17c7('0x61')],_0x328a9a[_0x17c7('0x5f')]['id'],_0x2c9d59['body']?JSON['stringify'](_0x2c9d59[_0x17c7('0x52')]):'null');return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x328a9a);}return null;})[_0x17c7('0x20')](function(_0x105747){var _0x8e6ac3=_0x17c7('0x62')+_0x105747[_0x17c7('0x27')][_0x17c7('0x63')];return db['sequelize'][_0x17c7('0x3e')](_0x8e6ac3,{'type':db[_0x17c7('0x64')][_0x17c7('0x65')]['SELECT'],'raw':!![]})[_0x17c7('0x20')](function(_0x144601){return _0x144601;});})[_0x17c7('0x20')](function(_0x3cfdd1){if(_0x3cfdd1){_0x328a9a[_0x17c7('0x27')][_0x17c7('0x66')]=_0x3cfdd1[0x0];if(!_0x2c9d59[_0x17c7('0x52')][_0x17c7('0x59')])return;return db['User'][_0x17c7('0x50')]({'where':{'id':_0x2c9d59[_0x17c7('0x52')][_0x17c7('0x59')],'role':'agent'},'attributes':['id',_0x17c7('0x3d'),_0x17c7('0x67'),'email',_0x17c7('0x68')],'raw':!![]});}return null;})[_0x17c7('0x20')](function(_0x38edbd){if(!_0x38edbd)return null;_0x328a9a[_0x17c7('0x27')][_0x17c7('0x69')]=_0x38edbd;return _0x328a9a;})[_0x17c7('0x20')](function(_0x578ec7){if(_0x578ec7){if(_0x2c9d59[_0x17c7('0x52')][_0x17c7('0x6a')]){_0x328a9a['message']['interface']=util[_0x17c7('0x57')](_0x17c7('0x6b'),_0x2c9d59['user'][_0x17c7('0x3d')]);_0x328a9a['message'][_0x17c7('0x6c')]=_0x328a9a[_0x17c7('0x6c')];_0x328a9a[_0x17c7('0x27')][_0x17c7('0x6d')]=_0x328a9a[_0x17c7('0x6c')];_0x328a9a[_0x17c7('0x27')]['event']=_0x17c7('0x6e');return respondWithRpcPromise('EventManager',_0x17c7('0x6f'),{'event':'acceptmessage','message':_['merge'](_0x328a9a[_0x17c7('0x27')],JSON[_0x17c7('0x70')](_0x328a9a[_0x17c7('0x5f')][_0x17c7('0x71')]))},client9002)['then'](function(){return _0x328a9a;});}return _0x328a9a;}return null;})[_0x17c7('0x20')](respondWithResult(_0x8621ef,null))[_0x17c7('0x29')](handleError(_0x8621ef,null));};var interaction_log=require('../../config/logger')(_0x17c7('0x55'));exports[_0x17c7('0x72')]=function(_0x26a771,_0x2610e7,_0x5ade14){var _0xc3902c={'agent':{},'channel':_0x17c7('0x56')};if(_0x26a771[_0x17c7('0x52')]['id']){delete _0x26a771['body']['id'];}_0x26a771[_0x17c7('0x52')][_0x17c7('0x59')]=_0x26a771[_0x17c7('0x52')][_0x17c7('0x59')]||_0x26a771[_0x17c7('0x5a')]['id'];_0xc3902c['agent']['id']=_0x26a771[_0x17c7('0x52')][_0x17c7('0x59')];return db['ChatMessage'][_0x17c7('0x50')]({'where':{'id':_0x26a771[_0x17c7('0x53')]['id'],'UserId':null}})[_0x17c7('0x20')](handleEntityNotFound(_0x2610e7,null))[_0x17c7('0x20')](function(_0x39e71c){if(_0x39e71c){_0xc3902c['message']=_0x39e71c[_0x17c7('0x73')]({'plain':!![]});return db[_0x17c7('0x5b')][_0x17c7('0x50')]({'where':{'id':_0x39e71c['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x2610e7,null))[_0x17c7('0x20')](function(_0x161ef3){if(_0x161ef3){_0xc3902c[_0x17c7('0x5f')]=_0x161ef3[_0x17c7('0x73')]({'plain':!![]});interaction_log['info'](_0x17c7('0x74'),_0x26a771[_0x17c7('0x5a')]['id'],_0x26a771['user'][_0x17c7('0x3d')],_0x26a771['user'][_0x17c7('0x61')],_0xc3902c['interaction']['id'],_0x26a771[_0x17c7('0x52')]?JSON[_0x17c7('0x25')](_0x26a771['body']):_0x17c7('0x75'));return respondWithRpcPromise(_0x17c7('0x76'),'rejectMessage',_0xc3902c);}return null;})[_0x17c7('0x20')](function(_0x53f92d){var _0x3edc70='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x53f92d[_0x17c7('0x27')]['ContactId'];return db[_0x17c7('0x77')][_0x17c7('0x3e')](_0x3edc70,{'type':db[_0x17c7('0x64')][_0x17c7('0x65')][_0x17c7('0x78')],'raw':!![]})['then'](function(_0x214bab){return _0x214bab;});})[_0x17c7('0x20')](function(_0x2d1fa5){if(_0x2d1fa5){_0xc3902c[_0x17c7('0x27')][_0x17c7('0x66')]=_0x2d1fa5[0x0];if(!_0x26a771[_0x17c7('0x52')][_0x17c7('0x59')])return;return db[_0x17c7('0x79')][_0x17c7('0x50')]({'where':{'id':_0x26a771[_0x17c7('0x52')][_0x17c7('0x59')],'role':'agent'},'attributes':['id',_0x17c7('0x3d'),_0x17c7('0x67'),'email',_0x17c7('0x68')],'raw':!![]});}return null;})[_0x17c7('0x20')](function(_0x2b720c){if(!_0x2b720c)return null;_0xc3902c['message'][_0x17c7('0x69')]=_0x2b720c;return _0xc3902c;})[_0x17c7('0x20')](function(_0x508068){if(_0x508068){_0x508068[_0x17c7('0x27')][_0x17c7('0x7a')]=util[_0x17c7('0x57')](_0x17c7('0x6b'),_0x26a771['user'][_0x17c7('0x3d')]);_0x508068[_0x17c7('0x27')][_0x17c7('0x6c')]=_0xc3902c[_0x17c7('0x6c')];_0x508068[_0x17c7('0x27')]['motionChannel']=_0xc3902c['channel'];_0x508068[_0x17c7('0x27')][_0x17c7('0x7b')]='reject';respondWithRpcPromise(_0x17c7('0x6f'),'EventManager',{'event':_0x17c7('0x7c'),'message':_[_0x17c7('0x49')](_0xc3902c[_0x17c7('0x27')],JSON['parse'](_0xc3902c[_0x17c7('0x5f')][_0x17c7('0x71')]))},client9002);return _0xc3902c;}return null;})[_0x17c7('0x20')](respondWithResult(_0x2610e7,null))['catch'](handleError(_0x2610e7,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 7644481..e3489c1 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 _0xaeaa=['hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','update','emit','hasOwnProperty'];(function(_0xa41267,_0x24b463){var _0x402825=function(_0x362d7c){while(--_0x362d7c){_0xa41267['push'](_0xa41267['shift']());}};_0x402825(++_0x24b463);}(_0xaeaa,0x110));var _0xaaea=function(_0x195cc2,_0x30f2ea){_0x195cc2=_0x195cc2-0x0;var _0x2266cb=_0xaeaa[_0x195cc2];return _0x2266cb;};'use strict';var EventEmitter=require(_0xaaea('0x0'));var ChatMessage=require(_0xaaea('0x1'))['db'][_0xaaea('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xaaea('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xaaea('0x4'),'afterDestroy':'remove'};function emitEvent(_0x562fa9){return function(_0x34e14e,_0x26d2ac,_0x36fa9e){ChatMessageEvents[_0xaaea('0x5')](_0x562fa9+':'+_0x34e14e['id'],_0x34e14e);ChatMessageEvents[_0xaaea('0x5')](_0x562fa9,_0x34e14e);_0x36fa9e(null);};}for(var e in events){if(events[_0xaaea('0x6')](e)){var event=events[e];ChatMessage[_0xaaea('0x7')](e,emitEvent(event));}}module[_0xaaea('0x8')]=ChatMessageEvents; \ No newline at end of file +var _0xac79=['hasOwnProperty','hook','exports','events','ChatMessage','setMaxListeners','update','remove','emit'];(function(_0x228134,_0x401d05){var _0x230f1f=function(_0x4bddd3){while(--_0x4bddd3){_0x228134['push'](_0x228134['shift']());}};_0x230f1f(++_0x401d05);}(_0xac79,0x198));var _0x9ac7=function(_0x54e3ca,_0xc3736b){_0x54e3ca=_0x54e3ca-0x0;var _0x34aea8=_0xac79[_0x54e3ca];return _0x34aea8;};'use strict';var EventEmitter=require(_0x9ac7('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x9ac7('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x9ac7('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9ac7('0x3'),'afterDestroy':_0x9ac7('0x4')};function emitEvent(_0x48176e){return function(_0x59ab37,_0x374b5f,_0x1bf623){ChatMessageEvents[_0x9ac7('0x5')](_0x48176e+':'+_0x59ab37['id'],_0x59ab37);ChatMessageEvents[_0x9ac7('0x5')](_0x48176e,_0x59ab37);_0x1bf623(null);};}for(var e in events){if(events[_0x9ac7('0x6')](e)){var event=events[e];ChatMessage[_0x9ac7('0x7')](e,emitEvent(event));}}module[_0x9ac7('0x8')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 1f4c459..de6a764 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 _0x8efc=['findOne','ChatInteractionId','then','utf8mb4','utf8mb4_unicode_ci','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./chatMessage.attributes','exports','ChatMessage','chat_messages','fti_chat_messages','models','get','direction','toLowerCase','secret','UserId','ChatInteraction'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x8efc,0x1a3));var _0xc8ef=function(_0x11155f,_0x57b687){_0x11155f=_0x11155f-0x0;var _0xd07e48=_0x8efc[_0x11155f];return _0xd07e48;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc8ef('0x0'))('api');var moment=require(_0xc8ef('0x1'));var BPromise=require(_0xc8ef('0x2'));var rp=require(_0xc8ef('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc8ef('0x4'));var config=require(_0xc8ef('0x5'));var attributes=require(_0xc8ef('0x6'));module[_0xc8ef('0x7')]=function(_0x16e40c,_0x2f9903){return _0x16e40c['define'](_0xc8ef('0x8'),attributes,{'tableName':_0xc8ef('0x9'),'paranoid':![],'indexes':[{'name':_0xc8ef('0xa'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x43c53a,_0x310bc5,_0x5b2ffa){var _0x4b8f6d=_0x16e40c[_0xc8ef('0xb')];var _0x9107d6=_0x43c53a[_0xc8ef('0xc')]({'plain':!![]});if(_0x9107d6[_0xc8ef('0xd')]['toLowerCase']()==='in'||_0x9107d6[_0xc8ef('0xd')][_0xc8ef('0xe')]()==='out'&&!_0x9107d6[_0xc8ef('0xf')]&&!_['isNil'](_0x9107d6[_0xc8ef('0x10')])){_0x4b8f6d[_0xc8ef('0x11')][_0xc8ef('0x12')]({'where':{'id':_0x9107d6[_0xc8ef('0x13')]}})[_0xc8ef('0x14')](function(_0x40bd3a){if(_0x40bd3a){_0x40bd3a['update']({'lastMsgAt':_0x9107d6['createdAt'],'lastMsgDirection':_0x9107d6[_0xc8ef('0xd')][_0xc8ef('0xe')]()});}})['catch'](function(_0x53e30a){console['error'](_0x53e30a);});}_0x5b2ffa();}},'charset':_0xc8ef('0x15'),'collate':_0xc8ef('0x16')});}; \ No newline at end of file +var _0x944e=['UserId','ChatInteractionId','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./chatMessage.attributes','exports','define','chat_messages','body','models','direction','toLowerCase','out','secret','isNil'];(function(_0x56b8eb,_0x1b90ab){var _0x31494f=function(_0x865155){while(--_0x865155){_0x56b8eb['push'](_0x56b8eb['shift']());}};_0x31494f(++_0x1b90ab);}(_0x944e,0x89));var _0xe944=function(_0x4b64bf,_0x2b4781){_0x4b64bf=_0x4b64bf-0x0;var _0x19247b=_0x944e[_0x4b64bf];return _0x19247b;};'use strict';var _=require(_0xe944('0x0'));var util=require(_0xe944('0x1'));var logger=require(_0xe944('0x2'))(_0xe944('0x3'));var moment=require(_0xe944('0x4'));var BPromise=require('bluebird');var rp=require(_0xe944('0x5'));var fs=require('fs');var path=require(_0xe944('0x6'));var rimraf=require('rimraf');var config=require(_0xe944('0x7'));var attributes=require(_0xe944('0x8'));module[_0xe944('0x9')]=function(_0x438ecc,_0x10f814){return _0x438ecc[_0xe944('0xa')]('ChatMessage',attributes,{'tableName':_0xe944('0xb'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0xe944('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x53fad0,_0x564209,_0xe921d7){var _0x5025b8=_0x438ecc[_0xe944('0xd')];var _0x118f1e=_0x53fad0['get']({'plain':!![]});if(_0x118f1e[_0xe944('0xe')][_0xe944('0xf')]()==='in'||_0x118f1e['direction'][_0xe944('0xf')]()===_0xe944('0x10')&&!_0x118f1e[_0xe944('0x11')]&&!_[_0xe944('0x12')](_0x118f1e[_0xe944('0x13')])){_0x5025b8['ChatInteraction']['findOne']({'where':{'id':_0x118f1e[_0xe944('0x14')]}})['then'](function(_0x1b3182){if(_0x1b3182){_0x1b3182[_0xe944('0x15')]({'lastMsgAt':_0x118f1e[_0xe944('0x16')],'lastMsgDirection':_0x118f1e['direction'][_0xe944('0xf')]()});}})[_0xe944('0x17')](function(_0x26c046){console['error'](_0x26c046);});}_0xe921d7();}},'charset':_0xe944('0x18'),'collate':_0xe944('0x19')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 71c5cf0..8b7d047 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 _0xa7d9=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','defaults','redis','localhost','./chatMessage.socket','register','request','then','info','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatMessage,\x20%s,\x20%s','message','result','catch','CreateChatMessage','ChatMessage','create','body','lodash','util','bluebird','randomstring','ioredis'];(function(_0x3b19ea,_0x518b6b){var _0x40ece9=function(_0x3a3386){while(--_0x3a3386){_0x3b19ea['push'](_0x3b19ea['shift']());}};_0x40ece9(++_0x518b6b);}(_0xa7d9,0x6f));var _0x9a7d=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xa7d9[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x9a7d('0x0'));var util=require(_0x9a7d('0x1'));var moment=require('moment');var BPromise=require(_0x9a7d('0x2'));var rs=require(_0x9a7d('0x3'));var fs=require('fs');var Redis=require(_0x9a7d('0x4'));var db=require(_0x9a7d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9a7d('0x6'))('rpc');var config=require(_0x9a7d('0x7'));var jayson=require(_0x9a7d('0x8'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x9a7d('0x9')](config[_0x9a7d('0xa')],{'host':_0x9a7d('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9a7d('0xa')]));require(_0x9a7d('0xc'))[_0x9a7d('0xd')](socket);function respondWithRpcPromise(_0x3cfe3b,_0x4b7b13,_0xa26be){return new BPromise(function(_0x1b2550,_0x6826d1){return client[_0x9a7d('0xe')](_0x3cfe3b,_0xa26be)[_0x9a7d('0xf')](function(_0x11ea9d){logger[_0x9a7d('0x10')]('ChatMessage,\x20%s,\x20%s',_0x4b7b13,_0x9a7d('0x11'));logger['debug'](_0x9a7d('0x12'),_0x4b7b13,_0x9a7d('0x11'),JSON[_0x9a7d('0x13')](_0x11ea9d));if(_0x11ea9d['error']){if(_0x11ea9d[_0x9a7d('0x14')]['code']===0x1f4){logger[_0x9a7d('0x14')](_0x9a7d('0x15'),_0x4b7b13,_0x11ea9d[_0x9a7d('0x14')][_0x9a7d('0x16')]);return _0x6826d1(_0x11ea9d[_0x9a7d('0x14')]['message']);}logger[_0x9a7d('0x14')]('ChatMessage,\x20%s,\x20%s',_0x4b7b13,_0x11ea9d[_0x9a7d('0x14')]['message']);return _0x1b2550(_0x11ea9d[_0x9a7d('0x14')][_0x9a7d('0x16')]);}else{logger[_0x9a7d('0x10')]('ChatMessage,\x20%s,\x20%s',_0x4b7b13,'request\x20sent');_0x1b2550(_0x11ea9d[_0x9a7d('0x17')]['message']);}})[_0x9a7d('0x18')](function(_0x2bdfa6){logger[_0x9a7d('0x14')](_0x9a7d('0x15'),_0x4b7b13,_0x2bdfa6);_0x6826d1(_0x2bdfa6);});});}exports[_0x9a7d('0x19')]=function(_0x406161){var _0x51711f=this;return new Promise(function(_0x3aefed,_0x408392){return db[_0x9a7d('0x1a')][_0x9a7d('0x1b')](_0x406161[_0x9a7d('0x1c')],{'raw':_0x406161['options']?_0x406161['options']['raw']===undefined?!![]:![]:!![]})[_0x9a7d('0xf')](function(_0x19013b){logger[_0x9a7d('0x10')]('CreateChatMessage',_0x406161);logger['debug'](_0x9a7d('0x19'),_0x406161,JSON[_0x9a7d('0x13')](_0x19013b));_0x3aefed(_0x19013b);})[_0x9a7d('0x18')](function(_0x6c77ff){logger[_0x9a7d('0x14')]('CreateChatMessage',_0x6c77ff['message'],_0x406161);_0x408392(_0x51711f[_0x9a7d('0x14')](0x1f4,_0x6c77ff[_0x9a7d('0x16')]));});});}; \ No newline at end of file +var _0xe4d5=['CreateChatMessage','ChatMessage','create','options','debug','stringify','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','request\x20sent','error','code','message','ChatMessage,\x20%s,\x20%s','result'];(function(_0x28366e,_0x2ac7e1){var _0x37637b=function(_0x1c9257){while(--_0x1c9257){_0x28366e['push'](_0x28366e['shift']());}};_0x37637b(++_0x2ac7e1);}(_0xe4d5,0x147));var _0x5e4d=function(_0x5a07a2,_0x32f99c){_0x5a07a2=_0x5a07a2-0x0;var _0x2238fe=_0xe4d5[_0x5a07a2];return _0x2238fe;};'use strict';var _=require(_0x5e4d('0x0'));var util=require(_0x5e4d('0x1'));var moment=require(_0x5e4d('0x2'));var BPromise=require(_0x5e4d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5e4d('0x4'));var db=require(_0x5e4d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5e4d('0x6'))(_0x5e4d('0x7'));var config=require('../../config/environment');var jayson=require(_0x5e4d('0x8'));var client=jayson[_0x5e4d('0x9')][_0x5e4d('0xa')]({'port':0x232a});config[_0x5e4d('0xb')]=_['defaults'](config[_0x5e4d('0xb')],{'host':_0x5e4d('0xc'),'port':0x18eb});var socket=require(_0x5e4d('0xd'))(new Redis(config['redis']));require(_0x5e4d('0xe'))[_0x5e4d('0xf')](socket);function respondWithRpcPromise(_0x41e8bf,_0x32c28f,_0x4ad521){return new BPromise(function(_0x1f40f8,_0xe00aa0){return client[_0x5e4d('0x10')](_0x41e8bf,_0x4ad521)[_0x5e4d('0x11')](function(_0x8a00b3){logger[_0x5e4d('0x12')]('ChatMessage,\x20%s,\x20%s',_0x32c28f,'request\x20sent');logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x32c28f,_0x5e4d('0x13'),JSON['stringify'](_0x8a00b3));if(_0x8a00b3[_0x5e4d('0x14')]){if(_0x8a00b3[_0x5e4d('0x14')][_0x5e4d('0x15')]===0x1f4){logger[_0x5e4d('0x14')]('ChatMessage,\x20%s,\x20%s',_0x32c28f,_0x8a00b3['error']['message']);return _0xe00aa0(_0x8a00b3[_0x5e4d('0x14')][_0x5e4d('0x16')]);}logger[_0x5e4d('0x14')](_0x5e4d('0x17'),_0x32c28f,_0x8a00b3[_0x5e4d('0x14')][_0x5e4d('0x16')]);return _0x1f40f8(_0x8a00b3['error'][_0x5e4d('0x16')]);}else{logger[_0x5e4d('0x12')](_0x5e4d('0x17'),_0x32c28f,'request\x20sent');_0x1f40f8(_0x8a00b3[_0x5e4d('0x18')][_0x5e4d('0x16')]);}})['catch'](function(_0x2ce9ed){logger[_0x5e4d('0x14')](_0x5e4d('0x17'),_0x32c28f,_0x2ce9ed);_0xe00aa0(_0x2ce9ed);});});}exports[_0x5e4d('0x19')]=function(_0x4059f9){var _0x2a968e=this;return new Promise(function(_0x147275,_0x1e0a53){return db[_0x5e4d('0x1a')][_0x5e4d('0x1b')](_0x4059f9['body'],{'raw':_0x4059f9[_0x5e4d('0x1c')]?_0x4059f9[_0x5e4d('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x5e4d('0x11')](function(_0x47ae81){logger[_0x5e4d('0x12')](_0x5e4d('0x19'),_0x4059f9);logger[_0x5e4d('0x1d')](_0x5e4d('0x19'),_0x4059f9,JSON[_0x5e4d('0x1e')](_0x47ae81));_0x147275(_0x47ae81);})[_0x5e4d('0x1f')](function(_0x56d7c1){logger[_0x5e4d('0x14')](_0x5e4d('0x19'),_0x56d7c1[_0x5e4d('0x16')],_0x4059f9);_0x1e0a53(_0x2a968e['error'](0x1f4,_0x56d7c1[_0x5e4d('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 2dbf860..ca9af51 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 _0xf725=['./chatMessage.events','save','remove','update','emit','register','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf725,0x7e));var _0x5f72=function(_0x4bf2ed,_0x503c67){_0x4bf2ed=_0x4bf2ed-0x0;var _0x99a893=_0xf725[_0x4bf2ed];return _0x99a893;};'use strict';var ChatMessageEvents=require(_0x5f72('0x0'));var events=[_0x5f72('0x1'),_0x5f72('0x2'),_0x5f72('0x3')];function createListener(_0x1ab380,_0x2fb465){return function(_0x3f7b69){_0x2fb465[_0x5f72('0x4')](_0x1ab380,_0x3f7b69);};}function removeListener(_0x4200ff,_0x17a5bc){return function(){ChatMessageEvents['removeListener'](_0x4200ff,_0x17a5bc);};}exports[_0x5f72('0x5')]=function(_0x14a92d){for(var _0x3f2ca7=0x0,_0x193393=events[_0x5f72('0x6')];_0x3f2ca7<_0x193393;_0x3f2ca7++){var _0x4961d1=events[_0x3f2ca7];var _0x158aa3=createListener('chatMessage:'+_0x4961d1,_0x14a92d);ChatMessageEvents['on'](_0x4961d1,_0x158aa3);}}; \ No newline at end of file +var _0x04f9=['emit','removeListener','length','chatMessage:','save','remove','update'];(function(_0x23a042,_0x169361){var _0x57543a=function(_0x1fccec){while(--_0x1fccec){_0x23a042['push'](_0x23a042['shift']());}};_0x57543a(++_0x169361);}(_0x04f9,0xb3));var _0x904f=function(_0xd4ee3c,_0x1ec548){_0xd4ee3c=_0xd4ee3c-0x0;var _0x501fba=_0x04f9[_0xd4ee3c];return _0x501fba;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x904f('0x0'),_0x904f('0x1'),_0x904f('0x2')];function createListener(_0x563e97,_0x18baf7){return function(_0x81ba22){_0x18baf7[_0x904f('0x3')](_0x563e97,_0x81ba22);};}function removeListener(_0x8cc251,_0x243fb2){return function(){ChatMessageEvents[_0x904f('0x4')](_0x8cc251,_0x243fb2);};}exports['register']=function(_0x4e5a0c){for(var _0x2bcb2a=0x0,_0x175c38=events[_0x904f('0x5')];_0x2bcb2a<_0x175c38;_0x2bcb2a++){var _0x34cbd7=events[_0x2bcb2a];var _0x506239=createListener(_0x904f('0x6')+_0x34cbd7,_0x4e5a0c);ChatMessageEvents['on'](_0x34cbd7,_0x506239);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index c6daef0..6637d13 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 _0x2504=['put','/:id/accept','accept','/:id/reject','delete','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','tracked','chat','chatmessage:create','create','update'];(function(_0x519ea1,_0x200818){var _0x365af3=function(_0x1d264b){while(--_0x1d264b){_0x519ea1['push'](_0x519ea1['shift']());}};_0x365af3(++_0x200818);}(_0x2504,0x1ae));var _0x4250=function(_0x942a4f,_0x4c4a7e){_0x942a4f=_0x942a4f-0x0;var _0xcf37fb=_0x2504[_0x942a4f];return _0xcf37fb;};'use strict';var multer=require('multer');var util=require(_0x4250('0x0'));var path=require(_0x4250('0x1'));var timeout=require(_0x4250('0x2'));var express=require(_0x4250('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4250('0x4'));var config=require(_0x4250('0x5'));var controller=require(_0x4250('0x6'));router[_0x4250('0x7')]('/',auth['isAuthenticated'](),controller[_0x4250('0x8')]);router['get'](_0x4250('0x9'),auth[_0x4250('0xa')](),controller[_0x4250('0xb')]);router[_0x4250('0x7')](_0x4250('0xc'),auth[_0x4250('0xa')](),controller[_0x4250('0xd')]);router[_0x4250('0xe')]('/',auth[_0x4250('0xa')](),interaction[_0x4250('0xf')](_0x4250('0x10'),_0x4250('0x11')),controller[_0x4250('0x12')]);router['put'](_0x4250('0xc'),controller[_0x4250('0x13')]);router[_0x4250('0x14')](_0x4250('0x15'),auth[_0x4250('0xa')](),controller[_0x4250('0x16')]);router[_0x4250('0x14')](_0x4250('0x17'),auth['isAuthenticated'](),controller['reject']);router[_0x4250('0x18')](_0x4250('0xc'),auth[_0x4250('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x4fd7=['show','tracked','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x4fd7,0x15b));var _0x74fd=function(_0x2ef56e,_0x1c8924){_0x2ef56e=_0x2ef56e-0x0;var _0x2adc73=_0x4fd7[_0x2ef56e];return _0x2adc73;};'use strict';var multer=require('multer');var util=require(_0x74fd('0x0'));var path=require(_0x74fd('0x1'));var timeout=require(_0x74fd('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x74fd('0x3'));var auth=require(_0x74fd('0x4'));var interaction=require(_0x74fd('0x5'));var config=require(_0x74fd('0x6'));var controller=require(_0x74fd('0x7'));router[_0x74fd('0x8')]('/',auth[_0x74fd('0x9')](),controller[_0x74fd('0xa')]);router[_0x74fd('0x8')](_0x74fd('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x74fd('0x8')](_0x74fd('0xc'),auth['isAuthenticated'](),controller[_0x74fd('0xd')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x74fd('0xe')]('chat',_0x74fd('0xf')),controller[_0x74fd('0x10')]);router[_0x74fd('0x11')](_0x74fd('0xc'),controller[_0x74fd('0x12')]);router['put'](_0x74fd('0x13'),auth[_0x74fd('0x9')](),controller[_0x74fd('0x14')]);router[_0x74fd('0x11')](_0x74fd('0x15'),auth['isAuthenticated'](),controller[_0x74fd('0x16')]);router['delete']('/:id',auth[_0x74fd('0x9')](),controller['destroy']);module[_0x74fd('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 c95145c..1f8560f 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 _0x5f2f=['exports','TEXT','medium','sequelize'];(function(_0x24fbde,_0x1ba2e8){var _0x5f2e1e=function(_0x371520){while(--_0x371520){_0x24fbde['push'](_0x24fbde['shift']());}};_0x5f2e1e(++_0x1ba2e8);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1050a8,_0x3c4fc7){_0x1050a8=_0x1050a8-0x0;var _0xaff181=_0x5f2f[_0x1050a8];return _0xaff181;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'body':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]}}; \ No newline at end of file +var _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0xdc8d0e,_0x15055a){var _0x10b4d0=function(_0x38088c){while(--_0x38088c){_0xdc8d0e['push'](_0xdc8d0e['shift']());}};_0x10b4d0(++_0x15055a);}(_0xdb28,0x106));var _0x8db2=function(_0xbced30,_0x46c175){_0xbced30=_0xbced30-0x0;var _0xd4b034=_0xdb28[_0xbced30];return _0xd4b034;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x8db2('0x3')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 17e52e2..df7c6a2 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(_0x3e5ec8,_0x36a6d0){var _0x4baffc=function(_0x81defe){while(--_0x81defe){_0x3e5ec8['push'](_0x3e5ec8['shift']());}};_0x4baffc(++_0x36a6d0);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'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 _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(_0x31a22a,_0x1e5e74){var _0x4cc9a5=function(_0x27ff45){while(--_0x27ff45){_0x31a22a['push'](_0x31a22a['shift']());}};_0x4cc9a5(++_0x1e5e74);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index 5e42946..8a77912 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7bd9=['save','emit','hasOwnProperty','hook','events','setMaxListeners'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7bd9,0xee));var _0x97bd=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x7bd9[_0x6131cd];return _0x47e916;};'use strict';var EventEmitter=require(_0x97bd('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x97bd('0x1')](0x0);var events={'afterCreate':_0x97bd('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xb521e2){return function(_0x1ca13d,_0x45d8dd,_0x5d8d33){ChatOfflineMessageEvents['emit'](_0xb521e2+':'+_0x1ca13d['id'],_0x1ca13d);ChatOfflineMessageEvents[_0x97bd('0x3')](_0xb521e2,_0x1ca13d);_0x5d8d33(null);};}for(var e in events){if(events[_0x97bd('0x4')](e)){var event=events[e];ChatOfflineMessage[_0x97bd('0x5')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents; \ No newline at end of file +var _0x0893=['ChatOfflineMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x48a81d,_0x2b3d9e){var _0x19699a=function(_0x117ebf){while(--_0x117ebf){_0x48a81d['push'](_0x48a81d['shift']());}};_0x19699a(++_0x2b3d9e);}(_0x0893,0x138));var _0x3089=function(_0x58b55a,_0x3d9f9c){_0x58b55a=_0x58b55a-0x0;var _0x588ba2=_0x0893[_0x58b55a];return _0x588ba2;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require('../../mysqldb')['db'][_0x3089('0x0')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x3089('0x1')](0x0);var events={'afterCreate':_0x3089('0x2'),'afterUpdate':_0x3089('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3fc975){return function(_0x5c91b7,_0x41c65f,_0x1575f6){ChatOfflineMessageEvents[_0x3089('0x4')](_0x3fc975+':'+_0x5c91b7['id'],_0x5c91b7);ChatOfflineMessageEvents[_0x3089('0x4')](_0x3fc975,_0x5c91b7);_0x1575f6(null);};}for(var e in events){if(events[_0x3089('0x5')](e)){var event=events[e];ChatOfflineMessage[_0x3089('0x6')](e,emitEvent(event));}}module[_0x3089('0x7')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 7603ca5..ae67077 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 _0x6350=['utf8mb4_unicode_ci','./chatOfflineMessage.attributes','ChatOfflineMessage','chat_offline_messages','utf8mb4'];(function(_0x674b81,_0x10dd39){var _0x5500f1=function(_0x5b275a){while(--_0x5b275a){_0x674b81['push'](_0x674b81['shift']());}};_0x5500f1(++_0x10dd39);}(_0x6350,0xd3));var _0x0635=function(_0x4c9764,_0x1a197f){_0x4c9764=_0x4c9764-0x0;var _0x2136af=_0x6350[_0x4c9764];return _0x2136af;};'use strict';var attributes=require(_0x0635('0x0'));module['exports']=function(_0x4357f7){return _0x4357f7['define'](_0x0635('0x1'),attributes,{'tableName':_0x0635('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0635('0x3'),'collate':_0x0635('0x4')});}; \ No newline at end of file +var _0x5477=['utf8mb4_unicode_ci','./chatOfflineMessage.attributes','define','ChatOfflineMessage','chat_offline_messages','utf8mb4'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x5477,0x163));var _0x7547=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x5477[_0x465a0c];return _0x1e202e;};'use strict';var attributes=require(_0x7547('0x0'));module['exports']=function(_0x211c99){return _0x211c99[_0x7547('0x1')](_0x7547('0x2'),attributes,{'tableName':_0x7547('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7547('0x4'),'collate':_0x7547('0x5')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 500786a..ff3eb6c 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 _0x9e0d=['util','moment','bluebird','randomstring','../../mysqldb','rpc','client','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0x18b9a8,_0x1770b6){var _0x4a0a8f=function(_0x80ea93){while(--_0x80ea93){_0x18b9a8['push'](_0x18b9a8['shift']());}};_0x4a0a8f(++_0x1770b6);}(_0x9e0d,0x12b));var _0xd9e0=function(_0x1b4170,_0x3ca8b1){_0x1b4170=_0x1b4170-0x0;var _0x39cb98=_0x9e0d[_0x1b4170];return _0x39cb98;};'use strict';var _=require(_0xd9e0('0x0'));var util=require(_0xd9e0('0x1'));var moment=require(_0xd9e0('0x2'));var BPromise=require(_0xd9e0('0x3'));var rs=require(_0xd9e0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd9e0('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd9e0('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd9e0('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45cc1c,_0x291ae4,_0x15f33c){return new BPromise(function(_0x51d672,_0x1b0a6b){return client[_0xd9e0('0x8')](_0x45cc1c,_0x15f33c)[_0xd9e0('0x9')](function(_0x28fa88){logger[_0xd9e0('0xa')](_0xd9e0('0xb'),_0x291ae4,_0xd9e0('0xc'));logger[_0xd9e0('0xd')](_0xd9e0('0xe'),_0x291ae4,_0xd9e0('0xc'),JSON[_0xd9e0('0xf')](_0x28fa88));if(_0x28fa88[_0xd9e0('0x10')]){if(_0x28fa88['error']['code']===0x1f4){logger[_0xd9e0('0x10')](_0xd9e0('0xb'),_0x291ae4,_0x28fa88[_0xd9e0('0x10')]['message']);return _0x1b0a6b(_0x28fa88['error']['message']);}logger[_0xd9e0('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x291ae4,_0x28fa88['error'][_0xd9e0('0x11')]);return _0x51d672(_0x28fa88['error']['message']);}else{logger[_0xd9e0('0xa')]('ChatOfflineMessage,\x20%s,\x20%s',_0x291ae4,_0xd9e0('0xc'));_0x51d672(_0x28fa88[_0xd9e0('0x12')][_0xd9e0('0x11')]);}})[_0xd9e0('0x13')](function(_0x53da81){logger[_0xd9e0('0x10')](_0xd9e0('0xb'),_0x291ae4,_0x53da81);_0x1b0a6b(_0x53da81);});});} \ No newline at end of file +var _0x0178=['ChatOfflineMessage,\x20%s,\x20%s','debug','request\x20sent','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info'];(function(_0x4a5100,_0x598828){var _0x4b2f44=function(_0x48050b){while(--_0x48050b){_0x4a5100['push'](_0x4a5100['shift']());}};_0x4b2f44(++_0x598828);}(_0x0178,0xce));var _0x8017=function(_0x1d167e,_0x359ab9){_0x1d167e=_0x1d167e-0x0;var _0x4bfb5e=_0x0178[_0x1d167e];return _0x4bfb5e;};'use strict';var _=require(_0x8017('0x0'));var util=require(_0x8017('0x1'));var moment=require(_0x8017('0x2'));var BPromise=require(_0x8017('0x3'));var rs=require(_0x8017('0x4'));var fs=require('fs');var Redis=require(_0x8017('0x5'));var db=require(_0x8017('0x6'))['db'];var utils=require(_0x8017('0x7'));var logger=require(_0x8017('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8017('0x9'));var client=jayson[_0x8017('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc844d9,_0x3899b3,_0x186d43){return new BPromise(function(_0xda8415,_0x4f9be8){return client[_0x8017('0xb')](_0xc844d9,_0x186d43)[_0x8017('0xc')](function(_0x1bda95){logger[_0x8017('0xd')](_0x8017('0xe'),_0x3899b3,'request\x20sent');logger[_0x8017('0xf')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x3899b3,_0x8017('0x10'),JSON['stringify'](_0x1bda95));if(_0x1bda95[_0x8017('0x11')]){if(_0x1bda95['error']['code']===0x1f4){logger[_0x8017('0x11')](_0x8017('0xe'),_0x3899b3,_0x1bda95[_0x8017('0x11')][_0x8017('0x12')]);return _0x4f9be8(_0x1bda95['error'][_0x8017('0x12')]);}logger[_0x8017('0x11')](_0x8017('0xe'),_0x3899b3,_0x1bda95['error'][_0x8017('0x12')]);return _0xda8415(_0x1bda95['error'][_0x8017('0x12')]);}else{logger['info'](_0x8017('0xe'),_0x3899b3,'request\x20sent');_0xda8415(_0x1bda95[_0x8017('0x13')][_0x8017('0x12')]);}})['catch'](function(_0x1a68e2){logger['error'](_0x8017('0xe'),_0x3899b3,_0x1a68e2);_0x4f9be8(_0x1a68e2);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index ed05934..423bbb3 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 _0xd7c4=['update','delete','destroy','exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','create','put'];(function(_0x49096c,_0x60cdf0){var _0x5ce846=function(_0x20c329){while(--_0x20c329){_0x49096c['push'](_0x49096c['shift']());}};_0x5ce846(++_0x60cdf0);}(_0xd7c4,0x1df));var _0x4d7c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd7c4[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x4d7c('0x0'));var express=require(_0x4d7c('0x1'));var router=express[_0x4d7c('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x4d7c('0x3'));var interaction=require(_0x4d7c('0x4'));var config=require(_0x4d7c('0x5'));var controller=require(_0x4d7c('0x6'));router[_0x4d7c('0x7')]('/',auth[_0x4d7c('0x8')](),controller[_0x4d7c('0x9')]);router[_0x4d7c('0x7')](_0x4d7c('0xa'),auth['isAuthenticated'](),controller[_0x4d7c('0xb')]);router['get'](_0x4d7c('0xc'),auth[_0x4d7c('0x8')](),controller['show']);router['post']('/',auth[_0x4d7c('0x8')](),controller[_0x4d7c('0xd')]);router[_0x4d7c('0xe')](_0x4d7c('0xc'),auth[_0x4d7c('0x8')](),controller[_0x4d7c('0xf')]);router[_0x4d7c('0x10')]('/:id',auth[_0x4d7c('0x8')](),controller[_0x4d7c('0x11')]);module[_0x4d7c('0x12')]=router; \ No newline at end of file +var _0x383f=['exports','util','connect-timeout','express','Router','../../config/environment','./chatOfflineMessage.controller','get','index','isAuthenticated','describe','/:id','show','post','create','update','delete','destroy'];(function(_0x592f08,_0x25c7b6){var _0x4cd8fb=function(_0x5887b1){while(--_0x5887b1){_0x592f08['push'](_0x592f08['shift']());}};_0x4cd8fb(++_0x25c7b6);}(_0x383f,0xb5));var _0xf383=function(_0x11aa15,_0x215f43){_0x11aa15=_0x11aa15-0x0;var _0xb8e22e=_0x383f[_0x11aa15];return _0xb8e22e;};'use strict';var multer=require('multer');var util=require(_0xf383('0x0'));var path=require('path');var timeout=require(_0xf383('0x1'));var express=require(_0xf383('0x2'));var router=express[_0xf383('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf383('0x4'));var controller=require(_0xf383('0x5'));router[_0xf383('0x6')]('/',auth['isAuthenticated'](),controller[_0xf383('0x7')]);router[_0xf383('0x6')]('/describe',auth[_0xf383('0x8')](),controller[_0xf383('0x9')]);router['get'](_0xf383('0xa'),auth[_0xf383('0x8')](),controller[_0xf383('0xb')]);router[_0xf383('0xc')]('/',auth[_0xf383('0x8')](),controller[_0xf383('0xd')]);router['put']('/:id',auth[_0xf383('0x8')](),controller[_0xf383('0xe')]);router[_0xf383('0xf')](_0xf383('0xa'),auth[_0xf383('0x8')](),controller[_0xf383('0x10')]);module[_0xf383('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 08fea3f..ffb880f 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 _0xc2a8=['ENUM','INTEGER','sequelize','exports','STRING'];(function(_0x530be9,_0x1d8a7b){var _0x128b79=function(_0xac7444){while(--_0xac7444){_0x530be9['push'](_0x530be9['shift']());}};_0x128b79(++_0x1d8a7b);}(_0xc2a8,0x15b));var _0x8c2a=function(_0x13ee22,_0xaf9e33){_0x13ee22=_0x13ee22-0x0;var _0x2ffe18=_0xc2a8[_0x13ee22];return _0x2ffe18;};'use strict';var Sequelize=require(_0x8c2a('0x0'));module[_0x8c2a('0x1')]={'name':{'type':Sequelize[_0x8c2a('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x8c2a('0x3')]('mouseOver','timeout'),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x8c2a('0x2')]},'timeout':{'type':Sequelize[_0x8c2a('0x4')]}}; \ No newline at end of file +var _0x20e9=['STRING','ENUM','mouseOver','INTEGER','sequelize','exports'];(function(_0x395e57,_0x349e66){var _0x5bb4fa=function(_0x1d3be9){while(--_0x1d3be9){_0x395e57['push'](_0x395e57['shift']());}};_0x5bb4fa(++_0x349e66);}(_0x20e9,0x166));var _0x920e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x20e9[_0x297fd3];return _0x2af381;};'use strict';var Sequelize=require(_0x920e('0x0'));module[_0x920e('0x1')]={'name':{'type':Sequelize[_0x920e('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x920e('0x3')](_0x920e('0x4'),'timeout'),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x920e('0x2')]},'timeout':{'type':Sequelize[_0x920e('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 023d51c..5a3add3 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 _0xaab2=['offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','fields','attributes','includeAll','merge','find','catch','create','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end'];(function(_0x3ad111,_0x552571){var _0x13f242=function(_0x5f3f3a){while(--_0x5f3f3a){_0x3ad111['push'](_0x3ad111['shift']());}};_0x13f242(++_0x552571);}(_0xaab2,0xca));var _0x2aab=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0xaab2[_0x2b5eae];return _0x5f3ac9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2aab('0x0'));var zipdir=require(_0x2aab('0x1'));var jsonpatch=require(_0x2aab('0x2'));var rp=require('request-promise');var moment=require(_0x2aab('0x3'));var BPromise=require(_0x2aab('0x4'));var Mustache=require(_0x2aab('0x5'));var util=require(_0x2aab('0x6'));var path=require(_0x2aab('0x7'));var sox=require('sox');var csv=require(_0x2aab('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2aab('0x9'));var _=require(_0x2aab('0xa'));var squel=require(_0x2aab('0xb'));var crypto=require(_0x2aab('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2aab('0xd'));var toCsv=require(_0x2aab('0x8'));var querystring=require(_0x2aab('0xe'));var Papa=require(_0x2aab('0xf'));var Redis=require(_0x2aab('0x10'));var authService=require(_0x2aab('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2aab('0x12'));var logger=require(_0x2aab('0x13'))('api');var utils=require(_0x2aab('0x14'));var config=require(_0x2aab('0x15'));var licenseUtil=require(_0x2aab('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x32754a,_0x3d2c09){_0x3d2c09=_0x3d2c09||0xcc;return function(_0x32d7ef){if(_0x32d7ef){return _0x32754a[_0x2aab('0x17')](_0x3d2c09);}return _0x32754a[_0x2aab('0x18')](_0x3d2c09)[_0x2aab('0x19')]();};}function respondWithResult(_0x536a85,_0x490240){_0x490240=_0x490240||0xc8;return function(_0x3039f1){if(_0x3039f1){return _0x536a85['status'](_0x490240)['json'](_0x3039f1);}};}function respondWithFilteredResult(_0x135345,_0xcabe88){return function(_0x2e5c20){if(_0x2e5c20){var _0xb0ff8c=typeof _0xcabe88[_0x2aab('0x1a')]===_0x2aab('0x1b')&&typeof _0xcabe88[_0x2aab('0x1c')]===_0x2aab('0x1b');var _0x4ebce7=_0x2e5c20[_0x2aab('0x1d')];var _0x332d6b=_0xb0ff8c?0x0:_0xcabe88[_0x2aab('0x1a')];var _0x10af82=_0xb0ff8c?_0x2e5c20[_0x2aab('0x1d')]:_0xcabe88[_0x2aab('0x1a')]+_0xcabe88[_0x2aab('0x1c')];var _0x42c628;if(_0x10af82>=_0x4ebce7){_0x10af82=_0x4ebce7;_0x42c628=0xc8;}else{_0x42c628=0xce;}_0x135345[_0x2aab('0x18')](_0x42c628);return _0x135345[_0x2aab('0x1e')](_0x2aab('0x1f'),_0x332d6b+'-'+_0x10af82+'/'+_0x4ebce7)[_0x2aab('0x20')](_0x2e5c20);}return null;};}function patchUpdates(_0x1ec2d8){return function(_0x1b4367){try{jsonpatch[_0x2aab('0x21')](_0x1b4367,_0x1ec2d8,!![]);}catch(_0x2c243f){return BPromise[_0x2aab('0x22')](_0x2c243f);}return _0x1b4367[_0x2aab('0x23')]();};}function saveUpdates(_0x1bb2bb,_0x118021){return function(_0x58aad7){if(_0x58aad7){return _0x58aad7[_0x2aab('0x24')](_0x1bb2bb)[_0x2aab('0x25')](function(_0x42544d){return _0x42544d;});}return null;};}function removeEntity(_0x4d20ab,_0x163a50){return function(_0x11bef2){if(_0x11bef2){return _0x11bef2[_0x2aab('0x26')]()[_0x2aab('0x25')](function(){_0x4d20ab[_0x2aab('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x429481,_0xde364){return function(_0x77ca0c){if(!_0x77ca0c){_0x429481[_0x2aab('0x17')](0x194);}return _0x77ca0c;};}function handleError(_0x52993a,_0x18ec3f){_0x18ec3f=_0x18ec3f||0x1f4;return function(_0x117bbb){logger['error'](_0x117bbb[_0x2aab('0x27')]);if(_0x117bbb[_0x2aab('0x28')]){delete _0x117bbb[_0x2aab('0x28')];}_0x52993a[_0x2aab('0x18')](_0x18ec3f)['send'](_0x117bbb);};}exports['show']=function(_0x1942bd,_0x2c98aa){var _0x3e7746={'raw':!![],'where':{'id':_0x1942bd[_0x2aab('0x29')]['id']}},_0x308ceb={};_0x308ceb[_0x2aab('0x2a')]=_[_0x2aab('0x2b')](db[_0x2aab('0x2c')][_0x2aab('0x2d')]);_0x308ceb[_0x2aab('0x2e')]=_[_0x2aab('0x2b')](_0x1942bd['query']);_0x308ceb[_0x2aab('0x2f')]=_[_0x2aab('0x30')](_0x308ceb[_0x2aab('0x2a')],_0x308ceb[_0x2aab('0x2e')]);_0x3e7746['attributes']=_[_0x2aab('0x30')](_0x308ceb[_0x2aab('0x2a')],qs[_0x2aab('0x31')](_0x1942bd[_0x2aab('0x2e')][_0x2aab('0x31')]));_0x3e7746['attributes']=_0x3e7746[_0x2aab('0x32')]['length']?_0x3e7746[_0x2aab('0x32')]:_0x308ceb[_0x2aab('0x2a')];if(_0x1942bd[_0x2aab('0x2e')][_0x2aab('0x33')]){_0x3e7746['include']=[{'all':!![]}];}_0x3e7746=_[_0x2aab('0x34')]({},_0x3e7746,_0x1942bd['options']);return db[_0x2aab('0x2c')][_0x2aab('0x35')](_0x3e7746)[_0x2aab('0x25')](handleEntityNotFound(_0x2c98aa,null))[_0x2aab('0x25')](respondWithResult(_0x2c98aa,null))[_0x2aab('0x36')](handleError(_0x2c98aa,null));};exports[_0x2aab('0x37')]=function(_0x23e4a4,_0xe5aa48){return db[_0x2aab('0x2c')][_0x2aab('0x37')](_0x23e4a4[_0x2aab('0x38')],{})['then'](respondWithResult(_0xe5aa48,0xc9))[_0x2aab('0x36')](handleError(_0xe5aa48,null));};exports[_0x2aab('0x24')]=function(_0x5aa55e,_0x4ee39f){if(_0x5aa55e[_0x2aab('0x38')]['id']){delete _0x5aa55e[_0x2aab('0x38')]['id'];}return db[_0x2aab('0x2c')]['find']({'where':{'id':_0x5aa55e['params']['id']}})[_0x2aab('0x25')](handleEntityNotFound(_0x4ee39f,null))[_0x2aab('0x25')](saveUpdates(_0x5aa55e[_0x2aab('0x38')],null))['then'](respondWithResult(_0x4ee39f,null))['catch'](handleError(_0x4ee39f,null));};exports['destroy']=function(_0x2cd4e8,_0x1f7bb6){return db[_0x2aab('0x2c')][_0x2aab('0x35')]({'where':{'id':_0x2cd4e8[_0x2aab('0x29')]['id']}})[_0x2aab('0x25')](handleEntityNotFound(_0x1f7bb6,null))['then'](removeEntity(_0x1f7bb6,null))['catch'](handleError(_0x1f7bb6,null));}; \ No newline at end of file +var _0xa631=['query','intersection','fields','attributes','length','merge','ChatProactiveAction','create','body','catch','find','params','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','error','name','send','show','model','keys','rawAttributes'];(function(_0x1ec087,_0x357bbe){var _0x598a75=function(_0x1711c2){while(--_0x1711c2){_0x1ec087['push'](_0x1ec087['shift']());}};_0x598a75(++_0x357bbe);}(_0xa631,0xe4));var _0x1a63=function(_0x1ce2b8,_0x31a354){_0x1ce2b8=_0x1ce2b8-0x0;var _0x2a5ee3=_0xa631[_0x1ce2b8];return _0x2a5ee3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1a63('0x0'));var zipdir=require(_0x1a63('0x1'));var jsonpatch=require(_0x1a63('0x2'));var rp=require('request-promise');var moment=require(_0x1a63('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1a63('0x4'));var path=require(_0x1a63('0x5'));var sox=require(_0x1a63('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1a63('0x7'));var crypto=require(_0x1a63('0x8'));var jsforce=require(_0x1a63('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1a63('0xa'));var Papa=require(_0x1a63('0xb'));var Redis=require(_0x1a63('0xc'));var authService=require(_0x1a63('0xd'));var qs=require(_0x1a63('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1a63('0xf'));var logger=require(_0x1a63('0x10'))(_0x1a63('0x11'));var utils=require(_0x1a63('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x1a63('0x13'));var db=require(_0x1a63('0x14'))['db'];function respondWithStatusCode(_0x32269d,_0x55307f){_0x55307f=_0x55307f||0xcc;return function(_0xd7e70c){if(_0xd7e70c){return _0x32269d['sendStatus'](_0x55307f);}return _0x32269d[_0x1a63('0x15')](_0x55307f)[_0x1a63('0x16')]();};}function respondWithResult(_0x44bf20,_0x5301b6){_0x5301b6=_0x5301b6||0xc8;return function(_0x5b4ab8){if(_0x5b4ab8){return _0x44bf20[_0x1a63('0x15')](_0x5301b6)[_0x1a63('0x17')](_0x5b4ab8);}};}function respondWithFilteredResult(_0x436623,_0x3756e2){return function(_0x1c1e8c){if(_0x1c1e8c){var _0x4d66d4=typeof _0x3756e2[_0x1a63('0x18')]==='undefined'&&typeof _0x3756e2[_0x1a63('0x19')]===_0x1a63('0x1a');var _0x6a72c1=_0x1c1e8c[_0x1a63('0x1b')];var _0x52fdd1=_0x4d66d4?0x0:_0x3756e2[_0x1a63('0x18')];var _0x365ab8=_0x4d66d4?_0x1c1e8c[_0x1a63('0x1b')]:_0x3756e2[_0x1a63('0x18')]+_0x3756e2[_0x1a63('0x19')];var _0x491c8a;if(_0x365ab8>=_0x6a72c1){_0x365ab8=_0x6a72c1;_0x491c8a=0xc8;}else{_0x491c8a=0xce;}_0x436623[_0x1a63('0x15')](_0x491c8a);return _0x436623[_0x1a63('0x1c')]('Content-Range',_0x52fdd1+'-'+_0x365ab8+'/'+_0x6a72c1)[_0x1a63('0x17')](_0x1c1e8c);}return null;};}function patchUpdates(_0x444406){return function(_0x1e15a3){try{jsonpatch[_0x1a63('0x1d')](_0x1e15a3,_0x444406,!![]);}catch(_0x24646d){return BPromise[_0x1a63('0x1e')](_0x24646d);}return _0x1e15a3[_0x1a63('0x1f')]();};}function saveUpdates(_0x547d78,_0x3e4b57){return function(_0x524469){if(_0x524469){return _0x524469[_0x1a63('0x20')](_0x547d78)[_0x1a63('0x21')](function(_0x529be7){return _0x529be7;});}return null;};}function removeEntity(_0x564f9a,_0x58ff2){return function(_0x2c1a1f){if(_0x2c1a1f){return _0x2c1a1f[_0x1a63('0x22')]()[_0x1a63('0x21')](function(){_0x564f9a[_0x1a63('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x233b12,_0x22b4e1){return function(_0x3b551f){if(!_0x3b551f){_0x233b12['sendStatus'](0x194);}return _0x3b551f;};}function handleError(_0x471f63,_0x41e05e){_0x41e05e=_0x41e05e||0x1f4;return function(_0x81548f){logger[_0x1a63('0x23')](_0x81548f['stack']);if(_0x81548f['name']){delete _0x81548f[_0x1a63('0x24')];}_0x471f63[_0x1a63('0x15')](_0x41e05e)[_0x1a63('0x25')](_0x81548f);};}exports[_0x1a63('0x26')]=function(_0xa125b3,_0x399570){var _0x5e6eee={'raw':!![],'where':{'id':_0xa125b3['params']['id']}},_0x177171={};_0x177171[_0x1a63('0x27')]=_[_0x1a63('0x28')](db['ChatProactiveAction'][_0x1a63('0x29')]);_0x177171[_0x1a63('0x2a')]=_[_0x1a63('0x28')](_0xa125b3[_0x1a63('0x2a')]);_0x177171['filters']=_['intersection'](_0x177171[_0x1a63('0x27')],_0x177171[_0x1a63('0x2a')]);_0x5e6eee['attributes']=_[_0x1a63('0x2b')](_0x177171[_0x1a63('0x27')],qs[_0x1a63('0x2c')](_0xa125b3[_0x1a63('0x2a')][_0x1a63('0x2c')]));_0x5e6eee[_0x1a63('0x2d')]=_0x5e6eee['attributes'][_0x1a63('0x2e')]?_0x5e6eee[_0x1a63('0x2d')]:_0x177171[_0x1a63('0x27')];if(_0xa125b3[_0x1a63('0x2a')]['includeAll']){_0x5e6eee['include']=[{'all':!![]}];}_0x5e6eee=_[_0x1a63('0x2f')]({},_0x5e6eee,_0xa125b3['options']);return db[_0x1a63('0x30')]['find'](_0x5e6eee)[_0x1a63('0x21')](handleEntityNotFound(_0x399570,null))[_0x1a63('0x21')](respondWithResult(_0x399570,null))['catch'](handleError(_0x399570,null));};exports[_0x1a63('0x31')]=function(_0x1cb941,_0x20b129){return db[_0x1a63('0x30')]['create'](_0x1cb941[_0x1a63('0x32')],{})[_0x1a63('0x21')](respondWithResult(_0x20b129,0xc9))[_0x1a63('0x33')](handleError(_0x20b129,null));};exports[_0x1a63('0x20')]=function(_0x3954a6,_0xbe34e1){if(_0x3954a6['body']['id']){delete _0x3954a6['body']['id'];}return db[_0x1a63('0x30')][_0x1a63('0x34')]({'where':{'id':_0x3954a6[_0x1a63('0x35')]['id']}})[_0x1a63('0x21')](handleEntityNotFound(_0xbe34e1,null))[_0x1a63('0x21')](saveUpdates(_0x3954a6[_0x1a63('0x32')],null))['then'](respondWithResult(_0xbe34e1,null))[_0x1a63('0x33')](handleError(_0xbe34e1,null));};exports['destroy']=function(_0x59f1bc,_0x4c0f37){return db['ChatProactiveAction'][_0x1a63('0x34')]({'where':{'id':_0x59f1bc['params']['id']}})[_0x1a63('0x21')](handleEntityNotFound(_0x4c0f37,null))['then'](removeEntity(_0x4c0f37,null))[_0x1a63('0x33')](handleError(_0x4c0f37,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 8706037..1fd5417 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 _0x0a73=['path','rimraf','./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions','util','api','moment','bluebird','request-promise'];(function(_0x4cbc8b,_0x3ba785){var _0x58e1d2=function(_0x3dc36){while(--_0x3dc36){_0x4cbc8b['push'](_0x4cbc8b['shift']());}};_0x58e1d2(++_0x3ba785);}(_0x0a73,0x13a));var _0x30a7=function(_0x2d2258,_0x2ce510){_0x2d2258=_0x2d2258-0x0;var _0x18e155=_0x0a73[_0x2d2258];return _0x18e155;};'use strict';var _=require('lodash');var util=require(_0x30a7('0x0'));var logger=require('../../config/logger')(_0x30a7('0x1'));var moment=require(_0x30a7('0x2'));var BPromise=require(_0x30a7('0x3'));var rp=require(_0x30a7('0x4'));var fs=require('fs');var path=require(_0x30a7('0x5'));var rimraf=require(_0x30a7('0x6'));var config=require('../../config/environment');var attributes=require(_0x30a7('0x7'));module['exports']=function(_0xab6e89,_0x176628){return _0xab6e89[_0x30a7('0x8')](_0x30a7('0x9'),attributes,{'tableName':_0x30a7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0469=['rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','util','api','moment','bluebird','request-promise','path'];(function(_0x48fdbb,_0x3239bd){var _0x198205=function(_0x1dd8c6){while(--_0x1dd8c6){_0x48fdbb['push'](_0x48fdbb['shift']());}};_0x198205(++_0x3239bd);}(_0x0469,0xe4));var _0x9046=function(_0x37edf6,_0x1ef3a8){_0x37edf6=_0x37edf6-0x0;var _0xbf0705=_0x0469[_0x37edf6];return _0xbf0705;};'use strict';var _=require('lodash');var util=require(_0x9046('0x0'));var logger=require('../../config/logger')(_0x9046('0x1'));var moment=require(_0x9046('0x2'));var BPromise=require(_0x9046('0x3'));var rp=require(_0x9046('0x4'));var fs=require('fs');var path=require(_0x9046('0x5'));var rimraf=require(_0x9046('0x6'));var config=require(_0x9046('0x7'));var attributes=require(_0x9046('0x8'));module[_0x9046('0x9')]=function(_0x17fd9c,_0x3a371e){return _0x17fd9c[_0x9046('0xa')](_0x9046('0xb'),attributes,{'tableName':_0x9046('0xc'),'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 0c82e7c..287e49b 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 _0x0008=['request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatProactiveAction,\x20%s,\x20%s'];(function(_0x101d35,_0x4216d0){var _0x5a4206=function(_0x3269bd){while(--_0x3269bd){_0x101d35['push'](_0x101d35['shift']());}};_0x5a4206(++_0x4216d0);}(_0x0008,0x1b8));var _0x8000=function(_0x353abb,_0x194c80){_0x353abb=_0x353abb-0x0;var _0x43c9c5=_0x0008[_0x353abb];return _0x43c9c5;};'use strict';var _=require(_0x8000('0x0'));var util=require(_0x8000('0x1'));var moment=require(_0x8000('0x2'));var BPromise=require(_0x8000('0x3'));var rs=require(_0x8000('0x4'));var fs=require('fs');var Redis=require(_0x8000('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8000('0x6'));var logger=require(_0x8000('0x7'))(_0x8000('0x8'));var config=require(_0x8000('0x9'));var jayson=require(_0x8000('0xa'));var client=jayson[_0x8000('0xb')][_0x8000('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xa6b60f,_0x4af877,_0xcc464c){return new BPromise(function(_0x9786e7,_0x53e367){return client['request'](_0xa6b60f,_0xcc464c)[_0x8000('0xd')](function(_0x47be8e){logger[_0x8000('0xe')](_0x8000('0xf'),_0x4af877,_0x8000('0x10'));logger[_0x8000('0x11')](_0x8000('0x12'),_0x4af877,_0x8000('0x10'),JSON[_0x8000('0x13')](_0x47be8e));if(_0x47be8e[_0x8000('0x14')]){if(_0x47be8e['error'][_0x8000('0x15')]===0x1f4){logger[_0x8000('0x14')](_0x8000('0xf'),_0x4af877,_0x47be8e[_0x8000('0x14')][_0x8000('0x16')]);return _0x53e367(_0x47be8e['error'][_0x8000('0x16')]);}logger[_0x8000('0x14')](_0x8000('0xf'),_0x4af877,_0x47be8e[_0x8000('0x14')][_0x8000('0x16')]);return _0x9786e7(_0x47be8e[_0x8000('0x14')][_0x8000('0x16')]);}else{logger[_0x8000('0xe')](_0x8000('0xf'),_0x4af877,_0x8000('0x10'));_0x9786e7(_0x47be8e[_0x8000('0x17')][_0x8000('0x16')]);}})['catch'](function(_0x3664c6){logger[_0x8000('0x14')]('ChatProactiveAction,\x20%s,\x20%s',_0x4af877,_0x3664c6);_0x53e367(_0x3664c6);});});} \ No newline at end of file +var _0xc2f7=['info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x5cab28,_0x307622){var _0xa3554d=function(_0x330139){while(--_0x330139){_0x5cab28['push'](_0x5cab28['shift']());}};_0xa3554d(++_0x307622);}(_0xc2f7,0x1d4));var _0x7c2f=function(_0xb7da38,_0x488bcc){_0xb7da38=_0xb7da38-0x0;var _0x12749f=_0xc2f7[_0xb7da38];return _0x12749f;};'use strict';var _=require(_0x7c2f('0x0'));var util=require(_0x7c2f('0x1'));var moment=require(_0x7c2f('0x2'));var BPromise=require(_0x7c2f('0x3'));var rs=require(_0x7c2f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7c2f('0x5'))(_0x7c2f('0x6'));var config=require(_0x7c2f('0x7'));var jayson=require(_0x7c2f('0x8'));var client=jayson[_0x7c2f('0x9')][_0x7c2f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41f40c,_0x5adc32,_0x2ee20d){return new BPromise(function(_0x5217b2,_0x156bd3){return client['request'](_0x41f40c,_0x2ee20d)[_0x7c2f('0xb')](function(_0x34ebaf){logger[_0x7c2f('0xc')](_0x7c2f('0xd'),_0x5adc32,_0x7c2f('0xe'));logger[_0x7c2f('0xf')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x5adc32,_0x7c2f('0xe'),JSON['stringify'](_0x34ebaf));if(_0x34ebaf['error']){if(_0x34ebaf[_0x7c2f('0x10')]['code']===0x1f4){logger['error'](_0x7c2f('0xd'),_0x5adc32,_0x34ebaf[_0x7c2f('0x10')][_0x7c2f('0x11')]);return _0x156bd3(_0x34ebaf[_0x7c2f('0x10')]['message']);}logger[_0x7c2f('0x10')](_0x7c2f('0xd'),_0x5adc32,_0x34ebaf['error'][_0x7c2f('0x11')]);return _0x5217b2(_0x34ebaf[_0x7c2f('0x10')][_0x7c2f('0x11')]);}else{logger[_0x7c2f('0xc')](_0x7c2f('0xd'),_0x5adc32,_0x7c2f('0xe'));_0x5217b2(_0x34ebaf[_0x7c2f('0x12')][_0x7c2f('0x11')]);}})[_0x7c2f('0x13')](function(_0x3e43b5){logger['error'](_0x7c2f('0xd'),_0x5adc32,_0x3e43b5);_0x156bd3(_0x3e43b5);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 7b71097..d937627 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 _0xa630=['/:id','show','post','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','express','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get'];(function(_0x234551,_0x484d7c){var _0x531d90=function(_0x2aae0b){while(--_0x2aae0b){_0x234551['push'](_0x234551['shift']());}};_0x531d90(++_0x484d7c);}(_0xa630,0xbe));var _0x0a63=function(_0x4204fb,_0x3921e3){_0x4204fb=_0x4204fb-0x0;var _0x4854fa=_0xa630[_0x4204fb];return _0x4854fa;};'use strict';var multer=require(_0x0a63('0x0'));var util=require(_0x0a63('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0a63('0x2'));var router=express['Router']();var fs_extra=require(_0x0a63('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0a63('0x4'));var config=require(_0x0a63('0x5'));var controller=require(_0x0a63('0x6'));router[_0x0a63('0x7')](_0x0a63('0x8'),auth['isAuthenticated'](),controller[_0x0a63('0x9')]);router[_0x0a63('0xa')]('/',auth[_0x0a63('0xb')](),controller[_0x0a63('0xc')]);router[_0x0a63('0xd')](_0x0a63('0x8'),auth['isAuthenticated'](),controller[_0x0a63('0xe')]);router[_0x0a63('0xf')](_0x0a63('0x8'),auth[_0x0a63('0xb')](),controller[_0x0a63('0x10')]);module[_0x0a63('0x11')]=router; \ No newline at end of file +var _0x33c5=['fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','util','path','express','Router'];(function(_0xc02d1d,_0x4adc51){var _0x51e0a2=function(_0x4a0f13){while(--_0x4a0f13){_0xc02d1d['push'](_0xc02d1d['shift']());}};_0x51e0a2(++_0x4adc51);}(_0x33c5,0xe6));var _0x533c=function(_0xbebf50,_0x44ec09){_0xbebf50=_0xbebf50-0x0;var _0xce1496=_0x33c5[_0xbebf50];return _0xce1496;};'use strict';var multer=require('multer');var util=require(_0x533c('0x0'));var path=require(_0x533c('0x1'));var timeout=require('connect-timeout');var express=require(_0x533c('0x2'));var router=express[_0x533c('0x3')]();var fs_extra=require(_0x533c('0x4'));var auth=require(_0x533c('0x5'));var interaction=require(_0x533c('0x6'));var config=require('../../config/environment');var controller=require(_0x533c('0x7'));router[_0x533c('0x8')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0xb')]);router[_0x533c('0xc')]('/',auth[_0x533c('0xa')](),controller[_0x533c('0xd')]);router[_0x533c('0xe')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0xf')]);router[_0x533c('0x10')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 72701c3..caa03da 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 _0x32e2=['beepall','exports','STRING','INTEGER','rrmemory'];(function(_0x4084eb,_0x30c6ad){var _0x4c1f1c=function(_0x1ca12e){while(--_0x1ca12e){_0x4084eb['push'](_0x4084eb['shift']());}};_0x4c1f1c(++_0x30c6ad);}(_0x32e2,0x18c));var _0x232e=function(_0x58db4e,_0x439d8d){_0x58db4e=_0x58db4e-0x0;var _0x40139a=_0x32e2[_0x58db4e];return _0x40139a;};'use strict';var Sequelize=require('sequelize');module[_0x232e('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x232e('0x1')]},'timeout':{'type':Sequelize[_0x232e('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x232e('0x3'),_0x232e('0x4'),'roundrobin')}}; \ No newline at end of file +var _0xe549=['INTEGER','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name'];(function(_0x256668,_0xa5a225){var _0x23668c=function(_0x1477db){while(--_0x1477db){_0x256668['push'](_0x256668['shift']());}};_0x23668c(++_0xa5a225);}(_0xe549,0xcc));var _0x9e54=function(_0x433be1,_0x3d5097){_0x433be1=_0x433be1-0x0;var _0x492e3f=_0xe549[_0x433be1];return _0x492e3f;};'use strict';var Sequelize=require(_0x9e54('0x0'));module[_0x9e54('0x1')]={'name':{'type':Sequelize[_0x9e54('0x2')],'unique':_0x9e54('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x9e54('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x9e54('0x5'),_0x9e54('0x6'),_0x9e54('0x7'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index f16b26b..60af6e2 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 _0x7025=['params','model','keys','query','filters','intersection','fields','attributes','includeAll','merge','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChatQueues','UserProfileSection','find','userProfileId','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','length','nolimit','order','sort','pick','ChatQueueId','filter','User','findAndCountAll','UserId','agent','chatPause','format','SIP','updatedAt','getTeams','addTeams','Team','findAll','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','emit','userChatQueue:save','removeTeams','ids','select','field','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','every','includes','value','isEmpty','removeAgents','forEach','userChatQueue:remove','addAgents','spread','isArray','getAgents','hasOwnProperty','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','update','then','UserProfileResource','destroy','error','send','index','map','rawAttributes','fieldName','type','key','getOptions','where','ChatQueue','include','rows','catch','show'];(function(_0x17607b,_0x198fb1){var _0x11c698=function(_0x4bbb9b){while(--_0x4bbb9b){_0x17607b['push'](_0x17607b['shift']());}};_0x11c698(++_0x198fb1);}(_0x7025,0x1be));var _0x5702=function(_0x2a834b,_0x37f040){_0x2a834b=_0x2a834b-0x0;var _0x240185=_0x7025[_0x2a834b];return _0x240185;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x5702('0x0'));var squel=require(_0x5702('0x1'));var Redis=require(_0x5702('0x2'));var qs=require(_0x5702('0x3'));var logger=require(_0x5702('0x4'))(_0x5702('0x5'));var config=require(_0x5702('0x6'));var db=require(_0x5702('0x7'))['db'];config[_0x5702('0x8')]=_[_0x5702('0x9')](config[_0x5702('0x8')],{'host':_0x5702('0xa'),'port':0x18eb});var socket=require(_0x5702('0xb'))(new Redis(config[_0x5702('0x8')]));require(_0x5702('0xc'))[_0x5702('0xd')](socket);function respondWithStatusCode(_0x368303,_0x136c2c){_0x136c2c=_0x136c2c||0xcc;return function(_0x3fc32a){if(_0x3fc32a){return _0x368303[_0x5702('0xe')](_0x136c2c);}return _0x368303[_0x5702('0xf')](_0x136c2c)[_0x5702('0x10')]();};}function respondWithResult(_0x319722,_0x52a8c7){_0x52a8c7=_0x52a8c7||0xc8;return function(_0x11b219){if(_0x11b219){return _0x319722[_0x5702('0xf')](_0x52a8c7)[_0x5702('0x11')](_0x11b219);}};}function respondWithFilteredResult(_0x135f35,_0x5e6f0d){return function(_0xd651da){if(_0xd651da){var _0x1f2b1f=typeof _0x5e6f0d[_0x5702('0x12')]===_0x5702('0x13')&&typeof _0x5e6f0d[_0x5702('0x14')]==='undefined';var _0x4c5e82=_0xd651da['count'];var _0x4683b8=_0x1f2b1f?0x0:_0x5e6f0d[_0x5702('0x12')];var _0x59c906=_0x1f2b1f?_0xd651da[_0x5702('0x15')]:_0x5e6f0d['offset']+_0x5e6f0d['limit'];var _0x2c854b;if(_0x59c906>=_0x4c5e82){_0x59c906=_0x4c5e82;_0x2c854b=0xc8;}else{_0x2c854b=0xce;}_0x135f35[_0x5702('0xf')](_0x2c854b);return _0x135f35[_0x5702('0x16')]('Content-Range',_0x4683b8+'-'+_0x59c906+'/'+_0x4c5e82)[_0x5702('0x11')](_0xd651da);}return null;};}function saveUpdates(_0x21ca04){return function(_0x57532b){if(_0x57532b){return _0x57532b[_0x5702('0x17')](_0x21ca04)[_0x5702('0x18')](function(_0x3fd531){return _0x3fd531;});}return null;};}function removeEntity(_0x55bc80){return function(_0x296c75){if(_0x296c75){return _0x296c75['destroy']()[_0x5702('0x18')](function(){var _0x4b3546=_0x296c75['get']({'plain':!![]});var _0x59f278='ChatQueues';return db[_0x5702('0x19')][_0x5702('0x1a')]({'where':{'type':_0x59f278,'resourceId':_0x4b3546['id']}})[_0x5702('0x18')](function(){return _0x296c75;});})[_0x5702('0x18')](function(){_0x55bc80[_0x5702('0xf')](0xcc)[_0x5702('0x10')]();});}};}function handleEntityNotFound(_0x47a218){return function(_0x5dbb75){if(!_0x5dbb75){_0x47a218[_0x5702('0xe')](0x194);}return _0x5dbb75;};}function handleError(_0x54b0d9,_0xdb92cf){_0xdb92cf=_0xdb92cf||0x1f4;return function(_0x3ee42d){logger[_0x5702('0x1b')](_0x3ee42d['stack']);if(_0x3ee42d['name']){delete _0x3ee42d['name'];}_0x54b0d9[_0x5702('0xf')](_0xdb92cf)[_0x5702('0x1c')](_0x3ee42d);};}exports[_0x5702('0x1d')]=function(_0x1de85b,_0x41c571){var _0x4ad3d2={};var _0x55896a={'count':0x0,'rows':[]};var _0x516a64=_[_0x5702('0x1e')](db['ChatQueue'][_0x5702('0x1f')],function(_0xc8250b){return{'name':_0xc8250b[_0x5702('0x20')],'type':_0xc8250b[_0x5702('0x21')][_0x5702('0x22')]};});_0x4ad3d2=qs[_0x5702('0x23')](_0x516a64,_0x1de85b);var _0x19c137={'where':_0x4ad3d2[_0x5702('0x24')]};return db[_0x5702('0x25')]['count'](_0x19c137)[_0x5702('0x18')](function(_0x294af8){_0x55896a[_0x5702('0x15')]=_0x294af8;_0x4ad3d2[_0x5702('0x26')]=qs[_0x5702('0x26')](_0x1de85b['query']);return db[_0x5702('0x25')]['findAll'](_0x4ad3d2);})[_0x5702('0x18')](function(_0x4654a8){_0x55896a[_0x5702('0x27')]=_0x4654a8;return _0x55896a;})['then'](respondWithFilteredResult(_0x41c571,_0x4ad3d2))[_0x5702('0x28')](handleError(_0x41c571,null));};exports[_0x5702('0x29')]=function(_0x369188,_0x214324){var _0x1d63b4={'raw':!![],'where':{'id':_0x369188[_0x5702('0x2a')]['id']}},_0x66cfa1={};_0x66cfa1[_0x5702('0x2b')]=_[_0x5702('0x2c')](db[_0x5702('0x25')][_0x5702('0x1f')]);_0x66cfa1[_0x5702('0x2d')]=_[_0x5702('0x2c')](_0x369188[_0x5702('0x2d')]);_0x66cfa1[_0x5702('0x2e')]=_[_0x5702('0x2f')](_0x66cfa1[_0x5702('0x2b')],_0x66cfa1[_0x5702('0x2d')]);_0x1d63b4['attributes']=_[_0x5702('0x2f')](_0x66cfa1[_0x5702('0x2b')],qs[_0x5702('0x30')](_0x369188[_0x5702('0x2d')][_0x5702('0x30')]));_0x1d63b4['attributes']=_0x1d63b4[_0x5702('0x31')]['length']?_0x1d63b4['attributes']:_0x66cfa1[_0x5702('0x2b')];if(_0x369188[_0x5702('0x2d')][_0x5702('0x32')]){_0x1d63b4['include']=[{'all':!![]}];}_0x1d63b4=_[_0x5702('0x33')]({},_0x1d63b4,_0x369188[_0x5702('0x34')]);return db[_0x5702('0x25')]['find'](_0x1d63b4)['then'](handleEntityNotFound(_0x214324,null))[_0x5702('0x18')](respondWithResult(_0x214324,null))[_0x5702('0x28')](handleError(_0x214324,null));};exports[_0x5702('0x35')]=function(_0x3866c3,_0xa8e692){return db[_0x5702('0x25')][_0x5702('0x35')](_0x3866c3[_0x5702('0x36')],{})['then'](function(_0x1695af){var _0x1df32b=_0x3866c3[_0x5702('0x37')][_0x5702('0x38')]({'plain':!![]});if(!_0x1df32b)throw new Error(_0x5702('0x39'));if(_0x1df32b['role']==='user'){var _0x6b0d1a=_0x1695af['get']({'plain':!![]});var _0x171475=_0x5702('0x3a');return db[_0x5702('0x3b')][_0x5702('0x3c')]({'where':{'name':_0x171475,'userProfileId':_0x1df32b[_0x5702('0x3d')]},'raw':!![]})[_0x5702('0x18')](function(_0x5479ba){if(_0x5479ba&&_0x5479ba['autoAssociation']===0x0){return db[_0x5702('0x19')]['create']({'name':_0x6b0d1a[_0x5702('0x3e')],'resourceId':_0x6b0d1a['id'],'type':_0x5479ba['name'],'sectionId':_0x5479ba['id']},{})['then'](function(){return _0x1695af;});}else{return _0x1695af;}})[_0x5702('0x28')](function(_0x363400){logger[_0x5702('0x1b')](_0x5702('0x3f'),_0x363400);throw _0x363400;});}return _0x1695af;})[_0x5702('0x18')](respondWithResult(_0xa8e692,0xc9))[_0x5702('0x28')](handleError(_0xa8e692,null));};exports['update']=function(_0x242feb,_0x3d2092){if(_0x242feb[_0x5702('0x36')]['id']){delete _0x242feb['body']['id'];}return db[_0x5702('0x25')][_0x5702('0x3c')]({'where':{'id':_0x242feb[_0x5702('0x2a')]['id']}})[_0x5702('0x18')](handleEntityNotFound(_0x3d2092,null))[_0x5702('0x18')](saveUpdates(_0x242feb[_0x5702('0x36')],null))[_0x5702('0x18')](respondWithResult(_0x3d2092,null))['catch'](handleError(_0x3d2092,null));};exports[_0x5702('0x1a')]=function(_0x4b6def,_0x3245f0){return db[_0x5702('0x25')][_0x5702('0x3c')]({'where':{'id':_0x4b6def[_0x5702('0x2a')]['id']}})[_0x5702('0x18')](handleEntityNotFound(_0x3245f0,null))[_0x5702('0x18')](removeEntity(_0x3245f0,null))['catch'](handleError(_0x3245f0,null));};exports['describe']=function(_0x1e7e54,_0x47bc65){return db['ChatQueue'][_0x5702('0x40')]()[_0x5702('0x18')](respondWithResult(_0x47bc65,null))[_0x5702('0x28')](handleError(_0x47bc65,null));};exports[_0x5702('0x41')]=function(_0x1a1488,_0x3c196c){var _0x41b25f={'raw':!![],'where':{}},_0x3962ff={},_0x499d4a;return db[_0x5702('0x25')][_0x5702('0x42')]({'where':{'id':_0x1a1488[_0x5702('0x2a')]['id']}})[_0x5702('0x18')](handleEntityNotFound(_0x3c196c,null))[_0x5702('0x18')](function(_0x2c25b7){if(_0x2c25b7){_0x499d4a=_0x2c25b7['get']({'plain':!![]});_0x3962ff[_0x5702('0x2b')]=_[_0x5702('0x2c')](db[_0x5702('0x43')][_0x5702('0x1f')]);_0x3962ff['query']=_['keys'](_0x1a1488[_0x5702('0x2d')]);_0x3962ff[_0x5702('0x2e')]=_[_0x5702('0x2f')](_0x3962ff['model'],_0x3962ff[_0x5702('0x2d')]);_0x41b25f['attributes']=_[_0x5702('0x2f')](_0x3962ff['model'],qs[_0x5702('0x30')](_0x1a1488['query'][_0x5702('0x30')]));_0x41b25f[_0x5702('0x31')]=_0x41b25f[_0x5702('0x31')][_0x5702('0x44')]?_0x41b25f['attributes']:_0x3962ff[_0x5702('0x2b')];if(!_0x1a1488[_0x5702('0x2d')]['hasOwnProperty'](_0x5702('0x45'))){_0x41b25f['limit']=qs[_0x5702('0x14')](_0x1a1488[_0x5702('0x2d')][_0x5702('0x14')]);_0x41b25f['offset']=qs[_0x5702('0x12')](_0x1a1488[_0x5702('0x2d')][_0x5702('0x12')]);}_0x41b25f[_0x5702('0x46')]=qs[_0x5702('0x47')](_0x1a1488['query'][_0x5702('0x47')]);_0x41b25f[_0x5702('0x24')]=qs[_0x5702('0x2e')](_[_0x5702('0x48')](_0x1a1488[_0x5702('0x2d')],_0x3962ff['filters']));_0x41b25f['where'][_0x5702('0x49')]=_0x2c25b7['id'];if(_0x1a1488[_0x5702('0x2d')][_0x5702('0x4a')]){_0x41b25f['where']=_[_0x5702('0x33')](_0x41b25f[_0x5702('0x24')],{'$or':_['map'](_0x41b25f[_0x5702('0x31')],function(_0x825486){var _0x29c108={};_0x29c108[_0x825486]={'$like':'%'+_0x1a1488[_0x5702('0x2d')][_0x5702('0x4a')]+'%'};return _0x29c108;})});}_0x41b25f=_[_0x5702('0x33')]({},_0x41b25f,_0x1a1488[_0x5702('0x34')]);return db[_0x5702('0x43')]['findAll'](_0x41b25f);}})[_0x5702('0x18')](function(_0x2a7bc8){if(_0x2a7bc8){return db[_0x5702('0x4b')][_0x5702('0x4c')]({'where':{'id':_[_0x5702('0x1e')](_0x2a7bc8,_0x5702('0x4d')),'role':_0x5702('0x4e')},'attributes':['id',_0x5702('0x3e'),_0x5702('0x4f'),'updatedAt','createdAt']});}})['then'](function(_0x1bf21f){if(_0x1bf21f){return{'count':_0x1bf21f[_0x5702('0x15')],'rows':_[_0x5702('0x1e')](_0x1bf21f[_0x5702('0x27')],function(_0x4b289f){return{'membername':_0x4b289f[_0x5702('0x3e')],'UserId':_0x4b289f['id'],'queue_name':_0x499d4a[_0x5702('0x3e')],'ChatQueueId':_0x499d4a['id'],'interface':util[_0x5702('0x50')]('%s/%s',_0x5702('0x51'),_0x4b289f[_0x5702('0x3e')]),'penalty':0x0,'paused':_0x4b289f[_0x5702('0x4f')],'createdAt':_0x4b289f['createdAt'],'updatedAt':_0x4b289f[_0x5702('0x52')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3c196c,_0x41b25f))[_0x5702('0x28')](handleError(_0x3c196c,null));};exports[_0x5702('0x53')]=function(_0x1a88ef,_0x8163a2){var _0x18a346={};var _0x491bf3={};var _0x22a12e;var _0x3eac83;return db['ChatQueue'][_0x5702('0x42')]({'where':{'id':_0x1a88ef[_0x5702('0x2a')]['id']}})[_0x5702('0x18')](handleEntityNotFound(_0x8163a2,null))[_0x5702('0x18')](function(_0x47f6d7){if(_0x47f6d7){_0x22a12e=_0x47f6d7;_0x491bf3[_0x5702('0x2b')]=_[_0x5702('0x2c')](db['Team'][_0x5702('0x1f')]);_0x491bf3[_0x5702('0x2d')]=_['keys'](_0x1a88ef['query']);_0x491bf3['filters']=_[_0x5702('0x2f')](_0x491bf3['model'],_0x491bf3[_0x5702('0x2d')]);_0x18a346[_0x5702('0x31')]=_[_0x5702('0x2f')](_0x491bf3['model'],qs[_0x5702('0x30')](_0x1a88ef['query'][_0x5702('0x30')]));_0x18a346[_0x5702('0x31')]=_0x18a346['attributes'][_0x5702('0x44')]?_0x18a346[_0x5702('0x31')]:_0x491bf3['model'];_0x18a346[_0x5702('0x46')]=qs[_0x5702('0x47')](_0x1a88ef[_0x5702('0x2d')][_0x5702('0x47')]);_0x18a346['where']=qs[_0x5702('0x2e')](_['pick'](_0x1a88ef[_0x5702('0x2d')],_0x491bf3[_0x5702('0x2e')]));if(_0x1a88ef['query'][_0x5702('0x4a')]){_0x18a346[_0x5702('0x24')]=_[_0x5702('0x33')](_0x18a346[_0x5702('0x24')],{'$or':_[_0x5702('0x1e')](_0x18a346[_0x5702('0x31')],function(_0x204673){var _0x5039de={};_0x5039de[_0x204673]={'$like':'%'+_0x1a88ef['query'][_0x5702('0x4a')]+'%'};return _0x5039de;})});}_0x18a346=_[_0x5702('0x33')]({},_0x18a346,_0x1a88ef['options']);return _0x22a12e['getTeams'](_0x18a346);}})[_0x5702('0x18')](function(_0x2e470d){if(_0x2e470d){_0x3eac83=_0x2e470d['length'];if(!_0x1a88ef['query']['hasOwnProperty']('nolimit')){_0x18a346[_0x5702('0x14')]=qs['limit'](_0x1a88ef['query'][_0x5702('0x14')]);_0x18a346[_0x5702('0x12')]=qs[_0x5702('0x12')](_0x1a88ef[_0x5702('0x2d')]['offset']);}return _0x22a12e['getTeams'](_0x18a346);}})[_0x5702('0x18')](function(_0x1d0dca){if(_0x1d0dca){return _0x1d0dca?{'count':_0x3eac83,'rows':_0x1d0dca}:null;}})['then'](respondWithResult(_0x8163a2,null))[_0x5702('0x28')](handleError(_0x8163a2,null));};exports[_0x5702('0x54')]=function(_0x52999c,_0x261761){var _0xe84ecc=_0x52999c[_0x5702('0x36')]['ids'];return db[_0x5702('0x55')][_0x5702('0x56')]({'where':{'id':_0xe84ecc},'attributes':['id'],'include':[{'model':db[_0x5702('0x4b')],'as':_0x5702('0x57'),'attributes':['id','name',_0x5702('0x58'),_0x5702('0x59'),_0x5702('0x5a')],'raw':!![]}]})[_0x5702('0x18')](function(_0x48e605){if(_0x48e605){var _0x4e53c7=_[_0x5702('0x5b')](_0x48e605,function(_0x76edc5){var _0x3224fa=_0x76edc5[_0x5702('0x38')]({'plain':!![]});return _0x3224fa[_0x5702('0x57')];});return db[_0x5702('0x25')]['find']({'where':{'id':_0x52999c['params']['id']}})[_0x5702('0x18')](function(_0x90859d){return db[_0x5702('0x5c')][_0x5702('0x5d')](function(_0x5f002d){return _0x90859d[_0x5702('0x54')](_0xe84ecc,{'transaction':_0x5f002d})[_0x5702('0x18')](function(){return BPromise[_0x5702('0x5e')](_0x4e53c7,function(_0x15072d){return db['UserChatQueue'][_0x5702('0x5f')]({'where':{'UserId':_0x15072d['id'],'ChatQueueId':_0x52999c['params']['id']},'transaction':_0x5f002d});});})[_0x5702('0x18')](function(){_0x4e53c7['forEach'](function(_0xaaac2e){socket[_0x5702('0x60')](_0x5702('0x61'),{'UserId':_0xaaac2e['id'],'ChatQueueId':_0x90859d['id']});});});});});}})[_0x5702('0x18')](respondWithStatusCode(_0x261761,null))[_0x5702('0x28')](handleError(_0x261761,null));};exports[_0x5702('0x62')]=function(_0x19c42a,_0x8250e0){return db[_0x5702('0x55')][_0x5702('0x56')]({'where':{'id':_0x19c42a[_0x5702('0x2d')][_0x5702('0x63')]},'attributes':['id'],'include':[{'model':db[_0x5702('0x4b')],'as':_0x5702('0x57'),'attributes':['id'],'raw':!![]}]})[_0x5702('0x18')](handleEntityNotFound(_0x8250e0,null))[_0x5702('0x18')](function(_0x497fcb){var _0x141f6d=_[_0x5702('0x1e')](_0x497fcb,'id');var _0x157946=[];var _0x4fb354=[];var _0x3daf1f=squel[_0x5702('0x64')]();_0x3daf1f[_0x5702('0x65')]('tq.TeamId')[_0x5702('0x66')]('team_has_chat_queues','tq')[_0x5702('0x67')](_0x5702('0x68'),'ut',_0x5702('0x69'))[_0x5702('0x24')](_0x5702('0x6a'),_0x19c42a[_0x5702('0x2a')]['id']);for(var _0x14ce8b=0x0;_0x14ce8b<_0x497fcb[_0x5702('0x44')];_0x14ce8b+=0x1){let _0x34b63a=_0x497fcb[_0x14ce8b];for(var _0x2cf558=0x0;_0x2cf558<_0x34b63a[_0x5702('0x57')]['length'];_0x2cf558+=0x1){let _0x4ab376=_0x34b63a[_0x5702('0x57')][_0x2cf558];var _0x156860=_0x3daf1f[_0x5702('0x6b')]();_0x156860[_0x5702('0x24')](_0x5702('0x6c'),_0x4ab376['id']);_0x4fb354['push'](db[_0x5702('0x5c')][_0x5702('0x2d')](_0x156860[_0x5702('0x6d')](),{'type':db['sequelize']['QueryTypes']['SELECT']})[_0x5702('0x18')](function(_0x211780){if(_0x211780[_0x5702('0x44')]===0x1){return _0x4ab376['id'];}else{var _0x2e631a=_[_0x5702('0x6e')](_['map'](_0x211780,'TeamId'),function(_0x416426){return _[_0x5702('0x6f')](_0x141f6d,_0x416426);});if(_0x2e631a){return _0x4ab376['id'];}}}));}}return BPromise['all'](_0x4fb354)[_0x5702('0x18')](function(_0x342f94){_0x157946=_(_0x157946)['union'](_0x342f94)['compact']()[_0x5702('0x70')]();return db['ChatQueue']['find']({'where':{'id':_0x19c42a[_0x5702('0x2a')]['id']}})[_0x5702('0x18')](function(_0x54d472){return db['sequelize'][_0x5702('0x5d')](function(_0x44ac0d){return _0x54d472['removeTeams'](_0x19c42a[_0x5702('0x2d')][_0x5702('0x63')],{'transaction':_0x44ac0d})[_0x5702('0x18')](function(){if(!_[_0x5702('0x71')](_0x157946)){return _0x54d472[_0x5702('0x72')](_0x157946,{'transaction':_0x44ac0d});}})[_0x5702('0x18')](function(){_0x157946[_0x5702('0x73')](function(_0x4d4aa2){socket['emit'](_0x5702('0x74'),{'UserId':_0x4d4aa2,'ChatQueueId':_0x54d472['id']});});});});});});})['then'](respondWithStatusCode(_0x8250e0,null))[_0x5702('0x28')](handleError(_0x8250e0,null));};exports[_0x5702('0x75')]=function(_0x1e1b5b,_0x6ef5b9){return db[_0x5702('0x25')][_0x5702('0x3c')]({'where':{'id':_0x1e1b5b[_0x5702('0x2a')]['id']}})[_0x5702('0x18')](handleEntityNotFound(_0x6ef5b9,null))[_0x5702('0x18')](function(_0x51484f){if(_0x51484f){return _0x51484f[_0x5702('0x75')](_0x1e1b5b[_0x5702('0x36')][_0x5702('0x63')],_['omit'](_0x1e1b5b[_0x5702('0x36')],['ids','id'])||{})[_0x5702('0x76')](function(_0x507321){for(var _0x556c2a=0x0;_0x556c2a<_0x1e1b5b[_0x5702('0x36')][_0x5702('0x63')][_0x5702('0x44')];_0x556c2a+=0x1){socket[_0x5702('0x60')]('userChatQueue:save',{'UserId':Number(_0x1e1b5b[_0x5702('0x36')][_0x5702('0x63')][_0x556c2a]),'ChatQueueId':Number(_0x1e1b5b['params']['id'])});}return _0x507321;});}})[_0x5702('0x18')](respondWithResult(_0x6ef5b9,null))[_0x5702('0x28')](handleError(_0x6ef5b9,null));};exports['removeAgents']=function(_0x1f25a7,_0x487cc9){return db[_0x5702('0x25')]['find']({'where':{'id':_0x1f25a7['params']['id']}})[_0x5702('0x18')](handleEntityNotFound(_0x487cc9,null))[_0x5702('0x18')](function(_0x723818){if(_0x723818){return _0x723818[_0x5702('0x72')](_0x1f25a7['query']['ids'])[_0x5702('0x18')](function(){if(_[_0x5702('0x77')](_0x1f25a7[_0x5702('0x2d')][_0x5702('0x63')])){for(var _0x217d9e=0x0;_0x217d9e<_0x1f25a7['query'][_0x5702('0x63')][_0x5702('0x44')];_0x217d9e+=0x1){socket[_0x5702('0x60')](_0x5702('0x74'),{'UserId':Number(_0x1f25a7['query'][_0x5702('0x63')][_0x217d9e]),'ChatQueueId':Number(_0x1f25a7[_0x5702('0x2a')]['id'])});}}else{socket[_0x5702('0x60')](_0x5702('0x74'),{'UserId':Number(_0x1f25a7[_0x5702('0x2d')][_0x5702('0x63')]),'ChatQueueId':Number(_0x1f25a7[_0x5702('0x2a')]['id'])});}});}})['then'](respondWithStatusCode(_0x487cc9,null))[_0x5702('0x28')](handleError(_0x487cc9,null));};exports[_0x5702('0x78')]=function(_0x44650a,_0x2a5eab){var _0xe45521={};var _0x44c4c8={};var _0xaaec6a;var _0x3c3e75;return db[_0x5702('0x25')][_0x5702('0x42')]({'where':{'id':_0x44650a[_0x5702('0x2a')]['id']}})[_0x5702('0x18')](handleEntityNotFound(_0x2a5eab,null))[_0x5702('0x18')](function(_0x5c46b6){if(_0x5c46b6){_0xaaec6a=_0x5c46b6;_0x44c4c8[_0x5702('0x2b')]=_[_0x5702('0x2c')](db[_0x5702('0x4b')][_0x5702('0x1f')]);_0x44c4c8['query']=_['keys'](_0x44650a[_0x5702('0x2d')]);_0x44c4c8[_0x5702('0x2e')]=_[_0x5702('0x2f')](_0x44c4c8['model'],_0x44c4c8[_0x5702('0x2d')]);_0xe45521[_0x5702('0x31')]=_['intersection'](_0x44c4c8[_0x5702('0x2b')],qs[_0x5702('0x30')](_0x44650a[_0x5702('0x2d')][_0x5702('0x30')]));_0xe45521[_0x5702('0x31')]=_0xe45521[_0x5702('0x31')][_0x5702('0x44')]?_0xe45521['attributes']:_0x44c4c8['model'];_0xe45521[_0x5702('0x46')]=qs[_0x5702('0x47')](_0x44650a[_0x5702('0x2d')]['sort']);_0xe45521['where']=qs['filters'](_['pick'](_0x44650a[_0x5702('0x2d')],_0x44c4c8[_0x5702('0x2e')]));if(_0x44650a[_0x5702('0x2d')][_0x5702('0x4a')]){_0xe45521[_0x5702('0x24')]=_[_0x5702('0x33')](_0xe45521[_0x5702('0x24')],{'$or':_[_0x5702('0x1e')](_0xe45521[_0x5702('0x31')],function(_0x1449a0){var _0x5a942b={};_0x5a942b[_0x1449a0]={'$like':'%'+_0x44650a[_0x5702('0x2d')][_0x5702('0x4a')]+'%'};return _0x5a942b;})});}_0xe45521=_[_0x5702('0x33')]({},_0xe45521,_0x44650a[_0x5702('0x34')]);return _0xaaec6a['getAgents'](_0xe45521);}})[_0x5702('0x18')](function(_0x29cdb2){if(_0x29cdb2){_0x3c3e75=_0x29cdb2[_0x5702('0x44')];if(!_0x44650a[_0x5702('0x2d')][_0x5702('0x79')]('nolimit')){_0xe45521['limit']=qs[_0x5702('0x14')](_0x44650a[_0x5702('0x2d')][_0x5702('0x14')]);_0xe45521['offset']=qs[_0x5702('0x12')](_0x44650a[_0x5702('0x2d')]['offset']);}return _0xaaec6a[_0x5702('0x78')](_0xe45521);}})[_0x5702('0x18')](function(_0x22f55c){if(_0x22f55c){return _0x22f55c?{'count':_0x3c3e75,'rows':_0x22f55c}:null;}})['then'](respondWithResult(_0x2a5eab,null))[_0x5702('0x28')](handleError(_0x2a5eab,null));}; \ No newline at end of file +var _0x6e5e=['attributes','fields','merge','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','describe','getMembers','findOne','UserChatQueue','length','order','sort','pick','ChatQueueId','filter','User','findAndCountAll','UserId','chatPause','updatedAt','createdAt','%s/%s','SIP','Team','getTeams','hasOwnProperty','addTeams','ids','Agents','interface','flatMap','transaction','each','findOrCreate','emit','removeTeams','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','clone','push','toString','sequelize','SELECT','every','TeamId','includes','all','value','forEach','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','removeAgents','isArray','getAgents','options','nolimit','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','./chatQueue.socket','register','sendStatus','end','offset','undefined','limit','count','status','Content-Range','json','update','then','destroy','get','ChatQueues','UserProfileResource','error','stack','name','map','rawAttributes','fieldName','type','key','getOptions','where','ChatQueue','include','query','findAll','rows','params','model','keys','filters','intersection'];(function(_0x1278b6,_0x24252e){var _0x2cff42=function(_0x46b845){while(--_0x46b845){_0x1278b6['push'](_0x1278b6['shift']());}};_0x2cff42(++_0x24252e);}(_0x6e5e,0x133));var _0xe6e5=function(_0x4f42db,_0x13c7aa){_0x4f42db=_0x4f42db-0x0;var _0x44b85d=_0x6e5e[_0x4f42db];return _0x44b85d;};'use strict';var BPromise=require('bluebird');var util=require(_0xe6e5('0x0'));var _=require(_0xe6e5('0x1'));var squel=require(_0xe6e5('0x2'));var Redis=require(_0xe6e5('0x3'));var qs=require(_0xe6e5('0x4'));var logger=require(_0xe6e5('0x5'))(_0xe6e5('0x6'));var config=require(_0xe6e5('0x7'));var db=require(_0xe6e5('0x8'))['db'];config[_0xe6e5('0x9')]=_['defaults'](config[_0xe6e5('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe6e5('0x9')]));require(_0xe6e5('0xa'))[_0xe6e5('0xb')](socket);function respondWithStatusCode(_0x4a346a,_0x4e207c){_0x4e207c=_0x4e207c||0xcc;return function(_0x31045a){if(_0x31045a){return _0x4a346a[_0xe6e5('0xc')](_0x4e207c);}return _0x4a346a['status'](_0x4e207c)[_0xe6e5('0xd')]();};}function respondWithResult(_0x1c354b,_0x131531){_0x131531=_0x131531||0xc8;return function(_0x26f5cd){if(_0x26f5cd){return _0x1c354b['status'](_0x131531)['json'](_0x26f5cd);}};}function respondWithFilteredResult(_0x24f60c,_0x240b09){return function(_0x1218f2){if(_0x1218f2){var _0x3a8942=typeof _0x240b09[_0xe6e5('0xe')]===_0xe6e5('0xf')&&typeof _0x240b09[_0xe6e5('0x10')]===_0xe6e5('0xf');var _0x5e25b1=_0x1218f2[_0xe6e5('0x11')];var _0x22e4a=_0x3a8942?0x0:_0x240b09[_0xe6e5('0xe')];var _0x4118b1=_0x3a8942?_0x1218f2[_0xe6e5('0x11')]:_0x240b09[_0xe6e5('0xe')]+_0x240b09[_0xe6e5('0x10')];var _0x3bfc91;if(_0x4118b1>=_0x5e25b1){_0x4118b1=_0x5e25b1;_0x3bfc91=0xc8;}else{_0x3bfc91=0xce;}_0x24f60c[_0xe6e5('0x12')](_0x3bfc91);return _0x24f60c['set'](_0xe6e5('0x13'),_0x22e4a+'-'+_0x4118b1+'/'+_0x5e25b1)[_0xe6e5('0x14')](_0x1218f2);}return null;};}function saveUpdates(_0x3a4365){return function(_0x121ad2){if(_0x121ad2){return _0x121ad2[_0xe6e5('0x15')](_0x3a4365)[_0xe6e5('0x16')](function(_0x16d296){return _0x16d296;});}return null;};}function removeEntity(_0x1ef188){return function(_0x298cbb){if(_0x298cbb){return _0x298cbb[_0xe6e5('0x17')]()[_0xe6e5('0x16')](function(){var _0x1a3cff=_0x298cbb[_0xe6e5('0x18')]({'plain':!![]});var _0x10af43=_0xe6e5('0x19');return db[_0xe6e5('0x1a')]['destroy']({'where':{'type':_0x10af43,'resourceId':_0x1a3cff['id']}})[_0xe6e5('0x16')](function(){return _0x298cbb;});})[_0xe6e5('0x16')](function(){_0x1ef188[_0xe6e5('0x12')](0xcc)[_0xe6e5('0xd')]();});}};}function handleEntityNotFound(_0x243834){return function(_0x42e43c){if(!_0x42e43c){_0x243834['sendStatus'](0x194);}return _0x42e43c;};}function handleError(_0x578665,_0x46a8c3){_0x46a8c3=_0x46a8c3||0x1f4;return function(_0x1305fc){logger[_0xe6e5('0x1b')](_0x1305fc[_0xe6e5('0x1c')]);if(_0x1305fc[_0xe6e5('0x1d')]){delete _0x1305fc[_0xe6e5('0x1d')];}_0x578665['status'](_0x46a8c3)['send'](_0x1305fc);};}exports['index']=function(_0x2c2b18,_0x59eebb){var _0xafea7d={};var _0xdf4bfc={'count':0x0,'rows':[]};var _0x8bf0c2=_[_0xe6e5('0x1e')](db['ChatQueue'][_0xe6e5('0x1f')],function(_0x41588d){return{'name':_0x41588d[_0xe6e5('0x20')],'type':_0x41588d[_0xe6e5('0x21')][_0xe6e5('0x22')]};});_0xafea7d=qs[_0xe6e5('0x23')](_0x8bf0c2,_0x2c2b18);var _0x5305b8={'where':_0xafea7d[_0xe6e5('0x24')]};return db[_0xe6e5('0x25')]['count'](_0x5305b8)[_0xe6e5('0x16')](function(_0x186507){_0xdf4bfc[_0xe6e5('0x11')]=_0x186507;_0xafea7d[_0xe6e5('0x26')]=qs['include'](_0x2c2b18[_0xe6e5('0x27')]);return db[_0xe6e5('0x25')][_0xe6e5('0x28')](_0xafea7d);})[_0xe6e5('0x16')](function(_0x455491){_0xdf4bfc[_0xe6e5('0x29')]=_0x455491;return _0xdf4bfc;})[_0xe6e5('0x16')](respondWithFilteredResult(_0x59eebb,_0xafea7d))['catch'](handleError(_0x59eebb,null));};exports['show']=function(_0x28e3fd,_0x59b814){var _0xcc52cf={'raw':!![],'where':{'id':_0x28e3fd[_0xe6e5('0x2a')]['id']}},_0x4d5f88={};_0x4d5f88[_0xe6e5('0x2b')]=_[_0xe6e5('0x2c')](db['ChatQueue'][_0xe6e5('0x1f')]);_0x4d5f88['query']=_[_0xe6e5('0x2c')](_0x28e3fd['query']);_0x4d5f88[_0xe6e5('0x2d')]=_[_0xe6e5('0x2e')](_0x4d5f88[_0xe6e5('0x2b')],_0x4d5f88[_0xe6e5('0x27')]);_0xcc52cf[_0xe6e5('0x2f')]=_[_0xe6e5('0x2e')](_0x4d5f88[_0xe6e5('0x2b')],qs[_0xe6e5('0x30')](_0x28e3fd[_0xe6e5('0x27')][_0xe6e5('0x30')]));_0xcc52cf['attributes']=_0xcc52cf[_0xe6e5('0x2f')]['length']?_0xcc52cf['attributes']:_0x4d5f88[_0xe6e5('0x2b')];if(_0x28e3fd[_0xe6e5('0x27')]['includeAll']){_0xcc52cf['include']=[{'all':!![]}];}_0xcc52cf=_[_0xe6e5('0x31')]({},_0xcc52cf,_0x28e3fd['options']);return db[_0xe6e5('0x25')][_0xe6e5('0x32')](_0xcc52cf)[_0xe6e5('0x16')](handleEntityNotFound(_0x59b814,null))['then'](respondWithResult(_0x59b814,null))[_0xe6e5('0x33')](handleError(_0x59b814,null));};exports[_0xe6e5('0x34')]=function(_0x4f7fcc,_0x275864){return db['ChatQueue'][_0xe6e5('0x34')](_0x4f7fcc[_0xe6e5('0x35')],{})[_0xe6e5('0x16')](function(_0x3477d0){var _0x5e8e76=_0x4f7fcc[_0xe6e5('0x36')][_0xe6e5('0x18')]({'plain':!![]});if(!_0x5e8e76)throw new Error(_0xe6e5('0x37'));if(_0x5e8e76[_0xe6e5('0x38')]===_0xe6e5('0x36')){var _0x1019e1=_0x3477d0['get']({'plain':!![]});var _0x596878=_0xe6e5('0x19');return db[_0xe6e5('0x39')][_0xe6e5('0x32')]({'where':{'name':_0x596878,'userProfileId':_0x5e8e76[_0xe6e5('0x3a')]},'raw':!![]})['then'](function(_0x2ff190){if(_0x2ff190&&_0x2ff190[_0xe6e5('0x3b')]===0x0){return db['UserProfileResource'][_0xe6e5('0x34')]({'name':_0x1019e1[_0xe6e5('0x1d')],'resourceId':_0x1019e1['id'],'type':_0x2ff190[_0xe6e5('0x1d')],'sectionId':_0x2ff190['id']},{})[_0xe6e5('0x16')](function(){return _0x3477d0;});}else{return _0x3477d0;}})[_0xe6e5('0x33')](function(_0x1a9b7d){logger[_0xe6e5('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1a9b7d);throw _0x1a9b7d;});}return _0x3477d0;})[_0xe6e5('0x16')](respondWithResult(_0x275864,0xc9))[_0xe6e5('0x33')](handleError(_0x275864,null));};exports[_0xe6e5('0x15')]=function(_0x1201cc,_0x2d4699){if(_0x1201cc['body']['id']){delete _0x1201cc[_0xe6e5('0x35')]['id'];}return db[_0xe6e5('0x25')][_0xe6e5('0x32')]({'where':{'id':_0x1201cc[_0xe6e5('0x2a')]['id']}})[_0xe6e5('0x16')](handleEntityNotFound(_0x2d4699,null))[_0xe6e5('0x16')](saveUpdates(_0x1201cc[_0xe6e5('0x35')],null))['then'](respondWithResult(_0x2d4699,null))[_0xe6e5('0x33')](handleError(_0x2d4699,null));};exports['destroy']=function(_0x17e037,_0x45d9a4){return db[_0xe6e5('0x25')]['find']({'where':{'id':_0x17e037[_0xe6e5('0x2a')]['id']}})[_0xe6e5('0x16')](handleEntityNotFound(_0x45d9a4,null))[_0xe6e5('0x16')](removeEntity(_0x45d9a4,null))[_0xe6e5('0x33')](handleError(_0x45d9a4,null));};exports[_0xe6e5('0x3c')]=function(_0x107fcd,_0x5d14d9){return db[_0xe6e5('0x25')]['describe']()['then'](respondWithResult(_0x5d14d9,null))[_0xe6e5('0x33')](handleError(_0x5d14d9,null));};exports[_0xe6e5('0x3d')]=function(_0x482f39,_0x42b767){var _0x29c742={'raw':!![],'where':{}},_0x265d23={},_0xb63e58;return db['ChatQueue'][_0xe6e5('0x3e')]({'where':{'id':_0x482f39[_0xe6e5('0x2a')]['id']}})[_0xe6e5('0x16')](handleEntityNotFound(_0x42b767,null))[_0xe6e5('0x16')](function(_0x289d57){if(_0x289d57){_0xb63e58=_0x289d57[_0xe6e5('0x18')]({'plain':!![]});_0x265d23[_0xe6e5('0x2b')]=_[_0xe6e5('0x2c')](db[_0xe6e5('0x3f')][_0xe6e5('0x1f')]);_0x265d23['query']=_['keys'](_0x482f39[_0xe6e5('0x27')]);_0x265d23[_0xe6e5('0x2d')]=_[_0xe6e5('0x2e')](_0x265d23['model'],_0x265d23[_0xe6e5('0x27')]);_0x29c742['attributes']=_[_0xe6e5('0x2e')](_0x265d23[_0xe6e5('0x2b')],qs[_0xe6e5('0x30')](_0x482f39[_0xe6e5('0x27')][_0xe6e5('0x30')]));_0x29c742[_0xe6e5('0x2f')]=_0x29c742[_0xe6e5('0x2f')][_0xe6e5('0x40')]?_0x29c742[_0xe6e5('0x2f')]:_0x265d23[_0xe6e5('0x2b')];if(!_0x482f39[_0xe6e5('0x27')]['hasOwnProperty']('nolimit')){_0x29c742[_0xe6e5('0x10')]=qs[_0xe6e5('0x10')](_0x482f39[_0xe6e5('0x27')]['limit']);_0x29c742[_0xe6e5('0xe')]=qs['offset'](_0x482f39[_0xe6e5('0x27')]['offset']);}_0x29c742[_0xe6e5('0x41')]=qs[_0xe6e5('0x42')](_0x482f39[_0xe6e5('0x27')][_0xe6e5('0x42')]);_0x29c742['where']=qs[_0xe6e5('0x2d')](_[_0xe6e5('0x43')](_0x482f39[_0xe6e5('0x27')],_0x265d23['filters']));_0x29c742[_0xe6e5('0x24')][_0xe6e5('0x44')]=_0x289d57['id'];if(_0x482f39[_0xe6e5('0x27')][_0xe6e5('0x45')]){_0x29c742['where']=_[_0xe6e5('0x31')](_0x29c742[_0xe6e5('0x24')],{'$or':_[_0xe6e5('0x1e')](_0x29c742['attributes'],function(_0x5e5414){var _0x3bc405={};_0x3bc405[_0x5e5414]={'$like':'%'+_0x482f39[_0xe6e5('0x27')]['filter']+'%'};return _0x3bc405;})});}_0x29c742=_[_0xe6e5('0x31')]({},_0x29c742,_0x482f39['options']);return db['UserChatQueue'][_0xe6e5('0x28')](_0x29c742);}})[_0xe6e5('0x16')](function(_0x53ddcd){if(_0x53ddcd){return db[_0xe6e5('0x46')][_0xe6e5('0x47')]({'where':{'id':_[_0xe6e5('0x1e')](_0x53ddcd,_0xe6e5('0x48')),'role':'agent'},'attributes':['id','name',_0xe6e5('0x49'),_0xe6e5('0x4a'),_0xe6e5('0x4b')]});}})[_0xe6e5('0x16')](function(_0x51ea5b){if(_0x51ea5b){return{'count':_0x51ea5b['count'],'rows':_[_0xe6e5('0x1e')](_0x51ea5b[_0xe6e5('0x29')],function(_0x3058f2){return{'membername':_0x3058f2[_0xe6e5('0x1d')],'UserId':_0x3058f2['id'],'queue_name':_0xb63e58[_0xe6e5('0x1d')],'ChatQueueId':_0xb63e58['id'],'interface':util['format'](_0xe6e5('0x4c'),_0xe6e5('0x4d'),_0x3058f2['name']),'penalty':0x0,'paused':_0x3058f2[_0xe6e5('0x49')],'createdAt':_0x3058f2[_0xe6e5('0x4b')],'updatedAt':_0x3058f2[_0xe6e5('0x4a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe6e5('0x16')](respondWithFilteredResult(_0x42b767,_0x29c742))[_0xe6e5('0x33')](handleError(_0x42b767,null));};exports['getTeams']=function(_0x592355,_0x12e178){var _0x5c1909={};var _0x14e99c={};var _0x582248;var _0x8d432;return db[_0xe6e5('0x25')][_0xe6e5('0x3e')]({'where':{'id':_0x592355[_0xe6e5('0x2a')]['id']}})[_0xe6e5('0x16')](handleEntityNotFound(_0x12e178,null))[_0xe6e5('0x16')](function(_0x5ac588){if(_0x5ac588){_0x582248=_0x5ac588;_0x14e99c[_0xe6e5('0x2b')]=_[_0xe6e5('0x2c')](db[_0xe6e5('0x4e')]['rawAttributes']);_0x14e99c[_0xe6e5('0x27')]=_['keys'](_0x592355[_0xe6e5('0x27')]);_0x14e99c['filters']=_[_0xe6e5('0x2e')](_0x14e99c[_0xe6e5('0x2b')],_0x14e99c[_0xe6e5('0x27')]);_0x5c1909[_0xe6e5('0x2f')]=_[_0xe6e5('0x2e')](_0x14e99c[_0xe6e5('0x2b')],qs[_0xe6e5('0x30')](_0x592355['query']['fields']));_0x5c1909[_0xe6e5('0x2f')]=_0x5c1909[_0xe6e5('0x2f')]['length']?_0x5c1909['attributes']:_0x14e99c[_0xe6e5('0x2b')];_0x5c1909['order']=qs[_0xe6e5('0x42')](_0x592355['query'][_0xe6e5('0x42')]);_0x5c1909['where']=qs[_0xe6e5('0x2d')](_['pick'](_0x592355['query'],_0x14e99c[_0xe6e5('0x2d')]));if(_0x592355['query']['filter']){_0x5c1909[_0xe6e5('0x24')]=_[_0xe6e5('0x31')](_0x5c1909[_0xe6e5('0x24')],{'$or':_['map'](_0x5c1909[_0xe6e5('0x2f')],function(_0x5d2e0f){var _0x18a96f={};_0x18a96f[_0x5d2e0f]={'$like':'%'+_0x592355[_0xe6e5('0x27')]['filter']+'%'};return _0x18a96f;})});}_0x5c1909=_['merge']({},_0x5c1909,_0x592355['options']);return _0x582248[_0xe6e5('0x4f')](_0x5c1909);}})[_0xe6e5('0x16')](function(_0x420428){if(_0x420428){_0x8d432=_0x420428[_0xe6e5('0x40')];if(!_0x592355['query'][_0xe6e5('0x50')]('nolimit')){_0x5c1909[_0xe6e5('0x10')]=qs[_0xe6e5('0x10')](_0x592355['query'][_0xe6e5('0x10')]);_0x5c1909[_0xe6e5('0xe')]=qs[_0xe6e5('0xe')](_0x592355[_0xe6e5('0x27')][_0xe6e5('0xe')]);}return _0x582248[_0xe6e5('0x4f')](_0x5c1909);}})[_0xe6e5('0x16')](function(_0x545e4c){if(_0x545e4c){return _0x545e4c?{'count':_0x8d432,'rows':_0x545e4c}:null;}})[_0xe6e5('0x16')](respondWithResult(_0x12e178,null))[_0xe6e5('0x33')](handleError(_0x12e178,null));};exports[_0xe6e5('0x51')]=function(_0x2a801c,_0x2231df){var _0x5ee6d4=_0x2a801c[_0xe6e5('0x35')][_0xe6e5('0x52')];return db[_0xe6e5('0x4e')][_0xe6e5('0x28')]({'where':{'id':_0x5ee6d4},'attributes':['id'],'include':[{'model':db[_0xe6e5('0x46')],'as':_0xe6e5('0x53'),'attributes':['id','name','online','voicePause',_0xe6e5('0x54')],'raw':!![]}]})[_0xe6e5('0x16')](function(_0x38a3e1){if(_0x38a3e1){var _0xe521bb=_[_0xe6e5('0x55')](_0x38a3e1,function(_0x5a2e9f){var _0x3fdee1=_0x5a2e9f['get']({'plain':!![]});return _0x3fdee1[_0xe6e5('0x53')];});return db[_0xe6e5('0x25')][_0xe6e5('0x32')]({'where':{'id':_0x2a801c[_0xe6e5('0x2a')]['id']}})[_0xe6e5('0x16')](function(_0x5adcc7){return db['sequelize'][_0xe6e5('0x56')](function(_0x271fd6){return _0x5adcc7[_0xe6e5('0x51')](_0x5ee6d4,{'transaction':_0x271fd6})[_0xe6e5('0x16')](function(){return BPromise[_0xe6e5('0x57')](_0xe521bb,function(_0x2313a5){return db['UserChatQueue'][_0xe6e5('0x58')]({'where':{'UserId':_0x2313a5['id'],'ChatQueueId':_0x2a801c[_0xe6e5('0x2a')]['id']},'transaction':_0x271fd6});});})['then'](function(){_0xe521bb['forEach'](function(_0x27156b){socket[_0xe6e5('0x59')]('userChatQueue:save',{'UserId':_0x27156b['id'],'ChatQueueId':_0x5adcc7['id']});});});});});}})['then'](respondWithStatusCode(_0x2231df,null))[_0xe6e5('0x33')](handleError(_0x2231df,null));};exports[_0xe6e5('0x5a')]=function(_0x5df89b,_0x5353b4){return db[_0xe6e5('0x4e')]['findAll']({'where':{'id':_0x5df89b[_0xe6e5('0x27')][_0xe6e5('0x52')]},'attributes':['id'],'include':[{'model':db[_0xe6e5('0x46')],'as':_0xe6e5('0x53'),'attributes':['id'],'raw':!![]}]})[_0xe6e5('0x16')](handleEntityNotFound(_0x5353b4,null))[_0xe6e5('0x16')](function(_0x29bd29){var _0x45550b=_[_0xe6e5('0x1e')](_0x29bd29,'id');var _0x640a5f=[];var _0x4f042a=[];var _0xeaa19a=squel['select']();_0xeaa19a[_0xe6e5('0x5b')](_0xe6e5('0x5c'))[_0xe6e5('0x5d')](_0xe6e5('0x5e'),'tq')[_0xe6e5('0x5f')](_0xe6e5('0x60'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xe6e5('0x24')]('ChatQueueId\x20=\x20?',_0x5df89b[_0xe6e5('0x2a')]['id']);for(var _0x502e4e=0x0;_0x502e4e<_0x29bd29[_0xe6e5('0x40')];_0x502e4e+=0x1){let _0x4b50c6=_0x29bd29[_0x502e4e];for(var _0x52c53a=0x0;_0x52c53a<_0x4b50c6[_0xe6e5('0x53')]['length'];_0x52c53a+=0x1){let _0x54a87f=_0x4b50c6[_0xe6e5('0x53')][_0x52c53a];var _0x3d1ccc=_0xeaa19a[_0xe6e5('0x61')]();_0x3d1ccc[_0xe6e5('0x24')]('ut.UserId\x20=\x20?',_0x54a87f['id']);_0x4f042a[_0xe6e5('0x62')](db['sequelize']['query'](_0x3d1ccc[_0xe6e5('0x63')](),{'type':db[_0xe6e5('0x64')]['QueryTypes'][_0xe6e5('0x65')]})[_0xe6e5('0x16')](function(_0x25e4f0){if(_0x25e4f0[_0xe6e5('0x40')]===0x1){return _0x54a87f['id'];}else{var _0xc07923=_[_0xe6e5('0x66')](_[_0xe6e5('0x1e')](_0x25e4f0,_0xe6e5('0x67')),function(_0x5579f1){return _[_0xe6e5('0x68')](_0x45550b,_0x5579f1);});if(_0xc07923){return _0x54a87f['id'];}}}));}}return BPromise[_0xe6e5('0x69')](_0x4f042a)[_0xe6e5('0x16')](function(_0x2a243a){_0x640a5f=_(_0x640a5f)['union'](_0x2a243a)['compact']()[_0xe6e5('0x6a')]();return db[_0xe6e5('0x25')]['find']({'where':{'id':_0x5df89b[_0xe6e5('0x2a')]['id']}})[_0xe6e5('0x16')](function(_0xe0f5b3){return db['sequelize'][_0xe6e5('0x56')](function(_0x5a40d8){return _0xe0f5b3['removeTeams'](_0x5df89b[_0xe6e5('0x27')][_0xe6e5('0x52')],{'transaction':_0x5a40d8})[_0xe6e5('0x16')](function(){if(!_['isEmpty'](_0x640a5f)){return _0xe0f5b3['removeAgents'](_0x640a5f,{'transaction':_0x5a40d8});}})['then'](function(){_0x640a5f[_0xe6e5('0x6b')](function(_0x4f89de){socket[_0xe6e5('0x59')](_0xe6e5('0x6c'),{'UserId':_0x4f89de,'ChatQueueId':_0xe0f5b3['id']});});});});});});})[_0xe6e5('0x16')](respondWithStatusCode(_0x5353b4,null))[_0xe6e5('0x33')](handleError(_0x5353b4,null));};exports[_0xe6e5('0x6d')]=function(_0x3b3476,_0x49d605){return db[_0xe6e5('0x25')]['find']({'where':{'id':_0x3b3476[_0xe6e5('0x2a')]['id']}})[_0xe6e5('0x16')](handleEntityNotFound(_0x49d605,null))[_0xe6e5('0x16')](function(_0x20b8d6){if(_0x20b8d6){return _0x20b8d6['addAgents'](_0x3b3476[_0xe6e5('0x35')][_0xe6e5('0x52')],_[_0xe6e5('0x6e')](_0x3b3476[_0xe6e5('0x35')],[_0xe6e5('0x52'),'id'])||{})[_0xe6e5('0x6f')](function(_0x4ebbf2){for(var _0x32d7cf=0x0;_0x32d7cf<_0x3b3476[_0xe6e5('0x35')][_0xe6e5('0x52')]['length'];_0x32d7cf+=0x1){socket[_0xe6e5('0x59')](_0xe6e5('0x70'),{'UserId':Number(_0x3b3476[_0xe6e5('0x35')][_0xe6e5('0x52')][_0x32d7cf]),'ChatQueueId':Number(_0x3b3476[_0xe6e5('0x2a')]['id'])});}return _0x4ebbf2;});}})['then'](respondWithResult(_0x49d605,null))[_0xe6e5('0x33')](handleError(_0x49d605,null));};exports[_0xe6e5('0x71')]=function(_0x4e155a,_0x19d01a){return db['ChatQueue'][_0xe6e5('0x32')]({'where':{'id':_0x4e155a[_0xe6e5('0x2a')]['id']}})['then'](handleEntityNotFound(_0x19d01a,null))[_0xe6e5('0x16')](function(_0x38555c){if(_0x38555c){return _0x38555c[_0xe6e5('0x71')](_0x4e155a['query']['ids'])[_0xe6e5('0x16')](function(){if(_[_0xe6e5('0x72')](_0x4e155a[_0xe6e5('0x27')][_0xe6e5('0x52')])){for(var _0x38e519=0x0;_0x38e519<_0x4e155a[_0xe6e5('0x27')][_0xe6e5('0x52')][_0xe6e5('0x40')];_0x38e519+=0x1){socket[_0xe6e5('0x59')](_0xe6e5('0x6c'),{'UserId':Number(_0x4e155a[_0xe6e5('0x27')][_0xe6e5('0x52')][_0x38e519]),'ChatQueueId':Number(_0x4e155a['params']['id'])});}}else{socket[_0xe6e5('0x59')](_0xe6e5('0x6c'),{'UserId':Number(_0x4e155a['query'][_0xe6e5('0x52')]),'ChatQueueId':Number(_0x4e155a[_0xe6e5('0x2a')]['id'])});}});}})[_0xe6e5('0x16')](respondWithStatusCode(_0x19d01a,null))[_0xe6e5('0x33')](handleError(_0x19d01a,null));};exports[_0xe6e5('0x73')]=function(_0x4d3370,_0x4ce4f2){var _0xdb6ef7={};var _0x4da7c7={};var _0x9b7127;var _0x2374ea;return db[_0xe6e5('0x25')][_0xe6e5('0x3e')]({'where':{'id':_0x4d3370['params']['id']}})[_0xe6e5('0x16')](handleEntityNotFound(_0x4ce4f2,null))[_0xe6e5('0x16')](function(_0x53d231){if(_0x53d231){_0x9b7127=_0x53d231;_0x4da7c7[_0xe6e5('0x2b')]=_[_0xe6e5('0x2c')](db[_0xe6e5('0x46')]['rawAttributes']);_0x4da7c7[_0xe6e5('0x27')]=_[_0xe6e5('0x2c')](_0x4d3370['query']);_0x4da7c7[_0xe6e5('0x2d')]=_[_0xe6e5('0x2e')](_0x4da7c7[_0xe6e5('0x2b')],_0x4da7c7[_0xe6e5('0x27')]);_0xdb6ef7[_0xe6e5('0x2f')]=_['intersection'](_0x4da7c7[_0xe6e5('0x2b')],qs[_0xe6e5('0x30')](_0x4d3370[_0xe6e5('0x27')]['fields']));_0xdb6ef7[_0xe6e5('0x2f')]=_0xdb6ef7[_0xe6e5('0x2f')][_0xe6e5('0x40')]?_0xdb6ef7[_0xe6e5('0x2f')]:_0x4da7c7[_0xe6e5('0x2b')];_0xdb6ef7[_0xe6e5('0x41')]=qs['sort'](_0x4d3370[_0xe6e5('0x27')][_0xe6e5('0x42')]);_0xdb6ef7['where']=qs[_0xe6e5('0x2d')](_[_0xe6e5('0x43')](_0x4d3370[_0xe6e5('0x27')],_0x4da7c7[_0xe6e5('0x2d')]));if(_0x4d3370[_0xe6e5('0x27')][_0xe6e5('0x45')]){_0xdb6ef7[_0xe6e5('0x24')]=_[_0xe6e5('0x31')](_0xdb6ef7['where'],{'$or':_[_0xe6e5('0x1e')](_0xdb6ef7[_0xe6e5('0x2f')],function(_0xfc8e96){var _0x2eae33={};_0x2eae33[_0xfc8e96]={'$like':'%'+_0x4d3370[_0xe6e5('0x27')][_0xe6e5('0x45')]+'%'};return _0x2eae33;})});}_0xdb6ef7=_[_0xe6e5('0x31')]({},_0xdb6ef7,_0x4d3370[_0xe6e5('0x74')]);return _0x9b7127[_0xe6e5('0x73')](_0xdb6ef7);}})[_0xe6e5('0x16')](function(_0x447106){if(_0x447106){_0x2374ea=_0x447106[_0xe6e5('0x40')];if(!_0x4d3370[_0xe6e5('0x27')][_0xe6e5('0x50')](_0xe6e5('0x75'))){_0xdb6ef7['limit']=qs['limit'](_0x4d3370[_0xe6e5('0x27')]['limit']);_0xdb6ef7[_0xe6e5('0xe')]=qs[_0xe6e5('0xe')](_0x4d3370[_0xe6e5('0x27')][_0xe6e5('0xe')]);}return _0x9b7127[_0xe6e5('0x73')](_0xdb6ef7);}})[_0xe6e5('0x16')](function(_0xd458e4){if(_0xd458e4){return _0xd458e4?{'count':_0x2374ea,'rows':_0xd458e4}:null;}})[_0xe6e5('0x16')](respondWithResult(_0x4ce4f2,null))['catch'](handleError(_0x4ce4f2,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 20cd129..436f275 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 _0xdcbd=['events','ChatQueue','setMaxListeners','update','emit','hasOwnProperty','exports'];(function(_0x2314f4,_0x1180c4){var _0x593f9b=function(_0x2ea7bb){while(--_0x2ea7bb){_0x2314f4['push'](_0x2314f4['shift']());}};_0x593f9b(++_0x1180c4);}(_0xdcbd,0xb6));var _0xddcb=function(_0x39a3c9,_0x190d73){_0x39a3c9=_0x39a3c9-0x0;var _0x1025e3=_0xdcbd[_0x39a3c9];return _0x1025e3;};'use strict';var EventEmitter=require(_0xddcb('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xddcb('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xddcb('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xddcb('0x3'),'afterDestroy':'remove'};function emitEvent(_0x580cd8){return function(_0x3b4939,_0x460a5,_0x1c082e){ChatQueueEvents[_0xddcb('0x4')](_0x580cd8+':'+_0x3b4939['id'],_0x3b4939);ChatQueueEvents[_0xddcb('0x4')](_0x580cd8,_0x3b4939);_0x1c082e(null);};}for(var e in events){if(events[_0xddcb('0x5')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0xddcb('0x6')]=ChatQueueEvents; \ No newline at end of file +var _0x44f1=['ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x40c12e,_0x58a6ca){var _0x771bfd=function(_0x2925e0){while(--_0x2925e0){_0x40c12e['push'](_0x40c12e['shift']());}};_0x771bfd(++_0x58a6ca);}(_0x44f1,0x169));var _0x144f=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x44f1[_0x40ac5e];return _0x2839d6;};'use strict';var EventEmitter=require(_0x144f('0x0'));var ChatQueue=require(_0x144f('0x1'))['db'][_0x144f('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x144f('0x3')](0x0);var events={'afterCreate':_0x144f('0x4'),'afterUpdate':_0x144f('0x5'),'afterDestroy':_0x144f('0x6')};function emitEvent(_0x54db15){return function(_0x5651d8,_0x678a34,_0x3d359c){ChatQueueEvents['emit'](_0x54db15+':'+_0x5651d8['id'],_0x5651d8);ChatQueueEvents[_0x144f('0x7')](_0x54db15,_0x5651d8);_0x3d359c(null);};}for(var e in events){if(events[_0x144f('0x8')](e)){var event=events[e];ChatQueue[_0x144f('0x9')](e,emitEvent(event));}}module[_0x144f('0xa')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 1a5cfd7..97721af 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 _0x3267=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util'];(function(_0x59efbb,_0x1b77e1){var _0x1e143c=function(_0x411003){while(--_0x411003){_0x59efbb['push'](_0x59efbb['shift']());}};_0x1e143c(++_0x1b77e1);}(_0x3267,0xd0));var _0x7326=function(_0x55daf2,_0x1b48de){_0x55daf2=_0x55daf2-0x0;var _0x1c8500=_0x3267[_0x55daf2];return _0x1c8500;};'use strict';var _=require(_0x7326('0x0'));var util=require(_0x7326('0x1'));var logger=require(_0x7326('0x2'))(_0x7326('0x3'));var moment=require(_0x7326('0x4'));var BPromise=require(_0x7326('0x5'));var rp=require(_0x7326('0x6'));var fs=require('fs');var path=require(_0x7326('0x7'));var rimraf=require(_0x7326('0x8'));var config=require('../../config/environment');var attributes=require(_0x7326('0x9'));module[_0x7326('0xa')]=function(_0x4ca28d,_0x52a945){return _0x4ca28d[_0x7326('0xb')](_0x7326('0xc'),attributes,{'tableName':_0x7326('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x23c3=['chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatQueue.attributes','exports','define','ChatQueue'];(function(_0x1c4987,_0x1ac3ee){var _0x5aa453=function(_0x49ff6e){while(--_0x49ff6e){_0x1c4987['push'](_0x1c4987['shift']());}};_0x5aa453(++_0x1ac3ee);}(_0x23c3,0x71));var _0x323c=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x23c3[_0x45783c];return _0x1161da;};'use strict';var _=require(_0x323c('0x0'));var util=require(_0x323c('0x1'));var logger=require(_0x323c('0x2'))(_0x323c('0x3'));var moment=require(_0x323c('0x4'));var BPromise=require(_0x323c('0x5'));var rp=require(_0x323c('0x6'));var fs=require('fs');var path=require(_0x323c('0x7'));var rimraf=require(_0x323c('0x8'));var config=require('../../config/environment');var attributes=require(_0x323c('0x9'));module[_0x323c('0xa')]=function(_0x7bd08d,_0x28a1a5){return _0x7bd08d[_0x323c('0xb')](_0x323c('0xc'),attributes,{'tableName':_0x323c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index 09e7f44..b5b1aad 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 _0xf9ae=['result','catch','GetChatQueue','ChatQueue','findAll','options','raw','limit','include','model','map','stringify','ShowChatQueue','find','where','attributes','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','./chatQueue.socket','then','info','ChatQueue,\x20%s,\x20%s','debug','request\x20sent','error','code','message'];(function(_0x3ea0ae,_0x4825de){var _0x4a78da=function(_0x2eb1d7){while(--_0x2eb1d7){_0x3ea0ae['push'](_0x3ea0ae['shift']());}};_0x4a78da(++_0x4825de);}(_0xf9ae,0x85));var _0xef9a=function(_0x5c0fc4,_0x41e8fa){_0x5c0fc4=_0x5c0fc4-0x0;var _0x95c33f=_0xf9ae[_0x5c0fc4];return _0x95c33f;};'use strict';var _=require(_0xef9a('0x0'));var util=require(_0xef9a('0x1'));var moment=require('moment');var BPromise=require(_0xef9a('0x2'));var rs=require(_0xef9a('0x3'));var fs=require('fs');var Redis=require(_0xef9a('0x4'));var db=require(_0xef9a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xef9a('0x6'))(_0xef9a('0x7'));var config=require('../../config/environment');var jayson=require(_0xef9a('0x8'));var client=jayson[_0xef9a('0x9')][_0xef9a('0xa')]({'port':0x232a});config['redis']=_[_0xef9a('0xb')](config[_0xef9a('0xc')],{'host':_0xef9a('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xef9a('0xc')]));require(_0xef9a('0xe'))['register'](socket);function respondWithRpcPromise(_0x2bbab4,_0xa39500,_0x25b83a){return new BPromise(function(_0x5e70f6,_0xc7ce85){return client['request'](_0x2bbab4,_0x25b83a)[_0xef9a('0xf')](function(_0xd021c1){logger[_0xef9a('0x10')](_0xef9a('0x11'),_0xa39500,'request\x20sent');logger[_0xef9a('0x12')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0xa39500,_0xef9a('0x13'),JSON['stringify'](_0xd021c1));if(_0xd021c1[_0xef9a('0x14')]){if(_0xd021c1[_0xef9a('0x14')][_0xef9a('0x15')]===0x1f4){logger[_0xef9a('0x14')]('ChatQueue,\x20%s,\x20%s',_0xa39500,_0xd021c1[_0xef9a('0x14')][_0xef9a('0x16')]);return _0xc7ce85(_0xd021c1[_0xef9a('0x14')][_0xef9a('0x16')]);}logger[_0xef9a('0x14')](_0xef9a('0x11'),_0xa39500,_0xd021c1[_0xef9a('0x14')]['message']);return _0x5e70f6(_0xd021c1[_0xef9a('0x14')][_0xef9a('0x16')]);}else{logger['info'](_0xef9a('0x11'),_0xa39500,_0xef9a('0x13'));_0x5e70f6(_0xd021c1[_0xef9a('0x17')][_0xef9a('0x16')]);}})[_0xef9a('0x18')](function(_0x432a79){logger[_0xef9a('0x14')](_0xef9a('0x11'),_0xa39500,_0x432a79);_0xc7ce85(_0x432a79);});});}exports[_0xef9a('0x19')]=function(_0x585278){var _0x2e9b02=this;return new Promise(function(_0xac6117,_0x6d6e2f){return db[_0xef9a('0x1a')][_0xef9a('0x1b')]({'raw':_0x585278[_0xef9a('0x1c')]?_0x585278[_0xef9a('0x1c')][_0xef9a('0x1d')]===undefined?!![]:![]:!![],'where':_0x585278[_0xef9a('0x1c')]?_0x585278[_0xef9a('0x1c')]['where']||null:null,'attributes':_0x585278['options']?_0x585278[_0xef9a('0x1c')]['attributes']||null:null,'limit':_0x585278[_0xef9a('0x1c')]?_0x585278[_0xef9a('0x1c')][_0xef9a('0x1e')]||null:null,'include':_0x585278['options']?_0x585278[_0xef9a('0x1c')][_0xef9a('0x1f')]?_['map'](_0x585278[_0xef9a('0x1c')]['include'],function(_0x55598c){return{'model':db[_0x55598c['model']],'as':_0x55598c['as'],'attributes':_0x55598c['attributes'],'include':_0x55598c['include']?_['map'](_0x55598c[_0xef9a('0x1f')],function(_0x3964d6){return{'model':db[_0x3964d6[_0xef9a('0x20')]],'as':_0x3964d6['as'],'attributes':_0x3964d6['attributes'],'include':_0x3964d6['include']?_[_0xef9a('0x21')](_0x3964d6[_0xef9a('0x1f')],function(_0x3050cf){return{'model':db[_0x3050cf[_0xef9a('0x20')]],'as':_0x3050cf['as'],'attributes':_0x3050cf['attributes']};}):[]};}):[]};}):[]:[]})[_0xef9a('0xf')](function(_0x240b9d){logger[_0xef9a('0x10')]('GetChatQueue',_0x585278);logger[_0xef9a('0x12')](_0xef9a('0x19'),_0x585278,JSON[_0xef9a('0x22')](_0x240b9d));_0xac6117(_0x240b9d);})[_0xef9a('0x18')](function(_0x5f5c6a){logger['error'](_0xef9a('0x19'),_0x5f5c6a[_0xef9a('0x16')],_0x585278);_0x6d6e2f(_0x2e9b02['error'](0x1f4,_0x5f5c6a[_0xef9a('0x16')]));});});};exports[_0xef9a('0x23')]=function(_0x448e51){var _0x16f679=this;return new Promise(function(_0x43242d,_0xe90517){return db[_0xef9a('0x1a')][_0xef9a('0x24')]({'raw':_0x448e51[_0xef9a('0x1c')]?_0x448e51[_0xef9a('0x1c')][_0xef9a('0x1d')]===undefined?!![]:![]:!![],'where':_0x448e51['options']?_0x448e51['options'][_0xef9a('0x25')]||null:null,'attributes':_0x448e51['options']?_0x448e51[_0xef9a('0x1c')][_0xef9a('0x26')]||null:null,'include':_0x448e51[_0xef9a('0x1c')]?_0x448e51[_0xef9a('0x1c')][_0xef9a('0x1f')]?_[_0xef9a('0x21')](_0x448e51[_0xef9a('0x1c')][_0xef9a('0x1f')],function(_0x3d41bf){return{'model':db[_0x3d41bf[_0xef9a('0x20')]],'as':_0x3d41bf['as'],'attributes':_0x3d41bf[_0xef9a('0x26')],'include':_0x3d41bf[_0xef9a('0x1f')]?_['map'](_0x3d41bf['include'],function(_0x507e56){return{'model':db[_0x507e56[_0xef9a('0x20')]],'as':_0x507e56['as'],'attributes':_0x507e56[_0xef9a('0x26')],'include':_0x507e56['include']?_[_0xef9a('0x21')](_0x507e56['include'],function(_0x3506c){return{'model':db[_0x3506c['model']],'as':_0x3506c['as'],'attributes':_0x3506c[_0xef9a('0x26')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4021ef){logger[_0xef9a('0x10')]('ShowChatQueue',_0x448e51);logger[_0xef9a('0x12')](_0xef9a('0x23'),_0x448e51,JSON[_0xef9a('0x22')](_0x4021ef));_0x43242d(_0x4021ef);})[_0xef9a('0x18')](function(_0x19bf47){logger[_0xef9a('0x14')]('ShowChatQueue',_0x19bf47['message'],_0x448e51);_0xe90517(_0x16f679['error'](0x1f4,_0x19bf47[_0xef9a('0x16')]));});});}; \ No newline at end of file +var _0xe75a=['GetChatQueue','catch','find','ShowChatQueue','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','ChatQueue','findAll','options','raw','attributes','limit','include','map','model'];(function(_0x3bc222,_0x481df5){var _0x574be4=function(_0x1f5a5a){while(--_0x1f5a5a){_0x3bc222['push'](_0x3bc222['shift']());}};_0x574be4(++_0x481df5);}(_0xe75a,0x115));var _0xae75=function(_0x3d7a9f,_0x24e0f1){_0x3d7a9f=_0x3d7a9f-0x0;var _0x13f5f1=_0xe75a[_0x3d7a9f];return _0x13f5f1;};'use strict';var _=require('lodash');var util=require(_0xae75('0x0'));var moment=require(_0xae75('0x1'));var BPromise=require(_0xae75('0x2'));var rs=require(_0xae75('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xae75('0x4'))['db'];var utils=require(_0xae75('0x5'));var logger=require(_0xae75('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xae75('0x7')][_0xae75('0x8')]({'port':0x232a});config[_0xae75('0x9')]=_[_0xae75('0xa')](config['redis'],{'host':_0xae75('0xb'),'port':0x18eb});var socket=require(_0xae75('0xc'))(new Redis(config[_0xae75('0x9')]));require(_0xae75('0xd'))['register'](socket);function respondWithRpcPromise(_0x3f3412,_0xfe558e,_0xa5a5ce){return new BPromise(function(_0xf924a6,_0x196972){return client[_0xae75('0xe')](_0x3f3412,_0xa5a5ce)[_0xae75('0xf')](function(_0x5f3c49){logger['info'](_0xae75('0x10'),_0xfe558e,_0xae75('0x11'));logger[_0xae75('0x12')](_0xae75('0x13'),_0xfe558e,'request\x20sent',JSON[_0xae75('0x14')](_0x5f3c49));if(_0x5f3c49['error']){if(_0x5f3c49[_0xae75('0x15')][_0xae75('0x16')]===0x1f4){logger[_0xae75('0x15')](_0xae75('0x10'),_0xfe558e,_0x5f3c49[_0xae75('0x15')]['message']);return _0x196972(_0x5f3c49[_0xae75('0x15')][_0xae75('0x17')]);}logger[_0xae75('0x15')](_0xae75('0x10'),_0xfe558e,_0x5f3c49['error'][_0xae75('0x17')]);return _0xf924a6(_0x5f3c49[_0xae75('0x15')][_0xae75('0x17')]);}else{logger[_0xae75('0x18')]('ChatQueue,\x20%s,\x20%s',_0xfe558e,'request\x20sent');_0xf924a6(_0x5f3c49[_0xae75('0x19')]['message']);}})['catch'](function(_0x5e415d){logger['error'](_0xae75('0x10'),_0xfe558e,_0x5e415d);_0x196972(_0x5e415d);});});}exports['GetChatQueue']=function(_0x155454){var _0x2bdb10=this;return new Promise(function(_0x43c06b,_0x5b8df1){return db[_0xae75('0x1a')][_0xae75('0x1b')]({'raw':_0x155454[_0xae75('0x1c')]?_0x155454['options'][_0xae75('0x1d')]===undefined?!![]:![]:!![],'where':_0x155454[_0xae75('0x1c')]?_0x155454['options']['where']||null:null,'attributes':_0x155454[_0xae75('0x1c')]?_0x155454['options'][_0xae75('0x1e')]||null:null,'limit':_0x155454[_0xae75('0x1c')]?_0x155454[_0xae75('0x1c')][_0xae75('0x1f')]||null:null,'include':_0x155454[_0xae75('0x1c')]?_0x155454[_0xae75('0x1c')][_0xae75('0x20')]?_[_0xae75('0x21')](_0x155454[_0xae75('0x1c')][_0xae75('0x20')],function(_0x2ac86c){return{'model':db[_0x2ac86c[_0xae75('0x22')]],'as':_0x2ac86c['as'],'attributes':_0x2ac86c[_0xae75('0x1e')],'include':_0x2ac86c['include']?_[_0xae75('0x21')](_0x2ac86c[_0xae75('0x20')],function(_0x33eb2a){return{'model':db[_0x33eb2a[_0xae75('0x22')]],'as':_0x33eb2a['as'],'attributes':_0x33eb2a['attributes'],'include':_0x33eb2a['include']?_['map'](_0x33eb2a[_0xae75('0x20')],function(_0x4f5de0){return{'model':db[_0x4f5de0[_0xae75('0x22')]],'as':_0x4f5de0['as'],'attributes':_0x4f5de0[_0xae75('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xae75('0xf')](function(_0x256993){logger['info']('GetChatQueue',_0x155454);logger[_0xae75('0x12')](_0xae75('0x23'),_0x155454,JSON[_0xae75('0x14')](_0x256993));_0x43c06b(_0x256993);})[_0xae75('0x24')](function(_0x42f7cb){logger[_0xae75('0x15')]('GetChatQueue',_0x42f7cb[_0xae75('0x17')],_0x155454);_0x5b8df1(_0x2bdb10[_0xae75('0x15')](0x1f4,_0x42f7cb[_0xae75('0x17')]));});});};exports['ShowChatQueue']=function(_0x136014){var _0x23c43e=this;return new Promise(function(_0x238928,_0x2042ae){return db['ChatQueue'][_0xae75('0x25')]({'raw':_0x136014[_0xae75('0x1c')]?_0x136014[_0xae75('0x1c')][_0xae75('0x1d')]===undefined?!![]:![]:!![],'where':_0x136014[_0xae75('0x1c')]?_0x136014[_0xae75('0x1c')]['where']||null:null,'attributes':_0x136014[_0xae75('0x1c')]?_0x136014[_0xae75('0x1c')][_0xae75('0x1e')]||null:null,'include':_0x136014[_0xae75('0x1c')]?_0x136014['options'][_0xae75('0x20')]?_['map'](_0x136014[_0xae75('0x1c')]['include'],function(_0x478525){return{'model':db[_0x478525[_0xae75('0x22')]],'as':_0x478525['as'],'attributes':_0x478525[_0xae75('0x1e')],'include':_0x478525[_0xae75('0x20')]?_[_0xae75('0x21')](_0x478525[_0xae75('0x20')],function(_0x25aa62){return{'model':db[_0x25aa62[_0xae75('0x22')]],'as':_0x25aa62['as'],'attributes':_0x25aa62[_0xae75('0x1e')],'include':_0x25aa62[_0xae75('0x20')]?_[_0xae75('0x21')](_0x25aa62[_0xae75('0x20')],function(_0x4f418f){return{'model':db[_0x4f418f[_0xae75('0x22')]],'as':_0x4f418f['as'],'attributes':_0x4f418f[_0xae75('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xae75('0xf')](function(_0x5a0134){logger[_0xae75('0x18')](_0xae75('0x26'),_0x136014);logger[_0xae75('0x12')]('ShowChatQueue',_0x136014,JSON[_0xae75('0x14')](_0x5a0134));_0x238928(_0x5a0134);})[_0xae75('0x24')](function(_0x3463b8){logger[_0xae75('0x15')](_0xae75('0x26'),_0x3463b8['message'],_0x136014);_0x2042ae(_0x23c43e[_0xae75('0x15')](0x1f4,_0x3463b8[_0xae75('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index db69efa..e3ed20c 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 _0x0ba7=['emit','removeListener','register','length','chatQueue:','./chatQueue.events','remove','update'];(function(_0x296129,_0x52117e){var _0x469ed0=function(_0x103898){while(--_0x103898){_0x296129['push'](_0x296129['shift']());}};_0x469ed0(++_0x52117e);}(_0x0ba7,0x16d));var _0x70ba=function(_0x89c66d,_0x192137){_0x89c66d=_0x89c66d-0x0;var _0x58c569=_0x0ba7[_0x89c66d];return _0x58c569;};'use strict';var ChatQueueEvents=require(_0x70ba('0x0'));var events=['save',_0x70ba('0x1'),_0x70ba('0x2')];function createListener(_0xadfc69,_0x42d93c){return function(_0x5e5368){_0x42d93c[_0x70ba('0x3')](_0xadfc69,_0x5e5368);};}function removeListener(_0x3e20ab,_0x3cb2e3){return function(){ChatQueueEvents[_0x70ba('0x4')](_0x3e20ab,_0x3cb2e3);};}exports[_0x70ba('0x5')]=function(_0x3f9877){for(var _0x17a00c=0x0,_0x2d5a16=events[_0x70ba('0x6')];_0x17a00c<_0x2d5a16;_0x17a00c++){var _0x1185cb=events[_0x17a00c];var _0x1a968b=createListener(_0x70ba('0x7')+_0x1185cb,_0x3f9877);ChatQueueEvents['on'](_0x1185cb,_0x1a968b);}}; \ No newline at end of file +var _0x4c6d=['emit','removeListener','register','length','chatQueue:','./chatQueue.events','save','remove','update'];(function(_0x13fd88,_0x1e0d26){var _0x399a2f=function(_0x179447){while(--_0x179447){_0x13fd88['push'](_0x13fd88['shift']());}};_0x399a2f(++_0x1e0d26);}(_0x4c6d,0x1d0));var _0xd4c6=function(_0x3c69a3,_0xb8ce21){_0x3c69a3=_0x3c69a3-0x0;var _0x46e814=_0x4c6d[_0x3c69a3];return _0x46e814;};'use strict';var ChatQueueEvents=require(_0xd4c6('0x0'));var events=[_0xd4c6('0x1'),_0xd4c6('0x2'),_0xd4c6('0x3')];function createListener(_0x350cc0,_0x5448bc){return function(_0x209f99){_0x5448bc[_0xd4c6('0x4')](_0x350cc0,_0x209f99);};}function removeListener(_0x306766,_0x4b2d75){return function(){ChatQueueEvents[_0xd4c6('0x5')](_0x306766,_0x4b2d75);};}exports[_0xd4c6('0x6')]=function(_0x56279c){for(var _0x182671=0x0,_0x316314=events[_0xd4c6('0x7')];_0x182671<_0x316314;_0x182671++){var _0x5d4fce=events[_0x182671];var _0x440ee3=createListener(_0xd4c6('0x8')+_0x5d4fce,_0x56279c);ChatQueueEvents['on'](_0x5d4fce,_0x440ee3);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 6296ab4..de1339e 100644 --- a/server/api/chatQueue/index.js +++ b/server/api/chatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x34b2e2,_0x70422e){var _0x23e130=function(_0x4a7c99){while(--_0x4a7c99){_0x34b2e2['push'](_0x34b2e2['shift']());}};_0x23e130(++_0x70422e);}(_0x7217,0x19e));var _0x7721=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0x7217[_0x5e3b04];return _0x1fc44d;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router; \ No newline at end of file +var _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0x5fc3,0xa8));var _0x35fc=function(_0x375492,_0x4ed149){_0x375492=_0x375492-0x0;var _0x18ba5b=_0x5fc3[_0x375492];return _0x18ba5b;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 4e10dc1..5d86225 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 _0x4e8b=['moment','sequelize','exports','STRING','DATE'];(function(_0x348187,_0x56c8ad){var _0x437a67=function(_0x206bba){while(--_0x206bba){_0x348187['push'](_0x348187['shift']());}};_0x437a67(++_0x56c8ad);}(_0x4e8b,0x159));var _0xb4e8=function(_0x412e27,_0x20a978){_0x412e27=_0x412e27-0x0;var _0x53da42=_0x4e8b[_0x412e27];return _0x53da42;};'use strict';var moment=require(_0xb4e8('0x0'));var Sequelize=require(_0xb4e8('0x1'));module[_0xb4e8('0x2')]={'uniqueid':{'type':Sequelize[_0xb4e8('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xb4e8('0x3')]},'joinAt':{'type':Sequelize[_0xb4e8('0x4')]},'leaveAt':{'type':Sequelize[_0xb4e8('0x4')]},'acceptAt':{'type':Sequelize[_0xb4e8('0x4')]},'exitAt':{'type':Sequelize[_0xb4e8('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7fbc=['exports','STRING','DATE','sequelize'];(function(_0x195e29,_0x4404a3){var _0x280ade=function(_0xf6548d){while(--_0xf6548d){_0x195e29['push'](_0x195e29['shift']());}};_0x280ade(++_0x4404a3);}(_0x7fbc,0x73));var _0xc7fb=function(_0xcf348,_0x41e8d3){_0xcf348=_0xcf348-0x0;var _0x333793=_0x7fbc[_0xcf348];return _0x333793;};'use strict';var moment=require('moment');var Sequelize=require(_0xc7fb('0x0'));module[_0xc7fb('0x1')]={'uniqueid':{'type':Sequelize[_0xc7fb('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xc7fb('0x3')]},'leaveAt':{'type':Sequelize[_0xc7fb('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xc7fb('0x3')]},'reason':{'type':Sequelize[_0xc7fb('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index e431a52..11622cf 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 _0xd69e=['query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','ChatQueueReport','includeAll','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','sox','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','end','status','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model'];(function(_0x5f626c,_0x17cc7d){var _0x2f71e5=function(_0x524a20){while(--_0x524a20){_0x5f626c['push'](_0x5f626c['shift']());}};_0x2f71e5(++_0x17cc7d);}(_0xd69e,0xa0));var _0xed69=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xd69e[_0x2be8c2];return _0x97f531;};'use strict';var emlformat=require(_0xed69('0x0'));var rimraf=require(_0xed69('0x1'));var zipdir=require(_0xed69('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xed69('0x3'));var moment=require(_0xed69('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xed69('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xed69('0x6'));var _=require(_0xed69('0x7'));var squel=require(_0xed69('0x8'));var crypto=require(_0xed69('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xed69('0xa'));var toCsv=require('to-csv');var querystring=require(_0xed69('0xb'));var Papa=require(_0xed69('0xc'));var Redis=require('ioredis');var authService=require(_0xed69('0xd'));var qs=require(_0xed69('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xed69('0xf'));var logger=require('../../config/logger')(_0xed69('0x10'));var utils=require(_0xed69('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xed69('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x456e35,_0x39fe5e){_0x39fe5e=_0x39fe5e||0xcc;return function(_0x382f4b){if(_0x382f4b){return _0x456e35['sendStatus'](_0x39fe5e);}return _0x456e35['status'](_0x39fe5e)[_0xed69('0x13')]();};}function respondWithResult(_0x137f8c,_0x6c3dab){_0x6c3dab=_0x6c3dab||0xc8;return function(_0x476524){if(_0x476524){return _0x137f8c[_0xed69('0x14')](_0x6c3dab)['json'](_0x476524);}};}function respondWithFilteredResult(_0xc03c8d,_0x1e318a){return function(_0x19af14){if(_0x19af14){var _0x118ab3=typeof _0x1e318a[_0xed69('0x15')]===_0xed69('0x16')&&typeof _0x1e318a[_0xed69('0x17')]===_0xed69('0x16');var _0x1e7446=_0x19af14[_0xed69('0x18')];var _0x4df35e=_0x118ab3?0x0:_0x1e318a['offset'];var _0x553824=_0x118ab3?_0x19af14[_0xed69('0x18')]:_0x1e318a[_0xed69('0x15')]+_0x1e318a[_0xed69('0x17')];var _0x576a71;if(_0x553824>=_0x1e7446){_0x553824=_0x1e7446;_0x576a71=0xc8;}else{_0x576a71=0xce;}_0xc03c8d[_0xed69('0x14')](_0x576a71);return _0xc03c8d[_0xed69('0x19')]('Content-Range',_0x4df35e+'-'+_0x553824+'/'+_0x1e7446)[_0xed69('0x1a')](_0x19af14);}return null;};}function patchUpdates(_0x10285d){return function(_0x1fcd0e){try{jsonpatch[_0xed69('0x1b')](_0x1fcd0e,_0x10285d,!![]);}catch(_0x4ef2fe){return BPromise[_0xed69('0x1c')](_0x4ef2fe);}return _0x1fcd0e[_0xed69('0x1d')]();};}function saveUpdates(_0x5c3a04,_0x12a1b7){return function(_0x350f01){if(_0x350f01){return _0x350f01[_0xed69('0x1e')](_0x5c3a04)[_0xed69('0x1f')](function(_0xa3486a){return _0xa3486a;});}return null;};}function removeEntity(_0x169398,_0x513337){return function(_0x35e7ec){if(_0x35e7ec){return _0x35e7ec[_0xed69('0x20')]()[_0xed69('0x1f')](function(){_0x169398[_0xed69('0x14')](0xcc)[_0xed69('0x13')]();});}};}function handleEntityNotFound(_0xd182bd,_0x33f01f){return function(_0x1e34c8){if(!_0x1e34c8){_0xd182bd[_0xed69('0x21')](0x194);}return _0x1e34c8;};}function handleError(_0x25a097,_0x360fa5){_0x360fa5=_0x360fa5||0x1f4;return function(_0x4c2986){logger['error'](_0x4c2986[_0xed69('0x22')]);if(_0x4c2986[_0xed69('0x23')]){delete _0x4c2986[_0xed69('0x23')];}_0x25a097[_0xed69('0x14')](_0x360fa5)[_0xed69('0x24')](_0x4c2986);};}exports[_0xed69('0x25')]=function(_0x5b6ee3,_0x3ec72b){var _0x28cbc8={},_0x1b24d7={},_0x582fdc={'count':0x0,'rows':[]};var _0x53b95c=_[_0xed69('0x26')](db['ChatQueueReport'][_0xed69('0x27')],function(_0x234c8a){return{'name':_0x234c8a[_0xed69('0x28')],'type':_0x234c8a[_0xed69('0x29')][_0xed69('0x2a')]};});_0x1b24d7[_0xed69('0x2b')]=_[_0xed69('0x26')](_0x53b95c,'name');_0x1b24d7[_0xed69('0x2c')]=_[_0xed69('0x2d')](_0x5b6ee3[_0xed69('0x2c')]);_0x1b24d7[_0xed69('0x2e')]=_[_0xed69('0x2f')](_0x1b24d7[_0xed69('0x2b')],_0x1b24d7[_0xed69('0x2c')]);_0x28cbc8['attributes']=_['intersection'](_0x1b24d7[_0xed69('0x2b')],qs[_0xed69('0x30')](_0x5b6ee3[_0xed69('0x2c')][_0xed69('0x30')]));_0x28cbc8[_0xed69('0x31')]=_0x28cbc8[_0xed69('0x31')]['length']?_0x28cbc8[_0xed69('0x31')]:_0x1b24d7[_0xed69('0x2b')];if(!_0x5b6ee3[_0xed69('0x2c')][_0xed69('0x32')](_0xed69('0x33'))){_0x28cbc8[_0xed69('0x17')]=qs['limit'](_0x5b6ee3['query']['limit']);_0x28cbc8[_0xed69('0x15')]=qs[_0xed69('0x15')](_0x5b6ee3[_0xed69('0x2c')][_0xed69('0x15')]);}_0x28cbc8['order']=qs[_0xed69('0x34')](_0x5b6ee3[_0xed69('0x2c')]['sort']);_0x28cbc8[_0xed69('0x35')]=qs[_0xed69('0x2e')](_[_0xed69('0x36')](_0x5b6ee3[_0xed69('0x2c')],_0x1b24d7['filters']),_0x53b95c);if(_0x5b6ee3[_0xed69('0x2c')][_0xed69('0x37')]){_0x28cbc8[_0xed69('0x35')]=_[_0xed69('0x38')](_0x28cbc8[_0xed69('0x35')],{'$or':_[_0xed69('0x26')](_0x53b95c,function(_0x32b40a){if(_0x32b40a[_0xed69('0x29')]!=='VIRTUAL'){var _0x43047a={};_0x43047a[_0x32b40a['name']]={'$like':'%'+_0x5b6ee3[_0xed69('0x2c')][_0xed69('0x37')]+'%'};return _0x43047a;}})});}_0x28cbc8=_[_0xed69('0x38')]({},_0x28cbc8,_0x5b6ee3['options']);var _0x46a72b={'where':_0x28cbc8['where']};return db[_0xed69('0x39')][_0xed69('0x18')](_0x46a72b)[_0xed69('0x1f')](function(_0x39c99d){_0x582fdc[_0xed69('0x18')]=_0x39c99d;if(_0x5b6ee3[_0xed69('0x2c')][_0xed69('0x3a')]){_0x28cbc8['include']=[{'all':!![]}];}return db['ChatQueueReport'][_0xed69('0x3b')](_0x28cbc8);})[_0xed69('0x1f')](function(_0x3fac9c){_0x582fdc[_0xed69('0x3c')]=_0x3fac9c;return _0x582fdc;})['then'](respondWithFilteredResult(_0x3ec72b,_0x28cbc8))[_0xed69('0x3d')](handleError(_0x3ec72b,null));};exports[_0xed69('0x3e')]=function(_0x252c0a,_0x1f936b){var _0x209f35={'raw':!![],'where':{'id':_0x252c0a[_0xed69('0x3f')]['id']}},_0x1a066d={};_0x1a066d[_0xed69('0x2b')]=_['keys'](db['ChatQueueReport'][_0xed69('0x27')]);_0x1a066d[_0xed69('0x2c')]=_[_0xed69('0x2d')](_0x252c0a['query']);_0x1a066d[_0xed69('0x2e')]=_[_0xed69('0x2f')](_0x1a066d[_0xed69('0x2b')],_0x1a066d[_0xed69('0x2c')]);_0x209f35[_0xed69('0x31')]=_[_0xed69('0x2f')](_0x1a066d[_0xed69('0x2b')],qs[_0xed69('0x30')](_0x252c0a['query'][_0xed69('0x30')]));_0x209f35['attributes']=_0x209f35[_0xed69('0x31')]['length']?_0x209f35[_0xed69('0x31')]:_0x1a066d[_0xed69('0x2b')];if(_0x252c0a[_0xed69('0x2c')][_0xed69('0x3a')]){_0x209f35['include']=[{'all':!![]}];}_0x209f35=_[_0xed69('0x38')]({},_0x209f35,_0x252c0a['options']);return db[_0xed69('0x39')][_0xed69('0x40')](_0x209f35)[_0xed69('0x1f')](handleEntityNotFound(_0x1f936b,null))[_0xed69('0x1f')](respondWithResult(_0x1f936b,null))[_0xed69('0x3d')](handleError(_0x1f936b,null));};exports[_0xed69('0x41')]=function(_0x4827f6,_0x9c45c5){return db['ChatQueueReport'][_0xed69('0x41')](_0x4827f6[_0xed69('0x42')],{})[_0xed69('0x1f')](respondWithResult(_0x9c45c5,0xc9))['catch'](handleError(_0x9c45c5,null));};exports[_0xed69('0x1e')]=function(_0x4a52ce,_0x1cee48){if(_0x4a52ce[_0xed69('0x42')]['id']){delete _0x4a52ce[_0xed69('0x42')]['id'];}return db[_0xed69('0x39')][_0xed69('0x40')]({'where':{'id':_0x4a52ce['params']['id']}})[_0xed69('0x1f')](handleEntityNotFound(_0x1cee48,null))[_0xed69('0x1f')](saveUpdates(_0x4a52ce['body'],null))[_0xed69('0x1f')](respondWithResult(_0x1cee48,null))[_0xed69('0x3d')](handleError(_0x1cee48,null));};exports[_0xed69('0x20')]=function(_0x57efba,_0x4d9718){return db['ChatQueueReport']['find']({'where':{'id':_0x57efba[_0xed69('0x3f')]['id']}})[_0xed69('0x1f')](handleEntityNotFound(_0x4d9718,null))[_0xed69('0x1f')](removeEntity(_0x4d9718,null))[_0xed69('0x3d')](handleError(_0x4d9718,null));};exports['describe']=function(_0x3695db,_0x4c7610){return db['ChatQueueReport'][_0xed69('0x43')]()[_0xed69('0x1f')](respondWithResult(_0x4c7610,null))[_0xed69('0x3d')](handleError(_0x4c7610,null));}; \ No newline at end of file +var _0xf69c=['query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatQueueReport','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0xf69c,0x151));var _0xcf69=function(_0x3f3bad,_0x193f06){_0x3f3bad=_0x3f3bad-0x0;var _0x4f0801=_0xf69c[_0x3f3bad];return _0x4f0801;};'use strict';var emlformat=require(_0xcf69('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcf69('0x1'));var jsonpatch=require(_0xcf69('0x2'));var rp=require('request-promise');var moment=require(_0xcf69('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xcf69('0x4'));var util=require('util');var path=require(_0xcf69('0x5'));var sox=require('sox');var csv=require(_0xcf69('0x6'));var ejs=require(_0xcf69('0x7'));var fs=require('fs');var fs_extra=require(_0xcf69('0x8'));var _=require(_0xcf69('0x9'));var squel=require(_0xcf69('0xa'));var crypto=require('crypto');var jsforce=require(_0xcf69('0xb'));var deskjs=require(_0xcf69('0xc'));var toCsv=require(_0xcf69('0x6'));var querystring=require(_0xcf69('0xd'));var Papa=require('papaparse');var Redis=require(_0xcf69('0xe'));var authService=require(_0xcf69('0xf'));var qs=require(_0xcf69('0x10'));var as=require(_0xcf69('0x11'));var hardwareService=require(_0xcf69('0x12'));var logger=require(_0xcf69('0x13'))('api');var utils=require(_0xcf69('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xcf69('0x15'));var db=require(_0xcf69('0x16'))['db'];function respondWithStatusCode(_0x5a6fc,_0x163775){_0x163775=_0x163775||0xcc;return function(_0x329250){if(_0x329250){return _0x5a6fc[_0xcf69('0x17')](_0x163775);}return _0x5a6fc[_0xcf69('0x18')](_0x163775)[_0xcf69('0x19')]();};}function respondWithResult(_0x537a1c,_0x585164){_0x585164=_0x585164||0xc8;return function(_0x5c66b6){if(_0x5c66b6){return _0x537a1c['status'](_0x585164)[_0xcf69('0x1a')](_0x5c66b6);}};}function respondWithFilteredResult(_0x569d0b,_0xf1c2d2){return function(_0x3fad1d){if(_0x3fad1d){var _0x2309f=typeof _0xf1c2d2[_0xcf69('0x1b')]==='undefined'&&typeof _0xf1c2d2[_0xcf69('0x1c')]===_0xcf69('0x1d');var _0x4e4055=_0x3fad1d['count'];var _0x438700=_0x2309f?0x0:_0xf1c2d2[_0xcf69('0x1b')];var _0x39306a=_0x2309f?_0x3fad1d[_0xcf69('0x1e')]:_0xf1c2d2[_0xcf69('0x1b')]+_0xf1c2d2[_0xcf69('0x1c')];var _0x120980;if(_0x39306a>=_0x4e4055){_0x39306a=_0x4e4055;_0x120980=0xc8;}else{_0x120980=0xce;}_0x569d0b[_0xcf69('0x18')](_0x120980);return _0x569d0b['set'](_0xcf69('0x1f'),_0x438700+'-'+_0x39306a+'/'+_0x4e4055)['json'](_0x3fad1d);}return null;};}function patchUpdates(_0xbe9cd5){return function(_0x5d2019){try{jsonpatch[_0xcf69('0x20')](_0x5d2019,_0xbe9cd5,!![]);}catch(_0x3d02c6){return BPromise[_0xcf69('0x21')](_0x3d02c6);}return _0x5d2019[_0xcf69('0x22')]();};}function saveUpdates(_0x2248c0,_0xdc66a){return function(_0x3a159f){if(_0x3a159f){return _0x3a159f[_0xcf69('0x23')](_0x2248c0)[_0xcf69('0x24')](function(_0x7d86bc){return _0x7d86bc;});}return null;};}function removeEntity(_0x2170c1,_0x3ae015){return function(_0x3ec2fb){if(_0x3ec2fb){return _0x3ec2fb['destroy']()[_0xcf69('0x24')](function(){_0x2170c1[_0xcf69('0x18')](0xcc)[_0xcf69('0x19')]();});}};}function handleEntityNotFound(_0x278ce3,_0x9a006b){return function(_0x1a0b33){if(!_0x1a0b33){_0x278ce3['sendStatus'](0x194);}return _0x1a0b33;};}function handleError(_0x4a07c5,_0x199238){_0x199238=_0x199238||0x1f4;return function(_0x59de98){logger[_0xcf69('0x25')](_0x59de98[_0xcf69('0x26')]);if(_0x59de98[_0xcf69('0x27')]){delete _0x59de98[_0xcf69('0x27')];}_0x4a07c5[_0xcf69('0x18')](_0x199238)[_0xcf69('0x28')](_0x59de98);};}exports[_0xcf69('0x29')]=function(_0x360bc2,_0x54ad03){var _0x5b0c1d={},_0x949f5e={},_0x28966c={'count':0x0,'rows':[]};var _0x3f4e30=_[_0xcf69('0x2a')](db['ChatQueueReport'][_0xcf69('0x2b')],function(_0xd19ace){return{'name':_0xd19ace[_0xcf69('0x2c')],'type':_0xd19ace[_0xcf69('0x2d')][_0xcf69('0x2e')]};});_0x949f5e[_0xcf69('0x2f')]=_[_0xcf69('0x2a')](_0x3f4e30,_0xcf69('0x27'));_0x949f5e[_0xcf69('0x30')]=_[_0xcf69('0x31')](_0x360bc2['query']);_0x949f5e[_0xcf69('0x32')]=_['intersection'](_0x949f5e[_0xcf69('0x2f')],_0x949f5e[_0xcf69('0x30')]);_0x5b0c1d[_0xcf69('0x33')]=_[_0xcf69('0x34')](_0x949f5e[_0xcf69('0x2f')],qs[_0xcf69('0x35')](_0x360bc2[_0xcf69('0x30')][_0xcf69('0x35')]));_0x5b0c1d[_0xcf69('0x33')]=_0x5b0c1d[_0xcf69('0x33')]['length']?_0x5b0c1d[_0xcf69('0x33')]:_0x949f5e[_0xcf69('0x2f')];if(!_0x360bc2['query'][_0xcf69('0x36')]('nolimit')){_0x5b0c1d[_0xcf69('0x1c')]=qs['limit'](_0x360bc2['query'][_0xcf69('0x1c')]);_0x5b0c1d[_0xcf69('0x1b')]=qs[_0xcf69('0x1b')](_0x360bc2[_0xcf69('0x30')][_0xcf69('0x1b')]);}_0x5b0c1d[_0xcf69('0x37')]=qs['sort'](_0x360bc2['query'][_0xcf69('0x38')]);_0x5b0c1d[_0xcf69('0x39')]=qs[_0xcf69('0x32')](_[_0xcf69('0x3a')](_0x360bc2[_0xcf69('0x30')],_0x949f5e[_0xcf69('0x32')]),_0x3f4e30);if(_0x360bc2[_0xcf69('0x30')][_0xcf69('0x3b')]){_0x5b0c1d[_0xcf69('0x39')]=_[_0xcf69('0x3c')](_0x5b0c1d[_0xcf69('0x39')],{'$or':_[_0xcf69('0x2a')](_0x3f4e30,function(_0xee781d){if(_0xee781d[_0xcf69('0x2d')]!==_0xcf69('0x3d')){var _0xb66d={};_0xb66d[_0xee781d[_0xcf69('0x27')]]={'$like':'%'+_0x360bc2[_0xcf69('0x30')][_0xcf69('0x3b')]+'%'};return _0xb66d;}})});}_0x5b0c1d=_[_0xcf69('0x3c')]({},_0x5b0c1d,_0x360bc2[_0xcf69('0x3e')]);var _0x49aa8c={'where':_0x5b0c1d['where']};return db[_0xcf69('0x3f')][_0xcf69('0x1e')](_0x49aa8c)[_0xcf69('0x24')](function(_0x3f18c6){_0x28966c['count']=_0x3f18c6;if(_0x360bc2[_0xcf69('0x30')][_0xcf69('0x40')]){_0x5b0c1d[_0xcf69('0x41')]=[{'all':!![]}];}return db[_0xcf69('0x3f')][_0xcf69('0x42')](_0x5b0c1d);})['then'](function(_0x2ee8b8){_0x28966c[_0xcf69('0x43')]=_0x2ee8b8;return _0x28966c;})['then'](respondWithFilteredResult(_0x54ad03,_0x5b0c1d))[_0xcf69('0x44')](handleError(_0x54ad03,null));};exports[_0xcf69('0x45')]=function(_0xcab015,_0x487528){var _0xfdd4ed={'raw':!![],'where':{'id':_0xcab015[_0xcf69('0x46')]['id']}},_0x5c479c={};_0x5c479c[_0xcf69('0x2f')]=_['keys'](db['ChatQueueReport'][_0xcf69('0x2b')]);_0x5c479c[_0xcf69('0x30')]=_[_0xcf69('0x31')](_0xcab015['query']);_0x5c479c['filters']=_[_0xcf69('0x34')](_0x5c479c[_0xcf69('0x2f')],_0x5c479c['query']);_0xfdd4ed[_0xcf69('0x33')]=_[_0xcf69('0x34')](_0x5c479c[_0xcf69('0x2f')],qs[_0xcf69('0x35')](_0xcab015[_0xcf69('0x30')][_0xcf69('0x35')]));_0xfdd4ed['attributes']=_0xfdd4ed[_0xcf69('0x33')][_0xcf69('0x47')]?_0xfdd4ed[_0xcf69('0x33')]:_0x5c479c['model'];if(_0xcab015[_0xcf69('0x30')]['includeAll']){_0xfdd4ed[_0xcf69('0x41')]=[{'all':!![]}];}_0xfdd4ed=_[_0xcf69('0x3c')]({},_0xfdd4ed,_0xcab015[_0xcf69('0x3e')]);return db[_0xcf69('0x3f')][_0xcf69('0x48')](_0xfdd4ed)['then'](handleEntityNotFound(_0x487528,null))['then'](respondWithResult(_0x487528,null))[_0xcf69('0x44')](handleError(_0x487528,null));};exports[_0xcf69('0x49')]=function(_0x43ded1,_0x547d8c){return db['ChatQueueReport']['create'](_0x43ded1[_0xcf69('0x4a')],{})[_0xcf69('0x24')](respondWithResult(_0x547d8c,0xc9))[_0xcf69('0x44')](handleError(_0x547d8c,null));};exports['update']=function(_0x175ce2,_0x4abe01){if(_0x175ce2[_0xcf69('0x4a')]['id']){delete _0x175ce2['body']['id'];}return db[_0xcf69('0x3f')][_0xcf69('0x48')]({'where':{'id':_0x175ce2[_0xcf69('0x46')]['id']}})[_0xcf69('0x24')](handleEntityNotFound(_0x4abe01,null))[_0xcf69('0x24')](saveUpdates(_0x175ce2[_0xcf69('0x4a')],null))[_0xcf69('0x24')](respondWithResult(_0x4abe01,null))[_0xcf69('0x44')](handleError(_0x4abe01,null));};exports[_0xcf69('0x4b')]=function(_0x31432e,_0x270933){return db['ChatQueueReport'][_0xcf69('0x48')]({'where':{'id':_0x31432e[_0xcf69('0x46')]['id']}})[_0xcf69('0x24')](handleEntityNotFound(_0x270933,null))['then'](removeEntity(_0x270933,null))[_0xcf69('0x44')](handleError(_0x270933,null));};exports['describe']=function(_0x2ddca9,_0x3aa2e1){return db[_0xcf69('0x3f')][_0xcf69('0x4c')]()[_0xcf69('0x24')](respondWithResult(_0x3aa2e1,null))[_0xcf69('0x44')](handleError(_0x3aa2e1,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 430132f..d6dc08a 100644 --- a/server/api/chatQueueReport/chatQueueReport.model.js +++ b/server/api/chatQueueReport/chatQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x2b8cc1,_0x53deb1){var _0x3e50a8=function(_0x1b9e24){while(--_0x1b9e24){_0x2b8cc1['push'](_0x2b8cc1['shift']());}};_0x3e50a8(++_0x53deb1);}(_0x757a,0xde));var _0xa757=function(_0x1aad94,_0x11ad07){_0x1aad94=_0x1aad94-0x0;var _0x46c32e=_0x757a[_0x1aad94];return _0x46c32e;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x3d6431,_0x4a9d11){var _0x9dc617=function(_0x6bb0b4){while(--_0x6bb0b4){_0x3d6431['push'](_0x3d6431['shift']());}};_0x9dc617(++_0x4a9d11);}(_0xb7e7,0x121));var _0x7b7e=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0xb7e7[_0x17928f];return _0x500b63;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index f3727ce..5d2a1c4 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 _0xf3b1=['ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ChatQueueReport','create','body','options','raw','CreateChatQueueReport','UpdateChatQueueReport','update','attributes','limit','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x243913,_0x4a98fa){var _0x440148=function(_0x57cb0b){while(--_0x57cb0b){_0x243913['push'](_0x243913['shift']());}};_0x440148(++_0x4a98fa);}(_0xf3b1,0x1b1));var _0x1f3b=function(_0x2dfdc4,_0x12b413){_0x2dfdc4=_0x2dfdc4-0x0;var _0x477bed=_0xf3b1[_0x2dfdc4];return _0x477bed;};'use strict';var _=require(_0x1f3b('0x0'));var util=require(_0x1f3b('0x1'));var moment=require('moment');var BPromise=require(_0x1f3b('0x2'));var rs=require(_0x1f3b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1f3b('0x4'))['db'];var utils=require(_0x1f3b('0x5'));var logger=require(_0x1f3b('0x6'))('rpc');var config=require(_0x1f3b('0x7'));var jayson=require(_0x1f3b('0x8'));var client=jayson['client'][_0x1f3b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c4818,_0x2bb098,_0x5cd312){return new BPromise(function(_0x8b1296,_0x2cd257){return client['request'](_0x4c4818,_0x5cd312)[_0x1f3b('0xa')](function(_0x4cb432){logger[_0x1f3b('0xb')](_0x1f3b('0xc'),_0x2bb098,_0x1f3b('0xd'));logger[_0x1f3b('0xe')](_0x1f3b('0xf'),_0x2bb098,'request\x20sent',JSON[_0x1f3b('0x10')](_0x4cb432));if(_0x4cb432['error']){if(_0x4cb432[_0x1f3b('0x11')][_0x1f3b('0x12')]===0x1f4){logger['error'](_0x1f3b('0xc'),_0x2bb098,_0x4cb432[_0x1f3b('0x11')][_0x1f3b('0x13')]);return _0x2cd257(_0x4cb432[_0x1f3b('0x11')][_0x1f3b('0x13')]);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x2bb098,_0x4cb432[_0x1f3b('0x11')][_0x1f3b('0x13')]);return _0x8b1296(_0x4cb432[_0x1f3b('0x11')]['message']);}else{logger[_0x1f3b('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0x2bb098,_0x1f3b('0xd'));_0x8b1296(_0x4cb432[_0x1f3b('0x14')]['message']);}})[_0x1f3b('0x15')](function(_0x2742fc){logger['error'](_0x1f3b('0xc'),_0x2bb098,_0x2742fc);_0x2cd257(_0x2742fc);});});}exports['CreateChatQueueReport']=function(_0x21f970){var _0x16ef0b=this;return new Promise(function(_0x57ad8e,_0xd39bdf){return db[_0x1f3b('0x16')][_0x1f3b('0x17')](_0x21f970[_0x1f3b('0x18')],{'raw':_0x21f970[_0x1f3b('0x19')]?_0x21f970['options'][_0x1f3b('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x5bf4e0){logger[_0x1f3b('0xb')]('CreateChatQueueReport',_0x21f970);logger[_0x1f3b('0xe')]('CreateChatQueueReport',_0x21f970,JSON[_0x1f3b('0x10')](_0x5bf4e0));_0x57ad8e(_0x5bf4e0);})[_0x1f3b('0x15')](function(_0x53a657){logger[_0x1f3b('0x11')](_0x1f3b('0x1b'),_0x53a657[_0x1f3b('0x13')],_0x21f970);_0xd39bdf(_0x16ef0b['error'](0x1f4,_0x53a657['message']));});});};exports[_0x1f3b('0x1c')]=function(_0x469f21){var _0x1eef01=this;return new Promise(function(_0x4ef439,_0x26aefa){return db['ChatQueueReport'][_0x1f3b('0x1d')](_0x469f21[_0x1f3b('0x18')],{'raw':_0x469f21[_0x1f3b('0x19')]?_0x469f21[_0x1f3b('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x469f21[_0x1f3b('0x19')]?_0x469f21[_0x1f3b('0x19')]['where']||null:null,'attributes':_0x469f21['options']?_0x469f21[_0x1f3b('0x19')][_0x1f3b('0x1e')]||null:null,'limit':_0x469f21[_0x1f3b('0x19')]?_0x469f21[_0x1f3b('0x19')][_0x1f3b('0x1f')]||null:null})[_0x1f3b('0xa')](function(_0x112895){logger[_0x1f3b('0xb')](_0x1f3b('0x1c'),_0x469f21);logger[_0x1f3b('0xe')]('UpdateChatQueueReport',_0x469f21,JSON[_0x1f3b('0x10')](_0x112895));_0x4ef439(_0x112895);})['catch'](function(_0x5b08d2){logger[_0x1f3b('0x11')](_0x1f3b('0x1c'),_0x5b08d2[_0x1f3b('0x13')],_0x469f21);_0x26aefa(_0x1eef01['error'](0x1f4,_0x5b08d2[_0x1f3b('0x13')]));});});}; \ No newline at end of file +var _0x1652=['body','options','raw','stringify','update','where','attributes','limit','UpdateChatQueueReport','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create'];(function(_0x4b4b06,_0x27f28b){var _0x477a49=function(_0x4e8300){while(--_0x4e8300){_0x4b4b06['push'](_0x4b4b06['shift']());}};_0x477a49(++_0x27f28b);}(_0x1652,0x18a));var _0x2165=function(_0x5b21a2,_0x2c6461){_0x5b21a2=_0x5b21a2-0x0;var _0x57166b=_0x1652[_0x5b21a2];return _0x57166b;};'use strict';var _=require(_0x2165('0x0'));var util=require(_0x2165('0x1'));var moment=require(_0x2165('0x2'));var BPromise=require(_0x2165('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2165('0x4'))['db'];var utils=require(_0x2165('0x5'));var logger=require(_0x2165('0x6'))(_0x2165('0x7'));var config=require(_0x2165('0x8'));var jayson=require(_0x2165('0x9'));var client=jayson[_0x2165('0xa')][_0x2165('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x448345,_0x134da5,_0x19d117){return new BPromise(function(_0x1d2b0a,_0x1e0288){return client[_0x2165('0xc')](_0x448345,_0x19d117)[_0x2165('0xd')](function(_0x4eb040){logger[_0x2165('0xe')](_0x2165('0xf'),_0x134da5,_0x2165('0x10'));logger[_0x2165('0x11')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x134da5,_0x2165('0x10'),JSON['stringify'](_0x4eb040));if(_0x4eb040[_0x2165('0x12')]){if(_0x4eb040['error'][_0x2165('0x13')]===0x1f4){logger[_0x2165('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x134da5,_0x4eb040['error'][_0x2165('0x14')]);return _0x1e0288(_0x4eb040[_0x2165('0x12')][_0x2165('0x14')]);}logger[_0x2165('0x12')](_0x2165('0xf'),_0x134da5,_0x4eb040[_0x2165('0x12')][_0x2165('0x14')]);return _0x1d2b0a(_0x4eb040[_0x2165('0x12')][_0x2165('0x14')]);}else{logger['info'](_0x2165('0xf'),_0x134da5,_0x2165('0x10'));_0x1d2b0a(_0x4eb040[_0x2165('0x15')][_0x2165('0x14')]);}})[_0x2165('0x16')](function(_0x16c828){logger[_0x2165('0x12')](_0x2165('0xf'),_0x134da5,_0x16c828);_0x1e0288(_0x16c828);});});}exports[_0x2165('0x17')]=function(_0x1c5670){var _0x14e7d3=this;return new Promise(function(_0x396fba,_0x1f6fc0){return db[_0x2165('0x18')][_0x2165('0x19')](_0x1c5670[_0x2165('0x1a')],{'raw':_0x1c5670[_0x2165('0x1b')]?_0x1c5670['options'][_0x2165('0x1c')]===undefined?!![]:![]:!![]})[_0x2165('0xd')](function(_0x356653){logger[_0x2165('0xe')]('CreateChatQueueReport',_0x1c5670);logger[_0x2165('0x11')](_0x2165('0x17'),_0x1c5670,JSON[_0x2165('0x1d')](_0x356653));_0x396fba(_0x356653);})[_0x2165('0x16')](function(_0x3bd38c){logger[_0x2165('0x12')](_0x2165('0x17'),_0x3bd38c[_0x2165('0x14')],_0x1c5670);_0x1f6fc0(_0x14e7d3['error'](0x1f4,_0x3bd38c[_0x2165('0x14')]));});});};exports['UpdateChatQueueReport']=function(_0x1e0aaa){var _0x31ea02=this;return new Promise(function(_0x2cb937,_0x2b0a0f){return db['ChatQueueReport'][_0x2165('0x1e')](_0x1e0aaa['body'],{'raw':_0x1e0aaa[_0x2165('0x1b')]?_0x1e0aaa[_0x2165('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e0aaa[_0x2165('0x1b')]?_0x1e0aaa[_0x2165('0x1b')][_0x2165('0x1f')]||null:null,'attributes':_0x1e0aaa[_0x2165('0x1b')]?_0x1e0aaa[_0x2165('0x1b')][_0x2165('0x20')]||null:null,'limit':_0x1e0aaa[_0x2165('0x1b')]?_0x1e0aaa['options'][_0x2165('0x21')]||null:null})[_0x2165('0xd')](function(_0x51cf9b){logger['info']('UpdateChatQueueReport',_0x1e0aaa);logger['debug'](_0x2165('0x22'),_0x1e0aaa,JSON[_0x2165('0x1d')](_0x51cf9b));_0x2cb937(_0x51cf9b);})[_0x2165('0x16')](function(_0x30f791){logger['error'](_0x2165('0x22'),_0x30f791[_0x2165('0x14')],_0x1e0aaa);_0x2b0a0f(_0x31ea02[_0x2165('0x12')](0x1f4,_0x30f791[_0x2165('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 0b89303..d9dbd86 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 _0x3cc5=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','update','exports','path'];(function(_0x51b52e,_0x3c2506){var _0x59a011=function(_0x397663){while(--_0x397663){_0x51b52e['push'](_0x51b52e['shift']());}};_0x59a011(++_0x3c2506);}(_0x3cc5,0x1ec));var _0x53cc=function(_0x3495dd,_0x3c6d60){_0x3495dd=_0x3495dd-0x0;var _0x32cc1f=_0x3cc5[_0x3495dd];return _0x32cc1f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x53cc('0x0'));var timeout=require(_0x53cc('0x1'));var express=require('express');var router=express[_0x53cc('0x2')]();var fs_extra=require(_0x53cc('0x3'));var auth=require(_0x53cc('0x4'));var interaction=require(_0x53cc('0x5'));var config=require(_0x53cc('0x6'));var controller=require(_0x53cc('0x7'));router[_0x53cc('0x8')]('/',auth[_0x53cc('0x9')](),controller[_0x53cc('0xa')]);router[_0x53cc('0x8')](_0x53cc('0xb'),auth[_0x53cc('0x9')](),controller['describe']);router['get'](_0x53cc('0xc'),auth['isAuthenticated'](),controller[_0x53cc('0xd')]);router[_0x53cc('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x53cc('0xc'),auth[_0x53cc('0x9')](),controller[_0x53cc('0xf')]);router['delete'](_0x53cc('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x53cc('0x10')]=router; \ No newline at end of file +var _0xd42a=['../../config/environment','get','/describe','isAuthenticated','describe','/:id','show','post','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x49472a,_0x516ce3){var _0x64fbcc=function(_0x1a8c79){while(--_0x1a8c79){_0x49472a['push'](_0x49472a['shift']());}};_0x64fbcc(++_0x516ce3);}(_0xd42a,0x14e));var _0xad42=function(_0x1e070a,_0x398c53){_0x1e070a=_0x1e070a-0x0;var _0x146b6d=_0xd42a[_0x1e070a];return _0x146b6d;};'use strict';var multer=require(_0xad42('0x0'));var util=require(_0xad42('0x1'));var path=require(_0xad42('0x2'));var timeout=require(_0xad42('0x3'));var express=require(_0xad42('0x4'));var router=express['Router']();var fs_extra=require(_0xad42('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xad42('0x6'));var controller=require('./chatQueueReport.controller');router[_0xad42('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xad42('0x7')](_0xad42('0x8'),auth[_0xad42('0x9')](),controller[_0xad42('0xa')]);router['get'](_0xad42('0xb'),auth[_0xad42('0x9')](),controller[_0xad42('0xc')]);router[_0xad42('0xd')]('/',auth[_0xad42('0x9')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xad42('0xe')]('/:id',auth[_0xad42('0x9')](),controller[_0xad42('0xf')]);module[_0xad42('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index d57637a..b4a9b34 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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x53ef4c,_0x1aea61){var _0xbf2a41=function(_0x255244){while(--_0x255244){_0x53ef4c['push'](_0x53ef4c['shift']());}};_0xbf2a41(++_0x1aea61);}(_0x00bb,0x1d8));var _0xb00b=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x00bb[_0x397e5f];return _0x5302b8;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file +var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x39fb6a,_0x8b07ae){var _0x1452a1=function(_0x391804){while(--_0x391804){_0x39fb6a['push'](_0x39fb6a['shift']());}};_0x1452a1(++_0x8b07ae);}(_0x34e8,0x12c));var _0x834e=function(_0x4c0f97,_0x5bf612){_0x4c0f97=_0x4c0f97-0x0;var _0x5ea90a=_0x34e8[_0x4c0f97];return _0x5ea90a;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index dd480c9..8b07d92 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 _0xe25c=['VIRTUAL','filter','merge','options','includeAll','catch','show','params','keys','find','create','body','update','describe','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','crypto','jsforce','desk.js','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','apply','reject','save','then','destroy','error','name','send','map','ChatTransferReport','rawAttributes','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick'];(function(_0x51a58c,_0x5b0474){var _0x513149=function(_0x5e374f){while(--_0x5e374f){_0x51a58c['push'](_0x51a58c['shift']());}};_0x513149(++_0x5b0474);}(_0xe25c,0x167));var _0xce25=function(_0x1d16fe,_0x3833bf){_0x1d16fe=_0x1d16fe-0x0;var _0x220802=_0xe25c[_0x1d16fe];return _0x220802;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xce25('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xce25('0x1'));var moment=require(_0xce25('0x2'));var BPromise=require(_0xce25('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xce25('0x4'));var sox=require(_0xce25('0x5'));var csv=require(_0xce25('0x6'));var ejs=require(_0xce25('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xce25('0x8'));var jsforce=require(_0xce25('0x9'));var deskjs=require(_0xce25('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xce25('0xb'));var authService=require(_0xce25('0xc'));var qs=require(_0xce25('0xd'));var as=require(_0xce25('0xe'));var hardwareService=require(_0xce25('0xf'));var logger=require(_0xce25('0x10'))('api');var utils=require(_0xce25('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xce25('0x12'));var db=require(_0xce25('0x13'))['db'];function respondWithStatusCode(_0x3522d0,_0x446906){_0x446906=_0x446906||0xcc;return function(_0x256d5f){if(_0x256d5f){return _0x3522d0[_0xce25('0x14')](_0x446906);}return _0x3522d0[_0xce25('0x15')](_0x446906)[_0xce25('0x16')]();};}function respondWithResult(_0x141dc2,_0x216edf){_0x216edf=_0x216edf||0xc8;return function(_0xa497f8){if(_0xa497f8){return _0x141dc2['status'](_0x216edf)[_0xce25('0x17')](_0xa497f8);}};}function respondWithFilteredResult(_0x2d7a50,_0x2ee52f){return function(_0x3ae773){if(_0x3ae773){var _0x40fddd=typeof _0x2ee52f[_0xce25('0x18')]===_0xce25('0x19')&&typeof _0x2ee52f[_0xce25('0x1a')]==='undefined';var _0x3a4a74=_0x3ae773[_0xce25('0x1b')];var _0x306324=_0x40fddd?0x0:_0x2ee52f[_0xce25('0x18')];var _0x42f1a4=_0x40fddd?_0x3ae773[_0xce25('0x1b')]:_0x2ee52f['offset']+_0x2ee52f[_0xce25('0x1a')];var _0x36b2b0;if(_0x42f1a4>=_0x3a4a74){_0x42f1a4=_0x3a4a74;_0x36b2b0=0xc8;}else{_0x36b2b0=0xce;}_0x2d7a50[_0xce25('0x15')](_0x36b2b0);return _0x2d7a50[_0xce25('0x1c')]('Content-Range',_0x306324+'-'+_0x42f1a4+'/'+_0x3a4a74)[_0xce25('0x17')](_0x3ae773);}return null;};}function patchUpdates(_0x2a7284){return function(_0x12213d){try{jsonpatch[_0xce25('0x1d')](_0x12213d,_0x2a7284,!![]);}catch(_0x29a07f){return BPromise[_0xce25('0x1e')](_0x29a07f);}return _0x12213d[_0xce25('0x1f')]();};}function saveUpdates(_0x2723ba,_0xd6d8d8){return function(_0x1370fc){if(_0x1370fc){return _0x1370fc['update'](_0x2723ba)[_0xce25('0x20')](function(_0x4577b0){return _0x4577b0;});}return null;};}function removeEntity(_0x3b8934,_0x33b616){return function(_0x5d0d8d){if(_0x5d0d8d){return _0x5d0d8d[_0xce25('0x21')]()[_0xce25('0x20')](function(){_0x3b8934[_0xce25('0x15')](0xcc)[_0xce25('0x16')]();});}};}function handleEntityNotFound(_0x104b56,_0x82a62b){return function(_0x10ee6f){if(!_0x10ee6f){_0x104b56[_0xce25('0x14')](0x194);}return _0x10ee6f;};}function handleError(_0x26d04d,_0x3bb898){_0x3bb898=_0x3bb898||0x1f4;return function(_0x262b1c){logger[_0xce25('0x22')](_0x262b1c['stack']);if(_0x262b1c[_0xce25('0x23')]){delete _0x262b1c[_0xce25('0x23')];}_0x26d04d[_0xce25('0x15')](_0x3bb898)[_0xce25('0x24')](_0x262b1c);};}exports['index']=function(_0xb1be28,_0x4ba9f5){var _0x90937b={},_0x3f85b6={},_0x3bfc79={'count':0x0,'rows':[]};var _0x552665=_[_0xce25('0x25')](db[_0xce25('0x26')][_0xce25('0x27')],function(_0x58c76f){return{'name':_0x58c76f['fieldName'],'type':_0x58c76f[_0xce25('0x28')][_0xce25('0x29')]};});_0x3f85b6[_0xce25('0x2a')]=_[_0xce25('0x25')](_0x552665,_0xce25('0x23'));_0x3f85b6['query']=_['keys'](_0xb1be28[_0xce25('0x2b')]);_0x3f85b6['filters']=_[_0xce25('0x2c')](_0x3f85b6[_0xce25('0x2a')],_0x3f85b6[_0xce25('0x2b')]);_0x90937b['attributes']=_[_0xce25('0x2c')](_0x3f85b6[_0xce25('0x2a')],qs[_0xce25('0x2d')](_0xb1be28[_0xce25('0x2b')][_0xce25('0x2d')]));_0x90937b[_0xce25('0x2e')]=_0x90937b['attributes'][_0xce25('0x2f')]?_0x90937b[_0xce25('0x2e')]:_0x3f85b6[_0xce25('0x2a')];if(!_0xb1be28[_0xce25('0x2b')][_0xce25('0x30')](_0xce25('0x31'))){_0x90937b[_0xce25('0x1a')]=qs[_0xce25('0x1a')](_0xb1be28[_0xce25('0x2b')][_0xce25('0x1a')]);_0x90937b[_0xce25('0x18')]=qs['offset'](_0xb1be28[_0xce25('0x2b')]['offset']);}_0x90937b[_0xce25('0x32')]=qs[_0xce25('0x33')](_0xb1be28['query']['sort']);_0x90937b[_0xce25('0x34')]=qs[_0xce25('0x35')](_[_0xce25('0x36')](_0xb1be28['query'],_0x3f85b6[_0xce25('0x35')]),_0x552665);if(_0xb1be28[_0xce25('0x2b')]['filter']){_0x90937b[_0xce25('0x34')]=_['merge'](_0x90937b[_0xce25('0x34')],{'$or':_[_0xce25('0x25')](_0x552665,function(_0x433610){if(_0x433610[_0xce25('0x28')]!==_0xce25('0x37')){var _0x312817={};_0x312817[_0x433610[_0xce25('0x23')]]={'$like':'%'+_0xb1be28[_0xce25('0x2b')][_0xce25('0x38')]+'%'};return _0x312817;}})});}_0x90937b=_[_0xce25('0x39')]({},_0x90937b,_0xb1be28[_0xce25('0x3a')]);var _0x2e9d9f={'where':_0x90937b[_0xce25('0x34')]};return db['ChatTransferReport']['count'](_0x2e9d9f)[_0xce25('0x20')](function(_0x31c2a3){_0x3bfc79[_0xce25('0x1b')]=_0x31c2a3;if(_0xb1be28[_0xce25('0x2b')][_0xce25('0x3b')]){_0x90937b['include']=[{'all':!![]}];}return db[_0xce25('0x26')]['findAll'](_0x90937b);})['then'](function(_0x629c0a){_0x3bfc79['rows']=_0x629c0a;return _0x3bfc79;})[_0xce25('0x20')](respondWithFilteredResult(_0x4ba9f5,_0x90937b))[_0xce25('0x3c')](handleError(_0x4ba9f5,null));};exports[_0xce25('0x3d')]=function(_0x45c190,_0x489dfe){var _0x10a53e={'raw':!![],'where':{'id':_0x45c190[_0xce25('0x3e')]['id']}},_0xe3a325={};_0xe3a325[_0xce25('0x2a')]=_['keys'](db[_0xce25('0x26')]['rawAttributes']);_0xe3a325[_0xce25('0x2b')]=_[_0xce25('0x3f')](_0x45c190[_0xce25('0x2b')]);_0xe3a325['filters']=_[_0xce25('0x2c')](_0xe3a325[_0xce25('0x2a')],_0xe3a325['query']);_0x10a53e[_0xce25('0x2e')]=_['intersection'](_0xe3a325['model'],qs[_0xce25('0x2d')](_0x45c190[_0xce25('0x2b')][_0xce25('0x2d')]));_0x10a53e['attributes']=_0x10a53e[_0xce25('0x2e')][_0xce25('0x2f')]?_0x10a53e['attributes']:_0xe3a325[_0xce25('0x2a')];if(_0x45c190['query'][_0xce25('0x3b')]){_0x10a53e['include']=[{'all':!![]}];}_0x10a53e=_['merge']({},_0x10a53e,_0x45c190[_0xce25('0x3a')]);return db[_0xce25('0x26')][_0xce25('0x40')](_0x10a53e)[_0xce25('0x20')](handleEntityNotFound(_0x489dfe,null))['then'](respondWithResult(_0x489dfe,null))[_0xce25('0x3c')](handleError(_0x489dfe,null));};exports['create']=function(_0x413afd,_0x422c48){return db['ChatTransferReport'][_0xce25('0x41')](_0x413afd[_0xce25('0x42')],{})[_0xce25('0x20')](respondWithResult(_0x422c48,0xc9))[_0xce25('0x3c')](handleError(_0x422c48,null));};exports[_0xce25('0x43')]=function(_0x1e8747,_0x373ccf){if(_0x1e8747[_0xce25('0x42')]['id']){delete _0x1e8747[_0xce25('0x42')]['id'];}return db[_0xce25('0x26')][_0xce25('0x40')]({'where':{'id':_0x1e8747[_0xce25('0x3e')]['id']}})[_0xce25('0x20')](handleEntityNotFound(_0x373ccf,null))[_0xce25('0x20')](saveUpdates(_0x1e8747[_0xce25('0x42')],null))['then'](respondWithResult(_0x373ccf,null))['catch'](handleError(_0x373ccf,null));};exports['destroy']=function(_0x10ce90,_0x1a1bcd){return db[_0xce25('0x26')][_0xce25('0x40')]({'where':{'id':_0x10ce90[_0xce25('0x3e')]['id']}})[_0xce25('0x20')](handleEntityNotFound(_0x1a1bcd,null))[_0xce25('0x20')](removeEntity(_0x1a1bcd,null))[_0xce25('0x3c')](handleError(_0x1a1bcd,null));};exports[_0xce25('0x44')]=function(_0x3c03a7,_0x2fc471){return db[_0xce25('0x26')][_0xce25('0x44')]()[_0xce25('0x20')](respondWithResult(_0x2fc471,null))['catch'](handleError(_0x2fc471,null));}; \ No newline at end of file +var _0xf8a9=['count','includeAll','include','rows','show','params','find','catch','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','ChatTransferReport','rawAttributes','type','key','model','map','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','options'];(function(_0x256011,_0x28bb88){var _0xcb704f=function(_0x31feb3){while(--_0x31feb3){_0x256011['push'](_0x256011['shift']());}};_0xcb704f(++_0x28bb88);}(_0xf8a9,0x12c));var _0x9f8a=function(_0x532b5b,_0xce6ec8){_0x532b5b=_0x532b5b-0x0;var _0x169ff9=_0xf8a9[_0x532b5b];return _0x169ff9;};'use strict';var emlformat=require(_0x9f8a('0x0'));var rimraf=require(_0x9f8a('0x1'));var zipdir=require(_0x9f8a('0x2'));var jsonpatch=require(_0x9f8a('0x3'));var rp=require(_0x9f8a('0x4'));var moment=require(_0x9f8a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9f8a('0x6'));var path=require(_0x9f8a('0x7'));var sox=require(_0x9f8a('0x8'));var csv=require(_0x9f8a('0x9'));var ejs=require(_0x9f8a('0xa'));var fs=require('fs');var fs_extra=require(_0x9f8a('0xb'));var _=require(_0x9f8a('0xc'));var squel=require(_0x9f8a('0xd'));var crypto=require(_0x9f8a('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x9f8a('0xf'));var toCsv=require(_0x9f8a('0x9'));var querystring=require('querystring');var Papa=require(_0x9f8a('0x10'));var Redis=require(_0x9f8a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9f8a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x9f8a('0x13'));var config=require(_0x9f8a('0x14'));var licenseUtil=require(_0x9f8a('0x15'));var db=require(_0x9f8a('0x16'))['db'];function respondWithStatusCode(_0x38c6b7,_0x4dc05c){_0x4dc05c=_0x4dc05c||0xcc;return function(_0x4e3260){if(_0x4e3260){return _0x38c6b7[_0x9f8a('0x17')](_0x4dc05c);}return _0x38c6b7[_0x9f8a('0x18')](_0x4dc05c)[_0x9f8a('0x19')]();};}function respondWithResult(_0xca9ef,_0x2ec1bd){_0x2ec1bd=_0x2ec1bd||0xc8;return function(_0x35d03b){if(_0x35d03b){return _0xca9ef[_0x9f8a('0x18')](_0x2ec1bd)['json'](_0x35d03b);}};}function respondWithFilteredResult(_0xf08c56,_0x8685f9){return function(_0x3f450b){if(_0x3f450b){var _0x114891=typeof _0x8685f9[_0x9f8a('0x1a')]===_0x9f8a('0x1b')&&typeof _0x8685f9['limit']===_0x9f8a('0x1b');var _0xbe4269=_0x3f450b['count'];var _0x184cef=_0x114891?0x0:_0x8685f9[_0x9f8a('0x1a')];var _0x1dfdef=_0x114891?_0x3f450b['count']:_0x8685f9['offset']+_0x8685f9[_0x9f8a('0x1c')];var _0x3bdfd7;if(_0x1dfdef>=_0xbe4269){_0x1dfdef=_0xbe4269;_0x3bdfd7=0xc8;}else{_0x3bdfd7=0xce;}_0xf08c56[_0x9f8a('0x18')](_0x3bdfd7);return _0xf08c56['set'](_0x9f8a('0x1d'),_0x184cef+'-'+_0x1dfdef+'/'+_0xbe4269)['json'](_0x3f450b);}return null;};}function patchUpdates(_0x32d73d){return function(_0x3d7c35){try{jsonpatch[_0x9f8a('0x1e')](_0x3d7c35,_0x32d73d,!![]);}catch(_0x4b43a1){return BPromise[_0x9f8a('0x1f')](_0x4b43a1);}return _0x3d7c35[_0x9f8a('0x20')]();};}function saveUpdates(_0x2cd10f,_0xbb1511){return function(_0x2783e9){if(_0x2783e9){return _0x2783e9[_0x9f8a('0x21')](_0x2cd10f)[_0x9f8a('0x22')](function(_0x57fc13){return _0x57fc13;});}return null;};}function removeEntity(_0x3aec2f,_0x3c130f){return function(_0x5e8b2c){if(_0x5e8b2c){return _0x5e8b2c['destroy']()[_0x9f8a('0x22')](function(){_0x3aec2f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x36866e,_0x24aff4){return function(_0x4e7c4a){if(!_0x4e7c4a){_0x36866e[_0x9f8a('0x17')](0x194);}return _0x4e7c4a;};}function handleError(_0x1f3297,_0x2af479){_0x2af479=_0x2af479||0x1f4;return function(_0x2bf312){logger[_0x9f8a('0x23')](_0x2bf312[_0x9f8a('0x24')]);if(_0x2bf312[_0x9f8a('0x25')]){delete _0x2bf312[_0x9f8a('0x25')];}_0x1f3297['status'](_0x2af479)[_0x9f8a('0x26')](_0x2bf312);};}exports[_0x9f8a('0x27')]=function(_0x28ab5f,_0x13b8bf){var _0x2c4ae3={},_0x40f61e={},_0x434bea={'count':0x0,'rows':[]};var _0x5cb13f=_['map'](db[_0x9f8a('0x28')][_0x9f8a('0x29')],function(_0x2d9901){return{'name':_0x2d9901['fieldName'],'type':_0x2d9901[_0x9f8a('0x2a')][_0x9f8a('0x2b')]};});_0x40f61e[_0x9f8a('0x2c')]=_[_0x9f8a('0x2d')](_0x5cb13f,_0x9f8a('0x25'));_0x40f61e['query']=_[_0x9f8a('0x2e')](_0x28ab5f['query']);_0x40f61e[_0x9f8a('0x2f')]=_[_0x9f8a('0x30')](_0x40f61e['model'],_0x40f61e[_0x9f8a('0x31')]);_0x2c4ae3['attributes']=_['intersection'](_0x40f61e[_0x9f8a('0x2c')],qs[_0x9f8a('0x32')](_0x28ab5f[_0x9f8a('0x31')][_0x9f8a('0x32')]));_0x2c4ae3['attributes']=_0x2c4ae3[_0x9f8a('0x33')][_0x9f8a('0x34')]?_0x2c4ae3[_0x9f8a('0x33')]:_0x40f61e['model'];if(!_0x28ab5f[_0x9f8a('0x31')][_0x9f8a('0x35')]('nolimit')){_0x2c4ae3[_0x9f8a('0x1c')]=qs[_0x9f8a('0x1c')](_0x28ab5f[_0x9f8a('0x31')][_0x9f8a('0x1c')]);_0x2c4ae3[_0x9f8a('0x1a')]=qs[_0x9f8a('0x1a')](_0x28ab5f[_0x9f8a('0x31')][_0x9f8a('0x1a')]);}_0x2c4ae3['order']=qs['sort'](_0x28ab5f[_0x9f8a('0x31')][_0x9f8a('0x36')]);_0x2c4ae3[_0x9f8a('0x37')]=qs[_0x9f8a('0x2f')](_[_0x9f8a('0x38')](_0x28ab5f['query'],_0x40f61e[_0x9f8a('0x2f')]),_0x5cb13f);if(_0x28ab5f[_0x9f8a('0x31')][_0x9f8a('0x39')]){_0x2c4ae3[_0x9f8a('0x37')]=_[_0x9f8a('0x3a')](_0x2c4ae3[_0x9f8a('0x37')],{'$or':_['map'](_0x5cb13f,function(_0x4270a7){if(_0x4270a7[_0x9f8a('0x2a')]!=='VIRTUAL'){var _0x56f088={};_0x56f088[_0x4270a7[_0x9f8a('0x25')]]={'$like':'%'+_0x28ab5f['query'][_0x9f8a('0x39')]+'%'};return _0x56f088;}})});}_0x2c4ae3=_[_0x9f8a('0x3a')]({},_0x2c4ae3,_0x28ab5f[_0x9f8a('0x3b')]);var _0x5d53e5={'where':_0x2c4ae3[_0x9f8a('0x37')]};return db['ChatTransferReport']['count'](_0x5d53e5)['then'](function(_0x9c637c){_0x434bea[_0x9f8a('0x3c')]=_0x9c637c;if(_0x28ab5f[_0x9f8a('0x31')][_0x9f8a('0x3d')]){_0x2c4ae3[_0x9f8a('0x3e')]=[{'all':!![]}];}return db['ChatTransferReport']['findAll'](_0x2c4ae3);})['then'](function(_0x542630){_0x434bea[_0x9f8a('0x3f')]=_0x542630;return _0x434bea;})['then'](respondWithFilteredResult(_0x13b8bf,_0x2c4ae3))['catch'](handleError(_0x13b8bf,null));};exports[_0x9f8a('0x40')]=function(_0x43b364,_0x265627){var _0x5380f7={'raw':!![],'where':{'id':_0x43b364[_0x9f8a('0x41')]['id']}},_0x290144={};_0x290144[_0x9f8a('0x2c')]=_[_0x9f8a('0x2e')](db[_0x9f8a('0x28')][_0x9f8a('0x29')]);_0x290144[_0x9f8a('0x31')]=_[_0x9f8a('0x2e')](_0x43b364[_0x9f8a('0x31')]);_0x290144[_0x9f8a('0x2f')]=_['intersection'](_0x290144['model'],_0x290144[_0x9f8a('0x31')]);_0x5380f7[_0x9f8a('0x33')]=_['intersection'](_0x290144['model'],qs[_0x9f8a('0x32')](_0x43b364[_0x9f8a('0x31')][_0x9f8a('0x32')]));_0x5380f7[_0x9f8a('0x33')]=_0x5380f7['attributes'][_0x9f8a('0x34')]?_0x5380f7['attributes']:_0x290144[_0x9f8a('0x2c')];if(_0x43b364[_0x9f8a('0x31')]['includeAll']){_0x5380f7['include']=[{'all':!![]}];}_0x5380f7=_['merge']({},_0x5380f7,_0x43b364['options']);return db[_0x9f8a('0x28')][_0x9f8a('0x42')](_0x5380f7)[_0x9f8a('0x22')](handleEntityNotFound(_0x265627,null))[_0x9f8a('0x22')](respondWithResult(_0x265627,null))[_0x9f8a('0x43')](handleError(_0x265627,null));};exports[_0x9f8a('0x44')]=function(_0xb4c066,_0x552e0d){return db[_0x9f8a('0x28')]['create'](_0xb4c066['body'],{})[_0x9f8a('0x22')](respondWithResult(_0x552e0d,0xc9))[_0x9f8a('0x43')](handleError(_0x552e0d,null));};exports['update']=function(_0x15613c,_0x586fd9){if(_0x15613c[_0x9f8a('0x45')]['id']){delete _0x15613c[_0x9f8a('0x45')]['id'];}return db[_0x9f8a('0x28')][_0x9f8a('0x42')]({'where':{'id':_0x15613c[_0x9f8a('0x41')]['id']}})[_0x9f8a('0x22')](handleEntityNotFound(_0x586fd9,null))[_0x9f8a('0x22')](saveUpdates(_0x15613c['body'],null))[_0x9f8a('0x22')](respondWithResult(_0x586fd9,null))['catch'](handleError(_0x586fd9,null));};exports[_0x9f8a('0x46')]=function(_0x4f274c,_0x4a62e5){return db[_0x9f8a('0x28')][_0x9f8a('0x42')]({'where':{'id':_0x4f274c[_0x9f8a('0x41')]['id']}})[_0x9f8a('0x22')](handleEntityNotFound(_0x4a62e5,null))['then'](removeEntity(_0x4a62e5,null))['catch'](handleError(_0x4a62e5,null));};exports[_0x9f8a('0x47')]=function(_0x2e45c5,_0x259702){return db[_0x9f8a('0x28')][_0x9f8a('0x47')]()[_0x9f8a('0x22')](respondWithResult(_0x259702,null))[_0x9f8a('0x43')](handleError(_0x259702,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index ee0eec3..ff6f53c 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 _0x3cdf=['bluebird','request-promise','rimraf','../../config/environment','./chatTransferReport.attributes','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','../../config/logger','moment'];(function(_0x530f66,_0x41bcb7){var _0x23a441=function(_0x24c67f){while(--_0x24c67f){_0x530f66['push'](_0x530f66['shift']());}};_0x23a441(++_0x41bcb7);}(_0x3cdf,0x99));var _0xf3cd=function(_0x2351c4,_0x1dca54){_0x2351c4=_0x2351c4-0x0;var _0x1dd3f8=_0x3cdf[_0x2351c4];return _0x1dd3f8;};'use strict';var _=require(_0xf3cd('0x0'));var util=require('util');var logger=require(_0xf3cd('0x1'))('api');var moment=require(_0xf3cd('0x2'));var BPromise=require(_0xf3cd('0x3'));var rp=require(_0xf3cd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf3cd('0x5'));var config=require(_0xf3cd('0x6'));var attributes=require(_0xf3cd('0x7'));module['exports']=function(_0x493351,_0xbc0028){return _0x493351[_0xf3cd('0x8')](_0xf3cd('0x9'),attributes,{'tableName':_0xf3cd('0xa'),'paranoid':![],'indexes':[{'name':_0xf3cd('0xb'),'fields':[_0xf3cd('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4450=['uniqueid','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer'];(function(_0x33fa7c,_0xc93c6a){var _0x53da7e=function(_0x33c922){while(--_0x33c922){_0x33fa7c['push'](_0x33fa7c['shift']());}};_0x53da7e(++_0xc93c6a);}(_0x4450,0x119));var _0x0445=function(_0x567af5,_0x12f560){_0x567af5=_0x567af5-0x0;var _0x18ecf4=_0x4450[_0x567af5];return _0x18ecf4;};'use strict';var _=require('lodash');var util=require(_0x0445('0x0'));var logger=require(_0x0445('0x1'))(_0x0445('0x2'));var moment=require(_0x0445('0x3'));var BPromise=require('bluebird');var rp=require(_0x0445('0x4'));var fs=require('fs');var path=require(_0x0445('0x5'));var rimraf=require(_0x0445('0x6'));var config=require(_0x0445('0x7'));var attributes=require(_0x0445('0x8'));module[_0x0445('0x9')]=function(_0x2fdabd,_0x2f4733){return _0x2fdabd[_0x0445('0xa')](_0x0445('0xb'),attributes,{'tableName':_0x0445('0xc'),'paranoid':![],'indexes':[{'name':_0x0445('0xd'),'fields':[_0x0445('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index ce5057d..b42e499 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 _0x500b=['moment','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','message','ChatTransferReport,\x20%s,\x20%s','catch','lodash','util'];(function(_0xcd7d2,_0x3daeb2){var _0x2e4364=function(_0x583ee5){while(--_0x583ee5){_0xcd7d2['push'](_0xcd7d2['shift']());}};_0x2e4364(++_0x3daeb2);}(_0x500b,0x7c));var _0xb500=function(_0x17ff72,_0x5a05c9){_0x17ff72=_0x17ff72-0x0;var _0x4b987c=_0x500b[_0x17ff72];return _0x4b987c;};'use strict';var _=require(_0xb500('0x0'));var util=require(_0xb500('0x1'));var moment=require(_0xb500('0x2'));var BPromise=require(_0xb500('0x3'));var rs=require(_0xb500('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb500('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xb500('0x6'));var jayson=require(_0xb500('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xa6a35c,_0x57358d,_0x4ab02a){return new BPromise(function(_0x501271,_0x3f38b8){return client[_0xb500('0x8')](_0xa6a35c,_0x4ab02a)[_0xb500('0x9')](function(_0x44c996){logger[_0xb500('0xa')]('ChatTransferReport,\x20%s,\x20%s',_0x57358d,_0xb500('0xb'));logger[_0xb500('0xc')](_0xb500('0xd'),_0x57358d,_0xb500('0xb'),JSON['stringify'](_0x44c996));if(_0x44c996[_0xb500('0xe')]){if(_0x44c996[_0xb500('0xe')]['code']===0x1f4){logger[_0xb500('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0x57358d,_0x44c996[_0xb500('0xe')][_0xb500('0xf')]);return _0x3f38b8(_0x44c996[_0xb500('0xe')]['message']);}logger[_0xb500('0xe')](_0xb500('0x10'),_0x57358d,_0x44c996[_0xb500('0xe')][_0xb500('0xf')]);return _0x501271(_0x44c996['error'][_0xb500('0xf')]);}else{logger[_0xb500('0xa')]('ChatTransferReport,\x20%s,\x20%s',_0x57358d,_0xb500('0xb'));_0x501271(_0x44c996['result'][_0xb500('0xf')]);}})[_0xb500('0x11')](function(_0x36c9d1){logger['error'](_0xb500('0x10'),_0x57358d,_0x36c9d1);_0x3f38b8(_0x36c9d1);});});} \ No newline at end of file +var _0xe03e=['jayson/promise','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x28e4d6,_0x3084db){var _0x751d2e=function(_0x3e39d1){while(--_0x3e39d1){_0x28e4d6['push'](_0x28e4d6['shift']());}};_0x751d2e(++_0x3084db);}(_0xe03e,0x16d));var _0xee03=function(_0x2e6499,_0x468cd2){_0x2e6499=_0x2e6499-0x0;var _0xee830b=_0xe03e[_0x2e6499];return _0xee830b;};'use strict';var _=require(_0xee03('0x0'));var util=require(_0xee03('0x1'));var moment=require(_0xee03('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee03('0x3'));var db=require(_0xee03('0x4'))['db'];var utils=require(_0xee03('0x5'));var logger=require(_0xee03('0x6'))(_0xee03('0x7'));var config=require(_0xee03('0x8'));var jayson=require(_0xee03('0x9'));var client=jayson['client'][_0xee03('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a082a,_0x8a99ad,_0x53197d){return new BPromise(function(_0x18cea1,_0x23df8c){return client[_0xee03('0xb')](_0x4a082a,_0x53197d)[_0xee03('0xc')](function(_0x25394b){logger[_0xee03('0xd')](_0xee03('0xe'),_0x8a99ad,_0xee03('0xf'));logger[_0xee03('0x10')](_0xee03('0x11'),_0x8a99ad,_0xee03('0xf'),JSON['stringify'](_0x25394b));if(_0x25394b['error']){if(_0x25394b[_0xee03('0x12')][_0xee03('0x13')]===0x1f4){logger[_0xee03('0x12')](_0xee03('0xe'),_0x8a99ad,_0x25394b[_0xee03('0x12')][_0xee03('0x14')]);return _0x23df8c(_0x25394b[_0xee03('0x12')][_0xee03('0x14')]);}logger[_0xee03('0x12')](_0xee03('0xe'),_0x8a99ad,_0x25394b[_0xee03('0x12')][_0xee03('0x14')]);return _0x18cea1(_0x25394b[_0xee03('0x12')][_0xee03('0x14')]);}else{logger[_0xee03('0xd')](_0xee03('0xe'),_0x8a99ad,'request\x20sent');_0x18cea1(_0x25394b['result'][_0xee03('0x14')]);}})[_0xee03('0x15')](function(_0x4bf9df){logger[_0xee03('0x12')](_0xee03('0xe'),_0x8a99ad,_0x4bf9df);_0x23df8c(_0x4bf9df);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 8558140..957e4da 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 _0x14a5=['put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/:id','show','post','create'];(function(_0x27ee05,_0x2d3ca8){var _0x485de1=function(_0x30167d){while(--_0x30167d){_0x27ee05['push'](_0x27ee05['shift']());}};_0x485de1(++_0x2d3ca8);}(_0x14a5,0x193));var _0x514a=function(_0x2ee264,_0x2e97b7){_0x2ee264=_0x2ee264-0x0;var _0xfcaed5=_0x14a5[_0x2ee264];return _0xfcaed5;};'use strict';var multer=require(_0x514a('0x0'));var util=require('util');var path=require(_0x514a('0x1'));var timeout=require(_0x514a('0x2'));var express=require(_0x514a('0x3'));var router=express[_0x514a('0x4')]();var fs_extra=require(_0x514a('0x5'));var auth=require(_0x514a('0x6'));var interaction=require(_0x514a('0x7'));var config=require('../../config/environment');var controller=require('./chatTransferReport.controller');router[_0x514a('0x8')]('/',auth['isAuthenticated'](),controller[_0x514a('0x9')]);router[_0x514a('0x8')](_0x514a('0xa'),auth[_0x514a('0xb')](),controller[_0x514a('0xc')]);router['get'](_0x514a('0xd'),auth[_0x514a('0xb')](),controller[_0x514a('0xe')]);router[_0x514a('0xf')]('/',auth[_0x514a('0xb')](),controller[_0x514a('0x10')]);router[_0x514a('0x11')](_0x514a('0xd'),auth[_0x514a('0xb')](),controller['update']);router[_0x514a('0x12')](_0x514a('0xd'),auth[_0x514a('0xb')](),controller[_0x514a('0x13')]);module[_0x514a('0x14')]=router; \ No newline at end of file +var _0xad8c=['show','post','create','put','/:id','update','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x5b84d9,_0x450c7e){var _0x1dbeb8=function(_0x5a404d){while(--_0x5a404d){_0x5b84d9['push'](_0x5b84d9['shift']());}};_0x1dbeb8(++_0x450c7e);}(_0xad8c,0x110));var _0xcad8=function(_0x2bf888,_0x374f0b){_0x2bf888=_0x2bf888-0x0;var _0x3038d6=_0xad8c[_0x2bf888];return _0x3038d6;};'use strict';var multer=require('multer');var util=require(_0xcad8('0x0'));var path=require(_0xcad8('0x1'));var timeout=require(_0xcad8('0x2'));var express=require(_0xcad8('0x3'));var router=express['Router']();var fs_extra=require(_0xcad8('0x4'));var auth=require(_0xcad8('0x5'));var interaction=require(_0xcad8('0x6'));var config=require(_0xcad8('0x7'));var controller=require(_0xcad8('0x8'));router[_0xcad8('0x9')]('/',auth[_0xcad8('0xa')](),controller[_0xcad8('0xb')]);router['get'](_0xcad8('0xc'),auth[_0xcad8('0xa')](),controller[_0xcad8('0xd')]);router[_0xcad8('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xcad8('0xe')]);router[_0xcad8('0xf')]('/',auth[_0xcad8('0xa')](),controller[_0xcad8('0x10')]);router[_0xcad8('0x11')](_0xcad8('0x12'),auth[_0xcad8('0xa')](),controller[_0xcad8('0x13')]);router['delete'](_0xcad8('0x12'),auth[_0xcad8('0xa')](),controller[_0xcad8('0x14')]);module[_0xcad8('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 9cdf6ac..526bde0 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 _0x2084=['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:','Your\x20request\x20has\x20not\x20been\x20processed.','bottom_right','CHAT','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','star','input','name','text','getDataValue','onlineForm','parse','setDataValue','stringify','textarea','Comments','offlineForm'];(function(_0x548eae,_0xad69de){var _0x5b1a01=function(_0x358051){while(--_0x358051){_0x548eae['push'](_0x548eae['shift']());}};_0x5b1a01(++_0xad69de);}(_0x2084,0x163));var _0x4208=function(_0x54bc7a,_0x5079d8){_0x54bc7a=_0x54bc7a-0x0;var _0x34bb82=_0x2084[_0x54bc7a];return _0x34bb82;};'use strict';var Sequelize=require(_0x4208('0x0'));var rs=require(_0x4208('0x1'));module[_0x4208('0x2')]={'name':{'type':Sequelize[_0x4208('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x4208('0x4')},'description':{'type':Sequelize[_0x4208('0x3')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x4208('0x5')},'mapKeyOffline':{'type':Sequelize[_0x4208('0x3')],'defaultValue':_0x4208('0x5')},'key':{'type':Sequelize[_0x4208('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x4208('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4208('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x4208('0x3')],'allowNull':![],'defaultValue':_0x4208('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x4208('0x3')],'allowNull':![],'defaultValue':_0x4208('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4208('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x4208('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x4208('0x3')]},'animation':{'type':Sequelize[_0x4208('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x4208('0xa')](_0x4208('0xb'),_0x4208('0xc')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x4208('0x3')],'defaultValue':_0x4208('0xd')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x4208('0xe')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x4208('0xf')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x4208('0x10')},'download_transcript':{'type':Sequelize[_0x4208('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x4208('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x4208('0x3')],'defaultValue':_0x4208('0x11')},'defaultWhiteLabel':{'type':Sequelize[_0x4208('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x4208('0x12')]},'closingQuestion':{'type':Sequelize[_0x4208('0x3')],'defaultValue':_0x4208('0x13')},'formSubmitSuccessMessage':{'type':Sequelize[_0x4208('0x3')],'defaultValue':_0x4208('0x14')},'formSubmitFailureMessage':{'type':Sequelize[_0x4208('0x3')],'defaultValue':_0x4208('0x15')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x4208('0x16')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x4208('0x17')},'closingMessage':{'type':Sequelize[_0x4208('0x3')],'defaultValue':_0x4208('0x18')},'closingMessageButton':{'type':Sequelize[_0x4208('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x4208('0x3')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x4208('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x4208('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x4208('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x4208('0xa')](_0x4208('0x19'),'thumb'),'defaultValue':_0x4208('0x19')},'ratingStarsNumber':{'type':Sequelize[_0x4208('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x4208('0x1a'),'variable':null,'config':{'placeholder':_0x4208('0x1b'),'type':_0x4208('0x1c'),'required':!![]},'props':{'title':_0x4208('0x1b'),'helpText':''}},{'type':_0x4208('0x1a'),'props':{'title':_0x4208('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x4208('0x5'),'type':_0x4208('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x4208('0x1d')](_0x4208('0x1e'))?JSON[_0x4208('0x1f')](this[_0x4208('0x1d')]('onlineForm')):{};},'set':function(_0x3c0d36){return this[_0x4208('0x20')](_0x4208('0x1e'),JSON[_0x4208('0x21')](_0x3c0d36));}},'offlineForm':{'type':Sequelize[_0x4208('0x12')],'defaultValue':function(){return JSON[_0x4208('0x21')]({'items':[{'type':_0x4208('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x4208('0x5'),'type':_0x4208('0x5')},'variable':null},{'type':_0x4208('0x22'),'config':{'placeholder':_0x4208('0x23')},'props':{'title':_0x4208('0x23'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x4208('0x1d')](_0x4208('0x24'))?JSON[_0x4208('0x1f')](this[_0x4208('0x1d')]('offlineForm')):{};},'set':function(_0x59a4ea){return this[_0x4208('0x20')](_0x4208('0x24'),JSON[_0x4208('0x21')](_0x59a4ea));}},'token':{'type':Sequelize[_0x4208('0x3')],'defaultValue':function(){return rs[_0x4208('0x25')]();}},'autoclose':{'type':Sequelize[_0x4208('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x4208('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x4208('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x4208('0x3')]},'forwardOffline':{'type':Sequelize[_0x4208('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x4208('0x3')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x4208('0x3')],'defaultValue':_0x4208('0x26')},'offlineMessageSubject':{'type':Sequelize[_0x4208('0x3')],'defaultValue':_0x4208('0x27')},'offlineMessageBody':{'type':Sequelize[_0x4208('0x3')],'defaultValue':_0x4208('0x28')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x4208('0x3')],'defaultValue':_0x4208('0x29')},'skipUnmanaged':{'type':Sequelize[_0x4208('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x4208('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x4208('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x4208('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x4208('0x12')]},'showAgentAvatar':{'type':Sequelize[_0x4208('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x4208('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x4208('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4208('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x4208('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x4208('0x3')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x4208('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x4208('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x4208('0x2a')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x4208('0x2b')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x4208('0x12')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x4208('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x4208('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4208('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4208('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x4208('0x3')],'defaultValue':_0x4208('0x2c')},'systemAvatar':{'type':Sequelize[_0x4208('0x12')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x4208('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0x4208('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x218750){if(!_0x218750)this[_0x4208('0x20')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x4208('0x2e'),_0x218750);}},'vidaooEscalation':{'type':Sequelize[_0x4208('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x4208('0x3')]},'vidaooTopic':{'type':Sequelize[_0x4208('0x3')],'allowNull':![],'defaultValue':_0x4208('0x2f')},'vidaooNote':{'type':Sequelize[_0x4208('0x3')],'defaultValue':function(){return _0x4208('0x30');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x4208('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x4208('0x12')]}}; \ No newline at end of file +var _0x9233=['bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','STRING','address','email','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Send','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','thumb','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0x9233,0xd1));var _0x3923=function(_0xd81b7d,_0x3561e0){_0xd81b7d=_0xd81b7d-0x0;var _0x3358a1=_0x9233[_0xd81b7d];return _0x3358a1;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x3923('0x0'));module[_0x3923('0x1')]={'name':{'type':Sequelize[_0x3923('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x3923('0x2')],'allowNull':![],'unique':_0x3923('0x3')},'description':{'type':Sequelize[_0x3923('0x2')]},'mapKey':{'type':Sequelize[_0x3923('0x2')],'defaultValue':_0x3923('0x4')},'mapKeyOffline':{'type':Sequelize[_0x3923('0x2')],'defaultValue':_0x3923('0x4')},'key':{'type':Sequelize[_0x3923('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x3923('0x2')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x3923('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x3923('0x2')],'allowNull':![],'defaultValue':_0x3923('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3923('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x3923('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x3923('0x2')]},'animation':{'type':Sequelize[_0x3923('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x3923('0x9')](_0x3923('0xa'),'squared'),'defaultValue':_0x3923('0xa')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x3923('0xb')},'start_chat_button':{'type':Sequelize[_0x3923('0x2')],'defaultValue':_0x3923('0xc')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x3923('0xd')},'header_offline':{'type':Sequelize[_0x3923('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x3923('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x3923('0x2')],'defaultValue':_0x3923('0xe')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x3923('0xf')]},'closingQuestion':{'type':Sequelize[_0x3923('0x2')],'defaultValue':_0x3923('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0x3923('0x2')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x3923('0x2')],'defaultValue':_0x3923('0x11')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x3923('0x12')},'placeholderMessage':{'type':Sequelize[_0x3923('0x2')],'defaultValue':_0x3923('0x13')},'closingMessage':{'type':Sequelize[_0x3923('0x2')],'defaultValue':_0x3923('0x14')},'closingMessageButton':{'type':Sequelize[_0x3923('0x2')],'defaultValue':_0x3923('0xd')},'skipMessageButton':{'type':Sequelize[_0x3923('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x3923('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x3923('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x3923('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x3923('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x3923('0x2')],'defaultValue':_0x3923('0x15')},'ratingType':{'type':Sequelize[_0x3923('0x9')]('star',_0x3923('0x16')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x3923('0x17')]({'items':[{'type':_0x3923('0x18'),'variable':null,'config':{'placeholder':_0x3923('0x19'),'type':_0x3923('0x1a'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x3923('0x18'),'props':{'title':_0x3923('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x3923('0x4'),'type':_0x3923('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x3923('0x1b')](_0x3923('0x1c'))?JSON[_0x3923('0x1d')](this[_0x3923('0x1b')](_0x3923('0x1c'))):{};},'set':function(_0x45a4d8){return this[_0x3923('0x1e')](_0x3923('0x1c'),JSON['stringify'](_0x45a4d8));}},'offlineForm':{'type':Sequelize[_0x3923('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x3923('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x3923('0x4')},'variable':null},{'type':_0x3923('0x1f'),'config':{'placeholder':_0x3923('0x20')},'props':{'title':_0x3923('0x20'),'helpText':_0x3923('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x3923('0x1b')](_0x3923('0x22'))?JSON[_0x3923('0x1d')](this[_0x3923('0x1b')](_0x3923('0x22'))):{};},'set':function(_0x5dba75){return this[_0x3923('0x1e')](_0x3923('0x22'),JSON[_0x3923('0x17')](_0x5dba75));}},'token':{'type':Sequelize[_0x3923('0x2')],'defaultValue':function(){return rs[_0x3923('0x23')]();}},'autoclose':{'type':Sequelize[_0x3923('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x3923('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x3923('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x3923('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x3923('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x3923('0x24')},'offlineMessageSubject':{'type':Sequelize[_0x3923('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x3923('0x2')],'defaultValue':_0x3923('0x25')},'enableUnmanagedNote':{'type':Sequelize[_0x3923('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x3923('0x2')],'defaultValue':_0x3923('0x26')},'skipUnmanaged':{'type':Sequelize[_0x3923('0x2')],'defaultValue':_0x3923('0x27')},'sendUnmanaged':{'type':Sequelize[_0x3923('0x2')],'defaultValue':_0x3923('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x3923('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x3923('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x3923('0xf')]},'showAgentAvatar':{'type':Sequelize[_0x3923('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x3923('0x2')]},'notificationTemplate':{'type':Sequelize[_0x3923('0xf')],'defaultValue':function(){return _0x3923('0x28');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3923('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x3923('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x3923('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x3923('0x2')],'defaultValue':_0x3923('0x29')},'verticalAlignment':{'type':Sequelize[_0x3923('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x3923('0x2')],'defaultValue':_0x3923('0x2a')},'messagesAlignment':{'type':Sequelize[_0x3923('0x2')],'defaultValue':_0x3923('0x2b')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x3923('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0x3923('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x3923('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x3923('0x2')],'allowNull':![],'defaultValue':_0x3923('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x3923('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3923('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3923('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3923('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x3923('0x2')],'defaultValue':_0x3923('0x2d')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3923('0x7')],'comment':_0x3923('0x2e')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xfa8389){if(!_0xfa8389)this[_0x3923('0x1e')](_0x3923('0x2f'),null);this[_0x3923('0x1e')](_0x3923('0x30'),_0xfa8389);}},'vidaooEscalation':{'type':Sequelize[_0x3923('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x3923('0x2')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x3923('0x2')],'defaultValue':function(){return _0x3923('0x31');}},'vidaooMetadata':{'type':Sequelize[_0x3923('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x3923('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x3923('0xf')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 6e28a01..d6a1fe5 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 _0xcbf2=['setUA','user-agent','getResult','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','model','device','%s\x20%s\x20%s','vendor','type','Pause','map','rawAttributes','fieldName','key','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','ChatWebsite','then','includeAll','include','findAll','rows','show','mandatoryDispositionPause','intersection','options','find','body','address','\x22\x20is\x20not\x20a\x20valid\x20website\x20domain','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','testWildcardValidity','params','describe','ChatWebsiteId','getDispositions','findOne','Disposition','removeDispositions','ids','CannedAnswer','getAnswers','length','removeAnswers','sitepic','file','filename','addAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','getLicense','isNil','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','resolve','ifTime','notify','chat','from','From\x20is\x20mandatory','mapKey','isEmpty','Body\x20is\x20mandatory','No\x20available\x20attributes','updatedAt','includes','createdAt','CompanyId','ListId','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','CmList','List','CmContact','Contacts','DESC','ChatApplication','Applications','Interval','Intervals','interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','orderBy','priority','list','defaults','contact','headers','threadId','ChatInteraction','closed','Writing\x20on\x20closed\x20interaction','externalUrl','interaction','messageId','created','applications','push','close','*,*,*,*','AttachmentId','UserId','User','agent','forcedOwnership','queueId','ChatQueue','unshift','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','offline','Sequelize','ValidationError','no\x20available\x20attributes','difference','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','files','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','SendMail','offlineMessageSubject','MailAccountId','toPairsIn','mapValues','subjectOffline','email','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Owner','fullname','internal','Tag','tag','getProactiveActions','../../config/license/util','custom','License','increment','chatLicenseExceeded','timezone','readFileSync','server/files/chat/iframe.ejs','3.9.0','replace','remote','connection','alignment','color','labelText','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','getApplications','omit','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Contact','Attachment','addAgents','emit','userChatWebsite:save','removeAgents','getAgents','mustache','util','path','ejs','fs-extra','lodash','querystring','html-to-text','ioredis','jayson/promise','../../config/logger','api','../../config/environment','APIBadRequestError','../../errors/api','APINotFoundError','APIOutOfIntervalError','handleError','APIConflictError','./helpers/wildcard-expressions','url','URL','../../mysqldb','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','update','get','ChatWebsites','UserProfileResource','destroy','stack','name','send','user-agent-parser'];(function(_0x28f0e5,_0x2db50c){var _0x36214c=function(_0xe112){while(--_0xe112){_0x28f0e5['push'](_0x28f0e5['shift']());}};_0x36214c(++_0x2db50c);}(_0xcbf2,0xf9));var _0x2cbf=function(_0x281312,_0x15b6df){_0x281312=_0x281312-0x0;var _0x12c8b6=_0xcbf2[_0x281312];return _0x12c8b6;};'use strict';var Mustache=require(_0x2cbf('0x0'));var util=require(_0x2cbf('0x1'));var path=require(_0x2cbf('0x2'));var ejs=require(_0x2cbf('0x3'));var fs=require('fs');var fs_extra=require(_0x2cbf('0x4'));var _=require(_0x2cbf('0x5'));var querystring=require(_0x2cbf('0x6'));var htmlToText=require(_0x2cbf('0x7'));var Redis=require(_0x2cbf('0x8'));var jayson=require(_0x2cbf('0x9'));var qs=require('../../components/parsers/qs');var logger=require(_0x2cbf('0xa'))(_0x2cbf('0xb'));var config=require(_0x2cbf('0xc'));var APIBadRequestError=require('../../errors/api')[_0x2cbf('0xd')];var APINotFoundError=require(_0x2cbf('0xe'))[_0x2cbf('0xf')];var APIOutOfIntervalError=require(_0x2cbf('0xe'))[_0x2cbf('0x10')];var APIHandleError=require(_0x2cbf('0xe'))[_0x2cbf('0x11')];var APIConflictError=require(_0x2cbf('0xe'))[_0x2cbf('0x12')];var wildcardUtils=require(_0x2cbf('0x13'));var URL=require(_0x2cbf('0x14'))[_0x2cbf('0x15')];var db=require(_0x2cbf('0x16'))['db'];config['redis']=_['defaults'](config[_0x2cbf('0x17')],{'host':_0x2cbf('0x18'),'port':0x18eb});var socket=require(_0x2cbf('0x19'))(new Redis(config[_0x2cbf('0x17')]));require(_0x2cbf('0x1a'))[_0x2cbf('0x1b')](socket);var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x2cbf('0x1c')][_0x2cbf('0x1d')]({'port':0x232a});var client9003=jayson[_0x2cbf('0x1c')][_0x2cbf('0x1d')]({'port':0x232b});var client9001=jayson[_0x2cbf('0x1c')][_0x2cbf('0x1d')]({'port':0x2329});function respondWithRpcPromise(_0x572a17,_0x2dd12e,_0x2f757b,_0x4013df){return new Promise(function(_0x1c4621,_0xc48199){var _0x328d55=_0x4013df||client;return _0x328d55['request'](_0x572a17,_0x2f757b)['then'](function(_0x13156e){logger[_0x2cbf('0x1e')](_0x2cbf('0x1f'),_0x2dd12e,_0x2cbf('0x20'));logger[_0x2cbf('0x21')](_0x2cbf('0x22'),_0x2dd12e,_0x2cbf('0x20'),JSON[_0x2cbf('0x23')](_0x13156e));if(_0x13156e[_0x2cbf('0x24')]){if(_0x13156e[_0x2cbf('0x24')][_0x2cbf('0x25')]===0x1f4){logger[_0x2cbf('0x24')]('ChatWebsite,\x20%s,\x20%s',_0x2dd12e,_0x13156e[_0x2cbf('0x24')][_0x2cbf('0x26')]);return _0xc48199(_0x13156e['error'][_0x2cbf('0x26')]);}logger[_0x2cbf('0x24')](_0x2cbf('0x1f'),_0x2dd12e,_0x13156e[_0x2cbf('0x24')][_0x2cbf('0x26')]);return _0x1c4621(_0x13156e['error'][_0x2cbf('0x26')]);}else{logger[_0x2cbf('0x1e')](_0x2cbf('0x1f'),_0x2dd12e,_0x2cbf('0x20'));_0x1c4621(_0x13156e[_0x2cbf('0x27')][_0x2cbf('0x26')]);}})[_0x2cbf('0x28')](function(_0x58eda8){logger[_0x2cbf('0x24')](_0x2cbf('0x1f'),_0x2dd12e,_0x58eda8);_0xc48199(_0x58eda8);});});}function respondWithStatusCode(_0x471280,_0x21f4c0){_0x21f4c0=_0x21f4c0||0xcc;return function(_0x39c5bd){if(_0x39c5bd){return _0x471280[_0x2cbf('0x29')](_0x21f4c0);}return _0x471280['status'](_0x21f4c0)['end']();};}function respondWithResult(_0xa53176,_0x5845cc){_0x5845cc=_0x5845cc||0xc8;return function(_0x45aff6){if(_0x45aff6){return _0xa53176['status'](_0x5845cc)[_0x2cbf('0x2a')](_0x45aff6);}};}function respondWithFilteredResult(_0x2b89c8,_0x5b2f9a){return function(_0x3951d5){if(_0x3951d5){var _0x52879f=typeof _0x5b2f9a[_0x2cbf('0x2b')]===_0x2cbf('0x2c')&&typeof _0x5b2f9a[_0x2cbf('0x2d')]===_0x2cbf('0x2c');var _0x2f9789=_0x3951d5[_0x2cbf('0x2e')];var _0x359371=_0x52879f?0x0:_0x5b2f9a[_0x2cbf('0x2b')];var _0x1559a4=_0x52879f?_0x3951d5['count']:_0x5b2f9a[_0x2cbf('0x2b')]+_0x5b2f9a['limit'];var _0x47ee8b;if(_0x1559a4>=_0x2f9789){_0x1559a4=_0x2f9789;_0x47ee8b=0xc8;}else{_0x47ee8b=0xce;}_0x2b89c8[_0x2cbf('0x2f')](_0x47ee8b);return _0x2b89c8[_0x2cbf('0x30')](_0x2cbf('0x31'),_0x359371+'-'+_0x1559a4+'/'+_0x2f9789)[_0x2cbf('0x2a')](_0x3951d5);}return null;};}function saveUpdates(_0x4cc0a7){return function(_0x92cc1e){if(_0x92cc1e){return _0x92cc1e[_0x2cbf('0x32')](_0x4cc0a7)['then'](function(_0x4b1c0f){return _0x4b1c0f;});}return null;};}function removeEntity(_0x555311){return function(_0x1bffd2){if(_0x1bffd2){return _0x1bffd2['destroy']()['then'](function(){var _0x572441=_0x1bffd2[_0x2cbf('0x33')]({'plain':!![]});var _0x4e5ce6=_0x2cbf('0x34');return db[_0x2cbf('0x35')][_0x2cbf('0x36')]({'where':{'type':_0x4e5ce6,'resourceId':_0x572441['id']}})['then'](function(){return _0x1bffd2;});})['then'](function(){_0x555311[_0x2cbf('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x550e6a){return function(_0x155fdc){if(!_0x155fdc){_0x550e6a['sendStatus'](0x194);}return _0x155fdc;};}function handleError(_0x52d8c7,_0x797cac){_0x797cac=_0x797cac||0x1f4;return function(_0x4204f6){logger['error'](_0x4204f6[_0x2cbf('0x37')]);if(_0x4204f6[_0x2cbf('0x38')]){delete _0x4204f6['name'];}_0x52d8c7[_0x2cbf('0x2f')](_0x797cac)[_0x2cbf('0x39')](_0x4204f6);};}function createInteractionObject(_0x5738f4,_0x4fc7e1,_0x48a27f,_0x3a85d2){var _0x2a322a=require(_0x2cbf('0x3a'));var _0x5d5097=new _0x2a322a();var _0x3f6dfd=_0x5d5097[_0x2cbf('0x3b')](_0x48a27f[_0x2cbf('0x3c')])[_0x2cbf('0x3d')]();var _0x3654ac=_0x4fc7e1[_0x2cbf('0x3e')];if(_0x48a27f[_0x2cbf('0x3f')]){_0x3654ac=_0x48a27f['cf-connecting-ip'];}else if(_0x48a27f['x-forwarded-for']){_0x3654ac=_[_0x2cbf('0x40')](_0x48a27f[_0x2cbf('0x41')][_0x2cbf('0x42')](','));}return{'ContactId':_0x3a85d2['id'],'ChatWebsiteId':_0x5738f4,'from':(_0x3a85d2[_0x2cbf('0x43')]||'')+'\x20'+(_0x3a85d2[_0x2cbf('0x44')]||''),'customerIp':_0x3654ac,'customerPort':_0x48a27f[_0x2cbf('0x45')]?_0x48a27f[_0x2cbf('0x45')]:null,'referer':_0x4fc7e1[_0x2cbf('0x46')],'browserName':_0x3f6dfd[_0x2cbf('0x47')]['name']&&_0x3f6dfd[_0x2cbf('0x47')][_0x2cbf('0x48')]?util[_0x2cbf('0x49')](_0x2cbf('0x4a'),_0x3f6dfd[_0x2cbf('0x47')][_0x2cbf('0x38')],_0x3f6dfd[_0x2cbf('0x47')][_0x2cbf('0x48')]):'unknown','browserVersion':_0x3f6dfd[_0x2cbf('0x47')][_0x2cbf('0x48')]||_0x2cbf('0x4b'),'osName':util[_0x2cbf('0x49')](_0x2cbf('0x4a'),_0x3f6dfd['os'][_0x2cbf('0x38')],_0x3f6dfd['os'][_0x2cbf('0x48')]),'osVersion':_0x3f6dfd['os'][_0x2cbf('0x48')],'deviceModel':_0x3f6dfd['device'][_0x2cbf('0x4c')]&&_0x3f6dfd[_0x2cbf('0x4d')]['vendor']?util[_0x2cbf('0x49')](_0x2cbf('0x4e'),_0x3f6dfd[_0x2cbf('0x4d')][_0x2cbf('0x4c')],_0x3f6dfd[_0x2cbf('0x4d')][_0x2cbf('0x4f')],_0x3f6dfd['device'][_0x2cbf('0x50')]):null,'deviceVendor':_0x3f6dfd[_0x2cbf('0x4d')]['vendor'],'deviceType':_0x3f6dfd[_0x2cbf('0x4d')][_0x2cbf('0x50')],'formData':JSON['stringify'](_0x4fc7e1)};}exports['index']=function(_0x41a754,_0x566bfb){var _0x1ac967={'include':[{'model':db[_0x2cbf('0x51')],'as':'mandatoryDispositionPause'}]},_0x303a9f={},_0x2e65b5={'count':0x0,'rows':[]};var _0x3563b5=_[_0x2cbf('0x52')](db['ChatWebsite'][_0x2cbf('0x53')],function(_0x3c5102){return{'name':_0x3c5102[_0x2cbf('0x54')],'type':_0x3c5102[_0x2cbf('0x50')][_0x2cbf('0x55')]};});_0x303a9f[_0x2cbf('0x4c')]=_[_0x2cbf('0x52')](_0x3563b5,_0x2cbf('0x38'));_0x303a9f[_0x2cbf('0x56')]=_[_0x2cbf('0x57')](_0x41a754['query']);_0x303a9f[_0x2cbf('0x58')]=_['intersection'](_0x303a9f['model'],_0x303a9f[_0x2cbf('0x56')]);_0x1ac967[_0x2cbf('0x59')]=_['intersection'](_0x303a9f[_0x2cbf('0x4c')],qs['fields'](_0x41a754['query'][_0x2cbf('0x5a')]));_0x1ac967[_0x2cbf('0x59')]=_0x1ac967['attributes']['length']?_0x1ac967[_0x2cbf('0x59')]:_0x303a9f['model'];if(!_0x41a754['query'][_0x2cbf('0x5b')](_0x2cbf('0x5c'))){_0x1ac967[_0x2cbf('0x2d')]=qs[_0x2cbf('0x2d')](_0x41a754[_0x2cbf('0x56')][_0x2cbf('0x2d')]);_0x1ac967[_0x2cbf('0x2b')]=qs[_0x2cbf('0x2b')](_0x41a754[_0x2cbf('0x56')]['offset']);}_0x1ac967[_0x2cbf('0x5d')]=qs[_0x2cbf('0x5e')](_0x41a754[_0x2cbf('0x56')][_0x2cbf('0x5e')]);_0x1ac967['where']=qs[_0x2cbf('0x58')](_[_0x2cbf('0x5f')](_0x41a754[_0x2cbf('0x56')],_0x303a9f[_0x2cbf('0x58')]),_0x3563b5);if(_0x41a754['query']['filter']){_0x1ac967['where']=_[_0x2cbf('0x60')](_0x1ac967[_0x2cbf('0x61')],{'$or':_[_0x2cbf('0x52')](_0x3563b5,function(_0x237624){if(_0x237624[_0x2cbf('0x50')]!==_0x2cbf('0x62')){var _0x31c7a0={};_0x31c7a0[_0x237624[_0x2cbf('0x38')]]={'$like':'%'+_0x41a754[_0x2cbf('0x56')][_0x2cbf('0x63')]+'%'};return _0x31c7a0;}})});}_0x1ac967=_[_0x2cbf('0x60')]({},_0x1ac967,_0x41a754['options']);var _0x2b47ee={'where':_0x1ac967['where']};return db[_0x2cbf('0x64')][_0x2cbf('0x2e')](_0x2b47ee)[_0x2cbf('0x65')](function(_0x287c86){_0x2e65b5[_0x2cbf('0x2e')]=_0x287c86;if(_0x41a754[_0x2cbf('0x56')][_0x2cbf('0x66')]){_0x1ac967[_0x2cbf('0x67')]=[{'all':!![]}];}return db['ChatWebsite'][_0x2cbf('0x68')](_0x1ac967);})['then'](function(_0x4c96fe){_0x2e65b5[_0x2cbf('0x69')]=_0x4c96fe;return _0x2e65b5;})['then'](respondWithFilteredResult(_0x566bfb,_0x1ac967))[_0x2cbf('0x28')](handleError(_0x566bfb,null));};exports[_0x2cbf('0x6a')]=function(_0x5c74a1,_0x4e2026){var _0x267c3a={'raw':![],'where':{'id':_0x5c74a1['params']['id']},'include':[{'model':db[_0x2cbf('0x51')],'as':_0x2cbf('0x6b')}]},_0x3834a3={};_0x3834a3[_0x2cbf('0x4c')]=_['keys'](db[_0x2cbf('0x64')]['rawAttributes']);_0x3834a3[_0x2cbf('0x56')]=_[_0x2cbf('0x57')](_0x5c74a1['query']);_0x3834a3[_0x2cbf('0x58')]=_['intersection'](_0x3834a3[_0x2cbf('0x4c')],_0x3834a3[_0x2cbf('0x56')]);_0x267c3a[_0x2cbf('0x59')]=_[_0x2cbf('0x6c')](_0x3834a3[_0x2cbf('0x4c')],qs[_0x2cbf('0x5a')](_0x5c74a1['query']['fields']));_0x267c3a[_0x2cbf('0x59')]=_0x267c3a[_0x2cbf('0x59')]['length']?_0x267c3a[_0x2cbf('0x59')]:_0x3834a3[_0x2cbf('0x4c')];if(_0x5c74a1[_0x2cbf('0x56')][_0x2cbf('0x66')]){_0x267c3a[_0x2cbf('0x67')]=[{'all':!![]}];}_0x267c3a=_[_0x2cbf('0x60')]({},_0x267c3a,_0x5c74a1[_0x2cbf('0x6d')]);return db[_0x2cbf('0x64')][_0x2cbf('0x6e')](_0x267c3a)[_0x2cbf('0x65')](handleEntityNotFound(_0x4e2026,null))[_0x2cbf('0x65')](respondWithResult(_0x4e2026,null))[_0x2cbf('0x28')](handleError(_0x4e2026,null));};exports['create']=function(_0x16a7ae,_0x50d8e2){if(!wildcardUtils['testWildcardValidity'](_0x16a7ae[_0x2cbf('0x6f')]['address'])){return handleError(_0x50d8e2,null)(new APIBadRequestError('\x22'+_0x16a7ae['body'][_0x2cbf('0x70')]+_0x2cbf('0x71')));}return db['ChatWebsite'][_0x2cbf('0x72')](_0x16a7ae[_0x2cbf('0x6f')],{})[_0x2cbf('0x65')](function(_0x33f954){var _0x11f98f=_0x16a7ae[_0x2cbf('0x73')]['get']({'plain':!![]});if(!_0x11f98f)throw new Error(_0x2cbf('0x74'));if(_0x11f98f['role']==='user'){var _0x2d6af0=_0x33f954[_0x2cbf('0x33')]({'plain':!![]});var _0x52e018='ChatWebsites';return db[_0x2cbf('0x75')][_0x2cbf('0x6e')]({'where':{'name':_0x52e018,'userProfileId':_0x11f98f[_0x2cbf('0x76')]},'raw':!![]})[_0x2cbf('0x65')](function(_0x54ceb6){if(_0x54ceb6&&_0x54ceb6[_0x2cbf('0x77')]===0x0){return db[_0x2cbf('0x35')][_0x2cbf('0x72')]({'name':_0x2d6af0[_0x2cbf('0x38')],'resourceId':_0x2d6af0['id'],'type':_0x54ceb6[_0x2cbf('0x38')],'sectionId':_0x54ceb6['id']},{})[_0x2cbf('0x65')](function(){return _0x33f954;});}else{return _0x33f954;}})[_0x2cbf('0x28')](function(_0x2d31ed){logger[_0x2cbf('0x24')](_0x2cbf('0x78'),_0x2d31ed);throw _0x2d31ed;});}return _0x33f954;})[_0x2cbf('0x65')](respondWithResult(_0x50d8e2,0xc9))[_0x2cbf('0x28')](handleError(_0x50d8e2,null));};exports[_0x2cbf('0x32')]=function(_0x198b3e,_0x53fd4b){if(!wildcardUtils[_0x2cbf('0x79')](_0x198b3e[_0x2cbf('0x6f')][_0x2cbf('0x70')])){return handleError(_0x53fd4b,null)(new APIBadRequestError('\x22'+_0x198b3e[_0x2cbf('0x6f')][_0x2cbf('0x70')]+_0x2cbf('0x71')));}if(_0x198b3e[_0x2cbf('0x6f')]['id']){delete _0x198b3e[_0x2cbf('0x6f')]['id'];}return db[_0x2cbf('0x64')][_0x2cbf('0x6e')]({'where':{'id':_0x198b3e[_0x2cbf('0x7a')]['id']},'include':[{'model':db[_0x2cbf('0x51')],'as':'mandatoryDispositionPause'}]})[_0x2cbf('0x65')](handleEntityNotFound(_0x53fd4b,null))[_0x2cbf('0x65')](saveUpdates(_0x198b3e[_0x2cbf('0x6f')],null))['then'](respondWithResult(_0x53fd4b,null))[_0x2cbf('0x28')](handleError(_0x53fd4b,null));};exports[_0x2cbf('0x36')]=function(_0x39a27f,_0x275247){return db[_0x2cbf('0x64')][_0x2cbf('0x6e')]({'where':{'id':_0x39a27f['params']['id']}})['then'](handleEntityNotFound(_0x275247,null))[_0x2cbf('0x65')](removeEntity(_0x275247,null))[_0x2cbf('0x28')](handleError(_0x275247,null));};exports[_0x2cbf('0x7b')]=function(_0x24aab4,_0x4d03b6){return db[_0x2cbf('0x64')][_0x2cbf('0x7b')]()[_0x2cbf('0x65')](respondWithResult(_0x4d03b6,null))[_0x2cbf('0x28')](handleError(_0x4d03b6,null));};exports['addDisposition']=function(_0x1e9d63,_0x2e320a){if(_0x1e9d63[_0x2cbf('0x6f')]['id']){delete _0x1e9d63[_0x2cbf('0x6f')]['id'];}return db['ChatWebsite'][_0x2cbf('0x6e')]({'where':{'id':_0x1e9d63[_0x2cbf('0x7a')]['id']}})[_0x2cbf('0x65')](handleEntityNotFound(_0x2e320a,null))[_0x2cbf('0x65')](function(_0x52523c){if(_0x52523c){_0x1e9d63[_0x2cbf('0x6f')][_0x2cbf('0x7c')]=_0x52523c['id'];return db['Disposition'][_0x2cbf('0x72')](_0x1e9d63[_0x2cbf('0x6f')]);}})[_0x2cbf('0x65')](respondWithResult(_0x2e320a,null))[_0x2cbf('0x28')](handleError(_0x2e320a,null));};exports[_0x2cbf('0x7d')]=function(_0x2fcf85,_0x1e7b9e){var _0x16f580={'raw':![],'where':{}};var _0xa4d1c3={};var _0x197663={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x2cbf('0x7e')]({'where':{'id':_0x2fcf85[_0x2cbf('0x7a')]['id']}})['then'](handleEntityNotFound(_0x1e7b9e,null))[_0x2cbf('0x65')](function(_0x643640){if(_0x643640){_0xa4d1c3['model']=_[_0x2cbf('0x57')](db[_0x2cbf('0x7f')][_0x2cbf('0x53')]);_0xa4d1c3[_0x2cbf('0x56')]=_[_0x2cbf('0x57')](_0x2fcf85['query']);_0xa4d1c3[_0x2cbf('0x58')]=_[_0x2cbf('0x6c')](_0xa4d1c3['model'],_0xa4d1c3['query']);_0x16f580['attributes']=_[_0x2cbf('0x6c')](_0xa4d1c3[_0x2cbf('0x4c')],qs[_0x2cbf('0x5a')](_0x2fcf85[_0x2cbf('0x56')][_0x2cbf('0x5a')]));_0x16f580[_0x2cbf('0x59')]=_0x16f580[_0x2cbf('0x59')]['length']?_0x16f580[_0x2cbf('0x59')]:_0xa4d1c3[_0x2cbf('0x4c')];if(!_0x2fcf85[_0x2cbf('0x56')]['hasOwnProperty'](_0x2cbf('0x5c'))){_0x16f580['limit']=qs[_0x2cbf('0x2d')](_0x2fcf85[_0x2cbf('0x56')][_0x2cbf('0x2d')]);_0x16f580['offset']=qs[_0x2cbf('0x2b')](_0x2fcf85[_0x2cbf('0x56')][_0x2cbf('0x2b')]);}_0x16f580[_0x2cbf('0x5d')]=qs[_0x2cbf('0x5e')](_0x2fcf85['query'][_0x2cbf('0x5e')]);_0x16f580['where']=qs[_0x2cbf('0x58')](_[_0x2cbf('0x5f')](_0x2fcf85[_0x2cbf('0x56')],_0xa4d1c3[_0x2cbf('0x58')]));_0x16f580[_0x2cbf('0x61')][_0x2cbf('0x7c')]=_0x643640['id'];if(_0x2fcf85[_0x2cbf('0x56')][_0x2cbf('0x63')]){_0x16f580[_0x2cbf('0x61')]=_['merge'](_0x16f580[_0x2cbf('0x61')],{'$or':_[_0x2cbf('0x52')](_0x16f580[_0x2cbf('0x59')],function(_0x389baa){var _0x491b2a={};_0x491b2a[_0x389baa]={'$like':'%'+_0x2fcf85[_0x2cbf('0x56')][_0x2cbf('0x63')]+'%'};return _0x491b2a;})});}_0x16f580=_[_0x2cbf('0x60')]({},_0x16f580,_0x2fcf85[_0x2cbf('0x6d')]);return db[_0x2cbf('0x7f')][_0x2cbf('0x2e')]({'where':_0x16f580[_0x2cbf('0x61')]})[_0x2cbf('0x65')](function(_0x22e7f6){_0x197663[_0x2cbf('0x2e')]=_0x22e7f6;if(_0x2fcf85[_0x2cbf('0x56')][_0x2cbf('0x66')]){_0x16f580[_0x2cbf('0x67')]=[{'all':!![]}];}return db[_0x2cbf('0x7f')][_0x2cbf('0x68')](_0x16f580);})[_0x2cbf('0x65')](function(_0x1b6ee7){_0x197663[_0x2cbf('0x69')]=_0x1b6ee7;return _0x197663;});}})['then'](respondWithFilteredResult(_0x1e7b9e,_0x16f580))[_0x2cbf('0x28')](handleError(_0x1e7b9e,null));};exports[_0x2cbf('0x80')]=function(_0xea0046,_0x16934c){return db[_0x2cbf('0x64')][_0x2cbf('0x6e')]({'where':{'id':_0xea0046['params']['id']}})[_0x2cbf('0x65')](handleEntityNotFound(_0x16934c,null))['then'](function(_0xb01a8a){if(_0xb01a8a){return _0xb01a8a['removeDispositions'](_0xea0046['query'][_0x2cbf('0x81')]);}})['then'](respondWithStatusCode(_0x16934c,null))[_0x2cbf('0x28')](handleError(_0x16934c,null));};exports['addAnswer']=function(_0x3c7170,_0x4b9c83){if(_0x3c7170[_0x2cbf('0x6f')]['id']){delete _0x3c7170[_0x2cbf('0x6f')]['id'];}return db[_0x2cbf('0x64')][_0x2cbf('0x6e')]({'where':{'id':_0x3c7170[_0x2cbf('0x7a')]['id']}})[_0x2cbf('0x65')](handleEntityNotFound(_0x4b9c83,null))['then'](function(_0x54ede4){if(_0x54ede4){_0x3c7170[_0x2cbf('0x6f')]['ChatWebsiteId']=_0x54ede4['id'];return db[_0x2cbf('0x82')][_0x2cbf('0x72')](_0x3c7170[_0x2cbf('0x6f')]);}})[_0x2cbf('0x65')](respondWithResult(_0x4b9c83,null))['catch'](handleError(_0x4b9c83,null));};exports[_0x2cbf('0x83')]=function(_0x238400,_0x325b77){var _0x5d900c={'raw':![],'where':{}};var _0x2ca8bc={};var _0x216b3b={'count':0x0,'rows':[]};return db[_0x2cbf('0x64')]['findOne']({'where':{'id':_0x238400[_0x2cbf('0x7a')]['id']}})[_0x2cbf('0x65')](handleEntityNotFound(_0x325b77,null))['then'](function(_0x5ba0b1){if(_0x5ba0b1){_0x2ca8bc[_0x2cbf('0x4c')]=_[_0x2cbf('0x57')](db['CannedAnswer'][_0x2cbf('0x53')]);_0x2ca8bc['query']=_[_0x2cbf('0x57')](_0x238400[_0x2cbf('0x56')]);_0x2ca8bc['filters']=_[_0x2cbf('0x6c')](_0x2ca8bc[_0x2cbf('0x4c')],_0x2ca8bc[_0x2cbf('0x56')]);_0x5d900c[_0x2cbf('0x59')]=_[_0x2cbf('0x6c')](_0x2ca8bc['model'],qs['fields'](_0x238400[_0x2cbf('0x56')][_0x2cbf('0x5a')]));_0x5d900c[_0x2cbf('0x59')]=_0x5d900c[_0x2cbf('0x59')][_0x2cbf('0x84')]?_0x5d900c[_0x2cbf('0x59')]:_0x2ca8bc['model'];if(!_0x238400[_0x2cbf('0x56')][_0x2cbf('0x5b')](_0x2cbf('0x5c'))){_0x5d900c[_0x2cbf('0x2d')]=qs[_0x2cbf('0x2d')](_0x238400[_0x2cbf('0x56')]['limit']);_0x5d900c[_0x2cbf('0x2b')]=qs['offset'](_0x238400[_0x2cbf('0x56')][_0x2cbf('0x2b')]);}_0x5d900c[_0x2cbf('0x5d')]=qs[_0x2cbf('0x5e')](_0x238400[_0x2cbf('0x56')]['sort']);_0x5d900c[_0x2cbf('0x61')]=qs[_0x2cbf('0x58')](_[_0x2cbf('0x5f')](_0x238400['query'],_0x2ca8bc['filters']));_0x5d900c[_0x2cbf('0x61')][_0x2cbf('0x7c')]=_0x5ba0b1['id'];if(_0x238400[_0x2cbf('0x56')]['filter']){_0x5d900c[_0x2cbf('0x61')]=_[_0x2cbf('0x60')](_0x5d900c[_0x2cbf('0x61')],{'$or':_[_0x2cbf('0x52')](_0x5d900c['attributes'],function(_0xb0022c){var _0x40d0d2={};_0x40d0d2[_0xb0022c]={'$like':'%'+_0x238400[_0x2cbf('0x56')][_0x2cbf('0x63')]+'%'};return _0x40d0d2;})});}_0x5d900c=_[_0x2cbf('0x60')]({},_0x5d900c,_0x238400[_0x2cbf('0x6d')]);return db[_0x2cbf('0x82')][_0x2cbf('0x2e')]({'where':_0x5d900c[_0x2cbf('0x61')]})['then'](function(_0x5e09b9){_0x216b3b[_0x2cbf('0x2e')]=_0x5e09b9;if(_0x238400['query'][_0x2cbf('0x66')]){_0x5d900c[_0x2cbf('0x67')]=[{'all':!![]}];}return db[_0x2cbf('0x82')][_0x2cbf('0x68')](_0x5d900c);})[_0x2cbf('0x65')](function(_0x58ee7d){_0x216b3b[_0x2cbf('0x69')]=_0x58ee7d;return _0x216b3b;});}})['then'](respondWithFilteredResult(_0x325b77,_0x5d900c))[_0x2cbf('0x28')](handleError(_0x325b77,null));};exports[_0x2cbf('0x85')]=function(_0xd513b2,_0x118bce){return db[_0x2cbf('0x64')][_0x2cbf('0x6e')]({'where':{'id':_0xd513b2['params']['id']}})[_0x2cbf('0x65')](handleEntityNotFound(_0x118bce,null))[_0x2cbf('0x65')](function(_0x1adbf5){if(_0x1adbf5){return _0x1adbf5[_0x2cbf('0x85')](_0xd513b2['query'][_0x2cbf('0x81')]);}})['then'](respondWithStatusCode(_0x118bce,null))[_0x2cbf('0x28')](handleError(_0x118bce,null));};exports['addLogo']=function(_0x3487b1,_0x360b0a){_0x3487b1['body'][_0x2cbf('0x86')]=_0x3487b1[_0x2cbf('0x87')][_0x2cbf('0x88')];return db[_0x2cbf('0x64')][_0x2cbf('0x6e')]({'where':{'id':_0x3487b1[_0x2cbf('0x7a')]['id']}})[_0x2cbf('0x65')](handleEntityNotFound(_0x360b0a,null))[_0x2cbf('0x65')](saveUpdates(_0x3487b1['body'],null))[_0x2cbf('0x65')](respondWithResult(_0x360b0a,null))[_0x2cbf('0x28')](handleError(_0x360b0a,null));};exports[_0x2cbf('0x89')]=function(_0x5c854e,_0x4612a4){_0x5c854e[_0x2cbf('0x6f')]['agentAvatar']=_0x5c854e[_0x2cbf('0x87')][_0x2cbf('0x88')];return db[_0x2cbf('0x64')][_0x2cbf('0x6e')]({'where':{'id':_0x5c854e[_0x2cbf('0x7a')]['id']}})['then'](handleEntityNotFound(_0x4612a4,null))[_0x2cbf('0x65')](saveUpdates(_0x5c854e['body'],null))['then'](respondWithResult(_0x4612a4,null))[_0x2cbf('0x28')](handleError(_0x4612a4,null));};exports['addCustomerAvatar']=function(_0x188214,_0x3a4382){_0x188214[_0x2cbf('0x6f')]['customerAvatar']=_0x188214[_0x2cbf('0x87')][_0x2cbf('0x88')];return db[_0x2cbf('0x64')]['find']({'where':{'id':_0x188214[_0x2cbf('0x7a')]['id']}})[_0x2cbf('0x65')](handleEntityNotFound(_0x3a4382,null))[_0x2cbf('0x65')](saveUpdates(_0x188214[_0x2cbf('0x6f')],null))[_0x2cbf('0x65')](respondWithResult(_0x3a4382,null))[_0x2cbf('0x28')](handleError(_0x3a4382,null));};exports[_0x2cbf('0x8a')]=function(_0x2314d4,_0x3f7f75){_0x2314d4[_0x2cbf('0x6f')][_0x2cbf('0x8b')]=_0x2314d4[_0x2cbf('0x87')]['filename'];return db[_0x2cbf('0x64')][_0x2cbf('0x6e')]({'where':{'id':_0x2314d4['params']['id']}})[_0x2cbf('0x65')](handleEntityNotFound(_0x3f7f75,null))[_0x2cbf('0x65')](saveUpdates(_0x2314d4[_0x2cbf('0x6f')],null))['then'](respondWithResult(_0x3f7f75,null))[_0x2cbf('0x28')](handleError(_0x3f7f75,null));};exports[_0x2cbf('0x8c')]=function(_0x511610,_0x3f741d){var _0x196691=path[_0x2cbf('0x8d')](config[_0x2cbf('0x8e')],'server/files/images/logos/default_logo.svg');var _0x7f66cf={'where':{'id':_0x511610['params']['id']},'attributes':['id',_0x2cbf('0x86')],'raw':!![]};var _0x5701bc=![];return require('../../config/license/util')[_0x2cbf('0x8f')]()['then'](function(_0x55a8d3){if(_0x55a8d3){_0x5701bc=_0x55a8d3['custom'];}})['then'](function(){return db['ChatWebsite'][_0x2cbf('0x6e')](_0x7f66cf);})[_0x2cbf('0x65')](handleEntityNotFound(_0x3f741d,null))['then'](function(_0x26dc4c){if(_0x26dc4c){if(!_[_0x2cbf('0x90')](_0x26dc4c[_0x2cbf('0x86')])){if(fs['existsSync'](path[_0x2cbf('0x8d')](config[_0x2cbf('0x8e')],_0x2cbf('0x91'),_0x26dc4c[_0x2cbf('0x86')]))&&_0x5701bc){_0x196691=path[_0x2cbf('0x8d')](config[_0x2cbf('0x8e')],'server/files/images/logos/',_0x26dc4c[_0x2cbf('0x86')]);}}return _0x3f741d[_0x2cbf('0x92')](_0x196691);}})['catch'](handleError(_0x3f741d,null));};exports[_0x2cbf('0x93')]=function(_0x535d60,_0x40a7cb){var _0x1780a3=path['join'](config[_0x2cbf('0x8e')],_0x2cbf('0x94'));var _0x163513={'where':{'id':_0x535d60[_0x2cbf('0x7a')]['id']},'attributes':['id',_0x2cbf('0x95')],'raw':!![]};return db[_0x2cbf('0x64')][_0x2cbf('0x6e')](_0x163513)[_0x2cbf('0x65')](handleEntityNotFound(_0x40a7cb,null))[_0x2cbf('0x65')](function(_0x5964da){if(_0x5964da){if(!_[_0x2cbf('0x90')](_0x5964da['agentAvatar'])){if(fs[_0x2cbf('0x96')](path[_0x2cbf('0x8d')](config[_0x2cbf('0x8e')],_0x2cbf('0x97'),_0x5964da[_0x2cbf('0x95')]))){_0x1780a3=path['join'](config[_0x2cbf('0x8e')],'server/files/images/avatars/',_0x5964da[_0x2cbf('0x95')]);}}return _0x40a7cb[_0x2cbf('0x92')](_0x1780a3);}})[_0x2cbf('0x28')](handleError(_0x40a7cb,null));};exports[_0x2cbf('0x98')]=function(_0x3bd5bd,_0x5598ab){var _0x1f96c6=path['join'](config['root'],_0x2cbf('0x99'));var _0xd579d7={'where':{'id':_0x3bd5bd[_0x2cbf('0x7a')]['id']},'attributes':['id',_0x2cbf('0x9a'),'showCustomerAvatar'],'raw':!![]};return db[_0x2cbf('0x64')][_0x2cbf('0x6e')](_0xd579d7)[_0x2cbf('0x65')](handleEntityNotFound(_0x5598ab,null))[_0x2cbf('0x65')](function(_0x5e97c1){if(_0x5e97c1){if(!_[_0x2cbf('0x90')](_0x5e97c1[_0x2cbf('0x9a')])){if(fs['existsSync'](path['join'](config[_0x2cbf('0x8e')],_0x2cbf('0x97'),_0x5e97c1['customerAvatar']))&&_0x5e97c1[_0x2cbf('0x9b')]){_0x1f96c6=path[_0x2cbf('0x8d')](config[_0x2cbf('0x8e')],_0x2cbf('0x97'),_0x5e97c1['customerAvatar']);}}return _0x5598ab['download'](_0x1f96c6);}})[_0x2cbf('0x28')](handleError(_0x5598ab,null));};exports[_0x2cbf('0x9c')]=function(_0x12dbb8,_0x2105dd){var _0x42144f=path[_0x2cbf('0x8d')](config['root'],_0x2cbf('0x9d'));var _0x4c4551={'where':{'id':_0x12dbb8[_0x2cbf('0x7a')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x2cbf('0x64')]['find'](_0x4c4551)['then'](handleEntityNotFound(_0x2105dd,null))[_0x2cbf('0x65')](function(_0x6d17fd){if(_0x6d17fd){if(!_[_0x2cbf('0x90')](_0x6d17fd[_0x2cbf('0x8b')])){if(fs[_0x2cbf('0x96')](path[_0x2cbf('0x8d')](config['root'],_0x2cbf('0x97'),_0x6d17fd['systemAvatar']))){_0x42144f=path['join'](config['root'],_0x2cbf('0x97'),_0x6d17fd['systemAvatar']);}}return _0x2105dd['download'](_0x42144f);}})[_0x2cbf('0x28')](handleError(_0x2105dd,null));};function checkWebsiteInterval(_0x8f05d5){var _0x286ccd=_0x8f05d5['Interval'];if(!_0x286ccd){return Promise[_0x2cbf('0x9e')](_0x8f05d5);}var _0x2eba55=_0x8f05d5['timezone']||undefined;return _0x286ccd[_0x2cbf('0x9f')](_0x2eba55)['then'](function(_0x3507a8){if(!_0x3507a8){throw new APIOutOfIntervalError();}return _0x8f05d5;});}exports[_0x2cbf('0xa0')]=function(_0x372fee,_0xc49341){var _0x5f546d={'body':_0x372fee[_0x2cbf('0x6f')],'channel':_0x2cbf('0xa1')};var _0xc301c5=[];var _0x114365=[];var _0x5e004a={};var _0x30b908=![];if(_0x372fee[_0x2cbf('0x6f')]['id']){delete _0x372fee[_0x2cbf('0x6f')]['id'];}if(_[_0x2cbf('0x90')](_0x372fee['body'][_0x2cbf('0xa2')])){throw new APIBadRequestError(_0x2cbf('0xa3'));}if(_[_0x2cbf('0x90')](_0x372fee['body'][_0x2cbf('0xa4')])){throw new APIBadRequestError('MapKey\x20is\x20mandatory');}if(_[_0x2cbf('0xa5')](_0x372fee[_0x2cbf('0x6f')][_0x2cbf('0x6f')])){throw new APIBadRequestError(_0x2cbf('0xa6'));}var _0x9d2a54=_0x372fee[_0x2cbf('0x6f')][_0x2cbf('0x3e')]&&_0x372fee[_0x2cbf('0x6f')]['referer'];return db['CmContact'][_0x2cbf('0x7b')]()['then'](function(_0x597bc7){if(!_0x597bc7){throw new Error(_0x2cbf('0xa7'));}_0xc301c5=Object[_0x2cbf('0x57')](_0x597bc7)['filter'](function(_0x27e90b){return!['createdAt',_0x2cbf('0xa8')][_0x2cbf('0xa9')](_0x27e90b);});_0x114365=Object[_0x2cbf('0x57')](_0x597bc7)['filter'](function(_0xec7dd0){return![_0x2cbf('0xaa'),_0x2cbf('0xa8'),_0x2cbf('0xab'),_0x2cbf('0xac')]['includes'](_0xec7dd0);});if(!_['includes'](_0x114365,_0x372fee[_0x2cbf('0x6f')]['mapKey'])){throw new APIBadRequestError(_0x2cbf('0xad')+_0x114365[_0x2cbf('0x8d')](',\x20'));}_0x5e004a[_0x372fee[_0x2cbf('0x6f')][_0x2cbf('0xa4')]]=_0x372fee[_0x2cbf('0x6f')][_0x2cbf('0xa2')];})[_0x2cbf('0x65')](function(){return db[_0x2cbf('0x64')]['find']({'where':{'id':_0x372fee[_0x2cbf('0x7a')]['id']},'include':[{'model':db[_0x2cbf('0xae')],'as':_0x2cbf('0xaf'),'include':[{'model':db[_0x2cbf('0xb0')],'as':_0x2cbf('0xb1'),'where':_0x5e004a,'limit':0x1,'order':[['updatedAt',_0x2cbf('0xb2')]]}]},{'model':db[_0x2cbf('0xb3')],'as':_0x2cbf('0xb4')},{'model':db['Interval'],'as':'Interval','include':[{'model':db[_0x2cbf('0xb5')],'as':_0x2cbf('0xb6'),'attributes':['id',_0x2cbf('0xb7')],'raw':!![]}]}]});})[_0x2cbf('0x65')](function(_0x2bdbc1){if(!_0x2bdbc1){throw new APINotFoundError(util[_0x2cbf('0x49')](_0x2cbf('0xb8'),_0x372fee[_0x2cbf('0x7a')]['id']));}if(_0x9d2a54){return checkWebsiteInterval(_0x2bdbc1);}return _0x2bdbc1;})['then'](function(_0x5c1b96){_0x5f546d[_0x2cbf('0xb9')]=_0x5c1b96;_0x5f546d['applications']=_[_0x2cbf('0xba')](_0x5c1b96[_0x2cbf('0xb4')],[_0x2cbf('0xbb')],['asc']);if(_0x5f546d[_0x2cbf('0xb9')][_0x2cbf('0xb4')]){delete _0x5f546d['account'][_0x2cbf('0xb4')];}_0x5f546d['list']=_0x5c1b96['List']||{'id':_0x5c1b96['ListId']};if(_0x5f546d[_0x2cbf('0xbc')]&&_0x5f546d[_0x2cbf('0xbc')]['Contacts'][_0x2cbf('0x84')]){return _0x5f546d['list'][_0x2cbf('0xb1')][0x0];}var _0x498a37=_[_0x2cbf('0xbd')](_0x372fee[_0x2cbf('0x6f')],{'firstName':_0x372fee[_0x2cbf('0x6f')]['from'],'ListId':_0x5c1b96[_0x2cbf('0xac')]});_0x498a37[_0x372fee[_0x2cbf('0x6f')][_0x2cbf('0xa4')]]=_0x372fee[_0x2cbf('0x6f')][_0x2cbf('0xa2')];return db[_0x2cbf('0xb0')][_0x2cbf('0x72')](_0x498a37,{'fields':_0xc301c5,'raw':!![]});})[_0x2cbf('0x65')](function(_0x46c2b2){_0x5f546d[_0x2cbf('0xbe')]=_0x46c2b2;var _0xb2dca6=createInteractionObject(_0x372fee[_0x2cbf('0x7a')]['id'],_0x372fee[_0x2cbf('0x6f')],_0x372fee[_0x2cbf('0xbf')],_0x46c2b2);var _0x556bad={'ChatWebsiteId':_0x372fee[_0x2cbf('0x7a')]['id']};if(_0x372fee[_0x2cbf('0x6f')]['threadId']){_0x556bad['threadId']=_0x372fee['body'][_0x2cbf('0xc0')];_0x556bad['closed']=![];return db[_0x2cbf('0xc1')]['find']({'where':_0x556bad})[_0x2cbf('0x65')](function(_0x20dc73){var _0x57c62c=_0x372fee[_0x2cbf('0x6f')]['customerIp']&&_0x372fee[_0x2cbf('0x6f')][_0x2cbf('0x46')];if(_0x20dc73){_0x30b908=!![];return _0x20dc73;}else if(!_0x57c62c&&_0x20dc73&&_0x20dc73[_0x2cbf('0xc2')]){throw new APIConflictError(_0x2cbf('0xc3'));}_0xb2dca6[_0x2cbf('0xc0')]=_0x372fee[_0x2cbf('0x6f')][_0x2cbf('0xc0')];_0xb2dca6['externalUrl']=_0x372fee[_0x2cbf('0x6f')][_0x2cbf('0xc4')];return db[_0x2cbf('0xc1')]['create'](_0xb2dca6);});}_0x556bad['ContactId']=_0x46c2b2['id'];if(_0x372fee[_0x2cbf('0x6f')][_0x2cbf('0xc5')]&&_0x372fee['body'][_0x2cbf('0xc5')]['id']){_0x556bad['id']=_0x372fee[_0x2cbf('0x6f')][_0x2cbf('0xc5')]['id'];return db[_0x2cbf('0xc1')][_0x2cbf('0x6e')]({'where':_0x556bad})[_0x2cbf('0x65')](function(_0x3b7834){var _0x29e97b=_0x372fee[_0x2cbf('0x6f')][_0x2cbf('0x3e')]&&_0x372fee['body'][_0x2cbf('0x46')];if(!_0x29e97b&&_0x3b7834&&_0x3b7834[_0x2cbf('0xc2')]){throw new APIConflictError(_0x2cbf('0xc3'));}else if(_0x3b7834){_0x30b908=!![];return _0x3b7834;}else{return db[_0x2cbf('0xc1')][_0x2cbf('0x72')](_0xb2dca6);}});}return db[_0x2cbf('0xc1')][_0x2cbf('0x72')](_0xb2dca6);})[_0x2cbf('0x65')](function(_0x17ddd4){if(!_0x30b908){return _0x17ddd4;}var _0x3a29c0={'from':(_0x5f546d[_0x2cbf('0xbe')]['firstName']||'')+'\x20'+(_0x5f546d[_0x2cbf('0xbe')][_0x2cbf('0x44')]||'')};if(_0x372fee['body'][_0x2cbf('0xc0')]&&_0x372fee[_0x2cbf('0x6f')][_0x2cbf('0xc6')]&&_0x372fee[_0x2cbf('0x6f')][_0x2cbf('0xc0')]!=_0x372fee[_0x2cbf('0x6f')]['messageId']){_0x3a29c0['threadId']=_0x372fee['body'][_0x2cbf('0xc6')];}return _0x17ddd4[_0x2cbf('0x32')](_0x3a29c0);})['then'](function(_0x8e9260){_0x5f546d[_0x2cbf('0xc5')]=_0x8e9260[_0x2cbf('0x33')]({'plain':!![]});_0x5f546d['interaction']['created']=!_0x30b908;if(_0x5f546d[_0x2cbf('0xc5')][_0x2cbf('0xc7')]){if(_0x5f546d[_0x2cbf('0xb9')]['autoclose']){_0x5f546d[_0x2cbf('0xc8')][_0x2cbf('0xc9')]({'id':0x0,'priority':_0x5f546d[_0x2cbf('0xc8')][_0x2cbf('0x84')]+0x1,'app':_0x2cbf('0xca'),'appdata':'unmanaged','interval':_0x2cbf('0xcb')});}}return db['ChatMessage'][_0x2cbf('0x72')]({'body':_0x372fee['body'][_0x2cbf('0x6f')],'ChatWebsiteId':_0x372fee['params']['id'],'ChatInteractionId':_0x8e9260['id'],'direction':'in','ContactId':_0x5f546d[_0x2cbf('0xbe')]['id'],'AttachmentId':_0x372fee[_0x2cbf('0x6f')][_0x2cbf('0xcc')]});})[_0x2cbf('0x65')](function(_0x3c63bb){_0x5f546d['message']=_0x3c63bb;if(!_0x5f546d[_0x2cbf('0xc5')][_0x2cbf('0xcd')]){return;}return db[_0x2cbf('0xce')][_0x2cbf('0x6e')]({'attributes':['id',_0x2cbf('0x38')],'where':{'id':_0x5f546d[_0x2cbf('0xc5')]['UserId']}});})[_0x2cbf('0x65')](function(_0x4bbecd){if(_0x4bbecd){_0x5f546d[_0x2cbf('0xc8')]['unshift']({'id':0x0,'priority':0x0,'app':_0x2cbf('0xcf'),'appdata':_0x4bbecd[_0x2cbf('0x38')]+','+(_0x5f546d['account']['waitForTheAssignedAgent']||0xa),'interval':_0x2cbf('0xcb')});_0x5f546d[_0x2cbf('0xd0')]=!![];}if(!_0x5f546d[_0x2cbf('0xc5')][_0x2cbf('0xd1')]){return;}return db[_0x2cbf('0xd2')]['find']({'attributes':['id',_0x2cbf('0x38')],'where':{'id':_0x5f546d[_0x2cbf('0xc5')][_0x2cbf('0xd1')]}});})[_0x2cbf('0x65')](function(_0x26c1c7){if(_0x26c1c7){_0x5f546d['applications'][_0x2cbf('0xd3')]({'id':0x0,'priority':0x1,'app':_0x2cbf('0xd4'),'appdata':_0x26c1c7[_0x2cbf('0x38')]+','+(_0x5f546d[_0x2cbf('0xb9')][_0x2cbf('0xd5')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x2cbf('0xd6'),_0x2cbf('0xd7'),_0x5f546d);})[_0x2cbf('0x65')](function(_0x21ca92){respondWithRpcPromise(_0x2cbf('0xd8'),_0x2cbf('0xd8'),{'event':'notify','message':_0x21ca92},client9002);return _0x21ca92;})[_0x2cbf('0x65')](respondWithResult(_0xc49341,null))['catch'](APIHandleError(_0xc49341));};exports[_0x2cbf('0xd9')]=function(_0x1438ba,_0x35040b){var _0x3817de,_0x13a2b8,_0x43b80f;var _0x1566e1=[];var _0x3750cd={};var _0x5cc241=_0x1438ba['files']||[];var _0x1aa91f=[];var _0x5f2a41;return db['CmContact'][_0x2cbf('0x7b')]()[_0x2cbf('0x65')](function(_0x2c680d){if(!_0x2c680d){throw new db[(_0x2cbf('0xda'))][(_0x2cbf('0xdb'))](_0x2cbf('0xdc'));}_0x1566e1=_[_0x2cbf('0xdd')](_[_0x2cbf('0x57')](_0x2c680d),[_0x2cbf('0xaa'),'updatedAt',_0x2cbf('0xab'),_0x2cbf('0xac')]);if(_0x1438ba['body']['id']){delete _0x1438ba[_0x2cbf('0x6f')]['id'];}if(_['isNil'](_0x1438ba[_0x2cbf('0x6f')][_0x2cbf('0xa2')])){throw _0x35040b[_0x2cbf('0x2f')](0x1f4)[_0x2cbf('0x39')](new db[(_0x2cbf('0xda'))]['ValidationError']('from\x20is\x20mandatory'));}if(_['isNil'](_0x1438ba[_0x2cbf('0x6f')][_0x2cbf('0x6f')])||_0x1438ba['body']['body']===''){throw _0x35040b['status'](0x1f4)[_0x2cbf('0x39')](new db[(_0x2cbf('0xda'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x2cbf('0x90')](_0x1438ba['body'][_0x2cbf('0xde')])){throw _0x35040b[_0x2cbf('0x2f')](0x1f4)[_0x2cbf('0x39')](new db['Sequelize']['ValidationError']('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1566e1));}if(!_[_0x2cbf('0xa9')](_0x1566e1,_0x1438ba[_0x2cbf('0x6f')][_0x2cbf('0xde')])){throw _0x35040b['status'](0x1f4)['send'](new db['Sequelize'][(_0x2cbf('0xdb'))](_0x2cbf('0xdf')+_0x1566e1));}_0x3750cd[_0x1438ba[_0x2cbf('0x6f')][_0x2cbf('0xde')]]=_0x1438ba[_0x2cbf('0x6f')]['from'];})[_0x2cbf('0x65')](function(){return db[_0x2cbf('0x64')][_0x2cbf('0x6e')]({'where':{'id':_0x1438ba[_0x2cbf('0x7a')]['id']},'include':[{'model':db[_0x2cbf('0xae')],'as':_0x2cbf('0xaf')},{'model':db['MailAccount'],'as':_0x2cbf('0xe0')}]});})['then'](handleEntityNotFound(_0x35040b,null))['then'](function(_0x358273){if(_0x358273&&_0x358273[_0x2cbf('0xaf')]){_0x13a2b8=_0x358273;var _0x411456=_[_0x2cbf('0xbd')](_0x1438ba[_0x2cbf('0x6f')],{'firstName':_0x1438ba[_0x2cbf('0x6f')][_0x2cbf('0xa2')],'phone':_0x1438ba[_0x2cbf('0x6f')][_0x2cbf('0xa2')],'ListId':_0x358273[_0x2cbf('0xac')]});_0x411456[_0x1438ba[_0x2cbf('0x6f')][_0x2cbf('0xde')]]=_0x1438ba[_0x2cbf('0x6f')][_0x2cbf('0xa2')];return db['CmContact'][_0x2cbf('0xe1')]({'where':_0x3750cd,'defaults':_0x411456});}})[_0x2cbf('0xe2')](function(_0x4926b9){if(_0x4926b9){_0x43b80f=_0x4926b9;var _0x31d682=fs['readFileSync'](path[_0x2cbf('0x8d')](config[_0x2cbf('0x8e')],'server/files/templates/chatOfflineMessage.ejs'),_0x2cbf('0xe3'));var _0x4e975f=ejs[_0x2cbf('0xe4')](_0x31d682,{'body':_[_0x2cbf('0xe5')](_0x1438ba['body']['body']),'bodyTitle':_0x13a2b8[_0x2cbf('0xe6')]});return db[_0x2cbf('0xe7')]['create']({'body':_0x4e975f,'plainBody':htmlToText[_0x2cbf('0xe8')](_0x4e975f),'ContactId':_0x4926b9['id'],'ChatWebsiteId':_0x13a2b8['id']});}})[_0x2cbf('0x65')](function(_0x32ab22){_0x5f2a41=_0x32ab22;if(_0x5cc241['length']){var _0x383390=_0x5cc241['map'](function(_0x507938){return{'name':_0x507938[_0x2cbf('0xe9')],'basename':_0x507938[_0x2cbf('0x88')],'type':_0x507938[_0x2cbf('0xea')],'ChatOfflineMessageId':_0x32ab22['id']};});_0x1aa91f=_0x383390[_0x2cbf('0x52')](_0x399e0e=>{var _0x175c4e={'filename':_0x399e0e[_0x2cbf('0x38')],'path':path[_0x2cbf('0x8d')](config[_0x2cbf('0x8e')],_0x2cbf('0xeb'),_0x2cbf('0xec'),_0x2cbf('0xed'),_0x2cbf('0xee'),_0x399e0e[_0x2cbf('0xef')])};return _0x175c4e;});if(!_0x13a2b8[_0x2cbf('0xf0')]){return db[_0x2cbf('0xf1')][_0x2cbf('0xf2')](function(_0x52c402){return db['Attachment'][_0x2cbf('0xf3')](_0x383390,{'transaction':_0x52c402});});}}})[_0x2cbf('0x65')](function(){if(_0x5f2a41){_0x3817de=_0x5f2a41;return db[_0x2cbf('0xe0')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x2cbf('0xf4')],'as':_0x2cbf('0xf5'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x2cbf('0xf6'),'raw':!![]}]}]});}})[_0x2cbf('0x65')](function(_0x5a010c){if(_0x5a010c&&_0x5a010c[_0x2cbf('0xf5')]&&_0x13a2b8[_0x2cbf('0xf7')]&&_0x13a2b8[_0x2cbf('0xf8')]){var _0x3e01cb=_0x5a010c['getSmtpOptions']();return respondWithRpcPromise(_0x2cbf('0xf9'),'sendMail',{'account':_0x3e01cb,'message':{'from':util[_0x2cbf('0x49')]('\x22%s\x22\x20<%s>',_0x5a010c[_0x2cbf('0x38')],_0x5a010c['email']||_0x5a010c[_0x2cbf('0xf5')]['user']),'to':_0x13a2b8[_0x2cbf('0xf8')],'subject':_0x13a2b8[_0x2cbf('0xfa')],'html':_0x3817de[_0x2cbf('0x6f')],'attachments':_0x1aa91f}},client9003)[_0x2cbf('0x65')](function(){return _0x3817de;})['catch'](function(_0x505583){logger[_0x2cbf('0x24')](_0x505583);});}})[_0x2cbf('0x65')](function(){if(_0x13a2b8&&_0x13a2b8[_0x2cbf('0xf0')]&&_0x13a2b8[_0x2cbf('0xfb')]){var _0x255ebb=[];if(_0x5cc241[_0x2cbf('0x84')]){_0x255ebb=_0x5cc241[_0x2cbf('0x52')](function(_0x4e142b){return{'name':_0x4e142b[_0x2cbf('0xe9')],'basename':_0x4e142b['filename'],'type':_0x4e142b['mimetype'],'ChatOfflineMessageId':_0x5f2a41['id']};});}var _0x263a69;if(!_['isNil'](_0x13a2b8['subjectOffline'])){var _0x3cfff3=_[_0x2cbf('0x52')](_0x1438ba[_0x2cbf('0x6f')],function(_0x320f60){return _0x320f60;});var _0x311555=_[_0x2cbf('0xfc')](_0x3cfff3)[0x0];var _0x428d80=_[_0x2cbf('0xfd')](_0x311555,function(_0x3f4ae4){return _0x3f4ae4;});_0x263a69=_0x428d80[0x1][_0x13a2b8[_0x2cbf('0xfe')]];}var _0x143680={'from':_0x43b80f['email'],'firstName':_0x43b80f[_0x2cbf('0x43')],'lastName':_0x43b80f[_0x2cbf('0x44')],'mapKey':'email','message':{'from':_0x43b80f[_0x2cbf('0xff')],'to':_0x13a2b8['MailAccount'][_0x2cbf('0xff')],'cc':'','subject':_[_0x2cbf('0x90')](_0x263a69)?_0x13a2b8[_0x2cbf('0xfa')]:_0x263a69,'messageId':'','sentAt':new Date(),'attach':_0x255ebb[_0x2cbf('0x84')],'attachments':_0x255ebb,'originChannel':'Chat','ChatWebsiteId':_0x13a2b8['id'],'ChatOfflineMessageId':_0x3817de['id'],'originTo':_0x13a2b8[_0x2cbf('0xe0')]['email']},'body':_0x3817de['body']};var _0x2f8f7e={'account':{'id':_0x13a2b8['MailAccountId']},'body':_0x143680,'log':_0x2cbf('0x100')};return respondWithRpcPromise(_0x2cbf('0x100'),_0x2cbf('0x101'),_0x2f8f7e,client9001)[_0x2cbf('0x65')](function(){return _0x3817de;})['catch'](function(_0x1a0ba2){logger[_0x2cbf('0x24')](_0x1a0ba2);});}return;})['then'](function(){if(_0x3817de){return _0x3817de;}})['then'](respondWithResult(_0x35040b,null))[_0x2cbf('0x28')](function(){for(var _0x30ca11 of _0x5cc241){var _0x394b77=path[_0x2cbf('0x8d')](config['root'],'server','files',_0x2cbf('0xed'),_0x2cbf('0xee'),_0x30ca11[_0x2cbf('0x88')]);fs_extra[_0x2cbf('0x102')](_0x394b77)[_0x2cbf('0x28')](function(_0x54db91){logger[_0x2cbf('0x24')](_0x2cbf('0x103'),_0x394b77,_0x54db91);});}});};exports[_0x2cbf('0x104')]=function(_0x5f4db4,_0x21f7b7){return db[_0x2cbf('0xc1')][_0x2cbf('0x6e')]({'where':{'id':_0x5f4db4[_0x2cbf('0x7a')]['id']}})[_0x2cbf('0x65')](handleEntityNotFound(_0x21f7b7,null))[_0x2cbf('0x65')](function(_0x18e501){if(_0x18e501){return _0x18e501[_0x2cbf('0x104')](_0x5f4db4[_0x2cbf('0x6f')]['ids'],_['omit'](_0x5f4db4[_0x2cbf('0x6f')],[_0x2cbf('0x81'),'id'])||{});}})[_0x2cbf('0x65')](respondWithResult(_0x21f7b7,null))[_0x2cbf('0x28')](handleError(_0x21f7b7,null));};exports[_0x2cbf('0x105')]=function(_0x2fe755,_0x18b9d3){var _0x23bd43={'raw':![],'where':{}};var _0x111442={};var _0x213c69={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x2cbf('0x7e')]({'where':{'id':_0x2fe755[_0x2cbf('0x7a')]['id']}})[_0x2cbf('0x65')](handleEntityNotFound(_0x18b9d3,null))[_0x2cbf('0x65')](function(_0x1be2c1){if(_0x1be2c1){_0x111442[_0x2cbf('0x4c')]=_[_0x2cbf('0x57')](db['ChatInteraction'][_0x2cbf('0x53')]);_0x111442[_0x2cbf('0x56')]=_[_0x2cbf('0x57')](_0x2fe755[_0x2cbf('0x56')]);_0x111442[_0x2cbf('0x58')]=_[_0x2cbf('0x6c')](_0x111442[_0x2cbf('0x4c')],_0x111442['query']);_0x23bd43[_0x2cbf('0x59')]=_[_0x2cbf('0x6c')](_0x111442['model'],qs['fields'](_0x2fe755[_0x2cbf('0x56')][_0x2cbf('0x5a')]));_0x23bd43[_0x2cbf('0x59')]=_0x23bd43[_0x2cbf('0x59')][_0x2cbf('0x84')]?_0x23bd43[_0x2cbf('0x59')]:_0x111442[_0x2cbf('0x4c')];if(!_0x2fe755[_0x2cbf('0x56')][_0x2cbf('0x5b')](_0x2cbf('0x5c'))){_0x23bd43[_0x2cbf('0x2d')]=qs[_0x2cbf('0x2d')](_0x2fe755[_0x2cbf('0x56')][_0x2cbf('0x2d')]);_0x23bd43[_0x2cbf('0x2b')]=qs[_0x2cbf('0x2b')](_0x2fe755[_0x2cbf('0x56')][_0x2cbf('0x2b')]);}_0x23bd43['order']=qs[_0x2cbf('0x5e')](_0x2fe755['query'][_0x2cbf('0x5e')]);_0x23bd43[_0x2cbf('0x61')]=qs[_0x2cbf('0x58')](_[_0x2cbf('0x5f')](_0x2fe755[_0x2cbf('0x56')],_0x111442[_0x2cbf('0x58')]));_0x23bd43[_0x2cbf('0x61')][_0x2cbf('0x7c')]=_0x1be2c1['id'];if(_0x2fe755[_0x2cbf('0x56')][_0x2cbf('0x63')]){_0x23bd43[_0x2cbf('0x61')]=_[_0x2cbf('0x60')](_0x23bd43[_0x2cbf('0x61')],{'$or':_['map'](_0x23bd43[_0x2cbf('0x59')],function(_0x34c11d){var _0x2eab0e={};_0x2eab0e[_0x34c11d]={'$like':'%'+_0x2fe755[_0x2cbf('0x56')][_0x2cbf('0x63')]+'%'};return _0x2eab0e;})});}_0x23bd43=_[_0x2cbf('0x60')]({},_0x23bd43,_0x2fe755['options']);return db[_0x2cbf('0xc1')][_0x2cbf('0x2e')]({'where':_0x23bd43[_0x2cbf('0x61')]})['then'](function(_0x1f3d1b){_0x213c69[_0x2cbf('0x2e')]=_0x1f3d1b;if(_0x2fe755['query'][_0x2cbf('0x66')]){_0x23bd43[_0x2cbf('0x67')]=[{'model':db[_0x2cbf('0xb0')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x2cbf('0x106'),'attributes':[_0x2cbf('0x38'),_0x2cbf('0x107'),_0x2cbf('0x108')],'required':![]},{'model':db[_0x2cbf('0x109')],'as':'Tags','attributes':['id',_0x2cbf('0x38'),'color'],'where':_0x2fe755['query'][_0x2cbf('0x10a')]?{'id':_0x2fe755[_0x2cbf('0x56')][_0x2cbf('0x10a')]}:undefined,'required':_0x2fe755[_0x2cbf('0x56')]['tag']?!![]:![]}];}return db['ChatInteraction'][_0x2cbf('0x68')](_0x23bd43);})[_0x2cbf('0x65')](function(_0x3a6210){_0x213c69['rows']=_0x3a6210;return _0x213c69;});}})[_0x2cbf('0x65')](respondWithFilteredResult(_0x18b9d3,_0x23bd43))[_0x2cbf('0x28')](handleError(_0x18b9d3,null));};exports['getSnippet']=function(_0x4e5601,_0xd5e0f9){var _0x37c617=0x0;var _0x24aa35=0x0;var _0x35d4fb=![];var _0x32a484;var _0x2c8311;return db[_0x2cbf('0x64')][_0x2cbf('0x6e')]({'where':{'id':_0x4e5601['params']['id']},'include':[{'model':db[_0x2cbf('0xb5')],'as':'Interval','include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0x2cbf('0xb7')]}]}]})[_0x2cbf('0x65')](handleEntityNotFound(_0xd5e0f9,null))[_0x2cbf('0x65')](function(_0x3bc24a){if(_0x3bc24a){_0x32a484=_0x3bc24a;return _0x3bc24a[_0x2cbf('0x10b')]({'raw':!![]});}})[_0x2cbf('0x65')](function(_0x1cf4b3){if(_0x32a484){if(_0x1cf4b3){_0x2c8311=_0x1cf4b3;}}return require(_0x2cbf('0x10c'))[_0x2cbf('0x8f')]();})[_0x2cbf('0x65')](function(_0xd3407f){if(_0xd3407f){_0x24aa35=_0xd3407f['virtual'];_0x35d4fb=_0xd3407f[_0x2cbf('0x10d')];}})[_0x2cbf('0x65')](function(){return db[_0x2cbf('0xc1')][_0x2cbf('0x2e')]({'where':{'closed':![]}});})['then'](function(_0x484ac1){_0x37c617=_0x484ac1;if(_0x24aa35&&_0x484ac1>_0x24aa35){return db[_0x2cbf('0x10e')][_0x2cbf('0x7e')]({'where':{'id':0x1}})['then'](function(_0x2a1f3b){if(_0x2a1f3b){_0x2a1f3b[_0x2cbf('0x10f')](_0x2cbf('0x110'));}});}})[_0x2cbf('0x65')](function(){var _0x595780=_0x32a484['Interval'];var _0x2694be=_0x32a484[_0x2cbf('0x111')]||undefined;return _0x595780?_0x595780[_0x2cbf('0x9f')](_0x2694be):!![];})[_0x2cbf('0x65')](function(_0x780c3d){var _0x42548c=fs[_0x2cbf('0x112')](path['join'](config[_0x2cbf('0x8e')],_0x2cbf('0x113')),_0x2cbf('0xe3'));var _0x17ea69=_0x2cbf('0x114');var _0x5b08fe=![];try{const _0x48344d=new URL(_0x32a484[_0x2cbf('0x70')]);_0x32a484[_0x2cbf('0x70')]=_0x48344d['origin'];}catch(_0x3f9c32){}var _0x558924;if(_0x4e5601[_0x2cbf('0xbf')][_0x2cbf('0x46')]){_0x4e5601['headers'][_0x2cbf('0x46')]=_0x4e5601[_0x2cbf('0xbf')][_0x2cbf('0x46')][_0x2cbf('0x115')](/\/$/,'');_0x558924=wildcardUtils['testWebsiteWithWildcard'](_0x32a484[_0x2cbf('0x70')],_0x4e5601[_0x2cbf('0xbf')][_0x2cbf('0x46')]);}else{_0x4e5601['headers'][_0x2cbf('0x46')]=_0x32a484[_0x2cbf('0x70')];_0x558924=!![];}var _0x2acc00={'chatVersion':_0x17ea69,'chatWebsiteAddressOrigin':_0x558924?_0x4e5601[_0x2cbf('0xbf')][_0x2cbf('0x46')]:_0x32a484[_0x2cbf('0x70')],'remote':_0x32a484[_0x2cbf('0x116')],'query':querystring[_0x2cbf('0x23')](_[_0x2cbf('0x60')](_0x32a484[_0x2cbf('0x33')]({'plain':!![]}),{'customerIp':_0x4e5601[_0x2cbf('0xbf')][_0x2cbf('0x41')]||_0x4e5601['headers']['x-real-ip']||_0x4e5601[_0x2cbf('0x117')]['remoteAddress']||_0x4e5601['ip'],'referer':_0x4e5601[_0x2cbf('0xbf')][_0x2cbf('0x46')],'openedInteractions':_0x37c617,'maxInteractions':_0x24aa35,'virtual':_0x35d4fb['virtual'],'online':_0x780c3d,'custom':_0x35d4fb,'address':_0x558924?_0x4e5601[_0x2cbf('0xbf')][_0x2cbf('0x46')]:null}))[_0x2cbf('0x115')](/'/g,'\x5c\x27')};_0xd5e0f9[_0x2cbf('0x39')](ejs['render'](Mustache[_0x2cbf('0xe4')](_0x42548c,_0x2acc00),{'proactiveActions':_0x2c8311,'alignment':_0x32a484[_0x2cbf('0x118')],'verticalAlignment':_0x32a484['verticalAlignment'],'div_color':_0x32a484[_0x2cbf('0x119')],'labelText':_0x32a484[_0x2cbf('0x11a')],'text_color':_0x32a484['textColor'],'text_button_color':_0x32a484['textButtonColor'],'button_color':_0x32a484[_0x2cbf('0x11b')],'background_color':_0x32a484[_0x2cbf('0x11c')],'hideWhenOffline':_0x32a484[_0x2cbf('0x11d')],'intervalId':_0x32a484[_0x2cbf('0x11e')],'isDevelopment':_0x5b08fe,'chatVersion':_0x17ea69}));})['catch'](handleError(_0xd5e0f9,null));};exports[_0x2cbf('0x11f')]=function(_0x15b0db,_0x280559){var _0x1bc56b=_0x15b0db[_0x2cbf('0x7a')]['id'];var _0x1d6581=_0x15b0db[_0x2cbf('0x6f')];var _0xcceb15=0xc8;var _0x21b4c5=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x2cbf('0xf1')][_0x2cbf('0x120')][_0x2cbf('0x121')][_0x2cbf('0x122')]},function(_0x30a17c){return db[_0x2cbf('0x64')]['findOne']({'where':{'id':_0x1bc56b},'transaction':_0x30a17c})[_0x2cbf('0x65')](function(_0x227359){if(_0x227359){return db[_0x2cbf('0xb3')][_0x2cbf('0x36')]({'where':{'ChatWebsiteId':_0x1bc56b},'transaction':_0x30a17c})[_0x2cbf('0x65')](function(){var _0x461012=_[_0x2cbf('0x52')](_0x1d6581,function(_0x2b4f2e){_0x2b4f2e[_0x2cbf('0x7c')]=_0x1bc56b;return _0x2b4f2e;});return db[_0x2cbf('0xb3')]['bulkCreate'](_0x461012,{'transaction':_0x30a17c});});}else{_0xcceb15=0x194;_0x21b4c5=[];}});})[_0x2cbf('0x65')](function(){if(_0xcceb15!==0x194){return db[_0x2cbf('0xb3')][_0x2cbf('0x123')]({'where':{'ChatWebsiteId':_0x1bc56b},'order':_0x2cbf('0xbb')})[_0x2cbf('0x65')](function(_0xa98bb9){_0x21b4c5=_0xa98bb9;});}})[_0x2cbf('0x28')](function(_0x516dec){_0xcceb15=0x1f4;logger[_0x2cbf('0x24')](_0x516dec['stack']);if(_0x516dec[_0x2cbf('0x38')]){delete _0x516dec[_0x2cbf('0x38')];}_0x21b4c5=_0x516dec;})['finally'](function(){if(_0x21b4c5===null){_0x280559[_0x2cbf('0x29')](_0xcceb15);}else{if(_0xcceb15===0x1f4){_0x280559[_0x2cbf('0x2f')](_0xcceb15)[_0x2cbf('0x39')](_0x21b4c5);}else{_0x280559['status'](_0xcceb15)[_0x2cbf('0x2a')](_0x21b4c5);}}});};exports[_0x2cbf('0x124')]=function(_0x13bb5b,_0x545023){var _0x3072a1={};var _0x26d3bb={};var _0x12510d;var _0x465e34;return db['ChatWebsite'][_0x2cbf('0x7e')]({'where':{'id':_0x13bb5b[_0x2cbf('0x7a')]['id']}})[_0x2cbf('0x65')](handleEntityNotFound(_0x545023,null))[_0x2cbf('0x65')](function(_0x4a70b9){if(_0x4a70b9){_0x12510d=_0x4a70b9;_0x26d3bb['model']=_[_0x2cbf('0x57')](db[_0x2cbf('0xb3')]['rawAttributes']);_0x26d3bb[_0x2cbf('0x56')]=_[_0x2cbf('0x57')](_0x13bb5b[_0x2cbf('0x56')]);_0x26d3bb['filters']=_[_0x2cbf('0x6c')](_0x26d3bb[_0x2cbf('0x4c')],_0x26d3bb[_0x2cbf('0x56')]);_0x3072a1[_0x2cbf('0x59')]=_[_0x2cbf('0x6c')](_0x26d3bb['model'],qs['fields'](_0x13bb5b[_0x2cbf('0x56')][_0x2cbf('0x5a')]));_0x3072a1[_0x2cbf('0x59')]=_0x3072a1['attributes'][_0x2cbf('0x84')]?_0x3072a1[_0x2cbf('0x59')]:_0x26d3bb[_0x2cbf('0x4c')];_0x3072a1['order']=qs[_0x2cbf('0x5e')](_0x13bb5b[_0x2cbf('0x56')]['sort']);_0x3072a1[_0x2cbf('0x61')]=qs[_0x2cbf('0x58')](_[_0x2cbf('0x5f')](_0x13bb5b[_0x2cbf('0x56')],_0x26d3bb[_0x2cbf('0x58')]));if(_0x13bb5b[_0x2cbf('0x56')][_0x2cbf('0x63')]){_0x3072a1[_0x2cbf('0x61')]=_[_0x2cbf('0x60')](_0x3072a1[_0x2cbf('0x61')],{'$or':_['map'](_0x3072a1[_0x2cbf('0x59')],function(_0x430a4d){var _0x14165e={};_0x14165e[_0x430a4d]={'$like':'%'+_0x13bb5b[_0x2cbf('0x56')][_0x2cbf('0x63')]+'%'};return _0x14165e;})});}_0x3072a1=_[_0x2cbf('0x60')]({},_0x3072a1,_0x13bb5b[_0x2cbf('0x6d')]);return _0x12510d[_0x2cbf('0x124')](_0x3072a1);}})['then'](function(_0x2b5b1){if(_0x2b5b1){_0x465e34=_0x2b5b1[_0x2cbf('0x84')];if(!_0x13bb5b[_0x2cbf('0x56')][_0x2cbf('0x5b')]('nolimit')){_0x3072a1['limit']=qs[_0x2cbf('0x2d')](_0x13bb5b['query']['limit']);_0x3072a1[_0x2cbf('0x2b')]=qs[_0x2cbf('0x2b')](_0x13bb5b['query'][_0x2cbf('0x2b')]);}return _0x12510d[_0x2cbf('0x124')](_0x3072a1);}})[_0x2cbf('0x65')](function(_0x420ebc){if(_0x420ebc){return _0x420ebc?{'count':_0x465e34,'rows':_0x420ebc}:null;}})['then'](respondWithResult(_0x545023,null))['catch'](handleError(_0x545023,null));};exports['addProactiveActions']=function(_0x5da678,_0x32a310){return db['chatProactiveAction'][_0x2cbf('0x6e')]({'where':{'id':_0x5da678[_0x2cbf('0x7a')]['id']}})[_0x2cbf('0x65')](handleEntityNotFound(_0x32a310,null))[_0x2cbf('0x65')](function(_0x4dc89b){if(_0x4dc89b){return _0x4dc89b['addProactiveActions'](_0x5da678[_0x2cbf('0x6f')]['ids'],_[_0x2cbf('0x125')](_0x5da678[_0x2cbf('0x6f')],[_0x2cbf('0x81'),'id'])||{});}})[_0x2cbf('0x65')](respondWithResult(_0x32a310,null))[_0x2cbf('0x28')](handleError(_0x32a310,null));};exports[_0x2cbf('0x10b')]=function(_0x39f3fb,_0x56ea79){var _0x454847={};var _0x113fce={};var _0x5c5bf1;var _0x2b2d2a;return db[_0x2cbf('0x64')]['findOne']({'where':{'id':_0x39f3fb[_0x2cbf('0x7a')]['id']}})[_0x2cbf('0x65')](handleEntityNotFound(_0x56ea79,null))[_0x2cbf('0x65')](function(_0x5b55ac){if(_0x5b55ac){_0x5c5bf1=_0x5b55ac;_0x113fce[_0x2cbf('0x4c')]=_['keys'](db['ChatProactiveAction']['rawAttributes']);_0x113fce[_0x2cbf('0x56')]=_[_0x2cbf('0x57')](_0x39f3fb[_0x2cbf('0x56')]);_0x113fce['filters']=_[_0x2cbf('0x6c')](_0x113fce['model'],_0x113fce[_0x2cbf('0x56')]);_0x454847[_0x2cbf('0x59')]=_[_0x2cbf('0x6c')](_0x113fce[_0x2cbf('0x4c')],qs[_0x2cbf('0x5a')](_0x39f3fb[_0x2cbf('0x56')][_0x2cbf('0x5a')]));_0x454847[_0x2cbf('0x59')]=_0x454847[_0x2cbf('0x59')][_0x2cbf('0x84')]?_0x454847[_0x2cbf('0x59')]:_0x113fce[_0x2cbf('0x4c')];_0x454847['order']=qs['sort'](_0x39f3fb[_0x2cbf('0x56')][_0x2cbf('0x5e')]);_0x454847[_0x2cbf('0x61')]=qs['filters'](_[_0x2cbf('0x5f')](_0x39f3fb['query'],_0x113fce[_0x2cbf('0x58')]));if(_0x39f3fb[_0x2cbf('0x56')][_0x2cbf('0x63')]){_0x454847['where']=_[_0x2cbf('0x60')](_0x454847[_0x2cbf('0x61')],{'$or':_[_0x2cbf('0x52')](_0x454847[_0x2cbf('0x59')],function(_0x21eae6){var _0x51ded1={};_0x51ded1[_0x21eae6]={'$like':'%'+_0x39f3fb[_0x2cbf('0x56')][_0x2cbf('0x63')]+'%'};return _0x51ded1;})});}_0x454847=_['merge']({},_0x454847,_0x39f3fb[_0x2cbf('0x6d')]);return _0x5c5bf1[_0x2cbf('0x10b')](_0x454847);}})[_0x2cbf('0x65')](function(_0x4af1e4){if(_0x4af1e4){_0x2b2d2a=_0x4af1e4[_0x2cbf('0x84')];if(!_0x39f3fb[_0x2cbf('0x56')][_0x2cbf('0x5b')](_0x2cbf('0x5c'))){_0x454847[_0x2cbf('0x2d')]=qs['limit'](_0x39f3fb[_0x2cbf('0x56')][_0x2cbf('0x2d')]);_0x454847['offset']=qs[_0x2cbf('0x2b')](_0x39f3fb[_0x2cbf('0x56')][_0x2cbf('0x2b')]);}return _0x5c5bf1[_0x2cbf('0x10b')](_0x454847);}})[_0x2cbf('0x65')](function(_0x2c53f0){if(_0x2c53f0){return _0x2c53f0?{'count':_0x2b2d2a,'rows':_0x2c53f0}:null;}})[_0x2cbf('0x65')](respondWithResult(_0x56ea79,null))[_0x2cbf('0x28')](handleError(_0x56ea79,null));};exports['getFields']=function(_0x53a827,_0xdb4c4e){var _0x5d4d45=_0x53a827[_0x2cbf('0x56')][_0x2cbf('0x126')]===_0x2cbf('0x127')?_0x2cbf('0x128'):_0x2cbf('0x129');return db[_0x2cbf('0x64')][_0x2cbf('0x6e')]({'attributes':['id',_0x5d4d45],'where':{'id':_0x53a827[_0x2cbf('0x7a')]['id']}})[_0x2cbf('0x65')](handleEntityNotFound(_0xdb4c4e,null))[_0x2cbf('0x65')](function(_0x193909){if(_0x193909){var _0x6e593b=_0x193909[_0x5d4d45];var _0x4ceadd=_0x6e593b&&_0x6e593b['items']?_0x6e593b[_0x2cbf('0x12a')]:[];_0xdb4c4e[_0x2cbf('0x39')]({'fromKey':_['isNil'](_0x6e593b[_0x2cbf('0x12b')])?undefined:_0x6e593b[_0x2cbf('0x12b')],'count':_0x4ceadd[_0x2cbf('0x84')],'rows':_0x4ceadd});}})[_0x2cbf('0x28')](handleError(_0xdb4c4e,null));};exports[_0x2cbf('0x12c')]=function(_0x562e48,_0x232b76){var _0x1197ea={'raw':![],'where':{}};var _0x20bcb1={};var _0x3798a2={'count':0x0,'rows':[]};return db[_0x2cbf('0x64')][_0x2cbf('0x7e')]({'where':{'id':_0x562e48[_0x2cbf('0x7a')]['id']}})[_0x2cbf('0x65')](handleEntityNotFound(_0x232b76,null))['then'](function(_0x40f41c){if(_0x40f41c){_0x20bcb1[_0x2cbf('0x4c')]=_[_0x2cbf('0x57')](db[_0x2cbf('0xe7')][_0x2cbf('0x53')]);_0x20bcb1[_0x2cbf('0x56')]=_[_0x2cbf('0x57')](_0x562e48['query']);_0x20bcb1[_0x2cbf('0x58')]=_[_0x2cbf('0x6c')](_0x20bcb1[_0x2cbf('0x4c')],_0x20bcb1[_0x2cbf('0x56')]);_0x1197ea[_0x2cbf('0x59')]=_[_0x2cbf('0x6c')](_0x20bcb1[_0x2cbf('0x4c')],qs['fields'](_0x562e48['query'][_0x2cbf('0x5a')]));_0x1197ea[_0x2cbf('0x59')]=_0x1197ea[_0x2cbf('0x59')][_0x2cbf('0x84')]?_0x1197ea[_0x2cbf('0x59')]:_0x20bcb1[_0x2cbf('0x4c')];if(!_0x562e48[_0x2cbf('0x56')][_0x2cbf('0x5b')](_0x2cbf('0x5c'))){_0x1197ea[_0x2cbf('0x2d')]=qs[_0x2cbf('0x2d')](_0x562e48[_0x2cbf('0x56')][_0x2cbf('0x2d')]);_0x1197ea[_0x2cbf('0x2b')]=qs[_0x2cbf('0x2b')](_0x562e48['query'][_0x2cbf('0x2b')]);}_0x1197ea[_0x2cbf('0x5d')]=qs[_0x2cbf('0x5e')](_0x562e48[_0x2cbf('0x56')][_0x2cbf('0x5e')]);_0x1197ea[_0x2cbf('0x61')]=qs[_0x2cbf('0x58')](_[_0x2cbf('0x5f')](_0x562e48[_0x2cbf('0x56')],_0x20bcb1[_0x2cbf('0x58')]));_0x1197ea[_0x2cbf('0x61')][_0x2cbf('0x7c')]=_0x40f41c['id'];if(_0x562e48[_0x2cbf('0x56')][_0x2cbf('0x63')]){_0x1197ea[_0x2cbf('0x61')]=_['merge'](_0x1197ea[_0x2cbf('0x61')],{'$or':_[_0x2cbf('0x52')](_0x1197ea[_0x2cbf('0x59')],function(_0x276662){var _0xac2f94={};_0xac2f94[_0x276662]={'$like':'%'+_0x562e48[_0x2cbf('0x56')][_0x2cbf('0x63')]+'%'};return _0xac2f94;})});}_0x1197ea=_[_0x2cbf('0x60')]({},_0x1197ea,_0x562e48['options']);return db['ChatOfflineMessage'][_0x2cbf('0x2e')]({'where':_0x1197ea[_0x2cbf('0x61')]})[_0x2cbf('0x65')](function(_0xcd8b09){_0x3798a2[_0x2cbf('0x2e')]=_0xcd8b09;if(_0x562e48['query']['includeAll']){_0x1197ea[_0x2cbf('0x67')]=[{'all':!![]}];}else{_0x1197ea['include']=[{'model':db[_0x2cbf('0xb0')],'as':_0x2cbf('0x12d'),'required':![]},{'model':db[_0x2cbf('0x12e')],'as':'Attachments','required':![]}];}return db['ChatOfflineMessage']['findAll'](_0x1197ea);})[_0x2cbf('0x65')](function(_0x599cce){_0x3798a2['rows']=_0x599cce;return _0x3798a2;});}})['then'](respondWithFilteredResult(_0x232b76,_0x1197ea))['catch'](handleError(_0x232b76,null));};exports[_0x2cbf('0x12f')]=function(_0x39ad7b,_0x84d60a){return db[_0x2cbf('0x64')][_0x2cbf('0x6e')]({'where':{'id':_0x39ad7b[_0x2cbf('0x7a')]['id']}})[_0x2cbf('0x65')](handleEntityNotFound(_0x84d60a,null))['then'](function(_0x271d6e){if(_0x271d6e){return _0x271d6e[_0x2cbf('0x12f')](_0x39ad7b['body']['ids'],_[_0x2cbf('0x125')](_0x39ad7b['body'],['ids','id'])||{})[_0x2cbf('0xe2')](function(_0x360811){for(var _0x31c25e=0x0;_0x31c25e<_0x39ad7b['body']['ids'][_0x2cbf('0x84')];_0x31c25e+=0x1){socket[_0x2cbf('0x130')](_0x2cbf('0x131'),{'UserId':Number(_0x39ad7b[_0x2cbf('0x6f')][_0x2cbf('0x81')][_0x31c25e]),'ChatWebsiteId':Number(_0x39ad7b['params']['id'])});}return _0x360811;});}})[_0x2cbf('0x65')](respondWithResult(_0x84d60a,null))['catch'](handleError(_0x84d60a,null));};exports[_0x2cbf('0x132')]=function(_0x4c964d,_0x4edefe){return db[_0x2cbf('0x64')]['find']({'where':{'id':_0x4c964d[_0x2cbf('0x7a')]['id']}})[_0x2cbf('0x65')](handleEntityNotFound(_0x4edefe,null))[_0x2cbf('0x65')](function(_0x445965){if(_0x445965){return _0x445965[_0x2cbf('0x132')](_0x4c964d[_0x2cbf('0x56')][_0x2cbf('0x81')])['then'](function(){if(_['isArray'](_0x4c964d[_0x2cbf('0x56')][_0x2cbf('0x81')])){for(var _0x4dc264=0x0;_0x4dc264<_0x4c964d[_0x2cbf('0x56')][_0x2cbf('0x81')][_0x2cbf('0x84')];_0x4dc264+=0x1){socket[_0x2cbf('0x130')]('userChatWebsite:remove',{'UserId':Number(_0x4c964d[_0x2cbf('0x56')][_0x2cbf('0x81')][_0x4dc264]),'ChatWebsiteId':Number(_0x4c964d[_0x2cbf('0x7a')]['id'])});}}else{socket[_0x2cbf('0x130')]('userChatWebsite:remove',{'UserId':Number(_0x4c964d[_0x2cbf('0x56')][_0x2cbf('0x81')]),'ChatWebsiteId':Number(_0x4c964d[_0x2cbf('0x7a')]['id'])});}});}})[_0x2cbf('0x65')](respondWithStatusCode(_0x4edefe,null))['catch'](handleError(_0x4edefe,null));};exports[_0x2cbf('0x133')]=function(_0x531b89,_0x208601){var _0x1d444d={};var _0x6d1f2e={};var _0x432698;var _0x30987f;return db[_0x2cbf('0x64')][_0x2cbf('0x7e')]({'where':{'id':_0x531b89[_0x2cbf('0x7a')]['id']}})[_0x2cbf('0x65')](handleEntityNotFound(_0x208601,null))['then'](function(_0x3ef5e6){if(_0x3ef5e6){_0x432698=_0x3ef5e6;_0x6d1f2e[_0x2cbf('0x4c')]=_['keys'](db[_0x2cbf('0xce')][_0x2cbf('0x53')]);_0x6d1f2e['query']=_['keys'](_0x531b89[_0x2cbf('0x56')]);_0x6d1f2e[_0x2cbf('0x58')]=_[_0x2cbf('0x6c')](_0x6d1f2e[_0x2cbf('0x4c')],_0x6d1f2e[_0x2cbf('0x56')]);_0x1d444d['attributes']=_[_0x2cbf('0x6c')](_0x6d1f2e[_0x2cbf('0x4c')],qs['fields'](_0x531b89[_0x2cbf('0x56')]['fields']));_0x1d444d[_0x2cbf('0x59')]=_0x1d444d[_0x2cbf('0x59')]['length']?_0x1d444d['attributes']:_0x6d1f2e[_0x2cbf('0x4c')];_0x1d444d[_0x2cbf('0x5d')]=qs[_0x2cbf('0x5e')](_0x531b89['query'][_0x2cbf('0x5e')]);_0x1d444d[_0x2cbf('0x61')]=qs[_0x2cbf('0x58')](_[_0x2cbf('0x5f')](_0x531b89[_0x2cbf('0x56')],_0x6d1f2e[_0x2cbf('0x58')]));if(_0x531b89[_0x2cbf('0x56')]['filter']){_0x1d444d[_0x2cbf('0x61')]=_['merge'](_0x1d444d['where'],{'$or':_['map'](_0x1d444d[_0x2cbf('0x59')],function(_0x31934f){var _0x3adec1={};_0x3adec1[_0x31934f]={'$like':'%'+_0x531b89[_0x2cbf('0x56')][_0x2cbf('0x63')]+'%'};return _0x3adec1;})});}_0x1d444d=_[_0x2cbf('0x60')]({},_0x1d444d,_0x531b89[_0x2cbf('0x6d')]);return _0x432698[_0x2cbf('0x133')](_0x1d444d);}})[_0x2cbf('0x65')](function(_0x5607da){if(_0x5607da){_0x30987f=_0x5607da['length'];if(!_0x531b89[_0x2cbf('0x56')][_0x2cbf('0x5b')](_0x2cbf('0x5c'))){_0x1d444d['limit']=qs[_0x2cbf('0x2d')](_0x531b89[_0x2cbf('0x56')]['limit']);_0x1d444d['offset']=qs[_0x2cbf('0x2b')](_0x531b89[_0x2cbf('0x56')][_0x2cbf('0x2b')]);}return _0x432698[_0x2cbf('0x133')](_0x1d444d);}})[_0x2cbf('0x65')](function(_0x1540d0){if(_0x1540d0){return _0x1540d0?{'count':_0x30987f,'rows':_0x1540d0}:null;}})[_0x2cbf('0x65')](respondWithResult(_0x208601,null))['catch'](handleError(_0x208601,null));}; \ No newline at end of file +var _0x6da1=['ValidationError','no\x20available\x20attributes','createdAt','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','findOrCreate','spread','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','files','attachments','offline-chat','basename','openNewInteraction','transaction','Attachment','bulkCreate','MailAccount','MailServerOut','Smtp','CloudProvider','forwardOfflineAddress','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','mapValues','Chat','NotifyMailAccount','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','getSnippet','interval','getProactiveActions','getLicense','virtual','License','chatLicenseExceeded','ifTime','readFileSync','server/files/chat/iframe.ejs','3.9.0','origin','replace','x-real-ip','connection','remoteAddress','verticalAlignment','textColor','textButtonColor','backgroundColor','addApplications','sequelize','Transaction','findAndCountAll','stack','finally','getApplications','chatProactiveAction','addProactiveActions','omit','ChatProactiveAction','getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','User','util','path','ejs','querystring','html-to-text','ioredis','../../components/parsers/qs','../../config/environment','../../errors/api','APIOutOfIntervalError','handleError','APIConflictError','./helpers/wildcard-expressions','URL','../../mysqldb','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','http','client','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','name','send','user-agent-parser','setUA','customerIp','cf-connecting-ip','x-forwarded-for','split','lastName','referer','browser','version','format','%s\x20%s','unknown','device','model','vendor','type','stringify','Pause','mandatoryDispositionPause','map','ChatWebsite','key','query','filters','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','filter','include','rows','show','params','keys','intersection','length','includeAll','find','create','body','address','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','testWildcardValidity','describe','ChatWebsiteId','getDispositions','findOne','Disposition','rawAttributes','nolimit','options','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','findAll','addLogo','sitepic','filename','addAvatar','agentAvatar','file','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','../../config/license/util','custom','isNil','server/files/images/logos/','download','existsSync','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','customerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','timezone','chat','from','From\x20is\x20mandatory','mapKey','isEmpty','CmContact','No\x20available\x20attributes','updatedAt','CompanyId','ListId','includes','List','DESC','ChatApplication','Applications','Interval','Intervals','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','applications','orderBy','priority','asc','list','Contacts','defaults','contact','headers','threadId','closed','ChatInteraction','Writing\x20on\x20closed\x20interaction','externalUrl','ContactId','interaction','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','ChatQueue','queueId','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','notify'];(function(_0x5d26d1,_0x1d8e4b){var _0x2d5c7e=function(_0x26a55c){while(--_0x26a55c){_0x5d26d1['push'](_0x5d26d1['shift']());}};_0x2d5c7e(++_0x1d8e4b);}(_0x6da1,0x18d));var _0x16da=function(_0x15af0f,_0x5454ce){_0x15af0f=_0x15af0f-0x0;var _0x2bd1cb=_0x6da1[_0x15af0f];return _0x2bd1cb;};'use strict';var Mustache=require('mustache');var util=require(_0x16da('0x0'));var path=require(_0x16da('0x1'));var ejs=require(_0x16da('0x2'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var querystring=require(_0x16da('0x3'));var htmlToText=require(_0x16da('0x4'));var Redis=require(_0x16da('0x5'));var jayson=require('jayson/promise');var qs=require(_0x16da('0x6'));var logger=require('../../config/logger')('api');var config=require(_0x16da('0x7'));var APIBadRequestError=require(_0x16da('0x8'))['APIBadRequestError'];var APINotFoundError=require(_0x16da('0x8'))['APINotFoundError'];var APIOutOfIntervalError=require(_0x16da('0x8'))[_0x16da('0x9')];var APIHandleError=require(_0x16da('0x8'))[_0x16da('0xa')];var APIConflictError=require(_0x16da('0x8'))[_0x16da('0xb')];var wildcardUtils=require(_0x16da('0xc'));var URL=require('url')[_0x16da('0xd')];var db=require(_0x16da('0xe'))['db'];config[_0x16da('0xf')]=_['defaults'](config['redis'],{'host':_0x16da('0x10'),'port':0x18eb});var socket=require(_0x16da('0x11'))(new Redis(config[_0x16da('0xf')]));require(_0x16da('0x12'))[_0x16da('0x13')](socket);var client=jayson['client'][_0x16da('0x14')]({'port':0x232c});var client9002=jayson[_0x16da('0x15')][_0x16da('0x14')]({'port':0x232a});var client9003=jayson[_0x16da('0x15')]['http']({'port':0x232b});var client9001=jayson[_0x16da('0x15')][_0x16da('0x14')]({'port':0x2329});function respondWithRpcPromise(_0x41fed9,_0x377865,_0xc739b0,_0x39ca3a){return new Promise(function(_0x4759cd,_0xd12eca){var _0x400394=_0x39ca3a||client;return _0x400394['request'](_0x41fed9,_0xc739b0)[_0x16da('0x16')](function(_0x5d957e){logger[_0x16da('0x17')](_0x16da('0x18'),_0x377865,_0x16da('0x19'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x377865,_0x16da('0x19'),JSON['stringify'](_0x5d957e));if(_0x5d957e[_0x16da('0x1a')]){if(_0x5d957e[_0x16da('0x1a')][_0x16da('0x1b')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x377865,_0x5d957e[_0x16da('0x1a')][_0x16da('0x1c')]);return _0xd12eca(_0x5d957e[_0x16da('0x1a')][_0x16da('0x1c')]);}logger[_0x16da('0x1a')](_0x16da('0x18'),_0x377865,_0x5d957e['error'][_0x16da('0x1c')]);return _0x4759cd(_0x5d957e[_0x16da('0x1a')][_0x16da('0x1c')]);}else{logger[_0x16da('0x17')](_0x16da('0x18'),_0x377865,_0x16da('0x19'));_0x4759cd(_0x5d957e[_0x16da('0x1d')][_0x16da('0x1c')]);}})[_0x16da('0x1e')](function(_0x3a4e75){logger['error'](_0x16da('0x18'),_0x377865,_0x3a4e75);_0xd12eca(_0x3a4e75);});});}function respondWithStatusCode(_0xb4cad4,_0xfe2ba4){_0xfe2ba4=_0xfe2ba4||0xcc;return function(_0x303969){if(_0x303969){return _0xb4cad4[_0x16da('0x1f')](_0xfe2ba4);}return _0xb4cad4[_0x16da('0x20')](_0xfe2ba4)[_0x16da('0x21')]();};}function respondWithResult(_0x42c688,_0x2065e4){_0x2065e4=_0x2065e4||0xc8;return function(_0x43ef9f){if(_0x43ef9f){return _0x42c688['status'](_0x2065e4)[_0x16da('0x22')](_0x43ef9f);}};}function respondWithFilteredResult(_0x3bd516,_0xa0806a){return function(_0x2c14cf){if(_0x2c14cf){var _0x3168c9=typeof _0xa0806a[_0x16da('0x23')]===_0x16da('0x24')&&typeof _0xa0806a['limit']===_0x16da('0x24');var _0x20c6a1=_0x2c14cf[_0x16da('0x25')];var _0x146366=_0x3168c9?0x0:_0xa0806a[_0x16da('0x23')];var _0x57d32b=_0x3168c9?_0x2c14cf['count']:_0xa0806a[_0x16da('0x23')]+_0xa0806a[_0x16da('0x26')];var _0x2371a7;if(_0x57d32b>=_0x20c6a1){_0x57d32b=_0x20c6a1;_0x2371a7=0xc8;}else{_0x2371a7=0xce;}_0x3bd516[_0x16da('0x20')](_0x2371a7);return _0x3bd516[_0x16da('0x27')](_0x16da('0x28'),_0x146366+'-'+_0x57d32b+'/'+_0x20c6a1)[_0x16da('0x22')](_0x2c14cf);}return null;};}function saveUpdates(_0x1d8cd7){return function(_0x5dd0df){if(_0x5dd0df){return _0x5dd0df[_0x16da('0x29')](_0x1d8cd7)[_0x16da('0x16')](function(_0x3439b7){return _0x3439b7;});}return null;};}function removeEntity(_0x28f2ae){return function(_0x7d0c61){if(_0x7d0c61){return _0x7d0c61[_0x16da('0x2a')]()[_0x16da('0x16')](function(){var _0x596bde=_0x7d0c61[_0x16da('0x2b')]({'plain':!![]});var _0xff33c1=_0x16da('0x2c');return db[_0x16da('0x2d')]['destroy']({'where':{'type':_0xff33c1,'resourceId':_0x596bde['id']}})['then'](function(){return _0x7d0c61;});})[_0x16da('0x16')](function(){_0x28f2ae[_0x16da('0x20')](0xcc)[_0x16da('0x21')]();});}};}function handleEntityNotFound(_0x5eb29e){return function(_0x1d8e8a){if(!_0x1d8e8a){_0x5eb29e[_0x16da('0x1f')](0x194);}return _0x1d8e8a;};}function handleError(_0x5b23fc,_0x4dc9cf){_0x4dc9cf=_0x4dc9cf||0x1f4;return function(_0x4e1579){logger[_0x16da('0x1a')](_0x4e1579['stack']);if(_0x4e1579['name']){delete _0x4e1579[_0x16da('0x2e')];}_0x5b23fc[_0x16da('0x20')](_0x4dc9cf)[_0x16da('0x2f')](_0x4e1579);};}function createInteractionObject(_0xc0a2eb,_0x88bfb4,_0x477c69,_0x305717){var _0x38f32e=require(_0x16da('0x30'));var _0x35118c=new _0x38f32e();var _0x480afb=_0x35118c[_0x16da('0x31')](_0x477c69['user-agent'])['getResult']();var _0x20bd1f=_0x88bfb4[_0x16da('0x32')];if(_0x477c69[_0x16da('0x33')]){_0x20bd1f=_0x477c69['cf-connecting-ip'];}else if(_0x477c69[_0x16da('0x34')]){_0x20bd1f=_['first'](_0x477c69[_0x16da('0x34')][_0x16da('0x35')](','));}return{'ContactId':_0x305717['id'],'ChatWebsiteId':_0xc0a2eb,'from':(_0x305717['firstName']||'')+'\x20'+(_0x305717[_0x16da('0x36')]||''),'customerIp':_0x20bd1f,'customerPort':_0x477c69['x-real-port']?_0x477c69['x-real-port']:null,'referer':_0x88bfb4[_0x16da('0x37')],'browserName':_0x480afb['browser'][_0x16da('0x2e')]&&_0x480afb[_0x16da('0x38')][_0x16da('0x39')]?util[_0x16da('0x3a')](_0x16da('0x3b'),_0x480afb[_0x16da('0x38')]['name'],_0x480afb[_0x16da('0x38')]['version']):_0x16da('0x3c'),'browserVersion':_0x480afb['browser'][_0x16da('0x39')]||_0x16da('0x3c'),'osName':util['format'](_0x16da('0x3b'),_0x480afb['os'][_0x16da('0x2e')],_0x480afb['os'][_0x16da('0x39')]),'osVersion':_0x480afb['os']['version'],'deviceModel':_0x480afb[_0x16da('0x3d')]['model']&&_0x480afb[_0x16da('0x3d')]['vendor']?util[_0x16da('0x3a')]('%s\x20%s\x20%s',_0x480afb[_0x16da('0x3d')][_0x16da('0x3e')],_0x480afb[_0x16da('0x3d')][_0x16da('0x3f')],_0x480afb[_0x16da('0x3d')][_0x16da('0x40')]):null,'deviceVendor':_0x480afb['device'][_0x16da('0x3f')],'deviceType':_0x480afb[_0x16da('0x3d')][_0x16da('0x40')],'formData':JSON[_0x16da('0x41')](_0x88bfb4)};}exports['index']=function(_0x19c8f4,_0x39fe72){var _0x277202={'include':[{'model':db[_0x16da('0x42')],'as':_0x16da('0x43')}]},_0x163118={},_0x1eb8b9={'count':0x0,'rows':[]};var _0x248b7a=_[_0x16da('0x44')](db[_0x16da('0x45')]['rawAttributes'],function(_0x342c4a){return{'name':_0x342c4a['fieldName'],'type':_0x342c4a['type'][_0x16da('0x46')]};});_0x163118['model']=_[_0x16da('0x44')](_0x248b7a,'name');_0x163118[_0x16da('0x47')]=_['keys'](_0x19c8f4[_0x16da('0x47')]);_0x163118[_0x16da('0x48')]=_['intersection'](_0x163118['model'],_0x163118[_0x16da('0x47')]);_0x277202[_0x16da('0x49')]=_['intersection'](_0x163118['model'],qs['fields'](_0x19c8f4[_0x16da('0x47')][_0x16da('0x4a')]));_0x277202[_0x16da('0x49')]=_0x277202[_0x16da('0x49')]['length']?_0x277202[_0x16da('0x49')]:_0x163118[_0x16da('0x3e')];if(!_0x19c8f4[_0x16da('0x47')][_0x16da('0x4b')]('nolimit')){_0x277202[_0x16da('0x26')]=qs[_0x16da('0x26')](_0x19c8f4[_0x16da('0x47')]['limit']);_0x277202[_0x16da('0x23')]=qs[_0x16da('0x23')](_0x19c8f4[_0x16da('0x47')][_0x16da('0x23')]);}_0x277202[_0x16da('0x4c')]=qs[_0x16da('0x4d')](_0x19c8f4[_0x16da('0x47')][_0x16da('0x4d')]);_0x277202[_0x16da('0x4e')]=qs['filters'](_[_0x16da('0x4f')](_0x19c8f4[_0x16da('0x47')],_0x163118[_0x16da('0x48')]),_0x248b7a);if(_0x19c8f4[_0x16da('0x47')]['filter']){_0x277202['where']=_[_0x16da('0x50')](_0x277202[_0x16da('0x4e')],{'$or':_[_0x16da('0x44')](_0x248b7a,function(_0x243f24){if(_0x243f24[_0x16da('0x40')]!=='VIRTUAL'){var _0x4bc72b={};_0x4bc72b[_0x243f24[_0x16da('0x2e')]]={'$like':'%'+_0x19c8f4['query'][_0x16da('0x51')]+'%'};return _0x4bc72b;}})});}_0x277202=_[_0x16da('0x50')]({},_0x277202,_0x19c8f4['options']);var _0x1de632={'where':_0x277202[_0x16da('0x4e')]};return db[_0x16da('0x45')][_0x16da('0x25')](_0x1de632)[_0x16da('0x16')](function(_0x45b4ae){_0x1eb8b9[_0x16da('0x25')]=_0x45b4ae;if(_0x19c8f4[_0x16da('0x47')]['includeAll']){_0x277202[_0x16da('0x52')]=[{'all':!![]}];}return db[_0x16da('0x45')]['findAll'](_0x277202);})['then'](function(_0x4bd52f){_0x1eb8b9[_0x16da('0x53')]=_0x4bd52f;return _0x1eb8b9;})[_0x16da('0x16')](respondWithFilteredResult(_0x39fe72,_0x277202))['catch'](handleError(_0x39fe72,null));};exports[_0x16da('0x54')]=function(_0x343ef1,_0x1bcaee){var _0x2a69a8={'raw':![],'where':{'id':_0x343ef1[_0x16da('0x55')]['id']},'include':[{'model':db[_0x16da('0x42')],'as':_0x16da('0x43')}]},_0x1a36ec={};_0x1a36ec['model']=_[_0x16da('0x56')](db[_0x16da('0x45')]['rawAttributes']);_0x1a36ec['query']=_[_0x16da('0x56')](_0x343ef1[_0x16da('0x47')]);_0x1a36ec[_0x16da('0x48')]=_[_0x16da('0x57')](_0x1a36ec[_0x16da('0x3e')],_0x1a36ec[_0x16da('0x47')]);_0x2a69a8['attributes']=_[_0x16da('0x57')](_0x1a36ec['model'],qs[_0x16da('0x4a')](_0x343ef1[_0x16da('0x47')][_0x16da('0x4a')]));_0x2a69a8[_0x16da('0x49')]=_0x2a69a8['attributes'][_0x16da('0x58')]?_0x2a69a8[_0x16da('0x49')]:_0x1a36ec[_0x16da('0x3e')];if(_0x343ef1['query'][_0x16da('0x59')]){_0x2a69a8[_0x16da('0x52')]=[{'all':!![]}];}_0x2a69a8=_['merge']({},_0x2a69a8,_0x343ef1['options']);return db['ChatWebsite'][_0x16da('0x5a')](_0x2a69a8)[_0x16da('0x16')](handleEntityNotFound(_0x1bcaee,null))[_0x16da('0x16')](respondWithResult(_0x1bcaee,null))[_0x16da('0x1e')](handleError(_0x1bcaee,null));};exports[_0x16da('0x5b')]=function(_0x1d913b,_0x29579e){if(!wildcardUtils['testWildcardValidity'](_0x1d913b[_0x16da('0x5c')][_0x16da('0x5d')])){return handleError(_0x29579e,null)(new APIBadRequestError('\x22'+_0x1d913b['body'][_0x16da('0x5d')]+'\x22\x20is\x20not\x20a\x20valid\x20website\x20domain'));}return db[_0x16da('0x45')][_0x16da('0x5b')](_0x1d913b[_0x16da('0x5c')],{})[_0x16da('0x16')](function(_0x45a782){var _0xa21751=_0x1d913b[_0x16da('0x5e')][_0x16da('0x2b')]({'plain':!![]});if(!_0xa21751)throw new Error(_0x16da('0x5f'));if(_0xa21751[_0x16da('0x60')]==='user'){var _0x3de327=_0x45a782['get']({'plain':!![]});var _0x49194f='ChatWebsites';return db['UserProfileSection'][_0x16da('0x5a')]({'where':{'name':_0x49194f,'userProfileId':_0xa21751[_0x16da('0x61')]},'raw':!![]})['then'](function(_0x54369e){if(_0x54369e&&_0x54369e[_0x16da('0x62')]===0x0){return db['UserProfileResource'][_0x16da('0x5b')]({'name':_0x3de327[_0x16da('0x2e')],'resourceId':_0x3de327['id'],'type':_0x54369e[_0x16da('0x2e')],'sectionId':_0x54369e['id']},{})['then'](function(){return _0x45a782;});}else{return _0x45a782;}})[_0x16da('0x1e')](function(_0x2945c5){logger[_0x16da('0x1a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2945c5);throw _0x2945c5;});}return _0x45a782;})[_0x16da('0x16')](respondWithResult(_0x29579e,0xc9))[_0x16da('0x1e')](handleError(_0x29579e,null));};exports[_0x16da('0x29')]=function(_0x20039b,_0x48310e){if(!wildcardUtils[_0x16da('0x63')](_0x20039b[_0x16da('0x5c')][_0x16da('0x5d')])){return handleError(_0x48310e,null)(new APIBadRequestError('\x22'+_0x20039b[_0x16da('0x5c')][_0x16da('0x5d')]+'\x22\x20is\x20not\x20a\x20valid\x20website\x20domain'));}if(_0x20039b[_0x16da('0x5c')]['id']){delete _0x20039b[_0x16da('0x5c')]['id'];}return db[_0x16da('0x45')]['find']({'where':{'id':_0x20039b['params']['id']},'include':[{'model':db[_0x16da('0x42')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x48310e,null))[_0x16da('0x16')](saveUpdates(_0x20039b[_0x16da('0x5c')],null))[_0x16da('0x16')](respondWithResult(_0x48310e,null))['catch'](handleError(_0x48310e,null));};exports[_0x16da('0x2a')]=function(_0x2ff3a6,_0x48c715){return db[_0x16da('0x45')][_0x16da('0x5a')]({'where':{'id':_0x2ff3a6[_0x16da('0x55')]['id']}})['then'](handleEntityNotFound(_0x48c715,null))[_0x16da('0x16')](removeEntity(_0x48c715,null))[_0x16da('0x1e')](handleError(_0x48c715,null));};exports[_0x16da('0x64')]=function(_0x5907c1,_0x3ac739){return db[_0x16da('0x45')][_0x16da('0x64')]()[_0x16da('0x16')](respondWithResult(_0x3ac739,null))[_0x16da('0x1e')](handleError(_0x3ac739,null));};exports['addDisposition']=function(_0x1c2954,_0x5eeebc){if(_0x1c2954[_0x16da('0x5c')]['id']){delete _0x1c2954[_0x16da('0x5c')]['id'];}return db[_0x16da('0x45')]['find']({'where':{'id':_0x1c2954['params']['id']}})['then'](handleEntityNotFound(_0x5eeebc,null))['then'](function(_0x3bff64){if(_0x3bff64){_0x1c2954['body'][_0x16da('0x65')]=_0x3bff64['id'];return db['Disposition'][_0x16da('0x5b')](_0x1c2954[_0x16da('0x5c')]);}})[_0x16da('0x16')](respondWithResult(_0x5eeebc,null))[_0x16da('0x1e')](handleError(_0x5eeebc,null));};exports[_0x16da('0x66')]=function(_0x341a82,_0x5d45e8){var _0x432b9a={'raw':![],'where':{}};var _0x1f3463={};var _0x371070={'count':0x0,'rows':[]};return db[_0x16da('0x45')][_0x16da('0x67')]({'where':{'id':_0x341a82[_0x16da('0x55')]['id']}})[_0x16da('0x16')](handleEntityNotFound(_0x5d45e8,null))[_0x16da('0x16')](function(_0x3d67c5){if(_0x3d67c5){_0x1f3463['model']=_[_0x16da('0x56')](db[_0x16da('0x68')][_0x16da('0x69')]);_0x1f3463[_0x16da('0x47')]=_[_0x16da('0x56')](_0x341a82['query']);_0x1f3463[_0x16da('0x48')]=_['intersection'](_0x1f3463[_0x16da('0x3e')],_0x1f3463[_0x16da('0x47')]);_0x432b9a[_0x16da('0x49')]=_['intersection'](_0x1f3463[_0x16da('0x3e')],qs[_0x16da('0x4a')](_0x341a82[_0x16da('0x47')][_0x16da('0x4a')]));_0x432b9a[_0x16da('0x49')]=_0x432b9a[_0x16da('0x49')][_0x16da('0x58')]?_0x432b9a[_0x16da('0x49')]:_0x1f3463[_0x16da('0x3e')];if(!_0x341a82[_0x16da('0x47')][_0x16da('0x4b')](_0x16da('0x6a'))){_0x432b9a[_0x16da('0x26')]=qs[_0x16da('0x26')](_0x341a82['query'][_0x16da('0x26')]);_0x432b9a[_0x16da('0x23')]=qs[_0x16da('0x23')](_0x341a82[_0x16da('0x47')]['offset']);}_0x432b9a[_0x16da('0x4c')]=qs[_0x16da('0x4d')](_0x341a82[_0x16da('0x47')][_0x16da('0x4d')]);_0x432b9a[_0x16da('0x4e')]=qs[_0x16da('0x48')](_['pick'](_0x341a82[_0x16da('0x47')],_0x1f3463[_0x16da('0x48')]));_0x432b9a[_0x16da('0x4e')][_0x16da('0x65')]=_0x3d67c5['id'];if(_0x341a82[_0x16da('0x47')][_0x16da('0x51')]){_0x432b9a[_0x16da('0x4e')]=_[_0x16da('0x50')](_0x432b9a['where'],{'$or':_['map'](_0x432b9a[_0x16da('0x49')],function(_0x3e88df){var _0x2e1aa4={};_0x2e1aa4[_0x3e88df]={'$like':'%'+_0x341a82[_0x16da('0x47')][_0x16da('0x51')]+'%'};return _0x2e1aa4;})});}_0x432b9a=_[_0x16da('0x50')]({},_0x432b9a,_0x341a82[_0x16da('0x6b')]);return db[_0x16da('0x68')][_0x16da('0x25')]({'where':_0x432b9a['where']})[_0x16da('0x16')](function(_0x43c9f3){_0x371070[_0x16da('0x25')]=_0x43c9f3;if(_0x341a82['query'][_0x16da('0x59')]){_0x432b9a[_0x16da('0x52')]=[{'all':!![]}];}return db[_0x16da('0x68')]['findAll'](_0x432b9a);})[_0x16da('0x16')](function(_0x39c53d){_0x371070['rows']=_0x39c53d;return _0x371070;});}})[_0x16da('0x16')](respondWithFilteredResult(_0x5d45e8,_0x432b9a))['catch'](handleError(_0x5d45e8,null));};exports[_0x16da('0x6c')]=function(_0x4ba7ed,_0x1ee568){return db[_0x16da('0x45')][_0x16da('0x5a')]({'where':{'id':_0x4ba7ed['params']['id']}})[_0x16da('0x16')](handleEntityNotFound(_0x1ee568,null))[_0x16da('0x16')](function(_0x654cd0){if(_0x654cd0){return _0x654cd0['removeDispositions'](_0x4ba7ed[_0x16da('0x47')][_0x16da('0x6d')]);}})['then'](respondWithStatusCode(_0x1ee568,null))[_0x16da('0x1e')](handleError(_0x1ee568,null));};exports[_0x16da('0x6e')]=function(_0x2e442b,_0x5e91cf){if(_0x2e442b[_0x16da('0x5c')]['id']){delete _0x2e442b['body']['id'];}return db[_0x16da('0x45')][_0x16da('0x5a')]({'where':{'id':_0x2e442b[_0x16da('0x55')]['id']}})[_0x16da('0x16')](handleEntityNotFound(_0x5e91cf,null))[_0x16da('0x16')](function(_0x1a114c){if(_0x1a114c){_0x2e442b['body'][_0x16da('0x65')]=_0x1a114c['id'];return db['CannedAnswer']['create'](_0x2e442b[_0x16da('0x5c')]);}})[_0x16da('0x16')](respondWithResult(_0x5e91cf,null))['catch'](handleError(_0x5e91cf,null));};exports[_0x16da('0x6f')]=function(_0x2f63d2,_0x4d7fb7){var _0x3a6dad={'raw':![],'where':{}};var _0x518341={};var _0x1d4d6d={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x2f63d2['params']['id']}})[_0x16da('0x16')](handleEntityNotFound(_0x4d7fb7,null))[_0x16da('0x16')](function(_0x218b21){if(_0x218b21){_0x518341[_0x16da('0x3e')]=_[_0x16da('0x56')](db[_0x16da('0x70')][_0x16da('0x69')]);_0x518341[_0x16da('0x47')]=_[_0x16da('0x56')](_0x2f63d2[_0x16da('0x47')]);_0x518341[_0x16da('0x48')]=_[_0x16da('0x57')](_0x518341[_0x16da('0x3e')],_0x518341['query']);_0x3a6dad[_0x16da('0x49')]=_[_0x16da('0x57')](_0x518341[_0x16da('0x3e')],qs[_0x16da('0x4a')](_0x2f63d2[_0x16da('0x47')][_0x16da('0x4a')]));_0x3a6dad[_0x16da('0x49')]=_0x3a6dad[_0x16da('0x49')]['length']?_0x3a6dad['attributes']:_0x518341['model'];if(!_0x2f63d2[_0x16da('0x47')][_0x16da('0x4b')](_0x16da('0x6a'))){_0x3a6dad['limit']=qs[_0x16da('0x26')](_0x2f63d2[_0x16da('0x47')][_0x16da('0x26')]);_0x3a6dad[_0x16da('0x23')]=qs[_0x16da('0x23')](_0x2f63d2[_0x16da('0x47')][_0x16da('0x23')]);}_0x3a6dad[_0x16da('0x4c')]=qs['sort'](_0x2f63d2[_0x16da('0x47')][_0x16da('0x4d')]);_0x3a6dad[_0x16da('0x4e')]=qs[_0x16da('0x48')](_[_0x16da('0x4f')](_0x2f63d2[_0x16da('0x47')],_0x518341[_0x16da('0x48')]));_0x3a6dad[_0x16da('0x4e')][_0x16da('0x65')]=_0x218b21['id'];if(_0x2f63d2[_0x16da('0x47')][_0x16da('0x51')]){_0x3a6dad[_0x16da('0x4e')]=_[_0x16da('0x50')](_0x3a6dad[_0x16da('0x4e')],{'$or':_[_0x16da('0x44')](_0x3a6dad[_0x16da('0x49')],function(_0x2e22d7){var _0x81f112={};_0x81f112[_0x2e22d7]={'$like':'%'+_0x2f63d2['query'][_0x16da('0x51')]+'%'};return _0x81f112;})});}_0x3a6dad=_[_0x16da('0x50')]({},_0x3a6dad,_0x2f63d2[_0x16da('0x6b')]);return db[_0x16da('0x70')][_0x16da('0x25')]({'where':_0x3a6dad[_0x16da('0x4e')]})[_0x16da('0x16')](function(_0x452b18){_0x1d4d6d[_0x16da('0x25')]=_0x452b18;if(_0x2f63d2[_0x16da('0x47')][_0x16da('0x59')]){_0x3a6dad['include']=[{'all':!![]}];}return db[_0x16da('0x70')][_0x16da('0x71')](_0x3a6dad);})['then'](function(_0x3be066){_0x1d4d6d['rows']=_0x3be066;return _0x1d4d6d;});}})[_0x16da('0x16')](respondWithFilteredResult(_0x4d7fb7,_0x3a6dad))[_0x16da('0x1e')](handleError(_0x4d7fb7,null));};exports['removeAnswers']=function(_0x4ae70d,_0x4616c0){return db['ChatWebsite']['find']({'where':{'id':_0x4ae70d[_0x16da('0x55')]['id']}})['then'](handleEntityNotFound(_0x4616c0,null))['then'](function(_0x1dcc2b){if(_0x1dcc2b){return _0x1dcc2b['removeAnswers'](_0x4ae70d[_0x16da('0x47')][_0x16da('0x6d')]);}})[_0x16da('0x16')](respondWithStatusCode(_0x4616c0,null))['catch'](handleError(_0x4616c0,null));};exports[_0x16da('0x72')]=function(_0x4c82df,_0x1784c6){_0x4c82df[_0x16da('0x5c')][_0x16da('0x73')]=_0x4c82df['file'][_0x16da('0x74')];return db[_0x16da('0x45')]['find']({'where':{'id':_0x4c82df[_0x16da('0x55')]['id']}})['then'](handleEntityNotFound(_0x1784c6,null))[_0x16da('0x16')](saveUpdates(_0x4c82df['body'],null))[_0x16da('0x16')](respondWithResult(_0x1784c6,null))[_0x16da('0x1e')](handleError(_0x1784c6,null));};exports[_0x16da('0x75')]=function(_0x31511d,_0x5f2993){_0x31511d['body'][_0x16da('0x76')]=_0x31511d[_0x16da('0x77')][_0x16da('0x74')];return db[_0x16da('0x45')]['find']({'where':{'id':_0x31511d['params']['id']}})[_0x16da('0x16')](handleEntityNotFound(_0x5f2993,null))['then'](saveUpdates(_0x31511d[_0x16da('0x5c')],null))['then'](respondWithResult(_0x5f2993,null))[_0x16da('0x1e')](handleError(_0x5f2993,null));};exports[_0x16da('0x78')]=function(_0x5d4a61,_0x1b10a7){_0x5d4a61[_0x16da('0x5c')]['customerAvatar']=_0x5d4a61[_0x16da('0x77')][_0x16da('0x74')];return db[_0x16da('0x45')][_0x16da('0x5a')]({'where':{'id':_0x5d4a61[_0x16da('0x55')]['id']}})[_0x16da('0x16')](handleEntityNotFound(_0x1b10a7,null))['then'](saveUpdates(_0x5d4a61[_0x16da('0x5c')],null))[_0x16da('0x16')](respondWithResult(_0x1b10a7,null))[_0x16da('0x1e')](handleError(_0x1b10a7,null));};exports[_0x16da('0x79')]=function(_0x4e11e5,_0x3a6db4){_0x4e11e5[_0x16da('0x5c')][_0x16da('0x7a')]=_0x4e11e5['file'][_0x16da('0x74')];return db['ChatWebsite']['find']({'where':{'id':_0x4e11e5[_0x16da('0x55')]['id']}})[_0x16da('0x16')](handleEntityNotFound(_0x3a6db4,null))[_0x16da('0x16')](saveUpdates(_0x4e11e5[_0x16da('0x5c')],null))[_0x16da('0x16')](respondWithResult(_0x3a6db4,null))[_0x16da('0x1e')](handleError(_0x3a6db4,null));};exports[_0x16da('0x7b')]=function(_0x31921f,_0x324b54){var _0x44d46e=path[_0x16da('0x7c')](config[_0x16da('0x7d')],'server/files/images/logos/default_logo.svg');var _0x6b36ff={'where':{'id':_0x31921f['params']['id']},'attributes':['id',_0x16da('0x73')],'raw':!![]};var _0x3b94de=![];return require(_0x16da('0x7e'))['getLicense']()[_0x16da('0x16')](function(_0x39ccf2){if(_0x39ccf2){_0x3b94de=_0x39ccf2[_0x16da('0x7f')];}})['then'](function(){return db[_0x16da('0x45')][_0x16da('0x5a')](_0x6b36ff);})[_0x16da('0x16')](handleEntityNotFound(_0x324b54,null))[_0x16da('0x16')](function(_0x30fc4c){if(_0x30fc4c){if(!_[_0x16da('0x80')](_0x30fc4c[_0x16da('0x73')])){if(fs['existsSync'](path[_0x16da('0x7c')](config[_0x16da('0x7d')],_0x16da('0x81'),_0x30fc4c[_0x16da('0x73')]))&&_0x3b94de){_0x44d46e=path[_0x16da('0x7c')](config['root'],'server/files/images/logos/',_0x30fc4c['sitepic']);}}return _0x324b54[_0x16da('0x82')](_0x44d46e);}})[_0x16da('0x1e')](handleError(_0x324b54,null));};exports['getAvatar']=function(_0xb9d511,_0x46779e){var _0x1c4a60=path[_0x16da('0x7c')](config[_0x16da('0x7d')],'server/files/images/avatars/default_avatar.png');var _0x2f4c70={'where':{'id':_0xb9d511[_0x16da('0x55')]['id']},'attributes':['id',_0x16da('0x76')],'raw':!![]};return db[_0x16da('0x45')][_0x16da('0x5a')](_0x2f4c70)[_0x16da('0x16')](handleEntityNotFound(_0x46779e,null))['then'](function(_0x10c14e){if(_0x10c14e){if(!_[_0x16da('0x80')](_0x10c14e[_0x16da('0x76')])){if(fs[_0x16da('0x83')](path[_0x16da('0x7c')](config[_0x16da('0x7d')],_0x16da('0x84'),_0x10c14e[_0x16da('0x76')]))){_0x1c4a60=path[_0x16da('0x7c')](config[_0x16da('0x7d')],_0x16da('0x84'),_0x10c14e[_0x16da('0x76')]);}}return _0x46779e[_0x16da('0x82')](_0x1c4a60);}})['catch'](handleError(_0x46779e,null));};exports[_0x16da('0x85')]=function(_0x1fa3c2,_0x5c8658){var _0x30de1f=path[_0x16da('0x7c')](config[_0x16da('0x7d')],'server/files/images/avatars/customer_avatar.png');var _0x234c9e={'where':{'id':_0x1fa3c2[_0x16da('0x55')]['id']},'attributes':['id','customerAvatar',_0x16da('0x86')],'raw':!![]};return db[_0x16da('0x45')]['find'](_0x234c9e)[_0x16da('0x16')](handleEntityNotFound(_0x5c8658,null))[_0x16da('0x16')](function(_0x216061){if(_0x216061){if(!_[_0x16da('0x80')](_0x216061[_0x16da('0x87')])){if(fs[_0x16da('0x83')](path[_0x16da('0x7c')](config[_0x16da('0x7d')],'server/files/images/avatars/',_0x216061[_0x16da('0x87')]))&&_0x216061['showCustomerAvatar']){_0x30de1f=path[_0x16da('0x7c')](config[_0x16da('0x7d')],_0x16da('0x84'),_0x216061['customerAvatar']);}}return _0x5c8658[_0x16da('0x82')](_0x30de1f);}})[_0x16da('0x1e')](handleError(_0x5c8658,null));};exports[_0x16da('0x88')]=function(_0xc29fea,_0xb169e4){var _0x540991=path[_0x16da('0x7c')](config[_0x16da('0x7d')],_0x16da('0x89'));var _0x12b220={'where':{'id':_0xc29fea[_0x16da('0x55')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x16da('0x45')][_0x16da('0x5a')](_0x12b220)[_0x16da('0x16')](handleEntityNotFound(_0xb169e4,null))['then'](function(_0x1b2176){if(_0x1b2176){if(!_[_0x16da('0x80')](_0x1b2176['systemAvatar'])){if(fs['existsSync'](path[_0x16da('0x7c')](config['root'],_0x16da('0x84'),_0x1b2176['systemAvatar']))){_0x540991=path[_0x16da('0x7c')](config[_0x16da('0x7d')],_0x16da('0x84'),_0x1b2176[_0x16da('0x7a')]);}}return _0xb169e4['download'](_0x540991);}})[_0x16da('0x1e')](handleError(_0xb169e4,null));};function checkWebsiteInterval(_0x6b883f){var _0x7b129d=_0x6b883f['Interval'];if(!_0x7b129d){return Promise['resolve'](_0x6b883f);}var _0x23150e=_0x6b883f[_0x16da('0x8a')]||undefined;return _0x7b129d['ifTime'](_0x23150e)['then'](function(_0x5a239f){if(!_0x5a239f){throw new APIOutOfIntervalError();}return _0x6b883f;});}exports['notify']=function(_0x37cf88,_0x2a5c28){var _0x24bd55={'body':_0x37cf88[_0x16da('0x5c')],'channel':_0x16da('0x8b')};var _0x378795=[];var _0x467a50=[];var _0x23477f={};var _0x3d3314=![];if(_0x37cf88[_0x16da('0x5c')]['id']){delete _0x37cf88[_0x16da('0x5c')]['id'];}if(_[_0x16da('0x80')](_0x37cf88[_0x16da('0x5c')][_0x16da('0x8c')])){throw new APIBadRequestError(_0x16da('0x8d'));}if(_['isNil'](_0x37cf88[_0x16da('0x5c')][_0x16da('0x8e')])){throw new APIBadRequestError('MapKey\x20is\x20mandatory');}if(_[_0x16da('0x8f')](_0x37cf88[_0x16da('0x5c')][_0x16da('0x5c')])){throw new APIBadRequestError('Body\x20is\x20mandatory');}var _0x35ee4d=_0x37cf88['body']['customerIp']&&_0x37cf88[_0x16da('0x5c')][_0x16da('0x37')];return db[_0x16da('0x90')][_0x16da('0x64')]()['then'](function(_0x1686ab){if(!_0x1686ab){throw new Error(_0x16da('0x91'));}_0x378795=Object['keys'](_0x1686ab)[_0x16da('0x51')](function(_0xceea8){return!['createdAt',_0x16da('0x92')]['includes'](_0xceea8);});_0x467a50=Object[_0x16da('0x56')](_0x1686ab)[_0x16da('0x51')](function(_0x1be2e5){return!['createdAt','updatedAt',_0x16da('0x93'),_0x16da('0x94')][_0x16da('0x95')](_0x1be2e5);});if(!_['includes'](_0x467a50,_0x37cf88[_0x16da('0x5c')][_0x16da('0x8e')])){throw new APIBadRequestError('Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20'+_0x467a50[_0x16da('0x7c')](',\x20'));}_0x23477f[_0x37cf88[_0x16da('0x5c')][_0x16da('0x8e')]]=_0x37cf88[_0x16da('0x5c')][_0x16da('0x8c')];})['then'](function(){return db[_0x16da('0x45')][_0x16da('0x5a')]({'where':{'id':_0x37cf88[_0x16da('0x55')]['id']},'include':[{'model':db['CmList'],'as':_0x16da('0x96'),'include':[{'model':db[_0x16da('0x90')],'as':'Contacts','where':_0x23477f,'limit':0x1,'order':[[_0x16da('0x92'),_0x16da('0x97')]]}]},{'model':db[_0x16da('0x98')],'as':_0x16da('0x99')},{'model':db[_0x16da('0x9a')],'as':_0x16da('0x9a'),'include':[{'model':db[_0x16da('0x9a')],'as':_0x16da('0x9b'),'attributes':['id','interval'],'raw':!![]}]}]});})['then'](function(_0x2cd608){if(!_0x2cd608){throw new APINotFoundError(util[_0x16da('0x3a')](_0x16da('0x9c'),_0x37cf88[_0x16da('0x55')]['id']));}if(_0x35ee4d){return checkWebsiteInterval(_0x2cd608);}return _0x2cd608;})[_0x16da('0x16')](function(_0x27673e){_0x24bd55[_0x16da('0x9d')]=_0x27673e;_0x24bd55[_0x16da('0x9e')]=_[_0x16da('0x9f')](_0x27673e[_0x16da('0x99')],[_0x16da('0xa0')],[_0x16da('0xa1')]);if(_0x24bd55[_0x16da('0x9d')]['Applications']){delete _0x24bd55['account'][_0x16da('0x99')];}_0x24bd55['list']=_0x27673e[_0x16da('0x96')]||{'id':_0x27673e[_0x16da('0x94')]};if(_0x24bd55[_0x16da('0xa2')]&&_0x24bd55[_0x16da('0xa2')][_0x16da('0xa3')][_0x16da('0x58')]){return _0x24bd55['list']['Contacts'][0x0];}var _0x47eaf5=_[_0x16da('0xa4')](_0x37cf88[_0x16da('0x5c')],{'firstName':_0x37cf88[_0x16da('0x5c')][_0x16da('0x8c')],'ListId':_0x27673e[_0x16da('0x94')]});_0x47eaf5[_0x37cf88[_0x16da('0x5c')][_0x16da('0x8e')]]=_0x37cf88['body'][_0x16da('0x8c')];return db[_0x16da('0x90')][_0x16da('0x5b')](_0x47eaf5,{'fields':_0x378795,'raw':!![]});})[_0x16da('0x16')](function(_0x2b0778){_0x24bd55[_0x16da('0xa5')]=_0x2b0778;var _0x44cbbc=createInteractionObject(_0x37cf88[_0x16da('0x55')]['id'],_0x37cf88[_0x16da('0x5c')],_0x37cf88[_0x16da('0xa6')],_0x2b0778);var _0x5b5ee1={'ChatWebsiteId':_0x37cf88['params']['id']};if(_0x37cf88['body'][_0x16da('0xa7')]){_0x5b5ee1[_0x16da('0xa7')]=_0x37cf88[_0x16da('0x5c')][_0x16da('0xa7')];_0x5b5ee1[_0x16da('0xa8')]=![];return db[_0x16da('0xa9')]['find']({'where':_0x5b5ee1})[_0x16da('0x16')](function(_0x150be7){var _0x2b0a70=_0x37cf88[_0x16da('0x5c')][_0x16da('0x32')]&&_0x37cf88[_0x16da('0x5c')][_0x16da('0x37')];if(_0x150be7){_0x3d3314=!![];return _0x150be7;}else if(!_0x2b0a70&&_0x150be7&&_0x150be7[_0x16da('0xa8')]){throw new APIConflictError(_0x16da('0xaa'));}_0x44cbbc['threadId']=_0x37cf88[_0x16da('0x5c')][_0x16da('0xa7')];_0x44cbbc[_0x16da('0xab')]=_0x37cf88[_0x16da('0x5c')]['externalUrl'];return db['ChatInteraction'][_0x16da('0x5b')](_0x44cbbc);});}_0x5b5ee1[_0x16da('0xac')]=_0x2b0778['id'];if(_0x37cf88['body'][_0x16da('0xad')]&&_0x37cf88[_0x16da('0x5c')][_0x16da('0xad')]['id']){_0x5b5ee1['id']=_0x37cf88[_0x16da('0x5c')][_0x16da('0xad')]['id'];return db[_0x16da('0xa9')][_0x16da('0x5a')]({'where':_0x5b5ee1})['then'](function(_0x38659e){var _0x2f0bb9=_0x37cf88[_0x16da('0x5c')][_0x16da('0x32')]&&_0x37cf88[_0x16da('0x5c')]['referer'];if(!_0x2f0bb9&&_0x38659e&&_0x38659e['closed']){throw new APIConflictError('Writing\x20on\x20closed\x20interaction');}else if(_0x38659e){_0x3d3314=!![];return _0x38659e;}else{return db['ChatInteraction'][_0x16da('0x5b')](_0x44cbbc);}});}return db['ChatInteraction'][_0x16da('0x5b')](_0x44cbbc);})[_0x16da('0x16')](function(_0x17b9c5){if(!_0x3d3314){return _0x17b9c5;}var _0x31a5ec={'from':(_0x24bd55['contact']['firstName']||'')+'\x20'+(_0x24bd55['contact'][_0x16da('0x36')]||'')};if(_0x37cf88[_0x16da('0x5c')][_0x16da('0xa7')]&&_0x37cf88['body'][_0x16da('0xae')]&&_0x37cf88[_0x16da('0x5c')][_0x16da('0xa7')]!=_0x37cf88['body']['messageId']){_0x31a5ec[_0x16da('0xa7')]=_0x37cf88[_0x16da('0x5c')][_0x16da('0xae')];}return _0x17b9c5[_0x16da('0x29')](_0x31a5ec);})[_0x16da('0x16')](function(_0x207862){_0x24bd55[_0x16da('0xad')]=_0x207862[_0x16da('0x2b')]({'plain':!![]});_0x24bd55[_0x16da('0xad')][_0x16da('0xaf')]=!_0x3d3314;if(_0x24bd55[_0x16da('0xad')][_0x16da('0xaf')]){if(_0x24bd55[_0x16da('0x9d')][_0x16da('0xb0')]){_0x24bd55[_0x16da('0x9e')][_0x16da('0xb1')]({'id':0x0,'priority':_0x24bd55[_0x16da('0x9e')][_0x16da('0x58')]+0x1,'app':_0x16da('0xb2'),'appdata':_0x16da('0xb3'),'interval':_0x16da('0xb4')});}}return db[_0x16da('0xb5')][_0x16da('0x5b')]({'body':_0x37cf88['body'][_0x16da('0x5c')],'ChatWebsiteId':_0x37cf88['params']['id'],'ChatInteractionId':_0x207862['id'],'direction':'in','ContactId':_0x24bd55[_0x16da('0xa5')]['id'],'AttachmentId':_0x37cf88[_0x16da('0x5c')]['AttachmentId']});})[_0x16da('0x16')](function(_0x5cae74){_0x24bd55['message']=_0x5cae74;if(!_0x24bd55['interaction'][_0x16da('0xb6')]){return;}return db['User'][_0x16da('0x5a')]({'attributes':['id',_0x16da('0x2e')],'where':{'id':_0x24bd55[_0x16da('0xad')][_0x16da('0xb6')]}});})[_0x16da('0x16')](function(_0x332e55){if(_0x332e55){_0x24bd55[_0x16da('0x9e')][_0x16da('0xb7')]({'id':0x0,'priority':0x0,'app':_0x16da('0xb8'),'appdata':_0x332e55['name']+','+(_0x24bd55['account'][_0x16da('0xb9')]||0xa),'interval':_0x16da('0xb4')});_0x24bd55[_0x16da('0xba')]=!![];}if(!_0x24bd55[_0x16da('0xad')]['queueId']){return;}return db[_0x16da('0xbb')][_0x16da('0x5a')]({'attributes':['id',_0x16da('0x2e')],'where':{'id':_0x24bd55['interaction'][_0x16da('0xbc')]}});})['then'](function(_0x17e770){if(_0x17e770){_0x24bd55[_0x16da('0x9e')][_0x16da('0xb7')]({'id':0x0,'priority':0x1,'app':_0x16da('0xbd'),'appdata':_0x17e770[_0x16da('0x2e')]+','+(_0x24bd55[_0x16da('0x9d')][_0x16da('0xbe')]||0x12c),'interval':_0x16da('0xb4')});}return respondWithRpcPromise(_0x16da('0xbf'),_0x16da('0xc0'),_0x24bd55);})[_0x16da('0x16')](function(_0x323726){respondWithRpcPromise(_0x16da('0xc1'),_0x16da('0xc1'),{'event':_0x16da('0xc2'),'message':_0x323726},client9002);return _0x323726;})['then'](respondWithResult(_0x2a5c28,null))[_0x16da('0x1e')](APIHandleError(_0x2a5c28));};exports['offline']=function(_0x1a9083,_0x3621b5){var _0x212f8e,_0x59b0a9,_0x1094b9;var _0x5927a8=[];var _0x730b5b={};var _0x530d09=_0x1a9083['files']||[];var _0x4660a0=[];var _0x184688;return db[_0x16da('0x90')]['describe']()['then'](function(_0x1920c8){if(!_0x1920c8){throw new db['Sequelize'][(_0x16da('0xc3'))](_0x16da('0xc4'));}_0x5927a8=_['difference'](_['keys'](_0x1920c8),[_0x16da('0xc5'),_0x16da('0x92'),_0x16da('0x93'),'ListId']);if(_0x1a9083[_0x16da('0x5c')]['id']){delete _0x1a9083[_0x16da('0x5c')]['id'];}if(_[_0x16da('0x80')](_0x1a9083[_0x16da('0x5c')][_0x16da('0x8c')])){throw _0x3621b5[_0x16da('0x20')](0x1f4)[_0x16da('0x2f')](new db[(_0x16da('0xc6'))][(_0x16da('0xc3'))](_0x16da('0xc7')));}if(_[_0x16da('0x80')](_0x1a9083['body'][_0x16da('0x5c')])||_0x1a9083['body']['body']===''){throw _0x3621b5[_0x16da('0x20')](0x1f4)[_0x16da('0x2f')](new db['Sequelize'][(_0x16da('0xc3'))](_0x16da('0xc8')));}if(_[_0x16da('0x80')](_0x1a9083[_0x16da('0x5c')][_0x16da('0xc9')])){throw _0x3621b5[_0x16da('0x20')](0x1f4)['send'](new db[(_0x16da('0xc6'))]['ValidationError'](_0x16da('0xca')+_0x5927a8));}if(!_[_0x16da('0x95')](_0x5927a8,_0x1a9083[_0x16da('0x5c')]['mapKeyOffline'])){throw _0x3621b5['status'](0x1f4)[_0x16da('0x2f')](new db[(_0x16da('0xc6'))][(_0x16da('0xc3'))](_0x16da('0xcb')+_0x5927a8));}_0x730b5b[_0x1a9083[_0x16da('0x5c')]['mapKeyOffline']]=_0x1a9083[_0x16da('0x5c')][_0x16da('0x8c')];})[_0x16da('0x16')](function(){return db[_0x16da('0x45')][_0x16da('0x5a')]({'where':{'id':_0x1a9083[_0x16da('0x55')]['id']},'include':[{'model':db[_0x16da('0xcc')],'as':'List'},{'model':db['MailAccount'],'as':'MailAccount'}]});})[_0x16da('0x16')](handleEntityNotFound(_0x3621b5,null))[_0x16da('0x16')](function(_0x2ebce1){if(_0x2ebce1&&_0x2ebce1['List']){_0x59b0a9=_0x2ebce1;var _0x22d9be=_[_0x16da('0xa4')](_0x1a9083[_0x16da('0x5c')],{'firstName':_0x1a9083[_0x16da('0x5c')][_0x16da('0x8c')],'phone':_0x1a9083[_0x16da('0x5c')][_0x16da('0x8c')],'ListId':_0x2ebce1[_0x16da('0x94')]});_0x22d9be[_0x1a9083[_0x16da('0x5c')][_0x16da('0xc9')]]=_0x1a9083['body'][_0x16da('0x8c')];return db[_0x16da('0x90')][_0x16da('0xcd')]({'where':_0x730b5b,'defaults':_0x22d9be});}})[_0x16da('0xce')](function(_0x17db2b){if(_0x17db2b){_0x1094b9=_0x17db2b;var _0x3208bf=fs['readFileSync'](path[_0x16da('0x7c')](config['root'],_0x16da('0xcf')),_0x16da('0xd0'));var _0x303934=ejs[_0x16da('0xd1')](_0x3208bf,{'body':_['toPairs'](_0x1a9083[_0x16da('0x5c')][_0x16da('0x5c')]),'bodyTitle':_0x59b0a9[_0x16da('0xd2')]});return db[_0x16da('0xd3')][_0x16da('0x5b')]({'body':_0x303934,'plainBody':htmlToText['fromString'](_0x303934),'ContactId':_0x17db2b['id'],'ChatWebsiteId':_0x59b0a9['id']});}})[_0x16da('0x16')](function(_0x1801cb){_0x184688=_0x1801cb;if(_0x530d09[_0x16da('0x58')]){var _0x1ab4e6=_0x530d09[_0x16da('0x44')](function(_0x26d2df){return{'name':_0x26d2df[_0x16da('0xd4')],'basename':_0x26d2df['filename'],'type':_0x26d2df[_0x16da('0xd5')],'ChatOfflineMessageId':_0x1801cb['id']};});_0x4660a0=_0x1ab4e6[_0x16da('0x44')](_0x1442e5=>{var _0x2b2267={'filename':_0x1442e5[_0x16da('0x2e')],'path':path['join'](config[_0x16da('0x7d')],_0x16da('0xd6'),_0x16da('0xd7'),_0x16da('0xd8'),_0x16da('0xd9'),_0x1442e5[_0x16da('0xda')])};return _0x2b2267;});if(!_0x59b0a9[_0x16da('0xdb')]){return db['sequelize'][_0x16da('0xdc')](function(_0xfda2a2){return db[_0x16da('0xdd')][_0x16da('0xde')](_0x1ab4e6,{'transaction':_0xfda2a2});});}}})[_0x16da('0x16')](function(){if(_0x184688){_0x212f8e=_0x184688;return db[_0x16da('0xdf')][_0x16da('0x67')]({'where':{'service':!![]},'include':[{'model':db[_0x16da('0xe0')],'as':_0x16da('0xe1'),'raw':!![],'include':[{'model':db[_0x16da('0xe2')],'as':_0x16da('0xe2'),'raw':!![]}]}]});}})[_0x16da('0x16')](function(_0x211df3){if(_0x211df3&&_0x211df3[_0x16da('0xe1')]&&_0x59b0a9['forwardOffline']&&_0x59b0a9[_0x16da('0xe3')]){var _0x4fb7fb=_0x211df3[_0x16da('0xe4')]();return respondWithRpcPromise(_0x16da('0xe5'),'sendMail',{'account':_0x4fb7fb,'message':{'from':util[_0x16da('0x3a')](_0x16da('0xe6'),_0x211df3[_0x16da('0x2e')],_0x211df3[_0x16da('0xe7')]||_0x211df3[_0x16da('0xe1')]['user']),'to':_0x59b0a9[_0x16da('0xe3')],'subject':_0x59b0a9[_0x16da('0xe8')],'html':_0x212f8e[_0x16da('0x5c')],'attachments':_0x4660a0}},client9003)[_0x16da('0x16')](function(){return _0x212f8e;})[_0x16da('0x1e')](function(_0x445a4f){logger[_0x16da('0x1a')](_0x445a4f);});}})[_0x16da('0x16')](function(){if(_0x59b0a9&&_0x59b0a9['openNewInteraction']&&_0x59b0a9[_0x16da('0xe9')]){var _0x494a90=[];if(_0x530d09[_0x16da('0x58')]){_0x494a90=_0x530d09['map'](function(_0x5b3a84){return{'name':_0x5b3a84[_0x16da('0xd4')],'basename':_0x5b3a84[_0x16da('0x74')],'type':_0x5b3a84[_0x16da('0xd5')],'ChatOfflineMessageId':_0x184688['id']};});}var _0x1b5b46;if(!_[_0x16da('0x80')](_0x59b0a9[_0x16da('0xea')])){var _0x4cbc1e=_['map'](_0x1a9083['body'],function(_0x25fc59){return _0x25fc59;});var _0x57527a=_['toPairsIn'](_0x4cbc1e)[0x0];var _0x4c456b=_[_0x16da('0xeb')](_0x57527a,function(_0x55e26c){return _0x55e26c;});_0x1b5b46=_0x4c456b[0x1][_0x59b0a9[_0x16da('0xea')]];}var _0x2356b5={'from':_0x1094b9[_0x16da('0xe7')],'firstName':_0x1094b9['firstName'],'lastName':_0x1094b9['lastName'],'mapKey':_0x16da('0xe7'),'message':{'from':_0x1094b9[_0x16da('0xe7')],'to':_0x59b0a9[_0x16da('0xdf')]['email'],'cc':'','subject':_[_0x16da('0x80')](_0x1b5b46)?_0x59b0a9[_0x16da('0xe8')]:_0x1b5b46,'messageId':'','sentAt':new Date(),'attach':_0x494a90[_0x16da('0x58')],'attachments':_0x494a90,'originChannel':_0x16da('0xec'),'ChatWebsiteId':_0x59b0a9['id'],'ChatOfflineMessageId':_0x212f8e['id'],'originTo':_0x59b0a9[_0x16da('0xdf')]['email']},'body':_0x212f8e[_0x16da('0x5c')]};var _0x4ecaed={'account':{'id':_0x59b0a9['MailAccountId']},'body':_0x2356b5,'log':_0x16da('0xed')};return respondWithRpcPromise(_0x16da('0xed'),'notifyMail',_0x4ecaed,client9001)[_0x16da('0x16')](function(){return _0x212f8e;})[_0x16da('0x1e')](function(_0xf87b1c){logger['error'](_0xf87b1c);});}return;})[_0x16da('0x16')](function(){if(_0x212f8e){return _0x212f8e;}})[_0x16da('0x16')](respondWithResult(_0x3621b5,null))[_0x16da('0x1e')](function(){for(var _0x10d143 of _0x530d09){var _0x36270c=path[_0x16da('0x7c')](config[_0x16da('0x7d')],_0x16da('0xd6'),_0x16da('0xd7'),_0x16da('0xd8'),'offline-chat',_0x10d143[_0x16da('0x74')]);fs_extra['remove'](_0x36270c)[_0x16da('0x1e')](function(_0x1a2eb1){logger[_0x16da('0x1a')](_0x16da('0xee'),_0x36270c,_0x1a2eb1);});}});};exports['addInteraction']=function(_0x562f8b,_0x3fea51){return db[_0x16da('0xa9')][_0x16da('0x5a')]({'where':{'id':_0x562f8b[_0x16da('0x55')]['id']}})[_0x16da('0x16')](handleEntityNotFound(_0x3fea51,null))['then'](function(_0x573500){if(_0x573500){return _0x573500[_0x16da('0xef')](_0x562f8b[_0x16da('0x5c')][_0x16da('0x6d')],_['omit'](_0x562f8b[_0x16da('0x5c')],[_0x16da('0x6d'),'id'])||{});}})[_0x16da('0x16')](respondWithResult(_0x3fea51,null))[_0x16da('0x1e')](handleError(_0x3fea51,null));};exports[_0x16da('0xf0')]=function(_0x2b8fec,_0x51eec7){var _0x507c99={'raw':![],'where':{}};var _0xaadc19={};var _0x247f29={'count':0x0,'rows':[]};return db[_0x16da('0x45')][_0x16da('0x67')]({'where':{'id':_0x2b8fec['params']['id']}})['then'](handleEntityNotFound(_0x51eec7,null))[_0x16da('0x16')](function(_0x1cd15d){if(_0x1cd15d){_0xaadc19[_0x16da('0x3e')]=_[_0x16da('0x56')](db[_0x16da('0xa9')][_0x16da('0x69')]);_0xaadc19[_0x16da('0x47')]=_['keys'](_0x2b8fec[_0x16da('0x47')]);_0xaadc19[_0x16da('0x48')]=_[_0x16da('0x57')](_0xaadc19[_0x16da('0x3e')],_0xaadc19[_0x16da('0x47')]);_0x507c99[_0x16da('0x49')]=_[_0x16da('0x57')](_0xaadc19[_0x16da('0x3e')],qs['fields'](_0x2b8fec[_0x16da('0x47')][_0x16da('0x4a')]));_0x507c99['attributes']=_0x507c99[_0x16da('0x49')][_0x16da('0x58')]?_0x507c99[_0x16da('0x49')]:_0xaadc19['model'];if(!_0x2b8fec[_0x16da('0x47')][_0x16da('0x4b')](_0x16da('0x6a'))){_0x507c99[_0x16da('0x26')]=qs[_0x16da('0x26')](_0x2b8fec[_0x16da('0x47')][_0x16da('0x26')]);_0x507c99['offset']=qs[_0x16da('0x23')](_0x2b8fec[_0x16da('0x47')]['offset']);}_0x507c99[_0x16da('0x4c')]=qs['sort'](_0x2b8fec[_0x16da('0x47')]['sort']);_0x507c99[_0x16da('0x4e')]=qs[_0x16da('0x48')](_[_0x16da('0x4f')](_0x2b8fec[_0x16da('0x47')],_0xaadc19[_0x16da('0x48')]));_0x507c99[_0x16da('0x4e')]['ChatWebsiteId']=_0x1cd15d['id'];if(_0x2b8fec['query']['filter']){_0x507c99[_0x16da('0x4e')]=_[_0x16da('0x50')](_0x507c99[_0x16da('0x4e')],{'$or':_[_0x16da('0x44')](_0x507c99[_0x16da('0x49')],function(_0x573d96){var _0x3507de={};_0x3507de[_0x573d96]={'$like':'%'+_0x2b8fec[_0x16da('0x47')][_0x16da('0x51')]+'%'};return _0x3507de;})});}_0x507c99=_[_0x16da('0x50')]({},_0x507c99,_0x2b8fec[_0x16da('0x6b')]);return db[_0x16da('0xa9')][_0x16da('0x25')]({'where':_0x507c99[_0x16da('0x4e')]})['then'](function(_0x49602f){_0x247f29[_0x16da('0x25')]=_0x49602f;if(_0x2b8fec['query'][_0x16da('0x59')]){_0x507c99['include']=[{'model':db[_0x16da('0x90')],'as':_0x16da('0xf1'),'required':![]},{'model':db['User'],'as':_0x16da('0xf2'),'attributes':[_0x16da('0x2e'),_0x16da('0xf3'),_0x16da('0xf4')],'required':![]},{'model':db[_0x16da('0xf5')],'as':_0x16da('0xf6'),'attributes':['id','name',_0x16da('0xf7')],'where':_0x2b8fec[_0x16da('0x47')][_0x16da('0xf8')]?{'id':_0x2b8fec[_0x16da('0x47')]['tag']}:undefined,'required':_0x2b8fec[_0x16da('0x47')][_0x16da('0xf8')]?!![]:![]}];}return db[_0x16da('0xa9')][_0x16da('0x71')](_0x507c99);})[_0x16da('0x16')](function(_0x3db9bd){_0x247f29['rows']=_0x3db9bd;return _0x247f29;});}})[_0x16da('0x16')](respondWithFilteredResult(_0x51eec7,_0x507c99))[_0x16da('0x1e')](handleError(_0x51eec7,null));};exports[_0x16da('0xf9')]=function(_0xc793a7,_0x556acb){var _0x49cbc8=0x0;var _0x2b6583=0x0;var _0x2ba770=![];var _0xb55041;var _0x30e468;return db[_0x16da('0x45')]['find']({'where':{'id':_0xc793a7[_0x16da('0x55')]['id']},'include':[{'model':db['Interval'],'as':_0x16da('0x9a'),'include':[{'model':db[_0x16da('0x9a')],'as':'Intervals','attributes':['id',_0x16da('0xfa')]}]}]})[_0x16da('0x16')](handleEntityNotFound(_0x556acb,null))['then'](function(_0x386ce6){if(_0x386ce6){_0xb55041=_0x386ce6;return _0x386ce6[_0x16da('0xfb')]({'raw':!![]});}})['then'](function(_0x3175c4){if(_0xb55041){if(_0x3175c4){_0x30e468=_0x3175c4;}}return require(_0x16da('0x7e'))[_0x16da('0xfc')]();})[_0x16da('0x16')](function(_0x3c9aa5){if(_0x3c9aa5){_0x2b6583=_0x3c9aa5[_0x16da('0xfd')];_0x2ba770=_0x3c9aa5[_0x16da('0x7f')];}})[_0x16da('0x16')](function(){return db[_0x16da('0xa9')][_0x16da('0x25')]({'where':{'closed':![]}});})[_0x16da('0x16')](function(_0x53a80b){_0x49cbc8=_0x53a80b;if(_0x2b6583&&_0x53a80b>_0x2b6583){return db[_0x16da('0xfe')][_0x16da('0x67')]({'where':{'id':0x1}})[_0x16da('0x16')](function(_0xe0c81d){if(_0xe0c81d){_0xe0c81d['increment'](_0x16da('0xff'));}});}})[_0x16da('0x16')](function(){var _0x5c9a94=_0xb55041[_0x16da('0x9a')];var _0x48f312=_0xb55041[_0x16da('0x8a')]||undefined;return _0x5c9a94?_0x5c9a94[_0x16da('0x100')](_0x48f312):!![];})['then'](function(_0x5ca2b5){var _0x432b87=fs[_0x16da('0x101')](path[_0x16da('0x7c')](config[_0x16da('0x7d')],_0x16da('0x102')),_0x16da('0xd0'));var _0x148f8e=_0x16da('0x103');var _0x2309cb=![];try{const _0x5f24f3=new URL(_0xb55041[_0x16da('0x5d')]);_0xb55041[_0x16da('0x5d')]=_0x5f24f3[_0x16da('0x104')];}catch(_0x3bf89b){}var _0x2af174;if(_0xc793a7[_0x16da('0xa6')][_0x16da('0x37')]){_0xc793a7[_0x16da('0xa6')][_0x16da('0x37')]=_0xc793a7[_0x16da('0xa6')][_0x16da('0x37')][_0x16da('0x105')](/\/$/,'');_0x2af174=wildcardUtils['testWebsiteWithWildcard'](_0xb55041[_0x16da('0x5d')],_0xc793a7['headers'][_0x16da('0x37')]);}else{_0xc793a7[_0x16da('0xa6')][_0x16da('0x37')]=_0xb55041['address'];_0x2af174=!![];}var _0x2cc33d={'chatVersion':_0x148f8e,'chatWebsiteAddressOrigin':_0x2af174?_0xc793a7[_0x16da('0xa6')]['referer']:_0xb55041[_0x16da('0x5d')],'remote':_0xb55041['remote'],'query':querystring[_0x16da('0x41')](_[_0x16da('0x50')](_0xb55041[_0x16da('0x2b')]({'plain':!![]}),{'customerIp':_0xc793a7[_0x16da('0xa6')]['x-forwarded-for']||_0xc793a7[_0x16da('0xa6')][_0x16da('0x106')]||_0xc793a7[_0x16da('0x107')][_0x16da('0x108')]||_0xc793a7['ip'],'referer':_0xc793a7[_0x16da('0xa6')][_0x16da('0x37')],'openedInteractions':_0x49cbc8,'maxInteractions':_0x2b6583,'virtual':_0x2ba770[_0x16da('0xfd')],'online':_0x5ca2b5,'custom':_0x2ba770,'address':_0x2af174?_0xc793a7[_0x16da('0xa6')][_0x16da('0x37')]:null}))[_0x16da('0x105')](/'/g,'\x5c\x27')};_0x556acb['send'](ejs[_0x16da('0xd1')](Mustache[_0x16da('0xd1')](_0x432b87,_0x2cc33d),{'proactiveActions':_0x30e468,'alignment':_0xb55041['alignment'],'verticalAlignment':_0xb55041[_0x16da('0x109')],'div_color':_0xb55041['color'],'labelText':_0xb55041['labelText'],'text_color':_0xb55041[_0x16da('0x10a')],'text_button_color':_0xb55041[_0x16da('0x10b')],'button_color':_0xb55041['color_button'],'background_color':_0xb55041[_0x16da('0x10c')],'hideWhenOffline':_0xb55041['hideWhenOffline'],'intervalId':_0xb55041['IntervalId'],'isDevelopment':_0x2309cb,'chatVersion':_0x148f8e}));})[_0x16da('0x1e')](handleError(_0x556acb,null));};exports[_0x16da('0x10d')]=function(_0x36b59f,_0x5c6f79){var _0xa9c85b=_0x36b59f[_0x16da('0x55')]['id'];var _0xeeb14a=_0x36b59f[_0x16da('0x5c')];var _0x5484bb=0xc8;var _0x15b144=null;return db[_0x16da('0x10e')][_0x16da('0xdc')]({'isolationLevel':db[_0x16da('0x10e')][_0x16da('0x10f')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x26c40c){return db[_0x16da('0x45')][_0x16da('0x67')]({'where':{'id':_0xa9c85b},'transaction':_0x26c40c})[_0x16da('0x16')](function(_0x470a39){if(_0x470a39){return db[_0x16da('0x98')][_0x16da('0x2a')]({'where':{'ChatWebsiteId':_0xa9c85b},'transaction':_0x26c40c})['then'](function(){var _0x7a8770=_[_0x16da('0x44')](_0xeeb14a,function(_0x5b8ebe){_0x5b8ebe[_0x16da('0x65')]=_0xa9c85b;return _0x5b8ebe;});return db[_0x16da('0x98')]['bulkCreate'](_0x7a8770,{'transaction':_0x26c40c});});}else{_0x5484bb=0x194;_0x15b144=[];}});})[_0x16da('0x16')](function(){if(_0x5484bb!==0x194){return db[_0x16da('0x98')][_0x16da('0x110')]({'where':{'ChatWebsiteId':_0xa9c85b},'order':_0x16da('0xa0')})[_0x16da('0x16')](function(_0x53b11c){_0x15b144=_0x53b11c;});}})[_0x16da('0x1e')](function(_0x44dec6){_0x5484bb=0x1f4;logger['error'](_0x44dec6[_0x16da('0x111')]);if(_0x44dec6['name']){delete _0x44dec6[_0x16da('0x2e')];}_0x15b144=_0x44dec6;})[_0x16da('0x112')](function(){if(_0x15b144===null){_0x5c6f79[_0x16da('0x1f')](_0x5484bb);}else{if(_0x5484bb===0x1f4){_0x5c6f79['status'](_0x5484bb)[_0x16da('0x2f')](_0x15b144);}else{_0x5c6f79[_0x16da('0x20')](_0x5484bb)[_0x16da('0x22')](_0x15b144);}}});};exports[_0x16da('0x113')]=function(_0x5d574d,_0x3f6391){var _0xdfd4d8={};var _0x47d0a1={};var _0x1efa72;var _0x5666ed;return db[_0x16da('0x45')][_0x16da('0x67')]({'where':{'id':_0x5d574d[_0x16da('0x55')]['id']}})[_0x16da('0x16')](handleEntityNotFound(_0x3f6391,null))['then'](function(_0x5ed086){if(_0x5ed086){_0x1efa72=_0x5ed086;_0x47d0a1[_0x16da('0x3e')]=_[_0x16da('0x56')](db['ChatApplication']['rawAttributes']);_0x47d0a1['query']=_[_0x16da('0x56')](_0x5d574d[_0x16da('0x47')]);_0x47d0a1[_0x16da('0x48')]=_[_0x16da('0x57')](_0x47d0a1[_0x16da('0x3e')],_0x47d0a1[_0x16da('0x47')]);_0xdfd4d8[_0x16da('0x49')]=_[_0x16da('0x57')](_0x47d0a1['model'],qs[_0x16da('0x4a')](_0x5d574d[_0x16da('0x47')][_0x16da('0x4a')]));_0xdfd4d8[_0x16da('0x49')]=_0xdfd4d8[_0x16da('0x49')]['length']?_0xdfd4d8[_0x16da('0x49')]:_0x47d0a1['model'];_0xdfd4d8['order']=qs[_0x16da('0x4d')](_0x5d574d[_0x16da('0x47')][_0x16da('0x4d')]);_0xdfd4d8['where']=qs['filters'](_[_0x16da('0x4f')](_0x5d574d[_0x16da('0x47')],_0x47d0a1[_0x16da('0x48')]));if(_0x5d574d[_0x16da('0x47')][_0x16da('0x51')]){_0xdfd4d8[_0x16da('0x4e')]=_[_0x16da('0x50')](_0xdfd4d8[_0x16da('0x4e')],{'$or':_[_0x16da('0x44')](_0xdfd4d8['attributes'],function(_0x4ba57b){var _0x5c5f33={};_0x5c5f33[_0x4ba57b]={'$like':'%'+_0x5d574d[_0x16da('0x47')]['filter']+'%'};return _0x5c5f33;})});}_0xdfd4d8=_['merge']({},_0xdfd4d8,_0x5d574d['options']);return _0x1efa72[_0x16da('0x113')](_0xdfd4d8);}})['then'](function(_0x1a0e89){if(_0x1a0e89){_0x5666ed=_0x1a0e89[_0x16da('0x58')];if(!_0x5d574d[_0x16da('0x47')][_0x16da('0x4b')](_0x16da('0x6a'))){_0xdfd4d8['limit']=qs[_0x16da('0x26')](_0x5d574d[_0x16da('0x47')][_0x16da('0x26')]);_0xdfd4d8[_0x16da('0x23')]=qs[_0x16da('0x23')](_0x5d574d[_0x16da('0x47')][_0x16da('0x23')]);}return _0x1efa72['getApplications'](_0xdfd4d8);}})[_0x16da('0x16')](function(_0x2f0952){if(_0x2f0952){return _0x2f0952?{'count':_0x5666ed,'rows':_0x2f0952}:null;}})[_0x16da('0x16')](respondWithResult(_0x3f6391,null))[_0x16da('0x1e')](handleError(_0x3f6391,null));};exports['addProactiveActions']=function(_0x5548cf,_0x42f2a3){return db[_0x16da('0x114')][_0x16da('0x5a')]({'where':{'id':_0x5548cf[_0x16da('0x55')]['id']}})[_0x16da('0x16')](handleEntityNotFound(_0x42f2a3,null))[_0x16da('0x16')](function(_0x53f3d7){if(_0x53f3d7){return _0x53f3d7[_0x16da('0x115')](_0x5548cf['body']['ids'],_[_0x16da('0x116')](_0x5548cf[_0x16da('0x5c')],[_0x16da('0x6d'),'id'])||{});}})['then'](respondWithResult(_0x42f2a3,null))[_0x16da('0x1e')](handleError(_0x42f2a3,null));};exports['getProactiveActions']=function(_0x1b75c1,_0x303d8f){var _0x5b4f8d={};var _0x44eac3={};var _0x13ca56;var _0x53232b;return db['ChatWebsite'][_0x16da('0x67')]({'where':{'id':_0x1b75c1[_0x16da('0x55')]['id']}})[_0x16da('0x16')](handleEntityNotFound(_0x303d8f,null))[_0x16da('0x16')](function(_0x287c52){if(_0x287c52){_0x13ca56=_0x287c52;_0x44eac3[_0x16da('0x3e')]=_[_0x16da('0x56')](db[_0x16da('0x117')][_0x16da('0x69')]);_0x44eac3[_0x16da('0x47')]=_[_0x16da('0x56')](_0x1b75c1[_0x16da('0x47')]);_0x44eac3[_0x16da('0x48')]=_[_0x16da('0x57')](_0x44eac3[_0x16da('0x3e')],_0x44eac3[_0x16da('0x47')]);_0x5b4f8d[_0x16da('0x49')]=_['intersection'](_0x44eac3[_0x16da('0x3e')],qs[_0x16da('0x4a')](_0x1b75c1[_0x16da('0x47')][_0x16da('0x4a')]));_0x5b4f8d['attributes']=_0x5b4f8d[_0x16da('0x49')][_0x16da('0x58')]?_0x5b4f8d[_0x16da('0x49')]:_0x44eac3['model'];_0x5b4f8d['order']=qs['sort'](_0x1b75c1[_0x16da('0x47')][_0x16da('0x4d')]);_0x5b4f8d[_0x16da('0x4e')]=qs[_0x16da('0x48')](_[_0x16da('0x4f')](_0x1b75c1['query'],_0x44eac3['filters']));if(_0x1b75c1['query'][_0x16da('0x51')]){_0x5b4f8d[_0x16da('0x4e')]=_[_0x16da('0x50')](_0x5b4f8d[_0x16da('0x4e')],{'$or':_[_0x16da('0x44')](_0x5b4f8d[_0x16da('0x49')],function(_0x49a468){var _0x54c619={};_0x54c619[_0x49a468]={'$like':'%'+_0x1b75c1[_0x16da('0x47')][_0x16da('0x51')]+'%'};return _0x54c619;})});}_0x5b4f8d=_[_0x16da('0x50')]({},_0x5b4f8d,_0x1b75c1['options']);return _0x13ca56['getProactiveActions'](_0x5b4f8d);}})[_0x16da('0x16')](function(_0x252093){if(_0x252093){_0x53232b=_0x252093[_0x16da('0x58')];if(!_0x1b75c1[_0x16da('0x47')]['hasOwnProperty'](_0x16da('0x6a'))){_0x5b4f8d[_0x16da('0x26')]=qs[_0x16da('0x26')](_0x1b75c1['query'][_0x16da('0x26')]);_0x5b4f8d[_0x16da('0x23')]=qs['offset'](_0x1b75c1[_0x16da('0x47')]['offset']);}return _0x13ca56['getProactiveActions'](_0x5b4f8d);}})['then'](function(_0x2fb8f7){if(_0x2fb8f7){return _0x2fb8f7?{'count':_0x53232b,'rows':_0x2fb8f7}:null;}})[_0x16da('0x16')](respondWithResult(_0x303d8f,null))[_0x16da('0x1e')](handleError(_0x303d8f,null));};exports[_0x16da('0x118')]=function(_0x1e1212,_0xc86d7c){var _0x9edd52=_0x1e1212[_0x16da('0x47')][_0x16da('0x119')]===_0x16da('0x11a')?_0x16da('0x11b'):'onlineForm';return db[_0x16da('0x45')][_0x16da('0x5a')]({'attributes':['id',_0x9edd52],'where':{'id':_0x1e1212['params']['id']}})[_0x16da('0x16')](handleEntityNotFound(_0xc86d7c,null))['then'](function(_0x416b9c){if(_0x416b9c){var _0x5baf74=_0x416b9c[_0x9edd52];var _0x2c7765=_0x5baf74&&_0x5baf74[_0x16da('0x11c')]?_0x5baf74[_0x16da('0x11c')]:[];_0xc86d7c[_0x16da('0x2f')]({'fromKey':_['isNil'](_0x5baf74[_0x16da('0x11d')])?undefined:_0x5baf74['fromKey'],'count':_0x2c7765[_0x16da('0x58')],'rows':_0x2c7765});}})[_0x16da('0x1e')](handleError(_0xc86d7c,null));};exports[_0x16da('0x11e')]=function(_0x1afbf4,_0x416b15){var _0x38276f={'raw':![],'where':{}};var _0x2525ed={};var _0xd8ecab={'count':0x0,'rows':[]};return db[_0x16da('0x45')][_0x16da('0x67')]({'where':{'id':_0x1afbf4[_0x16da('0x55')]['id']}})[_0x16da('0x16')](handleEntityNotFound(_0x416b15,null))[_0x16da('0x16')](function(_0x16f970){if(_0x16f970){_0x2525ed[_0x16da('0x3e')]=_[_0x16da('0x56')](db['ChatOfflineMessage']['rawAttributes']);_0x2525ed[_0x16da('0x47')]=_[_0x16da('0x56')](_0x1afbf4[_0x16da('0x47')]);_0x2525ed[_0x16da('0x48')]=_[_0x16da('0x57')](_0x2525ed[_0x16da('0x3e')],_0x2525ed[_0x16da('0x47')]);_0x38276f[_0x16da('0x49')]=_['intersection'](_0x2525ed['model'],qs['fields'](_0x1afbf4[_0x16da('0x47')]['fields']));_0x38276f[_0x16da('0x49')]=_0x38276f[_0x16da('0x49')][_0x16da('0x58')]?_0x38276f['attributes']:_0x2525ed[_0x16da('0x3e')];if(!_0x1afbf4[_0x16da('0x47')]['hasOwnProperty'](_0x16da('0x6a'))){_0x38276f[_0x16da('0x26')]=qs[_0x16da('0x26')](_0x1afbf4[_0x16da('0x47')][_0x16da('0x26')]);_0x38276f['offset']=qs[_0x16da('0x23')](_0x1afbf4['query'][_0x16da('0x23')]);}_0x38276f[_0x16da('0x4c')]=qs[_0x16da('0x4d')](_0x1afbf4['query'][_0x16da('0x4d')]);_0x38276f[_0x16da('0x4e')]=qs[_0x16da('0x48')](_[_0x16da('0x4f')](_0x1afbf4[_0x16da('0x47')],_0x2525ed[_0x16da('0x48')]));_0x38276f[_0x16da('0x4e')][_0x16da('0x65')]=_0x16f970['id'];if(_0x1afbf4[_0x16da('0x47')][_0x16da('0x51')]){_0x38276f[_0x16da('0x4e')]=_[_0x16da('0x50')](_0x38276f[_0x16da('0x4e')],{'$or':_[_0x16da('0x44')](_0x38276f[_0x16da('0x49')],function(_0x1021f1){var _0x503f66={};_0x503f66[_0x1021f1]={'$like':'%'+_0x1afbf4[_0x16da('0x47')]['filter']+'%'};return _0x503f66;})});}_0x38276f=_[_0x16da('0x50')]({},_0x38276f,_0x1afbf4[_0x16da('0x6b')]);return db[_0x16da('0xd3')][_0x16da('0x25')]({'where':_0x38276f[_0x16da('0x4e')]})[_0x16da('0x16')](function(_0x4d4f38){_0xd8ecab[_0x16da('0x25')]=_0x4d4f38;if(_0x1afbf4['query'][_0x16da('0x59')]){_0x38276f[_0x16da('0x52')]=[{'all':!![]}];}else{_0x38276f[_0x16da('0x52')]=[{'model':db[_0x16da('0x90')],'as':_0x16da('0xf1'),'required':![]},{'model':db[_0x16da('0xdd')],'as':_0x16da('0x11f'),'required':![]}];}return db[_0x16da('0xd3')][_0x16da('0x71')](_0x38276f);})[_0x16da('0x16')](function(_0x5bdab3){_0xd8ecab['rows']=_0x5bdab3;return _0xd8ecab;});}})[_0x16da('0x16')](respondWithFilteredResult(_0x416b15,_0x38276f))[_0x16da('0x1e')](handleError(_0x416b15,null));};exports[_0x16da('0x120')]=function(_0x194288,_0x5bcd44){return db['ChatWebsite'][_0x16da('0x5a')]({'where':{'id':_0x194288[_0x16da('0x55')]['id']}})[_0x16da('0x16')](handleEntityNotFound(_0x5bcd44,null))[_0x16da('0x16')](function(_0x281167){if(_0x281167){return _0x281167['addAgents'](_0x194288['body']['ids'],_[_0x16da('0x116')](_0x194288[_0x16da('0x5c')],[_0x16da('0x6d'),'id'])||{})[_0x16da('0xce')](function(_0xe48bd9){for(var _0xf1aeda=0x0;_0xf1aeda<_0x194288[_0x16da('0x5c')][_0x16da('0x6d')][_0x16da('0x58')];_0xf1aeda+=0x1){socket[_0x16da('0x121')](_0x16da('0x122'),{'UserId':Number(_0x194288['body'][_0x16da('0x6d')][_0xf1aeda]),'ChatWebsiteId':Number(_0x194288[_0x16da('0x55')]['id'])});}return _0xe48bd9;});}})[_0x16da('0x16')](respondWithResult(_0x5bcd44,null))['catch'](handleError(_0x5bcd44,null));};exports['removeAgents']=function(_0x565654,_0x500c30){return db['ChatWebsite'][_0x16da('0x5a')]({'where':{'id':_0x565654['params']['id']}})[_0x16da('0x16')](handleEntityNotFound(_0x500c30,null))[_0x16da('0x16')](function(_0x497703){if(_0x497703){return _0x497703[_0x16da('0x123')](_0x565654[_0x16da('0x47')][_0x16da('0x6d')])[_0x16da('0x16')](function(){if(_[_0x16da('0x124')](_0x565654[_0x16da('0x47')][_0x16da('0x6d')])){for(var _0x3fb7f1=0x0;_0x3fb7f1<_0x565654['query'][_0x16da('0x6d')][_0x16da('0x58')];_0x3fb7f1+=0x1){socket[_0x16da('0x121')](_0x16da('0x125'),{'UserId':Number(_0x565654['query'][_0x16da('0x6d')][_0x3fb7f1]),'ChatWebsiteId':Number(_0x565654[_0x16da('0x55')]['id'])});}}else{socket['emit'](_0x16da('0x125'),{'UserId':Number(_0x565654['query'][_0x16da('0x6d')]),'ChatWebsiteId':Number(_0x565654[_0x16da('0x55')]['id'])});}});}})['then'](respondWithStatusCode(_0x500c30,null))[_0x16da('0x1e')](handleError(_0x500c30,null));};exports[_0x16da('0x126')]=function(_0x1ed05b,_0x4fbd6a){var _0x562639={};var _0x3e3ce7={};var _0x28ac45;var _0x222a65;return db[_0x16da('0x45')][_0x16da('0x67')]({'where':{'id':_0x1ed05b[_0x16da('0x55')]['id']}})['then'](handleEntityNotFound(_0x4fbd6a,null))[_0x16da('0x16')](function(_0x4ae95a){if(_0x4ae95a){_0x28ac45=_0x4ae95a;_0x3e3ce7[_0x16da('0x3e')]=_[_0x16da('0x56')](db[_0x16da('0x127')][_0x16da('0x69')]);_0x3e3ce7[_0x16da('0x47')]=_[_0x16da('0x56')](_0x1ed05b[_0x16da('0x47')]);_0x3e3ce7[_0x16da('0x48')]=_[_0x16da('0x57')](_0x3e3ce7[_0x16da('0x3e')],_0x3e3ce7[_0x16da('0x47')]);_0x562639[_0x16da('0x49')]=_[_0x16da('0x57')](_0x3e3ce7[_0x16da('0x3e')],qs[_0x16da('0x4a')](_0x1ed05b[_0x16da('0x47')][_0x16da('0x4a')]));_0x562639[_0x16da('0x49')]=_0x562639['attributes'][_0x16da('0x58')]?_0x562639[_0x16da('0x49')]:_0x3e3ce7['model'];_0x562639[_0x16da('0x4c')]=qs['sort'](_0x1ed05b[_0x16da('0x47')][_0x16da('0x4d')]);_0x562639[_0x16da('0x4e')]=qs[_0x16da('0x48')](_[_0x16da('0x4f')](_0x1ed05b[_0x16da('0x47')],_0x3e3ce7['filters']));if(_0x1ed05b[_0x16da('0x47')][_0x16da('0x51')]){_0x562639[_0x16da('0x4e')]=_[_0x16da('0x50')](_0x562639['where'],{'$or':_[_0x16da('0x44')](_0x562639['attributes'],function(_0x41e1fa){var _0x694133={};_0x694133[_0x41e1fa]={'$like':'%'+_0x1ed05b[_0x16da('0x47')]['filter']+'%'};return _0x694133;})});}_0x562639=_[_0x16da('0x50')]({},_0x562639,_0x1ed05b[_0x16da('0x6b')]);return _0x28ac45[_0x16da('0x126')](_0x562639);}})[_0x16da('0x16')](function(_0x2eaae0){if(_0x2eaae0){_0x222a65=_0x2eaae0[_0x16da('0x58')];if(!_0x1ed05b[_0x16da('0x47')][_0x16da('0x4b')](_0x16da('0x6a'))){_0x562639['limit']=qs[_0x16da('0x26')](_0x1ed05b[_0x16da('0x47')][_0x16da('0x26')]);_0x562639[_0x16da('0x23')]=qs[_0x16da('0x23')](_0x1ed05b[_0x16da('0x47')][_0x16da('0x23')]);}return _0x28ac45[_0x16da('0x126')](_0x562639);}})[_0x16da('0x16')](function(_0x4a80b4){if(_0x4a80b4){return _0x4a80b4?{'count':_0x222a65,'rows':_0x4a80b4}:null;}})[_0x16da('0x16')](respondWithResult(_0x4fbd6a,null))['catch'](handleError(_0x4fbd6a,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 7e103db..37f190f 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 _0xf23b=['hook','events','../../mysqldb','ChatWebsite','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0xf23b,0x133));var _0xbf23=function(_0xc9a6f2,_0x34bdea){_0xc9a6f2=_0xc9a6f2-0x0;var _0xd0947f=_0xf23b[_0xc9a6f2];return _0xd0947f;};'use strict';var EventEmitter=require(_0xbf23('0x0'));var ChatWebsite=require(_0xbf23('0x1'))['db'][_0xbf23('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xbf23('0x3')](0x0);var events={'afterCreate':_0xbf23('0x4'),'afterUpdate':'update','afterDestroy':_0xbf23('0x5')};function emitEvent(_0x27f311){return function(_0x14ff3b,_0x5ecbf5,_0x13fc15){ChatWebsiteEvents[_0xbf23('0x6')](_0x27f311+':'+_0x14ff3b['id'],_0x14ff3b);ChatWebsiteEvents[_0xbf23('0x6')](_0x27f311,_0x14ff3b);_0x13fc15(null);};}for(var e in events){if(events[_0xbf23('0x7')](e)){var event=events[e];ChatWebsite[_0xbf23('0x8')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file +var _0x723e=['save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatWebsite','setMaxListeners'];(function(_0x2d6d48,_0xd948d7){var _0x4283ba=function(_0x3264b4){while(--_0x3264b4){_0x2d6d48['push'](_0x2d6d48['shift']());}};_0x4283ba(++_0xd948d7);}(_0x723e,0x179));var _0xe723=function(_0x16295e,_0x4a9b05){_0x16295e=_0x16295e-0x0;var _0x2d9e54=_0x723e[_0x16295e];return _0x2d9e54;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0xe723('0x0'))['db'][_0xe723('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xe723('0x2')](0x0);var events={'afterCreate':_0xe723('0x3'),'afterUpdate':_0xe723('0x4'),'afterDestroy':_0xe723('0x5')};function emitEvent(_0x39e35c){return function(_0x1da20f,_0x8f78b2,_0x10aa61){ChatWebsiteEvents['emit'](_0x39e35c+':'+_0x1da20f['id'],_0x1da20f);ChatWebsiteEvents[_0xe723('0x6')](_0x39e35c,_0x1da20f);_0x10aa61(null);};}for(var e in events){if(events[_0xe723('0x7')](e)){var event=events[e];ChatWebsite[_0xe723('0x8')](e,emitEvent(event));}}module[_0xe723('0x9')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index c92e06e..b1a7a32 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 _0x5d88=['path','rimraf','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5d88,0x166));var _0x85d8=function(_0x137d56,_0x42c324){_0x137d56=_0x137d56-0x0;var _0xeb8b5=_0x5d88[_0x137d56];return _0xeb8b5;};'use strict';var _=require(_0x85d8('0x0'));var util=require(_0x85d8('0x1'));var logger=require(_0x85d8('0x2'))(_0x85d8('0x3'));var moment=require(_0x85d8('0x4'));var BPromise=require('bluebird');var rp=require(_0x85d8('0x5'));var fs=require('fs');var path=require(_0x85d8('0x6'));var rimraf=require(_0x85d8('0x7'));var config=require('../../config/environment');var attributes=require(_0x85d8('0x8'));module[_0x85d8('0x9')]=function(_0x2bbc01,_0x175970){return _0x2bbc01[_0x85d8('0xa')](_0x85d8('0xb'),attributes,{'tableName':_0x85d8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe106=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','util'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0xe106,0x1ed));var _0x6e10=function(_0x36d25e,_0x1a047d){_0x36d25e=_0x36d25e-0x0;var _0x4b95b8=_0xe106[_0x36d25e];return _0x4b95b8;};'use strict';var _=require('lodash');var util=require(_0x6e10('0x0'));var logger=require(_0x6e10('0x1'))(_0x6e10('0x2'));var moment=require(_0x6e10('0x3'));var BPromise=require(_0x6e10('0x4'));var rp=require(_0x6e10('0x5'));var fs=require('fs');var path=require(_0x6e10('0x6'));var rimraf=require('rimraf');var config=require(_0x6e10('0x7'));var attributes=require(_0x6e10('0x8'));module[_0x6e10('0x9')]=function(_0x200c81,_0x29cbd3){return _0x200c81[_0x6e10('0xa')](_0x6e10('0xb'),attributes,{'tableName':_0x6e10('0xc'),'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 f7ce7cd..9119e84 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 _0xbda3=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','redis','defaults','localhost','./chatWebsite.socket','register','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbda3,0x144));var _0x3bda=function(_0x3f4613,_0x4405a7){_0x3f4613=_0x3f4613-0x0;var _0x95d346=_0xbda3[_0x3f4613];return _0x95d346;};'use strict';var _=require(_0x3bda('0x0'));var util=require(_0x3bda('0x1'));var moment=require('moment');var BPromise=require(_0x3bda('0x2'));var rs=require(_0x3bda('0x3'));var fs=require('fs');var Redis=require(_0x3bda('0x4'));var db=require(_0x3bda('0x5'))['db'];var utils=require(_0x3bda('0x6'));var logger=require('../../config/logger')(_0x3bda('0x7'));var config=require('../../config/environment');var jayson=require(_0x3bda('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x3bda('0x9')]=_[_0x3bda('0xa')](config[_0x3bda('0x9')],{'host':_0x3bda('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3bda('0x9')]));require(_0x3bda('0xc'))[_0x3bda('0xd')](socket);function respondWithRpcPromise(_0xa36325,_0x5c0251,_0x17edcd){return new BPromise(function(_0x4c92bc,_0x42f309){return client['request'](_0xa36325,_0x17edcd)[_0x3bda('0xe')](function(_0x1cd19a){logger[_0x3bda('0xf')](_0x3bda('0x10'),_0x5c0251,_0x3bda('0x11'));logger[_0x3bda('0x12')](_0x3bda('0x13'),_0x5c0251,_0x3bda('0x11'),JSON[_0x3bda('0x14')](_0x1cd19a));if(_0x1cd19a[_0x3bda('0x15')]){if(_0x1cd19a[_0x3bda('0x15')][_0x3bda('0x16')]===0x1f4){logger[_0x3bda('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x5c0251,_0x1cd19a[_0x3bda('0x15')][_0x3bda('0x17')]);return _0x42f309(_0x1cd19a['error']['message']);}logger[_0x3bda('0x15')](_0x3bda('0x10'),_0x5c0251,_0x1cd19a['error']['message']);return _0x4c92bc(_0x1cd19a[_0x3bda('0x15')][_0x3bda('0x17')]);}else{logger[_0x3bda('0xf')](_0x3bda('0x10'),_0x5c0251,_0x3bda('0x11'));_0x4c92bc(_0x1cd19a['result'][_0x3bda('0x17')]);}})[_0x3bda('0x18')](function(_0xa74839){logger['error'](_0x3bda('0x10'),_0x5c0251,_0xa74839);_0x42f309(_0xa74839);});});} \ No newline at end of file +var _0xe4df=['socket.io-emitter','./chatWebsite.socket','register','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults'];(function(_0x1cf532,_0x4cacf2){var _0x506a32=function(_0x16dfd9){while(--_0x16dfd9){_0x1cf532['push'](_0x1cf532['shift']());}};_0x506a32(++_0x4cacf2);}(_0xe4df,0x85));var _0xfe4d=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xe4df[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfe4d('0x0'));var BPromise=require(_0xfe4d('0x1'));var rs=require(_0xfe4d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfe4d('0x3'))['db'];var utils=require(_0xfe4d('0x4'));var logger=require(_0xfe4d('0x5'))('rpc');var config=require(_0xfe4d('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xfe4d('0x7')][_0xfe4d('0x8')]({'port':0x232a});config[_0xfe4d('0x9')]=_[_0xfe4d('0xa')](config[_0xfe4d('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xfe4d('0xb'))(new Redis(config[_0xfe4d('0x9')]));require(_0xfe4d('0xc'))[_0xfe4d('0xd')](socket);function respondWithRpcPromise(_0x5df4fd,_0x324a7d,_0x3076f3){return new BPromise(function(_0x4adb33,_0x2fd73e){return client[_0xfe4d('0xe')](_0x5df4fd,_0x3076f3)[_0xfe4d('0xf')](function(_0x81d5c1){logger['info'](_0xfe4d('0x10'),_0x324a7d,_0xfe4d('0x11'));logger[_0xfe4d('0x12')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x324a7d,_0xfe4d('0x11'),JSON[_0xfe4d('0x13')](_0x81d5c1));if(_0x81d5c1['error']){if(_0x81d5c1[_0xfe4d('0x14')]['code']===0x1f4){logger[_0xfe4d('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x324a7d,_0x81d5c1[_0xfe4d('0x14')]['message']);return _0x2fd73e(_0x81d5c1[_0xfe4d('0x14')][_0xfe4d('0x15')]);}logger[_0xfe4d('0x14')](_0xfe4d('0x10'),_0x324a7d,_0x81d5c1[_0xfe4d('0x14')][_0xfe4d('0x15')]);return _0x4adb33(_0x81d5c1['error'][_0xfe4d('0x15')]);}else{logger[_0xfe4d('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x324a7d,'request\x20sent');_0x4adb33(_0x81d5c1['result'][_0xfe4d('0x15')]);}})[_0xfe4d('0x17')](function(_0x297ff2){logger['error'](_0xfe4d('0x10'),_0x324a7d,_0x297ff2);_0x2fd73e(_0x297ff2);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 27edd12..b3e2ed9 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 _0x745f=['chatWebsite:','update','removeListener','register','length'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x745f,0x1eb));var _0xf745=function(_0x220afa,_0xf5f6cc){_0x220afa=_0x220afa-0x0;var _0x1b79d1=_0x745f[_0x220afa];return _0x1b79d1;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=['save','remove',_0xf745('0x0')];function createListener(_0x48f779,_0x302f3b){return function(_0x1792e9){_0x302f3b['emit'](_0x48f779,_0x1792e9);};}function removeListener(_0x1c4eb5,_0x384094){return function(){ChatWebsiteEvents[_0xf745('0x1')](_0x1c4eb5,_0x384094);};}exports[_0xf745('0x2')]=function(_0x332cb0){for(var _0xc93a6e=0x0,_0x2509fd=events[_0xf745('0x3')];_0xc93a6e<_0x2509fd;_0xc93a6e++){var _0x2785a3=events[_0xc93a6e];var _0x248747=createListener(_0xf745('0x4')+_0x2785a3,_0x332cb0);ChatWebsiteEvents['on'](_0x2785a3,_0x248747);}}; \ No newline at end of file +var _0xd679=['length','chatWebsite:','./chatWebsite.events','save','update','emit','removeListener','register'];(function(_0x202909,_0x4d9939){var _0x433325=function(_0xa7059c){while(--_0xa7059c){_0x202909['push'](_0x202909['shift']());}};_0x433325(++_0x4d9939);}(_0xd679,0x10a));var _0x9d67=function(_0x17a448,_0x5c3ee4){_0x17a448=_0x17a448-0x0;var _0x1a078c=_0xd679[_0x17a448];return _0x1a078c;};'use strict';var ChatWebsiteEvents=require(_0x9d67('0x0'));var events=[_0x9d67('0x1'),'remove',_0x9d67('0x2')];function createListener(_0x506121,_0x349b0e){return function(_0x423077){_0x349b0e[_0x9d67('0x3')](_0x506121,_0x423077);};}function removeListener(_0x41f1a2,_0x7f2fa0){return function(){ChatWebsiteEvents[_0x9d67('0x4')](_0x41f1a2,_0x7f2fa0);};}exports[_0x9d67('0x5')]=function(_0x2c8105){for(var _0x164d0a=0x0,_0x542505=events[_0x9d67('0x6')];_0x164d0a<_0x542505;_0x164d0a++){var _0x4b5a30=events[_0x164d0a];var _0x592a57=createListener(_0x9d67('0x7')+_0x4b5a30,_0x2c8105);ChatWebsiteEvents['on'](_0x4b5a30,_0x592a57);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/helpers/wildcard-expressions.js b/server/api/chatWebsite/helpers/wildcard-expressions.js index fdab203..ea61964 100644 --- a/server/api/chatWebsite/helpers/wildcard-expressions.js +++ b/server/api/chatWebsite/helpers/wildcard-expressions.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd845=['URL','replace','localhost','([\x5cw]+)','exports','../../../utils/misc','escapeRegExp','url'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0xd845,0x135));var _0x5d84=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0xd845[_0x4e6ae6];return _0x23c108;};var escapeRegExp=require(_0x5d84('0x0'))[_0x5d84('0x1')];var URL=require(_0x5d84('0x2'))[_0x5d84('0x3')];function testWildcardValidity(_0x59cdf4){let _0x137388=!![];try{new URL(_0x59cdf4[_0x5d84('0x4')]('*',_0x5d84('0x5')));}catch(_0x11abe5){_0x137388=![];}return _0x137388&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)['test'](_0x59cdf4);}function testWebsiteWithWildcard(_0x2a4c98,_0x134828){let _0x3e48e4;const _0x41ab60=escapeRegExp(_0x2a4c98)[_0x5d84('0x4')]('\x5c*',_0x5d84('0x6'));try{new URL(_0x2a4c98['replace']('\x5c*',_0x5d84('0x5')));_0x3e48e4=new RegExp(_0x41ab60)['test'](_0x134828);}catch(_0x8958eb){_0x3e48e4=![];}return _0x3e48e4;}module[_0x5d84('0x7')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity}; \ No newline at end of file +var _0x949d=['test','exports','../../../utils/misc','escapeRegExp','url','URL','replace','localhost'];(function(_0x45be0d,_0x7a2b0a){var _0x72a7b7=function(_0x526a3c){while(--_0x526a3c){_0x45be0d['push'](_0x45be0d['shift']());}};_0x72a7b7(++_0x7a2b0a);}(_0x949d,0x162));var _0xd949=function(_0x3d7e1a,_0x4e1990){_0x3d7e1a=_0x3d7e1a-0x0;var _0x4cb731=_0x949d[_0x3d7e1a];return _0x4cb731;};var escapeRegExp=require(_0xd949('0x0'))[_0xd949('0x1')];var URL=require(_0xd949('0x2'))[_0xd949('0x3')];function testWildcardValidity(_0x59c4ae){let _0x5c5854=!![];try{new URL(_0x59c4ae[_0xd949('0x4')]('*',_0xd949('0x5')));}catch(_0x596628){_0x5c5854=![];}return _0x5c5854&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0xd949('0x6')](_0x59c4ae);}function testWebsiteWithWildcard(_0x312499,_0x5d1579){let _0x3d2be5;const _0x416d5e=escapeRegExp(_0x312499)[_0xd949('0x4')]('\x5c*','([\x5cw]+)');try{new URL(_0x312499[_0xd949('0x4')]('\x5c*',_0xd949('0x5')));_0x3d2be5=new RegExp(_0x416d5e)['test'](_0x5d1579);}catch(_0x58e185){_0x3d2be5=![];}return _0x3d2be5;}module[_0xd949('0x7')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 0be8e74..edf48de 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 _0xd70f=['replace','/:id/offline','offline','/:id/applications','/:id/proactive_actions','addProactiveActions','addAgents','put','delete','removeDispositions','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','get','index','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','getProactiveActions','getFields','/:id/offline_messages','/:id/users','getAgents','post','create','addDisposition','diskStorage','join','root','server/files/images/logos/','format','now','originalname','single','file','server/files/images/avatars/','%s-%s','addAvatar','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir'];(function(_0x9e2e27,_0x362d79){var _0x45cd79=function(_0x51c57e){while(--_0x51c57e){_0x9e2e27['push'](_0x9e2e27['shift']());}};_0x45cd79(++_0x362d79);}(_0xd70f,0x8e));var _0xfd70=function(_0x2607c8,_0x504609){_0x2607c8=_0x2607c8-0x0;var _0x28e451=_0xd70f[_0x2607c8];return _0x28e451;};'use strict';var multer=require(_0xfd70('0x0'));var util=require(_0xfd70('0x1'));var path=require(_0xfd70('0x2'));var timeout=require(_0xfd70('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xfd70('0x4'));var auth=require(_0xfd70('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfd70('0x6'));var controller=require('./chatWebsite.controller');router[_0xfd70('0x7')]('/',auth['isAuthenticated'](),controller[_0xfd70('0x8')]);router['get']('/describe',auth[_0xfd70('0x9')](),controller[_0xfd70('0xa')]);router[_0xfd70('0x7')](_0xfd70('0xb'),auth[_0xfd70('0x9')](),controller[_0xfd70('0xc')]);router[_0xfd70('0x7')](_0xfd70('0xd'),auth[_0xfd70('0x9')](),controller[_0xfd70('0xe')]);router['get'](_0xfd70('0xf'),auth[_0xfd70('0x9')](),controller[_0xfd70('0x10')]);router[_0xfd70('0x7')]('/:id/logo',controller[_0xfd70('0x11')]);router['get'](_0xfd70('0x12'),controller[_0xfd70('0x13')]);router[_0xfd70('0x7')](_0xfd70('0x14'),controller[_0xfd70('0x15')]);router['get']('/:id/system_avatar',controller[_0xfd70('0x16')]);router[_0xfd70('0x7')](_0xfd70('0x17'),auth['isAuthenticated'](),controller[_0xfd70('0x18')]);router['get'](_0xfd70('0x19'),controller[_0xfd70('0x1a')]);router['get']('/:id/applications',auth[_0xfd70('0x9')](),controller['getApplications']);router[_0xfd70('0x7')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0xfd70('0x1b')]);router['get']('/:id/fields',controller[_0xfd70('0x1c')]);router[_0xfd70('0x7')](_0xfd70('0x1d'),auth['isAuthenticated'](),controller['getOfflineMessages']);router[_0xfd70('0x7')](_0xfd70('0x1e'),auth['isAuthenticated'](),controller[_0xfd70('0x1f')]);router[_0xfd70('0x20')]('/',auth['isAuthenticated'](),controller[_0xfd70('0x21')]);router[_0xfd70('0x20')]('/:id/dispositions',auth[_0xfd70('0x9')](),controller[_0xfd70('0x22')]);router[_0xfd70('0x20')](_0xfd70('0xf'),auth[_0xfd70('0x9')](),controller['addAnswer']);var upload=multer({'storage':multer[_0xfd70('0x23')]({'destination':function(_0x2b1a91,_0x4771e2,_0x59ca11){_0x59ca11(null,path[_0xfd70('0x24')](config[_0xfd70('0x25')],_0xfd70('0x26')));},'filename':function(_0x477fb9,_0x28c8a7,_0x3fb144){_0x3fb144(null,util[_0xfd70('0x27')]('%s-%s',Date[_0xfd70('0x28')](),_0x28c8a7[_0xfd70('0x29')]));}})});router[_0xfd70('0x20')]('/:id/logo',upload[_0xfd70('0x2a')](_0xfd70('0x2b')),controller['addLogo']);var upload=multer({'storage':multer[_0xfd70('0x23')]({'destination':function(_0x59c577,_0x1f1820,_0xae7f88){_0xae7f88(null,path[_0xfd70('0x24')](config[_0xfd70('0x25')],_0xfd70('0x2c')));},'filename':function(_0x1b23da,_0x24a615,_0x2dfc3){_0x2dfc3(null,util[_0xfd70('0x27')](_0xfd70('0x2d'),Date['now'](),_0x24a615['originalname']));}})});router[_0xfd70('0x20')]('/:id/avatar',upload[_0xfd70('0x2a')](_0xfd70('0x2b')),controller[_0xfd70('0x2e')]);var upload=multer({'storage':multer[_0xfd70('0x23')]({'destination':function(_0x24c892,_0x2e183d,_0x31af86){_0x31af86(null,path[_0xfd70('0x24')](config['root'],_0xfd70('0x2c')));},'filename':function(_0x552dcd,_0x553f78,_0x127e10){_0x127e10(null,util[_0xfd70('0x27')]('%s-%s',Date['now'](),_0x553f78[_0xfd70('0x29')]));}})});router[_0xfd70('0x20')]('/:id/customer_avatar',upload[_0xfd70('0x2a')](_0xfd70('0x2b')),controller[_0xfd70('0x2f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x297f9a,_0x46907c,_0x485562){_0x485562(null,path['join'](config['root'],'server/files/images/avatars/'));},'filename':function(_0x1e28aa,_0x415b76,_0x73e514){_0x73e514(null,util['format']('%s-%s',Date[_0xfd70('0x28')](),_0x415b76[_0xfd70('0x29')]));}})});router['post'](_0xfd70('0x30'),upload['single']('file'),controller[_0xfd70('0x31')]);router[_0xfd70('0x20')](_0xfd70('0x32'),controller[_0xfd70('0x33')]);const offlineUploadMulter=multer({'storage':multer[_0xfd70('0x23')]({'destination':function(_0x2a0152,_0x37f183,_0x37306e){const _0x2cae6e=path['join'](config[_0xfd70('0x25')],_0xfd70('0x34'),_0xfd70('0x35'),_0xfd70('0x36'));fs_extra[_0xfd70('0x37')](_0x2cae6e,function(){_0x37306e(null,_0x2cae6e);});},'filename':function(_0x474b12,_0x1664c2,_0x347b2e){const _0x320142=_0x1664c2['originalname'][_0xfd70('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x190931=path['extname'](_0x320142);const _0x5d1cc1=Date['now']()+'-'+_0x320142[_0xfd70('0x38')](_0x190931,'')+_0x190931;_0x347b2e(null,_0x5d1cc1);}})});router[_0xfd70('0x20')](_0xfd70('0x39'),offlineUploadMulter['any'](),controller[_0xfd70('0x3a')]);router[_0xfd70('0x20')](_0xfd70('0x17'),auth[_0xfd70('0x9')](),controller['addInteraction']);router[_0xfd70('0x20')](_0xfd70('0x3b'),auth[_0xfd70('0x9')](),controller['addApplications']);router[_0xfd70('0x20')](_0xfd70('0x3c'),auth[_0xfd70('0x9')](),controller[_0xfd70('0x3d')]);router[_0xfd70('0x20')]('/:id/users',auth[_0xfd70('0x9')](),controller[_0xfd70('0x3e')]);router[_0xfd70('0x3f')](_0xfd70('0xb'),auth[_0xfd70('0x9')](),controller['update']);router['delete'](_0xfd70('0xb'),auth['isAuthenticated'](),controller['destroy']);router[_0xfd70('0x40')]('/:id/dispositions',auth[_0xfd70('0x9')](),controller[_0xfd70('0x41')]);router[_0xfd70('0x40')](_0xfd70('0xf'),auth[_0xfd70('0x9')](),controller['removeAnswers']);router[_0xfd70('0x40')](_0xfd70('0x1e'),auth[_0xfd70('0x9')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x4403=['getOfflineMessages','/:id/users','post','create','/:id/canned_answers','addAnswer','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','addLogo','diskStorage','server/files/images/avatars/','/:id/avatar','addCustomerAvatar','/:id/system_avatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','extname','replace','/:id/offline','any','offline','addInteraction','addProactiveActions','addAgents','update','delete','removeDispositions','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages'];(function(_0x25b24a,_0x1c0163){var _0x224e68=function(_0x1fc9d2){while(--_0x1fc9d2){_0x25b24a['push'](_0x25b24a['shift']());}};_0x224e68(++_0x1c0163);}(_0x4403,0xb8));var _0x3440=function(_0x1ee128,_0x3ecc30){_0x1ee128=_0x1ee128-0x0;var _0x5c5ea9=_0x4403[_0x1ee128];return _0x5c5ea9;};'use strict';var multer=require(_0x3440('0x0'));var util=require(_0x3440('0x1'));var path=require(_0x3440('0x2'));var timeout=require('connect-timeout');var express=require(_0x3440('0x3'));var router=express[_0x3440('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3440('0x5'));var interaction=require(_0x3440('0x6'));var config=require(_0x3440('0x7'));var controller=require(_0x3440('0x8'));router[_0x3440('0x9')]('/',auth[_0x3440('0xa')](),controller['index']);router[_0x3440('0x9')](_0x3440('0xb'),auth[_0x3440('0xa')](),controller[_0x3440('0xc')]);router[_0x3440('0x9')](_0x3440('0xd'),auth[_0x3440('0xa')](),controller[_0x3440('0xe')]);router[_0x3440('0x9')](_0x3440('0xf'),auth[_0x3440('0xa')](),controller[_0x3440('0x10')]);router['get']('/:id/canned_answers',auth[_0x3440('0xa')](),controller[_0x3440('0x11')]);router['get'](_0x3440('0x12'),controller[_0x3440('0x13')]);router[_0x3440('0x9')]('/:id/avatar',controller[_0x3440('0x14')]);router[_0x3440('0x9')](_0x3440('0x15'),controller[_0x3440('0x16')]);router[_0x3440('0x9')]('/:id/system_avatar',controller[_0x3440('0x17')]);router['get'](_0x3440('0x18'),auth[_0x3440('0xa')](),controller[_0x3440('0x19')]);router[_0x3440('0x9')]('/:id/snippet',controller[_0x3440('0x1a')]);router['get'](_0x3440('0x1b'),auth['isAuthenticated'](),controller['getApplications']);router[_0x3440('0x9')](_0x3440('0x1c'),auth['isAuthenticated'](),controller[_0x3440('0x1d')]);router[_0x3440('0x9')](_0x3440('0x1e'),controller['getFields']);router[_0x3440('0x9')](_0x3440('0x1f'),auth[_0x3440('0xa')](),controller[_0x3440('0x20')]);router[_0x3440('0x9')](_0x3440('0x21'),auth[_0x3440('0xa')](),controller['getAgents']);router[_0x3440('0x22')]('/',auth[_0x3440('0xa')](),controller[_0x3440('0x23')]);router['post'](_0x3440('0xf'),auth[_0x3440('0xa')](),controller['addDisposition']);router['post'](_0x3440('0x24'),auth[_0x3440('0xa')](),controller[_0x3440('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53d40c,_0x137dd3,_0x53c26b){_0x53c26b(null,path[_0x3440('0x26')](config[_0x3440('0x27')],_0x3440('0x28')));},'filename':function(_0x3f43a6,_0x43c15a,_0x219428){_0x219428(null,util[_0x3440('0x29')](_0x3440('0x2a'),Date[_0x3440('0x2b')](),_0x43c15a[_0x3440('0x2c')]));}})});router[_0x3440('0x22')](_0x3440('0x12'),upload[_0x3440('0x2d')](_0x3440('0x2e')),controller[_0x3440('0x2f')]);var upload=multer({'storage':multer[_0x3440('0x30')]({'destination':function(_0xb5927d,_0x9ebba6,_0x261839){_0x261839(null,path[_0x3440('0x26')](config['root'],_0x3440('0x31')));},'filename':function(_0x3a0509,_0x4e31fb,_0x1a2c67){_0x1a2c67(null,util['format'](_0x3440('0x2a'),Date[_0x3440('0x2b')](),_0x4e31fb[_0x3440('0x2c')]));}})});router[_0x3440('0x22')](_0x3440('0x32'),upload[_0x3440('0x2d')](_0x3440('0x2e')),controller['addAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x52813d,_0x3646b5,_0x29f3fa){_0x29f3fa(null,path[_0x3440('0x26')](config['root'],_0x3440('0x31')));},'filename':function(_0x5f2c87,_0x160176,_0x195c8c){_0x195c8c(null,util[_0x3440('0x29')](_0x3440('0x2a'),Date[_0x3440('0x2b')](),_0x160176[_0x3440('0x2c')]));}})});router[_0x3440('0x22')]('/:id/customer_avatar',upload[_0x3440('0x2d')](_0x3440('0x2e')),controller[_0x3440('0x33')]);var upload=multer({'storage':multer[_0x3440('0x30')]({'destination':function(_0x5d411e,_0x355487,_0x35ecf3){_0x35ecf3(null,path[_0x3440('0x26')](config[_0x3440('0x27')],_0x3440('0x31')));},'filename':function(_0x34e296,_0x49af0d,_0x1230be){_0x1230be(null,util[_0x3440('0x29')]('%s-%s',Date[_0x3440('0x2b')](),_0x49af0d[_0x3440('0x2c')]));}})});router[_0x3440('0x22')](_0x3440('0x34'),upload[_0x3440('0x2d')](_0x3440('0x2e')),controller['addSystemAvatar']);router['post'](_0x3440('0x35'),controller[_0x3440('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0x3440('0x30')]({'destination':function(_0x122aaa,_0x34fa7c,_0x4f9946){const _0x38bc78=path[_0x3440('0x26')](config[_0x3440('0x27')],_0x3440('0x37'),_0x3440('0x38'),_0x3440('0x39'));fs_extra[_0x3440('0x3a')](_0x38bc78,function(){_0x4f9946(null,_0x38bc78);});},'filename':function(_0x4e7c7d,_0x3c8b8c,_0x256e1c){const _0x53c733=_0x3c8b8c[_0x3440('0x2c')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2cee10=path[_0x3440('0x3b')](_0x53c733);const _0x176b44=Date['now']()+'-'+_0x53c733[_0x3440('0x3c')](_0x2cee10,'')+_0x2cee10;_0x256e1c(null,_0x176b44);}})});router[_0x3440('0x22')](_0x3440('0x3d'),offlineUploadMulter[_0x3440('0x3e')](),controller[_0x3440('0x3f')]);router[_0x3440('0x22')](_0x3440('0x18'),auth['isAuthenticated'](),controller[_0x3440('0x40')]);router[_0x3440('0x22')](_0x3440('0x1b'),auth[_0x3440('0xa')](),controller['addApplications']);router['post'](_0x3440('0x1c'),auth[_0x3440('0xa')](),controller[_0x3440('0x41')]);router[_0x3440('0x22')](_0x3440('0x21'),auth[_0x3440('0xa')](),controller[_0x3440('0x42')]);router['put'](_0x3440('0xd'),auth[_0x3440('0xa')](),controller[_0x3440('0x43')]);router[_0x3440('0x44')](_0x3440('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0x3440('0x44')]('/:id/dispositions',auth[_0x3440('0xa')](),controller[_0x3440('0x45')]);router[_0x3440('0x44')](_0x3440('0x24'),auth[_0x3440('0xa')](),controller['removeAnswers']);router[_0x3440('0x44')](_0x3440('0x21'),auth[_0x3440('0xa')](),controller[_0x3440('0x46')]);module[_0x3440('0x47')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index bf96898..f52cffa 100644 --- a/server/api/client-side-logs.js +++ b/server/api/client-side-logs.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x515c=['../config/environment','Router','env','production','app','Client-Side\x20logger\x20not\x20found!','expressEndpoint','isAuthenticated','exports','beaver-logger/server','express','../components/auth/service'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0x515c,0x75));var _0xc515=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x515c[_0x17d9e3];return _0x14192d;};var beaverLogger=require(_0xc515('0x0'));var express=require(_0xc515('0x1'));var auth=require(_0xc515('0x2'));var config=require(_0xc515('0x3'));var router=express[_0xc515('0x4')]();var isProduction=config[_0xc515('0x5')]===_0xc515('0x6')||![];function clientSideLogs(_0x3531a6,_0x14896d,_0x16c9d1){var _0x2dd59b=_0x3531a6[_0xc515('0x7')]['get']('client-side-logger');if(!_0x2dd59b){throw new Error(_0xc515('0x8'));}return beaverLogger[_0xc515('0x9')]({'uri':'/client-logs','logger':_0x2dd59b,'enableCors':!isProduction})(_0x3531a6,_0x14896d,_0x16c9d1);}router['use'](auth[_0xc515('0xa')](),clientSideLogs);module[_0xc515('0xb')]=router; \ No newline at end of file +var _0x0069=['app','client-side-logger','expressEndpoint','/client-logs','use','isAuthenticated','exports','beaver-logger/server','express','Router','production'];(function(_0x3c4024,_0x1fb7c9){var _0x20f126=function(_0x572d54){while(--_0x572d54){_0x3c4024['push'](_0x3c4024['shift']());}};_0x20f126(++_0x1fb7c9);}(_0x0069,0x15c));var _0x9006=function(_0x1fd4d7,_0x2feafd){_0x1fd4d7=_0x1fd4d7-0x0;var _0x7efe8a=_0x0069[_0x1fd4d7];return _0x7efe8a;};var beaverLogger=require(_0x9006('0x0'));var express=require(_0x9006('0x1'));var auth=require('../components/auth/service');var config=require('../config/environment');var router=express[_0x9006('0x2')]();var isProduction=config['env']===_0x9006('0x3')||![];function clientSideLogs(_0x5e8e68,_0x6ac838,_0x5674d4){var _0x518ecc=_0x5e8e68[_0x9006('0x4')]['get'](_0x9006('0x5'));if(!_0x518ecc){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0x9006('0x6')]({'uri':_0x9006('0x7'),'logger':_0x518ecc,'enableCors':!isProduction})(_0x5e8e68,_0x6ac838,_0x5674d4);}router[_0x9006('0x8')](auth[_0x9006('0x9')](),clientSideLogs);module[_0x9006('0xa')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index b1156f9..b278a88 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 _0x3d19=['sequelize','STRING','ENUM','MicrosoftAzure','Outlook365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token'];(function(_0x3682e2,_0x517f05){var _0x3312f8=function(_0x5bee4e){while(--_0x5bee4e){_0x3682e2['push'](_0x3682e2['shift']());}};_0x3312f8(++_0x517f05);}(_0x3d19,0xbb));var _0x93d1=function(_0x59c301,_0x359c50){_0x59c301=_0x59c301-0x0;var _0x3866b9=_0x3d19[_0x59c301];return _0x3866b9;};'use strict';var Sequelize=require(_0x93d1('0x0'));module['exports']={'name':{'type':Sequelize[_0x93d1('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x93d1('0x2')]('AmazonAWS','Google',_0x93d1('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x93d1('0x2')](_0x93d1('0x4'),'Dynamics365')},'data1':{'type':Sequelize[_0x93d1('0x1')],'comment':_0x93d1('0x5')},'data2':{'type':Sequelize[_0x93d1('0x1')],'comment':_0x93d1('0x6')},'data3':{'type':Sequelize[_0x93d1('0x1')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize['STRING'],'comment':_0x93d1('0x7')},'data5':{'type':Sequelize[_0x93d1('0x8')],'comment':_0x93d1('0x9')},'data6':{'type':Sequelize[_0x93d1('0x8')],'comment':_0x93d1('0xa')},'data7':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}}; \ No newline at end of file +var _0x6227=['AmazonAWS','Google','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM'];(function(_0x480f2c,_0x54f1c0){var _0x3a990a=function(_0x5373f7){while(--_0x5373f7){_0x480f2c['push'](_0x480f2c['shift']());}};_0x3a990a(++_0x54f1c0);}(_0x6227,0xb2));var _0x7622=function(_0x14432f,_0x339c86){_0x14432f=_0x14432f-0x0;var _0x9a7578=_0x6227[_0x14432f];return _0x9a7578;};'use strict';var Sequelize=require(_0x7622('0x0'));module[_0x7622('0x1')]={'name':{'type':Sequelize[_0x7622('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x7622('0x3')](_0x7622('0x4'),_0x7622('0x5'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x7622('0x3')](_0x7622('0x6'),_0x7622('0x7'))},'data1':{'type':Sequelize[_0x7622('0x2')],'comment':_0x7622('0x8')},'data2':{'type':Sequelize['STRING'],'comment':_0x7622('0x9')},'data3':{'type':Sequelize[_0x7622('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x7622('0x2')],'comment':_0x7622('0xa')},'data5':{'type':Sequelize[_0x7622('0xb')],'comment':_0x7622('0xc')},'data6':{'type':Sequelize[_0x7622('0xb')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x7622('0xb')],'comment':_0x7622('0xd')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 4e6af32..43fdfbe 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 _0x042a=['where','pick','filter','merge','type','VIRTUAL','includeAll','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','show','params','fields','find','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','update','oauth2MicrosoftAuthorize','findOne','user','get','state','Invalid\x20state\x20parameter','base64','toString','ascii','isValidIdToken','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','refresh_token','startRefreshInterval','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','send','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../config/environment','../../config/logger','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','then','destroy','error','stack','name','padEnd','slice','CloudProvider','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','attributes','length','nolimit','order','sort'];(function(_0x2b59b1,_0x46c17c){var _0x4a44bb=function(_0x47c007){while(--_0x47c007){_0x2b59b1['push'](_0x2b59b1['shift']());}};_0x4a44bb(++_0x46c17c);}(_0x042a,0x1ad));var _0xa042=function(_0x226931,_0x2a0d77){_0x226931=_0x226931-0x0;var _0x806ee7=_0x042a[_0x226931];return _0x806ee7;};'use strict';var _=require(_0xa042('0x0'));var Redis=require(_0xa042('0x1'));var qs=require(_0xa042('0x2'));var encryptor=require('../../components/encryptor');var config=require(_0xa042('0x3'));var logger=require(_0xa042('0x4'))('api');var db=require(_0xa042('0x5'))['db'];var oauth=require('./cloudProvider.oauth');config[_0xa042('0x6')]=_[_0xa042('0x7')](config[_0xa042('0x6')],{'host':_0xa042('0x8'),'port':0x18eb});var socket=require(_0xa042('0x9'))(new Redis(config[_0xa042('0x6')]));var redis=new Redis(config[_0xa042('0x6')]);function respondWithStatusCode(_0x760061,_0x145f61){_0x145f61=_0x145f61||0xcc;return function(_0x543106){if(_0x543106){return _0x760061[_0xa042('0xa')](_0x145f61);}return _0x760061['status'](_0x145f61)[_0xa042('0xb')]();};}function respondWithResult(_0x109d32,_0x334a3f){_0x334a3f=_0x334a3f||0xc8;return function(_0x259258){if(_0x259258){return _0x109d32[_0xa042('0xc')](_0x334a3f)[_0xa042('0xd')](_0x259258);}};}function respondWithFilteredResult(_0x412df6,_0x20217c){return function(_0x242608){if(_0x242608){var _0x31cd1d=typeof _0x20217c[_0xa042('0xe')]==='undefined'&&typeof _0x20217c[_0xa042('0xf')]===_0xa042('0x10');var _0x1128bf=_0x242608[_0xa042('0x11')];var _0x301763=_0x31cd1d?0x0:_0x20217c[_0xa042('0xe')];var _0xc02fd2=_0x31cd1d?_0x242608[_0xa042('0x11')]:_0x20217c['offset']+_0x20217c[_0xa042('0xf')];var _0x399e0c;if(_0xc02fd2>=_0x1128bf){_0xc02fd2=_0x1128bf;_0x399e0c=0xc8;}else{_0x399e0c=0xce;}_0x412df6['status'](_0x399e0c);return _0x412df6['set'](_0xa042('0x12'),_0x301763+'-'+_0xc02fd2+'/'+_0x1128bf)[_0xa042('0xd')](_0x242608);}return null;};}function saveUpdates(_0xc17c69){return function(_0x250dc9){if(_0x250dc9){return _0x250dc9['update'](_0xc17c69)[_0xa042('0x13')](function(_0x179cc0){return _0x179cc0;});}return null;};}function removeEntity(_0x370947){return function(_0x51cc09){if(_0x51cc09){return _0x51cc09[_0xa042('0x14')]()[_0xa042('0x13')](function(){_0x370947['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x12bad1){return function(_0xd7515){if(!_0xd7515){_0x12bad1[_0xa042('0xa')](0x194);}return _0xd7515;};}function handleError(_0x2a1d88,_0x5b98bc){_0x5b98bc=_0x5b98bc||0x1f4;return function(_0x2f4c2d){logger[_0xa042('0x15')](_0x2f4c2d[_0xa042('0x16')]);if(_0x2f4c2d[_0xa042('0x17')]){delete _0x2f4c2d[_0xa042('0x17')];}_0x2a1d88['status'](_0x5b98bc)['send'](_0x2f4c2d);};}function maskClientSecret(_0x563b0d){return _[_0xa042('0x18')](_0x563b0d[_0xa042('0x19')](0x0,0x3),0x14,'*');}exports['index']=function(_0x4335dc,_0x4ce94f){var _0xbfd982={},_0x120428={},_0xa98c4c={'count':0x0,'rows':[]};var _0x37c2aa=_['map'](db[_0xa042('0x1a')][_0xa042('0x1b')],function(_0x348fd3){return{'name':_0x348fd3[_0xa042('0x1c')],'type':_0x348fd3['type'][_0xa042('0x1d')]};});_0x120428[_0xa042('0x1e')]=_[_0xa042('0x1f')](_0x37c2aa,'name');_0x120428['query']=_[_0xa042('0x20')](_0x4335dc[_0xa042('0x21')]);_0x120428[_0xa042('0x22')]=_[_0xa042('0x23')](_0x120428[_0xa042('0x1e')],_0x120428['query']);_0xbfd982[_0xa042('0x24')]=_['intersection'](_0x120428['model'],qs['fields'](_0x4335dc[_0xa042('0x21')]['fields']));_0xbfd982[_0xa042('0x24')]=_0xbfd982['attributes'][_0xa042('0x25')]?_0xbfd982[_0xa042('0x24')]:_0x120428[_0xa042('0x1e')];if(!_0x4335dc[_0xa042('0x21')]['hasOwnProperty'](_0xa042('0x26'))){_0xbfd982[_0xa042('0xf')]=qs[_0xa042('0xf')](_0x4335dc[_0xa042('0x21')][_0xa042('0xf')]);_0xbfd982['offset']=qs[_0xa042('0xe')](_0x4335dc['query']['offset']);}_0xbfd982[_0xa042('0x27')]=qs[_0xa042('0x28')](_0x4335dc['query'][_0xa042('0x28')]);_0xbfd982[_0xa042('0x29')]=qs['filters'](_[_0xa042('0x2a')](_0x4335dc[_0xa042('0x21')],_0x120428['filters']),_0x37c2aa);if(_0x4335dc[_0xa042('0x21')][_0xa042('0x2b')]){_0xbfd982[_0xa042('0x29')]=_[_0xa042('0x2c')](_0xbfd982[_0xa042('0x29')],{'$or':_[_0xa042('0x1f')](_0x37c2aa,function(_0x46b0e8){if(_0x46b0e8[_0xa042('0x2d')]!==_0xa042('0x2e')){var _0x35b9b5={};_0x35b9b5[_0x46b0e8[_0xa042('0x17')]]={'$like':'%'+_0x4335dc[_0xa042('0x21')][_0xa042('0x2b')]+'%'};return _0x35b9b5;}})});}_0xbfd982=_[_0xa042('0x2c')]({},_0xbfd982,_0x4335dc['options']);var _0x85d2ce={'where':_0xbfd982[_0xa042('0x29')]};return db[_0xa042('0x1a')][_0xa042('0x11')](_0x85d2ce)[_0xa042('0x13')](function(_0x590478){_0xa98c4c[_0xa042('0x11')]=_0x590478;if(_0x4335dc[_0xa042('0x21')][_0xa042('0x2f')]){_0xbfd982['include']=[{'all':!![]}];}return db[_0xa042('0x1a')][_0xa042('0x30')](_0xbfd982);})[_0xa042('0x13')](function(_0x2c57bb){_0xa98c4c[_0xa042('0x31')]=_[_0xa042('0x1f')](_0x2c57bb,function(_0x32fa29){if(_0x32fa29[_0xa042('0x32')]===_0xa042('0x33')){var _0xbe825b=encryptor[_0xa042('0x34')](_0x32fa29[_0xa042('0x35')]);_0x32fa29[_0xa042('0x35')]=maskClientSecret(_0xbe825b);}return _0x32fa29;});return _0xa98c4c;})[_0xa042('0x13')](respondWithFilteredResult(_0x4ce94f,_0xbfd982))[_0xa042('0x36')](handleError(_0x4ce94f,null));};exports[_0xa042('0x37')]=function(_0x28bb6c,_0x1313eb){var _0x5ceae1={'raw':!![],'where':{'id':_0x28bb6c[_0xa042('0x38')]['id']}},_0x1f93d4={};_0x1f93d4[_0xa042('0x1e')]=_['keys'](db[_0xa042('0x1a')][_0xa042('0x1b')]);_0x1f93d4['query']=_[_0xa042('0x20')](_0x28bb6c[_0xa042('0x21')]);_0x1f93d4[_0xa042('0x22')]=_['intersection'](_0x1f93d4[_0xa042('0x1e')],_0x1f93d4['query']);_0x5ceae1['attributes']=_[_0xa042('0x23')](_0x1f93d4[_0xa042('0x1e')],qs[_0xa042('0x39')](_0x28bb6c[_0xa042('0x21')][_0xa042('0x39')]));_0x5ceae1['attributes']=_0x5ceae1[_0xa042('0x24')]['length']?_0x5ceae1['attributes']:_0x1f93d4[_0xa042('0x1e')];if(_0x28bb6c[_0xa042('0x21')][_0xa042('0x2f')]){_0x5ceae1['include']=[{'all':!![]}];}_0x5ceae1=_['merge']({},_0x5ceae1,_0x28bb6c['options']);return db[_0xa042('0x1a')][_0xa042('0x3a')](_0x5ceae1)['then'](handleEntityNotFound(_0x1313eb,null))[_0xa042('0x13')](function(_0x5dff57){if(_0x5dff57[_0xa042('0x32')]===_0xa042('0x33')){var _0x27b895=encryptor[_0xa042('0x34')](_0x5dff57['data3']);_0x5dff57['data3']=maskClientSecret(_0x27b895);}return _0x5dff57;})['then'](respondWithResult(_0x1313eb,null))[_0xa042('0x36')](handleError(_0x1313eb,null));};exports[_0xa042('0x3b')]=function(_0xfad250,_0x536e74){if(!_0xfad250[_0xa042('0x3c')][_0xa042('0x17')])throw new Error(_0xa042('0x3d'));if(!_0xfad250[_0xa042('0x3c')]['service'])throw new Error(_0xa042('0x3e'));var _0x4b770e=db[_0xa042('0x1a')][_0xa042('0x1b')]['service']['values'];if(!_0x4b770e[_0xa042('0x3f')](_0xfad250[_0xa042('0x3c')][_0xa042('0x32')]))throw new Error(_0xa042('0x40')+_0x4b770e[_0xa042('0x41')](',\x20'));if(_0xfad250[_0xa042('0x3c')][_0xa042('0x32')]===_0xa042('0x33')&&_0xfad250[_0xa042('0x3c')]['data3']){_0xfad250[_0xa042('0x3c')][_0xa042('0x35')]=encryptor[_0xa042('0x42')](_0xfad250[_0xa042('0x3c')][_0xa042('0x35')]);}return db[_0xa042('0x1a')][_0xa042('0x3b')](_0xfad250['body'],{})[_0xa042('0x13')](respondWithResult(_0x536e74,0xc9))[_0xa042('0x36')](handleError(_0x536e74,null));};exports[_0xa042('0x43')]=function(_0x10b655,_0x3d05ae){if(_0x10b655['body']['id']){delete _0x10b655[_0xa042('0x3c')]['id'];}return db[_0xa042('0x1a')]['find']({'where':{'id':_0x10b655[_0xa042('0x38')]['id']}})[_0xa042('0x13')](handleEntityNotFound(_0x3d05ae,null))['then'](function(_0xa6382a){if(_0xa6382a[_0xa042('0x32')]===_0xa042('0x33')&&_0x10b655[_0xa042('0x3c')][_0xa042('0x35')]){_0x10b655['body'][_0xa042('0x35')]=encryptor['encryptString'](_0x10b655[_0xa042('0x3c')][_0xa042('0x35')]);}return _0xa6382a;})[_0xa042('0x13')](saveUpdates(_0x10b655[_0xa042('0x3c')],null))[_0xa042('0x13')](respondWithResult(_0x3d05ae,null))[_0xa042('0x36')](handleError(_0x3d05ae,null));};exports[_0xa042('0x14')]=function(_0x34edf8,_0x3ad2c2){return db[_0xa042('0x1a')][_0xa042('0x3a')]({'where':{'id':_0x34edf8['params']['id']}})['then'](handleEntityNotFound(_0x3ad2c2,null))[_0xa042('0x13')](removeEntity(_0x3ad2c2,null))[_0xa042('0x36')](handleError(_0x3ad2c2,null));};exports[_0xa042('0x44')]=function(_0x582c2b,_0x1e7ea7){return db[_0xa042('0x1a')][_0xa042('0x45')]({'where':{'id':_0x582c2b[_0xa042('0x38')]['id']},'raw':!![]})[_0xa042('0x13')](function(_0x3f25a2){if(!_0x3f25a2)return _0x1e7ea7[_0xa042('0xa')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x3f25a2,_0x582c2b[_0xa042('0x46')]['id'])};})[_0xa042('0x13')](respondWithResult(_0x1e7ea7,null))[_0xa042('0x36')](handleError(_0x1e7ea7,null));};exports['oauth2MicrosoftCallback']=function(_0x259a61,_0x21e883){var _0x42443c=_0x259a61[_0xa042('0x3c')];var _0x522b01;var _0x5b5bf3;if(_0x42443c['error'])throw _0x42443c;redis[_0xa042('0x47')](_0x42443c[_0xa042('0x48')])[_0xa042('0x13')](function(_0x20c8ae){if(!_0x20c8ae)throw new Error(_0xa042('0x49'));_0x522b01=JSON['parse'](_0x20c8ae);var _0x408091=Buffer['from'](_0x42443c['state'],_0xa042('0x4a'))[_0xa042('0x4b')](_0xa042('0x4c'));_0x5b5bf3=JSON['parse'](_0x408091);if(!oauth[_0xa042('0x4d')](_0x42443c['id_token'],_0x522b01[_0xa042('0x4e')]))throw new Error(_0xa042('0x4f'));redis[_0xa042('0x50')](_0x42443c['state']);return oauth[_0xa042('0x51')](_0x42443c[_0xa042('0x52')],_0x522b01);})['then'](function(_0x3d1ba5){_0x522b01[_0xa042('0x53')]=_0x3d1ba5[_0xa042('0x54')];_0x522b01['data6']=_0x3d1ba5[_0xa042('0x55')];return db['CloudProvider'][_0xa042('0x43')]({'data5':_0x522b01[_0xa042('0x53')],'data6':_0x522b01['data6']},{'where':{'id':_0x522b01['id']}});})[_0xa042('0x13')](function(){oauth[_0xa042('0x56')](_0x522b01);socket[_0xa042('0x57')]('microsoftAuthorization:success',{'id':_0x5b5bf3['id']});return;})[_0xa042('0x13')](respondWithStatusCode(_0x21e883,null))[_0xa042('0x36')](function(_0x1fd3c2){if(_0x5b5bf3){socket['emit'](_0xa042('0x58'),{'id':_0x5b5bf3['id']});}if(!_0x522b01){logger[_0xa042('0x15')](_0xa042('0x59'),_0x1fd3c2);return _0x21e883[_0xa042('0xc')](0x1f4)[_0xa042('0x5a')](_0x1fd3c2[_0xa042('0x5b')]);}logger[_0xa042('0x15')](_0xa042('0x5c'),_0x522b01['id'],JSON[_0xa042('0x5d')](_0x1fd3c2));});}; \ No newline at end of file +var _0x5e07=['sort','where','pick','filters','filter','merge','includeAll','include','findAll','rows','MicrosoftAzure','decryptString','data3','catch','show','params','keys','options','find','service','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','oauth2MicrosoftAuthorize','findOne','sendStatus','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','from','base64','toString','ascii','parse','isValidIdToken','id_token','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','access_token','data6','refresh_token','data5','startRefreshInterval','microsoftAuthorization:success','emit','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../config/environment','api','../../mysqldb','./cloudProvider.oauth','defaults','localhost','socket.io-emitter','redis','status','json','offset','undefined','count','set','update','destroy','then','error','name','send','padEnd','slice','CloudProvider','rawAttributes','fieldName','key','map','query','attributes','intersection','model','fields','length','hasOwnProperty','limit','order'];(function(_0x419ffd,_0x10bdfe){var _0xb0b19d=function(_0x335815){while(--_0x335815){_0x419ffd['push'](_0x419ffd['shift']());}};_0xb0b19d(++_0x10bdfe);}(_0x5e07,0x9b));var _0x75e0=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x5e07[_0x4154a6];return _0x3b2786;};'use strict';var _=require(_0x75e0('0x0'));var Redis=require(_0x75e0('0x1'));var qs=require(_0x75e0('0x2'));var encryptor=require('../../components/encryptor');var config=require(_0x75e0('0x3'));var logger=require('../../config/logger')(_0x75e0('0x4'));var db=require(_0x75e0('0x5'))['db'];var oauth=require(_0x75e0('0x6'));config['redis']=_[_0x75e0('0x7')](config['redis'],{'host':_0x75e0('0x8'),'port':0x18eb});var socket=require(_0x75e0('0x9'))(new Redis(config[_0x75e0('0xa')]));var redis=new Redis(config[_0x75e0('0xa')]);function respondWithStatusCode(_0x3901b1,_0x9e1882){_0x9e1882=_0x9e1882||0xcc;return function(_0x344729){if(_0x344729){return _0x3901b1['sendStatus'](_0x9e1882);}return _0x3901b1[_0x75e0('0xb')](_0x9e1882)['end']();};}function respondWithResult(_0xe30ffc,_0x4968ad){_0x4968ad=_0x4968ad||0xc8;return function(_0x214a14){if(_0x214a14){return _0xe30ffc[_0x75e0('0xb')](_0x4968ad)[_0x75e0('0xc')](_0x214a14);}};}function respondWithFilteredResult(_0x2134ec,_0x132761){return function(_0x281077){if(_0x281077){var _0x277022=typeof _0x132761[_0x75e0('0xd')]===_0x75e0('0xe')&&typeof _0x132761['limit']==='undefined';var _0x59d17f=_0x281077[_0x75e0('0xf')];var _0x493755=_0x277022?0x0:_0x132761[_0x75e0('0xd')];var _0x323605=_0x277022?_0x281077['count']:_0x132761[_0x75e0('0xd')]+_0x132761['limit'];var _0x44edeb;if(_0x323605>=_0x59d17f){_0x323605=_0x59d17f;_0x44edeb=0xc8;}else{_0x44edeb=0xce;}_0x2134ec['status'](_0x44edeb);return _0x2134ec[_0x75e0('0x10')]('Content-Range',_0x493755+'-'+_0x323605+'/'+_0x59d17f)[_0x75e0('0xc')](_0x281077);}return null;};}function saveUpdates(_0x1b3726){return function(_0x1b9987){if(_0x1b9987){return _0x1b9987[_0x75e0('0x11')](_0x1b3726)['then'](function(_0x26c67b){return _0x26c67b;});}return null;};}function removeEntity(_0x1d083d){return function(_0x15f3cf){if(_0x15f3cf){return _0x15f3cf[_0x75e0('0x12')]()[_0x75e0('0x13')](function(){_0x1d083d[_0x75e0('0xb')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b41d5){return function(_0x380374){if(!_0x380374){_0x1b41d5['sendStatus'](0x194);}return _0x380374;};}function handleError(_0x9db82c,_0x4b6e7d){_0x4b6e7d=_0x4b6e7d||0x1f4;return function(_0x2e48eb){logger[_0x75e0('0x14')](_0x2e48eb['stack']);if(_0x2e48eb[_0x75e0('0x15')]){delete _0x2e48eb['name'];}_0x9db82c[_0x75e0('0xb')](_0x4b6e7d)[_0x75e0('0x16')](_0x2e48eb);};}function maskClientSecret(_0x22e84d){return _[_0x75e0('0x17')](_0x22e84d[_0x75e0('0x18')](0x0,0x3),0x14,'*');}exports['index']=function(_0x50151c,_0x338a6a){var _0x300d2a={},_0x1e5a5f={},_0x20c795={'count':0x0,'rows':[]};var _0x20baad=_['map'](db[_0x75e0('0x19')][_0x75e0('0x1a')],function(_0x151d46){return{'name':_0x151d46[_0x75e0('0x1b')],'type':_0x151d46['type'][_0x75e0('0x1c')]};});_0x1e5a5f['model']=_[_0x75e0('0x1d')](_0x20baad,'name');_0x1e5a5f[_0x75e0('0x1e')]=_['keys'](_0x50151c[_0x75e0('0x1e')]);_0x1e5a5f['filters']=_['intersection'](_0x1e5a5f['model'],_0x1e5a5f[_0x75e0('0x1e')]);_0x300d2a[_0x75e0('0x1f')]=_[_0x75e0('0x20')](_0x1e5a5f[_0x75e0('0x21')],qs[_0x75e0('0x22')](_0x50151c['query'][_0x75e0('0x22')]));_0x300d2a[_0x75e0('0x1f')]=_0x300d2a[_0x75e0('0x1f')][_0x75e0('0x23')]?_0x300d2a[_0x75e0('0x1f')]:_0x1e5a5f[_0x75e0('0x21')];if(!_0x50151c[_0x75e0('0x1e')][_0x75e0('0x24')]('nolimit')){_0x300d2a['limit']=qs[_0x75e0('0x25')](_0x50151c['query'][_0x75e0('0x25')]);_0x300d2a[_0x75e0('0xd')]=qs[_0x75e0('0xd')](_0x50151c[_0x75e0('0x1e')][_0x75e0('0xd')]);}_0x300d2a[_0x75e0('0x26')]=qs['sort'](_0x50151c[_0x75e0('0x1e')][_0x75e0('0x27')]);_0x300d2a[_0x75e0('0x28')]=qs['filters'](_[_0x75e0('0x29')](_0x50151c[_0x75e0('0x1e')],_0x1e5a5f[_0x75e0('0x2a')]),_0x20baad);if(_0x50151c['query'][_0x75e0('0x2b')]){_0x300d2a[_0x75e0('0x28')]=_[_0x75e0('0x2c')](_0x300d2a[_0x75e0('0x28')],{'$or':_[_0x75e0('0x1d')](_0x20baad,function(_0xa1e6cf){if(_0xa1e6cf['type']!=='VIRTUAL'){var _0x3c56ae={};_0x3c56ae[_0xa1e6cf['name']]={'$like':'%'+_0x50151c[_0x75e0('0x1e')][_0x75e0('0x2b')]+'%'};return _0x3c56ae;}})});}_0x300d2a=_[_0x75e0('0x2c')]({},_0x300d2a,_0x50151c['options']);var _0x2c7559={'where':_0x300d2a['where']};return db[_0x75e0('0x19')]['count'](_0x2c7559)[_0x75e0('0x13')](function(_0x2d44e4){_0x20c795[_0x75e0('0xf')]=_0x2d44e4;if(_0x50151c[_0x75e0('0x1e')][_0x75e0('0x2d')]){_0x300d2a[_0x75e0('0x2e')]=[{'all':!![]}];}return db['CloudProvider'][_0x75e0('0x2f')](_0x300d2a);})[_0x75e0('0x13')](function(_0x523ffb){_0x20c795[_0x75e0('0x30')]=_[_0x75e0('0x1d')](_0x523ffb,function(_0x5d5d00){if(_0x5d5d00['service']===_0x75e0('0x31')){var _0xba1fc7=encryptor[_0x75e0('0x32')](_0x5d5d00[_0x75e0('0x33')]);_0x5d5d00[_0x75e0('0x33')]=maskClientSecret(_0xba1fc7);}return _0x5d5d00;});return _0x20c795;})['then'](respondWithFilteredResult(_0x338a6a,_0x300d2a))[_0x75e0('0x34')](handleError(_0x338a6a,null));};exports[_0x75e0('0x35')]=function(_0x58aa02,_0x22da31){var _0x4412fe={'raw':!![],'where':{'id':_0x58aa02[_0x75e0('0x36')]['id']}},_0x266282={};_0x266282['model']=_['keys'](db[_0x75e0('0x19')][_0x75e0('0x1a')]);_0x266282[_0x75e0('0x1e')]=_[_0x75e0('0x37')](_0x58aa02[_0x75e0('0x1e')]);_0x266282[_0x75e0('0x2a')]=_[_0x75e0('0x20')](_0x266282[_0x75e0('0x21')],_0x266282['query']);_0x4412fe[_0x75e0('0x1f')]=_[_0x75e0('0x20')](_0x266282['model'],qs[_0x75e0('0x22')](_0x58aa02[_0x75e0('0x1e')][_0x75e0('0x22')]));_0x4412fe[_0x75e0('0x1f')]=_0x4412fe[_0x75e0('0x1f')]['length']?_0x4412fe[_0x75e0('0x1f')]:_0x266282['model'];if(_0x58aa02[_0x75e0('0x1e')][_0x75e0('0x2d')]){_0x4412fe[_0x75e0('0x2e')]=[{'all':!![]}];}_0x4412fe=_[_0x75e0('0x2c')]({},_0x4412fe,_0x58aa02[_0x75e0('0x38')]);return db['CloudProvider'][_0x75e0('0x39')](_0x4412fe)[_0x75e0('0x13')](handleEntityNotFound(_0x22da31,null))[_0x75e0('0x13')](function(_0xeb35e9){if(_0xeb35e9[_0x75e0('0x3a')]==='MicrosoftAzure'){var _0x1e84bb=encryptor[_0x75e0('0x32')](_0xeb35e9[_0x75e0('0x33')]);_0xeb35e9[_0x75e0('0x33')]=maskClientSecret(_0x1e84bb);}return _0xeb35e9;})[_0x75e0('0x13')](respondWithResult(_0x22da31,null))[_0x75e0('0x34')](handleError(_0x22da31,null));};exports[_0x75e0('0x3b')]=function(_0x2616c4,_0x5c2176){if(!_0x2616c4[_0x75e0('0x3c')]['name'])throw new Error(_0x75e0('0x3d'));if(!_0x2616c4[_0x75e0('0x3c')][_0x75e0('0x3a')])throw new Error(_0x75e0('0x3e'));var _0x4be587=db[_0x75e0('0x19')]['rawAttributes']['service'][_0x75e0('0x3f')];if(!_0x4be587[_0x75e0('0x40')](_0x2616c4['body'][_0x75e0('0x3a')]))throw new Error(_0x75e0('0x41')+_0x4be587[_0x75e0('0x42')](',\x20'));if(_0x2616c4[_0x75e0('0x3c')][_0x75e0('0x3a')]==='MicrosoftAzure'&&_0x2616c4[_0x75e0('0x3c')][_0x75e0('0x33')]){_0x2616c4[_0x75e0('0x3c')][_0x75e0('0x33')]=encryptor[_0x75e0('0x43')](_0x2616c4[_0x75e0('0x3c')][_0x75e0('0x33')]);}return db[_0x75e0('0x19')][_0x75e0('0x3b')](_0x2616c4[_0x75e0('0x3c')],{})[_0x75e0('0x13')](respondWithResult(_0x5c2176,0xc9))[_0x75e0('0x34')](handleError(_0x5c2176,null));};exports['update']=function(_0x21f909,_0x55e820){if(_0x21f909['body']['id']){delete _0x21f909[_0x75e0('0x3c')]['id'];}return db[_0x75e0('0x19')][_0x75e0('0x39')]({'where':{'id':_0x21f909['params']['id']}})['then'](handleEntityNotFound(_0x55e820,null))[_0x75e0('0x13')](function(_0x47037b){if(_0x47037b[_0x75e0('0x3a')]===_0x75e0('0x31')&&_0x21f909[_0x75e0('0x3c')][_0x75e0('0x33')]){_0x21f909[_0x75e0('0x3c')][_0x75e0('0x33')]=encryptor[_0x75e0('0x43')](_0x21f909['body'][_0x75e0('0x33')]);}return _0x47037b;})['then'](saveUpdates(_0x21f909['body'],null))[_0x75e0('0x13')](respondWithResult(_0x55e820,null))[_0x75e0('0x34')](handleError(_0x55e820,null));};exports[_0x75e0('0x12')]=function(_0x25dce5,_0xf861ed){return db[_0x75e0('0x19')][_0x75e0('0x39')]({'where':{'id':_0x25dce5[_0x75e0('0x36')]['id']}})[_0x75e0('0x13')](handleEntityNotFound(_0xf861ed,null))[_0x75e0('0x13')](removeEntity(_0xf861ed,null))['catch'](handleError(_0xf861ed,null));};exports[_0x75e0('0x44')]=function(_0x4cae8c,_0x37352c){return db[_0x75e0('0x19')][_0x75e0('0x45')]({'where':{'id':_0x4cae8c[_0x75e0('0x36')]['id']},'raw':!![]})[_0x75e0('0x13')](function(_0x18c744){if(!_0x18c744)return _0x37352c[_0x75e0('0x46')](0x194);return{'url':oauth[_0x75e0('0x47')](_0x18c744,_0x4cae8c[_0x75e0('0x48')]['id'])};})[_0x75e0('0x13')](respondWithResult(_0x37352c,null))[_0x75e0('0x34')](handleError(_0x37352c,null));};exports[_0x75e0('0x49')]=function(_0x44b1a5,_0x2ed63f){var _0x4348fe=_0x44b1a5[_0x75e0('0x3c')];var _0x40c0e2;var _0x456f74;if(_0x4348fe[_0x75e0('0x14')])throw _0x4348fe;redis[_0x75e0('0x4a')](_0x4348fe[_0x75e0('0x4b')])['then'](function(_0x119840){if(!_0x119840)throw new Error('Invalid\x20state\x20parameter');_0x40c0e2=JSON['parse'](_0x119840);var _0x32bade=Buffer[_0x75e0('0x4c')](_0x4348fe[_0x75e0('0x4b')],_0x75e0('0x4d'))[_0x75e0('0x4e')](_0x75e0('0x4f'));_0x456f74=JSON[_0x75e0('0x50')](_0x32bade);if(!oauth[_0x75e0('0x51')](_0x4348fe[_0x75e0('0x52')],_0x40c0e2['oauth2Claims']))throw new Error(_0x75e0('0x53'));redis[_0x75e0('0x54')](_0x4348fe[_0x75e0('0x4b')]);return oauth[_0x75e0('0x55')](_0x4348fe[_0x75e0('0x56')],_0x40c0e2);})[_0x75e0('0x13')](function(_0x5aaeb7){_0x40c0e2['data5']=_0x5aaeb7[_0x75e0('0x57')];_0x40c0e2[_0x75e0('0x58')]=_0x5aaeb7[_0x75e0('0x59')];return db[_0x75e0('0x19')][_0x75e0('0x11')]({'data5':_0x40c0e2[_0x75e0('0x5a')],'data6':_0x40c0e2['data6']},{'where':{'id':_0x40c0e2['id']}});})['then'](function(){oauth[_0x75e0('0x5b')](_0x40c0e2);socket['emit'](_0x75e0('0x5c'),{'id':_0x456f74['id']});return;})[_0x75e0('0x13')](respondWithStatusCode(_0x2ed63f,null))[_0x75e0('0x34')](function(_0x2cdc25){if(_0x456f74){socket[_0x75e0('0x5d')]('microsoftAuthorization:error',{'id':_0x456f74['id']});}if(!_0x40c0e2){logger[_0x75e0('0x14')]('Invalid\x20authentication\x20state\x20parameter',_0x2cdc25);return _0x2ed63f[_0x75e0('0xb')](0x1f4)[_0x75e0('0x16')](_0x2cdc25[_0x75e0('0x5e')]);}logger[_0x75e0('0x14')](_0x75e0('0x5f'),_0x40c0e2['id'],JSON[_0x75e0('0x60')](_0x2cdc25));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 4f5a1c5..877b7b4 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 _0x5e9f=['./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','api','request-promise','path','rimraf'];(function(_0x1c0b6e,_0x2a7562){var _0x29f883=function(_0x44e420){while(--_0x44e420){_0x1c0b6e['push'](_0x1c0b6e['shift']());}};_0x29f883(++_0x2a7562);}(_0x5e9f,0x1f4));var _0xf5e9=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x5e9f[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0xf5e9('0x0'));var util=require(_0xf5e9('0x1'));var logger=require('../../config/logger')(_0xf5e9('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf5e9('0x3'));var fs=require('fs');var path=require(_0xf5e9('0x4'));var rimraf=require(_0xf5e9('0x5'));var config=require('../../config/environment');var attributes=require(_0xf5e9('0x6'));module[_0xf5e9('0x7')]=function(_0xb16e57,_0x4c625b){return _0xb16e57[_0xf5e9('0x8')](_0xf5e9('0x9'),attributes,{'tableName':_0xf5e9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x835f=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','util'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x835f,0xc2));var _0xf835=function(_0x3f3f40,_0x4c71f4){_0x3f3f40=_0x3f3f40-0x0;var _0x403b7a=_0x835f[_0x3f3f40];return _0x403b7a;};'use strict';var _=require('lodash');var util=require(_0xf835('0x0'));var logger=require(_0xf835('0x1'))('api');var moment=require(_0xf835('0x2'));var BPromise=require(_0xf835('0x3'));var rp=require(_0xf835('0x4'));var fs=require('fs');var path=require(_0xf835('0x5'));var rimraf=require(_0xf835('0x6'));var config=require(_0xf835('0x7'));var attributes=require(_0xf835('0x8'));module[_0xf835('0x9')]=function(_0x2fe27a,_0x2748b5){return _0x2fe27a[_0xf835('0xa')](_0xf835('0xb'),attributes,{'tableName':_0xf835('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index dc7e9b4..d639fe2 100644 --- a/server/api/cloudProvider/cloudProvider.oauth.js +++ b/server/api/cloudProvider/cloudProvider.oauth.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf78e=['../../mysqldb','defaults','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','map','type','Dynamics365','push','/.default','join','Outlook365','data7','replace','{TENANT_ID}','data2','code','stringify','toString','base64','hex','response_mode','form_post','scope','state','nonce','prompt','login','value','data1','set','decode','payload','issuer','aud','audience','unix','resolve','then','data3','CloudProvider','data6','data4','decryptString','data5','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','POST','intervals','findAll','all','catch','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','crypto','jsonwebtoken','ioredis','request-promise','util','../../components/encryptor','../../config/schedule/cloud-provider'];(function(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0xf78e,0x83));var _0xef78=function(_0x13fe35,_0x537cee){_0x13fe35=_0x13fe35-0x0;var _0x4875a8=_0xf78e[_0x13fe35];return _0x4875a8;};'use strict';var _=require('lodash');var crypto=require(_0xef78('0x0'));var jwt=require(_0xef78('0x1'));var moment=require('moment');var Redis=require(_0xef78('0x2'));var rp=require(_0xef78('0x3'));var util=require(_0xef78('0x4'));var encryptor=require(_0xef78('0x5'));var config=require('../../config/environment');var logger=require('../../config/logger')('api');var schedule=require(_0xef78('0x6'));var db=require(_0xef78('0x7'))['db'];config['redis']=_[_0xef78('0x8')](config[_0xef78('0x9')],{'host':_0xef78('0xa'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0xef78('0xb');var AZURE_AUTH_SCOPES={'Outlook365':[_0xef78('0xc'),'profile',_0xef78('0xd'),_0xef78('0xe'),_0xef78('0xf'),'https://outlook.office.com/POP.AccessAsUser.All',_0xef78('0x10')],'Dynamics365':[_0xef78('0xc'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0xef78('0x11');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x29bc53){var _0xf974e6=_[_0xef78('0x12')](AZURE_AUTH_SCOPES[_0x29bc53[_0xef78('0x13')]]);if(_0x29bc53[_0xef78('0x13')]===_0xef78('0x14'))_0xf974e6[_0xef78('0x15')](_0x29bc53['data7']+_0xef78('0x16'));return _0xf974e6[_0xef78('0x17')]('\x20');}function getAccessTokenScope(_0x3c1624){if(_0x3c1624[_0xef78('0x13')]===_0xef78('0x18'))return _0xef78('0xf');if(_0x3c1624[_0xef78('0x13')]==='Dynamics365')return _0x3c1624[_0xef78('0x19')]+_0xef78('0x16');}function generateMicrosoftAuthorizationUrl(_0x47d54a,_0xbb3e33){var _0x2d531d=MICROSOFT_AUTH_URL[_0xef78('0x1a')](_0xef78('0x1b'),_0x47d54a[_0xef78('0x1c')]);var _0xcf4ef8=[_0xef78('0x1d'),'id_token'];var _0xbfa00b=Buffer['from'](JSON[_0xef78('0x1e')]({'id':_0xbb3e33}))[_0xef78('0x1f')](_0xef78('0x20'));var _0x1b1582=crypto['randomBytes'](0x10)['toString'](_0xef78('0x21'));var _0x2caf3a=getAuthorizationScopes(_0x47d54a);var _0x3ca762=[{'key':'client_id','value':_0x47d54a['data1']},{'key':'response_type','value':encodeURIComponent(_0xcf4ef8['join']('\x20'))},{'key':'redirect_uri','value':_0x47d54a['data4']},{'key':_0xef78('0x22'),'value':_0xef78('0x23')},{'key':_0xef78('0x24'),'value':encodeURIComponent(_0x2caf3a)},{'key':_0xef78('0x25'),'value':_0xbfa00b},{'key':_0xef78('0x26'),'value':_0x1b1582},{'key':_0xef78('0x27'),'value':_0xef78('0x28')}];var _0x34e9ac=_0x2d531d+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xef78('0x12')](_0x3ca762,function(_0x2a159a){return _0x2a159a['key']+'='+_0x2a159a[_0xef78('0x29')];})[_0xef78('0x17')]('&');_0x47d54a['oauth2Claims']={'issuer':_0x2d531d[_0xef78('0x1a')]('oauth2/',''),'audience':_0x47d54a[_0xef78('0x2a')],'state':_0xbfa00b,'nonce':_0x1b1582};redis[_0xef78('0x2b')](_0xbfa00b,JSON['stringify'](_0x47d54a));return _0x34e9ac;}function isValidIdToken(_0x20d0e9,_0x334704){try{var _0x407595=jwt[_0xef78('0x2c')](_0x20d0e9,{'complete':!![]});var _0x382b61=_0x407595[_0xef78('0x2d')];if(_0x382b61['iss']!==_0x334704[_0xef78('0x2e')])return![];if(_0x382b61[_0xef78('0x2f')]!==_0x334704[_0xef78('0x30')])return![];if(_0x382b61[_0xef78('0x26')]!==_0x334704[_0xef78('0x26')])return![];if(moment()['isAfter'](moment[_0xef78('0x31')](_0x382b61['exp'])))return![];return!![];}catch(_0x507d60){throw _0x507d60;}}function refreshOauth2MicrosoftAccessToken(_0x1c5e90){return Promise[_0xef78('0x32')]()[_0xef78('0x33')](function(){if(_0x1c5e90[_0xef78('0x34')])return _0x1c5e90;return db[_0xef78('0x35')]['findOne']({'where':{'id':_0x1c5e90['id']},'raw':!![]});})[_0xef78('0x33')](function(_0x431630){var _0x4b17d8={'grant_type':'refresh_token','refresh_token':_0x431630[_0xef78('0x36')],'scope':getAccessTokenScope(_0x431630),'redirect_uri':_0x431630[_0xef78('0x37')],'client_id':_0x431630[_0xef78('0x2a')],'client_secret':encryptor[_0xef78('0x38')](_0x431630[_0xef78('0x34')])};var _0x483199={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xef78('0x1a')](_0xef78('0x1b'),_0x431630[_0xef78('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4b17d8,'json':!![]};return rp(_0x483199);})['then'](function(_0x456fee){_0x1c5e90['data5']=_0x456fee['access_token'];_0x1c5e90[_0xef78('0x36')]=_0x456fee['refresh_token'];return db[_0xef78('0x35')]['update']({'data5':_0x1c5e90[_0xef78('0x39')],'data6':_0x1c5e90[_0xef78('0x36')]},{'where':{'id':_0x1c5e90['id']}});})[_0xef78('0x33')](function(){return _0x1c5e90;})['catch'](function(_0x26b9cb){logger[_0xef78('0x3a')](_0xef78('0x3b'),_0x1c5e90['id'],_0x26b9cb);});}function getOauth2MicrosoftAccessToken(_0x31ee23,_0x11491a){var _0x39e6f={'grant_type':_0xef78('0x3c'),'code':_0x31ee23,'scope':getAccessTokenScope(_0x11491a),'redirect_uri':_0x11491a[_0xef78('0x37')],'client_id':_0x11491a['data1'],'client_secret':encryptor[_0xef78('0x38')](_0x11491a[_0xef78('0x34')])};var _0x1a6fb1={'method':_0xef78('0x3d'),'uri':MICROSOFT_AUTH_URL[_0xef78('0x1a')](_0xef78('0x1b'),_0x11491a[_0xef78('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x39e6f,'json':!![]};return rp(_0x1a6fb1);}function startRefreshInterval(_0x34bb4a){var _0x252581=schedule[_0xef78('0x3e')];if(_0x252581[_0x34bb4a['id']])clearInterval(_0x252581[_0x34bb4a['id']]);_0x252581[_0x34bb4a['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x34bb4a['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x252581;}function startAllRefreshIntervals(){return db[_0xef78('0x35')][_0xef78('0x3f')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x15502e){var _0x5d3d68=_0x15502e[_0xef78('0x12')](function(_0x41dbdd){return refreshOauth2MicrosoftAccessToken(_0x41dbdd)[_0xef78('0x33')](function(_0x22e85a){startRefreshInterval(_0x22e85a);});});return Promise[_0xef78('0x40')](_0x5d3d68);})[_0xef78('0x41')](function(_0x3e939d){var _0x18b9c9=_0x3e939d?util[_0xef78('0x42')](_0x3e939d,{'showHidden':![],'depth':null}):'';logger[_0xef78('0x3a')](_0xef78('0x43'),_0x18b9c9);});}module[_0xef78('0x44')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x6576=['util','../../config/environment','api','../../config/schedule/cloud-provider','redis','localhost','openid','profile','email','offline_access','https://outlook.office.com/POP.AccessAsUser.All','/authorize','/token','map','type','data7','join','Dynamics365','{TENANT_ID}','data2','code','stringify','toString','base64','randomBytes','hex','client_id','data1','response_type','redirect_uri','response_mode','form_post','state','nonce','prompt','login','key','oauth2Claims','replace','set','decode','payload','iss','isAfter','unix','exp','resolve','then','data3','findOne','refresh_token','data6','data4','POST','data5','access_token','CloudProvider','update','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','decryptString','intervals','bind','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0x6576,0x1b0));var _0x6657=function(_0x77fd25,_0x226ea2){_0x77fd25=_0x77fd25-0x0;var _0xe14528=_0x6576[_0x77fd25];return _0xe14528;};'use strict';var _=require(_0x6657('0x0'));var crypto=require(_0x6657('0x1'));var jwt=require(_0x6657('0x2'));var moment=require(_0x6657('0x3'));var Redis=require(_0x6657('0x4'));var rp=require(_0x6657('0x5'));var util=require(_0x6657('0x6'));var encryptor=require('../../components/encryptor');var config=require(_0x6657('0x7'));var logger=require('../../config/logger')(_0x6657('0x8'));var schedule=require(_0x6657('0x9'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x6657('0xa')],{'host':_0x6657('0xb'),'port':0x18eb});var redis=new Redis(config[_0x6657('0xa')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0x6657('0xc'),_0x6657('0xd'),_0x6657('0xe'),_0x6657('0xf'),'https://outlook.office365.com/IMAP.AccessAsUser.All',_0x6657('0x10'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0x6657('0xc'),_0x6657('0xf')]};var MICROSOFT_AUTH_ENDPOINT=_0x6657('0x11');var MICROSOFT_TOKEN_ENDPOINT=_0x6657('0x12');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x3810ec){var _0x3d6c9e=_[_0x6657('0x13')](AZURE_AUTH_SCOPES[_0x3810ec[_0x6657('0x14')]]);if(_0x3810ec[_0x6657('0x14')]==='Dynamics365')_0x3d6c9e['push'](_0x3810ec[_0x6657('0x15')]+'/.default');return _0x3d6c9e[_0x6657('0x16')]('\x20');}function getAccessTokenScope(_0x30657b){if(_0x30657b[_0x6657('0x14')]==='Outlook365')return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x30657b[_0x6657('0x14')]===_0x6657('0x17'))return _0x30657b[_0x6657('0x15')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x347b11,_0x3b24c9){var _0x5d74e8=MICROSOFT_AUTH_URL['replace'](_0x6657('0x18'),_0x347b11[_0x6657('0x19')]);var _0x4c1fc0=[_0x6657('0x1a'),'id_token'];var _0x4e8758=Buffer['from'](JSON[_0x6657('0x1b')]({'id':_0x3b24c9}))[_0x6657('0x1c')](_0x6657('0x1d'));var _0x4c7b57=crypto[_0x6657('0x1e')](0x10)[_0x6657('0x1c')](_0x6657('0x1f'));var _0x177f1b=getAuthorizationScopes(_0x347b11);var _0x119dd2=[{'key':_0x6657('0x20'),'value':_0x347b11[_0x6657('0x21')]},{'key':_0x6657('0x22'),'value':encodeURIComponent(_0x4c1fc0['join']('\x20'))},{'key':_0x6657('0x23'),'value':_0x347b11['data4']},{'key':_0x6657('0x24'),'value':_0x6657('0x25')},{'key':'scope','value':encodeURIComponent(_0x177f1b)},{'key':_0x6657('0x26'),'value':_0x4e8758},{'key':_0x6657('0x27'),'value':_0x4c7b57},{'key':_0x6657('0x28'),'value':_0x6657('0x29')}];var _0x388dc1=_0x5d74e8+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x6657('0x13')](_0x119dd2,function(_0x354dfb){return _0x354dfb[_0x6657('0x2a')]+'='+_0x354dfb['value'];})[_0x6657('0x16')]('&');_0x347b11[_0x6657('0x2b')]={'issuer':_0x5d74e8[_0x6657('0x2c')]('oauth2/',''),'audience':_0x347b11['data1'],'state':_0x4e8758,'nonce':_0x4c7b57};redis[_0x6657('0x2d')](_0x4e8758,JSON[_0x6657('0x1b')](_0x347b11));return _0x388dc1;}function isValidIdToken(_0x3f4869,_0x4b1dbf){try{var _0x36d564=jwt[_0x6657('0x2e')](_0x3f4869,{'complete':!![]});var _0x1f7e9d=_0x36d564[_0x6657('0x2f')];if(_0x1f7e9d[_0x6657('0x30')]!==_0x4b1dbf['issuer'])return![];if(_0x1f7e9d['aud']!==_0x4b1dbf['audience'])return![];if(_0x1f7e9d['nonce']!==_0x4b1dbf[_0x6657('0x27')])return![];if(moment()[_0x6657('0x31')](moment[_0x6657('0x32')](_0x1f7e9d[_0x6657('0x33')])))return![];return!![];}catch(_0x5cb749){throw _0x5cb749;}}function refreshOauth2MicrosoftAccessToken(_0x1b717c){return Promise[_0x6657('0x34')]()[_0x6657('0x35')](function(){if(_0x1b717c[_0x6657('0x36')])return _0x1b717c;return db['CloudProvider'][_0x6657('0x37')]({'where':{'id':_0x1b717c['id']},'raw':!![]});})['then'](function(_0xa6bc3b){var _0x4c1e59={'grant_type':_0x6657('0x38'),'refresh_token':_0xa6bc3b[_0x6657('0x39')],'scope':getAccessTokenScope(_0xa6bc3b),'redirect_uri':_0xa6bc3b[_0x6657('0x3a')],'client_id':_0xa6bc3b[_0x6657('0x21')],'client_secret':encryptor['decryptString'](_0xa6bc3b['data3'])};var _0x48f28d={'method':_0x6657('0x3b'),'uri':MICROSOFT_AUTH_URL[_0x6657('0x2c')]('{TENANT_ID}',_0xa6bc3b[_0x6657('0x19')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4c1e59,'json':!![]};return rp(_0x48f28d);})[_0x6657('0x35')](function(_0x24d8b7){_0x1b717c[_0x6657('0x3c')]=_0x24d8b7[_0x6657('0x3d')];_0x1b717c[_0x6657('0x39')]=_0x24d8b7[_0x6657('0x38')];return db[_0x6657('0x3e')][_0x6657('0x3f')]({'data5':_0x1b717c[_0x6657('0x3c')],'data6':_0x1b717c[_0x6657('0x39')]},{'where':{'id':_0x1b717c['id']}});})['then'](function(){return _0x1b717c;})[_0x6657('0x40')](function(_0x62439c){logger['error'](_0x6657('0x41'),_0x1b717c['id'],_0x62439c);});}function getOauth2MicrosoftAccessToken(_0x5f1ce8,_0x184999){var _0x567d0b={'grant_type':'authorization_code','code':_0x5f1ce8,'scope':getAccessTokenScope(_0x184999),'redirect_uri':_0x184999[_0x6657('0x3a')],'client_id':_0x184999[_0x6657('0x21')],'client_secret':encryptor[_0x6657('0x42')](_0x184999[_0x6657('0x36')])};var _0x5bcb89={'method':_0x6657('0x3b'),'uri':MICROSOFT_AUTH_URL[_0x6657('0x2c')](_0x6657('0x18'),_0x184999[_0x6657('0x19')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x567d0b,'json':!![]};return rp(_0x5bcb89);}function startRefreshInterval(_0x222409){var _0x4b0155=schedule[_0x6657('0x43')];if(_0x4b0155[_0x222409['id']])clearInterval(_0x4b0155[_0x222409['id']]);_0x4b0155[_0x222409['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x6657('0x44')](this,{'id':_0x222409['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x4b0155;}function startAllRefreshIntervals(){return db[_0x6657('0x3e')][_0x6657('0x45')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x6657('0x35')](function(_0x577e30){var _0x2d7ac1=_0x577e30['map'](function(_0x3e79c5){return refreshOauth2MicrosoftAccessToken(_0x3e79c5)[_0x6657('0x35')](function(_0x450ba3){startRefreshInterval(_0x450ba3);});});return Promise[_0x6657('0x46')](_0x2d7ac1);})['catch'](function(_0x45aa10){var _0x14cd30=_0x45aa10?util[_0x6657('0x47')](_0x45aa10,{'showHidden':![],'depth':null}):'';logger['error'](_0x6657('0x48'),_0x14cd30);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index d3a9358..c7658fe 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 _0x59ac=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','CloudProvider,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch'];(function(_0x47d18a,_0xd53074){var _0x130c43=function(_0x380f11){while(--_0x380f11){_0x47d18a['push'](_0x47d18a['shift']());}};_0x130c43(++_0xd53074);}(_0x59ac,0x73));var _0xc59a=function(_0xbd77c1,_0x50b969){_0xbd77c1=_0xbd77c1-0x0;var _0x47fa83=_0x59ac[_0xbd77c1];return _0x47fa83;};'use strict';var _=require(_0xc59a('0x0'));var util=require(_0xc59a('0x1'));var moment=require(_0xc59a('0x2'));var BPromise=require(_0xc59a('0x3'));var rs=require(_0xc59a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc59a('0x5'))['db'];var utils=require(_0xc59a('0x6'));var logger=require('../../config/logger')(_0xc59a('0x7'));var config=require(_0xc59a('0x8'));var jayson=require(_0xc59a('0x9'));var client=jayson[_0xc59a('0xa')][_0xc59a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5286c6,_0x364b03,_0x576a51){return new BPromise(function(_0x12806d,_0x5dc514){return client[_0xc59a('0xc')](_0x5286c6,_0x576a51)['then'](function(_0x3ba5c0){logger['info'](_0xc59a('0xd'),_0x364b03,'request\x20sent');logger[_0xc59a('0xe')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x364b03,_0xc59a('0xf'),JSON[_0xc59a('0x10')](_0x3ba5c0));if(_0x3ba5c0[_0xc59a('0x11')]){if(_0x3ba5c0['error'][_0xc59a('0x12')]===0x1f4){logger[_0xc59a('0x11')](_0xc59a('0xd'),_0x364b03,_0x3ba5c0['error'][_0xc59a('0x13')]);return _0x5dc514(_0x3ba5c0['error'][_0xc59a('0x13')]);}logger[_0xc59a('0x11')](_0xc59a('0xd'),_0x364b03,_0x3ba5c0[_0xc59a('0x11')][_0xc59a('0x13')]);return _0x12806d(_0x3ba5c0[_0xc59a('0x11')][_0xc59a('0x13')]);}else{logger[_0xc59a('0x14')](_0xc59a('0xd'),_0x364b03,_0xc59a('0xf'));_0x12806d(_0x3ba5c0[_0xc59a('0x15')][_0xc59a('0x13')]);}})[_0xc59a('0x16')](function(_0x16c9ef){logger[_0xc59a('0x11')](_0xc59a('0xd'),_0x364b03,_0x16c9ef);_0x5dc514(_0x16c9ef);});});} \ No newline at end of file +var _0x42c3=['message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','request','then','info','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','code','error'];(function(_0x242d6c,_0x301bc8){var _0x6af9a=function(_0x4f81ca){while(--_0x4f81ca){_0x242d6c['push'](_0x242d6c['shift']());}};_0x6af9a(++_0x301bc8);}(_0x42c3,0x1bc));var _0x342c=function(_0x44427a,_0x30b5ba){_0x44427a=_0x44427a-0x0;var _0x399f15=_0x42c3[_0x44427a];return _0x399f15;};'use strict';var _=require(_0x342c('0x0'));var util=require(_0x342c('0x1'));var moment=require(_0x342c('0x2'));var BPromise=require('bluebird');var rs=require(_0x342c('0x3'));var fs=require('fs');var Redis=require(_0x342c('0x4'));var db=require(_0x342c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x342c('0x6'))('rpc');var config=require(_0x342c('0x7'));var jayson=require(_0x342c('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3f6d68,_0x364f48,_0x1da228){return new BPromise(function(_0xe659b6,_0x53e9a8){return client[_0x342c('0x9')](_0x3f6d68,_0x1da228)[_0x342c('0xa')](function(_0x3bc287){logger[_0x342c('0xb')](_0x342c('0xc'),_0x364f48,'request\x20sent');logger[_0x342c('0xd')](_0x342c('0xe'),_0x364f48,_0x342c('0xf'),JSON['stringify'](_0x3bc287));if(_0x3bc287['error']){if(_0x3bc287['error'][_0x342c('0x10')]===0x1f4){logger[_0x342c('0x11')](_0x342c('0xc'),_0x364f48,_0x3bc287[_0x342c('0x11')][_0x342c('0x12')]);return _0x53e9a8(_0x3bc287[_0x342c('0x11')][_0x342c('0x12')]);}logger[_0x342c('0x11')](_0x342c('0xc'),_0x364f48,_0x3bc287[_0x342c('0x11')][_0x342c('0x12')]);return _0xe659b6(_0x3bc287[_0x342c('0x11')][_0x342c('0x12')]);}else{logger[_0x342c('0xb')](_0x342c('0xc'),_0x364f48,_0x342c('0xf'));_0xe659b6(_0x3bc287[_0x342c('0x13')]['message']);}})[_0x342c('0x14')](function(_0x50a286){logger[_0x342c('0x11')](_0x342c('0xc'),_0x364f48,_0x50a286);_0x53e9a8(_0x50a286);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 1b8b0f6..ca67670 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 _0xadb5=['put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','Router','./cloudProvider.controller','get','isAuthenticated','/:id','post','create'];(function(_0x1a38f6,_0x4cf559){var _0x378957=function(_0x5e6f88){while(--_0x5e6f88){_0x1a38f6['push'](_0x1a38f6['shift']());}};_0x378957(++_0x4cf559);}(_0xadb5,0xad));var _0x5adb=function(_0x4fc275,_0x2db4bf){_0x4fc275=_0x4fc275-0x0;var _0x2c854a=_0xadb5[_0x4fc275];return _0x2c854a;};'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['index']);router[_0x5adb('0x2')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller['show']);router[_0x5adb('0x5')]('/',auth[_0x5adb('0x3')](),controller[_0x5adb('0x6')]);router[_0x5adb('0x7')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0xa')]);router[_0x5adb('0x2')](_0x5adb('0xb'),auth[_0x5adb('0x3')](),controller['oauth2MicrosoftAuthorize']);router['post'](_0x5adb('0xc'),controller[_0x5adb('0xd')]);module[_0x5adb('0xe')]=router; \ No newline at end of file +var _0x5f2f=['exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback'];(function(_0x4c8a8f,_0x997ef){var _0x404500=function(_0x1c6072){while(--_0x1c6072){_0x4c8a8f['push'](_0x4c8a8f['shift']());}};_0x404500(++_0x997ef);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5914eb,_0x39edc2){_0x5914eb=_0x5914eb-0x0;var _0x26b8da=_0x5f2f[_0x5914eb];return _0x26b8da;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);router[_0xf5f2('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x7')]);router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x9')]);router[_0xf5f2('0xa')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xc')]);router[_0xf5f2('0xd')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0x4')](_0xf5f2('0xf'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router['post']('/oauth2/microsoft/callback',controller[_0xf5f2('0x11')]);module[_0xf5f2('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 705c587..13b93e1 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 _0x13dd=['STRING','sequelize','exports'];(function(_0x3ac588,_0x1d4856){var _0x51d53d=function(_0x47642b){while(--_0x47642b){_0x3ac588['push'](_0x3ac588['shift']());}};_0x51d53d(++_0x1d4856);}(_0x13dd,0x88));var _0xd13d=function(_0x4396dd,_0x5263ee){_0x4396dd=_0x4396dd-0x0;var _0x3b401c=_0x13dd[_0x4396dd];return _0x3b401c;};'use strict';var Sequelize=require(_0xd13d('0x0'));module[_0xd13d('0x1')]={'name':{'type':Sequelize[_0xd13d('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xd13d('0x2')]},'companyId':{'type':Sequelize[_0xd13d('0x2')]},'website':{'type':Sequelize[_0xd13d('0x2')]},'phone':{'type':Sequelize[_0xd13d('0x2')]},'fax':{'type':Sequelize[_0xd13d('0x2')]},'type':{'type':Sequelize[_0xd13d('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xd13d('0x2')]},'city':{'type':Sequelize[_0xd13d('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xd13d('0x2')]},'sStreet':{'type':Sequelize[_0xd13d('0x2')]},'sPostalCode':{'type':Sequelize[_0xd13d('0x2')]},'sCity':{'type':Sequelize[_0xd13d('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd13d('0x2')]}}; \ No newline at end of file +var _0xe407=['STRING','sequelize','exports'];(function(_0x580710,_0x25bff3){var _0x58b65f=function(_0x46252c){while(--_0x46252c){_0x580710['push'](_0x580710['shift']());}};_0x58b65f(++_0x25bff3);}(_0xe407,0x181));var _0x7e40=function(_0x51a0d5,_0x159779){_0x51a0d5=_0x51a0d5-0x0;var _0x3dae2a=_0xe407[_0x51a0d5];return _0x3dae2a;};'use strict';var Sequelize=require(_0x7e40('0x0'));module[_0x7e40('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x7e40('0x2')]},'companyId':{'type':Sequelize[_0x7e40('0x2')]},'website':{'type':Sequelize[_0x7e40('0x2')]},'phone':{'type':Sequelize[_0x7e40('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x7e40('0x2')]},'street':{'type':Sequelize[_0x7e40('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x7e40('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x7e40('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x7e40('0x2')]},'sStreet':{'type':Sequelize[_0x7e40('0x2')]},'sPostalCode':{'type':Sequelize[_0x7e40('0x2')]},'sCity':{'type':Sequelize[_0x7e40('0x2')]},'sCountry':{'type':Sequelize[_0x7e40('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index e08d61f..3fbde08 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 _0x9d22=['offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','Companies','name','send','index','CmCompany','describe','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','map','filter','options','include','findAll','catch','params','rawAttributes','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','addContacts','findOne','CmContact','order','getContacts','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json'];(function(_0x1ff2ec,_0x386e86){var _0x405683=function(_0x22f921){while(--_0x22f921){_0x1ff2ec['push'](_0x1ff2ec['shift']());}};_0x405683(++_0x386e86);}(_0x9d22,0x12c));var _0x29d2=function(_0x32a81f,_0x4eee66){_0x32a81f=_0x32a81f-0x0;var _0x5b67a2=_0x9d22[_0x32a81f];return _0x5b67a2;};'use strict';var emlformat=require(_0x29d2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x29d2('0x1'));var jsonpatch=require(_0x29d2('0x2'));var rp=require(_0x29d2('0x3'));var moment=require('moment');var BPromise=require(_0x29d2('0x4'));var Mustache=require(_0x29d2('0x5'));var util=require('util');var path=require(_0x29d2('0x6'));var sox=require(_0x29d2('0x7'));var csv=require(_0x29d2('0x8'));var ejs=require(_0x29d2('0x9'));var fs=require('fs');var fs_extra=require(_0x29d2('0xa'));var _=require('lodash');var squel=require(_0x29d2('0xb'));var crypto=require(_0x29d2('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x29d2('0xd'));var toCsv=require(_0x29d2('0x8'));var querystring=require(_0x29d2('0xe'));var Papa=require(_0x29d2('0xf'));var Redis=require(_0x29d2('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x29d2('0x11'));var as=require(_0x29d2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x29d2('0x13'))(_0x29d2('0x14'));var utils=require(_0x29d2('0x15'));var config=require(_0x29d2('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x29d2('0x17'))['db'];function respondWithStatusCode(_0x9228cc,_0x2f70f5){_0x2f70f5=_0x2f70f5||0xcc;return function(_0x275644){if(_0x275644){return _0x9228cc[_0x29d2('0x18')](_0x2f70f5);}return _0x9228cc[_0x29d2('0x19')](_0x2f70f5)[_0x29d2('0x1a')]();};}function respondWithResult(_0x1c1262,_0x22352d){_0x22352d=_0x22352d||0xc8;return function(_0x53d1b4){if(_0x53d1b4){return _0x1c1262['status'](_0x22352d)[_0x29d2('0x1b')](_0x53d1b4);}};}function respondWithFilteredResult(_0x13bd56,_0x48189c){return function(_0x5ec694){if(_0x5ec694){var _0x106dd1=typeof _0x48189c[_0x29d2('0x1c')]===_0x29d2('0x1d')&&typeof _0x48189c[_0x29d2('0x1e')]===_0x29d2('0x1d');var _0x3c3134=_0x5ec694[_0x29d2('0x1f')];var _0x2b4b0d=_0x106dd1?0x0:_0x48189c[_0x29d2('0x1c')];var _0x51c3c5=_0x106dd1?_0x5ec694[_0x29d2('0x1f')]:_0x48189c[_0x29d2('0x1c')]+_0x48189c[_0x29d2('0x1e')];var _0x274413;if(_0x51c3c5>=_0x3c3134){_0x51c3c5=_0x3c3134;_0x274413=0xc8;}else{_0x274413=0xce;}_0x13bd56['status'](_0x274413);return _0x13bd56[_0x29d2('0x20')](_0x29d2('0x21'),_0x2b4b0d+'-'+_0x51c3c5+'/'+_0x3c3134)['json'](_0x5ec694);}return null;};}function patchUpdates(_0x2d62cb){return function(_0x4754c0){try{jsonpatch['apply'](_0x4754c0,_0x2d62cb,!![]);}catch(_0x34e014){return BPromise[_0x29d2('0x22')](_0x34e014);}return _0x4754c0[_0x29d2('0x23')]();};}function saveUpdates(_0x55a748,_0x49f95a){return function(_0x2bdc8c){if(_0x2bdc8c){return _0x2bdc8c[_0x29d2('0x24')](_0x55a748)[_0x29d2('0x25')](function(_0x550c14){return _0x550c14;});}return null;};}function removeEntity(_0x35f020,_0x1274c5){return function(_0x48933c){if(_0x48933c){return _0x48933c[_0x29d2('0x26')]()['then'](function(){var _0x1c5d52=_0x48933c['get']({'plain':!![]});var _0x52c7c8=_0x29d2('0x27');return db['UserProfileResource'][_0x29d2('0x26')]({'where':{'type':_0x52c7c8,'resourceId':_0x1c5d52['id']}})[_0x29d2('0x25')](function(){return _0x48933c;});})[_0x29d2('0x25')](function(){_0x35f020[_0x29d2('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8e0c6e,_0x203d20){return function(_0xe9d61a){if(!_0xe9d61a){_0x8e0c6e[_0x29d2('0x18')](0x194);}return _0xe9d61a;};}function handleError(_0x1553b5,_0x3f3f02){_0x3f3f02=_0x3f3f02||0x1f4;return function(_0x7a9c33){logger['error'](_0x7a9c33['stack']);if(_0x7a9c33[_0x29d2('0x28')]){delete _0x7a9c33[_0x29d2('0x28')];}_0x1553b5[_0x29d2('0x19')](_0x3f3f02)[_0x29d2('0x29')](_0x7a9c33);};}exports[_0x29d2('0x2a')]=function(_0x18a7d6,_0x1527f1){var _0xdbc798={},_0x599882={},_0xd5cb01={'count':0x0,'rows':[]};return db[_0x29d2('0x2b')][_0x29d2('0x2c')]()[_0x29d2('0x25')](function(_0x3cb4c9){_0x599882[_0x29d2('0x2d')]=_['keys'](_0x3cb4c9);_0x599882[_0x29d2('0x2e')]=_[_0x29d2('0x2f')](_0x18a7d6[_0x29d2('0x2e')]);_0x599882[_0x29d2('0x30')]=_[_0x29d2('0x31')](_0x599882['model'],_0x599882[_0x29d2('0x2e')]);_0xdbc798[_0x29d2('0x32')]=_[_0x29d2('0x31')](_0x599882[_0x29d2('0x2d')],qs[_0x29d2('0x33')](_0x18a7d6[_0x29d2('0x2e')][_0x29d2('0x33')]));_0xdbc798[_0x29d2('0x32')]=_0xdbc798[_0x29d2('0x32')][_0x29d2('0x34')]?_0xdbc798['attributes']:_0x599882[_0x29d2('0x2d')];if(!_0x18a7d6[_0x29d2('0x2e')]['hasOwnProperty'](_0x29d2('0x35'))){_0xdbc798['limit']=qs[_0x29d2('0x1e')](_0x18a7d6[_0x29d2('0x2e')][_0x29d2('0x1e')]);_0xdbc798['offset']=qs['offset'](_0x18a7d6[_0x29d2('0x2e')][_0x29d2('0x1c')]);}_0xdbc798['order']=qs['sort'](_0x18a7d6[_0x29d2('0x2e')][_0x29d2('0x36')]);_0xdbc798[_0x29d2('0x37')]=qs[_0x29d2('0x30')](_[_0x29d2('0x38')](_0x18a7d6[_0x29d2('0x2e')],_0x599882[_0x29d2('0x30')]),_0x3cb4c9);if(_0x18a7d6[_0x29d2('0x2e')]['filter']){_0xdbc798[_0x29d2('0x37')]=_[_0x29d2('0x39')](_0xdbc798['where'],{'$or':_[_0x29d2('0x3a')](_0xdbc798[_0x29d2('0x32')],function(_0x243e05){var _0xefe360={};_0xefe360[_0x243e05]={'$like':'%'+_0x18a7d6[_0x29d2('0x2e')][_0x29d2('0x3b')]+'%'};return _0xefe360;})});}_0xdbc798=_['merge']({},_0xdbc798,_0x18a7d6[_0x29d2('0x3c')]);var _0x5e3276={'where':_0xdbc798[_0x29d2('0x37')]};return db[_0x29d2('0x2b')][_0x29d2('0x1f')](_0x5e3276)[_0x29d2('0x25')](function(_0x4a4c9b){_0xd5cb01[_0x29d2('0x1f')]=_0x4a4c9b;if(_0x18a7d6[_0x29d2('0x2e')]['includeAll']){_0xdbc798[_0x29d2('0x3d')]=[{'all':!![]}];}return db[_0x29d2('0x2b')][_0x29d2('0x3e')](_0xdbc798);})[_0x29d2('0x25')](function(_0x16c51b){_0xd5cb01['rows']=_0x16c51b;return _0xd5cb01;})[_0x29d2('0x25')](respondWithFilteredResult(_0x1527f1,_0xdbc798))[_0x29d2('0x3f')](handleError(_0x1527f1,null));})[_0x29d2('0x3f')](handleError(_0x1527f1,null));};exports['show']=function(_0x124f28,_0x4b092e){var _0xe68c4e={'raw':![],'where':{'id':_0x124f28[_0x29d2('0x40')]['id']}},_0x198c97={};_0x198c97[_0x29d2('0x2d')]=_[_0x29d2('0x2f')](db[_0x29d2('0x2b')][_0x29d2('0x41')]);_0x198c97['query']=_[_0x29d2('0x2f')](_0x124f28[_0x29d2('0x2e')]);_0x198c97[_0x29d2('0x30')]=_[_0x29d2('0x31')](_0x198c97[_0x29d2('0x2d')],_0x198c97['query']);_0xe68c4e['attributes']=_[_0x29d2('0x31')](_0x198c97[_0x29d2('0x2d')],qs['fields'](_0x124f28[_0x29d2('0x2e')][_0x29d2('0x33')]));_0xe68c4e[_0x29d2('0x32')]=_0xe68c4e[_0x29d2('0x32')][_0x29d2('0x34')]?_0xe68c4e[_0x29d2('0x32')]:_0x198c97[_0x29d2('0x2d')];if(_0x124f28['query']['includeAll']){_0xe68c4e[_0x29d2('0x3d')]=[{'all':!![]}];}_0xe68c4e=_[_0x29d2('0x39')]({},_0xe68c4e,_0x124f28[_0x29d2('0x3c')]);return db[_0x29d2('0x2b')]['find'](_0xe68c4e)[_0x29d2('0x25')](handleEntityNotFound(_0x4b092e,null))[_0x29d2('0x25')](respondWithResult(_0x4b092e,null))[_0x29d2('0x3f')](handleError(_0x4b092e,null));};exports[_0x29d2('0x42')]=function(_0x1f0c23,_0x1887a8){return db[_0x29d2('0x2b')][_0x29d2('0x42')](_0x1f0c23[_0x29d2('0x43')],{})[_0x29d2('0x25')](function(_0x440afc){var _0x193f7a=_0x1f0c23[_0x29d2('0x44')][_0x29d2('0x45')]({'plain':!![]});if(!_0x193f7a)throw new Error(_0x29d2('0x46'));if(_0x193f7a['role']==='user'){var _0x286c47=_0x440afc[_0x29d2('0x45')]({'plain':!![]});var _0x24a134=_0x29d2('0x27');return db[_0x29d2('0x47')]['find']({'where':{'name':_0x24a134,'userProfileId':_0x193f7a[_0x29d2('0x48')]},'raw':!![]})[_0x29d2('0x25')](function(_0x528f0f){if(_0x528f0f&&_0x528f0f[_0x29d2('0x49')]===0x0){return db['UserProfileResource'][_0x29d2('0x42')]({'name':_0x286c47[_0x29d2('0x28')],'resourceId':_0x286c47['id'],'type':_0x528f0f[_0x29d2('0x28')],'sectionId':_0x528f0f['id']},{})[_0x29d2('0x25')](function(){return _0x440afc;});}else{return _0x440afc;}})[_0x29d2('0x3f')](function(_0xedeaa5){logger[_0x29d2('0x4a')](_0x29d2('0x4b'),_0xedeaa5);throw _0xedeaa5;});}return _0x440afc;})[_0x29d2('0x25')](respondWithResult(_0x1887a8,0xc9))[_0x29d2('0x3f')](handleError(_0x1887a8,null));};exports[_0x29d2('0x24')]=function(_0xe0ee16,_0x64f8a1){if(_0xe0ee16[_0x29d2('0x43')]['id']){delete _0xe0ee16[_0x29d2('0x43')]['id'];}return db[_0x29d2('0x2b')]['find']({'where':{'id':_0xe0ee16[_0x29d2('0x40')]['id']}})[_0x29d2('0x25')](handleEntityNotFound(_0x64f8a1,null))['then'](saveUpdates(_0xe0ee16[_0x29d2('0x43')],null))[_0x29d2('0x25')](respondWithResult(_0x64f8a1,null))['catch'](handleError(_0x64f8a1,null));};exports['destroy']=function(_0x5eb706,_0x6b3722){return db[_0x29d2('0x2b')][_0x29d2('0x4c')]({'where':{'id':_0x5eb706[_0x29d2('0x40')]['id']}})[_0x29d2('0x25')](handleEntityNotFound(_0x6b3722,null))[_0x29d2('0x25')](removeEntity(_0x6b3722,null))[_0x29d2('0x3f')](handleError(_0x6b3722,null));};exports[_0x29d2('0x2c')]=function(_0x814afa,_0xdc1ddd){return db[_0x29d2('0x2b')][_0x29d2('0x2c')]()[_0x29d2('0x25')](respondWithResult(_0xdc1ddd,null))[_0x29d2('0x3f')](handleError(_0xdc1ddd,null));};exports['addContacts']=function(_0x5dc0ea,_0x44435a,_0x43eb61){return db['CmContact'][_0x29d2('0x4c')]({'where':{'id':_0x5dc0ea['params']['id']}})[_0x29d2('0x25')](handleEntityNotFound(_0x44435a,null))['then'](function(_0x2492fa){if(_0x2492fa){return _0x2492fa[_0x29d2('0x4d')](_0x5dc0ea[_0x29d2('0x43')]['ids'],_['omit'](_0x5dc0ea[_0x29d2('0x43')],['ids','id'])||{});}})[_0x29d2('0x25')](respondWithResult(_0x44435a,null))[_0x29d2('0x3f')](handleError(_0x44435a,null));};exports['getContacts']=function(_0xc4e6e9,_0x221b4e,_0x569044){var _0xd37ae9={};var _0x5ddd48={};var _0xea7706;var _0x4ba9bc;return db[_0x29d2('0x2b')][_0x29d2('0x4e')]({'where':{'id':_0xc4e6e9[_0x29d2('0x40')]['id']}})['then'](handleEntityNotFound(_0x221b4e,null))[_0x29d2('0x25')](function(_0x2b4845){if(_0x2b4845){_0xea7706=_0x2b4845;_0x5ddd48[_0x29d2('0x2d')]=_[_0x29d2('0x2f')](db[_0x29d2('0x4f')][_0x29d2('0x41')]);_0x5ddd48[_0x29d2('0x2e')]=_[_0x29d2('0x2f')](_0xc4e6e9[_0x29d2('0x2e')]);_0x5ddd48[_0x29d2('0x30')]=_[_0x29d2('0x31')](_0x5ddd48[_0x29d2('0x2d')],_0x5ddd48['query']);_0xd37ae9['attributes']=_['intersection'](_0x5ddd48['model'],qs['fields'](_0xc4e6e9['query']['fields']));_0xd37ae9['attributes']=_0xd37ae9['attributes'][_0x29d2('0x34')]?_0xd37ae9['attributes']:_0x5ddd48[_0x29d2('0x2d')];_0xd37ae9[_0x29d2('0x50')]=qs[_0x29d2('0x36')](_0xc4e6e9[_0x29d2('0x2e')][_0x29d2('0x36')]);_0xd37ae9[_0x29d2('0x37')]=qs[_0x29d2('0x30')](_[_0x29d2('0x38')](_0xc4e6e9[_0x29d2('0x2e')],_0x5ddd48[_0x29d2('0x30')]));if(_0xc4e6e9[_0x29d2('0x2e')][_0x29d2('0x3b')]){_0xd37ae9[_0x29d2('0x37')]=_[_0x29d2('0x39')](_0xd37ae9[_0x29d2('0x37')],{'$or':_[_0x29d2('0x3a')](_0xd37ae9[_0x29d2('0x32')],function(_0x303cfe){var _0x467812={};_0x467812[_0x303cfe]={'$like':'%'+_0xc4e6e9['query'][_0x29d2('0x3b')]+'%'};return _0x467812;})});}_0xd37ae9=_[_0x29d2('0x39')]({},_0xd37ae9,_0xc4e6e9[_0x29d2('0x3c')]);return _0xea7706[_0x29d2('0x51')](_0xd37ae9);}})[_0x29d2('0x25')](function(_0x1c20fd){if(_0x1c20fd){_0x4ba9bc=_0x1c20fd[_0x29d2('0x34')];if(!_0xc4e6e9[_0x29d2('0x2e')]['hasOwnProperty']('nolimit')){_0xd37ae9[_0x29d2('0x1e')]=qs[_0x29d2('0x1e')](_0xc4e6e9[_0x29d2('0x2e')][_0x29d2('0x1e')]);_0xd37ae9[_0x29d2('0x1c')]=qs[_0x29d2('0x1c')](_0xc4e6e9[_0x29d2('0x2e')][_0x29d2('0x1c')]);}return _0xea7706[_0x29d2('0x51')](_0xd37ae9);}})[_0x29d2('0x25')](function(_0x246aca){if(_0x246aca){return _0x246aca?{'count':_0x4ba9bc,'rows':_0x246aca}:null;}})[_0x29d2('0x25')](respondWithResult(_0x221b4e,null))['catch'](handleError(_0x221b4e,null));}; \ No newline at end of file +var _0x8c49=['intersection','query','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','fields','create','body','role','user','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addContacts','omit','ids','getContacts','findOne','CmContact','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','save','update','then','destroy','get','Companies','UserProfileResource','stack','name','send','index','CmCompany','describe','model','keys','filters'];(function(_0x4639ec,_0x264ba5){var _0x408cd8=function(_0x252b16){while(--_0x252b16){_0x4639ec['push'](_0x4639ec['shift']());}};_0x408cd8(++_0x264ba5);}(_0x8c49,0x7a));var _0x98c4=function(_0x32062c,_0x43ee1f){_0x32062c=_0x32062c-0x0;var _0xa8ccf1=_0x8c49[_0x32062c];return _0xa8ccf1;};'use strict';var emlformat=require(_0x98c4('0x0'));var rimraf=require(_0x98c4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x98c4('0x2'));var rp=require(_0x98c4('0x3'));var moment=require('moment');var BPromise=require(_0x98c4('0x4'));var Mustache=require(_0x98c4('0x5'));var util=require(_0x98c4('0x6'));var path=require(_0x98c4('0x7'));var sox=require('sox');var csv=require(_0x98c4('0x8'));var ejs=require(_0x98c4('0x9'));var fs=require('fs');var fs_extra=require(_0x98c4('0xa'));var _=require(_0x98c4('0xb'));var squel=require('squel');var crypto=require(_0x98c4('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x98c4('0xd'));var toCsv=require(_0x98c4('0x8'));var querystring=require(_0x98c4('0xe'));var Papa=require(_0x98c4('0xf'));var Redis=require(_0x98c4('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x98c4('0x11'));var logger=require(_0x98c4('0x12'))(_0x98c4('0x13'));var utils=require(_0x98c4('0x14'));var config=require(_0x98c4('0x15'));var licenseUtil=require(_0x98c4('0x16'));var db=require(_0x98c4('0x17'))['db'];function respondWithStatusCode(_0xa37e52,_0x4d0d9f){_0x4d0d9f=_0x4d0d9f||0xcc;return function(_0x25fbcf){if(_0x25fbcf){return _0xa37e52[_0x98c4('0x18')](_0x4d0d9f);}return _0xa37e52[_0x98c4('0x19')](_0x4d0d9f)[_0x98c4('0x1a')]();};}function respondWithResult(_0x575185,_0x4c928e){_0x4c928e=_0x4c928e||0xc8;return function(_0x34e48e){if(_0x34e48e){return _0x575185[_0x98c4('0x19')](_0x4c928e)[_0x98c4('0x1b')](_0x34e48e);}};}function respondWithFilteredResult(_0x3e761b,_0x4fc062){return function(_0x2e1f63){if(_0x2e1f63){var _0x4ea7ca=typeof _0x4fc062[_0x98c4('0x1c')]===_0x98c4('0x1d')&&typeof _0x4fc062['limit']==='undefined';var _0x5b6a9d=_0x2e1f63['count'];var _0x2345b8=_0x4ea7ca?0x0:_0x4fc062[_0x98c4('0x1c')];var _0x168e7c=_0x4ea7ca?_0x2e1f63[_0x98c4('0x1e')]:_0x4fc062['offset']+_0x4fc062[_0x98c4('0x1f')];var _0x31d461;if(_0x168e7c>=_0x5b6a9d){_0x168e7c=_0x5b6a9d;_0x31d461=0xc8;}else{_0x31d461=0xce;}_0x3e761b['status'](_0x31d461);return _0x3e761b['set']('Content-Range',_0x2345b8+'-'+_0x168e7c+'/'+_0x5b6a9d)[_0x98c4('0x1b')](_0x2e1f63);}return null;};}function patchUpdates(_0x155724){return function(_0xb1f211){try{jsonpatch['apply'](_0xb1f211,_0x155724,!![]);}catch(_0x24d8c2){return BPromise['reject'](_0x24d8c2);}return _0xb1f211[_0x98c4('0x20')]();};}function saveUpdates(_0x31e4e7,_0x1b15e1){return function(_0x46e061){if(_0x46e061){return _0x46e061[_0x98c4('0x21')](_0x31e4e7)[_0x98c4('0x22')](function(_0x2856c4){return _0x2856c4;});}return null;};}function removeEntity(_0x233c2f,_0x5ed694){return function(_0x3849f2){if(_0x3849f2){return _0x3849f2[_0x98c4('0x23')]()[_0x98c4('0x22')](function(){var _0x2b14b7=_0x3849f2[_0x98c4('0x24')]({'plain':!![]});var _0x1beae4=_0x98c4('0x25');return db[_0x98c4('0x26')]['destroy']({'where':{'type':_0x1beae4,'resourceId':_0x2b14b7['id']}})[_0x98c4('0x22')](function(){return _0x3849f2;});})['then'](function(){_0x233c2f[_0x98c4('0x19')](0xcc)[_0x98c4('0x1a')]();});}};}function handleEntityNotFound(_0x5b8003,_0x18e430){return function(_0x2e6c64){if(!_0x2e6c64){_0x5b8003['sendStatus'](0x194);}return _0x2e6c64;};}function handleError(_0x252381,_0x1a5535){_0x1a5535=_0x1a5535||0x1f4;return function(_0x3a5277){logger['error'](_0x3a5277[_0x98c4('0x27')]);if(_0x3a5277[_0x98c4('0x28')]){delete _0x3a5277[_0x98c4('0x28')];}_0x252381[_0x98c4('0x19')](_0x1a5535)[_0x98c4('0x29')](_0x3a5277);};}exports[_0x98c4('0x2a')]=function(_0x23b600,_0x48c673){var _0x422729={},_0x42e6ae={},_0x20648b={'count':0x0,'rows':[]};return db[_0x98c4('0x2b')][_0x98c4('0x2c')]()[_0x98c4('0x22')](function(_0x3f0d3d){_0x42e6ae[_0x98c4('0x2d')]=_['keys'](_0x3f0d3d);_0x42e6ae['query']=_[_0x98c4('0x2e')](_0x23b600['query']);_0x42e6ae[_0x98c4('0x2f')]=_[_0x98c4('0x30')](_0x42e6ae[_0x98c4('0x2d')],_0x42e6ae[_0x98c4('0x31')]);_0x422729['attributes']=_[_0x98c4('0x30')](_0x42e6ae[_0x98c4('0x2d')],qs['fields'](_0x23b600[_0x98c4('0x31')]['fields']));_0x422729[_0x98c4('0x32')]=_0x422729['attributes'][_0x98c4('0x33')]?_0x422729[_0x98c4('0x32')]:_0x42e6ae[_0x98c4('0x2d')];if(!_0x23b600[_0x98c4('0x31')][_0x98c4('0x34')](_0x98c4('0x35'))){_0x422729['limit']=qs[_0x98c4('0x1f')](_0x23b600[_0x98c4('0x31')][_0x98c4('0x1f')]);_0x422729[_0x98c4('0x1c')]=qs[_0x98c4('0x1c')](_0x23b600[_0x98c4('0x31')][_0x98c4('0x1c')]);}_0x422729[_0x98c4('0x36')]=qs['sort'](_0x23b600[_0x98c4('0x31')][_0x98c4('0x37')]);_0x422729[_0x98c4('0x38')]=qs['filters'](_[_0x98c4('0x39')](_0x23b600['query'],_0x42e6ae[_0x98c4('0x2f')]),_0x3f0d3d);if(_0x23b600[_0x98c4('0x31')][_0x98c4('0x3a')]){_0x422729[_0x98c4('0x38')]=_['merge'](_0x422729['where'],{'$or':_[_0x98c4('0x3b')](_0x422729['attributes'],function(_0x4c226e){var _0x234468={};_0x234468[_0x4c226e]={'$like':'%'+_0x23b600[_0x98c4('0x31')][_0x98c4('0x3a')]+'%'};return _0x234468;})});}_0x422729=_[_0x98c4('0x3c')]({},_0x422729,_0x23b600[_0x98c4('0x3d')]);var _0x1b15e2={'where':_0x422729['where']};return db[_0x98c4('0x2b')]['count'](_0x1b15e2)['then'](function(_0x36c106){_0x20648b[_0x98c4('0x1e')]=_0x36c106;if(_0x23b600[_0x98c4('0x31')][_0x98c4('0x3e')]){_0x422729[_0x98c4('0x3f')]=[{'all':!![]}];}return db['CmCompany'][_0x98c4('0x40')](_0x422729);})[_0x98c4('0x22')](function(_0xd5d49c){_0x20648b[_0x98c4('0x41')]=_0xd5d49c;return _0x20648b;})[_0x98c4('0x22')](respondWithFilteredResult(_0x48c673,_0x422729))[_0x98c4('0x42')](handleError(_0x48c673,null));})[_0x98c4('0x42')](handleError(_0x48c673,null));};exports[_0x98c4('0x43')]=function(_0x3777d7,_0xc42d01){var _0x1d8de4={'raw':![],'where':{'id':_0x3777d7['params']['id']}},_0x3ff69b={};_0x3ff69b['model']=_[_0x98c4('0x2e')](db['CmCompany'][_0x98c4('0x44')]);_0x3ff69b[_0x98c4('0x31')]=_[_0x98c4('0x2e')](_0x3777d7[_0x98c4('0x31')]);_0x3ff69b[_0x98c4('0x2f')]=_[_0x98c4('0x30')](_0x3ff69b[_0x98c4('0x2d')],_0x3ff69b['query']);_0x1d8de4[_0x98c4('0x32')]=_[_0x98c4('0x30')](_0x3ff69b[_0x98c4('0x2d')],qs['fields'](_0x3777d7[_0x98c4('0x31')][_0x98c4('0x45')]));_0x1d8de4['attributes']=_0x1d8de4[_0x98c4('0x32')][_0x98c4('0x33')]?_0x1d8de4[_0x98c4('0x32')]:_0x3ff69b[_0x98c4('0x2d')];if(_0x3777d7['query'][_0x98c4('0x3e')]){_0x1d8de4[_0x98c4('0x3f')]=[{'all':!![]}];}_0x1d8de4=_['merge']({},_0x1d8de4,_0x3777d7[_0x98c4('0x3d')]);return db[_0x98c4('0x2b')]['find'](_0x1d8de4)[_0x98c4('0x22')](handleEntityNotFound(_0xc42d01,null))[_0x98c4('0x22')](respondWithResult(_0xc42d01,null))[_0x98c4('0x42')](handleError(_0xc42d01,null));};exports[_0x98c4('0x46')]=function(_0x408ae0,_0x363bd5){return db['CmCompany'][_0x98c4('0x46')](_0x408ae0[_0x98c4('0x47')],{})[_0x98c4('0x22')](function(_0xb691b5){var _0x1b7b3b=_0x408ae0['user']['get']({'plain':!![]});if(!_0x1b7b3b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1b7b3b[_0x98c4('0x48')]===_0x98c4('0x49')){var _0x4e9664=_0xb691b5['get']({'plain':!![]});var _0x137439='Companies';return db['UserProfileSection'][_0x98c4('0x4a')]({'where':{'name':_0x137439,'userProfileId':_0x1b7b3b[_0x98c4('0x4b')]},'raw':!![]})['then'](function(_0x13dba4){if(_0x13dba4&&_0x13dba4[_0x98c4('0x4c')]===0x0){return db[_0x98c4('0x26')][_0x98c4('0x46')]({'name':_0x4e9664[_0x98c4('0x28')],'resourceId':_0x4e9664['id'],'type':_0x13dba4[_0x98c4('0x28')],'sectionId':_0x13dba4['id']},{})['then'](function(){return _0xb691b5;});}else{return _0xb691b5;}})[_0x98c4('0x42')](function(_0x5d9d76){logger['error'](_0x98c4('0x4d'),_0x5d9d76);throw _0x5d9d76;});}return _0xb691b5;})[_0x98c4('0x22')](respondWithResult(_0x363bd5,0xc9))[_0x98c4('0x42')](handleError(_0x363bd5,null));};exports[_0x98c4('0x21')]=function(_0x1cd73b,_0x141d6e){if(_0x1cd73b[_0x98c4('0x47')]['id']){delete _0x1cd73b[_0x98c4('0x47')]['id'];}return db[_0x98c4('0x2b')][_0x98c4('0x4a')]({'where':{'id':_0x1cd73b['params']['id']}})[_0x98c4('0x22')](handleEntityNotFound(_0x141d6e,null))[_0x98c4('0x22')](saveUpdates(_0x1cd73b[_0x98c4('0x47')],null))[_0x98c4('0x22')](respondWithResult(_0x141d6e,null))[_0x98c4('0x42')](handleError(_0x141d6e,null));};exports[_0x98c4('0x23')]=function(_0x45c25b,_0x770aab){return db['CmCompany'][_0x98c4('0x4a')]({'where':{'id':_0x45c25b[_0x98c4('0x4e')]['id']}})[_0x98c4('0x22')](handleEntityNotFound(_0x770aab,null))[_0x98c4('0x22')](removeEntity(_0x770aab,null))[_0x98c4('0x42')](handleError(_0x770aab,null));};exports[_0x98c4('0x2c')]=function(_0x2ecb44,_0x41dbe3){return db[_0x98c4('0x2b')]['describe']()['then'](respondWithResult(_0x41dbe3,null))[_0x98c4('0x42')](handleError(_0x41dbe3,null));};exports['addContacts']=function(_0x43199f,_0x3def06,_0x4e7789){return db['CmContact'][_0x98c4('0x4a')]({'where':{'id':_0x43199f[_0x98c4('0x4e')]['id']}})[_0x98c4('0x22')](handleEntityNotFound(_0x3def06,null))[_0x98c4('0x22')](function(_0x53a5a3){if(_0x53a5a3){return _0x53a5a3[_0x98c4('0x4f')](_0x43199f['body']['ids'],_[_0x98c4('0x50')](_0x43199f[_0x98c4('0x47')],[_0x98c4('0x51'),'id'])||{});}})[_0x98c4('0x22')](respondWithResult(_0x3def06,null))['catch'](handleError(_0x3def06,null));};exports[_0x98c4('0x52')]=function(_0x3ddcb5,_0x2a91f6,_0x2e52c1){var _0x2ce800={};var _0x364c5f={};var _0x1485da;var _0x4b53ac;return db[_0x98c4('0x2b')][_0x98c4('0x53')]({'where':{'id':_0x3ddcb5[_0x98c4('0x4e')]['id']}})[_0x98c4('0x22')](handleEntityNotFound(_0x2a91f6,null))[_0x98c4('0x22')](function(_0x58f87e){if(_0x58f87e){_0x1485da=_0x58f87e;_0x364c5f['model']=_[_0x98c4('0x2e')](db[_0x98c4('0x54')][_0x98c4('0x44')]);_0x364c5f[_0x98c4('0x31')]=_[_0x98c4('0x2e')](_0x3ddcb5[_0x98c4('0x31')]);_0x364c5f[_0x98c4('0x2f')]=_[_0x98c4('0x30')](_0x364c5f[_0x98c4('0x2d')],_0x364c5f[_0x98c4('0x31')]);_0x2ce800['attributes']=_[_0x98c4('0x30')](_0x364c5f[_0x98c4('0x2d')],qs[_0x98c4('0x45')](_0x3ddcb5['query'][_0x98c4('0x45')]));_0x2ce800['attributes']=_0x2ce800[_0x98c4('0x32')][_0x98c4('0x33')]?_0x2ce800[_0x98c4('0x32')]:_0x364c5f[_0x98c4('0x2d')];_0x2ce800[_0x98c4('0x36')]=qs[_0x98c4('0x37')](_0x3ddcb5[_0x98c4('0x31')][_0x98c4('0x37')]);_0x2ce800[_0x98c4('0x38')]=qs[_0x98c4('0x2f')](_[_0x98c4('0x39')](_0x3ddcb5['query'],_0x364c5f[_0x98c4('0x2f')]));if(_0x3ddcb5['query'][_0x98c4('0x3a')]){_0x2ce800['where']=_['merge'](_0x2ce800[_0x98c4('0x38')],{'$or':_[_0x98c4('0x3b')](_0x2ce800['attributes'],function(_0x5438cc){var _0x21566e={};_0x21566e[_0x5438cc]={'$like':'%'+_0x3ddcb5['query']['filter']+'%'};return _0x21566e;})});}_0x2ce800=_[_0x98c4('0x3c')]({},_0x2ce800,_0x3ddcb5[_0x98c4('0x3d')]);return _0x1485da[_0x98c4('0x52')](_0x2ce800);}})[_0x98c4('0x22')](function(_0x1cb5f9){if(_0x1cb5f9){_0x4b53ac=_0x1cb5f9['length'];if(!_0x3ddcb5[_0x98c4('0x31')][_0x98c4('0x34')](_0x98c4('0x35'))){_0x2ce800['limit']=qs[_0x98c4('0x1f')](_0x3ddcb5[_0x98c4('0x31')]['limit']);_0x2ce800[_0x98c4('0x1c')]=qs[_0x98c4('0x1c')](_0x3ddcb5[_0x98c4('0x31')][_0x98c4('0x1c')]);}return _0x1485da[_0x98c4('0x52')](_0x2ce800);}})[_0x98c4('0x22')](function(_0x435b0a){if(_0x435b0a){return _0x435b0a?{'count':_0x4b53ac,'rows':_0x435b0a}:null;}})[_0x98c4('0x22')](respondWithResult(_0x2a91f6,null))['catch'](handleError(_0x2a91f6,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 93557f4..17d4d29 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 _0x55ce=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util','../../config/logger'];(function(_0xf168d3,_0x43dcfc){var _0x17fb54=function(_0x3d9674){while(--_0x3d9674){_0xf168d3['push'](_0xf168d3['shift']());}};_0x17fb54(++_0x43dcfc);}(_0x55ce,0x10b));var _0xe55c=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x55ce[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xe55c('0x0'));var util=require(_0xe55c('0x1'));var logger=require(_0xe55c('0x2'))(_0xe55c('0x3'));var moment=require(_0xe55c('0x4'));var BPromise=require(_0xe55c('0x5'));var rp=require(_0xe55c('0x6'));var fs=require('fs');var path=require(_0xe55c('0x7'));var rimraf=require(_0xe55c('0x8'));var config=require(_0xe55c('0x9'));var attributes=require(_0xe55c('0xa'));module[_0xe55c('0xb')]=function(_0x55c1e0,_0x3594b9){return _0x55c1e0[_0xe55c('0xc')](_0xe55c('0xd'),attributes,{'tableName':_0xe55c('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0197=['rimraf','./cmCompany.attributes','CmCompany','cm_companies','../../config/logger','api','bluebird','request-promise','path'];(function(_0x42bb60,_0x1b06be){var _0xc7b8da=function(_0x22d671){while(--_0x22d671){_0x42bb60['push'](_0x42bb60['shift']());}};_0xc7b8da(++_0x1b06be);}(_0x0197,0xee));var _0x7019=function(_0x3016ae,_0xae7ab){_0x3016ae=_0x3016ae-0x0;var _0x51ceb8=_0x0197[_0x3016ae];return _0x51ceb8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7019('0x0'))(_0x7019('0x1'));var moment=require('moment');var BPromise=require(_0x7019('0x2'));var rp=require(_0x7019('0x3'));var fs=require('fs');var path=require(_0x7019('0x4'));var rimraf=require(_0x7019('0x5'));var config=require('../../config/environment');var attributes=require(_0x7019('0x6'));module['exports']=function(_0x74e68f,_0x20b9fc){return _0x74e68f['define'](_0x7019('0x7'),attributes,{'tableName':_0x7019('0x8'),'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 28478f3..95e93d8 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 _0x0c82=['randomstring','ioredis','rpc','../../config/environment','http','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','util','moment','bluebird'];(function(_0x478414,_0xcf142d){var _0x5eb6b9=function(_0x10e6fe){while(--_0x10e6fe){_0x478414['push'](_0x478414['shift']());}};_0x5eb6b9(++_0xcf142d);}(_0x0c82,0x1d1));var _0x20c8=function(_0x530168,_0x58b644){_0x530168=_0x530168-0x0;var _0x31d6ee=_0x0c82[_0x530168];return _0x31d6ee;};'use strict';var _=require('lodash');var util=require(_0x20c8('0x0'));var moment=require(_0x20c8('0x1'));var BPromise=require(_0x20c8('0x2'));var rs=require(_0x20c8('0x3'));var fs=require('fs');var Redis=require(_0x20c8('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x20c8('0x5'));var config=require(_0x20c8('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x20c8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x55580c,_0x593ab1,_0x3a21d9){return new BPromise(function(_0x3a3600,_0x503ce4){return client['request'](_0x55580c,_0x3a21d9)[_0x20c8('0x8')](function(_0x2e02b6){logger['info'](_0x20c8('0x9'),_0x593ab1,_0x20c8('0xa'));logger[_0x20c8('0xb')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x593ab1,_0x20c8('0xa'),JSON['stringify'](_0x2e02b6));if(_0x2e02b6['error']){if(_0x2e02b6[_0x20c8('0xc')][_0x20c8('0xd')]===0x1f4){logger[_0x20c8('0xc')]('CmCompany,\x20%s,\x20%s',_0x593ab1,_0x2e02b6['error'][_0x20c8('0xe')]);return _0x503ce4(_0x2e02b6[_0x20c8('0xc')][_0x20c8('0xe')]);}logger[_0x20c8('0xc')](_0x20c8('0x9'),_0x593ab1,_0x2e02b6[_0x20c8('0xc')]['message']);return _0x3a3600(_0x2e02b6[_0x20c8('0xc')][_0x20c8('0xe')]);}else{logger[_0x20c8('0xf')](_0x20c8('0x9'),_0x593ab1,_0x20c8('0xa'));_0x3a3600(_0x2e02b6[_0x20c8('0x10')][_0x20c8('0xe')]);}})[_0x20c8('0x11')](function(_0x1f7e9e){logger[_0x20c8('0xc')](_0x20c8('0x9'),_0x593ab1,_0x1f7e9e);_0x503ce4(_0x1f7e9e);});});} \ No newline at end of file +var _0x7938=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CmCompany,\x20%s,\x20%s','message','info','result'];(function(_0x192d7d,_0x632513){var _0x1566fb=function(_0x32f9de){while(--_0x32f9de){_0x192d7d['push'](_0x192d7d['shift']());}};_0x1566fb(++_0x632513);}(_0x7938,0x1b1));var _0x8793=function(_0x16748f,_0x44bf60){_0x16748f=_0x16748f-0x0;var _0xb2e819=_0x7938[_0x16748f];return _0xb2e819;};'use strict';var _=require(_0x8793('0x0'));var util=require('util');var moment=require(_0x8793('0x1'));var BPromise=require(_0x8793('0x2'));var rs=require(_0x8793('0x3'));var fs=require('fs');var Redis=require(_0x8793('0x4'));var db=require(_0x8793('0x5'))['db'];var utils=require(_0x8793('0x6'));var logger=require(_0x8793('0x7'))('rpc');var config=require(_0x8793('0x8'));var jayson=require(_0x8793('0x9'));var client=jayson[_0x8793('0xa')][_0x8793('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f4144,_0x47d744,_0x544906){return new BPromise(function(_0x4749d9,_0xec769c){return client[_0x8793('0xc')](_0x1f4144,_0x544906)['then'](function(_0x5c4d2d){logger['info']('CmCompany,\x20%s,\x20%s',_0x47d744,'request\x20sent');logger[_0x8793('0xd')](_0x8793('0xe'),_0x47d744,_0x8793('0xf'),JSON[_0x8793('0x10')](_0x5c4d2d));if(_0x5c4d2d[_0x8793('0x11')]){if(_0x5c4d2d['error'][_0x8793('0x12')]===0x1f4){logger[_0x8793('0x11')](_0x8793('0x13'),_0x47d744,_0x5c4d2d[_0x8793('0x11')]['message']);return _0xec769c(_0x5c4d2d[_0x8793('0x11')][_0x8793('0x14')]);}logger['error'](_0x8793('0x13'),_0x47d744,_0x5c4d2d[_0x8793('0x11')]['message']);return _0x4749d9(_0x5c4d2d[_0x8793('0x11')]['message']);}else{logger[_0x8793('0x15')](_0x8793('0x13'),_0x47d744,_0x8793('0xf'));_0x4749d9(_0x5c4d2d[_0x8793('0x16')]['message']);}})[_0x8793('0x17')](function(_0x3f5ca8){logger[_0x8793('0x11')](_0x8793('0x13'),_0x47d744,_0x3f5ca8);_0xec769c(_0x3f5ca8);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 3b9ba5a..d29aea2 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 _0x8b7e=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','describe','/:id','show','getContacts','post','/:id/contacts','addContacts','put','update','delete','destroy','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8b7e,0x1c2));var _0xe8b7=function(_0x2af4d4,_0x26ae08){_0x2af4d4=_0x2af4d4-0x0;var _0x3d62c7=_0x8b7e[_0x2af4d4];return _0x3d62c7;};'use strict';var multer=require(_0xe8b7('0x0'));var util=require(_0xe8b7('0x1'));var path=require(_0xe8b7('0x2'));var timeout=require(_0xe8b7('0x3'));var express=require(_0xe8b7('0x4'));var router=express[_0xe8b7('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xe8b7('0x6'));var interaction=require(_0xe8b7('0x7'));var config=require(_0xe8b7('0x8'));var controller=require(_0xe8b7('0x9'));router[_0xe8b7('0xa')]('/',auth[_0xe8b7('0xb')](),controller[_0xe8b7('0xc')]);router['get']('/describe',auth[_0xe8b7('0xb')](),controller[_0xe8b7('0xd')]);router['get'](_0xe8b7('0xe'),auth[_0xe8b7('0xb')](),controller[_0xe8b7('0xf')]);router[_0xe8b7('0xa')]('/:id/contacts',auth[_0xe8b7('0xb')](),controller[_0xe8b7('0x10')]);router[_0xe8b7('0x11')]('/',auth[_0xe8b7('0xb')](),controller['create']);router[_0xe8b7('0x11')](_0xe8b7('0x12'),auth[_0xe8b7('0xb')](),controller[_0xe8b7('0x13')]);router[_0xe8b7('0x14')](_0xe8b7('0xe'),auth[_0xe8b7('0xb')](),controller[_0xe8b7('0x15')]);router[_0xe8b7('0x16')](_0xe8b7('0xe'),auth['isAuthenticated'](),controller[_0xe8b7('0x17')]);module[_0xe8b7('0x18')]=router; \ No newline at end of file +var _0xc3ea=['create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','/:id','/:id/contacts','getContacts','post'];(function(_0x5215dc,_0x45aa60){var _0x5dd04f=function(_0x5598c1){while(--_0x5598c1){_0x5215dc['push'](_0x5215dc['shift']());}};_0x5dd04f(++_0x45aa60);}(_0xc3ea,0x165));var _0xac3e=function(_0x5c0979,_0x287854){_0x5c0979=_0x5c0979-0x0;var _0x309972=_0xc3ea[_0x5c0979];return _0x309972;};'use strict';var multer=require(_0xac3e('0x0'));var util=require(_0xac3e('0x1'));var path=require(_0xac3e('0x2'));var timeout=require(_0xac3e('0x3'));var express=require(_0xac3e('0x4'));var router=express[_0xac3e('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xac3e('0x6'));var config=require(_0xac3e('0x7'));var controller=require(_0xac3e('0x8'));router[_0xac3e('0x9')]('/',auth[_0xac3e('0xa')](),controller[_0xac3e('0xb')]);router[_0xac3e('0x9')](_0xac3e('0xc'),auth[_0xac3e('0xa')](),controller['describe']);router[_0xac3e('0x9')](_0xac3e('0xd'),auth[_0xac3e('0xa')](),controller['show']);router[_0xac3e('0x9')](_0xac3e('0xe'),auth[_0xac3e('0xa')](),controller[_0xac3e('0xf')]);router[_0xac3e('0x10')]('/',auth[_0xac3e('0xa')](),controller[_0xac3e('0x11')]);router[_0xac3e('0x10')](_0xac3e('0xe'),auth[_0xac3e('0xa')](),controller['addContacts']);router[_0xac3e('0x12')](_0xac3e('0xd'),auth['isAuthenticated'](),controller[_0xac3e('0x13')]);router[_0xac3e('0x14')](_0xac3e('0xd'),auth['isAuthenticated'](),controller[_0xac3e('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 21493e1..648d9fa 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 _0x5faa=['UNSIGNED','DATE','NOW','lodash','sequelize','exports','STRING','INTEGER'];(function(_0x57d867,_0x2ee50b){var _0x33d270=function(_0x43a7b5){while(--_0x43a7b5){_0x57d867['push'](_0x57d867['shift']());}};_0x33d270(++_0x2ee50b);}(_0x5faa,0x83));var _0xa5fa=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x5faa[_0x5a776b];return _0xbbef59;};'use strict';var _=require(_0xa5fa('0x0'));var Sequelize=require(_0xa5fa('0x1'));module[_0xa5fa('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xa5fa('0x3')]},'street':{'type':Sequelize[_0xa5fa('0x3')]},'postalCode':{'type':Sequelize[_0xa5fa('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xa5fa('0x3')]},'dateOfBirth':{'type':Sequelize[_0xa5fa('0x3')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0xa5fa('0x3')]},'mobile':{'type':Sequelize[_0xa5fa('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xa5fa('0x3')]},'url':{'type':Sequelize[_0xa5fa('0x3')]},'facebook':{'type':Sequelize[_0xa5fa('0x3')]},'fb_data':{'type':Sequelize[_0xa5fa('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0xa5fa('0x3')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0xa5fa('0x3')]},'line':{'type':Sequelize[_0xa5fa('0x3')]},'wechat':{'type':Sequelize[_0xa5fa('0x3')]},'telegram':{'type':Sequelize[_0xa5fa('0x3')]},'UserId':{'type':Sequelize[_0xa5fa('0x4')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xa5fa('0x4')](0x2)[_0xa5fa('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xa5fa('0x6')],'defaultValue':Sequelize[_0xa5fa('0x7')]},'dialTimezone':{'type':Sequelize[_0xa5fa('0x3')]},'utcOffset':{'type':Sequelize[_0xa5fa('0x4')]}}; \ No newline at end of file +var _0x75fc=['STRING','TEXT','INTEGER','UNSIGNED','NOW','lodash','sequelize'];(function(_0x74745d,_0x177606){var _0x174ab3=function(_0x1c94e9){while(--_0x1c94e9){_0x74745d['push'](_0x74745d['shift']());}};_0x174ab3(++_0x177606);}(_0x75fc,0x10f));var _0xc75f=function(_0x12a827,_0x39ea76){_0x12a827=_0x12a827-0x0;var _0xb54beb=_0x75fc[_0x12a827];return _0xb54beb;};'use strict';var _=require(_0xc75f('0x0'));var Sequelize=require(_0xc75f('0x1'));module['exports']={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xc75f('0x2')]},'street':{'type':Sequelize[_0xc75f('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xc75f('0x2')]},'country':{'type':Sequelize[_0xc75f('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc75f('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xc75f('0x2')]},'fax':{'type':Sequelize[_0xc75f('0x2')]},'email':{'type':Sequelize[_0xc75f('0x2')]},'url':{'type':Sequelize[_0xc75f('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0xc75f('0x2')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0xc75f('0x2')]},'teams':{'type':Sequelize[_0xc75f('0x2')]},'viber':{'type':Sequelize[_0xc75f('0x2')]},'line':{'type':Sequelize[_0xc75f('0x2')]},'wechat':{'type':Sequelize[_0xc75f('0x2')]},'telegram':{'type':Sequelize[_0xc75f('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xc75f('0x4')](0x2)[_0xc75f('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xc75f('0x6')]},'dialTimezone':{'type':Sequelize[_0xc75f('0x2')]},'utcOffset':{'type':Sequelize[_0xc75f('0x4')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index e6cb161..a853762 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 _0xf2e5=['OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','isNil','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','where','push','ListId','findOrCreate','all','show','Tag','Tags','color','tag','Phones','ContactItemType','ItemType','sequelize','literal','Phones.OrderBy','$and','map','format','pickBy','cf_%d','isEmpty','table','id\x20=\x20?','toParam','text','phone','CmHopper','getTags','model','filters','intersection','attributes','fields','order','sort','options','hasOwnProperty','setTags','findOne','ids','setAdditionalPhones','items','item_types','ItemTypeId','description','OrderBy','`ItemType`.OrderBy','CmHopperId','item','CmHopperAdditionalPhone','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','rawAttributes','nolimit','pick','ContactId','filter','includeAll','rows','getHopperHistories','include','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','file','filename','chmodSync','0777','child_process','fork','join','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','meta','import','agent','binding','message','start\x20child\x20process\x20correctly!','exit','User','../../components/import/cm/csvUpdates','stringify','error\x20child\x20process','sms','openchannel','fax','whatsapp','resolve','channel','includes','toLowerCase','range','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','voice','uniqueid','source','destination','callerid','starttime','endtime','duration','note','createdAt','userDisposition','userThirdDisposition','UserId','DESC','VoiceCallReport','findAndCountAll','fullname','startCase','chat','Website','Account','closed','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','customerPort','deviceModel','ratingMessage','ratingType','referer','subject','threadId','Interaction','flatten','slice','moment','bluebird','util','path','lodash','squel','papaparse','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/environment/shared','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','offset','undefined','limit','count','status','set','Content-Range','json','update','then','destroy','end','sendStatus','error','stack','name','send','index','describe','getOptions','findAll','user','catch','CmContact','find','params','tags','keys','length','startsWith','cf_','columnName','displayName','query','analytics','alias','custom','type','values','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','merge','body','from','get','mergeWith','isArray','[CmContact][merge]\x20to\x20%s\x20from\x20%s','info','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','ChatQueueReport','FaxQueueReport'];(function(_0x3a732b,_0xb35afb){var _0x7e2979=function(_0x7caecb){while(--_0x7caecb){_0x3a732b['push'](_0x3a732b['shift']());}};_0x7e2979(++_0xb35afb);}(_0xf2e5,0xaa));var _0x5f2e=function(_0xc4f7c0,_0x3d731b){_0xc4f7c0=_0xc4f7c0-0x0;var _0x479501=_0xf2e5[_0xc4f7c0];return _0x479501;};'use strict';var moment=require(_0x5f2e('0x0'));var BPromise=require(_0x5f2e('0x1'));var util=require(_0x5f2e('0x2'));var path=require(_0x5f2e('0x3'));var fs=require('fs');var _=require(_0x5f2e('0x4'));var squel=require(_0x5f2e('0x5'));var Papa=require(_0x5f2e('0x6'));var Redis=require(_0x5f2e('0x7'));var contacts=require(_0x5f2e('0x8'));var qs=require(_0x5f2e('0x9'));var logger=require(_0x5f2e('0xa'))(_0x5f2e('0xb'));var config=require(_0x5f2e('0xc'));var shared=require(_0x5f2e('0xd'));var db=require('../../mysqldb')['db'];config[_0x5f2e('0xe')]=_[_0x5f2e('0xf')](config[_0x5f2e('0xe')],{'host':_0x5f2e('0x10'),'port':0x18eb});var socket=require(_0x5f2e('0x11'))(new Redis(config[_0x5f2e('0xe')]));require(_0x5f2e('0x12'))[_0x5f2e('0x13')](socket);function respondWithResult(_0x3ac052,_0x6e7427){_0x6e7427=_0x6e7427||0xc8;return function(_0x52901c){if(_0x52901c){return _0x3ac052['status'](_0x6e7427)['json'](_0x52901c);}};}function respondWithFilteredResult(_0x327aaa,_0x2f9592){return function(_0x122afa){if(_0x122afa){var _0x328350=typeof _0x2f9592[_0x5f2e('0x14')]===_0x5f2e('0x15')&&typeof _0x2f9592[_0x5f2e('0x16')]===_0x5f2e('0x15');var _0x4cf89d=_0x122afa[_0x5f2e('0x17')];var _0x2eed77=_0x328350?0x0:_0x2f9592[_0x5f2e('0x14')];var _0x4b8445=_0x328350?_0x122afa[_0x5f2e('0x17')]:_0x2f9592[_0x5f2e('0x14')]+_0x2f9592['limit'];var _0x1b5c23;if(_0x4b8445>=_0x4cf89d){_0x4b8445=_0x4cf89d;_0x1b5c23=0xc8;}else{_0x1b5c23=0xce;}_0x327aaa[_0x5f2e('0x18')](_0x1b5c23);return _0x327aaa[_0x5f2e('0x19')](_0x5f2e('0x1a'),_0x2eed77+'-'+_0x4b8445+'/'+_0x4cf89d)[_0x5f2e('0x1b')](_0x122afa);}return null;};}function saveUpdates(_0x339cc5){return function(_0x2c635f){if(_0x2c635f){return _0x2c635f[_0x5f2e('0x1c')](_0x339cc5)[_0x5f2e('0x1d')](function(_0x27308e){return _0x27308e;});}return null;};}function removeEntity(_0x15cc27){return function(_0x45f1a5){if(_0x45f1a5){return _0x45f1a5[_0x5f2e('0x1e')]()[_0x5f2e('0x1d')](function(){_0x15cc27[_0x5f2e('0x18')](0xcc)[_0x5f2e('0x1f')]();});}};}function handleEntityNotFound(_0x96df8b){return function(_0x42cf2d){if(!_0x42cf2d){_0x96df8b[_0x5f2e('0x20')](0x194);}return _0x42cf2d;};}function handleError(_0x34e1db,_0x202e35){_0x202e35=_0x202e35||0x1f4;return function(_0x4d5e04){logger[_0x5f2e('0x21')](_0x4d5e04[_0x5f2e('0x22')]);if(_0x4d5e04[_0x5f2e('0x23')]){delete _0x4d5e04[_0x5f2e('0x23')];}_0x34e1db[_0x5f2e('0x18')](_0x202e35)[_0x5f2e('0x24')](_0x4d5e04);};}exports[_0x5f2e('0x25')]=function(_0x267b14,_0x19fae3){var _0x5d8a12={};return contacts[_0x5f2e('0x26')]()['then'](function(_0x24bf5c){_0x5d8a12=qs[_0x5f2e('0x27')](_0x24bf5c,_0x267b14);return contacts[_0x5f2e('0x28')](_0x267b14['query'],_0x267b14[_0x5f2e('0x29')],_0x5d8a12,_0x24bf5c);})[_0x5f2e('0x1d')](respondWithFilteredResult(_0x19fae3,_0x5d8a12))[_0x5f2e('0x2a')](handleError(_0x19fae3,null));};exports[_0x5f2e('0x1e')]=function(_0x118e4f,_0x30208b){return db[_0x5f2e('0x2b')][_0x5f2e('0x2c')]({'where':{'id':_0x118e4f[_0x5f2e('0x2d')]['id']}})[_0x5f2e('0x1d')](handleEntityNotFound(_0x30208b,null))[_0x5f2e('0x1d')](removeEntity(_0x30208b,null))[_0x5f2e('0x2a')](handleError(_0x30208b,null));};exports[_0x5f2e('0x26')]=function(_0x355284,_0x390832){return db[_0x5f2e('0x2b')][_0x5f2e('0x26')]()[_0x5f2e('0x1d')](function(_0x661161){delete _0x661161[_0x5f2e('0x2e')];for(var _0x4ba8ab=0x0;_0x4ba8ab0x0){return new Promise(function(_0x3e8370){var _0x5a3c9b=[];for(var _0x470f21=0x0;_0x470f21<_0x2377c2[_0x5f2e('0x30')];_0x470f21++){_0x5a3c9b['push'](insertAdditionalPhones(_0x2377c2[_0x470f21]['contact'],_0x2377c2[_0x470f21]['additionalPhones']));}Promise[_0x5f2e('0x69')](_0x5a3c9b)['then'](function(){_0x3e8370(0x1);});})[_0x5f2e('0x1d')](function(){return{'success':_0x558ec3,'failure':_0x1a63a2,'duplicates':_0x33e431};});}else{return{'success':_0x558ec3,'failure':_0x1a63a2,'duplicates':_0x33e431};}}})['then'](respondWithResult(_0x66eeeb,0xc9))['catch'](handleError(_0x66eeeb,null));};exports[_0x5f2e('0x6a')]=function(_0x1ec046,_0x2aa6d8){var _0x321435;return db['CmContact']['describe']()[_0x5f2e('0x1d')](function(_0x5e3c8e){return db['CmContact'][_0x5f2e('0x2c')]({'where':{'id':_0x1ec046[_0x5f2e('0x2d')]['id']},'include':[{'model':db[_0x5f2e('0x6b')],'as':_0x5f2e('0x6c'),'attributes':['id',_0x5f2e('0x23'),_0x5f2e('0x6d')],'required':_0x1ec046[_0x5f2e('0x35')][_0x5f2e('0x6e')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x5f2e('0x6f'),'where':{'CmContactId':_0x1ec046[_0x5f2e('0x2d')]['id']},'required':![],'include':[{'model':db[_0x5f2e('0x70')],'as':_0x5f2e('0x71')}]}],'order':[db[_0x5f2e('0x72')][_0x5f2e('0x73')](_0x5f2e('0x74'))],'attributes':_[_0x5f2e('0x2f')](_0x5e3c8e)});})[_0x5f2e('0x1d')](function(_0x50be67){if(!_['isNil'](_0x50be67)){_0x321435=_0x50be67['get']({'plain':!![]});var _0x575d21={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x50be67&&_0x50be67[_0x5f2e('0x67')]){if(_0x50be67['ListId']){_0x575d21[_0x5f2e('0x65')][_0x5f2e('0x75')][_0x5f2e('0x66')]({'ListId':{'$ne':_0x50be67[_0x5f2e('0x67')]}});}}return db['CmCustomField']['findAll'](_0x575d21);}})[_0x5f2e('0x1d')](function(_0x60324e){if(!_[_0x5f2e('0x5d')](_0x60324e)){return _['omit'](_0x321435,_[_0x5f2e('0x76')](_0x60324e,function(_0x18e037){return util[_0x5f2e('0x77')]('cf_%d',_0x18e037['id']);}));}})[_0x5f2e('0x1d')](handleEntityNotFound(_0x2aa6d8,null))[_0x5f2e('0x1d')](respondWithResult(_0x2aa6d8,null))['catch'](handleError(_0x2aa6d8,null));};exports[_0x5f2e('0x1c')]=function(_0x59418a,_0x43f47f){var _0x3b27df;if(_0x59418a[_0x5f2e('0x3e')]['id']){delete _0x59418a[_0x5f2e('0x3e')]['id'];}if(!_['isNil'](_0x59418a[_0x5f2e('0x3e')][_0x5f2e('0x5e')])){var _0x5b03b3=_0x59418a['body']['dialTimezone'];if(!_[_0x5f2e('0x5d')](shared[_0x5f2e('0x5f')][_0x5b03b3]))_0x59418a['body']['utcOffset']=shared[_0x5f2e('0x5f')][_0x5b03b3][_0x5f2e('0x60')];}return db[_0x5f2e('0x2b')][_0x5f2e('0x2c')]({'where':{'id':_0x59418a[_0x5f2e('0x2d')]['id']}})[_0x5f2e('0x1d')](handleEntityNotFound(_0x43f47f,null))[_0x5f2e('0x1d')](saveUpdates(_0x59418a['body'],null))[_0x5f2e('0x1d')](function(_0x55a323){_0x3b27df=_0x55a323;var _0x25fa1c={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x55a323&&_0x55a323['ListId']){if(_0x55a323[_0x5f2e('0x67')]){_0x25fa1c['where'][_0x5f2e('0x75')]['push']({'ListId':{'$ne':_0x55a323[_0x5f2e('0x67')]}});}}return db['CmCustomField'][_0x5f2e('0x28')](_0x25fa1c);})[_0x5f2e('0x1d')](function(_0x54f7bd){if(_0x54f7bd){return _['omit'](_[_0x5f2e('0x78')](_0x59418a[_0x5f2e('0x3e')],function(_0x20403e,_0x597633){return _[_0x5f2e('0x31')](_0x597633,'cf_');}),_[_0x5f2e('0x76')](_0x54f7bd,function(_0x180bdd){return util['format'](_0x5f2e('0x79'),_0x180bdd['id']);}));}})[_0x5f2e('0x1d')](function(_0x24195e){if(_0x24195e&&!_[_0x5f2e('0x7a')](_0x24195e)){var _0x281c46=squel[_0x5f2e('0x1c')]()[_0x5f2e('0x7b')]('cm_contacts')['setFields'](_0x24195e)[_0x5f2e('0x65')](_0x5f2e('0x7c'),_0x59418a[_0x5f2e('0x2d')]['id'])[_0x5f2e('0x7d')]();return db['sequelize'][_0x5f2e('0x35')](_0x281c46[_0x5f2e('0x7e')],{'replacements':_0x281c46[_0x5f2e('0x3a')]});}})[_0x5f2e('0x1d')](function(){if(_0x59418a['body'][_0x5f2e('0x7f')]&&_0x3b27df){return db[_0x5f2e('0x80')][_0x5f2e('0x1c')]({'phone':_0x59418a[_0x5f2e('0x3e')][_0x5f2e('0x7f')],'OrderBy':0x0},{'where':{'ContactId':_0x3b27df['id']}});}})[_0x5f2e('0x1d')](function(){return _0x3b27df;})[_0x5f2e('0x1d')](respondWithResult(_0x43f47f,null))[_0x5f2e('0x2a')](handleError(_0x43f47f,null));};exports[_0x5f2e('0x81')]=function(_0x2c7ce4,_0x4200f0){var _0x2a05ba={};var _0x5f4361={};var _0x10a177;var _0x2e02c0;return db[_0x5f2e('0x2b')]['findOne']({'where':{'id':_0x2c7ce4[_0x5f2e('0x2d')]['id']}})[_0x5f2e('0x1d')](handleEntityNotFound(_0x4200f0,null))[_0x5f2e('0x1d')](function(_0x17b085){if(_0x17b085){_0x10a177=_0x17b085;_0x5f4361[_0x5f2e('0x82')]=_['keys'](db['Tag']['rawAttributes']);_0x5f4361[_0x5f2e('0x35')]=_[_0x5f2e('0x2f')](_0x2c7ce4[_0x5f2e('0x35')]);_0x5f4361[_0x5f2e('0x83')]=_[_0x5f2e('0x84')](_0x5f4361['model'],_0x5f4361['query']);_0x2a05ba[_0x5f2e('0x85')]=_[_0x5f2e('0x84')](_0x5f4361[_0x5f2e('0x82')],qs[_0x5f2e('0x86')](_0x2c7ce4[_0x5f2e('0x35')]['fields']));_0x2a05ba[_0x5f2e('0x85')]=_0x2a05ba[_0x5f2e('0x85')][_0x5f2e('0x30')]?_0x2a05ba[_0x5f2e('0x85')]:_0x5f4361['model'];_0x2a05ba[_0x5f2e('0x87')]=qs['sort'](_0x2c7ce4[_0x5f2e('0x35')][_0x5f2e('0x88')]);_0x2a05ba['where']=qs[_0x5f2e('0x83')](_['pick'](_0x2c7ce4[_0x5f2e('0x35')],_0x5f4361['filters']));if(_0x2c7ce4[_0x5f2e('0x35')]['filter']){_0x2a05ba[_0x5f2e('0x65')]=_[_0x5f2e('0x3d')](_0x2a05ba[_0x5f2e('0x65')],{'$or':_[_0x5f2e('0x76')](_0x2a05ba[_0x5f2e('0x85')],function(_0x3dfe98){var _0x44d3e5={};_0x44d3e5[_0x3dfe98]={'$like':'%'+_0x2c7ce4[_0x5f2e('0x35')]['filter']+'%'};return _0x44d3e5;})});}_0x2a05ba=_[_0x5f2e('0x3d')]({},_0x2a05ba,_0x2c7ce4[_0x5f2e('0x89')]);return _0x10a177[_0x5f2e('0x81')](_0x2a05ba);}})[_0x5f2e('0x1d')](function(_0x1f0bc0){if(_0x1f0bc0){_0x2e02c0=_0x1f0bc0[_0x5f2e('0x30')];if(!_0x2c7ce4[_0x5f2e('0x35')][_0x5f2e('0x8a')]('nolimit')){_0x2a05ba[_0x5f2e('0x16')]=qs[_0x5f2e('0x16')](_0x2c7ce4[_0x5f2e('0x35')]['limit']);_0x2a05ba['offset']=qs[_0x5f2e('0x14')](_0x2c7ce4[_0x5f2e('0x35')]['offset']);}return _0x10a177[_0x5f2e('0x81')](_0x2a05ba);}})[_0x5f2e('0x1d')](function(_0xefd639){if(_0xefd639){return _0xefd639?{'count':_0x2e02c0,'rows':_0xefd639}:null;}})[_0x5f2e('0x1d')](respondWithResult(_0x4200f0,null))[_0x5f2e('0x2a')](handleError(_0x4200f0,null));};exports[_0x5f2e('0x8b')]=function(_0x139aaf,_0x2268b3){if(_0x139aaf['body']['id']){delete _0x139aaf[_0x5f2e('0x3e')]['id'];}return db[_0x5f2e('0x2b')][_0x5f2e('0x8c')]({'where':{'id':_0x139aaf[_0x5f2e('0x2d')]['id']}})[_0x5f2e('0x1d')](handleEntityNotFound(_0x2268b3,null))[_0x5f2e('0x1d')](function(_0x5e0909){if(_0x5e0909){return _0x5e0909[_0x5f2e('0x8b')](_0x139aaf[_0x5f2e('0x3e')][_0x5f2e('0x8d')]||[]);}return null;})[_0x5f2e('0x1d')](respondWithResult(_0x2268b3,null))[_0x5f2e('0x2a')](handleError(_0x2268b3,null));};exports[_0x5f2e('0x8e')]=function(_0x246a6b,_0x3691a5){var _0x4b1329=[];_0x4b1329['push'](addAdditionalPhones(_0x246a6b[_0x5f2e('0x3e')]));Promise[_0x5f2e('0x69')](_0x4b1329)[_0x5f2e('0x1d')](function(){_0x4b1329=[];_0x4b1329[_0x5f2e('0x66')](deleteCmHopperPhones(_0x246a6b[_0x5f2e('0x3e')]['id']));_0x4b1329['push'](addCmHopperPhones(_0x246a6b[_0x5f2e('0x3e')]['id']));Promise[_0x5f2e('0x69')](_0x4b1329)[_0x5f2e('0x1d')](function(){return[0x1];})['then'](respondWithResult(_0x3691a5,null));});};function addAdditionalPhones(_0x4afe94){var _0x433a13;return new Promise(function(_0x37dffc){return db['CmContactHasItem'][_0x5f2e('0x1e')]({'where':{'CmContactId':_0x4afe94['id']}})[_0x5f2e('0x1d')](function(){db[_0x5f2e('0x70')][_0x5f2e('0x28')]({'raw':!![],'attributes':['id','OrderBy']})['then'](function(_0x3703f3){var _0x161b31=[];for(var _0x1a4197=0x0;_0x1a4197<_0x4afe94[_0x5f2e('0x8f')][_0x5f2e('0x30')];_0x1a4197++){var _0x43704e=_0x4afe94[_0x5f2e('0x90')]?_['isNil'](_0x4afe94[_0x5f2e('0x90')][_0x1a4197])?'':_0x4afe94['item_types'][_0x1a4197]:_0x4afe94[_0x5f2e('0x8f')][_0x1a4197][_0x5f2e('0x91')]?_0x4afe94[_0x5f2e('0x8f')][_0x1a4197][_0x5f2e('0x91')]:'';var _0x24613f=_['isNil'](_0x4afe94['items'][_0x1a4197][_0x5f2e('0x92')])?'':_0x4afe94[_0x5f2e('0x8f')][_0x1a4197][_0x5f2e('0x92')];var _0x5db331=_0x43704e+':'+_0x4afe94[_0x5f2e('0x8f')][_0x1a4197][_0x5f2e('0x7f')]+'§'+_0x24613f;if(_[_0x5f2e('0x5d')](_0x433a13))_0x433a13=_0x5db331;else _0x433a13+=';'+_0x5db331;var _0x511211=null;var _0x31b77b=null;if(_0x4afe94[_0x5f2e('0x90')]){if(!_[_0x5f2e('0x5d')](_0x4afe94['item_types'][_0x1a4197])){_0x31b77b=_['find'](_0x3703f3,function(_0x551379){return _0x551379['id']===_0x4afe94[_0x5f2e('0x90')][_0x1a4197];});if(!_[_0x5f2e('0x5d')](_0x31b77b)){_0x511211=_0x31b77b[_0x5f2e('0x93')];}}}else{if(!_[_0x5f2e('0x5d')](_0x4afe94[_0x5f2e('0x8f')][_0x1a4197])){_0x31b77b=_['find'](_0x3703f3,function(_0x51ed0f){return _0x51ed0f['id']===_0x4afe94[_0x5f2e('0x8f')][_0x1a4197][_0x5f2e('0x91')];});if(!_[_0x5f2e('0x5d')](_0x31b77b)){_0x511211=_0x1a4197;}}}if(_['isNil'](_0x511211)){_0x511211=0x64;}_0x161b31['push'](addAdditionalPhone(_0x4afe94['id'],_0x4afe94['items'][_0x1a4197][_0x5f2e('0x7f')],_0x4afe94[_0x5f2e('0x90')]?_[_0x5f2e('0x5d')](_0x4afe94[_0x5f2e('0x90')][_0x1a4197])?null:_0x4afe94[_0x5f2e('0x90')][_0x1a4197]:_0x4afe94[_0x5f2e('0x8f')][_0x1a4197][_0x5f2e('0x91')]?_0x4afe94['items'][_0x1a4197]['ItemTypeId']:null,_0x511211,_0x24613f));}Promise[_0x5f2e('0x69')](_0x161b31)[_0x5f2e('0x1d')](function(){db['CmContact'][_0x5f2e('0x1c')]({'AdditionalPhones':_0x433a13},{'where':{'id':_0x4afe94['id']}})[_0x5f2e('0x1d')](function(){_0x37dffc(0x1);});});});});});}function addAdditionalPhone(_0x38e35f,_0x562634,_0xdda83,_0x3e9d0e,_0x12d11c){return db[_0x5f2e('0x52')][_0x5f2e('0x2c')]({'where':{'CmContactId':_0x38e35f,'item':_0x562634}})[_0x5f2e('0x1d')](function(_0x413aa4){if(_0x413aa4)logger[_0x5f2e('0x44')]('contact\x20phone\x20exists',_0x413aa4);else{db[_0x5f2e('0x52')][_0x5f2e('0x48')]({'CmContactId':_0x38e35f,'item':_0x562634,'ItemTypeId':_0xdda83,'OrderBy':_0x3e9d0e,'ItemClass':'PHONE','description':_0x12d11c});}});}function deleteCmHopperPhones(_0x51f714){return new Promise(function(_0xface1a){return db[_0x5f2e('0x80')][_0x5f2e('0x28')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x51f714}})[_0x5f2e('0x1d')](function(_0x3d77b7){db['CmHopperAdditionalPhone'][_0x5f2e('0x1e')]({'where':{'CmHopperId':{'$in':_[_0x5f2e('0x76')](_0x3d77b7,'id')}}});})[_0x5f2e('0x1d')](function(){_0xface1a(0x1);});});}function addCmHopperPhones(_0x4466fd){return new Promise(function(_0xf3ae6c){return db[_0x5f2e('0x80')][_0x5f2e('0x28')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x4466fd}})[_0x5f2e('0x1d')](function(_0x4b67ff){var _0x32addd=[];_[_0x5f2e('0x76')](_0x4b67ff,function(_0x58b0be){_0x32addd['push'](createCmHopperPhone(_0x4466fd,_0x58b0be['id']));});Promise[_0x5f2e('0x69')](_0x32addd)['then'](function(){_0xf3ae6c(0x1);});});});}function createCmHopperPhone(_0x3db953,_0x1c3b3b){return new Promise(function(_0x5c73d4){db[_0x5f2e('0x52')][_0x5f2e('0x28')]({'raw':!![],'attributes':['item',_0x5f2e('0x93')],'where':{'CmContactId':_0x3db953,'ItemClass':'PHONE'},'include':[{'model':db[_0x5f2e('0x70')],'attributes':[_0x5f2e('0x93')],'as':_0x5f2e('0x71')}],'order':['OrderBy',db['sequelize'][_0x5f2e('0x73')](_0x5f2e('0x94'))]})[_0x5f2e('0x1d')](function(_0x1f8aad){var _0x1ebd1a=0x1;var _0x69f86c=_[_0x5f2e('0x76')](_0x1f8aad,function(_0x1fabb9){_0x1fabb9[_0x5f2e('0x95')]=_0x1c3b3b;_0x1fabb9[_0x5f2e('0x7f')]=_0x1fabb9[_0x5f2e('0x96')];_0x1fabb9['OrderBy']=_0x1ebd1a;delete _0x1fabb9['ItemType.OrderBy'];_0x1ebd1a=_0x1ebd1a+0x1;return _0x1fabb9;});return db[_0x5f2e('0x97')][_0x5f2e('0x62')](_0x69f86c,{});})[_0x5f2e('0x1d')](function(){_0x5c73d4(0x1);});});}function insertAdditionalPhones(_0x20b96e,_0x20d24a){return new Promise(function(_0x1e07ea){var _0xc75b26=[];for(var _0x49c0fe=0x0;_0x49c0fe<_0x20d24a['length'];_0x49c0fe++){var _0x3f5c1f=_0x20d24a[_0x49c0fe];_0xc75b26[_0x5f2e('0x66')](parseContactItemType(_0x3f5c1f));}Promise['all'](_0xc75b26)[_0x5f2e('0x1d')](function(){var _0x1a9496={'id':_0x20b96e['id'],'items':_0x20d24a};return addAdditionalPhones(_0x1a9496)[_0x5f2e('0x1d')](function(){return addCmHopperPhones(_0x20b96e['id']);});})[_0x5f2e('0x1d')](function(){_0x1e07ea(_0x20b96e);});});}function parseContactItemType(_0x195ca9){return new Promise(function(_0x5015e7){if(_0x195ca9['hasOwnProperty'](_0x5f2e('0x91'))){_0x5015e7(_0x195ca9);}else{return db[_0x5f2e('0x70')][_0x5f2e('0x2c')]({'where':{'name':_0x195ca9[_0x5f2e('0x71')]}})['then'](function(_0x4fdc4a){if(_[_0x5f2e('0x5d')](_0x4fdc4a))_0x195ca9['ItemTypeId']=null;else _0x195ca9[_0x5f2e('0x91')]=_0x4fdc4a['id'];_0x5015e7(_0x195ca9);});}});}exports[_0x5f2e('0x98')]=function(_0x165c59,_0x594020){return db['CmContactHasItem'][_0x5f2e('0x28')]({'raw':!![],'where':{'CmContactId':_0x165c59[_0x5f2e('0x2d')]['id'],'ItemClass':_0x5f2e('0x99')},'include':[{'model':db[_0x5f2e('0x70')],'as':_0x5f2e('0x71')}],'order':[[_0x5f2e('0x93')],[db['sequelize'][_0x5f2e('0x73')](_0x5f2e('0x94'))]]})['then'](function(_0x2287c2){return _0x2287c2;})[_0x5f2e('0x1d')](respondWithResult(_0x594020,null))['catch'](handleError(_0x594020,null));};exports[_0x5f2e('0x9a')]=function(_0x45daf2,_0x3414b1){return db[_0x5f2e('0x52')][_0x5f2e('0x28')]({'raw':!![],'where':{'CmContactId':_0x45daf2[_0x5f2e('0x3e')]['fromContactId']}})[_0x5f2e('0x1d')](function(_0x5a1056){var _0x31b8c4=_[_0x5f2e('0x76')](_0x5a1056,function(_0x434fea){_0x434fea[_0x5f2e('0x9b')]=_0x45daf2[_0x5f2e('0x3e')][_0x5f2e('0x9c')];return _0x434fea;});return db[_0x5f2e('0x52')][_0x5f2e('0x62')](_0x31b8c4,{});})[_0x5f2e('0x1d')](function(){return addCmHopperPhones(_0x45daf2[_0x5f2e('0x3e')]['toContactId']);})[_0x5f2e('0x1d')](function(){return['ok'];})[_0x5f2e('0x1d')](respondWithResult(_0x3414b1,null))[_0x5f2e('0x2a')](handleError(_0x3414b1,null));};exports[_0x5f2e('0x9d')]=function(_0x32be03,_0x2dc178){var _0x30207e=[];_0x30207e[_0x5f2e('0x66')](createCmHopperPhone(_0x32be03['body']['id'],_0x32be03[_0x5f2e('0x3e')]['hopperId']));Promise['all'](_0x30207e)['then'](function(){return[0x1];})['then'](respondWithResult(_0x2dc178,null));};exports['getHoppers']=function(_0x488b72,_0x5685f8){var _0x288c9a={'raw':![],'where':{}};var _0x43c2ae={};var _0x516c09={'count':0x0,'rows':[]};return db[_0x5f2e('0x2b')][_0x5f2e('0x8c')]({'where':{'id':_0x488b72['params']['id']}})[_0x5f2e('0x1d')](handleEntityNotFound(_0x5685f8,null))[_0x5f2e('0x1d')](function(_0x38a7d8){if(_0x38a7d8){_0x43c2ae[_0x5f2e('0x82')]=_[_0x5f2e('0x2f')](db['CmHopper'][_0x5f2e('0x9e')]);_0x43c2ae[_0x5f2e('0x35')]=_['keys'](_0x488b72[_0x5f2e('0x35')]);_0x43c2ae[_0x5f2e('0x83')]=_[_0x5f2e('0x84')](_0x43c2ae[_0x5f2e('0x82')],_0x43c2ae[_0x5f2e('0x35')]);_0x288c9a[_0x5f2e('0x85')]=_[_0x5f2e('0x84')](_0x43c2ae[_0x5f2e('0x82')],qs[_0x5f2e('0x86')](_0x488b72[_0x5f2e('0x35')][_0x5f2e('0x86')]));_0x288c9a[_0x5f2e('0x85')]=_0x288c9a[_0x5f2e('0x85')][_0x5f2e('0x30')]?_0x288c9a[_0x5f2e('0x85')]:_0x43c2ae['model'];if(!_0x488b72[_0x5f2e('0x35')][_0x5f2e('0x8a')](_0x5f2e('0x9f'))){_0x288c9a['limit']=qs[_0x5f2e('0x16')](_0x488b72[_0x5f2e('0x35')][_0x5f2e('0x16')]);_0x288c9a[_0x5f2e('0x14')]=qs[_0x5f2e('0x14')](_0x488b72[_0x5f2e('0x35')]['offset']);}_0x288c9a[_0x5f2e('0x87')]=qs['sort'](_0x488b72[_0x5f2e('0x35')][_0x5f2e('0x88')]);_0x288c9a[_0x5f2e('0x65')]=qs[_0x5f2e('0x83')](_[_0x5f2e('0xa0')](_0x488b72[_0x5f2e('0x35')],_0x43c2ae[_0x5f2e('0x83')]));_0x288c9a[_0x5f2e('0x65')][_0x5f2e('0xa1')]=_0x38a7d8['id'];if(_0x488b72[_0x5f2e('0x35')]['filter']){_0x288c9a[_0x5f2e('0x65')]=_[_0x5f2e('0x3d')](_0x288c9a['where'],{'$or':_[_0x5f2e('0x76')](_0x288c9a[_0x5f2e('0x85')],function(_0x56c51c){var _0x51fca2={};_0x51fca2[_0x56c51c]={'$like':'%'+_0x488b72['query'][_0x5f2e('0xa2')]+'%'};return _0x51fca2;})});}_0x288c9a=_[_0x5f2e('0x3d')]({},_0x288c9a,_0x488b72[_0x5f2e('0x89')]);return db[_0x5f2e('0x80')][_0x5f2e('0x17')]({'where':_0x288c9a[_0x5f2e('0x65')]})['then'](function(_0x12e68f){_0x516c09['count']=_0x12e68f;if(_0x488b72[_0x5f2e('0x35')][_0x5f2e('0xa3')]){_0x288c9a['include']=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x288c9a);})[_0x5f2e('0x1d')](function(_0x41c62b){_0x516c09[_0x5f2e('0xa4')]=_0x41c62b;return _0x516c09;});}})[_0x5f2e('0x1d')](respondWithFilteredResult(_0x5685f8,_0x288c9a))['catch'](handleError(_0x5685f8,null));};exports[_0x5f2e('0xa5')]=function(_0x42d602,_0x44c67c){var _0x529842={'raw':!![],'where':{}};var _0x13b620={};var _0x107edb={'count':0x0,'rows':[]};return db[_0x5f2e('0x2b')][_0x5f2e('0x8c')]({'where':{'id':_0x42d602[_0x5f2e('0x2d')]['id']}})[_0x5f2e('0x1d')](handleEntityNotFound(_0x44c67c,null))[_0x5f2e('0x1d')](function(_0x9e1d42){if(_0x9e1d42){_0x13b620['model']=_['keys'](db['CmHopperHistory']['rawAttributes']);_0x13b620[_0x5f2e('0x35')]=_[_0x5f2e('0x2f')](_0x42d602[_0x5f2e('0x35')]);_0x13b620[_0x5f2e('0x83')]=_[_0x5f2e('0x84')](_0x13b620[_0x5f2e('0x82')],_0x13b620[_0x5f2e('0x35')]);_0x529842[_0x5f2e('0x85')]=_[_0x5f2e('0x84')](_0x13b620[_0x5f2e('0x82')],qs['fields'](_0x42d602[_0x5f2e('0x35')][_0x5f2e('0x86')]));_0x529842[_0x5f2e('0x85')]=_0x529842[_0x5f2e('0x85')][_0x5f2e('0x30')]?_0x529842[_0x5f2e('0x85')]:_0x13b620[_0x5f2e('0x82')];if(!_0x42d602[_0x5f2e('0x35')]['hasOwnProperty'](_0x5f2e('0x9f'))){_0x529842[_0x5f2e('0x16')]=qs[_0x5f2e('0x16')](_0x42d602[_0x5f2e('0x35')][_0x5f2e('0x16')]);_0x529842['offset']=qs[_0x5f2e('0x14')](_0x42d602['query'][_0x5f2e('0x14')]);}_0x529842[_0x5f2e('0x87')]=qs[_0x5f2e('0x88')](_0x42d602[_0x5f2e('0x35')]['sort']);_0x529842[_0x5f2e('0x65')]=qs[_0x5f2e('0x83')](_['pick'](_0x42d602[_0x5f2e('0x35')],_0x13b620[_0x5f2e('0x83')]));_0x529842[_0x5f2e('0x65')][_0x5f2e('0xa1')]=_0x9e1d42['id'];if(_0x42d602[_0x5f2e('0x35')][_0x5f2e('0xa2')]){_0x529842[_0x5f2e('0x65')]=_['merge'](_0x529842[_0x5f2e('0x65')],{'$or':_[_0x5f2e('0x76')](_0x529842['attributes'],function(_0x5bbda7){var _0x5f4d99={};_0x5f4d99[_0x5bbda7]={'$like':'%'+_0x42d602[_0x5f2e('0x35')][_0x5f2e('0xa2')]+'%'};return _0x5f4d99;})});}_0x529842=_['merge']({},_0x529842,_0x42d602['options']);return db[_0x5f2e('0x54')][_0x5f2e('0x17')]({'where':_0x529842['where']})[_0x5f2e('0x1d')](function(_0x2fb78d){_0x107edb[_0x5f2e('0x17')]=_0x2fb78d;if(_0x42d602[_0x5f2e('0x35')][_0x5f2e('0xa3')]){_0x529842[_0x5f2e('0xa6')]=[{'all':!![]}];}return db[_0x5f2e('0x54')][_0x5f2e('0x28')](_0x529842);})['then'](function(_0x10dac2){_0x107edb[_0x5f2e('0xa4')]=_0x10dac2;return _0x107edb;});}})[_0x5f2e('0x1d')](respondWithFilteredResult(_0x44c67c,_0x529842))[_0x5f2e('0x2a')](handleError(_0x44c67c,null));};exports['getHopperFinals']=function(_0x32d45c,_0x56c477){var _0x1f2363={'raw':!![],'where':{}};var _0x90a6ab={};var _0x505d81={'count':0x0,'rows':[]};return db[_0x5f2e('0x2b')][_0x5f2e('0x8c')]({'where':{'id':_0x32d45c['params']['id']}})[_0x5f2e('0x1d')](handleEntityNotFound(_0x56c477,null))[_0x5f2e('0x1d')](function(_0x4af2ca){if(_0x4af2ca){_0x90a6ab[_0x5f2e('0x82')]=_['keys'](db[_0x5f2e('0x53')][_0x5f2e('0x9e')]);_0x90a6ab[_0x5f2e('0x35')]=_[_0x5f2e('0x2f')](_0x32d45c['query']);_0x90a6ab[_0x5f2e('0x83')]=_[_0x5f2e('0x84')](_0x90a6ab[_0x5f2e('0x82')],_0x90a6ab[_0x5f2e('0x35')]);_0x1f2363[_0x5f2e('0x85')]=_[_0x5f2e('0x84')](_0x90a6ab['model'],qs['fields'](_0x32d45c[_0x5f2e('0x35')][_0x5f2e('0x86')]));_0x1f2363[_0x5f2e('0x85')]=_0x1f2363[_0x5f2e('0x85')][_0x5f2e('0x30')]?_0x1f2363[_0x5f2e('0x85')]:_0x90a6ab[_0x5f2e('0x82')];if(!_0x32d45c[_0x5f2e('0x35')]['hasOwnProperty']('nolimit')){_0x1f2363['limit']=qs['limit'](_0x32d45c[_0x5f2e('0x35')][_0x5f2e('0x16')]);_0x1f2363['offset']=qs[_0x5f2e('0x14')](_0x32d45c['query'][_0x5f2e('0x14')]);}_0x1f2363[_0x5f2e('0x87')]=qs['sort'](_0x32d45c['query']['sort']);_0x1f2363[_0x5f2e('0x65')]=qs[_0x5f2e('0x83')](_[_0x5f2e('0xa0')](_0x32d45c[_0x5f2e('0x35')],_0x90a6ab[_0x5f2e('0x83')]));_0x1f2363['where']['ContactId']=_0x4af2ca['id'];if(_0x32d45c[_0x5f2e('0x35')][_0x5f2e('0xa2')]){_0x1f2363['where']=_[_0x5f2e('0x3d')](_0x1f2363[_0x5f2e('0x65')],{'$or':_[_0x5f2e('0x76')](_0x1f2363['attributes'],function(_0x55d94){var _0x234159={};_0x234159[_0x55d94]={'$like':'%'+_0x32d45c[_0x5f2e('0x35')][_0x5f2e('0xa2')]+'%'};return _0x234159;})});}_0x1f2363=_['merge']({},_0x1f2363,_0x32d45c[_0x5f2e('0x89')]);return db[_0x5f2e('0x53')][_0x5f2e('0x17')]({'where':_0x1f2363[_0x5f2e('0x65')]})[_0x5f2e('0x1d')](function(_0x2e9d36){_0x505d81[_0x5f2e('0x17')]=_0x2e9d36;if(_0x32d45c['query'][_0x5f2e('0xa3')]){_0x1f2363[_0x5f2e('0xa6')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x5f2e('0x28')](_0x1f2363);})[_0x5f2e('0x1d')](function(_0x2e7e5e){_0x505d81[_0x5f2e('0xa4')]=_0x2e7e5e;return _0x505d81;});}})['then'](respondWithFilteredResult(_0x56c477,_0x1f2363))[_0x5f2e('0x2a')](handleError(_0x56c477,null));};exports[_0x5f2e('0xa7')]=function(_0x2e9469,_0x9e002e){var _0x47c9ec={'raw':!![],'where':{}};var _0x4285ac={};var _0x51c6d={'count':0x0,'rows':[]};return db['CmContact']['findOne']({'where':{'id':_0x2e9469[_0x5f2e('0x2d')]['id']}})[_0x5f2e('0x1d')](handleEntityNotFound(_0x9e002e,null))[_0x5f2e('0x1d')](function(_0x97d53e){if(_0x97d53e){_0x4285ac[_0x5f2e('0x82')]=_[_0x5f2e('0x2f')](db[_0x5f2e('0x59')][_0x5f2e('0x9e')]);_0x4285ac['query']=_[_0x5f2e('0x2f')](_0x2e9469[_0x5f2e('0x35')]);_0x4285ac[_0x5f2e('0x83')]=_['intersection'](_0x4285ac[_0x5f2e('0x82')],_0x4285ac['query']);_0x47c9ec['attributes']=_[_0x5f2e('0x84')](_0x4285ac[_0x5f2e('0x82')],qs[_0x5f2e('0x86')](_0x2e9469['query'][_0x5f2e('0x86')]));_0x47c9ec[_0x5f2e('0x85')]=_0x47c9ec[_0x5f2e('0x85')][_0x5f2e('0x30')]?_0x47c9ec['attributes']:_0x4285ac['model'];if(!_0x2e9469['query'][_0x5f2e('0x8a')](_0x5f2e('0x9f'))){_0x47c9ec[_0x5f2e('0x16')]=qs[_0x5f2e('0x16')](_0x2e9469['query'][_0x5f2e('0x16')]);_0x47c9ec[_0x5f2e('0x14')]=qs['offset'](_0x2e9469[_0x5f2e('0x35')][_0x5f2e('0x14')]);}_0x47c9ec[_0x5f2e('0x87')]=qs['sort'](_0x2e9469[_0x5f2e('0x35')][_0x5f2e('0x88')]);_0x47c9ec['where']=qs['filters'](_['pick'](_0x2e9469[_0x5f2e('0x35')],_0x4285ac[_0x5f2e('0x83')]));_0x47c9ec[_0x5f2e('0x65')]['ContactId']=_0x97d53e['id'];if(_0x2e9469[_0x5f2e('0x35')][_0x5f2e('0xa2')]){_0x47c9ec[_0x5f2e('0x65')]=_[_0x5f2e('0x3d')](_0x47c9ec[_0x5f2e('0x65')],{'$or':_[_0x5f2e('0x76')](_0x47c9ec[_0x5f2e('0x85')],function(_0x49a058){var _0x50c721={};_0x50c721[_0x49a058]={'$like':'%'+_0x2e9469[_0x5f2e('0x35')][_0x5f2e('0xa2')]+'%'};return _0x50c721;})});}_0x47c9ec=_[_0x5f2e('0x3d')]({},_0x47c9ec,_0x2e9469[_0x5f2e('0x89')]);return db[_0x5f2e('0x59')][_0x5f2e('0x17')]({'where':_0x47c9ec[_0x5f2e('0x65')]})['then'](function(_0x4681a4){_0x51c6d[_0x5f2e('0x17')]=_0x4681a4;if(_0x2e9469[_0x5f2e('0x35')][_0x5f2e('0xa3')]){_0x47c9ec[_0x5f2e('0xa6')]=[{'all':!![]}];}return db[_0x5f2e('0x59')][_0x5f2e('0x28')](_0x47c9ec);})[_0x5f2e('0x1d')](function(_0x13f5e6){_0x51c6d[_0x5f2e('0xa4')]=_0x13f5e6;return _0x51c6d;});}})[_0x5f2e('0x1d')](respondWithFilteredResult(_0x9e002e,_0x47c9ec))[_0x5f2e('0x2a')](handleError(_0x9e002e,null));};exports[_0x5f2e('0xa8')]=function(_0x5ed425,_0x4039c7){try{if(!_0x5ed425[_0x5f2e('0x3e')][_0x5f2e('0x67')]){throw new Error(_0x5f2e('0xa9'));}if(!_0x5ed425[_0x5f2e('0x3e')][_0x5f2e('0xaa')]){throw new Error(_0x5f2e('0xab'));}if(!_0x5ed425['body'][_0x5f2e('0xac')]){throw new Error(_0x5f2e('0xad'));}if(!_0x5ed425[_0x5f2e('0x3e')][_0x5f2e('0xae')]){throw new Error(_0x5f2e('0xaf'));}var _0x194d51=_0x5ed425[_0x5f2e('0x3e')][_0x5f2e('0xaa')]['split'](',');var _0x16b576=_0x5ed425[_0x5f2e('0x3e')]['binding_values'][_0x5f2e('0xb0')](',');if(!_0x194d51[_0x5f2e('0x30')]||!_0x16b576[_0x5f2e('0x30')]||_0x194d51[_0x5f2e('0x30')]!==_0x16b576['length']){throw new Error(_0x5f2e('0xb1'));}_0x5ed425['body'][_0x5f2e('0x86')]=_[_0x5f2e('0xb2')](_0x194d51,_0x16b576);if(!_0x5ed425[_0x5f2e('0x3e')][_0x5f2e('0x86')]['phone']){throw new Error(_0x5f2e('0xb3'));}if(!_0x5ed425[_0x5f2e('0x3e')][_0x5f2e('0x86')][_0x5f2e('0xb4')]){throw new Error('No\x20firstName\x20column\x20specified');}var _0x14ccc5=path['join'](config['root'],'server/files/tmp',_0x5ed425[_0x5f2e('0xb5')][_0x5f2e('0xb6')]);fs[_0x5f2e('0xb7')](_0x14ccc5,parseInt(_0x5f2e('0xb8'),0x8));var _0x1b6862=require(_0x5f2e('0xb9'))[_0x5f2e('0xba')](path[_0x5f2e('0xbb')](__dirname,_0x5f2e('0xbc')),[_0x14ccc5,_0x5ed425[_0x5f2e('0x3e')][_0x5f2e('0xaa')],_0x5ed425[_0x5f2e('0x3e')][_0x5f2e('0xac')],_0x5ed425[_0x5f2e('0x3e')]['ListId'],_0x5ed425[_0x5f2e('0x3e')][_0x5f2e('0xbd')],_0x5ed425['body']['duplicates'],_0x5ed425[_0x5f2e('0x3e')][_0x5f2e('0xae')]]);return _0x4039c7[_0x5f2e('0x18')](0xc8)[_0x5f2e('0x1b')]({'message':_0x5f2e('0xbe'),'pid':_0x1b6862[_0x5f2e('0xbf')]});}catch(_0x4aaa97){return _0x4039c7[_0x5f2e('0x18')](0x1f4)[_0x5f2e('0x24')](_0x4aaa97);}};exports[_0x5f2e('0xc0')]=function(_0x7b239,_0x5893d2){var _0x407e97=fs[_0x5f2e('0xc1')](_0x7b239[_0x5f2e('0xb5')][_0x5f2e('0x3')]);Papa[_0x5f2e('0xc2')](_0x407e97,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x129be7){return _0x5893d2[_0x5f2e('0x18')](0xc8)['json']({'file':_0x7b239[_0x5f2e('0xb5')],'fields':_0x129be7[_0x5f2e('0xc3')][_0x5f2e('0x86')]});}});};exports[_0x5f2e('0xc4')]=function(_0x564d96,_0x52cc8f){return db['User']['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x5f2e('0xc5')}})[_0x5f2e('0x1d')](function(_0x5d47ae){var _0x3f2276=![];if(!_0x564d96[_0x5f2e('0x3e')][_0x5f2e('0x67')]){throw new Error('No\x20ListId\x20specified');}if(!_0x564d96[_0x5f2e('0x3e')][_0x5f2e('0xc6')][_0x5f2e('0x7f')]){throw new Error(_0x5f2e('0xb3'));}if(!_0x564d96[_0x5f2e('0x3e')][_0x5f2e('0xc6')][_0x5f2e('0xb4')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x564d96[_0x5f2e('0x3e')][_0x5f2e('0xae')]){throw new Error(_0x5f2e('0xaf'));}var _0xb326f2=require(_0x5f2e('0xb9'))[_0x5f2e('0xba')](path[_0x5f2e('0xbb')](__dirname,'../../components/import/cm/csv2'),[_0x564d96[_0x5f2e('0x2d')]['id'],JSON['stringify'](_0x564d96[_0x5f2e('0x3e')]),JSON['stringify'](_0x5d47ae)]);_0xb326f2['on'](_0x5f2e('0xc7'),function(){_0x3f2276=!![];return _0x52cc8f[_0x5f2e('0x18')](0xc8)[_0x5f2e('0x1b')]({'message':_0x5f2e('0xc8'),'pid':_0xb326f2[_0x5f2e('0xbf')]});});_0xb326f2['on'](_0x5f2e('0xc9'),function(_0x3632b2){if(_0x3632b2&&!_0x3f2276){return _0x52cc8f['status'](0x1f4)[_0x5f2e('0x1b')]({'message':'error\x20child\x20process','pid':_0xb326f2[_0x5f2e('0xbf')]});}});})[_0x5f2e('0x2a')](handleError(_0x52cc8f,null));};exports['importUpdates']=function(_0x49537d,_0x5a1bba){return db[_0x5f2e('0xca')][_0x5f2e('0x28')]({'raw':!![],'attributes':['id'],'where':{'role':_0x5f2e('0xc5')}})[_0x5f2e('0x1d')](function(_0x4f377a){var _0x2c397a=![];if(!_0x49537d[_0x5f2e('0x3e')][_0x5f2e('0x67')]){throw new Error('No\x20ListId\x20specified');}if(!_0x49537d[_0x5f2e('0x3e')][_0x5f2e('0xc6')]['phone']){throw new Error(_0x5f2e('0xb3'));}if(!_0x49537d['body'][_0x5f2e('0xc6')][_0x5f2e('0xb4')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x49537d[_0x5f2e('0x3e')][_0x5f2e('0xae')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x58dbd2=require('child_process')['fork'](path['join'](__dirname,_0x5f2e('0xcb')),[_0x49537d[_0x5f2e('0x2d')]['id'],JSON[_0x5f2e('0xcc')](_0x49537d['body']),JSON[_0x5f2e('0xcc')](_0x4f377a)]);_0x58dbd2['on'](_0x5f2e('0xc7'),function(){_0x2c397a=!![];return _0x5a1bba[_0x5f2e('0x18')](0xc8)['json']({'message':_0x5f2e('0xc8'),'pid':_0x58dbd2[_0x5f2e('0xbf')]});});_0x58dbd2['on'](_0x5f2e('0xc9'),function(_0x4591b8){if(_0x4591b8&&!_0x2c397a){return _0x5a1bba[_0x5f2e('0x18')](0x1f4)['json']({'message':_0x5f2e('0xcd'),'pid':_0x58dbd2['pid']});}});})[_0x5f2e('0x2a')](handleError(_0x5a1bba,null));};exports['getJourney']=function(_0x3cff2e,_0x1d52c3){var _0x145bd4=['mail','chat',_0x5f2e('0xce'),_0x5f2e('0xcf'),_0x5f2e('0xd0'),_0x5f2e('0xd1'),'voice'];var _0x44d34f={'offset':0x0,'order':qs[_0x5f2e('0x88')]('-createdAt')},_0x379856={'count':0x0,'rows':[]};Promise[_0x5f2e('0xd2')]()[_0x5f2e('0x1d')](function(){if(_0x3cff2e[_0x5f2e('0x35')][_0x5f2e('0xd3')]){if(!_[_0x5f2e('0xd4')](_0x145bd4,_0x3cff2e[_0x5f2e('0x35')][_0x5f2e('0xd3')][_0x5f2e('0xd5')]())){throw new Error('Invalid\x20channel');}_0x145bd4=[_0x3cff2e[_0x5f2e('0x35')][_0x5f2e('0xd3')]['toLowerCase']()];}if(_0x3cff2e['query']['range']){try{var _0x5c6d3d=JSON[_0x5f2e('0xc2')](_0x3cff2e['query'][_0x5f2e('0xd6')]);if(!moment(_0x5c6d3d[_0x5f2e('0x3f')])['isValid']()){throw new Error(_0x5f2e('0xd7'));}if(!moment(_0x5c6d3d['to'])['isValid']()){throw new Error(_0x5f2e('0xd8'));}}catch(_0x3ef59e){throw new Error(_0x5f2e('0xd9'));}}if(!_0x3cff2e[_0x5f2e('0x35')][_0x5f2e('0x8a')](_0x5f2e('0x9f'))){_0x44d34f[_0x5f2e('0x16')]=qs[_0x5f2e('0x16')](_0x3cff2e['query'][_0x5f2e('0x16')]||0xa);_0x44d34f[_0x5f2e('0x14')]=qs[_0x5f2e('0x14')](_0x3cff2e[_0x5f2e('0x35')][_0x5f2e('0x14')]);}var _0x3c1617=_0x145bd4['map'](function(_0x289e9e){if(_0x289e9e===_0x5f2e('0xda')){var _0x42396d={'attributes':['id',_0x5f2e('0xdb'),'type',_0x5f2e('0xdc'),_0x5f2e('0xdd'),_0x5f2e('0xde'),_0x5f2e('0xdf'),_0x5f2e('0xe0'),_0x5f2e('0xe1'),_0x5f2e('0xe2'),_0x5f2e('0xe3'),_0x5f2e('0xe4'),'userSecondDisposition',_0x5f2e('0xe5'),_0x5f2e('0xe6')],'where':{'ContactId':_0x3cff2e[_0x5f2e('0x2d')]['id']},'include':[{'model':db[_0x5f2e('0xca')],'as':'User','attributes':['id',_0x5f2e('0x23'),'fullname',_0x5f2e('0x37')]}],'order':[['createdAt',_0x5f2e('0xe7')]]};if(_0x3cff2e[_0x5f2e('0x35')][_0x5f2e('0xd6')]){_0x42396d['where'][_0x5f2e('0xe3')]={'$gte':_0x5c6d3d[_0x5f2e('0x3f')],'$lte':_0x5c6d3d['to']};}return db[_0x5f2e('0xe8')][_0x5f2e('0xe9')](_0x42396d)[_0x5f2e('0x1d')](function(_0x48d738){_0x379856[_0x5f2e('0x17')]+=_0x48d738[_0x5f2e('0x17')];return _[_0x5f2e('0x76')](_0x48d738['rows'],function(_0x50fa97){var _0x20c76a=_0x50fa97['get']({'plain':!![]});_0x20c76a[_0x5f2e('0xd3')]=_0x289e9e;if(_0x20c76a[_0x5f2e('0xca')]){_0x20c76a['User']={'id':_0x20c76a['User']['id'],'name':_0x20c76a['User']['name'],'fullname':_0x20c76a['User'][_0x5f2e('0xea')],'alias':_0x20c76a[_0x5f2e('0xca')][_0x5f2e('0x37')]};}return _0x20c76a;});});}else{var _0x5631cb=_[_0x5f2e('0xeb')](_0x289e9e)+(_0x289e9e===_0x5f2e('0xec')?_0x5f2e('0xed'):_0x5f2e('0xee'));var _0xaa0147={'attributes':['id',_0x5f2e('0xef'),_0x5f2e('0xf0'),_0x5f2e('0xe3'),_0x5f2e('0xe2'),_0x5f2e('0xf1'),_0x5f2e('0xf2'),_0x5f2e('0xf3'),'UserId',_0x5631cb+'Id'],'where':{'ContactId':_0x3cff2e['params']['id']},'include':[{'model':db[_0x5631cb],'as':'Account','attributes':['id',_0x5f2e('0x23'),'key']},{'model':db[_0x5f2e('0xca')],'as':_0x5f2e('0xf4'),'attributes':['id','name',_0x5f2e('0xea')]},{'model':db[_0x5f2e('0x6b')],'as':_0x5f2e('0x6c'),'attributes':['id','name','color'],'through':{'attributes':[]}}],'order':[[_0x5f2e('0xe3'),_0x5f2e('0xe7')]]};if(_0x3cff2e[_0x5f2e('0x35')]['range']){_0xaa0147[_0x5f2e('0x65')][_0x5f2e('0xe3')]={'$gte':_0x5c6d3d['from'],'$lte':_0x5c6d3d['to']};}switch(_0x289e9e){case _0x5f2e('0xec'):_0xaa0147[_0x5f2e('0x85')][_0x5f2e('0x66')](_0x5f2e('0xf5'),_0x5f2e('0xf6'),_0x5f2e('0xf7'),_0x5f2e('0xf8'),'osName',_0x5f2e('0xf9'),_0x5f2e('0xfa'),'ratingValue',_0x5f2e('0xfb'));break;case'mail':_0xaa0147[_0x5f2e('0x85')]['push'](_0x5f2e('0xfc'),'substatus');break;case _0x5f2e('0xcf'):_0xaa0147[_0x5f2e('0x85')][_0x5f2e('0x66')]('externalUrl',_0x5f2e('0xfd'));break;}return db[_['startCase'](_0x289e9e)+_0x5f2e('0xfe')][_0x5f2e('0xe9')](_0xaa0147)['then'](function(_0x2826e5){_0x379856[_0x5f2e('0x17')]+=_0x2826e5[_0x5f2e('0x17')];return _[_0x5f2e('0x76')](_0x2826e5[_0x5f2e('0xa4')],function(_0x13f848){var _0x4cd513=_0x13f848[_0x5f2e('0x40')]({'plain':!![]});_0x4cd513[_0x5f2e('0xd3')]=_0x289e9e;if(_0x4cd513[_0x5f2e('0xf4')]){_0x4cd513[_0x5f2e('0xf4')]={'id':_0x4cd513['Owner']['id'],'name':_0x4cd513[_0x5f2e('0xf4')][_0x5f2e('0x23')],'fullname':_0x4cd513[_0x5f2e('0xf4')][_0x5f2e('0xea')]};}return _0x4cd513;});});}});return Promise[_0x5f2e('0x69')](_0x3c1617);})[_0x5f2e('0x1d')](function(_0x566f66){return _(_0x566f66)[_0x5f2e('0xff')]()['sortBy']('createdAt')['reverse']()['value']();})[_0x5f2e('0x1d')](function(_0x55fde0){_0x379856['rows']=_0x44d34f[_0x5f2e('0x16')]?_0x55fde0[_0x5f2e('0x100')](_0x44d34f[_0x5f2e('0x14')],_0x44d34f[_0x5f2e('0x14')]+_0x44d34f[_0x5f2e('0x16')]):_0x55fde0;return _0x379856;})[_0x5f2e('0x1d')](respondWithFilteredResult(_0x1d52c3,_0x44d34f))['catch'](handleError(_0x1d52c3,null));}; \ No newline at end of file +var _0xdd98=['./cmContact.socket','register','status','json','offset','undefined','limit','count','destroy','end','sendStatus','error','stack','name','index','describe','getOptions','query','user','then','CmContact','find','params','catch','tags','keys','length','startsWith','cf_','columnName','displayName','analytics','CmCustomField','findAll','alias','type','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','merge','body','get','mergeWith','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','from','[CmContact][merge][destroy][CmHopper],\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','MailInteraction','MailMessage','SmsInteraction','FaxInteraction','FaxMessage','OpenchannelInteraction','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappMessage','WhatsappQueueReport','isArray','isNil','dialTimezone','timezones','utcOffset','additionalPhones','each','duplicates','where','push','findOrCreate','spread','contact','show','Tag','Tags','color','tag','Phones','ContactItemType','ItemType','sequelize','literal','Phones.OrderBy','ListId','$and','map','format','cf_%d','omit','pickBy','isEmpty','table','cm_contacts','setFields','toParam','text','phone','CmHopper','getTags','model','rawAttributes','intersection','attributes','fields','sort','filters','pick','filter','options','hasOwnProperty','setTags','findOne','ids','setAdditionalPhones','all','OrderBy','items','item_types','ItemTypeId','description','PHONE','item','ItemType.OrderBy','bulkCreate','getAdditionalPhones','`ItemType`.OrderBy','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','getHoppers','nolimit','order','ContactId','includeAll','rows','getHopperHistories','CmHopperHistory','include','getHopperFinals','getJscriptySessions','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','split','Incorrect\x20binding\x20parameters\x20passed!','firstName','No\x20firstName\x20column\x20specified','file','filename','chmodSync','child_process','fork','../../components/import/cm/csv','socket_timestamp','File\x20uploaded\x20correctly!','pid','send','upload','parse','meta','User','agent','No\x20phone\x20column\x20specified','binding','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','../../components/import/cm/csv2','stringify','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','importUpdates','../../components/import/cm/csvUpdates','message','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','includes','channel','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','starttime','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','fullname','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','UserId','key','Owner','browserName','customerIp','deviceModel','osName','ratingMessage','ratingType','ratingValue','referer','subject','substatus','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','path','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/environment/shared','../../mysqldb','redis','defaults','localhost','socket.io-emitter'];(function(_0x458dad,_0x573c0b){var _0x534d3a=function(_0x5889af){while(--_0x5889af){_0x458dad['push'](_0x458dad['shift']());}};_0x534d3a(++_0x573c0b);}(_0xdd98,0xf1));var _0x8dd9=function(_0x2ceade,_0xa7ebfd){_0x2ceade=_0x2ceade-0x0;var _0x3354b7=_0xdd98[_0x2ceade];return _0x3354b7;};'use strict';var moment=require(_0x8dd9('0x0'));var BPromise=require(_0x8dd9('0x1'));var util=require('util');var path=require(_0x8dd9('0x2'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8dd9('0x3'));var Papa=require('papaparse');var Redis=require(_0x8dd9('0x4'));var contacts=require(_0x8dd9('0x5'));var qs=require(_0x8dd9('0x6'));var logger=require(_0x8dd9('0x7'))(_0x8dd9('0x8'));var config=require(_0x8dd9('0x9'));var shared=require(_0x8dd9('0xa'));var db=require(_0x8dd9('0xb'))['db'];config[_0x8dd9('0xc')]=_[_0x8dd9('0xd')](config[_0x8dd9('0xc')],{'host':_0x8dd9('0xe'),'port':0x18eb});var socket=require(_0x8dd9('0xf'))(new Redis(config[_0x8dd9('0xc')]));require(_0x8dd9('0x10'))[_0x8dd9('0x11')](socket);function respondWithResult(_0x1406cd,_0xa5c086){_0xa5c086=_0xa5c086||0xc8;return function(_0x5f41cd){if(_0x5f41cd){return _0x1406cd[_0x8dd9('0x12')](_0xa5c086)[_0x8dd9('0x13')](_0x5f41cd);}};}function respondWithFilteredResult(_0x375ec7,_0xcb4e85){return function(_0x29b166){if(_0x29b166){var _0x33f965=typeof _0xcb4e85[_0x8dd9('0x14')]===_0x8dd9('0x15')&&typeof _0xcb4e85[_0x8dd9('0x16')]===_0x8dd9('0x15');var _0x167d7b=_0x29b166[_0x8dd9('0x17')];var _0x9dc07c=_0x33f965?0x0:_0xcb4e85[_0x8dd9('0x14')];var _0x3e8c11=_0x33f965?_0x29b166[_0x8dd9('0x17')]:_0xcb4e85['offset']+_0xcb4e85[_0x8dd9('0x16')];var _0x24a9ed;if(_0x3e8c11>=_0x167d7b){_0x3e8c11=_0x167d7b;_0x24a9ed=0xc8;}else{_0x24a9ed=0xce;}_0x375ec7[_0x8dd9('0x12')](_0x24a9ed);return _0x375ec7['set']('Content-Range',_0x9dc07c+'-'+_0x3e8c11+'/'+_0x167d7b)['json'](_0x29b166);}return null;};}function saveUpdates(_0x329f5b){return function(_0x3cef28){if(_0x3cef28){return _0x3cef28['update'](_0x329f5b)['then'](function(_0x3694f6){return _0x3694f6;});}return null;};}function removeEntity(_0x2fd8dc){return function(_0x2e7f90){if(_0x2e7f90){return _0x2e7f90[_0x8dd9('0x18')]()['then'](function(){_0x2fd8dc[_0x8dd9('0x12')](0xcc)[_0x8dd9('0x19')]();});}};}function handleEntityNotFound(_0x31e6b3){return function(_0x3ff16){if(!_0x3ff16){_0x31e6b3[_0x8dd9('0x1a')](0x194);}return _0x3ff16;};}function handleError(_0x32f0fb,_0x4167e1){_0x4167e1=_0x4167e1||0x1f4;return function(_0x429366){logger[_0x8dd9('0x1b')](_0x429366[_0x8dd9('0x1c')]);if(_0x429366['name']){delete _0x429366[_0x8dd9('0x1d')];}_0x32f0fb[_0x8dd9('0x12')](_0x4167e1)['send'](_0x429366);};}exports[_0x8dd9('0x1e')]=function(_0x30d25c,_0x245b41){var _0x240fbf={};return contacts[_0x8dd9('0x1f')]()['then'](function(_0x55986f){_0x240fbf=qs[_0x8dd9('0x20')](_0x55986f,_0x30d25c);return contacts['findAll'](_0x30d25c[_0x8dd9('0x21')],_0x30d25c[_0x8dd9('0x22')],_0x240fbf,_0x55986f);})[_0x8dd9('0x23')](respondWithFilteredResult(_0x245b41,_0x240fbf))['catch'](handleError(_0x245b41,null));};exports[_0x8dd9('0x18')]=function(_0x196a30,_0x49f688){return db[_0x8dd9('0x24')][_0x8dd9('0x25')]({'where':{'id':_0x196a30[_0x8dd9('0x26')]['id']}})[_0x8dd9('0x23')](handleEntityNotFound(_0x49f688,null))['then'](removeEntity(_0x49f688,null))[_0x8dd9('0x27')](handleError(_0x49f688,null));};exports[_0x8dd9('0x1f')]=function(_0x3ff030,_0x25a9dd){return db[_0x8dd9('0x24')][_0x8dd9('0x1f')]()[_0x8dd9('0x23')](function(_0x42fac3){delete _0x42fac3[_0x8dd9('0x28')];for(var _0x559be9=0x0;_0x559be90x0){return new Promise(function(_0xa6b0db){var _0x4ee146=[];for(var _0x1a79cd=0x0;_0x1a79cd<_0x43d8d7[_0x8dd9('0x2a')];_0x1a79cd++){_0x4ee146[_0x8dd9('0x5d')](insertAdditionalPhones(_0x43d8d7[_0x1a79cd][_0x8dd9('0x60')],_0x43d8d7[_0x1a79cd][_0x8dd9('0x59')]));}Promise['all'](_0x4ee146)[_0x8dd9('0x23')](function(){_0xa6b0db(0x1);});})[_0x8dd9('0x23')](function(){return{'success':_0xd6192c,'failure':_0x188ce6,'duplicates':_0x1d308a};});}else{return{'success':_0xd6192c,'failure':_0x188ce6,'duplicates':_0x1d308a};}}})['then'](respondWithResult(_0x31fb98,0xc9))[_0x8dd9('0x27')](handleError(_0x31fb98,null));};exports[_0x8dd9('0x61')]=function(_0x58df42,_0x53f0f1){var _0x2edeaf;return db[_0x8dd9('0x24')][_0x8dd9('0x1f')]()[_0x8dd9('0x23')](function(_0x3db6ba){return db[_0x8dd9('0x24')][_0x8dd9('0x25')]({'where':{'id':_0x58df42[_0x8dd9('0x26')]['id']},'include':[{'model':db[_0x8dd9('0x62')],'as':_0x8dd9('0x63'),'attributes':['id',_0x8dd9('0x1d'),_0x8dd9('0x64')],'required':_0x58df42[_0x8dd9('0x21')][_0x8dd9('0x65')]?!![]:![]},{'model':db[_0x8dd9('0x4a')],'as':_0x8dd9('0x66'),'where':{'CmContactId':_0x58df42[_0x8dd9('0x26')]['id']},'required':![],'include':[{'model':db[_0x8dd9('0x67')],'as':_0x8dd9('0x68')}]}],'order':[db[_0x8dd9('0x69')][_0x8dd9('0x6a')](_0x8dd9('0x6b'))],'attributes':_[_0x8dd9('0x29')](_0x3db6ba)});})[_0x8dd9('0x23')](function(_0xe08ea1){if(!_[_0x8dd9('0x55')](_0xe08ea1)){_0x2edeaf=_0xe08ea1[_0x8dd9('0x3a')]({'plain':!![]});var _0x23ba38={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xe08ea1&&_0xe08ea1[_0x8dd9('0x6c')]){if(_0xe08ea1['ListId']){_0x23ba38[_0x8dd9('0x5c')][_0x8dd9('0x6d')]['push']({'ListId':{'$ne':_0xe08ea1['ListId']}});}}return db[_0x8dd9('0x30')][_0x8dd9('0x31')](_0x23ba38);}})[_0x8dd9('0x23')](function(_0x3b0be8){if(!_[_0x8dd9('0x55')](_0x3b0be8)){return _['omit'](_0x2edeaf,_[_0x8dd9('0x6e')](_0x3b0be8,function(_0x2f3457){return util[_0x8dd9('0x6f')](_0x8dd9('0x70'),_0x2f3457['id']);}));}})['then'](handleEntityNotFound(_0x53f0f1,null))['then'](respondWithResult(_0x53f0f1,null))[_0x8dd9('0x27')](handleError(_0x53f0f1,null));};exports[_0x8dd9('0x43')]=function(_0x19c817,_0x2038a3){var _0x2e29b0;if(_0x19c817[_0x8dd9('0x39')]['id']){delete _0x19c817[_0x8dd9('0x39')]['id'];}if(!_[_0x8dd9('0x55')](_0x19c817[_0x8dd9('0x39')][_0x8dd9('0x56')])){var _0x460cf9=_0x19c817[_0x8dd9('0x39')][_0x8dd9('0x56')];if(!_[_0x8dd9('0x55')](shared[_0x8dd9('0x57')][_0x460cf9]))_0x19c817[_0x8dd9('0x39')][_0x8dd9('0x58')]=shared[_0x8dd9('0x57')][_0x460cf9][_0x8dd9('0x58')];}return db[_0x8dd9('0x24')][_0x8dd9('0x25')]({'where':{'id':_0x19c817[_0x8dd9('0x26')]['id']}})[_0x8dd9('0x23')](handleEntityNotFound(_0x2038a3,null))['then'](saveUpdates(_0x19c817['body'],null))[_0x8dd9('0x23')](function(_0xee09a7){_0x2e29b0=_0xee09a7;var _0x5c7f2b={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xee09a7&&_0xee09a7['ListId']){if(_0xee09a7[_0x8dd9('0x6c')]){_0x5c7f2b[_0x8dd9('0x5c')][_0x8dd9('0x6d')][_0x8dd9('0x5d')]({'ListId':{'$ne':_0xee09a7[_0x8dd9('0x6c')]}});}}return db[_0x8dd9('0x30')][_0x8dd9('0x31')](_0x5c7f2b);})[_0x8dd9('0x23')](function(_0x29712a){if(_0x29712a){return _[_0x8dd9('0x71')](_[_0x8dd9('0x72')](_0x19c817[_0x8dd9('0x39')],function(_0x1f832f,_0x51505b){return _[_0x8dd9('0x2b')](_0x51505b,_0x8dd9('0x2c'));}),_[_0x8dd9('0x6e')](_0x29712a,function(_0x5a12b4){return util[_0x8dd9('0x6f')]('cf_%d',_0x5a12b4['id']);}));}})[_0x8dd9('0x23')](function(_0x245547){if(_0x245547&&!_[_0x8dd9('0x73')](_0x245547)){var _0x66afbe=squel[_0x8dd9('0x43')]()[_0x8dd9('0x74')](_0x8dd9('0x75'))[_0x8dd9('0x76')](_0x245547)[_0x8dd9('0x5c')]('id\x20=\x20?',_0x19c817[_0x8dd9('0x26')]['id'])[_0x8dd9('0x77')]();return db['sequelize'][_0x8dd9('0x21')](_0x66afbe[_0x8dd9('0x78')],{'replacements':_0x66afbe['values']});}})[_0x8dd9('0x23')](function(){if(_0x19c817[_0x8dd9('0x39')][_0x8dd9('0x79')]&&_0x2e29b0){return db[_0x8dd9('0x7a')][_0x8dd9('0x43')]({'phone':_0x19c817[_0x8dd9('0x39')][_0x8dd9('0x79')],'OrderBy':0x0},{'where':{'ContactId':_0x2e29b0['id']}});}})[_0x8dd9('0x23')](function(){return _0x2e29b0;})[_0x8dd9('0x23')](respondWithResult(_0x2038a3,null))[_0x8dd9('0x27')](handleError(_0x2038a3,null));};exports[_0x8dd9('0x7b')]=function(_0x1fbc51,_0x1480d4){var _0x1416e0={};var _0x29fccd={};var _0x12f70a;var _0xce5f3d;return db[_0x8dd9('0x24')]['findOne']({'where':{'id':_0x1fbc51[_0x8dd9('0x26')]['id']}})[_0x8dd9('0x23')](handleEntityNotFound(_0x1480d4,null))[_0x8dd9('0x23')](function(_0x443079){if(_0x443079){_0x12f70a=_0x443079;_0x29fccd[_0x8dd9('0x7c')]=_[_0x8dd9('0x29')](db['Tag'][_0x8dd9('0x7d')]);_0x29fccd[_0x8dd9('0x21')]=_['keys'](_0x1fbc51[_0x8dd9('0x21')]);_0x29fccd['filters']=_[_0x8dd9('0x7e')](_0x29fccd[_0x8dd9('0x7c')],_0x29fccd['query']);_0x1416e0[_0x8dd9('0x7f')]=_['intersection'](_0x29fccd[_0x8dd9('0x7c')],qs[_0x8dd9('0x80')](_0x1fbc51[_0x8dd9('0x21')][_0x8dd9('0x80')]));_0x1416e0['attributes']=_0x1416e0[_0x8dd9('0x7f')][_0x8dd9('0x2a')]?_0x1416e0[_0x8dd9('0x7f')]:_0x29fccd[_0x8dd9('0x7c')];_0x1416e0['order']=qs[_0x8dd9('0x81')](_0x1fbc51[_0x8dd9('0x21')][_0x8dd9('0x81')]);_0x1416e0[_0x8dd9('0x5c')]=qs[_0x8dd9('0x82')](_[_0x8dd9('0x83')](_0x1fbc51[_0x8dd9('0x21')],_0x29fccd[_0x8dd9('0x82')]));if(_0x1fbc51['query'][_0x8dd9('0x84')]){_0x1416e0['where']=_[_0x8dd9('0x38')](_0x1416e0['where'],{'$or':_[_0x8dd9('0x6e')](_0x1416e0['attributes'],function(_0x44173e){var _0x13563c={};_0x13563c[_0x44173e]={'$like':'%'+_0x1fbc51['query'][_0x8dd9('0x84')]+'%'};return _0x13563c;})});}_0x1416e0=_[_0x8dd9('0x38')]({},_0x1416e0,_0x1fbc51[_0x8dd9('0x85')]);return _0x12f70a['getTags'](_0x1416e0);}})['then'](function(_0x38d4b4){if(_0x38d4b4){_0xce5f3d=_0x38d4b4[_0x8dd9('0x2a')];if(!_0x1fbc51[_0x8dd9('0x21')][_0x8dd9('0x86')]('nolimit')){_0x1416e0[_0x8dd9('0x16')]=qs[_0x8dd9('0x16')](_0x1fbc51[_0x8dd9('0x21')][_0x8dd9('0x16')]);_0x1416e0[_0x8dd9('0x14')]=qs[_0x8dd9('0x14')](_0x1fbc51['query'][_0x8dd9('0x14')]);}return _0x12f70a[_0x8dd9('0x7b')](_0x1416e0);}})[_0x8dd9('0x23')](function(_0x345a80){if(_0x345a80){return _0x345a80?{'count':_0xce5f3d,'rows':_0x345a80}:null;}})[_0x8dd9('0x23')](respondWithResult(_0x1480d4,null))['catch'](handleError(_0x1480d4,null));};exports[_0x8dd9('0x87')]=function(_0x1653c1,_0x147d2e){if(_0x1653c1['body']['id']){delete _0x1653c1[_0x8dd9('0x39')]['id'];}return db[_0x8dd9('0x24')][_0x8dd9('0x88')]({'where':{'id':_0x1653c1['params']['id']}})[_0x8dd9('0x23')](handleEntityNotFound(_0x147d2e,null))['then'](function(_0x31349b){if(_0x31349b){return _0x31349b['setTags'](_0x1653c1[_0x8dd9('0x39')][_0x8dd9('0x89')]||[]);}return null;})['then'](respondWithResult(_0x147d2e,null))[_0x8dd9('0x27')](handleError(_0x147d2e,null));};exports[_0x8dd9('0x8a')]=function(_0x1c8e5b,_0x2b6820){var _0x304804=[];_0x304804[_0x8dd9('0x5d')](addAdditionalPhones(_0x1c8e5b['body']));Promise[_0x8dd9('0x8b')](_0x304804)[_0x8dd9('0x23')](function(){_0x304804=[];_0x304804['push'](deleteCmHopperPhones(_0x1c8e5b[_0x8dd9('0x39')]['id']));_0x304804[_0x8dd9('0x5d')](addCmHopperPhones(_0x1c8e5b[_0x8dd9('0x39')]['id']));Promise[_0x8dd9('0x8b')](_0x304804)['then'](function(){return[0x1];})[_0x8dd9('0x23')](respondWithResult(_0x2b6820,null));});};function addAdditionalPhones(_0x1e7dc8){var _0x4a56eb;return new Promise(function(_0x40c88a){return db[_0x8dd9('0x4a')][_0x8dd9('0x18')]({'where':{'CmContactId':_0x1e7dc8['id']}})[_0x8dd9('0x23')](function(){db['ContactItemType'][_0x8dd9('0x31')]({'raw':!![],'attributes':['id',_0x8dd9('0x8c')]})[_0x8dd9('0x23')](function(_0x29a6ed){var _0x3fb52f=[];for(var _0x49102b=0x0;_0x49102b<_0x1e7dc8[_0x8dd9('0x8d')]['length'];_0x49102b++){var _0x4dcba1=_0x1e7dc8[_0x8dd9('0x8e')]?_[_0x8dd9('0x55')](_0x1e7dc8[_0x8dd9('0x8e')][_0x49102b])?'':_0x1e7dc8[_0x8dd9('0x8e')][_0x49102b]:_0x1e7dc8['items'][_0x49102b][_0x8dd9('0x8f')]?_0x1e7dc8['items'][_0x49102b]['ItemTypeId']:'';var _0x3e1c96=_[_0x8dd9('0x55')](_0x1e7dc8['items'][_0x49102b][_0x8dd9('0x90')])?'':_0x1e7dc8[_0x8dd9('0x8d')][_0x49102b]['description'];var _0x3008bd=_0x4dcba1+':'+_0x1e7dc8[_0x8dd9('0x8d')][_0x49102b][_0x8dd9('0x79')]+'§'+_0x3e1c96;if(_[_0x8dd9('0x55')](_0x4a56eb))_0x4a56eb=_0x3008bd;else _0x4a56eb+=';'+_0x3008bd;var _0x3606e0=null;var _0x109e04=null;if(_0x1e7dc8[_0x8dd9('0x8e')]){if(!_['isNil'](_0x1e7dc8['item_types'][_0x49102b])){_0x109e04=_['find'](_0x29a6ed,function(_0x3a10e6){return _0x3a10e6['id']===_0x1e7dc8[_0x8dd9('0x8e')][_0x49102b];});if(!_[_0x8dd9('0x55')](_0x109e04)){_0x3606e0=_0x109e04[_0x8dd9('0x8c')];}}}else{if(!_[_0x8dd9('0x55')](_0x1e7dc8[_0x8dd9('0x8d')][_0x49102b])){_0x109e04=_[_0x8dd9('0x25')](_0x29a6ed,function(_0x1aa514){return _0x1aa514['id']===_0x1e7dc8[_0x8dd9('0x8d')][_0x49102b][_0x8dd9('0x8f')];});if(!_['isNil'](_0x109e04)){_0x3606e0=_0x49102b;}}}if(_['isNil'](_0x3606e0)){_0x3606e0=0x64;}_0x3fb52f[_0x8dd9('0x5d')](addAdditionalPhone(_0x1e7dc8['id'],_0x1e7dc8[_0x8dd9('0x8d')][_0x49102b]['phone'],_0x1e7dc8[_0x8dd9('0x8e')]?_[_0x8dd9('0x55')](_0x1e7dc8[_0x8dd9('0x8e')][_0x49102b])?null:_0x1e7dc8[_0x8dd9('0x8e')][_0x49102b]:_0x1e7dc8[_0x8dd9('0x8d')][_0x49102b][_0x8dd9('0x8f')]?_0x1e7dc8['items'][_0x49102b]['ItemTypeId']:null,_0x3606e0,_0x3e1c96));}Promise[_0x8dd9('0x8b')](_0x3fb52f)['then'](function(){db[_0x8dd9('0x24')][_0x8dd9('0x43')]({'AdditionalPhones':_0x4a56eb},{'where':{'id':_0x1e7dc8['id']}})[_0x8dd9('0x23')](function(){_0x40c88a(0x1);});});});});});}function addAdditionalPhone(_0x8609c9,_0x446744,_0x39604e,_0x54f367,_0xbde497){return db[_0x8dd9('0x4a')][_0x8dd9('0x25')]({'where':{'CmContactId':_0x8609c9,'item':_0x446744}})['then'](function(_0x21ed76){if(_0x21ed76)logger['info']('contact\x20phone\x20exists',_0x21ed76);else{db[_0x8dd9('0x4a')]['create']({'CmContactId':_0x8609c9,'item':_0x446744,'ItemTypeId':_0x39604e,'OrderBy':_0x54f367,'ItemClass':_0x8dd9('0x91'),'description':_0xbde497});}});}function deleteCmHopperPhones(_0x19e246){return new Promise(function(_0x23f194){return db[_0x8dd9('0x7a')][_0x8dd9('0x31')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19e246}})[_0x8dd9('0x23')](function(_0x59b8df){db['CmHopperAdditionalPhone']['destroy']({'where':{'CmHopperId':{'$in':_[_0x8dd9('0x6e')](_0x59b8df,'id')}}});})[_0x8dd9('0x23')](function(){_0x23f194(0x1);});});}function addCmHopperPhones(_0x20925c){return new Promise(function(_0x30cf27){return db['CmHopper'][_0x8dd9('0x31')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x20925c}})[_0x8dd9('0x23')](function(_0x2689e8){var _0x999251=[];_[_0x8dd9('0x6e')](_0x2689e8,function(_0x4c267c){_0x999251[_0x8dd9('0x5d')](createCmHopperPhone(_0x20925c,_0x4c267c['id']));});Promise[_0x8dd9('0x8b')](_0x999251)[_0x8dd9('0x23')](function(){_0x30cf27(0x1);});});});}function createCmHopperPhone(_0x3570bb,_0x210853){return new Promise(function(_0x27b217){db['CmContactHasItem']['findAll']({'raw':!![],'attributes':[_0x8dd9('0x92'),'OrderBy'],'where':{'CmContactId':_0x3570bb,'ItemClass':_0x8dd9('0x91')},'include':[{'model':db[_0x8dd9('0x67')],'attributes':[_0x8dd9('0x8c')],'as':_0x8dd9('0x68')}],'order':['OrderBy',db[_0x8dd9('0x69')][_0x8dd9('0x6a')]('`ItemType`.OrderBy')]})['then'](function(_0x46cfe8){var _0x205e3c=0x1;var _0x44f0b4=_[_0x8dd9('0x6e')](_0x46cfe8,function(_0x490580){_0x490580['CmHopperId']=_0x210853;_0x490580[_0x8dd9('0x79')]=_0x490580[_0x8dd9('0x92')];_0x490580[_0x8dd9('0x8c')]=_0x205e3c;delete _0x490580[_0x8dd9('0x93')];_0x205e3c=_0x205e3c+0x1;return _0x490580;});return db['CmHopperAdditionalPhone'][_0x8dd9('0x94')](_0x44f0b4,{});})[_0x8dd9('0x23')](function(){_0x27b217(0x1);});});}function insertAdditionalPhones(_0x10c2aa,_0x3040ee){return new Promise(function(_0x17c463){var _0x4ca331=[];for(var _0x1f60e4=0x0;_0x1f60e4<_0x3040ee[_0x8dd9('0x2a')];_0x1f60e4++){var _0x456eb2=_0x3040ee[_0x1f60e4];_0x4ca331[_0x8dd9('0x5d')](parseContactItemType(_0x456eb2));}Promise[_0x8dd9('0x8b')](_0x4ca331)[_0x8dd9('0x23')](function(){var _0x556fb7={'id':_0x10c2aa['id'],'items':_0x3040ee};return addAdditionalPhones(_0x556fb7)[_0x8dd9('0x23')](function(){return addCmHopperPhones(_0x10c2aa['id']);});})[_0x8dd9('0x23')](function(){_0x17c463(_0x10c2aa);});});}function parseContactItemType(_0x46562a){return new Promise(function(_0x428e4){if(_0x46562a[_0x8dd9('0x86')](_0x8dd9('0x8f'))){_0x428e4(_0x46562a);}else{return db['ContactItemType'][_0x8dd9('0x25')]({'where':{'name':_0x46562a[_0x8dd9('0x68')]}})['then'](function(_0x77c63c){if(_[_0x8dd9('0x55')](_0x77c63c))_0x46562a[_0x8dd9('0x8f')]=null;else _0x46562a[_0x8dd9('0x8f')]=_0x77c63c['id'];_0x428e4(_0x46562a);});}});}exports[_0x8dd9('0x95')]=function(_0x244594,_0x52b917){return db[_0x8dd9('0x4a')][_0x8dd9('0x31')]({'raw':!![],'where':{'CmContactId':_0x244594[_0x8dd9('0x26')]['id'],'ItemClass':_0x8dd9('0x91')},'include':[{'model':db[_0x8dd9('0x67')],'as':_0x8dd9('0x68')}],'order':[[_0x8dd9('0x8c')],[db[_0x8dd9('0x69')][_0x8dd9('0x6a')](_0x8dd9('0x96'))]]})[_0x8dd9('0x23')](function(_0x5e198e){return _0x5e198e;})[_0x8dd9('0x23')](respondWithResult(_0x52b917,null))['catch'](handleError(_0x52b917,null));};exports['duplicateAdditionalPhones']=function(_0x575cf1,_0x2c54e1){return db[_0x8dd9('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x575cf1['body']['fromContactId']}})[_0x8dd9('0x23')](function(_0x2dbdde){var _0x4f336f=_['map'](_0x2dbdde,function(_0x285628){_0x285628[_0x8dd9('0x97')]=_0x575cf1['body'][_0x8dd9('0x98')];return _0x285628;});return db[_0x8dd9('0x4a')][_0x8dd9('0x94')](_0x4f336f,{});})['then'](function(){return addCmHopperPhones(_0x575cf1[_0x8dd9('0x39')][_0x8dd9('0x98')]);})[_0x8dd9('0x23')](function(){return['ok'];})['then'](respondWithResult(_0x2c54e1,null))['catch'](handleError(_0x2c54e1,null));};exports[_0x8dd9('0x99')]=function(_0x128cbd,_0x44ad92){var _0x4b1bc9=[];_0x4b1bc9[_0x8dd9('0x5d')](createCmHopperPhone(_0x128cbd[_0x8dd9('0x39')]['id'],_0x128cbd['body'][_0x8dd9('0x9a')]));Promise['all'](_0x4b1bc9)['then'](function(){return[0x1];})[_0x8dd9('0x23')](respondWithResult(_0x44ad92,null));};exports[_0x8dd9('0x9b')]=function(_0x230f3e,_0x1eaee1){var _0x1ad8b8={'raw':![],'where':{}};var _0x3773fc={};var _0x5a77f2={'count':0x0,'rows':[]};return db[_0x8dd9('0x24')][_0x8dd9('0x88')]({'where':{'id':_0x230f3e[_0x8dd9('0x26')]['id']}})[_0x8dd9('0x23')](handleEntityNotFound(_0x1eaee1,null))[_0x8dd9('0x23')](function(_0x1d0b6e){if(_0x1d0b6e){_0x3773fc[_0x8dd9('0x7c')]=_['keys'](db['CmHopper'][_0x8dd9('0x7d')]);_0x3773fc[_0x8dd9('0x21')]=_['keys'](_0x230f3e[_0x8dd9('0x21')]);_0x3773fc[_0x8dd9('0x82')]=_[_0x8dd9('0x7e')](_0x3773fc['model'],_0x3773fc[_0x8dd9('0x21')]);_0x1ad8b8[_0x8dd9('0x7f')]=_['intersection'](_0x3773fc[_0x8dd9('0x7c')],qs[_0x8dd9('0x80')](_0x230f3e[_0x8dd9('0x21')][_0x8dd9('0x80')]));_0x1ad8b8['attributes']=_0x1ad8b8[_0x8dd9('0x7f')][_0x8dd9('0x2a')]?_0x1ad8b8[_0x8dd9('0x7f')]:_0x3773fc[_0x8dd9('0x7c')];if(!_0x230f3e[_0x8dd9('0x21')][_0x8dd9('0x86')](_0x8dd9('0x9c'))){_0x1ad8b8[_0x8dd9('0x16')]=qs[_0x8dd9('0x16')](_0x230f3e['query'][_0x8dd9('0x16')]);_0x1ad8b8['offset']=qs[_0x8dd9('0x14')](_0x230f3e[_0x8dd9('0x21')][_0x8dd9('0x14')]);}_0x1ad8b8[_0x8dd9('0x9d')]=qs[_0x8dd9('0x81')](_0x230f3e['query'][_0x8dd9('0x81')]);_0x1ad8b8[_0x8dd9('0x5c')]=qs['filters'](_[_0x8dd9('0x83')](_0x230f3e['query'],_0x3773fc[_0x8dd9('0x82')]));_0x1ad8b8[_0x8dd9('0x5c')][_0x8dd9('0x9e')]=_0x1d0b6e['id'];if(_0x230f3e[_0x8dd9('0x21')][_0x8dd9('0x84')]){_0x1ad8b8[_0x8dd9('0x5c')]=_[_0x8dd9('0x38')](_0x1ad8b8[_0x8dd9('0x5c')],{'$or':_[_0x8dd9('0x6e')](_0x1ad8b8['attributes'],function(_0x1777e8){var _0x55ea15={};_0x55ea15[_0x1777e8]={'$like':'%'+_0x230f3e[_0x8dd9('0x21')][_0x8dd9('0x84')]+'%'};return _0x55ea15;})});}_0x1ad8b8=_[_0x8dd9('0x38')]({},_0x1ad8b8,_0x230f3e[_0x8dd9('0x85')]);return db['CmHopper'][_0x8dd9('0x17')]({'where':_0x1ad8b8[_0x8dd9('0x5c')]})[_0x8dd9('0x23')](function(_0x32d47e){_0x5a77f2['count']=_0x32d47e;if(_0x230f3e['query'][_0x8dd9('0x9f')]){_0x1ad8b8['include']=[{'all':!![]}];}return db[_0x8dd9('0x7a')][_0x8dd9('0x31')](_0x1ad8b8);})[_0x8dd9('0x23')](function(_0x1d66c2){_0x5a77f2[_0x8dd9('0xa0')]=_0x1d66c2;return _0x5a77f2;});}})[_0x8dd9('0x23')](respondWithFilteredResult(_0x1eaee1,_0x1ad8b8))[_0x8dd9('0x27')](handleError(_0x1eaee1,null));};exports[_0x8dd9('0xa1')]=function(_0x45b887,_0x129cc0){var _0x188f2e={'raw':!![],'where':{}};var _0xd98a56={};var _0x35542a={'count':0x0,'rows':[]};return db[_0x8dd9('0x24')][_0x8dd9('0x88')]({'where':{'id':_0x45b887['params']['id']}})[_0x8dd9('0x23')](handleEntityNotFound(_0x129cc0,null))[_0x8dd9('0x23')](function(_0x255c6d){if(_0x255c6d){_0xd98a56['model']=_[_0x8dd9('0x29')](db['CmHopperHistory'][_0x8dd9('0x7d')]);_0xd98a56[_0x8dd9('0x21')]=_[_0x8dd9('0x29')](_0x45b887['query']);_0xd98a56[_0x8dd9('0x82')]=_[_0x8dd9('0x7e')](_0xd98a56[_0x8dd9('0x7c')],_0xd98a56[_0x8dd9('0x21')]);_0x188f2e[_0x8dd9('0x7f')]=_[_0x8dd9('0x7e')](_0xd98a56[_0x8dd9('0x7c')],qs['fields'](_0x45b887[_0x8dd9('0x21')][_0x8dd9('0x80')]));_0x188f2e[_0x8dd9('0x7f')]=_0x188f2e['attributes'][_0x8dd9('0x2a')]?_0x188f2e['attributes']:_0xd98a56[_0x8dd9('0x7c')];if(!_0x45b887[_0x8dd9('0x21')][_0x8dd9('0x86')](_0x8dd9('0x9c'))){_0x188f2e[_0x8dd9('0x16')]=qs[_0x8dd9('0x16')](_0x45b887[_0x8dd9('0x21')][_0x8dd9('0x16')]);_0x188f2e[_0x8dd9('0x14')]=qs[_0x8dd9('0x14')](_0x45b887[_0x8dd9('0x21')][_0x8dd9('0x14')]);}_0x188f2e['order']=qs[_0x8dd9('0x81')](_0x45b887[_0x8dd9('0x21')]['sort']);_0x188f2e[_0x8dd9('0x5c')]=qs[_0x8dd9('0x82')](_['pick'](_0x45b887['query'],_0xd98a56['filters']));_0x188f2e[_0x8dd9('0x5c')][_0x8dd9('0x9e')]=_0x255c6d['id'];if(_0x45b887[_0x8dd9('0x21')]['filter']){_0x188f2e[_0x8dd9('0x5c')]=_[_0x8dd9('0x38')](_0x188f2e[_0x8dd9('0x5c')],{'$or':_[_0x8dd9('0x6e')](_0x188f2e[_0x8dd9('0x7f')],function(_0x342d77){var _0x43ce80={};_0x43ce80[_0x342d77]={'$like':'%'+_0x45b887[_0x8dd9('0x21')][_0x8dd9('0x84')]+'%'};return _0x43ce80;})});}_0x188f2e=_[_0x8dd9('0x38')]({},_0x188f2e,_0x45b887[_0x8dd9('0x85')]);return db[_0x8dd9('0xa2')][_0x8dd9('0x17')]({'where':_0x188f2e[_0x8dd9('0x5c')]})[_0x8dd9('0x23')](function(_0xbce542){_0x35542a['count']=_0xbce542;if(_0x45b887['query']['includeAll']){_0x188f2e[_0x8dd9('0xa3')]=[{'all':!![]}];}return db[_0x8dd9('0xa2')][_0x8dd9('0x31')](_0x188f2e);})[_0x8dd9('0x23')](function(_0x5f5c75){_0x35542a['rows']=_0x5f5c75;return _0x35542a;});}})[_0x8dd9('0x23')](respondWithFilteredResult(_0x129cc0,_0x188f2e))[_0x8dd9('0x27')](handleError(_0x129cc0,null));};exports[_0x8dd9('0xa4')]=function(_0x3d1935,_0x279228){var _0x2281fd={'raw':!![],'where':{}};var _0x276680={};var _0x14988d={'count':0x0,'rows':[]};return db['CmContact'][_0x8dd9('0x88')]({'where':{'id':_0x3d1935[_0x8dd9('0x26')]['id']}})[_0x8dd9('0x23')](handleEntityNotFound(_0x279228,null))[_0x8dd9('0x23')](function(_0x25f69e){if(_0x25f69e){_0x276680[_0x8dd9('0x7c')]=_[_0x8dd9('0x29')](db[_0x8dd9('0x4b')][_0x8dd9('0x7d')]);_0x276680[_0x8dd9('0x21')]=_[_0x8dd9('0x29')](_0x3d1935[_0x8dd9('0x21')]);_0x276680['filters']=_['intersection'](_0x276680[_0x8dd9('0x7c')],_0x276680[_0x8dd9('0x21')]);_0x2281fd[_0x8dd9('0x7f')]=_[_0x8dd9('0x7e')](_0x276680[_0x8dd9('0x7c')],qs[_0x8dd9('0x80')](_0x3d1935[_0x8dd9('0x21')][_0x8dd9('0x80')]));_0x2281fd[_0x8dd9('0x7f')]=_0x2281fd[_0x8dd9('0x7f')]['length']?_0x2281fd[_0x8dd9('0x7f')]:_0x276680[_0x8dd9('0x7c')];if(!_0x3d1935[_0x8dd9('0x21')]['hasOwnProperty'](_0x8dd9('0x9c'))){_0x2281fd[_0x8dd9('0x16')]=qs[_0x8dd9('0x16')](_0x3d1935[_0x8dd9('0x21')][_0x8dd9('0x16')]);_0x2281fd[_0x8dd9('0x14')]=qs[_0x8dd9('0x14')](_0x3d1935[_0x8dd9('0x21')][_0x8dd9('0x14')]);}_0x2281fd[_0x8dd9('0x9d')]=qs[_0x8dd9('0x81')](_0x3d1935[_0x8dd9('0x21')]['sort']);_0x2281fd[_0x8dd9('0x5c')]=qs['filters'](_[_0x8dd9('0x83')](_0x3d1935[_0x8dd9('0x21')],_0x276680[_0x8dd9('0x82')]));_0x2281fd[_0x8dd9('0x5c')]['ContactId']=_0x25f69e['id'];if(_0x3d1935[_0x8dd9('0x21')][_0x8dd9('0x84')]){_0x2281fd['where']=_[_0x8dd9('0x38')](_0x2281fd['where'],{'$or':_[_0x8dd9('0x6e')](_0x2281fd[_0x8dd9('0x7f')],function(_0x517b6b){var _0x297820={};_0x297820[_0x517b6b]={'$like':'%'+_0x3d1935[_0x8dd9('0x21')][_0x8dd9('0x84')]+'%'};return _0x297820;})});}_0x2281fd=_[_0x8dd9('0x38')]({},_0x2281fd,_0x3d1935['options']);return db[_0x8dd9('0x4b')][_0x8dd9('0x17')]({'where':_0x2281fd[_0x8dd9('0x5c')]})['then'](function(_0x40e945){_0x14988d[_0x8dd9('0x17')]=_0x40e945;if(_0x3d1935[_0x8dd9('0x21')][_0x8dd9('0x9f')]){_0x2281fd[_0x8dd9('0xa3')]=[{'all':!![]}];}return db[_0x8dd9('0x4b')]['findAll'](_0x2281fd);})['then'](function(_0x4b3d7e){_0x14988d[_0x8dd9('0xa0')]=_0x4b3d7e;return _0x14988d;});}})['then'](respondWithFilteredResult(_0x279228,_0x2281fd))['catch'](handleError(_0x279228,null));};exports[_0x8dd9('0xa5')]=function(_0x1ae130,_0x7b6ec7){var _0x2af857={'raw':!![],'where':{}};var _0x3735a7={};var _0x4753ea={'count':0x0,'rows':[]};return db['CmContact'][_0x8dd9('0x88')]({'where':{'id':_0x1ae130[_0x8dd9('0x26')]['id']}})['then'](handleEntityNotFound(_0x7b6ec7,null))[_0x8dd9('0x23')](function(_0xfb02f8){if(_0xfb02f8){_0x3735a7[_0x8dd9('0x7c')]=_[_0x8dd9('0x29')](db[_0x8dd9('0x51')]['rawAttributes']);_0x3735a7['query']=_['keys'](_0x1ae130['query']);_0x3735a7[_0x8dd9('0x82')]=_['intersection'](_0x3735a7['model'],_0x3735a7['query']);_0x2af857['attributes']=_[_0x8dd9('0x7e')](_0x3735a7[_0x8dd9('0x7c')],qs[_0x8dd9('0x80')](_0x1ae130[_0x8dd9('0x21')]['fields']));_0x2af857[_0x8dd9('0x7f')]=_0x2af857[_0x8dd9('0x7f')][_0x8dd9('0x2a')]?_0x2af857[_0x8dd9('0x7f')]:_0x3735a7[_0x8dd9('0x7c')];if(!_0x1ae130[_0x8dd9('0x21')][_0x8dd9('0x86')](_0x8dd9('0x9c'))){_0x2af857['limit']=qs['limit'](_0x1ae130[_0x8dd9('0x21')]['limit']);_0x2af857['offset']=qs[_0x8dd9('0x14')](_0x1ae130['query'][_0x8dd9('0x14')]);}_0x2af857['order']=qs['sort'](_0x1ae130['query'][_0x8dd9('0x81')]);_0x2af857[_0x8dd9('0x5c')]=qs[_0x8dd9('0x82')](_[_0x8dd9('0x83')](_0x1ae130['query'],_0x3735a7[_0x8dd9('0x82')]));_0x2af857[_0x8dd9('0x5c')][_0x8dd9('0x9e')]=_0xfb02f8['id'];if(_0x1ae130[_0x8dd9('0x21')][_0x8dd9('0x84')]){_0x2af857[_0x8dd9('0x5c')]=_['merge'](_0x2af857['where'],{'$or':_[_0x8dd9('0x6e')](_0x2af857[_0x8dd9('0x7f')],function(_0x33f08e){var _0x14c21e={};_0x14c21e[_0x33f08e]={'$like':'%'+_0x1ae130[_0x8dd9('0x21')][_0x8dd9('0x84')]+'%'};return _0x14c21e;})});}_0x2af857=_[_0x8dd9('0x38')]({},_0x2af857,_0x1ae130[_0x8dd9('0x85')]);return db[_0x8dd9('0x51')][_0x8dd9('0x17')]({'where':_0x2af857[_0x8dd9('0x5c')]})['then'](function(_0x1d3123){_0x4753ea['count']=_0x1d3123;if(_0x1ae130['query'][_0x8dd9('0x9f')]){_0x2af857[_0x8dd9('0xa3')]=[{'all':!![]}];}return db[_0x8dd9('0x51')][_0x8dd9('0x31')](_0x2af857);})['then'](function(_0x19a050){_0x4753ea['rows']=_0x19a050;return _0x4753ea;});}})[_0x8dd9('0x23')](respondWithFilteredResult(_0x7b6ec7,_0x2af857))[_0x8dd9('0x27')](handleError(_0x7b6ec7,null));};exports['uploadCsv']=function(_0x115175,_0x2f1d15){try{if(!_0x115175['body'][_0x8dd9('0x6c')]){throw new Error(_0x8dd9('0xa6'));}if(!_0x115175[_0x8dd9('0x39')][_0x8dd9('0xa7')]){throw new Error(_0x8dd9('0xa8'));}if(!_0x115175[_0x8dd9('0x39')][_0x8dd9('0xa9')]){throw new Error('No\x20association\x20values\x20specified!');}if(!_0x115175[_0x8dd9('0x39')]['socket_timestamp']){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x25cced=_0x115175['body']['binding_keys']['split'](',');var _0x11c29e=_0x115175[_0x8dd9('0x39')][_0x8dd9('0xa9')][_0x8dd9('0xaa')](',');if(!_0x25cced['length']||!_0x11c29e[_0x8dd9('0x2a')]||_0x25cced['length']!==_0x11c29e[_0x8dd9('0x2a')]){throw new Error(_0x8dd9('0xab'));}_0x115175[_0x8dd9('0x39')]['fields']=_['zipObject'](_0x25cced,_0x11c29e);if(!_0x115175[_0x8dd9('0x39')][_0x8dd9('0x80')][_0x8dd9('0x79')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x115175['body']['fields'][_0x8dd9('0xac')]){throw new Error(_0x8dd9('0xad'));}var _0x26e27b=path[_0x8dd9('0x3c')](config['root'],'server/files/tmp',_0x115175[_0x8dd9('0xae')][_0x8dd9('0xaf')]);fs[_0x8dd9('0xb0')](_0x26e27b,parseInt('0777',0x8));var _0x341886=require(_0x8dd9('0xb1'))[_0x8dd9('0xb2')](path[_0x8dd9('0x3c')](__dirname,_0x8dd9('0xb3')),[_0x26e27b,_0x115175['body']['binding_keys'],_0x115175[_0x8dd9('0x39')][_0x8dd9('0xa9')],_0x115175[_0x8dd9('0x39')][_0x8dd9('0x6c')],_0x115175[_0x8dd9('0x39')]['CompanyId'],_0x115175[_0x8dd9('0x39')][_0x8dd9('0x5b')],_0x115175[_0x8dd9('0x39')][_0x8dd9('0xb4')]]);return _0x2f1d15['status'](0xc8)[_0x8dd9('0x13')]({'message':_0x8dd9('0xb5'),'pid':_0x341886[_0x8dd9('0xb6')]});}catch(_0x26d37b){return _0x2f1d15[_0x8dd9('0x12')](0x1f4)[_0x8dd9('0xb7')](_0x26d37b);}};exports[_0x8dd9('0xb8')]=function(_0x127d7c,_0x52b002){var _0x59a1fe=fs['createReadStream'](_0x127d7c[_0x8dd9('0xae')]['path']);Papa[_0x8dd9('0xb9')](_0x59a1fe,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x300467){return _0x52b002[_0x8dd9('0x12')](0xc8)['json']({'file':_0x127d7c[_0x8dd9('0xae')],'fields':_0x300467[_0x8dd9('0xba')][_0x8dd9('0x80')]});}});};exports['import']=function(_0x44a1fe,_0x2037ef){return db[_0x8dd9('0xbb')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x8dd9('0xbc')}})[_0x8dd9('0x23')](function(_0x5f54b8){var _0x156bd9=![];if(!_0x44a1fe[_0x8dd9('0x39')][_0x8dd9('0x6c')]){throw new Error(_0x8dd9('0xa6'));}if(!_0x44a1fe[_0x8dd9('0x39')]['binding'][_0x8dd9('0x79')]){throw new Error(_0x8dd9('0xbd'));}if(!_0x44a1fe['body'][_0x8dd9('0xbe')]['firstName']){throw new Error(_0x8dd9('0xad'));}if(!_0x44a1fe[_0x8dd9('0x39')]['socket_timestamp']){throw new Error(_0x8dd9('0xbf'));}var _0x13732a=require(_0x8dd9('0xb1'))[_0x8dd9('0xb2')](path[_0x8dd9('0x3c')](__dirname,_0x8dd9('0xc0')),[_0x44a1fe['params']['id'],JSON[_0x8dd9('0xc1')](_0x44a1fe['body']),JSON[_0x8dd9('0xc1')](_0x5f54b8)]);_0x13732a['on']('message',function(){_0x156bd9=!![];return _0x2037ef[_0x8dd9('0x12')](0xc8)[_0x8dd9('0x13')]({'message':_0x8dd9('0xc2'),'pid':_0x13732a[_0x8dd9('0xb6')]});});_0x13732a['on'](_0x8dd9('0xc3'),function(_0x2e8d29){if(_0x2e8d29&&!_0x156bd9){return _0x2037ef[_0x8dd9('0x12')](0x1f4)[_0x8dd9('0x13')]({'message':_0x8dd9('0xc4'),'pid':_0x13732a[_0x8dd9('0xb6')]});}});})[_0x8dd9('0x27')](handleError(_0x2037ef,null));};exports[_0x8dd9('0xc5')]=function(_0x99ac51,_0x3d57bf){return db[_0x8dd9('0xbb')][_0x8dd9('0x31')]({'raw':!![],'attributes':['id'],'where':{'role':_0x8dd9('0xbc')}})['then'](function(_0x2a779f){var _0x4f383a=![];if(!_0x99ac51[_0x8dd9('0x39')][_0x8dd9('0x6c')]){throw new Error('No\x20ListId\x20specified');}if(!_0x99ac51[_0x8dd9('0x39')]['binding']['phone']){throw new Error(_0x8dd9('0xbd'));}if(!_0x99ac51[_0x8dd9('0x39')]['binding']['firstName']){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x99ac51[_0x8dd9('0x39')]['socket_timestamp']){throw new Error(_0x8dd9('0xbf'));}var _0x59a35d=require(_0x8dd9('0xb1'))[_0x8dd9('0xb2')](path[_0x8dd9('0x3c')](__dirname,_0x8dd9('0xc6')),[_0x99ac51[_0x8dd9('0x26')]['id'],JSON[_0x8dd9('0xc1')](_0x99ac51['body']),JSON[_0x8dd9('0xc1')](_0x2a779f)]);_0x59a35d['on'](_0x8dd9('0xc7'),function(){_0x4f383a=!![];return _0x3d57bf[_0x8dd9('0x12')](0xc8)[_0x8dd9('0x13')]({'message':_0x8dd9('0xc2'),'pid':_0x59a35d[_0x8dd9('0xb6')]});});_0x59a35d['on'](_0x8dd9('0xc3'),function(_0x4e34c6){if(_0x4e34c6&&!_0x4f383a){return _0x3d57bf['status'](0x1f4)['json']({'message':_0x8dd9('0xc4'),'pid':_0x59a35d['pid']});}});})[_0x8dd9('0x27')](handleError(_0x3d57bf,null));};exports[_0x8dd9('0xc8')]=function(_0x4892d5,_0x251866){var _0x26d8ae=[_0x8dd9('0xc9'),_0x8dd9('0xca'),_0x8dd9('0xcb'),_0x8dd9('0xcc'),_0x8dd9('0xcd'),_0x8dd9('0xce'),_0x8dd9('0xcf')];var _0x1b86b8={'offset':0x0,'order':qs['sort'](_0x8dd9('0xd0'))},_0x1289df={'count':0x0,'rows':[]};Promise[_0x8dd9('0xd1')]()[_0x8dd9('0x23')](function(){if(_0x4892d5[_0x8dd9('0x21')]['channel']){if(!_[_0x8dd9('0xd2')](_0x26d8ae,_0x4892d5[_0x8dd9('0x21')][_0x8dd9('0xd3')][_0x8dd9('0xd4')]())){throw new Error('Invalid\x20channel');}_0x26d8ae=[_0x4892d5[_0x8dd9('0x21')]['channel'][_0x8dd9('0xd4')]()];}if(_0x4892d5[_0x8dd9('0x21')]['range']){try{var _0x18b757=JSON[_0x8dd9('0xb9')](_0x4892d5['query'][_0x8dd9('0xd5')]);if(!moment(_0x18b757['from'])[_0x8dd9('0xd6')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x18b757['to'])[_0x8dd9('0xd6')]()){throw new Error(_0x8dd9('0xd7'));}}catch(_0x27557a){throw new Error(_0x8dd9('0xd8'));}}if(!_0x4892d5[_0x8dd9('0x21')]['hasOwnProperty']('nolimit')){_0x1b86b8[_0x8dd9('0x16')]=qs['limit'](_0x4892d5[_0x8dd9('0x21')][_0x8dd9('0x16')]||0xa);_0x1b86b8[_0x8dd9('0x14')]=qs['offset'](_0x4892d5[_0x8dd9('0x21')][_0x8dd9('0x14')]);}var _0x401b75=_0x26d8ae[_0x8dd9('0x6e')](function(_0x156d47){if(_0x156d47==='voice'){var _0x35d952={'attributes':['id',_0x8dd9('0xd9'),_0x8dd9('0x33'),_0x8dd9('0xda'),_0x8dd9('0xdb'),_0x8dd9('0xdc'),_0x8dd9('0xdd'),_0x8dd9('0xde'),_0x8dd9('0xdf'),_0x8dd9('0xe0'),_0x8dd9('0xe1'),_0x8dd9('0xe2'),_0x8dd9('0xe3'),_0x8dd9('0xe4'),'UserId'],'where':{'ContactId':_0x4892d5[_0x8dd9('0x26')]['id']},'include':[{'model':db[_0x8dd9('0xbb')],'as':_0x8dd9('0xbb'),'attributes':['id',_0x8dd9('0x1d'),_0x8dd9('0xe5'),'alias']}],'order':[[_0x8dd9('0xe1'),_0x8dd9('0xe6')]]};if(_0x4892d5['query'][_0x8dd9('0xd5')]){_0x35d952[_0x8dd9('0x5c')][_0x8dd9('0xe1')]={'$gte':_0x18b757[_0x8dd9('0x3e')],'$lte':_0x18b757['to']};}return db['VoiceCallReport'][_0x8dd9('0xe7')](_0x35d952)[_0x8dd9('0x23')](function(_0x1a7e94){_0x1289df[_0x8dd9('0x17')]+=_0x1a7e94[_0x8dd9('0x17')];return _[_0x8dd9('0x6e')](_0x1a7e94[_0x8dd9('0xa0')],function(_0x29d7ba){var _0x288f5c=_0x29d7ba[_0x8dd9('0x3a')]({'plain':!![]});_0x288f5c[_0x8dd9('0xd3')]=_0x156d47;if(_0x288f5c[_0x8dd9('0xbb')]){_0x288f5c[_0x8dd9('0xbb')]={'id':_0x288f5c[_0x8dd9('0xbb')]['id'],'name':_0x288f5c['User'][_0x8dd9('0x1d')],'fullname':_0x288f5c['User'][_0x8dd9('0xe5')],'alias':_0x288f5c['User']['alias']};}return _0x288f5c;});});}else{var _0x367e1a=_[_0x8dd9('0xe8')](_0x156d47)+(_0x156d47==='chat'?_0x8dd9('0xe9'):_0x8dd9('0xea'));var _0x552339={'attributes':['id','closed',_0x8dd9('0xeb'),_0x8dd9('0xe1'),_0x8dd9('0xe0'),_0x8dd9('0xec'),_0x8dd9('0xed'),'thirdDisposition',_0x8dd9('0xee'),_0x367e1a+'Id'],'where':{'ContactId':_0x4892d5[_0x8dd9('0x26')]['id']},'include':[{'model':db[_0x367e1a],'as':_0x8dd9('0xea'),'attributes':['id',_0x8dd9('0x1d'),_0x8dd9('0xef')]},{'model':db[_0x8dd9('0xbb')],'as':_0x8dd9('0xf0'),'attributes':['id','name',_0x8dd9('0xe5')]},{'model':db[_0x8dd9('0x62')],'as':_0x8dd9('0x63'),'attributes':['id',_0x8dd9('0x1d'),_0x8dd9('0x64')],'through':{'attributes':[]}}],'order':[['createdAt',_0x8dd9('0xe6')]]};if(_0x4892d5[_0x8dd9('0x21')][_0x8dd9('0xd5')]){_0x552339[_0x8dd9('0x5c')][_0x8dd9('0xe1')]={'$gte':_0x18b757['from'],'$lte':_0x18b757['to']};}switch(_0x156d47){case _0x8dd9('0xca'):_0x552339[_0x8dd9('0x7f')][_0x8dd9('0x5d')](_0x8dd9('0xf1'),_0x8dd9('0xf2'),'customerPort',_0x8dd9('0xf3'),_0x8dd9('0xf4'),_0x8dd9('0xf5'),_0x8dd9('0xf6'),_0x8dd9('0xf7'),_0x8dd9('0xf8'));break;case _0x8dd9('0xc9'):_0x552339['attributes'][_0x8dd9('0x5d')](_0x8dd9('0xf9'),_0x8dd9('0xfa'));break;case _0x8dd9('0xcc'):_0x552339[_0x8dd9('0x7f')]['push']('externalUrl',_0x8dd9('0xfb'));break;}return db[_['startCase'](_0x156d47)+_0x8dd9('0xfc')][_0x8dd9('0xe7')](_0x552339)[_0x8dd9('0x23')](function(_0x5ba8ea){_0x1289df[_0x8dd9('0x17')]+=_0x5ba8ea[_0x8dd9('0x17')];return _[_0x8dd9('0x6e')](_0x5ba8ea['rows'],function(_0x38a3cb){var _0x2f2c08=_0x38a3cb['get']({'plain':!![]});_0x2f2c08[_0x8dd9('0xd3')]=_0x156d47;if(_0x2f2c08[_0x8dd9('0xf0')]){_0x2f2c08[_0x8dd9('0xf0')]={'id':_0x2f2c08[_0x8dd9('0xf0')]['id'],'name':_0x2f2c08['Owner'][_0x8dd9('0x1d')],'fullname':_0x2f2c08[_0x8dd9('0xf0')][_0x8dd9('0xe5')]};}return _0x2f2c08;});});}});return Promise[_0x8dd9('0x8b')](_0x401b75);})['then'](function(_0x403d33){return _(_0x403d33)[_0x8dd9('0xfd')]()['sortBy']('createdAt')[_0x8dd9('0xfe')]()[_0x8dd9('0xff')]();})[_0x8dd9('0x23')](function(_0x5060a5){_0x1289df[_0x8dd9('0xa0')]=_0x1b86b8[_0x8dd9('0x16')]?_0x5060a5[_0x8dd9('0x100')](_0x1b86b8[_0x8dd9('0x14')],_0x1b86b8[_0x8dd9('0x14')]+_0x1b86b8['limit']):_0x5060a5;return _0x1289df;})[_0x8dd9('0x23')](respondWithFilteredResult(_0x251866,_0x1b86b8))[_0x8dd9('0x27')](handleError(_0x251866,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index 7819bb6..4f642aa 100644 --- a/server/api/cmContact/cmContact.events.js +++ b/server/api/cmContact/cmContact.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd490=['exports','setMaxListeners','save','update','remove','emit','hook'];(function(_0x581a5a,_0xe1d35e){var _0x450fcb=function(_0x1abc96){while(--_0x1abc96){_0x581a5a['push'](_0x581a5a['shift']());}};_0x450fcb(++_0xe1d35e);}(_0xd490,0xe8));var _0x0d49=function(_0x2f2097,_0x164ad0){_0x2f2097=_0x2f2097-0x0;var _0x41c3fe=_0xd490[_0x2f2097];return _0x41c3fe;};'use strict';var EventEmitter=require('events');var CmContact=require('../../mysqldb')['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents[_0x0d49('0x0')](0x0);var events={'afterCreate':_0x0d49('0x1'),'afterUpdate':_0x0d49('0x2'),'afterDestroy':_0x0d49('0x3')};function emitEvent(_0x5e917d){return function(_0x1828ed,_0x35482c,_0x121aea){CmContactEvents['emit'](_0x5e917d+':'+_0x1828ed['id'],_0x1828ed);CmContactEvents[_0x0d49('0x4')](_0x5e917d,_0x1828ed);_0x121aea(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact[_0x0d49('0x5')](e,emitEvent(event));}}module[_0x0d49('0x6')]=CmContactEvents; \ No newline at end of file +var _0x8757=['update','emit','hasOwnProperty','exports','events','../../mysqldb','CmContact','setMaxListeners','save'];(function(_0x1d2650,_0x3a9d00){var _0x5a4b9f=function(_0x1a87aa){while(--_0x1a87aa){_0x1d2650['push'](_0x1d2650['shift']());}};_0x5a4b9f(++_0x3a9d00);}(_0x8757,0x79));var _0x7875=function(_0x544ca2,_0x18bda5){_0x544ca2=_0x544ca2-0x0;var _0x15fac2=_0x8757[_0x544ca2];return _0x15fac2;};'use strict';var EventEmitter=require(_0x7875('0x0'));var CmContact=require(_0x7875('0x1'))['db'][_0x7875('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x7875('0x3')](0x0);var events={'afterCreate':_0x7875('0x4'),'afterUpdate':_0x7875('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4ef115){return function(_0x1709aa,_0xe9ebd5,_0x23f927){CmContactEvents['emit'](_0x4ef115+':'+_0x1709aa['id'],_0x1709aa);CmContactEvents[_0x7875('0x6')](_0x4ef115,_0x1709aa);_0x23f927(null);};}for(var e in events){if(events[_0x7875('0x7')](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module[_0x7875('0x8')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index 5a5b120..2950aca 100644 --- a/server/api/cmContact/cmContact.model.js +++ b/server/api/cmContact/cmContact.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a61=['always','onlyIfOpen','findAll','outbound','BlackLists','CmHopperBlack','message','Campaign','cmContact,\x20%s,\x20%s','List\x20not\x20found','isEmpty','destroy','ContactId','VoiceQueueId','CampaignId','push','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','../../config/environment/shared','./cmContact.attributes','exports','cm_contacts','phone','fti_cm_contacts','firstName','lastName','mobile','fax','email','FULLTEXT','utf8mb4','models','get','error','cmContact','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','findOne','then','utcOffset','minutes','CmHopper','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','priority','callbackUniqueid','catch','ret','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','ListId','dialTimezone','add','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','VoiceQueue','dialCheckDuplicateType','CmList','Lists','length'];(function(_0xa8aae2,_0x117624){var _0x54b2b5=function(_0x51fcb8){while(--_0x51fcb8){_0xa8aae2['push'](_0xa8aae2['shift']());}};_0x54b2b5(++_0x117624);}(_0x7a61,0xae));var _0x17a6=function(_0x3e8f14,_0x3b6352){_0x3e8f14=_0x3e8f14-0x0;var _0x3e1d9b=_0x7a61[_0x3e8f14];return _0x3e1d9b;};'use strict';var _=require(_0x17a6('0x0'));var util=require(_0x17a6('0x1'));var logger=require('../../config/logger')(_0x17a6('0x2'));var moment=require(_0x17a6('0x3'));var BPromise=require(_0x17a6('0x4'));var rp=require(_0x17a6('0x5'));var fs=require('fs');var path=require(_0x17a6('0x6'));var rimraf=require('rimraf');var config=require(_0x17a6('0x7'));var shared=require(_0x17a6('0x8'));var attributes=require(_0x17a6('0x9'));module[_0x17a6('0xa')]=function(_0x1b0605,_0x87ef7d){return _0x1b0605['define']('CmContact',attributes,{'tableName':_0x17a6('0xb'),'paranoid':!![],'indexes':[{'name':'phone','fields':[_0x17a6('0xc')]},{'name':_0x17a6('0xd'),'fields':[_0x17a6('0xe'),_0x17a6('0xf'),_0x17a6('0xc'),_0x17a6('0x10'),_0x17a6('0x11'),_0x17a6('0x12')],'type':_0x17a6('0x13')}],'timestamps':!![],'charset':_0x17a6('0x14'),'collate':'utf8mb4_unicode_ci','hooks':{'afterCreate':function(_0x3cf096,_0x1d4003,_0x39b9fe){var _0x1d423d=_0x1b0605[_0x17a6('0x15')];var _0xcea26b=_0x3cf096[_0x17a6('0x16')]({'plain':!![]});function _0x2d8ca3(){return function(_0x45d40a){logger[_0x17a6('0x17')](_0x17a6('0x18'),_0x17a6('0x19'),util[_0x17a6('0x1a')](_0x45d40a,{'showHidden':![],'depth':null}));};}function _0x87c3a5(_0x1d8fd0,_0x41f664){var _0x50d357=_0x41f664[_0x17a6('0x1b')]?_0x41f664[_0x17a6('0x1b')]:moment()[_0x17a6('0x1c')](_0x17a6('0x1d'));return new BPromise(function(_0x55a0af,_0x54bf27){if(_[_0x17a6('0x1e')](_0x41f664['dialTimezone'])){_0x55a0af({'ret':_0x50d357});}else{_0x1d423d['VoiceQueue'][_0x17a6('0x1f')]({'where':{'id':_0x1d8fd0['id']}})[_0x17a6('0x20')](function(_0xb3a43b){if(!_[_0x17a6('0x1e')](_0xb3a43b)){var _0x216968=_0xb3a43b['dialTimezone'];if(!_['isNil'](_0x216968)){var _0x550b58=shared['timezones'];var _0x380aff=_0x550b58[_0x216968];var _0x470943=_0x550b58[_0x41f664['dialTimezone']];if(!_[_0x17a6('0x1e')](_0x380aff)&&!_[_0x17a6('0x1e')](_0x470943)){var _0x443568=_0x380aff[_0x17a6('0x21')]-_0x470943['utcOffset'];_0x50d357=_0x41f664[_0x17a6('0x1b')]?_0x41f664[_0x17a6('0x1b')]:moment();var _0x509197=moment(_0x50d357)['add'](_0x443568,_0x17a6('0x22'));_0x55a0af({'ret':_0x509197[_0x17a6('0x1c')](_0x17a6('0x1d'))});}else _0x55a0af({'ret':_0x50d357});}else _0x55a0af({'ret':_0x50d357});}else{_0x55a0af({'ret':_0x50d357});}});}});return 0xa;}var _0x4bcac7=function(_0xf38847){return new BPromise(function(_0x329b55,_0x2ecb11){_0x87c3a5(_0xf38847,_0xcea26b)[_0x17a6('0x20')](function(_0x3aa65a){_0xcea26b[_0x17a6('0x1b')]=_0x3aa65a['ret'];_0x1d423d[_0x17a6('0x23')]['findOne']({'where':{'phone':_0xcea26b[_0x17a6('0xc')],'VoiceQueueId':_0xf38847['id']}})[_0x17a6('0x20')](function(_0x4a5798){if(!_['isNil'](_0x4a5798)){throw new Error(_0x17a6('0x24')+_0xcea26b[_0x17a6('0xc')]+_0x17a6('0x25')+_0xf38847['id']);}return _0x1d423d[_0x17a6('0x23')][_0x17a6('0x26')]({'phone':_0xcea26b[_0x17a6('0xc')],'ContactId':_0xcea26b['id'],'ListId':_0xcea26b['ListId'],'priority':_0xcea26b['priority']?_0xcea26b[_0x17a6('0x27')]:0x2,'scheduledat':_0xcea26b[_0x17a6('0x1b')]?_0xcea26b[_0x17a6('0x1b')]:moment()[_0x17a6('0x1c')](_0x17a6('0x1d')),'callback':_0xcea26b[_0x17a6('0x28')]?!![]:![],'callbackuniqueid':_0xcea26b['callbackUniqueid']?_0xcea26b[_0x17a6('0x28')]:undefined,'callbackat':_0xcea26b[_0x17a6('0x28')]?moment()[_0x17a6('0x1c')](_0x17a6('0x1d')):undefined,'VoiceQueueId':_0xf38847['id']});})[_0x17a6('0x29')](function(_0x417c88){_0x2ecb11(_0x417c88);});});});};var _0x447153=function(_0x5c00f9){return new BPromise(function(_0x13d22b,_0x41c28f){_0x87c3a5(_0x5c00f9,_0xcea26b)[_0x17a6('0x20')](function(_0xa1b52b){_0xcea26b['scheduledat']=_0xa1b52b[_0x17a6('0x2a')];_0x1d423d[_0x17a6('0x23')][_0x17a6('0x1f')]({'where':{'phone':_0xcea26b['phone'],'VoiceQueueId':_0x5c00f9['id']}})[_0x17a6('0x20')](function(_0x1ce62f){if(!_[_0x17a6('0x1e')](_0x1ce62f)){throw new Error(_0x17a6('0x24')+_0xcea26b[_0x17a6('0xc')]+_0x17a6('0x2b')+_0x5c00f9['id']);}return _0x1d423d[_0x17a6('0x2c')][_0x17a6('0x1f')]({'where':{'calleridnum':_0xcea26b['phone'],'VoiceQueueId':_0x5c00f9['id']}});})['then'](function(_0x5595e9){if(!_['isNil'](_0x5595e9)){throw new Error(_0x17a6('0x2d')+_0xcea26b[_0x17a6('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x5c00f9['id']);}return _0x1d423d[_0x17a6('0x23')][_0x17a6('0x26')]({'phone':_0xcea26b[_0x17a6('0xc')],'ContactId':_0xcea26b['id'],'ListId':_0xcea26b[_0x17a6('0x2e')],'priority':_0xcea26b[_0x17a6('0x27')]?_0xcea26b[_0x17a6('0x27')]:0x2,'scheduledat':_0xcea26b[_0x17a6('0x1b')]?_0xcea26b[_0x17a6('0x1b')]:moment()[_0x17a6('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0xcea26b[_0x17a6('0x28')]?!![]:![],'callbackuniqueid':_0xcea26b[_0x17a6('0x28')]?_0xcea26b[_0x17a6('0x28')]:undefined,'callbackat':_0xcea26b[_0x17a6('0x28')]?moment()['format'](_0x17a6('0x1d')):undefined,'VoiceQueueId':_0x5c00f9['id']});})[_0x17a6('0x29')](function(_0x4dab59){_0x41c28f(_0x4dab59);});});});};function _0x4e5ced(){return function(_0x2b2e2b){logger[_0x17a6('0x17')]('cmContact',_0x17a6('0x19'),util['inspect'](_0x2b2e2b,{'showHidden':![],'depth':null}));};}function _0x4ec41d(_0x51cefb,_0x43e321){var _0x27c6f5=_0x43e321[_0x17a6('0x1b')]?_0x43e321[_0x17a6('0x1b')]:moment()['format'](_0x17a6('0x1d'));return new BPromise(function(_0x46754a,_0x2bcc18){if(_[_0x17a6('0x1e')](_0x43e321[_0x17a6('0x2f')])){_0x46754a({'ret':_0x27c6f5});}else{_0x1d423d['Campaign'][_0x17a6('0x1f')]({'where':{'id':_0x51cefb['id']}})['then'](function(_0x35b21e){if(!_[_0x17a6('0x1e')](_0x35b21e)){var _0x808af6=_0x35b21e[_0x17a6('0x2f')];if(!_[_0x17a6('0x1e')](_0x808af6)){var _0x2e2ecb=shared['timezones'];var _0x416d3d=_0x2e2ecb[_0x808af6];var _0x299562=_0x2e2ecb[_0x43e321[_0x17a6('0x2f')]];if(!_['isNil'](_0x416d3d)&&!_[_0x17a6('0x1e')](_0x299562)){var _0xfbc3d8=_0x416d3d[_0x17a6('0x21')]-_0x299562[_0x17a6('0x21')];_0x27c6f5=_0x43e321[_0x17a6('0x1b')]?_0x43e321[_0x17a6('0x1b')]:moment();var _0x34c5a4=moment(_0x27c6f5)[_0x17a6('0x30')](_0xfbc3d8,_0x17a6('0x22'));_0x46754a({'ret':_0x34c5a4[_0x17a6('0x1c')](_0x17a6('0x1d'))});}else _0x46754a({'ret':_0x27c6f5});}else _0x46754a({'ret':_0x27c6f5});}else{_0x46754a({'ret':_0x27c6f5});}});}});return 0xa;}var _0x58de85=function(_0x3c0295){return new BPromise(function(_0x3b342d,_0x320611){_0x4ec41d(_0x3c0295,_0xcea26b)[_0x17a6('0x20')](function(_0x49dd40){_0xcea26b['scheduledat']=_0x49dd40['ret'];_0x1d423d[_0x17a6('0x23')][_0x17a6('0x1f')]({'where':{'phone':_0xcea26b[_0x17a6('0xc')],'CampaignId':_0x3c0295['id']}})['then'](function(_0x3bb8c2){if(!_['isNil'](_0x3bb8c2)){throw new Error(_0x17a6('0x24')+_0xcea26b[_0x17a6('0xc')]+_0x17a6('0x31')+_0x3c0295['id']);}return _0x1d423d[_0x17a6('0x23')]['create']({'phone':_0xcea26b[_0x17a6('0xc')],'ContactId':_0xcea26b['id'],'ListId':_0xcea26b['ListId'],'priority':_0xcea26b[_0x17a6('0x27')]?_0xcea26b[_0x17a6('0x27')]:0x2,'scheduledat':_0xcea26b[_0x17a6('0x1b')]?_0xcea26b['scheduledat']:moment()[_0x17a6('0x1c')](_0x17a6('0x1d')),'callback':_0xcea26b[_0x17a6('0x28')]?!![]:![],'callbackuniqueid':_0xcea26b[_0x17a6('0x28')]?_0xcea26b[_0x17a6('0x28')]:undefined,'callbackat':_0xcea26b[_0x17a6('0x28')]?moment()[_0x17a6('0x1c')](_0x17a6('0x1d')):undefined,'CampaignId':_0x3c0295['id']});})[_0x17a6('0x29')](function(_0x16232e){_0x320611(_0x16232e);});});});};var _0x2a3dda=function(_0x315512){return new BPromise(function(_0x48c7e4,_0x4b123e){_0x4ec41d(_0x315512,_0xcea26b)[_0x17a6('0x20')](function(_0x2251cb){_0xcea26b[_0x17a6('0x1b')]=_0x2251cb[_0x17a6('0x2a')];_0x1d423d[_0x17a6('0x23')][_0x17a6('0x1f')]({'where':{'phone':_0xcea26b[_0x17a6('0xc')],'CampaignId':_0x315512['id']}})['then'](function(_0x11eec2){if(!_[_0x17a6('0x1e')](_0x11eec2)){throw new Error('cmContact,\x20afterCreate\x20'+_0xcea26b[_0x17a6('0xc')]+_0x17a6('0x32')+_0x315512['id']);}return _0x1d423d[_0x17a6('0x2c')]['findOne']({'where':{'calleridnum':_0xcea26b[_0x17a6('0xc')],'CampaignId':_0x315512['id']}});})[_0x17a6('0x20')](function(_0x2013fb){if(!_[_0x17a6('0x1e')](_0x2013fb)){throw new Error('cmContact,\x20afterCreate,\x20'+_0xcea26b['phone']+_0x17a6('0x33')+_0x315512['id']);}return _0x1d423d[_0x17a6('0x23')][_0x17a6('0x26')]({'phone':_0xcea26b[_0x17a6('0xc')],'ContactId':_0xcea26b['id'],'ListId':_0xcea26b[_0x17a6('0x2e')],'priority':_0xcea26b[_0x17a6('0x27')]?_0xcea26b['priority']:0x2,'scheduledat':_0xcea26b[_0x17a6('0x1b')]?_0xcea26b[_0x17a6('0x1b')]:moment()['format'](_0x17a6('0x1d')),'callback':_0xcea26b[_0x17a6('0x28')]?!![]:![],'callbackuniqueid':_0xcea26b['callbackUniqueid']?_0xcea26b[_0x17a6('0x28')]:undefined,'callbackat':_0xcea26b[_0x17a6('0x28')]?moment()[_0x17a6('0x1c')](_0x17a6('0x1d')):undefined,'CampaignId':_0x315512['id']});})['catch'](function(_0xce2c97){_0x4b123e(_0xce2c97);});});});};if(_0xcea26b[_0x17a6('0x2e')]){_0x1d423d[_0x17a6('0x34')]['findAll']({'where':{'type':'outbound'},'attributes':['id',_0x17a6('0x35'),_0x17a6('0x2f')],'include':[{'model':_0x1d423d[_0x17a6('0x36')],'as':_0x17a6('0x37'),'where':{'id':_0xcea26b[_0x17a6('0x2e')]}}]})[_0x17a6('0x20')](function(_0x40e493){if(_0x40e493){var _0x445541=[];for(var _0x2e0ad4=0x0,_0xb871f5;_0x2e0ad4<_0x40e493[_0x17a6('0x38')];_0x2e0ad4+=0x1){_0xb871f5=_0x40e493[_0x2e0ad4]['get']({'plain':!![]});switch(_0xb871f5[_0x17a6('0x35')]){case _0x17a6('0x39'):_0x447153(_0xb871f5)[_0x17a6('0x29')](_0x2d8ca3());break;case _0x17a6('0x3a'):_0x4bcac7(_0xb871f5)['catch'](_0x2d8ca3());break;default:_0x4ec41d(_0xb871f5,_0xcea26b)['then'](function(_0x51e0ba){_0xcea26b[_0x17a6('0x1b')]=_0x51e0ba['ret'];_0x1d423d[_0x17a6('0x23')]['create']({'phone':_0xcea26b[_0x17a6('0xc')],'ContactId':_0xcea26b['id'],'ListId':_0xcea26b[_0x17a6('0x2e')],'scheduledat':_0xcea26b['scheduledat']?_0xcea26b[_0x17a6('0x1b')]:moment()[_0x17a6('0x1c')](_0x17a6('0x1d')),'priority':_0xcea26b[_0x17a6('0x27')]?_0xcea26b[_0x17a6('0x27')]:0x2,'callback':_0xcea26b[_0x17a6('0x28')]?!![]:![],'callbackuniqueid':_0xcea26b[_0x17a6('0x28')]?_0xcea26b[_0x17a6('0x28')]:undefined,'callbackat':_0xcea26b[_0x17a6('0x28')]?moment()[_0x17a6('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0xb871f5['id']})[_0x17a6('0x29')](_0x2d8ca3());});}}}})[_0x17a6('0x20')](function(){return _0x1d423d['VoiceQueue'][_0x17a6('0x3b')]({'where':{'type':_0x17a6('0x3c')},'attributes':['id'],'include':[{'model':_0x1d423d[_0x17a6('0x36')],'as':_0x17a6('0x3d'),'where':{'id':_0xcea26b[_0x17a6('0x2e')]}}]})[_0x17a6('0x20')](function(_0x5735ec){if(_0x5735ec){var _0x3e7942=[];for(var _0x5033b9=0x0,_0x17a7aa;_0x5033b9<_0x5735ec['length'];_0x5033b9+=0x1){_0x17a7aa=_0x5735ec[_0x5033b9][_0x17a6('0x16')]({'plain':!![]});_0x1d423d[_0x17a6('0x3e')][_0x17a6('0x26')]({'phone':_0xcea26b[_0x17a6('0xc')],'ContactId':_0xcea26b['id'],'ListId':_0xcea26b['ListId'],'VoiceQueueId':_0x17a7aa['id']})[_0x17a6('0x29')](function(_0x4a5098){logger['error']('cmContact,\x20%s,\x20%s',_0x17a6('0x19'),_0x4a5098[_0x17a6('0x3f')]);});}}});})['then'](function(){return _0x1d423d[_0x17a6('0x40')][_0x17a6('0x3b')]({'attributes':['id',_0x17a6('0x35'),_0x17a6('0x2f')],'include':[{'model':_0x1d423d[_0x17a6('0x36')],'as':_0x17a6('0x37'),'where':{'id':_0xcea26b[_0x17a6('0x2e')]}}]})[_0x17a6('0x20')](function(_0x47cd85){if(_0x47cd85){var _0x4a6f88=[];for(var _0x5baa8b=0x0,_0x26e979;_0x5baa8b<_0x47cd85['length'];_0x5baa8b+=0x1){_0x26e979=_0x47cd85[_0x5baa8b][_0x17a6('0x16')]({'plain':!![]});switch(_0x26e979[_0x17a6('0x35')]){case _0x17a6('0x39'):_0x2a3dda(_0x26e979)[_0x17a6('0x29')](_0x4e5ced());break;case'onlyIfOpen':_0x58de85(_0x26e979)[_0x17a6('0x29')](_0x4e5ced());break;default:_0x1d423d[_0x17a6('0x23')][_0x17a6('0x26')]({'phone':_0xcea26b[_0x17a6('0xc')],'ContactId':_0xcea26b['id'],'ListId':_0xcea26b[_0x17a6('0x2e')],'scheduledat':_0xcea26b[_0x17a6('0x1b')]?_0xcea26b[_0x17a6('0x1b')]:moment()[_0x17a6('0x1c')](_0x17a6('0x1d')),'priority':_0xcea26b[_0x17a6('0x27')]?_0xcea26b[_0x17a6('0x27')]:0x2,'callback':_0xcea26b['callbackUniqueid']?!![]:![],'callbackuniqueid':_0xcea26b[_0x17a6('0x28')]?_0xcea26b[_0x17a6('0x28')]:undefined,'callbackat':_0xcea26b[_0x17a6('0x28')]?moment()[_0x17a6('0x1c')](_0x17a6('0x1d')):undefined,'CampaignId':_0x26e979['id']})[_0x17a6('0x29')](_0x4e5ced());}}}});})[_0x17a6('0x20')](function(){return _0x1d423d[_0x17a6('0x40')][_0x17a6('0x3b')]({'attributes':['id'],'include':[{'model':_0x1d423d['CmList'],'as':_0x17a6('0x3d'),'where':{'id':_0xcea26b['ListId']}}]})[_0x17a6('0x20')](function(_0x5d5d36){if(_0x5d5d36){var _0x44e126=[];for(var _0x427b50=0x0,_0x4c6993;_0x427b50<_0x5d5d36[_0x17a6('0x38')];_0x427b50+=0x1){_0x4c6993=_0x5d5d36[_0x427b50][_0x17a6('0x16')]({'plain':!![]});_0x1d423d[_0x17a6('0x3e')][_0x17a6('0x26')]({'phone':_0xcea26b[_0x17a6('0xc')],'ContactId':_0xcea26b['id'],'ListId':_0xcea26b['ListId'],'CampaignId':_0x4c6993['id']})[_0x17a6('0x29')](function(_0x30db59){logger['error']('cmContact,\x20%s,\x20%s',_0x17a6('0x19'),_0x30db59['message']);});}}});})[_0x17a6('0x20')](function(){_0x39b9fe();})[_0x17a6('0x29')](function(_0x3edcae){logger[_0x17a6('0x17')](_0x17a6('0x41'),_0x17a6('0x19'),_0x3edcae['message']);_0x39b9fe(_0x3edcae);});}else{_0x39b9fe(new Error(_0x17a6('0x42')));}},'afterDestroy':function(_0x40350c,_0x54a600,_0xb7f60b){var _0x42c8b3=_0x1b0605[_0x17a6('0x15')];var _0x5642fb=_0x40350c[_0x17a6('0x16')]({'plain':!![]});return _0x42c8b3['CmHopper'][_0x17a6('0x3b')]({'raw':!![],'where':{'ListId':_0x5642fb[_0x17a6('0x2e')],'ContactId':_0x5642fb['id']}})[_0x17a6('0x20')](function(_0x2b15ea){if(!_[_0x17a6('0x43')](_0x2b15ea)){var _0x321843=[];for(var _0x1e0ac1=0x0;_0x1e0ac1<_0x2b15ea[_0x17a6('0x38')];_0x1e0ac1+=0x1){var _0x31ebb5=_0x42c8b3[_0x17a6('0x23')][_0x17a6('0x44')]({'where':{'ListId':_0x2b15ea[_0x1e0ac1][_0x17a6('0x2e')],'ContactId':_0x2b15ea[_0x1e0ac1][_0x17a6('0x45')],'VoiceQueueId':_0x2b15ea[_0x1e0ac1][_0x17a6('0x46')],'CampaignId':_0x2b15ea[_0x1e0ac1][_0x17a6('0x47')]}});_0x321843[_0x17a6('0x48')](_0x31ebb5);}return BPromise[_0x17a6('0x49')](_0x321843);}})[_0x17a6('0x20')](function(_0x841b47){logger[_0x17a6('0x4a')](_0x17a6('0x4b'),util['inspect'](_0x841b47,{'showHidden':![],'depth':null}));_0xb7f60b();})[_0x17a6('0x29')](function(_0xd9bbf7){logger['error'](_0x17a6('0x4c'),util[_0x17a6('0x1a')](_0xd9bbf7,{'showHidden':![],'depth':null}));_0xb7f60b(_0xd9bbf7);});}}});}; \ No newline at end of file +var _0x4be8=['request-promise','path','rimraf','../../config/environment','./cmContact.attributes','exports','define','CmContact','phone','fti_cm_contacts','firstName','lastName','mobile','fax','utf8mb4_unicode_ci','models','error','afterCreate','inspect','scheduledat','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','findOne','timezones','utcOffset','add','minutes','format','then','ret','CmHopper','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','callbackUniqueid','catch','CmHopperFinal','cmContact,\x20afterCreate,\x20','cmContact','Campaign','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','dialCheckDuplicateType','Lists','length','get','always','onlyIfOpen','outbound','CmList','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','message','List\x20not\x20found','isEmpty','info','lodash','util','../../config/logger','api','moment'];(function(_0x455607,_0x41665f){var _0x25631a=function(_0x177e17){while(--_0x177e17){_0x455607['push'](_0x455607['shift']());}};_0x25631a(++_0x41665f);}(_0x4be8,0x14a));var _0x84be=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0x4be8[_0xa8883];return _0x479426;};'use strict';var _=require(_0x84be('0x0'));var util=require(_0x84be('0x1'));var logger=require(_0x84be('0x2'))(_0x84be('0x3'));var moment=require(_0x84be('0x4'));var BPromise=require('bluebird');var rp=require(_0x84be('0x5'));var fs=require('fs');var path=require(_0x84be('0x6'));var rimraf=require(_0x84be('0x7'));var config=require(_0x84be('0x8'));var shared=require('../../config/environment/shared');var attributes=require(_0x84be('0x9'));module[_0x84be('0xa')]=function(_0x4ce5de,_0x4020eb){return _0x4ce5de[_0x84be('0xb')](_0x84be('0xc'),attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':'phone','fields':[_0x84be('0xd')]},{'name':_0x84be('0xe'),'fields':[_0x84be('0xf'),_0x84be('0x10'),'phone',_0x84be('0x11'),_0x84be('0x12'),'email'],'type':'FULLTEXT'}],'timestamps':!![],'charset':'utf8mb4','collate':_0x84be('0x13'),'hooks':{'afterCreate':function(_0xf1058c,_0x4a5685,_0x18548c){var _0x47b632=_0x4ce5de[_0x84be('0x14')];var _0x5b769e=_0xf1058c['get']({'plain':!![]});function _0x302570(){return function(_0x1de5be){logger[_0x84be('0x15')]('cmContact',_0x84be('0x16'),util[_0x84be('0x17')](_0x1de5be,{'showHidden':![],'depth':null}));};}function _0x2131c4(_0x35e0d0,_0xd3d5ad){var _0x33c83b=_0xd3d5ad[_0x84be('0x18')]?_0xd3d5ad[_0x84be('0x18')]:moment()['format'](_0x84be('0x19'));return new BPromise(function(_0x2ebf0c,_0x20b55a){if(_[_0x84be('0x1a')](_0xd3d5ad[_0x84be('0x1b')])){_0x2ebf0c({'ret':_0x33c83b});}else{_0x47b632['VoiceQueue'][_0x84be('0x1c')]({'where':{'id':_0x35e0d0['id']}})['then'](function(_0x5675c0){if(!_[_0x84be('0x1a')](_0x5675c0)){var _0x1baae7=_0x5675c0[_0x84be('0x1b')];if(!_[_0x84be('0x1a')](_0x1baae7)){var _0x299737=shared[_0x84be('0x1d')];var _0x260c30=_0x299737[_0x1baae7];var _0x4735a7=_0x299737[_0xd3d5ad[_0x84be('0x1b')]];if(!_['isNil'](_0x260c30)&&!_[_0x84be('0x1a')](_0x4735a7)){var _0x174fbd=_0x260c30['utcOffset']-_0x4735a7[_0x84be('0x1e')];_0x33c83b=_0xd3d5ad['scheduledat']?_0xd3d5ad[_0x84be('0x18')]:moment();var _0x47506e=moment(_0x33c83b)[_0x84be('0x1f')](_0x174fbd,_0x84be('0x20'));_0x2ebf0c({'ret':_0x47506e[_0x84be('0x21')](_0x84be('0x19'))});}else _0x2ebf0c({'ret':_0x33c83b});}else _0x2ebf0c({'ret':_0x33c83b});}else{_0x2ebf0c({'ret':_0x33c83b});}});}});return 0xa;}var _0x180b96=function(_0x2622d5){return new BPromise(function(_0x29bb06,_0xfab21e){_0x2131c4(_0x2622d5,_0x5b769e)[_0x84be('0x22')](function(_0xc29dc8){_0x5b769e[_0x84be('0x18')]=_0xc29dc8[_0x84be('0x23')];_0x47b632[_0x84be('0x24')][_0x84be('0x1c')]({'where':{'phone':_0x5b769e[_0x84be('0xd')],'VoiceQueueId':_0x2622d5['id']}})[_0x84be('0x22')](function(_0xc34edc){if(!_[_0x84be('0x1a')](_0xc34edc)){throw new Error(_0x84be('0x25')+_0x5b769e[_0x84be('0xd')]+_0x84be('0x26')+_0x2622d5['id']);}return _0x47b632[_0x84be('0x24')][_0x84be('0x27')]({'phone':_0x5b769e[_0x84be('0xd')],'ContactId':_0x5b769e['id'],'ListId':_0x5b769e[_0x84be('0x28')],'priority':_0x5b769e[_0x84be('0x29')]?_0x5b769e[_0x84be('0x29')]:0x2,'scheduledat':_0x5b769e[_0x84be('0x18')]?_0x5b769e[_0x84be('0x18')]:moment()['format'](_0x84be('0x19')),'callback':_0x5b769e[_0x84be('0x2a')]?!![]:![],'callbackuniqueid':_0x5b769e[_0x84be('0x2a')]?_0x5b769e[_0x84be('0x2a')]:undefined,'callbackat':_0x5b769e['callbackUniqueid']?moment()[_0x84be('0x21')](_0x84be('0x19')):undefined,'VoiceQueueId':_0x2622d5['id']});})[_0x84be('0x2b')](function(_0xf913bb){_0xfab21e(_0xf913bb);});});});};var _0x2c0068=function(_0x262380){return new BPromise(function(_0x41eb18,_0x1d711d){_0x2131c4(_0x262380,_0x5b769e)[_0x84be('0x22')](function(_0x5698a7){_0x5b769e[_0x84be('0x18')]=_0x5698a7[_0x84be('0x23')];_0x47b632[_0x84be('0x24')][_0x84be('0x1c')]({'where':{'phone':_0x5b769e['phone'],'VoiceQueueId':_0x262380['id']}})[_0x84be('0x22')](function(_0x41cfe5){if(!_['isNil'](_0x41cfe5)){throw new Error(_0x84be('0x25')+_0x5b769e[_0x84be('0xd')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x262380['id']);}return _0x47b632[_0x84be('0x2c')][_0x84be('0x1c')]({'where':{'calleridnum':_0x5b769e[_0x84be('0xd')],'VoiceQueueId':_0x262380['id']}});})['then'](function(_0x491945){if(!_[_0x84be('0x1a')](_0x491945)){throw new Error(_0x84be('0x2d')+_0x5b769e['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x262380['id']);}return _0x47b632['CmHopper']['create']({'phone':_0x5b769e[_0x84be('0xd')],'ContactId':_0x5b769e['id'],'ListId':_0x5b769e[_0x84be('0x28')],'priority':_0x5b769e['priority']?_0x5b769e[_0x84be('0x29')]:0x2,'scheduledat':_0x5b769e[_0x84be('0x18')]?_0x5b769e[_0x84be('0x18')]:moment()[_0x84be('0x21')](_0x84be('0x19')),'callback':_0x5b769e[_0x84be('0x2a')]?!![]:![],'callbackuniqueid':_0x5b769e[_0x84be('0x2a')]?_0x5b769e['callbackUniqueid']:undefined,'callbackat':_0x5b769e[_0x84be('0x2a')]?moment()[_0x84be('0x21')](_0x84be('0x19')):undefined,'VoiceQueueId':_0x262380['id']});})[_0x84be('0x2b')](function(_0x508b82){_0x1d711d(_0x508b82);});});});};function _0x2b97b3(){return function(_0x3b9c4b){logger[_0x84be('0x15')](_0x84be('0x2e'),'afterCreate',util[_0x84be('0x17')](_0x3b9c4b,{'showHidden':![],'depth':null}));};}function _0x4dec7b(_0x3f31b2,_0x449f4b){var _0x154c8c=_0x449f4b[_0x84be('0x18')]?_0x449f4b[_0x84be('0x18')]:moment()[_0x84be('0x21')]('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x2139d6,_0xfc9215){if(_[_0x84be('0x1a')](_0x449f4b[_0x84be('0x1b')])){_0x2139d6({'ret':_0x154c8c});}else{_0x47b632[_0x84be('0x2f')]['findOne']({'where':{'id':_0x3f31b2['id']}})[_0x84be('0x22')](function(_0x1b5a5f){if(!_['isNil'](_0x1b5a5f)){var _0x426bd1=_0x1b5a5f[_0x84be('0x1b')];if(!_[_0x84be('0x1a')](_0x426bd1)){var _0x2b9c20=shared['timezones'];var _0x4c77ae=_0x2b9c20[_0x426bd1];var _0x16d192=_0x2b9c20[_0x449f4b[_0x84be('0x1b')]];if(!_['isNil'](_0x4c77ae)&&!_[_0x84be('0x1a')](_0x16d192)){var _0x2b3ac9=_0x4c77ae['utcOffset']-_0x16d192[_0x84be('0x1e')];_0x154c8c=_0x449f4b['scheduledat']?_0x449f4b[_0x84be('0x18')]:moment();var _0x236c68=moment(_0x154c8c)[_0x84be('0x1f')](_0x2b3ac9,_0x84be('0x20'));_0x2139d6({'ret':_0x236c68[_0x84be('0x21')](_0x84be('0x19'))});}else _0x2139d6({'ret':_0x154c8c});}else _0x2139d6({'ret':_0x154c8c});}else{_0x2139d6({'ret':_0x154c8c});}});}});return 0xa;}var _0x4426a5=function(_0x1e6849){return new BPromise(function(_0x3d2597,_0x15b062){_0x4dec7b(_0x1e6849,_0x5b769e)['then'](function(_0x1b406c){_0x5b769e[_0x84be('0x18')]=_0x1b406c[_0x84be('0x23')];_0x47b632[_0x84be('0x24')][_0x84be('0x1c')]({'where':{'phone':_0x5b769e[_0x84be('0xd')],'CampaignId':_0x1e6849['id']}})[_0x84be('0x22')](function(_0x302b5c){if(!_[_0x84be('0x1a')](_0x302b5c)){throw new Error('cmContact,\x20afterCreate\x20'+_0x5b769e[_0x84be('0xd')]+_0x84be('0x30')+_0x1e6849['id']);}return _0x47b632[_0x84be('0x24')][_0x84be('0x27')]({'phone':_0x5b769e[_0x84be('0xd')],'ContactId':_0x5b769e['id'],'ListId':_0x5b769e[_0x84be('0x28')],'priority':_0x5b769e[_0x84be('0x29')]?_0x5b769e['priority']:0x2,'scheduledat':_0x5b769e[_0x84be('0x18')]?_0x5b769e[_0x84be('0x18')]:moment()[_0x84be('0x21')](_0x84be('0x19')),'callback':_0x5b769e[_0x84be('0x2a')]?!![]:![],'callbackuniqueid':_0x5b769e['callbackUniqueid']?_0x5b769e[_0x84be('0x2a')]:undefined,'callbackat':_0x5b769e[_0x84be('0x2a')]?moment()[_0x84be('0x21')](_0x84be('0x19')):undefined,'CampaignId':_0x1e6849['id']});})['catch'](function(_0x41b135){_0x15b062(_0x41b135);});});});};var _0x2b6881=function(_0x481eeb){return new BPromise(function(_0x49cc44,_0x5ebd0b){_0x4dec7b(_0x481eeb,_0x5b769e)['then'](function(_0x4d8013){_0x5b769e[_0x84be('0x18')]=_0x4d8013[_0x84be('0x23')];_0x47b632['CmHopper']['findOne']({'where':{'phone':_0x5b769e[_0x84be('0xd')],'CampaignId':_0x481eeb['id']}})[_0x84be('0x22')](function(_0x112537){if(!_[_0x84be('0x1a')](_0x112537)){throw new Error(_0x84be('0x25')+_0x5b769e[_0x84be('0xd')]+_0x84be('0x31')+_0x481eeb['id']);}return _0x47b632[_0x84be('0x2c')][_0x84be('0x1c')]({'where':{'calleridnum':_0x5b769e[_0x84be('0xd')],'CampaignId':_0x481eeb['id']}});})['then'](function(_0x4f87a6){if(!_['isNil'](_0x4f87a6)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x5b769e[_0x84be('0xd')]+_0x84be('0x32')+_0x481eeb['id']);}return _0x47b632[_0x84be('0x24')]['create']({'phone':_0x5b769e[_0x84be('0xd')],'ContactId':_0x5b769e['id'],'ListId':_0x5b769e[_0x84be('0x28')],'priority':_0x5b769e[_0x84be('0x29')]?_0x5b769e['priority']:0x2,'scheduledat':_0x5b769e[_0x84be('0x18')]?_0x5b769e[_0x84be('0x18')]:moment()['format'](_0x84be('0x19')),'callback':_0x5b769e[_0x84be('0x2a')]?!![]:![],'callbackuniqueid':_0x5b769e['callbackUniqueid']?_0x5b769e[_0x84be('0x2a')]:undefined,'callbackat':_0x5b769e[_0x84be('0x2a')]?moment()[_0x84be('0x21')](_0x84be('0x19')):undefined,'CampaignId':_0x481eeb['id']});})[_0x84be('0x2b')](function(_0x2e1261){_0x5ebd0b(_0x2e1261);});});});};if(_0x5b769e[_0x84be('0x28')]){_0x47b632['VoiceQueue'][_0x84be('0x33')]({'where':{'type':'outbound'},'attributes':['id',_0x84be('0x34'),'dialTimezone'],'include':[{'model':_0x47b632['CmList'],'as':_0x84be('0x35'),'where':{'id':_0x5b769e['ListId']}}]})['then'](function(_0x1e758c){if(_0x1e758c){var _0x215863=[];for(var _0x7ed041=0x0,_0x46b219;_0x7ed041<_0x1e758c[_0x84be('0x36')];_0x7ed041+=0x1){_0x46b219=_0x1e758c[_0x7ed041][_0x84be('0x37')]({'plain':!![]});switch(_0x46b219[_0x84be('0x34')]){case _0x84be('0x38'):_0x2c0068(_0x46b219)[_0x84be('0x2b')](_0x302570());break;case _0x84be('0x39'):_0x180b96(_0x46b219)[_0x84be('0x2b')](_0x302570());break;default:_0x4dec7b(_0x46b219,_0x5b769e)[_0x84be('0x22')](function(_0xbc1e99){_0x5b769e['scheduledat']=_0xbc1e99[_0x84be('0x23')];_0x47b632[_0x84be('0x24')]['create']({'phone':_0x5b769e['phone'],'ContactId':_0x5b769e['id'],'ListId':_0x5b769e[_0x84be('0x28')],'scheduledat':_0x5b769e['scheduledat']?_0x5b769e[_0x84be('0x18')]:moment()[_0x84be('0x21')](_0x84be('0x19')),'priority':_0x5b769e[_0x84be('0x29')]?_0x5b769e[_0x84be('0x29')]:0x2,'callback':_0x5b769e[_0x84be('0x2a')]?!![]:![],'callbackuniqueid':_0x5b769e[_0x84be('0x2a')]?_0x5b769e['callbackUniqueid']:undefined,'callbackat':_0x5b769e[_0x84be('0x2a')]?moment()[_0x84be('0x21')](_0x84be('0x19')):undefined,'VoiceQueueId':_0x46b219['id']})['catch'](_0x302570());});}}}})[_0x84be('0x22')](function(){return _0x47b632['VoiceQueue'][_0x84be('0x33')]({'where':{'type':_0x84be('0x3a')},'attributes':['id'],'include':[{'model':_0x47b632[_0x84be('0x3b')],'as':_0x84be('0x3c'),'where':{'id':_0x5b769e['ListId']}}]})[_0x84be('0x22')](function(_0x1fedbd){if(_0x1fedbd){var _0x1694e0=[];for(var _0x118b7d=0x0,_0x50694a;_0x118b7d<_0x1fedbd[_0x84be('0x36')];_0x118b7d+=0x1){_0x50694a=_0x1fedbd[_0x118b7d][_0x84be('0x37')]({'plain':!![]});_0x47b632[_0x84be('0x3d')][_0x84be('0x27')]({'phone':_0x5b769e['phone'],'ContactId':_0x5b769e['id'],'ListId':_0x5b769e['ListId'],'VoiceQueueId':_0x50694a['id']})['catch'](function(_0x32d83b){logger[_0x84be('0x15')](_0x84be('0x3e'),'afterCreate',_0x32d83b[_0x84be('0x3f')]);});}}});})[_0x84be('0x22')](function(){return _0x47b632[_0x84be('0x2f')]['findAll']({'attributes':['id','dialCheckDuplicateType',_0x84be('0x1b')],'include':[{'model':_0x47b632['CmList'],'as':_0x84be('0x35'),'where':{'id':_0x5b769e[_0x84be('0x28')]}}]})[_0x84be('0x22')](function(_0x14610f){if(_0x14610f){var _0xeb1d84=[];for(var _0x37598b=0x0,_0x36cf73;_0x37598b<_0x14610f[_0x84be('0x36')];_0x37598b+=0x1){_0x36cf73=_0x14610f[_0x37598b]['get']({'plain':!![]});switch(_0x36cf73['dialCheckDuplicateType']){case _0x84be('0x38'):_0x2b6881(_0x36cf73)[_0x84be('0x2b')](_0x2b97b3());break;case _0x84be('0x39'):_0x4426a5(_0x36cf73)[_0x84be('0x2b')](_0x2b97b3());break;default:_0x47b632[_0x84be('0x24')][_0x84be('0x27')]({'phone':_0x5b769e[_0x84be('0xd')],'ContactId':_0x5b769e['id'],'ListId':_0x5b769e[_0x84be('0x28')],'scheduledat':_0x5b769e[_0x84be('0x18')]?_0x5b769e[_0x84be('0x18')]:moment()[_0x84be('0x21')](_0x84be('0x19')),'priority':_0x5b769e[_0x84be('0x29')]?_0x5b769e['priority']:0x2,'callback':_0x5b769e['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x5b769e[_0x84be('0x2a')]?_0x5b769e[_0x84be('0x2a')]:undefined,'callbackat':_0x5b769e[_0x84be('0x2a')]?moment()[_0x84be('0x21')](_0x84be('0x19')):undefined,'CampaignId':_0x36cf73['id']})[_0x84be('0x2b')](_0x2b97b3());}}}});})[_0x84be('0x22')](function(){return _0x47b632['Campaign'][_0x84be('0x33')]({'attributes':['id'],'include':[{'model':_0x47b632[_0x84be('0x3b')],'as':'BlackLists','where':{'id':_0x5b769e['ListId']}}]})[_0x84be('0x22')](function(_0x28acaf){if(_0x28acaf){var _0x39c326=[];for(var _0x1abb79=0x0,_0x207f42;_0x1abb79<_0x28acaf[_0x84be('0x36')];_0x1abb79+=0x1){_0x207f42=_0x28acaf[_0x1abb79]['get']({'plain':!![]});_0x47b632['CmHopperBlack'][_0x84be('0x27')]({'phone':_0x5b769e[_0x84be('0xd')],'ContactId':_0x5b769e['id'],'ListId':_0x5b769e[_0x84be('0x28')],'CampaignId':_0x207f42['id']})[_0x84be('0x2b')](function(_0x41947e){logger['error'](_0x84be('0x3e'),'afterCreate',_0x41947e['message']);});}}});})['then'](function(){_0x18548c();})[_0x84be('0x2b')](function(_0x3bcd48){logger[_0x84be('0x15')]('cmContact,\x20%s,\x20%s',_0x84be('0x16'),_0x3bcd48[_0x84be('0x3f')]);_0x18548c(_0x3bcd48);});}else{_0x18548c(new Error(_0x84be('0x40')));}},'afterDestroy':function(_0x209742,_0x3b960f,_0x5751ff){var _0x2509bc=_0x4ce5de[_0x84be('0x14')];var _0x394810=_0x209742[_0x84be('0x37')]({'plain':!![]});return _0x2509bc[_0x84be('0x24')][_0x84be('0x33')]({'raw':!![],'where':{'ListId':_0x394810['ListId'],'ContactId':_0x394810['id']}})[_0x84be('0x22')](function(_0x2e9e98){if(!_[_0x84be('0x41')](_0x2e9e98)){var _0x5406d9=[];for(var _0x4dc254=0x0;_0x4dc254<_0x2e9e98[_0x84be('0x36')];_0x4dc254+=0x1){var _0x5da94f=_0x2509bc[_0x84be('0x24')]['destroy']({'where':{'ListId':_0x2e9e98[_0x4dc254]['ListId'],'ContactId':_0x2e9e98[_0x4dc254]['ContactId'],'VoiceQueueId':_0x2e9e98[_0x4dc254]['VoiceQueueId'],'CampaignId':_0x2e9e98[_0x4dc254]['CampaignId']}});_0x5406d9['push'](_0x5da94f);}return BPromise['all'](_0x5406d9);}})[_0x84be('0x22')](function(_0x4d3188){logger[_0x84be('0x42')]('[CmContact][afterDestroy][Succesfull]',util[_0x84be('0x17')](_0x4d3188,{'showHidden':![],'depth':null}));_0x5751ff();})[_0x84be('0x2b')](function(_0x11c363){logger[_0x84be('0x15')]('[CmContact][afterDestroy][Error]',util[_0x84be('0x17')](_0x11c363,{'showHidden':![],'depth':null}));_0x5751ff(_0x11c363);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index a368a1c..189121e 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['include','model','length','CmContactHasItem','find','ListId','Contact','isNil','CmContactId','CmContact','catch','CreateCmContact','create','body','keys','startsWith','cf_','table','cm_contacts','set','where','id\x20=\x20?','toString','sequelize','query','lodash','util','moment','bluebird','ioredis','squel','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./cmContact.socket','register','request','then','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','GetCmContact','findAll','options','raw','attributes','limit','map'];(function(_0x4f5a0e,_0x44414e){var _0x2a64fc=function(_0x4c011f){while(--_0x4c011f){_0x4f5a0e['push'](_0x4f5a0e['shift']());}};_0x2a64fc(++_0x44414e);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var squel=require(_0x7995('0x5'));var db=require(_0x7995('0x6'))['db'];var utils=require(_0x7995('0x7'));var logger=require('../../config/logger')(_0x7995('0x8'));var config=require(_0x7995('0x9'));var jayson=require(_0x7995('0xa'));var client=jayson[_0x7995('0xb')][_0x7995('0xc')]({'port':0x232a});config[_0x7995('0xd')]=_['defaults'](config[_0x7995('0xd')],{'host':_0x7995('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7995('0xd')]));require(_0x7995('0xf'))[_0x7995('0x10')](socket);function respondWithRpcPromise(_0x35b5fe,_0x3c1d19,_0x1e400a){return new BPromise(function(_0x341672,_0x524f7b){return client[_0x7995('0x11')](_0x35b5fe,_0x1e400a)[_0x7995('0x12')](function(_0x581f22){logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));logger[_0x7995('0x16')](_0x7995('0x17'),_0x3c1d19,_0x7995('0x15'),JSON[_0x7995('0x18')](_0x581f22));if(_0x581f22['error']){if(_0x581f22['error'][_0x7995('0x19')]===0x1f4){logger[_0x7995('0x1a')](_0x7995('0x14'),_0x3c1d19,_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);return _0x524f7b(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}logger[_0x7995('0x1a')]('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x581f22[_0x7995('0x1a')]['message']);return _0x341672(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}else{logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));_0x341672(_0x581f22[_0x7995('0x1c')]['message']);}})['catch'](function(_0x2536c8){logger['error']('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x2536c8);_0x524f7b(_0x2536c8);});});}exports[_0x7995('0x1d')]=function(_0x3d463e){var _0x4cbe10=this;return new Promise(function(_0x3a9b54,_0x51f276){return db['CmContact'][_0x7995('0x1e')]({'raw':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![],'where':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['where']||null:null,'attributes':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x21')]||null:null,'limit':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x22')]||null:null,'include':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['include']?_[_0x7995('0x23')](_0x3d463e[_0x7995('0x1f')][_0x7995('0x24')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x25')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x21')],'include':_0x268ce7['include']?_[_0x7995('0x23')](_0x268ce7['include'],function(_0x229742){return{'model':db[_0x229742[_0x7995('0x25')]],'as':_0x229742['as'],'attributes':_0x229742[_0x7995('0x21')],'include':_0x229742[_0x7995('0x24')]?_[_0x7995('0x23')](_0x229742['include'],function(_0x9b2a15){return{'model':db[_0x9b2a15['model']],'as':_0x9b2a15['as'],'attributes':_0x9b2a15[_0x7995('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x4253e5){logger['info']('GetCmContact',_0x3d463e);logger['debug'](_0x7995('0x1d'),_0x3d463e,JSON[_0x7995('0x18')](_0x4253e5));if(_0x4253e5[_0x7995('0x26')]==0x0){return db[_0x7995('0x27')][_0x7995('0x28')]({'raw':!![],'where':{'item':_0x3d463e[_0x7995('0x1f')]['phone']},'include':[{'model':db['CmContact'],'where':{'ListId':_0x3d463e[_0x7995('0x1f')]['where'][_0x7995('0x29')],'deletedAt':{'$eq':null}},'as':_0x7995('0x2a')}]})[_0x7995('0x12')](function(_0x1e9fa4){if(_[_0x7995('0x2b')](_0x1e9fa4)){_0x3a9b54(_0x4253e5);}else{var _0x510841=_0x1e9fa4[_0x7995('0x2c')];return db[_0x7995('0x2d')]['findAll']({'raw':!![],'where':{'id':_0x510841},'attributes':_0x3d463e['options']?_0x3d463e['options'][_0x7995('0x21')]||null:null})[_0x7995('0x12')](function(_0x4a176f){_0x3a9b54(_0x4a176f);});}});}else{_0x3a9b54(_0x4253e5);}})[_0x7995('0x2e')](function(_0x51b95d){logger[_0x7995('0x1a')](_0x7995('0x1d'),_0x51b95d[_0x7995('0x1b')],_0x3d463e);_0x51f276(_0x4cbe10['error'](0x1f4,_0x51b95d['message']));});});};exports[_0x7995('0x2f')]=function(_0x5e67fe){var _0x5d2428=this;return new Promise(function(_0x3e99cd,_0xe328b1){return db['CmContact'][_0x7995('0x30')](_0x5e67fe[_0x7995('0x31')],{'raw':_0x5e67fe[_0x7995('0x1f')]?_0x5e67fe[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x2d4285){var _0x242713;for(var _0xf612e6=0x0;_0xf612e6{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file +var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0xe9ecfc,_0x18d148){var _0xb5bd95=function(_0x378090){while(--_0x378090){_0xe9ecfc['push'](_0xe9ecfc['shift']());}};_0xb5bd95(++_0x18d148);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/phones',auth['isAuthenticated'](),controller['getAdditionalPhones']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getHopperHistories']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x18')]('/merge',auth[_0x0a9e('0xd')](),controller['merge']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/phones',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x1e'),auth['isAuthenticated'](),controller['duplicateAdditionalPhones']);router[_0x0a9e('0x18')](_0x0a9e('0x1f'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xfb6e48,_0x2fb0e4,_0x3b45bc){_0x3b45bc(null,path[_0x0a9e('0x21')](config[_0x0a9e('0x22')],_0x0a9e('0x23')));},'filename':function(_0x16b1ca,_0x5ea472,_0x59181e){_0x5ea472[_0x0a9e('0x24')]=_0x5ea472[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.attributes.js b/server/api/cmContactHasItem/cmContactHasItem.attributes.js index 702f1d0..07ce2aa 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.attributes.js +++ b/server/api/cmContactHasItem/cmContactHasItem.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaf9b=['INTEGER','STRING','PHONE','sequelize'];(function(_0x9ea8ba,_0x2515fd){var _0x2f8b41=function(_0x323acc){while(--_0x323acc){_0x9ea8ba['push'](_0x9ea8ba['shift']());}};_0x2f8b41(++_0x2515fd);}(_0xaf9b,0x1d7));var _0xbaf9=function(_0x29c8b2,_0x2f427d){_0x29c8b2=_0x29c8b2-0x0;var _0x1d16b5=_0xaf9b[_0x29c8b2];return _0x1d16b5;};'use strict';var Sequelize=require(_0xbaf9('0x0'));module['exports']={'CmContactId':{'type':Sequelize[_0xbaf9('0x1')],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xbaf9('0x1')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xbaf9('0x2')],'defaultValue':_0xbaf9('0x3')},'OrderBy':{'type':Sequelize[_0xbaf9('0x1')],'defaultValue':null},'description':{'type':Sequelize['STRING'],'defaultValue':null}}; \ No newline at end of file +var _0x279d=['STRING','PHONE','sequelize','exports','INTEGER'];(function(_0x53f90c,_0x4d47bb){var _0x869887=function(_0x13aaa7){while(--_0x13aaa7){_0x53f90c['push'](_0x53f90c['shift']());}};_0x869887(++_0x4d47bb);}(_0x279d,0x1d8));var _0xd279=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x279d[_0x36eaaa];return _0x461349;};'use strict';var Sequelize=require(_0xd279('0x0'));module[_0xd279('0x1')]={'CmContactId':{'type':Sequelize[_0xd279('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0xd279('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize['INTEGER'],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':_0xd279('0x4')},'OrderBy':{'type':Sequelize[_0xd279('0x2')],'defaultValue':null},'description':{'type':Sequelize['STRING'],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.controller.js b/server/api/cmContactHasItem/cmContactHasItem.controller.js index 5faae8c..bfebada 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.controller.js +++ b/server/api/cmContactHasItem/cmContactHasItem.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdc61=['order','sort','filter','merge','where','options','CmContactHasItem','include','findAll','catch','params','intersection','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','get','CmContactHasItems','sendStatus','name','send','map','fieldName','type','query','keys','filters','attributes','model','fields','length','hasOwnProperty'];(function(_0x5e8622,_0x1c5103){var _0x5223fe=function(_0x454fcd){while(--_0x454fcd){_0x5e8622['push'](_0x5e8622['shift']());}};_0x5223fe(++_0x1c5103);}(_0xdc61,0x1a0));var _0x1dc6=function(_0x5b1465,_0x215564){_0x5b1465=_0x5b1465-0x0;var _0x104668=_0xdc61[_0x5b1465];return _0x104668;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1dc6('0x0'));var zipdir=require(_0x1dc6('0x1'));var jsonpatch=require(_0x1dc6('0x2'));var rp=require(_0x1dc6('0x3'));var moment=require('moment');var BPromise=require(_0x1dc6('0x4'));var Mustache=require(_0x1dc6('0x5'));var util=require('util');var path=require(_0x1dc6('0x6'));var sox=require('sox');var csv=require(_0x1dc6('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1dc6('0x8'));var _=require(_0x1dc6('0x9'));var squel=require(_0x1dc6('0xa'));var crypto=require(_0x1dc6('0xb'));var jsforce=require(_0x1dc6('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1dc6('0xd'));var Redis=require('ioredis');var authService=require(_0x1dc6('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x1dc6('0xf'));var hardwareService=require(_0x1dc6('0x10'));var logger=require(_0x1dc6('0x11'))(_0x1dc6('0x12'));var utils=require(_0x1dc6('0x13'));var config=require(_0x1dc6('0x14'));var licenseUtil=require(_0x1dc6('0x15'));var db=require(_0x1dc6('0x16'))['db'];function respondWithStatusCode(_0x23600f,_0x3dd4d1){_0x3dd4d1=_0x3dd4d1||0xcc;return function(_0x37dd7e){if(_0x37dd7e){return _0x23600f['sendStatus'](_0x3dd4d1);}return _0x23600f[_0x1dc6('0x17')](_0x3dd4d1)[_0x1dc6('0x18')]();};}function respondWithResult(_0x397a04,_0x3742e7){_0x3742e7=_0x3742e7||0xc8;return function(_0x233926){if(_0x233926){return _0x397a04['status'](_0x3742e7)[_0x1dc6('0x19')](_0x233926);}};}function respondWithFilteredResult(_0x46d95a,_0x19d47c){return function(_0x37b978){if(_0x37b978){var _0x1f9e2a=typeof _0x19d47c[_0x1dc6('0x1a')]==='undefined'&&typeof _0x19d47c[_0x1dc6('0x1b')]==='undefined';var _0x4f8a7d=_0x37b978[_0x1dc6('0x1c')];var _0x3c3249=_0x1f9e2a?0x0:_0x19d47c[_0x1dc6('0x1a')];var _0x340ba1=_0x1f9e2a?_0x37b978[_0x1dc6('0x1c')]:_0x19d47c[_0x1dc6('0x1a')]+_0x19d47c[_0x1dc6('0x1b')];var _0x4f13fa;if(_0x340ba1>=_0x4f8a7d){_0x340ba1=_0x4f8a7d;_0x4f13fa=0xc8;}else{_0x4f13fa=0xce;}_0x46d95a[_0x1dc6('0x17')](_0x4f13fa);return _0x46d95a[_0x1dc6('0x1d')](_0x1dc6('0x1e'),_0x3c3249+'-'+_0x340ba1+'/'+_0x4f8a7d)[_0x1dc6('0x19')](_0x37b978);}return null;};}function patchUpdates(_0xf0cc24){return function(_0x5a8731){try{jsonpatch[_0x1dc6('0x1f')](_0x5a8731,_0xf0cc24,!![]);}catch(_0x4eb95e){return BPromise[_0x1dc6('0x20')](_0x4eb95e);}return _0x5a8731[_0x1dc6('0x21')]();};}function saveUpdates(_0x16f8ae,_0x482071){return function(_0x11a459){if(_0x11a459){return _0x11a459[_0x1dc6('0x22')](_0x16f8ae)[_0x1dc6('0x23')](function(_0x2fb8d4){return _0x2fb8d4;});}return null;};}function removeEntity(_0x58d183,_0x3c0492){return function(_0x5bb115){if(_0x5bb115){return _0x5bb115['destroy']()[_0x1dc6('0x23')](function(){var _0xfbe8f=_0x5bb115[_0x1dc6('0x24')]({'plain':!![]});var _0x1a3e4b=_0x1dc6('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x1a3e4b,'resourceId':_0xfbe8f['id']}})[_0x1dc6('0x23')](function(){return _0x5bb115;});})[_0x1dc6('0x23')](function(){_0x58d183[_0x1dc6('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4064da,_0x435dc4){return function(_0x5b9b69){if(!_0x5b9b69){_0x4064da[_0x1dc6('0x26')](0x194);}return _0x5b9b69;};}function handleError(_0x2b8972,_0x2a7497){_0x2a7497=_0x2a7497||0x1f4;return function(_0x334678){logger['error'](_0x334678['stack']);if(_0x334678[_0x1dc6('0x27')]){delete _0x334678[_0x1dc6('0x27')];}_0x2b8972[_0x1dc6('0x17')](_0x2a7497)[_0x1dc6('0x28')](_0x334678);};}exports['index']=function(_0x4b0990,_0x610ec2){var _0x514d00={},_0x58dd00={},_0x7a1682={'count':0x0,'rows':[]};var _0x2c9223=_[_0x1dc6('0x29')](db['CmContactHasItem']['rawAttributes'],function(_0x4a5d01){return{'name':_0x4a5d01[_0x1dc6('0x2a')],'type':_0x4a5d01[_0x1dc6('0x2b')]['key']};});_0x58dd00['model']=_[_0x1dc6('0x29')](_0x2c9223,_0x1dc6('0x27'));_0x58dd00[_0x1dc6('0x2c')]=_[_0x1dc6('0x2d')](_0x4b0990[_0x1dc6('0x2c')]);_0x58dd00[_0x1dc6('0x2e')]=_['intersection'](_0x58dd00['model'],_0x58dd00[_0x1dc6('0x2c')]);_0x514d00[_0x1dc6('0x2f')]=_['intersection'](_0x58dd00[_0x1dc6('0x30')],qs[_0x1dc6('0x31')](_0x4b0990[_0x1dc6('0x2c')]['fields']));_0x514d00['attributes']=_0x514d00[_0x1dc6('0x2f')][_0x1dc6('0x32')]?_0x514d00[_0x1dc6('0x2f')]:_0x58dd00[_0x1dc6('0x30')];if(!_0x4b0990[_0x1dc6('0x2c')][_0x1dc6('0x33')]('nolimit')){_0x514d00[_0x1dc6('0x1b')]=qs[_0x1dc6('0x1b')](_0x4b0990[_0x1dc6('0x2c')][_0x1dc6('0x1b')]);_0x514d00['offset']=qs[_0x1dc6('0x1a')](_0x4b0990[_0x1dc6('0x2c')]['offset']);}_0x514d00[_0x1dc6('0x34')]=qs[_0x1dc6('0x35')](_0x4b0990[_0x1dc6('0x2c')][_0x1dc6('0x35')]);_0x514d00['where']=qs[_0x1dc6('0x2e')](_['pick'](_0x4b0990[_0x1dc6('0x2c')],_0x58dd00[_0x1dc6('0x2e')]),_0x2c9223);if(_0x4b0990[_0x1dc6('0x2c')][_0x1dc6('0x36')]){_0x514d00['where']=_[_0x1dc6('0x37')](_0x514d00[_0x1dc6('0x38')],{'$or':_['map'](_0x2c9223,function(_0x25c4ab){if(_0x25c4ab['type']!=='VIRTUAL'){var _0x39215f={};_0x39215f[_0x25c4ab[_0x1dc6('0x27')]]={'$like':'%'+_0x4b0990[_0x1dc6('0x2c')][_0x1dc6('0x36')]+'%'};return _0x39215f;}})});}_0x514d00=_[_0x1dc6('0x37')]({},_0x514d00,_0x4b0990[_0x1dc6('0x39')]);var _0x4b69a7={'where':_0x514d00['where']};return db[_0x1dc6('0x3a')][_0x1dc6('0x1c')](_0x4b69a7)[_0x1dc6('0x23')](function(_0xbf415e){_0x7a1682[_0x1dc6('0x1c')]=_0xbf415e;if(_0x4b0990[_0x1dc6('0x2c')]['includeAll']){_0x514d00[_0x1dc6('0x3b')]=[{'all':!![]}];}return db[_0x1dc6('0x3a')][_0x1dc6('0x3c')](_0x514d00);})['then'](function(_0x3ce98f){_0x7a1682['rows']=_0x3ce98f;return _0x7a1682;})[_0x1dc6('0x23')](respondWithFilteredResult(_0x610ec2,_0x514d00))[_0x1dc6('0x3d')](handleError(_0x610ec2,null));};exports['show']=function(_0x3dbbb6,_0x53c193){var _0x39631b={'raw':!![],'where':{'id':_0x3dbbb6[_0x1dc6('0x3e')]['id']}},_0x5097c4={};_0x5097c4[_0x1dc6('0x30')]=_[_0x1dc6('0x2d')](db[_0x1dc6('0x3a')]['rawAttributes']);_0x5097c4['query']=_[_0x1dc6('0x2d')](_0x3dbbb6[_0x1dc6('0x2c')]);_0x5097c4[_0x1dc6('0x2e')]=_[_0x1dc6('0x3f')](_0x5097c4[_0x1dc6('0x30')],_0x5097c4['query']);_0x39631b[_0x1dc6('0x2f')]=_[_0x1dc6('0x3f')](_0x5097c4[_0x1dc6('0x30')],qs[_0x1dc6('0x31')](_0x3dbbb6[_0x1dc6('0x2c')][_0x1dc6('0x31')]));_0x39631b['attributes']=_0x39631b['attributes'][_0x1dc6('0x32')]?_0x39631b['attributes']:_0x5097c4[_0x1dc6('0x30')];if(_0x3dbbb6[_0x1dc6('0x2c')][_0x1dc6('0x40')]){_0x39631b[_0x1dc6('0x3b')]=[{'all':!![]}];}_0x39631b=_['merge']({},_0x39631b,_0x3dbbb6[_0x1dc6('0x39')]);return db[_0x1dc6('0x3a')][_0x1dc6('0x41')](_0x39631b)[_0x1dc6('0x23')](handleEntityNotFound(_0x53c193,null))[_0x1dc6('0x23')](respondWithResult(_0x53c193,null))[_0x1dc6('0x3d')](handleError(_0x53c193,null));};exports[_0x1dc6('0x42')]=function(_0x5b4b6f,_0x28a0ad){return db[_0x1dc6('0x3a')]['create'](_0x5b4b6f[_0x1dc6('0x43')],{})[_0x1dc6('0x23')](function(_0x32e179){var _0x31228b=_0x5b4b6f[_0x1dc6('0x44')][_0x1dc6('0x24')]({'plain':!![]});if(!_0x31228b)throw new Error(_0x1dc6('0x45'));if(_0x31228b[_0x1dc6('0x46')]===_0x1dc6('0x44')){var _0x256c4f=_0x32e179['get']({'plain':!![]});var _0x5a954f=_0x1dc6('0x25');return db[_0x1dc6('0x47')][_0x1dc6('0x41')]({'where':{'name':_0x5a954f,'userProfileId':_0x31228b[_0x1dc6('0x48')]},'raw':!![]})[_0x1dc6('0x23')](function(_0x960a35){if(_0x960a35&&_0x960a35[_0x1dc6('0x49')]===0x0){return db[_0x1dc6('0x4a')][_0x1dc6('0x42')]({'name':_0x256c4f[_0x1dc6('0x27')],'resourceId':_0x256c4f['id'],'type':_0x960a35[_0x1dc6('0x27')],'sectionId':_0x960a35['id']},{})['then'](function(){return _0x32e179;});}else{return _0x32e179;}})[_0x1dc6('0x3d')](function(_0x421e08){logger[_0x1dc6('0x4b')](_0x1dc6('0x4c'),_0x421e08);throw _0x421e08;});}return _0x32e179;})['then'](respondWithResult(_0x28a0ad,0xc9))[_0x1dc6('0x3d')](handleError(_0x28a0ad,null));};exports['update']=function(_0x42980c,_0x30acb4){if(_0x42980c[_0x1dc6('0x43')]['id']){delete _0x42980c[_0x1dc6('0x43')]['id'];}return db[_0x1dc6('0x3a')][_0x1dc6('0x41')]({'where':{'id':_0x42980c[_0x1dc6('0x3e')]['id']}})[_0x1dc6('0x23')](handleEntityNotFound(_0x30acb4,null))['then'](saveUpdates(_0x42980c[_0x1dc6('0x43')],null))['then'](respondWithResult(_0x30acb4,null))[_0x1dc6('0x3d')](handleError(_0x30acb4,null));};exports[_0x1dc6('0x4d')]=function(_0xc2475f,_0x5350fd){return db[_0x1dc6('0x3a')][_0x1dc6('0x41')]({'where':{'id':_0xc2475f[_0x1dc6('0x3e')]['id']}})[_0x1dc6('0x23')](handleEntityNotFound(_0x5350fd,null))[_0x1dc6('0x23')](removeEntity(_0x5350fd,null))['catch'](handleError(_0x5350fd,null));}; \ No newline at end of file +var _0x0fa0=['querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','sendStatus','offset','undefined','limit','count','status','Content-Range','apply','update','then','destroy','get','CmContactHasItems','UserProfileResource','end','error','stack','name','index','map','CmContactHasItem','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','include','findAll','rows','catch','params','length','includeAll','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x500fc1,_0x215ca7){var _0x4162c2=function(_0x499a6e){while(--_0x499a6e){_0x500fc1['push'](_0x500fc1['shift']());}};_0x4162c2(++_0x215ca7);}(_0x0fa0,0x89));var _0x00fa=function(_0x5181f7,_0xd27a){_0x5181f7=_0x5181f7-0x0;var _0x42c35e=_0x0fa0[_0x5181f7];return _0x42c35e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x00fa('0x0'));var rp=require(_0x00fa('0x1'));var moment=require(_0x00fa('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x00fa('0x3'));var util=require(_0x00fa('0x4'));var path=require(_0x00fa('0x5'));var sox=require('sox');var csv=require(_0x00fa('0x6'));var ejs=require(_0x00fa('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x00fa('0x8'));var squel=require(_0x00fa('0x9'));var crypto=require(_0x00fa('0xa'));var jsforce=require(_0x00fa('0xb'));var deskjs=require(_0x00fa('0xc'));var toCsv=require(_0x00fa('0x6'));var querystring=require(_0x00fa('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x00fa('0xe'));var qs=require(_0x00fa('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x00fa('0x10'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x00fa('0x11'));var licenseUtil=require(_0x00fa('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5f24a2,_0x21e26e){_0x21e26e=_0x21e26e||0xcc;return function(_0x4dbc16){if(_0x4dbc16){return _0x5f24a2[_0x00fa('0x13')](_0x21e26e);}return _0x5f24a2['status'](_0x21e26e)['end']();};}function respondWithResult(_0x55879b,_0x63925f){_0x63925f=_0x63925f||0xc8;return function(_0x3dc641){if(_0x3dc641){return _0x55879b['status'](_0x63925f)['json'](_0x3dc641);}};}function respondWithFilteredResult(_0x267804,_0x5332b3){return function(_0x230f45){if(_0x230f45){var _0xf7c405=typeof _0x5332b3[_0x00fa('0x14')]===_0x00fa('0x15')&&typeof _0x5332b3[_0x00fa('0x16')]===_0x00fa('0x15');var _0x58051e=_0x230f45[_0x00fa('0x17')];var _0x2184c2=_0xf7c405?0x0:_0x5332b3[_0x00fa('0x14')];var _0x437220=_0xf7c405?_0x230f45[_0x00fa('0x17')]:_0x5332b3[_0x00fa('0x14')]+_0x5332b3[_0x00fa('0x16')];var _0x19f00f;if(_0x437220>=_0x58051e){_0x437220=_0x58051e;_0x19f00f=0xc8;}else{_0x19f00f=0xce;}_0x267804[_0x00fa('0x18')](_0x19f00f);return _0x267804['set'](_0x00fa('0x19'),_0x2184c2+'-'+_0x437220+'/'+_0x58051e)['json'](_0x230f45);}return null;};}function patchUpdates(_0x272790){return function(_0x544b06){try{jsonpatch[_0x00fa('0x1a')](_0x544b06,_0x272790,!![]);}catch(_0x558cce){return BPromise['reject'](_0x558cce);}return _0x544b06['save']();};}function saveUpdates(_0x4ba81e,_0x1b3b04){return function(_0x26bbbd){if(_0x26bbbd){return _0x26bbbd[_0x00fa('0x1b')](_0x4ba81e)[_0x00fa('0x1c')](function(_0x2a8243){return _0x2a8243;});}return null;};}function removeEntity(_0x5b0b49,_0x53a6d9){return function(_0x9d6536){if(_0x9d6536){return _0x9d6536[_0x00fa('0x1d')]()[_0x00fa('0x1c')](function(){var _0x37bfc2=_0x9d6536[_0x00fa('0x1e')]({'plain':!![]});var _0x53947=_0x00fa('0x1f');return db[_0x00fa('0x20')][_0x00fa('0x1d')]({'where':{'type':_0x53947,'resourceId':_0x37bfc2['id']}})[_0x00fa('0x1c')](function(){return _0x9d6536;});})[_0x00fa('0x1c')](function(){_0x5b0b49[_0x00fa('0x18')](0xcc)[_0x00fa('0x21')]();});}};}function handleEntityNotFound(_0x584843,_0x5720db){return function(_0x1f908e){if(!_0x1f908e){_0x584843['sendStatus'](0x194);}return _0x1f908e;};}function handleError(_0x51193c,_0xd58633){_0xd58633=_0xd58633||0x1f4;return function(_0x22fb3f){logger[_0x00fa('0x22')](_0x22fb3f[_0x00fa('0x23')]);if(_0x22fb3f[_0x00fa('0x24')]){delete _0x22fb3f['name'];}_0x51193c['status'](_0xd58633)['send'](_0x22fb3f);};}exports[_0x00fa('0x25')]=function(_0x732c29,_0x512a68){var _0x258106={},_0x4fe230={},_0x3709e4={'count':0x0,'rows':[]};var _0x4d6ed7=_[_0x00fa('0x26')](db[_0x00fa('0x27')][_0x00fa('0x28')],function(_0x1b0a0e){return{'name':_0x1b0a0e[_0x00fa('0x29')],'type':_0x1b0a0e[_0x00fa('0x2a')][_0x00fa('0x2b')]};});_0x4fe230[_0x00fa('0x2c')]=_['map'](_0x4d6ed7,_0x00fa('0x24'));_0x4fe230[_0x00fa('0x2d')]=_[_0x00fa('0x2e')](_0x732c29[_0x00fa('0x2d')]);_0x4fe230[_0x00fa('0x2f')]=_['intersection'](_0x4fe230[_0x00fa('0x2c')],_0x4fe230[_0x00fa('0x2d')]);_0x258106[_0x00fa('0x30')]=_[_0x00fa('0x31')](_0x4fe230['model'],qs[_0x00fa('0x32')](_0x732c29[_0x00fa('0x2d')][_0x00fa('0x32')]));_0x258106[_0x00fa('0x30')]=_0x258106['attributes']['length']?_0x258106[_0x00fa('0x30')]:_0x4fe230[_0x00fa('0x2c')];if(!_0x732c29[_0x00fa('0x2d')][_0x00fa('0x33')](_0x00fa('0x34'))){_0x258106[_0x00fa('0x16')]=qs[_0x00fa('0x16')](_0x732c29[_0x00fa('0x2d')][_0x00fa('0x16')]);_0x258106[_0x00fa('0x14')]=qs[_0x00fa('0x14')](_0x732c29[_0x00fa('0x2d')][_0x00fa('0x14')]);}_0x258106[_0x00fa('0x35')]=qs[_0x00fa('0x36')](_0x732c29[_0x00fa('0x2d')]['sort']);_0x258106['where']=qs[_0x00fa('0x2f')](_['pick'](_0x732c29[_0x00fa('0x2d')],_0x4fe230[_0x00fa('0x2f')]),_0x4d6ed7);if(_0x732c29[_0x00fa('0x2d')]['filter']){_0x258106[_0x00fa('0x37')]=_['merge'](_0x258106[_0x00fa('0x37')],{'$or':_[_0x00fa('0x26')](_0x4d6ed7,function(_0x1c9501){if(_0x1c9501[_0x00fa('0x2a')]!==_0x00fa('0x38')){var _0x21e048={};_0x21e048[_0x1c9501['name']]={'$like':'%'+_0x732c29[_0x00fa('0x2d')][_0x00fa('0x39')]+'%'};return _0x21e048;}})});}_0x258106=_['merge']({},_0x258106,_0x732c29['options']);var _0x183ad8={'where':_0x258106['where']};return db['CmContactHasItem'][_0x00fa('0x17')](_0x183ad8)[_0x00fa('0x1c')](function(_0xf4b846){_0x3709e4[_0x00fa('0x17')]=_0xf4b846;if(_0x732c29['query']['includeAll']){_0x258106[_0x00fa('0x3a')]=[{'all':!![]}];}return db[_0x00fa('0x27')][_0x00fa('0x3b')](_0x258106);})[_0x00fa('0x1c')](function(_0x5420de){_0x3709e4[_0x00fa('0x3c')]=_0x5420de;return _0x3709e4;})[_0x00fa('0x1c')](respondWithFilteredResult(_0x512a68,_0x258106))[_0x00fa('0x3d')](handleError(_0x512a68,null));};exports['show']=function(_0x7c2a80,_0x2826fa){var _0x179d15={'raw':!![],'where':{'id':_0x7c2a80[_0x00fa('0x3e')]['id']}},_0x1e3c4f={};_0x1e3c4f[_0x00fa('0x2c')]=_[_0x00fa('0x2e')](db[_0x00fa('0x27')][_0x00fa('0x28')]);_0x1e3c4f['query']=_['keys'](_0x7c2a80[_0x00fa('0x2d')]);_0x1e3c4f[_0x00fa('0x2f')]=_[_0x00fa('0x31')](_0x1e3c4f[_0x00fa('0x2c')],_0x1e3c4f[_0x00fa('0x2d')]);_0x179d15[_0x00fa('0x30')]=_[_0x00fa('0x31')](_0x1e3c4f['model'],qs['fields'](_0x7c2a80[_0x00fa('0x2d')][_0x00fa('0x32')]));_0x179d15[_0x00fa('0x30')]=_0x179d15[_0x00fa('0x30')][_0x00fa('0x3f')]?_0x179d15[_0x00fa('0x30')]:_0x1e3c4f[_0x00fa('0x2c')];if(_0x7c2a80[_0x00fa('0x2d')][_0x00fa('0x40')]){_0x179d15[_0x00fa('0x3a')]=[{'all':!![]}];}_0x179d15=_[_0x00fa('0x41')]({},_0x179d15,_0x7c2a80[_0x00fa('0x42')]);return db[_0x00fa('0x27')][_0x00fa('0x43')](_0x179d15)[_0x00fa('0x1c')](handleEntityNotFound(_0x2826fa,null))[_0x00fa('0x1c')](respondWithResult(_0x2826fa,null))[_0x00fa('0x3d')](handleError(_0x2826fa,null));};exports[_0x00fa('0x44')]=function(_0x18fc08,_0x2826ee){return db[_0x00fa('0x27')][_0x00fa('0x44')](_0x18fc08[_0x00fa('0x45')],{})[_0x00fa('0x1c')](function(_0x27fb7c){var _0x5a5066=_0x18fc08[_0x00fa('0x46')][_0x00fa('0x1e')]({'plain':!![]});if(!_0x5a5066)throw new Error(_0x00fa('0x47'));if(_0x5a5066[_0x00fa('0x48')]===_0x00fa('0x46')){var _0x2b558d=_0x27fb7c[_0x00fa('0x1e')]({'plain':!![]});var _0x3ecfd0=_0x00fa('0x1f');return db['UserProfileSection'][_0x00fa('0x43')]({'where':{'name':_0x3ecfd0,'userProfileId':_0x5a5066[_0x00fa('0x49')]},'raw':!![]})[_0x00fa('0x1c')](function(_0x20fab0){if(_0x20fab0&&_0x20fab0['autoAssociation']===0x0){return db[_0x00fa('0x20')]['create']({'name':_0x2b558d[_0x00fa('0x24')],'resourceId':_0x2b558d['id'],'type':_0x20fab0['name'],'sectionId':_0x20fab0['id']},{})[_0x00fa('0x1c')](function(){return _0x27fb7c;});}else{return _0x27fb7c;}})['catch'](function(_0x37c8a8){logger[_0x00fa('0x22')](_0x00fa('0x4a'),_0x37c8a8);throw _0x37c8a8;});}return _0x27fb7c;})[_0x00fa('0x1c')](respondWithResult(_0x2826ee,0xc9))['catch'](handleError(_0x2826ee,null));};exports[_0x00fa('0x1b')]=function(_0x4583bd,_0x46e859){if(_0x4583bd[_0x00fa('0x45')]['id']){delete _0x4583bd[_0x00fa('0x45')]['id'];}return db[_0x00fa('0x27')][_0x00fa('0x43')]({'where':{'id':_0x4583bd['params']['id']}})[_0x00fa('0x1c')](handleEntityNotFound(_0x46e859,null))['then'](saveUpdates(_0x4583bd[_0x00fa('0x45')],null))[_0x00fa('0x1c')](respondWithResult(_0x46e859,null))[_0x00fa('0x3d')](handleError(_0x46e859,null));};exports[_0x00fa('0x1d')]=function(_0x28fa98,_0x483b76){return db[_0x00fa('0x27')][_0x00fa('0x43')]({'where':{'id':_0x28fa98[_0x00fa('0x3e')]['id']}})[_0x00fa('0x1c')](handleEntityNotFound(_0x483b76,null))[_0x00fa('0x1c')](removeEntity(_0x483b76,null))[_0x00fa('0x3d')](handleError(_0x483b76,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 808ea51..02e6d73 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.model.js +++ b/server/api/cmContactHasItem/cmContactHasItem.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x95a7=['api','moment','bluebird','request-promise','path','rimraf','exports','define','CmContactHasItem','lodash','../../config/logger'];(function(_0x141261,_0x10acbd){var _0x27cc4a=function(_0x5eec36){while(--_0x5eec36){_0x141261['push'](_0x141261['shift']());}};_0x27cc4a(++_0x10acbd);}(_0x95a7,0x106));var _0x795a=function(_0xcd8e75,_0x4bf1ac){_0xcd8e75=_0xcd8e75-0x0;var _0x3effa8=_0x95a7[_0xcd8e75];return _0x3effa8;};'use strict';var _=require(_0x795a('0x0'));var util=require('util');var logger=require(_0x795a('0x1'))(_0x795a('0x2'));var moment=require(_0x795a('0x3'));var BPromise=require(_0x795a('0x4'));var rp=require(_0x795a('0x5'));var fs=require('fs');var path=require(_0x795a('0x6'));var rimraf=require(_0x795a('0x7'));var config=require('../../config/environment');var attributes=require('./cmContactHasItem.attributes');module[_0x795a('0x8')]=function(_0x5a9622,_0x10c17a){return _0x5a9622[_0x795a('0x9')](_0x795a('0xa'),attributes,{'tableName':'cm_contact_has_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9aab=['rimraf','../../config/environment','./cmContactHasItem.attributes','exports','define','CmContactHasItem','cm_contact_has_items','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x1bfae6,_0x323af8){var _0x2d8c3b=function(_0x272ec2){while(--_0x272ec2){_0x1bfae6['push'](_0x1bfae6['shift']());}};_0x2d8c3b(++_0x323af8);}(_0x9aab,0x103));var _0xb9aa=function(_0x54fe18,_0x4d9d89){_0x54fe18=_0x54fe18-0x0;var _0xdbde89=_0x9aab[_0x54fe18];return _0xdbde89;};'use strict';var _=require(_0xb9aa('0x0'));var util=require(_0xb9aa('0x1'));var logger=require(_0xb9aa('0x2'))(_0xb9aa('0x3'));var moment=require('moment');var BPromise=require(_0xb9aa('0x4'));var rp=require(_0xb9aa('0x5'));var fs=require('fs');var path=require(_0xb9aa('0x6'));var rimraf=require(_0xb9aa('0x7'));var config=require(_0xb9aa('0x8'));var attributes=require(_0xb9aa('0x9'));module[_0xb9aa('0xa')]=function(_0x1fc9cb,_0x1fcf04){return _0x1fc9cb[_0xb9aa('0xb')](_0xb9aa('0xc'),attributes,{'tableName':_0xb9aa('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.rpc.js b/server/api/cmContactHasItem/cmContactHasItem.rpc.js index c2da376..6e077ea 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.rpc.js +++ b/server/api/cmContactHasItem/cmContactHasItem.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeb03=['../../config/logger','../../config/environment','jayson/promise','client','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeb03,0xbf));var _0x3eb0=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0xeb03[_0x334841];return _0x5beb4b;};'use strict';var _=require(_0x3eb0('0x0'));var util=require('util');var moment=require(_0x3eb0('0x1'));var BPromise=require(_0x3eb0('0x2'));var rs=require(_0x3eb0('0x3'));var fs=require('fs');var Redis=require(_0x3eb0('0x4'));var db=require(_0x3eb0('0x5'))['db'];var utils=require(_0x3eb0('0x6'));var logger=require(_0x3eb0('0x7'))('rpc');var config=require(_0x3eb0('0x8'));var jayson=require(_0x3eb0('0x9'));var client=jayson[_0x3eb0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f0818,_0x406a81,_0x4ccc5d){return new BPromise(function(_0x1136fb,_0x54c763){return client['request'](_0x3f0818,_0x4ccc5d)[_0x3eb0('0xb')](function(_0x127bea){logger[_0x3eb0('0xc')](_0x3eb0('0xd'),_0x406a81,_0x3eb0('0xe'));logger[_0x3eb0('0xf')](_0x3eb0('0x10'),_0x406a81,_0x3eb0('0xe'),JSON[_0x3eb0('0x11')](_0x127bea));if(_0x127bea['error']){if(_0x127bea[_0x3eb0('0x12')]['code']===0x1f4){logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x406a81,_0x127bea[_0x3eb0('0x12')]['message']);return _0x54c763(_0x127bea[_0x3eb0('0x12')][_0x3eb0('0x13')]);}logger[_0x3eb0('0x12')](_0x3eb0('0xd'),_0x406a81,_0x127bea['error']['message']);return _0x1136fb(_0x127bea['error']['message']);}else{logger[_0x3eb0('0xc')](_0x3eb0('0xd'),_0x406a81,_0x3eb0('0xe'));_0x1136fb(_0x127bea[_0x3eb0('0x14')][_0x3eb0('0x13')]);}})[_0x3eb0('0x15')](function(_0x1ae565){logger[_0x3eb0('0x12')](_0x3eb0('0xd'),_0x406a81,_0x1ae565);_0x54c763(_0x1ae565);});});} \ No newline at end of file +var _0x7c2f=['result','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','client','http','request','then','info','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','CmContactHasItem,\x20%s,\x20%s','message'];(function(_0x1d3cbe,_0x5a1aca){var _0x178bea=function(_0x4339a4){while(--_0x4339a4){_0x1d3cbe['push'](_0x1d3cbe['shift']());}};_0x178bea(++_0x5a1aca);}(_0x7c2f,0x12d));var _0xf7c2=function(_0x2d75b5,_0x4f2d0b){_0x2d75b5=_0x2d75b5-0x0;var _0x2a4fc1=_0x7c2f[_0x2d75b5];return _0x2a4fc1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf7c2('0x0'));var BPromise=require(_0xf7c2('0x1'));var rs=require(_0xf7c2('0x2'));var fs=require('fs');var Redis=require(_0xf7c2('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf7c2('0x4'));var logger=require(_0xf7c2('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf7c2('0x6')][_0xf7c2('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xfe0ad5,_0x36289e,_0x60001b){return new BPromise(function(_0x11bfdc,_0x386a01){return client[_0xf7c2('0x8')](_0xfe0ad5,_0x60001b)[_0xf7c2('0x9')](function(_0x2109bd){logger[_0xf7c2('0xa')]('CmContactHasItem,\x20%s,\x20%s',_0x36289e,_0xf7c2('0xb'));logger[_0xf7c2('0xc')](_0xf7c2('0xd'),_0x36289e,_0xf7c2('0xb'),JSON[_0xf7c2('0xe')](_0x2109bd));if(_0x2109bd[_0xf7c2('0xf')]){if(_0x2109bd[_0xf7c2('0xf')][_0xf7c2('0x10')]===0x1f4){logger[_0xf7c2('0xf')](_0xf7c2('0x11'),_0x36289e,_0x2109bd[_0xf7c2('0xf')][_0xf7c2('0x12')]);return _0x386a01(_0x2109bd[_0xf7c2('0xf')][_0xf7c2('0x12')]);}logger[_0xf7c2('0xf')]('CmContactHasItem,\x20%s,\x20%s',_0x36289e,_0x2109bd['error'][_0xf7c2('0x12')]);return _0x11bfdc(_0x2109bd[_0xf7c2('0xf')][_0xf7c2('0x12')]);}else{logger[_0xf7c2('0xa')](_0xf7c2('0x11'),_0x36289e,'request\x20sent');_0x11bfdc(_0x2109bd[_0xf7c2('0x13')]['message']);}})['catch'](function(_0x387087){logger['error'](_0xf7c2('0x11'),_0x36289e,_0x387087);_0x386a01(_0x387087);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index 6dd4fea..bed112c 100644 --- a/server/api/cmContactHasItem/index.js +++ b/server/api/cmContactHasItem/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb991=['put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get','isAuthenticated','index','show','post'];(function(_0x21d36e,_0x5dc096){var _0x4cc307=function(_0x4ae995){while(--_0x4ae995){_0x21d36e['push'](_0x21d36e['shift']());}};_0x4cc307(++_0x5dc096);}(_0xb991,0x69));var _0x1b99=function(_0x4fbb86,_0x374ed0){_0x4fbb86=_0x4fbb86-0x0;var _0xb141fe=_0xb991[_0x4fbb86];return _0xb141fe;};'use strict';var multer=require(_0x1b99('0x0'));var util=require(_0x1b99('0x1'));var path=require(_0x1b99('0x2'));var timeout=require(_0x1b99('0x3'));var express=require(_0x1b99('0x4'));var router=express[_0x1b99('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1b99('0x6'));var interaction=require(_0x1b99('0x7'));var config=require(_0x1b99('0x8'));var controller=require(_0x1b99('0x9'));router[_0x1b99('0xa')]('/',auth[_0x1b99('0xb')](),controller[_0x1b99('0xc')]);router[_0x1b99('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x1b99('0xd')]);router[_0x1b99('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1b99('0xf')](_0x1b99('0x10'),auth[_0x1b99('0xb')](),controller[_0x1b99('0x11')]);router['delete'](_0x1b99('0x10'),auth[_0x1b99('0xb')](),controller[_0x1b99('0x12')]);module[_0x1b99('0x13')]=router; \ No newline at end of file +var _0x670c=['./cmContactHasItem.controller','get','index','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../config/environment'];(function(_0x58e4d6,_0x1d5502){var _0x1e22d3=function(_0x365d7b){while(--_0x365d7b){_0x58e4d6['push'](_0x58e4d6['shift']());}};_0x1e22d3(++_0x1d5502);}(_0x670c,0x12c));var _0xc670=function(_0x120b6e,_0x1bb1d5){_0x120b6e=_0x120b6e-0x0;var _0x2050a4=_0x670c[_0x120b6e];return _0x2050a4;};'use strict';var multer=require(_0xc670('0x0'));var util=require(_0xc670('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc670('0x2'));var router=express[_0xc670('0x3')]();var fs_extra=require(_0xc670('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc670('0x5'));var controller=require(_0xc670('0x6'));router[_0xc670('0x7')]('/',auth['isAuthenticated'](),controller[_0xc670('0x8')]);router[_0xc670('0x7')](_0xc670('0x9'),auth[_0xc670('0xa')](),controller[_0xc670('0xb')]);router[_0xc670('0xc')]('/',auth[_0xc670('0xa')](),controller['create']);router[_0xc670('0xd')](_0xc670('0x9'),auth[_0xc670('0xa')](),controller[_0xc670('0xe')]);router[_0xc670('0xf')](_0xc670('0x9'),auth[_0xc670('0xa')](),controller[_0xc670('0x10')]);module[_0xc670('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index c09a2cc..88ae41f 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 _0xcbf0=['values','isArray','stringify','BOOLEAN','ENUM','voice','lodash','VIRTUAL','getDataValue','alias','STRING','setDataValue','TEXT','long','type','select','parse'];(function(_0x22a238,_0x234b9b){var _0x3ba062=function(_0x163ed4){while(--_0x163ed4){_0x22a238['push'](_0x22a238['shift']());}};_0x3ba062(++_0x234b9b);}(_0xcbf0,0x1c0));var _0x0cbf=function(_0x400924,_0x5d08e1){_0x400924=_0x400924-0x0;var _0x2e1acc=_0xcbf0[_0x400924];return _0x2e1acc;};'use strict';var Sequelize=require('sequelize');var _=require(_0x0cbf('0x0'));module['exports']={'name':{'type':Sequelize[_0x0cbf('0x1')],'get':function(_0x250f99){return this[_0x0cbf('0x2')](_0x0cbf('0x3'));}},'alias':{'type':Sequelize[_0x0cbf('0x4')],'allowNull':![],'set':function(_0x3e5a10){this[_0x0cbf('0x5')]('alias',_0x3e5a10?_0x3e5a10:this[_0x0cbf('0x2')]('name'));}},'type':{'type':Sequelize[_0x0cbf('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0x0cbf('0x6')](_0x0cbf('0x7')),'get':function(){if(this['getDataValue'](_0x0cbf('0x8'))===_0x0cbf('0x9')){return JSON[_0x0cbf('0xa')](this['getDataValue'](_0x0cbf('0xb')));}else{return this[_0x0cbf('0x2')](_0x0cbf('0xb'));}},'set':function(_0x28f450){if(Array[_0x0cbf('0xc')](_0x28f450)){this['setDataValue']('values',JSON[_0x0cbf('0xd')](_0x28f450));}else{this[_0x0cbf('0x5')]('values',_0x28f450);}}},'required':{'type':Sequelize[_0x0cbf('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0x0cbf('0xf')](_0x0cbf('0x10'))}}; \ No newline at end of file +var _0x1ef0=['STRING','name','TEXT','long','type','select','values','setDataValue','stringify','BOOLEAN','ENUM','voice','sequelize','lodash','exports','getDataValue','alias'];(function(_0x40b4da,_0x1df84d){var _0x5c2f04=function(_0x121bdd){while(--_0x121bdd){_0x40b4da['push'](_0x40b4da['shift']());}};_0x5c2f04(++_0x1df84d);}(_0x1ef0,0x10b));var _0x01ef=function(_0x589fb1,_0x5d8fb5){_0x589fb1=_0x589fb1-0x0;var _0x12195c=_0x1ef0[_0x589fb1];return _0x12195c;};'use strict';var Sequelize=require(_0x01ef('0x0'));var _=require(_0x01ef('0x1'));module[_0x01ef('0x2')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0xe3e877){return this[_0x01ef('0x3')](_0x01ef('0x4'));}},'alias':{'type':Sequelize[_0x01ef('0x5')],'allowNull':![],'set':function(_0x3cf999){this['setDataValue'](_0x01ef('0x4'),_0x3cf999?_0x3cf999:this[_0x01ef('0x3')](_0x01ef('0x6')));}},'type':{'type':Sequelize[_0x01ef('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0x01ef('0x7')](_0x01ef('0x8')),'get':function(){if(this[_0x01ef('0x3')](_0x01ef('0x9'))===_0x01ef('0xa')){return JSON['parse'](this[_0x01ef('0x3')](_0x01ef('0xb')));}else{return this['getDataValue'](_0x01ef('0xb'));}},'set':function(_0x573834){if(Array['isArray'](_0x573834)){this[_0x01ef('0xc')](_0x01ef('0xb'),JSON[_0x01ef('0xd')](_0x573834));}else{this['setDataValue'](_0x01ef('0xb'),_0x573834);}}},'required':{'type':Sequelize[_0x01ef('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x01ef('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x01ef('0xf')](_0x01ef('0x10'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 45ddafc..b807c44 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 _0xd058=['status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','rawAttributes','type','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','CmCustomField','findAll','catch','show','params','length','find','body','sequelize','transaction','create','Sequelize','TEXT','number','BOOLEAN','defaultValue','queryInterface','format','cf_%d','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0xd058,0xe7));var _0x8d05=function(_0x47568e,_0x5ccdaf){_0x47568e=_0x47568e-0x0;var _0x33815b=_0xd058[_0x47568e];return _0x33815b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8d05('0x0'));var zipdir=require(_0x8d05('0x1'));var jsonpatch=require(_0x8d05('0x2'));var rp=require(_0x8d05('0x3'));var moment=require(_0x8d05('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8d05('0x5'));var util=require(_0x8d05('0x6'));var path=require(_0x8d05('0x7'));var sox=require(_0x8d05('0x8'));var csv=require(_0x8d05('0x9'));var ejs=require(_0x8d05('0xa'));var fs=require('fs');var fs_extra=require(_0x8d05('0xb'));var _=require('lodash');var squel=require(_0x8d05('0xc'));var crypto=require(_0x8d05('0xd'));var jsforce=require(_0x8d05('0xe'));var deskjs=require(_0x8d05('0xf'));var toCsv=require(_0x8d05('0x9'));var querystring=require(_0x8d05('0x10'));var Papa=require(_0x8d05('0x11'));var Redis=require(_0x8d05('0x12'));var authService=require(_0x8d05('0x13'));var qs=require(_0x8d05('0x14'));var as=require(_0x8d05('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8d05('0x16'))(_0x8d05('0x17'));var utils=require('../../config/utils');var config=require(_0x8d05('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x8d05('0x19'))['db'];function respondWithStatusCode(_0x1dd6b3,_0x429073){_0x429073=_0x429073||0xcc;return function(_0x47c5ae){if(_0x47c5ae){return _0x1dd6b3[_0x8d05('0x1a')](_0x429073);}return _0x1dd6b3['status'](_0x429073)['end']();};}function respondWithResult(_0x4e92f8,_0x82ec17){_0x82ec17=_0x82ec17||0xc8;return function(_0x139292){if(_0x139292){return _0x4e92f8[_0x8d05('0x1b')](_0x82ec17)[_0x8d05('0x1c')](_0x139292);}};}function respondWithFilteredResult(_0x469d75,_0x17c4f6){return function(_0x3277ce){if(_0x3277ce){var _0x2706c0=typeof _0x17c4f6[_0x8d05('0x1d')]===_0x8d05('0x1e')&&typeof _0x17c4f6[_0x8d05('0x1f')]==='undefined';var _0xcef4ad=_0x3277ce[_0x8d05('0x20')];var _0x482dd6=_0x2706c0?0x0:_0x17c4f6['offset'];var _0x247928=_0x2706c0?_0x3277ce[_0x8d05('0x20')]:_0x17c4f6[_0x8d05('0x1d')]+_0x17c4f6['limit'];var _0x451025;if(_0x247928>=_0xcef4ad){_0x247928=_0xcef4ad;_0x451025=0xc8;}else{_0x451025=0xce;}_0x469d75[_0x8d05('0x1b')](_0x451025);return _0x469d75[_0x8d05('0x21')](_0x8d05('0x22'),_0x482dd6+'-'+_0x247928+'/'+_0xcef4ad)['json'](_0x3277ce);}return null;};}function patchUpdates(_0x3f6aa9){return function(_0x318285){try{jsonpatch[_0x8d05('0x23')](_0x318285,_0x3f6aa9,!![]);}catch(_0x34146e){return BPromise[_0x8d05('0x24')](_0x34146e);}return _0x318285[_0x8d05('0x25')]();};}function saveUpdates(_0x1dce4d,_0x36e358){return function(_0x46cf94){if(_0x46cf94){return _0x46cf94[_0x8d05('0x26')](_0x1dce4d)[_0x8d05('0x27')](function(_0x478b54){return _0x478b54;});}return null;};}function removeEntity(_0x2d5eb,_0x1198c0){return function(_0x16e15a){if(_0x16e15a){return _0x16e15a[_0x8d05('0x28')]()['then'](function(){_0x2d5eb[_0x8d05('0x1b')](0xcc)[_0x8d05('0x29')]();});}};}function handleEntityNotFound(_0x32326b,_0x14fde0){return function(_0x1cf03c){if(!_0x1cf03c){_0x32326b[_0x8d05('0x1a')](0x194);}return _0x1cf03c;};}function handleError(_0x33bead,_0x559cd7){_0x559cd7=_0x559cd7||0x1f4;return function(_0x5a11de){logger[_0x8d05('0x2a')](_0x5a11de[_0x8d05('0x2b')]);if(_0x5a11de[_0x8d05('0x2c')]){delete _0x5a11de[_0x8d05('0x2c')];}_0x33bead[_0x8d05('0x1b')](_0x559cd7)['send'](_0x5a11de);};}exports[_0x8d05('0x2d')]=function(_0x34325c,_0x3b10ea){var _0xcc0683={},_0x46e448={},_0x23c193={'count':0x0,'rows':[]};var _0x473dc2=_['map'](db['CmCustomField'][_0x8d05('0x2e')],function(_0x1737a0){return{'name':_0x1737a0['fieldName'],'type':_0x1737a0[_0x8d05('0x2f')]['key']};});_0x46e448[_0x8d05('0x30')]=_['differenceBy'](_[_0x8d05('0x31')](_0x473dc2,'name'),['name']);_0x46e448[_0x8d05('0x32')]=_[_0x8d05('0x33')](_0x34325c[_0x8d05('0x32')]);_0x46e448['filters']=_[_0x8d05('0x34')](_0x46e448['model'],_0x46e448['query']);_0xcc0683[_0x8d05('0x35')]=_[_0x8d05('0x34')](_0x46e448[_0x8d05('0x30')],qs[_0x8d05('0x36')](_0x34325c[_0x8d05('0x32')][_0x8d05('0x36')]));_0xcc0683['attributes']=_0xcc0683[_0x8d05('0x35')]['length']?_0xcc0683[_0x8d05('0x35')]:_0x46e448[_0x8d05('0x30')];if(!_0x34325c[_0x8d05('0x32')][_0x8d05('0x37')](_0x8d05('0x38'))){_0xcc0683[_0x8d05('0x1f')]=qs[_0x8d05('0x1f')](_0x34325c[_0x8d05('0x32')]['limit']);_0xcc0683[_0x8d05('0x1d')]=qs[_0x8d05('0x1d')](_0x34325c[_0x8d05('0x32')][_0x8d05('0x1d')]);}_0xcc0683[_0x8d05('0x39')]=qs['sort'](_0x34325c['query'][_0x8d05('0x3a')]);_0xcc0683[_0x8d05('0x3b')]=qs[_0x8d05('0x3c')](_[_0x8d05('0x3d')](_0x34325c[_0x8d05('0x32')],_0x46e448['filters']),_0x473dc2);if(_0x34325c['query'][_0x8d05('0x3e')]){_0xcc0683[_0x8d05('0x3b')]=_['merge'](_0xcc0683[_0x8d05('0x3b')],{'$or':_['map'](_0x473dc2,function(_0x25b367){if(_0x25b367[_0x8d05('0x2f')]!=='VIRTUAL'){var _0x4a5259={};_0x4a5259[_0x25b367[_0x8d05('0x2c')]]={'$like':'%'+_0x34325c[_0x8d05('0x32')]['filter']+'%'};return _0x4a5259;}})});}_0xcc0683=_[_0x8d05('0x3f')]({},_0xcc0683,_0x34325c[_0x8d05('0x40')]);var _0x4dd1d4={'where':_0xcc0683[_0x8d05('0x3b')]};return db['CmCustomField'][_0x8d05('0x20')](_0x4dd1d4)['then'](function(_0x516b64){_0x23c193['count']=_0x516b64;if(_0x34325c[_0x8d05('0x32')][_0x8d05('0x41')]){_0xcc0683[_0x8d05('0x42')]=[{'all':!![]}];}return db[_0x8d05('0x43')][_0x8d05('0x44')](_0xcc0683);})[_0x8d05('0x27')](function(_0x5b70eb){_0x23c193['rows']=_0x5b70eb;return _0x23c193;})[_0x8d05('0x27')](respondWithFilteredResult(_0x3b10ea,_0xcc0683))[_0x8d05('0x45')](handleError(_0x3b10ea,null));};exports[_0x8d05('0x46')]=function(_0x482032,_0xbb2cdc){var _0x37d3b6={'raw':!![],'where':{'id':_0x482032[_0x8d05('0x47')]['id']}},_0x547c7b={};_0x547c7b[_0x8d05('0x30')]=_[_0x8d05('0x33')](db[_0x8d05('0x43')]['rawAttributes']);_0x547c7b[_0x8d05('0x32')]=_[_0x8d05('0x33')](_0x482032[_0x8d05('0x32')]);_0x547c7b[_0x8d05('0x3c')]=_['intersection'](_0x547c7b[_0x8d05('0x30')],_0x547c7b['query']);_0x37d3b6[_0x8d05('0x35')]=_[_0x8d05('0x34')](_0x547c7b[_0x8d05('0x30')],qs[_0x8d05('0x36')](_0x482032['query'][_0x8d05('0x36')]));_0x37d3b6[_0x8d05('0x35')]=_0x37d3b6[_0x8d05('0x35')][_0x8d05('0x48')]?_0x37d3b6['attributes']:_0x547c7b['model'];if(_0x482032[_0x8d05('0x32')][_0x8d05('0x41')]){_0x37d3b6[_0x8d05('0x42')]=[{'all':!![]}];}_0x37d3b6=_[_0x8d05('0x3f')]({},_0x37d3b6,_0x482032[_0x8d05('0x40')]);return db['CmCustomField'][_0x8d05('0x49')](_0x37d3b6)[_0x8d05('0x27')](handleEntityNotFound(_0xbb2cdc,null))[_0x8d05('0x27')](respondWithResult(_0xbb2cdc,null))[_0x8d05('0x45')](handleError(_0xbb2cdc,null));};exports['update']=function(_0x296502,_0x479054){if(_0x296502[_0x8d05('0x4a')]['id']){delete _0x296502[_0x8d05('0x4a')]['id'];}return db['CmCustomField'][_0x8d05('0x49')]({'where':{'id':_0x296502[_0x8d05('0x47')]['id']}})[_0x8d05('0x27')](handleEntityNotFound(_0x479054,null))[_0x8d05('0x27')](saveUpdates(_0x296502['body'],null))[_0x8d05('0x27')](respondWithResult(_0x479054,null))[_0x8d05('0x45')](handleError(_0x479054,null));};exports[_0x8d05('0x28')]=function(_0x599451,_0x44be1f){return db[_0x8d05('0x43')][_0x8d05('0x49')]({'where':{'id':_0x599451[_0x8d05('0x47')]['id']}})[_0x8d05('0x27')](handleEntityNotFound(_0x44be1f,null))[_0x8d05('0x27')](removeEntity(_0x44be1f,null))[_0x8d05('0x45')](handleError(_0x44be1f,null));};exports['create']=function(_0x5e1c54,_0x23e71a){var _0x116a51;return db[_0x8d05('0x4b')][_0x8d05('0x4c')](function(_0x332486){return db['CmCustomField'][_0x8d05('0x4d')](_0x5e1c54[_0x8d05('0x4a')],{'transaction':_0x332486})['then'](function(_0x38e945){_0x116a51=_0x38e945;var _0x28f25a={'type':db[_0x8d05('0x4e')][_0x8d05('0x4f')],'transaction':_0x332486};switch(_0x5e1c54[_0x8d05('0x4a')]['type']){case'text':_0x28f25a['type']=db[_0x8d05('0x4e')][_0x8d05('0x4f')];break;case _0x8d05('0x50'):_0x28f25a[_0x8d05('0x2f')]=db[_0x8d05('0x4e')]['INTEGER'];break;case'switch':_0x28f25a[_0x8d05('0x2f')]=db[_0x8d05('0x4e')][_0x8d05('0x51')];_0x28f25a[_0x8d05('0x52')]=![];break;default:}return db[_0x8d05('0x4b')][_0x8d05('0x53')]['addColumn']('cm_contacts',util[_0x8d05('0x54')](_0x8d05('0x55'),_0x116a51['id']),_0x28f25a);})[_0x8d05('0x27')](function(){return _0x116a51;});})['then'](respondWithResult(_0x23e71a,0xc9))[_0x8d05('0x45')](handleError(_0x23e71a,null));}; \ No newline at end of file +var _0x070a=['name','index','map','CmCustomField','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','limit','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','show','keys','length','find','catch','body','params','create','Sequelize','TEXT','text','number','switch','BOOLEAN','defaultValue','sequelize','queryInterface','cm_contacts','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','set','json','reject','save','then','sendStatus','stack'];(function(_0x5495a0,_0x217a9e){var _0x5d0871=function(_0x4738d6){while(--_0x4738d6){_0x5495a0['push'](_0x5495a0['shift']());}};_0x5d0871(++_0x217a9e);}(_0x070a,0x79));var _0xa070=function(_0x1e9475,_0x13cf56){_0x1e9475=_0x1e9475-0x0;var _0x48d33f=_0x070a[_0x1e9475];return _0x48d33f;};'use strict';var emlformat=require(_0xa070('0x0'));var rimraf=require(_0xa070('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa070('0x2'));var rp=require(_0xa070('0x3'));var moment=require(_0xa070('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa070('0x5'));var util=require(_0xa070('0x6'));var path=require(_0xa070('0x7'));var sox=require(_0xa070('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa070('0x9'));var _=require('lodash');var squel=require(_0xa070('0xa'));var crypto=require(_0xa070('0xb'));var jsforce=require(_0xa070('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa070('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa070('0xe'));var authService=require(_0xa070('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa070('0x10'));var logger=require(_0xa070('0x11'))(_0xa070('0x12'));var utils=require(_0xa070('0x13'));var config=require(_0xa070('0x14'));var licenseUtil=require(_0xa070('0x15'));var db=require(_0xa070('0x16'))['db'];function respondWithStatusCode(_0x556d69,_0x56482d){_0x56482d=_0x56482d||0xcc;return function(_0x246e1c){if(_0x246e1c){return _0x556d69['sendStatus'](_0x56482d);}return _0x556d69[_0xa070('0x17')](_0x56482d)[_0xa070('0x18')]();};}function respondWithResult(_0x4b7c29,_0x3de8ce){_0x3de8ce=_0x3de8ce||0xc8;return function(_0x39b399){if(_0x39b399){return _0x4b7c29['status'](_0x3de8ce)['json'](_0x39b399);}};}function respondWithFilteredResult(_0x1545bf,_0x44d2fa){return function(_0x40578a){if(_0x40578a){var _0x35e829=typeof _0x44d2fa[_0xa070('0x19')]===_0xa070('0x1a')&&typeof _0x44d2fa['limit']==='undefined';var _0x1df3f7=_0x40578a[_0xa070('0x1b')];var _0x3bc25d=_0x35e829?0x0:_0x44d2fa[_0xa070('0x19')];var _0x11e9d9=_0x35e829?_0x40578a[_0xa070('0x1b')]:_0x44d2fa[_0xa070('0x19')]+_0x44d2fa['limit'];var _0x1bad4b;if(_0x11e9d9>=_0x1df3f7){_0x11e9d9=_0x1df3f7;_0x1bad4b=0xc8;}else{_0x1bad4b=0xce;}_0x1545bf['status'](_0x1bad4b);return _0x1545bf[_0xa070('0x1c')]('Content-Range',_0x3bc25d+'-'+_0x11e9d9+'/'+_0x1df3f7)[_0xa070('0x1d')](_0x40578a);}return null;};}function patchUpdates(_0x1b7647){return function(_0x278cfe){try{jsonpatch['apply'](_0x278cfe,_0x1b7647,!![]);}catch(_0x22d749){return BPromise[_0xa070('0x1e')](_0x22d749);}return _0x278cfe[_0xa070('0x1f')]();};}function saveUpdates(_0x4b826b,_0x1f202c){return function(_0x1a8f18){if(_0x1a8f18){return _0x1a8f18['update'](_0x4b826b)[_0xa070('0x20')](function(_0x109900){return _0x109900;});}return null;};}function removeEntity(_0x4cb321,_0x499d77){return function(_0x3be719){if(_0x3be719){return _0x3be719['destroy']()[_0xa070('0x20')](function(){_0x4cb321[_0xa070('0x17')](0xcc)[_0xa070('0x18')]();});}};}function handleEntityNotFound(_0x4af00c,_0x227b43){return function(_0x6c7e55){if(!_0x6c7e55){_0x4af00c[_0xa070('0x21')](0x194);}return _0x6c7e55;};}function handleError(_0x46658f,_0x310f1c){_0x310f1c=_0x310f1c||0x1f4;return function(_0x1e8092){logger['error'](_0x1e8092[_0xa070('0x22')]);if(_0x1e8092['name']){delete _0x1e8092[_0xa070('0x23')];}_0x46658f[_0xa070('0x17')](_0x310f1c)['send'](_0x1e8092);};}exports[_0xa070('0x24')]=function(_0x918952,_0x383cc8){var _0x38357d={},_0x3346dd={},_0x1718be={'count':0x0,'rows':[]};var _0x119150=_[_0xa070('0x25')](db[_0xa070('0x26')][_0xa070('0x27')],function(_0x71ad79){return{'name':_0x71ad79[_0xa070('0x28')],'type':_0x71ad79[_0xa070('0x29')][_0xa070('0x2a')]};});_0x3346dd[_0xa070('0x2b')]=_['differenceBy'](_['map'](_0x119150,_0xa070('0x23')),[_0xa070('0x23')]);_0x3346dd['query']=_['keys'](_0x918952[_0xa070('0x2c')]);_0x3346dd['filters']=_[_0xa070('0x2d')](_0x3346dd[_0xa070('0x2b')],_0x3346dd[_0xa070('0x2c')]);_0x38357d[_0xa070('0x2e')]=_['intersection'](_0x3346dd[_0xa070('0x2b')],qs[_0xa070('0x2f')](_0x918952['query'][_0xa070('0x2f')]));_0x38357d[_0xa070('0x2e')]=_0x38357d[_0xa070('0x2e')]['length']?_0x38357d[_0xa070('0x2e')]:_0x3346dd[_0xa070('0x2b')];if(!_0x918952['query'][_0xa070('0x30')]('nolimit')){_0x38357d[_0xa070('0x31')]=qs[_0xa070('0x31')](_0x918952[_0xa070('0x2c')][_0xa070('0x31')]);_0x38357d['offset']=qs[_0xa070('0x19')](_0x918952['query']['offset']);}_0x38357d['order']=qs[_0xa070('0x32')](_0x918952[_0xa070('0x2c')][_0xa070('0x32')]);_0x38357d[_0xa070('0x33')]=qs[_0xa070('0x34')](_['pick'](_0x918952[_0xa070('0x2c')],_0x3346dd['filters']),_0x119150);if(_0x918952['query'][_0xa070('0x35')]){_0x38357d[_0xa070('0x33')]=_[_0xa070('0x36')](_0x38357d[_0xa070('0x33')],{'$or':_[_0xa070('0x25')](_0x119150,function(_0x59748e){if(_0x59748e['type']!=='VIRTUAL'){var _0x5b8a66={};_0x5b8a66[_0x59748e[_0xa070('0x23')]]={'$like':'%'+_0x918952[_0xa070('0x2c')][_0xa070('0x35')]+'%'};return _0x5b8a66;}})});}_0x38357d=_[_0xa070('0x36')]({},_0x38357d,_0x918952[_0xa070('0x37')]);var _0x4e5994={'where':_0x38357d['where']};return db['CmCustomField'][_0xa070('0x1b')](_0x4e5994)[_0xa070('0x20')](function(_0x55257b){_0x1718be[_0xa070('0x1b')]=_0x55257b;if(_0x918952['query'][_0xa070('0x38')]){_0x38357d[_0xa070('0x39')]=[{'all':!![]}];}return db[_0xa070('0x26')][_0xa070('0x3a')](_0x38357d);})[_0xa070('0x20')](function(_0x469271){_0x1718be[_0xa070('0x3b')]=_0x469271;return _0x1718be;})[_0xa070('0x20')](respondWithFilteredResult(_0x383cc8,_0x38357d))['catch'](handleError(_0x383cc8,null));};exports[_0xa070('0x3c')]=function(_0x3fbbf3,_0xc1e5b5){var _0x30cf19={'raw':!![],'where':{'id':_0x3fbbf3['params']['id']}},_0x53f9f1={};_0x53f9f1[_0xa070('0x2b')]=_[_0xa070('0x3d')](db['CmCustomField'][_0xa070('0x27')]);_0x53f9f1['query']=_[_0xa070('0x3d')](_0x3fbbf3[_0xa070('0x2c')]);_0x53f9f1[_0xa070('0x34')]=_[_0xa070('0x2d')](_0x53f9f1['model'],_0x53f9f1['query']);_0x30cf19['attributes']=_[_0xa070('0x2d')](_0x53f9f1['model'],qs[_0xa070('0x2f')](_0x3fbbf3[_0xa070('0x2c')][_0xa070('0x2f')]));_0x30cf19['attributes']=_0x30cf19['attributes'][_0xa070('0x3e')]?_0x30cf19[_0xa070('0x2e')]:_0x53f9f1['model'];if(_0x3fbbf3['query'][_0xa070('0x38')]){_0x30cf19[_0xa070('0x39')]=[{'all':!![]}];}_0x30cf19=_[_0xa070('0x36')]({},_0x30cf19,_0x3fbbf3[_0xa070('0x37')]);return db[_0xa070('0x26')][_0xa070('0x3f')](_0x30cf19)[_0xa070('0x20')](handleEntityNotFound(_0xc1e5b5,null))[_0xa070('0x20')](respondWithResult(_0xc1e5b5,null))[_0xa070('0x40')](handleError(_0xc1e5b5,null));};exports['update']=function(_0x2dba6c,_0x51a466){if(_0x2dba6c[_0xa070('0x41')]['id']){delete _0x2dba6c[_0xa070('0x41')]['id'];}return db[_0xa070('0x26')][_0xa070('0x3f')]({'where':{'id':_0x2dba6c[_0xa070('0x42')]['id']}})[_0xa070('0x20')](handleEntityNotFound(_0x51a466,null))[_0xa070('0x20')](saveUpdates(_0x2dba6c[_0xa070('0x41')],null))[_0xa070('0x20')](respondWithResult(_0x51a466,null))['catch'](handleError(_0x51a466,null));};exports['destroy']=function(_0x4d7f36,_0x4cfcef){return db['CmCustomField'][_0xa070('0x3f')]({'where':{'id':_0x4d7f36[_0xa070('0x42')]['id']}})[_0xa070('0x20')](handleEntityNotFound(_0x4cfcef,null))['then'](removeEntity(_0x4cfcef,null))['catch'](handleError(_0x4cfcef,null));};exports[_0xa070('0x43')]=function(_0x1da4be,_0x1f4bbe){var _0xc50446;return db['sequelize']['transaction'](function(_0x3b21a7){return db[_0xa070('0x26')]['create'](_0x1da4be[_0xa070('0x41')],{'transaction':_0x3b21a7})['then'](function(_0x3a1d96){_0xc50446=_0x3a1d96;var _0x2c297c={'type':db[_0xa070('0x44')][_0xa070('0x45')],'transaction':_0x3b21a7};switch(_0x1da4be[_0xa070('0x41')][_0xa070('0x29')]){case _0xa070('0x46'):_0x2c297c['type']=db[_0xa070('0x44')][_0xa070('0x45')];break;case _0xa070('0x47'):_0x2c297c['type']=db['Sequelize']['INTEGER'];break;case _0xa070('0x48'):_0x2c297c[_0xa070('0x29')]=db[_0xa070('0x44')][_0xa070('0x49')];_0x2c297c[_0xa070('0x4a')]=![];break;default:}return db[_0xa070('0x4b')][_0xa070('0x4c')]['addColumn'](_0xa070('0x4d'),util['format']('cf_%d',_0xc50446['id']),_0x2c297c);})[_0xa070('0x20')](function(){return _0xc50446;});})[_0xa070('0x20')](respondWithResult(_0x1f4bbe,0xc9))[_0xa070('0x40')](handleError(_0x1f4bbe,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 2c1d95e..85d5c8d 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 _0x6003=['CmCustomField','cm_custom_fields','lodash','api','moment','bluebird','path','rimraf','../../config/environment','./cmCustomField.attributes','define'];(function(_0x519301,_0x18bd1a){var _0x81fb4d=function(_0x3d7fed){while(--_0x3d7fed){_0x519301['push'](_0x519301['shift']());}};_0x81fb4d(++_0x18bd1a);}(_0x6003,0x183));var _0x3600=function(_0x267e6e,_0x3e5029){_0x267e6e=_0x267e6e-0x0;var _0x1474d2=_0x6003[_0x267e6e];return _0x1474d2;};'use strict';var _=require(_0x3600('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3600('0x1'));var moment=require(_0x3600('0x2'));var BPromise=require(_0x3600('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3600('0x4'));var rimraf=require(_0x3600('0x5'));var config=require(_0x3600('0x6'));var attributes=require(_0x3600('0x7'));module['exports']=function(_0x1765f2,_0x252f01){return _0x1765f2[_0x3600('0x8')](_0x3600('0x9'),attributes,{'tableName':_0x3600('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x54d0=['path','rimraf','./cmCustomField.attributes','exports','CmCustomField','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x3002f8,_0x27dff2){var _0x84fd98=function(_0x5c34ce){while(--_0x5c34ce){_0x3002f8['push'](_0x3002f8['shift']());}};_0x84fd98(++_0x27dff2);}(_0x54d0,0xc0));var _0x054d=function(_0x18d50f,_0x124aff){_0x18d50f=_0x18d50f-0x0;var _0x8ce385=_0x54d0[_0x18d50f];return _0x8ce385;};'use strict';var _=require(_0x054d('0x0'));var util=require(_0x054d('0x1'));var logger=require(_0x054d('0x2'))(_0x054d('0x3'));var moment=require('moment');var BPromise=require(_0x054d('0x4'));var rp=require(_0x054d('0x5'));var fs=require('fs');var path=require(_0x054d('0x6'));var rimraf=require(_0x054d('0x7'));var config=require('../../config/environment');var attributes=require(_0x054d('0x8'));module[_0x054d('0x9')]=function(_0x4d8e2b,_0x38bc90){return _0x4d8e2b['define'](_0x054d('0xa'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index f0ab15a..6b31af8 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 _0xcfd5=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','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','util'];(function(_0x2f31b1,_0x17daa8){var _0x448988=function(_0x540f6b){while(--_0x540f6b){_0x2f31b1['push'](_0x2f31b1['shift']());}};_0x448988(++_0x17daa8);}(_0xcfd5,0x77));var _0x5cfd=function(_0x29cc2e,_0x4d03e9){_0x29cc2e=_0x29cc2e-0x0;var _0x387230=_0xcfd5[_0x29cc2e];return _0x387230;};'use strict';var _=require('lodash');var util=require(_0x5cfd('0x0'));var moment=require(_0x5cfd('0x1'));var BPromise=require(_0x5cfd('0x2'));var rs=require(_0x5cfd('0x3'));var fs=require('fs');var Redis=require(_0x5cfd('0x4'));var db=require(_0x5cfd('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5cfd('0x6'))('rpc');var config=require(_0x5cfd('0x7'));var jayson=require(_0x5cfd('0x8'));var client=jayson[_0x5cfd('0x9')][_0x5cfd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5bee20,_0xefe95f,_0xce527c){return new BPromise(function(_0x3c2c3f,_0x2609ca){return client[_0x5cfd('0xb')](_0x5bee20,_0xce527c)[_0x5cfd('0xc')](function(_0xe4b603){logger[_0x5cfd('0xd')](_0x5cfd('0xe'),_0xefe95f,_0x5cfd('0xf'));logger[_0x5cfd('0x10')](_0x5cfd('0x11'),_0xefe95f,_0x5cfd('0xf'),JSON[_0x5cfd('0x12')](_0xe4b603));if(_0xe4b603[_0x5cfd('0x13')]){if(_0xe4b603['error'][_0x5cfd('0x14')]===0x1f4){logger['error']('CmCustomField,\x20%s,\x20%s',_0xefe95f,_0xe4b603['error'][_0x5cfd('0x15')]);return _0x2609ca(_0xe4b603['error']['message']);}logger[_0x5cfd('0x13')]('CmCustomField,\x20%s,\x20%s',_0xefe95f,_0xe4b603[_0x5cfd('0x13')]['message']);return _0x3c2c3f(_0xe4b603['error']['message']);}else{logger[_0x5cfd('0xd')](_0x5cfd('0xe'),_0xefe95f,'request\x20sent');_0x3c2c3f(_0xe4b603[_0x5cfd('0x16')][_0x5cfd('0x15')]);}})[_0x5cfd('0x17')](function(_0x150cfb){logger[_0x5cfd('0x13')]('CmCustomField,\x20%s,\x20%s',_0xefe95f,_0x150cfb);_0x2609ca(_0x150cfb);});});} \ No newline at end of file +var _0x7f3a=['request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x540e28,_0x444d6d){var _0x5011a3=function(_0x1efbe7){while(--_0x1efbe7){_0x540e28['push'](_0x540e28['shift']());}};_0x5011a3(++_0x444d6d);}(_0x7f3a,0x9d));var _0xa7f3=function(_0xff8b6d,_0x12c12c){_0xff8b6d=_0xff8b6d-0x0;var _0x94a6b3=_0x7f3a[_0xff8b6d];return _0x94a6b3;};'use strict';var _=require(_0xa7f3('0x0'));var util=require(_0xa7f3('0x1'));var moment=require(_0xa7f3('0x2'));var BPromise=require(_0xa7f3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa7f3('0x4'));var db=require(_0xa7f3('0x5'))['db'];var utils=require(_0xa7f3('0x6'));var logger=require(_0xa7f3('0x7'))(_0xa7f3('0x8'));var config=require(_0xa7f3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa7f3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d6c9c,_0x91258b,_0x57f22f){return new BPromise(function(_0x5a477e,_0x50f82d){return client[_0xa7f3('0xb')](_0x4d6c9c,_0x57f22f)[_0xa7f3('0xc')](function(_0x59d311){logger[_0xa7f3('0xd')](_0xa7f3('0xe'),_0x91258b,_0xa7f3('0xf'));logger[_0xa7f3('0x10')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x91258b,_0xa7f3('0xf'),JSON[_0xa7f3('0x11')](_0x59d311));if(_0x59d311[_0xa7f3('0x12')]){if(_0x59d311[_0xa7f3('0x12')][_0xa7f3('0x13')]===0x1f4){logger['error'](_0xa7f3('0xe'),_0x91258b,_0x59d311[_0xa7f3('0x12')][_0xa7f3('0x14')]);return _0x50f82d(_0x59d311[_0xa7f3('0x12')][_0xa7f3('0x14')]);}logger['error'](_0xa7f3('0xe'),_0x91258b,_0x59d311[_0xa7f3('0x12')]['message']);return _0x5a477e(_0x59d311[_0xa7f3('0x12')][_0xa7f3('0x14')]);}else{logger[_0xa7f3('0xd')](_0xa7f3('0xe'),_0x91258b,_0xa7f3('0xf'));_0x5a477e(_0x59d311['result'][_0xa7f3('0x14')]);}})['catch'](function(_0x27278c){logger[_0xa7f3('0x12')]('CmCustomField,\x20%s,\x20%s',_0x91258b,_0x27278c);_0x50f82d(_0x27278c);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index d16dbf4..d5c3c48 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 _0x624c=['exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','put','update','destroy'];(function(_0x2346e1,_0x380df8){var _0x59856e=function(_0x5bc0fa){while(--_0x5bc0fa){_0x2346e1['push'](_0x2346e1['shift']());}};_0x59856e(++_0x380df8);}(_0x624c,0x1ee));var _0xc624=function(_0x4b719b,_0x440b42){_0x4b719b=_0x4b719b-0x0;var _0x90fbee=_0x624c[_0x4b719b];return _0x90fbee;};'use strict';var multer=require('multer');var util=require(_0xc624('0x0'));var path=require(_0xc624('0x1'));var timeout=require(_0xc624('0x2'));var express=require(_0xc624('0x3'));var router=express[_0xc624('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc624('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc624('0x6'));var controller=require('./cmCustomField.controller');router[_0xc624('0x7')]('/',auth[_0xc624('0x8')](),controller[_0xc624('0x9')]);router[_0xc624('0x7')](_0xc624('0xa'),auth[_0xc624('0x8')](),controller[_0xc624('0xb')]);router['post']('/',auth[_0xc624('0x8')](),controller[_0xc624('0xc')]);router[_0xc624('0xd')]('/:id',auth[_0xc624('0x8')](),controller[_0xc624('0xe')]);router['delete'](_0xc624('0xa'),auth[_0xc624('0x8')](),controller[_0xc624('0xf')]);module[_0xc624('0x10')]=router; \ No newline at end of file +var _0xe4d4=['isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get'];(function(_0x2136d5,_0x4b0479){var _0x3bee2e=function(_0x119e88){while(--_0x119e88){_0x2136d5['push'](_0x2136d5['shift']());}};_0x3bee2e(++_0x4b0479);}(_0xe4d4,0x184));var _0x4e4d=function(_0x3093ac,_0x4d2dba){_0x3093ac=_0x3093ac-0x0;var _0x2a972b=_0xe4d4[_0x3093ac];return _0x2a972b;};'use strict';var multer=require(_0x4e4d('0x0'));var util=require(_0x4e4d('0x1'));var path=require(_0x4e4d('0x2'));var timeout=require(_0x4e4d('0x3'));var express=require('express');var router=express[_0x4e4d('0x4')]();var fs_extra=require(_0x4e4d('0x5'));var auth=require(_0x4e4d('0x6'));var interaction=require(_0x4e4d('0x7'));var config=require(_0x4e4d('0x8'));var controller=require(_0x4e4d('0x9'));router[_0x4e4d('0xa')]('/',auth[_0x4e4d('0xb')](),controller[_0x4e4d('0xc')]);router[_0x4e4d('0xa')](_0x4e4d('0xd'),auth[_0x4e4d('0xb')](),controller['show']);router[_0x4e4d('0xe')]('/',auth[_0x4e4d('0xb')](),controller[_0x4e4d('0xf')]);router[_0x4e4d('0x10')]('/:id',auth[_0x4e4d('0xb')](),controller[_0x4e4d('0x11')]);router[_0x4e4d('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x4e4d('0x13')]);module[_0x4e4d('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index c9d5c92..e867979 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 _0x1b7d=['YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','sequelize','exports','STRING','BOOLEAN','DATE','format'];(function(_0x14e1cb,_0xd3465e){var _0x18a337=function(_0x3b97f3){while(--_0x3b97f3){_0x14e1cb['push'](_0x14e1cb['shift']());}};_0x18a337(++_0xd3465e);}(_0x1b7d,0x93));var _0xd1b7=function(_0x5aafe6,_0x1fcd3c){_0x5aafe6=_0x5aafe6-0x0;var _0x53fcf2=_0x1b7d[_0x5aafe6];return _0x53fcf2;};'use strict';var moment=require(_0xd1b7('0x0'));var Sequelize=require(_0xd1b7('0x1'));module[_0xd1b7('0x2')]={'phone':{'type':Sequelize[_0xd1b7('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0xd1b7('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xd1b7('0x5')],'defaultValue':moment()[_0xd1b7('0x6')](_0xd1b7('0x7'))},'countbusyretry':{'type':Sequelize[_0xd1b7('0x8')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xd1b7('0x8')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xd1b7('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xd1b7('0x5')]},'priority':{'type':Sequelize[_0xd1b7('0x8')](0x2)[_0xd1b7('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xd1b7('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xd1b7('0x8')],'unique':_0xd1b7('0xa')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xd1b7('0xa')},'UserId':{'type':Sequelize[_0xd1b7('0x8')]},'VoiceQueueId':{'type':Sequelize[_0xd1b7('0x8')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0xd1b7('0x8')]},'countnosuchnumberretry':{'type':Sequelize[_0xd1b7('0x8')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xd1b7('0x8')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xd1b7('0x8')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xd1b7('0x8')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xd1b7('0x3')]},'recallmeNotifiedDate':{'type':Sequelize[_0xd1b7('0x5')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x17d8=['format','INTEGER','STRING','UNSIGNED','contactListQueue','sequelize','exports','BOOLEAN','DATE'];(function(_0x69188b,_0x550923){var _0x3320f4=function(_0x27d05b){while(--_0x27d05b){_0x69188b['push'](_0x69188b['shift']());}};_0x3320f4(++_0x550923);}(_0x17d8,0x1d9));var _0x817d=function(_0x361fb2,_0x1a2411){_0x361fb2=_0x361fb2-0x0;var _0x219f56=_0x17d8[_0x361fb2];return _0x219f56;};'use strict';var moment=require('moment');var Sequelize=require(_0x817d('0x0'));module[_0x817d('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0x817d('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x817d('0x3')],'defaultValue':moment()[_0x817d('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x817d('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x817d('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x817d('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x817d('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x817d('0x6')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x817d('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x817d('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x817d('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x817d('0x8')},'ListId':{'type':Sequelize[_0x817d('0x5')],'unique':'contactListQueue'},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0x817d('0x5')],'unique':_0x817d('0x8')},'CampaignId':{'type':Sequelize[_0x817d('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x817d('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x817d('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x817d('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x817d('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x817d('0x5')],'defaultValue':0x0},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index f386f13..b3fbdaa 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 _0xee24=['phone','LOCK','UPDATE','CmContact','Contact','CmCompany','Company','Queue','dialActive','transaction','findOne','recallme','CmList','List','getOpenContacts','preview','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','getTimezones','timezones','push','utcOffset','getTimezone','lodash','../../components/parsers/qs','api','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','update','then','sendStatus','error','stack','name','send','index','map','CmHopper','rawAttributes','key','query','keys','intersection','filters','concat','$and','$or','$gt','$lt','$eq','$not','$between','$notBetween','$in','$notLike','$iLike','$like','$any','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','createdAt','updatedAt','state','statedesc','campaign','membername','user','UserId','deleted','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','queue','ivr','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','end','getPreview','getVoiceQueues','outbound','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','direction','prev','isEmpty','hopperIds','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat'];(function(_0x1ae267,_0x5b052c){var _0x4b4b8f=function(_0x1c7289){while(--_0x1c7289){_0x1ae267['push'](_0x1ae267['shift']());}};_0x4b4b8f(++_0x5b052c);}(_0xee24,0x1a6));var _0x4ee2=function(_0xcd496b,_0x2f1c5a){_0xcd496b=_0xcd496b-0x0;var _0x3f6160=_0xee24[_0xcd496b];return _0x3f6160;};'use strict';var moment=require('moment');var _=require(_0x4ee2('0x0'));var qs=require(_0x4ee2('0x1'));var logger=require('../../config/logger')(_0x4ee2('0x2'));var shared=require(_0x4ee2('0x3'));var db=require(_0x4ee2('0x4'))['db'];function respondWithResult(_0x34b373,_0x5546e1){_0x5546e1=_0x5546e1||0xc8;return function(_0x1aee89){if(_0x1aee89){return _0x34b373[_0x4ee2('0x5')](_0x5546e1)[_0x4ee2('0x6')](_0x1aee89);}};}function respondWithFilteredResult(_0x1993de,_0x5c778f){return function(_0x2e6e11){if(_0x2e6e11){var _0x319d9d=typeof _0x5c778f[_0x4ee2('0x7')]===_0x4ee2('0x8')&&typeof _0x5c778f[_0x4ee2('0x9')]===_0x4ee2('0x8');var _0x32c572=_0x2e6e11[_0x4ee2('0xa')];var _0x550e8d=_0x319d9d?0x0:_0x5c778f['offset'];var _0xcf0cbb=_0x319d9d?_0x2e6e11[_0x4ee2('0xa')]:_0x5c778f[_0x4ee2('0x7')]+_0x5c778f[_0x4ee2('0x9')];var _0x2363b0;if(_0xcf0cbb>=_0x32c572){_0xcf0cbb=_0x32c572;_0x2363b0=0xc8;}else{_0x2363b0=0xce;}_0x1993de['status'](_0x2363b0);return _0x1993de[_0x4ee2('0xb')](_0x4ee2('0xc'),_0x550e8d+'-'+_0xcf0cbb+'/'+_0x32c572)[_0x4ee2('0x6')](_0x2e6e11);}return null;};}function saveUpdates(_0x322780,_0x51f09d){return function(_0x1f7125){if(_0x1f7125){return _0x1f7125[_0x4ee2('0xd')](_0x322780)[_0x4ee2('0xe')](function(_0x23c1c9){return _0x23c1c9;});}return null;};}function handleEntityNotFound(_0x4f41cb,_0x481181){return function(_0x2357c5){if(!_0x2357c5){_0x4f41cb[_0x4ee2('0xf')](0x194);}return _0x2357c5;};}function handleError(_0x5a3c5c,_0x34dacb){_0x34dacb=_0x34dacb||0x1f4;return function(_0x231d5){logger[_0x4ee2('0x10')](_0x231d5[_0x4ee2('0x11')]);if(_0x231d5[_0x4ee2('0x12')]){delete _0x231d5[_0x4ee2('0x12')];}_0x5a3c5c['status'](_0x34dacb)[_0x4ee2('0x13')](_0x231d5);};}exports[_0x4ee2('0x14')]=function(_0x3d0308,_0x4aba2b){var _0x23df00={},_0xb8e027={},_0x3ba412={'count':0x0,'rows':[]};var _0x93c8a8=_[_0x4ee2('0x15')](db[_0x4ee2('0x16')][_0x4ee2('0x17')],function(_0x1e598f){return{'name':_0x1e598f['fieldName'],'type':_0x1e598f['type'][_0x4ee2('0x18')]};});_0xb8e027['model']=_[_0x4ee2('0x15')](_0x93c8a8,_0x4ee2('0x12'));_0xb8e027[_0x4ee2('0x19')]=_[_0x4ee2('0x1a')](_0x3d0308[_0x4ee2('0x19')]);_0xb8e027['filters']=_[_0x4ee2('0x1b')](_0xb8e027['model'],_0xb8e027[_0x4ee2('0x19')]);_0xb8e027[_0x4ee2('0x1c')]=_[_0x4ee2('0x1d')](_0xb8e027[_0x4ee2('0x1c')],[_0x4ee2('0x1e'),_0x4ee2('0x1f'),_0x4ee2('0x20'),'$gte',_0x4ee2('0x21'),'$lte','$ne',_0x4ee2('0x22'),_0x4ee2('0x23'),_0x4ee2('0x24'),_0x4ee2('0x25'),_0x4ee2('0x26'),'$notIn','$like',_0x4ee2('0x27'),_0x4ee2('0x28'),'$notILike',_0x4ee2('0x29'),'$overlap','$contains','$contained',_0x4ee2('0x2a')]);_0x23df00[_0x4ee2('0x2b')]=_['intersection'](_0xb8e027[_0x4ee2('0x2c')],qs[_0x4ee2('0x2d')](_0x3d0308['query'][_0x4ee2('0x2d')]));_0x23df00['attributes']=_0x23df00[_0x4ee2('0x2b')][_0x4ee2('0x2e')]?_0x23df00[_0x4ee2('0x2b')]:_0xb8e027['model'];if(!_0x3d0308['query'][_0x4ee2('0x2f')](_0x4ee2('0x30'))){_0x23df00[_0x4ee2('0x9')]=qs['limit'](_0x3d0308[_0x4ee2('0x19')][_0x4ee2('0x9')]);_0x23df00[_0x4ee2('0x7')]=qs[_0x4ee2('0x7')](_0x3d0308[_0x4ee2('0x19')][_0x4ee2('0x7')]);}_0x23df00[_0x4ee2('0x31')]=qs[_0x4ee2('0x32')](_0x3d0308[_0x4ee2('0x19')][_0x4ee2('0x32')]);_0x23df00[_0x4ee2('0x33')]=qs[_0x4ee2('0x1c')](_['pick'](_0x3d0308[_0x4ee2('0x19')],_0xb8e027[_0x4ee2('0x1c')]),_0x93c8a8);if(_0x3d0308['query'][_0x4ee2('0x34')]){_0x23df00[_0x4ee2('0x33')]=_[_0x4ee2('0x35')](_0x23df00[_0x4ee2('0x33')],{'$or':_[_0x4ee2('0x15')](_0x93c8a8,function(_0x429a90){if(_0x429a90[_0x4ee2('0x36')]!=='VIRTUAL'){var _0x455258={};_0x455258[_0x429a90[_0x4ee2('0x12')]]={'$like':'%'+_0x3d0308[_0x4ee2('0x19')]['filter']+'%'};return _0x455258;}})});}_0x23df00=_[_0x4ee2('0x35')]({},_0x23df00,_0x3d0308['options']);var _0x1079b6={'where':_0x23df00[_0x4ee2('0x33')]};return db[_0x4ee2('0x16')][_0x4ee2('0xa')](_0x1079b6)[_0x4ee2('0xe')](function(_0x52fa55){_0x3ba412['count']=_0x52fa55;if(_0x3d0308['query'][_0x4ee2('0x37')]){_0x23df00[_0x4ee2('0x38')]=[{'all':!![]}];}return db[_0x4ee2('0x16')][_0x4ee2('0x39')](_0x23df00);})[_0x4ee2('0xe')](function(_0x27c4a3){_0x3ba412[_0x4ee2('0x3a')]=_0x27c4a3;return _0x3ba412;})[_0x4ee2('0xe')](respondWithFilteredResult(_0x4aba2b,_0x23df00))[_0x4ee2('0x3b')](handleError(_0x4aba2b,null));};exports[_0x4ee2('0x3c')]=function(_0x57b506,_0x492595){var _0x2e12f3={'raw':!![],'where':{'id':_0x57b506[_0x4ee2('0x3d')]['id']}},_0x2b54f1={};_0x2b54f1['model']=_[_0x4ee2('0x1a')](db[_0x4ee2('0x16')][_0x4ee2('0x17')]);_0x2b54f1[_0x4ee2('0x19')]=_[_0x4ee2('0x1a')](_0x57b506[_0x4ee2('0x19')]);_0x2b54f1[_0x4ee2('0x1c')]=_[_0x4ee2('0x1b')](_0x2b54f1[_0x4ee2('0x2c')],_0x2b54f1[_0x4ee2('0x19')]);_0x2e12f3['attributes']=_['intersection'](_0x2b54f1[_0x4ee2('0x2c')],qs[_0x4ee2('0x2d')](_0x57b506[_0x4ee2('0x19')]['fields']));_0x2e12f3[_0x4ee2('0x2b')]=_0x2e12f3['attributes'][_0x4ee2('0x2e')]?_0x2e12f3['attributes']:_0x2b54f1[_0x4ee2('0x2c')];if(_0x57b506[_0x4ee2('0x19')][_0x4ee2('0x37')]){_0x2e12f3['include']=[{'all':!![]}];}_0x2e12f3=_[_0x4ee2('0x35')]({},_0x2e12f3,_0x57b506['options']);return db[_0x4ee2('0x16')][_0x4ee2('0x3e')](_0x2e12f3)[_0x4ee2('0xe')](handleEntityNotFound(_0x492595,null))[_0x4ee2('0xe')](respondWithResult(_0x492595,null))['catch'](handleError(_0x492595,null));};exports[_0x4ee2('0x3f')]=function(_0x2ca3c1,_0x4c76ba){return db[_0x4ee2('0x16')]['create'](_0x2ca3c1['body'],{})[_0x4ee2('0xe')](respondWithResult(_0x4c76ba,0xc9))['catch'](handleError(_0x4c76ba,null));};exports[_0x4ee2('0xd')]=function(_0x53635c,_0x3011e4){if(_0x53635c[_0x4ee2('0x40')]['id']){delete _0x53635c[_0x4ee2('0x40')]['id'];}return db['CmHopper'][_0x4ee2('0x3e')]({'where':{'id':_0x53635c[_0x4ee2('0x3d')]['id']}})[_0x4ee2('0xe')](handleEntityNotFound(_0x3011e4,null))[_0x4ee2('0xe')](saveUpdates(_0x53635c[_0x4ee2('0x40')],null))['then'](respondWithResult(_0x3011e4,null))[_0x4ee2('0x3b')](handleError(_0x3011e4,null));};exports[_0x4ee2('0x41')]=function(_0x535c11,_0x4c21f4){return db[_0x4ee2('0x16')]['describe']()[_0x4ee2('0xe')](respondWithResult(_0x4c21f4,null))[_0x4ee2('0x3b')](handleError(_0x4c21f4,null));};exports['destroy']=function(_0x43ca98,_0x2bf21a){var _0x29b3fe;var _0x4ae648=_0x43ca98[_0x4ee2('0x3d')]['id'];return db[_0x4ee2('0x16')]['find']({'where':{'id':_0x43ca98['params']['id']}})['then'](handleEntityNotFound(_0x2bf21a,null))['then'](function(_0x2b053a){if(_0x2b053a){return _0x2b053a[_0x4ee2('0x42')]()['then'](function(_0x1379c0){return _0x1379c0;});}})[_0x4ee2('0xe')](function(_0x391424){_0x29b3fe=_0x391424;if(_0x391424){if(_0x391424[_0x4ee2('0x43')]||_0x391424[_0x4ee2('0x44')]){return db[_0x391424[_0x4ee2('0x43')]?_0x4ee2('0x45'):'Campaign'][_0x4ee2('0x3e')]({'where':{'id':_0x391424['VoiceQueueId']?_0x391424[_0x4ee2('0x43')]:_0x391424[_0x4ee2('0x44')]},'attributes':['id',_0x4ee2('0x12')],'raw':!![]});}}})['then'](function(_0x386a59){var _0x309d65={};if(_0x386a59){_[_0x4ee2('0x35')](_0x309d65,_['omit'](_0x29b3fe['dataValues'],[_0x4ee2('0x46'),_0x4ee2('0x47'),'id']));_0x309d65[_0x4ee2('0x48')]=0x15;_0x309d65[_0x4ee2('0x49')]='deleted';_0x309d65[_0x4ee2('0x4a')]=_0x386a59[_0x4ee2('0x12')];_0x309d65[_0x4ee2('0x4b')]=_0x43ca98[_0x4ee2('0x4c')][_0x4ee2('0x12')];_0x309d65[_0x4ee2('0x4d')]=_0x43ca98[_0x4ee2('0x4c')]['id'];_0x309d65[_0x4ee2('0x4e')]=!![];_0x309d65[_0x4ee2('0x4f')]=moment()[_0x4ee2('0x50')](_0x4ee2('0x51'));_0x309d65[_0x4ee2('0x52')]=_0x29b3fe['phone'];_0x309d65['campaigntype']=_0x29b3fe[_0x4ee2('0x43')]?_0x4ee2('0x53'):_0x4ee2('0x54');return db['CmContact']['find']({'where':{'id':_0x309d65[_0x4ee2('0x55')]},'attributes':[_0x4ee2('0x56'),_0x4ee2('0x57')]})['then'](function(_0x45294c){if(!_[_0x4ee2('0x58')](_0x2bf21a)&&!_[_0x4ee2('0x58')](_0x45294c[_0x4ee2('0x56')])){_0x309d65[_0x4ee2('0x59')]=_0x45294c['firstName'];if(!_['isNil'](_0x45294c[_0x4ee2('0x57')])){_0x309d65[_0x4ee2('0x59')]+='\x20'+_0x45294c['lastName'];}}})[_0x4ee2('0x5a')](function(){return db[_0x4ee2('0x5b')][_0x4ee2('0x3f')](_0x309d65);});}})[_0x4ee2('0xe')](function(_0xc658bd){return db['CmHopperAdditionalPhone'][_0x4ee2('0x42')]({'where':{'CmHopperId':_0x4ae648}});})['then'](function(){return _0x2bf21a[_0x4ee2('0x5')](0xcc)[_0x4ee2('0x5c')]();})['catch'](handleError(_0x2bf21a,null));};exports[_0x4ee2('0x5d')]=function(_0x17b21e,_0x3686e5){var _0x1d6b21=[];return db['CmContact'][_0x4ee2('0x41')]()[_0x4ee2('0xe')](function(_0x49e063){_0x1d6b21=_[_0x4ee2('0x1a')](_0x49e063);return _0x17b21e[_0x4ee2('0x4c')][_0x4ee2('0x5e')]({'where':{'type':_0x4ee2('0x5f'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x4ee2('0x60'),_0x4ee2('0x61')],'raw':!![]});})[_0x4ee2('0xe')](function(_0xb0694a){if(_0xb0694a&&_0xb0694a[_0x4ee2('0x2e')]){return db[_0x4ee2('0x62')]['transaction'](function(_0x211e6d){var _0x19d41b={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x4ee2('0x50')](_0x4ee2('0x51'))},'VoiceQueueId':{'$in':_[_0x4ee2('0x15')](_0xb0694a,'id')},'$or':[{'UserId':null},{'UserId':_0x17b21e[_0x4ee2('0x4c')]['id']}]};var _0x7e3337={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0xb0694a)[_0x4ee2('0x34')](['dialPreviewAutoRecallMe',0x0])['map']('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x17b21e[_0x4ee2('0x4c')]['id']}]};var _0x51106a={'$or':[_0x19d41b,_0x7e3337]};var _0x1ab67c=[];if(_0x17b21e[_0x4ee2('0x40')][_0x4ee2('0x63')]&&_0x17b21e['body']['direction']===_0x4ee2('0x64')){if(!_[_0x4ee2('0x65')](_0x17b21e[_0x4ee2('0x40')][_0x4ee2('0x66')])){_0x51106a['id']={'$in':_0x17b21e[_0x4ee2('0x40')][_0x4ee2('0x66')]};}_0x1ab67c=[['priority',_0x4ee2('0x67')],[_0x4ee2('0x68'),_0xb0694a[0x0][_0x4ee2('0x60')]===_0x4ee2('0x67')?_0x4ee2('0x69'):_0x4ee2('0x67')],db[_0x4ee2('0x62')][_0x4ee2('0x6a')](_0x4ee2('0x6b')),['id','DESC']];}else{if(!_['isEmpty'](_0x17b21e[_0x4ee2('0x40')]['hopperIds'])){_0x51106a['id']={'$notIn':_0x17b21e[_0x4ee2('0x40')]['hopperIds']};}_0x1ab67c=[['priority',_0x4ee2('0x69')],[_0x4ee2('0x68'),_0xb0694a[0x0]['dialOrderByScheduledAt']],db[_0x4ee2('0x62')]['literal'](_0x4ee2('0x6c')),['id',_0x4ee2('0x67')]];}return db[_0x4ee2('0x16')]['findOne']({'attributes':['id',_0x4ee2('0x6d'),_0x4ee2('0x6e'),'recallme'],'where':_0x51106a,'order':_0x1ab67c,'transaction':_0x211e6d,'lock':_0x211e6d[_0x4ee2('0x6f')][_0x4ee2('0x70')],'include':[{'model':db[_0x4ee2('0x71')],'as':_0x4ee2('0x72'),'attributes':_0x1d6b21,'include':[{'model':db[_0x4ee2('0x73')],'as':_0x4ee2('0x74'),'attributes':['id',_0x4ee2('0x12')]}]},{'model':db['CmList'],'as':'List','attributes':['id',_0x4ee2('0x12')]},{'model':db[_0x4ee2('0x45')],'as':_0x4ee2('0x75'),'attributes':['id','name',_0x4ee2('0x76')]}]})[_0x4ee2('0xe')](function(_0x576287){if(_0x576287){return _0x576287['update']({'UserId':_0x17b21e[_0x4ee2('0x4c')]['id']},{'transaction':_0x211e6d});}});});}})['then'](handleEntityNotFound(_0x3686e5,null))[_0x4ee2('0xe')](respondWithResult(_0x3686e5,null))[_0x4ee2('0x3b')](handleError(_0x3686e5,null));};exports['getPreviewRecall']=function(_0x313086,_0x3c3920,_0x147353){var _0x3428e0=[];var _0x2c3b73=_0x313086[_0x4ee2('0x3d')]['id'];var _0x1e093a=_0x313086[_0x4ee2('0x4c')]['id'];return db[_0x4ee2('0x71')][_0x4ee2('0x41')]()[_0x4ee2('0xe')](function(_0x4175a2){_0x3428e0=_[_0x4ee2('0x1a')](_0x4175a2);return db[_0x4ee2('0x62')][_0x4ee2('0x77')](function(_0x421c65){const _0x190a5e={'id':_0x2c3b73};return db[_0x4ee2('0x16')][_0x4ee2('0x78')]({'attributes':['id',_0x4ee2('0x6d'),_0x4ee2('0x79')],'where':_0x190a5e,'transaction':_0x421c65,'lock':_0x421c65[_0x4ee2('0x6f')]['UPDATE'],'include':[{'model':db[_0x4ee2('0x71')],'as':_0x4ee2('0x72'),'attributes':_0x3428e0,'include':[{'model':db[_0x4ee2('0x73')],'as':_0x4ee2('0x74'),'attributes':['id',_0x4ee2('0x12')]}]},{'model':db[_0x4ee2('0x7a')],'as':_0x4ee2('0x7b'),'attributes':['id',_0x4ee2('0x12')]},{'model':db[_0x4ee2('0x45')],'as':_0x4ee2('0x75'),'attributes':['id','name',_0x4ee2('0x76')]}]})[_0x4ee2('0xe')](function(_0x367396){if(_0x367396){return _0x367396['update']({'UserId':_0x1e093a},{'transaction':_0x421c65});}});});})[_0x4ee2('0xe')](handleEntityNotFound(_0x3c3920,null))[_0x4ee2('0xe')](respondWithResult(_0x3c3920,null))[_0x4ee2('0x3b')](handleError(_0x3c3920,null));};exports[_0x4ee2('0x7c')]=function(_0x327543,_0x3eb440){return _0x327543[_0x4ee2('0x4c')][_0x4ee2('0x5e')]({'where':{'type':_0x4ee2('0x5f'),'dialActive':!![],'dialMethod':_0x4ee2('0x7d')},'attributes':['id'],'raw':!![]})[_0x4ee2('0xe')](function(_0x5e3e6d){if(_0x5e3e6d&&_0x5e3e6d[_0x4ee2('0x2e')]){return db[_0x4ee2('0x16')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x4ee2('0x15')](_0x5e3e6d,'id')},'$or':[{'UserId':null},{'UserId':_0x327543[_0x4ee2('0x4c')]['id']}]}});}return 0x0;})[_0x4ee2('0xe')](function(_0x478725){if(!_[_0x4ee2('0x58')](_0x478725)&&_[_0x4ee2('0x7e')](_0x478725)){return _0x3eb440[_0x4ee2('0x5')](0xc8)[_0x4ee2('0x6')]({'contacts':_0x478725});}else{logger[_0x4ee2('0x10')](_0x4ee2('0x7f'),_0x4ee2('0x7c'),0x194,'entity\x20not\x20found');_0x3eb440[_0x4ee2('0xf')](0x194);}})['catch'](handleError(_0x3eb440,null));};exports[_0x4ee2('0x80')]=function(_0x43c331,_0x6b233c){var _0x2575a5=shared[_0x4ee2('0x81')];var _0x2a34c9=[];_[_0x4ee2('0x15')](_0x2575a5,function(_0xa207a5){_0x2a34c9[_0x4ee2('0x82')]({'id':_0xa207a5[_0x4ee2('0x12')],'name':_0xa207a5[_0x4ee2('0x12')],'utcOffset':_0xa207a5[_0x4ee2('0x83')]});});return _0x6b233c[_0x4ee2('0x5')](0xc8)[_0x4ee2('0x6')]({'tz':_0x2a34c9});};exports[_0x4ee2('0x84')]=function(_0x300bf9,_0x43fa53){var _0x5266f3=shared[_0x4ee2('0x81')];var _0x396180={};if(!_[_0x4ee2('0x58')](_0x5266f3[_0x300bf9[_0x4ee2('0x40')]['id']]))_0x396180=_0x5266f3[_0x300bf9[_0x4ee2('0x40')]['id']];return _0x43fa53['status'](0xc8)[_0x4ee2('0x6')](_0x396180);}; \ No newline at end of file +var _0x0b78=['DESC','ASC','findOne','scheduledat','recallme','LOCK','CmCompany','Company','CmList','getPreviewRecall','CmContact','UPDATE','Contact','List','VoiceQueue','Queue','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','push','utcOffset','getTimezone','timezones','moment','lodash','../../config/logger','api','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','update','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','map','query','keys','filters','concat','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$notIn','$like','$iLike','$notILike','$contains','$contained','$any','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','CmHopper','includeAll','include','then','rows','params','find','catch','create','body','describe','destroy','VoiceQueueId','CampaignId','Campaign','omit','dataValues','state','statedesc','deleted','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','ContactId','firstName','lastName','isNil','calleridname','CmHopperFinal','CmHopperAdditionalPhone','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','dialPreviewAutoRecallMe','direction','prev','hopperIds','scheduledAt','literal','isEmpty','priority'];(function(_0x4361b6,_0x414635){var _0x4c6878=function(_0x54cfb6){while(--_0x54cfb6){_0x4361b6['push'](_0x4361b6['shift']());}};_0x4c6878(++_0x414635);}(_0x0b78,0x1ad));var _0x80b7=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x0b78[_0xfae23b];return _0x200640;};'use strict';var moment=require(_0x80b7('0x0'));var _=require(_0x80b7('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x80b7('0x2'))(_0x80b7('0x3'));var shared=require('../../config/environment');var db=require(_0x80b7('0x4'))['db'];function respondWithResult(_0x4ee9b4,_0x6a187e){_0x6a187e=_0x6a187e||0xc8;return function(_0x89d4d7){if(_0x89d4d7){return _0x4ee9b4[_0x80b7('0x5')](_0x6a187e)['json'](_0x89d4d7);}};}function respondWithFilteredResult(_0x49bc7f,_0x167ddd){return function(_0x584401){if(_0x584401){var _0x5e19ef=typeof _0x167ddd[_0x80b7('0x6')]===_0x80b7('0x7')&&typeof _0x167ddd[_0x80b7('0x8')]==='undefined';var _0x74b4a8=_0x584401[_0x80b7('0x9')];var _0x374c52=_0x5e19ef?0x0:_0x167ddd['offset'];var _0x467f38=_0x5e19ef?_0x584401['count']:_0x167ddd[_0x80b7('0x6')]+_0x167ddd[_0x80b7('0x8')];var _0x3b19da;if(_0x467f38>=_0x74b4a8){_0x467f38=_0x74b4a8;_0x3b19da=0xc8;}else{_0x3b19da=0xce;}_0x49bc7f[_0x80b7('0x5')](_0x3b19da);return _0x49bc7f[_0x80b7('0xa')](_0x80b7('0xb'),_0x374c52+'-'+_0x467f38+'/'+_0x74b4a8)[_0x80b7('0xc')](_0x584401);}return null;};}function saveUpdates(_0x145241,_0x323d06){return function(_0x366e34){if(_0x366e34){return _0x366e34[_0x80b7('0xd')](_0x145241)['then'](function(_0x2c2668){return _0x2c2668;});}return null;};}function handleEntityNotFound(_0x401ad3,_0x527c5b){return function(_0x2ee168){if(!_0x2ee168){_0x401ad3[_0x80b7('0xe')](0x194);}return _0x2ee168;};}function handleError(_0x4aaa02,_0x46822c){_0x46822c=_0x46822c||0x1f4;return function(_0x3b6b13){logger[_0x80b7('0xf')](_0x3b6b13[_0x80b7('0x10')]);if(_0x3b6b13[_0x80b7('0x11')]){delete _0x3b6b13[_0x80b7('0x11')];}_0x4aaa02[_0x80b7('0x5')](_0x46822c)[_0x80b7('0x12')](_0x3b6b13);};}exports[_0x80b7('0x13')]=function(_0x34299c,_0x4c12b1){var _0x3bb691={},_0x1d62ed={},_0x205457={'count':0x0,'rows':[]};var _0x125c47=_['map'](db['CmHopper'][_0x80b7('0x14')],function(_0x1e27aa){return{'name':_0x1e27aa[_0x80b7('0x15')],'type':_0x1e27aa[_0x80b7('0x16')]['key']};});_0x1d62ed['model']=_[_0x80b7('0x17')](_0x125c47,_0x80b7('0x11'));_0x1d62ed[_0x80b7('0x18')]=_[_0x80b7('0x19')](_0x34299c['query']);_0x1d62ed[_0x80b7('0x1a')]=_['intersection'](_0x1d62ed['model'],_0x1d62ed[_0x80b7('0x18')]);_0x1d62ed[_0x80b7('0x1a')]=_[_0x80b7('0x1b')](_0x1d62ed[_0x80b7('0x1a')],[_0x80b7('0x1c'),_0x80b7('0x1d'),_0x80b7('0x1e'),_0x80b7('0x1f'),_0x80b7('0x20'),_0x80b7('0x21'),_0x80b7('0x22'),_0x80b7('0x23'),_0x80b7('0x24'),_0x80b7('0x25'),_0x80b7('0x26'),'$in',_0x80b7('0x27'),_0x80b7('0x28'),'$notLike',_0x80b7('0x29'),_0x80b7('0x2a'),_0x80b7('0x28'),'$overlap',_0x80b7('0x2b'),_0x80b7('0x2c'),_0x80b7('0x2d')]);_0x3bb691[_0x80b7('0x2e')]=_[_0x80b7('0x2f')](_0x1d62ed[_0x80b7('0x30')],qs[_0x80b7('0x31')](_0x34299c[_0x80b7('0x18')][_0x80b7('0x31')]));_0x3bb691[_0x80b7('0x2e')]=_0x3bb691[_0x80b7('0x2e')][_0x80b7('0x32')]?_0x3bb691[_0x80b7('0x2e')]:_0x1d62ed['model'];if(!_0x34299c['query'][_0x80b7('0x33')](_0x80b7('0x34'))){_0x3bb691['limit']=qs['limit'](_0x34299c[_0x80b7('0x18')][_0x80b7('0x8')]);_0x3bb691[_0x80b7('0x6')]=qs[_0x80b7('0x6')](_0x34299c[_0x80b7('0x18')][_0x80b7('0x6')]);}_0x3bb691['order']=qs[_0x80b7('0x35')](_0x34299c[_0x80b7('0x18')][_0x80b7('0x35')]);_0x3bb691[_0x80b7('0x36')]=qs['filters'](_[_0x80b7('0x37')](_0x34299c[_0x80b7('0x18')],_0x1d62ed['filters']),_0x125c47);if(_0x34299c[_0x80b7('0x18')][_0x80b7('0x38')]){_0x3bb691[_0x80b7('0x36')]=_[_0x80b7('0x39')](_0x3bb691[_0x80b7('0x36')],{'$or':_[_0x80b7('0x17')](_0x125c47,function(_0x3ff3f9){if(_0x3ff3f9[_0x80b7('0x16')]!=='VIRTUAL'){var _0x5743fa={};_0x5743fa[_0x3ff3f9['name']]={'$like':'%'+_0x34299c[_0x80b7('0x18')][_0x80b7('0x38')]+'%'};return _0x5743fa;}})});}_0x3bb691=_[_0x80b7('0x39')]({},_0x3bb691,_0x34299c[_0x80b7('0x3a')]);var _0x462eb0={'where':_0x3bb691[_0x80b7('0x36')]};return db[_0x80b7('0x3b')][_0x80b7('0x9')](_0x462eb0)['then'](function(_0x2a34eb){_0x205457[_0x80b7('0x9')]=_0x2a34eb;if(_0x34299c[_0x80b7('0x18')][_0x80b7('0x3c')]){_0x3bb691[_0x80b7('0x3d')]=[{'all':!![]}];}return db[_0x80b7('0x3b')]['findAll'](_0x3bb691);})[_0x80b7('0x3e')](function(_0x53f51c){_0x205457[_0x80b7('0x3f')]=_0x53f51c;return _0x205457;})[_0x80b7('0x3e')](respondWithFilteredResult(_0x4c12b1,_0x3bb691))['catch'](handleError(_0x4c12b1,null));};exports['show']=function(_0x823c32,_0x5e21eb){var _0x5c91d8={'raw':!![],'where':{'id':_0x823c32[_0x80b7('0x40')]['id']}},_0x295ca6={};_0x295ca6['model']=_[_0x80b7('0x19')](db[_0x80b7('0x3b')]['rawAttributes']);_0x295ca6['query']=_[_0x80b7('0x19')](_0x823c32[_0x80b7('0x18')]);_0x295ca6[_0x80b7('0x1a')]=_[_0x80b7('0x2f')](_0x295ca6[_0x80b7('0x30')],_0x295ca6[_0x80b7('0x18')]);_0x5c91d8['attributes']=_[_0x80b7('0x2f')](_0x295ca6[_0x80b7('0x30')],qs[_0x80b7('0x31')](_0x823c32[_0x80b7('0x18')]['fields']));_0x5c91d8[_0x80b7('0x2e')]=_0x5c91d8['attributes'][_0x80b7('0x32')]?_0x5c91d8[_0x80b7('0x2e')]:_0x295ca6[_0x80b7('0x30')];if(_0x823c32[_0x80b7('0x18')][_0x80b7('0x3c')]){_0x5c91d8[_0x80b7('0x3d')]=[{'all':!![]}];}_0x5c91d8=_[_0x80b7('0x39')]({},_0x5c91d8,_0x823c32[_0x80b7('0x3a')]);return db[_0x80b7('0x3b')][_0x80b7('0x41')](_0x5c91d8)[_0x80b7('0x3e')](handleEntityNotFound(_0x5e21eb,null))[_0x80b7('0x3e')](respondWithResult(_0x5e21eb,null))[_0x80b7('0x42')](handleError(_0x5e21eb,null));};exports['create']=function(_0x311142,_0x272cad){return db['CmHopper'][_0x80b7('0x43')](_0x311142['body'],{})['then'](respondWithResult(_0x272cad,0xc9))[_0x80b7('0x42')](handleError(_0x272cad,null));};exports['update']=function(_0x50ad92,_0x300bac){if(_0x50ad92[_0x80b7('0x44')]['id']){delete _0x50ad92['body']['id'];}return db[_0x80b7('0x3b')][_0x80b7('0x41')]({'where':{'id':_0x50ad92[_0x80b7('0x40')]['id']}})['then'](handleEntityNotFound(_0x300bac,null))[_0x80b7('0x3e')](saveUpdates(_0x50ad92[_0x80b7('0x44')],null))[_0x80b7('0x3e')](respondWithResult(_0x300bac,null))[_0x80b7('0x42')](handleError(_0x300bac,null));};exports['describe']=function(_0x5dcbcd,_0x5417b9){return db[_0x80b7('0x3b')][_0x80b7('0x45')]()[_0x80b7('0x3e')](respondWithResult(_0x5417b9,null))[_0x80b7('0x42')](handleError(_0x5417b9,null));};exports[_0x80b7('0x46')]=function(_0x44b23d,_0x398925){var _0x557988;var _0x4a6cb5=_0x44b23d['params']['id'];return db[_0x80b7('0x3b')][_0x80b7('0x41')]({'where':{'id':_0x44b23d[_0x80b7('0x40')]['id']}})[_0x80b7('0x3e')](handleEntityNotFound(_0x398925,null))[_0x80b7('0x3e')](function(_0x2da4a1){if(_0x2da4a1){return _0x2da4a1['destroy']()[_0x80b7('0x3e')](function(_0x36e5a5){return _0x36e5a5;});}})['then'](function(_0x12dc7b){_0x557988=_0x12dc7b;if(_0x12dc7b){if(_0x12dc7b[_0x80b7('0x47')]||_0x12dc7b[_0x80b7('0x48')]){return db[_0x12dc7b['VoiceQueueId']?'VoiceQueue':_0x80b7('0x49')][_0x80b7('0x41')]({'where':{'id':_0x12dc7b[_0x80b7('0x47')]?_0x12dc7b[_0x80b7('0x47')]:_0x12dc7b[_0x80b7('0x48')]},'attributes':['id',_0x80b7('0x11')],'raw':!![]});}}})['then'](function(_0x1b81a2){var _0x270386={};if(_0x1b81a2){_[_0x80b7('0x39')](_0x270386,_[_0x80b7('0x4a')](_0x557988[_0x80b7('0x4b')],['createdAt','updatedAt','id']));_0x270386[_0x80b7('0x4c')]=0x15;_0x270386[_0x80b7('0x4d')]=_0x80b7('0x4e');_0x270386['campaign']=_0x1b81a2[_0x80b7('0x11')];_0x270386['membername']=_0x44b23d[_0x80b7('0x4f')][_0x80b7('0x11')];_0x270386[_0x80b7('0x50')]=_0x44b23d[_0x80b7('0x4f')]['id'];_0x270386[_0x80b7('0x4e')]=!![];_0x270386[_0x80b7('0x51')]=moment()[_0x80b7('0x52')](_0x80b7('0x53'));_0x270386[_0x80b7('0x54')]=_0x557988[_0x80b7('0x55')];_0x270386[_0x80b7('0x56')]=_0x557988[_0x80b7('0x47')]?_0x80b7('0x57'):_0x80b7('0x58');return db['CmContact'][_0x80b7('0x41')]({'where':{'id':_0x270386[_0x80b7('0x59')]},'attributes':[_0x80b7('0x5a'),_0x80b7('0x5b')]})[_0x80b7('0x3e')](function(_0x1c009a){if(!_[_0x80b7('0x5c')](_0x398925)&&!_['isNil'](_0x1c009a[_0x80b7('0x5a')])){_0x270386[_0x80b7('0x5d')]=_0x1c009a[_0x80b7('0x5a')];if(!_[_0x80b7('0x5c')](_0x1c009a['lastName'])){_0x270386[_0x80b7('0x5d')]+='\x20'+_0x1c009a[_0x80b7('0x5b')];}}})['finally'](function(){return db[_0x80b7('0x5e')][_0x80b7('0x43')](_0x270386);});}})['then'](function(_0x1a21f4){return db[_0x80b7('0x5f')]['destroy']({'where':{'CmHopperId':_0x4a6cb5}});})['then'](function(){return _0x398925[_0x80b7('0x5')](0xcc)['end']();})[_0x80b7('0x42')](handleError(_0x398925,null));};exports[_0x80b7('0x60')]=function(_0x57d361,_0x1ec5ee){var _0x151939=[];return db['CmContact'][_0x80b7('0x45')]()[_0x80b7('0x3e')](function(_0xb36861){_0x151939=_[_0x80b7('0x19')](_0xb36861);return _0x57d361[_0x80b7('0x4f')][_0x80b7('0x61')]({'where':{'type':_0x80b7('0x62'),'dialActive':!![],'dialMethod':_0x80b7('0x63')},'attributes':['id',_0x80b7('0x64'),'dialPreviewAutoRecallMe'],'raw':!![]});})['then'](function(_0x6d7c1e){if(_0x6d7c1e&&_0x6d7c1e['length']){return db[_0x80b7('0x65')][_0x80b7('0x66')](function(_0x25fc84){var _0x599f17={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x80b7('0x52')](_0x80b7('0x53'))},'VoiceQueueId':{'$in':_['map'](_0x6d7c1e,'id')},'$or':[{'UserId':null},{'UserId':_0x57d361[_0x80b7('0x4f')]['id']}]};var _0x43511d={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x6d7c1e)[_0x80b7('0x38')]([_0x80b7('0x67'),0x0])['map']('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x57d361[_0x80b7('0x4f')]['id']}]};var _0x6fff0c={'$or':[_0x599f17,_0x43511d]};var _0x1b56a9=[];if(_0x57d361['body']['direction']&&_0x57d361[_0x80b7('0x44')][_0x80b7('0x68')]===_0x80b7('0x69')){if(!_['isEmpty'](_0x57d361[_0x80b7('0x44')][_0x80b7('0x6a')])){_0x6fff0c['id']={'$in':_0x57d361[_0x80b7('0x44')][_0x80b7('0x6a')]};}_0x1b56a9=[['priority','ASC'],[_0x80b7('0x6b'),_0x6d7c1e[0x0][_0x80b7('0x64')]==='ASC'?'DESC':'ASC'],db['sequelize'][_0x80b7('0x6c')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id','DESC']];}else{if(!_[_0x80b7('0x6d')](_0x57d361[_0x80b7('0x44')][_0x80b7('0x6a')])){_0x6fff0c['id']={'$notIn':_0x57d361[_0x80b7('0x44')][_0x80b7('0x6a')]};}_0x1b56a9=[[_0x80b7('0x6e'),_0x80b7('0x6f')],[_0x80b7('0x6b'),_0x6d7c1e[0x0][_0x80b7('0x64')]],db['sequelize']['literal']('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x80b7('0x70')]];}return db[_0x80b7('0x3b')][_0x80b7('0x71')]({'attributes':['id',_0x80b7('0x72'),'phone',_0x80b7('0x73')],'where':_0x6fff0c,'order':_0x1b56a9,'transaction':_0x25fc84,'lock':_0x25fc84[_0x80b7('0x74')]['UPDATE'],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_0x151939,'include':[{'model':db[_0x80b7('0x75')],'as':_0x80b7('0x76'),'attributes':['id','name']}]},{'model':db[_0x80b7('0x77')],'as':'List','attributes':['id','name']},{'model':db['VoiceQueue'],'as':'Queue','attributes':['id','name','dialActive']}]})['then'](function(_0x3c1e8e){if(_0x3c1e8e){return _0x3c1e8e['update']({'UserId':_0x57d361[_0x80b7('0x4f')]['id']},{'transaction':_0x25fc84});}});});}})['then'](handleEntityNotFound(_0x1ec5ee,null))[_0x80b7('0x3e')](respondWithResult(_0x1ec5ee,null))[_0x80b7('0x42')](handleError(_0x1ec5ee,null));};exports[_0x80b7('0x78')]=function(_0x485b5e,_0x22083b,_0x37e1c8){var _0x482cfc=[];var _0x190c5a=_0x485b5e[_0x80b7('0x40')]['id'];var _0x5ac51b=_0x485b5e[_0x80b7('0x4f')]['id'];return db[_0x80b7('0x79')][_0x80b7('0x45')]()['then'](function(_0x7a4ddb){_0x482cfc=_['keys'](_0x7a4ddb);return db['sequelize']['transaction'](function(_0x30987d){const _0x531232={'id':_0x190c5a};return db['CmHopper'][_0x80b7('0x71')]({'attributes':['id',_0x80b7('0x72'),_0x80b7('0x73')],'where':_0x531232,'transaction':_0x30987d,'lock':_0x30987d[_0x80b7('0x74')][_0x80b7('0x7a')],'include':[{'model':db[_0x80b7('0x79')],'as':_0x80b7('0x7b'),'attributes':_0x482cfc,'include':[{'model':db[_0x80b7('0x75')],'as':_0x80b7('0x76'),'attributes':['id',_0x80b7('0x11')]}]},{'model':db[_0x80b7('0x77')],'as':_0x80b7('0x7c'),'attributes':['id','name']},{'model':db[_0x80b7('0x7d')],'as':_0x80b7('0x7e'),'attributes':['id',_0x80b7('0x11'),'dialActive']}]})[_0x80b7('0x3e')](function(_0x207335){if(_0x207335){return _0x207335[_0x80b7('0xd')]({'UserId':_0x5ac51b},{'transaction':_0x30987d});}});});})[_0x80b7('0x3e')](handleEntityNotFound(_0x22083b,null))[_0x80b7('0x3e')](respondWithResult(_0x22083b,null))[_0x80b7('0x42')](handleError(_0x22083b,null));};exports[_0x80b7('0x7f')]=function(_0x34aa0f,_0x53ebf4){return _0x34aa0f[_0x80b7('0x4f')][_0x80b7('0x61')]({'where':{'type':_0x80b7('0x62'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})['then'](function(_0xb22b8b){if(_0xb22b8b&&_0xb22b8b[_0x80b7('0x32')]){return db[_0x80b7('0x3b')][_0x80b7('0x9')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x80b7('0x53'))},'VoiceQueueId':{'$in':_[_0x80b7('0x17')](_0xb22b8b,'id')},'$or':[{'UserId':null},{'UserId':_0x34aa0f[_0x80b7('0x4f')]['id']}]}});}return 0x0;})[_0x80b7('0x3e')](function(_0x4c7e27){if(!_[_0x80b7('0x5c')](_0x4c7e27)&&_[_0x80b7('0x80')](_0x4c7e27)){return _0x53ebf4[_0x80b7('0x5')](0xc8)['json']({'contacts':_0x4c7e27});}else{logger[_0x80b7('0xf')](_0x80b7('0x81'),_0x80b7('0x7f'),0x194,_0x80b7('0x82'));_0x53ebf4[_0x80b7('0xe')](0x194);}})[_0x80b7('0x42')](handleError(_0x53ebf4,null));};exports['getTimezones']=function(_0x1a13e2,_0x13524c){var _0x29aade=shared['timezones'];var _0x2396f3=[];_[_0x80b7('0x17')](_0x29aade,function(_0x130acc){_0x2396f3[_0x80b7('0x83')]({'id':_0x130acc[_0x80b7('0x11')],'name':_0x130acc['name'],'utcOffset':_0x130acc[_0x80b7('0x84')]});});return _0x13524c[_0x80b7('0x5')](0xc8)['json']({'tz':_0x2396f3});};exports[_0x80b7('0x85')]=function(_0x5440e4,_0x2fc6e8){var _0x58d164=shared[_0x80b7('0x86')];var _0x2d09a3={};if(!_['isNil'](_0x58d164[_0x5440e4[_0x80b7('0x44')]['id']]))_0x2d09a3=_0x58d164[_0x5440e4[_0x80b7('0x44')]['id']];return _0x2fc6e8[_0x80b7('0x5')](0xc8)[_0x80b7('0xc')](_0x2d09a3);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 790d81c..146c57f 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 _0x1883=['../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x6b0e7c,_0x408fd8){var _0x4504e1=function(_0x44c6ff){while(--_0x44c6ff){_0x6b0e7c['push'](_0x6b0e7c['shift']());}};_0x4504e1(++_0x408fd8);}(_0x1883,0xab));var _0x3188=function(_0x14339c,_0x541121){_0x14339c=_0x14339c-0x0;var _0x100238=_0x1883[_0x14339c];return _0x100238;};'use strict';var _=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var logger=require(_0x3188('0x2'))(_0x3188('0x3'));var moment=require(_0x3188('0x4'));var BPromise=require(_0x3188('0x5'));var rp=require(_0x3188('0x6'));var fs=require('fs');var path=require(_0x3188('0x7'));var rimraf=require(_0x3188('0x8'));var config=require(_0x3188('0x9'));var attributes=require(_0x3188('0xa'));module[_0x3188('0xb')]=function(_0x408ae0,_0x33b62d){return _0x408ae0[_0x3188('0xc')](_0x3188('0xd'),attributes,{'tableName':_0x3188('0xe'),'paranoid':![],'indexes':[{'name':'scheduledat','fields':[_0x3188('0xf')]},{'name':_0x3188('0x10'),'fields':['phone']},{'name':_0x3188('0x11'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file +var _0xfdbd=['path','rimraf','./cmHopper.attributes','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4ce479,_0x64fc6a){var _0x3d142f=function(_0x40f4a5){while(--_0x40f4a5){_0x4ce479['push'](_0x4ce479['shift']());}};_0x3d142f(++_0x64fc6a);}(_0xfdbd,0xf0));var _0xdfdb=function(_0xf2662b,_0x4d8f41){_0xf2662b=_0xf2662b-0x0;var _0x257dc7=_0xfdbd[_0xf2662b];return _0x257dc7;};'use strict';var _=require(_0xdfdb('0x0'));var util=require(_0xdfdb('0x1'));var logger=require(_0xdfdb('0x2'))(_0xdfdb('0x3'));var moment=require(_0xdfdb('0x4'));var BPromise=require(_0xdfdb('0x5'));var rp=require(_0xdfdb('0x6'));var fs=require('fs');var path=require(_0xdfdb('0x7'));var rimraf=require(_0xdfdb('0x8'));var config=require('../../config/environment');var attributes=require(_0xdfdb('0x9'));module['exports']=function(_0x453ef6,_0x41bd5e){return _0x453ef6['define']('CmHopper',attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0xdfdb('0xa'),'fields':[_0xdfdb('0xa')]},{'name':'phone','fields':[_0xdfdb('0xb')]},{'name':_0xdfdb('0xc'),'fields':[_0xdfdb('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 45fdad7..5b0a09c 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 _0xdbeb=['interval','\x20MINUTE','NOW()','voicePause','CmList','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','CmHopper','findAll','options','attributes','include','map','model','then','info','debug','GetCmHopper','stringify','catch','error','message','ShowCmHopper','where','CreateCmHopper','body','raw','update','UpdateCmHopper','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','order','Contact','keys','User','Agent','name','length','UserId','includes','push','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','MoveContactManagedDialer','transaction','CmHopperFinal','create','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetCmHopperPreview','GetContactByPhone','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xdbeb,0x141));var _0xbdbe=function(_0x24de2a,_0x325484){_0x24de2a=_0x24de2a-0x0;var _0xa66cc=_0xdbeb[_0x24de2a];return _0xa66cc;};'use strict';var _=require(_0xbdbe('0x0'));var util=require(_0xbdbe('0x1'));var moment=require(_0xbdbe('0x2'));var BPromise=require(_0xbdbe('0x3'));var db=require(_0xbdbe('0x4'))['db'];var logger=require(_0xbdbe('0x5'))(_0xbdbe('0x6'));exports['GetCmHopper']=function(_0x4719d1){var _0x545d2c=this;return new Promise(function(_0x1e5543,_0x4dba93){return db[_0xbdbe('0x7')][_0xbdbe('0x8')]({'raw':_0x4719d1[_0xbdbe('0x9')]?_0x4719d1[_0xbdbe('0x9')]['raw']===undefined?!![]:![]:!![],'where':_0x4719d1['options']?_0x4719d1['options']['where']||null:null,'attributes':_0x4719d1[_0xbdbe('0x9')]?_0x4719d1[_0xbdbe('0x9')][_0xbdbe('0xa')]||null:null,'limit':_0x4719d1[_0xbdbe('0x9')]?_0x4719d1[_0xbdbe('0x9')]['limit']||null:null,'include':_0x4719d1[_0xbdbe('0x9')]?_0x4719d1[_0xbdbe('0x9')][_0xbdbe('0xb')]?_['map'](_0x4719d1[_0xbdbe('0x9')][_0xbdbe('0xb')],function(_0x204ea3){return{'model':db[_0x204ea3['model']],'as':_0x204ea3['as'],'attributes':_0x204ea3[_0xbdbe('0xa')],'include':_0x204ea3['include']?_[_0xbdbe('0xc')](_0x204ea3[_0xbdbe('0xb')],function(_0x55b2fa){return{'model':db[_0x55b2fa['model']],'as':_0x55b2fa['as'],'attributes':_0x55b2fa[_0xbdbe('0xa')],'include':_0x55b2fa[_0xbdbe('0xb')]?_[_0xbdbe('0xc')](_0x55b2fa[_0xbdbe('0xb')],function(_0x29c733){return{'model':db[_0x29c733[_0xbdbe('0xd')]],'as':_0x29c733['as'],'attributes':_0x29c733[_0xbdbe('0xa')]};}):[]};}):[]};}):[]:[]})[_0xbdbe('0xe')](function(_0x545f36){logger[_0xbdbe('0xf')]('GetCmHopper',_0x4719d1);logger[_0xbdbe('0x10')](_0xbdbe('0x11'),_0x4719d1,JSON[_0xbdbe('0x12')](_0x545f36));_0x1e5543(_0x545f36);})[_0xbdbe('0x13')](function(_0x87471b){logger[_0xbdbe('0x14')](_0xbdbe('0x11'),_0x87471b['message'],_0x4719d1);_0x4dba93(_0x545d2c[_0xbdbe('0x14')](0x1f4,_0x87471b[_0xbdbe('0x15')]));});});};exports[_0xbdbe('0x16')]=function(_0x1203aa){var _0xd5fa02=this;return new Promise(function(_0x4830ab,_0x106496){return db[_0xbdbe('0x7')]['find']({'raw':_0x1203aa['options']?_0x1203aa[_0xbdbe('0x9')]['raw']===undefined?!![]:![]:!![],'where':_0x1203aa[_0xbdbe('0x9')]?_0x1203aa[_0xbdbe('0x9')][_0xbdbe('0x17')]||null:null,'attributes':_0x1203aa[_0xbdbe('0x9')]?_0x1203aa[_0xbdbe('0x9')][_0xbdbe('0xa')]||null:null,'include':_0x1203aa['options']?_0x1203aa[_0xbdbe('0x9')][_0xbdbe('0xb')]?_['map'](_0x1203aa[_0xbdbe('0x9')][_0xbdbe('0xb')],function(_0x873d6){return{'model':db[_0x873d6['model']],'as':_0x873d6['as'],'attributes':_0x873d6['attributes'],'include':_0x873d6[_0xbdbe('0xb')]?_[_0xbdbe('0xc')](_0x873d6['include'],function(_0x4bf934){return{'model':db[_0x4bf934[_0xbdbe('0xd')]],'as':_0x4bf934['as'],'attributes':_0x4bf934['attributes'],'include':_0x4bf934[_0xbdbe('0xb')]?_['map'](_0x4bf934[_0xbdbe('0xb')],function(_0x1f5d3d){return{'model':db[_0x1f5d3d[_0xbdbe('0xd')]],'as':_0x1f5d3d['as'],'attributes':_0x1f5d3d[_0xbdbe('0xa')]};}):[]};}):[]};}):[]:[]})[_0xbdbe('0xe')](function(_0x1db2ce){logger['info'](_0xbdbe('0x16'),_0x1203aa);logger[_0xbdbe('0x10')]('ShowCmHopper',_0x1203aa,JSON[_0xbdbe('0x12')](_0x1db2ce));_0x4830ab(_0x1db2ce);})[_0xbdbe('0x13')](function(_0x4a8eea){logger[_0xbdbe('0x14')](_0xbdbe('0x16'),_0x4a8eea[_0xbdbe('0x15')],_0x1203aa);_0x106496(_0xd5fa02[_0xbdbe('0x14')](0x1f4,_0x4a8eea[_0xbdbe('0x15')]));});});};exports[_0xbdbe('0x18')]=function(_0x4217b5){var _0x59484a=this;return new Promise(function(_0x26c6a4,_0x1a9f0e){return db[_0xbdbe('0x7')]['create'](_0x4217b5[_0xbdbe('0x19')],{'raw':_0x4217b5[_0xbdbe('0x9')]?_0x4217b5[_0xbdbe('0x9')][_0xbdbe('0x1a')]===undefined?!![]:![]:!![]})[_0xbdbe('0xe')](function(_0x1ed2f7){logger[_0xbdbe('0xf')](_0xbdbe('0x18'),_0x4217b5);logger[_0xbdbe('0x10')](_0xbdbe('0x18'),_0x4217b5,JSON[_0xbdbe('0x12')](_0x1ed2f7));_0x26c6a4(_0x1ed2f7);})[_0xbdbe('0x13')](function(_0x4bae59){logger[_0xbdbe('0x14')](_0xbdbe('0x18'),_0x4bae59[_0xbdbe('0x15')],_0x4217b5);_0x1a9f0e(_0x59484a[_0xbdbe('0x14')](0x1f4,_0x4bae59[_0xbdbe('0x15')]));});});};exports['UpdateCmHopper']=function(_0x13dc20){var _0x23798e=this;return new Promise(function(_0x5e4de4,_0x4fd53d){return db['CmHopper'][_0xbdbe('0x1b')](_0x13dc20[_0xbdbe('0x19')],{'raw':_0x13dc20['options']?_0x13dc20[_0xbdbe('0x9')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x13dc20['options']?_0x13dc20[_0xbdbe('0x9')][_0xbdbe('0x17')]||null:null,'attributes':_0x13dc20[_0xbdbe('0x9')]?_0x13dc20['options'][_0xbdbe('0xa')]||null:null,'limit':_0x13dc20[_0xbdbe('0x9')]?_0x13dc20['options']['limit']||null:null})[_0xbdbe('0xe')](function(_0xad881){logger[_0xbdbe('0xf')](_0xbdbe('0x1c'),_0x13dc20);logger[_0xbdbe('0xf')](_0xbdbe('0x1d'),JSON[_0xbdbe('0x12')](_0x13dc20[_0xbdbe('0x9')][_0xbdbe('0x17')]),_0x13dc20['body'][_0xbdbe('0x1e')]);logger[_0xbdbe('0x10')](_0xbdbe('0x1c'),_0x13dc20,JSON[_0xbdbe('0x12')](_0xad881));_0x5e4de4(_0xad881);})[_0xbdbe('0x13')](function(_0x1ae719){logger[_0xbdbe('0x14')]('UpdateCmHopper',_0x1ae719[_0xbdbe('0x15')],_0x13dc20);_0x4fd53d(_0x23798e[_0xbdbe('0x14')](0x1f4,_0x1ae719[_0xbdbe('0x15')]));});});};exports[_0xbdbe('0x1f')]=function(_0x190c6e){var _0x391c64=this;return new Promise(function(_0x1a8212,_0x59ec64){return db[_0xbdbe('0x7')][_0xbdbe('0x20')]({'where':_0x190c6e[_0xbdbe('0x9')]?_0x190c6e[_0xbdbe('0x9')][_0xbdbe('0x17')]||null:null})[_0xbdbe('0xe')](function(_0x4b8f6c){logger[_0xbdbe('0xf')](_0xbdbe('0x1f'),_0x190c6e);logger[_0xbdbe('0x10')]('DestroyCmHopper',_0x190c6e,JSON[_0xbdbe('0x12')](_0x4b8f6c));_0x1a8212(_0x4b8f6c);})[_0xbdbe('0x13')](function(_0x5d2703){logger['error'](_0xbdbe('0x1f'),_0x5d2703[_0xbdbe('0x15')],_0x190c6e);_0x59ec64(_0x391c64['error'](0x1f4,_0x5d2703[_0xbdbe('0x15')]));});});};exports[_0xbdbe('0x21')]=function(_0x23f598){var _0x285154=this;return new Promise(function(_0x1f6142,_0x2fa201){return db[_0xbdbe('0x22')][_0xbdbe('0x23')]()[_0xbdbe('0xe')](function(_0x1e18b9){return db[_0xbdbe('0x24')]['transaction'](function(_0x56de2d){return db[_0xbdbe('0x7')][_0xbdbe('0x8')]({'where':_0x23f598['options']?_0x23f598[_0xbdbe('0x9')]['where']||null:null,'attributes':_0x23f598[_0xbdbe('0x9')]?_0x23f598['options'][_0xbdbe('0xa')]||null:null,'limit':_0x23f598[_0xbdbe('0x9')]?_0x23f598[_0xbdbe('0x9')]['limit']||null:null,'order':_0x23f598[_0xbdbe('0x9')]?_0x23f598[_0xbdbe('0x9')][_0xbdbe('0x25')]||null:null,'transaction':_0x56de2d,'lock':_0x56de2d['LOCK']['UPDATE'],'include':[{'model':db[_0xbdbe('0x22')],'as':_0xbdbe('0x26'),'attributes':_[_0xbdbe('0x27')](_0x1e18b9)},{'model':db[_0xbdbe('0x28')],'as':_0xbdbe('0x29'),'attributes':['id',_0xbdbe('0x2a'),'voicePause']}]})[_0xbdbe('0xe')](function(_0x1825d6){var _0x171ea7=[];var _0x1ee900=[];for(var _0xc2b29d=0x0;_0xc2b29d<_0x1825d6[_0xbdbe('0x2b')];_0xc2b29d+=0x1){var _0x599cdf=_0x1825d6[_0xc2b29d][_0xbdbe('0x2c')];if(_0x599cdf===null){_0x171ea7['push'](_0x1825d6[_0xc2b29d][_0xbdbe('0x1b')](_0x23f598[_0xbdbe('0x19')],{'transaction':_0x56de2d}));}else if(!_0x1ee900[_0xbdbe('0x2d')](_0x599cdf)){_0x1ee900[_0xbdbe('0x2e')](_0x599cdf);_0x171ea7['push'](_0x1825d6[_0xc2b29d][_0xbdbe('0x1b')](_0x23f598[_0xbdbe('0x19')],{'transaction':_0x56de2d}));}}return BPromise[_0xbdbe('0x2f')](_0x171ea7);});})[_0xbdbe('0xe')](function(_0x23749c){logger[_0xbdbe('0xf')]('GetContactDialer',_0x23f598);if(_0x23749c['length']>0x0){logger[_0xbdbe('0xf')](_0xbdbe('0x30'),_0x23749c[0x0][_0xbdbe('0x31')]['id'],_0x23749c[0x0][_0xbdbe('0x31')]['ContactId'],_0x23749c[0x0][_0xbdbe('0x31')][_0xbdbe('0x1e')]);}logger['debug'](_0xbdbe('0x21'),_0x23f598,JSON[_0xbdbe('0x12')](_0x23749c));_0x1f6142(_0x23749c);})[_0xbdbe('0x13')](function(_0x5691b9){logger[_0xbdbe('0x14')](_0xbdbe('0x21'),_0x5691b9[_0xbdbe('0x15')],_0x23f598);_0x2fa201(_0x285154[_0xbdbe('0x14')](0x1f4,_0x5691b9[_0xbdbe('0x15')]));});});});};exports[_0xbdbe('0x32')]=function(_0xda8585){var _0x3aa773=this;return new Promise(function(_0x18a825,_0x56c798){return db[_0xbdbe('0x24')][_0xbdbe('0x33')](function(_0x18f3bc){return db[_0xbdbe('0x34')][_0xbdbe('0x35')](_0xda8585[_0xbdbe('0x19')],{'raw':_0xda8585[_0xbdbe('0x9')]?_0xda8585['options'][_0xbdbe('0x1a')]===undefined?!![]:![]:!![],'transaction':_0x18f3bc})['then'](function(){logger[_0xbdbe('0xf')](_0xbdbe('0x36'),JSON[_0xbdbe('0x12')](_0xda8585[_0xbdbe('0x9')][_0xbdbe('0x17')]),_0xda8585[_0xbdbe('0x9')][_0xbdbe('0x17')]['active']);return db[_0xbdbe('0x7')]['destroy']({'where':_0xda8585['options']?_0xda8585[_0xbdbe('0x9')][_0xbdbe('0x17')]||null:null,'transaction':_0x18f3bc});});})['then'](function(_0x22275c){logger[_0xbdbe('0xf')](_0xbdbe('0x32'),_0xda8585);logger[_0xbdbe('0x10')](_0xbdbe('0x32'),_0xda8585,JSON[_0xbdbe('0x12')](_0x22275c));_0x18a825(_0x22275c);})['catch'](function(_0x1dd6bb){logger[_0xbdbe('0x14')](_0xbdbe('0x32'),_0x1dd6bb[_0xbdbe('0x15')],_0xda8585);_0x56c798(_0x3aa773[_0xbdbe('0x14')](0x1f4,_0x1dd6bb[_0xbdbe('0x15')]));});});};exports[_0xbdbe('0x37')]=function(_0x54638c){var _0x152d01=this;return new Promise(function(_0x4a823e,_0x13c10c){return db[_0xbdbe('0x7')][_0xbdbe('0x8')]({'raw':_0x54638c[_0xbdbe('0x9')]?_0x54638c[_0xbdbe('0x9')][_0xbdbe('0x1a')]===undefined?!![]:![]:!![],'where':_0x54638c[_0xbdbe('0x9')]?_0x54638c[_0xbdbe('0x9')][_0xbdbe('0x17')]||null:null,'attributes':[[db[_0xbdbe('0x24')]['fn'](_0xbdbe('0x38'),db[_0xbdbe('0x24')]['fn']('IF',db[_0xbdbe('0x24')][_0xbdbe('0x39')](_0xbdbe('0x3a')+util[_0xbdbe('0x3b')](_0xbdbe('0x3c'),moment()[_0xbdbe('0x3b')](_0xbdbe('0x3d')))+_0xbdbe('0x3e')))),_0xbdbe('0x3f')]]})[_0xbdbe('0xe')](function(_0x5887af){logger[_0xbdbe('0xf')](_0xbdbe('0x37'),_0x54638c);logger[_0xbdbe('0x10')](_0xbdbe('0x37'),_0x54638c,JSON[_0xbdbe('0x12')](_0x5887af));_0x4a823e(_0x5887af);})[_0xbdbe('0x13')](function(_0x1ecdea){logger['error'](_0xbdbe('0x37'),_0x1ecdea[_0xbdbe('0x15')],_0x54638c);_0x13c10c(_0x152d01[_0xbdbe('0x14')](0x1f4,_0x1ecdea[_0xbdbe('0x15')]));});});};exports['GetContactRecallMe']=function(_0x340093){var _0x3bc1c8=this;return new Promise(function(_0x11431f,_0x5a9815){return db[_0xbdbe('0x22')]['describe']()[_0xbdbe('0xe')](function(){return db[_0xbdbe('0x24')][_0xbdbe('0x33')](function(_0xf2f5ca){return db['CmHopper'][_0xbdbe('0x8')]({'where':_0x340093[_0xbdbe('0x9')]?_0x340093['options']['where']||null:null,'attributes':_0x340093['options']?_0x340093[_0xbdbe('0x9')][_0xbdbe('0xa')]||null:null,'limit':0x1,'order':_0x340093['options']?_0x340093[_0xbdbe('0x9')]['order']||null:null,'group':db[_0xbdbe('0x7')]['UserId'],'transaction':_0xf2f5ca,'lock':_0xf2f5ca['LOCK']['UPDATE'],'include':_0x340093['options']?_0x340093[_0xbdbe('0x9')]['include']?_['map'](_0x340093[_0xbdbe('0x9')]['include'],function(_0x3fa3b1){return{'model':db[_0x3fa3b1[_0xbdbe('0xd')]],'as':_0x3fa3b1['as'],'attributes':_0x3fa3b1[_0xbdbe('0xa')],'include':_0x3fa3b1[_0xbdbe('0xb')]?_[_0xbdbe('0xc')](_0x3fa3b1['include'],function(_0x492f54){return{'model':db[_0x492f54[_0xbdbe('0xd')]],'as':_0x492f54['as'],'attributes':_0x492f54[_0xbdbe('0xa')],'include':_0x492f54[_0xbdbe('0xb')]?_[_0xbdbe('0xc')](_0x492f54[_0xbdbe('0xb')],function(_0x3aa0cc){return{'model':db[_0x3aa0cc[_0xbdbe('0xd')]],'as':_0x3aa0cc['as'],'attributes':_0x3aa0cc[_0xbdbe('0xa')]};}):[]};}):[]};}):[]:[]})[_0xbdbe('0xe')](function(_0x4abdca){var _0xde64ea=[];for(var _0x7bbbef=0x0;_0x7bbbef<_0x4abdca[_0xbdbe('0x2b')];_0x7bbbef+=0x1){_0xde64ea[_0xbdbe('0x2e')](_0x4abdca[_0x7bbbef][_0xbdbe('0x1b')](_0x340093['body'],{'transaction':_0xf2f5ca}));}return BPromise[_0xbdbe('0x2f')](_0xde64ea);});})['then'](function(_0x3508e0){logger[_0xbdbe('0xf')]('GetContactRecallMe',_0x340093);logger[_0xbdbe('0x10')]('GetContactRecallMe',_0x340093,JSON['stringify'](_0x3508e0));_0x11431f(_0x3508e0);})[_0xbdbe('0x13')](function(_0x46fdb1){logger[_0xbdbe('0x14')]('GetContactRecallMe',_0x46fdb1[_0xbdbe('0x15')],_0x340093);_0x5a9815(_0x3bc1c8[_0xbdbe('0x14')](0x1f4,_0x46fdb1[_0xbdbe('0x15')]));});});});};exports[_0xbdbe('0x40')]=function(_0x472306){var _0xa056d2=this;return new Promise(function(_0x13bb8a,_0x2205b9){db['CmContact'][_0xbdbe('0x23')]()['then'](function(_0x5b74b1){return db[_0xbdbe('0x7')][_0xbdbe('0x8')]({'raw':_0x472306[_0xbdbe('0x9')]?_0x472306[_0xbdbe('0x9')][_0xbdbe('0x1a')]===undefined?!![]:![]:!![],'where':_0x472306['options']?_0x472306[_0xbdbe('0x9')][_0xbdbe('0x17')]||null:null,'attributes':_0x472306[_0xbdbe('0x9')]?_0x472306[_0xbdbe('0x9')][_0xbdbe('0xa')]||null:null,'limit':_0x472306['options']?_0x472306['options']['limit']||null:null,'include':_0x472306[_0xbdbe('0x9')]?_0x472306['options'][_0xbdbe('0xb')]?_[_0xbdbe('0xc')](_0x472306[_0xbdbe('0x9')][_0xbdbe('0xb')],function(_0x21942a){return{'model':db[_0x21942a[_0xbdbe('0xd')]],'as':_0x21942a['as'],'attributes':_0x21942a['as']===_0xbdbe('0x26')?_['keys'](_0x5b74b1):_0x21942a[_0xbdbe('0xa')],'include':_0x21942a[_0xbdbe('0xb')]?_[_0xbdbe('0xc')](_0x21942a[_0xbdbe('0xb')],function(_0x3bb226){return{'model':db[_0x3bb226[_0xbdbe('0xd')]],'as':_0x3bb226['as'],'attributes':_0x3bb226[_0xbdbe('0xa')],'include':_0x3bb226[_0xbdbe('0xb')]?_[_0xbdbe('0xc')](_0x3bb226[_0xbdbe('0xb')],function(_0x43ebea){return{'model':db[_0x43ebea['model']],'as':_0x43ebea['as'],'attributes':_0x43ebea['attributes']};}):[]};}):[]};}):[]:[]})[_0xbdbe('0xe')](function(_0x1f52a3){logger[_0xbdbe('0xf')]('GetCmHopper',_0x472306);logger[_0xbdbe('0x10')](_0xbdbe('0x11'),_0x472306,JSON[_0xbdbe('0x12')](_0x1f52a3));_0x13bb8a(_0x1f52a3);})['catch'](function(_0x1f9790){logger[_0xbdbe('0x14')](_0xbdbe('0x11'),_0x1f9790[_0xbdbe('0x15')],_0x472306);_0x2205b9(_0xa056d2[_0xbdbe('0x14')](0x1f4,_0x1f9790['message']));});});});};exports[_0xbdbe('0x41')]=function(_0x36eda4){var _0x388bae=this;return new Promise(function(_0x484467,_0x49e9fc){return db[_0xbdbe('0x22')][_0xbdbe('0x42')]({'raw':!![],'where':{'phone':_0x36eda4[_0xbdbe('0x9')]['where'][_0xbdbe('0x43')]},'attributes':['id',_0xbdbe('0x44')],'order':[['id',_0xbdbe('0x45')]]})['then'](function(_0x4020ca){logger[_0xbdbe('0xf')](_0xbdbe('0x46'),_0x36eda4);logger[_0xbdbe('0x10')](_0xbdbe('0x46'),_0x36eda4,JSON[_0xbdbe('0x12')](_0x4020ca));_0x484467(_0x4020ca);})[_0xbdbe('0x13')](function(_0x2c6a16){logger[_0xbdbe('0x14')](_0xbdbe('0x46'),_0x2c6a16[_0xbdbe('0x15')],_0x36eda4);_0x49e9fc(_0x388bae[_0xbdbe('0x14')](0x1f4,_0x2c6a16[_0xbdbe('0x15')]));});});};exports[_0xbdbe('0x47')]=function(_0x2767c8){var _0x11627c=this;return new Promise(function(_0x29e072,_0x54af58){return db[_0xbdbe('0x24')][_0xbdbe('0x33')](function(_0x3767db){var _0x1db137=_0x2767c8[_0xbdbe('0x9')]&&_0x2767c8['options']['where']?_0x2767c8['options'][_0xbdbe('0x17')]:{};return db[_0xbdbe('0x7')]['update'](_0x2767c8[_0xbdbe('0x19')],{'where':_0x1db137,'transaction':_0x3767db})['then'](function(_0x2b2b11){logger[_0xbdbe('0xf')](_0xbdbe('0x47'),_0x2767c8);logger[_0xbdbe('0x10')](_0xbdbe('0x47'),_0x2767c8,JSON[_0xbdbe('0x12')](_0x2b2b11));_0x29e072(_0x2b2b11);})['catch'](function(_0x362d18){logger['error'](_0xbdbe('0x47'),_0x362d18['message'],_0x2767c8);_0x54af58(_0x11627c[_0xbdbe('0x14')](0x1f4,_0x362d18[_0xbdbe('0x15')]));});});});};exports[_0xbdbe('0x48')]=function(_0x27f00b){var _0xddd494=this;var _0x22a9fe=_0x27f00b['body'][_0xbdbe('0x17')][_0xbdbe('0x49')];var _0x4d4dbc=_0x27f00b['body'][_0xbdbe('0x17')][_0xbdbe('0x4a')];var _0x55d9ae=_0x27f00b['body'][_0xbdbe('0x17')]['availableAgentsIds'];return new Promise(function(_0x26aa67,_0x5e638b){return db[_0xbdbe('0x7')][_0xbdbe('0x8')]({'where':{'voiceQueueId':{'$in':_0x22a9fe},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xbdbe('0x24')][_0xbdbe('0x39')]('NOW()\x20+\x20INTERVAL\x20'+_0x4d4dbc+_0xbdbe('0x4b')),'$gt':db[_0xbdbe('0x24')][_0xbdbe('0x39')](_0xbdbe('0x4c'))}},'UserId':{'$in':_0x55d9ae}},'include':[{'model':db['CmContact'],'as':_0xbdbe('0x26')},{'model':db[_0xbdbe('0x28')],'as':_0xbdbe('0x29'),'attributes':['id','name',_0xbdbe('0x4d')]},{'model':db[_0xbdbe('0x4e')],'as':'List'}]})[_0xbdbe('0xe')](function(_0x1629c9){if(_0x1629c9[_0xbdbe('0x2b')]>0x0){return db[_0xbdbe('0x24')][_0xbdbe('0x33')](function(_0x2dd637){return db[_0xbdbe('0x7')]['update']({'recallmeNotifiedDate':db[_0xbdbe('0x24')]['literal']('NOW()')},{'where':{'id':{'$in':_['map'](_0x1629c9,'id')}},'transaction':_0x2dd637})['then'](function(){_0x26aa67(_0x1629c9);})[_0xbdbe('0x13')](function(_0x3b64eb){logger['error']('CmHopperHandlePreviewRecallNotifications',_0x3b64eb[_0xbdbe('0x15')],_0x27f00b);_0x5e638b(_0xddd494[_0xbdbe('0x14')](0x1f4,_0x3b64eb[_0xbdbe('0x15')]));});})['catch'](function(_0x5cbd2c){logger[_0xbdbe('0x14')]('CmHopperHandlePreviewRecallNotifications',_0x5cbd2c[_0xbdbe('0x15')],_0x27f00b);_0x5e638b(_0xddd494[_0xbdbe('0x14')](0x1f4,_0x5cbd2c['message']));});}else{_0x26aa67(_0x1629c9);}});});}; \ No newline at end of file +var _0xbba0=['transaction','order','UPDATE','keys','User','Agent','voicePause','length','UserId','push','update','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','CmHopperFinal','MoveContactManagedDialer','CountReScheduled','sequelize','COUNT','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','contactsRescheduled','GetContactRecallMe','describe','LOCK','GetContactByPhone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','literal','\x20MINUTE','name','CmList','List','NOW()','util','moment','bluebird','../../mysqldb','../../config/logger','GetCmHopper','CmHopper','findAll','raw','options','where','attributes','limit','map','model','include','then','catch','error','message','ShowCmHopper','find','info','CreateCmHopper','create','body','debug','UpdateCmHopper','stringify','active','DestroyCmHopper','destroy','GetContactDialer','CmContact'];(function(_0x1ea015,_0x5e416a){var _0x5ed37f=function(_0x50fae6){while(--_0x50fae6){_0x1ea015['push'](_0x1ea015['shift']());}};_0x5ed37f(++_0x5e416a);}(_0xbba0,0x7a));var _0x0bba=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xbba0[_0x173441];return _0x2423a8;};'use strict';var _=require('lodash');var util=require(_0x0bba('0x0'));var moment=require(_0x0bba('0x1'));var BPromise=require(_0x0bba('0x2'));var db=require(_0x0bba('0x3'))['db'];var logger=require(_0x0bba('0x4'))('rpc');exports[_0x0bba('0x5')]=function(_0x373397){var _0xf168f8=this;return new Promise(function(_0x4b9b57,_0x41aae9){return db[_0x0bba('0x6')][_0x0bba('0x7')]({'raw':_0x373397['options']?_0x373397['options'][_0x0bba('0x8')]===undefined?!![]:![]:!![],'where':_0x373397[_0x0bba('0x9')]?_0x373397['options'][_0x0bba('0xa')]||null:null,'attributes':_0x373397['options']?_0x373397[_0x0bba('0x9')][_0x0bba('0xb')]||null:null,'limit':_0x373397[_0x0bba('0x9')]?_0x373397['options'][_0x0bba('0xc')]||null:null,'include':_0x373397['options']?_0x373397[_0x0bba('0x9')]['include']?_[_0x0bba('0xd')](_0x373397[_0x0bba('0x9')]['include'],function(_0x2acd65){return{'model':db[_0x2acd65[_0x0bba('0xe')]],'as':_0x2acd65['as'],'attributes':_0x2acd65[_0x0bba('0xb')],'include':_0x2acd65[_0x0bba('0xf')]?_[_0x0bba('0xd')](_0x2acd65[_0x0bba('0xf')],function(_0x5e9b12){return{'model':db[_0x5e9b12['model']],'as':_0x5e9b12['as'],'attributes':_0x5e9b12[_0x0bba('0xb')],'include':_0x5e9b12[_0x0bba('0xf')]?_[_0x0bba('0xd')](_0x5e9b12[_0x0bba('0xf')],function(_0x14c9f5){return{'model':db[_0x14c9f5['model']],'as':_0x14c9f5['as'],'attributes':_0x14c9f5[_0x0bba('0xb')]};}):[]};}):[]};}):[]:[]})[_0x0bba('0x10')](function(_0x59b75a){logger['info']('GetCmHopper',_0x373397);logger['debug'](_0x0bba('0x5'),_0x373397,JSON['stringify'](_0x59b75a));_0x4b9b57(_0x59b75a);})[_0x0bba('0x11')](function(_0x1a4b53){logger[_0x0bba('0x12')]('GetCmHopper',_0x1a4b53[_0x0bba('0x13')],_0x373397);_0x41aae9(_0xf168f8['error'](0x1f4,_0x1a4b53[_0x0bba('0x13')]));});});};exports[_0x0bba('0x14')]=function(_0x5f541a){var _0x4a5c65=this;return new Promise(function(_0x5138cd,_0x46cd87){return db[_0x0bba('0x6')][_0x0bba('0x15')]({'raw':_0x5f541a['options']?_0x5f541a[_0x0bba('0x9')][_0x0bba('0x8')]===undefined?!![]:![]:!![],'where':_0x5f541a[_0x0bba('0x9')]?_0x5f541a[_0x0bba('0x9')][_0x0bba('0xa')]||null:null,'attributes':_0x5f541a[_0x0bba('0x9')]?_0x5f541a[_0x0bba('0x9')][_0x0bba('0xb')]||null:null,'include':_0x5f541a[_0x0bba('0x9')]?_0x5f541a[_0x0bba('0x9')][_0x0bba('0xf')]?_[_0x0bba('0xd')](_0x5f541a['options'][_0x0bba('0xf')],function(_0x54fb27){return{'model':db[_0x54fb27[_0x0bba('0xe')]],'as':_0x54fb27['as'],'attributes':_0x54fb27[_0x0bba('0xb')],'include':_0x54fb27[_0x0bba('0xf')]?_['map'](_0x54fb27[_0x0bba('0xf')],function(_0x41a44d){return{'model':db[_0x41a44d[_0x0bba('0xe')]],'as':_0x41a44d['as'],'attributes':_0x41a44d[_0x0bba('0xb')],'include':_0x41a44d[_0x0bba('0xf')]?_['map'](_0x41a44d[_0x0bba('0xf')],function(_0x133edc){return{'model':db[_0x133edc[_0x0bba('0xe')]],'as':_0x133edc['as'],'attributes':_0x133edc[_0x0bba('0xb')]};}):[]};}):[]};}):[]:[]})[_0x0bba('0x10')](function(_0x2a7473){logger[_0x0bba('0x16')]('ShowCmHopper',_0x5f541a);logger['debug'](_0x0bba('0x14'),_0x5f541a,JSON['stringify'](_0x2a7473));_0x5138cd(_0x2a7473);})[_0x0bba('0x11')](function(_0x57f20d){logger[_0x0bba('0x12')]('ShowCmHopper',_0x57f20d[_0x0bba('0x13')],_0x5f541a);_0x46cd87(_0x4a5c65[_0x0bba('0x12')](0x1f4,_0x57f20d[_0x0bba('0x13')]));});});};exports[_0x0bba('0x17')]=function(_0x1fe086){var _0x51b87f=this;return new Promise(function(_0x3a8494,_0x508e26){return db[_0x0bba('0x6')][_0x0bba('0x18')](_0x1fe086[_0x0bba('0x19')],{'raw':_0x1fe086[_0x0bba('0x9')]?_0x1fe086[_0x0bba('0x9')][_0x0bba('0x8')]===undefined?!![]:![]:!![]})[_0x0bba('0x10')](function(_0x19a56e){logger['info'](_0x0bba('0x17'),_0x1fe086);logger[_0x0bba('0x1a')]('CreateCmHopper',_0x1fe086,JSON['stringify'](_0x19a56e));_0x3a8494(_0x19a56e);})[_0x0bba('0x11')](function(_0x1c4a04){logger['error'](_0x0bba('0x17'),_0x1c4a04[_0x0bba('0x13')],_0x1fe086);_0x508e26(_0x51b87f['error'](0x1f4,_0x1c4a04[_0x0bba('0x13')]));});});};exports[_0x0bba('0x1b')]=function(_0x46bfac){var _0xc9dfe6=this;return new Promise(function(_0x488e6e,_0x42691f){return db[_0x0bba('0x6')]['update'](_0x46bfac[_0x0bba('0x19')],{'raw':_0x46bfac[_0x0bba('0x9')]?_0x46bfac[_0x0bba('0x9')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46bfac[_0x0bba('0x9')]?_0x46bfac[_0x0bba('0x9')]['where']||null:null,'attributes':_0x46bfac[_0x0bba('0x9')]?_0x46bfac[_0x0bba('0x9')][_0x0bba('0xb')]||null:null,'limit':_0x46bfac['options']?_0x46bfac['options'][_0x0bba('0xc')]||null:null})[_0x0bba('0x10')](function(_0x2be602){logger[_0x0bba('0x16')](_0x0bba('0x1b'),_0x46bfac);logger[_0x0bba('0x16')]('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0x0bba('0x1c')](_0x46bfac['options'][_0x0bba('0xa')]),_0x46bfac[_0x0bba('0x19')][_0x0bba('0x1d')]);logger['debug'](_0x0bba('0x1b'),_0x46bfac,JSON['stringify'](_0x2be602));_0x488e6e(_0x2be602);})['catch'](function(_0x4ef694){logger[_0x0bba('0x12')]('UpdateCmHopper',_0x4ef694[_0x0bba('0x13')],_0x46bfac);_0x42691f(_0xc9dfe6[_0x0bba('0x12')](0x1f4,_0x4ef694[_0x0bba('0x13')]));});});};exports[_0x0bba('0x1e')]=function(_0x24e7b7){var _0x24a64d=this;return new Promise(function(_0x54d58e,_0x2b48f8){return db[_0x0bba('0x6')][_0x0bba('0x1f')]({'where':_0x24e7b7['options']?_0x24e7b7[_0x0bba('0x9')][_0x0bba('0xa')]||null:null})['then'](function(_0x129847){logger['info'](_0x0bba('0x1e'),_0x24e7b7);logger[_0x0bba('0x1a')](_0x0bba('0x1e'),_0x24e7b7,JSON[_0x0bba('0x1c')](_0x129847));_0x54d58e(_0x129847);})[_0x0bba('0x11')](function(_0x3ed6af){logger[_0x0bba('0x12')](_0x0bba('0x1e'),_0x3ed6af['message'],_0x24e7b7);_0x2b48f8(_0x24a64d[_0x0bba('0x12')](0x1f4,_0x3ed6af[_0x0bba('0x13')]));});});};exports[_0x0bba('0x20')]=function(_0x2e3b68){var _0x19d636=this;return new Promise(function(_0x57b7d8,_0x4ef9ab){return db[_0x0bba('0x21')]['describe']()['then'](function(_0x15aa0d){return db['sequelize'][_0x0bba('0x22')](function(_0x7d7047){return db[_0x0bba('0x6')][_0x0bba('0x7')]({'where':_0x2e3b68[_0x0bba('0x9')]?_0x2e3b68[_0x0bba('0x9')][_0x0bba('0xa')]||null:null,'attributes':_0x2e3b68['options']?_0x2e3b68[_0x0bba('0x9')][_0x0bba('0xb')]||null:null,'limit':_0x2e3b68[_0x0bba('0x9')]?_0x2e3b68[_0x0bba('0x9')]['limit']||null:null,'order':_0x2e3b68['options']?_0x2e3b68['options'][_0x0bba('0x23')]||null:null,'transaction':_0x7d7047,'lock':_0x7d7047['LOCK'][_0x0bba('0x24')],'include':[{'model':db[_0x0bba('0x21')],'as':'Contact','attributes':_[_0x0bba('0x25')](_0x15aa0d)},{'model':db[_0x0bba('0x26')],'as':_0x0bba('0x27'),'attributes':['id','name',_0x0bba('0x28')]}]})[_0x0bba('0x10')](function(_0x5a7300){var _0x45b060=[];var _0x23c455=[];for(var _0x5960b1=0x0;_0x5960b1<_0x5a7300[_0x0bba('0x29')];_0x5960b1+=0x1){var _0x469e66=_0x5a7300[_0x5960b1][_0x0bba('0x2a')];if(_0x469e66===null){_0x45b060[_0x0bba('0x2b')](_0x5a7300[_0x5960b1][_0x0bba('0x2c')](_0x2e3b68[_0x0bba('0x19')],{'transaction':_0x7d7047}));}else if(!_0x23c455[_0x0bba('0x2d')](_0x469e66)){_0x23c455[_0x0bba('0x2b')](_0x469e66);_0x45b060[_0x0bba('0x2b')](_0x5a7300[_0x5960b1]['update'](_0x2e3b68['body'],{'transaction':_0x7d7047}));}}return BPromise[_0x0bba('0x2e')](_0x45b060);});})[_0x0bba('0x10')](function(_0x18517){logger['info'](_0x0bba('0x20'),_0x2e3b68);if(_0x18517[_0x0bba('0x29')]>0x0){logger[_0x0bba('0x16')](_0x0bba('0x2f'),_0x18517[0x0][_0x0bba('0x30')]['id'],_0x18517[0x0][_0x0bba('0x30')][_0x0bba('0x31')],_0x18517[0x0][_0x0bba('0x30')][_0x0bba('0x1d')]);}logger[_0x0bba('0x1a')]('GetContactDialer',_0x2e3b68,JSON['stringify'](_0x18517));_0x57b7d8(_0x18517);})['catch'](function(_0x48b88c){logger[_0x0bba('0x12')]('GetContactDialer',_0x48b88c[_0x0bba('0x13')],_0x2e3b68);_0x4ef9ab(_0x19d636[_0x0bba('0x12')](0x1f4,_0x48b88c[_0x0bba('0x13')]));});});});};exports['MoveContactManagedDialer']=function(_0x431367){var _0x11b36d=this;return new Promise(function(_0x382fc3,_0x312ef3){return db['sequelize'][_0x0bba('0x22')](function(_0x5450e5){return db[_0x0bba('0x32')][_0x0bba('0x18')](_0x431367['body'],{'raw':_0x431367[_0x0bba('0x9')]?_0x431367[_0x0bba('0x9')]['raw']===undefined?!![]:![]:!![],'transaction':_0x5450e5})[_0x0bba('0x10')](function(){logger[_0x0bba('0x16')]('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON['stringify'](_0x431367[_0x0bba('0x9')][_0x0bba('0xa')]),_0x431367['options'][_0x0bba('0xa')]['active']);return db[_0x0bba('0x6')][_0x0bba('0x1f')]({'where':_0x431367[_0x0bba('0x9')]?_0x431367[_0x0bba('0x9')][_0x0bba('0xa')]||null:null,'transaction':_0x5450e5});});})['then'](function(_0x2d30dc){logger[_0x0bba('0x16')](_0x0bba('0x33'),_0x431367);logger[_0x0bba('0x1a')](_0x0bba('0x33'),_0x431367,JSON[_0x0bba('0x1c')](_0x2d30dc));_0x382fc3(_0x2d30dc);})[_0x0bba('0x11')](function(_0x3d75f9){logger[_0x0bba('0x12')](_0x0bba('0x33'),_0x3d75f9[_0x0bba('0x13')],_0x431367);_0x312ef3(_0x11b36d[_0x0bba('0x12')](0x1f4,_0x3d75f9[_0x0bba('0x13')]));});});};exports[_0x0bba('0x34')]=function(_0x2ca2bd){var _0x2f4a12=this;return new Promise(function(_0x3eae90,_0x25439d){return db['CmHopper'][_0x0bba('0x7')]({'raw':_0x2ca2bd[_0x0bba('0x9')]?_0x2ca2bd[_0x0bba('0x9')][_0x0bba('0x8')]===undefined?!![]:![]:!![],'where':_0x2ca2bd['options']?_0x2ca2bd[_0x0bba('0x9')][_0x0bba('0xa')]||null:null,'attributes':[[db[_0x0bba('0x35')]['fn'](_0x0bba('0x36'),db[_0x0bba('0x35')]['fn']('IF',db[_0x0bba('0x35')]['literal'](_0x0bba('0x37')+util[_0x0bba('0x38')](_0x0bba('0x39'),moment()['format'](_0x0bba('0x3a')))+'\x20,\x201,\x20null'))),_0x0bba('0x3b')]]})[_0x0bba('0x10')](function(_0x50fda9){logger[_0x0bba('0x16')](_0x0bba('0x34'),_0x2ca2bd);logger['debug'](_0x0bba('0x34'),_0x2ca2bd,JSON[_0x0bba('0x1c')](_0x50fda9));_0x3eae90(_0x50fda9);})['catch'](function(_0x30b72e){logger['error'](_0x0bba('0x34'),_0x30b72e[_0x0bba('0x13')],_0x2ca2bd);_0x25439d(_0x2f4a12[_0x0bba('0x12')](0x1f4,_0x30b72e[_0x0bba('0x13')]));});});};exports[_0x0bba('0x3c')]=function(_0x7025ff){var _0x5474bb=this;return new Promise(function(_0x2aa825,_0xacd93e){return db[_0x0bba('0x21')][_0x0bba('0x3d')]()[_0x0bba('0x10')](function(){return db[_0x0bba('0x35')][_0x0bba('0x22')](function(_0x501599){return db[_0x0bba('0x6')][_0x0bba('0x7')]({'where':_0x7025ff[_0x0bba('0x9')]?_0x7025ff[_0x0bba('0x9')][_0x0bba('0xa')]||null:null,'attributes':_0x7025ff[_0x0bba('0x9')]?_0x7025ff[_0x0bba('0x9')]['attributes']||null:null,'limit':0x1,'order':_0x7025ff[_0x0bba('0x9')]?_0x7025ff['options'][_0x0bba('0x23')]||null:null,'group':db[_0x0bba('0x6')][_0x0bba('0x2a')],'transaction':_0x501599,'lock':_0x501599[_0x0bba('0x3e')][_0x0bba('0x24')],'include':_0x7025ff['options']?_0x7025ff[_0x0bba('0x9')]['include']?_['map'](_0x7025ff[_0x0bba('0x9')][_0x0bba('0xf')],function(_0x1c3e8b){return{'model':db[_0x1c3e8b['model']],'as':_0x1c3e8b['as'],'attributes':_0x1c3e8b['attributes'],'include':_0x1c3e8b[_0x0bba('0xf')]?_[_0x0bba('0xd')](_0x1c3e8b[_0x0bba('0xf')],function(_0x47a795){return{'model':db[_0x47a795[_0x0bba('0xe')]],'as':_0x47a795['as'],'attributes':_0x47a795[_0x0bba('0xb')],'include':_0x47a795[_0x0bba('0xf')]?_['map'](_0x47a795['include'],function(_0x31c8fa){return{'model':db[_0x31c8fa['model']],'as':_0x31c8fa['as'],'attributes':_0x31c8fa[_0x0bba('0xb')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xe57caf){var _0x1d8172=[];for(var _0x389e6d=0x0;_0x389e6d<_0xe57caf['length'];_0x389e6d+=0x1){_0x1d8172['push'](_0xe57caf[_0x389e6d][_0x0bba('0x2c')](_0x7025ff[_0x0bba('0x19')],{'transaction':_0x501599}));}return BPromise['all'](_0x1d8172);});})['then'](function(_0x16e808){logger[_0x0bba('0x16')](_0x0bba('0x3c'),_0x7025ff);logger[_0x0bba('0x1a')](_0x0bba('0x3c'),_0x7025ff,JSON[_0x0bba('0x1c')](_0x16e808));_0x2aa825(_0x16e808);})[_0x0bba('0x11')](function(_0x3841b1){logger[_0x0bba('0x12')](_0x0bba('0x3c'),_0x3841b1[_0x0bba('0x13')],_0x7025ff);_0xacd93e(_0x5474bb[_0x0bba('0x12')](0x1f4,_0x3841b1[_0x0bba('0x13')]));});});});};exports['GetCmHopperPreview']=function(_0x57bfd3){var _0x269bdc=this;return new Promise(function(_0x11d9fb,_0x3e006d){db['CmContact'][_0x0bba('0x3d')]()['then'](function(_0x4c596d){return db[_0x0bba('0x6')][_0x0bba('0x7')]({'raw':_0x57bfd3[_0x0bba('0x9')]?_0x57bfd3[_0x0bba('0x9')][_0x0bba('0x8')]===undefined?!![]:![]:!![],'where':_0x57bfd3[_0x0bba('0x9')]?_0x57bfd3[_0x0bba('0x9')][_0x0bba('0xa')]||null:null,'attributes':_0x57bfd3['options']?_0x57bfd3[_0x0bba('0x9')][_0x0bba('0xb')]||null:null,'limit':_0x57bfd3[_0x0bba('0x9')]?_0x57bfd3['options'][_0x0bba('0xc')]||null:null,'include':_0x57bfd3['options']?_0x57bfd3[_0x0bba('0x9')][_0x0bba('0xf')]?_[_0x0bba('0xd')](_0x57bfd3[_0x0bba('0x9')][_0x0bba('0xf')],function(_0x568745){return{'model':db[_0x568745[_0x0bba('0xe')]],'as':_0x568745['as'],'attributes':_0x568745['as']==='Contact'?_[_0x0bba('0x25')](_0x4c596d):_0x568745[_0x0bba('0xb')],'include':_0x568745[_0x0bba('0xf')]?_['map'](_0x568745[_0x0bba('0xf')],function(_0x23aec8){return{'model':db[_0x23aec8[_0x0bba('0xe')]],'as':_0x23aec8['as'],'attributes':_0x23aec8[_0x0bba('0xb')],'include':_0x23aec8['include']?_['map'](_0x23aec8['include'],function(_0x3a4c43){return{'model':db[_0x3a4c43['model']],'as':_0x3a4c43['as'],'attributes':_0x3a4c43[_0x0bba('0xb')]};}):[]};}):[]};}):[]:[]})[_0x0bba('0x10')](function(_0x1616de){logger[_0x0bba('0x16')](_0x0bba('0x5'),_0x57bfd3);logger[_0x0bba('0x1a')](_0x0bba('0x5'),_0x57bfd3,JSON['stringify'](_0x1616de));_0x11d9fb(_0x1616de);})[_0x0bba('0x11')](function(_0x526d75){logger[_0x0bba('0x12')]('GetCmHopper',_0x526d75[_0x0bba('0x13')],_0x57bfd3);_0x3e006d(_0x269bdc[_0x0bba('0x12')](0x1f4,_0x526d75[_0x0bba('0x13')]));});});});};exports[_0x0bba('0x3f')]=function(_0x514a2f){var _0x370110=this;return new Promise(function(_0x228af9,_0x1760e0){return db[_0x0bba('0x21')]['findOne']({'raw':!![],'where':{'phone':_0x514a2f[_0x0bba('0x9')][_0x0bba('0xa')]['phone']},'attributes':['id',_0x0bba('0x40')],'order':[['id',_0x0bba('0x41')]]})[_0x0bba('0x10')](function(_0x300796){logger[_0x0bba('0x16')](_0x0bba('0x42'),_0x514a2f);logger[_0x0bba('0x1a')](_0x0bba('0x42'),_0x514a2f,JSON[_0x0bba('0x1c')](_0x300796));_0x228af9(_0x300796);})[_0x0bba('0x11')](function(_0x3d10ad){logger[_0x0bba('0x12')]('getContactByPhone',_0x3d10ad[_0x0bba('0x13')],_0x514a2f);_0x1760e0(_0x370110[_0x0bba('0x12')](0x1f4,_0x3d10ad[_0x0bba('0x13')]));});});};exports[_0x0bba('0x43')]=function(_0x26a063){var _0x399c3e=this;return new Promise(function(_0x3fa69f,_0x1a1c3b){return db[_0x0bba('0x35')][_0x0bba('0x22')](function(_0x3783b0){var _0x18de26=_0x26a063[_0x0bba('0x9')]&&_0x26a063[_0x0bba('0x9')][_0x0bba('0xa')]?_0x26a063[_0x0bba('0x9')][_0x0bba('0xa')]:{};return db['CmHopper'][_0x0bba('0x2c')](_0x26a063['body'],{'where':_0x18de26,'transaction':_0x3783b0})[_0x0bba('0x10')](function(_0x34b3f9){logger[_0x0bba('0x16')]('ResetActiveCalls',_0x26a063);logger[_0x0bba('0x1a')](_0x0bba('0x43'),_0x26a063,JSON[_0x0bba('0x1c')](_0x34b3f9));_0x3fa69f(_0x34b3f9);})[_0x0bba('0x11')](function(_0x4039a7){logger[_0x0bba('0x12')](_0x0bba('0x43'),_0x4039a7[_0x0bba('0x13')],_0x26a063);_0x1a1c3b(_0x399c3e['error'](0x1f4,_0x4039a7[_0x0bba('0x13')]));});});});};exports[_0x0bba('0x44')]=function(_0x5a765d){var _0x36a10b=this;var _0x42134f=_0x5a765d['body']['where'][_0x0bba('0x45')];var _0x668ea8=_0x5a765d[_0x0bba('0x19')][_0x0bba('0xa')][_0x0bba('0x46')];var _0x28af12=_0x5a765d['body'][_0x0bba('0xa')][_0x0bba('0x47')];return new Promise(function(_0x27a848,_0xf039f6){return db[_0x0bba('0x6')][_0x0bba('0x7')]({'where':{'voiceQueueId':{'$in':_0x42134f},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db['sequelize'][_0x0bba('0x48')]('NOW()\x20+\x20INTERVAL\x20'+_0x668ea8+_0x0bba('0x49')),'$gt':db[_0x0bba('0x35')][_0x0bba('0x48')]('NOW()')}},'UserId':{'$in':_0x28af12}},'include':[{'model':db[_0x0bba('0x21')],'as':'Contact'},{'model':db['User'],'as':_0x0bba('0x27'),'attributes':['id',_0x0bba('0x4a'),_0x0bba('0x28')]},{'model':db[_0x0bba('0x4b')],'as':_0x0bba('0x4c')}]})[_0x0bba('0x10')](function(_0xdbeeeb){if(_0xdbeeeb['length']>0x0){return db[_0x0bba('0x35')][_0x0bba('0x22')](function(_0x38b483){return db['CmHopper'][_0x0bba('0x2c')]({'recallmeNotifiedDate':db[_0x0bba('0x35')][_0x0bba('0x48')](_0x0bba('0x4d'))},{'where':{'id':{'$in':_[_0x0bba('0xd')](_0xdbeeeb,'id')}},'transaction':_0x38b483})[_0x0bba('0x10')](function(){_0x27a848(_0xdbeeeb);})[_0x0bba('0x11')](function(_0x15e79f){logger[_0x0bba('0x12')]('CmHopperHandlePreviewRecallNotifications',_0x15e79f[_0x0bba('0x13')],_0x5a765d);_0xf039f6(_0x36a10b['error'](0x1f4,_0x15e79f[_0x0bba('0x13')]));});})[_0x0bba('0x11')](function(_0x8971ff){logger['error']('CmHopperHandlePreviewRecallNotifications',_0x8971ff['message'],_0x5a765d);_0xf039f6(_0x36a10b['error'](0x1f4,_0x8971ff[_0x0bba('0x13')]));});}else{_0x27a848(_0xdbeeeb);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 6fd96ca..380cfe1 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 _0x029a=['describe','/opencontacts','getOpenContacts','getTimezones','/:id','show','/:id/previewrecall','getPreviewRecall','post','create','/preview','/timezone','getTimezone','put','update','delete','destroy','express','Router','../../components/auth/service','./cmHopper.controller','get','isAuthenticated','index','/describe'];(function(_0x571e63,_0x2b4b14){var _0x1090ee=function(_0x1f051f){while(--_0x1f051f){_0x571e63['push'](_0x571e63['shift']());}};_0x1090ee(++_0x2b4b14);}(_0x029a,0x188));var _0xa029=function(_0x572b00,_0x50277c){_0x572b00=_0x572b00-0x0;var _0x82e860=_0x029a[_0x572b00];return _0x82e860;};'use strict';var express=require(_0xa029('0x0'));var router=express[_0xa029('0x1')]();var auth=require(_0xa029('0x2'));var controller=require(_0xa029('0x3'));router[_0xa029('0x4')]('/',auth[_0xa029('0x5')](),controller[_0xa029('0x6')]);router[_0xa029('0x4')](_0xa029('0x7'),auth['isAuthenticated'](),controller[_0xa029('0x8')]);router[_0xa029('0x4')](_0xa029('0x9'),auth[_0xa029('0x5')](),controller[_0xa029('0xa')]);router[_0xa029('0x4')]('/timezones',auth['isAuthenticated'](),controller[_0xa029('0xb')]);router[_0xa029('0x4')](_0xa029('0xc'),auth[_0xa029('0x5')](),controller[_0xa029('0xd')]);router['get'](_0xa029('0xe'),auth['isAuthenticated'](),controller[_0xa029('0xf')]);router[_0xa029('0x10')]('/',auth[_0xa029('0x5')](),controller[_0xa029('0x11')]);router['post'](_0xa029('0x12'),auth['isAuthenticated'](),controller['getPreview']);router[_0xa029('0x10')](_0xa029('0x13'),auth['isAuthenticated'](),controller[_0xa029('0x14')]);router[_0xa029('0x15')]('/:id',auth[_0xa029('0x5')](),controller[_0xa029('0x16')]);router[_0xa029('0x17')](_0xa029('0xc'),auth[_0xa029('0x5')](),controller[_0xa029('0x18')]);module['exports']=router; \ No newline at end of file +var _0xed25=['post','create','/preview','/timezone','getTimezone','put','update','delete','destroy','exports','Router','./cmHopper.controller','get','isAuthenticated','index','/describe','describe','/opencontacts','getOpenContacts','/timezones','getTimezones','/:id','show','/:id/previewrecall','getPreviewRecall'];(function(_0x1f4e09,_0x1fc591){var _0x10deec=function(_0x5c1fb9){while(--_0x5c1fb9){_0x1f4e09['push'](_0x1f4e09['shift']());}};_0x10deec(++_0x1fc591);}(_0xed25,0x1cc));var _0x5ed2=function(_0xa1ae5c,_0x44beef){_0xa1ae5c=_0xa1ae5c-0x0;var _0x4573c1=_0xed25[_0xa1ae5c];return _0x4573c1;};'use strict';var express=require('express');var router=express[_0x5ed2('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5ed2('0x1'));router[_0x5ed2('0x2')]('/',auth[_0x5ed2('0x3')](),controller[_0x5ed2('0x4')]);router[_0x5ed2('0x2')](_0x5ed2('0x5'),auth[_0x5ed2('0x3')](),controller[_0x5ed2('0x6')]);router[_0x5ed2('0x2')](_0x5ed2('0x7'),auth[_0x5ed2('0x3')](),controller[_0x5ed2('0x8')]);router['get'](_0x5ed2('0x9'),auth['isAuthenticated'](),controller[_0x5ed2('0xa')]);router[_0x5ed2('0x2')](_0x5ed2('0xb'),auth['isAuthenticated'](),controller[_0x5ed2('0xc')]);router['get'](_0x5ed2('0xd'),auth[_0x5ed2('0x3')](),controller[_0x5ed2('0xe')]);router[_0x5ed2('0xf')]('/',auth[_0x5ed2('0x3')](),controller[_0x5ed2('0x10')]);router[_0x5ed2('0xf')](_0x5ed2('0x11'),auth[_0x5ed2('0x3')](),controller['getPreview']);router[_0x5ed2('0xf')](_0x5ed2('0x12'),auth[_0x5ed2('0x3')](),controller[_0x5ed2('0x13')]);router[_0x5ed2('0x14')](_0x5ed2('0xb'),auth['isAuthenticated'](),controller[_0x5ed2('0x15')]);router[_0x5ed2('0x16')](_0x5ed2('0xb'),auth['isAuthenticated'](),controller[_0x5ed2('0x17')]);module[_0x5ed2('0x18')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index 3f01747..9549f37 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6dd0=['sequelize','exports','INTEGER','STRING','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6dd0,0x185));var _0x06dd=function(_0x2b6f27,_0x3dd1fd){_0x2b6f27=_0x2b6f27-0x0;var _0x545fbb=_0x6dd0[_0x2b6f27];return _0x545fbb;};'use strict';var moment=require(_0x06dd('0x0'));var Sequelize=require(_0x06dd('0x1'));module[_0x06dd('0x2')]={'CmHopperId':{'type':Sequelize[_0x06dd('0x3')]},'phone':{'type':Sequelize[_0x06dd('0x4')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x06dd('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x06dd('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x06dd('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x06dd('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x06dd('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x06dd('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x50fc=['moment','sequelize','exports','INTEGER','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x11b212,_0x504409){var _0x156a68=function(_0x576bfd){while(--_0x576bfd){_0x11b212['push'](_0x11b212['shift']());}};_0x156a68(++_0x504409);}(_0x50fc,0x1d1));var _0xc50f=function(_0x1d9bc1,_0x52f0a6){_0x1d9bc1=_0x1d9bc1-0x0;var _0x540128=_0x50fc[_0x1d9bc1];return _0x540128;};'use strict';var moment=require(_0xc50f('0x0'));var Sequelize=require(_0xc50f('0x1'));module[_0xc50f('0x2')]={'CmHopperId':{'type':Sequelize[_0xc50f('0x3')]},'phone':{'type':Sequelize['STRING'],'allowNull':![]},'OrderBy':{'type':Sequelize[_0xc50f('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()['format'](_0xc50f('0x4'))},'countbusyretry':{'type':Sequelize[_0xc50f('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xc50f('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xc50f('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0xc50f('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xc50f('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xc50f('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xc50f('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js index 5d7e71c..1494d98 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6cea=['user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','CmHopperAdditionalPhones','UserProfileResource','error','name','send','index','rawAttributes','fieldName','type','key','map','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','CmHopperAdditionalPhone','includeAll','include','findAll','rows','catch','show','fields','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x8c88a8,_0x1bcb7a){var _0xcb2860=function(_0x725513){while(--_0x725513){_0x8c88a8['push'](_0x8c88a8['shift']());}};_0xcb2860(++_0x1bcb7a);}(_0x6cea,0x1be));var _0xa6ce=function(_0x181ef3,_0x40ad81){_0x181ef3=_0x181ef3-0x0;var _0x2b01d4=_0x6cea[_0x181ef3];return _0x2b01d4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa6ce('0x0'));var zipdir=require(_0xa6ce('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa6ce('0x2'));var moment=require(_0xa6ce('0x3'));var BPromise=require(_0xa6ce('0x4'));var Mustache=require(_0xa6ce('0x5'));var util=require(_0xa6ce('0x6'));var path=require(_0xa6ce('0x7'));var sox=require('sox');var csv=require(_0xa6ce('0x8'));var ejs=require(_0xa6ce('0x9'));var fs=require('fs');var fs_extra=require(_0xa6ce('0xa'));var _=require(_0xa6ce('0xb'));var squel=require(_0xa6ce('0xc'));var crypto=require('crypto');var jsforce=require(_0xa6ce('0xd'));var deskjs=require(_0xa6ce('0xe'));var toCsv=require(_0xa6ce('0x8'));var querystring=require(_0xa6ce('0xf'));var Papa=require(_0xa6ce('0x10'));var Redis=require('ioredis');var authService=require(_0xa6ce('0x11'));var qs=require(_0xa6ce('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa6ce('0x13'));var logger=require(_0xa6ce('0x14'))(_0xa6ce('0x15'));var utils=require('../../config/utils');var config=require(_0xa6ce('0x16'));var licenseUtil=require(_0xa6ce('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f8620,_0x93ae82){_0x93ae82=_0x93ae82||0xcc;return function(_0x1ec819){if(_0x1ec819){return _0x2f8620[_0xa6ce('0x18')](_0x93ae82);}return _0x2f8620[_0xa6ce('0x19')](_0x93ae82)[_0xa6ce('0x1a')]();};}function respondWithResult(_0x4052a3,_0x320a80){_0x320a80=_0x320a80||0xc8;return function(_0x34269c){if(_0x34269c){return _0x4052a3[_0xa6ce('0x19')](_0x320a80)[_0xa6ce('0x1b')](_0x34269c);}};}function respondWithFilteredResult(_0x473074,_0x4a3dc0){return function(_0x54a29b){if(_0x54a29b){var _0x24e641=typeof _0x4a3dc0['offset']===_0xa6ce('0x1c')&&typeof _0x4a3dc0['limit']===_0xa6ce('0x1c');var _0x653b59=_0x54a29b[_0xa6ce('0x1d')];var _0x4826e7=_0x24e641?0x0:_0x4a3dc0['offset'];var _0x1c9f54=_0x24e641?_0x54a29b[_0xa6ce('0x1d')]:_0x4a3dc0[_0xa6ce('0x1e')]+_0x4a3dc0[_0xa6ce('0x1f')];var _0xfc29d4;if(_0x1c9f54>=_0x653b59){_0x1c9f54=_0x653b59;_0xfc29d4=0xc8;}else{_0xfc29d4=0xce;}_0x473074[_0xa6ce('0x19')](_0xfc29d4);return _0x473074[_0xa6ce('0x20')](_0xa6ce('0x21'),_0x4826e7+'-'+_0x1c9f54+'/'+_0x653b59)[_0xa6ce('0x1b')](_0x54a29b);}return null;};}function patchUpdates(_0xc8f984){return function(_0x2a12c8){try{jsonpatch[_0xa6ce('0x22')](_0x2a12c8,_0xc8f984,!![]);}catch(_0x4ce21b){return BPromise[_0xa6ce('0x23')](_0x4ce21b);}return _0x2a12c8[_0xa6ce('0x24')]();};}function saveUpdates(_0x24fb1a,_0x1b79a2){return function(_0x3fd506){if(_0x3fd506){return _0x3fd506[_0xa6ce('0x25')](_0x24fb1a)['then'](function(_0x4685a3){return _0x4685a3;});}return null;};}function removeEntity(_0x19f80e,_0x2e0c54){return function(_0x2818d4){if(_0x2818d4){return _0x2818d4[_0xa6ce('0x26')]()[_0xa6ce('0x27')](function(){var _0x2cd7ed=_0x2818d4['get']({'plain':!![]});var _0x580b5c=_0xa6ce('0x28');return db[_0xa6ce('0x29')][_0xa6ce('0x26')]({'where':{'type':_0x580b5c,'resourceId':_0x2cd7ed['id']}})[_0xa6ce('0x27')](function(){return _0x2818d4;});})[_0xa6ce('0x27')](function(){_0x19f80e[_0xa6ce('0x19')](0xcc)[_0xa6ce('0x1a')]();});}};}function handleEntityNotFound(_0x3ab5d0,_0x445016){return function(_0x108521){if(!_0x108521){_0x3ab5d0[_0xa6ce('0x18')](0x194);}return _0x108521;};}function handleError(_0x125324,_0x30989b){_0x30989b=_0x30989b||0x1f4;return function(_0x722362){logger[_0xa6ce('0x2a')](_0x722362['stack']);if(_0x722362['name']){delete _0x722362[_0xa6ce('0x2b')];}_0x125324[_0xa6ce('0x19')](_0x30989b)[_0xa6ce('0x2c')](_0x722362);};}exports[_0xa6ce('0x2d')]=function(_0x261f88,_0x282e97){var _0x3497c6={},_0x1f21cb={},_0x3345a3={'count':0x0,'rows':[]};var _0x33eb59=_['map'](db['CmHopperAdditionalPhone'][_0xa6ce('0x2e')],function(_0x23ef55){return{'name':_0x23ef55[_0xa6ce('0x2f')],'type':_0x23ef55[_0xa6ce('0x30')][_0xa6ce('0x31')]};});_0x1f21cb['model']=_[_0xa6ce('0x32')](_0x33eb59,_0xa6ce('0x2b'));_0x1f21cb['query']=_[_0xa6ce('0x33')](_0x261f88[_0xa6ce('0x34')]);_0x1f21cb[_0xa6ce('0x35')]=_[_0xa6ce('0x36')](_0x1f21cb[_0xa6ce('0x37')],_0x1f21cb[_0xa6ce('0x34')]);_0x3497c6['attributes']=_[_0xa6ce('0x36')](_0x1f21cb[_0xa6ce('0x37')],qs['fields'](_0x261f88[_0xa6ce('0x34')]['fields']));_0x3497c6['attributes']=_0x3497c6[_0xa6ce('0x38')][_0xa6ce('0x39')]?_0x3497c6['attributes']:_0x1f21cb[_0xa6ce('0x37')];if(!_0x261f88[_0xa6ce('0x34')][_0xa6ce('0x3a')](_0xa6ce('0x3b'))){_0x3497c6[_0xa6ce('0x1f')]=qs[_0xa6ce('0x1f')](_0x261f88[_0xa6ce('0x34')][_0xa6ce('0x1f')]);_0x3497c6[_0xa6ce('0x1e')]=qs[_0xa6ce('0x1e')](_0x261f88[_0xa6ce('0x34')][_0xa6ce('0x1e')]);}_0x3497c6[_0xa6ce('0x3c')]=qs[_0xa6ce('0x3d')](_0x261f88[_0xa6ce('0x34')][_0xa6ce('0x3d')]);_0x3497c6['where']=qs[_0xa6ce('0x35')](_[_0xa6ce('0x3e')](_0x261f88[_0xa6ce('0x34')],_0x1f21cb[_0xa6ce('0x35')]),_0x33eb59);if(_0x261f88[_0xa6ce('0x34')][_0xa6ce('0x3f')]){_0x3497c6['where']=_[_0xa6ce('0x40')](_0x3497c6[_0xa6ce('0x41')],{'$or':_[_0xa6ce('0x32')](_0x33eb59,function(_0x16a1df){if(_0x16a1df[_0xa6ce('0x30')]!==_0xa6ce('0x42')){var _0x599d69={};_0x599d69[_0x16a1df[_0xa6ce('0x2b')]]={'$like':'%'+_0x261f88[_0xa6ce('0x34')][_0xa6ce('0x3f')]+'%'};return _0x599d69;}})});}_0x3497c6=_[_0xa6ce('0x40')]({},_0x3497c6,_0x261f88[_0xa6ce('0x43')]);var _0x163c82={'where':_0x3497c6[_0xa6ce('0x41')]};return db[_0xa6ce('0x44')][_0xa6ce('0x1d')](_0x163c82)['then'](function(_0x28afb9){_0x3345a3[_0xa6ce('0x1d')]=_0x28afb9;if(_0x261f88['query'][_0xa6ce('0x45')]){_0x3497c6[_0xa6ce('0x46')]=[{'all':!![]}];}return db[_0xa6ce('0x44')][_0xa6ce('0x47')](_0x3497c6);})[_0xa6ce('0x27')](function(_0x50f052){_0x3345a3[_0xa6ce('0x48')]=_0x50f052;return _0x3345a3;})[_0xa6ce('0x27')](respondWithFilteredResult(_0x282e97,_0x3497c6))[_0xa6ce('0x49')](handleError(_0x282e97,null));};exports[_0xa6ce('0x4a')]=function(_0x3b615e,_0x2a45b0){var _0x413244={'raw':!![],'where':{'id':_0x3b615e['params']['id']}},_0x2792bf={};_0x2792bf['model']=_['keys'](db[_0xa6ce('0x44')][_0xa6ce('0x2e')]);_0x2792bf[_0xa6ce('0x34')]=_[_0xa6ce('0x33')](_0x3b615e[_0xa6ce('0x34')]);_0x2792bf[_0xa6ce('0x35')]=_['intersection'](_0x2792bf[_0xa6ce('0x37')],_0x2792bf[_0xa6ce('0x34')]);_0x413244[_0xa6ce('0x38')]=_[_0xa6ce('0x36')](_0x2792bf['model'],qs[_0xa6ce('0x4b')](_0x3b615e[_0xa6ce('0x34')]['fields']));_0x413244[_0xa6ce('0x38')]=_0x413244['attributes'][_0xa6ce('0x39')]?_0x413244[_0xa6ce('0x38')]:_0x2792bf['model'];if(_0x3b615e[_0xa6ce('0x34')]['includeAll']){_0x413244[_0xa6ce('0x46')]=[{'all':!![]}];}_0x413244=_[_0xa6ce('0x40')]({},_0x413244,_0x3b615e[_0xa6ce('0x43')]);return db[_0xa6ce('0x44')][_0xa6ce('0x4c')](_0x413244)[_0xa6ce('0x27')](handleEntityNotFound(_0x2a45b0,null))[_0xa6ce('0x27')](respondWithResult(_0x2a45b0,null))[_0xa6ce('0x49')](handleError(_0x2a45b0,null));};exports['create']=function(_0xd7ff3e,_0x105df5){return db[_0xa6ce('0x44')][_0xa6ce('0x4d')](_0xd7ff3e[_0xa6ce('0x4e')],{})['then'](function(_0x5cb879){var _0x390d3a=_0xd7ff3e['user'][_0xa6ce('0x4f')]({'plain':!![]});if(!_0x390d3a)throw new Error(_0xa6ce('0x50'));if(_0x390d3a[_0xa6ce('0x51')]===_0xa6ce('0x52')){var _0x134e40=_0x5cb879['get']({'plain':!![]});var _0x5d426c=_0xa6ce('0x28');return db[_0xa6ce('0x53')][_0xa6ce('0x4c')]({'where':{'name':_0x5d426c,'userProfileId':_0x390d3a[_0xa6ce('0x54')]},'raw':!![]})[_0xa6ce('0x27')](function(_0x1d91aa){if(_0x1d91aa&&_0x1d91aa[_0xa6ce('0x55')]===0x0){return db[_0xa6ce('0x29')][_0xa6ce('0x4d')]({'name':_0x134e40['name'],'resourceId':_0x134e40['id'],'type':_0x1d91aa[_0xa6ce('0x2b')],'sectionId':_0x1d91aa['id']},{})[_0xa6ce('0x27')](function(){return _0x5cb879;});}else{return _0x5cb879;}})[_0xa6ce('0x49')](function(_0x5391dd){logger[_0xa6ce('0x2a')](_0xa6ce('0x56'),_0x5391dd);throw _0x5391dd;});}return _0x5cb879;})['then'](respondWithResult(_0x105df5,0xc9))[_0xa6ce('0x49')](handleError(_0x105df5,null));};exports[_0xa6ce('0x25')]=function(_0xe85ef9,_0x290d81){if(_0xe85ef9[_0xa6ce('0x4e')]['id']){delete _0xe85ef9[_0xa6ce('0x4e')]['id'];}return db[_0xa6ce('0x44')][_0xa6ce('0x4c')]({'where':{'id':_0xe85ef9[_0xa6ce('0x57')]['id']}})[_0xa6ce('0x27')](handleEntityNotFound(_0x290d81,null))[_0xa6ce('0x27')](saveUpdates(_0xe85ef9[_0xa6ce('0x4e')],null))[_0xa6ce('0x27')](respondWithResult(_0x290d81,null))[_0xa6ce('0x49')](handleError(_0x290d81,null));};exports[_0xa6ce('0x26')]=function(_0x688f3c,_0x2ccac3){return db[_0xa6ce('0x44')][_0xa6ce('0x4c')]({'where':{'id':_0x688f3c['params']['id']}})[_0xa6ce('0x27')](handleEntityNotFound(_0x2ccac3,null))[_0xa6ce('0x27')](removeEntity(_0x2ccac3,null))[_0xa6ce('0x49')](handleError(_0x2ccac3,null));}; \ No newline at end of file +var _0xed90=['query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','CmHopperAdditionalPhones','error','stack','name','map','CmHopperAdditionalPhone','fieldName','type','key','model'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xed90,0x11b));var _0x0ed9=function(_0x54b27f,_0x11a3a9){_0x54b27f=_0x54b27f-0x0;var _0x279111=_0xed90[_0x54b27f];return _0x279111;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0ed9('0x0'));var zipdir=require(_0x0ed9('0x1'));var jsonpatch=require(_0x0ed9('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0ed9('0x3'));var Mustache=require('mustache');var util=require(_0x0ed9('0x4'));var path=require(_0x0ed9('0x5'));var sox=require(_0x0ed9('0x6'));var csv=require(_0x0ed9('0x7'));var ejs=require(_0x0ed9('0x8'));var fs=require('fs');var fs_extra=require(_0x0ed9('0x9'));var _=require(_0x0ed9('0xa'));var squel=require(_0x0ed9('0xb'));var crypto=require(_0x0ed9('0xc'));var jsforce=require(_0x0ed9('0xd'));var deskjs=require(_0x0ed9('0xe'));var toCsv=require(_0x0ed9('0x7'));var querystring=require('querystring');var Papa=require(_0x0ed9('0xf'));var Redis=require(_0x0ed9('0x10'));var authService=require(_0x0ed9('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0ed9('0x12'));var hardwareService=require(_0x0ed9('0x13'));var logger=require(_0x0ed9('0x14'))(_0x0ed9('0x15'));var utils=require(_0x0ed9('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0ed9('0x17'));var db=require(_0x0ed9('0x18'))['db'];function respondWithStatusCode(_0x26584a,_0x366bd4){_0x366bd4=_0x366bd4||0xcc;return function(_0x5d8779){if(_0x5d8779){return _0x26584a[_0x0ed9('0x19')](_0x366bd4);}return _0x26584a[_0x0ed9('0x1a')](_0x366bd4)[_0x0ed9('0x1b')]();};}function respondWithResult(_0xe900b8,_0x17a804){_0x17a804=_0x17a804||0xc8;return function(_0x3cd091){if(_0x3cd091){return _0xe900b8[_0x0ed9('0x1a')](_0x17a804)[_0x0ed9('0x1c')](_0x3cd091);}};}function respondWithFilteredResult(_0x4cc996,_0x29144d){return function(_0x19349d){if(_0x19349d){var _0x190eca=typeof _0x29144d[_0x0ed9('0x1d')]===_0x0ed9('0x1e')&&typeof _0x29144d[_0x0ed9('0x1f')]===_0x0ed9('0x1e');var _0x39707b=_0x19349d[_0x0ed9('0x20')];var _0x30d210=_0x190eca?0x0:_0x29144d[_0x0ed9('0x1d')];var _0x361364=_0x190eca?_0x19349d[_0x0ed9('0x20')]:_0x29144d[_0x0ed9('0x1d')]+_0x29144d[_0x0ed9('0x1f')];var _0x152e0d;if(_0x361364>=_0x39707b){_0x361364=_0x39707b;_0x152e0d=0xc8;}else{_0x152e0d=0xce;}_0x4cc996[_0x0ed9('0x1a')](_0x152e0d);return _0x4cc996[_0x0ed9('0x21')]('Content-Range',_0x30d210+'-'+_0x361364+'/'+_0x39707b)[_0x0ed9('0x1c')](_0x19349d);}return null;};}function patchUpdates(_0x30d078){return function(_0x55279d){try{jsonpatch[_0x0ed9('0x22')](_0x55279d,_0x30d078,!![]);}catch(_0x429703){return BPromise[_0x0ed9('0x23')](_0x429703);}return _0x55279d['save']();};}function saveUpdates(_0x3f7757,_0x350150){return function(_0x4510cc){if(_0x4510cc){return _0x4510cc[_0x0ed9('0x24')](_0x3f7757)[_0x0ed9('0x25')](function(_0x5a4037){return _0x5a4037;});}return null;};}function removeEntity(_0x576442,_0x5f400c){return function(_0x242f59){if(_0x242f59){return _0x242f59[_0x0ed9('0x26')]()[_0x0ed9('0x25')](function(){var _0x41d7ca=_0x242f59['get']({'plain':!![]});var _0x1de81a=_0x0ed9('0x27');return db['UserProfileResource'][_0x0ed9('0x26')]({'where':{'type':_0x1de81a,'resourceId':_0x41d7ca['id']}})[_0x0ed9('0x25')](function(){return _0x242f59;});})[_0x0ed9('0x25')](function(){_0x576442['status'](0xcc)[_0x0ed9('0x1b')]();});}};}function handleEntityNotFound(_0x1b7b3e,_0x12bace){return function(_0x121330){if(!_0x121330){_0x1b7b3e[_0x0ed9('0x19')](0x194);}return _0x121330;};}function handleError(_0x5dd819,_0x112082){_0x112082=_0x112082||0x1f4;return function(_0x29da1e){logger[_0x0ed9('0x28')](_0x29da1e[_0x0ed9('0x29')]);if(_0x29da1e[_0x0ed9('0x2a')]){delete _0x29da1e[_0x0ed9('0x2a')];}_0x5dd819[_0x0ed9('0x1a')](_0x112082)['send'](_0x29da1e);};}exports['index']=function(_0x1bbdd2,_0x59fc79){var _0x206156={},_0x47b1d2={},_0x11a2c9={'count':0x0,'rows':[]};var _0x3bf7f2=_[_0x0ed9('0x2b')](db[_0x0ed9('0x2c')]['rawAttributes'],function(_0x1554b0){return{'name':_0x1554b0[_0x0ed9('0x2d')],'type':_0x1554b0[_0x0ed9('0x2e')][_0x0ed9('0x2f')]};});_0x47b1d2[_0x0ed9('0x30')]=_[_0x0ed9('0x2b')](_0x3bf7f2,_0x0ed9('0x2a'));_0x47b1d2['query']=_['keys'](_0x1bbdd2[_0x0ed9('0x31')]);_0x47b1d2['filters']=_[_0x0ed9('0x32')](_0x47b1d2['model'],_0x47b1d2['query']);_0x206156[_0x0ed9('0x33')]=_['intersection'](_0x47b1d2['model'],qs[_0x0ed9('0x34')](_0x1bbdd2[_0x0ed9('0x31')][_0x0ed9('0x34')]));_0x206156[_0x0ed9('0x33')]=_0x206156['attributes'][_0x0ed9('0x35')]?_0x206156[_0x0ed9('0x33')]:_0x47b1d2[_0x0ed9('0x30')];if(!_0x1bbdd2[_0x0ed9('0x31')][_0x0ed9('0x36')](_0x0ed9('0x37'))){_0x206156[_0x0ed9('0x1f')]=qs['limit'](_0x1bbdd2['query'][_0x0ed9('0x1f')]);_0x206156[_0x0ed9('0x1d')]=qs['offset'](_0x1bbdd2[_0x0ed9('0x31')][_0x0ed9('0x1d')]);}_0x206156['order']=qs['sort'](_0x1bbdd2[_0x0ed9('0x31')][_0x0ed9('0x38')]);_0x206156[_0x0ed9('0x39')]=qs[_0x0ed9('0x3a')](_[_0x0ed9('0x3b')](_0x1bbdd2[_0x0ed9('0x31')],_0x47b1d2['filters']),_0x3bf7f2);if(_0x1bbdd2[_0x0ed9('0x31')][_0x0ed9('0x3c')]){_0x206156['where']=_[_0x0ed9('0x3d')](_0x206156['where'],{'$or':_[_0x0ed9('0x2b')](_0x3bf7f2,function(_0x22097a){if(_0x22097a[_0x0ed9('0x2e')]!==_0x0ed9('0x3e')){var _0x55ede2={};_0x55ede2[_0x22097a[_0x0ed9('0x2a')]]={'$like':'%'+_0x1bbdd2[_0x0ed9('0x31')][_0x0ed9('0x3c')]+'%'};return _0x55ede2;}})});}_0x206156=_[_0x0ed9('0x3d')]({},_0x206156,_0x1bbdd2['options']);var _0xdc5b15={'where':_0x206156[_0x0ed9('0x39')]};return db[_0x0ed9('0x2c')][_0x0ed9('0x20')](_0xdc5b15)[_0x0ed9('0x25')](function(_0x326bb3){_0x11a2c9['count']=_0x326bb3;if(_0x1bbdd2[_0x0ed9('0x31')][_0x0ed9('0x3f')]){_0x206156[_0x0ed9('0x40')]=[{'all':!![]}];}return db['CmHopperAdditionalPhone'][_0x0ed9('0x41')](_0x206156);})['then'](function(_0x4de173){_0x11a2c9[_0x0ed9('0x42')]=_0x4de173;return _0x11a2c9;})['then'](respondWithFilteredResult(_0x59fc79,_0x206156))[_0x0ed9('0x43')](handleError(_0x59fc79,null));};exports[_0x0ed9('0x44')]=function(_0x522968,_0x445cb3){var _0x3b4331={'raw':!![],'where':{'id':_0x522968[_0x0ed9('0x45')]['id']}},_0x476742={};_0x476742[_0x0ed9('0x30')]=_[_0x0ed9('0x46')](db[_0x0ed9('0x2c')]['rawAttributes']);_0x476742[_0x0ed9('0x31')]=_['keys'](_0x522968[_0x0ed9('0x31')]);_0x476742[_0x0ed9('0x3a')]=_[_0x0ed9('0x32')](_0x476742['model'],_0x476742[_0x0ed9('0x31')]);_0x3b4331[_0x0ed9('0x33')]=_[_0x0ed9('0x32')](_0x476742[_0x0ed9('0x30')],qs['fields'](_0x522968[_0x0ed9('0x31')][_0x0ed9('0x34')]));_0x3b4331[_0x0ed9('0x33')]=_0x3b4331[_0x0ed9('0x33')]['length']?_0x3b4331[_0x0ed9('0x33')]:_0x476742[_0x0ed9('0x30')];if(_0x522968[_0x0ed9('0x31')][_0x0ed9('0x3f')]){_0x3b4331[_0x0ed9('0x40')]=[{'all':!![]}];}_0x3b4331=_['merge']({},_0x3b4331,_0x522968['options']);return db['CmHopperAdditionalPhone']['find'](_0x3b4331)[_0x0ed9('0x25')](handleEntityNotFound(_0x445cb3,null))['then'](respondWithResult(_0x445cb3,null))['catch'](handleError(_0x445cb3,null));};exports[_0x0ed9('0x47')]=function(_0x65cd1d,_0x13f0e4){return db[_0x0ed9('0x2c')][_0x0ed9('0x47')](_0x65cd1d[_0x0ed9('0x48')],{})[_0x0ed9('0x25')](function(_0x1692ee){var _0x185fa1=_0x65cd1d[_0x0ed9('0x49')]['get']({'plain':!![]});if(!_0x185fa1)throw new Error(_0x0ed9('0x4a'));if(_0x185fa1[_0x0ed9('0x4b')]===_0x0ed9('0x49')){var _0x4a821b=_0x1692ee[_0x0ed9('0x4c')]({'plain':!![]});var _0x46bea4=_0x0ed9('0x27');return db[_0x0ed9('0x4d')][_0x0ed9('0x4e')]({'where':{'name':_0x46bea4,'userProfileId':_0x185fa1[_0x0ed9('0x4f')]},'raw':!![]})['then'](function(_0x2567e5){if(_0x2567e5&&_0x2567e5[_0x0ed9('0x50')]===0x0){return db[_0x0ed9('0x51')][_0x0ed9('0x47')]({'name':_0x4a821b[_0x0ed9('0x2a')],'resourceId':_0x4a821b['id'],'type':_0x2567e5[_0x0ed9('0x2a')],'sectionId':_0x2567e5['id']},{})[_0x0ed9('0x25')](function(){return _0x1692ee;});}else{return _0x1692ee;}})['catch'](function(_0x28c78b){logger['error'](_0x0ed9('0x52'),_0x28c78b);throw _0x28c78b;});}return _0x1692ee;})[_0x0ed9('0x25')](respondWithResult(_0x13f0e4,0xc9))[_0x0ed9('0x43')](handleError(_0x13f0e4,null));};exports[_0x0ed9('0x24')]=function(_0x31f767,_0x1ee3f5){if(_0x31f767[_0x0ed9('0x48')]['id']){delete _0x31f767['body']['id'];}return db[_0x0ed9('0x2c')]['find']({'where':{'id':_0x31f767[_0x0ed9('0x45')]['id']}})[_0x0ed9('0x25')](handleEntityNotFound(_0x1ee3f5,null))[_0x0ed9('0x25')](saveUpdates(_0x31f767['body'],null))[_0x0ed9('0x25')](respondWithResult(_0x1ee3f5,null))[_0x0ed9('0x43')](handleError(_0x1ee3f5,null));};exports[_0x0ed9('0x26')]=function(_0x372626,_0x3fedde){return db['CmHopperAdditionalPhone']['find']({'where':{'id':_0x372626[_0x0ed9('0x45')]['id']}})[_0x0ed9('0x25')](handleEntityNotFound(_0x3fedde,null))[_0x0ed9('0x25')](removeEntity(_0x3fedde,null))[_0x0ed9('0x43')](handleError(_0x3fedde,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 073bf9f..d3da4d4 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xba06=['bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','cm_hopper_additional_phones','lodash','../../config/logger','api'];(function(_0x20a635,_0x20161b){var _0x41a849=function(_0x4b0355){while(--_0x4b0355){_0x20a635['push'](_0x20a635['shift']());}};_0x41a849(++_0x20161b);}(_0xba06,0xcf));var _0x6ba0=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xba06[_0x36ed48];return _0x51c63a;};'use strict';var _=require(_0x6ba0('0x0'));var util=require('util');var logger=require(_0x6ba0('0x1'))(_0x6ba0('0x2'));var moment=require('moment');var BPromise=require(_0x6ba0('0x3'));var rp=require(_0x6ba0('0x4'));var fs=require('fs');var path=require(_0x6ba0('0x5'));var rimraf=require(_0x6ba0('0x6'));var config=require(_0x6ba0('0x7'));var attributes=require(_0x6ba0('0x8'));module['exports']=function(_0xd239e5,_0x1a37b1){return _0xd239e5['define']('CmHopperAdditionalPhone',attributes,{'tableName':_0x6ba0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x028a=['exports','lodash','util','../../config/logger','moment','bluebird','request-promise','path','./cmHopperAdditionalPhone.attributes'];(function(_0x419715,_0x221336){var _0x274fbd=function(_0x5119b0){while(--_0x5119b0){_0x419715['push'](_0x419715['shift']());}};_0x274fbd(++_0x221336);}(_0x028a,0xfd));var _0xa028=function(_0x24b62c,_0x46def1){_0x24b62c=_0x24b62c-0x0;var _0x27fe6c=_0x028a[_0x24b62c];return _0x27fe6c;};'use strict';var _=require(_0xa028('0x0'));var util=require(_0xa028('0x1'));var logger=require(_0xa028('0x2'))('api');var moment=require(_0xa028('0x3'));var BPromise=require(_0xa028('0x4'));var rp=require(_0xa028('0x5'));var fs=require('fs');var path=require(_0xa028('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa028('0x7'));module[_0xa028('0x8')]=function(_0x2805a9,_0x540dd4){return _0x2805a9['define']('CmHopperAdditionalPhone',attributes,{'tableName':'cm_hopper_additional_phones','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js index cace0b4..9b7871f 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7505=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','VerifyAdditionalPhones','CmHopper','findOne','body','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','countbusyretry','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','entity','ASC','countnoanswerretry','countagentrejectretry','dialGlobalMaxRetry','SwapAdditionalPhones','ContactId','duration','waitTime','isNil','add','minutes','scheduledat','phone','createdAt','updatedAt','sequelize','transaction','activateAdditionalPhone','IncrementPreviewCounters','update','lodash','util','moment','randomstring'];(function(_0x4b0d5,_0x588199){var _0x2e8607=function(_0x583782){while(--_0x583782){_0x4b0d5['push'](_0x4b0d5['shift']());}};_0x2e8607(++_0x588199);}(_0x7505,0x1cc));var _0x5750=function(_0xf13e4,_0x4fa777){_0xf13e4=_0xf13e4-0x0;var _0xd1f58e=_0x7505[_0xf13e4];return _0xd1f58e;};'use strict';var _=require(_0x5750('0x0'));var util=require(_0x5750('0x1'));var moment=require(_0x5750('0x2'));var BPromise=require('bluebird');var rs=require(_0x5750('0x3'));var fs=require('fs');var Redis=require(_0x5750('0x4'));var db=require(_0x5750('0x5'))['db'];var utils=require(_0x5750('0x6'));var logger=require(_0x5750('0x7'))('rpc');var config=require(_0x5750('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5750('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34bfe1,_0x4ebbf4,_0x53bbaf){return new BPromise(function(_0x1301e0,_0x1a80e7){return client['request'](_0x34bfe1,_0x53bbaf)[_0x5750('0xa')](function(_0x135344){logger[_0x5750('0xb')](_0x5750('0xc'),_0x4ebbf4,_0x5750('0xd'));logger[_0x5750('0xe')](_0x5750('0xf'),_0x4ebbf4,'request\x20sent',JSON[_0x5750('0x10')](_0x135344));if(_0x135344['error']){if(_0x135344['error'][_0x5750('0x11')]===0x1f4){logger['error'](_0x5750('0xc'),_0x4ebbf4,_0x135344[_0x5750('0x12')]['message']);return _0x1a80e7(_0x135344[_0x5750('0x12')][_0x5750('0x13')]);}logger[_0x5750('0x12')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x4ebbf4,_0x135344[_0x5750('0x12')][_0x5750('0x13')]);return _0x1301e0(_0x135344['error'][_0x5750('0x13')]);}else{logger['info'](_0x5750('0xc'),_0x4ebbf4,'request\x20sent');_0x1301e0(_0x135344[_0x5750('0x14')][_0x5750('0x13')]);}})[_0x5750('0x15')](function(_0x43edc4){logger[_0x5750('0x12')](_0x5750('0xc'),_0x4ebbf4,_0x43edc4);_0x1a80e7(_0x43edc4);});});}exports[_0x5750('0x16')]=function(_0x95a8ca){var _0x1b0e24=this;return new Promise(function(_0x265f12,_0x5d909c){return db[_0x5750('0x17')][_0x5750('0x18')]({'raw':!![],'where':{'ContactId':_0x95a8ca['body']['ContactId'],'ListId':_0x95a8ca[_0x5750('0x19')][_0x5750('0x1a')],'VoiceQueueId':_0x95a8ca[_0x5750('0x19')]['VoiceQueueId']===undefined?null:_0x95a8ca['body'][_0x5750('0x1b')],'CampaignId':_0x95a8ca[_0x5750('0x19')][_0x5750('0x1c')]===undefined?null:_0x95a8ca['body'][_0x5750('0x1c')]}})[_0x5750('0xa')](function(_0x138dcf){if(_0x138dcf!=null){return db[_0x5750('0x1d')][_0x5750('0x18')]({'raw':!![],'where':{'CmHopperId':_0x138dcf['id'],'OrderBy':{'$gt':_0x138dcf['OrderBy']}},'order':[[_0x5750('0x1e'),'ASC']]})[_0x5750('0xa')](function(_0x2168bd){var _0x4f6a8b=0x0;if(_0x2168bd){if(_0x2168bd[_0x5750('0x1f')]+_0x2168bd[_0x5750('0x20')]+_0x2168bd['countnoanswerretry']+_0x2168bd[_0x5750('0x21')]+_0x2168bd[_0x5750('0x22')]+_0x2168bd[_0x5750('0x23')]+_0x2168bd[_0x5750('0x24')]+_0x2168bd['countagentrejectretry']<_0x95a8ca[_0x5750('0x25')]['dialGlobalMaxRetry'])_0x4f6a8b=0x1;_0x265f12({'additional':_0x4f6a8b});}else{return db[_0x5750('0x1d')][_0x5750('0x18')]({'raw':!![],'where':{'CmHopperId':_0x138dcf['id']},'order':[[_0x5750('0x1e'),_0x5750('0x26')]]})[_0x5750('0xa')](function(_0x20f764){var _0x3578e6=0x0;if(_0x20f764){if(_0x20f764['countbusyretry']+_0x20f764[_0x5750('0x20')]+_0x20f764[_0x5750('0x27')]+_0x20f764['countnosuchnumberretry']+_0x20f764[_0x5750('0x22')]+_0x20f764[_0x5750('0x23')]+_0x20f764[_0x5750('0x24')]+_0x20f764[_0x5750('0x28')]<_0x95a8ca[_0x5750('0x25')][_0x5750('0x29')])_0x3578e6=0x1;_0x265f12({'additional':_0x3578e6});}else{_0x265f12({'additional':0x0});}})['catch'](function(_0x14c977){logger[_0x5750('0x12')]('VerifyAdditionalPhones',_0x14c977[_0x5750('0x13')]);_0x5d909c(_0x1b0e24[_0x5750('0x12')](0x1f4,_0x14c977[_0x5750('0x13')]));});}})['catch'](function(_0x36ca99){logger[_0x5750('0x12')](_0x5750('0x16'),_0x36ca99[_0x5750('0x13')]);_0x5d909c(_0x1b0e24[_0x5750('0x12')](0x1f4,_0x36ca99[_0x5750('0x13')]));});}else _0x265f12({'additional':0x0});});});};exports[_0x5750('0x2a')]=function(_0x29a0a2){var _0x11c202=this;return new Promise(function(_0x28bac,_0x53668c){return db[_0x5750('0x17')][_0x5750('0x18')]({'raw':!![],'where':{'ContactId':_0x29a0a2['body'][_0x5750('0x2b')],'ListId':_0x29a0a2['body'][_0x5750('0x1a')],'VoiceQueueId':_0x29a0a2[_0x5750('0x19')]['VoiceQueueId']===undefined?null:_0x29a0a2[_0x5750('0x19')][_0x5750('0x1b')],'CampaignId':_0x29a0a2['body'][_0x5750('0x1c')]===undefined?null:_0x29a0a2[_0x5750('0x19')][_0x5750('0x1c')]}})[_0x5750('0xa')](function(_0x39f63e){if(_0x39f63e!=null){return db['CmHopperAdditionalPhone'][_0x5750('0x18')]({'raw':!![],'where':{'CmHopperId':_0x39f63e['id'],'OrderBy':{'$gte':_0x39f63e[_0x5750('0x1e')]}},'order':[[_0x5750('0x1e'),_0x5750('0x26')]]})[_0x5750('0xa')](function(_0x3bd852){if(_0x3bd852)return activateAdditionalPhone(_0x39f63e,_0x29a0a2[_0x5750('0x19')],_0x3bd852,_0x29a0a2[_0x5750('0x2c')],_0x29a0a2[_0x5750('0x2d')])[_0x5750('0xa')](function(_0x5afe02){_0x28bac(_0x5afe02);});else{return db[_0x5750('0x1d')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x39f63e['id']},'order':[[_0x5750('0x1e'),_0x5750('0x26')]]})[_0x5750('0xa')](function(_0x56d3bc){if(_0x56d3bc)return activateAdditionalPhone(_0x39f63e,_0x29a0a2['body'],_0x56d3bc,_0x29a0a2['duration'],_0x29a0a2[_0x5750('0x2d')])[_0x5750('0xa')](function(_0x36989c){_0x28bac(_0x36989c);});else{_0x28bac({'id':_0x39f63e['id'],'phone':''});}})[_0x5750('0x15')](function(_0x25a156){logger['error'](_0x5750('0x16'),_0x25a156['message']);_0x53668c(_0x11c202[_0x5750('0x12')](0x1f4,_0x25a156[_0x5750('0x13')]));});}})[_0x5750('0x15')](function(_0x4d1059){logger[_0x5750('0x12')](_0x5750('0x16'),_0x4d1059[_0x5750('0x13')]);_0x53668c(_0x11c202['error'](0x1f4,_0x4d1059[_0x5750('0x13')]));});}else _0x28bac(0x1);});});};function activateAdditionalPhone(_0x541604,_0x3fd223,_0x49c44e,_0xf4eb8d,_0x17fcbf){return new Promise(function(_0x210424,_0x4bce86){var _0x18f9ae;if(_[_0x5750('0x2e')](_0x49c44e['scheduledat'])){_0x49c44e['scheduledat']=moment();}if(moment()>moment(_0x49c44e['scheduledat'])){_0x18f9ae=moment()[_0x5750('0x2f')](_0x17fcbf||0x3,_0x5750('0x30'));}else{if(_0x49c44e[_0x5750('0x1e')]==0x0){_0x18f9ae=moment(_0x49c44e[_0x5750('0x31')]);}else{_0x18f9ae=moment()[_0x5750('0x2f')](_0x17fcbf||0x3,_0x5750('0x30'));}}if(_[_0x5750('0x2e')](_0x18f9ae)){_0x18f9ae=moment()[_0x5750('0x2f')](_0x17fcbf||0x3,'minutes');}var _0x3a9490={'phone':_0x541604[_0x5750('0x32')],'active':0x0,'OrderBy':_[_0x5750('0x2e')](_0x541604[_0x5750('0x1e')])?0x0:_0x541604['OrderBy'],'scheduledat':moment()[_0x5750('0x2f')](_0xf4eb8d||0x1,'minutes'),'countbusyretry':_0x3fd223['countbusyretry'],'countcongestionretry':_0x3fd223[_0x5750('0x20')],'countnoanswerretry':_0x3fd223[_0x5750('0x27')],'countnosuchnumberretry':_0x3fd223['countnosuchnumberretry'],'countdropretry':_0x3fd223[_0x5750('0x22')],'countabandonedretry':_0x3fd223['countabandonedretry'],'countmachineretry':_0x3fd223[_0x5750('0x24')],'countagentrejectretry':_0x3fd223[_0x5750('0x28')],'createdAt':_0x3fd223[_0x5750('0x33')],'updatedAt':_0x3fd223[_0x5750('0x34')]};var _0x836418={'CmHopperId':_0x541604['id'],'phone':_0x49c44e[_0x5750('0x32')],'active':0x0,'OrderBy':_[_0x5750('0x2e')](_0x49c44e['OrderBy'])?0x0:_0x49c44e[_0x5750('0x1e')],'scheduledat':_0x18f9ae,'countbusyretry':_0x49c44e[_0x5750('0x1f')],'countcongestionretry':_0x49c44e[_0x5750('0x20')],'countnoanswerretry':_0x49c44e['countnoanswerretry'],'countnosuchnumberretry':_0x49c44e[_0x5750('0x21')],'countdropretry':_0x49c44e[_0x5750('0x22')],'countabandonedretry':_0x49c44e[_0x5750('0x23')],'countmachineretry':_0x49c44e[_0x5750('0x24')],'countagentrejectretry':_0x49c44e[_0x5750('0x28')],'createdAt':_0x49c44e[_0x5750('0x33')],'updatedAt':_0x49c44e[_0x5750('0x34')]};return db[_0x5750('0x35')][_0x5750('0x36')](function(_0x3377f6){return db[_0x5750('0x1d')]['update'](_0x3a9490,{'where':{'id':_0x49c44e['id']}},{'transaction':_0x3377f6})[_0x5750('0xa')](function(){return db[_0x5750('0x17')]['update'](_0x836418,{'where':{'id':_0x541604['id']}},{'transaction':_0x3377f6});});})[_0x5750('0xa')](function(_0x596cbe){_0x210424({'id':_0x541604['id'],'phone':_0x49c44e['phone']});})[_0x5750('0x15')](function(_0x34f315){logger[_0x5750('0x12')](_0x5750('0x37'),_0x34f315['message']);_0x4bce86({'error':_0x34f315[_0x5750('0x13')]});});});}exports[_0x5750('0x38')]=function(_0x50b3bd){var _0x357128=this;return new Promise(function(_0x5ac86e,_0x1aa69c){return db[_0x5750('0x17')][_0x5750('0x39')](_0x50b3bd[_0x5750('0x19')]['field'],{'where':{'id':_0x50b3bd['body']['id']}})[_0x5750('0xa')](function(_0x32eedc){_0x5ac86e(_0x32eedc);})[_0x5750('0x15')](function(_0x5d1f80){logger['error'](_0x5750('0x38'),_0x5d1f80['message']);_0x1aa69c(_0x357128[_0x5750('0x12')](0x1f4,_0x5d1f80[_0x5750('0x13')]));});});}; \ No newline at end of file +var _0xbcdd=['ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','entity','dialGlobalMaxRetry','ASC','countcongestionretry','countmachineretry','SwapAdditionalPhones','waitTime','duration','isNil','scheduledat','minutes','add','phone','countagentrejectretry','createdAt','updatedAt','sequelize','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','field','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','VerifyAdditionalPhones','CmHopper','findOne','body','ContactId'];(function(_0x14477e,_0x44d4da){var _0x5d4a05=function(_0x5e0fa3){while(--_0x5e0fa3){_0x14477e['push'](_0x14477e['shift']());}};_0x5d4a05(++_0x44d4da);}(_0xbcdd,0x142));var _0xdbcd=function(_0x31991b,_0xaf75d2){_0x31991b=_0x31991b-0x0;var _0x307304=_0xbcdd[_0x31991b];return _0x307304;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xdbcd('0x0'));var BPromise=require(_0xdbcd('0x1'));var rs=require(_0xdbcd('0x2'));var fs=require('fs');var Redis=require(_0xdbcd('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xdbcd('0x4'));var logger=require('../../config/logger')(_0xdbcd('0x5'));var config=require(_0xdbcd('0x6'));var jayson=require(_0xdbcd('0x7'));var client=jayson[_0xdbcd('0x8')][_0xdbcd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d3dbc,_0x31fe53,_0x52c39c){return new BPromise(function(_0x10295e,_0x11a189){return client['request'](_0x5d3dbc,_0x52c39c)[_0xdbcd('0xa')](function(_0x163c49){logger[_0xdbcd('0xb')](_0xdbcd('0xc'),_0x31fe53,'request\x20sent');logger[_0xdbcd('0xd')](_0xdbcd('0xe'),_0x31fe53,_0xdbcd('0xf'),JSON[_0xdbcd('0x10')](_0x163c49));if(_0x163c49[_0xdbcd('0x11')]){if(_0x163c49[_0xdbcd('0x11')][_0xdbcd('0x12')]===0x1f4){logger['error'](_0xdbcd('0xc'),_0x31fe53,_0x163c49[_0xdbcd('0x11')][_0xdbcd('0x13')]);return _0x11a189(_0x163c49[_0xdbcd('0x11')]['message']);}logger[_0xdbcd('0x11')](_0xdbcd('0xc'),_0x31fe53,_0x163c49[_0xdbcd('0x11')][_0xdbcd('0x13')]);return _0x10295e(_0x163c49[_0xdbcd('0x11')][_0xdbcd('0x13')]);}else{logger['info'](_0xdbcd('0xc'),_0x31fe53,_0xdbcd('0xf'));_0x10295e(_0x163c49['result'][_0xdbcd('0x13')]);}})[_0xdbcd('0x14')](function(_0x5ecb2a){logger[_0xdbcd('0x11')](_0xdbcd('0xc'),_0x31fe53,_0x5ecb2a);_0x11a189(_0x5ecb2a);});});}exports[_0xdbcd('0x15')]=function(_0x3cdc73){var _0x5a3e50=this;return new Promise(function(_0x2cc016,_0x39b471){return db[_0xdbcd('0x16')][_0xdbcd('0x17')]({'raw':!![],'where':{'ContactId':_0x3cdc73[_0xdbcd('0x18')][_0xdbcd('0x19')],'ListId':_0x3cdc73[_0xdbcd('0x18')][_0xdbcd('0x1a')],'VoiceQueueId':_0x3cdc73[_0xdbcd('0x18')][_0xdbcd('0x1b')]===undefined?null:_0x3cdc73['body'][_0xdbcd('0x1b')],'CampaignId':_0x3cdc73[_0xdbcd('0x18')][_0xdbcd('0x1c')]===undefined?null:_0x3cdc73['body'][_0xdbcd('0x1c')]}})[_0xdbcd('0xa')](function(_0x29b39b){if(_0x29b39b!=null){return db[_0xdbcd('0x1d')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x29b39b['id'],'OrderBy':{'$gt':_0x29b39b[_0xdbcd('0x1e')]}},'order':[['OrderBy','ASC']]})[_0xdbcd('0xa')](function(_0x63494f){var _0x32d3c7=0x0;if(_0x63494f){if(_0x63494f[_0xdbcd('0x1f')]+_0x63494f['countcongestionretry']+_0x63494f[_0xdbcd('0x20')]+_0x63494f[_0xdbcd('0x21')]+_0x63494f[_0xdbcd('0x22')]+_0x63494f[_0xdbcd('0x23')]+_0x63494f['countmachineretry']+_0x63494f['countagentrejectretry']<_0x3cdc73[_0xdbcd('0x24')][_0xdbcd('0x25')])_0x32d3c7=0x1;_0x2cc016({'additional':_0x32d3c7});}else{return db['CmHopperAdditionalPhone'][_0xdbcd('0x17')]({'raw':!![],'where':{'CmHopperId':_0x29b39b['id']},'order':[[_0xdbcd('0x1e'),_0xdbcd('0x26')]]})['then'](function(_0x263385){var _0xe13d63=0x0;if(_0x263385){if(_0x263385[_0xdbcd('0x1f')]+_0x263385[_0xdbcd('0x27')]+_0x263385[_0xdbcd('0x20')]+_0x263385[_0xdbcd('0x21')]+_0x263385[_0xdbcd('0x22')]+_0x263385['countabandonedretry']+_0x263385[_0xdbcd('0x28')]+_0x263385['countagentrejectretry']<_0x3cdc73[_0xdbcd('0x24')][_0xdbcd('0x25')])_0xe13d63=0x1;_0x2cc016({'additional':_0xe13d63});}else{_0x2cc016({'additional':0x0});}})['catch'](function(_0x3170d2){logger[_0xdbcd('0x11')](_0xdbcd('0x15'),_0x3170d2[_0xdbcd('0x13')]);_0x39b471(_0x5a3e50[_0xdbcd('0x11')](0x1f4,_0x3170d2[_0xdbcd('0x13')]));});}})[_0xdbcd('0x14')](function(_0x4533ed){logger[_0xdbcd('0x11')]('VerifyAdditionalPhones',_0x4533ed['message']);_0x39b471(_0x5a3e50['error'](0x1f4,_0x4533ed[_0xdbcd('0x13')]));});}else _0x2cc016({'additional':0x0});});});};exports[_0xdbcd('0x29')]=function(_0x29a0e5){var _0x2f64a3=this;return new Promise(function(_0x4b38a8,_0x13f219){return db[_0xdbcd('0x16')][_0xdbcd('0x17')]({'raw':!![],'where':{'ContactId':_0x29a0e5[_0xdbcd('0x18')]['ContactId'],'ListId':_0x29a0e5[_0xdbcd('0x18')][_0xdbcd('0x1a')],'VoiceQueueId':_0x29a0e5[_0xdbcd('0x18')][_0xdbcd('0x1b')]===undefined?null:_0x29a0e5[_0xdbcd('0x18')][_0xdbcd('0x1b')],'CampaignId':_0x29a0e5['body'][_0xdbcd('0x1c')]===undefined?null:_0x29a0e5[_0xdbcd('0x18')][_0xdbcd('0x1c')]}})[_0xdbcd('0xa')](function(_0x2397c5){if(_0x2397c5!=null){return db['CmHopperAdditionalPhone'][_0xdbcd('0x17')]({'raw':!![],'where':{'CmHopperId':_0x2397c5['id'],'OrderBy':{'$gte':_0x2397c5['OrderBy']}},'order':[['OrderBy',_0xdbcd('0x26')]]})['then'](function(_0x52a6ea){if(_0x52a6ea)return activateAdditionalPhone(_0x2397c5,_0x29a0e5[_0xdbcd('0x18')],_0x52a6ea,_0x29a0e5['duration'],_0x29a0e5[_0xdbcd('0x2a')])[_0xdbcd('0xa')](function(_0xb1c547){_0x4b38a8(_0xb1c547);});else{return db[_0xdbcd('0x1d')][_0xdbcd('0x17')]({'raw':!![],'where':{'CmHopperId':_0x2397c5['id']},'order':[[_0xdbcd('0x1e'),_0xdbcd('0x26')]]})[_0xdbcd('0xa')](function(_0x288931){if(_0x288931)return activateAdditionalPhone(_0x2397c5,_0x29a0e5['body'],_0x288931,_0x29a0e5[_0xdbcd('0x2b')],_0x29a0e5[_0xdbcd('0x2a')])[_0xdbcd('0xa')](function(_0x2c44ec){_0x4b38a8(_0x2c44ec);});else{_0x4b38a8({'id':_0x2397c5['id'],'phone':''});}})[_0xdbcd('0x14')](function(_0x5bbdd7){logger[_0xdbcd('0x11')](_0xdbcd('0x15'),_0x5bbdd7['message']);_0x13f219(_0x2f64a3[_0xdbcd('0x11')](0x1f4,_0x5bbdd7[_0xdbcd('0x13')]));});}})[_0xdbcd('0x14')](function(_0x30985a){logger[_0xdbcd('0x11')](_0xdbcd('0x15'),_0x30985a['message']);_0x13f219(_0x2f64a3['error'](0x1f4,_0x30985a[_0xdbcd('0x13')]));});}else _0x4b38a8(0x1);});});};function activateAdditionalPhone(_0x810e24,_0x52f5bd,_0x30606e,_0x29d157,_0x3b24dc){return new Promise(function(_0x31563a,_0x2217ad){var _0x43836b;if(_[_0xdbcd('0x2c')](_0x30606e['scheduledat'])){_0x30606e[_0xdbcd('0x2d')]=moment();}if(moment()>moment(_0x30606e[_0xdbcd('0x2d')])){_0x43836b=moment()['add'](_0x3b24dc||0x3,_0xdbcd('0x2e'));}else{if(_0x30606e[_0xdbcd('0x1e')]==0x0){_0x43836b=moment(_0x30606e[_0xdbcd('0x2d')]);}else{_0x43836b=moment()[_0xdbcd('0x2f')](_0x3b24dc||0x3,_0xdbcd('0x2e'));}}if(_[_0xdbcd('0x2c')](_0x43836b)){_0x43836b=moment()[_0xdbcd('0x2f')](_0x3b24dc||0x3,_0xdbcd('0x2e'));}var _0x173bea={'phone':_0x810e24[_0xdbcd('0x30')],'active':0x0,'OrderBy':_[_0xdbcd('0x2c')](_0x810e24['OrderBy'])?0x0:_0x810e24[_0xdbcd('0x1e')],'scheduledat':moment()[_0xdbcd('0x2f')](_0x29d157||0x1,_0xdbcd('0x2e')),'countbusyretry':_0x52f5bd['countbusyretry'],'countcongestionretry':_0x52f5bd[_0xdbcd('0x27')],'countnoanswerretry':_0x52f5bd[_0xdbcd('0x20')],'countnosuchnumberretry':_0x52f5bd[_0xdbcd('0x21')],'countdropretry':_0x52f5bd[_0xdbcd('0x22')],'countabandonedretry':_0x52f5bd[_0xdbcd('0x23')],'countmachineretry':_0x52f5bd['countmachineretry'],'countagentrejectretry':_0x52f5bd[_0xdbcd('0x31')],'createdAt':_0x52f5bd[_0xdbcd('0x32')],'updatedAt':_0x52f5bd[_0xdbcd('0x33')]};var _0x4d6390={'CmHopperId':_0x810e24['id'],'phone':_0x30606e[_0xdbcd('0x30')],'active':0x0,'OrderBy':_[_0xdbcd('0x2c')](_0x30606e[_0xdbcd('0x1e')])?0x0:_0x30606e[_0xdbcd('0x1e')],'scheduledat':_0x43836b,'countbusyretry':_0x30606e[_0xdbcd('0x1f')],'countcongestionretry':_0x30606e[_0xdbcd('0x27')],'countnoanswerretry':_0x30606e[_0xdbcd('0x20')],'countnosuchnumberretry':_0x30606e[_0xdbcd('0x21')],'countdropretry':_0x30606e['countdropretry'],'countabandonedretry':_0x30606e[_0xdbcd('0x23')],'countmachineretry':_0x30606e[_0xdbcd('0x28')],'countagentrejectretry':_0x30606e[_0xdbcd('0x31')],'createdAt':_0x30606e['createdAt'],'updatedAt':_0x30606e[_0xdbcd('0x33')]};return db[_0xdbcd('0x34')][_0xdbcd('0x35')](function(_0x59599a){return db[_0xdbcd('0x1d')]['update'](_0x173bea,{'where':{'id':_0x30606e['id']}},{'transaction':_0x59599a})[_0xdbcd('0xa')](function(){return db[_0xdbcd('0x16')][_0xdbcd('0x36')](_0x4d6390,{'where':{'id':_0x810e24['id']}},{'transaction':_0x59599a});});})['then'](function(_0x46bbaa){_0x31563a({'id':_0x810e24['id'],'phone':_0x30606e[_0xdbcd('0x30')]});})[_0xdbcd('0x14')](function(_0x1baea2){logger[_0xdbcd('0x11')](_0xdbcd('0x37'),_0x1baea2[_0xdbcd('0x13')]);_0x2217ad({'error':_0x1baea2[_0xdbcd('0x13')]});});});}exports[_0xdbcd('0x38')]=function(_0x1bf451){var _0x417525=this;return new Promise(function(_0x1e92a0,_0x2ec6c2){return db[_0xdbcd('0x16')][_0xdbcd('0x36')](_0x1bf451[_0xdbcd('0x18')][_0xdbcd('0x39')],{'where':{'id':_0x1bf451[_0xdbcd('0x18')]['id']}})[_0xdbcd('0xa')](function(_0x30d584){_0x1e92a0(_0x30d584);})['catch'](function(_0x3e0dbe){logger[_0xdbcd('0x11')](_0xdbcd('0x38'),_0x3e0dbe[_0xdbcd('0x13')]);_0x2ec6c2(_0x417525[_0xdbcd('0x11')](0x1f4,_0x3e0dbe['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index f14cb34..a899106 100644 --- a/server/api/cmHopperAdditionalPhone/index.js +++ b/server/api/cmHopperAdditionalPhone/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5d9f=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./cmHopperAdditionalPhone.controller','isAuthenticated','index','/:id','show'];(function(_0x268dce,_0xa9f818){var _0x12ddf9=function(_0x1df241){while(--_0x1df241){_0x268dce['push'](_0x268dce['shift']());}};_0x12ddf9(++_0xa9f818);}(_0x5d9f,0x15c));var _0xf5d9=function(_0x24f02a,_0x4da9b6){_0x24f02a=_0x24f02a-0x0;var _0x2c21ef=_0x5d9f[_0x24f02a];return _0x2c21ef;};'use strict';var multer=require(_0xf5d9('0x0'));var util=require(_0xf5d9('0x1'));var path=require(_0xf5d9('0x2'));var timeout=require(_0xf5d9('0x3'));var express=require(_0xf5d9('0x4'));var router=express['Router']();var fs_extra=require(_0xf5d9('0x5'));var auth=require(_0xf5d9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf5d9('0x7'));var controller=require(_0xf5d9('0x8'));router['get']('/',auth[_0xf5d9('0x9')](),controller[_0xf5d9('0xa')]);router['get'](_0xf5d9('0xb'),auth['isAuthenticated'](),controller[_0xf5d9('0xc')]);router['post']('/',auth[_0xf5d9('0x9')](),controller[_0xf5d9('0xd')]);router[_0xf5d9('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xf5d9('0xf')]);router[_0xf5d9('0x10')](_0xf5d9('0xb'),auth[_0xf5d9('0x9')](),controller[_0xf5d9('0x11')]);module[_0xf5d9('0x12')]=router; \ No newline at end of file +var _0x790c=['isAuthenticated','index','/:id','create','put','update','delete','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x2ee80e,_0x1123ff){var _0x2c1e41=function(_0x597e6a){while(--_0x597e6a){_0x2ee80e['push'](_0x2ee80e['shift']());}};_0x2c1e41(++_0x1123ff);}(_0x790c,0x106));var _0xc790=function(_0x2cbb74,_0x241c10){_0x2cbb74=_0x2cbb74-0x0;var _0xa6d18=_0x790c[_0x2cbb74];return _0xa6d18;};'use strict';var multer=require(_0xc790('0x0'));var util=require(_0xc790('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc790('0x2')]();var fs_extra=require(_0xc790('0x3'));var auth=require(_0xc790('0x4'));var interaction=require(_0xc790('0x5'));var config=require(_0xc790('0x6'));var controller=require('./cmHopperAdditionalPhone.controller');router[_0xc790('0x7')]('/',auth[_0xc790('0x8')](),controller[_0xc790('0x9')]);router['get'](_0xc790('0xa'),auth[_0xc790('0x8')](),controller['show']);router['post']('/',auth[_0xc790('0x8')](),controller[_0xc790('0xb')]);router[_0xc790('0xc')](_0xc790('0xa'),auth[_0xc790('0x8')](),controller[_0xc790('0xd')]);router[_0xc790('0xe')](_0xc790('0xa'),auth[_0xc790('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 0b97489..9a72790 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 _0x1561=['contactListQueue','exports','STRING','INTEGER'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1561,0x1bd));var _0x1156=function(_0x3fa148,_0x1573b7){_0x3fa148=_0x3fa148-0x0;var _0x2d985c=_0x1561[_0x3fa148];return _0x2d985c;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1156('0x0')]={'phone':{'type':Sequelize[_0x1156('0x1')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x1156('0x2')],'unique':_0x1156('0x3')},'ListId':{'type':Sequelize[_0x1156('0x2')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0x1156('0x2')],'unique':_0x1156('0x3')}}; \ No newline at end of file +var _0x25fa=['moment','exports','STRING','contactListQueue','INTEGER'];(function(_0x41eb72,_0x2eebb7){var _0x4803a6=function(_0x13f70b){while(--_0x13f70b){_0x41eb72['push'](_0x41eb72['shift']());}};_0x4803a6(++_0x2eebb7);}(_0x25fa,0x109));var _0xa25f=function(_0x365852,_0x5f15eb){_0x365852=_0x365852-0x0;var _0x34dc81=_0x25fa[_0x365852];return _0x34dc81;};'use strict';var moment=require(_0xa25f('0x0'));var Sequelize=require('sequelize');module[_0xa25f('0x1')]={'phone':{'type':Sequelize[_0xa25f('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xa25f('0x3')},'ListId':{'type':Sequelize[_0xa25f('0x4')],'unique':_0xa25f('0x3')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index a8b4f33..9b576e2 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 _0x2baf=['undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','fieldName','type','key','model','keys','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','filters','filter','where','VIRTUAL','merge','options','CmHopperBlack','includeAll','include','findAll','catch','show','rawAttributes','find','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json'];(function(_0x244399,_0x144f7f){var _0x944d41=function(_0x8995ac){while(--_0x8995ac){_0x244399['push'](_0x244399['shift']());}};_0x944d41(++_0x144f7f);}(_0x2baf,0xc8));var _0xf2ba=function(_0x4bb2b9,_0x459c78){_0x4bb2b9=_0x4bb2b9-0x0;var _0x40e2a2=_0x2baf[_0x4bb2b9];return _0x40e2a2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf2ba('0x0'));var zipdir=require(_0xf2ba('0x1'));var jsonpatch=require(_0xf2ba('0x2'));var rp=require(_0xf2ba('0x3'));var moment=require(_0xf2ba('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf2ba('0x5'));var util=require('util');var path=require('path');var sox=require(_0xf2ba('0x6'));var csv=require(_0xf2ba('0x7'));var ejs=require(_0xf2ba('0x8'));var fs=require('fs');var fs_extra=require(_0xf2ba('0x9'));var _=require(_0xf2ba('0xa'));var squel=require('squel');var crypto=require(_0xf2ba('0xb'));var jsforce=require(_0xf2ba('0xc'));var deskjs=require(_0xf2ba('0xd'));var toCsv=require(_0xf2ba('0x7'));var querystring=require(_0xf2ba('0xe'));var Papa=require(_0xf2ba('0xf'));var Redis=require(_0xf2ba('0x10'));var authService=require(_0xf2ba('0x11'));var qs=require(_0xf2ba('0x12'));var as=require(_0xf2ba('0x13'));var hardwareService=require(_0xf2ba('0x14'));var logger=require(_0xf2ba('0x15'))(_0xf2ba('0x16'));var utils=require(_0xf2ba('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf2ba('0x18'))['db'];function respondWithStatusCode(_0x101e81,_0x5c6307){_0x5c6307=_0x5c6307||0xcc;return function(_0x34006e){if(_0x34006e){return _0x101e81[_0xf2ba('0x19')](_0x5c6307);}return _0x101e81[_0xf2ba('0x1a')](_0x5c6307)['end']();};}function respondWithResult(_0x3ee056,_0x214430){_0x214430=_0x214430||0xc8;return function(_0x12e446){if(_0x12e446){return _0x3ee056[_0xf2ba('0x1a')](_0x214430)[_0xf2ba('0x1b')](_0x12e446);}};}function respondWithFilteredResult(_0x3499c2,_0x379e42){return function(_0x197ae6){if(_0x197ae6){var _0x16b094=typeof _0x379e42['offset']==='undefined'&&typeof _0x379e42['limit']===_0xf2ba('0x1c');var _0x465e2f=_0x197ae6[_0xf2ba('0x1d')];var _0x2c0bc4=_0x16b094?0x0:_0x379e42[_0xf2ba('0x1e')];var _0x52f53f=_0x16b094?_0x197ae6[_0xf2ba('0x1d')]:_0x379e42[_0xf2ba('0x1e')]+_0x379e42['limit'];var _0x226276;if(_0x52f53f>=_0x465e2f){_0x52f53f=_0x465e2f;_0x226276=0xc8;}else{_0x226276=0xce;}_0x3499c2[_0xf2ba('0x1a')](_0x226276);return _0x3499c2['set'](_0xf2ba('0x1f'),_0x2c0bc4+'-'+_0x52f53f+'/'+_0x465e2f)[_0xf2ba('0x1b')](_0x197ae6);}return null;};}function patchUpdates(_0x5b2724){return function(_0x21ca7e){try{jsonpatch[_0xf2ba('0x20')](_0x21ca7e,_0x5b2724,!![]);}catch(_0x432e80){return BPromise[_0xf2ba('0x21')](_0x432e80);}return _0x21ca7e[_0xf2ba('0x22')]();};}function saveUpdates(_0x505211,_0x3d082){return function(_0x5b8ae6){if(_0x5b8ae6){return _0x5b8ae6[_0xf2ba('0x23')](_0x505211)[_0xf2ba('0x24')](function(_0x599072){return _0x599072;});}return null;};}function removeEntity(_0x5ada32,_0x3de21b){return function(_0x368ffa){if(_0x368ffa){return _0x368ffa[_0xf2ba('0x25')]()[_0xf2ba('0x24')](function(){_0x5ada32[_0xf2ba('0x1a')](0xcc)[_0xf2ba('0x26')]();});}};}function handleEntityNotFound(_0x52f6b1,_0xab07bb){return function(_0x14e2d1){if(!_0x14e2d1){_0x52f6b1[_0xf2ba('0x19')](0x194);}return _0x14e2d1;};}function handleError(_0x50bc4a,_0x486064){_0x486064=_0x486064||0x1f4;return function(_0x151c24){logger[_0xf2ba('0x27')](_0x151c24['stack']);if(_0x151c24[_0xf2ba('0x28')]){delete _0x151c24[_0xf2ba('0x28')];}_0x50bc4a[_0xf2ba('0x1a')](_0x486064)[_0xf2ba('0x29')](_0x151c24);};}exports[_0xf2ba('0x2a')]=function(_0x15d237,_0x24c161){var _0x33adb5={},_0x30164b={},_0x1cd5bd={'count':0x0,'rows':[]};var _0x2b3cc0=_[_0xf2ba('0x2b')](db['CmHopperBlack']['rawAttributes'],function(_0x5bfa95){return{'name':_0x5bfa95[_0xf2ba('0x2c')],'type':_0x5bfa95[_0xf2ba('0x2d')][_0xf2ba('0x2e')]};});_0x30164b[_0xf2ba('0x2f')]=_[_0xf2ba('0x2b')](_0x2b3cc0,'name');_0x30164b['query']=_[_0xf2ba('0x30')](_0x15d237['query']);_0x30164b['filters']=_[_0xf2ba('0x31')](_0x30164b[_0xf2ba('0x2f')],_0x30164b[_0xf2ba('0x32')]);_0x33adb5['attributes']=_[_0xf2ba('0x31')](_0x30164b[_0xf2ba('0x2f')],qs[_0xf2ba('0x33')](_0x15d237[_0xf2ba('0x32')]['fields']));_0x33adb5[_0xf2ba('0x34')]=_0x33adb5['attributes'][_0xf2ba('0x35')]?_0x33adb5[_0xf2ba('0x34')]:_0x30164b[_0xf2ba('0x2f')];if(!_0x15d237[_0xf2ba('0x32')][_0xf2ba('0x36')](_0xf2ba('0x37'))){_0x33adb5[_0xf2ba('0x38')]=qs[_0xf2ba('0x38')](_0x15d237[_0xf2ba('0x32')][_0xf2ba('0x38')]);_0x33adb5[_0xf2ba('0x1e')]=qs[_0xf2ba('0x1e')](_0x15d237[_0xf2ba('0x32')][_0xf2ba('0x1e')]);}_0x33adb5[_0xf2ba('0x39')]=qs[_0xf2ba('0x3a')](_0x15d237[_0xf2ba('0x32')][_0xf2ba('0x3a')]);_0x33adb5['where']=qs[_0xf2ba('0x3b')](_['pick'](_0x15d237[_0xf2ba('0x32')],_0x30164b[_0xf2ba('0x3b')]),_0x2b3cc0);if(_0x15d237['query'][_0xf2ba('0x3c')]){_0x33adb5[_0xf2ba('0x3d')]=_['merge'](_0x33adb5['where'],{'$or':_[_0xf2ba('0x2b')](_0x2b3cc0,function(_0x308210){if(_0x308210['type']!==_0xf2ba('0x3e')){var _0x23d214={};_0x23d214[_0x308210[_0xf2ba('0x28')]]={'$like':'%'+_0x15d237[_0xf2ba('0x32')][_0xf2ba('0x3c')]+'%'};return _0x23d214;}})});}_0x33adb5=_[_0xf2ba('0x3f')]({},_0x33adb5,_0x15d237[_0xf2ba('0x40')]);var _0xe84c42={'where':_0x33adb5[_0xf2ba('0x3d')]};return db[_0xf2ba('0x41')][_0xf2ba('0x1d')](_0xe84c42)[_0xf2ba('0x24')](function(_0x548a81){_0x1cd5bd[_0xf2ba('0x1d')]=_0x548a81;if(_0x15d237[_0xf2ba('0x32')][_0xf2ba('0x42')]){_0x33adb5[_0xf2ba('0x43')]=[{'all':!![]}];}return db[_0xf2ba('0x41')][_0xf2ba('0x44')](_0x33adb5);})[_0xf2ba('0x24')](function(_0x3da6d4){_0x1cd5bd['rows']=_0x3da6d4;return _0x1cd5bd;})[_0xf2ba('0x24')](respondWithFilteredResult(_0x24c161,_0x33adb5))[_0xf2ba('0x45')](handleError(_0x24c161,null));};exports[_0xf2ba('0x46')]=function(_0x461348,_0x4889d3){var _0x1b9999={'raw':!![],'where':{'id':_0x461348['params']['id']}},_0x3252c5={};_0x3252c5[_0xf2ba('0x2f')]=_[_0xf2ba('0x30')](db[_0xf2ba('0x41')][_0xf2ba('0x47')]);_0x3252c5[_0xf2ba('0x32')]=_[_0xf2ba('0x30')](_0x461348['query']);_0x3252c5[_0xf2ba('0x3b')]=_[_0xf2ba('0x31')](_0x3252c5[_0xf2ba('0x2f')],_0x3252c5[_0xf2ba('0x32')]);_0x1b9999[_0xf2ba('0x34')]=_[_0xf2ba('0x31')](_0x3252c5[_0xf2ba('0x2f')],qs[_0xf2ba('0x33')](_0x461348[_0xf2ba('0x32')][_0xf2ba('0x33')]));_0x1b9999[_0xf2ba('0x34')]=_0x1b9999['attributes'][_0xf2ba('0x35')]?_0x1b9999[_0xf2ba('0x34')]:_0x3252c5[_0xf2ba('0x2f')];if(_0x461348['query'][_0xf2ba('0x42')]){_0x1b9999[_0xf2ba('0x43')]=[{'all':!![]}];}_0x1b9999=_['merge']({},_0x1b9999,_0x461348['options']);return db['CmHopperBlack'][_0xf2ba('0x48')](_0x1b9999)[_0xf2ba('0x24')](handleEntityNotFound(_0x4889d3,null))[_0xf2ba('0x24')](respondWithResult(_0x4889d3,null))[_0xf2ba('0x45')](handleError(_0x4889d3,null));};exports['update']=function(_0x55a9d7,_0x2d5ea7){if(_0x55a9d7['body']['id']){delete _0x55a9d7[_0xf2ba('0x49')]['id'];}return db['CmHopperBlack']['find']({'where':{'id':_0x55a9d7['params']['id']}})[_0xf2ba('0x24')](handleEntityNotFound(_0x2d5ea7,null))['then'](saveUpdates(_0x55a9d7['body'],null))['then'](respondWithResult(_0x2d5ea7,null))[_0xf2ba('0x45')](handleError(_0x2d5ea7,null));};exports[_0xf2ba('0x25')]=function(_0x10254a,_0x252bad){return db[_0xf2ba('0x41')][_0xf2ba('0x48')]({'where':{'id':_0x10254a[_0xf2ba('0x4a')]['id']}})[_0xf2ba('0x24')](handleEntityNotFound(_0x252bad,null))['then'](removeEntity(_0x252bad,null))[_0xf2ba('0x45')](handleError(_0x252bad,null));};exports[_0xf2ba('0x4b')]=function(_0x139ffd,_0xb1436c){return db[_0xf2ba('0x41')][_0xf2ba('0x4b')]()['then'](respondWithResult(_0xb1436c,null))[_0xf2ba('0x45')](handleError(_0xb1436c,null));}; \ No newline at end of file +var _0xa204=['CmHopperBlack','key','name','query','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','includeAll','include','rows','catch','show','params','keys','rawAttributes','intersection','options','find','update','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','send','index','map'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xa204,0xbc));var _0x4a20=function(_0x5c7525,_0x39490f){_0x5c7525=_0x5c7525-0x0;var _0x2e2ec8=_0xa204[_0x5c7525];return _0x2e2ec8;};'use strict';var emlformat=require(_0x4a20('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4a20('0x1'));var jsonpatch=require(_0x4a20('0x2'));var rp=require(_0x4a20('0x3'));var moment=require(_0x4a20('0x4'));var BPromise=require(_0x4a20('0x5'));var Mustache=require(_0x4a20('0x6'));var util=require(_0x4a20('0x7'));var path=require(_0x4a20('0x8'));var sox=require(_0x4a20('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4a20('0xa'));var _=require(_0x4a20('0xb'));var squel=require(_0x4a20('0xc'));var crypto=require(_0x4a20('0xd'));var jsforce=require(_0x4a20('0xe'));var deskjs=require(_0x4a20('0xf'));var toCsv=require(_0x4a20('0x10'));var querystring=require(_0x4a20('0x11'));var Papa=require(_0x4a20('0x12'));var Redis=require(_0x4a20('0x13'));var authService=require(_0x4a20('0x14'));var qs=require(_0x4a20('0x15'));var as=require(_0x4a20('0x16'));var hardwareService=require(_0x4a20('0x17'));var logger=require('../../config/logger')(_0x4a20('0x18'));var utils=require(_0x4a20('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x4a20('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5006eb,_0x1e1cc){_0x1e1cc=_0x1e1cc||0xcc;return function(_0x254677){if(_0x254677){return _0x5006eb[_0x4a20('0x1b')](_0x1e1cc);}return _0x5006eb[_0x4a20('0x1c')](_0x1e1cc)['end']();};}function respondWithResult(_0x16351b,_0x47af77){_0x47af77=_0x47af77||0xc8;return function(_0x5010d4){if(_0x5010d4){return _0x16351b[_0x4a20('0x1c')](_0x47af77)[_0x4a20('0x1d')](_0x5010d4);}};}function respondWithFilteredResult(_0x4a7689,_0x48ad36){return function(_0x294233){if(_0x294233){var _0x3605f2=typeof _0x48ad36[_0x4a20('0x1e')]===_0x4a20('0x1f')&&typeof _0x48ad36[_0x4a20('0x20')]===_0x4a20('0x1f');var _0x54d55b=_0x294233[_0x4a20('0x21')];var _0xeab4ad=_0x3605f2?0x0:_0x48ad36[_0x4a20('0x1e')];var _0x31562c=_0x3605f2?_0x294233[_0x4a20('0x21')]:_0x48ad36[_0x4a20('0x1e')]+_0x48ad36[_0x4a20('0x20')];var _0xb10d0;if(_0x31562c>=_0x54d55b){_0x31562c=_0x54d55b;_0xb10d0=0xc8;}else{_0xb10d0=0xce;}_0x4a7689[_0x4a20('0x1c')](_0xb10d0);return _0x4a7689[_0x4a20('0x22')](_0x4a20('0x23'),_0xeab4ad+'-'+_0x31562c+'/'+_0x54d55b)[_0x4a20('0x1d')](_0x294233);}return null;};}function patchUpdates(_0x309745){return function(_0x33cc83){try{jsonpatch[_0x4a20('0x24')](_0x33cc83,_0x309745,!![]);}catch(_0x294fad){return BPromise[_0x4a20('0x25')](_0x294fad);}return _0x33cc83[_0x4a20('0x26')]();};}function saveUpdates(_0x133bea,_0x496ef9){return function(_0x2db357){if(_0x2db357){return _0x2db357['update'](_0x133bea)[_0x4a20('0x27')](function(_0x32ad7a){return _0x32ad7a;});}return null;};}function removeEntity(_0x2c73cd,_0x40226d){return function(_0x3ab52e){if(_0x3ab52e){return _0x3ab52e[_0x4a20('0x28')]()[_0x4a20('0x27')](function(){_0x2c73cd[_0x4a20('0x1c')](0xcc)[_0x4a20('0x29')]();});}};}function handleEntityNotFound(_0xe2ae48,_0x50cca0){return function(_0xe7e235){if(!_0xe7e235){_0xe2ae48[_0x4a20('0x1b')](0x194);}return _0xe7e235;};}function handleError(_0x463e10,_0x327197){_0x327197=_0x327197||0x1f4;return function(_0x2fe0c3){logger[_0x4a20('0x2a')](_0x2fe0c3['stack']);if(_0x2fe0c3['name']){delete _0x2fe0c3['name'];}_0x463e10[_0x4a20('0x1c')](_0x327197)[_0x4a20('0x2b')](_0x2fe0c3);};}exports[_0x4a20('0x2c')]=function(_0x50bb40,_0xaff454){var _0x26a502={},_0x234018={},_0x4d8894={'count':0x0,'rows':[]};var _0x4c23ec=_[_0x4a20('0x2d')](db[_0x4a20('0x2e')]['rawAttributes'],function(_0x245ba6){return{'name':_0x245ba6['fieldName'],'type':_0x245ba6['type'][_0x4a20('0x2f')]};});_0x234018['model']=_[_0x4a20('0x2d')](_0x4c23ec,_0x4a20('0x30'));_0x234018[_0x4a20('0x31')]=_['keys'](_0x50bb40[_0x4a20('0x31')]);_0x234018['filters']=_['intersection'](_0x234018[_0x4a20('0x32')],_0x234018[_0x4a20('0x31')]);_0x26a502['attributes']=_['intersection'](_0x234018[_0x4a20('0x32')],qs[_0x4a20('0x33')](_0x50bb40[_0x4a20('0x31')]['fields']));_0x26a502[_0x4a20('0x34')]=_0x26a502[_0x4a20('0x34')][_0x4a20('0x35')]?_0x26a502['attributes']:_0x234018[_0x4a20('0x32')];if(!_0x50bb40[_0x4a20('0x31')][_0x4a20('0x36')](_0x4a20('0x37'))){_0x26a502[_0x4a20('0x20')]=qs['limit'](_0x50bb40[_0x4a20('0x31')]['limit']);_0x26a502['offset']=qs['offset'](_0x50bb40[_0x4a20('0x31')][_0x4a20('0x1e')]);}_0x26a502[_0x4a20('0x38')]=qs['sort'](_0x50bb40[_0x4a20('0x31')][_0x4a20('0x39')]);_0x26a502[_0x4a20('0x3a')]=qs[_0x4a20('0x3b')](_['pick'](_0x50bb40[_0x4a20('0x31')],_0x234018['filters']),_0x4c23ec);if(_0x50bb40['query'][_0x4a20('0x3c')]){_0x26a502[_0x4a20('0x3a')]=_[_0x4a20('0x3d')](_0x26a502['where'],{'$or':_[_0x4a20('0x2d')](_0x4c23ec,function(_0x3c80d2){if(_0x3c80d2[_0x4a20('0x3e')]!==_0x4a20('0x3f')){var _0x2ba952={};_0x2ba952[_0x3c80d2['name']]={'$like':'%'+_0x50bb40[_0x4a20('0x31')][_0x4a20('0x3c')]+'%'};return _0x2ba952;}})});}_0x26a502=_['merge']({},_0x26a502,_0x50bb40['options']);var _0x59ed57={'where':_0x26a502['where']};return db[_0x4a20('0x2e')][_0x4a20('0x21')](_0x59ed57)[_0x4a20('0x27')](function(_0x3861c0){_0x4d8894['count']=_0x3861c0;if(_0x50bb40[_0x4a20('0x31')][_0x4a20('0x40')]){_0x26a502[_0x4a20('0x41')]=[{'all':!![]}];}return db[_0x4a20('0x2e')]['findAll'](_0x26a502);})[_0x4a20('0x27')](function(_0x25f0e8){_0x4d8894[_0x4a20('0x42')]=_0x25f0e8;return _0x4d8894;})[_0x4a20('0x27')](respondWithFilteredResult(_0xaff454,_0x26a502))[_0x4a20('0x43')](handleError(_0xaff454,null));};exports[_0x4a20('0x44')]=function(_0x24ebdc,_0x17a8cd){var _0xd81598={'raw':!![],'where':{'id':_0x24ebdc[_0x4a20('0x45')]['id']}},_0x1aacec={};_0x1aacec['model']=_[_0x4a20('0x46')](db[_0x4a20('0x2e')][_0x4a20('0x47')]);_0x1aacec['query']=_['keys'](_0x24ebdc[_0x4a20('0x31')]);_0x1aacec[_0x4a20('0x3b')]=_[_0x4a20('0x48')](_0x1aacec[_0x4a20('0x32')],_0x1aacec['query']);_0xd81598[_0x4a20('0x34')]=_[_0x4a20('0x48')](_0x1aacec[_0x4a20('0x32')],qs[_0x4a20('0x33')](_0x24ebdc[_0x4a20('0x31')][_0x4a20('0x33')]));_0xd81598[_0x4a20('0x34')]=_0xd81598[_0x4a20('0x34')]['length']?_0xd81598['attributes']:_0x1aacec['model'];if(_0x24ebdc[_0x4a20('0x31')][_0x4a20('0x40')]){_0xd81598[_0x4a20('0x41')]=[{'all':!![]}];}_0xd81598=_[_0x4a20('0x3d')]({},_0xd81598,_0x24ebdc[_0x4a20('0x49')]);return db[_0x4a20('0x2e')][_0x4a20('0x4a')](_0xd81598)[_0x4a20('0x27')](handleEntityNotFound(_0x17a8cd,null))[_0x4a20('0x27')](respondWithResult(_0x17a8cd,null))[_0x4a20('0x43')](handleError(_0x17a8cd,null));};exports[_0x4a20('0x4b')]=function(_0x463508,_0x4b46a2){if(_0x463508[_0x4a20('0x4c')]['id']){delete _0x463508[_0x4a20('0x4c')]['id'];}return db['CmHopperBlack'][_0x4a20('0x4a')]({'where':{'id':_0x463508[_0x4a20('0x45')]['id']}})[_0x4a20('0x27')](handleEntityNotFound(_0x4b46a2,null))['then'](saveUpdates(_0x463508[_0x4a20('0x4c')],null))[_0x4a20('0x27')](respondWithResult(_0x4b46a2,null))[_0x4a20('0x43')](handleError(_0x4b46a2,null));};exports[_0x4a20('0x28')]=function(_0x3eaf86,_0x25e96f){return db[_0x4a20('0x2e')][_0x4a20('0x4a')]({'where':{'id':_0x3eaf86['params']['id']}})[_0x4a20('0x27')](handleEntityNotFound(_0x25e96f,null))[_0x4a20('0x27')](removeEntity(_0x25e96f,null))[_0x4a20('0x43')](handleError(_0x25e96f,null));};exports[_0x4a20('0x4d')]=function(_0xfbcdf7,_0x1c5b33){return db[_0x4a20('0x2e')]['describe']()[_0x4a20('0x27')](respondWithResult(_0x1c5b33,null))[_0x4a20('0x43')](handleError(_0x1c5b33,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 7a0142d..4abed1c 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 _0x866b=['CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define'];(function(_0x7e4009,_0xfeef51){var _0x5ec8a4=function(_0x1959aa){while(--_0x1959aa){_0x7e4009['push'](_0x7e4009['shift']());}};_0x5ec8a4(++_0xfeef51);}(_0x866b,0x1a6));var _0xb866=function(_0x4e2861,_0x199be0){_0x4e2861=_0x4e2861-0x0;var _0x2265e3=_0x866b[_0x4e2861];return _0x2265e3;};'use strict';var _=require(_0xb866('0x0'));var util=require(_0xb866('0x1'));var logger=require(_0xb866('0x2'))('api');var moment=require(_0xb866('0x3'));var BPromise=require(_0xb866('0x4'));var rp=require(_0xb866('0x5'));var fs=require('fs');var path=require(_0xb866('0x6'));var rimraf=require(_0xb866('0x7'));var config=require(_0xb866('0x8'));var attributes=require(_0xb866('0x9'));module[_0xb866('0xa')]=function(_0x55ac33,_0x158055){return _0x55ac33[_0xb866('0xb')](_0xb866('0xc'),attributes,{'tableName':_0xb866('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5c0b=['api','bluebird','path','rimraf','./cmHopperBlack.attributes','exports','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger'];(function(_0x5e3b04,_0xbb6795){var _0x1fc44d=function(_0x3472a1){while(--_0x3472a1){_0x5e3b04['push'](_0x5e3b04['shift']());}};_0x1fc44d(++_0xbb6795);}(_0x5c0b,0x76));var _0xb5c0=function(_0x18bb48,_0x3898d6){_0x18bb48=_0x18bb48-0x0;var _0x4d6c2b=_0x5c0b[_0x18bb48];return _0x4d6c2b;};'use strict';var _=require(_0xb5c0('0x0'));var util=require(_0xb5c0('0x1'));var logger=require(_0xb5c0('0x2'))(_0xb5c0('0x3'));var moment=require('moment');var BPromise=require(_0xb5c0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb5c0('0x5'));var rimraf=require(_0xb5c0('0x6'));var config=require('../../config/environment');var attributes=require(_0xb5c0('0x7'));module[_0xb5c0('0x8')]=function(_0x4b9689,_0x26dc18){return _0x4b9689['define'](_0xb5c0('0x9'),attributes,{'tableName':_0xb5c0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 87e1b19..dd6091a 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 _0x0297=['GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','limit','include','attributes','map','model','debug','UpdateCmHopperBlack','update','body','then','DestroyCmHopperBlack','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','info','request\x20sent','stringify','error','CmHopperBlack,\x20%s,\x20%s','message','catch'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x0297,0xe3));var _0x7029=function(_0x17b98b,_0x382995){_0x17b98b=_0x17b98b-0x0;var _0x59513f=_0x0297[_0x17b98b];return _0x59513f;};'use strict';var _=require('lodash');var util=require(_0x7029('0x0'));var moment=require(_0x7029('0x1'));var BPromise=require(_0x7029('0x2'));var rs=require(_0x7029('0x3'));var fs=require('fs');var Redis=require(_0x7029('0x4'));var db=require(_0x7029('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7029('0x6'))(_0x7029('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7029('0x8')][_0x7029('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x982918,_0x177974,_0x30f72f){return new BPromise(function(_0x36cec7,_0x2a53b7){return client[_0x7029('0xa')](_0x982918,_0x30f72f)['then'](function(_0x319b49){logger[_0x7029('0xb')]('CmHopperBlack,\x20%s,\x20%s',_0x177974,_0x7029('0xc'));logger['debug']('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x177974,_0x7029('0xc'),JSON[_0x7029('0xd')](_0x319b49));if(_0x319b49[_0x7029('0xe')]){if(_0x319b49[_0x7029('0xe')]['code']===0x1f4){logger[_0x7029('0xe')]('CmHopperBlack,\x20%s,\x20%s',_0x177974,_0x319b49[_0x7029('0xe')]['message']);return _0x2a53b7(_0x319b49['error']['message']);}logger['error'](_0x7029('0xf'),_0x177974,_0x319b49[_0x7029('0xe')]['message']);return _0x36cec7(_0x319b49[_0x7029('0xe')][_0x7029('0x10')]);}else{logger[_0x7029('0xb')]('CmHopperBlack,\x20%s,\x20%s',_0x177974,_0x7029('0xc'));_0x36cec7(_0x319b49['result']['message']);}})[_0x7029('0x11')](function(_0x1d83b0){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x177974,_0x1d83b0);_0x2a53b7(_0x1d83b0);});});}exports[_0x7029('0x12')]=function(_0x2deed7){var _0xfcf007=this;return new Promise(function(_0x54fca7,_0x3ab10c){return db[_0x7029('0x13')][_0x7029('0x14')]({'raw':_0x2deed7[_0x7029('0x15')]?_0x2deed7[_0x7029('0x15')][_0x7029('0x16')]===undefined?!![]:![]:!![],'where':_0x2deed7[_0x7029('0x15')]?_0x2deed7[_0x7029('0x15')][_0x7029('0x17')]||null:null,'attributes':_0x2deed7[_0x7029('0x15')]?_0x2deed7['options']['attributes']||null:null,'limit':_0x2deed7[_0x7029('0x15')]?_0x2deed7['options'][_0x7029('0x18')]||null:null,'include':_0x2deed7[_0x7029('0x15')]?_0x2deed7[_0x7029('0x15')][_0x7029('0x19')]?_['map'](_0x2deed7[_0x7029('0x15')][_0x7029('0x19')],function(_0x5a2a04){return{'model':db[_0x5a2a04['model']],'as':_0x5a2a04['as'],'attributes':_0x5a2a04[_0x7029('0x1a')],'include':_0x5a2a04['include']?_[_0x7029('0x1b')](_0x5a2a04[_0x7029('0x19')],function(_0x51aed3){return{'model':db[_0x51aed3['model']],'as':_0x51aed3['as'],'attributes':_0x51aed3[_0x7029('0x1a')],'include':_0x51aed3['include']?_[_0x7029('0x1b')](_0x51aed3[_0x7029('0x19')],function(_0x13f653){return{'model':db[_0x13f653[_0x7029('0x1c')]],'as':_0x13f653['as'],'attributes':_0x13f653[_0x7029('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5bb5f8){logger[_0x7029('0xb')](_0x7029('0x12'),_0x2deed7);logger[_0x7029('0x1d')](_0x7029('0x12'),_0x2deed7,JSON['stringify'](_0x5bb5f8));_0x54fca7(_0x5bb5f8);})[_0x7029('0x11')](function(_0x517c6e){logger[_0x7029('0xe')](_0x7029('0x12'),_0x517c6e[_0x7029('0x10')],_0x2deed7);_0x3ab10c(_0xfcf007[_0x7029('0xe')](0x1f4,_0x517c6e[_0x7029('0x10')]));});});};exports[_0x7029('0x1e')]=function(_0x31e8ff){var _0x5d83b4=this;return new Promise(function(_0x2e7dfe,_0x4d7679){return db[_0x7029('0x13')][_0x7029('0x1f')](_0x31e8ff[_0x7029('0x20')],{'raw':_0x31e8ff['options']?_0x31e8ff['options'][_0x7029('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x31e8ff[_0x7029('0x15')]?_0x31e8ff['options'][_0x7029('0x17')]||null:null,'attributes':_0x31e8ff[_0x7029('0x15')]?_0x31e8ff[_0x7029('0x15')]['attributes']||null:null,'limit':_0x31e8ff['options']?_0x31e8ff[_0x7029('0x15')][_0x7029('0x18')]||null:null})[_0x7029('0x21')](function(_0x3c2893){logger['info'](_0x7029('0x1e'),_0x31e8ff);logger['debug']('UpdateCmHopperBlack',_0x31e8ff,JSON[_0x7029('0xd')](_0x3c2893));_0x2e7dfe(_0x3c2893);})[_0x7029('0x11')](function(_0x1c305a){logger[_0x7029('0xe')]('UpdateCmHopperBlack',_0x1c305a[_0x7029('0x10')],_0x31e8ff);_0x4d7679(_0x5d83b4[_0x7029('0xe')](0x1f4,_0x1c305a['message']));});});};exports[_0x7029('0x22')]=function(_0x4e1fc6){var _0x31150d=this;return new Promise(function(_0x1f8c1d,_0x3277bb){return db[_0x7029('0x13')]['destroy']({'where':_0x4e1fc6['options']?_0x4e1fc6[_0x7029('0x15')][_0x7029('0x17')]||null:null})[_0x7029('0x21')](function(_0x33e406){logger['info'](_0x7029('0x22'),_0x4e1fc6);logger[_0x7029('0x1d')](_0x7029('0x22'),_0x4e1fc6,JSON['stringify'](_0x33e406));_0x1f8c1d(_0x33e406);})[_0x7029('0x11')](function(_0x2b20d3){logger[_0x7029('0xe')]('DestroyCmHopperBlack',_0x2b20d3[_0x7029('0x10')],_0x4e1fc6);_0x3277bb(_0x31150d['error'](0x1f4,_0x2b20d3[_0x7029('0x10')]));});});}; \ No newline at end of file +var _0xec36=['GetCmHopperBlack','stringify','catch','UpdateCmHopperBlack','update','body','raw','DestroyCmHopperBlack','lodash','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','code','error','CmHopperBlack,\x20%s,\x20%s','message','CmHopperBlack','findAll','options','where','attributes','limit','map','include','model','then'];(function(_0x10f6e8,_0x351db6){var _0x35bb3c=function(_0x30a39b){while(--_0x30a39b){_0x10f6e8['push'](_0x10f6e8['shift']());}};_0x35bb3c(++_0x351db6);}(_0xec36,0x17a));var _0x6ec3=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xec36[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x6ec3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6ec3('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6ec3('0x2'));var db=require(_0x6ec3('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x6ec3('0x4'))(_0x6ec3('0x5'));var config=require(_0x6ec3('0x6'));var jayson=require(_0x6ec3('0x7'));var client=jayson[_0x6ec3('0x8')][_0x6ec3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x47748a,_0x22daf4,_0x2ce12b){return new BPromise(function(_0x3bfc56,_0x2672c9){return client[_0x6ec3('0xa')](_0x47748a,_0x2ce12b)['then'](function(_0xa12bda){logger[_0x6ec3('0xb')]('CmHopperBlack,\x20%s,\x20%s',_0x22daf4,_0x6ec3('0xc'));logger[_0x6ec3('0xd')](_0x6ec3('0xe'),_0x22daf4,_0x6ec3('0xc'),JSON['stringify'](_0xa12bda));if(_0xa12bda['error']){if(_0xa12bda['error'][_0x6ec3('0xf')]===0x1f4){logger[_0x6ec3('0x10')](_0x6ec3('0x11'),_0x22daf4,_0xa12bda[_0x6ec3('0x10')]['message']);return _0x2672c9(_0xa12bda['error'][_0x6ec3('0x12')]);}logger[_0x6ec3('0x10')]('CmHopperBlack,\x20%s,\x20%s',_0x22daf4,_0xa12bda['error']['message']);return _0x3bfc56(_0xa12bda[_0x6ec3('0x10')][_0x6ec3('0x12')]);}else{logger['info'](_0x6ec3('0x11'),_0x22daf4,'request\x20sent');_0x3bfc56(_0xa12bda['result'][_0x6ec3('0x12')]);}})['catch'](function(_0xb72495){logger[_0x6ec3('0x10')](_0x6ec3('0x11'),_0x22daf4,_0xb72495);_0x2672c9(_0xb72495);});});}exports['GetCmHopperBlack']=function(_0x59208f){var _0x1b282d=this;return new Promise(function(_0x54c11d,_0x3d7721){return db[_0x6ec3('0x13')][_0x6ec3('0x14')]({'raw':_0x59208f[_0x6ec3('0x15')]?_0x59208f[_0x6ec3('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x59208f[_0x6ec3('0x15')]?_0x59208f[_0x6ec3('0x15')][_0x6ec3('0x16')]||null:null,'attributes':_0x59208f[_0x6ec3('0x15')]?_0x59208f[_0x6ec3('0x15')][_0x6ec3('0x17')]||null:null,'limit':_0x59208f[_0x6ec3('0x15')]?_0x59208f[_0x6ec3('0x15')][_0x6ec3('0x18')]||null:null,'include':_0x59208f[_0x6ec3('0x15')]?_0x59208f['options']['include']?_[_0x6ec3('0x19')](_0x59208f[_0x6ec3('0x15')][_0x6ec3('0x1a')],function(_0x3ff888){return{'model':db[_0x3ff888[_0x6ec3('0x1b')]],'as':_0x3ff888['as'],'attributes':_0x3ff888[_0x6ec3('0x17')],'include':_0x3ff888[_0x6ec3('0x1a')]?_[_0x6ec3('0x19')](_0x3ff888[_0x6ec3('0x1a')],function(_0x1f2e7d){return{'model':db[_0x1f2e7d[_0x6ec3('0x1b')]],'as':_0x1f2e7d['as'],'attributes':_0x1f2e7d[_0x6ec3('0x17')],'include':_0x1f2e7d[_0x6ec3('0x1a')]?_['map'](_0x1f2e7d[_0x6ec3('0x1a')],function(_0x3d5a0c){return{'model':db[_0x3d5a0c[_0x6ec3('0x1b')]],'as':_0x3d5a0c['as'],'attributes':_0x3d5a0c['attributes']};}):[]};}):[]};}):[]:[]})[_0x6ec3('0x1c')](function(_0x2b490c){logger[_0x6ec3('0xb')](_0x6ec3('0x1d'),_0x59208f);logger['debug']('GetCmHopperBlack',_0x59208f,JSON[_0x6ec3('0x1e')](_0x2b490c));_0x54c11d(_0x2b490c);})[_0x6ec3('0x1f')](function(_0x41b452){logger['error'](_0x6ec3('0x1d'),_0x41b452[_0x6ec3('0x12')],_0x59208f);_0x3d7721(_0x1b282d['error'](0x1f4,_0x41b452[_0x6ec3('0x12')]));});});};exports[_0x6ec3('0x20')]=function(_0xada988){var _0x5405d4=this;return new Promise(function(_0x287c4c,_0x273e2f){return db[_0x6ec3('0x13')][_0x6ec3('0x21')](_0xada988[_0x6ec3('0x22')],{'raw':_0xada988[_0x6ec3('0x15')]?_0xada988[_0x6ec3('0x15')][_0x6ec3('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xada988[_0x6ec3('0x15')]?_0xada988[_0x6ec3('0x15')][_0x6ec3('0x16')]||null:null,'attributes':_0xada988['options']?_0xada988[_0x6ec3('0x15')][_0x6ec3('0x17')]||null:null,'limit':_0xada988[_0x6ec3('0x15')]?_0xada988['options'][_0x6ec3('0x18')]||null:null})[_0x6ec3('0x1c')](function(_0x1a2973){logger[_0x6ec3('0xb')](_0x6ec3('0x20'),_0xada988);logger['debug'](_0x6ec3('0x20'),_0xada988,JSON[_0x6ec3('0x1e')](_0x1a2973));_0x287c4c(_0x1a2973);})[_0x6ec3('0x1f')](function(_0x40189b){logger[_0x6ec3('0x10')](_0x6ec3('0x20'),_0x40189b[_0x6ec3('0x12')],_0xada988);_0x273e2f(_0x5405d4[_0x6ec3('0x10')](0x1f4,_0x40189b[_0x6ec3('0x12')]));});});};exports[_0x6ec3('0x24')]=function(_0x5976fe){var _0x5a6920=this;return new Promise(function(_0x2f3708,_0x44f03a){return db[_0x6ec3('0x13')]['destroy']({'where':_0x5976fe[_0x6ec3('0x15')]?_0x5976fe[_0x6ec3('0x15')][_0x6ec3('0x16')]||null:null})[_0x6ec3('0x1c')](function(_0x2b9e9b){logger[_0x6ec3('0xb')](_0x6ec3('0x24'),_0x5976fe);logger[_0x6ec3('0xd')](_0x6ec3('0x24'),_0x5976fe,JSON[_0x6ec3('0x1e')](_0x2b9e9b));_0x2f3708(_0x2b9e9b);})[_0x6ec3('0x1f')](function(_0x554788){logger['error'](_0x6ec3('0x24'),_0x554788[_0x6ec3('0x12')],_0x5976fe);_0x44f03a(_0x5a6920[_0x6ec3('0x10')](0x1f4,_0x554788[_0x6ec3('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index d43f2af..183dba6 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 _0x430c=['exports','multer','connect-timeout','express','Router','./cmHopperBlack.controller','get','index','/describe','isAuthenticated','describe','/:id','show','put','update','delete'];(function(_0x4fec67,_0x3a3767){var _0x3795d9=function(_0xca87){while(--_0xca87){_0x4fec67['push'](_0x4fec67['shift']());}};_0x3795d9(++_0x3a3767);}(_0x430c,0x1a1));var _0xc430=function(_0x531cb8,_0x8ef36f){_0x531cb8=_0x531cb8-0x0;var _0x5cf297=_0x430c[_0x531cb8];return _0x5cf297;};'use strict';var multer=require(_0xc430('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc430('0x1'));var express=require(_0xc430('0x2'));var router=express[_0xc430('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc430('0x4'));router[_0xc430('0x5')]('/',auth['isAuthenticated'](),controller[_0xc430('0x6')]);router['get'](_0xc430('0x7'),auth[_0xc430('0x8')](),controller[_0xc430('0x9')]);router[_0xc430('0x5')](_0xc430('0xa'),auth[_0xc430('0x8')](),controller[_0xc430('0xb')]);router[_0xc430('0xc')](_0xc430('0xa'),auth['isAuthenticated'](),controller[_0xc430('0xd')]);router[_0xc430('0xe')]('/:id',auth[_0xc430('0x8')](),controller['destroy']);module[_0xc430('0xf')]=router; \ No newline at end of file +var _0x0424=['isAuthenticated','index','/describe','/:id','show','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','./cmHopperBlack.controller','get'];(function(_0x4947e3,_0x21f2ee){var _0x1911e5=function(_0x193c1b){while(--_0x193c1b){_0x4947e3['push'](_0x4947e3['shift']());}};_0x1911e5(++_0x21f2ee);}(_0x0424,0x159));var _0x4042=function(_0x4ded50,_0x4a6af3){_0x4ded50=_0x4ded50-0x0;var _0xa92135=_0x0424[_0x4ded50];return _0xa92135;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4042('0x0'));var timeout=require(_0x4042('0x1'));var express=require(_0x4042('0x2'));var router=express[_0x4042('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4042('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4042('0x5'));router[_0x4042('0x6')]('/',auth[_0x4042('0x7')](),controller[_0x4042('0x8')]);router[_0x4042('0x6')](_0x4042('0x9'),auth[_0x4042('0x7')](),controller['describe']);router['get'](_0x4042('0xa'),auth[_0x4042('0x7')](),controller[_0x4042('0xb')]);router['put'](_0x4042('0xa'),auth[_0x4042('0x7')](),controller[_0x4042('0xc')]);router[_0x4042('0xd')](_0x4042('0xa'),auth[_0x4042('0x7')](),controller[_0x4042('0xe')]);module[_0x4042('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 52932fe..363c68f 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 _0x2b79=['INTEGER','STRING','DATE','endtime','setDataValue','followuptime','diff','seconds','BOOLEAN','exports'];(function(_0x505978,_0x4010b6){var _0x2368bf=function(_0x49a556){while(--_0x49a556){_0x505978['push'](_0x505978['shift']());}};_0x2368bf(++_0x4010b6);}(_0x2b79,0x149));var _0x92b7=function(_0x3e961c,_0x5747e7){_0x3e961c=_0x3e961c-0x0;var _0x474f9c=_0x2b79[_0x3e961c];return _0x474f9c;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x92b7('0x0')]={'state':{'type':Sequelize[_0x92b7('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x92b7('0x2')]},'scheduledat':{'type':Sequelize[_0x92b7('0x3')]},'countbusyretry':{'type':Sequelize[_0x92b7('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x92b7('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x92b7('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x92b7('0x2')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x92b7('0x2')]},'calleridname':{'type':Sequelize[_0x92b7('0x2')]},'starttime':{'type':Sequelize[_0x92b7('0x3')]},'responsetime':{'type':Sequelize[_0x92b7('0x3')]},'answertime':{'type':Sequelize[_0x92b7('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x92b7('0x3')]},'ringtime':{'type':Sequelize[_0x92b7('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x92b7('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x92b7('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x92b7('0x2')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x92b7('0x2')]},'reason':{'type':Sequelize[_0x92b7('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x92b7('0x2')]},'dispositionat':{'type':Sequelize[_0x92b7('0x3')],'set':function(_0x190169){var _0xd2ffaa=this['getDataValue'](_0x92b7('0x4'));if(_0xd2ffaa&&_0x190169){this[_0x92b7('0x5')](_0x92b7('0x6'),moment(_0x190169)[_0x92b7('0x7')](moment(_0xd2ffaa),_0x92b7('0x8')));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x92b7('0x9')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x92b7('0x3')]},'callback':{'type':Sequelize[_0x92b7('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0x92b7('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x92b7('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x92b7('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0x92b7('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x92b7('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x92b7('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x92b7('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x92b7('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x35e6=['getDataValue','endtime','setDataValue','diff','seconds','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE'];(function(_0x59eefb,_0x2151ce){var _0x1a49e8=function(_0x5a758c){while(--_0x5a758c){_0x59eefb['push'](_0x59eefb['shift']());}};_0x1a49e8(++_0x2151ce);}(_0x35e6,0x72));var _0x635e=function(_0x15bc80,_0x90158a){_0x15bc80=_0x15bc80-0x0;var _0x46b3e7=_0x35e6[_0x15bc80];return _0x46b3e7;};'use strict';var Sequelize=require(_0x635e('0x0'));var moment=require(_0x635e('0x1'));module[_0x635e('0x2')]={'state':{'type':Sequelize[_0x635e('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x635e('0x4')]},'scheduledat':{'type':Sequelize[_0x635e('0x5')]},'countbusyretry':{'type':Sequelize[_0x635e('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x635e('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x635e('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x635e('0x4')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x635e('0x4')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x635e('0x4')]},'starttime':{'type':Sequelize[_0x635e('0x5')]},'responsetime':{'type':Sequelize[_0x635e('0x5')]},'answertime':{'type':Sequelize[_0x635e('0x5')]},'droptime':{'type':Sequelize[_0x635e('0x5')]},'endtime':{'type':Sequelize[_0x635e('0x5')]},'ringtime':{'type':Sequelize[_0x635e('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x635e('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x635e('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x635e('0x4')]},'campaign':{'type':Sequelize[_0x635e('0x4')]},'campaigntype':{'type':Sequelize[_0x635e('0x4')]},'membername':{'type':Sequelize[_0x635e('0x4')]},'reason':{'type':Sequelize[_0x635e('0x4')]},'disposition':{'type':Sequelize[_0x635e('0x4')]},'secondDisposition':{'type':Sequelize[_0x635e('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x635e('0x5')],'set':function(_0x4b6d14){var _0x1be9ab=this[_0x635e('0x6')](_0x635e('0x7'));if(_0x1be9ab&&_0x4b6d14){this[_0x635e('0x8')]('followuptime',moment(_0x4b6d14)[_0x635e('0x9')](moment(_0x1be9ab),_0x635e('0xa')));}}},'amd':{'type':Sequelize[_0x635e('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0x635e('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x635e('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x635e('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x635e('0x5')]},'callback':{'type':Sequelize[_0x635e('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x635e('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x635e('0x5')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x635e('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0x635e('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x635e('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x635e('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x635e('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 cd7cebc..cb1d1ae 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 _0xeda8=['calleridnum','state\x20=\x204','group','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','findOne','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','stack','name','send','index','map','CmHopperFinal','rawAttributes','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','includeAll','include','rows','catch','show','params','keys','options','find','body','uniqueid','countContactsQueueCampaignHopperFinal','findAll','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','congestionContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','VoiceQueue','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','phone','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20NOT\x20IN\x20(?)','select'];(function(_0x48b810,_0x173a5e){var _0x23c17d=function(_0x38531e){while(--_0x38531e){_0x48b810['push'](_0x48b810['shift']());}};_0x23c17d(++_0x173a5e);}(_0xeda8,0x104));var _0x8eda=function(_0x4e2b2e,_0xbed04a){_0x4e2b2e=_0x4e2b2e-0x0;var _0x4ccf1e=_0xeda8[_0x4e2b2e];return _0x4ccf1e;};'use strict';var emlformat=require(_0x8eda('0x0'));var rimraf=require(_0x8eda('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8eda('0x2'));var rp=require(_0x8eda('0x3'));var moment=require(_0x8eda('0x4'));var BPromise=require(_0x8eda('0x5'));var Mustache=require(_0x8eda('0x6'));var util=require(_0x8eda('0x7'));var path=require(_0x8eda('0x8'));var sox=require(_0x8eda('0x9'));var csv=require(_0x8eda('0xa'));var ejs=require(_0x8eda('0xb'));var fs=require('fs');var fs_extra=require(_0x8eda('0xc'));var _=require(_0x8eda('0xd'));var squel=require('squel');var crypto=require(_0x8eda('0xe'));var jsforce=require(_0x8eda('0xf'));var deskjs=require(_0x8eda('0x10'));var toCsv=require(_0x8eda('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8eda('0x11'));var as=require(_0x8eda('0x12'));var hardwareService=require(_0x8eda('0x13'));var logger=require('../../config/logger')(_0x8eda('0x14'));var utils=require('../../config/utils');var config=require(_0x8eda('0x15'));var licenseUtil=require(_0x8eda('0x16'));var db=require(_0x8eda('0x17'))['db'];function respondWithStatusCode(_0x1ad3df,_0x337573){_0x337573=_0x337573||0xcc;return function(_0x3af00c){if(_0x3af00c){return _0x1ad3df[_0x8eda('0x18')](_0x337573);}return _0x1ad3df[_0x8eda('0x19')](_0x337573)['end']();};}function respondWithResult(_0x500bd4,_0xe04d90){_0xe04d90=_0xe04d90||0xc8;return function(_0x223dcf){if(_0x223dcf){return _0x500bd4['status'](_0xe04d90)[_0x8eda('0x1a')](_0x223dcf);}};}function respondWithFilteredResult(_0x34b1ee,_0x123905){return function(_0x56ff8a){if(_0x56ff8a){var _0x3f2925=typeof _0x123905['offset']===_0x8eda('0x1b')&&typeof _0x123905['limit']===_0x8eda('0x1b');var _0x58023b=_0x56ff8a[_0x8eda('0x1c')];var _0x2a4d2b=_0x3f2925?0x0:_0x123905['offset'];var _0x5e44b7=_0x3f2925?_0x56ff8a[_0x8eda('0x1c')]:_0x123905[_0x8eda('0x1d')]+_0x123905[_0x8eda('0x1e')];var _0x41abfa;if(_0x5e44b7>=_0x58023b){_0x5e44b7=_0x58023b;_0x41abfa=0xc8;}else{_0x41abfa=0xce;}_0x34b1ee[_0x8eda('0x19')](_0x41abfa);return _0x34b1ee[_0x8eda('0x1f')](_0x8eda('0x20'),_0x2a4d2b+'-'+_0x5e44b7+'/'+_0x58023b)[_0x8eda('0x1a')](_0x56ff8a);}return null;};}function patchUpdates(_0x850cce){return function(_0x232786){try{jsonpatch[_0x8eda('0x21')](_0x232786,_0x850cce,!![]);}catch(_0x57f336){return BPromise[_0x8eda('0x22')](_0x57f336);}return _0x232786['save']();};}function saveUpdates(_0x45517e,_0x5183bc){return function(_0x1033d6){if(_0x1033d6){return _0x1033d6[_0x8eda('0x23')](_0x45517e)['then'](function(_0x58e54b){return _0x58e54b;});}return null;};}function removeEntity(_0x56dba4,_0x2a4c99){return function(_0x17cae8){if(_0x17cae8){return _0x17cae8['destroy']()[_0x8eda('0x24')](function(){_0x56dba4[_0x8eda('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25e955,_0xfa57ca){return function(_0x24b1e1){if(!_0x24b1e1){_0x25e955[_0x8eda('0x18')](0x194);}return _0x24b1e1;};}function handleError(_0x2e42e4,_0x5c8488){_0x5c8488=_0x5c8488||0x1f4;return function(_0x41b5a9){logger['error'](_0x41b5a9[_0x8eda('0x25')]);if(_0x41b5a9[_0x8eda('0x26')]){delete _0x41b5a9[_0x8eda('0x26')];}_0x2e42e4['status'](_0x5c8488)[_0x8eda('0x27')](_0x41b5a9);};}exports[_0x8eda('0x28')]=function(_0x1dd12,_0x4cdd2e){var _0x1616ea={},_0x11a999={},_0x5dd315={'count':0x0,'rows':[]};var _0x27d2ce=_[_0x8eda('0x29')](db[_0x8eda('0x2a')][_0x8eda('0x2b')],function(_0x53274e){return{'name':_0x53274e['fieldName'],'type':_0x53274e['type'][_0x8eda('0x2c')]};});_0x11a999[_0x8eda('0x2d')]=_[_0x8eda('0x29')](_0x27d2ce,'name');_0x11a999['query']=_['keys'](_0x1dd12[_0x8eda('0x2e')]);_0x11a999[_0x8eda('0x2f')]=_[_0x8eda('0x30')](_0x11a999['model'],_0x11a999['query']);_0x1616ea['attributes']=_[_0x8eda('0x30')](_0x11a999[_0x8eda('0x2d')],qs[_0x8eda('0x31')](_0x1dd12[_0x8eda('0x2e')][_0x8eda('0x31')]));_0x1616ea[_0x8eda('0x32')]=_0x1616ea[_0x8eda('0x32')][_0x8eda('0x33')]?_0x1616ea[_0x8eda('0x32')]:_0x11a999[_0x8eda('0x2d')];if(!_0x1dd12[_0x8eda('0x2e')][_0x8eda('0x34')](_0x8eda('0x35'))){_0x1616ea[_0x8eda('0x1e')]=qs['limit'](_0x1dd12[_0x8eda('0x2e')][_0x8eda('0x1e')]);_0x1616ea[_0x8eda('0x1d')]=qs['offset'](_0x1dd12['query'][_0x8eda('0x1d')]);}_0x1616ea[_0x8eda('0x36')]=qs[_0x8eda('0x37')](_0x1dd12[_0x8eda('0x2e')]['sort']);_0x1616ea[_0x8eda('0x38')]=qs[_0x8eda('0x2f')](_[_0x8eda('0x39')](_0x1dd12[_0x8eda('0x2e')],_0x11a999[_0x8eda('0x2f')]),_0x27d2ce);if(_0x1dd12[_0x8eda('0x2e')]['filter']){_0x1616ea[_0x8eda('0x38')]=_[_0x8eda('0x3a')](_0x1616ea[_0x8eda('0x38')],{'$or':_[_0x8eda('0x29')](_0x27d2ce,function(_0x261e12){if(_0x261e12[_0x8eda('0x3b')]!=='VIRTUAL'){var _0x1067eb={};_0x1067eb[_0x261e12[_0x8eda('0x26')]]={'$like':'%'+_0x1dd12[_0x8eda('0x2e')][_0x8eda('0x3c')]+'%'};return _0x1067eb;}})});}_0x1616ea=_[_0x8eda('0x3a')]({},_0x1616ea,_0x1dd12['options']);var _0x17ee80={'where':_0x1616ea[_0x8eda('0x38')]};return db[_0x8eda('0x2a')]['count'](_0x17ee80)[_0x8eda('0x24')](function(_0x5d361e){_0x5dd315[_0x8eda('0x1c')]=_0x5d361e;if(_0x1dd12[_0x8eda('0x2e')][_0x8eda('0x3d')]){_0x1616ea[_0x8eda('0x3e')]=[{'all':!![]}];}return db[_0x8eda('0x2a')]['findAll'](_0x1616ea);})['then'](function(_0xbf14a1){_0x5dd315[_0x8eda('0x3f')]=_0xbf14a1;return _0x5dd315;})[_0x8eda('0x24')](respondWithFilteredResult(_0x4cdd2e,_0x1616ea))[_0x8eda('0x40')](handleError(_0x4cdd2e,null));};exports[_0x8eda('0x41')]=function(_0x13b3bc,_0x18b043){var _0xcb6164={'raw':!![],'where':{'id':_0x13b3bc[_0x8eda('0x42')]['id']}},_0x184590={};_0x184590[_0x8eda('0x2d')]=_[_0x8eda('0x43')](db[_0x8eda('0x2a')][_0x8eda('0x2b')]);_0x184590[_0x8eda('0x2e')]=_[_0x8eda('0x43')](_0x13b3bc[_0x8eda('0x2e')]);_0x184590[_0x8eda('0x2f')]=_[_0x8eda('0x30')](_0x184590['model'],_0x184590[_0x8eda('0x2e')]);_0xcb6164[_0x8eda('0x32')]=_['intersection'](_0x184590[_0x8eda('0x2d')],qs[_0x8eda('0x31')](_0x13b3bc['query'][_0x8eda('0x31')]));_0xcb6164[_0x8eda('0x32')]=_0xcb6164['attributes'][_0x8eda('0x33')]?_0xcb6164[_0x8eda('0x32')]:_0x184590[_0x8eda('0x2d')];if(_0x13b3bc['query'][_0x8eda('0x3d')]){_0xcb6164[_0x8eda('0x3e')]=[{'all':!![]}];}_0xcb6164=_[_0x8eda('0x3a')]({},_0xcb6164,_0x13b3bc[_0x8eda('0x44')]);return db[_0x8eda('0x2a')][_0x8eda('0x45')](_0xcb6164)[_0x8eda('0x24')](handleEntityNotFound(_0x18b043,null))['then'](respondWithResult(_0x18b043,null))[_0x8eda('0x40')](handleError(_0x18b043,null));};exports['describe']=function(_0xcde3e,_0x52b026){return db[_0x8eda('0x2a')]['describe']()[_0x8eda('0x24')](respondWithResult(_0x52b026,null))['catch'](handleError(_0x52b026,null));};exports[_0x8eda('0x23')]=function(_0x3aca19,_0xf445){if(_0x3aca19[_0x8eda('0x46')][_0x8eda('0x47')]){delete _0x3aca19[_0x8eda('0x46')][_0x8eda('0x47')];}return db[_0x8eda('0x2a')][_0x8eda('0x45')]({'where':{'uniqueid':_0x3aca19[_0x8eda('0x42')]['id']}})[_0x8eda('0x24')](handleEntityNotFound(_0xf445,null))[_0x8eda('0x24')](saveUpdates(_0x3aca19['body'],null))[_0x8eda('0x24')](respondWithResult(_0xf445,null))[_0x8eda('0x40')](handleError(_0xf445,null));};exports[_0x8eda('0x48')]=function(_0x3259de,_0x33ba39,_0x389399){return db[_0x8eda('0x2a')][_0x8eda('0x49')]({'raw':![],'where':{'VoiceQueueId':_0x3259de[_0x8eda('0x42')]['id']},'attributes':[[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x4d')))),'noSuchContacts'],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x4e')))),'noAnswerContacts'],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db['sequelize'][_0x8eda('0x4c')]('`state`\x20=\x205,\x201,\x20null'))),_0x8eda('0x4f')],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db['sequelize']['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x50')))),'congestionContacts'],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x51')))),_0x8eda('0x52')],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db['sequelize'][_0x8eda('0x4c')](_0x8eda('0x53')))),'abandonedContacts'],[db[_0x8eda('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2022,\x201,\x20null'))),_0x8eda('0x54')],[db['sequelize']['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x55')))),_0x8eda('0x56')]]})[_0x8eda('0x24')](handleEntityNotFound(_0x33ba39,null))['then'](respondWithResult(_0x33ba39,null))[_0x8eda('0x40')](handleError(_0x33ba39,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0xdd71ce,_0x4ba827,_0xfb98bf){return db['CmHopperFinal'][_0x8eda('0x49')]({'raw':![],'where':{'CampaignId':_0xdd71ce[_0x8eda('0x42')]['id']},'attributes':[[db[_0x8eda('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x8eda('0x4c')](_0x8eda('0x4d')))),'noSuchContacts'],[db[_0x8eda('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x4e')))),_0x8eda('0x57')],[db['sequelize']['fn']('COUNT',db[_0x8eda('0x4a')]['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x58')))),'busyContacts'],[db[_0x8eda('0x4a')]['fn']('COUNT',db[_0x8eda('0x4a')]['fn']('IF',db['sequelize'][_0x8eda('0x4c')]('`state`\x20=\x208,\x201,\x20null'))),_0x8eda('0x59')],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x51')))),_0x8eda('0x52')],[db[_0x8eda('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x8eda('0x4a')]['literal'](_0x8eda('0x53')))),_0x8eda('0x5a')],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db['sequelize']['literal'](_0x8eda('0x5b')))),_0x8eda('0x54')],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')]('`state`\x20=\x2019,\x201,\x20null'))),_0x8eda('0x56')]]})[_0x8eda('0x24')](handleEntityNotFound(_0x4ba827,null))['then'](respondWithResult(_0x4ba827,null))[_0x8eda('0x40')](handleError(_0x4ba827,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x47f57c,_0x49d1a1,_0x5e66cd){return db[_0x8eda('0x5c')][_0x8eda('0x45')]({'where':{'id':_0x47f57c[_0x8eda('0x42')]['id']}})[_0x8eda('0x24')](handleEntityNotFound(_0x49d1a1,null))[_0x8eda('0x24')](function(_0xe5d324){var _0x589c2f;if(_0xe5d324){_0x589c2f=squel[_0x8eda('0x5d')]()[_0x8eda('0x5e')](_0x8eda('0x5f'))[_0x8eda('0x60')](['phone',_0x8eda('0x61'),_0x8eda('0x62'),_0x8eda('0x63'),_0x8eda('0x64'),_0x8eda('0x65'),_0x8eda('0x66')],squel['select']()[_0x8eda('0x67')](_0x8eda('0x68'),_0x8eda('0x69'))[_0x8eda('0x67')](_0x8eda('0x6a'),_0x8eda('0x61'))[_0x8eda('0x67')](_0x8eda('0x6b'),_0x8eda('0x62'))[_0x8eda('0x67')](_0x8eda('0x6c'),_0x8eda('0x63'))[_0x8eda('0x67')](_0x8eda('0x6d'),'VoiceQueueId')['field'](_0x8eda('0x6a'),_0x8eda('0x65'))[_0x8eda('0x67')](_0x8eda('0x6a'),'updatedAt')[_0x8eda('0x6e')](_0x8eda('0x6f'))['where'](_0x8eda('0x70'),_0x47f57c['params']['id'][_0x8eda('0x71')]())[_0x8eda('0x38')](_0x8eda('0x72'),_0x47f57c['body'][_0x8eda('0x73')][_0x8eda('0x71')]())[_0x8eda('0x38')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x8eda('0x38')](_0x8eda('0x74'),squel[_0x8eda('0x75')]()[_0x8eda('0x67')]('phone')['from'](_0x8eda('0x5f'))[_0x8eda('0x38')](_0x8eda('0x70'),_0x47f57c[_0x8eda('0x42')]['id']['toString']()))[_0x8eda('0x38')](_0x8eda('0x74'),squel[_0x8eda('0x75')]()[_0x8eda('0x67')](_0x8eda('0x76'))['from'](_0x8eda('0x6f'))[_0x8eda('0x38')](_0x8eda('0x70'),_0x47f57c['params']['id']['toString']())['where'](_0x8eda('0x77')))[_0x8eda('0x78')](_0x8eda('0x62')))[_0x8eda('0x71')]();return db[_0x8eda('0x4a')][_0x8eda('0x2e')](_0x589c2f);}return[];})[_0x8eda('0x24')](respondWithResult(_0x49d1a1,null))[_0x8eda('0x40')](handleError(_0x49d1a1,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x1bbe8b,_0x437c6f,_0x1006b1){return db['Campaign'][_0x8eda('0x45')]({'where':{'id':_0x1bbe8b[_0x8eda('0x42')]['id']}})[_0x8eda('0x24')](handleEntityNotFound(_0x437c6f,null))[_0x8eda('0x24')](function(_0x33350e){var _0x3e245f;if(_0x33350e){_0x3e245f=squel[_0x8eda('0x5d')]()[_0x8eda('0x5e')](_0x8eda('0x5f'))[_0x8eda('0x60')]([_0x8eda('0x69'),'scheduledAt',_0x8eda('0x62'),_0x8eda('0x63'),_0x8eda('0x79'),_0x8eda('0x65'),_0x8eda('0x66')],squel[_0x8eda('0x75')]()[_0x8eda('0x67')](_0x8eda('0x68'),_0x8eda('0x69'))[_0x8eda('0x67')](_0x8eda('0x6a'),'scheduledAt')['field']('ANY_VALUE(ContactId)',_0x8eda('0x62'))[_0x8eda('0x67')]('ANY_VALUE(ListId)',_0x8eda('0x63'))[_0x8eda('0x67')](_0x8eda('0x7a'),'CampaignId')[_0x8eda('0x67')]('NOW()',_0x8eda('0x65'))['field'](_0x8eda('0x6a'),_0x8eda('0x66'))['from'](_0x8eda('0x6f'))[_0x8eda('0x38')](_0x8eda('0x7b'),_0x1bbe8b[_0x8eda('0x42')]['id'][_0x8eda('0x71')]())[_0x8eda('0x38')](_0x8eda('0x72'),_0x1bbe8b[_0x8eda('0x46')][_0x8eda('0x73')][_0x8eda('0x71')]())['where']('calleridnum\x20IS\x20NOT\x20NULL')['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x8eda('0x75')]()[_0x8eda('0x67')](_0x8eda('0x69'))['from'](_0x8eda('0x5f'))[_0x8eda('0x38')](_0x8eda('0x7b'),_0x1bbe8b[_0x8eda('0x42')]['id'][_0x8eda('0x71')]()))[_0x8eda('0x38')](_0x8eda('0x74'),squel[_0x8eda('0x75')]()['field']('calleridnum')[_0x8eda('0x6e')](_0x8eda('0x6f'))['where'](_0x8eda('0x7b'),_0x1bbe8b[_0x8eda('0x42')]['id'][_0x8eda('0x71')]())['where'](_0x8eda('0x77')))[_0x8eda('0x78')](_0x8eda('0x62')))[_0x8eda('0x71')]();return db[_0x8eda('0x4a')][_0x8eda('0x2e')](_0x3e245f);}return[];})[_0x8eda('0x24')](respondWithResult(_0x437c6f,null))['catch'](handleError(_0x437c6f,null));};exports[_0x8eda('0x7c')]=function(_0x11f734,_0x4cb4e6,_0x5d8512){return db['CmHopper'][_0x8eda('0x7d')]({'where':{'VoiceQueueId':_0x11f734[_0x8eda('0x46')][_0x8eda('0x64')],'CampaignId':_0x11f734[_0x8eda('0x46')][_0x8eda('0x79')],'ContactId':_0x11f734[_0x8eda('0x46')][_0x8eda('0x62')]}})[_0x8eda('0x24')](handleEntityNotFound(_0x4cb4e6,null))[_0x8eda('0x24')](function(_0x1a3993){if(_0x1a3993){return _0x1a3993;}return null;})[_0x8eda('0x24')](respondWithResult(_0x4cb4e6,null))[_0x8eda('0x40')](handleError(_0x4cb4e6,null));}; \ No newline at end of file +var _0x4975=['ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','CmHopper','findOne','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','name','fieldName','type','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','sort','pick','filter','where','map','VIRTUAL','options','CmHopperFinal','count','includeAll','include','findAll','catch','show','params','rawAttributes','find','describe','uniqueid','body','countContactsQueueCampaignHopperFinal','sequelize','`state`\x20=\x200,\x201,\x20null','noSuchContacts','COUNT','literal','noAnswerContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','into','cm_hopper','fromQuery','scheduledAt','ContactId','VoiceQueueId','createdAt','updatedAt','ANY_VALUE(calleridnum)','phone','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ListId','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','CampaignId','select'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x4975,0x86));var _0x5497=function(_0x567199,_0x2f80a5){_0x567199=_0x567199-0x0;var _0xc41788=_0x4975[_0x567199];return _0xc41788;};'use strict';var emlformat=require(_0x5497('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5497('0x1'));var jsonpatch=require(_0x5497('0x2'));var rp=require(_0x5497('0x3'));var moment=require(_0x5497('0x4'));var BPromise=require(_0x5497('0x5'));var Mustache=require(_0x5497('0x6'));var util=require(_0x5497('0x7'));var path=require(_0x5497('0x8'));var sox=require(_0x5497('0x9'));var csv=require(_0x5497('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5497('0xb'));var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xa'));var querystring=require('querystring');var Papa=require(_0x5497('0xf'));var Redis=require(_0x5497('0x10'));var authService=require(_0x5497('0x11'));var qs=require(_0x5497('0x12'));var as=require(_0x5497('0x13'));var hardwareService=require(_0x5497('0x14'));var logger=require(_0x5497('0x15'))(_0x5497('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5497('0x17'))['db'];function respondWithStatusCode(_0x1b23df,_0x1bb794){_0x1bb794=_0x1bb794||0xcc;return function(_0x984990){if(_0x984990){return _0x1b23df[_0x5497('0x18')](_0x1bb794);}return _0x1b23df[_0x5497('0x19')](_0x1bb794)[_0x5497('0x1a')]();};}function respondWithResult(_0xaca97d,_0x363a5b){_0x363a5b=_0x363a5b||0xc8;return function(_0x1a4c74){if(_0x1a4c74){return _0xaca97d['status'](_0x363a5b)[_0x5497('0x1b')](_0x1a4c74);}};}function respondWithFilteredResult(_0x4fb8e9,_0x4237a9){return function(_0x2bfd8a){if(_0x2bfd8a){var _0x19e5f3=typeof _0x4237a9[_0x5497('0x1c')]===_0x5497('0x1d')&&typeof _0x4237a9[_0x5497('0x1e')]===_0x5497('0x1d');var _0x575f6b=_0x2bfd8a['count'];var _0x3f4d20=_0x19e5f3?0x0:_0x4237a9[_0x5497('0x1c')];var _0x3a47fd=_0x19e5f3?_0x2bfd8a['count']:_0x4237a9[_0x5497('0x1c')]+_0x4237a9[_0x5497('0x1e')];var _0x18e8a8;if(_0x3a47fd>=_0x575f6b){_0x3a47fd=_0x575f6b;_0x18e8a8=0xc8;}else{_0x18e8a8=0xce;}_0x4fb8e9[_0x5497('0x19')](_0x18e8a8);return _0x4fb8e9[_0x5497('0x1f')](_0x5497('0x20'),_0x3f4d20+'-'+_0x3a47fd+'/'+_0x575f6b)[_0x5497('0x1b')](_0x2bfd8a);}return null;};}function patchUpdates(_0x10226f){return function(_0x2e3960){try{jsonpatch[_0x5497('0x21')](_0x2e3960,_0x10226f,!![]);}catch(_0x186065){return BPromise['reject'](_0x186065);}return _0x2e3960[_0x5497('0x22')]();};}function saveUpdates(_0x4d1b27,_0x19200a){return function(_0xd0868d){if(_0xd0868d){return _0xd0868d[_0x5497('0x23')](_0x4d1b27)[_0x5497('0x24')](function(_0x35ecd9){return _0x35ecd9;});}return null;};}function removeEntity(_0x3b2fbc,_0x5018fa){return function(_0x54043a){if(_0x54043a){return _0x54043a[_0x5497('0x25')]()[_0x5497('0x24')](function(){_0x3b2fbc[_0x5497('0x19')](0xcc)[_0x5497('0x1a')]();});}};}function handleEntityNotFound(_0x5223b5,_0x13b7a4){return function(_0x57268c){if(!_0x57268c){_0x5223b5[_0x5497('0x18')](0x194);}return _0x57268c;};}function handleError(_0x16a2b4,_0x429d36){_0x429d36=_0x429d36||0x1f4;return function(_0x34a1a5){logger[_0x5497('0x26')](_0x34a1a5[_0x5497('0x27')]);if(_0x34a1a5['name']){delete _0x34a1a5[_0x5497('0x28')];}_0x16a2b4['status'](_0x429d36)['send'](_0x34a1a5);};}exports['index']=function(_0x39a2b7,_0x48d146){var _0x5e9356={},_0xc3465={},_0xb14593={'count':0x0,'rows':[]};var _0x1cf908=_['map'](db['CmHopperFinal']['rawAttributes'],function(_0x371874){return{'name':_0x371874[_0x5497('0x29')],'type':_0x371874[_0x5497('0x2a')]['key']};});_0xc3465['model']=_['map'](_0x1cf908,_0x5497('0x28'));_0xc3465['query']=_[_0x5497('0x2b')](_0x39a2b7[_0x5497('0x2c')]);_0xc3465[_0x5497('0x2d')]=_['intersection'](_0xc3465[_0x5497('0x2e')],_0xc3465[_0x5497('0x2c')]);_0x5e9356['attributes']=_[_0x5497('0x2f')](_0xc3465[_0x5497('0x2e')],qs[_0x5497('0x30')](_0x39a2b7['query'][_0x5497('0x30')]));_0x5e9356[_0x5497('0x31')]=_0x5e9356[_0x5497('0x31')][_0x5497('0x32')]?_0x5e9356[_0x5497('0x31')]:_0xc3465['model'];if(!_0x39a2b7[_0x5497('0x2c')][_0x5497('0x33')]('nolimit')){_0x5e9356[_0x5497('0x1e')]=qs[_0x5497('0x1e')](_0x39a2b7[_0x5497('0x2c')][_0x5497('0x1e')]);_0x5e9356[_0x5497('0x1c')]=qs[_0x5497('0x1c')](_0x39a2b7['query'][_0x5497('0x1c')]);}_0x5e9356['order']=qs[_0x5497('0x34')](_0x39a2b7[_0x5497('0x2c')][_0x5497('0x34')]);_0x5e9356['where']=qs['filters'](_[_0x5497('0x35')](_0x39a2b7[_0x5497('0x2c')],_0xc3465[_0x5497('0x2d')]),_0x1cf908);if(_0x39a2b7[_0x5497('0x2c')][_0x5497('0x36')]){_0x5e9356[_0x5497('0x37')]=_['merge'](_0x5e9356[_0x5497('0x37')],{'$or':_[_0x5497('0x38')](_0x1cf908,function(_0x3de8fe){if(_0x3de8fe[_0x5497('0x2a')]!==_0x5497('0x39')){var _0x468902={};_0x468902[_0x3de8fe[_0x5497('0x28')]]={'$like':'%'+_0x39a2b7[_0x5497('0x2c')][_0x5497('0x36')]+'%'};return _0x468902;}})});}_0x5e9356=_['merge']({},_0x5e9356,_0x39a2b7[_0x5497('0x3a')]);var _0x32fa2b={'where':_0x5e9356[_0x5497('0x37')]};return db[_0x5497('0x3b')][_0x5497('0x3c')](_0x32fa2b)[_0x5497('0x24')](function(_0x4299be){_0xb14593['count']=_0x4299be;if(_0x39a2b7[_0x5497('0x2c')][_0x5497('0x3d')]){_0x5e9356[_0x5497('0x3e')]=[{'all':!![]}];}return db[_0x5497('0x3b')][_0x5497('0x3f')](_0x5e9356);})[_0x5497('0x24')](function(_0x114471){_0xb14593['rows']=_0x114471;return _0xb14593;})[_0x5497('0x24')](respondWithFilteredResult(_0x48d146,_0x5e9356))[_0x5497('0x40')](handleError(_0x48d146,null));};exports[_0x5497('0x41')]=function(_0x1e6389,_0x20e947){var _0xd90608={'raw':!![],'where':{'id':_0x1e6389[_0x5497('0x42')]['id']}},_0xc1a999={};_0xc1a999[_0x5497('0x2e')]=_[_0x5497('0x2b')](db['CmHopperFinal'][_0x5497('0x43')]);_0xc1a999['query']=_[_0x5497('0x2b')](_0x1e6389[_0x5497('0x2c')]);_0xc1a999[_0x5497('0x2d')]=_[_0x5497('0x2f')](_0xc1a999[_0x5497('0x2e')],_0xc1a999['query']);_0xd90608[_0x5497('0x31')]=_[_0x5497('0x2f')](_0xc1a999['model'],qs[_0x5497('0x30')](_0x1e6389['query'][_0x5497('0x30')]));_0xd90608['attributes']=_0xd90608[_0x5497('0x31')][_0x5497('0x32')]?_0xd90608[_0x5497('0x31')]:_0xc1a999[_0x5497('0x2e')];if(_0x1e6389[_0x5497('0x2c')]['includeAll']){_0xd90608['include']=[{'all':!![]}];}_0xd90608=_['merge']({},_0xd90608,_0x1e6389['options']);return db[_0x5497('0x3b')][_0x5497('0x44')](_0xd90608)[_0x5497('0x24')](handleEntityNotFound(_0x20e947,null))[_0x5497('0x24')](respondWithResult(_0x20e947,null))[_0x5497('0x40')](handleError(_0x20e947,null));};exports[_0x5497('0x45')]=function(_0xc78abe,_0x466287){return db[_0x5497('0x3b')]['describe']()[_0x5497('0x24')](respondWithResult(_0x466287,null))[_0x5497('0x40')](handleError(_0x466287,null));};exports[_0x5497('0x23')]=function(_0x52a189,_0x3e4da2){if(_0x52a189['body'][_0x5497('0x46')]){delete _0x52a189[_0x5497('0x47')][_0x5497('0x46')];}return db['CmHopperFinal'][_0x5497('0x44')]({'where':{'uniqueid':_0x52a189[_0x5497('0x42')]['id']}})['then'](handleEntityNotFound(_0x3e4da2,null))[_0x5497('0x24')](saveUpdates(_0x52a189['body'],null))[_0x5497('0x24')](respondWithResult(_0x3e4da2,null))['catch'](handleError(_0x3e4da2,null));};exports[_0x5497('0x48')]=function(_0x400860,_0x26fd9f,_0xf07541){return db[_0x5497('0x3b')][_0x5497('0x3f')]({'raw':![],'where':{'VoiceQueueId':_0x400860[_0x5497('0x42')]['id']},'attributes':[[db[_0x5497('0x49')]['fn']('COUNT',db[_0x5497('0x49')]['fn']('IF',db['sequelize']['literal'](_0x5497('0x4a')))),_0x5497('0x4b')],[db['sequelize']['fn'](_0x5497('0x4c'),db[_0x5497('0x49')]['fn']('IF',db[_0x5497('0x49')][_0x5497('0x4d')]('`state`\x20=\x203,\x201,\x20null'))),_0x5497('0x4e')],[db['sequelize']['fn']('COUNT',db[_0x5497('0x49')]['fn']('IF',db[_0x5497('0x49')][_0x5497('0x4d')]('`state`\x20=\x205,\x201,\x20null'))),'busyContacts'],[db[_0x5497('0x49')]['fn']('COUNT',db[_0x5497('0x49')]['fn']('IF',db['sequelize'][_0x5497('0x4d')]('`state`\x20=\x208,\x201,\x20null'))),_0x5497('0x4f')],[db[_0x5497('0x49')]['fn']('COUNT',db[_0x5497('0x49')]['fn']('IF',db['sequelize']['literal'](_0x5497('0x50')))),_0x5497('0x51')],[db['sequelize']['fn'](_0x5497('0x4c'),db[_0x5497('0x49')]['fn']('IF',db[_0x5497('0x49')][_0x5497('0x4d')](_0x5497('0x52')))),_0x5497('0x53')],[db['sequelize']['fn'](_0x5497('0x4c'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x5497('0x54')))),_0x5497('0x55')],[db[_0x5497('0x49')]['fn']('COUNT',db[_0x5497('0x49')]['fn']('IF',db['sequelize']['literal'](_0x5497('0x56')))),_0x5497('0x57')]]})[_0x5497('0x24')](handleEntityNotFound(_0x26fd9f,null))[_0x5497('0x24')](respondWithResult(_0x26fd9f,null))[_0x5497('0x40')](handleError(_0x26fd9f,null));};exports[_0x5497('0x58')]=function(_0x573f93,_0x18b30c,_0x3b0350){return db[_0x5497('0x3b')][_0x5497('0x3f')]({'raw':![],'where':{'CampaignId':_0x573f93['params']['id']},'attributes':[[db[_0x5497('0x49')]['fn'](_0x5497('0x4c'),db[_0x5497('0x49')]['fn']('IF',db[_0x5497('0x49')]['literal'](_0x5497('0x4a')))),_0x5497('0x4b')],[db[_0x5497('0x49')]['fn']('COUNT',db[_0x5497('0x49')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x203,\x201,\x20null'))),_0x5497('0x4e')],[db[_0x5497('0x49')]['fn'](_0x5497('0x4c'),db['sequelize']['fn']('IF',db[_0x5497('0x49')][_0x5497('0x4d')](_0x5497('0x59')))),_0x5497('0x5a')],[db['sequelize']['fn'](_0x5497('0x4c'),db[_0x5497('0x49')]['fn']('IF',db[_0x5497('0x49')]['literal'](_0x5497('0x5b')))),_0x5497('0x4f')],[db[_0x5497('0x49')]['fn'](_0x5497('0x4c'),db[_0x5497('0x49')]['fn']('IF',db[_0x5497('0x49')][_0x5497('0x4d')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x5497('0x51')],[db[_0x5497('0x49')]['fn'](_0x5497('0x4c'),db[_0x5497('0x49')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x5497('0x53')],[db[_0x5497('0x49')]['fn'](_0x5497('0x4c'),db['sequelize']['fn']('IF',db[_0x5497('0x49')][_0x5497('0x4d')](_0x5497('0x54')))),_0x5497('0x55')],[db[_0x5497('0x49')]['fn'](_0x5497('0x4c'),db[_0x5497('0x49')]['fn']('IF',db[_0x5497('0x49')][_0x5497('0x4d')](_0x5497('0x56')))),_0x5497('0x57')]]})['then'](handleEntityNotFound(_0x18b30c,null))[_0x5497('0x24')](respondWithResult(_0x18b30c,null))[_0x5497('0x40')](handleError(_0x18b30c,null));};exports[_0x5497('0x5c')]=function(_0x4ef195,_0x5794ff,_0x589008){return db[_0x5497('0x5d')][_0x5497('0x44')]({'where':{'id':_0x4ef195['params']['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x5794ff,null))[_0x5497('0x24')](function(_0x21c715){var _0x286af8;if(_0x21c715){_0x286af8=squel['insert']()[_0x5497('0x5e')](_0x5497('0x5f'))[_0x5497('0x60')](['phone',_0x5497('0x61'),_0x5497('0x62'),'ListId',_0x5497('0x63'),_0x5497('0x64'),_0x5497('0x65')],squel['select']()['field'](_0x5497('0x66'),_0x5497('0x67'))[_0x5497('0x68')](_0x5497('0x69'),_0x5497('0x61'))[_0x5497('0x68')](_0x5497('0x6a'),'ContactId')['field'](_0x5497('0x6b'),_0x5497('0x6c'))['field'](_0x5497('0x6d'),_0x5497('0x63'))[_0x5497('0x68')]('NOW()',_0x5497('0x64'))[_0x5497('0x68')]('NOW()',_0x5497('0x65'))[_0x5497('0x6e')](_0x5497('0x6f'))[_0x5497('0x37')](_0x5497('0x70'),_0x4ef195['params']['id'][_0x5497('0x71')]())[_0x5497('0x37')](_0x5497('0x72'),_0x4ef195[_0x5497('0x47')][_0x5497('0x73')]['toString']())[_0x5497('0x37')](_0x5497('0x74'))[_0x5497('0x37')](_0x5497('0x75'),squel['select']()[_0x5497('0x68')](_0x5497('0x67'))['from'](_0x5497('0x5f'))[_0x5497('0x37')](_0x5497('0x70'),_0x4ef195[_0x5497('0x42')]['id']['toString']()))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0x5497('0x76'))[_0x5497('0x6e')](_0x5497('0x6f'))[_0x5497('0x37')](_0x5497('0x70'),_0x4ef195['params']['id']['toString']())[_0x5497('0x37')](_0x5497('0x77')))[_0x5497('0x78')](_0x5497('0x62')))[_0x5497('0x71')]();return db[_0x5497('0x49')][_0x5497('0x2c')](_0x286af8);}return[];})[_0x5497('0x24')](respondWithResult(_0x5794ff,null))[_0x5497('0x40')](handleError(_0x5794ff,null));};exports[_0x5497('0x79')]=function(_0x4c41c4,_0x1515f1,_0x4118ec){return db[_0x5497('0x7a')][_0x5497('0x44')]({'where':{'id':_0x4c41c4[_0x5497('0x42')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x1515f1,null))['then'](function(_0x1ef7fc){var _0x5903b7;if(_0x1ef7fc){_0x5903b7=squel[_0x5497('0x7b')]()[_0x5497('0x5e')](_0x5497('0x5f'))['fromQuery'](['phone',_0x5497('0x61'),_0x5497('0x62'),_0x5497('0x6c'),_0x5497('0x7c'),_0x5497('0x64'),_0x5497('0x65')],squel[_0x5497('0x7d')]()[_0x5497('0x68')]('ANY_VALUE(calleridnum)','phone')['field'](_0x5497('0x69'),_0x5497('0x61'))[_0x5497('0x68')](_0x5497('0x6a'),'ContactId')['field'](_0x5497('0x6b'),_0x5497('0x6c'))['field'](_0x5497('0x7e'),_0x5497('0x7c'))[_0x5497('0x68')](_0x5497('0x69'),'createdAt')['field']('NOW()','updatedAt')['from'](_0x5497('0x6f'))['where'](_0x5497('0x7f'),_0x4c41c4['params']['id'][_0x5497('0x71')]())[_0x5497('0x37')](_0x5497('0x72'),_0x4c41c4[_0x5497('0x47')][_0x5497('0x73')][_0x5497('0x71')]())['where'](_0x5497('0x74'))['where'](_0x5497('0x75'),squel[_0x5497('0x7d')]()[_0x5497('0x68')](_0x5497('0x67'))[_0x5497('0x6e')](_0x5497('0x5f'))[_0x5497('0x37')](_0x5497('0x7f'),_0x4c41c4[_0x5497('0x42')]['id'][_0x5497('0x71')]()))['where'](_0x5497('0x75'),squel['select']()[_0x5497('0x68')](_0x5497('0x76'))['from'](_0x5497('0x6f'))[_0x5497('0x37')](_0x5497('0x7f'),_0x4c41c4[_0x5497('0x42')]['id'][_0x5497('0x71')]())[_0x5497('0x37')](_0x5497('0x77')))[_0x5497('0x78')](_0x5497('0x62')))[_0x5497('0x71')]();return db[_0x5497('0x49')][_0x5497('0x2c')](_0x5903b7);}return[];})[_0x5497('0x24')](respondWithResult(_0x1515f1,null))[_0x5497('0x40')](handleError(_0x1515f1,null));};exports['checkContactHopper']=function(_0x37c17e,_0x163b5b,_0x3a31be){return db[_0x5497('0x80')][_0x5497('0x81')]({'where':{'VoiceQueueId':_0x37c17e['body'][_0x5497('0x63')],'CampaignId':_0x37c17e[_0x5497('0x47')]['CampaignId'],'ContactId':_0x37c17e['body'][_0x5497('0x62')]}})[_0x5497('0x24')](handleEntityNotFound(_0x163b5b,null))[_0x5497('0x24')](function(_0x14f693){if(_0x14f693){return _0x14f693;}return null;})[_0x5497('0x24')](respondWithResult(_0x163b5b,null))['catch'](handleError(_0x163b5b,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 0e89573..9c89437 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 _0x1d24=['exports','define','calleridnum','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x1d24,0x197));var _0x41d2=function(_0x4858bc,_0x176641){_0x4858bc=_0x4858bc-0x0;var _0x5f2e11=_0x1d24[_0x4858bc];return _0x5f2e11;};'use strict';var _=require(_0x41d2('0x0'));var util=require(_0x41d2('0x1'));var logger=require(_0x41d2('0x2'))(_0x41d2('0x3'));var moment=require(_0x41d2('0x4'));var BPromise=require(_0x41d2('0x5'));var rp=require(_0x41d2('0x6'));var fs=require('fs');var path=require(_0x41d2('0x7'));var rimraf=require('rimraf');var config=require(_0x41d2('0x8'));var attributes=require('./cmHopperFinal.attributes');module[_0x41d2('0x9')]=function(_0x43a7b3,_0xddb78c){return _0x43a7b3[_0x41d2('0xa')]('CmHopperFinal',attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x41d2('0xb'),'fields':[_0x41d2('0xb')]},{'name':'uniqueid','fields':[_0x41d2('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd2ae=['uniqueid','lodash','api','moment','path','../../config/environment','exports','define','calleridnum'];(function(_0x3364c3,_0x3a00c6){var _0x352ff4=function(_0x499b1c){while(--_0x499b1c){_0x3364c3['push'](_0x3364c3['shift']());}};_0x352ff4(++_0x3a00c6);}(_0xd2ae,0x1f0));var _0xed2a=function(_0x544601,_0x5bda3d){_0x544601=_0x544601-0x0;var _0x4e1f79=_0xd2ae[_0x544601];return _0x4e1f79;};'use strict';var _=require(_0xed2a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xed2a('0x1'));var moment=require(_0xed2a('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xed2a('0x3'));var rimraf=require('rimraf');var config=require(_0xed2a('0x4'));var attributes=require('./cmHopperFinal.attributes');module[_0xed2a('0x5')]=function(_0x47943d,_0x93f31a){return _0x47943d[_0xed2a('0x6')]('CmHopperFinal',attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0xed2a('0x7')]},{'name':_0xed2a('0x8'),'fields':[_0xed2a('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 8df9613..1eef443 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(_0x28fb4a,_0x1ff14d){var _0x37cd5f=function(_0x3903ba){while(--_0x3903ba){_0x28fb4a['push'](_0x28fb4a['shift']());}};_0x37cd5f(++_0x1ff14d);}(_0x7a54,0x106));var _0x47a5=function(_0x37cbfe,_0x48bd86){_0x37cbfe=_0x37cbfe-0x0;var _0x5feeb4=_0x7a54[_0x37cbfe];return _0x5feeb4;};'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(_0x14ae18,_0x25f0ba){var _0x388f40=function(_0x18e83a){while(--_0x18e83a){_0x14ae18['push'](_0x14ae18['shift']());}};_0x388f40(++_0x25f0ba);}(_0x7a54,0x106));var _0x47a5=function(_0x4eadd1,_0x472475){_0x4eadd1=_0x4eadd1-0x0;var _0x26936c=_0x7a54[_0x4eadd1];return _0x26936c;};'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 22a3fab..72035b0 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 _0x1b07=['update','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','/describe','describe','get','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','moveContactsQueueCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','/checkContactHopper','checkContactHopper'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1b07,0x1a0));var _0x71b0=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x1b07[_0x4fde08];return _0x12e725;};'use strict';var multer=require(_0x71b0('0x0'));var util=require(_0x71b0('0x1'));var path=require(_0x71b0('0x2'));var timeout=require('connect-timeout');var express=require(_0x71b0('0x3'));var router=express['Router']();var fs_extra=require(_0x71b0('0x4'));var auth=require(_0x71b0('0x5'));var interaction=require(_0x71b0('0x6'));var config=require('../../config/environment');var controller=require('./cmHopperFinal.controller');router['get']('/',auth[_0x71b0('0x7')](),controller['index']);router['get'](_0x71b0('0x8'),auth[_0x71b0('0x7')](),controller[_0x71b0('0x9')]);router[_0x71b0('0xa')](_0x71b0('0xb'),auth['isAuthenticated'](),controller[_0x71b0('0xc')]);router[_0x71b0('0xa')](_0x71b0('0xd'),auth['isAuthenticated'](),controller[_0x71b0('0xe')]);router['get'](_0x71b0('0xf'),auth[_0x71b0('0x7')](),controller['countContactsIvrCampaignHopperFinal']);router['post']('/voice/queue/moveContacts/:id',auth[_0x71b0('0x7')](),controller[_0x71b0('0x10')]);router[_0x71b0('0x11')](_0x71b0('0x12'),auth[_0x71b0('0x7')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x71b0('0x11')](_0x71b0('0x13'),auth[_0x71b0('0x7')](),controller[_0x71b0('0x14')]);router['put'](_0x71b0('0xb'),auth[_0x71b0('0x7')](),controller[_0x71b0('0x15')]);module[_0x71b0('0x16')]=router; \ No newline at end of file +var _0xdea1=['./cmHopperFinal.controller','isAuthenticated','index','get','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','put','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x578275,_0xe7ae46){var _0xf78041=function(_0x13148c){while(--_0x13148c){_0x578275['push'](_0x578275['shift']());}};_0xf78041(++_0xe7ae46);}(_0xdea1,0x82));var _0x1dea=function(_0x2eff09,_0x4b6bb9){_0x2eff09=_0x2eff09-0x0;var _0x13efa5=_0xdea1[_0x2eff09];return _0x13efa5;};'use strict';var multer=require(_0x1dea('0x0'));var util=require(_0x1dea('0x1'));var path=require(_0x1dea('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1dea('0x3')]();var fs_extra=require(_0x1dea('0x4'));var auth=require(_0x1dea('0x5'));var interaction=require(_0x1dea('0x6'));var config=require(_0x1dea('0x7'));var controller=require(_0x1dea('0x8'));router['get']('/',auth[_0x1dea('0x9')](),controller[_0x1dea('0xa')]);router[_0x1dea('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x1dea('0xc')]);router[_0x1dea('0xb')](_0x1dea('0xd'),auth['isAuthenticated'](),controller[_0x1dea('0xe')]);router[_0x1dea('0xb')](_0x1dea('0xf'),auth[_0x1dea('0x9')](),controller[_0x1dea('0x10')]);router[_0x1dea('0xb')](_0x1dea('0x11'),auth[_0x1dea('0x9')](),controller['countContactsIvrCampaignHopperFinal']);router[_0x1dea('0x12')](_0x1dea('0x13'),auth[_0x1dea('0x9')](),controller[_0x1dea('0x14')]);router[_0x1dea('0x12')](_0x1dea('0x15'),auth[_0x1dea('0x9')](),controller['moveContactsIvrCampaignHopperFinal']);router['post']('/checkContactHopper',auth[_0x1dea('0x9')](),controller['checkContactHopper']);router[_0x1dea('0x16')]('/:id',auth['isAuthenticated'](),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 242bacf..2e3c653 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 _0xf22e=['STRING','DATE','BOOLEAN','exports','INTEGER'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf22e,0x94));var _0xef22=function(_0x54fd10,_0x4395e9){_0x54fd10=_0x54fd10-0x0;var _0x2a92e1=_0xf22e[_0x54fd10];return _0x2a92e1;};'use strict';var Sequelize=require('sequelize');module[_0xef22('0x0')]={'state':{'type':Sequelize[_0xef22('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xef22('0x2')]},'scheduledat':{'type':Sequelize[_0xef22('0x3')]},'countbusyretry':{'type':Sequelize[_0xef22('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xef22('0x2')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xef22('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xef22('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xef22('0x3')]},'answertime':{'type':Sequelize[_0xef22('0x3')]},'droptime':{'type':Sequelize[_0xef22('0x3')]},'endtime':{'type':Sequelize[_0xef22('0x3')]},'ringtime':{'type':Sequelize[_0xef22('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xef22('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xef22('0x2')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xef22('0x2')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0xef22('0x4')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0xef22('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xef22('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xef22('0x3')]},'recallme':{'type':Sequelize[_0xef22('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xef22('0x3')]},'edited':{'type':Sequelize[_0xef22('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xef22('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xef22('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xef22('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xef22('0x2')]}}; \ No newline at end of file +var _0xd92a=['INTEGER','STRING','DATE','BOOLEAN','exports'];(function(_0x20714a,_0x7de591){var _0x15e877=function(_0x3f9f8d){while(--_0x3f9f8d){_0x20714a['push'](_0x20714a['shift']());}};_0x15e877(++_0x7de591);}(_0xd92a,0x1bc));var _0xad92=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xd92a[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require('sequelize');module[_0xad92('0x0')]={'state':{'type':Sequelize[_0xad92('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xad92('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xad92('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xad92('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xad92('0x2')]},'originatecalleridname':{'type':Sequelize[_0xad92('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xad92('0x2')]},'starttime':{'type':Sequelize[_0xad92('0x3')]},'responsetime':{'type':Sequelize[_0xad92('0x3')]},'answertime':{'type':Sequelize[_0xad92('0x3')]},'droptime':{'type':Sequelize[_0xad92('0x3')]},'endtime':{'type':Sequelize[_0xad92('0x3')]},'ringtime':{'type':Sequelize[_0xad92('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xad92('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xad92('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xad92('0x2')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xad92('0x2')]},'membername':{'type':Sequelize[_0xad92('0x2')]},'reason':{'type':Sequelize[_0xad92('0x2')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xad92('0x4')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xad92('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xad92('0x3')]},'recallme':{'type':Sequelize[_0xad92('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xad92('0x3')]},'edited':{'type':Sequelize[_0xad92('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xad92('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xad92('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xad92('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xad92('0x1')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xad92('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 9a7ecc1..540de65 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 _0xdd47=['count','set','Content-Range','apply','reject','save','update','then','end','sendStatus','name','send','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','create','describe','body','uniqueid','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit'];(function(_0xdd8d43,_0x26147b){var _0x2abf27=function(_0x1c16a9){while(--_0x1c16a9){_0xdd8d43['push'](_0xdd8d43['shift']());}};_0x2abf27(++_0x26147b);}(_0xdd47,0x15e));var _0x7dd4=function(_0x5a7d5f,_0x5695cb){_0x5a7d5f=_0x5a7d5f-0x0;var _0x5dcded=_0xdd47[_0x5a7d5f];return _0x5dcded;};'use strict';var emlformat=require(_0x7dd4('0x0'));var rimraf=require(_0x7dd4('0x1'));var zipdir=require(_0x7dd4('0x2'));var jsonpatch=require(_0x7dd4('0x3'));var rp=require(_0x7dd4('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7dd4('0x5'));var util=require('util');var path=require(_0x7dd4('0x6'));var sox=require(_0x7dd4('0x7'));var csv=require(_0x7dd4('0x8'));var ejs=require(_0x7dd4('0x9'));var fs=require('fs');var fs_extra=require(_0x7dd4('0xa'));var _=require(_0x7dd4('0xb'));var squel=require(_0x7dd4('0xc'));var crypto=require(_0x7dd4('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7dd4('0xe'));var toCsv=require(_0x7dd4('0x8'));var querystring=require(_0x7dd4('0xf'));var Papa=require(_0x7dd4('0x10'));var Redis=require(_0x7dd4('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7dd4('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7dd4('0x13'));var logger=require(_0x7dd4('0x14'))(_0x7dd4('0x15'));var utils=require(_0x7dd4('0x16'));var config=require(_0x7dd4('0x17'));var licenseUtil=require(_0x7dd4('0x18'));var db=require(_0x7dd4('0x19'))['db'];function respondWithStatusCode(_0x14a3c3,_0x5aa890){_0x5aa890=_0x5aa890||0xcc;return function(_0x118256){if(_0x118256){return _0x14a3c3['sendStatus'](_0x5aa890);}return _0x14a3c3[_0x7dd4('0x1a')](_0x5aa890)['end']();};}function respondWithResult(_0x1bc7ff,_0x54fea4){_0x54fea4=_0x54fea4||0xc8;return function(_0x4e91ca){if(_0x4e91ca){return _0x1bc7ff[_0x7dd4('0x1a')](_0x54fea4)[_0x7dd4('0x1b')](_0x4e91ca);}};}function respondWithFilteredResult(_0x5b3a4a,_0x3eaa58){return function(_0x5cbf35){if(_0x5cbf35){var _0x3da883=typeof _0x3eaa58[_0x7dd4('0x1c')]==='undefined'&&typeof _0x3eaa58[_0x7dd4('0x1d')]==='undefined';var _0x30ddf6=_0x5cbf35[_0x7dd4('0x1e')];var _0x70cc00=_0x3da883?0x0:_0x3eaa58[_0x7dd4('0x1c')];var _0x112805=_0x3da883?_0x5cbf35['count']:_0x3eaa58[_0x7dd4('0x1c')]+_0x3eaa58[_0x7dd4('0x1d')];var _0xbed6a;if(_0x112805>=_0x30ddf6){_0x112805=_0x30ddf6;_0xbed6a=0xc8;}else{_0xbed6a=0xce;}_0x5b3a4a[_0x7dd4('0x1a')](_0xbed6a);return _0x5b3a4a[_0x7dd4('0x1f')](_0x7dd4('0x20'),_0x70cc00+'-'+_0x112805+'/'+_0x30ddf6)[_0x7dd4('0x1b')](_0x5cbf35);}return null;};}function patchUpdates(_0x12e495){return function(_0x20eb18){try{jsonpatch[_0x7dd4('0x21')](_0x20eb18,_0x12e495,!![]);}catch(_0x49c7cb){return BPromise[_0x7dd4('0x22')](_0x49c7cb);}return _0x20eb18[_0x7dd4('0x23')]();};}function saveUpdates(_0x377168,_0x659cad){return function(_0x2db338){if(_0x2db338){return _0x2db338[_0x7dd4('0x24')](_0x377168)['then'](function(_0xd756ea){return _0xd756ea;});}return null;};}function removeEntity(_0x31160f,_0x2738a2){return function(_0x5422b6){if(_0x5422b6){return _0x5422b6['destroy']()[_0x7dd4('0x25')](function(){_0x31160f[_0x7dd4('0x1a')](0xcc)[_0x7dd4('0x26')]();});}};}function handleEntityNotFound(_0xb7b718,_0x58360f){return function(_0xc31e88){if(!_0xc31e88){_0xb7b718[_0x7dd4('0x27')](0x194);}return _0xc31e88;};}function handleError(_0x23ba70,_0x5d299c){_0x5d299c=_0x5d299c||0x1f4;return function(_0x2574a1){logger['error'](_0x2574a1['stack']);if(_0x2574a1['name']){delete _0x2574a1[_0x7dd4('0x28')];}_0x23ba70[_0x7dd4('0x1a')](_0x5d299c)[_0x7dd4('0x29')](_0x2574a1);};}exports['index']=function(_0x2b987b,_0x50aced){var _0x319483={},_0xafdfc1={},_0x899282={'count':0x0,'rows':[]};var _0x3a6ced=_[_0x7dd4('0x2a')](db[_0x7dd4('0x2b')][_0x7dd4('0x2c')],function(_0xb2bebf){return{'name':_0xb2bebf[_0x7dd4('0x2d')],'type':_0xb2bebf[_0x7dd4('0x2e')][_0x7dd4('0x2f')]};});_0xafdfc1[_0x7dd4('0x30')]=_[_0x7dd4('0x2a')](_0x3a6ced,_0x7dd4('0x28'));_0xafdfc1[_0x7dd4('0x31')]=_[_0x7dd4('0x32')](_0x2b987b[_0x7dd4('0x31')]);_0xafdfc1[_0x7dd4('0x33')]=_[_0x7dd4('0x34')](_0xafdfc1[_0x7dd4('0x30')],_0xafdfc1[_0x7dd4('0x31')]);_0x319483[_0x7dd4('0x35')]=_['intersection'](_0xafdfc1[_0x7dd4('0x30')],qs[_0x7dd4('0x36')](_0x2b987b[_0x7dd4('0x31')][_0x7dd4('0x36')]));_0x319483[_0x7dd4('0x35')]=_0x319483[_0x7dd4('0x35')]['length']?_0x319483[_0x7dd4('0x35')]:_0xafdfc1[_0x7dd4('0x30')];if(!_0x2b987b[_0x7dd4('0x31')][_0x7dd4('0x37')](_0x7dd4('0x38'))){_0x319483['limit']=qs[_0x7dd4('0x1d')](_0x2b987b[_0x7dd4('0x31')]['limit']);_0x319483['offset']=qs[_0x7dd4('0x1c')](_0x2b987b[_0x7dd4('0x31')]['offset']);}_0x319483[_0x7dd4('0x39')]=qs[_0x7dd4('0x3a')](_0x2b987b[_0x7dd4('0x31')]['sort']);_0x319483['where']=qs[_0x7dd4('0x33')](_[_0x7dd4('0x3b')](_0x2b987b[_0x7dd4('0x31')],_0xafdfc1[_0x7dd4('0x33')]),_0x3a6ced);if(_0x2b987b['query'][_0x7dd4('0x3c')]){_0x319483['where']=_[_0x7dd4('0x3d')](_0x319483[_0x7dd4('0x3e')],{'$or':_[_0x7dd4('0x2a')](_0x3a6ced,function(_0x5ed3f3){if(_0x5ed3f3[_0x7dd4('0x2e')]!==_0x7dd4('0x3f')){var _0x40925e={};_0x40925e[_0x5ed3f3[_0x7dd4('0x28')]]={'$like':'%'+_0x2b987b[_0x7dd4('0x31')][_0x7dd4('0x3c')]+'%'};return _0x40925e;}})});}_0x319483=_[_0x7dd4('0x3d')]({},_0x319483,_0x2b987b['options']);var _0x155ab2={'where':_0x319483['where']};return db['CmHopperHistory'][_0x7dd4('0x1e')](_0x155ab2)[_0x7dd4('0x25')](function(_0x5de105){_0x899282[_0x7dd4('0x1e')]=_0x5de105;if(_0x2b987b[_0x7dd4('0x31')][_0x7dd4('0x40')]){_0x319483['include']=[{'all':!![]}];}return db[_0x7dd4('0x2b')][_0x7dd4('0x41')](_0x319483);})[_0x7dd4('0x25')](function(_0x2afb13){_0x899282[_0x7dd4('0x42')]=_0x2afb13;return _0x899282;})[_0x7dd4('0x25')](respondWithFilteredResult(_0x50aced,_0x319483))[_0x7dd4('0x43')](handleError(_0x50aced,null));};exports[_0x7dd4('0x44')]=function(_0x1b6f4c,_0x4678dd){var _0x84083f={'raw':!![],'where':{'id':_0x1b6f4c[_0x7dd4('0x45')]['id']}},_0x4203f7={};_0x4203f7[_0x7dd4('0x30')]=_[_0x7dd4('0x32')](db[_0x7dd4('0x2b')][_0x7dd4('0x2c')]);_0x4203f7['query']=_['keys'](_0x1b6f4c[_0x7dd4('0x31')]);_0x4203f7[_0x7dd4('0x33')]=_['intersection'](_0x4203f7[_0x7dd4('0x30')],_0x4203f7['query']);_0x84083f[_0x7dd4('0x35')]=_[_0x7dd4('0x34')](_0x4203f7[_0x7dd4('0x30')],qs[_0x7dd4('0x36')](_0x1b6f4c[_0x7dd4('0x31')]['fields']));_0x84083f['attributes']=_0x84083f[_0x7dd4('0x35')]['length']?_0x84083f[_0x7dd4('0x35')]:_0x4203f7['model'];if(_0x1b6f4c[_0x7dd4('0x31')][_0x7dd4('0x40')]){_0x84083f[_0x7dd4('0x46')]=[{'all':!![]}];}_0x84083f=_[_0x7dd4('0x3d')]({},_0x84083f,_0x1b6f4c['options']);return db[_0x7dd4('0x2b')]['find'](_0x84083f)['then'](handleEntityNotFound(_0x4678dd,null))[_0x7dd4('0x25')](respondWithResult(_0x4678dd,null))[_0x7dd4('0x43')](handleError(_0x4678dd,null));};exports['create']=function(_0x10c7f9,_0x113d9b){return db[_0x7dd4('0x2b')][_0x7dd4('0x47')](_0x10c7f9['body'],{})[_0x7dd4('0x25')](respondWithResult(_0x113d9b,0xc9))[_0x7dd4('0x43')](handleError(_0x113d9b,null));};exports['describe']=function(_0x141202,_0x329c5f){return db[_0x7dd4('0x2b')][_0x7dd4('0x48')]()[_0x7dd4('0x25')](respondWithResult(_0x329c5f,null))['catch'](handleError(_0x329c5f,null));};exports[_0x7dd4('0x24')]=function(_0xec1b55,_0x4225c9){if(_0xec1b55[_0x7dd4('0x49')][_0x7dd4('0x4a')]){delete _0xec1b55[_0x7dd4('0x49')][_0x7dd4('0x4a')];}return db[_0x7dd4('0x2b')][_0x7dd4('0x4b')]({'where':{'uniqueid':_0xec1b55[_0x7dd4('0x45')]['id']}})[_0x7dd4('0x25')](handleEntityNotFound(_0x4225c9,null))[_0x7dd4('0x25')](saveUpdates(_0xec1b55[_0x7dd4('0x49')],null))[_0x7dd4('0x25')](respondWithResult(_0x4225c9,null))[_0x7dd4('0x43')](handleError(_0x4225c9,null));}; \ No newline at end of file +var _0xba54=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','save','update','then','destroy','stack','name','send','index','map','CmHopperHistory','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','include','findAll','params','rawAttributes','options','find','create','body','catch','describe','uniqueid','rimraf','zip-dir','fast-json-patch','moment','mustache','sox','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0xba54,0xcb));var _0x4ba5=function(_0x5fe792,_0x2d84b3){_0x5fe792=_0x5fe792-0x0;var _0x40a880=_0xba54[_0x5fe792];return _0x40a880;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4ba5('0x0'));var zipdir=require(_0x4ba5('0x1'));var jsonpatch=require(_0x4ba5('0x2'));var rp=require('request-promise');var moment=require(_0x4ba5('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4ba5('0x4'));var util=require('util');var path=require('path');var sox=require(_0x4ba5('0x5'));var csv=require('to-csv');var ejs=require(_0x4ba5('0x6'));var fs=require('fs');var fs_extra=require(_0x4ba5('0x7'));var _=require(_0x4ba5('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4ba5('0x9'));var deskjs=require(_0x4ba5('0xa'));var toCsv=require('to-csv');var querystring=require(_0x4ba5('0xb'));var Papa=require(_0x4ba5('0xc'));var Redis=require(_0x4ba5('0xd'));var authService=require(_0x4ba5('0xe'));var qs=require(_0x4ba5('0xf'));var as=require(_0x4ba5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4ba5('0x11'))(_0x4ba5('0x12'));var utils=require(_0x4ba5('0x13'));var config=require(_0x4ba5('0x14'));var licenseUtil=require(_0x4ba5('0x15'));var db=require(_0x4ba5('0x16'))['db'];function respondWithStatusCode(_0x5be40b,_0x4c8c77){_0x4c8c77=_0x4c8c77||0xcc;return function(_0x55993c){if(_0x55993c){return _0x5be40b[_0x4ba5('0x17')](_0x4c8c77);}return _0x5be40b[_0x4ba5('0x18')](_0x4c8c77)[_0x4ba5('0x19')]();};}function respondWithResult(_0x25b8fd,_0x5f0b4e){_0x5f0b4e=_0x5f0b4e||0xc8;return function(_0x2f4f98){if(_0x2f4f98){return _0x25b8fd[_0x4ba5('0x18')](_0x5f0b4e)['json'](_0x2f4f98);}};}function respondWithFilteredResult(_0x1fa6c8,_0x1c986d){return function(_0x852aac){if(_0x852aac){var _0x91b7a0=typeof _0x1c986d['offset']===_0x4ba5('0x1a')&&typeof _0x1c986d['limit']===_0x4ba5('0x1a');var _0x30859a=_0x852aac[_0x4ba5('0x1b')];var _0x321c51=_0x91b7a0?0x0:_0x1c986d[_0x4ba5('0x1c')];var _0x4d4cb7=_0x91b7a0?_0x852aac[_0x4ba5('0x1b')]:_0x1c986d[_0x4ba5('0x1c')]+_0x1c986d[_0x4ba5('0x1d')];var _0x5256eb;if(_0x4d4cb7>=_0x30859a){_0x4d4cb7=_0x30859a;_0x5256eb=0xc8;}else{_0x5256eb=0xce;}_0x1fa6c8[_0x4ba5('0x18')](_0x5256eb);return _0x1fa6c8[_0x4ba5('0x1e')](_0x4ba5('0x1f'),_0x321c51+'-'+_0x4d4cb7+'/'+_0x30859a)[_0x4ba5('0x20')](_0x852aac);}return null;};}function patchUpdates(_0x143509){return function(_0x1665f7){try{jsonpatch[_0x4ba5('0x21')](_0x1665f7,_0x143509,!![]);}catch(_0x1e4cf5){return BPromise['reject'](_0x1e4cf5);}return _0x1665f7[_0x4ba5('0x22')]();};}function saveUpdates(_0x3afcbe,_0x2f751c){return function(_0x10d154){if(_0x10d154){return _0x10d154[_0x4ba5('0x23')](_0x3afcbe)[_0x4ba5('0x24')](function(_0x367d46){return _0x367d46;});}return null;};}function removeEntity(_0x43bccf,_0x53ded5){return function(_0x217ebc){if(_0x217ebc){return _0x217ebc[_0x4ba5('0x25')]()['then'](function(){_0x43bccf[_0x4ba5('0x18')](0xcc)[_0x4ba5('0x19')]();});}};}function handleEntityNotFound(_0x2e1f2b,_0x2bdc32){return function(_0x29420f){if(!_0x29420f){_0x2e1f2b[_0x4ba5('0x17')](0x194);}return _0x29420f;};}function handleError(_0x26c98b,_0x4858ac){_0x4858ac=_0x4858ac||0x1f4;return function(_0x4413bb){logger['error'](_0x4413bb[_0x4ba5('0x26')]);if(_0x4413bb[_0x4ba5('0x27')]){delete _0x4413bb[_0x4ba5('0x27')];}_0x26c98b[_0x4ba5('0x18')](_0x4858ac)[_0x4ba5('0x28')](_0x4413bb);};}exports[_0x4ba5('0x29')]=function(_0x43a391,_0x21be3e){var _0x4192b2={},_0x508e1c={},_0x45a689={'count':0x0,'rows':[]};var _0x427d0a=_[_0x4ba5('0x2a')](db[_0x4ba5('0x2b')]['rawAttributes'],function(_0x5700cc){return{'name':_0x5700cc['fieldName'],'type':_0x5700cc['type'][_0x4ba5('0x2c')]};});_0x508e1c[_0x4ba5('0x2d')]=_[_0x4ba5('0x2a')](_0x427d0a,'name');_0x508e1c[_0x4ba5('0x2e')]=_[_0x4ba5('0x2f')](_0x43a391[_0x4ba5('0x2e')]);_0x508e1c[_0x4ba5('0x30')]=_[_0x4ba5('0x31')](_0x508e1c[_0x4ba5('0x2d')],_0x508e1c[_0x4ba5('0x2e')]);_0x4192b2[_0x4ba5('0x32')]=_[_0x4ba5('0x31')](_0x508e1c['model'],qs[_0x4ba5('0x33')](_0x43a391['query']['fields']));_0x4192b2['attributes']=_0x4192b2[_0x4ba5('0x32')][_0x4ba5('0x34')]?_0x4192b2[_0x4ba5('0x32')]:_0x508e1c[_0x4ba5('0x2d')];if(!_0x43a391[_0x4ba5('0x2e')][_0x4ba5('0x35')](_0x4ba5('0x36'))){_0x4192b2[_0x4ba5('0x1d')]=qs[_0x4ba5('0x1d')](_0x43a391[_0x4ba5('0x2e')]['limit']);_0x4192b2[_0x4ba5('0x1c')]=qs['offset'](_0x43a391[_0x4ba5('0x2e')]['offset']);}_0x4192b2['order']=qs[_0x4ba5('0x37')](_0x43a391[_0x4ba5('0x2e')]['sort']);_0x4192b2[_0x4ba5('0x38')]=qs[_0x4ba5('0x30')](_[_0x4ba5('0x39')](_0x43a391[_0x4ba5('0x2e')],_0x508e1c[_0x4ba5('0x30')]),_0x427d0a);if(_0x43a391['query'][_0x4ba5('0x3a')]){_0x4192b2[_0x4ba5('0x38')]=_[_0x4ba5('0x3b')](_0x4192b2['where'],{'$or':_['map'](_0x427d0a,function(_0x508843){if(_0x508843[_0x4ba5('0x3c')]!=='VIRTUAL'){var _0x517f20={};_0x517f20[_0x508843[_0x4ba5('0x27')]]={'$like':'%'+_0x43a391['query'][_0x4ba5('0x3a')]+'%'};return _0x517f20;}})});}_0x4192b2=_[_0x4ba5('0x3b')]({},_0x4192b2,_0x43a391['options']);var _0x1a1576={'where':_0x4192b2[_0x4ba5('0x38')]};return db[_0x4ba5('0x2b')]['count'](_0x1a1576)['then'](function(_0x1ca3f5){_0x45a689['count']=_0x1ca3f5;if(_0x43a391['query']['includeAll']){_0x4192b2[_0x4ba5('0x3d')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x4ba5('0x3e')](_0x4192b2);})[_0x4ba5('0x24')](function(_0x495b61){_0x45a689['rows']=_0x495b61;return _0x45a689;})['then'](respondWithFilteredResult(_0x21be3e,_0x4192b2))['catch'](handleError(_0x21be3e,null));};exports['show']=function(_0x29431c,_0x56deae){var _0x1b7f23={'raw':!![],'where':{'id':_0x29431c[_0x4ba5('0x3f')]['id']}},_0x141a18={};_0x141a18[_0x4ba5('0x2d')]=_[_0x4ba5('0x2f')](db[_0x4ba5('0x2b')][_0x4ba5('0x40')]);_0x141a18[_0x4ba5('0x2e')]=_[_0x4ba5('0x2f')](_0x29431c['query']);_0x141a18['filters']=_[_0x4ba5('0x31')](_0x141a18[_0x4ba5('0x2d')],_0x141a18[_0x4ba5('0x2e')]);_0x1b7f23[_0x4ba5('0x32')]=_[_0x4ba5('0x31')](_0x141a18['model'],qs[_0x4ba5('0x33')](_0x29431c[_0x4ba5('0x2e')][_0x4ba5('0x33')]));_0x1b7f23['attributes']=_0x1b7f23[_0x4ba5('0x32')][_0x4ba5('0x34')]?_0x1b7f23['attributes']:_0x141a18[_0x4ba5('0x2d')];if(_0x29431c[_0x4ba5('0x2e')]['includeAll']){_0x1b7f23[_0x4ba5('0x3d')]=[{'all':!![]}];}_0x1b7f23=_[_0x4ba5('0x3b')]({},_0x1b7f23,_0x29431c[_0x4ba5('0x41')]);return db[_0x4ba5('0x2b')][_0x4ba5('0x42')](_0x1b7f23)[_0x4ba5('0x24')](handleEntityNotFound(_0x56deae,null))['then'](respondWithResult(_0x56deae,null))['catch'](handleError(_0x56deae,null));};exports[_0x4ba5('0x43')]=function(_0x33111c,_0x1c7d7d){return db['CmHopperHistory'][_0x4ba5('0x43')](_0x33111c[_0x4ba5('0x44')],{})[_0x4ba5('0x24')](respondWithResult(_0x1c7d7d,0xc9))[_0x4ba5('0x45')](handleError(_0x1c7d7d,null));};exports['describe']=function(_0x17731d,_0x313745){return db[_0x4ba5('0x2b')][_0x4ba5('0x46')]()[_0x4ba5('0x24')](respondWithResult(_0x313745,null))['catch'](handleError(_0x313745,null));};exports[_0x4ba5('0x23')]=function(_0x5c0fab,_0x5117b4){if(_0x5c0fab[_0x4ba5('0x44')]['uniqueid']){delete _0x5c0fab[_0x4ba5('0x44')][_0x4ba5('0x47')];}return db['CmHopperHistory'][_0x4ba5('0x42')]({'where':{'uniqueid':_0x5c0fab[_0x4ba5('0x3f')]['id']}})[_0x4ba5('0x24')](handleEntityNotFound(_0x5117b4,null))[_0x4ba5('0x24')](saveUpdates(_0x5c0fab[_0x4ba5('0x44')],null))[_0x4ba5('0x24')](respondWithResult(_0x5117b4,null))[_0x4ba5('0x45')](handleError(_0x5117b4,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index f6094fb..7b869c8 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 _0x25a9=['rimraf','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','util','../../config/logger','api','moment','bluebird','path'];(function(_0x2242a1,_0x38f44d){var _0x2c298b=function(_0x4f4246){while(--_0x4f4246){_0x2242a1['push'](_0x2242a1['shift']());}};_0x2c298b(++_0x38f44d);}(_0x25a9,0xf1));var _0x925a=function(_0x3eb630,_0x552586){_0x3eb630=_0x3eb630-0x0;var _0x1b840d=_0x25a9[_0x3eb630];return _0x1b840d;};'use strict';var _=require('lodash');var util=require(_0x925a('0x0'));var logger=require(_0x925a('0x1'))(_0x925a('0x2'));var moment=require(_0x925a('0x3'));var BPromise=require(_0x925a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x925a('0x5'));var rimraf=require(_0x925a('0x6'));var config=require('../../config/environment');var attributes=require('./cmHopperHistory.attributes');module[_0x925a('0x7')]=function(_0x5271bc,_0x436db7){return _0x5271bc[_0x925a('0x8')](_0x925a('0x9'),attributes,{'tableName':_0x925a('0xa'),'paranoid':![],'indexes':[{'name':_0x925a('0xb'),'fields':[_0x925a('0xb')]},{'name':_0x925a('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xb458=['define','CmHopperHistory','cm_hopper_history','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./cmHopperHistory.attributes'];(function(_0x4f502e,_0x47f025){var _0x40d608=function(_0x59bcb6){while(--_0x59bcb6){_0x4f502e['push'](_0x4f502e['shift']());}};_0x40d608(++_0x47f025);}(_0xb458,0x94));var _0x8b45=function(_0x3ae4cc,_0x1cd059){_0x3ae4cc=_0x3ae4cc-0x0;var _0x102b82=_0xb458[_0x3ae4cc];return _0x102b82;};'use strict';var _=require(_0x8b45('0x0'));var util=require(_0x8b45('0x1'));var logger=require(_0x8b45('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8b45('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8b45('0x4'));var rimraf=require(_0x8b45('0x5'));var config=require(_0x8b45('0x6'));var attributes=require(_0x8b45('0x7'));module['exports']=function(_0xfe8757,_0xd23b88){return _0xfe8757[_0x8b45('0x8')](_0x8b45('0x9'),attributes,{'tableName':_0x8b45('0xa'),'paranoid':![],'indexes':[{'name':'endtime','fields':['endtime']},{'name':_0x8b45('0xb'),'fields':[_0x8b45('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 1f0eeb8..20da369 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 _0x21a3=['predictiveIntervalTotalCalls','COUNT','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','AvgHandleTime','GetVoiceQueueHopperHistory','findAll','name','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','outboundRejectCallsDay','outboundReCallsDay','campaign','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CmHopperHistory','create','body','options','raw','CreateCmHopperHistory','catch','where','sequelize','col'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x21a3,0x66));var _0x321a=function(_0x3c307c,_0x1b06c4){_0x3c307c=_0x3c307c-0x0;var _0x32cf08=_0x21a3[_0x3c307c];return _0x32cf08;};'use strict';var _=require(_0x321a('0x0'));var util=require('util');var moment=require(_0x321a('0x1'));var BPromise=require(_0x321a('0x2'));var rs=require(_0x321a('0x3'));var fs=require('fs');var Redis=require(_0x321a('0x4'));var db=require(_0x321a('0x5'))['db'];var utils=require(_0x321a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x321a('0x7'));var jayson=require(_0x321a('0x8'));var client=jayson[_0x321a('0x9')][_0x321a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5f3b81,_0x388901,_0x24a04c){return new BPromise(function(_0x10c1d3,_0xdfd6b8){return client[_0x321a('0xb')](_0x5f3b81,_0x24a04c)[_0x321a('0xc')](function(_0x2c52dc){logger[_0x321a('0xd')](_0x321a('0xe'),_0x388901,_0x321a('0xf'));logger[_0x321a('0x10')](_0x321a('0x11'),_0x388901,'request\x20sent',JSON[_0x321a('0x12')](_0x2c52dc));if(_0x2c52dc[_0x321a('0x13')]){if(_0x2c52dc['error']['code']===0x1f4){logger[_0x321a('0x13')]('CmHopperHistory,\x20%s,\x20%s',_0x388901,_0x2c52dc[_0x321a('0x13')][_0x321a('0x14')]);return _0xdfd6b8(_0x2c52dc['error']['message']);}logger[_0x321a('0x13')](_0x321a('0xe'),_0x388901,_0x2c52dc[_0x321a('0x13')][_0x321a('0x14')]);return _0x10c1d3(_0x2c52dc[_0x321a('0x13')][_0x321a('0x14')]);}else{logger[_0x321a('0xd')](_0x321a('0xe'),_0x388901,'request\x20sent');_0x10c1d3(_0x2c52dc[_0x321a('0x15')][_0x321a('0x14')]);}})['catch'](function(_0x45ceb2){logger[_0x321a('0x13')](_0x321a('0xe'),_0x388901,_0x45ceb2);_0xdfd6b8(_0x45ceb2);});});}exports['CreateCmHopperHistory']=function(_0x5b1810){var _0x464bd7=this;return new Promise(function(_0x35fd6f,_0x58595b){return db[_0x321a('0x16')][_0x321a('0x17')](_0x5b1810[_0x321a('0x18')],{'raw':_0x5b1810['options']?_0x5b1810[_0x321a('0x19')][_0x321a('0x1a')]===undefined?!![]:![]:!![]})[_0x321a('0xc')](function(_0x423cb8){logger[_0x321a('0xd')](_0x321a('0x1b'),_0x5b1810);logger[_0x321a('0x10')](_0x321a('0x1b'),_0x5b1810,JSON[_0x321a('0x12')](_0x423cb8));_0x35fd6f(_0x423cb8);})[_0x321a('0x1c')](function(_0x1b94a1){logger[_0x321a('0x13')]('CreateCmHopperHistory',_0x1b94a1[_0x321a('0x14')],_0x5b1810);_0x58595b(_0x464bd7[_0x321a('0x13')](0x1f4,_0x1b94a1[_0x321a('0x14')]));});});};exports['AvgHandleTime']=function(_0x26da8e){var _0x15886e=this;return new Promise(function(_0x591f89,_0x51e7a8){return db[_0x321a('0x16')]['findAll']({'raw':_0x26da8e[_0x321a('0x19')]?_0x26da8e[_0x321a('0x19')][_0x321a('0x1a')]===undefined?!![]:![]:!![],'where':_0x26da8e[_0x321a('0x19')]?_0x26da8e[_0x321a('0x19')][_0x321a('0x1d')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0x321a('0x1e')][_0x321a('0x1f')]('id')),_0x321a('0x20')],[db['sequelize']['fn'](_0x321a('0x21'),db[_0x321a('0x1e')]['fn']('IF',db[_0x321a('0x1e')]['literal'](_0x321a('0x22')))),_0x321a('0x23')],[db[_0x321a('0x1e')]['fn'](_0x321a('0x21'),db[_0x321a('0x1e')]['fn']('IF',db[_0x321a('0x1e')][_0x321a('0x24')](_0x321a('0x25')))),_0x321a('0x26')],[db['sequelize']['fn'](_0x321a('0x21'),db[_0x321a('0x1e')]['fn']('IF',db[_0x321a('0x1e')][_0x321a('0x24')](_0x321a('0x27')))),_0x321a('0x28')],[db['sequelize']['fn']('AVG',db[_0x321a('0x1e')]['fn']('IF',db['sequelize'][_0x321a('0x24')](_0x321a('0x29')))),_0x321a('0x2a')],[db['sequelize']['fn']('AVG',db[_0x321a('0x1e')]['fn']('IF',db['sequelize'][_0x321a('0x24')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),'predictiveIntervalAvgTalktime']]})[_0x321a('0xc')](function(_0x16bb91){logger[_0x321a('0xd')]('AvgHandleTime',_0x26da8e);logger['debug']('AvgHandleTime',_0x26da8e,JSON[_0x321a('0x12')](_0x16bb91));_0x591f89(_0x16bb91);})[_0x321a('0x1c')](function(_0x4cfd01){logger['error'](_0x321a('0x2b'),_0x4cfd01[_0x321a('0x14')],_0x26da8e);_0x51e7a8(_0x15886e[_0x321a('0x13')](0x1f4,_0x4cfd01[_0x321a('0x14')]));});});};exports[_0x321a('0x2c')]=function(_0x141ea9){var _0x4d3e0e=this;return new Promise(function(_0x2e8c78,_0x2a9a33){return db[_0x321a('0x16')][_0x321a('0x2d')]({'raw':_0x141ea9['options']?_0x141ea9[_0x321a('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x141ea9['options']?_0x141ea9[_0x321a('0x19')][_0x321a('0x1d')]||null:null,'attributes':[['campaign',_0x321a('0x2e')],[db[_0x321a('0x1e')]['fn'](_0x321a('0x21'),db['sequelize']['fn']('IF',db[_0x321a('0x1e')][_0x321a('0x24')]('`state`\x20=\x200,\x201,\x20null'))),'outboundNoSuchCallsDay'],[db[_0x321a('0x1e')]['fn'](_0x321a('0x21'),db[_0x321a('0x1e')]['fn']('IF',db['sequelize'][_0x321a('0x24')](_0x321a('0x2f')))),_0x321a('0x30')],[db[_0x321a('0x1e')]['fn'](_0x321a('0x21'),db[_0x321a('0x1e')]['fn']('IF',db[_0x321a('0x1e')][_0x321a('0x24')](_0x321a('0x22')))),_0x321a('0x31')],[db[_0x321a('0x1e')]['fn'](_0x321a('0x21'),db['sequelize']['fn']('IF',db[_0x321a('0x1e')][_0x321a('0x24')]('`state`\x20=\x205,\x201,\x20null'))),_0x321a('0x32')],[db[_0x321a('0x1e')]['fn']('COUNT',db[_0x321a('0x1e')]['fn']('IF',db[_0x321a('0x1e')][_0x321a('0x24')](_0x321a('0x33')))),'outboundCongestionCallsDay'],[db[_0x321a('0x1e')]['fn'](_0x321a('0x21'),db[_0x321a('0x1e')]['fn']('IF',db[_0x321a('0x1e')][_0x321a('0x24')](_0x321a('0x34')))),_0x321a('0x35')],[db[_0x321a('0x1e')]['fn'](_0x321a('0x21'),db[_0x321a('0x1e')]['fn']('IF',db[_0x321a('0x1e')][_0x321a('0x24')]('`state`\x20=\x2011\x20,\x201,\x20null'))),'outboundDropCallsDayCallersExit'],[db[_0x321a('0x1e')]['fn'](_0x321a('0x21'),db[_0x321a('0x1e')]['fn']('IF',db[_0x321a('0x1e')][_0x321a('0x24')]('`state`\x20=\x2012,\x201,\x20null'))),_0x321a('0x36')],[db['sequelize']['fn'](_0x321a('0x21'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x321a('0x37')))),_0x321a('0x38')],[db['sequelize']['fn']('COUNT',db[_0x321a('0x1e')]['fn']('IF',db[_0x321a('0x1e')]['literal']('`state`\x20=\x2014,\x201,\x20null'))),_0x321a('0x39')],[db[_0x321a('0x1e')]['fn']('COUNT',db[_0x321a('0x1e')]['fn']('IF',db[_0x321a('0x1e')][_0x321a('0x24')](_0x321a('0x3a')))),'outboundRejectCallsDay'],[db[_0x321a('0x1e')]['fn'](_0x321a('0x21'),db[_0x321a('0x1e')]['fn']('IF',db['sequelize'][_0x321a('0x24')](_0x321a('0x3b')))),_0x321a('0x3c')],[db[_0x321a('0x1e')]['fn']('COUNT',db[_0x321a('0x1e')]['fn']('IF',db['sequelize'][_0x321a('0x24')]('`state`\x20=\x2020,\x201,\x20null'))),_0x321a('0x3d')],[db[_0x321a('0x1e')]['fn']('COUNT',db[_0x321a('0x1e')]['fn']('IF',db[_0x321a('0x1e')]['literal']('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0x321a('0x3e')]],'group':[_0x321a('0x3f')]})['then'](function(_0x232044){logger['info'](_0x321a('0x2c'),_0x141ea9);logger[_0x321a('0x10')]('GetVoiceQueueHopperHistory',_0x141ea9,JSON[_0x321a('0x12')](_0x232044));_0x2e8c78(_0x232044);})[_0x321a('0x1c')](function(_0x118b0b){logger['error']('GetVoiceQueueHopperHistory',_0x118b0b['message'],_0x141ea9);_0x2a9a33(_0x4d3e0e[_0x321a('0x13')](0x1f4,_0x118b0b[_0x321a('0x14')]));});});};exports['GetCampaignHopperHistory']=function(_0x35ed58){var _0xf7b5cd=this;return new Promise(function(_0x15fdae,_0x267a3c){return db[_0x321a('0x16')][_0x321a('0x2d')]({'raw':_0x35ed58[_0x321a('0x19')]?_0x35ed58[_0x321a('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x35ed58[_0x321a('0x19')]?_0x35ed58[_0x321a('0x19')][_0x321a('0x1d')]||null:null,'attributes':[[_0x321a('0x3f'),_0x321a('0x2e')],[db[_0x321a('0x1e')]['fn'](_0x321a('0x21'),db['sequelize'][_0x321a('0x1f')]('id')),_0x321a('0x40')],[db['sequelize']['fn']('COUNT',db[_0x321a('0x1e')]['fn']('IF',db[_0x321a('0x1e')]['literal'](_0x321a('0x22')))),_0x321a('0x41')]],'group':[_0x321a('0x3f')]})[_0x321a('0xc')](function(_0x566f70){logger['info']('GetCampaignHopperHistory',_0x35ed58);logger['debug'](_0x321a('0x42'),_0x35ed58,JSON[_0x321a('0x12')](_0x566f70));_0x15fdae(_0x566f70);})[_0x321a('0x1c')](function(_0x2cf6d1){logger[_0x321a('0x13')](_0x321a('0x42'),_0x2cf6d1[_0x321a('0x14')],_0x35ed58);_0x267a3c(_0xf7b5cd[_0x321a('0x13')](0x1f4,_0x2cf6d1[_0x321a('0x14')]));});});}; \ No newline at end of file +var _0xe3c9=['then','catch','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrAnswerCallsDay','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent','stringify','error','code','message','CmHopperHistory,\x20%s,\x20%s','result','CmHopperHistory','options','raw','CreateCmHopperHistory','debug','AvgHandleTime','findAll','where','COUNT','sequelize','col','`state`\x20=\x204,\x201,\x20null','literal','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime'];(function(_0x5aadac,_0x15dd83){var _0x3c7e21=function(_0x20a135){while(--_0x20a135){_0x5aadac['push'](_0x5aadac['shift']());}};_0x3c7e21(++_0x15dd83);}(_0xe3c9,0x1ad));var _0x9e3c=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xe3c9[_0x53ccf2];return _0x5a2964;};'use strict';var _=require('lodash');var util=require(_0x9e3c('0x0'));var moment=require('moment');var BPromise=require(_0x9e3c('0x1'));var rs=require(_0x9e3c('0x2'));var fs=require('fs');var Redis=require(_0x9e3c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9e3c('0x4'));var logger=require(_0x9e3c('0x5'))(_0x9e3c('0x6'));var config=require(_0x9e3c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9e3c('0x8')][_0x9e3c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5347cb,_0x1437a0,_0x335e99){return new BPromise(function(_0x59a631,_0x3cc670){return client[_0x9e3c('0xa')](_0x5347cb,_0x335e99)['then'](function(_0x1bd026){logger[_0x9e3c('0xb')]('CmHopperHistory,\x20%s,\x20%s',_0x1437a0,_0x9e3c('0xc'));logger['debug']('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x1437a0,_0x9e3c('0xc'),JSON[_0x9e3c('0xd')](_0x1bd026));if(_0x1bd026['error']){if(_0x1bd026[_0x9e3c('0xe')][_0x9e3c('0xf')]===0x1f4){logger[_0x9e3c('0xe')]('CmHopperHistory,\x20%s,\x20%s',_0x1437a0,_0x1bd026[_0x9e3c('0xe')][_0x9e3c('0x10')]);return _0x3cc670(_0x1bd026[_0x9e3c('0xe')][_0x9e3c('0x10')]);}logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x1437a0,_0x1bd026[_0x9e3c('0xe')][_0x9e3c('0x10')]);return _0x59a631(_0x1bd026[_0x9e3c('0xe')][_0x9e3c('0x10')]);}else{logger[_0x9e3c('0xb')](_0x9e3c('0x11'),_0x1437a0,'request\x20sent');_0x59a631(_0x1bd026[_0x9e3c('0x12')][_0x9e3c('0x10')]);}})['catch'](function(_0x55bcad){logger['error'](_0x9e3c('0x11'),_0x1437a0,_0x55bcad);_0x3cc670(_0x55bcad);});});}exports['CreateCmHopperHistory']=function(_0x2943fe){var _0x47da45=this;return new Promise(function(_0x3ac32b,_0x488a47){return db[_0x9e3c('0x13')]['create'](_0x2943fe['body'],{'raw':_0x2943fe[_0x9e3c('0x14')]?_0x2943fe[_0x9e3c('0x14')][_0x9e3c('0x15')]===undefined?!![]:![]:!![]})['then'](function(_0x433711){logger[_0x9e3c('0xb')](_0x9e3c('0x16'),_0x2943fe);logger[_0x9e3c('0x17')](_0x9e3c('0x16'),_0x2943fe,JSON[_0x9e3c('0xd')](_0x433711));_0x3ac32b(_0x433711);})['catch'](function(_0x2ad1b){logger[_0x9e3c('0xe')]('CreateCmHopperHistory',_0x2ad1b[_0x9e3c('0x10')],_0x2943fe);_0x488a47(_0x47da45[_0x9e3c('0xe')](0x1f4,_0x2ad1b[_0x9e3c('0x10')]));});});};exports[_0x9e3c('0x18')]=function(_0x134bfd){var _0x38499a=this;return new Promise(function(_0x3a6c45,_0x1035e0){return db[_0x9e3c('0x13')][_0x9e3c('0x19')]({'raw':_0x134bfd[_0x9e3c('0x14')]?_0x134bfd[_0x9e3c('0x14')][_0x9e3c('0x15')]===undefined?!![]:![]:!![],'where':_0x134bfd[_0x9e3c('0x14')]?_0x134bfd[_0x9e3c('0x14')][_0x9e3c('0x1a')]||null:null,'attributes':[[db['sequelize']['fn'](_0x9e3c('0x1b'),db[_0x9e3c('0x1c')][_0x9e3c('0x1d')]('id')),'predictiveIntervalTotalCalls'],[db['sequelize']['fn'](_0x9e3c('0x1b'),db['sequelize']['fn']('IF',db[_0x9e3c('0x1c')]['literal'](_0x9e3c('0x1e')))),'predictiveIntervalAnsweredCalls'],[db['sequelize']['fn'](_0x9e3c('0x1b'),db['sequelize']['fn']('IF',db[_0x9e3c('0x1c')][_0x9e3c('0x1f')](_0x9e3c('0x20')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x9e3c('0x1c')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x9e3c('0x1c')][_0x9e3c('0x1f')](_0x9e3c('0x21')))),_0x9e3c('0x22')],[db[_0x9e3c('0x1c')]['fn']('AVG',db[_0x9e3c('0x1c')]['fn']('IF',db[_0x9e3c('0x1c')][_0x9e3c('0x1f')](_0x9e3c('0x23')))),_0x9e3c('0x24')],[db['sequelize']['fn'](_0x9e3c('0x25'),db[_0x9e3c('0x1c')]['fn']('IF',db['sequelize'][_0x9e3c('0x1f')](_0x9e3c('0x26')))),_0x9e3c('0x27')]]})[_0x9e3c('0x28')](function(_0x3821c0){logger[_0x9e3c('0xb')]('AvgHandleTime',_0x134bfd);logger[_0x9e3c('0x17')]('AvgHandleTime',_0x134bfd,JSON['stringify'](_0x3821c0));_0x3a6c45(_0x3821c0);})[_0x9e3c('0x29')](function(_0xa1b62e){logger[_0x9e3c('0xe')]('AvgHandleTime',_0xa1b62e[_0x9e3c('0x10')],_0x134bfd);_0x1035e0(_0x38499a[_0x9e3c('0xe')](0x1f4,_0xa1b62e['message']));});});};exports[_0x9e3c('0x2a')]=function(_0x452e7e){var _0x1f908f=this;return new Promise(function(_0x18c6ce,_0x147ef0){return db[_0x9e3c('0x13')]['findAll']({'raw':_0x452e7e[_0x9e3c('0x14')]?_0x452e7e[_0x9e3c('0x14')][_0x9e3c('0x15')]===undefined?!![]:![]:!![],'where':_0x452e7e['options']?_0x452e7e[_0x9e3c('0x14')][_0x9e3c('0x1a')]||null:null,'attributes':[[_0x9e3c('0x2b'),_0x9e3c('0x2c')],[db[_0x9e3c('0x1c')]['fn'](_0x9e3c('0x1b'),db['sequelize']['fn']('IF',db[_0x9e3c('0x1c')][_0x9e3c('0x1f')](_0x9e3c('0x2d')))),_0x9e3c('0x2e')],[db[_0x9e3c('0x1c')]['fn'](_0x9e3c('0x1b'),db[_0x9e3c('0x1c')]['fn']('IF',db[_0x9e3c('0x1c')][_0x9e3c('0x1f')](_0x9e3c('0x2f')))),_0x9e3c('0x30')],[db['sequelize']['fn']('COUNT',db[_0x9e3c('0x1c')]['fn']('IF',db[_0x9e3c('0x1c')][_0x9e3c('0x1f')](_0x9e3c('0x1e')))),'outboundAnswerCallsDay'],[db[_0x9e3c('0x1c')]['fn'](_0x9e3c('0x1b'),db['sequelize']['fn']('IF',db[_0x9e3c('0x1c')][_0x9e3c('0x1f')](_0x9e3c('0x31')))),_0x9e3c('0x32')],[db[_0x9e3c('0x1c')]['fn'](_0x9e3c('0x1b'),db[_0x9e3c('0x1c')]['fn']('IF',db[_0x9e3c('0x1c')][_0x9e3c('0x1f')](_0x9e3c('0x33')))),'outboundCongestionCallsDay'],[db[_0x9e3c('0x1c')]['fn'](_0x9e3c('0x1b'),db[_0x9e3c('0x1c')]['fn']('IF',db[_0x9e3c('0x1c')][_0x9e3c('0x1f')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x9e3c('0x34')],[db[_0x9e3c('0x1c')]['fn'](_0x9e3c('0x1b'),db[_0x9e3c('0x1c')]['fn']('IF',db['sequelize'][_0x9e3c('0x1f')](_0x9e3c('0x35')))),_0x9e3c('0x36')],[db[_0x9e3c('0x1c')]['fn']('COUNT',db[_0x9e3c('0x1c')]['fn']('IF',db[_0x9e3c('0x1c')][_0x9e3c('0x1f')](_0x9e3c('0x37')))),'outboundUnknownCallsDay'],[db[_0x9e3c('0x1c')]['fn'](_0x9e3c('0x1b'),db[_0x9e3c('0x1c')]['fn']('IF',db[_0x9e3c('0x1c')][_0x9e3c('0x1f')](_0x9e3c('0x38')))),'outboundBlacklistCallsDay'],[db[_0x9e3c('0x1c')]['fn'](_0x9e3c('0x1b'),db['sequelize']['fn']('IF',db[_0x9e3c('0x1c')][_0x9e3c('0x1f')](_0x9e3c('0x39')))),'outboundOriginateFailureCallsDay'],[db[_0x9e3c('0x1c')]['fn'](_0x9e3c('0x1b'),db[_0x9e3c('0x1c')]['fn']('IF',db[_0x9e3c('0x1c')]['literal'](_0x9e3c('0x3a')))),_0x9e3c('0x3b')],[db[_0x9e3c('0x1c')]['fn'](_0x9e3c('0x1b'),db[_0x9e3c('0x1c')]['fn']('IF',db[_0x9e3c('0x1c')][_0x9e3c('0x1f')](_0x9e3c('0x3c')))),_0x9e3c('0x3d')],[db[_0x9e3c('0x1c')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x9e3c('0x1c')][_0x9e3c('0x1f')](_0x9e3c('0x3e')))),_0x9e3c('0x3b')],[db[_0x9e3c('0x1c')]['fn'](_0x9e3c('0x1b'),db[_0x9e3c('0x1c')]['fn']('IF',db['sequelize'][_0x9e3c('0x1f')](_0x9e3c('0x3f')))),_0x9e3c('0x40')]],'group':[_0x9e3c('0x2b')]})['then'](function(_0x540879){logger[_0x9e3c('0xb')](_0x9e3c('0x2a'),_0x452e7e);logger[_0x9e3c('0x17')](_0x9e3c('0x2a'),_0x452e7e,JSON[_0x9e3c('0xd')](_0x540879));_0x18c6ce(_0x540879);})['catch'](function(_0x169f1c){logger[_0x9e3c('0xe')]('GetVoiceQueueHopperHistory',_0x169f1c[_0x9e3c('0x10')],_0x452e7e);_0x147ef0(_0x1f908f[_0x9e3c('0xe')](0x1f4,_0x169f1c[_0x9e3c('0x10')]));});});};exports[_0x9e3c('0x41')]=function(_0xf1efa3){var _0x32cf83=this;return new Promise(function(_0x3dbc4c,_0x4a69cd){return db['CmHopperHistory'][_0x9e3c('0x19')]({'raw':_0xf1efa3[_0x9e3c('0x14')]?_0xf1efa3['options']['raw']===undefined?!![]:![]:!![],'where':_0xf1efa3[_0x9e3c('0x14')]?_0xf1efa3[_0x9e3c('0x14')][_0x9e3c('0x1a')]||null:null,'attributes':[['campaign',_0x9e3c('0x2c')],[db[_0x9e3c('0x1c')]['fn']('COUNT',db[_0x9e3c('0x1c')][_0x9e3c('0x1d')]('id')),'ivrTotalCallsDays'],[db[_0x9e3c('0x1c')]['fn'](_0x9e3c('0x1b'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x9e3c('0x1e')))),_0x9e3c('0x42')]],'group':[_0x9e3c('0x2b')]})['then'](function(_0x17ee6d){logger['info'](_0x9e3c('0x41'),_0xf1efa3);logger[_0x9e3c('0x17')]('GetCampaignHopperHistory',_0xf1efa3,JSON[_0x9e3c('0xd')](_0x17ee6d));_0x3dbc4c(_0x17ee6d);})['catch'](function(_0x1cd7c5){logger['error']('GetCampaignHopperHistory',_0x1cd7c5[_0x9e3c('0x10')],_0xf1efa3);_0x4a69cd(_0x32cf83[_0x9e3c('0xe')](0x1f4,_0x1cd7c5[_0x9e3c('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 78efdfe..f4fb259 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 _0x0e20=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','create','put','update','exports','multer','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0e20,0x1a2));var _0x00e2=function(_0x52f651,_0x189afd){_0x52f651=_0x52f651-0x0;var _0x261523=_0x0e20[_0x52f651];return _0x261523;};'use strict';var multer=require(_0x00e2('0x0'));var util=require('util');var path=require(_0x00e2('0x1'));var timeout=require(_0x00e2('0x2'));var express=require(_0x00e2('0x3'));var router=express[_0x00e2('0x4')]();var fs_extra=require(_0x00e2('0x5'));var auth=require(_0x00e2('0x6'));var interaction=require(_0x00e2('0x7'));var config=require(_0x00e2('0x8'));var controller=require('./cmHopperHistory.controller');router['get']('/',auth[_0x00e2('0x9')](),controller[_0x00e2('0xa')]);router[_0x00e2('0xb')](_0x00e2('0xc'),auth['isAuthenticated'](),controller[_0x00e2('0xd')]);router[_0x00e2('0xb')](_0x00e2('0xe'),auth[_0x00e2('0x9')](),controller[_0x00e2('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x00e2('0x10')]);router[_0x00e2('0x11')]('/:id',auth[_0x00e2('0x9')](),controller[_0x00e2('0x12')]);module[_0x00e2('0x13')]=router; \ No newline at end of file +var _0x76df=['get','isAuthenticated','index','/describe','/:id','show','create','put','update','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment'];(function(_0x25e415,_0x3276ed){var _0x1c37dc=function(_0x2f2381){while(--_0x2f2381){_0x25e415['push'](_0x25e415['shift']());}};_0x1c37dc(++_0x3276ed);}(_0x76df,0x8a));var _0xf76d=function(_0x2e914,_0x1c7566){_0x2e914=_0x2e914-0x0;var _0x936e45=_0x76df[_0x2e914];return _0x936e45;};'use strict';var multer=require(_0xf76d('0x0'));var util=require('util');var path=require(_0xf76d('0x1'));var timeout=require(_0xf76d('0x2'));var express=require('express');var router=express[_0xf76d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf76d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf76d('0x5'));var controller=require('./cmHopperHistory.controller');router[_0xf76d('0x6')]('/',auth[_0xf76d('0x7')](),controller[_0xf76d('0x8')]);router[_0xf76d('0x6')](_0xf76d('0x9'),auth[_0xf76d('0x7')](),controller['describe']);router['get'](_0xf76d('0xa'),auth['isAuthenticated'](),controller[_0xf76d('0xb')]);router['post']('/',auth[_0xf76d('0x7')](),controller[_0xf76d('0xc')]);router[_0xf76d('0xd')](_0xf76d('0xa'),auth['isAuthenticated'](),controller[_0xf76d('0xe')]);module[_0xf76d('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index ec029c1..38bbc51 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 _0x291c=['exports','STRING','name','sequelize'];(function(_0xdca707,_0x3b84d1){var _0x48cca2=function(_0x49199d){while(--_0x49199d){_0xdca707['push'](_0xdca707['shift']());}};_0x48cca2(++_0x3b84d1);}(_0x291c,0x137));var _0xc291=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x291c[_0x413feb];return _0x40ee88;};'use strict';var Sequelize=require(_0xc291('0x0'));module[_0xc291('0x1')]={'name':{'type':Sequelize[_0xc291('0x2')],'unique':_0xc291('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc291('0x2')]},'dialPrefix':{'type':Sequelize[_0xc291('0x2')]}}; \ No newline at end of file +var _0x33c5=['exports','STRING'];(function(_0x25193d,_0x59611e){var _0x3d08f9=function(_0x502e65){while(--_0x502e65){_0x25193d['push'](_0x25193d['shift']());}};_0x3d08f9(++_0x59611e);}(_0x33c5,0xe6));var _0x533c=function(_0x26425a,_0x1b4d6f){_0x26425a=_0x26425a-0x0;var _0x12802a=_0x33c5[_0x26425a];return _0x12802a;};'use strict';var Sequelize=require('sequelize');module[_0x533c('0x0')]={'name':{'type':Sequelize[_0x533c('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x533c('0x1')]},'dialPrefix':{'type':Sequelize[_0x533c('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 6ac5abb..33ef89f 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 _0xec90=['includeAll','findAll','rows','show','rawAttributes','find','catch','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','params','describe','addDisposition','ListId','Disposition','getDispositions','findOne','filter','include','removeDispositions','ids','addContacts','CmContact','tags','isArray','push','each','omit','success','dataValues','errors','message','CmCustomField','format','cf_%d','getContacts','getContactsCsv','ContactItemType','OrderBy','select','from','cm_contacts','distinct','field','customField_','alias','item','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','toString','isEmpty','now','/tmp/list_%d_%s.csv','setHeader','attachment;\x20filename=','list_%d_%s.csv','Content-type','download','addCustomField','sequelize','transaction','addCustomFields','Sequelize','text','number','INTEGER','switch','BOOLEAN','queryInterface','addColumn','getCustomFields','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','info','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./cmList.socket','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','Lists','UserProfileResource','sendStatus','error','stack','name','send','map','CmList','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','options'];(function(_0x118004,_0x35594e){var _0x44485e=function(_0x191483){while(--_0x191483){_0x118004['push'](_0x118004['shift']());}};_0x44485e(++_0x35594e);}(_0xec90,0x19c));var _0x0ec9=function(_0xc4066e,_0x58eb77){_0xc4066e=_0xc4066e-0x0;var _0x497b59=_0xec90[_0xc4066e];return _0x497b59;};'use strict';var emlformat=require(_0x0ec9('0x0'));var rimraf=require(_0x0ec9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0ec9('0x2'));var rp=require(_0x0ec9('0x3'));var moment=require(_0x0ec9('0x4'));var BPromise=require(_0x0ec9('0x5'));var Mustache=require(_0x0ec9('0x6'));var util=require(_0x0ec9('0x7'));var path=require(_0x0ec9('0x8'));var sox=require(_0x0ec9('0x9'));var csv=require(_0x0ec9('0xa'));var ejs=require(_0x0ec9('0xb'));var fs=require('fs');var fs_extra=require(_0x0ec9('0xc'));var _=require(_0x0ec9('0xd'));var squel=require('squel');var crypto=require(_0x0ec9('0xe'));var jsforce=require(_0x0ec9('0xf'));var deskjs=require(_0x0ec9('0x10'));var toCsv=require(_0x0ec9('0xa'));var querystring=require(_0x0ec9('0x11'));var Papa=require(_0x0ec9('0x12'));var Redis=require(_0x0ec9('0x13'));var authService=require(_0x0ec9('0x14'));var qs=require(_0x0ec9('0x15'));var as=require(_0x0ec9('0x16'));var hardwareService=require(_0x0ec9('0x17'));var logger=require('../../config/logger')(_0x0ec9('0x18'));var utils=require(_0x0ec9('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x0ec9('0x1a'));var db=require(_0x0ec9('0x1b'))['db'];var csv_results;config[_0x0ec9('0x1c')]=_['defaults'](config['redis'],{'host':_0x0ec9('0x1d'),'port':0x18eb});var socket=require(_0x0ec9('0x1e'))(new Redis(config[_0x0ec9('0x1c')]));require(_0x0ec9('0x1f'))['register'](socket);function respondWithStatusCode(_0xaa0ae3,_0x5288b7){_0x5288b7=_0x5288b7||0xcc;return function(_0x95ea17){if(_0x95ea17){return _0xaa0ae3['sendStatus'](_0x5288b7);}return _0xaa0ae3[_0x0ec9('0x20')](_0x5288b7)[_0x0ec9('0x21')]();};}function respondWithResult(_0x2ec1d8,_0x5ae01c){_0x5ae01c=_0x5ae01c||0xc8;return function(_0x2c4b5c){if(_0x2c4b5c){return _0x2ec1d8[_0x0ec9('0x20')](_0x5ae01c)[_0x0ec9('0x22')](_0x2c4b5c);}};}function respondWithFilteredResult(_0x4302fc,_0x223039){return function(_0x37e8d1){if(_0x37e8d1){var _0x537e8b=typeof _0x223039[_0x0ec9('0x23')]===_0x0ec9('0x24')&&typeof _0x223039[_0x0ec9('0x25')]===_0x0ec9('0x24');var _0x560142=_0x37e8d1[_0x0ec9('0x26')];var _0x1acd72=_0x537e8b?0x0:_0x223039[_0x0ec9('0x23')];var _0xfad2bc=_0x537e8b?_0x37e8d1[_0x0ec9('0x26')]:_0x223039['offset']+_0x223039[_0x0ec9('0x25')];var _0x401a09;if(_0xfad2bc>=_0x560142){_0xfad2bc=_0x560142;_0x401a09=0xc8;}else{_0x401a09=0xce;}_0x4302fc[_0x0ec9('0x20')](_0x401a09);return _0x4302fc['set'](_0x0ec9('0x27'),_0x1acd72+'-'+_0xfad2bc+'/'+_0x560142)[_0x0ec9('0x22')](_0x37e8d1);}return null;};}function patchUpdates(_0x5eb8f8){return function(_0x4a47eb){try{jsonpatch[_0x0ec9('0x28')](_0x4a47eb,_0x5eb8f8,!![]);}catch(_0x5962bd){return BPromise[_0x0ec9('0x29')](_0x5962bd);}return _0x4a47eb[_0x0ec9('0x2a')]();};}function saveUpdates(_0x3e5bb3,_0x50c8d1){return function(_0x9e71ef){if(_0x9e71ef){return _0x9e71ef[_0x0ec9('0x2b')](_0x3e5bb3)['then'](function(_0x55752a){return _0x55752a;});}return null;};}function removeEntity(_0x325748,_0x50fb2c){return function(_0x4f738a){if(_0x4f738a){return _0x4f738a['destroy']()[_0x0ec9('0x2c')](function(){var _0xbc4169=_0x4f738a[_0x0ec9('0x2d')]({'plain':!![]});var _0x291b7b=_0x0ec9('0x2e');return db[_0x0ec9('0x2f')]['destroy']({'where':{'type':_0x291b7b,'resourceId':_0xbc4169['id']}})[_0x0ec9('0x2c')](function(){return _0x4f738a;});})[_0x0ec9('0x2c')](function(){_0x325748['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b817a,_0x276821){return function(_0x2697cf){if(!_0x2697cf){_0x1b817a[_0x0ec9('0x30')](0x194);}return _0x2697cf;};}function handleError(_0x4f8c99,_0x561679){_0x561679=_0x561679||0x1f4;return function(_0x1b7863){logger[_0x0ec9('0x31')](_0x1b7863[_0x0ec9('0x32')]);if(_0x1b7863[_0x0ec9('0x33')]){delete _0x1b7863[_0x0ec9('0x33')];}_0x4f8c99[_0x0ec9('0x20')](_0x561679)[_0x0ec9('0x34')](_0x1b7863);};}exports['index']=function(_0x1634df,_0x5e33ae){var _0x5a0ef4={},_0x1c142b={},_0x1ed10c={'count':0x0,'rows':[]};var _0xc6855a=_[_0x0ec9('0x35')](db[_0x0ec9('0x36')]['rawAttributes'],function(_0x4ac76c){return{'name':_0x4ac76c[_0x0ec9('0x37')],'type':_0x4ac76c[_0x0ec9('0x38')]['key']};});_0x1c142b[_0x0ec9('0x39')]=_[_0x0ec9('0x35')](_0xc6855a,_0x0ec9('0x33'));_0x1c142b[_0x0ec9('0x3a')]=_[_0x0ec9('0x3b')](_0x1634df[_0x0ec9('0x3a')]);_0x1c142b['filters']=_[_0x0ec9('0x3c')](_0x1c142b[_0x0ec9('0x39')],_0x1c142b['query']);_0x5a0ef4[_0x0ec9('0x3d')]=_[_0x0ec9('0x3c')](_0x1c142b[_0x0ec9('0x39')],qs[_0x0ec9('0x3e')](_0x1634df[_0x0ec9('0x3a')]['fields']));_0x5a0ef4[_0x0ec9('0x3d')]=_0x5a0ef4[_0x0ec9('0x3d')][_0x0ec9('0x3f')]?_0x5a0ef4[_0x0ec9('0x3d')]:_0x1c142b[_0x0ec9('0x39')];if(!_0x1634df['query'][_0x0ec9('0x40')](_0x0ec9('0x41'))){_0x5a0ef4[_0x0ec9('0x25')]=qs['limit'](_0x1634df[_0x0ec9('0x3a')]['limit']);_0x5a0ef4[_0x0ec9('0x23')]=qs[_0x0ec9('0x23')](_0x1634df[_0x0ec9('0x3a')][_0x0ec9('0x23')]);}_0x5a0ef4[_0x0ec9('0x42')]=qs[_0x0ec9('0x43')](_0x1634df['query']['sort']);_0x5a0ef4[_0x0ec9('0x44')]=qs['filters'](_[_0x0ec9('0x45')](_0x1634df[_0x0ec9('0x3a')],_0x1c142b[_0x0ec9('0x46')]),_0xc6855a);if(_0x1634df['query']['filter']){_0x5a0ef4['where']=_[_0x0ec9('0x47')](_0x5a0ef4[_0x0ec9('0x44')],{'$or':_[_0x0ec9('0x35')](_0xc6855a,function(_0x1469da){if(_0x1469da[_0x0ec9('0x38')]!==_0x0ec9('0x48')){var _0x2c4e9e={};_0x2c4e9e[_0x1469da[_0x0ec9('0x33')]]={'$like':'%'+_0x1634df[_0x0ec9('0x3a')]['filter']+'%'};return _0x2c4e9e;}})});}_0x5a0ef4=_['merge']({},_0x5a0ef4,_0x1634df[_0x0ec9('0x49')]);var _0x3c6042={'where':_0x5a0ef4[_0x0ec9('0x44')]};return db['CmList'][_0x0ec9('0x26')](_0x3c6042)['then'](function(_0x41a2c6){_0x1ed10c[_0x0ec9('0x26')]=_0x41a2c6;if(_0x1634df[_0x0ec9('0x3a')][_0x0ec9('0x4a')]){_0x5a0ef4['include']=[{'all':!![]}];}return db[_0x0ec9('0x36')][_0x0ec9('0x4b')](_0x5a0ef4);})[_0x0ec9('0x2c')](function(_0x5e0071){_0x1ed10c[_0x0ec9('0x4c')]=_0x5e0071;return _0x1ed10c;})['then'](respondWithFilteredResult(_0x5e33ae,_0x5a0ef4))['catch'](handleError(_0x5e33ae,null));};exports[_0x0ec9('0x4d')]=function(_0x438d24,_0x12ba38){var _0x4abe1f={'raw':![],'where':{'id':_0x438d24['params']['id']}},_0xe583d6={};_0xe583d6[_0x0ec9('0x39')]=_['keys'](db[_0x0ec9('0x36')][_0x0ec9('0x4e')]);_0xe583d6[_0x0ec9('0x3a')]=_[_0x0ec9('0x3b')](_0x438d24[_0x0ec9('0x3a')]);_0xe583d6[_0x0ec9('0x46')]=_['intersection'](_0xe583d6[_0x0ec9('0x39')],_0xe583d6[_0x0ec9('0x3a')]);_0x4abe1f[_0x0ec9('0x3d')]=_[_0x0ec9('0x3c')](_0xe583d6[_0x0ec9('0x39')],qs[_0x0ec9('0x3e')](_0x438d24[_0x0ec9('0x3a')]['fields']));_0x4abe1f[_0x0ec9('0x3d')]=_0x4abe1f['attributes'][_0x0ec9('0x3f')]?_0x4abe1f[_0x0ec9('0x3d')]:_0xe583d6[_0x0ec9('0x39')];if(_0x438d24[_0x0ec9('0x3a')][_0x0ec9('0x4a')]){_0x4abe1f['include']=[{'all':!![]}];}_0x4abe1f=_['merge']({},_0x4abe1f,_0x438d24[_0x0ec9('0x49')]);return db[_0x0ec9('0x36')][_0x0ec9('0x4f')](_0x4abe1f)[_0x0ec9('0x2c')](handleEntityNotFound(_0x12ba38,null))[_0x0ec9('0x2c')](respondWithResult(_0x12ba38,null))[_0x0ec9('0x50')](handleError(_0x12ba38,null));};exports[_0x0ec9('0x51')]=function(_0x53ba30,_0x55b593){return db[_0x0ec9('0x36')][_0x0ec9('0x51')](_0x53ba30[_0x0ec9('0x52')],{})[_0x0ec9('0x2c')](function(_0x1577bc){var _0x5273eb=_0x53ba30[_0x0ec9('0x53')][_0x0ec9('0x2d')]({'plain':!![]});if(!_0x5273eb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5273eb[_0x0ec9('0x54')]===_0x0ec9('0x53')){var _0x4ec613=_0x1577bc[_0x0ec9('0x2d')]({'plain':!![]});var _0xcb5f4c=_0x0ec9('0x2e');return db['UserProfileSection'][_0x0ec9('0x4f')]({'where':{'name':_0xcb5f4c,'userProfileId':_0x5273eb[_0x0ec9('0x55')]},'raw':!![]})[_0x0ec9('0x2c')](function(_0x4b67a5){if(_0x4b67a5&&_0x4b67a5[_0x0ec9('0x56')]===0x0){return db[_0x0ec9('0x2f')][_0x0ec9('0x51')]({'name':_0x4ec613[_0x0ec9('0x33')],'resourceId':_0x4ec613['id'],'type':_0x4b67a5[_0x0ec9('0x33')],'sectionId':_0x4b67a5['id']},{})[_0x0ec9('0x2c')](function(){return _0x1577bc;});}else{return _0x1577bc;}})[_0x0ec9('0x50')](function(_0x29a2d5){logger[_0x0ec9('0x31')](_0x0ec9('0x57'),_0x29a2d5);throw _0x29a2d5;});}return _0x1577bc;})[_0x0ec9('0x2c')](respondWithResult(_0x55b593,0xc9))[_0x0ec9('0x50')](handleError(_0x55b593,null));};exports[_0x0ec9('0x2b')]=function(_0x544654,_0x2a135e){if(_0x544654[_0x0ec9('0x52')]['id']){delete _0x544654['body']['id'];}return db['CmList'][_0x0ec9('0x4f')]({'where':{'id':_0x544654['params']['id']}})[_0x0ec9('0x2c')](handleEntityNotFound(_0x2a135e,null))[_0x0ec9('0x2c')](saveUpdates(_0x544654['body'],null))['then'](respondWithResult(_0x2a135e,null))[_0x0ec9('0x50')](handleError(_0x2a135e,null));};exports[_0x0ec9('0x58')]=function(_0x2eb990,_0x3cabc0){return db[_0x0ec9('0x36')][_0x0ec9('0x4f')]({'where':{'id':_0x2eb990[_0x0ec9('0x59')]['id']}})[_0x0ec9('0x2c')](handleEntityNotFound(_0x3cabc0,null))[_0x0ec9('0x2c')](removeEntity(_0x3cabc0,null))['catch'](handleError(_0x3cabc0,null));};exports[_0x0ec9('0x5a')]=function(_0x145478,_0x2114c3){return db['CmList']['describe']()[_0x0ec9('0x2c')](respondWithResult(_0x2114c3,null))[_0x0ec9('0x50')](handleError(_0x2114c3,null));};exports[_0x0ec9('0x5b')]=function(_0x3d37af,_0x45cfd7,_0x2e08e3){if(_0x3d37af[_0x0ec9('0x52')]['id']){delete _0x3d37af['body']['id'];}return db['CmList']['find']({'where':{'id':_0x3d37af['params']['id']}})[_0x0ec9('0x2c')](handleEntityNotFound(_0x45cfd7,null))[_0x0ec9('0x2c')](function(_0x564ace){if(_0x564ace){_0x3d37af['body'][_0x0ec9('0x5c')]=_0x564ace['id'];return db[_0x0ec9('0x5d')]['create'](_0x3d37af[_0x0ec9('0x52')]);}})['then'](respondWithResult(_0x45cfd7,null))[_0x0ec9('0x50')](handleError(_0x45cfd7,null));};exports[_0x0ec9('0x5e')]=function(_0x45269e,_0xaeb0b5,_0x244b9c){var _0x4740a9={'raw':![],'where':{}};var _0x56b3d8={};var _0x86f15b={'count':0x0,'rows':[]};return db[_0x0ec9('0x36')][_0x0ec9('0x5f')]({'where':{'id':_0x45269e['params']['id']}})[_0x0ec9('0x2c')](handleEntityNotFound(_0xaeb0b5,null))[_0x0ec9('0x2c')](function(_0x33a721){if(_0x33a721){_0x56b3d8[_0x0ec9('0x39')]=_[_0x0ec9('0x3b')](db['Disposition']['rawAttributes']);_0x56b3d8[_0x0ec9('0x3a')]=_[_0x0ec9('0x3b')](_0x45269e[_0x0ec9('0x3a')]);_0x56b3d8[_0x0ec9('0x46')]=_[_0x0ec9('0x3c')](_0x56b3d8[_0x0ec9('0x39')],_0x56b3d8['query']);_0x4740a9['attributes']=_[_0x0ec9('0x3c')](_0x56b3d8['model'],qs['fields'](_0x45269e[_0x0ec9('0x3a')][_0x0ec9('0x3e')]));_0x4740a9['attributes']=_0x4740a9['attributes'][_0x0ec9('0x3f')]?_0x4740a9[_0x0ec9('0x3d')]:_0x56b3d8[_0x0ec9('0x39')];if(!_0x45269e['query']['hasOwnProperty'](_0x0ec9('0x41'))){_0x4740a9[_0x0ec9('0x25')]=qs[_0x0ec9('0x25')](_0x45269e[_0x0ec9('0x3a')][_0x0ec9('0x25')]);_0x4740a9['offset']=qs['offset'](_0x45269e[_0x0ec9('0x3a')][_0x0ec9('0x23')]);}_0x4740a9[_0x0ec9('0x42')]=qs['sort'](_0x45269e['query']['sort']);_0x4740a9[_0x0ec9('0x44')]=qs[_0x0ec9('0x46')](_[_0x0ec9('0x45')](_0x45269e[_0x0ec9('0x3a')],_0x56b3d8['filters']));_0x4740a9['where'][_0x0ec9('0x5c')]=_0x33a721['id'];if(_0x45269e[_0x0ec9('0x3a')]['filter']){_0x4740a9[_0x0ec9('0x44')]=_[_0x0ec9('0x47')](_0x4740a9[_0x0ec9('0x44')],{'$or':_['map'](_0x4740a9[_0x0ec9('0x3d')],function(_0x3a793c){var _0xda9d75={};_0xda9d75[_0x3a793c]={'$like':'%'+_0x45269e['query'][_0x0ec9('0x60')]+'%'};return _0xda9d75;})});}_0x4740a9=_[_0x0ec9('0x47')]({},_0x4740a9,_0x45269e[_0x0ec9('0x49')]);return db['Disposition'][_0x0ec9('0x26')]({'where':_0x4740a9[_0x0ec9('0x44')]})[_0x0ec9('0x2c')](function(_0x13c9e1){_0x86f15b[_0x0ec9('0x26')]=_0x13c9e1;if(_0x45269e[_0x0ec9('0x3a')][_0x0ec9('0x4a')]){_0x4740a9[_0x0ec9('0x61')]=[{'all':!![]}];}return db['Disposition'][_0x0ec9('0x4b')](_0x4740a9);})[_0x0ec9('0x2c')](function(_0x3bd37d){_0x86f15b[_0x0ec9('0x4c')]=_0x3bd37d;return _0x86f15b;});}})['then'](respondWithFilteredResult(_0xaeb0b5,_0x4740a9))[_0x0ec9('0x50')](handleError(_0xaeb0b5,null));};exports[_0x0ec9('0x62')]=function(_0x2dc860,_0x57f2a3,_0x31de73){return db[_0x0ec9('0x36')][_0x0ec9('0x4f')]({'where':{'id':_0x2dc860['params']['id']}})[_0x0ec9('0x2c')](handleEntityNotFound(_0x57f2a3,null))['then'](function(_0xaa092d){if(_0xaa092d){return _0xaa092d[_0x0ec9('0x62')](_0x2dc860[_0x0ec9('0x3a')][_0x0ec9('0x63')]);}})[_0x0ec9('0x2c')](respondWithStatusCode(_0x57f2a3,null))[_0x0ec9('0x50')](handleError(_0x57f2a3,null));};exports[_0x0ec9('0x64')]=function(_0x5bc28b,_0x4ef3eb,_0x387869){return db[_0x0ec9('0x36')][_0x0ec9('0x4f')]({'where':{'id':_0x5bc28b[_0x0ec9('0x59')]['id']}})[_0x0ec9('0x2c')](handleEntityNotFound(_0x4ef3eb,null))[_0x0ec9('0x2c')](function(_0x315230){if(_0x315230){var _0x4f45ab=[];var _0x4d22c8={'success':[],'errors':[]};return db[_0x0ec9('0x65')][_0x0ec9('0x5a')]()[_0x0ec9('0x2c')](function(_0x45e0cf){if(_0x5bc28b[_0x0ec9('0x52')][_0x0ec9('0x66')]&&_[_0x0ec9('0x67')](_0x5bc28b[_0x0ec9('0x52')][_0x0ec9('0x66')])){if(_0x5bc28b['body'][_0x0ec9('0x66')][_0x0ec9('0x3f')]){_0x5bc28b[_0x0ec9('0x52')]['tags']=_0x5bc28b['body'][_0x0ec9('0x66')]['join'](';')+';';}else{_0x5bc28b[_0x0ec9('0x52')][_0x0ec9('0x66')]=null;}}else{_0x5bc28b[_0x0ec9('0x52')]['tags']=null;}if(_0x5bc28b[_0x0ec9('0x52')]&&_['isArray'](_0x5bc28b[_0x0ec9('0x52')])){for(var _0x4ce24c=0x0;_0x4ce24c<_0x5bc28b[_0x0ec9('0x52')][_0x0ec9('0x3f')];_0x4ce24c+=0x1){_0x5bc28b[_0x0ec9('0x52')][_0x4ce24c][_0x0ec9('0x5c')]=_0x5bc28b[_0x0ec9('0x59')]['id'];_0x4f45ab[_0x0ec9('0x68')](_0x5bc28b[_0x0ec9('0x52')][_0x4ce24c]);}return BPromise[_0x0ec9('0x69')](_0x4f45ab,function(_0x131fd4){return db[_0x0ec9('0x65')][_0x0ec9('0x51')](_[_0x0ec9('0x6a')](_0x131fd4,[_0x0ec9('0x63'),'id'])||{},{'fields':_[_0x0ec9('0x3b')](_0x45e0cf),'raw':!![]})['then'](function(_0x2bc9e6){_0x4d22c8[_0x0ec9('0x6b')]['push'](_0x2bc9e6[_0x0ec9('0x6c')]);})[_0x0ec9('0x50')](function(_0x129832){_0x4d22c8[_0x0ec9('0x6d')]['push']({'data':_0x131fd4,'error':_0x129832[_0x0ec9('0x6e')]});});})['then'](function(_0x4e3d26){return _0x4d22c8;})[_0x0ec9('0x50')](function(_0x1d1560){return _0x1d1560;});}else{_0x4ef3eb[_0x0ec9('0x20')](0x190)[_0x0ec9('0x22')]({'message':'Malformed\x20request\x20syntax'});}});}})['then'](respondWithResult(_0x4ef3eb,null))[_0x0ec9('0x50')](handleError(_0x4ef3eb,null));};exports['getContacts']=function(_0x407e2c,_0x4bd1b3,_0x19e6d5){var _0xc845a3;return db['CmList'][_0x0ec9('0x4f')]({'where':{'id':_0x407e2c[_0x0ec9('0x59')]['id']},'include':[{'model':db[_0x0ec9('0x6f')],'as':'CustomFields'}]})[_0x0ec9('0x2c')](handleEntityNotFound(_0x4bd1b3,null))['then'](function(_0x2cd2cc){if(_0x2cd2cc){_0xc845a3=_0x2cd2cc;return db[_0x0ec9('0x65')][_0x0ec9('0x4e')];}})[_0x0ec9('0x2c')](function(_0x4f5614){if(_0x4f5614){var _0x491bf7={};var _0x19ec84={};_0x19ec84[_0x0ec9('0x39')]=_['concat'](_[_0x0ec9('0x3b')](_0x4f5614),_[_0x0ec9('0x35')](_0xc845a3['CustomFields'],function(_0x24a492){return util[_0x0ec9('0x70')](_0x0ec9('0x71'),_0x24a492['id']);}));_0x19ec84['query']=_[_0x0ec9('0x3b')](_0x407e2c[_0x0ec9('0x3a')]);_0x19ec84[_0x0ec9('0x46')]=_[_0x0ec9('0x3c')](_0x19ec84[_0x0ec9('0x39')],_0x19ec84[_0x0ec9('0x3a')]);_0x491bf7[_0x0ec9('0x3d')]=_[_0x0ec9('0x3c')](_0x19ec84[_0x0ec9('0x39')],qs[_0x0ec9('0x3e')](_0x407e2c[_0x0ec9('0x3a')][_0x0ec9('0x3e')]));_0x491bf7['attributes']=_0x491bf7['attributes']['length']?_0x491bf7['attributes']:_0x19ec84[_0x0ec9('0x39')];if(!_0x407e2c[_0x0ec9('0x3a')]['hasOwnProperty']('nolimit')){_0x491bf7[_0x0ec9('0x25')]=qs[_0x0ec9('0x25')](_0x407e2c['query'][_0x0ec9('0x25')]);_0x491bf7[_0x0ec9('0x23')]=qs[_0x0ec9('0x23')](_0x407e2c[_0x0ec9('0x3a')]['offset']);}_0x491bf7[_0x0ec9('0x42')]=qs[_0x0ec9('0x43')](_0x407e2c['query']['sort']);_0x491bf7[_0x0ec9('0x44')]=qs[_0x0ec9('0x46')](_[_0x0ec9('0x45')](_0x407e2c['query'],_0x19ec84[_0x0ec9('0x46')]));_0x491bf7['raw']=!![];if(_0x407e2c['query'][_0x0ec9('0x60')]){_0x491bf7[_0x0ec9('0x44')]=_[_0x0ec9('0x47')](_0x491bf7[_0x0ec9('0x44')],{'$or':_['map'](_0x491bf7[_0x0ec9('0x3d')],function(_0x429eb5){var _0x40bb4f={};_0x40bb4f[_0x429eb5]={'$like':'%'+_0x407e2c['query']['filter']+'%'};return _0x40bb4f;})});}_0x491bf7=_[_0x0ec9('0x47')]({},_0x491bf7,_0x407e2c['options']);return _0xc845a3[_0x0ec9('0x72')](_0x491bf7);}})[_0x0ec9('0x2c')](respondWithResult(_0x4bd1b3,null))[_0x0ec9('0x50')](handleError(_0x4bd1b3,null));};exports[_0x0ec9('0x73')]=function(_0x159067,_0x12ff2d,_0x4976d8){var _0x14711c;var _0x13e66f;var _0x36eb8c;var _0x40e7fd=_0x159067['params']['id'];csv_results=[];return db[_0x0ec9('0x74')][_0x0ec9('0x4b')]({'attributes':['id',_0x0ec9('0x33')],'raw':!![],'order':[_0x0ec9('0x75')]})['then'](function(_0x13d41d){_0x14711c=_0x13d41d;var _0x3b1837=_[_0x0ec9('0x3b')](db[_0x0ec9('0x65')][_0x0ec9('0x4e')]);return db[_0x0ec9('0x6f')][_0x0ec9('0x4b')]({'raw':!![],'attributes':['id','alias']})[_0x0ec9('0x2c')](function(_0x4486cb){_0x13e66f=_0x4486cb;var _0x5c5f7f=squel[_0x0ec9('0x76')]()[_0x0ec9('0x3e')](_0x3b1837)[_0x0ec9('0x77')](_0x0ec9('0x78'),'c')['where']('c.ListId\x20=\x20?',_0x40e7fd)[_0x0ec9('0x44')]('c.deletedAt\x20is\x20null')[_0x0ec9('0x79')]();for(var _0x132d1f=0x0;_0x132d1f<_0x13e66f[_0x0ec9('0x3f')];_0x132d1f++){_0x5c5f7f[_0x0ec9('0x7a')]('c.cf_'+_0x13e66f[_0x132d1f]['id'],_0x0ec9('0x7b')+_0x13e66f[_0x132d1f][_0x0ec9('0x7c')]);}for(var _0x132d1f=0x0;_0x132d1f<_0x14711c[_0x0ec9('0x3f')];_0x132d1f++){_0x5c5f7f[_0x0ec9('0x7a')](squel[_0x0ec9('0x76')]()[_0x0ec9('0x7a')](_0x0ec9('0x7d'))[_0x0ec9('0x77')](_0x0ec9('0x7e'))[_0x0ec9('0x44')](_0x0ec9('0x7f'),_0x14711c[_0x132d1f]['id'])['where'](_0x0ec9('0x80')),_0x0ec9('0x81')+_0x14711c[_0x132d1f][_0x0ec9('0x33')]);_0x5c5f7f[_0x0ec9('0x7a')](squel[_0x0ec9('0x76')]()[_0x0ec9('0x7a')](_0x0ec9('0x82'))[_0x0ec9('0x77')](_0x0ec9('0x7e'))[_0x0ec9('0x44')](_0x0ec9('0x7f'),_0x14711c[_0x132d1f]['id'])[_0x0ec9('0x44')](_0x0ec9('0x80')),'description_additionalPhone_'+_0x14711c[_0x132d1f][_0x0ec9('0x33')]);}var _0x4f6559=[];_0x4f6559[_0x0ec9('0x68')](_0x5c5f7f[_0x0ec9('0x83')]());BPromise[_0x0ec9('0x69')](_0x4f6559,handleQuery)[_0x0ec9('0x2c')](function(_0x459698){handleQuery(_0x5c5f7f[_0x0ec9('0x83')]());var _0x3622a7=csv_results[0x0];if(!_[_0x0ec9('0x84')](_0x3622a7)){var _0x51ec4b=toCsv(_0x3622a7);var _0x2d80f5=Date[_0x0ec9('0x85')]();fs['writeFileSync'](util[_0x0ec9('0x70')](_0x0ec9('0x86'),_0x40e7fd,_0x2d80f5),_0x51ec4b);_0x12ff2d[_0x0ec9('0x87')]('Content-disposition',_0x0ec9('0x88')+util[_0x0ec9('0x70')](_0x0ec9('0x89'),_0x40e7fd,_0x2d80f5));_0x12ff2d[_0x0ec9('0x87')](_0x0ec9('0x8a'),'text/csv');return _0x12ff2d[_0x0ec9('0x8b')](util[_0x0ec9('0x70')]('/tmp/list_%d_%s.csv',_0x40e7fd,_0x2d80f5));}else{return _0x12ff2d[_0x0ec9('0x30')](0xcc);}});});});};exports[_0x0ec9('0x8c')]=function(_0x11b747,_0x1ff8ce,_0xec984e){var _0x410a71;delete _0x11b747['body']['id'];return db[_0x0ec9('0x36')][_0x0ec9('0x5f')]({'where':{'id':_0x11b747[_0x0ec9('0x59')]['id']}})['then'](handleEntityNotFound(_0x1ff8ce,null))[_0x0ec9('0x2c')](function(_0x3c0701){if(_0x3c0701){return db[_0x0ec9('0x8d')][_0x0ec9('0x8e')](function(_0x597f46){return db[_0x0ec9('0x6f')][_0x0ec9('0x51')](_0x11b747[_0x0ec9('0x52')],{'transaction':_0x597f46})[_0x0ec9('0x2c')](function(_0x574039){_0x410a71=_0x574039;return _0x3c0701[_0x0ec9('0x8f')](_0x574039,{'transaction':_0x597f46});})[_0x0ec9('0x2c')](function(){var _0x547ec4={'type':db[_0x0ec9('0x90')]['TEXT'],'transaction':_0x597f46};switch(_0x11b747[_0x0ec9('0x52')]['type']){case _0x0ec9('0x91'):_0x547ec4[_0x0ec9('0x38')]=db[_0x0ec9('0x90')]['TEXT'];break;case _0x0ec9('0x92'):_0x547ec4[_0x0ec9('0x38')]=db['Sequelize'][_0x0ec9('0x93')];break;case _0x0ec9('0x94'):_0x547ec4['type']=db[_0x0ec9('0x90')][_0x0ec9('0x95')];_0x547ec4['defaultValue']=![];break;default:}return db[_0x0ec9('0x8d')][_0x0ec9('0x96')][_0x0ec9('0x97')](_0x0ec9('0x78'),util[_0x0ec9('0x70')]('cf_%s',_0x410a71['id']),_0x547ec4);})[_0x0ec9('0x2c')](function(){return _0x410a71;});});}})[_0x0ec9('0x2c')](respondWithResult(_0x1ff8ce,null))[_0x0ec9('0x50')](handleError(_0x1ff8ce,null));};exports[_0x0ec9('0x98')]=function(_0x4db8d6,_0x4093f6,_0x8ca12e){var _0x221885={};var _0x3d7162={};var _0x2850c8;var _0x469fbe;return db[_0x0ec9('0x36')]['findOne']({'where':{'id':_0x4db8d6['params']['id']}})[_0x0ec9('0x2c')](handleEntityNotFound(_0x4093f6,null))[_0x0ec9('0x2c')](function(_0x2ddd8e){if(_0x2ddd8e){_0x2850c8=_0x2ddd8e;_0x3d7162['model']=_[_0x0ec9('0x3b')](db[_0x0ec9('0x6f')]['rawAttributes']);_0x3d7162[_0x0ec9('0x3a')]=_[_0x0ec9('0x3b')](_0x4db8d6['query']);_0x3d7162[_0x0ec9('0x46')]=_['intersection'](_0x3d7162[_0x0ec9('0x39')],_0x3d7162[_0x0ec9('0x3a')]);_0x221885['attributes']=_['intersection'](_0x3d7162['model'],qs[_0x0ec9('0x3e')](_0x4db8d6[_0x0ec9('0x3a')]['fields']));_0x221885['attributes']=_0x221885[_0x0ec9('0x3d')][_0x0ec9('0x3f')]?_0x221885[_0x0ec9('0x3d')]:_0x3d7162[_0x0ec9('0x39')];_0x221885[_0x0ec9('0x42')]=qs[_0x0ec9('0x43')](_0x4db8d6['query'][_0x0ec9('0x43')]);_0x221885[_0x0ec9('0x44')]=qs[_0x0ec9('0x46')](_[_0x0ec9('0x45')](_0x4db8d6[_0x0ec9('0x3a')],_0x3d7162['filters']));_0x221885['where']=_['merge'](_0x221885[_0x0ec9('0x44')],{'$or':[{'ListId':_0x2ddd8e['id']},{'ListId':null}]});if(_0x4db8d6[_0x0ec9('0x3a')][_0x0ec9('0x60')]){_0x221885[_0x0ec9('0x44')]=_[_0x0ec9('0x47')](_0x221885['where'],{'$or':_[_0x0ec9('0x35')](_0x221885[_0x0ec9('0x3d')],function(_0x1bf8b3){var _0x506a76={};_0x506a76[_0x1bf8b3]={'$like':'%'+_0x4db8d6[_0x0ec9('0x3a')][_0x0ec9('0x60')]+'%'};return _0x506a76;})});}_0x221885=_['merge']({},_0x221885,_0x4db8d6[_0x0ec9('0x49')]);return db[_0x0ec9('0x6f')][_0x0ec9('0x99')](_0x221885);}})['then'](respondWithResult(_0x4093f6,null))[_0x0ec9('0x50')](handleError(_0x4093f6,null));};exports['getGlobalCustomFields']=function(_0x1e3c9c,_0x205f14){return db[_0x0ec9('0x6f')]['findAndCountAll']({'where':{'ListId':null}})[_0x0ec9('0x2c')](handleEntityNotFound(_0x205f14,null))[_0x0ec9('0x2c')](function(_0x4febc0){return _0x4febc0;})['then'](respondWithResult(_0x205f14,null))[_0x0ec9('0x50')](handleError(_0x205f14,null));};exports['addAgents']=function(_0x58707f,_0x1a7e38,_0x2ce25b){return db[_0x0ec9('0x36')]['find']({'where':{'id':_0x58707f[_0x0ec9('0x59')]['id']}})[_0x0ec9('0x2c')](handleEntityNotFound(_0x1a7e38,null))[_0x0ec9('0x2c')](function(_0x541b9f){if(_0x541b9f){return _0x541b9f[_0x0ec9('0x9a')](_0x58707f[_0x0ec9('0x52')][_0x0ec9('0x63')],_[_0x0ec9('0x6a')](_0x58707f[_0x0ec9('0x52')],[_0x0ec9('0x63'),'id'])||{})[_0x0ec9('0x9b')](function(_0x480423){for(var _0x42828d=0x0;_0x42828d<_0x58707f[_0x0ec9('0x52')][_0x0ec9('0x63')][_0x0ec9('0x3f')];_0x42828d+=0x1){socket[_0x0ec9('0x9c')](_0x0ec9('0x9d'),{'UserId':Number(_0x58707f['body']['ids'][_0x42828d]),'CmListId':Number(_0x58707f['params']['id'])});}return _0x480423;});}})[_0x0ec9('0x2c')](respondWithResult(_0x1a7e38,null))['catch'](handleError(_0x1a7e38,null));};exports[_0x0ec9('0x9e')]=function(_0x3e3598,_0x39af43,_0x3c0d69){return db['CmList']['find']({'where':{'id':_0x3e3598[_0x0ec9('0x59')]['id']}})[_0x0ec9('0x2c')](handleEntityNotFound(_0x39af43,null))[_0x0ec9('0x2c')](function(_0x490c85){if(_0x490c85){return _0x490c85[_0x0ec9('0x9e')](_0x3e3598['query'][_0x0ec9('0x63')])[_0x0ec9('0x2c')](function(){if(_[_0x0ec9('0x67')](_0x3e3598[_0x0ec9('0x3a')][_0x0ec9('0x63')])){for(var _0x568e45=0x0;_0x568e45<_0x3e3598['query'][_0x0ec9('0x63')][_0x0ec9('0x3f')];_0x568e45+=0x1){socket['emit'](_0x0ec9('0x9f'),{'UserId':Number(_0x3e3598[_0x0ec9('0x3a')][_0x0ec9('0x63')][_0x568e45]),'CmListId':Number(_0x3e3598[_0x0ec9('0x59')]['id'])});}}else{socket[_0x0ec9('0x9c')]('userCmList:remove',{'UserId':Number(_0x3e3598[_0x0ec9('0x3a')][_0x0ec9('0x63')]),'CmListId':Number(_0x3e3598[_0x0ec9('0x59')]['id'])});}});}})[_0x0ec9('0x2c')](respondWithStatusCode(_0x39af43,null))['catch'](handleError(_0x39af43,null));};exports[_0x0ec9('0xa0')]=function(_0x4aac8d,_0x286ba3,_0x893c79){var _0x4316f8={};var _0x90bbe0={};var _0x36fbba;var _0x1b7f27;return db[_0x0ec9('0x36')]['findOne']({'where':{'id':_0x4aac8d[_0x0ec9('0x59')]['id']}})[_0x0ec9('0x2c')](handleEntityNotFound(_0x286ba3,null))[_0x0ec9('0x2c')](function(_0x510d82){if(_0x510d82){_0x36fbba=_0x510d82;_0x90bbe0[_0x0ec9('0x39')]=_[_0x0ec9('0x3b')](db['User'][_0x0ec9('0x4e')]);_0x90bbe0[_0x0ec9('0x3a')]=_[_0x0ec9('0x3b')](_0x4aac8d[_0x0ec9('0x3a')]);_0x90bbe0[_0x0ec9('0x46')]=_[_0x0ec9('0x3c')](_0x90bbe0[_0x0ec9('0x39')],_0x90bbe0[_0x0ec9('0x3a')]);_0x4316f8[_0x0ec9('0x3d')]=_['intersection'](_0x90bbe0['model'],qs[_0x0ec9('0x3e')](_0x4aac8d[_0x0ec9('0x3a')]['fields']));_0x4316f8[_0x0ec9('0x3d')]=_0x4316f8[_0x0ec9('0x3d')][_0x0ec9('0x3f')]?_0x4316f8[_0x0ec9('0x3d')]:_0x90bbe0[_0x0ec9('0x39')];_0x4316f8[_0x0ec9('0x42')]=qs[_0x0ec9('0x43')](_0x4aac8d['query'][_0x0ec9('0x43')]);_0x4316f8[_0x0ec9('0x44')]=qs[_0x0ec9('0x46')](_[_0x0ec9('0x45')](_0x4aac8d[_0x0ec9('0x3a')],_0x90bbe0['filters']));if(_0x4aac8d[_0x0ec9('0x3a')]['filter']){_0x4316f8[_0x0ec9('0x44')]=_[_0x0ec9('0x47')](_0x4316f8[_0x0ec9('0x44')],{'$or':_[_0x0ec9('0x35')](_0x4316f8[_0x0ec9('0x3d')],function(_0x1630a5){var _0x3674cd={};_0x3674cd[_0x1630a5]={'$like':'%'+_0x4aac8d[_0x0ec9('0x3a')][_0x0ec9('0x60')]+'%'};return _0x3674cd;})});}_0x4316f8=_[_0x0ec9('0x47')]({},_0x4316f8,_0x4aac8d[_0x0ec9('0x49')]);return _0x36fbba[_0x0ec9('0xa0')](_0x4316f8);}})[_0x0ec9('0x2c')](function(_0x39aeb9){if(_0x39aeb9){_0x1b7f27=_0x39aeb9[_0x0ec9('0x3f')];if(!_0x4aac8d[_0x0ec9('0x3a')]['hasOwnProperty'](_0x0ec9('0x41'))){_0x4316f8['limit']=qs[_0x0ec9('0x25')](_0x4aac8d[_0x0ec9('0x3a')][_0x0ec9('0x25')]);_0x4316f8[_0x0ec9('0x23')]=qs[_0x0ec9('0x23')](_0x4aac8d[_0x0ec9('0x3a')][_0x0ec9('0x23')]);}return _0x36fbba['getAgents'](_0x4316f8);}})[_0x0ec9('0x2c')](function(_0xa49c58){if(_0xa49c58){return _0xa49c58?{'count':_0x1b7f27,'rows':_0xa49c58}:null;}})[_0x0ec9('0x2c')](respondWithResult(_0x286ba3,null))[_0x0ec9('0x50')](handleError(_0x286ba3,null));};function handleQuery(_0x10ffb0){logger[_0x0ec9('0xa1')](_0x10ffb0);return db[_0x0ec9('0x8d')][_0x0ec9('0x3a')](_0x10ffb0)[_0x0ec9('0x9b')](function(_0x29acf8){csv_results[_0x0ec9('0x68')](_0x29acf8);})[_0x0ec9('0x50')](function(_0x101ccc){logger[_0x0ec9('0x31')](_0x101ccc['message']);});} \ No newline at end of file +var _0xbabd=['name','send','index','map','CmList','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','getDispositions','findOne','pick','filter','findAll','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','omit','success','dataValues','message','CmCustomField','CustomFields','concat','format','raw','getContacts','OrderBy','alias','from','cm_contacts','c.deletedAt\x20is\x20null','distinct','c.cf_','customField_','field','item','cm_contact_has_items','CmContactId\x20=\x20c.id','additionalPhone_','select','description','ItemTypeId\x20=\x20?','description_additionalPhone_','each','toString','now','/tmp/list_%d_%s.csv','Content-disposition','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','sequelize','addCustomFields','Sequelize','TEXT','text','number','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','cf_%s','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','zip-dir','fast-json-patch','request-promise','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/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','./cmList.socket','register','sendStatus','status','limit','undefined','count','offset','set','Content-Range','json','apply','reject','save','update','then','get','Lists','UserProfileResource','destroy','end','error','stack'];(function(_0x550d3b,_0x1657d2){var _0x540430=function(_0x5d705){while(--_0x5d705){_0x550d3b['push'](_0x550d3b['shift']());}};_0x540430(++_0x1657d2);}(_0xbabd,0x118));var _0xdbab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbabd[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xdbab('0x0'));var jsonpatch=require(_0xdbab('0x1'));var rp=require(_0xdbab('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdbab('0x3'));var util=require(_0xdbab('0x4'));var path=require(_0xdbab('0x5'));var sox=require(_0xdbab('0x6'));var csv=require(_0xdbab('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdbab('0x8'));var _=require(_0xdbab('0x9'));var squel=require(_0xdbab('0xa'));var crypto=require(_0xdbab('0xb'));var jsforce=require(_0xdbab('0xc'));var deskjs=require(_0xdbab('0xd'));var toCsv=require(_0xdbab('0x7'));var querystring=require(_0xdbab('0xe'));var Papa=require(_0xdbab('0xf'));var Redis=require(_0xdbab('0x10'));var authService=require(_0xdbab('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xdbab('0x12'));var hardwareService=require(_0xdbab('0x13'));var logger=require(_0xdbab('0x14'))(_0xdbab('0x15'));var utils=require(_0xdbab('0x16'));var config=require(_0xdbab('0x17'));var licenseUtil=require(_0xdbab('0x18'));var db=require(_0xdbab('0x19'))['db'];var csv_results;config[_0xdbab('0x1a')]=_['defaults'](config[_0xdbab('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xdbab('0x1b'))[_0xdbab('0x1c')](socket);function respondWithStatusCode(_0x2a9395,_0x56dc21){_0x56dc21=_0x56dc21||0xcc;return function(_0x3f2983){if(_0x3f2983){return _0x2a9395[_0xdbab('0x1d')](_0x56dc21);}return _0x2a9395[_0xdbab('0x1e')](_0x56dc21)['end']();};}function respondWithResult(_0x50f0af,_0x4377d6){_0x4377d6=_0x4377d6||0xc8;return function(_0x50171f){if(_0x50171f){return _0x50f0af[_0xdbab('0x1e')](_0x4377d6)['json'](_0x50171f);}};}function respondWithFilteredResult(_0x2fb72e,_0x574a31){return function(_0x17e139){if(_0x17e139){var _0x35bf46=typeof _0x574a31['offset']==='undefined'&&typeof _0x574a31[_0xdbab('0x1f')]===_0xdbab('0x20');var _0xe51e97=_0x17e139[_0xdbab('0x21')];var _0x1b9b18=_0x35bf46?0x0:_0x574a31['offset'];var _0x5670aa=_0x35bf46?_0x17e139[_0xdbab('0x21')]:_0x574a31[_0xdbab('0x22')]+_0x574a31[_0xdbab('0x1f')];var _0x330a70;if(_0x5670aa>=_0xe51e97){_0x5670aa=_0xe51e97;_0x330a70=0xc8;}else{_0x330a70=0xce;}_0x2fb72e['status'](_0x330a70);return _0x2fb72e[_0xdbab('0x23')](_0xdbab('0x24'),_0x1b9b18+'-'+_0x5670aa+'/'+_0xe51e97)[_0xdbab('0x25')](_0x17e139);}return null;};}function patchUpdates(_0xc964a0){return function(_0x289970){try{jsonpatch[_0xdbab('0x26')](_0x289970,_0xc964a0,!![]);}catch(_0x39a3cd){return BPromise[_0xdbab('0x27')](_0x39a3cd);}return _0x289970[_0xdbab('0x28')]();};}function saveUpdates(_0x2e7bf5,_0x513cb0){return function(_0x32e0c0){if(_0x32e0c0){return _0x32e0c0[_0xdbab('0x29')](_0x2e7bf5)[_0xdbab('0x2a')](function(_0x22f25f){return _0x22f25f;});}return null;};}function removeEntity(_0x15f017,_0x4372bb){return function(_0x4fe1ae){if(_0x4fe1ae){return _0x4fe1ae['destroy']()[_0xdbab('0x2a')](function(){var _0x2d6b11=_0x4fe1ae[_0xdbab('0x2b')]({'plain':!![]});var _0x33fa94=_0xdbab('0x2c');return db[_0xdbab('0x2d')][_0xdbab('0x2e')]({'where':{'type':_0x33fa94,'resourceId':_0x2d6b11['id']}})[_0xdbab('0x2a')](function(){return _0x4fe1ae;});})[_0xdbab('0x2a')](function(){_0x15f017[_0xdbab('0x1e')](0xcc)[_0xdbab('0x2f')]();});}};}function handleEntityNotFound(_0x59a6b9,_0xea76c7){return function(_0x5ceb72){if(!_0x5ceb72){_0x59a6b9[_0xdbab('0x1d')](0x194);}return _0x5ceb72;};}function handleError(_0xddc673,_0x273dad){_0x273dad=_0x273dad||0x1f4;return function(_0x521b95){logger[_0xdbab('0x30')](_0x521b95[_0xdbab('0x31')]);if(_0x521b95[_0xdbab('0x32')]){delete _0x521b95['name'];}_0xddc673[_0xdbab('0x1e')](_0x273dad)[_0xdbab('0x33')](_0x521b95);};}exports[_0xdbab('0x34')]=function(_0x4879b3,_0x3f3cfe){var _0x4d1765={},_0x12d05d={},_0x3f9982={'count':0x0,'rows':[]};var _0x3247d6=_[_0xdbab('0x35')](db[_0xdbab('0x36')][_0xdbab('0x37')],function(_0xa0e7a9){return{'name':_0xa0e7a9[_0xdbab('0x38')],'type':_0xa0e7a9['type'][_0xdbab('0x39')]};});_0x12d05d[_0xdbab('0x3a')]=_[_0xdbab('0x35')](_0x3247d6,_0xdbab('0x32'));_0x12d05d[_0xdbab('0x3b')]=_[_0xdbab('0x3c')](_0x4879b3[_0xdbab('0x3b')]);_0x12d05d[_0xdbab('0x3d')]=_[_0xdbab('0x3e')](_0x12d05d[_0xdbab('0x3a')],_0x12d05d[_0xdbab('0x3b')]);_0x4d1765[_0xdbab('0x3f')]=_[_0xdbab('0x3e')](_0x12d05d[_0xdbab('0x3a')],qs[_0xdbab('0x40')](_0x4879b3[_0xdbab('0x3b')][_0xdbab('0x40')]));_0x4d1765[_0xdbab('0x3f')]=_0x4d1765[_0xdbab('0x3f')][_0xdbab('0x41')]?_0x4d1765[_0xdbab('0x3f')]:_0x12d05d[_0xdbab('0x3a')];if(!_0x4879b3[_0xdbab('0x3b')][_0xdbab('0x42')](_0xdbab('0x43'))){_0x4d1765[_0xdbab('0x1f')]=qs[_0xdbab('0x1f')](_0x4879b3[_0xdbab('0x3b')]['limit']);_0x4d1765[_0xdbab('0x22')]=qs['offset'](_0x4879b3[_0xdbab('0x3b')]['offset']);}_0x4d1765[_0xdbab('0x44')]=qs['sort'](_0x4879b3['query'][_0xdbab('0x45')]);_0x4d1765[_0xdbab('0x46')]=qs['filters'](_['pick'](_0x4879b3[_0xdbab('0x3b')],_0x12d05d[_0xdbab('0x3d')]),_0x3247d6);if(_0x4879b3['query']['filter']){_0x4d1765[_0xdbab('0x46')]=_[_0xdbab('0x47')](_0x4d1765[_0xdbab('0x46')],{'$or':_['map'](_0x3247d6,function(_0x523512){if(_0x523512[_0xdbab('0x48')]!==_0xdbab('0x49')){var _0x4ffa66={};_0x4ffa66[_0x523512['name']]={'$like':'%'+_0x4879b3[_0xdbab('0x3b')]['filter']+'%'};return _0x4ffa66;}})});}_0x4d1765=_[_0xdbab('0x47')]({},_0x4d1765,_0x4879b3[_0xdbab('0x4a')]);var _0x1a5dce={'where':_0x4d1765[_0xdbab('0x46')]};return db[_0xdbab('0x36')][_0xdbab('0x21')](_0x1a5dce)[_0xdbab('0x2a')](function(_0xb615fc){_0x3f9982[_0xdbab('0x21')]=_0xb615fc;if(_0x4879b3[_0xdbab('0x3b')][_0xdbab('0x4b')]){_0x4d1765[_0xdbab('0x4c')]=[{'all':!![]}];}return db[_0xdbab('0x36')]['findAll'](_0x4d1765);})[_0xdbab('0x2a')](function(_0x2622c0){_0x3f9982[_0xdbab('0x4d')]=_0x2622c0;return _0x3f9982;})['then'](respondWithFilteredResult(_0x3f3cfe,_0x4d1765))[_0xdbab('0x4e')](handleError(_0x3f3cfe,null));};exports[_0xdbab('0x4f')]=function(_0x30c2bb,_0x5cd990){var _0x46ba24={'raw':![],'where':{'id':_0x30c2bb[_0xdbab('0x50')]['id']}},_0x5a7c9f={};_0x5a7c9f[_0xdbab('0x3a')]=_[_0xdbab('0x3c')](db[_0xdbab('0x36')][_0xdbab('0x37')]);_0x5a7c9f[_0xdbab('0x3b')]=_[_0xdbab('0x3c')](_0x30c2bb[_0xdbab('0x3b')]);_0x5a7c9f[_0xdbab('0x3d')]=_[_0xdbab('0x3e')](_0x5a7c9f['model'],_0x5a7c9f[_0xdbab('0x3b')]);_0x46ba24[_0xdbab('0x3f')]=_[_0xdbab('0x3e')](_0x5a7c9f[_0xdbab('0x3a')],qs['fields'](_0x30c2bb['query']['fields']));_0x46ba24[_0xdbab('0x3f')]=_0x46ba24[_0xdbab('0x3f')][_0xdbab('0x41')]?_0x46ba24[_0xdbab('0x3f')]:_0x5a7c9f[_0xdbab('0x3a')];if(_0x30c2bb[_0xdbab('0x3b')]['includeAll']){_0x46ba24[_0xdbab('0x4c')]=[{'all':!![]}];}_0x46ba24=_[_0xdbab('0x47')]({},_0x46ba24,_0x30c2bb[_0xdbab('0x4a')]);return db[_0xdbab('0x36')][_0xdbab('0x51')](_0x46ba24)['then'](handleEntityNotFound(_0x5cd990,null))[_0xdbab('0x2a')](respondWithResult(_0x5cd990,null))[_0xdbab('0x4e')](handleError(_0x5cd990,null));};exports[_0xdbab('0x52')]=function(_0x4c78a2,_0x3ec9f6){return db['CmList']['create'](_0x4c78a2[_0xdbab('0x53')],{})[_0xdbab('0x2a')](function(_0xd7c770){var _0x374a00=_0x4c78a2[_0xdbab('0x54')]['get']({'plain':!![]});if(!_0x374a00)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x374a00['role']===_0xdbab('0x54')){var _0x1898b5=_0xd7c770['get']({'plain':!![]});var _0x30272f=_0xdbab('0x2c');return db['UserProfileSection'][_0xdbab('0x51')]({'where':{'name':_0x30272f,'userProfileId':_0x374a00[_0xdbab('0x55')]},'raw':!![]})['then'](function(_0x2cd776){if(_0x2cd776&&_0x2cd776[_0xdbab('0x56')]===0x0){return db[_0xdbab('0x2d')][_0xdbab('0x52')]({'name':_0x1898b5[_0xdbab('0x32')],'resourceId':_0x1898b5['id'],'type':_0x2cd776[_0xdbab('0x32')],'sectionId':_0x2cd776['id']},{})[_0xdbab('0x2a')](function(){return _0xd7c770;});}else{return _0xd7c770;}})[_0xdbab('0x4e')](function(_0x5914a8){logger[_0xdbab('0x30')](_0xdbab('0x57'),_0x5914a8);throw _0x5914a8;});}return _0xd7c770;})[_0xdbab('0x2a')](respondWithResult(_0x3ec9f6,0xc9))[_0xdbab('0x4e')](handleError(_0x3ec9f6,null));};exports['update']=function(_0x396a2a,_0x6c0cfa){if(_0x396a2a['body']['id']){delete _0x396a2a[_0xdbab('0x53')]['id'];}return db[_0xdbab('0x36')][_0xdbab('0x51')]({'where':{'id':_0x396a2a[_0xdbab('0x50')]['id']}})[_0xdbab('0x2a')](handleEntityNotFound(_0x6c0cfa,null))['then'](saveUpdates(_0x396a2a['body'],null))[_0xdbab('0x2a')](respondWithResult(_0x6c0cfa,null))[_0xdbab('0x4e')](handleError(_0x6c0cfa,null));};exports[_0xdbab('0x2e')]=function(_0x16a309,_0x3de137){return db['CmList']['find']({'where':{'id':_0x16a309['params']['id']}})[_0xdbab('0x2a')](handleEntityNotFound(_0x3de137,null))[_0xdbab('0x2a')](removeEntity(_0x3de137,null))[_0xdbab('0x4e')](handleError(_0x3de137,null));};exports[_0xdbab('0x58')]=function(_0x5cd8f3,_0x190902){return db[_0xdbab('0x36')][_0xdbab('0x58')]()[_0xdbab('0x2a')](respondWithResult(_0x190902,null))[_0xdbab('0x4e')](handleError(_0x190902,null));};exports[_0xdbab('0x59')]=function(_0x286596,_0x570d98,_0x31aadd){if(_0x286596[_0xdbab('0x53')]['id']){delete _0x286596[_0xdbab('0x53')]['id'];}return db[_0xdbab('0x36')][_0xdbab('0x51')]({'where':{'id':_0x286596[_0xdbab('0x50')]['id']}})[_0xdbab('0x2a')](handleEntityNotFound(_0x570d98,null))[_0xdbab('0x2a')](function(_0xe0520c){if(_0xe0520c){_0x286596[_0xdbab('0x53')][_0xdbab('0x5a')]=_0xe0520c['id'];return db[_0xdbab('0x5b')][_0xdbab('0x52')](_0x286596[_0xdbab('0x53')]);}})['then'](respondWithResult(_0x570d98,null))['catch'](handleError(_0x570d98,null));};exports[_0xdbab('0x5c')]=function(_0x212d78,_0x123b37,_0x14864c){var _0x1fb348={'raw':![],'where':{}};var _0x26b92d={};var _0x38c892={'count':0x0,'rows':[]};return db['CmList'][_0xdbab('0x5d')]({'where':{'id':_0x212d78[_0xdbab('0x50')]['id']}})['then'](handleEntityNotFound(_0x123b37,null))[_0xdbab('0x2a')](function(_0x493f25){if(_0x493f25){_0x26b92d[_0xdbab('0x3a')]=_['keys'](db[_0xdbab('0x5b')]['rawAttributes']);_0x26b92d['query']=_[_0xdbab('0x3c')](_0x212d78[_0xdbab('0x3b')]);_0x26b92d[_0xdbab('0x3d')]=_[_0xdbab('0x3e')](_0x26b92d[_0xdbab('0x3a')],_0x26b92d['query']);_0x1fb348['attributes']=_[_0xdbab('0x3e')](_0x26b92d[_0xdbab('0x3a')],qs[_0xdbab('0x40')](_0x212d78['query'][_0xdbab('0x40')]));_0x1fb348[_0xdbab('0x3f')]=_0x1fb348[_0xdbab('0x3f')][_0xdbab('0x41')]?_0x1fb348[_0xdbab('0x3f')]:_0x26b92d[_0xdbab('0x3a')];if(!_0x212d78['query']['hasOwnProperty']('nolimit')){_0x1fb348['limit']=qs[_0xdbab('0x1f')](_0x212d78[_0xdbab('0x3b')]['limit']);_0x1fb348[_0xdbab('0x22')]=qs[_0xdbab('0x22')](_0x212d78[_0xdbab('0x3b')][_0xdbab('0x22')]);}_0x1fb348[_0xdbab('0x44')]=qs[_0xdbab('0x45')](_0x212d78[_0xdbab('0x3b')][_0xdbab('0x45')]);_0x1fb348['where']=qs[_0xdbab('0x3d')](_[_0xdbab('0x5e')](_0x212d78[_0xdbab('0x3b')],_0x26b92d[_0xdbab('0x3d')]));_0x1fb348[_0xdbab('0x46')][_0xdbab('0x5a')]=_0x493f25['id'];if(_0x212d78[_0xdbab('0x3b')][_0xdbab('0x5f')]){_0x1fb348[_0xdbab('0x46')]=_[_0xdbab('0x47')](_0x1fb348['where'],{'$or':_[_0xdbab('0x35')](_0x1fb348[_0xdbab('0x3f')],function(_0x5e3f2d){var _0x49cce9={};_0x49cce9[_0x5e3f2d]={'$like':'%'+_0x212d78[_0xdbab('0x3b')]['filter']+'%'};return _0x49cce9;})});}_0x1fb348=_[_0xdbab('0x47')]({},_0x1fb348,_0x212d78[_0xdbab('0x4a')]);return db[_0xdbab('0x5b')]['count']({'where':_0x1fb348[_0xdbab('0x46')]})['then'](function(_0x35dfed){_0x38c892[_0xdbab('0x21')]=_0x35dfed;if(_0x212d78[_0xdbab('0x3b')][_0xdbab('0x4b')]){_0x1fb348[_0xdbab('0x4c')]=[{'all':!![]}];}return db[_0xdbab('0x5b')][_0xdbab('0x60')](_0x1fb348);})[_0xdbab('0x2a')](function(_0x222df9){_0x38c892[_0xdbab('0x4d')]=_0x222df9;return _0x38c892;});}})[_0xdbab('0x2a')](respondWithFilteredResult(_0x123b37,_0x1fb348))[_0xdbab('0x4e')](handleError(_0x123b37,null));};exports[_0xdbab('0x61')]=function(_0x1f39f2,_0x41fff1,_0x5b3b6d){return db[_0xdbab('0x36')][_0xdbab('0x51')]({'where':{'id':_0x1f39f2[_0xdbab('0x50')]['id']}})['then'](handleEntityNotFound(_0x41fff1,null))[_0xdbab('0x2a')](function(_0x544196){if(_0x544196){return _0x544196[_0xdbab('0x61')](_0x1f39f2[_0xdbab('0x3b')][_0xdbab('0x62')]);}})[_0xdbab('0x2a')](respondWithStatusCode(_0x41fff1,null))[_0xdbab('0x4e')](handleError(_0x41fff1,null));};exports[_0xdbab('0x63')]=function(_0x33f158,_0x32f47b,_0x2e6425){return db[_0xdbab('0x36')][_0xdbab('0x51')]({'where':{'id':_0x33f158[_0xdbab('0x50')]['id']}})[_0xdbab('0x2a')](handleEntityNotFound(_0x32f47b,null))['then'](function(_0x23ab59){if(_0x23ab59){var _0x3ca41b=[];var _0xec1c10={'success':[],'errors':[]};return db[_0xdbab('0x64')]['describe']()[_0xdbab('0x2a')](function(_0x2db742){if(_0x33f158['body'][_0xdbab('0x65')]&&_[_0xdbab('0x66')](_0x33f158[_0xdbab('0x53')]['tags'])){if(_0x33f158[_0xdbab('0x53')][_0xdbab('0x65')][_0xdbab('0x41')]){_0x33f158[_0xdbab('0x53')][_0xdbab('0x65')]=_0x33f158[_0xdbab('0x53')][_0xdbab('0x65')][_0xdbab('0x67')](';')+';';}else{_0x33f158[_0xdbab('0x53')][_0xdbab('0x65')]=null;}}else{_0x33f158[_0xdbab('0x53')][_0xdbab('0x65')]=null;}if(_0x33f158[_0xdbab('0x53')]&&_['isArray'](_0x33f158[_0xdbab('0x53')])){for(var _0x2e945f=0x0;_0x2e945f<_0x33f158['body'][_0xdbab('0x41')];_0x2e945f+=0x1){_0x33f158[_0xdbab('0x53')][_0x2e945f][_0xdbab('0x5a')]=_0x33f158[_0xdbab('0x50')]['id'];_0x3ca41b[_0xdbab('0x68')](_0x33f158['body'][_0x2e945f]);}return BPromise['each'](_0x3ca41b,function(_0x546388){return db[_0xdbab('0x64')]['create'](_[_0xdbab('0x69')](_0x546388,['ids','id'])||{},{'fields':_['keys'](_0x2db742),'raw':!![]})[_0xdbab('0x2a')](function(_0x4a9b29){_0xec1c10[_0xdbab('0x6a')][_0xdbab('0x68')](_0x4a9b29[_0xdbab('0x6b')]);})[_0xdbab('0x4e')](function(_0x399f2b){_0xec1c10['errors'][_0xdbab('0x68')]({'data':_0x546388,'error':_0x399f2b[_0xdbab('0x6c')]});});})['then'](function(_0x23b52){return _0xec1c10;})['catch'](function(_0x3dee68){return _0x3dee68;});}else{_0x32f47b[_0xdbab('0x1e')](0x190)['json']({'message':'Malformed\x20request\x20syntax'});}});}})[_0xdbab('0x2a')](respondWithResult(_0x32f47b,null))[_0xdbab('0x4e')](handleError(_0x32f47b,null));};exports['getContacts']=function(_0x878742,_0xf28f0d,_0x1c4acf){var _0xd58775;return db[_0xdbab('0x36')][_0xdbab('0x51')]({'where':{'id':_0x878742[_0xdbab('0x50')]['id']},'include':[{'model':db[_0xdbab('0x6d')],'as':_0xdbab('0x6e')}]})['then'](handleEntityNotFound(_0xf28f0d,null))[_0xdbab('0x2a')](function(_0x2f3a22){if(_0x2f3a22){_0xd58775=_0x2f3a22;return db[_0xdbab('0x64')][_0xdbab('0x37')];}})[_0xdbab('0x2a')](function(_0x573db6){if(_0x573db6){var _0x362842={};var _0x3ef049={};_0x3ef049['model']=_[_0xdbab('0x6f')](_[_0xdbab('0x3c')](_0x573db6),_[_0xdbab('0x35')](_0xd58775[_0xdbab('0x6e')],function(_0x42b4a5){return util[_0xdbab('0x70')]('cf_%d',_0x42b4a5['id']);}));_0x3ef049[_0xdbab('0x3b')]=_[_0xdbab('0x3c')](_0x878742[_0xdbab('0x3b')]);_0x3ef049[_0xdbab('0x3d')]=_[_0xdbab('0x3e')](_0x3ef049['model'],_0x3ef049['query']);_0x362842[_0xdbab('0x3f')]=_['intersection'](_0x3ef049['model'],qs[_0xdbab('0x40')](_0x878742['query'][_0xdbab('0x40')]));_0x362842[_0xdbab('0x3f')]=_0x362842[_0xdbab('0x3f')][_0xdbab('0x41')]?_0x362842[_0xdbab('0x3f')]:_0x3ef049['model'];if(!_0x878742[_0xdbab('0x3b')][_0xdbab('0x42')](_0xdbab('0x43'))){_0x362842[_0xdbab('0x1f')]=qs['limit'](_0x878742[_0xdbab('0x3b')]['limit']);_0x362842[_0xdbab('0x22')]=qs['offset'](_0x878742[_0xdbab('0x3b')][_0xdbab('0x22')]);}_0x362842[_0xdbab('0x44')]=qs['sort'](_0x878742[_0xdbab('0x3b')][_0xdbab('0x45')]);_0x362842['where']=qs['filters'](_[_0xdbab('0x5e')](_0x878742[_0xdbab('0x3b')],_0x3ef049['filters']));_0x362842[_0xdbab('0x71')]=!![];if(_0x878742[_0xdbab('0x3b')][_0xdbab('0x5f')]){_0x362842[_0xdbab('0x46')]=_[_0xdbab('0x47')](_0x362842[_0xdbab('0x46')],{'$or':_['map'](_0x362842['attributes'],function(_0x422776){var _0x35ba07={};_0x35ba07[_0x422776]={'$like':'%'+_0x878742[_0xdbab('0x3b')][_0xdbab('0x5f')]+'%'};return _0x35ba07;})});}_0x362842=_[_0xdbab('0x47')]({},_0x362842,_0x878742[_0xdbab('0x4a')]);return _0xd58775[_0xdbab('0x72')](_0x362842);}})[_0xdbab('0x2a')](respondWithResult(_0xf28f0d,null))[_0xdbab('0x4e')](handleError(_0xf28f0d,null));};exports['getContactsCsv']=function(_0x1a6b07,_0x511db5,_0xff00b6){var _0x415fa9;var _0x1058f8;var _0x24c9bc;var _0x520491=_0x1a6b07[_0xdbab('0x50')]['id'];csv_results=[];return db['ContactItemType']['findAll']({'attributes':['id',_0xdbab('0x32')],'raw':!![],'order':[_0xdbab('0x73')]})[_0xdbab('0x2a')](function(_0xa55bac){_0x415fa9=_0xa55bac;var _0x18c4ca=_['keys'](db[_0xdbab('0x64')][_0xdbab('0x37')]);return db[_0xdbab('0x6d')][_0xdbab('0x60')]({'raw':!![],'attributes':['id',_0xdbab('0x74')]})[_0xdbab('0x2a')](function(_0x4cca66){_0x1058f8=_0x4cca66;var _0x5010bb=squel['select']()['fields'](_0x18c4ca)[_0xdbab('0x75')](_0xdbab('0x76'),'c')[_0xdbab('0x46')]('c.ListId\x20=\x20?',_0x520491)['where'](_0xdbab('0x77'))[_0xdbab('0x78')]();for(var _0x89e842=0x0;_0x89e842<_0x1058f8[_0xdbab('0x41')];_0x89e842++){_0x5010bb['field'](_0xdbab('0x79')+_0x1058f8[_0x89e842]['id'],_0xdbab('0x7a')+_0x1058f8[_0x89e842][_0xdbab('0x74')]);}for(var _0x89e842=0x0;_0x89e842<_0x415fa9[_0xdbab('0x41')];_0x89e842++){_0x5010bb[_0xdbab('0x7b')](squel['select']()[_0xdbab('0x7b')](_0xdbab('0x7c'))[_0xdbab('0x75')](_0xdbab('0x7d'))[_0xdbab('0x46')]('ItemTypeId\x20=\x20?',_0x415fa9[_0x89e842]['id'])[_0xdbab('0x46')](_0xdbab('0x7e')),_0xdbab('0x7f')+_0x415fa9[_0x89e842][_0xdbab('0x32')]);_0x5010bb[_0xdbab('0x7b')](squel[_0xdbab('0x80')]()['field'](_0xdbab('0x81'))[_0xdbab('0x75')](_0xdbab('0x7d'))[_0xdbab('0x46')](_0xdbab('0x82'),_0x415fa9[_0x89e842]['id'])[_0xdbab('0x46')](_0xdbab('0x7e')),_0xdbab('0x83')+_0x415fa9[_0x89e842][_0xdbab('0x32')]);}var _0x1aed31=[];_0x1aed31[_0xdbab('0x68')](_0x5010bb['toString']());BPromise[_0xdbab('0x84')](_0x1aed31,handleQuery)[_0xdbab('0x2a')](function(_0x3fd099){handleQuery(_0x5010bb[_0xdbab('0x85')]());var _0x39bf91=csv_results[0x0];if(!_['isEmpty'](_0x39bf91)){var _0x5431ce=toCsv(_0x39bf91);var _0x5e73ad=Date[_0xdbab('0x86')]();fs['writeFileSync'](util[_0xdbab('0x70')](_0xdbab('0x87'),_0x520491,_0x5e73ad),_0x5431ce);_0x511db5['setHeader'](_0xdbab('0x88'),'attachment;\x20filename='+util[_0xdbab('0x70')](_0xdbab('0x89'),_0x520491,_0x5e73ad));_0x511db5['setHeader'](_0xdbab('0x8a'),_0xdbab('0x8b'));return _0x511db5[_0xdbab('0x8c')](util[_0xdbab('0x70')](_0xdbab('0x87'),_0x520491,_0x5e73ad));}else{return _0x511db5[_0xdbab('0x1d')](0xcc);}});});});};exports[_0xdbab('0x8d')]=function(_0x47c1ba,_0x1cec08,_0x24fefa){var _0x5c2e16;delete _0x47c1ba['body']['id'];return db[_0xdbab('0x36')][_0xdbab('0x5d')]({'where':{'id':_0x47c1ba[_0xdbab('0x50')]['id']}})['then'](handleEntityNotFound(_0x1cec08,null))['then'](function(_0x3bf52a){if(_0x3bf52a){return db[_0xdbab('0x8e')]['transaction'](function(_0x48db67){return db[_0xdbab('0x6d')][_0xdbab('0x52')](_0x47c1ba[_0xdbab('0x53')],{'transaction':_0x48db67})[_0xdbab('0x2a')](function(_0x311ba5){_0x5c2e16=_0x311ba5;return _0x3bf52a[_0xdbab('0x8f')](_0x311ba5,{'transaction':_0x48db67});})[_0xdbab('0x2a')](function(){var _0x3cdf6d={'type':db[_0xdbab('0x90')][_0xdbab('0x91')],'transaction':_0x48db67};switch(_0x47c1ba['body'][_0xdbab('0x48')]){case _0xdbab('0x92'):_0x3cdf6d[_0xdbab('0x48')]=db['Sequelize'][_0xdbab('0x91')];break;case _0xdbab('0x93'):_0x3cdf6d[_0xdbab('0x48')]=db['Sequelize'][_0xdbab('0x94')];break;case'switch':_0x3cdf6d[_0xdbab('0x48')]=db[_0xdbab('0x90')][_0xdbab('0x95')];_0x3cdf6d[_0xdbab('0x96')]=![];break;default:}return db[_0xdbab('0x8e')][_0xdbab('0x97')][_0xdbab('0x98')]('cm_contacts',util[_0xdbab('0x70')](_0xdbab('0x99'),_0x5c2e16['id']),_0x3cdf6d);})[_0xdbab('0x2a')](function(){return _0x5c2e16;});});}})[_0xdbab('0x2a')](respondWithResult(_0x1cec08,null))[_0xdbab('0x4e')](handleError(_0x1cec08,null));};exports[_0xdbab('0x9a')]=function(_0x43ced2,_0x5cfb6d,_0x4413f6){var _0x54360f={};var _0x398434={};var _0x1f9d73;var _0xc41b8d;return db[_0xdbab('0x36')]['findOne']({'where':{'id':_0x43ced2[_0xdbab('0x50')]['id']}})[_0xdbab('0x2a')](handleEntityNotFound(_0x5cfb6d,null))[_0xdbab('0x2a')](function(_0x39336f){if(_0x39336f){_0x1f9d73=_0x39336f;_0x398434[_0xdbab('0x3a')]=_[_0xdbab('0x3c')](db[_0xdbab('0x6d')][_0xdbab('0x37')]);_0x398434[_0xdbab('0x3b')]=_['keys'](_0x43ced2[_0xdbab('0x3b')]);_0x398434[_0xdbab('0x3d')]=_[_0xdbab('0x3e')](_0x398434['model'],_0x398434[_0xdbab('0x3b')]);_0x54360f[_0xdbab('0x3f')]=_[_0xdbab('0x3e')](_0x398434[_0xdbab('0x3a')],qs['fields'](_0x43ced2[_0xdbab('0x3b')][_0xdbab('0x40')]));_0x54360f[_0xdbab('0x3f')]=_0x54360f[_0xdbab('0x3f')][_0xdbab('0x41')]?_0x54360f['attributes']:_0x398434[_0xdbab('0x3a')];_0x54360f[_0xdbab('0x44')]=qs[_0xdbab('0x45')](_0x43ced2[_0xdbab('0x3b')][_0xdbab('0x45')]);_0x54360f['where']=qs[_0xdbab('0x3d')](_[_0xdbab('0x5e')](_0x43ced2[_0xdbab('0x3b')],_0x398434['filters']));_0x54360f['where']=_[_0xdbab('0x47')](_0x54360f[_0xdbab('0x46')],{'$or':[{'ListId':_0x39336f['id']},{'ListId':null}]});if(_0x43ced2[_0xdbab('0x3b')]['filter']){_0x54360f[_0xdbab('0x46')]=_[_0xdbab('0x47')](_0x54360f[_0xdbab('0x46')],{'$or':_['map'](_0x54360f['attributes'],function(_0x1544c7){var _0x41afda={};_0x41afda[_0x1544c7]={'$like':'%'+_0x43ced2['query'][_0xdbab('0x5f')]+'%'};return _0x41afda;})});}_0x54360f=_[_0xdbab('0x47')]({},_0x54360f,_0x43ced2[_0xdbab('0x4a')]);return db[_0xdbab('0x6d')][_0xdbab('0x9b')](_0x54360f);}})['then'](respondWithResult(_0x5cfb6d,null))[_0xdbab('0x4e')](handleError(_0x5cfb6d,null));};exports[_0xdbab('0x9c')]=function(_0x9b510c,_0x34cfb3){return db[_0xdbab('0x6d')][_0xdbab('0x9b')]({'where':{'ListId':null}})[_0xdbab('0x2a')](handleEntityNotFound(_0x34cfb3,null))[_0xdbab('0x2a')](function(_0x1ba089){return _0x1ba089;})[_0xdbab('0x2a')](respondWithResult(_0x34cfb3,null))[_0xdbab('0x4e')](handleError(_0x34cfb3,null));};exports[_0xdbab('0x9d')]=function(_0xcbde4a,_0x2b11fa,_0x30902d){return db['CmList'][_0xdbab('0x51')]({'where':{'id':_0xcbde4a['params']['id']}})[_0xdbab('0x2a')](handleEntityNotFound(_0x2b11fa,null))['then'](function(_0x13368c){if(_0x13368c){return _0x13368c[_0xdbab('0x9d')](_0xcbde4a['body'][_0xdbab('0x62')],_[_0xdbab('0x69')](_0xcbde4a[_0xdbab('0x53')],[_0xdbab('0x62'),'id'])||{})[_0xdbab('0x9e')](function(_0x286032){for(var _0x2d20b2=0x0;_0x2d20b2<_0xcbde4a[_0xdbab('0x53')][_0xdbab('0x62')][_0xdbab('0x41')];_0x2d20b2+=0x1){socket[_0xdbab('0x9f')](_0xdbab('0xa0'),{'UserId':Number(_0xcbde4a[_0xdbab('0x53')][_0xdbab('0x62')][_0x2d20b2]),'CmListId':Number(_0xcbde4a['params']['id'])});}return _0x286032;});}})[_0xdbab('0x2a')](respondWithResult(_0x2b11fa,null))[_0xdbab('0x4e')](handleError(_0x2b11fa,null));};exports[_0xdbab('0xa1')]=function(_0x460cb2,_0x5c05d7,_0x574f8c){return db[_0xdbab('0x36')][_0xdbab('0x51')]({'where':{'id':_0x460cb2[_0xdbab('0x50')]['id']}})[_0xdbab('0x2a')](handleEntityNotFound(_0x5c05d7,null))[_0xdbab('0x2a')](function(_0x52657e){if(_0x52657e){return _0x52657e[_0xdbab('0xa1')](_0x460cb2['query'][_0xdbab('0x62')])['then'](function(){if(_[_0xdbab('0x66')](_0x460cb2[_0xdbab('0x3b')][_0xdbab('0x62')])){for(var _0x572783=0x0;_0x572783<_0x460cb2['query']['ids'][_0xdbab('0x41')];_0x572783+=0x1){socket['emit'](_0xdbab('0xa2'),{'UserId':Number(_0x460cb2['query'][_0xdbab('0x62')][_0x572783]),'CmListId':Number(_0x460cb2[_0xdbab('0x50')]['id'])});}}else{socket['emit'](_0xdbab('0xa2'),{'UserId':Number(_0x460cb2[_0xdbab('0x3b')][_0xdbab('0x62')]),'CmListId':Number(_0x460cb2[_0xdbab('0x50')]['id'])});}});}})['then'](respondWithStatusCode(_0x5c05d7,null))['catch'](handleError(_0x5c05d7,null));};exports[_0xdbab('0xa3')]=function(_0x4b27d1,_0x28f75a,_0x4ea975){var _0x4b8323={};var _0x2a107c={};var _0x49ff77;var _0x61b8bc;return db['CmList'][_0xdbab('0x5d')]({'where':{'id':_0x4b27d1['params']['id']}})[_0xdbab('0x2a')](handleEntityNotFound(_0x28f75a,null))['then'](function(_0x257497){if(_0x257497){_0x49ff77=_0x257497;_0x2a107c[_0xdbab('0x3a')]=_[_0xdbab('0x3c')](db[_0xdbab('0xa4')]['rawAttributes']);_0x2a107c[_0xdbab('0x3b')]=_[_0xdbab('0x3c')](_0x4b27d1[_0xdbab('0x3b')]);_0x2a107c['filters']=_[_0xdbab('0x3e')](_0x2a107c[_0xdbab('0x3a')],_0x2a107c[_0xdbab('0x3b')]);_0x4b8323[_0xdbab('0x3f')]=_[_0xdbab('0x3e')](_0x2a107c[_0xdbab('0x3a')],qs['fields'](_0x4b27d1[_0xdbab('0x3b')][_0xdbab('0x40')]));_0x4b8323[_0xdbab('0x3f')]=_0x4b8323[_0xdbab('0x3f')][_0xdbab('0x41')]?_0x4b8323['attributes']:_0x2a107c[_0xdbab('0x3a')];_0x4b8323[_0xdbab('0x44')]=qs[_0xdbab('0x45')](_0x4b27d1[_0xdbab('0x3b')][_0xdbab('0x45')]);_0x4b8323['where']=qs[_0xdbab('0x3d')](_[_0xdbab('0x5e')](_0x4b27d1[_0xdbab('0x3b')],_0x2a107c[_0xdbab('0x3d')]));if(_0x4b27d1[_0xdbab('0x3b')][_0xdbab('0x5f')]){_0x4b8323[_0xdbab('0x46')]=_[_0xdbab('0x47')](_0x4b8323['where'],{'$or':_[_0xdbab('0x35')](_0x4b8323[_0xdbab('0x3f')],function(_0x4f573d){var _0x39a2ba={};_0x39a2ba[_0x4f573d]={'$like':'%'+_0x4b27d1[_0xdbab('0x3b')][_0xdbab('0x5f')]+'%'};return _0x39a2ba;})});}_0x4b8323=_[_0xdbab('0x47')]({},_0x4b8323,_0x4b27d1[_0xdbab('0x4a')]);return _0x49ff77['getAgents'](_0x4b8323);}})[_0xdbab('0x2a')](function(_0x376124){if(_0x376124){_0x61b8bc=_0x376124[_0xdbab('0x41')];if(!_0x4b27d1[_0xdbab('0x3b')][_0xdbab('0x42')](_0xdbab('0x43'))){_0x4b8323['limit']=qs[_0xdbab('0x1f')](_0x4b27d1[_0xdbab('0x3b')][_0xdbab('0x1f')]);_0x4b8323[_0xdbab('0x22')]=qs[_0xdbab('0x22')](_0x4b27d1[_0xdbab('0x3b')][_0xdbab('0x22')]);}return _0x49ff77['getAgents'](_0x4b8323);}})[_0xdbab('0x2a')](function(_0x3e2f25){if(_0x3e2f25){return _0x3e2f25?{'count':_0x61b8bc,'rows':_0x3e2f25}:null;}})[_0xdbab('0x2a')](respondWithResult(_0x28f75a,null))[_0xdbab('0x4e')](handleError(_0x28f75a,null));};function handleQuery(_0x354b59){logger['info'](_0x354b59);return db['sequelize']['query'](_0x354b59)[_0xdbab('0x9e')](function(_0x1397e7){csv_results['push'](_0x1397e7);})[_0xdbab('0x4e')](function(_0x10d618){logger[_0xdbab('0x30')](_0x10d618[_0xdbab('0x6c')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 97cfe53..c6e6133 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 _0x7217=['emit','hasOwnProperty','hook','exports','events','CmList','setMaxListeners','save','update','remove'];(function(_0x15fc3c,_0x35665b){var _0x94c5c8=function(_0xbab268){while(--_0xbab268){_0x15fc3c['push'](_0x15fc3c['shift']());}};_0x94c5c8(++_0x35665b);}(_0x7217,0x19e));var _0x7721=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0x7217[_0x34bc30];return _0x5706de;};'use strict';var EventEmitter=require(_0x7721('0x0'));var CmList=require('../../mysqldb')['db'][_0x7721('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x7721('0x2')](0x0);var events={'afterCreate':_0x7721('0x3'),'afterUpdate':_0x7721('0x4'),'afterDestroy':_0x7721('0x5')};function emitEvent(_0x4d6446){return function(_0x5bf160,_0x472a96,_0xce17f9){CmListEvents[_0x7721('0x6')](_0x4d6446+':'+_0x5bf160['id'],_0x5bf160);CmListEvents[_0x7721('0x6')](_0x4d6446,_0x5bf160);_0xce17f9(null);};}for(var e in events){if(events[_0x7721('0x7')](e)){var event=events[e];CmList[_0x7721('0x8')](e,emitEvent(event));}}module[_0x7721('0x9')]=CmListEvents; \ No newline at end of file +var _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0x5fc3,0xa8));var _0x35fc=function(_0x336376,_0xe4b28d){_0x336376=_0x336376-0x0;var _0x1d2a8e=_0x5fc3[_0x336376];return _0x1d2a8e;};'use strict';var EventEmitter=require(_0x35fc('0x0'));var CmList=require(_0x35fc('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x35fc('0x2')](0x0);var events={'afterCreate':_0x35fc('0x3'),'afterUpdate':_0x35fc('0x4'),'afterDestroy':_0x35fc('0x5')};function emitEvent(_0xb4f9ce){return function(_0x5e75e6,_0x2d1404,_0x1d5fec){CmListEvents[_0x35fc('0x6')](_0xb4f9ce+':'+_0x5e75e6['id'],_0x5e75e6);CmListEvents['emit'](_0xb4f9ce,_0x5e75e6);_0x1d5fec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x35fc('0x7')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 9dbf95a..d9678e9 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 _0x2dae=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists'];(function(_0x536277,_0x19558f){var _0x34aa15=function(_0x4b5752){while(--_0x4b5752){_0x536277['push'](_0x536277['shift']());}};_0x34aa15(++_0x19558f);}(_0x2dae,0xc3));var _0xe2da=function(_0x4179e2,_0xf2dbb){_0x4179e2=_0x4179e2-0x0;var _0x24cb50=_0x2dae[_0x4179e2];return _0x24cb50;};'use strict';var _=require(_0xe2da('0x0'));var util=require('util');var logger=require(_0xe2da('0x1'))(_0xe2da('0x2'));var moment=require(_0xe2da('0x3'));var BPromise=require(_0xe2da('0x4'));var rp=require(_0xe2da('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe2da('0x6'));var config=require(_0xe2da('0x7'));var attributes=require(_0xe2da('0x8'));module[_0xe2da('0x9')]=function(_0x523c60,_0x3e3e25){return _0x523c60[_0xe2da('0xa')](_0xe2da('0xb'),attributes,{'tableName':_0xe2da('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x878f=['path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x878f,0x173));var _0xf878=function(_0x4ff69c,_0x5069a6){_0x4ff69c=_0x4ff69c-0x0;var _0x26c499=_0x878f[_0x4ff69c];return _0x26c499;};'use strict';var _=require('lodash');var util=require(_0xf878('0x0'));var logger=require(_0xf878('0x1'))(_0xf878('0x2'));var moment=require(_0xf878('0x3'));var BPromise=require(_0xf878('0x4'));var rp=require(_0xf878('0x5'));var fs=require('fs');var path=require(_0xf878('0x6'));var rimraf=require(_0xf878('0x7'));var config=require(_0xf878('0x8'));var attributes=require(_0xf878('0x9'));module[_0xf878('0xa')]=function(_0x4bc9aa,_0x4ac8d8){return _0x4bc9aa[_0xf878('0xb')](_0xf878('0xc'),attributes,{'tableName':'cm_lists','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 e803da8..0238828 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 _0xd2c2=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','CmList,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash'];(function(_0x15d7df,_0x21b3f0){var _0x3ebfc2=function(_0x3e8692){while(--_0x3e8692){_0x15d7df['push'](_0x15d7df['shift']());}};_0x3ebfc2(++_0x21b3f0);}(_0xd2c2,0x195));var _0x2d2c=function(_0x3ba386,_0x30e846){_0x3ba386=_0x3ba386-0x0;var _0x325695=_0xd2c2[_0x3ba386];return _0x325695;};'use strict';var _=require(_0x2d2c('0x0'));var util=require('util');var moment=require(_0x2d2c('0x1'));var BPromise=require(_0x2d2c('0x2'));var rs=require(_0x2d2c('0x3'));var fs=require('fs');var Redis=require(_0x2d2c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2d2c('0x5'));var logger=require(_0x2d2c('0x6'))(_0x2d2c('0x7'));var config=require(_0x2d2c('0x8'));var jayson=require(_0x2d2c('0x9'));var client=jayson['client'][_0x2d2c('0xa')]({'port':0x232a});config[_0x2d2c('0xb')]=_[_0x2d2c('0xc')](config[_0x2d2c('0xb')],{'host':_0x2d2c('0xd'),'port':0x18eb});var socket=require(_0x2d2c('0xe'))(new Redis(config[_0x2d2c('0xb')]));require(_0x2d2c('0xf'))[_0x2d2c('0x10')](socket);function respondWithRpcPromise(_0x54ba10,_0x5098f6,_0x1bd11a){return new BPromise(function(_0x33d748,_0x5cd8b6){return client[_0x2d2c('0x11')](_0x54ba10,_0x1bd11a)[_0x2d2c('0x12')](function(_0x1e7f77){logger[_0x2d2c('0x13')](_0x2d2c('0x14'),_0x5098f6,'request\x20sent');logger['debug'](_0x2d2c('0x15'),_0x5098f6,_0x2d2c('0x16'),JSON[_0x2d2c('0x17')](_0x1e7f77));if(_0x1e7f77[_0x2d2c('0x18')]){if(_0x1e7f77[_0x2d2c('0x18')][_0x2d2c('0x19')]===0x1f4){logger[_0x2d2c('0x18')](_0x2d2c('0x14'),_0x5098f6,_0x1e7f77[_0x2d2c('0x18')][_0x2d2c('0x1a')]);return _0x5cd8b6(_0x1e7f77['error'][_0x2d2c('0x1a')]);}logger[_0x2d2c('0x18')](_0x2d2c('0x14'),_0x5098f6,_0x1e7f77[_0x2d2c('0x18')][_0x2d2c('0x1a')]);return _0x33d748(_0x1e7f77['error'][_0x2d2c('0x1a')]);}else{logger[_0x2d2c('0x13')](_0x2d2c('0x14'),_0x5098f6,_0x2d2c('0x16'));_0x33d748(_0x1e7f77[_0x2d2c('0x1b')]['message']);}})[_0x2d2c('0x1c')](function(_0x39547f){logger[_0x2d2c('0x18')](_0x2d2c('0x14'),_0x5098f6,_0x39547f);_0x5cd8b6(_0x39547f);});});} \ No newline at end of file +var _0xfd57=['defaults','localhost','socket.io-emitter','./cmList.socket','then','info','CmList,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','redis'];(function(_0x5c8d20,_0x49078d){var _0xe4b028=function(_0x7e534){while(--_0x7e534){_0x5c8d20['push'](_0x5c8d20['shift']());}};_0xe4b028(++_0x49078d);}(_0xfd57,0xe6));var _0x7fd5=function(_0x2d58f6,_0x1408ec){_0x2d58f6=_0x2d58f6-0x0;var _0x31a7a2=_0xfd57[_0x2d58f6];return _0x31a7a2;};'use strict';var _=require('lodash');var util=require(_0x7fd5('0x0'));var moment=require(_0x7fd5('0x1'));var BPromise=require(_0x7fd5('0x2'));var rs=require(_0x7fd5('0x3'));var fs=require('fs');var Redis=require(_0x7fd5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7fd5('0x5'));var logger=require('../../config/logger')(_0x7fd5('0x6'));var config=require('../../config/environment');var jayson=require(_0x7fd5('0x7'));var client=jayson[_0x7fd5('0x8')]['http']({'port':0x232a});config[_0x7fd5('0x9')]=_[_0x7fd5('0xa')](config[_0x7fd5('0x9')],{'host':_0x7fd5('0xb'),'port':0x18eb});var socket=require(_0x7fd5('0xc'))(new Redis(config['redis']));require(_0x7fd5('0xd'))['register'](socket);function respondWithRpcPromise(_0x3fef89,_0x1ec3dd,_0x3926cc){return new BPromise(function(_0x34b99b,_0x448393){return client['request'](_0x3fef89,_0x3926cc)[_0x7fd5('0xe')](function(_0x16c1ae){logger[_0x7fd5('0xf')](_0x7fd5('0x10'),_0x1ec3dd,_0x7fd5('0x11'));logger['debug']('CmList,\x20%s,\x20%s,\x20%s',_0x1ec3dd,'request\x20sent',JSON[_0x7fd5('0x12')](_0x16c1ae));if(_0x16c1ae[_0x7fd5('0x13')]){if(_0x16c1ae['error'][_0x7fd5('0x14')]===0x1f4){logger['error'](_0x7fd5('0x10'),_0x1ec3dd,_0x16c1ae[_0x7fd5('0x13')][_0x7fd5('0x15')]);return _0x448393(_0x16c1ae[_0x7fd5('0x13')]['message']);}logger[_0x7fd5('0x13')](_0x7fd5('0x10'),_0x1ec3dd,_0x16c1ae[_0x7fd5('0x13')][_0x7fd5('0x15')]);return _0x34b99b(_0x16c1ae[_0x7fd5('0x13')]['message']);}else{logger['info'](_0x7fd5('0x10'),_0x1ec3dd,_0x7fd5('0x11'));_0x34b99b(_0x16c1ae[_0x7fd5('0x16')][_0x7fd5('0x15')]);}})[_0x7fd5('0x17')](function(_0x35a0e9){logger['error']('CmList,\x20%s,\x20%s',_0x1ec3dd,_0x35a0e9);_0x448393(_0x35a0e9);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 2f36ac5..5b6e45d 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 _0xa520=['length','./cmList.events','save','remove','update','register'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa520,0xd3));var _0x0a52=function(_0x4fb540,_0x4a1559){_0x4fb540=_0x4fb540-0x0;var _0x4a21e7=_0xa520[_0x4fb540];return _0x4a21e7;};'use strict';var CmListEvents=require(_0x0a52('0x0'));var events=[_0x0a52('0x1'),_0x0a52('0x2'),_0x0a52('0x3')];function createListener(_0x838363,_0x22bfae){return function(_0x2738ac){_0x22bfae['emit'](_0x838363,_0x2738ac);};}function removeListener(_0x4fe01c,_0x6e0673){return function(){CmListEvents['removeListener'](_0x4fe01c,_0x6e0673);};}exports[_0x0a52('0x4')]=function(_0x1f83ec){for(var _0x558e07=0x0,_0x4f9013=events[_0x0a52('0x5')];_0x558e07<_0x4f9013;_0x558e07++){var _0x3999b5=events[_0x558e07];var _0x1f0d5b=createListener('cmList:'+_0x3999b5,_0x1f83ec);CmListEvents['on'](_0x3999b5,_0x1f0d5b);}}; \ No newline at end of file +var _0x070b=['cmList:','./cmList.events','emit','removeListener'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x070b,0x1bd));var _0xb070=function(_0x5af8f8,_0x51110d){_0x5af8f8=_0x5af8f8-0x0;var _0xd900f7=_0x070b[_0x5af8f8];return _0xd900f7;};'use strict';var CmListEvents=require(_0xb070('0x0'));var events=['save','remove','update'];function createListener(_0x2934b3,_0x269215){return function(_0x5166f5){_0x269215[_0xb070('0x1')](_0x2934b3,_0x5166f5);};}function removeListener(_0x16a436,_0x2fb6c0){return function(){CmListEvents[_0xb070('0x2')](_0x16a436,_0x2fb6c0);};}exports['register']=function(_0x2680c2){for(var _0x5eb312=0x0,_0x589915=events['length'];_0x5eb312<_0x589915;_0x5eb312++){var _0x3d1453=events[_0x5eb312];var _0x1f49b0=createListener(_0xb070('0x3')+_0x3d1453,_0x2680c2);CmListEvents['on'](_0x3d1453,_0x1f49b0);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index f9ca7e8..1cc2d55 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 _0xba35=['delete','destroy','removeDispositions','exports','multer','util','path','connect-timeout','fs-extra','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','describe','/global_fields','getGlobalCustomFields','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','addDisposition','addCustomField','addAgents','/:id'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xba35,0x190));var _0x5ba3=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xba35[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require(_0x5ba3('0x0'));var util=require(_0x5ba3('0x1'));var path=require(_0x5ba3('0x2'));var timeout=require(_0x5ba3('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5ba3('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5ba3('0x5'));var controller=require(_0x5ba3('0x6'));router[_0x5ba3('0x7')]('/',auth[_0x5ba3('0x8')](),controller[_0x5ba3('0x9')]);router[_0x5ba3('0x7')](_0x5ba3('0xa'),auth[_0x5ba3('0x8')](),controller[_0x5ba3('0xb')]);router[_0x5ba3('0x7')](_0x5ba3('0xc'),auth[_0x5ba3('0x8')](),controller[_0x5ba3('0xd')]);router['get']('/:id',auth[_0x5ba3('0x8')](),controller[_0x5ba3('0xe')]);router['get'](_0x5ba3('0xf'),auth[_0x5ba3('0x8')](),controller[_0x5ba3('0x10')]);router[_0x5ba3('0x7')](_0x5ba3('0x11'),auth[_0x5ba3('0x8')](),controller[_0x5ba3('0x12')]);router[_0x5ba3('0x7')]('/:id/contacts/csv',auth['isAuthenticated'](),controller[_0x5ba3('0x13')]);router[_0x5ba3('0x7')](_0x5ba3('0x14'),auth[_0x5ba3('0x8')](),controller[_0x5ba3('0x15')]);router[_0x5ba3('0x7')](_0x5ba3('0x16'),auth[_0x5ba3('0x8')](),controller[_0x5ba3('0x17')]);router[_0x5ba3('0x18')]('/',auth[_0x5ba3('0x8')](),controller['create']);router[_0x5ba3('0x18')](_0x5ba3('0xf'),auth[_0x5ba3('0x8')](),controller[_0x5ba3('0x19')]);router[_0x5ba3('0x18')](_0x5ba3('0x11'),auth[_0x5ba3('0x8')](),controller['addContacts']);router[_0x5ba3('0x18')]('/:id/fields',auth['isAuthenticated'](),controller[_0x5ba3('0x1a')]);router[_0x5ba3('0x18')](_0x5ba3('0x16'),auth[_0x5ba3('0x8')](),controller[_0x5ba3('0x1b')]);router['put'](_0x5ba3('0x1c'),auth[_0x5ba3('0x8')](),controller['update']);router[_0x5ba3('0x1d')](_0x5ba3('0x1c'),auth[_0x5ba3('0x8')](),controller[_0x5ba3('0x1e')]);router[_0x5ba3('0x1d')](_0x5ba3('0xf'),auth['isAuthenticated'](),controller[_0x5ba3('0x1f')]);router[_0x5ba3('0x1d')](_0x5ba3('0x16'),auth[_0x5ba3('0x8')](),controller['removeAgents']);module[_0x5ba3('0x20')]=router; \ No newline at end of file +var _0x0844=['/:id/fields','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addContacts','addCustomField','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','./cmList.controller','get','index','isAuthenticated','describe','/global_fields','getGlobalCustomFields','show','getDispositions','/:id/contacts','getContactsCsv'];(function(_0x18c618,_0x484959){var _0x4c1381=function(_0x53e849){while(--_0x53e849){_0x18c618['push'](_0x18c618['shift']());}};_0x4c1381(++_0x484959);}(_0x0844,0xc1));var _0x4084=function(_0x38b0ab,_0x2b7d14){_0x38b0ab=_0x38b0ab-0x0;var _0x51c38d=_0x0844[_0x38b0ab];return _0x51c38d;};'use strict';var multer=require(_0x4084('0x0'));var util=require(_0x4084('0x1'));var path=require(_0x4084('0x2'));var timeout=require(_0x4084('0x3'));var express=require(_0x4084('0x4'));var router=express['Router']();var fs_extra=require(_0x4084('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4084('0x6'));router[_0x4084('0x7')]('/',auth['isAuthenticated'](),controller[_0x4084('0x8')]);router[_0x4084('0x7')]('/describe',auth[_0x4084('0x9')](),controller[_0x4084('0xa')]);router[_0x4084('0x7')](_0x4084('0xb'),auth[_0x4084('0x9')](),controller[_0x4084('0xc')]);router[_0x4084('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x4084('0xd')]);router['get']('/:id/dispositions',auth[_0x4084('0x9')](),controller[_0x4084('0xe')]);router['get'](_0x4084('0xf'),auth[_0x4084('0x9')](),controller['getContacts']);router['get']('/:id/contacts/csv',auth['isAuthenticated'](),controller[_0x4084('0x10')]);router['get'](_0x4084('0x11'),auth['isAuthenticated'](),controller['getCustomFields']);router[_0x4084('0x7')](_0x4084('0x12'),auth[_0x4084('0x9')](),controller[_0x4084('0x13')]);router[_0x4084('0x14')]('/',auth[_0x4084('0x9')](),controller[_0x4084('0x15')]);router[_0x4084('0x14')](_0x4084('0x16'),auth[_0x4084('0x9')](),controller[_0x4084('0x17')]);router['post']('/:id/contacts',auth[_0x4084('0x9')](),controller[_0x4084('0x18')]);router[_0x4084('0x14')](_0x4084('0x11'),auth['isAuthenticated'](),controller[_0x4084('0x19')]);router[_0x4084('0x14')]('/:id/users',auth['isAuthenticated'](),controller[_0x4084('0x1a')]);router[_0x4084('0x1b')](_0x4084('0x1c'),auth['isAuthenticated'](),controller[_0x4084('0x1d')]);router['delete']('/:id',auth[_0x4084('0x9')](),controller[_0x4084('0x1e')]);router[_0x4084('0x1f')](_0x4084('0x16'),auth[_0x4084('0x9')](),controller[_0x4084('0x20')]);router[_0x4084('0x1f')](_0x4084('0x12'),auth[_0x4084('0x9')](),controller[_0x4084('0x21')]);module[_0x4084('0x22')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index e892c71..a9b70e7 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 _0xab64=['STRING','VIRTUAL','getDataValue','field'];(function(_0x43d16c,_0x2b5447){var _0x208cce=function(_0x371720){while(--_0x371720){_0x43d16c['push'](_0x43d16c['shift']());}};_0x208cce(++_0x2b5447);}(_0xab64,0x85));var _0x4ab6=function(_0x5ba025,_0x3828d1){_0x5ba025=_0x5ba025-0x0;var _0x1306ba=_0xab64[_0x5ba025];return _0x1306ba;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4ab6('0x0')],'get':function(_0x5ae487){return this[_0x4ab6('0x1')](_0x4ab6('0x2'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x4ab6('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0x4ab6('0x3')],'allowNull':![]}}; \ No newline at end of file +var _0x56f9=['VIRTUAL','STRING','sequelize','exports'];(function(_0x152e53,_0xf6761e){var _0x37a703=function(_0x553962){while(--_0x553962){_0x152e53['push'](_0x152e53['shift']());}};_0x37a703(++_0xf6761e);}(_0x56f9,0x10a));var _0x956f=function(_0xb2133b,_0x277c58){_0xb2133b=_0xb2133b-0x0;var _0x257df6=_0x56f9[_0xb2133b];return _0x257df6;};'use strict';var Sequelize=require(_0x956f('0x0'));module[_0x956f('0x1')]={'name':{'type':Sequelize[_0x956f('0x2')],'get':function(_0x10a5ab){return this['getDataValue']('field');}},'field':{'type':Sequelize[_0x956f('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0x956f('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0x956f('0x3')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index dc0e096..2272879 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x441de2,_0x569766){var _0xdd1902=function(_0x44025d){while(--_0x44025d){_0x441de2['push'](_0x441de2['shift']());}};_0xdd1902(++_0x569766);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file +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(_0x49d1f7,_0x442482){var _0x56b11c=function(_0x45c15e){while(--_0x45c15e){_0x49d1f7['push'](_0x49d1f7['shift']());}};_0x56b11c(++_0x442482);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index b258ba0..be34db3 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 _0x5185=['request-promise','path','rimraf','../../config/environment','./condition.attributes','exports','define','tools_conditions','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x38a155,_0x2aa026){var _0x269403=function(_0x47263b){while(--_0x47263b){_0x38a155['push'](_0x38a155['shift']());}};_0x269403(++_0x2aa026);}(_0x5185,0x112));var _0x5518=function(_0x37c8f6,_0x344659){_0x37c8f6=_0x37c8f6-0x0;var _0x5b995f=_0x5185[_0x37c8f6];return _0x5b995f;};'use strict';var _=require(_0x5518('0x0'));var util=require(_0x5518('0x1'));var logger=require(_0x5518('0x2'))(_0x5518('0x3'));var moment=require(_0x5518('0x4'));var BPromise=require(_0x5518('0x5'));var rp=require(_0x5518('0x6'));var fs=require('fs');var path=require(_0x5518('0x7'));var rimraf=require(_0x5518('0x8'));var config=require(_0x5518('0x9'));var attributes=require(_0x5518('0xa'));module[_0x5518('0xb')]=function(_0x22a28f,_0x404f6f){return _0x22a28f[_0x5518('0xc')]('Condition',attributes,{'tableName':_0x5518('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x024f=['path','./condition.attributes','exports','Condition','tools_conditions','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3f503c,_0x212ce4){var _0x1e9eae=function(_0x137c35){while(--_0x137c35){_0x3f503c['push'](_0x3f503c['shift']());}};_0x1e9eae(++_0x212ce4);}(_0x024f,0x16d));var _0xf024=function(_0x262548,_0x43479b){_0x262548=_0x262548-0x0;var _0x495d88=_0x024f[_0x262548];return _0x495d88;};'use strict';var _=require(_0xf024('0x0'));var util=require(_0xf024('0x1'));var logger=require(_0xf024('0x2'))(_0xf024('0x3'));var moment=require(_0xf024('0x4'));var BPromise=require(_0xf024('0x5'));var rp=require(_0xf024('0x6'));var fs=require('fs');var path=require(_0xf024('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf024('0x8'));module[_0xf024('0x9')]=function(_0x31f341,_0x2ed270){return _0x31f341['define'](_0xf024('0xa'),attributes,{'tableName':_0xf024('0xb'),'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 1e16b38..c47da0a 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 _0x7b0a=['bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','Condition,\x20%s,\x20%s','request\x20sent','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','moment'];(function(_0x943277,_0x253cad){var _0x5c4179=function(_0x377f48){while(--_0x377f48){_0x943277['push'](_0x943277['shift']());}};_0x5c4179(++_0x253cad);}(_0x7b0a,0xd7));var _0xa7b0=function(_0xad6129,_0x633ff0){_0xad6129=_0xad6129-0x0;var _0x5340a9=_0x7b0a[_0xad6129];return _0x5340a9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa7b0('0x0'));var BPromise=require(_0xa7b0('0x1'));var rs=require(_0xa7b0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa7b0('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa7b0('0x4'))('rpc');var config=require(_0xa7b0('0x5'));var jayson=require(_0xa7b0('0x6'));var client=jayson[_0xa7b0('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x374494,_0x46a832,_0x32aea0){return new BPromise(function(_0x16248b,_0x1385f5){return client[_0xa7b0('0x8')](_0x374494,_0x32aea0)['then'](function(_0x5e6285){logger['info'](_0xa7b0('0x9'),_0x46a832,_0xa7b0('0xa'));logger['debug'](_0xa7b0('0xb'),_0x46a832,_0xa7b0('0xa'),JSON[_0xa7b0('0xc')](_0x5e6285));if(_0x5e6285['error']){if(_0x5e6285[_0xa7b0('0xd')][_0xa7b0('0xe')]===0x1f4){logger[_0xa7b0('0xd')]('Condition,\x20%s,\x20%s',_0x46a832,_0x5e6285[_0xa7b0('0xd')][_0xa7b0('0xf')]);return _0x1385f5(_0x5e6285[_0xa7b0('0xd')][_0xa7b0('0xf')]);}logger['error'](_0xa7b0('0x9'),_0x46a832,_0x5e6285[_0xa7b0('0xd')][_0xa7b0('0xf')]);return _0x16248b(_0x5e6285[_0xa7b0('0xd')][_0xa7b0('0xf')]);}else{logger[_0xa7b0('0x10')]('Condition,\x20%s,\x20%s',_0x46a832,_0xa7b0('0xa'));_0x16248b(_0x5e6285[_0xa7b0('0x11')]['message']);}})['catch'](function(_0x55dc88){logger[_0xa7b0('0xd')](_0xa7b0('0x9'),_0x46a832,_0x55dc88);_0x1385f5(_0x55dc88);});});} \ No newline at end of file +var _0xf49a=['result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x3ff4a3,_0xa5bfa6){var _0x38676f=function(_0x3ab2b1){while(--_0x3ab2b1){_0x3ff4a3['push'](_0x3ff4a3['shift']());}};_0x38676f(++_0xa5bfa6);}(_0xf49a,0x1f0));var _0xaf49=function(_0x4694a0,_0x35b97f){_0x4694a0=_0x4694a0-0x0;var _0x38a2dc=_0xf49a[_0x4694a0];return _0x38a2dc;};'use strict';var _=require('lodash');var util=require(_0xaf49('0x0'));var moment=require('moment');var BPromise=require(_0xaf49('0x1'));var rs=require(_0xaf49('0x2'));var fs=require('fs');var Redis=require(_0xaf49('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xaf49('0x4'));var logger=require(_0xaf49('0x5'))(_0xaf49('0x6'));var config=require('../../config/environment');var jayson=require(_0xaf49('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x125384,_0x22c468,_0x3ba11c){return new BPromise(function(_0x3c889c,_0x54be90){return client['request'](_0x125384,_0x3ba11c)[_0xaf49('0x8')](function(_0xd6ffe4){logger[_0xaf49('0x9')](_0xaf49('0xa'),_0x22c468,_0xaf49('0xb'));logger[_0xaf49('0xc')](_0xaf49('0xd'),_0x22c468,_0xaf49('0xb'),JSON['stringify'](_0xd6ffe4));if(_0xd6ffe4[_0xaf49('0xe')]){if(_0xd6ffe4['error'][_0xaf49('0xf')]===0x1f4){logger[_0xaf49('0xe')]('Condition,\x20%s,\x20%s',_0x22c468,_0xd6ffe4[_0xaf49('0xe')][_0xaf49('0x10')]);return _0x54be90(_0xd6ffe4[_0xaf49('0xe')][_0xaf49('0x10')]);}logger['error'](_0xaf49('0xa'),_0x22c468,_0xd6ffe4['error']['message']);return _0x3c889c(_0xd6ffe4[_0xaf49('0xe')]['message']);}else{logger[_0xaf49('0x9')](_0xaf49('0xa'),_0x22c468,_0xaf49('0xb'));_0x3c889c(_0xd6ffe4[_0xaf49('0x11')][_0xaf49('0x10')]);}})[_0xaf49('0x12')](function(_0x1cc6fd){logger['error'](_0xaf49('0xa'),_0x22c468,_0x1cc6fd);_0x54be90(_0x1cc6fd);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 9f0f450..20697bd 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 _0xfebf=['delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','put','/:id','isAuthenticated'];(function(_0x1f5612,_0x525a31){var _0x4af208=function(_0x9417f9){while(--_0x9417f9){_0x1f5612['push'](_0x1f5612['shift']());}};_0x4af208(++_0x525a31);}(_0xfebf,0x1b4));var _0xffeb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfebf[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xffeb('0x0'));var util=require(_0xffeb('0x1'));var path=require(_0xffeb('0x2'));var timeout=require(_0xffeb('0x3'));var express=require(_0xffeb('0x4'));var router=express[_0xffeb('0x5')]();var fs_extra=require(_0xffeb('0x6'));var auth=require(_0xffeb('0x7'));var interaction=require(_0xffeb('0x8'));var config=require('../../config/environment');var controller=require('./condition.controller');router[_0xffeb('0x9')](_0xffeb('0xa'),auth[_0xffeb('0xb')](),controller['update']);router[_0xffeb('0xc')](_0xffeb('0xa'),auth[_0xffeb('0xb')](),controller['destroy']);module[_0xffeb('0xd')]=router; \ No newline at end of file +var _0x1ebb=['update','delete','isAuthenticated','destroy','exports','util','path','connect-timeout','express','Router','../../config/environment','./condition.controller','put','/:id'];(function(_0x2eac4f,_0x5173f9){var _0x58f73b=function(_0x529f28){while(--_0x529f28){_0x2eac4f['push'](_0x2eac4f['shift']());}};_0x58f73b(++_0x5173f9);}(_0x1ebb,0x75));var _0xb1eb=function(_0x5bfae8,_0x471a61){_0x5bfae8=_0x5bfae8-0x0;var _0x51dd7b=_0x1ebb[_0x5bfae8];return _0x51dd7b;};'use strict';var multer=require('multer');var util=require(_0xb1eb('0x0'));var path=require(_0xb1eb('0x1'));var timeout=require(_0xb1eb('0x2'));var express=require(_0xb1eb('0x3'));var router=express[_0xb1eb('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb1eb('0x5'));var controller=require(_0xb1eb('0x6'));router[_0xb1eb('0x7')](_0xb1eb('0x8'),auth['isAuthenticated'](),controller[_0xb1eb('0x9')]);router[_0xb1eb('0xa')](_0xb1eb('0x8'),auth[_0xb1eb('0xb')](),controller[_0xb1eb('0xc')]);module[_0xb1eb('0xd')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index f5b0290..d25a681 100644 --- a/server/api/contactItemType/contactItemType.attributes.js +++ b/server/api/contactItemType/contactItemType.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xff9e=['STRING','name','INTEGER','sequelize','exports'];(function(_0xaec9b8,_0x5eb035){var _0x35ff86=function(_0x5b43f5){while(--_0x5b43f5){_0xaec9b8['push'](_0xaec9b8['shift']());}};_0x35ff86(++_0x5eb035);}(_0xff9e,0xe9));var _0xeff9=function(_0x1dce2a,_0x3dce33){_0x1dce2a=_0x1dce2a-0x0;var _0x42f7e5=_0xff9e[_0x1dce2a];return _0x42f7e5;};'use strict';var Sequelize=require(_0xeff9('0x0'));module[_0xeff9('0x1')]={'name':{'type':Sequelize[_0xeff9('0x2')],'allowNull':![],'unique':_0xeff9('0x3')},'OrderBy':{'type':Sequelize[_0xeff9('0x4')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0xa0f7=['name','INTEGER','STRING'];(function(_0x1247a8,_0x16755c){var _0x2daeaf=function(_0x28db82){while(--_0x28db82){_0x1247a8['push'](_0x1247a8['shift']());}};_0x2daeaf(++_0x16755c);}(_0xa0f7,0xba));var _0x7a0f=function(_0x4bbbb7,_0x331854){_0x4bbbb7=_0x4bbbb7-0x0;var _0x1c8926=_0xa0f7[_0x4bbbb7];return _0x1c8926;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7a0f('0x0')},'OrderBy':{'type':Sequelize[_0x7a0f('0x1')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x7a0f('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 7a9651d..ce63746 100644 --- a/server/api/contactItemType/contactItemType.controller.js +++ b/server/api/contactItemType/contactItemType.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5c3c=['zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','limit','count','offset','Content-Range','json','apply','reject','save','update','then','get','destroy','error','stack','name','send','map','ContactItemType','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','where','merge','findAll','rows','catch','params','includeAll','include','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf'];(function(_0x2febc5,_0x31827e){var _0xdcd110=function(_0x50c3af){while(--_0x50c3af){_0x2febc5['push'](_0x2febc5['shift']());}};_0xdcd110(++_0x31827e);}(_0x5c3c,0x132));var _0xc5c3=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5c3c[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0xc5c3('0x0'));var rimraf=require(_0xc5c3('0x1'));var zipdir=require(_0xc5c3('0x2'));var jsonpatch=require(_0xc5c3('0x3'));var rp=require('request-promise');var moment=require(_0xc5c3('0x4'));var BPromise=require(_0xc5c3('0x5'));var Mustache=require(_0xc5c3('0x6'));var util=require(_0xc5c3('0x7'));var path=require(_0xc5c3('0x8'));var sox=require(_0xc5c3('0x9'));var csv=require(_0xc5c3('0xa'));var ejs=require(_0xc5c3('0xb'));var fs=require('fs');var fs_extra=require(_0xc5c3('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc5c3('0xd'));var deskjs=require(_0xc5c3('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc5c3('0xf'));var Papa=require(_0xc5c3('0x10'));var Redis=require('ioredis');var authService=require(_0xc5c3('0x11'));var qs=require(_0xc5c3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc5c3('0x13'));var logger=require(_0xc5c3('0x14'))(_0xc5c3('0x15'));var utils=require('../../config/utils');var config=require(_0xc5c3('0x16'));var licenseUtil=require(_0xc5c3('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b56e6,_0x44d2b9){_0x44d2b9=_0x44d2b9||0xcc;return function(_0x3f0f45){if(_0x3f0f45){return _0x2b56e6['sendStatus'](_0x44d2b9);}return _0x2b56e6[_0xc5c3('0x18')](_0x44d2b9)[_0xc5c3('0x19')]();};}function respondWithResult(_0x1488ab,_0x13a740){_0x13a740=_0x13a740||0xc8;return function(_0xc8a636){if(_0xc8a636){return _0x1488ab['status'](_0x13a740)['json'](_0xc8a636);}};}function respondWithFilteredResult(_0x4445ea,_0x577e1a){return function(_0x1bae87){if(_0x1bae87){var _0xef8b21=typeof _0x577e1a['offset']==='undefined'&&typeof _0x577e1a[_0xc5c3('0x1a')]==='undefined';var _0xa9bc84=_0x1bae87[_0xc5c3('0x1b')];var _0x2ff158=_0xef8b21?0x0:_0x577e1a[_0xc5c3('0x1c')];var _0x28bae6=_0xef8b21?_0x1bae87['count']:_0x577e1a[_0xc5c3('0x1c')]+_0x577e1a[_0xc5c3('0x1a')];var _0x123dba;if(_0x28bae6>=_0xa9bc84){_0x28bae6=_0xa9bc84;_0x123dba=0xc8;}else{_0x123dba=0xce;}_0x4445ea[_0xc5c3('0x18')](_0x123dba);return _0x4445ea['set'](_0xc5c3('0x1d'),_0x2ff158+'-'+_0x28bae6+'/'+_0xa9bc84)[_0xc5c3('0x1e')](_0x1bae87);}return null;};}function patchUpdates(_0x3cc612){return function(_0x3ca20a){try{jsonpatch[_0xc5c3('0x1f')](_0x3ca20a,_0x3cc612,!![]);}catch(_0x564815){return BPromise[_0xc5c3('0x20')](_0x564815);}return _0x3ca20a[_0xc5c3('0x21')]();};}function saveUpdates(_0x370254,_0x2de266){return function(_0x1c5793){if(_0x1c5793){return _0x1c5793[_0xc5c3('0x22')](_0x370254)[_0xc5c3('0x23')](function(_0x5996a0){return _0x5996a0;});}return null;};}function removeEntity(_0x52d638,_0x45affe){return function(_0x38dd9e){if(_0x38dd9e){return _0x38dd9e['destroy']()['then'](function(){var _0x23e2fb=_0x38dd9e[_0xc5c3('0x24')]({'plain':!![]});var _0x38a3df='ContactItemTypes';return db['UserProfileResource'][_0xc5c3('0x25')]({'where':{'type':_0x38a3df,'resourceId':_0x23e2fb['id']}})[_0xc5c3('0x23')](function(){return _0x38dd9e;});})[_0xc5c3('0x23')](function(){_0x52d638[_0xc5c3('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21efd6,_0x5176c4){return function(_0x2eacec){if(!_0x2eacec){_0x21efd6['sendStatus'](0x194);}return _0x2eacec;};}function handleError(_0x1da259,_0x40d341){_0x40d341=_0x40d341||0x1f4;return function(_0x4269eb){logger[_0xc5c3('0x26')](_0x4269eb[_0xc5c3('0x27')]);if(_0x4269eb[_0xc5c3('0x28')]){delete _0x4269eb[_0xc5c3('0x28')];}_0x1da259['status'](_0x40d341)[_0xc5c3('0x29')](_0x4269eb);};}exports['index']=function(_0xc4b134,_0x43ebfc){var _0x5b26e9={},_0x4daa8b={},_0x2e648f={'count':0x0,'rows':[]};var _0x46f149=_[_0xc5c3('0x2a')](db[_0xc5c3('0x2b')]['rawAttributes'],function(_0x3f9591){return{'name':_0x3f9591[_0xc5c3('0x2c')],'type':_0x3f9591[_0xc5c3('0x2d')][_0xc5c3('0x2e')]};});_0x4daa8b[_0xc5c3('0x2f')]=_[_0xc5c3('0x2a')](_0x46f149,_0xc5c3('0x28'));_0x4daa8b[_0xc5c3('0x30')]=_[_0xc5c3('0x31')](_0xc4b134['query']);_0x4daa8b[_0xc5c3('0x32')]=_[_0xc5c3('0x33')](_0x4daa8b[_0xc5c3('0x2f')],_0x4daa8b[_0xc5c3('0x30')]);_0x5b26e9[_0xc5c3('0x34')]=_[_0xc5c3('0x33')](_0x4daa8b[_0xc5c3('0x2f')],qs['fields'](_0xc4b134['query'][_0xc5c3('0x35')]));_0x5b26e9['attributes']=_0x5b26e9[_0xc5c3('0x34')][_0xc5c3('0x36')]?_0x5b26e9[_0xc5c3('0x34')]:_0x4daa8b[_0xc5c3('0x2f')];if(!_0xc4b134[_0xc5c3('0x30')]['hasOwnProperty'](_0xc5c3('0x37'))){_0x5b26e9[_0xc5c3('0x1a')]=qs['limit'](_0xc4b134[_0xc5c3('0x30')][_0xc5c3('0x1a')]);_0x5b26e9[_0xc5c3('0x1c')]=qs[_0xc5c3('0x1c')](_0xc4b134[_0xc5c3('0x30')][_0xc5c3('0x1c')]);}_0x5b26e9[_0xc5c3('0x38')]=qs[_0xc5c3('0x39')](_0xc4b134[_0xc5c3('0x30')][_0xc5c3('0x39')]);_0x5b26e9['where']=qs[_0xc5c3('0x32')](_['pick'](_0xc4b134['query'],_0x4daa8b[_0xc5c3('0x32')]),_0x46f149);if(_0xc4b134[_0xc5c3('0x30')][_0xc5c3('0x3a')]){_0x5b26e9[_0xc5c3('0x3b')]=_[_0xc5c3('0x3c')](_0x5b26e9['where'],{'$or':_['map'](_0x46f149,function(_0x17e263){if(_0x17e263[_0xc5c3('0x2d')]!=='VIRTUAL'){var _0x3e12ee={};_0x3e12ee[_0x17e263['name']]={'$like':'%'+_0xc4b134[_0xc5c3('0x30')][_0xc5c3('0x3a')]+'%'};return _0x3e12ee;}})});}_0x5b26e9=_[_0xc5c3('0x3c')]({},_0x5b26e9,_0xc4b134['options']);var _0xca2b9a={'where':_0x5b26e9[_0xc5c3('0x3b')]};return db['ContactItemType'][_0xc5c3('0x1b')](_0xca2b9a)['then'](function(_0x33936c){_0x2e648f[_0xc5c3('0x1b')]=_0x33936c;if(_0xc4b134['query']['includeAll']){_0x5b26e9['include']=[{'all':!![]}];}return db[_0xc5c3('0x2b')][_0xc5c3('0x3d')](_0x5b26e9);})['then'](function(_0x1a8490){_0x2e648f[_0xc5c3('0x3e')]=_0x1a8490;return _0x2e648f;})[_0xc5c3('0x23')](respondWithFilteredResult(_0x43ebfc,_0x5b26e9))[_0xc5c3('0x3f')](handleError(_0x43ebfc,null));};exports['show']=function(_0x3688a9,_0x523fdf){var _0x585a3b={'raw':!![],'where':{'id':_0x3688a9[_0xc5c3('0x40')]['id']}},_0x1363fa={};_0x1363fa['model']=_[_0xc5c3('0x31')](db[_0xc5c3('0x2b')]['rawAttributes']);_0x1363fa[_0xc5c3('0x30')]=_['keys'](_0x3688a9[_0xc5c3('0x30')]);_0x1363fa[_0xc5c3('0x32')]=_['intersection'](_0x1363fa[_0xc5c3('0x2f')],_0x1363fa['query']);_0x585a3b[_0xc5c3('0x34')]=_[_0xc5c3('0x33')](_0x1363fa['model'],qs[_0xc5c3('0x35')](_0x3688a9[_0xc5c3('0x30')][_0xc5c3('0x35')]));_0x585a3b[_0xc5c3('0x34')]=_0x585a3b[_0xc5c3('0x34')][_0xc5c3('0x36')]?_0x585a3b['attributes']:_0x1363fa[_0xc5c3('0x2f')];if(_0x3688a9[_0xc5c3('0x30')][_0xc5c3('0x41')]){_0x585a3b[_0xc5c3('0x42')]=[{'all':!![]}];}_0x585a3b=_[_0xc5c3('0x3c')]({},_0x585a3b,_0x3688a9['options']);return db['ContactItemType'][_0xc5c3('0x43')](_0x585a3b)[_0xc5c3('0x23')](handleEntityNotFound(_0x523fdf,null))[_0xc5c3('0x23')](respondWithResult(_0x523fdf,null))['catch'](handleError(_0x523fdf,null));};exports[_0xc5c3('0x44')]=function(_0x65f720,_0x3a901f){return db[_0xc5c3('0x2b')][_0xc5c3('0x44')](_0x65f720[_0xc5c3('0x45')],{})[_0xc5c3('0x23')](function(_0x5ac7c8){var _0x259a4d=_0x65f720[_0xc5c3('0x46')][_0xc5c3('0x24')]({'plain':!![]});if(!_0x259a4d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x259a4d[_0xc5c3('0x47')]===_0xc5c3('0x46')){var _0x3b1bc2=_0x5ac7c8[_0xc5c3('0x24')]({'plain':!![]});var _0x21d480='ContactItemTypes';return db[_0xc5c3('0x48')]['find']({'where':{'name':_0x21d480,'userProfileId':_0x259a4d[_0xc5c3('0x49')]},'raw':!![]})['then'](function(_0x2f7a0a){if(_0x2f7a0a&&_0x2f7a0a[_0xc5c3('0x4a')]===0x0){return db[_0xc5c3('0x4b')][_0xc5c3('0x44')]({'name':_0x3b1bc2[_0xc5c3('0x28')],'resourceId':_0x3b1bc2['id'],'type':_0x2f7a0a['name'],'sectionId':_0x2f7a0a['id']},{})[_0xc5c3('0x23')](function(){return _0x5ac7c8;});}else{return _0x5ac7c8;}})[_0xc5c3('0x3f')](function(_0x348960){logger[_0xc5c3('0x26')](_0xc5c3('0x4c'),_0x348960);throw _0x348960;});}return _0x5ac7c8;})['then'](respondWithResult(_0x3a901f,0xc9))[_0xc5c3('0x3f')](handleError(_0x3a901f,null));};exports[_0xc5c3('0x22')]=function(_0x24ef39,_0x4d1ff8){if(_0x24ef39[_0xc5c3('0x45')]['id']){delete _0x24ef39['body']['id'];}return db['ContactItemType'][_0xc5c3('0x43')]({'where':{'id':_0x24ef39[_0xc5c3('0x40')]['id']}})[_0xc5c3('0x23')](handleEntityNotFound(_0x4d1ff8,null))[_0xc5c3('0x23')](saveUpdates(_0x24ef39[_0xc5c3('0x45')],null))[_0xc5c3('0x23')](respondWithResult(_0x4d1ff8,null))['catch'](handleError(_0x4d1ff8,null));};exports[_0xc5c3('0x25')]=function(_0x1ad3aa,_0x260f12){return db[_0xc5c3('0x2b')][_0xc5c3('0x43')]({'where':{'id':_0x1ad3aa[_0xc5c3('0x40')]['id']}})[_0xc5c3('0x23')](handleEntityNotFound(_0x260f12,null))['then'](db['CmContactHasItem'][_0xc5c3('0x22')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x1ad3aa[_0xc5c3('0x40')]['id']}}))['then'](removeEntity(_0x260f12,null))[_0xc5c3('0x3f')](handleError(_0x260f12,null));}; \ No newline at end of file +var _0x5fdc=['destroy','get','ContactItemTypes','error','name','send','index','ContactItemType','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','merge','where','options','includeAll','include','catch','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','CmContactHasItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','update','then'];(function(_0x31e945,_0x42fa0c){var _0x5a110e=function(_0x15e817){while(--_0x15e817){_0x31e945['push'](_0x31e945['shift']());}};_0x5a110e(++_0x42fa0c);}(_0x5fdc,0x127));var _0xc5fd=function(_0x1eccf3,_0x21d021){_0x1eccf3=_0x1eccf3-0x0;var _0x442a61=_0x5fdc[_0x1eccf3];return _0x442a61;};'use strict';var emlformat=require(_0xc5fd('0x0'));var rimraf=require(_0xc5fd('0x1'));var zipdir=require(_0xc5fd('0x2'));var jsonpatch=require(_0xc5fd('0x3'));var rp=require(_0xc5fd('0x4'));var moment=require(_0xc5fd('0x5'));var BPromise=require(_0xc5fd('0x6'));var Mustache=require(_0xc5fd('0x7'));var util=require(_0xc5fd('0x8'));var path=require(_0xc5fd('0x9'));var sox=require(_0xc5fd('0xa'));var csv=require(_0xc5fd('0xb'));var ejs=require(_0xc5fd('0xc'));var fs=require('fs');var fs_extra=require(_0xc5fd('0xd'));var _=require(_0xc5fd('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc5fd('0xf'));var toCsv=require(_0xc5fd('0xb'));var querystring=require(_0xc5fd('0x10'));var Papa=require(_0xc5fd('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc5fd('0x12'));var as=require(_0xc5fd('0x13'));var hardwareService=require(_0xc5fd('0x14'));var logger=require(_0xc5fd('0x15'))(_0xc5fd('0x16'));var utils=require(_0xc5fd('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xc5fd('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x558939,_0x1b1b2b){_0x1b1b2b=_0x1b1b2b||0xcc;return function(_0x1bc6d1){if(_0x1bc6d1){return _0x558939[_0xc5fd('0x19')](_0x1b1b2b);}return _0x558939[_0xc5fd('0x1a')](_0x1b1b2b)[_0xc5fd('0x1b')]();};}function respondWithResult(_0x40b0f8,_0x27447e){_0x27447e=_0x27447e||0xc8;return function(_0xa7a954){if(_0xa7a954){return _0x40b0f8['status'](_0x27447e)[_0xc5fd('0x1c')](_0xa7a954);}};}function respondWithFilteredResult(_0x103c3d,_0x2221da){return function(_0x3404e0){if(_0x3404e0){var _0x4d3636=typeof _0x2221da['offset']==='undefined'&&typeof _0x2221da['limit']==='undefined';var _0x35a9d0=_0x3404e0[_0xc5fd('0x1d')];var _0x27f611=_0x4d3636?0x0:_0x2221da[_0xc5fd('0x1e')];var _0x2ee392=_0x4d3636?_0x3404e0[_0xc5fd('0x1d')]:_0x2221da[_0xc5fd('0x1e')]+_0x2221da['limit'];var _0xb7bab1;if(_0x2ee392>=_0x35a9d0){_0x2ee392=_0x35a9d0;_0xb7bab1=0xc8;}else{_0xb7bab1=0xce;}_0x103c3d[_0xc5fd('0x1a')](_0xb7bab1);return _0x103c3d[_0xc5fd('0x1f')](_0xc5fd('0x20'),_0x27f611+'-'+_0x2ee392+'/'+_0x35a9d0)[_0xc5fd('0x1c')](_0x3404e0);}return null;};}function patchUpdates(_0x48024e){return function(_0x3966a2){try{jsonpatch[_0xc5fd('0x21')](_0x3966a2,_0x48024e,!![]);}catch(_0x18048e){return BPromise[_0xc5fd('0x22')](_0x18048e);}return _0x3966a2['save']();};}function saveUpdates(_0x4c85d5,_0x13cc42){return function(_0x2ab935){if(_0x2ab935){return _0x2ab935[_0xc5fd('0x23')](_0x4c85d5)[_0xc5fd('0x24')](function(_0x334401){return _0x334401;});}return null;};}function removeEntity(_0x311952,_0x56d473){return function(_0x1a3f21){if(_0x1a3f21){return _0x1a3f21[_0xc5fd('0x25')]()[_0xc5fd('0x24')](function(){var _0x18c9c7=_0x1a3f21[_0xc5fd('0x26')]({'plain':!![]});var _0x4020af=_0xc5fd('0x27');return db['UserProfileResource'][_0xc5fd('0x25')]({'where':{'type':_0x4020af,'resourceId':_0x18c9c7['id']}})['then'](function(){return _0x1a3f21;});})[_0xc5fd('0x24')](function(){_0x311952[_0xc5fd('0x1a')](0xcc)[_0xc5fd('0x1b')]();});}};}function handleEntityNotFound(_0x2bee22,_0x5cafd3){return function(_0x176313){if(!_0x176313){_0x2bee22[_0xc5fd('0x19')](0x194);}return _0x176313;};}function handleError(_0x19c4a0,_0x42cbf0){_0x42cbf0=_0x42cbf0||0x1f4;return function(_0x19df33){logger[_0xc5fd('0x28')](_0x19df33['stack']);if(_0x19df33[_0xc5fd('0x29')]){delete _0x19df33['name'];}_0x19c4a0['status'](_0x42cbf0)[_0xc5fd('0x2a')](_0x19df33);};}exports[_0xc5fd('0x2b')]=function(_0x39b21a,_0x38db1d){var _0x7693c4={},_0x85fa81={},_0x2a891d={'count':0x0,'rows':[]};var _0x321eea=_['map'](db[_0xc5fd('0x2c')][_0xc5fd('0x2d')],function(_0x6bb14d){return{'name':_0x6bb14d[_0xc5fd('0x2e')],'type':_0x6bb14d[_0xc5fd('0x2f')][_0xc5fd('0x30')]};});_0x85fa81[_0xc5fd('0x31')]=_[_0xc5fd('0x32')](_0x321eea,_0xc5fd('0x29'));_0x85fa81[_0xc5fd('0x33')]=_[_0xc5fd('0x34')](_0x39b21a[_0xc5fd('0x33')]);_0x85fa81['filters']=_[_0xc5fd('0x35')](_0x85fa81[_0xc5fd('0x31')],_0x85fa81[_0xc5fd('0x33')]);_0x7693c4[_0xc5fd('0x36')]=_[_0xc5fd('0x35')](_0x85fa81[_0xc5fd('0x31')],qs[_0xc5fd('0x37')](_0x39b21a[_0xc5fd('0x33')][_0xc5fd('0x37')]));_0x7693c4['attributes']=_0x7693c4[_0xc5fd('0x36')][_0xc5fd('0x38')]?_0x7693c4[_0xc5fd('0x36')]:_0x85fa81[_0xc5fd('0x31')];if(!_0x39b21a[_0xc5fd('0x33')][_0xc5fd('0x39')](_0xc5fd('0x3a'))){_0x7693c4['limit']=qs[_0xc5fd('0x3b')](_0x39b21a[_0xc5fd('0x33')]['limit']);_0x7693c4[_0xc5fd('0x1e')]=qs['offset'](_0x39b21a[_0xc5fd('0x33')][_0xc5fd('0x1e')]);}_0x7693c4[_0xc5fd('0x3c')]=qs['sort'](_0x39b21a[_0xc5fd('0x33')][_0xc5fd('0x3d')]);_0x7693c4['where']=qs[_0xc5fd('0x3e')](_[_0xc5fd('0x3f')](_0x39b21a[_0xc5fd('0x33')],_0x85fa81[_0xc5fd('0x3e')]),_0x321eea);if(_0x39b21a[_0xc5fd('0x33')][_0xc5fd('0x40')]){_0x7693c4['where']=_[_0xc5fd('0x41')](_0x7693c4[_0xc5fd('0x42')],{'$or':_[_0xc5fd('0x32')](_0x321eea,function(_0x2a368e){if(_0x2a368e['type']!=='VIRTUAL'){var _0x47fe66={};_0x47fe66[_0x2a368e[_0xc5fd('0x29')]]={'$like':'%'+_0x39b21a[_0xc5fd('0x33')][_0xc5fd('0x40')]+'%'};return _0x47fe66;}})});}_0x7693c4=_[_0xc5fd('0x41')]({},_0x7693c4,_0x39b21a[_0xc5fd('0x43')]);var _0x33514d={'where':_0x7693c4[_0xc5fd('0x42')]};return db[_0xc5fd('0x2c')][_0xc5fd('0x1d')](_0x33514d)['then'](function(_0x5a2199){_0x2a891d[_0xc5fd('0x1d')]=_0x5a2199;if(_0x39b21a['query'][_0xc5fd('0x44')]){_0x7693c4[_0xc5fd('0x45')]=[{'all':!![]}];}return db[_0xc5fd('0x2c')]['findAll'](_0x7693c4);})[_0xc5fd('0x24')](function(_0x350753){_0x2a891d['rows']=_0x350753;return _0x2a891d;})[_0xc5fd('0x24')](respondWithFilteredResult(_0x38db1d,_0x7693c4))[_0xc5fd('0x46')](handleError(_0x38db1d,null));};exports['show']=function(_0x3e57da,_0x48c8d4){var _0x1297a1={'raw':!![],'where':{'id':_0x3e57da['params']['id']}},_0x17ce12={};_0x17ce12[_0xc5fd('0x31')]=_[_0xc5fd('0x34')](db[_0xc5fd('0x2c')]['rawAttributes']);_0x17ce12[_0xc5fd('0x33')]=_[_0xc5fd('0x34')](_0x3e57da['query']);_0x17ce12['filters']=_[_0xc5fd('0x35')](_0x17ce12['model'],_0x17ce12['query']);_0x1297a1['attributes']=_[_0xc5fd('0x35')](_0x17ce12[_0xc5fd('0x31')],qs[_0xc5fd('0x37')](_0x3e57da[_0xc5fd('0x33')][_0xc5fd('0x37')]));_0x1297a1[_0xc5fd('0x36')]=_0x1297a1['attributes']['length']?_0x1297a1['attributes']:_0x17ce12[_0xc5fd('0x31')];if(_0x3e57da[_0xc5fd('0x33')][_0xc5fd('0x44')]){_0x1297a1['include']=[{'all':!![]}];}_0x1297a1=_[_0xc5fd('0x41')]({},_0x1297a1,_0x3e57da['options']);return db[_0xc5fd('0x2c')][_0xc5fd('0x47')](_0x1297a1)[_0xc5fd('0x24')](handleEntityNotFound(_0x48c8d4,null))[_0xc5fd('0x24')](respondWithResult(_0x48c8d4,null))[_0xc5fd('0x46')](handleError(_0x48c8d4,null));};exports[_0xc5fd('0x48')]=function(_0x54d86c,_0x6b2f77){return db[_0xc5fd('0x2c')]['create'](_0x54d86c['body'],{})[_0xc5fd('0x24')](function(_0x4eb26b){var _0x5723cb=_0x54d86c[_0xc5fd('0x49')][_0xc5fd('0x26')]({'plain':!![]});if(!_0x5723cb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5723cb[_0xc5fd('0x4a')]===_0xc5fd('0x49')){var _0x5c49e7=_0x4eb26b[_0xc5fd('0x26')]({'plain':!![]});var _0x346718=_0xc5fd('0x27');return db[_0xc5fd('0x4b')][_0xc5fd('0x47')]({'where':{'name':_0x346718,'userProfileId':_0x5723cb[_0xc5fd('0x4c')]},'raw':!![]})[_0xc5fd('0x24')](function(_0x26bae0){if(_0x26bae0&&_0x26bae0[_0xc5fd('0x4d')]===0x0){return db[_0xc5fd('0x4e')][_0xc5fd('0x48')]({'name':_0x5c49e7['name'],'resourceId':_0x5c49e7['id'],'type':_0x26bae0[_0xc5fd('0x29')],'sectionId':_0x26bae0['id']},{})[_0xc5fd('0x24')](function(){return _0x4eb26b;});}else{return _0x4eb26b;}})[_0xc5fd('0x46')](function(_0x4989ce){logger[_0xc5fd('0x28')](_0xc5fd('0x4f'),_0x4989ce);throw _0x4989ce;});}return _0x4eb26b;})[_0xc5fd('0x24')](respondWithResult(_0x6b2f77,0xc9))[_0xc5fd('0x46')](handleError(_0x6b2f77,null));};exports['update']=function(_0xcbd63b,_0x5b5ecd){if(_0xcbd63b['body']['id']){delete _0xcbd63b[_0xc5fd('0x50')]['id'];}return db[_0xc5fd('0x2c')][_0xc5fd('0x47')]({'where':{'id':_0xcbd63b[_0xc5fd('0x51')]['id']}})[_0xc5fd('0x24')](handleEntityNotFound(_0x5b5ecd,null))['then'](saveUpdates(_0xcbd63b['body'],null))[_0xc5fd('0x24')](respondWithResult(_0x5b5ecd,null))[_0xc5fd('0x46')](handleError(_0x5b5ecd,null));};exports['destroy']=function(_0x4e9495,_0x50e0c7){return db[_0xc5fd('0x2c')]['find']({'where':{'id':_0x4e9495[_0xc5fd('0x51')]['id']}})[_0xc5fd('0x24')](handleEntityNotFound(_0x50e0c7,null))[_0xc5fd('0x24')](db[_0xc5fd('0x52')][_0xc5fd('0x23')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x4e9495[_0xc5fd('0x51')]['id']}}))[_0xc5fd('0x24')](removeEntity(_0x50e0c7,null))['catch'](handleError(_0x50e0c7,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 1208e51..3099b58 100644 --- a/server/api/contactItemType/contactItemType.model.js +++ b/server/api/contactItemType/contactItemType.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x850a=['bluebird','request-promise','path','rimraf','../../config/environment','define','ContactItemType','tools_contact_item_types','lodash','util','api','moment'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0x850a,0x11c));var _0xa850=function(_0x54f493,_0x385811){_0x54f493=_0x54f493-0x0;var _0x5f2b47=_0x850a[_0x54f493];return _0x5f2b47;};'use strict';var _=require(_0xa850('0x0'));var util=require(_0xa850('0x1'));var logger=require('../../config/logger')(_0xa850('0x2'));var moment=require(_0xa850('0x3'));var BPromise=require(_0xa850('0x4'));var rp=require(_0xa850('0x5'));var fs=require('fs');var path=require(_0xa850('0x6'));var rimraf=require(_0xa850('0x7'));var config=require(_0xa850('0x8'));var attributes=require('./contactItemType.attributes');module['exports']=function(_0x46040c,_0x46a34a){return _0x46040c[_0xa850('0x9')](_0xa850('0xa'),attributes,{'tableName':_0xa850('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x90e7=['request-promise','path','../../config/environment','./contactItemType.attributes','exports','define','ContactItemType','tools_contact_item_types','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x46439c,_0x2fa662){var _0x5a6eae=function(_0x61fa9a){while(--_0x61fa9a){_0x46439c['push'](_0x46439c['shift']());}};_0x5a6eae(++_0x2fa662);}(_0x90e7,0x14a));var _0x790e=function(_0x1319a0,_0x893f48){_0x1319a0=_0x1319a0-0x0;var _0x5c86e4=_0x90e7[_0x1319a0];return _0x5c86e4;};'use strict';var _=require(_0x790e('0x0'));var util=require(_0x790e('0x1'));var logger=require(_0x790e('0x2'))(_0x790e('0x3'));var moment=require(_0x790e('0x4'));var BPromise=require(_0x790e('0x5'));var rp=require(_0x790e('0x6'));var fs=require('fs');var path=require(_0x790e('0x7'));var rimraf=require('rimraf');var config=require(_0x790e('0x8'));var attributes=require(_0x790e('0x9'));module[_0x790e('0xa')]=function(_0x250c6a,_0x1b3a8b){return _0x250c6a[_0x790e('0xb')](_0x790e('0xc'),attributes,{'tableName':_0x790e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.rpc.js b/server/api/contactItemType/contactItemType.rpc.js index 166a2ae..68cfab4 100644 --- a/server/api/contactItemType/contactItemType.rpc.js +++ b/server/api/contactItemType/contactItemType.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x93c6=['../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','bluebird','randomstring','ioredis'];(function(_0x280f4a,_0x2ed8d6){var _0x1bb157=function(_0x37de94){while(--_0x37de94){_0x280f4a['push'](_0x280f4a['shift']());}};_0x1bb157(++_0x2ed8d6);}(_0x93c6,0x1a0));var _0x693c=function(_0x33d341,_0x428489){_0x33d341=_0x33d341-0x0;var _0x1e975a=_0x93c6[_0x33d341];return _0x1e975a;};'use strict';var _=require('lodash');var util=require(_0x693c('0x0'));var moment=require('moment');var BPromise=require(_0x693c('0x1'));var rs=require(_0x693c('0x2'));var fs=require('fs');var Redis=require(_0x693c('0x3'));var db=require(_0x693c('0x4'))['db'];var utils=require(_0x693c('0x5'));var logger=require('../../config/logger')(_0x693c('0x6'));var config=require(_0x693c('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x693c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1da5e9,_0x3bd263,_0xf1289f){return new BPromise(function(_0x46274a,_0x49c59c){return client[_0x693c('0x9')](_0x1da5e9,_0xf1289f)[_0x693c('0xa')](function(_0xf8ab33){logger[_0x693c('0xb')](_0x693c('0xc'),_0x3bd263,_0x693c('0xd'));logger[_0x693c('0xe')](_0x693c('0xf'),_0x3bd263,_0x693c('0xd'),JSON['stringify'](_0xf8ab33));if(_0xf8ab33['error']){if(_0xf8ab33[_0x693c('0x10')][_0x693c('0x11')]===0x1f4){logger[_0x693c('0x10')](_0x693c('0xc'),_0x3bd263,_0xf8ab33[_0x693c('0x10')][_0x693c('0x12')]);return _0x49c59c(_0xf8ab33[_0x693c('0x10')][_0x693c('0x12')]);}logger[_0x693c('0x10')](_0x693c('0xc'),_0x3bd263,_0xf8ab33['error'][_0x693c('0x12')]);return _0x46274a(_0xf8ab33[_0x693c('0x10')]['message']);}else{logger[_0x693c('0xb')](_0x693c('0xc'),_0x3bd263,_0x693c('0xd'));_0x46274a(_0xf8ab33[_0x693c('0x13')][_0x693c('0x12')]);}})[_0x693c('0x14')](function(_0x49fa36){logger[_0x693c('0x10')]('ContactItemType,\x20%s,\x20%s',_0x3bd263,_0x49fa36);_0x49c59c(_0x49fa36);});});} \ No newline at end of file +var _0x5228=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x5228,0xcc));var _0x8522=function(_0x5f414a,_0x58572e){_0x5f414a=_0x5f414a-0x0;var _0x38688d=_0x5228[_0x5f414a];return _0x38688d;};'use strict';var _=require(_0x8522('0x0'));var util=require(_0x8522('0x1'));var moment=require(_0x8522('0x2'));var BPromise=require(_0x8522('0x3'));var rs=require(_0x8522('0x4'));var fs=require('fs');var Redis=require(_0x8522('0x5'));var db=require(_0x8522('0x6'))['db'];var utils=require(_0x8522('0x7'));var logger=require('../../config/logger')(_0x8522('0x8'));var config=require(_0x8522('0x9'));var jayson=require(_0x8522('0xa'));var client=jayson[_0x8522('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3cb4fb,_0x2dc5c2,_0x3a2d74){return new BPromise(function(_0x589b0a,_0x1ee542){return client[_0x8522('0xc')](_0x3cb4fb,_0x3a2d74)[_0x8522('0xd')](function(_0x41e8b2){logger[_0x8522('0xe')](_0x8522('0xf'),_0x2dc5c2,_0x8522('0x10'));logger[_0x8522('0x11')](_0x8522('0x12'),_0x2dc5c2,'request\x20sent',JSON[_0x8522('0x13')](_0x41e8b2));if(_0x41e8b2[_0x8522('0x14')]){if(_0x41e8b2[_0x8522('0x14')][_0x8522('0x15')]===0x1f4){logger[_0x8522('0x14')]('ContactItemType,\x20%s,\x20%s',_0x2dc5c2,_0x41e8b2[_0x8522('0x14')]['message']);return _0x1ee542(_0x41e8b2[_0x8522('0x14')]['message']);}logger['error']('ContactItemType,\x20%s,\x20%s',_0x2dc5c2,_0x41e8b2[_0x8522('0x14')][_0x8522('0x16')]);return _0x589b0a(_0x41e8b2[_0x8522('0x14')][_0x8522('0x16')]);}else{logger[_0x8522('0xe')]('ContactItemType,\x20%s,\x20%s',_0x2dc5c2,'request\x20sent');_0x589b0a(_0x41e8b2[_0x8522('0x17')]['message']);}})[_0x8522('0x18')](function(_0x1e8d83){logger['error'](_0x8522('0xf'),_0x2dc5c2,_0x1e8d83);_0x1ee542(_0x1e8d83);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index c7e6cb4..ffd9914 100644 --- a/server/api/contactItemType/index.js +++ b/server/api/contactItemType/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x692a=['../../components/interaction/service','../../config/environment','get','isAuthenticated','show','post','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x7060b3,_0x18c63e){var _0x5a78f3=function(_0x555f49){while(--_0x555f49){_0x7060b3['push'](_0x7060b3['shift']());}};_0x5a78f3(++_0x18c63e);}(_0x692a,0x160));var _0xa692=function(_0x3e93d2,_0x372043){_0x3e93d2=_0x3e93d2-0x0;var _0x14dd11=_0x692a[_0x3e93d2];return _0x14dd11;};'use strict';var multer=require(_0xa692('0x0'));var util=require(_0xa692('0x1'));var path=require(_0xa692('0x2'));var timeout=require(_0xa692('0x3'));var express=require(_0xa692('0x4'));var router=express[_0xa692('0x5')]();var fs_extra=require(_0xa692('0x6'));var auth=require(_0xa692('0x7'));var interaction=require(_0xa692('0x8'));var config=require(_0xa692('0x9'));var controller=require('./contactItemType.controller');router[_0xa692('0xa')]('/',auth[_0xa692('0xb')](),controller['index']);router[_0xa692('0xa')]('/:id',auth[_0xa692('0xb')](),controller[_0xa692('0xc')]);router[_0xa692('0xd')]('/',auth[_0xa692('0xb')](),controller[_0xa692('0xe')]);router[_0xa692('0xf')](_0xa692('0x10'),auth['isAuthenticated'](),controller[_0xa692('0x11')]);router[_0xa692('0x12')](_0xa692('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0xa692('0x13')]=router; \ No newline at end of file +var _0xb370=['multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','isAuthenticated','get','/:id','show','post','update','delete','destroy','exports'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xb370,0x10e));var _0x0b37=function(_0x1e29b9,_0x2144a3){_0x1e29b9=_0x1e29b9-0x0;var _0x2e3cfd=_0xb370[_0x1e29b9];return _0x2e3cfd;};'use strict';var multer=require(_0x0b37('0x0'));var util=require('util');var path=require(_0x0b37('0x1'));var timeout=require(_0x0b37('0x2'));var express=require(_0x0b37('0x3'));var router=express['Router']();var fs_extra=require(_0x0b37('0x4'));var auth=require(_0x0b37('0x5'));var interaction=require(_0x0b37('0x6'));var config=require(_0x0b37('0x7'));var controller=require(_0x0b37('0x8'));router['get']('/',auth[_0x0b37('0x9')](),controller['index']);router[_0x0b37('0xa')](_0x0b37('0xb'),auth[_0x0b37('0x9')](),controller[_0x0b37('0xc')]);router[_0x0b37('0xd')]('/',auth[_0x0b37('0x9')](),controller['create']);router['put'](_0x0b37('0xb'),auth[_0x0b37('0x9')](),controller[_0x0b37('0xe')]);router[_0x0b37('0xf')](_0x0b37('0xb'),auth[_0x0b37('0x9')](),controller[_0x0b37('0x10')]);module[_0x0b37('0x11')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 97f5632..94c492e 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 _0x757a=['exports','STRING'];(function(_0x17fe2b,_0x45c043){var _0x4ac54f=function(_0x13f4fc){while(--_0x13f4fc){_0x17fe2b['push'](_0x17fe2b['shift']());}};_0x4ac54f(++_0x45c043);}(_0x757a,0xde));var _0xa757=function(_0x530373,_0x51f0e6){_0x530373=_0x530373-0x0;var _0x494c3e=_0x757a[_0x530373];return _0x494c3e;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe706=['STRING','sequelize','exports'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xe706,0xa3));var _0x6e70=function(_0x155924,_0x2a5368){_0x155924=_0x155924-0x0;var _0x262e4b=_0xe706[_0x155924];return _0x262e4b;};'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 diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 072bda2..feacfa0 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 _0x7df9=['role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','includeAll','Unable\x20to\x20retrieve\x20the\x20current\x20user','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie2','attrSerie3','voice','attrWhatsappAccounts','web-report','reportType','attrReport','attrRefresh','stringify','DashboardId','DashboardItem','getItems','findOne','eml-format','rimraf','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','get','CustomDashboards','UserProfileResource','destroy','end','stack','name','index','map','fieldName','type','key','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','Dashboard','include','rows','catch','params','rawAttributes','find','create','body','user'];(function(_0x2dc09e,_0x5b0466){var _0x541327=function(_0x1b9e74){while(--_0x1b9e74){_0x2dc09e['push'](_0x2dc09e['shift']());}};_0x541327(++_0x5b0466);}(_0x7df9,0xae));var _0x97df=function(_0x324f07,_0x1ff7e3){_0x324f07=_0x324f07-0x0;var _0x33b31a=_0x7df9[_0x324f07];return _0x33b31a;};'use strict';var emlformat=require(_0x97df('0x0'));var rimraf=require(_0x97df('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x97df('0x2'));var moment=require('moment');var BPromise=require(_0x97df('0x3'));var Mustache=require(_0x97df('0x4'));var util=require(_0x97df('0x5'));var path=require(_0x97df('0x6'));var sox=require('sox');var csv=require(_0x97df('0x7'));var ejs=require(_0x97df('0x8'));var fs=require('fs');var fs_extra=require(_0x97df('0x9'));var _=require(_0x97df('0xa'));var squel=require(_0x97df('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x97df('0x7'));var querystring=require(_0x97df('0xc'));var Papa=require(_0x97df('0xd'));var Redis=require(_0x97df('0xe'));var authService=require(_0x97df('0xf'));var qs=require(_0x97df('0x10'));var as=require(_0x97df('0x11'));var hardwareService=require(_0x97df('0x12'));var logger=require('../../config/logger')(_0x97df('0x13'));var utils=require(_0x97df('0x14'));var config=require(_0x97df('0x15'));var licenseUtil=require(_0x97df('0x16'));var db=require(_0x97df('0x17'))['db'];config[_0x97df('0x18')]=_['defaults'](config[_0x97df('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x97df('0x19'))(new Redis(config[_0x97df('0x18')]));require('./dashboard.socket')[_0x97df('0x1a')](socket);function respondWithStatusCode(_0x3d82c1,_0x22bfa4){_0x22bfa4=_0x22bfa4||0xcc;return function(_0x33ec14){if(_0x33ec14){return _0x3d82c1[_0x97df('0x1b')](_0x22bfa4);}return _0x3d82c1[_0x97df('0x1c')](_0x22bfa4)['end']();};}function respondWithResult(_0x59c1f5,_0x962082){_0x962082=_0x962082||0xc8;return function(_0x3ad362){if(_0x3ad362){return _0x59c1f5[_0x97df('0x1c')](_0x962082)[_0x97df('0x1d')](_0x3ad362);}};}function respondWithFilteredResult(_0x1fbe5f,_0x116e11){return function(_0x3d2580){if(_0x3d2580){var _0x405f67=typeof _0x116e11[_0x97df('0x1e')]==='undefined'&&typeof _0x116e11[_0x97df('0x1f')]===_0x97df('0x20');var _0x18eb6c=_0x3d2580[_0x97df('0x21')];var _0x387c90=_0x405f67?0x0:_0x116e11[_0x97df('0x1e')];var _0x56447b=_0x405f67?_0x3d2580['count']:_0x116e11[_0x97df('0x1e')]+_0x116e11[_0x97df('0x1f')];var _0x53a10c;if(_0x56447b>=_0x18eb6c){_0x56447b=_0x18eb6c;_0x53a10c=0xc8;}else{_0x53a10c=0xce;}_0x1fbe5f[_0x97df('0x1c')](_0x53a10c);return _0x1fbe5f[_0x97df('0x22')](_0x97df('0x23'),_0x387c90+'-'+_0x56447b+'/'+_0x18eb6c)['json'](_0x3d2580);}return null;};}function patchUpdates(_0x30928b){return function(_0x106dc2){try{jsonpatch['apply'](_0x106dc2,_0x30928b,!![]);}catch(_0x40af1f){return BPromise[_0x97df('0x24')](_0x40af1f);}return _0x106dc2[_0x97df('0x25')]();};}function saveUpdates(_0x4d731a,_0x362683){return function(_0x409014){if(_0x409014){return _0x409014[_0x97df('0x26')](_0x4d731a)[_0x97df('0x27')](function(_0x251cc2){return _0x251cc2;});}return null;};}function removeEntity(_0x4e4ec0,_0x4e32bc){return function(_0x63a5c4){if(_0x63a5c4){return _0x63a5c4['destroy']()[_0x97df('0x27')](function(){var _0x5a9eb5=_0x63a5c4[_0x97df('0x28')]({'plain':!![]});var _0x177a86=_0x97df('0x29');return db[_0x97df('0x2a')][_0x97df('0x2b')]({'where':{'type':_0x177a86,'resourceId':_0x5a9eb5['id']}})['then'](function(){return _0x63a5c4;});})[_0x97df('0x27')](function(){_0x4e4ec0[_0x97df('0x1c')](0xcc)[_0x97df('0x2c')]();});}};}function handleEntityNotFound(_0x37606d,_0x4eab0e){return function(_0x2b4ea1){if(!_0x2b4ea1){_0x37606d[_0x97df('0x1b')](0x194);}return _0x2b4ea1;};}function handleError(_0xea2ad0,_0x15118f){_0x15118f=_0x15118f||0x1f4;return function(_0x5b74b4){logger['error'](_0x5b74b4[_0x97df('0x2d')]);if(_0x5b74b4[_0x97df('0x2e')]){delete _0x5b74b4[_0x97df('0x2e')];}_0xea2ad0['status'](_0x15118f)['send'](_0x5b74b4);};}exports[_0x97df('0x2f')]=function(_0x4e4115,_0x174309){var _0xd7ade2={},_0x58518d={},_0x19eac7={'count':0x0,'rows':[]};var _0x502068=_[_0x97df('0x30')](db['Dashboard']['rawAttributes'],function(_0x82fec2){return{'name':_0x82fec2[_0x97df('0x31')],'type':_0x82fec2[_0x97df('0x32')][_0x97df('0x33')]};});_0x58518d['model']=_[_0x97df('0x30')](_0x502068,_0x97df('0x2e'));_0x58518d[_0x97df('0x34')]=_[_0x97df('0x35')](_0x4e4115['query']);_0x58518d[_0x97df('0x36')]=_['intersection'](_0x58518d[_0x97df('0x37')],_0x58518d[_0x97df('0x34')]);_0xd7ade2['attributes']=_[_0x97df('0x38')](_0x58518d['model'],qs['fields'](_0x4e4115[_0x97df('0x34')][_0x97df('0x39')]));_0xd7ade2['attributes']=_0xd7ade2[_0x97df('0x3a')][_0x97df('0x3b')]?_0xd7ade2[_0x97df('0x3a')]:_0x58518d[_0x97df('0x37')];if(!_0x4e4115['query'][_0x97df('0x3c')](_0x97df('0x3d'))){_0xd7ade2[_0x97df('0x1f')]=qs[_0x97df('0x1f')](_0x4e4115['query'][_0x97df('0x1f')]);_0xd7ade2[_0x97df('0x1e')]=qs[_0x97df('0x1e')](_0x4e4115[_0x97df('0x34')]['offset']);}_0xd7ade2[_0x97df('0x3e')]=qs[_0x97df('0x3f')](_0x4e4115['query'][_0x97df('0x3f')]);_0xd7ade2['where']=qs[_0x97df('0x36')](_[_0x97df('0x40')](_0x4e4115[_0x97df('0x34')],_0x58518d[_0x97df('0x36')]),_0x502068);if(_0x4e4115['query'][_0x97df('0x41')]){_0xd7ade2[_0x97df('0x42')]=_['merge'](_0xd7ade2[_0x97df('0x42')],{'$or':_[_0x97df('0x30')](_0x502068,function(_0xc3a315){if(_0xc3a315[_0x97df('0x32')]!==_0x97df('0x43')){var _0x154b63={};_0x154b63[_0xc3a315['name']]={'$like':'%'+_0x4e4115[_0x97df('0x34')][_0x97df('0x41')]+'%'};return _0x154b63;}})});}_0xd7ade2=_[_0x97df('0x44')]({},_0xd7ade2,_0x4e4115[_0x97df('0x45')]);var _0x1752db={'where':_0xd7ade2[_0x97df('0x42')]};return db[_0x97df('0x46')]['count'](_0x1752db)['then'](function(_0x4ea463){_0x19eac7['count']=_0x4ea463;if(_0x4e4115['query']['includeAll']){_0xd7ade2[_0x97df('0x47')]=[{'all':!![]}];}return db['Dashboard']['findAll'](_0xd7ade2);})['then'](function(_0x3ea8cf){_0x19eac7[_0x97df('0x48')]=_0x3ea8cf;return _0x19eac7;})[_0x97df('0x27')](respondWithFilteredResult(_0x174309,_0xd7ade2))[_0x97df('0x49')](handleError(_0x174309,null));};exports['show']=function(_0x1940bc,_0xbec76c){var _0x2654ee={'raw':![],'where':{'id':_0x1940bc[_0x97df('0x4a')]['id']}},_0x35e96e={};_0x35e96e[_0x97df('0x37')]=_[_0x97df('0x35')](db['Dashboard'][_0x97df('0x4b')]);_0x35e96e['query']=_[_0x97df('0x35')](_0x1940bc[_0x97df('0x34')]);_0x35e96e[_0x97df('0x36')]=_[_0x97df('0x38')](_0x35e96e[_0x97df('0x37')],_0x35e96e[_0x97df('0x34')]);_0x2654ee[_0x97df('0x3a')]=_[_0x97df('0x38')](_0x35e96e[_0x97df('0x37')],qs[_0x97df('0x39')](_0x1940bc['query'][_0x97df('0x39')]));_0x2654ee[_0x97df('0x3a')]=_0x2654ee[_0x97df('0x3a')]['length']?_0x2654ee[_0x97df('0x3a')]:_0x35e96e[_0x97df('0x37')];if(_0x1940bc['query']['includeAll']){_0x2654ee['include']=[{'all':!![]}];}_0x2654ee=_[_0x97df('0x44')]({},_0x2654ee,_0x1940bc[_0x97df('0x45')]);return db[_0x97df('0x46')][_0x97df('0x4c')](_0x2654ee)['then'](handleEntityNotFound(_0xbec76c,null))[_0x97df('0x27')](respondWithResult(_0xbec76c,null))[_0x97df('0x49')](handleError(_0xbec76c,null));};exports[_0x97df('0x4d')]=function(_0x56ccf2,_0x4e8e6a){return db[_0x97df('0x46')][_0x97df('0x4d')](_0x56ccf2[_0x97df('0x4e')],{})[_0x97df('0x27')](function(_0x5508d7){var _0x41f3d9=_0x56ccf2[_0x97df('0x4f')][_0x97df('0x28')]({'plain':!![]});if(!_0x41f3d9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x41f3d9[_0x97df('0x50')]===_0x97df('0x4f')){var _0x9a7fc2=_0x5508d7[_0x97df('0x28')]({'plain':!![]});var _0x3482cc='CustomDashboards';return db[_0x97df('0x51')]['find']({'where':{'name':_0x3482cc,'userProfileId':_0x41f3d9[_0x97df('0x52')]},'raw':!![]})[_0x97df('0x27')](function(_0x21db32){if(_0x21db32&&_0x21db32[_0x97df('0x53')]===0x0){return db['UserProfileResource'][_0x97df('0x4d')]({'name':_0x9a7fc2[_0x97df('0x2e')],'resourceId':_0x9a7fc2['id'],'type':_0x21db32[_0x97df('0x2e')],'sectionId':_0x21db32['id']},{})[_0x97df('0x27')](function(){return _0x5508d7;});}else{return _0x5508d7;}})['catch'](function(_0xc36753){logger[_0x97df('0x54')](_0x97df('0x55'),_0xc36753);throw _0xc36753;});}return _0x5508d7;})[_0x97df('0x27')](respondWithResult(_0x4e8e6a,0xc9))[_0x97df('0x49')](handleError(_0x4e8e6a,null));};exports[_0x97df('0x56')]=function(_0x1bc37f,_0x32cb44){var _0xa08da1={'where':{'id':_0x1bc37f[_0x97df('0x4a')]['id']}},_0x13a7b4={};_0x13a7b4[_0x97df('0x37')]=_[_0x97df('0x35')](db[_0x97df('0x46')][_0x97df('0x4b')]);_0xa08da1[_0x97df('0x3a')]=_[_0x97df('0x38')](_0x13a7b4[_0x97df('0x37')],qs['fields'](_0x1bc37f['query'][_0x97df('0x39')]));_0xa08da1[_0x97df('0x3a')]=_0xa08da1[_0x97df('0x3a')]['length']?_0xa08da1[_0x97df('0x3a')]:_0x13a7b4[_0x97df('0x37')];if(_0x1bc37f['query']['includeAll']){_0xa08da1[_0x97df('0x47')]=[{'all':!![]}];}_0xa08da1=_[_0x97df('0x44')]({},_0xa08da1,_0x1bc37f[_0x97df('0x45')]);return db[_0x97df('0x46')]['find'](_0xa08da1)[_0x97df('0x27')](handleEntityNotFound(_0x32cb44,null))[_0x97df('0x27')](function(_0xd15ed7){if(_0xd15ed7){var _0x249efc=_0xd15ed7[_0x97df('0x28')]({'plain':!![]});_0x249efc=qs[_0x97df('0x57')](_0x249efc,['id',_0x97df('0x58'),_0x97df('0x59')]);_0x1bc37f[_0x97df('0x4e')]=_[_0x97df('0x57')](_0x1bc37f[_0x97df('0x4e')],['id',_0x97df('0x58'),_0x97df('0x59')]);return db['Dashboard'][_0x97df('0x4d')](_[_0x97df('0x44')](_0x249efc,_0x1bc37f[_0x97df('0x4e')]),{'include':_0x1bc37f['query'][_0x97df('0x5a')]?[{'all':!![]}]:undefined})['then'](function(_0x2844c9){var _0x384f36=_0x1bc37f[_0x97df('0x4f')][_0x97df('0x28')]({'plain':!![]});if(!_0x384f36)throw new Error(_0x97df('0x5b'));if(_0x384f36[_0x97df('0x50')]===_0x97df('0x4f')){var _0x50abb9=_0x2844c9[_0x97df('0x28')]({'plain':!![]});var _0x1060c4=_0x97df('0x29');return db['UserProfileSection']['find']({'where':{'name':_0x1060c4,'userProfileId':_0x384f36[_0x97df('0x52')]},'raw':!![]})['then'](function(_0x21838e){if(_0x21838e&&_0x21838e['autoAssociation']===0x0){return db[_0x97df('0x2a')][_0x97df('0x4d')]({'name':_0x50abb9[_0x97df('0x2e')],'resourceId':_0x50abb9['id'],'type':_0x21838e[_0x97df('0x2e')],'sectionId':_0x21838e['id']},{})[_0x97df('0x27')](function(){return _0x2844c9;});}else{return _0x2844c9;}})[_0x97df('0x49')](function(_0x2a2e67){logger[_0x97df('0x54')](_0x97df('0x55'),_0x2a2e67);throw _0x2a2e67;});}return _0x2844c9;});}})[_0x97df('0x27')](respondWithResult(_0x32cb44,0xc9))['catch'](handleError(_0x32cb44,null));};exports[_0x97df('0x26')]=function(_0x18ce95,_0x893ed6){if(_0x18ce95[_0x97df('0x4e')]['id']){delete _0x18ce95['body']['id'];}return db[_0x97df('0x46')][_0x97df('0x4c')]({'where':{'id':_0x18ce95[_0x97df('0x4a')]['id']}})[_0x97df('0x27')](handleEntityNotFound(_0x893ed6,null))['then'](saveUpdates(_0x18ce95['body'],null))[_0x97df('0x27')](respondWithResult(_0x893ed6,null))[_0x97df('0x49')](handleError(_0x893ed6,null));};exports[_0x97df('0x2b')]=function(_0x445366,_0x242a87){return db[_0x97df('0x46')]['find']({'where':{'id':_0x445366[_0x97df('0x4a')]['id']}})[_0x97df('0x27')](handleEntityNotFound(_0x242a87,null))[_0x97df('0x27')](removeEntity(_0x242a87,null))[_0x97df('0x49')](handleError(_0x242a87,null));};function widgetAttributes(_0x504901){try{switch(_0x504901[_0x97df('0x32')]){case'iframe':return[{'name':_0x97df('0x5c'),'value':_0x504901[_0x97df('0x5c')]||(_0x504901['attrs']&&_0x504901[_0x97df('0x5d')][0x0]?_0x504901['attrs'][0x0]['value']:undefined)||_0x97df('0x5e')}];case _0x97df('0x5f'):return[{'name':_0x97df('0x60'),'value':_0x504901[_0x97df('0x60')]||(_0x504901[_0x97df('0x5d')]&&_0x504901[_0x97df('0x5d')][0x0]?_0x504901[_0x97df('0x5d')][0x0][_0x97df('0x61')]:undefined)||''}];case _0x97df('0x62'):return[{'name':_0x97df('0x63'),'value':_0x504901[_0x97df('0x63')]||(_0x504901['attrs']&&_0x504901[_0x97df('0x5d')][0x0]?_0x504901['attrs'][0x0][_0x97df('0x61')]:undefined)||'HH:mm:ss'},{'name':_0x97df('0x64'),'value':_0x504901[_0x97df('0x64')]||(_0x504901[_0x97df('0x5d')]&&_0x504901[_0x97df('0x5d')][0x1]?_0x504901['attrs'][0x1][_0x97df('0x61')]:undefined)||_0x97df('0x65')},{'name':_0x97df('0x66'),'value':_0x504901['attrFontSize']||(_0x504901[_0x97df('0x5d')]&&_0x504901[_0x97df('0x5d')][0x2]?_0x504901[_0x97df('0x5d')][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':_0x97df('0x67'),'value':_0x504901['attrMetric']||(_0x504901[_0x97df('0x5d')]&&_0x504901[_0x97df('0x5d')][0x0]?_0x504901[_0x97df('0x5d')][0x0][_0x97df('0x61')]:undefined)||_0x97df('0x68')},{'name':_0x97df('0x69'),'value':_0x504901[_0x97df('0x69')]||(_0x504901[_0x97df('0x5d')]&&_0x504901[_0x97df('0x5d')][0x1]?_0x504901[_0x97df('0x5d')][0x1]['value']:undefined)||[]},{'name':_0x97df('0x66'),'value':_0x504901[_0x97df('0x66')]||(_0x504901[_0x97df('0x5d')]&&_0x504901[_0x97df('0x5d')][0x2]?_0x504901[_0x97df('0x5d')][0x2][_0x97df('0x61')]:undefined)||0x14},{'name':_0x97df('0x6a'),'value':_0x504901[_0x97df('0x6a')]||(_0x504901['attrs']&&_0x504901[_0x97df('0x5d')][0x3]?_0x504901[_0x97df('0x5d')][0x3][_0x97df('0x61')]:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x504901[_0x97df('0x6b')]||(_0x504901[_0x97df('0x5d')]&&_0x504901[_0x97df('0x5d')][0x4]?_0x504901['attrs'][0x4]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x504901[_0x97df('0x6c')]||(_0x504901[_0x97df('0x5d')]&&_0x504901[_0x97df('0x5d')][0x5]?_0x504901[_0x97df('0x5d')][0x5]['value']:undefined)||''},{'name':_0x97df('0x6d'),'value':_0x504901[_0x97df('0x6d')]||(_0x504901[_0x97df('0x5d')]&&_0x504901[_0x97df('0x5d')][0x6]?_0x504901[_0x97df('0x5d')][0x6][_0x97df('0x61')]:undefined)||''},{'name':_0x97df('0x6e'),'value':_0x504901[_0x97df('0x6e')]||(_0x504901[_0x97df('0x5d')]&&_0x504901['attrs'][0x7]?_0x504901[_0x97df('0x5d')][0x7][_0x97df('0x61')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x504901['attrWhatsappAccounts']||(_0x504901[_0x97df('0x5d')]&&_0x504901[_0x97df('0x5d')][0x8]?_0x504901[_0x97df('0x5d')][0x8]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0x504901[_0x97df('0x6f')]||(_0x504901['attrs']&&_0x504901[_0x97df('0x5d')][0x9]?_0x504901[_0x97df('0x5d')][0x9][_0x97df('0x61')]:undefined)||''}];case _0x97df('0x70'):case _0x97df('0x71'):return[{'name':'attrSerie1','value':_0x504901['attrSerie1']||(_0x504901[_0x97df('0x5d')]&&_0x504901[_0x97df('0x5d')][0x0]?_0x504901[_0x97df('0x5d')][0x0][_0x97df('0x61')]:undefined)||_0x97df('0x68')},{'name':_0x97df('0x72'),'value':_0x504901['attrSerie2']||(_0x504901[_0x97df('0x5d')]&&_0x504901['attrs'][0x1]?_0x504901[_0x97df('0x5d')][0x1][_0x97df('0x61')]:undefined)||null},{'name':_0x97df('0x73'),'value':_0x504901[_0x97df('0x73')]||(_0x504901[_0x97df('0x5d')]&&_0x504901['attrs'][0x2]?_0x504901['attrs'][0x2][_0x97df('0x61')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x504901['attrVoiceQueues']||(_0x504901[_0x97df('0x5d')]&&_0x504901[_0x97df('0x5d')][0x3]?_0x504901['attrs'][0x3][_0x97df('0x61')]:undefined)||[]},{'name':_0x97df('0x6a'),'value':_0x504901[_0x97df('0x6a')]||(_0x504901[_0x97df('0x5d')]&&_0x504901[_0x97df('0x5d')][0x4]?_0x504901[_0x97df('0x5d')][0x4][_0x97df('0x61')]:undefined)||_0x97df('0x74')},{'name':_0x97df('0x6b'),'value':_0x504901[_0x97df('0x6b')]||(_0x504901[_0x97df('0x5d')]&&_0x504901[_0x97df('0x5d')][0x5]?_0x504901[_0x97df('0x5d')][0x5]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x504901[_0x97df('0x6c')]||(_0x504901[_0x97df('0x5d')]&&_0x504901['attrs'][0x6]?_0x504901[_0x97df('0x5d')][0x6][_0x97df('0x61')]:undefined)||''},{'name':_0x97df('0x6d'),'value':_0x504901[_0x97df('0x6d')]||(_0x504901[_0x97df('0x5d')]&&_0x504901['attrs'][0x7]?_0x504901['attrs'][0x7][_0x97df('0x61')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x504901['attrOpenchannelAccounts']||(_0x504901[_0x97df('0x5d')]&&_0x504901[_0x97df('0x5d')][0x8]?_0x504901[_0x97df('0x5d')][0x8][_0x97df('0x61')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x504901[_0x97df('0x75')]||(_0x504901['attrs']&&_0x504901[_0x97df('0x5d')][0x9]?_0x504901[_0x97df('0x5d')][0x9][_0x97df('0x61')]:undefined)||''},{'name':_0x97df('0x6f'),'value':_0x504901['attrChatWebsites']||(_0x504901[_0x97df('0x5d')]&&_0x504901[_0x97df('0x5d')][0xa]?_0x504901[_0x97df('0x5d')][0xa][_0x97df('0x61')]:undefined)||''}];case _0x97df('0x76'):return[{'name':'attrReport','type':_0x504901[_0x97df('0x77')]||(_0x504901[_0x97df('0x5d')]&&_0x504901[_0x97df('0x5d')][0x0]?_0x504901['attrs'][0x0][_0x97df('0x32')]:undefined)||null,'value':_0x504901[_0x97df('0x78')]||(_0x504901[_0x97df('0x5d')]&&_0x504901[_0x97df('0x5d')][0x0]?_0x504901[_0x97df('0x5d')][0x0][_0x97df('0x61')]:undefined)||null},{'name':_0x97df('0x79'),'value':_0x504901[_0x97df('0x79')]||(_0x504901['attrs']&&_0x504901[_0x97df('0x5d')][0x1]?_0x504901['attrs'][0x1][_0x97df('0x61')]:undefined)||0x0}];default:return[];}}catch(_0x1e41e6){logger['error']('widgetAttributes:\x20%s',JSON[_0x97df('0x7a')](_0x1e41e6));return[];}}exports['addItem']=function(_0x5102c8,_0x2de20f,_0x1bf197){if(_0x5102c8[_0x97df('0x4e')]['id']){delete _0x5102c8[_0x97df('0x4e')]['id'];}return db[_0x97df('0x46')][_0x97df('0x4c')]({'where':{'id':_0x5102c8[_0x97df('0x4a')]['id']}})[_0x97df('0x27')](handleEntityNotFound(_0x2de20f,null))[_0x97df('0x27')](function(_0x300c60){if(_0x300c60){_0x5102c8[_0x97df('0x4e')][_0x97df('0x7b')]=_0x300c60['id'];_0x5102c8[_0x97df('0x4e')][_0x97df('0x5d')]=widgetAttributes(_0x5102c8[_0x97df('0x4e')]);return db[_0x97df('0x7c')]['create'](_0x5102c8[_0x97df('0x4e')]);}})[_0x97df('0x27')](respondWithResult(_0x2de20f,null))['catch'](handleError(_0x2de20f,null));};exports[_0x97df('0x7d')]=function(_0x59d23e,_0x402f85,_0xffb073){var _0x46b673={};var _0x2453e7={};var _0x4f1f5b;var _0x588fd9;return db[_0x97df('0x46')][_0x97df('0x7e')]({'where':{'id':_0x59d23e['params']['id']}})[_0x97df('0x27')](handleEntityNotFound(_0x402f85,null))['then'](function(_0x15e3f7){if(_0x15e3f7){_0x4f1f5b=_0x15e3f7;_0x2453e7[_0x97df('0x37')]=_[_0x97df('0x35')](db[_0x97df('0x7c')][_0x97df('0x4b')]);_0x2453e7[_0x97df('0x34')]=_[_0x97df('0x35')](_0x59d23e[_0x97df('0x34')]);_0x2453e7[_0x97df('0x36')]=_['intersection'](_0x2453e7['model'],_0x2453e7[_0x97df('0x34')]);_0x46b673[_0x97df('0x3a')]=_['intersection'](_0x2453e7[_0x97df('0x37')],qs['fields'](_0x59d23e['query'][_0x97df('0x39')]));_0x46b673[_0x97df('0x3a')]=_0x46b673[_0x97df('0x3a')]['length']?_0x46b673[_0x97df('0x3a')]:_0x2453e7['model'];_0x46b673['order']=qs[_0x97df('0x3f')](_0x59d23e[_0x97df('0x34')][_0x97df('0x3f')]);_0x46b673[_0x97df('0x42')]=qs['filters'](_[_0x97df('0x40')](_0x59d23e[_0x97df('0x34')],_0x2453e7['filters']));if(_0x59d23e['query'][_0x97df('0x41')]){_0x46b673[_0x97df('0x42')]=_[_0x97df('0x44')](_0x46b673[_0x97df('0x42')],{'$or':_[_0x97df('0x30')](_0x46b673[_0x97df('0x3a')],function(_0x5eec30){var _0x2d7f1b={};_0x2d7f1b[_0x5eec30]={'$like':'%'+_0x59d23e[_0x97df('0x34')][_0x97df('0x41')]+'%'};return _0x2d7f1b;})});}_0x46b673=_[_0x97df('0x44')]({},_0x46b673,_0x59d23e[_0x97df('0x45')]);return _0x4f1f5b[_0x97df('0x7d')](_0x46b673);}})[_0x97df('0x27')](function(_0x12f503){if(_0x12f503){_0x588fd9=_0x12f503[_0x97df('0x3b')];if(!_0x59d23e[_0x97df('0x34')][_0x97df('0x3c')](_0x97df('0x3d'))){_0x46b673[_0x97df('0x1f')]=qs[_0x97df('0x1f')](_0x59d23e['query'][_0x97df('0x1f')]);_0x46b673[_0x97df('0x1e')]=qs['offset'](_0x59d23e[_0x97df('0x34')][_0x97df('0x1e')]);}return _0x4f1f5b[_0x97df('0x7d')](_0x46b673);}})[_0x97df('0x27')](function(_0x19e3de){if(_0x19e3de){return _0x19e3de?{'count':_0x588fd9,'rows':_0x19e3de}:null;}})[_0x97df('0x27')](respondWithResult(_0x402f85,null))[_0x97df('0x49')](handleError(_0x402f85,null));}; \ No newline at end of file +var _0x2124=['params','length','include','find','catch','create','body','user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','updatedAt','omit','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','error','iframe','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrChatWebsites','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','DashboardId','DashboardItem','getItems','pick','filter','hasOwnProperty','nolimit','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','register','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomDashboards','UserProfileResource','end','sendStatus','name','send','map','Dashboard','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','order','sort','where','VIRTUAL','merge','includeAll','findAll','rows','show'];(function(_0x531a0a,_0x22c3be){var _0x27cc5f=function(_0x14f389){while(--_0x14f389){_0x531a0a['push'](_0x531a0a['shift']());}};_0x27cc5f(++_0x22c3be);}(_0x2124,0xc0));var _0x4212=function(_0xba9507,_0x16a681){_0xba9507=_0xba9507-0x0;var _0x29a14f=_0x2124[_0xba9507];return _0x29a14f;};'use strict';var emlformat=require(_0x4212('0x0'));var rimraf=require(_0x4212('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4212('0x2'));var rp=require(_0x4212('0x3'));var moment=require(_0x4212('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4212('0x5'));var util=require(_0x4212('0x6'));var path=require('path');var sox=require(_0x4212('0x7'));var csv=require(_0x4212('0x8'));var ejs=require(_0x4212('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4212('0xa'));var squel=require(_0x4212('0xb'));var crypto=require(_0x4212('0xc'));var jsforce=require(_0x4212('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4212('0x8'));var querystring=require(_0x4212('0xe'));var Papa=require(_0x4212('0xf'));var Redis=require('ioredis');var authService=require(_0x4212('0x10'));var qs=require(_0x4212('0x11'));var as=require(_0x4212('0x12'));var hardwareService=require(_0x4212('0x13'));var logger=require(_0x4212('0x14'))(_0x4212('0x15'));var utils=require(_0x4212('0x16'));var config=require(_0x4212('0x17'));var licenseUtil=require(_0x4212('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x4212('0x19')](config[_0x4212('0x1a')],{'host':_0x4212('0x1b'),'port':0x18eb});var socket=require(_0x4212('0x1c'))(new Redis(config['redis']));require('./dashboard.socket')[_0x4212('0x1d')](socket);function respondWithStatusCode(_0x3f7dbb,_0x5f2583){_0x5f2583=_0x5f2583||0xcc;return function(_0x4f39cc){if(_0x4f39cc){return _0x3f7dbb['sendStatus'](_0x5f2583);}return _0x3f7dbb['status'](_0x5f2583)['end']();};}function respondWithResult(_0x6817c3,_0x512db4){_0x512db4=_0x512db4||0xc8;return function(_0x3e2a25){if(_0x3e2a25){return _0x6817c3[_0x4212('0x1e')](_0x512db4)[_0x4212('0x1f')](_0x3e2a25);}};}function respondWithFilteredResult(_0x35cff2,_0x183558){return function(_0x397039){if(_0x397039){var _0x29e538=typeof _0x183558[_0x4212('0x20')]===_0x4212('0x21')&&typeof _0x183558['limit']===_0x4212('0x21');var _0x272a24=_0x397039[_0x4212('0x22')];var _0x5d3241=_0x29e538?0x0:_0x183558['offset'];var _0x4b729d=_0x29e538?_0x397039[_0x4212('0x22')]:_0x183558[_0x4212('0x20')]+_0x183558[_0x4212('0x23')];var _0x423571;if(_0x4b729d>=_0x272a24){_0x4b729d=_0x272a24;_0x423571=0xc8;}else{_0x423571=0xce;}_0x35cff2[_0x4212('0x1e')](_0x423571);return _0x35cff2[_0x4212('0x24')](_0x4212('0x25'),_0x5d3241+'-'+_0x4b729d+'/'+_0x272a24)[_0x4212('0x1f')](_0x397039);}return null;};}function patchUpdates(_0x35439f){return function(_0x37bfbd){try{jsonpatch[_0x4212('0x26')](_0x37bfbd,_0x35439f,!![]);}catch(_0x369f3a){return BPromise[_0x4212('0x27')](_0x369f3a);}return _0x37bfbd[_0x4212('0x28')]();};}function saveUpdates(_0x3eca8a,_0xf6ba89){return function(_0x348af2){if(_0x348af2){return _0x348af2[_0x4212('0x29')](_0x3eca8a)[_0x4212('0x2a')](function(_0x2b98d0){return _0x2b98d0;});}return null;};}function removeEntity(_0x5b242c,_0x905b0b){return function(_0x5f4bda){if(_0x5f4bda){return _0x5f4bda[_0x4212('0x2b')]()[_0x4212('0x2a')](function(){var _0xa697fa=_0x5f4bda[_0x4212('0x2c')]({'plain':!![]});var _0x244fe8=_0x4212('0x2d');return db[_0x4212('0x2e')][_0x4212('0x2b')]({'where':{'type':_0x244fe8,'resourceId':_0xa697fa['id']}})['then'](function(){return _0x5f4bda;});})[_0x4212('0x2a')](function(){_0x5b242c['status'](0xcc)[_0x4212('0x2f')]();});}};}function handleEntityNotFound(_0x5c4287,_0x4ebb66){return function(_0x2d992f){if(!_0x2d992f){_0x5c4287[_0x4212('0x30')](0x194);}return _0x2d992f;};}function handleError(_0x4456d7,_0x45001d){_0x45001d=_0x45001d||0x1f4;return function(_0x285272){logger['error'](_0x285272['stack']);if(_0x285272[_0x4212('0x31')]){delete _0x285272[_0x4212('0x31')];}_0x4456d7[_0x4212('0x1e')](_0x45001d)[_0x4212('0x32')](_0x285272);};}exports['index']=function(_0x5ef4eb,_0x5ba596){var _0x228c84={},_0x46c6e2={},_0x47cecb={'count':0x0,'rows':[]};var _0x132df0=_[_0x4212('0x33')](db[_0x4212('0x34')][_0x4212('0x35')],function(_0x891b36){return{'name':_0x891b36['fieldName'],'type':_0x891b36[_0x4212('0x36')][_0x4212('0x37')]};});_0x46c6e2[_0x4212('0x38')]=_[_0x4212('0x33')](_0x132df0,_0x4212('0x31'));_0x46c6e2[_0x4212('0x39')]=_[_0x4212('0x3a')](_0x5ef4eb[_0x4212('0x39')]);_0x46c6e2[_0x4212('0x3b')]=_[_0x4212('0x3c')](_0x46c6e2['model'],_0x46c6e2[_0x4212('0x39')]);_0x228c84['attributes']=_[_0x4212('0x3c')](_0x46c6e2[_0x4212('0x38')],qs[_0x4212('0x3d')](_0x5ef4eb[_0x4212('0x39')][_0x4212('0x3d')]));_0x228c84[_0x4212('0x3e')]=_0x228c84[_0x4212('0x3e')]['length']?_0x228c84[_0x4212('0x3e')]:_0x46c6e2[_0x4212('0x38')];if(!_0x5ef4eb[_0x4212('0x39')]['hasOwnProperty']('nolimit')){_0x228c84['limit']=qs[_0x4212('0x23')](_0x5ef4eb[_0x4212('0x39')]['limit']);_0x228c84[_0x4212('0x20')]=qs[_0x4212('0x20')](_0x5ef4eb[_0x4212('0x39')]['offset']);}_0x228c84[_0x4212('0x3f')]=qs[_0x4212('0x40')](_0x5ef4eb[_0x4212('0x39')][_0x4212('0x40')]);_0x228c84[_0x4212('0x41')]=qs[_0x4212('0x3b')](_['pick'](_0x5ef4eb['query'],_0x46c6e2[_0x4212('0x3b')]),_0x132df0);if(_0x5ef4eb['query']['filter']){_0x228c84['where']=_['merge'](_0x228c84[_0x4212('0x41')],{'$or':_[_0x4212('0x33')](_0x132df0,function(_0x3637aa){if(_0x3637aa[_0x4212('0x36')]!==_0x4212('0x42')){var _0x283c36={};_0x283c36[_0x3637aa[_0x4212('0x31')]]={'$like':'%'+_0x5ef4eb['query']['filter']+'%'};return _0x283c36;}})});}_0x228c84=_[_0x4212('0x43')]({},_0x228c84,_0x5ef4eb['options']);var _0x53e4fd={'where':_0x228c84[_0x4212('0x41')]};return db['Dashboard'][_0x4212('0x22')](_0x53e4fd)[_0x4212('0x2a')](function(_0x140a8a){_0x47cecb[_0x4212('0x22')]=_0x140a8a;if(_0x5ef4eb['query'][_0x4212('0x44')]){_0x228c84['include']=[{'all':!![]}];}return db[_0x4212('0x34')][_0x4212('0x45')](_0x228c84);})['then'](function(_0x22e8f2){_0x47cecb[_0x4212('0x46')]=_0x22e8f2;return _0x47cecb;})[_0x4212('0x2a')](respondWithFilteredResult(_0x5ba596,_0x228c84))['catch'](handleError(_0x5ba596,null));};exports[_0x4212('0x47')]=function(_0xc523ff,_0x5bc595){var _0x4a1c71={'raw':![],'where':{'id':_0xc523ff[_0x4212('0x48')]['id']}},_0x200852={};_0x200852[_0x4212('0x38')]=_[_0x4212('0x3a')](db[_0x4212('0x34')][_0x4212('0x35')]);_0x200852[_0x4212('0x39')]=_[_0x4212('0x3a')](_0xc523ff['query']);_0x200852[_0x4212('0x3b')]=_[_0x4212('0x3c')](_0x200852[_0x4212('0x38')],_0x200852[_0x4212('0x39')]);_0x4a1c71[_0x4212('0x3e')]=_['intersection'](_0x200852[_0x4212('0x38')],qs[_0x4212('0x3d')](_0xc523ff[_0x4212('0x39')][_0x4212('0x3d')]));_0x4a1c71[_0x4212('0x3e')]=_0x4a1c71[_0x4212('0x3e')][_0x4212('0x49')]?_0x4a1c71['attributes']:_0x200852[_0x4212('0x38')];if(_0xc523ff[_0x4212('0x39')][_0x4212('0x44')]){_0x4a1c71[_0x4212('0x4a')]=[{'all':!![]}];}_0x4a1c71=_['merge']({},_0x4a1c71,_0xc523ff['options']);return db[_0x4212('0x34')][_0x4212('0x4b')](_0x4a1c71)['then'](handleEntityNotFound(_0x5bc595,null))['then'](respondWithResult(_0x5bc595,null))[_0x4212('0x4c')](handleError(_0x5bc595,null));};exports['create']=function(_0x49c979,_0x179f57){return db['Dashboard'][_0x4212('0x4d')](_0x49c979[_0x4212('0x4e')],{})[_0x4212('0x2a')](function(_0x527056){var _0x21fe4e=_0x49c979[_0x4212('0x4f')]['get']({'plain':!![]});if(!_0x21fe4e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x21fe4e[_0x4212('0x50')]===_0x4212('0x4f')){var _0x5ea092=_0x527056['get']({'plain':!![]});var _0x40e0d9='CustomDashboards';return db['UserProfileSection']['find']({'where':{'name':_0x40e0d9,'userProfileId':_0x21fe4e['userProfileId']},'raw':!![]})['then'](function(_0x4fd082){if(_0x4fd082&&_0x4fd082[_0x4212('0x51')]===0x0){return db[_0x4212('0x2e')][_0x4212('0x4d')]({'name':_0x5ea092[_0x4212('0x31')],'resourceId':_0x5ea092['id'],'type':_0x4fd082['name'],'sectionId':_0x4fd082['id']},{})[_0x4212('0x2a')](function(){return _0x527056;});}else{return _0x527056;}})[_0x4212('0x4c')](function(_0x3347a4){logger['error'](_0x4212('0x52'),_0x3347a4);throw _0x3347a4;});}return _0x527056;})[_0x4212('0x2a')](respondWithResult(_0x179f57,0xc9))[_0x4212('0x4c')](handleError(_0x179f57,null));};exports[_0x4212('0x53')]=function(_0x50eed4,_0x59cff8){var _0x114435={'where':{'id':_0x50eed4[_0x4212('0x48')]['id']}},_0x11e842={};_0x11e842['model']=_[_0x4212('0x3a')](db['Dashboard']['rawAttributes']);_0x114435[_0x4212('0x3e')]=_[_0x4212('0x3c')](_0x11e842[_0x4212('0x38')],qs[_0x4212('0x3d')](_0x50eed4[_0x4212('0x39')][_0x4212('0x3d')]));_0x114435[_0x4212('0x3e')]=_0x114435[_0x4212('0x3e')][_0x4212('0x49')]?_0x114435[_0x4212('0x3e')]:_0x11e842[_0x4212('0x38')];if(_0x50eed4['query'][_0x4212('0x44')]){_0x114435[_0x4212('0x4a')]=[{'all':!![]}];}_0x114435=_['merge']({},_0x114435,_0x50eed4['options']);return db[_0x4212('0x34')][_0x4212('0x4b')](_0x114435)['then'](handleEntityNotFound(_0x59cff8,null))[_0x4212('0x2a')](function(_0x30fc4d){if(_0x30fc4d){var _0x38f79b=_0x30fc4d[_0x4212('0x2c')]({'plain':!![]});_0x38f79b=qs['omit'](_0x38f79b,['id','createdAt',_0x4212('0x54')]);_0x50eed4[_0x4212('0x4e')]=_[_0x4212('0x55')](_0x50eed4[_0x4212('0x4e')],['id',_0x4212('0x56'),_0x4212('0x54')]);return db[_0x4212('0x34')][_0x4212('0x4d')](_[_0x4212('0x43')](_0x38f79b,_0x50eed4[_0x4212('0x4e')]),{'include':_0x50eed4[_0x4212('0x39')][_0x4212('0x44')]?[{'all':!![]}]:undefined})[_0x4212('0x2a')](function(_0x48e3db){var _0x321891=_0x50eed4[_0x4212('0x4f')][_0x4212('0x2c')]({'plain':!![]});if(!_0x321891)throw new Error(_0x4212('0x57'));if(_0x321891[_0x4212('0x50')]===_0x4212('0x4f')){var _0x5ba68c=_0x48e3db['get']({'plain':!![]});var _0x3c5842=_0x4212('0x2d');return db[_0x4212('0x58')][_0x4212('0x4b')]({'where':{'name':_0x3c5842,'userProfileId':_0x321891[_0x4212('0x59')]},'raw':!![]})['then'](function(_0x171c96){if(_0x171c96&&_0x171c96[_0x4212('0x51')]===0x0){return db['UserProfileResource'][_0x4212('0x4d')]({'name':_0x5ba68c[_0x4212('0x31')],'resourceId':_0x5ba68c['id'],'type':_0x171c96[_0x4212('0x31')],'sectionId':_0x171c96['id']},{})[_0x4212('0x2a')](function(){return _0x48e3db;});}else{return _0x48e3db;}})[_0x4212('0x4c')](function(_0x4c0321){logger[_0x4212('0x5a')](_0x4212('0x52'),_0x4c0321);throw _0x4c0321;});}return _0x48e3db;});}})[_0x4212('0x2a')](respondWithResult(_0x59cff8,0xc9))['catch'](handleError(_0x59cff8,null));};exports[_0x4212('0x29')]=function(_0x30a3fa,_0x33eff4){if(_0x30a3fa[_0x4212('0x4e')]['id']){delete _0x30a3fa[_0x4212('0x4e')]['id'];}return db[_0x4212('0x34')]['find']({'where':{'id':_0x30a3fa[_0x4212('0x48')]['id']}})[_0x4212('0x2a')](handleEntityNotFound(_0x33eff4,null))['then'](saveUpdates(_0x30a3fa['body'],null))[_0x4212('0x2a')](respondWithResult(_0x33eff4,null))['catch'](handleError(_0x33eff4,null));};exports[_0x4212('0x2b')]=function(_0x213759,_0x488379){return db['Dashboard'][_0x4212('0x4b')]({'where':{'id':_0x213759[_0x4212('0x48')]['id']}})[_0x4212('0x2a')](handleEntityNotFound(_0x488379,null))['then'](removeEntity(_0x488379,null))[_0x4212('0x4c')](handleError(_0x488379,null));};function widgetAttributes(_0x1a9c4d){try{switch(_0x1a9c4d[_0x4212('0x36')]){case _0x4212('0x5b'):return[{'name':_0x4212('0x5c'),'value':_0x1a9c4d[_0x4212('0x5c')]||(_0x1a9c4d['attrs']&&_0x1a9c4d[_0x4212('0x5d')][0x0]?_0x1a9c4d[_0x4212('0x5d')][0x0][_0x4212('0x5e')]:undefined)||_0x4212('0x5f')}];case _0x4212('0x60'):return[{'name':_0x4212('0x61'),'value':_0x1a9c4d[_0x4212('0x61')]||(_0x1a9c4d[_0x4212('0x5d')]&&_0x1a9c4d['attrs'][0x0]?_0x1a9c4d[_0x4212('0x5d')][0x0][_0x4212('0x5e')]:undefined)||''}];case'clock':return[{'name':_0x4212('0x62'),'value':_0x1a9c4d[_0x4212('0x62')]||(_0x1a9c4d['attrs']&&_0x1a9c4d[_0x4212('0x5d')][0x0]?_0x1a9c4d[_0x4212('0x5d')][0x0]['value']:undefined)||_0x4212('0x63')},{'name':'attrTimezone','value':_0x1a9c4d[_0x4212('0x64')]||(_0x1a9c4d[_0x4212('0x5d')]&&_0x1a9c4d['attrs'][0x1]?_0x1a9c4d['attrs'][0x1]['value']:undefined)||_0x4212('0x65')},{'name':_0x4212('0x66'),'value':_0x1a9c4d[_0x4212('0x66')]||(_0x1a9c4d[_0x4212('0x5d')]&&_0x1a9c4d[_0x4212('0x5d')][0x2]?_0x1a9c4d[_0x4212('0x5d')][0x2][_0x4212('0x5e')]:undefined)||0xc}];case _0x4212('0x67'):return[{'name':_0x4212('0x68'),'value':_0x1a9c4d[_0x4212('0x68')]||(_0x1a9c4d[_0x4212('0x5d')]&&_0x1a9c4d[_0x4212('0x5d')][0x0]?_0x1a9c4d[_0x4212('0x5d')][0x0][_0x4212('0x5e')]:undefined)||_0x4212('0x69')},{'name':_0x4212('0x6a'),'value':_0x1a9c4d[_0x4212('0x6a')]||(_0x1a9c4d[_0x4212('0x5d')]&&_0x1a9c4d[_0x4212('0x5d')][0x1]?_0x1a9c4d[_0x4212('0x5d')][0x1][_0x4212('0x5e')]:undefined)||[]},{'name':_0x4212('0x66'),'value':_0x1a9c4d[_0x4212('0x66')]||(_0x1a9c4d['attrs']&&_0x1a9c4d[_0x4212('0x5d')][0x2]?_0x1a9c4d[_0x4212('0x5d')][0x2][_0x4212('0x5e')]:undefined)||0x14},{'name':_0x4212('0x6b'),'value':_0x1a9c4d[_0x4212('0x6b')]||(_0x1a9c4d['attrs']&&_0x1a9c4d['attrs'][0x3]?_0x1a9c4d[_0x4212('0x5d')][0x3][_0x4212('0x5e')]:undefined)||_0x4212('0x6c')},{'name':_0x4212('0x6d'),'value':_0x1a9c4d[_0x4212('0x6d')]||(_0x1a9c4d[_0x4212('0x5d')]&&_0x1a9c4d[_0x4212('0x5d')][0x4]?_0x1a9c4d[_0x4212('0x5d')][0x4]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x1a9c4d[_0x4212('0x6e')]||(_0x1a9c4d['attrs']&&_0x1a9c4d[_0x4212('0x5d')][0x5]?_0x1a9c4d[_0x4212('0x5d')][0x5][_0x4212('0x5e')]:undefined)||''},{'name':_0x4212('0x6f'),'value':_0x1a9c4d[_0x4212('0x6f')]||(_0x1a9c4d['attrs']&&_0x1a9c4d[_0x4212('0x5d')][0x6]?_0x1a9c4d[_0x4212('0x5d')][0x6][_0x4212('0x5e')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x1a9c4d[_0x4212('0x70')]||(_0x1a9c4d[_0x4212('0x5d')]&&_0x1a9c4d[_0x4212('0x5d')][0x7]?_0x1a9c4d[_0x4212('0x5d')][0x7]['value']:undefined)||''},{'name':_0x4212('0x71'),'value':_0x1a9c4d[_0x4212('0x71')]||(_0x1a9c4d[_0x4212('0x5d')]&&_0x1a9c4d[_0x4212('0x5d')][0x8]?_0x1a9c4d[_0x4212('0x5d')][0x8][_0x4212('0x5e')]:undefined)||''},{'name':'attrChatWebsites','value':_0x1a9c4d['attrChatWebsites']||(_0x1a9c4d[_0x4212('0x5d')]&&_0x1a9c4d[_0x4212('0x5d')][0x9]?_0x1a9c4d[_0x4212('0x5d')][0x9][_0x4212('0x5e')]:undefined)||''}];case _0x4212('0x72'):case _0x4212('0x73'):return[{'name':_0x4212('0x74'),'value':_0x1a9c4d[_0x4212('0x74')]||(_0x1a9c4d[_0x4212('0x5d')]&&_0x1a9c4d[_0x4212('0x5d')][0x0]?_0x1a9c4d[_0x4212('0x5d')][0x0]['value']:undefined)||_0x4212('0x69')},{'name':_0x4212('0x75'),'value':_0x1a9c4d[_0x4212('0x75')]||(_0x1a9c4d[_0x4212('0x5d')]&&_0x1a9c4d[_0x4212('0x5d')][0x1]?_0x1a9c4d['attrs'][0x1][_0x4212('0x5e')]:undefined)||null},{'name':_0x4212('0x76'),'value':_0x1a9c4d[_0x4212('0x76')]||(_0x1a9c4d[_0x4212('0x5d')]&&_0x1a9c4d[_0x4212('0x5d')][0x2]?_0x1a9c4d[_0x4212('0x5d')][0x2][_0x4212('0x5e')]:undefined)||null},{'name':_0x4212('0x6a'),'value':_0x1a9c4d[_0x4212('0x6a')]||(_0x1a9c4d[_0x4212('0x5d')]&&_0x1a9c4d['attrs'][0x3]?_0x1a9c4d[_0x4212('0x5d')][0x3][_0x4212('0x5e')]:undefined)||[]},{'name':_0x4212('0x6b'),'value':_0x1a9c4d[_0x4212('0x6b')]||(_0x1a9c4d[_0x4212('0x5d')]&&_0x1a9c4d[_0x4212('0x5d')][0x4]?_0x1a9c4d[_0x4212('0x5d')][0x4][_0x4212('0x5e')]:undefined)||_0x4212('0x6c')},{'name':_0x4212('0x6d'),'value':_0x1a9c4d[_0x4212('0x6d')]||(_0x1a9c4d[_0x4212('0x5d')]&&_0x1a9c4d[_0x4212('0x5d')][0x5]?_0x1a9c4d['attrs'][0x5][_0x4212('0x5e')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x1a9c4d[_0x4212('0x6e')]||(_0x1a9c4d[_0x4212('0x5d')]&&_0x1a9c4d[_0x4212('0x5d')][0x6]?_0x1a9c4d['attrs'][0x6][_0x4212('0x5e')]:undefined)||''},{'name':_0x4212('0x6f'),'value':_0x1a9c4d['attrSmsAccounts']||(_0x1a9c4d['attrs']&&_0x1a9c4d['attrs'][0x7]?_0x1a9c4d[_0x4212('0x5d')][0x7][_0x4212('0x5e')]:undefined)||''},{'name':_0x4212('0x70'),'value':_0x1a9c4d[_0x4212('0x70')]||(_0x1a9c4d[_0x4212('0x5d')]&&_0x1a9c4d[_0x4212('0x5d')][0x8]?_0x1a9c4d[_0x4212('0x5d')][0x8][_0x4212('0x5e')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x1a9c4d[_0x4212('0x71')]||(_0x1a9c4d['attrs']&&_0x1a9c4d['attrs'][0x9]?_0x1a9c4d['attrs'][0x9][_0x4212('0x5e')]:undefined)||''},{'name':_0x4212('0x77'),'value':_0x1a9c4d[_0x4212('0x77')]||(_0x1a9c4d[_0x4212('0x5d')]&&_0x1a9c4d[_0x4212('0x5d')][0xa]?_0x1a9c4d['attrs'][0xa]['value']:undefined)||''}];case _0x4212('0x78'):return[{'name':_0x4212('0x79'),'type':_0x1a9c4d[_0x4212('0x7a')]||(_0x1a9c4d[_0x4212('0x5d')]&&_0x1a9c4d[_0x4212('0x5d')][0x0]?_0x1a9c4d[_0x4212('0x5d')][0x0]['type']:undefined)||null,'value':_0x1a9c4d['attrReport']||(_0x1a9c4d['attrs']&&_0x1a9c4d[_0x4212('0x5d')][0x0]?_0x1a9c4d[_0x4212('0x5d')][0x0]['value']:undefined)||null},{'name':_0x4212('0x7b'),'value':_0x1a9c4d[_0x4212('0x7b')]||(_0x1a9c4d[_0x4212('0x5d')]&&_0x1a9c4d[_0x4212('0x5d')][0x1]?_0x1a9c4d[_0x4212('0x5d')][0x1][_0x4212('0x5e')]:undefined)||0x0}];default:return[];}}catch(_0x71f2bc){logger[_0x4212('0x5a')](_0x4212('0x7c'),JSON['stringify'](_0x71f2bc));return[];}}exports['addItem']=function(_0x469175,_0x5a4b47,_0x400c3f){if(_0x469175[_0x4212('0x4e')]['id']){delete _0x469175[_0x4212('0x4e')]['id'];}return db[_0x4212('0x34')][_0x4212('0x4b')]({'where':{'id':_0x469175[_0x4212('0x48')]['id']}})['then'](handleEntityNotFound(_0x5a4b47,null))[_0x4212('0x2a')](function(_0x113e85){if(_0x113e85){_0x469175['body'][_0x4212('0x7d')]=_0x113e85['id'];_0x469175[_0x4212('0x4e')][_0x4212('0x5d')]=widgetAttributes(_0x469175[_0x4212('0x4e')]);return db[_0x4212('0x7e')][_0x4212('0x4d')](_0x469175[_0x4212('0x4e')]);}})[_0x4212('0x2a')](respondWithResult(_0x5a4b47,null))['catch'](handleError(_0x5a4b47,null));};exports[_0x4212('0x7f')]=function(_0x3bea00,_0x2f040c,_0x40f33e){var _0x2b2cc0={};var _0x587d54={};var _0x51a8ee;var _0x16139b;return db[_0x4212('0x34')]['findOne']({'where':{'id':_0x3bea00[_0x4212('0x48')]['id']}})[_0x4212('0x2a')](handleEntityNotFound(_0x2f040c,null))[_0x4212('0x2a')](function(_0x4a57c0){if(_0x4a57c0){_0x51a8ee=_0x4a57c0;_0x587d54[_0x4212('0x38')]=_[_0x4212('0x3a')](db[_0x4212('0x7e')][_0x4212('0x35')]);_0x587d54[_0x4212('0x39')]=_['keys'](_0x3bea00[_0x4212('0x39')]);_0x587d54[_0x4212('0x3b')]=_['intersection'](_0x587d54[_0x4212('0x38')],_0x587d54[_0x4212('0x39')]);_0x2b2cc0[_0x4212('0x3e')]=_[_0x4212('0x3c')](_0x587d54['model'],qs[_0x4212('0x3d')](_0x3bea00[_0x4212('0x39')][_0x4212('0x3d')]));_0x2b2cc0[_0x4212('0x3e')]=_0x2b2cc0['attributes']['length']?_0x2b2cc0[_0x4212('0x3e')]:_0x587d54[_0x4212('0x38')];_0x2b2cc0[_0x4212('0x3f')]=qs[_0x4212('0x40')](_0x3bea00[_0x4212('0x39')][_0x4212('0x40')]);_0x2b2cc0[_0x4212('0x41')]=qs[_0x4212('0x3b')](_[_0x4212('0x80')](_0x3bea00[_0x4212('0x39')],_0x587d54['filters']));if(_0x3bea00[_0x4212('0x39')][_0x4212('0x81')]){_0x2b2cc0[_0x4212('0x41')]=_[_0x4212('0x43')](_0x2b2cc0[_0x4212('0x41')],{'$or':_[_0x4212('0x33')](_0x2b2cc0[_0x4212('0x3e')],function(_0x4a2542){var _0x2ec9b3={};_0x2ec9b3[_0x4a2542]={'$like':'%'+_0x3bea00[_0x4212('0x39')][_0x4212('0x81')]+'%'};return _0x2ec9b3;})});}_0x2b2cc0=_['merge']({},_0x2b2cc0,_0x3bea00['options']);return _0x51a8ee[_0x4212('0x7f')](_0x2b2cc0);}})[_0x4212('0x2a')](function(_0x283fc8){if(_0x283fc8){_0x16139b=_0x283fc8[_0x4212('0x49')];if(!_0x3bea00['query'][_0x4212('0x82')](_0x4212('0x83'))){_0x2b2cc0[_0x4212('0x23')]=qs[_0x4212('0x23')](_0x3bea00[_0x4212('0x39')]['limit']);_0x2b2cc0[_0x4212('0x20')]=qs[_0x4212('0x20')](_0x3bea00[_0x4212('0x39')][_0x4212('0x20')]);}return _0x51a8ee['getItems'](_0x2b2cc0);}})[_0x4212('0x2a')](function(_0x5bde88){if(_0x5bde88){return _0x5bde88?{'count':_0x16139b,'rows':_0x5bde88}:null;}})['then'](respondWithResult(_0x2f040c,null))[_0x4212('0x4c')](handleError(_0x2f040c,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index bb17ab7..72cffed 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 _0x6a45=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Dashboard'];(function(_0x440064,_0x15230d){var _0x4f32c7=function(_0x21c549){while(--_0x21c549){_0x440064['push'](_0x440064['shift']());}};_0x4f32c7(++_0x15230d);}(_0x6a45,0x147));var _0x56a4=function(_0x150c31,_0x3849e){_0x150c31=_0x150c31-0x0;var _0x36c812=_0x6a45[_0x150c31];return _0x36c812;};'use strict';var EventEmitter=require(_0x56a4('0x0'));var Dashboard=require(_0x56a4('0x1'))['db'][_0x56a4('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x56a4('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x56a4('0x4'),'afterDestroy':_0x56a4('0x5')};function emitEvent(_0x19991a){return function(_0x74032b,_0x456872,_0xbfc02b){DashboardEvents['emit'](_0x19991a+':'+_0x74032b['id'],_0x74032b);DashboardEvents[_0x56a4('0x6')](_0x19991a,_0x74032b);_0xbfc02b(null);};}for(var e in events){if(events[_0x56a4('0x7')](e)){var event=events[e];Dashboard[_0x56a4('0x8')](e,emitEvent(event));}}module[_0x56a4('0x9')]=DashboardEvents; \ No newline at end of file +var _0x6fcd=['setMaxListeners','save','update','emit','exports','events','../../mysqldb'];(function(_0x127c7e,_0x470192){var _0x45f955=function(_0x26dcea){while(--_0x26dcea){_0x127c7e['push'](_0x127c7e['shift']());}};_0x45f955(++_0x470192);}(_0x6fcd,0x19b));var _0xd6fc=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x6fcd[_0x565ed7];return _0x183ad7;};'use strict';var EventEmitter=require(_0xd6fc('0x0'));var Dashboard=require(_0xd6fc('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0xd6fc('0x2')](0x0);var events={'afterCreate':_0xd6fc('0x3'),'afterUpdate':_0xd6fc('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2725d0){return function(_0x78ea60,_0x27b602,_0x418485){DashboardEvents['emit'](_0x2725d0+':'+_0x78ea60['id'],_0x78ea60);DashboardEvents[_0xd6fc('0x5')](_0x2725d0,_0x78ea60);_0x418485(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0xd6fc('0x6')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 8d05bc8..643fc7a 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 _0x5fcf=['exports','define','Dashboard','dashboards','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboard.attributes'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5fcf,0x159));var _0xf5fc=function(_0x44a2e6,_0x359e3b){_0x44a2e6=_0x44a2e6-0x0;var _0x5096e9=_0x5fcf[_0x44a2e6];return _0x5096e9;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xf5fc('0x0'));var BPromise=require(_0xf5fc('0x1'));var rp=require(_0xf5fc('0x2'));var fs=require('fs');var path=require(_0xf5fc('0x3'));var rimraf=require(_0xf5fc('0x4'));var config=require(_0xf5fc('0x5'));var attributes=require(_0xf5fc('0x6'));module[_0xf5fc('0x7')]=function(_0x391f18,_0x41a8c4){return _0x391f18[_0xf5fc('0x8')](_0xf5fc('0x9'),attributes,{'tableName':_0xf5fc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4457=['dashboards','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./dashboard.attributes','exports','define','Dashboard'];(function(_0x1493b9,_0x4eb7db){var _0x11514f=function(_0x45409a){while(--_0x45409a){_0x1493b9['push'](_0x1493b9['shift']());}};_0x11514f(++_0x4eb7db);}(_0x4457,0xe1));var _0x7445=function(_0x2977fa,_0x1bef01){_0x2977fa=_0x2977fa-0x0;var _0x2a489f=_0x4457[_0x2977fa];return _0x2a489f;};'use strict';var _=require(_0x7445('0x0'));var util=require(_0x7445('0x1'));var logger=require(_0x7445('0x2'))(_0x7445('0x3'));var moment=require(_0x7445('0x4'));var BPromise=require(_0x7445('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7445('0x6'));var rimraf=require(_0x7445('0x7'));var config=require(_0x7445('0x8'));var attributes=require(_0x7445('0x9'));module[_0x7445('0xa')]=function(_0x168d39,_0x359792){return _0x168d39[_0x7445('0xb')](_0x7445('0xc'),attributes,{'tableName':_0x7445('0xd'),'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 d1e10c4..3da6879 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 _0xc5bd=['ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','then','Dashboard,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x216799,_0x44b817){var _0x3661c3=function(_0x28f85e){while(--_0x28f85e){_0x216799['push'](_0x216799['shift']());}};_0x3661c3(++_0x44b817);}(_0xc5bd,0x175));var _0xdc5b=function(_0x2200d6,_0x31ea51){_0x2200d6=_0x2200d6-0x0;var _0x5697c0=_0xc5bd[_0x2200d6];return _0x5697c0;};'use strict';var _=require(_0xdc5b('0x0'));var util=require(_0xdc5b('0x1'));var moment=require(_0xdc5b('0x2'));var BPromise=require(_0xdc5b('0x3'));var rs=require(_0xdc5b('0x4'));var fs=require('fs');var Redis=require(_0xdc5b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdc5b('0x6'));var logger=require('../../config/logger')(_0xdc5b('0x7'));var config=require(_0xdc5b('0x8'));var jayson=require(_0xdc5b('0x9'));var client=jayson[_0xdc5b('0xa')][_0xdc5b('0xb')]({'port':0x232a});config[_0xdc5b('0xc')]=_[_0xdc5b('0xd')](config[_0xdc5b('0xc')],{'host':_0xdc5b('0xe'),'port':0x18eb});var socket=require(_0xdc5b('0xf'))(new Redis(config['redis']));require(_0xdc5b('0x10'))[_0xdc5b('0x11')](socket);function respondWithRpcPromise(_0xfbaab6,_0x19cecf,_0x26a47d){return new BPromise(function(_0x185fc8,_0x555181){return client[_0xdc5b('0x12')](_0xfbaab6,_0x26a47d)[_0xdc5b('0x13')](function(_0x566260){logger['info'](_0xdc5b('0x14'),_0x19cecf,_0xdc5b('0x15'));logger[_0xdc5b('0x16')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x19cecf,_0xdc5b('0x15'),JSON['stringify'](_0x566260));if(_0x566260[_0xdc5b('0x17')]){if(_0x566260[_0xdc5b('0x17')][_0xdc5b('0x18')]===0x1f4){logger['error'](_0xdc5b('0x14'),_0x19cecf,_0x566260[_0xdc5b('0x17')][_0xdc5b('0x19')]);return _0x555181(_0x566260[_0xdc5b('0x17')][_0xdc5b('0x19')]);}logger[_0xdc5b('0x17')](_0xdc5b('0x14'),_0x19cecf,_0x566260[_0xdc5b('0x17')][_0xdc5b('0x19')]);return _0x185fc8(_0x566260['error'][_0xdc5b('0x19')]);}else{logger['info'](_0xdc5b('0x14'),_0x19cecf,'request\x20sent');_0x185fc8(_0x566260[_0xdc5b('0x1a')][_0xdc5b('0x19')]);}})['catch'](function(_0x288e45){logger['error'](_0xdc5b('0x14'),_0x19cecf,_0x288e45);_0x555181(_0x288e45);});});} \ No newline at end of file +var _0xa945=['info','Dashboard,\x20%s,\x20%s','debug','Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','request','then'];(function(_0x577f8c,_0x5386f1){var _0x5c28fd=function(_0x40592f){while(--_0x40592f){_0x577f8c['push'](_0x577f8c['shift']());}};_0x5c28fd(++_0x5386f1);}(_0xa945,0xfd));var _0x5a94=function(_0x88d72b,_0x161055){_0x88d72b=_0x88d72b-0x0;var _0x15a298=_0xa945[_0x88d72b];return _0x15a298;};'use strict';var _=require(_0x5a94('0x0'));var util=require('util');var moment=require(_0x5a94('0x1'));var BPromise=require('bluebird');var rs=require(_0x5a94('0x2'));var fs=require('fs');var Redis=require(_0x5a94('0x3'));var db=require(_0x5a94('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5a94('0x5'))(_0x5a94('0x6'));var config=require(_0x5a94('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5a94('0x8')][_0x5a94('0x9')]({'port':0x232a});config[_0x5a94('0xa')]=_[_0x5a94('0xb')](config[_0x5a94('0xa')],{'host':_0x5a94('0xc'),'port':0x18eb});var socket=require(_0x5a94('0xd'))(new Redis(config['redis']));require(_0x5a94('0xe'))['register'](socket);function respondWithRpcPromise(_0x7be798,_0x26d08a,_0x8247a4){return new BPromise(function(_0xd7b1ea,_0x4a94d1){return client[_0x5a94('0xf')](_0x7be798,_0x8247a4)[_0x5a94('0x10')](function(_0x220252){logger[_0x5a94('0x11')](_0x5a94('0x12'),_0x26d08a,'request\x20sent');logger[_0x5a94('0x13')](_0x5a94('0x14'),_0x26d08a,_0x5a94('0x15'),JSON['stringify'](_0x220252));if(_0x220252['error']){if(_0x220252['error'][_0x5a94('0x16')]===0x1f4){logger['error'](_0x5a94('0x12'),_0x26d08a,_0x220252[_0x5a94('0x17')][_0x5a94('0x18')]);return _0x4a94d1(_0x220252[_0x5a94('0x17')]['message']);}logger[_0x5a94('0x17')](_0x5a94('0x12'),_0x26d08a,_0x220252[_0x5a94('0x17')]['message']);return _0xd7b1ea(_0x220252[_0x5a94('0x17')]['message']);}else{logger['info']('Dashboard,\x20%s,\x20%s',_0x26d08a,_0x5a94('0x15'));_0xd7b1ea(_0x220252[_0x5a94('0x19')][_0x5a94('0x18')]);}})[_0x5a94('0x1a')](function(_0x564c11){logger[_0x5a94('0x17')](_0x5a94('0x12'),_0x26d08a,_0x564c11);_0x4a94d1(_0x564c11);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index ee5182a..5060ffb 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 _0x2dfa=['save','emit','removeListener','register','length','dashboard:','./dashboard.events'];(function(_0x7aa744,_0x450c0d){var _0x3ef3cb=function(_0x44cc93){while(--_0x44cc93){_0x7aa744['push'](_0x7aa744['shift']());}};_0x3ef3cb(++_0x450c0d);}(_0x2dfa,0x1b1));var _0xa2df=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x2dfa[_0x17d9e3];return _0x14192d;};'use strict';var DashboardEvents=require(_0xa2df('0x0'));var events=[_0xa2df('0x1'),'remove','update'];function createListener(_0x361f97,_0x1b765e){return function(_0x435dc8){_0x1b765e[_0xa2df('0x2')](_0x361f97,_0x435dc8);};}function removeListener(_0x4959eb,_0x38bd84){return function(){DashboardEvents[_0xa2df('0x3')](_0x4959eb,_0x38bd84);};}exports[_0xa2df('0x4')]=function(_0x120449){for(var _0x17e8f6=0x0,_0x25e280=events[_0xa2df('0x5')];_0x17e8f6<_0x25e280;_0x17e8f6++){var _0x1510a3=events[_0x17e8f6];var _0x50cd7c=createListener(_0xa2df('0x6')+_0x1510a3,_0x120449);DashboardEvents['on'](_0x1510a3,_0x50cd7c);}}; \ No newline at end of file +var _0xb51a=['save','remove','update','emit','removeListener','register','length','dashboard:'];(function(_0x4a1488,_0xad4189){var _0xbb51b2=function(_0xadd212){while(--_0xadd212){_0x4a1488['push'](_0x4a1488['shift']());}};_0xbb51b2(++_0xad4189);}(_0xb51a,0x1a8));var _0xab51=function(_0x3a5297,_0x17d53e){_0x3a5297=_0x3a5297-0x0;var _0x2737ca=_0xb51a[_0x3a5297];return _0x2737ca;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0xab51('0x0'),_0xab51('0x1'),_0xab51('0x2')];function createListener(_0x5ca83a,_0x1be89a){return function(_0x40e4a7){_0x1be89a[_0xab51('0x3')](_0x5ca83a,_0x40e4a7);};}function removeListener(_0x56dd2c,_0x397a6d){return function(){DashboardEvents[_0xab51('0x4')](_0x56dd2c,_0x397a6d);};}exports[_0xab51('0x5')]=function(_0x5c418e){for(var _0x42a5bc=0x0,_0x4dc09a=events[_0xab51('0x6')];_0x42a5bc<_0x4dc09a;_0x42a5bc++){var _0x58bda4=events[_0x42a5bc];var _0x3e54e7=createListener(_0xab51('0x7')+_0x58bda4,_0x5c418e);DashboardEvents['on'](_0x58bda4,_0x3e54e7);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 00653cc..9a31474 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 _0x2629=['clone','addItem','put','update','delete','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','index','/:id','isAuthenticated','show','/:id/items','getItems','post','/:id/clone'];(function(_0x147f19,_0x48194c){var _0x159877=function(_0xa00b35){while(--_0xa00b35){_0x147f19['push'](_0x147f19['shift']());}};_0x159877(++_0x48194c);}(_0x2629,0x1e6));var _0x9262=function(_0x357f00,_0x1e8454){_0x357f00=_0x357f00-0x0;var _0x450b67=_0x2629[_0x357f00];return _0x450b67;};'use strict';var multer=require(_0x9262('0x0'));var util=require(_0x9262('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9262('0x2'));var router=express[_0x9262('0x3')]();var fs_extra=require(_0x9262('0x4'));var auth=require(_0x9262('0x5'));var interaction=require(_0x9262('0x6'));var config=require(_0x9262('0x7'));var controller=require(_0x9262('0x8'));router[_0x9262('0x9')]('/',auth['isAuthenticated'](),controller[_0x9262('0xa')]);router[_0x9262('0x9')](_0x9262('0xb'),auth[_0x9262('0xc')](),controller[_0x9262('0xd')]);router['get'](_0x9262('0xe'),auth[_0x9262('0xc')](),controller[_0x9262('0xf')]);router[_0x9262('0x10')]('/',auth[_0x9262('0xc')](),controller['create']);router[_0x9262('0x10')](_0x9262('0x11'),auth[_0x9262('0xc')](),controller[_0x9262('0x12')]);router[_0x9262('0x10')](_0x9262('0xe'),auth[_0x9262('0xc')](),controller[_0x9262('0x13')]);router[_0x9262('0x14')]('/:id',auth[_0x9262('0xc')](),controller[_0x9262('0x15')]);router[_0x9262('0x16')](_0x9262('0xb'),auth[_0x9262('0xc')](),controller['destroy']);module[_0x9262('0x17')]=router; \ No newline at end of file +var _0xd9c3=['../../components/interaction/service','../../config/environment','./dashboard.controller','isAuthenticated','index','/:id','show','get','/:id/items','getItems','post','/:id/clone','clone','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x514244,_0x3d5e2c){var _0xdcd1f6=function(_0x36a417){while(--_0x36a417){_0x514244['push'](_0x514244['shift']());}};_0xdcd1f6(++_0x3d5e2c);}(_0xd9c3,0x8f));var _0x3d9c=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0xd9c3[_0x2b5eae];return _0x5f3ac9;};'use strict';var multer=require(_0x3d9c('0x0'));var util=require(_0x3d9c('0x1'));var path=require(_0x3d9c('0x2'));var timeout=require(_0x3d9c('0x3'));var express=require('express');var router=express[_0x3d9c('0x4')]();var fs_extra=require(_0x3d9c('0x5'));var auth=require(_0x3d9c('0x6'));var interaction=require(_0x3d9c('0x7'));var config=require(_0x3d9c('0x8'));var controller=require(_0x3d9c('0x9'));router['get']('/',auth[_0x3d9c('0xa')](),controller[_0x3d9c('0xb')]);router['get'](_0x3d9c('0xc'),auth[_0x3d9c('0xa')](),controller[_0x3d9c('0xd')]);router[_0x3d9c('0xe')](_0x3d9c('0xf'),auth['isAuthenticated'](),controller[_0x3d9c('0x10')]);router[_0x3d9c('0x11')]('/',auth[_0x3d9c('0xa')](),controller['create']);router['post'](_0x3d9c('0x12'),auth[_0x3d9c('0xa')](),controller[_0x3d9c('0x13')]);router[_0x3d9c('0x11')](_0x3d9c('0xf'),auth[_0x3d9c('0xa')](),controller['addItem']);router[_0x3d9c('0x14')](_0x3d9c('0xc'),auth[_0x3d9c('0xa')](),controller[_0x3d9c('0x15')]);router[_0x3d9c('0x16')](_0x3d9c('0xc'),auth['isAuthenticated'](),controller[_0x3d9c('0x17')]);module[_0x3d9c('0x18')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index a464a09..0e048fd 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 _0x7096=['setDataValue','stringify','INTEGER','#ffffff','squel','exports','STRING','TEXT','long','parse','getDataValue','attrs'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7096,0x10c));var _0x6709=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x7096[_0xa1e3e3];return _0xc980e9;};'use strict';var Sequelize=require('sequelize');var squel=require(_0x6709('0x0'));var _=require('lodash');module[_0x6709('0x1')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6709('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x6709('0x3')](_0x6709('0x4')),'get':function(){try{return JSON[_0x6709('0x5')](this[_0x6709('0x6')](_0x6709('0x7')));}catch(_0xb8fe6d){return[];}},'set':function(_0x9d630f){try{this[_0x6709('0x8')](_0x6709('0x7'),JSON[_0x6709('0x9')](_0x9d630f));}catch(_0x985814){this[_0x6709('0x8')]('attrs',JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x6709('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x6709('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x6709('0xa')]},'col':{'type':Sequelize[_0x6709('0xa')]},'background':{'type':Sequelize[_0x6709('0x2')],'allowNull':![],'defaultValue':_0x6709('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x6709('0x2')]},'titleFontSize':{'type':Sequelize[_0x6709('0xa')],'defaultValue':0xc}}; \ No newline at end of file +var _0x90b1=['#2196f3','sequelize','squel','lodash','STRING','TEXT','long','parse','setDataValue','attrs','stringify','INTEGER','#ffffff'];(function(_0x395d09,_0x5c8be5){var _0x30316a=function(_0xf2bb50){while(--_0xf2bb50){_0x395d09['push'](_0x395d09['shift']());}};_0x30316a(++_0x5c8be5);}(_0x90b1,0x1bb));var _0x190b=function(_0x5473da,_0x49396c){_0x5473da=_0x5473da-0x0;var _0x3b0928=_0x90b1[_0x5473da];return _0x3b0928;};'use strict';var Sequelize=require(_0x190b('0x0'));var squel=require(_0x190b('0x1'));var _=require(_0x190b('0x2'));module['exports']={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x190b('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x190b('0x4')](_0x190b('0x5')),'get':function(){try{return JSON[_0x190b('0x6')](this['getDataValue']('attrs'));}catch(_0x5cbebb){return[];}},'set':function(_0x5da9c1){try{this[_0x190b('0x7')](_0x190b('0x8'),JSON[_0x190b('0x9')](_0x5da9c1));}catch(_0x626aa1){this[_0x190b('0x7')](_0x190b('0x8'),JSON[_0x190b('0x9')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x190b('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x190b('0xa')]},'col':{'type':Sequelize[_0x190b('0xa')]},'background':{'type':Sequelize[_0x190b('0x3')],'allowNull':![],'defaultValue':_0x190b('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x190b('0x3')],'allowNull':![],'defaultValue':_0x190b('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x190b('0x3')]},'titleFontSize':{'type':Sequelize['INTEGER'],'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 a4495e3..e91fdfa 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 _0x9b69=['undefined','count','set','Content-Range','apply','reject','save','update','then','name','show','model','keys','DashboardItem','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','merge','options','find','catch','destroy','params','type','iframe','attrUrl','attrs','custom','attrPath','value','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','error','widgetAttributes:\x20%s','stringify','create','body','eml-format','rimraf','zip-dir','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','register','sendStatus','status','end','json','offset'];(function(_0x20ae75,_0x39c98e){var _0x3832f5=function(_0x16a1c9){while(--_0x16a1c9){_0x20ae75['push'](_0x20ae75['shift']());}};_0x3832f5(++_0x39c98e);}(_0x9b69,0xa3));var _0x99b6=function(_0x55b624,_0x502419){_0x55b624=_0x55b624-0x0;var _0x475e02=_0x9b69[_0x55b624];return _0x475e02;};'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('bluebird');var Mustache=require(_0x99b6('0x4'));var util=require(_0x99b6('0x5'));var path=require(_0x99b6('0x6'));var sox=require('sox');var csv=require(_0x99b6('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x99b6('0x8'));var _=require(_0x99b6('0x9'));var squel=require(_0x99b6('0xa'));var crypto=require(_0x99b6('0xb'));var jsforce=require(_0x99b6('0xc'));var deskjs=require(_0x99b6('0xd'));var toCsv=require(_0x99b6('0x7'));var querystring=require(_0x99b6('0xe'));var Papa=require(_0x99b6('0xf'));var Redis=require(_0x99b6('0x10'));var authService=require(_0x99b6('0x11'));var qs=require(_0x99b6('0x12'));var as=require(_0x99b6('0x13'));var hardwareService=require(_0x99b6('0x14'));var logger=require(_0x99b6('0x15'))(_0x99b6('0x16'));var utils=require(_0x99b6('0x17'));var config=require(_0x99b6('0x18'));var licenseUtil=require(_0x99b6('0x19'));var db=require(_0x99b6('0x1a'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./dashboardItem.socket')[_0x99b6('0x1b')](socket);function respondWithStatusCode(_0x184e90,_0x2cda40){_0x2cda40=_0x2cda40||0xcc;return function(_0x54a474){if(_0x54a474){return _0x184e90[_0x99b6('0x1c')](_0x2cda40);}return _0x184e90[_0x99b6('0x1d')](_0x2cda40)[_0x99b6('0x1e')]();};}function respondWithResult(_0x417e9a,_0x4857a2){_0x4857a2=_0x4857a2||0xc8;return function(_0x433b59){if(_0x433b59){return _0x417e9a[_0x99b6('0x1d')](_0x4857a2)[_0x99b6('0x1f')](_0x433b59);}};}function respondWithFilteredResult(_0x2a2bf2,_0x453735){return function(_0x3fd5ad){if(_0x3fd5ad){var _0x1a6436=typeof _0x453735[_0x99b6('0x20')]===_0x99b6('0x21')&&typeof _0x453735['limit']===_0x99b6('0x21');var _0x391c6a=_0x3fd5ad[_0x99b6('0x22')];var _0x2036bb=_0x1a6436?0x0:_0x453735[_0x99b6('0x20')];var _0xc65470=_0x1a6436?_0x3fd5ad[_0x99b6('0x22')]:_0x453735['offset']+_0x453735['limit'];var _0x11b866;if(_0xc65470>=_0x391c6a){_0xc65470=_0x391c6a;_0x11b866=0xc8;}else{_0x11b866=0xce;}_0x2a2bf2[_0x99b6('0x1d')](_0x11b866);return _0x2a2bf2[_0x99b6('0x23')](_0x99b6('0x24'),_0x2036bb+'-'+_0xc65470+'/'+_0x391c6a)['json'](_0x3fd5ad);}return null;};}function patchUpdates(_0x38a916){return function(_0x8ad5c4){try{jsonpatch[_0x99b6('0x25')](_0x8ad5c4,_0x38a916,!![]);}catch(_0x563210){return BPromise[_0x99b6('0x26')](_0x563210);}return _0x8ad5c4[_0x99b6('0x27')]();};}function saveUpdates(_0x454d43,_0x2ea098){return function(_0x319e66){if(_0x319e66){return _0x319e66[_0x99b6('0x28')](_0x454d43)[_0x99b6('0x29')](function(_0x2d92a6){return _0x2d92a6;});}return null;};}function removeEntity(_0x1f8f01,_0x58176f){return function(_0xaa8d52){if(_0xaa8d52){return _0xaa8d52['destroy']()[_0x99b6('0x29')](function(){_0x1f8f01['status'](0xcc)[_0x99b6('0x1e')]();});}};}function handleEntityNotFound(_0x246b17,_0x49dc9a){return function(_0x5dcf7f){if(!_0x5dcf7f){_0x246b17[_0x99b6('0x1c')](0x194);}return _0x5dcf7f;};}function handleError(_0x9617c4,_0x368e6e){_0x368e6e=_0x368e6e||0x1f4;return function(_0x48f796){logger['error'](_0x48f796['stack']);if(_0x48f796['name']){delete _0x48f796[_0x99b6('0x2a')];}_0x9617c4[_0x99b6('0x1d')](_0x368e6e)['send'](_0x48f796);};}exports[_0x99b6('0x2b')]=function(_0x3e4461,_0x2228d1){var _0x311351={'raw':![],'where':{'id':_0x3e4461['params']['id']}},_0x200caf={};_0x200caf[_0x99b6('0x2c')]=_[_0x99b6('0x2d')](db[_0x99b6('0x2e')][_0x99b6('0x2f')]);_0x200caf[_0x99b6('0x30')]=_['keys'](_0x3e4461[_0x99b6('0x30')]);_0x200caf[_0x99b6('0x31')]=_[_0x99b6('0x32')](_0x200caf[_0x99b6('0x2c')],_0x200caf[_0x99b6('0x30')]);_0x311351[_0x99b6('0x33')]=_[_0x99b6('0x32')](_0x200caf[_0x99b6('0x2c')],qs['fields'](_0x3e4461[_0x99b6('0x30')][_0x99b6('0x34')]));_0x311351[_0x99b6('0x33')]=_0x311351[_0x99b6('0x33')][_0x99b6('0x35')]?_0x311351[_0x99b6('0x33')]:_0x200caf[_0x99b6('0x2c')];if(_0x3e4461[_0x99b6('0x30')][_0x99b6('0x36')]){_0x311351['include']=[{'all':!![]}];}_0x311351=_[_0x99b6('0x37')]({},_0x311351,_0x3e4461[_0x99b6('0x38')]);return db['DashboardItem'][_0x99b6('0x39')](_0x311351)['then'](handleEntityNotFound(_0x2228d1,null))[_0x99b6('0x29')](respondWithResult(_0x2228d1,null))[_0x99b6('0x3a')](handleError(_0x2228d1,null));};exports[_0x99b6('0x3b')]=function(_0x1350b1,_0x4e5fb5){return db[_0x99b6('0x2e')]['find']({'where':{'id':_0x1350b1[_0x99b6('0x3c')]['id']}})[_0x99b6('0x29')](handleEntityNotFound(_0x4e5fb5,null))[_0x99b6('0x29')](removeEntity(_0x4e5fb5,null))[_0x99b6('0x3a')](handleError(_0x4e5fb5,null));};function widgetAttributes(_0x172422){try{switch(_0x172422[_0x99b6('0x3d')]){case _0x99b6('0x3e'):return[{'name':_0x99b6('0x3f'),'value':_0x172422[_0x99b6('0x3f')]||(_0x172422[_0x99b6('0x40')]&&_0x172422[_0x99b6('0x40')][0x0]?_0x172422[_0x99b6('0x40')][0x0]['value']:undefined)||'https://'}];case _0x99b6('0x41'):return[{'name':_0x99b6('0x42'),'value':_0x172422[_0x99b6('0x42')]||(_0x172422[_0x99b6('0x40')]&&_0x172422['attrs'][0x0]?_0x172422[_0x99b6('0x40')][0x0][_0x99b6('0x43')]:undefined)||''}];case'clock':return[{'name':_0x99b6('0x44'),'value':_0x172422['attrHourFormat']||(_0x172422['attrs']&&_0x172422['attrs'][0x0]?_0x172422[_0x99b6('0x40')][0x0]['value']:undefined)||_0x99b6('0x45')},{'name':_0x99b6('0x46'),'value':_0x172422['attrTimezone']||(_0x172422[_0x99b6('0x40')]&&_0x172422[_0x99b6('0x40')][0x1]?_0x172422[_0x99b6('0x40')][0x1][_0x99b6('0x43')]:undefined)||_0x99b6('0x47')},{'name':_0x99b6('0x48'),'value':_0x172422[_0x99b6('0x48')]||(_0x172422[_0x99b6('0x40')]&&_0x172422[_0x99b6('0x40')][0x2]?_0x172422['attrs'][0x2][_0x99b6('0x43')]:undefined)||0xc}];case _0x99b6('0x49'):return[{'name':'attrMetric','value':_0x172422['attrMetric']||(_0x172422[_0x99b6('0x40')]&&_0x172422[_0x99b6('0x40')][0x0]?_0x172422[_0x99b6('0x40')][0x0][_0x99b6('0x43')]:undefined)||_0x99b6('0x4a')},{'name':_0x99b6('0x4b'),'value':_0x172422[_0x99b6('0x4b')]||(_0x172422[_0x99b6('0x40')]&&_0x172422[_0x99b6('0x40')][0x1]?_0x172422[_0x99b6('0x40')][0x1][_0x99b6('0x43')]:undefined)||[]},{'name':_0x99b6('0x48'),'value':_0x172422[_0x99b6('0x48')]||(_0x172422['attrs']&&_0x172422['attrs'][0x2]?_0x172422[_0x99b6('0x40')][0x2]['value']:undefined)||0x14},{'name':'attrChannel','value':_0x172422[_0x99b6('0x4c')]||(_0x172422[_0x99b6('0x40')]&&_0x172422[_0x99b6('0x40')][0x3]?_0x172422[_0x99b6('0x40')][0x3][_0x99b6('0x43')]:undefined)||_0x99b6('0x4d')},{'name':_0x99b6('0x4e'),'value':_0x172422[_0x99b6('0x4e')]||(_0x172422['attrs']&&_0x172422['attrs'][0x4]?_0x172422[_0x99b6('0x40')][0x4][_0x99b6('0x43')]:undefined)||''},{'name':_0x99b6('0x4f'),'value':_0x172422['attrFaxAccounts']||(_0x172422['attrs']&&_0x172422[_0x99b6('0x40')][0x5]?_0x172422[_0x99b6('0x40')][0x5]['value']:undefined)||''},{'name':_0x99b6('0x50'),'value':_0x172422['attrSmsAccounts']||(_0x172422[_0x99b6('0x40')]&&_0x172422[_0x99b6('0x40')][0x6]?_0x172422[_0x99b6('0x40')][0x6][_0x99b6('0x43')]:undefined)||''},{'name':_0x99b6('0x51'),'value':_0x172422[_0x99b6('0x51')]||(_0x172422[_0x99b6('0x40')]&&_0x172422[_0x99b6('0x40')][0x7]?_0x172422[_0x99b6('0x40')][0x7][_0x99b6('0x43')]:undefined)||''},{'name':_0x99b6('0x52'),'value':_0x172422['attrWhatsappAccounts']||(_0x172422[_0x99b6('0x40')]&&_0x172422[_0x99b6('0x40')][0x8]?_0x172422[_0x99b6('0x40')][0x8]['value']:undefined)||''},{'name':_0x99b6('0x53'),'value':_0x172422[_0x99b6('0x53')]||(_0x172422[_0x99b6('0x40')]&&_0x172422[_0x99b6('0x40')][0x9]?_0x172422[_0x99b6('0x40')][0x9][_0x99b6('0x43')]:undefined)||''}];case _0x99b6('0x54'):case _0x99b6('0x55'):return[{'name':'attrSerie1','value':_0x172422[_0x99b6('0x56')]||(_0x172422['attrs']&&_0x172422[_0x99b6('0x40')][0x0]?_0x172422['attrs'][0x0][_0x99b6('0x43')]:undefined)||_0x99b6('0x4a')},{'name':_0x99b6('0x57'),'value':_0x172422[_0x99b6('0x57')]||(_0x172422[_0x99b6('0x40')]&&_0x172422[_0x99b6('0x40')][0x1]?_0x172422['attrs'][0x1][_0x99b6('0x43')]:undefined)||null},{'name':_0x99b6('0x58'),'value':_0x172422['attrSerie3']||(_0x172422[_0x99b6('0x40')]&&_0x172422[_0x99b6('0x40')][0x2]?_0x172422[_0x99b6('0x40')][0x2][_0x99b6('0x43')]:undefined)||null},{'name':_0x99b6('0x4b'),'value':_0x172422[_0x99b6('0x4b')]||(_0x172422['attrs']&&_0x172422[_0x99b6('0x40')][0x3]?_0x172422[_0x99b6('0x40')][0x3][_0x99b6('0x43')]:undefined)||[]},{'name':_0x99b6('0x4c'),'value':_0x172422[_0x99b6('0x4c')]||(_0x172422[_0x99b6('0x40')]&&_0x172422['attrs'][0x4]?_0x172422[_0x99b6('0x40')][0x4][_0x99b6('0x43')]:undefined)||'voice'},{'name':_0x99b6('0x4e'),'value':_0x172422[_0x99b6('0x4e')]||(_0x172422[_0x99b6('0x40')]&&_0x172422[_0x99b6('0x40')][0x5]?_0x172422[_0x99b6('0x40')][0x5][_0x99b6('0x43')]:undefined)||''},{'name':_0x99b6('0x4f'),'value':_0x172422['attrFaxAccounts']||(_0x172422[_0x99b6('0x40')]&&_0x172422[_0x99b6('0x40')][0x6]?_0x172422[_0x99b6('0x40')][0x6]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x172422[_0x99b6('0x50')]||(_0x172422[_0x99b6('0x40')]&&_0x172422[_0x99b6('0x40')][0x7]?_0x172422[_0x99b6('0x40')][0x7][_0x99b6('0x43')]:undefined)||''},{'name':_0x99b6('0x51'),'value':_0x172422[_0x99b6('0x51')]||(_0x172422[_0x99b6('0x40')]&&_0x172422['attrs'][0x8]?_0x172422[_0x99b6('0x40')][0x8][_0x99b6('0x43')]:undefined)||''},{'name':_0x99b6('0x52'),'value':_0x172422['attrWhatsappAccounts']||(_0x172422[_0x99b6('0x40')]&&_0x172422[_0x99b6('0x40')][0x9]?_0x172422['attrs'][0x9]['value']:undefined)||''},{'name':_0x99b6('0x53'),'value':_0x172422[_0x99b6('0x53')]||(_0x172422[_0x99b6('0x40')]&&_0x172422[_0x99b6('0x40')][0xa]?_0x172422[_0x99b6('0x40')][0xa][_0x99b6('0x43')]:undefined)||''}];case _0x99b6('0x59'):return[{'name':_0x99b6('0x5a'),'type':_0x172422[_0x99b6('0x5b')]||(_0x172422[_0x99b6('0x40')]&&_0x172422[_0x99b6('0x40')][0x0]?_0x172422[_0x99b6('0x40')][0x0]['type']:undefined)||null,'value':_0x172422[_0x99b6('0x5a')]||(_0x172422[_0x99b6('0x40')]&&_0x172422['attrs'][0x0]?_0x172422[_0x99b6('0x40')][0x0]['value']:undefined)||null},{'name':_0x99b6('0x5c'),'value':_0x172422[_0x99b6('0x5c')]||(_0x172422[_0x99b6('0x40')]&&_0x172422['attrs'][0x1]?_0x172422['attrs'][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x454875){logger[_0x99b6('0x5d')](_0x99b6('0x5e'),JSON[_0x99b6('0x5f')](_0x454875));return[];}}exports[_0x99b6('0x60')]=function(_0x33c57a,_0x1da94b){if(_0x33c57a['body']){_0x33c57a[_0x99b6('0x61')]['attrs']=widgetAttributes(_0x33c57a['body']);}return db[_0x99b6('0x2e')][_0x99b6('0x60')](_0x33c57a[_0x99b6('0x61')],{})[_0x99b6('0x29')](respondWithResult(_0x1da94b,0xc9))[_0x99b6('0x3a')](handleError(_0x1da94b,null));};exports[_0x99b6('0x28')]=function(_0x361ca5,_0xbff277){if(_0x361ca5[_0x99b6('0x61')]['id']){delete _0x361ca5[_0x99b6('0x61')]['id'];}_0x361ca5[_0x99b6('0x61')]['attrs']=widgetAttributes(_0x361ca5['body']);return db[_0x99b6('0x2e')][_0x99b6('0x39')]({'where':{'id':_0x361ca5[_0x99b6('0x3c')]['id']}})[_0x99b6('0x29')](handleEntityNotFound(_0xbff277,null))[_0x99b6('0x29')](saveUpdates(_0x361ca5['body'],null))[_0x99b6('0x29')](respondWithResult(_0xbff277,null))[_0x99b6('0x3a')](handleError(_0xbff277,null));}; \ No newline at end of file +var _0x524e=['attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrWhatsappAccounts','web-report','attrReport','reportType','attrRefresh','error','widgetAttributes:\x20%s','stringify','create','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./dashboardItem.socket','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','destroy','then','stack','name','send','params','model','DashboardItem','query','filters','intersection','fields','attributes','length','include','merge','options','find','catch','type','iframe'];(function(_0x21cc56,_0x1ce4f1){var _0x5a8ce3=function(_0x1fb110){while(--_0x1fb110){_0x21cc56['push'](_0x21cc56['shift']());}};_0x5a8ce3(++_0x1ce4f1);}(_0x524e,0x15e));var _0xe524=function(_0x2c76be,_0x21ccd6){_0x2c76be=_0x2c76be-0x0;var _0x149bb3=_0x524e[_0x2c76be];return _0x149bb3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe524('0x0'));var jsonpatch=require(_0xe524('0x1'));var rp=require(_0xe524('0x2'));var moment=require(_0xe524('0x3'));var BPromise=require(_0xe524('0x4'));var Mustache=require(_0xe524('0x5'));var util=require(_0xe524('0x6'));var path=require(_0xe524('0x7'));var sox=require(_0xe524('0x8'));var csv=require(_0xe524('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe524('0xa'));var _=require(_0xe524('0xb'));var squel=require(_0xe524('0xc'));var crypto=require('crypto');var jsforce=require(_0xe524('0xd'));var deskjs=require(_0xe524('0xe'));var toCsv=require(_0xe524('0x9'));var querystring=require(_0xe524('0xf'));var Papa=require(_0xe524('0x10'));var Redis=require(_0xe524('0x11'));var authService=require(_0xe524('0x12'));var qs=require(_0xe524('0x13'));var as=require(_0xe524('0x14'));var hardwareService=require(_0xe524('0x15'));var logger=require(_0xe524('0x16'))(_0xe524('0x17'));var utils=require(_0xe524('0x18'));var config=require(_0xe524('0x19'));var licenseUtil=require(_0xe524('0x1a'));var db=require(_0xe524('0x1b'))['db'];config['redis']=_['defaults'](config[_0xe524('0x1c')],{'host':_0xe524('0x1d'),'port':0x18eb});var socket=require(_0xe524('0x1e'))(new Redis(config[_0xe524('0x1c')]));require(_0xe524('0x1f'))['register'](socket);function respondWithStatusCode(_0x12ff75,_0x51e9fe){_0x51e9fe=_0x51e9fe||0xcc;return function(_0x19f013){if(_0x19f013){return _0x12ff75[_0xe524('0x20')](_0x51e9fe);}return _0x12ff75['status'](_0x51e9fe)[_0xe524('0x21')]();};}function respondWithResult(_0x488fce,_0x109795){_0x109795=_0x109795||0xc8;return function(_0x538754){if(_0x538754){return _0x488fce[_0xe524('0x22')](_0x109795)['json'](_0x538754);}};}function respondWithFilteredResult(_0x5c8736,_0x5a5c0d){return function(_0x3a4027){if(_0x3a4027){var _0x4f1dfb=typeof _0x5a5c0d[_0xe524('0x23')]===_0xe524('0x24')&&typeof _0x5a5c0d[_0xe524('0x25')]===_0xe524('0x24');var _0x5d7b17=_0x3a4027[_0xe524('0x26')];var _0x3ccb3f=_0x4f1dfb?0x0:_0x5a5c0d['offset'];var _0x467c2a=_0x4f1dfb?_0x3a4027[_0xe524('0x26')]:_0x5a5c0d[_0xe524('0x23')]+_0x5a5c0d[_0xe524('0x25')];var _0x1c4194;if(_0x467c2a>=_0x5d7b17){_0x467c2a=_0x5d7b17;_0x1c4194=0xc8;}else{_0x1c4194=0xce;}_0x5c8736[_0xe524('0x22')](_0x1c4194);return _0x5c8736[_0xe524('0x27')](_0xe524('0x28'),_0x3ccb3f+'-'+_0x467c2a+'/'+_0x5d7b17)[_0xe524('0x29')](_0x3a4027);}return null;};}function patchUpdates(_0x5c4d21){return function(_0x7d1f92){try{jsonpatch['apply'](_0x7d1f92,_0x5c4d21,!![]);}catch(_0x577d1f){return BPromise[_0xe524('0x2a')](_0x577d1f);}return _0x7d1f92[_0xe524('0x2b')]();};}function saveUpdates(_0x1ad106,_0x85fc51){return function(_0x599d5d){if(_0x599d5d){return _0x599d5d[_0xe524('0x2c')](_0x1ad106)['then'](function(_0x17e245){return _0x17e245;});}return null;};}function removeEntity(_0xcf5db,_0xd62772){return function(_0x3cd922){if(_0x3cd922){return _0x3cd922[_0xe524('0x2d')]()[_0xe524('0x2e')](function(){_0xcf5db[_0xe524('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58a896,_0x283f18){return function(_0x45abad){if(!_0x45abad){_0x58a896[_0xe524('0x20')](0x194);}return _0x45abad;};}function handleError(_0x109a96,_0x359c8b){_0x359c8b=_0x359c8b||0x1f4;return function(_0x5405e4){logger['error'](_0x5405e4[_0xe524('0x2f')]);if(_0x5405e4[_0xe524('0x30')]){delete _0x5405e4[_0xe524('0x30')];}_0x109a96[_0xe524('0x22')](_0x359c8b)[_0xe524('0x31')](_0x5405e4);};}exports['show']=function(_0x365a1f,_0x9a7e98){var _0x4a4e15={'raw':![],'where':{'id':_0x365a1f[_0xe524('0x32')]['id']}},_0x5b7ded={};_0x5b7ded[_0xe524('0x33')]=_['keys'](db[_0xe524('0x34')]['rawAttributes']);_0x5b7ded[_0xe524('0x35')]=_['keys'](_0x365a1f[_0xe524('0x35')]);_0x5b7ded[_0xe524('0x36')]=_[_0xe524('0x37')](_0x5b7ded['model'],_0x5b7ded[_0xe524('0x35')]);_0x4a4e15['attributes']=_[_0xe524('0x37')](_0x5b7ded[_0xe524('0x33')],qs[_0xe524('0x38')](_0x365a1f['query'][_0xe524('0x38')]));_0x4a4e15[_0xe524('0x39')]=_0x4a4e15['attributes'][_0xe524('0x3a')]?_0x4a4e15[_0xe524('0x39')]:_0x5b7ded[_0xe524('0x33')];if(_0x365a1f[_0xe524('0x35')]['includeAll']){_0x4a4e15[_0xe524('0x3b')]=[{'all':!![]}];}_0x4a4e15=_[_0xe524('0x3c')]({},_0x4a4e15,_0x365a1f[_0xe524('0x3d')]);return db[_0xe524('0x34')][_0xe524('0x3e')](_0x4a4e15)[_0xe524('0x2e')](handleEntityNotFound(_0x9a7e98,null))[_0xe524('0x2e')](respondWithResult(_0x9a7e98,null))[_0xe524('0x3f')](handleError(_0x9a7e98,null));};exports['destroy']=function(_0x150a9f,_0x56f371){return db[_0xe524('0x34')][_0xe524('0x3e')]({'where':{'id':_0x150a9f['params']['id']}})[_0xe524('0x2e')](handleEntityNotFound(_0x56f371,null))['then'](removeEntity(_0x56f371,null))[_0xe524('0x3f')](handleError(_0x56f371,null));};function widgetAttributes(_0x41af26){try{switch(_0x41af26[_0xe524('0x40')]){case _0xe524('0x41'):return[{'name':_0xe524('0x42'),'value':_0x41af26[_0xe524('0x42')]||(_0x41af26[_0xe524('0x43')]&&_0x41af26[_0xe524('0x43')][0x0]?_0x41af26['attrs'][0x0][_0xe524('0x44')]:undefined)||_0xe524('0x45')}];case _0xe524('0x46'):return[{'name':_0xe524('0x47'),'value':_0x41af26[_0xe524('0x47')]||(_0x41af26[_0xe524('0x43')]&&_0x41af26[_0xe524('0x43')][0x0]?_0x41af26[_0xe524('0x43')][0x0]['value']:undefined)||''}];case _0xe524('0x48'):return[{'name':_0xe524('0x49'),'value':_0x41af26[_0xe524('0x49')]||(_0x41af26['attrs']&&_0x41af26[_0xe524('0x43')][0x0]?_0x41af26['attrs'][0x0][_0xe524('0x44')]:undefined)||_0xe524('0x4a')},{'name':_0xe524('0x4b'),'value':_0x41af26[_0xe524('0x4b')]||(_0x41af26[_0xe524('0x43')]&&_0x41af26[_0xe524('0x43')][0x1]?_0x41af26[_0xe524('0x43')][0x1]['value']:undefined)||_0xe524('0x4c')},{'name':_0xe524('0x4d'),'value':_0x41af26[_0xe524('0x4d')]||(_0x41af26[_0xe524('0x43')]&&_0x41af26[_0xe524('0x43')][0x2]?_0x41af26[_0xe524('0x43')][0x2]['value']:undefined)||0xc}];case _0xe524('0x4e'):return[{'name':_0xe524('0x4f'),'value':_0x41af26[_0xe524('0x4f')]||(_0x41af26['attrs']&&_0x41af26[_0xe524('0x43')][0x0]?_0x41af26['attrs'][0x0]['value']:undefined)||_0xe524('0x50')},{'name':_0xe524('0x51'),'value':_0x41af26['attrVoiceQueues']||(_0x41af26[_0xe524('0x43')]&&_0x41af26[_0xe524('0x43')][0x1]?_0x41af26[_0xe524('0x43')][0x1][_0xe524('0x44')]:undefined)||[]},{'name':'attrFontSize','value':_0x41af26['attrFontSize']||(_0x41af26[_0xe524('0x43')]&&_0x41af26[_0xe524('0x43')][0x2]?_0x41af26['attrs'][0x2][_0xe524('0x44')]:undefined)||0x14},{'name':'attrChannel','value':_0x41af26[_0xe524('0x52')]||(_0x41af26[_0xe524('0x43')]&&_0x41af26[_0xe524('0x43')][0x3]?_0x41af26[_0xe524('0x43')][0x3][_0xe524('0x44')]:undefined)||_0xe524('0x53')},{'name':_0xe524('0x54'),'value':_0x41af26[_0xe524('0x54')]||(_0x41af26[_0xe524('0x43')]&&_0x41af26[_0xe524('0x43')][0x4]?_0x41af26[_0xe524('0x43')][0x4][_0xe524('0x44')]:undefined)||''},{'name':_0xe524('0x55'),'value':_0x41af26[_0xe524('0x55')]||(_0x41af26[_0xe524('0x43')]&&_0x41af26['attrs'][0x5]?_0x41af26[_0xe524('0x43')][0x5]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x41af26[_0xe524('0x56')]||(_0x41af26['attrs']&&_0x41af26[_0xe524('0x43')][0x6]?_0x41af26[_0xe524('0x43')][0x6]['value']:undefined)||''},{'name':_0xe524('0x57'),'value':_0x41af26['attrOpenchannelAccounts']||(_0x41af26['attrs']&&_0x41af26[_0xe524('0x43')][0x7]?_0x41af26[_0xe524('0x43')][0x7][_0xe524('0x44')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x41af26['attrWhatsappAccounts']||(_0x41af26['attrs']&&_0x41af26['attrs'][0x8]?_0x41af26['attrs'][0x8]['value']:undefined)||''},{'name':_0xe524('0x58'),'value':_0x41af26[_0xe524('0x58')]||(_0x41af26['attrs']&&_0x41af26[_0xe524('0x43')][0x9]?_0x41af26[_0xe524('0x43')][0x9][_0xe524('0x44')]:undefined)||''}];case _0xe524('0x59'):case _0xe524('0x5a'):return[{'name':'attrSerie1','value':_0x41af26[_0xe524('0x5b')]||(_0x41af26[_0xe524('0x43')]&&_0x41af26[_0xe524('0x43')][0x0]?_0x41af26['attrs'][0x0][_0xe524('0x44')]:undefined)||'total'},{'name':_0xe524('0x5c'),'value':_0x41af26[_0xe524('0x5c')]||(_0x41af26[_0xe524('0x43')]&&_0x41af26[_0xe524('0x43')][0x1]?_0x41af26[_0xe524('0x43')][0x1][_0xe524('0x44')]:undefined)||null},{'name':_0xe524('0x5d'),'value':_0x41af26[_0xe524('0x5d')]||(_0x41af26[_0xe524('0x43')]&&_0x41af26[_0xe524('0x43')][0x2]?_0x41af26[_0xe524('0x43')][0x2][_0xe524('0x44')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x41af26['attrVoiceQueues']||(_0x41af26['attrs']&&_0x41af26[_0xe524('0x43')][0x3]?_0x41af26[_0xe524('0x43')][0x3][_0xe524('0x44')]:undefined)||[]},{'name':_0xe524('0x52'),'value':_0x41af26[_0xe524('0x52')]||(_0x41af26[_0xe524('0x43')]&&_0x41af26[_0xe524('0x43')][0x4]?_0x41af26[_0xe524('0x43')][0x4][_0xe524('0x44')]:undefined)||_0xe524('0x53')},{'name':_0xe524('0x54'),'value':_0x41af26['attrEmailAccounts']||(_0x41af26[_0xe524('0x43')]&&_0x41af26[_0xe524('0x43')][0x5]?_0x41af26['attrs'][0x5]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x41af26['attrFaxAccounts']||(_0x41af26[_0xe524('0x43')]&&_0x41af26[_0xe524('0x43')][0x6]?_0x41af26[_0xe524('0x43')][0x6][_0xe524('0x44')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x41af26[_0xe524('0x56')]||(_0x41af26[_0xe524('0x43')]&&_0x41af26[_0xe524('0x43')][0x7]?_0x41af26[_0xe524('0x43')][0x7]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x41af26['attrOpenchannelAccounts']||(_0x41af26[_0xe524('0x43')]&&_0x41af26['attrs'][0x8]?_0x41af26[_0xe524('0x43')][0x8][_0xe524('0x44')]:undefined)||''},{'name':_0xe524('0x5e'),'value':_0x41af26[_0xe524('0x5e')]||(_0x41af26[_0xe524('0x43')]&&_0x41af26['attrs'][0x9]?_0x41af26['attrs'][0x9][_0xe524('0x44')]:undefined)||''},{'name':_0xe524('0x58'),'value':_0x41af26[_0xe524('0x58')]||(_0x41af26[_0xe524('0x43')]&&_0x41af26[_0xe524('0x43')][0xa]?_0x41af26[_0xe524('0x43')][0xa]['value']:undefined)||''}];case _0xe524('0x5f'):return[{'name':_0xe524('0x60'),'type':_0x41af26[_0xe524('0x61')]||(_0x41af26['attrs']&&_0x41af26[_0xe524('0x43')][0x0]?_0x41af26[_0xe524('0x43')][0x0][_0xe524('0x40')]:undefined)||null,'value':_0x41af26['attrReport']||(_0x41af26['attrs']&&_0x41af26[_0xe524('0x43')][0x0]?_0x41af26[_0xe524('0x43')][0x0][_0xe524('0x44')]:undefined)||null},{'name':_0xe524('0x62'),'value':_0x41af26[_0xe524('0x62')]||(_0x41af26['attrs']&&_0x41af26[_0xe524('0x43')][0x1]?_0x41af26[_0xe524('0x43')][0x1][_0xe524('0x44')]:undefined)||0x0}];default:return[];}}catch(_0x21a625){logger[_0xe524('0x63')](_0xe524('0x64'),JSON[_0xe524('0x65')](_0x21a625));return[];}}exports[_0xe524('0x66')]=function(_0x27c55c,_0x7e5992){if(_0x27c55c[_0xe524('0x67')]){_0x27c55c['body'][_0xe524('0x43')]=widgetAttributes(_0x27c55c[_0xe524('0x67')]);}return db[_0xe524('0x34')][_0xe524('0x66')](_0x27c55c[_0xe524('0x67')],{})['then'](respondWithResult(_0x7e5992,0xc9))[_0xe524('0x3f')](handleError(_0x7e5992,null));};exports[_0xe524('0x2c')]=function(_0x2ea4c9,_0x32d11a){if(_0x2ea4c9[_0xe524('0x67')]['id']){delete _0x2ea4c9[_0xe524('0x67')]['id'];}_0x2ea4c9[_0xe524('0x67')]['attrs']=widgetAttributes(_0x2ea4c9[_0xe524('0x67')]);return db[_0xe524('0x34')][_0xe524('0x3e')]({'where':{'id':_0x2ea4c9[_0xe524('0x32')]['id']}})['then'](handleEntityNotFound(_0x32d11a,null))[_0xe524('0x2e')](saveUpdates(_0x2ea4c9['body'],null))[_0xe524('0x2e')](respondWithResult(_0x32d11a,null))[_0xe524('0x3f')](handleError(_0x32d11a,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 93a8479..cf5e233 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 _0xf459=['hook','exports','events','../../mysqldb','DashboardItem','update','remove','emit','hasOwnProperty'];(function(_0x1e7be1,_0x161891){var _0x5c9c54=function(_0x5e377b){while(--_0x5e377b){_0x1e7be1['push'](_0x1e7be1['shift']());}};_0x5c9c54(++_0x161891);}(_0xf459,0x16a));var _0x9f45=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0xf459[_0x18cd5b];return _0x5eaa52;};'use strict';var EventEmitter=require(_0x9f45('0x0'));var DashboardItem=require(_0x9f45('0x1'))['db'][_0x9f45('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x9f45('0x3'),'afterDestroy':_0x9f45('0x4')};function emitEvent(_0x31c18f){return function(_0x55ce58,_0x236101,_0x32827c){DashboardItemEvents['emit'](_0x31c18f+':'+_0x55ce58['id'],_0x55ce58);DashboardItemEvents[_0x9f45('0x5')](_0x31c18f,_0x55ce58);_0x32827c(null);};}for(var e in events){if(events[_0x9f45('0x6')](e)){var event=events[e];DashboardItem[_0x9f45('0x7')](e,emitEvent(event));}}module[_0x9f45('0x8')]=DashboardItemEvents; \ No newline at end of file +var _0x1147=['hasOwnProperty','exports','events','DashboardItem','setMaxListeners','save','update','remove','emit'];(function(_0x648163,_0x241576){var _0x199d4d=function(_0x23055d){while(--_0x23055d){_0x648163['push'](_0x648163['shift']());}};_0x199d4d(++_0x241576);}(_0x1147,0xf5));var _0x7114=function(_0xfa6bec,_0x1f9577){_0xfa6bec=_0xfa6bec-0x0;var _0x391fde=_0x1147[_0xfa6bec];return _0x391fde;};'use strict';var EventEmitter=require(_0x7114('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0x7114('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x7114('0x2')](0x0);var events={'afterCreate':_0x7114('0x3'),'afterUpdate':_0x7114('0x4'),'afterDestroy':_0x7114('0x5')};function emitEvent(_0x32e902){return function(_0x45c112,_0x1bdc17,_0x167c93){DashboardItemEvents[_0x7114('0x6')](_0x32e902+':'+_0x45c112['id'],_0x45c112);DashboardItemEvents['emit'](_0x32e902,_0x45c112);_0x167c93(null);};}for(var e in events){if(events[_0x7114('0x7')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0x7114('0x8')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index a165827..bb72e48 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 _0xe5af=['exports','define','dashboard_items','util','../../config/logger','bluebird','rimraf','../../config/environment','./dashboardItem.attributes'];(function(_0x313b17,_0x3db228){var _0x493fc2=function(_0x560a46){while(--_0x560a46){_0x313b17['push'](_0x313b17['shift']());}};_0x493fc2(++_0x3db228);}(_0xe5af,0xff));var _0xfe5a=function(_0x59ac27,_0x202e0e){_0x59ac27=_0x59ac27-0x0;var _0x4ed9b3=_0xe5af[_0x59ac27];return _0x4ed9b3;};'use strict';var _=require('lodash');var util=require(_0xfe5a('0x0'));var logger=require(_0xfe5a('0x1'))('api');var moment=require('moment');var BPromise=require(_0xfe5a('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xfe5a('0x3'));var config=require(_0xfe5a('0x4'));var attributes=require(_0xfe5a('0x5'));module[_0xfe5a('0x6')]=function(_0x311fe7,_0x3e2cbd){return _0x311fe7[_0xfe5a('0x7')]('DashboardItem',attributes,{'tableName':_0xfe5a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3792=['define','DashboardItem','dashboard_items','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports'];(function(_0x492b1c,_0x58840e){var _0xfd2d4c=function(_0x468aa){while(--_0x468aa){_0x492b1c['push'](_0x492b1c['shift']());}};_0xfd2d4c(++_0x58840e);}(_0x3792,0x9f));var _0x2379=function(_0x20780a,_0x5dbfc1){_0x20780a=_0x20780a-0x0;var _0x24fd38=_0x3792[_0x20780a];return _0x24fd38;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2379('0x0'))(_0x2379('0x1'));var moment=require(_0x2379('0x2'));var BPromise=require(_0x2379('0x3'));var rp=require(_0x2379('0x4'));var fs=require('fs');var path=require(_0x2379('0x5'));var rimraf=require(_0x2379('0x6'));var config=require(_0x2379('0x7'));var attributes=require(_0x2379('0x8'));module[_0x2379('0x9')]=function(_0x46f846,_0x1c600c){return _0x46f846[_0x2379('0xa')](_0x2379('0xb'),attributes,{'tableName':_0x2379('0xc'),'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 b6cdcb7..060ea14 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 _0x5a01=['register','request','DashboardItem,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter'];(function(_0x5acf45,_0x5eb851){var _0x100b31=function(_0x50813c){while(--_0x50813c){_0x5acf45['push'](_0x5acf45['shift']());}};_0x100b31(++_0x5eb851);}(_0x5a01,0xb9));var _0x15a0=function(_0x206711,_0x4125b4){_0x206711=_0x206711-0x0;var _0x4fe02b=_0x5a01[_0x206711];return _0x4fe02b;};'use strict';var _=require(_0x15a0('0x0'));var util=require('util');var moment=require(_0x15a0('0x1'));var BPromise=require(_0x15a0('0x2'));var rs=require(_0x15a0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x15a0('0x4'))['db'];var utils=require(_0x15a0('0x5'));var logger=require(_0x15a0('0x6'))(_0x15a0('0x7'));var config=require(_0x15a0('0x8'));var jayson=require(_0x15a0('0x9'));var client=jayson[_0x15a0('0xa')][_0x15a0('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x15a0('0xc')],{'host':_0x15a0('0xd'),'port':0x18eb});var socket=require(_0x15a0('0xe'))(new Redis(config[_0x15a0('0xc')]));require('./dashboardItem.socket')[_0x15a0('0xf')](socket);function respondWithRpcPromise(_0x283900,_0x46fc75,_0xbf18c4){return new BPromise(function(_0x276e02,_0x1f1c27){return client[_0x15a0('0x10')](_0x283900,_0xbf18c4)['then'](function(_0x5d471c){logger['info'](_0x15a0('0x11'),_0x46fc75,_0x15a0('0x12'));logger['debug']('DashboardItem,\x20%s,\x20%s,\x20%s',_0x46fc75,_0x15a0('0x12'),JSON[_0x15a0('0x13')](_0x5d471c));if(_0x5d471c['error']){if(_0x5d471c[_0x15a0('0x14')]['code']===0x1f4){logger[_0x15a0('0x14')](_0x15a0('0x11'),_0x46fc75,_0x5d471c['error'][_0x15a0('0x15')]);return _0x1f1c27(_0x5d471c[_0x15a0('0x14')][_0x15a0('0x15')]);}logger[_0x15a0('0x14')](_0x15a0('0x11'),_0x46fc75,_0x5d471c[_0x15a0('0x14')][_0x15a0('0x15')]);return _0x276e02(_0x5d471c[_0x15a0('0x14')][_0x15a0('0x15')]);}else{logger[_0x15a0('0x16')](_0x15a0('0x11'),_0x46fc75,_0x15a0('0x12'));_0x276e02(_0x5d471c[_0x15a0('0x17')][_0x15a0('0x15')]);}})[_0x15a0('0x18')](function(_0x12e0f0){logger['error'](_0x15a0('0x11'),_0x46fc75,_0x12e0f0);_0x1f1c27(_0x12e0f0);});});} \ No newline at end of file +var _0x78d2=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','DashboardItem,\x20%s,\x20%s','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result'];(function(_0x84c44d,_0x3d577b){var _0x1abb29=function(_0xc6d1f8){while(--_0xc6d1f8){_0x84c44d['push'](_0x84c44d['shift']());}};_0x1abb29(++_0x3d577b);}(_0x78d2,0xf4));var _0x278d=function(_0xf5bda0,_0x2589e1){_0xf5bda0=_0xf5bda0-0x0;var _0x5303cb=_0x78d2[_0xf5bda0];return _0x5303cb;};'use strict';var _=require(_0x278d('0x0'));var util=require(_0x278d('0x1'));var moment=require(_0x278d('0x2'));var BPromise=require(_0x278d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x278d('0x4'));var db=require(_0x278d('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x278d('0x6'));var config=require(_0x278d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x278d('0x8')]['http']({'port':0x232a});config[_0x278d('0x9')]=_[_0x278d('0xa')](config[_0x278d('0x9')],{'host':_0x278d('0xb'),'port':0x18eb});var socket=require(_0x278d('0xc'))(new Redis(config[_0x278d('0x9')]));require(_0x278d('0xd'))[_0x278d('0xe')](socket);function respondWithRpcPromise(_0x456acd,_0x59dd57,_0x1b6759){return new BPromise(function(_0xf84d2,_0x1e7c35){return client[_0x278d('0xf')](_0x456acd,_0x1b6759)[_0x278d('0x10')](function(_0x565132){logger['info'](_0x278d('0x11'),_0x59dd57,'request\x20sent');logger['debug'](_0x278d('0x12'),_0x59dd57,_0x278d('0x13'),JSON[_0x278d('0x14')](_0x565132));if(_0x565132[_0x278d('0x15')]){if(_0x565132[_0x278d('0x15')][_0x278d('0x16')]===0x1f4){logger[_0x278d('0x15')](_0x278d('0x11'),_0x59dd57,_0x565132[_0x278d('0x15')][_0x278d('0x17')]);return _0x1e7c35(_0x565132[_0x278d('0x15')]['message']);}logger[_0x278d('0x15')](_0x278d('0x11'),_0x59dd57,_0x565132[_0x278d('0x15')][_0x278d('0x17')]);return _0xf84d2(_0x565132['error'][_0x278d('0x17')]);}else{logger[_0x278d('0x18')](_0x278d('0x11'),_0x59dd57,_0x278d('0x13'));_0xf84d2(_0x565132[_0x278d('0x19')][_0x278d('0x17')]);}})[_0x278d('0x1a')](function(_0x3b6a87){logger[_0x278d('0x15')](_0x278d('0x11'),_0x59dd57,_0x3b6a87);_0x1e7c35(_0x3b6a87);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 7083d37..e710fe3 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 _0xa259=['emit','length','save','remove','update'];(function(_0x269ac2,_0x139b30){var _0x288e11=function(_0x3886e3){while(--_0x3886e3){_0x269ac2['push'](_0x269ac2['shift']());}};_0x288e11(++_0x139b30);}(_0xa259,0x192));var _0x9a25=function(_0x429948,_0x1a6851){_0x429948=_0x429948-0x0;var _0x35d5d1=_0xa259[_0x429948];return _0x35d5d1;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x9a25('0x0'),_0x9a25('0x1'),_0x9a25('0x2')];function createListener(_0x39cd12,_0x5286ee){return function(_0x535578){_0x5286ee[_0x9a25('0x3')](_0x39cd12,_0x535578);};}function removeListener(_0x39f3e3,_0x51f674){return function(){DashboardItemEvents['removeListener'](_0x39f3e3,_0x51f674);};}exports['register']=function(_0x592d3e){for(var _0x51565c=0x0,_0x2fad84=events[_0x9a25('0x4')];_0x51565c<_0x2fad84;_0x51565c++){var _0x3ab799=events[_0x51565c];var _0x595ed3=createListener('dashboardItem:'+_0x3ab799,_0x592d3e);DashboardItemEvents['on'](_0x3ab799,_0x595ed3);}}; \ No newline at end of file +var _0x5d34=['removeListener','register','length','dashboardItem:','./dashboardItem.events','save','emit'];(function(_0x54c5e6,_0x42b44a){var _0x44be7d=function(_0x37fc4e){while(--_0x37fc4e){_0x54c5e6['push'](_0x54c5e6['shift']());}};_0x44be7d(++_0x42b44a);}(_0x5d34,0xd6));var _0x45d3=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5d34[_0x122ef9];return _0x42fba0;};'use strict';var DashboardItemEvents=require(_0x45d3('0x0'));var events=[_0x45d3('0x1'),'remove','update'];function createListener(_0x255f76,_0x4c885e){return function(_0x1155ac){_0x4c885e[_0x45d3('0x2')](_0x255f76,_0x1155ac);};}function removeListener(_0x47051c,_0x206b99){return function(){DashboardItemEvents[_0x45d3('0x3')](_0x47051c,_0x206b99);};}exports[_0x45d3('0x4')]=function(_0x41d003){for(var _0x2af9e3=0x0,_0x1666bf=events[_0x45d3('0x5')];_0x2af9e3<_0x1666bf;_0x2af9e3++){var _0x3c3cf8=events[_0x2af9e3];var _0x30652c=createListener(_0x45d3('0x6')+_0x3c3cf8,_0x41d003);DashboardItemEvents['on'](_0x3c3cf8,_0x30652c);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index c837b57..6fc2de3 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 _0xf3fe=['destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','get','/:id','isAuthenticated','post','put'];(function(_0x5902b9,_0x47d2b9){var _0x311b02=function(_0x5a4fe4){while(--_0x5a4fe4){_0x5902b9['push'](_0x5902b9['shift']());}};_0x311b02(++_0x47d2b9);}(_0xf3fe,0x12e));var _0xef3f=function(_0x404eff,_0x4ef653){_0x404eff=_0x404eff-0x0;var _0x46cc25=_0xf3fe[_0x404eff];return _0x46cc25;};'use strict';var multer=require('multer');var util=require(_0xef3f('0x0'));var path=require('path');var timeout=require(_0xef3f('0x1'));var express=require('express');var router=express[_0xef3f('0x2')]();var fs_extra=require(_0xef3f('0x3'));var auth=require(_0xef3f('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./dashboardItem.controller');router[_0xef3f('0x5')](_0xef3f('0x6'),auth[_0xef3f('0x7')](),controller['show']);router[_0xef3f('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0xef3f('0x9')](_0xef3f('0x6'),auth[_0xef3f('0x7')](),controller['update']);router['delete']('/:id',auth[_0xef3f('0x7')](),controller[_0xef3f('0xa')]);module[_0xef3f('0xb')]=router; \ No newline at end of file +var _0x19b5=['Router','fs-extra','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','isAuthenticated','show','put','/:id','update','delete','destroy','multer','path','connect-timeout','express'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x19b5,0x11d));var _0x519b=function(_0x3ffaf8,_0x29266e){_0x3ffaf8=_0x3ffaf8-0x0;var _0xf200b6=_0x19b5[_0x3ffaf8];return _0xf200b6;};'use strict';var multer=require(_0x519b('0x0'));var util=require('util');var path=require(_0x519b('0x1'));var timeout=require(_0x519b('0x2'));var express=require(_0x519b('0x3'));var router=express[_0x519b('0x4')]();var fs_extra=require(_0x519b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x519b('0x6'));var config=require(_0x519b('0x7'));var controller=require(_0x519b('0x8'));router[_0x519b('0x9')]('/:id',auth[_0x519b('0xa')](),controller[_0x519b('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x519b('0xc')](_0x519b('0xd'),auth[_0x519b('0xa')](),controller[_0x519b('0xe')]);router[_0x519b('0xf')](_0x519b('0xd'),auth[_0x519b('0xa')](),controller[_0x519b('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 748c40d..0ac170e 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 _0x49c6=['STRING','third','first','sequelize','exports'];(function(_0x34a2c8,_0x5e6e3c){var _0x3fa061=function(_0x3b8b9b){while(--_0x3b8b9b){_0x34a2c8['push'](_0x34a2c8['shift']());}};_0x3fa061(++_0x5e6e3c);}(_0x49c6,0x99));var _0x649c=function(_0x4cb9e8,_0x43ac2c){_0x4cb9e8=_0x4cb9e8-0x0;var _0x398212=_0x49c6[_0x4cb9e8];return _0x398212;};'use strict';var Sequelize=require(_0x649c('0x0'));module[_0x649c('0x1')]={'name':{'type':Sequelize[_0x649c('0x2')],'allowNull':![]},'level':{'type':Sequelize['ENUM']('first','second',_0x649c('0x3')),'allowNull':![],'defaultValue':_0x649c('0x4')},'description':{'type':Sequelize[_0x649c('0x2')]}}; \ No newline at end of file +var _0x552e=['first','second','third','exports','STRING'];(function(_0x379ab0,_0x261bc1){var _0x3ff12d=function(_0x2f9f5c){while(--_0x2f9f5c){_0x379ab0['push'](_0x379ab0['shift']());}};_0x3ff12d(++_0x261bc1);}(_0x552e,0x1a7));var _0xe552=function(_0x2eee48,_0x29b8ea){_0x2eee48=_0x2eee48-0x0;var _0xb99463=_0x552e[_0x2eee48];return _0xb99463;};'use strict';var Sequelize=require('sequelize');module[_0xe552('0x0')]={'name':{'type':Sequelize[_0xe552('0x1')],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0xe552('0x2'),_0xe552('0x3'),_0xe552('0x4')),'allowNull':![],'defaultValue':_0xe552('0x2')},'description':{'type':Sequelize[_0xe552('0x1')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index af3c402..d19167f 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 _0x9075=['end','sendStatus','stack','name','index','map','fieldName','type','key','model','intersection','query','attributes','fields','length','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','Disposition','includeAll','include','findAll','rows','catch','rawAttributes','keys','create','body','user','UserProfileSection','find','userProfileId','autoAssociation','error','params','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','squel','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','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','Dispositions','UserProfileResource','destroy'];(function(_0x263646,_0x4f806d){var _0x1e947b=function(_0x3d2ea7){while(--_0x3d2ea7){_0x263646['push'](_0x263646['shift']());}};_0x1e947b(++_0x4f806d);}(_0x9075,0x7a));var _0x5907=function(_0x2eadbe,_0x3aa115){_0x2eadbe=_0x2eadbe-0x0;var _0x249dee=_0x9075[_0x2eadbe];return _0x249dee;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5907('0x0'));var jsonpatch=require(_0x5907('0x1'));var rp=require(_0x5907('0x2'));var moment=require(_0x5907('0x3'));var BPromise=require(_0x5907('0x4'));var Mustache=require(_0x5907('0x5'));var util=require(_0x5907('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x5907('0x7'));var ejs=require(_0x5907('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5907('0x9'));var crypto=require('crypto');var jsforce=require(_0x5907('0xa'));var deskjs=require(_0x5907('0xb'));var toCsv=require(_0x5907('0x7'));var querystring=require('querystring');var Papa=require(_0x5907('0xc'));var Redis=require(_0x5907('0xd'));var authService=require(_0x5907('0xe'));var qs=require(_0x5907('0xf'));var as=require(_0x5907('0x10'));var hardwareService=require(_0x5907('0x11'));var logger=require(_0x5907('0x12'))(_0x5907('0x13'));var utils=require(_0x5907('0x14'));var config=require(_0x5907('0x15'));var licenseUtil=require(_0x5907('0x16'));var db=require(_0x5907('0x17'))['db'];function respondWithStatusCode(_0x18e5cb,_0xd80e8f){_0xd80e8f=_0xd80e8f||0xcc;return function(_0x1b8feb){if(_0x1b8feb){return _0x18e5cb['sendStatus'](_0xd80e8f);}return _0x18e5cb[_0x5907('0x18')](_0xd80e8f)['end']();};}function respondWithResult(_0x93baf1,_0x1f1c80){_0x1f1c80=_0x1f1c80||0xc8;return function(_0x2490fd){if(_0x2490fd){return _0x93baf1['status'](_0x1f1c80)[_0x5907('0x19')](_0x2490fd);}};}function respondWithFilteredResult(_0x15d420,_0x4c1b48){return function(_0xb49e1e){if(_0xb49e1e){var _0x48fc51=typeof _0x4c1b48[_0x5907('0x1a')]===_0x5907('0x1b')&&typeof _0x4c1b48[_0x5907('0x1c')]==='undefined';var _0x240398=_0xb49e1e['count'];var _0x399152=_0x48fc51?0x0:_0x4c1b48['offset'];var _0x3e0ce0=_0x48fc51?_0xb49e1e[_0x5907('0x1d')]:_0x4c1b48[_0x5907('0x1a')]+_0x4c1b48['limit'];var _0x4c7768;if(_0x3e0ce0>=_0x240398){_0x3e0ce0=_0x240398;_0x4c7768=0xc8;}else{_0x4c7768=0xce;}_0x15d420[_0x5907('0x18')](_0x4c7768);return _0x15d420[_0x5907('0x1e')](_0x5907('0x1f'),_0x399152+'-'+_0x3e0ce0+'/'+_0x240398)[_0x5907('0x19')](_0xb49e1e);}return null;};}function patchUpdates(_0x42dfdd){return function(_0x29fe5e){try{jsonpatch['apply'](_0x29fe5e,_0x42dfdd,!![]);}catch(_0x4f2e0a){return BPromise[_0x5907('0x20')](_0x4f2e0a);}return _0x29fe5e[_0x5907('0x21')]();};}function saveUpdates(_0x24402e,_0x5c8d35){return function(_0x277192){if(_0x277192){return _0x277192[_0x5907('0x22')](_0x24402e)[_0x5907('0x23')](function(_0x1149a3){return _0x1149a3;});}return null;};}function removeEntity(_0x2945f8,_0x534ef5){return function(_0x258e54){if(_0x258e54){return _0x258e54['destroy']()[_0x5907('0x23')](function(){var _0x3153ad=_0x258e54[_0x5907('0x24')]({'plain':!![]});var _0x2c4106=_0x5907('0x25');return db[_0x5907('0x26')][_0x5907('0x27')]({'where':{'type':_0x2c4106,'resourceId':_0x3153ad['id']}})['then'](function(){return _0x258e54;});})['then'](function(){_0x2945f8['status'](0xcc)[_0x5907('0x28')]();});}};}function handleEntityNotFound(_0x1e42f6,_0x38e758){return function(_0x38c2ae){if(!_0x38c2ae){_0x1e42f6[_0x5907('0x29')](0x194);}return _0x38c2ae;};}function handleError(_0x5720ef,_0x38c35d){_0x38c35d=_0x38c35d||0x1f4;return function(_0x4678c0){logger['error'](_0x4678c0[_0x5907('0x2a')]);if(_0x4678c0[_0x5907('0x2b')]){delete _0x4678c0[_0x5907('0x2b')];}_0x5720ef[_0x5907('0x18')](_0x38c35d)['send'](_0x4678c0);};}exports[_0x5907('0x2c')]=function(_0x4159ee,_0x235bcd){var _0xa68fa8={},_0x2623b7={},_0x4c3c0c={'count':0x0,'rows':[]};var _0x506694=_[_0x5907('0x2d')](db['Disposition']['rawAttributes'],function(_0x21795e){return{'name':_0x21795e[_0x5907('0x2e')],'type':_0x21795e[_0x5907('0x2f')][_0x5907('0x30')]};});_0x2623b7[_0x5907('0x31')]=_[_0x5907('0x2d')](_0x506694,_0x5907('0x2b'));_0x2623b7['query']=_['keys'](_0x4159ee['query']);_0x2623b7['filters']=_[_0x5907('0x32')](_0x2623b7['model'],_0x2623b7[_0x5907('0x33')]);_0xa68fa8[_0x5907('0x34')]=_[_0x5907('0x32')](_0x2623b7['model'],qs['fields'](_0x4159ee[_0x5907('0x33')][_0x5907('0x35')]));_0xa68fa8[_0x5907('0x34')]=_0xa68fa8[_0x5907('0x34')][_0x5907('0x36')]?_0xa68fa8[_0x5907('0x34')]:_0x2623b7[_0x5907('0x31')];if(!_0x4159ee[_0x5907('0x33')]['hasOwnProperty'](_0x5907('0x37'))){_0xa68fa8[_0x5907('0x1c')]=qs[_0x5907('0x1c')](_0x4159ee[_0x5907('0x33')][_0x5907('0x1c')]);_0xa68fa8[_0x5907('0x1a')]=qs['offset'](_0x4159ee[_0x5907('0x33')][_0x5907('0x1a')]);}_0xa68fa8['order']=qs[_0x5907('0x38')](_0x4159ee['query'][_0x5907('0x38')]);_0xa68fa8[_0x5907('0x39')]=qs[_0x5907('0x3a')](_[_0x5907('0x3b')](_0x4159ee[_0x5907('0x33')],_0x2623b7[_0x5907('0x3a')]),_0x506694);if(_0x4159ee[_0x5907('0x33')][_0x5907('0x3c')]){_0xa68fa8[_0x5907('0x39')]=_[_0x5907('0x3d')](_0xa68fa8[_0x5907('0x39')],{'$or':_[_0x5907('0x2d')](_0x506694,function(_0x5401b5){if(_0x5401b5['type']!==_0x5907('0x3e')){var _0x17ef05={};_0x17ef05[_0x5401b5['name']]={'$like':'%'+_0x4159ee[_0x5907('0x33')][_0x5907('0x3c')]+'%'};return _0x17ef05;}})});}_0xa68fa8=_[_0x5907('0x3d')]({},_0xa68fa8,_0x4159ee[_0x5907('0x3f')]);var _0x4ac061={'where':_0xa68fa8[_0x5907('0x39')]};return db[_0x5907('0x40')][_0x5907('0x1d')](_0x4ac061)[_0x5907('0x23')](function(_0x55df45){_0x4c3c0c['count']=_0x55df45;if(_0x4159ee['query'][_0x5907('0x41')]){_0xa68fa8[_0x5907('0x42')]=[{'all':!![]}];}return db['Disposition'][_0x5907('0x43')](_0xa68fa8);})[_0x5907('0x23')](function(_0x2f004b){_0x4c3c0c[_0x5907('0x44')]=_0x2f004b;return _0x4c3c0c;})[_0x5907('0x23')](respondWithFilteredResult(_0x235bcd,_0xa68fa8))[_0x5907('0x45')](handleError(_0x235bcd,null));};exports['show']=function(_0x313f3b,_0x26db58){var _0x1d0243={'raw':!![],'where':{'id':_0x313f3b['params']['id']}},_0x118337={};_0x118337[_0x5907('0x31')]=_['keys'](db[_0x5907('0x40')][_0x5907('0x46')]);_0x118337['query']=_[_0x5907('0x47')](_0x313f3b[_0x5907('0x33')]);_0x118337[_0x5907('0x3a')]=_['intersection'](_0x118337[_0x5907('0x31')],_0x118337[_0x5907('0x33')]);_0x1d0243['attributes']=_[_0x5907('0x32')](_0x118337[_0x5907('0x31')],qs[_0x5907('0x35')](_0x313f3b[_0x5907('0x33')][_0x5907('0x35')]));_0x1d0243[_0x5907('0x34')]=_0x1d0243[_0x5907('0x34')][_0x5907('0x36')]?_0x1d0243[_0x5907('0x34')]:_0x118337['model'];if(_0x313f3b['query'][_0x5907('0x41')]){_0x1d0243[_0x5907('0x42')]=[{'all':!![]}];}_0x1d0243=_[_0x5907('0x3d')]({},_0x1d0243,_0x313f3b['options']);return db[_0x5907('0x40')]['find'](_0x1d0243)[_0x5907('0x23')](handleEntityNotFound(_0x26db58,null))['then'](respondWithResult(_0x26db58,null))[_0x5907('0x45')](handleError(_0x26db58,null));};exports['create']=function(_0x476c7d,_0x3d915f){return db['Disposition'][_0x5907('0x48')](_0x476c7d[_0x5907('0x49')],{})[_0x5907('0x23')](function(_0x50ef6e){var _0x5e86de=_0x476c7d[_0x5907('0x4a')][_0x5907('0x24')]({'plain':!![]});if(!_0x5e86de)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5e86de['role']===_0x5907('0x4a')){var _0x5c78f5=_0x50ef6e[_0x5907('0x24')]({'plain':!![]});var _0x5ab0ea=_0x5907('0x25');return db[_0x5907('0x4b')][_0x5907('0x4c')]({'where':{'name':_0x5ab0ea,'userProfileId':_0x5e86de[_0x5907('0x4d')]},'raw':!![]})[_0x5907('0x23')](function(_0xdca392){if(_0xdca392&&_0xdca392[_0x5907('0x4e')]===0x0){return db[_0x5907('0x26')][_0x5907('0x48')]({'name':_0x5c78f5[_0x5907('0x2b')],'resourceId':_0x5c78f5['id'],'type':_0xdca392[_0x5907('0x2b')],'sectionId':_0xdca392['id']},{})[_0x5907('0x23')](function(){return _0x50ef6e;});}else{return _0x50ef6e;}})['catch'](function(_0x1f7c07){logger[_0x5907('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1f7c07);throw _0x1f7c07;});}return _0x50ef6e;})[_0x5907('0x23')](respondWithResult(_0x3d915f,0xc9))['catch'](handleError(_0x3d915f,null));};exports['update']=function(_0x352346,_0x3c3875){if(_0x352346[_0x5907('0x49')]['id']){delete _0x352346[_0x5907('0x49')]['id'];}return db[_0x5907('0x40')][_0x5907('0x4c')]({'where':{'id':_0x352346[_0x5907('0x50')]['id']}})[_0x5907('0x23')](handleEntityNotFound(_0x3c3875,null))[_0x5907('0x23')](saveUpdates(_0x352346[_0x5907('0x49')],null))[_0x5907('0x23')](respondWithResult(_0x3c3875,null))[_0x5907('0x45')](handleError(_0x3c3875,null));};exports[_0x5907('0x27')]=function(_0x419d8a,_0x13ecff){return db['Disposition'][_0x5907('0x4c')]({'where':{'id':_0x419d8a[_0x5907('0x50')]['id']}})[_0x5907('0x23')](handleEntityNotFound(_0x13ecff,null))[_0x5907('0x23')](removeEntity(_0x13ecff,null))[_0x5907('0x45')](handleError(_0x13ecff,null));}; \ No newline at end of file +var _0xe14b=['papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','save','update','then','get','Dispositions','UserProfileResource','destroy','error','stack','name','send','index','map','Disposition','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','keys','length','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','params','eml-format','rimraf','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring'];(function(_0x287591,_0x18897d){var _0x366699=function(_0x1acd41){while(--_0x1acd41){_0x287591['push'](_0x287591['shift']());}};_0x366699(++_0x18897d);}(_0xe14b,0x93));var _0xbe14=function(_0x276e2a,_0x1544e1){_0x276e2a=_0x276e2a-0x0;var _0x4f9f3f=_0xe14b[_0x276e2a];return _0x4f9f3f;};'use strict';var emlformat=require(_0xbe14('0x0'));var rimraf=require(_0xbe14('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbe14('0x2'));var moment=require(_0xbe14('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbe14('0x4'));var util=require('util');var path=require('path');var sox=require(_0xbe14('0x5'));var csv=require(_0xbe14('0x6'));var ejs=require(_0xbe14('0x7'));var fs=require('fs');var fs_extra=require(_0xbe14('0x8'));var _=require(_0xbe14('0x9'));var squel=require(_0xbe14('0xa'));var crypto=require(_0xbe14('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe14('0xc'));var Papa=require(_0xbe14('0xd'));var Redis=require(_0xbe14('0xe'));var authService=require(_0xbe14('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe14('0x10'));var logger=require(_0xbe14('0x11'))('api');var utils=require(_0xbe14('0x12'));var config=require(_0xbe14('0x13'));var licenseUtil=require(_0xbe14('0x14'));var db=require(_0xbe14('0x15'))['db'];function respondWithStatusCode(_0x27792f,_0x3b898d){_0x3b898d=_0x3b898d||0xcc;return function(_0x23a730){if(_0x23a730){return _0x27792f[_0xbe14('0x16')](_0x3b898d);}return _0x27792f[_0xbe14('0x17')](_0x3b898d)[_0xbe14('0x18')]();};}function respondWithResult(_0x1e4826,_0x33fd54){_0x33fd54=_0x33fd54||0xc8;return function(_0x813399){if(_0x813399){return _0x1e4826['status'](_0x33fd54)['json'](_0x813399);}};}function respondWithFilteredResult(_0x3f58f5,_0x3dc4a9){return function(_0xf4ac9){if(_0xf4ac9){var _0x37ce4e=typeof _0x3dc4a9['offset']===_0xbe14('0x19')&&typeof _0x3dc4a9[_0xbe14('0x1a')]===_0xbe14('0x19');var _0x123ede=_0xf4ac9[_0xbe14('0x1b')];var _0x29ab73=_0x37ce4e?0x0:_0x3dc4a9[_0xbe14('0x1c')];var _0x5ea1f8=_0x37ce4e?_0xf4ac9[_0xbe14('0x1b')]:_0x3dc4a9[_0xbe14('0x1c')]+_0x3dc4a9[_0xbe14('0x1a')];var _0x433459;if(_0x5ea1f8>=_0x123ede){_0x5ea1f8=_0x123ede;_0x433459=0xc8;}else{_0x433459=0xce;}_0x3f58f5[_0xbe14('0x17')](_0x433459);return _0x3f58f5[_0xbe14('0x1d')]('Content-Range',_0x29ab73+'-'+_0x5ea1f8+'/'+_0x123ede)[_0xbe14('0x1e')](_0xf4ac9);}return null;};}function patchUpdates(_0x4a1bbd){return function(_0x417c8d){try{jsonpatch[_0xbe14('0x1f')](_0x417c8d,_0x4a1bbd,!![]);}catch(_0x188ec4){return BPromise['reject'](_0x188ec4);}return _0x417c8d[_0xbe14('0x20')]();};}function saveUpdates(_0x56d845,_0x3c1c85){return function(_0x56e80c){if(_0x56e80c){return _0x56e80c[_0xbe14('0x21')](_0x56d845)['then'](function(_0x274018){return _0x274018;});}return null;};}function removeEntity(_0x3d3608,_0x505dbd){return function(_0x2da350){if(_0x2da350){return _0x2da350['destroy']()[_0xbe14('0x22')](function(){var _0x4851f8=_0x2da350[_0xbe14('0x23')]({'plain':!![]});var _0x5fa043=_0xbe14('0x24');return db[_0xbe14('0x25')][_0xbe14('0x26')]({'where':{'type':_0x5fa043,'resourceId':_0x4851f8['id']}})[_0xbe14('0x22')](function(){return _0x2da350;});})['then'](function(){_0x3d3608[_0xbe14('0x17')](0xcc)[_0xbe14('0x18')]();});}};}function handleEntityNotFound(_0x391556,_0x169369){return function(_0x5dd475){if(!_0x5dd475){_0x391556[_0xbe14('0x16')](0x194);}return _0x5dd475;};}function handleError(_0x29fc64,_0x59bf34){_0x59bf34=_0x59bf34||0x1f4;return function(_0x3c3613){logger[_0xbe14('0x27')](_0x3c3613[_0xbe14('0x28')]);if(_0x3c3613[_0xbe14('0x29')]){delete _0x3c3613[_0xbe14('0x29')];}_0x29fc64[_0xbe14('0x17')](_0x59bf34)[_0xbe14('0x2a')](_0x3c3613);};}exports[_0xbe14('0x2b')]=function(_0x4168c8,_0x16a159){var _0x40538f={},_0x3bf43c={},_0x39dc0a={'count':0x0,'rows':[]};var _0x10ae36=_[_0xbe14('0x2c')](db[_0xbe14('0x2d')][_0xbe14('0x2e')],function(_0x2ff48e){return{'name':_0x2ff48e[_0xbe14('0x2f')],'type':_0x2ff48e[_0xbe14('0x30')]['key']};});_0x3bf43c[_0xbe14('0x31')]=_['map'](_0x10ae36,'name');_0x3bf43c[_0xbe14('0x32')]=_['keys'](_0x4168c8[_0xbe14('0x32')]);_0x3bf43c[_0xbe14('0x33')]=_['intersection'](_0x3bf43c['model'],_0x3bf43c['query']);_0x40538f[_0xbe14('0x34')]=_[_0xbe14('0x35')](_0x3bf43c['model'],qs[_0xbe14('0x36')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x36')]));_0x40538f[_0xbe14('0x34')]=_0x40538f[_0xbe14('0x34')]['length']?_0x40538f['attributes']:_0x3bf43c[_0xbe14('0x31')];if(!_0x4168c8['query']['hasOwnProperty']('nolimit')){_0x40538f[_0xbe14('0x1a')]=qs[_0xbe14('0x1a')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x1a')]);_0x40538f[_0xbe14('0x1c')]=qs[_0xbe14('0x1c')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x1c')]);}_0x40538f[_0xbe14('0x37')]=qs[_0xbe14('0x38')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x38')]);_0x40538f['where']=qs['filters'](_[_0xbe14('0x39')](_0x4168c8[_0xbe14('0x32')],_0x3bf43c[_0xbe14('0x33')]),_0x10ae36);if(_0x4168c8['query'][_0xbe14('0x3a')]){_0x40538f[_0xbe14('0x3b')]=_[_0xbe14('0x3c')](_0x40538f[_0xbe14('0x3b')],{'$or':_[_0xbe14('0x2c')](_0x10ae36,function(_0x25ee1f){if(_0x25ee1f[_0xbe14('0x30')]!==_0xbe14('0x3d')){var _0x1b2608={};_0x1b2608[_0x25ee1f['name']]={'$like':'%'+_0x4168c8[_0xbe14('0x32')][_0xbe14('0x3a')]+'%'};return _0x1b2608;}})});}_0x40538f=_[_0xbe14('0x3c')]({},_0x40538f,_0x4168c8[_0xbe14('0x3e')]);var _0x3287b9={'where':_0x40538f[_0xbe14('0x3b')]};return db['Disposition'][_0xbe14('0x1b')](_0x3287b9)[_0xbe14('0x22')](function(_0x1220c9){_0x39dc0a[_0xbe14('0x1b')]=_0x1220c9;if(_0x4168c8['query']['includeAll']){_0x40538f[_0xbe14('0x3f')]=[{'all':!![]}];}return db[_0xbe14('0x2d')][_0xbe14('0x40')](_0x40538f);})['then'](function(_0x5d5318){_0x39dc0a[_0xbe14('0x41')]=_0x5d5318;return _0x39dc0a;})['then'](respondWithFilteredResult(_0x16a159,_0x40538f))['catch'](handleError(_0x16a159,null));};exports[_0xbe14('0x42')]=function(_0x1f0355,_0x8216c3){var _0x5051e4={'raw':!![],'where':{'id':_0x1f0355['params']['id']}},_0x558525={};_0x558525[_0xbe14('0x31')]=_[_0xbe14('0x43')](db[_0xbe14('0x2d')]['rawAttributes']);_0x558525[_0xbe14('0x32')]=_[_0xbe14('0x43')](_0x1f0355[_0xbe14('0x32')]);_0x558525[_0xbe14('0x33')]=_['intersection'](_0x558525['model'],_0x558525[_0xbe14('0x32')]);_0x5051e4[_0xbe14('0x34')]=_[_0xbe14('0x35')](_0x558525[_0xbe14('0x31')],qs[_0xbe14('0x36')](_0x1f0355['query']['fields']));_0x5051e4[_0xbe14('0x34')]=_0x5051e4[_0xbe14('0x34')][_0xbe14('0x44')]?_0x5051e4[_0xbe14('0x34')]:_0x558525['model'];if(_0x1f0355[_0xbe14('0x32')][_0xbe14('0x45')]){_0x5051e4['include']=[{'all':!![]}];}_0x5051e4=_[_0xbe14('0x3c')]({},_0x5051e4,_0x1f0355[_0xbe14('0x3e')]);return db[_0xbe14('0x2d')][_0xbe14('0x46')](_0x5051e4)['then'](handleEntityNotFound(_0x8216c3,null))['then'](respondWithResult(_0x8216c3,null))[_0xbe14('0x47')](handleError(_0x8216c3,null));};exports[_0xbe14('0x48')]=function(_0x4a1a37,_0x5acf90){return db[_0xbe14('0x2d')][_0xbe14('0x48')](_0x4a1a37[_0xbe14('0x49')],{})[_0xbe14('0x22')](function(_0xdbc6e1){var _0xd04fd5=_0x4a1a37[_0xbe14('0x4a')]['get']({'plain':!![]});if(!_0xd04fd5)throw new Error(_0xbe14('0x4b'));if(_0xd04fd5[_0xbe14('0x4c')]===_0xbe14('0x4a')){var _0x22b1f8=_0xdbc6e1[_0xbe14('0x23')]({'plain':!![]});var _0x494c32=_0xbe14('0x24');return db[_0xbe14('0x4d')][_0xbe14('0x46')]({'where':{'name':_0x494c32,'userProfileId':_0xd04fd5[_0xbe14('0x4e')]},'raw':!![]})[_0xbe14('0x22')](function(_0x2dbeb1){if(_0x2dbeb1&&_0x2dbeb1['autoAssociation']===0x0){return db['UserProfileResource'][_0xbe14('0x48')]({'name':_0x22b1f8[_0xbe14('0x29')],'resourceId':_0x22b1f8['id'],'type':_0x2dbeb1[_0xbe14('0x29')],'sectionId':_0x2dbeb1['id']},{})['then'](function(){return _0xdbc6e1;});}else{return _0xdbc6e1;}})['catch'](function(_0x44fe0d){logger[_0xbe14('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44fe0d);throw _0x44fe0d;});}return _0xdbc6e1;})[_0xbe14('0x22')](respondWithResult(_0x5acf90,0xc9))[_0xbe14('0x47')](handleError(_0x5acf90,null));};exports['update']=function(_0x28f995,_0x4a40d2){if(_0x28f995[_0xbe14('0x49')]['id']){delete _0x28f995[_0xbe14('0x49')]['id'];}return db[_0xbe14('0x2d')]['find']({'where':{'id':_0x28f995[_0xbe14('0x4f')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x4a40d2,null))['then'](saveUpdates(_0x28f995[_0xbe14('0x49')],null))[_0xbe14('0x22')](respondWithResult(_0x4a40d2,null))[_0xbe14('0x47')](handleError(_0x4a40d2,null));};exports[_0xbe14('0x26')]=function(_0x49322f,_0x4f06a3){return db[_0xbe14('0x2d')][_0xbe14('0x46')]({'where':{'id':_0x49322f[_0xbe14('0x4f')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x4f06a3,null))[_0xbe14('0x22')](removeEntity(_0x4f06a3,null))[_0xbe14('0x47')](handleError(_0x4f06a3,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 705ca3c..233603e 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 _0x9ed7=['name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','WhatsappAccountId','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','define','Disposition','tools_dispositions','name','ListId','name_sms','SmsAccountId'];(function(_0xd2718b,_0x3c97be){var _0x224e67=function(_0x5ee283){while(--_0x5ee283){_0xd2718b['push'](_0xd2718b['shift']());}};_0x224e67(++_0x3c97be);}(_0x9ed7,0x16d));var _0x79ed=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0x9ed7[_0x22b68a];return _0x1ac67a;};'use strict';var _=require(_0x79ed('0x0'));var util=require('util');var logger=require(_0x79ed('0x1'))(_0x79ed('0x2'));var moment=require(_0x79ed('0x3'));var BPromise=require(_0x79ed('0x4'));var rp=require(_0x79ed('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x79ed('0x6'));var config=require(_0x79ed('0x7'));var attributes=require('./disposition.attributes');module['exports']=function(_0x1ea74c,_0x224ba0){return _0x1ea74c[_0x79ed('0x8')](_0x79ed('0x9'),attributes,{'tableName':_0x79ed('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0x79ed('0xb'),_0x79ed('0xc')]},{'unique':!![],'name':'name_chat','fields':[_0x79ed('0xb'),'ChatWebsiteId']},{'unique':!![],'name':'name_mail','fields':['name','MailAccountId']},{'unique':!![],'name':_0x79ed('0xd'),'fields':['name',_0x79ed('0xe')]},{'unique':!![],'name':_0x79ed('0xf'),'fields':[_0x79ed('0xb'),_0x79ed('0x10')]},{'unique':!![],'name':_0x79ed('0x11'),'fields':[_0x79ed('0xb'),_0x79ed('0x12')]},{'unique':!![],'name':'name_whatsapp','fields':[_0x79ed('0xb'),_0x79ed('0x13')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xffe3=['util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./disposition.attributes','exports','define','tools_dispositions','ListId','name_chat','name','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xffe3,0x1a8));var _0x3ffe=function(_0x1d38fb,_0xffa094){_0x1d38fb=_0x1d38fb-0x0;var _0x262398=_0xffe3[_0x1d38fb];return _0x262398;};'use strict';var _=require(_0x3ffe('0x0'));var util=require(_0x3ffe('0x1'));var logger=require(_0x3ffe('0x2'))(_0x3ffe('0x3'));var moment=require(_0x3ffe('0x4'));var BPromise=require(_0x3ffe('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3ffe('0x6'));var config=require(_0x3ffe('0x7'));var attributes=require(_0x3ffe('0x8'));module[_0x3ffe('0x9')]=function(_0x28ff6,_0xdaa374){return _0x28ff6[_0x3ffe('0xa')]('Disposition',attributes,{'tableName':_0x3ffe('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':['name',_0x3ffe('0xc')]},{'unique':!![],'name':_0x3ffe('0xd'),'fields':[_0x3ffe('0xe'),_0x3ffe('0xf')]},{'unique':!![],'name':_0x3ffe('0x10'),'fields':[_0x3ffe('0xe'),_0x3ffe('0x11')]},{'unique':!![],'name':_0x3ffe('0x12'),'fields':[_0x3ffe('0xe'),_0x3ffe('0x13')]},{'unique':!![],'name':_0x3ffe('0x14'),'fields':[_0x3ffe('0xe'),'FaxAccountId']},{'unique':!![],'name':_0x3ffe('0x15'),'fields':[_0x3ffe('0xe'),_0x3ffe('0x16')]},{'unique':!![],'name':_0x3ffe('0x17'),'fields':[_0x3ffe('0xe'),_0x3ffe('0x18')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index fa161da..862bbeb 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(_0xf25ef4,_0x56a476){var _0x50d23b=function(_0x18836f){while(--_0x18836f){_0xf25ef4['push'](_0xf25ef4['shift']());}};_0x50d23b(++_0x56a476);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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(_0x10d212,_0x464c8c){var _0x288d1f=function(_0x2a42e9){while(--_0x2a42e9){_0x10d212['push'](_0x10d212['shift']());}};_0x288d1f(++_0x464c8c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'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 5e3c508..6b33c92 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 _0xe9af=['get','isAuthenticated','index','show','post','put','/:id','update','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller'];(function(_0x537601,_0x1f3968){var _0x4a8bce=function(_0x36dcff){while(--_0x36dcff){_0x537601['push'](_0x537601['shift']());}};_0x4a8bce(++_0x1f3968);}(_0xe9af,0x9a));var _0xfe9a=function(_0x3f1799,_0x28ab37){_0x3f1799=_0x3f1799-0x0;var _0x534902=_0xe9af[_0x3f1799];return _0x534902;};'use strict';var multer=require(_0xfe9a('0x0'));var util=require('util');var path=require(_0xfe9a('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfe9a('0x2')]();var fs_extra=require(_0xfe9a('0x3'));var auth=require(_0xfe9a('0x4'));var interaction=require(_0xfe9a('0x5'));var config=require(_0xfe9a('0x6'));var controller=require(_0xfe9a('0x7'));router[_0xfe9a('0x8')]('/',auth[_0xfe9a('0x9')](),controller[_0xfe9a('0xa')]);router[_0xfe9a('0x8')]('/:id',auth[_0xfe9a('0x9')](),controller[_0xfe9a('0xb')]);router[_0xfe9a('0xc')]('/',auth[_0xfe9a('0x9')](),controller['create']);router[_0xfe9a('0xd')](_0xfe9a('0xe'),auth[_0xfe9a('0x9')](),controller[_0xfe9a('0xf')]);router['delete']('/:id',auth[_0xfe9a('0x9')](),controller[_0xfe9a('0x10')]);module[_0xfe9a('0x11')]=router; \ No newline at end of file +var _0x8f5d=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./disposition.controller','isAuthenticated','index','get','show','post','put','/:id','delete','destroy','exports','multer','util'];(function(_0x50c4ee,_0x2cc4e3){var _0x172545=function(_0x341e3d){while(--_0x341e3d){_0x50c4ee['push'](_0x50c4ee['shift']());}};_0x172545(++_0x2cc4e3);}(_0x8f5d,0xc6));var _0xd8f5=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x8f5d[_0x25e7cb];return _0x375d92;};'use strict';var multer=require(_0xd8f5('0x0'));var util=require(_0xd8f5('0x1'));var path=require(_0xd8f5('0x2'));var timeout=require(_0xd8f5('0x3'));var express=require(_0xd8f5('0x4'));var router=express[_0xd8f5('0x5')]();var fs_extra=require(_0xd8f5('0x6'));var auth=require(_0xd8f5('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xd8f5('0x8'));var controller=require(_0xd8f5('0x9'));router['get']('/',auth[_0xd8f5('0xa')](),controller[_0xd8f5('0xb')]);router[_0xd8f5('0xc')]('/:id',auth[_0xd8f5('0xa')](),controller[_0xd8f5('0xd')]);router[_0xd8f5('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd8f5('0xf')](_0xd8f5('0x10'),auth[_0xd8f5('0xa')](),controller['update']);router[_0xd8f5('0x11')](_0xd8f5('0x10'),auth[_0xd8f5('0xa')](),controller[_0xd8f5('0x12')]);module[_0xd8f5('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index f8b0003..b49413b 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 _0x90b5=['ENUM','yes','xCALLY\x20Motion\x20Fax','2400','4800','9600','12000','14400','7200','v17,v27,v29','INTEGER','SIP','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','setDataValue','mandatoryDispositionPauseId','sequelize','STRING'];(function(_0x228237,_0x12c51a){var _0x2c86ec=function(_0x3c7465){while(--_0x3c7465){_0x228237['push'](_0x228237['shift']());}};_0x2c86ec(++_0x12c51a);}(_0x90b5,0x139));var _0x590b=function(_0x233d57,_0x10889d){_0x233d57=_0x233d57-0x0;var _0x5f2dbb=_0x90b5[_0x233d57];return _0x5f2dbb;};'use strict';var Sequelize=require(_0x590b('0x0'));module['exports']={'name':{'type':Sequelize[_0x590b('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x590b('0x1')]},'ecm':{'type':Sequelize[_0x590b('0x2')](_0x590b('0x3'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0x590b('0x4')},'localstationid':{'type':Sequelize[_0x590b('0x1')],'unique':'localstationid'},'minrate':{'type':Sequelize[_0x590b('0x2')](_0x590b('0x5'),_0x590b('0x6'),'7200',_0x590b('0x7'),_0x590b('0x8'),_0x590b('0x9')),'defaultValue':_0x590b('0x6')},'maxrate':{'type':Sequelize[_0x590b('0x2')](_0x590b('0x5'),_0x590b('0x6'),_0x590b('0xa'),_0x590b('0x7'),'12000',_0x590b('0x9')),'defaultValue':_0x590b('0x9')},'modem':{'type':Sequelize['STRING'],'defaultValue':_0x590b('0xb')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x590b('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x590b('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x590b('0x2')](_0x590b('0xd'),'IAX',_0x590b('0xe'),_0x590b('0xf')),'defaultValue':_0x590b('0xd')},'key':{'type':Sequelize[_0x590b('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x590b('0x10')],'defaultValue':function(){return _0x590b('0x11');}},'notificationSound':{'type':Sequelize[_0x590b('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x590b('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x590b('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x590b('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x590b('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x590b('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x590b('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x590b('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x590b('0xc')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x590b('0x12')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x5c788){if(!_0x5c788)this[_0x590b('0x13')](_0x590b('0x14'),null);this['setDataValue']('mandatoryDisposition',_0x5c788);}}}; \ No newline at end of file +var _0x8819=['2400','4800','9600','12000','14400','v17,v27,v29','SIP','DADHI','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','mandatoryDispositionPauseId','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid'];(function(_0x4f3c9b,_0x28e078){var _0x84e58a=function(_0x37bf49){while(--_0x37bf49){_0x4f3c9b['push'](_0x4f3c9b['shift']());}};_0x84e58a(++_0x28e078);}(_0x8819,0x94));var _0x9881=function(_0x1babac,_0x436e22){_0x1babac=_0x1babac-0x0;var _0x16c7cd=_0x8819[_0x1babac];return _0x16c7cd;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9881('0x0')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9881('0x0')]},'ecm':{'type':Sequelize[_0x9881('0x1')](_0x9881('0x2'),'no'),'defaultValue':_0x9881('0x2')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0x9881('0x3')},'localstationid':{'type':Sequelize[_0x9881('0x0')],'unique':_0x9881('0x4')},'minrate':{'type':Sequelize[_0x9881('0x1')](_0x9881('0x5'),_0x9881('0x6'),'7200',_0x9881('0x7'),'12000','14400'),'defaultValue':_0x9881('0x6')},'maxrate':{'type':Sequelize['ENUM']('2400',_0x9881('0x6'),'7200',_0x9881('0x7'),_0x9881('0x8'),_0x9881('0x9')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x9881('0x0')],'defaultValue':_0x9881('0xa')},'gateway':{'type':Sequelize[_0x9881('0x0')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x9881('0x0')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x9881('0x1')](_0x9881('0xb'),'IAX',_0x9881('0xc'),'KHOMP'),'defaultValue':'SIP'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x9881('0xd');}},'notificationSound':{'type':Sequelize[_0x9881('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9881('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9881('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x9881('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9881('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9881('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9881('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9881('0xf')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x280ea2){if(!_0x280ea2)this['setDataValue'](_0x9881('0x10'),null);this['setDataValue']('mandatoryDisposition',_0x280ea2);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 9f3b8df..ed3bc9d 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 _0xd076=['error','code','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','FaxAccounts','UserProfileResource','stack','name','send','Pause','map','FaxAccount','fieldName','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','mandatoryDispositionPause','rawAttributes','intersection','include','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','FaxAccountId','Disposition','getDispositions','findOne','removeDispositions','addAnswer','getAnswers','CannedAnswer','removeAnswers','ids','addInteraction','getInteractions','CmContact','internal','color','tag','FaxInteraction','addApplications','sequelize','Transaction','ISOLATION_LEVELS','FaxApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','exten','localstationid','app','system','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','headerinfo','maxrate','minrate','modem','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','transaction','VoiceExtension','omit','tech','key','createdAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','List','Contacts','updatedAt','attachments','join','server/files/attachments','basename','isNil','from','format','\x22%s\x22\x20<%s>','fax','Send\x20Fax\x20failed','filename','Messages','Contact\x20not\x20found','spread','out','ContactId','dataValues','SendFax','info','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','User','getAgents','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','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','jayson/promise','client','http','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x1f17db,_0x1b258e){var _0x68d72b=function(_0xf8a86b){while(--_0xf8a86b){_0x1f17db['push'](_0x1f17db['shift']());}};_0x68d72b(++_0x1b258e);}(_0xd076,0xa0));var _0x6d07=function(_0x4597e1,_0x187f2){_0x4597e1=_0x4597e1-0x0;var _0x408820=_0xd076[_0x4597e1];return _0x408820;};'use strict';var emlformat=require(_0x6d07('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6d07('0x1'));var jsonpatch=require(_0x6d07('0x2'));var rp=require(_0x6d07('0x3'));var moment=require('moment');var BPromise=require(_0x6d07('0x4'));var Mustache=require(_0x6d07('0x5'));var util=require(_0x6d07('0x6'));var path=require(_0x6d07('0x7'));var sox=require(_0x6d07('0x8'));var csv=require(_0x6d07('0x9'));var ejs=require(_0x6d07('0xa'));var fs=require('fs');var fs_extra=require(_0x6d07('0xb'));var _=require(_0x6d07('0xc'));var squel=require(_0x6d07('0xd'));var crypto=require(_0x6d07('0xe'));var jsforce=require(_0x6d07('0xf'));var deskjs=require(_0x6d07('0x10'));var toCsv=require('to-csv');var querystring=require(_0x6d07('0x11'));var Papa=require('papaparse');var Redis=require(_0x6d07('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6d07('0x13'));var as=require(_0x6d07('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6d07('0x15'))(_0x6d07('0x16'));var utils=require(_0x6d07('0x17'));var config=require(_0x6d07('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x6d07('0x19'))['db'];config[_0x6d07('0x1a')]=_[_0x6d07('0x1b')](config[_0x6d07('0x1a')],{'host':_0x6d07('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6d07('0x1a')]));require('./faxAccount.socket')['register'](socket);var jayson=require(_0x6d07('0x1d'));var client=jayson[_0x6d07('0x1e')][_0x6d07('0x1f')]({'port':0x232c});var client9002=jayson[_0x6d07('0x1e')][_0x6d07('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x250c1b,_0x4e768,_0x5d4edf,_0x41015f){return new BPromise(function(_0x517b14,_0x19c8b4){var _0x4a9d27=_0x41015f||client;return _0x4a9d27[_0x6d07('0x20')](_0x250c1b,_0x5d4edf)[_0x6d07('0x21')](function(_0x1659b9){logger['info'](_0x6d07('0x22'),_0x4e768,_0x6d07('0x23'));logger[_0x6d07('0x24')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x4e768,'request\x20sent',JSON[_0x6d07('0x25')](_0x1659b9));if(_0x1659b9[_0x6d07('0x26')]){if(_0x1659b9[_0x6d07('0x26')][_0x6d07('0x27')]===0x1f4){logger[_0x6d07('0x26')](_0x6d07('0x22'),_0x4e768,_0x1659b9[_0x6d07('0x26')][_0x6d07('0x28')]);return _0x19c8b4(_0x1659b9[_0x6d07('0x26')]['message']);}logger[_0x6d07('0x26')](_0x6d07('0x22'),_0x4e768,_0x1659b9['error'][_0x6d07('0x28')]);return _0x517b14(_0x1659b9['error'][_0x6d07('0x28')]);}else{logger['info'](_0x6d07('0x22'),_0x4e768,_0x6d07('0x23'));_0x517b14(_0x1659b9[_0x6d07('0x29')][_0x6d07('0x28')]);}})[_0x6d07('0x2a')](function(_0x167f4b){logger[_0x6d07('0x26')](_0x6d07('0x22'),_0x4e768,_0x167f4b);_0x19c8b4(_0x167f4b);});});}function respondWithStatusCode(_0x2b3472,_0x53c985){_0x53c985=_0x53c985||0xcc;return function(_0x216fe4){if(_0x216fe4){return _0x2b3472[_0x6d07('0x2b')](_0x53c985);}return _0x2b3472[_0x6d07('0x2c')](_0x53c985)[_0x6d07('0x2d')]();};}function respondWithResult(_0x207b39,_0x314d0c){_0x314d0c=_0x314d0c||0xc8;return function(_0x312ae5){if(_0x312ae5){return _0x207b39['status'](_0x314d0c)[_0x6d07('0x2e')](_0x312ae5);}};}function respondWithFilteredResult(_0x258d64,_0x7bbad2){return function(_0xcfbb3e){if(_0xcfbb3e){var _0x5f0b46=typeof _0x7bbad2[_0x6d07('0x2f')]==='undefined'&&typeof _0x7bbad2[_0x6d07('0x30')]===_0x6d07('0x31');var _0x33bc52=_0xcfbb3e['count'];var _0x37a683=_0x5f0b46?0x0:_0x7bbad2[_0x6d07('0x2f')];var _0x1097df=_0x5f0b46?_0xcfbb3e[_0x6d07('0x32')]:_0x7bbad2['offset']+_0x7bbad2[_0x6d07('0x30')];var _0x382730;if(_0x1097df>=_0x33bc52){_0x1097df=_0x33bc52;_0x382730=0xc8;}else{_0x382730=0xce;}_0x258d64[_0x6d07('0x2c')](_0x382730);return _0x258d64[_0x6d07('0x33')](_0x6d07('0x34'),_0x37a683+'-'+_0x1097df+'/'+_0x33bc52)['json'](_0xcfbb3e);}return null;};}function patchUpdates(_0x4d7b97){return function(_0x5398c3){try{jsonpatch['apply'](_0x5398c3,_0x4d7b97,!![]);}catch(_0x1c722a){return BPromise[_0x6d07('0x35')](_0x1c722a);}return _0x5398c3[_0x6d07('0x36')]();};}function saveUpdates(_0x3b47f9,_0x360e65){return function(_0xc2a90e){if(_0xc2a90e){return _0xc2a90e[_0x6d07('0x37')](_0x3b47f9)[_0x6d07('0x21')](function(_0x40c6e9){return _0x40c6e9;});}return null;};}function removeEntity(_0x200a6c,_0x453fe5){return function(_0x1d3129){if(_0x1d3129){return _0x1d3129[_0x6d07('0x38')]()[_0x6d07('0x21')](function(){var _0x4801aa=_0x1d3129['get']({'plain':!![]});var _0x46acef=_0x6d07('0x39');return db[_0x6d07('0x3a')][_0x6d07('0x38')]({'where':{'type':_0x46acef,'resourceId':_0x4801aa['id']}})[_0x6d07('0x21')](function(){return _0x1d3129;});})[_0x6d07('0x21')](function(){_0x200a6c[_0x6d07('0x2c')](0xcc)[_0x6d07('0x2d')]();});}};}function handleEntityNotFound(_0xb44449,_0x2c6f4a){return function(_0x48fc18){if(!_0x48fc18){_0xb44449[_0x6d07('0x2b')](0x194);}return _0x48fc18;};}function handleError(_0x16950f,_0x260efd){_0x260efd=_0x260efd||0x1f4;return function(_0x28349d){logger['error'](_0x28349d[_0x6d07('0x3b')]);if(_0x28349d['name']){delete _0x28349d[_0x6d07('0x3c')];}_0x16950f[_0x6d07('0x2c')](_0x260efd)[_0x6d07('0x3d')](_0x28349d);};}exports['index']=function(_0x2d9f18,_0x57b2c4){var _0x56e26d={'include':[{'model':db[_0x6d07('0x3e')],'as':'mandatoryDispositionPause'}]},_0x5a353c={},_0x1f4d9b={'count':0x0,'rows':[]};var _0x144d3c=_[_0x6d07('0x3f')](db[_0x6d07('0x40')]['rawAttributes'],function(_0x56c8c6){return{'name':_0x56c8c6[_0x6d07('0x41')],'type':_0x56c8c6[_0x6d07('0x42')]['key']};});_0x5a353c[_0x6d07('0x43')]=_[_0x6d07('0x3f')](_0x144d3c,'name');_0x5a353c[_0x6d07('0x44')]=_[_0x6d07('0x45')](_0x2d9f18[_0x6d07('0x44')]);_0x5a353c[_0x6d07('0x46')]=_['intersection'](_0x5a353c['model'],_0x5a353c[_0x6d07('0x44')]);_0x56e26d[_0x6d07('0x47')]=_['intersection'](_0x5a353c[_0x6d07('0x43')],qs[_0x6d07('0x48')](_0x2d9f18[_0x6d07('0x44')][_0x6d07('0x48')]));_0x56e26d['attributes']=_0x56e26d[_0x6d07('0x47')][_0x6d07('0x49')]?_0x56e26d[_0x6d07('0x47')]:_0x5a353c[_0x6d07('0x43')];if(!_0x2d9f18['query'][_0x6d07('0x4a')](_0x6d07('0x4b'))){_0x56e26d[_0x6d07('0x30')]=qs['limit'](_0x2d9f18[_0x6d07('0x44')][_0x6d07('0x30')]);_0x56e26d[_0x6d07('0x2f')]=qs['offset'](_0x2d9f18[_0x6d07('0x44')][_0x6d07('0x2f')]);}_0x56e26d[_0x6d07('0x4c')]=qs[_0x6d07('0x4d')](_0x2d9f18[_0x6d07('0x44')][_0x6d07('0x4d')]);_0x56e26d[_0x6d07('0x4e')]=qs[_0x6d07('0x46')](_[_0x6d07('0x4f')](_0x2d9f18[_0x6d07('0x44')],_0x5a353c[_0x6d07('0x46')]),_0x144d3c);if(_0x2d9f18[_0x6d07('0x44')][_0x6d07('0x50')]){_0x56e26d[_0x6d07('0x4e')]=_[_0x6d07('0x51')](_0x56e26d[_0x6d07('0x4e')],{'$or':_[_0x6d07('0x3f')](_0x144d3c,function(_0x1b83a5){if(_0x1b83a5['type']!==_0x6d07('0x52')){var _0x25bf62={};_0x25bf62[_0x1b83a5[_0x6d07('0x3c')]]={'$like':'%'+_0x2d9f18[_0x6d07('0x44')][_0x6d07('0x50')]+'%'};return _0x25bf62;}})});}_0x56e26d=_['merge']({},_0x56e26d,_0x2d9f18[_0x6d07('0x53')]);var _0x344093={'where':_0x56e26d['where']};return db['FaxAccount']['count'](_0x344093)[_0x6d07('0x21')](function(_0x460fc8){_0x1f4d9b[_0x6d07('0x32')]=_0x460fc8;if(_0x2d9f18['query'][_0x6d07('0x54')]){_0x56e26d['include']=[{'all':!![]}];}return db[_0x6d07('0x40')][_0x6d07('0x55')](_0x56e26d);})[_0x6d07('0x21')](function(_0x4a5eed){_0x1f4d9b[_0x6d07('0x56')]=_0x4a5eed;return _0x1f4d9b;})['then'](respondWithFilteredResult(_0x57b2c4,_0x56e26d))[_0x6d07('0x2a')](handleError(_0x57b2c4,null));};exports[_0x6d07('0x57')]=function(_0x367e69,_0x5d3327){var _0x4cf4d8={'raw':![],'where':{'id':_0x367e69['params']['id']},'include':[{'model':db[_0x6d07('0x3e')],'as':_0x6d07('0x58')}]},_0x1f58ab={};_0x1f58ab[_0x6d07('0x43')]=_[_0x6d07('0x45')](db[_0x6d07('0x40')][_0x6d07('0x59')]);_0x1f58ab[_0x6d07('0x44')]=_['keys'](_0x367e69['query']);_0x1f58ab[_0x6d07('0x46')]=_[_0x6d07('0x5a')](_0x1f58ab[_0x6d07('0x43')],_0x1f58ab[_0x6d07('0x44')]);_0x4cf4d8[_0x6d07('0x47')]=_[_0x6d07('0x5a')](_0x1f58ab[_0x6d07('0x43')],qs[_0x6d07('0x48')](_0x367e69[_0x6d07('0x44')][_0x6d07('0x48')]));_0x4cf4d8[_0x6d07('0x47')]=_0x4cf4d8[_0x6d07('0x47')][_0x6d07('0x49')]?_0x4cf4d8[_0x6d07('0x47')]:_0x1f58ab[_0x6d07('0x43')];if(_0x367e69[_0x6d07('0x44')][_0x6d07('0x54')]){_0x4cf4d8[_0x6d07('0x5b')]=[{'all':!![]}];}_0x4cf4d8=_[_0x6d07('0x51')]({},_0x4cf4d8,_0x367e69[_0x6d07('0x53')]);return db[_0x6d07('0x40')]['find'](_0x4cf4d8)[_0x6d07('0x21')](handleEntityNotFound(_0x5d3327,null))[_0x6d07('0x21')](respondWithResult(_0x5d3327,null))[_0x6d07('0x2a')](handleError(_0x5d3327,null));};exports['create']=function(_0x50a3a3,_0x137162){return db[_0x6d07('0x40')]['create'](_0x50a3a3[_0x6d07('0x5c')],{})[_0x6d07('0x21')](function(_0xc5d3aa){var _0x3b35c0=_0x50a3a3[_0x6d07('0x5d')][_0x6d07('0x5e')]({'plain':!![]});if(!_0x3b35c0)throw new Error(_0x6d07('0x5f'));if(_0x3b35c0[_0x6d07('0x60')]===_0x6d07('0x5d')){var _0x47f96a=_0xc5d3aa[_0x6d07('0x5e')]({'plain':!![]});var _0x23c2c5=_0x6d07('0x39');return db[_0x6d07('0x61')][_0x6d07('0x62')]({'where':{'name':_0x23c2c5,'userProfileId':_0x3b35c0[_0x6d07('0x63')]},'raw':!![]})['then'](function(_0x5c9212){if(_0x5c9212&&_0x5c9212[_0x6d07('0x64')]===0x0){return db[_0x6d07('0x3a')][_0x6d07('0x65')]({'name':_0x47f96a[_0x6d07('0x3c')],'resourceId':_0x47f96a['id'],'type':_0x5c9212['name'],'sectionId':_0x5c9212['id']},{})[_0x6d07('0x21')](function(){return _0xc5d3aa;});}else{return _0xc5d3aa;}})['catch'](function(_0x3afcba){logger[_0x6d07('0x26')](_0x6d07('0x66'),_0x3afcba);throw _0x3afcba;});}return _0xc5d3aa;})[_0x6d07('0x21')](respondWithResult(_0x137162,0xc9))['catch'](handleError(_0x137162,null));};exports[_0x6d07('0x37')]=function(_0x32bc72,_0x130ab5){if(_0x32bc72['body']['id']){delete _0x32bc72['body']['id'];}return db[_0x6d07('0x40')][_0x6d07('0x62')]({'where':{'id':_0x32bc72[_0x6d07('0x67')]['id']},'include':[{'model':db[_0x6d07('0x3e')],'as':'mandatoryDispositionPause'}]})[_0x6d07('0x21')](handleEntityNotFound(_0x130ab5,null))[_0x6d07('0x21')](saveUpdates(_0x32bc72[_0x6d07('0x5c')],null))['then'](respondWithResult(_0x130ab5,null))[_0x6d07('0x2a')](handleError(_0x130ab5,null));};exports[_0x6d07('0x38')]=function(_0x4bab7b,_0x386eb4){return db[_0x6d07('0x40')][_0x6d07('0x62')]({'where':{'id':_0x4bab7b[_0x6d07('0x67')]['id']}})[_0x6d07('0x21')](handleEntityNotFound(_0x386eb4,null))['then'](removeEntity(_0x386eb4,null))[_0x6d07('0x2a')](handleError(_0x386eb4,null));};exports[_0x6d07('0x68')]=function(_0x3e909d,_0x5ce163){return db[_0x6d07('0x40')][_0x6d07('0x68')]()[_0x6d07('0x21')](respondWithResult(_0x5ce163,null))[_0x6d07('0x2a')](handleError(_0x5ce163,null));};exports['addDisposition']=function(_0x380535,_0x91876,_0x1a4073){if(_0x380535[_0x6d07('0x5c')]['id']){delete _0x380535[_0x6d07('0x5c')]['id'];}return db[_0x6d07('0x40')][_0x6d07('0x62')]({'where':{'id':_0x380535[_0x6d07('0x67')]['id']}})[_0x6d07('0x21')](handleEntityNotFound(_0x91876,null))[_0x6d07('0x21')](function(_0x591c2d){if(_0x591c2d){_0x380535[_0x6d07('0x5c')][_0x6d07('0x69')]=_0x591c2d['id'];return db[_0x6d07('0x6a')][_0x6d07('0x65')](_0x380535[_0x6d07('0x5c')]);}})['then'](respondWithResult(_0x91876,null))['catch'](handleError(_0x91876,null));};exports[_0x6d07('0x6b')]=function(_0x4bbc16,_0x2ce017,_0x3672a8){var _0x2f5bf3={'raw':![],'where':{}};var _0x52f16b={};var _0x396103={'count':0x0,'rows':[]};return db[_0x6d07('0x40')][_0x6d07('0x6c')]({'where':{'id':_0x4bbc16[_0x6d07('0x67')]['id']}})[_0x6d07('0x21')](handleEntityNotFound(_0x2ce017,null))[_0x6d07('0x21')](function(_0x117eec){if(_0x117eec){_0x52f16b[_0x6d07('0x43')]=_[_0x6d07('0x45')](db[_0x6d07('0x6a')][_0x6d07('0x59')]);_0x52f16b[_0x6d07('0x44')]=_[_0x6d07('0x45')](_0x4bbc16['query']);_0x52f16b[_0x6d07('0x46')]=_['intersection'](_0x52f16b['model'],_0x52f16b['query']);_0x2f5bf3[_0x6d07('0x47')]=_[_0x6d07('0x5a')](_0x52f16b[_0x6d07('0x43')],qs[_0x6d07('0x48')](_0x4bbc16[_0x6d07('0x44')][_0x6d07('0x48')]));_0x2f5bf3[_0x6d07('0x47')]=_0x2f5bf3[_0x6d07('0x47')][_0x6d07('0x49')]?_0x2f5bf3[_0x6d07('0x47')]:_0x52f16b[_0x6d07('0x43')];if(!_0x4bbc16[_0x6d07('0x44')][_0x6d07('0x4a')](_0x6d07('0x4b'))){_0x2f5bf3[_0x6d07('0x30')]=qs[_0x6d07('0x30')](_0x4bbc16['query'][_0x6d07('0x30')]);_0x2f5bf3[_0x6d07('0x2f')]=qs[_0x6d07('0x2f')](_0x4bbc16[_0x6d07('0x44')][_0x6d07('0x2f')]);}_0x2f5bf3['order']=qs[_0x6d07('0x4d')](_0x4bbc16['query'][_0x6d07('0x4d')]);_0x2f5bf3['where']=qs[_0x6d07('0x46')](_[_0x6d07('0x4f')](_0x4bbc16[_0x6d07('0x44')],_0x52f16b['filters']));_0x2f5bf3[_0x6d07('0x4e')][_0x6d07('0x69')]=_0x117eec['id'];if(_0x4bbc16[_0x6d07('0x44')][_0x6d07('0x50')]){_0x2f5bf3[_0x6d07('0x4e')]=_[_0x6d07('0x51')](_0x2f5bf3['where'],{'$or':_[_0x6d07('0x3f')](_0x2f5bf3[_0x6d07('0x47')],function(_0x3c0f96){var _0x4794d6={};_0x4794d6[_0x3c0f96]={'$like':'%'+_0x4bbc16[_0x6d07('0x44')][_0x6d07('0x50')]+'%'};return _0x4794d6;})});}_0x2f5bf3=_[_0x6d07('0x51')]({},_0x2f5bf3,_0x4bbc16['options']);return db['Disposition'][_0x6d07('0x32')]({'where':_0x2f5bf3[_0x6d07('0x4e')]})[_0x6d07('0x21')](function(_0x5d8d6e){_0x396103[_0x6d07('0x32')]=_0x5d8d6e;if(_0x4bbc16[_0x6d07('0x44')][_0x6d07('0x54')]){_0x2f5bf3[_0x6d07('0x5b')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x2f5bf3);})[_0x6d07('0x21')](function(_0x36fa66){_0x396103[_0x6d07('0x56')]=_0x36fa66;return _0x396103;});}})[_0x6d07('0x21')](respondWithFilteredResult(_0x2ce017,_0x2f5bf3))['catch'](handleError(_0x2ce017,null));};exports['removeDispositions']=function(_0x5cf592,_0x3daec0,_0x2d65d9){return db[_0x6d07('0x40')][_0x6d07('0x62')]({'where':{'id':_0x5cf592['params']['id']}})[_0x6d07('0x21')](handleEntityNotFound(_0x3daec0,null))['then'](function(_0x425017){if(_0x425017){return _0x425017[_0x6d07('0x6d')](_0x5cf592[_0x6d07('0x44')]['ids']);}})[_0x6d07('0x21')](respondWithStatusCode(_0x3daec0,null))[_0x6d07('0x2a')](handleError(_0x3daec0,null));};exports[_0x6d07('0x6e')]=function(_0x2bc262,_0x235f63,_0x315855){if(_0x2bc262[_0x6d07('0x5c')]['id']){delete _0x2bc262[_0x6d07('0x5c')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x2bc262[_0x6d07('0x67')]['id']}})[_0x6d07('0x21')](handleEntityNotFound(_0x235f63,null))[_0x6d07('0x21')](function(_0x53f360){if(_0x53f360){_0x2bc262['body'][_0x6d07('0x69')]=_0x53f360['id'];return db['CannedAnswer']['create'](_0x2bc262['body']);}})[_0x6d07('0x21')](respondWithResult(_0x235f63,null))[_0x6d07('0x2a')](handleError(_0x235f63,null));};exports[_0x6d07('0x6f')]=function(_0x2e7d89,_0x266278,_0x5277d0){var _0x1dbcae={'raw':![],'where':{}};var _0x20be39={};var _0x3669fd={'count':0x0,'rows':[]};return db[_0x6d07('0x40')][_0x6d07('0x6c')]({'where':{'id':_0x2e7d89[_0x6d07('0x67')]['id']}})['then'](handleEntityNotFound(_0x266278,null))['then'](function(_0x22ec80){if(_0x22ec80){_0x20be39[_0x6d07('0x43')]=_[_0x6d07('0x45')](db[_0x6d07('0x70')][_0x6d07('0x59')]);_0x20be39[_0x6d07('0x44')]=_[_0x6d07('0x45')](_0x2e7d89['query']);_0x20be39[_0x6d07('0x46')]=_[_0x6d07('0x5a')](_0x20be39['model'],_0x20be39[_0x6d07('0x44')]);_0x1dbcae['attributes']=_[_0x6d07('0x5a')](_0x20be39['model'],qs['fields'](_0x2e7d89[_0x6d07('0x44')][_0x6d07('0x48')]));_0x1dbcae['attributes']=_0x1dbcae[_0x6d07('0x47')][_0x6d07('0x49')]?_0x1dbcae['attributes']:_0x20be39['model'];if(!_0x2e7d89[_0x6d07('0x44')][_0x6d07('0x4a')](_0x6d07('0x4b'))){_0x1dbcae[_0x6d07('0x30')]=qs[_0x6d07('0x30')](_0x2e7d89[_0x6d07('0x44')][_0x6d07('0x30')]);_0x1dbcae['offset']=qs[_0x6d07('0x2f')](_0x2e7d89[_0x6d07('0x44')][_0x6d07('0x2f')]);}_0x1dbcae[_0x6d07('0x4c')]=qs['sort'](_0x2e7d89[_0x6d07('0x44')][_0x6d07('0x4d')]);_0x1dbcae[_0x6d07('0x4e')]=qs[_0x6d07('0x46')](_[_0x6d07('0x4f')](_0x2e7d89['query'],_0x20be39[_0x6d07('0x46')]));_0x1dbcae[_0x6d07('0x4e')][_0x6d07('0x69')]=_0x22ec80['id'];if(_0x2e7d89['query'][_0x6d07('0x50')]){_0x1dbcae[_0x6d07('0x4e')]=_[_0x6d07('0x51')](_0x1dbcae[_0x6d07('0x4e')],{'$or':_[_0x6d07('0x3f')](_0x1dbcae[_0x6d07('0x47')],function(_0x487cc4){var _0x4b3d43={};_0x4b3d43[_0x487cc4]={'$like':'%'+_0x2e7d89[_0x6d07('0x44')][_0x6d07('0x50')]+'%'};return _0x4b3d43;})});}_0x1dbcae=_[_0x6d07('0x51')]({},_0x1dbcae,_0x2e7d89[_0x6d07('0x53')]);return db[_0x6d07('0x70')][_0x6d07('0x32')]({'where':_0x1dbcae['where']})[_0x6d07('0x21')](function(_0x385ab0){_0x3669fd[_0x6d07('0x32')]=_0x385ab0;if(_0x2e7d89[_0x6d07('0x44')][_0x6d07('0x54')]){_0x1dbcae[_0x6d07('0x5b')]=[{'all':!![]}];}return db[_0x6d07('0x70')][_0x6d07('0x55')](_0x1dbcae);})[_0x6d07('0x21')](function(_0x4b46e5){_0x3669fd[_0x6d07('0x56')]=_0x4b46e5;return _0x3669fd;});}})[_0x6d07('0x21')](respondWithFilteredResult(_0x266278,_0x1dbcae))['catch'](handleError(_0x266278,null));};exports[_0x6d07('0x71')]=function(_0x1fe29a,_0x481fcb,_0x222742){return db[_0x6d07('0x40')][_0x6d07('0x62')]({'where':{'id':_0x1fe29a[_0x6d07('0x67')]['id']}})[_0x6d07('0x21')](handleEntityNotFound(_0x481fcb,null))[_0x6d07('0x21')](function(_0x58bfd6){if(_0x58bfd6){return _0x58bfd6[_0x6d07('0x71')](_0x1fe29a['query'][_0x6d07('0x72')]);}})['then'](respondWithStatusCode(_0x481fcb,null))[_0x6d07('0x2a')](handleError(_0x481fcb,null));};exports[_0x6d07('0x73')]=function(_0x43b1c0,_0x1de2aa,_0x18ea85){return db['FaxInteraction']['find']({'where':{'id':_0x43b1c0[_0x6d07('0x67')]['id']}})[_0x6d07('0x21')](handleEntityNotFound(_0x1de2aa,null))[_0x6d07('0x21')](function(_0x566e45){if(_0x566e45){return _0x566e45[_0x6d07('0x73')](_0x43b1c0[_0x6d07('0x5c')][_0x6d07('0x72')],_['omit'](_0x43b1c0['body'],[_0x6d07('0x72'),'id'])||{});}})['then'](respondWithResult(_0x1de2aa,null))[_0x6d07('0x2a')](handleError(_0x1de2aa,null));};exports[_0x6d07('0x74')]=function(_0x2434d3,_0x49db1f,_0x26dc01){var _0x5b6cf7={'raw':![],'where':{}};var _0x5e559b={};var _0x1baeb7={'count':0x0,'rows':[]};return db[_0x6d07('0x40')]['findOne']({'where':{'id':_0x2434d3[_0x6d07('0x67')]['id']}})['then'](handleEntityNotFound(_0x49db1f,null))[_0x6d07('0x21')](function(_0x1a4961){if(_0x1a4961){_0x5e559b['model']=_[_0x6d07('0x45')](db['FaxInteraction']['rawAttributes']);_0x5e559b[_0x6d07('0x44')]=_['keys'](_0x2434d3['query']);_0x5e559b[_0x6d07('0x46')]=_['intersection'](_0x5e559b['model'],_0x5e559b['query']);_0x5b6cf7['attributes']=_['intersection'](_0x5e559b['model'],qs[_0x6d07('0x48')](_0x2434d3[_0x6d07('0x44')]['fields']));_0x5b6cf7[_0x6d07('0x47')]=_0x5b6cf7['attributes']['length']?_0x5b6cf7[_0x6d07('0x47')]:_0x5e559b[_0x6d07('0x43')];if(!_0x2434d3[_0x6d07('0x44')]['hasOwnProperty']('nolimit')){_0x5b6cf7[_0x6d07('0x30')]=qs[_0x6d07('0x30')](_0x2434d3[_0x6d07('0x44')][_0x6d07('0x30')]);_0x5b6cf7[_0x6d07('0x2f')]=qs[_0x6d07('0x2f')](_0x2434d3[_0x6d07('0x44')]['offset']);}_0x5b6cf7['order']=qs[_0x6d07('0x4d')](_0x2434d3['query'][_0x6d07('0x4d')]);_0x5b6cf7[_0x6d07('0x4e')]=qs[_0x6d07('0x46')](_[_0x6d07('0x4f')](_0x2434d3[_0x6d07('0x44')],_0x5e559b[_0x6d07('0x46')]));_0x5b6cf7['where'][_0x6d07('0x69')]=_0x1a4961['id'];if(_0x2434d3[_0x6d07('0x44')][_0x6d07('0x50')]){_0x5b6cf7['where']=_[_0x6d07('0x51')](_0x5b6cf7[_0x6d07('0x4e')],{'$or':_[_0x6d07('0x3f')](_0x5b6cf7['attributes'],function(_0x3223f4){var _0x486a41={};_0x486a41[_0x3223f4]={'$like':'%'+_0x2434d3[_0x6d07('0x44')]['filter']+'%'};return _0x486a41;})});}_0x5b6cf7=_[_0x6d07('0x51')]({},_0x5b6cf7,_0x2434d3[_0x6d07('0x53')]);return db['FaxInteraction'][_0x6d07('0x32')]({'where':_0x5b6cf7['where']})[_0x6d07('0x21')](function(_0x2ba8cf){_0x1baeb7[_0x6d07('0x32')]=_0x2ba8cf;if(_0x2434d3[_0x6d07('0x44')][_0x6d07('0x54')]){_0x5b6cf7['include']=[{'model':db[_0x6d07('0x75')],'as':'Contact','required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x6d07('0x3c'),'fullname',_0x6d07('0x76')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x6d07('0x3c'),_0x6d07('0x77')],'where':_0x2434d3[_0x6d07('0x44')][_0x6d07('0x78')]?{'id':_0x2434d3[_0x6d07('0x44')][_0x6d07('0x78')]}:undefined,'required':_0x2434d3['query']['tag']?!![]:![]}];}return db[_0x6d07('0x79')][_0x6d07('0x55')](_0x5b6cf7);})[_0x6d07('0x21')](function(_0xb15277){_0x1baeb7['rows']=_0xb15277;return _0x1baeb7;});}})[_0x6d07('0x21')](respondWithFilteredResult(_0x49db1f,_0x5b6cf7))[_0x6d07('0x2a')](handleError(_0x49db1f,null));};exports[_0x6d07('0x7a')]=function(_0x1c5a5b,_0x410136){var _0x3bca80=_0x1c5a5b[_0x6d07('0x67')]['id'];var _0x594c28=_0x1c5a5b['body'];var _0x1e07bf=0xc8;var _0x591772=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x6d07('0x7b')][_0x6d07('0x7c')][_0x6d07('0x7d')]['READ_COMMITTED']},function(_0xc82ac0){return db[_0x6d07('0x40')]['findOne']({'where':{'id':_0x3bca80},'transaction':_0xc82ac0})[_0x6d07('0x21')](function(_0x2f871b){if(_0x2f871b){return db[_0x6d07('0x7e')][_0x6d07('0x38')]({'where':{'FaxAccountId':_0x3bca80},'transaction':_0xc82ac0})[_0x6d07('0x21')](function(){var _0xc590=_['map'](_0x594c28,function(_0x392a16){_0x392a16[_0x6d07('0x69')]=_0x3bca80;return _0x392a16;});return db[_0x6d07('0x7e')][_0x6d07('0x7f')](_0xc590,{'transaction':_0xc82ac0});});}else{_0x1e07bf=0x194;_0x591772=[];}});})[_0x6d07('0x21')](function(){if(_0x1e07bf!==0x194){return db[_0x6d07('0x7e')][_0x6d07('0x80')]({'where':{'FaxAccountId':_0x3bca80},'order':_0x6d07('0x81')})[_0x6d07('0x21')](function(_0x6ced2a){_0x591772=_0x6ced2a;});}})[_0x6d07('0x2a')](function(_0x2cdf5b){_0x1e07bf=0x1f4;logger[_0x6d07('0x26')](_0x2cdf5b['stack']);if(_0x2cdf5b['name']){delete _0x2cdf5b['name'];}_0x591772=_0x2cdf5b;})[_0x6d07('0x82')](function(){if(_0x591772===null){_0x410136[_0x6d07('0x2b')](_0x1e07bf);}else{if(_0x1e07bf===0x1f4){_0x410136[_0x6d07('0x2c')](_0x1e07bf)[_0x6d07('0x3d')](_0x591772);}else{_0x410136[_0x6d07('0x2c')](_0x1e07bf)['json'](_0x591772);}}});};exports[_0x6d07('0x83')]=function(_0x15201d,_0xaaa14a,_0x4294ed){var _0x82a963={};var _0x2e6123={};var _0x50f700;var _0x37dcbe;return db[_0x6d07('0x40')][_0x6d07('0x6c')]({'where':{'id':_0x15201d['params']['id']}})[_0x6d07('0x21')](handleEntityNotFound(_0xaaa14a,null))[_0x6d07('0x21')](function(_0x540ac1){if(_0x540ac1){_0x50f700=_0x540ac1;_0x2e6123[_0x6d07('0x43')]=_[_0x6d07('0x45')](db['FaxApplication'][_0x6d07('0x59')]);_0x2e6123['query']=_[_0x6d07('0x45')](_0x15201d['query']);_0x2e6123[_0x6d07('0x46')]=_[_0x6d07('0x5a')](_0x2e6123[_0x6d07('0x43')],_0x2e6123[_0x6d07('0x44')]);_0x82a963[_0x6d07('0x47')]=_['intersection'](_0x2e6123['model'],qs['fields'](_0x15201d[_0x6d07('0x44')][_0x6d07('0x48')]));_0x82a963['attributes']=_0x82a963[_0x6d07('0x47')]['length']?_0x82a963[_0x6d07('0x47')]:_0x2e6123[_0x6d07('0x43')];_0x82a963[_0x6d07('0x4c')]=qs[_0x6d07('0x4d')](_0x15201d['query'][_0x6d07('0x4d')]);_0x82a963[_0x6d07('0x4e')]=qs[_0x6d07('0x46')](_[_0x6d07('0x4f')](_0x15201d[_0x6d07('0x44')],_0x2e6123[_0x6d07('0x46')]));if(_0x15201d[_0x6d07('0x44')][_0x6d07('0x50')]){_0x82a963['where']=_[_0x6d07('0x51')](_0x82a963[_0x6d07('0x4e')],{'$or':_['map'](_0x82a963['attributes'],function(_0x21f149){var _0x4b80f3={};_0x4b80f3[_0x21f149]={'$like':'%'+_0x15201d[_0x6d07('0x44')][_0x6d07('0x50')]+'%'};return _0x4b80f3;})});}_0x82a963=_[_0x6d07('0x51')]({},_0x82a963,_0x15201d[_0x6d07('0x53')]);return _0x50f700['getApplications'](_0x82a963);}})[_0x6d07('0x21')](function(_0x496a3d){if(_0x496a3d){_0x37dcbe=_0x496a3d[_0x6d07('0x49')];if(!_0x15201d[_0x6d07('0x44')][_0x6d07('0x4a')](_0x6d07('0x4b'))){_0x82a963[_0x6d07('0x30')]=qs[_0x6d07('0x30')](_0x15201d[_0x6d07('0x44')][_0x6d07('0x30')]);_0x82a963['offset']=qs[_0x6d07('0x2f')](_0x15201d[_0x6d07('0x44')][_0x6d07('0x2f')]);}return _0x50f700['getApplications'](_0x82a963);}})['then'](function(_0x5e0391){if(_0x5e0391){return _0x5e0391?{'count':_0x37dcbe,'rows':_0x5e0391}:null;}})[_0x6d07('0x21')](respondWithResult(_0xaaa14a,null))['catch'](handleError(_0xaaa14a,null));};function Extension(_0x287e90,_0x5b0e50,_0x1e3661,_0x4ddca6){this['context']='from-voip-provider';this[_0x6d07('0x84')]=_0x287e90[_0x6d07('0x85')];this[_0x6d07('0x86')]=_0x4ddca6;this[_0x6d07('0x42')]=_0x6d07('0x87');this[_0x6d07('0x88')]=_0x6d07('0x89');this[_0x6d07('0x69')]=_0x287e90['id'];this[_0x6d07('0x81')]=_0x5b0e50;this[_0x6d07('0x8a')]=_0x1e3661;}function createExtensionsReciveFax(_0x14d6cf){var _0x31ecf5=0x1;var _0x39dece=[];_0x39dece[_0x6d07('0x8b')](new Extension(_0x14d6cf,_0x31ecf5,'',_0x6d07('0x8c')));_0x31ecf5+=0x1;_0x39dece[_0x6d07('0x8b')](new Extension(_0x14d6cf,_0x31ecf5,_0x6d07('0x8d'),_0x6d07('0x8e')));_0x31ecf5+=0x1;for(var _0x131652 in _0x14d6cf){if(_0x14d6cf['hasOwnProperty'](_0x131652)&&(_0x131652===_0x6d07('0x8f')||_0x131652===_0x6d07('0x85')||_0x131652===_0x6d07('0x90')||_0x131652==='faxdetect'||_0x131652===_0x6d07('0x91')||_0x131652===_0x6d07('0x92')||_0x131652===_0x6d07('0x93')||_0x131652===_0x6d07('0x94')||_0x131652==='t38timeout')){_0x39dece[_0x6d07('0x8b')](new Extension(_0x14d6cf,_0x31ecf5,_0x6d07('0x95')+_0x131652+')='+_0x14d6cf[_0x131652],'Set'));_0x31ecf5+=0x1;}}_0x39dece[_0x6d07('0x8b')](new Extension(_0x14d6cf,_0x31ecf5,'6',_0x6d07('0x96')));_0x31ecf5+=0x1;_0x39dece[_0x6d07('0x8b')](new Extension(_0x14d6cf,_0x31ecf5,_0x6d07('0x97'),_0x6d07('0x98')));_0x31ecf5=0x0;return _0x39dece;}exports['addAccountApplications']=function(_0x576771,_0x5c2ac5,_0x5b862f){var _0x1687a7;return db['sequelize'][_0x6d07('0x99')](function(_0x6ec682){return db[_0x6d07('0x40')][_0x6d07('0x65')](_0x576771[_0x6d07('0x5c')],{'transaction':_0x6ec682})[_0x6d07('0x21')](function(_0x331988){_0x1687a7=_0x331988[_0x6d07('0x5e')]({'plain':!![]});return db[_0x6d07('0x9a')]['bulkCreate'](createExtensionsReciveFax(_0x1687a7),{'transaction':_0x6ec682});});})['then'](function(){return _0x1687a7;})[_0x6d07('0x21')](respondWithResult(_0x5c2ac5,null))[_0x6d07('0x2a')](handleError(_0x5c2ac5,null));};exports['updateAccountApplications']=function(_0x31384b,_0x8fdc23,_0x19ecf8){var _0x3d6087;return db['sequelize'][_0x6d07('0x99')](function(_0x1a1309){return db[_0x6d07('0x40')][_0x6d07('0x37')](_0x31384b[_0x6d07('0x5c')],{'where':{'id':_0x31384b['body']['id']},'transaction':_0x1a1309})[_0x6d07('0x21')](function(_0x5bde5a){return db[_0x6d07('0x9a')]['destroy']({'where':{'FaxAccountId':_0x31384b[_0x6d07('0x5c')]['id']},'transaction':_0x1a1309})[_0x6d07('0x21')](function(_0x351876){return db[_0x6d07('0x9a')]['bulkCreate'](createExtensionsReciveFax(_[_0x6d07('0x9b')](_0x31384b[_0x6d07('0x5c')],[_0x6d07('0x9c'),_0x6d07('0x9d'),_0x6d07('0x9e'),'updatedAt',_0x6d07('0x9f'),_0x6d07('0xa0')])),{'transaction':_0x1a1309});});});})[_0x6d07('0x21')](function(){return db[_0x6d07('0x40')][_0x6d07('0xa1')](_0x31384b[_0x6d07('0x5c')]['id']);})[_0x6d07('0x21')](respondWithResult(_0x8fdc23,null))[_0x6d07('0x2a')](handleError(_0x8fdc23,null));};exports[_0x6d07('0xa2')]=function(_0x46077c,_0x3c985a,_0xe4172c){var _0x325421={'raw':!![],'where':{}};var _0x5e762e={};var _0x32ee45={'count':0x0,'rows':[]};return db[_0x6d07('0x40')]['findOne']({'where':{'id':_0x46077c['params']['id']}})['then'](handleEntityNotFound(_0x3c985a,null))[_0x6d07('0x21')](function(_0x2aad5d){if(_0x2aad5d){_0x5e762e[_0x6d07('0x43')]=_[_0x6d07('0x45')](db[_0x6d07('0xa3')]['rawAttributes']);_0x5e762e[_0x6d07('0x44')]=_[_0x6d07('0x45')](_0x46077c['query']);_0x5e762e['filters']=_[_0x6d07('0x5a')](_0x5e762e[_0x6d07('0x43')],_0x5e762e[_0x6d07('0x44')]);_0x325421[_0x6d07('0x47')]=_[_0x6d07('0x5a')](_0x5e762e[_0x6d07('0x43')],qs[_0x6d07('0x48')](_0x46077c[_0x6d07('0x44')][_0x6d07('0x48')]));_0x325421['attributes']=_0x325421[_0x6d07('0x47')]['length']?_0x325421['attributes']:_0x5e762e[_0x6d07('0x43')];if(!_0x46077c[_0x6d07('0x44')][_0x6d07('0x4a')]('nolimit')){_0x325421[_0x6d07('0x30')]=qs['limit'](_0x46077c[_0x6d07('0x44')]['limit']);_0x325421[_0x6d07('0x2f')]=qs[_0x6d07('0x2f')](_0x46077c[_0x6d07('0x44')]['offset']);}_0x325421[_0x6d07('0x4c')]=qs[_0x6d07('0x4d')](_0x46077c[_0x6d07('0x44')][_0x6d07('0x4d')]);_0x325421['where']=qs[_0x6d07('0x46')](_[_0x6d07('0x4f')](_0x46077c[_0x6d07('0x44')],_0x5e762e[_0x6d07('0x46')]));_0x325421[_0x6d07('0x4e')][_0x6d07('0x69')]=_0x2aad5d['id'];if(_0x46077c[_0x6d07('0x44')][_0x6d07('0x50')]){_0x325421['where']=_[_0x6d07('0x51')](_0x325421[_0x6d07('0x4e')],{'$or':_[_0x6d07('0x3f')](_0x325421[_0x6d07('0x47')],function(_0x1c336e){var _0x6ddfb5={};_0x6ddfb5[_0x1c336e]={'$like':'%'+_0x46077c['query']['filter']+'%'};return _0x6ddfb5;})});}if(_0x46077c[_0x6d07('0x44')][_0x6d07('0xa4')]){var _0x4c44a8=_0x46077c[_0x6d07('0x44')]['$gte'][_0x6d07('0xa5')](',');var _0x4e2b58={};_0x4e2b58[_0x4c44a8[0x0]]={'$gte':moment(_0x4c44a8[0x1])['format'](_0x6d07('0xa6'))};_0x325421['where']=_[_0x6d07('0x51')](_0x325421[_0x6d07('0x4e')],_0x4e2b58);}_0x325421=_['merge']({},_0x325421,_0x46077c[_0x6d07('0x53')]);return db[_0x6d07('0xa3')][_0x6d07('0x32')]({'where':_0x325421[_0x6d07('0x4e')]})[_0x6d07('0x21')](function(_0x2a815d){_0x32ee45[_0x6d07('0x32')]=_0x2a815d;if(_0x46077c[_0x6d07('0x44')][_0x6d07('0x54')]){_0x325421[_0x6d07('0x5b')]=[{'all':!![]}];}return db[_0x6d07('0xa3')][_0x6d07('0x55')](_0x325421);})[_0x6d07('0x21')](function(_0x5d1daa){_0x32ee45[_0x6d07('0x56')]=_0x5d1daa;return _0x32ee45;});}})['then'](respondWithFilteredResult(_0x3c985a,_0x325421))[_0x6d07('0x2a')](handleError(_0x3c985a,null));};exports[_0x6d07('0x3d')]=function(_0x30f339,_0x1251e2,_0x50a6ef){var _0x16d4f9,_0x34132c={},_0x3d737c;if(_0x30f339[_0x6d07('0x5c')]['to']){_0x3d737c=_0x30f339[_0x6d07('0x5c')]['to'][0x0];}return db[_0x6d07('0x40')][_0x6d07('0x62')]({'where':{'id':_0x30f339['params']['id']},'include':[{'model':db['CmList'],'as':_0x6d07('0xa7'),'include':[{'model':db[_0x6d07('0x75')],'as':_0x6d07('0xa8'),'where':{'fax':_0x3d737c},'limit':0x1,'order':[[_0x6d07('0xa9'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x1251e2,null))[_0x6d07('0x21')](function(_0x2a4cd3){_0x16d4f9=_0x2a4cd3;if(_0x30f339['body']['attachments']&&_0x30f339[_0x6d07('0x5c')]['attachments']['length']){for(var _0x389d97=0x0;_0x389d97<_0x30f339[_0x6d07('0x5c')][_0x6d07('0xaa')][_0x6d07('0x49')];_0x389d97+=0x1){_0x30f339[_0x6d07('0x5c')]['attachments'][_0x389d97]={'filename':_0x30f339['body']['attachments'][_0x389d97][_0x6d07('0x3c')],'id':_0x30f339['body'][_0x6d07('0xaa')][_0x389d97]['id'],'path':path[_0x6d07('0xab')](config['root'],_0x6d07('0xac'),_0x30f339['body'][_0x6d07('0xaa')][_0x389d97][_0x6d07('0xad')])};}}return respondWithRpcPromise('CheckAfterSend','CheckAfterSend',{'FaxAccountId':_[_0x6d07('0xae')](_0x30f339[_0x6d07('0x67')]['id'])?undefined:_0x30f339[_0x6d07('0x67')]['id'],'path':_[_0x6d07('0xae')](_0x30f339[_0x6d07('0x5c')][_0x6d07('0xaa')][0x0][_0x6d07('0x7')])?undefined:_0x30f339[_0x6d07('0x5c')][_0x6d07('0xaa')][0x0][_0x6d07('0x7')],'fax':_[_0x6d07('0xae')](_0x30f339[_0x6d07('0x5c')]['to'][0x0])?undefined:_0x30f339[_0x6d07('0x5c')]['to'][0x0]},client9002);})[_0x6d07('0x21')](function(){if(_0x16d4f9){if(_[_0x6d07('0xae')](_0x30f339[_0x6d07('0x5c')][_0x6d07('0xaf')])){_0x30f339[_0x6d07('0x5c')][_0x6d07('0xaf')]=util[_0x6d07('0xb0')](_0x6d07('0xb1'),_0x16d4f9[_0x6d07('0x3c')],_0x16d4f9[_0x6d07('0xb2')]);}if(_0x16d4f9['List']){if(_0x16d4f9['List']['Contacts'][_0x6d07('0x49')]){return _0x16d4f9[_0x6d07('0xa7')][_0x6d07('0xa8')][0x0];}else{return db['CmContact']['create'](_[_0x6d07('0x1b')](_0x30f339[_0x6d07('0x5c')],{'firstName':_0x30f339[_0x6d07('0x5c')]['to'][0x0],'phone':_0x30f339[_0x6d07('0x5c')]['to'][0x0],'fax':_0x30f339[_0x6d07('0x5c')]['to'][0x0],'ListId':_0x16d4f9[_0x6d07('0xa0')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0x6d07('0xb3'));}})[_0x6d07('0x21')](function(_0x23dfbe){if(_0x23dfbe){return db['FaxInteraction'][_0x6d07('0x62')]({'where':{'ContactId':_0x23dfbe['id'],'closed':![],'FaxAccountId':_0x16d4f9['id']}})[_0x6d07('0x21')](function(_0x1b661e){if(_0x1b661e){return[_0x1b661e,![]];}return db[_0x6d07('0x79')][_0x6d07('0x65')]({'UserId':_0x30f339[_0x6d07('0x5d')]['id'],'ContactId':_0x23dfbe['id'],'FaxAccountId':_0x16d4f9['id'],'fax':_0x30f339['body']['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0x6d07('0x51')](_0x30f339[_0x6d07('0x5c')],{'read':![],'body':_0x30f339[_0x6d07('0x5c')]['attachments'][0x0][_0x6d07('0xb4')],'FaxAccountId':_0x16d4f9['id'],'UserId':_0x30f339[_0x6d07('0x5d')]['id'],'ContactId':_0x23dfbe['id'],'AttachmentId':_0x30f339[_0x6d07('0x5c')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x6d07('0xa3')],'as':_0x6d07('0xb5')}]})[_0x6d07('0x21')](function(_0x4de40f){return[_0x4de40f,!![]];});});}else{throw new Error(_0x6d07('0xb6'));}})[_0x6d07('0xb7')](function(_0x53b779,_0x227e53){if(_0x227e53){return _0x53b779;}return db[_0x6d07('0xa3')][_0x6d07('0x65')]({'direction':_0x6d07('0xb8'),'read':![],'body':_0x30f339['body']['attachments'][0x0][_0x6d07('0xb4')],'FaxAccountId':_0x16d4f9['id'],'FaxInteractionId':_0x53b779['id'],'UserId':_0x30f339['user']['id'],'ContactId':_0x53b779[_0x6d07('0xb9')],'AttachmentId':_0x30f339[_0x6d07('0x5c')]['attachments'][0x0]['id']})[_0x6d07('0x21')](function(_0x5d780d){_0x53b779[_0x6d07('0xba')]['Messages']=[];_0x53b779[_0x6d07('0xba')][_0x6d07('0xb5')]['push'](_0x5d780d[_0x6d07('0xba')]);return _0x53b779;});})[_0x6d07('0x21')](function(_0x1ab855){respondWithRpcPromise(_0x6d07('0xbb'),_0x6d07('0xbb'),{'FaxAccountId':_[_0x6d07('0xae')](_0x30f339[_0x6d07('0x67')]['id'])?undefined:_0x30f339[_0x6d07('0x67')]['id'],'path':_[_0x6d07('0xae')](_0x30f339[_0x6d07('0x5c')][_0x6d07('0xaa')][0x0][_0x6d07('0x7')])?undefined:_0x30f339[_0x6d07('0x5c')][_0x6d07('0xaa')][0x0][_0x6d07('0x7')],'fax':_['isNil'](_0x30f339[_0x6d07('0x5c')]['to'][0x0])?undefined:_0x30f339[_0x6d07('0x5c')]['to'][0x0],'AttachmentId':_0x30f339[_0x6d07('0x5c')][_0x6d07('0xaa')][0x0]['id']},client9002)[_0x6d07('0x21')](function(_0x43c3da){logger[_0x6d07('0xbc')](_0x6d07('0xbd'),_0x43c3da);})[_0x6d07('0x2a')](function(_0x396618){logger[_0x6d07('0xbc')](_0x6d07('0xbd'),_0x396618);});return _0x1ab855;})[_0x6d07('0x21')](respondWithResult(_0x1251e2,null))[_0x6d07('0x2a')](handleError(_0x1251e2,null));};exports[_0x6d07('0xbe')]=function(_0x44a84d,_0x4d5a3e,_0x429e59){return db[_0x6d07('0x40')][_0x6d07('0x62')]({'where':{'id':_0x44a84d[_0x6d07('0x67')]['id']}})[_0x6d07('0x21')](handleEntityNotFound(_0x4d5a3e,null))['then'](function(_0x14bd02){if(_0x14bd02){return _0x14bd02[_0x6d07('0xbe')](_0x44a84d['body']['ids'],_['omit'](_0x44a84d[_0x6d07('0x5c')],['ids','id'])||{})['spread'](function(_0xbe8bb7){for(var _0x106607=0x0;_0x106607<_0x44a84d[_0x6d07('0x5c')][_0x6d07('0x72')][_0x6d07('0x49')];_0x106607+=0x1){socket[_0x6d07('0xbf')](_0x6d07('0xc0'),{'UserId':Number(_0x44a84d[_0x6d07('0x5c')][_0x6d07('0x72')][_0x106607]),'FaxAccountId':Number(_0x44a84d['params']['id'])});}return _0xbe8bb7;});}})[_0x6d07('0x21')](respondWithResult(_0x4d5a3e,null))['catch'](handleError(_0x4d5a3e,null));};exports[_0x6d07('0xc1')]=function(_0x35ec35,_0x858eaf,_0x1e97a8){return db['FaxAccount'][_0x6d07('0x62')]({'where':{'id':_0x35ec35[_0x6d07('0x67')]['id']}})[_0x6d07('0x21')](handleEntityNotFound(_0x858eaf,null))[_0x6d07('0x21')](function(_0x2b05c2){if(_0x2b05c2){return _0x2b05c2[_0x6d07('0xc1')](_0x35ec35[_0x6d07('0x44')][_0x6d07('0x72')])['then'](function(){if(_[_0x6d07('0xc2')](_0x35ec35[_0x6d07('0x44')][_0x6d07('0x72')])){for(var _0x33368b=0x0;_0x33368b<_0x35ec35[_0x6d07('0x44')][_0x6d07('0x72')]['length'];_0x33368b+=0x1){socket['emit'](_0x6d07('0xc3'),{'UserId':Number(_0x35ec35[_0x6d07('0x44')][_0x6d07('0x72')][_0x33368b]),'FaxAccountId':Number(_0x35ec35[_0x6d07('0x67')]['id'])});}}else{socket[_0x6d07('0xbf')](_0x6d07('0xc3'),{'UserId':Number(_0x35ec35[_0x6d07('0x44')][_0x6d07('0x72')]),'FaxAccountId':Number(_0x35ec35['params']['id'])});}});}})[_0x6d07('0x21')](respondWithStatusCode(_0x858eaf,null))[_0x6d07('0x2a')](handleError(_0x858eaf,null));};exports['getAgents']=function(_0x4d3bbe,_0x52047d,_0x20d835){var _0x18dd43={};var _0x53ecf6={};var _0x477119;var _0x39a1fb;return db[_0x6d07('0x40')]['findOne']({'where':{'id':_0x4d3bbe[_0x6d07('0x67')]['id']}})['then'](handleEntityNotFound(_0x52047d,null))[_0x6d07('0x21')](function(_0x21a7e1){if(_0x21a7e1){_0x477119=_0x21a7e1;_0x53ecf6[_0x6d07('0x43')]=_[_0x6d07('0x45')](db[_0x6d07('0xc4')][_0x6d07('0x59')]);_0x53ecf6[_0x6d07('0x44')]=_[_0x6d07('0x45')](_0x4d3bbe[_0x6d07('0x44')]);_0x53ecf6['filters']=_[_0x6d07('0x5a')](_0x53ecf6[_0x6d07('0x43')],_0x53ecf6[_0x6d07('0x44')]);_0x18dd43['attributes']=_[_0x6d07('0x5a')](_0x53ecf6['model'],qs[_0x6d07('0x48')](_0x4d3bbe['query'][_0x6d07('0x48')]));_0x18dd43[_0x6d07('0x47')]=_0x18dd43[_0x6d07('0x47')]['length']?_0x18dd43[_0x6d07('0x47')]:_0x53ecf6[_0x6d07('0x43')];_0x18dd43[_0x6d07('0x4c')]=qs[_0x6d07('0x4d')](_0x4d3bbe['query'][_0x6d07('0x4d')]);_0x18dd43['where']=qs[_0x6d07('0x46')](_[_0x6d07('0x4f')](_0x4d3bbe[_0x6d07('0x44')],_0x53ecf6[_0x6d07('0x46')]));if(_0x4d3bbe[_0x6d07('0x44')][_0x6d07('0x50')]){_0x18dd43[_0x6d07('0x4e')]=_[_0x6d07('0x51')](_0x18dd43['where'],{'$or':_[_0x6d07('0x3f')](_0x18dd43['attributes'],function(_0x64ca62){var _0x29fb31={};_0x29fb31[_0x64ca62]={'$like':'%'+_0x4d3bbe[_0x6d07('0x44')][_0x6d07('0x50')]+'%'};return _0x29fb31;})});}_0x18dd43=_[_0x6d07('0x51')]({},_0x18dd43,_0x4d3bbe[_0x6d07('0x53')]);return _0x477119[_0x6d07('0xc5')](_0x18dd43);}})[_0x6d07('0x21')](function(_0x2e06c1){if(_0x2e06c1){_0x39a1fb=_0x2e06c1[_0x6d07('0x49')];if(!_0x4d3bbe['query'][_0x6d07('0x4a')](_0x6d07('0x4b'))){_0x18dd43[_0x6d07('0x30')]=qs[_0x6d07('0x30')](_0x4d3bbe[_0x6d07('0x44')][_0x6d07('0x30')]);_0x18dd43[_0x6d07('0x2f')]=qs[_0x6d07('0x2f')](_0x4d3bbe['query'][_0x6d07('0x2f')]);}return _0x477119['getAgents'](_0x18dd43);}})[_0x6d07('0x21')](function(_0x206705){if(_0x206705){return _0x206705?{'count':_0x39a1fb,'rows':_0x206705}:null;}})['then'](respondWithResult(_0x52047d,null))[_0x6d07('0x2a')](handleError(_0x52047d,null));}; \ No newline at end of file +var _0xd2bf=['removeAnswers','addInteraction','FaxInteraction','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','stack','finally','getApplications','context','exten','localstationid','priority','appdata','push','CDR(type)=inbound-fax','Set','gateway','faxdetect','headerinfo','modem','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','omit','tech','createdAt','updatedAt','TrunkId','ListId','findById','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','attachments','join','server/files/attachments','basename','CheckAfterSend','isNil','path','from','fax','Send\x20Fax\x20failed','out','Messages','spread','filename','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','socket.io-emitter','./faxAccount.socket','register','jayson/promise','http','client','request','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','get','FaxAccounts','UserProfileResource','name','send','index','mandatoryDispositionPause','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','FaxAccount','includeAll','rows','show','params','Pause','length','include','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','findOne','hasOwnProperty','FaxAccountId','findAll','ids','CannedAnswer','getAnswers'];(function(_0x5ec82b,_0x27298e){var _0x3ae72e=function(_0x381749){while(--_0x381749){_0x5ec82b['push'](_0x5ec82b['shift']());}};_0x3ae72e(++_0x27298e);}(_0xd2bf,0x112));var _0xfd2b=function(_0x2bbc07,_0x1e2168){_0x2bbc07=_0x2bbc07-0x0;var _0x6879e4=_0xd2bf[_0x2bbc07];return _0x6879e4;};'use strict';var emlformat=require(_0xfd2b('0x0'));var rimraf=require(_0xfd2b('0x1'));var zipdir=require(_0xfd2b('0x2'));var jsonpatch=require(_0xfd2b('0x3'));var rp=require(_0xfd2b('0x4'));var moment=require('moment');var BPromise=require(_0xfd2b('0x5'));var Mustache=require(_0xfd2b('0x6'));var util=require('util');var path=require('path');var sox=require(_0xfd2b('0x7'));var csv=require(_0xfd2b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfd2b('0x9'));var _=require(_0xfd2b('0xa'));var squel=require(_0xfd2b('0xb'));var crypto=require(_0xfd2b('0xc'));var jsforce=require(_0xfd2b('0xd'));var deskjs=require(_0xfd2b('0xe'));var toCsv=require(_0xfd2b('0x8'));var querystring=require('querystring');var Papa=require(_0xfd2b('0xf'));var Redis=require('ioredis');var authService=require(_0xfd2b('0x10'));var qs=require(_0xfd2b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfd2b('0x12'));var logger=require(_0xfd2b('0x13'))('api');var utils=require(_0xfd2b('0x14'));var config=require(_0xfd2b('0x15'));var licenseUtil=require(_0xfd2b('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xfd2b('0x17')](config[_0xfd2b('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xfd2b('0x19'))(new Redis(config['redis']));require(_0xfd2b('0x1a'))[_0xfd2b('0x1b')](socket);var jayson=require(_0xfd2b('0x1c'));var client=jayson['client'][_0xfd2b('0x1d')]({'port':0x232c});var client9002=jayson[_0xfd2b('0x1e')][_0xfd2b('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x4afb46,_0x8f551,_0x5d2621,_0x4b7113){return new BPromise(function(_0x1cd580,_0x25ca33){var _0x5c1188=_0x4b7113||client;return _0x5c1188[_0xfd2b('0x1f')](_0x4afb46,_0x5d2621)['then'](function(_0x19eca0){logger[_0xfd2b('0x20')]('FaxAccount,\x20%s,\x20%s',_0x8f551,_0xfd2b('0x21'));logger[_0xfd2b('0x22')](_0xfd2b('0x23'),_0x8f551,_0xfd2b('0x21'),JSON[_0xfd2b('0x24')](_0x19eca0));if(_0x19eca0[_0xfd2b('0x25')]){if(_0x19eca0[_0xfd2b('0x25')][_0xfd2b('0x26')]===0x1f4){logger[_0xfd2b('0x25')](_0xfd2b('0x27'),_0x8f551,_0x19eca0[_0xfd2b('0x25')]['message']);return _0x25ca33(_0x19eca0['error'][_0xfd2b('0x28')]);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x8f551,_0x19eca0[_0xfd2b('0x25')]['message']);return _0x1cd580(_0x19eca0[_0xfd2b('0x25')][_0xfd2b('0x28')]);}else{logger[_0xfd2b('0x20')](_0xfd2b('0x27'),_0x8f551,'request\x20sent');_0x1cd580(_0x19eca0[_0xfd2b('0x29')][_0xfd2b('0x28')]);}})['catch'](function(_0x5302e4){logger[_0xfd2b('0x25')]('FaxAccount,\x20%s,\x20%s',_0x8f551,_0x5302e4);_0x25ca33(_0x5302e4);});});}function respondWithStatusCode(_0x556780,_0x3ce2fe){_0x3ce2fe=_0x3ce2fe||0xcc;return function(_0x480acd){if(_0x480acd){return _0x556780[_0xfd2b('0x2a')](_0x3ce2fe);}return _0x556780[_0xfd2b('0x2b')](_0x3ce2fe)[_0xfd2b('0x2c')]();};}function respondWithResult(_0x1200c7,_0x588fd6){_0x588fd6=_0x588fd6||0xc8;return function(_0x404013){if(_0x404013){return _0x1200c7[_0xfd2b('0x2b')](_0x588fd6)[_0xfd2b('0x2d')](_0x404013);}};}function respondWithFilteredResult(_0x3b8e3e,_0x223d89){return function(_0x30b8e6){if(_0x30b8e6){var _0x3e57dd=typeof _0x223d89[_0xfd2b('0x2e')]===_0xfd2b('0x2f')&&typeof _0x223d89[_0xfd2b('0x30')]==='undefined';var _0x5b24e8=_0x30b8e6['count'];var _0x165a0b=_0x3e57dd?0x0:_0x223d89[_0xfd2b('0x2e')];var _0x39af72=_0x3e57dd?_0x30b8e6[_0xfd2b('0x31')]:_0x223d89['offset']+_0x223d89['limit'];var _0xeeced0;if(_0x39af72>=_0x5b24e8){_0x39af72=_0x5b24e8;_0xeeced0=0xc8;}else{_0xeeced0=0xce;}_0x3b8e3e[_0xfd2b('0x2b')](_0xeeced0);return _0x3b8e3e['set'](_0xfd2b('0x32'),_0x165a0b+'-'+_0x39af72+'/'+_0x5b24e8)[_0xfd2b('0x2d')](_0x30b8e6);}return null;};}function patchUpdates(_0x284ab1){return function(_0x5f49cd){try{jsonpatch['apply'](_0x5f49cd,_0x284ab1,!![]);}catch(_0x6cefaf){return BPromise[_0xfd2b('0x33')](_0x6cefaf);}return _0x5f49cd[_0xfd2b('0x34')]();};}function saveUpdates(_0x189056,_0x325018){return function(_0x4d0baa){if(_0x4d0baa){return _0x4d0baa[_0xfd2b('0x35')](_0x189056)[_0xfd2b('0x36')](function(_0x2161e6){return _0x2161e6;});}return null;};}function removeEntity(_0xcd2941,_0x44de0b){return function(_0x41a98b){if(_0x41a98b){return _0x41a98b[_0xfd2b('0x37')]()['then'](function(){var _0x50e95a=_0x41a98b[_0xfd2b('0x38')]({'plain':!![]});var _0x1de939=_0xfd2b('0x39');return db[_0xfd2b('0x3a')][_0xfd2b('0x37')]({'where':{'type':_0x1de939,'resourceId':_0x50e95a['id']}})[_0xfd2b('0x36')](function(){return _0x41a98b;});})[_0xfd2b('0x36')](function(){_0xcd2941['status'](0xcc)[_0xfd2b('0x2c')]();});}};}function handleEntityNotFound(_0xeed19d,_0x569799){return function(_0x11eba5){if(!_0x11eba5){_0xeed19d[_0xfd2b('0x2a')](0x194);}return _0x11eba5;};}function handleError(_0x1ba31c,_0x58e813){_0x58e813=_0x58e813||0x1f4;return function(_0x235c0f){logger[_0xfd2b('0x25')](_0x235c0f['stack']);if(_0x235c0f[_0xfd2b('0x3b')]){delete _0x235c0f[_0xfd2b('0x3b')];}_0x1ba31c[_0xfd2b('0x2b')](_0x58e813)[_0xfd2b('0x3c')](_0x235c0f);};}exports[_0xfd2b('0x3d')]=function(_0x4b8797,_0x38bbdc){var _0x416c1f={'include':[{'model':db['Pause'],'as':_0xfd2b('0x3e')}]},_0x5c902d={},_0x580d7a={'count':0x0,'rows':[]};var _0x1b1242=_['map'](db['FaxAccount'][_0xfd2b('0x3f')],function(_0x57563f){return{'name':_0x57563f[_0xfd2b('0x40')],'type':_0x57563f['type'][_0xfd2b('0x41')]};});_0x5c902d[_0xfd2b('0x42')]=_['map'](_0x1b1242,_0xfd2b('0x3b'));_0x5c902d[_0xfd2b('0x43')]=_[_0xfd2b('0x44')](_0x4b8797[_0xfd2b('0x43')]);_0x5c902d[_0xfd2b('0x45')]=_[_0xfd2b('0x46')](_0x5c902d[_0xfd2b('0x42')],_0x5c902d[_0xfd2b('0x43')]);_0x416c1f[_0xfd2b('0x47')]=_[_0xfd2b('0x46')](_0x5c902d[_0xfd2b('0x42')],qs[_0xfd2b('0x48')](_0x4b8797['query'][_0xfd2b('0x48')]));_0x416c1f[_0xfd2b('0x47')]=_0x416c1f[_0xfd2b('0x47')]['length']?_0x416c1f['attributes']:_0x5c902d[_0xfd2b('0x42')];if(!_0x4b8797[_0xfd2b('0x43')]['hasOwnProperty'](_0xfd2b('0x49'))){_0x416c1f[_0xfd2b('0x30')]=qs[_0xfd2b('0x30')](_0x4b8797[_0xfd2b('0x43')]['limit']);_0x416c1f[_0xfd2b('0x2e')]=qs['offset'](_0x4b8797[_0xfd2b('0x43')]['offset']);}_0x416c1f[_0xfd2b('0x4a')]=qs[_0xfd2b('0x4b')](_0x4b8797[_0xfd2b('0x43')][_0xfd2b('0x4b')]);_0x416c1f[_0xfd2b('0x4c')]=qs[_0xfd2b('0x45')](_[_0xfd2b('0x4d')](_0x4b8797[_0xfd2b('0x43')],_0x5c902d[_0xfd2b('0x45')]),_0x1b1242);if(_0x4b8797[_0xfd2b('0x43')][_0xfd2b('0x4e')]){_0x416c1f['where']=_[_0xfd2b('0x4f')](_0x416c1f[_0xfd2b('0x4c')],{'$or':_[_0xfd2b('0x50')](_0x1b1242,function(_0x283f6d){if(_0x283f6d['type']!==_0xfd2b('0x51')){var _0x2a65c5={};_0x2a65c5[_0x283f6d[_0xfd2b('0x3b')]]={'$like':'%'+_0x4b8797[_0xfd2b('0x43')]['filter']+'%'};return _0x2a65c5;}})});}_0x416c1f=_[_0xfd2b('0x4f')]({},_0x416c1f,_0x4b8797[_0xfd2b('0x52')]);var _0x21bf3b={'where':_0x416c1f['where']};return db[_0xfd2b('0x53')][_0xfd2b('0x31')](_0x21bf3b)[_0xfd2b('0x36')](function(_0x7fed13){_0x580d7a[_0xfd2b('0x31')]=_0x7fed13;if(_0x4b8797[_0xfd2b('0x43')][_0xfd2b('0x54')]){_0x416c1f['include']=[{'all':!![]}];}return db[_0xfd2b('0x53')]['findAll'](_0x416c1f);})[_0xfd2b('0x36')](function(_0x157bc7){_0x580d7a[_0xfd2b('0x55')]=_0x157bc7;return _0x580d7a;})[_0xfd2b('0x36')](respondWithFilteredResult(_0x38bbdc,_0x416c1f))['catch'](handleError(_0x38bbdc,null));};exports[_0xfd2b('0x56')]=function(_0x29dfc2,_0x3e4bd4){var _0x4962b6={'raw':![],'where':{'id':_0x29dfc2[_0xfd2b('0x57')]['id']},'include':[{'model':db[_0xfd2b('0x58')],'as':_0xfd2b('0x3e')}]},_0x158127={};_0x158127[_0xfd2b('0x42')]=_[_0xfd2b('0x44')](db[_0xfd2b('0x53')][_0xfd2b('0x3f')]);_0x158127[_0xfd2b('0x43')]=_[_0xfd2b('0x44')](_0x29dfc2[_0xfd2b('0x43')]);_0x158127['filters']=_['intersection'](_0x158127[_0xfd2b('0x42')],_0x158127['query']);_0x4962b6['attributes']=_[_0xfd2b('0x46')](_0x158127[_0xfd2b('0x42')],qs['fields'](_0x29dfc2[_0xfd2b('0x43')][_0xfd2b('0x48')]));_0x4962b6[_0xfd2b('0x47')]=_0x4962b6['attributes'][_0xfd2b('0x59')]?_0x4962b6[_0xfd2b('0x47')]:_0x158127['model'];if(_0x29dfc2['query']['includeAll']){_0x4962b6[_0xfd2b('0x5a')]=[{'all':!![]}];}_0x4962b6=_[_0xfd2b('0x4f')]({},_0x4962b6,_0x29dfc2[_0xfd2b('0x52')]);return db[_0xfd2b('0x53')]['find'](_0x4962b6)[_0xfd2b('0x36')](handleEntityNotFound(_0x3e4bd4,null))[_0xfd2b('0x36')](respondWithResult(_0x3e4bd4,null))[_0xfd2b('0x5b')](handleError(_0x3e4bd4,null));};exports[_0xfd2b('0x5c')]=function(_0x58555f,_0x18f6bc){return db[_0xfd2b('0x53')][_0xfd2b('0x5c')](_0x58555f[_0xfd2b('0x5d')],{})[_0xfd2b('0x36')](function(_0x386ed9){var _0xb487b4=_0x58555f[_0xfd2b('0x5e')][_0xfd2b('0x38')]({'plain':!![]});if(!_0xb487b4)throw new Error(_0xfd2b('0x5f'));if(_0xb487b4[_0xfd2b('0x60')]==='user'){var _0x5aa528=_0x386ed9[_0xfd2b('0x38')]({'plain':!![]});var _0x5eaaa2=_0xfd2b('0x39');return db[_0xfd2b('0x61')][_0xfd2b('0x62')]({'where':{'name':_0x5eaaa2,'userProfileId':_0xb487b4['userProfileId']},'raw':!![]})['then'](function(_0xe0c630){if(_0xe0c630&&_0xe0c630[_0xfd2b('0x63')]===0x0){return db['UserProfileResource'][_0xfd2b('0x5c')]({'name':_0x5aa528[_0xfd2b('0x3b')],'resourceId':_0x5aa528['id'],'type':_0xe0c630[_0xfd2b('0x3b')],'sectionId':_0xe0c630['id']},{})['then'](function(){return _0x386ed9;});}else{return _0x386ed9;}})[_0xfd2b('0x5b')](function(_0x3f8e2c){logger['error'](_0xfd2b('0x64'),_0x3f8e2c);throw _0x3f8e2c;});}return _0x386ed9;})[_0xfd2b('0x36')](respondWithResult(_0x18f6bc,0xc9))[_0xfd2b('0x5b')](handleError(_0x18f6bc,null));};exports[_0xfd2b('0x35')]=function(_0x19fa0a,_0x5499f1){if(_0x19fa0a['body']['id']){delete _0x19fa0a[_0xfd2b('0x5d')]['id'];}return db[_0xfd2b('0x53')][_0xfd2b('0x62')]({'where':{'id':_0x19fa0a[_0xfd2b('0x57')]['id']},'include':[{'model':db[_0xfd2b('0x58')],'as':_0xfd2b('0x3e')}]})['then'](handleEntityNotFound(_0x5499f1,null))[_0xfd2b('0x36')](saveUpdates(_0x19fa0a['body'],null))[_0xfd2b('0x36')](respondWithResult(_0x5499f1,null))['catch'](handleError(_0x5499f1,null));};exports['destroy']=function(_0x264d58,_0x31d7a0){return db[_0xfd2b('0x53')]['find']({'where':{'id':_0x264d58[_0xfd2b('0x57')]['id']}})['then'](handleEntityNotFound(_0x31d7a0,null))[_0xfd2b('0x36')](removeEntity(_0x31d7a0,null))[_0xfd2b('0x5b')](handleError(_0x31d7a0,null));};exports[_0xfd2b('0x65')]=function(_0x551163,_0x35abc3){return db[_0xfd2b('0x53')]['describe']()[_0xfd2b('0x36')](respondWithResult(_0x35abc3,null))[_0xfd2b('0x5b')](handleError(_0x35abc3,null));};exports[_0xfd2b('0x66')]=function(_0x55b515,_0x44bf93,_0x4f8f09){if(_0x55b515[_0xfd2b('0x5d')]['id']){delete _0x55b515['body']['id'];}return db[_0xfd2b('0x53')][_0xfd2b('0x62')]({'where':{'id':_0x55b515[_0xfd2b('0x57')]['id']}})['then'](handleEntityNotFound(_0x44bf93,null))['then'](function(_0x520951){if(_0x520951){_0x55b515[_0xfd2b('0x5d')]['FaxAccountId']=_0x520951['id'];return db[_0xfd2b('0x67')][_0xfd2b('0x5c')](_0x55b515['body']);}})['then'](respondWithResult(_0x44bf93,null))['catch'](handleError(_0x44bf93,null));};exports[_0xfd2b('0x68')]=function(_0x27a867,_0x25a911,_0x74d145){var _0x4a70df={'raw':![],'where':{}};var _0x56aa82={};var _0xa47be={'count':0x0,'rows':[]};return db[_0xfd2b('0x53')][_0xfd2b('0x69')]({'where':{'id':_0x27a867[_0xfd2b('0x57')]['id']}})['then'](handleEntityNotFound(_0x25a911,null))[_0xfd2b('0x36')](function(_0x4a470e){if(_0x4a470e){_0x56aa82[_0xfd2b('0x42')]=_[_0xfd2b('0x44')](db[_0xfd2b('0x67')][_0xfd2b('0x3f')]);_0x56aa82[_0xfd2b('0x43')]=_[_0xfd2b('0x44')](_0x27a867[_0xfd2b('0x43')]);_0x56aa82[_0xfd2b('0x45')]=_['intersection'](_0x56aa82['model'],_0x56aa82[_0xfd2b('0x43')]);_0x4a70df[_0xfd2b('0x47')]=_[_0xfd2b('0x46')](_0x56aa82[_0xfd2b('0x42')],qs[_0xfd2b('0x48')](_0x27a867[_0xfd2b('0x43')][_0xfd2b('0x48')]));_0x4a70df['attributes']=_0x4a70df[_0xfd2b('0x47')][_0xfd2b('0x59')]?_0x4a70df[_0xfd2b('0x47')]:_0x56aa82['model'];if(!_0x27a867[_0xfd2b('0x43')][_0xfd2b('0x6a')]('nolimit')){_0x4a70df[_0xfd2b('0x30')]=qs[_0xfd2b('0x30')](_0x27a867[_0xfd2b('0x43')][_0xfd2b('0x30')]);_0x4a70df[_0xfd2b('0x2e')]=qs['offset'](_0x27a867[_0xfd2b('0x43')][_0xfd2b('0x2e')]);}_0x4a70df[_0xfd2b('0x4a')]=qs[_0xfd2b('0x4b')](_0x27a867[_0xfd2b('0x43')][_0xfd2b('0x4b')]);_0x4a70df[_0xfd2b('0x4c')]=qs[_0xfd2b('0x45')](_[_0xfd2b('0x4d')](_0x27a867[_0xfd2b('0x43')],_0x56aa82[_0xfd2b('0x45')]));_0x4a70df['where'][_0xfd2b('0x6b')]=_0x4a470e['id'];if(_0x27a867[_0xfd2b('0x43')][_0xfd2b('0x4e')]){_0x4a70df[_0xfd2b('0x4c')]=_[_0xfd2b('0x4f')](_0x4a70df[_0xfd2b('0x4c')],{'$or':_[_0xfd2b('0x50')](_0x4a70df[_0xfd2b('0x47')],function(_0x57c0c5){var _0x23b387={};_0x23b387[_0x57c0c5]={'$like':'%'+_0x27a867['query'][_0xfd2b('0x4e')]+'%'};return _0x23b387;})});}_0x4a70df=_[_0xfd2b('0x4f')]({},_0x4a70df,_0x27a867[_0xfd2b('0x52')]);return db[_0xfd2b('0x67')][_0xfd2b('0x31')]({'where':_0x4a70df[_0xfd2b('0x4c')]})[_0xfd2b('0x36')](function(_0xbfd8cc){_0xa47be[_0xfd2b('0x31')]=_0xbfd8cc;if(_0x27a867[_0xfd2b('0x43')][_0xfd2b('0x54')]){_0x4a70df[_0xfd2b('0x5a')]=[{'all':!![]}];}return db[_0xfd2b('0x67')][_0xfd2b('0x6c')](_0x4a70df);})[_0xfd2b('0x36')](function(_0x4764d3){_0xa47be[_0xfd2b('0x55')]=_0x4764d3;return _0xa47be;});}})[_0xfd2b('0x36')](respondWithFilteredResult(_0x25a911,_0x4a70df))[_0xfd2b('0x5b')](handleError(_0x25a911,null));};exports['removeDispositions']=function(_0x485a94,_0x355202,_0x557445){return db[_0xfd2b('0x53')]['find']({'where':{'id':_0x485a94[_0xfd2b('0x57')]['id']}})['then'](handleEntityNotFound(_0x355202,null))[_0xfd2b('0x36')](function(_0x4cd396){if(_0x4cd396){return _0x4cd396['removeDispositions'](_0x485a94[_0xfd2b('0x43')][_0xfd2b('0x6d')]);}})['then'](respondWithStatusCode(_0x355202,null))[_0xfd2b('0x5b')](handleError(_0x355202,null));};exports['addAnswer']=function(_0x28e68d,_0x49c423,_0x2f0993){if(_0x28e68d[_0xfd2b('0x5d')]['id']){delete _0x28e68d[_0xfd2b('0x5d')]['id'];}return db['FaxAccount'][_0xfd2b('0x62')]({'where':{'id':_0x28e68d[_0xfd2b('0x57')]['id']}})[_0xfd2b('0x36')](handleEntityNotFound(_0x49c423,null))[_0xfd2b('0x36')](function(_0xd79bd){if(_0xd79bd){_0x28e68d['body']['FaxAccountId']=_0xd79bd['id'];return db[_0xfd2b('0x6e')][_0xfd2b('0x5c')](_0x28e68d[_0xfd2b('0x5d')]);}})[_0xfd2b('0x36')](respondWithResult(_0x49c423,null))[_0xfd2b('0x5b')](handleError(_0x49c423,null));};exports[_0xfd2b('0x6f')]=function(_0x4c2b52,_0x14f867,_0x36b059){var _0x2045b5={'raw':![],'where':{}};var _0x580489={};var _0x21152e={'count':0x0,'rows':[]};return db[_0xfd2b('0x53')][_0xfd2b('0x69')]({'where':{'id':_0x4c2b52[_0xfd2b('0x57')]['id']}})[_0xfd2b('0x36')](handleEntityNotFound(_0x14f867,null))[_0xfd2b('0x36')](function(_0x96bd7){if(_0x96bd7){_0x580489[_0xfd2b('0x42')]=_[_0xfd2b('0x44')](db[_0xfd2b('0x6e')][_0xfd2b('0x3f')]);_0x580489[_0xfd2b('0x43')]=_['keys'](_0x4c2b52[_0xfd2b('0x43')]);_0x580489[_0xfd2b('0x45')]=_[_0xfd2b('0x46')](_0x580489[_0xfd2b('0x42')],_0x580489[_0xfd2b('0x43')]);_0x2045b5['attributes']=_[_0xfd2b('0x46')](_0x580489[_0xfd2b('0x42')],qs[_0xfd2b('0x48')](_0x4c2b52[_0xfd2b('0x43')][_0xfd2b('0x48')]));_0x2045b5[_0xfd2b('0x47')]=_0x2045b5[_0xfd2b('0x47')][_0xfd2b('0x59')]?_0x2045b5[_0xfd2b('0x47')]:_0x580489[_0xfd2b('0x42')];if(!_0x4c2b52[_0xfd2b('0x43')][_0xfd2b('0x6a')]('nolimit')){_0x2045b5[_0xfd2b('0x30')]=qs[_0xfd2b('0x30')](_0x4c2b52[_0xfd2b('0x43')][_0xfd2b('0x30')]);_0x2045b5[_0xfd2b('0x2e')]=qs[_0xfd2b('0x2e')](_0x4c2b52[_0xfd2b('0x43')]['offset']);}_0x2045b5['order']=qs['sort'](_0x4c2b52[_0xfd2b('0x43')][_0xfd2b('0x4b')]);_0x2045b5[_0xfd2b('0x4c')]=qs[_0xfd2b('0x45')](_[_0xfd2b('0x4d')](_0x4c2b52[_0xfd2b('0x43')],_0x580489[_0xfd2b('0x45')]));_0x2045b5[_0xfd2b('0x4c')][_0xfd2b('0x6b')]=_0x96bd7['id'];if(_0x4c2b52['query'][_0xfd2b('0x4e')]){_0x2045b5[_0xfd2b('0x4c')]=_[_0xfd2b('0x4f')](_0x2045b5['where'],{'$or':_['map'](_0x2045b5[_0xfd2b('0x47')],function(_0x119f7c){var _0xc1834b={};_0xc1834b[_0x119f7c]={'$like':'%'+_0x4c2b52[_0xfd2b('0x43')][_0xfd2b('0x4e')]+'%'};return _0xc1834b;})});}_0x2045b5=_[_0xfd2b('0x4f')]({},_0x2045b5,_0x4c2b52['options']);return db[_0xfd2b('0x6e')][_0xfd2b('0x31')]({'where':_0x2045b5[_0xfd2b('0x4c')]})[_0xfd2b('0x36')](function(_0x54662c){_0x21152e[_0xfd2b('0x31')]=_0x54662c;if(_0x4c2b52[_0xfd2b('0x43')][_0xfd2b('0x54')]){_0x2045b5['include']=[{'all':!![]}];}return db[_0xfd2b('0x6e')]['findAll'](_0x2045b5);})['then'](function(_0x5cfde3){_0x21152e[_0xfd2b('0x55')]=_0x5cfde3;return _0x21152e;});}})['then'](respondWithFilteredResult(_0x14f867,_0x2045b5))[_0xfd2b('0x5b')](handleError(_0x14f867,null));};exports[_0xfd2b('0x70')]=function(_0x4c55f3,_0x47c694,_0x5de472){return db[_0xfd2b('0x53')]['find']({'where':{'id':_0x4c55f3[_0xfd2b('0x57')]['id']}})[_0xfd2b('0x36')](handleEntityNotFound(_0x47c694,null))['then'](function(_0x202cce){if(_0x202cce){return _0x202cce[_0xfd2b('0x70')](_0x4c55f3[_0xfd2b('0x43')][_0xfd2b('0x6d')]);}})[_0xfd2b('0x36')](respondWithStatusCode(_0x47c694,null))[_0xfd2b('0x5b')](handleError(_0x47c694,null));};exports[_0xfd2b('0x71')]=function(_0x5f1071,_0x305e9f,_0x53d467){return db[_0xfd2b('0x72')][_0xfd2b('0x62')]({'where':{'id':_0x5f1071[_0xfd2b('0x57')]['id']}})[_0xfd2b('0x36')](handleEntityNotFound(_0x305e9f,null))['then'](function(_0x4c507c){if(_0x4c507c){return _0x4c507c['addInteraction'](_0x5f1071[_0xfd2b('0x5d')][_0xfd2b('0x6d')],_['omit'](_0x5f1071[_0xfd2b('0x5d')],['ids','id'])||{});}})[_0xfd2b('0x36')](respondWithResult(_0x305e9f,null))[_0xfd2b('0x5b')](handleError(_0x305e9f,null));};exports['getInteractions']=function(_0x1d7f6b,_0x30ac90,_0x54d85f){var _0x49d369={'raw':![],'where':{}};var _0x511fed={};var _0x51ef98={'count':0x0,'rows':[]};return db[_0xfd2b('0x53')][_0xfd2b('0x69')]({'where':{'id':_0x1d7f6b[_0xfd2b('0x57')]['id']}})[_0xfd2b('0x36')](handleEntityNotFound(_0x30ac90,null))['then'](function(_0x396f4d){if(_0x396f4d){_0x511fed[_0xfd2b('0x42')]=_[_0xfd2b('0x44')](db[_0xfd2b('0x72')]['rawAttributes']);_0x511fed[_0xfd2b('0x43')]=_[_0xfd2b('0x44')](_0x1d7f6b[_0xfd2b('0x43')]);_0x511fed[_0xfd2b('0x45')]=_[_0xfd2b('0x46')](_0x511fed[_0xfd2b('0x42')],_0x511fed[_0xfd2b('0x43')]);_0x49d369[_0xfd2b('0x47')]=_[_0xfd2b('0x46')](_0x511fed[_0xfd2b('0x42')],qs[_0xfd2b('0x48')](_0x1d7f6b['query'][_0xfd2b('0x48')]));_0x49d369['attributes']=_0x49d369[_0xfd2b('0x47')]['length']?_0x49d369[_0xfd2b('0x47')]:_0x511fed[_0xfd2b('0x42')];if(!_0x1d7f6b[_0xfd2b('0x43')][_0xfd2b('0x6a')]('nolimit')){_0x49d369[_0xfd2b('0x30')]=qs[_0xfd2b('0x30')](_0x1d7f6b[_0xfd2b('0x43')][_0xfd2b('0x30')]);_0x49d369[_0xfd2b('0x2e')]=qs[_0xfd2b('0x2e')](_0x1d7f6b[_0xfd2b('0x43')][_0xfd2b('0x2e')]);}_0x49d369[_0xfd2b('0x4a')]=qs['sort'](_0x1d7f6b[_0xfd2b('0x43')]['sort']);_0x49d369[_0xfd2b('0x4c')]=qs[_0xfd2b('0x45')](_['pick'](_0x1d7f6b[_0xfd2b('0x43')],_0x511fed['filters']));_0x49d369[_0xfd2b('0x4c')]['FaxAccountId']=_0x396f4d['id'];if(_0x1d7f6b[_0xfd2b('0x43')][_0xfd2b('0x4e')]){_0x49d369[_0xfd2b('0x4c')]=_[_0xfd2b('0x4f')](_0x49d369[_0xfd2b('0x4c')],{'$or':_[_0xfd2b('0x50')](_0x49d369[_0xfd2b('0x47')],function(_0x4fb364){var _0x14bb3e={};_0x14bb3e[_0x4fb364]={'$like':'%'+_0x1d7f6b[_0xfd2b('0x43')]['filter']+'%'};return _0x14bb3e;})});}_0x49d369=_['merge']({},_0x49d369,_0x1d7f6b[_0xfd2b('0x52')]);return db[_0xfd2b('0x72')][_0xfd2b('0x31')]({'where':_0x49d369['where']})[_0xfd2b('0x36')](function(_0x234549){_0x51ef98[_0xfd2b('0x31')]=_0x234549;if(_0x1d7f6b['query'][_0xfd2b('0x54')]){_0x49d369['include']=[{'model':db[_0xfd2b('0x73')],'as':_0xfd2b('0x74'),'required':![]},{'model':db[_0xfd2b('0x75')],'as':_0xfd2b('0x76'),'attributes':['name',_0xfd2b('0x77'),_0xfd2b('0x78')],'required':![]},{'model':db[_0xfd2b('0x79')],'as':_0xfd2b('0x7a'),'attributes':['id',_0xfd2b('0x3b'),_0xfd2b('0x7b')],'where':_0x1d7f6b['query'][_0xfd2b('0x7c')]?{'id':_0x1d7f6b['query'][_0xfd2b('0x7c')]}:undefined,'required':_0x1d7f6b[_0xfd2b('0x43')]['tag']?!![]:![]}];}return db[_0xfd2b('0x72')][_0xfd2b('0x6c')](_0x49d369);})[_0xfd2b('0x36')](function(_0x16c275){_0x51ef98[_0xfd2b('0x55')]=_0x16c275;return _0x51ef98;});}})[_0xfd2b('0x36')](respondWithFilteredResult(_0x30ac90,_0x49d369))[_0xfd2b('0x5b')](handleError(_0x30ac90,null));};exports[_0xfd2b('0x7d')]=function(_0x2b672e,_0x198ad5){var _0x23b3fa=_0x2b672e[_0xfd2b('0x57')]['id'];var _0x54da2f=_0x2b672e['body'];var _0x583b73=0xc8;var _0x20378c=null;return db[_0xfd2b('0x7e')][_0xfd2b('0x7f')]({'isolationLevel':db['sequelize'][_0xfd2b('0x80')]['ISOLATION_LEVELS'][_0xfd2b('0x81')]},function(_0x5863b8){return db[_0xfd2b('0x53')][_0xfd2b('0x69')]({'where':{'id':_0x23b3fa},'transaction':_0x5863b8})[_0xfd2b('0x36')](function(_0xaac154){if(_0xaac154){return db[_0xfd2b('0x82')][_0xfd2b('0x37')]({'where':{'FaxAccountId':_0x23b3fa},'transaction':_0x5863b8})[_0xfd2b('0x36')](function(){var _0x25d66c=_[_0xfd2b('0x50')](_0x54da2f,function(_0x548a96){_0x548a96['FaxAccountId']=_0x23b3fa;return _0x548a96;});return db['FaxApplication'][_0xfd2b('0x83')](_0x25d66c,{'transaction':_0x5863b8});});}else{_0x583b73=0x194;_0x20378c=[];}});})[_0xfd2b('0x36')](function(){if(_0x583b73!==0x194){return db[_0xfd2b('0x82')][_0xfd2b('0x84')]({'where':{'FaxAccountId':_0x23b3fa},'order':'priority'})['then'](function(_0x4ecdaf){_0x20378c=_0x4ecdaf;});}})[_0xfd2b('0x5b')](function(_0x1d5e3e){_0x583b73=0x1f4;logger[_0xfd2b('0x25')](_0x1d5e3e[_0xfd2b('0x85')]);if(_0x1d5e3e['name']){delete _0x1d5e3e[_0xfd2b('0x3b')];}_0x20378c=_0x1d5e3e;})[_0xfd2b('0x86')](function(){if(_0x20378c===null){_0x198ad5[_0xfd2b('0x2a')](_0x583b73);}else{if(_0x583b73===0x1f4){_0x198ad5[_0xfd2b('0x2b')](_0x583b73)[_0xfd2b('0x3c')](_0x20378c);}else{_0x198ad5[_0xfd2b('0x2b')](_0x583b73)[_0xfd2b('0x2d')](_0x20378c);}}});};exports[_0xfd2b('0x87')]=function(_0x41b208,_0x41c069,_0x287fb6){var _0x4c0b94={};var _0x1f0291={};var _0x3ebd66;var _0x3d634a;return db[_0xfd2b('0x53')][_0xfd2b('0x69')]({'where':{'id':_0x41b208[_0xfd2b('0x57')]['id']}})[_0xfd2b('0x36')](handleEntityNotFound(_0x41c069,null))[_0xfd2b('0x36')](function(_0x4f5cf2){if(_0x4f5cf2){_0x3ebd66=_0x4f5cf2;_0x1f0291[_0xfd2b('0x42')]=_[_0xfd2b('0x44')](db[_0xfd2b('0x82')]['rawAttributes']);_0x1f0291[_0xfd2b('0x43')]=_['keys'](_0x41b208[_0xfd2b('0x43')]);_0x1f0291[_0xfd2b('0x45')]=_[_0xfd2b('0x46')](_0x1f0291[_0xfd2b('0x42')],_0x1f0291[_0xfd2b('0x43')]);_0x4c0b94[_0xfd2b('0x47')]=_[_0xfd2b('0x46')](_0x1f0291['model'],qs[_0xfd2b('0x48')](_0x41b208['query']['fields']));_0x4c0b94[_0xfd2b('0x47')]=_0x4c0b94[_0xfd2b('0x47')]['length']?_0x4c0b94['attributes']:_0x1f0291[_0xfd2b('0x42')];_0x4c0b94['order']=qs[_0xfd2b('0x4b')](_0x41b208[_0xfd2b('0x43')][_0xfd2b('0x4b')]);_0x4c0b94[_0xfd2b('0x4c')]=qs[_0xfd2b('0x45')](_['pick'](_0x41b208['query'],_0x1f0291[_0xfd2b('0x45')]));if(_0x41b208[_0xfd2b('0x43')][_0xfd2b('0x4e')]){_0x4c0b94[_0xfd2b('0x4c')]=_[_0xfd2b('0x4f')](_0x4c0b94['where'],{'$or':_[_0xfd2b('0x50')](_0x4c0b94['attributes'],function(_0x4be42a){var _0x9109b7={};_0x9109b7[_0x4be42a]={'$like':'%'+_0x41b208[_0xfd2b('0x43')][_0xfd2b('0x4e')]+'%'};return _0x9109b7;})});}_0x4c0b94=_['merge']({},_0x4c0b94,_0x41b208[_0xfd2b('0x52')]);return _0x3ebd66['getApplications'](_0x4c0b94);}})['then'](function(_0x233169){if(_0x233169){_0x3d634a=_0x233169[_0xfd2b('0x59')];if(!_0x41b208[_0xfd2b('0x43')][_0xfd2b('0x6a')](_0xfd2b('0x49'))){_0x4c0b94[_0xfd2b('0x30')]=qs['limit'](_0x41b208[_0xfd2b('0x43')][_0xfd2b('0x30')]);_0x4c0b94[_0xfd2b('0x2e')]=qs[_0xfd2b('0x2e')](_0x41b208[_0xfd2b('0x43')][_0xfd2b('0x2e')]);}return _0x3ebd66['getApplications'](_0x4c0b94);}})[_0xfd2b('0x36')](function(_0x2a982f){if(_0x2a982f){return _0x2a982f?{'count':_0x3d634a,'rows':_0x2a982f}:null;}})[_0xfd2b('0x36')](respondWithResult(_0x41c069,null))[_0xfd2b('0x5b')](handleError(_0x41c069,null));};function Extension(_0x5b75b6,_0xf2a81d,_0xb290a7,_0x2786c4){this[_0xfd2b('0x88')]='from-voip-provider';this[_0xfd2b('0x89')]=_0x5b75b6[_0xfd2b('0x8a')];this['app']=_0x2786c4;this['type']='system';this['description']='Fax\x20Extension';this['FaxAccountId']=_0x5b75b6['id'];this[_0xfd2b('0x8b')]=_0xf2a81d;this[_0xfd2b('0x8c')]=_0xb290a7;}function createExtensionsReciveFax(_0x292101){var _0x44df46=0x1;var _0x53fa31=[];_0x53fa31[_0xfd2b('0x8d')](new Extension(_0x292101,_0x44df46,'','Answer'));_0x44df46+=0x1;_0x53fa31[_0xfd2b('0x8d')](new Extension(_0x292101,_0x44df46,_0xfd2b('0x8e'),_0xfd2b('0x8f')));_0x44df46+=0x1;for(var _0x47dfb5 in _0x292101){if(_0x292101['hasOwnProperty'](_0x47dfb5)&&(_0x47dfb5==='ecm'||_0x47dfb5===_0xfd2b('0x8a')||_0x47dfb5===_0xfd2b('0x90')||_0x47dfb5===_0xfd2b('0x91')||_0x47dfb5===_0xfd2b('0x92')||_0x47dfb5==='maxrate'||_0x47dfb5==='minrate'||_0x47dfb5===_0xfd2b('0x93')||_0x47dfb5==='t38timeout')){_0x53fa31[_0xfd2b('0x8d')](new Extension(_0x292101,_0x44df46,_0xfd2b('0x94')+_0x47dfb5+')='+_0x292101[_0x47dfb5],'Set'));_0x44df46+=0x1;}}_0x53fa31['push'](new Extension(_0x292101,_0x44df46,'6',_0xfd2b('0x95')));_0x44df46+=0x1;_0x53fa31[_0xfd2b('0x8d')](new Extension(_0x292101,_0x44df46,_0xfd2b('0x96'),_0xfd2b('0x97')));_0x44df46=0x0;return _0x53fa31;}exports[_0xfd2b('0x98')]=function(_0x15b843,_0x41631d,_0x132df1){var _0xcf9daf;return db[_0xfd2b('0x7e')][_0xfd2b('0x7f')](function(_0x4a7383){return db['FaxAccount'][_0xfd2b('0x5c')](_0x15b843[_0xfd2b('0x5d')],{'transaction':_0x4a7383})['then'](function(_0x5c2a6f){_0xcf9daf=_0x5c2a6f[_0xfd2b('0x38')]({'plain':!![]});return db[_0xfd2b('0x99')][_0xfd2b('0x83')](createExtensionsReciveFax(_0xcf9daf),{'transaction':_0x4a7383});});})[_0xfd2b('0x36')](function(){return _0xcf9daf;})[_0xfd2b('0x36')](respondWithResult(_0x41631d,null))[_0xfd2b('0x5b')](handleError(_0x41631d,null));};exports[_0xfd2b('0x9a')]=function(_0x12af9c,_0x44761e,_0xb728ee){var _0x587c57;return db[_0xfd2b('0x7e')][_0xfd2b('0x7f')](function(_0x3893a6){return db[_0xfd2b('0x53')][_0xfd2b('0x35')](_0x12af9c[_0xfd2b('0x5d')],{'where':{'id':_0x12af9c[_0xfd2b('0x5d')]['id']},'transaction':_0x3893a6})['then'](function(_0x379ae8){return db[_0xfd2b('0x99')][_0xfd2b('0x37')]({'where':{'FaxAccountId':_0x12af9c['body']['id']},'transaction':_0x3893a6})['then'](function(_0x51e620){return db['VoiceExtension'][_0xfd2b('0x83')](createExtensionsReciveFax(_[_0xfd2b('0x9b')](_0x12af9c[_0xfd2b('0x5d')],[_0xfd2b('0x9c'),'key',_0xfd2b('0x9d'),_0xfd2b('0x9e'),_0xfd2b('0x9f'),_0xfd2b('0xa0')])),{'transaction':_0x3893a6});});});})[_0xfd2b('0x36')](function(){return db['FaxAccount'][_0xfd2b('0xa1')](_0x12af9c[_0xfd2b('0x5d')]['id']);})[_0xfd2b('0x36')](respondWithResult(_0x44761e,null))[_0xfd2b('0x5b')](handleError(_0x44761e,null));};exports['getMessages']=function(_0x320fe6,_0x2e8384,_0x4d930d){var _0x3eba27={'raw':!![],'where':{}};var _0x33619f={};var _0x1d19a7={'count':0x0,'rows':[]};return db[_0xfd2b('0x53')]['findOne']({'where':{'id':_0x320fe6[_0xfd2b('0x57')]['id']}})['then'](handleEntityNotFound(_0x2e8384,null))[_0xfd2b('0x36')](function(_0x296375){if(_0x296375){_0x33619f['model']=_[_0xfd2b('0x44')](db[_0xfd2b('0xa2')][_0xfd2b('0x3f')]);_0x33619f['query']=_[_0xfd2b('0x44')](_0x320fe6[_0xfd2b('0x43')]);_0x33619f[_0xfd2b('0x45')]=_[_0xfd2b('0x46')](_0x33619f[_0xfd2b('0x42')],_0x33619f[_0xfd2b('0x43')]);_0x3eba27[_0xfd2b('0x47')]=_[_0xfd2b('0x46')](_0x33619f['model'],qs[_0xfd2b('0x48')](_0x320fe6[_0xfd2b('0x43')][_0xfd2b('0x48')]));_0x3eba27[_0xfd2b('0x47')]=_0x3eba27['attributes'][_0xfd2b('0x59')]?_0x3eba27['attributes']:_0x33619f['model'];if(!_0x320fe6[_0xfd2b('0x43')][_0xfd2b('0x6a')](_0xfd2b('0x49'))){_0x3eba27[_0xfd2b('0x30')]=qs['limit'](_0x320fe6[_0xfd2b('0x43')][_0xfd2b('0x30')]);_0x3eba27[_0xfd2b('0x2e')]=qs[_0xfd2b('0x2e')](_0x320fe6[_0xfd2b('0x43')][_0xfd2b('0x2e')]);}_0x3eba27[_0xfd2b('0x4a')]=qs[_0xfd2b('0x4b')](_0x320fe6[_0xfd2b('0x43')][_0xfd2b('0x4b')]);_0x3eba27[_0xfd2b('0x4c')]=qs[_0xfd2b('0x45')](_[_0xfd2b('0x4d')](_0x320fe6[_0xfd2b('0x43')],_0x33619f[_0xfd2b('0x45')]));_0x3eba27['where'][_0xfd2b('0x6b')]=_0x296375['id'];if(_0x320fe6[_0xfd2b('0x43')][_0xfd2b('0x4e')]){_0x3eba27[_0xfd2b('0x4c')]=_['merge'](_0x3eba27[_0xfd2b('0x4c')],{'$or':_[_0xfd2b('0x50')](_0x3eba27[_0xfd2b('0x47')],function(_0x3d01db){var _0x51f231={};_0x51f231[_0x3d01db]={'$like':'%'+_0x320fe6[_0xfd2b('0x43')][_0xfd2b('0x4e')]+'%'};return _0x51f231;})});}if(_0x320fe6[_0xfd2b('0x43')][_0xfd2b('0xa3')]){var _0x1a26a7=_0x320fe6[_0xfd2b('0x43')]['$gte'][_0xfd2b('0xa4')](',');var _0x1474d7={};_0x1474d7[_0x1a26a7[0x0]]={'$gte':moment(_0x1a26a7[0x1])[_0xfd2b('0xa5')](_0xfd2b('0xa6'))};_0x3eba27[_0xfd2b('0x4c')]=_['merge'](_0x3eba27[_0xfd2b('0x4c')],_0x1474d7);}_0x3eba27=_['merge']({},_0x3eba27,_0x320fe6[_0xfd2b('0x52')]);return db[_0xfd2b('0xa2')][_0xfd2b('0x31')]({'where':_0x3eba27[_0xfd2b('0x4c')]})[_0xfd2b('0x36')](function(_0x12e4ac){_0x1d19a7[_0xfd2b('0x31')]=_0x12e4ac;if(_0x320fe6['query']['includeAll']){_0x3eba27['include']=[{'all':!![]}];}return db[_0xfd2b('0xa2')]['findAll'](_0x3eba27);})['then'](function(_0x4a3d27){_0x1d19a7[_0xfd2b('0x55')]=_0x4a3d27;return _0x1d19a7;});}})[_0xfd2b('0x36')](respondWithFilteredResult(_0x2e8384,_0x3eba27))['catch'](handleError(_0x2e8384,null));};exports['send']=function(_0x1e0cab,_0xbdf52b,_0x3e78df){var _0x4404cf,_0x11ccf5={},_0x160407;if(_0x1e0cab['body']['to']){_0x160407=_0x1e0cab['body']['to'][0x0];}return db[_0xfd2b('0x53')][_0xfd2b('0x62')]({'where':{'id':_0x1e0cab[_0xfd2b('0x57')]['id']},'include':[{'model':db[_0xfd2b('0xa7')],'as':_0xfd2b('0xa8'),'include':[{'model':db['CmContact'],'as':_0xfd2b('0xa9'),'where':{'fax':_0x160407},'limit':0x1,'order':[[_0xfd2b('0x9e'),'DESC']]}]}]})[_0xfd2b('0x36')](handleEntityNotFound(_0xbdf52b,null))[_0xfd2b('0x36')](function(_0x3cbc3f){_0x4404cf=_0x3cbc3f;if(_0x1e0cab[_0xfd2b('0x5d')][_0xfd2b('0xaa')]&&_0x1e0cab[_0xfd2b('0x5d')][_0xfd2b('0xaa')]['length']){for(var _0x40ec74=0x0;_0x40ec74<_0x1e0cab[_0xfd2b('0x5d')][_0xfd2b('0xaa')][_0xfd2b('0x59')];_0x40ec74+=0x1){_0x1e0cab['body'][_0xfd2b('0xaa')][_0x40ec74]={'filename':_0x1e0cab[_0xfd2b('0x5d')][_0xfd2b('0xaa')][_0x40ec74][_0xfd2b('0x3b')],'id':_0x1e0cab['body'][_0xfd2b('0xaa')][_0x40ec74]['id'],'path':path[_0xfd2b('0xab')](config['root'],_0xfd2b('0xac'),_0x1e0cab[_0xfd2b('0x5d')][_0xfd2b('0xaa')][_0x40ec74][_0xfd2b('0xad')])};}}return respondWithRpcPromise(_0xfd2b('0xae'),_0xfd2b('0xae'),{'FaxAccountId':_['isNil'](_0x1e0cab[_0xfd2b('0x57')]['id'])?undefined:_0x1e0cab['params']['id'],'path':_[_0xfd2b('0xaf')](_0x1e0cab[_0xfd2b('0x5d')][_0xfd2b('0xaa')][0x0][_0xfd2b('0xb0')])?undefined:_0x1e0cab[_0xfd2b('0x5d')][_0xfd2b('0xaa')][0x0][_0xfd2b('0xb0')],'fax':_[_0xfd2b('0xaf')](_0x1e0cab[_0xfd2b('0x5d')]['to'][0x0])?undefined:_0x1e0cab[_0xfd2b('0x5d')]['to'][0x0]},client9002);})[_0xfd2b('0x36')](function(){if(_0x4404cf){if(_['isNil'](_0x1e0cab['body'][_0xfd2b('0xb1')])){_0x1e0cab[_0xfd2b('0x5d')][_0xfd2b('0xb1')]=util[_0xfd2b('0xa5')]('\x22%s\x22\x20<%s>',_0x4404cf[_0xfd2b('0x3b')],_0x4404cf[_0xfd2b('0xb2')]);}if(_0x4404cf[_0xfd2b('0xa8')]){if(_0x4404cf[_0xfd2b('0xa8')]['Contacts']['length']){return _0x4404cf[_0xfd2b('0xa8')][_0xfd2b('0xa9')][0x0];}else{return db[_0xfd2b('0x73')][_0xfd2b('0x5c')](_[_0xfd2b('0x17')](_0x1e0cab[_0xfd2b('0x5d')],{'firstName':_0x1e0cab['body']['to'][0x0],'phone':_0x1e0cab['body']['to'][0x0],'fax':_0x1e0cab['body']['to'][0x0],'ListId':_0x4404cf['ListId']}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0xfd2b('0xb3'));}})[_0xfd2b('0x36')](function(_0x4ee5c9){if(_0x4ee5c9){return db['FaxInteraction'][_0xfd2b('0x62')]({'where':{'ContactId':_0x4ee5c9['id'],'closed':![],'FaxAccountId':_0x4404cf['id']}})[_0xfd2b('0x36')](function(_0x130506){if(_0x130506){return[_0x130506,![]];}return db['FaxInteraction'][_0xfd2b('0x5c')]({'UserId':_0x1e0cab[_0xfd2b('0x5e')]['id'],'ContactId':_0x4ee5c9['id'],'FaxAccountId':_0x4404cf['id'],'fax':_0x1e0cab[_0xfd2b('0x5d')]['to'][0x0],'firstMsgDirection':_0xfd2b('0xb4'),'Messages':[_[_0xfd2b('0x4f')](_0x1e0cab[_0xfd2b('0x5d')],{'read':![],'body':_0x1e0cab[_0xfd2b('0x5d')][_0xfd2b('0xaa')][0x0]['filename'],'FaxAccountId':_0x4404cf['id'],'UserId':_0x1e0cab[_0xfd2b('0x5e')]['id'],'ContactId':_0x4ee5c9['id'],'AttachmentId':_0x1e0cab[_0xfd2b('0x5d')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0xfd2b('0xa2')],'as':_0xfd2b('0xb5')}]})[_0xfd2b('0x36')](function(_0xf741a3){return[_0xf741a3,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xfd2b('0xb6')](function(_0x48930e,_0x2f72ce){if(_0x2f72ce){return _0x48930e;}return db[_0xfd2b('0xa2')]['create']({'direction':'out','read':![],'body':_0x1e0cab[_0xfd2b('0x5d')][_0xfd2b('0xaa')][0x0][_0xfd2b('0xb7')],'FaxAccountId':_0x4404cf['id'],'FaxInteractionId':_0x48930e['id'],'UserId':_0x1e0cab['user']['id'],'ContactId':_0x48930e[_0xfd2b('0xb8')],'AttachmentId':_0x1e0cab[_0xfd2b('0x5d')]['attachments'][0x0]['id']})[_0xfd2b('0x36')](function(_0x3b0303){_0x48930e[_0xfd2b('0xb9')][_0xfd2b('0xb5')]=[];_0x48930e['dataValues'][_0xfd2b('0xb5')][_0xfd2b('0x8d')](_0x3b0303[_0xfd2b('0xb9')]);return _0x48930e;});})[_0xfd2b('0x36')](function(_0x5e4fe6){respondWithRpcPromise(_0xfd2b('0xba'),_0xfd2b('0xba'),{'FaxAccountId':_[_0xfd2b('0xaf')](_0x1e0cab[_0xfd2b('0x57')]['id'])?undefined:_0x1e0cab[_0xfd2b('0x57')]['id'],'path':_[_0xfd2b('0xaf')](_0x1e0cab[_0xfd2b('0x5d')]['attachments'][0x0]['path'])?undefined:_0x1e0cab[_0xfd2b('0x5d')][_0xfd2b('0xaa')][0x0]['path'],'fax':_[_0xfd2b('0xaf')](_0x1e0cab[_0xfd2b('0x5d')]['to'][0x0])?undefined:_0x1e0cab[_0xfd2b('0x5d')]['to'][0x0],'AttachmentId':_0x1e0cab[_0xfd2b('0x5d')][_0xfd2b('0xaa')][0x0]['id']},client9002)[_0xfd2b('0x36')](function(_0x2a9383){logger[_0xfd2b('0x20')](_0xfd2b('0xbb'),_0x2a9383);})['catch'](function(_0x4414b8){logger[_0xfd2b('0x20')](_0xfd2b('0xbb'),_0x4414b8);});return _0x5e4fe6;})['then'](respondWithResult(_0xbdf52b,null))[_0xfd2b('0x5b')](handleError(_0xbdf52b,null));};exports[_0xfd2b('0xbc')]=function(_0x230b44,_0x5c787f,_0x22cd14){return db['FaxAccount'][_0xfd2b('0x62')]({'where':{'id':_0x230b44[_0xfd2b('0x57')]['id']}})[_0xfd2b('0x36')](handleEntityNotFound(_0x5c787f,null))[_0xfd2b('0x36')](function(_0x39d6de){if(_0x39d6de){return _0x39d6de[_0xfd2b('0xbc')](_0x230b44[_0xfd2b('0x5d')][_0xfd2b('0x6d')],_[_0xfd2b('0x9b')](_0x230b44[_0xfd2b('0x5d')],[_0xfd2b('0x6d'),'id'])||{})[_0xfd2b('0xb6')](function(_0x34bdd5){for(var _0xf2ba25=0x0;_0xf2ba25<_0x230b44[_0xfd2b('0x5d')][_0xfd2b('0x6d')][_0xfd2b('0x59')];_0xf2ba25+=0x1){socket[_0xfd2b('0xbd')](_0xfd2b('0xbe'),{'UserId':Number(_0x230b44['body'][_0xfd2b('0x6d')][_0xf2ba25]),'FaxAccountId':Number(_0x230b44[_0xfd2b('0x57')]['id'])});}return _0x34bdd5;});}})[_0xfd2b('0x36')](respondWithResult(_0x5c787f,null))[_0xfd2b('0x5b')](handleError(_0x5c787f,null));};exports[_0xfd2b('0xbf')]=function(_0x2134e9,_0x287aa9,_0x1bda49){return db[_0xfd2b('0x53')][_0xfd2b('0x62')]({'where':{'id':_0x2134e9[_0xfd2b('0x57')]['id']}})[_0xfd2b('0x36')](handleEntityNotFound(_0x287aa9,null))[_0xfd2b('0x36')](function(_0x14915f){if(_0x14915f){return _0x14915f[_0xfd2b('0xbf')](_0x2134e9[_0xfd2b('0x43')][_0xfd2b('0x6d')])[_0xfd2b('0x36')](function(){if(_['isArray'](_0x2134e9['query'][_0xfd2b('0x6d')])){for(var _0x248c93=0x0;_0x248c93<_0x2134e9[_0xfd2b('0x43')][_0xfd2b('0x6d')][_0xfd2b('0x59')];_0x248c93+=0x1){socket[_0xfd2b('0xbd')]('userFaxAccount:remove',{'UserId':Number(_0x2134e9['query'][_0xfd2b('0x6d')][_0x248c93]),'FaxAccountId':Number(_0x2134e9[_0xfd2b('0x57')]['id'])});}}else{socket[_0xfd2b('0xbd')]('userFaxAccount:remove',{'UserId':Number(_0x2134e9[_0xfd2b('0x43')][_0xfd2b('0x6d')]),'FaxAccountId':Number(_0x2134e9[_0xfd2b('0x57')]['id'])});}});}})[_0xfd2b('0x36')](respondWithStatusCode(_0x287aa9,null))[_0xfd2b('0x5b')](handleError(_0x287aa9,null));};exports['getAgents']=function(_0x2d86fa,_0x1eb25d,_0x1cec76){var _0x130a95={};var _0x69dc08={};var _0x1516e0;var _0x269320;return db[_0xfd2b('0x53')]['findOne']({'where':{'id':_0x2d86fa[_0xfd2b('0x57')]['id']}})[_0xfd2b('0x36')](handleEntityNotFound(_0x1eb25d,null))[_0xfd2b('0x36')](function(_0x40e0c7){if(_0x40e0c7){_0x1516e0=_0x40e0c7;_0x69dc08[_0xfd2b('0x42')]=_['keys'](db[_0xfd2b('0x75')]['rawAttributes']);_0x69dc08[_0xfd2b('0x43')]=_[_0xfd2b('0x44')](_0x2d86fa['query']);_0x69dc08[_0xfd2b('0x45')]=_[_0xfd2b('0x46')](_0x69dc08[_0xfd2b('0x42')],_0x69dc08[_0xfd2b('0x43')]);_0x130a95['attributes']=_[_0xfd2b('0x46')](_0x69dc08[_0xfd2b('0x42')],qs[_0xfd2b('0x48')](_0x2d86fa['query'][_0xfd2b('0x48')]));_0x130a95[_0xfd2b('0x47')]=_0x130a95[_0xfd2b('0x47')][_0xfd2b('0x59')]?_0x130a95[_0xfd2b('0x47')]:_0x69dc08[_0xfd2b('0x42')];_0x130a95[_0xfd2b('0x4a')]=qs['sort'](_0x2d86fa['query'][_0xfd2b('0x4b')]);_0x130a95[_0xfd2b('0x4c')]=qs[_0xfd2b('0x45')](_[_0xfd2b('0x4d')](_0x2d86fa[_0xfd2b('0x43')],_0x69dc08[_0xfd2b('0x45')]));if(_0x2d86fa[_0xfd2b('0x43')][_0xfd2b('0x4e')]){_0x130a95[_0xfd2b('0x4c')]=_[_0xfd2b('0x4f')](_0x130a95[_0xfd2b('0x4c')],{'$or':_[_0xfd2b('0x50')](_0x130a95[_0xfd2b('0x47')],function(_0x4b4bdd){var _0x98d894={};_0x98d894[_0x4b4bdd]={'$like':'%'+_0x2d86fa['query'][_0xfd2b('0x4e')]+'%'};return _0x98d894;})});}_0x130a95=_[_0xfd2b('0x4f')]({},_0x130a95,_0x2d86fa['options']);return _0x1516e0['getAgents'](_0x130a95);}})[_0xfd2b('0x36')](function(_0x17e88c){if(_0x17e88c){_0x269320=_0x17e88c[_0xfd2b('0x59')];if(!_0x2d86fa[_0xfd2b('0x43')][_0xfd2b('0x6a')](_0xfd2b('0x49'))){_0x130a95[_0xfd2b('0x30')]=qs['limit'](_0x2d86fa[_0xfd2b('0x43')][_0xfd2b('0x30')]);_0x130a95[_0xfd2b('0x2e')]=qs[_0xfd2b('0x2e')](_0x2d86fa[_0xfd2b('0x43')][_0xfd2b('0x2e')]);}return _0x1516e0[_0xfd2b('0xc0')](_0x130a95);}})[_0xfd2b('0x36')](function(_0x3d595e){if(_0x3d595e){return _0x3d595e?{'count':_0x269320,'rows':_0x3d595e}:null;}})[_0xfd2b('0x36')](respondWithResult(_0x1eb25d,null))[_0xfd2b('0x5b')](handleError(_0x1eb25d,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index ee9324c..b86bf36 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 _0xa364=['setMaxListeners','save','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x4d641e,_0x5bda1d){var _0x2c10c6=function(_0x4c2ea1){while(--_0x4c2ea1){_0x4d641e['push'](_0x4d641e['shift']());}};_0x2c10c6(++_0x5bda1d);}(_0xa364,0x6a));var _0x4a36=function(_0x1843ba,_0xb44b1e){_0x1843ba=_0x1843ba-0x0;var _0x195743=_0xa364[_0x1843ba];return _0x195743;};'use strict';var EventEmitter=require(_0x4a36('0x0'));var FaxAccount=require(_0x4a36('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x4a36('0x2')](0x0);var events={'afterCreate':_0x4a36('0x3'),'afterUpdate':_0x4a36('0x4'),'afterDestroy':_0x4a36('0x5')};function emitEvent(_0x1e62f3){return function(_0x5510d6,_0x5e2c19,_0x43666e){FaxAccountEvents[_0x4a36('0x6')](_0x1e62f3+':'+_0x5510d6['id'],_0x5510d6);FaxAccountEvents[_0x4a36('0x6')](_0x1e62f3,_0x5510d6);_0x43666e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0x4a36('0x7')](e,emitEvent(event));}}module[_0x4a36('0x8')]=FaxAccountEvents; \ No newline at end of file +var _0xe7ed=['remove','emit','hasOwnProperty','hook','exports','FaxAccount','setMaxListeners','save','update'];(function(_0xa3463d,_0x32f8da){var _0x50fd67=function(_0xb984fd){while(--_0xb984fd){_0xa3463d['push'](_0xa3463d['shift']());}};_0x50fd67(++_0x32f8da);}(_0xe7ed,0x15b));var _0xde7e=function(_0x360b23,_0x5c6352){_0x360b23=_0x360b23-0x0;var _0x3b8fda=_0xe7ed[_0x360b23];return _0x3b8fda;};'use strict';var EventEmitter=require('events');var FaxAccount=require('../../mysqldb')['db'][_0xde7e('0x0')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xde7e('0x1')](0x0);var events={'afterCreate':_0xde7e('0x2'),'afterUpdate':_0xde7e('0x3'),'afterDestroy':_0xde7e('0x4')};function emitEvent(_0x11b5ee){return function(_0x25db68,_0xe69177,_0x1e61b5){FaxAccountEvents[_0xde7e('0x5')](_0x11b5ee+':'+_0x25db68['id'],_0x25db68);FaxAccountEvents[_0xde7e('0x5')](_0x11b5ee,_0x25db68);_0x1e61b5(null);};}for(var e in events){if(events[_0xde7e('0x6')](e)){var event=events[e];FaxAccount[_0xde7e('0x7')](e,emitEvent(event));}}module[_0xde7e('0x8')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index ba8c8a8..61a1efb 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 _0x6830=['util','../../config/logger','api','moment','request-promise','path','../../config/environment','./faxAccount.attributes','exports','lodash'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x6830,0x1a3));var _0x0683=function(_0x23551e,_0x56f82f){_0x23551e=_0x23551e-0x0;var _0x4e36ff=_0x6830[_0x23551e];return _0x4e36ff;};'use strict';var _=require(_0x0683('0x0'));var util=require(_0x0683('0x1'));var logger=require(_0x0683('0x2'))(_0x0683('0x3'));var moment=require(_0x0683('0x4'));var BPromise=require('bluebird');var rp=require(_0x0683('0x5'));var fs=require('fs');var path=require(_0x0683('0x6'));var rimraf=require('rimraf');var config=require(_0x0683('0x7'));var attributes=require(_0x0683('0x8'));module[_0x0683('0x9')]=function(_0xd38b03,_0x26fa00){return _0xd38b03['define']('FaxAccount',attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x306a=['lodash','util','api','moment','bluebird','path','rimraf','exports','define','FaxAccount','fax_accounts'];(function(_0xa9750,_0x1472fe){var _0x587bd0=function(_0x419267){while(--_0x419267){_0xa9750['push'](_0xa9750['shift']());}};_0x587bd0(++_0x1472fe);}(_0x306a,0x1c3));var _0xa306=function(_0x2f6d16,_0x516c0c){_0x2f6d16=_0x2f6d16-0x0;var _0xf706a=_0x306a[_0x2f6d16];return _0xf706a;};'use strict';var _=require(_0xa306('0x0'));var util=require(_0xa306('0x1'));var logger=require('../../config/logger')(_0xa306('0x2'));var moment=require(_0xa306('0x3'));var BPromise=require(_0xa306('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa306('0x5'));var rimraf=require(_0xa306('0x6'));var config=require('../../config/environment');var attributes=require('./faxAccount.attributes');module[_0xa306('0x7')]=function(_0x36b8d1,_0xd88763){return _0x36b8d1[_0xa306('0x8')](_0xa306('0x9'),attributes,{'tableName':_0xa306('0xa'),'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 d12078a..51020eb 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 _0x6ca5=['User','unshift','agent','name','waitForTheAssignedAgent','*,*,*,*','queueId','FaxQueue','waitForTheAssignedQueue','Start','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','FaxAccount','findAll','options','raw','where','attributes','map','include','model','GetFaxAccount','body','CmContact','Sequelize','keys','createdAt','updatedAt','difference','ListId','isNil','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','find','account','CmList','List','Contacts','DESC','Applications','get','applications','priority','asc','length','fax','FaxInteraction','create','Contact\x20not\x20found','autoclose','unmanaged','created','interaction','ContactId','AttachmentId','UserId'];(function(_0x22e489,_0x277c91){var _0x41d9cb=function(_0x393970){while(--_0x393970){_0x22e489['push'](_0x22e489['shift']());}};_0x41d9cb(++_0x277c91);}(_0x6ca5,0x112));var _0x56ca=function(_0x1d2574,_0x3bc4dd){_0x1d2574=_0x1d2574-0x0;var _0x2b3b1f=_0x6ca5[_0x1d2574];return _0x2b3b1f;};'use strict';var _=require(_0x56ca('0x0'));var util=require(_0x56ca('0x1'));var moment=require(_0x56ca('0x2'));var BPromise=require('bluebird');var rs=require(_0x56ca('0x3'));var fs=require('fs');var Redis=require(_0x56ca('0x4'));var db=require(_0x56ca('0x5'))['db'];var utils=require(_0x56ca('0x6'));var logger=require('../../config/logger')(_0x56ca('0x7'));var config=require(_0x56ca('0x8'));var jayson=require(_0x56ca('0x9'));var client=jayson[_0x56ca('0xa')][_0x56ca('0xb')]({'port':0x232c});config[_0x56ca('0xc')]=_[_0x56ca('0xd')](config[_0x56ca('0xc')],{'host':_0x56ca('0xe'),'port':0x18eb});var socket=require(_0x56ca('0xf'))(new Redis(config['redis']));require('./faxAccount.socket')[_0x56ca('0x10')](socket);function respondWithRpcPromise(_0x27fef3,_0x26eba0,_0x4adbab){return new BPromise(function(_0x2da364,_0x2b3e9f){return client[_0x56ca('0x11')](_0x27fef3,_0x4adbab)[_0x56ca('0x12')](function(_0x58c8c3){logger[_0x56ca('0x13')](_0x56ca('0x14'),_0x26eba0,'request\x20sent');logger[_0x56ca('0x15')](_0x56ca('0x16'),_0x26eba0,_0x56ca('0x17'),JSON['stringify'](_0x58c8c3));if(_0x58c8c3[_0x56ca('0x18')]){if(_0x58c8c3[_0x56ca('0x18')][_0x56ca('0x19')]===0x1f4){logger[_0x56ca('0x18')](_0x56ca('0x14'),_0x26eba0,_0x58c8c3[_0x56ca('0x18')][_0x56ca('0x1a')]);return _0x2b3e9f(_0x58c8c3[_0x56ca('0x18')][_0x56ca('0x1a')]);}logger[_0x56ca('0x18')](_0x56ca('0x14'),_0x26eba0,_0x58c8c3[_0x56ca('0x18')][_0x56ca('0x1a')]);return _0x2da364(_0x58c8c3['error'][_0x56ca('0x1a')]);}else{logger[_0x56ca('0x13')](_0x56ca('0x14'),_0x26eba0,'request\x20sent');_0x2da364(_0x58c8c3[_0x56ca('0x1b')][_0x56ca('0x1a')]);}})[_0x56ca('0x1c')](function(_0x238afa){logger[_0x56ca('0x18')](_0x56ca('0x14'),_0x26eba0,_0x238afa);_0x2b3e9f(_0x238afa);});});}exports['GetFaxAccount']=function(_0x33fed4){var _0x486ed8=this;return new Promise(function(_0x48ae2a,_0x54aa88){return db[_0x56ca('0x1d')][_0x56ca('0x1e')]({'raw':_0x33fed4[_0x56ca('0x1f')]?_0x33fed4['options'][_0x56ca('0x20')]===undefined?!![]:![]:!![],'where':_0x33fed4[_0x56ca('0x1f')]?_0x33fed4[_0x56ca('0x1f')][_0x56ca('0x21')]||null:null,'attributes':_0x33fed4[_0x56ca('0x1f')]?_0x33fed4[_0x56ca('0x1f')][_0x56ca('0x22')]||null:null,'limit':_0x33fed4[_0x56ca('0x1f')]?_0x33fed4[_0x56ca('0x1f')]['limit']||null:null,'include':_0x33fed4['options']?_0x33fed4[_0x56ca('0x1f')]['include']?_[_0x56ca('0x23')](_0x33fed4[_0x56ca('0x1f')][_0x56ca('0x24')],function(_0x33577a){return{'model':db[_0x33577a[_0x56ca('0x25')]],'as':_0x33577a['as'],'attributes':_0x33577a[_0x56ca('0x22')],'include':_0x33577a[_0x56ca('0x24')]?_[_0x56ca('0x23')](_0x33577a[_0x56ca('0x24')],function(_0x59f8aa){return{'model':db[_0x59f8aa[_0x56ca('0x25')]],'as':_0x59f8aa['as'],'attributes':_0x59f8aa[_0x56ca('0x22')],'include':_0x59f8aa[_0x56ca('0x24')]?_[_0x56ca('0x23')](_0x59f8aa[_0x56ca('0x24')],function(_0x3557b2){return{'model':db[_0x3557b2[_0x56ca('0x25')]],'as':_0x3557b2['as'],'attributes':_0x3557b2['attributes']};}):[]};}):[]};}):[]:[]})[_0x56ca('0x12')](function(_0x356baa){logger['info']('GetFaxAccount',_0x33fed4);logger[_0x56ca('0x15')](_0x56ca('0x26'),_0x33fed4,JSON['stringify'](_0x356baa));_0x48ae2a(_0x356baa);})['catch'](function(_0x15cf3c){logger[_0x56ca('0x18')](_0x56ca('0x26'),_0x15cf3c[_0x56ca('0x1a')],_0x33fed4);_0x54aa88(_0x486ed8[_0x56ca('0x18')](0x1f4,_0x15cf3c['message']));});});};exports['NotifyFaxAccount']=function(_0x56c784,_0x110b75,_0x510ba8){var _0x3748a0=this;return new Promise(function(_0x189bc9,_0x446b92){var _0x16cbc1={'body':_0x56c784[_0x56ca('0x27')],'channel':'fax'};var _0xa3a5ef=[];var _0x177932=[];var _0x27c791={};return db[_0x56ca('0x28')]['describe']()[_0x56ca('0x12')](function(_0x4be1f8){if(!_0x4be1f8){throw new db[(_0x56ca('0x29'))]['ValidationError']('no\x20available\x20attributes');}_0xa3a5ef=_['difference'](_[_0x56ca('0x2a')](_0x4be1f8),[_0x56ca('0x2b'),_0x56ca('0x2c')]);_0x177932=_[_0x56ca('0x2d')](_[_0x56ca('0x2a')](_0x4be1f8),[_0x56ca('0x2b'),_0x56ca('0x2c'),'CompanyId',_0x56ca('0x2e')]);if(_0x56c784[_0x56ca('0x27')]['id']){delete _0x56c784[_0x56ca('0x27')]['id'];}if(_[_0x56ca('0x2f')](_0x56c784[_0x56ca('0x27')][_0x56ca('0x30')])){throw new db[(_0x56ca('0x29'))][(_0x56ca('0x31'))](_0x56ca('0x32'));}if(_['isNil'](_0x56c784[_0x56ca('0x27')][_0x56ca('0x27')])||_0x56c784['body'][_0x56ca('0x27')]===''){throw new db[(_0x56ca('0x29'))]['ValidationError'](_0x56ca('0x33'));}if(_[_0x56ca('0x2f')](_0x56c784[_0x56ca('0x27')][_0x56ca('0x34')])){throw new db[(_0x56ca('0x29'))][(_0x56ca('0x31'))](_0x56ca('0x35')+_0x177932);}if(!_[_0x56ca('0x36')](_0x177932,_0x56c784[_0x56ca('0x27')][_0x56ca('0x34')])){throw new db[(_0x56ca('0x29'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x177932);}_0x27c791[_0x56c784['body'][_0x56ca('0x34')]]=_0x56c784[_0x56ca('0x27')]['from'];})[_0x56ca('0x12')](function(){return db[_0x56ca('0x1d')][_0x56ca('0x37')]({'where':{'id':_0x56c784[_0x56ca('0x38')]['id']},'include':[{'model':db[_0x56ca('0x39')],'as':_0x56ca('0x3a'),'include':[{'model':db['CmContact'],'as':_0x56ca('0x3b'),'where':_0x27c791,'limit':0x1,'order':[[_0x56ca('0x2c'),_0x56ca('0x3c')]]}]},{'model':db['FaxApplication'],'as':_0x56ca('0x3d')}]});})[_0x56ca('0x12')](function(_0x2cfb58){if(_0x2cfb58&&_0x2cfb58[_0x56ca('0x3a')]){var _0x3d4cba=_0x2cfb58[_0x56ca('0x3e')]({'plain':!![]});_0x16cbc1[_0x56ca('0x38')]=_0x3d4cba;_0x16cbc1[_0x56ca('0x3f')]=_0x3d4cba[_0x56ca('0x3d')];_0x16cbc1['list']=_0x3d4cba[_0x56ca('0x3a')];_0x16cbc1[_0x56ca('0x3f')]=_['orderBy'](_0x16cbc1[_0x56ca('0x3f')],[_0x56ca('0x40')],[_0x56ca('0x41')]);if(_0x16cbc1[_0x56ca('0x38')]['Applications']){delete _0x16cbc1[_0x56ca('0x38')][_0x56ca('0x3d')];}if(_0x16cbc1[_0x56ca('0x38')][_0x56ca('0x3a')]&&_0x16cbc1[_0x56ca('0x38')][_0x56ca('0x3a')]['Contacts'][_0x56ca('0x42')]){return _0x16cbc1[_0x56ca('0x38')][_0x56ca('0x3a')][_0x56ca('0x3b')][0x0];}var _0x432bca=_[_0x56ca('0xd')](_0x56c784[_0x56ca('0x27')],{'firstName':_0x56c784[_0x56ca('0x27')]['from'],'ListId':_0x3d4cba['ListId']});_0x432bca[_0x56c784['body'][_0x56ca('0x34')]]=_0x56c784[_0x56ca('0x27')][_0x56ca('0x30')];return db[_0x56ca('0x28')]['create'](_0x432bca,{'fields':_0xa3a5ef,'raw':!![]});}})[_0x56ca('0x12')](function(_0x2017f5){_0x16cbc1['contact']=_0x2017f5;if(_0x2017f5){var _0x3f364e={'ContactId':_0x2017f5['id'],'FaxAccountId':_0x56c784[_0x56ca('0x38')]['id'],'fax':_0x2017f5[_0x56ca('0x43')]};return db[_0x56ca('0x44')]['find']({'where':{'ContactId':_0x2017f5['id'],'closed':![],'FaxAccountId':_0x56c784[_0x56ca('0x38')]['id']}})['then'](function(_0x2185b6){if(_0x2185b6){return[_0x2185b6,![]];}return db['FaxInteraction'][_0x56ca('0x45')](_0x3f364e)[_0x56ca('0x12')](function(_0x53e0f7){return[_0x53e0f7,!![]];});});}else{throw new Error(_0x56ca('0x46'));}})['spread'](function(_0x40416e,_0x201760){var _0x4b7e0e=_0x40416e[_0x56ca('0x3e')]({'plain':!![]});if(_0x201760){if(_0x16cbc1[_0x56ca('0x38')][_0x56ca('0x47')]){_0x16cbc1['applications']['push']({'id':0x0,'priority':_0x16cbc1[_0x56ca('0x3f')]['length']+0x1,'app':'close','appdata':_0x56ca('0x48'),'interval':'*,*,*,*'});}_0x4b7e0e[_0x56ca('0x49')]=!![];}else{_0x4b7e0e[_0x56ca('0x49')]=![];}_0x16cbc1[_0x56ca('0x4a')]=_0x4b7e0e;return db['FaxMessage'][_0x56ca('0x45')]({'body':_0x56c784['body'][_0x56ca('0x27')],'FaxAccountId':_0x56c784['account']['id'],'FaxInteractionId':_0x40416e['id'],'direction':'in','ContactId':_0x40416e[_0x56ca('0x4b')],'AttachmentId':_0x56c784[_0x56ca('0x27')][_0x56ca('0x4c')]});})[_0x56ca('0x12')](function(_0x4f90c6){_0x16cbc1[_0x56ca('0x1a')]=_0x4f90c6;if(!_0x16cbc1[_0x56ca('0x4a')][_0x56ca('0x4d')])return;return db[_0x56ca('0x4e')]['find']({'attributes':['id','name'],'where':{'id':_0x16cbc1[_0x56ca('0x4a')][_0x56ca('0x4d')]}});})[_0x56ca('0x12')](function(_0xdaebbe){if(_0xdaebbe){_0x16cbc1[_0x56ca('0x3f')][_0x56ca('0x4f')]({'id':0x0,'priority':0x0,'app':_0x56ca('0x50'),'appdata':_0xdaebbe[_0x56ca('0x51')]+','+(_0x16cbc1[_0x56ca('0x38')][_0x56ca('0x52')]||0xa),'interval':_0x56ca('0x53')});}if(!_0x16cbc1[_0x56ca('0x4a')][_0x56ca('0x54')])return;return db[_0x56ca('0x55')]['find']({'attributes':['id',_0x56ca('0x51')],'where':{'id':_0x16cbc1['interaction'][_0x56ca('0x54')]}});})[_0x56ca('0x12')](function(_0x1db7e8){if(_0x1db7e8){_0x16cbc1[_0x56ca('0x3f')]['unshift']({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x1db7e8['name']+','+(_0x16cbc1[_0x56ca('0x38')][_0x56ca('0x56')]||0x12c),'interval':_0x56ca('0x53')});}return respondWithRpcPromise(_0x56ca('0x57'),'startRouting',_0x16cbc1);})['then'](function(_0x504ee0){_0x189bc9(_0x504ee0);})[_0x56ca('0x1c')](function(_0x39e1d4){_0x446b92(_0x3748a0[_0x56ca('0x18')](0x1f4,_0x39e1d4[_0x56ca('0x1a')]));});});}; \ No newline at end of file +var _0xf26d=['push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','User','unshift','agent','name','waitForTheAssignedAgent','queueId','FaxQueue','waitForTheAssignedQueue','Start','startRouting','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','NotifyFaxAccount','body','fax','Sequelize','ValidationError','difference','keys','createdAt','CompanyId','ListId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','find','CmList','List','CmContact','Contacts','DESC','FaxApplication','get','applications','Applications','list','orderBy','asc','account','length','create','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose'];(function(_0x3029f6,_0x2cedd6){var _0xbf8840=function(_0x37466a){while(--_0x37466a){_0x3029f6['push'](_0x3029f6['shift']());}};_0xbf8840(++_0x2cedd6);}(_0xf26d,0x131));var _0xdf26=function(_0x797e40,_0x49a4d5){_0x797e40=_0x797e40-0x0;var _0x3c5bfc=_0xf26d[_0x797e40];return _0x3c5bfc;};'use strict';var _=require(_0xdf26('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xdf26('0x1'));var rs=require(_0xdf26('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdf26('0x3'))['db'];var utils=require(_0xdf26('0x4'));var logger=require(_0xdf26('0x5'))('rpc');var config=require(_0xdf26('0x6'));var jayson=require(_0xdf26('0x7'));var client=jayson[_0xdf26('0x8')]['http']({'port':0x232c});config['redis']=_[_0xdf26('0x9')](config[_0xdf26('0xa')],{'host':_0xdf26('0xb'),'port':0x18eb});var socket=require(_0xdf26('0xc'))(new Redis(config[_0xdf26('0xa')]));require(_0xdf26('0xd'))[_0xdf26('0xe')](socket);function respondWithRpcPromise(_0x19e0e4,_0xd2e63f,_0x1cb572){return new BPromise(function(_0x2301d0,_0x7473fa){return client[_0xdf26('0xf')](_0x19e0e4,_0x1cb572)[_0xdf26('0x10')](function(_0x257e6f){logger[_0xdf26('0x11')](_0xdf26('0x12'),_0xd2e63f,_0xdf26('0x13'));logger[_0xdf26('0x14')](_0xdf26('0x15'),_0xd2e63f,_0xdf26('0x13'),JSON['stringify'](_0x257e6f));if(_0x257e6f[_0xdf26('0x16')]){if(_0x257e6f[_0xdf26('0x16')][_0xdf26('0x17')]===0x1f4){logger[_0xdf26('0x16')]('FaxAccount,\x20%s,\x20%s',_0xd2e63f,_0x257e6f[_0xdf26('0x16')][_0xdf26('0x18')]);return _0x7473fa(_0x257e6f[_0xdf26('0x16')][_0xdf26('0x18')]);}logger['error'](_0xdf26('0x12'),_0xd2e63f,_0x257e6f[_0xdf26('0x16')][_0xdf26('0x18')]);return _0x2301d0(_0x257e6f[_0xdf26('0x16')][_0xdf26('0x18')]);}else{logger[_0xdf26('0x11')](_0xdf26('0x12'),_0xd2e63f,_0xdf26('0x13'));_0x2301d0(_0x257e6f[_0xdf26('0x19')]['message']);}})[_0xdf26('0x1a')](function(_0x3dafa2){logger['error'](_0xdf26('0x12'),_0xd2e63f,_0x3dafa2);_0x7473fa(_0x3dafa2);});});}exports[_0xdf26('0x1b')]=function(_0x1b5fd8){var _0x3075fc=this;return new Promise(function(_0x2b4f2a,_0x27abe3){return db[_0xdf26('0x1c')][_0xdf26('0x1d')]({'raw':_0x1b5fd8['options']?_0x1b5fd8[_0xdf26('0x1e')][_0xdf26('0x1f')]===undefined?!![]:![]:!![],'where':_0x1b5fd8['options']?_0x1b5fd8[_0xdf26('0x1e')][_0xdf26('0x20')]||null:null,'attributes':_0x1b5fd8[_0xdf26('0x1e')]?_0x1b5fd8[_0xdf26('0x1e')][_0xdf26('0x21')]||null:null,'limit':_0x1b5fd8[_0xdf26('0x1e')]?_0x1b5fd8[_0xdf26('0x1e')][_0xdf26('0x22')]||null:null,'include':_0x1b5fd8[_0xdf26('0x1e')]?_0x1b5fd8[_0xdf26('0x1e')][_0xdf26('0x23')]?_[_0xdf26('0x24')](_0x1b5fd8[_0xdf26('0x1e')]['include'],function(_0x1efb8b){return{'model':db[_0x1efb8b['model']],'as':_0x1efb8b['as'],'attributes':_0x1efb8b[_0xdf26('0x21')],'include':_0x1efb8b[_0xdf26('0x23')]?_['map'](_0x1efb8b[_0xdf26('0x23')],function(_0x3a2107){return{'model':db[_0x3a2107[_0xdf26('0x25')]],'as':_0x3a2107['as'],'attributes':_0x3a2107[_0xdf26('0x21')],'include':_0x3a2107[_0xdf26('0x23')]?_[_0xdf26('0x24')](_0x3a2107[_0xdf26('0x23')],function(_0x465848){return{'model':db[_0x465848[_0xdf26('0x25')]],'as':_0x465848['as'],'attributes':_0x465848['attributes']};}):[]};}):[]};}):[]:[]})[_0xdf26('0x10')](function(_0xeee33){logger['info']('GetFaxAccount',_0x1b5fd8);logger[_0xdf26('0x14')](_0xdf26('0x1b'),_0x1b5fd8,JSON[_0xdf26('0x26')](_0xeee33));_0x2b4f2a(_0xeee33);})[_0xdf26('0x1a')](function(_0x33a49e){logger[_0xdf26('0x16')]('GetFaxAccount',_0x33a49e['message'],_0x1b5fd8);_0x27abe3(_0x3075fc[_0xdf26('0x16')](0x1f4,_0x33a49e[_0xdf26('0x18')]));});});};exports[_0xdf26('0x27')]=function(_0x1024e3,_0x3debf1,_0x457b3c){var _0x4be833=this;return new Promise(function(_0x49dccc,_0x274640){var _0x241897={'body':_0x1024e3[_0xdf26('0x28')],'channel':_0xdf26('0x29')};var _0x5819a2=[];var _0x2cbadb=[];var _0x17405b={};return db['CmContact']['describe']()[_0xdf26('0x10')](function(_0x371a6a){if(!_0x371a6a){throw new db[(_0xdf26('0x2a'))][(_0xdf26('0x2b'))]('no\x20available\x20attributes');}_0x5819a2=_[_0xdf26('0x2c')](_[_0xdf26('0x2d')](_0x371a6a),[_0xdf26('0x2e'),'updatedAt']);_0x2cbadb=_[_0xdf26('0x2c')](_[_0xdf26('0x2d')](_0x371a6a),[_0xdf26('0x2e'),'updatedAt',_0xdf26('0x2f'),_0xdf26('0x30')]);if(_0x1024e3[_0xdf26('0x28')]['id']){delete _0x1024e3[_0xdf26('0x28')]['id'];}if(_['isNil'](_0x1024e3[_0xdf26('0x28')][_0xdf26('0x31')])){throw new db[(_0xdf26('0x2a'))][(_0xdf26('0x2b'))](_0xdf26('0x32'));}if(_[_0xdf26('0x33')](_0x1024e3['body'][_0xdf26('0x28')])||_0x1024e3[_0xdf26('0x28')][_0xdf26('0x28')]===''){throw new db[(_0xdf26('0x2a'))]['ValidationError'](_0xdf26('0x34'));}if(_['isNil'](_0x1024e3[_0xdf26('0x28')][_0xdf26('0x35')])){throw new db[(_0xdf26('0x2a'))][(_0xdf26('0x2b'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2cbadb);}if(!_['includes'](_0x2cbadb,_0x1024e3[_0xdf26('0x28')][_0xdf26('0x35')])){throw new db[(_0xdf26('0x2a'))][(_0xdf26('0x2b'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2cbadb);}_0x17405b[_0x1024e3[_0xdf26('0x28')][_0xdf26('0x35')]]=_0x1024e3[_0xdf26('0x28')][_0xdf26('0x31')];})[_0xdf26('0x10')](function(){return db[_0xdf26('0x1c')][_0xdf26('0x36')]({'where':{'id':_0x1024e3['account']['id']},'include':[{'model':db[_0xdf26('0x37')],'as':_0xdf26('0x38'),'include':[{'model':db[_0xdf26('0x39')],'as':_0xdf26('0x3a'),'where':_0x17405b,'limit':0x1,'order':[['updatedAt',_0xdf26('0x3b')]]}]},{'model':db[_0xdf26('0x3c')],'as':'Applications'}]});})[_0xdf26('0x10')](function(_0x46d58b){if(_0x46d58b&&_0x46d58b[_0xdf26('0x38')]){var _0x43c5ce=_0x46d58b[_0xdf26('0x3d')]({'plain':!![]});_0x241897['account']=_0x43c5ce;_0x241897[_0xdf26('0x3e')]=_0x43c5ce[_0xdf26('0x3f')];_0x241897[_0xdf26('0x40')]=_0x43c5ce[_0xdf26('0x38')];_0x241897[_0xdf26('0x3e')]=_[_0xdf26('0x41')](_0x241897[_0xdf26('0x3e')],['priority'],[_0xdf26('0x42')]);if(_0x241897['account'][_0xdf26('0x3f')]){delete _0x241897[_0xdf26('0x43')][_0xdf26('0x3f')];}if(_0x241897[_0xdf26('0x43')]['List']&&_0x241897['account'][_0xdf26('0x38')]['Contacts'][_0xdf26('0x44')]){return _0x241897[_0xdf26('0x43')]['List'][_0xdf26('0x3a')][0x0];}var _0xdfed45=_[_0xdf26('0x9')](_0x1024e3[_0xdf26('0x28')],{'firstName':_0x1024e3[_0xdf26('0x28')]['from'],'ListId':_0x43c5ce[_0xdf26('0x30')]});_0xdfed45[_0x1024e3[_0xdf26('0x28')][_0xdf26('0x35')]]=_0x1024e3['body']['from'];return db['CmContact'][_0xdf26('0x45')](_0xdfed45,{'fields':_0x5819a2,'raw':!![]});}})[_0xdf26('0x10')](function(_0x41243d){_0x241897[_0xdf26('0x46')]=_0x41243d;if(_0x41243d){var _0x4790b5={'ContactId':_0x41243d['id'],'FaxAccountId':_0x1024e3[_0xdf26('0x43')]['id'],'fax':_0x41243d[_0xdf26('0x29')]};return db[_0xdf26('0x47')][_0xdf26('0x36')]({'where':{'ContactId':_0x41243d['id'],'closed':![],'FaxAccountId':_0x1024e3[_0xdf26('0x43')]['id']}})[_0xdf26('0x10')](function(_0x402045){if(_0x402045){return[_0x402045,![]];}return db['FaxInteraction'][_0xdf26('0x45')](_0x4790b5)[_0xdf26('0x10')](function(_0x363b8b){return[_0x363b8b,!![]];});});}else{throw new Error(_0xdf26('0x48'));}})[_0xdf26('0x49')](function(_0x426beb,_0x13cf6e){var _0x42d1d0=_0x426beb[_0xdf26('0x3d')]({'plain':!![]});if(_0x13cf6e){if(_0x241897['account'][_0xdf26('0x4a')]){_0x241897[_0xdf26('0x3e')][_0xdf26('0x4b')]({'id':0x0,'priority':_0x241897[_0xdf26('0x3e')][_0xdf26('0x44')]+0x1,'app':_0xdf26('0x4c'),'appdata':_0xdf26('0x4d'),'interval':_0xdf26('0x4e')});}_0x42d1d0[_0xdf26('0x4f')]=!![];}else{_0x42d1d0['created']=![];}_0x241897[_0xdf26('0x50')]=_0x42d1d0;return db[_0xdf26('0x51')][_0xdf26('0x45')]({'body':_0x1024e3[_0xdf26('0x28')][_0xdf26('0x28')],'FaxAccountId':_0x1024e3[_0xdf26('0x43')]['id'],'FaxInteractionId':_0x426beb['id'],'direction':'in','ContactId':_0x426beb[_0xdf26('0x52')],'AttachmentId':_0x1024e3['body'][_0xdf26('0x53')]});})[_0xdf26('0x10')](function(_0x143ba0){_0x241897[_0xdf26('0x18')]=_0x143ba0;if(!_0x241897[_0xdf26('0x50')][_0xdf26('0x54')])return;return db[_0xdf26('0x55')][_0xdf26('0x36')]({'attributes':['id','name'],'where':{'id':_0x241897[_0xdf26('0x50')][_0xdf26('0x54')]}});})[_0xdf26('0x10')](function(_0x72b94e){if(_0x72b94e){_0x241897[_0xdf26('0x3e')][_0xdf26('0x56')]({'id':0x0,'priority':0x0,'app':_0xdf26('0x57'),'appdata':_0x72b94e[_0xdf26('0x58')]+','+(_0x241897[_0xdf26('0x43')][_0xdf26('0x59')]||0xa),'interval':_0xdf26('0x4e')});}if(!_0x241897[_0xdf26('0x50')][_0xdf26('0x5a')])return;return db[_0xdf26('0x5b')][_0xdf26('0x36')]({'attributes':['id',_0xdf26('0x58')],'where':{'id':_0x241897['interaction'][_0xdf26('0x5a')]}});})[_0xdf26('0x10')](function(_0x20275f){if(_0x20275f){_0x241897[_0xdf26('0x3e')][_0xdf26('0x56')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x20275f[_0xdf26('0x58')]+','+(_0x241897[_0xdf26('0x43')][_0xdf26('0x5c')]||0x12c),'interval':_0xdf26('0x4e')});}return respondWithRpcPromise(_0xdf26('0x5d'),_0xdf26('0x5e'),_0x241897);})[_0xdf26('0x10')](function(_0x330ebf){_0x49dccc(_0x330ebf);})[_0xdf26('0x1a')](function(_0x401635){_0x274640(_0x4be833[_0xdf26('0x16')](0x1f4,_0x401635['message']));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 404d7d3..179c51c 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 _0x9200=['update','emit','./faxAccount.events','save','remove'];(function(_0x1360f5,_0x551fb8){var _0x1b8702=function(_0x3836c6){while(--_0x3836c6){_0x1360f5['push'](_0x1360f5['shift']());}};_0x1b8702(++_0x551fb8);}(_0x9200,0x18d));var _0x0920=function(_0x1ee749,_0x347f3e){_0x1ee749=_0x1ee749-0x0;var _0x202829=_0x9200[_0x1ee749];return _0x202829;};'use strict';var FaxAccountEvents=require(_0x0920('0x0'));var events=[_0x0920('0x1'),_0x0920('0x2'),_0x0920('0x3')];function createListener(_0x44e9a1,_0x55c66e){return function(_0x573a5d){_0x55c66e[_0x0920('0x4')](_0x44e9a1,_0x573a5d);};}function removeListener(_0x1a421d,_0x1ed463){return function(){FaxAccountEvents['removeListener'](_0x1a421d,_0x1ed463);};}exports['register']=function(_0x595c1d){for(var _0x119fea=0x0,_0x527f65=events['length'];_0x119fea<_0x527f65;_0x119fea++){var _0xff4835=events[_0x119fea];var _0x548c84=createListener('faxAccount:'+_0xff4835,_0x595c1d);FaxAccountEvents['on'](_0xff4835,_0x548c84);}}; \ No newline at end of file +var _0x6a58=['remove','emit','removeListener','register','length','save'];(function(_0x484d75,_0x29089d){var _0x4cfd22=function(_0x3cf399){while(--_0x3cf399){_0x484d75['push'](_0x484d75['shift']());}};_0x4cfd22(++_0x29089d);}(_0x6a58,0x18b));var _0x86a5=function(_0x236d24,_0x29e80a){_0x236d24=_0x236d24-0x0;var _0x1574cf=_0x6a58[_0x236d24];return _0x1574cf;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0x86a5('0x0'),_0x86a5('0x1'),'update'];function createListener(_0x59505c,_0x2a6eab){return function(_0x19123d){_0x2a6eab[_0x86a5('0x2')](_0x59505c,_0x19123d);};}function removeListener(_0x2c0612,_0x14946a){return function(){FaxAccountEvents[_0x86a5('0x3')](_0x2c0612,_0x14946a);};}exports[_0x86a5('0x4')]=function(_0x135549){for(var _0x53ba11=0x0,_0x5d9108=events[_0x86a5('0x5')];_0x53ba11<_0x5d9108;_0x53ba11++){var _0x239a21=events[_0x53ba11];var _0x24e911=createListener('faxAccount:'+_0x239a21,_0x135549);FaxAccountEvents['on'](_0x239a21,_0x24e911);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index f2fe2f8..ad2e9e0 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 _0x12b8=['/describe','show','getDispositions','/:id/canned_answers','getAnswers','/:id/interactions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/users','post','/:id/dispositions','addAnswer','addInteraction','addAccountApplications','/updateaccountapplications','updateAccountApplications','send','put','/:id','update','destroy','removeDispositions','removeAnswers','delete','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','isAuthenticated'];(function(_0x26bd8e,_0x2a9fdf){var _0x3a659d=function(_0x1b82cd){while(--_0x1b82cd){_0x26bd8e['push'](_0x26bd8e['shift']());}};_0x3a659d(++_0x2a9fdf);}(_0x12b8,0x133));var _0x812b=function(_0x30309a,_0x325481){_0x30309a=_0x30309a-0x0;var _0x5c9b16=_0x12b8[_0x30309a];return _0x5c9b16;};'use strict';var multer=require(_0x812b('0x0'));var util=require(_0x812b('0x1'));var path=require(_0x812b('0x2'));var timeout=require(_0x812b('0x3'));var express=require(_0x812b('0x4'));var router=express[_0x812b('0x5')]();var fs_extra=require(_0x812b('0x6'));var auth=require(_0x812b('0x7'));var interaction=require(_0x812b('0x8'));var config=require(_0x812b('0x9'));var controller=require(_0x812b('0xa'));router[_0x812b('0xb')]('/',auth[_0x812b('0xc')](),controller['index']);router['get'](_0x812b('0xd'),auth[_0x812b('0xc')](),controller['describe']);router[_0x812b('0xb')]('/:id',auth[_0x812b('0xc')](),controller[_0x812b('0xe')]);router['get']('/:id/dispositions',auth[_0x812b('0xc')](),controller[_0x812b('0xf')]);router[_0x812b('0xb')](_0x812b('0x10'),auth[_0x812b('0xc')](),controller[_0x812b('0x11')]);router[_0x812b('0xb')](_0x812b('0x12'),auth['isAuthenticated'](),controller['getInteractions']);router[_0x812b('0xb')](_0x812b('0x13'),auth[_0x812b('0xc')](),controller[_0x812b('0x14')]);router['get'](_0x812b('0x15'),auth[_0x812b('0xc')](),controller[_0x812b('0x16')]);router[_0x812b('0xb')](_0x812b('0x17'),auth[_0x812b('0xc')](),controller['getAgents']);router[_0x812b('0x18')]('/',auth['isAuthenticated'](),controller['create']);router[_0x812b('0x18')](_0x812b('0x19'),auth[_0x812b('0xc')](),controller['addDisposition']);router[_0x812b('0x18')]('/:id/canned_answers',auth[_0x812b('0xc')](),controller[_0x812b('0x1a')]);router[_0x812b('0x18')](_0x812b('0x12'),auth[_0x812b('0xc')](),controller[_0x812b('0x1b')]);router[_0x812b('0x18')](_0x812b('0x13'),auth[_0x812b('0xc')](),controller['addApplications']);router['post']('/addaccountapplications',auth[_0x812b('0xc')](),controller[_0x812b('0x1c')]);router[_0x812b('0x18')](_0x812b('0x1d'),auth[_0x812b('0xc')](),controller[_0x812b('0x1e')]);router['post']('/:id/send',auth['isAuthenticated'](),controller[_0x812b('0x1f')]);router[_0x812b('0x18')](_0x812b('0x17'),auth[_0x812b('0xc')](),controller['addAgents']);router[_0x812b('0x20')](_0x812b('0x21'),auth[_0x812b('0xc')](),controller[_0x812b('0x22')]);router['delete']('/:id',auth[_0x812b('0xc')](),controller[_0x812b('0x23')]);router['delete'](_0x812b('0x19'),auth[_0x812b('0xc')](),controller[_0x812b('0x24')]);router['delete']('/:id/canned_answers',auth[_0x812b('0xc')](),controller[_0x812b('0x25')]);router[_0x812b('0x26')]('/:id/users',auth[_0x812b('0xc')](),controller[_0x812b('0x27')]);module['exports']=router; \ No newline at end of file +var _0x58a1=['removeAnswers','removeAgents','exports','path','connect-timeout','express','../../config/environment','get','isAuthenticated','/describe','describe','/:id','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','send','addAgents','put','update','delete','destroy','removeDispositions'];(function(_0x50d80b,_0x221be4){var _0x3a8af5=function(_0x57f8e7){while(--_0x57f8e7){_0x50d80b['push'](_0x50d80b['shift']());}};_0x3a8af5(++_0x221be4);}(_0x58a1,0xbc));var _0x158a=function(_0x21125f,_0x8079f8){_0x21125f=_0x21125f-0x0;var _0x2f421d=_0x58a1[_0x21125f];return _0x2f421d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x158a('0x0'));var timeout=require(_0x158a('0x1'));var express=require(_0x158a('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x158a('0x3'));var controller=require('./faxAccount.controller');router[_0x158a('0x4')]('/',auth[_0x158a('0x5')](),controller['index']);router['get'](_0x158a('0x6'),auth[_0x158a('0x5')](),controller[_0x158a('0x7')]);router[_0x158a('0x4')](_0x158a('0x8'),auth[_0x158a('0x5')](),controller['show']);router[_0x158a('0x4')](_0x158a('0x9'),auth['isAuthenticated'](),controller['getDispositions']);router['get'](_0x158a('0xa'),auth['isAuthenticated'](),controller[_0x158a('0xb')]);router[_0x158a('0x4')](_0x158a('0xc'),auth[_0x158a('0x5')](),controller[_0x158a('0xd')]);router['get'](_0x158a('0xe'),auth[_0x158a('0x5')](),controller['getApplications']);router[_0x158a('0x4')](_0x158a('0xf'),auth[_0x158a('0x5')](),controller[_0x158a('0x10')]);router[_0x158a('0x4')](_0x158a('0x11'),auth[_0x158a('0x5')](),controller[_0x158a('0x12')]);router[_0x158a('0x13')]('/',auth[_0x158a('0x5')](),controller[_0x158a('0x14')]);router[_0x158a('0x13')](_0x158a('0x9'),auth[_0x158a('0x5')](),controller[_0x158a('0x15')]);router['post'](_0x158a('0xa'),auth['isAuthenticated'](),controller[_0x158a('0x16')]);router['post']('/:id/interactions',auth['isAuthenticated'](),controller['addInteraction']);router[_0x158a('0x13')](_0x158a('0xe'),auth[_0x158a('0x5')](),controller[_0x158a('0x17')]);router[_0x158a('0x13')](_0x158a('0x18'),auth[_0x158a('0x5')](),controller[_0x158a('0x19')]);router[_0x158a('0x13')](_0x158a('0x1a'),auth[_0x158a('0x5')](),controller['updateAccountApplications']);router[_0x158a('0x13')]('/:id/send',auth[_0x158a('0x5')](),controller[_0x158a('0x1b')]);router[_0x158a('0x13')](_0x158a('0x11'),auth[_0x158a('0x5')](),controller[_0x158a('0x1c')]);router[_0x158a('0x1d')](_0x158a('0x8'),auth[_0x158a('0x5')](),controller[_0x158a('0x1e')]);router[_0x158a('0x1f')](_0x158a('0x8'),auth[_0x158a('0x5')](),controller[_0x158a('0x20')]);router[_0x158a('0x1f')]('/:id/dispositions',auth[_0x158a('0x5')](),controller[_0x158a('0x21')]);router[_0x158a('0x1f')](_0x158a('0xa'),auth[_0x158a('0x5')](),controller[_0x158a('0x22')]);router['delete'](_0x158a('0x11'),auth[_0x158a('0x5')](),controller[_0x158a('0x23')]);module[_0x158a('0x24')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 045ec61..783cc74 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 _0xb1ed=['noop','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x18cac4,_0x57a4d5){var _0x2227c6=function(_0x72934d){while(--_0x72934d){_0x18cac4['push'](_0x18cac4['shift']());}};_0x2227c6(++_0x57a4d5);}(_0xb1ed,0xf2));var _0xdb1e=function(_0x37e342,_0x160c8f){_0x37e342=_0x37e342-0x0;var _0x1768f9=_0xb1ed[_0x37e342];return _0x1768f9;};'use strict';var Sequelize=require(_0xdb1e('0x0'));module[_0xdb1e('0x1')]={'priority':{'type':Sequelize[_0xdb1e('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xdb1e('0x3')],'allowNull':![],'defaultValue':_0xdb1e('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xdb1e('0x3')]},'interval':{'type':Sequelize[_0xdb1e('0x3')],'defaultValue':_0xdb1e('0x5')}}; \ No newline at end of file +var _0xc735=['noop','TEXT','*,*,*,*','sequelize','exports','STRING'];(function(_0x57f29e,_0x352c43){var _0x5a66f4=function(_0x2fb252){while(--_0x2fb252){_0x57f29e['push'](_0x57f29e['shift']());}};_0x5a66f4(++_0x352c43);}(_0xc735,0x8d));var _0x5c73=function(_0x444d5a,_0x5d95d1){_0x444d5a=_0x444d5a-0x0;var _0xf6b58f=_0xc735[_0x444d5a];return _0xf6b58f;};'use strict';var Sequelize=require(_0x5c73('0x0'));module[_0x5c73('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x5c73('0x2')],'allowNull':![],'defaultValue':_0x5c73('0x3')},'appdata':{'type':Sequelize[_0x5c73('0x4')]()},'description':{'type':Sequelize[_0x5c73('0x2')]},'interval':{'type':Sequelize[_0x5c73('0x2')],'defaultValue':_0x5c73('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 474da19..6ae3aa4 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 _0xbd46=['undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','map','rawAttributes','fieldName','key','query','model','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','FaxApplication','findAll','catch','show','params','keys','intersection','length','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','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/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0xbd46,0x117));var _0x6bd4=function(_0x295a3d,_0x56d487){_0x295a3d=_0x295a3d-0x0;var _0x23a732=_0xbd46[_0x295a3d];return _0x23a732;};'use strict';var emlformat=require(_0x6bd4('0x0'));var rimraf=require(_0x6bd4('0x1'));var zipdir=require(_0x6bd4('0x2'));var jsonpatch=require(_0x6bd4('0x3'));var rp=require('request-promise');var moment=require(_0x6bd4('0x4'));var BPromise=require(_0x6bd4('0x5'));var Mustache=require(_0x6bd4('0x6'));var util=require('util');var path=require(_0x6bd4('0x7'));var sox=require('sox');var csv=require(_0x6bd4('0x8'));var ejs=require(_0x6bd4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6bd4('0xa'));var squel=require(_0x6bd4('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6bd4('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6bd4('0xd'));var Papa=require('papaparse');var Redis=require(_0x6bd4('0xe'));var authService=require(_0x6bd4('0xf'));var qs=require(_0x6bd4('0x10'));var as=require(_0x6bd4('0x11'));var hardwareService=require(_0x6bd4('0x12'));var logger=require(_0x6bd4('0x13'))(_0x6bd4('0x14'));var utils=require(_0x6bd4('0x15'));var config=require(_0x6bd4('0x16'));var licenseUtil=require(_0x6bd4('0x17'));var db=require(_0x6bd4('0x18'))['db'];function respondWithStatusCode(_0x23dad9,_0x2ddf2f){_0x2ddf2f=_0x2ddf2f||0xcc;return function(_0x3d8088){if(_0x3d8088){return _0x23dad9[_0x6bd4('0x19')](_0x2ddf2f);}return _0x23dad9[_0x6bd4('0x1a')](_0x2ddf2f)[_0x6bd4('0x1b')]();};}function respondWithResult(_0x42d235,_0x21f9c2){_0x21f9c2=_0x21f9c2||0xc8;return function(_0x15189c){if(_0x15189c){return _0x42d235[_0x6bd4('0x1a')](_0x21f9c2)['json'](_0x15189c);}};}function respondWithFilteredResult(_0x610953,_0x4f747c){return function(_0xe76c0e){if(_0xe76c0e){var _0x1a00eb=typeof _0x4f747c[_0x6bd4('0x1c')]===_0x6bd4('0x1d')&&typeof _0x4f747c[_0x6bd4('0x1e')]===_0x6bd4('0x1d');var _0xfb103b=_0xe76c0e[_0x6bd4('0x1f')];var _0x422e04=_0x1a00eb?0x0:_0x4f747c[_0x6bd4('0x1c')];var _0x427611=_0x1a00eb?_0xe76c0e[_0x6bd4('0x1f')]:_0x4f747c[_0x6bd4('0x1c')]+_0x4f747c[_0x6bd4('0x1e')];var _0x2d3506;if(_0x427611>=_0xfb103b){_0x427611=_0xfb103b;_0x2d3506=0xc8;}else{_0x2d3506=0xce;}_0x610953[_0x6bd4('0x1a')](_0x2d3506);return _0x610953[_0x6bd4('0x20')](_0x6bd4('0x21'),_0x422e04+'-'+_0x427611+'/'+_0xfb103b)[_0x6bd4('0x22')](_0xe76c0e);}return null;};}function patchUpdates(_0x2b3f22){return function(_0x2a1c41){try{jsonpatch[_0x6bd4('0x23')](_0x2a1c41,_0x2b3f22,!![]);}catch(_0x415c3f){return BPromise[_0x6bd4('0x24')](_0x415c3f);}return _0x2a1c41[_0x6bd4('0x25')]();};}function saveUpdates(_0x593ff3,_0x56e2a5){return function(_0x2dc48b){if(_0x2dc48b){return _0x2dc48b[_0x6bd4('0x26')](_0x593ff3)[_0x6bd4('0x27')](function(_0x199bf9){return _0x199bf9;});}return null;};}function removeEntity(_0x4d48f1,_0x2ced72){return function(_0xf1bdbb){if(_0xf1bdbb){return _0xf1bdbb[_0x6bd4('0x28')]()[_0x6bd4('0x27')](function(){_0x4d48f1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e8035,_0x29acf9){return function(_0x269eb4){if(!_0x269eb4){_0x1e8035['sendStatus'](0x194);}return _0x269eb4;};}function handleError(_0x44fb07,_0x27ec91){_0x27ec91=_0x27ec91||0x1f4;return function(_0x464c5c){logger[_0x6bd4('0x29')](_0x464c5c[_0x6bd4('0x2a')]);if(_0x464c5c[_0x6bd4('0x2b')]){delete _0x464c5c[_0x6bd4('0x2b')];}_0x44fb07['status'](_0x27ec91)['send'](_0x464c5c);};}exports['index']=function(_0x277d17,_0x30064f){var _0x569e66={},_0x4679c8={},_0x13c227={'count':0x0,'rows':[]};var _0x127430=_[_0x6bd4('0x2c')](db['FaxApplication'][_0x6bd4('0x2d')],function(_0xdf9262){return{'name':_0xdf9262[_0x6bd4('0x2e')],'type':_0xdf9262['type'][_0x6bd4('0x2f')]};});_0x4679c8['model']=_[_0x6bd4('0x2c')](_0x127430,'name');_0x4679c8[_0x6bd4('0x30')]=_['keys'](_0x277d17[_0x6bd4('0x30')]);_0x4679c8['filters']=_['intersection'](_0x4679c8[_0x6bd4('0x31')],_0x4679c8[_0x6bd4('0x30')]);_0x569e66['attributes']=_['intersection'](_0x4679c8[_0x6bd4('0x31')],qs[_0x6bd4('0x32')](_0x277d17[_0x6bd4('0x30')][_0x6bd4('0x32')]));_0x569e66[_0x6bd4('0x33')]=_0x569e66[_0x6bd4('0x33')]['length']?_0x569e66[_0x6bd4('0x33')]:_0x4679c8[_0x6bd4('0x31')];if(!_0x277d17[_0x6bd4('0x30')][_0x6bd4('0x34')](_0x6bd4('0x35'))){_0x569e66[_0x6bd4('0x1e')]=qs[_0x6bd4('0x1e')](_0x277d17[_0x6bd4('0x30')][_0x6bd4('0x1e')]);_0x569e66[_0x6bd4('0x1c')]=qs[_0x6bd4('0x1c')](_0x277d17[_0x6bd4('0x30')][_0x6bd4('0x1c')]);}_0x569e66[_0x6bd4('0x36')]=qs[_0x6bd4('0x37')](_0x277d17[_0x6bd4('0x30')][_0x6bd4('0x37')]);_0x569e66['where']=qs[_0x6bd4('0x38')](_[_0x6bd4('0x39')](_0x277d17[_0x6bd4('0x30')],_0x4679c8['filters']),_0x127430);if(_0x277d17['query'][_0x6bd4('0x3a')]){_0x569e66[_0x6bd4('0x3b')]=_[_0x6bd4('0x3c')](_0x569e66[_0x6bd4('0x3b')],{'$or':_['map'](_0x127430,function(_0x2e3e78){if(_0x2e3e78[_0x6bd4('0x3d')]!==_0x6bd4('0x3e')){var _0x3f5c15={};_0x3f5c15[_0x2e3e78[_0x6bd4('0x2b')]]={'$like':'%'+_0x277d17[_0x6bd4('0x30')]['filter']+'%'};return _0x3f5c15;}})});}_0x569e66=_['merge']({},_0x569e66,_0x277d17[_0x6bd4('0x3f')]);var _0x29ecf7={'where':_0x569e66['where']};return db['FaxApplication'][_0x6bd4('0x1f')](_0x29ecf7)[_0x6bd4('0x27')](function(_0x38fd52){_0x13c227[_0x6bd4('0x1f')]=_0x38fd52;if(_0x277d17[_0x6bd4('0x30')][_0x6bd4('0x40')]){_0x569e66[_0x6bd4('0x41')]=[{'all':!![]}];}return db[_0x6bd4('0x42')][_0x6bd4('0x43')](_0x569e66);})[_0x6bd4('0x27')](function(_0xfc5cb2){_0x13c227['rows']=_0xfc5cb2;return _0x13c227;})[_0x6bd4('0x27')](respondWithFilteredResult(_0x30064f,_0x569e66))[_0x6bd4('0x44')](handleError(_0x30064f,null));};exports[_0x6bd4('0x45')]=function(_0x3c8795,_0x384bcc){var _0x37828b={'raw':!![],'where':{'id':_0x3c8795[_0x6bd4('0x46')]['id']}},_0x15518a={};_0x15518a[_0x6bd4('0x31')]=_[_0x6bd4('0x47')](db[_0x6bd4('0x42')][_0x6bd4('0x2d')]);_0x15518a['query']=_[_0x6bd4('0x47')](_0x3c8795[_0x6bd4('0x30')]);_0x15518a[_0x6bd4('0x38')]=_['intersection'](_0x15518a[_0x6bd4('0x31')],_0x15518a[_0x6bd4('0x30')]);_0x37828b['attributes']=_[_0x6bd4('0x48')](_0x15518a[_0x6bd4('0x31')],qs[_0x6bd4('0x32')](_0x3c8795[_0x6bd4('0x30')][_0x6bd4('0x32')]));_0x37828b[_0x6bd4('0x33')]=_0x37828b[_0x6bd4('0x33')][_0x6bd4('0x49')]?_0x37828b[_0x6bd4('0x33')]:_0x15518a[_0x6bd4('0x31')];if(_0x3c8795[_0x6bd4('0x30')][_0x6bd4('0x40')]){_0x37828b['include']=[{'all':!![]}];}_0x37828b=_[_0x6bd4('0x3c')]({},_0x37828b,_0x3c8795[_0x6bd4('0x3f')]);return db[_0x6bd4('0x42')]['find'](_0x37828b)[_0x6bd4('0x27')](handleEntityNotFound(_0x384bcc,null))['then'](respondWithResult(_0x384bcc,null))[_0x6bd4('0x44')](handleError(_0x384bcc,null));};exports[_0x6bd4('0x4a')]=function(_0x232ff9,_0x125190){return db[_0x6bd4('0x42')]['create'](_0x232ff9[_0x6bd4('0x4b')],{})[_0x6bd4('0x27')](respondWithResult(_0x125190,0xc9))[_0x6bd4('0x44')](handleError(_0x125190,null));};exports[_0x6bd4('0x26')]=function(_0x3db9f3,_0x13dfbf){if(_0x3db9f3[_0x6bd4('0x4b')]['id']){delete _0x3db9f3[_0x6bd4('0x4b')]['id'];}return db['FaxApplication']['find']({'where':{'id':_0x3db9f3[_0x6bd4('0x46')]['id']}})['then'](handleEntityNotFound(_0x13dfbf,null))[_0x6bd4('0x27')](saveUpdates(_0x3db9f3[_0x6bd4('0x4b')],null))[_0x6bd4('0x27')](respondWithResult(_0x13dfbf,null))[_0x6bd4('0x44')](handleError(_0x13dfbf,null));};exports[_0x6bd4('0x28')]=function(_0x5b21d1,_0x51635e){return db[_0x6bd4('0x42')][_0x6bd4('0x4c')]({'where':{'id':_0x5b21d1[_0x6bd4('0x46')]['id']}})[_0x6bd4('0x27')](handleEntityNotFound(_0x51635e,null))[_0x6bd4('0x27')](removeEntity(_0x51635e,null))[_0x6bd4('0x44')](handleError(_0x51635e,null));}; \ No newline at end of file +var _0xd885=['../../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','limit','offset','set','json','apply','save','update','then','destroy','error','stack','name','send','index','map','FaxApplication','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','length','nolimit','where','pick','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','catch','show','params','keys','fields','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','jsforce','papaparse','ioredis'];(function(_0x2b3c9d,_0x1c8c0c){var _0x4b8037=function(_0x225327){while(--_0x225327){_0x2b3c9d['push'](_0x2b3c9d['shift']());}};_0x4b8037(++_0x1c8c0c);}(_0xd885,0x118));var _0x5d88=function(_0x31bace,_0x570dd4){_0x31bace=_0x31bace-0x0;var _0x261cba=_0xd885[_0x31bace];return _0x261cba;};'use strict';var emlformat=require(_0x5d88('0x0'));var rimraf=require(_0x5d88('0x1'));var zipdir=require(_0x5d88('0x2'));var jsonpatch=require(_0x5d88('0x3'));var rp=require(_0x5d88('0x4'));var moment=require(_0x5d88('0x5'));var BPromise=require(_0x5d88('0x6'));var Mustache=require('mustache');var util=require(_0x5d88('0x7'));var path=require(_0x5d88('0x8'));var sox=require(_0x5d88('0x9'));var csv=require(_0x5d88('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5d88('0xb'));var _=require('lodash');var squel=require(_0x5d88('0xc'));var crypto=require('crypto');var jsforce=require(_0x5d88('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5d88('0xa'));var querystring=require('querystring');var Papa=require(_0x5d88('0xe'));var Redis=require(_0x5d88('0xf'));var authService=require(_0x5d88('0x10'));var qs=require(_0x5d88('0x11'));var as=require(_0x5d88('0x12'));var hardwareService=require(_0x5d88('0x13'));var logger=require(_0x5d88('0x14'))(_0x5d88('0x15'));var utils=require(_0x5d88('0x16'));var config=require(_0x5d88('0x17'));var licenseUtil=require(_0x5d88('0x18'));var db=require(_0x5d88('0x19'))['db'];function respondWithStatusCode(_0x534f84,_0x4a0c84){_0x4a0c84=_0x4a0c84||0xcc;return function(_0x5281af){if(_0x5281af){return _0x534f84['sendStatus'](_0x4a0c84);}return _0x534f84[_0x5d88('0x1a')](_0x4a0c84)[_0x5d88('0x1b')]();};}function respondWithResult(_0x26d0c1,_0x1f037c){_0x1f037c=_0x1f037c||0xc8;return function(_0x14e0ca){if(_0x14e0ca){return _0x26d0c1[_0x5d88('0x1a')](_0x1f037c)['json'](_0x14e0ca);}};}function respondWithFilteredResult(_0x3ca087,_0x4992c4){return function(_0x54b186){if(_0x54b186){var _0x52ebef=typeof _0x4992c4['offset']==='undefined'&&typeof _0x4992c4[_0x5d88('0x1c')]==='undefined';var _0x22d4b=_0x54b186['count'];var _0x3fbe55=_0x52ebef?0x0:_0x4992c4['offset'];var _0x27f528=_0x52ebef?_0x54b186['count']:_0x4992c4[_0x5d88('0x1d')]+_0x4992c4[_0x5d88('0x1c')];var _0x1181cd;if(_0x27f528>=_0x22d4b){_0x27f528=_0x22d4b;_0x1181cd=0xc8;}else{_0x1181cd=0xce;}_0x3ca087[_0x5d88('0x1a')](_0x1181cd);return _0x3ca087[_0x5d88('0x1e')]('Content-Range',_0x3fbe55+'-'+_0x27f528+'/'+_0x22d4b)[_0x5d88('0x1f')](_0x54b186);}return null;};}function patchUpdates(_0x135828){return function(_0x34b522){try{jsonpatch[_0x5d88('0x20')](_0x34b522,_0x135828,!![]);}catch(_0x5689cd){return BPromise['reject'](_0x5689cd);}return _0x34b522[_0x5d88('0x21')]();};}function saveUpdates(_0x289e8e,_0x3c95a1){return function(_0x4d831c){if(_0x4d831c){return _0x4d831c[_0x5d88('0x22')](_0x289e8e)[_0x5d88('0x23')](function(_0x5f1586){return _0x5f1586;});}return null;};}function removeEntity(_0x406825,_0x201933){return function(_0x346224){if(_0x346224){return _0x346224[_0x5d88('0x24')]()[_0x5d88('0x23')](function(){_0x406825[_0x5d88('0x1a')](0xcc)[_0x5d88('0x1b')]();});}};}function handleEntityNotFound(_0x55e5e5,_0x11b6e2){return function(_0x17c5a6){if(!_0x17c5a6){_0x55e5e5['sendStatus'](0x194);}return _0x17c5a6;};}function handleError(_0x103629,_0x343a34){_0x343a34=_0x343a34||0x1f4;return function(_0x423ec3){logger[_0x5d88('0x25')](_0x423ec3[_0x5d88('0x26')]);if(_0x423ec3[_0x5d88('0x27')]){delete _0x423ec3[_0x5d88('0x27')];}_0x103629['status'](_0x343a34)[_0x5d88('0x28')](_0x423ec3);};}exports[_0x5d88('0x29')]=function(_0x4d912f,_0x5462cc){var _0x296556={},_0x5adcb3={},_0x46a0b5={'count':0x0,'rows':[]};var _0x53cf69=_[_0x5d88('0x2a')](db[_0x5d88('0x2b')][_0x5d88('0x2c')],function(_0x5ceab6){return{'name':_0x5ceab6[_0x5d88('0x2d')],'type':_0x5ceab6[_0x5d88('0x2e')][_0x5d88('0x2f')]};});_0x5adcb3[_0x5d88('0x30')]=_['map'](_0x53cf69,_0x5d88('0x27'));_0x5adcb3[_0x5d88('0x31')]=_['keys'](_0x4d912f[_0x5d88('0x31')]);_0x5adcb3[_0x5d88('0x32')]=_['intersection'](_0x5adcb3[_0x5d88('0x30')],_0x5adcb3['query']);_0x296556[_0x5d88('0x33')]=_[_0x5d88('0x34')](_0x5adcb3[_0x5d88('0x30')],qs['fields'](_0x4d912f['query']['fields']));_0x296556['attributes']=_0x296556['attributes'][_0x5d88('0x35')]?_0x296556[_0x5d88('0x33')]:_0x5adcb3[_0x5d88('0x30')];if(!_0x4d912f[_0x5d88('0x31')]['hasOwnProperty'](_0x5d88('0x36'))){_0x296556[_0x5d88('0x1c')]=qs[_0x5d88('0x1c')](_0x4d912f[_0x5d88('0x31')][_0x5d88('0x1c')]);_0x296556[_0x5d88('0x1d')]=qs[_0x5d88('0x1d')](_0x4d912f[_0x5d88('0x31')][_0x5d88('0x1d')]);}_0x296556['order']=qs['sort'](_0x4d912f[_0x5d88('0x31')]['sort']);_0x296556[_0x5d88('0x37')]=qs[_0x5d88('0x32')](_[_0x5d88('0x38')](_0x4d912f['query'],_0x5adcb3['filters']),_0x53cf69);if(_0x4d912f[_0x5d88('0x31')]['filter']){_0x296556[_0x5d88('0x37')]=_[_0x5d88('0x39')](_0x296556[_0x5d88('0x37')],{'$or':_[_0x5d88('0x2a')](_0x53cf69,function(_0x12c773){if(_0x12c773['type']!==_0x5d88('0x3a')){var _0x1a3ecc={};_0x1a3ecc[_0x12c773[_0x5d88('0x27')]]={'$like':'%'+_0x4d912f[_0x5d88('0x31')][_0x5d88('0x3b')]+'%'};return _0x1a3ecc;}})});}_0x296556=_['merge']({},_0x296556,_0x4d912f[_0x5d88('0x3c')]);var _0x3c4a60={'where':_0x296556[_0x5d88('0x37')]};return db[_0x5d88('0x2b')][_0x5d88('0x3d')](_0x3c4a60)[_0x5d88('0x23')](function(_0x5e8809){_0x46a0b5[_0x5d88('0x3d')]=_0x5e8809;if(_0x4d912f[_0x5d88('0x31')][_0x5d88('0x3e')]){_0x296556[_0x5d88('0x3f')]=[{'all':!![]}];}return db[_0x5d88('0x2b')][_0x5d88('0x40')](_0x296556);})[_0x5d88('0x23')](function(_0x7d9deb){_0x46a0b5[_0x5d88('0x41')]=_0x7d9deb;return _0x46a0b5;})[_0x5d88('0x23')](respondWithFilteredResult(_0x5462cc,_0x296556))[_0x5d88('0x42')](handleError(_0x5462cc,null));};exports[_0x5d88('0x43')]=function(_0x52c412,_0x19fc74){var _0x58e2ee={'raw':!![],'where':{'id':_0x52c412[_0x5d88('0x44')]['id']}},_0x5b2072={};_0x5b2072[_0x5d88('0x30')]=_['keys'](db['FaxApplication'][_0x5d88('0x2c')]);_0x5b2072[_0x5d88('0x31')]=_[_0x5d88('0x45')](_0x52c412['query']);_0x5b2072[_0x5d88('0x32')]=_['intersection'](_0x5b2072[_0x5d88('0x30')],_0x5b2072['query']);_0x58e2ee[_0x5d88('0x33')]=_['intersection'](_0x5b2072[_0x5d88('0x30')],qs[_0x5d88('0x46')](_0x52c412[_0x5d88('0x31')][_0x5d88('0x46')]));_0x58e2ee[_0x5d88('0x33')]=_0x58e2ee['attributes']['length']?_0x58e2ee[_0x5d88('0x33')]:_0x5b2072[_0x5d88('0x30')];if(_0x52c412[_0x5d88('0x31')][_0x5d88('0x3e')]){_0x58e2ee[_0x5d88('0x3f')]=[{'all':!![]}];}_0x58e2ee=_[_0x5d88('0x39')]({},_0x58e2ee,_0x52c412[_0x5d88('0x3c')]);return db[_0x5d88('0x2b')][_0x5d88('0x47')](_0x58e2ee)[_0x5d88('0x23')](handleEntityNotFound(_0x19fc74,null))[_0x5d88('0x23')](respondWithResult(_0x19fc74,null))[_0x5d88('0x42')](handleError(_0x19fc74,null));};exports[_0x5d88('0x48')]=function(_0x13082c,_0x79f4c4){return db[_0x5d88('0x2b')]['create'](_0x13082c[_0x5d88('0x49')],{})[_0x5d88('0x23')](respondWithResult(_0x79f4c4,0xc9))[_0x5d88('0x42')](handleError(_0x79f4c4,null));};exports[_0x5d88('0x22')]=function(_0xd48783,_0x49900d){if(_0xd48783['body']['id']){delete _0xd48783[_0x5d88('0x49')]['id'];}return db[_0x5d88('0x2b')]['find']({'where':{'id':_0xd48783['params']['id']}})[_0x5d88('0x23')](handleEntityNotFound(_0x49900d,null))[_0x5d88('0x23')](saveUpdates(_0xd48783['body'],null))[_0x5d88('0x23')](respondWithResult(_0x49900d,null))['catch'](handleError(_0x49900d,null));};exports[_0x5d88('0x24')]=function(_0x110cdd,_0x5d6b8b){return db[_0x5d88('0x2b')][_0x5d88('0x47')]({'where':{'id':_0x110cdd[_0x5d88('0x44')]['id']}})[_0x5d88('0x23')](handleEntityNotFound(_0x5d6b8b,null))[_0x5d88('0x23')](removeEntity(_0x5d6b8b,null))[_0x5d88('0x42')](handleError(_0x5d6b8b,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 4d6e468..dee9b50 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 _0xb5ad=['api','moment','rimraf','../../config/environment','exports','define','FaxApplication','fax_applications','utf8mb4','lodash','util','../../config/logger'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xb5ad,0x189));var _0xdb5a=function(_0x386c3e,_0x44a375){_0x386c3e=_0x386c3e-0x0;var _0x4b8e13=_0xb5ad[_0x386c3e];return _0x4b8e13;};'use strict';var _=require(_0xdb5a('0x0'));var util=require(_0xdb5a('0x1'));var logger=require(_0xdb5a('0x2'))(_0xdb5a('0x3'));var moment=require(_0xdb5a('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xdb5a('0x5'));var config=require(_0xdb5a('0x6'));var attributes=require('./faxApplication.attributes');module[_0xdb5a('0x7')]=function(_0x260f6e,_0x2551af){return _0x260f6e[_0xdb5a('0x8')](_0xdb5a('0x9'),attributes,{'tableName':_0xdb5a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdb5a('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x19c5=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x19c5,0x7c));var _0x519c=function(_0x2f9467,_0x40576f){_0x2f9467=_0x2f9467-0x0;var _0x39894c=_0x19c5[_0x2f9467];return _0x39894c;};'use strict';var _=require(_0x519c('0x0'));var util=require(_0x519c('0x1'));var logger=require(_0x519c('0x2'))(_0x519c('0x3'));var moment=require(_0x519c('0x4'));var BPromise=require(_0x519c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x519c('0x6'));var rimraf=require(_0x519c('0x7'));var config=require(_0x519c('0x8'));var attributes=require('./faxApplication.attributes');module[_0x519c('0x9')]=function(_0x3d1444,_0x35e1e3){return _0x3d1444['define'](_0x519c('0xa'),attributes,{'tableName':_0x519c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x519c('0xc'),'collate':_0x519c('0xd')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 126d2ef..65b8849 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 _0xfd02=['UpdateFaxApplication','FaxApplication','update','options','raw','debug','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','then','FaxApplication,\x20%s,\x20%s','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result'];(function(_0x257b0e,_0x563d7e){var _0x27ac2a=function(_0x3a4bbc){while(--_0x3a4bbc){_0x257b0e['push'](_0x257b0e['shift']());}};_0x27ac2a(++_0x563d7e);}(_0xfd02,0xbd));var _0x2fd0=function(_0x6978c0,_0x1f6765){_0x6978c0=_0x6978c0-0x0;var _0x361377=_0xfd02[_0x6978c0];return _0x361377;};'use strict';var _=require(_0x2fd0('0x0'));var util=require('util');var moment=require(_0x2fd0('0x1'));var BPromise=require(_0x2fd0('0x2'));var rs=require(_0x2fd0('0x3'));var fs=require('fs');var Redis=require(_0x2fd0('0x4'));var db=require(_0x2fd0('0x5'))['db'];var utils=require(_0x2fd0('0x6'));var logger=require(_0x2fd0('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2fd0('0x8')][_0x2fd0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2d3262,_0x30f13a,_0x1c7305){return new BPromise(function(_0x46cd1c,_0x412067){return client['request'](_0x2d3262,_0x1c7305)[_0x2fd0('0xa')](function(_0x405a98){logger['info'](_0x2fd0('0xb'),_0x30f13a,_0x2fd0('0xc'));logger['debug'](_0x2fd0('0xd'),_0x30f13a,'request\x20sent',JSON[_0x2fd0('0xe')](_0x405a98));if(_0x405a98['error']){if(_0x405a98[_0x2fd0('0xf')]['code']===0x1f4){logger[_0x2fd0('0xf')](_0x2fd0('0xb'),_0x30f13a,_0x405a98['error'][_0x2fd0('0x10')]);return _0x412067(_0x405a98[_0x2fd0('0xf')][_0x2fd0('0x10')]);}logger['error'](_0x2fd0('0xb'),_0x30f13a,_0x405a98[_0x2fd0('0xf')][_0x2fd0('0x10')]);return _0x46cd1c(_0x405a98[_0x2fd0('0xf')][_0x2fd0('0x10')]);}else{logger[_0x2fd0('0x11')](_0x2fd0('0xb'),_0x30f13a,_0x2fd0('0xc'));_0x46cd1c(_0x405a98[_0x2fd0('0x12')]['message']);}})['catch'](function(_0x149d6d){logger[_0x2fd0('0xf')]('FaxApplication,\x20%s,\x20%s',_0x30f13a,_0x149d6d);_0x412067(_0x149d6d);});});}exports[_0x2fd0('0x13')]=function(_0x34701e){var _0x36d42e=this;return new Promise(function(_0x2f7cd1,_0x14cb36){return db[_0x2fd0('0x14')][_0x2fd0('0x15')](_0x34701e['body'],{'raw':_0x34701e[_0x2fd0('0x16')]?_0x34701e[_0x2fd0('0x16')][_0x2fd0('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34701e[_0x2fd0('0x16')]?_0x34701e['options']['where']||null:null,'attributes':_0x34701e[_0x2fd0('0x16')]?_0x34701e[_0x2fd0('0x16')]['attributes']||null:null,'limit':_0x34701e[_0x2fd0('0x16')]?_0x34701e['options']['limit']||null:null})[_0x2fd0('0xa')](function(_0x1423df){logger[_0x2fd0('0x11')]('UpdateFaxApplication',_0x34701e);logger[_0x2fd0('0x18')](_0x2fd0('0x13'),_0x34701e,JSON[_0x2fd0('0xe')](_0x1423df));_0x2f7cd1(_0x1423df);})[_0x2fd0('0x19')](function(_0x27436f){logger[_0x2fd0('0xf')](_0x2fd0('0x13'),_0x27436f[_0x2fd0('0x10')],_0x34701e);_0x14cb36(_0x36d42e[_0x2fd0('0xf')](0x1f4,_0x27436f[_0x2fd0('0x10')]));});});}; \ No newline at end of file +var _0xf3c2=['client','http','request','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateFaxApplication','FaxApplication','body','options','raw','where','limit','then','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x9b6f48,_0x583963){var _0x96a18d=function(_0x5c37c3){while(--_0x5c37c3){_0x9b6f48['push'](_0x9b6f48['shift']());}};_0x96a18d(++_0x583963);}(_0xf3c2,0x14c));var _0x2f3c=function(_0x35f0fb,_0x26ef29){_0x35f0fb=_0x35f0fb-0x0;var _0x1a76b4=_0xf3c2[_0x35f0fb];return _0x1a76b4;};'use strict';var _=require(_0x2f3c('0x0'));var util=require('util');var moment=require(_0x2f3c('0x1'));var BPromise=require(_0x2f3c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2f3c('0x3'));var db=require(_0x2f3c('0x4'))['db'];var utils=require(_0x2f3c('0x5'));var logger=require(_0x2f3c('0x6'))(_0x2f3c('0x7'));var config=require(_0x2f3c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2f3c('0x9')][_0x2f3c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e415e,_0x8dbfd5,_0x5f00be){return new BPromise(function(_0x1f7126,_0x59fc66){return client[_0x2f3c('0xb')](_0x3e415e,_0x5f00be)['then'](function(_0x38a3cc){logger[_0x2f3c('0xc')](_0x2f3c('0xd'),_0x8dbfd5,_0x2f3c('0xe'));logger[_0x2f3c('0xf')](_0x2f3c('0x10'),_0x8dbfd5,_0x2f3c('0xe'),JSON[_0x2f3c('0x11')](_0x38a3cc));if(_0x38a3cc[_0x2f3c('0x12')]){if(_0x38a3cc['error'][_0x2f3c('0x13')]===0x1f4){logger[_0x2f3c('0x12')](_0x2f3c('0xd'),_0x8dbfd5,_0x38a3cc[_0x2f3c('0x12')][_0x2f3c('0x14')]);return _0x59fc66(_0x38a3cc[_0x2f3c('0x12')]['message']);}logger[_0x2f3c('0x12')](_0x2f3c('0xd'),_0x8dbfd5,_0x38a3cc[_0x2f3c('0x12')][_0x2f3c('0x14')]);return _0x1f7126(_0x38a3cc[_0x2f3c('0x12')][_0x2f3c('0x14')]);}else{logger[_0x2f3c('0xc')](_0x2f3c('0xd'),_0x8dbfd5,_0x2f3c('0xe'));_0x1f7126(_0x38a3cc[_0x2f3c('0x15')][_0x2f3c('0x14')]);}})['catch'](function(_0x2635f4){logger[_0x2f3c('0x12')](_0x2f3c('0xd'),_0x8dbfd5,_0x2635f4);_0x59fc66(_0x2635f4);});});}exports[_0x2f3c('0x16')]=function(_0x548686){var _0x102c4d=this;return new Promise(function(_0x42f85e,_0x20e50b){return db[_0x2f3c('0x17')]['update'](_0x548686[_0x2f3c('0x18')],{'raw':_0x548686[_0x2f3c('0x19')]?_0x548686[_0x2f3c('0x19')][_0x2f3c('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x548686[_0x2f3c('0x19')]?_0x548686[_0x2f3c('0x19')][_0x2f3c('0x1b')]||null:null,'attributes':_0x548686[_0x2f3c('0x19')]?_0x548686[_0x2f3c('0x19')]['attributes']||null:null,'limit':_0x548686[_0x2f3c('0x19')]?_0x548686[_0x2f3c('0x19')][_0x2f3c('0x1c')]||null:null})[_0x2f3c('0x1d')](function(_0x4a8076){logger['info'](_0x2f3c('0x16'),_0x548686);logger[_0x2f3c('0xf')](_0x2f3c('0x16'),_0x548686,JSON[_0x2f3c('0x11')](_0x4a8076));_0x42f85e(_0x4a8076);})[_0x2f3c('0x1e')](function(_0x29ceb0){logger[_0x2f3c('0x12')](_0x2f3c('0x16'),_0x29ceb0[_0x2f3c('0x14')],_0x548686);_0x20e50b(_0x102c4d['error'](0x1f4,_0x29ceb0[_0x2f3c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index d507d0e..3049673 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 _0xb03e=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','/:id','show','post','put','delete','destroy','exports','util','path','connect-timeout'];(function(_0x41fdcc,_0xd9c201){var _0x1b66e1=function(_0x3285d3){while(--_0x3285d3){_0x41fdcc['push'](_0x41fdcc['shift']());}};_0x1b66e1(++_0xd9c201);}(_0xb03e,0x1eb));var _0xeb03=function(_0x574994,_0x139779){_0x574994=_0x574994-0x0;var _0x4abfdc=_0xb03e[_0x574994];return _0x4abfdc;};'use strict';var multer=require('multer');var util=require(_0xeb03('0x0'));var path=require(_0xeb03('0x1'));var timeout=require(_0xeb03('0x2'));var express=require(_0xeb03('0x3'));var router=express[_0xeb03('0x4')]();var fs_extra=require(_0xeb03('0x5'));var auth=require(_0xeb03('0x6'));var interaction=require(_0xeb03('0x7'));var config=require(_0xeb03('0x8'));var controller=require(_0xeb03('0x9'));router[_0xeb03('0xa')]('/',auth[_0xeb03('0xb')](),controller['index']);router[_0xeb03('0xa')](_0xeb03('0xc'),auth[_0xeb03('0xb')](),controller[_0xeb03('0xd')]);router[_0xeb03('0xe')]('/',auth[_0xeb03('0xb')](),controller['create']);router[_0xeb03('0xf')](_0xeb03('0xc'),auth[_0xeb03('0xb')](),controller['update']);router[_0xeb03('0x10')]('/:id',auth[_0xeb03('0xb')](),controller[_0xeb03('0x11')]);module[_0xeb03('0x12')]=router; \ No newline at end of file +var _0x80ed=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer'];(function(_0x2a55f8,_0x540ac4){var _0x245efd=function(_0x4dbc19){while(--_0x4dbc19){_0x2a55f8['push'](_0x2a55f8['shift']());}};_0x245efd(++_0x540ac4);}(_0x80ed,0x11c));var _0xd80e=function(_0x44b992,_0x1504ba){_0x44b992=_0x44b992-0x0;var _0x46ea63=_0x80ed[_0x44b992];return _0x46ea63;};'use strict';var multer=require(_0xd80e('0x0'));var util=require('util');var path=require(_0xd80e('0x1'));var timeout=require(_0xd80e('0x2'));var express=require(_0xd80e('0x3'));var router=express['Router']();var fs_extra=require(_0xd80e('0x4'));var auth=require(_0xd80e('0x5'));var interaction=require(_0xd80e('0x6'));var config=require(_0xd80e('0x7'));var controller=require('./faxApplication.controller');router[_0xd80e('0x8')]('/',auth[_0xd80e('0x9')](),controller[_0xd80e('0xa')]);router['get'](_0xd80e('0xb'),auth[_0xd80e('0x9')](),controller[_0xd80e('0xc')]);router[_0xd80e('0xd')]('/',auth[_0xd80e('0x9')](),controller[_0xd80e('0xe')]);router[_0xd80e('0xf')](_0xd80e('0xb'),auth[_0xd80e('0x9')](),controller[_0xd80e('0x10')]);router['delete'](_0xd80e('0xb'),auth[_0xd80e('0x9')](),controller[_0xd80e('0x11')]);module[_0xd80e('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index c367fe0..1b14681 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 _0x1a37=['STRING','out','ENUM','INTEGER','sequelize','exports','BOOLEAN','DATE'];(function(_0x568e19,_0xec93a9){var _0x42b365=function(_0x7aec85){while(--_0x7aec85){_0x568e19['push'](_0x568e19['shift']());}};_0x42b365(++_0xec93a9);}(_0x1a37,0xb4));var _0x71a3=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x1a37[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0x71a3('0x0'));module[_0x71a3('0x1')]={'closed':{'type':Sequelize[_0x71a3('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x71a3('0x3')]},'disposition':{'type':Sequelize[_0x71a3('0x4')]},'secondDisposition':{'type':Sequelize[_0x71a3('0x4')]},'thirdDisposition':{'type':Sequelize[_0x71a3('0x4')]},'note':{'type':Sequelize[_0x71a3('0x4')]},'read1stAt':{'type':Sequelize[_0x71a3('0x3')]},'fax':{'type':Sequelize[_0x71a3('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x71a3('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x71a3('0x6')]('in',_0x71a3('0x5')),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0x71a3('0x7')]}}; \ No newline at end of file +var _0x3d04=['out','sequelize','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x2077be,_0x26136a){var _0x198bbf=function(_0x2fd7e3){while(--_0x2fd7e3){_0x2077be['push'](_0x2077be['shift']());}};_0x198bbf(++_0x26136a);}(_0x3d04,0xbe));var _0x43d0=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x3d04[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x43d0('0x0'));module[_0x43d0('0x1')]={'closed':{'type':Sequelize[_0x43d0('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x43d0('0x3')]},'disposition':{'type':Sequelize[_0x43d0('0x4')]},'secondDisposition':{'type':Sequelize[_0x43d0('0x4')]},'thirdDisposition':{'type':Sequelize[_0x43d0('0x4')]},'note':{'type':Sequelize[_0x43d0('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0x43d0('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x43d0('0x5')]('in',_0x43d0('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x43d0('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 54494ec..20b0870 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 _0x5ac0=['Content-Range','then','destroy','error','name','send','index','FaxInteraction','rawAttributes','fieldName','key','fax','query','user','catch','params','keys','filters','intersection','model','fields','attributes','length','includeAll','merge','options','find','create','body','update','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','hasOwnProperty','nolimit','order','FaxInteractionId','filter','where','map','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','include','rows','addTags','setTags','findAll','color','emit','removeTags','download','unix','toString','root','server','files','tmp','attachments','join','transcript-%d-%s.zip','Attachment','createdAt','Messages','get','mkdirSync','existsSync','createReadStream','pipe','createWriteStream','resolve','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','undefined','limit','count','offset','set'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0x5ac0,0x11f));var _0x05ac=function(_0x5ce435,_0x9e28aa){_0x5ce435=_0x5ce435-0x0;var _0xb35b2d=_0x5ac0[_0x5ce435];return _0xb35b2d;};'use strict';var rimraf=require(_0x05ac('0x0'));var zipdir=require(_0x05ac('0x1'));var moment=require(_0x05ac('0x2'));var BPromise=require(_0x05ac('0x3'));var util=require(_0x05ac('0x4'));var path=require('path');var fs=require('fs');var _=require(_0x05ac('0x5'));var Redis=require(_0x05ac('0x6'));var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var logger=require(_0x05ac('0x7'))(_0x05ac('0x8'));var config=require(_0x05ac('0x9'));var db=require(_0x05ac('0xa'))['db'];config[_0x05ac('0xb')]=_[_0x05ac('0xc')](config['redis'],{'host':_0x05ac('0xd'),'port':0x18eb});var socket=require(_0x05ac('0xe'))(new Redis(config[_0x05ac('0xb')]));require('./faxInteraction.socket')[_0x05ac('0xf')](socket);function respondWithStatusCode(_0x443634,_0x3d7039){_0x3d7039=_0x3d7039||0xcc;return function(_0x15dd6f){if(_0x15dd6f){return _0x443634[_0x05ac('0x10')](_0x3d7039);}return _0x443634['status'](_0x3d7039)[_0x05ac('0x11')]();};}function respondWithResult(_0x25e571,_0x38f239){_0x38f239=_0x38f239||0xc8;return function(_0x5d8632){if(_0x5d8632){return _0x25e571[_0x05ac('0x12')](_0x38f239)[_0x05ac('0x13')](_0x5d8632);}};}function respondWithFilteredResult(_0x1de328,_0x23dd49){return function(_0x3e4d89){if(_0x3e4d89){var _0x258137=typeof _0x23dd49['offset']===_0x05ac('0x14')&&typeof _0x23dd49[_0x05ac('0x15')]===_0x05ac('0x14');var _0x3c3c52=_0x3e4d89[_0x05ac('0x16')];var _0x16df8f=_0x258137?0x0:_0x23dd49[_0x05ac('0x17')];var _0x2ca708=_0x258137?_0x3e4d89[_0x05ac('0x16')]:_0x23dd49[_0x05ac('0x17')]+_0x23dd49[_0x05ac('0x15')];var _0xb28d21;if(_0x2ca708>=_0x3c3c52){_0x2ca708=_0x3c3c52;_0xb28d21=0xc8;}else{_0xb28d21=0xce;}_0x1de328[_0x05ac('0x12')](_0xb28d21);return _0x1de328[_0x05ac('0x18')](_0x05ac('0x19'),_0x16df8f+'-'+_0x2ca708+'/'+_0x3c3c52)[_0x05ac('0x13')](_0x3e4d89);}return null;};}function saveUpdates(_0x129752){return function(_0x3bf935){if(_0x3bf935){return _0x3bf935['update'](_0x129752)[_0x05ac('0x1a')](function(_0x54d385){return _0x54d385;});}return null;};}function removeEntity(_0x5e00f2){return function(_0x31958d){if(_0x31958d){return _0x31958d[_0x05ac('0x1b')]()['then'](function(){_0x5e00f2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x119ffb){return function(_0x29c455){if(!_0x29c455){_0x119ffb[_0x05ac('0x10')](0x194);}return _0x29c455;};}function handleError(_0x3bc8a7,_0x1488c5){_0x1488c5=_0x1488c5||0x1f4;return function(_0x46e187){logger[_0x05ac('0x1c')](_0x46e187['stack']);if(_0x46e187[_0x05ac('0x1d')]){delete _0x46e187[_0x05ac('0x1d')];}_0x3bc8a7['status'](_0x1488c5)[_0x05ac('0x1e')](_0x46e187);};}exports[_0x05ac('0x1f')]=function(_0x1a269e,_0x8afe24){var _0x4ed50b={};var _0x1c5574=_['map'](db[_0x05ac('0x20')][_0x05ac('0x21')],function(_0x284413){return{'name':_0x284413[_0x05ac('0x22')],'type':_0x284413['type'][_0x05ac('0x23')]};});_0x4ed50b=qs['getOptions'](_0x1c5574,_0x1a269e);return interaction['findAll'](_0x05ac('0x24'),_0x1a269e[_0x05ac('0x25')],_0x1a269e[_0x05ac('0x26')],_0x4ed50b,_0x1c5574)[_0x05ac('0x1a')](respondWithFilteredResult(_0x8afe24,_0x4ed50b))[_0x05ac('0x27')](handleError(_0x8afe24,null));};exports['show']=function(_0x247c69,_0x145fc2){var _0x579e86={'raw':![],'where':{'id':_0x247c69[_0x05ac('0x28')]['id']}},_0x4f1380={};_0x4f1380['model']=_[_0x05ac('0x29')](db['FaxInteraction']['rawAttributes']);_0x4f1380[_0x05ac('0x25')]=_[_0x05ac('0x29')](_0x247c69['query']);_0x4f1380[_0x05ac('0x2a')]=_[_0x05ac('0x2b')](_0x4f1380[_0x05ac('0x2c')],_0x4f1380['query']);_0x579e86['attributes']=_[_0x05ac('0x2b')](_0x4f1380['model'],qs[_0x05ac('0x2d')](_0x247c69[_0x05ac('0x25')][_0x05ac('0x2d')]));_0x579e86['attributes']=_0x579e86[_0x05ac('0x2e')][_0x05ac('0x2f')]?_0x579e86[_0x05ac('0x2e')]:_0x4f1380[_0x05ac('0x2c')];if(_0x247c69[_0x05ac('0x25')][_0x05ac('0x30')]){_0x579e86['include']=[{'all':!![]}];}_0x579e86=_[_0x05ac('0x31')]({},_0x579e86,_0x247c69[_0x05ac('0x32')]);return db[_0x05ac('0x20')][_0x05ac('0x33')](_0x579e86)['then'](handleEntityNotFound(_0x145fc2,null))['then'](respondWithResult(_0x145fc2,null))[_0x05ac('0x27')](handleError(_0x145fc2,null));};exports[_0x05ac('0x34')]=function(_0x5ef15a,_0x113cd3){return db['FaxInteraction']['create'](_0x5ef15a[_0x05ac('0x35')],{})[_0x05ac('0x1a')](respondWithResult(_0x113cd3,0xc9))[_0x05ac('0x27')](handleError(_0x113cd3,null));};exports[_0x05ac('0x36')]=function(_0x41b332,_0x5645f0){if(_0x41b332[_0x05ac('0x35')]['id']){delete _0x41b332[_0x05ac('0x35')]['id'];}return db[_0x05ac('0x20')][_0x05ac('0x33')]({'where':{'id':_0x41b332['params']['id']}})[_0x05ac('0x1a')](handleEntityNotFound(_0x5645f0,null))[_0x05ac('0x1a')](saveUpdates(_0x41b332[_0x05ac('0x35')],null))['then'](respondWithResult(_0x5645f0,null))[_0x05ac('0x27')](handleError(_0x5645f0,null));};exports[_0x05ac('0x1b')]=function(_0x29c2fc,_0x47eb1c){return db['FaxInteraction']['find']({'where':{'id':_0x29c2fc[_0x05ac('0x28')]['id']}})[_0x05ac('0x1a')](handleEntityNotFound(_0x47eb1c,null))[_0x05ac('0x1a')](removeEntity(_0x47eb1c,null))[_0x05ac('0x27')](handleError(_0x47eb1c,null));};exports[_0x05ac('0x37')]=function(_0xe17551,_0x26b1b4){return db[_0x05ac('0x20')][_0x05ac('0x37')]()[_0x05ac('0x1a')](respondWithResult(_0x26b1b4,null))[_0x05ac('0x27')](handleError(_0x26b1b4,null));};exports[_0x05ac('0x38')]=function(_0x3947b0,_0x59435c){return db[_0x05ac('0x39')][_0x05ac('0x33')]({'where':{'id':_0x3947b0[_0x05ac('0x28')]['id']}})[_0x05ac('0x1a')](handleEntityNotFound(_0x59435c,null))['then'](function(_0x31d885){if(_0x31d885){return _0x31d885['addMessage'](_0x3947b0['body'][_0x05ac('0x3a')],_[_0x05ac('0x3b')](_0x3947b0[_0x05ac('0x35')],[_0x05ac('0x3a'),'id'])||{});}})[_0x05ac('0x1a')](respondWithResult(_0x59435c,null))[_0x05ac('0x27')](handleError(_0x59435c,null));};exports[_0x05ac('0x3c')]=function(_0x1be5ba,_0x5d4d4c){var _0x59310b={'raw':![],'where':{}};var _0x47cc6b={};var _0x3cbe68={'count':0x0,'rows':[]};return db[_0x05ac('0x20')][_0x05ac('0x3d')]({'where':{'id':_0x1be5ba[_0x05ac('0x28')]['id']}})[_0x05ac('0x1a')](handleEntityNotFound(_0x5d4d4c,null))['then'](function(_0x21a54b){if(_0x21a54b){_0x47cc6b[_0x05ac('0x2c')]=_[_0x05ac('0x29')](db['FaxMessage']['rawAttributes']);_0x47cc6b[_0x05ac('0x25')]=_[_0x05ac('0x29')](_0x1be5ba[_0x05ac('0x25')]);_0x47cc6b[_0x05ac('0x2a')]=_[_0x05ac('0x2b')](_0x47cc6b[_0x05ac('0x2c')],_0x47cc6b[_0x05ac('0x25')]);_0x59310b[_0x05ac('0x2e')]=_[_0x05ac('0x2b')](_0x47cc6b['model'],qs['fields'](_0x1be5ba[_0x05ac('0x25')][_0x05ac('0x2d')]));_0x59310b[_0x05ac('0x2e')]=_0x59310b[_0x05ac('0x2e')][_0x05ac('0x2f')]?_0x59310b[_0x05ac('0x2e')]:_0x47cc6b[_0x05ac('0x2c')];if(!_0x1be5ba['query'][_0x05ac('0x3e')](_0x05ac('0x3f'))){_0x59310b['limit']=qs[_0x05ac('0x15')](_0x1be5ba[_0x05ac('0x25')][_0x05ac('0x15')]);_0x59310b['offset']=qs[_0x05ac('0x17')](_0x1be5ba[_0x05ac('0x25')][_0x05ac('0x17')]);}_0x59310b[_0x05ac('0x40')]=qs['sort'](_0x1be5ba[_0x05ac('0x25')]['sort']);_0x59310b['where']=qs[_0x05ac('0x2a')](_['pick'](_0x1be5ba['query'],_0x47cc6b['filters']));_0x59310b['where'][_0x05ac('0x41')]=_0x21a54b['id'];if(_0x1be5ba[_0x05ac('0x25')][_0x05ac('0x42')]){_0x59310b[_0x05ac('0x43')]=_[_0x05ac('0x31')](_0x59310b[_0x05ac('0x43')],{'$or':_[_0x05ac('0x44')](_0x59310b[_0x05ac('0x2e')],function(_0x397ca7){var _0x207be3={};_0x207be3[_0x397ca7]={'$like':'%'+_0x1be5ba[_0x05ac('0x25')][_0x05ac('0x42')]+'%'};return _0x207be3;})});}if(_0x1be5ba['query'][_0x05ac('0x45')]){var _0x170e87=_0x1be5ba[_0x05ac('0x25')][_0x05ac('0x45')][_0x05ac('0x46')](',');var _0x33315b={};_0x33315b[_0x170e87[0x0]]={'$gte':moment(_0x170e87[0x1])[_0x05ac('0x47')](_0x05ac('0x48'))};_0x59310b[_0x05ac('0x43')]=_[_0x05ac('0x31')](_0x59310b[_0x05ac('0x43')],_0x33315b);}_0x59310b=_[_0x05ac('0x31')]({},_0x59310b,_0x1be5ba['options']);return db[_0x05ac('0x39')][_0x05ac('0x16')]({'where':_0x59310b['where']})[_0x05ac('0x1a')](function(_0x272a56){_0x3cbe68['count']=_0x272a56;if(_0x1be5ba['query'][_0x05ac('0x30')]){_0x59310b[_0x05ac('0x49')]=[{'all':!![]}];}return db[_0x05ac('0x39')]['findAll'](_0x59310b);})[_0x05ac('0x1a')](function(_0x1bcdc6){_0x3cbe68[_0x05ac('0x4a')]=_0x1bcdc6;return _0x3cbe68;});}})[_0x05ac('0x1a')](respondWithFilteredResult(_0x5d4d4c,_0x59310b))[_0x05ac('0x27')](handleError(_0x5d4d4c,null));};exports[_0x05ac('0x4b')]=function(_0x30f57c,_0x1208c4){return db[_0x05ac('0x20')][_0x05ac('0x33')]({'where':{'id':_0x30f57c[_0x05ac('0x28')]['id']}})['then'](handleEntityNotFound(_0x1208c4,null))['then'](function(_0x3ea0e3){if(_0x3ea0e3){return _0x3ea0e3[_0x05ac('0x4c')](_0x30f57c['body'][_0x05ac('0x3a')],_[_0x05ac('0x3b')](_0x30f57c['body'],['ids','id'])||{})['spread'](function(){return db['Tag'][_0x05ac('0x4d')]({'attributes':['id',_0x05ac('0x1d'),_0x05ac('0x4e')],'where':{'id':_0x30f57c['body'][_0x05ac('0x3a')]}});})[_0x05ac('0x1a')](function(_0x590ae9){socket[_0x05ac('0x4f')]('faxInteractionTags:save',{'id':Number(_0x30f57c[_0x05ac('0x28')]['id']),'tags':_0x590ae9||[]});return{'id':Number(_0x30f57c[_0x05ac('0x28')]['id']),'tags':_0x590ae9||[]};});}})[_0x05ac('0x1a')](respondWithResult(_0x1208c4,null))[_0x05ac('0x27')](handleError(_0x1208c4,null));};exports[_0x05ac('0x50')]=function(_0x3282f2,_0xee1fef){return db[_0x05ac('0x20')][_0x05ac('0x33')]({'where':{'id':_0x3282f2[_0x05ac('0x28')]['id']}})['then'](handleEntityNotFound(_0xee1fef,null))[_0x05ac('0x1a')](function(_0x4fdbe2){if(_0x4fdbe2){return _0x4fdbe2['removeTags'](_0x3282f2[_0x05ac('0x25')][_0x05ac('0x3a')]);}})['then'](respondWithStatusCode(_0xee1fef,null))[_0x05ac('0x27')](handleError(_0xee1fef,null));};exports[_0x05ac('0x51')]=function(_0x355343,_0x1acabe){var _0x97fad8=moment()[_0x05ac('0x52')]()[_0x05ac('0x53')]();var _0x29304c=path['join'](config[_0x05ac('0x54')],_0x05ac('0x55'),_0x05ac('0x56'),_0x05ac('0x57'));var _0x3a1c6b=path['join'](config[_0x05ac('0x54')],_0x05ac('0x55'),'files',_0x05ac('0x58'));var _0x2b5951=path[_0x05ac('0x59')](_0x29304c,_0x97fad8);var _0x252694=util[_0x05ac('0x47')](_0x05ac('0x5a'),_0x355343['params']['id'],_0x97fad8);var _0x190c4f=path[_0x05ac('0x59')](_0x29304c,_0x252694);var _0x18fea7=[];_0x18fea7['push']({'model':db[_0x05ac('0x5b')],'as':'Attachment','raw':!![]});var _0x40b38d=[{'model':db[_0x05ac('0x39')],'as':'Messages','attributes':['id','body',_0x05ac('0x5c')],'include':_0x18fea7}];return db[_0x05ac('0x20')]['find']({'where':{'id':_0x355343[_0x05ac('0x28')]['id']},'include':_0x40b38d})[_0x05ac('0x1a')](handleEntityNotFound(_0x1acabe,null))['then'](function(_0x12fa1b){if(_0x12fa1b&&_0x12fa1b[_0x05ac('0x5d')]){var _0x2c035d=_0x12fa1b[_0x05ac('0x5e')]({'plain':!![]});fs[_0x05ac('0x5f')](_0x2b5951);for(var _0x3bb401=0x0;_0x3bb401<_0x2c035d['Messages'][_0x05ac('0x2f')];_0x3bb401++){var _0x528b44=_0x2c035d['Messages'][_0x3bb401][_0x05ac('0x5b')];if(_0x528b44){var _0x2744f2=path[_0x05ac('0x59')](_0x3a1c6b,_0x528b44['basename']);if(fs[_0x05ac('0x60')](_0x2744f2)){fs[_0x05ac('0x61')](_0x2744f2)[_0x05ac('0x62')](fs[_0x05ac('0x63')](path[_0x05ac('0x59')](_0x2b5951,_0x528b44['basename'])));}}}return BPromise[_0x05ac('0x64')]()[_0x05ac('0x1a')](function(){return new BPromise(function(_0x5ac455,_0x1e54a5){zipdir(_0x2b5951,{'saveTo':_0x190c4f},function(_0x8b49e7,_0x212fcb){if(_0x8b49e7)return _0x1e54a5(_0x8b49e7);return _0x5ac455(_0x212fcb);});})['then'](function(){return new BPromise(function(_0x3eb2df,_0x1d4691){rimraf(_0x2b5951,function(_0x19bf74){if(_0x19bf74)_0x1d4691(_0x19bf74);return _0x3eb2df();});});})[_0x05ac('0x1a')](function(){return _0x1acabe['download'](_0x190c4f,_0x252694,function(_0x18e00b){if(_0x18e00b){console[_0x05ac('0x65')](_0x05ac('0x66'),_0x18e00b);}else{fs[_0x05ac('0x67')](_0x190c4f);}});});});}else{return _0x1acabe['sendStatus'](0xc8);}})[_0x05ac('0x27')](handleError(_0x1acabe,null));}; \ No newline at end of file +var _0xe429=['includeAll','findAll','rows','setTags','spread','color','emit','removeTags','download','unix','toString','root','server','files','tmp','join','push','Attachment','createdAt','get','mkdirSync','Messages','basename','createReadStream','resolve','log','unlinkSync','rimraf','zip-dir','moment','util','path','lodash','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./faxInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','update','then','destroy','error','stack','name','send','index','type','getOptions','fax','query','user','catch','show','model','keys','FaxInteraction','attributes','intersection','fields','length','include','merge','options','find','create','body','params','describe','addMessage','FaxMessage','omit','ids','getMessages','findOne','rawAttributes','filters','order','sort','where','FaxInteractionId','filter','map','$gte','split','format'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xe429,0x7d));var _0x9e42=function(_0x12e9e3,_0x260383){_0x12e9e3=_0x12e9e3-0x0;var _0x3ada04=_0xe429[_0x12e9e3];return _0x3ada04;};'use strict';var rimraf=require(_0x9e42('0x0'));var zipdir=require(_0x9e42('0x1'));var moment=require(_0x9e42('0x2'));var BPromise=require('bluebird');var util=require(_0x9e42('0x3'));var path=require(_0x9e42('0x4'));var fs=require('fs');var _=require(_0x9e42('0x5'));var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var logger=require(_0x9e42('0x6'))(_0x9e42('0x7'));var config=require(_0x9e42('0x8'));var db=require(_0x9e42('0x9'))['db'];config[_0x9e42('0xa')]=_[_0x9e42('0xb')](config[_0x9e42('0xa')],{'host':_0x9e42('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9e42('0xa')]));require(_0x9e42('0xd'))[_0x9e42('0xe')](socket);function respondWithStatusCode(_0x455cc0,_0x530141){_0x530141=_0x530141||0xcc;return function(_0x1639c0){if(_0x1639c0){return _0x455cc0[_0x9e42('0xf')](_0x530141);}return _0x455cc0[_0x9e42('0x10')](_0x530141)[_0x9e42('0x11')]();};}function respondWithResult(_0x2900a1,_0x2966b2){_0x2966b2=_0x2966b2||0xc8;return function(_0x3d3244){if(_0x3d3244){return _0x2900a1[_0x9e42('0x10')](_0x2966b2)[_0x9e42('0x12')](_0x3d3244);}};}function respondWithFilteredResult(_0x3ee667,_0x26a144){return function(_0x23f8ec){if(_0x23f8ec){var _0x3f63c6=typeof _0x26a144[_0x9e42('0x13')]===_0x9e42('0x14')&&typeof _0x26a144[_0x9e42('0x15')]===_0x9e42('0x14');var _0x4f2748=_0x23f8ec[_0x9e42('0x16')];var _0x24d2e2=_0x3f63c6?0x0:_0x26a144[_0x9e42('0x13')];var _0x2d5dbf=_0x3f63c6?_0x23f8ec[_0x9e42('0x16')]:_0x26a144[_0x9e42('0x13')]+_0x26a144[_0x9e42('0x15')];var _0x4e8125;if(_0x2d5dbf>=_0x4f2748){_0x2d5dbf=_0x4f2748;_0x4e8125=0xc8;}else{_0x4e8125=0xce;}_0x3ee667[_0x9e42('0x10')](_0x4e8125);return _0x3ee667[_0x9e42('0x17')]('Content-Range',_0x24d2e2+'-'+_0x2d5dbf+'/'+_0x4f2748)[_0x9e42('0x12')](_0x23f8ec);}return null;};}function saveUpdates(_0x1cf5ec){return function(_0x7d5291){if(_0x7d5291){return _0x7d5291[_0x9e42('0x18')](_0x1cf5ec)[_0x9e42('0x19')](function(_0x30008f){return _0x30008f;});}return null;};}function removeEntity(_0xe38413){return function(_0x379ef9){if(_0x379ef9){return _0x379ef9[_0x9e42('0x1a')]()[_0x9e42('0x19')](function(){_0xe38413[_0x9e42('0x10')](0xcc)[_0x9e42('0x11')]();});}};}function handleEntityNotFound(_0x58a0a2){return function(_0x10ef08){if(!_0x10ef08){_0x58a0a2['sendStatus'](0x194);}return _0x10ef08;};}function handleError(_0x2c838f,_0x589bc5){_0x589bc5=_0x589bc5||0x1f4;return function(_0x544c37){logger[_0x9e42('0x1b')](_0x544c37[_0x9e42('0x1c')]);if(_0x544c37['name']){delete _0x544c37[_0x9e42('0x1d')];}_0x2c838f[_0x9e42('0x10')](_0x589bc5)[_0x9e42('0x1e')](_0x544c37);};}exports[_0x9e42('0x1f')]=function(_0x2e05b8,_0x5b44f7){var _0x1d195b={};var _0x12b663=_['map'](db['FaxInteraction']['rawAttributes'],function(_0x4beffd){return{'name':_0x4beffd['fieldName'],'type':_0x4beffd[_0x9e42('0x20')]['key']};});_0x1d195b=qs[_0x9e42('0x21')](_0x12b663,_0x2e05b8);return interaction['findAll'](_0x9e42('0x22'),_0x2e05b8[_0x9e42('0x23')],_0x2e05b8[_0x9e42('0x24')],_0x1d195b,_0x12b663)[_0x9e42('0x19')](respondWithFilteredResult(_0x5b44f7,_0x1d195b))[_0x9e42('0x25')](handleError(_0x5b44f7,null));};exports[_0x9e42('0x26')]=function(_0x196193,_0x2d17e0){var _0x18fd13={'raw':![],'where':{'id':_0x196193['params']['id']}},_0x8a2572={};_0x8a2572[_0x9e42('0x27')]=_[_0x9e42('0x28')](db[_0x9e42('0x29')]['rawAttributes']);_0x8a2572[_0x9e42('0x23')]=_[_0x9e42('0x28')](_0x196193[_0x9e42('0x23')]);_0x8a2572['filters']=_['intersection'](_0x8a2572[_0x9e42('0x27')],_0x8a2572['query']);_0x18fd13[_0x9e42('0x2a')]=_[_0x9e42('0x2b')](_0x8a2572[_0x9e42('0x27')],qs[_0x9e42('0x2c')](_0x196193['query']['fields']));_0x18fd13['attributes']=_0x18fd13['attributes'][_0x9e42('0x2d')]?_0x18fd13[_0x9e42('0x2a')]:_0x8a2572[_0x9e42('0x27')];if(_0x196193[_0x9e42('0x23')]['includeAll']){_0x18fd13[_0x9e42('0x2e')]=[{'all':!![]}];}_0x18fd13=_[_0x9e42('0x2f')]({},_0x18fd13,_0x196193[_0x9e42('0x30')]);return db[_0x9e42('0x29')][_0x9e42('0x31')](_0x18fd13)[_0x9e42('0x19')](handleEntityNotFound(_0x2d17e0,null))['then'](respondWithResult(_0x2d17e0,null))['catch'](handleError(_0x2d17e0,null));};exports[_0x9e42('0x32')]=function(_0x35b5f6,_0x4df9c8){return db['FaxInteraction']['create'](_0x35b5f6[_0x9e42('0x33')],{})[_0x9e42('0x19')](respondWithResult(_0x4df9c8,0xc9))[_0x9e42('0x25')](handleError(_0x4df9c8,null));};exports[_0x9e42('0x18')]=function(_0x1f2f8d,_0x246510){if(_0x1f2f8d[_0x9e42('0x33')]['id']){delete _0x1f2f8d[_0x9e42('0x33')]['id'];}return db[_0x9e42('0x29')]['find']({'where':{'id':_0x1f2f8d[_0x9e42('0x34')]['id']}})[_0x9e42('0x19')](handleEntityNotFound(_0x246510,null))[_0x9e42('0x19')](saveUpdates(_0x1f2f8d[_0x9e42('0x33')],null))[_0x9e42('0x19')](respondWithResult(_0x246510,null))[_0x9e42('0x25')](handleError(_0x246510,null));};exports[_0x9e42('0x1a')]=function(_0x24927b,_0xeb4675){return db['FaxInteraction'][_0x9e42('0x31')]({'where':{'id':_0x24927b['params']['id']}})['then'](handleEntityNotFound(_0xeb4675,null))[_0x9e42('0x19')](removeEntity(_0xeb4675,null))['catch'](handleError(_0xeb4675,null));};exports[_0x9e42('0x35')]=function(_0x3b2b55,_0x384f28){return db[_0x9e42('0x29')][_0x9e42('0x35')]()[_0x9e42('0x19')](respondWithResult(_0x384f28,null))[_0x9e42('0x25')](handleError(_0x384f28,null));};exports[_0x9e42('0x36')]=function(_0x1f76c8,_0x125803){return db[_0x9e42('0x37')][_0x9e42('0x31')]({'where':{'id':_0x1f76c8[_0x9e42('0x34')]['id']}})[_0x9e42('0x19')](handleEntityNotFound(_0x125803,null))[_0x9e42('0x19')](function(_0x2ec8dd){if(_0x2ec8dd){return _0x2ec8dd[_0x9e42('0x36')](_0x1f76c8[_0x9e42('0x33')]['ids'],_[_0x9e42('0x38')](_0x1f76c8[_0x9e42('0x33')],[_0x9e42('0x39'),'id'])||{});}})['then'](respondWithResult(_0x125803,null))[_0x9e42('0x25')](handleError(_0x125803,null));};exports[_0x9e42('0x3a')]=function(_0x35d9f5,_0x253262){var _0x43aae3={'raw':![],'where':{}};var _0x385f84={};var _0x3b3e73={'count':0x0,'rows':[]};return db['FaxInteraction'][_0x9e42('0x3b')]({'where':{'id':_0x35d9f5['params']['id']}})['then'](handleEntityNotFound(_0x253262,null))[_0x9e42('0x19')](function(_0x136c7e){if(_0x136c7e){_0x385f84[_0x9e42('0x27')]=_[_0x9e42('0x28')](db[_0x9e42('0x37')][_0x9e42('0x3c')]);_0x385f84['query']=_[_0x9e42('0x28')](_0x35d9f5[_0x9e42('0x23')]);_0x385f84[_0x9e42('0x3d')]=_['intersection'](_0x385f84[_0x9e42('0x27')],_0x385f84[_0x9e42('0x23')]);_0x43aae3[_0x9e42('0x2a')]=_['intersection'](_0x385f84['model'],qs['fields'](_0x35d9f5['query']['fields']));_0x43aae3[_0x9e42('0x2a')]=_0x43aae3['attributes'][_0x9e42('0x2d')]?_0x43aae3[_0x9e42('0x2a')]:_0x385f84[_0x9e42('0x27')];if(!_0x35d9f5[_0x9e42('0x23')]['hasOwnProperty']('nolimit')){_0x43aae3[_0x9e42('0x15')]=qs[_0x9e42('0x15')](_0x35d9f5['query'][_0x9e42('0x15')]);_0x43aae3[_0x9e42('0x13')]=qs['offset'](_0x35d9f5[_0x9e42('0x23')]['offset']);}_0x43aae3[_0x9e42('0x3e')]=qs[_0x9e42('0x3f')](_0x35d9f5[_0x9e42('0x23')]['sort']);_0x43aae3['where']=qs[_0x9e42('0x3d')](_['pick'](_0x35d9f5[_0x9e42('0x23')],_0x385f84['filters']));_0x43aae3[_0x9e42('0x40')][_0x9e42('0x41')]=_0x136c7e['id'];if(_0x35d9f5[_0x9e42('0x23')][_0x9e42('0x42')]){_0x43aae3[_0x9e42('0x40')]=_[_0x9e42('0x2f')](_0x43aae3[_0x9e42('0x40')],{'$or':_[_0x9e42('0x43')](_0x43aae3[_0x9e42('0x2a')],function(_0x1414c7){var _0x3c4e20={};_0x3c4e20[_0x1414c7]={'$like':'%'+_0x35d9f5['query'][_0x9e42('0x42')]+'%'};return _0x3c4e20;})});}if(_0x35d9f5[_0x9e42('0x23')][_0x9e42('0x44')]){var _0x2a6a40=_0x35d9f5[_0x9e42('0x23')][_0x9e42('0x44')][_0x9e42('0x45')](',');var _0x40f63f={};_0x40f63f[_0x2a6a40[0x0]]={'$gte':moment(_0x2a6a40[0x1])[_0x9e42('0x46')]('YYYY-MM-DD\x20HH:mm:ss')};_0x43aae3[_0x9e42('0x40')]=_[_0x9e42('0x2f')](_0x43aae3[_0x9e42('0x40')],_0x40f63f);}_0x43aae3=_[_0x9e42('0x2f')]({},_0x43aae3,_0x35d9f5[_0x9e42('0x30')]);return db[_0x9e42('0x37')][_0x9e42('0x16')]({'where':_0x43aae3['where']})[_0x9e42('0x19')](function(_0x109d8d){_0x3b3e73[_0x9e42('0x16')]=_0x109d8d;if(_0x35d9f5[_0x9e42('0x23')][_0x9e42('0x47')]){_0x43aae3[_0x9e42('0x2e')]=[{'all':!![]}];}return db[_0x9e42('0x37')][_0x9e42('0x48')](_0x43aae3);})['then'](function(_0x312b4f){_0x3b3e73[_0x9e42('0x49')]=_0x312b4f;return _0x3b3e73;});}})['then'](respondWithFilteredResult(_0x253262,_0x43aae3))['catch'](handleError(_0x253262,null));};exports['addTags']=function(_0x3141c6,_0x2258d2){return db['FaxInteraction'][_0x9e42('0x31')]({'where':{'id':_0x3141c6[_0x9e42('0x34')]['id']}})[_0x9e42('0x19')](handleEntityNotFound(_0x2258d2,null))['then'](function(_0xa859a0){if(_0xa859a0){return _0xa859a0[_0x9e42('0x4a')](_0x3141c6['body']['ids'],_['omit'](_0x3141c6[_0x9e42('0x33')],['ids','id'])||{})[_0x9e42('0x4b')](function(){return db['Tag'][_0x9e42('0x48')]({'attributes':['id',_0x9e42('0x1d'),_0x9e42('0x4c')],'where':{'id':_0x3141c6[_0x9e42('0x33')][_0x9e42('0x39')]}});})[_0x9e42('0x19')](function(_0x5e23c7){socket[_0x9e42('0x4d')]('faxInteractionTags:save',{'id':Number(_0x3141c6['params']['id']),'tags':_0x5e23c7||[]});return{'id':Number(_0x3141c6['params']['id']),'tags':_0x5e23c7||[]};});}})[_0x9e42('0x19')](respondWithResult(_0x2258d2,null))[_0x9e42('0x25')](handleError(_0x2258d2,null));};exports[_0x9e42('0x4e')]=function(_0xa7a756,_0x3d6410){return db['FaxInteraction'][_0x9e42('0x31')]({'where':{'id':_0xa7a756[_0x9e42('0x34')]['id']}})[_0x9e42('0x19')](handleEntityNotFound(_0x3d6410,null))[_0x9e42('0x19')](function(_0x1ade19){if(_0x1ade19){return _0x1ade19[_0x9e42('0x4e')](_0xa7a756[_0x9e42('0x23')][_0x9e42('0x39')]);}})['then'](respondWithStatusCode(_0x3d6410,null))[_0x9e42('0x25')](handleError(_0x3d6410,null));};exports[_0x9e42('0x4f')]=function(_0x570fd9,_0x2dad87){var _0x407e61=moment()[_0x9e42('0x50')]()[_0x9e42('0x51')]();var _0x3de3ea=path['join'](config[_0x9e42('0x52')],_0x9e42('0x53'),_0x9e42('0x54'),_0x9e42('0x55'));var _0x29ba2f=path[_0x9e42('0x56')](config[_0x9e42('0x52')],_0x9e42('0x53'),'files','attachments');var _0x356610=path['join'](_0x3de3ea,_0x407e61);var _0x1bb775=util[_0x9e42('0x46')]('transcript-%d-%s.zip',_0x570fd9[_0x9e42('0x34')]['id'],_0x407e61);var _0x1ab8f4=path['join'](_0x3de3ea,_0x1bb775);var _0x259d3c=[];_0x259d3c[_0x9e42('0x57')]({'model':db[_0x9e42('0x58')],'as':_0x9e42('0x58'),'raw':!![]});var _0x113846=[{'model':db[_0x9e42('0x37')],'as':'Messages','attributes':['id',_0x9e42('0x33'),_0x9e42('0x59')],'include':_0x259d3c}];return db['FaxInteraction'][_0x9e42('0x31')]({'where':{'id':_0x570fd9[_0x9e42('0x34')]['id']},'include':_0x113846})[_0x9e42('0x19')](handleEntityNotFound(_0x2dad87,null))[_0x9e42('0x19')](function(_0x340c3a){if(_0x340c3a&&_0x340c3a['Messages']){var _0x129d95=_0x340c3a[_0x9e42('0x5a')]({'plain':!![]});fs[_0x9e42('0x5b')](_0x356610);for(var _0x1a3784=0x0;_0x1a3784<_0x129d95[_0x9e42('0x5c')][_0x9e42('0x2d')];_0x1a3784++){var _0x45db80=_0x129d95['Messages'][_0x1a3784]['Attachment'];if(_0x45db80){var _0xab2434=path['join'](_0x29ba2f,_0x45db80[_0x9e42('0x5d')]);if(fs['existsSync'](_0xab2434)){fs[_0x9e42('0x5e')](_0xab2434)['pipe'](fs['createWriteStream'](path[_0x9e42('0x56')](_0x356610,_0x45db80['basename'])));}}}return BPromise[_0x9e42('0x5f')]()['then'](function(){return new BPromise(function(_0x34d345,_0x396e0d){zipdir(_0x356610,{'saveTo':_0x1ab8f4},function(_0xb16e3d,_0x27fa6d){if(_0xb16e3d)return _0x396e0d(_0xb16e3d);return _0x34d345(_0x27fa6d);});})[_0x9e42('0x19')](function(){return new BPromise(function(_0x2b1eb0,_0xa7359c){rimraf(_0x356610,function(_0x5e8622){if(_0x5e8622)_0xa7359c(_0x5e8622);return _0x2b1eb0();});});})[_0x9e42('0x19')](function(){return _0x2dad87['download'](_0x1ab8f4,_0x1bb775,function(_0x1119f8){if(_0x1119f8){console[_0x9e42('0x60')]('err',_0x1119f8);}else{fs[_0x9e42('0x61')](_0x1ab8f4);}});});});}else{return _0x2dad87[_0x9e42('0xf')](0xc8);}})['catch'](handleError(_0x2dad87,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 3cdfcf7..0419659 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 _0x2733=['map','unreadMessages','emit','catch','hook','exports','../../mysqldb','FaxInteraction','update','remove','getUsers','then','setDataValue','Users'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2733,0x110));var _0x3273=function(_0x45b034,_0x3a57dd){_0x45b034=_0x45b034-0x0;var _0x509cb0=_0x2733[_0x45b034];return _0x509cb0;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x3273('0x0'))['db'][_0x3273('0x1')];var FaxMessage=require(_0x3273('0x0'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x3273('0x2'),'afterDestroy':_0x3273('0x3')};function emitEvent(_0x25e2cb){return function(_0x1f1451,_0x4f2324,_0x547bf6){_0x1f1451[_0x3273('0x4')]({'attributes':['id'],'raw':!![]})[_0x3273('0x5')](function(_0x3dfe89){_0x1f1451[_0x3273('0x6')](_0x3273('0x7'),_0x3dfe89[_0x3273('0x8')](function(_0x49ff31){return{'id':_0x49ff31['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x1f1451['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3273('0x5')](function(_0x2c2a4a){_0x1f1451[_0x3273('0x6')](_0x3273('0x9'),_0x2c2a4a['length']);FaxInteractionEvents[_0x3273('0xa')](_0x25e2cb+':'+_0x1f1451['id'],_0x1f1451);FaxInteractionEvents['emit'](_0x25e2cb,_0x1f1451);_0x547bf6(null);})[_0x3273('0xb')](_0x547bf6(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0x3273('0xc')](e,emitEvent(event));}}module[_0x3273('0xd')]=FaxInteractionEvents; \ No newline at end of file +var _0x00d3=['findAll','setDataValue','unreadMessages','length','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage','save','remove','then','Users','map'];(function(_0xbbc1b,_0x4667c7){var _0x49de02=function(_0x115f1c){while(--_0x115f1c){_0xbbc1b['push'](_0xbbc1b['shift']());}};_0x49de02(++_0x4667c7);}(_0x00d3,0x106));var _0x300d=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x00d3[_0x2dafbe];return _0x58a45a;};'use strict';var EventEmitter=require(_0x300d('0x0'));var FaxInteraction=require(_0x300d('0x1'))['db']['FaxInteraction'];var FaxMessage=require(_0x300d('0x1'))['db'][_0x300d('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x300d('0x3'),'afterUpdate':'update','afterDestroy':_0x300d('0x4')};function emitEvent(_0x1da4a7){return function(_0x495bc8,_0x4cbae8,_0x26fbd1){_0x495bc8['getUsers']({'attributes':['id'],'raw':!![]})[_0x300d('0x5')](function(_0x4fbfe9){_0x495bc8['setDataValue'](_0x300d('0x6'),_0x4fbfe9[_0x300d('0x7')](function(_0x4e35af){return{'id':_0x4e35af['id']};}));return FaxMessage[_0x300d('0x8')]({'where':{'FaxInteractionId':_0x495bc8['id'],'direction':'in','read':![]},'raw':!![]});})[_0x300d('0x5')](function(_0xbfe5a2){_0x495bc8[_0x300d('0x9')](_0x300d('0xa'),_0xbfe5a2[_0x300d('0xb')]);FaxInteractionEvents['emit'](_0x1da4a7+':'+_0x495bc8['id'],_0x495bc8);FaxInteractionEvents['emit'](_0x1da4a7,_0x495bc8);_0x26fbd1(null);})['catch'](_0x26fbd1(null));};}for(var e in events){if(events[_0x300d('0xc')](e)){var event=events[e];FaxInteraction[_0x300d('0xd')](e,emitEvent(event));}}module[_0x300d('0xe')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index e813ced..c9ca8bc 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 _0xdd23=['../../config/logger','api','request-promise','path','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x1c3196,_0x2cccdd){var _0xaf1ad6=function(_0xdd3e10){while(--_0xdd3e10){_0x1c3196['push'](_0x1c3196['shift']());}};_0xaf1ad6(++_0x2cccdd);}(_0xdd23,0x1a3));var _0x3dd2=function(_0x38d06a,_0x235a32){_0x38d06a=_0x38d06a-0x0;var _0x1cc756=_0xdd23[_0x38d06a];return _0x1cc756;};'use strict';var _=require(_0x3dd2('0x0'));var util=require('util');var logger=require(_0x3dd2('0x1'))(_0x3dd2('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3dd2('0x3'));var fs=require('fs');var path=require(_0x3dd2('0x4'));var rimraf=require('rimraf');var config=require(_0x3dd2('0x5'));var attributes=require(_0x3dd2('0x6'));module[_0x3dd2('0x7')]=function(_0x56a54a,_0x45d4cd){return _0x56a54a[_0x3dd2('0x8')](_0x3dd2('0x9'),attributes,{'tableName':_0x3dd2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x26766d,_0x188b65,_0xbc2e67){if(_0x26766d['changed'](_0x3dd2('0xb'))){_0x26766d[_0x3dd2('0xc')]=moment()['format'](_0x3dd2('0xd'));}_0xbc2e67(null,_0x26766d);}}});}; \ No newline at end of file +var _0x69a0=['FaxInteraction','fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','moment','bluebird','request-promise','path','rimraf','exports'];(function(_0x10eb59,_0x3f9bc4){var _0x3f0cff=function(_0x2198d6){while(--_0x2198d6){_0x10eb59['push'](_0x10eb59['shift']());}};_0x3f0cff(++_0x3f9bc4);}(_0x69a0,0x181));var _0x069a=function(_0x32ebee,_0xf5e41b){_0x32ebee=_0x32ebee-0x0;var _0x394447=_0x69a0[_0x32ebee];return _0x394447;};'use strict';var _=require(_0x069a('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x069a('0x1'));var BPromise=require(_0x069a('0x2'));var rp=require(_0x069a('0x3'));var fs=require('fs');var path=require(_0x069a('0x4'));var rimraf=require(_0x069a('0x5'));var config=require('../../config/environment');var attributes=require('./faxInteraction.attributes');module[_0x069a('0x6')]=function(_0x276163,_0x15b82e){return _0x276163['define'](_0x069a('0x7'),attributes,{'tableName':_0x069a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x415ac3,_0x4a61e2,_0xd3cb95){if(_0x415ac3[_0x069a('0x9')](_0x069a('0xa'))){_0x415ac3[_0x069a('0xb')]=moment()[_0x069a('0xc')](_0x069a('0xd'));}_0xd3cb95(null,_0x415ac3);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index cfad474..2c05713 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 _0x6f8f=['UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','attributes','limit','catch','AddTagsToFaxInteraction','find','ids','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./faxInteraction.socket','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x428ce6,_0x1f0a86){var _0x5abc72=function(_0x4f9df3){while(--_0x4f9df3){_0x428ce6['push'](_0x428ce6['shift']());}};_0x5abc72(++_0x1f0a86);}(_0x6f8f,0x1ef));var _0xf6f8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f8f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf6f8('0x0'));var util=require('util');var moment=require(_0xf6f8('0x1'));var BPromise=require(_0xf6f8('0x2'));var rs=require(_0xf6f8('0x3'));var fs=require('fs');var Redis=require(_0xf6f8('0x4'));var db=require(_0xf6f8('0x5'))['db'];var utils=require(_0xf6f8('0x6'));var logger=require('../../config/logger')(_0xf6f8('0x7'));var config=require(_0xf6f8('0x8'));var jayson=require(_0xf6f8('0x9'));var client=jayson[_0xf6f8('0xa')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xf6f8('0xb')],{'host':_0xf6f8('0xc'),'port':0x18eb});var socket=require(_0xf6f8('0xd'))(new Redis(config[_0xf6f8('0xb')]));require(_0xf6f8('0xe'))['register'](socket);function respondWithRpcPromise(_0x3208f8,_0x587012,_0x579f9e){return new BPromise(function(_0x449a88,_0x474a13){return client[_0xf6f8('0xf')](_0x3208f8,_0x579f9e)[_0xf6f8('0x10')](function(_0x41bd1b){logger[_0xf6f8('0x11')](_0xf6f8('0x12'),_0x587012,_0xf6f8('0x13'));logger[_0xf6f8('0x14')](_0xf6f8('0x15'),_0x587012,_0xf6f8('0x13'),JSON[_0xf6f8('0x16')](_0x41bd1b));if(_0x41bd1b[_0xf6f8('0x17')]){if(_0x41bd1b[_0xf6f8('0x17')]['code']===0x1f4){logger['error']('FaxInteraction,\x20%s,\x20%s',_0x587012,_0x41bd1b[_0xf6f8('0x17')]['message']);return _0x474a13(_0x41bd1b['error']['message']);}logger[_0xf6f8('0x17')]('FaxInteraction,\x20%s,\x20%s',_0x587012,_0x41bd1b[_0xf6f8('0x17')][_0xf6f8('0x18')]);return _0x449a88(_0x41bd1b['error'][_0xf6f8('0x18')]);}else{logger['info'](_0xf6f8('0x12'),_0x587012,_0xf6f8('0x13'));_0x449a88(_0x41bd1b['result']['message']);}})['catch'](function(_0x59f16f){logger[_0xf6f8('0x17')]('FaxInteraction,\x20%s,\x20%s',_0x587012,_0x59f16f);_0x474a13(_0x59f16f);});});}exports[_0xf6f8('0x19')]=function(_0x2fabf1){var _0x5b5631=this;return new Promise(function(_0x42c270,_0x1a57b5){return db[_0xf6f8('0x1a')][_0xf6f8('0x1b')](_0x2fabf1[_0xf6f8('0x1c')],{'raw':_0x2fabf1[_0xf6f8('0x1d')]?_0x2fabf1[_0xf6f8('0x1d')][_0xf6f8('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2fabf1['options']?_0x2fabf1[_0xf6f8('0x1d')][_0xf6f8('0x1f')]||null:null,'attributes':_0x2fabf1[_0xf6f8('0x1d')]?_0x2fabf1[_0xf6f8('0x1d')][_0xf6f8('0x20')]||null:null,'limit':_0x2fabf1[_0xf6f8('0x1d')]?_0x2fabf1[_0xf6f8('0x1d')][_0xf6f8('0x21')]||null:null})['then'](function(_0x51bd41){logger['info'](_0xf6f8('0x19'),_0x2fabf1);logger[_0xf6f8('0x14')](_0xf6f8('0x19'),_0x2fabf1,JSON[_0xf6f8('0x16')](_0x51bd41));_0x42c270(_0x51bd41);})[_0xf6f8('0x22')](function(_0x3537a8){logger[_0xf6f8('0x17')]('UpdateFaxInteraction',_0x3537a8[_0xf6f8('0x18')],_0x2fabf1);_0x1a57b5(_0x5b5631[_0xf6f8('0x17')](0x1f4,_0x3537a8[_0xf6f8('0x18')]));});});};exports[_0xf6f8('0x23')]=function(_0x4a4064){return new Promise(function(_0x2cd030,_0x9f02c2){return db[_0xf6f8('0x1a')][_0xf6f8('0x24')]({'where':_0x4a4064['options']?_0x4a4064[_0xf6f8('0x1d')][_0xf6f8('0x1f')]||null:null})[_0xf6f8('0x10')](function(_0x486d16){if(_0x486d16){return _0x486d16['addTags'](_0x4a4064[_0xf6f8('0x1c')]['ids'],_['omit'](_0x4a4064[_0xf6f8('0x1c')],[_0xf6f8('0x25'),'id'])||{});}})[_0xf6f8('0x26')](function(_0x43a2b1){logger['info']('AddTags',_0x4a4064);logger['debug'](_0xf6f8('0x27'),_0x4a4064,JSON[_0xf6f8('0x16')](_0x43a2b1));_0x2cd030(_0x43a2b1);})[_0xf6f8('0x22')](function(_0x12fb11){logger['error'](_0xf6f8('0x27'),_0x12fb11[_0xf6f8('0x18')],_0x4a4064);_0x9f02c2(_this[_0xf6f8('0x17')](0x1f4,_0x12fb11['message']));});});}; \ No newline at end of file +var _0xb0aa=['./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateFaxInteraction','update','body','options','raw','attributes','debug','AddTagsToFaxInteraction','FaxInteraction','find','where','ids','spread','AddTags','lodash','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter'];(function(_0xaf25ae,_0x2001c1){var _0x49732d=function(_0x5b764d){while(--_0x5b764d){_0xaf25ae['push'](_0xaf25ae['shift']());}};_0x49732d(++_0x2001c1);}(_0xb0aa,0xb7));var _0xab0a=function(_0x2d6b62,_0xf37655){_0x2d6b62=_0x2d6b62-0x0;var _0x3dba7c=_0xb0aa[_0x2d6b62];return _0x3dba7c;};'use strict';var _=require(_0xab0a('0x0'));var util=require('util');var moment=require(_0xab0a('0x1'));var BPromise=require('bluebird');var rs=require(_0xab0a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xab0a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xab0a('0x4'))('rpc');var config=require(_0xab0a('0x5'));var jayson=require(_0xab0a('0x6'));var client=jayson[_0xab0a('0x7')][_0xab0a('0x8')]({'port':0x232a});config[_0xab0a('0x9')]=_['defaults'](config[_0xab0a('0x9')],{'host':_0xab0a('0xa'),'port':0x18eb});var socket=require(_0xab0a('0xb'))(new Redis(config[_0xab0a('0x9')]));require(_0xab0a('0xc'))[_0xab0a('0xd')](socket);function respondWithRpcPromise(_0x5bdd92,_0x3a0192,_0x1d5e76){return new BPromise(function(_0x377c81,_0x3e539e){return client[_0xab0a('0xe')](_0x5bdd92,_0x1d5e76)[_0xab0a('0xf')](function(_0x181d7f){logger[_0xab0a('0x10')](_0xab0a('0x11'),_0x3a0192,_0xab0a('0x12'));logger['debug'](_0xab0a('0x13'),_0x3a0192,_0xab0a('0x12'),JSON[_0xab0a('0x14')](_0x181d7f));if(_0x181d7f['error']){if(_0x181d7f[_0xab0a('0x15')]['code']===0x1f4){logger[_0xab0a('0x15')](_0xab0a('0x11'),_0x3a0192,_0x181d7f[_0xab0a('0x15')][_0xab0a('0x16')]);return _0x3e539e(_0x181d7f[_0xab0a('0x15')][_0xab0a('0x16')]);}logger['error'](_0xab0a('0x11'),_0x3a0192,_0x181d7f['error'][_0xab0a('0x16')]);return _0x377c81(_0x181d7f[_0xab0a('0x15')][_0xab0a('0x16')]);}else{logger[_0xab0a('0x10')]('FaxInteraction,\x20%s,\x20%s',_0x3a0192,_0xab0a('0x12'));_0x377c81(_0x181d7f[_0xab0a('0x17')][_0xab0a('0x16')]);}})[_0xab0a('0x18')](function(_0x392e20){logger[_0xab0a('0x15')](_0xab0a('0x11'),_0x3a0192,_0x392e20);_0x3e539e(_0x392e20);});});}exports[_0xab0a('0x19')]=function(_0x566dee){var _0x4a3d59=this;return new Promise(function(_0x399472,_0x23b846){return db['FaxInteraction'][_0xab0a('0x1a')](_0x566dee[_0xab0a('0x1b')],{'raw':_0x566dee[_0xab0a('0x1c')]?_0x566dee['options'][_0xab0a('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x566dee[_0xab0a('0x1c')]?_0x566dee['options']['where']||null:null,'attributes':_0x566dee[_0xab0a('0x1c')]?_0x566dee['options'][_0xab0a('0x1e')]||null:null,'limit':_0x566dee[_0xab0a('0x1c')]?_0x566dee[_0xab0a('0x1c')]['limit']||null:null})[_0xab0a('0xf')](function(_0x36bb7a){logger[_0xab0a('0x10')](_0xab0a('0x19'),_0x566dee);logger[_0xab0a('0x1f')](_0xab0a('0x19'),_0x566dee,JSON['stringify'](_0x36bb7a));_0x399472(_0x36bb7a);})[_0xab0a('0x18')](function(_0xc8b041){logger[_0xab0a('0x15')](_0xab0a('0x19'),_0xc8b041[_0xab0a('0x16')],_0x566dee);_0x23b846(_0x4a3d59['error'](0x1f4,_0xc8b041['message']));});});};exports[_0xab0a('0x20')]=function(_0x1349bc){return new Promise(function(_0x1e79d1,_0x2d7dd8){return db[_0xab0a('0x21')][_0xab0a('0x22')]({'where':_0x1349bc['options']?_0x1349bc['options'][_0xab0a('0x23')]||null:null})['then'](function(_0x2c5cfd){if(_0x2c5cfd){return _0x2c5cfd['addTags'](_0x1349bc[_0xab0a('0x1b')][_0xab0a('0x24')],_['omit'](_0x1349bc[_0xab0a('0x1b')],[_0xab0a('0x24'),'id'])||{});}})[_0xab0a('0x25')](function(_0x2c39e4){logger[_0xab0a('0x10')](_0xab0a('0x26'),_0x1349bc);logger[_0xab0a('0x1f')]('AddTags',_0x1349bc,JSON['stringify'](_0x2c39e4));_0x1e79d1(_0x2c39e4);})[_0xab0a('0x18')](function(_0xa240a4){logger[_0xab0a('0x15')](_0xab0a('0x26'),_0xa240a4[_0xab0a('0x16')],_0x1349bc);_0x2d7dd8(_this[_0xab0a('0x15')](0x1f4,_0xa240a4[_0xab0a('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 3abe645..62e4463 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 _0x1d10=['./faxInteraction.events','save','remove','update','emit','removeListener','register','faxInteraction:'];(function(_0x121d38,_0xd5583b){var _0x2f132a=function(_0x4d5447){while(--_0x4d5447){_0x121d38['push'](_0x121d38['shift']());}};_0x2f132a(++_0xd5583b);}(_0x1d10,0x170));var _0x01d1=function(_0x18f383,_0x7a4150){_0x18f383=_0x18f383-0x0;var _0x2aa6ad=_0x1d10[_0x18f383];return _0x2aa6ad;};'use strict';var FaxInteractionEvents=require(_0x01d1('0x0'));var events=[_0x01d1('0x1'),_0x01d1('0x2'),_0x01d1('0x3')];function createListener(_0x2fe1f9,_0x41e3b0){return function(_0x68e35a){_0x41e3b0[_0x01d1('0x4')](_0x2fe1f9,_0x68e35a);};}function removeListener(_0xb81a0e,_0x15fd9b){return function(){FaxInteractionEvents[_0x01d1('0x5')](_0xb81a0e,_0x15fd9b);};}exports[_0x01d1('0x6')]=function(_0x2f21ec){for(var _0x258dfc=0x0,_0x55ec03=events['length'];_0x258dfc<_0x55ec03;_0x258dfc++){var _0x8c2ac2=events[_0x258dfc];var _0x4cc13c=createListener(_0x01d1('0x7')+_0x8c2ac2,_0x2f21ec);FaxInteractionEvents['on'](_0x8c2ac2,_0x4cc13c);}}; \ No newline at end of file +var _0x4c2a=['update','removeListener','register','length','faxInteraction:','save','remove'];(function(_0x410856,_0x1968b0){var _0x498745=function(_0x4138b4){while(--_0x4138b4){_0x410856['push'](_0x410856['shift']());}};_0x498745(++_0x1968b0);}(_0x4c2a,0x1cc));var _0xa4c2=function(_0x50e703,_0x127370){_0x50e703=_0x50e703-0x0;var _0xf1840c=_0x4c2a[_0x50e703];return _0xf1840c;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0xa4c2('0x0'),_0xa4c2('0x1'),_0xa4c2('0x2')];function createListener(_0x3ea4c0,_0x3815ab){return function(_0x4c7c45){_0x3815ab['emit'](_0x3ea4c0,_0x4c7c45);};}function removeListener(_0xb6eb90,_0x2d8cf7){return function(){FaxInteractionEvents[_0xa4c2('0x3')](_0xb6eb90,_0x2d8cf7);};}exports[_0xa4c2('0x4')]=function(_0x17ded6){for(var _0xe9f74c=0x0,_0x37313c=events[_0xa4c2('0x5')];_0xe9f74c<_0x37313c;_0xe9f74c++){var _0x201679=events[_0xe9f74c];var _0x341c14=createListener(_0xa4c2('0x6')+_0x201679,_0x17ded6);FaxInteractionEvents['on'](_0x201679,_0x341c14);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 248bd9f..55b7495 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 _0xd9dc=['express','Router','fs-extra','../../components/auth/service','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','addMessage','post','/:id/tags','tracked','faxinteraction:addtags','addTags','put','faxinteraction:update','update','delete','fax','faxinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout'];(function(_0x2550eb,_0x3a51e6){var _0x24c7b5=function(_0x15ae91){while(--_0x15ae91){_0x2550eb['push'](_0x2550eb['shift']());}};_0x24c7b5(++_0x3a51e6);}(_0xd9dc,0xa1));var _0xcd9d=function(_0x38c7d8,_0x253557){_0x38c7d8=_0x38c7d8-0x0;var _0x266426=_0xd9dc[_0x38c7d8];return _0x266426;};'use strict';var multer=require(_0xcd9d('0x0'));var util=require(_0xcd9d('0x1'));var path=require(_0xcd9d('0x2'));var timeout=require(_0xcd9d('0x3'));var express=require(_0xcd9d('0x4'));var router=express[_0xcd9d('0x5')]();var fs_extra=require(_0xcd9d('0x6'));var auth=require(_0xcd9d('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./faxInteraction.controller');router['get']('/',auth[_0xcd9d('0x8')](),controller[_0xcd9d('0x9')]);router[_0xcd9d('0xa')](_0xcd9d('0xb'),auth[_0xcd9d('0x8')](),controller[_0xcd9d('0xc')]);router['get'](_0xcd9d('0xd'),auth['isAuthenticated'](),controller[_0xcd9d('0xe')]);router[_0xcd9d('0xa')](_0xcd9d('0xf'),auth[_0xcd9d('0x8')](),controller[_0xcd9d('0x10')]);router['get'](_0xcd9d('0x11'),auth[_0xcd9d('0x8')](),controller[_0xcd9d('0x12')]);router['post']('/',auth[_0xcd9d('0x8')](),controller['create']);router['post'](_0xcd9d('0xf'),auth['isAuthenticated'](),controller[_0xcd9d('0x13')]);router[_0xcd9d('0x14')](_0xcd9d('0x15'),auth[_0xcd9d('0x8')](),interaction[_0xcd9d('0x16')]('fax',_0xcd9d('0x17')),controller[_0xcd9d('0x18')]);router[_0xcd9d('0x19')](_0xcd9d('0xd'),auth['isAuthenticated'](),interaction['tracked']('fax',_0xcd9d('0x1a')),controller[_0xcd9d('0x1b')]);router[_0xcd9d('0x1c')](_0xcd9d('0xd'),auth['isAuthenticated'](),interaction[_0xcd9d('0x16')](_0xcd9d('0x1d'),_0xcd9d('0x1e')),controller[_0xcd9d('0x1f')]);router[_0xcd9d('0x1c')](_0xcd9d('0x15'),auth[_0xcd9d('0x8')](),controller[_0xcd9d('0x20')]);module['exports']=router; \ No newline at end of file +var _0xffa6=['/:id/messages','/:id/tags','tracked','fax','addTags','put','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','/:id','getMessages','/:id/download','download','post','create'];(function(_0x40ddca,_0x374da5){var _0x38064b=function(_0x1118e3){while(--_0x1118e3){_0x40ddca['push'](_0x40ddca['shift']());}};_0x38064b(++_0x374da5);}(_0xffa6,0x1a5));var _0x6ffa=function(_0x4dea3b,_0x1c30d3){_0x4dea3b=_0x4dea3b-0x0;var _0x55d7ae=_0xffa6[_0x4dea3b];return _0x55d7ae;};'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[_0x6ffa('0x5')]();var fs_extra=require(_0x6ffa('0x6'));var auth=require(_0x6ffa('0x7'));var interaction=require(_0x6ffa('0x8'));var config=require(_0x6ffa('0x9'));var controller=require(_0x6ffa('0xa'));router[_0x6ffa('0xb')]('/',auth[_0x6ffa('0xc')](),controller[_0x6ffa('0xd')]);router['get'](_0x6ffa('0xe'),auth[_0x6ffa('0xc')](),controller['describe']);router[_0x6ffa('0xb')](_0x6ffa('0xf'),auth[_0x6ffa('0xc')](),controller['show']);router[_0x6ffa('0xb')]('/:id/messages',auth[_0x6ffa('0xc')](),controller[_0x6ffa('0x10')]);router['get'](_0x6ffa('0x11'),auth['isAuthenticated'](),controller[_0x6ffa('0x12')]);router[_0x6ffa('0x13')]('/',auth[_0x6ffa('0xc')](),controller[_0x6ffa('0x14')]);router[_0x6ffa('0x13')](_0x6ffa('0x15'),auth[_0x6ffa('0xc')](),controller['addMessage']);router[_0x6ffa('0x13')](_0x6ffa('0x16'),auth[_0x6ffa('0xc')](),interaction[_0x6ffa('0x17')](_0x6ffa('0x18'),'faxinteraction:addtags'),controller[_0x6ffa('0x19')]);router[_0x6ffa('0x1a')](_0x6ffa('0xf'),auth['isAuthenticated'](),interaction[_0x6ffa('0x17')](_0x6ffa('0x18'),_0x6ffa('0x1b')),controller[_0x6ffa('0x1c')]);router[_0x6ffa('0x1d')](_0x6ffa('0xf'),auth['isAuthenticated'](),interaction[_0x6ffa('0x17')]('fax',_0x6ffa('0x1e')),controller[_0x6ffa('0x1f')]);router[_0x6ffa('0x1d')](_0x6ffa('0x16'),auth[_0x6ffa('0xc')](),controller[_0x6ffa('0x20')]);module[_0x6ffa('0x21')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index d77f74f..fdbf350 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 _0x7764=['BOOLEAN','ENUM','out','DATE','sequelize','exports','TEXT','medium'];(function(_0x29ba2c,_0x396e48){var _0x5665f4=function(_0x374025){while(--_0x374025){_0x29ba2c['push'](_0x29ba2c['shift']());}};_0x5665f4(++_0x396e48);}(_0x7764,0xa4));var _0x4776=function(_0x503ffd,_0x8ecde){_0x503ffd=_0x503ffd-0x0;var _0x160437=_0x7764[_0x503ffd];return _0x160437;};'use strict';var Sequelize=require(_0x4776('0x0'));module[_0x4776('0x1')]={'body':{'type':Sequelize[_0x4776('0x2')](_0x4776('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x4776('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4776('0x5')]('in',_0x4776('0x6')),'defaultValue':_0x4776('0x6'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x4776('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x4776('0x7')]}}; \ No newline at end of file +var _0x5d70=['TEXT','sequelize','exports','medium','BOOLEAN','ENUM','out'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5d70,0x8d));var _0x05d7=function(_0x326960,_0x11bca7){_0x326960=_0x326960-0x0;var _0x3151f6=_0x5d70[_0x326960];return _0x3151f6;};'use strict';var Sequelize=require(_0x05d7('0x0'));module[_0x05d7('0x1')]={'body':{'type':Sequelize['TEXT'](_0x05d7('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x05d7('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x05d7('0x4')]('in',_0x05d7('0x5')),'defaultValue':_0x05d7('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x05d7('0x6')],'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 243e5e6..2f9c868 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 _0xb9d4=['RejectMessage','sequelize','Sequelize','contact','motionChannel','rejectmessage','create','CmContact','findOne','fax','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','download','join','server','attachments','Attachment','basename','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','stack','send','map','FaxMessage','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','show','length','find','body','params','describe','fax-interactions','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','user','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','User','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','role'];(function(_0x989928,_0x1410d3){var _0x31a662=function(_0x1b0adb){while(--_0x1b0adb){_0x989928['push'](_0x989928['shift']());}};_0x31a662(++_0x1410d3);}(_0xb9d4,0x1c7));var _0x4b9d=function(_0x2f06f1,_0x13a628){_0x2f06f1=_0x2f06f1-0x0;var _0x516baf=_0xb9d4[_0x2f06f1];return _0x516baf;};'use strict';var emlformat=require(_0x4b9d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4b9d('0x1'));var jsonpatch=require(_0x4b9d('0x2'));var rp=require(_0x4b9d('0x3'));var moment=require(_0x4b9d('0x4'));var BPromise=require(_0x4b9d('0x5'));var Mustache=require(_0x4b9d('0x6'));var util=require('util');var path=require(_0x4b9d('0x7'));var sox=require(_0x4b9d('0x8'));var csv=require(_0x4b9d('0x9'));var ejs=require(_0x4b9d('0xa'));var fs=require('fs');var fs_extra=require(_0x4b9d('0xb'));var _=require(_0x4b9d('0xc'));var squel=require(_0x4b9d('0xd'));var crypto=require(_0x4b9d('0xe'));var jsforce=require(_0x4b9d('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x4b9d('0x9'));var querystring=require(_0x4b9d('0x10'));var Papa=require(_0x4b9d('0x11'));var Redis=require(_0x4b9d('0x12'));var authService=require(_0x4b9d('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x4b9d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4b9d('0x15'))(_0x4b9d('0x16'));var utils=require(_0x4b9d('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4b9d('0x18'));var db=require(_0x4b9d('0x19'))['db'];config[_0x4b9d('0x1a')]=_[_0x4b9d('0x1b')](config[_0x4b9d('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x4b9d('0x1c'))(new Redis(config[_0x4b9d('0x1a')]));require(_0x4b9d('0x1d'))[_0x4b9d('0x1e')](socket);var jayson=require(_0x4b9d('0x1f'));var client=jayson[_0x4b9d('0x20')][_0x4b9d('0x21')]({'port':0x232c});var client9002=jayson['client'][_0x4b9d('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x3f53f2,_0x27859f,_0x494017,_0x373585){return new BPromise(function(_0xe37539,_0x5d0318){var _0x1d77cf=_0x373585||client;return _0x1d77cf[_0x4b9d('0x22')](_0x3f53f2,_0x494017)[_0x4b9d('0x23')](function(_0x71ccc3){logger[_0x4b9d('0x24')](_0x4b9d('0x25'),_0x27859f,_0x4b9d('0x26'));logger[_0x4b9d('0x27')](_0x4b9d('0x28'),_0x27859f,_0x4b9d('0x26'),JSON[_0x4b9d('0x29')](_0x71ccc3));if(_0x71ccc3[_0x4b9d('0x2a')]){if(_0x71ccc3['error'][_0x4b9d('0x2b')]===0x1f4){logger['error'](_0x4b9d('0x25'),_0x27859f,_0x71ccc3[_0x4b9d('0x2a')][_0x4b9d('0x2c')]);return _0x5d0318(_0x71ccc3['error'][_0x4b9d('0x2c')]);}logger[_0x4b9d('0x2a')](_0x4b9d('0x25'),_0x27859f,_0x71ccc3[_0x4b9d('0x2a')][_0x4b9d('0x2c')]);return _0xe37539(_0x71ccc3[_0x4b9d('0x2a')][_0x4b9d('0x2c')]);}else{logger[_0x4b9d('0x24')]('FaxMessage,\x20%s,\x20%s',_0x27859f,_0x4b9d('0x26'));_0xe37539(_0x71ccc3[_0x4b9d('0x2d')][_0x4b9d('0x2c')]);}})[_0x4b9d('0x2e')](function(_0x3ff544){logger[_0x4b9d('0x2a')]('FaxMessage,\x20%s,\x20%s',_0x27859f,_0x3ff544);_0x5d0318(_0x3ff544);});});}function respondWithStatusCode(_0x507bf5,_0x1f4cc5){_0x1f4cc5=_0x1f4cc5||0xcc;return function(_0x272bb9){if(_0x272bb9){return _0x507bf5[_0x4b9d('0x2f')](_0x1f4cc5);}return _0x507bf5[_0x4b9d('0x30')](_0x1f4cc5)[_0x4b9d('0x31')]();};}function respondWithResult(_0x266e1b,_0x435a12){_0x435a12=_0x435a12||0xc8;return function(_0x590122){if(_0x590122){return _0x266e1b[_0x4b9d('0x30')](_0x435a12)['json'](_0x590122);}};}function respondWithFilteredResult(_0x20ff85,_0x178dc0){return function(_0x2af124){if(_0x2af124){var _0x52a692=typeof _0x178dc0[_0x4b9d('0x32')]===_0x4b9d('0x33')&&typeof _0x178dc0[_0x4b9d('0x34')]==='undefined';var _0x3b83e5=_0x2af124[_0x4b9d('0x35')];var _0x3220a0=_0x52a692?0x0:_0x178dc0[_0x4b9d('0x32')];var _0xaedf94=_0x52a692?_0x2af124['count']:_0x178dc0[_0x4b9d('0x32')]+_0x178dc0[_0x4b9d('0x34')];var _0x5f23a7;if(_0xaedf94>=_0x3b83e5){_0xaedf94=_0x3b83e5;_0x5f23a7=0xc8;}else{_0x5f23a7=0xce;}_0x20ff85[_0x4b9d('0x30')](_0x5f23a7);return _0x20ff85[_0x4b9d('0x36')]('Content-Range',_0x3220a0+'-'+_0xaedf94+'/'+_0x3b83e5)[_0x4b9d('0x37')](_0x2af124);}return null;};}function patchUpdates(_0xbd253c){return function(_0x3c91c7){try{jsonpatch[_0x4b9d('0x38')](_0x3c91c7,_0xbd253c,!![]);}catch(_0x15cbe1){return BPromise[_0x4b9d('0x39')](_0x15cbe1);}return _0x3c91c7[_0x4b9d('0x3a')]();};}function saveUpdates(_0x161d2d,_0x140a7f){return function(_0x15834d){if(_0x15834d){return _0x15834d[_0x4b9d('0x3b')](_0x161d2d)[_0x4b9d('0x23')](function(_0x5b6c37){return _0x5b6c37;});}return null;};}function removeEntity(_0x44c674,_0x548f21){return function(_0x503012){if(_0x503012){return _0x503012[_0x4b9d('0x3c')]()[_0x4b9d('0x23')](function(){_0x44c674[_0x4b9d('0x30')](0xcc)[_0x4b9d('0x31')]();});}};}function handleEntityNotFound(_0x5e8ccb,_0x56539f){return function(_0x13e57e){if(!_0x13e57e){_0x5e8ccb['sendStatus'](0x194);}return _0x13e57e;};}function handleError(_0x5a484b,_0x429d19){_0x429d19=_0x429d19||0x1f4;return function(_0x1248f6){logger['error'](_0x1248f6[_0x4b9d('0x3d')]);if(_0x1248f6['name']){delete _0x1248f6['name'];}_0x5a484b[_0x4b9d('0x30')](_0x429d19)[_0x4b9d('0x3e')](_0x1248f6);};}exports['index']=function(_0x568c59,_0x4a2aa0){var _0x5af699={},_0x1c7ed3={},_0x1bbe50={'count':0x0,'rows':[]};var _0x32f422=_[_0x4b9d('0x3f')](db[_0x4b9d('0x40')][_0x4b9d('0x41')],function(_0x39e6e1){return{'name':_0x39e6e1[_0x4b9d('0x42')],'type':_0x39e6e1[_0x4b9d('0x43')][_0x4b9d('0x44')]};});_0x1c7ed3[_0x4b9d('0x45')]=_[_0x4b9d('0x3f')](_0x32f422,_0x4b9d('0x46'));_0x1c7ed3[_0x4b9d('0x47')]=_[_0x4b9d('0x48')](_0x568c59['query']);_0x1c7ed3[_0x4b9d('0x49')]=_[_0x4b9d('0x4a')](_0x1c7ed3[_0x4b9d('0x45')],_0x1c7ed3[_0x4b9d('0x47')]);_0x5af699[_0x4b9d('0x4b')]=_[_0x4b9d('0x4a')](_0x1c7ed3['model'],qs[_0x4b9d('0x4c')](_0x568c59[_0x4b9d('0x47')][_0x4b9d('0x4c')]));_0x5af699['attributes']=_0x5af699[_0x4b9d('0x4b')]['length']?_0x5af699['attributes']:_0x1c7ed3[_0x4b9d('0x45')];if(!_0x568c59[_0x4b9d('0x47')][_0x4b9d('0x4d')](_0x4b9d('0x4e'))){_0x5af699[_0x4b9d('0x34')]=qs['limit'](_0x568c59[_0x4b9d('0x47')][_0x4b9d('0x34')]);_0x5af699[_0x4b9d('0x32')]=qs[_0x4b9d('0x32')](_0x568c59[_0x4b9d('0x47')][_0x4b9d('0x32')]);}_0x5af699[_0x4b9d('0x4f')]=qs[_0x4b9d('0x50')](_0x568c59['query'][_0x4b9d('0x50')]);_0x5af699[_0x4b9d('0x51')]=qs[_0x4b9d('0x49')](_['pick'](_0x568c59[_0x4b9d('0x47')],_0x1c7ed3[_0x4b9d('0x49')]),_0x32f422);if(_0x568c59[_0x4b9d('0x47')]['filter']){_0x5af699[_0x4b9d('0x51')]=_['merge'](_0x5af699[_0x4b9d('0x51')],{'$or':_[_0x4b9d('0x3f')](_0x32f422,function(_0xf288b2){if(_0xf288b2['type']!==_0x4b9d('0x52')){var _0x1969f9={};_0x1969f9[_0xf288b2[_0x4b9d('0x46')]]={'$like':'%'+_0x568c59[_0x4b9d('0x47')][_0x4b9d('0x53')]+'%'};return _0x1969f9;}})});}_0x5af699=_[_0x4b9d('0x54')]({},_0x5af699,_0x568c59[_0x4b9d('0x55')]);var _0x2779a3={'where':_0x5af699['where']};return db[_0x4b9d('0x40')]['count'](_0x2779a3)['then'](function(_0x333e95){_0x1bbe50[_0x4b9d('0x35')]=_0x333e95;if(_0x568c59['query'][_0x4b9d('0x56')]){_0x5af699[_0x4b9d('0x57')]=[{'all':!![]}];}return db['FaxMessage'][_0x4b9d('0x58')](_0x5af699);})[_0x4b9d('0x23')](function(_0x548d7a){_0x1bbe50['rows']=_0x548d7a;return _0x1bbe50;})[_0x4b9d('0x23')](respondWithFilteredResult(_0x4a2aa0,_0x5af699))[_0x4b9d('0x2e')](handleError(_0x4a2aa0,null));};exports[_0x4b9d('0x59')]=function(_0x913c67,_0x2842d1){var _0x5cc4ae={'raw':!![],'where':{'id':_0x913c67['params']['id']}},_0x5bf543={};_0x5bf543['model']=_[_0x4b9d('0x48')](db[_0x4b9d('0x40')][_0x4b9d('0x41')]);_0x5bf543[_0x4b9d('0x47')]=_[_0x4b9d('0x48')](_0x913c67['query']);_0x5bf543['filters']=_[_0x4b9d('0x4a')](_0x5bf543[_0x4b9d('0x45')],_0x5bf543['query']);_0x5cc4ae[_0x4b9d('0x4b')]=_[_0x4b9d('0x4a')](_0x5bf543[_0x4b9d('0x45')],qs[_0x4b9d('0x4c')](_0x913c67[_0x4b9d('0x47')][_0x4b9d('0x4c')]));_0x5cc4ae['attributes']=_0x5cc4ae['attributes'][_0x4b9d('0x5a')]?_0x5cc4ae['attributes']:_0x5bf543[_0x4b9d('0x45')];if(_0x913c67[_0x4b9d('0x47')][_0x4b9d('0x56')]){_0x5cc4ae[_0x4b9d('0x57')]=[{'all':!![]}];}_0x5cc4ae=_['merge']({},_0x5cc4ae,_0x913c67[_0x4b9d('0x55')]);return db[_0x4b9d('0x40')][_0x4b9d('0x5b')](_0x5cc4ae)[_0x4b9d('0x23')](handleEntityNotFound(_0x2842d1,null))[_0x4b9d('0x23')](respondWithResult(_0x2842d1,null))[_0x4b9d('0x2e')](handleError(_0x2842d1,null));};exports[_0x4b9d('0x3b')]=function(_0x5d359a,_0x49d9c0){if(_0x5d359a[_0x4b9d('0x5c')]['id']){delete _0x5d359a['body']['id'];}return db[_0x4b9d('0x40')][_0x4b9d('0x5b')]({'where':{'id':_0x5d359a[_0x4b9d('0x5d')]['id']}})[_0x4b9d('0x23')](handleEntityNotFound(_0x49d9c0,null))[_0x4b9d('0x23')](saveUpdates(_0x5d359a[_0x4b9d('0x5c')],null))[_0x4b9d('0x23')](respondWithResult(_0x49d9c0,null))[_0x4b9d('0x2e')](handleError(_0x49d9c0,null));};exports['destroy']=function(_0x14dcfa,_0x5ece7a){return db[_0x4b9d('0x40')][_0x4b9d('0x5b')]({'where':{'id':_0x14dcfa[_0x4b9d('0x5d')]['id']}})['then'](handleEntityNotFound(_0x5ece7a,null))[_0x4b9d('0x23')](removeEntity(_0x5ece7a,null))['catch'](handleError(_0x5ece7a,null));};exports['describe']=function(_0x1144ae,_0xb6bc21){return db[_0x4b9d('0x40')][_0x4b9d('0x5e')]()['then'](respondWithResult(_0xb6bc21,null))[_0x4b9d('0x2e')](handleError(_0xb6bc21,null));};var interaction_log=require(_0x4b9d('0x15'))(_0x4b9d('0x5f'));exports[_0x4b9d('0x60')]=function(_0x6d9876,_0x39ee17,_0x5d05a1){var _0x519535={'agent':{},'channel':'fax'};if(_0x6d9876[_0x4b9d('0x5c')]['id']){delete _0x6d9876['body']['id'];}_0x6d9876[_0x4b9d('0x5c')][_0x4b9d('0x61')]=!![];_0x6d9876[_0x4b9d('0x5c')]['readAt']=moment()[_0x4b9d('0x62')](_0x4b9d('0x63'));_0x6d9876[_0x4b9d('0x5c')]['UserId']=_0x6d9876['body'][_0x4b9d('0x64')]||_0x6d9876['user']['id'];_0x519535[_0x4b9d('0x65')]['id']=_0x6d9876[_0x4b9d('0x5c')][_0x4b9d('0x64')];return db[_0x4b9d('0x40')][_0x4b9d('0x5b')]({'where':{'id':_0x6d9876[_0x4b9d('0x5d')]['id'],'UserId':null}})[_0x4b9d('0x23')](handleEntityNotFound(_0x39ee17,null))['then'](saveUpdates(_0x6d9876[_0x4b9d('0x5c')],null))[_0x4b9d('0x23')](function(_0xdd27e5){if(_0xdd27e5){_0x519535['message']=_0xdd27e5[_0x4b9d('0x66')]({'plain':!![]});return db[_0x4b9d('0x67')]['find']({'where':{'id':_0xdd27e5[_0x4b9d('0x68')]}});}return null;})[_0x4b9d('0x23')](handleEntityNotFound(_0x39ee17,null))[_0x4b9d('0x23')](function(_0x3d4d4d){if(_0x3d4d4d){return _0x3d4d4d[_0x4b9d('0x3b')]({'UserId':_0x6d9876[_0x4b9d('0x5c')]['UserId'],'read1stAt':_[_0x4b9d('0x69')](_0x3d4d4d[_0x4b9d('0x6a')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x4b9d('0x23')](function(_0xb8990a){if(_0xb8990a){_0x519535[_0x4b9d('0x6b')]=_0xb8990a[_0x4b9d('0x66')]({'plain':!![]});interaction_log[_0x4b9d('0x24')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x6d9876[_0x4b9d('0x6c')]['id'],_0x6d9876['user']['name'],_0x6d9876[_0x4b9d('0x6c')]['role'],_0x519535[_0x4b9d('0x6b')]['id'],_0x6d9876[_0x4b9d('0x5c')]?JSON[_0x4b9d('0x29')](_0x6d9876[_0x4b9d('0x5c')]):_0x4b9d('0x6d'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x519535);}return null;})['then'](function(_0x5349b5){var _0x143c70=_0x4b9d('0x6e')+_0x5349b5[_0x4b9d('0x2c')][_0x4b9d('0x6f')];return db['sequelize']['query'](_0x143c70,{'type':db['Sequelize'][_0x4b9d('0x70')]['SELECT'],'raw':!![]})['then'](function(_0x3e0cd0){return _0x3e0cd0;});})[_0x4b9d('0x23')](function(_0x52f6d4){if(_0x52f6d4){_0x519535[_0x4b9d('0x2c')]['contact']=_0x52f6d4[0x0];if(!_0x6d9876['body'][_0x4b9d('0x64')])return;return db[_0x4b9d('0x71')][_0x4b9d('0x5b')]({'where':{'id':_0x6d9876['body'][_0x4b9d('0x64')],'role':_0x4b9d('0x65')},'attributes':['id',_0x4b9d('0x46'),_0x4b9d('0x72'),_0x4b9d('0x73'),_0x4b9d('0x74')],'raw':!![]});}return null;})[_0x4b9d('0x23')](function(_0x2fafe1){if(!_0x2fafe1)return null;_0x519535[_0x4b9d('0x2c')][_0x4b9d('0x65')]=_0x2fafe1;return _0x519535;})['then'](function(_0x744c4c){if(_0x744c4c){if(_0x6d9876[_0x4b9d('0x5c')][_0x4b9d('0x75')]){_0x519535['message'][_0x4b9d('0x76')]=util[_0x4b9d('0x62')](_0x4b9d('0x77'),_0x6d9876[_0x4b9d('0x6c')]['name']);_0x519535[_0x4b9d('0x2c')][_0x4b9d('0x78')]=_0x519535[_0x4b9d('0x78')];_0x519535[_0x4b9d('0x2c')]['motionChannel']=_0x519535[_0x4b9d('0x78')];_0x519535['message'][_0x4b9d('0x79')]=_0x4b9d('0x60');return respondWithRpcPromise(_0x4b9d('0x7a'),'EventManager',{'event':_0x4b9d('0x7b'),'message':_0x519535[_0x4b9d('0x2c')]},client9002)['then'](function(){return _0x519535;});}return _0x519535;}return null;})[_0x4b9d('0x23')](respondWithResult(_0x39ee17,null))['catch'](handleError(_0x39ee17,null));};var interaction_log=require(_0x4b9d('0x15'))(_0x4b9d('0x5f'));exports['reject']=function(_0x30ed3a,_0x3470c7,_0x12057a){var _0xcd8af2={'agent':{},'channel':'fax'};if(_0x30ed3a['body']['id']){delete _0x30ed3a[_0x4b9d('0x5c')]['id'];}_0x30ed3a[_0x4b9d('0x5c')][_0x4b9d('0x64')]=_0x30ed3a[_0x4b9d('0x5c')][_0x4b9d('0x64')]||_0x30ed3a[_0x4b9d('0x6c')]['id'];_0xcd8af2[_0x4b9d('0x65')]['id']=_0x30ed3a[_0x4b9d('0x5c')]['UserId'];return db[_0x4b9d('0x40')][_0x4b9d('0x5b')]({'where':{'id':_0x30ed3a['params']['id'],'UserId':null}})[_0x4b9d('0x23')](handleEntityNotFound(_0x3470c7,null))['then'](function(_0x55e3a7){if(_0x55e3a7){_0xcd8af2['message']=_0x55e3a7[_0x4b9d('0x66')]({'plain':!![]});return db['FaxInteraction'][_0x4b9d('0x5b')]({'where':{'id':_0x55e3a7[_0x4b9d('0x68')]}});}return null;})['then'](handleEntityNotFound(_0x3470c7,null))[_0x4b9d('0x23')](function(_0x9753a0){if(_0x9753a0){_0xcd8af2['interaction']=_0x9753a0[_0x4b9d('0x66')]({'plain':!![]});interaction_log['info']('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x30ed3a[_0x4b9d('0x6c')]['id'],_0x30ed3a[_0x4b9d('0x6c')]['name'],_0x30ed3a[_0x4b9d('0x6c')][_0x4b9d('0x7c')],_0xcd8af2[_0x4b9d('0x6b')]['id'],_0x30ed3a[_0x4b9d('0x5c')]?JSON['stringify'](_0x30ed3a[_0x4b9d('0x5c')]):_0x4b9d('0x6d'));return respondWithRpcPromise(_0x4b9d('0x7d'),'rejectMessage',_0xcd8af2);}return null;})[_0x4b9d('0x23')](function(_0x459da7){var _0x230da7=_0x4b9d('0x6e')+_0x459da7[_0x4b9d('0x2c')]['ContactId'];return db[_0x4b9d('0x7e')][_0x4b9d('0x47')](_0x230da7,{'type':db[_0x4b9d('0x7f')][_0x4b9d('0x70')]['SELECT'],'raw':!![]})[_0x4b9d('0x23')](function(_0x43fde6){return _0x43fde6;});})['then'](function(_0x1037dc){if(_0x1037dc){_0xcd8af2[_0x4b9d('0x2c')][_0x4b9d('0x80')]=_0x1037dc[0x0];if(!_0x30ed3a[_0x4b9d('0x5c')][_0x4b9d('0x64')])return;return db[_0x4b9d('0x71')][_0x4b9d('0x5b')]({'where':{'id':_0x30ed3a[_0x4b9d('0x5c')]['UserId'],'role':_0x4b9d('0x65')},'attributes':['id','name','fullname',_0x4b9d('0x73'),_0x4b9d('0x74')],'raw':!![]});}return null;})[_0x4b9d('0x23')](function(_0x1af72b){if(!_0x1af72b)return null;_0xcd8af2['message'][_0x4b9d('0x65')]=_0x1af72b;return _0xcd8af2;})[_0x4b9d('0x23')](function(_0x4424bf){if(_0x4424bf){_0x4424bf[_0x4b9d('0x2c')][_0x4b9d('0x76')]=util['format'](_0x4b9d('0x77'),_0x30ed3a[_0x4b9d('0x6c')][_0x4b9d('0x46')]);_0x4424bf[_0x4b9d('0x2c')][_0x4b9d('0x78')]=_0xcd8af2[_0x4b9d('0x78')];_0x4424bf[_0x4b9d('0x2c')][_0x4b9d('0x81')]=_0xcd8af2[_0x4b9d('0x78')];_0x4424bf[_0x4b9d('0x2c')][_0x4b9d('0x79')]=_0x4b9d('0x39');respondWithRpcPromise('EventManager',_0x4b9d('0x7a'),{'event':_0x4b9d('0x82'),'message':_0x4424bf['message']},client9002);return _0xcd8af2;}return null;})['then'](respondWithResult(_0x3470c7,null))['catch'](handleError(_0x3470c7,null));};exports[_0x4b9d('0x83')]=function(_0x428153,_0x54af71){var _0x1e6cad;return db[_0x4b9d('0x40')][_0x4b9d('0x83')](_0x428153[_0x4b9d('0x5c')],{})[_0x4b9d('0x23')](function(_0x2a85a7){_0x1e6cad=_0x2a85a7;return db[_0x4b9d('0x84')][_0x4b9d('0x85')]({'where':{'id':_0x1e6cad['ContactId']}});})['then'](function(_0x365baf){if(_[_0x4b9d('0x69')](_0x365baf)){return;}else{_0x1e6cad[_0x4b9d('0x86')]=_0x365baf[_0x4b9d('0x86')];return db['Attachment'][_0x4b9d('0x85')]({'where':{'id':_0x1e6cad[_0x4b9d('0x87')]}});}})[_0x4b9d('0x23')](function(_0x41abc3){return respondWithRpcPromise('SendFax',_0x4b9d('0x88'),{'FaxAccountId':_[_0x4b9d('0x69')](_0x428153[_0x4b9d('0x5c')])?undefined:_0x428153[_0x4b9d('0x5c')][_0x4b9d('0x89')],'path':_[_0x4b9d('0x69')](_0x41abc3)?undefined:util[_0x4b9d('0x62')](_0x4b9d('0x8a'),_0x41abc3['basename']),'fax':_['isNil'](_0x1e6cad['fax'])?undefined:_0x1e6cad['fax'],'AttachmentId':_0x1e6cad[_0x4b9d('0x87')]},client9002);})[_0x4b9d('0x23')](respondWithResult(_0x54af71,0xc9))[_0x4b9d('0x2e')](handleError(_0x54af71,null));};exports[_0x4b9d('0x8b')]=function(_0x53d7b0,_0x7f767b){var _0x53c5e8=path[_0x4b9d('0x8c')](config['root'],_0x4b9d('0x8d'),'files',_0x4b9d('0x8e'));return db[_0x4b9d('0x40')][_0x4b9d('0x5b')]({'where':{'id':_0x53d7b0[_0x4b9d('0x5d')]['id']},'include':[{'model':db[_0x4b9d('0x8f')],'as':_0x4b9d('0x8f')}]})[_0x4b9d('0x23')](handleEntityNotFound(_0x7f767b,null))[_0x4b9d('0x23')](function(_0x2f94b9){if(_0x2f94b9){return _0x7f767b['download'](path[_0x4b9d('0x8c')](_0x53c5e8,_0x2f94b9[_0x4b9d('0x8f')][_0x4b9d('0x90')]));}})[_0x4b9d('0x2e')](handleError(_0x7f767b,null));}; \ No newline at end of file +var _0xda6e=['api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','jayson/promise','http','client','request','then','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','index','map','rawAttributes','fieldName','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','FaxMessage','findAll','rows','show','params','keys','body','find','describe','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','rejectMessage','email','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','files','attachments','eml-format','rimraf','zip-dir','moment','bluebird','util','sox','ejs','fs-extra','squel','jsforce','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x315319,_0x947606){var _0x13e947=function(_0x120c6a){while(--_0x120c6a){_0x315319['push'](_0x315319['shift']());}};_0x13e947(++_0x947606);}(_0xda6e,0x111));var _0xeda6=function(_0x5ef863,_0x455ead){_0x5ef863=_0x5ef863-0x0;var _0x1381c9=_0xda6e[_0x5ef863];return _0x1381c9;};'use strict';var emlformat=require(_0xeda6('0x0'));var rimraf=require(_0xeda6('0x1'));var zipdir=require(_0xeda6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xeda6('0x3'));var BPromise=require(_0xeda6('0x4'));var Mustache=require('mustache');var util=require(_0xeda6('0x5'));var path=require('path');var sox=require(_0xeda6('0x6'));var csv=require('to-csv');var ejs=require(_0xeda6('0x7'));var fs=require('fs');var fs_extra=require(_0xeda6('0x8'));var _=require('lodash');var squel=require(_0xeda6('0x9'));var crypto=require('crypto');var jsforce=require(_0xeda6('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xeda6('0xb'));var querystring=require(_0xeda6('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xeda6('0xd'));var as=require(_0xeda6('0xe'));var hardwareService=require(_0xeda6('0xf'));var logger=require(_0xeda6('0x10'))(_0xeda6('0x11'));var utils=require(_0xeda6('0x12'));var config=require(_0xeda6('0x13'));var licenseUtil=require(_0xeda6('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xeda6('0x15')](config[_0xeda6('0x16')],{'host':_0xeda6('0x17'),'port':0x18eb});var socket=require(_0xeda6('0x18'))(new Redis(config[_0xeda6('0x16')]));require('./faxMessage.socket')['register'](socket);var jayson=require(_0xeda6('0x19'));var client=jayson['client'][_0xeda6('0x1a')]({'port':0x232c});var client9002=jayson[_0xeda6('0x1b')][_0xeda6('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x49c666,_0x3470a6,_0x3d9424,_0x1d4887){return new BPromise(function(_0x2d8390,_0x20fb27){var _0xee2001=_0x1d4887||client;return _0xee2001[_0xeda6('0x1c')](_0x49c666,_0x3d9424)[_0xeda6('0x1d')](function(_0x5b5697){logger[_0xeda6('0x1e')]('FaxMessage,\x20%s,\x20%s',_0x3470a6,_0xeda6('0x1f'));logger[_0xeda6('0x20')](_0xeda6('0x21'),_0x3470a6,_0xeda6('0x1f'),JSON[_0xeda6('0x22')](_0x5b5697));if(_0x5b5697[_0xeda6('0x23')]){if(_0x5b5697[_0xeda6('0x23')][_0xeda6('0x24')]===0x1f4){logger[_0xeda6('0x23')](_0xeda6('0x25'),_0x3470a6,_0x5b5697[_0xeda6('0x23')][_0xeda6('0x26')]);return _0x20fb27(_0x5b5697['error'][_0xeda6('0x26')]);}logger['error'](_0xeda6('0x25'),_0x3470a6,_0x5b5697[_0xeda6('0x23')][_0xeda6('0x26')]);return _0x2d8390(_0x5b5697[_0xeda6('0x23')][_0xeda6('0x26')]);}else{logger[_0xeda6('0x1e')]('FaxMessage,\x20%s,\x20%s',_0x3470a6,_0xeda6('0x1f'));_0x2d8390(_0x5b5697['result'][_0xeda6('0x26')]);}})[_0xeda6('0x27')](function(_0x5019d8){logger[_0xeda6('0x23')](_0xeda6('0x25'),_0x3470a6,_0x5019d8);_0x20fb27(_0x5019d8);});});}function respondWithStatusCode(_0x2cde2c,_0x455c73){_0x455c73=_0x455c73||0xcc;return function(_0x280303){if(_0x280303){return _0x2cde2c[_0xeda6('0x28')](_0x455c73);}return _0x2cde2c[_0xeda6('0x29')](_0x455c73)[_0xeda6('0x2a')]();};}function respondWithResult(_0x3d63da,_0x3dfdb1){_0x3dfdb1=_0x3dfdb1||0xc8;return function(_0x11db30){if(_0x11db30){return _0x3d63da['status'](_0x3dfdb1)[_0xeda6('0x2b')](_0x11db30);}};}function respondWithFilteredResult(_0x1d31e4,_0x54b29d){return function(_0x5c161f){if(_0x5c161f){var _0x58e1e7=typeof _0x54b29d[_0xeda6('0x2c')]===_0xeda6('0x2d')&&typeof _0x54b29d[_0xeda6('0x2e')]===_0xeda6('0x2d');var _0x210b3a=_0x5c161f['count'];var _0x1a2dcf=_0x58e1e7?0x0:_0x54b29d[_0xeda6('0x2c')];var _0x55e548=_0x58e1e7?_0x5c161f[_0xeda6('0x2f')]:_0x54b29d[_0xeda6('0x2c')]+_0x54b29d['limit'];var _0x4009de;if(_0x55e548>=_0x210b3a){_0x55e548=_0x210b3a;_0x4009de=0xc8;}else{_0x4009de=0xce;}_0x1d31e4[_0xeda6('0x29')](_0x4009de);return _0x1d31e4[_0xeda6('0x30')](_0xeda6('0x31'),_0x1a2dcf+'-'+_0x55e548+'/'+_0x210b3a)[_0xeda6('0x2b')](_0x5c161f);}return null;};}function patchUpdates(_0x252f08){return function(_0x3af72e){try{jsonpatch[_0xeda6('0x32')](_0x3af72e,_0x252f08,!![]);}catch(_0x244866){return BPromise[_0xeda6('0x33')](_0x244866);}return _0x3af72e[_0xeda6('0x34')]();};}function saveUpdates(_0x52b8d4,_0x2c7ecb){return function(_0x17799f){if(_0x17799f){return _0x17799f[_0xeda6('0x35')](_0x52b8d4)['then'](function(_0xa35bbe){return _0xa35bbe;});}return null;};}function removeEntity(_0x2626e3,_0x53899d){return function(_0x52e97e){if(_0x52e97e){return _0x52e97e[_0xeda6('0x36')]()[_0xeda6('0x1d')](function(){_0x2626e3[_0xeda6('0x29')](0xcc)[_0xeda6('0x2a')]();});}};}function handleEntityNotFound(_0x25b22a,_0x16f9e1){return function(_0x2944ad){if(!_0x2944ad){_0x25b22a['sendStatus'](0x194);}return _0x2944ad;};}function handleError(_0x8a0a80,_0x4220b5){_0x4220b5=_0x4220b5||0x1f4;return function(_0x39f9a6){logger[_0xeda6('0x23')](_0x39f9a6[_0xeda6('0x37')]);if(_0x39f9a6[_0xeda6('0x38')]){delete _0x39f9a6[_0xeda6('0x38')];}_0x8a0a80[_0xeda6('0x29')](_0x4220b5)['send'](_0x39f9a6);};}exports[_0xeda6('0x39')]=function(_0x22e2cc,_0x517d67){var _0x1015be={},_0x39b4f7={},_0x4656de={'count':0x0,'rows':[]};var _0x23fe63=_[_0xeda6('0x3a')](db['FaxMessage'][_0xeda6('0x3b')],function(_0x20ab6d){return{'name':_0x20ab6d[_0xeda6('0x3c')],'type':_0x20ab6d['type']['key']};});_0x39b4f7[_0xeda6('0x3d')]=_[_0xeda6('0x3a')](_0x23fe63,'name');_0x39b4f7['query']=_['keys'](_0x22e2cc[_0xeda6('0x3e')]);_0x39b4f7[_0xeda6('0x3f')]=_['intersection'](_0x39b4f7[_0xeda6('0x3d')],_0x39b4f7[_0xeda6('0x3e')]);_0x1015be[_0xeda6('0x40')]=_[_0xeda6('0x41')](_0x39b4f7[_0xeda6('0x3d')],qs[_0xeda6('0x42')](_0x22e2cc['query'][_0xeda6('0x42')]));_0x1015be[_0xeda6('0x40')]=_0x1015be[_0xeda6('0x40')][_0xeda6('0x43')]?_0x1015be[_0xeda6('0x40')]:_0x39b4f7[_0xeda6('0x3d')];if(!_0x22e2cc[_0xeda6('0x3e')][_0xeda6('0x44')](_0xeda6('0x45'))){_0x1015be[_0xeda6('0x2e')]=qs[_0xeda6('0x2e')](_0x22e2cc[_0xeda6('0x3e')]['limit']);_0x1015be[_0xeda6('0x2c')]=qs[_0xeda6('0x2c')](_0x22e2cc['query'][_0xeda6('0x2c')]);}_0x1015be['order']=qs['sort'](_0x22e2cc[_0xeda6('0x3e')][_0xeda6('0x46')]);_0x1015be[_0xeda6('0x47')]=qs[_0xeda6('0x3f')](_[_0xeda6('0x48')](_0x22e2cc[_0xeda6('0x3e')],_0x39b4f7[_0xeda6('0x3f')]),_0x23fe63);if(_0x22e2cc[_0xeda6('0x3e')][_0xeda6('0x49')]){_0x1015be[_0xeda6('0x47')]=_[_0xeda6('0x4a')](_0x1015be['where'],{'$or':_[_0xeda6('0x3a')](_0x23fe63,function(_0x1c0fc2){if(_0x1c0fc2['type']!==_0xeda6('0x4b')){var _0x579c33={};_0x579c33[_0x1c0fc2[_0xeda6('0x38')]]={'$like':'%'+_0x22e2cc[_0xeda6('0x3e')][_0xeda6('0x49')]+'%'};return _0x579c33;}})});}_0x1015be=_['merge']({},_0x1015be,_0x22e2cc[_0xeda6('0x4c')]);var _0xb8cdab={'where':_0x1015be['where']};return db['FaxMessage'][_0xeda6('0x2f')](_0xb8cdab)[_0xeda6('0x1d')](function(_0x5c6c7d){_0x4656de[_0xeda6('0x2f')]=_0x5c6c7d;if(_0x22e2cc[_0xeda6('0x3e')][_0xeda6('0x4d')]){_0x1015be[_0xeda6('0x4e')]=[{'all':!![]}];}return db[_0xeda6('0x4f')][_0xeda6('0x50')](_0x1015be);})['then'](function(_0x57469c){_0x4656de[_0xeda6('0x51')]=_0x57469c;return _0x4656de;})[_0xeda6('0x1d')](respondWithFilteredResult(_0x517d67,_0x1015be))[_0xeda6('0x27')](handleError(_0x517d67,null));};exports[_0xeda6('0x52')]=function(_0x5a4cb9,_0x1c0afa){var _0x2e7320={'raw':!![],'where':{'id':_0x5a4cb9[_0xeda6('0x53')]['id']}},_0x40d527={};_0x40d527[_0xeda6('0x3d')]=_['keys'](db['FaxMessage']['rawAttributes']);_0x40d527['query']=_[_0xeda6('0x54')](_0x5a4cb9['query']);_0x40d527[_0xeda6('0x3f')]=_[_0xeda6('0x41')](_0x40d527[_0xeda6('0x3d')],_0x40d527[_0xeda6('0x3e')]);_0x2e7320[_0xeda6('0x40')]=_[_0xeda6('0x41')](_0x40d527[_0xeda6('0x3d')],qs[_0xeda6('0x42')](_0x5a4cb9[_0xeda6('0x3e')]['fields']));_0x2e7320['attributes']=_0x2e7320['attributes'][_0xeda6('0x43')]?_0x2e7320[_0xeda6('0x40')]:_0x40d527[_0xeda6('0x3d')];if(_0x5a4cb9['query'][_0xeda6('0x4d')]){_0x2e7320['include']=[{'all':!![]}];}_0x2e7320=_[_0xeda6('0x4a')]({},_0x2e7320,_0x5a4cb9[_0xeda6('0x4c')]);return db[_0xeda6('0x4f')]['find'](_0x2e7320)['then'](handleEntityNotFound(_0x1c0afa,null))[_0xeda6('0x1d')](respondWithResult(_0x1c0afa,null))[_0xeda6('0x27')](handleError(_0x1c0afa,null));};exports[_0xeda6('0x35')]=function(_0x16b9e2,_0x5774ec){if(_0x16b9e2[_0xeda6('0x55')]['id']){delete _0x16b9e2[_0xeda6('0x55')]['id'];}return db['FaxMessage'][_0xeda6('0x56')]({'where':{'id':_0x16b9e2['params']['id']}})[_0xeda6('0x1d')](handleEntityNotFound(_0x5774ec,null))['then'](saveUpdates(_0x16b9e2[_0xeda6('0x55')],null))[_0xeda6('0x1d')](respondWithResult(_0x5774ec,null))['catch'](handleError(_0x5774ec,null));};exports[_0xeda6('0x36')]=function(_0x4f4ec3,_0x435589){return db['FaxMessage'][_0xeda6('0x56')]({'where':{'id':_0x4f4ec3[_0xeda6('0x53')]['id']}})[_0xeda6('0x1d')](handleEntityNotFound(_0x435589,null))[_0xeda6('0x1d')](removeEntity(_0x435589,null))[_0xeda6('0x27')](handleError(_0x435589,null));};exports[_0xeda6('0x57')]=function(_0x5eff5b,_0x4c1e64){return db[_0xeda6('0x4f')]['describe']()[_0xeda6('0x1d')](respondWithResult(_0x4c1e64,null))[_0xeda6('0x27')](handleError(_0x4c1e64,null));};var interaction_log=require('../../config/logger')(_0xeda6('0x58'));exports[_0xeda6('0x59')]=function(_0x430fcb,_0x26af33,_0x3d8437){var _0x480bb0={'agent':{},'channel':_0xeda6('0x5a')};if(_0x430fcb[_0xeda6('0x55')]['id']){delete _0x430fcb[_0xeda6('0x55')]['id'];}_0x430fcb['body'][_0xeda6('0x5b')]=!![];_0x430fcb[_0xeda6('0x55')][_0xeda6('0x5c')]=moment()[_0xeda6('0x5d')](_0xeda6('0x5e'));_0x430fcb['body'][_0xeda6('0x5f')]=_0x430fcb[_0xeda6('0x55')][_0xeda6('0x5f')]||_0x430fcb[_0xeda6('0x60')]['id'];_0x480bb0[_0xeda6('0x61')]['id']=_0x430fcb['body']['UserId'];return db['FaxMessage']['find']({'where':{'id':_0x430fcb[_0xeda6('0x53')]['id'],'UserId':null}})[_0xeda6('0x1d')](handleEntityNotFound(_0x26af33,null))['then'](saveUpdates(_0x430fcb[_0xeda6('0x55')],null))[_0xeda6('0x1d')](function(_0x5ab09e){if(_0x5ab09e){_0x480bb0['message']=_0x5ab09e[_0xeda6('0x62')]({'plain':!![]});return db[_0xeda6('0x63')][_0xeda6('0x56')]({'where':{'id':_0x5ab09e[_0xeda6('0x64')]}});}return null;})[_0xeda6('0x1d')](handleEntityNotFound(_0x26af33,null))['then'](function(_0x4d944e){if(_0x4d944e){return _0x4d944e['update']({'UserId':_0x430fcb[_0xeda6('0x55')][_0xeda6('0x5f')],'read1stAt':_[_0xeda6('0x65')](_0x4d944e[_0xeda6('0x66')])?moment()[_0xeda6('0x5d')](_0xeda6('0x5e')):undefined});}return null;})[_0xeda6('0x1d')](function(_0x2623b0){if(_0x2623b0){_0x480bb0[_0xeda6('0x67')]=_0x2623b0[_0xeda6('0x62')]({'plain':!![]});interaction_log[_0xeda6('0x1e')](_0xeda6('0x68'),_0x430fcb['user']['id'],_0x430fcb[_0xeda6('0x60')]['name'],_0x430fcb[_0xeda6('0x60')]['role'],_0x480bb0[_0xeda6('0x67')]['id'],_0x430fcb[_0xeda6('0x55')]?JSON[_0xeda6('0x22')](_0x430fcb['body']):'null');return respondWithRpcPromise(_0xeda6('0x69'),_0xeda6('0x6a'),_0x480bb0);}return null;})[_0xeda6('0x1d')](function(_0x2b4f55){var _0x3ae376=_0xeda6('0x6b')+_0x2b4f55['message'][_0xeda6('0x6c')];return db[_0xeda6('0x6d')][_0xeda6('0x3e')](_0x3ae376,{'type':db[_0xeda6('0x6e')][_0xeda6('0x6f')][_0xeda6('0x70')],'raw':!![]})[_0xeda6('0x1d')](function(_0xd82b29){return _0xd82b29;});})['then'](function(_0x5e7d16){if(_0x5e7d16){_0x480bb0['message'][_0xeda6('0x71')]=_0x5e7d16[0x0];if(!_0x430fcb[_0xeda6('0x55')]['UserId'])return;return db[_0xeda6('0x72')][_0xeda6('0x56')]({'where':{'id':_0x430fcb[_0xeda6('0x55')][_0xeda6('0x5f')],'role':_0xeda6('0x61')},'attributes':['id',_0xeda6('0x38'),_0xeda6('0x73'),'email',_0xeda6('0x74')],'raw':!![]});}return null;})[_0xeda6('0x1d')](function(_0x262dac){if(!_0x262dac)return null;_0x480bb0[_0xeda6('0x26')]['agent']=_0x262dac;return _0x480bb0;})[_0xeda6('0x1d')](function(_0x1e7100){if(_0x1e7100){if(_0x430fcb[_0xeda6('0x55')][_0xeda6('0x75')]){_0x480bb0[_0xeda6('0x26')][_0xeda6('0x76')]=util[_0xeda6('0x5d')](_0xeda6('0x77'),_0x430fcb[_0xeda6('0x60')]['name']);_0x480bb0[_0xeda6('0x26')][_0xeda6('0x78')]=_0x480bb0['channel'];_0x480bb0[_0xeda6('0x26')][_0xeda6('0x79')]=_0x480bb0[_0xeda6('0x78')];_0x480bb0[_0xeda6('0x26')][_0xeda6('0x7a')]=_0xeda6('0x59');return respondWithRpcPromise(_0xeda6('0x7b'),_0xeda6('0x7b'),{'event':_0xeda6('0x7c'),'message':_0x480bb0[_0xeda6('0x26')]},client9002)[_0xeda6('0x1d')](function(){return _0x480bb0;});}return _0x480bb0;}return null;})[_0xeda6('0x1d')](respondWithResult(_0x26af33,null))[_0xeda6('0x27')](handleError(_0x26af33,null));};var interaction_log=require(_0xeda6('0x10'))(_0xeda6('0x58'));exports[_0xeda6('0x33')]=function(_0x1e15e9,_0x4fc4f2,_0x4f6f2d){var _0xd47a63={'agent':{},'channel':_0xeda6('0x5a')};if(_0x1e15e9['body']['id']){delete _0x1e15e9[_0xeda6('0x55')]['id'];}_0x1e15e9[_0xeda6('0x55')][_0xeda6('0x5f')]=_0x1e15e9[_0xeda6('0x55')][_0xeda6('0x5f')]||_0x1e15e9['user']['id'];_0xd47a63['agent']['id']=_0x1e15e9[_0xeda6('0x55')][_0xeda6('0x5f')];return db['FaxMessage'][_0xeda6('0x56')]({'where':{'id':_0x1e15e9[_0xeda6('0x53')]['id'],'UserId':null}})[_0xeda6('0x1d')](handleEntityNotFound(_0x4fc4f2,null))[_0xeda6('0x1d')](function(_0xda3db4){if(_0xda3db4){_0xd47a63[_0xeda6('0x26')]=_0xda3db4[_0xeda6('0x62')]({'plain':!![]});return db[_0xeda6('0x63')][_0xeda6('0x56')]({'where':{'id':_0xda3db4[_0xeda6('0x64')]}});}return null;})[_0xeda6('0x1d')](handleEntityNotFound(_0x4fc4f2,null))[_0xeda6('0x1d')](function(_0x2f81e5){if(_0x2f81e5){_0xd47a63[_0xeda6('0x67')]=_0x2f81e5[_0xeda6('0x62')]({'plain':!![]});interaction_log[_0xeda6('0x1e')](_0xeda6('0x7d'),_0x1e15e9[_0xeda6('0x60')]['id'],_0x1e15e9[_0xeda6('0x60')]['name'],_0x1e15e9[_0xeda6('0x60')][_0xeda6('0x7e')],_0xd47a63['interaction']['id'],_0x1e15e9['body']?JSON['stringify'](_0x1e15e9['body']):_0xeda6('0x7f'));return respondWithRpcPromise('RejectMessage',_0xeda6('0x80'),_0xd47a63);}return null;})[_0xeda6('0x1d')](function(_0x5b4772){var _0xf6a90c=_0xeda6('0x6b')+_0x5b4772[_0xeda6('0x26')]['ContactId'];return db[_0xeda6('0x6d')]['query'](_0xf6a90c,{'type':db['Sequelize'][_0xeda6('0x6f')][_0xeda6('0x70')],'raw':!![]})[_0xeda6('0x1d')](function(_0x17f327){return _0x17f327;});})[_0xeda6('0x1d')](function(_0x168166){if(_0x168166){_0xd47a63['message'][_0xeda6('0x71')]=_0x168166[0x0];if(!_0x1e15e9[_0xeda6('0x55')][_0xeda6('0x5f')])return;return db[_0xeda6('0x72')][_0xeda6('0x56')]({'where':{'id':_0x1e15e9[_0xeda6('0x55')][_0xeda6('0x5f')],'role':_0xeda6('0x61')},'attributes':['id',_0xeda6('0x38'),_0xeda6('0x73'),_0xeda6('0x81'),_0xeda6('0x74')],'raw':!![]});}return null;})[_0xeda6('0x1d')](function(_0x1ba26e){if(!_0x1ba26e)return null;_0xd47a63[_0xeda6('0x26')]['agent']=_0x1ba26e;return _0xd47a63;})[_0xeda6('0x1d')](function(_0xb93089){if(_0xb93089){_0xb93089['message']['interface']=util[_0xeda6('0x5d')](_0xeda6('0x77'),_0x1e15e9[_0xeda6('0x60')][_0xeda6('0x38')]);_0xb93089[_0xeda6('0x26')]['channel']=_0xd47a63[_0xeda6('0x78')];_0xb93089[_0xeda6('0x26')][_0xeda6('0x79')]=_0xd47a63['channel'];_0xb93089[_0xeda6('0x26')]['event']=_0xeda6('0x33');respondWithRpcPromise(_0xeda6('0x7b'),_0xeda6('0x7b'),{'event':_0xeda6('0x82'),'message':_0xb93089[_0xeda6('0x26')]},client9002);return _0xd47a63;}return null;})['then'](respondWithResult(_0x4fc4f2,null))[_0xeda6('0x27')](handleError(_0x4fc4f2,null));};exports[_0xeda6('0x83')]=function(_0x1e9c57,_0x4eb3d5){var _0x14908c;return db[_0xeda6('0x4f')]['create'](_0x1e9c57[_0xeda6('0x55')],{})[_0xeda6('0x1d')](function(_0x10660f){_0x14908c=_0x10660f;return db[_0xeda6('0x84')][_0xeda6('0x85')]({'where':{'id':_0x14908c[_0xeda6('0x6c')]}});})[_0xeda6('0x1d')](function(_0x3497dc){if(_['isNil'](_0x3497dc)){return;}else{_0x14908c['fax']=_0x3497dc['fax'];return db[_0xeda6('0x86')]['findOne']({'where':{'id':_0x14908c[_0xeda6('0x87')]}});}})[_0xeda6('0x1d')](function(_0x1288dd){return respondWithRpcPromise(_0xeda6('0x88'),'SendFax',{'FaxAccountId':_[_0xeda6('0x65')](_0x1e9c57[_0xeda6('0x55')])?undefined:_0x1e9c57[_0xeda6('0x55')]['FaxAccountId'],'path':_['isNil'](_0x1288dd)?undefined:util['format'](_0xeda6('0x89'),_0x1288dd[_0xeda6('0x8a')]),'fax':_['isNil'](_0x14908c['fax'])?undefined:_0x14908c['fax'],'AttachmentId':_0x14908c['AttachmentId']},client9002);})[_0xeda6('0x1d')](respondWithResult(_0x4eb3d5,0xc9))[_0xeda6('0x27')](handleError(_0x4eb3d5,null));};exports[_0xeda6('0x8b')]=function(_0x2ede2e,_0x7283e1){var _0x1d9af7=path[_0xeda6('0x8c')](config[_0xeda6('0x8d')],_0xeda6('0x8e'),_0xeda6('0x8f'),_0xeda6('0x90'));return db[_0xeda6('0x4f')][_0xeda6('0x56')]({'where':{'id':_0x2ede2e['params']['id']},'include':[{'model':db[_0xeda6('0x86')],'as':'Attachment'}]})[_0xeda6('0x1d')](handleEntityNotFound(_0x7283e1,null))['then'](function(_0x53de09){if(_0x53de09){return _0x7283e1[_0xeda6('0x8b')](path[_0xeda6('0x8c')](_0x1d9af7,_0x53de09['Attachment']['basename']));}})[_0xeda6('0x27')](handleError(_0x7283e1,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 5840461..d5ee6c0 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 _0x9e6d=['save','remove','emit','exports','events','FaxMessage','setMaxListeners'];(function(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0x9e6d,0x1d2));var _0xd9e6=function(_0x33f81c,_0x1e6914){_0x33f81c=_0x33f81c-0x0;var _0x559e94=_0x9e6d[_0x33f81c];return _0x559e94;};'use strict';var EventEmitter=require(_0xd9e6('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0xd9e6('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xd9e6('0x2')](0x0);var events={'afterCreate':_0xd9e6('0x3'),'afterUpdate':'update','afterDestroy':_0xd9e6('0x4')};function emitEvent(_0x1d5756){return function(_0x2f1c0,_0x3b2951,_0x5e363d){FaxMessageEvents[_0xd9e6('0x5')](_0x1d5756+':'+_0x2f1c0['id'],_0x2f1c0);FaxMessageEvents[_0xd9e6('0x5')](_0x1d5756,_0x2f1c0);_0x5e363d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0xd9e6('0x6')]=FaxMessageEvents; \ No newline at end of file +var _0xb931=['remove','emit','hasOwnProperty','hook','exports','FaxMessage','update'];(function(_0x52ab0a,_0xf641d5){var _0x1d2cab=function(_0x47d5a1){while(--_0x47d5a1){_0x52ab0a['push'](_0x52ab0a['shift']());}};_0x1d2cab(++_0xf641d5);}(_0xb931,0x155));var _0x1b93=function(_0xc5afe0,_0x211e91){_0xc5afe0=_0xc5afe0-0x0;var _0x24de40=_0xb931[_0xc5afe0];return _0x24de40;};'use strict';var EventEmitter=require('events');var FaxMessage=require('../../mysqldb')['db'][_0x1b93('0x0')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x1b93('0x1'),'afterDestroy':_0x1b93('0x2')};function emitEvent(_0x2d11a5){return function(_0x42a943,_0x1c8b77,_0xa36141){FaxMessageEvents[_0x1b93('0x3')](_0x2d11a5+':'+_0x42a943['id'],_0x42a943);FaxMessageEvents[_0x1b93('0x3')](_0x2d11a5,_0x42a943);_0xa36141(null);};}for(var e in events){if(events[_0x1b93('0x4')](e)){var event=events[e];FaxMessage[_0x1b93('0x5')](e,emitEvent(event));}}module[_0x1b93('0x6')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 9000a55..692b8af 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 _0x6b3d=['FaxInteraction','FaxInteractionId','then','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','fti_fax_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil'];(function(_0x31f3fa,_0x58d74d){var _0xd77380=function(_0x8a8150){while(--_0x8a8150){_0x31f3fa['push'](_0x31f3fa['shift']());}};_0xd77380(++_0x58d74d);}(_0x6b3d,0x128));var _0xd6b3=function(_0x26c52f,_0x465f72){_0x26c52f=_0x26c52f-0x0;var _0x428fa7=_0x6b3d[_0x26c52f];return _0x428fa7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd6b3('0x0'))('api');var moment=require(_0xd6b3('0x1'));var BPromise=require('bluebird');var rp=require(_0xd6b3('0x2'));var fs=require('fs');var path=require(_0xd6b3('0x3'));var rimraf=require(_0xd6b3('0x4'));var config=require(_0xd6b3('0x5'));var attributes=require('./faxMessage.attributes');module[_0xd6b3('0x6')]=function(_0x59c27c,_0x590425){return _0x59c27c['define']('FaxMessage',attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0xd6b3('0x7'),'fields':[_0xd6b3('0x8')],'type':_0xd6b3('0x9')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x474fcd,_0x570965,_0x193eed){var _0x1bcabf=_0x59c27c['models'];var _0x590c2a=_0x474fcd[_0xd6b3('0xa')]({'plain':!![]});if(_0x590c2a[_0xd6b3('0xb')][_0xd6b3('0xc')]()==='in'||_0x590c2a['direction']['toLowerCase']()===_0xd6b3('0xd')&&!_0x590c2a[_0xd6b3('0xe')]&&!_[_0xd6b3('0xf')](_0x590c2a['UserId'])){_0x1bcabf[_0xd6b3('0x10')]['findOne']({'where':{'id':_0x590c2a[_0xd6b3('0x11')]}})[_0xd6b3('0x12')](function(_0x569256){if(_0x569256){_0x569256[_0xd6b3('0x13')]({'lastMsgAt':_0x590c2a[_0xd6b3('0x14')],'lastMsgDirection':_0x590c2a[_0xd6b3('0xb')][_0xd6b3('0xc')]()});}})['catch'](function(_0x2faa4c){console[_0xd6b3('0x15')](_0x2faa4c);});}_0x193eed();}},'charset':_0xd6b3('0x16'),'collate':_0xd6b3('0x17')});}; \ No newline at end of file +var _0x05ca=['FaxInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','./faxMessage.attributes','define','FaxMessage','fax_messages','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','FaxInteraction','findOne'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x05ca,0x77));var _0xa05c=function(_0x52a054,_0x3c7619){_0x52a054=_0x52a054-0x0;var _0x285c58=_0x05ca[_0x52a054];return _0x285c58;};'use strict';var _=require(_0xa05c('0x0'));var util=require(_0xa05c('0x1'));var logger=require(_0xa05c('0x2'))('api');var moment=require(_0xa05c('0x3'));var BPromise=require(_0xa05c('0x4'));var rp=require(_0xa05c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa05c('0x6'));var config=require('../../config/environment');var attributes=require(_0xa05c('0x7'));module['exports']=function(_0x417e8c,_0x26d5b6){return _0x417e8c[_0xa05c('0x8')](_0xa05c('0x9'),attributes,{'tableName':_0xa05c('0xa'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':['body'],'type':_0xa05c('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2f5130,_0x23bac9,_0x375376){var _0x4523a4=_0x417e8c[_0xa05c('0xc')];var _0x98bc7c=_0x2f5130[_0xa05c('0xd')]({'plain':!![]});if(_0x98bc7c[_0xa05c('0xe')]['toLowerCase']()==='in'||_0x98bc7c['direction'][_0xa05c('0xf')]()==='out'&&!_0x98bc7c[_0xa05c('0x10')]&&!_[_0xa05c('0x11')](_0x98bc7c[_0xa05c('0x12')])){_0x4523a4[_0xa05c('0x13')][_0xa05c('0x14')]({'where':{'id':_0x98bc7c[_0xa05c('0x15')]}})[_0xa05c('0x16')](function(_0x268f14){if(_0x268f14){_0x268f14[_0xa05c('0x17')]({'lastMsgAt':_0x98bc7c[_0xa05c('0x18')],'lastMsgDirection':_0x98bc7c[_0xa05c('0xe')][_0xa05c('0xf')]()});}})[_0xa05c('0x19')](function(_0x5a771d){console['error'](_0x5a771d);});}_0x375376();}},'charset':_0xa05c('0x1a'),'collate':_0xa05c('0x1b')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index aedccdc..b2890c8 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 _0x34e8=['request\x20sent','result','catch','CreateFaxMessage','FaxMessage','create','options','raw','update','body','attributes','limit','UpdateFaxMessage','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x346898,_0x1c3544){var _0x2fd5eb=function(_0x5c417f){while(--_0x5c417f){_0x346898['push'](_0x346898['shift']());}};_0x2fd5eb(++_0x1c3544);}(_0x34e8,0x12c));var _0x834e=function(_0x49f35f,_0x5a261a){_0x49f35f=_0x49f35f-0x0;var _0x57c5b3=_0x34e8[_0x49f35f];return _0x57c5b3;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var BPromise=require(_0x834e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x834e('0x4'));var db=require(_0x834e('0x5'))['db'];var utils=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));var config=require(_0x834e('0x9'));var jayson=require(_0x834e('0xa'));var client=jayson['client'][_0x834e('0xb')]({'port':0x232a});config['redis']=_[_0x834e('0xc')](config[_0x834e('0xd')],{'host':_0x834e('0xe'),'port':0x18eb});var socket=require(_0x834e('0xf'))(new Redis(config[_0x834e('0xd')]));require(_0x834e('0x10'))[_0x834e('0x11')](socket);function respondWithRpcPromise(_0x1af45a,_0x3bdda9,_0x186b3b){return new BPromise(function(_0x1e41fe,_0x36e124){return client[_0x834e('0x12')](_0x1af45a,_0x186b3b)[_0x834e('0x13')](function(_0x293514){logger[_0x834e('0x14')](_0x834e('0x15'),_0x3bdda9,'request\x20sent');logger[_0x834e('0x16')](_0x834e('0x17'),_0x3bdda9,'request\x20sent',JSON[_0x834e('0x18')](_0x293514));if(_0x293514[_0x834e('0x19')]){if(_0x293514[_0x834e('0x19')][_0x834e('0x1a')]===0x1f4){logger['error'](_0x834e('0x15'),_0x3bdda9,_0x293514[_0x834e('0x19')]['message']);return _0x36e124(_0x293514[_0x834e('0x19')]['message']);}logger[_0x834e('0x19')](_0x834e('0x15'),_0x3bdda9,_0x293514['error'][_0x834e('0x1b')]);return _0x1e41fe(_0x293514[_0x834e('0x19')][_0x834e('0x1b')]);}else{logger['info'](_0x834e('0x15'),_0x3bdda9,_0x834e('0x1c'));_0x1e41fe(_0x293514[_0x834e('0x1d')][_0x834e('0x1b')]);}})[_0x834e('0x1e')](function(_0x254677){logger[_0x834e('0x19')]('FaxMessage,\x20%s,\x20%s',_0x3bdda9,_0x254677);_0x36e124(_0x254677);});});}exports[_0x834e('0x1f')]=function(_0x1fd2c6){var _0x113ff4=this;return new Promise(function(_0x325a99,_0x4ab05d){return db[_0x834e('0x20')][_0x834e('0x21')](_0x1fd2c6['body'],{'raw':_0x1fd2c6[_0x834e('0x22')]?_0x1fd2c6[_0x834e('0x22')][_0x834e('0x23')]===undefined?!![]:![]:!![]})['then'](function(_0x4e3f48){logger[_0x834e('0x14')](_0x834e('0x1f'),_0x1fd2c6);logger['debug'](_0x834e('0x1f'),_0x1fd2c6,JSON[_0x834e('0x18')](_0x4e3f48));_0x325a99(_0x4e3f48);})['catch'](function(_0x3bc4f7){logger[_0x834e('0x19')](_0x834e('0x1f'),_0x3bc4f7['message'],_0x1fd2c6);_0x4ab05d(_0x113ff4[_0x834e('0x19')](0x1f4,_0x3bc4f7[_0x834e('0x1b')]));});});};exports['UpdateFaxMessage']=function(_0x5bef62){var _0x1e713a=this;return new Promise(function(_0x508a1d,_0x2826ec){return db[_0x834e('0x20')][_0x834e('0x24')](_0x5bef62[_0x834e('0x25')],{'raw':_0x5bef62[_0x834e('0x22')]?_0x5bef62[_0x834e('0x22')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5bef62['options']?_0x5bef62['options']['where']||null:null,'attributes':_0x5bef62[_0x834e('0x22')]?_0x5bef62[_0x834e('0x22')][_0x834e('0x26')]||null:null,'limit':_0x5bef62['options']?_0x5bef62[_0x834e('0x22')][_0x834e('0x27')]||null:null})[_0x834e('0x13')](function(_0x1e026a){logger[_0x834e('0x14')](_0x834e('0x28'),_0x5bef62);logger[_0x834e('0x16')](_0x834e('0x28'),_0x5bef62,JSON[_0x834e('0x18')](_0x1e026a));_0x508a1d(_0x1e026a);})['catch'](function(_0xef9ec2){logger['error'](_0x834e('0x28'),_0xef9ec2[_0x834e('0x1b')],_0x5bef62);_0x2826ec(_0x1e713a[_0x834e('0x19')](0x1f4,_0xef9ec2[_0x834e('0x1b')]));});});}; \ No newline at end of file +var _0x9f62=['util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','request','info','request\x20sent','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','CreateFaxMessage','FaxMessage','body','raw','then','debug','catch','UpdateFaxMessage','update','options','where','attributes','limit'];(function(_0x3f2639,_0x46917f){var _0x406475=function(_0x86d57){while(--_0x86d57){_0x3f2639['push'](_0x3f2639['shift']());}};_0x406475(++_0x46917f);}(_0x9f62,0x154));var _0x29f6=function(_0x1c839d,_0x35e8b0){_0x1c839d=_0x1c839d-0x0;var _0x2d2815=_0x9f62[_0x1c839d];return _0x2d2815;};'use strict';var _=require('lodash');var util=require(_0x29f6('0x0'));var moment=require('moment');var BPromise=require(_0x29f6('0x1'));var rs=require(_0x29f6('0x2'));var fs=require('fs');var Redis=require(_0x29f6('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x29f6('0x4'))(_0x29f6('0x5'));var config=require(_0x29f6('0x6'));var jayson=require(_0x29f6('0x7'));var client=jayson['client'][_0x29f6('0x8')]({'port':0x232a});config[_0x29f6('0x9')]=_[_0x29f6('0xa')](config[_0x29f6('0x9')],{'host':_0x29f6('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0xe25841,_0x44db16,_0x4fb455){return new BPromise(function(_0x5a0724,_0x29b3f5){return client[_0x29f6('0xc')](_0xe25841,_0x4fb455)['then'](function(_0x17b69c){logger[_0x29f6('0xd')]('FaxMessage,\x20%s,\x20%s',_0x44db16,'request\x20sent');logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0x44db16,_0x29f6('0xe'),JSON[_0x29f6('0xf')](_0x17b69c));if(_0x17b69c[_0x29f6('0x10')]){if(_0x17b69c[_0x29f6('0x10')][_0x29f6('0x11')]===0x1f4){logger[_0x29f6('0x10')](_0x29f6('0x12'),_0x44db16,_0x17b69c[_0x29f6('0x10')][_0x29f6('0x13')]);return _0x29b3f5(_0x17b69c[_0x29f6('0x10')][_0x29f6('0x13')]);}logger[_0x29f6('0x10')](_0x29f6('0x12'),_0x44db16,_0x17b69c[_0x29f6('0x10')][_0x29f6('0x13')]);return _0x5a0724(_0x17b69c[_0x29f6('0x10')][_0x29f6('0x13')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x44db16,_0x29f6('0xe'));_0x5a0724(_0x17b69c[_0x29f6('0x14')][_0x29f6('0x13')]);}})['catch'](function(_0xcb90){logger[_0x29f6('0x10')]('FaxMessage,\x20%s,\x20%s',_0x44db16,_0xcb90);_0x29b3f5(_0xcb90);});});}exports[_0x29f6('0x15')]=function(_0x3e81af){var _0x42a8fa=this;return new Promise(function(_0x41b9f0,_0xb6e7a9){return db[_0x29f6('0x16')]['create'](_0x3e81af[_0x29f6('0x17')],{'raw':_0x3e81af['options']?_0x3e81af['options'][_0x29f6('0x18')]===undefined?!![]:![]:!![]})[_0x29f6('0x19')](function(_0x39c6b3){logger[_0x29f6('0xd')]('CreateFaxMessage',_0x3e81af);logger[_0x29f6('0x1a')]('CreateFaxMessage',_0x3e81af,JSON[_0x29f6('0xf')](_0x39c6b3));_0x41b9f0(_0x39c6b3);})[_0x29f6('0x1b')](function(_0x4200cc){logger[_0x29f6('0x10')]('CreateFaxMessage',_0x4200cc[_0x29f6('0x13')],_0x3e81af);_0xb6e7a9(_0x42a8fa[_0x29f6('0x10')](0x1f4,_0x4200cc['message']));});});};exports[_0x29f6('0x1c')]=function(_0x45f792){var _0x2519ac=this;return new Promise(function(_0x342038,_0x84ccb7){return db[_0x29f6('0x16')][_0x29f6('0x1d')](_0x45f792['body'],{'raw':_0x45f792[_0x29f6('0x1e')]?_0x45f792[_0x29f6('0x1e')][_0x29f6('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45f792[_0x29f6('0x1e')]?_0x45f792[_0x29f6('0x1e')][_0x29f6('0x1f')]||null:null,'attributes':_0x45f792[_0x29f6('0x1e')]?_0x45f792[_0x29f6('0x1e')][_0x29f6('0x20')]||null:null,'limit':_0x45f792[_0x29f6('0x1e')]?_0x45f792[_0x29f6('0x1e')][_0x29f6('0x21')]||null:null})[_0x29f6('0x19')](function(_0x304c28){logger[_0x29f6('0xd')](_0x29f6('0x1c'),_0x45f792);logger[_0x29f6('0x1a')]('UpdateFaxMessage',_0x45f792,JSON['stringify'](_0x304c28));_0x342038(_0x304c28);})[_0x29f6('0x1b')](function(_0x489897){logger[_0x29f6('0x10')](_0x29f6('0x1c'),_0x489897[_0x29f6('0x13')],_0x45f792);_0x84ccb7(_0x2519ac[_0x29f6('0x10')](0x1f4,_0x489897['message']));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 84118a4..d40a1f2 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 _0x7c99=['update','removeListener','register','faxMessage:','./faxMessage.events','save','remove'];(function(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0x7c99,0x1d9));var _0x97c9=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x7c99[_0x21a9d9];return _0x46adce;};'use strict';var FaxMessageEvents=require(_0x97c9('0x0'));var events=[_0x97c9('0x1'),_0x97c9('0x2'),_0x97c9('0x3')];function createListener(_0x431daa,_0x4e303d){return function(_0x10fee9){_0x4e303d['emit'](_0x431daa,_0x10fee9);};}function removeListener(_0x3a6964,_0x244d07){return function(){FaxMessageEvents[_0x97c9('0x4')](_0x3a6964,_0x244d07);};}exports[_0x97c9('0x5')]=function(_0x3aa4fc){for(var _0x29ce4a=0x0,_0x11f10b=events['length'];_0x29ce4a<_0x11f10b;_0x29ce4a++){var _0x139b8e=events[_0x29ce4a];var _0x51d056=createListener(_0x97c9('0x6')+_0x139b8e,_0x3aa4fc);FaxMessageEvents['on'](_0x139b8e,_0x51d056);}}; \ No newline at end of file +var _0x6e62=['removeListener','save','remove','update','emit'];(function(_0x384ed9,_0x549286){var _0x11825f=function(_0x539b21){while(--_0x539b21){_0x384ed9['push'](_0x384ed9['shift']());}};_0x11825f(++_0x549286);}(_0x6e62,0xab));var _0x26e6=function(_0x4b7aab,_0x15c40a){_0x4b7aab=_0x4b7aab-0x0;var _0x3fb70b=_0x6e62[_0x4b7aab];return _0x3fb70b;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0x26e6('0x0'),_0x26e6('0x1'),_0x26e6('0x2')];function createListener(_0x57798b,_0x520d09){return function(_0x63db16){_0x520d09[_0x26e6('0x3')](_0x57798b,_0x63db16);};}function removeListener(_0x439bd2,_0x4c61ed){return function(){FaxMessageEvents[_0x26e6('0x4')](_0x439bd2,_0x4c61ed);};}exports['register']=function(_0x2f2512){for(var _0x5aeb79=0x0,_0x28ec6a=events['length'];_0x5aeb79<_0x28ec6a;_0x5aeb79++){var _0x5b541e=events[_0x5aeb79];var _0x204ced=createListener('faxMessage:'+_0x5b541e,_0x2f2512);FaxMessageEvents['on'](_0x5b541e,_0x204ced);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index a35881a..bea354d 100644 --- a/server/api/faxMessage/index.js +++ b/server/api/faxMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xca66=['faxmessage:create','create','put','update','/:id/accept','accept','/:id/reject','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','tracked','fax'];(function(_0x166d7e,_0x3eb917){var _0x298eb4=function(_0x32db26){while(--_0x32db26){_0x166d7e['push'](_0x166d7e['shift']());}};_0x298eb4(++_0x3eb917);}(_0xca66,0x8b));var _0x6ca6=function(_0x216860,_0x179253){_0x216860=_0x216860-0x0;var _0x38135c=_0xca66[_0x216860];return _0x38135c;};'use strict';var multer=require(_0x6ca6('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6ca6('0x1'));var express=require(_0x6ca6('0x2'));var router=express[_0x6ca6('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6ca6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6ca6('0x5'));var controller=require('./faxMessage.controller');router[_0x6ca6('0x6')]('/',auth[_0x6ca6('0x7')](),controller[_0x6ca6('0x8')]);router[_0x6ca6('0x6')](_0x6ca6('0x9'),auth[_0x6ca6('0x7')](),controller[_0x6ca6('0xa')]);router['get'](_0x6ca6('0xb'),auth[_0x6ca6('0x7')](),controller[_0x6ca6('0xc')]);router[_0x6ca6('0x6')](_0x6ca6('0xd'),auth[_0x6ca6('0x7')](),controller[_0x6ca6('0xe')]);router['post']('/',auth[_0x6ca6('0x7')](),interaction[_0x6ca6('0xf')](_0x6ca6('0x10'),_0x6ca6('0x11')),controller[_0x6ca6('0x12')]);router[_0x6ca6('0x13')]('/:id',auth[_0x6ca6('0x7')](),controller[_0x6ca6('0x14')]);router['put'](_0x6ca6('0x15'),auth[_0x6ca6('0x7')](),controller[_0x6ca6('0x16')]);router[_0x6ca6('0x13')](_0x6ca6('0x17'),auth[_0x6ca6('0x7')](),controller['reject']);router['delete']('/:id',auth[_0x6ca6('0x7')](),controller[_0x6ca6('0x18')]);module[_0x6ca6('0x19')]=router; \ No newline at end of file +var _0xfe57=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','show','download','faxmessage:create','create','put','/:id','update','/:id/reject','reject','destroy','exports','multer','util','express'];(function(_0x5b740b,_0x381833){var _0x6f8f4e=function(_0x86d068){while(--_0x86d068){_0x5b740b['push'](_0x5b740b['shift']());}};_0x6f8f4e(++_0x381833);}(_0xfe57,0x195));var _0x7fe5=function(_0x8ae98b,_0x155f88){_0x8ae98b=_0x8ae98b-0x0;var _0xc30bd4=_0xfe57[_0x8ae98b];return _0xc30bd4;};'use strict';var multer=require(_0x7fe5('0x0'));var util=require(_0x7fe5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7fe5('0x2'));var router=express[_0x7fe5('0x3')]();var fs_extra=require(_0x7fe5('0x4'));var auth=require(_0x7fe5('0x5'));var interaction=require(_0x7fe5('0x6'));var config=require(_0x7fe5('0x7'));var controller=require(_0x7fe5('0x8'));router[_0x7fe5('0x9')]('/',auth[_0x7fe5('0xa')](),controller[_0x7fe5('0xb')]);router[_0x7fe5('0x9')](_0x7fe5('0xc'),auth[_0x7fe5('0xa')](),controller['describe']);router[_0x7fe5('0x9')]('/:id',auth[_0x7fe5('0xa')](),controller[_0x7fe5('0xd')]);router['get']('/:id/download',auth[_0x7fe5('0xa')](),controller[_0x7fe5('0xe')]);router['post']('/',auth[_0x7fe5('0xa')](),interaction['tracked']('fax',_0x7fe5('0xf')),controller[_0x7fe5('0x10')]);router[_0x7fe5('0x11')](_0x7fe5('0x12'),auth['isAuthenticated'](),controller[_0x7fe5('0x13')]);router[_0x7fe5('0x11')]('/:id/accept',auth[_0x7fe5('0xa')](),controller['accept']);router[_0x7fe5('0x11')](_0x7fe5('0x14'),auth['isAuthenticated'](),controller[_0x7fe5('0x15')]);router['delete'](_0x7fe5('0x12'),auth[_0x7fe5('0xa')](),controller[_0x7fe5('0x16')]);module[_0x7fe5('0x17')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index c83baac..2bcb857 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 _0x898f=['name','STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x2496cb,_0x14a36a){var _0x10e668=function(_0x43a05a){while(--_0x43a05a){_0x2496cb['push'](_0x2496cb['shift']());}};_0x10e668(++_0x14a36a);}(_0x898f,0x11e));var _0xf898=function(_0x344e6a,_0x6df8b5){_0x344e6a=_0x344e6a-0x0;var _0xe6dee5=_0x898f[_0x344e6a];return _0xe6dee5;};'use strict';var Sequelize=require(_0xf898('0x0'));module[_0xf898('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xf898('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xf898('0x3')]},'timeout':{'type':Sequelize[_0xf898('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf898('0x5')](_0xf898('0x6'),_0xf898('0x7'),_0xf898('0x8')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xf6ff=['ENUM','beepall','INTEGER','sequelize','exports','name','STRING'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0xf6ff,0x11b));var _0xff6f=function(_0x5d3ab1,_0x3d0c4f){_0x5d3ab1=_0x5d3ab1-0x0;var _0x181a99=_0xf6ff[_0x5d3ab1];return _0x181a99;};'use strict';var Sequelize=require(_0xff6f('0x0'));module[_0xff6f('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xff6f('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xff6f('0x3')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xff6f('0x4')]('rrmemory',_0xff6f('0x5'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xff6f('0x6')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index ac2a94e..ac00b90 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 _0xcde7=['Content-Range','update','then','get','FaxQueues','UserProfileResource','name','send','index','map','FaxQueue','rawAttributes','fieldName','type','getOptions','where','include','query','findAll','catch','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','destroy','describe','getMembers','findOne','UserFaxQueue','nolimit','order','sort','pick','FaxQueueId','filter','User','UserId','faxPause','createdAt','rows','SIP','updatedAt','getTeams','Team','hasOwnProperty','addTeams','ids','online','voicePause','interface','flatMap','sequelize','transaction','each','emit','userFaxQueue:save','removeTeams','Agents','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','includes','union','value','isEmpty','removeAgents','forEach','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','lodash','squel','ioredis','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','sendStatus','end','status','json','undefined','limit','count','offset','set'];(function(_0x436095,_0x467c67){var _0x476a65=function(_0x468bb4){while(--_0x468bb4){_0x436095['push'](_0x436095['shift']());}};_0x476a65(++_0x467c67);}(_0xcde7,0x65));var _0x7cde=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xcde7[_0x19950b];return _0x3c6b41;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x7cde('0x0'));var squel=require(_0x7cde('0x1'));var Redis=require(_0x7cde('0x2'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x7cde('0x3'));var config=require('../../config/environment');var db=require(_0x7cde('0x4'))['db'];config[_0x7cde('0x5')]=_[_0x7cde('0x6')](config[_0x7cde('0x5')],{'host':_0x7cde('0x7'),'port':0x18eb});var socket=require(_0x7cde('0x8'))(new Redis(config['redis']));require(_0x7cde('0x9'))['register'](socket);function respondWithStatusCode(_0x236dbd,_0x18d4c5){_0x18d4c5=_0x18d4c5||0xcc;return function(_0x40377e){if(_0x40377e){return _0x236dbd[_0x7cde('0xa')](_0x18d4c5);}return _0x236dbd['status'](_0x18d4c5)[_0x7cde('0xb')]();};}function respondWithResult(_0x5e590a,_0x15ed09){_0x15ed09=_0x15ed09||0xc8;return function(_0x13d4f6){if(_0x13d4f6){return _0x5e590a[_0x7cde('0xc')](_0x15ed09)[_0x7cde('0xd')](_0x13d4f6);}};}function respondWithFilteredResult(_0x174446,_0x29a5f3){return function(_0xbc825c){if(_0xbc825c){var _0x60c171=typeof _0x29a5f3['offset']===_0x7cde('0xe')&&typeof _0x29a5f3[_0x7cde('0xf')]===_0x7cde('0xe');var _0x1c51b2=_0xbc825c[_0x7cde('0x10')];var _0x27e8dc=_0x60c171?0x0:_0x29a5f3[_0x7cde('0x11')];var _0x2e86a0=_0x60c171?_0xbc825c[_0x7cde('0x10')]:_0x29a5f3['offset']+_0x29a5f3[_0x7cde('0xf')];var _0x35b20a;if(_0x2e86a0>=_0x1c51b2){_0x2e86a0=_0x1c51b2;_0x35b20a=0xc8;}else{_0x35b20a=0xce;}_0x174446[_0x7cde('0xc')](_0x35b20a);return _0x174446[_0x7cde('0x12')](_0x7cde('0x13'),_0x27e8dc+'-'+_0x2e86a0+'/'+_0x1c51b2)[_0x7cde('0xd')](_0xbc825c);}return null;};}function saveUpdates(_0x3bf97a){return function(_0x34965a){if(_0x34965a){return _0x34965a[_0x7cde('0x14')](_0x3bf97a)[_0x7cde('0x15')](function(_0x87ebf0){return _0x87ebf0;});}return null;};}function removeEntity(_0x3f2e82){return function(_0x3b1e08){if(_0x3b1e08){return _0x3b1e08['destroy']()[_0x7cde('0x15')](function(){var _0x19c662=_0x3b1e08[_0x7cde('0x16')]({'plain':!![]});var _0x5c6875=_0x7cde('0x17');return db[_0x7cde('0x18')]['destroy']({'where':{'type':_0x5c6875,'resourceId':_0x19c662['id']}})[_0x7cde('0x15')](function(){return _0x3b1e08;});})[_0x7cde('0x15')](function(){_0x3f2e82[_0x7cde('0xc')](0xcc)[_0x7cde('0xb')]();});}};}function handleEntityNotFound(_0x405031){return function(_0x42891f){if(!_0x42891f){_0x405031[_0x7cde('0xa')](0x194);}return _0x42891f;};}function handleError(_0x33b4d9,_0x4ee923){_0x4ee923=_0x4ee923||0x1f4;return function(_0x10ba0d){logger['error'](_0x10ba0d['stack']);if(_0x10ba0d['name']){delete _0x10ba0d[_0x7cde('0x19')];}_0x33b4d9['status'](_0x4ee923)[_0x7cde('0x1a')](_0x10ba0d);};}exports[_0x7cde('0x1b')]=function(_0x16439a,_0x5596b3){var _0x4b25e3={};var _0x219296={'count':0x0,'rows':[]};var _0x591cfa=_[_0x7cde('0x1c')](db[_0x7cde('0x1d')][_0x7cde('0x1e')],function(_0x4b28b2){return{'name':_0x4b28b2[_0x7cde('0x1f')],'type':_0x4b28b2[_0x7cde('0x20')]['key']};});_0x4b25e3=qs[_0x7cde('0x21')](_0x591cfa,_0x16439a);var _0x341479={'where':_0x4b25e3[_0x7cde('0x22')]};return db[_0x7cde('0x1d')]['count'](_0x341479)[_0x7cde('0x15')](function(_0x4ec2be){_0x219296['count']=_0x4ec2be;_0x4b25e3[_0x7cde('0x23')]=qs[_0x7cde('0x23')](_0x16439a[_0x7cde('0x24')]);return db[_0x7cde('0x1d')][_0x7cde('0x25')](_0x4b25e3);})[_0x7cde('0x15')](function(_0x50f3db){_0x219296['rows']=_0x50f3db;return _0x219296;})[_0x7cde('0x15')](respondWithFilteredResult(_0x5596b3,_0x4b25e3))[_0x7cde('0x26')](handleError(_0x5596b3,null));};exports[_0x7cde('0x27')]=function(_0x1f25f2,_0x4d3182){var _0x49788d={'raw':!![],'where':{'id':_0x1f25f2[_0x7cde('0x28')]['id']}},_0x816d25={};_0x816d25[_0x7cde('0x29')]=_[_0x7cde('0x2a')](db[_0x7cde('0x1d')]['rawAttributes']);_0x816d25['query']=_[_0x7cde('0x2a')](_0x1f25f2[_0x7cde('0x24')]);_0x816d25[_0x7cde('0x2b')]=_[_0x7cde('0x2c')](_0x816d25[_0x7cde('0x29')],_0x816d25['query']);_0x49788d[_0x7cde('0x2d')]=_[_0x7cde('0x2c')](_0x816d25[_0x7cde('0x29')],qs[_0x7cde('0x2e')](_0x1f25f2[_0x7cde('0x24')]['fields']));_0x49788d[_0x7cde('0x2d')]=_0x49788d[_0x7cde('0x2d')][_0x7cde('0x2f')]?_0x49788d[_0x7cde('0x2d')]:_0x816d25[_0x7cde('0x29')];if(_0x1f25f2[_0x7cde('0x24')][_0x7cde('0x30')]){_0x49788d[_0x7cde('0x23')]=[{'all':!![]}];}_0x49788d=_[_0x7cde('0x31')]({},_0x49788d,_0x1f25f2[_0x7cde('0x32')]);return db[_0x7cde('0x1d')][_0x7cde('0x33')](_0x49788d)[_0x7cde('0x15')](handleEntityNotFound(_0x4d3182,null))['then'](respondWithResult(_0x4d3182,null))[_0x7cde('0x26')](handleError(_0x4d3182,null));};exports[_0x7cde('0x34')]=function(_0x11a2de,_0x671a3b){return db[_0x7cde('0x1d')][_0x7cde('0x34')](_0x11a2de[_0x7cde('0x35')],{})[_0x7cde('0x15')](function(_0x2d8e4d){var _0x1ba5bc=_0x11a2de[_0x7cde('0x36')][_0x7cde('0x16')]({'plain':!![]});if(!_0x1ba5bc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1ba5bc[_0x7cde('0x37')]===_0x7cde('0x36')){var _0x221423=_0x2d8e4d[_0x7cde('0x16')]({'plain':!![]});var _0x465cd1='FaxQueues';return db[_0x7cde('0x38')][_0x7cde('0x33')]({'where':{'name':_0x465cd1,'userProfileId':_0x1ba5bc[_0x7cde('0x39')]},'raw':!![]})['then'](function(_0x4fade6){if(_0x4fade6&&_0x4fade6[_0x7cde('0x3a')]===0x0){return db['UserProfileResource']['create']({'name':_0x221423[_0x7cde('0x19')],'resourceId':_0x221423['id'],'type':_0x4fade6[_0x7cde('0x19')],'sectionId':_0x4fade6['id']},{})[_0x7cde('0x15')](function(){return _0x2d8e4d;});}else{return _0x2d8e4d;}})[_0x7cde('0x26')](function(_0x30a8c1){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x30a8c1);throw _0x30a8c1;});}return _0x2d8e4d;})['then'](respondWithResult(_0x671a3b,0xc9))[_0x7cde('0x26')](handleError(_0x671a3b,null));};exports[_0x7cde('0x14')]=function(_0x11751b,_0x58d4a2){if(_0x11751b[_0x7cde('0x35')]['id']){delete _0x11751b[_0x7cde('0x35')]['id'];}return db[_0x7cde('0x1d')][_0x7cde('0x33')]({'where':{'id':_0x11751b[_0x7cde('0x28')]['id']}})[_0x7cde('0x15')](handleEntityNotFound(_0x58d4a2,null))[_0x7cde('0x15')](saveUpdates(_0x11751b[_0x7cde('0x35')],null))[_0x7cde('0x15')](respondWithResult(_0x58d4a2,null))[_0x7cde('0x26')](handleError(_0x58d4a2,null));};exports[_0x7cde('0x3b')]=function(_0x18f505,_0x295c51){return db[_0x7cde('0x1d')]['find']({'where':{'id':_0x18f505[_0x7cde('0x28')]['id']}})[_0x7cde('0x15')](handleEntityNotFound(_0x295c51,null))['then'](removeEntity(_0x295c51,null))[_0x7cde('0x26')](handleError(_0x295c51,null));};exports['describe']=function(_0x55b6c8,_0x13f1a1){return db['FaxQueue'][_0x7cde('0x3c')]()[_0x7cde('0x15')](respondWithResult(_0x13f1a1,null))[_0x7cde('0x26')](handleError(_0x13f1a1,null));};exports[_0x7cde('0x3d')]=function(_0xd044d0,_0x35213b){var _0x1c7484={'raw':!![],'where':{}},_0x8dc8a1={},_0x57813d;return db['FaxQueue'][_0x7cde('0x3e')]({'where':{'id':_0xd044d0[_0x7cde('0x28')]['id']}})['then'](handleEntityNotFound(_0x35213b,null))[_0x7cde('0x15')](function(_0x10ed89){if(_0x10ed89){_0x57813d=_0x10ed89[_0x7cde('0x16')]({'plain':!![]});_0x8dc8a1[_0x7cde('0x29')]=_[_0x7cde('0x2a')](db[_0x7cde('0x3f')]['rawAttributes']);_0x8dc8a1[_0x7cde('0x24')]=_[_0x7cde('0x2a')](_0xd044d0['query']);_0x8dc8a1[_0x7cde('0x2b')]=_[_0x7cde('0x2c')](_0x8dc8a1[_0x7cde('0x29')],_0x8dc8a1[_0x7cde('0x24')]);_0x1c7484[_0x7cde('0x2d')]=_[_0x7cde('0x2c')](_0x8dc8a1[_0x7cde('0x29')],qs[_0x7cde('0x2e')](_0xd044d0['query'][_0x7cde('0x2e')]));_0x1c7484['attributes']=_0x1c7484[_0x7cde('0x2d')][_0x7cde('0x2f')]?_0x1c7484[_0x7cde('0x2d')]:_0x8dc8a1[_0x7cde('0x29')];if(!_0xd044d0['query']['hasOwnProperty'](_0x7cde('0x40'))){_0x1c7484[_0x7cde('0xf')]=qs[_0x7cde('0xf')](_0xd044d0['query'][_0x7cde('0xf')]);_0x1c7484['offset']=qs[_0x7cde('0x11')](_0xd044d0[_0x7cde('0x24')][_0x7cde('0x11')]);}_0x1c7484[_0x7cde('0x41')]=qs[_0x7cde('0x42')](_0xd044d0[_0x7cde('0x24')][_0x7cde('0x42')]);_0x1c7484[_0x7cde('0x22')]=qs[_0x7cde('0x2b')](_[_0x7cde('0x43')](_0xd044d0[_0x7cde('0x24')],_0x8dc8a1['filters']));_0x1c7484['where'][_0x7cde('0x44')]=_0x10ed89['id'];if(_0xd044d0[_0x7cde('0x24')][_0x7cde('0x45')]){_0x1c7484['where']=_[_0x7cde('0x31')](_0x1c7484['where'],{'$or':_['map'](_0x1c7484[_0x7cde('0x2d')],function(_0x34aef2){var _0x5e5b1d={};_0x5e5b1d[_0x34aef2]={'$like':'%'+_0xd044d0[_0x7cde('0x24')][_0x7cde('0x45')]+'%'};return _0x5e5b1d;})});}_0x1c7484=_[_0x7cde('0x31')]({},_0x1c7484,_0xd044d0[_0x7cde('0x32')]);return db[_0x7cde('0x3f')][_0x7cde('0x25')](_0x1c7484);}})[_0x7cde('0x15')](function(_0x2f4a2d){if(_0x2f4a2d){return db[_0x7cde('0x46')]['findAndCountAll']({'where':{'id':_['map'](_0x2f4a2d,_0x7cde('0x47')),'role':'agent'},'attributes':['id','name',_0x7cde('0x48'),'updatedAt',_0x7cde('0x49')]});}})[_0x7cde('0x15')](function(_0x5229e4){if(_0x5229e4){return{'count':_0x5229e4[_0x7cde('0x10')],'rows':_['map'](_0x5229e4[_0x7cde('0x4a')],function(_0x118195){return{'membername':_0x118195['name'],'UserId':_0x118195['id'],'queue_name':_0x57813d[_0x7cde('0x19')],'FaxQueueId':_0x57813d['id'],'interface':util['format']('%s/%s',_0x7cde('0x4b'),_0x118195['name']),'penalty':0x0,'paused':_0x118195[_0x7cde('0x48')],'createdAt':_0x118195[_0x7cde('0x49')],'updatedAt':_0x118195[_0x7cde('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x35213b,_0x1c7484))[_0x7cde('0x26')](handleError(_0x35213b,null));};exports[_0x7cde('0x4d')]=function(_0x174003,_0x3132d8){var _0x393230={};var _0x84762a={};var _0x44afa4;var _0x209faf;return db['FaxQueue'][_0x7cde('0x3e')]({'where':{'id':_0x174003[_0x7cde('0x28')]['id']}})['then'](handleEntityNotFound(_0x3132d8,null))[_0x7cde('0x15')](function(_0x1a3d46){if(_0x1a3d46){_0x44afa4=_0x1a3d46;_0x84762a[_0x7cde('0x29')]=_[_0x7cde('0x2a')](db[_0x7cde('0x4e')][_0x7cde('0x1e')]);_0x84762a[_0x7cde('0x24')]=_[_0x7cde('0x2a')](_0x174003['query']);_0x84762a['filters']=_[_0x7cde('0x2c')](_0x84762a[_0x7cde('0x29')],_0x84762a[_0x7cde('0x24')]);_0x393230[_0x7cde('0x2d')]=_[_0x7cde('0x2c')](_0x84762a[_0x7cde('0x29')],qs['fields'](_0x174003[_0x7cde('0x24')][_0x7cde('0x2e')]));_0x393230[_0x7cde('0x2d')]=_0x393230[_0x7cde('0x2d')][_0x7cde('0x2f')]?_0x393230[_0x7cde('0x2d')]:_0x84762a[_0x7cde('0x29')];_0x393230['order']=qs[_0x7cde('0x42')](_0x174003['query'][_0x7cde('0x42')]);_0x393230[_0x7cde('0x22')]=qs[_0x7cde('0x2b')](_[_0x7cde('0x43')](_0x174003[_0x7cde('0x24')],_0x84762a[_0x7cde('0x2b')]));if(_0x174003[_0x7cde('0x24')][_0x7cde('0x45')]){_0x393230[_0x7cde('0x22')]=_[_0x7cde('0x31')](_0x393230[_0x7cde('0x22')],{'$or':_['map'](_0x393230['attributes'],function(_0xc996ba){var _0x34a51a={};_0x34a51a[_0xc996ba]={'$like':'%'+_0x174003[_0x7cde('0x24')][_0x7cde('0x45')]+'%'};return _0x34a51a;})});}_0x393230=_[_0x7cde('0x31')]({},_0x393230,_0x174003[_0x7cde('0x32')]);return _0x44afa4['getTeams'](_0x393230);}})[_0x7cde('0x15')](function(_0x59d0b2){if(_0x59d0b2){_0x209faf=_0x59d0b2['length'];if(!_0x174003[_0x7cde('0x24')][_0x7cde('0x4f')]('nolimit')){_0x393230[_0x7cde('0xf')]=qs[_0x7cde('0xf')](_0x174003[_0x7cde('0x24')][_0x7cde('0xf')]);_0x393230[_0x7cde('0x11')]=qs['offset'](_0x174003[_0x7cde('0x24')][_0x7cde('0x11')]);}return _0x44afa4['getTeams'](_0x393230);}})['then'](function(_0x2d12df){if(_0x2d12df){return _0x2d12df?{'count':_0x209faf,'rows':_0x2d12df}:null;}})[_0x7cde('0x15')](respondWithResult(_0x3132d8,null))['catch'](handleError(_0x3132d8,null));};exports[_0x7cde('0x50')]=function(_0x307fe4,_0x4ee552){var _0x4ceef9=_0x307fe4[_0x7cde('0x35')][_0x7cde('0x51')];return db[_0x7cde('0x4e')][_0x7cde('0x25')]({'where':{'id':_0x4ceef9},'attributes':['id'],'include':[{'model':db[_0x7cde('0x46')],'as':'Agents','attributes':['id',_0x7cde('0x19'),_0x7cde('0x52'),_0x7cde('0x53'),_0x7cde('0x54')],'raw':!![]}]})[_0x7cde('0x15')](function(_0x445775){if(_0x445775){var _0x2c89e8=_[_0x7cde('0x55')](_0x445775,function(_0xc90300){var _0x11c17a=_0xc90300[_0x7cde('0x16')]({'plain':!![]});return _0x11c17a['Agents'];});return db[_0x7cde('0x1d')]['find']({'where':{'id':_0x307fe4[_0x7cde('0x28')]['id']}})[_0x7cde('0x15')](function(_0x234dce){return db[_0x7cde('0x56')][_0x7cde('0x57')](function(_0x2c51d6){return _0x234dce['addTeams'](_0x4ceef9,{'transaction':_0x2c51d6})[_0x7cde('0x15')](function(){return BPromise[_0x7cde('0x58')](_0x2c89e8,function(_0x5a2d67){return db['UserFaxQueue']['findOrCreate']({'where':{'UserId':_0x5a2d67['id'],'FaxQueueId':_0x307fe4['params']['id']},'transaction':_0x2c51d6});});})['then'](function(){_0x2c89e8['forEach'](function(_0x3ca630){socket[_0x7cde('0x59')](_0x7cde('0x5a'),{'UserId':_0x3ca630['id'],'FaxQueueId':_0x234dce['id']});});});});});}})['then'](respondWithStatusCode(_0x4ee552,null))[_0x7cde('0x26')](handleError(_0x4ee552,null));};exports[_0x7cde('0x5b')]=function(_0x42d88c,_0x2947ea){return db['Team'][_0x7cde('0x25')]({'where':{'id':_0x42d88c['query'][_0x7cde('0x51')]},'attributes':['id'],'include':[{'model':db[_0x7cde('0x46')],'as':_0x7cde('0x5c'),'attributes':['id'],'raw':!![]}]})[_0x7cde('0x15')](handleEntityNotFound(_0x2947ea,null))['then'](function(_0x31258){var _0xe7e81=_[_0x7cde('0x1c')](_0x31258,'id');var _0x2d3830=[];var _0x15a8ce=[];var _0x312d2b=squel[_0x7cde('0x5d')]();_0x312d2b[_0x7cde('0x5e')](_0x7cde('0x5f'))[_0x7cde('0x60')](_0x7cde('0x61'),'tq')[_0x7cde('0x62')](_0x7cde('0x63'),'ut',_0x7cde('0x64'))['where'](_0x7cde('0x65'),_0x42d88c['params']['id']);for(var _0x382cde=0x0;_0x382cde<_0x31258[_0x7cde('0x2f')];_0x382cde+=0x1){let _0x16c9e9=_0x31258[_0x382cde];for(var _0x22b7d3=0x0;_0x22b7d3<_0x16c9e9['Agents']['length'];_0x22b7d3+=0x1){let _0x8adcab=_0x16c9e9['Agents'][_0x22b7d3];var _0x4f7070=_0x312d2b[_0x7cde('0x66')]();_0x4f7070[_0x7cde('0x22')](_0x7cde('0x67'),_0x8adcab['id']);_0x15a8ce[_0x7cde('0x68')](db[_0x7cde('0x56')]['query'](_0x4f7070['toString'](),{'type':db[_0x7cde('0x56')][_0x7cde('0x69')][_0x7cde('0x6a')]})[_0x7cde('0x15')](function(_0x3dfc01){if(_0x3dfc01[_0x7cde('0x2f')]===0x1){return _0x8adcab['id'];}else{var _0x7d7e6c=_[_0x7cde('0x6b')](_['map'](_0x3dfc01,'TeamId'),function(_0x10340d){return _[_0x7cde('0x6c')](_0xe7e81,_0x10340d);});if(_0x7d7e6c){return _0x8adcab['id'];}}}));}}return BPromise['all'](_0x15a8ce)[_0x7cde('0x15')](function(_0x294970){_0x2d3830=_(_0x2d3830)[_0x7cde('0x6d')](_0x294970)['compact']()[_0x7cde('0x6e')]();return db[_0x7cde('0x1d')][_0x7cde('0x33')]({'where':{'id':_0x42d88c['params']['id']}})[_0x7cde('0x15')](function(_0x2ebed9){return db[_0x7cde('0x56')][_0x7cde('0x57')](function(_0x5a5db7){return _0x2ebed9['removeTeams'](_0x42d88c['query']['ids'],{'transaction':_0x5a5db7})[_0x7cde('0x15')](function(){if(!_[_0x7cde('0x6f')](_0x2d3830)){return _0x2ebed9[_0x7cde('0x70')](_0x2d3830,{'transaction':_0x5a5db7});}})[_0x7cde('0x15')](function(){_0x2d3830[_0x7cde('0x71')](function(_0x3c8c49){socket[_0x7cde('0x59')](_0x7cde('0x72'),{'UserId':_0x3c8c49,'FaxQueueId':_0x2ebed9['id']});});});});});});})[_0x7cde('0x15')](respondWithStatusCode(_0x2947ea,null))[_0x7cde('0x26')](handleError(_0x2947ea,null));};exports[_0x7cde('0x73')]=function(_0x2abe76,_0x31435c){return db[_0x7cde('0x1d')][_0x7cde('0x33')]({'where':{'id':_0x2abe76[_0x7cde('0x28')]['id']}})[_0x7cde('0x15')](handleEntityNotFound(_0x31435c,null))[_0x7cde('0x15')](function(_0x3ab58c){if(_0x3ab58c){return _0x3ab58c['addAgents'](_0x2abe76[_0x7cde('0x35')][_0x7cde('0x51')],_[_0x7cde('0x74')](_0x2abe76[_0x7cde('0x35')],[_0x7cde('0x51'),'id'])||{})[_0x7cde('0x75')](function(_0x33fc8d){for(var _0x3a8fd5=0x0;_0x3a8fd5<_0x2abe76[_0x7cde('0x35')][_0x7cde('0x51')][_0x7cde('0x2f')];_0x3a8fd5+=0x1){socket[_0x7cde('0x59')](_0x7cde('0x5a'),{'UserId':Number(_0x2abe76['body']['ids'][_0x3a8fd5]),'FaxQueueId':Number(_0x2abe76[_0x7cde('0x28')]['id'])});}return _0x33fc8d;});}})[_0x7cde('0x15')](respondWithResult(_0x31435c,null))['catch'](handleError(_0x31435c,null));};exports['removeAgents']=function(_0x55c61d,_0x496d87){return db[_0x7cde('0x1d')][_0x7cde('0x33')]({'where':{'id':_0x55c61d[_0x7cde('0x28')]['id']}})[_0x7cde('0x15')](handleEntityNotFound(_0x496d87,null))['then'](function(_0x4c988f){if(_0x4c988f){return _0x4c988f['removeAgents'](_0x55c61d['query'][_0x7cde('0x51')])[_0x7cde('0x15')](function(){if(_[_0x7cde('0x76')](_0x55c61d[_0x7cde('0x24')][_0x7cde('0x51')])){for(var _0x283b8e=0x0;_0x283b8e<_0x55c61d[_0x7cde('0x24')][_0x7cde('0x51')][_0x7cde('0x2f')];_0x283b8e+=0x1){socket['emit']('userFaxQueue:remove',{'UserId':Number(_0x55c61d[_0x7cde('0x24')][_0x7cde('0x51')][_0x283b8e]),'FaxQueueId':Number(_0x55c61d[_0x7cde('0x28')]['id'])});}}else{socket[_0x7cde('0x59')]('userFaxQueue:remove',{'UserId':Number(_0x55c61d[_0x7cde('0x24')]['ids']),'FaxQueueId':Number(_0x55c61d[_0x7cde('0x28')]['id'])});}});}})[_0x7cde('0x15')](respondWithStatusCode(_0x496d87,null))[_0x7cde('0x26')](handleError(_0x496d87,null));};exports[_0x7cde('0x77')]=function(_0x3c1055,_0x37ef83){var _0x5784d={};var _0x498bb2={};var _0x1caf40;var _0x4070d3;return db[_0x7cde('0x1d')][_0x7cde('0x3e')]({'where':{'id':_0x3c1055[_0x7cde('0x28')]['id']}})['then'](handleEntityNotFound(_0x37ef83,null))[_0x7cde('0x15')](function(_0x2c3a02){if(_0x2c3a02){_0x1caf40=_0x2c3a02;_0x498bb2[_0x7cde('0x29')]=_[_0x7cde('0x2a')](db[_0x7cde('0x46')][_0x7cde('0x1e')]);_0x498bb2[_0x7cde('0x24')]=_['keys'](_0x3c1055[_0x7cde('0x24')]);_0x498bb2['filters']=_['intersection'](_0x498bb2[_0x7cde('0x29')],_0x498bb2['query']);_0x5784d[_0x7cde('0x2d')]=_[_0x7cde('0x2c')](_0x498bb2[_0x7cde('0x29')],qs[_0x7cde('0x2e')](_0x3c1055[_0x7cde('0x24')]['fields']));_0x5784d[_0x7cde('0x2d')]=_0x5784d[_0x7cde('0x2d')][_0x7cde('0x2f')]?_0x5784d['attributes']:_0x498bb2[_0x7cde('0x29')];_0x5784d['order']=qs[_0x7cde('0x42')](_0x3c1055[_0x7cde('0x24')][_0x7cde('0x42')]);_0x5784d[_0x7cde('0x22')]=qs['filters'](_['pick'](_0x3c1055[_0x7cde('0x24')],_0x498bb2['filters']));if(_0x3c1055['query'][_0x7cde('0x45')]){_0x5784d[_0x7cde('0x22')]=_[_0x7cde('0x31')](_0x5784d[_0x7cde('0x22')],{'$or':_[_0x7cde('0x1c')](_0x5784d[_0x7cde('0x2d')],function(_0x4b78ba){var _0x3361e3={};_0x3361e3[_0x4b78ba]={'$like':'%'+_0x3c1055[_0x7cde('0x24')][_0x7cde('0x45')]+'%'};return _0x3361e3;})});}_0x5784d=_['merge']({},_0x5784d,_0x3c1055[_0x7cde('0x32')]);return _0x1caf40[_0x7cde('0x77')](_0x5784d);}})[_0x7cde('0x15')](function(_0x34da07){if(_0x34da07){_0x4070d3=_0x34da07['length'];if(!_0x3c1055[_0x7cde('0x24')]['hasOwnProperty']('nolimit')){_0x5784d[_0x7cde('0xf')]=qs[_0x7cde('0xf')](_0x3c1055['query'][_0x7cde('0xf')]);_0x5784d[_0x7cde('0x11')]=qs[_0x7cde('0x11')](_0x3c1055[_0x7cde('0x24')][_0x7cde('0x11')]);}return _0x1caf40[_0x7cde('0x77')](_0x5784d);}})[_0x7cde('0x15')](function(_0x1c9754){if(_0x1c9754){return _0x1c9754?{'count':_0x4070d3,'rows':_0x1c9754}:null;}})[_0x7cde('0x15')](respondWithResult(_0x37ef83,null))[_0x7cde('0x26')](handleError(_0x37ef83,null));}; \ No newline at end of file +var _0x6050=['pick','getTeams','nolimit','addTeams','ids','online','voicePause','interface','flatMap','Agents','each','findOrCreate','emit','userFaxQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_fax_queues','join','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','removeAgents','forEach','userFaxQueue:remove','addAgents','omit','isArray','getAgents','order','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','localhost','register','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','FaxQueue','rawAttributes','key','getOptions','where','include','query','findAll','rows','catch','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserFaxQueue','hasOwnProperty','sort','FaxQueueId','filter','User','agent','faxPause','updatedAt','createdAt','map','format','%s/%s','findOne','Team'];(function(_0x422a5f,_0x590c7a){var _0x4b3202=function(_0x2e4b88){while(--_0x2e4b88){_0x422a5f['push'](_0x422a5f['shift']());}};_0x4b3202(++_0x590c7a);}(_0x6050,0x196));var _0x0605=function(_0x5c0f72,_0xa0f850){_0x5c0f72=_0x5c0f72-0x0;var _0x435d56=_0x6050[_0x5c0f72];return _0x435d56;};'use strict';var BPromise=require(_0x0605('0x0'));var util=require(_0x0605('0x1'));var _=require(_0x0605('0x2'));var squel=require(_0x0605('0x3'));var Redis=require(_0x0605('0x4'));var qs=require(_0x0605('0x5'));var logger=require('../../config/logger')(_0x0605('0x6'));var config=require(_0x0605('0x7'));var db=require(_0x0605('0x8'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x0605('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxQueue.socket')[_0x0605('0xa')](socket);function respondWithStatusCode(_0x11b8b5,_0xa08eca){_0xa08eca=_0xa08eca||0xcc;return function(_0x5bb96){if(_0x5bb96){return _0x11b8b5[_0x0605('0xb')](_0xa08eca);}return _0x11b8b5['status'](_0xa08eca)[_0x0605('0xc')]();};}function respondWithResult(_0x23dc2b,_0xe54b22){_0xe54b22=_0xe54b22||0xc8;return function(_0x2c5e23){if(_0x2c5e23){return _0x23dc2b[_0x0605('0xd')](_0xe54b22)[_0x0605('0xe')](_0x2c5e23);}};}function respondWithFilteredResult(_0x4385d3,_0x4af103){return function(_0x1e8014){if(_0x1e8014){var _0x434e62=typeof _0x4af103[_0x0605('0xf')]===_0x0605('0x10')&&typeof _0x4af103[_0x0605('0x11')]===_0x0605('0x10');var _0x22c011=_0x1e8014[_0x0605('0x12')];var _0x169a70=_0x434e62?0x0:_0x4af103[_0x0605('0xf')];var _0x1b944f=_0x434e62?_0x1e8014['count']:_0x4af103[_0x0605('0xf')]+_0x4af103[_0x0605('0x11')];var _0x4993ab;if(_0x1b944f>=_0x22c011){_0x1b944f=_0x22c011;_0x4993ab=0xc8;}else{_0x4993ab=0xce;}_0x4385d3['status'](_0x4993ab);return _0x4385d3['set'](_0x0605('0x13'),_0x169a70+'-'+_0x1b944f+'/'+_0x22c011)[_0x0605('0xe')](_0x1e8014);}return null;};}function saveUpdates(_0xa83443){return function(_0x2d46ef){if(_0x2d46ef){return _0x2d46ef[_0x0605('0x14')](_0xa83443)[_0x0605('0x15')](function(_0x2b7b5a){return _0x2b7b5a;});}return null;};}function removeEntity(_0x1d57ba){return function(_0x193520){if(_0x193520){return _0x193520[_0x0605('0x16')]()[_0x0605('0x15')](function(){var _0x2fa77e=_0x193520[_0x0605('0x17')]({'plain':!![]});var _0x103952='FaxQueues';return db[_0x0605('0x18')][_0x0605('0x16')]({'where':{'type':_0x103952,'resourceId':_0x2fa77e['id']}})[_0x0605('0x15')](function(){return _0x193520;});})[_0x0605('0x15')](function(){_0x1d57ba[_0x0605('0xd')](0xcc)[_0x0605('0xc')]();});}};}function handleEntityNotFound(_0x379211){return function(_0x2c90ed){if(!_0x2c90ed){_0x379211[_0x0605('0xb')](0x194);}return _0x2c90ed;};}function handleError(_0x5b0d44,_0xc334b8){_0xc334b8=_0xc334b8||0x1f4;return function(_0x4fe293){logger[_0x0605('0x19')](_0x4fe293[_0x0605('0x1a')]);if(_0x4fe293[_0x0605('0x1b')]){delete _0x4fe293[_0x0605('0x1b')];}_0x5b0d44[_0x0605('0xd')](_0xc334b8)[_0x0605('0x1c')](_0x4fe293);};}exports[_0x0605('0x1d')]=function(_0x1ae3db,_0x234231){var _0x2896d7={};var _0x9f2833={'count':0x0,'rows':[]};var _0x1c3722=_['map'](db[_0x0605('0x1e')][_0x0605('0x1f')],function(_0x4b1e0c){return{'name':_0x4b1e0c['fieldName'],'type':_0x4b1e0c['type'][_0x0605('0x20')]};});_0x2896d7=qs[_0x0605('0x21')](_0x1c3722,_0x1ae3db);var _0x4163cd={'where':_0x2896d7[_0x0605('0x22')]};return db[_0x0605('0x1e')][_0x0605('0x12')](_0x4163cd)['then'](function(_0x34f25d){_0x9f2833['count']=_0x34f25d;_0x2896d7[_0x0605('0x23')]=qs[_0x0605('0x23')](_0x1ae3db[_0x0605('0x24')]);return db[_0x0605('0x1e')][_0x0605('0x25')](_0x2896d7);})[_0x0605('0x15')](function(_0x56dd1a){_0x9f2833[_0x0605('0x26')]=_0x56dd1a;return _0x9f2833;})[_0x0605('0x15')](respondWithFilteredResult(_0x234231,_0x2896d7))[_0x0605('0x27')](handleError(_0x234231,null));};exports[_0x0605('0x28')]=function(_0x25d397,_0x39e9b7){var _0x2db998={'raw':!![],'where':{'id':_0x25d397[_0x0605('0x29')]['id']}},_0x362551={};_0x362551[_0x0605('0x2a')]=_[_0x0605('0x2b')](db[_0x0605('0x1e')][_0x0605('0x1f')]);_0x362551[_0x0605('0x24')]=_[_0x0605('0x2b')](_0x25d397[_0x0605('0x24')]);_0x362551[_0x0605('0x2c')]=_[_0x0605('0x2d')](_0x362551[_0x0605('0x2a')],_0x362551[_0x0605('0x24')]);_0x2db998[_0x0605('0x2e')]=_[_0x0605('0x2d')](_0x362551[_0x0605('0x2a')],qs[_0x0605('0x2f')](_0x25d397[_0x0605('0x24')][_0x0605('0x2f')]));_0x2db998[_0x0605('0x2e')]=_0x2db998['attributes'][_0x0605('0x30')]?_0x2db998[_0x0605('0x2e')]:_0x362551['model'];if(_0x25d397[_0x0605('0x24')][_0x0605('0x31')]){_0x2db998['include']=[{'all':!![]}];}_0x2db998=_[_0x0605('0x32')]({},_0x2db998,_0x25d397[_0x0605('0x33')]);return db[_0x0605('0x1e')][_0x0605('0x34')](_0x2db998)[_0x0605('0x15')](handleEntityNotFound(_0x39e9b7,null))[_0x0605('0x15')](respondWithResult(_0x39e9b7,null))['catch'](handleError(_0x39e9b7,null));};exports['create']=function(_0x216f82,_0x18f7f2){return db[_0x0605('0x1e')]['create'](_0x216f82[_0x0605('0x35')],{})['then'](function(_0xbb1eeb){var _0x1e98f6=_0x216f82[_0x0605('0x36')][_0x0605('0x17')]({'plain':!![]});if(!_0x1e98f6)throw new Error(_0x0605('0x37'));if(_0x1e98f6[_0x0605('0x38')]===_0x0605('0x36')){var _0x24e5af=_0xbb1eeb[_0x0605('0x17')]({'plain':!![]});var _0x3fd533='FaxQueues';return db[_0x0605('0x39')]['find']({'where':{'name':_0x3fd533,'userProfileId':_0x1e98f6[_0x0605('0x3a')]},'raw':!![]})[_0x0605('0x15')](function(_0x45787e){if(_0x45787e&&_0x45787e['autoAssociation']===0x0){return db['UserProfileResource'][_0x0605('0x3b')]({'name':_0x24e5af['name'],'resourceId':_0x24e5af['id'],'type':_0x45787e[_0x0605('0x1b')],'sectionId':_0x45787e['id']},{})[_0x0605('0x15')](function(){return _0xbb1eeb;});}else{return _0xbb1eeb;}})[_0x0605('0x27')](function(_0x3de34a){logger[_0x0605('0x19')](_0x0605('0x3c'),_0x3de34a);throw _0x3de34a;});}return _0xbb1eeb;})[_0x0605('0x15')](respondWithResult(_0x18f7f2,0xc9))[_0x0605('0x27')](handleError(_0x18f7f2,null));};exports[_0x0605('0x14')]=function(_0x10bb36,_0x18d3ce){if(_0x10bb36[_0x0605('0x35')]['id']){delete _0x10bb36[_0x0605('0x35')]['id'];}return db['FaxQueue']['find']({'where':{'id':_0x10bb36[_0x0605('0x29')]['id']}})['then'](handleEntityNotFound(_0x18d3ce,null))[_0x0605('0x15')](saveUpdates(_0x10bb36[_0x0605('0x35')],null))['then'](respondWithResult(_0x18d3ce,null))[_0x0605('0x27')](handleError(_0x18d3ce,null));};exports[_0x0605('0x16')]=function(_0x5057a6,_0x36ab0e){return db[_0x0605('0x1e')]['find']({'where':{'id':_0x5057a6[_0x0605('0x29')]['id']}})[_0x0605('0x15')](handleEntityNotFound(_0x36ab0e,null))['then'](removeEntity(_0x36ab0e,null))[_0x0605('0x27')](handleError(_0x36ab0e,null));};exports['describe']=function(_0x5df8d1,_0x1fa208){return db[_0x0605('0x1e')][_0x0605('0x3d')]()[_0x0605('0x15')](respondWithResult(_0x1fa208,null))[_0x0605('0x27')](handleError(_0x1fa208,null));};exports[_0x0605('0x3e')]=function(_0x3d7cfc,_0x232c93){var _0x56190c={'raw':!![],'where':{}},_0x337f79={},_0x415b31;return db[_0x0605('0x1e')]['findOne']({'where':{'id':_0x3d7cfc[_0x0605('0x29')]['id']}})[_0x0605('0x15')](handleEntityNotFound(_0x232c93,null))[_0x0605('0x15')](function(_0x3a1624){if(_0x3a1624){_0x415b31=_0x3a1624[_0x0605('0x17')]({'plain':!![]});_0x337f79[_0x0605('0x2a')]=_[_0x0605('0x2b')](db[_0x0605('0x3f')][_0x0605('0x1f')]);_0x337f79['query']=_[_0x0605('0x2b')](_0x3d7cfc[_0x0605('0x24')]);_0x337f79[_0x0605('0x2c')]=_[_0x0605('0x2d')](_0x337f79[_0x0605('0x2a')],_0x337f79[_0x0605('0x24')]);_0x56190c[_0x0605('0x2e')]=_[_0x0605('0x2d')](_0x337f79[_0x0605('0x2a')],qs[_0x0605('0x2f')](_0x3d7cfc['query']['fields']));_0x56190c['attributes']=_0x56190c[_0x0605('0x2e')][_0x0605('0x30')]?_0x56190c[_0x0605('0x2e')]:_0x337f79[_0x0605('0x2a')];if(!_0x3d7cfc[_0x0605('0x24')][_0x0605('0x40')]('nolimit')){_0x56190c[_0x0605('0x11')]=qs[_0x0605('0x11')](_0x3d7cfc[_0x0605('0x24')][_0x0605('0x11')]);_0x56190c['offset']=qs[_0x0605('0xf')](_0x3d7cfc[_0x0605('0x24')][_0x0605('0xf')]);}_0x56190c['order']=qs['sort'](_0x3d7cfc[_0x0605('0x24')][_0x0605('0x41')]);_0x56190c[_0x0605('0x22')]=qs['filters'](_['pick'](_0x3d7cfc[_0x0605('0x24')],_0x337f79['filters']));_0x56190c[_0x0605('0x22')][_0x0605('0x42')]=_0x3a1624['id'];if(_0x3d7cfc[_0x0605('0x24')][_0x0605('0x43')]){_0x56190c[_0x0605('0x22')]=_[_0x0605('0x32')](_0x56190c[_0x0605('0x22')],{'$or':_['map'](_0x56190c[_0x0605('0x2e')],function(_0x510e63){var _0x40dd01={};_0x40dd01[_0x510e63]={'$like':'%'+_0x3d7cfc['query'][_0x0605('0x43')]+'%'};return _0x40dd01;})});}_0x56190c=_[_0x0605('0x32')]({},_0x56190c,_0x3d7cfc[_0x0605('0x33')]);return db[_0x0605('0x3f')]['findAll'](_0x56190c);}})['then'](function(_0x418d20){if(_0x418d20){return db[_0x0605('0x44')]['findAndCountAll']({'where':{'id':_['map'](_0x418d20,'UserId'),'role':_0x0605('0x45')},'attributes':['id',_0x0605('0x1b'),_0x0605('0x46'),_0x0605('0x47'),_0x0605('0x48')]});}})[_0x0605('0x15')](function(_0x491ff2){if(_0x491ff2){return{'count':_0x491ff2[_0x0605('0x12')],'rows':_[_0x0605('0x49')](_0x491ff2[_0x0605('0x26')],function(_0x31fda0){return{'membername':_0x31fda0[_0x0605('0x1b')],'UserId':_0x31fda0['id'],'queue_name':_0x415b31[_0x0605('0x1b')],'FaxQueueId':_0x415b31['id'],'interface':util[_0x0605('0x4a')](_0x0605('0x4b'),'SIP',_0x31fda0['name']),'penalty':0x0,'paused':_0x31fda0['faxPause'],'createdAt':_0x31fda0[_0x0605('0x48')],'updatedAt':_0x31fda0[_0x0605('0x47')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0605('0x15')](respondWithFilteredResult(_0x232c93,_0x56190c))['catch'](handleError(_0x232c93,null));};exports['getTeams']=function(_0x36fb25,_0x2227c9){var _0x8ae474={};var _0x3cfbb7={};var _0x14cc4c;var _0x437c90;return db[_0x0605('0x1e')][_0x0605('0x4c')]({'where':{'id':_0x36fb25[_0x0605('0x29')]['id']}})[_0x0605('0x15')](handleEntityNotFound(_0x2227c9,null))[_0x0605('0x15')](function(_0xa2b60){if(_0xa2b60){_0x14cc4c=_0xa2b60;_0x3cfbb7['model']=_[_0x0605('0x2b')](db[_0x0605('0x4d')][_0x0605('0x1f')]);_0x3cfbb7[_0x0605('0x24')]=_[_0x0605('0x2b')](_0x36fb25[_0x0605('0x24')]);_0x3cfbb7['filters']=_[_0x0605('0x2d')](_0x3cfbb7['model'],_0x3cfbb7['query']);_0x8ae474[_0x0605('0x2e')]=_[_0x0605('0x2d')](_0x3cfbb7[_0x0605('0x2a')],qs[_0x0605('0x2f')](_0x36fb25[_0x0605('0x24')][_0x0605('0x2f')]));_0x8ae474[_0x0605('0x2e')]=_0x8ae474[_0x0605('0x2e')][_0x0605('0x30')]?_0x8ae474[_0x0605('0x2e')]:_0x3cfbb7['model'];_0x8ae474['order']=qs['sort'](_0x36fb25['query']['sort']);_0x8ae474[_0x0605('0x22')]=qs[_0x0605('0x2c')](_[_0x0605('0x4e')](_0x36fb25['query'],_0x3cfbb7[_0x0605('0x2c')]));if(_0x36fb25[_0x0605('0x24')][_0x0605('0x43')]){_0x8ae474[_0x0605('0x22')]=_[_0x0605('0x32')](_0x8ae474[_0x0605('0x22')],{'$or':_['map'](_0x8ae474[_0x0605('0x2e')],function(_0x41cae9){var _0x38e202={};_0x38e202[_0x41cae9]={'$like':'%'+_0x36fb25['query']['filter']+'%'};return _0x38e202;})});}_0x8ae474=_['merge']({},_0x8ae474,_0x36fb25[_0x0605('0x33')]);return _0x14cc4c[_0x0605('0x4f')](_0x8ae474);}})[_0x0605('0x15')](function(_0x542607){if(_0x542607){_0x437c90=_0x542607['length'];if(!_0x36fb25['query'][_0x0605('0x40')](_0x0605('0x50'))){_0x8ae474['limit']=qs[_0x0605('0x11')](_0x36fb25[_0x0605('0x24')][_0x0605('0x11')]);_0x8ae474[_0x0605('0xf')]=qs[_0x0605('0xf')](_0x36fb25[_0x0605('0x24')][_0x0605('0xf')]);}return _0x14cc4c[_0x0605('0x4f')](_0x8ae474);}})[_0x0605('0x15')](function(_0x1dbed6){if(_0x1dbed6){return _0x1dbed6?{'count':_0x437c90,'rows':_0x1dbed6}:null;}})[_0x0605('0x15')](respondWithResult(_0x2227c9,null))[_0x0605('0x27')](handleError(_0x2227c9,null));};exports[_0x0605('0x51')]=function(_0x4b1f58,_0x47e20b){var _0x1d500c=_0x4b1f58[_0x0605('0x35')][_0x0605('0x52')];return db['Team']['findAll']({'where':{'id':_0x1d500c},'attributes':['id'],'include':[{'model':db[_0x0605('0x44')],'as':'Agents','attributes':['id','name',_0x0605('0x53'),_0x0605('0x54'),_0x0605('0x55')],'raw':!![]}]})['then'](function(_0x5963c9){if(_0x5963c9){var _0x54e147=_[_0x0605('0x56')](_0x5963c9,function(_0x499892){var _0x8b4ffe=_0x499892[_0x0605('0x17')]({'plain':!![]});return _0x8b4ffe[_0x0605('0x57')];});return db[_0x0605('0x1e')][_0x0605('0x34')]({'where':{'id':_0x4b1f58[_0x0605('0x29')]['id']}})[_0x0605('0x15')](function(_0x1f6ae8){return db['sequelize']['transaction'](function(_0x37512f){return _0x1f6ae8[_0x0605('0x51')](_0x1d500c,{'transaction':_0x37512f})['then'](function(){return BPromise[_0x0605('0x58')](_0x54e147,function(_0x5b29a5){return db[_0x0605('0x3f')][_0x0605('0x59')]({'where':{'UserId':_0x5b29a5['id'],'FaxQueueId':_0x4b1f58['params']['id']},'transaction':_0x37512f});});})[_0x0605('0x15')](function(){_0x54e147['forEach'](function(_0x45caba){socket[_0x0605('0x5a')](_0x0605('0x5b'),{'UserId':_0x45caba['id'],'FaxQueueId':_0x1f6ae8['id']});});});});});}})[_0x0605('0x15')](respondWithStatusCode(_0x47e20b,null))['catch'](handleError(_0x47e20b,null));};exports[_0x0605('0x5c')]=function(_0x4189ba,_0x54b8e2){return db[_0x0605('0x4d')][_0x0605('0x25')]({'where':{'id':_0x4189ba[_0x0605('0x24')][_0x0605('0x52')]},'attributes':['id'],'include':[{'model':db[_0x0605('0x44')],'as':_0x0605('0x57'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x54b8e2,null))['then'](function(_0x3f005a){var _0x1f441f=_[_0x0605('0x49')](_0x3f005a,'id');var _0x4302fb=[];var _0x4de957=[];var _0x9d49a=squel[_0x0605('0x5d')]();_0x9d49a[_0x0605('0x5e')](_0x0605('0x5f'))[_0x0605('0x60')](_0x0605('0x61'),'tq')[_0x0605('0x62')]('user_has_teams','ut',_0x0605('0x63'))[_0x0605('0x22')](_0x0605('0x64'),_0x4189ba[_0x0605('0x29')]['id']);for(var _0x4c49ac=0x0;_0x4c49ac<_0x3f005a['length'];_0x4c49ac+=0x1){let _0x1c08db=_0x3f005a[_0x4c49ac];for(var _0xc3baaa=0x0;_0xc3baaa<_0x1c08db['Agents'][_0x0605('0x30')];_0xc3baaa+=0x1){let _0x503568=_0x1c08db['Agents'][_0xc3baaa];var _0x23e12b=_0x9d49a[_0x0605('0x65')]();_0x23e12b[_0x0605('0x22')]('ut.UserId\x20=\x20?',_0x503568['id']);_0x4de957[_0x0605('0x66')](db[_0x0605('0x67')][_0x0605('0x24')](_0x23e12b[_0x0605('0x68')](),{'type':db[_0x0605('0x67')][_0x0605('0x69')][_0x0605('0x6a')]})[_0x0605('0x15')](function(_0x292178){if(_0x292178[_0x0605('0x30')]===0x1){return _0x503568['id'];}else{var _0x342c2b=_[_0x0605('0x6b')](_[_0x0605('0x49')](_0x292178,_0x0605('0x6c')),function(_0x1e14cc){return _[_0x0605('0x6d')](_0x1f441f,_0x1e14cc);});if(_0x342c2b){return _0x503568['id'];}}}));}}return BPromise['all'](_0x4de957)[_0x0605('0x15')](function(_0x106da4){_0x4302fb=_(_0x4302fb)[_0x0605('0x6e')](_0x106da4)[_0x0605('0x6f')]()[_0x0605('0x70')]();return db['FaxQueue'][_0x0605('0x34')]({'where':{'id':_0x4189ba[_0x0605('0x29')]['id']}})[_0x0605('0x15')](function(_0x5b7e88){return db[_0x0605('0x67')]['transaction'](function(_0xe02b78){return _0x5b7e88['removeTeams'](_0x4189ba['query'][_0x0605('0x52')],{'transaction':_0xe02b78})['then'](function(){if(!_['isEmpty'](_0x4302fb)){return _0x5b7e88[_0x0605('0x71')](_0x4302fb,{'transaction':_0xe02b78});}})[_0x0605('0x15')](function(){_0x4302fb[_0x0605('0x72')](function(_0x1a1e63){socket[_0x0605('0x5a')](_0x0605('0x73'),{'UserId':_0x1a1e63,'FaxQueueId':_0x5b7e88['id']});});});});});});})[_0x0605('0x15')](respondWithStatusCode(_0x54b8e2,null))['catch'](handleError(_0x54b8e2,null));};exports[_0x0605('0x74')]=function(_0xe989d1,_0x3ff76d){return db['FaxQueue'][_0x0605('0x34')]({'where':{'id':_0xe989d1['params']['id']}})[_0x0605('0x15')](handleEntityNotFound(_0x3ff76d,null))[_0x0605('0x15')](function(_0x58278d){if(_0x58278d){return _0x58278d[_0x0605('0x74')](_0xe989d1['body']['ids'],_[_0x0605('0x75')](_0xe989d1[_0x0605('0x35')],[_0x0605('0x52'),'id'])||{})['spread'](function(_0x428f06){for(var _0x2e47d5=0x0;_0x2e47d5<_0xe989d1[_0x0605('0x35')][_0x0605('0x52')][_0x0605('0x30')];_0x2e47d5+=0x1){socket[_0x0605('0x5a')](_0x0605('0x5b'),{'UserId':Number(_0xe989d1[_0x0605('0x35')][_0x0605('0x52')][_0x2e47d5]),'FaxQueueId':Number(_0xe989d1[_0x0605('0x29')]['id'])});}return _0x428f06;});}})['then'](respondWithResult(_0x3ff76d,null))[_0x0605('0x27')](handleError(_0x3ff76d,null));};exports[_0x0605('0x71')]=function(_0xb75eda,_0x23a6ef){return db[_0x0605('0x1e')]['find']({'where':{'id':_0xb75eda[_0x0605('0x29')]['id']}})['then'](handleEntityNotFound(_0x23a6ef,null))[_0x0605('0x15')](function(_0x10e19e){if(_0x10e19e){return _0x10e19e['removeAgents'](_0xb75eda[_0x0605('0x24')][_0x0605('0x52')])[_0x0605('0x15')](function(){if(_[_0x0605('0x76')](_0xb75eda[_0x0605('0x24')][_0x0605('0x52')])){for(var _0x40449c=0x0;_0x40449c<_0xb75eda[_0x0605('0x24')]['ids'][_0x0605('0x30')];_0x40449c+=0x1){socket['emit'](_0x0605('0x73'),{'UserId':Number(_0xb75eda[_0x0605('0x24')][_0x0605('0x52')][_0x40449c]),'FaxQueueId':Number(_0xb75eda[_0x0605('0x29')]['id'])});}}else{socket[_0x0605('0x5a')]('userFaxQueue:remove',{'UserId':Number(_0xb75eda[_0x0605('0x24')][_0x0605('0x52')]),'FaxQueueId':Number(_0xb75eda[_0x0605('0x29')]['id'])});}});}})[_0x0605('0x15')](respondWithStatusCode(_0x23a6ef,null))[_0x0605('0x27')](handleError(_0x23a6ef,null));};exports[_0x0605('0x77')]=function(_0x5dd9f3,_0x403cd4){var _0x3ca4ff={};var _0x39e179={};var _0x26a089;var _0xfbe941;return db[_0x0605('0x1e')][_0x0605('0x4c')]({'where':{'id':_0x5dd9f3['params']['id']}})[_0x0605('0x15')](handleEntityNotFound(_0x403cd4,null))['then'](function(_0x139d90){if(_0x139d90){_0x26a089=_0x139d90;_0x39e179[_0x0605('0x2a')]=_['keys'](db[_0x0605('0x44')][_0x0605('0x1f')]);_0x39e179[_0x0605('0x24')]=_[_0x0605('0x2b')](_0x5dd9f3[_0x0605('0x24')]);_0x39e179[_0x0605('0x2c')]=_['intersection'](_0x39e179['model'],_0x39e179[_0x0605('0x24')]);_0x3ca4ff['attributes']=_[_0x0605('0x2d')](_0x39e179[_0x0605('0x2a')],qs[_0x0605('0x2f')](_0x5dd9f3[_0x0605('0x24')][_0x0605('0x2f')]));_0x3ca4ff[_0x0605('0x2e')]=_0x3ca4ff[_0x0605('0x2e')][_0x0605('0x30')]?_0x3ca4ff[_0x0605('0x2e')]:_0x39e179[_0x0605('0x2a')];_0x3ca4ff[_0x0605('0x78')]=qs[_0x0605('0x41')](_0x5dd9f3[_0x0605('0x24')][_0x0605('0x41')]);_0x3ca4ff[_0x0605('0x22')]=qs[_0x0605('0x2c')](_[_0x0605('0x4e')](_0x5dd9f3[_0x0605('0x24')],_0x39e179[_0x0605('0x2c')]));if(_0x5dd9f3['query'][_0x0605('0x43')]){_0x3ca4ff['where']=_[_0x0605('0x32')](_0x3ca4ff[_0x0605('0x22')],{'$or':_['map'](_0x3ca4ff[_0x0605('0x2e')],function(_0x1a1750){var _0x7e1946={};_0x7e1946[_0x1a1750]={'$like':'%'+_0x5dd9f3[_0x0605('0x24')][_0x0605('0x43')]+'%'};return _0x7e1946;})});}_0x3ca4ff=_[_0x0605('0x32')]({},_0x3ca4ff,_0x5dd9f3[_0x0605('0x33')]);return _0x26a089['getAgents'](_0x3ca4ff);}})[_0x0605('0x15')](function(_0x2f0cb5){if(_0x2f0cb5){_0xfbe941=_0x2f0cb5['length'];if(!_0x5dd9f3['query'][_0x0605('0x40')]('nolimit')){_0x3ca4ff[_0x0605('0x11')]=qs['limit'](_0x5dd9f3[_0x0605('0x24')][_0x0605('0x11')]);_0x3ca4ff['offset']=qs['offset'](_0x5dd9f3['query'][_0x0605('0xf')]);}return _0x26a089['getAgents'](_0x3ca4ff);}})[_0x0605('0x15')](function(_0x5c3dba){if(_0x5c3dba){return _0x5c3dba?{'count':_0xfbe941,'rows':_0x5c3dba}:null;}})[_0x0605('0x15')](respondWithResult(_0x403cd4,null))[_0x0605('0x27')](handleError(_0x403cd4,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index f9a8a36..e38d5c4 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 _0x5731=['FaxQueue','save','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x12b9ac,_0x49493b){var _0x372882=function(_0x5ebc97){while(--_0x5ebc97){_0x12b9ac['push'](_0x12b9ac['shift']());}};_0x372882(++_0x49493b);}(_0x5731,0xa9));var _0x1573=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x5731[_0x1035c1];return _0x308d67;};'use strict';var EventEmitter=require(_0x1573('0x0'));var FaxQueue=require(_0x1573('0x1'))['db'][_0x1573('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1573('0x3'),'afterUpdate':_0x1573('0x4'),'afterDestroy':_0x1573('0x5')};function emitEvent(_0x4d2c31){return function(_0x11826c,_0xe6b62,_0x4c3532){FaxQueueEvents[_0x1573('0x6')](_0x4d2c31+':'+_0x11826c['id'],_0x11826c);FaxQueueEvents[_0x1573('0x6')](_0x4d2c31,_0x11826c);_0x4c3532(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0x1573('0x7')](e,emitEvent(event));}}module[_0x1573('0x8')]=FaxQueueEvents; \ No newline at end of file +var _0xaf41=['hasOwnProperty','hook','exports','../../mysqldb','FaxQueue','save','update','remove','emit'];(function(_0xbad79b,_0x16123f){var _0x35c37a=function(_0x27e047){while(--_0x27e047){_0xbad79b['push'](_0xbad79b['shift']());}};_0x35c37a(++_0x16123f);}(_0xaf41,0x66));var _0x1af4=function(_0x5483a8,_0x199d60){_0x5483a8=_0x5483a8-0x0;var _0x390aa5=_0xaf41[_0x5483a8];return _0x390aa5;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x1af4('0x0'))['db'][_0x1af4('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1af4('0x2'),'afterUpdate':_0x1af4('0x3'),'afterDestroy':_0x1af4('0x4')};function emitEvent(_0x37164a){return function(_0xc5748c,_0x222db0,_0x149c72){FaxQueueEvents['emit'](_0x37164a+':'+_0xc5748c['id'],_0xc5748c);FaxQueueEvents[_0x1af4('0x5')](_0x37164a,_0xc5748c);_0x149c72(null);};}for(var e in events){if(events[_0x1af4('0x6')](e)){var event=events[e];FaxQueue[_0x1af4('0x7')](e,emitEvent(event));}}module[_0x1af4('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 04088c6..3fe4821 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 _0x3a5a=['request-promise','path','rimraf','./faxQueue.attributes','exports','define','FaxQueue','lodash','util','../../config/logger','bluebird'];(function(_0xe20abd,_0x538261){var _0xa97fc1=function(_0x2aaea7){while(--_0x2aaea7){_0xe20abd['push'](_0xe20abd['shift']());}};_0xa97fc1(++_0x538261);}(_0x3a5a,0xcd));var _0xa3a5=function(_0x59d546,_0x107f05){_0x59d546=_0x59d546-0x0;var _0x41fbdb=_0x3a5a[_0x59d546];return _0x41fbdb;};'use strict';var _=require(_0xa3a5('0x0'));var util=require(_0xa3a5('0x1'));var logger=require(_0xa3a5('0x2'))('api');var moment=require('moment');var BPromise=require(_0xa3a5('0x3'));var rp=require(_0xa3a5('0x4'));var fs=require('fs');var path=require(_0xa3a5('0x5'));var rimraf=require(_0xa3a5('0x6'));var config=require('../../config/environment');var attributes=require(_0xa3a5('0x7'));module[_0xa3a5('0x8')]=function(_0x249606,_0x492e14){return _0x249606[_0xa3a5('0x9')](_0xa3a5('0xa'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8cbb=['bluebird','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','fax_queues','lodash','util','../../config/logger','api','moment'];(function(_0x190877,_0x5871c8){var _0x190fd4=function(_0x496c90){while(--_0x496c90){_0x190877['push'](_0x190877['shift']());}};_0x190fd4(++_0x5871c8);}(_0x8cbb,0xbf));var _0xb8cb=function(_0xfd5b35,_0xd8fdd8){_0xfd5b35=_0xfd5b35-0x0;var _0x86ae7e=_0x8cbb[_0xfd5b35];return _0x86ae7e;};'use strict';var _=require(_0xb8cb('0x0'));var util=require(_0xb8cb('0x1'));var logger=require(_0xb8cb('0x2'))(_0xb8cb('0x3'));var moment=require(_0xb8cb('0x4'));var BPromise=require(_0xb8cb('0x5'));var rp=require(_0xb8cb('0x6'));var fs=require('fs');var path=require(_0xb8cb('0x7'));var rimraf=require(_0xb8cb('0x8'));var config=require(_0xb8cb('0x9'));var attributes=require(_0xb8cb('0xa'));module[_0xb8cb('0xb')]=function(_0x5dab5e,_0x44276a){return _0x5dab5e[_0xb8cb('0xc')]('FaxQueue',attributes,{'tableName':_0xb8cb('0xd'),'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 24ad367..0351a8b 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 _0x9f26=['attributes','debug','stringify','ShowFaxQueue','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','request','then','FaxQueue,\x20%s,\x20%s','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','limit','include','map','model'];(function(_0x15b5c2,_0x3c9be5){var _0x613c5a=function(_0x16100f){while(--_0x16100f){_0x15b5c2['push'](_0x15b5c2['shift']());}};_0x613c5a(++_0x3c9be5);}(_0x9f26,0x14d));var _0x69f2=function(_0x532c55,_0x4dab9a){_0x532c55=_0x532c55-0x0;var _0x1eefe9=_0x9f26[_0x532c55];return _0x1eefe9;};'use strict';var _=require(_0x69f2('0x0'));var util=require(_0x69f2('0x1'));var moment=require(_0x69f2('0x2'));var BPromise=require('bluebird');var rs=require(_0x69f2('0x3'));var fs=require('fs');var Redis=require(_0x69f2('0x4'));var db=require(_0x69f2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x69f2('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x69f2('0x7'));var client=jayson[_0x69f2('0x8')][_0x69f2('0x9')]({'port':0x232a});config[_0x69f2('0xa')]=_[_0x69f2('0xb')](config['redis'],{'host':_0x69f2('0xc'),'port':0x18eb});var socket=require(_0x69f2('0xd'))(new Redis(config[_0x69f2('0xa')]));require(_0x69f2('0xe'))['register'](socket);function respondWithRpcPromise(_0x56c43b,_0xa56ff7,_0x1fac76){return new BPromise(function(_0x1ab2b7,_0x24d270){return client[_0x69f2('0xf')](_0x56c43b,_0x1fac76)[_0x69f2('0x10')](function(_0x330026){logger['info'](_0x69f2('0x11'),_0xa56ff7,'request\x20sent');logger['debug'](_0x69f2('0x12'),_0xa56ff7,_0x69f2('0x13'),JSON['stringify'](_0x330026));if(_0x330026[_0x69f2('0x14')]){if(_0x330026[_0x69f2('0x14')][_0x69f2('0x15')]===0x1f4){logger[_0x69f2('0x14')]('FaxQueue,\x20%s,\x20%s',_0xa56ff7,_0x330026[_0x69f2('0x14')]['message']);return _0x24d270(_0x330026['error'][_0x69f2('0x16')]);}logger['error'](_0x69f2('0x11'),_0xa56ff7,_0x330026['error'][_0x69f2('0x16')]);return _0x1ab2b7(_0x330026[_0x69f2('0x14')][_0x69f2('0x16')]);}else{logger[_0x69f2('0x17')]('FaxQueue,\x20%s,\x20%s',_0xa56ff7,_0x69f2('0x13'));_0x1ab2b7(_0x330026[_0x69f2('0x18')]['message']);}})[_0x69f2('0x19')](function(_0x3aca0f){logger[_0x69f2('0x14')]('FaxQueue,\x20%s,\x20%s',_0xa56ff7,_0x3aca0f);_0x24d270(_0x3aca0f);});});}exports[_0x69f2('0x1a')]=function(_0x59a599){var _0x458c0a=this;return new Promise(function(_0x306cb0,_0x424619){return db[_0x69f2('0x1b')][_0x69f2('0x1c')]({'raw':_0x59a599[_0x69f2('0x1d')]?_0x59a599[_0x69f2('0x1d')][_0x69f2('0x1e')]===undefined?!![]:![]:!![],'where':_0x59a599[_0x69f2('0x1d')]?_0x59a599[_0x69f2('0x1d')][_0x69f2('0x1f')]||null:null,'attributes':_0x59a599[_0x69f2('0x1d')]?_0x59a599[_0x69f2('0x1d')]['attributes']||null:null,'limit':_0x59a599[_0x69f2('0x1d')]?_0x59a599[_0x69f2('0x1d')][_0x69f2('0x20')]||null:null,'include':_0x59a599[_0x69f2('0x1d')]?_0x59a599[_0x69f2('0x1d')][_0x69f2('0x21')]?_[_0x69f2('0x22')](_0x59a599[_0x69f2('0x1d')][_0x69f2('0x21')],function(_0x5479d0){return{'model':db[_0x5479d0[_0x69f2('0x23')]],'as':_0x5479d0['as'],'attributes':_0x5479d0[_0x69f2('0x24')],'include':_0x5479d0[_0x69f2('0x21')]?_[_0x69f2('0x22')](_0x5479d0['include'],function(_0x3ccd63){return{'model':db[_0x3ccd63['model']],'as':_0x3ccd63['as'],'attributes':_0x3ccd63['attributes'],'include':_0x3ccd63[_0x69f2('0x21')]?_[_0x69f2('0x22')](_0x3ccd63['include'],function(_0x536685){return{'model':db[_0x536685[_0x69f2('0x23')]],'as':_0x536685['as'],'attributes':_0x536685[_0x69f2('0x24')]};}):[]};}):[]};}):[]:[]})[_0x69f2('0x10')](function(_0x449cf1){logger[_0x69f2('0x17')](_0x69f2('0x1a'),_0x59a599);logger[_0x69f2('0x25')](_0x69f2('0x1a'),_0x59a599,JSON[_0x69f2('0x26')](_0x449cf1));_0x306cb0(_0x449cf1);})['catch'](function(_0x224ff1){logger['error'](_0x69f2('0x1a'),_0x224ff1[_0x69f2('0x16')],_0x59a599);_0x424619(_0x458c0a['error'](0x1f4,_0x224ff1['message']));});});};exports[_0x69f2('0x27')]=function(_0x15e5ca){var _0x5763aa=this;return new Promise(function(_0x1deb85,_0x433a5a){return db[_0x69f2('0x1b')][_0x69f2('0x28')]({'raw':_0x15e5ca[_0x69f2('0x1d')]?_0x15e5ca[_0x69f2('0x1d')][_0x69f2('0x1e')]===undefined?!![]:![]:!![],'where':_0x15e5ca[_0x69f2('0x1d')]?_0x15e5ca[_0x69f2('0x1d')][_0x69f2('0x1f')]||null:null,'attributes':_0x15e5ca[_0x69f2('0x1d')]?_0x15e5ca[_0x69f2('0x1d')][_0x69f2('0x24')]||null:null,'include':_0x15e5ca[_0x69f2('0x1d')]?_0x15e5ca[_0x69f2('0x1d')]['include']?_[_0x69f2('0x22')](_0x15e5ca[_0x69f2('0x1d')][_0x69f2('0x21')],function(_0x4c291e){return{'model':db[_0x4c291e[_0x69f2('0x23')]],'as':_0x4c291e['as'],'attributes':_0x4c291e[_0x69f2('0x24')],'include':_0x4c291e[_0x69f2('0x21')]?_['map'](_0x4c291e[_0x69f2('0x21')],function(_0x58ab9b){return{'model':db[_0x58ab9b[_0x69f2('0x23')]],'as':_0x58ab9b['as'],'attributes':_0x58ab9b[_0x69f2('0x24')],'include':_0x58ab9b[_0x69f2('0x21')]?_[_0x69f2('0x22')](_0x58ab9b['include'],function(_0x1c89a5){return{'model':db[_0x1c89a5[_0x69f2('0x23')]],'as':_0x1c89a5['as'],'attributes':_0x1c89a5[_0x69f2('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x18b157){logger['info']('ShowFaxQueue',_0x15e5ca);logger[_0x69f2('0x25')]('ShowFaxQueue',_0x15e5ca,JSON[_0x69f2('0x26')](_0x18b157));_0x1deb85(_0x18b157);})[_0x69f2('0x19')](function(_0x35a10d){logger[_0x69f2('0x14')]('ShowFaxQueue',_0x35a10d[_0x69f2('0x16')],_0x15e5ca);_0x433a5a(_0x5763aa[_0x69f2('0x14')](0x1f4,_0x35a10d[_0x69f2('0x16')]));});});}; \ No newline at end of file +var _0x9b8b=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./faxQueue.socket','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetFaxQueue','findAll','options','raw','attributes','limit','include','map','model','find','where','ShowFaxQueue'];(function(_0x495054,_0x304104){var _0x146d2e=function(_0x350426){while(--_0x350426){_0x495054['push'](_0x495054['shift']());}};_0x146d2e(++_0x304104);}(_0x9b8b,0xa4));var _0xb9b8=function(_0x28087d,_0x2665af){_0x28087d=_0x28087d-0x0;var _0x5bd30b=_0x9b8b[_0x28087d];return _0x5bd30b;};'use strict';var _=require('lodash');var util=require(_0xb9b8('0x0'));var moment=require('moment');var BPromise=require(_0xb9b8('0x1'));var rs=require(_0xb9b8('0x2'));var fs=require('fs');var Redis=require(_0xb9b8('0x3'));var db=require(_0xb9b8('0x4'))['db'];var utils=require(_0xb9b8('0x5'));var logger=require(_0xb9b8('0x6'))(_0xb9b8('0x7'));var config=require(_0xb9b8('0x8'));var jayson=require(_0xb9b8('0x9'));var client=jayson[_0xb9b8('0xa')][_0xb9b8('0xb')]({'port':0x232a});config['redis']=_[_0xb9b8('0xc')](config[_0xb9b8('0xd')],{'host':_0xb9b8('0xe'),'port':0x18eb});var socket=require(_0xb9b8('0xf'))(new Redis(config[_0xb9b8('0xd')]));require(_0xb9b8('0x10'))['register'](socket);function respondWithRpcPromise(_0x1160ec,_0x105799,_0x2f2621){return new BPromise(function(_0x56956b,_0x2484f2){return client[_0xb9b8('0x11')](_0x1160ec,_0x2f2621)[_0xb9b8('0x12')](function(_0x5d9774){logger[_0xb9b8('0x13')](_0xb9b8('0x14'),_0x105799,_0xb9b8('0x15'));logger[_0xb9b8('0x16')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x105799,'request\x20sent',JSON[_0xb9b8('0x17')](_0x5d9774));if(_0x5d9774[_0xb9b8('0x18')]){if(_0x5d9774[_0xb9b8('0x18')][_0xb9b8('0x19')]===0x1f4){logger[_0xb9b8('0x18')](_0xb9b8('0x14'),_0x105799,_0x5d9774[_0xb9b8('0x18')][_0xb9b8('0x1a')]);return _0x2484f2(_0x5d9774[_0xb9b8('0x18')][_0xb9b8('0x1a')]);}logger[_0xb9b8('0x18')]('FaxQueue,\x20%s,\x20%s',_0x105799,_0x5d9774['error'][_0xb9b8('0x1a')]);return _0x56956b(_0x5d9774[_0xb9b8('0x18')][_0xb9b8('0x1a')]);}else{logger['info']('FaxQueue,\x20%s,\x20%s',_0x105799,_0xb9b8('0x15'));_0x56956b(_0x5d9774[_0xb9b8('0x1b')][_0xb9b8('0x1a')]);}})[_0xb9b8('0x1c')](function(_0x5951c0){logger[_0xb9b8('0x18')]('FaxQueue,\x20%s,\x20%s',_0x105799,_0x5951c0);_0x2484f2(_0x5951c0);});});}exports[_0xb9b8('0x1d')]=function(_0x172759){var _0x1ccca7=this;return new Promise(function(_0x1d247b,_0x47fdb0){return db['FaxQueue'][_0xb9b8('0x1e')]({'raw':_0x172759[_0xb9b8('0x1f')]?_0x172759[_0xb9b8('0x1f')][_0xb9b8('0x20')]===undefined?!![]:![]:!![],'where':_0x172759[_0xb9b8('0x1f')]?_0x172759[_0xb9b8('0x1f')]['where']||null:null,'attributes':_0x172759[_0xb9b8('0x1f')]?_0x172759[_0xb9b8('0x1f')][_0xb9b8('0x21')]||null:null,'limit':_0x172759['options']?_0x172759[_0xb9b8('0x1f')][_0xb9b8('0x22')]||null:null,'include':_0x172759[_0xb9b8('0x1f')]?_0x172759[_0xb9b8('0x1f')][_0xb9b8('0x23')]?_[_0xb9b8('0x24')](_0x172759[_0xb9b8('0x1f')][_0xb9b8('0x23')],function(_0x18876c){return{'model':db[_0x18876c[_0xb9b8('0x25')]],'as':_0x18876c['as'],'attributes':_0x18876c[_0xb9b8('0x21')],'include':_0x18876c['include']?_[_0xb9b8('0x24')](_0x18876c[_0xb9b8('0x23')],function(_0x3fa323){return{'model':db[_0x3fa323[_0xb9b8('0x25')]],'as':_0x3fa323['as'],'attributes':_0x3fa323[_0xb9b8('0x21')],'include':_0x3fa323[_0xb9b8('0x23')]?_['map'](_0x3fa323[_0xb9b8('0x23')],function(_0x4968ff){return{'model':db[_0x4968ff[_0xb9b8('0x25')]],'as':_0x4968ff['as'],'attributes':_0x4968ff['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x59b75d){logger[_0xb9b8('0x13')](_0xb9b8('0x1d'),_0x172759);logger[_0xb9b8('0x16')](_0xb9b8('0x1d'),_0x172759,JSON['stringify'](_0x59b75d));_0x1d247b(_0x59b75d);})[_0xb9b8('0x1c')](function(_0x480fb9){logger[_0xb9b8('0x18')]('GetFaxQueue',_0x480fb9['message'],_0x172759);_0x47fdb0(_0x1ccca7[_0xb9b8('0x18')](0x1f4,_0x480fb9[_0xb9b8('0x1a')]));});});};exports['ShowFaxQueue']=function(_0x1e7a71){var _0x273ba6=this;return new Promise(function(_0xf848ce,_0x4760dc){return db['FaxQueue'][_0xb9b8('0x26')]({'raw':_0x1e7a71[_0xb9b8('0x1f')]?_0x1e7a71[_0xb9b8('0x1f')][_0xb9b8('0x20')]===undefined?!![]:![]:!![],'where':_0x1e7a71[_0xb9b8('0x1f')]?_0x1e7a71['options'][_0xb9b8('0x27')]||null:null,'attributes':_0x1e7a71[_0xb9b8('0x1f')]?_0x1e7a71[_0xb9b8('0x1f')][_0xb9b8('0x21')]||null:null,'include':_0x1e7a71[_0xb9b8('0x1f')]?_0x1e7a71[_0xb9b8('0x1f')][_0xb9b8('0x23')]?_[_0xb9b8('0x24')](_0x1e7a71[_0xb9b8('0x1f')][_0xb9b8('0x23')],function(_0x5ab7b7){return{'model':db[_0x5ab7b7[_0xb9b8('0x25')]],'as':_0x5ab7b7['as'],'attributes':_0x5ab7b7[_0xb9b8('0x21')],'include':_0x5ab7b7['include']?_['map'](_0x5ab7b7[_0xb9b8('0x23')],function(_0x3a3813){return{'model':db[_0x3a3813[_0xb9b8('0x25')]],'as':_0x3a3813['as'],'attributes':_0x3a3813[_0xb9b8('0x21')],'include':_0x3a3813['include']?_[_0xb9b8('0x24')](_0x3a3813[_0xb9b8('0x23')],function(_0x1cc3dd){return{'model':db[_0x1cc3dd[_0xb9b8('0x25')]],'as':_0x1cc3dd['as'],'attributes':_0x1cc3dd['attributes']};}):[]};}):[]};}):[]:[]})[_0xb9b8('0x12')](function(_0x25f2fe){logger['info']('ShowFaxQueue',_0x1e7a71);logger['debug'](_0xb9b8('0x28'),_0x1e7a71,JSON[_0xb9b8('0x17')](_0x25f2fe));_0xf848ce(_0x25f2fe);})[_0xb9b8('0x1c')](function(_0x4914fb){logger[_0xb9b8('0x18')]('ShowFaxQueue',_0x4914fb['message'],_0x1e7a71);_0x4760dc(_0x273ba6[_0xb9b8('0x18')](0x1f4,_0x4914fb['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 4dd9f10..48c487d 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 _0x1fa3=['remove','update','removeListener','register','./faxQueue.events','save'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1fa3,0xc4));var _0x31fa=function(_0x480256,_0x13fefe){_0x480256=_0x480256-0x0;var _0x6530f3=_0x1fa3[_0x480256];return _0x6530f3;};'use strict';var FaxQueueEvents=require(_0x31fa('0x0'));var events=[_0x31fa('0x1'),_0x31fa('0x2'),_0x31fa('0x3')];function createListener(_0x53b172,_0xeb1d3e){return function(_0x46ee1a){_0xeb1d3e['emit'](_0x53b172,_0x46ee1a);};}function removeListener(_0x519060,_0x49815c){return function(){FaxQueueEvents[_0x31fa('0x4')](_0x519060,_0x49815c);};}exports[_0x31fa('0x5')]=function(_0x28f6bc){for(var _0x4fb10a=0x0,_0x2619f3=events['length'];_0x4fb10a<_0x2619f3;_0x4fb10a++){var _0x256b76=events[_0x4fb10a];var _0x34f073=createListener('faxQueue:'+_0x256b76,_0x28f6bc);FaxQueueEvents['on'](_0x256b76,_0x34f073);}}; \ No newline at end of file +var _0x5109=['removeListener','register','length','faxQueue:','./faxQueue.events','save','remove','update','emit'];(function(_0x2787ba,_0x21b7c2){var _0x46e5ec=function(_0x32529f){while(--_0x32529f){_0x2787ba['push'](_0x2787ba['shift']());}};_0x46e5ec(++_0x21b7c2);}(_0x5109,0xb8));var _0x9510=function(_0x4ae689,_0x2b8c25){_0x4ae689=_0x4ae689-0x0;var _0x61137b=_0x5109[_0x4ae689];return _0x61137b;};'use strict';var FaxQueueEvents=require(_0x9510('0x0'));var events=[_0x9510('0x1'),_0x9510('0x2'),_0x9510('0x3')];function createListener(_0x302e55,_0x570950){return function(_0x96f1b6){_0x570950[_0x9510('0x4')](_0x302e55,_0x96f1b6);};}function removeListener(_0xf0adac,_0x31c003){return function(){FaxQueueEvents[_0x9510('0x5')](_0xf0adac,_0x31c003);};}exports[_0x9510('0x6')]=function(_0x240d1a){for(var _0x156535=0x0,_0x59099a=events[_0x9510('0x7')];_0x156535<_0x59099a;_0x156535++){var _0x15341e=events[_0x156535];var _0x37a5f3=createListener(_0x9510('0x8')+_0x15341e,_0x240d1a);FaxQueueEvents['on'](_0x15341e,_0x37a5f3);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 6b896d0..489c6fe 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 _0x50e5=['../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','delete','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x4de9f4,_0x2e546c){var _0x1923cb=function(_0x4a49ad){while(--_0x4a49ad){_0x4de9f4['push'](_0x4de9f4['shift']());}};_0x1923cb(++_0x2e546c);}(_0x50e5,0xb7));var _0x550e=function(_0x3d94a3,_0x243078){_0x3d94a3=_0x3d94a3-0x0;var _0x151feb=_0x50e5[_0x3d94a3];return _0x151feb;};'use strict';var multer=require(_0x550e('0x0'));var util=require(_0x550e('0x1'));var path=require('path');var timeout=require(_0x550e('0x2'));var express=require(_0x550e('0x3'));var router=express[_0x550e('0x4')]();var fs_extra=require(_0x550e('0x5'));var auth=require(_0x550e('0x6'));var interaction=require(_0x550e('0x7'));var config=require(_0x550e('0x8'));var controller=require(_0x550e('0x9'));router[_0x550e('0xa')]('/',auth[_0x550e('0xb')](),controller[_0x550e('0xc')]);router[_0x550e('0xa')]('/describe',auth[_0x550e('0xb')](),controller[_0x550e('0xd')]);router['get'](_0x550e('0xe'),auth[_0x550e('0xb')](),controller[_0x550e('0xf')]);router['get'](_0x550e('0x10'),auth['isAuthenticated'](),controller['getMembers']);router[_0x550e('0xa')](_0x550e('0x11'),auth['isAuthenticated'](),controller[_0x550e('0x12')]);router[_0x550e('0xa')](_0x550e('0x13'),auth[_0x550e('0xb')](),controller['getAgents']);router[_0x550e('0x14')]('/',auth['isAuthenticated'](),controller[_0x550e('0x15')]);router['post'](_0x550e('0x11'),auth[_0x550e('0xb')](),controller[_0x550e('0x16')]);router[_0x550e('0x14')](_0x550e('0x13'),auth['isAuthenticated'](),controller[_0x550e('0x17')]);router['put'](_0x550e('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x550e('0x18')](_0x550e('0xe'),auth['isAuthenticated'](),controller['destroy']);router['delete'](_0x550e('0x11'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x550e('0x18')](_0x550e('0x13'),auth[_0x550e('0xb')](),controller[_0x550e('0x19')]);module[_0x550e('0x1a')]=router; \ No newline at end of file +var _0xa751=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','/:id/teams','getAgents','post','/:id/users','addAgents','put','/:id','destroy','delete','removeAgents','exports','multer','util','path','connect-timeout','Router'];(function(_0x28c6a2,_0x5e2df3){var _0x278cc0=function(_0x50bc21){while(--_0x50bc21){_0x28c6a2['push'](_0x28c6a2['shift']());}};_0x278cc0(++_0x5e2df3);}(_0xa751,0x175));var _0x1a75=function(_0x185d3d,_0x2592fc){_0x185d3d=_0x185d3d-0x0;var _0x6e6b97=_0xa751[_0x185d3d];return _0x6e6b97;};'use strict';var multer=require(_0x1a75('0x0'));var util=require(_0x1a75('0x1'));var path=require(_0x1a75('0x2'));var timeout=require(_0x1a75('0x3'));var express=require('express');var router=express[_0x1a75('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1a75('0x5'));var interaction=require(_0x1a75('0x6'));var config=require(_0x1a75('0x7'));var controller=require('./faxQueue.controller');router[_0x1a75('0x8')]('/',auth[_0x1a75('0x9')](),controller[_0x1a75('0xa')]);router[_0x1a75('0x8')](_0x1a75('0xb'),auth[_0x1a75('0x9')](),controller[_0x1a75('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x1a75('0xd')]);router[_0x1a75('0x8')](_0x1a75('0xe'),auth[_0x1a75('0x9')](),controller[_0x1a75('0xf')]);router[_0x1a75('0x8')](_0x1a75('0x10'),auth[_0x1a75('0x9')](),controller['getTeams']);router['get']('/:id/users',auth[_0x1a75('0x9')](),controller[_0x1a75('0x11')]);router[_0x1a75('0x12')]('/',auth[_0x1a75('0x9')](),controller['create']);router['post'](_0x1a75('0x10'),auth[_0x1a75('0x9')](),controller['addTeams']);router[_0x1a75('0x12')](_0x1a75('0x13'),auth['isAuthenticated'](),controller[_0x1a75('0x14')]);router[_0x1a75('0x15')](_0x1a75('0x16'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x1a75('0x16'),auth[_0x1a75('0x9')](),controller[_0x1a75('0x17')]);router[_0x1a75('0x18')](_0x1a75('0x10'),auth[_0x1a75('0x9')](),controller['removeTeams']);router[_0x1a75('0x18')]('/:id/users',auth['isAuthenticated'](),controller[_0x1a75('0x19')]);module[_0x1a75('0x1a')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 439f7f6..e78e313 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 _0x100c=['DATE','moment','sequelize','STRING'];(function(_0x2e71d6,_0x31d271){var _0x2b3132=function(_0x1d7a20){while(--_0x1d7a20){_0x2e71d6['push'](_0x2e71d6['shift']());}};_0x2b3132(++_0x31d271);}(_0x100c,0x149));var _0xc100=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x100c[_0x1facfa];return _0x9ec701;};'use strict';var moment=require(_0xc100('0x0'));var Sequelize=require(_0xc100('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xc100('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xc100('0x2')]},'joinAt':{'type':Sequelize[_0xc100('0x3')]},'leaveAt':{'type':Sequelize[_0xc100('0x3')]},'acceptAt':{'type':Sequelize[_0xc100('0x3')]},'exitAt':{'type':Sequelize[_0xc100('0x3')]},'reason':{'type':Sequelize[_0xc100('0x2')]}}; \ No newline at end of file +var _0xd54a=['exports','STRING','DATE','moment'];(function(_0x5ae8f7,_0x330d91){var _0x54c636=function(_0x173188){while(--_0x173188){_0x5ae8f7['push'](_0x5ae8f7['shift']());}};_0x54c636(++_0x330d91);}(_0xd54a,0x1df));var _0xad54=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xd54a[_0x255d5b];return _0x3e141a;};'use strict';var moment=require(_0xad54('0x0'));var Sequelize=require('sequelize');module[_0xad54('0x1')]={'uniqueid':{'type':Sequelize[_0xad54('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xad54('0x3')]},'leaveAt':{'type':Sequelize[_0xad54('0x3')]},'acceptAt':{'type':Sequelize[_0xad54('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xad54('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 5b8ee94..4c3a596 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 _0xa446=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','count','apply','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','key','map','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','where','filter','type','VIRTUAL','options','include','FaxQueueReport','findAll','rows','params','keys','includeAll','merge','find','catch','create','body','describe','eml-format','rimraf','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x8bb648,_0x3bae92){var _0x115554=function(_0x494eb7){while(--_0x494eb7){_0x8bb648['push'](_0x8bb648['shift']());}};_0x115554(++_0x3bae92);}(_0xa446,0xc6));var _0x6a44=function(_0x12e476,_0x45dcc1){_0x12e476=_0x12e476-0x0;var _0x3339ad=_0xa446[_0x12e476];return _0x3339ad;};'use strict';var emlformat=require(_0x6a44('0x0'));var rimraf=require(_0x6a44('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6a44('0x2'));var rp=require('request-promise');var moment=require(_0x6a44('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6a44('0x4'));var util=require('util');var path=require(_0x6a44('0x5'));var sox=require(_0x6a44('0x6'));var csv=require(_0x6a44('0x7'));var ejs=require(_0x6a44('0x8'));var fs=require('fs');var fs_extra=require(_0x6a44('0x9'));var _=require(_0x6a44('0xa'));var squel=require('squel');var crypto=require(_0x6a44('0xb'));var jsforce=require(_0x6a44('0xc'));var deskjs=require(_0x6a44('0xd'));var toCsv=require(_0x6a44('0x7'));var querystring=require(_0x6a44('0xe'));var Papa=require('papaparse');var Redis=require(_0x6a44('0xf'));var authService=require(_0x6a44('0x10'));var qs=require(_0x6a44('0x11'));var as=require(_0x6a44('0x12'));var hardwareService=require(_0x6a44('0x13'));var logger=require(_0x6a44('0x14'))(_0x6a44('0x15'));var utils=require('../../config/utils');var config=require(_0x6a44('0x16'));var licenseUtil=require(_0x6a44('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x131b39,_0x1e0639){_0x1e0639=_0x1e0639||0xcc;return function(_0x21ce4a){if(_0x21ce4a){return _0x131b39['sendStatus'](_0x1e0639);}return _0x131b39[_0x6a44('0x18')](_0x1e0639)[_0x6a44('0x19')]();};}function respondWithResult(_0x94be1,_0xb1d987){_0xb1d987=_0xb1d987||0xc8;return function(_0x156a27){if(_0x156a27){return _0x94be1[_0x6a44('0x18')](_0xb1d987)['json'](_0x156a27);}};}function respondWithFilteredResult(_0x52aa9c,_0x260be6){return function(_0x973938){if(_0x973938){var _0x577275=typeof _0x260be6[_0x6a44('0x1a')]===_0x6a44('0x1b')&&typeof _0x260be6[_0x6a44('0x1c')]===_0x6a44('0x1b');var _0x2ff2a0=_0x973938[_0x6a44('0x1d')];var _0x3dde7f=_0x577275?0x0:_0x260be6[_0x6a44('0x1a')];var _0xc0997e=_0x577275?_0x973938[_0x6a44('0x1d')]:_0x260be6[_0x6a44('0x1a')]+_0x260be6[_0x6a44('0x1c')];var _0x1b8920;if(_0xc0997e>=_0x2ff2a0){_0xc0997e=_0x2ff2a0;_0x1b8920=0xc8;}else{_0x1b8920=0xce;}_0x52aa9c[_0x6a44('0x18')](_0x1b8920);return _0x52aa9c['set']('Content-Range',_0x3dde7f+'-'+_0xc0997e+'/'+_0x2ff2a0)['json'](_0x973938);}return null;};}function patchUpdates(_0x2d279b){return function(_0x19410f){try{jsonpatch[_0x6a44('0x1e')](_0x19410f,_0x2d279b,!![]);}catch(_0x1a7990){return BPromise['reject'](_0x1a7990);}return _0x19410f[_0x6a44('0x1f')]();};}function saveUpdates(_0x24ba62,_0x528afe){return function(_0xebf7d6){if(_0xebf7d6){return _0xebf7d6[_0x6a44('0x20')](_0x24ba62)[_0x6a44('0x21')](function(_0x153a7a){return _0x153a7a;});}return null;};}function removeEntity(_0x21a25c,_0x12e6fb){return function(_0x178b35){if(_0x178b35){return _0x178b35[_0x6a44('0x22')]()[_0x6a44('0x21')](function(){_0x21a25c['status'](0xcc)[_0x6a44('0x19')]();});}};}function handleEntityNotFound(_0x99475e,_0x466c54){return function(_0x36b027){if(!_0x36b027){_0x99475e['sendStatus'](0x194);}return _0x36b027;};}function handleError(_0x14141d,_0x4ee88c){_0x4ee88c=_0x4ee88c||0x1f4;return function(_0x3ad23e){logger[_0x6a44('0x23')](_0x3ad23e[_0x6a44('0x24')]);if(_0x3ad23e[_0x6a44('0x25')]){delete _0x3ad23e[_0x6a44('0x25')];}_0x14141d[_0x6a44('0x18')](_0x4ee88c)[_0x6a44('0x26')](_0x3ad23e);};}exports[_0x6a44('0x27')]=function(_0x5a542b,_0x5b81ce){var _0x4a5eab={},_0x265f9d={},_0x5abc23={'count':0x0,'rows':[]};var _0xaef746=_['map'](db['FaxQueueReport'][_0x6a44('0x28')],function(_0xbe9fa1){return{'name':_0xbe9fa1[_0x6a44('0x29')],'type':_0xbe9fa1['type'][_0x6a44('0x2a')]};});_0x265f9d['model']=_[_0x6a44('0x2b')](_0xaef746,_0x6a44('0x25'));_0x265f9d['query']=_['keys'](_0x5a542b[_0x6a44('0x2c')]);_0x265f9d[_0x6a44('0x2d')]=_[_0x6a44('0x2e')](_0x265f9d['model'],_0x265f9d['query']);_0x4a5eab[_0x6a44('0x2f')]=_[_0x6a44('0x2e')](_0x265f9d[_0x6a44('0x30')],qs['fields'](_0x5a542b[_0x6a44('0x2c')][_0x6a44('0x31')]));_0x4a5eab[_0x6a44('0x2f')]=_0x4a5eab[_0x6a44('0x2f')][_0x6a44('0x32')]?_0x4a5eab[_0x6a44('0x2f')]:_0x265f9d[_0x6a44('0x30')];if(!_0x5a542b[_0x6a44('0x2c')][_0x6a44('0x33')](_0x6a44('0x34'))){_0x4a5eab[_0x6a44('0x1c')]=qs[_0x6a44('0x1c')](_0x5a542b['query'][_0x6a44('0x1c')]);_0x4a5eab['offset']=qs['offset'](_0x5a542b['query']['offset']);}_0x4a5eab[_0x6a44('0x35')]=qs['sort'](_0x5a542b[_0x6a44('0x2c')]['sort']);_0x4a5eab[_0x6a44('0x36')]=qs[_0x6a44('0x2d')](_['pick'](_0x5a542b['query'],_0x265f9d[_0x6a44('0x2d')]),_0xaef746);if(_0x5a542b[_0x6a44('0x2c')][_0x6a44('0x37')]){_0x4a5eab[_0x6a44('0x36')]=_['merge'](_0x4a5eab[_0x6a44('0x36')],{'$or':_[_0x6a44('0x2b')](_0xaef746,function(_0x3eee72){if(_0x3eee72[_0x6a44('0x38')]!==_0x6a44('0x39')){var _0x1b88d6={};_0x1b88d6[_0x3eee72['name']]={'$like':'%'+_0x5a542b[_0x6a44('0x2c')][_0x6a44('0x37')]+'%'};return _0x1b88d6;}})});}_0x4a5eab=_['merge']({},_0x4a5eab,_0x5a542b[_0x6a44('0x3a')]);var _0x4e3223={'where':_0x4a5eab[_0x6a44('0x36')]};return db['FaxQueueReport'][_0x6a44('0x1d')](_0x4e3223)[_0x6a44('0x21')](function(_0x1f32a2){_0x5abc23[_0x6a44('0x1d')]=_0x1f32a2;if(_0x5a542b[_0x6a44('0x2c')]['includeAll']){_0x4a5eab[_0x6a44('0x3b')]=[{'all':!![]}];}return db[_0x6a44('0x3c')][_0x6a44('0x3d')](_0x4a5eab);})['then'](function(_0x43eaca){_0x5abc23[_0x6a44('0x3e')]=_0x43eaca;return _0x5abc23;})['then'](respondWithFilteredResult(_0x5b81ce,_0x4a5eab))['catch'](handleError(_0x5b81ce,null));};exports['show']=function(_0x59c038,_0xea4abf){var _0xcdb39={'raw':!![],'where':{'id':_0x59c038[_0x6a44('0x3f')]['id']}},_0x21ba45={};_0x21ba45[_0x6a44('0x30')]=_['keys'](db['FaxQueueReport'][_0x6a44('0x28')]);_0x21ba45[_0x6a44('0x2c')]=_[_0x6a44('0x40')](_0x59c038['query']);_0x21ba45[_0x6a44('0x2d')]=_[_0x6a44('0x2e')](_0x21ba45[_0x6a44('0x30')],_0x21ba45['query']);_0xcdb39[_0x6a44('0x2f')]=_[_0x6a44('0x2e')](_0x21ba45[_0x6a44('0x30')],qs[_0x6a44('0x31')](_0x59c038[_0x6a44('0x2c')][_0x6a44('0x31')]));_0xcdb39[_0x6a44('0x2f')]=_0xcdb39[_0x6a44('0x2f')]['length']?_0xcdb39[_0x6a44('0x2f')]:_0x21ba45[_0x6a44('0x30')];if(_0x59c038[_0x6a44('0x2c')][_0x6a44('0x41')]){_0xcdb39[_0x6a44('0x3b')]=[{'all':!![]}];}_0xcdb39=_[_0x6a44('0x42')]({},_0xcdb39,_0x59c038[_0x6a44('0x3a')]);return db[_0x6a44('0x3c')][_0x6a44('0x43')](_0xcdb39)['then'](handleEntityNotFound(_0xea4abf,null))[_0x6a44('0x21')](respondWithResult(_0xea4abf,null))[_0x6a44('0x44')](handleError(_0xea4abf,null));};exports[_0x6a44('0x45')]=function(_0x3dc7ef,_0x620eb6){return db[_0x6a44('0x3c')][_0x6a44('0x45')](_0x3dc7ef[_0x6a44('0x46')],{})['then'](respondWithResult(_0x620eb6,0xc9))[_0x6a44('0x44')](handleError(_0x620eb6,null));};exports[_0x6a44('0x20')]=function(_0x59377e,_0x4dce0f){if(_0x59377e[_0x6a44('0x46')]['id']){delete _0x59377e['body']['id'];}return db['FaxQueueReport'][_0x6a44('0x43')]({'where':{'id':_0x59377e[_0x6a44('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4dce0f,null))['then'](saveUpdates(_0x59377e[_0x6a44('0x46')],null))[_0x6a44('0x21')](respondWithResult(_0x4dce0f,null))['catch'](handleError(_0x4dce0f,null));};exports[_0x6a44('0x22')]=function(_0x4d0a75,_0x18f09a){return db[_0x6a44('0x3c')][_0x6a44('0x43')]({'where':{'id':_0x4d0a75['params']['id']}})['then'](handleEntityNotFound(_0x18f09a,null))['then'](removeEntity(_0x18f09a,null))['catch'](handleError(_0x18f09a,null));};exports[_0x6a44('0x47')]=function(_0xa393fc,_0x428a08){return db[_0x6a44('0x3c')][_0x6a44('0x47')]()['then'](respondWithResult(_0x428a08,null))[_0x6a44('0x44')](handleError(_0x428a08,null));}; \ No newline at end of file +var _0x37dc=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','update','then','error','stack','name','send','map','FaxQueueReport','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','params','rawAttributes','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring'];(function(_0x2473de,_0xc1ddaa){var _0x32f0f5=function(_0x2d5399){while(--_0x2d5399){_0x2473de['push'](_0x2473de['shift']());}};_0x32f0f5(++_0xc1ddaa);}(_0x37dc,0x1e9));var _0xc37d=function(_0x2a7110,_0x5ce63e){_0x2a7110=_0x2a7110-0x0;var _0x2652bf=_0x37dc[_0x2a7110];return _0x2652bf;};'use strict';var emlformat=require(_0xc37d('0x0'));var rimraf=require(_0xc37d('0x1'));var zipdir=require(_0xc37d('0x2'));var jsonpatch=require(_0xc37d('0x3'));var rp=require('request-promise');var moment=require(_0xc37d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc37d('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc37d('0x6'));var fs=require('fs');var fs_extra=require(_0xc37d('0x7'));var _=require(_0xc37d('0x8'));var squel=require(_0xc37d('0x9'));var crypto=require(_0xc37d('0xa'));var jsforce=require(_0xc37d('0xb'));var deskjs=require(_0xc37d('0xc'));var toCsv=require(_0xc37d('0xd'));var querystring=require(_0xc37d('0xe'));var Papa=require('papaparse');var Redis=require(_0xc37d('0xf'));var authService=require(_0xc37d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xc37d('0x11'));var hardwareService=require(_0xc37d('0x12'));var logger=require('../../config/logger')(_0xc37d('0x13'));var utils=require(_0xc37d('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xc37d('0x15'));var db=require(_0xc37d('0x16'))['db'];function respondWithStatusCode(_0x429e7c,_0x28611c){_0x28611c=_0x28611c||0xcc;return function(_0x345666){if(_0x345666){return _0x429e7c[_0xc37d('0x17')](_0x28611c);}return _0x429e7c[_0xc37d('0x18')](_0x28611c)[_0xc37d('0x19')]();};}function respondWithResult(_0x9da0c,_0x39aab8){_0x39aab8=_0x39aab8||0xc8;return function(_0x183c8a){if(_0x183c8a){return _0x9da0c[_0xc37d('0x18')](_0x39aab8)['json'](_0x183c8a);}};}function respondWithFilteredResult(_0x547047,_0x2e44ea){return function(_0x5bca59){if(_0x5bca59){var _0x5c90e3=typeof _0x2e44ea[_0xc37d('0x1a')]===_0xc37d('0x1b')&&typeof _0x2e44ea['limit']===_0xc37d('0x1b');var _0x4adec0=_0x5bca59['count'];var _0xcd23a5=_0x5c90e3?0x0:_0x2e44ea[_0xc37d('0x1a')];var _0xfefa40=_0x5c90e3?_0x5bca59[_0xc37d('0x1c')]:_0x2e44ea[_0xc37d('0x1a')]+_0x2e44ea[_0xc37d('0x1d')];var _0x59d7cb;if(_0xfefa40>=_0x4adec0){_0xfefa40=_0x4adec0;_0x59d7cb=0xc8;}else{_0x59d7cb=0xce;}_0x547047['status'](_0x59d7cb);return _0x547047[_0xc37d('0x1e')](_0xc37d('0x1f'),_0xcd23a5+'-'+_0xfefa40+'/'+_0x4adec0)[_0xc37d('0x20')](_0x5bca59);}return null;};}function patchUpdates(_0x526ae1){return function(_0x369cf6){try{jsonpatch[_0xc37d('0x21')](_0x369cf6,_0x526ae1,!![]);}catch(_0x55ffb2){return BPromise[_0xc37d('0x22')](_0x55ffb2);}return _0x369cf6['save']();};}function saveUpdates(_0x219840,_0x3db21b){return function(_0x1c1e3a){if(_0x1c1e3a){return _0x1c1e3a[_0xc37d('0x23')](_0x219840)[_0xc37d('0x24')](function(_0x2f48d5){return _0x2f48d5;});}return null;};}function removeEntity(_0x120378,_0x1ab504){return function(_0x2c90df){if(_0x2c90df){return _0x2c90df['destroy']()[_0xc37d('0x24')](function(){_0x120378[_0xc37d('0x18')](0xcc)[_0xc37d('0x19')]();});}};}function handleEntityNotFound(_0x5c1dd7,_0x19fe41){return function(_0x5a4f5b){if(!_0x5a4f5b){_0x5c1dd7['sendStatus'](0x194);}return _0x5a4f5b;};}function handleError(_0x3abbaa,_0x1d8870){_0x1d8870=_0x1d8870||0x1f4;return function(_0x459f13){logger[_0xc37d('0x25')](_0x459f13[_0xc37d('0x26')]);if(_0x459f13['name']){delete _0x459f13[_0xc37d('0x27')];}_0x3abbaa['status'](_0x1d8870)[_0xc37d('0x28')](_0x459f13);};}exports['index']=function(_0x1f69fb,_0x3cdc2d){var _0x1d116a={},_0x26be2a={},_0x1c151d={'count':0x0,'rows':[]};var _0x2e24e7=_[_0xc37d('0x29')](db[_0xc37d('0x2a')]['rawAttributes'],function(_0x146831){return{'name':_0x146831['fieldName'],'type':_0x146831['type'][_0xc37d('0x2b')]};});_0x26be2a[_0xc37d('0x2c')]=_[_0xc37d('0x29')](_0x2e24e7,_0xc37d('0x27'));_0x26be2a[_0xc37d('0x2d')]=_[_0xc37d('0x2e')](_0x1f69fb[_0xc37d('0x2d')]);_0x26be2a[_0xc37d('0x2f')]=_[_0xc37d('0x30')](_0x26be2a['model'],_0x26be2a['query']);_0x1d116a[_0xc37d('0x31')]=_[_0xc37d('0x30')](_0x26be2a[_0xc37d('0x2c')],qs['fields'](_0x1f69fb[_0xc37d('0x2d')][_0xc37d('0x32')]));_0x1d116a[_0xc37d('0x31')]=_0x1d116a['attributes'][_0xc37d('0x33')]?_0x1d116a[_0xc37d('0x31')]:_0x26be2a[_0xc37d('0x2c')];if(!_0x1f69fb[_0xc37d('0x2d')][_0xc37d('0x34')]('nolimit')){_0x1d116a['limit']=qs[_0xc37d('0x1d')](_0x1f69fb['query'][_0xc37d('0x1d')]);_0x1d116a[_0xc37d('0x1a')]=qs[_0xc37d('0x1a')](_0x1f69fb[_0xc37d('0x2d')][_0xc37d('0x1a')]);}_0x1d116a['order']=qs['sort'](_0x1f69fb[_0xc37d('0x2d')][_0xc37d('0x35')]);_0x1d116a[_0xc37d('0x36')]=qs['filters'](_[_0xc37d('0x37')](_0x1f69fb[_0xc37d('0x2d')],_0x26be2a[_0xc37d('0x2f')]),_0x2e24e7);if(_0x1f69fb[_0xc37d('0x2d')][_0xc37d('0x38')]){_0x1d116a[_0xc37d('0x36')]=_[_0xc37d('0x39')](_0x1d116a['where'],{'$or':_['map'](_0x2e24e7,function(_0x318020){if(_0x318020[_0xc37d('0x3a')]!==_0xc37d('0x3b')){var _0x503b7e={};_0x503b7e[_0x318020['name']]={'$like':'%'+_0x1f69fb[_0xc37d('0x2d')]['filter']+'%'};return _0x503b7e;}})});}_0x1d116a=_['merge']({},_0x1d116a,_0x1f69fb[_0xc37d('0x3c')]);var _0x5428a2={'where':_0x1d116a[_0xc37d('0x36')]};return db['FaxQueueReport'][_0xc37d('0x1c')](_0x5428a2)[_0xc37d('0x24')](function(_0x88ed5d){_0x1c151d[_0xc37d('0x1c')]=_0x88ed5d;if(_0x1f69fb[_0xc37d('0x2d')][_0xc37d('0x3d')]){_0x1d116a['include']=[{'all':!![]}];}return db[_0xc37d('0x2a')][_0xc37d('0x3e')](_0x1d116a);})[_0xc37d('0x24')](function(_0x5151f9){_0x1c151d[_0xc37d('0x3f')]=_0x5151f9;return _0x1c151d;})[_0xc37d('0x24')](respondWithFilteredResult(_0x3cdc2d,_0x1d116a))[_0xc37d('0x40')](handleError(_0x3cdc2d,null));};exports['show']=function(_0x5675fb,_0xdea30e){var _0x31c27d={'raw':!![],'where':{'id':_0x5675fb[_0xc37d('0x41')]['id']}},_0x578163={};_0x578163[_0xc37d('0x2c')]=_['keys'](db['FaxQueueReport'][_0xc37d('0x42')]);_0x578163['query']=_[_0xc37d('0x2e')](_0x5675fb[_0xc37d('0x2d')]);_0x578163['filters']=_[_0xc37d('0x30')](_0x578163[_0xc37d('0x2c')],_0x578163['query']);_0x31c27d['attributes']=_[_0xc37d('0x30')](_0x578163[_0xc37d('0x2c')],qs[_0xc37d('0x32')](_0x5675fb[_0xc37d('0x2d')][_0xc37d('0x32')]));_0x31c27d[_0xc37d('0x31')]=_0x31c27d[_0xc37d('0x31')][_0xc37d('0x33')]?_0x31c27d[_0xc37d('0x31')]:_0x578163[_0xc37d('0x2c')];if(_0x5675fb[_0xc37d('0x2d')][_0xc37d('0x3d')]){_0x31c27d[_0xc37d('0x43')]=[{'all':!![]}];}_0x31c27d=_[_0xc37d('0x39')]({},_0x31c27d,_0x5675fb[_0xc37d('0x3c')]);return db[_0xc37d('0x2a')][_0xc37d('0x44')](_0x31c27d)[_0xc37d('0x24')](handleEntityNotFound(_0xdea30e,null))['then'](respondWithResult(_0xdea30e,null))[_0xc37d('0x40')](handleError(_0xdea30e,null));};exports[_0xc37d('0x45')]=function(_0x201554,_0x30dad2){return db[_0xc37d('0x2a')][_0xc37d('0x45')](_0x201554['body'],{})[_0xc37d('0x24')](respondWithResult(_0x30dad2,0xc9))[_0xc37d('0x40')](handleError(_0x30dad2,null));};exports['update']=function(_0x4b2ced,_0x840116){if(_0x4b2ced['body']['id']){delete _0x4b2ced[_0xc37d('0x46')]['id'];}return db[_0xc37d('0x2a')]['find']({'where':{'id':_0x4b2ced[_0xc37d('0x41')]['id']}})[_0xc37d('0x24')](handleEntityNotFound(_0x840116,null))[_0xc37d('0x24')](saveUpdates(_0x4b2ced['body'],null))[_0xc37d('0x24')](respondWithResult(_0x840116,null))[_0xc37d('0x40')](handleError(_0x840116,null));};exports['destroy']=function(_0x242e03,_0xe183d7){return db[_0xc37d('0x2a')][_0xc37d('0x44')]({'where':{'id':_0x242e03[_0xc37d('0x41')]['id']}})[_0xc37d('0x24')](handleEntityNotFound(_0xe183d7,null))['then'](removeEntity(_0xe183d7,null))[_0xc37d('0x40')](handleError(_0xe183d7,null));};exports[_0xc37d('0x47')]=function(_0x5af40f,_0x40bd79){return db[_0xc37d('0x2a')][_0xc37d('0x47')]()[_0xc37d('0x24')](respondWithResult(_0x40bd79,null))[_0xc37d('0x40')](handleError(_0x40bd79,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index f366845..95d1df6 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 _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','uniqueid','lodash'];(function(_0x316cd6,_0x124f2a){var _0x9f5b24=function(_0x43d3e1){while(--_0x43d3e1){_0x316cd6['push'](_0x316cd6['shift']());}};_0x9f5b24(++_0x124f2a);}(_0x326f,0xd1));var _0xf326=function(_0x1964dc,_0xb50e6f){_0x1964dc=_0x1964dc-0x0;var _0x5ef915=_0x326f[_0x1964dc];return _0x5ef915;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xe14b=['bluebird','path','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','lodash','util','moment'];(function(_0x46c140,_0x20d524){var _0x12122e=function(_0x491bfd){while(--_0x491bfd){_0x46c140['push'](_0x46c140['shift']());}};_0x12122e(++_0x20d524);}(_0xe14b,0x93));var _0xbe14=function(_0x3af3b6,_0x4ad29e){_0x3af3b6=_0x3af3b6-0x0;var _0x1a5ad2=_0xe14b[_0x3af3b6];return _0x1a5ad2;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index debf4c3..6d37b38 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 _0x8b13=['FaxQueueReport,\x20%s,\x20%s','result','catch','CreateFaxQueueReport','FaxQueueReport','create','options','raw','update','body','where','attributes','then','UpdateFaxQueueReport','stringify','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','info','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x8b13,0xc3));var _0x38b1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8b13[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x38b1('0x0'));var moment=require(_0x38b1('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x38b1('0x2'));var db=require(_0x38b1('0x3'))['db'];var utils=require(_0x38b1('0x4'));var logger=require(_0x38b1('0x5'))(_0x38b1('0x6'));var config=require(_0x38b1('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x449001,_0x554220,_0x4e3c28){return new BPromise(function(_0x21e6aa,_0xb9be09){return client['request'](_0x449001,_0x4e3c28)['then'](function(_0x1c6bda){logger[_0x38b1('0x8')]('FaxQueueReport,\x20%s,\x20%s',_0x554220,_0x38b1('0x9'));logger[_0x38b1('0xa')](_0x38b1('0xb'),_0x554220,_0x38b1('0x9'),JSON['stringify'](_0x1c6bda));if(_0x1c6bda[_0x38b1('0xc')]){if(_0x1c6bda[_0x38b1('0xc')][_0x38b1('0xd')]===0x1f4){logger[_0x38b1('0xc')]('FaxQueueReport,\x20%s,\x20%s',_0x554220,_0x1c6bda[_0x38b1('0xc')]['message']);return _0xb9be09(_0x1c6bda[_0x38b1('0xc')][_0x38b1('0xe')]);}logger[_0x38b1('0xc')](_0x38b1('0xf'),_0x554220,_0x1c6bda[_0x38b1('0xc')]['message']);return _0x21e6aa(_0x1c6bda[_0x38b1('0xc')]['message']);}else{logger['info'](_0x38b1('0xf'),_0x554220,_0x38b1('0x9'));_0x21e6aa(_0x1c6bda[_0x38b1('0x10')][_0x38b1('0xe')]);}})[_0x38b1('0x11')](function(_0x468944){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x554220,_0x468944);_0xb9be09(_0x468944);});});}exports[_0x38b1('0x12')]=function(_0x44d206){var _0x3ac71e=this;return new Promise(function(_0x536650,_0x3a9e35){return db[_0x38b1('0x13')][_0x38b1('0x14')](_0x44d206['body'],{'raw':_0x44d206[_0x38b1('0x15')]?_0x44d206[_0x38b1('0x15')][_0x38b1('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x595cac){logger[_0x38b1('0x8')](_0x38b1('0x12'),_0x44d206);logger['debug'](_0x38b1('0x12'),_0x44d206,JSON['stringify'](_0x595cac));_0x536650(_0x595cac);})[_0x38b1('0x11')](function(_0x4321d2){logger[_0x38b1('0xc')](_0x38b1('0x12'),_0x4321d2['message'],_0x44d206);_0x3a9e35(_0x3ac71e[_0x38b1('0xc')](0x1f4,_0x4321d2['message']));});});};exports['UpdateFaxQueueReport']=function(_0x1d502c){var _0xe3f002=this;return new Promise(function(_0x9fc8d6,_0x44b4f0){return db[_0x38b1('0x13')][_0x38b1('0x17')](_0x1d502c[_0x38b1('0x18')],{'raw':_0x1d502c[_0x38b1('0x15')]?_0x1d502c[_0x38b1('0x15')][_0x38b1('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d502c[_0x38b1('0x15')]?_0x1d502c['options'][_0x38b1('0x19')]||null:null,'attributes':_0x1d502c[_0x38b1('0x15')]?_0x1d502c[_0x38b1('0x15')][_0x38b1('0x1a')]||null:null,'limit':_0x1d502c[_0x38b1('0x15')]?_0x1d502c[_0x38b1('0x15')]['limit']||null:null})[_0x38b1('0x1b')](function(_0x342295){logger[_0x38b1('0x8')](_0x38b1('0x1c'),_0x1d502c);logger[_0x38b1('0xa')](_0x38b1('0x1c'),_0x1d502c,JSON[_0x38b1('0x1d')](_0x342295));_0x9fc8d6(_0x342295);})[_0x38b1('0x11')](function(_0x491628){logger['error'](_0x38b1('0x1c'),_0x491628['message'],_0x1d502c);_0x44b4f0(_0xe3f002['error'](0x1f4,_0x491628[_0x38b1('0xe')]));});});}; \ No newline at end of file +var _0x9aab=['rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueueReport,\x20%s,\x20%s','message','result','catch','FaxQueueReport','options','then','CreateFaxQueueReport','UpdateFaxQueueReport','update','body','raw','attributes','limit','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0x26172c,_0x3da4b5){var _0xb99a81=function(_0x299355){while(--_0x299355){_0x26172c['push'](_0x26172c['shift']());}};_0xb99a81(++_0x3da4b5);}(_0x9aab,0x7a));var _0xb9aa=function(_0x4e128d,_0x4e149e){_0x4e128d=_0x4e128d-0x0;var _0x241615=_0x9aab[_0x4e128d];return _0x241615;};'use strict';var _=require(_0xb9aa('0x0'));var util=require('util');var moment=require(_0xb9aa('0x1'));var BPromise=require(_0xb9aa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb9aa('0x3'));var db=require(_0xb9aa('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb9aa('0x5'))(_0xb9aa('0x6'));var config=require(_0xb9aa('0x7'));var jayson=require(_0xb9aa('0x8'));var client=jayson[_0xb9aa('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4709d9,_0x545394,_0xedfb23){return new BPromise(function(_0x2cfa05,_0x2bc5a6){return client[_0xb9aa('0xa')](_0x4709d9,_0xedfb23)['then'](function(_0x356ce6){logger[_0xb9aa('0xb')]('FaxQueueReport,\x20%s,\x20%s',_0x545394,_0xb9aa('0xc'));logger[_0xb9aa('0xd')](_0xb9aa('0xe'),_0x545394,_0xb9aa('0xc'),JSON[_0xb9aa('0xf')](_0x356ce6));if(_0x356ce6[_0xb9aa('0x10')]){if(_0x356ce6[_0xb9aa('0x10')][_0xb9aa('0x11')]===0x1f4){logger[_0xb9aa('0x10')](_0xb9aa('0x12'),_0x545394,_0x356ce6[_0xb9aa('0x10')][_0xb9aa('0x13')]);return _0x2bc5a6(_0x356ce6['error'][_0xb9aa('0x13')]);}logger[_0xb9aa('0x10')](_0xb9aa('0x12'),_0x545394,_0x356ce6['error'][_0xb9aa('0x13')]);return _0x2cfa05(_0x356ce6[_0xb9aa('0x10')][_0xb9aa('0x13')]);}else{logger[_0xb9aa('0xb')]('FaxQueueReport,\x20%s,\x20%s',_0x545394,'request\x20sent');_0x2cfa05(_0x356ce6[_0xb9aa('0x14')][_0xb9aa('0x13')]);}})[_0xb9aa('0x15')](function(_0x4eec3b){logger[_0xb9aa('0x10')](_0xb9aa('0x12'),_0x545394,_0x4eec3b);_0x2bc5a6(_0x4eec3b);});});}exports['CreateFaxQueueReport']=function(_0x510572){var _0x5c217d=this;return new Promise(function(_0x2a1c42,_0x380fd1){return db[_0xb9aa('0x16')]['create'](_0x510572['body'],{'raw':_0x510572[_0xb9aa('0x17')]?_0x510572['options']['raw']===undefined?!![]:![]:!![]})[_0xb9aa('0x18')](function(_0x350d46){logger['info'](_0xb9aa('0x19'),_0x510572);logger[_0xb9aa('0xd')](_0xb9aa('0x19'),_0x510572,JSON[_0xb9aa('0xf')](_0x350d46));_0x2a1c42(_0x350d46);})['catch'](function(_0x1e768a){logger['error']('CreateFaxQueueReport',_0x1e768a[_0xb9aa('0x13')],_0x510572);_0x380fd1(_0x5c217d[_0xb9aa('0x10')](0x1f4,_0x1e768a['message']));});});};exports[_0xb9aa('0x1a')]=function(_0x170355){var _0xabf7b9=this;return new Promise(function(_0x17e5cd,_0x2f257b){return db[_0xb9aa('0x16')][_0xb9aa('0x1b')](_0x170355[_0xb9aa('0x1c')],{'raw':_0x170355[_0xb9aa('0x17')]?_0x170355[_0xb9aa('0x17')][_0xb9aa('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x170355[_0xb9aa('0x17')]?_0x170355[_0xb9aa('0x17')]['where']||null:null,'attributes':_0x170355[_0xb9aa('0x17')]?_0x170355[_0xb9aa('0x17')][_0xb9aa('0x1e')]||null:null,'limit':_0x170355[_0xb9aa('0x17')]?_0x170355[_0xb9aa('0x17')][_0xb9aa('0x1f')]||null:null})[_0xb9aa('0x18')](function(_0x46806e){logger[_0xb9aa('0xb')](_0xb9aa('0x1a'),_0x170355);logger['debug'](_0xb9aa('0x1a'),_0x170355,JSON[_0xb9aa('0xf')](_0x46806e));_0x17e5cd(_0x46806e);})[_0xb9aa('0x15')](function(_0x4cd8f){logger[_0xb9aa('0x10')](_0xb9aa('0x1a'),_0x4cd8f[_0xb9aa('0x13')],_0x170355);_0x2f257b(_0xabf7b9[_0xb9aa('0x10')](0x1f4,_0x4cd8f[_0xb9aa('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 4f18b52..bd065c5 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 _0x9e67=['get','isAuthenticated','index','/describe','/:id','show','post','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller'];(function(_0x30deb4,_0x3c9213){var _0xa65c53=function(_0x19dbcb){while(--_0x19dbcb){_0x30deb4['push'](_0x30deb4['shift']());}};_0xa65c53(++_0x3c9213);}(_0x9e67,0x1d9));var _0x79e6=function(_0x2b6699,_0x21de96){_0x2b6699=_0x2b6699-0x0;var _0x2f10a1=_0x9e67[_0x2b6699];return _0x2f10a1;};'use strict';var multer=require(_0x79e6('0x0'));var util=require('util');var path=require(_0x79e6('0x1'));var timeout=require(_0x79e6('0x2'));var express=require(_0x79e6('0x3'));var router=express[_0x79e6('0x4')]();var fs_extra=require(_0x79e6('0x5'));var auth=require(_0x79e6('0x6'));var interaction=require(_0x79e6('0x7'));var config=require(_0x79e6('0x8'));var controller=require(_0x79e6('0x9'));router[_0x79e6('0xa')]('/',auth[_0x79e6('0xb')](),controller[_0x79e6('0xc')]);router[_0x79e6('0xa')](_0x79e6('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0x79e6('0xa')](_0x79e6('0xe'),auth[_0x79e6('0xb')](),controller[_0x79e6('0xf')]);router[_0x79e6('0x10')]('/',auth[_0x79e6('0xb')](),controller['create']);router[_0x79e6('0x11')](_0x79e6('0xe'),auth[_0x79e6('0xb')](),controller[_0x79e6('0x12')]);router[_0x79e6('0x13')](_0x79e6('0xe'),auth[_0x79e6('0xb')](),controller[_0x79e6('0x14')]);module['exports']=router; \ No newline at end of file +var _0xc746=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete'];(function(_0x1842bb,_0x41250a){var _0xe81b30=function(_0xd43d81){while(--_0xd43d81){_0x1842bb['push'](_0x1842bb['shift']());}};_0xe81b30(++_0x41250a);}(_0xc746,0xd1));var _0x6c74=function(_0x37de02,_0x361205){_0x37de02=_0x37de02-0x0;var _0x8717fa=_0xc746[_0x37de02];return _0x8717fa;};'use strict';var multer=require(_0x6c74('0x0'));var util=require(_0x6c74('0x1'));var path=require(_0x6c74('0x2'));var timeout=require(_0x6c74('0x3'));var express=require(_0x6c74('0x4'));var router=express[_0x6c74('0x5')]();var fs_extra=require(_0x6c74('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x6c74('0x7'));var config=require(_0x6c74('0x8'));var controller=require(_0x6c74('0x9'));router[_0x6c74('0xa')]('/',auth[_0x6c74('0xb')](),controller[_0x6c74('0xc')]);router[_0x6c74('0xa')](_0x6c74('0xd'),auth[_0x6c74('0xb')](),controller[_0x6c74('0xe')]);router['get'](_0x6c74('0xf'),auth[_0x6c74('0xb')](),controller[_0x6c74('0x10')]);router[_0x6c74('0x11')]('/',auth[_0x6c74('0xb')](),controller[_0x6c74('0x12')]);router[_0x6c74('0x13')](_0x6c74('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x6c74('0x14')](_0x6c74('0xf'),auth[_0x6c74('0xb')](),controller[_0x6c74('0x15')]);module[_0x6c74('0x16')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 9f1612f..56007bc 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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x2f80c7,_0x24d5d3){var _0xf92e6=function(_0x7e22e2){while(--_0x7e22e2){_0x2f80c7['push'](_0x2f80c7['shift']());}};_0xf92e6(++_0x24d5d3);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x400b43,_0x55da4e){_0x400b43=_0x400b43-0x0;var _0x3c330f=_0xf3cd[_0x400b43];return _0x3c330f;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x29f1d1,_0x10a240){var _0x8fce6d=function(_0x280618){while(--_0x280618){_0x29f1d1['push'](_0x29f1d1['shift']());}};_0x8fce6d(++_0x10a240);}(_0x00bb,0x1d8));var _0xb00b=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x00bb[_0x5c351c];return _0x26f3b3;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index f8f02f7..22255c0 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 _0x6e23=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','apply','reject','then','destroy','sendStatus','stack','name','send','FaxTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','map','VIRTUAL','merge','options','rows','catch','params','include','body','update','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x4a2246,_0x5a11e8){var _0x4392b4=function(_0x577fd1){while(--_0x577fd1){_0x4a2246['push'](_0x4a2246['shift']());}};_0x4392b4(++_0x5a11e8);}(_0x6e23,0x7c));var _0x36e2=function(_0x59cac5,_0x3b9efe){_0x59cac5=_0x59cac5-0x0;var _0x42ebc7=_0x6e23[_0x59cac5];return _0x42ebc7;};'use strict';var emlformat=require(_0x36e2('0x0'));var rimraf=require(_0x36e2('0x1'));var zipdir=require(_0x36e2('0x2'));var jsonpatch=require(_0x36e2('0x3'));var rp=require(_0x36e2('0x4'));var moment=require('moment');var BPromise=require(_0x36e2('0x5'));var Mustache=require(_0x36e2('0x6'));var util=require('util');var path=require('path');var sox=require(_0x36e2('0x7'));var csv=require('to-csv');var ejs=require(_0x36e2('0x8'));var fs=require('fs');var fs_extra=require(_0x36e2('0x9'));var _=require(_0x36e2('0xa'));var squel=require('squel');var crypto=require(_0x36e2('0xb'));var jsforce=require(_0x36e2('0xc'));var deskjs=require(_0x36e2('0xd'));var toCsv=require('to-csv');var querystring=require(_0x36e2('0xe'));var Papa=require(_0x36e2('0xf'));var Redis=require(_0x36e2('0x10'));var authService=require(_0x36e2('0x11'));var qs=require(_0x36e2('0x12'));var as=require(_0x36e2('0x13'));var hardwareService=require(_0x36e2('0x14'));var logger=require(_0x36e2('0x15'))('api');var utils=require(_0x36e2('0x16'));var config=require(_0x36e2('0x17'));var licenseUtil=require(_0x36e2('0x18'));var db=require(_0x36e2('0x19'))['db'];function respondWithStatusCode(_0x4caa68,_0x404728){_0x404728=_0x404728||0xcc;return function(_0x410298){if(_0x410298){return _0x4caa68['sendStatus'](_0x404728);}return _0x4caa68['status'](_0x404728)[_0x36e2('0x1a')]();};}function respondWithResult(_0x335557,_0x10c41d){_0x10c41d=_0x10c41d||0xc8;return function(_0x5ca783){if(_0x5ca783){return _0x335557[_0x36e2('0x1b')](_0x10c41d)[_0x36e2('0x1c')](_0x5ca783);}};}function respondWithFilteredResult(_0x48667e,_0x23a50b){return function(_0x33244b){if(_0x33244b){var _0x330b7c=typeof _0x23a50b[_0x36e2('0x1d')]===_0x36e2('0x1e')&&typeof _0x23a50b[_0x36e2('0x1f')]===_0x36e2('0x1e');var _0x313e41=_0x33244b[_0x36e2('0x20')];var _0xa9cf7d=_0x330b7c?0x0:_0x23a50b[_0x36e2('0x1d')];var _0x1f5b78=_0x330b7c?_0x33244b[_0x36e2('0x20')]:_0x23a50b['offset']+_0x23a50b[_0x36e2('0x1f')];var _0x4d040f;if(_0x1f5b78>=_0x313e41){_0x1f5b78=_0x313e41;_0x4d040f=0xc8;}else{_0x4d040f=0xce;}_0x48667e[_0x36e2('0x1b')](_0x4d040f);return _0x48667e['set']('Content-Range',_0xa9cf7d+'-'+_0x1f5b78+'/'+_0x313e41)[_0x36e2('0x1c')](_0x33244b);}return null;};}function patchUpdates(_0x1a5070){return function(_0xb9dac8){try{jsonpatch[_0x36e2('0x21')](_0xb9dac8,_0x1a5070,!![]);}catch(_0x4ea02e){return BPromise[_0x36e2('0x22')](_0x4ea02e);}return _0xb9dac8['save']();};}function saveUpdates(_0x1a8906,_0x56ba4f){return function(_0x4e2ae0){if(_0x4e2ae0){return _0x4e2ae0['update'](_0x1a8906)[_0x36e2('0x23')](function(_0x4a783e){return _0x4a783e;});}return null;};}function removeEntity(_0x49de3c,_0x430dab){return function(_0x4731b8){if(_0x4731b8){return _0x4731b8[_0x36e2('0x24')]()[_0x36e2('0x23')](function(){_0x49de3c[_0x36e2('0x1b')](0xcc)[_0x36e2('0x1a')]();});}};}function handleEntityNotFound(_0x78e0d,_0x32e52e){return function(_0x12bb87){if(!_0x12bb87){_0x78e0d[_0x36e2('0x25')](0x194);}return _0x12bb87;};}function handleError(_0x1d7c95,_0xbb595c){_0xbb595c=_0xbb595c||0x1f4;return function(_0x5c9cc2){logger['error'](_0x5c9cc2[_0x36e2('0x26')]);if(_0x5c9cc2[_0x36e2('0x27')]){delete _0x5c9cc2[_0x36e2('0x27')];}_0x1d7c95[_0x36e2('0x1b')](_0xbb595c)[_0x36e2('0x28')](_0x5c9cc2);};}exports['index']=function(_0x5226b4,_0x5a1084){var _0x5132bb={},_0xcddfeb={},_0x27e9a4={'count':0x0,'rows':[]};var _0x2b4c69=_['map'](db[_0x36e2('0x29')][_0x36e2('0x2a')],function(_0x480cce){return{'name':_0x480cce[_0x36e2('0x2b')],'type':_0x480cce[_0x36e2('0x2c')][_0x36e2('0x2d')]};});_0xcddfeb[_0x36e2('0x2e')]=_['map'](_0x2b4c69,_0x36e2('0x27'));_0xcddfeb[_0x36e2('0x2f')]=_[_0x36e2('0x30')](_0x5226b4[_0x36e2('0x2f')]);_0xcddfeb[_0x36e2('0x31')]=_[_0x36e2('0x32')](_0xcddfeb[_0x36e2('0x2e')],_0xcddfeb[_0x36e2('0x2f')]);_0x5132bb['attributes']=_[_0x36e2('0x32')](_0xcddfeb[_0x36e2('0x2e')],qs[_0x36e2('0x33')](_0x5226b4[_0x36e2('0x2f')][_0x36e2('0x33')]));_0x5132bb[_0x36e2('0x34')]=_0x5132bb['attributes'][_0x36e2('0x35')]?_0x5132bb[_0x36e2('0x34')]:_0xcddfeb['model'];if(!_0x5226b4[_0x36e2('0x2f')]['hasOwnProperty'](_0x36e2('0x36'))){_0x5132bb[_0x36e2('0x1f')]=qs[_0x36e2('0x1f')](_0x5226b4[_0x36e2('0x2f')][_0x36e2('0x1f')]);_0x5132bb[_0x36e2('0x1d')]=qs[_0x36e2('0x1d')](_0x5226b4[_0x36e2('0x2f')]['offset']);}_0x5132bb[_0x36e2('0x37')]=qs[_0x36e2('0x38')](_0x5226b4['query']['sort']);_0x5132bb[_0x36e2('0x39')]=qs[_0x36e2('0x31')](_[_0x36e2('0x3a')](_0x5226b4[_0x36e2('0x2f')],_0xcddfeb[_0x36e2('0x31')]),_0x2b4c69);if(_0x5226b4['query'][_0x36e2('0x3b')]){_0x5132bb[_0x36e2('0x39')]=_['merge'](_0x5132bb[_0x36e2('0x39')],{'$or':_[_0x36e2('0x3c')](_0x2b4c69,function(_0x2bd78c){if(_0x2bd78c['type']!==_0x36e2('0x3d')){var _0xd3c66f={};_0xd3c66f[_0x2bd78c[_0x36e2('0x27')]]={'$like':'%'+_0x5226b4[_0x36e2('0x2f')][_0x36e2('0x3b')]+'%'};return _0xd3c66f;}})});}_0x5132bb=_[_0x36e2('0x3e')]({},_0x5132bb,_0x5226b4[_0x36e2('0x3f')]);var _0x21dc93={'where':_0x5132bb[_0x36e2('0x39')]};return db[_0x36e2('0x29')][_0x36e2('0x20')](_0x21dc93)[_0x36e2('0x23')](function(_0x1b6b0d){_0x27e9a4['count']=_0x1b6b0d;if(_0x5226b4[_0x36e2('0x2f')]['includeAll']){_0x5132bb['include']=[{'all':!![]}];}return db[_0x36e2('0x29')]['findAll'](_0x5132bb);})[_0x36e2('0x23')](function(_0x5b14ae){_0x27e9a4[_0x36e2('0x40')]=_0x5b14ae;return _0x27e9a4;})['then'](respondWithFilteredResult(_0x5a1084,_0x5132bb))[_0x36e2('0x41')](handleError(_0x5a1084,null));};exports['show']=function(_0x15cafc,_0x48c75f){var _0x45f8ec={'raw':!![],'where':{'id':_0x15cafc[_0x36e2('0x42')]['id']}},_0x1ede22={};_0x1ede22[_0x36e2('0x2e')]=_[_0x36e2('0x30')](db['FaxTransferReport'][_0x36e2('0x2a')]);_0x1ede22[_0x36e2('0x2f')]=_[_0x36e2('0x30')](_0x15cafc[_0x36e2('0x2f')]);_0x1ede22[_0x36e2('0x31')]=_[_0x36e2('0x32')](_0x1ede22[_0x36e2('0x2e')],_0x1ede22[_0x36e2('0x2f')]);_0x45f8ec[_0x36e2('0x34')]=_[_0x36e2('0x32')](_0x1ede22[_0x36e2('0x2e')],qs[_0x36e2('0x33')](_0x15cafc[_0x36e2('0x2f')][_0x36e2('0x33')]));_0x45f8ec['attributes']=_0x45f8ec[_0x36e2('0x34')][_0x36e2('0x35')]?_0x45f8ec[_0x36e2('0x34')]:_0x1ede22[_0x36e2('0x2e')];if(_0x15cafc[_0x36e2('0x2f')]['includeAll']){_0x45f8ec[_0x36e2('0x43')]=[{'all':!![]}];}_0x45f8ec=_[_0x36e2('0x3e')]({},_0x45f8ec,_0x15cafc['options']);return db['FaxTransferReport']['find'](_0x45f8ec)[_0x36e2('0x23')](handleEntityNotFound(_0x48c75f,null))[_0x36e2('0x23')](respondWithResult(_0x48c75f,null))[_0x36e2('0x41')](handleError(_0x48c75f,null));};exports['create']=function(_0x2065d4,_0x2fa539){return db[_0x36e2('0x29')]['create'](_0x2065d4[_0x36e2('0x44')],{})[_0x36e2('0x23')](respondWithResult(_0x2fa539,0xc9))[_0x36e2('0x41')](handleError(_0x2fa539,null));};exports[_0x36e2('0x45')]=function(_0x5dd653,_0x5d2d6a){if(_0x5dd653[_0x36e2('0x44')]['id']){delete _0x5dd653['body']['id'];}return db[_0x36e2('0x29')][_0x36e2('0x46')]({'where':{'id':_0x5dd653[_0x36e2('0x42')]['id']}})[_0x36e2('0x23')](handleEntityNotFound(_0x5d2d6a,null))[_0x36e2('0x23')](saveUpdates(_0x5dd653[_0x36e2('0x44')],null))[_0x36e2('0x23')](respondWithResult(_0x5d2d6a,null))['catch'](handleError(_0x5d2d6a,null));};exports[_0x36e2('0x24')]=function(_0x1b9e1a,_0x39fa27){return db[_0x36e2('0x29')][_0x36e2('0x46')]({'where':{'id':_0x1b9e1a[_0x36e2('0x42')]['id']}})[_0x36e2('0x23')](handleEntityNotFound(_0x39fa27,null))[_0x36e2('0x23')](removeEntity(_0x39fa27,null))['catch'](handleError(_0x39fa27,null));};exports['describe']=function(_0x1d8923,_0x35a9e9){return db[_0x36e2('0x29')]['describe']()[_0x36e2('0x23')](respondWithResult(_0x35a9e9,null))['catch'](handleError(_0x35a9e9,null));}; \ No newline at end of file +var _0xe2ed=['options','FaxTransferReport','find','create','catch','body','params','describe','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','filter','where','merge','include','findAll','rows','show'];(function(_0x423e42,_0x2f632b){var _0x12e752=function(_0x23d7df){while(--_0x23d7df){_0x423e42['push'](_0x423e42['shift']());}};_0x12e752(++_0x2f632b);}(_0xe2ed,0xdd));var _0xde2e=function(_0x504532,_0x353435){_0x504532=_0x504532-0x0;var _0x5bc639=_0xe2ed[_0x504532];return _0x5bc639;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xde2e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xde2e('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xde2e('0x2'));var Mustache=require(_0xde2e('0x3'));var util=require(_0xde2e('0x4'));var path=require(_0xde2e('0x5'));var sox=require(_0xde2e('0x6'));var csv=require(_0xde2e('0x7'));var ejs=require(_0xde2e('0x8'));var fs=require('fs');var fs_extra=require(_0xde2e('0x9'));var _=require(_0xde2e('0xa'));var squel=require('squel');var crypto=require(_0xde2e('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xde2e('0xc'));var toCsv=require(_0xde2e('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xde2e('0xd'));var authService=require(_0xde2e('0xe'));var qs=require(_0xde2e('0xf'));var as=require(_0xde2e('0x10'));var hardwareService=require(_0xde2e('0x11'));var logger=require('../../config/logger')(_0xde2e('0x12'));var utils=require('../../config/utils');var config=require(_0xde2e('0x13'));var licenseUtil=require(_0xde2e('0x14'));var db=require(_0xde2e('0x15'))['db'];function respondWithStatusCode(_0x14ae12,_0x2fd99e){_0x2fd99e=_0x2fd99e||0xcc;return function(_0x212bf5){if(_0x212bf5){return _0x14ae12[_0xde2e('0x16')](_0x2fd99e);}return _0x14ae12[_0xde2e('0x17')](_0x2fd99e)[_0xde2e('0x18')]();};}function respondWithResult(_0x4b460a,_0x48b6e3){_0x48b6e3=_0x48b6e3||0xc8;return function(_0x17f26e){if(_0x17f26e){return _0x4b460a[_0xde2e('0x17')](_0x48b6e3)[_0xde2e('0x19')](_0x17f26e);}};}function respondWithFilteredResult(_0x206fb8,_0x4615ab){return function(_0x507664){if(_0x507664){var _0x22533f=typeof _0x4615ab['offset']===_0xde2e('0x1a')&&typeof _0x4615ab[_0xde2e('0x1b')]===_0xde2e('0x1a');var _0x27333d=_0x507664['count'];var _0x3469e5=_0x22533f?0x0:_0x4615ab[_0xde2e('0x1c')];var _0x5d5ad2=_0x22533f?_0x507664[_0xde2e('0x1d')]:_0x4615ab[_0xde2e('0x1c')]+_0x4615ab[_0xde2e('0x1b')];var _0x33aa7c;if(_0x5d5ad2>=_0x27333d){_0x5d5ad2=_0x27333d;_0x33aa7c=0xc8;}else{_0x33aa7c=0xce;}_0x206fb8[_0xde2e('0x17')](_0x33aa7c);return _0x206fb8['set'](_0xde2e('0x1e'),_0x3469e5+'-'+_0x5d5ad2+'/'+_0x27333d)[_0xde2e('0x19')](_0x507664);}return null;};}function patchUpdates(_0x3157c8){return function(_0x564490){try{jsonpatch[_0xde2e('0x1f')](_0x564490,_0x3157c8,!![]);}catch(_0x5d4b86){return BPromise[_0xde2e('0x20')](_0x5d4b86);}return _0x564490[_0xde2e('0x21')]();};}function saveUpdates(_0x392db8,_0x1c9b98){return function(_0x35b21f){if(_0x35b21f){return _0x35b21f[_0xde2e('0x22')](_0x392db8)[_0xde2e('0x23')](function(_0x21593a){return _0x21593a;});}return null;};}function removeEntity(_0x338d53,_0xdbcb0d){return function(_0x392027){if(_0x392027){return _0x392027[_0xde2e('0x24')]()[_0xde2e('0x23')](function(){_0x338d53['status'](0xcc)[_0xde2e('0x18')]();});}};}function handleEntityNotFound(_0x4f9289,_0x47e7eb){return function(_0x178efc){if(!_0x178efc){_0x4f9289[_0xde2e('0x16')](0x194);}return _0x178efc;};}function handleError(_0x198447,_0x457e1d){_0x457e1d=_0x457e1d||0x1f4;return function(_0x3c320c){logger[_0xde2e('0x25')](_0x3c320c[_0xde2e('0x26')]);if(_0x3c320c[_0xde2e('0x27')]){delete _0x3c320c[_0xde2e('0x27')];}_0x198447[_0xde2e('0x17')](_0x457e1d)[_0xde2e('0x28')](_0x3c320c);};}exports[_0xde2e('0x29')]=function(_0x1de86c,_0x5cce2a){var _0x4c7194={},_0x16f1aa={},_0x51ad30={'count':0x0,'rows':[]};var _0x2b6c17=_[_0xde2e('0x2a')](db['FaxTransferReport']['rawAttributes'],function(_0x36454b){return{'name':_0x36454b[_0xde2e('0x2b')],'type':_0x36454b[_0xde2e('0x2c')]['key']};});_0x16f1aa[_0xde2e('0x2d')]=_[_0xde2e('0x2a')](_0x2b6c17,'name');_0x16f1aa[_0xde2e('0x2e')]=_[_0xde2e('0x2f')](_0x1de86c[_0xde2e('0x2e')]);_0x16f1aa['filters']=_[_0xde2e('0x30')](_0x16f1aa[_0xde2e('0x2d')],_0x16f1aa['query']);_0x4c7194[_0xde2e('0x31')]=_[_0xde2e('0x30')](_0x16f1aa[_0xde2e('0x2d')],qs[_0xde2e('0x32')](_0x1de86c[_0xde2e('0x2e')]['fields']));_0x4c7194[_0xde2e('0x31')]=_0x4c7194['attributes'][_0xde2e('0x33')]?_0x4c7194[_0xde2e('0x31')]:_0x16f1aa['model'];if(!_0x1de86c[_0xde2e('0x2e')][_0xde2e('0x34')](_0xde2e('0x35'))){_0x4c7194[_0xde2e('0x1b')]=qs[_0xde2e('0x1b')](_0x1de86c[_0xde2e('0x2e')]['limit']);_0x4c7194[_0xde2e('0x1c')]=qs[_0xde2e('0x1c')](_0x1de86c[_0xde2e('0x2e')][_0xde2e('0x1c')]);}_0x4c7194['order']=qs['sort'](_0x1de86c[_0xde2e('0x2e')][_0xde2e('0x36')]);_0x4c7194['where']=qs[_0xde2e('0x37')](_['pick'](_0x1de86c[_0xde2e('0x2e')],_0x16f1aa[_0xde2e('0x37')]),_0x2b6c17);if(_0x1de86c['query'][_0xde2e('0x38')]){_0x4c7194[_0xde2e('0x39')]=_[_0xde2e('0x3a')](_0x4c7194['where'],{'$or':_[_0xde2e('0x2a')](_0x2b6c17,function(_0x53a14e){if(_0x53a14e[_0xde2e('0x2c')]!=='VIRTUAL'){var _0x4548ba={};_0x4548ba[_0x53a14e[_0xde2e('0x27')]]={'$like':'%'+_0x1de86c[_0xde2e('0x2e')][_0xde2e('0x38')]+'%'};return _0x4548ba;}})});}_0x4c7194=_[_0xde2e('0x3a')]({},_0x4c7194,_0x1de86c['options']);var _0x342ba0={'where':_0x4c7194[_0xde2e('0x39')]};return db['FaxTransferReport']['count'](_0x342ba0)[_0xde2e('0x23')](function(_0x14fef8){_0x51ad30[_0xde2e('0x1d')]=_0x14fef8;if(_0x1de86c[_0xde2e('0x2e')]['includeAll']){_0x4c7194[_0xde2e('0x3b')]=[{'all':!![]}];}return db['FaxTransferReport'][_0xde2e('0x3c')](_0x4c7194);})[_0xde2e('0x23')](function(_0x2c123c){_0x51ad30[_0xde2e('0x3d')]=_0x2c123c;return _0x51ad30;})[_0xde2e('0x23')](respondWithFilteredResult(_0x5cce2a,_0x4c7194))['catch'](handleError(_0x5cce2a,null));};exports[_0xde2e('0x3e')]=function(_0x328e04,_0x28c6ae){var _0x1934ef={'raw':!![],'where':{'id':_0x328e04['params']['id']}},_0x1c71c1={};_0x1c71c1[_0xde2e('0x2d')]=_[_0xde2e('0x2f')](db['FaxTransferReport']['rawAttributes']);_0x1c71c1['query']=_[_0xde2e('0x2f')](_0x328e04[_0xde2e('0x2e')]);_0x1c71c1[_0xde2e('0x37')]=_['intersection'](_0x1c71c1[_0xde2e('0x2d')],_0x1c71c1[_0xde2e('0x2e')]);_0x1934ef[_0xde2e('0x31')]=_[_0xde2e('0x30')](_0x1c71c1[_0xde2e('0x2d')],qs[_0xde2e('0x32')](_0x328e04[_0xde2e('0x2e')]['fields']));_0x1934ef[_0xde2e('0x31')]=_0x1934ef['attributes'][_0xde2e('0x33')]?_0x1934ef['attributes']:_0x1c71c1[_0xde2e('0x2d')];if(_0x328e04[_0xde2e('0x2e')]['includeAll']){_0x1934ef[_0xde2e('0x3b')]=[{'all':!![]}];}_0x1934ef=_['merge']({},_0x1934ef,_0x328e04[_0xde2e('0x3f')]);return db[_0xde2e('0x40')][_0xde2e('0x41')](_0x1934ef)[_0xde2e('0x23')](handleEntityNotFound(_0x28c6ae,null))[_0xde2e('0x23')](respondWithResult(_0x28c6ae,null))['catch'](handleError(_0x28c6ae,null));};exports[_0xde2e('0x42')]=function(_0x2cb24e,_0x1c40ae){return db[_0xde2e('0x40')]['create'](_0x2cb24e['body'],{})[_0xde2e('0x23')](respondWithResult(_0x1c40ae,0xc9))[_0xde2e('0x43')](handleError(_0x1c40ae,null));};exports[_0xde2e('0x22')]=function(_0x31c475,_0x501272){if(_0x31c475[_0xde2e('0x44')]['id']){delete _0x31c475[_0xde2e('0x44')]['id'];}return db[_0xde2e('0x40')]['find']({'where':{'id':_0x31c475[_0xde2e('0x45')]['id']}})[_0xde2e('0x23')](handleEntityNotFound(_0x501272,null))[_0xde2e('0x23')](saveUpdates(_0x31c475[_0xde2e('0x44')],null))['then'](respondWithResult(_0x501272,null))[_0xde2e('0x43')](handleError(_0x501272,null));};exports['destroy']=function(_0x4d4da7,_0x25207e){return db['FaxTransferReport'][_0xde2e('0x41')]({'where':{'id':_0x4d4da7[_0xde2e('0x45')]['id']}})[_0xde2e('0x23')](handleEntityNotFound(_0x25207e,null))[_0xde2e('0x23')](removeEntity(_0x25207e,null))['catch'](handleError(_0x25207e,null));};exports['describe']=function(_0x4bb3cb,_0x36707c){return db[_0xde2e('0x40')][_0xde2e('0x46')]()[_0xde2e('0x23')](respondWithResult(_0x36707c,null))[_0xde2e('0x43')](handleError(_0x36707c,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 747b58b..5fc2944 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 _0x84b8=['../../config/environment','exports','define','report_fax_transfer','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x84b8,0x19a));var _0x884b=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x84b8[_0x2b5eae];return _0x5f3ac9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x884b('0x0'))(_0x884b('0x1'));var moment=require(_0x884b('0x2'));var BPromise=require(_0x884b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x884b('0x4'));var attributes=require('./faxTransferReport.attributes');module[_0x884b('0x5')]=function(_0x5e3b94,_0x17ea4c){return _0x5e3b94[_0x884b('0x6')]('FaxTransferReport',attributes,{'tableName':_0x884b('0x7'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x884b('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0701=['api','moment','bluebird','request-promise','path','rimraf','exports','define','FaxTransferReport','uniqueid','lodash','util'];(function(_0xe72729,_0x503951){var _0x3f679b=function(_0x58939f){while(--_0x58939f){_0xe72729['push'](_0xe72729['shift']());}};_0x3f679b(++_0x503951);}(_0x0701,0x166));var _0x1070=function(_0x55f8dc,_0x11cef7){_0x55f8dc=_0x55f8dc-0x0;var _0x2daf10=_0x0701[_0x55f8dc];return _0x2daf10;};'use strict';var _=require(_0x1070('0x0'));var util=require(_0x1070('0x1'));var logger=require('../../config/logger')(_0x1070('0x2'));var moment=require(_0x1070('0x3'));var BPromise=require(_0x1070('0x4'));var rp=require(_0x1070('0x5'));var fs=require('fs');var path=require(_0x1070('0x6'));var rimraf=require(_0x1070('0x7'));var config=require('../../config/environment');var attributes=require('./faxTransferReport.attributes');module[_0x1070('0x8')]=function(_0x59c2e2,_0x5c7b9f){return _0x59c2e2[_0x1070('0x9')](_0x1070('0xa'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x1070('0xb'),'fields':[_0x1070('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index f511524..066df8c 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 _0xccdd=['../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','stringify','error','FaxTransferReport,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2b3b3a,_0x3226e0){var _0x4b1b2c=function(_0x53b585){while(--_0x53b585){_0x2b3b3a['push'](_0x2b3b3a['shift']());}};_0x4b1b2c(++_0x3226e0);}(_0xccdd,0xf4));var _0xdccd=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0xccdd[_0x1b4b23];return _0x2a325b;};'use strict';var _=require(_0xdccd('0x0'));var util=require(_0xdccd('0x1'));var moment=require(_0xdccd('0x2'));var BPromise=require(_0xdccd('0x3'));var rs=require(_0xdccd('0x4'));var fs=require('fs');var Redis=require(_0xdccd('0x5'));var db=require(_0xdccd('0x6'))['db'];var utils=require(_0xdccd('0x7'));var logger=require(_0xdccd('0x8'))(_0xdccd('0x9'));var config=require(_0xdccd('0xa'));var jayson=require(_0xdccd('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x55853a,_0x4928c0,_0x141487){return new BPromise(function(_0xcfb033,_0x3cbf8a){return client[_0xdccd('0xc')](_0x55853a,_0x141487)[_0xdccd('0xd')](function(_0x3132f5){logger[_0xdccd('0xe')]('FaxTransferReport,\x20%s,\x20%s',_0x4928c0,_0xdccd('0xf'));logger['debug']('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x4928c0,_0xdccd('0xf'),JSON[_0xdccd('0x10')](_0x3132f5));if(_0x3132f5[_0xdccd('0x11')]){if(_0x3132f5[_0xdccd('0x11')]['code']===0x1f4){logger['error'](_0xdccd('0x12'),_0x4928c0,_0x3132f5[_0xdccd('0x11')][_0xdccd('0x13')]);return _0x3cbf8a(_0x3132f5['error']['message']);}logger[_0xdccd('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0x4928c0,_0x3132f5[_0xdccd('0x11')]['message']);return _0xcfb033(_0x3132f5[_0xdccd('0x11')][_0xdccd('0x13')]);}else{logger[_0xdccd('0xe')](_0xdccd('0x12'),_0x4928c0,_0xdccd('0xf'));_0xcfb033(_0x3132f5['result'][_0xdccd('0x13')]);}})[_0xdccd('0x14')](function(_0x3fb5b4){logger[_0xdccd('0x11')](_0xdccd('0x12'),_0x4928c0,_0x3fb5b4);_0x3cbf8a(_0x3fb5b4);});});} \ No newline at end of file +var _0xa16d=['FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x55d829,_0x43f06c){var _0x52163b=function(_0x493cd8){while(--_0x493cd8){_0x55d829['push'](_0x55d829['shift']());}};_0x52163b(++_0x43f06c);}(_0xa16d,0x14b));var _0xda16=function(_0x163f58,_0x1c8ae4){_0x163f58=_0x163f58-0x0;var _0x472ed9=_0xa16d[_0x163f58];return _0x472ed9;};'use strict';var _=require(_0xda16('0x0'));var util=require(_0xda16('0x1'));var moment=require('moment');var BPromise=require(_0xda16('0x2'));var rs=require(_0xda16('0x3'));var fs=require('fs');var Redis=require(_0xda16('0x4'));var db=require(_0xda16('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xda16('0x6'))(_0xda16('0x7'));var config=require(_0xda16('0x8'));var jayson=require(_0xda16('0x9'));var client=jayson[_0xda16('0xa')][_0xda16('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2c9aec,_0x3dea68,_0x1b7047){return new BPromise(function(_0x3bea32,_0x161370){return client[_0xda16('0xc')](_0x2c9aec,_0x1b7047)[_0xda16('0xd')](function(_0x1b1602){logger['info'](_0xda16('0xe'),_0x3dea68,_0xda16('0xf'));logger[_0xda16('0x10')](_0xda16('0x11'),_0x3dea68,'request\x20sent',JSON['stringify'](_0x1b1602));if(_0x1b1602[_0xda16('0x12')]){if(_0x1b1602[_0xda16('0x12')][_0xda16('0x13')]===0x1f4){logger['error'](_0xda16('0xe'),_0x3dea68,_0x1b1602[_0xda16('0x12')]['message']);return _0x161370(_0x1b1602['error'][_0xda16('0x14')]);}logger[_0xda16('0x12')]('FaxTransferReport,\x20%s,\x20%s',_0x3dea68,_0x1b1602[_0xda16('0x12')][_0xda16('0x14')]);return _0x3bea32(_0x1b1602[_0xda16('0x12')]['message']);}else{logger[_0xda16('0x15')]('FaxTransferReport,\x20%s,\x20%s',_0x3dea68,_0xda16('0xf'));_0x3bea32(_0x1b1602[_0xda16('0x16')][_0xda16('0x14')]);}})['catch'](function(_0x24184c){logger[_0xda16('0x12')](_0xda16('0xe'),_0x3dea68,_0x24184c);_0x161370(_0x24184c);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index c10aee4..d23acfb 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 _0xced8=['update','delete','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','index','/describe','describe','/:id','isAuthenticated','show','post','create'];(function(_0x119271,_0x59a782){var _0xe088b8=function(_0xfe87ba){while(--_0xfe87ba){_0x119271['push'](_0x119271['shift']());}};_0xe088b8(++_0x59a782);}(_0xced8,0x13e));var _0x8ced=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xced8[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x8ced('0x0'));var path=require('path');var timeout=require(_0x8ced('0x1'));var express=require(_0x8ced('0x2'));var router=express[_0x8ced('0x3')]();var fs_extra=require(_0x8ced('0x4'));var auth=require(_0x8ced('0x5'));var interaction=require(_0x8ced('0x6'));var config=require(_0x8ced('0x7'));var controller=require(_0x8ced('0x8'));router[_0x8ced('0x9')]('/',auth['isAuthenticated'](),controller[_0x8ced('0xa')]);router[_0x8ced('0x9')](_0x8ced('0xb'),auth['isAuthenticated'](),controller[_0x8ced('0xc')]);router[_0x8ced('0x9')](_0x8ced('0xd'),auth[_0x8ced('0xe')](),controller[_0x8ced('0xf')]);router[_0x8ced('0x10')]('/',auth[_0x8ced('0xe')](),controller[_0x8ced('0x11')]);router['put'](_0x8ced('0xd'),auth[_0x8ced('0xe')](),controller[_0x8ced('0x12')]);router[_0x8ced('0x13')](_0x8ced('0xd'),auth[_0x8ced('0xe')](),controller[_0x8ced('0x14')]);module['exports']=router; \ No newline at end of file +var _0x94b1=['../../config/environment','./faxTransferReport.controller','get','index','/:id','show','post','isAuthenticated','create','update','delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x57597b,_0x36d862){var _0x30ec4d=function(_0x1bf0f9){while(--_0x1bf0f9){_0x57597b['push'](_0x57597b['shift']());}};_0x30ec4d(++_0x36d862);}(_0x94b1,0x186));var _0x194b=function(_0x4ad203,_0x1fa807){_0x4ad203=_0x4ad203-0x0;var _0x5516b5=_0x94b1[_0x4ad203];return _0x5516b5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x194b('0x0'));var timeout=require(_0x194b('0x1'));var express=require(_0x194b('0x2'));var router=express[_0x194b('0x3')]();var fs_extra=require(_0x194b('0x4'));var auth=require(_0x194b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x194b('0x6'));var controller=require(_0x194b('0x7'));router[_0x194b('0x8')]('/',auth['isAuthenticated'](),controller[_0x194b('0x9')]);router[_0x194b('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x194b('0x8')](_0x194b('0xa'),auth['isAuthenticated'](),controller[_0x194b('0xb')]);router[_0x194b('0xc')]('/',auth[_0x194b('0xd')](),controller[_0x194b('0xe')]);router['put'](_0x194b('0xa'),auth['isAuthenticated'](),controller[_0x194b('0xf')]);router[_0x194b('0x10')]('/:id',auth[_0x194b('0xd')](),controller[_0x194b('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index fdcf6e2..7789603 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 _0xc9f6=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','destroy'];(function(_0x53f463,_0x25e271){var _0x4f4cdd=function(_0x33254c){while(--_0x33254c){_0x53f463['push'](_0x53f463['shift']());}};_0x4f4cdd(++_0x25e271);}(_0xc9f6,0x160));var _0x6c9f=function(_0x2ba271,_0x459df0){_0x2ba271=_0x2ba271-0x0;var _0x21e60d=_0xc9f6[_0x2ba271];return _0x21e60d;};'use strict';var multer=require(_0x6c9f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6c9f('0x1'));var express=require(_0x6c9f('0x2'));var router=express[_0x6c9f('0x3')]();var fs_extra=require(_0x6c9f('0x4'));var auth=require(_0x6c9f('0x5'));var interaction=require(_0x6c9f('0x6'));var config=require(_0x6c9f('0x7'));var controller=require('./intDeskAccount.controller');router[_0x6c9f('0x8')]('/',auth[_0x6c9f('0x9')](),controller[_0x6c9f('0xa')]);router[_0x6c9f('0x8')](_0x6c9f('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x6c9f('0x8')](_0x6c9f('0xc'),auth[_0x6c9f('0x9')](),controller[_0x6c9f('0xd')]);router[_0x6c9f('0x8')](_0x6c9f('0xe'),auth[_0x6c9f('0x9')](),controller[_0x6c9f('0xf')]);router[_0x6c9f('0x10')]('/',auth[_0x6c9f('0x9')](),controller[_0x6c9f('0x11')]);router[_0x6c9f('0x10')](_0x6c9f('0xc'),auth[_0x6c9f('0x9')](),controller[_0x6c9f('0x12')]);router[_0x6c9f('0x13')](_0x6c9f('0xb'),auth['isAuthenticated'](),controller[_0x6c9f('0x14')]);router['delete'](_0x6c9f('0xb'),auth[_0x6c9f('0x9')](),controller[_0x6c9f('0x15')]);module['exports']=router; \ No newline at end of file +var _0x903f=['isAuthenticated','get','/:id/fields','getFields','post','create','/:id/configurations','put','update','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDeskAccount.controller','index','/:id'];(function(_0x1cf9d3,_0x4d4716){var _0x479ebc=function(_0xc4524d){while(--_0xc4524d){_0x1cf9d3['push'](_0x1cf9d3['shift']());}};_0x479ebc(++_0x4d4716);}(_0x903f,0x1c2));var _0xf903=function(_0x5cc533,_0x21101a){_0x5cc533=_0x5cc533-0x0;var _0x2e4fac=_0x903f[_0x5cc533];return _0x2e4fac;};'use strict';var multer=require('multer');var util=require(_0xf903('0x0'));var path=require(_0xf903('0x1'));var timeout=require('connect-timeout');var express=require(_0xf903('0x2'));var router=express[_0xf903('0x3')]();var fs_extra=require(_0xf903('0x4'));var auth=require(_0xf903('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf903('0x6'));var controller=require(_0xf903('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xf903('0x8')]);router['get'](_0xf903('0x9'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/configurations',auth[_0xf903('0xa')](),controller['getConfigurations']);router[_0xf903('0xb')](_0xf903('0xc'),auth['isAuthenticated'](),controller[_0xf903('0xd')]);router[_0xf903('0xe')]('/',auth[_0xf903('0xa')](),controller[_0xf903('0xf')]);router[_0xf903('0xe')](_0xf903('0x10'),auth[_0xf903('0xa')](),controller['addConfiguration']);router[_0xf903('0x11')](_0xf903('0x9'),auth[_0xf903('0xa')](),controller[_0xf903('0x12')]);router['delete'](_0xf903('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0xf903('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index ac32079..5f9c094 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 _0x8aad=['ENUM','basic','integrationTab','newTab','exports','STRING'];(function(_0x58471e,_0x3b2c0e){var _0x34a39b=function(_0x2eda1c){while(--_0x2eda1c){_0x58471e['push'](_0x58471e['shift']());}};_0x34a39b(++_0x3b2c0e);}(_0x8aad,0x118));var _0xd8aa=function(_0x11a9d6,_0x36e986){_0x11a9d6=_0x11a9d6-0x0;var _0x46d663=_0x8aad[_0x11a9d6];return _0x46d663;};'use strict';var Sequelize=require('sequelize');module[_0xd8aa('0x0')]={'name':{'type':Sequelize[_0xd8aa('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xd8aa('0x1')]},'remoteUri':{'type':Sequelize[_0xd8aa('0x1')]},'authType':{'type':Sequelize[_0xd8aa('0x2')](_0xd8aa('0x3')),'defaultValue':_0xd8aa('0x3')},'password':{'type':Sequelize[_0xd8aa('0x1')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xd8aa('0x1')]},'tokenSecret':{'type':Sequelize[_0xd8aa('0x1')]},'serverUrl':{'type':Sequelize[_0xd8aa('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xd8aa('0x2')](_0xd8aa('0x4'),_0xd8aa('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xe107=['STRING','ENUM','integrationTab','newTab','exports'];(function(_0x310832,_0xe72c7e){var _0x103f74=function(_0x4a217c){while(--_0x4a217c){_0x310832['push'](_0x310832['shift']());}};_0x103f74(++_0xe72c7e);}(_0xe107,0x17b));var _0x7e10=function(_0xd5377e,_0x46b1ee){_0xd5377e=_0xd5377e-0x0;var _0x4dd167=_0xe107[_0xd5377e];return _0x4dd167;};'use strict';var Sequelize=require('sequelize');module[_0x7e10('0x0')]={'name':{'type':Sequelize[_0x7e10('0x1')]},'description':{'type':Sequelize[_0x7e10('0x1')]},'username':{'type':Sequelize[_0x7e10('0x1')]},'remoteUri':{'type':Sequelize[_0x7e10('0x1')]},'authType':{'type':Sequelize[_0x7e10('0x2')]('basic'),'defaultValue':'basic'},'password':{'type':Sequelize[_0x7e10('0x1')]},'consumerKey':{'type':Sequelize[_0x7e10('0x1')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0x7e10('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x7e10('0x2')](_0x7e10('0x3'),_0x7e10('0x4')),'defaultValue':_0x7e10('0x3')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index e2e925e..91f4f29 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 _0xfdbd=['body','getConfigurations','findOne','DeskConfiguration','sort','filter','addConfiguration','AccountId','Subjects','getSubjects','channel','DeskField','priority','remoteUri','authType','password','consumerKey','consumerSecret','slice','lastIndexOf','format','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','username','toString','_embedded','entries','active','label','statusCode','getFields','stringify','test','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','error','stack','name','send','index','map','DeskAccount','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','nolimit','order','where','filters','pick','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','length','include','create'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xfdbd,0x1ce));var _0xdfdb=function(_0x4c7935,_0x4a53fb){_0x4c7935=_0x4c7935-0x0;var _0x30651d=_0xfdbd[_0x4c7935];return _0x30651d;};'use strict';var emlformat=require(_0xdfdb('0x0'));var rimraf=require(_0xdfdb('0x1'));var zipdir=require(_0xdfdb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdfdb('0x3'));var moment=require(_0xdfdb('0x4'));var BPromise=require(_0xdfdb('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xdfdb('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdfdb('0x7'));var fs=require('fs');var fs_extra=require(_0xdfdb('0x8'));var _=require(_0xdfdb('0x9'));var squel=require(_0xdfdb('0xa'));var crypto=require('crypto');var jsforce=require(_0xdfdb('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xdfdb('0xc'));var Papa=require(_0xdfdb('0xd'));var Redis=require(_0xdfdb('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xdfdb('0xf'));var hardwareService=require(_0xdfdb('0x10'));var logger=require(_0xdfdb('0x11'))(_0xdfdb('0x12'));var utils=require(_0xdfdb('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xdfdb('0x14'));var db=require(_0xdfdb('0x15'))['db'];var integrations=require(_0xdfdb('0x16'));function respondWithStatusCode(_0x36436a,_0x1cfe48){_0x1cfe48=_0x1cfe48||0xcc;return function(_0x520c1a){if(_0x520c1a){return _0x36436a[_0xdfdb('0x17')](_0x1cfe48);}return _0x36436a[_0xdfdb('0x18')](_0x1cfe48)[_0xdfdb('0x19')]();};}function respondWithResult(_0x3a3fda,_0x13b20f){_0x13b20f=_0x13b20f||0xc8;return function(_0x476c9e){if(_0x476c9e){return _0x3a3fda[_0xdfdb('0x18')](_0x13b20f)[_0xdfdb('0x1a')](_0x476c9e);}};}function respondWithFilteredResult(_0xf7c761,_0x34ac49){return function(_0x17a68e){if(_0x17a68e){var _0x38c404=typeof _0x34ac49[_0xdfdb('0x1b')]===_0xdfdb('0x1c')&&typeof _0x34ac49[_0xdfdb('0x1d')]==='undefined';var _0xa05b28=_0x17a68e[_0xdfdb('0x1e')];var _0x32d395=_0x38c404?0x0:_0x34ac49[_0xdfdb('0x1b')];var _0x5763a4=_0x38c404?_0x17a68e['count']:_0x34ac49[_0xdfdb('0x1b')]+_0x34ac49[_0xdfdb('0x1d')];var _0x346def;if(_0x5763a4>=_0xa05b28){_0x5763a4=_0xa05b28;_0x346def=0xc8;}else{_0x346def=0xce;}_0xf7c761['status'](_0x346def);return _0xf7c761[_0xdfdb('0x1f')](_0xdfdb('0x20'),_0x32d395+'-'+_0x5763a4+'/'+_0xa05b28)['json'](_0x17a68e);}return null;};}function patchUpdates(_0x551505){return function(_0x161c67){try{jsonpatch['apply'](_0x161c67,_0x551505,!![]);}catch(_0x18f43f){return BPromise['reject'](_0x18f43f);}return _0x161c67['save']();};}function saveUpdates(_0x35803b,_0x5448bb){return function(_0x18570c){if(_0x18570c){return _0x18570c[_0xdfdb('0x21')](_0x35803b)['then'](function(_0xa48f0d){return _0xa48f0d;});}return null;};}function removeEntity(_0x566caf,_0x34d207){return function(_0x8fb6a9){if(_0x8fb6a9){return _0x8fb6a9[_0xdfdb('0x22')]()[_0xdfdb('0x23')](function(){_0x566caf[_0xdfdb('0x18')](0xcc)[_0xdfdb('0x19')]();});}};}function handleEntityNotFound(_0x46c110,_0xca1406){return function(_0x3606f7){if(!_0x3606f7){_0x46c110['sendStatus'](0x194);}return _0x3606f7;};}function handleError(_0x5efb75,_0x498c39){_0x498c39=_0x498c39||0x1f4;return function(_0x12b192){logger[_0xdfdb('0x24')](_0x12b192[_0xdfdb('0x25')]);if(_0x12b192['name']){delete _0x12b192[_0xdfdb('0x26')];}_0x5efb75[_0xdfdb('0x18')](_0x498c39)[_0xdfdb('0x27')](_0x12b192);};}exports[_0xdfdb('0x28')]=function(_0x141c7f,_0x543390){var _0xa8eb00={},_0x58ed51={},_0x31288d={'count':0x0,'rows':[]};var _0x20eab8=_[_0xdfdb('0x29')](db[_0xdfdb('0x2a')][_0xdfdb('0x2b')],function(_0x4e7e70){return{'name':_0x4e7e70[_0xdfdb('0x2c')],'type':_0x4e7e70[_0xdfdb('0x2d')]['key']};});_0x58ed51[_0xdfdb('0x2e')]=_[_0xdfdb('0x29')](_0x20eab8,_0xdfdb('0x26'));_0x58ed51[_0xdfdb('0x2f')]=_[_0xdfdb('0x30')](_0x141c7f[_0xdfdb('0x2f')]);_0x58ed51['filters']=_[_0xdfdb('0x31')](_0x58ed51[_0xdfdb('0x2e')],_0x58ed51['query']);_0xa8eb00[_0xdfdb('0x32')]=_[_0xdfdb('0x31')](_0x58ed51[_0xdfdb('0x2e')],qs[_0xdfdb('0x33')](_0x141c7f[_0xdfdb('0x2f')][_0xdfdb('0x33')]));_0xa8eb00[_0xdfdb('0x32')]=_0xa8eb00[_0xdfdb('0x32')]['length']?_0xa8eb00[_0xdfdb('0x32')]:_0x58ed51['model'];if(!_0x141c7f[_0xdfdb('0x2f')]['hasOwnProperty'](_0xdfdb('0x34'))){_0xa8eb00[_0xdfdb('0x1d')]=qs['limit'](_0x141c7f[_0xdfdb('0x2f')][_0xdfdb('0x1d')]);_0xa8eb00['offset']=qs[_0xdfdb('0x1b')](_0x141c7f[_0xdfdb('0x2f')][_0xdfdb('0x1b')]);}_0xa8eb00[_0xdfdb('0x35')]=qs['sort'](_0x141c7f[_0xdfdb('0x2f')]['sort']);_0xa8eb00[_0xdfdb('0x36')]=qs[_0xdfdb('0x37')](_[_0xdfdb('0x38')](_0x141c7f['query'],_0x58ed51['filters']),_0x20eab8);if(_0x141c7f[_0xdfdb('0x2f')]['filter']){_0xa8eb00[_0xdfdb('0x36')]=_[_0xdfdb('0x39')](_0xa8eb00['where'],{'$or':_[_0xdfdb('0x29')](_0x20eab8,function(_0x4226a7){if(_0x4226a7[_0xdfdb('0x2d')]!==_0xdfdb('0x3a')){var _0x446b32={};_0x446b32[_0x4226a7[_0xdfdb('0x26')]]={'$like':'%'+_0x141c7f['query']['filter']+'%'};return _0x446b32;}})});}_0xa8eb00=_[_0xdfdb('0x39')]({},_0xa8eb00,_0x141c7f[_0xdfdb('0x3b')]);var _0x5a1b3c={'where':_0xa8eb00[_0xdfdb('0x36')]};return db[_0xdfdb('0x2a')][_0xdfdb('0x1e')](_0x5a1b3c)['then'](function(_0x6dad4d){_0x31288d[_0xdfdb('0x1e')]=_0x6dad4d;if(_0x141c7f['query'][_0xdfdb('0x3c')]){_0xa8eb00['include']=[{'all':!![]}];}return db[_0xdfdb('0x2a')][_0xdfdb('0x3d')](_0xa8eb00);})[_0xdfdb('0x23')](function(_0x4cc15f){_0x31288d['rows']=_0x4cc15f;return _0x31288d;})['then'](respondWithFilteredResult(_0x543390,_0xa8eb00))[_0xdfdb('0x3e')](handleError(_0x543390,null));};exports[_0xdfdb('0x3f')]=function(_0x4ba380,_0xbc97d6){var _0x52bf16={'raw':![],'where':{'id':_0x4ba380[_0xdfdb('0x40')]['id']}},_0x55d61a={};_0x55d61a[_0xdfdb('0x2e')]=_['keys'](db[_0xdfdb('0x2a')][_0xdfdb('0x2b')]);_0x55d61a[_0xdfdb('0x2f')]=_[_0xdfdb('0x30')](_0x4ba380['query']);_0x55d61a[_0xdfdb('0x37')]=_[_0xdfdb('0x31')](_0x55d61a[_0xdfdb('0x2e')],_0x55d61a['query']);_0x52bf16[_0xdfdb('0x32')]=_[_0xdfdb('0x31')](_0x55d61a[_0xdfdb('0x2e')],qs[_0xdfdb('0x33')](_0x4ba380[_0xdfdb('0x2f')]['fields']));_0x52bf16['attributes']=_0x52bf16[_0xdfdb('0x32')][_0xdfdb('0x41')]?_0x52bf16[_0xdfdb('0x32')]:_0x55d61a[_0xdfdb('0x2e')];if(_0x4ba380[_0xdfdb('0x2f')]['includeAll']){_0x52bf16[_0xdfdb('0x42')]=[{'all':!![]}];}_0x52bf16=_[_0xdfdb('0x39')]({},_0x52bf16,_0x4ba380[_0xdfdb('0x3b')]);return db['DeskAccount']['find'](_0x52bf16)[_0xdfdb('0x23')](handleEntityNotFound(_0xbc97d6,null))[_0xdfdb('0x23')](respondWithResult(_0xbc97d6,null))[_0xdfdb('0x3e')](handleError(_0xbc97d6,null));};exports['create']=function(_0x643010,_0x1f8966){return db[_0xdfdb('0x2a')][_0xdfdb('0x43')](_0x643010[_0xdfdb('0x44')],{})[_0xdfdb('0x23')](respondWithResult(_0x1f8966,0xc9))[_0xdfdb('0x3e')](handleError(_0x1f8966,null));};exports['update']=function(_0x1f08f9,_0x168eaa){if(_0x1f08f9['body']['id']){delete _0x1f08f9[_0xdfdb('0x44')]['id'];}return db[_0xdfdb('0x2a')]['find']({'where':{'id':_0x1f08f9['params']['id']}})[_0xdfdb('0x23')](handleEntityNotFound(_0x168eaa,null))['then'](saveUpdates(_0x1f08f9[_0xdfdb('0x44')],null))[_0xdfdb('0x23')](respondWithResult(_0x168eaa,null))['catch'](handleError(_0x168eaa,null));};exports[_0xdfdb('0x22')]=function(_0xbe7004,_0xd46830){return db[_0xdfdb('0x2a')]['find']({'where':{'id':_0xbe7004[_0xdfdb('0x40')]['id']}})[_0xdfdb('0x23')](handleEntityNotFound(_0xd46830,null))[_0xdfdb('0x23')](removeEntity(_0xd46830,null))[_0xdfdb('0x3e')](handleError(_0xd46830,null));};exports[_0xdfdb('0x45')]=function(_0x187b61,_0x2b0290,_0x1f8114){var _0x3fa504={};var _0x23b974={};var _0x52d3bb;var _0x2641cd;return db[_0xdfdb('0x2a')][_0xdfdb('0x46')]({'where':{'id':_0x187b61[_0xdfdb('0x40')]['id']}})[_0xdfdb('0x23')](handleEntityNotFound(_0x2b0290,null))[_0xdfdb('0x23')](function(_0x4251ed){if(_0x4251ed){_0x52d3bb=_0x4251ed;_0x23b974[_0xdfdb('0x2e')]=_[_0xdfdb('0x30')](db[_0xdfdb('0x47')][_0xdfdb('0x2b')]);_0x23b974[_0xdfdb('0x2f')]=_[_0xdfdb('0x30')](_0x187b61['query']);_0x23b974[_0xdfdb('0x37')]=_[_0xdfdb('0x31')](_0x23b974[_0xdfdb('0x2e')],_0x23b974['query']);_0x3fa504['attributes']=_['intersection'](_0x23b974[_0xdfdb('0x2e')],qs[_0xdfdb('0x33')](_0x187b61[_0xdfdb('0x2f')][_0xdfdb('0x33')]));_0x3fa504[_0xdfdb('0x32')]=_0x3fa504['attributes'][_0xdfdb('0x41')]?_0x3fa504[_0xdfdb('0x32')]:_0x23b974['model'];_0x3fa504['order']=qs['sort'](_0x187b61[_0xdfdb('0x2f')][_0xdfdb('0x48')]);_0x3fa504[_0xdfdb('0x36')]=qs[_0xdfdb('0x37')](_['pick'](_0x187b61[_0xdfdb('0x2f')],_0x23b974[_0xdfdb('0x37')]));if(_0x187b61[_0xdfdb('0x2f')][_0xdfdb('0x49')]){_0x3fa504[_0xdfdb('0x36')]=_[_0xdfdb('0x39')](_0x3fa504[_0xdfdb('0x36')],{'$or':_[_0xdfdb('0x29')](_0x3fa504['attributes'],function(_0x3951e1){var _0x29d2d0={};_0x29d2d0[_0x3951e1]={'$like':'%'+_0x187b61['query']['filter']+'%'};return _0x29d2d0;})});}_0x3fa504=_[_0xdfdb('0x39')]({},_0x3fa504,_0x187b61['options']);return _0x52d3bb[_0xdfdb('0x45')](_0x3fa504);}})[_0xdfdb('0x23')](function(_0x386810){if(_0x386810){_0x2641cd=_0x386810[_0xdfdb('0x41')];if(!_0x187b61[_0xdfdb('0x2f')]['hasOwnProperty'](_0xdfdb('0x34'))){_0x3fa504[_0xdfdb('0x1d')]=qs[_0xdfdb('0x1d')](_0x187b61[_0xdfdb('0x2f')][_0xdfdb('0x1d')]);_0x3fa504['offset']=qs[_0xdfdb('0x1b')](_0x187b61[_0xdfdb('0x2f')][_0xdfdb('0x1b')]);}return _0x52d3bb[_0xdfdb('0x45')](_0x3fa504);}})[_0xdfdb('0x23')](function(_0x3ec6fc){if(_0x3ec6fc){return _0x3ec6fc?{'count':_0x2641cd,'rows':_0x3ec6fc}:null;}})[_0xdfdb('0x23')](respondWithResult(_0x2b0290,null))[_0xdfdb('0x3e')](handleError(_0x2b0290,null));};exports[_0xdfdb('0x4a')]=function(_0x16c712,_0x841ace,_0x5a8707){if(_0x16c712[_0xdfdb('0x44')]['id']){delete _0x16c712[_0xdfdb('0x44')]['id'];}return db[_0xdfdb('0x2a')][_0xdfdb('0x46')]({'where':{'id':_0x16c712['params']['id']}})[_0xdfdb('0x23')](handleEntityNotFound(_0x841ace,null))[_0xdfdb('0x23')](function(_0x170845){if(_0x170845){_0x16c712[_0xdfdb('0x44')][_0xdfdb('0x4b')]=_0x170845['id'];_0x16c712['body'][_0xdfdb('0x4c')]=integrations[_0xdfdb('0x4d')](_0x16c712['body']['channel'],_0x16c712[_0xdfdb('0x44')][_0xdfdb('0x2d')]);_0x16c712[_0xdfdb('0x44')]['Descriptions']=integrations['getDescriptions'](_0x16c712[_0xdfdb('0x44')][_0xdfdb('0x4e')],_0x16c712[_0xdfdb('0x44')]['type']);return db['DeskConfiguration'][_0xdfdb('0x43')](_0x16c712['body'],{'include':[{'model':db[_0xdfdb('0x4f')],'as':_0xdfdb('0x4c')},{'model':db['DeskField'],'as':'Descriptions'}]});}return null;})[_0xdfdb('0x23')](respondWithResult(_0x841ace,null))[_0xdfdb('0x3e')](handleError(_0x841ace,null));};exports['getFields']=function(_0x14b4bb,_0x5d9c12,_0x28fb65){var _0x16d445=[{'name':_0xdfdb('0x50'),'label':'priority','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 _0xebf59a='';return db[_0xdfdb('0x2a')][_0xdfdb('0x46')]({'where':{'id':_0x14b4bb[_0xdfdb('0x40')]['id']},'attributes':['id',_0xdfdb('0x51'),_0xdfdb('0x52'),'username',_0xdfdb('0x53'),_0xdfdb('0x54'),_0xdfdb('0x55'),'token','tokenSecret']})[_0xdfdb('0x23')](handleEntityNotFound(_0x5d9c12,null))['then'](function(_0x33bb0b){if(_0x33bb0b){_0xebf59a=_0x33bb0b['remoteUri'];var _0x1ecbff=_0xebf59a[_0xdfdb('0x56')](-0x1);if(_0x1ecbff==='/'){_0xebf59a=_0xebf59a['substring'](0x0,_0xebf59a[_0xdfdb('0x57')](_0x1ecbff));}var _0x29b7ca={'method':'GET','uri':util[_0xdfdb('0x58')](_0xdfdb('0x59'),_0xebf59a),'headers':{'Content-Type':_0xdfdb('0x5a'),'Accept':'application/json'},'json':!![]};if(_0x33bb0b['authType']===_0xdfdb('0x5b')){_0x29b7ca[_0xdfdb('0x5c')][_0xdfdb('0x5d')]=util[_0xdfdb('0x58')](_0xdfdb('0x5e'),new Buffer(util[_0xdfdb('0x58')](_0xdfdb('0x5f'),_0x33bb0b[_0xdfdb('0x60')],_0x33bb0b[_0xdfdb('0x53')]))[_0xdfdb('0x61')]('base64'));}return rp(_0x29b7ca)[_0xdfdb('0x23')](function(_0x1d63df){return _0x16d445['concat'](_['map'](_0x1d63df[_0xdfdb('0x62')][_0xdfdb('0x63')],function(_0x4d4325){return{'id':_0x4d4325[_0xdfdb('0x26')],'name':_0x4d4325[_0xdfdb('0x26')],'type':_0x4d4325['type'],'active':_0x4d4325[_0xdfdb('0x64')],'label':_0x4d4325[_0xdfdb('0x65')],'custom':!![]};}));});}})['then'](function(_0x49815c){return{'count':_0x49815c[_0xdfdb('0x41')],'rows':_0x49815c};})[_0xdfdb('0x23')](respondWithResult(_0x5d9c12,null))[_0xdfdb('0x3e')](function(_0xc9e895){var _0x304b6c=_0x14b4bb[_0xdfdb('0x2f')]['test']?0x1f4:_0xc9e895[_0xdfdb('0x66')]||0x1f4;logger[_0xdfdb('0x24')]('getFields,\x20%s,\x20%s,\x20%s',_0xdfdb('0x67'),_0x304b6c,JSON[_0xdfdb('0x68')](_0xc9e895));delete _0xc9e895[_0xdfdb('0x26')];if(_0x304b6c===0x191){_0x304b6c=0x190;}_0x5d9c12[_0xdfdb('0x18')](_0x304b6c)[_0xdfdb('0x27')](_0x14b4bb[_0xdfdb('0x2f')][_0xdfdb('0x69')]?{'message':'Wrong\x20credentials','statusCode':_0xc9e895[_0xdfdb('0x66')]}:_0xc9e895);});}; \ No newline at end of file +var _0xe867=['format','%s/custom_fields','basic','headers','Basic\x20%s','%s:%s','toString','base64','concat','_embedded','entries','label','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','test','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','reject','then','destroy','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','DeskAccount','show','params','include','find','catch','create','body','getConfigurations','findOne','AccountId','getSubjects','channel','getDescriptions','DeskConfiguration','Subjects','DeskField','Descriptions','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','slice','lastIndexOf','GET'];(function(_0x454165,_0x1f3e74){var _0x56db53=function(_0x23388c){while(--_0x23388c){_0x454165['push'](_0x454165['shift']());}};_0x56db53(++_0x1f3e74);}(_0xe867,0xef));var _0x7e86=function(_0x34e562,_0x133f9b){_0x34e562=_0x34e562-0x0;var _0x1d586c=_0xe867[_0x34e562];return _0x1d586c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7e86('0x0'));var zipdir=require(_0x7e86('0x1'));var jsonpatch=require(_0x7e86('0x2'));var rp=require(_0x7e86('0x3'));var moment=require(_0x7e86('0x4'));var BPromise=require(_0x7e86('0x5'));var Mustache=require(_0x7e86('0x6'));var util=require('util');var path=require(_0x7e86('0x7'));var sox=require(_0x7e86('0x8'));var csv=require(_0x7e86('0x9'));var ejs=require(_0x7e86('0xa'));var fs=require('fs');var fs_extra=require(_0x7e86('0xb'));var _=require(_0x7e86('0xc'));var squel=require(_0x7e86('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7e86('0xe'));var toCsv=require(_0x7e86('0x9'));var querystring=require(_0x7e86('0xf'));var Papa=require(_0x7e86('0x10'));var Redis=require(_0x7e86('0x11'));var authService=require(_0x7e86('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7e86('0x13'));var logger=require(_0x7e86('0x14'))('api');var utils=require(_0x7e86('0x15'));var config=require(_0x7e86('0x16'));var licenseUtil=require(_0x7e86('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x7e86('0x18'));function respondWithStatusCode(_0x2463e5,_0x5c62c7){_0x5c62c7=_0x5c62c7||0xcc;return function(_0x1af5c6){if(_0x1af5c6){return _0x2463e5[_0x7e86('0x19')](_0x5c62c7);}return _0x2463e5[_0x7e86('0x1a')](_0x5c62c7)[_0x7e86('0x1b')]();};}function respondWithResult(_0x4691c3,_0x3d6e60){_0x3d6e60=_0x3d6e60||0xc8;return function(_0x2f6b10){if(_0x2f6b10){return _0x4691c3['status'](_0x3d6e60)['json'](_0x2f6b10);}};}function respondWithFilteredResult(_0x59fb9a,_0x1ee11f){return function(_0x1e93a0){if(_0x1e93a0){var _0x24b636=typeof _0x1ee11f[_0x7e86('0x1c')]===_0x7e86('0x1d')&&typeof _0x1ee11f['limit']===_0x7e86('0x1d');var _0x40a6a7=_0x1e93a0['count'];var _0x782f8b=_0x24b636?0x0:_0x1ee11f[_0x7e86('0x1c')];var _0x559f4a=_0x24b636?_0x1e93a0[_0x7e86('0x1e')]:_0x1ee11f[_0x7e86('0x1c')]+_0x1ee11f[_0x7e86('0x1f')];var _0x189b63;if(_0x559f4a>=_0x40a6a7){_0x559f4a=_0x40a6a7;_0x189b63=0xc8;}else{_0x189b63=0xce;}_0x59fb9a[_0x7e86('0x1a')](_0x189b63);return _0x59fb9a[_0x7e86('0x20')]('Content-Range',_0x782f8b+'-'+_0x559f4a+'/'+_0x40a6a7)[_0x7e86('0x21')](_0x1e93a0);}return null;};}function patchUpdates(_0x411f87){return function(_0x5ebeed){try{jsonpatch[_0x7e86('0x22')](_0x5ebeed,_0x411f87,!![]);}catch(_0xc0629b){return BPromise[_0x7e86('0x23')](_0xc0629b);}return _0x5ebeed['save']();};}function saveUpdates(_0x216545,_0x2048c9){return function(_0x472cfb){if(_0x472cfb){return _0x472cfb['update'](_0x216545)[_0x7e86('0x24')](function(_0x2135b4){return _0x2135b4;});}return null;};}function removeEntity(_0x385168,_0x5bea7e){return function(_0x36257e){if(_0x36257e){return _0x36257e[_0x7e86('0x25')]()[_0x7e86('0x24')](function(){_0x385168[_0x7e86('0x1a')](0xcc)[_0x7e86('0x1b')]();});}};}function handleEntityNotFound(_0x44788e,_0x10491b){return function(_0x25762b){if(!_0x25762b){_0x44788e[_0x7e86('0x19')](0x194);}return _0x25762b;};}function handleError(_0x4416ee,_0x94ab6d){_0x94ab6d=_0x94ab6d||0x1f4;return function(_0x2ee515){logger['error'](_0x2ee515['stack']);if(_0x2ee515[_0x7e86('0x26')]){delete _0x2ee515['name'];}_0x4416ee['status'](_0x94ab6d)[_0x7e86('0x27')](_0x2ee515);};}exports['index']=function(_0xf84de9,_0x39def6){var _0x409607={},_0x37c59d={},_0x239b07={'count':0x0,'rows':[]};var _0x3378ae=_[_0x7e86('0x28')](db['DeskAccount'][_0x7e86('0x29')],function(_0x722ebe){return{'name':_0x722ebe[_0x7e86('0x2a')],'type':_0x722ebe[_0x7e86('0x2b')]['key']};});_0x37c59d[_0x7e86('0x2c')]=_['map'](_0x3378ae,_0x7e86('0x26'));_0x37c59d[_0x7e86('0x2d')]=_[_0x7e86('0x2e')](_0xf84de9[_0x7e86('0x2d')]);_0x37c59d[_0x7e86('0x2f')]=_[_0x7e86('0x30')](_0x37c59d[_0x7e86('0x2c')],_0x37c59d[_0x7e86('0x2d')]);_0x409607[_0x7e86('0x31')]=_[_0x7e86('0x30')](_0x37c59d[_0x7e86('0x2c')],qs[_0x7e86('0x32')](_0xf84de9[_0x7e86('0x2d')][_0x7e86('0x32')]));_0x409607['attributes']=_0x409607['attributes'][_0x7e86('0x33')]?_0x409607[_0x7e86('0x31')]:_0x37c59d[_0x7e86('0x2c')];if(!_0xf84de9[_0x7e86('0x2d')][_0x7e86('0x34')](_0x7e86('0x35'))){_0x409607[_0x7e86('0x1f')]=qs['limit'](_0xf84de9['query']['limit']);_0x409607[_0x7e86('0x1c')]=qs[_0x7e86('0x1c')](_0xf84de9[_0x7e86('0x2d')]['offset']);}_0x409607['order']=qs['sort'](_0xf84de9[_0x7e86('0x2d')][_0x7e86('0x36')]);_0x409607[_0x7e86('0x37')]=qs[_0x7e86('0x2f')](_[_0x7e86('0x38')](_0xf84de9[_0x7e86('0x2d')],_0x37c59d[_0x7e86('0x2f')]),_0x3378ae);if(_0xf84de9['query'][_0x7e86('0x39')]){_0x409607[_0x7e86('0x37')]=_[_0x7e86('0x3a')](_0x409607[_0x7e86('0x37')],{'$or':_[_0x7e86('0x28')](_0x3378ae,function(_0x329857){if(_0x329857[_0x7e86('0x2b')]!=='VIRTUAL'){var _0x4a475c={};_0x4a475c[_0x329857[_0x7e86('0x26')]]={'$like':'%'+_0xf84de9['query'][_0x7e86('0x39')]+'%'};return _0x4a475c;}})});}_0x409607=_['merge']({},_0x409607,_0xf84de9[_0x7e86('0x3b')]);var _0x5c60b6={'where':_0x409607[_0x7e86('0x37')]};return db['DeskAccount'][_0x7e86('0x1e')](_0x5c60b6)[_0x7e86('0x24')](function(_0x4787f9){_0x239b07[_0x7e86('0x1e')]=_0x4787f9;if(_0xf84de9['query'][_0x7e86('0x3c')]){_0x409607['include']=[{'all':!![]}];}return db[_0x7e86('0x3d')]['findAll'](_0x409607);})[_0x7e86('0x24')](function(_0x259b51){_0x239b07['rows']=_0x259b51;return _0x239b07;})[_0x7e86('0x24')](respondWithFilteredResult(_0x39def6,_0x409607))['catch'](handleError(_0x39def6,null));};exports[_0x7e86('0x3e')]=function(_0x1c9067,_0x5ba938){var _0x530205={'raw':![],'where':{'id':_0x1c9067[_0x7e86('0x3f')]['id']}},_0xf37284={};_0xf37284[_0x7e86('0x2c')]=_['keys'](db[_0x7e86('0x3d')]['rawAttributes']);_0xf37284[_0x7e86('0x2d')]=_['keys'](_0x1c9067[_0x7e86('0x2d')]);_0xf37284[_0x7e86('0x2f')]=_['intersection'](_0xf37284[_0x7e86('0x2c')],_0xf37284[_0x7e86('0x2d')]);_0x530205[_0x7e86('0x31')]=_['intersection'](_0xf37284[_0x7e86('0x2c')],qs[_0x7e86('0x32')](_0x1c9067[_0x7e86('0x2d')]['fields']));_0x530205[_0x7e86('0x31')]=_0x530205[_0x7e86('0x31')][_0x7e86('0x33')]?_0x530205[_0x7e86('0x31')]:_0xf37284['model'];if(_0x1c9067[_0x7e86('0x2d')]['includeAll']){_0x530205[_0x7e86('0x40')]=[{'all':!![]}];}_0x530205=_[_0x7e86('0x3a')]({},_0x530205,_0x1c9067['options']);return db['DeskAccount'][_0x7e86('0x41')](_0x530205)['then'](handleEntityNotFound(_0x5ba938,null))['then'](respondWithResult(_0x5ba938,null))[_0x7e86('0x42')](handleError(_0x5ba938,null));};exports[_0x7e86('0x43')]=function(_0x11b4ac,_0x976e5e){return db[_0x7e86('0x3d')][_0x7e86('0x43')](_0x11b4ac['body'],{})[_0x7e86('0x24')](respondWithResult(_0x976e5e,0xc9))[_0x7e86('0x42')](handleError(_0x976e5e,null));};exports['update']=function(_0x52321c,_0x319dc9){if(_0x52321c[_0x7e86('0x44')]['id']){delete _0x52321c[_0x7e86('0x44')]['id'];}return db[_0x7e86('0x3d')][_0x7e86('0x41')]({'where':{'id':_0x52321c[_0x7e86('0x3f')]['id']}})[_0x7e86('0x24')](handleEntityNotFound(_0x319dc9,null))[_0x7e86('0x24')](saveUpdates(_0x52321c[_0x7e86('0x44')],null))[_0x7e86('0x24')](respondWithResult(_0x319dc9,null))[_0x7e86('0x42')](handleError(_0x319dc9,null));};exports[_0x7e86('0x25')]=function(_0x45546c,_0x3ff8a3){return db['DeskAccount'][_0x7e86('0x41')]({'where':{'id':_0x45546c[_0x7e86('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3ff8a3,null))[_0x7e86('0x24')](removeEntity(_0x3ff8a3,null))[_0x7e86('0x42')](handleError(_0x3ff8a3,null));};exports[_0x7e86('0x45')]=function(_0x3e53f2,_0x23cabf,_0xecdf5a){var _0xa17bd1={};var _0x544080={};var _0x2f87d6;var _0x5cd29f;return db[_0x7e86('0x3d')][_0x7e86('0x46')]({'where':{'id':_0x3e53f2[_0x7e86('0x3f')]['id']}})[_0x7e86('0x24')](handleEntityNotFound(_0x23cabf,null))[_0x7e86('0x24')](function(_0x76ec6e){if(_0x76ec6e){_0x2f87d6=_0x76ec6e;_0x544080[_0x7e86('0x2c')]=_['keys'](db['DeskConfiguration'][_0x7e86('0x29')]);_0x544080['query']=_[_0x7e86('0x2e')](_0x3e53f2['query']);_0x544080[_0x7e86('0x2f')]=_[_0x7e86('0x30')](_0x544080[_0x7e86('0x2c')],_0x544080[_0x7e86('0x2d')]);_0xa17bd1['attributes']=_[_0x7e86('0x30')](_0x544080[_0x7e86('0x2c')],qs['fields'](_0x3e53f2[_0x7e86('0x2d')][_0x7e86('0x32')]));_0xa17bd1[_0x7e86('0x31')]=_0xa17bd1[_0x7e86('0x31')]['length']?_0xa17bd1['attributes']:_0x544080[_0x7e86('0x2c')];_0xa17bd1['order']=qs[_0x7e86('0x36')](_0x3e53f2[_0x7e86('0x2d')][_0x7e86('0x36')]);_0xa17bd1[_0x7e86('0x37')]=qs[_0x7e86('0x2f')](_[_0x7e86('0x38')](_0x3e53f2[_0x7e86('0x2d')],_0x544080[_0x7e86('0x2f')]));if(_0x3e53f2[_0x7e86('0x2d')][_0x7e86('0x39')]){_0xa17bd1[_0x7e86('0x37')]=_[_0x7e86('0x3a')](_0xa17bd1[_0x7e86('0x37')],{'$or':_[_0x7e86('0x28')](_0xa17bd1['attributes'],function(_0x270f64){var _0x5a42ba={};_0x5a42ba[_0x270f64]={'$like':'%'+_0x3e53f2[_0x7e86('0x2d')]['filter']+'%'};return _0x5a42ba;})});}_0xa17bd1=_['merge']({},_0xa17bd1,_0x3e53f2['options']);return _0x2f87d6['getConfigurations'](_0xa17bd1);}})[_0x7e86('0x24')](function(_0x500fe7){if(_0x500fe7){_0x5cd29f=_0x500fe7['length'];if(!_0x3e53f2['query'][_0x7e86('0x34')](_0x7e86('0x35'))){_0xa17bd1[_0x7e86('0x1f')]=qs['limit'](_0x3e53f2['query']['limit']);_0xa17bd1['offset']=qs[_0x7e86('0x1c')](_0x3e53f2['query'][_0x7e86('0x1c')]);}return _0x2f87d6[_0x7e86('0x45')](_0xa17bd1);}})[_0x7e86('0x24')](function(_0x493b82){if(_0x493b82){return _0x493b82?{'count':_0x5cd29f,'rows':_0x493b82}:null;}})['then'](respondWithResult(_0x23cabf,null))[_0x7e86('0x42')](handleError(_0x23cabf,null));};exports['addConfiguration']=function(_0x480b73,_0x2e0e09,_0x2d831b){if(_0x480b73[_0x7e86('0x44')]['id']){delete _0x480b73[_0x7e86('0x44')]['id'];}return db[_0x7e86('0x3d')][_0x7e86('0x46')]({'where':{'id':_0x480b73[_0x7e86('0x3f')]['id']}})[_0x7e86('0x24')](handleEntityNotFound(_0x2e0e09,null))[_0x7e86('0x24')](function(_0x48eab6){if(_0x48eab6){_0x480b73[_0x7e86('0x44')][_0x7e86('0x47')]=_0x48eab6['id'];_0x480b73['body']['Subjects']=integrations[_0x7e86('0x48')](_0x480b73[_0x7e86('0x44')][_0x7e86('0x49')],_0x480b73[_0x7e86('0x44')][_0x7e86('0x2b')]);_0x480b73['body']['Descriptions']=integrations[_0x7e86('0x4a')](_0x480b73['body'][_0x7e86('0x49')],_0x480b73[_0x7e86('0x44')][_0x7e86('0x2b')]);return db[_0x7e86('0x4b')][_0x7e86('0x43')](_0x480b73[_0x7e86('0x44')],{'include':[{'model':db['DeskField'],'as':_0x7e86('0x4c')},{'model':db[_0x7e86('0x4d')],'as':_0x7e86('0x4e')}]});}return null;})[_0x7e86('0x24')](respondWithResult(_0x2e0e09,null))['catch'](handleError(_0x2e0e09,null));};exports['getFields']=function(_0x119838,_0x6005a9,_0x59f476){var _0x21cba6=[{'name':_0x7e86('0x4f'),'label':_0x7e86('0x4f'),'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 _0xac54ec='';return db[_0x7e86('0x3d')]['findOne']({'where':{'id':_0x119838[_0x7e86('0x3f')]['id']},'attributes':['id',_0x7e86('0x50'),_0x7e86('0x51'),_0x7e86('0x52'),_0x7e86('0x53'),_0x7e86('0x54'),_0x7e86('0x55'),_0x7e86('0x56'),_0x7e86('0x57')]})['then'](handleEntityNotFound(_0x6005a9,null))[_0x7e86('0x24')](function(_0xff2905){if(_0xff2905){_0xac54ec=_0xff2905[_0x7e86('0x50')];var _0x269c50=_0xac54ec[_0x7e86('0x58')](-0x1);if(_0x269c50==='/'){_0xac54ec=_0xac54ec['substring'](0x0,_0xac54ec[_0x7e86('0x59')](_0x269c50));}var _0x5459f3={'method':_0x7e86('0x5a'),'uri':util[_0x7e86('0x5b')](_0x7e86('0x5c'),_0xac54ec),'headers':{'Content-Type':'application/json','Accept':'application/json'},'json':!![]};if(_0xff2905['authType']===_0x7e86('0x5d')){_0x5459f3[_0x7e86('0x5e')]['Authorization']=util[_0x7e86('0x5b')](_0x7e86('0x5f'),new Buffer(util[_0x7e86('0x5b')](_0x7e86('0x60'),_0xff2905[_0x7e86('0x52')],_0xff2905[_0x7e86('0x53')]))[_0x7e86('0x61')](_0x7e86('0x62')));}return rp(_0x5459f3)['then'](function(_0x1b55c2){return _0x21cba6[_0x7e86('0x63')](_[_0x7e86('0x28')](_0x1b55c2[_0x7e86('0x64')][_0x7e86('0x65')],function(_0x411b85){return{'id':_0x411b85[_0x7e86('0x26')],'name':_0x411b85[_0x7e86('0x26')],'type':_0x411b85[_0x7e86('0x2b')],'active':_0x411b85['active'],'label':_0x411b85[_0x7e86('0x66')],'custom':!![]};}));});}})['then'](function(_0x2b4220){return{'count':_0x2b4220[_0x7e86('0x33')],'rows':_0x2b4220};})[_0x7e86('0x24')](respondWithResult(_0x6005a9,null))[_0x7e86('0x42')](function(_0x3dc165){var _0x4209e1=_0x119838['query']['test']?0x1f4:_0x3dc165[_0x7e86('0x67')]||0x1f4;logger[_0x7e86('0x68')](_0x7e86('0x69'),_0x7e86('0x6a'),_0x4209e1,JSON[_0x7e86('0x6b')](_0x3dc165));delete _0x3dc165[_0x7e86('0x26')];if(_0x4209e1===0x191){_0x4209e1=0x190;}_0x6005a9[_0x7e86('0x1a')](_0x4209e1)[_0x7e86('0x27')](_0x119838['query'][_0x7e86('0x6c')]?{'message':_0x7e86('0x6d'),'statusCode':_0x3dc165[_0x7e86('0x67')]}:_0x3dc165);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index d60ae3f..e02cc29 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 _0x1b57=['../../config/environment','../../components/integrations/configuration','exports','define','DeskAccount','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x15f3d1,_0x22d77a){var _0x25c2f4=function(_0x2d1592){while(--_0x2d1592){_0x15f3d1['push'](_0x15f3d1['shift']());}};_0x25c2f4(++_0x22d77a);}(_0x1b57,0x181));var _0x71b5=function(_0x196930,_0x371124){_0x196930=_0x196930-0x0;var _0x41c865=_0x1b57[_0x196930];return _0x41c865;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x71b5('0x0'))(_0x71b5('0x1'));var moment=require('moment');var BPromise=require(_0x71b5('0x2'));var rp=require(_0x71b5('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x71b5('0x4'));var config=require(_0x71b5('0x5'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0x71b5('0x6'));module[_0x71b5('0x7')]=function(_0x40d22f,_0x3eb7ff){return _0x40d22f[_0x71b5('0x8')](_0x71b5('0x9'),attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7fb1=['moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','lodash','../../config/logger'];(function(_0x510c60,_0x50247e){var _0x49c4aa=function(_0x3149c7){while(--_0x3149c7){_0x510c60['push'](_0x510c60['shift']());}};_0x49c4aa(++_0x50247e);}(_0x7fb1,0xa7));var _0x17fb=function(_0x2493c3,_0x419613){_0x2493c3=_0x2493c3-0x0;var _0x5bd06a=_0x7fb1[_0x2493c3];return _0x5bd06a;};'use strict';var _=require(_0x17fb('0x0'));var util=require('util');var logger=require(_0x17fb('0x1'))('api');var moment=require(_0x17fb('0x2'));var BPromise=require(_0x17fb('0x3'));var rp=require(_0x17fb('0x4'));var fs=require('fs');var path=require(_0x17fb('0x5'));var rimraf=require(_0x17fb('0x6'));var config=require(_0x17fb('0x7'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0x17fb('0x8'));module[_0x17fb('0x9')]=function(_0x28961c,_0x2e5aed){return _0x28961c[_0x17fb('0xa')](_0x17fb('0xb'),attributes,{'tableName':_0x17fb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index ce0c5a1..cf47c8c 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 _0x271a=['include','map','model','stringify','ShowDeskAccount','DeskAccount','find','util','moment','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','DeskAccount,\x20%s,\x20%s','message','result','catch','GetDeskAccount','findAll','options','raw','where','attributes'];(function(_0x1eeb14,_0x3bdb98){var _0x5b52e9=function(_0x19e0e9){while(--_0x19e0e9){_0x1eeb14['push'](_0x1eeb14['shift']());}};_0x5b52e9(++_0x3bdb98);}(_0x271a,0x151));var _0xa271=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x271a[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xa271('0x0'));var moment=require(_0xa271('0x1'));var BPromise=require('bluebird');var rs=require(_0xa271('0x2'));var fs=require('fs');var Redis=require(_0xa271('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa271('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xa271('0x5'));var jayson=require(_0xa271('0x6'));var client=jayson[_0xa271('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xffbbdf,_0x48628c,_0x150e82){return new BPromise(function(_0x15ee90,_0x4e88b3){return client[_0xa271('0x8')](_0xffbbdf,_0x150e82)[_0xa271('0x9')](function(_0x2fd97c){logger[_0xa271('0xa')]('DeskAccount,\x20%s,\x20%s',_0x48628c,_0xa271('0xb'));logger[_0xa271('0xc')](_0xa271('0xd'),_0x48628c,_0xa271('0xb'),JSON['stringify'](_0x2fd97c));if(_0x2fd97c[_0xa271('0xe')]){if(_0x2fd97c[_0xa271('0xe')][_0xa271('0xf')]===0x1f4){logger['error'](_0xa271('0x10'),_0x48628c,_0x2fd97c[_0xa271('0xe')][_0xa271('0x11')]);return _0x4e88b3(_0x2fd97c[_0xa271('0xe')][_0xa271('0x11')]);}logger[_0xa271('0xe')](_0xa271('0x10'),_0x48628c,_0x2fd97c[_0xa271('0xe')][_0xa271('0x11')]);return _0x15ee90(_0x2fd97c['error']['message']);}else{logger[_0xa271('0xa')](_0xa271('0x10'),_0x48628c,_0xa271('0xb'));_0x15ee90(_0x2fd97c[_0xa271('0x12')][_0xa271('0x11')]);}})[_0xa271('0x13')](function(_0x5aef19){logger[_0xa271('0xe')](_0xa271('0x10'),_0x48628c,_0x5aef19);_0x4e88b3(_0x5aef19);});});}exports[_0xa271('0x14')]=function(_0x3ddc8f){var _0x109fd6=this;return new Promise(function(_0x3620f0,_0x114166){return db['DeskAccount'][_0xa271('0x15')]({'raw':_0x3ddc8f[_0xa271('0x16')]?_0x3ddc8f['options'][_0xa271('0x17')]===undefined?!![]:![]:!![],'where':_0x3ddc8f[_0xa271('0x16')]?_0x3ddc8f['options'][_0xa271('0x18')]||null:null,'attributes':_0x3ddc8f[_0xa271('0x16')]?_0x3ddc8f[_0xa271('0x16')][_0xa271('0x19')]||null:null,'limit':_0x3ddc8f['options']?_0x3ddc8f[_0xa271('0x16')]['limit']||null:null,'include':_0x3ddc8f[_0xa271('0x16')]?_0x3ddc8f[_0xa271('0x16')][_0xa271('0x1a')]?_[_0xa271('0x1b')](_0x3ddc8f['options'][_0xa271('0x1a')],function(_0x3a39c6){return{'model':db[_0x3a39c6['model']],'as':_0x3a39c6['as'],'attributes':_0x3a39c6['attributes'],'include':_0x3a39c6[_0xa271('0x1a')]?_['map'](_0x3a39c6['include'],function(_0xd764b9){return{'model':db[_0xd764b9[_0xa271('0x1c')]],'as':_0xd764b9['as'],'attributes':_0xd764b9[_0xa271('0x19')],'include':_0xd764b9[_0xa271('0x1a')]?_['map'](_0xd764b9['include'],function(_0x4acea6){return{'model':db[_0x4acea6['model']],'as':_0x4acea6['as'],'attributes':_0x4acea6[_0xa271('0x19')]};}):[]};}):[]};}):[]:[]})[_0xa271('0x9')](function(_0x2a7f12){logger[_0xa271('0xa')]('GetDeskAccount',_0x3ddc8f);logger[_0xa271('0xc')]('GetDeskAccount',_0x3ddc8f,JSON[_0xa271('0x1d')](_0x2a7f12));_0x3620f0(_0x2a7f12);})[_0xa271('0x13')](function(_0x27093c){logger[_0xa271('0xe')](_0xa271('0x14'),_0x27093c[_0xa271('0x11')],_0x3ddc8f);_0x114166(_0x109fd6[_0xa271('0xe')](0x1f4,_0x27093c[_0xa271('0x11')]));});});};exports[_0xa271('0x1e')]=function(_0x2db512){var _0x1f4d15=this;return new Promise(function(_0x5d1b18,_0x115ee6){return db[_0xa271('0x1f')][_0xa271('0x20')]({'raw':_0x2db512[_0xa271('0x16')]?_0x2db512[_0xa271('0x16')][_0xa271('0x17')]===undefined?!![]:![]:!![],'where':_0x2db512[_0xa271('0x16')]?_0x2db512[_0xa271('0x16')][_0xa271('0x18')]||null:null,'attributes':_0x2db512['options']?_0x2db512[_0xa271('0x16')][_0xa271('0x19')]||null:null,'include':_0x2db512[_0xa271('0x16')]?_0x2db512[_0xa271('0x16')][_0xa271('0x1a')]?_['map'](_0x2db512[_0xa271('0x16')][_0xa271('0x1a')],function(_0x38e5dd){return{'model':db[_0x38e5dd['model']],'as':_0x38e5dd['as'],'attributes':_0x38e5dd[_0xa271('0x19')],'include':_0x38e5dd[_0xa271('0x1a')]?_[_0xa271('0x1b')](_0x38e5dd[_0xa271('0x1a')],function(_0x4a2030){return{'model':db[_0x4a2030[_0xa271('0x1c')]],'as':_0x4a2030['as'],'attributes':_0x4a2030['attributes'],'include':_0x4a2030['include']?_[_0xa271('0x1b')](_0x4a2030['include'],function(_0x2ca247){return{'model':db[_0x2ca247['model']],'as':_0x2ca247['as'],'attributes':_0x2ca247['attributes']};}):[]};}):[]};}):[]:[]})[_0xa271('0x9')](function(_0xdb870d){logger[_0xa271('0xa')](_0xa271('0x1e'),_0x2db512);logger[_0xa271('0xc')](_0xa271('0x1e'),_0x2db512,JSON[_0xa271('0x1d')](_0xdb870d));_0x5d1b18(_0xdb870d);})['catch'](function(_0x29426a){logger['error'](_0xa271('0x1e'),_0x29426a[_0xa271('0x11')],_0x2db512);_0x115ee6(_0x1f4d15['error'](0x1f4,_0x29426a[_0xa271('0x11')]));});});}; \ No newline at end of file +var _0x728a=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','DeskAccount,\x20%s,\x20%s','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','where','limit','map','model','include','attributes','ShowDeskAccount','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x79cd47,_0x16102d){var _0x3b9484=function(_0x23db95){while(--_0x23db95){_0x79cd47['push'](_0x79cd47['shift']());}};_0x3b9484(++_0x16102d);}(_0x728a,0xd3));var _0xa728=function(_0x33afe9,_0x529051){_0x33afe9=_0x33afe9-0x0;var _0x244e9a=_0x728a[_0x33afe9];return _0x244e9a;};'use strict';var _=require(_0xa728('0x0'));var util=require('util');var moment=require(_0xa728('0x1'));var BPromise=require(_0xa728('0x2'));var rs=require(_0xa728('0x3'));var fs=require('fs');var Redis=require(_0xa728('0x4'));var db=require(_0xa728('0x5'))['db'];var utils=require(_0xa728('0x6'));var logger=require('../../config/logger')(_0xa728('0x7'));var config=require(_0xa728('0x8'));var jayson=require(_0xa728('0x9'));var client=jayson[_0xa728('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd258c1,_0x3e962f,_0x177c4e){return new BPromise(function(_0x4f7ccd,_0x586f50){return client[_0xa728('0xb')](_0xd258c1,_0x177c4e)[_0xa728('0xc')](function(_0x17f2cc){logger[_0xa728('0xd')]('DeskAccount,\x20%s,\x20%s',_0x3e962f,'request\x20sent');logger[_0xa728('0xe')](_0xa728('0xf'),_0x3e962f,_0xa728('0x10'),JSON[_0xa728('0x11')](_0x17f2cc));if(_0x17f2cc[_0xa728('0x12')]){if(_0x17f2cc['error'][_0xa728('0x13')]===0x1f4){logger[_0xa728('0x12')]('DeskAccount,\x20%s,\x20%s',_0x3e962f,_0x17f2cc[_0xa728('0x12')][_0xa728('0x14')]);return _0x586f50(_0x17f2cc['error'][_0xa728('0x14')]);}logger['error']('DeskAccount,\x20%s,\x20%s',_0x3e962f,_0x17f2cc['error'][_0xa728('0x14')]);return _0x4f7ccd(_0x17f2cc[_0xa728('0x12')][_0xa728('0x14')]);}else{logger[_0xa728('0xd')](_0xa728('0x15'),_0x3e962f,_0xa728('0x10'));_0x4f7ccd(_0x17f2cc[_0xa728('0x16')][_0xa728('0x14')]);}})[_0xa728('0x17')](function(_0x15a1de){logger[_0xa728('0x12')](_0xa728('0x15'),_0x3e962f,_0x15a1de);_0x586f50(_0x15a1de);});});}exports[_0xa728('0x18')]=function(_0x47e28b){var _0x10e5c9=this;return new Promise(function(_0x30133,_0x17ebb4){return db[_0xa728('0x19')][_0xa728('0x1a')]({'raw':_0x47e28b[_0xa728('0x1b')]?_0x47e28b[_0xa728('0x1b')][_0xa728('0x1c')]===undefined?!![]:![]:!![],'where':_0x47e28b[_0xa728('0x1b')]?_0x47e28b['options'][_0xa728('0x1d')]||null:null,'attributes':_0x47e28b['options']?_0x47e28b[_0xa728('0x1b')]['attributes']||null:null,'limit':_0x47e28b['options']?_0x47e28b[_0xa728('0x1b')][_0xa728('0x1e')]||null:null,'include':_0x47e28b[_0xa728('0x1b')]?_0x47e28b[_0xa728('0x1b')]['include']?_[_0xa728('0x1f')](_0x47e28b[_0xa728('0x1b')]['include'],function(_0x3bcc08){return{'model':db[_0x3bcc08[_0xa728('0x20')]],'as':_0x3bcc08['as'],'attributes':_0x3bcc08['attributes'],'include':_0x3bcc08[_0xa728('0x21')]?_[_0xa728('0x1f')](_0x3bcc08[_0xa728('0x21')],function(_0x5533af){return{'model':db[_0x5533af['model']],'as':_0x5533af['as'],'attributes':_0x5533af[_0xa728('0x22')],'include':_0x5533af[_0xa728('0x21')]?_[_0xa728('0x1f')](_0x5533af[_0xa728('0x21')],function(_0x1378be){return{'model':db[_0x1378be[_0xa728('0x20')]],'as':_0x1378be['as'],'attributes':_0x1378be['attributes']};}):[]};}):[]};}):[]:[]})[_0xa728('0xc')](function(_0x2fdcb3){logger[_0xa728('0xd')](_0xa728('0x18'),_0x47e28b);logger['debug'](_0xa728('0x18'),_0x47e28b,JSON[_0xa728('0x11')](_0x2fdcb3));_0x30133(_0x2fdcb3);})[_0xa728('0x17')](function(_0x5aacec){logger['error'](_0xa728('0x18'),_0x5aacec[_0xa728('0x14')],_0x47e28b);_0x17ebb4(_0x10e5c9['error'](0x1f4,_0x5aacec['message']));});});};exports[_0xa728('0x23')]=function(_0x5f1e8b){var _0x555677=this;return new Promise(function(_0x190d18,_0x1bc7fa){return db[_0xa728('0x19')]['find']({'raw':_0x5f1e8b['options']?_0x5f1e8b['options']['raw']===undefined?!![]:![]:!![],'where':_0x5f1e8b[_0xa728('0x1b')]?_0x5f1e8b['options']['where']||null:null,'attributes':_0x5f1e8b[_0xa728('0x1b')]?_0x5f1e8b[_0xa728('0x1b')]['attributes']||null:null,'include':_0x5f1e8b[_0xa728('0x1b')]?_0x5f1e8b['options']['include']?_[_0xa728('0x1f')](_0x5f1e8b[_0xa728('0x1b')]['include'],function(_0x576df1){return{'model':db[_0x576df1[_0xa728('0x20')]],'as':_0x576df1['as'],'attributes':_0x576df1[_0xa728('0x22')],'include':_0x576df1[_0xa728('0x21')]?_['map'](_0x576df1[_0xa728('0x21')],function(_0x3d27d0){return{'model':db[_0x3d27d0[_0xa728('0x20')]],'as':_0x3d27d0['as'],'attributes':_0x3d27d0[_0xa728('0x22')],'include':_0x3d27d0[_0xa728('0x21')]?_[_0xa728('0x1f')](_0x3d27d0[_0xa728('0x21')],function(_0x44df85){return{'model':db[_0x44df85[_0xa728('0x20')]],'as':_0x44df85['as'],'attributes':_0x44df85[_0xa728('0x22')]};}):[]};}):[]};}):[]:[]})[_0xa728('0xc')](function(_0x222b3d){logger[_0xa728('0xd')](_0xa728('0x23'),_0x5f1e8b);logger[_0xa728('0xe')](_0xa728('0x23'),_0x5f1e8b,JSON['stringify'](_0x222b3d));_0x190d18(_0x222b3d);})['catch'](function(_0x4428de){logger['error'](_0xa728('0x23'),_0x4428de['message'],_0x5f1e8b);_0x1bc7fa(_0x555677[_0xa728('0x12')](0x1f4,_0x4428de[_0xa728('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 8a7162d..552a795 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['getTags','post','create','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getSubjects','/:id/descriptions','/:id/tags'];(function(_0x490f65,_0x2229e3){var _0x57a7a7=function(_0x2623e0){while(--_0x2623e0){_0x490f65['push'](_0x490f65['shift']());}};_0x57a7a7(++_0x2229e3);}(_0xedd9,0xfc));var _0x9edd=function(_0xed0ed1,_0x187c29){_0xed0ed1=_0xed0ed1-0x0;var _0x5f46d3=_0xedd9[_0xed0ed1];return _0x5f46d3;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['getFields']);router[_0x9edd('0x9')]('/:id/subjects',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['get'](_0x9edd('0x10'),auth[_0x9edd('0xa')](),controller['getDescriptions']);router[_0x9edd('0x9')](_0x9edd('0x11'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')]('/:id/tags',auth[_0x9edd('0xa')](),controller[_0x9edd('0x15')]);router[_0x9edd('0x16')](_0x9edd('0xc'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x17')]);router[_0x9edd('0x18')](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x19')]);module[_0x9edd('0x1a')]=router; \ No newline at end of file +var _0x55ca=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','setTags','put','/:id','update','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service'];(function(_0x487ee4,_0x3d3e66){var _0x3b0877=function(_0x5fba36){while(--_0x5fba36){_0x487ee4['push'](_0x487ee4['shift']());}};_0x3b0877(++_0x3d3e66);}(_0x55ca,0x126));var _0xa55c=function(_0x4c4683,_0x241657){_0x4c4683=_0x4c4683-0x0;var _0x78ee7e=_0x55ca[_0x4c4683];return _0x78ee7e;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['getFields']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getTags']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/tags',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router['delete'](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x15')]);module[_0xa55c('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 81b84ad..0abfd1d 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 _0xd5e2=['STRING','sequelize','exports'];(function(_0x462999,_0x24d200){var _0x4b1366=function(_0x1fa353){while(--_0x1fa353){_0x462999['push'](_0x462999['shift']());}};_0x4b1366(++_0x24d200);}(_0xd5e2,0xf7));var _0x2d5e=function(_0xb49f68,_0x3b2899){_0xb49f68=_0xb49f68-0x0;var _0x503f83=_0xd5e2[_0xb49f68];return _0x503f83;};'use strict';var Sequelize=require(_0x2d5e('0x0'));module[_0x2d5e('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2d5e('0x2')]}}; \ No newline at end of file +var _0x498f=['sequelize','STRING'];(function(_0x19d458,_0x234919){var _0x29b429=function(_0x141e83){while(--_0x141e83){_0x19d458['push'](_0x19d458['shift']());}};_0x29b429(++_0x234919);}(_0x498f,0x17c));var _0xf498=function(_0x593f4b,_0x56be0d){_0x593f4b=_0x593f4b-0x0;var _0xb5efae=_0x498f[_0x593f4b];return _0xb5efae;};'use strict';var Sequelize=require(_0xf498('0x0'));module['exports']={'name':{'type':Sequelize[_0xf498('0x1')]},'description':{'type':Sequelize[_0xf498('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 236e436..5228985 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 _0xc72f=['include','rows','show','params','includeAll','find','catch','create','body','getFields','findOne','DeskField','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','Content-Range','apply','save','update','then','sendStatus','stack','name','send','index','map','DeskConfiguration','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count'];(function(_0xde12d1,_0x2ff219){var _0x74b488=function(_0x73a347){while(--_0x73a347){_0xde12d1['push'](_0xde12d1['shift']());}};_0x74b488(++_0x2ff219);}(_0xc72f,0x1d9));var _0xfc72=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0xc72f[_0x39c734];return _0xb2a2f9;};'use strict';var emlformat=require(_0xfc72('0x0'));var rimraf=require(_0xfc72('0x1'));var zipdir=require(_0xfc72('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfc72('0x3'));var moment=require(_0xfc72('0x4'));var BPromise=require(_0xfc72('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xfc72('0x6'));var sox=require('sox');var csv=require(_0xfc72('0x7'));var ejs=require(_0xfc72('0x8'));var fs=require('fs');var fs_extra=require(_0xfc72('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xfc72('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xfc72('0xb'));var toCsv=require(_0xfc72('0x7'));var querystring=require('querystring');var Papa=require(_0xfc72('0xc'));var Redis=require(_0xfc72('0xd'));var authService=require(_0xfc72('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfc72('0xf'));var logger=require(_0xfc72('0x10'))('api');var utils=require(_0xfc72('0x11'));var config=require(_0xfc72('0x12'));var licenseUtil=require(_0xfc72('0x13'));var db=require(_0xfc72('0x14'))['db'];function respondWithStatusCode(_0x1c0a6f,_0x51ccab){_0x51ccab=_0x51ccab||0xcc;return function(_0x3c49b4){if(_0x3c49b4){return _0x1c0a6f['sendStatus'](_0x51ccab);}return _0x1c0a6f[_0xfc72('0x15')](_0x51ccab)[_0xfc72('0x16')]();};}function respondWithResult(_0x571fc0,_0x118dd4){_0x118dd4=_0x118dd4||0xc8;return function(_0x470ff4){if(_0x470ff4){return _0x571fc0[_0xfc72('0x15')](_0x118dd4)[_0xfc72('0x17')](_0x470ff4);}};}function respondWithFilteredResult(_0x254362,_0x2c379b){return function(_0x40c502){if(_0x40c502){var _0x300167=typeof _0x2c379b['offset']===_0xfc72('0x18')&&typeof _0x2c379b[_0xfc72('0x19')]==='undefined';var _0x7944b=_0x40c502['count'];var _0x23fd73=_0x300167?0x0:_0x2c379b[_0xfc72('0x1a')];var _0x3e397a=_0x300167?_0x40c502['count']:_0x2c379b[_0xfc72('0x1a')]+_0x2c379b[_0xfc72('0x19')];var _0x1662b0;if(_0x3e397a>=_0x7944b){_0x3e397a=_0x7944b;_0x1662b0=0xc8;}else{_0x1662b0=0xce;}_0x254362[_0xfc72('0x15')](_0x1662b0);return _0x254362['set'](_0xfc72('0x1b'),_0x23fd73+'-'+_0x3e397a+'/'+_0x7944b)[_0xfc72('0x17')](_0x40c502);}return null;};}function patchUpdates(_0x5eb67b){return function(_0x37c253){try{jsonpatch[_0xfc72('0x1c')](_0x37c253,_0x5eb67b,!![]);}catch(_0x1cc298){return BPromise['reject'](_0x1cc298);}return _0x37c253[_0xfc72('0x1d')]();};}function saveUpdates(_0x2a5b36,_0x1ad961){return function(_0x2b4a92){if(_0x2b4a92){return _0x2b4a92[_0xfc72('0x1e')](_0x2a5b36)[_0xfc72('0x1f')](function(_0x32b243){return _0x32b243;});}return null;};}function removeEntity(_0x1a58e9,_0x15b8f5){return function(_0x327703){if(_0x327703){return _0x327703['destroy']()[_0xfc72('0x1f')](function(){_0x1a58e9['status'](0xcc)[_0xfc72('0x16')]();});}};}function handleEntityNotFound(_0x19e9ba,_0x42e04d){return function(_0x108c13){if(!_0x108c13){_0x19e9ba[_0xfc72('0x20')](0x194);}return _0x108c13;};}function handleError(_0x3d5b48,_0x44bd7f){_0x44bd7f=_0x44bd7f||0x1f4;return function(_0x39df87){logger['error'](_0x39df87[_0xfc72('0x21')]);if(_0x39df87[_0xfc72('0x22')]){delete _0x39df87['name'];}_0x3d5b48['status'](_0x44bd7f)[_0xfc72('0x23')](_0x39df87);};}exports[_0xfc72('0x24')]=function(_0x40678b,_0x5b8b7e){var _0x2501c9={},_0x30bcee={},_0x39e64e={'count':0x0,'rows':[]};var _0x4b0e13=_[_0xfc72('0x25')](db[_0xfc72('0x26')][_0xfc72('0x27')],function(_0xf175c5){return{'name':_0xf175c5['fieldName'],'type':_0xf175c5[_0xfc72('0x28')]['key']};});_0x30bcee[_0xfc72('0x29')]=_[_0xfc72('0x25')](_0x4b0e13,_0xfc72('0x22'));_0x30bcee[_0xfc72('0x2a')]=_[_0xfc72('0x2b')](_0x40678b['query']);_0x30bcee[_0xfc72('0x2c')]=_[_0xfc72('0x2d')](_0x30bcee[_0xfc72('0x29')],_0x30bcee['query']);_0x2501c9[_0xfc72('0x2e')]=_['intersection'](_0x30bcee[_0xfc72('0x29')],qs['fields'](_0x40678b['query'][_0xfc72('0x2f')]));_0x2501c9[_0xfc72('0x2e')]=_0x2501c9[_0xfc72('0x2e')][_0xfc72('0x30')]?_0x2501c9['attributes']:_0x30bcee[_0xfc72('0x29')];if(!_0x40678b['query'][_0xfc72('0x31')](_0xfc72('0x32'))){_0x2501c9[_0xfc72('0x19')]=qs['limit'](_0x40678b[_0xfc72('0x2a')][_0xfc72('0x19')]);_0x2501c9[_0xfc72('0x1a')]=qs[_0xfc72('0x1a')](_0x40678b[_0xfc72('0x2a')]['offset']);}_0x2501c9[_0xfc72('0x33')]=qs[_0xfc72('0x34')](_0x40678b['query'][_0xfc72('0x34')]);_0x2501c9[_0xfc72('0x35')]=qs[_0xfc72('0x2c')](_[_0xfc72('0x36')](_0x40678b[_0xfc72('0x2a')],_0x30bcee[_0xfc72('0x2c')]),_0x4b0e13);if(_0x40678b[_0xfc72('0x2a')][_0xfc72('0x37')]){_0x2501c9['where']=_[_0xfc72('0x38')](_0x2501c9['where'],{'$or':_[_0xfc72('0x25')](_0x4b0e13,function(_0x2cb5a4){if(_0x2cb5a4['type']!=='VIRTUAL'){var _0x2f9a47={};_0x2f9a47[_0x2cb5a4[_0xfc72('0x22')]]={'$like':'%'+_0x40678b['query'][_0xfc72('0x37')]+'%'};return _0x2f9a47;}})});}_0x2501c9=_[_0xfc72('0x38')]({},_0x2501c9,_0x40678b[_0xfc72('0x39')]);var _0x31fd05={'where':_0x2501c9[_0xfc72('0x35')]};return db['DeskConfiguration']['count'](_0x31fd05)[_0xfc72('0x1f')](function(_0x450cf6){_0x39e64e[_0xfc72('0x3a')]=_0x450cf6;if(_0x40678b['query']['includeAll']){_0x2501c9[_0xfc72('0x3b')]=[{'all':!![]}];}return db[_0xfc72('0x26')]['findAll'](_0x2501c9);})[_0xfc72('0x1f')](function(_0x1b1c1e){_0x39e64e[_0xfc72('0x3c')]=_0x1b1c1e;return _0x39e64e;})[_0xfc72('0x1f')](respondWithFilteredResult(_0x5b8b7e,_0x2501c9))['catch'](handleError(_0x5b8b7e,null));};exports[_0xfc72('0x3d')]=function(_0x222490,_0x17b1dd){var _0x523634={'raw':![],'where':{'id':_0x222490[_0xfc72('0x3e')]['id']}},_0x12d6d5={};_0x12d6d5['model']=_[_0xfc72('0x2b')](db[_0xfc72('0x26')][_0xfc72('0x27')]);_0x12d6d5[_0xfc72('0x2a')]=_['keys'](_0x222490[_0xfc72('0x2a')]);_0x12d6d5['filters']=_[_0xfc72('0x2d')](_0x12d6d5[_0xfc72('0x29')],_0x12d6d5[_0xfc72('0x2a')]);_0x523634[_0xfc72('0x2e')]=_['intersection'](_0x12d6d5['model'],qs['fields'](_0x222490['query'][_0xfc72('0x2f')]));_0x523634[_0xfc72('0x2e')]=_0x523634[_0xfc72('0x2e')][_0xfc72('0x30')]?_0x523634[_0xfc72('0x2e')]:_0x12d6d5['model'];if(_0x222490[_0xfc72('0x2a')][_0xfc72('0x3f')]){_0x523634[_0xfc72('0x3b')]=[{'all':!![]}];}_0x523634=_[_0xfc72('0x38')]({},_0x523634,_0x222490['options']);return db['DeskConfiguration'][_0xfc72('0x40')](_0x523634)['then'](handleEntityNotFound(_0x17b1dd,null))['then'](respondWithResult(_0x17b1dd,null))[_0xfc72('0x41')](handleError(_0x17b1dd,null));};exports[_0xfc72('0x42')]=function(_0x501d3a,_0xb29524){return db[_0xfc72('0x26')]['create'](_0x501d3a[_0xfc72('0x43')],{})[_0xfc72('0x1f')](respondWithResult(_0xb29524,0xc9))[_0xfc72('0x41')](handleError(_0xb29524,null));};exports[_0xfc72('0x1e')]=function(_0x1b0d77,_0x4df341){if(_0x1b0d77[_0xfc72('0x43')]['id']){delete _0x1b0d77[_0xfc72('0x43')]['id'];}return db[_0xfc72('0x26')]['find']({'where':{'id':_0x1b0d77['params']['id']}})[_0xfc72('0x1f')](handleEntityNotFound(_0x4df341,null))[_0xfc72('0x1f')](saveUpdates(_0x1b0d77[_0xfc72('0x43')],null))[_0xfc72('0x1f')](respondWithResult(_0x4df341,null))[_0xfc72('0x41')](handleError(_0x4df341,null));};exports['destroy']=function(_0x2499f2,_0x276f46){return db['DeskConfiguration']['find']({'where':{'id':_0x2499f2[_0xfc72('0x3e')]['id']}})[_0xfc72('0x1f')](handleEntityNotFound(_0x276f46,null))[_0xfc72('0x1f')](removeEntity(_0x276f46,null))[_0xfc72('0x41')](handleError(_0x276f46,null));};exports[_0xfc72('0x44')]=function(_0x4da21e,_0x3c9ba4,_0x1b79b9){var _0x316357={};var _0x4c5821={};var _0x517818;var _0xb159fa;return db['DeskConfiguration'][_0xfc72('0x45')]({'where':{'id':_0x4da21e[_0xfc72('0x3e')]['id']}})[_0xfc72('0x1f')](handleEntityNotFound(_0x3c9ba4,null))[_0xfc72('0x1f')](function(_0x483483){if(_0x483483){_0x517818=_0x483483;_0x4c5821['model']=_['keys'](db[_0xfc72('0x46')][_0xfc72('0x27')]);_0x4c5821[_0xfc72('0x2a')]=_[_0xfc72('0x2b')](_0x4da21e[_0xfc72('0x2a')]);_0x4c5821[_0xfc72('0x2c')]=_[_0xfc72('0x2d')](_0x4c5821[_0xfc72('0x29')],_0x4c5821['query']);_0x316357['attributes']=_[_0xfc72('0x2d')](_0x4c5821[_0xfc72('0x29')],qs[_0xfc72('0x2f')](_0x4da21e['query'][_0xfc72('0x2f')]));_0x316357['attributes']=_0x316357[_0xfc72('0x2e')][_0xfc72('0x30')]?_0x316357[_0xfc72('0x2e')]:_0x4c5821['model'];_0x316357['order']=qs[_0xfc72('0x34')](_0x4da21e[_0xfc72('0x2a')][_0xfc72('0x34')]);_0x316357[_0xfc72('0x35')]=qs[_0xfc72('0x2c')](_[_0xfc72('0x36')](_0x4da21e['query'],_0x4c5821[_0xfc72('0x2c')]));if(_0x4da21e[_0xfc72('0x2a')][_0xfc72('0x37')]){_0x316357[_0xfc72('0x35')]=_['merge'](_0x316357[_0xfc72('0x35')],{'$or':_['map'](_0x316357['attributes'],function(_0x29c0e4){var _0x3fda39={};_0x3fda39[_0x29c0e4]={'$like':'%'+_0x4da21e['query'][_0xfc72('0x37')]+'%'};return _0x3fda39;})});}_0x316357=_[_0xfc72('0x38')]({},_0x316357,_0x4da21e[_0xfc72('0x39')]);return _0x517818[_0xfc72('0x44')](_0x316357);}})['then'](function(_0x3b10f4){if(_0x3b10f4){_0xb159fa=_0x3b10f4[_0xfc72('0x30')];if(!_0x4da21e[_0xfc72('0x2a')]['hasOwnProperty']('nolimit')){_0x316357[_0xfc72('0x19')]=qs['limit'](_0x4da21e[_0xfc72('0x2a')][_0xfc72('0x19')]);_0x316357[_0xfc72('0x1a')]=qs[_0xfc72('0x1a')](_0x4da21e[_0xfc72('0x2a')][_0xfc72('0x1a')]);}return _0x517818[_0xfc72('0x44')](_0x316357);}})[_0xfc72('0x1f')](function(_0x1be916){if(_0x1be916){return _0x1be916?{'count':_0xb159fa,'rows':_0x1be916}:null;}})[_0xfc72('0x1f')](respondWithResult(_0x3c9ba4,null))['catch'](handleError(_0x3c9ba4,null));};exports['getSubjects']=function(_0x56b758,_0x35c42f,_0x223d2e){var _0x280f49={};var _0x875160={};var _0x1e392b;var _0x2fdf70;return db[_0xfc72('0x26')]['findOne']({'where':{'id':_0x56b758[_0xfc72('0x3e')]['id']}})[_0xfc72('0x1f')](handleEntityNotFound(_0x35c42f,null))[_0xfc72('0x1f')](function(_0x49b717){if(_0x49b717){_0x1e392b=_0x49b717;_0x875160[_0xfc72('0x29')]=_[_0xfc72('0x2b')](db['DeskField'][_0xfc72('0x27')]);_0x875160[_0xfc72('0x2a')]=_[_0xfc72('0x2b')](_0x56b758[_0xfc72('0x2a')]);_0x875160[_0xfc72('0x2c')]=_[_0xfc72('0x2d')](_0x875160[_0xfc72('0x29')],_0x875160[_0xfc72('0x2a')]);_0x280f49[_0xfc72('0x2e')]=_['intersection'](_0x875160[_0xfc72('0x29')],qs['fields'](_0x56b758[_0xfc72('0x2a')][_0xfc72('0x2f')]));_0x280f49[_0xfc72('0x2e')]=_0x280f49['attributes']['length']?_0x280f49['attributes']:_0x875160['model'];_0x280f49['order']=qs[_0xfc72('0x34')](_0x56b758[_0xfc72('0x2a')]['sort']);_0x280f49['where']=qs[_0xfc72('0x2c')](_['pick'](_0x56b758[_0xfc72('0x2a')],_0x875160[_0xfc72('0x2c')]));if(_0x56b758[_0xfc72('0x2a')][_0xfc72('0x37')]){_0x280f49[_0xfc72('0x35')]=_[_0xfc72('0x38')](_0x280f49['where'],{'$or':_[_0xfc72('0x25')](_0x280f49['attributes'],function(_0xc0e0ab){var _0x457a79={};_0x457a79[_0xc0e0ab]={'$like':'%'+_0x56b758[_0xfc72('0x2a')][_0xfc72('0x37')]+'%'};return _0x457a79;})});}_0x280f49=_[_0xfc72('0x38')]({},_0x280f49,_0x56b758['options']);return _0x1e392b['getSubjects'](_0x280f49);}})['then'](function(_0x3c1e54){if(_0x3c1e54){_0x2fdf70=_0x3c1e54[_0xfc72('0x30')];if(!_0x56b758[_0xfc72('0x2a')]['hasOwnProperty'](_0xfc72('0x32'))){_0x280f49[_0xfc72('0x19')]=qs[_0xfc72('0x19')](_0x56b758[_0xfc72('0x2a')][_0xfc72('0x19')]);_0x280f49[_0xfc72('0x1a')]=qs[_0xfc72('0x1a')](_0x56b758[_0xfc72('0x2a')]['offset']);}return _0x1e392b[_0xfc72('0x47')](_0x280f49);}})[_0xfc72('0x1f')](function(_0x2f4624){if(_0x2f4624){return _0x2f4624?{'count':_0x2fdf70,'rows':_0x2f4624}:null;}})[_0xfc72('0x1f')](respondWithResult(_0x35c42f,null))[_0xfc72('0x41')](handleError(_0x35c42f,null));};exports['getDescriptions']=function(_0x3dbeaa,_0x5e743b,_0x22b06c){var _0x526bf5={};var _0x88b821={};var _0x36d3b6;var _0x48a8cc;return db[_0xfc72('0x26')][_0xfc72('0x45')]({'where':{'id':_0x3dbeaa[_0xfc72('0x3e')]['id']}})[_0xfc72('0x1f')](handleEntityNotFound(_0x5e743b,null))[_0xfc72('0x1f')](function(_0x568a69){if(_0x568a69){_0x36d3b6=_0x568a69;_0x88b821[_0xfc72('0x29')]=_[_0xfc72('0x2b')](db[_0xfc72('0x46')]['rawAttributes']);_0x88b821['query']=_[_0xfc72('0x2b')](_0x3dbeaa[_0xfc72('0x2a')]);_0x88b821[_0xfc72('0x2c')]=_['intersection'](_0x88b821[_0xfc72('0x29')],_0x88b821[_0xfc72('0x2a')]);_0x526bf5['attributes']=_['intersection'](_0x88b821[_0xfc72('0x29')],qs[_0xfc72('0x2f')](_0x3dbeaa[_0xfc72('0x2a')][_0xfc72('0x2f')]));_0x526bf5[_0xfc72('0x2e')]=_0x526bf5[_0xfc72('0x2e')][_0xfc72('0x30')]?_0x526bf5[_0xfc72('0x2e')]:_0x88b821[_0xfc72('0x29')];_0x526bf5['order']=qs[_0xfc72('0x34')](_0x3dbeaa[_0xfc72('0x2a')][_0xfc72('0x34')]);_0x526bf5['where']=qs[_0xfc72('0x2c')](_['pick'](_0x3dbeaa['query'],_0x88b821[_0xfc72('0x2c')]));if(_0x3dbeaa[_0xfc72('0x2a')][_0xfc72('0x37')]){_0x526bf5[_0xfc72('0x35')]=_[_0xfc72('0x38')](_0x526bf5[_0xfc72('0x35')],{'$or':_[_0xfc72('0x25')](_0x526bf5[_0xfc72('0x2e')],function(_0x39527f){var _0x3208fd={};_0x3208fd[_0x39527f]={'$like':'%'+_0x3dbeaa[_0xfc72('0x2a')]['filter']+'%'};return _0x3208fd;})});}_0x526bf5=_[_0xfc72('0x38')]({},_0x526bf5,_0x3dbeaa[_0xfc72('0x39')]);return _0x36d3b6[_0xfc72('0x48')](_0x526bf5);}})['then'](function(_0xd2cf61){if(_0xd2cf61){_0x48a8cc=_0xd2cf61[_0xfc72('0x30')];if(!_0x3dbeaa[_0xfc72('0x2a')][_0xfc72('0x31')]('nolimit')){_0x526bf5[_0xfc72('0x19')]=qs[_0xfc72('0x19')](_0x3dbeaa[_0xfc72('0x2a')][_0xfc72('0x19')]);_0x526bf5['offset']=qs['offset'](_0x3dbeaa[_0xfc72('0x2a')][_0xfc72('0x1a')]);}return _0x36d3b6[_0xfc72('0x48')](_0x526bf5);}})[_0xfc72('0x1f')](function(_0xee1609){if(_0xee1609){return _0xee1609?{'count':_0x48a8cc,'rows':_0xee1609}:null;}})[_0xfc72('0x1f')](respondWithResult(_0x5e743b,null))[_0xfc72('0x41')](handleError(_0x5e743b,null));};exports[_0xfc72('0x49')]=function(_0x74a6a6,_0x3f2cf6,_0x155f01){var _0x44cd82={};var _0xe7de2b={};var _0x46ee27;var _0x49aa01;return db[_0xfc72('0x26')][_0xfc72('0x45')]({'where':{'id':_0x74a6a6[_0xfc72('0x3e')]['id']}})[_0xfc72('0x1f')](handleEntityNotFound(_0x3f2cf6,null))[_0xfc72('0x1f')](function(_0x39d068){if(_0x39d068){_0x46ee27=_0x39d068;_0xe7de2b['model']=_['keys'](db['Tag'][_0xfc72('0x27')]);_0xe7de2b[_0xfc72('0x2a')]=_[_0xfc72('0x2b')](_0x74a6a6[_0xfc72('0x2a')]);_0xe7de2b[_0xfc72('0x2c')]=_[_0xfc72('0x2d')](_0xe7de2b[_0xfc72('0x29')],_0xe7de2b[_0xfc72('0x2a')]);_0x44cd82[_0xfc72('0x2e')]=_[_0xfc72('0x2d')](_0xe7de2b['model'],qs[_0xfc72('0x2f')](_0x74a6a6[_0xfc72('0x2a')][_0xfc72('0x2f')]));_0x44cd82[_0xfc72('0x2e')]=_0x44cd82[_0xfc72('0x2e')][_0xfc72('0x30')]?_0x44cd82[_0xfc72('0x2e')]:_0xe7de2b[_0xfc72('0x29')];_0x44cd82['order']=qs['sort'](_0x74a6a6[_0xfc72('0x2a')]['sort']);_0x44cd82[_0xfc72('0x35')]=qs[_0xfc72('0x2c')](_[_0xfc72('0x36')](_0x74a6a6[_0xfc72('0x2a')],_0xe7de2b[_0xfc72('0x2c')]));if(_0x74a6a6[_0xfc72('0x2a')][_0xfc72('0x37')]){_0x44cd82[_0xfc72('0x35')]=_['merge'](_0x44cd82['where'],{'$or':_[_0xfc72('0x25')](_0x44cd82[_0xfc72('0x2e')],function(_0x4ce297){var _0x34c17f={};_0x34c17f[_0x4ce297]={'$like':'%'+_0x74a6a6[_0xfc72('0x2a')]['filter']+'%'};return _0x34c17f;})});}_0x44cd82=_[_0xfc72('0x38')]({},_0x44cd82,_0x74a6a6[_0xfc72('0x39')]);return _0x46ee27[_0xfc72('0x49')](_0x44cd82);}})['then'](function(_0x2b641d){if(_0x2b641d){_0x49aa01=_0x2b641d[_0xfc72('0x30')];if(!_0x74a6a6[_0xfc72('0x2a')][_0xfc72('0x31')](_0xfc72('0x32'))){_0x44cd82[_0xfc72('0x19')]=qs[_0xfc72('0x19')](_0x74a6a6[_0xfc72('0x2a')][_0xfc72('0x19')]);_0x44cd82[_0xfc72('0x1a')]=qs['offset'](_0x74a6a6['query'][_0xfc72('0x1a')]);}return _0x46ee27[_0xfc72('0x49')](_0x44cd82);}})[_0xfc72('0x1f')](function(_0x24e6df){if(_0x24e6df){return _0x24e6df?{'count':_0x49aa01,'rows':_0x24e6df}:null;}})[_0xfc72('0x1f')](respondWithResult(_0x3f2cf6,null))[_0xfc72('0x41')](handleError(_0x3f2cf6,null));};exports['setTags']=function(_0x4bbe37,_0x532cb7,_0x46b918){if(_0x4bbe37[_0xfc72('0x43')]['id']){delete _0x4bbe37[_0xfc72('0x43')]['id'];}return db['DeskConfiguration']['findOne']({'where':{'id':_0x4bbe37['params']['id']}})[_0xfc72('0x1f')](handleEntityNotFound(_0x532cb7,null))[_0xfc72('0x1f')](function(_0x4fc25d){if(_0x4fc25d){return _0x4fc25d[_0xfc72('0x4a')](_0x4bbe37[_0xfc72('0x43')][_0xfc72('0x4b')]||[]);}return null;})[_0xfc72('0x1f')](respondWithResult(_0x532cb7,null))[_0xfc72('0x41')](handleError(_0x532cb7,null));}; \ No newline at end of file +var _0x7742=['apply','reject','save','update','then','error','stack','name','send','index','DeskConfiguration','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','where','merge','map','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','include','find','create','body','findOne','getFields','nolimit','getSubjects','DeskField','pick','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7742,0x1e1));var _0x2774=function(_0x153885,_0x462059){_0x153885=_0x153885-0x0;var _0x1d6583=_0x7742[_0x153885];return _0x1d6583;};'use strict';var emlformat=require(_0x2774('0x0'));var rimraf=require(_0x2774('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2774('0x2'));var moment=require(_0x2774('0x3'));var BPromise=require(_0x2774('0x4'));var Mustache=require(_0x2774('0x5'));var util=require(_0x2774('0x6'));var path=require(_0x2774('0x7'));var sox=require(_0x2774('0x8'));var csv=require(_0x2774('0x9'));var ejs=require(_0x2774('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2774('0xb'));var squel=require(_0x2774('0xc'));var crypto=require(_0x2774('0xd'));var jsforce=require(_0x2774('0xe'));var deskjs=require(_0x2774('0xf'));var toCsv=require(_0x2774('0x9'));var querystring=require('querystring');var Papa=require(_0x2774('0x10'));var Redis=require(_0x2774('0x11'));var authService=require(_0x2774('0x12'));var qs=require(_0x2774('0x13'));var as=require(_0x2774('0x14'));var hardwareService=require(_0x2774('0x15'));var logger=require(_0x2774('0x16'))(_0x2774('0x17'));var utils=require(_0x2774('0x18'));var config=require(_0x2774('0x19'));var licenseUtil=require(_0x2774('0x1a'));var db=require(_0x2774('0x1b'))['db'];function respondWithStatusCode(_0x560efa,_0x15143e){_0x15143e=_0x15143e||0xcc;return function(_0x52e639){if(_0x52e639){return _0x560efa[_0x2774('0x1c')](_0x15143e);}return _0x560efa[_0x2774('0x1d')](_0x15143e)[_0x2774('0x1e')]();};}function respondWithResult(_0x2f696d,_0x2df93f){_0x2df93f=_0x2df93f||0xc8;return function(_0x10db22){if(_0x10db22){return _0x2f696d[_0x2774('0x1d')](_0x2df93f)['json'](_0x10db22);}};}function respondWithFilteredResult(_0xa2547f,_0x549cad){return function(_0x518906){if(_0x518906){var _0x2bb534=typeof _0x549cad[_0x2774('0x1f')]===_0x2774('0x20')&&typeof _0x549cad[_0x2774('0x21')]==='undefined';var _0x57c832=_0x518906[_0x2774('0x22')];var _0x3ac181=_0x2bb534?0x0:_0x549cad['offset'];var _0x58c820=_0x2bb534?_0x518906[_0x2774('0x22')]:_0x549cad[_0x2774('0x1f')]+_0x549cad['limit'];var _0x4ec5f8;if(_0x58c820>=_0x57c832){_0x58c820=_0x57c832;_0x4ec5f8=0xc8;}else{_0x4ec5f8=0xce;}_0xa2547f[_0x2774('0x1d')](_0x4ec5f8);return _0xa2547f['set']('Content-Range',_0x3ac181+'-'+_0x58c820+'/'+_0x57c832)['json'](_0x518906);}return null;};}function patchUpdates(_0x462d33){return function(_0x5a3eb1){try{jsonpatch[_0x2774('0x23')](_0x5a3eb1,_0x462d33,!![]);}catch(_0x52aa6f){return BPromise[_0x2774('0x24')](_0x52aa6f);}return _0x5a3eb1[_0x2774('0x25')]();};}function saveUpdates(_0x5b1e2e,_0x483e33){return function(_0x2a4dec){if(_0x2a4dec){return _0x2a4dec[_0x2774('0x26')](_0x5b1e2e)[_0x2774('0x27')](function(_0x2042f2){return _0x2042f2;});}return null;};}function removeEntity(_0xc827be,_0x21ffff){return function(_0x6e648a){if(_0x6e648a){return _0x6e648a['destroy']()[_0x2774('0x27')](function(){_0xc827be[_0x2774('0x1d')](0xcc)[_0x2774('0x1e')]();});}};}function handleEntityNotFound(_0xc55edc,_0xbb32fa){return function(_0x53ef64){if(!_0x53ef64){_0xc55edc[_0x2774('0x1c')](0x194);}return _0x53ef64;};}function handleError(_0x4be79c,_0x343710){_0x343710=_0x343710||0x1f4;return function(_0x381098){logger[_0x2774('0x28')](_0x381098[_0x2774('0x29')]);if(_0x381098[_0x2774('0x2a')]){delete _0x381098[_0x2774('0x2a')];}_0x4be79c[_0x2774('0x1d')](_0x343710)[_0x2774('0x2b')](_0x381098);};}exports[_0x2774('0x2c')]=function(_0x1f5694,_0x16ab79){var _0x2ef223={},_0x123e3c={},_0x364633={'count':0x0,'rows':[]};var _0x562263=_['map'](db[_0x2774('0x2d')]['rawAttributes'],function(_0x1737f6){return{'name':_0x1737f6['fieldName'],'type':_0x1737f6[_0x2774('0x2e')][_0x2774('0x2f')]};});_0x123e3c[_0x2774('0x30')]=_['map'](_0x562263,_0x2774('0x2a'));_0x123e3c[_0x2774('0x31')]=_['keys'](_0x1f5694['query']);_0x123e3c[_0x2774('0x32')]=_[_0x2774('0x33')](_0x123e3c[_0x2774('0x30')],_0x123e3c[_0x2774('0x31')]);_0x2ef223[_0x2774('0x34')]=_[_0x2774('0x33')](_0x123e3c['model'],qs[_0x2774('0x35')](_0x1f5694['query']['fields']));_0x2ef223['attributes']=_0x2ef223['attributes'][_0x2774('0x36')]?_0x2ef223[_0x2774('0x34')]:_0x123e3c[_0x2774('0x30')];if(!_0x1f5694[_0x2774('0x31')][_0x2774('0x37')]('nolimit')){_0x2ef223[_0x2774('0x21')]=qs[_0x2774('0x21')](_0x1f5694[_0x2774('0x31')][_0x2774('0x21')]);_0x2ef223[_0x2774('0x1f')]=qs[_0x2774('0x1f')](_0x1f5694[_0x2774('0x31')][_0x2774('0x1f')]);}_0x2ef223[_0x2774('0x38')]=qs[_0x2774('0x39')](_0x1f5694[_0x2774('0x31')]['sort']);_0x2ef223['where']=qs[_0x2774('0x32')](_['pick'](_0x1f5694['query'],_0x123e3c[_0x2774('0x32')]),_0x562263);if(_0x1f5694['query'][_0x2774('0x3a')]){_0x2ef223[_0x2774('0x3b')]=_[_0x2774('0x3c')](_0x2ef223[_0x2774('0x3b')],{'$or':_[_0x2774('0x3d')](_0x562263,function(_0x49df0d){if(_0x49df0d[_0x2774('0x2e')]!==_0x2774('0x3e')){var _0x50b0de={};_0x50b0de[_0x49df0d[_0x2774('0x2a')]]={'$like':'%'+_0x1f5694[_0x2774('0x31')][_0x2774('0x3a')]+'%'};return _0x50b0de;}})});}_0x2ef223=_['merge']({},_0x2ef223,_0x1f5694[_0x2774('0x3f')]);var _0x2ebb3c={'where':_0x2ef223[_0x2774('0x3b')]};return db['DeskConfiguration']['count'](_0x2ebb3c)['then'](function(_0x305d74){_0x364633[_0x2774('0x22')]=_0x305d74;if(_0x1f5694[_0x2774('0x31')][_0x2774('0x40')]){_0x2ef223['include']=[{'all':!![]}];}return db[_0x2774('0x2d')][_0x2774('0x41')](_0x2ef223);})[_0x2774('0x27')](function(_0x46b718){_0x364633[_0x2774('0x42')]=_0x46b718;return _0x364633;})[_0x2774('0x27')](respondWithFilteredResult(_0x16ab79,_0x2ef223))[_0x2774('0x43')](handleError(_0x16ab79,null));};exports[_0x2774('0x44')]=function(_0x52cc21,_0x1e9d40){var _0x1753d7={'raw':![],'where':{'id':_0x52cc21[_0x2774('0x45')]['id']}},_0x15f0e1={};_0x15f0e1[_0x2774('0x30')]=_[_0x2774('0x46')](db['DeskConfiguration'][_0x2774('0x47')]);_0x15f0e1[_0x2774('0x31')]=_[_0x2774('0x46')](_0x52cc21['query']);_0x15f0e1['filters']=_[_0x2774('0x33')](_0x15f0e1[_0x2774('0x30')],_0x15f0e1[_0x2774('0x31')]);_0x1753d7[_0x2774('0x34')]=_['intersection'](_0x15f0e1['model'],qs['fields'](_0x52cc21[_0x2774('0x31')][_0x2774('0x35')]));_0x1753d7['attributes']=_0x1753d7[_0x2774('0x34')][_0x2774('0x36')]?_0x1753d7[_0x2774('0x34')]:_0x15f0e1[_0x2774('0x30')];if(_0x52cc21[_0x2774('0x31')][_0x2774('0x40')]){_0x1753d7[_0x2774('0x48')]=[{'all':!![]}];}_0x1753d7=_[_0x2774('0x3c')]({},_0x1753d7,_0x52cc21[_0x2774('0x3f')]);return db[_0x2774('0x2d')][_0x2774('0x49')](_0x1753d7)['then'](handleEntityNotFound(_0x1e9d40,null))['then'](respondWithResult(_0x1e9d40,null))[_0x2774('0x43')](handleError(_0x1e9d40,null));};exports['create']=function(_0x5aaa1b,_0x446d87){return db[_0x2774('0x2d')][_0x2774('0x4a')](_0x5aaa1b[_0x2774('0x4b')],{})[_0x2774('0x27')](respondWithResult(_0x446d87,0xc9))[_0x2774('0x43')](handleError(_0x446d87,null));};exports[_0x2774('0x26')]=function(_0x20631d,_0x2e10f6){if(_0x20631d[_0x2774('0x4b')]['id']){delete _0x20631d[_0x2774('0x4b')]['id'];}return db[_0x2774('0x2d')]['find']({'where':{'id':_0x20631d[_0x2774('0x45')]['id']}})[_0x2774('0x27')](handleEntityNotFound(_0x2e10f6,null))[_0x2774('0x27')](saveUpdates(_0x20631d[_0x2774('0x4b')],null))['then'](respondWithResult(_0x2e10f6,null))[_0x2774('0x43')](handleError(_0x2e10f6,null));};exports['destroy']=function(_0x1ae6a7,_0x1d7220){return db[_0x2774('0x2d')][_0x2774('0x49')]({'where':{'id':_0x1ae6a7[_0x2774('0x45')]['id']}})[_0x2774('0x27')](handleEntityNotFound(_0x1d7220,null))['then'](removeEntity(_0x1d7220,null))['catch'](handleError(_0x1d7220,null));};exports['getFields']=function(_0x49c494,_0x451504,_0x5dd332){var _0x395b5f={};var _0x264c78={};var _0x176c79;var _0x488358;return db[_0x2774('0x2d')][_0x2774('0x4c')]({'where':{'id':_0x49c494[_0x2774('0x45')]['id']}})[_0x2774('0x27')](handleEntityNotFound(_0x451504,null))['then'](function(_0x36f921){if(_0x36f921){_0x176c79=_0x36f921;_0x264c78[_0x2774('0x30')]=_[_0x2774('0x46')](db['DeskField']['rawAttributes']);_0x264c78[_0x2774('0x31')]=_[_0x2774('0x46')](_0x49c494[_0x2774('0x31')]);_0x264c78['filters']=_['intersection'](_0x264c78[_0x2774('0x30')],_0x264c78[_0x2774('0x31')]);_0x395b5f['attributes']=_['intersection'](_0x264c78[_0x2774('0x30')],qs[_0x2774('0x35')](_0x49c494['query']['fields']));_0x395b5f[_0x2774('0x34')]=_0x395b5f[_0x2774('0x34')][_0x2774('0x36')]?_0x395b5f['attributes']:_0x264c78['model'];_0x395b5f[_0x2774('0x38')]=qs[_0x2774('0x39')](_0x49c494[_0x2774('0x31')][_0x2774('0x39')]);_0x395b5f[_0x2774('0x3b')]=qs[_0x2774('0x32')](_['pick'](_0x49c494[_0x2774('0x31')],_0x264c78[_0x2774('0x32')]));if(_0x49c494[_0x2774('0x31')][_0x2774('0x3a')]){_0x395b5f[_0x2774('0x3b')]=_[_0x2774('0x3c')](_0x395b5f[_0x2774('0x3b')],{'$or':_[_0x2774('0x3d')](_0x395b5f['attributes'],function(_0x55edeb){var _0x4fd02d={};_0x4fd02d[_0x55edeb]={'$like':'%'+_0x49c494[_0x2774('0x31')]['filter']+'%'};return _0x4fd02d;})});}_0x395b5f=_['merge']({},_0x395b5f,_0x49c494[_0x2774('0x3f')]);return _0x176c79[_0x2774('0x4d')](_0x395b5f);}})[_0x2774('0x27')](function(_0x1c058d){if(_0x1c058d){_0x488358=_0x1c058d[_0x2774('0x36')];if(!_0x49c494[_0x2774('0x31')][_0x2774('0x37')](_0x2774('0x4e'))){_0x395b5f[_0x2774('0x21')]=qs[_0x2774('0x21')](_0x49c494[_0x2774('0x31')][_0x2774('0x21')]);_0x395b5f[_0x2774('0x1f')]=qs[_0x2774('0x1f')](_0x49c494['query'][_0x2774('0x1f')]);}return _0x176c79[_0x2774('0x4d')](_0x395b5f);}})['then'](function(_0x483eff){if(_0x483eff){return _0x483eff?{'count':_0x488358,'rows':_0x483eff}:null;}})[_0x2774('0x27')](respondWithResult(_0x451504,null))[_0x2774('0x43')](handleError(_0x451504,null));};exports[_0x2774('0x4f')]=function(_0x3ee2a0,_0x31918d,_0x128dd7){var _0x466ad9={};var _0x2496c1={};var _0x2a8827;var _0x1cfc21;return db[_0x2774('0x2d')][_0x2774('0x4c')]({'where':{'id':_0x3ee2a0[_0x2774('0x45')]['id']}})['then'](handleEntityNotFound(_0x31918d,null))[_0x2774('0x27')](function(_0x1d622d){if(_0x1d622d){_0x2a8827=_0x1d622d;_0x2496c1[_0x2774('0x30')]=_[_0x2774('0x46')](db[_0x2774('0x50')][_0x2774('0x47')]);_0x2496c1[_0x2774('0x31')]=_[_0x2774('0x46')](_0x3ee2a0['query']);_0x2496c1['filters']=_[_0x2774('0x33')](_0x2496c1[_0x2774('0x30')],_0x2496c1[_0x2774('0x31')]);_0x466ad9[_0x2774('0x34')]=_[_0x2774('0x33')](_0x2496c1['model'],qs[_0x2774('0x35')](_0x3ee2a0[_0x2774('0x31')][_0x2774('0x35')]));_0x466ad9[_0x2774('0x34')]=_0x466ad9[_0x2774('0x34')][_0x2774('0x36')]?_0x466ad9[_0x2774('0x34')]:_0x2496c1[_0x2774('0x30')];_0x466ad9[_0x2774('0x38')]=qs[_0x2774('0x39')](_0x3ee2a0[_0x2774('0x31')][_0x2774('0x39')]);_0x466ad9[_0x2774('0x3b')]=qs[_0x2774('0x32')](_[_0x2774('0x51')](_0x3ee2a0[_0x2774('0x31')],_0x2496c1[_0x2774('0x32')]));if(_0x3ee2a0['query'][_0x2774('0x3a')]){_0x466ad9[_0x2774('0x3b')]=_[_0x2774('0x3c')](_0x466ad9[_0x2774('0x3b')],{'$or':_['map'](_0x466ad9[_0x2774('0x34')],function(_0x383986){var _0x562de9={};_0x562de9[_0x383986]={'$like':'%'+_0x3ee2a0[_0x2774('0x31')][_0x2774('0x3a')]+'%'};return _0x562de9;})});}_0x466ad9=_[_0x2774('0x3c')]({},_0x466ad9,_0x3ee2a0[_0x2774('0x3f')]);return _0x2a8827[_0x2774('0x4f')](_0x466ad9);}})['then'](function(_0x4a3a06){if(_0x4a3a06){_0x1cfc21=_0x4a3a06[_0x2774('0x36')];if(!_0x3ee2a0['query']['hasOwnProperty']('nolimit')){_0x466ad9['limit']=qs['limit'](_0x3ee2a0['query'][_0x2774('0x21')]);_0x466ad9[_0x2774('0x1f')]=qs['offset'](_0x3ee2a0[_0x2774('0x31')][_0x2774('0x1f')]);}return _0x2a8827['getSubjects'](_0x466ad9);}})[_0x2774('0x27')](function(_0x37d249){if(_0x37d249){return _0x37d249?{'count':_0x1cfc21,'rows':_0x37d249}:null;}})[_0x2774('0x27')](respondWithResult(_0x31918d,null))[_0x2774('0x43')](handleError(_0x31918d,null));};exports[_0x2774('0x52')]=function(_0x1bf80b,_0x143c91,_0x53461d){var _0x4c0d71={};var _0x337c4c={};var _0x5cdea3;var _0x20fa4f;return db[_0x2774('0x2d')]['findOne']({'where':{'id':_0x1bf80b[_0x2774('0x45')]['id']}})['then'](handleEntityNotFound(_0x143c91,null))[_0x2774('0x27')](function(_0x30243e){if(_0x30243e){_0x5cdea3=_0x30243e;_0x337c4c[_0x2774('0x30')]=_['keys'](db[_0x2774('0x50')][_0x2774('0x47')]);_0x337c4c['query']=_[_0x2774('0x46')](_0x1bf80b[_0x2774('0x31')]);_0x337c4c[_0x2774('0x32')]=_['intersection'](_0x337c4c[_0x2774('0x30')],_0x337c4c[_0x2774('0x31')]);_0x4c0d71[_0x2774('0x34')]=_[_0x2774('0x33')](_0x337c4c[_0x2774('0x30')],qs['fields'](_0x1bf80b[_0x2774('0x31')][_0x2774('0x35')]));_0x4c0d71[_0x2774('0x34')]=_0x4c0d71[_0x2774('0x34')][_0x2774('0x36')]?_0x4c0d71['attributes']:_0x337c4c['model'];_0x4c0d71[_0x2774('0x38')]=qs[_0x2774('0x39')](_0x1bf80b[_0x2774('0x31')][_0x2774('0x39')]);_0x4c0d71[_0x2774('0x3b')]=qs['filters'](_[_0x2774('0x51')](_0x1bf80b[_0x2774('0x31')],_0x337c4c['filters']));if(_0x1bf80b[_0x2774('0x31')][_0x2774('0x3a')]){_0x4c0d71[_0x2774('0x3b')]=_[_0x2774('0x3c')](_0x4c0d71['where'],{'$or':_[_0x2774('0x3d')](_0x4c0d71['attributes'],function(_0x30e070){var _0x15ec76={};_0x15ec76[_0x30e070]={'$like':'%'+_0x1bf80b[_0x2774('0x31')][_0x2774('0x3a')]+'%'};return _0x15ec76;})});}_0x4c0d71=_[_0x2774('0x3c')]({},_0x4c0d71,_0x1bf80b['options']);return _0x5cdea3[_0x2774('0x52')](_0x4c0d71);}})[_0x2774('0x27')](function(_0xea9bcf){if(_0xea9bcf){_0x20fa4f=_0xea9bcf[_0x2774('0x36')];if(!_0x1bf80b[_0x2774('0x31')]['hasOwnProperty'](_0x2774('0x4e'))){_0x4c0d71['limit']=qs['limit'](_0x1bf80b[_0x2774('0x31')][_0x2774('0x21')]);_0x4c0d71['offset']=qs[_0x2774('0x1f')](_0x1bf80b[_0x2774('0x31')]['offset']);}return _0x5cdea3[_0x2774('0x52')](_0x4c0d71);}})[_0x2774('0x27')](function(_0x1f979f){if(_0x1f979f){return _0x1f979f?{'count':_0x20fa4f,'rows':_0x1f979f}:null;}})['then'](respondWithResult(_0x143c91,null))['catch'](handleError(_0x143c91,null));};exports[_0x2774('0x53')]=function(_0x33ba74,_0x45ad27,_0x57a10c){var _0x181a1b={};var _0x4ebbcf={};var _0x55f0c2;var _0x46fb5a;return db[_0x2774('0x2d')][_0x2774('0x4c')]({'where':{'id':_0x33ba74['params']['id']}})[_0x2774('0x27')](handleEntityNotFound(_0x45ad27,null))['then'](function(_0x1f590b){if(_0x1f590b){_0x55f0c2=_0x1f590b;_0x4ebbcf[_0x2774('0x30')]=_[_0x2774('0x46')](db[_0x2774('0x54')]['rawAttributes']);_0x4ebbcf[_0x2774('0x31')]=_['keys'](_0x33ba74[_0x2774('0x31')]);_0x4ebbcf[_0x2774('0x32')]=_['intersection'](_0x4ebbcf[_0x2774('0x30')],_0x4ebbcf[_0x2774('0x31')]);_0x181a1b[_0x2774('0x34')]=_[_0x2774('0x33')](_0x4ebbcf[_0x2774('0x30')],qs[_0x2774('0x35')](_0x33ba74[_0x2774('0x31')][_0x2774('0x35')]));_0x181a1b['attributes']=_0x181a1b[_0x2774('0x34')][_0x2774('0x36')]?_0x181a1b[_0x2774('0x34')]:_0x4ebbcf[_0x2774('0x30')];_0x181a1b[_0x2774('0x38')]=qs['sort'](_0x33ba74[_0x2774('0x31')][_0x2774('0x39')]);_0x181a1b[_0x2774('0x3b')]=qs[_0x2774('0x32')](_[_0x2774('0x51')](_0x33ba74['query'],_0x4ebbcf[_0x2774('0x32')]));if(_0x33ba74[_0x2774('0x31')][_0x2774('0x3a')]){_0x181a1b[_0x2774('0x3b')]=_['merge'](_0x181a1b[_0x2774('0x3b')],{'$or':_[_0x2774('0x3d')](_0x181a1b[_0x2774('0x34')],function(_0x44e844){var _0x44c744={};_0x44c744[_0x44e844]={'$like':'%'+_0x33ba74['query'][_0x2774('0x3a')]+'%'};return _0x44c744;})});}_0x181a1b=_['merge']({},_0x181a1b,_0x33ba74[_0x2774('0x3f')]);return _0x55f0c2[_0x2774('0x53')](_0x181a1b);}})[_0x2774('0x27')](function(_0x295c63){if(_0x295c63){_0x46fb5a=_0x295c63['length'];if(!_0x33ba74['query'][_0x2774('0x37')](_0x2774('0x4e'))){_0x181a1b['limit']=qs[_0x2774('0x21')](_0x33ba74[_0x2774('0x31')]['limit']);_0x181a1b['offset']=qs[_0x2774('0x1f')](_0x33ba74['query'][_0x2774('0x1f')]);}return _0x55f0c2['getTags'](_0x181a1b);}})[_0x2774('0x27')](function(_0x1b40b6){if(_0x1b40b6){return _0x1b40b6?{'count':_0x46fb5a,'rows':_0x1b40b6}:null;}})[_0x2774('0x27')](respondWithResult(_0x45ad27,null))['catch'](handleError(_0x45ad27,null));};exports[_0x2774('0x55')]=function(_0x1d6311,_0x19d4dd,_0x39a895){if(_0x1d6311[_0x2774('0x4b')]['id']){delete _0x1d6311[_0x2774('0x4b')]['id'];}return db[_0x2774('0x2d')][_0x2774('0x4c')]({'where':{'id':_0x1d6311[_0x2774('0x45')]['id']}})[_0x2774('0x27')](handleEntityNotFound(_0x19d4dd,null))[_0x2774('0x27')](function(_0x61efee){if(_0x61efee){return _0x61efee[_0x2774('0x55')](_0x1d6311[_0x2774('0x4b')]['ids']||[]);}return null;})[_0x2774('0x27')](respondWithResult(_0x19d4dd,null))['catch'](handleError(_0x19d4dd,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 60ba99e..2accb3a 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 _0x3bb2=['path','rimraf','./intDeskConfiguration.attributes','exports','int_desk_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x3bb2,0x1b2));var _0x23bb=function(_0x10b48e,_0x21d547){_0x10b48e=_0x10b48e-0x0;var _0x558bf5=_0x3bb2[_0x10b48e];return _0x558bf5;};'use strict';var _=require(_0x23bb('0x0'));var util=require(_0x23bb('0x1'));var logger=require(_0x23bb('0x2'))('api');var moment=require(_0x23bb('0x3'));var BPromise=require(_0x23bb('0x4'));var rp=require(_0x23bb('0x5'));var fs=require('fs');var path=require(_0x23bb('0x6'));var rimraf=require(_0x23bb('0x7'));var config=require('../../config/environment');var attributes=require(_0x23bb('0x8'));module[_0x23bb('0x9')]=function(_0x1fb2db,_0x2b198e){return _0x1fb2db['define']('DeskConfiguration',attributes,{'tableName':_0x23bb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0326=['int_desk_configurations','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration'];(function(_0x40c0ad,_0x24771c){var _0x354d97=function(_0x1e58bb){while(--_0x1e58bb){_0x40c0ad['push'](_0x40c0ad['shift']());}};_0x354d97(++_0x24771c);}(_0x0326,0x115));var _0x6032=function(_0x58c9fd,_0x34100c){_0x58c9fd=_0x58c9fd-0x0;var _0x4284f9=_0x0326[_0x58c9fd];return _0x4284f9;};'use strict';var _=require(_0x6032('0x0'));var util=require(_0x6032('0x1'));var logger=require(_0x6032('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6032('0x3'));var rp=require(_0x6032('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6032('0x5'));var config=require(_0x6032('0x6'));var attributes=require(_0x6032('0x7'));module[_0x6032('0x8')]=function(_0xefe798,_0xf8769b){return _0xefe798[_0x6032('0x9')](_0x6032('0xa'),attributes,{'tableName':_0x6032('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 2cd7bba..a745f3d 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 _0x39d2=['DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x246e1a,_0x30ee98){var _0x19a13c=function(_0x3c4cd8){while(--_0x3c4cd8){_0x246e1a['push'](_0x246e1a['shift']());}};_0x19a13c(++_0x30ee98);}(_0x39d2,0xf5));var _0x239d=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0x39d2[_0x3ce3c];return _0x55a2c9;};'use strict';var _=require(_0x239d('0x0'));var util=require('util');var moment=require(_0x239d('0x1'));var BPromise=require(_0x239d('0x2'));var rs=require(_0x239d('0x3'));var fs=require('fs');var Redis=require(_0x239d('0x4'));var db=require(_0x239d('0x5'))['db'];var utils=require(_0x239d('0x6'));var logger=require(_0x239d('0x7'))(_0x239d('0x8'));var config=require(_0x239d('0x9'));var jayson=require(_0x239d('0xa'));var client=jayson[_0x239d('0xb')][_0x239d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1f0947,_0x53d457,_0x262efe){return new BPromise(function(_0x2a6811,_0x3f9948){return client[_0x239d('0xd')](_0x1f0947,_0x262efe)[_0x239d('0xe')](function(_0x3d7f32){logger[_0x239d('0xf')](_0x239d('0x10'),_0x53d457,_0x239d('0x11'));logger[_0x239d('0x12')](_0x239d('0x13'),_0x53d457,_0x239d('0x11'),JSON[_0x239d('0x14')](_0x3d7f32));if(_0x3d7f32[_0x239d('0x15')]){if(_0x3d7f32[_0x239d('0x15')]['code']===0x1f4){logger['error'](_0x239d('0x10'),_0x53d457,_0x3d7f32[_0x239d('0x15')][_0x239d('0x16')]);return _0x3f9948(_0x3d7f32[_0x239d('0x15')][_0x239d('0x16')]);}logger[_0x239d('0x15')](_0x239d('0x10'),_0x53d457,_0x3d7f32[_0x239d('0x15')][_0x239d('0x16')]);return _0x2a6811(_0x3d7f32['error'][_0x239d('0x16')]);}else{logger[_0x239d('0xf')](_0x239d('0x10'),_0x53d457,_0x239d('0x11'));_0x2a6811(_0x3d7f32[_0x239d('0x17')]['message']);}})['catch'](function(_0x141582){logger['error'](_0x239d('0x10'),_0x53d457,_0x141582);_0x3f9948(_0x141582);});});} \ No newline at end of file +var _0xb8cb=['info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xb8cb,0xd9));var _0xbb8c=function(_0x30655d,_0x18fe25){_0x30655d=_0x30655d-0x0;var _0x1efa56=_0xb8cb[_0x30655d];return _0x1efa56;};'use strict';var _=require(_0xbb8c('0x0'));var util=require(_0xbb8c('0x1'));var moment=require(_0xbb8c('0x2'));var BPromise=require(_0xbb8c('0x3'));var rs=require(_0xbb8c('0x4'));var fs=require('fs');var Redis=require(_0xbb8c('0x5'));var db=require(_0xbb8c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xbb8c('0x7'))(_0xbb8c('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbb8c('0x9')][_0xbb8c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3eb759,_0x497956,_0x31224b){return new BPromise(function(_0x3eda24,_0x11d365){return client[_0xbb8c('0xb')](_0x3eb759,_0x31224b)[_0xbb8c('0xc')](function(_0x2a9791){logger[_0xbb8c('0xd')](_0xbb8c('0xe'),_0x497956,_0xbb8c('0xf'));logger[_0xbb8c('0x10')](_0xbb8c('0x11'),_0x497956,_0xbb8c('0xf'),JSON['stringify'](_0x2a9791));if(_0x2a9791[_0xbb8c('0x12')]){if(_0x2a9791[_0xbb8c('0x12')][_0xbb8c('0x13')]===0x1f4){logger[_0xbb8c('0x12')](_0xbb8c('0xe'),_0x497956,_0x2a9791['error'][_0xbb8c('0x14')]);return _0x11d365(_0x2a9791[_0xbb8c('0x12')][_0xbb8c('0x14')]);}logger[_0xbb8c('0x12')](_0xbb8c('0xe'),_0x497956,_0x2a9791[_0xbb8c('0x12')][_0xbb8c('0x14')]);return _0x3eda24(_0x2a9791['error'][_0xbb8c('0x14')]);}else{logger[_0xbb8c('0xd')](_0xbb8c('0xe'),_0x497956,_0xbb8c('0xf'));_0x3eda24(_0x2a9791[_0xbb8c('0x15')][_0xbb8c('0x14')]);}})[_0xbb8c('0x16')](function(_0x3988cf){logger[_0xbb8c('0x12')](_0xbb8c('0xe'),_0x497956,_0x3988cf);_0x11d365(_0x3988cf);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 236569b..5241fc7 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 _0x6f3e=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','put','update','delete','destroy','multer','util','path'];(function(_0x3c99ae,_0x2098fe){var _0x4563c9=function(_0x403f65){while(--_0x403f65){_0x3c99ae['push'](_0x3c99ae['shift']());}};_0x4563c9(++_0x2098fe);}(_0x6f3e,0x9f));var _0xe6f3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f3e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xe6f3('0x0'));var util=require(_0xe6f3('0x1'));var path=require(_0xe6f3('0x2'));var timeout=require(_0xe6f3('0x3'));var express=require(_0xe6f3('0x4'));var router=express[_0xe6f3('0x5')]();var fs_extra=require(_0xe6f3('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xe6f3('0x7'));var config=require(_0xe6f3('0x8'));var controller=require('./intDeskField.controller');router[_0xe6f3('0x9')]('/',auth[_0xe6f3('0xa')](),controller[_0xe6f3('0xb')]);router['get'](_0xe6f3('0xc'),auth[_0xe6f3('0xa')](),controller[_0xe6f3('0xd')]);router['post']('/',auth[_0xe6f3('0xa')](),controller['create']);router[_0xe6f3('0xe')](_0xe6f3('0xc'),auth[_0xe6f3('0xa')](),controller[_0xe6f3('0xf')]);router[_0xe6f3('0x10')](_0xe6f3('0xc'),auth['isAuthenticated'](),controller[_0xe6f3('0x11')]);module['exports']=router; \ No newline at end of file +var _0xda28=['../../components/interaction/service','../../config/environment','./intDeskField.controller','get','index','/:id','isAuthenticated','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0xda28,0xfd));var _0x8da2=function(_0x31a331,_0x352ae8){_0x31a331=_0x31a331-0x0;var _0x4f3407=_0xda28[_0x31a331];return _0x4f3407;};'use strict';var multer=require(_0x8da2('0x0'));var util=require(_0x8da2('0x1'));var path=require(_0x8da2('0x2'));var timeout=require(_0x8da2('0x3'));var express=require(_0x8da2('0x4'));var router=express['Router']();var fs_extra=require(_0x8da2('0x5'));var auth=require(_0x8da2('0x6'));var interaction=require(_0x8da2('0x7'));var config=require(_0x8da2('0x8'));var controller=require(_0x8da2('0x9'));router[_0x8da2('0xa')]('/',auth['isAuthenticated'](),controller[_0x8da2('0xb')]);router['get'](_0x8da2('0xc'),auth[_0x8da2('0xd')](),controller['show']);router[_0x8da2('0xe')]('/',auth['isAuthenticated'](),controller[_0x8da2('0xf')]);router[_0x8da2('0x10')](_0x8da2('0xc'),auth[_0x8da2('0xd')](),controller['update']);router[_0x8da2('0x11')]('/:id',auth[_0x8da2('0xd')](),controller[_0x8da2('0x12')]);module[_0x8da2('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index addb659..01a503f 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 _0x5c68=['keyValue','picklist','STRING','BOOLEAN','sequelize','ENUM','string','variable','customVariable'];(function(_0x158e3b,_0x4534b){var _0x551a1d=function(_0x629c21){while(--_0x629c21){_0x158e3b['push'](_0x158e3b['shift']());}};_0x551a1d(++_0x4534b);}(_0x5c68,0x79));var _0x85c6=function(_0x2a18ab,_0xae4224){_0x2a18ab=_0x2a18ab-0x0;var _0x5d7db8=_0x5c68[_0x2a18ab];return _0x5d7db8;};'use strict';var Sequelize=require(_0x85c6('0x0'));module['exports']={'type':{'type':Sequelize[_0x85c6('0x1')](_0x85c6('0x2'),_0x85c6('0x3'),_0x85c6('0x4'),_0x85c6('0x5'),_0x85c6('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x85c6('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x85c6('0x1')](_0x85c6('0x2'),_0x85c6('0x3'),_0x85c6('0x4'))},'keyContent':{'type':Sequelize[_0x85c6('0x7')]},'idField':{'type':Sequelize[_0x85c6('0x7')]},'nameField':{'type':Sequelize[_0x85c6('0x7')]},'customField':{'type':Sequelize[_0x85c6('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x85c6('0x7')]}}; \ No newline at end of file +var _0xefa7=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x264970,_0x6fa19){var _0x55a8bf=function(_0x3c4244){while(--_0x3c4244){_0x264970['push'](_0x264970['shift']());}};_0x55a8bf(++_0x6fa19);}(_0xefa7,0x169));var _0x7efa=function(_0x5c1ace,_0x585e77){_0x5c1ace=_0x5c1ace-0x0;var _0x5d9a0a=_0xefa7[_0x5c1ace];return _0x5d9a0a;};'use strict';var Sequelize=require(_0x7efa('0x0'));module[_0x7efa('0x1')]={'type':{'type':Sequelize[_0x7efa('0x2')](_0x7efa('0x3'),_0x7efa('0x4'),_0x7efa('0x5'),_0x7efa('0x6'),_0x7efa('0x7')),'defaultValue':_0x7efa('0x3')},'content':{'type':Sequelize[_0x7efa('0x8')]},'key':{'type':Sequelize[_0x7efa('0x8')]},'keyType':{'type':Sequelize[_0x7efa('0x2')](_0x7efa('0x3'),'variable',_0x7efa('0x5'))},'keyContent':{'type':Sequelize[_0x7efa('0x8')]},'idField':{'type':Sequelize[_0x7efa('0x8')]},'nameField':{'type':Sequelize[_0x7efa('0x8')]},'customField':{'type':Sequelize[_0x7efa('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7efa('0x8')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 7898cc2..c5fdfc8 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 _0x1ad9=['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','end','status','offset','undefined','count','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','stack','send','index','map','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','sort','pick','filter','where','VIRTUAL','merge','options','DeskField','includeAll','include','findAll','rows','catch','keys','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto'];(function(_0x57d5c2,_0x44668c){var _0x1f1729=function(_0x333c10){while(--_0x333c10){_0x57d5c2['push'](_0x57d5c2['shift']());}};_0x1f1729(++_0x44668c);}(_0x1ad9,0xdb));var _0x91ad=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0x1ad9[_0x3c2a69];return _0x596bc8;};'use strict';var emlformat=require(_0x91ad('0x0'));var rimraf=require(_0x91ad('0x1'));var zipdir=require(_0x91ad('0x2'));var jsonpatch=require(_0x91ad('0x3'));var rp=require(_0x91ad('0x4'));var moment=require(_0x91ad('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x91ad('0x6'));var util=require(_0x91ad('0x7'));var path=require(_0x91ad('0x8'));var sox=require(_0x91ad('0x9'));var csv=require(_0x91ad('0xa'));var ejs=require(_0x91ad('0xb'));var fs=require('fs');var fs_extra=require(_0x91ad('0xc'));var _=require(_0x91ad('0xd'));var squel=require('squel');var crypto=require(_0x91ad('0xe'));var jsforce=require(_0x91ad('0xf'));var deskjs=require(_0x91ad('0x10'));var toCsv=require(_0x91ad('0xa'));var querystring=require(_0x91ad('0x11'));var Papa=require(_0x91ad('0x12'));var Redis=require(_0x91ad('0x13'));var authService=require(_0x91ad('0x14'));var qs=require(_0x91ad('0x15'));var as=require(_0x91ad('0x16'));var hardwareService=require(_0x91ad('0x17'));var logger=require('../../config/logger')(_0x91ad('0x18'));var utils=require(_0x91ad('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x91ad('0x1a'));var db=require(_0x91ad('0x1b'))['db'];function respondWithStatusCode(_0x5d6da1,_0x344b11){_0x344b11=_0x344b11||0xcc;return function(_0xd5d7c1){if(_0xd5d7c1){return _0x5d6da1['sendStatus'](_0x344b11);}return _0x5d6da1['status'](_0x344b11)[_0x91ad('0x1c')]();};}function respondWithResult(_0x42ffc8,_0xe52b0c){_0xe52b0c=_0xe52b0c||0xc8;return function(_0x305a11){if(_0x305a11){return _0x42ffc8[_0x91ad('0x1d')](_0xe52b0c)['json'](_0x305a11);}};}function respondWithFilteredResult(_0x34f580,_0x334874){return function(_0x495185){if(_0x495185){var _0x48cbfa=typeof _0x334874[_0x91ad('0x1e')]===_0x91ad('0x1f')&&typeof _0x334874['limit']===_0x91ad('0x1f');var _0x13cc19=_0x495185[_0x91ad('0x20')];var _0x171559=_0x48cbfa?0x0:_0x334874[_0x91ad('0x1e')];var _0x1c6b4c=_0x48cbfa?_0x495185[_0x91ad('0x20')]:_0x334874[_0x91ad('0x1e')]+_0x334874['limit'];var _0x269501;if(_0x1c6b4c>=_0x13cc19){_0x1c6b4c=_0x13cc19;_0x269501=0xc8;}else{_0x269501=0xce;}_0x34f580[_0x91ad('0x1d')](_0x269501);return _0x34f580['set'](_0x91ad('0x21'),_0x171559+'-'+_0x1c6b4c+'/'+_0x13cc19)[_0x91ad('0x22')](_0x495185);}return null;};}function patchUpdates(_0x3c1e3f){return function(_0x1631d3){try{jsonpatch[_0x91ad('0x23')](_0x1631d3,_0x3c1e3f,!![]);}catch(_0x48cb71){return BPromise[_0x91ad('0x24')](_0x48cb71);}return _0x1631d3[_0x91ad('0x25')]();};}function saveUpdates(_0x41ef9b,_0x431c88){return function(_0x1779e4){if(_0x1779e4){return _0x1779e4[_0x91ad('0x26')](_0x41ef9b)[_0x91ad('0x27')](function(_0x293b00){return _0x293b00;});}return null;};}function removeEntity(_0x241109,_0x2b53e7){return function(_0x3e966f){if(_0x3e966f){return _0x3e966f[_0x91ad('0x28')]()[_0x91ad('0x27')](function(){_0x241109[_0x91ad('0x1d')](0xcc)[_0x91ad('0x1c')]();});}};}function handleEntityNotFound(_0x1d4617,_0x384fc2){return function(_0x1d1123){if(!_0x1d1123){_0x1d4617[_0x91ad('0x29')](0x194);}return _0x1d1123;};}function handleError(_0x21ac35,_0x54d425){_0x54d425=_0x54d425||0x1f4;return function(_0x119931){logger['error'](_0x119931[_0x91ad('0x2a')]);if(_0x119931['name']){delete _0x119931['name'];}_0x21ac35[_0x91ad('0x1d')](_0x54d425)[_0x91ad('0x2b')](_0x119931);};}exports[_0x91ad('0x2c')]=function(_0x229f8f,_0x2f664f){var _0x2b2565={},_0x1393e2={},_0x687737={'count':0x0,'rows':[]};var _0x496649=_[_0x91ad('0x2d')](db['DeskField'][_0x91ad('0x2e')],function(_0x50c2fb){return{'name':_0x50c2fb[_0x91ad('0x2f')],'type':_0x50c2fb[_0x91ad('0x30')][_0x91ad('0x31')]};});_0x1393e2[_0x91ad('0x32')]=_[_0x91ad('0x2d')](_0x496649,_0x91ad('0x33'));_0x1393e2['query']=_['keys'](_0x229f8f[_0x91ad('0x34')]);_0x1393e2[_0x91ad('0x35')]=_[_0x91ad('0x36')](_0x1393e2[_0x91ad('0x32')],_0x1393e2[_0x91ad('0x34')]);_0x2b2565[_0x91ad('0x37')]=_[_0x91ad('0x36')](_0x1393e2['model'],qs['fields'](_0x229f8f['query'][_0x91ad('0x38')]));_0x2b2565[_0x91ad('0x37')]=_0x2b2565[_0x91ad('0x37')][_0x91ad('0x39')]?_0x2b2565[_0x91ad('0x37')]:_0x1393e2[_0x91ad('0x32')];if(!_0x229f8f[_0x91ad('0x34')][_0x91ad('0x3a')]('nolimit')){_0x2b2565['limit']=qs[_0x91ad('0x3b')](_0x229f8f['query'][_0x91ad('0x3b')]);_0x2b2565['offset']=qs['offset'](_0x229f8f[_0x91ad('0x34')]['offset']);}_0x2b2565['order']=qs[_0x91ad('0x3c')](_0x229f8f[_0x91ad('0x34')]['sort']);_0x2b2565['where']=qs[_0x91ad('0x35')](_[_0x91ad('0x3d')](_0x229f8f[_0x91ad('0x34')],_0x1393e2[_0x91ad('0x35')]),_0x496649);if(_0x229f8f[_0x91ad('0x34')][_0x91ad('0x3e')]){_0x2b2565[_0x91ad('0x3f')]=_['merge'](_0x2b2565[_0x91ad('0x3f')],{'$or':_[_0x91ad('0x2d')](_0x496649,function(_0x13d13e){if(_0x13d13e[_0x91ad('0x30')]!==_0x91ad('0x40')){var _0x15edd8={};_0x15edd8[_0x13d13e[_0x91ad('0x33')]]={'$like':'%'+_0x229f8f[_0x91ad('0x34')][_0x91ad('0x3e')]+'%'};return _0x15edd8;}})});}_0x2b2565=_[_0x91ad('0x41')]({},_0x2b2565,_0x229f8f[_0x91ad('0x42')]);var _0x14fe2d={'where':_0x2b2565[_0x91ad('0x3f')]};return db[_0x91ad('0x43')][_0x91ad('0x20')](_0x14fe2d)[_0x91ad('0x27')](function(_0x4eada8){_0x687737['count']=_0x4eada8;if(_0x229f8f[_0x91ad('0x34')][_0x91ad('0x44')]){_0x2b2565[_0x91ad('0x45')]=[{'all':!![]}];}return db['DeskField'][_0x91ad('0x46')](_0x2b2565);})[_0x91ad('0x27')](function(_0x39a474){_0x687737[_0x91ad('0x47')]=_0x39a474;return _0x687737;})['then'](respondWithFilteredResult(_0x2f664f,_0x2b2565))[_0x91ad('0x48')](handleError(_0x2f664f,null));};exports['show']=function(_0x51aabf,_0x32a875){var _0xcf668c={'raw':!![],'where':{'id':_0x51aabf['params']['id']}},_0x9bca9c={};_0x9bca9c[_0x91ad('0x32')]=_['keys'](db[_0x91ad('0x43')][_0x91ad('0x2e')]);_0x9bca9c['query']=_[_0x91ad('0x49')](_0x51aabf['query']);_0x9bca9c['filters']=_[_0x91ad('0x36')](_0x9bca9c[_0x91ad('0x32')],_0x9bca9c[_0x91ad('0x34')]);_0xcf668c['attributes']=_[_0x91ad('0x36')](_0x9bca9c[_0x91ad('0x32')],qs['fields'](_0x51aabf[_0x91ad('0x34')]['fields']));_0xcf668c[_0x91ad('0x37')]=_0xcf668c[_0x91ad('0x37')][_0x91ad('0x39')]?_0xcf668c[_0x91ad('0x37')]:_0x9bca9c[_0x91ad('0x32')];if(_0x51aabf[_0x91ad('0x34')][_0x91ad('0x44')]){_0xcf668c[_0x91ad('0x45')]=[{'all':!![]}];}_0xcf668c=_['merge']({},_0xcf668c,_0x51aabf[_0x91ad('0x42')]);return db[_0x91ad('0x43')]['find'](_0xcf668c)['then'](handleEntityNotFound(_0x32a875,null))[_0x91ad('0x27')](respondWithResult(_0x32a875,null))['catch'](handleError(_0x32a875,null));};exports[_0x91ad('0x4a')]=function(_0x4265c0,_0x276c7e){return db[_0x91ad('0x43')][_0x91ad('0x4a')](_0x4265c0['body'],{})[_0x91ad('0x27')](respondWithResult(_0x276c7e,0xc9))['catch'](handleError(_0x276c7e,null));};exports[_0x91ad('0x26')]=function(_0xc4bddd,_0x4d2c45){if(_0xc4bddd[_0x91ad('0x4b')]['id']){delete _0xc4bddd[_0x91ad('0x4b')]['id'];}return db[_0x91ad('0x43')][_0x91ad('0x4c')]({'where':{'id':_0xc4bddd['params']['id']}})[_0x91ad('0x27')](handleEntityNotFound(_0x4d2c45,null))[_0x91ad('0x27')](saveUpdates(_0xc4bddd[_0x91ad('0x4b')],null))[_0x91ad('0x27')](respondWithResult(_0x4d2c45,null))[_0x91ad('0x48')](handleError(_0x4d2c45,null));};exports[_0x91ad('0x28')]=function(_0x245823,_0x4876d8){return db[_0x91ad('0x43')][_0x91ad('0x4c')]({'where':{'id':_0x245823[_0x91ad('0x4d')]['id']}})[_0x91ad('0x27')](handleEntityNotFound(_0x4876d8,null))[_0x91ad('0x27')](removeEntity(_0x4876d8,null))[_0x91ad('0x48')](handleError(_0x4876d8,null));}; \ No newline at end of file +var _0xfdfc=['index','rawAttributes','type','key','model','map','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','DeskField','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','then','stack','name','send'];(function(_0xbc9deb,_0x10a431){var _0xc2ca35=function(_0x109f9c){while(--_0x109f9c){_0xbc9deb['push'](_0xbc9deb['shift']());}};_0xc2ca35(++_0x10a431);}(_0xfdfc,0x6c));var _0xcfdf=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0xfdfc[_0x5f0089];return _0x193892;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xcfdf('0x0'));var rp=require(_0xcfdf('0x1'));var moment=require(_0xcfdf('0x2'));var BPromise=require(_0xcfdf('0x3'));var Mustache=require(_0xcfdf('0x4'));var util=require('util');var path=require(_0xcfdf('0x5'));var sox=require(_0xcfdf('0x6'));var csv=require(_0xcfdf('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcfdf('0x8'));var _=require(_0xcfdf('0x9'));var squel=require(_0xcfdf('0xa'));var crypto=require(_0xcfdf('0xb'));var jsforce=require(_0xcfdf('0xc'));var deskjs=require(_0xcfdf('0xd'));var toCsv=require(_0xcfdf('0x7'));var querystring=require(_0xcfdf('0xe'));var Papa=require('papaparse');var Redis=require(_0xcfdf('0xf'));var authService=require(_0xcfdf('0x10'));var qs=require(_0xcfdf('0x11'));var as=require(_0xcfdf('0x12'));var hardwareService=require(_0xcfdf('0x13'));var logger=require('../../config/logger')(_0xcfdf('0x14'));var utils=require(_0xcfdf('0x15'));var config=require(_0xcfdf('0x16'));var licenseUtil=require(_0xcfdf('0x17'));var db=require(_0xcfdf('0x18'))['db'];function respondWithStatusCode(_0x5521de,_0x63bc98){_0x63bc98=_0x63bc98||0xcc;return function(_0x1fe97d){if(_0x1fe97d){return _0x5521de[_0xcfdf('0x19')](_0x63bc98);}return _0x5521de[_0xcfdf('0x1a')](_0x63bc98)[_0xcfdf('0x1b')]();};}function respondWithResult(_0x3d4795,_0x50d47a){_0x50d47a=_0x50d47a||0xc8;return function(_0x56acc1){if(_0x56acc1){return _0x3d4795['status'](_0x50d47a)[_0xcfdf('0x1c')](_0x56acc1);}};}function respondWithFilteredResult(_0x30a38d,_0x4e2b99){return function(_0x1a4170){if(_0x1a4170){var _0x47b3b0=typeof _0x4e2b99[_0xcfdf('0x1d')]===_0xcfdf('0x1e')&&typeof _0x4e2b99[_0xcfdf('0x1f')]==='undefined';var _0x18b252=_0x1a4170['count'];var _0x161b62=_0x47b3b0?0x0:_0x4e2b99['offset'];var _0x373a39=_0x47b3b0?_0x1a4170[_0xcfdf('0x20')]:_0x4e2b99[_0xcfdf('0x1d')]+_0x4e2b99[_0xcfdf('0x1f')];var _0x30f2cf;if(_0x373a39>=_0x18b252){_0x373a39=_0x18b252;_0x30f2cf=0xc8;}else{_0x30f2cf=0xce;}_0x30a38d['status'](_0x30f2cf);return _0x30a38d[_0xcfdf('0x21')](_0xcfdf('0x22'),_0x161b62+'-'+_0x373a39+'/'+_0x18b252)['json'](_0x1a4170);}return null;};}function patchUpdates(_0x28782b){return function(_0x48813e){try{jsonpatch['apply'](_0x48813e,_0x28782b,!![]);}catch(_0x1af681){return BPromise[_0xcfdf('0x23')](_0x1af681);}return _0x48813e['save']();};}function saveUpdates(_0x38a0e3,_0xc3e068){return function(_0x1e901d){if(_0x1e901d){return _0x1e901d[_0xcfdf('0x24')](_0x38a0e3)['then'](function(_0x4f8cea){return _0x4f8cea;});}return null;};}function removeEntity(_0x14685f,_0x5a90ba){return function(_0x1a20a8){if(_0x1a20a8){return _0x1a20a8[_0xcfdf('0x25')]()[_0xcfdf('0x26')](function(){_0x14685f[_0xcfdf('0x1a')](0xcc)[_0xcfdf('0x1b')]();});}};}function handleEntityNotFound(_0x1b1872,_0x1fe1cf){return function(_0x2f7af2){if(!_0x2f7af2){_0x1b1872[_0xcfdf('0x19')](0x194);}return _0x2f7af2;};}function handleError(_0x16c627,_0x4a12cf){_0x4a12cf=_0x4a12cf||0x1f4;return function(_0x3dda28){logger['error'](_0x3dda28[_0xcfdf('0x27')]);if(_0x3dda28['name']){delete _0x3dda28[_0xcfdf('0x28')];}_0x16c627['status'](_0x4a12cf)[_0xcfdf('0x29')](_0x3dda28);};}exports[_0xcfdf('0x2a')]=function(_0x12f8f7,_0x14f967){var _0x22da8b={},_0x57f5d1={},_0x5474f7={'count':0x0,'rows':[]};var _0x2870b5=_['map'](db['DeskField'][_0xcfdf('0x2b')],function(_0xaeb1a0){return{'name':_0xaeb1a0['fieldName'],'type':_0xaeb1a0[_0xcfdf('0x2c')][_0xcfdf('0x2d')]};});_0x57f5d1[_0xcfdf('0x2e')]=_[_0xcfdf('0x2f')](_0x2870b5,_0xcfdf('0x28'));_0x57f5d1[_0xcfdf('0x30')]=_['keys'](_0x12f8f7[_0xcfdf('0x30')]);_0x57f5d1['filters']=_[_0xcfdf('0x31')](_0x57f5d1[_0xcfdf('0x2e')],_0x57f5d1[_0xcfdf('0x30')]);_0x22da8b['attributes']=_[_0xcfdf('0x31')](_0x57f5d1[_0xcfdf('0x2e')],qs[_0xcfdf('0x32')](_0x12f8f7[_0xcfdf('0x30')]['fields']));_0x22da8b[_0xcfdf('0x33')]=_0x22da8b[_0xcfdf('0x33')][_0xcfdf('0x34')]?_0x22da8b[_0xcfdf('0x33')]:_0x57f5d1[_0xcfdf('0x2e')];if(!_0x12f8f7[_0xcfdf('0x30')][_0xcfdf('0x35')]('nolimit')){_0x22da8b[_0xcfdf('0x1f')]=qs[_0xcfdf('0x1f')](_0x12f8f7[_0xcfdf('0x30')][_0xcfdf('0x1f')]);_0x22da8b[_0xcfdf('0x1d')]=qs[_0xcfdf('0x1d')](_0x12f8f7['query']['offset']);}_0x22da8b[_0xcfdf('0x36')]=qs[_0xcfdf('0x37')](_0x12f8f7['query'][_0xcfdf('0x37')]);_0x22da8b[_0xcfdf('0x38')]=qs[_0xcfdf('0x39')](_[_0xcfdf('0x3a')](_0x12f8f7[_0xcfdf('0x30')],_0x57f5d1[_0xcfdf('0x39')]),_0x2870b5);if(_0x12f8f7[_0xcfdf('0x30')][_0xcfdf('0x3b')]){_0x22da8b[_0xcfdf('0x38')]=_[_0xcfdf('0x3c')](_0x22da8b[_0xcfdf('0x38')],{'$or':_[_0xcfdf('0x2f')](_0x2870b5,function(_0x4dc435){if(_0x4dc435[_0xcfdf('0x2c')]!==_0xcfdf('0x3d')){var _0xa194e={};_0xa194e[_0x4dc435[_0xcfdf('0x28')]]={'$like':'%'+_0x12f8f7[_0xcfdf('0x30')][_0xcfdf('0x3b')]+'%'};return _0xa194e;}})});}_0x22da8b=_[_0xcfdf('0x3c')]({},_0x22da8b,_0x12f8f7['options']);var _0x44e90f={'where':_0x22da8b['where']};return db[_0xcfdf('0x3e')][_0xcfdf('0x20')](_0x44e90f)[_0xcfdf('0x26')](function(_0x57666f){_0x5474f7[_0xcfdf('0x20')]=_0x57666f;if(_0x12f8f7['query'][_0xcfdf('0x3f')]){_0x22da8b[_0xcfdf('0x40')]=[{'all':!![]}];}return db[_0xcfdf('0x3e')][_0xcfdf('0x41')](_0x22da8b);})[_0xcfdf('0x26')](function(_0x414a4d){_0x5474f7[_0xcfdf('0x42')]=_0x414a4d;return _0x5474f7;})[_0xcfdf('0x26')](respondWithFilteredResult(_0x14f967,_0x22da8b))[_0xcfdf('0x43')](handleError(_0x14f967,null));};exports[_0xcfdf('0x44')]=function(_0x4eaee4,_0x12a6bf){var _0x315081={'raw':!![],'where':{'id':_0x4eaee4[_0xcfdf('0x45')]['id']}},_0x1df4fb={};_0x1df4fb[_0xcfdf('0x2e')]=_['keys'](db[_0xcfdf('0x3e')][_0xcfdf('0x2b')]);_0x1df4fb[_0xcfdf('0x30')]=_[_0xcfdf('0x46')](_0x4eaee4[_0xcfdf('0x30')]);_0x1df4fb[_0xcfdf('0x39')]=_[_0xcfdf('0x31')](_0x1df4fb['model'],_0x1df4fb[_0xcfdf('0x30')]);_0x315081[_0xcfdf('0x33')]=_[_0xcfdf('0x31')](_0x1df4fb[_0xcfdf('0x2e')],qs['fields'](_0x4eaee4[_0xcfdf('0x30')]['fields']));_0x315081[_0xcfdf('0x33')]=_0x315081[_0xcfdf('0x33')][_0xcfdf('0x34')]?_0x315081[_0xcfdf('0x33')]:_0x1df4fb[_0xcfdf('0x2e')];if(_0x4eaee4[_0xcfdf('0x30')]['includeAll']){_0x315081[_0xcfdf('0x40')]=[{'all':!![]}];}_0x315081=_['merge']({},_0x315081,_0x4eaee4[_0xcfdf('0x47')]);return db[_0xcfdf('0x3e')][_0xcfdf('0x48')](_0x315081)['then'](handleEntityNotFound(_0x12a6bf,null))[_0xcfdf('0x26')](respondWithResult(_0x12a6bf,null))[_0xcfdf('0x43')](handleError(_0x12a6bf,null));};exports[_0xcfdf('0x49')]=function(_0x15d853,_0x20eafa){return db[_0xcfdf('0x3e')][_0xcfdf('0x49')](_0x15d853[_0xcfdf('0x4a')],{})['then'](respondWithResult(_0x20eafa,0xc9))[_0xcfdf('0x43')](handleError(_0x20eafa,null));};exports[_0xcfdf('0x24')]=function(_0x955cca,_0x5615a0){if(_0x955cca[_0xcfdf('0x4a')]['id']){delete _0x955cca[_0xcfdf('0x4a')]['id'];}return db[_0xcfdf('0x3e')]['find']({'where':{'id':_0x955cca[_0xcfdf('0x45')]['id']}})['then'](handleEntityNotFound(_0x5615a0,null))['then'](saveUpdates(_0x955cca[_0xcfdf('0x4a')],null))[_0xcfdf('0x26')](respondWithResult(_0x5615a0,null))[_0xcfdf('0x43')](handleError(_0x5615a0,null));};exports[_0xcfdf('0x25')]=function(_0x1068a6,_0x484f02){return db['DeskField']['find']({'where':{'id':_0x1068a6['params']['id']}})[_0xcfdf('0x26')](handleEntityNotFound(_0x484f02,null))[_0xcfdf('0x26')](removeEntity(_0x484f02,null))['catch'](handleError(_0x484f02,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 0a8bd26..b66af9a 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 _0xeb07=['int_desk_fields','desk_unique_index','FieldId','util','../../config/logger','api','moment','bluebird','path','rimraf','exports','DeskField'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xeb07,0x123));var _0x7eb0=function(_0x25c05d,_0x5d1626){_0x25c05d=_0x25c05d-0x0;var _0x34eca2=_0xeb07[_0x25c05d];return _0x34eca2;};'use strict';var _=require('lodash');var util=require(_0x7eb0('0x0'));var logger=require(_0x7eb0('0x1'))(_0x7eb0('0x2'));var moment=require(_0x7eb0('0x3'));var BPromise=require(_0x7eb0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7eb0('0x5'));var rimraf=require(_0x7eb0('0x6'));var config=require('../../config/environment');var attributes=require('./intDeskField.attributes');module[_0x7eb0('0x7')]=function(_0x5516b4,_0x2a8128){return _0x5516b4['define'](_0x7eb0('0x8'),attributes,{'tableName':_0x7eb0('0x9'),'paranoid':![],'indexes':[{'name':_0x7eb0('0xa'),'fields':['idField',_0x7eb0('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x38a3=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','desk_unique_index','FieldId','lodash','util'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x38a3,0x11e));var _0x338a=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x38a3[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x338a('0x0'));var util=require(_0x338a('0x1'));var logger=require(_0x338a('0x2'))(_0x338a('0x3'));var moment=require(_0x338a('0x4'));var BPromise=require(_0x338a('0x5'));var rp=require(_0x338a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x338a('0x7'));var config=require(_0x338a('0x8'));var attributes=require(_0x338a('0x9'));module[_0x338a('0xa')]=function(_0x5eb282,_0x3f1676){return _0x5eb282[_0x338a('0xb')](_0x338a('0xc'),attributes,{'tableName':_0x338a('0xd'),'paranoid':![],'indexes':[{'name':_0x338a('0xe'),'fields':['idField',_0x338a('0xf')],'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 8c8f0d8..599d294 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 _0x7279=['result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','DeskField,\x20%s,\x20%s','DeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info'];(function(_0x46b19f,_0x434564){var _0x4085d3=function(_0x2910d1){while(--_0x2910d1){_0x46b19f['push'](_0x46b19f['shift']());}};_0x4085d3(++_0x434564);}(_0x7279,0x1ba));var _0x9727=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7279[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9727('0x0'));var util=require(_0x9727('0x1'));var moment=require(_0x9727('0x2'));var BPromise=require(_0x9727('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9727('0x4'));var db=require(_0x9727('0x5'))['db'];var utils=require(_0x9727('0x6'));var logger=require(_0x9727('0x7'))(_0x9727('0x8'));var config=require('../../config/environment');var jayson=require(_0x9727('0x9'));var client=jayson[_0x9727('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x15cdc3,_0x3720a6,_0x55c957){return new BPromise(function(_0xaede35,_0x2995c3){return client[_0x9727('0xb')](_0x15cdc3,_0x55c957)[_0x9727('0xc')](function(_0x14c576){logger['info'](_0x9727('0xd'),_0x3720a6,'request\x20sent');logger['debug'](_0x9727('0xe'),_0x3720a6,_0x9727('0xf'),JSON[_0x9727('0x10')](_0x14c576));if(_0x14c576[_0x9727('0x11')]){if(_0x14c576['error']['code']===0x1f4){logger[_0x9727('0x11')](_0x9727('0xd'),_0x3720a6,_0x14c576[_0x9727('0x11')]['message']);return _0x2995c3(_0x14c576['error'][_0x9727('0x12')]);}logger[_0x9727('0x11')](_0x9727('0xd'),_0x3720a6,_0x14c576[_0x9727('0x11')][_0x9727('0x12')]);return _0xaede35(_0x14c576[_0x9727('0x11')][_0x9727('0x12')]);}else{logger[_0x9727('0x13')]('DeskField,\x20%s,\x20%s',_0x3720a6,'request\x20sent');_0xaede35(_0x14c576[_0x9727('0x14')][_0x9727('0x12')]);}})['catch'](function(_0x1ecae0){logger[_0x9727('0x11')]('DeskField,\x20%s,\x20%s',_0x3720a6,_0x1ecae0);_0x2995c3(_0x1ecae0);});});} \ No newline at end of file +var _0x47c0=['DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskField,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent'];(function(_0x1fa841,_0x37a70c){var _0x384b67=function(_0x248c40){while(--_0x248c40){_0x1fa841['push'](_0x1fa841['shift']());}};_0x384b67(++_0x37a70c);}(_0x47c0,0x9a));var _0x047c=function(_0x5dee77,_0x4bec32){_0x5dee77=_0x5dee77-0x0;var _0x37356a=_0x47c0[_0x5dee77];return _0x37356a;};'use strict';var _=require(_0x047c('0x0'));var util=require('util');var moment=require(_0x047c('0x1'));var BPromise=require(_0x047c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x047c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x047c('0x4'));var logger=require(_0x047c('0x5'))(_0x047c('0x6'));var config=require(_0x047c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x047c('0x8')][_0x047c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2eb14f,_0x22da08,_0x58eacc){return new BPromise(function(_0x18168b,_0x28c7e9){return client[_0x047c('0xa')](_0x2eb14f,_0x58eacc)[_0x047c('0xb')](function(_0x35f293){logger[_0x047c('0xc')]('DeskField,\x20%s,\x20%s',_0x22da08,_0x047c('0xd'));logger['debug'](_0x047c('0xe'),_0x22da08,_0x047c('0xd'),JSON[_0x047c('0xf')](_0x35f293));if(_0x35f293[_0x047c('0x10')]){if(_0x35f293['error'][_0x047c('0x11')]===0x1f4){logger[_0x047c('0x10')](_0x047c('0x12'),_0x22da08,_0x35f293[_0x047c('0x10')][_0x047c('0x13')]);return _0x28c7e9(_0x35f293[_0x047c('0x10')][_0x047c('0x13')]);}logger[_0x047c('0x10')](_0x047c('0x12'),_0x22da08,_0x35f293[_0x047c('0x10')]['message']);return _0x18168b(_0x35f293['error'][_0x047c('0x13')]);}else{logger[_0x047c('0xc')](_0x047c('0x12'),_0x22da08,'request\x20sent');_0x18168b(_0x35f293['result'][_0x047c('0x13')]);}})[_0x047c('0x14')](function(_0x2b23aa){logger['error'](_0x047c('0x12'),_0x22da08,_0x2b23aa);_0x28c7e9(_0x2b23aa);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index a2e7e27..fe6b987 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 _0x3e23=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','post','/:id/configurations','update','delete','destroy','util','connect-timeout'];(function(_0x507cb1,_0x1d1a6d){var _0x4c61f6=function(_0x4f9173){while(--_0x4f9173){_0x507cb1['push'](_0x507cb1['shift']());}};_0x4c61f6(++_0x1d1a6d);}(_0x3e23,0x154));var _0x33e2=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0x3e23[_0xa8883];return _0x479426;};'use strict';var multer=require('multer');var util=require(_0x33e2('0x0'));var path=require('path');var timeout=require(_0x33e2('0x1'));var express=require('express');var router=express[_0x33e2('0x2')]();var fs_extra=require(_0x33e2('0x3'));var auth=require(_0x33e2('0x4'));var interaction=require(_0x33e2('0x5'));var config=require(_0x33e2('0x6'));var controller=require('./intDynamics365Account.controller');router[_0x33e2('0x7')]('/',auth[_0x33e2('0x8')](),controller[_0x33e2('0x9')]);router[_0x33e2('0x7')](_0x33e2('0xa'),auth[_0x33e2('0x8')](),controller[_0x33e2('0xb')]);router[_0x33e2('0x7')]('/:id/configurations',auth[_0x33e2('0x8')](),controller['getConfigurations']);router[_0x33e2('0x7')](_0x33e2('0xc'),auth[_0x33e2('0x8')](),controller[_0x33e2('0xd')]);router[_0x33e2('0xe')]('/',auth[_0x33e2('0x8')](),controller['create']);router[_0x33e2('0xe')](_0x33e2('0xf'),auth[_0x33e2('0x8')](),controller['addConfiguration']);router['put']('/:id',auth[_0x33e2('0x8')](),controller[_0x33e2('0x10')]);router[_0x33e2('0x11')](_0x33e2('0xa'),auth[_0x33e2('0x8')](),controller[_0x33e2('0x12')]);module['exports']=router; \ No newline at end of file +var _0x4ad5=['getFields','create','post','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','/:id','show','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields'];(function(_0x3d536f,_0x58cedd){var _0x277ee8=function(_0x4df154){while(--_0x4df154){_0x3d536f['push'](_0x3d536f['shift']());}};_0x277ee8(++_0x58cedd);}(_0x4ad5,0x18e));var _0x54ad=function(_0x31f4cc,_0x22ddd3){_0x31f4cc=_0x31f4cc-0x0;var _0x43ad5d=_0x4ad5[_0x31f4cc];return _0x43ad5d;};'use strict';var multer=require('multer');var util=require(_0x54ad('0x0'));var path=require(_0x54ad('0x1'));var timeout=require(_0x54ad('0x2'));var express=require('express');var router=express[_0x54ad('0x3')]();var fs_extra=require(_0x54ad('0x4'));var auth=require(_0x54ad('0x5'));var interaction=require(_0x54ad('0x6'));var config=require(_0x54ad('0x7'));var controller=require(_0x54ad('0x8'));router[_0x54ad('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x54ad('0x9')](_0x54ad('0xa'),auth['isAuthenticated'](),controller[_0x54ad('0xb')]);router[_0x54ad('0x9')](_0x54ad('0xc'),auth[_0x54ad('0xd')](),controller[_0x54ad('0xe')]);router[_0x54ad('0x9')](_0x54ad('0xf'),auth[_0x54ad('0xd')](),controller[_0x54ad('0x10')]);router['post']('/',auth[_0x54ad('0xd')](),controller[_0x54ad('0x11')]);router[_0x54ad('0x12')](_0x54ad('0xc'),auth[_0x54ad('0xd')](),controller['addConfiguration']);router['put'](_0x54ad('0xa'),auth['isAuthenticated'](),controller[_0x54ad('0x13')]);router[_0x54ad('0x14')](_0x54ad('0xa'),auth['isAuthenticated'](),controller[_0x54ad('0x15')]);module[_0x54ad('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 5c37227..4ed49dd 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 _0x70e9=['BOOLEAN','exports','STRING'];(function(_0x4ac716,_0x40243f){var _0x35f56b=function(_0x14e518){while(--_0x14e518){_0x4ac716['push'](_0x4ac716['shift']());}};_0x35f56b(++_0x40243f);}(_0x70e9,0x193));var _0x970e=function(_0x1511fd,_0x5b572c){_0x1511fd=_0x1511fd-0x0;var _0x3ba08b=_0x70e9[_0x1511fd];return _0x3ba08b;};'use strict';var Sequelize=require('sequelize');module[_0x970e('0x0')]={'name':{'type':Sequelize[_0x970e('0x1')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x970e('0x1')]},'remoteUri':{'type':Sequelize[_0x970e('0x1')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x970e('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x970e('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x970e('0x1')]},'modernAuthentication':{'type':Sequelize[_0x970e('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x50d0=['STRING','BOOLEAN','sequelize'];(function(_0x57e309,_0x1b7f1f){var _0x5aa5c2=function(_0x274fcb){while(--_0x274fcb){_0x57e309['push'](_0x57e309['shift']());}};_0x5aa5c2(++_0x1b7f1f);}(_0x50d0,0x101));var _0x050d=function(_0x2c7c27,_0x945979){_0x2c7c27=_0x2c7c27-0x0;var _0x38a3ce=_0x50d0[_0x2c7c27];return _0x38a3ce;};'use strict';var Sequelize=require(_0x050d('0x0'));module['exports']={'name':{'type':Sequelize[_0x050d('0x1')]},'username':{'type':Sequelize[_0x050d('0x1')]},'password':{'type':Sequelize[_0x050d('0x1')]},'remoteUri':{'type':Sequelize[_0x050d('0x1')]},'tenantId':{'type':Sequelize[_0x050d('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x050d('0x1')]},'serverUrl':{'type':Sequelize[_0x050d('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x050d('0x1')]},'modernAuthentication':{'type':Sequelize[_0x050d('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index a7ec225..564f4c1 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 _0x8c2e=['modernAuthentication','access_token','https://login.microsoftonline.com/','/oauth2/token','clientSecret','Bearer\x20',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','4.0','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','MetadataId','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','statusCode','stack','send','test','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','UserLocalizedLabel','Value','DisplayName','EntityDefinitions(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','Label','true','FalseOption','GET','?$select=DisplayName,LogicalName','request-promise','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','json','offset','undefined','limit','count','update','then','destroy','status','end','sendStatus','error','name','index','map','Dynamics365Account','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','include','create','catch','body','find','getConfigurations','findOne','Dynamics365Configuration','order','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','Dynamics365Field','Descriptions','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields','ticketType','incident','PhoneCall','title','description','customerid','caseorigincode','subject','regardingobjectid','directioncode','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','customeridtype','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_iotalertname','numberofchildincidents','onholdtime','owneridname','owneridtype','parentcaseidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statuscode','subjectidname','ticketnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','clientId','CloudProvider','data5','data7'];(function(_0x413cfb,_0x102a87){var _0x14b43c=function(_0x2ddecb){while(--_0x2ddecb){_0x413cfb['push'](_0x413cfb['shift']());}};_0x14b43c(++_0x102a87);}(_0x8c2e,0xec));var _0xe8c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8c2e[_0x3dd15e];return _0x231fd0;};'use strict';var rp=require(_0xe8c2('0x0'));var util=require('util');var _=require(_0xe8c2('0x1'));var qs=require(_0xe8c2('0x2'));var logger=require(_0xe8c2('0x3'))(_0xe8c2('0x4'));var db=require(_0xe8c2('0x5'))['db'];var integrations=require(_0xe8c2('0x6'));function respondWithResult(_0x1603a7,_0x14de48){_0x14de48=_0x14de48||0xc8;return function(_0x52da4e){if(_0x52da4e){return _0x1603a7['status'](_0x14de48)[_0xe8c2('0x7')](_0x52da4e);}};}function respondWithFilteredResult(_0x9041b,_0x49f3ac){return function(_0x1600c6){if(_0x1600c6){var _0x4b3318=typeof _0x49f3ac[_0xe8c2('0x8')]===_0xe8c2('0x9')&&typeof _0x49f3ac[_0xe8c2('0xa')]==='undefined';var _0xad00b6=_0x1600c6[_0xe8c2('0xb')];var _0x4e0299=_0x4b3318?0x0:_0x49f3ac[_0xe8c2('0x8')];var _0x3b0d15=_0x4b3318?_0x1600c6[_0xe8c2('0xb')]:_0x49f3ac[_0xe8c2('0x8')]+_0x49f3ac[_0xe8c2('0xa')];var _0x2b0b9e;if(_0x3b0d15>=_0xad00b6){_0x3b0d15=_0xad00b6;_0x2b0b9e=0xc8;}else{_0x2b0b9e=0xce;}_0x9041b['status'](_0x2b0b9e);return _0x9041b['set']('Content-Range',_0x4e0299+'-'+_0x3b0d15+'/'+_0xad00b6)[_0xe8c2('0x7')](_0x1600c6);}return null;};}function saveUpdates(_0x487dbc){return function(_0x58dec0){if(_0x58dec0){return _0x58dec0[_0xe8c2('0xc')](_0x487dbc)[_0xe8c2('0xd')](function(_0x29183e){return _0x29183e;});}return null;};}function removeEntity(_0x11bb41){return function(_0x4f4644){if(_0x4f4644){return _0x4f4644[_0xe8c2('0xe')]()[_0xe8c2('0xd')](function(){_0x11bb41[_0xe8c2('0xf')](0xcc)[_0xe8c2('0x10')]();});}};}function handleEntityNotFound(_0xa7bdc){return function(_0x41847e){if(!_0x41847e){_0xa7bdc[_0xe8c2('0x11')](0x194);}return _0x41847e;};}function handleError(_0x334767,_0x47d4e7){_0x47d4e7=_0x47d4e7||0x1f4;return function(_0x5aaf80){logger[_0xe8c2('0x12')](_0x5aaf80['stack']);if(_0x5aaf80['name']){delete _0x5aaf80[_0xe8c2('0x13')];}_0x334767[_0xe8c2('0xf')](_0x47d4e7)['send'](_0x5aaf80);};}exports[_0xe8c2('0x14')]=function(_0x219190,_0x4fed86){var _0x85abc5={},_0x2e8da9={},_0xa1bf={'count':0x0,'rows':[]};var _0xbdca93=_[_0xe8c2('0x15')](db[_0xe8c2('0x16')][_0xe8c2('0x17')],function(_0x122a09){return{'name':_0x122a09['fieldName'],'type':_0x122a09[_0xe8c2('0x18')][_0xe8c2('0x19')]};});_0x2e8da9[_0xe8c2('0x1a')]=_[_0xe8c2('0x15')](_0xbdca93,_0xe8c2('0x13'));_0x2e8da9[_0xe8c2('0x1b')]=_[_0xe8c2('0x1c')](_0x219190['query']);_0x2e8da9[_0xe8c2('0x1d')]=_[_0xe8c2('0x1e')](_0x2e8da9[_0xe8c2('0x1a')],_0x2e8da9['query']);_0x85abc5[_0xe8c2('0x1f')]=_['intersection'](_0x2e8da9[_0xe8c2('0x1a')],qs[_0xe8c2('0x20')](_0x219190[_0xe8c2('0x1b')][_0xe8c2('0x20')]));_0x85abc5[_0xe8c2('0x1f')]=_0x85abc5['attributes'][_0xe8c2('0x21')]?_0x85abc5[_0xe8c2('0x1f')]:_0x2e8da9[_0xe8c2('0x1a')];if(!_0x219190[_0xe8c2('0x1b')][_0xe8c2('0x22')](_0xe8c2('0x23'))){_0x85abc5[_0xe8c2('0xa')]=qs['limit'](_0x219190[_0xe8c2('0x1b')][_0xe8c2('0xa')]);_0x85abc5[_0xe8c2('0x8')]=qs[_0xe8c2('0x8')](_0x219190['query']['offset']);}_0x85abc5['order']=qs[_0xe8c2('0x24')](_0x219190[_0xe8c2('0x1b')][_0xe8c2('0x24')]);_0x85abc5[_0xe8c2('0x25')]=qs['filters'](_['pick'](_0x219190[_0xe8c2('0x1b')],_0x2e8da9[_0xe8c2('0x1d')]),_0xbdca93);if(_0x219190[_0xe8c2('0x1b')][_0xe8c2('0x26')]){_0x85abc5[_0xe8c2('0x25')]=_[_0xe8c2('0x27')](_0x85abc5['where'],{'$or':_[_0xe8c2('0x15')](_0xbdca93,function(_0x287e27){if(_0x287e27[_0xe8c2('0x18')]!==_0xe8c2('0x28')){var _0x128d43={};_0x128d43[_0x287e27[_0xe8c2('0x13')]]={'$like':'%'+_0x219190[_0xe8c2('0x1b')][_0xe8c2('0x26')]+'%'};return _0x128d43;}})});}_0x85abc5=_['merge']({},_0x85abc5,_0x219190[_0xe8c2('0x29')]);var _0x7271cc={'where':_0x85abc5[_0xe8c2('0x25')]};return db['Dynamics365Account'][_0xe8c2('0xb')](_0x7271cc)[_0xe8c2('0xd')](function(_0x5aae4a){_0xa1bf[_0xe8c2('0xb')]=_0x5aae4a;if(_0x219190['query'][_0xe8c2('0x2a')]){_0x85abc5['include']=[{'all':!![]}];}return db[_0xe8c2('0x16')][_0xe8c2('0x2b')](_0x85abc5);})[_0xe8c2('0xd')](function(_0x279f3f){_0xa1bf[_0xe8c2('0x2c')]=_0x279f3f;return _0xa1bf;})[_0xe8c2('0xd')](respondWithFilteredResult(_0x4fed86,_0x85abc5))['catch'](handleError(_0x4fed86,null));};exports[_0xe8c2('0x2d')]=function(_0x48d41b,_0x3e0b48){var _0x32e050={'raw':![],'where':{'id':_0x48d41b[_0xe8c2('0x2e')]['id']}},_0x2baaf8={};_0x2baaf8[_0xe8c2('0x1a')]=_['keys'](db[_0xe8c2('0x16')][_0xe8c2('0x17')]);_0x2baaf8[_0xe8c2('0x1b')]=_[_0xe8c2('0x1c')](_0x48d41b['query']);_0x2baaf8['filters']=_[_0xe8c2('0x1e')](_0x2baaf8[_0xe8c2('0x1a')],_0x2baaf8[_0xe8c2('0x1b')]);_0x32e050[_0xe8c2('0x1f')]=_[_0xe8c2('0x1e')](_0x2baaf8['model'],qs[_0xe8c2('0x20')](_0x48d41b['query'][_0xe8c2('0x20')]));_0x32e050[_0xe8c2('0x1f')]=_0x32e050['attributes'][_0xe8c2('0x21')]?_0x32e050[_0xe8c2('0x1f')]:_0x2baaf8[_0xe8c2('0x1a')];if(_0x48d41b[_0xe8c2('0x1b')][_0xe8c2('0x2a')]){_0x32e050[_0xe8c2('0x2f')]=[{'all':!![]}];}_0x32e050=_[_0xe8c2('0x27')]({},_0x32e050,_0x48d41b[_0xe8c2('0x29')]);return db[_0xe8c2('0x16')]['find'](_0x32e050)['then'](handleEntityNotFound(_0x3e0b48,null))[_0xe8c2('0xd')](respondWithResult(_0x3e0b48,null))['catch'](handleError(_0x3e0b48,null));};exports[_0xe8c2('0x30')]=function(_0x42d743,_0x5b0151){return db[_0xe8c2('0x16')][_0xe8c2('0x30')](_0x42d743['body'],{})[_0xe8c2('0xd')](respondWithResult(_0x5b0151,0xc9))[_0xe8c2('0x31')](handleError(_0x5b0151,null));};exports[_0xe8c2('0xc')]=function(_0x244499,_0x478c7c){if(_0x244499[_0xe8c2('0x32')]['id']){delete _0x244499[_0xe8c2('0x32')]['id'];}return db[_0xe8c2('0x16')][_0xe8c2('0x33')]({'where':{'id':_0x244499['params']['id']}})[_0xe8c2('0xd')](handleEntityNotFound(_0x478c7c,null))[_0xe8c2('0xd')](saveUpdates(_0x244499['body'],null))[_0xe8c2('0xd')](respondWithResult(_0x478c7c,null))['catch'](handleError(_0x478c7c,null));};exports[_0xe8c2('0xe')]=function(_0x2811d7,_0x157980){return db[_0xe8c2('0x16')][_0xe8c2('0x33')]({'where':{'id':_0x2811d7[_0xe8c2('0x2e')]['id']}})[_0xe8c2('0xd')](handleEntityNotFound(_0x157980,null))['then'](removeEntity(_0x157980,null))[_0xe8c2('0x31')](handleError(_0x157980,null));};exports[_0xe8c2('0x34')]=function(_0x1e0a54,_0x30f133){var _0xad0b72={};var _0xce0c0b={};var _0x666202;var _0x4be222;return db[_0xe8c2('0x16')][_0xe8c2('0x35')]({'where':{'id':_0x1e0a54[_0xe8c2('0x2e')]['id']}})[_0xe8c2('0xd')](handleEntityNotFound(_0x30f133,null))['then'](function(_0x52d1fb){if(_0x52d1fb){_0x666202=_0x52d1fb;_0xce0c0b[_0xe8c2('0x1a')]=_[_0xe8c2('0x1c')](db[_0xe8c2('0x36')][_0xe8c2('0x17')]);_0xce0c0b[_0xe8c2('0x1b')]=_[_0xe8c2('0x1c')](_0x1e0a54['query']);_0xce0c0b[_0xe8c2('0x1d')]=_[_0xe8c2('0x1e')](_0xce0c0b[_0xe8c2('0x1a')],_0xce0c0b[_0xe8c2('0x1b')]);_0xad0b72['attributes']=_[_0xe8c2('0x1e')](_0xce0c0b[_0xe8c2('0x1a')],qs['fields'](_0x1e0a54[_0xe8c2('0x1b')][_0xe8c2('0x20')]));_0xad0b72[_0xe8c2('0x1f')]=_0xad0b72[_0xe8c2('0x1f')]['length']?_0xad0b72['attributes']:_0xce0c0b[_0xe8c2('0x1a')];_0xad0b72[_0xe8c2('0x37')]=qs[_0xe8c2('0x24')](_0x1e0a54['query']['sort']);_0xad0b72['where']=qs[_0xe8c2('0x1d')](_[_0xe8c2('0x38')](_0x1e0a54['query'],_0xce0c0b[_0xe8c2('0x1d')]));if(_0x1e0a54[_0xe8c2('0x1b')][_0xe8c2('0x26')]){_0xad0b72[_0xe8c2('0x25')]=_[_0xe8c2('0x27')](_0xad0b72[_0xe8c2('0x25')],{'$or':_[_0xe8c2('0x15')](_0xad0b72['attributes'],function(_0x2aa590){var _0xe7e69d={};_0xe7e69d[_0x2aa590]={'$like':'%'+_0x1e0a54[_0xe8c2('0x1b')][_0xe8c2('0x26')]+'%'};return _0xe7e69d;})});}_0xad0b72=_['merge']({},_0xad0b72,_0x1e0a54['options']);return _0x666202[_0xe8c2('0x34')](_0xad0b72);}})[_0xe8c2('0xd')](function(_0x1c7a75){if(_0x1c7a75){_0x4be222=_0x1c7a75[_0xe8c2('0x21')];if(!_0x1e0a54['query'][_0xe8c2('0x22')]('nolimit')){_0xad0b72[_0xe8c2('0xa')]=qs[_0xe8c2('0xa')](_0x1e0a54[_0xe8c2('0x1b')]['limit']);_0xad0b72[_0xe8c2('0x8')]=qs[_0xe8c2('0x8')](_0x1e0a54[_0xe8c2('0x1b')][_0xe8c2('0x8')]);}return _0x666202['getConfigurations'](_0xad0b72);}})[_0xe8c2('0xd')](function(_0x6515a1){if(_0x6515a1){return _0x6515a1?{'count':_0x4be222,'rows':_0x6515a1}:null;}})[_0xe8c2('0xd')](respondWithResult(_0x30f133,null))[_0xe8c2('0x31')](handleError(_0x30f133,null));};exports[_0xe8c2('0x39')]=function(_0x1fdddd,_0x4cf4ba){if(_0x1fdddd[_0xe8c2('0x32')]['id']){delete _0x1fdddd[_0xe8c2('0x32')]['id'];}return db['Dynamics365Account']['findOne']({'where':{'id':_0x1fdddd[_0xe8c2('0x2e')]['id']}})[_0xe8c2('0xd')](handleEntityNotFound(_0x4cf4ba,null))['then'](function(_0xe55beb){if(_0xe55beb){_0x1fdddd[_0xe8c2('0x32')][_0xe8c2('0x3a')]=_0xe55beb['id'];_0x1fdddd[_0xe8c2('0x32')][_0xe8c2('0x3b')]=integrations[_0xe8c2('0x3c')](_0x1fdddd[_0xe8c2('0x32')][_0xe8c2('0x3d')],_0x1fdddd[_0xe8c2('0x32')][_0xe8c2('0x18')]);_0x1fdddd[_0xe8c2('0x32')]['Descriptions']=integrations[_0xe8c2('0x3e')](_0x1fdddd[_0xe8c2('0x32')][_0xe8c2('0x3d')],_0x1fdddd['body']['type']);return db[_0xe8c2('0x36')][_0xe8c2('0x30')](_0x1fdddd['body'],{'include':[{'model':db[_0xe8c2('0x3f')],'as':_0xe8c2('0x3b')},{'model':db[_0xe8c2('0x3f')],'as':_0xe8c2('0x40')}]});}return null;})[_0xe8c2('0xd')](respondWithResult(_0x4cf4ba,null))[_0xe8c2('0x31')](handleError(_0x4cf4ba,null));};function sanitizeRemoteUri(_0x16099d){var _0xf3a96a=_0x16099d[_0xe8c2('0x41')](-0x1);if(_0xf3a96a==='/')return _0x16099d[_0xe8c2('0x42')](0x0,_0x16099d[_0xe8c2('0x43')](_0xf3a96a));return _0x16099d;}function getWebApiUrl(_0x46877e){return util[_0xe8c2('0x44')](_0xe8c2('0x45'),_0x46877e);}exports[_0xe8c2('0x46')]=function(_0x31a75f,_0x555b8e){var _0x2e8343=_0x31a75f[_0xe8c2('0x1b')][_0xe8c2('0x47')];var _0x4da3d8=_0x2e8343===_0xe8c2('0x48')?'Incident':_0xe8c2('0x49');var _0x4cac98='';var _0x3cf982='';var _0xfafdc3='';var _0x266201='';var _0x284603='';var _0xd2964c='';var _0x52d15e='';var _0x139f05='';var _0x2fcbb5=[_0xe8c2('0x4a'),_0xe8c2('0x4b'),_0xe8c2('0x4c'),'ownerid',_0xe8c2('0x4d'),_0xe8c2('0x4e'),'phonenumber',_0xe8c2('0x4f'),_0xe8c2('0x50'),'phonecall_activity_parties'];var _0x182e6c=[_0xe8c2('0x51'),_0xe8c2('0x52'),_0xe8c2('0x53'),_0xe8c2('0x54'),_0xe8c2('0x55'),_0xe8c2('0x56'),_0xe8c2('0x57'),_0xe8c2('0x58'),_0xe8c2('0x59'),_0xe8c2('0x5a'),_0xe8c2('0x5b'),_0xe8c2('0x5c'),_0xe8c2('0x5d'),_0xe8c2('0x5e'),'createdonbehalfbyyominame','customeridname',_0xe8c2('0x5f'),'customeridyominame',_0xe8c2('0x60'),_0xe8c2('0x61'),_0xe8c2('0x62'),_0xe8c2('0x63'),_0xe8c2('0x64'),_0xe8c2('0x65'),_0xe8c2('0x66'),_0xe8c2('0x67'),_0xe8c2('0x68'),_0xe8c2('0x69'),_0xe8c2('0x6a'),_0xe8c2('0x6b'),_0xe8c2('0x6c'),_0xe8c2('0x6d'),'modifiedbyexternalpartyyominame','modifiedbyname',_0xe8c2('0x6e'),_0xe8c2('0x6f'),_0xe8c2('0x70'),_0xe8c2('0x71'),'msdyn_incidenttypename',_0xe8c2('0x72'),_0xe8c2('0x73'),_0xe8c2('0x74'),'overriddencreatedon',_0xe8c2('0x75'),_0xe8c2('0x76'),'owneridyominame',_0xe8c2('0x77'),'primarycontactidname',_0xe8c2('0x78'),_0xe8c2('0x79'),_0xe8c2('0x7a'),_0xe8c2('0x7b'),_0xe8c2('0x7c'),_0xe8c2('0x7d'),_0xe8c2('0x7e'),_0xe8c2('0x7f'),_0xe8c2('0x80'),_0xe8c2('0x81'),_0xe8c2('0x82'),_0xe8c2('0x83'),_0xe8c2('0x84'),'statecode',_0xe8c2('0x85'),_0xe8c2('0x86'),_0xe8c2('0x87'),'timezoneruleversionnumber',_0xe8c2('0x88'),_0xe8c2('0x89'),_0xe8c2('0x8a'),_0xe8c2('0x8b')];var _0x396029=_0x2fcbb5[_0xe8c2('0x8c')](_0x182e6c);return db[_0xe8c2('0x16')][_0xe8c2('0x35')]({'where':{'id':_0x31a75f[_0xe8c2('0x2e')]['id']},'attributes':['id',_0xe8c2('0x8d'),_0xe8c2('0x8e'),_0xe8c2('0x8f'),'tenantId',_0xe8c2('0x90'),'clientSecret','modernAuthentication'],'include':[{'model':db[_0xe8c2('0x91')],'as':_0xe8c2('0x91'),'attributes':['id',_0xe8c2('0x92'),_0xe8c2('0x93')]}]})[_0xe8c2('0xd')](handleEntityNotFound(_0x555b8e,null))[_0xe8c2('0xd')](function(_0xf035dd){if(_0xf035dd){if(_0xf035dd[_0xe8c2('0x94')]){_0xf035dd[_0xe8c2('0x95')]=_0xf035dd[_0xe8c2('0x91')][_0xe8c2('0x92')];_0x139f05=sanitizeRemoteUri(_0xf035dd[_0xe8c2('0x91')]['data7']);_0x52d15e=getWebApiUrl(_0x139f05);return _0xf035dd;}_0x139f05=sanitizeRemoteUri(_0xf035dd[_0xe8c2('0x8f')]);_0x52d15e=getWebApiUrl(_0x139f05);var _0xb9b70a={'method':'POST','uri':_0xe8c2('0x96')+_0xf035dd['tenantId']+_0xe8c2('0x97'),'form':{'client_id':_0xf035dd[_0xe8c2('0x90')],'resource':_0x139f05,'username':_0xf035dd[_0xe8c2('0x8d')],'password':_0xf035dd[_0xe8c2('0x8e')],'grant_type':_0xe8c2('0x8e'),'client_secret':_0xf035dd[_0xe8c2('0x98')]},'json':!![]};return rp(_0xb9b70a);}})[_0xe8c2('0xd')](function(_0x17571f){_0xd2964c=_0x17571f['access_token'];var _0x3f2bab={'method':'GET','uri':encodeURI(_0x52d15e+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x4da3d8+'\x27'),'headers':{'Authorization':_0xe8c2('0x99')+_0xd2964c,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3f2bab);})[_0xe8c2('0xd')](function(_0xdaf81){var _0x54a3d9=_0xdaf81['value'][0x0];var _0x23244c=_0x54a3d9['MetadataId'];var _0x510717={'method':'GET','uri':_0x52d15e+'EntityDefinitions('+_0x23244c+_0xe8c2('0x9a'),'headers':{'Authorization':_0xe8c2('0x99')+_0xd2964c,'If-None-Match':null,'OData-Version':_0xe8c2('0x9b')},'json':!![]};return rp(_0x510717);})[_0xe8c2('0xd')](function(_0x22ac49){_0x4cac98=_0x22ac49;_0x3cf982=_0x4cac98['Attributes'];_0x3cf982=_['remove'](_0x3cf982,function(_0x17de7e){return!_0x396029[_0xe8c2('0x9c')](_0x17de7e[_0xe8c2('0x9d')]);});var _0x86ce=[];var _0xb7dfb9=[];_0x3cf982[_0xe8c2('0x9e')](function(_0x8f0914){if(_0x8f0914[_0xe8c2('0x9f')]){var _0x49d4b9=_0x8f0914[_0xe8c2('0x9f')]['substring'](_0x8f0914[_0xe8c2('0x9f')][_0xe8c2('0x43')]('.')+0x1);if(_0x49d4b9===_0xe8c2('0xa0')){_0x86ce[_0xe8c2('0xa1')](getSelectList(_0x52d15e,_0x2e8343,_0xb7dfb9,_0x4cac98[_0xe8c2('0xa2')],_0x8f0914[_0xe8c2('0xa2')],_0xd2964c));}}});return Promise[_0xe8c2('0xa3')](_0x86ce);})['then'](function(_0x4220ea){_0xfafdc3=_0x4220ea[0x0];var _0x45706f=[];var _0x1bda30=[];_0x3cf982[_0xe8c2('0x9e')](function(_0x506217){if(!_[_0xe8c2('0xa4')](_0x506217['@odata.type'])){var _0xf3ebd1=_0x506217[_0xe8c2('0x9f')][_0xe8c2('0x42')](_0x506217[_0xe8c2('0x9f')][_0xe8c2('0x43')]('.')+0x1);if(_0xf3ebd1===_0xe8c2('0xa5')){_0x45706f[_0xe8c2('0xa1')](getBooleanList(_0x52d15e,_0x2e8343,_0x1bda30,_0x4cac98[_0xe8c2('0xa2')],_0x506217[_0xe8c2('0xa2')],_0xd2964c));}}});return Promise['all'](_0x45706f);})[_0xe8c2('0xd')](function(_0xf318e3){_0x266201=_0xf318e3[0x0];var _0x2b46d0=[];var _0x385669=[];_0x3cf982[_0xe8c2('0x9e')](function(_0x30a4f0){if(_0x30a4f0[_0xe8c2('0x9f')]){var _0x46cc5b=_0x30a4f0[_0xe8c2('0x9f')][_0xe8c2('0x42')](_0x30a4f0['@odata.type'][_0xe8c2('0x43')]('.')+0x1);if(_0x46cc5b===_0xe8c2('0xa6')||_0x46cc5b==='DoubleAttributeMetadata'||_0x46cc5b==='BigIntAttributeMetadata'||_0x46cc5b===_0xe8c2('0xa7')||_0x46cc5b===_0xe8c2('0xa8')||_0x46cc5b==='DateTimeAttributeMetadata'||_0x46cc5b===_0xe8c2('0xa9')||_0x46cc5b==='EntityNameAttributeMetadata'||_0x46cc5b===_0xe8c2('0xaa')||_0x46cc5b==='DecimalAttributeMetadata'){_0x2b46d0[_0xe8c2('0xa1')](getInputList(_0x52d15e,_0x2e8343,_0x46cc5b,_0x385669,_0x4cac98[_0xe8c2('0xa2')],_0x30a4f0[_0xe8c2('0xa2')],_0xd2964c));}}});return Promise[_0xe8c2('0xa3')](_0x2b46d0);})[_0xe8c2('0xd')](function(_0x4c2da7){_0x284603=_0x4c2da7[0x0];var _0x5f519c=_0xfafdc3['concat'](_0x266201)[_0xe8c2('0x8c')](_0x284603);var _0x5396ea={'count':_0x5f519c[_0xe8c2('0x21')],'rows':_0x5f519c};return _0x5396ea;})[_0xe8c2('0xd')](respondWithResult(_0x555b8e,null))[_0xe8c2('0x31')](function(_0x4fa0aa){var _0x4adbf6=_0x31a75f[_0xe8c2('0x1b')]['test']?0x1f4:_0x4fa0aa[_0xe8c2('0xab')]||0x1f4;logger[_0xe8c2('0x12')](_0x4fa0aa[_0xe8c2('0xac')]);delete _0x4fa0aa[_0xe8c2('0x13')];if(_0x4adbf6===0x191){_0x4adbf6=0x190;}_0x555b8e[_0xe8c2('0xf')](_0x4adbf6)[_0xe8c2('0xad')](_0x31a75f[_0xe8c2('0x1b')][_0xe8c2('0xae')]?{'message':_0xe8c2('0xaf'),'statusCode':_0x4fa0aa[_0xe8c2('0xab')]}:_0x4fa0aa);});};function getSelectList(_0x34a10c,_0x4f8ffc,_0x30be97,_0x38a342,_0x4fb191,_0x4b2580){var _0x4b73ed={'method':'GET','uri':_0x34a10c+'EntityDefinitions('+_0x38a342+_0xe8c2('0xb0')+_0x4fb191+_0xe8c2('0xb1')+_0xe8c2('0xb2'),'headers':{'Authorization':_0xe8c2('0x99')+_0x4b2580,'If-None-Match':null,'OData-Version':_0xe8c2('0x9b')},'json':!![]};return rp(_0x4b73ed)['then'](function(_0x4ff9ec){var _0x3d5ddb=[];var _0x284ed1=_0x4ff9ec[_0xe8c2('0xb3')][_0xe8c2('0xb4')];_0x284ed1[_0xe8c2('0x9e')](function(_0x27691c){_0x3d5ddb[_0xe8c2('0xa1')]({'name':_0x27691c['Label'][_0xe8c2('0xb5')]['Label'],'value':String(_0x27691c[_0xe8c2('0xb6')])});});var _0x9871e7={'id':_0x4f8ffc+'_'+_0x4ff9ec[_0xe8c2('0x9d')],'name':_0x4ff9ec[_0xe8c2('0xb7')][_0xe8c2('0xb5')]['Label'],'custom':![],'options':_0x3d5ddb};_0x30be97[_0xe8c2('0xa1')](_0x9871e7);return _0x30be97;});}function getBooleanList(_0x236829,_0xfd90a1,_0x4365f6,_0x3f76a9,_0x360a57,_0x6e9235){var _0x1d6656={'method':'GET','uri':_0x236829+_0xe8c2('0xb8')+_0x3f76a9+_0xe8c2('0xb0')+_0x360a57+_0xe8c2('0xb9'),'headers':{'Authorization':_0xe8c2('0x99')+_0x6e9235,'If-None-Match':null,'OData-Version':_0xe8c2('0x9b')},'json':!![]};return rp(_0x1d6656)[_0xe8c2('0xd')](function(_0x27b21d){var _0x1a9a4b=[];_0x1a9a4b[_0xe8c2('0xa1')]({'name':_0x27b21d[_0xe8c2('0xb3')][_0xe8c2('0xba')][_0xe8c2('0xbb')][_0xe8c2('0xb5')][_0xe8c2('0xbb')],'value':_0xe8c2('0xbc')},{'name':_0x27b21d['OptionSet'][_0xe8c2('0xbd')][_0xe8c2('0xbb')][_0xe8c2('0xb5')][_0xe8c2('0xbb')],'value':'false'});var _0x421546={'id':_0xfd90a1+'_'+_0x27b21d[_0xe8c2('0x9d')],'name':_0x27b21d[_0xe8c2('0xb7')][_0xe8c2('0xb5')]['Label'],'custom':![],'options':_0x1a9a4b};_0x4365f6['push'](_0x421546);return _0x4365f6;});}function getInputList(_0x5d762a,_0x4f81a6,_0x5a4db7,_0x453362,_0x4df406,_0x4ed585,_0x5b42e9){var _0x134f02={'method':_0xe8c2('0xbe'),'uri':_0x5d762a+'EntityDefinitions('+_0x4df406+_0xe8c2('0xb0')+_0x4ed585+')/Microsoft.Dynamics.CRM.'+_0x5a4db7+_0xe8c2('0xbf'),'headers':{'Authorization':_0xe8c2('0x99')+_0x5b42e9,'If-None-Match':null,'OData-Version':_0xe8c2('0x9b')},'json':!![]};return rp(_0x134f02)[_0xe8c2('0xd')](function(_0x1b82b8){var _0x2d5fff={'id':_0x4f81a6+'_'+_0x1b82b8[_0xe8c2('0x9d')],'name':_0x1b82b8['DisplayName']['UserLocalizedLabel']?_0x1b82b8[_0xe8c2('0xb7')]['UserLocalizedLabel']['Label']:_0x1b82b8[_0xe8c2('0x9d')],'custom':![],'options':[]};_0x453362[_0xe8c2('0xa1')](_0x2d5fff);return _0x453362;});} \ No newline at end of file +var _0xd878=['contractdetailidname','contractidname','createdbyexternalpartyname','createdbyname','createdon','createdonbehalfbyyominame','customeridtype','customeridyominame','entitlementidname','entityimage_url','escalatedon','exchangerate','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridyominame','parentcaseidname','primarycontactidyominame','prioritycodename','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','subjectidname','ticketnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','tenantId','clientSecret','CloudProvider','data5','data7','access_token','POST','https://login.microsoftonline.com/','/oauth2/token','password','GET','4.0','MetadataId','Bearer\x20','Attributes','remove','includes','forEach','@odata.type','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','Wrong\x20credentials','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Label','Value','LogicalName','DisplayName','UserLocalizedLabel',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','offset','undefined','limit','count','status','set','json','then','destroy','end','sendStatus','error','stack','send','index','map','Dynamics365Account','rawAttributes','fieldName','type','key','model','name','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','filter','options','include','rows','catch','intersection','includeAll','find','create','body','params','getConfigurations','findOne','sort','AccountId','Subjects','getSubjects','channel','getDescriptions','Dynamics365Configuration','Dynamics365Field','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields','Incident','customerid','caseorigincode','phonenumber','regardingobjectid','directioncode','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0xd878,0x118));var _0x8d87=function(_0xd4fd50,_0x40f63a){_0xd4fd50=_0xd4fd50-0x0;var _0x1efda2=_0xd878[_0xd4fd50];return _0x1efda2;};'use strict';var rp=require(_0x8d87('0x0'));var util=require(_0x8d87('0x1'));var _=require(_0x8d87('0x2'));var qs=require(_0x8d87('0x3'));var logger=require(_0x8d87('0x4'))(_0x8d87('0x5'));var db=require(_0x8d87('0x6'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithResult(_0x4e8e8d,_0x508913){_0x508913=_0x508913||0xc8;return function(_0x39829a){if(_0x39829a){return _0x4e8e8d['status'](_0x508913)['json'](_0x39829a);}};}function respondWithFilteredResult(_0x456998,_0x1b504e){return function(_0xcb4dae){if(_0xcb4dae){var _0x1eba92=typeof _0x1b504e[_0x8d87('0x7')]===_0x8d87('0x8')&&typeof _0x1b504e[_0x8d87('0x9')]===_0x8d87('0x8');var _0xf6aa49=_0xcb4dae['count'];var _0x207ac3=_0x1eba92?0x0:_0x1b504e['offset'];var _0x562e77=_0x1eba92?_0xcb4dae[_0x8d87('0xa')]:_0x1b504e[_0x8d87('0x7')]+_0x1b504e[_0x8d87('0x9')];var _0x10bb8f;if(_0x562e77>=_0xf6aa49){_0x562e77=_0xf6aa49;_0x10bb8f=0xc8;}else{_0x10bb8f=0xce;}_0x456998[_0x8d87('0xb')](_0x10bb8f);return _0x456998[_0x8d87('0xc')]('Content-Range',_0x207ac3+'-'+_0x562e77+'/'+_0xf6aa49)[_0x8d87('0xd')](_0xcb4dae);}return null;};}function saveUpdates(_0x5f0962){return function(_0xbe2fa0){if(_0xbe2fa0){return _0xbe2fa0['update'](_0x5f0962)[_0x8d87('0xe')](function(_0x98b85f){return _0x98b85f;});}return null;};}function removeEntity(_0x33c197){return function(_0x5703c3){if(_0x5703c3){return _0x5703c3[_0x8d87('0xf')]()[_0x8d87('0xe')](function(){_0x33c197[_0x8d87('0xb')](0xcc)[_0x8d87('0x10')]();});}};}function handleEntityNotFound(_0x5954d3){return function(_0x1d6695){if(!_0x1d6695){_0x5954d3[_0x8d87('0x11')](0x194);}return _0x1d6695;};}function handleError(_0x262833,_0x21d1dc){_0x21d1dc=_0x21d1dc||0x1f4;return function(_0x520df5){logger[_0x8d87('0x12')](_0x520df5[_0x8d87('0x13')]);if(_0x520df5['name']){delete _0x520df5['name'];}_0x262833[_0x8d87('0xb')](_0x21d1dc)[_0x8d87('0x14')](_0x520df5);};}exports[_0x8d87('0x15')]=function(_0x4fc4c6,_0x4380e1){var _0x3a3678={},_0x13df00={},_0xde0183={'count':0x0,'rows':[]};var _0x1e9555=_[_0x8d87('0x16')](db[_0x8d87('0x17')][_0x8d87('0x18')],function(_0x374ee1){return{'name':_0x374ee1[_0x8d87('0x19')],'type':_0x374ee1[_0x8d87('0x1a')][_0x8d87('0x1b')]};});_0x13df00[_0x8d87('0x1c')]=_[_0x8d87('0x16')](_0x1e9555,_0x8d87('0x1d'));_0x13df00[_0x8d87('0x1e')]=_[_0x8d87('0x1f')](_0x4fc4c6[_0x8d87('0x1e')]);_0x13df00[_0x8d87('0x20')]=_['intersection'](_0x13df00[_0x8d87('0x1c')],_0x13df00[_0x8d87('0x1e')]);_0x3a3678[_0x8d87('0x21')]=_['intersection'](_0x13df00[_0x8d87('0x1c')],qs[_0x8d87('0x22')](_0x4fc4c6[_0x8d87('0x1e')][_0x8d87('0x22')]));_0x3a3678[_0x8d87('0x21')]=_0x3a3678[_0x8d87('0x21')][_0x8d87('0x23')]?_0x3a3678[_0x8d87('0x21')]:_0x13df00[_0x8d87('0x1c')];if(!_0x4fc4c6[_0x8d87('0x1e')][_0x8d87('0x24')](_0x8d87('0x25'))){_0x3a3678[_0x8d87('0x9')]=qs[_0x8d87('0x9')](_0x4fc4c6[_0x8d87('0x1e')][_0x8d87('0x9')]);_0x3a3678[_0x8d87('0x7')]=qs[_0x8d87('0x7')](_0x4fc4c6[_0x8d87('0x1e')][_0x8d87('0x7')]);}_0x3a3678[_0x8d87('0x26')]=qs['sort'](_0x4fc4c6['query']['sort']);_0x3a3678[_0x8d87('0x27')]=qs[_0x8d87('0x20')](_[_0x8d87('0x28')](_0x4fc4c6[_0x8d87('0x1e')],_0x13df00['filters']),_0x1e9555);if(_0x4fc4c6[_0x8d87('0x1e')]['filter']){_0x3a3678['where']=_[_0x8d87('0x29')](_0x3a3678[_0x8d87('0x27')],{'$or':_[_0x8d87('0x16')](_0x1e9555,function(_0x1bf154){if(_0x1bf154[_0x8d87('0x1a')]!==_0x8d87('0x2a')){var _0x3701de={};_0x3701de[_0x1bf154[_0x8d87('0x1d')]]={'$like':'%'+_0x4fc4c6['query'][_0x8d87('0x2b')]+'%'};return _0x3701de;}})});}_0x3a3678=_[_0x8d87('0x29')]({},_0x3a3678,_0x4fc4c6[_0x8d87('0x2c')]);var _0x41fc95={'where':_0x3a3678['where']};return db[_0x8d87('0x17')][_0x8d87('0xa')](_0x41fc95)['then'](function(_0x51ccd3){_0xde0183[_0x8d87('0xa')]=_0x51ccd3;if(_0x4fc4c6[_0x8d87('0x1e')]['includeAll']){_0x3a3678[_0x8d87('0x2d')]=[{'all':!![]}];}return db[_0x8d87('0x17')]['findAll'](_0x3a3678);})[_0x8d87('0xe')](function(_0x448c5d){_0xde0183[_0x8d87('0x2e')]=_0x448c5d;return _0xde0183;})['then'](respondWithFilteredResult(_0x4380e1,_0x3a3678))[_0x8d87('0x2f')](handleError(_0x4380e1,null));};exports['show']=function(_0x7f5d73,_0x157647){var _0x19fe1f={'raw':![],'where':{'id':_0x7f5d73['params']['id']}},_0x30460a={};_0x30460a[_0x8d87('0x1c')]=_[_0x8d87('0x1f')](db['Dynamics365Account']['rawAttributes']);_0x30460a['query']=_['keys'](_0x7f5d73[_0x8d87('0x1e')]);_0x30460a[_0x8d87('0x20')]=_[_0x8d87('0x30')](_0x30460a['model'],_0x30460a[_0x8d87('0x1e')]);_0x19fe1f[_0x8d87('0x21')]=_['intersection'](_0x30460a['model'],qs[_0x8d87('0x22')](_0x7f5d73[_0x8d87('0x1e')]['fields']));_0x19fe1f[_0x8d87('0x21')]=_0x19fe1f[_0x8d87('0x21')][_0x8d87('0x23')]?_0x19fe1f['attributes']:_0x30460a[_0x8d87('0x1c')];if(_0x7f5d73[_0x8d87('0x1e')][_0x8d87('0x31')]){_0x19fe1f[_0x8d87('0x2d')]=[{'all':!![]}];}_0x19fe1f=_[_0x8d87('0x29')]({},_0x19fe1f,_0x7f5d73[_0x8d87('0x2c')]);return db[_0x8d87('0x17')][_0x8d87('0x32')](_0x19fe1f)['then'](handleEntityNotFound(_0x157647,null))[_0x8d87('0xe')](respondWithResult(_0x157647,null))[_0x8d87('0x2f')](handleError(_0x157647,null));};exports[_0x8d87('0x33')]=function(_0x2bbd46,_0x3b5e8e){return db[_0x8d87('0x17')][_0x8d87('0x33')](_0x2bbd46[_0x8d87('0x34')],{})[_0x8d87('0xe')](respondWithResult(_0x3b5e8e,0xc9))[_0x8d87('0x2f')](handleError(_0x3b5e8e,null));};exports['update']=function(_0x4419a9,_0x1877fe){if(_0x4419a9[_0x8d87('0x34')]['id']){delete _0x4419a9[_0x8d87('0x34')]['id'];}return db[_0x8d87('0x17')][_0x8d87('0x32')]({'where':{'id':_0x4419a9[_0x8d87('0x35')]['id']}})[_0x8d87('0xe')](handleEntityNotFound(_0x1877fe,null))[_0x8d87('0xe')](saveUpdates(_0x4419a9[_0x8d87('0x34')],null))[_0x8d87('0xe')](respondWithResult(_0x1877fe,null))['catch'](handleError(_0x1877fe,null));};exports[_0x8d87('0xf')]=function(_0x53319e,_0x42f4b6){return db[_0x8d87('0x17')][_0x8d87('0x32')]({'where':{'id':_0x53319e['params']['id']}})[_0x8d87('0xe')](handleEntityNotFound(_0x42f4b6,null))[_0x8d87('0xe')](removeEntity(_0x42f4b6,null))['catch'](handleError(_0x42f4b6,null));};exports[_0x8d87('0x36')]=function(_0x322e63,_0x495905){var _0x17d9d6={};var _0x14b5d5={};var _0x1a8d16;var _0x28a297;return db[_0x8d87('0x17')][_0x8d87('0x37')]({'where':{'id':_0x322e63[_0x8d87('0x35')]['id']}})[_0x8d87('0xe')](handleEntityNotFound(_0x495905,null))[_0x8d87('0xe')](function(_0x4b73bd){if(_0x4b73bd){_0x1a8d16=_0x4b73bd;_0x14b5d5[_0x8d87('0x1c')]=_[_0x8d87('0x1f')](db['Dynamics365Configuration'][_0x8d87('0x18')]);_0x14b5d5[_0x8d87('0x1e')]=_[_0x8d87('0x1f')](_0x322e63[_0x8d87('0x1e')]);_0x14b5d5[_0x8d87('0x20')]=_['intersection'](_0x14b5d5[_0x8d87('0x1c')],_0x14b5d5[_0x8d87('0x1e')]);_0x17d9d6[_0x8d87('0x21')]=_['intersection'](_0x14b5d5[_0x8d87('0x1c')],qs[_0x8d87('0x22')](_0x322e63['query'][_0x8d87('0x22')]));_0x17d9d6[_0x8d87('0x21')]=_0x17d9d6['attributes']['length']?_0x17d9d6[_0x8d87('0x21')]:_0x14b5d5[_0x8d87('0x1c')];_0x17d9d6[_0x8d87('0x26')]=qs[_0x8d87('0x38')](_0x322e63[_0x8d87('0x1e')][_0x8d87('0x38')]);_0x17d9d6[_0x8d87('0x27')]=qs['filters'](_['pick'](_0x322e63[_0x8d87('0x1e')],_0x14b5d5['filters']));if(_0x322e63[_0x8d87('0x1e')][_0x8d87('0x2b')]){_0x17d9d6[_0x8d87('0x27')]=_[_0x8d87('0x29')](_0x17d9d6[_0x8d87('0x27')],{'$or':_[_0x8d87('0x16')](_0x17d9d6[_0x8d87('0x21')],function(_0x5649ca){var _0x4fd82f={};_0x4fd82f[_0x5649ca]={'$like':'%'+_0x322e63[_0x8d87('0x1e')]['filter']+'%'};return _0x4fd82f;})});}_0x17d9d6=_['merge']({},_0x17d9d6,_0x322e63['options']);return _0x1a8d16[_0x8d87('0x36')](_0x17d9d6);}})[_0x8d87('0xe')](function(_0x4c9124){if(_0x4c9124){_0x28a297=_0x4c9124['length'];if(!_0x322e63[_0x8d87('0x1e')][_0x8d87('0x24')]('nolimit')){_0x17d9d6['limit']=qs[_0x8d87('0x9')](_0x322e63[_0x8d87('0x1e')]['limit']);_0x17d9d6[_0x8d87('0x7')]=qs[_0x8d87('0x7')](_0x322e63[_0x8d87('0x1e')][_0x8d87('0x7')]);}return _0x1a8d16[_0x8d87('0x36')](_0x17d9d6);}})[_0x8d87('0xe')](function(_0x3e6a79){if(_0x3e6a79){return _0x3e6a79?{'count':_0x28a297,'rows':_0x3e6a79}:null;}})[_0x8d87('0xe')](respondWithResult(_0x495905,null))[_0x8d87('0x2f')](handleError(_0x495905,null));};exports['addConfiguration']=function(_0x2d8f83,_0x6b6975){if(_0x2d8f83['body']['id']){delete _0x2d8f83[_0x8d87('0x34')]['id'];}return db[_0x8d87('0x17')][_0x8d87('0x37')]({'where':{'id':_0x2d8f83['params']['id']}})['then'](handleEntityNotFound(_0x6b6975,null))['then'](function(_0x16ed3f){if(_0x16ed3f){_0x2d8f83[_0x8d87('0x34')][_0x8d87('0x39')]=_0x16ed3f['id'];_0x2d8f83[_0x8d87('0x34')][_0x8d87('0x3a')]=integrations[_0x8d87('0x3b')](_0x2d8f83[_0x8d87('0x34')][_0x8d87('0x3c')],_0x2d8f83['body']['type']);_0x2d8f83['body']['Descriptions']=integrations[_0x8d87('0x3d')](_0x2d8f83[_0x8d87('0x34')][_0x8d87('0x3c')],_0x2d8f83['body'][_0x8d87('0x1a')]);return db[_0x8d87('0x3e')][_0x8d87('0x33')](_0x2d8f83[_0x8d87('0x34')],{'include':[{'model':db[_0x8d87('0x3f')],'as':_0x8d87('0x3a')},{'model':db['Dynamics365Field'],'as':'Descriptions'}]});}return null;})[_0x8d87('0xe')](respondWithResult(_0x6b6975,null))[_0x8d87('0x2f')](handleError(_0x6b6975,null));};function sanitizeRemoteUri(_0x5549f4){var _0x5da096=_0x5549f4[_0x8d87('0x40')](-0x1);if(_0x5da096==='/')return _0x5549f4[_0x8d87('0x41')](0x0,_0x5549f4[_0x8d87('0x42')](_0x5da096));return _0x5549f4;}function getWebApiUrl(_0x5e3cac){return util[_0x8d87('0x43')](_0x8d87('0x44'),_0x5e3cac);}exports[_0x8d87('0x45')]=function(_0x5e04c0,_0x2e09ca){var _0x452540=_0x5e04c0[_0x8d87('0x1e')]['ticketType'];var _0x115fde=_0x452540==='incident'?_0x8d87('0x46'):'PhoneCall';var _0x2431ae='';var _0x317c24='';var _0x1ede24='';var _0x5eb411='';var _0xb4624='';var _0x8e043d='';var _0xc8186='';var _0x50198b='';var _0x1dc39b=['title','description',_0x8d87('0x47'),'ownerid',_0x8d87('0x48'),'subject',_0x8d87('0x49'),_0x8d87('0x4a'),_0x8d87('0x4b'),'phonecall_activity_parties'];var _0x196a63=[_0x8d87('0x4c'),_0x8d87('0x4d'),_0x8d87('0x4e'),_0x8d87('0x4f'),_0x8d87('0x50'),_0x8d87('0x51'),_0x8d87('0x52'),_0x8d87('0x53'),_0x8d87('0x54'),'createdbyexternalpartyyominame',_0x8d87('0x55'),'createdbyyominame',_0x8d87('0x56'),'createdonbehalfbyname',_0x8d87('0x57'),'customeridname',_0x8d87('0x58'),_0x8d87('0x59'),'emailaddress',_0x8d87('0x5a'),'entityimage_timestamp',_0x8d87('0x5b'),_0x8d87('0x5c'),_0x8d87('0x5d'),'firstresponsebykpiidname',_0x8d87('0x5e'),_0x8d87('0x5f'),_0x8d87('0x60'),_0x8d87('0x61'),_0x8d87('0x62'),_0x8d87('0x63'),'modifiedbyexternalpartyname',_0x8d87('0x64'),_0x8d87('0x65'),_0x8d87('0x66'),_0x8d87('0x67'),'modifiedonbehalfbyname',_0x8d87('0x68'),_0x8d87('0x69'),'msdyn_iotalertname',_0x8d87('0x6a'),_0x8d87('0x6b'),_0x8d87('0x6c'),_0x8d87('0x6d'),'owneridtype',_0x8d87('0x6e'),_0x8d87('0x6f'),'primarycontactidname',_0x8d87('0x70'),_0x8d87('0x71'),'productidname',_0x8d87('0x72'),_0x8d87('0x73'),_0x8d87('0x74'),_0x8d87('0x75'),_0x8d87('0x76'),_0x8d87('0x77'),_0x8d87('0x78'),'slainvokedidname','slaname','socialprofileidname','statecode','statuscode',_0x8d87('0x79'),_0x8d87('0x7a'),'timezoneruleversionnumber',_0x8d87('0x7b'),_0x8d87('0x7c'),_0x8d87('0x7d'),_0x8d87('0x7e')];var _0xa2903e=_0x1dc39b[_0x8d87('0x7f')](_0x196a63);return db['Dynamics365Account']['findOne']({'where':{'id':_0x5e04c0[_0x8d87('0x35')]['id']},'attributes':['id',_0x8d87('0x80'),'password','remoteUri',_0x8d87('0x81'),'clientId',_0x8d87('0x82'),'modernAuthentication'],'include':[{'model':db[_0x8d87('0x83')],'as':_0x8d87('0x83'),'attributes':['id',_0x8d87('0x84'),_0x8d87('0x85')]}]})[_0x8d87('0xe')](handleEntityNotFound(_0x2e09ca,null))[_0x8d87('0xe')](function(_0x4e670b){if(_0x4e670b){if(_0x4e670b['modernAuthentication']){_0x4e670b[_0x8d87('0x86')]=_0x4e670b[_0x8d87('0x83')][_0x8d87('0x84')];_0x50198b=sanitizeRemoteUri(_0x4e670b['CloudProvider'][_0x8d87('0x85')]);_0xc8186=getWebApiUrl(_0x50198b);return _0x4e670b;}_0x50198b=sanitizeRemoteUri(_0x4e670b['remoteUri']);_0xc8186=getWebApiUrl(_0x50198b);var _0x17dc0a={'method':_0x8d87('0x87'),'uri':_0x8d87('0x88')+_0x4e670b[_0x8d87('0x81')]+_0x8d87('0x89'),'form':{'client_id':_0x4e670b['clientId'],'resource':_0x50198b,'username':_0x4e670b[_0x8d87('0x80')],'password':_0x4e670b[_0x8d87('0x8a')],'grant_type':_0x8d87('0x8a'),'client_secret':_0x4e670b[_0x8d87('0x82')]},'json':!![]};return rp(_0x17dc0a);}})[_0x8d87('0xe')](function(_0x16263a){_0x8e043d=_0x16263a['access_token'];var _0x2af99e={'method':_0x8d87('0x8b'),'uri':encodeURI(_0xc8186+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x115fde+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x8e043d,'If-None-Match':null,'OData-Version':_0x8d87('0x8c')},'json':!![]};return rp(_0x2af99e);})[_0x8d87('0xe')](function(_0x1fda71){var _0x187362=_0x1fda71['value'][0x0];var _0x1ca6a2=_0x187362[_0x8d87('0x8d')];var _0x2e1c70={'method':_0x8d87('0x8b'),'uri':_0xc8186+'EntityDefinitions('+_0x1ca6a2+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0x8d87('0x8e')+_0x8e043d,'If-None-Match':null,'OData-Version':_0x8d87('0x8c')},'json':!![]};return rp(_0x2e1c70);})[_0x8d87('0xe')](function(_0x55cf73){_0x2431ae=_0x55cf73;_0x317c24=_0x2431ae[_0x8d87('0x8f')];_0x317c24=_[_0x8d87('0x90')](_0x317c24,function(_0x2ff357){return!_0xa2903e[_0x8d87('0x91')](_0x2ff357['LogicalName']);});var _0x491c2d=[];var _0x2fb840=[];_0x317c24[_0x8d87('0x92')](function(_0x58aa26){if(_0x58aa26['@odata.type']){var _0x28f48f=_0x58aa26[_0x8d87('0x93')][_0x8d87('0x41')](_0x58aa26[_0x8d87('0x93')]['lastIndexOf']('.')+0x1);if(_0x28f48f==='PicklistAttributeMetadata'){_0x491c2d[_0x8d87('0x94')](getSelectList(_0xc8186,_0x452540,_0x2fb840,_0x2431ae[_0x8d87('0x8d')],_0x58aa26['MetadataId'],_0x8e043d));}}});return Promise[_0x8d87('0x95')](_0x491c2d);})[_0x8d87('0xe')](function(_0x3479fb){_0x1ede24=_0x3479fb[0x0];var _0x136806=[];var _0x2ae3ec=[];_0x317c24[_0x8d87('0x92')](function(_0xe02677){if(!_[_0x8d87('0x96')](_0xe02677[_0x8d87('0x93')])){var _0x22b034=_0xe02677[_0x8d87('0x93')]['substring'](_0xe02677[_0x8d87('0x93')][_0x8d87('0x42')]('.')+0x1);if(_0x22b034===_0x8d87('0x97')){_0x136806[_0x8d87('0x94')](getBooleanList(_0xc8186,_0x452540,_0x2ae3ec,_0x2431ae['MetadataId'],_0xe02677[_0x8d87('0x8d')],_0x8e043d));}}});return Promise['all'](_0x136806);})[_0x8d87('0xe')](function(_0x2cd8e9){_0x5eb411=_0x2cd8e9[0x0];var _0x27e72f=[];var _0x1c64bf=[];_0x317c24[_0x8d87('0x92')](function(_0xe2702c){if(_0xe2702c[_0x8d87('0x93')]){var _0x5b1faa=_0xe2702c[_0x8d87('0x93')][_0x8d87('0x41')](_0xe2702c['@odata.type'][_0x8d87('0x42')]('.')+0x1);if(_0x5b1faa===_0x8d87('0x98')||_0x5b1faa===_0x8d87('0x99')||_0x5b1faa===_0x8d87('0x9a')||_0x5b1faa===_0x8d87('0x9b')||_0x5b1faa===_0x8d87('0x9c')||_0x5b1faa===_0x8d87('0x9d')||_0x5b1faa===_0x8d87('0x9e')||_0x5b1faa===_0x8d87('0x9f')||_0x5b1faa===_0x8d87('0xa0')||_0x5b1faa===_0x8d87('0xa1')){_0x27e72f[_0x8d87('0x94')](getInputList(_0xc8186,_0x452540,_0x5b1faa,_0x1c64bf,_0x2431ae[_0x8d87('0x8d')],_0xe2702c[_0x8d87('0x8d')],_0x8e043d));}}});return Promise[_0x8d87('0x95')](_0x27e72f);})[_0x8d87('0xe')](function(_0x2a7d3f){_0xb4624=_0x2a7d3f[0x0];var _0x9faaec=_0x1ede24[_0x8d87('0x7f')](_0x5eb411)['concat'](_0xb4624);var _0x285c45={'count':_0x9faaec['length'],'rows':_0x9faaec};return _0x285c45;})[_0x8d87('0xe')](respondWithResult(_0x2e09ca,null))[_0x8d87('0x2f')](function(_0x47eb01){var _0x1b09fc=_0x5e04c0[_0x8d87('0x1e')][_0x8d87('0xa2')]?0x1f4:_0x47eb01[_0x8d87('0xa3')]||0x1f4;logger['error'](_0x47eb01[_0x8d87('0x13')]);delete _0x47eb01[_0x8d87('0x1d')];if(_0x1b09fc===0x191){_0x1b09fc=0x190;}_0x2e09ca[_0x8d87('0xb')](_0x1b09fc)[_0x8d87('0x14')](_0x5e04c0[_0x8d87('0x1e')][_0x8d87('0xa2')]?{'message':_0x8d87('0xa4'),'statusCode':_0x47eb01['statusCode']}:_0x47eb01);});};function getSelectList(_0x10eb82,_0x120be5,_0x1157df,_0xa58e93,_0x475a31,_0xa0ff47){var _0x132cfb={'method':_0x8d87('0x8b'),'uri':_0x10eb82+_0x8d87('0xa5')+_0xa58e93+_0x8d87('0xa6')+_0x475a31+_0x8d87('0xa7')+_0x8d87('0xa8'),'headers':{'Authorization':_0x8d87('0x8e')+_0xa0ff47,'If-None-Match':null,'OData-Version':_0x8d87('0x8c')},'json':!![]};return rp(_0x132cfb)[_0x8d87('0xe')](function(_0x4e132e){var _0x37fef7=[];var _0xca4a7b=_0x4e132e[_0x8d87('0xa9')]['Options'];_0xca4a7b['forEach'](function(_0x88296f){_0x37fef7[_0x8d87('0x94')]({'name':_0x88296f[_0x8d87('0xaa')]['UserLocalizedLabel'][_0x8d87('0xaa')],'value':String(_0x88296f[_0x8d87('0xab')])});});var _0x12ad31={'id':_0x120be5+'_'+_0x4e132e[_0x8d87('0xac')],'name':_0x4e132e[_0x8d87('0xad')][_0x8d87('0xae')][_0x8d87('0xaa')],'custom':![],'options':_0x37fef7};_0x1157df[_0x8d87('0x94')](_0x12ad31);return _0x1157df;});}function getBooleanList(_0x431931,_0x535490,_0x22c1cb,_0x4f0092,_0x48b3ee,_0x409eed){var _0x42afda={'method':_0x8d87('0x8b'),'uri':_0x431931+_0x8d87('0xa5')+_0x4f0092+_0x8d87('0xa6')+_0x48b3ee+_0x8d87('0xaf'),'headers':{'Authorization':_0x8d87('0x8e')+_0x409eed,'If-None-Match':null,'OData-Version':_0x8d87('0x8c')},'json':!![]};return rp(_0x42afda)[_0x8d87('0xe')](function(_0x17da06){var _0x5b78d8=[];_0x5b78d8[_0x8d87('0x94')]({'name':_0x17da06[_0x8d87('0xa9')][_0x8d87('0xb0')]['Label'][_0x8d87('0xae')][_0x8d87('0xaa')],'value':'true'},{'name':_0x17da06['OptionSet'][_0x8d87('0xb1')][_0x8d87('0xaa')]['UserLocalizedLabel'][_0x8d87('0xaa')],'value':_0x8d87('0xb2')});var _0x39b0c9={'id':_0x535490+'_'+_0x17da06[_0x8d87('0xac')],'name':_0x17da06[_0x8d87('0xad')][_0x8d87('0xae')]['Label'],'custom':![],'options':_0x5b78d8};_0x22c1cb[_0x8d87('0x94')](_0x39b0c9);return _0x22c1cb;});}function getInputList(_0x17995c,_0x32e155,_0x535031,_0x17681d,_0xb72c91,_0x1a66dd,_0x54696b){var _0x1e1a82={'method':_0x8d87('0x8b'),'uri':_0x17995c+'EntityDefinitions('+_0xb72c91+_0x8d87('0xa6')+_0x1a66dd+_0x8d87('0xb3')+_0x535031+_0x8d87('0xb4'),'headers':{'Authorization':_0x8d87('0x8e')+_0x54696b,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1e1a82)[_0x8d87('0xe')](function(_0x48d0fa){var _0x14f436={'id':_0x32e155+'_'+_0x48d0fa['LogicalName'],'name':_0x48d0fa['DisplayName'][_0x8d87('0xae')]?_0x48d0fa[_0x8d87('0xad')][_0x8d87('0xae')][_0x8d87('0xaa')]:_0x48d0fa[_0x8d87('0xac')],'custom':![],'options':[]};_0x17681d[_0x8d87('0x94')](_0x14f436);return _0x17681d;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 65c087b..45faa9e 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.model.js +++ b/server/api/intDynamics365Account/intDynamics365Account.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash','util'];(function(_0x46168d,_0x586ebe){var _0x315227=function(_0x1f4c98){while(--_0x1f4c98){_0x46168d['push'](_0x46168d['shift']());}};_0x315227(++_0x586ebe);}(_0xe706,0xa3));var _0x6e70=function(_0x451999,_0x1b3908){_0x451999=_0x451999-0x0;var _0x1b696e=_0xe706[_0x451999];return _0x1b696e;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));var integrations=require(_0x6e70('0xa'));module[_0x6e70('0xb')]=function(_0x4381d1,_0x36357b){return _0x4381d1[_0x6e70('0xc')](_0x6e70('0xd'),attributes,{'tableName':_0x6e70('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts'];(function(_0xcda377,_0x1e2678){var _0x1c024f=function(_0x1aeb61){while(--_0x1aeb61){_0xcda377['push'](_0xcda377['shift']());}};_0x1c024f(++_0x1e2678);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));var integrations=require(_0x3071('0x8'));module[_0x3071('0x9')]=function(_0x41cf76,_0x1d3dd6){return _0x41cf76[_0x3071('0xa')](_0x3071('0xb'),attributes,{'tableName':_0x3071('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 9cf8482..f4238b6 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 _0x0ffa=['code','message','result','GetDynamics365Account','Dynamics365Account','options','raw','where','limit','map','include','model','attributes','catch','find','ShowDynamics365Account','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3d4369,_0x1701eb){var _0xfc21c0=function(_0x2fe281){while(--_0x2fe281){_0x3d4369['push'](_0x3d4369['shift']());}};_0xfc21c0(++_0x1701eb);}(_0x0ffa,0x1f1));var _0xa0ff=function(_0x29db3a,_0x1d5b61){_0x29db3a=_0x29db3a-0x0;var _0x1c39e9=_0x0ffa[_0x29db3a];return _0x1c39e9;};'use strict';var _=require('lodash');var util=require(_0xa0ff('0x0'));var moment=require(_0xa0ff('0x1'));var BPromise=require('bluebird');var rs=require(_0xa0ff('0x2'));var fs=require('fs');var Redis=require(_0xa0ff('0x3'));var db=require(_0xa0ff('0x4'))['db'];var utils=require(_0xa0ff('0x5'));var logger=require(_0xa0ff('0x6'))(_0xa0ff('0x7'));var config=require(_0xa0ff('0x8'));var jayson=require(_0xa0ff('0x9'));var client=jayson[_0xa0ff('0xa')][_0xa0ff('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x293106,_0x424280,_0x13fe1e){return new BPromise(function(_0x11da12,_0x49d137){return client[_0xa0ff('0xc')](_0x293106,_0x13fe1e)[_0xa0ff('0xd')](function(_0x3ac4d4){logger[_0xa0ff('0xe')](_0xa0ff('0xf'),_0x424280,_0xa0ff('0x10'));logger[_0xa0ff('0x11')](_0xa0ff('0x12'),_0x424280,_0xa0ff('0x10'),JSON[_0xa0ff('0x13')](_0x3ac4d4));if(_0x3ac4d4[_0xa0ff('0x14')]){if(_0x3ac4d4[_0xa0ff('0x14')][_0xa0ff('0x15')]===0x1f4){logger[_0xa0ff('0x14')](_0xa0ff('0xf'),_0x424280,_0x3ac4d4[_0xa0ff('0x14')][_0xa0ff('0x16')]);return _0x49d137(_0x3ac4d4[_0xa0ff('0x14')][_0xa0ff('0x16')]);}logger['error'](_0xa0ff('0xf'),_0x424280,_0x3ac4d4[_0xa0ff('0x14')]['message']);return _0x11da12(_0x3ac4d4[_0xa0ff('0x14')][_0xa0ff('0x16')]);}else{logger[_0xa0ff('0xe')]('Dynamics365Account,\x20%s,\x20%s',_0x424280,_0xa0ff('0x10'));_0x11da12(_0x3ac4d4[_0xa0ff('0x17')]['message']);}})['catch'](function(_0x66041b){logger[_0xa0ff('0x14')](_0xa0ff('0xf'),_0x424280,_0x66041b);_0x49d137(_0x66041b);});});}exports[_0xa0ff('0x18')]=function(_0x3f101f){var _0x574950=this;return new Promise(function(_0x35b3d4,_0x1098a1){return db[_0xa0ff('0x19')]['findAll']({'raw':_0x3f101f[_0xa0ff('0x1a')]?_0x3f101f['options'][_0xa0ff('0x1b')]===undefined?!![]:![]:!![],'where':_0x3f101f[_0xa0ff('0x1a')]?_0x3f101f[_0xa0ff('0x1a')][_0xa0ff('0x1c')]||null:null,'attributes':_0x3f101f[_0xa0ff('0x1a')]?_0x3f101f[_0xa0ff('0x1a')]['attributes']||null:null,'limit':_0x3f101f['options']?_0x3f101f['options'][_0xa0ff('0x1d')]||null:null,'include':_0x3f101f[_0xa0ff('0x1a')]?_0x3f101f[_0xa0ff('0x1a')]['include']?_[_0xa0ff('0x1e')](_0x3f101f[_0xa0ff('0x1a')][_0xa0ff('0x1f')],function(_0xd9c279){return{'model':db[_0xd9c279[_0xa0ff('0x20')]],'as':_0xd9c279['as'],'attributes':_0xd9c279[_0xa0ff('0x21')],'include':_0xd9c279['include']?_[_0xa0ff('0x1e')](_0xd9c279['include'],function(_0x3f0483){return{'model':db[_0x3f0483['model']],'as':_0x3f0483['as'],'attributes':_0x3f0483[_0xa0ff('0x21')],'include':_0x3f0483[_0xa0ff('0x1f')]?_[_0xa0ff('0x1e')](_0x3f0483['include'],function(_0x5bd609){return{'model':db[_0x5bd609[_0xa0ff('0x20')]],'as':_0x5bd609['as'],'attributes':_0x5bd609[_0xa0ff('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x56156f){logger[_0xa0ff('0xe')](_0xa0ff('0x18'),_0x3f101f);logger['debug'](_0xa0ff('0x18'),_0x3f101f,JSON['stringify'](_0x56156f));_0x35b3d4(_0x56156f);})[_0xa0ff('0x22')](function(_0x248bdb){logger[_0xa0ff('0x14')](_0xa0ff('0x18'),_0x248bdb[_0xa0ff('0x16')],_0x3f101f);_0x1098a1(_0x574950['error'](0x1f4,_0x248bdb['message']));});});};exports['ShowDynamics365Account']=function(_0x481a09){var _0x486a35=this;return new Promise(function(_0x2e54b1,_0x28281f){return db[_0xa0ff('0x19')][_0xa0ff('0x23')]({'raw':_0x481a09[_0xa0ff('0x1a')]?_0x481a09[_0xa0ff('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x481a09[_0xa0ff('0x1a')]?_0x481a09[_0xa0ff('0x1a')][_0xa0ff('0x1c')]||null:null,'attributes':_0x481a09[_0xa0ff('0x1a')]?_0x481a09[_0xa0ff('0x1a')][_0xa0ff('0x21')]||null:null,'include':_0x481a09[_0xa0ff('0x1a')]?_0x481a09[_0xa0ff('0x1a')][_0xa0ff('0x1f')]?_[_0xa0ff('0x1e')](_0x481a09[_0xa0ff('0x1a')][_0xa0ff('0x1f')],function(_0x1c3dfe){return{'model':db[_0x1c3dfe[_0xa0ff('0x20')]],'as':_0x1c3dfe['as'],'attributes':_0x1c3dfe[_0xa0ff('0x21')],'include':_0x1c3dfe[_0xa0ff('0x1f')]?_[_0xa0ff('0x1e')](_0x1c3dfe[_0xa0ff('0x1f')],function(_0x4f2d4b){return{'model':db[_0x4f2d4b[_0xa0ff('0x20')]],'as':_0x4f2d4b['as'],'attributes':_0x4f2d4b['attributes'],'include':_0x4f2d4b[_0xa0ff('0x1f')]?_[_0xa0ff('0x1e')](_0x4f2d4b[_0xa0ff('0x1f')],function(_0x284d8d){return{'model':db[_0x284d8d[_0xa0ff('0x20')]],'as':_0x284d8d['as'],'attributes':_0x284d8d['attributes']};}):[]};}):[]};}):[]:[]})[_0xa0ff('0xd')](function(_0x27bdf8){logger[_0xa0ff('0xe')](_0xa0ff('0x24'),_0x481a09);logger[_0xa0ff('0x11')](_0xa0ff('0x24'),_0x481a09,JSON[_0xa0ff('0x13')](_0x27bdf8));_0x2e54b1(_0x27bdf8);})[_0xa0ff('0x22')](function(_0x38d037){logger[_0xa0ff('0x14')]('ShowDynamics365Account',_0x38d037[_0xa0ff('0x16')],_0x481a09);_0x28281f(_0x486a35[_0xa0ff('0x14')](0x1f4,_0x38d037['message']));});});}; \ No newline at end of file +var _0x9a85=['stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','code','message','info','Dynamics365Account','findAll','options','raw','where','attributes','limit','include','map','model','GetDynamics365Account','debug','catch','ShowDynamics365Account','then'];(function(_0x3f3696,_0x5f2351){var _0x29214d=function(_0x594cc3){while(--_0x594cc3){_0x3f3696['push'](_0x3f3696['shift']());}};_0x29214d(++_0x5f2351);}(_0x9a85,0xf6));var _0x59a8=function(_0x2a2166,_0x3a077f){_0x2a2166=_0x2a2166-0x0;var _0x3bcf50=_0x9a85[_0x2a2166];return _0x3bcf50;};'use strict';var _=require(_0x59a8('0x0'));var util=require(_0x59a8('0x1'));var moment=require(_0x59a8('0x2'));var BPromise=require(_0x59a8('0x3'));var rs=require(_0x59a8('0x4'));var fs=require('fs');var Redis=require(_0x59a8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x59a8('0x6'));var logger=require(_0x59a8('0x7'))(_0x59a8('0x8'));var config=require('../../config/environment');var jayson=require(_0x59a8('0x9'));var client=jayson['client'][_0x59a8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3fc8a1,_0x181325,_0x3b3af7){return new BPromise(function(_0x1916ca,_0x35bf42){return client[_0x59a8('0xb')](_0x3fc8a1,_0x3b3af7)['then'](function(_0x5345c2){logger['info'](_0x59a8('0xc'),_0x181325,_0x59a8('0xd'));logger['debug'](_0x59a8('0xe'),_0x181325,_0x59a8('0xd'),JSON['stringify'](_0x5345c2));if(_0x5345c2[_0x59a8('0xf')]){if(_0x5345c2[_0x59a8('0xf')][_0x59a8('0x10')]===0x1f4){logger[_0x59a8('0xf')]('Dynamics365Account,\x20%s,\x20%s',_0x181325,_0x5345c2[_0x59a8('0xf')]['message']);return _0x35bf42(_0x5345c2[_0x59a8('0xf')]['message']);}logger[_0x59a8('0xf')](_0x59a8('0xc'),_0x181325,_0x5345c2[_0x59a8('0xf')]['message']);return _0x1916ca(_0x5345c2['error'][_0x59a8('0x11')]);}else{logger[_0x59a8('0x12')]('Dynamics365Account,\x20%s,\x20%s',_0x181325,_0x59a8('0xd'));_0x1916ca(_0x5345c2['result'][_0x59a8('0x11')]);}})['catch'](function(_0x130086){logger[_0x59a8('0xf')](_0x59a8('0xc'),_0x181325,_0x130086);_0x35bf42(_0x130086);});});}exports['GetDynamics365Account']=function(_0x98347a){var _0x5b4246=this;return new Promise(function(_0x161cda,_0x5e3975){return db[_0x59a8('0x13')][_0x59a8('0x14')]({'raw':_0x98347a[_0x59a8('0x15')]?_0x98347a[_0x59a8('0x15')][_0x59a8('0x16')]===undefined?!![]:![]:!![],'where':_0x98347a[_0x59a8('0x15')]?_0x98347a[_0x59a8('0x15')][_0x59a8('0x17')]||null:null,'attributes':_0x98347a[_0x59a8('0x15')]?_0x98347a[_0x59a8('0x15')][_0x59a8('0x18')]||null:null,'limit':_0x98347a[_0x59a8('0x15')]?_0x98347a['options'][_0x59a8('0x19')]||null:null,'include':_0x98347a[_0x59a8('0x15')]?_0x98347a[_0x59a8('0x15')][_0x59a8('0x1a')]?_[_0x59a8('0x1b')](_0x98347a['options']['include'],function(_0xd5eda8){return{'model':db[_0xd5eda8[_0x59a8('0x1c')]],'as':_0xd5eda8['as'],'attributes':_0xd5eda8[_0x59a8('0x18')],'include':_0xd5eda8[_0x59a8('0x1a')]?_[_0x59a8('0x1b')](_0xd5eda8[_0x59a8('0x1a')],function(_0x591955){return{'model':db[_0x591955[_0x59a8('0x1c')]],'as':_0x591955['as'],'attributes':_0x591955[_0x59a8('0x18')],'include':_0x591955['include']?_[_0x59a8('0x1b')](_0x591955[_0x59a8('0x1a')],function(_0x3f0104){return{'model':db[_0x3f0104[_0x59a8('0x1c')]],'as':_0x3f0104['as'],'attributes':_0x3f0104[_0x59a8('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4fefda){logger[_0x59a8('0x12')](_0x59a8('0x1d'),_0x98347a);logger[_0x59a8('0x1e')](_0x59a8('0x1d'),_0x98347a,JSON['stringify'](_0x4fefda));_0x161cda(_0x4fefda);})[_0x59a8('0x1f')](function(_0x13bd94){logger[_0x59a8('0xf')](_0x59a8('0x1d'),_0x13bd94[_0x59a8('0x11')],_0x98347a);_0x5e3975(_0x5b4246[_0x59a8('0xf')](0x1f4,_0x13bd94[_0x59a8('0x11')]));});});};exports[_0x59a8('0x20')]=function(_0x2840e6){var _0x9a5d7=this;return new Promise(function(_0x40463f,_0x2c8c18){return db[_0x59a8('0x13')]['find']({'raw':_0x2840e6[_0x59a8('0x15')]?_0x2840e6[_0x59a8('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x2840e6[_0x59a8('0x15')]?_0x2840e6[_0x59a8('0x15')][_0x59a8('0x17')]||null:null,'attributes':_0x2840e6['options']?_0x2840e6[_0x59a8('0x15')]['attributes']||null:null,'include':_0x2840e6[_0x59a8('0x15')]?_0x2840e6[_0x59a8('0x15')][_0x59a8('0x1a')]?_[_0x59a8('0x1b')](_0x2840e6[_0x59a8('0x15')]['include'],function(_0xdfe223){return{'model':db[_0xdfe223[_0x59a8('0x1c')]],'as':_0xdfe223['as'],'attributes':_0xdfe223[_0x59a8('0x18')],'include':_0xdfe223[_0x59a8('0x1a')]?_[_0x59a8('0x1b')](_0xdfe223[_0x59a8('0x1a')],function(_0x5a53b6){return{'model':db[_0x5a53b6[_0x59a8('0x1c')]],'as':_0x5a53b6['as'],'attributes':_0x5a53b6['attributes'],'include':_0x5a53b6[_0x59a8('0x1a')]?_[_0x59a8('0x1b')](_0x5a53b6[_0x59a8('0x1a')],function(_0xe89a75){return{'model':db[_0xe89a75[_0x59a8('0x1c')]],'as':_0xe89a75['as'],'attributes':_0xe89a75['attributes']};}):[]};}):[]};}):[]:[]})[_0x59a8('0x21')](function(_0x5c7caf){logger['info'](_0x59a8('0x20'),_0x2840e6);logger['debug'](_0x59a8('0x20'),_0x2840e6,JSON[_0x59a8('0x22')](_0x5c7caf));_0x40463f(_0x5c7caf);})[_0x59a8('0x1f')](function(_0x47e2e0){logger[_0x59a8('0xf')]('ShowDynamics365Account',_0x47e2e0[_0x59a8('0x11')],_0x2840e6);_0x2c8c18(_0x9a5d7[_0x59a8('0xf')](0x1f4,_0x47e2e0['message']));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index d4bb5e3..278a075 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 _0xdeff=['exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','post','update','delete','destroy'];(function(_0xcd10a3,_0x1f7c3f){var _0x1beebe=function(_0xc7fc0e){while(--_0xc7fc0e){_0xcd10a3['push'](_0xcd10a3['shift']());}};_0x1beebe(++_0x1f7c3f);}(_0xdeff,0x151));var _0xfdef=function(_0x51fe5f,_0x1d8632){_0x51fe5f=_0x51fe5f-0x0;var _0x4abce9=_0xdeff[_0x51fe5f];return _0x4abce9;};'use strict';var multer=require(_0xfdef('0x0'));var util=require('util');var path=require(_0xfdef('0x1'));var timeout=require('connect-timeout');var express=require(_0xfdef('0x2'));var router=express['Router']();var fs_extra=require(_0xfdef('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xfdef('0x4'));var config=require(_0xfdef('0x5'));var controller=require(_0xfdef('0x6'));router[_0xfdef('0x7')]('/',auth[_0xfdef('0x8')](),controller[_0xfdef('0x9')]);router['get'](_0xfdef('0xa'),auth[_0xfdef('0x8')](),controller[_0xfdef('0xb')]);router['get'](_0xfdef('0xc'),auth['isAuthenticated'](),controller[_0xfdef('0xd')]);router[_0xfdef('0x7')]('/:id/subjects',auth[_0xfdef('0x8')](),controller[_0xfdef('0xe')]);router[_0xfdef('0x7')](_0xfdef('0xf'),auth[_0xfdef('0x8')](),controller['getDescriptions']);router[_0xfdef('0x10')]('/',auth[_0xfdef('0x8')](),controller['create']);router['put'](_0xfdef('0xa'),auth[_0xfdef('0x8')](),controller[_0xfdef('0x11')]);router[_0xfdef('0x12')](_0xfdef('0xa'),auth[_0xfdef('0x8')](),controller[_0xfdef('0x13')]);module[_0xfdef('0x14')]=router; \ No newline at end of file +var _0x3de3=['/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Configuration.controller','get','index','/:id','isAuthenticated','show'];(function(_0x4f0b3e,_0x412401){var _0x5da95b=function(_0x570485){while(--_0x570485){_0x4f0b3e['push'](_0x4f0b3e['shift']());}};_0x5da95b(++_0x412401);}(_0x3de3,0x1ce));var _0x33de=function(_0x3c1464,_0x5464dd){_0x3c1464=_0x3c1464-0x0;var _0x8f5247=_0x3de3[_0x3c1464];return _0x8f5247;};'use strict';var multer=require(_0x33de('0x0'));var util=require('util');var path=require(_0x33de('0x1'));var timeout=require(_0x33de('0x2'));var express=require('express');var router=express[_0x33de('0x3')]();var fs_extra=require(_0x33de('0x4'));var auth=require(_0x33de('0x5'));var interaction=require(_0x33de('0x6'));var config=require('../../config/environment');var controller=require(_0x33de('0x7'));router[_0x33de('0x8')]('/',auth['isAuthenticated'](),controller[_0x33de('0x9')]);router['get'](_0x33de('0xa'),auth[_0x33de('0xb')](),controller[_0x33de('0xc')]);router['get'](_0x33de('0xd'),auth[_0x33de('0xb')](),controller[_0x33de('0xe')]);router['get'](_0x33de('0xf'),auth[_0x33de('0xb')](),controller[_0x33de('0x10')]);router[_0x33de('0x8')](_0x33de('0x11'),auth[_0x33de('0xb')](),controller[_0x33de('0x12')]);router[_0x33de('0x13')]('/',auth[_0x33de('0xb')](),controller[_0x33de('0x14')]);router[_0x33de('0x15')]('/:id',auth[_0x33de('0xb')](),controller[_0x33de('0x16')]);router['delete']('/:id',auth[_0x33de('0xb')](),controller[_0x33de('0x17')]);module[_0x33de('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index bd4848d..b2edda1 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 _0x758f=['phonecall','contact','nothing','BOOLEAN','sequelize','exports','STRING','ENUM','incident'];(function(_0x33605e,_0x22ed43){var _0x4c9a93=function(_0x55dc2c){while(--_0x55dc2c){_0x33605e['push'](_0x33605e['shift']());}};_0x4c9a93(++_0x22ed43);}(_0x758f,0x1b4));var _0xf758=function(_0x5bbb86,_0x31386a){_0x5bbb86=_0x5bbb86-0x0;var _0x41f61d=_0x758f[_0x5bbb86];return _0x41f61d;};'use strict';var Sequelize=require(_0xf758('0x0'));module[_0xf758('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf758('0x2')]},'ticketType':{'type':Sequelize[_0xf758('0x3')](_0xf758('0x4'),_0xf758('0x5')),'defaultValue':_0xf758('0x4')},'moduleCreate':{'type':Sequelize[_0xf758('0x3')](_0xf758('0x6'),_0xf758('0x7')),'defaultValue':_0xf758('0x6'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize['STRING'],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0xf758('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0xbcb0=['nothing','BOOLEAN','sequelize','exports','STRING','incident','phonecall','ENUM','contact'];(function(_0x1279e0,_0x30599f){var _0x211a2b=function(_0x32f0c6){while(--_0x32f0c6){_0x1279e0['push'](_0x1279e0['shift']());}};_0x211a2b(++_0x30599f);}(_0xbcb0,0x80));var _0x0bcb=function(_0x1ca4f8,_0x5591b6){_0x1ca4f8=_0x1ca4f8-0x0;var _0x48f1af=_0xbcb0[_0x1ca4f8];return _0x48f1af;};'use strict';var Sequelize=require(_0x0bcb('0x0'));module[_0x0bcb('0x1')]={'name':{'type':Sequelize[_0x0bcb('0x2')]},'description':{'type':Sequelize[_0x0bcb('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0x0bcb('0x3'),_0x0bcb('0x4')),'defaultValue':_0x0bcb('0x3')},'moduleCreate':{'type':Sequelize[_0x0bcb('0x5')](_0x0bcb('0x6'),_0x0bcb('0x7')),'defaultValue':_0x0bcb('0x6'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x0bcb('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x0bcb('0x8')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 3c31fc1..9dfe429 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 _0x4b46=['type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','findOne','Dynamics365Field','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','Dynamics365Configuration','rawAttributes'];(function(_0x14ef29,_0x10916e){var _0x1cafd4=function(_0x35b250){while(--_0x35b250){_0x14ef29['push'](_0x14ef29['shift']());}};_0x1cafd4(++_0x10916e);}(_0x4b46,0x166));var _0x64b4=function(_0x136b83,_0x502e59){_0x136b83=_0x136b83-0x0;var _0x3aa63f=_0x4b46[_0x136b83];return _0x3aa63f;};'use strict';var emlformat=require(_0x64b4('0x0'));var rimraf=require(_0x64b4('0x1'));var zipdir=require(_0x64b4('0x2'));var jsonpatch=require(_0x64b4('0x3'));var rp=require(_0x64b4('0x4'));var moment=require(_0x64b4('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x64b4('0x6'));var util=require(_0x64b4('0x7'));var path=require(_0x64b4('0x8'));var sox=require('sox');var csv=require(_0x64b4('0x9'));var ejs=require(_0x64b4('0xa'));var fs=require('fs');var fs_extra=require(_0x64b4('0xb'));var _=require('lodash');var squel=require(_0x64b4('0xc'));var crypto=require(_0x64b4('0xd'));var jsforce=require(_0x64b4('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x64b4('0x9'));var querystring=require(_0x64b4('0xf'));var Papa=require(_0x64b4('0x10'));var Redis=require(_0x64b4('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x64b4('0x12'));var hardwareService=require(_0x64b4('0x13'));var logger=require(_0x64b4('0x14'))(_0x64b4('0x15'));var utils=require(_0x64b4('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c37f2,_0x293365){_0x293365=_0x293365||0xcc;return function(_0x1d2bb5){if(_0x1d2bb5){return _0x2c37f2[_0x64b4('0x17')](_0x293365);}return _0x2c37f2['status'](_0x293365)[_0x64b4('0x18')]();};}function respondWithResult(_0x17afef,_0x567408){_0x567408=_0x567408||0xc8;return function(_0x4a6523){if(_0x4a6523){return _0x17afef[_0x64b4('0x19')](_0x567408)[_0x64b4('0x1a')](_0x4a6523);}};}function respondWithFilteredResult(_0x4d1685,_0x4d465a){return function(_0x56cb4f){if(_0x56cb4f){var _0x28a01d=typeof _0x4d465a[_0x64b4('0x1b')]==='undefined'&&typeof _0x4d465a[_0x64b4('0x1c')]===_0x64b4('0x1d');var _0x20d37b=_0x56cb4f['count'];var _0x73fdc=_0x28a01d?0x0:_0x4d465a[_0x64b4('0x1b')];var _0x5e37c0=_0x28a01d?_0x56cb4f[_0x64b4('0x1e')]:_0x4d465a[_0x64b4('0x1b')]+_0x4d465a[_0x64b4('0x1c')];var _0x437228;if(_0x5e37c0>=_0x20d37b){_0x5e37c0=_0x20d37b;_0x437228=0xc8;}else{_0x437228=0xce;}_0x4d1685[_0x64b4('0x19')](_0x437228);return _0x4d1685[_0x64b4('0x1f')](_0x64b4('0x20'),_0x73fdc+'-'+_0x5e37c0+'/'+_0x20d37b)[_0x64b4('0x1a')](_0x56cb4f);}return null;};}function patchUpdates(_0x5e24f7){return function(_0x1b90c0){try{jsonpatch[_0x64b4('0x21')](_0x1b90c0,_0x5e24f7,!![]);}catch(_0x5f1fcd){return BPromise[_0x64b4('0x22')](_0x5f1fcd);}return _0x1b90c0[_0x64b4('0x23')]();};}function saveUpdates(_0x2123eb,_0x3a484e){return function(_0x581584){if(_0x581584){return _0x581584[_0x64b4('0x24')](_0x2123eb)['then'](function(_0x397f1a){return _0x397f1a;});}return null;};}function removeEntity(_0xb95ec6,_0x5d6d95){return function(_0x463d53){if(_0x463d53){return _0x463d53[_0x64b4('0x25')]()[_0x64b4('0x26')](function(){_0xb95ec6['status'](0xcc)[_0x64b4('0x18')]();});}};}function handleEntityNotFound(_0x1648d4,_0x11f3f6){return function(_0x1b9d72){if(!_0x1b9d72){_0x1648d4[_0x64b4('0x17')](0x194);}return _0x1b9d72;};}function handleError(_0x2595f8,_0x567929){_0x567929=_0x567929||0x1f4;return function(_0x561e45){logger[_0x64b4('0x27')](_0x561e45[_0x64b4('0x28')]);if(_0x561e45[_0x64b4('0x29')]){delete _0x561e45[_0x64b4('0x29')];}_0x2595f8[_0x64b4('0x19')](_0x567929)[_0x64b4('0x2a')](_0x561e45);};}exports[_0x64b4('0x2b')]=function(_0x56c625,_0x22d73c){var _0x1c5a30={},_0x4f60c9={},_0x5c3841={'count':0x0,'rows':[]};var _0x309aea=_[_0x64b4('0x2c')](db[_0x64b4('0x2d')][_0x64b4('0x2e')],function(_0x28fa0f){return{'name':_0x28fa0f['fieldName'],'type':_0x28fa0f[_0x64b4('0x2f')][_0x64b4('0x30')]};});_0x4f60c9['model']=_[_0x64b4('0x2c')](_0x309aea,'name');_0x4f60c9[_0x64b4('0x31')]=_[_0x64b4('0x32')](_0x56c625['query']);_0x4f60c9[_0x64b4('0x33')]=_[_0x64b4('0x34')](_0x4f60c9[_0x64b4('0x35')],_0x4f60c9[_0x64b4('0x31')]);_0x1c5a30[_0x64b4('0x36')]=_[_0x64b4('0x34')](_0x4f60c9['model'],qs[_0x64b4('0x37')](_0x56c625['query'][_0x64b4('0x37')]));_0x1c5a30[_0x64b4('0x36')]=_0x1c5a30['attributes'][_0x64b4('0x38')]?_0x1c5a30[_0x64b4('0x36')]:_0x4f60c9[_0x64b4('0x35')];if(!_0x56c625[_0x64b4('0x31')][_0x64b4('0x39')](_0x64b4('0x3a'))){_0x1c5a30['limit']=qs[_0x64b4('0x1c')](_0x56c625[_0x64b4('0x31')][_0x64b4('0x1c')]);_0x1c5a30[_0x64b4('0x1b')]=qs['offset'](_0x56c625[_0x64b4('0x31')][_0x64b4('0x1b')]);}_0x1c5a30[_0x64b4('0x3b')]=qs[_0x64b4('0x3c')](_0x56c625[_0x64b4('0x31')]['sort']);_0x1c5a30[_0x64b4('0x3d')]=qs[_0x64b4('0x33')](_[_0x64b4('0x3e')](_0x56c625['query'],_0x4f60c9[_0x64b4('0x33')]),_0x309aea);if(_0x56c625[_0x64b4('0x31')][_0x64b4('0x3f')]){_0x1c5a30[_0x64b4('0x3d')]=_[_0x64b4('0x40')](_0x1c5a30[_0x64b4('0x3d')],{'$or':_[_0x64b4('0x2c')](_0x309aea,function(_0x35c7ba){if(_0x35c7ba['type']!==_0x64b4('0x41')){var _0x3f08cd={};_0x3f08cd[_0x35c7ba['name']]={'$like':'%'+_0x56c625[_0x64b4('0x31')][_0x64b4('0x3f')]+'%'};return _0x3f08cd;}})});}_0x1c5a30=_['merge']({},_0x1c5a30,_0x56c625[_0x64b4('0x42')]);var _0x35acdc={'where':_0x1c5a30['where']};return db[_0x64b4('0x2d')][_0x64b4('0x1e')](_0x35acdc)['then'](function(_0x5a04c2){_0x5c3841['count']=_0x5a04c2;if(_0x56c625['query'][_0x64b4('0x43')]){_0x1c5a30[_0x64b4('0x44')]=[{'all':!![]}];}return db[_0x64b4('0x2d')][_0x64b4('0x45')](_0x1c5a30);})[_0x64b4('0x26')](function(_0x14f007){_0x5c3841['rows']=_0x14f007;return _0x5c3841;})['then'](respondWithFilteredResult(_0x22d73c,_0x1c5a30))[_0x64b4('0x46')](handleError(_0x22d73c,null));};exports[_0x64b4('0x47')]=function(_0x4b3ead,_0x970587){var _0x5179ef={'raw':![],'where':{'id':_0x4b3ead[_0x64b4('0x48')]['id']}},_0x4478c1={};_0x4478c1[_0x64b4('0x35')]=_[_0x64b4('0x32')](db[_0x64b4('0x2d')][_0x64b4('0x2e')]);_0x4478c1['query']=_['keys'](_0x4b3ead[_0x64b4('0x31')]);_0x4478c1[_0x64b4('0x33')]=_[_0x64b4('0x34')](_0x4478c1['model'],_0x4478c1['query']);_0x5179ef['attributes']=_[_0x64b4('0x34')](_0x4478c1[_0x64b4('0x35')],qs[_0x64b4('0x37')](_0x4b3ead['query'][_0x64b4('0x37')]));_0x5179ef[_0x64b4('0x36')]=_0x5179ef[_0x64b4('0x36')]['length']?_0x5179ef['attributes']:_0x4478c1[_0x64b4('0x35')];if(_0x4b3ead[_0x64b4('0x31')]['includeAll']){_0x5179ef[_0x64b4('0x44')]=[{'all':!![]}];}_0x5179ef=_['merge']({},_0x5179ef,_0x4b3ead['options']);return db[_0x64b4('0x2d')][_0x64b4('0x49')](_0x5179ef)['then'](handleEntityNotFound(_0x970587,null))[_0x64b4('0x26')](respondWithResult(_0x970587,null))[_0x64b4('0x46')](handleError(_0x970587,null));};exports[_0x64b4('0x4a')]=function(_0x21743d,_0x247093){return db[_0x64b4('0x2d')][_0x64b4('0x4a')](_0x21743d[_0x64b4('0x4b')],{})[_0x64b4('0x26')](respondWithResult(_0x247093,0xc9))[_0x64b4('0x46')](handleError(_0x247093,null));};exports[_0x64b4('0x24')]=function(_0x407370,_0x229fd6){if(_0x407370[_0x64b4('0x4b')]['id']){delete _0x407370[_0x64b4('0x4b')]['id'];}return db['Dynamics365Configuration'][_0x64b4('0x49')]({'where':{'id':_0x407370[_0x64b4('0x48')]['id']}})['then'](handleEntityNotFound(_0x229fd6,null))[_0x64b4('0x26')](saveUpdates(_0x407370['body'],null))[_0x64b4('0x26')](respondWithResult(_0x229fd6,null))['catch'](handleError(_0x229fd6,null));};exports[_0x64b4('0x25')]=function(_0x1d063f,_0x3b93d8){return db['Dynamics365Configuration']['find']({'where':{'id':_0x1d063f[_0x64b4('0x48')]['id']}})[_0x64b4('0x26')](handleEntityNotFound(_0x3b93d8,null))[_0x64b4('0x26')](removeEntity(_0x3b93d8,null))['catch'](handleError(_0x3b93d8,null));};exports['getFields']=function(_0x221650,_0x16a817,_0x893b7b){var _0x119b84={};var _0x5c5fa7={};var _0x465c93;var _0x5043d1;return db[_0x64b4('0x2d')][_0x64b4('0x4c')]({'where':{'id':_0x221650[_0x64b4('0x48')]['id']}})[_0x64b4('0x26')](handleEntityNotFound(_0x16a817,null))['then'](function(_0x2a2074){if(_0x2a2074){_0x465c93=_0x2a2074;_0x5c5fa7[_0x64b4('0x35')]=_['keys'](db[_0x64b4('0x4d')][_0x64b4('0x2e')]);_0x5c5fa7[_0x64b4('0x31')]=_[_0x64b4('0x32')](_0x221650['query']);_0x5c5fa7['filters']=_['intersection'](_0x5c5fa7[_0x64b4('0x35')],_0x5c5fa7[_0x64b4('0x31')]);_0x119b84[_0x64b4('0x36')]=_[_0x64b4('0x34')](_0x5c5fa7[_0x64b4('0x35')],qs[_0x64b4('0x37')](_0x221650['query'][_0x64b4('0x37')]));_0x119b84[_0x64b4('0x36')]=_0x119b84['attributes']['length']?_0x119b84[_0x64b4('0x36')]:_0x5c5fa7[_0x64b4('0x35')];_0x119b84['order']=qs['sort'](_0x221650['query'][_0x64b4('0x3c')]);_0x119b84[_0x64b4('0x3d')]=qs[_0x64b4('0x33')](_[_0x64b4('0x3e')](_0x221650[_0x64b4('0x31')],_0x5c5fa7['filters']));if(_0x221650[_0x64b4('0x31')]['filter']){_0x119b84[_0x64b4('0x3d')]=_[_0x64b4('0x40')](_0x119b84[_0x64b4('0x3d')],{'$or':_[_0x64b4('0x2c')](_0x119b84['attributes'],function(_0x1af9fc){var _0x438a8c={};_0x438a8c[_0x1af9fc]={'$like':'%'+_0x221650[_0x64b4('0x31')][_0x64b4('0x3f')]+'%'};return _0x438a8c;})});}_0x119b84=_[_0x64b4('0x40')]({},_0x119b84,_0x221650[_0x64b4('0x42')]);return _0x465c93['getFields'](_0x119b84);}})[_0x64b4('0x26')](function(_0x241cfe){if(_0x241cfe){_0x5043d1=_0x241cfe[_0x64b4('0x38')];if(!_0x221650['query'][_0x64b4('0x39')](_0x64b4('0x3a'))){_0x119b84[_0x64b4('0x1c')]=qs[_0x64b4('0x1c')](_0x221650[_0x64b4('0x31')][_0x64b4('0x1c')]);_0x119b84[_0x64b4('0x1b')]=qs[_0x64b4('0x1b')](_0x221650[_0x64b4('0x31')][_0x64b4('0x1b')]);}return _0x465c93[_0x64b4('0x4e')](_0x119b84);}})[_0x64b4('0x26')](function(_0x1967a7){if(_0x1967a7){return _0x1967a7?{'count':_0x5043d1,'rows':_0x1967a7}:null;}})['then'](respondWithResult(_0x16a817,null))['catch'](handleError(_0x16a817,null));};exports['getSubjects']=function(_0x448a2d,_0x3ff8af,_0x664a8c){var _0xae44d3={};var _0x14d913={};var _0x3d30d2;var _0x498440;return db[_0x64b4('0x2d')][_0x64b4('0x4c')]({'where':{'id':_0x448a2d[_0x64b4('0x48')]['id']}})[_0x64b4('0x26')](handleEntityNotFound(_0x3ff8af,null))[_0x64b4('0x26')](function(_0x17e80b){if(_0x17e80b){_0x3d30d2=_0x17e80b;_0x14d913[_0x64b4('0x35')]=_['keys'](db[_0x64b4('0x4d')][_0x64b4('0x2e')]);_0x14d913['query']=_[_0x64b4('0x32')](_0x448a2d['query']);_0x14d913[_0x64b4('0x33')]=_[_0x64b4('0x34')](_0x14d913[_0x64b4('0x35')],_0x14d913['query']);_0xae44d3[_0x64b4('0x36')]=_[_0x64b4('0x34')](_0x14d913['model'],qs[_0x64b4('0x37')](_0x448a2d[_0x64b4('0x31')][_0x64b4('0x37')]));_0xae44d3[_0x64b4('0x36')]=_0xae44d3[_0x64b4('0x36')][_0x64b4('0x38')]?_0xae44d3[_0x64b4('0x36')]:_0x14d913[_0x64b4('0x35')];_0xae44d3[_0x64b4('0x3b')]=qs[_0x64b4('0x3c')](_0x448a2d[_0x64b4('0x31')]['sort']);_0xae44d3[_0x64b4('0x3d')]=qs[_0x64b4('0x33')](_[_0x64b4('0x3e')](_0x448a2d['query'],_0x14d913['filters']));if(_0x448a2d[_0x64b4('0x31')][_0x64b4('0x3f')]){_0xae44d3['where']=_[_0x64b4('0x40')](_0xae44d3[_0x64b4('0x3d')],{'$or':_[_0x64b4('0x2c')](_0xae44d3[_0x64b4('0x36')],function(_0x4bdf6c){var _0x4273a8={};_0x4273a8[_0x4bdf6c]={'$like':'%'+_0x448a2d[_0x64b4('0x31')]['filter']+'%'};return _0x4273a8;})});}_0xae44d3=_[_0x64b4('0x40')]({},_0xae44d3,_0x448a2d[_0x64b4('0x42')]);return _0x3d30d2[_0x64b4('0x4f')](_0xae44d3);}})[_0x64b4('0x26')](function(_0x59447f){if(_0x59447f){_0x498440=_0x59447f['length'];if(!_0x448a2d[_0x64b4('0x31')][_0x64b4('0x39')]('nolimit')){_0xae44d3[_0x64b4('0x1c')]=qs[_0x64b4('0x1c')](_0x448a2d[_0x64b4('0x31')][_0x64b4('0x1c')]);_0xae44d3['offset']=qs[_0x64b4('0x1b')](_0x448a2d['query'][_0x64b4('0x1b')]);}return _0x3d30d2['getSubjects'](_0xae44d3);}})[_0x64b4('0x26')](function(_0xd1c91e){if(_0xd1c91e){return _0xd1c91e?{'count':_0x498440,'rows':_0xd1c91e}:null;}})['then'](respondWithResult(_0x3ff8af,null))[_0x64b4('0x46')](handleError(_0x3ff8af,null));};exports['getDescriptions']=function(_0x5ae727,_0x454fd9,_0x174ce1){var _0x233792={};var _0x10f770={};var _0x6af206;var _0x378dfa;return db[_0x64b4('0x2d')][_0x64b4('0x4c')]({'where':{'id':_0x5ae727[_0x64b4('0x48')]['id']}})[_0x64b4('0x26')](handleEntityNotFound(_0x454fd9,null))[_0x64b4('0x26')](function(_0x51d9d2){if(_0x51d9d2){_0x6af206=_0x51d9d2;_0x10f770[_0x64b4('0x35')]=_[_0x64b4('0x32')](db['Dynamics365Field'][_0x64b4('0x2e')]);_0x10f770[_0x64b4('0x31')]=_[_0x64b4('0x32')](_0x5ae727[_0x64b4('0x31')]);_0x10f770[_0x64b4('0x33')]=_[_0x64b4('0x34')](_0x10f770[_0x64b4('0x35')],_0x10f770['query']);_0x233792[_0x64b4('0x36')]=_[_0x64b4('0x34')](_0x10f770[_0x64b4('0x35')],qs['fields'](_0x5ae727[_0x64b4('0x31')][_0x64b4('0x37')]));_0x233792[_0x64b4('0x36')]=_0x233792[_0x64b4('0x36')][_0x64b4('0x38')]?_0x233792[_0x64b4('0x36')]:_0x10f770[_0x64b4('0x35')];_0x233792[_0x64b4('0x3b')]=qs[_0x64b4('0x3c')](_0x5ae727[_0x64b4('0x31')]['sort']);_0x233792[_0x64b4('0x3d')]=qs[_0x64b4('0x33')](_[_0x64b4('0x3e')](_0x5ae727[_0x64b4('0x31')],_0x10f770['filters']));if(_0x5ae727[_0x64b4('0x31')][_0x64b4('0x3f')]){_0x233792[_0x64b4('0x3d')]=_['merge'](_0x233792['where'],{'$or':_[_0x64b4('0x2c')](_0x233792[_0x64b4('0x36')],function(_0x1f7d52){var _0x13ea1d={};_0x13ea1d[_0x1f7d52]={'$like':'%'+_0x5ae727[_0x64b4('0x31')][_0x64b4('0x3f')]+'%'};return _0x13ea1d;})});}_0x233792=_[_0x64b4('0x40')]({},_0x233792,_0x5ae727[_0x64b4('0x42')]);return _0x6af206['getDescriptions'](_0x233792);}})[_0x64b4('0x26')](function(_0x21dfca){if(_0x21dfca){_0x378dfa=_0x21dfca['length'];if(!_0x5ae727[_0x64b4('0x31')][_0x64b4('0x39')](_0x64b4('0x3a'))){_0x233792['limit']=qs[_0x64b4('0x1c')](_0x5ae727[_0x64b4('0x31')][_0x64b4('0x1c')]);_0x233792[_0x64b4('0x1b')]=qs[_0x64b4('0x1b')](_0x5ae727[_0x64b4('0x31')][_0x64b4('0x1b')]);}return _0x6af206[_0x64b4('0x50')](_0x233792);}})['then'](function(_0x1d0ed6){if(_0x1d0ed6){return _0x1d0ed6?{'count':_0x378dfa,'rows':_0x1d0ed6}:null;}})['then'](respondWithResult(_0x454fd9,null))['catch'](handleError(_0x454fd9,null));}; \ No newline at end of file +var _0xf766=['fields','hasOwnProperty','nolimit','sort','where','pick','merge','options','includeAll','include','findAll','rows','keys','intersection','length','find','create','body','catch','params','getFields','findOne','Dynamics365Field','order','filter','getSubjects','getDescriptions','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','query','filters','model','attributes'];(function(_0x2b94b4,_0x8f878){var _0x41b774=function(_0x80cfc5){while(--_0x80cfc5){_0x2b94b4['push'](_0x2b94b4['shift']());}};_0x41b774(++_0x8f878);}(_0xf766,0x1b5));var _0x6f76=function(_0x254d9f,_0x54ddb5){_0x254d9f=_0x254d9f-0x0;var _0x1eedb9=_0xf766[_0x254d9f];return _0x1eedb9;};'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(_0x6f76('0x0'));var moment=require(_0x6f76('0x1'));var BPromise=require(_0x6f76('0x2'));var Mustache=require(_0x6f76('0x3'));var util=require(_0x6f76('0x4'));var path=require('path');var sox=require(_0x6f76('0x5'));var csv=require(_0x6f76('0x6'));var ejs=require(_0x6f76('0x7'));var fs=require('fs');var fs_extra=require(_0x6f76('0x8'));var _=require(_0x6f76('0x9'));var squel=require(_0x6f76('0xa'));var crypto=require(_0x6f76('0xb'));var jsforce=require(_0x6f76('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6f76('0x6'));var querystring=require('querystring');var Papa=require(_0x6f76('0xd'));var Redis=require(_0x6f76('0xe'));var authService=require(_0x6f76('0xf'));var qs=require(_0x6f76('0x10'));var as=require(_0x6f76('0x11'));var hardwareService=require(_0x6f76('0x12'));var logger=require(_0x6f76('0x13'))(_0x6f76('0x14'));var utils=require(_0x6f76('0x15'));var config=require(_0x6f76('0x16'));var licenseUtil=require(_0x6f76('0x17'));var db=require(_0x6f76('0x18'))['db'];function respondWithStatusCode(_0x4f541a,_0x7b1af6){_0x7b1af6=_0x7b1af6||0xcc;return function(_0x3b9b5f){if(_0x3b9b5f){return _0x4f541a['sendStatus'](_0x7b1af6);}return _0x4f541a['status'](_0x7b1af6)[_0x6f76('0x19')]();};}function respondWithResult(_0x2f0a55,_0x2d3a05){_0x2d3a05=_0x2d3a05||0xc8;return function(_0x4b0da1){if(_0x4b0da1){return _0x2f0a55[_0x6f76('0x1a')](_0x2d3a05)[_0x6f76('0x1b')](_0x4b0da1);}};}function respondWithFilteredResult(_0x21af50,_0x342ff9){return function(_0x2206cc){if(_0x2206cc){var _0x2746e9=typeof _0x342ff9[_0x6f76('0x1c')]===_0x6f76('0x1d')&&typeof _0x342ff9['limit']===_0x6f76('0x1d');var _0x383b7d=_0x2206cc[_0x6f76('0x1e')];var _0x5205e9=_0x2746e9?0x0:_0x342ff9[_0x6f76('0x1c')];var _0x4211ad=_0x2746e9?_0x2206cc[_0x6f76('0x1e')]:_0x342ff9[_0x6f76('0x1c')]+_0x342ff9[_0x6f76('0x1f')];var _0x287c95;if(_0x4211ad>=_0x383b7d){_0x4211ad=_0x383b7d;_0x287c95=0xc8;}else{_0x287c95=0xce;}_0x21af50[_0x6f76('0x1a')](_0x287c95);return _0x21af50[_0x6f76('0x20')]('Content-Range',_0x5205e9+'-'+_0x4211ad+'/'+_0x383b7d)['json'](_0x2206cc);}return null;};}function patchUpdates(_0x9668c9){return function(_0x421e4d){try{jsonpatch[_0x6f76('0x21')](_0x421e4d,_0x9668c9,!![]);}catch(_0xe9c7e7){return BPromise[_0x6f76('0x22')](_0xe9c7e7);}return _0x421e4d[_0x6f76('0x23')]();};}function saveUpdates(_0x576989,_0x5909d0){return function(_0x271774){if(_0x271774){return _0x271774[_0x6f76('0x24')](_0x576989)[_0x6f76('0x25')](function(_0x5c0d06){return _0x5c0d06;});}return null;};}function removeEntity(_0xfbefff,_0x27b5a7){return function(_0x32b30f){if(_0x32b30f){return _0x32b30f[_0x6f76('0x26')]()[_0x6f76('0x25')](function(){_0xfbefff[_0x6f76('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51fce6,_0x1c1aae){return function(_0x30711d){if(!_0x30711d){_0x51fce6[_0x6f76('0x27')](0x194);}return _0x30711d;};}function handleError(_0xbfc750,_0x26063e){_0x26063e=_0x26063e||0x1f4;return function(_0x46d488){logger[_0x6f76('0x28')](_0x46d488[_0x6f76('0x29')]);if(_0x46d488[_0x6f76('0x2a')]){delete _0x46d488['name'];}_0xbfc750[_0x6f76('0x1a')](_0x26063e)[_0x6f76('0x2b')](_0x46d488);};}exports[_0x6f76('0x2c')]=function(_0x4aecdd,_0x421842){var _0x266159={},_0x41a588={},_0x5bc0c5={'count':0x0,'rows':[]};var _0x59ceb0=_[_0x6f76('0x2d')](db[_0x6f76('0x2e')][_0x6f76('0x2f')],function(_0x48153b){return{'name':_0x48153b[_0x6f76('0x30')],'type':_0x48153b[_0x6f76('0x31')][_0x6f76('0x32')]};});_0x41a588['model']=_['map'](_0x59ceb0,_0x6f76('0x2a'));_0x41a588[_0x6f76('0x33')]=_['keys'](_0x4aecdd[_0x6f76('0x33')]);_0x41a588[_0x6f76('0x34')]=_['intersection'](_0x41a588[_0x6f76('0x35')],_0x41a588['query']);_0x266159[_0x6f76('0x36')]=_['intersection'](_0x41a588[_0x6f76('0x35')],qs['fields'](_0x4aecdd['query'][_0x6f76('0x37')]));_0x266159[_0x6f76('0x36')]=_0x266159['attributes']['length']?_0x266159[_0x6f76('0x36')]:_0x41a588[_0x6f76('0x35')];if(!_0x4aecdd[_0x6f76('0x33')][_0x6f76('0x38')](_0x6f76('0x39'))){_0x266159[_0x6f76('0x1f')]=qs['limit'](_0x4aecdd[_0x6f76('0x33')][_0x6f76('0x1f')]);_0x266159['offset']=qs['offset'](_0x4aecdd['query'][_0x6f76('0x1c')]);}_0x266159['order']=qs[_0x6f76('0x3a')](_0x4aecdd[_0x6f76('0x33')][_0x6f76('0x3a')]);_0x266159[_0x6f76('0x3b')]=qs[_0x6f76('0x34')](_[_0x6f76('0x3c')](_0x4aecdd[_0x6f76('0x33')],_0x41a588[_0x6f76('0x34')]),_0x59ceb0);if(_0x4aecdd[_0x6f76('0x33')]['filter']){_0x266159['where']=_[_0x6f76('0x3d')](_0x266159[_0x6f76('0x3b')],{'$or':_[_0x6f76('0x2d')](_0x59ceb0,function(_0x333025){if(_0x333025['type']!=='VIRTUAL'){var _0x1bab50={};_0x1bab50[_0x333025[_0x6f76('0x2a')]]={'$like':'%'+_0x4aecdd[_0x6f76('0x33')]['filter']+'%'};return _0x1bab50;}})});}_0x266159=_['merge']({},_0x266159,_0x4aecdd[_0x6f76('0x3e')]);var _0x1826ac={'where':_0x266159[_0x6f76('0x3b')]};return db[_0x6f76('0x2e')][_0x6f76('0x1e')](_0x1826ac)[_0x6f76('0x25')](function(_0x3def68){_0x5bc0c5[_0x6f76('0x1e')]=_0x3def68;if(_0x4aecdd[_0x6f76('0x33')][_0x6f76('0x3f')]){_0x266159[_0x6f76('0x40')]=[{'all':!![]}];}return db[_0x6f76('0x2e')][_0x6f76('0x41')](_0x266159);})[_0x6f76('0x25')](function(_0x41af46){_0x5bc0c5[_0x6f76('0x42')]=_0x41af46;return _0x5bc0c5;})['then'](respondWithFilteredResult(_0x421842,_0x266159))['catch'](handleError(_0x421842,null));};exports['show']=function(_0x1aa8d9,_0x3d9744){var _0x2dc269={'raw':![],'where':{'id':_0x1aa8d9['params']['id']}},_0x2791c7={};_0x2791c7[_0x6f76('0x35')]=_['keys'](db[_0x6f76('0x2e')]['rawAttributes']);_0x2791c7['query']=_[_0x6f76('0x43')](_0x1aa8d9['query']);_0x2791c7[_0x6f76('0x34')]=_[_0x6f76('0x44')](_0x2791c7[_0x6f76('0x35')],_0x2791c7[_0x6f76('0x33')]);_0x2dc269[_0x6f76('0x36')]=_[_0x6f76('0x44')](_0x2791c7['model'],qs['fields'](_0x1aa8d9[_0x6f76('0x33')][_0x6f76('0x37')]));_0x2dc269[_0x6f76('0x36')]=_0x2dc269['attributes'][_0x6f76('0x45')]?_0x2dc269['attributes']:_0x2791c7['model'];if(_0x1aa8d9[_0x6f76('0x33')][_0x6f76('0x3f')]){_0x2dc269[_0x6f76('0x40')]=[{'all':!![]}];}_0x2dc269=_['merge']({},_0x2dc269,_0x1aa8d9['options']);return db['Dynamics365Configuration'][_0x6f76('0x46')](_0x2dc269)['then'](handleEntityNotFound(_0x3d9744,null))[_0x6f76('0x25')](respondWithResult(_0x3d9744,null))['catch'](handleError(_0x3d9744,null));};exports[_0x6f76('0x47')]=function(_0x419db7,_0x6164ee){return db[_0x6f76('0x2e')][_0x6f76('0x47')](_0x419db7[_0x6f76('0x48')],{})[_0x6f76('0x25')](respondWithResult(_0x6164ee,0xc9))[_0x6f76('0x49')](handleError(_0x6164ee,null));};exports[_0x6f76('0x24')]=function(_0x3ba92b,_0x40df0e){if(_0x3ba92b[_0x6f76('0x48')]['id']){delete _0x3ba92b[_0x6f76('0x48')]['id'];}return db['Dynamics365Configuration']['find']({'where':{'id':_0x3ba92b[_0x6f76('0x4a')]['id']}})[_0x6f76('0x25')](handleEntityNotFound(_0x40df0e,null))['then'](saveUpdates(_0x3ba92b[_0x6f76('0x48')],null))['then'](respondWithResult(_0x40df0e,null))[_0x6f76('0x49')](handleError(_0x40df0e,null));};exports[_0x6f76('0x26')]=function(_0x3c35df,_0x2dec04){return db[_0x6f76('0x2e')][_0x6f76('0x46')]({'where':{'id':_0x3c35df[_0x6f76('0x4a')]['id']}})[_0x6f76('0x25')](handleEntityNotFound(_0x2dec04,null))[_0x6f76('0x25')](removeEntity(_0x2dec04,null))['catch'](handleError(_0x2dec04,null));};exports[_0x6f76('0x4b')]=function(_0xd3c19a,_0x19fe0b,_0x22b067){var _0x550698={};var _0x1dcc4e={};var _0x72f5cc;var _0x5df481;return db[_0x6f76('0x2e')][_0x6f76('0x4c')]({'where':{'id':_0xd3c19a[_0x6f76('0x4a')]['id']}})[_0x6f76('0x25')](handleEntityNotFound(_0x19fe0b,null))['then'](function(_0x4423cf){if(_0x4423cf){_0x72f5cc=_0x4423cf;_0x1dcc4e[_0x6f76('0x35')]=_[_0x6f76('0x43')](db[_0x6f76('0x4d')][_0x6f76('0x2f')]);_0x1dcc4e[_0x6f76('0x33')]=_[_0x6f76('0x43')](_0xd3c19a[_0x6f76('0x33')]);_0x1dcc4e[_0x6f76('0x34')]=_['intersection'](_0x1dcc4e[_0x6f76('0x35')],_0x1dcc4e[_0x6f76('0x33')]);_0x550698['attributes']=_[_0x6f76('0x44')](_0x1dcc4e[_0x6f76('0x35')],qs[_0x6f76('0x37')](_0xd3c19a[_0x6f76('0x33')]['fields']));_0x550698['attributes']=_0x550698['attributes'][_0x6f76('0x45')]?_0x550698[_0x6f76('0x36')]:_0x1dcc4e[_0x6f76('0x35')];_0x550698[_0x6f76('0x4e')]=qs[_0x6f76('0x3a')](_0xd3c19a[_0x6f76('0x33')][_0x6f76('0x3a')]);_0x550698[_0x6f76('0x3b')]=qs['filters'](_[_0x6f76('0x3c')](_0xd3c19a['query'],_0x1dcc4e[_0x6f76('0x34')]));if(_0xd3c19a[_0x6f76('0x33')][_0x6f76('0x4f')]){_0x550698[_0x6f76('0x3b')]=_[_0x6f76('0x3d')](_0x550698[_0x6f76('0x3b')],{'$or':_[_0x6f76('0x2d')](_0x550698['attributes'],function(_0x49ebfc){var _0x22cc05={};_0x22cc05[_0x49ebfc]={'$like':'%'+_0xd3c19a[_0x6f76('0x33')]['filter']+'%'};return _0x22cc05;})});}_0x550698=_['merge']({},_0x550698,_0xd3c19a[_0x6f76('0x3e')]);return _0x72f5cc[_0x6f76('0x4b')](_0x550698);}})['then'](function(_0x2d2e19){if(_0x2d2e19){_0x5df481=_0x2d2e19[_0x6f76('0x45')];if(!_0xd3c19a['query'][_0x6f76('0x38')](_0x6f76('0x39'))){_0x550698[_0x6f76('0x1f')]=qs[_0x6f76('0x1f')](_0xd3c19a[_0x6f76('0x33')]['limit']);_0x550698[_0x6f76('0x1c')]=qs['offset'](_0xd3c19a[_0x6f76('0x33')][_0x6f76('0x1c')]);}return _0x72f5cc['getFields'](_0x550698);}})['then'](function(_0x28a9ad){if(_0x28a9ad){return _0x28a9ad?{'count':_0x5df481,'rows':_0x28a9ad}:null;}})['then'](respondWithResult(_0x19fe0b,null))[_0x6f76('0x49')](handleError(_0x19fe0b,null));};exports['getSubjects']=function(_0x458712,_0x4988f2,_0x9af2ed){var _0x1a8052={};var _0x45a8b7={};var _0x51eb4e;var _0x3f6284;return db[_0x6f76('0x2e')][_0x6f76('0x4c')]({'where':{'id':_0x458712[_0x6f76('0x4a')]['id']}})[_0x6f76('0x25')](handleEntityNotFound(_0x4988f2,null))['then'](function(_0x2ec3db){if(_0x2ec3db){_0x51eb4e=_0x2ec3db;_0x45a8b7[_0x6f76('0x35')]=_[_0x6f76('0x43')](db['Dynamics365Field'][_0x6f76('0x2f')]);_0x45a8b7[_0x6f76('0x33')]=_[_0x6f76('0x43')](_0x458712[_0x6f76('0x33')]);_0x45a8b7[_0x6f76('0x34')]=_[_0x6f76('0x44')](_0x45a8b7[_0x6f76('0x35')],_0x45a8b7[_0x6f76('0x33')]);_0x1a8052[_0x6f76('0x36')]=_['intersection'](_0x45a8b7[_0x6f76('0x35')],qs[_0x6f76('0x37')](_0x458712[_0x6f76('0x33')]['fields']));_0x1a8052[_0x6f76('0x36')]=_0x1a8052['attributes'][_0x6f76('0x45')]?_0x1a8052[_0x6f76('0x36')]:_0x45a8b7[_0x6f76('0x35')];_0x1a8052[_0x6f76('0x4e')]=qs[_0x6f76('0x3a')](_0x458712[_0x6f76('0x33')]['sort']);_0x1a8052[_0x6f76('0x3b')]=qs['filters'](_[_0x6f76('0x3c')](_0x458712[_0x6f76('0x33')],_0x45a8b7[_0x6f76('0x34')]));if(_0x458712['query'][_0x6f76('0x4f')]){_0x1a8052[_0x6f76('0x3b')]=_[_0x6f76('0x3d')](_0x1a8052[_0x6f76('0x3b')],{'$or':_['map'](_0x1a8052[_0x6f76('0x36')],function(_0x3cf160){var _0x470b2d={};_0x470b2d[_0x3cf160]={'$like':'%'+_0x458712[_0x6f76('0x33')]['filter']+'%'};return _0x470b2d;})});}_0x1a8052=_[_0x6f76('0x3d')]({},_0x1a8052,_0x458712[_0x6f76('0x3e')]);return _0x51eb4e[_0x6f76('0x50')](_0x1a8052);}})[_0x6f76('0x25')](function(_0x24ffa2){if(_0x24ffa2){_0x3f6284=_0x24ffa2['length'];if(!_0x458712[_0x6f76('0x33')]['hasOwnProperty'](_0x6f76('0x39'))){_0x1a8052[_0x6f76('0x1f')]=qs['limit'](_0x458712[_0x6f76('0x33')][_0x6f76('0x1f')]);_0x1a8052[_0x6f76('0x1c')]=qs['offset'](_0x458712[_0x6f76('0x33')][_0x6f76('0x1c')]);}return _0x51eb4e[_0x6f76('0x50')](_0x1a8052);}})[_0x6f76('0x25')](function(_0x54ab1f){if(_0x54ab1f){return _0x54ab1f?{'count':_0x3f6284,'rows':_0x54ab1f}:null;}})[_0x6f76('0x25')](respondWithResult(_0x4988f2,null))[_0x6f76('0x49')](handleError(_0x4988f2,null));};exports[_0x6f76('0x51')]=function(_0x563cf8,_0x41456c,_0x445bbe){var _0x470d4a={};var _0x1b0063={};var _0x1464bb;var _0x4c9c40;return db[_0x6f76('0x2e')][_0x6f76('0x4c')]({'where':{'id':_0x563cf8[_0x6f76('0x4a')]['id']}})[_0x6f76('0x25')](handleEntityNotFound(_0x41456c,null))[_0x6f76('0x25')](function(_0x3e2b2c){if(_0x3e2b2c){_0x1464bb=_0x3e2b2c;_0x1b0063[_0x6f76('0x35')]=_[_0x6f76('0x43')](db['Dynamics365Field'][_0x6f76('0x2f')]);_0x1b0063[_0x6f76('0x33')]=_[_0x6f76('0x43')](_0x563cf8[_0x6f76('0x33')]);_0x1b0063[_0x6f76('0x34')]=_['intersection'](_0x1b0063[_0x6f76('0x35')],_0x1b0063[_0x6f76('0x33')]);_0x470d4a[_0x6f76('0x36')]=_[_0x6f76('0x44')](_0x1b0063[_0x6f76('0x35')],qs[_0x6f76('0x37')](_0x563cf8[_0x6f76('0x33')][_0x6f76('0x37')]));_0x470d4a[_0x6f76('0x36')]=_0x470d4a['attributes']['length']?_0x470d4a[_0x6f76('0x36')]:_0x1b0063[_0x6f76('0x35')];_0x470d4a[_0x6f76('0x4e')]=qs['sort'](_0x563cf8[_0x6f76('0x33')][_0x6f76('0x3a')]);_0x470d4a[_0x6f76('0x3b')]=qs[_0x6f76('0x34')](_[_0x6f76('0x3c')](_0x563cf8[_0x6f76('0x33')],_0x1b0063[_0x6f76('0x34')]));if(_0x563cf8[_0x6f76('0x33')]['filter']){_0x470d4a[_0x6f76('0x3b')]=_[_0x6f76('0x3d')](_0x470d4a['where'],{'$or':_[_0x6f76('0x2d')](_0x470d4a['attributes'],function(_0x3800fc){var _0x519ad7={};_0x519ad7[_0x3800fc]={'$like':'%'+_0x563cf8[_0x6f76('0x33')][_0x6f76('0x4f')]+'%'};return _0x519ad7;})});}_0x470d4a=_[_0x6f76('0x3d')]({},_0x470d4a,_0x563cf8[_0x6f76('0x3e')]);return _0x1464bb[_0x6f76('0x51')](_0x470d4a);}})[_0x6f76('0x25')](function(_0x420df3){if(_0x420df3){_0x4c9c40=_0x420df3[_0x6f76('0x45')];if(!_0x563cf8[_0x6f76('0x33')][_0x6f76('0x38')]('nolimit')){_0x470d4a[_0x6f76('0x1f')]=qs['limit'](_0x563cf8[_0x6f76('0x33')][_0x6f76('0x1f')]);_0x470d4a[_0x6f76('0x1c')]=qs[_0x6f76('0x1c')](_0x563cf8[_0x6f76('0x33')][_0x6f76('0x1c')]);}return _0x1464bb[_0x6f76('0x51')](_0x470d4a);}})[_0x6f76('0x25')](function(_0x302b01){if(_0x302b01){return _0x302b01?{'count':_0x4c9c40,'rows':_0x302b01}:null;}})[_0x6f76('0x25')](respondWithResult(_0x41456c,null))[_0x6f76('0x49')](handleError(_0x41456c,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 56439ee..bc137c1 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 _0x00bb=['util','../../config/logger','moment','request-promise','path','../../config/environment','./intDynamics365Configuration.attributes','define','Dynamics365Configuration','int_dynamics365_configurations','lodash'];(function(_0x84b1ac,_0x4690e5){var _0x4a8fb8=function(_0x3532a0){while(--_0x3532a0){_0x84b1ac['push'](_0x84b1ac['shift']());}};_0x4a8fb8(++_0x4690e5);}(_0x00bb,0x1d8));var _0xb00b=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x00bb[_0x5c351c];return _0x26f3b3;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var logger=require(_0xb00b('0x2'))('api');var moment=require(_0xb00b('0x3'));var BPromise=require('bluebird');var rp=require(_0xb00b('0x4'));var fs=require('fs');var path=require(_0xb00b('0x5'));var rimraf=require('rimraf');var config=require(_0xb00b('0x6'));var attributes=require(_0xb00b('0x7'));module['exports']=function(_0x574cf8,_0x532ffb){return _0x574cf8[_0xb00b('0x8')](_0xb00b('0x9'),attributes,{'tableName':_0xb00b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9f62=['api','moment','bluebird','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','util'];(function(_0xe554e5,_0x138712){var _0x3cb94b=function(_0x10dfc1){while(--_0x10dfc1){_0xe554e5['push'](_0xe554e5['shift']());}};_0x3cb94b(++_0x138712);}(_0x9f62,0x154));var _0x29f6=function(_0x2c0806,_0x5b832d){_0x2c0806=_0x2c0806-0x0;var _0x379aca=_0x9f62[_0x2c0806];return _0x379aca;};'use strict';var _=require('lodash');var util=require(_0x29f6('0x0'));var logger=require('../../config/logger')(_0x29f6('0x1'));var moment=require(_0x29f6('0x2'));var BPromise=require(_0x29f6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x29f6('0x4'));var config=require(_0x29f6('0x5'));var attributes=require(_0x29f6('0x6'));module[_0x29f6('0x7')]=function(_0x595034,_0xf66137){return _0x595034[_0x29f6('0x8')](_0x29f6('0x9'),attributes,{'tableName':_0x29f6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 913e416..690e72c 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 _0x5cdf=['jayson/promise','client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3d71a3,_0x3a33b7){var _0x5bb3ab=function(_0x2834f2){while(--_0x2834f2){_0x3d71a3['push'](_0x3d71a3['shift']());}};_0x5bb3ab(++_0x3a33b7);}(_0x5cdf,0x6e));var _0xf5cd=function(_0x145205,_0x1690cc){_0x145205=_0x145205-0x0;var _0x5871c0=_0x5cdf[_0x145205];return _0x5871c0;};'use strict';var _=require(_0xf5cd('0x0'));var util=require(_0xf5cd('0x1'));var moment=require(_0xf5cd('0x2'));var BPromise=require('bluebird');var rs=require(_0xf5cd('0x3'));var fs=require('fs');var Redis=require(_0xf5cd('0x4'));var db=require(_0xf5cd('0x5'))['db'];var utils=require(_0xf5cd('0x6'));var logger=require(_0xf5cd('0x7'))(_0xf5cd('0x8'));var config=require(_0xf5cd('0x9'));var jayson=require(_0xf5cd('0xa'));var client=jayson[_0xf5cd('0xb')][_0xf5cd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x54828a,_0x108573,_0x3fe8cd){return new BPromise(function(_0x1d9512,_0x5cba33){return client[_0xf5cd('0xd')](_0x54828a,_0x3fe8cd)[_0xf5cd('0xe')](function(_0x374ed5){logger[_0xf5cd('0xf')](_0xf5cd('0x10'),_0x108573,'request\x20sent');logger[_0xf5cd('0x11')](_0xf5cd('0x12'),_0x108573,_0xf5cd('0x13'),JSON[_0xf5cd('0x14')](_0x374ed5));if(_0x374ed5[_0xf5cd('0x15')]){if(_0x374ed5[_0xf5cd('0x15')][_0xf5cd('0x16')]===0x1f4){logger[_0xf5cd('0x15')](_0xf5cd('0x10'),_0x108573,_0x374ed5[_0xf5cd('0x15')][_0xf5cd('0x17')]);return _0x5cba33(_0x374ed5['error'][_0xf5cd('0x17')]);}logger[_0xf5cd('0x15')](_0xf5cd('0x10'),_0x108573,_0x374ed5['error'][_0xf5cd('0x17')]);return _0x1d9512(_0x374ed5[_0xf5cd('0x15')][_0xf5cd('0x17')]);}else{logger['info'](_0xf5cd('0x10'),_0x108573,'request\x20sent');_0x1d9512(_0x374ed5['result'][_0xf5cd('0x17')]);}})['catch'](function(_0x454adb){logger[_0xf5cd('0x15')](_0xf5cd('0x10'),_0x108573,_0x454adb);_0x5cba33(_0x454adb);});});} \ No newline at end of file +var _0x2263=['debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent'];(function(_0x41bfa8,_0x2222f0){var _0x5a689e=function(_0x9c9b27){while(--_0x9c9b27){_0x41bfa8['push'](_0x41bfa8['shift']());}};_0x5a689e(++_0x2222f0);}(_0x2263,0xa7));var _0x3226=function(_0x3eb4a9,_0x359d73){_0x3eb4a9=_0x3eb4a9-0x0;var _0x48dbad=_0x2263[_0x3eb4a9];return _0x48dbad;};'use strict';var _=require(_0x3226('0x0'));var util=require(_0x3226('0x1'));var moment=require('moment');var BPromise=require(_0x3226('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3226('0x3'));var db=require(_0x3226('0x4'))['db'];var utils=require(_0x3226('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x3226('0x6'));var client=jayson['client'][_0x3226('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x430663,_0x5dd0cd,_0x443b09){return new BPromise(function(_0x4636cc,_0x2d491d){return client[_0x3226('0x8')](_0x430663,_0x443b09)[_0x3226('0x9')](function(_0x5d290b){logger[_0x3226('0xa')](_0x3226('0xb'),_0x5dd0cd,_0x3226('0xc'));logger[_0x3226('0xd')](_0x3226('0xe'),_0x5dd0cd,_0x3226('0xc'),JSON[_0x3226('0xf')](_0x5d290b));if(_0x5d290b[_0x3226('0x10')]){if(_0x5d290b['error']['code']===0x1f4){logger[_0x3226('0x10')](_0x3226('0xb'),_0x5dd0cd,_0x5d290b[_0x3226('0x10')][_0x3226('0x11')]);return _0x2d491d(_0x5d290b[_0x3226('0x10')][_0x3226('0x11')]);}logger[_0x3226('0x10')](_0x3226('0xb'),_0x5dd0cd,_0x5d290b[_0x3226('0x10')][_0x3226('0x11')]);return _0x4636cc(_0x5d290b[_0x3226('0x10')]['message']);}else{logger[_0x3226('0xa')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5dd0cd,_0x3226('0xc'));_0x4636cc(_0x5d290b['result']['message']);}})['catch'](function(_0x3c64db){logger['error'](_0x3226('0xb'),_0x5dd0cd,_0x3c64db);_0x2d491d(_0x3c64db);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index f402065..510dcf6 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 _0xdef1=['index','/:id','isAuthenticated','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Field.controller','get'];(function(_0x351c72,_0x10d6d6){var _0x4565ee=function(_0x34df1c){while(--_0x34df1c){_0x351c72['push'](_0x351c72['shift']());}};_0x4565ee(++_0x10d6d6);}(_0xdef1,0x82));var _0x1def=function(_0x57d35d,_0x4dc85e){_0x57d35d=_0x57d35d-0x0;var _0x25d572=_0xdef1[_0x57d35d];return _0x25d572;};'use strict';var multer=require(_0x1def('0x0'));var util=require(_0x1def('0x1'));var path=require(_0x1def('0x2'));var timeout=require(_0x1def('0x3'));var express=require(_0x1def('0x4'));var router=express['Router']();var fs_extra=require(_0x1def('0x5'));var auth=require(_0x1def('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1def('0x7'));var controller=require(_0x1def('0x8'));router[_0x1def('0x9')]('/',auth['isAuthenticated'](),controller[_0x1def('0xa')]);router[_0x1def('0x9')](_0x1def('0xb'),auth[_0x1def('0xc')](),controller[_0x1def('0xd')]);router[_0x1def('0xe')]('/',auth[_0x1def('0xc')](),controller[_0x1def('0xf')]);router[_0x1def('0x10')]('/:id',auth[_0x1def('0xc')](),controller[_0x1def('0x11')]);router[_0x1def('0x12')](_0x1def('0xb'),auth[_0x1def('0xc')](),controller['destroy']);module[_0x1def('0x13')]=router; \ No newline at end of file +var _0xd60d=['show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x52e68e,_0x309912){var _0x3211a4=function(_0x467c01){while(--_0x467c01){_0x52e68e['push'](_0x52e68e['shift']());}};_0x3211a4(++_0x309912);}(_0xd60d,0x104));var _0xdd60=function(_0x584be7,_0x213c84){_0x584be7=_0x584be7-0x0;var _0x3deeff=_0xd60d[_0x584be7];return _0x3deeff;};'use strict';var multer=require(_0xdd60('0x0'));var util=require('util');var path=require(_0xdd60('0x1'));var timeout=require(_0xdd60('0x2'));var express=require(_0xdd60('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xdd60('0x4'));var interaction=require(_0xdd60('0x5'));var config=require(_0xdd60('0x6'));var controller=require('./intDynamics365Field.controller');router[_0xdd60('0x7')]('/',auth[_0xdd60('0x8')](),controller[_0xdd60('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xdd60('0xa')]);router[_0xdd60('0xb')]('/',auth[_0xdd60('0x8')](),controller[_0xdd60('0xc')]);router[_0xdd60('0xd')]('/:id',auth[_0xdd60('0x8')](),controller[_0xdd60('0xe')]);router[_0xdd60('0xf')]('/:id',auth[_0xdd60('0x8')](),controller[_0xdd60('0x10')]);module[_0xdd60('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index c23d1be..51027e3 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 _0x4cf9=['keyValue','STRING','customVariable','BOOLEAN','exports','ENUM','string','variable'];(function(_0x2100ff,_0x34b042){var _0x357f27=function(_0x58cd35){while(--_0x58cd35){_0x2100ff['push'](_0x2100ff['shift']());}};_0x357f27(++_0x34b042);}(_0x4cf9,0xfc));var _0x94cf=function(_0x2d7077,_0x4e5882){_0x2d7077=_0x2d7077-0x0;var _0x2b7a7d=_0x4cf9[_0x2d7077];return _0x2b7a7d;};'use strict';var Sequelize=require('sequelize');module[_0x94cf('0x0')]={'type':{'type':Sequelize[_0x94cf('0x1')](_0x94cf('0x2'),_0x94cf('0x3'),'customVariable',_0x94cf('0x4'),'picklist'),'defaultValue':_0x94cf('0x2')},'content':{'type':Sequelize[_0x94cf('0x5')]},'key':{'type':Sequelize[_0x94cf('0x5')]},'keyType':{'type':Sequelize[_0x94cf('0x1')](_0x94cf('0x2'),_0x94cf('0x3'),_0x94cf('0x6'))},'keyContent':{'type':Sequelize[_0x94cf('0x5')]},'idField':{'type':Sequelize[_0x94cf('0x5')]},'nameField':{'type':Sequelize[_0x94cf('0x5')]},'customField':{'type':Sequelize[_0x94cf('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x94cf('0x5')]}}; \ No newline at end of file +var _0xee8e=['customVariable','keyValue','picklist','STRING','BOOLEAN','exports','ENUM','string','variable'];(function(_0x400fd9,_0x405eb4){var _0x440eff=function(_0x3a38a9){while(--_0x3a38a9){_0x400fd9['push'](_0x400fd9['shift']());}};_0x440eff(++_0x405eb4);}(_0xee8e,0x83));var _0xeee8=function(_0x2e4aa8,_0x17fbae){_0x2e4aa8=_0x2e4aa8-0x0;var _0x3052b9=_0xee8e[_0x2e4aa8];return _0x3052b9;};'use strict';var Sequelize=require('sequelize');module[_0xeee8('0x0')]={'type':{'type':Sequelize[_0xeee8('0x1')](_0xeee8('0x2'),_0xeee8('0x3'),_0xeee8('0x4'),_0xeee8('0x5'),_0xeee8('0x6')),'defaultValue':_0xeee8('0x2')},'content':{'type':Sequelize[_0xeee8('0x7')]},'key':{'type':Sequelize[_0xeee8('0x7')]},'keyType':{'type':Sequelize[_0xeee8('0x1')](_0xeee8('0x2'),_0xeee8('0x3'),_0xeee8('0x4'))},'keyContent':{'type':Sequelize[_0xeee8('0x7')]},'idField':{'type':Sequelize[_0xeee8('0x7')]},'nameField':{'type':Sequelize[_0xeee8('0x7')]},'customField':{'type':Sequelize[_0xeee8('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xeee8('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 0552881..243ce10 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 _0x3c56=['moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','status','sendStatus','stack','name','send','index','rawAttributes','fieldName','type','key','map','keys','query','filters','intersection','model','attributes','fields','length','sort','where','pick','filter','merge','VIRTUAL','options','Dynamics365Field','includeAll','include','findAll','rows','catch','params','create','body','find','eml-format','rimraf','zip-dir','request-promise'];(function(_0xf5b6bb,_0x4451f2){var _0x1ccbde=function(_0x1c9997){while(--_0x1c9997){_0xf5b6bb['push'](_0xf5b6bb['shift']());}};_0x1ccbde(++_0x4451f2);}(_0x3c56,0xd1));var _0x63c5=function(_0x17dcbd,_0x4c35ea){_0x17dcbd=_0x17dcbd-0x0;var _0x4567c1=_0x3c56[_0x17dcbd];return _0x4567c1;};'use strict';var emlformat=require(_0x63c5('0x0'));var rimraf=require(_0x63c5('0x1'));var zipdir=require(_0x63c5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x63c5('0x3'));var moment=require(_0x63c5('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x63c5('0x5'));var path=require(_0x63c5('0x6'));var sox=require(_0x63c5('0x7'));var csv=require(_0x63c5('0x8'));var ejs=require(_0x63c5('0x9'));var fs=require('fs');var fs_extra=require(_0x63c5('0xa'));var _=require(_0x63c5('0xb'));var squel=require(_0x63c5('0xc'));var crypto=require(_0x63c5('0xd'));var jsforce=require(_0x63c5('0xe'));var deskjs=require(_0x63c5('0xf'));var toCsv=require(_0x63c5('0x8'));var querystring=require(_0x63c5('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x63c5('0x11'));var as=require(_0x63c5('0x12'));var hardwareService=require(_0x63c5('0x13'));var logger=require('../../config/logger')(_0x63c5('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x63c5('0x15'));var db=require(_0x63c5('0x16'))['db'];function respondWithStatusCode(_0x125900,_0x166317){_0x166317=_0x166317||0xcc;return function(_0xa1eed5){if(_0xa1eed5){return _0x125900['sendStatus'](_0x166317);}return _0x125900['status'](_0x166317)[_0x63c5('0x17')]();};}function respondWithResult(_0x256ccd,_0x2dd969){_0x2dd969=_0x2dd969||0xc8;return function(_0x9e6d9d){if(_0x9e6d9d){return _0x256ccd['status'](_0x2dd969)[_0x63c5('0x18')](_0x9e6d9d);}};}function respondWithFilteredResult(_0x2d11df,_0x5ece17){return function(_0x1e1847){if(_0x1e1847){var _0x34ccae=typeof _0x5ece17[_0x63c5('0x19')]===_0x63c5('0x1a')&&typeof _0x5ece17[_0x63c5('0x1b')]===_0x63c5('0x1a');var _0x369dc9=_0x1e1847[_0x63c5('0x1c')];var _0x3e28e1=_0x34ccae?0x0:_0x5ece17[_0x63c5('0x19')];var _0xfd9b00=_0x34ccae?_0x1e1847[_0x63c5('0x1c')]:_0x5ece17[_0x63c5('0x19')]+_0x5ece17[_0x63c5('0x1b')];var _0x55eb56;if(_0xfd9b00>=_0x369dc9){_0xfd9b00=_0x369dc9;_0x55eb56=0xc8;}else{_0x55eb56=0xce;}_0x2d11df['status'](_0x55eb56);return _0x2d11df[_0x63c5('0x1d')]('Content-Range',_0x3e28e1+'-'+_0xfd9b00+'/'+_0x369dc9)[_0x63c5('0x18')](_0x1e1847);}return null;};}function patchUpdates(_0x59800b){return function(_0x17f3cb){try{jsonpatch[_0x63c5('0x1e')](_0x17f3cb,_0x59800b,!![]);}catch(_0x5753e5){return BPromise[_0x63c5('0x1f')](_0x5753e5);}return _0x17f3cb['save']();};}function saveUpdates(_0x321259,_0xf426b3){return function(_0x3c1256){if(_0x3c1256){return _0x3c1256[_0x63c5('0x20')](_0x321259)[_0x63c5('0x21')](function(_0x1648e3){return _0x1648e3;});}return null;};}function removeEntity(_0x4a7d71,_0x296f55){return function(_0x3c5dc0){if(_0x3c5dc0){return _0x3c5dc0[_0x63c5('0x22')]()[_0x63c5('0x21')](function(){_0x4a7d71[_0x63c5('0x23')](0xcc)[_0x63c5('0x17')]();});}};}function handleEntityNotFound(_0x26f096,_0x316e50){return function(_0x2e94a8){if(!_0x2e94a8){_0x26f096[_0x63c5('0x24')](0x194);}return _0x2e94a8;};}function handleError(_0x22e55c,_0x482bb5){_0x482bb5=_0x482bb5||0x1f4;return function(_0x41899f){logger['error'](_0x41899f[_0x63c5('0x25')]);if(_0x41899f[_0x63c5('0x26')]){delete _0x41899f[_0x63c5('0x26')];}_0x22e55c['status'](_0x482bb5)[_0x63c5('0x27')](_0x41899f);};}exports[_0x63c5('0x28')]=function(_0x3fc363,_0x1a2065){var _0x33701e={},_0x13adea={},_0x495f6b={'count':0x0,'rows':[]};var _0x57d0f6=_['map'](db['Dynamics365Field'][_0x63c5('0x29')],function(_0x14bd11){return{'name':_0x14bd11[_0x63c5('0x2a')],'type':_0x14bd11[_0x63c5('0x2b')][_0x63c5('0x2c')]};});_0x13adea['model']=_[_0x63c5('0x2d')](_0x57d0f6,'name');_0x13adea['query']=_[_0x63c5('0x2e')](_0x3fc363[_0x63c5('0x2f')]);_0x13adea[_0x63c5('0x30')]=_[_0x63c5('0x31')](_0x13adea[_0x63c5('0x32')],_0x13adea[_0x63c5('0x2f')]);_0x33701e[_0x63c5('0x33')]=_[_0x63c5('0x31')](_0x13adea[_0x63c5('0x32')],qs[_0x63c5('0x34')](_0x3fc363[_0x63c5('0x2f')][_0x63c5('0x34')]));_0x33701e[_0x63c5('0x33')]=_0x33701e['attributes'][_0x63c5('0x35')]?_0x33701e[_0x63c5('0x33')]:_0x13adea[_0x63c5('0x32')];if(!_0x3fc363[_0x63c5('0x2f')]['hasOwnProperty']('nolimit')){_0x33701e[_0x63c5('0x1b')]=qs[_0x63c5('0x1b')](_0x3fc363[_0x63c5('0x2f')][_0x63c5('0x1b')]);_0x33701e['offset']=qs[_0x63c5('0x19')](_0x3fc363[_0x63c5('0x2f')]['offset']);}_0x33701e['order']=qs['sort'](_0x3fc363[_0x63c5('0x2f')][_0x63c5('0x36')]);_0x33701e[_0x63c5('0x37')]=qs['filters'](_[_0x63c5('0x38')](_0x3fc363[_0x63c5('0x2f')],_0x13adea[_0x63c5('0x30')]),_0x57d0f6);if(_0x3fc363[_0x63c5('0x2f')][_0x63c5('0x39')]){_0x33701e[_0x63c5('0x37')]=_[_0x63c5('0x3a')](_0x33701e[_0x63c5('0x37')],{'$or':_[_0x63c5('0x2d')](_0x57d0f6,function(_0x16b407){if(_0x16b407[_0x63c5('0x2b')]!==_0x63c5('0x3b')){var _0x53e062={};_0x53e062[_0x16b407['name']]={'$like':'%'+_0x3fc363[_0x63c5('0x2f')][_0x63c5('0x39')]+'%'};return _0x53e062;}})});}_0x33701e=_[_0x63c5('0x3a')]({},_0x33701e,_0x3fc363[_0x63c5('0x3c')]);var _0x10f9bc={'where':_0x33701e[_0x63c5('0x37')]};return db[_0x63c5('0x3d')][_0x63c5('0x1c')](_0x10f9bc)[_0x63c5('0x21')](function(_0x522d29){_0x495f6b[_0x63c5('0x1c')]=_0x522d29;if(_0x3fc363[_0x63c5('0x2f')][_0x63c5('0x3e')]){_0x33701e[_0x63c5('0x3f')]=[{'all':!![]}];}return db['Dynamics365Field'][_0x63c5('0x40')](_0x33701e);})[_0x63c5('0x21')](function(_0x94497b){_0x495f6b[_0x63c5('0x41')]=_0x94497b;return _0x495f6b;})[_0x63c5('0x21')](respondWithFilteredResult(_0x1a2065,_0x33701e))[_0x63c5('0x42')](handleError(_0x1a2065,null));};exports['show']=function(_0x21fc4c,_0x3cba80){var _0x34b972={'raw':!![],'where':{'id':_0x21fc4c[_0x63c5('0x43')]['id']}},_0x5eacfb={};_0x5eacfb[_0x63c5('0x32')]=_[_0x63c5('0x2e')](db[_0x63c5('0x3d')][_0x63c5('0x29')]);_0x5eacfb['query']=_[_0x63c5('0x2e')](_0x21fc4c[_0x63c5('0x2f')]);_0x5eacfb[_0x63c5('0x30')]=_[_0x63c5('0x31')](_0x5eacfb['model'],_0x5eacfb[_0x63c5('0x2f')]);_0x34b972[_0x63c5('0x33')]=_['intersection'](_0x5eacfb[_0x63c5('0x32')],qs['fields'](_0x21fc4c[_0x63c5('0x2f')][_0x63c5('0x34')]));_0x34b972[_0x63c5('0x33')]=_0x34b972[_0x63c5('0x33')][_0x63c5('0x35')]?_0x34b972[_0x63c5('0x33')]:_0x5eacfb['model'];if(_0x21fc4c[_0x63c5('0x2f')][_0x63c5('0x3e')]){_0x34b972['include']=[{'all':!![]}];}_0x34b972=_[_0x63c5('0x3a')]({},_0x34b972,_0x21fc4c[_0x63c5('0x3c')]);return db[_0x63c5('0x3d')]['find'](_0x34b972)[_0x63c5('0x21')](handleEntityNotFound(_0x3cba80,null))[_0x63c5('0x21')](respondWithResult(_0x3cba80,null))[_0x63c5('0x42')](handleError(_0x3cba80,null));};exports[_0x63c5('0x44')]=function(_0x38d74e,_0x3aa6e0){return db[_0x63c5('0x3d')]['create'](_0x38d74e[_0x63c5('0x45')],{})['then'](respondWithResult(_0x3aa6e0,0xc9))[_0x63c5('0x42')](handleError(_0x3aa6e0,null));};exports[_0x63c5('0x20')]=function(_0x5cd076,_0x4f9d19){if(_0x5cd076[_0x63c5('0x45')]['id']){delete _0x5cd076[_0x63c5('0x45')]['id'];}return db[_0x63c5('0x3d')][_0x63c5('0x46')]({'where':{'id':_0x5cd076[_0x63c5('0x43')]['id']}})[_0x63c5('0x21')](handleEntityNotFound(_0x4f9d19,null))[_0x63c5('0x21')](saveUpdates(_0x5cd076[_0x63c5('0x45')],null))[_0x63c5('0x21')](respondWithResult(_0x4f9d19,null))[_0x63c5('0x42')](handleError(_0x4f9d19,null));};exports[_0x63c5('0x22')]=function(_0x1a6e0e,_0x595293){return db[_0x63c5('0x3d')][_0x63c5('0x46')]({'where':{'id':_0x1a6e0e[_0x63c5('0x43')]['id']}})[_0x63c5('0x21')](handleEntityNotFound(_0x595293,null))[_0x63c5('0x21')](removeEntity(_0x595293,null))[_0x63c5('0x42')](handleError(_0x595293,null));}; \ No newline at end of file +var _0xa1bb=['name','send','index','map','Dynamics365Field','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','rows','show','params','catch','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','limit','undefined','count','offset','set','reject','save','update','then','sendStatus','error','stack'];(function(_0x1cbcf1,_0x3f9fd9){var _0x3a06f0=function(_0x5425d4){while(--_0x5425d4){_0x1cbcf1['push'](_0x1cbcf1['shift']());}};_0x3a06f0(++_0x3f9fd9);}(_0xa1bb,0x6e));var _0xba1b=function(_0x24fb83,_0x18caba){_0x24fb83=_0x24fb83-0x0;var _0x445a66=_0xa1bb[_0x24fb83];return _0x445a66;};'use strict';var emlformat=require(_0xba1b('0x0'));var rimraf=require(_0xba1b('0x1'));var zipdir=require(_0xba1b('0x2'));var jsonpatch=require(_0xba1b('0x3'));var rp=require(_0xba1b('0x4'));var moment=require(_0xba1b('0x5'));var BPromise=require(_0xba1b('0x6'));var Mustache=require(_0xba1b('0x7'));var util=require(_0xba1b('0x8'));var path=require(_0xba1b('0x9'));var sox=require(_0xba1b('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xba1b('0xb'));var squel=require(_0xba1b('0xc'));var crypto=require(_0xba1b('0xd'));var jsforce=require(_0xba1b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xba1b('0xf'));var querystring=require(_0xba1b('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xba1b('0x11'));var qs=require(_0xba1b('0x12'));var as=require(_0xba1b('0x13'));var hardwareService=require(_0xba1b('0x14'));var logger=require(_0xba1b('0x15'))(_0xba1b('0x16'));var utils=require('../../config/utils');var config=require(_0xba1b('0x17'));var licenseUtil=require(_0xba1b('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb00f68,_0x115341){_0x115341=_0x115341||0xcc;return function(_0x5a8485){if(_0x5a8485){return _0xb00f68['sendStatus'](_0x115341);}return _0xb00f68[_0xba1b('0x19')](_0x115341)[_0xba1b('0x1a')]();};}function respondWithResult(_0x3549a4,_0x475f15){_0x475f15=_0x475f15||0xc8;return function(_0x1ccb8d){if(_0x1ccb8d){return _0x3549a4[_0xba1b('0x19')](_0x475f15)[_0xba1b('0x1b')](_0x1ccb8d);}};}function respondWithFilteredResult(_0x161fe9,_0x1e396c){return function(_0x22f9ee){if(_0x22f9ee){var _0x2cf04c=typeof _0x1e396c['offset']==='undefined'&&typeof _0x1e396c[_0xba1b('0x1c')]===_0xba1b('0x1d');var _0x3ceb27=_0x22f9ee[_0xba1b('0x1e')];var _0x23df63=_0x2cf04c?0x0:_0x1e396c[_0xba1b('0x1f')];var _0x3de127=_0x2cf04c?_0x22f9ee[_0xba1b('0x1e')]:_0x1e396c['offset']+_0x1e396c[_0xba1b('0x1c')];var _0x4395bb;if(_0x3de127>=_0x3ceb27){_0x3de127=_0x3ceb27;_0x4395bb=0xc8;}else{_0x4395bb=0xce;}_0x161fe9[_0xba1b('0x19')](_0x4395bb);return _0x161fe9[_0xba1b('0x20')]('Content-Range',_0x23df63+'-'+_0x3de127+'/'+_0x3ceb27)[_0xba1b('0x1b')](_0x22f9ee);}return null;};}function patchUpdates(_0x2b8d91){return function(_0x783e99){try{jsonpatch['apply'](_0x783e99,_0x2b8d91,!![]);}catch(_0x2aed82){return BPromise[_0xba1b('0x21')](_0x2aed82);}return _0x783e99[_0xba1b('0x22')]();};}function saveUpdates(_0x43705d,_0x2bbf83){return function(_0x2ede49){if(_0x2ede49){return _0x2ede49[_0xba1b('0x23')](_0x43705d)[_0xba1b('0x24')](function(_0xe6b271){return _0xe6b271;});}return null;};}function removeEntity(_0xdc73fe,_0x1f5838){return function(_0xda5ec){if(_0xda5ec){return _0xda5ec['destroy']()[_0xba1b('0x24')](function(){_0xdc73fe[_0xba1b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13efd1,_0x14744d){return function(_0x1a9a1a){if(!_0x1a9a1a){_0x13efd1[_0xba1b('0x25')](0x194);}return _0x1a9a1a;};}function handleError(_0x4700f1,_0x3b6f7e){_0x3b6f7e=_0x3b6f7e||0x1f4;return function(_0x1541e4){logger[_0xba1b('0x26')](_0x1541e4[_0xba1b('0x27')]);if(_0x1541e4[_0xba1b('0x28')]){delete _0x1541e4[_0xba1b('0x28')];}_0x4700f1[_0xba1b('0x19')](_0x3b6f7e)[_0xba1b('0x29')](_0x1541e4);};}exports[_0xba1b('0x2a')]=function(_0x3914bd,_0xa5a362){var _0x1e392b={},_0x501658={},_0x379050={'count':0x0,'rows':[]};var _0x4440f9=_[_0xba1b('0x2b')](db[_0xba1b('0x2c')][_0xba1b('0x2d')],function(_0x181611){return{'name':_0x181611[_0xba1b('0x2e')],'type':_0x181611[_0xba1b('0x2f')][_0xba1b('0x30')]};});_0x501658[_0xba1b('0x31')]=_[_0xba1b('0x2b')](_0x4440f9,_0xba1b('0x28'));_0x501658[_0xba1b('0x32')]=_[_0xba1b('0x33')](_0x3914bd[_0xba1b('0x32')]);_0x501658['filters']=_[_0xba1b('0x34')](_0x501658[_0xba1b('0x31')],_0x501658['query']);_0x1e392b[_0xba1b('0x35')]=_['intersection'](_0x501658['model'],qs[_0xba1b('0x36')](_0x3914bd[_0xba1b('0x32')]['fields']));_0x1e392b[_0xba1b('0x35')]=_0x1e392b[_0xba1b('0x35')][_0xba1b('0x37')]?_0x1e392b[_0xba1b('0x35')]:_0x501658[_0xba1b('0x31')];if(!_0x3914bd['query'][_0xba1b('0x38')](_0xba1b('0x39'))){_0x1e392b[_0xba1b('0x1c')]=qs[_0xba1b('0x1c')](_0x3914bd['query'][_0xba1b('0x1c')]);_0x1e392b[_0xba1b('0x1f')]=qs[_0xba1b('0x1f')](_0x3914bd['query'][_0xba1b('0x1f')]);}_0x1e392b[_0xba1b('0x3a')]=qs[_0xba1b('0x3b')](_0x3914bd['query'][_0xba1b('0x3b')]);_0x1e392b['where']=qs[_0xba1b('0x3c')](_['pick'](_0x3914bd[_0xba1b('0x32')],_0x501658[_0xba1b('0x3c')]),_0x4440f9);if(_0x3914bd[_0xba1b('0x32')][_0xba1b('0x3d')]){_0x1e392b[_0xba1b('0x3e')]=_[_0xba1b('0x3f')](_0x1e392b[_0xba1b('0x3e')],{'$or':_['map'](_0x4440f9,function(_0x47b69f){if(_0x47b69f[_0xba1b('0x2f')]!==_0xba1b('0x40')){var _0x511658={};_0x511658[_0x47b69f[_0xba1b('0x28')]]={'$like':'%'+_0x3914bd[_0xba1b('0x32')]['filter']+'%'};return _0x511658;}})});}_0x1e392b=_[_0xba1b('0x3f')]({},_0x1e392b,_0x3914bd[_0xba1b('0x41')]);var _0x4afeab={'where':_0x1e392b[_0xba1b('0x3e')]};return db[_0xba1b('0x2c')]['count'](_0x4afeab)[_0xba1b('0x24')](function(_0x2c342c){_0x379050['count']=_0x2c342c;if(_0x3914bd['query'][_0xba1b('0x42')]){_0x1e392b['include']=[{'all':!![]}];}return db[_0xba1b('0x2c')]['findAll'](_0x1e392b);})[_0xba1b('0x24')](function(_0x5db5b4){_0x379050[_0xba1b('0x43')]=_0x5db5b4;return _0x379050;})[_0xba1b('0x24')](respondWithFilteredResult(_0xa5a362,_0x1e392b))['catch'](handleError(_0xa5a362,null));};exports[_0xba1b('0x44')]=function(_0x46218f,_0x1081e0){var _0x1a4126={'raw':!![],'where':{'id':_0x46218f[_0xba1b('0x45')]['id']}},_0x4fa3bd={};_0x4fa3bd['model']=_[_0xba1b('0x33')](db['Dynamics365Field']['rawAttributes']);_0x4fa3bd['query']=_['keys'](_0x46218f[_0xba1b('0x32')]);_0x4fa3bd['filters']=_[_0xba1b('0x34')](_0x4fa3bd[_0xba1b('0x31')],_0x4fa3bd[_0xba1b('0x32')]);_0x1a4126[_0xba1b('0x35')]=_[_0xba1b('0x34')](_0x4fa3bd[_0xba1b('0x31')],qs['fields'](_0x46218f[_0xba1b('0x32')][_0xba1b('0x36')]));_0x1a4126[_0xba1b('0x35')]=_0x1a4126[_0xba1b('0x35')][_0xba1b('0x37')]?_0x1a4126[_0xba1b('0x35')]:_0x4fa3bd['model'];if(_0x46218f[_0xba1b('0x32')][_0xba1b('0x42')]){_0x1a4126['include']=[{'all':!![]}];}_0x1a4126=_[_0xba1b('0x3f')]({},_0x1a4126,_0x46218f['options']);return db[_0xba1b('0x2c')]['find'](_0x1a4126)['then'](handleEntityNotFound(_0x1081e0,null))[_0xba1b('0x24')](respondWithResult(_0x1081e0,null))[_0xba1b('0x46')](handleError(_0x1081e0,null));};exports['create']=function(_0x129ff2,_0xd8462a){return db[_0xba1b('0x2c')][_0xba1b('0x47')](_0x129ff2['body'],{})[_0xba1b('0x24')](respondWithResult(_0xd8462a,0xc9))[_0xba1b('0x46')](handleError(_0xd8462a,null));};exports[_0xba1b('0x23')]=function(_0x58b294,_0x2590a6){if(_0x58b294[_0xba1b('0x48')]['id']){delete _0x58b294['body']['id'];}return db[_0xba1b('0x2c')][_0xba1b('0x49')]({'where':{'id':_0x58b294[_0xba1b('0x45')]['id']}})['then'](handleEntityNotFound(_0x2590a6,null))['then'](saveUpdates(_0x58b294[_0xba1b('0x48')],null))[_0xba1b('0x24')](respondWithResult(_0x2590a6,null))[_0xba1b('0x46')](handleError(_0x2590a6,null));};exports[_0xba1b('0x4a')]=function(_0x59038f,_0x5c41b2){return db['Dynamics365Field'][_0xba1b('0x49')]({'where':{'id':_0x59038f[_0xba1b('0x45')]['id']}})[_0xba1b('0x24')](handleEntityNotFound(_0x5c41b2,null))[_0xba1b('0x24')](removeEntity(_0x5c41b2,null))['catch'](handleError(_0x5c41b2,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index b580e34..1227f18 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 _0x6f4b=['int_dynamics365_fields','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','define','Dynamics365Field'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x6f4b,0x92));var _0xb6f4=function(_0x523ec1,_0x6461ef){_0x523ec1=_0x523ec1-0x0;var _0x2e1945=_0x6f4b[_0x523ec1];return _0x2e1945;};'use strict';var _=require(_0xb6f4('0x0'));var util=require('util');var logger=require(_0xb6f4('0x1'))(_0xb6f4('0x2'));var moment=require(_0xb6f4('0x3'));var BPromise=require(_0xb6f4('0x4'));var rp=require(_0xb6f4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb6f4('0x6'));var attributes=require('./intDynamics365Field.attributes');module[_0xb6f4('0x7')]=function(_0x4bfee8,_0x5007ce){return _0x4bfee8[_0xb6f4('0x8')](_0xb6f4('0x9'),attributes,{'tableName':_0xb6f4('0xa'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':['idField',_0xb6f4('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb7cb=['rimraf','./intDynamics365Field.attributes','exports','define','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','api','moment','bluebird','request-promise'];(function(_0x323ade,_0x12a9a2){var _0x2abef0=function(_0x27db57){while(--_0x27db57){_0x323ade['push'](_0x323ade['shift']());}};_0x2abef0(++_0x12a9a2);}(_0xb7cb,0x14d));var _0xbb7c=function(_0x4e0026,_0x2b52b6){_0x4e0026=_0x4e0026-0x0;var _0x3f8ee7=_0xb7cb[_0x4e0026];return _0x3f8ee7;};'use strict';var _=require(_0xbb7c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xbb7c('0x1'));var moment=require(_0xbb7c('0x2'));var BPromise=require(_0xbb7c('0x3'));var rp=require(_0xbb7c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbb7c('0x5'));var config=require('../../config/environment');var attributes=require(_0xbb7c('0x6'));module[_0xbb7c('0x7')]=function(_0x3db094,_0x2caeab){return _0x3db094[_0xbb7c('0x8')]('Dynamics365Field',attributes,{'tableName':_0xbb7c('0x9'),'paranoid':![],'indexes':[{'name':_0xbb7c('0xa'),'fields':[_0xbb7c('0xb'),_0xbb7c('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index ac9c3ea..add2d83 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 _0xc3f1=['result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xc3f1,0x7a));var _0x1c3f=function(_0x14f686,_0x23d1ca){_0x14f686=_0x14f686-0x0;var _0x5be8d7=_0xc3f1[_0x14f686];return _0x5be8d7;};'use strict';var _=require(_0x1c3f('0x0'));var util=require(_0x1c3f('0x1'));var moment=require(_0x1c3f('0x2'));var BPromise=require(_0x1c3f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1c3f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1c3f('0x5'));var logger=require(_0x1c3f('0x6'))(_0x1c3f('0x7'));var config=require(_0x1c3f('0x8'));var jayson=require(_0x1c3f('0x9'));var client=jayson['client'][_0x1c3f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3dbcf3,_0x1d87c5,_0x3b472c){return new BPromise(function(_0x343a8e,_0x393082){return client[_0x1c3f('0xb')](_0x3dbcf3,_0x3b472c)[_0x1c3f('0xc')](function(_0x41ceb4){logger[_0x1c3f('0xd')](_0x1c3f('0xe'),_0x1d87c5,'request\x20sent');logger[_0x1c3f('0xf')](_0x1c3f('0x10'),_0x1d87c5,_0x1c3f('0x11'),JSON[_0x1c3f('0x12')](_0x41ceb4));if(_0x41ceb4[_0x1c3f('0x13')]){if(_0x41ceb4['error'][_0x1c3f('0x14')]===0x1f4){logger[_0x1c3f('0x13')](_0x1c3f('0xe'),_0x1d87c5,_0x41ceb4['error'][_0x1c3f('0x15')]);return _0x393082(_0x41ceb4['error'][_0x1c3f('0x15')]);}logger[_0x1c3f('0x13')](_0x1c3f('0xe'),_0x1d87c5,_0x41ceb4[_0x1c3f('0x13')][_0x1c3f('0x15')]);return _0x343a8e(_0x41ceb4[_0x1c3f('0x13')][_0x1c3f('0x15')]);}else{logger[_0x1c3f('0xd')](_0x1c3f('0xe'),_0x1d87c5,_0x1c3f('0x11'));_0x343a8e(_0x41ceb4[_0x1c3f('0x16')][_0x1c3f('0x15')]);}})[_0x1c3f('0x17')](function(_0xcf1dfb){logger[_0x1c3f('0x13')](_0x1c3f('0xe'),_0x1d87c5,_0xcf1dfb);_0x393082(_0xcf1dfb);});});} \ No newline at end of file +var _0x0b3d=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','Dynamics365Field,\x20%s,\x20%s','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','catch','lodash','util','moment','randomstring'];(function(_0x4232dc,_0x49c320){var _0x2f90b3=function(_0x38fc8d){while(--_0x38fc8d){_0x4232dc['push'](_0x4232dc['shift']());}};_0x2f90b3(++_0x49c320);}(_0x0b3d,0x122));var _0xd0b3=function(_0x5418ad,_0x40742f){_0x5418ad=_0x5418ad-0x0;var _0x2cae56=_0x0b3d[_0x5418ad];return _0x2cae56;};'use strict';var _=require(_0xd0b3('0x0'));var util=require(_0xd0b3('0x1'));var moment=require(_0xd0b3('0x2'));var BPromise=require('bluebird');var rs=require(_0xd0b3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd0b3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd0b3('0x5'))('rpc');var config=require(_0xd0b3('0x6'));var jayson=require(_0xd0b3('0x7'));var client=jayson[_0xd0b3('0x8')][_0xd0b3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1b8863,_0x1d0741,_0x2094b2){return new BPromise(function(_0x46d1bd,_0x4a2143){return client[_0xd0b3('0xa')](_0x1b8863,_0x2094b2)['then'](function(_0x43a97f){logger['info'](_0xd0b3('0xb'),_0x1d0741,'request\x20sent');logger[_0xd0b3('0xc')](_0xd0b3('0xd'),_0x1d0741,'request\x20sent',JSON[_0xd0b3('0xe')](_0x43a97f));if(_0x43a97f['error']){if(_0x43a97f[_0xd0b3('0xf')][_0xd0b3('0x10')]===0x1f4){logger[_0xd0b3('0xf')](_0xd0b3('0xb'),_0x1d0741,_0x43a97f[_0xd0b3('0xf')]['message']);return _0x4a2143(_0x43a97f[_0xd0b3('0xf')][_0xd0b3('0x11')]);}logger[_0xd0b3('0xf')](_0xd0b3('0xb'),_0x1d0741,_0x43a97f['error'][_0xd0b3('0x11')]);return _0x46d1bd(_0x43a97f[_0xd0b3('0xf')][_0xd0b3('0x11')]);}else{logger[_0xd0b3('0x12')](_0xd0b3('0xb'),_0x1d0741,_0xd0b3('0x13'));_0x46d1bd(_0x43a97f['result'][_0xd0b3('0x11')]);}})[_0xd0b3('0x14')](function(_0x4cf190){logger[_0xd0b3('0xf')](_0xd0b3('0xb'),_0x1d0741,_0x4cf190);_0x4a2143(_0x4cf190);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index d427f72..9f31219 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 _0xf27f=['/:id/fields','getFields','create','post','put','/:id','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','show','/:id/configurations','getConfigurations'];(function(_0x53b4e1,_0x4a34eb){var _0x1be9bf=function(_0x507caa){while(--_0x507caa){_0x53b4e1['push'](_0x53b4e1['shift']());}};_0x1be9bf(++_0x4a34eb);}(_0xf27f,0x81));var _0xff27=function(_0x4c1962,_0x29fb3a){_0x4c1962=_0x4c1962-0x0;var _0x27575f=_0xf27f[_0x4c1962];return _0x27575f;};'use strict';var multer=require(_0xff27('0x0'));var util=require(_0xff27('0x1'));var path=require(_0xff27('0x2'));var timeout=require('connect-timeout');var express=require(_0xff27('0x3'));var router=express[_0xff27('0x4')]();var fs_extra=require(_0xff27('0x5'));var auth=require(_0xff27('0x6'));var interaction=require(_0xff27('0x7'));var config=require(_0xff27('0x8'));var controller=require(_0xff27('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xff27('0xa')]('/:id',auth[_0xff27('0xb')](),controller[_0xff27('0xc')]);router['get'](_0xff27('0xd'),auth[_0xff27('0xb')](),controller[_0xff27('0xe')]);router[_0xff27('0xa')](_0xff27('0xf'),auth['isAuthenticated'](),controller[_0xff27('0x10')]);router['post']('/',auth[_0xff27('0xb')](),controller[_0xff27('0x11')]);router[_0xff27('0x12')](_0xff27('0xd'),auth[_0xff27('0xb')](),controller['addConfiguration']);router[_0xff27('0x13')](_0xff27('0x14'),auth['isAuthenticated'](),controller[_0xff27('0x15')]);router['delete'](_0xff27('0x14'),auth[_0xff27('0xb')](),controller[_0xff27('0x16')]);module[_0xff27('0x17')]=router; \ No newline at end of file +var _0xaeb3=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','post','create','/:id/configurations','addConfiguration','update'];(function(_0x55f73a,_0xc9b344){var _0x54c371=function(_0x1443b0){while(--_0x1443b0){_0x55f73a['push'](_0x55f73a['shift']());}};_0x54c371(++_0xc9b344);}(_0xaeb3,0x1cd));var _0x3aeb=function(_0x27657c,_0x36813e){_0x27657c=_0x27657c-0x0;var _0x12324a=_0xaeb3[_0x27657c];return _0x12324a;};'use strict';var multer=require(_0x3aeb('0x0'));var util=require(_0x3aeb('0x1'));var path=require(_0x3aeb('0x2'));var timeout=require(_0x3aeb('0x3'));var express=require(_0x3aeb('0x4'));var router=express[_0x3aeb('0x5')]();var fs_extra=require(_0x3aeb('0x6'));var auth=require(_0x3aeb('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3aeb('0x8'));router[_0x3aeb('0x9')]('/',auth[_0x3aeb('0xa')](),controller[_0x3aeb('0xb')]);router['get'](_0x3aeb('0xc'),auth[_0x3aeb('0xa')](),controller[_0x3aeb('0xd')]);router[_0x3aeb('0x9')]('/:id/configurations',auth[_0x3aeb('0xa')](),controller['getConfigurations']);router['get']('/:id/fields',auth[_0x3aeb('0xa')](),controller['getFields']);router[_0x3aeb('0xe')]('/',auth[_0x3aeb('0xa')](),controller[_0x3aeb('0xf')]);router['post'](_0x3aeb('0x10'),auth[_0x3aeb('0xa')](),controller[_0x3aeb('0x11')]);router['put']('/:id',auth[_0x3aeb('0xa')](),controller[_0x3aeb('0x12')]);router['delete'](_0x3aeb('0xc'),auth[_0x3aeb('0xa')](),controller[_0x3aeb('0x13')]);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 90d8f7f..0f16c6f 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 _0xfff0=['username','exports','STRING'];(function(_0x128607,_0x242e5f){var _0x4ba37b=function(_0x42aa1d){while(--_0x42aa1d){_0x128607['push'](_0x128607['shift']());}};_0x4ba37b(++_0x242e5f);}(_0xfff0,0x139));var _0x0fff=function(_0x4dc4eb,_0x4a4b6c){_0x4dc4eb=_0x4dc4eb-0x0;var _0x484840=_0xfff0[_0x4dc4eb];return _0x484840;};'use strict';var Sequelize=require('sequelize');module[_0x0fff('0x0')]={'name':{'type':Sequelize[_0x0fff('0x1')]},'description':{'type':Sequelize[_0x0fff('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x0fff('0x2')},'apiKey':{'type':Sequelize[_0x0fff('0x1')]},'remoteUri':{'type':Sequelize[_0x0fff('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x0fff('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xb44a=['STRING'];(function(_0x49b076,_0x4fb74e){var _0xa3609=function(_0x474e71){while(--_0x474e71){_0x49b076['push'](_0x49b076['shift']());}};_0xa3609(++_0x4fb74e);}(_0xb44a,0x1c2));var _0xab44=function(_0x3ab0ac,_0x1ea9cf){_0x3ab0ac=_0x3ab0ac-0x0;var _0x1f743d=_0xb44a[_0x3ab0ac];return _0x1f743d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xab44('0x0')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xab44('0x0')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xab44('0x0')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xab44('0x0')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index be733ed..ff63997 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 _0xd3b4=['format','%s/%s','Basic\x20%s','%s:X','apiKey','toString','base64','requester','subject','agent','priority','group','source','ticket_type','company','remove','includes','default','custom_text','choices','capitalize','test','statusCode','stringify','send','eml-format','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','limit','undefined','count','set','apply','save','update','destroy','then','sendStatus','error','stack','name','index','FreshdeskAccount','fieldName','key','model','map','filters','query','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','options','includeAll','include','rows','catch','show','params','keys','find','create','body','findOne','FreshdeskConfiguration','rawAttributes','length','getConfigurations','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','remoteUri','slice','substring','lastIndexOf','GET'];(function(_0x2b7891,_0xedce2b){var _0x1e3218=function(_0x455b93){while(--_0x455b93){_0x2b7891['push'](_0x2b7891['shift']());}};_0x1e3218(++_0xedce2b);}(_0xd3b4,0x1e9));var _0x4d3b=function(_0xd1b925,_0x706f6f){_0xd1b925=_0xd1b925-0x0;var _0x49d59e=_0xd3b4[_0xd1b925];return _0x49d59e;};'use strict';var emlformat=require(_0x4d3b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4d3b('0x1'));var rp=require(_0x4d3b('0x2'));var moment=require(_0x4d3b('0x3'));var BPromise=require(_0x4d3b('0x4'));var Mustache=require('mustache');var util=require(_0x4d3b('0x5'));var path=require('path');var sox=require(_0x4d3b('0x6'));var csv=require(_0x4d3b('0x7'));var ejs=require(_0x4d3b('0x8'));var fs=require('fs');var fs_extra=require(_0x4d3b('0x9'));var _=require(_0x4d3b('0xa'));var squel=require(_0x4d3b('0xb'));var crypto=require(_0x4d3b('0xc'));var jsforce=require(_0x4d3b('0xd'));var deskjs=require(_0x4d3b('0xe'));var toCsv=require(_0x4d3b('0x7'));var querystring=require('querystring');var Papa=require(_0x4d3b('0xf'));var Redis=require('ioredis');var authService=require(_0x4d3b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4d3b('0x11'));var hardwareService=require(_0x4d3b('0x12'));var logger=require(_0x4d3b('0x13'))(_0x4d3b('0x14'));var utils=require(_0x4d3b('0x15'));var config=require(_0x4d3b('0x16'));var licenseUtil=require(_0x4d3b('0x17'));var db=require(_0x4d3b('0x18'))['db'];var integrations=require(_0x4d3b('0x19'));function respondWithStatusCode(_0xa23977,_0x43e1b6){_0x43e1b6=_0x43e1b6||0xcc;return function(_0x3b87a){if(_0x3b87a){return _0xa23977['sendStatus'](_0x43e1b6);}return _0xa23977[_0x4d3b('0x1a')](_0x43e1b6)[_0x4d3b('0x1b')]();};}function respondWithResult(_0x2f5fa0,_0x156e79){_0x156e79=_0x156e79||0xc8;return function(_0x38fba9){if(_0x38fba9){return _0x2f5fa0[_0x4d3b('0x1a')](_0x156e79)[_0x4d3b('0x1c')](_0x38fba9);}};}function respondWithFilteredResult(_0x263268,_0x19aad9){return function(_0x43a9a2){if(_0x43a9a2){var _0x531d57=typeof _0x19aad9[_0x4d3b('0x1d')]==='undefined'&&typeof _0x19aad9[_0x4d3b('0x1e')]===_0x4d3b('0x1f');var _0x15cc17=_0x43a9a2[_0x4d3b('0x20')];var _0x4f5ac6=_0x531d57?0x0:_0x19aad9[_0x4d3b('0x1d')];var _0x393b68=_0x531d57?_0x43a9a2[_0x4d3b('0x20')]:_0x19aad9[_0x4d3b('0x1d')]+_0x19aad9[_0x4d3b('0x1e')];var _0x76a01a;if(_0x393b68>=_0x15cc17){_0x393b68=_0x15cc17;_0x76a01a=0xc8;}else{_0x76a01a=0xce;}_0x263268[_0x4d3b('0x1a')](_0x76a01a);return _0x263268[_0x4d3b('0x21')]('Content-Range',_0x4f5ac6+'-'+_0x393b68+'/'+_0x15cc17)[_0x4d3b('0x1c')](_0x43a9a2);}return null;};}function patchUpdates(_0x401d86){return function(_0x122169){try{jsonpatch[_0x4d3b('0x22')](_0x122169,_0x401d86,!![]);}catch(_0x40ede6){return BPromise['reject'](_0x40ede6);}return _0x122169[_0x4d3b('0x23')]();};}function saveUpdates(_0x19c4c0,_0x335bd8){return function(_0x557811){if(_0x557811){return _0x557811[_0x4d3b('0x24')](_0x19c4c0)['then'](function(_0x1a7b5c){return _0x1a7b5c;});}return null;};}function removeEntity(_0x293388,_0xc3fe1d){return function(_0x5b94fc){if(_0x5b94fc){return _0x5b94fc[_0x4d3b('0x25')]()[_0x4d3b('0x26')](function(){_0x293388[_0x4d3b('0x1a')](0xcc)[_0x4d3b('0x1b')]();});}};}function handleEntityNotFound(_0x51856d,_0x260cd3){return function(_0x7ac21c){if(!_0x7ac21c){_0x51856d[_0x4d3b('0x27')](0x194);}return _0x7ac21c;};}function handleError(_0x4b0605,_0x2486ef){_0x2486ef=_0x2486ef||0x1f4;return function(_0xcf99a5){logger[_0x4d3b('0x28')](_0xcf99a5[_0x4d3b('0x29')]);if(_0xcf99a5[_0x4d3b('0x2a')]){delete _0xcf99a5['name'];}_0x4b0605[_0x4d3b('0x1a')](_0x2486ef)['send'](_0xcf99a5);};}exports[_0x4d3b('0x2b')]=function(_0x3993a5,_0x239ee9){var _0x3239bf={},_0x147799={},_0x2a57d4={'count':0x0,'rows':[]};var _0x491116=_['map'](db[_0x4d3b('0x2c')]['rawAttributes'],function(_0x5dc8a9){return{'name':_0x5dc8a9[_0x4d3b('0x2d')],'type':_0x5dc8a9['type'][_0x4d3b('0x2e')]};});_0x147799[_0x4d3b('0x2f')]=_[_0x4d3b('0x30')](_0x491116,_0x4d3b('0x2a'));_0x147799['query']=_['keys'](_0x3993a5['query']);_0x147799[_0x4d3b('0x31')]=_['intersection'](_0x147799[_0x4d3b('0x2f')],_0x147799[_0x4d3b('0x32')]);_0x3239bf[_0x4d3b('0x33')]=_[_0x4d3b('0x34')](_0x147799[_0x4d3b('0x2f')],qs[_0x4d3b('0x35')](_0x3993a5[_0x4d3b('0x32')][_0x4d3b('0x35')]));_0x3239bf[_0x4d3b('0x33')]=_0x3239bf[_0x4d3b('0x33')]['length']?_0x3239bf[_0x4d3b('0x33')]:_0x147799['model'];if(!_0x3993a5['query'][_0x4d3b('0x36')](_0x4d3b('0x37'))){_0x3239bf[_0x4d3b('0x1e')]=qs[_0x4d3b('0x1e')](_0x3993a5[_0x4d3b('0x32')][_0x4d3b('0x1e')]);_0x3239bf[_0x4d3b('0x1d')]=qs[_0x4d3b('0x1d')](_0x3993a5[_0x4d3b('0x32')][_0x4d3b('0x1d')]);}_0x3239bf['order']=qs[_0x4d3b('0x38')](_0x3993a5['query']['sort']);_0x3239bf[_0x4d3b('0x39')]=qs[_0x4d3b('0x31')](_[_0x4d3b('0x3a')](_0x3993a5[_0x4d3b('0x32')],_0x147799['filters']),_0x491116);if(_0x3993a5['query'][_0x4d3b('0x3b')]){_0x3239bf[_0x4d3b('0x39')]=_[_0x4d3b('0x3c')](_0x3239bf['where'],{'$or':_[_0x4d3b('0x30')](_0x491116,function(_0x1f529f){if(_0x1f529f[_0x4d3b('0x3d')]!=='VIRTUAL'){var _0x10a3fc={};_0x10a3fc[_0x1f529f[_0x4d3b('0x2a')]]={'$like':'%'+_0x3993a5[_0x4d3b('0x32')]['filter']+'%'};return _0x10a3fc;}})});}_0x3239bf=_[_0x4d3b('0x3c')]({},_0x3239bf,_0x3993a5[_0x4d3b('0x3e')]);var _0x1b8969={'where':_0x3239bf[_0x4d3b('0x39')]};return db[_0x4d3b('0x2c')][_0x4d3b('0x20')](_0x1b8969)['then'](function(_0x3b6deb){_0x2a57d4[_0x4d3b('0x20')]=_0x3b6deb;if(_0x3993a5['query'][_0x4d3b('0x3f')]){_0x3239bf[_0x4d3b('0x40')]=[{'all':!![]}];}return db['FreshdeskAccount']['findAll'](_0x3239bf);})[_0x4d3b('0x26')](function(_0x3b0f39){_0x2a57d4[_0x4d3b('0x41')]=_0x3b0f39;return _0x2a57d4;})[_0x4d3b('0x26')](respondWithFilteredResult(_0x239ee9,_0x3239bf))[_0x4d3b('0x42')](handleError(_0x239ee9,null));};exports[_0x4d3b('0x43')]=function(_0x46b274,_0x372858){var _0xe623ca={'raw':![],'where':{'id':_0x46b274[_0x4d3b('0x44')]['id']}},_0x45d6fa={};_0x45d6fa['model']=_[_0x4d3b('0x45')](db[_0x4d3b('0x2c')]['rawAttributes']);_0x45d6fa[_0x4d3b('0x32')]=_[_0x4d3b('0x45')](_0x46b274['query']);_0x45d6fa[_0x4d3b('0x31')]=_[_0x4d3b('0x34')](_0x45d6fa[_0x4d3b('0x2f')],_0x45d6fa['query']);_0xe623ca['attributes']=_[_0x4d3b('0x34')](_0x45d6fa[_0x4d3b('0x2f')],qs[_0x4d3b('0x35')](_0x46b274[_0x4d3b('0x32')]['fields']));_0xe623ca[_0x4d3b('0x33')]=_0xe623ca[_0x4d3b('0x33')]['length']?_0xe623ca[_0x4d3b('0x33')]:_0x45d6fa[_0x4d3b('0x2f')];if(_0x46b274['query'][_0x4d3b('0x3f')]){_0xe623ca[_0x4d3b('0x40')]=[{'all':!![]}];}_0xe623ca=_[_0x4d3b('0x3c')]({},_0xe623ca,_0x46b274[_0x4d3b('0x3e')]);return db[_0x4d3b('0x2c')][_0x4d3b('0x46')](_0xe623ca)[_0x4d3b('0x26')](handleEntityNotFound(_0x372858,null))['then'](respondWithResult(_0x372858,null))[_0x4d3b('0x42')](handleError(_0x372858,null));};exports[_0x4d3b('0x47')]=function(_0xf80cb4,_0xb49d74){return db[_0x4d3b('0x2c')][_0x4d3b('0x47')](_0xf80cb4['body'],{})[_0x4d3b('0x26')](respondWithResult(_0xb49d74,0xc9))[_0x4d3b('0x42')](handleError(_0xb49d74,null));};exports[_0x4d3b('0x24')]=function(_0x178dda,_0x3d2773){if(_0x178dda[_0x4d3b('0x48')]['id']){delete _0x178dda[_0x4d3b('0x48')]['id'];}return db[_0x4d3b('0x2c')][_0x4d3b('0x46')]({'where':{'id':_0x178dda[_0x4d3b('0x44')]['id']}})[_0x4d3b('0x26')](handleEntityNotFound(_0x3d2773,null))[_0x4d3b('0x26')](saveUpdates(_0x178dda['body'],null))[_0x4d3b('0x26')](respondWithResult(_0x3d2773,null))[_0x4d3b('0x42')](handleError(_0x3d2773,null));};exports[_0x4d3b('0x25')]=function(_0x1127c5,_0x364ce1){return db['FreshdeskAccount'][_0x4d3b('0x46')]({'where':{'id':_0x1127c5['params']['id']}})[_0x4d3b('0x26')](handleEntityNotFound(_0x364ce1,null))['then'](removeEntity(_0x364ce1,null))[_0x4d3b('0x42')](handleError(_0x364ce1,null));};exports['getConfigurations']=function(_0x6b8319,_0x2f7791,_0x1fd57a){var _0x2f47b1={};var _0x1beff9={};var _0xa8a054;var _0x171499;return db[_0x4d3b('0x2c')][_0x4d3b('0x49')]({'where':{'id':_0x6b8319[_0x4d3b('0x44')]['id']}})[_0x4d3b('0x26')](handleEntityNotFound(_0x2f7791,null))[_0x4d3b('0x26')](function(_0x576273){if(_0x576273){_0xa8a054=_0x576273;_0x1beff9[_0x4d3b('0x2f')]=_[_0x4d3b('0x45')](db[_0x4d3b('0x4a')][_0x4d3b('0x4b')]);_0x1beff9['query']=_[_0x4d3b('0x45')](_0x6b8319['query']);_0x1beff9[_0x4d3b('0x31')]=_[_0x4d3b('0x34')](_0x1beff9[_0x4d3b('0x2f')],_0x1beff9['query']);_0x2f47b1[_0x4d3b('0x33')]=_[_0x4d3b('0x34')](_0x1beff9[_0x4d3b('0x2f')],qs[_0x4d3b('0x35')](_0x6b8319[_0x4d3b('0x32')]['fields']));_0x2f47b1[_0x4d3b('0x33')]=_0x2f47b1[_0x4d3b('0x33')][_0x4d3b('0x4c')]?_0x2f47b1[_0x4d3b('0x33')]:_0x1beff9[_0x4d3b('0x2f')];_0x2f47b1['order']=qs[_0x4d3b('0x38')](_0x6b8319['query'][_0x4d3b('0x38')]);_0x2f47b1['where']=qs[_0x4d3b('0x31')](_[_0x4d3b('0x3a')](_0x6b8319['query'],_0x1beff9[_0x4d3b('0x31')]));if(_0x6b8319['query'][_0x4d3b('0x3b')]){_0x2f47b1[_0x4d3b('0x39')]=_[_0x4d3b('0x3c')](_0x2f47b1[_0x4d3b('0x39')],{'$or':_['map'](_0x2f47b1[_0x4d3b('0x33')],function(_0x40d68c){var _0x35dfe7={};_0x35dfe7[_0x40d68c]={'$like':'%'+_0x6b8319[_0x4d3b('0x32')][_0x4d3b('0x3b')]+'%'};return _0x35dfe7;})});}_0x2f47b1=_[_0x4d3b('0x3c')]({},_0x2f47b1,_0x6b8319['options']);return _0xa8a054[_0x4d3b('0x4d')](_0x2f47b1);}})[_0x4d3b('0x26')](function(_0x5b82b0){if(_0x5b82b0){_0x171499=_0x5b82b0[_0x4d3b('0x4c')];if(!_0x6b8319[_0x4d3b('0x32')][_0x4d3b('0x36')]('nolimit')){_0x2f47b1[_0x4d3b('0x1e')]=qs[_0x4d3b('0x1e')](_0x6b8319[_0x4d3b('0x32')]['limit']);_0x2f47b1[_0x4d3b('0x1d')]=qs[_0x4d3b('0x1d')](_0x6b8319[_0x4d3b('0x32')][_0x4d3b('0x1d')]);}return _0xa8a054['getConfigurations'](_0x2f47b1);}})[_0x4d3b('0x26')](function(_0xe00311){if(_0xe00311){return _0xe00311?{'count':_0x171499,'rows':_0xe00311}:null;}})['then'](respondWithResult(_0x2f7791,null))[_0x4d3b('0x42')](handleError(_0x2f7791,null));};exports['addConfiguration']=function(_0x35a7bf,_0x2d8135,_0x13a9f0){if(_0x35a7bf['body']['id']){delete _0x35a7bf['body']['id'];}return db[_0x4d3b('0x2c')][_0x4d3b('0x49')]({'where':{'id':_0x35a7bf['params']['id']}})[_0x4d3b('0x26')](handleEntityNotFound(_0x2d8135,null))[_0x4d3b('0x26')](function(_0x5acd44){if(_0x5acd44){_0x35a7bf[_0x4d3b('0x48')][_0x4d3b('0x4e')]=_0x5acd44['id'];_0x35a7bf[_0x4d3b('0x48')][_0x4d3b('0x4f')]=integrations[_0x4d3b('0x50')](_0x35a7bf[_0x4d3b('0x48')][_0x4d3b('0x51')],_0x35a7bf[_0x4d3b('0x48')]['type']);_0x35a7bf[_0x4d3b('0x48')][_0x4d3b('0x52')]=integrations[_0x4d3b('0x53')](_0x35a7bf[_0x4d3b('0x48')][_0x4d3b('0x51')],_0x35a7bf[_0x4d3b('0x48')][_0x4d3b('0x3d')]);return db[_0x4d3b('0x4a')][_0x4d3b('0x47')](_0x35a7bf[_0x4d3b('0x48')],{'include':[{'model':db[_0x4d3b('0x54')],'as':_0x4d3b('0x4f')},{'model':db[_0x4d3b('0x54')],'as':_0x4d3b('0x52')}]});}return null;})[_0x4d3b('0x26')](respondWithResult(_0x2d8135,null))[_0x4d3b('0x42')](handleError(_0x2d8135,null));};exports[_0x4d3b('0x55')]=function(_0x46cb51,_0x2fa618,_0xd7a609){var _0xba5d66='';return db[_0x4d3b('0x2c')][_0x4d3b('0x49')]({'where':{'id':_0x46cb51[_0x4d3b('0x44')]['id']},'attributes':['id','remoteUri','apiKey']})[_0x4d3b('0x26')](handleEntityNotFound(_0x2fa618,null))[_0x4d3b('0x26')](function(_0x17b124){if(_0x17b124){_0xba5d66=_0x17b124[_0x4d3b('0x56')];var _0x7b556d=_0xba5d66[_0x4d3b('0x57')](-0x1);if(_0x7b556d==='/'){_0xba5d66=_0xba5d66[_0x4d3b('0x58')](0x0,_0xba5d66[_0x4d3b('0x59')](_0x7b556d));}return rp({'method':_0x4d3b('0x5a'),'uri':util[_0x4d3b('0x5b')](_0x4d3b('0x5c'),_0xba5d66,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0x4d3b('0x5b')](_0x4d3b('0x5d'),new Buffer(util[_0x4d3b('0x5b')](_0x4d3b('0x5e'),_0x17b124[_0x4d3b('0x5f')]))[_0x4d3b('0x60')](_0x4d3b('0x61')))},'json':!![]});}})['then'](function(_0x98838){if(_0x98838){var _0x4a8e5b=[_0x4d3b('0x62'),_0x4d3b('0x63'),_0x4d3b('0x64'),'description',_0x4d3b('0x1a'),_0x4d3b('0x65'),_0x4d3b('0x66'),_0x4d3b('0x67'),_0x4d3b('0x68'),_0x4d3b('0x66'),_0x4d3b('0x69')];_[_0x4d3b('0x6a')](_0x98838,function(_0x168692){return _0x4a8e5b[_0x4d3b('0x6b')](_0x168692[_0x4d3b('0x2a')])||!_0x168692[_0x4d3b('0x6c')]&&_0x168692[_0x4d3b('0x3d')]!==_0x4d3b('0x6d')&&_0x168692['type']!=='custom_dropdown';});return{'count':_0x98838[_0x4d3b('0x4c')],'rows':_[_0x4d3b('0x30')](_0x98838,function(_0x2b1286){return{'id':_0x2b1286[_0x4d3b('0x2a')],'name':_0x2b1286['label'],'custom':!_0x2b1286['default'],'options':_0x2b1286[_0x4d3b('0x6e')]?_[_0x4d3b('0x30')](_0x2b1286['choices'],function(_0x54c562){return{'name':_[_0x4d3b('0x6f')](_0x54c562),'value':_0x54c562};}):[]};})};}})[_0x4d3b('0x26')](respondWithResult(_0x2fa618,null))[_0x4d3b('0x42')](function(_0x58c6fd){var _0x1057b9=_0x46cb51[_0x4d3b('0x32')][_0x4d3b('0x70')]?0x1f4:_0x58c6fd[_0x4d3b('0x71')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x4d3b('0x55'),_0x1057b9,JSON[_0x4d3b('0x72')](_0x58c6fd));delete _0x58c6fd[_0x4d3b('0x2a')];if(_0x1057b9===0x191){_0x1057b9=0x190;}_0x2fa618[_0x4d3b('0x1a')](_0x1057b9)[_0x4d3b('0x73')](_0x46cb51[_0x4d3b('0x32')][_0x4d3b('0x70')]?{'message':'Wrong\x20credentials','statusCode':_0x58c6fd['statusCode']}:_0x58c6fd);});}; \ No newline at end of file +var _0xb16f=['body','getConfigurations','nolimit','findOne','AccountId','Subjects','type','Descriptions','channel','FreshdeskConfiguration','FreshdeskField','getFields','apiKey','remoteUri','slice','substring','lastIndexOf','GET','%s/%s','api/v2/ticket_fields','%s:X','base64','priority','group','source','ticket_type','company','default','custom_text','label','choices','capitalize','test','statusCode','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','lodash','crypto','desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','then','sendStatus','error','stack','name','index','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','merge','where','VIRTUAL','options','FreshdeskAccount','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create'];(function(_0x109d91,_0x37b324){var _0x4fd53d=function(_0xf74bd6){while(--_0xf74bd6){_0x109d91['push'](_0x109d91['shift']());}};_0x4fd53d(++_0x37b324);}(_0xb16f,0xf6));var _0xfb16=function(_0x4ca288,_0x254dd8){_0x4ca288=_0x4ca288-0x0;var _0x2362c1=_0xb16f[_0x4ca288];return _0x2362c1;};'use strict';var emlformat=require(_0xfb16('0x0'));var rimraf=require(_0xfb16('0x1'));var zipdir=require(_0xfb16('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfb16('0x3'));var moment=require(_0xfb16('0x4'));var BPromise=require(_0xfb16('0x5'));var Mustache=require(_0xfb16('0x6'));var util=require('util');var path=require(_0xfb16('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfb16('0x8'));var squel=require('squel');var crypto=require(_0xfb16('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xfb16('0xa'));var toCsv=require(_0xfb16('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfb16('0xc'));var qs=require(_0xfb16('0xd'));var as=require(_0xfb16('0xe'));var hardwareService=require(_0xfb16('0xf'));var logger=require(_0xfb16('0x10'))(_0xfb16('0x11'));var utils=require(_0xfb16('0x12'));var config=require(_0xfb16('0x13'));var licenseUtil=require(_0xfb16('0x14'));var db=require(_0xfb16('0x15'))['db'];var integrations=require(_0xfb16('0x16'));function respondWithStatusCode(_0x4f3a00,_0xd6eeee){_0xd6eeee=_0xd6eeee||0xcc;return function(_0x59ee42){if(_0x59ee42){return _0x4f3a00['sendStatus'](_0xd6eeee);}return _0x4f3a00[_0xfb16('0x17')](_0xd6eeee)[_0xfb16('0x18')]();};}function respondWithResult(_0x4cdc87,_0x507bcc){_0x507bcc=_0x507bcc||0xc8;return function(_0x321489){if(_0x321489){return _0x4cdc87[_0xfb16('0x17')](_0x507bcc)[_0xfb16('0x19')](_0x321489);}};}function respondWithFilteredResult(_0x1643cc,_0x28cb87){return function(_0xcf5a5){if(_0xcf5a5){var _0x11a5d0=typeof _0x28cb87[_0xfb16('0x1a')]===_0xfb16('0x1b')&&typeof _0x28cb87[_0xfb16('0x1c')]===_0xfb16('0x1b');var _0x394d5e=_0xcf5a5[_0xfb16('0x1d')];var _0x14d05e=_0x11a5d0?0x0:_0x28cb87['offset'];var _0x2b28ea=_0x11a5d0?_0xcf5a5[_0xfb16('0x1d')]:_0x28cb87[_0xfb16('0x1a')]+_0x28cb87['limit'];var _0x5e1ffd;if(_0x2b28ea>=_0x394d5e){_0x2b28ea=_0x394d5e;_0x5e1ffd=0xc8;}else{_0x5e1ffd=0xce;}_0x1643cc[_0xfb16('0x17')](_0x5e1ffd);return _0x1643cc[_0xfb16('0x1e')](_0xfb16('0x1f'),_0x14d05e+'-'+_0x2b28ea+'/'+_0x394d5e)['json'](_0xcf5a5);}return null;};}function patchUpdates(_0x193162){return function(_0x32f13f){try{jsonpatch[_0xfb16('0x20')](_0x32f13f,_0x193162,!![]);}catch(_0x509e70){return BPromise['reject'](_0x509e70);}return _0x32f13f['save']();};}function saveUpdates(_0x27203c,_0x354ef4){return function(_0x39ec10){if(_0x39ec10){return _0x39ec10[_0xfb16('0x21')](_0x27203c)['then'](function(_0x5814e9){return _0x5814e9;});}return null;};}function removeEntity(_0x8ef26c,_0x2aea90){return function(_0x2c1fa3){if(_0x2c1fa3){return _0x2c1fa3[_0xfb16('0x22')]()[_0xfb16('0x23')](function(){_0x8ef26c[_0xfb16('0x17')](0xcc)[_0xfb16('0x18')]();});}};}function handleEntityNotFound(_0x239633,_0x1335a3){return function(_0x360df5){if(!_0x360df5){_0x239633[_0xfb16('0x24')](0x194);}return _0x360df5;};}function handleError(_0x4c194a,_0x1ca17b){_0x1ca17b=_0x1ca17b||0x1f4;return function(_0x15f0e4){logger[_0xfb16('0x25')](_0x15f0e4[_0xfb16('0x26')]);if(_0x15f0e4[_0xfb16('0x27')]){delete _0x15f0e4['name'];}_0x4c194a[_0xfb16('0x17')](_0x1ca17b)['send'](_0x15f0e4);};}exports[_0xfb16('0x28')]=function(_0x21822b,_0xe1a799){var _0x1a92ce={},_0x19fb63={},_0x49d03e={'count':0x0,'rows':[]};var _0x1386d2=_['map'](db['FreshdeskAccount']['rawAttributes'],function(_0x29ebd8){return{'name':_0x29ebd8['fieldName'],'type':_0x29ebd8['type']['key']};});_0x19fb63[_0xfb16('0x29')]=_[_0xfb16('0x2a')](_0x1386d2,_0xfb16('0x27'));_0x19fb63[_0xfb16('0x2b')]=_[_0xfb16('0x2c')](_0x21822b[_0xfb16('0x2b')]);_0x19fb63[_0xfb16('0x2d')]=_[_0xfb16('0x2e')](_0x19fb63['model'],_0x19fb63[_0xfb16('0x2b')]);_0x1a92ce[_0xfb16('0x2f')]=_[_0xfb16('0x2e')](_0x19fb63['model'],qs[_0xfb16('0x30')](_0x21822b[_0xfb16('0x2b')][_0xfb16('0x30')]));_0x1a92ce[_0xfb16('0x2f')]=_0x1a92ce['attributes'][_0xfb16('0x31')]?_0x1a92ce['attributes']:_0x19fb63[_0xfb16('0x29')];if(!_0x21822b[_0xfb16('0x2b')][_0xfb16('0x32')]('nolimit')){_0x1a92ce[_0xfb16('0x1c')]=qs[_0xfb16('0x1c')](_0x21822b[_0xfb16('0x2b')][_0xfb16('0x1c')]);_0x1a92ce['offset']=qs['offset'](_0x21822b[_0xfb16('0x2b')]['offset']);}_0x1a92ce[_0xfb16('0x33')]=qs[_0xfb16('0x34')](_0x21822b[_0xfb16('0x2b')][_0xfb16('0x34')]);_0x1a92ce['where']=qs[_0xfb16('0x2d')](_['pick'](_0x21822b[_0xfb16('0x2b')],_0x19fb63[_0xfb16('0x2d')]),_0x1386d2);if(_0x21822b[_0xfb16('0x2b')][_0xfb16('0x35')]){_0x1a92ce['where']=_[_0xfb16('0x36')](_0x1a92ce[_0xfb16('0x37')],{'$or':_['map'](_0x1386d2,function(_0x294ad0){if(_0x294ad0['type']!==_0xfb16('0x38')){var _0x2c2965={};_0x2c2965[_0x294ad0[_0xfb16('0x27')]]={'$like':'%'+_0x21822b[_0xfb16('0x2b')][_0xfb16('0x35')]+'%'};return _0x2c2965;}})});}_0x1a92ce=_[_0xfb16('0x36')]({},_0x1a92ce,_0x21822b[_0xfb16('0x39')]);var _0x59df93={'where':_0x1a92ce['where']};return db[_0xfb16('0x3a')]['count'](_0x59df93)[_0xfb16('0x23')](function(_0x1336cd){_0x49d03e[_0xfb16('0x1d')]=_0x1336cd;if(_0x21822b['query']['includeAll']){_0x1a92ce[_0xfb16('0x3b')]=[{'all':!![]}];}return db[_0xfb16('0x3a')][_0xfb16('0x3c')](_0x1a92ce);})['then'](function(_0x16d9a9){_0x49d03e[_0xfb16('0x3d')]=_0x16d9a9;return _0x49d03e;})[_0xfb16('0x23')](respondWithFilteredResult(_0xe1a799,_0x1a92ce))[_0xfb16('0x3e')](handleError(_0xe1a799,null));};exports[_0xfb16('0x3f')]=function(_0x37266a,_0x554c5b){var _0x223045={'raw':![],'where':{'id':_0x37266a[_0xfb16('0x40')]['id']}},_0x2807bc={};_0x2807bc['model']=_['keys'](db[_0xfb16('0x3a')][_0xfb16('0x41')]);_0x2807bc['query']=_[_0xfb16('0x2c')](_0x37266a['query']);_0x2807bc[_0xfb16('0x2d')]=_['intersection'](_0x2807bc[_0xfb16('0x29')],_0x2807bc['query']);_0x223045['attributes']=_[_0xfb16('0x2e')](_0x2807bc[_0xfb16('0x29')],qs[_0xfb16('0x30')](_0x37266a['query']['fields']));_0x223045[_0xfb16('0x2f')]=_0x223045[_0xfb16('0x2f')][_0xfb16('0x31')]?_0x223045[_0xfb16('0x2f')]:_0x2807bc[_0xfb16('0x29')];if(_0x37266a[_0xfb16('0x2b')][_0xfb16('0x42')]){_0x223045['include']=[{'all':!![]}];}_0x223045=_['merge']({},_0x223045,_0x37266a[_0xfb16('0x39')]);return db[_0xfb16('0x3a')][_0xfb16('0x43')](_0x223045)[_0xfb16('0x23')](handleEntityNotFound(_0x554c5b,null))['then'](respondWithResult(_0x554c5b,null))[_0xfb16('0x3e')](handleError(_0x554c5b,null));};exports[_0xfb16('0x44')]=function(_0x44a792,_0x2413ce){return db['FreshdeskAccount'][_0xfb16('0x44')](_0x44a792[_0xfb16('0x45')],{})[_0xfb16('0x23')](respondWithResult(_0x2413ce,0xc9))[_0xfb16('0x3e')](handleError(_0x2413ce,null));};exports[_0xfb16('0x21')]=function(_0x3820d6,_0x1f0c12){if(_0x3820d6[_0xfb16('0x45')]['id']){delete _0x3820d6[_0xfb16('0x45')]['id'];}return db[_0xfb16('0x3a')][_0xfb16('0x43')]({'where':{'id':_0x3820d6[_0xfb16('0x40')]['id']}})['then'](handleEntityNotFound(_0x1f0c12,null))[_0xfb16('0x23')](saveUpdates(_0x3820d6[_0xfb16('0x45')],null))['then'](respondWithResult(_0x1f0c12,null))[_0xfb16('0x3e')](handleError(_0x1f0c12,null));};exports[_0xfb16('0x22')]=function(_0x3ac1f9,_0x3eee2c){return db[_0xfb16('0x3a')][_0xfb16('0x43')]({'where':{'id':_0x3ac1f9[_0xfb16('0x40')]['id']}})[_0xfb16('0x23')](handleEntityNotFound(_0x3eee2c,null))[_0xfb16('0x23')](removeEntity(_0x3eee2c,null))[_0xfb16('0x3e')](handleError(_0x3eee2c,null));};exports[_0xfb16('0x46')]=function(_0x260076,_0x5b286b,_0x46d242){var _0x2ee526={};var _0x197ff2={};var _0x50e398;var _0x401721;return db[_0xfb16('0x3a')]['findOne']({'where':{'id':_0x260076[_0xfb16('0x40')]['id']}})[_0xfb16('0x23')](handleEntityNotFound(_0x5b286b,null))[_0xfb16('0x23')](function(_0x2da37b){if(_0x2da37b){_0x50e398=_0x2da37b;_0x197ff2[_0xfb16('0x29')]=_[_0xfb16('0x2c')](db['FreshdeskConfiguration'][_0xfb16('0x41')]);_0x197ff2[_0xfb16('0x2b')]=_['keys'](_0x260076[_0xfb16('0x2b')]);_0x197ff2[_0xfb16('0x2d')]=_['intersection'](_0x197ff2[_0xfb16('0x29')],_0x197ff2['query']);_0x2ee526[_0xfb16('0x2f')]=_['intersection'](_0x197ff2[_0xfb16('0x29')],qs[_0xfb16('0x30')](_0x260076[_0xfb16('0x2b')]['fields']));_0x2ee526[_0xfb16('0x2f')]=_0x2ee526[_0xfb16('0x2f')][_0xfb16('0x31')]?_0x2ee526[_0xfb16('0x2f')]:_0x197ff2['model'];_0x2ee526[_0xfb16('0x33')]=qs[_0xfb16('0x34')](_0x260076[_0xfb16('0x2b')][_0xfb16('0x34')]);_0x2ee526['where']=qs[_0xfb16('0x2d')](_['pick'](_0x260076[_0xfb16('0x2b')],_0x197ff2[_0xfb16('0x2d')]));if(_0x260076[_0xfb16('0x2b')][_0xfb16('0x35')]){_0x2ee526[_0xfb16('0x37')]=_[_0xfb16('0x36')](_0x2ee526['where'],{'$or':_[_0xfb16('0x2a')](_0x2ee526['attributes'],function(_0x236da9){var _0x300349={};_0x300349[_0x236da9]={'$like':'%'+_0x260076[_0xfb16('0x2b')][_0xfb16('0x35')]+'%'};return _0x300349;})});}_0x2ee526=_[_0xfb16('0x36')]({},_0x2ee526,_0x260076['options']);return _0x50e398[_0xfb16('0x46')](_0x2ee526);}})['then'](function(_0x4e5fe7){if(_0x4e5fe7){_0x401721=_0x4e5fe7[_0xfb16('0x31')];if(!_0x260076[_0xfb16('0x2b')][_0xfb16('0x32')](_0xfb16('0x47'))){_0x2ee526[_0xfb16('0x1c')]=qs[_0xfb16('0x1c')](_0x260076[_0xfb16('0x2b')][_0xfb16('0x1c')]);_0x2ee526['offset']=qs[_0xfb16('0x1a')](_0x260076['query'][_0xfb16('0x1a')]);}return _0x50e398[_0xfb16('0x46')](_0x2ee526);}})[_0xfb16('0x23')](function(_0x5c0316){if(_0x5c0316){return _0x5c0316?{'count':_0x401721,'rows':_0x5c0316}:null;}})[_0xfb16('0x23')](respondWithResult(_0x5b286b,null))[_0xfb16('0x3e')](handleError(_0x5b286b,null));};exports['addConfiguration']=function(_0x406f0b,_0x217663,_0x5f3cdf){if(_0x406f0b[_0xfb16('0x45')]['id']){delete _0x406f0b['body']['id'];}return db[_0xfb16('0x3a')][_0xfb16('0x48')]({'where':{'id':_0x406f0b['params']['id']}})['then'](handleEntityNotFound(_0x217663,null))[_0xfb16('0x23')](function(_0x4ecdd8){if(_0x4ecdd8){_0x406f0b[_0xfb16('0x45')][_0xfb16('0x49')]=_0x4ecdd8['id'];_0x406f0b[_0xfb16('0x45')][_0xfb16('0x4a')]=integrations['getSubjects'](_0x406f0b[_0xfb16('0x45')]['channel'],_0x406f0b[_0xfb16('0x45')][_0xfb16('0x4b')]);_0x406f0b[_0xfb16('0x45')][_0xfb16('0x4c')]=integrations['getDescriptions'](_0x406f0b['body'][_0xfb16('0x4d')],_0x406f0b[_0xfb16('0x45')][_0xfb16('0x4b')]);return db[_0xfb16('0x4e')]['create'](_0x406f0b[_0xfb16('0x45')],{'include':[{'model':db[_0xfb16('0x4f')],'as':_0xfb16('0x4a')},{'model':db[_0xfb16('0x4f')],'as':_0xfb16('0x4c')}]});}return null;})[_0xfb16('0x23')](respondWithResult(_0x217663,null))['catch'](handleError(_0x217663,null));};exports[_0xfb16('0x50')]=function(_0x1b23e5,_0x3f2642,_0x22aa84){var _0x5e2707='';return db[_0xfb16('0x3a')][_0xfb16('0x48')]({'where':{'id':_0x1b23e5[_0xfb16('0x40')]['id']},'attributes':['id','remoteUri',_0xfb16('0x51')]})[_0xfb16('0x23')](handleEntityNotFound(_0x3f2642,null))[_0xfb16('0x23')](function(_0x16bb2d){if(_0x16bb2d){_0x5e2707=_0x16bb2d[_0xfb16('0x52')];var _0xbb96cd=_0x5e2707[_0xfb16('0x53')](-0x1);if(_0xbb96cd==='/'){_0x5e2707=_0x5e2707[_0xfb16('0x54')](0x0,_0x5e2707[_0xfb16('0x55')](_0xbb96cd));}return rp({'method':_0xfb16('0x56'),'uri':util['format'](_0xfb16('0x57'),_0x5e2707,_0xfb16('0x58')),'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(util['format'](_0xfb16('0x59'),_0x16bb2d['apiKey']))['toString'](_0xfb16('0x5a')))},'json':!![]});}})[_0xfb16('0x23')](function(_0x150b61){if(_0x150b61){var _0x430199=['requester','subject','agent','description',_0xfb16('0x17'),_0xfb16('0x5b'),_0xfb16('0x5c'),_0xfb16('0x5d'),_0xfb16('0x5e'),_0xfb16('0x5c'),_0xfb16('0x5f')];_['remove'](_0x150b61,function(_0x53da0a){return _0x430199['includes'](_0x53da0a[_0xfb16('0x27')])||!_0x53da0a[_0xfb16('0x60')]&&_0x53da0a['type']!==_0xfb16('0x61')&&_0x53da0a[_0xfb16('0x4b')]!=='custom_dropdown';});return{'count':_0x150b61['length'],'rows':_[_0xfb16('0x2a')](_0x150b61,function(_0x28ff0b){return{'id':_0x28ff0b[_0xfb16('0x27')],'name':_0x28ff0b[_0xfb16('0x62')],'custom':!_0x28ff0b[_0xfb16('0x60')],'options':_0x28ff0b['choices']?_[_0xfb16('0x2a')](_0x28ff0b[_0xfb16('0x63')],function(_0x56f037){return{'name':_[_0xfb16('0x64')](_0x56f037),'value':_0x56f037};}):[]};})};}})[_0xfb16('0x23')](respondWithResult(_0x3f2642,null))[_0xfb16('0x3e')](function(_0x322d42){var _0x1c0ce3=_0x1b23e5[_0xfb16('0x2b')][_0xfb16('0x65')]?0x1f4:_0x322d42[_0xfb16('0x66')]||0x1f4;logger[_0xfb16('0x25')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x1c0ce3,JSON['stringify'](_0x322d42));delete _0x322d42[_0xfb16('0x27')];if(_0x1c0ce3===0x191){_0x1c0ce3=0x190;}_0x3f2642['status'](_0x1c0ce3)[_0xfb16('0x67')](_0x1b23e5[_0xfb16('0x2b')]['test']?{'message':_0xfb16('0x68'),'statusCode':_0x322d42[_0xfb16('0x66')]}:_0x322d42);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index a494283..0fdd247 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 _0x25ab=['./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','FreshdeskAccount','int_freshdesk_accounts','lodash','moment','bluebird','request-promise'];(function(_0x2d2ec2,_0x5b3482){var _0x1d4fa4=function(_0x4f7d30){while(--_0x4f7d30){_0x2d2ec2['push'](_0x2d2ec2['shift']());}};_0x1d4fa4(++_0x5b3482);}(_0x25ab,0x95));var _0xb25a=function(_0x22c881,_0x588be2){_0x22c881=_0x22c881-0x0;var _0x4737d2=_0x25ab[_0x22c881];return _0x4737d2;};'use strict';var _=require(_0xb25a('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xb25a('0x1'));var BPromise=require(_0xb25a('0x2'));var rp=require(_0xb25a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb25a('0x4'));var integrations=require(_0xb25a('0x5'));module[_0xb25a('0x6')]=function(_0x22e5bc,_0x2b648d){return _0x22e5bc['define'](_0xb25a('0x7'),attributes,{'tableName':_0xb25a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8d77=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','FreshdeskAccount','int_freshdesk_accounts','lodash'];(function(_0x225f50,_0x48a77d){var _0x19d003=function(_0x58965d){while(--_0x58965d){_0x225f50['push'](_0x225f50['shift']());}};_0x19d003(++_0x48a77d);}(_0x8d77,0xdc));var _0x78d7=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x8d77[_0x3635ce];return _0x97ecd0;};'use strict';var _=require(_0x78d7('0x0'));var util=require(_0x78d7('0x1'));var logger=require(_0x78d7('0x2'))(_0x78d7('0x3'));var moment=require(_0x78d7('0x4'));var BPromise=require(_0x78d7('0x5'));var rp=require(_0x78d7('0x6'));var fs=require('fs');var path=require(_0x78d7('0x7'));var rimraf=require('rimraf');var config=require(_0x78d7('0x8'));var attributes=require(_0x78d7('0x9'));var integrations=require(_0x78d7('0xa'));module['exports']=function(_0x249045,_0x55ae4a){return _0x249045['define'](_0x78d7('0xb'),attributes,{'tableName':_0x78d7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index be108df..e0108df 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 _0x07b9=['where','limit','include','map','model','attributes','ShowFreshdeskAccount','find','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw'];(function(_0x455961,_0x34befd){var _0x38520e=function(_0x578c){while(--_0x578c){_0x455961['push'](_0x455961['shift']());}};_0x38520e(++_0x34befd);}(_0x07b9,0x143));var _0x907b=function(_0x466e57,_0x21b819){_0x466e57=_0x466e57-0x0;var _0x34df42=_0x07b9[_0x466e57];return _0x34df42;};'use strict';var _=require(_0x907b('0x0'));var util=require(_0x907b('0x1'));var moment=require(_0x907b('0x2'));var BPromise=require(_0x907b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x907b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x907b('0x5'));var logger=require(_0x907b('0x6'))(_0x907b('0x7'));var config=require(_0x907b('0x8'));var jayson=require(_0x907b('0x9'));var client=jayson[_0x907b('0xa')][_0x907b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5c124a,_0x78f108,_0x3804a7){return new BPromise(function(_0x43c574,_0x1ff1ca){return client['request'](_0x5c124a,_0x3804a7)['then'](function(_0x34767a){logger[_0x907b('0xc')](_0x907b('0xd'),_0x78f108,_0x907b('0xe'));logger[_0x907b('0xf')](_0x907b('0x10'),_0x78f108,_0x907b('0xe'),JSON[_0x907b('0x11')](_0x34767a));if(_0x34767a[_0x907b('0x12')]){if(_0x34767a[_0x907b('0x12')]['code']===0x1f4){logger[_0x907b('0x12')]('FreshdeskAccount,\x20%s,\x20%s',_0x78f108,_0x34767a['error'][_0x907b('0x13')]);return _0x1ff1ca(_0x34767a[_0x907b('0x12')][_0x907b('0x13')]);}logger[_0x907b('0x12')](_0x907b('0xd'),_0x78f108,_0x34767a[_0x907b('0x12')]['message']);return _0x43c574(_0x34767a[_0x907b('0x12')][_0x907b('0x13')]);}else{logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x78f108,_0x907b('0xe'));_0x43c574(_0x34767a[_0x907b('0x14')][_0x907b('0x13')]);}})[_0x907b('0x15')](function(_0x70dcd5){logger['error'](_0x907b('0xd'),_0x78f108,_0x70dcd5);_0x1ff1ca(_0x70dcd5);});});}exports[_0x907b('0x16')]=function(_0x5d7cd3){var _0xa801ac=this;return new Promise(function(_0x3f055d,_0x12e4fb){return db[_0x907b('0x17')][_0x907b('0x18')]({'raw':_0x5d7cd3[_0x907b('0x19')]?_0x5d7cd3[_0x907b('0x19')][_0x907b('0x1a')]===undefined?!![]:![]:!![],'where':_0x5d7cd3[_0x907b('0x19')]?_0x5d7cd3[_0x907b('0x19')][_0x907b('0x1b')]||null:null,'attributes':_0x5d7cd3[_0x907b('0x19')]?_0x5d7cd3[_0x907b('0x19')]['attributes']||null:null,'limit':_0x5d7cd3[_0x907b('0x19')]?_0x5d7cd3[_0x907b('0x19')][_0x907b('0x1c')]||null:null,'include':_0x5d7cd3[_0x907b('0x19')]?_0x5d7cd3[_0x907b('0x19')][_0x907b('0x1d')]?_[_0x907b('0x1e')](_0x5d7cd3['options'][_0x907b('0x1d')],function(_0xcc67f4){return{'model':db[_0xcc67f4[_0x907b('0x1f')]],'as':_0xcc67f4['as'],'attributes':_0xcc67f4[_0x907b('0x20')],'include':_0xcc67f4[_0x907b('0x1d')]?_[_0x907b('0x1e')](_0xcc67f4[_0x907b('0x1d')],function(_0x3cbf74){return{'model':db[_0x3cbf74[_0x907b('0x1f')]],'as':_0x3cbf74['as'],'attributes':_0x3cbf74[_0x907b('0x20')],'include':_0x3cbf74['include']?_[_0x907b('0x1e')](_0x3cbf74['include'],function(_0x41017e){return{'model':db[_0x41017e[_0x907b('0x1f')]],'as':_0x41017e['as'],'attributes':_0x41017e[_0x907b('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4acd74){logger[_0x907b('0xc')](_0x907b('0x16'),_0x5d7cd3);logger[_0x907b('0xf')](_0x907b('0x16'),_0x5d7cd3,JSON[_0x907b('0x11')](_0x4acd74));_0x3f055d(_0x4acd74);})[_0x907b('0x15')](function(_0x100f98){logger['error'](_0x907b('0x16'),_0x100f98[_0x907b('0x13')],_0x5d7cd3);_0x12e4fb(_0xa801ac['error'](0x1f4,_0x100f98[_0x907b('0x13')]));});});};exports[_0x907b('0x21')]=function(_0x3e536c){var _0x57b926=this;return new Promise(function(_0xf758f2,_0x4d4179){return db[_0x907b('0x17')][_0x907b('0x22')]({'raw':_0x3e536c[_0x907b('0x19')]?_0x3e536c[_0x907b('0x19')][_0x907b('0x1a')]===undefined?!![]:![]:!![],'where':_0x3e536c[_0x907b('0x19')]?_0x3e536c[_0x907b('0x19')][_0x907b('0x1b')]||null:null,'attributes':_0x3e536c[_0x907b('0x19')]?_0x3e536c[_0x907b('0x19')][_0x907b('0x20')]||null:null,'include':_0x3e536c['options']?_0x3e536c[_0x907b('0x19')]['include']?_['map'](_0x3e536c[_0x907b('0x19')]['include'],function(_0x37c833){return{'model':db[_0x37c833[_0x907b('0x1f')]],'as':_0x37c833['as'],'attributes':_0x37c833[_0x907b('0x20')],'include':_0x37c833[_0x907b('0x1d')]?_[_0x907b('0x1e')](_0x37c833[_0x907b('0x1d')],function(_0xc028cf){return{'model':db[_0xc028cf[_0x907b('0x1f')]],'as':_0xc028cf['as'],'attributes':_0xc028cf[_0x907b('0x20')],'include':_0xc028cf[_0x907b('0x1d')]?_[_0x907b('0x1e')](_0xc028cf['include'],function(_0x50f896){return{'model':db[_0x50f896[_0x907b('0x1f')]],'as':_0x50f896['as'],'attributes':_0x50f896['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x108411){logger['info'](_0x907b('0x21'),_0x3e536c);logger[_0x907b('0xf')](_0x907b('0x21'),_0x3e536c,JSON[_0x907b('0x11')](_0x108411));_0xf758f2(_0x108411);})[_0x907b('0x15')](function(_0x15f89d){logger['error']('ShowFreshdeskAccount',_0x15f89d[_0x907b('0x13')],_0x3e536c);_0x4d4179(_0x57b926[_0x907b('0x12')](0x1f4,_0x15f89d[_0x907b('0x13')]));});});}; \ No newline at end of file +var _0xb3dd=['ShowFreshdeskAccount','find','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','limit','include','map','model','attributes','debug','catch'];(function(_0x51cc2e,_0x4b967f){var _0x1aae31=function(_0x3fd51d){while(--_0x3fd51d){_0x51cc2e['push'](_0x51cc2e['shift']());}};_0x1aae31(++_0x4b967f);}(_0xb3dd,0xce));var _0xdb3d=function(_0x273e58,_0x22273d){_0x273e58=_0x273e58-0x0;var _0x5eab8f=_0xb3dd[_0x273e58];return _0x5eab8f;};'use strict';var _=require(_0xdb3d('0x0'));var util=require(_0xdb3d('0x1'));var moment=require('moment');var BPromise=require(_0xdb3d('0x2'));var rs=require(_0xdb3d('0x3'));var fs=require('fs');var Redis=require(_0xdb3d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdb3d('0x5'));var logger=require('../../config/logger')(_0xdb3d('0x6'));var config=require('../../config/environment');var jayson=require(_0xdb3d('0x7'));var client=jayson['client'][_0xdb3d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f8760,_0x5ac328,_0x42b7fa){return new BPromise(function(_0x384fe2,_0x22c04e){return client[_0xdb3d('0x9')](_0x3f8760,_0x42b7fa)[_0xdb3d('0xa')](function(_0x261294){logger[_0xdb3d('0xb')](_0xdb3d('0xc'),_0x5ac328,'request\x20sent');logger['debug'](_0xdb3d('0xd'),_0x5ac328,_0xdb3d('0xe'),JSON[_0xdb3d('0xf')](_0x261294));if(_0x261294[_0xdb3d('0x10')]){if(_0x261294['error'][_0xdb3d('0x11')]===0x1f4){logger[_0xdb3d('0x10')](_0xdb3d('0xc'),_0x5ac328,_0x261294[_0xdb3d('0x10')][_0xdb3d('0x12')]);return _0x22c04e(_0x261294['error']['message']);}logger[_0xdb3d('0x10')](_0xdb3d('0xc'),_0x5ac328,_0x261294[_0xdb3d('0x10')][_0xdb3d('0x12')]);return _0x384fe2(_0x261294['error'][_0xdb3d('0x12')]);}else{logger[_0xdb3d('0xb')](_0xdb3d('0xc'),_0x5ac328,_0xdb3d('0xe'));_0x384fe2(_0x261294['result'][_0xdb3d('0x12')]);}})['catch'](function(_0x2cc87e){logger['error'](_0xdb3d('0xc'),_0x5ac328,_0x2cc87e);_0x22c04e(_0x2cc87e);});});}exports[_0xdb3d('0x13')]=function(_0x115ad6){var _0x4d80b0=this;return new Promise(function(_0x187bb1,_0x5bf464){return db[_0xdb3d('0x14')][_0xdb3d('0x15')]({'raw':_0x115ad6[_0xdb3d('0x16')]?_0x115ad6[_0xdb3d('0x16')][_0xdb3d('0x17')]===undefined?!![]:![]:!![],'where':_0x115ad6[_0xdb3d('0x16')]?_0x115ad6[_0xdb3d('0x16')][_0xdb3d('0x18')]||null:null,'attributes':_0x115ad6[_0xdb3d('0x16')]?_0x115ad6[_0xdb3d('0x16')]['attributes']||null:null,'limit':_0x115ad6[_0xdb3d('0x16')]?_0x115ad6['options'][_0xdb3d('0x19')]||null:null,'include':_0x115ad6[_0xdb3d('0x16')]?_0x115ad6[_0xdb3d('0x16')][_0xdb3d('0x1a')]?_[_0xdb3d('0x1b')](_0x115ad6[_0xdb3d('0x16')][_0xdb3d('0x1a')],function(_0x19a479){return{'model':db[_0x19a479[_0xdb3d('0x1c')]],'as':_0x19a479['as'],'attributes':_0x19a479[_0xdb3d('0x1d')],'include':_0x19a479[_0xdb3d('0x1a')]?_[_0xdb3d('0x1b')](_0x19a479[_0xdb3d('0x1a')],function(_0x5813c0){return{'model':db[_0x5813c0[_0xdb3d('0x1c')]],'as':_0x5813c0['as'],'attributes':_0x5813c0[_0xdb3d('0x1d')],'include':_0x5813c0[_0xdb3d('0x1a')]?_['map'](_0x5813c0['include'],function(_0x48eee9){return{'model':db[_0x48eee9[_0xdb3d('0x1c')]],'as':_0x48eee9['as'],'attributes':_0x48eee9['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a89d3){logger[_0xdb3d('0xb')]('GetFreshdeskAccount',_0x115ad6);logger[_0xdb3d('0x1e')](_0xdb3d('0x13'),_0x115ad6,JSON[_0xdb3d('0xf')](_0x3a89d3));_0x187bb1(_0x3a89d3);})[_0xdb3d('0x1f')](function(_0x2cfbbd){logger[_0xdb3d('0x10')](_0xdb3d('0x13'),_0x2cfbbd[_0xdb3d('0x12')],_0x115ad6);_0x5bf464(_0x4d80b0[_0xdb3d('0x10')](0x1f4,_0x2cfbbd[_0xdb3d('0x12')]));});});};exports[_0xdb3d('0x20')]=function(_0x2f600e){var _0x46d32c=this;return new Promise(function(_0x245b9e,_0x11825f){return db[_0xdb3d('0x14')][_0xdb3d('0x21')]({'raw':_0x2f600e[_0xdb3d('0x16')]?_0x2f600e[_0xdb3d('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x2f600e['options']?_0x2f600e[_0xdb3d('0x16')][_0xdb3d('0x18')]||null:null,'attributes':_0x2f600e[_0xdb3d('0x16')]?_0x2f600e[_0xdb3d('0x16')][_0xdb3d('0x1d')]||null:null,'include':_0x2f600e[_0xdb3d('0x16')]?_0x2f600e['options'][_0xdb3d('0x1a')]?_[_0xdb3d('0x1b')](_0x2f600e['options'][_0xdb3d('0x1a')],function(_0x362967){return{'model':db[_0x362967['model']],'as':_0x362967['as'],'attributes':_0x362967[_0xdb3d('0x1d')],'include':_0x362967[_0xdb3d('0x1a')]?_[_0xdb3d('0x1b')](_0x362967[_0xdb3d('0x1a')],function(_0x4ae51f){return{'model':db[_0x4ae51f[_0xdb3d('0x1c')]],'as':_0x4ae51f['as'],'attributes':_0x4ae51f['attributes'],'include':_0x4ae51f[_0xdb3d('0x1a')]?_[_0xdb3d('0x1b')](_0x4ae51f[_0xdb3d('0x1a')],function(_0x28c33d){return{'model':db[_0x28c33d[_0xdb3d('0x1c')]],'as':_0x28c33d['as'],'attributes':_0x28c33d[_0xdb3d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xdb3d('0xa')](function(_0x585eb2){logger['info']('ShowFreshdeskAccount',_0x2f600e);logger[_0xdb3d('0x1e')](_0xdb3d('0x20'),_0x2f600e,JSON['stringify'](_0x585eb2));_0x245b9e(_0x585eb2);})[_0xdb3d('0x1f')](function(_0x253d65){logger[_0xdb3d('0x10')](_0xdb3d('0x20'),_0x253d65['message'],_0x2f600e);_0x11825f(_0x46d32c['error'](0x1f4,_0x253d65[_0xdb3d('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 664bbbf..b12b5ea 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 _0x1d0d=['isAuthenticated','/:id/fields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','/:id/tags','setTags','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','/:id'];(function(_0x4f6d08,_0x1b3dd0){var _0x53a9c6=function(_0x2e0e0f){while(--_0x2e0e0f){_0x4f6d08['push'](_0x4f6d08['shift']());}};_0x53a9c6(++_0x1b3dd0);}(_0x1d0d,0x1b0));var _0xd1d0=function(_0x234c1c,_0x4ff937){_0x234c1c=_0x234c1c-0x0;var _0x104031=_0x1d0d[_0x234c1c];return _0x104031;};'use strict';var multer=require(_0xd1d0('0x0'));var util=require(_0xd1d0('0x1'));var path=require('path');var timeout=require(_0xd1d0('0x2'));var express=require(_0xd1d0('0x3'));var router=express[_0xd1d0('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd1d0('0x5'));var interaction=require(_0xd1d0('0x6'));var config=require('../../config/environment');var controller=require('./intFreshdeskConfiguration.controller');router[_0xd1d0('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd1d0('0x7')](_0xd1d0('0x8'),auth[_0xd1d0('0x9')](),controller['show']);router[_0xd1d0('0x7')](_0xd1d0('0xa'),auth[_0xd1d0('0x9')](),controller['getFields']);router['get'](_0xd1d0('0xb'),auth[_0xd1d0('0x9')](),controller['getSubjects']);router[_0xd1d0('0x7')](_0xd1d0('0xc'),auth[_0xd1d0('0x9')](),controller[_0xd1d0('0xd')]);router['get']('/:id/tags',auth[_0xd1d0('0x9')](),controller['getTags']);router[_0xd1d0('0xe')]('/',auth['isAuthenticated'](),controller[_0xd1d0('0xf')]);router[_0xd1d0('0xe')](_0xd1d0('0x10'),auth[_0xd1d0('0x9')](),controller[_0xd1d0('0x11')]);router['put'](_0xd1d0('0x8'),auth[_0xd1d0('0x9')](),controller[_0xd1d0('0x12')]);router['delete'](_0xd1d0('0x8'),auth['isAuthenticated'](),controller[_0xd1d0('0x13')]);module[_0xd1d0('0x14')]=router; \ No newline at end of file +var _0x2c5d=['/:id/subjects','isAuthenticated','getSubjects','/:id/descriptions','getDescriptions','post','create','/:id/tags','setTags','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','index','/:id','show'];(function(_0x40123a,_0x1f8a5b){var _0x5f1511=function(_0x914091){while(--_0x914091){_0x40123a['push'](_0x40123a['shift']());}};_0x5f1511(++_0x1f8a5b);}(_0x2c5d,0x15b));var _0xd2c5=function(_0x53329d,_0xcd480d){_0x53329d=_0x53329d-0x0;var _0xf81ddd=_0x2c5d[_0x53329d];return _0xf81ddd;};'use strict';var multer=require('multer');var util=require(_0xd2c5('0x0'));var path=require(_0xd2c5('0x1'));var timeout=require('connect-timeout');var express=require(_0xd2c5('0x2'));var router=express[_0xd2c5('0x3')]();var fs_extra=require(_0xd2c5('0x4'));var auth=require(_0xd2c5('0x5'));var interaction=require(_0xd2c5('0x6'));var config=require(_0xd2c5('0x7'));var controller=require(_0xd2c5('0x8'));router[_0xd2c5('0x9')]('/',auth['isAuthenticated'](),controller[_0xd2c5('0xa')]);router[_0xd2c5('0x9')](_0xd2c5('0xb'),auth['isAuthenticated'](),controller[_0xd2c5('0xc')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0xd2c5('0x9')](_0xd2c5('0xd'),auth[_0xd2c5('0xe')](),controller[_0xd2c5('0xf')]);router[_0xd2c5('0x9')](_0xd2c5('0x10'),auth['isAuthenticated'](),controller[_0xd2c5('0x11')]);router[_0xd2c5('0x9')]('/:id/tags',auth[_0xd2c5('0xe')](),controller['getTags']);router[_0xd2c5('0x12')]('/',auth['isAuthenticated'](),controller[_0xd2c5('0x13')]);router[_0xd2c5('0x12')](_0xd2c5('0x14'),auth[_0xd2c5('0xe')](),controller[_0xd2c5('0x15')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0xd2c5('0xb'),auth['isAuthenticated'](),controller[_0xd2c5('0x16')]);module[_0xd2c5('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 0573892..4db4b81 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 _0xc6c1=['exports','STRING','sequelize'];(function(_0x4f4b53,_0x1f7158){var _0x5b705a=function(_0x290ba6){while(--_0x290ba6){_0x4f4b53['push'](_0x4f4b53['shift']());}};_0x5b705a(++_0x1f7158);}(_0xc6c1,0xc2));var _0x1c6c=function(_0xdbd4f7,_0x4e3bdd){_0xdbd4f7=_0xdbd4f7-0x0;var _0x5c3f9d=_0xc6c1[_0xdbd4f7];return _0x5c3f9d;};'use strict';var Sequelize=require(_0x1c6c('0x0'));module[_0x1c6c('0x1')]={'name':{'type':Sequelize[_0x1c6c('0x2')]},'description':{'type':Sequelize[_0x1c6c('0x2')]}}; \ No newline at end of file +var _0x55de=['STRING','exports'];(function(_0x329c16,_0x23a5e1){var _0x54d505=function(_0x24b047){while(--_0x24b047){_0x329c16['push'](_0x329c16['shift']());}};_0x54d505(++_0x23a5e1);}(_0x55de,0x1b1));var _0xe55d=function(_0x2290ae,_0xbbbf35){_0x2290ae=_0x2290ae-0x0;var _0x38bdd0=_0x55de[_0x2290ae];return _0x38bdd0;};'use strict';var Sequelize=require('sequelize');module[_0xe55d('0x0')]={'name':{'type':Sequelize[_0xe55d('0x1')]},'description':{'type':Sequelize[_0xe55d('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 0833c26..cc316a6 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 _0xab21=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','apply','reject','save','update','then','error','name','index','map','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','FreshdeskConfiguration','catch','show','params','options','find','create','body','destroy','getFields','findOne','FreshdeskField','hasOwnProperty','getSubjects','rawAttributes','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis'];(function(_0x2df4ac,_0x4a0b7b){var _0xa31728=function(_0x451e17){while(--_0x451e17){_0x2df4ac['push'](_0x2df4ac['shift']());}};_0xa31728(++_0x4a0b7b);}(_0xab21,0x13b));var _0x1ab2=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0xab21[_0x49d41c];return _0xb64c5f;};'use strict';var emlformat=require(_0x1ab2('0x0'));var rimraf=require(_0x1ab2('0x1'));var zipdir=require(_0x1ab2('0x2'));var jsonpatch=require(_0x1ab2('0x3'));var rp=require('request-promise');var moment=require(_0x1ab2('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1ab2('0x5'));var path=require('path');var sox=require(_0x1ab2('0x6'));var csv=require(_0x1ab2('0x7'));var ejs=require(_0x1ab2('0x8'));var fs=require('fs');var fs_extra=require(_0x1ab2('0x9'));var _=require(_0x1ab2('0xa'));var squel=require(_0x1ab2('0xb'));var crypto=require(_0x1ab2('0xc'));var jsforce=require(_0x1ab2('0xd'));var deskjs=require(_0x1ab2('0xe'));var toCsv=require(_0x1ab2('0x7'));var querystring=require(_0x1ab2('0xf'));var Papa=require('papaparse');var Redis=require(_0x1ab2('0x10'));var authService=require(_0x1ab2('0x11'));var qs=require(_0x1ab2('0x12'));var as=require(_0x1ab2('0x13'));var hardwareService=require(_0x1ab2('0x14'));var logger=require(_0x1ab2('0x15'))('api');var utils=require(_0x1ab2('0x16'));var config=require(_0x1ab2('0x17'));var licenseUtil=require(_0x1ab2('0x18'));var db=require(_0x1ab2('0x19'))['db'];function respondWithStatusCode(_0x1fb7f0,_0x545a30){_0x545a30=_0x545a30||0xcc;return function(_0x2cb02a){if(_0x2cb02a){return _0x1fb7f0[_0x1ab2('0x1a')](_0x545a30);}return _0x1fb7f0[_0x1ab2('0x1b')](_0x545a30)[_0x1ab2('0x1c')]();};}function respondWithResult(_0x3ea354,_0x20df82){_0x20df82=_0x20df82||0xc8;return function(_0x278f77){if(_0x278f77){return _0x3ea354['status'](_0x20df82)[_0x1ab2('0x1d')](_0x278f77);}};}function respondWithFilteredResult(_0x3bc311,_0x5200bc){return function(_0x5d27df){if(_0x5d27df){var _0x47fcd2=typeof _0x5200bc[_0x1ab2('0x1e')]==='undefined'&&typeof _0x5200bc[_0x1ab2('0x1f')]==='undefined';var _0x4f683d=_0x5d27df[_0x1ab2('0x20')];var _0x39d34c=_0x47fcd2?0x0:_0x5200bc[_0x1ab2('0x1e')];var _0x3b675c=_0x47fcd2?_0x5d27df[_0x1ab2('0x20')]:_0x5200bc[_0x1ab2('0x1e')]+_0x5200bc[_0x1ab2('0x1f')];var _0xd56e1a;if(_0x3b675c>=_0x4f683d){_0x3b675c=_0x4f683d;_0xd56e1a=0xc8;}else{_0xd56e1a=0xce;}_0x3bc311[_0x1ab2('0x1b')](_0xd56e1a);return _0x3bc311[_0x1ab2('0x21')]('Content-Range',_0x39d34c+'-'+_0x3b675c+'/'+_0x4f683d)['json'](_0x5d27df);}return null;};}function patchUpdates(_0x3d122b){return function(_0x5da839){try{jsonpatch[_0x1ab2('0x22')](_0x5da839,_0x3d122b,!![]);}catch(_0x5e0cc1){return BPromise[_0x1ab2('0x23')](_0x5e0cc1);}return _0x5da839[_0x1ab2('0x24')]();};}function saveUpdates(_0x422294,_0x1d4f33){return function(_0xbbdcee){if(_0xbbdcee){return _0xbbdcee[_0x1ab2('0x25')](_0x422294)[_0x1ab2('0x26')](function(_0x7409a6){return _0x7409a6;});}return null;};}function removeEntity(_0x50a346,_0xe54e82){return function(_0x2affd1){if(_0x2affd1){return _0x2affd1['destroy']()['then'](function(){_0x50a346[_0x1ab2('0x1b')](0xcc)[_0x1ab2('0x1c')]();});}};}function handleEntityNotFound(_0x4d10b4,_0x4caa08){return function(_0x282b1e){if(!_0x282b1e){_0x4d10b4[_0x1ab2('0x1a')](0x194);}return _0x282b1e;};}function handleError(_0x542c06,_0x1add9b){_0x1add9b=_0x1add9b||0x1f4;return function(_0x4ec487){logger[_0x1ab2('0x27')](_0x4ec487['stack']);if(_0x4ec487[_0x1ab2('0x28')]){delete _0x4ec487['name'];}_0x542c06[_0x1ab2('0x1b')](_0x1add9b)['send'](_0x4ec487);};}exports[_0x1ab2('0x29')]=function(_0x4d0812,_0x240cde){var _0x55b885={},_0x25456d={},_0x4b4a5f={'count':0x0,'rows':[]};var _0x98ba07=_[_0x1ab2('0x2a')](db['FreshdeskConfiguration']['rawAttributes'],function(_0x5830c5){return{'name':_0x5830c5[_0x1ab2('0x2b')],'type':_0x5830c5[_0x1ab2('0x2c')][_0x1ab2('0x2d')]};});_0x25456d[_0x1ab2('0x2e')]=_[_0x1ab2('0x2a')](_0x98ba07,_0x1ab2('0x28'));_0x25456d[_0x1ab2('0x2f')]=_[_0x1ab2('0x30')](_0x4d0812[_0x1ab2('0x2f')]);_0x25456d['filters']=_[_0x1ab2('0x31')](_0x25456d[_0x1ab2('0x2e')],_0x25456d['query']);_0x55b885[_0x1ab2('0x32')]=_[_0x1ab2('0x31')](_0x25456d['model'],qs[_0x1ab2('0x33')](_0x4d0812[_0x1ab2('0x2f')][_0x1ab2('0x33')]));_0x55b885[_0x1ab2('0x32')]=_0x55b885['attributes'][_0x1ab2('0x34')]?_0x55b885[_0x1ab2('0x32')]:_0x25456d['model'];if(!_0x4d0812[_0x1ab2('0x2f')]['hasOwnProperty'](_0x1ab2('0x35'))){_0x55b885[_0x1ab2('0x1f')]=qs[_0x1ab2('0x1f')](_0x4d0812['query']['limit']);_0x55b885[_0x1ab2('0x1e')]=qs[_0x1ab2('0x1e')](_0x4d0812[_0x1ab2('0x2f')]['offset']);}_0x55b885[_0x1ab2('0x36')]=qs[_0x1ab2('0x37')](_0x4d0812['query']['sort']);_0x55b885[_0x1ab2('0x38')]=qs[_0x1ab2('0x39')](_[_0x1ab2('0x3a')](_0x4d0812[_0x1ab2('0x2f')],_0x25456d[_0x1ab2('0x39')]),_0x98ba07);if(_0x4d0812['query'][_0x1ab2('0x3b')]){_0x55b885[_0x1ab2('0x38')]=_[_0x1ab2('0x3c')](_0x55b885[_0x1ab2('0x38')],{'$or':_['map'](_0x98ba07,function(_0x28a1a4){if(_0x28a1a4['type']!==_0x1ab2('0x3d')){var _0x328041={};_0x328041[_0x28a1a4[_0x1ab2('0x28')]]={'$like':'%'+_0x4d0812['query'][_0x1ab2('0x3b')]+'%'};return _0x328041;}})});}_0x55b885=_['merge']({},_0x55b885,_0x4d0812['options']);var _0x37145b={'where':_0x55b885['where']};return db['FreshdeskConfiguration'][_0x1ab2('0x20')](_0x37145b)[_0x1ab2('0x26')](function(_0x451557){_0x4b4a5f[_0x1ab2('0x20')]=_0x451557;if(_0x4d0812[_0x1ab2('0x2f')][_0x1ab2('0x3e')]){_0x55b885[_0x1ab2('0x3f')]=[{'all':!![]}];}return db[_0x1ab2('0x40')]['findAll'](_0x55b885);})[_0x1ab2('0x26')](function(_0x1066f6){_0x4b4a5f['rows']=_0x1066f6;return _0x4b4a5f;})[_0x1ab2('0x26')](respondWithFilteredResult(_0x240cde,_0x55b885))[_0x1ab2('0x41')](handleError(_0x240cde,null));};exports[_0x1ab2('0x42')]=function(_0x808779,_0x12243c){var _0x5f2bf6={'raw':![],'where':{'id':_0x808779[_0x1ab2('0x43')]['id']}},_0xf68856={};_0xf68856[_0x1ab2('0x2e')]=_[_0x1ab2('0x30')](db[_0x1ab2('0x40')]['rawAttributes']);_0xf68856[_0x1ab2('0x2f')]=_[_0x1ab2('0x30')](_0x808779[_0x1ab2('0x2f')]);_0xf68856[_0x1ab2('0x39')]=_[_0x1ab2('0x31')](_0xf68856[_0x1ab2('0x2e')],_0xf68856[_0x1ab2('0x2f')]);_0x5f2bf6[_0x1ab2('0x32')]=_['intersection'](_0xf68856[_0x1ab2('0x2e')],qs[_0x1ab2('0x33')](_0x808779['query'][_0x1ab2('0x33')]));_0x5f2bf6['attributes']=_0x5f2bf6[_0x1ab2('0x32')][_0x1ab2('0x34')]?_0x5f2bf6[_0x1ab2('0x32')]:_0xf68856['model'];if(_0x808779[_0x1ab2('0x2f')][_0x1ab2('0x3e')]){_0x5f2bf6[_0x1ab2('0x3f')]=[{'all':!![]}];}_0x5f2bf6=_[_0x1ab2('0x3c')]({},_0x5f2bf6,_0x808779[_0x1ab2('0x44')]);return db[_0x1ab2('0x40')][_0x1ab2('0x45')](_0x5f2bf6)[_0x1ab2('0x26')](handleEntityNotFound(_0x12243c,null))[_0x1ab2('0x26')](respondWithResult(_0x12243c,null))[_0x1ab2('0x41')](handleError(_0x12243c,null));};exports[_0x1ab2('0x46')]=function(_0x4ee1b8,_0x3c003b){return db[_0x1ab2('0x40')][_0x1ab2('0x46')](_0x4ee1b8['body'],{})[_0x1ab2('0x26')](respondWithResult(_0x3c003b,0xc9))[_0x1ab2('0x41')](handleError(_0x3c003b,null));};exports['update']=function(_0x155577,_0x2ab830){if(_0x155577[_0x1ab2('0x47')]['id']){delete _0x155577[_0x1ab2('0x47')]['id'];}return db[_0x1ab2('0x40')][_0x1ab2('0x45')]({'where':{'id':_0x155577[_0x1ab2('0x43')]['id']}})['then'](handleEntityNotFound(_0x2ab830,null))[_0x1ab2('0x26')](saveUpdates(_0x155577['body'],null))[_0x1ab2('0x26')](respondWithResult(_0x2ab830,null))[_0x1ab2('0x41')](handleError(_0x2ab830,null));};exports[_0x1ab2('0x48')]=function(_0xfc6eeb,_0x562b18){return db[_0x1ab2('0x40')]['find']({'where':{'id':_0xfc6eeb[_0x1ab2('0x43')]['id']}})['then'](handleEntityNotFound(_0x562b18,null))[_0x1ab2('0x26')](removeEntity(_0x562b18,null))[_0x1ab2('0x41')](handleError(_0x562b18,null));};exports[_0x1ab2('0x49')]=function(_0x4e8d9b,_0x577a7c,_0x81545a){var _0x133250={};var _0x2121c0={};var _0x4942d3;var _0x2da5f8;return db[_0x1ab2('0x40')][_0x1ab2('0x4a')]({'where':{'id':_0x4e8d9b['params']['id']}})[_0x1ab2('0x26')](handleEntityNotFound(_0x577a7c,null))[_0x1ab2('0x26')](function(_0xa81cd8){if(_0xa81cd8){_0x4942d3=_0xa81cd8;_0x2121c0['model']=_[_0x1ab2('0x30')](db[_0x1ab2('0x4b')]['rawAttributes']);_0x2121c0[_0x1ab2('0x2f')]=_[_0x1ab2('0x30')](_0x4e8d9b[_0x1ab2('0x2f')]);_0x2121c0[_0x1ab2('0x39')]=_[_0x1ab2('0x31')](_0x2121c0[_0x1ab2('0x2e')],_0x2121c0[_0x1ab2('0x2f')]);_0x133250[_0x1ab2('0x32')]=_[_0x1ab2('0x31')](_0x2121c0[_0x1ab2('0x2e')],qs[_0x1ab2('0x33')](_0x4e8d9b[_0x1ab2('0x2f')][_0x1ab2('0x33')]));_0x133250['attributes']=_0x133250['attributes'][_0x1ab2('0x34')]?_0x133250[_0x1ab2('0x32')]:_0x2121c0['model'];_0x133250[_0x1ab2('0x36')]=qs['sort'](_0x4e8d9b[_0x1ab2('0x2f')][_0x1ab2('0x37')]);_0x133250['where']=qs['filters'](_['pick'](_0x4e8d9b['query'],_0x2121c0[_0x1ab2('0x39')]));if(_0x4e8d9b[_0x1ab2('0x2f')][_0x1ab2('0x3b')]){_0x133250['where']=_[_0x1ab2('0x3c')](_0x133250[_0x1ab2('0x38')],{'$or':_[_0x1ab2('0x2a')](_0x133250[_0x1ab2('0x32')],function(_0x2f112b){var _0x3f4c00={};_0x3f4c00[_0x2f112b]={'$like':'%'+_0x4e8d9b[_0x1ab2('0x2f')][_0x1ab2('0x3b')]+'%'};return _0x3f4c00;})});}_0x133250=_[_0x1ab2('0x3c')]({},_0x133250,_0x4e8d9b[_0x1ab2('0x44')]);return _0x4942d3['getFields'](_0x133250);}})[_0x1ab2('0x26')](function(_0x3a63e5){if(_0x3a63e5){_0x2da5f8=_0x3a63e5[_0x1ab2('0x34')];if(!_0x4e8d9b['query'][_0x1ab2('0x4c')](_0x1ab2('0x35'))){_0x133250['limit']=qs[_0x1ab2('0x1f')](_0x4e8d9b[_0x1ab2('0x2f')][_0x1ab2('0x1f')]);_0x133250['offset']=qs[_0x1ab2('0x1e')](_0x4e8d9b['query']['offset']);}return _0x4942d3[_0x1ab2('0x49')](_0x133250);}})['then'](function(_0x6f7f0a){if(_0x6f7f0a){return _0x6f7f0a?{'count':_0x2da5f8,'rows':_0x6f7f0a}:null;}})[_0x1ab2('0x26')](respondWithResult(_0x577a7c,null))[_0x1ab2('0x41')](handleError(_0x577a7c,null));};exports[_0x1ab2('0x4d')]=function(_0x1ec173,_0x180fc5,_0x477ff9){var _0x25ea9e={};var _0x224d3c={};var _0x13edd9;var _0x952c38;return db[_0x1ab2('0x40')]['findOne']({'where':{'id':_0x1ec173[_0x1ab2('0x43')]['id']}})[_0x1ab2('0x26')](handleEntityNotFound(_0x180fc5,null))[_0x1ab2('0x26')](function(_0x5905a5){if(_0x5905a5){_0x13edd9=_0x5905a5;_0x224d3c[_0x1ab2('0x2e')]=_[_0x1ab2('0x30')](db[_0x1ab2('0x4b')][_0x1ab2('0x4e')]);_0x224d3c[_0x1ab2('0x2f')]=_[_0x1ab2('0x30')](_0x1ec173['query']);_0x224d3c[_0x1ab2('0x39')]=_[_0x1ab2('0x31')](_0x224d3c['model'],_0x224d3c[_0x1ab2('0x2f')]);_0x25ea9e[_0x1ab2('0x32')]=_[_0x1ab2('0x31')](_0x224d3c[_0x1ab2('0x2e')],qs[_0x1ab2('0x33')](_0x1ec173[_0x1ab2('0x2f')][_0x1ab2('0x33')]));_0x25ea9e['attributes']=_0x25ea9e[_0x1ab2('0x32')]['length']?_0x25ea9e[_0x1ab2('0x32')]:_0x224d3c[_0x1ab2('0x2e')];_0x25ea9e[_0x1ab2('0x36')]=qs[_0x1ab2('0x37')](_0x1ec173[_0x1ab2('0x2f')][_0x1ab2('0x37')]);_0x25ea9e[_0x1ab2('0x38')]=qs['filters'](_[_0x1ab2('0x3a')](_0x1ec173[_0x1ab2('0x2f')],_0x224d3c['filters']));if(_0x1ec173[_0x1ab2('0x2f')][_0x1ab2('0x3b')]){_0x25ea9e[_0x1ab2('0x38')]=_['merge'](_0x25ea9e[_0x1ab2('0x38')],{'$or':_[_0x1ab2('0x2a')](_0x25ea9e[_0x1ab2('0x32')],function(_0x25aefa){var _0xbfdf1a={};_0xbfdf1a[_0x25aefa]={'$like':'%'+_0x1ec173[_0x1ab2('0x2f')][_0x1ab2('0x3b')]+'%'};return _0xbfdf1a;})});}_0x25ea9e=_[_0x1ab2('0x3c')]({},_0x25ea9e,_0x1ec173[_0x1ab2('0x44')]);return _0x13edd9['getSubjects'](_0x25ea9e);}})['then'](function(_0xee8452){if(_0xee8452){_0x952c38=_0xee8452['length'];if(!_0x1ec173[_0x1ab2('0x2f')]['hasOwnProperty']('nolimit')){_0x25ea9e[_0x1ab2('0x1f')]=qs['limit'](_0x1ec173[_0x1ab2('0x2f')][_0x1ab2('0x1f')]);_0x25ea9e[_0x1ab2('0x1e')]=qs['offset'](_0x1ec173[_0x1ab2('0x2f')][_0x1ab2('0x1e')]);}return _0x13edd9[_0x1ab2('0x4d')](_0x25ea9e);}})[_0x1ab2('0x26')](function(_0x13f874){if(_0x13f874){return _0x13f874?{'count':_0x952c38,'rows':_0x13f874}:null;}})[_0x1ab2('0x26')](respondWithResult(_0x180fc5,null))['catch'](handleError(_0x180fc5,null));};exports[_0x1ab2('0x4f')]=function(_0x172a83,_0x596a33,_0x3751e1){var _0x19b7db={};var _0x4725e9={};var _0x1a7215;var _0x1a08e8;return db['FreshdeskConfiguration'][_0x1ab2('0x4a')]({'where':{'id':_0x172a83['params']['id']}})[_0x1ab2('0x26')](handleEntityNotFound(_0x596a33,null))[_0x1ab2('0x26')](function(_0x3114a0){if(_0x3114a0){_0x1a7215=_0x3114a0;_0x4725e9[_0x1ab2('0x2e')]=_[_0x1ab2('0x30')](db[_0x1ab2('0x4b')][_0x1ab2('0x4e')]);_0x4725e9[_0x1ab2('0x2f')]=_[_0x1ab2('0x30')](_0x172a83['query']);_0x4725e9[_0x1ab2('0x39')]=_[_0x1ab2('0x31')](_0x4725e9[_0x1ab2('0x2e')],_0x4725e9[_0x1ab2('0x2f')]);_0x19b7db['attributes']=_[_0x1ab2('0x31')](_0x4725e9[_0x1ab2('0x2e')],qs['fields'](_0x172a83[_0x1ab2('0x2f')]['fields']));_0x19b7db[_0x1ab2('0x32')]=_0x19b7db[_0x1ab2('0x32')][_0x1ab2('0x34')]?_0x19b7db[_0x1ab2('0x32')]:_0x4725e9[_0x1ab2('0x2e')];_0x19b7db[_0x1ab2('0x36')]=qs[_0x1ab2('0x37')](_0x172a83[_0x1ab2('0x2f')][_0x1ab2('0x37')]);_0x19b7db[_0x1ab2('0x38')]=qs[_0x1ab2('0x39')](_[_0x1ab2('0x3a')](_0x172a83[_0x1ab2('0x2f')],_0x4725e9[_0x1ab2('0x39')]));if(_0x172a83[_0x1ab2('0x2f')][_0x1ab2('0x3b')]){_0x19b7db[_0x1ab2('0x38')]=_[_0x1ab2('0x3c')](_0x19b7db[_0x1ab2('0x38')],{'$or':_[_0x1ab2('0x2a')](_0x19b7db['attributes'],function(_0x1a53b4){var _0x5ed3a1={};_0x5ed3a1[_0x1a53b4]={'$like':'%'+_0x172a83[_0x1ab2('0x2f')][_0x1ab2('0x3b')]+'%'};return _0x5ed3a1;})});}_0x19b7db=_[_0x1ab2('0x3c')]({},_0x19b7db,_0x172a83[_0x1ab2('0x44')]);return _0x1a7215[_0x1ab2('0x4f')](_0x19b7db);}})[_0x1ab2('0x26')](function(_0x248e76){if(_0x248e76){_0x1a08e8=_0x248e76[_0x1ab2('0x34')];if(!_0x172a83['query'][_0x1ab2('0x4c')]('nolimit')){_0x19b7db[_0x1ab2('0x1f')]=qs[_0x1ab2('0x1f')](_0x172a83[_0x1ab2('0x2f')][_0x1ab2('0x1f')]);_0x19b7db[_0x1ab2('0x1e')]=qs[_0x1ab2('0x1e')](_0x172a83[_0x1ab2('0x2f')][_0x1ab2('0x1e')]);}return _0x1a7215['getDescriptions'](_0x19b7db);}})[_0x1ab2('0x26')](function(_0x5e0ae3){if(_0x5e0ae3){return _0x5e0ae3?{'count':_0x1a08e8,'rows':_0x5e0ae3}:null;}})[_0x1ab2('0x26')](respondWithResult(_0x596a33,null))[_0x1ab2('0x41')](handleError(_0x596a33,null));};exports[_0x1ab2('0x50')]=function(_0xef56d1,_0x1860bd,_0x528e9f){var _0x2190dc={};var _0x21002f={};var _0x41924c;var _0x293e70;return db[_0x1ab2('0x40')]['findOne']({'where':{'id':_0xef56d1[_0x1ab2('0x43')]['id']}})[_0x1ab2('0x26')](handleEntityNotFound(_0x1860bd,null))[_0x1ab2('0x26')](function(_0x18d7df){if(_0x18d7df){_0x41924c=_0x18d7df;_0x21002f[_0x1ab2('0x2e')]=_[_0x1ab2('0x30')](db['Tag'][_0x1ab2('0x4e')]);_0x21002f[_0x1ab2('0x2f')]=_[_0x1ab2('0x30')](_0xef56d1[_0x1ab2('0x2f')]);_0x21002f[_0x1ab2('0x39')]=_['intersection'](_0x21002f[_0x1ab2('0x2e')],_0x21002f[_0x1ab2('0x2f')]);_0x2190dc[_0x1ab2('0x32')]=_[_0x1ab2('0x31')](_0x21002f[_0x1ab2('0x2e')],qs['fields'](_0xef56d1['query'][_0x1ab2('0x33')]));_0x2190dc['attributes']=_0x2190dc[_0x1ab2('0x32')][_0x1ab2('0x34')]?_0x2190dc[_0x1ab2('0x32')]:_0x21002f[_0x1ab2('0x2e')];_0x2190dc[_0x1ab2('0x36')]=qs[_0x1ab2('0x37')](_0xef56d1['query'][_0x1ab2('0x37')]);_0x2190dc[_0x1ab2('0x38')]=qs['filters'](_[_0x1ab2('0x3a')](_0xef56d1[_0x1ab2('0x2f')],_0x21002f[_0x1ab2('0x39')]));if(_0xef56d1[_0x1ab2('0x2f')][_0x1ab2('0x3b')]){_0x2190dc[_0x1ab2('0x38')]=_[_0x1ab2('0x3c')](_0x2190dc[_0x1ab2('0x38')],{'$or':_[_0x1ab2('0x2a')](_0x2190dc[_0x1ab2('0x32')],function(_0x5f45f4){var _0x1f17d3={};_0x1f17d3[_0x5f45f4]={'$like':'%'+_0xef56d1[_0x1ab2('0x2f')][_0x1ab2('0x3b')]+'%'};return _0x1f17d3;})});}_0x2190dc=_['merge']({},_0x2190dc,_0xef56d1[_0x1ab2('0x44')]);return _0x41924c[_0x1ab2('0x50')](_0x2190dc);}})['then'](function(_0x584d1a){if(_0x584d1a){_0x293e70=_0x584d1a[_0x1ab2('0x34')];if(!_0xef56d1[_0x1ab2('0x2f')][_0x1ab2('0x4c')](_0x1ab2('0x35'))){_0x2190dc[_0x1ab2('0x1f')]=qs[_0x1ab2('0x1f')](_0xef56d1['query']['limit']);_0x2190dc[_0x1ab2('0x1e')]=qs['offset'](_0xef56d1[_0x1ab2('0x2f')]['offset']);}return _0x41924c[_0x1ab2('0x50')](_0x2190dc);}})['then'](function(_0x10dd75){if(_0x10dd75){return _0x10dd75?{'count':_0x293e70,'rows':_0x10dd75}:null;}})[_0x1ab2('0x26')](respondWithResult(_0x1860bd,null))[_0x1ab2('0x41')](handleError(_0x1860bd,null));};exports[_0x1ab2('0x51')]=function(_0x20ba02,_0x4cf22e,_0x1a581e){if(_0x20ba02['body']['id']){delete _0x20ba02[_0x1ab2('0x47')]['id'];}return db[_0x1ab2('0x40')][_0x1ab2('0x4a')]({'where':{'id':_0x20ba02[_0x1ab2('0x43')]['id']}})[_0x1ab2('0x26')](handleEntityNotFound(_0x4cf22e,null))[_0x1ab2('0x26')](function(_0x19d9af){if(_0x19d9af){return _0x19d9af[_0x1ab2('0x51')](_0x20ba02['body'][_0x1ab2('0x52')]||[]);}return null;})[_0x1ab2('0x26')](respondWithResult(_0x4cf22e,null))[_0x1ab2('0x41')](handleError(_0x4cf22e,null));}; \ No newline at end of file +var _0x9068=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','type','keys','filters','intersection','model','query','fields','attributes','length','nolimit','order','where','pick','filter','merge','options','include','findAll','rows','catch','show','includeAll','find','create','body','destroy','params','getFields','findOne','FreshdeskField','sort','hasOwnProperty','getDescriptions','getTags','Tag','setTags','ids','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x1007b3,_0x344f7f){var _0x7cf215=function(_0x5e25a0){while(--_0x5e25a0){_0x1007b3['push'](_0x1007b3['shift']());}};_0x7cf215(++_0x344f7f);}(_0x9068,0x98));var _0x8906=function(_0x37aea3,_0x54352a){_0x37aea3=_0x37aea3-0x0;var _0x14637c=_0x9068[_0x37aea3];return _0x14637c;};'use strict';var emlformat=require(_0x8906('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8906('0x1'));var jsonpatch=require(_0x8906('0x2'));var rp=require('request-promise');var moment=require(_0x8906('0x3'));var BPromise=require(_0x8906('0x4'));var Mustache=require(_0x8906('0x5'));var util=require(_0x8906('0x6'));var path=require(_0x8906('0x7'));var sox=require(_0x8906('0x8'));var csv=require(_0x8906('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8906('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8906('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8906('0x9'));var querystring=require(_0x8906('0xc'));var Papa=require(_0x8906('0xd'));var Redis=require(_0x8906('0xe'));var authService=require(_0x8906('0xf'));var qs=require(_0x8906('0x10'));var as=require(_0x8906('0x11'));var hardwareService=require(_0x8906('0x12'));var logger=require(_0x8906('0x13'))(_0x8906('0x14'));var utils=require(_0x8906('0x15'));var config=require(_0x8906('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8906('0x17'))['db'];function respondWithStatusCode(_0x3cff76,_0x377d20){_0x377d20=_0x377d20||0xcc;return function(_0xa7633d){if(_0xa7633d){return _0x3cff76[_0x8906('0x18')](_0x377d20);}return _0x3cff76[_0x8906('0x19')](_0x377d20)[_0x8906('0x1a')]();};}function respondWithResult(_0x23fe28,_0x26c8f3){_0x26c8f3=_0x26c8f3||0xc8;return function(_0x215a02){if(_0x215a02){return _0x23fe28[_0x8906('0x19')](_0x26c8f3)[_0x8906('0x1b')](_0x215a02);}};}function respondWithFilteredResult(_0x149a36,_0x2e2fd6){return function(_0x2390e1){if(_0x2390e1){var _0x242073=typeof _0x2e2fd6['offset']===_0x8906('0x1c')&&typeof _0x2e2fd6[_0x8906('0x1d')]==='undefined';var _0x29b48a=_0x2390e1[_0x8906('0x1e')];var _0x4f4f81=_0x242073?0x0:_0x2e2fd6['offset'];var _0x44401f=_0x242073?_0x2390e1['count']:_0x2e2fd6[_0x8906('0x1f')]+_0x2e2fd6['limit'];var _0x437348;if(_0x44401f>=_0x29b48a){_0x44401f=_0x29b48a;_0x437348=0xc8;}else{_0x437348=0xce;}_0x149a36[_0x8906('0x19')](_0x437348);return _0x149a36[_0x8906('0x20')](_0x8906('0x21'),_0x4f4f81+'-'+_0x44401f+'/'+_0x29b48a)['json'](_0x2390e1);}return null;};}function patchUpdates(_0xdbb385){return function(_0xd754b){try{jsonpatch[_0x8906('0x22')](_0xd754b,_0xdbb385,!![]);}catch(_0x45dd19){return BPromise[_0x8906('0x23')](_0x45dd19);}return _0xd754b[_0x8906('0x24')]();};}function saveUpdates(_0x2e5ee1,_0x5be9c5){return function(_0x5196c2){if(_0x5196c2){return _0x5196c2[_0x8906('0x25')](_0x2e5ee1)['then'](function(_0x318cd4){return _0x318cd4;});}return null;};}function removeEntity(_0xaffa9d,_0x3a0b84){return function(_0x43a0d7){if(_0x43a0d7){return _0x43a0d7['destroy']()[_0x8906('0x26')](function(){_0xaffa9d['status'](0xcc)[_0x8906('0x1a')]();});}};}function handleEntityNotFound(_0x157559,_0x1239e6){return function(_0x2f3d60){if(!_0x2f3d60){_0x157559['sendStatus'](0x194);}return _0x2f3d60;};}function handleError(_0x20ad5e,_0x4b3a54){_0x4b3a54=_0x4b3a54||0x1f4;return function(_0x1dee7a){logger[_0x8906('0x27')](_0x1dee7a[_0x8906('0x28')]);if(_0x1dee7a[_0x8906('0x29')]){delete _0x1dee7a['name'];}_0x20ad5e['status'](_0x4b3a54)[_0x8906('0x2a')](_0x1dee7a);};}exports[_0x8906('0x2b')]=function(_0x46733e,_0xb78f4){var _0x592b5f={},_0x1013d3={},_0x356bba={'count':0x0,'rows':[]};var _0x2618ae=_[_0x8906('0x2c')](db[_0x8906('0x2d')][_0x8906('0x2e')],function(_0x523647){return{'name':_0x523647['fieldName'],'type':_0x523647[_0x8906('0x2f')]['key']};});_0x1013d3['model']=_['map'](_0x2618ae,_0x8906('0x29'));_0x1013d3['query']=_[_0x8906('0x30')](_0x46733e['query']);_0x1013d3[_0x8906('0x31')]=_[_0x8906('0x32')](_0x1013d3[_0x8906('0x33')],_0x1013d3[_0x8906('0x34')]);_0x592b5f['attributes']=_[_0x8906('0x32')](_0x1013d3['model'],qs[_0x8906('0x35')](_0x46733e['query'][_0x8906('0x35')]));_0x592b5f[_0x8906('0x36')]=_0x592b5f['attributes'][_0x8906('0x37')]?_0x592b5f['attributes']:_0x1013d3[_0x8906('0x33')];if(!_0x46733e[_0x8906('0x34')]['hasOwnProperty'](_0x8906('0x38'))){_0x592b5f[_0x8906('0x1d')]=qs[_0x8906('0x1d')](_0x46733e[_0x8906('0x34')][_0x8906('0x1d')]);_0x592b5f[_0x8906('0x1f')]=qs[_0x8906('0x1f')](_0x46733e['query']['offset']);}_0x592b5f[_0x8906('0x39')]=qs['sort'](_0x46733e[_0x8906('0x34')]['sort']);_0x592b5f[_0x8906('0x3a')]=qs[_0x8906('0x31')](_[_0x8906('0x3b')](_0x46733e[_0x8906('0x34')],_0x1013d3[_0x8906('0x31')]),_0x2618ae);if(_0x46733e[_0x8906('0x34')][_0x8906('0x3c')]){_0x592b5f['where']=_['merge'](_0x592b5f[_0x8906('0x3a')],{'$or':_[_0x8906('0x2c')](_0x2618ae,function(_0x46b031){if(_0x46b031[_0x8906('0x2f')]!=='VIRTUAL'){var _0x50e482={};_0x50e482[_0x46b031['name']]={'$like':'%'+_0x46733e[_0x8906('0x34')][_0x8906('0x3c')]+'%'};return _0x50e482;}})});}_0x592b5f=_[_0x8906('0x3d')]({},_0x592b5f,_0x46733e[_0x8906('0x3e')]);var _0x56ea8a={'where':_0x592b5f[_0x8906('0x3a')]};return db[_0x8906('0x2d')]['count'](_0x56ea8a)[_0x8906('0x26')](function(_0x47d7cf){_0x356bba[_0x8906('0x1e')]=_0x47d7cf;if(_0x46733e[_0x8906('0x34')]['includeAll']){_0x592b5f[_0x8906('0x3f')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0x8906('0x40')](_0x592b5f);})[_0x8906('0x26')](function(_0x5b78c5){_0x356bba[_0x8906('0x41')]=_0x5b78c5;return _0x356bba;})['then'](respondWithFilteredResult(_0xb78f4,_0x592b5f))[_0x8906('0x42')](handleError(_0xb78f4,null));};exports[_0x8906('0x43')]=function(_0x2ec6b5,_0xab063e){var _0x8ee29b={'raw':![],'where':{'id':_0x2ec6b5['params']['id']}},_0x3d72d2={};_0x3d72d2[_0x8906('0x33')]=_[_0x8906('0x30')](db[_0x8906('0x2d')]['rawAttributes']);_0x3d72d2[_0x8906('0x34')]=_[_0x8906('0x30')](_0x2ec6b5[_0x8906('0x34')]);_0x3d72d2[_0x8906('0x31')]=_[_0x8906('0x32')](_0x3d72d2[_0x8906('0x33')],_0x3d72d2[_0x8906('0x34')]);_0x8ee29b[_0x8906('0x36')]=_[_0x8906('0x32')](_0x3d72d2['model'],qs['fields'](_0x2ec6b5[_0x8906('0x34')]['fields']));_0x8ee29b[_0x8906('0x36')]=_0x8ee29b['attributes'][_0x8906('0x37')]?_0x8ee29b[_0x8906('0x36')]:_0x3d72d2[_0x8906('0x33')];if(_0x2ec6b5[_0x8906('0x34')][_0x8906('0x44')]){_0x8ee29b[_0x8906('0x3f')]=[{'all':!![]}];}_0x8ee29b=_[_0x8906('0x3d')]({},_0x8ee29b,_0x2ec6b5[_0x8906('0x3e')]);return db[_0x8906('0x2d')][_0x8906('0x45')](_0x8ee29b)['then'](handleEntityNotFound(_0xab063e,null))[_0x8906('0x26')](respondWithResult(_0xab063e,null))[_0x8906('0x42')](handleError(_0xab063e,null));};exports[_0x8906('0x46')]=function(_0x2de5ca,_0xfa8393){return db[_0x8906('0x2d')][_0x8906('0x46')](_0x2de5ca[_0x8906('0x47')],{})[_0x8906('0x26')](respondWithResult(_0xfa8393,0xc9))[_0x8906('0x42')](handleError(_0xfa8393,null));};exports[_0x8906('0x25')]=function(_0x4e3df6,_0x20b6cd){if(_0x4e3df6['body']['id']){delete _0x4e3df6[_0x8906('0x47')]['id'];}return db['FreshdeskConfiguration']['find']({'where':{'id':_0x4e3df6['params']['id']}})[_0x8906('0x26')](handleEntityNotFound(_0x20b6cd,null))[_0x8906('0x26')](saveUpdates(_0x4e3df6[_0x8906('0x47')],null))['then'](respondWithResult(_0x20b6cd,null))[_0x8906('0x42')](handleError(_0x20b6cd,null));};exports[_0x8906('0x48')]=function(_0x5d09bf,_0x447474){return db[_0x8906('0x2d')][_0x8906('0x45')]({'where':{'id':_0x5d09bf[_0x8906('0x49')]['id']}})['then'](handleEntityNotFound(_0x447474,null))[_0x8906('0x26')](removeEntity(_0x447474,null))[_0x8906('0x42')](handleError(_0x447474,null));};exports[_0x8906('0x4a')]=function(_0x4ee10b,_0x2e0b4,_0x2319ab){var _0x59a3d4={};var _0x510471={};var _0x5de2c2;var _0x35521c;return db['FreshdeskConfiguration'][_0x8906('0x4b')]({'where':{'id':_0x4ee10b[_0x8906('0x49')]['id']}})['then'](handleEntityNotFound(_0x2e0b4,null))['then'](function(_0x265c92){if(_0x265c92){_0x5de2c2=_0x265c92;_0x510471[_0x8906('0x33')]=_[_0x8906('0x30')](db[_0x8906('0x4c')][_0x8906('0x2e')]);_0x510471[_0x8906('0x34')]=_[_0x8906('0x30')](_0x4ee10b[_0x8906('0x34')]);_0x510471[_0x8906('0x31')]=_[_0x8906('0x32')](_0x510471['model'],_0x510471['query']);_0x59a3d4[_0x8906('0x36')]=_[_0x8906('0x32')](_0x510471['model'],qs['fields'](_0x4ee10b[_0x8906('0x34')][_0x8906('0x35')]));_0x59a3d4[_0x8906('0x36')]=_0x59a3d4['attributes'][_0x8906('0x37')]?_0x59a3d4[_0x8906('0x36')]:_0x510471[_0x8906('0x33')];_0x59a3d4['order']=qs[_0x8906('0x4d')](_0x4ee10b['query'][_0x8906('0x4d')]);_0x59a3d4[_0x8906('0x3a')]=qs[_0x8906('0x31')](_[_0x8906('0x3b')](_0x4ee10b['query'],_0x510471[_0x8906('0x31')]));if(_0x4ee10b[_0x8906('0x34')][_0x8906('0x3c')]){_0x59a3d4['where']=_[_0x8906('0x3d')](_0x59a3d4[_0x8906('0x3a')],{'$or':_['map'](_0x59a3d4[_0x8906('0x36')],function(_0x56d0b9){var _0x372f0a={};_0x372f0a[_0x56d0b9]={'$like':'%'+_0x4ee10b['query']['filter']+'%'};return _0x372f0a;})});}_0x59a3d4=_[_0x8906('0x3d')]({},_0x59a3d4,_0x4ee10b[_0x8906('0x3e')]);return _0x5de2c2[_0x8906('0x4a')](_0x59a3d4);}})['then'](function(_0x23cf16){if(_0x23cf16){_0x35521c=_0x23cf16[_0x8906('0x37')];if(!_0x4ee10b[_0x8906('0x34')][_0x8906('0x4e')](_0x8906('0x38'))){_0x59a3d4[_0x8906('0x1d')]=qs[_0x8906('0x1d')](_0x4ee10b[_0x8906('0x34')][_0x8906('0x1d')]);_0x59a3d4['offset']=qs['offset'](_0x4ee10b[_0x8906('0x34')][_0x8906('0x1f')]);}return _0x5de2c2[_0x8906('0x4a')](_0x59a3d4);}})[_0x8906('0x26')](function(_0x3f7db7){if(_0x3f7db7){return _0x3f7db7?{'count':_0x35521c,'rows':_0x3f7db7}:null;}})[_0x8906('0x26')](respondWithResult(_0x2e0b4,null))[_0x8906('0x42')](handleError(_0x2e0b4,null));};exports['getSubjects']=function(_0x2e9937,_0x368d13,_0x56f9ea){var _0x4c406f={};var _0x45f6c1={};var _0x17c3e3;var _0x91d0dc;return db['FreshdeskConfiguration'][_0x8906('0x4b')]({'where':{'id':_0x2e9937[_0x8906('0x49')]['id']}})[_0x8906('0x26')](handleEntityNotFound(_0x368d13,null))[_0x8906('0x26')](function(_0x3812d1){if(_0x3812d1){_0x17c3e3=_0x3812d1;_0x45f6c1['model']=_[_0x8906('0x30')](db[_0x8906('0x4c')][_0x8906('0x2e')]);_0x45f6c1[_0x8906('0x34')]=_[_0x8906('0x30')](_0x2e9937['query']);_0x45f6c1[_0x8906('0x31')]=_[_0x8906('0x32')](_0x45f6c1[_0x8906('0x33')],_0x45f6c1[_0x8906('0x34')]);_0x4c406f[_0x8906('0x36')]=_[_0x8906('0x32')](_0x45f6c1[_0x8906('0x33')],qs['fields'](_0x2e9937[_0x8906('0x34')][_0x8906('0x35')]));_0x4c406f[_0x8906('0x36')]=_0x4c406f[_0x8906('0x36')][_0x8906('0x37')]?_0x4c406f[_0x8906('0x36')]:_0x45f6c1[_0x8906('0x33')];_0x4c406f['order']=qs[_0x8906('0x4d')](_0x2e9937['query'][_0x8906('0x4d')]);_0x4c406f['where']=qs['filters'](_[_0x8906('0x3b')](_0x2e9937[_0x8906('0x34')],_0x45f6c1[_0x8906('0x31')]));if(_0x2e9937[_0x8906('0x34')]['filter']){_0x4c406f[_0x8906('0x3a')]=_['merge'](_0x4c406f[_0x8906('0x3a')],{'$or':_['map'](_0x4c406f['attributes'],function(_0x9a5a2a){var _0x172ddb={};_0x172ddb[_0x9a5a2a]={'$like':'%'+_0x2e9937['query'][_0x8906('0x3c')]+'%'};return _0x172ddb;})});}_0x4c406f=_[_0x8906('0x3d')]({},_0x4c406f,_0x2e9937[_0x8906('0x3e')]);return _0x17c3e3['getSubjects'](_0x4c406f);}})[_0x8906('0x26')](function(_0x39fc7a){if(_0x39fc7a){_0x91d0dc=_0x39fc7a[_0x8906('0x37')];if(!_0x2e9937['query']['hasOwnProperty'](_0x8906('0x38'))){_0x4c406f[_0x8906('0x1d')]=qs[_0x8906('0x1d')](_0x2e9937[_0x8906('0x34')][_0x8906('0x1d')]);_0x4c406f[_0x8906('0x1f')]=qs[_0x8906('0x1f')](_0x2e9937[_0x8906('0x34')][_0x8906('0x1f')]);}return _0x17c3e3['getSubjects'](_0x4c406f);}})[_0x8906('0x26')](function(_0x7305d0){if(_0x7305d0){return _0x7305d0?{'count':_0x91d0dc,'rows':_0x7305d0}:null;}})[_0x8906('0x26')](respondWithResult(_0x368d13,null))[_0x8906('0x42')](handleError(_0x368d13,null));};exports[_0x8906('0x4f')]=function(_0x4f87f2,_0x4571e5,_0x2fb342){var _0x38a519={};var _0x36b6b1={};var _0x5f1c5c;var _0x10a6e4;return db['FreshdeskConfiguration'][_0x8906('0x4b')]({'where':{'id':_0x4f87f2[_0x8906('0x49')]['id']}})[_0x8906('0x26')](handleEntityNotFound(_0x4571e5,null))[_0x8906('0x26')](function(_0x41740a){if(_0x41740a){_0x5f1c5c=_0x41740a;_0x36b6b1[_0x8906('0x33')]=_[_0x8906('0x30')](db[_0x8906('0x4c')]['rawAttributes']);_0x36b6b1['query']=_[_0x8906('0x30')](_0x4f87f2[_0x8906('0x34')]);_0x36b6b1[_0x8906('0x31')]=_[_0x8906('0x32')](_0x36b6b1[_0x8906('0x33')],_0x36b6b1[_0x8906('0x34')]);_0x38a519['attributes']=_[_0x8906('0x32')](_0x36b6b1[_0x8906('0x33')],qs[_0x8906('0x35')](_0x4f87f2[_0x8906('0x34')][_0x8906('0x35')]));_0x38a519[_0x8906('0x36')]=_0x38a519['attributes']['length']?_0x38a519['attributes']:_0x36b6b1['model'];_0x38a519[_0x8906('0x39')]=qs[_0x8906('0x4d')](_0x4f87f2[_0x8906('0x34')][_0x8906('0x4d')]);_0x38a519[_0x8906('0x3a')]=qs[_0x8906('0x31')](_[_0x8906('0x3b')](_0x4f87f2[_0x8906('0x34')],_0x36b6b1[_0x8906('0x31')]));if(_0x4f87f2[_0x8906('0x34')]['filter']){_0x38a519[_0x8906('0x3a')]=_['merge'](_0x38a519[_0x8906('0x3a')],{'$or':_['map'](_0x38a519[_0x8906('0x36')],function(_0x1c7280){var _0x5f0df8={};_0x5f0df8[_0x1c7280]={'$like':'%'+_0x4f87f2[_0x8906('0x34')][_0x8906('0x3c')]+'%'};return _0x5f0df8;})});}_0x38a519=_['merge']({},_0x38a519,_0x4f87f2[_0x8906('0x3e')]);return _0x5f1c5c[_0x8906('0x4f')](_0x38a519);}})['then'](function(_0x5a52df){if(_0x5a52df){_0x10a6e4=_0x5a52df['length'];if(!_0x4f87f2[_0x8906('0x34')][_0x8906('0x4e')]('nolimit')){_0x38a519[_0x8906('0x1d')]=qs['limit'](_0x4f87f2[_0x8906('0x34')][_0x8906('0x1d')]);_0x38a519[_0x8906('0x1f')]=qs[_0x8906('0x1f')](_0x4f87f2[_0x8906('0x34')]['offset']);}return _0x5f1c5c['getDescriptions'](_0x38a519);}})['then'](function(_0x58eae2){if(_0x58eae2){return _0x58eae2?{'count':_0x10a6e4,'rows':_0x58eae2}:null;}})[_0x8906('0x26')](respondWithResult(_0x4571e5,null))[_0x8906('0x42')](handleError(_0x4571e5,null));};exports[_0x8906('0x50')]=function(_0x50a129,_0x1794da,_0x25c03a){var _0x593e37={};var _0x2cb530={};var _0x874086;var _0xa04664;return db['FreshdeskConfiguration'][_0x8906('0x4b')]({'where':{'id':_0x50a129[_0x8906('0x49')]['id']}})[_0x8906('0x26')](handleEntityNotFound(_0x1794da,null))[_0x8906('0x26')](function(_0x41aa28){if(_0x41aa28){_0x874086=_0x41aa28;_0x2cb530[_0x8906('0x33')]=_[_0x8906('0x30')](db[_0x8906('0x51')][_0x8906('0x2e')]);_0x2cb530[_0x8906('0x34')]=_['keys'](_0x50a129[_0x8906('0x34')]);_0x2cb530[_0x8906('0x31')]=_['intersection'](_0x2cb530['model'],_0x2cb530[_0x8906('0x34')]);_0x593e37[_0x8906('0x36')]=_['intersection'](_0x2cb530[_0x8906('0x33')],qs[_0x8906('0x35')](_0x50a129[_0x8906('0x34')]['fields']));_0x593e37['attributes']=_0x593e37[_0x8906('0x36')]['length']?_0x593e37[_0x8906('0x36')]:_0x2cb530[_0x8906('0x33')];_0x593e37['order']=qs[_0x8906('0x4d')](_0x50a129['query']['sort']);_0x593e37[_0x8906('0x3a')]=qs[_0x8906('0x31')](_[_0x8906('0x3b')](_0x50a129['query'],_0x2cb530[_0x8906('0x31')]));if(_0x50a129[_0x8906('0x34')][_0x8906('0x3c')]){_0x593e37[_0x8906('0x3a')]=_[_0x8906('0x3d')](_0x593e37[_0x8906('0x3a')],{'$or':_[_0x8906('0x2c')](_0x593e37['attributes'],function(_0x1c7f23){var _0x1f67a3={};_0x1f67a3[_0x1c7f23]={'$like':'%'+_0x50a129[_0x8906('0x34')][_0x8906('0x3c')]+'%'};return _0x1f67a3;})});}_0x593e37=_['merge']({},_0x593e37,_0x50a129[_0x8906('0x3e')]);return _0x874086[_0x8906('0x50')](_0x593e37);}})[_0x8906('0x26')](function(_0x3a67c5){if(_0x3a67c5){_0xa04664=_0x3a67c5[_0x8906('0x37')];if(!_0x50a129[_0x8906('0x34')][_0x8906('0x4e')](_0x8906('0x38'))){_0x593e37['limit']=qs[_0x8906('0x1d')](_0x50a129['query']['limit']);_0x593e37[_0x8906('0x1f')]=qs[_0x8906('0x1f')](_0x50a129[_0x8906('0x34')][_0x8906('0x1f')]);}return _0x874086[_0x8906('0x50')](_0x593e37);}})['then'](function(_0x42fd3a){if(_0x42fd3a){return _0x42fd3a?{'count':_0xa04664,'rows':_0x42fd3a}:null;}})[_0x8906('0x26')](respondWithResult(_0x1794da,null))[_0x8906('0x42')](handleError(_0x1794da,null));};exports['setTags']=function(_0x3a70d1,_0x19fd51,_0xa1c20){if(_0x3a70d1[_0x8906('0x47')]['id']){delete _0x3a70d1[_0x8906('0x47')]['id'];}return db[_0x8906('0x2d')][_0x8906('0x4b')]({'where':{'id':_0x3a70d1[_0x8906('0x49')]['id']}})[_0x8906('0x26')](handleEntityNotFound(_0x19fd51,null))[_0x8906('0x26')](function(_0x94cdec){if(_0x94cdec){return _0x94cdec[_0x8906('0x52')](_0x3a70d1[_0x8906('0x47')][_0x8906('0x53')]||[]);}return null;})['then'](respondWithResult(_0x19fd51,null))[_0x8906('0x42')](handleError(_0x19fd51,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index e618c72..2bb8caa 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 _0x5ec2=['path','rimraf','../../config/environment','exports','define','FreshdeskConfiguration','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1a3edd,_0x1f3c57){var _0x216f26=function(_0x3e3161){while(--_0x3e3161){_0x1a3edd['push'](_0x1a3edd['shift']());}};_0x216f26(++_0x1f3c57);}(_0x5ec2,0x192));var _0x25ec=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x5ec2[_0x187ee1];return _0x388160;};'use strict';var _=require('lodash');var util=require(_0x25ec('0x0'));var logger=require(_0x25ec('0x1'))(_0x25ec('0x2'));var moment=require(_0x25ec('0x3'));var BPromise=require(_0x25ec('0x4'));var rp=require(_0x25ec('0x5'));var fs=require('fs');var path=require(_0x25ec('0x6'));var rimraf=require(_0x25ec('0x7'));var config=require(_0x25ec('0x8'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0x25ec('0x9')]=function(_0x5b584c,_0x427972){return _0x5b584c[_0x25ec('0xa')](_0x25ec('0xb'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8cc9=['../../config/environment','define','int_freshdesk_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x2872a6,_0x51417b){var _0x5763a5=function(_0x1add4e){while(--_0x1add4e){_0x2872a6['push'](_0x2872a6['shift']());}};_0x5763a5(++_0x51417b);}(_0x8cc9,0x93));var _0x98cc=function(_0x20a79d,_0x3b7db7){_0x20a79d=_0x20a79d-0x0;var _0x7df9f=_0x8cc9[_0x20a79d];return _0x7df9f;};'use strict';var _=require(_0x98cc('0x0'));var util=require(_0x98cc('0x1'));var logger=require(_0x98cc('0x2'))('api');var moment=require(_0x98cc('0x3'));var BPromise=require(_0x98cc('0x4'));var rp=require(_0x98cc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x98cc('0x6'));var attributes=require('./intFreshdeskConfiguration.attributes');module['exports']=function(_0x42b123,_0x410e76){return _0x42b123[_0x98cc('0x7')]('FreshdeskConfiguration',attributes,{'tableName':_0x98cc('0x8'),'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 fe2f509..2ab2286 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 _0x4813=['../../config/utils','../../config/logger','rpc','../../config/environment','request','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4813,0x170));var _0x3481=function(_0x561672,_0x578a52){_0x561672=_0x561672-0x0;var _0x34a896=_0x4813[_0x561672];return _0x34a896;};'use strict';var _=require(_0x3481('0x0'));var util=require(_0x3481('0x1'));var moment=require(_0x3481('0x2'));var BPromise=require(_0x3481('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3481('0x4'));var db=require(_0x3481('0x5'))['db'];var utils=require(_0x3481('0x6'));var logger=require(_0x3481('0x7'))(_0x3481('0x8'));var config=require(_0x3481('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4f17cd,_0x1fa0e2,_0x1a9ff1){return new BPromise(function(_0x40450a,_0xfa9973){return client[_0x3481('0xa')](_0x4f17cd,_0x1a9ff1)[_0x3481('0xb')](function(_0x4e67a7){logger['info'](_0x3481('0xc'),_0x1fa0e2,_0x3481('0xd'));logger[_0x3481('0xe')](_0x3481('0xf'),_0x1fa0e2,_0x3481('0xd'),JSON[_0x3481('0x10')](_0x4e67a7));if(_0x4e67a7['error']){if(_0x4e67a7['error'][_0x3481('0x11')]===0x1f4){logger['error'](_0x3481('0xc'),_0x1fa0e2,_0x4e67a7[_0x3481('0x12')]['message']);return _0xfa9973(_0x4e67a7[_0x3481('0x12')][_0x3481('0x13')]);}logger[_0x3481('0x12')](_0x3481('0xc'),_0x1fa0e2,_0x4e67a7[_0x3481('0x12')]['message']);return _0x40450a(_0x4e67a7['error'][_0x3481('0x13')]);}else{logger[_0x3481('0x14')](_0x3481('0xc'),_0x1fa0e2,_0x3481('0xd'));_0x40450a(_0x4e67a7[_0x3481('0x15')][_0x3481('0x13')]);}})['catch'](function(_0x2b90fc){logger[_0x3481('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x1fa0e2,_0x2b90fc);_0xfa9973(_0x2b90fc);});});} \ No newline at end of file +var _0x8832=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','util','moment','bluebird','randomstring'];(function(_0x21f959,_0x42fdbc){var _0x210421=function(_0x58bc9d){while(--_0x58bc9d){_0x21f959['push'](_0x21f959['shift']());}};_0x210421(++_0x42fdbc);}(_0x8832,0xed));var _0x2883=function(_0xfa05d7,_0x33c1f2){_0xfa05d7=_0xfa05d7-0x0;var _0x25560d=_0x8832[_0xfa05d7];return _0x25560d;};'use strict';var _=require(_0x2883('0x0'));var util=require(_0x2883('0x1'));var moment=require(_0x2883('0x2'));var BPromise=require(_0x2883('0x3'));var rs=require(_0x2883('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2883('0x5'))['db'];var utils=require(_0x2883('0x6'));var logger=require('../../config/logger')(_0x2883('0x7'));var config=require(_0x2883('0x8'));var jayson=require(_0x2883('0x9'));var client=jayson['client'][_0x2883('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x348fd6,_0x3784f6,_0x3e9677){return new BPromise(function(_0x55246b,_0x2f4c4f){return client[_0x2883('0xb')](_0x348fd6,_0x3e9677)[_0x2883('0xc')](function(_0x2084ca){logger[_0x2883('0xd')](_0x2883('0xe'),_0x3784f6,'request\x20sent');logger[_0x2883('0xf')](_0x2883('0x10'),_0x3784f6,_0x2883('0x11'),JSON[_0x2883('0x12')](_0x2084ca));if(_0x2084ca[_0x2883('0x13')]){if(_0x2084ca[_0x2883('0x13')][_0x2883('0x14')]===0x1f4){logger[_0x2883('0x13')](_0x2883('0xe'),_0x3784f6,_0x2084ca[_0x2883('0x13')][_0x2883('0x15')]);return _0x2f4c4f(_0x2084ca['error'][_0x2883('0x15')]);}logger[_0x2883('0x13')](_0x2883('0xe'),_0x3784f6,_0x2084ca[_0x2883('0x13')][_0x2883('0x15')]);return _0x55246b(_0x2084ca['error'][_0x2883('0x15')]);}else{logger['info'](_0x2883('0xe'),_0x3784f6,_0x2883('0x11'));_0x55246b(_0x2084ca['result'][_0x2883('0x15')]);}})['catch'](function(_0x31ffb2){logger[_0x2883('0x13')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3784f6,_0x31ffb2);_0x2f4c4f(_0x31ffb2);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 9d8fbab..f454784 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 _0x74fe=['post','put','update','destroy','exports','multer','util','path','connect-timeout','Router','index','get','/:id','isAuthenticated','show'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x74fe,0xe6));var _0xe74f=function(_0x1692b1,_0x9b57af){_0x1692b1=_0x1692b1-0x0;var _0x122f7a=_0x74fe[_0x1692b1];return _0x122f7a;};'use strict';var multer=require(_0xe74f('0x0'));var util=require(_0xe74f('0x1'));var path=require(_0xe74f('0x2'));var timeout=require(_0xe74f('0x3'));var express=require('express');var router=express[_0xe74f('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intFreshdeskField.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xe74f('0x5')]);router[_0xe74f('0x6')](_0xe74f('0x7'),auth[_0xe74f('0x8')](),controller[_0xe74f('0x9')]);router[_0xe74f('0xa')]('/',auth[_0xe74f('0x8')](),controller['create']);router[_0xe74f('0xb')](_0xe74f('0x7'),auth['isAuthenticated'](),controller[_0xe74f('0xc')]);router['delete'](_0xe74f('0x7'),auth['isAuthenticated'](),controller[_0xe74f('0xd')]);module[_0xe74f('0xe')]=router; \ No newline at end of file +var _0xbaa8=['get','isAuthenticated','index','show','post','put','/:id','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xbaa8,0x129));var _0x8baa=function(_0x42662d,_0x1c8732){_0x42662d=_0x42662d-0x0;var _0xef5ae3=_0xbaa8[_0x42662d];return _0xef5ae3;};'use strict';var multer=require(_0x8baa('0x0'));var util=require(_0x8baa('0x1'));var path=require(_0x8baa('0x2'));var timeout=require('connect-timeout');var express=require(_0x8baa('0x3'));var router=express[_0x8baa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8baa('0x5'));var interaction=require(_0x8baa('0x6'));var config=require(_0x8baa('0x7'));var controller=require(_0x8baa('0x8'));router[_0x8baa('0x9')]('/',auth[_0x8baa('0xa')](),controller[_0x8baa('0xb')]);router[_0x8baa('0x9')]('/:id',auth[_0x8baa('0xa')](),controller[_0x8baa('0xc')]);router[_0x8baa('0xd')]('/',auth[_0x8baa('0xa')](),controller['create']);router[_0x8baa('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x8baa('0xf'),auth[_0x8baa('0xa')](),controller[_0x8baa('0x10')]);module[_0x8baa('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index cbd4779..c452d8a 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 _0x9ec2=['variable','picklist','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9ec2,0x125));var _0x29ec=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9ec2[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x29ec('0x0'));module[_0x29ec('0x1')]={'type':{'type':Sequelize[_0x29ec('0x2')](_0x29ec('0x3'),_0x29ec('0x4'),'customVariable','keyValue',_0x29ec('0x5')),'defaultValue':_0x29ec('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x29ec('0x6')]},'keyType':{'type':Sequelize[_0x29ec('0x2')](_0x29ec('0x3'),_0x29ec('0x4'),_0x29ec('0x7'))},'keyContent':{'type':Sequelize[_0x29ec('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x29ec('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x29ec('0x6')]}}; \ No newline at end of file +var _0x4021=['keyValue','picklist','string','STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable'];(function(_0x43bd80,_0x289cc6){var _0x4de12c=function(_0x15f614){while(--_0x15f614){_0x43bd80['push'](_0x43bd80['shift']());}};_0x4de12c(++_0x289cc6);}(_0x4021,0x14f));var _0x1402=function(_0x5c6022,_0x5cd10b){_0x5c6022=_0x5c6022-0x0;var _0x4ab5af=_0x4021[_0x5c6022];return _0x4ab5af;};'use strict';var Sequelize=require(_0x1402('0x0'));module[_0x1402('0x1')]={'type':{'type':Sequelize[_0x1402('0x2')]('string',_0x1402('0x3'),_0x1402('0x4'),_0x1402('0x5'),_0x1402('0x6')),'defaultValue':_0x1402('0x7')},'content':{'type':Sequelize[_0x1402('0x8')]},'key':{'type':Sequelize[_0x1402('0x8')]},'keyType':{'type':Sequelize[_0x1402('0x2')](_0x1402('0x7'),_0x1402('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x1402('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x1402('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1402('0x8')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 1ce3082..37f3646 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 _0x4ded=['sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','reject','save','update','then','destroy','stack','name','index','FreshdeskField','rawAttributes','key','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','model','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x305422,_0x3b35a7){var _0x411ad7=function(_0x52a7b9){while(--_0x52a7b9){_0x305422['push'](_0x305422['shift']());}};_0x411ad7(++_0x3b35a7);}(_0x4ded,0x116));var _0xd4de=function(_0x3af7d0,_0x3afda){_0x3af7d0=_0x3af7d0-0x0;var _0x1e475c=_0x4ded[_0x3af7d0];return _0x1e475c;};'use strict';var emlformat=require(_0xd4de('0x0'));var rimraf=require(_0xd4de('0x1'));var zipdir=require(_0xd4de('0x2'));var jsonpatch=require(_0xd4de('0x3'));var rp=require(_0xd4de('0x4'));var moment=require(_0xd4de('0x5'));var BPromise=require(_0xd4de('0x6'));var Mustache=require(_0xd4de('0x7'));var util=require(_0xd4de('0x8'));var path=require(_0xd4de('0x9'));var sox=require(_0xd4de('0xa'));var csv=require(_0xd4de('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd4de('0xc'));var _=require(_0xd4de('0xd'));var squel=require(_0xd4de('0xe'));var crypto=require(_0xd4de('0xf'));var jsforce=require(_0xd4de('0x10'));var deskjs=require(_0xd4de('0x11'));var toCsv=require('to-csv');var querystring=require(_0xd4de('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd4de('0x13'));var as=require(_0xd4de('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xd4de('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd4de('0x16'));var db=require(_0xd4de('0x17'))['db'];function respondWithStatusCode(_0x104dad,_0x2aa09d){_0x2aa09d=_0x2aa09d||0xcc;return function(_0x3ffc72){if(_0x3ffc72){return _0x104dad[_0xd4de('0x18')](_0x2aa09d);}return _0x104dad[_0xd4de('0x19')](_0x2aa09d)[_0xd4de('0x1a')]();};}function respondWithResult(_0x3e3735,_0x37cb9f){_0x37cb9f=_0x37cb9f||0xc8;return function(_0x691ba9){if(_0x691ba9){return _0x3e3735[_0xd4de('0x19')](_0x37cb9f)[_0xd4de('0x1b')](_0x691ba9);}};}function respondWithFilteredResult(_0xbb4f7e,_0x102e5b){return function(_0xa7c18b){if(_0xa7c18b){var _0x325fba=typeof _0x102e5b['offset']==='undefined'&&typeof _0x102e5b[_0xd4de('0x1c')]===_0xd4de('0x1d');var _0x17b377=_0xa7c18b[_0xd4de('0x1e')];var _0x5b1d1c=_0x325fba?0x0:_0x102e5b['offset'];var _0x1e91d5=_0x325fba?_0xa7c18b['count']:_0x102e5b[_0xd4de('0x1f')]+_0x102e5b[_0xd4de('0x1c')];var _0x50b9e3;if(_0x1e91d5>=_0x17b377){_0x1e91d5=_0x17b377;_0x50b9e3=0xc8;}else{_0x50b9e3=0xce;}_0xbb4f7e[_0xd4de('0x19')](_0x50b9e3);return _0xbb4f7e['set'](_0xd4de('0x20'),_0x5b1d1c+'-'+_0x1e91d5+'/'+_0x17b377)[_0xd4de('0x1b')](_0xa7c18b);}return null;};}function patchUpdates(_0x2bad14){return function(_0x8e8712){try{jsonpatch['apply'](_0x8e8712,_0x2bad14,!![]);}catch(_0x318658){return BPromise[_0xd4de('0x21')](_0x318658);}return _0x8e8712[_0xd4de('0x22')]();};}function saveUpdates(_0xdb3fc,_0x1c631a){return function(_0x2d092a){if(_0x2d092a){return _0x2d092a[_0xd4de('0x23')](_0xdb3fc)[_0xd4de('0x24')](function(_0x2f9de6){return _0x2f9de6;});}return null;};}function removeEntity(_0x413f68,_0x534b37){return function(_0xad333f){if(_0xad333f){return _0xad333f[_0xd4de('0x25')]()[_0xd4de('0x24')](function(){_0x413f68[_0xd4de('0x19')](0xcc)[_0xd4de('0x1a')]();});}};}function handleEntityNotFound(_0x984904,_0xffe1cc){return function(_0x36308c){if(!_0x36308c){_0x984904[_0xd4de('0x18')](0x194);}return _0x36308c;};}function handleError(_0x260c5c,_0x2ea712){_0x2ea712=_0x2ea712||0x1f4;return function(_0xb2d8a1){logger['error'](_0xb2d8a1[_0xd4de('0x26')]);if(_0xb2d8a1[_0xd4de('0x27')]){delete _0xb2d8a1['name'];}_0x260c5c[_0xd4de('0x19')](_0x2ea712)['send'](_0xb2d8a1);};}exports[_0xd4de('0x28')]=function(_0x32e407,_0x15d2b7){var _0x4fa53a={},_0xd4de93={},_0x36f2f1={'count':0x0,'rows':[]};var _0x17f0a=_['map'](db[_0xd4de('0x29')][_0xd4de('0x2a')],function(_0x55f9f9){return{'name':_0x55f9f9['fieldName'],'type':_0x55f9f9['type'][_0xd4de('0x2b')]};});_0xd4de93['model']=_[_0xd4de('0x2c')](_0x17f0a,_0xd4de('0x27'));_0xd4de93[_0xd4de('0x2d')]=_[_0xd4de('0x2e')](_0x32e407['query']);_0xd4de93[_0xd4de('0x2f')]=_[_0xd4de('0x30')](_0xd4de93['model'],_0xd4de93[_0xd4de('0x2d')]);_0x4fa53a[_0xd4de('0x31')]=_['intersection'](_0xd4de93['model'],qs[_0xd4de('0x32')](_0x32e407[_0xd4de('0x2d')][_0xd4de('0x32')]));_0x4fa53a[_0xd4de('0x31')]=_0x4fa53a['attributes'][_0xd4de('0x33')]?_0x4fa53a[_0xd4de('0x31')]:_0xd4de93['model'];if(!_0x32e407[_0xd4de('0x2d')][_0xd4de('0x34')](_0xd4de('0x35'))){_0x4fa53a[_0xd4de('0x1c')]=qs[_0xd4de('0x1c')](_0x32e407[_0xd4de('0x2d')]['limit']);_0x4fa53a['offset']=qs[_0xd4de('0x1f')](_0x32e407[_0xd4de('0x2d')][_0xd4de('0x1f')]);}_0x4fa53a['order']=qs[_0xd4de('0x36')](_0x32e407[_0xd4de('0x2d')]['sort']);_0x4fa53a[_0xd4de('0x37')]=qs[_0xd4de('0x2f')](_[_0xd4de('0x38')](_0x32e407[_0xd4de('0x2d')],_0xd4de93['filters']),_0x17f0a);if(_0x32e407['query'][_0xd4de('0x39')]){_0x4fa53a['where']=_[_0xd4de('0x3a')](_0x4fa53a['where'],{'$or':_[_0xd4de('0x2c')](_0x17f0a,function(_0xcc1d7){if(_0xcc1d7[_0xd4de('0x3b')]!==_0xd4de('0x3c')){var _0x4e6843={};_0x4e6843[_0xcc1d7[_0xd4de('0x27')]]={'$like':'%'+_0x32e407['query'][_0xd4de('0x39')]+'%'};return _0x4e6843;}})});}_0x4fa53a=_[_0xd4de('0x3a')]({},_0x4fa53a,_0x32e407[_0xd4de('0x3d')]);var _0x4517a6={'where':_0x4fa53a[_0xd4de('0x37')]};return db[_0xd4de('0x29')][_0xd4de('0x1e')](_0x4517a6)['then'](function(_0x2333f6){_0x36f2f1[_0xd4de('0x1e')]=_0x2333f6;if(_0x32e407[_0xd4de('0x2d')][_0xd4de('0x3e')]){_0x4fa53a[_0xd4de('0x3f')]=[{'all':!![]}];}return db['FreshdeskField'][_0xd4de('0x40')](_0x4fa53a);})[_0xd4de('0x24')](function(_0x2294e2){_0x36f2f1['rows']=_0x2294e2;return _0x36f2f1;})[_0xd4de('0x24')](respondWithFilteredResult(_0x15d2b7,_0x4fa53a))[_0xd4de('0x41')](handleError(_0x15d2b7,null));};exports[_0xd4de('0x42')]=function(_0x516542,_0x3b9026){var _0x10a42c={'raw':!![],'where':{'id':_0x516542[_0xd4de('0x43')]['id']}},_0x419c49={};_0x419c49[_0xd4de('0x44')]=_[_0xd4de('0x2e')](db[_0xd4de('0x29')]['rawAttributes']);_0x419c49[_0xd4de('0x2d')]=_[_0xd4de('0x2e')](_0x516542[_0xd4de('0x2d')]);_0x419c49['filters']=_[_0xd4de('0x30')](_0x419c49[_0xd4de('0x44')],_0x419c49[_0xd4de('0x2d')]);_0x10a42c['attributes']=_['intersection'](_0x419c49[_0xd4de('0x44')],qs[_0xd4de('0x32')](_0x516542['query'][_0xd4de('0x32')]));_0x10a42c[_0xd4de('0x31')]=_0x10a42c[_0xd4de('0x31')][_0xd4de('0x33')]?_0x10a42c['attributes']:_0x419c49[_0xd4de('0x44')];if(_0x516542[_0xd4de('0x2d')][_0xd4de('0x3e')]){_0x10a42c[_0xd4de('0x3f')]=[{'all':!![]}];}_0x10a42c=_[_0xd4de('0x3a')]({},_0x10a42c,_0x516542[_0xd4de('0x3d')]);return db['FreshdeskField'][_0xd4de('0x45')](_0x10a42c)[_0xd4de('0x24')](handleEntityNotFound(_0x3b9026,null))[_0xd4de('0x24')](respondWithResult(_0x3b9026,null))[_0xd4de('0x41')](handleError(_0x3b9026,null));};exports[_0xd4de('0x46')]=function(_0x1a2bc3,_0x40bf55){return db[_0xd4de('0x29')][_0xd4de('0x46')](_0x1a2bc3[_0xd4de('0x47')],{})['then'](respondWithResult(_0x40bf55,0xc9))[_0xd4de('0x41')](handleError(_0x40bf55,null));};exports[_0xd4de('0x23')]=function(_0x178daf,_0x518bfe){if(_0x178daf[_0xd4de('0x47')]['id']){delete _0x178daf[_0xd4de('0x47')]['id'];}return db[_0xd4de('0x29')][_0xd4de('0x45')]({'where':{'id':_0x178daf[_0xd4de('0x43')]['id']}})[_0xd4de('0x24')](handleEntityNotFound(_0x518bfe,null))[_0xd4de('0x24')](saveUpdates(_0x178daf[_0xd4de('0x47')],null))[_0xd4de('0x24')](respondWithResult(_0x518bfe,null))[_0xd4de('0x41')](handleError(_0x518bfe,null));};exports['destroy']=function(_0x3e4c7f,_0x26d032){return db[_0xd4de('0x29')][_0xd4de('0x45')]({'where':{'id':_0x3e4c7f[_0xd4de('0x43')]['id']}})['then'](handleEntityNotFound(_0x26d032,null))['then'](removeEntity(_0x26d032,null))[_0xd4de('0x41')](handleError(_0x26d032,null));}; \ No newline at end of file +var _0x00b3=['hasOwnProperty','nolimit','order','sort','where','filters','pick','map','VIRTUAL','filter','options','FreshdeskField','includeAll','include','findAll','rows','show','merge','find','create','body','catch','params','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','set','json','reject','save','then','destroy','stack','name','send','index','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','length'];(function(_0x377e08,_0x2eb9b3){var _0x3e43f8=function(_0x76207d){while(--_0x76207d){_0x377e08['push'](_0x377e08['shift']());}};_0x3e43f8(++_0x2eb9b3);}(_0x00b3,0x17a));var _0x300b=function(_0x4c4c6f,_0x237541){_0x4c4c6f=_0x4c4c6f-0x0;var _0x315f91=_0x00b3[_0x4c4c6f];return _0x315f91;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x300b('0x0'));var zipdir=require(_0x300b('0x1'));var jsonpatch=require(_0x300b('0x2'));var rp=require(_0x300b('0x3'));var moment=require('moment');var BPromise=require(_0x300b('0x4'));var Mustache=require('mustache');var util=require(_0x300b('0x5'));var path=require('path');var sox=require(_0x300b('0x6'));var csv=require(_0x300b('0x7'));var ejs=require(_0x300b('0x8'));var fs=require('fs');var fs_extra=require(_0x300b('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x300b('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x300b('0x7'));var querystring=require(_0x300b('0xb'));var Papa=require(_0x300b('0xc'));var Redis=require('ioredis');var authService=require(_0x300b('0xd'));var qs=require(_0x300b('0xe'));var as=require(_0x300b('0xf'));var hardwareService=require(_0x300b('0x10'));var logger=require('../../config/logger')(_0x300b('0x11'));var utils=require(_0x300b('0x12'));var config=require(_0x300b('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x300b('0x14'))['db'];function respondWithStatusCode(_0xea95bb,_0x138efb){_0x138efb=_0x138efb||0xcc;return function(_0x40c03b){if(_0x40c03b){return _0xea95bb[_0x300b('0x15')](_0x138efb);}return _0xea95bb[_0x300b('0x16')](_0x138efb)[_0x300b('0x17')]();};}function respondWithResult(_0x10bb41,_0x58746b){_0x58746b=_0x58746b||0xc8;return function(_0x54c3ee){if(_0x54c3ee){return _0x10bb41['status'](_0x58746b)['json'](_0x54c3ee);}};}function respondWithFilteredResult(_0x44e61b,_0x26c0e5){return function(_0xfb49f){if(_0xfb49f){var _0xd252fa=typeof _0x26c0e5['offset']==='undefined'&&typeof _0x26c0e5[_0x300b('0x18')]===_0x300b('0x19');var _0x2fed99=_0xfb49f[_0x300b('0x1a')];var _0x4d2024=_0xd252fa?0x0:_0x26c0e5[_0x300b('0x1b')];var _0x2a7d96=_0xd252fa?_0xfb49f[_0x300b('0x1a')]:_0x26c0e5['offset']+_0x26c0e5[_0x300b('0x18')];var _0x10174b;if(_0x2a7d96>=_0x2fed99){_0x2a7d96=_0x2fed99;_0x10174b=0xc8;}else{_0x10174b=0xce;}_0x44e61b[_0x300b('0x16')](_0x10174b);return _0x44e61b[_0x300b('0x1c')]('Content-Range',_0x4d2024+'-'+_0x2a7d96+'/'+_0x2fed99)[_0x300b('0x1d')](_0xfb49f);}return null;};}function patchUpdates(_0x16bfc6){return function(_0x971d15){try{jsonpatch['apply'](_0x971d15,_0x16bfc6,!![]);}catch(_0xe05542){return BPromise[_0x300b('0x1e')](_0xe05542);}return _0x971d15[_0x300b('0x1f')]();};}function saveUpdates(_0x502c5f,_0x26913f){return function(_0x5b14ed){if(_0x5b14ed){return _0x5b14ed['update'](_0x502c5f)[_0x300b('0x20')](function(_0xad0fb){return _0xad0fb;});}return null;};}function removeEntity(_0x28bc0a,_0x3ea40b){return function(_0x3219aa){if(_0x3219aa){return _0x3219aa[_0x300b('0x21')]()[_0x300b('0x20')](function(){_0x28bc0a[_0x300b('0x16')](0xcc)[_0x300b('0x17')]();});}};}function handleEntityNotFound(_0x544658,_0x3d62b1){return function(_0x152048){if(!_0x152048){_0x544658[_0x300b('0x15')](0x194);}return _0x152048;};}function handleError(_0x43c480,_0x4cce77){_0x4cce77=_0x4cce77||0x1f4;return function(_0x4f50b0){logger['error'](_0x4f50b0[_0x300b('0x22')]);if(_0x4f50b0['name']){delete _0x4f50b0[_0x300b('0x23')];}_0x43c480[_0x300b('0x16')](_0x4cce77)[_0x300b('0x24')](_0x4f50b0);};}exports[_0x300b('0x25')]=function(_0x2d2ea7,_0x10ed6b){var _0x165f56={},_0x159b63={},_0x1cdc8b={'count':0x0,'rows':[]};var _0x3210cd=_['map'](db['FreshdeskField'][_0x300b('0x26')],function(_0x2a7604){return{'name':_0x2a7604[_0x300b('0x27')],'type':_0x2a7604[_0x300b('0x28')]['key']};});_0x159b63[_0x300b('0x29')]=_['map'](_0x3210cd,'name');_0x159b63['query']=_[_0x300b('0x2a')](_0x2d2ea7[_0x300b('0x2b')]);_0x159b63['filters']=_[_0x300b('0x2c')](_0x159b63[_0x300b('0x29')],_0x159b63['query']);_0x165f56[_0x300b('0x2d')]=_['intersection'](_0x159b63[_0x300b('0x29')],qs[_0x300b('0x2e')](_0x2d2ea7[_0x300b('0x2b')][_0x300b('0x2e')]));_0x165f56[_0x300b('0x2d')]=_0x165f56[_0x300b('0x2d')][_0x300b('0x2f')]?_0x165f56['attributes']:_0x159b63[_0x300b('0x29')];if(!_0x2d2ea7['query'][_0x300b('0x30')](_0x300b('0x31'))){_0x165f56['limit']=qs[_0x300b('0x18')](_0x2d2ea7[_0x300b('0x2b')]['limit']);_0x165f56[_0x300b('0x1b')]=qs[_0x300b('0x1b')](_0x2d2ea7[_0x300b('0x2b')]['offset']);}_0x165f56[_0x300b('0x32')]=qs[_0x300b('0x33')](_0x2d2ea7[_0x300b('0x2b')][_0x300b('0x33')]);_0x165f56[_0x300b('0x34')]=qs[_0x300b('0x35')](_[_0x300b('0x36')](_0x2d2ea7['query'],_0x159b63[_0x300b('0x35')]),_0x3210cd);if(_0x2d2ea7[_0x300b('0x2b')]['filter']){_0x165f56[_0x300b('0x34')]=_['merge'](_0x165f56['where'],{'$or':_[_0x300b('0x37')](_0x3210cd,function(_0x393017){if(_0x393017[_0x300b('0x28')]!==_0x300b('0x38')){var _0xa9c0bf={};_0xa9c0bf[_0x393017['name']]={'$like':'%'+_0x2d2ea7[_0x300b('0x2b')][_0x300b('0x39')]+'%'};return _0xa9c0bf;}})});}_0x165f56=_['merge']({},_0x165f56,_0x2d2ea7[_0x300b('0x3a')]);var _0x479561={'where':_0x165f56[_0x300b('0x34')]};return db[_0x300b('0x3b')][_0x300b('0x1a')](_0x479561)[_0x300b('0x20')](function(_0x40b715){_0x1cdc8b[_0x300b('0x1a')]=_0x40b715;if(_0x2d2ea7[_0x300b('0x2b')][_0x300b('0x3c')]){_0x165f56[_0x300b('0x3d')]=[{'all':!![]}];}return db[_0x300b('0x3b')][_0x300b('0x3e')](_0x165f56);})['then'](function(_0x4ee1d0){_0x1cdc8b[_0x300b('0x3f')]=_0x4ee1d0;return _0x1cdc8b;})['then'](respondWithFilteredResult(_0x10ed6b,_0x165f56))['catch'](handleError(_0x10ed6b,null));};exports[_0x300b('0x40')]=function(_0x24cb83,_0x61fc72){var _0x5ef864={'raw':!![],'where':{'id':_0x24cb83['params']['id']}},_0x7aa03a={};_0x7aa03a['model']=_[_0x300b('0x2a')](db[_0x300b('0x3b')]['rawAttributes']);_0x7aa03a[_0x300b('0x2b')]=_[_0x300b('0x2a')](_0x24cb83['query']);_0x7aa03a[_0x300b('0x35')]=_[_0x300b('0x2c')](_0x7aa03a['model'],_0x7aa03a[_0x300b('0x2b')]);_0x5ef864[_0x300b('0x2d')]=_[_0x300b('0x2c')](_0x7aa03a[_0x300b('0x29')],qs[_0x300b('0x2e')](_0x24cb83[_0x300b('0x2b')][_0x300b('0x2e')]));_0x5ef864[_0x300b('0x2d')]=_0x5ef864['attributes']['length']?_0x5ef864[_0x300b('0x2d')]:_0x7aa03a['model'];if(_0x24cb83['query'][_0x300b('0x3c')]){_0x5ef864[_0x300b('0x3d')]=[{'all':!![]}];}_0x5ef864=_[_0x300b('0x41')]({},_0x5ef864,_0x24cb83[_0x300b('0x3a')]);return db[_0x300b('0x3b')][_0x300b('0x42')](_0x5ef864)['then'](handleEntityNotFound(_0x61fc72,null))[_0x300b('0x20')](respondWithResult(_0x61fc72,null))['catch'](handleError(_0x61fc72,null));};exports['create']=function(_0x3b6ed2,_0x44d1b4){return db['FreshdeskField'][_0x300b('0x43')](_0x3b6ed2[_0x300b('0x44')],{})[_0x300b('0x20')](respondWithResult(_0x44d1b4,0xc9))[_0x300b('0x45')](handleError(_0x44d1b4,null));};exports['update']=function(_0x389256,_0x43eef6){if(_0x389256['body']['id']){delete _0x389256[_0x300b('0x44')]['id'];}return db[_0x300b('0x3b')][_0x300b('0x42')]({'where':{'id':_0x389256['params']['id']}})[_0x300b('0x20')](handleEntityNotFound(_0x43eef6,null))[_0x300b('0x20')](saveUpdates(_0x389256[_0x300b('0x44')],null))[_0x300b('0x20')](respondWithResult(_0x43eef6,null))[_0x300b('0x45')](handleError(_0x43eef6,null));};exports[_0x300b('0x21')]=function(_0x418ac3,_0x3dd25c){return db[_0x300b('0x3b')][_0x300b('0x42')]({'where':{'id':_0x418ac3[_0x300b('0x46')]['id']}})[_0x300b('0x20')](handleEntityNotFound(_0x3dd25c,null))[_0x300b('0x20')](removeEntity(_0x3dd25c,null))['catch'](handleError(_0x3dd25c,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 6ec0fa8..dd9ed1b 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 _0x7521=['moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','freshdesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api'];(function(_0x207f6e,_0x5a0657){var _0x2298ff=function(_0x3dabb8){while(--_0x3dabb8){_0x207f6e['push'](_0x207f6e['shift']());}};_0x2298ff(++_0x5a0657);}(_0x7521,0x8c));var _0x1752=function(_0x2c29f5,_0xdc0da2){_0x2c29f5=_0x2c29f5-0x0;var _0x3c99b2=_0x7521[_0x2c29f5];return _0x3c99b2;};'use strict';var _=require(_0x1752('0x0'));var util=require(_0x1752('0x1'));var logger=require(_0x1752('0x2'))(_0x1752('0x3'));var moment=require(_0x1752('0x4'));var BPromise=require(_0x1752('0x5'));var rp=require(_0x1752('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1752('0x7'));var config=require(_0x1752('0x8'));var attributes=require(_0x1752('0x9'));module[_0x1752('0xa')]=function(_0x5b6ea3,_0x28f24d){return _0x5b6ea3[_0x1752('0xb')](_0x1752('0xc'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x1752('0xd'),'fields':[_0x1752('0xe'),_0x1752('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7f90=['exports','define','freshdesk_unique_index','idField','lodash','util','../../config/logger','api','moment','path','rimraf','./intFreshdeskField.attributes'];(function(_0x4f0837,_0x2ef53b){var _0x30abc4=function(_0xbe1347){while(--_0xbe1347){_0x4f0837['push'](_0x4f0837['shift']());}};_0x30abc4(++_0x2ef53b);}(_0x7f90,0xf4));var _0x07f9=function(_0x232719,_0x37a326){_0x232719=_0x232719-0x0;var _0x21ee88=_0x7f90[_0x232719];return _0x21ee88;};'use strict';var _=require(_0x07f9('0x0'));var util=require(_0x07f9('0x1'));var logger=require(_0x07f9('0x2'))(_0x07f9('0x3'));var moment=require(_0x07f9('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x07f9('0x5'));var rimraf=require(_0x07f9('0x6'));var config=require('../../config/environment');var attributes=require(_0x07f9('0x7'));module[_0x07f9('0x8')]=function(_0x46f86e,_0x449544){return _0x46f86e[_0x07f9('0x9')]('FreshdeskField',attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x07f9('0xa'),'fields':[_0x07f9('0xb'),'FieldId'],'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 d120d53..6eff16f 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 _0xceab=['rpc','../../config/environment','jayson/promise','client','http','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4eea93,_0x48a6d5){var _0x2531d0=function(_0x5c1c2c){while(--_0x5c1c2c){_0x4eea93['push'](_0x4eea93['shift']());}};_0x2531d0(++_0x48a6d5);}(_0xceab,0x93));var _0xbcea=function(_0x276777,_0x28762a){_0x276777=_0x276777-0x0;var _0x617d81=_0xceab[_0x276777];return _0x617d81;};'use strict';var _=require(_0xbcea('0x0'));var util=require(_0xbcea('0x1'));var moment=require(_0xbcea('0x2'));var BPromise=require(_0xbcea('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbcea('0x4'))['db'];var utils=require(_0xbcea('0x5'));var logger=require(_0xbcea('0x6'))(_0xbcea('0x7'));var config=require(_0xbcea('0x8'));var jayson=require(_0xbcea('0x9'));var client=jayson[_0xbcea('0xa')][_0xbcea('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a47d8,_0x30e93d,_0xae8b91){return new BPromise(function(_0x261657,_0x2383f2){return client['request'](_0x5a47d8,_0xae8b91)[_0xbcea('0xc')](function(_0x2c4930){logger[_0xbcea('0xd')](_0xbcea('0xe'),_0x30e93d,_0xbcea('0xf'));logger[_0xbcea('0x10')](_0xbcea('0x11'),_0x30e93d,_0xbcea('0xf'),JSON[_0xbcea('0x12')](_0x2c4930));if(_0x2c4930[_0xbcea('0x13')]){if(_0x2c4930[_0xbcea('0x13')]['code']===0x1f4){logger[_0xbcea('0x13')](_0xbcea('0xe'),_0x30e93d,_0x2c4930[_0xbcea('0x13')][_0xbcea('0x14')]);return _0x2383f2(_0x2c4930['error'][_0xbcea('0x14')]);}logger[_0xbcea('0x13')](_0xbcea('0xe'),_0x30e93d,_0x2c4930['error'][_0xbcea('0x14')]);return _0x261657(_0x2c4930[_0xbcea('0x13')]['message']);}else{logger[_0xbcea('0xd')](_0xbcea('0xe'),_0x30e93d,_0xbcea('0xf'));_0x261657(_0x2c4930['result']['message']);}})[_0xbcea('0x15')](function(_0x3c5e3e){logger[_0xbcea('0x13')](_0xbcea('0xe'),_0x30e93d,_0x3c5e3e);_0x2383f2(_0x3c5e3e);});});} \ No newline at end of file +var _0xf87a=['client','http','request','debug','request\x20sent','stringify','error','code','FreshdeskField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise'];(function(_0x152a69,_0x45a510){var _0x9f8e78=function(_0x1051b4){while(--_0x1051b4){_0x152a69['push'](_0x152a69['shift']());}};_0x9f8e78(++_0x45a510);}(_0xf87a,0x124));var _0xaf87=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xf87a[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0xaf87('0x0'));var util=require(_0xaf87('0x1'));var moment=require(_0xaf87('0x2'));var BPromise=require('bluebird');var rs=require(_0xaf87('0x3'));var fs=require('fs');var Redis=require(_0xaf87('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaf87('0x5'))('rpc');var config=require(_0xaf87('0x6'));var jayson=require(_0xaf87('0x7'));var client=jayson[_0xaf87('0x8')][_0xaf87('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f87e1,_0x57c478,_0x3bb837){return new BPromise(function(_0x3b5ba0,_0x532bed){return client[_0xaf87('0xa')](_0x4f87e1,_0x3bb837)['then'](function(_0x2dec68){logger['info']('FreshdeskField,\x20%s,\x20%s',_0x57c478,'request\x20sent');logger[_0xaf87('0xb')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x57c478,_0xaf87('0xc'),JSON[_0xaf87('0xd')](_0x2dec68));if(_0x2dec68[_0xaf87('0xe')]){if(_0x2dec68[_0xaf87('0xe')][_0xaf87('0xf')]===0x1f4){logger[_0xaf87('0xe')](_0xaf87('0x10'),_0x57c478,_0x2dec68[_0xaf87('0xe')][_0xaf87('0x11')]);return _0x532bed(_0x2dec68[_0xaf87('0xe')][_0xaf87('0x11')]);}logger[_0xaf87('0xe')]('FreshdeskField,\x20%s,\x20%s',_0x57c478,_0x2dec68['error'][_0xaf87('0x11')]);return _0x3b5ba0(_0x2dec68['error'][_0xaf87('0x11')]);}else{logger['info']('FreshdeskField,\x20%s,\x20%s',_0x57c478,_0xaf87('0xc'));_0x3b5ba0(_0x2dec68[_0xaf87('0x12')][_0xaf87('0x11')]);}})[_0xaf87('0x13')](function(_0x5e8d15){logger[_0xaf87('0xe')](_0xaf87('0x10'),_0x57c478,_0x5e8d15);_0x532bed(_0x5e8d15);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index d2c1b5d..0b5d5fa 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 _0x7072=['put','update','destroy','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration'];(function(_0x490e96,_0x1ec4aa){var _0x32cb23=function(_0x440453){while(--_0x440453){_0x490e96['push'](_0x490e96['shift']());}};_0x32cb23(++_0x1ec4aa);}(_0x7072,0x138));var _0x2707=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x7072[_0x209941];return _0x1e8729;};'use strict';var multer=require('multer');var util=require(_0x2707('0x0'));var path=require(_0x2707('0x1'));var timeout=require(_0x2707('0x2'));var express=require(_0x2707('0x3'));var router=express[_0x2707('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2707('0x5'));var config=require('../../config/environment');var controller=require(_0x2707('0x6'));router[_0x2707('0x7')]('/',auth[_0x2707('0x8')](),controller[_0x2707('0x9')]);router[_0x2707('0x7')](_0x2707('0xa'),auth[_0x2707('0x8')](),controller[_0x2707('0xb')]);router[_0x2707('0x7')](_0x2707('0xc'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x2707('0x7')](_0x2707('0xd'),auth[_0x2707('0x8')](),controller[_0x2707('0xe')]);router[_0x2707('0xf')]('/',auth[_0x2707('0x8')](),controller[_0x2707('0x10')]);router[_0x2707('0xf')](_0x2707('0xc'),auth[_0x2707('0x8')](),controller[_0x2707('0x11')]);router[_0x2707('0x12')](_0x2707('0xa'),auth['isAuthenticated'](),controller[_0x2707('0x13')]);router['delete'](_0x2707('0xa'),auth[_0x2707('0x8')](),controller[_0x2707('0x14')]);module[_0x2707('0x15')]=router; \ No newline at end of file +var _0x0fd9=['../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','update','destroy','exports','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x141310,_0x4fb243){var _0x4680ae=function(_0x215303){while(--_0x215303){_0x141310['push'](_0x141310['shift']());}};_0x4680ae(++_0x4fb243);}(_0x0fd9,0xa3));var _0x90fd=function(_0x5a7112,_0x1f9492){_0x5a7112=_0x5a7112-0x0;var _0x3147f7=_0x0fd9[_0x5a7112];return _0x3147f7;};'use strict';var multer=require('multer');var util=require(_0x90fd('0x0'));var path=require(_0x90fd('0x1'));var timeout=require(_0x90fd('0x2'));var express=require(_0x90fd('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x90fd('0x4'));var interaction=require(_0x90fd('0x5'));var config=require(_0x90fd('0x6'));var controller=require(_0x90fd('0x7'));router[_0x90fd('0x8')]('/',auth[_0x90fd('0x9')](),controller['index']);router['get'](_0x90fd('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x90fd('0x8')](_0x90fd('0xb'),auth['isAuthenticated'](),controller[_0x90fd('0xc')]);router[_0x90fd('0x8')](_0x90fd('0xd'),auth[_0x90fd('0x9')](),controller[_0x90fd('0xe')]);router[_0x90fd('0xf')]('/',auth[_0x90fd('0x9')](),controller[_0x90fd('0x10')]);router[_0x90fd('0xf')]('/:id/configurations',auth[_0x90fd('0x9')](),controller[_0x90fd('0x11')]);router['put'](_0x90fd('0xa'),auth[_0x90fd('0x9')](),controller[_0x90fd('0x12')]);router['delete'](_0x90fd('0xa'),auth['isAuthenticated'](),controller[_0x90fd('0x13')]);module[_0x90fd('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 5bca46f..774af23 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 _0x2272=['sequelize','exports','STRING','remoteUri'];(function(_0x30f07a,_0x98341){var _0xb38461=function(_0x7b287a){while(--_0x7b287a){_0x30f07a['push'](_0x30f07a['shift']());}};_0xb38461(++_0x98341);}(_0x2272,0xd8));var _0x2227=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2272[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x2227('0x0'));module[_0x2227('0x1')]={'name':{'type':Sequelize[_0x2227('0x2')]},'description':{'type':Sequelize[_0x2227('0x2')]},'username':{'type':Sequelize[_0x2227('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0x2227('0x2')]},'remoteUri':{'type':Sequelize[_0x2227('0x2')],'unique':_0x2227('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x2542=['remoteUri','sequelize','exports','STRING','username'];(function(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0x2542,0x169));var _0x2254=function(_0x1d4c20,_0x1961e0){_0x1d4c20=_0x1d4c20-0x0;var _0x16e804=_0x2542[_0x1d4c20];return _0x16e804;};'use strict';var Sequelize=require(_0x2254('0x0'));module[_0x2254('0x1')]={'name':{'type':Sequelize[_0x2254('0x2')]},'description':{'type':Sequelize[_0x2254('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x2254('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x2254('0x2')],'unique':_0x2254('0x4')},'serverUrl':{'type':Sequelize[_0x2254('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 4b445b1..e76a80e 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 _0x4e23=['getDescriptions','channel','FreshsalesField','username','remoteUri','slice','substring','lastIndexOf','GET','format','/api/selector/owners','Token\x20token=','apiKey','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','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','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','sort','filters','pick','where','merge','VIRTUAL','options','FreshsalesAccount','includeAll','findAll','rows','catch','params','rawAttributes','length','find','create','body','getConfigurations','findOne','FreshsalesConfiguration','order','filter','addConfiguration','AccountId','Subjects','getSubjects','Descriptions'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x4e23,0x83));var _0x34e2=function(_0x43590d,_0x1acb23){_0x43590d=_0x43590d-0x0;var _0x294b30=_0x4e23[_0x43590d];return _0x294b30;};'use strict';var emlformat=require(_0x34e2('0x0'));var rimraf=require(_0x34e2('0x1'));var zipdir=require(_0x34e2('0x2'));var jsonpatch=require(_0x34e2('0x3'));var rp=require(_0x34e2('0x4'));var moment=require('moment');var BPromise=require(_0x34e2('0x5'));var Mustache=require(_0x34e2('0x6'));var util=require(_0x34e2('0x7'));var path=require(_0x34e2('0x8'));var sox=require(_0x34e2('0x9'));var csv=require(_0x34e2('0xa'));var ejs=require(_0x34e2('0xb'));var fs=require('fs');var fs_extra=require(_0x34e2('0xc'));var _=require(_0x34e2('0xd'));var squel=require(_0x34e2('0xe'));var crypto=require('crypto');var jsforce=require(_0x34e2('0xf'));var deskjs=require(_0x34e2('0x10'));var toCsv=require(_0x34e2('0xa'));var querystring=require(_0x34e2('0x11'));var Papa=require(_0x34e2('0x12'));var Redis=require(_0x34e2('0x13'));var authService=require(_0x34e2('0x14'));var qs=require(_0x34e2('0x15'));var as=require(_0x34e2('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x34e2('0x17'))('api');var utils=require(_0x34e2('0x18'));var config=require(_0x34e2('0x19'));var licenseUtil=require(_0x34e2('0x1a'));var db=require(_0x34e2('0x1b'))['db'];var integrations=require(_0x34e2('0x1c'));function respondWithStatusCode(_0x2607f6,_0x462ba2){_0x462ba2=_0x462ba2||0xcc;return function(_0x596416){if(_0x596416){return _0x2607f6['sendStatus'](_0x462ba2);}return _0x2607f6[_0x34e2('0x1d')](_0x462ba2)[_0x34e2('0x1e')]();};}function respondWithResult(_0x199430,_0x332b4e){_0x332b4e=_0x332b4e||0xc8;return function(_0x361087){if(_0x361087){return _0x199430[_0x34e2('0x1d')](_0x332b4e)[_0x34e2('0x1f')](_0x361087);}};}function respondWithFilteredResult(_0x42a3c1,_0x44b0af){return function(_0x1ea96d){if(_0x1ea96d){var _0x251922=typeof _0x44b0af[_0x34e2('0x20')]===_0x34e2('0x21')&&typeof _0x44b0af[_0x34e2('0x22')]===_0x34e2('0x21');var _0x432c3d=_0x1ea96d[_0x34e2('0x23')];var _0x57c639=_0x251922?0x0:_0x44b0af[_0x34e2('0x20')];var _0x29ab24=_0x251922?_0x1ea96d[_0x34e2('0x23')]:_0x44b0af[_0x34e2('0x20')]+_0x44b0af[_0x34e2('0x22')];var _0x2dd4c8;if(_0x29ab24>=_0x432c3d){_0x29ab24=_0x432c3d;_0x2dd4c8=0xc8;}else{_0x2dd4c8=0xce;}_0x42a3c1[_0x34e2('0x1d')](_0x2dd4c8);return _0x42a3c1[_0x34e2('0x24')](_0x34e2('0x25'),_0x57c639+'-'+_0x29ab24+'/'+_0x432c3d)['json'](_0x1ea96d);}return null;};}function patchUpdates(_0x373d00){return function(_0x57fc0d){try{jsonpatch[_0x34e2('0x26')](_0x57fc0d,_0x373d00,!![]);}catch(_0x1bec84){return BPromise[_0x34e2('0x27')](_0x1bec84);}return _0x57fc0d[_0x34e2('0x28')]();};}function saveUpdates(_0x2c40ba,_0x425942){return function(_0x459cd2){if(_0x459cd2){return _0x459cd2[_0x34e2('0x29')](_0x2c40ba)[_0x34e2('0x2a')](function(_0x581c69){return _0x581c69;});}return null;};}function removeEntity(_0x3876f1,_0x1c2c24){return function(_0x3f79b8){if(_0x3f79b8){return _0x3f79b8[_0x34e2('0x2b')]()[_0x34e2('0x2a')](function(){_0x3876f1['status'](0xcc)[_0x34e2('0x1e')]();});}};}function handleEntityNotFound(_0x19acd2,_0x9e6434){return function(_0x42675e){if(!_0x42675e){_0x19acd2[_0x34e2('0x2c')](0x194);}return _0x42675e;};}function handleError(_0x2879ea,_0x200ee0){_0x200ee0=_0x200ee0||0x1f4;return function(_0x3e25c5){logger[_0x34e2('0x2d')](_0x3e25c5[_0x34e2('0x2e')]);if(_0x3e25c5[_0x34e2('0x2f')]){delete _0x3e25c5['name'];}_0x2879ea[_0x34e2('0x1d')](_0x200ee0)[_0x34e2('0x30')](_0x3e25c5);};}exports[_0x34e2('0x31')]=function(_0x59abdc,_0x5cad38){var _0x1cf837={},_0x3b58d1={},_0x2eeda8={'count':0x0,'rows':[]};var _0xcf8ad8=_[_0x34e2('0x32')](db['FreshsalesAccount']['rawAttributes'],function(_0x40969b){return{'name':_0x40969b[_0x34e2('0x33')],'type':_0x40969b[_0x34e2('0x34')][_0x34e2('0x35')]};});_0x3b58d1[_0x34e2('0x36')]=_['map'](_0xcf8ad8,'name');_0x3b58d1[_0x34e2('0x37')]=_[_0x34e2('0x38')](_0x59abdc['query']);_0x3b58d1['filters']=_[_0x34e2('0x39')](_0x3b58d1[_0x34e2('0x36')],_0x3b58d1[_0x34e2('0x37')]);_0x1cf837[_0x34e2('0x3a')]=_[_0x34e2('0x39')](_0x3b58d1[_0x34e2('0x36')],qs[_0x34e2('0x3b')](_0x59abdc['query']['fields']));_0x1cf837[_0x34e2('0x3a')]=_0x1cf837['attributes']['length']?_0x1cf837['attributes']:_0x3b58d1[_0x34e2('0x36')];if(!_0x59abdc[_0x34e2('0x37')][_0x34e2('0x3c')]('nolimit')){_0x1cf837['limit']=qs['limit'](_0x59abdc[_0x34e2('0x37')][_0x34e2('0x22')]);_0x1cf837[_0x34e2('0x20')]=qs[_0x34e2('0x20')](_0x59abdc[_0x34e2('0x37')]['offset']);}_0x1cf837['order']=qs[_0x34e2('0x3d')](_0x59abdc['query'][_0x34e2('0x3d')]);_0x1cf837['where']=qs[_0x34e2('0x3e')](_[_0x34e2('0x3f')](_0x59abdc['query'],_0x3b58d1[_0x34e2('0x3e')]),_0xcf8ad8);if(_0x59abdc[_0x34e2('0x37')]['filter']){_0x1cf837[_0x34e2('0x40')]=_[_0x34e2('0x41')](_0x1cf837[_0x34e2('0x40')],{'$or':_[_0x34e2('0x32')](_0xcf8ad8,function(_0x34d7ef){if(_0x34d7ef[_0x34e2('0x34')]!==_0x34e2('0x42')){var _0x26ef39={};_0x26ef39[_0x34d7ef[_0x34e2('0x2f')]]={'$like':'%'+_0x59abdc['query']['filter']+'%'};return _0x26ef39;}})});}_0x1cf837=_['merge']({},_0x1cf837,_0x59abdc[_0x34e2('0x43')]);var _0x2e6b40={'where':_0x1cf837[_0x34e2('0x40')]};return db[_0x34e2('0x44')][_0x34e2('0x23')](_0x2e6b40)[_0x34e2('0x2a')](function(_0x151e86){_0x2eeda8[_0x34e2('0x23')]=_0x151e86;if(_0x59abdc[_0x34e2('0x37')][_0x34e2('0x45')]){_0x1cf837['include']=[{'all':!![]}];}return db[_0x34e2('0x44')][_0x34e2('0x46')](_0x1cf837);})[_0x34e2('0x2a')](function(_0x1b39f1){_0x2eeda8[_0x34e2('0x47')]=_0x1b39f1;return _0x2eeda8;})[_0x34e2('0x2a')](respondWithFilteredResult(_0x5cad38,_0x1cf837))[_0x34e2('0x48')](handleError(_0x5cad38,null));};exports['show']=function(_0x1ec220,_0x3583a6){var _0x1bbc95={'raw':![],'where':{'id':_0x1ec220[_0x34e2('0x49')]['id']}},_0x246010={};_0x246010['model']=_['keys'](db[_0x34e2('0x44')][_0x34e2('0x4a')]);_0x246010[_0x34e2('0x37')]=_[_0x34e2('0x38')](_0x1ec220[_0x34e2('0x37')]);_0x246010[_0x34e2('0x3e')]=_[_0x34e2('0x39')](_0x246010[_0x34e2('0x36')],_0x246010['query']);_0x1bbc95['attributes']=_[_0x34e2('0x39')](_0x246010[_0x34e2('0x36')],qs['fields'](_0x1ec220[_0x34e2('0x37')][_0x34e2('0x3b')]));_0x1bbc95[_0x34e2('0x3a')]=_0x1bbc95['attributes'][_0x34e2('0x4b')]?_0x1bbc95[_0x34e2('0x3a')]:_0x246010[_0x34e2('0x36')];if(_0x1ec220[_0x34e2('0x37')]['includeAll']){_0x1bbc95['include']=[{'all':!![]}];}_0x1bbc95=_[_0x34e2('0x41')]({},_0x1bbc95,_0x1ec220[_0x34e2('0x43')]);return db['FreshsalesAccount'][_0x34e2('0x4c')](_0x1bbc95)[_0x34e2('0x2a')](handleEntityNotFound(_0x3583a6,null))[_0x34e2('0x2a')](respondWithResult(_0x3583a6,null))[_0x34e2('0x48')](handleError(_0x3583a6,null));};exports[_0x34e2('0x4d')]=function(_0x189f2d,_0x1c1c7a){return db[_0x34e2('0x44')][_0x34e2('0x4d')](_0x189f2d[_0x34e2('0x4e')],{})[_0x34e2('0x2a')](respondWithResult(_0x1c1c7a,0xc9))[_0x34e2('0x48')](handleError(_0x1c1c7a,null));};exports[_0x34e2('0x29')]=function(_0x22496a,_0x2707f5){if(_0x22496a[_0x34e2('0x4e')]['id']){delete _0x22496a[_0x34e2('0x4e')]['id'];}return db[_0x34e2('0x44')][_0x34e2('0x4c')]({'where':{'id':_0x22496a[_0x34e2('0x49')]['id']}})[_0x34e2('0x2a')](handleEntityNotFound(_0x2707f5,null))['then'](saveUpdates(_0x22496a[_0x34e2('0x4e')],null))[_0x34e2('0x2a')](respondWithResult(_0x2707f5,null))[_0x34e2('0x48')](handleError(_0x2707f5,null));};exports['destroy']=function(_0x3ac02b,_0x360ae3){return db['FreshsalesAccount']['find']({'where':{'id':_0x3ac02b[_0x34e2('0x49')]['id']}})[_0x34e2('0x2a')](handleEntityNotFound(_0x360ae3,null))['then'](removeEntity(_0x360ae3,null))['catch'](handleError(_0x360ae3,null));};exports[_0x34e2('0x4f')]=function(_0x2657fd,_0x35d6ee,_0x1b52eb){var _0x443de9={};var _0x8e71cc={};var _0x5ef76b;var _0x15df17;return db[_0x34e2('0x44')][_0x34e2('0x50')]({'where':{'id':_0x2657fd[_0x34e2('0x49')]['id']}})[_0x34e2('0x2a')](handleEntityNotFound(_0x35d6ee,null))[_0x34e2('0x2a')](function(_0xa286a0){if(_0xa286a0){_0x5ef76b=_0xa286a0;_0x8e71cc[_0x34e2('0x36')]=_[_0x34e2('0x38')](db[_0x34e2('0x51')][_0x34e2('0x4a')]);_0x8e71cc[_0x34e2('0x37')]=_['keys'](_0x2657fd[_0x34e2('0x37')]);_0x8e71cc[_0x34e2('0x3e')]=_[_0x34e2('0x39')](_0x8e71cc[_0x34e2('0x36')],_0x8e71cc[_0x34e2('0x37')]);_0x443de9[_0x34e2('0x3a')]=_[_0x34e2('0x39')](_0x8e71cc[_0x34e2('0x36')],qs[_0x34e2('0x3b')](_0x2657fd[_0x34e2('0x37')][_0x34e2('0x3b')]));_0x443de9[_0x34e2('0x3a')]=_0x443de9[_0x34e2('0x3a')]['length']?_0x443de9['attributes']:_0x8e71cc[_0x34e2('0x36')];_0x443de9[_0x34e2('0x52')]=qs[_0x34e2('0x3d')](_0x2657fd['query'][_0x34e2('0x3d')]);_0x443de9[_0x34e2('0x40')]=qs[_0x34e2('0x3e')](_['pick'](_0x2657fd['query'],_0x8e71cc['filters']));if(_0x2657fd[_0x34e2('0x37')]['filter']){_0x443de9[_0x34e2('0x40')]=_[_0x34e2('0x41')](_0x443de9[_0x34e2('0x40')],{'$or':_['map'](_0x443de9[_0x34e2('0x3a')],function(_0x416f2b){var _0x1212f5={};_0x1212f5[_0x416f2b]={'$like':'%'+_0x2657fd[_0x34e2('0x37')][_0x34e2('0x53')]+'%'};return _0x1212f5;})});}_0x443de9=_[_0x34e2('0x41')]({},_0x443de9,_0x2657fd['options']);return _0x5ef76b['getConfigurations'](_0x443de9);}})[_0x34e2('0x2a')](function(_0x361666){if(_0x361666){_0x15df17=_0x361666[_0x34e2('0x4b')];if(!_0x2657fd[_0x34e2('0x37')][_0x34e2('0x3c')]('nolimit')){_0x443de9[_0x34e2('0x22')]=qs[_0x34e2('0x22')](_0x2657fd[_0x34e2('0x37')][_0x34e2('0x22')]);_0x443de9[_0x34e2('0x20')]=qs[_0x34e2('0x20')](_0x2657fd[_0x34e2('0x37')]['offset']);}return _0x5ef76b[_0x34e2('0x4f')](_0x443de9);}})['then'](function(_0x4721a2){if(_0x4721a2){return _0x4721a2?{'count':_0x15df17,'rows':_0x4721a2}:null;}})[_0x34e2('0x2a')](respondWithResult(_0x35d6ee,null))['catch'](handleError(_0x35d6ee,null));};exports[_0x34e2('0x54')]=function(_0x527979,_0x36c3ab,_0x14b2f1){if(_0x527979['body']['id']){delete _0x527979['body']['id'];}return db[_0x34e2('0x44')]['findOne']({'where':{'id':_0x527979[_0x34e2('0x49')]['id']}})[_0x34e2('0x2a')](handleEntityNotFound(_0x36c3ab,null))['then'](function(_0x336d6d){if(_0x336d6d){_0x527979['body'][_0x34e2('0x55')]=_0x336d6d['id'];_0x527979[_0x34e2('0x4e')][_0x34e2('0x56')]=integrations[_0x34e2('0x57')](_0x527979[_0x34e2('0x4e')]['channel'],_0x527979[_0x34e2('0x4e')]['type']);_0x527979[_0x34e2('0x4e')][_0x34e2('0x58')]=integrations[_0x34e2('0x59')](_0x527979['body'][_0x34e2('0x5a')],_0x527979[_0x34e2('0x4e')][_0x34e2('0x34')]);return db[_0x34e2('0x51')][_0x34e2('0x4d')](_0x527979['body'],{'include':[{'model':db[_0x34e2('0x5b')],'as':_0x34e2('0x56')},{'model':db['FreshsalesField'],'as':_0x34e2('0x58')}]});}return null;})[_0x34e2('0x2a')](respondWithResult(_0x36c3ab,null))[_0x34e2('0x48')](handleError(_0x36c3ab,null));};exports['getFields']=function(_0x24c69e,_0x156f32,_0x54c050){var _0x5df2c7='';var _0x5aa37f='';return db[_0x34e2('0x44')][_0x34e2('0x50')]({'where':{'id':_0x24c69e[_0x34e2('0x49')]['id']},'attributes':['id',_0x34e2('0x5c'),'remoteUri','apiKey']})[_0x34e2('0x2a')](handleEntityNotFound(_0x156f32,null))[_0x34e2('0x2a')](function(_0x586746){if(_0x586746){_0x5aa37f=_0x586746[_0x34e2('0x5c')];_0x5df2c7=_0x586746[_0x34e2('0x5d')];var _0x99381e=_0x586746['remoteUri'][_0x34e2('0x5e')](-0x1);if(_0x99381e==='/'){_0x5df2c7=_0x5df2c7[_0x34e2('0x5f')](0x0,_0x5df2c7[_0x34e2('0x60')](_0x99381e));}return rp({'method':_0x34e2('0x61'),'uri':util[_0x34e2('0x62')]('%s%s',_0x5df2c7,_0x34e2('0x63')),'headers':{'Authorization':_0x34e2('0x64')+_0x586746[_0x34e2('0x65')]},'json':!![]});}})[_0x34e2('0x2a')](function(_0x50393e){if(_0x50393e){var _0xe14338=_0x50393e[_0x34e2('0x66')];var _0x5bf71d=![];var _0x38bd45=null;for(_0x38bd45=0x0;_0x38bd45<_0xe14338[_0x34e2('0x4b')];_0x38bd45++){if(_0xe14338[_0x38bd45][_0x34e2('0x67')]===_0x5aa37f){_0x5bf71d=!![];}}if(_0x5bf71d){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x34e2('0x68')});}}})[_0x34e2('0x2a')](respondWithResult(_0x156f32,null))[_0x34e2('0x48')](function(_0x12386a){var _0xcc35a4=_0x24c69e['query'][_0x34e2('0x69')]?0x1f4:_0x12386a[_0x34e2('0x6a')]||0x1f4;logger[_0x34e2('0x2d')](_0x34e2('0x6b'),_0x34e2('0x6c'),_0xcc35a4,JSON[_0x34e2('0x6d')](_0x12386a));delete _0x12386a[_0x34e2('0x2f')];if(_0xcc35a4===0x191){_0xcc35a4=0x190;}_0x156f32[_0x34e2('0x1d')](_0xcc35a4)['send'](_0x24c69e[_0x34e2('0x37')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x12386a['statusCode']}:_0x12386a);});}; \ No newline at end of file +var _0xb5a7=['undefined','count','limit','Content-Range','json','save','update','then','destroy','end','stack','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','type','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','getConfigurations','findOne','order','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','FreshsalesField','username','remoteUri','slice','lastIndexOf','format','%s%s','Token\x20token=','apiKey','users','email','Requested\x20Resource\x20not\x20Found','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','test','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','offset'];(function(_0x3f6bcf,_0x531e79){var _0x1c5350=function(_0x282fc5){while(--_0x282fc5){_0x3f6bcf['push'](_0x3f6bcf['shift']());}};_0x1c5350(++_0x531e79);}(_0xb5a7,0xaf));var _0x7b5a=function(_0x48ccd8,_0xe98f1e){_0x48ccd8=_0x48ccd8-0x0;var _0x55923f=_0xb5a7[_0x48ccd8];return _0x55923f;};'use strict';var emlformat=require(_0x7b5a('0x0'));var rimraf=require(_0x7b5a('0x1'));var zipdir=require(_0x7b5a('0x2'));var jsonpatch=require(_0x7b5a('0x3'));var rp=require(_0x7b5a('0x4'));var moment=require(_0x7b5a('0x5'));var BPromise=require(_0x7b5a('0x6'));var Mustache=require(_0x7b5a('0x7'));var util=require(_0x7b5a('0x8'));var path=require(_0x7b5a('0x9'));var sox=require(_0x7b5a('0xa'));var csv=require(_0x7b5a('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7b5a('0xc'));var _=require(_0x7b5a('0xd'));var squel=require(_0x7b5a('0xe'));var crypto=require(_0x7b5a('0xf'));var jsforce=require(_0x7b5a('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x7b5a('0xb'));var querystring=require(_0x7b5a('0x11'));var Papa=require('papaparse');var Redis=require(_0x7b5a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7b5a('0x13'));var as=require(_0x7b5a('0x14'));var hardwareService=require(_0x7b5a('0x15'));var logger=require(_0x7b5a('0x16'))(_0x7b5a('0x17'));var utils=require(_0x7b5a('0x18'));var config=require(_0x7b5a('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x7b5a('0x1a'))['db'];var integrations=require(_0x7b5a('0x1b'));function respondWithStatusCode(_0x4446d1,_0x45c3d3){_0x45c3d3=_0x45c3d3||0xcc;return function(_0x479597){if(_0x479597){return _0x4446d1[_0x7b5a('0x1c')](_0x45c3d3);}return _0x4446d1[_0x7b5a('0x1d')](_0x45c3d3)['end']();};}function respondWithResult(_0x31fd4e,_0x2ee705){_0x2ee705=_0x2ee705||0xc8;return function(_0x1a01f7){if(_0x1a01f7){return _0x31fd4e['status'](_0x2ee705)['json'](_0x1a01f7);}};}function respondWithFilteredResult(_0x179dc5,_0x1ed3fa){return function(_0xe6f43){if(_0xe6f43){var _0x279c4b=typeof _0x1ed3fa[_0x7b5a('0x1e')]===_0x7b5a('0x1f')&&typeof _0x1ed3fa['limit']===_0x7b5a('0x1f');var _0xf0b3f6=_0xe6f43[_0x7b5a('0x20')];var _0x397f83=_0x279c4b?0x0:_0x1ed3fa['offset'];var _0x58d986=_0x279c4b?_0xe6f43[_0x7b5a('0x20')]:_0x1ed3fa[_0x7b5a('0x1e')]+_0x1ed3fa[_0x7b5a('0x21')];var _0x70b651;if(_0x58d986>=_0xf0b3f6){_0x58d986=_0xf0b3f6;_0x70b651=0xc8;}else{_0x70b651=0xce;}_0x179dc5[_0x7b5a('0x1d')](_0x70b651);return _0x179dc5['set'](_0x7b5a('0x22'),_0x397f83+'-'+_0x58d986+'/'+_0xf0b3f6)[_0x7b5a('0x23')](_0xe6f43);}return null;};}function patchUpdates(_0x449d16){return function(_0x42e185){try{jsonpatch['apply'](_0x42e185,_0x449d16,!![]);}catch(_0x14b829){return BPromise['reject'](_0x14b829);}return _0x42e185[_0x7b5a('0x24')]();};}function saveUpdates(_0x408760,_0xd04883){return function(_0x2ffcd5){if(_0x2ffcd5){return _0x2ffcd5[_0x7b5a('0x25')](_0x408760)[_0x7b5a('0x26')](function(_0x12e90d){return _0x12e90d;});}return null;};}function removeEntity(_0x2aa8ff,_0x425ee6){return function(_0xf05dbe){if(_0xf05dbe){return _0xf05dbe[_0x7b5a('0x27')]()['then'](function(){_0x2aa8ff[_0x7b5a('0x1d')](0xcc)[_0x7b5a('0x28')]();});}};}function handleEntityNotFound(_0x3287e7,_0x3f3e7c){return function(_0xa52561){if(!_0xa52561){_0x3287e7[_0x7b5a('0x1c')](0x194);}return _0xa52561;};}function handleError(_0x36a345,_0x3d2591){_0x3d2591=_0x3d2591||0x1f4;return function(_0x55cc1e){logger['error'](_0x55cc1e[_0x7b5a('0x29')]);if(_0x55cc1e[_0x7b5a('0x2a')]){delete _0x55cc1e[_0x7b5a('0x2a')];}_0x36a345[_0x7b5a('0x1d')](_0x3d2591)[_0x7b5a('0x2b')](_0x55cc1e);};}exports[_0x7b5a('0x2c')]=function(_0x218cb7,_0x839e85){var _0x4ec52e={},_0x21ea4e={},_0x3a3710={'count':0x0,'rows':[]};var _0x3cde98=_[_0x7b5a('0x2d')](db[_0x7b5a('0x2e')][_0x7b5a('0x2f')],function(_0x47cda8){return{'name':_0x47cda8[_0x7b5a('0x30')],'type':_0x47cda8[_0x7b5a('0x31')]['key']};});_0x21ea4e['model']=_[_0x7b5a('0x2d')](_0x3cde98,'name');_0x21ea4e['query']=_[_0x7b5a('0x32')](_0x218cb7['query']);_0x21ea4e[_0x7b5a('0x33')]=_[_0x7b5a('0x34')](_0x21ea4e[_0x7b5a('0x35')],_0x21ea4e[_0x7b5a('0x36')]);_0x4ec52e[_0x7b5a('0x37')]=_['intersection'](_0x21ea4e[_0x7b5a('0x35')],qs[_0x7b5a('0x38')](_0x218cb7['query'][_0x7b5a('0x38')]));_0x4ec52e[_0x7b5a('0x37')]=_0x4ec52e[_0x7b5a('0x37')][_0x7b5a('0x39')]?_0x4ec52e[_0x7b5a('0x37')]:_0x21ea4e[_0x7b5a('0x35')];if(!_0x218cb7[_0x7b5a('0x36')][_0x7b5a('0x3a')](_0x7b5a('0x3b'))){_0x4ec52e[_0x7b5a('0x21')]=qs[_0x7b5a('0x21')](_0x218cb7['query'][_0x7b5a('0x21')]);_0x4ec52e[_0x7b5a('0x1e')]=qs[_0x7b5a('0x1e')](_0x218cb7[_0x7b5a('0x36')][_0x7b5a('0x1e')]);}_0x4ec52e['order']=qs[_0x7b5a('0x3c')](_0x218cb7[_0x7b5a('0x36')][_0x7b5a('0x3c')]);_0x4ec52e['where']=qs['filters'](_['pick'](_0x218cb7[_0x7b5a('0x36')],_0x21ea4e[_0x7b5a('0x33')]),_0x3cde98);if(_0x218cb7[_0x7b5a('0x36')][_0x7b5a('0x3d')]){_0x4ec52e[_0x7b5a('0x3e')]=_['merge'](_0x4ec52e['where'],{'$or':_[_0x7b5a('0x2d')](_0x3cde98,function(_0x35e6c6){if(_0x35e6c6[_0x7b5a('0x31')]!==_0x7b5a('0x3f')){var _0xe30881={};_0xe30881[_0x35e6c6[_0x7b5a('0x2a')]]={'$like':'%'+_0x218cb7['query'][_0x7b5a('0x3d')]+'%'};return _0xe30881;}})});}_0x4ec52e=_[_0x7b5a('0x40')]({},_0x4ec52e,_0x218cb7[_0x7b5a('0x41')]);var _0x2204cb={'where':_0x4ec52e['where']};return db[_0x7b5a('0x2e')][_0x7b5a('0x20')](_0x2204cb)[_0x7b5a('0x26')](function(_0x38b278){_0x3a3710[_0x7b5a('0x20')]=_0x38b278;if(_0x218cb7[_0x7b5a('0x36')]['includeAll']){_0x4ec52e[_0x7b5a('0x42')]=[{'all':!![]}];}return db[_0x7b5a('0x2e')][_0x7b5a('0x43')](_0x4ec52e);})[_0x7b5a('0x26')](function(_0x1eaa72){_0x3a3710[_0x7b5a('0x44')]=_0x1eaa72;return _0x3a3710;})[_0x7b5a('0x26')](respondWithFilteredResult(_0x839e85,_0x4ec52e))[_0x7b5a('0x45')](handleError(_0x839e85,null));};exports[_0x7b5a('0x46')]=function(_0x1025ce,_0x463646){var _0x3e364b={'raw':![],'where':{'id':_0x1025ce[_0x7b5a('0x47')]['id']}},_0x3fa03e={};_0x3fa03e['model']=_[_0x7b5a('0x32')](db['FreshsalesAccount'][_0x7b5a('0x2f')]);_0x3fa03e['query']=_[_0x7b5a('0x32')](_0x1025ce[_0x7b5a('0x36')]);_0x3fa03e[_0x7b5a('0x33')]=_[_0x7b5a('0x34')](_0x3fa03e['model'],_0x3fa03e[_0x7b5a('0x36')]);_0x3e364b[_0x7b5a('0x37')]=_[_0x7b5a('0x34')](_0x3fa03e[_0x7b5a('0x35')],qs[_0x7b5a('0x38')](_0x1025ce[_0x7b5a('0x36')][_0x7b5a('0x38')]));_0x3e364b[_0x7b5a('0x37')]=_0x3e364b[_0x7b5a('0x37')][_0x7b5a('0x39')]?_0x3e364b[_0x7b5a('0x37')]:_0x3fa03e[_0x7b5a('0x35')];if(_0x1025ce['query'][_0x7b5a('0x48')]){_0x3e364b[_0x7b5a('0x42')]=[{'all':!![]}];}_0x3e364b=_[_0x7b5a('0x40')]({},_0x3e364b,_0x1025ce[_0x7b5a('0x41')]);return db['FreshsalesAccount'][_0x7b5a('0x49')](_0x3e364b)[_0x7b5a('0x26')](handleEntityNotFound(_0x463646,null))['then'](respondWithResult(_0x463646,null))[_0x7b5a('0x45')](handleError(_0x463646,null));};exports[_0x7b5a('0x4a')]=function(_0x1bae9c,_0x431b85){return db[_0x7b5a('0x2e')][_0x7b5a('0x4a')](_0x1bae9c[_0x7b5a('0x4b')],{})['then'](respondWithResult(_0x431b85,0xc9))[_0x7b5a('0x45')](handleError(_0x431b85,null));};exports[_0x7b5a('0x25')]=function(_0x3adf99,_0x3b9c7c){if(_0x3adf99[_0x7b5a('0x4b')]['id']){delete _0x3adf99[_0x7b5a('0x4b')]['id'];}return db[_0x7b5a('0x2e')]['find']({'where':{'id':_0x3adf99[_0x7b5a('0x47')]['id']}})[_0x7b5a('0x26')](handleEntityNotFound(_0x3b9c7c,null))['then'](saveUpdates(_0x3adf99[_0x7b5a('0x4b')],null))['then'](respondWithResult(_0x3b9c7c,null))[_0x7b5a('0x45')](handleError(_0x3b9c7c,null));};exports[_0x7b5a('0x27')]=function(_0x4abc7c,_0x163c21){return db[_0x7b5a('0x2e')][_0x7b5a('0x49')]({'where':{'id':_0x4abc7c['params']['id']}})['then'](handleEntityNotFound(_0x163c21,null))[_0x7b5a('0x26')](removeEntity(_0x163c21,null))[_0x7b5a('0x45')](handleError(_0x163c21,null));};exports[_0x7b5a('0x4c')]=function(_0x2ecd02,_0x31e713,_0x596b95){var _0x4a31ff={};var _0x1eba45={};var _0x578d89;var _0x14479b;return db[_0x7b5a('0x2e')][_0x7b5a('0x4d')]({'where':{'id':_0x2ecd02['params']['id']}})[_0x7b5a('0x26')](handleEntityNotFound(_0x31e713,null))[_0x7b5a('0x26')](function(_0x4bc115){if(_0x4bc115){_0x578d89=_0x4bc115;_0x1eba45[_0x7b5a('0x35')]=_[_0x7b5a('0x32')](db['FreshsalesConfiguration'][_0x7b5a('0x2f')]);_0x1eba45['query']=_[_0x7b5a('0x32')](_0x2ecd02[_0x7b5a('0x36')]);_0x1eba45[_0x7b5a('0x33')]=_[_0x7b5a('0x34')](_0x1eba45[_0x7b5a('0x35')],_0x1eba45[_0x7b5a('0x36')]);_0x4a31ff[_0x7b5a('0x37')]=_['intersection'](_0x1eba45['model'],qs['fields'](_0x2ecd02[_0x7b5a('0x36')][_0x7b5a('0x38')]));_0x4a31ff['attributes']=_0x4a31ff[_0x7b5a('0x37')][_0x7b5a('0x39')]?_0x4a31ff[_0x7b5a('0x37')]:_0x1eba45[_0x7b5a('0x35')];_0x4a31ff[_0x7b5a('0x4e')]=qs[_0x7b5a('0x3c')](_0x2ecd02['query'][_0x7b5a('0x3c')]);_0x4a31ff[_0x7b5a('0x3e')]=qs[_0x7b5a('0x33')](_[_0x7b5a('0x4f')](_0x2ecd02[_0x7b5a('0x36')],_0x1eba45[_0x7b5a('0x33')]));if(_0x2ecd02[_0x7b5a('0x36')][_0x7b5a('0x3d')]){_0x4a31ff['where']=_['merge'](_0x4a31ff[_0x7b5a('0x3e')],{'$or':_[_0x7b5a('0x2d')](_0x4a31ff[_0x7b5a('0x37')],function(_0x1ec921){var _0x2669e4={};_0x2669e4[_0x1ec921]={'$like':'%'+_0x2ecd02['query'][_0x7b5a('0x3d')]+'%'};return _0x2669e4;})});}_0x4a31ff=_[_0x7b5a('0x40')]({},_0x4a31ff,_0x2ecd02[_0x7b5a('0x41')]);return _0x578d89[_0x7b5a('0x4c')](_0x4a31ff);}})[_0x7b5a('0x26')](function(_0x542583){if(_0x542583){_0x14479b=_0x542583[_0x7b5a('0x39')];if(!_0x2ecd02[_0x7b5a('0x36')][_0x7b5a('0x3a')]('nolimit')){_0x4a31ff[_0x7b5a('0x21')]=qs[_0x7b5a('0x21')](_0x2ecd02[_0x7b5a('0x36')]['limit']);_0x4a31ff[_0x7b5a('0x1e')]=qs[_0x7b5a('0x1e')](_0x2ecd02[_0x7b5a('0x36')][_0x7b5a('0x1e')]);}return _0x578d89[_0x7b5a('0x4c')](_0x4a31ff);}})[_0x7b5a('0x26')](function(_0x258ca7){if(_0x258ca7){return _0x258ca7?{'count':_0x14479b,'rows':_0x258ca7}:null;}})[_0x7b5a('0x26')](respondWithResult(_0x31e713,null))[_0x7b5a('0x45')](handleError(_0x31e713,null));};exports[_0x7b5a('0x50')]=function(_0x49e1bb,_0x50c08e,_0x51f089){if(_0x49e1bb[_0x7b5a('0x4b')]['id']){delete _0x49e1bb[_0x7b5a('0x4b')]['id'];}return db[_0x7b5a('0x2e')]['findOne']({'where':{'id':_0x49e1bb[_0x7b5a('0x47')]['id']}})[_0x7b5a('0x26')](handleEntityNotFound(_0x50c08e,null))[_0x7b5a('0x26')](function(_0x1f5a16){if(_0x1f5a16){_0x49e1bb[_0x7b5a('0x4b')][_0x7b5a('0x51')]=_0x1f5a16['id'];_0x49e1bb[_0x7b5a('0x4b')][_0x7b5a('0x52')]=integrations[_0x7b5a('0x53')](_0x49e1bb[_0x7b5a('0x4b')][_0x7b5a('0x54')],_0x49e1bb[_0x7b5a('0x4b')][_0x7b5a('0x31')]);_0x49e1bb['body'][_0x7b5a('0x55')]=integrations['getDescriptions'](_0x49e1bb[_0x7b5a('0x4b')][_0x7b5a('0x54')],_0x49e1bb[_0x7b5a('0x4b')][_0x7b5a('0x31')]);return db['FreshsalesConfiguration'][_0x7b5a('0x4a')](_0x49e1bb['body'],{'include':[{'model':db[_0x7b5a('0x56')],'as':_0x7b5a('0x52')},{'model':db[_0x7b5a('0x56')],'as':_0x7b5a('0x55')}]});}return null;})[_0x7b5a('0x26')](respondWithResult(_0x50c08e,null))[_0x7b5a('0x45')](handleError(_0x50c08e,null));};exports['getFields']=function(_0x44e6d5,_0x2dac80,_0x76b727){var _0x304e26='';var _0x345a2c='';return db['FreshsalesAccount'][_0x7b5a('0x4d')]({'where':{'id':_0x44e6d5[_0x7b5a('0x47')]['id']},'attributes':['id',_0x7b5a('0x57'),_0x7b5a('0x58'),'apiKey']})[_0x7b5a('0x26')](handleEntityNotFound(_0x2dac80,null))['then'](function(_0x174a54){if(_0x174a54){_0x345a2c=_0x174a54[_0x7b5a('0x57')];_0x304e26=_0x174a54[_0x7b5a('0x58')];var _0x5a0f75=_0x174a54[_0x7b5a('0x58')][_0x7b5a('0x59')](-0x1);if(_0x5a0f75==='/'){_0x304e26=_0x304e26['substring'](0x0,_0x304e26[_0x7b5a('0x5a')](_0x5a0f75));}return rp({'method':'GET','uri':util[_0x7b5a('0x5b')](_0x7b5a('0x5c'),_0x304e26,'/api/selector/owners'),'headers':{'Authorization':_0x7b5a('0x5d')+_0x174a54[_0x7b5a('0x5e')]},'json':!![]});}})[_0x7b5a('0x26')](function(_0x3bfb18){if(_0x3bfb18){var _0x982b5b=_0x3bfb18[_0x7b5a('0x5f')];var _0x1a7c2c=![];var _0x3f7813=null;for(_0x3f7813=0x0;_0x3f7813<_0x982b5b[_0x7b5a('0x39')];_0x3f7813++){if(_0x982b5b[_0x3f7813][_0x7b5a('0x60')]===_0x345a2c){_0x1a7c2c=!![];}}if(_0x1a7c2c){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x7b5a('0x61')});}}})[_0x7b5a('0x26')](respondWithResult(_0x2dac80,null))[_0x7b5a('0x45')](function(_0x1cfa0e){var _0x5f5618=_0x44e6d5['query']['test']?0x1f4:_0x1cfa0e[_0x7b5a('0x62')]||0x1f4;logger['error'](_0x7b5a('0x63'),_0x7b5a('0x64'),_0x5f5618,JSON[_0x7b5a('0x65')](_0x1cfa0e));delete _0x1cfa0e[_0x7b5a('0x2a')];if(_0x5f5618===0x191){_0x5f5618=0x190;}_0x2dac80['status'](_0x5f5618)[_0x7b5a('0x2b')](_0x44e6d5[_0x7b5a('0x36')][_0x7b5a('0x66')]?{'message':'Wrong\x20credentials','statusCode':_0x1cfa0e[_0x7b5a('0x62')]}:_0x1cfa0e);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index e258cb5..aa821c2 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 _0x0adf=['exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes'];(function(_0x29deb3,_0x3b83f2){var _0x11ec3f=function(_0x27da6c){while(--_0x27da6c){_0x29deb3['push'](_0x29deb3['shift']());}};_0x11ec3f(++_0x3b83f2);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x40e645,_0x2a99e2){_0x40e645=_0x40e645-0x0;var _0x145b2c=_0x0adf[_0x40e645];return _0x145b2c;};'use strict';var _=require(_0xf0ad('0x0'));var util=require(_0xf0ad('0x1'));var logger=require(_0xf0ad('0x2'))('api');var moment=require(_0xf0ad('0x3'));var BPromise=require(_0xf0ad('0x4'));var rp=require(_0xf0ad('0x5'));var fs=require('fs');var path=require(_0xf0ad('0x6'));var rimraf=require(_0xf0ad('0x7'));var config=require(_0xf0ad('0x8'));var attributes=require(_0xf0ad('0x9'));var integrations=require('../../components/integrations/configuration');module[_0xf0ad('0xa')]=function(_0x53221f,_0x2eca0e){return _0x53221f[_0xf0ad('0xb')](_0xf0ad('0xc'),attributes,{'tableName':_0xf0ad('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1a37=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','define','FreshsalesAccount','lodash','util'];(function(_0x28be72,_0x2b83af){var _0x46c5da=function(_0x312911){while(--_0x312911){_0x28be72['push'](_0x28be72['shift']());}};_0x46c5da(++_0x2b83af);}(_0x1a37,0xb4));var _0x71a3=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0x1a37[_0x3de8a4];return _0x4635cf;};'use strict';var _=require(_0x71a3('0x0'));var util=require(_0x71a3('0x1'));var logger=require(_0x71a3('0x2'))(_0x71a3('0x3'));var moment=require(_0x71a3('0x4'));var BPromise=require(_0x71a3('0x5'));var rp=require(_0x71a3('0x6'));var fs=require('fs');var path=require(_0x71a3('0x7'));var rimraf=require(_0x71a3('0x8'));var config=require(_0x71a3('0x9'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x71a3('0xa'));module['exports']=function(_0xd09f7,_0x45050a){return _0xd09f7[_0x71a3('0xb')](_0x71a3('0xc'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index 5930729..150ca60 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 _0x4c60=['ShowFreshsalesAccount','lodash','util','moment','bluebird','ioredis','../../config/environment','jayson/promise','client','http','request','then','debug','request\x20sent','stringify','error','code','FreshsalesAccount,\x20%s,\x20%s','message','info','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','attributes','limit','map','include','model','find','raw'];(function(_0x792e6b,_0x1949c4){var _0x1627c2=function(_0xa89bb1){while(--_0xa89bb1){_0x792e6b['push'](_0x792e6b['shift']());}};_0x1627c2(++_0x1949c4);}(_0x4c60,0xc1));var _0x04c6=function(_0x3430aa,_0x1698fb){_0x3430aa=_0x3430aa-0x0;var _0x17e717=_0x4c60[_0x3430aa];return _0x17e717;};'use strict';var _=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var moment=require(_0x04c6('0x2'));var BPromise=require(_0x04c6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x04c6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x04c6('0x5'));var jayson=require(_0x04c6('0x6'));var client=jayson[_0x04c6('0x7')][_0x04c6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2b9041,_0x39be2d,_0x8f9b13){return new BPromise(function(_0x530a48,_0x2a4b51){return client[_0x04c6('0x9')](_0x2b9041,_0x8f9b13)[_0x04c6('0xa')](function(_0x30b901){logger['info']('FreshsalesAccount,\x20%s,\x20%s',_0x39be2d,'request\x20sent');logger[_0x04c6('0xb')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x39be2d,_0x04c6('0xc'),JSON[_0x04c6('0xd')](_0x30b901));if(_0x30b901['error']){if(_0x30b901[_0x04c6('0xe')][_0x04c6('0xf')]===0x1f4){logger[_0x04c6('0xe')](_0x04c6('0x10'),_0x39be2d,_0x30b901['error'][_0x04c6('0x11')]);return _0x2a4b51(_0x30b901[_0x04c6('0xe')][_0x04c6('0x11')]);}logger['error'](_0x04c6('0x10'),_0x39be2d,_0x30b901[_0x04c6('0xe')][_0x04c6('0x11')]);return _0x530a48(_0x30b901[_0x04c6('0xe')][_0x04c6('0x11')]);}else{logger[_0x04c6('0x12')](_0x04c6('0x10'),_0x39be2d,_0x04c6('0xc'));_0x530a48(_0x30b901['result'][_0x04c6('0x11')]);}})[_0x04c6('0x13')](function(_0x382e58){logger[_0x04c6('0xe')](_0x04c6('0x10'),_0x39be2d,_0x382e58);_0x2a4b51(_0x382e58);});});}exports[_0x04c6('0x14')]=function(_0x21674a){var _0x423ea9=this;return new Promise(function(_0x47f400,_0x142065){return db[_0x04c6('0x15')][_0x04c6('0x16')]({'raw':_0x21674a['options']?_0x21674a['options']['raw']===undefined?!![]:![]:!![],'where':_0x21674a[_0x04c6('0x17')]?_0x21674a[_0x04c6('0x17')]['where']||null:null,'attributes':_0x21674a['options']?_0x21674a[_0x04c6('0x17')][_0x04c6('0x18')]||null:null,'limit':_0x21674a[_0x04c6('0x17')]?_0x21674a['options'][_0x04c6('0x19')]||null:null,'include':_0x21674a[_0x04c6('0x17')]?_0x21674a[_0x04c6('0x17')]['include']?_[_0x04c6('0x1a')](_0x21674a[_0x04c6('0x17')]['include'],function(_0x54a8b0){return{'model':db[_0x54a8b0['model']],'as':_0x54a8b0['as'],'attributes':_0x54a8b0[_0x04c6('0x18')],'include':_0x54a8b0[_0x04c6('0x1b')]?_[_0x04c6('0x1a')](_0x54a8b0[_0x04c6('0x1b')],function(_0x3e1328){return{'model':db[_0x3e1328['model']],'as':_0x3e1328['as'],'attributes':_0x3e1328['attributes'],'include':_0x3e1328[_0x04c6('0x1b')]?_[_0x04c6('0x1a')](_0x3e1328[_0x04c6('0x1b')],function(_0x3233d7){return{'model':db[_0x3233d7[_0x04c6('0x1c')]],'as':_0x3233d7['as'],'attributes':_0x3233d7[_0x04c6('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1d0d3f){logger[_0x04c6('0x12')]('GetFreshsalesAccount',_0x21674a);logger[_0x04c6('0xb')](_0x04c6('0x14'),_0x21674a,JSON['stringify'](_0x1d0d3f));_0x47f400(_0x1d0d3f);})['catch'](function(_0x115d84){logger[_0x04c6('0xe')](_0x04c6('0x14'),_0x115d84[_0x04c6('0x11')],_0x21674a);_0x142065(_0x423ea9[_0x04c6('0xe')](0x1f4,_0x115d84[_0x04c6('0x11')]));});});};exports['ShowFreshsalesAccount']=function(_0x5d8c88){var _0x4fd842=this;return new Promise(function(_0x375a03,_0x5241b5){return db[_0x04c6('0x15')][_0x04c6('0x1d')]({'raw':_0x5d8c88['options']?_0x5d8c88[_0x04c6('0x17')][_0x04c6('0x1e')]===undefined?!![]:![]:!![],'where':_0x5d8c88[_0x04c6('0x17')]?_0x5d8c88[_0x04c6('0x17')]['where']||null:null,'attributes':_0x5d8c88[_0x04c6('0x17')]?_0x5d8c88[_0x04c6('0x17')][_0x04c6('0x18')]||null:null,'include':_0x5d8c88[_0x04c6('0x17')]?_0x5d8c88[_0x04c6('0x17')][_0x04c6('0x1b')]?_[_0x04c6('0x1a')](_0x5d8c88[_0x04c6('0x17')][_0x04c6('0x1b')],function(_0xca0b8f){return{'model':db[_0xca0b8f[_0x04c6('0x1c')]],'as':_0xca0b8f['as'],'attributes':_0xca0b8f[_0x04c6('0x18')],'include':_0xca0b8f[_0x04c6('0x1b')]?_[_0x04c6('0x1a')](_0xca0b8f[_0x04c6('0x1b')],function(_0x5bb584){return{'model':db[_0x5bb584[_0x04c6('0x1c')]],'as':_0x5bb584['as'],'attributes':_0x5bb584[_0x04c6('0x18')],'include':_0x5bb584[_0x04c6('0x1b')]?_[_0x04c6('0x1a')](_0x5bb584['include'],function(_0x181736){return{'model':db[_0x181736[_0x04c6('0x1c')]],'as':_0x181736['as'],'attributes':_0x181736['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4aac49){logger[_0x04c6('0x12')](_0x04c6('0x1f'),_0x5d8c88);logger['debug'](_0x04c6('0x1f'),_0x5d8c88,JSON['stringify'](_0x4aac49));_0x375a03(_0x4aac49);})[_0x04c6('0x13')](function(_0x1373ca){logger[_0x04c6('0xe')](_0x04c6('0x1f'),_0x1373ca['message'],_0x5d8c88);_0x5241b5(_0x4fd842['error'](0x1f4,_0x1373ca[_0x04c6('0x11')]));});});}; \ No newline at end of file +var _0x0598=['map','model','then','ShowFreshsalesAccount','find','where','lodash','util','bluebird','../../mysqldb','../../config/utils','jayson/promise','client','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','attributes','limit','include'];(function(_0x35e7b3,_0x19d486){var _0x5d5fe7=function(_0x5a4ad3){while(--_0x5a4ad3){_0x35e7b3['push'](_0x35e7b3['shift']());}};_0x5d5fe7(++_0x19d486);}(_0x0598,0x92));var _0x8059=function(_0x143a8d,_0x1822c6){_0x143a8d=_0x143a8d-0x0;var _0x567986=_0x0598[_0x143a8d];return _0x567986;};'use strict';var _=require(_0x8059('0x0'));var util=require(_0x8059('0x1'));var moment=require('moment');var BPromise=require(_0x8059('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8059('0x3'))['db'];var utils=require(_0x8059('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x8059('0x5'));var client=jayson[_0x8059('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5996d7,_0x248273,_0x347f1b){return new BPromise(function(_0x4610d2,_0x116946){return client['request'](_0x5996d7,_0x347f1b)['then'](function(_0x89dda1){logger[_0x8059('0x7')](_0x8059('0x8'),_0x248273,_0x8059('0x9'));logger[_0x8059('0xa')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x248273,'request\x20sent',JSON[_0x8059('0xb')](_0x89dda1));if(_0x89dda1[_0x8059('0xc')]){if(_0x89dda1['error']['code']===0x1f4){logger['error'](_0x8059('0x8'),_0x248273,_0x89dda1[_0x8059('0xc')][_0x8059('0xd')]);return _0x116946(_0x89dda1[_0x8059('0xc')][_0x8059('0xd')]);}logger['error'](_0x8059('0x8'),_0x248273,_0x89dda1['error'][_0x8059('0xd')]);return _0x4610d2(_0x89dda1['error'][_0x8059('0xd')]);}else{logger[_0x8059('0x7')](_0x8059('0x8'),_0x248273,'request\x20sent');_0x4610d2(_0x89dda1['result']['message']);}})[_0x8059('0xe')](function(_0x239195){logger[_0x8059('0xc')](_0x8059('0x8'),_0x248273,_0x239195);_0x116946(_0x239195);});});}exports[_0x8059('0xf')]=function(_0x4b6d55){var _0x10ad98=this;return new Promise(function(_0x2bb670,_0x37e926){return db[_0x8059('0x10')]['findAll']({'raw':_0x4b6d55[_0x8059('0x11')]?_0x4b6d55['options'][_0x8059('0x12')]===undefined?!![]:![]:!![],'where':_0x4b6d55['options']?_0x4b6d55[_0x8059('0x11')]['where']||null:null,'attributes':_0x4b6d55[_0x8059('0x11')]?_0x4b6d55[_0x8059('0x11')][_0x8059('0x13')]||null:null,'limit':_0x4b6d55['options']?_0x4b6d55['options'][_0x8059('0x14')]||null:null,'include':_0x4b6d55[_0x8059('0x11')]?_0x4b6d55[_0x8059('0x11')][_0x8059('0x15')]?_['map'](_0x4b6d55[_0x8059('0x11')][_0x8059('0x15')],function(_0x3da080){return{'model':db[_0x3da080['model']],'as':_0x3da080['as'],'attributes':_0x3da080[_0x8059('0x13')],'include':_0x3da080[_0x8059('0x15')]?_[_0x8059('0x16')](_0x3da080[_0x8059('0x15')],function(_0x59d3a6){return{'model':db[_0x59d3a6[_0x8059('0x17')]],'as':_0x59d3a6['as'],'attributes':_0x59d3a6[_0x8059('0x13')],'include':_0x59d3a6[_0x8059('0x15')]?_[_0x8059('0x16')](_0x59d3a6[_0x8059('0x15')],function(_0x54b88b){return{'model':db[_0x54b88b[_0x8059('0x17')]],'as':_0x54b88b['as'],'attributes':_0x54b88b[_0x8059('0x13')]};}):[]};}):[]};}):[]:[]})[_0x8059('0x18')](function(_0x4a294f){logger['info']('GetFreshsalesAccount',_0x4b6d55);logger[_0x8059('0xa')](_0x8059('0xf'),_0x4b6d55,JSON[_0x8059('0xb')](_0x4a294f));_0x2bb670(_0x4a294f);})[_0x8059('0xe')](function(_0x59abe9){logger[_0x8059('0xc')]('GetFreshsalesAccount',_0x59abe9[_0x8059('0xd')],_0x4b6d55);_0x37e926(_0x10ad98[_0x8059('0xc')](0x1f4,_0x59abe9['message']));});});};exports[_0x8059('0x19')]=function(_0x1aead2){var _0x30aac2=this;return new Promise(function(_0x260ba8,_0x2799b7){return db[_0x8059('0x10')][_0x8059('0x1a')]({'raw':_0x1aead2[_0x8059('0x11')]?_0x1aead2['options'][_0x8059('0x12')]===undefined?!![]:![]:!![],'where':_0x1aead2[_0x8059('0x11')]?_0x1aead2[_0x8059('0x11')][_0x8059('0x1b')]||null:null,'attributes':_0x1aead2[_0x8059('0x11')]?_0x1aead2['options'][_0x8059('0x13')]||null:null,'include':_0x1aead2[_0x8059('0x11')]?_0x1aead2[_0x8059('0x11')][_0x8059('0x15')]?_[_0x8059('0x16')](_0x1aead2[_0x8059('0x11')][_0x8059('0x15')],function(_0x175d57){return{'model':db[_0x175d57[_0x8059('0x17')]],'as':_0x175d57['as'],'attributes':_0x175d57[_0x8059('0x13')],'include':_0x175d57['include']?_[_0x8059('0x16')](_0x175d57['include'],function(_0x24194d){return{'model':db[_0x24194d['model']],'as':_0x24194d['as'],'attributes':_0x24194d['attributes'],'include':_0x24194d[_0x8059('0x15')]?_['map'](_0x24194d[_0x8059('0x15')],function(_0x50c745){return{'model':db[_0x50c745[_0x8059('0x17')]],'as':_0x50c745['as'],'attributes':_0x50c745['attributes']};}):[]};}):[]};}):[]:[]})[_0x8059('0x18')](function(_0x5c4aa0){logger['info'](_0x8059('0x19'),_0x1aead2);logger[_0x8059('0xa')](_0x8059('0x19'),_0x1aead2,JSON['stringify'](_0x5c4aa0));_0x260ba8(_0x5c4aa0);})[_0x8059('0xe')](function(_0x4927c9){logger[_0x8059('0xc')]('ShowFreshsalesAccount',_0x4927c9[_0x8059('0xd')],_0x1aead2);_0x2799b7(_0x30aac2[_0x8059('0xc')](0x1f4,_0x4927c9[_0x8059('0xd')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 3afa989..485431f 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 _0x15a8=['index','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','post','put','/:id','update','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated'];(function(_0x19b084,_0x22ebde){var _0x26d61d=function(_0xbaacf){while(--_0xbaacf){_0x19b084['push'](_0x19b084['shift']());}};_0x26d61d(++_0x22ebde);}(_0x15a8,0x174));var _0x815a=function(_0x5d32bd,_0x292424){_0x5d32bd=_0x5d32bd-0x0;var _0x19c49a=_0x15a8[_0x5d32bd];return _0x19c49a;};'use strict';var multer=require(_0x815a('0x0'));var util=require('util');var path=require(_0x815a('0x1'));var timeout=require(_0x815a('0x2'));var express=require(_0x815a('0x3'));var router=express[_0x815a('0x4')]();var fs_extra=require(_0x815a('0x5'));var auth=require(_0x815a('0x6'));var interaction=require(_0x815a('0x7'));var config=require(_0x815a('0x8'));var controller=require(_0x815a('0x9'));router[_0x815a('0xa')]('/',auth[_0x815a('0xb')](),controller[_0x815a('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x815a('0xd')]);router[_0x815a('0xa')](_0x815a('0xe'),auth[_0x815a('0xb')](),controller[_0x815a('0xf')]);router['get'](_0x815a('0x10'),auth[_0x815a('0xb')](),controller[_0x815a('0x11')]);router[_0x815a('0xa')](_0x815a('0x12'),auth[_0x815a('0xb')](),controller['getFields']);router[_0x815a('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0x815a('0x14')](_0x815a('0x15'),auth[_0x815a('0xb')](),controller[_0x815a('0x16')]);router['delete'](_0x815a('0x15'),auth['isAuthenticated'](),controller[_0x815a('0x17')]);module['exports']=router; \ No newline at end of file +var _0xa6b8=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','delete'];(function(_0x5f519b,_0x5b606f){var _0x2461e2=function(_0x510241){while(--_0x510241){_0x5f519b['push'](_0x5f519b['shift']());}};_0x2461e2(++_0x5b606f);}(_0xa6b8,0x134));var _0x8a6b=function(_0xb359ca,_0x5c3e1a){_0xb359ca=_0xb359ca-0x0;var _0x5ba75f=_0xa6b8[_0xb359ca];return _0x5ba75f;};'use strict';var multer=require(_0x8a6b('0x0'));var util=require(_0x8a6b('0x1'));var path=require('path');var timeout=require(_0x8a6b('0x2'));var express=require(_0x8a6b('0x3'));var router=express[_0x8a6b('0x4')]();var fs_extra=require(_0x8a6b('0x5'));var auth=require(_0x8a6b('0x6'));var interaction=require(_0x8a6b('0x7'));var config=require(_0x8a6b('0x8'));var controller=require(_0x8a6b('0x9'));router[_0x8a6b('0xa')]('/',auth[_0x8a6b('0xb')](),controller[_0x8a6b('0xc')]);router['get'](_0x8a6b('0xd'),auth['isAuthenticated'](),controller[_0x8a6b('0xe')]);router['get'](_0x8a6b('0xf'),auth[_0x8a6b('0xb')](),controller[_0x8a6b('0x10')]);router[_0x8a6b('0xa')](_0x8a6b('0x11'),auth[_0x8a6b('0xb')](),controller[_0x8a6b('0x12')]);router[_0x8a6b('0xa')]('/:id/fields',auth[_0x8a6b('0xb')](),controller['getFields']);router['post']('/',auth[_0x8a6b('0xb')](),controller[_0x8a6b('0x13')]);router[_0x8a6b('0x14')]('/:id',auth[_0x8a6b('0xb')](),controller['update']);router[_0x8a6b('0x15')](_0x8a6b('0xd'),auth[_0x8a6b('0xb')](),controller['destroy']);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 052104d..1026fb3 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 _0x729a=['sequelize','exports','STRING'];(function(_0x3667a4,_0x1ff999){var _0x5c8e56=function(_0xbbbe13){while(--_0xbbbe13){_0x3667a4['push'](_0x3667a4['shift']());}};_0x5c8e56(++_0x1ff999);}(_0x729a,0x126));var _0xa729=function(_0x1bec94,_0x512e04){_0x1bec94=_0x1bec94-0x0;var _0x2a8634=_0x729a[_0x1bec94];return _0x2a8634;};'use strict';var Sequelize=require(_0xa729('0x0'));module[_0xa729('0x1')]={'name':{'type':Sequelize[_0xa729('0x2')]},'description':{'type':Sequelize[_0xa729('0x2')]}}; \ No newline at end of file +var _0xb844=['STRING'];(function(_0x194914,_0x44f87b){var _0x122e0d=function(_0x321dd5){while(--_0x321dd5){_0x194914['push'](_0x194914['shift']());}};_0x122e0d(++_0x44f87b);}(_0xb844,0x136));var _0x4b84=function(_0x5aed19,_0x24d8a7){_0x5aed19=_0x5aed19-0x0;var _0x311ecd=_0xb844[_0x5aed19];return _0x311ecd;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4b84('0x0')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 5fcee72..6757784 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 _0x9a21=['length','hasOwnProperty','sort','where','pick','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','getSubjects','findOne','order','filter','getDescriptions','FreshsalesField','getFields','nolimit','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','name','index','map','FreshsalesConfiguration','fieldName','key','model','keys','query','filters','intersection','attributes','fields'];(function(_0x529296,_0x1a6a23){var _0x1796bf=function(_0x3cae53){while(--_0x3cae53){_0x529296['push'](_0x529296['shift']());}};_0x1796bf(++_0x1a6a23);}(_0x9a21,0x19c));var _0x19a2=function(_0x5430cf,_0x2197e6){_0x5430cf=_0x5430cf-0x0;var _0x25c68a=_0x9a21[_0x5430cf];return _0x25c68a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x19a2('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x19a2('0x1'));var BPromise=require(_0x19a2('0x2'));var Mustache=require(_0x19a2('0x3'));var util=require(_0x19a2('0x4'));var path=require(_0x19a2('0x5'));var sox=require(_0x19a2('0x6'));var csv=require(_0x19a2('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x19a2('0x8'));var _=require(_0x19a2('0x9'));var squel=require(_0x19a2('0xa'));var crypto=require('crypto');var jsforce=require(_0x19a2('0xb'));var deskjs=require(_0x19a2('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x19a2('0xd'));var Redis=require(_0x19a2('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x19a2('0xf'));var hardwareService=require(_0x19a2('0x10'));var logger=require(_0x19a2('0x11'))(_0x19a2('0x12'));var utils=require(_0x19a2('0x13'));var config=require(_0x19a2('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e1f2e,_0xd88523){_0xd88523=_0xd88523||0xcc;return function(_0x3d64c1){if(_0x3d64c1){return _0x2e1f2e[_0x19a2('0x15')](_0xd88523);}return _0x2e1f2e['status'](_0xd88523)[_0x19a2('0x16')]();};}function respondWithResult(_0x575ccf,_0x5507f3){_0x5507f3=_0x5507f3||0xc8;return function(_0x47a514){if(_0x47a514){return _0x575ccf[_0x19a2('0x17')](_0x5507f3)[_0x19a2('0x18')](_0x47a514);}};}function respondWithFilteredResult(_0x11896a,_0xb40928){return function(_0x3b6a94){if(_0x3b6a94){var _0x3c6402=typeof _0xb40928['offset']===_0x19a2('0x19')&&typeof _0xb40928['limit']===_0x19a2('0x19');var _0x1f9ce6=_0x3b6a94[_0x19a2('0x1a')];var _0x55dd61=_0x3c6402?0x0:_0xb40928[_0x19a2('0x1b')];var _0x1366b3=_0x3c6402?_0x3b6a94[_0x19a2('0x1a')]:_0xb40928[_0x19a2('0x1b')]+_0xb40928[_0x19a2('0x1c')];var _0xe0b173;if(_0x1366b3>=_0x1f9ce6){_0x1366b3=_0x1f9ce6;_0xe0b173=0xc8;}else{_0xe0b173=0xce;}_0x11896a['status'](_0xe0b173);return _0x11896a[_0x19a2('0x1d')](_0x19a2('0x1e'),_0x55dd61+'-'+_0x1366b3+'/'+_0x1f9ce6)[_0x19a2('0x18')](_0x3b6a94);}return null;};}function patchUpdates(_0x2ae1f1){return function(_0x42a8a2){try{jsonpatch[_0x19a2('0x1f')](_0x42a8a2,_0x2ae1f1,!![]);}catch(_0x12d802){return BPromise[_0x19a2('0x20')](_0x12d802);}return _0x42a8a2[_0x19a2('0x21')]();};}function saveUpdates(_0x53ba8b,_0x1eb39b){return function(_0x1661ce){if(_0x1661ce){return _0x1661ce[_0x19a2('0x22')](_0x53ba8b)[_0x19a2('0x23')](function(_0x31191f){return _0x31191f;});}return null;};}function removeEntity(_0x2dafa2,_0x1acdab){return function(_0x2383a6){if(_0x2383a6){return _0x2383a6[_0x19a2('0x24')]()[_0x19a2('0x23')](function(){_0x2dafa2[_0x19a2('0x17')](0xcc)[_0x19a2('0x16')]();});}};}function handleEntityNotFound(_0x297040,_0x5a25bb){return function(_0xdbeebb){if(!_0xdbeebb){_0x297040[_0x19a2('0x15')](0x194);}return _0xdbeebb;};}function handleError(_0x4fedd3,_0x4e9cd6){_0x4e9cd6=_0x4e9cd6||0x1f4;return function(_0x378cfb){logger['error'](_0x378cfb['stack']);if(_0x378cfb[_0x19a2('0x25')]){delete _0x378cfb[_0x19a2('0x25')];}_0x4fedd3[_0x19a2('0x17')](_0x4e9cd6)['send'](_0x378cfb);};}exports[_0x19a2('0x26')]=function(_0xaa093f,_0x26b131){var _0x3e942e={},_0x52c618={},_0x1c8ba8={'count':0x0,'rows':[]};var _0x271100=_[_0x19a2('0x27')](db[_0x19a2('0x28')]['rawAttributes'],function(_0xd9be2){return{'name':_0xd9be2[_0x19a2('0x29')],'type':_0xd9be2['type'][_0x19a2('0x2a')]};});_0x52c618[_0x19a2('0x2b')]=_[_0x19a2('0x27')](_0x271100,_0x19a2('0x25'));_0x52c618['query']=_[_0x19a2('0x2c')](_0xaa093f[_0x19a2('0x2d')]);_0x52c618[_0x19a2('0x2e')]=_[_0x19a2('0x2f')](_0x52c618[_0x19a2('0x2b')],_0x52c618[_0x19a2('0x2d')]);_0x3e942e[_0x19a2('0x30')]=_[_0x19a2('0x2f')](_0x52c618[_0x19a2('0x2b')],qs[_0x19a2('0x31')](_0xaa093f['query']['fields']));_0x3e942e['attributes']=_0x3e942e[_0x19a2('0x30')][_0x19a2('0x32')]?_0x3e942e[_0x19a2('0x30')]:_0x52c618['model'];if(!_0xaa093f[_0x19a2('0x2d')][_0x19a2('0x33')]('nolimit')){_0x3e942e['limit']=qs['limit'](_0xaa093f['query'][_0x19a2('0x1c')]);_0x3e942e[_0x19a2('0x1b')]=qs['offset'](_0xaa093f['query']['offset']);}_0x3e942e['order']=qs[_0x19a2('0x34')](_0xaa093f[_0x19a2('0x2d')]['sort']);_0x3e942e[_0x19a2('0x35')]=qs[_0x19a2('0x2e')](_[_0x19a2('0x36')](_0xaa093f[_0x19a2('0x2d')],_0x52c618['filters']),_0x271100);if(_0xaa093f[_0x19a2('0x2d')]['filter']){_0x3e942e[_0x19a2('0x35')]=_[_0x19a2('0x37')](_0x3e942e['where'],{'$or':_[_0x19a2('0x27')](_0x271100,function(_0x5c0dd1){if(_0x5c0dd1[_0x19a2('0x38')]!==_0x19a2('0x39')){var _0x2e2f78={};_0x2e2f78[_0x5c0dd1[_0x19a2('0x25')]]={'$like':'%'+_0xaa093f[_0x19a2('0x2d')]['filter']+'%'};return _0x2e2f78;}})});}_0x3e942e=_[_0x19a2('0x37')]({},_0x3e942e,_0xaa093f[_0x19a2('0x3a')]);var _0x51a494={'where':_0x3e942e['where']};return db[_0x19a2('0x28')][_0x19a2('0x1a')](_0x51a494)[_0x19a2('0x23')](function(_0x576ba4){_0x1c8ba8[_0x19a2('0x1a')]=_0x576ba4;if(_0xaa093f[_0x19a2('0x2d')][_0x19a2('0x3b')]){_0x3e942e[_0x19a2('0x3c')]=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0x19a2('0x3d')](_0x3e942e);})['then'](function(_0x390cb1){_0x1c8ba8['rows']=_0x390cb1;return _0x1c8ba8;})[_0x19a2('0x23')](respondWithFilteredResult(_0x26b131,_0x3e942e))[_0x19a2('0x3e')](handleError(_0x26b131,null));};exports[_0x19a2('0x3f')]=function(_0x34b7f6,_0x3f6f88){var _0x17e326={'raw':![],'where':{'id':_0x34b7f6[_0x19a2('0x40')]['id']}},_0x5395d1={};_0x5395d1[_0x19a2('0x2b')]=_['keys'](db[_0x19a2('0x28')][_0x19a2('0x41')]);_0x5395d1['query']=_[_0x19a2('0x2c')](_0x34b7f6['query']);_0x5395d1[_0x19a2('0x2e')]=_[_0x19a2('0x2f')](_0x5395d1['model'],_0x5395d1[_0x19a2('0x2d')]);_0x17e326[_0x19a2('0x30')]=_['intersection'](_0x5395d1[_0x19a2('0x2b')],qs['fields'](_0x34b7f6[_0x19a2('0x2d')][_0x19a2('0x31')]));_0x17e326[_0x19a2('0x30')]=_0x17e326[_0x19a2('0x30')][_0x19a2('0x32')]?_0x17e326[_0x19a2('0x30')]:_0x5395d1['model'];if(_0x34b7f6[_0x19a2('0x2d')]['includeAll']){_0x17e326[_0x19a2('0x3c')]=[{'all':!![]}];}_0x17e326=_['merge']({},_0x17e326,_0x34b7f6[_0x19a2('0x3a')]);return db['FreshsalesConfiguration'][_0x19a2('0x42')](_0x17e326)['then'](handleEntityNotFound(_0x3f6f88,null))[_0x19a2('0x23')](respondWithResult(_0x3f6f88,null))[_0x19a2('0x3e')](handleError(_0x3f6f88,null));};exports[_0x19a2('0x43')]=function(_0x4712f5,_0xf30c9c){return db['FreshsalesConfiguration'][_0x19a2('0x43')](_0x4712f5['body'],{})[_0x19a2('0x23')](respondWithResult(_0xf30c9c,0xc9))[_0x19a2('0x3e')](handleError(_0xf30c9c,null));};exports[_0x19a2('0x22')]=function(_0x5b73c1,_0x16029d){if(_0x5b73c1[_0x19a2('0x44')]['id']){delete _0x5b73c1[_0x19a2('0x44')]['id'];}return db[_0x19a2('0x28')][_0x19a2('0x42')]({'where':{'id':_0x5b73c1[_0x19a2('0x40')]['id']}})[_0x19a2('0x23')](handleEntityNotFound(_0x16029d,null))[_0x19a2('0x23')](saveUpdates(_0x5b73c1[_0x19a2('0x44')],null))[_0x19a2('0x23')](respondWithResult(_0x16029d,null))['catch'](handleError(_0x16029d,null));};exports[_0x19a2('0x24')]=function(_0x4e189d,_0x5205dc){return db[_0x19a2('0x28')][_0x19a2('0x42')]({'where':{'id':_0x4e189d[_0x19a2('0x40')]['id']}})[_0x19a2('0x23')](handleEntityNotFound(_0x5205dc,null))[_0x19a2('0x23')](removeEntity(_0x5205dc,null))[_0x19a2('0x3e')](handleError(_0x5205dc,null));};exports[_0x19a2('0x45')]=function(_0x4c4ba2,_0x5add8b,_0x554955){var _0x4020fd={};var _0x4ccd99={};var _0xbc73cf;var _0x123bb3;return db['FreshsalesConfiguration'][_0x19a2('0x46')]({'where':{'id':_0x4c4ba2[_0x19a2('0x40')]['id']}})['then'](handleEntityNotFound(_0x5add8b,null))[_0x19a2('0x23')](function(_0x2f4198){if(_0x2f4198){_0xbc73cf=_0x2f4198;_0x4ccd99[_0x19a2('0x2b')]=_[_0x19a2('0x2c')](db['FreshsalesField'][_0x19a2('0x41')]);_0x4ccd99[_0x19a2('0x2d')]=_['keys'](_0x4c4ba2[_0x19a2('0x2d')]);_0x4ccd99['filters']=_[_0x19a2('0x2f')](_0x4ccd99[_0x19a2('0x2b')],_0x4ccd99[_0x19a2('0x2d')]);_0x4020fd['attributes']=_[_0x19a2('0x2f')](_0x4ccd99[_0x19a2('0x2b')],qs[_0x19a2('0x31')](_0x4c4ba2[_0x19a2('0x2d')][_0x19a2('0x31')]));_0x4020fd[_0x19a2('0x30')]=_0x4020fd['attributes'][_0x19a2('0x32')]?_0x4020fd['attributes']:_0x4ccd99[_0x19a2('0x2b')];_0x4020fd[_0x19a2('0x47')]=qs[_0x19a2('0x34')](_0x4c4ba2[_0x19a2('0x2d')][_0x19a2('0x34')]);_0x4020fd[_0x19a2('0x35')]=qs[_0x19a2('0x2e')](_['pick'](_0x4c4ba2[_0x19a2('0x2d')],_0x4ccd99['filters']));if(_0x4c4ba2[_0x19a2('0x2d')][_0x19a2('0x48')]){_0x4020fd[_0x19a2('0x35')]=_[_0x19a2('0x37')](_0x4020fd['where'],{'$or':_[_0x19a2('0x27')](_0x4020fd[_0x19a2('0x30')],function(_0x1a48d5){var _0x155043={};_0x155043[_0x1a48d5]={'$like':'%'+_0x4c4ba2['query']['filter']+'%'};return _0x155043;})});}_0x4020fd=_[_0x19a2('0x37')]({},_0x4020fd,_0x4c4ba2[_0x19a2('0x3a')]);return _0xbc73cf[_0x19a2('0x45')](_0x4020fd);}})[_0x19a2('0x23')](function(_0x4333b6){if(_0x4333b6){_0x123bb3=_0x4333b6['length'];if(!_0x4c4ba2['query'][_0x19a2('0x33')]('nolimit')){_0x4020fd[_0x19a2('0x1c')]=qs[_0x19a2('0x1c')](_0x4c4ba2[_0x19a2('0x2d')][_0x19a2('0x1c')]);_0x4020fd[_0x19a2('0x1b')]=qs['offset'](_0x4c4ba2[_0x19a2('0x2d')][_0x19a2('0x1b')]);}return _0xbc73cf[_0x19a2('0x45')](_0x4020fd);}})[_0x19a2('0x23')](function(_0x3ee3a3){if(_0x3ee3a3){return _0x3ee3a3?{'count':_0x123bb3,'rows':_0x3ee3a3}:null;}})[_0x19a2('0x23')](respondWithResult(_0x5add8b,null))[_0x19a2('0x3e')](handleError(_0x5add8b,null));};exports[_0x19a2('0x49')]=function(_0x237ce6,_0x37aa58,_0x599243){var _0xe22640={};var _0xc73232={};var _0x1e1c86;var _0x317f11;return db[_0x19a2('0x28')][_0x19a2('0x46')]({'where':{'id':_0x237ce6['params']['id']}})[_0x19a2('0x23')](handleEntityNotFound(_0x37aa58,null))['then'](function(_0x5709ba){if(_0x5709ba){_0x1e1c86=_0x5709ba;_0xc73232['model']=_[_0x19a2('0x2c')](db[_0x19a2('0x4a')][_0x19a2('0x41')]);_0xc73232[_0x19a2('0x2d')]=_[_0x19a2('0x2c')](_0x237ce6[_0x19a2('0x2d')]);_0xc73232[_0x19a2('0x2e')]=_['intersection'](_0xc73232['model'],_0xc73232[_0x19a2('0x2d')]);_0xe22640['attributes']=_[_0x19a2('0x2f')](_0xc73232[_0x19a2('0x2b')],qs[_0x19a2('0x31')](_0x237ce6[_0x19a2('0x2d')][_0x19a2('0x31')]));_0xe22640[_0x19a2('0x30')]=_0xe22640[_0x19a2('0x30')]['length']?_0xe22640[_0x19a2('0x30')]:_0xc73232[_0x19a2('0x2b')];_0xe22640[_0x19a2('0x47')]=qs[_0x19a2('0x34')](_0x237ce6[_0x19a2('0x2d')][_0x19a2('0x34')]);_0xe22640[_0x19a2('0x35')]=qs[_0x19a2('0x2e')](_[_0x19a2('0x36')](_0x237ce6[_0x19a2('0x2d')],_0xc73232[_0x19a2('0x2e')]));if(_0x237ce6[_0x19a2('0x2d')][_0x19a2('0x48')]){_0xe22640[_0x19a2('0x35')]=_[_0x19a2('0x37')](_0xe22640['where'],{'$or':_[_0x19a2('0x27')](_0xe22640[_0x19a2('0x30')],function(_0x542ab5){var _0x57f91b={};_0x57f91b[_0x542ab5]={'$like':'%'+_0x237ce6['query'][_0x19a2('0x48')]+'%'};return _0x57f91b;})});}_0xe22640=_[_0x19a2('0x37')]({},_0xe22640,_0x237ce6['options']);return _0x1e1c86[_0x19a2('0x49')](_0xe22640);}})[_0x19a2('0x23')](function(_0x1ac1f2){if(_0x1ac1f2){_0x317f11=_0x1ac1f2[_0x19a2('0x32')];if(!_0x237ce6[_0x19a2('0x2d')][_0x19a2('0x33')]('nolimit')){_0xe22640[_0x19a2('0x1c')]=qs[_0x19a2('0x1c')](_0x237ce6[_0x19a2('0x2d')][_0x19a2('0x1c')]);_0xe22640[_0x19a2('0x1b')]=qs[_0x19a2('0x1b')](_0x237ce6[_0x19a2('0x2d')]['offset']);}return _0x1e1c86[_0x19a2('0x49')](_0xe22640);}})[_0x19a2('0x23')](function(_0x52a580){if(_0x52a580){return _0x52a580?{'count':_0x317f11,'rows':_0x52a580}:null;}})[_0x19a2('0x23')](respondWithResult(_0x37aa58,null))[_0x19a2('0x3e')](handleError(_0x37aa58,null));};exports['getFields']=function(_0x35a86e,_0x5a1d92,_0x39c948){var _0xf6c45e={};var _0x22334b={};var _0x1e9ab1;var _0x3c2e34;return db[_0x19a2('0x28')][_0x19a2('0x46')]({'where':{'id':_0x35a86e[_0x19a2('0x40')]['id']}})[_0x19a2('0x23')](handleEntityNotFound(_0x5a1d92,null))['then'](function(_0x57879f){if(_0x57879f){_0x1e9ab1=_0x57879f;_0x22334b[_0x19a2('0x2b')]=_['keys'](db['FreshsalesField'][_0x19a2('0x41')]);_0x22334b['query']=_[_0x19a2('0x2c')](_0x35a86e[_0x19a2('0x2d')]);_0x22334b[_0x19a2('0x2e')]=_[_0x19a2('0x2f')](_0x22334b[_0x19a2('0x2b')],_0x22334b[_0x19a2('0x2d')]);_0xf6c45e['attributes']=_[_0x19a2('0x2f')](_0x22334b[_0x19a2('0x2b')],qs[_0x19a2('0x31')](_0x35a86e['query'][_0x19a2('0x31')]));_0xf6c45e[_0x19a2('0x30')]=_0xf6c45e['attributes'][_0x19a2('0x32')]?_0xf6c45e['attributes']:_0x22334b['model'];_0xf6c45e[_0x19a2('0x47')]=qs[_0x19a2('0x34')](_0x35a86e['query'][_0x19a2('0x34')]);_0xf6c45e[_0x19a2('0x35')]=qs['filters'](_[_0x19a2('0x36')](_0x35a86e[_0x19a2('0x2d')],_0x22334b[_0x19a2('0x2e')]));if(_0x35a86e[_0x19a2('0x2d')][_0x19a2('0x48')]){_0xf6c45e['where']=_['merge'](_0xf6c45e[_0x19a2('0x35')],{'$or':_[_0x19a2('0x27')](_0xf6c45e[_0x19a2('0x30')],function(_0x484a2f){var _0x2e2e9b={};_0x2e2e9b[_0x484a2f]={'$like':'%'+_0x35a86e['query'][_0x19a2('0x48')]+'%'};return _0x2e2e9b;})});}_0xf6c45e=_[_0x19a2('0x37')]({},_0xf6c45e,_0x35a86e['options']);return _0x1e9ab1[_0x19a2('0x4b')](_0xf6c45e);}})[_0x19a2('0x23')](function(_0x3d4682){if(_0x3d4682){_0x3c2e34=_0x3d4682[_0x19a2('0x32')];if(!_0x35a86e['query'][_0x19a2('0x33')](_0x19a2('0x4c'))){_0xf6c45e[_0x19a2('0x1c')]=qs[_0x19a2('0x1c')](_0x35a86e[_0x19a2('0x2d')]['limit']);_0xf6c45e[_0x19a2('0x1b')]=qs[_0x19a2('0x1b')](_0x35a86e[_0x19a2('0x2d')][_0x19a2('0x1b')]);}return _0x1e9ab1[_0x19a2('0x4b')](_0xf6c45e);}})[_0x19a2('0x23')](function(_0x46dace){if(_0x46dace){return _0x46dace?{'count':_0x3c2e34,'rows':_0x46dace}:null;}})[_0x19a2('0x23')](respondWithResult(_0x5a1d92,null))['catch'](handleError(_0x5a1d92,null));}; \ No newline at end of file +var _0xc7e4=['order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','rows','show','params','catch','create','body','find','destroy','getSubjects','findOne','options','hasOwnProperty','getDescriptions','FreshsalesField','getFields','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','end','error','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','nolimit'];(function(_0x251fde,_0x384469){var _0x350af6=function(_0x15a6a3){while(--_0x15a6a3){_0x251fde['push'](_0x251fde['shift']());}};_0x350af6(++_0x384469);}(_0xc7e4,0x1b2));var _0x4c7e=function(_0x5f0a85,_0x517151){_0x5f0a85=_0x5f0a85-0x0;var _0x3ccda7=_0xc7e4[_0x5f0a85];return _0x3ccda7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4c7e('0x0'));var zipdir=require(_0x4c7e('0x1'));var jsonpatch=require(_0x4c7e('0x2'));var rp=require(_0x4c7e('0x3'));var moment=require(_0x4c7e('0x4'));var BPromise=require(_0x4c7e('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4c7e('0x6'));var sox=require('sox');var csv=require(_0x4c7e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4c7e('0x8'));var _=require(_0x4c7e('0x9'));var squel=require('squel');var crypto=require(_0x4c7e('0xa'));var jsforce=require(_0x4c7e('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x4c7e('0x7'));var querystring=require('querystring');var Papa=require(_0x4c7e('0xc'));var Redis=require(_0x4c7e('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x4c7e('0xe'));var as=require(_0x4c7e('0xf'));var hardwareService=require(_0x4c7e('0x10'));var logger=require(_0x4c7e('0x11'))(_0x4c7e('0x12'));var utils=require(_0x4c7e('0x13'));var config=require(_0x4c7e('0x14'));var licenseUtil=require(_0x4c7e('0x15'));var db=require(_0x4c7e('0x16'))['db'];function respondWithStatusCode(_0xd8f722,_0x5326f3){_0x5326f3=_0x5326f3||0xcc;return function(_0x21116a){if(_0x21116a){return _0xd8f722[_0x4c7e('0x17')](_0x5326f3);}return _0xd8f722[_0x4c7e('0x18')](_0x5326f3)['end']();};}function respondWithResult(_0x367200,_0x49ba2a){_0x49ba2a=_0x49ba2a||0xc8;return function(_0x32138e){if(_0x32138e){return _0x367200[_0x4c7e('0x18')](_0x49ba2a)['json'](_0x32138e);}};}function respondWithFilteredResult(_0x559902,_0x5912d5){return function(_0x56d728){if(_0x56d728){var _0x2f2da1=typeof _0x5912d5[_0x4c7e('0x19')]===_0x4c7e('0x1a')&&typeof _0x5912d5[_0x4c7e('0x1b')]===_0x4c7e('0x1a');var _0x55ed89=_0x56d728[_0x4c7e('0x1c')];var _0x5571da=_0x2f2da1?0x0:_0x5912d5[_0x4c7e('0x19')];var _0x15753e=_0x2f2da1?_0x56d728[_0x4c7e('0x1c')]:_0x5912d5[_0x4c7e('0x19')]+_0x5912d5[_0x4c7e('0x1b')];var _0x432633;if(_0x15753e>=_0x55ed89){_0x15753e=_0x55ed89;_0x432633=0xc8;}else{_0x432633=0xce;}_0x559902[_0x4c7e('0x18')](_0x432633);return _0x559902[_0x4c7e('0x1d')](_0x4c7e('0x1e'),_0x5571da+'-'+_0x15753e+'/'+_0x55ed89)[_0x4c7e('0x1f')](_0x56d728);}return null;};}function patchUpdates(_0x521c85){return function(_0x4b09a9){try{jsonpatch[_0x4c7e('0x20')](_0x4b09a9,_0x521c85,!![]);}catch(_0x191c3f){return BPromise[_0x4c7e('0x21')](_0x191c3f);}return _0x4b09a9[_0x4c7e('0x22')]();};}function saveUpdates(_0x18dcf6,_0x5b77b3){return function(_0x14bf86){if(_0x14bf86){return _0x14bf86[_0x4c7e('0x23')](_0x18dcf6)['then'](function(_0x302ae9){return _0x302ae9;});}return null;};}function removeEntity(_0x270d9c,_0x1b0199){return function(_0x2ac5bb){if(_0x2ac5bb){return _0x2ac5bb['destroy']()[_0x4c7e('0x24')](function(){_0x270d9c[_0x4c7e('0x18')](0xcc)[_0x4c7e('0x25')]();});}};}function handleEntityNotFound(_0x106a9f,_0xbce75e){return function(_0x333f5d){if(!_0x333f5d){_0x106a9f['sendStatus'](0x194);}return _0x333f5d;};}function handleError(_0x2fda76,_0x1dbf38){_0x1dbf38=_0x1dbf38||0x1f4;return function(_0x2ef280){logger[_0x4c7e('0x26')](_0x2ef280[_0x4c7e('0x27')]);if(_0x2ef280['name']){delete _0x2ef280[_0x4c7e('0x28')];}_0x2fda76[_0x4c7e('0x18')](_0x1dbf38)[_0x4c7e('0x29')](_0x2ef280);};}exports[_0x4c7e('0x2a')]=function(_0x3f0a95,_0x268aa7){var _0x269985={},_0x2d2b62={},_0x5b0bc5={'count':0x0,'rows':[]};var _0x176c49=_[_0x4c7e('0x2b')](db[_0x4c7e('0x2c')][_0x4c7e('0x2d')],function(_0x2eff0b){return{'name':_0x2eff0b[_0x4c7e('0x2e')],'type':_0x2eff0b[_0x4c7e('0x2f')][_0x4c7e('0x30')]};});_0x2d2b62[_0x4c7e('0x31')]=_['map'](_0x176c49,_0x4c7e('0x28'));_0x2d2b62['query']=_[_0x4c7e('0x32')](_0x3f0a95['query']);_0x2d2b62[_0x4c7e('0x33')]=_[_0x4c7e('0x34')](_0x2d2b62[_0x4c7e('0x31')],_0x2d2b62[_0x4c7e('0x35')]);_0x269985['attributes']=_[_0x4c7e('0x34')](_0x2d2b62[_0x4c7e('0x31')],qs[_0x4c7e('0x36')](_0x3f0a95[_0x4c7e('0x35')][_0x4c7e('0x36')]));_0x269985['attributes']=_0x269985[_0x4c7e('0x37')][_0x4c7e('0x38')]?_0x269985[_0x4c7e('0x37')]:_0x2d2b62[_0x4c7e('0x31')];if(!_0x3f0a95[_0x4c7e('0x35')]['hasOwnProperty'](_0x4c7e('0x39'))){_0x269985[_0x4c7e('0x1b')]=qs[_0x4c7e('0x1b')](_0x3f0a95['query']['limit']);_0x269985['offset']=qs['offset'](_0x3f0a95['query'][_0x4c7e('0x19')]);}_0x269985[_0x4c7e('0x3a')]=qs[_0x4c7e('0x3b')](_0x3f0a95[_0x4c7e('0x35')][_0x4c7e('0x3b')]);_0x269985[_0x4c7e('0x3c')]=qs[_0x4c7e('0x33')](_[_0x4c7e('0x3d')](_0x3f0a95['query'],_0x2d2b62[_0x4c7e('0x33')]),_0x176c49);if(_0x3f0a95[_0x4c7e('0x35')]['filter']){_0x269985[_0x4c7e('0x3c')]=_[_0x4c7e('0x3e')](_0x269985[_0x4c7e('0x3c')],{'$or':_['map'](_0x176c49,function(_0xa83a24){if(_0xa83a24[_0x4c7e('0x2f')]!==_0x4c7e('0x3f')){var _0x2405fc={};_0x2405fc[_0xa83a24[_0x4c7e('0x28')]]={'$like':'%'+_0x3f0a95[_0x4c7e('0x35')][_0x4c7e('0x40')]+'%'};return _0x2405fc;}})});}_0x269985=_[_0x4c7e('0x3e')]({},_0x269985,_0x3f0a95['options']);var _0x3be4c5={'where':_0x269985['where']};return db[_0x4c7e('0x2c')][_0x4c7e('0x1c')](_0x3be4c5)[_0x4c7e('0x24')](function(_0x35d384){_0x5b0bc5[_0x4c7e('0x1c')]=_0x35d384;if(_0x3f0a95[_0x4c7e('0x35')][_0x4c7e('0x41')]){_0x269985[_0x4c7e('0x42')]=[{'all':!![]}];}return db['FreshsalesConfiguration']['findAll'](_0x269985);})[_0x4c7e('0x24')](function(_0x9854ec){_0x5b0bc5[_0x4c7e('0x43')]=_0x9854ec;return _0x5b0bc5;})[_0x4c7e('0x24')](respondWithFilteredResult(_0x268aa7,_0x269985))['catch'](handleError(_0x268aa7,null));};exports[_0x4c7e('0x44')]=function(_0x3a7250,_0x3f3647){var _0x167484={'raw':![],'where':{'id':_0x3a7250[_0x4c7e('0x45')]['id']}},_0x4272bc={};_0x4272bc['model']=_[_0x4c7e('0x32')](db['FreshsalesConfiguration']['rawAttributes']);_0x4272bc[_0x4c7e('0x35')]=_[_0x4c7e('0x32')](_0x3a7250[_0x4c7e('0x35')]);_0x4272bc[_0x4c7e('0x33')]=_['intersection'](_0x4272bc[_0x4c7e('0x31')],_0x4272bc['query']);_0x167484[_0x4c7e('0x37')]=_[_0x4c7e('0x34')](_0x4272bc['model'],qs[_0x4c7e('0x36')](_0x3a7250[_0x4c7e('0x35')][_0x4c7e('0x36')]));_0x167484[_0x4c7e('0x37')]=_0x167484[_0x4c7e('0x37')][_0x4c7e('0x38')]?_0x167484[_0x4c7e('0x37')]:_0x4272bc[_0x4c7e('0x31')];if(_0x3a7250['query'][_0x4c7e('0x41')]){_0x167484[_0x4c7e('0x42')]=[{'all':!![]}];}_0x167484=_[_0x4c7e('0x3e')]({},_0x167484,_0x3a7250['options']);return db['FreshsalesConfiguration']['find'](_0x167484)[_0x4c7e('0x24')](handleEntityNotFound(_0x3f3647,null))['then'](respondWithResult(_0x3f3647,null))[_0x4c7e('0x46')](handleError(_0x3f3647,null));};exports[_0x4c7e('0x47')]=function(_0x41bd95,_0x337b77){return db[_0x4c7e('0x2c')][_0x4c7e('0x47')](_0x41bd95[_0x4c7e('0x48')],{})[_0x4c7e('0x24')](respondWithResult(_0x337b77,0xc9))[_0x4c7e('0x46')](handleError(_0x337b77,null));};exports[_0x4c7e('0x23')]=function(_0x555854,_0x3132a0){if(_0x555854[_0x4c7e('0x48')]['id']){delete _0x555854['body']['id'];}return db[_0x4c7e('0x2c')][_0x4c7e('0x49')]({'where':{'id':_0x555854['params']['id']}})[_0x4c7e('0x24')](handleEntityNotFound(_0x3132a0,null))['then'](saveUpdates(_0x555854[_0x4c7e('0x48')],null))[_0x4c7e('0x24')](respondWithResult(_0x3132a0,null))[_0x4c7e('0x46')](handleError(_0x3132a0,null));};exports[_0x4c7e('0x4a')]=function(_0x1c6aa0,_0x1032f2){return db[_0x4c7e('0x2c')]['find']({'where':{'id':_0x1c6aa0['params']['id']}})[_0x4c7e('0x24')](handleEntityNotFound(_0x1032f2,null))[_0x4c7e('0x24')](removeEntity(_0x1032f2,null))['catch'](handleError(_0x1032f2,null));};exports[_0x4c7e('0x4b')]=function(_0x36bd73,_0x303c40,_0x535775){var _0x22789c={};var _0x389246={};var _0x28f0ea;var _0x11941f;return db['FreshsalesConfiguration'][_0x4c7e('0x4c')]({'where':{'id':_0x36bd73[_0x4c7e('0x45')]['id']}})[_0x4c7e('0x24')](handleEntityNotFound(_0x303c40,null))[_0x4c7e('0x24')](function(_0x590134){if(_0x590134){_0x28f0ea=_0x590134;_0x389246[_0x4c7e('0x31')]=_[_0x4c7e('0x32')](db['FreshsalesField'][_0x4c7e('0x2d')]);_0x389246['query']=_[_0x4c7e('0x32')](_0x36bd73[_0x4c7e('0x35')]);_0x389246[_0x4c7e('0x33')]=_[_0x4c7e('0x34')](_0x389246[_0x4c7e('0x31')],_0x389246[_0x4c7e('0x35')]);_0x22789c[_0x4c7e('0x37')]=_['intersection'](_0x389246[_0x4c7e('0x31')],qs[_0x4c7e('0x36')](_0x36bd73[_0x4c7e('0x35')]['fields']));_0x22789c['attributes']=_0x22789c[_0x4c7e('0x37')][_0x4c7e('0x38')]?_0x22789c[_0x4c7e('0x37')]:_0x389246[_0x4c7e('0x31')];_0x22789c[_0x4c7e('0x3a')]=qs[_0x4c7e('0x3b')](_0x36bd73[_0x4c7e('0x35')][_0x4c7e('0x3b')]);_0x22789c[_0x4c7e('0x3c')]=qs[_0x4c7e('0x33')](_[_0x4c7e('0x3d')](_0x36bd73['query'],_0x389246[_0x4c7e('0x33')]));if(_0x36bd73[_0x4c7e('0x35')][_0x4c7e('0x40')]){_0x22789c[_0x4c7e('0x3c')]=_['merge'](_0x22789c[_0x4c7e('0x3c')],{'$or':_[_0x4c7e('0x2b')](_0x22789c[_0x4c7e('0x37')],function(_0x53ce68){var _0x470c3e={};_0x470c3e[_0x53ce68]={'$like':'%'+_0x36bd73['query'][_0x4c7e('0x40')]+'%'};return _0x470c3e;})});}_0x22789c=_[_0x4c7e('0x3e')]({},_0x22789c,_0x36bd73[_0x4c7e('0x4d')]);return _0x28f0ea[_0x4c7e('0x4b')](_0x22789c);}})[_0x4c7e('0x24')](function(_0x43e937){if(_0x43e937){_0x11941f=_0x43e937[_0x4c7e('0x38')];if(!_0x36bd73['query'][_0x4c7e('0x4e')](_0x4c7e('0x39'))){_0x22789c['limit']=qs['limit'](_0x36bd73[_0x4c7e('0x35')][_0x4c7e('0x1b')]);_0x22789c[_0x4c7e('0x19')]=qs['offset'](_0x36bd73[_0x4c7e('0x35')]['offset']);}return _0x28f0ea[_0x4c7e('0x4b')](_0x22789c);}})[_0x4c7e('0x24')](function(_0x9ffa54){if(_0x9ffa54){return _0x9ffa54?{'count':_0x11941f,'rows':_0x9ffa54}:null;}})[_0x4c7e('0x24')](respondWithResult(_0x303c40,null))[_0x4c7e('0x46')](handleError(_0x303c40,null));};exports[_0x4c7e('0x4f')]=function(_0x9532dd,_0x2a5dfb,_0x1ce589){var _0x19c191={};var _0x2a705e={};var _0x5d70a2;var _0x192565;return db[_0x4c7e('0x2c')][_0x4c7e('0x4c')]({'where':{'id':_0x9532dd[_0x4c7e('0x45')]['id']}})['then'](handleEntityNotFound(_0x2a5dfb,null))[_0x4c7e('0x24')](function(_0x1720c6){if(_0x1720c6){_0x5d70a2=_0x1720c6;_0x2a705e[_0x4c7e('0x31')]=_[_0x4c7e('0x32')](db[_0x4c7e('0x50')][_0x4c7e('0x2d')]);_0x2a705e[_0x4c7e('0x35')]=_[_0x4c7e('0x32')](_0x9532dd[_0x4c7e('0x35')]);_0x2a705e[_0x4c7e('0x33')]=_['intersection'](_0x2a705e[_0x4c7e('0x31')],_0x2a705e['query']);_0x19c191[_0x4c7e('0x37')]=_[_0x4c7e('0x34')](_0x2a705e['model'],qs[_0x4c7e('0x36')](_0x9532dd[_0x4c7e('0x35')]['fields']));_0x19c191[_0x4c7e('0x37')]=_0x19c191['attributes'][_0x4c7e('0x38')]?_0x19c191[_0x4c7e('0x37')]:_0x2a705e[_0x4c7e('0x31')];_0x19c191[_0x4c7e('0x3a')]=qs[_0x4c7e('0x3b')](_0x9532dd[_0x4c7e('0x35')][_0x4c7e('0x3b')]);_0x19c191[_0x4c7e('0x3c')]=qs['filters'](_[_0x4c7e('0x3d')](_0x9532dd[_0x4c7e('0x35')],_0x2a705e[_0x4c7e('0x33')]));if(_0x9532dd['query'][_0x4c7e('0x40')]){_0x19c191[_0x4c7e('0x3c')]=_['merge'](_0x19c191['where'],{'$or':_[_0x4c7e('0x2b')](_0x19c191['attributes'],function(_0x317213){var _0x3d1f67={};_0x3d1f67[_0x317213]={'$like':'%'+_0x9532dd[_0x4c7e('0x35')][_0x4c7e('0x40')]+'%'};return _0x3d1f67;})});}_0x19c191=_['merge']({},_0x19c191,_0x9532dd[_0x4c7e('0x4d')]);return _0x5d70a2[_0x4c7e('0x4f')](_0x19c191);}})['then'](function(_0x457709){if(_0x457709){_0x192565=_0x457709[_0x4c7e('0x38')];if(!_0x9532dd[_0x4c7e('0x35')][_0x4c7e('0x4e')](_0x4c7e('0x39'))){_0x19c191[_0x4c7e('0x1b')]=qs[_0x4c7e('0x1b')](_0x9532dd['query'][_0x4c7e('0x1b')]);_0x19c191[_0x4c7e('0x19')]=qs[_0x4c7e('0x19')](_0x9532dd[_0x4c7e('0x35')][_0x4c7e('0x19')]);}return _0x5d70a2['getDescriptions'](_0x19c191);}})[_0x4c7e('0x24')](function(_0x4a997f){if(_0x4a997f){return _0x4a997f?{'count':_0x192565,'rows':_0x4a997f}:null;}})[_0x4c7e('0x24')](respondWithResult(_0x2a5dfb,null))[_0x4c7e('0x46')](handleError(_0x2a5dfb,null));};exports['getFields']=function(_0x3e7bcb,_0x4983bf,_0x5a3ef8){var _0x1a14c9={};var _0x2dc692={};var _0x2f71a2;var _0x2bf27e;return db[_0x4c7e('0x2c')]['findOne']({'where':{'id':_0x3e7bcb['params']['id']}})['then'](handleEntityNotFound(_0x4983bf,null))['then'](function(_0x594207){if(_0x594207){_0x2f71a2=_0x594207;_0x2dc692['model']=_[_0x4c7e('0x32')](db[_0x4c7e('0x50')][_0x4c7e('0x2d')]);_0x2dc692[_0x4c7e('0x35')]=_[_0x4c7e('0x32')](_0x3e7bcb[_0x4c7e('0x35')]);_0x2dc692[_0x4c7e('0x33')]=_[_0x4c7e('0x34')](_0x2dc692[_0x4c7e('0x31')],_0x2dc692[_0x4c7e('0x35')]);_0x1a14c9[_0x4c7e('0x37')]=_['intersection'](_0x2dc692[_0x4c7e('0x31')],qs[_0x4c7e('0x36')](_0x3e7bcb[_0x4c7e('0x35')][_0x4c7e('0x36')]));_0x1a14c9['attributes']=_0x1a14c9[_0x4c7e('0x37')][_0x4c7e('0x38')]?_0x1a14c9[_0x4c7e('0x37')]:_0x2dc692['model'];_0x1a14c9[_0x4c7e('0x3a')]=qs[_0x4c7e('0x3b')](_0x3e7bcb['query'][_0x4c7e('0x3b')]);_0x1a14c9[_0x4c7e('0x3c')]=qs['filters'](_[_0x4c7e('0x3d')](_0x3e7bcb[_0x4c7e('0x35')],_0x2dc692[_0x4c7e('0x33')]));if(_0x3e7bcb['query'][_0x4c7e('0x40')]){_0x1a14c9[_0x4c7e('0x3c')]=_[_0x4c7e('0x3e')](_0x1a14c9[_0x4c7e('0x3c')],{'$or':_[_0x4c7e('0x2b')](_0x1a14c9[_0x4c7e('0x37')],function(_0x20eec2){var _0x4a30f0={};_0x4a30f0[_0x20eec2]={'$like':'%'+_0x3e7bcb[_0x4c7e('0x35')][_0x4c7e('0x40')]+'%'};return _0x4a30f0;})});}_0x1a14c9=_[_0x4c7e('0x3e')]({},_0x1a14c9,_0x3e7bcb['options']);return _0x2f71a2['getFields'](_0x1a14c9);}})[_0x4c7e('0x24')](function(_0x6bb11){if(_0x6bb11){_0x2bf27e=_0x6bb11['length'];if(!_0x3e7bcb[_0x4c7e('0x35')][_0x4c7e('0x4e')]('nolimit')){_0x1a14c9[_0x4c7e('0x1b')]=qs[_0x4c7e('0x1b')](_0x3e7bcb['query'][_0x4c7e('0x1b')]);_0x1a14c9[_0x4c7e('0x19')]=qs['offset'](_0x3e7bcb[_0x4c7e('0x35')][_0x4c7e('0x19')]);}return _0x2f71a2[_0x4c7e('0x51')](_0x1a14c9);}})['then'](function(_0x165caf){if(_0x165caf){return _0x165caf?{'count':_0x2bf27e,'rows':_0x165caf}:null;}})['then'](respondWithResult(_0x4983bf,null))['catch'](handleError(_0x4983bf,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 254b33e..3790a0a 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 _0x0404=['moment','rimraf','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0404,0x96));var _0x4040=function(_0x80d733,_0x266211){_0x80d733=_0x80d733-0x0;var _0x435868=_0x0404[_0x80d733];return _0x435868;};'use strict';var _=require(_0x4040('0x0'));var util=require(_0x4040('0x1'));var logger=require(_0x4040('0x2'))(_0x4040('0x3'));var moment=require(_0x4040('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4040('0x5'));var config=require('../../config/environment');var attributes=require(_0x4040('0x6'));module[_0x4040('0x7')]=function(_0x5a931d,_0x6feb43){return _0x5a931d[_0x4040('0x8')](_0x4040('0x9'),attributes,{'tableName':_0x4040('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0723=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger','api'];(function(_0x10e2cd,_0x10cbfd){var _0x149683=function(_0x47b1a5){while(--_0x47b1a5){_0x10e2cd['push'](_0x10e2cd['shift']());}};_0x149683(++_0x10cbfd);}(_0x0723,0x1d8));var _0x3072=function(_0x30121e,_0x240c86){_0x30121e=_0x30121e-0x0;var _0x4ba328=_0x0723[_0x30121e];return _0x4ba328;};'use strict';var _=require(_0x3072('0x0'));var util=require(_0x3072('0x1'));var logger=require(_0x3072('0x2'))(_0x3072('0x3'));var moment=require(_0x3072('0x4'));var BPromise=require(_0x3072('0x5'));var rp=require(_0x3072('0x6'));var fs=require('fs');var path=require(_0x3072('0x7'));var rimraf=require(_0x3072('0x8'));var config=require(_0x3072('0x9'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0x3072('0xa')]=function(_0x4acbd3,_0x1a0408){return _0x4acbd3[_0x3072('0xb')](_0x3072('0xc'),attributes,{'tableName':_0x3072('0xd'),'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 bc9e497..eafb68f 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 _0xc032=['request','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x518235,_0x260ffc){var _0x11a190=function(_0x4b8685){while(--_0x4b8685){_0x518235['push'](_0x518235['shift']());}};_0x11a190(++_0x260ffc);}(_0xc032,0xbc));var _0x2c03=function(_0x446f4a,_0x5163b7){_0x446f4a=_0x446f4a-0x0;var _0x12d082=_0xc032[_0x446f4a];return _0x12d082;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x2c03('0x0'));var rs=require(_0x2c03('0x1'));var fs=require('fs');var Redis=require(_0x2c03('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x2c03('0x3'));var logger=require(_0x2c03('0x4'))(_0x2c03('0x5'));var config=require(_0x2c03('0x6'));var jayson=require(_0x2c03('0x7'));var client=jayson[_0x2c03('0x8')][_0x2c03('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a3cc1,_0x1612bf,_0x42cad1){return new BPromise(function(_0x3ffb31,_0x4d606d){return client[_0x2c03('0xa')](_0x2a3cc1,_0x42cad1)['then'](function(_0x56cd4a){logger[_0x2c03('0xb')](_0x2c03('0xc'),_0x1612bf,_0x2c03('0xd'));logger[_0x2c03('0xe')](_0x2c03('0xf'),_0x1612bf,'request\x20sent',JSON[_0x2c03('0x10')](_0x56cd4a));if(_0x56cd4a[_0x2c03('0x11')]){if(_0x56cd4a[_0x2c03('0x11')][_0x2c03('0x12')]===0x1f4){logger[_0x2c03('0x11')](_0x2c03('0xc'),_0x1612bf,_0x56cd4a['error'][_0x2c03('0x13')]);return _0x4d606d(_0x56cd4a[_0x2c03('0x11')][_0x2c03('0x13')]);}logger[_0x2c03('0x11')](_0x2c03('0xc'),_0x1612bf,_0x56cd4a[_0x2c03('0x11')][_0x2c03('0x13')]);return _0x3ffb31(_0x56cd4a[_0x2c03('0x11')][_0x2c03('0x13')]);}else{logger[_0x2c03('0xb')](_0x2c03('0xc'),_0x1612bf,'request\x20sent');_0x3ffb31(_0x56cd4a[_0x2c03('0x14')][_0x2c03('0x13')]);}})[_0x2c03('0x15')](function(_0x2a0146){logger[_0x2c03('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x1612bf,_0x2a0146);_0x4d606d(_0x2a0146);});});} \ No newline at end of file +var _0x0c44=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','info','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird'];(function(_0x3c47bf,_0x5befe2){var _0x539960=function(_0x43aa56){while(--_0x43aa56){_0x3c47bf['push'](_0x3c47bf['shift']());}};_0x539960(++_0x5befe2);}(_0x0c44,0xa5));var _0x40c4=function(_0x150cdb,_0x4ee053){_0x150cdb=_0x150cdb-0x0;var _0xf802b1=_0x0c44[_0x150cdb];return _0xf802b1;};'use strict';var _=require(_0x40c4('0x0'));var util=require(_0x40c4('0x1'));var moment=require('moment');var BPromise=require(_0x40c4('0x2'));var rs=require(_0x40c4('0x3'));var fs=require('fs');var Redis=require(_0x40c4('0x4'));var db=require(_0x40c4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x40c4('0x6'))(_0x40c4('0x7'));var config=require(_0x40c4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x40c4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12ca18,_0x529159,_0x441682){return new BPromise(function(_0x5cc352,_0x2e2e88){return client[_0x40c4('0xa')](_0x12ca18,_0x441682)['then'](function(_0x2178fe){logger[_0x40c4('0xb')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x529159,'request\x20sent');logger['debug'](_0x40c4('0xc'),_0x529159,_0x40c4('0xd'),JSON[_0x40c4('0xe')](_0x2178fe));if(_0x2178fe[_0x40c4('0xf')]){if(_0x2178fe[_0x40c4('0xf')][_0x40c4('0x10')]===0x1f4){logger[_0x40c4('0xf')](_0x40c4('0x11'),_0x529159,_0x2178fe[_0x40c4('0xf')][_0x40c4('0x12')]);return _0x2e2e88(_0x2178fe[_0x40c4('0xf')][_0x40c4('0x12')]);}logger[_0x40c4('0xf')](_0x40c4('0x11'),_0x529159,_0x2178fe[_0x40c4('0xf')][_0x40c4('0x12')]);return _0x5cc352(_0x2178fe['error'][_0x40c4('0x12')]);}else{logger[_0x40c4('0xb')](_0x40c4('0x11'),_0x529159,_0x40c4('0xd'));_0x5cc352(_0x2178fe[_0x40c4('0x13')][_0x40c4('0x12')]);}})[_0x40c4('0x14')](function(_0x354fa8){logger[_0x40c4('0xf')](_0x40c4('0x11'),_0x529159,_0x354fa8);_0x2e2e88(_0x354fa8);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index aaffd3a..8243a36 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 _0x9ef8=['index','get','/:id','show','post','create','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated'];(function(_0x43aee5,_0x11268b){var _0x76d1d0=function(_0x3faee6){while(--_0x3faee6){_0x43aee5['push'](_0x43aee5['shift']());}};_0x76d1d0(++_0x11268b);}(_0x9ef8,0x17f));var _0x89ef=function(_0x2a8c21,_0x163576){_0x2a8c21=_0x2a8c21-0x0;var _0x5f3061=_0x9ef8[_0x2a8c21];return _0x5f3061;};'use strict';var multer=require(_0x89ef('0x0'));var util=require(_0x89ef('0x1'));var path=require('path');var timeout=require(_0x89ef('0x2'));var express=require(_0x89ef('0x3'));var router=express[_0x89ef('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x89ef('0x5'));var interaction=require(_0x89ef('0x6'));var config=require('../../config/environment');var controller=require('./intFreshsalesField.controller');router['get']('/',auth[_0x89ef('0x7')](),controller[_0x89ef('0x8')]);router[_0x89ef('0x9')](_0x89ef('0xa'),auth[_0x89ef('0x7')](),controller[_0x89ef('0xb')]);router[_0x89ef('0xc')]('/',auth[_0x89ef('0x7')](),controller[_0x89ef('0xd')]);router['put'](_0x89ef('0xa'),auth[_0x89ef('0x7')](),controller[_0x89ef('0xe')]);router['delete'](_0x89ef('0xa'),auth[_0x89ef('0x7')](),controller[_0x89ef('0xf')]);module[_0x89ef('0x10')]=router; \ No newline at end of file +var _0x54ef=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','index','get','/:id','show','isAuthenticated','create','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x25ba43,_0x3dc763){var _0x4291d5=function(_0x789032){while(--_0x789032){_0x25ba43['push'](_0x25ba43['shift']());}};_0x4291d5(++_0x3dc763);}(_0x54ef,0x112));var _0xf54e=function(_0x436dda,_0x4f4dff){_0x436dda=_0x436dda-0x0;var _0x4e09f3=_0x54ef[_0x436dda];return _0x4e09f3;};'use strict';var multer=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var path=require(_0xf54e('0x2'));var timeout=require('connect-timeout');var express=require(_0xf54e('0x3'));var router=express[_0xf54e('0x4')]();var fs_extra=require(_0xf54e('0x5'));var auth=require(_0xf54e('0x6'));var interaction=require(_0xf54e('0x7'));var config=require(_0xf54e('0x8'));var controller=require(_0xf54e('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xf54e('0xa')]);router[_0xf54e('0xb')](_0xf54e('0xc'),auth['isAuthenticated'](),controller[_0xf54e('0xd')]);router['post']('/',auth[_0xf54e('0xe')](),controller[_0xf54e('0xf')]);router['put'](_0xf54e('0xc'),auth[_0xf54e('0xe')](),controller[_0xf54e('0x10')]);router[_0xf54e('0x11')]('/:id',auth[_0xf54e('0xe')](),controller[_0xf54e('0x12')]);module[_0xf54e('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index deb1393..ec42194 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 _0x28d8=['customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x5e4f08,_0x234b13){var _0x332a62=function(_0x17d7dd){while(--_0x17d7dd){_0x5e4f08['push'](_0x5e4f08['shift']());}};_0x332a62(++_0x234b13);}(_0x28d8,0x1e5));var _0x828d=function(_0x26c4ea,_0x29eb13){_0x26c4ea=_0x26c4ea-0x0;var _0x7b9fe5=_0x28d8[_0x26c4ea];return _0x7b9fe5;};'use strict';var Sequelize=require(_0x828d('0x0'));module[_0x828d('0x1')]={'type':{'type':Sequelize[_0x828d('0x2')](_0x828d('0x3'),_0x828d('0x4'),_0x828d('0x5'),_0x828d('0x6'),_0x828d('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0x828d('0x8')]},'key':{'type':Sequelize[_0x828d('0x8')]},'keyType':{'type':Sequelize[_0x828d('0x2')](_0x828d('0x3'),_0x828d('0x4'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x828d('0x8')]},'nameField':{'type':Sequelize[_0x828d('0x8')]},'customField':{'type':Sequelize[_0x828d('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x828d('0x8')]}}; \ No newline at end of file +var _0x0bae=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0x0bae,0xe2));var _0xe0ba=function(_0x3727d3,_0x1bf55c){_0x3727d3=_0x3727d3-0x0;var _0x5a42e0=_0x0bae[_0x3727d3];return _0x5a42e0;};'use strict';var Sequelize=require(_0xe0ba('0x0'));module[_0xe0ba('0x1')]={'type':{'type':Sequelize[_0xe0ba('0x2')](_0xe0ba('0x3'),_0xe0ba('0x4'),_0xe0ba('0x5'),_0xe0ba('0x6'),_0xe0ba('0x7')),'defaultValue':_0xe0ba('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xe0ba('0x8')]},'keyType':{'type':Sequelize[_0xe0ba('0x2')](_0xe0ba('0x3'),_0xe0ba('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0xe0ba('0x8')]},'idField':{'type':Sequelize[_0xe0ba('0x8')]},'nameField':{'type':Sequelize[_0xe0ba('0x8')]},'customField':{'type':Sequelize[_0xe0ba('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index b96e68d..7a430e0 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 _0x33d0=['rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','FreshsalesField','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','body','update'];(function(_0x299d43,_0x4ebe75){var _0x2173b6=function(_0x588394){while(--_0x588394){_0x299d43['push'](_0x299d43['shift']());}};_0x2173b6(++_0x4ebe75);}(_0x33d0,0x8e));var _0x033d=function(_0x43d526,_0x106cf3){_0x43d526=_0x43d526-0x0;var _0xd7384d=_0x33d0[_0x43d526];return _0xd7384d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x033d('0x0'));var zipdir=require(_0x033d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x033d('0x2'));var moment=require(_0x033d('0x3'));var BPromise=require(_0x033d('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x033d('0x5'));var sox=require(_0x033d('0x6'));var csv=require(_0x033d('0x7'));var ejs=require(_0x033d('0x8'));var fs=require('fs');var fs_extra=require(_0x033d('0x9'));var _=require('lodash');var squel=require(_0x033d('0xa'));var crypto=require(_0x033d('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x033d('0x7'));var querystring=require('querystring');var Papa=require(_0x033d('0xc'));var Redis=require(_0x033d('0xd'));var authService=require(_0x033d('0xe'));var qs=require(_0x033d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x033d('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x033d('0x11'));var licenseUtil=require(_0x033d('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x56d52c,_0x26d76c){_0x26d76c=_0x26d76c||0xcc;return function(_0x39671c){if(_0x39671c){return _0x56d52c[_0x033d('0x13')](_0x26d76c);}return _0x56d52c['status'](_0x26d76c)[_0x033d('0x14')]();};}function respondWithResult(_0x7d2a86,_0x5bcc0b){_0x5bcc0b=_0x5bcc0b||0xc8;return function(_0x58c048){if(_0x58c048){return _0x7d2a86[_0x033d('0x15')](_0x5bcc0b)[_0x033d('0x16')](_0x58c048);}};}function respondWithFilteredResult(_0x4b7174,_0x45df4f){return function(_0x38392e){if(_0x38392e){var _0x55f1bf=typeof _0x45df4f['offset']==='undefined'&&typeof _0x45df4f['limit']===_0x033d('0x17');var _0x3cc4d6=_0x38392e[_0x033d('0x18')];var _0x4bf73c=_0x55f1bf?0x0:_0x45df4f[_0x033d('0x19')];var _0x4812ab=_0x55f1bf?_0x38392e[_0x033d('0x18')]:_0x45df4f['offset']+_0x45df4f[_0x033d('0x1a')];var _0xcfe47c;if(_0x4812ab>=_0x3cc4d6){_0x4812ab=_0x3cc4d6;_0xcfe47c=0xc8;}else{_0xcfe47c=0xce;}_0x4b7174['status'](_0xcfe47c);return _0x4b7174[_0x033d('0x1b')](_0x033d('0x1c'),_0x4bf73c+'-'+_0x4812ab+'/'+_0x3cc4d6)['json'](_0x38392e);}return null;};}function patchUpdates(_0x29d9d5){return function(_0x232fe2){try{jsonpatch[_0x033d('0x1d')](_0x232fe2,_0x29d9d5,!![]);}catch(_0x2ec15d){return BPromise[_0x033d('0x1e')](_0x2ec15d);}return _0x232fe2[_0x033d('0x1f')]();};}function saveUpdates(_0x2acd4d,_0x13561f){return function(_0x758b94){if(_0x758b94){return _0x758b94['update'](_0x2acd4d)[_0x033d('0x20')](function(_0x1abc84){return _0x1abc84;});}return null;};}function removeEntity(_0x3874d6,_0x5b84b8){return function(_0x49a210){if(_0x49a210){return _0x49a210[_0x033d('0x21')]()[_0x033d('0x20')](function(){_0x3874d6['status'](0xcc)[_0x033d('0x14')]();});}};}function handleEntityNotFound(_0x402d54,_0x323371){return function(_0x4f5b00){if(!_0x4f5b00){_0x402d54[_0x033d('0x13')](0x194);}return _0x4f5b00;};}function handleError(_0x587a9a,_0x58058c){_0x58058c=_0x58058c||0x1f4;return function(_0x4fd274){logger[_0x033d('0x22')](_0x4fd274[_0x033d('0x23')]);if(_0x4fd274[_0x033d('0x24')]){delete _0x4fd274[_0x033d('0x24')];}_0x587a9a[_0x033d('0x15')](_0x58058c)[_0x033d('0x25')](_0x4fd274);};}exports['index']=function(_0x45c006,_0x4081d5){var _0x4e32df={},_0x465344={},_0x5092de={'count':0x0,'rows':[]};var _0x595d5e=_[_0x033d('0x26')](db['FreshsalesField']['rawAttributes'],function(_0x35566f){return{'name':_0x35566f[_0x033d('0x27')],'type':_0x35566f[_0x033d('0x28')][_0x033d('0x29')]};});_0x465344[_0x033d('0x2a')]=_['map'](_0x595d5e,'name');_0x465344[_0x033d('0x2b')]=_[_0x033d('0x2c')](_0x45c006[_0x033d('0x2b')]);_0x465344[_0x033d('0x2d')]=_[_0x033d('0x2e')](_0x465344[_0x033d('0x2a')],_0x465344[_0x033d('0x2b')]);_0x4e32df['attributes']=_[_0x033d('0x2e')](_0x465344[_0x033d('0x2a')],qs[_0x033d('0x2f')](_0x45c006[_0x033d('0x2b')][_0x033d('0x2f')]));_0x4e32df['attributes']=_0x4e32df[_0x033d('0x30')]['length']?_0x4e32df[_0x033d('0x30')]:_0x465344[_0x033d('0x2a')];if(!_0x45c006[_0x033d('0x2b')][_0x033d('0x31')](_0x033d('0x32'))){_0x4e32df[_0x033d('0x1a')]=qs[_0x033d('0x1a')](_0x45c006[_0x033d('0x2b')][_0x033d('0x1a')]);_0x4e32df[_0x033d('0x19')]=qs[_0x033d('0x19')](_0x45c006['query'][_0x033d('0x19')]);}_0x4e32df['order']=qs[_0x033d('0x33')](_0x45c006[_0x033d('0x2b')][_0x033d('0x33')]);_0x4e32df[_0x033d('0x34')]=qs[_0x033d('0x2d')](_[_0x033d('0x35')](_0x45c006[_0x033d('0x2b')],_0x465344[_0x033d('0x2d')]),_0x595d5e);if(_0x45c006['query'][_0x033d('0x36')]){_0x4e32df[_0x033d('0x34')]=_[_0x033d('0x37')](_0x4e32df[_0x033d('0x34')],{'$or':_[_0x033d('0x26')](_0x595d5e,function(_0x83d5d8){if(_0x83d5d8[_0x033d('0x28')]!==_0x033d('0x38')){var _0xcc3ac6={};_0xcc3ac6[_0x83d5d8[_0x033d('0x24')]]={'$like':'%'+_0x45c006[_0x033d('0x2b')][_0x033d('0x36')]+'%'};return _0xcc3ac6;}})});}_0x4e32df=_['merge']({},_0x4e32df,_0x45c006[_0x033d('0x39')]);var _0x4f4442={'where':_0x4e32df['where']};return db[_0x033d('0x3a')][_0x033d('0x18')](_0x4f4442)[_0x033d('0x20')](function(_0x5ce1ea){_0x5092de[_0x033d('0x18')]=_0x5ce1ea;if(_0x45c006[_0x033d('0x2b')][_0x033d('0x3b')]){_0x4e32df[_0x033d('0x3c')]=[{'all':!![]}];}return db[_0x033d('0x3a')][_0x033d('0x3d')](_0x4e32df);})[_0x033d('0x20')](function(_0x10cf5e){_0x5092de[_0x033d('0x3e')]=_0x10cf5e;return _0x5092de;})['then'](respondWithFilteredResult(_0x4081d5,_0x4e32df))[_0x033d('0x3f')](handleError(_0x4081d5,null));};exports[_0x033d('0x40')]=function(_0x317865,_0x52485c){var _0x57204f={'raw':!![],'where':{'id':_0x317865[_0x033d('0x41')]['id']}},_0x2a677b={};_0x2a677b[_0x033d('0x2a')]=_[_0x033d('0x2c')](db[_0x033d('0x3a')][_0x033d('0x42')]);_0x2a677b[_0x033d('0x2b')]=_[_0x033d('0x2c')](_0x317865[_0x033d('0x2b')]);_0x2a677b['filters']=_[_0x033d('0x2e')](_0x2a677b[_0x033d('0x2a')],_0x2a677b[_0x033d('0x2b')]);_0x57204f[_0x033d('0x30')]=_['intersection'](_0x2a677b[_0x033d('0x2a')],qs[_0x033d('0x2f')](_0x317865[_0x033d('0x2b')][_0x033d('0x2f')]));_0x57204f[_0x033d('0x30')]=_0x57204f[_0x033d('0x30')][_0x033d('0x43')]?_0x57204f[_0x033d('0x30')]:_0x2a677b['model'];if(_0x317865[_0x033d('0x2b')][_0x033d('0x3b')]){_0x57204f[_0x033d('0x3c')]=[{'all':!![]}];}_0x57204f=_['merge']({},_0x57204f,_0x317865[_0x033d('0x39')]);return db[_0x033d('0x3a')][_0x033d('0x44')](_0x57204f)[_0x033d('0x20')](handleEntityNotFound(_0x52485c,null))[_0x033d('0x20')](respondWithResult(_0x52485c,null))[_0x033d('0x3f')](handleError(_0x52485c,null));};exports['create']=function(_0xc74dba,_0x2048fb){return db['FreshsalesField']['create'](_0xc74dba[_0x033d('0x45')],{})[_0x033d('0x20')](respondWithResult(_0x2048fb,0xc9))[_0x033d('0x3f')](handleError(_0x2048fb,null));};exports[_0x033d('0x46')]=function(_0x11a09a,_0x455d88){if(_0x11a09a['body']['id']){delete _0x11a09a[_0x033d('0x45')]['id'];}return db[_0x033d('0x3a')][_0x033d('0x44')]({'where':{'id':_0x11a09a['params']['id']}})['then'](handleEntityNotFound(_0x455d88,null))[_0x033d('0x20')](saveUpdates(_0x11a09a[_0x033d('0x45')],null))[_0x033d('0x20')](respondWithResult(_0x455d88,null))['catch'](handleError(_0x455d88,null));};exports[_0x033d('0x21')]=function(_0x5a64ef,_0x39941b){return db[_0x033d('0x3a')][_0x033d('0x44')]({'where':{'id':_0x5a64ef[_0x033d('0x41')]['id']}})[_0x033d('0x20')](handleEntityNotFound(_0x39941b,null))['then'](removeEntity(_0x39941b,null))['catch'](handleError(_0x39941b,null));}; \ No newline at end of file +var _0x2c5a=['Content-Range','apply','reject','save','then','destroy','stack','name','send','map','FreshsalesField','rawAttributes','fieldName','key','model','keys','filters','intersection','query','attributes','fields','nolimit','order','sort','pick','filter','type','VIRTUAL','merge','options','where','includeAll','include','rows','catch','params','create','body','find','zip-dir','request-promise','moment','bluebird','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','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2c5a,0x1d7));var _0xa2c5=function(_0x57536d,_0x3cd82d){_0x57536d=_0x57536d-0x0;var _0x10b3e7=_0x2c5a[_0x57536d];return _0x10b3e7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa2c5('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa2c5('0x1'));var moment=require(_0xa2c5('0x2'));var BPromise=require(_0xa2c5('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa2c5('0x4'));var sox=require(_0xa2c5('0x5'));var csv=require(_0xa2c5('0x6'));var ejs=require(_0xa2c5('0x7'));var fs=require('fs');var fs_extra=require(_0xa2c5('0x8'));var _=require(_0xa2c5('0x9'));var squel=require(_0xa2c5('0xa'));var crypto=require('crypto');var jsforce=require(_0xa2c5('0xb'));var deskjs=require(_0xa2c5('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa2c5('0xd'));var Papa=require(_0xa2c5('0xe'));var Redis=require(_0xa2c5('0xf'));var authService=require(_0xa2c5('0x10'));var qs=require(_0xa2c5('0x11'));var as=require(_0xa2c5('0x12'));var hardwareService=require(_0xa2c5('0x13'));var logger=require(_0xa2c5('0x14'))('api');var utils=require(_0xa2c5('0x15'));var config=require(_0xa2c5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa2c5('0x17'))['db'];function respondWithStatusCode(_0x10b9b4,_0x27815e){_0x27815e=_0x27815e||0xcc;return function(_0xa75507){if(_0xa75507){return _0x10b9b4[_0xa2c5('0x18')](_0x27815e);}return _0x10b9b4[_0xa2c5('0x19')](_0x27815e)[_0xa2c5('0x1a')]();};}function respondWithResult(_0x4197c1,_0x28093b){_0x28093b=_0x28093b||0xc8;return function(_0x46041e){if(_0x46041e){return _0x4197c1['status'](_0x28093b)[_0xa2c5('0x1b')](_0x46041e);}};}function respondWithFilteredResult(_0x16b330,_0x30822d){return function(_0x29591c){if(_0x29591c){var _0x2ef449=typeof _0x30822d[_0xa2c5('0x1c')]===_0xa2c5('0x1d')&&typeof _0x30822d[_0xa2c5('0x1e')]===_0xa2c5('0x1d');var _0x4a81d4=_0x29591c[_0xa2c5('0x1f')];var _0x3fec1d=_0x2ef449?0x0:_0x30822d['offset'];var _0x3d7eba=_0x2ef449?_0x29591c[_0xa2c5('0x1f')]:_0x30822d[_0xa2c5('0x1c')]+_0x30822d[_0xa2c5('0x1e')];var _0x11bd40;if(_0x3d7eba>=_0x4a81d4){_0x3d7eba=_0x4a81d4;_0x11bd40=0xc8;}else{_0x11bd40=0xce;}_0x16b330[_0xa2c5('0x19')](_0x11bd40);return _0x16b330[_0xa2c5('0x20')](_0xa2c5('0x21'),_0x3fec1d+'-'+_0x3d7eba+'/'+_0x4a81d4)[_0xa2c5('0x1b')](_0x29591c);}return null;};}function patchUpdates(_0x56baae){return function(_0x51d810){try{jsonpatch[_0xa2c5('0x22')](_0x51d810,_0x56baae,!![]);}catch(_0x2e34eb){return BPromise[_0xa2c5('0x23')](_0x2e34eb);}return _0x51d810[_0xa2c5('0x24')]();};}function saveUpdates(_0xc6ec90,_0x39a78d){return function(_0x3282ac){if(_0x3282ac){return _0x3282ac['update'](_0xc6ec90)[_0xa2c5('0x25')](function(_0x38e899){return _0x38e899;});}return null;};}function removeEntity(_0x4e8b85,_0x3214fd){return function(_0x5cca53){if(_0x5cca53){return _0x5cca53[_0xa2c5('0x26')]()[_0xa2c5('0x25')](function(){_0x4e8b85[_0xa2c5('0x19')](0xcc)[_0xa2c5('0x1a')]();});}};}function handleEntityNotFound(_0x326bfd,_0x57a7df){return function(_0x13f4aa){if(!_0x13f4aa){_0x326bfd['sendStatus'](0x194);}return _0x13f4aa;};}function handleError(_0x1f3738,_0xc460c5){_0xc460c5=_0xc460c5||0x1f4;return function(_0x8398c9){logger['error'](_0x8398c9[_0xa2c5('0x27')]);if(_0x8398c9[_0xa2c5('0x28')]){delete _0x8398c9[_0xa2c5('0x28')];}_0x1f3738['status'](_0xc460c5)[_0xa2c5('0x29')](_0x8398c9);};}exports['index']=function(_0x4a2d45,_0x576a19){var _0x54225f={},_0x76bfe4={},_0x457a77={'count':0x0,'rows':[]};var _0x58851e=_[_0xa2c5('0x2a')](db[_0xa2c5('0x2b')][_0xa2c5('0x2c')],function(_0xb9e253){return{'name':_0xb9e253[_0xa2c5('0x2d')],'type':_0xb9e253['type'][_0xa2c5('0x2e')]};});_0x76bfe4[_0xa2c5('0x2f')]=_[_0xa2c5('0x2a')](_0x58851e,_0xa2c5('0x28'));_0x76bfe4['query']=_[_0xa2c5('0x30')](_0x4a2d45['query']);_0x76bfe4[_0xa2c5('0x31')]=_[_0xa2c5('0x32')](_0x76bfe4[_0xa2c5('0x2f')],_0x76bfe4[_0xa2c5('0x33')]);_0x54225f[_0xa2c5('0x34')]=_[_0xa2c5('0x32')](_0x76bfe4[_0xa2c5('0x2f')],qs[_0xa2c5('0x35')](_0x4a2d45[_0xa2c5('0x33')]['fields']));_0x54225f[_0xa2c5('0x34')]=_0x54225f[_0xa2c5('0x34')]['length']?_0x54225f[_0xa2c5('0x34')]:_0x76bfe4[_0xa2c5('0x2f')];if(!_0x4a2d45[_0xa2c5('0x33')]['hasOwnProperty'](_0xa2c5('0x36'))){_0x54225f['limit']=qs[_0xa2c5('0x1e')](_0x4a2d45['query'][_0xa2c5('0x1e')]);_0x54225f['offset']=qs[_0xa2c5('0x1c')](_0x4a2d45['query'][_0xa2c5('0x1c')]);}_0x54225f[_0xa2c5('0x37')]=qs[_0xa2c5('0x38')](_0x4a2d45[_0xa2c5('0x33')][_0xa2c5('0x38')]);_0x54225f['where']=qs[_0xa2c5('0x31')](_[_0xa2c5('0x39')](_0x4a2d45[_0xa2c5('0x33')],_0x76bfe4[_0xa2c5('0x31')]),_0x58851e);if(_0x4a2d45[_0xa2c5('0x33')][_0xa2c5('0x3a')]){_0x54225f['where']=_['merge'](_0x54225f['where'],{'$or':_[_0xa2c5('0x2a')](_0x58851e,function(_0x20a10f){if(_0x20a10f[_0xa2c5('0x3b')]!==_0xa2c5('0x3c')){var _0x411a3c={};_0x411a3c[_0x20a10f[_0xa2c5('0x28')]]={'$like':'%'+_0x4a2d45[_0xa2c5('0x33')]['filter']+'%'};return _0x411a3c;}})});}_0x54225f=_[_0xa2c5('0x3d')]({},_0x54225f,_0x4a2d45[_0xa2c5('0x3e')]);var _0x1aa712={'where':_0x54225f[_0xa2c5('0x3f')]};return db[_0xa2c5('0x2b')][_0xa2c5('0x1f')](_0x1aa712)[_0xa2c5('0x25')](function(_0x952df3){_0x457a77[_0xa2c5('0x1f')]=_0x952df3;if(_0x4a2d45[_0xa2c5('0x33')][_0xa2c5('0x40')]){_0x54225f[_0xa2c5('0x41')]=[{'all':!![]}];}return db[_0xa2c5('0x2b')]['findAll'](_0x54225f);})['then'](function(_0x594e1a){_0x457a77[_0xa2c5('0x42')]=_0x594e1a;return _0x457a77;})[_0xa2c5('0x25')](respondWithFilteredResult(_0x576a19,_0x54225f))[_0xa2c5('0x43')](handleError(_0x576a19,null));};exports['show']=function(_0x32818b,_0x2ac98d){var _0x1bf14f={'raw':!![],'where':{'id':_0x32818b[_0xa2c5('0x44')]['id']}},_0x26ad74={};_0x26ad74['model']=_['keys'](db[_0xa2c5('0x2b')][_0xa2c5('0x2c')]);_0x26ad74[_0xa2c5('0x33')]=_[_0xa2c5('0x30')](_0x32818b['query']);_0x26ad74[_0xa2c5('0x31')]=_[_0xa2c5('0x32')](_0x26ad74[_0xa2c5('0x2f')],_0x26ad74[_0xa2c5('0x33')]);_0x1bf14f[_0xa2c5('0x34')]=_[_0xa2c5('0x32')](_0x26ad74[_0xa2c5('0x2f')],qs[_0xa2c5('0x35')](_0x32818b[_0xa2c5('0x33')]['fields']));_0x1bf14f['attributes']=_0x1bf14f[_0xa2c5('0x34')]['length']?_0x1bf14f[_0xa2c5('0x34')]:_0x26ad74['model'];if(_0x32818b[_0xa2c5('0x33')][_0xa2c5('0x40')]){_0x1bf14f[_0xa2c5('0x41')]=[{'all':!![]}];}_0x1bf14f=_['merge']({},_0x1bf14f,_0x32818b[_0xa2c5('0x3e')]);return db[_0xa2c5('0x2b')]['find'](_0x1bf14f)[_0xa2c5('0x25')](handleEntityNotFound(_0x2ac98d,null))[_0xa2c5('0x25')](respondWithResult(_0x2ac98d,null))[_0xa2c5('0x43')](handleError(_0x2ac98d,null));};exports[_0xa2c5('0x45')]=function(_0x452b86,_0x243193){return db[_0xa2c5('0x2b')]['create'](_0x452b86[_0xa2c5('0x46')],{})[_0xa2c5('0x25')](respondWithResult(_0x243193,0xc9))['catch'](handleError(_0x243193,null));};exports['update']=function(_0x141924,_0x5035d9){if(_0x141924[_0xa2c5('0x46')]['id']){delete _0x141924[_0xa2c5('0x46')]['id'];}return db[_0xa2c5('0x2b')][_0xa2c5('0x47')]({'where':{'id':_0x141924[_0xa2c5('0x44')]['id']}})[_0xa2c5('0x25')](handleEntityNotFound(_0x5035d9,null))[_0xa2c5('0x25')](saveUpdates(_0x141924['body'],null))[_0xa2c5('0x25')](respondWithResult(_0x5035d9,null))['catch'](handleError(_0x5035d9,null));};exports[_0xa2c5('0x26')]=function(_0x5d153f,_0x50e44f){return db[_0xa2c5('0x2b')][_0xa2c5('0x47')]({'where':{'id':_0x5d153f[_0xa2c5('0x44')]['id']}})['then'](handleEntityNotFound(_0x50e44f,null))[_0xa2c5('0x25')](removeEntity(_0x50e44f,null))['catch'](handleError(_0x50e44f,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 01b2632..19cb50f 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 _0xd290=['./intFreshsalesField.attributes','define','FreshsalesField','int_freshsales_fields','idField','FieldId','lodash','util','api','request-promise','path','rimraf','../../config/environment'];(function(_0x409002,_0xcfb56){var _0x49bbd9=function(_0xfccbfc){while(--_0xfccbfc){_0x409002['push'](_0x409002['shift']());}};_0x49bbd9(++_0xcfb56);}(_0xd290,0x165));var _0x0d29=function(_0x57c5a4,_0x11541d){_0x57c5a4=_0x57c5a4-0x0;var _0x5972df=_0xd290[_0x57c5a4];return _0x5972df;};'use strict';var _=require(_0x0d29('0x0'));var util=require(_0x0d29('0x1'));var logger=require('../../config/logger')(_0x0d29('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0d29('0x3'));var fs=require('fs');var path=require(_0x0d29('0x4'));var rimraf=require(_0x0d29('0x5'));var config=require(_0x0d29('0x6'));var attributes=require(_0x0d29('0x7'));module['exports']=function(_0x1d806d,_0x25857b){return _0x1d806d[_0x0d29('0x8')](_0x0d29('0x9'),attributes,{'tableName':_0x0d29('0xa'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0x0d29('0xb'),_0x0d29('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2ff5=['../../config/environment','exports','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x548c92,_0x1131c2){var _0xb70b16=function(_0x5f328a){while(--_0x5f328a){_0x548c92['push'](_0x548c92['shift']());}};_0xb70b16(++_0x1131c2);}(_0x2ff5,0x1d5));var _0x52ff=function(_0x4eaa87,_0x51d135){_0x4eaa87=_0x4eaa87-0x0;var _0x104466=_0x2ff5[_0x4eaa87];return _0x104466;};'use strict';var _=require('lodash');var util=require(_0x52ff('0x0'));var logger=require(_0x52ff('0x1'))('api');var moment=require(_0x52ff('0x2'));var BPromise=require(_0x52ff('0x3'));var rp=require(_0x52ff('0x4'));var fs=require('fs');var path=require(_0x52ff('0x5'));var rimraf=require(_0x52ff('0x6'));var config=require(_0x52ff('0x7'));var attributes=require('./intFreshsalesField.attributes');module[_0x52ff('0x8')]=function(_0x285f60,_0x26906c){return _0x285f60['define'](_0x52ff('0x9'),attributes,{'tableName':_0x52ff('0xa'),'paranoid':![],'indexes':[{'name':_0x52ff('0xb'),'fields':[_0x52ff('0xc'),_0x52ff('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index 13f32ad..671a5ee 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 _0x5d17=['request','info','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesField,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x1acdd9,_0x4be278){var _0x2058c4=function(_0x1bc472){while(--_0x1bc472){_0x1acdd9['push'](_0x1acdd9['shift']());}};_0x2058c4(++_0x4be278);}(_0x5d17,0x114));var _0x75d1=function(_0x404cde,_0x27b51c){_0x404cde=_0x404cde-0x0;var _0x139882=_0x5d17[_0x404cde];return _0x139882;};'use strict';var _=require(_0x75d1('0x0'));var util=require(_0x75d1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x75d1('0x2'));var fs=require('fs');var Redis=require(_0x75d1('0x3'));var db=require(_0x75d1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x75d1('0x5'))(_0x75d1('0x6'));var config=require(_0x75d1('0x7'));var jayson=require(_0x75d1('0x8'));var client=jayson['client'][_0x75d1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x116a51,_0x5c957a,_0x1ee61b){return new BPromise(function(_0x3a9d5e,_0x105607){return client[_0x75d1('0xa')](_0x116a51,_0x1ee61b)['then'](function(_0x4cf632){logger[_0x75d1('0xb')]('FreshsalesField,\x20%s,\x20%s',_0x5c957a,'request\x20sent');logger[_0x75d1('0xc')](_0x75d1('0xd'),_0x5c957a,'request\x20sent',JSON[_0x75d1('0xe')](_0x4cf632));if(_0x4cf632[_0x75d1('0xf')]){if(_0x4cf632[_0x75d1('0xf')][_0x75d1('0x10')]===0x1f4){logger[_0x75d1('0xf')](_0x75d1('0x11'),_0x5c957a,_0x4cf632['error'][_0x75d1('0x12')]);return _0x105607(_0x4cf632[_0x75d1('0xf')][_0x75d1('0x12')]);}logger[_0x75d1('0xf')]('FreshsalesField,\x20%s,\x20%s',_0x5c957a,_0x4cf632['error']['message']);return _0x3a9d5e(_0x4cf632[_0x75d1('0xf')][_0x75d1('0x12')]);}else{logger[_0x75d1('0xb')]('FreshsalesField,\x20%s,\x20%s',_0x5c957a,_0x75d1('0x13'));_0x3a9d5e(_0x4cf632[_0x75d1('0x14')][_0x75d1('0x12')]);}})[_0x75d1('0x15')](function(_0x1160ca){logger[_0x75d1('0xf')](_0x75d1('0x11'),_0x5c957a,_0x1160ca);_0x105607(_0x1160ca);});});} \ No newline at end of file +var _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','FreshsalesField,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xb65e77,_0x238c3d){var _0x38134b=function(_0x39da21){while(--_0x39da21){_0xb65e77['push'](_0xb65e77['shift']());}};_0x38134b(++_0x238c3d);}(_0xf494,0x1c6));var _0x4f49=function(_0x256d13,_0x26aad7){_0x256d13=_0x256d13-0x0;var _0x5ac292=_0xf494[_0x256d13];return _0x5ac292;};'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/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index ee6dae9..719586b 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x50dfe9,_0x39eb00){var _0x2fb05f=function(_0x7609c3){while(--_0x7609c3){_0x50dfe9['push'](_0x50dfe9['shift']());}};_0x2fb05f(++_0x39eb00);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x1e0b51,_0x510d35){var _0x2494cf=function(_0x51577f){while(--_0x51577f){_0x1e0b51['push'](_0x1e0b51['shift']());}};_0x2494cf(++_0x510d35);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 8ca478f..0f39750 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 _0x151b=['integrationTab','newTab','sequelize','exports','STRING','username'];(function(_0x56dce3,_0x4f2bbc){var _0x80ff4a=function(_0x55cfd1){while(--_0x55cfd1){_0x56dce3['push'](_0x56dce3['shift']());}};_0x80ff4a(++_0x4f2bbc);}(_0x151b,0x152));var _0xb151=function(_0x53227d,_0x229847){_0x53227d=_0x53227d-0x0;var _0x4bde4a=_0x151b[_0x53227d];return _0x4bde4a;};'use strict';var Sequelize=require(_0xb151('0x0'));module[_0xb151('0x1')]={'name':{'type':Sequelize[_0xb151('0x2')]},'description':{'type':Sequelize[_0xb151('0x2')]},'username':{'type':Sequelize[_0xb151('0x2')],'unique':_0xb151('0x3')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xb151('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xb151('0x2')]},'securityToken':{'type':Sequelize[_0xb151('0x2')]},'serverUrl':{'type':Sequelize[_0xb151('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xb151('0x4'),_0xb151('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xef0f=['sequelize','STRING','ENUM','integrationTab','newTab'];(function(_0xdbd4f7,_0x4e3bdd){var _0x5c3f9d=function(_0xa7a35a){while(--_0xa7a35a){_0xdbd4f7['push'](_0xdbd4f7['shift']());}};_0x5c3f9d(++_0x4e3bdd);}(_0xef0f,0x168));var _0xfef0=function(_0x2c87d0,_0x59f96f){_0x2c87d0=_0x2c87d0-0x0;var _0x322321=_0xef0f[_0x2c87d0];return _0x322321;};'use strict';var Sequelize=require(_0xfef0('0x0'));module['exports']={'name':{'type':Sequelize[_0xfef0('0x1')]},'description':{'type':Sequelize[_0xfef0('0x1')]},'username':{'type':Sequelize[_0xfef0('0x1')],'unique':'username'},'remoteUri':{'type':Sequelize[_0xfef0('0x1')]},'password':{'type':Sequelize[_0xfef0('0x1')]},'clientId':{'type':Sequelize[_0xfef0('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0xfef0('0x1')]},'serverUrl':{'type':Sequelize[_0xfef0('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xfef0('0x2')](_0xfef0('0x3'),_0xfef0('0x4')),'defaultValue':_0xfef0('0x3')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index b865e18..3add722 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 _0xeba6=['remoteUri','lastIndexOf','Connection','login','username','concat','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Description','string','picklist','boolean','textarea','remove','includes','label','custom','value','True','true','False','false','test','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','statusCode','eml-format','zip-dir','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','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','save','update','destroy','then','error','stack','name','index','SalesforceAccount','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','getConfigurations','SalesforceConfiguration','order','addConfiguration','findOne','AccountId','getSubjects','channel','Descriptions','Subjects','SalesforceField','getFields','Task','clientId','clientSecret','password','securityToken'];(function(_0x3640e2,_0x562103){var _0x277415=function(_0x1b2c89){while(--_0x1b2c89){_0x3640e2['push'](_0x3640e2['shift']());}};_0x277415(++_0x562103);}(_0xeba6,0x19c));var _0x6eba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xeba6[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x6eba('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6eba('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6eba('0x2'));var BPromise=require(_0x6eba('0x3'));var Mustache=require(_0x6eba('0x4'));var util=require('util');var path=require(_0x6eba('0x5'));var sox=require('sox');var csv=require(_0x6eba('0x6'));var ejs=require(_0x6eba('0x7'));var fs=require('fs');var fs_extra=require(_0x6eba('0x8'));var _=require(_0x6eba('0x9'));var squel=require(_0x6eba('0xa'));var crypto=require(_0x6eba('0xb'));var jsforce=require(_0x6eba('0xc'));var deskjs=require(_0x6eba('0xd'));var toCsv=require(_0x6eba('0x6'));var querystring=require(_0x6eba('0xe'));var Papa=require('papaparse');var Redis=require(_0x6eba('0xf'));var authService=require(_0x6eba('0x10'));var qs=require(_0x6eba('0x11'));var as=require(_0x6eba('0x12'));var hardwareService=require(_0x6eba('0x13'));var logger=require('../../config/logger')(_0x6eba('0x14'));var utils=require(_0x6eba('0x15'));var config=require(_0x6eba('0x16'));var licenseUtil=require(_0x6eba('0x17'));var db=require(_0x6eba('0x18'))['db'];var integrations=require(_0x6eba('0x19'));function respondWithStatusCode(_0x3384b3,_0x47088e){_0x47088e=_0x47088e||0xcc;return function(_0x2a6ecc){if(_0x2a6ecc){return _0x3384b3[_0x6eba('0x1a')](_0x47088e);}return _0x3384b3[_0x6eba('0x1b')](_0x47088e)[_0x6eba('0x1c')]();};}function respondWithResult(_0x220caf,_0x31a09e){_0x31a09e=_0x31a09e||0xc8;return function(_0x2127f1){if(_0x2127f1){return _0x220caf[_0x6eba('0x1b')](_0x31a09e)[_0x6eba('0x1d')](_0x2127f1);}};}function respondWithFilteredResult(_0x28cfc9,_0x2968ba){return function(_0x3a37cc){if(_0x3a37cc){var _0x50f502=typeof _0x2968ba[_0x6eba('0x1e')]===_0x6eba('0x1f')&&typeof _0x2968ba[_0x6eba('0x20')]===_0x6eba('0x1f');var _0x15d3c3=_0x3a37cc[_0x6eba('0x21')];var _0x1c4747=_0x50f502?0x0:_0x2968ba[_0x6eba('0x1e')];var _0x1769f4=_0x50f502?_0x3a37cc[_0x6eba('0x21')]:_0x2968ba[_0x6eba('0x1e')]+_0x2968ba['limit'];var _0x401e23;if(_0x1769f4>=_0x15d3c3){_0x1769f4=_0x15d3c3;_0x401e23=0xc8;}else{_0x401e23=0xce;}_0x28cfc9[_0x6eba('0x1b')](_0x401e23);return _0x28cfc9[_0x6eba('0x22')](_0x6eba('0x23'),_0x1c4747+'-'+_0x1769f4+'/'+_0x15d3c3)[_0x6eba('0x1d')](_0x3a37cc);}return null;};}function patchUpdates(_0x48be17){return function(_0x384a31){try{jsonpatch[_0x6eba('0x24')](_0x384a31,_0x48be17,!![]);}catch(_0x3033c6){return BPromise[_0x6eba('0x25')](_0x3033c6);}return _0x384a31[_0x6eba('0x26')]();};}function saveUpdates(_0xce9f2,_0x437f1d){return function(_0x4622eb){if(_0x4622eb){return _0x4622eb[_0x6eba('0x27')](_0xce9f2)['then'](function(_0x37d392){return _0x37d392;});}return null;};}function removeEntity(_0x5df1f1,_0x317bcc){return function(_0x49d3db){if(_0x49d3db){return _0x49d3db[_0x6eba('0x28')]()[_0x6eba('0x29')](function(){_0x5df1f1[_0x6eba('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e66de,_0xb52bd){return function(_0x3a41c9){if(!_0x3a41c9){_0x3e66de[_0x6eba('0x1a')](0x194);}return _0x3a41c9;};}function handleError(_0x1ad1a1,_0x3cb050){_0x3cb050=_0x3cb050||0x1f4;return function(_0x3d5981){logger[_0x6eba('0x2a')](_0x3d5981[_0x6eba('0x2b')]);if(_0x3d5981[_0x6eba('0x2c')]){delete _0x3d5981[_0x6eba('0x2c')];}_0x1ad1a1[_0x6eba('0x1b')](_0x3cb050)['send'](_0x3d5981);};}exports[_0x6eba('0x2d')]=function(_0x134682,_0x30cbde){var _0x5d81ef={},_0x17bc02={},_0x30f980={'count':0x0,'rows':[]};var _0x3989de=_['map'](db[_0x6eba('0x2e')][_0x6eba('0x2f')],function(_0x5b7673){return{'name':_0x5b7673[_0x6eba('0x30')],'type':_0x5b7673[_0x6eba('0x31')][_0x6eba('0x32')]};});_0x17bc02[_0x6eba('0x33')]=_[_0x6eba('0x34')](_0x3989de,_0x6eba('0x2c'));_0x17bc02[_0x6eba('0x35')]=_['keys'](_0x134682[_0x6eba('0x35')]);_0x17bc02[_0x6eba('0x36')]=_[_0x6eba('0x37')](_0x17bc02['model'],_0x17bc02[_0x6eba('0x35')]);_0x5d81ef['attributes']=_['intersection'](_0x17bc02[_0x6eba('0x33')],qs[_0x6eba('0x38')](_0x134682[_0x6eba('0x35')][_0x6eba('0x38')]));_0x5d81ef[_0x6eba('0x39')]=_0x5d81ef['attributes'][_0x6eba('0x3a')]?_0x5d81ef[_0x6eba('0x39')]:_0x17bc02[_0x6eba('0x33')];if(!_0x134682['query'][_0x6eba('0x3b')](_0x6eba('0x3c'))){_0x5d81ef[_0x6eba('0x20')]=qs['limit'](_0x134682['query'][_0x6eba('0x20')]);_0x5d81ef[_0x6eba('0x1e')]=qs[_0x6eba('0x1e')](_0x134682[_0x6eba('0x35')]['offset']);}_0x5d81ef['order']=qs[_0x6eba('0x3d')](_0x134682['query'][_0x6eba('0x3d')]);_0x5d81ef[_0x6eba('0x3e')]=qs[_0x6eba('0x36')](_[_0x6eba('0x3f')](_0x134682[_0x6eba('0x35')],_0x17bc02['filters']),_0x3989de);if(_0x134682['query'][_0x6eba('0x40')]){_0x5d81ef[_0x6eba('0x3e')]=_[_0x6eba('0x41')](_0x5d81ef['where'],{'$or':_[_0x6eba('0x34')](_0x3989de,function(_0x24dc28){if(_0x24dc28[_0x6eba('0x31')]!==_0x6eba('0x42')){var _0x3b98a4={};_0x3b98a4[_0x24dc28['name']]={'$like':'%'+_0x134682[_0x6eba('0x35')][_0x6eba('0x40')]+'%'};return _0x3b98a4;}})});}_0x5d81ef=_[_0x6eba('0x41')]({},_0x5d81ef,_0x134682[_0x6eba('0x43')]);var _0x451946={'where':_0x5d81ef[_0x6eba('0x3e')]};return db['SalesforceAccount'][_0x6eba('0x21')](_0x451946)[_0x6eba('0x29')](function(_0x3ddf85){_0x30f980[_0x6eba('0x21')]=_0x3ddf85;if(_0x134682['query'][_0x6eba('0x44')]){_0x5d81ef[_0x6eba('0x45')]=[{'all':!![]}];}return db['SalesforceAccount'][_0x6eba('0x46')](_0x5d81ef);})['then'](function(_0x5d7e96){_0x30f980[_0x6eba('0x47')]=_0x5d7e96;return _0x30f980;})[_0x6eba('0x29')](respondWithFilteredResult(_0x30cbde,_0x5d81ef))['catch'](handleError(_0x30cbde,null));};exports[_0x6eba('0x48')]=function(_0x3a0f6d,_0x450e39){var _0x52fa84={'raw':![],'where':{'id':_0x3a0f6d[_0x6eba('0x49')]['id']}},_0x30ffd6={};_0x30ffd6['model']=_['keys'](db[_0x6eba('0x2e')][_0x6eba('0x2f')]);_0x30ffd6[_0x6eba('0x35')]=_[_0x6eba('0x4a')](_0x3a0f6d[_0x6eba('0x35')]);_0x30ffd6['filters']=_[_0x6eba('0x37')](_0x30ffd6['model'],_0x30ffd6[_0x6eba('0x35')]);_0x52fa84[_0x6eba('0x39')]=_[_0x6eba('0x37')](_0x30ffd6[_0x6eba('0x33')],qs[_0x6eba('0x38')](_0x3a0f6d['query'][_0x6eba('0x38')]));_0x52fa84[_0x6eba('0x39')]=_0x52fa84[_0x6eba('0x39')]['length']?_0x52fa84[_0x6eba('0x39')]:_0x30ffd6[_0x6eba('0x33')];if(_0x3a0f6d[_0x6eba('0x35')][_0x6eba('0x44')]){_0x52fa84[_0x6eba('0x45')]=[{'all':!![]}];}_0x52fa84=_[_0x6eba('0x41')]({},_0x52fa84,_0x3a0f6d[_0x6eba('0x43')]);return db[_0x6eba('0x2e')][_0x6eba('0x4b')](_0x52fa84)[_0x6eba('0x29')](handleEntityNotFound(_0x450e39,null))['then'](respondWithResult(_0x450e39,null))[_0x6eba('0x4c')](handleError(_0x450e39,null));};exports['create']=function(_0x510400,_0x312c8f){return db['SalesforceAccount'][_0x6eba('0x4d')](_0x510400['body'],{})[_0x6eba('0x29')](respondWithResult(_0x312c8f,0xc9))['catch'](handleError(_0x312c8f,null));};exports[_0x6eba('0x27')]=function(_0x36cdc5,_0x522ca2){if(_0x36cdc5[_0x6eba('0x4e')]['id']){delete _0x36cdc5[_0x6eba('0x4e')]['id'];}return db[_0x6eba('0x2e')][_0x6eba('0x4b')]({'where':{'id':_0x36cdc5[_0x6eba('0x49')]['id']}})[_0x6eba('0x29')](handleEntityNotFound(_0x522ca2,null))['then'](saveUpdates(_0x36cdc5[_0x6eba('0x4e')],null))[_0x6eba('0x29')](respondWithResult(_0x522ca2,null))[_0x6eba('0x4c')](handleError(_0x522ca2,null));};exports[_0x6eba('0x28')]=function(_0x490136,_0x5f5511){return db[_0x6eba('0x2e')][_0x6eba('0x4b')]({'where':{'id':_0x490136[_0x6eba('0x49')]['id']}})[_0x6eba('0x29')](handleEntityNotFound(_0x5f5511,null))['then'](removeEntity(_0x5f5511,null))[_0x6eba('0x4c')](handleError(_0x5f5511,null));};exports[_0x6eba('0x4f')]=function(_0x3a856a,_0x28a87e,_0x2b0db0){var _0x4d68d0={};var _0x142eec={};var _0x29f3df;var _0x33e185;return db[_0x6eba('0x2e')]['findOne']({'where':{'id':_0x3a856a[_0x6eba('0x49')]['id']}})[_0x6eba('0x29')](handleEntityNotFound(_0x28a87e,null))[_0x6eba('0x29')](function(_0x28c1ed){if(_0x28c1ed){_0x29f3df=_0x28c1ed;_0x142eec[_0x6eba('0x33')]=_[_0x6eba('0x4a')](db[_0x6eba('0x50')][_0x6eba('0x2f')]);_0x142eec[_0x6eba('0x35')]=_['keys'](_0x3a856a[_0x6eba('0x35')]);_0x142eec['filters']=_[_0x6eba('0x37')](_0x142eec[_0x6eba('0x33')],_0x142eec['query']);_0x4d68d0[_0x6eba('0x39')]=_[_0x6eba('0x37')](_0x142eec['model'],qs['fields'](_0x3a856a[_0x6eba('0x35')][_0x6eba('0x38')]));_0x4d68d0[_0x6eba('0x39')]=_0x4d68d0['attributes'][_0x6eba('0x3a')]?_0x4d68d0[_0x6eba('0x39')]:_0x142eec[_0x6eba('0x33')];_0x4d68d0[_0x6eba('0x51')]=qs['sort'](_0x3a856a[_0x6eba('0x35')][_0x6eba('0x3d')]);_0x4d68d0[_0x6eba('0x3e')]=qs[_0x6eba('0x36')](_[_0x6eba('0x3f')](_0x3a856a['query'],_0x142eec[_0x6eba('0x36')]));if(_0x3a856a[_0x6eba('0x35')][_0x6eba('0x40')]){_0x4d68d0['where']=_['merge'](_0x4d68d0[_0x6eba('0x3e')],{'$or':_[_0x6eba('0x34')](_0x4d68d0[_0x6eba('0x39')],function(_0x18ad83){var _0x14bf4c={};_0x14bf4c[_0x18ad83]={'$like':'%'+_0x3a856a[_0x6eba('0x35')][_0x6eba('0x40')]+'%'};return _0x14bf4c;})});}_0x4d68d0=_['merge']({},_0x4d68d0,_0x3a856a[_0x6eba('0x43')]);return _0x29f3df[_0x6eba('0x4f')](_0x4d68d0);}})[_0x6eba('0x29')](function(_0x561b60){if(_0x561b60){_0x33e185=_0x561b60[_0x6eba('0x3a')];if(!_0x3a856a[_0x6eba('0x35')][_0x6eba('0x3b')](_0x6eba('0x3c'))){_0x4d68d0[_0x6eba('0x20')]=qs['limit'](_0x3a856a['query'][_0x6eba('0x20')]);_0x4d68d0['offset']=qs[_0x6eba('0x1e')](_0x3a856a['query'][_0x6eba('0x1e')]);}return _0x29f3df[_0x6eba('0x4f')](_0x4d68d0);}})[_0x6eba('0x29')](function(_0x45b527){if(_0x45b527){return _0x45b527?{'count':_0x33e185,'rows':_0x45b527}:null;}})['then'](respondWithResult(_0x28a87e,null))['catch'](handleError(_0x28a87e,null));};exports[_0x6eba('0x52')]=function(_0x36bc82,_0xc9cf51,_0x55746c){if(_0x36bc82[_0x6eba('0x4e')]['id']){delete _0x36bc82['body']['id'];}return db[_0x6eba('0x2e')][_0x6eba('0x53')]({'where':{'id':_0x36bc82[_0x6eba('0x49')]['id']}})[_0x6eba('0x29')](handleEntityNotFound(_0xc9cf51,null))['then'](function(_0x476e4){if(_0x476e4){_0x36bc82['body'][_0x6eba('0x54')]=_0x476e4['id'];_0x36bc82['body']['Subjects']=integrations[_0x6eba('0x55')](_0x36bc82[_0x6eba('0x4e')][_0x6eba('0x56')],_0x36bc82[_0x6eba('0x4e')][_0x6eba('0x31')]);_0x36bc82[_0x6eba('0x4e')][_0x6eba('0x57')]=integrations['getDescriptions'](_0x36bc82[_0x6eba('0x4e')][_0x6eba('0x56')],_0x36bc82[_0x6eba('0x4e')][_0x6eba('0x31')]);return db['SalesforceConfiguration'][_0x6eba('0x4d')](_0x36bc82['body'],{'include':[{'model':db['SalesforceField'],'as':_0x6eba('0x58')},{'model':db[_0x6eba('0x59')],'as':_0x6eba('0x57')}]});}return null;})[_0x6eba('0x29')](respondWithResult(_0xc9cf51,null))['catch'](handleError(_0xc9cf51,null));};exports[_0x6eba('0x5a')]=function(_0x995ecc,_0xddee53,_0x3f1b3b){var _0x29ff83;var _0x136ed4='';var _0x3f10b5=_0x6eba('0x5b');return db[_0x6eba('0x2e')][_0x6eba('0x53')]({'where':{'id':_0x995ecc[_0x6eba('0x49')]['id']},'attributes':['id','remoteUri',_0x6eba('0x5c'),_0x6eba('0x5d'),'username',_0x6eba('0x5e'),_0x6eba('0x5f')]})['then'](handleEntityNotFound(_0xddee53,null))[_0x6eba('0x29')](function(_0x5e734b){if(_0x5e734b){_0x136ed4=_0x5e734b[_0x6eba('0x60')];var _0x57948f=_0x136ed4['slice'](-0x1);if(_0x57948f==='/'){_0x136ed4=_0x136ed4['substring'](0x0,_0x136ed4[_0x6eba('0x61')](_0x57948f));}_0x29ff83=new jsforce[(_0x6eba('0x62'))]({'oauth2':{'loginUrl':_0x136ed4,'clientId':_0x5e734b[_0x6eba('0x5c')],'clientSecret':_0x5e734b[_0x6eba('0x5d')]}});return _0x29ff83[_0x6eba('0x63')](_0x5e734b[_0x6eba('0x64')],_0x5e734b[_0x6eba('0x5e')][_0x6eba('0x65')](_0x5e734b[_0x6eba('0x5f')]));}})['then'](function(_0x1072bb){if(_0x1072bb){if(!_['isNil'](_0x995ecc[_0x6eba('0x35')]['ticketType'])){_0x3f10b5=_0x995ecc['query']['ticketType'];}return _0x29ff83['sobject'](_0x3f10b5)[_0x6eba('0x66')]();}})[_0x6eba('0x29')](function(_0x15992e){var _0x42e3b3=[_0x6eba('0x67'),_0x6eba('0x68'),_0x6eba('0x69'),_0x6eba('0x6a'),'Subject',_0x6eba('0x6b')];var _0x3185cc=[_0x6eba('0x6c'),'int',_0x6eba('0x6d'),_0x6eba('0x6e'),'email',_0x6eba('0x6f'),'phone'];if(_0x15992e){_[_0x6eba('0x70')](_0x15992e['fields'],function(_0x18c077){return _0x42e3b3[_0x6eba('0x71')](_0x18c077[_0x6eba('0x2c')])||!_0x3185cc['includes'](_0x18c077['type']);});return{'count':_0x15992e[_0x6eba('0x38')][_0x6eba('0x3a')],'rows':_[_0x6eba('0x34')](_0x15992e[_0x6eba('0x38')],function(_0x899ebb){return{'id':_0x899ebb[_0x6eba('0x2c')],'name':_0x899ebb[_0x6eba('0x72')],'custom':_0x899ebb[_0x6eba('0x73')],'options':_0x899ebb['picklistValues'][_0x6eba('0x3a')]>0x0?_[_0x6eba('0x34')](_0x899ebb['picklistValues'],function(_0x1fbe4d){return{'name':_0x1fbe4d[_0x6eba('0x72')],'value':_0x1fbe4d[_0x6eba('0x74')]};}):_0x899ebb['type']==_0x6eba('0x6e')?[{'name':_0x6eba('0x75'),'value':_0x6eba('0x76')},{'name':_0x6eba('0x77'),'value':_0x6eba('0x78')}]:[]};})};}})[_0x6eba('0x29')](respondWithResult(_0xddee53,null))[_0x6eba('0x4c')](function(_0x241093){var _0x1ec84d=_0x995ecc['query'][_0x6eba('0x79')]?0x1f4:_0x241093['statusCode']||0x1f4;logger['error'](_0x6eba('0x7a'),_0x6eba('0x5a'),_0x1ec84d,JSON[_0x6eba('0x7b')](_0x241093));delete _0x241093['name'];if(_0x1ec84d===0x191){_0x1ec84d=0x190;}_0xddee53[_0x6eba('0x1b')](_0x1ec84d)[_0x6eba('0x7c')](_0x995ecc[_0x6eba('0x35')][_0x6eba('0x79')]?{'message':_0x6eba('0x7d'),'statusCode':_0x241093[_0x6eba('0x7e')]}:_0x241093);});}; \ No newline at end of file +var _0xbfc6=['json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','length','order','pick','filter','merge','where','options','findAll','rows','catch','show','params','fields','includeAll','include','find','create','body','getConfigurations','SalesforceConfiguration','sort','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','type','getDescriptions','channel','SalesforceField','Descriptions','getFields','Task','findOne','clientId','username','password','securityToken','remoteUri','slice','substring','lastIndexOf','Connection','clientSecret','login','isNil','ticketType','sobject','describe','IsReminderSet','IsRecurrence','Subject','Description','int','picklist','boolean','email','phone','remove','includes','custom','picklistValues','label','value','True','true','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status'];(function(_0x238671,_0x34aea0){var _0x474844=function(_0x26cab4){while(--_0x26cab4){_0x238671['push'](_0x238671['shift']());}};_0x474844(++_0x34aea0);}(_0xbfc6,0x1e0));var _0x6bfc=function(_0x19cb88,_0x16936f){_0x19cb88=_0x19cb88-0x0;var _0x42d4de=_0xbfc6[_0x19cb88];return _0x42d4de;};'use strict';var emlformat=require(_0x6bfc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6bfc('0x1'));var BPromise=require(_0x6bfc('0x2'));var Mustache=require(_0x6bfc('0x3'));var util=require('util');var path=require(_0x6bfc('0x4'));var sox=require(_0x6bfc('0x5'));var csv=require(_0x6bfc('0x6'));var ejs=require(_0x6bfc('0x7'));var fs=require('fs');var fs_extra=require(_0x6bfc('0x8'));var _=require(_0x6bfc('0x9'));var squel=require(_0x6bfc('0xa'));var crypto=require(_0x6bfc('0xb'));var jsforce=require(_0x6bfc('0xc'));var deskjs=require(_0x6bfc('0xd'));var toCsv=require(_0x6bfc('0x6'));var querystring=require(_0x6bfc('0xe'));var Papa=require(_0x6bfc('0xf'));var Redis=require('ioredis');var authService=require(_0x6bfc('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6bfc('0x11'));var hardwareService=require(_0x6bfc('0x12'));var logger=require('../../config/logger')(_0x6bfc('0x13'));var utils=require(_0x6bfc('0x14'));var config=require(_0x6bfc('0x15'));var licenseUtil=require(_0x6bfc('0x16'));var db=require(_0x6bfc('0x17'))['db'];var integrations=require(_0x6bfc('0x18'));function respondWithStatusCode(_0x38e008,_0x3cb656){_0x3cb656=_0x3cb656||0xcc;return function(_0x201742){if(_0x201742){return _0x38e008[_0x6bfc('0x19')](_0x3cb656);}return _0x38e008['status'](_0x3cb656)[_0x6bfc('0x1a')]();};}function respondWithResult(_0x555395,_0xe5b57f){_0xe5b57f=_0xe5b57f||0xc8;return function(_0x3efbb){if(_0x3efbb){return _0x555395[_0x6bfc('0x1b')](_0xe5b57f)[_0x6bfc('0x1c')](_0x3efbb);}};}function respondWithFilteredResult(_0x573f93,_0x21f512){return function(_0x3134af){if(_0x3134af){var _0x576754=typeof _0x21f512[_0x6bfc('0x1d')]==='undefined'&&typeof _0x21f512[_0x6bfc('0x1e')]===_0x6bfc('0x1f');var _0x3d8b7f=_0x3134af[_0x6bfc('0x20')];var _0x1d191b=_0x576754?0x0:_0x21f512[_0x6bfc('0x1d')];var _0x42d0fb=_0x576754?_0x3134af[_0x6bfc('0x20')]:_0x21f512['offset']+_0x21f512['limit'];var _0x21fb37;if(_0x42d0fb>=_0x3d8b7f){_0x42d0fb=_0x3d8b7f;_0x21fb37=0xc8;}else{_0x21fb37=0xce;}_0x573f93[_0x6bfc('0x1b')](_0x21fb37);return _0x573f93[_0x6bfc('0x21')](_0x6bfc('0x22'),_0x1d191b+'-'+_0x42d0fb+'/'+_0x3d8b7f)[_0x6bfc('0x1c')](_0x3134af);}return null;};}function patchUpdates(_0x42a6a2){return function(_0x349083){try{jsonpatch[_0x6bfc('0x23')](_0x349083,_0x42a6a2,!![]);}catch(_0x5b9a00){return BPromise[_0x6bfc('0x24')](_0x5b9a00);}return _0x349083[_0x6bfc('0x25')]();};}function saveUpdates(_0x4150c4,_0x2adba4){return function(_0xba7605){if(_0xba7605){return _0xba7605[_0x6bfc('0x26')](_0x4150c4)[_0x6bfc('0x27')](function(_0x13e084){return _0x13e084;});}return null;};}function removeEntity(_0x209b12,_0x10d7dc){return function(_0x24236e){if(_0x24236e){return _0x24236e[_0x6bfc('0x28')]()[_0x6bfc('0x27')](function(){_0x209b12[_0x6bfc('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x590cd8,_0x115e4){return function(_0x50fb25){if(!_0x50fb25){_0x590cd8[_0x6bfc('0x19')](0x194);}return _0x50fb25;};}function handleError(_0xcbf1aa,_0x4b267d){_0x4b267d=_0x4b267d||0x1f4;return function(_0x599839){logger[_0x6bfc('0x29')](_0x599839[_0x6bfc('0x2a')]);if(_0x599839['name']){delete _0x599839[_0x6bfc('0x2b')];}_0xcbf1aa[_0x6bfc('0x1b')](_0x4b267d)[_0x6bfc('0x2c')](_0x599839);};}exports[_0x6bfc('0x2d')]=function(_0x40c635,_0xbbcf94){var _0x222828={},_0x13bc1d={},_0x197ea7={'count':0x0,'rows':[]};var _0x3a1945=_[_0x6bfc('0x2e')](db[_0x6bfc('0x2f')][_0x6bfc('0x30')],function(_0xc0f9a2){return{'name':_0xc0f9a2[_0x6bfc('0x31')],'type':_0xc0f9a2['type'][_0x6bfc('0x32')]};});_0x13bc1d[_0x6bfc('0x33')]=_[_0x6bfc('0x2e')](_0x3a1945,_0x6bfc('0x2b'));_0x13bc1d[_0x6bfc('0x34')]=_[_0x6bfc('0x35')](_0x40c635['query']);_0x13bc1d[_0x6bfc('0x36')]=_[_0x6bfc('0x37')](_0x13bc1d[_0x6bfc('0x33')],_0x13bc1d[_0x6bfc('0x34')]);_0x222828[_0x6bfc('0x38')]=_[_0x6bfc('0x37')](_0x13bc1d['model'],qs['fields'](_0x40c635[_0x6bfc('0x34')]['fields']));_0x222828[_0x6bfc('0x38')]=_0x222828['attributes'][_0x6bfc('0x39')]?_0x222828['attributes']:_0x13bc1d[_0x6bfc('0x33')];if(!_0x40c635[_0x6bfc('0x34')]['hasOwnProperty']('nolimit')){_0x222828[_0x6bfc('0x1e')]=qs['limit'](_0x40c635[_0x6bfc('0x34')][_0x6bfc('0x1e')]);_0x222828[_0x6bfc('0x1d')]=qs[_0x6bfc('0x1d')](_0x40c635['query'][_0x6bfc('0x1d')]);}_0x222828[_0x6bfc('0x3a')]=qs['sort'](_0x40c635[_0x6bfc('0x34')]['sort']);_0x222828['where']=qs[_0x6bfc('0x36')](_[_0x6bfc('0x3b')](_0x40c635['query'],_0x13bc1d[_0x6bfc('0x36')]),_0x3a1945);if(_0x40c635[_0x6bfc('0x34')][_0x6bfc('0x3c')]){_0x222828['where']=_[_0x6bfc('0x3d')](_0x222828[_0x6bfc('0x3e')],{'$or':_[_0x6bfc('0x2e')](_0x3a1945,function(_0x590c44){if(_0x590c44['type']!=='VIRTUAL'){var _0x1ce407={};_0x1ce407[_0x590c44['name']]={'$like':'%'+_0x40c635[_0x6bfc('0x34')]['filter']+'%'};return _0x1ce407;}})});}_0x222828=_[_0x6bfc('0x3d')]({},_0x222828,_0x40c635[_0x6bfc('0x3f')]);var _0x16cde2={'where':_0x222828['where']};return db[_0x6bfc('0x2f')][_0x6bfc('0x20')](_0x16cde2)['then'](function(_0x5ff4d){_0x197ea7[_0x6bfc('0x20')]=_0x5ff4d;if(_0x40c635[_0x6bfc('0x34')]['includeAll']){_0x222828['include']=[{'all':!![]}];}return db[_0x6bfc('0x2f')][_0x6bfc('0x40')](_0x222828);})['then'](function(_0x127ba3){_0x197ea7[_0x6bfc('0x41')]=_0x127ba3;return _0x197ea7;})['then'](respondWithFilteredResult(_0xbbcf94,_0x222828))[_0x6bfc('0x42')](handleError(_0xbbcf94,null));};exports[_0x6bfc('0x43')]=function(_0x214892,_0x5af3e1){var _0x3a9231={'raw':![],'where':{'id':_0x214892[_0x6bfc('0x44')]['id']}},_0x4a7d97={};_0x4a7d97['model']=_['keys'](db['SalesforceAccount'][_0x6bfc('0x30')]);_0x4a7d97[_0x6bfc('0x34')]=_[_0x6bfc('0x35')](_0x214892[_0x6bfc('0x34')]);_0x4a7d97[_0x6bfc('0x36')]=_[_0x6bfc('0x37')](_0x4a7d97[_0x6bfc('0x33')],_0x4a7d97['query']);_0x3a9231['attributes']=_['intersection'](_0x4a7d97[_0x6bfc('0x33')],qs[_0x6bfc('0x45')](_0x214892['query'][_0x6bfc('0x45')]));_0x3a9231[_0x6bfc('0x38')]=_0x3a9231[_0x6bfc('0x38')][_0x6bfc('0x39')]?_0x3a9231[_0x6bfc('0x38')]:_0x4a7d97['model'];if(_0x214892[_0x6bfc('0x34')][_0x6bfc('0x46')]){_0x3a9231[_0x6bfc('0x47')]=[{'all':!![]}];}_0x3a9231=_['merge']({},_0x3a9231,_0x214892[_0x6bfc('0x3f')]);return db[_0x6bfc('0x2f')][_0x6bfc('0x48')](_0x3a9231)[_0x6bfc('0x27')](handleEntityNotFound(_0x5af3e1,null))['then'](respondWithResult(_0x5af3e1,null))[_0x6bfc('0x42')](handleError(_0x5af3e1,null));};exports[_0x6bfc('0x49')]=function(_0x5bf1af,_0x509a31){return db['SalesforceAccount'][_0x6bfc('0x49')](_0x5bf1af['body'],{})[_0x6bfc('0x27')](respondWithResult(_0x509a31,0xc9))[_0x6bfc('0x42')](handleError(_0x509a31,null));};exports['update']=function(_0x4eac89,_0x432c80){if(_0x4eac89['body']['id']){delete _0x4eac89[_0x6bfc('0x4a')]['id'];}return db[_0x6bfc('0x2f')]['find']({'where':{'id':_0x4eac89[_0x6bfc('0x44')]['id']}})[_0x6bfc('0x27')](handleEntityNotFound(_0x432c80,null))['then'](saveUpdates(_0x4eac89['body'],null))[_0x6bfc('0x27')](respondWithResult(_0x432c80,null))[_0x6bfc('0x42')](handleError(_0x432c80,null));};exports[_0x6bfc('0x28')]=function(_0x4af048,_0x7d91c0){return db[_0x6bfc('0x2f')]['find']({'where':{'id':_0x4af048[_0x6bfc('0x44')]['id']}})[_0x6bfc('0x27')](handleEntityNotFound(_0x7d91c0,null))[_0x6bfc('0x27')](removeEntity(_0x7d91c0,null))['catch'](handleError(_0x7d91c0,null));};exports[_0x6bfc('0x4b')]=function(_0x26e585,_0x46bcc4,_0x1e01a9){var _0x4af4c6={};var _0x15b809={};var _0x578200;var _0x13ea8f;return db[_0x6bfc('0x2f')]['findOne']({'where':{'id':_0x26e585['params']['id']}})['then'](handleEntityNotFound(_0x46bcc4,null))[_0x6bfc('0x27')](function(_0x349f79){if(_0x349f79){_0x578200=_0x349f79;_0x15b809[_0x6bfc('0x33')]=_['keys'](db[_0x6bfc('0x4c')][_0x6bfc('0x30')]);_0x15b809[_0x6bfc('0x34')]=_[_0x6bfc('0x35')](_0x26e585[_0x6bfc('0x34')]);_0x15b809[_0x6bfc('0x36')]=_[_0x6bfc('0x37')](_0x15b809[_0x6bfc('0x33')],_0x15b809['query']);_0x4af4c6[_0x6bfc('0x38')]=_[_0x6bfc('0x37')](_0x15b809[_0x6bfc('0x33')],qs['fields'](_0x26e585[_0x6bfc('0x34')][_0x6bfc('0x45')]));_0x4af4c6[_0x6bfc('0x38')]=_0x4af4c6[_0x6bfc('0x38')][_0x6bfc('0x39')]?_0x4af4c6[_0x6bfc('0x38')]:_0x15b809[_0x6bfc('0x33')];_0x4af4c6[_0x6bfc('0x3a')]=qs[_0x6bfc('0x4d')](_0x26e585[_0x6bfc('0x34')][_0x6bfc('0x4d')]);_0x4af4c6[_0x6bfc('0x3e')]=qs[_0x6bfc('0x36')](_['pick'](_0x26e585[_0x6bfc('0x34')],_0x15b809[_0x6bfc('0x36')]));if(_0x26e585[_0x6bfc('0x34')][_0x6bfc('0x3c')]){_0x4af4c6['where']=_[_0x6bfc('0x3d')](_0x4af4c6[_0x6bfc('0x3e')],{'$or':_['map'](_0x4af4c6[_0x6bfc('0x38')],function(_0x47f2be){var _0x29be49={};_0x29be49[_0x47f2be]={'$like':'%'+_0x26e585[_0x6bfc('0x34')][_0x6bfc('0x3c')]+'%'};return _0x29be49;})});}_0x4af4c6=_[_0x6bfc('0x3d')]({},_0x4af4c6,_0x26e585['options']);return _0x578200[_0x6bfc('0x4b')](_0x4af4c6);}})['then'](function(_0x467dc3){if(_0x467dc3){_0x13ea8f=_0x467dc3[_0x6bfc('0x39')];if(!_0x26e585[_0x6bfc('0x34')][_0x6bfc('0x4e')]('nolimit')){_0x4af4c6[_0x6bfc('0x1e')]=qs[_0x6bfc('0x1e')](_0x26e585[_0x6bfc('0x34')][_0x6bfc('0x1e')]);_0x4af4c6[_0x6bfc('0x1d')]=qs[_0x6bfc('0x1d')](_0x26e585[_0x6bfc('0x34')][_0x6bfc('0x1d')]);}return _0x578200[_0x6bfc('0x4b')](_0x4af4c6);}})[_0x6bfc('0x27')](function(_0x5cb55a){if(_0x5cb55a){return _0x5cb55a?{'count':_0x13ea8f,'rows':_0x5cb55a}:null;}})['then'](respondWithResult(_0x46bcc4,null))['catch'](handleError(_0x46bcc4,null));};exports[_0x6bfc('0x4f')]=function(_0x1d6901,_0x4f977a,_0x12a3ff){if(_0x1d6901[_0x6bfc('0x4a')]['id']){delete _0x1d6901['body']['id'];}return db[_0x6bfc('0x2f')]['findOne']({'where':{'id':_0x1d6901['params']['id']}})['then'](handleEntityNotFound(_0x4f977a,null))['then'](function(_0x105f96){if(_0x105f96){_0x1d6901['body'][_0x6bfc('0x50')]=_0x105f96['id'];_0x1d6901[_0x6bfc('0x4a')][_0x6bfc('0x51')]=integrations[_0x6bfc('0x52')](_0x1d6901[_0x6bfc('0x4a')]['channel'],_0x1d6901[_0x6bfc('0x4a')][_0x6bfc('0x53')]);_0x1d6901['body']['Descriptions']=integrations[_0x6bfc('0x54')](_0x1d6901[_0x6bfc('0x4a')][_0x6bfc('0x55')],_0x1d6901['body'][_0x6bfc('0x53')]);return db[_0x6bfc('0x4c')]['create'](_0x1d6901[_0x6bfc('0x4a')],{'include':[{'model':db[_0x6bfc('0x56')],'as':_0x6bfc('0x51')},{'model':db['SalesforceField'],'as':_0x6bfc('0x57')}]});}return null;})[_0x6bfc('0x27')](respondWithResult(_0x4f977a,null))[_0x6bfc('0x42')](handleError(_0x4f977a,null));};exports[_0x6bfc('0x58')]=function(_0x23e5ad,_0x1b0776,_0x22d2e0){var _0x32e3d6;var _0x1773f1='';var _0xb879a0=_0x6bfc('0x59');return db[_0x6bfc('0x2f')][_0x6bfc('0x5a')]({'where':{'id':_0x23e5ad[_0x6bfc('0x44')]['id']},'attributes':['id','remoteUri',_0x6bfc('0x5b'),'clientSecret',_0x6bfc('0x5c'),_0x6bfc('0x5d'),_0x6bfc('0x5e')]})[_0x6bfc('0x27')](handleEntityNotFound(_0x1b0776,null))[_0x6bfc('0x27')](function(_0x45c88a){if(_0x45c88a){_0x1773f1=_0x45c88a[_0x6bfc('0x5f')];var _0x587c14=_0x1773f1[_0x6bfc('0x60')](-0x1);if(_0x587c14==='/'){_0x1773f1=_0x1773f1[_0x6bfc('0x61')](0x0,_0x1773f1[_0x6bfc('0x62')](_0x587c14));}_0x32e3d6=new jsforce[(_0x6bfc('0x63'))]({'oauth2':{'loginUrl':_0x1773f1,'clientId':_0x45c88a[_0x6bfc('0x5b')],'clientSecret':_0x45c88a[_0x6bfc('0x64')]}});return _0x32e3d6[_0x6bfc('0x65')](_0x45c88a['username'],_0x45c88a[_0x6bfc('0x5d')]['concat'](_0x45c88a[_0x6bfc('0x5e')]));}})[_0x6bfc('0x27')](function(_0x344921){if(_0x344921){if(!_[_0x6bfc('0x66')](_0x23e5ad[_0x6bfc('0x34')][_0x6bfc('0x67')])){_0xb879a0=_0x23e5ad[_0x6bfc('0x34')][_0x6bfc('0x67')];}return _0x32e3d6[_0x6bfc('0x68')](_0xb879a0)[_0x6bfc('0x69')]();}})[_0x6bfc('0x27')](function(_0x123603){var _0x42542e=['OwnerId','ActivityDate',_0x6bfc('0x6a'),_0x6bfc('0x6b'),_0x6bfc('0x6c'),_0x6bfc('0x6d')];var _0x4297a8=['string',_0x6bfc('0x6e'),_0x6bfc('0x6f'),_0x6bfc('0x70'),_0x6bfc('0x71'),'textarea',_0x6bfc('0x72')];if(_0x123603){_[_0x6bfc('0x73')](_0x123603[_0x6bfc('0x45')],function(_0x35dc35){return _0x42542e[_0x6bfc('0x74')](_0x35dc35[_0x6bfc('0x2b')])||!_0x4297a8[_0x6bfc('0x74')](_0x35dc35[_0x6bfc('0x53')]);});return{'count':_0x123603['fields'][_0x6bfc('0x39')],'rows':_[_0x6bfc('0x2e')](_0x123603[_0x6bfc('0x45')],function(_0x2ad7bf){return{'id':_0x2ad7bf[_0x6bfc('0x2b')],'name':_0x2ad7bf['label'],'custom':_0x2ad7bf[_0x6bfc('0x75')],'options':_0x2ad7bf['picklistValues'][_0x6bfc('0x39')]>0x0?_[_0x6bfc('0x2e')](_0x2ad7bf[_0x6bfc('0x76')],function(_0x2a17ca){return{'name':_0x2a17ca[_0x6bfc('0x77')],'value':_0x2a17ca[_0x6bfc('0x78')]};}):_0x2ad7bf['type']=='boolean'?[{'name':_0x6bfc('0x79'),'value':_0x6bfc('0x7a')},{'name':'False','value':'false'}]:[]};})};}})[_0x6bfc('0x27')](respondWithResult(_0x1b0776,null))['catch'](function(_0x20a6f4){var _0xfd4b79=_0x23e5ad[_0x6bfc('0x34')][_0x6bfc('0x7b')]?0x1f4:_0x20a6f4[_0x6bfc('0x7c')]||0x1f4;logger['error'](_0x6bfc('0x7d'),_0x6bfc('0x58'),_0xfd4b79,JSON[_0x6bfc('0x7e')](_0x20a6f4));delete _0x20a6f4[_0x6bfc('0x2b')];if(_0xfd4b79===0x191){_0xfd4b79=0x190;}_0x1b0776[_0x6bfc('0x1b')](_0xfd4b79)['send'](_0x23e5ad[_0x6bfc('0x34')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x20a6f4[_0x6bfc('0x7c')]}:_0x20a6f4);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 7f56443..1ad7de3 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 _0x0ce1=['../../config/environment','exports','define','int_salesforce_accounts','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x14984a,_0xaf5268){var _0x57b442=function(_0x534b92){while(--_0x534b92){_0x14984a['push'](_0x14984a['shift']());}};_0x57b442(++_0xaf5268);}(_0x0ce1,0xc4));var _0x10ce=function(_0x4de115,_0x1adf59){_0x4de115=_0x4de115-0x0;var _0x3f9308=_0x0ce1[_0x4de115];return _0x3f9308;};'use strict';var _=require(_0x10ce('0x0'));var util=require(_0x10ce('0x1'));var logger=require(_0x10ce('0x2'))(_0x10ce('0x3'));var moment=require(_0x10ce('0x4'));var BPromise=require('bluebird');var rp=require(_0x10ce('0x5'));var fs=require('fs');var path=require(_0x10ce('0x6'));var rimraf=require(_0x10ce('0x7'));var config=require(_0x10ce('0x8'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x10ce('0x9')]=function(_0x32bbe8,_0xacf744){return _0x32bbe8[_0x10ce('0xa')]('SalesforceAccount',attributes,{'tableName':_0x10ce('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2bc1=['util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','define','SalesforceAccount','int_salesforce_accounts'];(function(_0x4c3e36,_0x4be9f3){var _0x3136b4=function(_0x4916b8){while(--_0x4916b8){_0x4c3e36['push'](_0x4c3e36['shift']());}};_0x3136b4(++_0x4be9f3);}(_0x2bc1,0x11e));var _0x12bc=function(_0x27ef17,_0x5194a8){_0x27ef17=_0x27ef17-0x0;var _0x4e9e24=_0x2bc1[_0x27ef17];return _0x4e9e24;};'use strict';var _=require('lodash');var util=require(_0x12bc('0x0'));var logger=require(_0x12bc('0x1'))('api');var moment=require(_0x12bc('0x2'));var BPromise=require('bluebird');var rp=require(_0x12bc('0x3'));var fs=require('fs');var path=require(_0x12bc('0x4'));var rimraf=require(_0x12bc('0x5'));var config=require(_0x12bc('0x6'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x12bc('0x7')]=function(_0x28b14e,_0x31f56e){return _0x28b14e[_0x12bc('0x8')](_0x12bc('0x9'),attributes,{'tableName':_0x12bc('0xa'),'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 c7a93d2..b648b87 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 _0x2090=['request\x20sent','debug','stringify','code','error','message','result','catch','SalesforceAccount','findAll','options','raw','limit','include','map','model','attributes','GetSalesforceAccount','ShowSalesforceAccount','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','SalesforceAccount,\x20%s,\x20%s'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x2090,0x195));var _0x0209=function(_0x473e94,_0x2443a9){_0x473e94=_0x473e94-0x0;var _0x483e9a=_0x2090[_0x473e94];return _0x483e9a;};'use strict';var _=require(_0x0209('0x0'));var util=require(_0x0209('0x1'));var moment=require(_0x0209('0x2'));var BPromise=require(_0x0209('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0209('0x4'));var db=require(_0x0209('0x5'))['db'];var utils=require(_0x0209('0x6'));var logger=require(_0x0209('0x7'))('rpc');var config=require(_0x0209('0x8'));var jayson=require(_0x0209('0x9'));var client=jayson['client'][_0x0209('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb4168a,_0x2a0688,_0x26b8bb){return new BPromise(function(_0x1e39d5,_0x3b0e01){return client[_0x0209('0xb')](_0xb4168a,_0x26b8bb)[_0x0209('0xc')](function(_0x3b8c4b){logger[_0x0209('0xd')](_0x0209('0xe'),_0x2a0688,_0x0209('0xf'));logger[_0x0209('0x10')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x2a0688,'request\x20sent',JSON[_0x0209('0x11')](_0x3b8c4b));if(_0x3b8c4b['error']){if(_0x3b8c4b['error'][_0x0209('0x12')]===0x1f4){logger[_0x0209('0x13')](_0x0209('0xe'),_0x2a0688,_0x3b8c4b[_0x0209('0x13')]['message']);return _0x3b0e01(_0x3b8c4b[_0x0209('0x13')][_0x0209('0x14')]);}logger[_0x0209('0x13')](_0x0209('0xe'),_0x2a0688,_0x3b8c4b[_0x0209('0x13')]['message']);return _0x1e39d5(_0x3b8c4b[_0x0209('0x13')][_0x0209('0x14')]);}else{logger['info'](_0x0209('0xe'),_0x2a0688,_0x0209('0xf'));_0x1e39d5(_0x3b8c4b[_0x0209('0x15')][_0x0209('0x14')]);}})[_0x0209('0x16')](function(_0x4dbf17){logger[_0x0209('0x13')](_0x0209('0xe'),_0x2a0688,_0x4dbf17);_0x3b0e01(_0x4dbf17);});});}exports['GetSalesforceAccount']=function(_0x42461a){var _0x8a6d50=this;return new Promise(function(_0x2ad3ba,_0x41e577){return db[_0x0209('0x17')][_0x0209('0x18')]({'raw':_0x42461a[_0x0209('0x19')]?_0x42461a[_0x0209('0x19')][_0x0209('0x1a')]===undefined?!![]:![]:!![],'where':_0x42461a[_0x0209('0x19')]?_0x42461a[_0x0209('0x19')]['where']||null:null,'attributes':_0x42461a['options']?_0x42461a[_0x0209('0x19')]['attributes']||null:null,'limit':_0x42461a[_0x0209('0x19')]?_0x42461a[_0x0209('0x19')][_0x0209('0x1b')]||null:null,'include':_0x42461a[_0x0209('0x19')]?_0x42461a[_0x0209('0x19')][_0x0209('0x1c')]?_[_0x0209('0x1d')](_0x42461a[_0x0209('0x19')][_0x0209('0x1c')],function(_0x2d0f96){return{'model':db[_0x2d0f96[_0x0209('0x1e')]],'as':_0x2d0f96['as'],'attributes':_0x2d0f96[_0x0209('0x1f')],'include':_0x2d0f96[_0x0209('0x1c')]?_[_0x0209('0x1d')](_0x2d0f96[_0x0209('0x1c')],function(_0x268080){return{'model':db[_0x268080[_0x0209('0x1e')]],'as':_0x268080['as'],'attributes':_0x268080[_0x0209('0x1f')],'include':_0x268080[_0x0209('0x1c')]?_[_0x0209('0x1d')](_0x268080[_0x0209('0x1c')],function(_0x458d49){return{'model':db[_0x458d49[_0x0209('0x1e')]],'as':_0x458d49['as'],'attributes':_0x458d49[_0x0209('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x0209('0xc')](function(_0x57889e){logger[_0x0209('0xd')](_0x0209('0x20'),_0x42461a);logger[_0x0209('0x10')](_0x0209('0x20'),_0x42461a,JSON[_0x0209('0x11')](_0x57889e));_0x2ad3ba(_0x57889e);})[_0x0209('0x16')](function(_0x3af9aa){logger[_0x0209('0x13')](_0x0209('0x20'),_0x3af9aa['message'],_0x42461a);_0x41e577(_0x8a6d50[_0x0209('0x13')](0x1f4,_0x3af9aa[_0x0209('0x14')]));});});};exports[_0x0209('0x21')]=function(_0x5cb409){var _0x4b4857=this;return new Promise(function(_0x231dcd,_0x4a8b68){return db['SalesforceAccount'][_0x0209('0x22')]({'raw':_0x5cb409[_0x0209('0x19')]?_0x5cb409['options'][_0x0209('0x1a')]===undefined?!![]:![]:!![],'where':_0x5cb409[_0x0209('0x19')]?_0x5cb409[_0x0209('0x19')]['where']||null:null,'attributes':_0x5cb409[_0x0209('0x19')]?_0x5cb409[_0x0209('0x19')]['attributes']||null:null,'include':_0x5cb409[_0x0209('0x19')]?_0x5cb409[_0x0209('0x19')][_0x0209('0x1c')]?_[_0x0209('0x1d')](_0x5cb409[_0x0209('0x19')][_0x0209('0x1c')],function(_0x259b4e){return{'model':db[_0x259b4e['model']],'as':_0x259b4e['as'],'attributes':_0x259b4e[_0x0209('0x1f')],'include':_0x259b4e['include']?_[_0x0209('0x1d')](_0x259b4e[_0x0209('0x1c')],function(_0x556c0f){return{'model':db[_0x556c0f[_0x0209('0x1e')]],'as':_0x556c0f['as'],'attributes':_0x556c0f[_0x0209('0x1f')],'include':_0x556c0f[_0x0209('0x1c')]?_['map'](_0x556c0f['include'],function(_0x2bdb01){return{'model':db[_0x2bdb01[_0x0209('0x1e')]],'as':_0x2bdb01['as'],'attributes':_0x2bdb01[_0x0209('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x0209('0xc')](function(_0x1c4d2e){logger[_0x0209('0xd')](_0x0209('0x21'),_0x5cb409);logger[_0x0209('0x10')]('ShowSalesforceAccount',_0x5cb409,JSON['stringify'](_0x1c4d2e));_0x231dcd(_0x1c4d2e);})[_0x0209('0x16')](function(_0x500a0b){logger[_0x0209('0x13')](_0x0209('0x21'),_0x500a0b[_0x0209('0x14')],_0x5cb409);_0x4a8b68(_0x4b4857[_0x0209('0x13')](0x1f4,_0x500a0b[_0x0209('0x14')]));});});}; \ No newline at end of file +var _0x444a=['attributes','limit','include','model','map','stringify','catch','ShowSalesforceAccount','find','where','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','SalesforceAccount,\x20%s,\x20%s','message','result','GetSalesforceAccount','SalesforceAccount','findAll','options','raw'];(function(_0x290801,_0x47db09){var _0x59ebd3=function(_0x158a74){while(--_0x158a74){_0x290801['push'](_0x290801['shift']());}};_0x59ebd3(++_0x47db09);}(_0x444a,0x1a1));var _0xa444=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0x444a[_0x58e469];return _0x4c01c5;};'use strict';var _=require(_0xa444('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa444('0x1'));var rs=require(_0xa444('0x2'));var fs=require('fs');var Redis=require(_0xa444('0x3'));var db=require(_0xa444('0x4'))['db'];var utils=require(_0xa444('0x5'));var logger=require('../../config/logger')(_0xa444('0x6'));var config=require(_0xa444('0x7'));var jayson=require(_0xa444('0x8'));var client=jayson[_0xa444('0x9')][_0xa444('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e3ab2,_0x2253f7,_0x593382){return new BPromise(function(_0x4190ff,_0x4ef8f5){return client[_0xa444('0xb')](_0x3e3ab2,_0x593382)[_0xa444('0xc')](function(_0x320003){logger[_0xa444('0xd')]('SalesforceAccount,\x20%s,\x20%s',_0x2253f7,_0xa444('0xe'));logger[_0xa444('0xf')](_0xa444('0x10'),_0x2253f7,_0xa444('0xe'),JSON['stringify'](_0x320003));if(_0x320003[_0xa444('0x11')]){if(_0x320003['error'][_0xa444('0x12')]===0x1f4){logger[_0xa444('0x11')](_0xa444('0x13'),_0x2253f7,_0x320003['error']['message']);return _0x4ef8f5(_0x320003[_0xa444('0x11')]['message']);}logger[_0xa444('0x11')](_0xa444('0x13'),_0x2253f7,_0x320003[_0xa444('0x11')][_0xa444('0x14')]);return _0x4190ff(_0x320003['error']['message']);}else{logger[_0xa444('0xd')](_0xa444('0x13'),_0x2253f7,_0xa444('0xe'));_0x4190ff(_0x320003[_0xa444('0x15')][_0xa444('0x14')]);}})['catch'](function(_0x1036c5){logger[_0xa444('0x11')](_0xa444('0x13'),_0x2253f7,_0x1036c5);_0x4ef8f5(_0x1036c5);});});}exports[_0xa444('0x16')]=function(_0x54e9f1){var _0x3e02b7=this;return new Promise(function(_0x10672a,_0x35db0d){return db[_0xa444('0x17')][_0xa444('0x18')]({'raw':_0x54e9f1[_0xa444('0x19')]?_0x54e9f1[_0xa444('0x19')][_0xa444('0x1a')]===undefined?!![]:![]:!![],'where':_0x54e9f1[_0xa444('0x19')]?_0x54e9f1[_0xa444('0x19')]['where']||null:null,'attributes':_0x54e9f1[_0xa444('0x19')]?_0x54e9f1[_0xa444('0x19')][_0xa444('0x1b')]||null:null,'limit':_0x54e9f1['options']?_0x54e9f1[_0xa444('0x19')][_0xa444('0x1c')]||null:null,'include':_0x54e9f1[_0xa444('0x19')]?_0x54e9f1[_0xa444('0x19')][_0xa444('0x1d')]?_['map'](_0x54e9f1[_0xa444('0x19')][_0xa444('0x1d')],function(_0x55af1a){return{'model':db[_0x55af1a['model']],'as':_0x55af1a['as'],'attributes':_0x55af1a[_0xa444('0x1b')],'include':_0x55af1a['include']?_['map'](_0x55af1a[_0xa444('0x1d')],function(_0x98ffa4){return{'model':db[_0x98ffa4[_0xa444('0x1e')]],'as':_0x98ffa4['as'],'attributes':_0x98ffa4[_0xa444('0x1b')],'include':_0x98ffa4[_0xa444('0x1d')]?_[_0xa444('0x1f')](_0x98ffa4['include'],function(_0x2ac298){return{'model':db[_0x2ac298[_0xa444('0x1e')]],'as':_0x2ac298['as'],'attributes':_0x2ac298['attributes']};}):[]};}):[]};}):[]:[]})[_0xa444('0xc')](function(_0x6dcc28){logger['info'](_0xa444('0x16'),_0x54e9f1);logger['debug'](_0xa444('0x16'),_0x54e9f1,JSON[_0xa444('0x20')](_0x6dcc28));_0x10672a(_0x6dcc28);})[_0xa444('0x21')](function(_0x4d0605){logger[_0xa444('0x11')](_0xa444('0x16'),_0x4d0605[_0xa444('0x14')],_0x54e9f1);_0x35db0d(_0x3e02b7[_0xa444('0x11')](0x1f4,_0x4d0605[_0xa444('0x14')]));});});};exports[_0xa444('0x22')]=function(_0x4e0ee3){var _0x58c043=this;return new Promise(function(_0x94173b,_0x10230a){return db[_0xa444('0x17')][_0xa444('0x23')]({'raw':_0x4e0ee3['options']?_0x4e0ee3[_0xa444('0x19')][_0xa444('0x1a')]===undefined?!![]:![]:!![],'where':_0x4e0ee3[_0xa444('0x19')]?_0x4e0ee3[_0xa444('0x19')][_0xa444('0x24')]||null:null,'attributes':_0x4e0ee3['options']?_0x4e0ee3[_0xa444('0x19')][_0xa444('0x1b')]||null:null,'include':_0x4e0ee3[_0xa444('0x19')]?_0x4e0ee3['options'][_0xa444('0x1d')]?_['map'](_0x4e0ee3[_0xa444('0x19')]['include'],function(_0x22b29a){return{'model':db[_0x22b29a['model']],'as':_0x22b29a['as'],'attributes':_0x22b29a['attributes'],'include':_0x22b29a[_0xa444('0x1d')]?_[_0xa444('0x1f')](_0x22b29a[_0xa444('0x1d')],function(_0x262d33){return{'model':db[_0x262d33['model']],'as':_0x262d33['as'],'attributes':_0x262d33[_0xa444('0x1b')],'include':_0x262d33[_0xa444('0x1d')]?_[_0xa444('0x1f')](_0x262d33['include'],function(_0x3365eb){return{'model':db[_0x3365eb[_0xa444('0x1e')]],'as':_0x3365eb['as'],'attributes':_0x3365eb['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x40d4fb){logger[_0xa444('0xd')](_0xa444('0x22'),_0x4e0ee3);logger[_0xa444('0xf')](_0xa444('0x22'),_0x4e0ee3,JSON[_0xa444('0x20')](_0x40d4fb));_0x94173b(_0x40d4fb);})[_0xa444('0x21')](function(_0x4aa5a8){logger[_0xa444('0x11')](_0xa444('0x22'),_0x4aa5a8[_0xa444('0x14')],_0x4e0ee3);_0x10230a(_0x58c043[_0xa444('0x11')](0x1f4,_0x4aa5a8['message']));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index cba5ff4..26913ff 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','exports','multer','util','path'];(function(_0x49c55e,_0x4016aa){var _0x4014ab=function(_0x4b7c95){while(--_0x4b7c95){_0x49c55e['push'](_0x49c55e['shift']());}};_0x4014ab(++_0x4016aa);}(_0x2ef3,0xba));var _0x32ef=function(_0x158204,_0x4a5333){_0x158204=_0x158204-0x0;var _0x2d3aa0=_0x2ef3[_0x158204];return _0x2d3aa0;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0x9')](_0x32ef('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x32ef('0x9')](_0x32ef('0x10'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x11')]);router['post']('/',auth[_0x32ef('0xb')](),controller['create']);router[_0x32ef('0x12')]('/:id',auth[_0x32ef('0xb')](),controller[_0x32ef('0x13')]);router['delete']('/:id',auth[_0x32ef('0xb')](),controller['destroy']);module[_0x32ef('0x14')]=router; \ No newline at end of file +var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xdb28,0x106));var _0x8db2=function(_0x43f33c,_0x5d106f){_0x43f33c=_0x43f33c-0x0;var _0x4bd35c=_0xdb28[_0x43f33c];return _0x4bd35c;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./intSalesforceConfiguration.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 8dc8bce..e45775b 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 _0xf61c=['account','exports','STRING','ENUM','Task','Case','contact_lead','contact','lead','account_contact_lead'];(function(_0x3d019a,_0x5650cb){var _0x3a1820=function(_0x3be936){while(--_0x3be936){_0x3d019a['push'](_0x3d019a['shift']());}};_0x3a1820(++_0x5650cb);}(_0xf61c,0x1c3));var _0xcf61=function(_0x59ad9f,_0x83a27d){_0x59ad9f=_0x59ad9f-0x0;var _0xc47c21=_0xf61c[_0x59ad9f];return _0xc47c21;};'use strict';var Sequelize=require('sequelize');module[_0xcf61('0x0')]={'name':{'type':Sequelize[_0xcf61('0x1')]},'description':{'type':Sequelize[_0xcf61('0x1')]},'ticketType':{'type':Sequelize[_0xcf61('0x2')](_0xcf61('0x3'),_0xcf61('0x4')),'defaultValue':_0xcf61('0x3')},'moduleSearch':{'type':Sequelize[_0xcf61('0x2')](_0xcf61('0x5'),_0xcf61('0x6'),_0xcf61('0x7'),_0xcf61('0x8'),_0xcf61('0x9')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0xcf61('0x2')]('nothing','contact',_0xcf61('0x7'),_0xcf61('0x9')),'defaultValue':_0xcf61('0x7')},'leadId':{'type':Sequelize[_0xcf61('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0xcf61('0x1')]},'additionalSearchContact':{'type':Sequelize[_0xcf61('0x1')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd988=['Case','contact','lead','contact_lead','nothing','account','sequelize','exports','STRING','ENUM','Task'];(function(_0x5c424d,_0x495a5c){var _0x19d803=function(_0x3d1ba5){while(--_0x3d1ba5){_0x5c424d['push'](_0x5c424d['shift']());}};_0x19d803(++_0x495a5c);}(_0xd988,0x1d4));var _0x8d98=function(_0xb7dfe4,_0x26d5b6){_0xb7dfe4=_0xb7dfe4-0x0;var _0x5b16af=_0xd988[_0xb7dfe4];return _0x5b16af;};'use strict';var Sequelize=require(_0x8d98('0x0'));module[_0x8d98('0x1')]={'name':{'type':Sequelize[_0x8d98('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x8d98('0x3')](_0x8d98('0x4'),_0x8d98('0x5')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0x8d98('0x3')]('contact_lead',_0x8d98('0x6'),_0x8d98('0x7'),'account_contact_lead','account'),'defaultValue':_0x8d98('0x8')},'moduleCreate':{'type':Sequelize[_0x8d98('0x3')](_0x8d98('0x9'),_0x8d98('0x6'),_0x8d98('0x7'),_0x8d98('0xa')),'defaultValue':_0x8d98('0x7')},'leadId':{'type':Sequelize[_0x8d98('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x8d98('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x8d98('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x8d98('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index c275c2a..c99f579 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 _0x34e9=['filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','find','create','body','update','getFields','findOne','SalesforceField','nolimit','getSubjects','getDescriptions','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','then','destroy','name','send','index','map','SalesforceConfiguration','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick'];(function(_0x4af2c3,_0xf4d1f4){var _0x74088=function(_0x5a3cc8){while(--_0x5a3cc8){_0x4af2c3['push'](_0x4af2c3['shift']());}};_0x74088(++_0xf4d1f4);}(_0x34e9,0x102));var _0x934e=function(_0x232f26,_0x54d93f){_0x232f26=_0x232f26-0x0;var _0x2f1612=_0x34e9[_0x232f26];return _0x2f1612;};'use strict';var emlformat=require(_0x934e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x934e('0x1'));var rp=require(_0x934e('0x2'));var moment=require(_0x934e('0x3'));var BPromise=require(_0x934e('0x4'));var Mustache=require(_0x934e('0x5'));var util=require(_0x934e('0x6'));var path=require('path');var sox=require(_0x934e('0x7'));var csv=require('to-csv');var ejs=require(_0x934e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x934e('0x9'));var squel=require(_0x934e('0xa'));var crypto=require(_0x934e('0xb'));var jsforce=require(_0x934e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x934e('0xd'));var querystring=require(_0x934e('0xe'));var Papa=require(_0x934e('0xf'));var Redis=require('ioredis');var authService=require(_0x934e('0x10'));var qs=require(_0x934e('0x11'));var as=require(_0x934e('0x12'));var hardwareService=require(_0x934e('0x13'));var logger=require(_0x934e('0x14'))(_0x934e('0x15'));var utils=require(_0x934e('0x16'));var config=require(_0x934e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x934e('0x18'))['db'];function respondWithStatusCode(_0x3ab958,_0x131bd6){_0x131bd6=_0x131bd6||0xcc;return function(_0x3514aa){if(_0x3514aa){return _0x3ab958['sendStatus'](_0x131bd6);}return _0x3ab958['status'](_0x131bd6)[_0x934e('0x19')]();};}function respondWithResult(_0x481fd5,_0x4bd63b){_0x4bd63b=_0x4bd63b||0xc8;return function(_0x3cde7d){if(_0x3cde7d){return _0x481fd5[_0x934e('0x1a')](_0x4bd63b)[_0x934e('0x1b')](_0x3cde7d);}};}function respondWithFilteredResult(_0x5c52fd,_0x3afb11){return function(_0x4a50a7){if(_0x4a50a7){var _0x549797=typeof _0x3afb11[_0x934e('0x1c')]===_0x934e('0x1d')&&typeof _0x3afb11['limit']===_0x934e('0x1d');var _0x1e0139=_0x4a50a7[_0x934e('0x1e')];var _0x4d3352=_0x549797?0x0:_0x3afb11[_0x934e('0x1c')];var _0x553186=_0x549797?_0x4a50a7[_0x934e('0x1e')]:_0x3afb11[_0x934e('0x1c')]+_0x3afb11[_0x934e('0x1f')];var _0x52b3c4;if(_0x553186>=_0x1e0139){_0x553186=_0x1e0139;_0x52b3c4=0xc8;}else{_0x52b3c4=0xce;}_0x5c52fd[_0x934e('0x1a')](_0x52b3c4);return _0x5c52fd[_0x934e('0x20')](_0x934e('0x21'),_0x4d3352+'-'+_0x553186+'/'+_0x1e0139)[_0x934e('0x1b')](_0x4a50a7);}return null;};}function patchUpdates(_0x43516d){return function(_0x13e453){try{jsonpatch[_0x934e('0x22')](_0x13e453,_0x43516d,!![]);}catch(_0x18181d){return BPromise[_0x934e('0x23')](_0x18181d);}return _0x13e453['save']();};}function saveUpdates(_0x3014f3,_0x23bddb){return function(_0x3ff8ac){if(_0x3ff8ac){return _0x3ff8ac['update'](_0x3014f3)[_0x934e('0x24')](function(_0x1eb683){return _0x1eb683;});}return null;};}function removeEntity(_0x58237e,_0x4b9cfc){return function(_0x2dfe32){if(_0x2dfe32){return _0x2dfe32[_0x934e('0x25')]()['then'](function(){_0x58237e[_0x934e('0x1a')](0xcc)[_0x934e('0x19')]();});}};}function handleEntityNotFound(_0x170423,_0x5f1dac){return function(_0x10d727){if(!_0x10d727){_0x170423['sendStatus'](0x194);}return _0x10d727;};}function handleError(_0x1e156d,_0x547461){_0x547461=_0x547461||0x1f4;return function(_0x2e6093){logger['error'](_0x2e6093['stack']);if(_0x2e6093[_0x934e('0x26')]){delete _0x2e6093[_0x934e('0x26')];}_0x1e156d[_0x934e('0x1a')](_0x547461)[_0x934e('0x27')](_0x2e6093);};}exports[_0x934e('0x28')]=function(_0x29273b,_0x319b1a){var _0x3e9725={},_0x384459={},_0x1f6d81={'count':0x0,'rows':[]};var _0x13408f=_[_0x934e('0x29')](db[_0x934e('0x2a')]['rawAttributes'],function(_0x2f4689){return{'name':_0x2f4689['fieldName'],'type':_0x2f4689[_0x934e('0x2b')][_0x934e('0x2c')]};});_0x384459[_0x934e('0x2d')]=_[_0x934e('0x29')](_0x13408f,_0x934e('0x26'));_0x384459[_0x934e('0x2e')]=_[_0x934e('0x2f')](_0x29273b['query']);_0x384459[_0x934e('0x30')]=_[_0x934e('0x31')](_0x384459[_0x934e('0x2d')],_0x384459['query']);_0x3e9725[_0x934e('0x32')]=_[_0x934e('0x31')](_0x384459[_0x934e('0x2d')],qs[_0x934e('0x33')](_0x29273b[_0x934e('0x2e')]['fields']));_0x3e9725[_0x934e('0x32')]=_0x3e9725[_0x934e('0x32')][_0x934e('0x34')]?_0x3e9725['attributes']:_0x384459['model'];if(!_0x29273b[_0x934e('0x2e')][_0x934e('0x35')]('nolimit')){_0x3e9725[_0x934e('0x1f')]=qs[_0x934e('0x1f')](_0x29273b[_0x934e('0x2e')]['limit']);_0x3e9725[_0x934e('0x1c')]=qs[_0x934e('0x1c')](_0x29273b[_0x934e('0x2e')][_0x934e('0x1c')]);}_0x3e9725[_0x934e('0x36')]=qs[_0x934e('0x37')](_0x29273b[_0x934e('0x2e')][_0x934e('0x37')]);_0x3e9725[_0x934e('0x38')]=qs[_0x934e('0x30')](_[_0x934e('0x39')](_0x29273b['query'],_0x384459['filters']),_0x13408f);if(_0x29273b[_0x934e('0x2e')][_0x934e('0x3a')]){_0x3e9725['where']=_['merge'](_0x3e9725['where'],{'$or':_[_0x934e('0x29')](_0x13408f,function(_0x59addb){if(_0x59addb[_0x934e('0x2b')]!==_0x934e('0x3b')){var _0x1f53d3={};_0x1f53d3[_0x59addb[_0x934e('0x26')]]={'$like':'%'+_0x29273b[_0x934e('0x2e')][_0x934e('0x3a')]+'%'};return _0x1f53d3;}})});}_0x3e9725=_[_0x934e('0x3c')]({},_0x3e9725,_0x29273b[_0x934e('0x3d')]);var _0x3c3d0f={'where':_0x3e9725[_0x934e('0x38')]};return db[_0x934e('0x2a')]['count'](_0x3c3d0f)['then'](function(_0x515cfa){_0x1f6d81['count']=_0x515cfa;if(_0x29273b[_0x934e('0x2e')][_0x934e('0x3e')]){_0x3e9725['include']=[{'all':!![]}];}return db[_0x934e('0x2a')][_0x934e('0x3f')](_0x3e9725);})['then'](function(_0x2e4fc4){_0x1f6d81[_0x934e('0x40')]=_0x2e4fc4;return _0x1f6d81;})['then'](respondWithFilteredResult(_0x319b1a,_0x3e9725))[_0x934e('0x41')](handleError(_0x319b1a,null));};exports[_0x934e('0x42')]=function(_0xcc979,_0x594051){var _0x1afa85={'raw':![],'where':{'id':_0xcc979[_0x934e('0x43')]['id']}},_0x396ec0={};_0x396ec0[_0x934e('0x2d')]=_[_0x934e('0x2f')](db[_0x934e('0x2a')][_0x934e('0x44')]);_0x396ec0[_0x934e('0x2e')]=_[_0x934e('0x2f')](_0xcc979[_0x934e('0x2e')]);_0x396ec0[_0x934e('0x30')]=_[_0x934e('0x31')](_0x396ec0[_0x934e('0x2d')],_0x396ec0[_0x934e('0x2e')]);_0x1afa85[_0x934e('0x32')]=_['intersection'](_0x396ec0[_0x934e('0x2d')],qs['fields'](_0xcc979[_0x934e('0x2e')][_0x934e('0x33')]));_0x1afa85['attributes']=_0x1afa85['attributes'][_0x934e('0x34')]?_0x1afa85[_0x934e('0x32')]:_0x396ec0[_0x934e('0x2d')];if(_0xcc979['query'][_0x934e('0x3e')]){_0x1afa85['include']=[{'all':!![]}];}_0x1afa85=_['merge']({},_0x1afa85,_0xcc979[_0x934e('0x3d')]);return db[_0x934e('0x2a')][_0x934e('0x45')](_0x1afa85)[_0x934e('0x24')](handleEntityNotFound(_0x594051,null))['then'](respondWithResult(_0x594051,null))[_0x934e('0x41')](handleError(_0x594051,null));};exports[_0x934e('0x46')]=function(_0x7c19c0,_0x4dc638){return db['SalesforceConfiguration']['create'](_0x7c19c0[_0x934e('0x47')],{})[_0x934e('0x24')](respondWithResult(_0x4dc638,0xc9))['catch'](handleError(_0x4dc638,null));};exports[_0x934e('0x48')]=function(_0x4ca1bd,_0x50ce82){if(_0x4ca1bd['body']['id']){delete _0x4ca1bd[_0x934e('0x47')]['id'];}return db[_0x934e('0x2a')][_0x934e('0x45')]({'where':{'id':_0x4ca1bd[_0x934e('0x43')]['id']}})['then'](handleEntityNotFound(_0x50ce82,null))[_0x934e('0x24')](saveUpdates(_0x4ca1bd['body'],null))[_0x934e('0x24')](respondWithResult(_0x50ce82,null))['catch'](handleError(_0x50ce82,null));};exports[_0x934e('0x25')]=function(_0x3a202f,_0x185773){return db[_0x934e('0x2a')][_0x934e('0x45')]({'where':{'id':_0x3a202f[_0x934e('0x43')]['id']}})[_0x934e('0x24')](handleEntityNotFound(_0x185773,null))[_0x934e('0x24')](removeEntity(_0x185773,null))['catch'](handleError(_0x185773,null));};exports[_0x934e('0x49')]=function(_0x545761,_0x9519f1,_0x24acee){var _0x30f06a={};var _0x19c9a5={};var _0xeabf01;var _0xa1e941;return db['SalesforceConfiguration'][_0x934e('0x4a')]({'where':{'id':_0x545761[_0x934e('0x43')]['id']}})[_0x934e('0x24')](handleEntityNotFound(_0x9519f1,null))[_0x934e('0x24')](function(_0x332851){if(_0x332851){_0xeabf01=_0x332851;_0x19c9a5['model']=_[_0x934e('0x2f')](db[_0x934e('0x4b')][_0x934e('0x44')]);_0x19c9a5[_0x934e('0x2e')]=_[_0x934e('0x2f')](_0x545761['query']);_0x19c9a5[_0x934e('0x30')]=_['intersection'](_0x19c9a5[_0x934e('0x2d')],_0x19c9a5[_0x934e('0x2e')]);_0x30f06a[_0x934e('0x32')]=_[_0x934e('0x31')](_0x19c9a5[_0x934e('0x2d')],qs['fields'](_0x545761[_0x934e('0x2e')][_0x934e('0x33')]));_0x30f06a['attributes']=_0x30f06a[_0x934e('0x32')][_0x934e('0x34')]?_0x30f06a['attributes']:_0x19c9a5['model'];_0x30f06a[_0x934e('0x36')]=qs['sort'](_0x545761['query'][_0x934e('0x37')]);_0x30f06a[_0x934e('0x38')]=qs[_0x934e('0x30')](_['pick'](_0x545761[_0x934e('0x2e')],_0x19c9a5[_0x934e('0x30')]));if(_0x545761[_0x934e('0x2e')][_0x934e('0x3a')]){_0x30f06a[_0x934e('0x38')]=_[_0x934e('0x3c')](_0x30f06a[_0x934e('0x38')],{'$or':_[_0x934e('0x29')](_0x30f06a[_0x934e('0x32')],function(_0x24d43e){var _0x17ea68={};_0x17ea68[_0x24d43e]={'$like':'%'+_0x545761[_0x934e('0x2e')][_0x934e('0x3a')]+'%'};return _0x17ea68;})});}_0x30f06a=_[_0x934e('0x3c')]({},_0x30f06a,_0x545761[_0x934e('0x3d')]);return _0xeabf01[_0x934e('0x49')](_0x30f06a);}})[_0x934e('0x24')](function(_0x3f43cd){if(_0x3f43cd){_0xa1e941=_0x3f43cd[_0x934e('0x34')];if(!_0x545761['query'][_0x934e('0x35')](_0x934e('0x4c'))){_0x30f06a[_0x934e('0x1f')]=qs[_0x934e('0x1f')](_0x545761['query'][_0x934e('0x1f')]);_0x30f06a[_0x934e('0x1c')]=qs[_0x934e('0x1c')](_0x545761[_0x934e('0x2e')][_0x934e('0x1c')]);}return _0xeabf01[_0x934e('0x49')](_0x30f06a);}})['then'](function(_0x4b3da5){if(_0x4b3da5){return _0x4b3da5?{'count':_0xa1e941,'rows':_0x4b3da5}:null;}})[_0x934e('0x24')](respondWithResult(_0x9519f1,null))[_0x934e('0x41')](handleError(_0x9519f1,null));};exports['getSubjects']=function(_0x168db8,_0x53ff27,_0x42d12b){var _0x3ccb9f={};var _0x4e40f2={};var _0x1a0a60;var _0x11b9ef;return db['SalesforceConfiguration'][_0x934e('0x4a')]({'where':{'id':_0x168db8[_0x934e('0x43')]['id']}})[_0x934e('0x24')](handleEntityNotFound(_0x53ff27,null))[_0x934e('0x24')](function(_0x238afe){if(_0x238afe){_0x1a0a60=_0x238afe;_0x4e40f2[_0x934e('0x2d')]=_[_0x934e('0x2f')](db[_0x934e('0x4b')][_0x934e('0x44')]);_0x4e40f2[_0x934e('0x2e')]=_[_0x934e('0x2f')](_0x168db8['query']);_0x4e40f2[_0x934e('0x30')]=_[_0x934e('0x31')](_0x4e40f2[_0x934e('0x2d')],_0x4e40f2[_0x934e('0x2e')]);_0x3ccb9f[_0x934e('0x32')]=_[_0x934e('0x31')](_0x4e40f2[_0x934e('0x2d')],qs['fields'](_0x168db8['query']['fields']));_0x3ccb9f[_0x934e('0x32')]=_0x3ccb9f['attributes'][_0x934e('0x34')]?_0x3ccb9f[_0x934e('0x32')]:_0x4e40f2['model'];_0x3ccb9f[_0x934e('0x36')]=qs['sort'](_0x168db8[_0x934e('0x2e')][_0x934e('0x37')]);_0x3ccb9f[_0x934e('0x38')]=qs[_0x934e('0x30')](_['pick'](_0x168db8[_0x934e('0x2e')],_0x4e40f2[_0x934e('0x30')]));if(_0x168db8[_0x934e('0x2e')]['filter']){_0x3ccb9f[_0x934e('0x38')]=_[_0x934e('0x3c')](_0x3ccb9f[_0x934e('0x38')],{'$or':_[_0x934e('0x29')](_0x3ccb9f[_0x934e('0x32')],function(_0x4aacf6){var _0x2562b7={};_0x2562b7[_0x4aacf6]={'$like':'%'+_0x168db8[_0x934e('0x2e')][_0x934e('0x3a')]+'%'};return _0x2562b7;})});}_0x3ccb9f=_[_0x934e('0x3c')]({},_0x3ccb9f,_0x168db8[_0x934e('0x3d')]);return _0x1a0a60['getSubjects'](_0x3ccb9f);}})[_0x934e('0x24')](function(_0x8ab988){if(_0x8ab988){_0x11b9ef=_0x8ab988['length'];if(!_0x168db8[_0x934e('0x2e')][_0x934e('0x35')](_0x934e('0x4c'))){_0x3ccb9f['limit']=qs[_0x934e('0x1f')](_0x168db8[_0x934e('0x2e')][_0x934e('0x1f')]);_0x3ccb9f[_0x934e('0x1c')]=qs[_0x934e('0x1c')](_0x168db8[_0x934e('0x2e')][_0x934e('0x1c')]);}return _0x1a0a60[_0x934e('0x4d')](_0x3ccb9f);}})[_0x934e('0x24')](function(_0x4ddec5){if(_0x4ddec5){return _0x4ddec5?{'count':_0x11b9ef,'rows':_0x4ddec5}:null;}})[_0x934e('0x24')](respondWithResult(_0x53ff27,null))[_0x934e('0x41')](handleError(_0x53ff27,null));};exports[_0x934e('0x4e')]=function(_0x1749f3,_0x39a423,_0x2656f1){var _0x35a709={};var _0x2f5a70={};var _0x427c67;var _0x57d88b;return db[_0x934e('0x2a')][_0x934e('0x4a')]({'where':{'id':_0x1749f3[_0x934e('0x43')]['id']}})[_0x934e('0x24')](handleEntityNotFound(_0x39a423,null))[_0x934e('0x24')](function(_0x3d8a2f){if(_0x3d8a2f){_0x427c67=_0x3d8a2f;_0x2f5a70['model']=_['keys'](db[_0x934e('0x4b')][_0x934e('0x44')]);_0x2f5a70[_0x934e('0x2e')]=_[_0x934e('0x2f')](_0x1749f3[_0x934e('0x2e')]);_0x2f5a70[_0x934e('0x30')]=_[_0x934e('0x31')](_0x2f5a70[_0x934e('0x2d')],_0x2f5a70[_0x934e('0x2e')]);_0x35a709[_0x934e('0x32')]=_[_0x934e('0x31')](_0x2f5a70['model'],qs[_0x934e('0x33')](_0x1749f3[_0x934e('0x2e')][_0x934e('0x33')]));_0x35a709[_0x934e('0x32')]=_0x35a709[_0x934e('0x32')]['length']?_0x35a709[_0x934e('0x32')]:_0x2f5a70['model'];_0x35a709[_0x934e('0x36')]=qs[_0x934e('0x37')](_0x1749f3[_0x934e('0x2e')]['sort']);_0x35a709[_0x934e('0x38')]=qs[_0x934e('0x30')](_[_0x934e('0x39')](_0x1749f3[_0x934e('0x2e')],_0x2f5a70['filters']));if(_0x1749f3[_0x934e('0x2e')][_0x934e('0x3a')]){_0x35a709[_0x934e('0x38')]=_[_0x934e('0x3c')](_0x35a709[_0x934e('0x38')],{'$or':_['map'](_0x35a709[_0x934e('0x32')],function(_0x4b8289){var _0x2e024a={};_0x2e024a[_0x4b8289]={'$like':'%'+_0x1749f3['query'][_0x934e('0x3a')]+'%'};return _0x2e024a;})});}_0x35a709=_['merge']({},_0x35a709,_0x1749f3[_0x934e('0x3d')]);return _0x427c67[_0x934e('0x4e')](_0x35a709);}})[_0x934e('0x24')](function(_0x32ca0a){if(_0x32ca0a){_0x57d88b=_0x32ca0a['length'];if(!_0x1749f3[_0x934e('0x2e')][_0x934e('0x35')](_0x934e('0x4c'))){_0x35a709['limit']=qs['limit'](_0x1749f3[_0x934e('0x2e')][_0x934e('0x1f')]);_0x35a709[_0x934e('0x1c')]=qs['offset'](_0x1749f3[_0x934e('0x2e')]['offset']);}return _0x427c67[_0x934e('0x4e')](_0x35a709);}})[_0x934e('0x24')](function(_0x4d6c57){if(_0x4d6c57){return _0x4d6c57?{'count':_0x57d88b,'rows':_0x4d6c57}:null;}})[_0x934e('0x24')](respondWithResult(_0x39a423,null))[_0x934e('0x41')](handleError(_0x39a423,null));}; \ No newline at end of file +var _0x2831=['fields','length','hasOwnProperty','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','getFields','sort','nolimit','getSubjects','order','findOne','SalesforceField','getDescriptions','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes'];(function(_0x3c8b02,_0x2d7906){var _0x436d48=function(_0x189968){while(--_0x189968){_0x3c8b02['push'](_0x3c8b02['shift']());}};_0x436d48(++_0x2d7906);}(_0x2831,0x1ee));var _0x1283=function(_0x1d0b2e,_0x1a6a14){_0x1d0b2e=_0x1d0b2e-0x0;var _0x58e36c=_0x2831[_0x1d0b2e];return _0x58e36c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1283('0x0'));var zipdir=require(_0x1283('0x1'));var jsonpatch=require(_0x1283('0x2'));var rp=require('request-promise');var moment=require(_0x1283('0x3'));var BPromise=require(_0x1283('0x4'));var Mustache=require(_0x1283('0x5'));var util=require(_0x1283('0x6'));var path=require(_0x1283('0x7'));var sox=require(_0x1283('0x8'));var csv=require(_0x1283('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1283('0xa'));var _=require('lodash');var squel=require(_0x1283('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1283('0xc'));var toCsv=require(_0x1283('0x9'));var querystring=require(_0x1283('0xd'));var Papa=require(_0x1283('0xe'));var Redis=require(_0x1283('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1283('0x10'));var logger=require('../../config/logger')(_0x1283('0x11'));var utils=require(_0x1283('0x12'));var config=require(_0x1283('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x1283('0x14'))['db'];function respondWithStatusCode(_0x21f6dd,_0x2667be){_0x2667be=_0x2667be||0xcc;return function(_0x20074c){if(_0x20074c){return _0x21f6dd['sendStatus'](_0x2667be);}return _0x21f6dd[_0x1283('0x15')](_0x2667be)[_0x1283('0x16')]();};}function respondWithResult(_0x43a3ab,_0xb45b2c){_0xb45b2c=_0xb45b2c||0xc8;return function(_0x135c8e){if(_0x135c8e){return _0x43a3ab[_0x1283('0x15')](_0xb45b2c)[_0x1283('0x17')](_0x135c8e);}};}function respondWithFilteredResult(_0x3a4582,_0x1ed12d){return function(_0x23d41e){if(_0x23d41e){var _0xa89652=typeof _0x1ed12d[_0x1283('0x18')]===_0x1283('0x19')&&typeof _0x1ed12d[_0x1283('0x1a')]===_0x1283('0x19');var _0x33018e=_0x23d41e['count'];var _0x14ac2a=_0xa89652?0x0:_0x1ed12d['offset'];var _0x37f753=_0xa89652?_0x23d41e[_0x1283('0x1b')]:_0x1ed12d[_0x1283('0x18')]+_0x1ed12d[_0x1283('0x1a')];var _0x15210b;if(_0x37f753>=_0x33018e){_0x37f753=_0x33018e;_0x15210b=0xc8;}else{_0x15210b=0xce;}_0x3a4582[_0x1283('0x15')](_0x15210b);return _0x3a4582[_0x1283('0x1c')](_0x1283('0x1d'),_0x14ac2a+'-'+_0x37f753+'/'+_0x33018e)[_0x1283('0x17')](_0x23d41e);}return null;};}function patchUpdates(_0x1c0370){return function(_0x180eca){try{jsonpatch['apply'](_0x180eca,_0x1c0370,!![]);}catch(_0x4893d8){return BPromise[_0x1283('0x1e')](_0x4893d8);}return _0x180eca[_0x1283('0x1f')]();};}function saveUpdates(_0x1bd5e2,_0x21f778){return function(_0x177e74){if(_0x177e74){return _0x177e74[_0x1283('0x20')](_0x1bd5e2)[_0x1283('0x21')](function(_0x239507){return _0x239507;});}return null;};}function removeEntity(_0x282fb,_0x2d6327){return function(_0x5e1665){if(_0x5e1665){return _0x5e1665[_0x1283('0x22')]()[_0x1283('0x21')](function(){_0x282fb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x393aea,_0x1e6d0d){return function(_0x466974){if(!_0x466974){_0x393aea['sendStatus'](0x194);}return _0x466974;};}function handleError(_0x3e71f5,_0x4107f7){_0x4107f7=_0x4107f7||0x1f4;return function(_0x43b0fc){logger[_0x1283('0x23')](_0x43b0fc[_0x1283('0x24')]);if(_0x43b0fc[_0x1283('0x25')]){delete _0x43b0fc[_0x1283('0x25')];}_0x3e71f5[_0x1283('0x15')](_0x4107f7)[_0x1283('0x26')](_0x43b0fc);};}exports[_0x1283('0x27')]=function(_0x5bd19c,_0x40f815){var _0x21f169={},_0x16fffa={},_0x5aed66={'count':0x0,'rows':[]};var _0x4ece08=_['map'](db[_0x1283('0x28')][_0x1283('0x29')],function(_0x164254){return{'name':_0x164254[_0x1283('0x2a')],'type':_0x164254[_0x1283('0x2b')][_0x1283('0x2c')]};});_0x16fffa[_0x1283('0x2d')]=_[_0x1283('0x2e')](_0x4ece08,_0x1283('0x25'));_0x16fffa['query']=_[_0x1283('0x2f')](_0x5bd19c[_0x1283('0x30')]);_0x16fffa[_0x1283('0x31')]=_[_0x1283('0x32')](_0x16fffa[_0x1283('0x2d')],_0x16fffa['query']);_0x21f169[_0x1283('0x33')]=_['intersection'](_0x16fffa['model'],qs[_0x1283('0x34')](_0x5bd19c[_0x1283('0x30')][_0x1283('0x34')]));_0x21f169[_0x1283('0x33')]=_0x21f169[_0x1283('0x33')][_0x1283('0x35')]?_0x21f169['attributes']:_0x16fffa[_0x1283('0x2d')];if(!_0x5bd19c['query'][_0x1283('0x36')]('nolimit')){_0x21f169[_0x1283('0x1a')]=qs[_0x1283('0x1a')](_0x5bd19c['query'][_0x1283('0x1a')]);_0x21f169['offset']=qs[_0x1283('0x18')](_0x5bd19c[_0x1283('0x30')][_0x1283('0x18')]);}_0x21f169['order']=qs['sort'](_0x5bd19c[_0x1283('0x30')]['sort']);_0x21f169[_0x1283('0x37')]=qs[_0x1283('0x31')](_[_0x1283('0x38')](_0x5bd19c[_0x1283('0x30')],_0x16fffa['filters']),_0x4ece08);if(_0x5bd19c[_0x1283('0x30')][_0x1283('0x39')]){_0x21f169[_0x1283('0x37')]=_[_0x1283('0x3a')](_0x21f169[_0x1283('0x37')],{'$or':_[_0x1283('0x2e')](_0x4ece08,function(_0x4e967a){if(_0x4e967a['type']!=='VIRTUAL'){var _0x4b8d6f={};_0x4b8d6f[_0x4e967a[_0x1283('0x25')]]={'$like':'%'+_0x5bd19c[_0x1283('0x30')][_0x1283('0x39')]+'%'};return _0x4b8d6f;}})});}_0x21f169=_[_0x1283('0x3a')]({},_0x21f169,_0x5bd19c[_0x1283('0x3b')]);var _0x4b9343={'where':_0x21f169[_0x1283('0x37')]};return db[_0x1283('0x28')][_0x1283('0x1b')](_0x4b9343)[_0x1283('0x21')](function(_0x346899){_0x5aed66[_0x1283('0x1b')]=_0x346899;if(_0x5bd19c[_0x1283('0x30')][_0x1283('0x3c')]){_0x21f169['include']=[{'all':!![]}];}return db[_0x1283('0x28')][_0x1283('0x3d')](_0x21f169);})[_0x1283('0x21')](function(_0x1e8d9a){_0x5aed66[_0x1283('0x3e')]=_0x1e8d9a;return _0x5aed66;})[_0x1283('0x21')](respondWithFilteredResult(_0x40f815,_0x21f169))[_0x1283('0x3f')](handleError(_0x40f815,null));};exports[_0x1283('0x40')]=function(_0x2f8215,_0x33e1db){var _0x2d61df={'raw':![],'where':{'id':_0x2f8215[_0x1283('0x41')]['id']}},_0x2f237f={};_0x2f237f['model']=_[_0x1283('0x2f')](db['SalesforceConfiguration']['rawAttributes']);_0x2f237f[_0x1283('0x30')]=_[_0x1283('0x2f')](_0x2f8215[_0x1283('0x30')]);_0x2f237f[_0x1283('0x31')]=_[_0x1283('0x32')](_0x2f237f[_0x1283('0x2d')],_0x2f237f['query']);_0x2d61df['attributes']=_[_0x1283('0x32')](_0x2f237f[_0x1283('0x2d')],qs[_0x1283('0x34')](_0x2f8215[_0x1283('0x30')][_0x1283('0x34')]));_0x2d61df[_0x1283('0x33')]=_0x2d61df['attributes'][_0x1283('0x35')]?_0x2d61df[_0x1283('0x33')]:_0x2f237f[_0x1283('0x2d')];if(_0x2f8215[_0x1283('0x30')][_0x1283('0x3c')]){_0x2d61df[_0x1283('0x42')]=[{'all':!![]}];}_0x2d61df=_[_0x1283('0x3a')]({},_0x2d61df,_0x2f8215[_0x1283('0x3b')]);return db['SalesforceConfiguration'][_0x1283('0x43')](_0x2d61df)[_0x1283('0x21')](handleEntityNotFound(_0x33e1db,null))[_0x1283('0x21')](respondWithResult(_0x33e1db,null))[_0x1283('0x3f')](handleError(_0x33e1db,null));};exports[_0x1283('0x44')]=function(_0x24164c,_0xe4cc40){return db[_0x1283('0x28')][_0x1283('0x44')](_0x24164c[_0x1283('0x45')],{})['then'](respondWithResult(_0xe4cc40,0xc9))[_0x1283('0x3f')](handleError(_0xe4cc40,null));};exports[_0x1283('0x20')]=function(_0x45d2a4,_0x2f0354){if(_0x45d2a4['body']['id']){delete _0x45d2a4['body']['id'];}return db[_0x1283('0x28')][_0x1283('0x43')]({'where':{'id':_0x45d2a4[_0x1283('0x41')]['id']}})['then'](handleEntityNotFound(_0x2f0354,null))[_0x1283('0x21')](saveUpdates(_0x45d2a4[_0x1283('0x45')],null))[_0x1283('0x21')](respondWithResult(_0x2f0354,null))[_0x1283('0x3f')](handleError(_0x2f0354,null));};exports[_0x1283('0x22')]=function(_0x5306f5,_0x468498){return db[_0x1283('0x28')][_0x1283('0x43')]({'where':{'id':_0x5306f5[_0x1283('0x41')]['id']}})[_0x1283('0x21')](handleEntityNotFound(_0x468498,null))['then'](removeEntity(_0x468498,null))[_0x1283('0x3f')](handleError(_0x468498,null));};exports[_0x1283('0x46')]=function(_0x3762fb,_0x1515cc,_0x8edd75){var _0x48f167={};var _0x87e397={};var _0x53318e;var _0x416a82;return db[_0x1283('0x28')]['findOne']({'where':{'id':_0x3762fb['params']['id']}})['then'](handleEntityNotFound(_0x1515cc,null))[_0x1283('0x21')](function(_0x126ea2){if(_0x126ea2){_0x53318e=_0x126ea2;_0x87e397[_0x1283('0x2d')]=_[_0x1283('0x2f')](db['SalesforceField'][_0x1283('0x29')]);_0x87e397[_0x1283('0x30')]=_[_0x1283('0x2f')](_0x3762fb[_0x1283('0x30')]);_0x87e397['filters']=_['intersection'](_0x87e397['model'],_0x87e397[_0x1283('0x30')]);_0x48f167[_0x1283('0x33')]=_[_0x1283('0x32')](_0x87e397[_0x1283('0x2d')],qs[_0x1283('0x34')](_0x3762fb[_0x1283('0x30')][_0x1283('0x34')]));_0x48f167[_0x1283('0x33')]=_0x48f167[_0x1283('0x33')][_0x1283('0x35')]?_0x48f167[_0x1283('0x33')]:_0x87e397[_0x1283('0x2d')];_0x48f167['order']=qs[_0x1283('0x47')](_0x3762fb[_0x1283('0x30')]['sort']);_0x48f167[_0x1283('0x37')]=qs['filters'](_[_0x1283('0x38')](_0x3762fb[_0x1283('0x30')],_0x87e397[_0x1283('0x31')]));if(_0x3762fb[_0x1283('0x30')][_0x1283('0x39')]){_0x48f167[_0x1283('0x37')]=_['merge'](_0x48f167[_0x1283('0x37')],{'$or':_[_0x1283('0x2e')](_0x48f167[_0x1283('0x33')],function(_0x5b2f58){var _0x366304={};_0x366304[_0x5b2f58]={'$like':'%'+_0x3762fb[_0x1283('0x30')][_0x1283('0x39')]+'%'};return _0x366304;})});}_0x48f167=_[_0x1283('0x3a')]({},_0x48f167,_0x3762fb[_0x1283('0x3b')]);return _0x53318e[_0x1283('0x46')](_0x48f167);}})['then'](function(_0x56f258){if(_0x56f258){_0x416a82=_0x56f258[_0x1283('0x35')];if(!_0x3762fb['query'][_0x1283('0x36')](_0x1283('0x48'))){_0x48f167[_0x1283('0x1a')]=qs[_0x1283('0x1a')](_0x3762fb[_0x1283('0x30')]['limit']);_0x48f167[_0x1283('0x18')]=qs[_0x1283('0x18')](_0x3762fb[_0x1283('0x30')][_0x1283('0x18')]);}return _0x53318e[_0x1283('0x46')](_0x48f167);}})[_0x1283('0x21')](function(_0x2ba816){if(_0x2ba816){return _0x2ba816?{'count':_0x416a82,'rows':_0x2ba816}:null;}})[_0x1283('0x21')](respondWithResult(_0x1515cc,null))[_0x1283('0x3f')](handleError(_0x1515cc,null));};exports[_0x1283('0x49')]=function(_0x17cbfe,_0x16a1c8,_0x183021){var _0x371688={};var _0x5c2cf4={};var _0x3b5a5b;var _0x33bbf3;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x17cbfe[_0x1283('0x41')]['id']}})[_0x1283('0x21')](handleEntityNotFound(_0x16a1c8,null))['then'](function(_0x409eb2){if(_0x409eb2){_0x3b5a5b=_0x409eb2;_0x5c2cf4[_0x1283('0x2d')]=_[_0x1283('0x2f')](db['SalesforceField'][_0x1283('0x29')]);_0x5c2cf4[_0x1283('0x30')]=_[_0x1283('0x2f')](_0x17cbfe['query']);_0x5c2cf4[_0x1283('0x31')]=_[_0x1283('0x32')](_0x5c2cf4[_0x1283('0x2d')],_0x5c2cf4[_0x1283('0x30')]);_0x371688['attributes']=_['intersection'](_0x5c2cf4[_0x1283('0x2d')],qs[_0x1283('0x34')](_0x17cbfe[_0x1283('0x30')]['fields']));_0x371688[_0x1283('0x33')]=_0x371688[_0x1283('0x33')]['length']?_0x371688[_0x1283('0x33')]:_0x5c2cf4['model'];_0x371688[_0x1283('0x4a')]=qs[_0x1283('0x47')](_0x17cbfe[_0x1283('0x30')][_0x1283('0x47')]);_0x371688[_0x1283('0x37')]=qs[_0x1283('0x31')](_[_0x1283('0x38')](_0x17cbfe['query'],_0x5c2cf4[_0x1283('0x31')]));if(_0x17cbfe['query'][_0x1283('0x39')]){_0x371688['where']=_['merge'](_0x371688[_0x1283('0x37')],{'$or':_[_0x1283('0x2e')](_0x371688[_0x1283('0x33')],function(_0x4fddac){var _0x3dd932={};_0x3dd932[_0x4fddac]={'$like':'%'+_0x17cbfe['query'][_0x1283('0x39')]+'%'};return _0x3dd932;})});}_0x371688=_[_0x1283('0x3a')]({},_0x371688,_0x17cbfe[_0x1283('0x3b')]);return _0x3b5a5b[_0x1283('0x49')](_0x371688);}})[_0x1283('0x21')](function(_0x9a503b){if(_0x9a503b){_0x33bbf3=_0x9a503b[_0x1283('0x35')];if(!_0x17cbfe['query'][_0x1283('0x36')]('nolimit')){_0x371688[_0x1283('0x1a')]=qs['limit'](_0x17cbfe[_0x1283('0x30')]['limit']);_0x371688[_0x1283('0x18')]=qs[_0x1283('0x18')](_0x17cbfe['query'][_0x1283('0x18')]);}return _0x3b5a5b[_0x1283('0x49')](_0x371688);}})[_0x1283('0x21')](function(_0x3cf877){if(_0x3cf877){return _0x3cf877?{'count':_0x33bbf3,'rows':_0x3cf877}:null;}})[_0x1283('0x21')](respondWithResult(_0x16a1c8,null))[_0x1283('0x3f')](handleError(_0x16a1c8,null));};exports['getDescriptions']=function(_0x3ff036,_0x5ecec8,_0x56b3be){var _0x2dc91e={};var _0x50372e={};var _0x461956;var _0x19eb58;return db['SalesforceConfiguration'][_0x1283('0x4b')]({'where':{'id':_0x3ff036[_0x1283('0x41')]['id']}})[_0x1283('0x21')](handleEntityNotFound(_0x5ecec8,null))['then'](function(_0x5792a1){if(_0x5792a1){_0x461956=_0x5792a1;_0x50372e['model']=_[_0x1283('0x2f')](db[_0x1283('0x4c')]['rawAttributes']);_0x50372e[_0x1283('0x30')]=_[_0x1283('0x2f')](_0x3ff036[_0x1283('0x30')]);_0x50372e[_0x1283('0x31')]=_[_0x1283('0x32')](_0x50372e[_0x1283('0x2d')],_0x50372e[_0x1283('0x30')]);_0x2dc91e[_0x1283('0x33')]=_['intersection'](_0x50372e[_0x1283('0x2d')],qs['fields'](_0x3ff036[_0x1283('0x30')][_0x1283('0x34')]));_0x2dc91e[_0x1283('0x33')]=_0x2dc91e[_0x1283('0x33')][_0x1283('0x35')]?_0x2dc91e[_0x1283('0x33')]:_0x50372e[_0x1283('0x2d')];_0x2dc91e[_0x1283('0x4a')]=qs['sort'](_0x3ff036[_0x1283('0x30')]['sort']);_0x2dc91e['where']=qs[_0x1283('0x31')](_['pick'](_0x3ff036[_0x1283('0x30')],_0x50372e[_0x1283('0x31')]));if(_0x3ff036['query'][_0x1283('0x39')]){_0x2dc91e['where']=_[_0x1283('0x3a')](_0x2dc91e[_0x1283('0x37')],{'$or':_['map'](_0x2dc91e['attributes'],function(_0x3eb44e){var _0x32b56d={};_0x32b56d[_0x3eb44e]={'$like':'%'+_0x3ff036['query'][_0x1283('0x39')]+'%'};return _0x32b56d;})});}_0x2dc91e=_[_0x1283('0x3a')]({},_0x2dc91e,_0x3ff036[_0x1283('0x3b')]);return _0x461956[_0x1283('0x4d')](_0x2dc91e);}})[_0x1283('0x21')](function(_0x1524c5){if(_0x1524c5){_0x19eb58=_0x1524c5['length'];if(!_0x3ff036[_0x1283('0x30')][_0x1283('0x36')](_0x1283('0x48'))){_0x2dc91e['limit']=qs[_0x1283('0x1a')](_0x3ff036[_0x1283('0x30')][_0x1283('0x1a')]);_0x2dc91e[_0x1283('0x18')]=qs[_0x1283('0x18')](_0x3ff036[_0x1283('0x30')][_0x1283('0x18')]);}return _0x461956[_0x1283('0x4d')](_0x2dc91e);}})[_0x1283('0x21')](function(_0x4ddc38){if(_0x4ddc38){return _0x4ddc38?{'count':_0x19eb58,'rows':_0x4ddc38}:null;}})[_0x1283('0x21')](respondWithResult(_0x5ecec8,null))[_0x1283('0x3f')](handleError(_0x5ecec8,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 605c18e..cff913c 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 _0x5e4f=['int_salesforce_configurations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration'];(function(_0x2ec3d1,_0x2d82b2){var _0x2551e2=function(_0x5a638b){while(--_0x5a638b){_0x2ec3d1['push'](_0x2ec3d1['shift']());}};_0x2551e2(++_0x2d82b2);}(_0x5e4f,0x1eb));var _0xf5e4=function(_0x17260f,_0x23546d){_0x17260f=_0x17260f-0x0;var _0x12fbfb=_0x5e4f[_0x17260f];return _0x12fbfb;};'use strict';var _=require(_0xf5e4('0x0'));var util=require(_0xf5e4('0x1'));var logger=require(_0xf5e4('0x2'))(_0xf5e4('0x3'));var moment=require(_0xf5e4('0x4'));var BPromise=require('bluebird');var rp=require(_0xf5e4('0x5'));var fs=require('fs');var path=require(_0xf5e4('0x6'));var rimraf=require(_0xf5e4('0x7'));var config=require(_0xf5e4('0x8'));var attributes=require(_0xf5e4('0x9'));module[_0xf5e4('0xa')]=function(_0x789c74,_0x235d72){return _0x789c74[_0xf5e4('0xb')](_0xf5e4('0xc'),attributes,{'tableName':_0xf5e4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8e48=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intSalesforceConfiguration.attributes','define','SalesforceConfiguration','int_salesforce_configurations','lodash'];(function(_0x383627,_0x5be16e){var _0x2c16a0=function(_0x569b72){while(--_0x569b72){_0x383627['push'](_0x383627['shift']());}};_0x2c16a0(++_0x5be16e);}(_0x8e48,0xdc));var _0x88e4=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x8e48[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x88e4('0x0'));var util=require(_0x88e4('0x1'));var logger=require(_0x88e4('0x2'))(_0x88e4('0x3'));var moment=require(_0x88e4('0x4'));var BPromise=require(_0x88e4('0x5'));var rp=require(_0x88e4('0x6'));var fs=require('fs');var path=require(_0x88e4('0x7'));var rimraf=require('rimraf');var config=require(_0x88e4('0x8'));var attributes=require(_0x88e4('0x9'));module['exports']=function(_0x4a8cdf,_0x339adb){return _0x4a8cdf[_0x88e4('0xa')](_0x88e4('0xb'),attributes,{'tableName':_0x88e4('0xc'),'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 980c916..849df9a 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 _0x1ee9=['http','request','then','info','request\x20sent','debug','stringify','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1ee9,0x1f0));var _0x91ee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1ee9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x91ee('0x0'));var util=require(_0x91ee('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x91ee('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x91ee('0x3'))['db'];var utils=require(_0x91ee('0x4'));var logger=require(_0x91ee('0x5'))(_0x91ee('0x6'));var config=require(_0x91ee('0x7'));var jayson=require(_0x91ee('0x8'));var client=jayson[_0x91ee('0x9')][_0x91ee('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c35be,_0x3bde66,_0x15dbe7){return new BPromise(function(_0x4b8fd,_0x304de2){return client[_0x91ee('0xb')](_0x4c35be,_0x15dbe7)[_0x91ee('0xc')](function(_0x3ef35e){logger[_0x91ee('0xd')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3bde66,_0x91ee('0xe'));logger[_0x91ee('0xf')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x3bde66,_0x91ee('0xe'),JSON[_0x91ee('0x10')](_0x3ef35e));if(_0x3ef35e[_0x91ee('0x11')]){if(_0x3ef35e[_0x91ee('0x11')][_0x91ee('0x12')]===0x1f4){logger['error'](_0x91ee('0x13'),_0x3bde66,_0x3ef35e[_0x91ee('0x11')]['message']);return _0x304de2(_0x3ef35e[_0x91ee('0x11')][_0x91ee('0x14')]);}logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x3bde66,_0x3ef35e[_0x91ee('0x11')][_0x91ee('0x14')]);return _0x4b8fd(_0x3ef35e[_0x91ee('0x11')][_0x91ee('0x14')]);}else{logger[_0x91ee('0xd')](_0x91ee('0x13'),_0x3bde66,_0x91ee('0xe'));_0x4b8fd(_0x3ef35e['result'][_0x91ee('0x14')]);}})[_0x91ee('0x15')](function(_0x34417c){logger[_0x91ee('0x11')](_0x91ee('0x13'),_0x3bde66,_0x34417c);_0x304de2(_0x34417c);});});} \ No newline at end of file +var _0x0da5=['client','http','request','then','info','request\x20sent','debug','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x264ca3,_0x65b645){var _0x156d1e=function(_0x3c2990){while(--_0x3c2990){_0x264ca3['push'](_0x264ca3['shift']());}};_0x156d1e(++_0x65b645);}(_0x0da5,0x110));var _0x50da=function(_0x1d1b1c,_0x415d51){_0x1d1b1c=_0x1d1b1c-0x0;var _0x24354a=_0x0da5[_0x1d1b1c];return _0x24354a;};'use strict';var _=require('lodash');var util=require(_0x50da('0x0'));var moment=require('moment');var BPromise=require(_0x50da('0x1'));var rs=require(_0x50da('0x2'));var fs=require('fs');var Redis=require(_0x50da('0x3'));var db=require(_0x50da('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x50da('0x5'))(_0x50da('0x6'));var config=require('../../config/environment');var jayson=require(_0x50da('0x7'));var client=jayson[_0x50da('0x8')][_0x50da('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x247e24,_0x3d5e0e,_0x3875d5){return new BPromise(function(_0x2d4fa4,_0x3d5eb9){return client[_0x50da('0xa')](_0x247e24,_0x3875d5)[_0x50da('0xb')](function(_0x3e8be8){logger[_0x50da('0xc')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3d5e0e,_0x50da('0xd'));logger[_0x50da('0xe')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x3d5e0e,_0x50da('0xd'),JSON['stringify'](_0x3e8be8));if(_0x3e8be8[_0x50da('0xf')]){if(_0x3e8be8[_0x50da('0xf')][_0x50da('0x10')]===0x1f4){logger[_0x50da('0xf')](_0x50da('0x11'),_0x3d5e0e,_0x3e8be8[_0x50da('0xf')][_0x50da('0x12')]);return _0x3d5eb9(_0x3e8be8[_0x50da('0xf')]['message']);}logger[_0x50da('0xf')](_0x50da('0x11'),_0x3d5e0e,_0x3e8be8[_0x50da('0xf')][_0x50da('0x12')]);return _0x2d4fa4(_0x3e8be8[_0x50da('0xf')][_0x50da('0x12')]);}else{logger[_0x50da('0xc')](_0x50da('0x11'),_0x3d5e0e,_0x50da('0xd'));_0x2d4fa4(_0x3e8be8['result']['message']);}})[_0x50da('0x13')](function(_0x30d363){logger[_0x50da('0xf')](_0x50da('0x11'),_0x3d5e0e,_0x30d363);_0x3d5eb9(_0x30d363);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 0a959c9..2b436ff 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 _0x3951=['./intSalesforceField.controller','get','index','/:id','isAuthenticated','show','post','create','update','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x594e62,_0x2bb443){var _0x2f3723=function(_0xbc95b8){while(--_0xbc95b8){_0x594e62['push'](_0x594e62['shift']());}};_0x2f3723(++_0x2bb443);}(_0x3951,0x1d6));var _0x1395=function(_0x9b716d,_0x3449d0){_0x9b716d=_0x9b716d-0x0;var _0x558e56=_0x3951[_0x9b716d];return _0x558e56;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1395('0x0'));var timeout=require(_0x1395('0x1'));var express=require(_0x1395('0x2'));var router=express[_0x1395('0x3')]();var fs_extra=require(_0x1395('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1395('0x5'));var config=require('../../config/environment');var controller=require(_0x1395('0x6'));router[_0x1395('0x7')]('/',auth['isAuthenticated'](),controller[_0x1395('0x8')]);router[_0x1395('0x7')](_0x1395('0x9'),auth[_0x1395('0xa')](),controller[_0x1395('0xb')]);router[_0x1395('0xc')]('/',auth['isAuthenticated'](),controller[_0x1395('0xd')]);router['put'](_0x1395('0x9'),auth['isAuthenticated'](),controller[_0x1395('0xe')]);router[_0x1395('0xf')](_0x1395('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x1395('0x10')]=router; \ No newline at end of file +var _0xafe6=['../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x12f688,_0x585c25){var _0x59c3de=function(_0x4ac301){while(--_0x4ac301){_0x12f688['push'](_0x12f688['shift']());}};_0x59c3de(++_0x585c25);}(_0xafe6,0x66));var _0x6afe=function(_0x269318,_0x4a0aad){_0x269318=_0x269318-0x0;var _0x69fc85=_0xafe6[_0x269318];return _0x69fc85;};'use strict';var multer=require(_0x6afe('0x0'));var util=require(_0x6afe('0x1'));var path=require(_0x6afe('0x2'));var timeout=require(_0x6afe('0x3'));var express=require(_0x6afe('0x4'));var router=express['Router']();var fs_extra=require(_0x6afe('0x5'));var auth=require(_0x6afe('0x6'));var interaction=require(_0x6afe('0x7'));var config=require('../../config/environment');var controller=require('./intSalesforceField.controller');router[_0x6afe('0x8')]('/',auth['isAuthenticated'](),controller[_0x6afe('0x9')]);router[_0x6afe('0x8')](_0x6afe('0xa'),auth[_0x6afe('0xb')](),controller[_0x6afe('0xc')]);router['post']('/',auth[_0x6afe('0xb')](),controller['create']);router[_0x6afe('0xd')]('/:id',auth[_0x6afe('0xb')](),controller[_0x6afe('0xe')]);router[_0x6afe('0xf')](_0x6afe('0xa'),auth[_0x6afe('0xb')](),controller[_0x6afe('0x10')]);module[_0x6afe('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index d16742d..1cb405d 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 _0xf0b8=['variable','sequelize','exports','keyValue','string','STRING'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xf0b8,0xeb));var _0x8f0b=function(_0xf0460b,_0x29897f){_0xf0460b=_0xf0460b-0x0;var _0x15f669=_0xf0b8[_0xf0460b];return _0x15f669;};'use strict';var Sequelize=require(_0x8f0b('0x0'));module[_0x8f0b('0x1')]={'type':{'type':Sequelize['ENUM']('string','variable','customVariable',_0x8f0b('0x2'),'picklist'),'defaultValue':_0x8f0b('0x3')},'content':{'type':Sequelize[_0x8f0b('0x4')]},'key':{'type':Sequelize[_0x8f0b('0x4')]},'keyType':{'type':Sequelize['ENUM'](_0x8f0b('0x3'),_0x8f0b('0x5'),'customVariable')},'keyContent':{'type':Sequelize[_0x8f0b('0x4')]},'idField':{'type':Sequelize[_0x8f0b('0x4')]},'variableName':{'type':Sequelize[_0x8f0b('0x4')]}}; \ No newline at end of file +var _0xcb96=['customVariable','keyValue','picklist','ENUM','STRING','exports','string','variable'];(function(_0x44be9b,_0x462b1a){var _0x2ba43b=function(_0x4448b7){while(--_0x4448b7){_0x44be9b['push'](_0x44be9b['shift']());}};_0x2ba43b(++_0x462b1a);}(_0xcb96,0x13d));var _0x6cb9=function(_0x4edbc6,_0x4a4766){_0x4edbc6=_0x4edbc6-0x0;var _0x307669=_0xcb96[_0x4edbc6];return _0x307669;};'use strict';var Sequelize=require('sequelize');module[_0x6cb9('0x0')]={'type':{'type':Sequelize['ENUM'](_0x6cb9('0x1'),_0x6cb9('0x2'),_0x6cb9('0x3'),_0x6cb9('0x4'),_0x6cb9('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x6cb9('0x6')](_0x6cb9('0x1'),_0x6cb9('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x6cb9('0x7')]},'idField':{'type':Sequelize[_0x6cb9('0x7')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index a76af87..96fe2a4 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 _0x3a24=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','SalesforceField','rawAttributes','type','model','query','filters','attributes','intersection','fields','nolimit','sort','pick','filter','merge','where','VIRTUAL','include','findAll','rows','catch','show','params','keys','length','includeAll','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils'];(function(_0x3f9c0e,_0x4d39be){var _0x3c152c=function(_0x2a3847){while(--_0x2a3847){_0x3f9c0e['push'](_0x3f9c0e['shift']());}};_0x3c152c(++_0x4d39be);}(_0x3a24,0x1ef));var _0x43a2=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x3a24[_0x4b2863];return _0x567d67;};'use strict';var emlformat=require(_0x43a2('0x0'));var rimraf=require(_0x43a2('0x1'));var zipdir=require(_0x43a2('0x2'));var jsonpatch=require(_0x43a2('0x3'));var rp=require('request-promise');var moment=require(_0x43a2('0x4'));var BPromise=require(_0x43a2('0x5'));var Mustache=require(_0x43a2('0x6'));var util=require('util');var path=require(_0x43a2('0x7'));var sox=require(_0x43a2('0x8'));var csv=require(_0x43a2('0x9'));var ejs=require(_0x43a2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x43a2('0xb'));var squel=require(_0x43a2('0xc'));var crypto=require(_0x43a2('0xd'));var jsforce=require(_0x43a2('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x43a2('0xf'));var Papa=require(_0x43a2('0x10'));var Redis=require('ioredis');var authService=require(_0x43a2('0x11'));var qs=require(_0x43a2('0x12'));var as=require(_0x43a2('0x13'));var hardwareService=require(_0x43a2('0x14'));var logger=require(_0x43a2('0x15'))('api');var utils=require(_0x43a2('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x43a2('0x17'));var db=require(_0x43a2('0x18'))['db'];function respondWithStatusCode(_0x46ad93,_0x49b04e){_0x49b04e=_0x49b04e||0xcc;return function(_0x207cbf){if(_0x207cbf){return _0x46ad93[_0x43a2('0x19')](_0x49b04e);}return _0x46ad93[_0x43a2('0x1a')](_0x49b04e)[_0x43a2('0x1b')]();};}function respondWithResult(_0x2d2c06,_0x13141e){_0x13141e=_0x13141e||0xc8;return function(_0x3d764c){if(_0x3d764c){return _0x2d2c06['status'](_0x13141e)[_0x43a2('0x1c')](_0x3d764c);}};}function respondWithFilteredResult(_0x1eb78d,_0x14761e){return function(_0x489f07){if(_0x489f07){var _0x403fbf=typeof _0x14761e[_0x43a2('0x1d')]===_0x43a2('0x1e')&&typeof _0x14761e[_0x43a2('0x1f')]===_0x43a2('0x1e');var _0x23320f=_0x489f07[_0x43a2('0x20')];var _0x1d93fb=_0x403fbf?0x0:_0x14761e[_0x43a2('0x1d')];var _0x54aa5e=_0x403fbf?_0x489f07[_0x43a2('0x20')]:_0x14761e[_0x43a2('0x1d')]+_0x14761e[_0x43a2('0x1f')];var _0x20e520;if(_0x54aa5e>=_0x23320f){_0x54aa5e=_0x23320f;_0x20e520=0xc8;}else{_0x20e520=0xce;}_0x1eb78d[_0x43a2('0x1a')](_0x20e520);return _0x1eb78d['set'](_0x43a2('0x21'),_0x1d93fb+'-'+_0x54aa5e+'/'+_0x23320f)[_0x43a2('0x1c')](_0x489f07);}return null;};}function patchUpdates(_0x5336a9){return function(_0x40ffa7){try{jsonpatch[_0x43a2('0x22')](_0x40ffa7,_0x5336a9,!![]);}catch(_0x3d8507){return BPromise[_0x43a2('0x23')](_0x3d8507);}return _0x40ffa7[_0x43a2('0x24')]();};}function saveUpdates(_0x15cd06,_0x362e94){return function(_0x5b5296){if(_0x5b5296){return _0x5b5296[_0x43a2('0x25')](_0x15cd06)[_0x43a2('0x26')](function(_0xc4cdb2){return _0xc4cdb2;});}return null;};}function removeEntity(_0x50979d,_0x83abb1){return function(_0x124391){if(_0x124391){return _0x124391['destroy']()['then'](function(){_0x50979d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x400495,_0x2badc){return function(_0x393ed4){if(!_0x393ed4){_0x400495[_0x43a2('0x19')](0x194);}return _0x393ed4;};}function handleError(_0x459448,_0x456506){_0x456506=_0x456506||0x1f4;return function(_0x3fdccb){logger[_0x43a2('0x27')](_0x3fdccb[_0x43a2('0x28')]);if(_0x3fdccb[_0x43a2('0x29')]){delete _0x3fdccb[_0x43a2('0x29')];}_0x459448[_0x43a2('0x1a')](_0x456506)[_0x43a2('0x2a')](_0x3fdccb);};}exports[_0x43a2('0x2b')]=function(_0x2be955,_0xd17d2d){var _0x6c94cb={},_0x15ea8e={},_0x33ff0d={'count':0x0,'rows':[]};var _0x48d918=_[_0x43a2('0x2c')](db[_0x43a2('0x2d')][_0x43a2('0x2e')],function(_0xd195c0){return{'name':_0xd195c0['fieldName'],'type':_0xd195c0[_0x43a2('0x2f')]['key']};});_0x15ea8e[_0x43a2('0x30')]=_[_0x43a2('0x2c')](_0x48d918,_0x43a2('0x29'));_0x15ea8e['query']=_['keys'](_0x2be955[_0x43a2('0x31')]);_0x15ea8e[_0x43a2('0x32')]=_['intersection'](_0x15ea8e[_0x43a2('0x30')],_0x15ea8e[_0x43a2('0x31')]);_0x6c94cb[_0x43a2('0x33')]=_[_0x43a2('0x34')](_0x15ea8e[_0x43a2('0x30')],qs[_0x43a2('0x35')](_0x2be955[_0x43a2('0x31')][_0x43a2('0x35')]));_0x6c94cb[_0x43a2('0x33')]=_0x6c94cb[_0x43a2('0x33')]['length']?_0x6c94cb[_0x43a2('0x33')]:_0x15ea8e[_0x43a2('0x30')];if(!_0x2be955[_0x43a2('0x31')]['hasOwnProperty'](_0x43a2('0x36'))){_0x6c94cb[_0x43a2('0x1f')]=qs[_0x43a2('0x1f')](_0x2be955[_0x43a2('0x31')][_0x43a2('0x1f')]);_0x6c94cb[_0x43a2('0x1d')]=qs[_0x43a2('0x1d')](_0x2be955['query'][_0x43a2('0x1d')]);}_0x6c94cb['order']=qs['sort'](_0x2be955[_0x43a2('0x31')][_0x43a2('0x37')]);_0x6c94cb['where']=qs[_0x43a2('0x32')](_[_0x43a2('0x38')](_0x2be955[_0x43a2('0x31')],_0x15ea8e[_0x43a2('0x32')]),_0x48d918);if(_0x2be955[_0x43a2('0x31')][_0x43a2('0x39')]){_0x6c94cb['where']=_[_0x43a2('0x3a')](_0x6c94cb[_0x43a2('0x3b')],{'$or':_[_0x43a2('0x2c')](_0x48d918,function(_0x49e842){if(_0x49e842['type']!==_0x43a2('0x3c')){var _0x2f3df2={};_0x2f3df2[_0x49e842[_0x43a2('0x29')]]={'$like':'%'+_0x2be955[_0x43a2('0x31')]['filter']+'%'};return _0x2f3df2;}})});}_0x6c94cb=_[_0x43a2('0x3a')]({},_0x6c94cb,_0x2be955['options']);var _0x24d502={'where':_0x6c94cb[_0x43a2('0x3b')]};return db[_0x43a2('0x2d')][_0x43a2('0x20')](_0x24d502)[_0x43a2('0x26')](function(_0x38f052){_0x33ff0d[_0x43a2('0x20')]=_0x38f052;if(_0x2be955[_0x43a2('0x31')]['includeAll']){_0x6c94cb[_0x43a2('0x3d')]=[{'all':!![]}];}return db['SalesforceField'][_0x43a2('0x3e')](_0x6c94cb);})[_0x43a2('0x26')](function(_0x3d00b3){_0x33ff0d[_0x43a2('0x3f')]=_0x3d00b3;return _0x33ff0d;})[_0x43a2('0x26')](respondWithFilteredResult(_0xd17d2d,_0x6c94cb))[_0x43a2('0x40')](handleError(_0xd17d2d,null));};exports[_0x43a2('0x41')]=function(_0x11a8f7,_0x1ae74e){var _0x24dbf9={'raw':!![],'where':{'id':_0x11a8f7[_0x43a2('0x42')]['id']}},_0x5de55f={};_0x5de55f['model']=_[_0x43a2('0x43')](db['SalesforceField']['rawAttributes']);_0x5de55f[_0x43a2('0x31')]=_[_0x43a2('0x43')](_0x11a8f7[_0x43a2('0x31')]);_0x5de55f[_0x43a2('0x32')]=_['intersection'](_0x5de55f[_0x43a2('0x30')],_0x5de55f['query']);_0x24dbf9['attributes']=_[_0x43a2('0x34')](_0x5de55f[_0x43a2('0x30')],qs['fields'](_0x11a8f7[_0x43a2('0x31')]['fields']));_0x24dbf9[_0x43a2('0x33')]=_0x24dbf9[_0x43a2('0x33')][_0x43a2('0x44')]?_0x24dbf9[_0x43a2('0x33')]:_0x5de55f[_0x43a2('0x30')];if(_0x11a8f7[_0x43a2('0x31')][_0x43a2('0x45')]){_0x24dbf9['include']=[{'all':!![]}];}_0x24dbf9=_[_0x43a2('0x3a')]({},_0x24dbf9,_0x11a8f7['options']);return db[_0x43a2('0x2d')][_0x43a2('0x46')](_0x24dbf9)[_0x43a2('0x26')](handleEntityNotFound(_0x1ae74e,null))['then'](respondWithResult(_0x1ae74e,null))[_0x43a2('0x40')](handleError(_0x1ae74e,null));};exports[_0x43a2('0x47')]=function(_0x2287ab,_0x290bc9){return db['SalesforceField'][_0x43a2('0x47')](_0x2287ab[_0x43a2('0x48')],{})[_0x43a2('0x26')](respondWithResult(_0x290bc9,0xc9))['catch'](handleError(_0x290bc9,null));};exports[_0x43a2('0x25')]=function(_0x594f02,_0x49aca6){if(_0x594f02['body']['id']){delete _0x594f02[_0x43a2('0x48')]['id'];}return db[_0x43a2('0x2d')][_0x43a2('0x46')]({'where':{'id':_0x594f02[_0x43a2('0x42')]['id']}})[_0x43a2('0x26')](handleEntityNotFound(_0x49aca6,null))[_0x43a2('0x26')](saveUpdates(_0x594f02[_0x43a2('0x48')],null))[_0x43a2('0x26')](respondWithResult(_0x49aca6,null))[_0x43a2('0x40')](handleError(_0x49aca6,null));};exports[_0x43a2('0x49')]=function(_0x40fca3,_0xcba6f6){return db[_0x43a2('0x2d')]['find']({'where':{'id':_0x40fca3[_0x43a2('0x42')]['id']}})[_0x43a2('0x26')](handleEntityNotFound(_0xcba6f6,null))[_0x43a2('0x26')](removeEntity(_0xcba6f6,null))[_0x43a2('0x40')](handleError(_0xcba6f6,null));}; \ No newline at end of file +var _0xdfc9=['catch','show','params','keys','attributes','includeAll','include','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','apply','reject','save','update','then','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','SalesforceField','findAll','rows'];(function(_0x2a43db,_0x1c448c){var _0x2a504b=function(_0x3726a9){while(--_0x3726a9){_0x2a43db['push'](_0x2a43db['shift']());}};_0x2a504b(++_0x1c448c);}(_0xdfc9,0xf7));var _0x9dfc=function(_0x3abe58,_0x184dd9){_0x3abe58=_0x3abe58-0x0;var _0x457389=_0xdfc9[_0x3abe58];return _0x457389;};'use strict';var emlformat=require(_0x9dfc('0x0'));var rimraf=require(_0x9dfc('0x1'));var zipdir=require(_0x9dfc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9dfc('0x3'));var moment=require(_0x9dfc('0x4'));var BPromise=require(_0x9dfc('0x5'));var Mustache=require(_0x9dfc('0x6'));var util=require('util');var path=require(_0x9dfc('0x7'));var sox=require(_0x9dfc('0x8'));var csv=require('to-csv');var ejs=require(_0x9dfc('0x9'));var fs=require('fs');var fs_extra=require(_0x9dfc('0xa'));var _=require(_0x9dfc('0xb'));var squel=require(_0x9dfc('0xc'));var crypto=require(_0x9dfc('0xd'));var jsforce=require(_0x9dfc('0xe'));var deskjs=require(_0x9dfc('0xf'));var toCsv=require(_0x9dfc('0x10'));var querystring=require(_0x9dfc('0x11'));var Papa=require(_0x9dfc('0x12'));var Redis=require(_0x9dfc('0x13'));var authService=require(_0x9dfc('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x9dfc('0x15'));var hardwareService=require(_0x9dfc('0x16'));var logger=require(_0x9dfc('0x17'))('api');var utils=require(_0x9dfc('0x18'));var config=require(_0x9dfc('0x19'));var licenseUtil=require(_0x9dfc('0x1a'));var db=require(_0x9dfc('0x1b'))['db'];function respondWithStatusCode(_0x5125af,_0x43d00f){_0x43d00f=_0x43d00f||0xcc;return function(_0x515b48){if(_0x515b48){return _0x5125af[_0x9dfc('0x1c')](_0x43d00f);}return _0x5125af[_0x9dfc('0x1d')](_0x43d00f)[_0x9dfc('0x1e')]();};}function respondWithResult(_0x5827a7,_0x2d3151){_0x2d3151=_0x2d3151||0xc8;return function(_0x228c71){if(_0x228c71){return _0x5827a7['status'](_0x2d3151)[_0x9dfc('0x1f')](_0x228c71);}};}function respondWithFilteredResult(_0x5ba5a0,_0x2356db){return function(_0x87a0f9){if(_0x87a0f9){var _0x13cdf5=typeof _0x2356db['offset']===_0x9dfc('0x20')&&typeof _0x2356db['limit']===_0x9dfc('0x20');var _0x53ccd6=_0x87a0f9[_0x9dfc('0x21')];var _0x553551=_0x13cdf5?0x0:_0x2356db[_0x9dfc('0x22')];var _0x30209d=_0x13cdf5?_0x87a0f9['count']:_0x2356db[_0x9dfc('0x22')]+_0x2356db['limit'];var _0x13183d;if(_0x30209d>=_0x53ccd6){_0x30209d=_0x53ccd6;_0x13183d=0xc8;}else{_0x13183d=0xce;}_0x5ba5a0[_0x9dfc('0x1d')](_0x13183d);return _0x5ba5a0[_0x9dfc('0x23')]('Content-Range',_0x553551+'-'+_0x30209d+'/'+_0x53ccd6)[_0x9dfc('0x1f')](_0x87a0f9);}return null;};}function patchUpdates(_0x55292b){return function(_0x42cabd){try{jsonpatch[_0x9dfc('0x24')](_0x42cabd,_0x55292b,!![]);}catch(_0x45a9fd){return BPromise[_0x9dfc('0x25')](_0x45a9fd);}return _0x42cabd[_0x9dfc('0x26')]();};}function saveUpdates(_0x16d14d,_0xbe256b){return function(_0x5cfaa3){if(_0x5cfaa3){return _0x5cfaa3[_0x9dfc('0x27')](_0x16d14d)[_0x9dfc('0x28')](function(_0x27839e){return _0x27839e;});}return null;};}function removeEntity(_0x254112,_0x4d702e){return function(_0x38b4a9){if(_0x38b4a9){return _0x38b4a9['destroy']()[_0x9dfc('0x28')](function(){_0x254112['status'](0xcc)[_0x9dfc('0x1e')]();});}};}function handleEntityNotFound(_0x5e8b65,_0x6d6a01){return function(_0x178d82){if(!_0x178d82){_0x5e8b65[_0x9dfc('0x1c')](0x194);}return _0x178d82;};}function handleError(_0x117e93,_0x28b478){_0x28b478=_0x28b478||0x1f4;return function(_0xf62bd2){logger[_0x9dfc('0x29')](_0xf62bd2[_0x9dfc('0x2a')]);if(_0xf62bd2['name']){delete _0xf62bd2[_0x9dfc('0x2b')];}_0x117e93['status'](_0x28b478)['send'](_0xf62bd2);};}exports[_0x9dfc('0x2c')]=function(_0x56bf8d,_0x467f9e){var _0x473a6e={},_0x21e601={},_0xf058cb={'count':0x0,'rows':[]};var _0x5c866e=_[_0x9dfc('0x2d')](db['SalesforceField'][_0x9dfc('0x2e')],function(_0x399fa4){return{'name':_0x399fa4[_0x9dfc('0x2f')],'type':_0x399fa4[_0x9dfc('0x30')][_0x9dfc('0x31')]};});_0x21e601[_0x9dfc('0x32')]=_[_0x9dfc('0x2d')](_0x5c866e,'name');_0x21e601[_0x9dfc('0x33')]=_['keys'](_0x56bf8d[_0x9dfc('0x33')]);_0x21e601[_0x9dfc('0x34')]=_[_0x9dfc('0x35')](_0x21e601[_0x9dfc('0x32')],_0x21e601['query']);_0x473a6e['attributes']=_[_0x9dfc('0x35')](_0x21e601[_0x9dfc('0x32')],qs[_0x9dfc('0x36')](_0x56bf8d[_0x9dfc('0x33')][_0x9dfc('0x36')]));_0x473a6e['attributes']=_0x473a6e['attributes'][_0x9dfc('0x37')]?_0x473a6e['attributes']:_0x21e601[_0x9dfc('0x32')];if(!_0x56bf8d['query'][_0x9dfc('0x38')](_0x9dfc('0x39'))){_0x473a6e[_0x9dfc('0x3a')]=qs[_0x9dfc('0x3a')](_0x56bf8d['query']['limit']);_0x473a6e[_0x9dfc('0x22')]=qs[_0x9dfc('0x22')](_0x56bf8d['query'][_0x9dfc('0x22')]);}_0x473a6e[_0x9dfc('0x3b')]=qs['sort'](_0x56bf8d[_0x9dfc('0x33')][_0x9dfc('0x3c')]);_0x473a6e[_0x9dfc('0x3d')]=qs['filters'](_[_0x9dfc('0x3e')](_0x56bf8d[_0x9dfc('0x33')],_0x21e601['filters']),_0x5c866e);if(_0x56bf8d[_0x9dfc('0x33')][_0x9dfc('0x3f')]){_0x473a6e[_0x9dfc('0x3d')]=_[_0x9dfc('0x40')](_0x473a6e[_0x9dfc('0x3d')],{'$or':_['map'](_0x5c866e,function(_0x56c933){if(_0x56c933[_0x9dfc('0x30')]!=='VIRTUAL'){var _0x3c1622={};_0x3c1622[_0x56c933[_0x9dfc('0x2b')]]={'$like':'%'+_0x56bf8d['query']['filter']+'%'};return _0x3c1622;}})});}_0x473a6e=_[_0x9dfc('0x40')]({},_0x473a6e,_0x56bf8d[_0x9dfc('0x41')]);var _0x4c410c={'where':_0x473a6e[_0x9dfc('0x3d')]};return db[_0x9dfc('0x42')][_0x9dfc('0x21')](_0x4c410c)[_0x9dfc('0x28')](function(_0x19ca49){_0xf058cb[_0x9dfc('0x21')]=_0x19ca49;if(_0x56bf8d['query']['includeAll']){_0x473a6e['include']=[{'all':!![]}];}return db['SalesforceField'][_0x9dfc('0x43')](_0x473a6e);})[_0x9dfc('0x28')](function(_0x5da6a4){_0xf058cb[_0x9dfc('0x44')]=_0x5da6a4;return _0xf058cb;})[_0x9dfc('0x28')](respondWithFilteredResult(_0x467f9e,_0x473a6e))[_0x9dfc('0x45')](handleError(_0x467f9e,null));};exports[_0x9dfc('0x46')]=function(_0x364056,_0xe9736f){var _0x15b7a4={'raw':!![],'where':{'id':_0x364056[_0x9dfc('0x47')]['id']}},_0x390922={};_0x390922['model']=_[_0x9dfc('0x48')](db[_0x9dfc('0x42')]['rawAttributes']);_0x390922['query']=_[_0x9dfc('0x48')](_0x364056['query']);_0x390922['filters']=_['intersection'](_0x390922[_0x9dfc('0x32')],_0x390922[_0x9dfc('0x33')]);_0x15b7a4[_0x9dfc('0x49')]=_['intersection'](_0x390922['model'],qs[_0x9dfc('0x36')](_0x364056['query'][_0x9dfc('0x36')]));_0x15b7a4[_0x9dfc('0x49')]=_0x15b7a4['attributes']['length']?_0x15b7a4[_0x9dfc('0x49')]:_0x390922['model'];if(_0x364056[_0x9dfc('0x33')][_0x9dfc('0x4a')]){_0x15b7a4[_0x9dfc('0x4b')]=[{'all':!![]}];}_0x15b7a4=_[_0x9dfc('0x40')]({},_0x15b7a4,_0x364056['options']);return db[_0x9dfc('0x42')][_0x9dfc('0x4c')](_0x15b7a4)[_0x9dfc('0x28')](handleEntityNotFound(_0xe9736f,null))[_0x9dfc('0x28')](respondWithResult(_0xe9736f,null))[_0x9dfc('0x45')](handleError(_0xe9736f,null));};exports['create']=function(_0x45c250,_0x4fec32){return db[_0x9dfc('0x42')][_0x9dfc('0x4d')](_0x45c250['body'],{})[_0x9dfc('0x28')](respondWithResult(_0x4fec32,0xc9))[_0x9dfc('0x45')](handleError(_0x4fec32,null));};exports[_0x9dfc('0x27')]=function(_0xc71657,_0xaa301c){if(_0xc71657[_0x9dfc('0x4e')]['id']){delete _0xc71657['body']['id'];}return db[_0x9dfc('0x42')][_0x9dfc('0x4c')]({'where':{'id':_0xc71657[_0x9dfc('0x47')]['id']}})[_0x9dfc('0x28')](handleEntityNotFound(_0xaa301c,null))[_0x9dfc('0x28')](saveUpdates(_0xc71657[_0x9dfc('0x4e')],null))[_0x9dfc('0x28')](respondWithResult(_0xaa301c,null))[_0x9dfc('0x45')](handleError(_0xaa301c,null));};exports['destroy']=function(_0x421b85,_0x3df7f1){return db[_0x9dfc('0x42')]['find']({'where':{'id':_0x421b85['params']['id']}})[_0x9dfc('0x28')](handleEntityNotFound(_0x3df7f1,null))[_0x9dfc('0x28')](removeEntity(_0x3df7f1,null))[_0x9dfc('0x45')](handleError(_0x3df7f1,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index c15b280..1cbf10c 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 _0x116e=['path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x533437,_0x4d59d1){var _0x53f4ce=function(_0x483f6b){while(--_0x483f6b){_0x533437['push'](_0x533437['shift']());}};_0x53f4ce(++_0x4d59d1);}(_0x116e,0x89));var _0xe116=function(_0x5b360e,_0x494136){_0x5b360e=_0x5b360e-0x0;var _0x1bf752=_0x116e[_0x5b360e];return _0x1bf752;};'use strict';var _=require(_0xe116('0x0'));var util=require(_0xe116('0x1'));var logger=require(_0xe116('0x2'))(_0xe116('0x3'));var moment=require(_0xe116('0x4'));var BPromise=require(_0xe116('0x5'));var rp=require(_0xe116('0x6'));var fs=require('fs');var path=require(_0xe116('0x7'));var rimraf=require(_0xe116('0x8'));var config=require(_0xe116('0x9'));var attributes=require(_0xe116('0xa'));module[_0xe116('0xb')]=function(_0x458f98,_0x20d394){return _0x458f98[_0xe116('0xc')](_0xe116('0xd'),attributes,{'tableName':_0xe116('0xe'),'paranoid':![],'indexes':[{'name':_0xe116('0xf'),'fields':[_0xe116('0x10'),_0xe116('0x11')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2256=['define','SalesforceField','int_salesforce_fields','idField','lodash','util','api','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x4dfc95,_0xd18318){var _0xacbe75=function(_0x24f83d){while(--_0x24f83d){_0x4dfc95['push'](_0x4dfc95['shift']());}};_0xacbe75(++_0xd18318);}(_0x2256,0xc4));var _0x6225=function(_0x49f36d,_0x2928ee){_0x49f36d=_0x49f36d-0x0;var _0x43bf1e=_0x2256[_0x49f36d];return _0x43bf1e;};'use strict';var _=require(_0x6225('0x0'));var util=require(_0x6225('0x1'));var logger=require('../../config/logger')(_0x6225('0x2'));var moment=require('moment');var BPromise=require(_0x6225('0x3'));var rp=require(_0x6225('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6225('0x5'));var config=require(_0x6225('0x6'));var attributes=require('./intSalesforceField.attributes');module[_0x6225('0x7')]=function(_0x15e67,_0xd78dae){return _0x15e67[_0x6225('0x8')](_0x6225('0x9'),attributes,{'tableName':_0x6225('0xa'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x6225('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index 8ea9398..6f73ce7 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 _0x81c7=['SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','info','SalesforceField,\x20%s,\x20%s'];(function(_0x43afae,_0x5279fc){var _0x2e59c4=function(_0x63e392){while(--_0x63e392){_0x43afae['push'](_0x43afae['shift']());}};_0x2e59c4(++_0x5279fc);}(_0x81c7,0x196));var _0x781c=function(_0x8d8187,_0x489c8a){_0x8d8187=_0x8d8187-0x0;var _0x4d7bbb=_0x81c7[_0x8d8187];return _0x4d7bbb;};'use strict';var _=require(_0x781c('0x0'));var util=require(_0x781c('0x1'));var moment=require(_0x781c('0x2'));var BPromise=require(_0x781c('0x3'));var rs=require(_0x781c('0x4'));var fs=require('fs');var Redis=require(_0x781c('0x5'));var db=require(_0x781c('0x6'))['db'];var utils=require(_0x781c('0x7'));var logger=require('../../config/logger')(_0x781c('0x8'));var config=require(_0x781c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x781c('0xa')][_0x781c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x595d79,_0x3e641f,_0x77bbfa){return new BPromise(function(_0x11d631,_0x2193d3){return client['request'](_0x595d79,_0x77bbfa)['then'](function(_0x47c833){logger[_0x781c('0xc')](_0x781c('0xd'),_0x3e641f,'request\x20sent');logger['debug'](_0x781c('0xe'),_0x3e641f,'request\x20sent',JSON[_0x781c('0xf')](_0x47c833));if(_0x47c833[_0x781c('0x10')]){if(_0x47c833[_0x781c('0x10')]['code']===0x1f4){logger[_0x781c('0x10')]('SalesforceField,\x20%s,\x20%s',_0x3e641f,_0x47c833[_0x781c('0x10')][_0x781c('0x11')]);return _0x2193d3(_0x47c833[_0x781c('0x10')][_0x781c('0x11')]);}logger['error']('SalesforceField,\x20%s,\x20%s',_0x3e641f,_0x47c833[_0x781c('0x10')][_0x781c('0x11')]);return _0x11d631(_0x47c833[_0x781c('0x10')][_0x781c('0x11')]);}else{logger['info'](_0x781c('0xd'),_0x3e641f,_0x781c('0x12'));_0x11d631(_0x47c833[_0x781c('0x13')]['message']);}})[_0x781c('0x14')](function(_0x550a7f){logger[_0x781c('0x10')](_0x781c('0xd'),_0x3e641f,_0x550a7f);_0x2193d3(_0x550a7f);});});} \ No newline at end of file +var _0xb5c2=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','request','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','SalesforceField,\x20%s,\x20%s','message','info','result'];(function(_0x41b8d1,_0x3cc4c3){var _0x2c87ef=function(_0xff4d3e){while(--_0xff4d3e){_0x41b8d1['push'](_0x41b8d1['shift']());}};_0x2c87ef(++_0x3cc4c3);}(_0xb5c2,0x1a5));var _0x2b5c=function(_0x28b40b,_0x57989b){_0x28b40b=_0x28b40b-0x0;var _0xcff5bf=_0xb5c2[_0x28b40b];return _0xcff5bf;};'use strict';var _=require(_0x2b5c('0x0'));var util=require(_0x2b5c('0x1'));var moment=require(_0x2b5c('0x2'));var BPromise=require(_0x2b5c('0x3'));var rs=require(_0x2b5c('0x4'));var fs=require('fs');var Redis=require(_0x2b5c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2b5c('0x6'));var logger=require('../../config/logger')(_0x2b5c('0x7'));var config=require(_0x2b5c('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x52ac4d,_0x527013,_0xa5f5b){return new BPromise(function(_0x4aeb5e,_0x1621fd){return client[_0x2b5c('0x9')](_0x52ac4d,_0xa5f5b)['then'](function(_0x9e7692){logger['info']('SalesforceField,\x20%s,\x20%s',_0x527013,_0x2b5c('0xa'));logger[_0x2b5c('0xb')](_0x2b5c('0xc'),_0x527013,_0x2b5c('0xa'),JSON[_0x2b5c('0xd')](_0x9e7692));if(_0x9e7692[_0x2b5c('0xe')]){if(_0x9e7692[_0x2b5c('0xe')]['code']===0x1f4){logger[_0x2b5c('0xe')](_0x2b5c('0xf'),_0x527013,_0x9e7692[_0x2b5c('0xe')]['message']);return _0x1621fd(_0x9e7692[_0x2b5c('0xe')][_0x2b5c('0x10')]);}logger['error'](_0x2b5c('0xf'),_0x527013,_0x9e7692[_0x2b5c('0xe')][_0x2b5c('0x10')]);return _0x4aeb5e(_0x9e7692[_0x2b5c('0xe')]['message']);}else{logger[_0x2b5c('0x11')](_0x2b5c('0xf'),_0x527013,_0x2b5c('0xa'));_0x4aeb5e(_0x9e7692[_0x2b5c('0x12')][_0x2b5c('0x10')]);}})[_0x2b5c('0x13')](function(_0x3b18ed){logger[_0x2b5c('0xe')](_0x2b5c('0xf'),_0x527013,_0x3b18ed);_0x1621fd(_0x3b18ed);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 906b4ba..062a937 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 _0xd261=['getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./intServicenowAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xd261,0x86));var _0x1d26=function(_0x2f9467,_0x40576f){_0x2f9467=_0x2f9467-0x0;var _0x39894c=_0xd261[_0x2f9467];return _0x39894c;};'use strict';var multer=require(_0x1d26('0x0'));var util=require(_0x1d26('0x1'));var path=require(_0x1d26('0x2'));var timeout=require(_0x1d26('0x3'));var express=require('express');var router=express[_0x1d26('0x4')]();var fs_extra=require(_0x1d26('0x5'));var auth=require(_0x1d26('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1d26('0x7'));router['get']('/',auth[_0x1d26('0x8')](),controller[_0x1d26('0x9')]);router[_0x1d26('0xa')](_0x1d26('0xb'),auth[_0x1d26('0x8')](),controller[_0x1d26('0xc')]);router[_0x1d26('0xa')](_0x1d26('0xd'),auth[_0x1d26('0x8')](),controller[_0x1d26('0xe')]);router[_0x1d26('0xa')](_0x1d26('0xf'),auth[_0x1d26('0x8')](),controller[_0x1d26('0x10')]);router[_0x1d26('0x11')]('/',auth['isAuthenticated'](),controller[_0x1d26('0x12')]);router[_0x1d26('0x11')](_0x1d26('0xd'),auth[_0x1d26('0x8')](),controller[_0x1d26('0x13')]);router[_0x1d26('0x14')](_0x1d26('0xb'),auth['isAuthenticated'](),controller[_0x1d26('0x15')]);router[_0x1d26('0x16')]('/:id',auth[_0x1d26('0x8')](),controller[_0x1d26('0x17')]);module[_0x1d26('0x18')]=router; \ No newline at end of file +var _0x46b9=['getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x58965a,_0x2e71db){var _0x254efc=function(_0xf14fb4){while(--_0xf14fb4){_0x58965a['push'](_0x58965a['shift']());}};_0x254efc(++_0x2e71db);}(_0x46b9,0x199));var _0x946b=function(_0xf6a1f2,_0x318851){_0xf6a1f2=_0xf6a1f2-0x0;var _0x501418=_0x46b9[_0xf6a1f2];return _0x501418;};'use strict';var multer=require(_0x946b('0x0'));var util=require('util');var path=require(_0x946b('0x1'));var timeout=require(_0x946b('0x2'));var express=require(_0x946b('0x3'));var router=express[_0x946b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x946b('0x5'));var interaction=require(_0x946b('0x6'));var config=require(_0x946b('0x7'));var controller=require(_0x946b('0x8'));router[_0x946b('0x9')]('/',auth[_0x946b('0xa')](),controller[_0x946b('0xb')]);router[_0x946b('0x9')](_0x946b('0xc'),auth[_0x946b('0xa')](),controller['show']);router['get'](_0x946b('0xd'),auth[_0x946b('0xa')](),controller[_0x946b('0xe')]);router[_0x946b('0x9')](_0x946b('0xf'),auth['isAuthenticated'](),controller[_0x946b('0x10')]);router[_0x946b('0x11')]('/',auth[_0x946b('0xa')](),controller[_0x946b('0x12')]);router[_0x946b('0x11')](_0x946b('0xd'),auth['isAuthenticated'](),controller[_0x946b('0x13')]);router[_0x946b('0x14')](_0x946b('0xc'),auth[_0x946b('0xa')](),controller[_0x946b('0x15')]);router[_0x946b('0x16')](_0x946b('0xc'),auth['isAuthenticated'](),controller[_0x946b('0x17')]);module[_0x946b('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 3dffebe..203f44b 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 _0xdd62=['remoteUri','exports','STRING'];(function(_0x3620df,_0x2a750c){var _0x4fdf2d=function(_0x329d79){while(--_0x329d79){_0x3620df['push'](_0x3620df['shift']());}};_0x4fdf2d(++_0x2a750c);}(_0xdd62,0x1c9));var _0x2dd6=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xdd62[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require('sequelize');module[_0x2dd6('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2dd6('0x1')]},'username':{'type':Sequelize[_0x2dd6('0x1')],'unique':'username'},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x2dd6('0x1')]},'remoteUri':{'type':Sequelize[_0x2dd6('0x1')],'unique':_0x2dd6('0x2')},'serverUrl':{'type':Sequelize[_0x2dd6('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x1784=['username','sequelize','exports','STRING'];(function(_0x55a45b,_0xdcc130){var _0x4b140b=function(_0x45a521){while(--_0x45a521){_0x55a45b['push'](_0x55a45b['shift']());}};_0x4b140b(++_0xdcc130);}(_0x1784,0x1e1));var _0x4178=function(_0x5de97d,_0x1141ee){_0x5de97d=_0x5de97d-0x0;var _0x2da950=_0x1784[_0x5de97d];return _0x2da950;};'use strict';var Sequelize=require(_0x4178('0x0'));module[_0x4178('0x1')]={'name':{'type':Sequelize[_0x4178('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x4178('0x2')],'unique':_0x4178('0x3')},'password':{'type':Sequelize[_0x4178('0x2')]},'email':{'type':Sequelize[_0x4178('0x2')]},'remoteUri':{'type':Sequelize[_0x4178('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x4178('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 8b016ff..3eb1d5a 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 _0x2078=['nolimit','order','sort','where','pick','filter','merge','then','includeAll','include','rows','show','params','options','find','catch','create','body','update','destroy','getConfigurations','findOne','ServicenowConfiguration','getDescriptions','channel','ServicenowField','Subjects','Descriptions','getFields','hold_reason','knowledge','subcategory','close_code','notify','severity','category','parent','made_sla','caused_by','watch_list','sys_updated_on','child_incidents','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','delivery_plan','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','additional_assignee_list','calendar_duration','close_notes','closed_by','follow_up','sys_id','contact_type','reopened_by','incident_state','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','upon_approval','correlation_id','location','username','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','password','GET','result','log','incident\x20table\x20objects','remove','includes','forEach','internalType','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','label','push','concat','ServiceNow\x20error:\x20','statusCode','test','Wrong\x20credentials','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','eml-format','zip-dir','request-promise','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','end','error','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x567083,_0x2f1805){var _0xe23776=function(_0xa6eb81){while(--_0xa6eb81){_0x567083['push'](_0x567083['shift']());}};_0xe23776(++_0x2f1805);}(_0x2078,0x13e));var _0x8207=function(_0x2e311f,_0x498a4e){_0x2e311f=_0x2e311f-0x0;var _0x1d2e8f=_0x2078[_0x2e311f];return _0x1d2e8f;};'use strict';var emlformat=require(_0x8207('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8207('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8207('0x2'));var moment=require('moment');var BPromise=require(_0x8207('0x3'));var Mustache=require('mustache');var util=require(_0x8207('0x4'));var path=require(_0x8207('0x5'));var sox=require(_0x8207('0x6'));var csv=require('to-csv');var ejs=require(_0x8207('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8207('0x8'));var squel=require(_0x8207('0x9'));var crypto=require(_0x8207('0xa'));var jsforce=require(_0x8207('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x8207('0xc'));var querystring=require(_0x8207('0xd'));var Papa=require(_0x8207('0xe'));var Redis=require(_0x8207('0xf'));var authService=require(_0x8207('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8207('0x11'));var hardwareService=require(_0x8207('0x12'));var logger=require('../../config/logger')(_0x8207('0x13'));var utils=require('../../config/utils');var config=require(_0x8207('0x14'));var licenseUtil=require(_0x8207('0x15'));var db=require(_0x8207('0x16'))['db'];var integrations=require(_0x8207('0x17'));function respondWithStatusCode(_0x55f4bf,_0x31ebfc){_0x31ebfc=_0x31ebfc||0xcc;return function(_0x222ebd){if(_0x222ebd){return _0x55f4bf[_0x8207('0x18')](_0x31ebfc);}return _0x55f4bf['status'](_0x31ebfc)['end']();};}function respondWithResult(_0x404ffc,_0x7ad9b4){_0x7ad9b4=_0x7ad9b4||0xc8;return function(_0x1158a8){if(_0x1158a8){return _0x404ffc[_0x8207('0x19')](_0x7ad9b4)[_0x8207('0x1a')](_0x1158a8);}};}function respondWithFilteredResult(_0x19bc4e,_0x49aa67){return function(_0x4ebf27){if(_0x4ebf27){var _0x371888=typeof _0x49aa67['offset']===_0x8207('0x1b')&&typeof _0x49aa67[_0x8207('0x1c')]===_0x8207('0x1b');var _0x52e5f2=_0x4ebf27[_0x8207('0x1d')];var _0x744ec5=_0x371888?0x0:_0x49aa67[_0x8207('0x1e')];var _0x5a34e2=_0x371888?_0x4ebf27[_0x8207('0x1d')]:_0x49aa67[_0x8207('0x1e')]+_0x49aa67[_0x8207('0x1c')];var _0x121694;if(_0x5a34e2>=_0x52e5f2){_0x5a34e2=_0x52e5f2;_0x121694=0xc8;}else{_0x121694=0xce;}_0x19bc4e[_0x8207('0x19')](_0x121694);return _0x19bc4e[_0x8207('0x1f')](_0x8207('0x20'),_0x744ec5+'-'+_0x5a34e2+'/'+_0x52e5f2)[_0x8207('0x1a')](_0x4ebf27);}return null;};}function patchUpdates(_0x58228e){return function(_0x10a46b){try{jsonpatch[_0x8207('0x21')](_0x10a46b,_0x58228e,!![]);}catch(_0x2fad6e){return BPromise[_0x8207('0x22')](_0x2fad6e);}return _0x10a46b[_0x8207('0x23')]();};}function saveUpdates(_0x227d81,_0x5e76ff){return function(_0xc4770d){if(_0xc4770d){return _0xc4770d['update'](_0x227d81)['then'](function(_0x5e4fd4){return _0x5e4fd4;});}return null;};}function removeEntity(_0x2e172d,_0xe8e257){return function(_0x17e14d){if(_0x17e14d){return _0x17e14d['destroy']()['then'](function(){_0x2e172d['status'](0xcc)[_0x8207('0x24')]();});}};}function handleEntityNotFound(_0x22bd69,_0x2b93f6){return function(_0x2b2fa5){if(!_0x2b2fa5){_0x22bd69[_0x8207('0x18')](0x194);}return _0x2b2fa5;};}function handleError(_0x4be241,_0x55d4ac){_0x55d4ac=_0x55d4ac||0x1f4;return function(_0x5a516b){logger[_0x8207('0x25')](_0x5a516b['stack']);if(_0x5a516b['name']){delete _0x5a516b[_0x8207('0x26')];}_0x4be241['status'](_0x55d4ac)[_0x8207('0x27')](_0x5a516b);};}exports[_0x8207('0x28')]=function(_0x36e70a,_0x33f9d2){var _0x739ad8={},_0x357ecc={},_0x5c7f07={'count':0x0,'rows':[]};var _0x72770f=_[_0x8207('0x29')](db[_0x8207('0x2a')][_0x8207('0x2b')],function(_0x1b7105){return{'name':_0x1b7105[_0x8207('0x2c')],'type':_0x1b7105[_0x8207('0x2d')][_0x8207('0x2e')]};});_0x357ecc[_0x8207('0x2f')]=_['map'](_0x72770f,'name');_0x357ecc[_0x8207('0x30')]=_[_0x8207('0x31')](_0x36e70a['query']);_0x357ecc[_0x8207('0x32')]=_[_0x8207('0x33')](_0x357ecc[_0x8207('0x2f')],_0x357ecc['query']);_0x739ad8['attributes']=_[_0x8207('0x33')](_0x357ecc[_0x8207('0x2f')],qs[_0x8207('0x34')](_0x36e70a[_0x8207('0x30')][_0x8207('0x34')]));_0x739ad8[_0x8207('0x35')]=_0x739ad8['attributes'][_0x8207('0x36')]?_0x739ad8[_0x8207('0x35')]:_0x357ecc[_0x8207('0x2f')];if(!_0x36e70a[_0x8207('0x30')][_0x8207('0x37')](_0x8207('0x38'))){_0x739ad8[_0x8207('0x1c')]=qs[_0x8207('0x1c')](_0x36e70a[_0x8207('0x30')][_0x8207('0x1c')]);_0x739ad8[_0x8207('0x1e')]=qs[_0x8207('0x1e')](_0x36e70a[_0x8207('0x30')]['offset']);}_0x739ad8[_0x8207('0x39')]=qs[_0x8207('0x3a')](_0x36e70a['query'][_0x8207('0x3a')]);_0x739ad8[_0x8207('0x3b')]=qs[_0x8207('0x32')](_[_0x8207('0x3c')](_0x36e70a[_0x8207('0x30')],_0x357ecc[_0x8207('0x32')]),_0x72770f);if(_0x36e70a[_0x8207('0x30')][_0x8207('0x3d')]){_0x739ad8[_0x8207('0x3b')]=_['merge'](_0x739ad8[_0x8207('0x3b')],{'$or':_[_0x8207('0x29')](_0x72770f,function(_0x368c03){if(_0x368c03['type']!=='VIRTUAL'){var _0x56f036={};_0x56f036[_0x368c03[_0x8207('0x26')]]={'$like':'%'+_0x36e70a[_0x8207('0x30')][_0x8207('0x3d')]+'%'};return _0x56f036;}})});}_0x739ad8=_[_0x8207('0x3e')]({},_0x739ad8,_0x36e70a['options']);var _0x51761e={'where':_0x739ad8[_0x8207('0x3b')]};return db['ServicenowAccount'][_0x8207('0x1d')](_0x51761e)[_0x8207('0x3f')](function(_0x15ddf5){_0x5c7f07[_0x8207('0x1d')]=_0x15ddf5;if(_0x36e70a[_0x8207('0x30')][_0x8207('0x40')]){_0x739ad8[_0x8207('0x41')]=[{'all':!![]}];}return db[_0x8207('0x2a')]['findAll'](_0x739ad8);})['then'](function(_0x3a1d46){_0x5c7f07[_0x8207('0x42')]=_0x3a1d46;return _0x5c7f07;})['then'](respondWithFilteredResult(_0x33f9d2,_0x739ad8))['catch'](handleError(_0x33f9d2,null));};exports[_0x8207('0x43')]=function(_0x3b9afe,_0xe6e2a5){var _0x282d19={'raw':![],'where':{'id':_0x3b9afe[_0x8207('0x44')]['id']}},_0x13b02e={};_0x13b02e[_0x8207('0x2f')]=_['keys'](db['ServicenowAccount'][_0x8207('0x2b')]);_0x13b02e[_0x8207('0x30')]=_[_0x8207('0x31')](_0x3b9afe[_0x8207('0x30')]);_0x13b02e['filters']=_[_0x8207('0x33')](_0x13b02e[_0x8207('0x2f')],_0x13b02e[_0x8207('0x30')]);_0x282d19[_0x8207('0x35')]=_[_0x8207('0x33')](_0x13b02e[_0x8207('0x2f')],qs[_0x8207('0x34')](_0x3b9afe[_0x8207('0x30')][_0x8207('0x34')]));_0x282d19[_0x8207('0x35')]=_0x282d19[_0x8207('0x35')][_0x8207('0x36')]?_0x282d19[_0x8207('0x35')]:_0x13b02e['model'];if(_0x3b9afe[_0x8207('0x30')][_0x8207('0x40')]){_0x282d19['include']=[{'all':!![]}];}_0x282d19=_[_0x8207('0x3e')]({},_0x282d19,_0x3b9afe[_0x8207('0x45')]);return db[_0x8207('0x2a')][_0x8207('0x46')](_0x282d19)['then'](handleEntityNotFound(_0xe6e2a5,null))[_0x8207('0x3f')](respondWithResult(_0xe6e2a5,null))[_0x8207('0x47')](handleError(_0xe6e2a5,null));};exports[_0x8207('0x48')]=function(_0x529417,_0x104853){return db[_0x8207('0x2a')][_0x8207('0x48')](_0x529417[_0x8207('0x49')],{})[_0x8207('0x3f')](respondWithResult(_0x104853,0xc9))[_0x8207('0x47')](handleError(_0x104853,null));};exports[_0x8207('0x4a')]=function(_0x29e756,_0x4c0c3c){if(_0x29e756[_0x8207('0x49')]['id']){delete _0x29e756[_0x8207('0x49')]['id'];}return db[_0x8207('0x2a')]['find']({'where':{'id':_0x29e756[_0x8207('0x44')]['id']}})[_0x8207('0x3f')](handleEntityNotFound(_0x4c0c3c,null))['then'](saveUpdates(_0x29e756[_0x8207('0x49')],null))[_0x8207('0x3f')](respondWithResult(_0x4c0c3c,null))[_0x8207('0x47')](handleError(_0x4c0c3c,null));};exports[_0x8207('0x4b')]=function(_0x560b08,_0x84d7ca){return db[_0x8207('0x2a')][_0x8207('0x46')]({'where':{'id':_0x560b08[_0x8207('0x44')]['id']}})[_0x8207('0x3f')](handleEntityNotFound(_0x84d7ca,null))[_0x8207('0x3f')](removeEntity(_0x84d7ca,null))[_0x8207('0x47')](handleError(_0x84d7ca,null));};exports[_0x8207('0x4c')]=function(_0xc99a9c,_0x397fa5,_0x1d96c9){var _0x292895={};var _0x19fe3d={};var _0x43acd4;var _0x1d05f2;return db[_0x8207('0x2a')][_0x8207('0x4d')]({'where':{'id':_0xc99a9c[_0x8207('0x44')]['id']}})['then'](handleEntityNotFound(_0x397fa5,null))[_0x8207('0x3f')](function(_0x177b51){if(_0x177b51){_0x43acd4=_0x177b51;_0x19fe3d[_0x8207('0x2f')]=_[_0x8207('0x31')](db[_0x8207('0x4e')][_0x8207('0x2b')]);_0x19fe3d[_0x8207('0x30')]=_[_0x8207('0x31')](_0xc99a9c[_0x8207('0x30')]);_0x19fe3d[_0x8207('0x32')]=_[_0x8207('0x33')](_0x19fe3d[_0x8207('0x2f')],_0x19fe3d[_0x8207('0x30')]);_0x292895[_0x8207('0x35')]=_[_0x8207('0x33')](_0x19fe3d[_0x8207('0x2f')],qs[_0x8207('0x34')](_0xc99a9c[_0x8207('0x30')][_0x8207('0x34')]));_0x292895[_0x8207('0x35')]=_0x292895[_0x8207('0x35')][_0x8207('0x36')]?_0x292895[_0x8207('0x35')]:_0x19fe3d[_0x8207('0x2f')];_0x292895[_0x8207('0x39')]=qs[_0x8207('0x3a')](_0xc99a9c[_0x8207('0x30')][_0x8207('0x3a')]);_0x292895[_0x8207('0x3b')]=qs[_0x8207('0x32')](_[_0x8207('0x3c')](_0xc99a9c['query'],_0x19fe3d[_0x8207('0x32')]));if(_0xc99a9c[_0x8207('0x30')]['filter']){_0x292895[_0x8207('0x3b')]=_[_0x8207('0x3e')](_0x292895['where'],{'$or':_[_0x8207('0x29')](_0x292895['attributes'],function(_0xa4bd59){var _0x9f4139={};_0x9f4139[_0xa4bd59]={'$like':'%'+_0xc99a9c['query'][_0x8207('0x3d')]+'%'};return _0x9f4139;})});}_0x292895=_[_0x8207('0x3e')]({},_0x292895,_0xc99a9c[_0x8207('0x45')]);return _0x43acd4['getConfigurations'](_0x292895);}})['then'](function(_0x53cc61){if(_0x53cc61){_0x1d05f2=_0x53cc61[_0x8207('0x36')];if(!_0xc99a9c[_0x8207('0x30')][_0x8207('0x37')](_0x8207('0x38'))){_0x292895[_0x8207('0x1c')]=qs[_0x8207('0x1c')](_0xc99a9c[_0x8207('0x30')][_0x8207('0x1c')]);_0x292895[_0x8207('0x1e')]=qs[_0x8207('0x1e')](_0xc99a9c[_0x8207('0x30')][_0x8207('0x1e')]);}return _0x43acd4['getConfigurations'](_0x292895);}})[_0x8207('0x3f')](function(_0xe56a81){if(_0xe56a81){return _0xe56a81?{'count':_0x1d05f2,'rows':_0xe56a81}:null;}})[_0x8207('0x3f')](respondWithResult(_0x397fa5,null))[_0x8207('0x47')](handleError(_0x397fa5,null));};exports['addConfiguration']=function(_0x3b0eca,_0xd8437c,_0x404af2){if(_0x3b0eca['body']['id']){delete _0x3b0eca[_0x8207('0x49')]['id'];}return db[_0x8207('0x2a')][_0x8207('0x4d')]({'where':{'id':_0x3b0eca[_0x8207('0x44')]['id']}})[_0x8207('0x3f')](handleEntityNotFound(_0xd8437c,null))[_0x8207('0x3f')](function(_0x3b6919){if(_0x3b6919){_0x3b0eca['body']['AccountId']=_0x3b6919['id'];_0x3b0eca[_0x8207('0x49')]['Subjects']=integrations['getSubjects'](_0x3b0eca[_0x8207('0x49')]['channel'],_0x3b0eca[_0x8207('0x49')]['type']);_0x3b0eca[_0x8207('0x49')]['Descriptions']=integrations[_0x8207('0x4f')](_0x3b0eca[_0x8207('0x49')][_0x8207('0x50')],_0x3b0eca['body'][_0x8207('0x2d')]);return db[_0x8207('0x4e')][_0x8207('0x48')](_0x3b0eca['body'],{'include':[{'model':db[_0x8207('0x51')],'as':_0x8207('0x52')},{'model':db[_0x8207('0x51')],'as':_0x8207('0x53')}]});}return null;})[_0x8207('0x3f')](respondWithResult(_0xd8437c,null))[_0x8207('0x47')](handleError(_0xd8437c,null));};exports[_0x8207('0x54')]=function(_0x113ed7,_0x36055a,_0x54bb4a){var _0x3d59e3=['made_sla',_0x8207('0x55'),_0x8207('0x56'),_0x8207('0x57'),_0x8207('0x58'),_0x8207('0x59'),'incident_state',_0x8207('0x5a'),_0x8207('0x5b')];var _0x375a10=[_0x8207('0x5c'),_0x8207('0x5d'),_0x8207('0x5e'),_0x8207('0x5f'),'upon_reject',_0x8207('0x60'),_0x8207('0x61'),_0x8207('0x55'),'approval_history',_0x8207('0x62'),_0x8207('0x63'),_0x8207('0x64'),_0x8207('0x65'),_0x8207('0x66'),_0x8207('0x67'),_0x8207('0x68'),_0x8207('0x69'),_0x8207('0x6a'),_0x8207('0x56'),'order',_0x8207('0x6b'),'closed_at','cmdb_ci',_0x8207('0x6c'),'impact','active',_0x8207('0x6d'),_0x8207('0x6e'),_0x8207('0x6f'),_0x8207('0x70'),_0x8207('0x71'),_0x8207('0x72'),_0x8207('0x73'),_0x8207('0x74'),_0x8207('0x75'),_0x8207('0x76'),_0x8207('0x77'),_0x8207('0x78'),_0x8207('0x79'),_0x8207('0x7a'),'approval_set','subcategory',_0x8207('0x7b'),_0x8207('0x7c'),'close_code',_0x8207('0x7d'),_0x8207('0x7e'),_0x8207('0x7f'),_0x8207('0x80'),'business_stc',_0x8207('0x81'),'description',_0x8207('0x82'),_0x8207('0x59'),'sys_class_name',_0x8207('0x83'),_0x8207('0x84'),_0x8207('0x85'),'parent_incident',_0x8207('0x86'),_0x8207('0x87'),_0x8207('0x88'),_0x8207('0x89'),'urgency',_0x8207('0x8a'),_0x8207('0x8b'),_0x8207('0x8c'),_0x8207('0x8d'),_0x8207('0x8e'),'severity',_0x8207('0x8f'),_0x8207('0x90'),'approval',_0x8207('0x91'),_0x8207('0x92'),_0x8207('0x93'),_0x8207('0x94'),_0x8207('0x95'),'escalation',_0x8207('0x96'),_0x8207('0x97'),_0x8207('0x98'),_0x8207('0x5b')];var _0x58d4d8='';var _0x1066bb='';var _0x2b39a6=[];var _0x13e366='';var _0x12ff2e='';var _0x2a62b8=[];var _0x116b53='';var _0x309236='';var _0x3cd109={};var _0x309f5b='';return db[_0x8207('0x2a')][_0x8207('0x4d')]({'where':{'id':_0x113ed7[_0x8207('0x44')]['id']},'attributes':['id',_0x8207('0x99'),'password','email',_0x8207('0x9a'),_0x8207('0x9b')]})[_0x8207('0x3f')](handleEntityNotFound(_0x36055a,null))['then'](function(_0x5f1328){if(_0x5f1328){_0x309f5b=_0x5f1328[_0x8207('0x9a')];var _0x1fd884=_0x309f5b[_0x8207('0x9c')](-0x1);if(_0x1fd884==='/'){_0x309f5b=_0x309f5b[_0x8207('0x9d')](0x0,_0x309f5b[_0x8207('0x9e')](_0x1fd884));}_0x309236=util[_0x8207('0x9f')](_0x8207('0xa0'),_0x309f5b);_0x116b53=util[_0x8207('0x9f')](_0x8207('0xa1'),_0x309f5b);_0x3cd109={'user':_0x5f1328['username'],'pass':_0x5f1328[_0x8207('0xa2')]};var _0x1b4987={'method':_0x8207('0xa3'),'uri':_0x309236+'incident?sysparm_display_value=all','auth':_0x3cd109,'json':!![]};return rp(_0x1b4987);}})[_0x8207('0x3f')](function(_0x46e172){if(_0x46e172[_0x8207('0xa4')][_0x8207('0x36')]>0x0){_0x58d4d8=_0x46e172[_0x8207('0xa4')];}console[_0x8207('0xa5')](_0x8207('0xa6'),_0x58d4d8);_0x2a62b8=[];_0x1066bb=Object['assign']([],_0x58d4d8);_[_0x8207('0xa7')](_0x1066bb,function(_0x3489be){return!_0x3d59e3[_0x8207('0xa8')](_0x3489be[_0x8207('0x26')]);});_0x1066bb[_0x8207('0xa9')](function(_0x54c690){var _0x72f158=createFieldObject(_0x116b53,_0x3cd109,_0x54c690[_0x8207('0xaa')],_0x54c690[_0x8207('0x26')],_0x54c690['label'],![]);_0x2a62b8['push'](_0x72f158);});return Promise[_0x8207('0xab')](_0x2a62b8);})[_0x8207('0x3f')](function(_0xeadc90){_0x2b39a6=_0xeadc90;_0x13e366=Object['assign']([],_0x58d4d8);console[_0x8207('0xa5')](_0x8207('0xac'),_0x58d4d8);_['remove'](_0x13e366,function(_0x50b8dd){return _0x375a10[_0x8207('0xa8')](_0x50b8dd[_0x8207('0x26')]);});console[_0x8207('0xa5')](_0x8207('0xad'),_0x13e366);_0x2a62b8=[];_0x13e366[_0x8207('0xa9')](function(_0x31e57b){var _0x30a19c=createFieldObject(_0x116b53,_0x3cd109,_0x31e57b[_0x8207('0xaa')],_0x31e57b[_0x8207('0x26')],_0x31e57b[_0x8207('0xae')],!![]);_0x2a62b8[_0x8207('0xaf')](_0x30a19c);});return Promise['all'](_0x2a62b8);})['then'](function(_0x323f5c){_0x12ff2e=_0x323f5c;var _0x1335e0=_0x2b39a6[_0x8207('0xb0')](_0x12ff2e);return{'count':_0x1335e0[_0x8207('0x36')],'rows':_0x1335e0};})['then'](respondWithResult(_0x36055a,null))[_0x8207('0x47')](function(_0x12cda9){console[_0x8207('0xa5')](_0x8207('0xb1')+_0x12cda9);var _0x37eae6=_0x113ed7[_0x8207('0x30')]['test']?0x1f4:_0x12cda9[_0x8207('0xb2')]||0x1f4;logger['error'](_0x12cda9['stack']);delete _0x12cda9[_0x8207('0x26')];if(_0x37eae6===0x191){_0x37eae6=0x190;}_0x36055a['status'](_0x37eae6)[_0x8207('0x27')](_0x113ed7[_0x8207('0x30')][_0x8207('0xb3')]?{'message':_0x8207('0xb4'),'statusCode':_0x12cda9[_0x8207('0xb2')]}:_0x12cda9);});};function createFieldObject(_0x1277d1,_0x3fffae,_0x413ca5,_0x2c6c3e,_0x125052,_0x2553cc){return new Promise(function(_0x52a32b,_0x3e5b0d){var _0x6e0048={'id':_0x2c6c3e,'name':_0x125052,'custom':_0x2553cc};if(_0x413ca5===_0x8207('0xb5')){_0x6e0048['options']=[{'name':_0x8207('0xb6'),'value':_0x8207('0xb7')},{'name':_0x8207('0xb8'),'value':_0x8207('0xb9')}];_0x52a32b(_0x6e0048);}else{var _0xf2b4e3={'method':_0x8207('0xa3'),'uri':_0x1277d1+_0x8207('0xba')+_0x2c6c3e,'auth':_0x3fffae,'json':!![]};return rp(_0xf2b4e3)[_0x8207('0x3f')](function(_0x3436a4){var _0x118241=[];if(_0x3436a4[_0x8207('0xa4')][_0x8207('0x36')]>0x0){_0x3436a4[_0x8207('0xa4')][_0x8207('0xa9')](function(_0x8a1222){if(_0x8a1222['inactive']===_0x8207('0xb9')){var _0x4247cf={'name':_0x8a1222[_0x8207('0xae')],'value':_0x8a1222['value']};_0x118241[_0x8207('0xaf')](_0x4247cf);}});}_0x6e0048[_0x8207('0x45')]=_0x118241;if(_0x6e0048[_0x8207('0x45')][_0x8207('0x36')]>0x0){_0x52a32b(_0x6e0048);}else{if(_0x2553cc==![]){_0x52a32b();}else{_0x52a32b(_0x6e0048);}}});}});} \ No newline at end of file +var _0x5cb9=['rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','options','includeAll','include','ServicenowAccount','findAll','catch','params','length','merge','find','create','body','getConfigurations','ServicenowConfiguration','pick','addConfiguration','findOne','AccountId','Descriptions','getDescriptions','channel','Subjects','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','category','parent','caused_by','watch_list','sys_updated_on','child_incidents','number','resolved_by','sys_updated_by','opened_by','user_input','state','sys_created_by','closed_at','cmdb_ci','active','work_notes_list','business_service','sys_domain_path','rfc','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','business_stc','description','calendar_duration','sys_class_name','closed_by','follow_up','parent_incident','sys_id','reopened_by','incident_state','problem_id','company','reassignment_count','severity','comments','sla_due','approval','comments_and_work_notes','due_date','reopen_count','upon_approval','password','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','assign','forEach','internalType','push','all','log','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','label','concat','ServiceNow\x20error:\x20','statusCode','error','Wrong\x20credentials','boolean','true','false','inactive','value','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','end','sendStatus','stack','name','send','index'];(function(_0x3448d8,_0x168aae){var _0x5a36bc=function(_0x1f73f8){while(--_0x1f73f8){_0x3448d8['push'](_0x3448d8['shift']());}};_0x5a36bc(++_0x168aae);}(_0x5cb9,0x136));var _0x95cb=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x5cb9[_0x2aec52];return _0x3b8835;};'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(_0x95cb('0x0'));var moment=require(_0x95cb('0x1'));var BPromise=require(_0x95cb('0x2'));var Mustache=require(_0x95cb('0x3'));var util=require(_0x95cb('0x4'));var path=require(_0x95cb('0x5'));var sox=require('sox');var csv=require(_0x95cb('0x6'));var ejs=require(_0x95cb('0x7'));var fs=require('fs');var fs_extra=require(_0x95cb('0x8'));var _=require(_0x95cb('0x9'));var squel=require(_0x95cb('0xa'));var crypto=require(_0x95cb('0xb'));var jsforce=require(_0x95cb('0xc'));var deskjs=require(_0x95cb('0xd'));var toCsv=require(_0x95cb('0x6'));var querystring=require(_0x95cb('0xe'));var Papa=require(_0x95cb('0xf'));var Redis=require(_0x95cb('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x95cb('0x11'));var as=require(_0x95cb('0x12'));var hardwareService=require(_0x95cb('0x13'));var logger=require(_0x95cb('0x14'))(_0x95cb('0x15'));var utils=require('../../config/utils');var config=require(_0x95cb('0x16'));var licenseUtil=require(_0x95cb('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x95cb('0x18'));function respondWithStatusCode(_0xac36a0,_0x2d2403){_0x2d2403=_0x2d2403||0xcc;return function(_0x19a399){if(_0x19a399){return _0xac36a0['sendStatus'](_0x2d2403);}return _0xac36a0[_0x95cb('0x19')](_0x2d2403)['end']();};}function respondWithResult(_0x2e5484,_0x355c6a){_0x355c6a=_0x355c6a||0xc8;return function(_0x45b70f){if(_0x45b70f){return _0x2e5484[_0x95cb('0x19')](_0x355c6a)[_0x95cb('0x1a')](_0x45b70f);}};}function respondWithFilteredResult(_0x311341,_0x59b1af){return function(_0x413ecd){if(_0x413ecd){var _0xf9dff7=typeof _0x59b1af[_0x95cb('0x1b')]===_0x95cb('0x1c')&&typeof _0x59b1af[_0x95cb('0x1d')]===_0x95cb('0x1c');var _0x2f0cc6=_0x413ecd[_0x95cb('0x1e')];var _0x414b17=_0xf9dff7?0x0:_0x59b1af['offset'];var _0x629440=_0xf9dff7?_0x413ecd['count']:_0x59b1af[_0x95cb('0x1b')]+_0x59b1af['limit'];var _0x36326f;if(_0x629440>=_0x2f0cc6){_0x629440=_0x2f0cc6;_0x36326f=0xc8;}else{_0x36326f=0xce;}_0x311341[_0x95cb('0x19')](_0x36326f);return _0x311341[_0x95cb('0x1f')]('Content-Range',_0x414b17+'-'+_0x629440+'/'+_0x2f0cc6)[_0x95cb('0x1a')](_0x413ecd);}return null;};}function patchUpdates(_0x122b39){return function(_0x48dae2){try{jsonpatch[_0x95cb('0x20')](_0x48dae2,_0x122b39,!![]);}catch(_0x3991d5){return BPromise[_0x95cb('0x21')](_0x3991d5);}return _0x48dae2[_0x95cb('0x22')]();};}function saveUpdates(_0x180f70,_0x37a14b){return function(_0x1db3c0){if(_0x1db3c0){return _0x1db3c0[_0x95cb('0x23')](_0x180f70)['then'](function(_0x489c27){return _0x489c27;});}return null;};}function removeEntity(_0x6334df,_0x245d37){return function(_0x254614){if(_0x254614){return _0x254614[_0x95cb('0x24')]()[_0x95cb('0x25')](function(){_0x6334df['status'](0xcc)[_0x95cb('0x26')]();});}};}function handleEntityNotFound(_0x3cb95a,_0x37d7bd){return function(_0x13af2d){if(!_0x13af2d){_0x3cb95a[_0x95cb('0x27')](0x194);}return _0x13af2d;};}function handleError(_0x4a7f6c,_0x78918f){_0x78918f=_0x78918f||0x1f4;return function(_0x420f71){logger['error'](_0x420f71[_0x95cb('0x28')]);if(_0x420f71[_0x95cb('0x29')]){delete _0x420f71['name'];}_0x4a7f6c[_0x95cb('0x19')](_0x78918f)[_0x95cb('0x2a')](_0x420f71);};}exports[_0x95cb('0x2b')]=function(_0x32b670,_0x1e6c81){var _0x2c206d={},_0x1ef23e={},_0x4e42b1={'count':0x0,'rows':[]};var _0x1f84e7=_['map'](db['ServicenowAccount'][_0x95cb('0x2c')],function(_0x75ad83){return{'name':_0x75ad83[_0x95cb('0x2d')],'type':_0x75ad83[_0x95cb('0x2e')][_0x95cb('0x2f')]};});_0x1ef23e[_0x95cb('0x30')]=_[_0x95cb('0x31')](_0x1f84e7,_0x95cb('0x29'));_0x1ef23e[_0x95cb('0x32')]=_[_0x95cb('0x33')](_0x32b670[_0x95cb('0x32')]);_0x1ef23e[_0x95cb('0x34')]=_[_0x95cb('0x35')](_0x1ef23e[_0x95cb('0x30')],_0x1ef23e[_0x95cb('0x32')]);_0x2c206d[_0x95cb('0x36')]=_[_0x95cb('0x35')](_0x1ef23e[_0x95cb('0x30')],qs[_0x95cb('0x37')](_0x32b670[_0x95cb('0x32')][_0x95cb('0x37')]));_0x2c206d['attributes']=_0x2c206d[_0x95cb('0x36')]['length']?_0x2c206d[_0x95cb('0x36')]:_0x1ef23e[_0x95cb('0x30')];if(!_0x32b670[_0x95cb('0x32')][_0x95cb('0x38')](_0x95cb('0x39'))){_0x2c206d[_0x95cb('0x1d')]=qs[_0x95cb('0x1d')](_0x32b670[_0x95cb('0x32')]['limit']);_0x2c206d[_0x95cb('0x1b')]=qs[_0x95cb('0x1b')](_0x32b670[_0x95cb('0x32')][_0x95cb('0x1b')]);}_0x2c206d['order']=qs['sort'](_0x32b670[_0x95cb('0x32')][_0x95cb('0x3a')]);_0x2c206d[_0x95cb('0x3b')]=qs[_0x95cb('0x34')](_['pick'](_0x32b670[_0x95cb('0x32')],_0x1ef23e['filters']),_0x1f84e7);if(_0x32b670[_0x95cb('0x32')][_0x95cb('0x3c')]){_0x2c206d['where']=_['merge'](_0x2c206d[_0x95cb('0x3b')],{'$or':_[_0x95cb('0x31')](_0x1f84e7,function(_0x328448){if(_0x328448[_0x95cb('0x2e')]!==_0x95cb('0x3d')){var _0x596626={};_0x596626[_0x328448[_0x95cb('0x29')]]={'$like':'%'+_0x32b670[_0x95cb('0x32')][_0x95cb('0x3c')]+'%'};return _0x596626;}})});}_0x2c206d=_['merge']({},_0x2c206d,_0x32b670[_0x95cb('0x3e')]);var _0x599607={'where':_0x2c206d[_0x95cb('0x3b')]};return db['ServicenowAccount']['count'](_0x599607)[_0x95cb('0x25')](function(_0x745389){_0x4e42b1[_0x95cb('0x1e')]=_0x745389;if(_0x32b670[_0x95cb('0x32')][_0x95cb('0x3f')]){_0x2c206d[_0x95cb('0x40')]=[{'all':!![]}];}return db[_0x95cb('0x41')][_0x95cb('0x42')](_0x2c206d);})[_0x95cb('0x25')](function(_0x2919e4){_0x4e42b1['rows']=_0x2919e4;return _0x4e42b1;})[_0x95cb('0x25')](respondWithFilteredResult(_0x1e6c81,_0x2c206d))[_0x95cb('0x43')](handleError(_0x1e6c81,null));};exports['show']=function(_0x2d7c13,_0xf76c8a){var _0x53cfef={'raw':![],'where':{'id':_0x2d7c13[_0x95cb('0x44')]['id']}},_0x47d756={};_0x47d756['model']=_[_0x95cb('0x33')](db[_0x95cb('0x41')]['rawAttributes']);_0x47d756[_0x95cb('0x32')]=_['keys'](_0x2d7c13[_0x95cb('0x32')]);_0x47d756[_0x95cb('0x34')]=_[_0x95cb('0x35')](_0x47d756[_0x95cb('0x30')],_0x47d756[_0x95cb('0x32')]);_0x53cfef['attributes']=_[_0x95cb('0x35')](_0x47d756[_0x95cb('0x30')],qs[_0x95cb('0x37')](_0x2d7c13[_0x95cb('0x32')][_0x95cb('0x37')]));_0x53cfef['attributes']=_0x53cfef[_0x95cb('0x36')][_0x95cb('0x45')]?_0x53cfef[_0x95cb('0x36')]:_0x47d756[_0x95cb('0x30')];if(_0x2d7c13['query'][_0x95cb('0x3f')]){_0x53cfef[_0x95cb('0x40')]=[{'all':!![]}];}_0x53cfef=_[_0x95cb('0x46')]({},_0x53cfef,_0x2d7c13[_0x95cb('0x3e')]);return db[_0x95cb('0x41')][_0x95cb('0x47')](_0x53cfef)[_0x95cb('0x25')](handleEntityNotFound(_0xf76c8a,null))[_0x95cb('0x25')](respondWithResult(_0xf76c8a,null))[_0x95cb('0x43')](handleError(_0xf76c8a,null));};exports[_0x95cb('0x48')]=function(_0x420e84,_0x1b72cf){return db[_0x95cb('0x41')][_0x95cb('0x48')](_0x420e84[_0x95cb('0x49')],{})[_0x95cb('0x25')](respondWithResult(_0x1b72cf,0xc9))['catch'](handleError(_0x1b72cf,null));};exports[_0x95cb('0x23')]=function(_0x2eb218,_0x1f7948){if(_0x2eb218[_0x95cb('0x49')]['id']){delete _0x2eb218[_0x95cb('0x49')]['id'];}return db[_0x95cb('0x41')]['find']({'where':{'id':_0x2eb218['params']['id']}})[_0x95cb('0x25')](handleEntityNotFound(_0x1f7948,null))[_0x95cb('0x25')](saveUpdates(_0x2eb218[_0x95cb('0x49')],null))[_0x95cb('0x25')](respondWithResult(_0x1f7948,null))[_0x95cb('0x43')](handleError(_0x1f7948,null));};exports['destroy']=function(_0x426f01,_0x35c04c){return db[_0x95cb('0x41')][_0x95cb('0x47')]({'where':{'id':_0x426f01[_0x95cb('0x44')]['id']}})[_0x95cb('0x25')](handleEntityNotFound(_0x35c04c,null))[_0x95cb('0x25')](removeEntity(_0x35c04c,null))[_0x95cb('0x43')](handleError(_0x35c04c,null));};exports[_0x95cb('0x4a')]=function(_0x2a1a8f,_0x552bc3,_0x398d9c){var _0x30f7e5={};var _0x3cce8e={};var _0x2ab3c2;var _0x26ba8f;return db['ServicenowAccount']['findOne']({'where':{'id':_0x2a1a8f[_0x95cb('0x44')]['id']}})[_0x95cb('0x25')](handleEntityNotFound(_0x552bc3,null))[_0x95cb('0x25')](function(_0x35cb47){if(_0x35cb47){_0x2ab3c2=_0x35cb47;_0x3cce8e[_0x95cb('0x30')]=_[_0x95cb('0x33')](db[_0x95cb('0x4b')]['rawAttributes']);_0x3cce8e[_0x95cb('0x32')]=_[_0x95cb('0x33')](_0x2a1a8f['query']);_0x3cce8e[_0x95cb('0x34')]=_['intersection'](_0x3cce8e[_0x95cb('0x30')],_0x3cce8e['query']);_0x30f7e5[_0x95cb('0x36')]=_[_0x95cb('0x35')](_0x3cce8e[_0x95cb('0x30')],qs[_0x95cb('0x37')](_0x2a1a8f[_0x95cb('0x32')][_0x95cb('0x37')]));_0x30f7e5[_0x95cb('0x36')]=_0x30f7e5['attributes'][_0x95cb('0x45')]?_0x30f7e5[_0x95cb('0x36')]:_0x3cce8e[_0x95cb('0x30')];_0x30f7e5['order']=qs['sort'](_0x2a1a8f[_0x95cb('0x32')][_0x95cb('0x3a')]);_0x30f7e5[_0x95cb('0x3b')]=qs[_0x95cb('0x34')](_[_0x95cb('0x4c')](_0x2a1a8f['query'],_0x3cce8e[_0x95cb('0x34')]));if(_0x2a1a8f['query'][_0x95cb('0x3c')]){_0x30f7e5[_0x95cb('0x3b')]=_['merge'](_0x30f7e5[_0x95cb('0x3b')],{'$or':_[_0x95cb('0x31')](_0x30f7e5[_0x95cb('0x36')],function(_0x49a2c4){var _0x1cd58d={};_0x1cd58d[_0x49a2c4]={'$like':'%'+_0x2a1a8f[_0x95cb('0x32')]['filter']+'%'};return _0x1cd58d;})});}_0x30f7e5=_[_0x95cb('0x46')]({},_0x30f7e5,_0x2a1a8f[_0x95cb('0x3e')]);return _0x2ab3c2[_0x95cb('0x4a')](_0x30f7e5);}})[_0x95cb('0x25')](function(_0x334ca8){if(_0x334ca8){_0x26ba8f=_0x334ca8[_0x95cb('0x45')];if(!_0x2a1a8f['query'][_0x95cb('0x38')]('nolimit')){_0x30f7e5[_0x95cb('0x1d')]=qs['limit'](_0x2a1a8f[_0x95cb('0x32')][_0x95cb('0x1d')]);_0x30f7e5[_0x95cb('0x1b')]=qs[_0x95cb('0x1b')](_0x2a1a8f[_0x95cb('0x32')][_0x95cb('0x1b')]);}return _0x2ab3c2[_0x95cb('0x4a')](_0x30f7e5);}})[_0x95cb('0x25')](function(_0x2ac087){if(_0x2ac087){return _0x2ac087?{'count':_0x26ba8f,'rows':_0x2ac087}:null;}})[_0x95cb('0x25')](respondWithResult(_0x552bc3,null))['catch'](handleError(_0x552bc3,null));};exports[_0x95cb('0x4d')]=function(_0x427cb5,_0x1033df,_0x1611a8){if(_0x427cb5['body']['id']){delete _0x427cb5['body']['id'];}return db['ServicenowAccount'][_0x95cb('0x4e')]({'where':{'id':_0x427cb5[_0x95cb('0x44')]['id']}})[_0x95cb('0x25')](handleEntityNotFound(_0x1033df,null))[_0x95cb('0x25')](function(_0x1286d8){if(_0x1286d8){_0x427cb5[_0x95cb('0x49')][_0x95cb('0x4f')]=_0x1286d8['id'];_0x427cb5[_0x95cb('0x49')]['Subjects']=integrations['getSubjects'](_0x427cb5[_0x95cb('0x49')]['channel'],_0x427cb5[_0x95cb('0x49')]['type']);_0x427cb5[_0x95cb('0x49')][_0x95cb('0x50')]=integrations[_0x95cb('0x51')](_0x427cb5[_0x95cb('0x49')][_0x95cb('0x52')],_0x427cb5[_0x95cb('0x49')]['type']);return db[_0x95cb('0x4b')][_0x95cb('0x48')](_0x427cb5[_0x95cb('0x49')],{'include':[{'model':db['ServicenowField'],'as':_0x95cb('0x53')},{'model':db[_0x95cb('0x54')],'as':_0x95cb('0x50')}]});}return null;})[_0x95cb('0x25')](respondWithResult(_0x1033df,null))[_0x95cb('0x43')](handleError(_0x1033df,null));};exports[_0x95cb('0x55')]=function(_0x345d5a,_0x48b5e7,_0x4640d8){var _0x1992d5=[_0x95cb('0x56'),_0x95cb('0x57'),_0x95cb('0x58'),_0x95cb('0x59'),_0x95cb('0x5a'),_0x95cb('0x5b'),'incident_state','severity',_0x95cb('0x5c')];var _0x407f52=[_0x95cb('0x5d'),_0x95cb('0x56'),_0x95cb('0x5e'),_0x95cb('0x5f'),'upon_reject',_0x95cb('0x60'),_0x95cb('0x61'),_0x95cb('0x57'),'approval_history',_0x95cb('0x62'),_0x95cb('0x63'),_0x95cb('0x64'),_0x95cb('0x65'),_0x95cb('0x66'),'sys_created_on','sys_domain',_0x95cb('0x67'),_0x95cb('0x68'),_0x95cb('0x58'),'order','calendar_stc',_0x95cb('0x69'),_0x95cb('0x6a'),'delivery_plan','impact',_0x95cb('0x6b'),_0x95cb('0x6c'),_0x95cb('0x6d'),'priority',_0x95cb('0x6e'),_0x95cb('0x6f'),'time_worked','expected_start',_0x95cb('0x70'),_0x95cb('0x71'),_0x95cb('0x72'),_0x95cb('0x73'),_0x95cb('0x74'),_0x95cb('0x75'),_0x95cb('0x76'),_0x95cb('0x77'),_0x95cb('0x59'),_0x95cb('0x78'),_0x95cb('0x79'),_0x95cb('0x5a'),_0x95cb('0x7a'),_0x95cb('0x7b'),_0x95cb('0x7c'),'assignment_group',_0x95cb('0x7d'),'additional_assignee_list',_0x95cb('0x7e'),_0x95cb('0x7f'),'notify',_0x95cb('0x80'),'close_notes',_0x95cb('0x81'),_0x95cb('0x82'),_0x95cb('0x83'),_0x95cb('0x84'),'contact_type',_0x95cb('0x85'),_0x95cb('0x86'),'urgency',_0x95cb('0x87'),_0x95cb('0x88'),_0x95cb('0x89'),'activity_due','assigned_to',_0x95cb('0x8a'),_0x95cb('0x8b'),_0x95cb('0x8c'),_0x95cb('0x8d'),_0x95cb('0x8e'),_0x95cb('0x8f'),'sys_mod_count',_0x95cb('0x90'),'sys_tags','escalation',_0x95cb('0x91'),'correlation_id','location',_0x95cb('0x5c')];var _0x159dbc='';var _0x464276='';var _0x16f5ac=[];var _0x405ed6='';var _0x4862a2='';var _0x4a6d94=[];var _0x25fed4='';var _0x54e124='';var _0x5d5447={};var _0x5041fa='';return db['ServicenowAccount'][_0x95cb('0x4e')]({'where':{'id':_0x345d5a[_0x95cb('0x44')]['id']},'attributes':['id','username',_0x95cb('0x92'),'email',_0x95cb('0x93'),_0x95cb('0x94')]})[_0x95cb('0x25')](handleEntityNotFound(_0x48b5e7,null))[_0x95cb('0x25')](function(_0x121ad7){if(_0x121ad7){_0x5041fa=_0x121ad7[_0x95cb('0x93')];var _0x596ef3=_0x5041fa[_0x95cb('0x95')](-0x1);if(_0x596ef3==='/'){_0x5041fa=_0x5041fa[_0x95cb('0x96')](0x0,_0x5041fa[_0x95cb('0x97')](_0x596ef3));}_0x54e124=util[_0x95cb('0x98')](_0x95cb('0x99'),_0x5041fa);_0x25fed4=util[_0x95cb('0x98')](_0x95cb('0x9a'),_0x5041fa);_0x5d5447={'user':_0x121ad7['username'],'pass':_0x121ad7[_0x95cb('0x92')]};var _0x261390={'method':_0x95cb('0x9b'),'uri':_0x54e124+_0x95cb('0x9c'),'auth':_0x5d5447,'json':!![]};return rp(_0x261390);}})[_0x95cb('0x25')](function(_0xb5e7c6){if(_0xb5e7c6[_0x95cb('0x9d')]['length']>0x0){_0x159dbc=_0xb5e7c6[_0x95cb('0x9d')];}console['log']('incident\x20table\x20objects',_0x159dbc);_0x4a6d94=[];_0x464276=Object[_0x95cb('0x9e')]([],_0x159dbc);_['remove'](_0x464276,function(_0x1c4d9f){return!_0x1992d5['includes'](_0x1c4d9f['name']);});_0x464276[_0x95cb('0x9f')](function(_0x495ddf){var _0x11c385=createFieldObject(_0x25fed4,_0x5d5447,_0x495ddf[_0x95cb('0xa0')],_0x495ddf[_0x95cb('0x29')],_0x495ddf['label'],![]);_0x4a6d94[_0x95cb('0xa1')](_0x11c385);});return Promise[_0x95cb('0xa2')](_0x4a6d94);})[_0x95cb('0x25')](function(_0x2afd50){_0x16f5ac=_0x2afd50;_0x405ed6=Object[_0x95cb('0x9e')]([],_0x159dbc);console[_0x95cb('0xa3')]('TCL:\x20_object',_0x159dbc);_['remove'](_0x405ed6,function(_0x112b9d){return _0x407f52[_0x95cb('0xa4')](_0x112b9d['name']);});console[_0x95cb('0xa3')](_0x95cb('0xa5'),_0x405ed6);_0x4a6d94=[];_0x405ed6['forEach'](function(_0x21b593){var _0x9b4f41=createFieldObject(_0x25fed4,_0x5d5447,_0x21b593['internalType'],_0x21b593[_0x95cb('0x29')],_0x21b593[_0x95cb('0xa6')],!![]);_0x4a6d94[_0x95cb('0xa1')](_0x9b4f41);});return Promise[_0x95cb('0xa2')](_0x4a6d94);})[_0x95cb('0x25')](function(_0x3acff5){_0x4862a2=_0x3acff5;var _0xdca090=_0x16f5ac[_0x95cb('0xa7')](_0x4862a2);return{'count':_0xdca090[_0x95cb('0x45')],'rows':_0xdca090};})[_0x95cb('0x25')](respondWithResult(_0x48b5e7,null))['catch'](function(_0x111f6d){console[_0x95cb('0xa3')](_0x95cb('0xa8')+_0x111f6d);var _0x3b81cd=_0x345d5a[_0x95cb('0x32')]['test']?0x1f4:_0x111f6d[_0x95cb('0xa9')]||0x1f4;logger[_0x95cb('0xaa')](_0x111f6d[_0x95cb('0x28')]);delete _0x111f6d[_0x95cb('0x29')];if(_0x3b81cd===0x191){_0x3b81cd=0x190;}_0x48b5e7[_0x95cb('0x19')](_0x3b81cd)[_0x95cb('0x2a')](_0x345d5a[_0x95cb('0x32')]['test']?{'message':_0x95cb('0xab'),'statusCode':_0x111f6d[_0x95cb('0xa9')]}:_0x111f6d);});};function createFieldObject(_0x82fd25,_0x2b0950,_0xa64e9d,_0x5cecfe,_0x57e197,_0x4083fe){return new Promise(function(_0x20aa76,_0x440003){var _0x31cef8={'id':_0x5cecfe,'name':_0x57e197,'custom':_0x4083fe};if(_0xa64e9d===_0x95cb('0xac')){_0x31cef8[_0x95cb('0x3e')]=[{'name':'True','value':_0x95cb('0xad')},{'name':'False','value':_0x95cb('0xae')}];_0x20aa76(_0x31cef8);}else{var _0xf698ec={'method':_0x95cb('0x9b'),'uri':_0x82fd25+'sys_choice?sysparm_query=name=incident^element='+_0x5cecfe,'auth':_0x2b0950,'json':!![]};return rp(_0xf698ec)[_0x95cb('0x25')](function(_0x29a553){var _0x52b895=[];if(_0x29a553['result'][_0x95cb('0x45')]>0x0){_0x29a553[_0x95cb('0x9d')]['forEach'](function(_0xaba557){if(_0xaba557[_0x95cb('0xaf')]===_0x95cb('0xae')){var _0x2da0f2={'name':_0xaba557[_0x95cb('0xa6')],'value':_0xaba557[_0x95cb('0xb0')]};_0x52b895[_0x95cb('0xa1')](_0x2da0f2);}});}_0x31cef8[_0x95cb('0x3e')]=_0x52b895;if(_0x31cef8[_0x95cb('0x3e')][_0x95cb('0x45')]>0x0){_0x20aa76(_0x31cef8);}else{if(_0x4083fe==![]){_0x20aa76();}else{_0x20aa76(_0x31cef8);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index a97536c..d0a127c 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 _0x4c60=['exports','define','ServicenowAccount','lodash','util','../../config/logger','api','bluebird','./intServicenowAccount.attributes','../../components/integrations/configuration'];(function(_0x14c158,_0x5a4e6d){var _0x49b8c8=function(_0x29625f){while(--_0x29625f){_0x14c158['push'](_0x14c158['shift']());}};_0x49b8c8(++_0x5a4e6d);}(_0x4c60,0xc1));var _0x04c6=function(_0x194471,_0x352fd8){_0x194471=_0x194471-0x0;var _0x123845=_0x4c60[_0x194471];return _0x123845;};'use strict';var _=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var logger=require(_0x04c6('0x2'))(_0x04c6('0x3'));var moment=require('moment');var BPromise=require(_0x04c6('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(_0x04c6('0x5'));var integrations=require(_0x04c6('0x6'));module[_0x04c6('0x7')]=function(_0x12bd5d,_0x2b9041){return _0x12bd5d[_0x04c6('0x8')](_0x04c6('0x9'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c5a=['int_servicenow_accounts','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','../../components/integrations/configuration'];(function(_0x4ec97e,_0x329017){var _0x18827a=function(_0x3db383){while(--_0x3db383){_0x4ec97e['push'](_0x4ec97e['shift']());}};_0x18827a(++_0x329017);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x21c775,_0x58205a){_0x21c775=_0x21c775-0x0;var _0x3d23c6=_0x9c5a[_0x21c775];return _0x3d23c6;};'use strict';var _=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var logger=require('../../config/logger')(_0xa9c5('0x2'));var moment=require(_0xa9c5('0x3'));var BPromise=require(_0xa9c5('0x4'));var rp=require(_0xa9c5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa9c5('0x6'));var config=require(_0xa9c5('0x7'));var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0xa9c5('0x8'));module['exports']=function(_0x394d84,_0x3df556){return _0x394d84['define']('ServicenowAccount',attributes,{'tableName':_0xa9c5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index c627982..67d81d4 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 _0x0320=['debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','GetServicenowAccount','ServicenowAccount','options','where','limit','include','map','model','attributes','catch','ShowServicenowAccount','find','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x5b1712,_0x7bd531){var _0x95b6db=function(_0x3d8233){while(--_0x3d8233){_0x5b1712['push'](_0x5b1712['shift']());}};_0x95b6db(++_0x7bd531);}(_0x0320,0x14f));var _0x0032=function(_0x57b98c,_0x5009ec){_0x57b98c=_0x57b98c-0x0;var _0x175a9f=_0x0320[_0x57b98c];return _0x175a9f;};'use strict';var _=require(_0x0032('0x0'));var util=require(_0x0032('0x1'));var moment=require('moment');var BPromise=require(_0x0032('0x2'));var rs=require(_0x0032('0x3'));var fs=require('fs');var Redis=require(_0x0032('0x4'));var db=require(_0x0032('0x5'))['db'];var utils=require(_0x0032('0x6'));var logger=require(_0x0032('0x7'))(_0x0032('0x8'));var config=require(_0x0032('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x33a0b2,_0x53ec4d,_0xd28475){return new BPromise(function(_0x5af965,_0x5599d5){return client[_0x0032('0xa')](_0x33a0b2,_0xd28475)[_0x0032('0xb')](function(_0x2198bc){logger[_0x0032('0xc')](_0x0032('0xd'),_0x53ec4d,_0x0032('0xe'));logger[_0x0032('0xf')](_0x0032('0x10'),_0x53ec4d,_0x0032('0xe'),JSON[_0x0032('0x11')](_0x2198bc));if(_0x2198bc['error']){if(_0x2198bc['error'][_0x0032('0x12')]===0x1f4){logger[_0x0032('0x13')](_0x0032('0xd'),_0x53ec4d,_0x2198bc[_0x0032('0x13')][_0x0032('0x14')]);return _0x5599d5(_0x2198bc[_0x0032('0x13')]['message']);}logger[_0x0032('0x13')]('ServicenowAccount,\x20%s,\x20%s',_0x53ec4d,_0x2198bc[_0x0032('0x13')][_0x0032('0x14')]);return _0x5af965(_0x2198bc['error'][_0x0032('0x14')]);}else{logger[_0x0032('0xc')]('ServicenowAccount,\x20%s,\x20%s',_0x53ec4d,_0x0032('0xe'));_0x5af965(_0x2198bc[_0x0032('0x15')][_0x0032('0x14')]);}})['catch'](function(_0x101d28){logger[_0x0032('0x13')](_0x0032('0xd'),_0x53ec4d,_0x101d28);_0x5599d5(_0x101d28);});});}exports[_0x0032('0x16')]=function(_0x4bf282){var _0x4ac857=this;return new Promise(function(_0x4150a7,_0x1ca44c){return db[_0x0032('0x17')]['findAll']({'raw':_0x4bf282['options']?_0x4bf282['options']['raw']===undefined?!![]:![]:!![],'where':_0x4bf282[_0x0032('0x18')]?_0x4bf282[_0x0032('0x18')][_0x0032('0x19')]||null:null,'attributes':_0x4bf282[_0x0032('0x18')]?_0x4bf282['options']['attributes']||null:null,'limit':_0x4bf282['options']?_0x4bf282[_0x0032('0x18')][_0x0032('0x1a')]||null:null,'include':_0x4bf282[_0x0032('0x18')]?_0x4bf282[_0x0032('0x18')][_0x0032('0x1b')]?_[_0x0032('0x1c')](_0x4bf282['options'][_0x0032('0x1b')],function(_0x4947cd){return{'model':db[_0x4947cd[_0x0032('0x1d')]],'as':_0x4947cd['as'],'attributes':_0x4947cd[_0x0032('0x1e')],'include':_0x4947cd['include']?_[_0x0032('0x1c')](_0x4947cd['include'],function(_0x4c26f1){return{'model':db[_0x4c26f1[_0x0032('0x1d')]],'as':_0x4c26f1['as'],'attributes':_0x4c26f1[_0x0032('0x1e')],'include':_0x4c26f1[_0x0032('0x1b')]?_[_0x0032('0x1c')](_0x4c26f1[_0x0032('0x1b')],function(_0x59c2af){return{'model':db[_0x59c2af[_0x0032('0x1d')]],'as':_0x59c2af['as'],'attributes':_0x59c2af[_0x0032('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0032('0xb')](function(_0x543908){logger[_0x0032('0xc')](_0x0032('0x16'),_0x4bf282);logger['debug'](_0x0032('0x16'),_0x4bf282,JSON[_0x0032('0x11')](_0x543908));_0x4150a7(_0x543908);})[_0x0032('0x1f')](function(_0x1e6252){logger['error'](_0x0032('0x16'),_0x1e6252[_0x0032('0x14')],_0x4bf282);_0x1ca44c(_0x4ac857[_0x0032('0x13')](0x1f4,_0x1e6252['message']));});});};exports[_0x0032('0x20')]=function(_0x217079){var _0x1f354d=this;return new Promise(function(_0x27dce5,_0x441437){return db[_0x0032('0x17')][_0x0032('0x21')]({'raw':_0x217079[_0x0032('0x18')]?_0x217079[_0x0032('0x18')][_0x0032('0x22')]===undefined?!![]:![]:!![],'where':_0x217079[_0x0032('0x18')]?_0x217079[_0x0032('0x18')][_0x0032('0x19')]||null:null,'attributes':_0x217079[_0x0032('0x18')]?_0x217079[_0x0032('0x18')][_0x0032('0x1e')]||null:null,'include':_0x217079[_0x0032('0x18')]?_0x217079[_0x0032('0x18')]['include']?_[_0x0032('0x1c')](_0x217079[_0x0032('0x18')][_0x0032('0x1b')],function(_0x4f619a){return{'model':db[_0x4f619a[_0x0032('0x1d')]],'as':_0x4f619a['as'],'attributes':_0x4f619a[_0x0032('0x1e')],'include':_0x4f619a[_0x0032('0x1b')]?_[_0x0032('0x1c')](_0x4f619a[_0x0032('0x1b')],function(_0x31d405){return{'model':db[_0x31d405[_0x0032('0x1d')]],'as':_0x31d405['as'],'attributes':_0x31d405[_0x0032('0x1e')],'include':_0x31d405[_0x0032('0x1b')]?_[_0x0032('0x1c')](_0x31d405[_0x0032('0x1b')],function(_0x43c904){return{'model':db[_0x43c904['model']],'as':_0x43c904['as'],'attributes':_0x43c904[_0x0032('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0032('0xb')](function(_0x594ea6){logger[_0x0032('0xc')](_0x0032('0x20'),_0x217079);logger['debug']('ShowServicenowAccount',_0x217079,JSON['stringify'](_0x594ea6));_0x27dce5(_0x594ea6);})[_0x0032('0x1f')](function(_0x23a5f5){logger['error']('ShowServicenowAccount',_0x23a5f5['message'],_0x217079);_0x441437(_0x1f354d[_0x0032('0x13')](0x1f4,_0x23a5f5[_0x0032('0x14')]));});});}; \ No newline at end of file +var _0x282b=['message','result','catch','GetServicenowAccount','ServicenowAccount','options','raw','where','attributes','limit','include','model','map','stringify','find','ShowServicenowAccount','lodash','util','moment','bluebird','randomstring','../../config/utils','jayson/promise','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','debug','request\x20sent','error','code'];(function(_0x509d3e,_0x5c9447){var _0x50fdf5=function(_0x4a3809){while(--_0x4a3809){_0x509d3e['push'](_0x509d3e['shift']());}};_0x50fdf5(++_0x5c9447);}(_0x282b,0x19c));var _0xb282=function(_0x1faaa0,_0x1a68eb){_0x1faaa0=_0x1faaa0-0x0;var _0x37654e=_0x282b[_0x1faaa0];return _0x37654e;};'use strict';var _=require(_0xb282('0x0'));var util=require(_0xb282('0x1'));var moment=require(_0xb282('0x2'));var BPromise=require(_0xb282('0x3'));var rs=require(_0xb282('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb282('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xb282('0x6'));var client=jayson[_0xb282('0x7')][_0xb282('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x12a398,_0x3ec557,_0x3c8b8a){return new BPromise(function(_0x1cfbe0,_0x30b7d2){return client[_0xb282('0x9')](_0x12a398,_0x3c8b8a)[_0xb282('0xa')](function(_0x43932e){logger[_0xb282('0xb')](_0xb282('0xc'),_0x3ec557,'request\x20sent');logger[_0xb282('0xd')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x3ec557,_0xb282('0xe'),JSON['stringify'](_0x43932e));if(_0x43932e[_0xb282('0xf')]){if(_0x43932e['error'][_0xb282('0x10')]===0x1f4){logger[_0xb282('0xf')]('ServicenowAccount,\x20%s,\x20%s',_0x3ec557,_0x43932e['error'][_0xb282('0x11')]);return _0x30b7d2(_0x43932e[_0xb282('0xf')][_0xb282('0x11')]);}logger['error'](_0xb282('0xc'),_0x3ec557,_0x43932e[_0xb282('0xf')][_0xb282('0x11')]);return _0x1cfbe0(_0x43932e[_0xb282('0xf')][_0xb282('0x11')]);}else{logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x3ec557,_0xb282('0xe'));_0x1cfbe0(_0x43932e[_0xb282('0x12')]['message']);}})[_0xb282('0x13')](function(_0xd630bd){logger['error'](_0xb282('0xc'),_0x3ec557,_0xd630bd);_0x30b7d2(_0xd630bd);});});}exports[_0xb282('0x14')]=function(_0x579a74){var _0x229019=this;return new Promise(function(_0x51ee2b,_0x5d1ecf){return db[_0xb282('0x15')]['findAll']({'raw':_0x579a74[_0xb282('0x16')]?_0x579a74[_0xb282('0x16')][_0xb282('0x17')]===undefined?!![]:![]:!![],'where':_0x579a74[_0xb282('0x16')]?_0x579a74[_0xb282('0x16')][_0xb282('0x18')]||null:null,'attributes':_0x579a74[_0xb282('0x16')]?_0x579a74[_0xb282('0x16')][_0xb282('0x19')]||null:null,'limit':_0x579a74[_0xb282('0x16')]?_0x579a74[_0xb282('0x16')][_0xb282('0x1a')]||null:null,'include':_0x579a74[_0xb282('0x16')]?_0x579a74[_0xb282('0x16')][_0xb282('0x1b')]?_['map'](_0x579a74['options'][_0xb282('0x1b')],function(_0x1e27d5){return{'model':db[_0x1e27d5['model']],'as':_0x1e27d5['as'],'attributes':_0x1e27d5['attributes'],'include':_0x1e27d5[_0xb282('0x1b')]?_['map'](_0x1e27d5['include'],function(_0x2176cd){return{'model':db[_0x2176cd[_0xb282('0x1c')]],'as':_0x2176cd['as'],'attributes':_0x2176cd[_0xb282('0x19')],'include':_0x2176cd[_0xb282('0x1b')]?_[_0xb282('0x1d')](_0x2176cd[_0xb282('0x1b')],function(_0x10ebea){return{'model':db[_0x10ebea[_0xb282('0x1c')]],'as':_0x10ebea['as'],'attributes':_0x10ebea['attributes']};}):[]};}):[]};}):[]:[]})[_0xb282('0xa')](function(_0x2db7cf){logger[_0xb282('0xb')](_0xb282('0x14'),_0x579a74);logger[_0xb282('0xd')](_0xb282('0x14'),_0x579a74,JSON[_0xb282('0x1e')](_0x2db7cf));_0x51ee2b(_0x2db7cf);})['catch'](function(_0x4c43cf){logger['error'](_0xb282('0x14'),_0x4c43cf[_0xb282('0x11')],_0x579a74);_0x5d1ecf(_0x229019[_0xb282('0xf')](0x1f4,_0x4c43cf[_0xb282('0x11')]));});});};exports['ShowServicenowAccount']=function(_0x50e55a){var _0x4a80ee=this;return new Promise(function(_0x35bd9a,_0x5d00df){return db[_0xb282('0x15')][_0xb282('0x1f')]({'raw':_0x50e55a[_0xb282('0x16')]?_0x50e55a[_0xb282('0x16')][_0xb282('0x17')]===undefined?!![]:![]:!![],'where':_0x50e55a[_0xb282('0x16')]?_0x50e55a[_0xb282('0x16')][_0xb282('0x18')]||null:null,'attributes':_0x50e55a[_0xb282('0x16')]?_0x50e55a['options'][_0xb282('0x19')]||null:null,'include':_0x50e55a[_0xb282('0x16')]?_0x50e55a[_0xb282('0x16')][_0xb282('0x1b')]?_['map'](_0x50e55a[_0xb282('0x16')][_0xb282('0x1b')],function(_0x4443e2){return{'model':db[_0x4443e2['model']],'as':_0x4443e2['as'],'attributes':_0x4443e2[_0xb282('0x19')],'include':_0x4443e2[_0xb282('0x1b')]?_[_0xb282('0x1d')](_0x4443e2['include'],function(_0x16d53e){return{'model':db[_0x16d53e['model']],'as':_0x16d53e['as'],'attributes':_0x16d53e[_0xb282('0x19')],'include':_0x16d53e[_0xb282('0x1b')]?_[_0xb282('0x1d')](_0x16d53e['include'],function(_0x4337d1){return{'model':db[_0x4337d1[_0xb282('0x1c')]],'as':_0x4337d1['as'],'attributes':_0x4337d1[_0xb282('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb282('0xa')](function(_0x390c1b){logger[_0xb282('0xb')](_0xb282('0x20'),_0x50e55a);logger[_0xb282('0xd')](_0xb282('0x20'),_0x50e55a,JSON[_0xb282('0x1e')](_0x390c1b));_0x35bd9a(_0x390c1b);})[_0xb282('0x13')](function(_0x1f2fdd){logger[_0xb282('0xf')]('ShowServicenowAccount',_0x1f2fdd[_0xb282('0x11')],_0x50e55a);_0x5d00df(_0x4a80ee['error'](0x1f4,_0x1f2fdd[_0xb282('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 28071af..01ae9d1 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 _0xb202=['/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index'];(function(_0x56c059,_0x58bc43){var _0x221a53=function(_0x300290){while(--_0x300290){_0x56c059['push'](_0x56c059['shift']());}};_0x221a53(++_0x58bc43);}(_0xb202,0x9c));var _0x2b20=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xb202[_0x3ce3c];return _0x55a2c9;};'use strict';var multer=require(_0x2b20('0x0'));var util=require(_0x2b20('0x1'));var path=require(_0x2b20('0x2'));var timeout=require(_0x2b20('0x3'));var express=require(_0x2b20('0x4'));var router=express[_0x2b20('0x5')]();var fs_extra=require(_0x2b20('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2b20('0x7'));var controller=require(_0x2b20('0x8'));router[_0x2b20('0x9')]('/',auth[_0x2b20('0xa')](),controller[_0x2b20('0xb')]);router['get'](_0x2b20('0xc'),auth[_0x2b20('0xa')](),controller[_0x2b20('0xd')]);router[_0x2b20('0x9')](_0x2b20('0xe'),auth[_0x2b20('0xa')](),controller['getFields']);router[_0x2b20('0x9')](_0x2b20('0xf'),auth['isAuthenticated'](),controller[_0x2b20('0x10')]);router[_0x2b20('0x9')](_0x2b20('0x11'),auth[_0x2b20('0xa')](),controller[_0x2b20('0x12')]);router['post']('/',auth[_0x2b20('0xa')](),controller['create']);router[_0x2b20('0x13')](_0x2b20('0xc'),auth['isAuthenticated'](),controller[_0x2b20('0x14')]);router[_0x2b20('0x15')]('/:id',auth[_0x2b20('0xa')](),controller[_0x2b20('0x16')]);module[_0x2b20('0x17')]=router; \ No newline at end of file +var _0xd102=['get','index','/:id','isAuthenticated','show','/:id/fields','getFields','getDescriptions','post','create','put','update','delete','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./intServicenowConfiguration.controller'];(function(_0x1df780,_0x40227a){var _0x2718ea=function(_0x119a75){while(--_0x119a75){_0x1df780['push'](_0x1df780['shift']());}};_0x2718ea(++_0x40227a);}(_0xd102,0x10a));var _0x2d10=function(_0x195aed,_0x452cb6){_0x195aed=_0x195aed-0x0;var _0x272e3e=_0xd102[_0x195aed];return _0x272e3e;};'use strict';var multer=require(_0x2d10('0x0'));var util=require('util');var path=require(_0x2d10('0x1'));var timeout=require(_0x2d10('0x2'));var express=require('express');var router=express[_0x2d10('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2d10('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2d10('0x5'));var controller=require(_0x2d10('0x6'));router[_0x2d10('0x7')]('/',auth['isAuthenticated'](),controller[_0x2d10('0x8')]);router[_0x2d10('0x7')](_0x2d10('0x9'),auth[_0x2d10('0xa')](),controller[_0x2d10('0xb')]);router[_0x2d10('0x7')](_0x2d10('0xc'),auth['isAuthenticated'](),controller[_0x2d10('0xd')]);router['get']('/:id/subjects',auth[_0x2d10('0xa')](),controller['getSubjects']);router[_0x2d10('0x7')]('/:id/descriptions',auth[_0x2d10('0xa')](),controller[_0x2d10('0xe')]);router[_0x2d10('0xf')]('/',auth['isAuthenticated'](),controller[_0x2d10('0x10')]);router[_0x2d10('0x11')]('/:id',auth[_0x2d10('0xa')](),controller[_0x2d10('0x12')]);router[_0x2d10('0x13')](_0x2d10('0x9'),auth[_0x2d10('0xa')](),controller['destroy']);module[_0x2d10('0x14')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 63a8d09..d0cafcb 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 _0xab67=['STRING','sequelize','exports'];(function(_0xe02eb5,_0x5f1a31){var _0x455bf0=function(_0x2a1cdb){while(--_0x2a1cdb){_0xe02eb5['push'](_0xe02eb5['shift']());}};_0x455bf0(++_0x5f1a31);}(_0xab67,0x103));var _0x7ab6=function(_0x4b2cc6,_0x29ef43){_0x4b2cc6=_0x4b2cc6-0x0;var _0x3e0b08=_0xab67[_0x4b2cc6];return _0x3e0b08;};'use strict';var Sequelize=require(_0x7ab6('0x0'));module[_0x7ab6('0x1')]={'name':{'type':Sequelize[_0x7ab6('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xeb1c=['sequelize','exports','STRING'];(function(_0x23b290,_0x1720f0){var _0x2b235b=function(_0x22bafc){while(--_0x22bafc){_0x23b290['push'](_0x23b290['shift']());}};_0x2b235b(++_0x1720f0);}(_0xeb1c,0xa5));var _0xceb1=function(_0x43783e,_0x1df0ee){_0x43783e=_0x43783e-0x0;var _0x3f105e=_0xeb1c[_0x43783e];return _0x3f105e;};'use strict';var Sequelize=require(_0xceb1('0x0'));module[_0xceb1('0x1')]={'name':{'type':Sequelize[_0xceb1('0x2')]},'description':{'type':Sequelize[_0xceb1('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 4f32a2e..6b1c809 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 _0xb359=['save','then','destroy','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','include','rows','catch','show','params','ServicenowConfiguration','find','create','body','update','getFields','findOne','ServicenowField','getSubjects','getDescriptions','eml-format','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject'];(function(_0x258389,_0x2ff900){var _0x2078ef=function(_0x3e7053){while(--_0x3e7053){_0x258389['push'](_0x258389['shift']());}};_0x2078ef(++_0x2ff900);}(_0xb359,0x16c));var _0x9b35=function(_0x2267f4,_0x376c5c){_0x2267f4=_0x2267f4-0x0;var _0xdd1add=_0xb359[_0x2267f4];return _0xdd1add;};'use strict';var emlformat=require(_0x9b35('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9b35('0x1'));var rp=require(_0x9b35('0x2'));var moment=require(_0x9b35('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9b35('0x4'));var util=require('util');var path=require(_0x9b35('0x5'));var sox=require(_0x9b35('0x6'));var csv=require(_0x9b35('0x7'));var ejs=require(_0x9b35('0x8'));var fs=require('fs');var fs_extra=require(_0x9b35('0x9'));var _=require(_0x9b35('0xa'));var squel=require(_0x9b35('0xb'));var crypto=require(_0x9b35('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9b35('0xd'));var toCsv=require(_0x9b35('0x7'));var querystring=require('querystring');var Papa=require(_0x9b35('0xe'));var Redis=require(_0x9b35('0xf'));var authService=require(_0x9b35('0x10'));var qs=require(_0x9b35('0x11'));var as=require(_0x9b35('0x12'));var hardwareService=require(_0x9b35('0x13'));var logger=require(_0x9b35('0x14'))(_0x9b35('0x15'));var utils=require(_0x9b35('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9b35('0x17'))['db'];function respondWithStatusCode(_0x538445,_0x420313){_0x420313=_0x420313||0xcc;return function(_0x250cdc){if(_0x250cdc){return _0x538445[_0x9b35('0x18')](_0x420313);}return _0x538445[_0x9b35('0x19')](_0x420313)[_0x9b35('0x1a')]();};}function respondWithResult(_0xbaf6d,_0x2ba762){_0x2ba762=_0x2ba762||0xc8;return function(_0x48a6b8){if(_0x48a6b8){return _0xbaf6d['status'](_0x2ba762)[_0x9b35('0x1b')](_0x48a6b8);}};}function respondWithFilteredResult(_0x4d29c1,_0x577e83){return function(_0x5651f2){if(_0x5651f2){var _0x22122a=typeof _0x577e83[_0x9b35('0x1c')]==='undefined'&&typeof _0x577e83[_0x9b35('0x1d')]===_0x9b35('0x1e');var _0x329949=_0x5651f2['count'];var _0x3b71ad=_0x22122a?0x0:_0x577e83[_0x9b35('0x1c')];var _0x5e7989=_0x22122a?_0x5651f2[_0x9b35('0x1f')]:_0x577e83[_0x9b35('0x1c')]+_0x577e83[_0x9b35('0x1d')];var _0x130dd4;if(_0x5e7989>=_0x329949){_0x5e7989=_0x329949;_0x130dd4=0xc8;}else{_0x130dd4=0xce;}_0x4d29c1[_0x9b35('0x19')](_0x130dd4);return _0x4d29c1[_0x9b35('0x20')](_0x9b35('0x21'),_0x3b71ad+'-'+_0x5e7989+'/'+_0x329949)[_0x9b35('0x1b')](_0x5651f2);}return null;};}function patchUpdates(_0x2252c1){return function(_0xfc9243){try{jsonpatch[_0x9b35('0x22')](_0xfc9243,_0x2252c1,!![]);}catch(_0x1f5a77){return BPromise[_0x9b35('0x23')](_0x1f5a77);}return _0xfc9243[_0x9b35('0x24')]();};}function saveUpdates(_0x41d12,_0x3bf78d){return function(_0x185d4e){if(_0x185d4e){return _0x185d4e['update'](_0x41d12)[_0x9b35('0x25')](function(_0x343ffe){return _0x343ffe;});}return null;};}function removeEntity(_0x24d14b,_0x4cec54){return function(_0x249904){if(_0x249904){return _0x249904[_0x9b35('0x26')]()[_0x9b35('0x25')](function(){_0x24d14b[_0x9b35('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28fb9b,_0x2dccdf){return function(_0x4d5486){if(!_0x4d5486){_0x28fb9b[_0x9b35('0x18')](0x194);}return _0x4d5486;};}function handleError(_0x22b9ee,_0x542786){_0x542786=_0x542786||0x1f4;return function(_0x4cddcc){logger['error'](_0x4cddcc[_0x9b35('0x27')]);if(_0x4cddcc[_0x9b35('0x28')]){delete _0x4cddcc[_0x9b35('0x28')];}_0x22b9ee[_0x9b35('0x19')](_0x542786)[_0x9b35('0x29')](_0x4cddcc);};}exports['index']=function(_0x4df15d,_0x380c21){var _0x232f1b={},_0x3ced2d={},_0x53002b={'count':0x0,'rows':[]};var _0x1230b5=_[_0x9b35('0x2a')](db['ServicenowConfiguration'][_0x9b35('0x2b')],function(_0xc732f){return{'name':_0xc732f[_0x9b35('0x2c')],'type':_0xc732f[_0x9b35('0x2d')][_0x9b35('0x2e')]};});_0x3ced2d[_0x9b35('0x2f')]=_[_0x9b35('0x2a')](_0x1230b5,_0x9b35('0x28'));_0x3ced2d[_0x9b35('0x30')]=_[_0x9b35('0x31')](_0x4df15d[_0x9b35('0x30')]);_0x3ced2d['filters']=_[_0x9b35('0x32')](_0x3ced2d[_0x9b35('0x2f')],_0x3ced2d[_0x9b35('0x30')]);_0x232f1b[_0x9b35('0x33')]=_[_0x9b35('0x32')](_0x3ced2d[_0x9b35('0x2f')],qs[_0x9b35('0x34')](_0x4df15d[_0x9b35('0x30')]['fields']));_0x232f1b['attributes']=_0x232f1b['attributes'][_0x9b35('0x35')]?_0x232f1b[_0x9b35('0x33')]:_0x3ced2d[_0x9b35('0x2f')];if(!_0x4df15d[_0x9b35('0x30')][_0x9b35('0x36')](_0x9b35('0x37'))){_0x232f1b[_0x9b35('0x1d')]=qs[_0x9b35('0x1d')](_0x4df15d[_0x9b35('0x30')]['limit']);_0x232f1b[_0x9b35('0x1c')]=qs[_0x9b35('0x1c')](_0x4df15d[_0x9b35('0x30')]['offset']);}_0x232f1b[_0x9b35('0x38')]=qs[_0x9b35('0x39')](_0x4df15d['query'][_0x9b35('0x39')]);_0x232f1b[_0x9b35('0x3a')]=qs[_0x9b35('0x3b')](_[_0x9b35('0x3c')](_0x4df15d['query'],_0x3ced2d['filters']),_0x1230b5);if(_0x4df15d[_0x9b35('0x30')]['filter']){_0x232f1b[_0x9b35('0x3a')]=_[_0x9b35('0x3d')](_0x232f1b[_0x9b35('0x3a')],{'$or':_['map'](_0x1230b5,function(_0x5ba2c3){if(_0x5ba2c3[_0x9b35('0x2d')]!==_0x9b35('0x3e')){var _0x101459={};_0x101459[_0x5ba2c3['name']]={'$like':'%'+_0x4df15d['query'][_0x9b35('0x3f')]+'%'};return _0x101459;}})});}_0x232f1b=_[_0x9b35('0x3d')]({},_0x232f1b,_0x4df15d[_0x9b35('0x40')]);var _0x298a12={'where':_0x232f1b[_0x9b35('0x3a')]};return db['ServicenowConfiguration'][_0x9b35('0x1f')](_0x298a12)['then'](function(_0x95dcc7){_0x53002b[_0x9b35('0x1f')]=_0x95dcc7;if(_0x4df15d[_0x9b35('0x30')]['includeAll']){_0x232f1b[_0x9b35('0x41')]=[{'all':!![]}];}return db['ServicenowConfiguration']['findAll'](_0x232f1b);})[_0x9b35('0x25')](function(_0x37b92b){_0x53002b[_0x9b35('0x42')]=_0x37b92b;return _0x53002b;})['then'](respondWithFilteredResult(_0x380c21,_0x232f1b))[_0x9b35('0x43')](handleError(_0x380c21,null));};exports[_0x9b35('0x44')]=function(_0x1d9fda,_0x4e37f0){var _0x594ca7={'raw':![],'where':{'id':_0x1d9fda[_0x9b35('0x45')]['id']}},_0x319191={};_0x319191[_0x9b35('0x2f')]=_['keys'](db[_0x9b35('0x46')][_0x9b35('0x2b')]);_0x319191[_0x9b35('0x30')]=_[_0x9b35('0x31')](_0x1d9fda[_0x9b35('0x30')]);_0x319191[_0x9b35('0x3b')]=_['intersection'](_0x319191[_0x9b35('0x2f')],_0x319191[_0x9b35('0x30')]);_0x594ca7[_0x9b35('0x33')]=_['intersection'](_0x319191[_0x9b35('0x2f')],qs[_0x9b35('0x34')](_0x1d9fda[_0x9b35('0x30')][_0x9b35('0x34')]));_0x594ca7['attributes']=_0x594ca7[_0x9b35('0x33')][_0x9b35('0x35')]?_0x594ca7['attributes']:_0x319191[_0x9b35('0x2f')];if(_0x1d9fda[_0x9b35('0x30')]['includeAll']){_0x594ca7[_0x9b35('0x41')]=[{'all':!![]}];}_0x594ca7=_[_0x9b35('0x3d')]({},_0x594ca7,_0x1d9fda[_0x9b35('0x40')]);return db[_0x9b35('0x46')][_0x9b35('0x47')](_0x594ca7)[_0x9b35('0x25')](handleEntityNotFound(_0x4e37f0,null))[_0x9b35('0x25')](respondWithResult(_0x4e37f0,null))[_0x9b35('0x43')](handleError(_0x4e37f0,null));};exports[_0x9b35('0x48')]=function(_0x26d9cb,_0x3158cb){return db[_0x9b35('0x46')][_0x9b35('0x48')](_0x26d9cb[_0x9b35('0x49')],{})[_0x9b35('0x25')](respondWithResult(_0x3158cb,0xc9))[_0x9b35('0x43')](handleError(_0x3158cb,null));};exports[_0x9b35('0x4a')]=function(_0x176f78,_0x2deaf3){if(_0x176f78[_0x9b35('0x49')]['id']){delete _0x176f78[_0x9b35('0x49')]['id'];}return db[_0x9b35('0x46')][_0x9b35('0x47')]({'where':{'id':_0x176f78[_0x9b35('0x45')]['id']}})['then'](handleEntityNotFound(_0x2deaf3,null))[_0x9b35('0x25')](saveUpdates(_0x176f78[_0x9b35('0x49')],null))[_0x9b35('0x25')](respondWithResult(_0x2deaf3,null))['catch'](handleError(_0x2deaf3,null));};exports[_0x9b35('0x26')]=function(_0x1a3e13,_0xec1ed1){return db[_0x9b35('0x46')][_0x9b35('0x47')]({'where':{'id':_0x1a3e13[_0x9b35('0x45')]['id']}})['then'](handleEntityNotFound(_0xec1ed1,null))[_0x9b35('0x25')](removeEntity(_0xec1ed1,null))[_0x9b35('0x43')](handleError(_0xec1ed1,null));};exports[_0x9b35('0x4b')]=function(_0x4dcdc6,_0x47525c,_0x42f5dc){var _0x356b0e={};var _0x4e667b={};var _0x35d089;var _0x2fbc54;return db['ServicenowConfiguration'][_0x9b35('0x4c')]({'where':{'id':_0x4dcdc6[_0x9b35('0x45')]['id']}})[_0x9b35('0x25')](handleEntityNotFound(_0x47525c,null))['then'](function(_0x4cd9f8){if(_0x4cd9f8){_0x35d089=_0x4cd9f8;_0x4e667b['model']=_[_0x9b35('0x31')](db[_0x9b35('0x4d')][_0x9b35('0x2b')]);_0x4e667b['query']=_['keys'](_0x4dcdc6[_0x9b35('0x30')]);_0x4e667b[_0x9b35('0x3b')]=_[_0x9b35('0x32')](_0x4e667b[_0x9b35('0x2f')],_0x4e667b[_0x9b35('0x30')]);_0x356b0e[_0x9b35('0x33')]=_[_0x9b35('0x32')](_0x4e667b[_0x9b35('0x2f')],qs['fields'](_0x4dcdc6[_0x9b35('0x30')]['fields']));_0x356b0e[_0x9b35('0x33')]=_0x356b0e[_0x9b35('0x33')][_0x9b35('0x35')]?_0x356b0e[_0x9b35('0x33')]:_0x4e667b[_0x9b35('0x2f')];_0x356b0e[_0x9b35('0x38')]=qs[_0x9b35('0x39')](_0x4dcdc6[_0x9b35('0x30')][_0x9b35('0x39')]);_0x356b0e[_0x9b35('0x3a')]=qs[_0x9b35('0x3b')](_[_0x9b35('0x3c')](_0x4dcdc6[_0x9b35('0x30')],_0x4e667b[_0x9b35('0x3b')]));if(_0x4dcdc6[_0x9b35('0x30')]['filter']){_0x356b0e['where']=_['merge'](_0x356b0e[_0x9b35('0x3a')],{'$or':_[_0x9b35('0x2a')](_0x356b0e[_0x9b35('0x33')],function(_0x1a2549){var _0x2b0762={};_0x2b0762[_0x1a2549]={'$like':'%'+_0x4dcdc6[_0x9b35('0x30')][_0x9b35('0x3f')]+'%'};return _0x2b0762;})});}_0x356b0e=_['merge']({},_0x356b0e,_0x4dcdc6[_0x9b35('0x40')]);return _0x35d089[_0x9b35('0x4b')](_0x356b0e);}})['then'](function(_0xab793e){if(_0xab793e){_0x2fbc54=_0xab793e[_0x9b35('0x35')];if(!_0x4dcdc6['query'][_0x9b35('0x36')](_0x9b35('0x37'))){_0x356b0e[_0x9b35('0x1d')]=qs[_0x9b35('0x1d')](_0x4dcdc6['query'][_0x9b35('0x1d')]);_0x356b0e[_0x9b35('0x1c')]=qs[_0x9b35('0x1c')](_0x4dcdc6[_0x9b35('0x30')][_0x9b35('0x1c')]);}return _0x35d089[_0x9b35('0x4b')](_0x356b0e);}})[_0x9b35('0x25')](function(_0x420312){if(_0x420312){return _0x420312?{'count':_0x2fbc54,'rows':_0x420312}:null;}})['then'](respondWithResult(_0x47525c,null))[_0x9b35('0x43')](handleError(_0x47525c,null));};exports[_0x9b35('0x4e')]=function(_0x2fe5e8,_0x50e07f,_0x10f502){var _0xc8827e={};var _0x3e0f7f={};var _0x4329b5;var _0xee7f45;return db[_0x9b35('0x46')][_0x9b35('0x4c')]({'where':{'id':_0x2fe5e8[_0x9b35('0x45')]['id']}})[_0x9b35('0x25')](handleEntityNotFound(_0x50e07f,null))[_0x9b35('0x25')](function(_0x529a98){if(_0x529a98){_0x4329b5=_0x529a98;_0x3e0f7f[_0x9b35('0x2f')]=_['keys'](db[_0x9b35('0x4d')][_0x9b35('0x2b')]);_0x3e0f7f['query']=_[_0x9b35('0x31')](_0x2fe5e8[_0x9b35('0x30')]);_0x3e0f7f['filters']=_[_0x9b35('0x32')](_0x3e0f7f[_0x9b35('0x2f')],_0x3e0f7f[_0x9b35('0x30')]);_0xc8827e[_0x9b35('0x33')]=_[_0x9b35('0x32')](_0x3e0f7f['model'],qs[_0x9b35('0x34')](_0x2fe5e8[_0x9b35('0x30')][_0x9b35('0x34')]));_0xc8827e['attributes']=_0xc8827e['attributes'][_0x9b35('0x35')]?_0xc8827e['attributes']:_0x3e0f7f['model'];_0xc8827e[_0x9b35('0x38')]=qs['sort'](_0x2fe5e8['query']['sort']);_0xc8827e[_0x9b35('0x3a')]=qs[_0x9b35('0x3b')](_[_0x9b35('0x3c')](_0x2fe5e8[_0x9b35('0x30')],_0x3e0f7f[_0x9b35('0x3b')]));if(_0x2fe5e8[_0x9b35('0x30')][_0x9b35('0x3f')]){_0xc8827e[_0x9b35('0x3a')]=_[_0x9b35('0x3d')](_0xc8827e['where'],{'$or':_[_0x9b35('0x2a')](_0xc8827e[_0x9b35('0x33')],function(_0x20a5f8){var _0x3f5f35={};_0x3f5f35[_0x20a5f8]={'$like':'%'+_0x2fe5e8[_0x9b35('0x30')][_0x9b35('0x3f')]+'%'};return _0x3f5f35;})});}_0xc8827e=_['merge']({},_0xc8827e,_0x2fe5e8['options']);return _0x4329b5[_0x9b35('0x4e')](_0xc8827e);}})[_0x9b35('0x25')](function(_0x550671){if(_0x550671){_0xee7f45=_0x550671[_0x9b35('0x35')];if(!_0x2fe5e8[_0x9b35('0x30')]['hasOwnProperty'](_0x9b35('0x37'))){_0xc8827e['limit']=qs[_0x9b35('0x1d')](_0x2fe5e8[_0x9b35('0x30')][_0x9b35('0x1d')]);_0xc8827e[_0x9b35('0x1c')]=qs[_0x9b35('0x1c')](_0x2fe5e8[_0x9b35('0x30')][_0x9b35('0x1c')]);}return _0x4329b5['getSubjects'](_0xc8827e);}})[_0x9b35('0x25')](function(_0xa94295){if(_0xa94295){return _0xa94295?{'count':_0xee7f45,'rows':_0xa94295}:null;}})[_0x9b35('0x25')](respondWithResult(_0x50e07f,null))[_0x9b35('0x43')](handleError(_0x50e07f,null));};exports[_0x9b35('0x4f')]=function(_0x13ae56,_0x57fbd8,_0xa3a817){var _0x3a8813={};var _0xee49d4={};var _0xa61b29;var _0xe1d06c;return db['ServicenowConfiguration'][_0x9b35('0x4c')]({'where':{'id':_0x13ae56['params']['id']}})[_0x9b35('0x25')](handleEntityNotFound(_0x57fbd8,null))[_0x9b35('0x25')](function(_0x2cc525){if(_0x2cc525){_0xa61b29=_0x2cc525;_0xee49d4[_0x9b35('0x2f')]=_['keys'](db[_0x9b35('0x4d')][_0x9b35('0x2b')]);_0xee49d4[_0x9b35('0x30')]=_['keys'](_0x13ae56['query']);_0xee49d4['filters']=_[_0x9b35('0x32')](_0xee49d4[_0x9b35('0x2f')],_0xee49d4['query']);_0x3a8813['attributes']=_['intersection'](_0xee49d4[_0x9b35('0x2f')],qs[_0x9b35('0x34')](_0x13ae56[_0x9b35('0x30')][_0x9b35('0x34')]));_0x3a8813[_0x9b35('0x33')]=_0x3a8813['attributes'][_0x9b35('0x35')]?_0x3a8813[_0x9b35('0x33')]:_0xee49d4[_0x9b35('0x2f')];_0x3a8813[_0x9b35('0x38')]=qs[_0x9b35('0x39')](_0x13ae56['query'][_0x9b35('0x39')]);_0x3a8813['where']=qs['filters'](_[_0x9b35('0x3c')](_0x13ae56['query'],_0xee49d4[_0x9b35('0x3b')]));if(_0x13ae56['query'][_0x9b35('0x3f')]){_0x3a8813[_0x9b35('0x3a')]=_[_0x9b35('0x3d')](_0x3a8813[_0x9b35('0x3a')],{'$or':_[_0x9b35('0x2a')](_0x3a8813[_0x9b35('0x33')],function(_0x141bce){var _0x3d21b3={};_0x3d21b3[_0x141bce]={'$like':'%'+_0x13ae56[_0x9b35('0x30')][_0x9b35('0x3f')]+'%'};return _0x3d21b3;})});}_0x3a8813=_[_0x9b35('0x3d')]({},_0x3a8813,_0x13ae56['options']);return _0xa61b29[_0x9b35('0x4f')](_0x3a8813);}})[_0x9b35('0x25')](function(_0xaf812d){if(_0xaf812d){_0xe1d06c=_0xaf812d[_0x9b35('0x35')];if(!_0x13ae56[_0x9b35('0x30')][_0x9b35('0x36')](_0x9b35('0x37'))){_0x3a8813[_0x9b35('0x1d')]=qs[_0x9b35('0x1d')](_0x13ae56[_0x9b35('0x30')]['limit']);_0x3a8813[_0x9b35('0x1c')]=qs[_0x9b35('0x1c')](_0x13ae56[_0x9b35('0x30')][_0x9b35('0x1c')]);}return _0xa61b29[_0x9b35('0x4f')](_0x3a8813);}})[_0x9b35('0x25')](function(_0x236089){if(_0x236089){return _0x236089?{'count':_0xe1d06c,'rows':_0x236089}:null;}})['then'](respondWithResult(_0x57fbd8,null))['catch'](handleError(_0x57fbd8,null));}; \ No newline at end of file +var _0xcd77=['body','params','getFields','order','pick','hasOwnProperty','getSubjects','ServicenowField','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','ServicenowConfiguration','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','show','find','catch','create'];(function(_0x2f5676,_0x342013){var _0x2e5f36=function(_0x516d81){while(--_0x516d81){_0x2f5676['push'](_0x2f5676['shift']());}};_0x2e5f36(++_0x342013);}(_0xcd77,0x1ae));var _0x7cd7=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xcd77[_0x2b4411];return _0x8e41ef;};'use strict';var emlformat=require(_0x7cd7('0x0'));var rimraf=require(_0x7cd7('0x1'));var zipdir=require(_0x7cd7('0x2'));var jsonpatch=require(_0x7cd7('0x3'));var rp=require(_0x7cd7('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7cd7('0x5'));var util=require(_0x7cd7('0x6'));var path=require('path');var sox=require(_0x7cd7('0x7'));var csv=require('to-csv');var ejs=require(_0x7cd7('0x8'));var fs=require('fs');var fs_extra=require(_0x7cd7('0x9'));var _=require(_0x7cd7('0xa'));var squel=require(_0x7cd7('0xb'));var crypto=require('crypto');var jsforce=require(_0x7cd7('0xc'));var deskjs=require(_0x7cd7('0xd'));var toCsv=require(_0x7cd7('0xe'));var querystring=require(_0x7cd7('0xf'));var Papa=require(_0x7cd7('0x10'));var Redis=require('ioredis');var authService=require(_0x7cd7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x7cd7('0x12'));var hardwareService=require(_0x7cd7('0x13'));var logger=require(_0x7cd7('0x14'))(_0x7cd7('0x15'));var utils=require(_0x7cd7('0x16'));var config=require(_0x7cd7('0x17'));var licenseUtil=require(_0x7cd7('0x18'));var db=require(_0x7cd7('0x19'))['db'];function respondWithStatusCode(_0xefc419,_0x51f948){_0x51f948=_0x51f948||0xcc;return function(_0x48b5b0){if(_0x48b5b0){return _0xefc419[_0x7cd7('0x1a')](_0x51f948);}return _0xefc419[_0x7cd7('0x1b')](_0x51f948)[_0x7cd7('0x1c')]();};}function respondWithResult(_0x38e2d7,_0x5e06b3){_0x5e06b3=_0x5e06b3||0xc8;return function(_0x212d20){if(_0x212d20){return _0x38e2d7[_0x7cd7('0x1b')](_0x5e06b3)[_0x7cd7('0x1d')](_0x212d20);}};}function respondWithFilteredResult(_0x351bed,_0x461e4c){return function(_0x1b78eb){if(_0x1b78eb){var _0x27cc61=typeof _0x461e4c[_0x7cd7('0x1e')]===_0x7cd7('0x1f')&&typeof _0x461e4c[_0x7cd7('0x20')]===_0x7cd7('0x1f');var _0x7a2b2=_0x1b78eb[_0x7cd7('0x21')];var _0x2faeb8=_0x27cc61?0x0:_0x461e4c[_0x7cd7('0x1e')];var _0x35456d=_0x27cc61?_0x1b78eb[_0x7cd7('0x21')]:_0x461e4c['offset']+_0x461e4c[_0x7cd7('0x20')];var _0x25b5d2;if(_0x35456d>=_0x7a2b2){_0x35456d=_0x7a2b2;_0x25b5d2=0xc8;}else{_0x25b5d2=0xce;}_0x351bed[_0x7cd7('0x1b')](_0x25b5d2);return _0x351bed[_0x7cd7('0x22')](_0x7cd7('0x23'),_0x2faeb8+'-'+_0x35456d+'/'+_0x7a2b2)[_0x7cd7('0x1d')](_0x1b78eb);}return null;};}function patchUpdates(_0x443aab){return function(_0x37337a){try{jsonpatch[_0x7cd7('0x24')](_0x37337a,_0x443aab,!![]);}catch(_0x4f3116){return BPromise[_0x7cd7('0x25')](_0x4f3116);}return _0x37337a[_0x7cd7('0x26')]();};}function saveUpdates(_0x2b88cf,_0x56ded4){return function(_0x3f804b){if(_0x3f804b){return _0x3f804b[_0x7cd7('0x27')](_0x2b88cf)[_0x7cd7('0x28')](function(_0x454dd4){return _0x454dd4;});}return null;};}function removeEntity(_0x2e55f2,_0x28d13b){return function(_0x5266b4){if(_0x5266b4){return _0x5266b4[_0x7cd7('0x29')]()['then'](function(){_0x2e55f2[_0x7cd7('0x1b')](0xcc)[_0x7cd7('0x1c')]();});}};}function handleEntityNotFound(_0x34c67f,_0x23b124){return function(_0x4cd4fe){if(!_0x4cd4fe){_0x34c67f[_0x7cd7('0x1a')](0x194);}return _0x4cd4fe;};}function handleError(_0x4628ee,_0x3a9548){_0x3a9548=_0x3a9548||0x1f4;return function(_0x2f521e){logger[_0x7cd7('0x2a')](_0x2f521e[_0x7cd7('0x2b')]);if(_0x2f521e[_0x7cd7('0x2c')]){delete _0x2f521e[_0x7cd7('0x2c')];}_0x4628ee['status'](_0x3a9548)[_0x7cd7('0x2d')](_0x2f521e);};}exports[_0x7cd7('0x2e')]=function(_0x39a2d2,_0x10e0d6){var _0x3cc0bc={},_0x2c9444={},_0x57c8ff={'count':0x0,'rows':[]};var _0xb5e7f=_['map'](db[_0x7cd7('0x2f')][_0x7cd7('0x30')],function(_0x27e16d){return{'name':_0x27e16d[_0x7cd7('0x31')],'type':_0x27e16d['type'][_0x7cd7('0x32')]};});_0x2c9444[_0x7cd7('0x33')]=_['map'](_0xb5e7f,_0x7cd7('0x2c'));_0x2c9444[_0x7cd7('0x34')]=_[_0x7cd7('0x35')](_0x39a2d2[_0x7cd7('0x34')]);_0x2c9444[_0x7cd7('0x36')]=_['intersection'](_0x2c9444[_0x7cd7('0x33')],_0x2c9444['query']);_0x3cc0bc[_0x7cd7('0x37')]=_[_0x7cd7('0x38')](_0x2c9444[_0x7cd7('0x33')],qs['fields'](_0x39a2d2['query'][_0x7cd7('0x39')]));_0x3cc0bc[_0x7cd7('0x37')]=_0x3cc0bc[_0x7cd7('0x37')][_0x7cd7('0x3a')]?_0x3cc0bc[_0x7cd7('0x37')]:_0x2c9444[_0x7cd7('0x33')];if(!_0x39a2d2['query']['hasOwnProperty'](_0x7cd7('0x3b'))){_0x3cc0bc['limit']=qs[_0x7cd7('0x20')](_0x39a2d2['query'][_0x7cd7('0x20')]);_0x3cc0bc[_0x7cd7('0x1e')]=qs[_0x7cd7('0x1e')](_0x39a2d2[_0x7cd7('0x34')][_0x7cd7('0x1e')]);}_0x3cc0bc['order']=qs['sort'](_0x39a2d2[_0x7cd7('0x34')][_0x7cd7('0x3c')]);_0x3cc0bc[_0x7cd7('0x3d')]=qs['filters'](_['pick'](_0x39a2d2[_0x7cd7('0x34')],_0x2c9444[_0x7cd7('0x36')]),_0xb5e7f);if(_0x39a2d2['query'][_0x7cd7('0x3e')]){_0x3cc0bc[_0x7cd7('0x3d')]=_[_0x7cd7('0x3f')](_0x3cc0bc['where'],{'$or':_[_0x7cd7('0x40')](_0xb5e7f,function(_0xf9e165){if(_0xf9e165['type']!==_0x7cd7('0x41')){var _0x379141={};_0x379141[_0xf9e165[_0x7cd7('0x2c')]]={'$like':'%'+_0x39a2d2['query'][_0x7cd7('0x3e')]+'%'};return _0x379141;}})});}_0x3cc0bc=_['merge']({},_0x3cc0bc,_0x39a2d2[_0x7cd7('0x42')]);var _0x1042fa={'where':_0x3cc0bc[_0x7cd7('0x3d')]};return db[_0x7cd7('0x2f')][_0x7cd7('0x21')](_0x1042fa)[_0x7cd7('0x28')](function(_0x10d1b5){_0x57c8ff['count']=_0x10d1b5;if(_0x39a2d2[_0x7cd7('0x34')][_0x7cd7('0x43')]){_0x3cc0bc[_0x7cd7('0x44')]=[{'all':!![]}];}return db[_0x7cd7('0x2f')][_0x7cd7('0x45')](_0x3cc0bc);})[_0x7cd7('0x28')](function(_0xa35f61){_0x57c8ff['rows']=_0xa35f61;return _0x57c8ff;})[_0x7cd7('0x28')](respondWithFilteredResult(_0x10e0d6,_0x3cc0bc))['catch'](handleError(_0x10e0d6,null));};exports[_0x7cd7('0x46')]=function(_0x366e55,_0x30126e){var _0x3ac2a2={'raw':![],'where':{'id':_0x366e55['params']['id']}},_0x1ac3d3={};_0x1ac3d3[_0x7cd7('0x33')]=_[_0x7cd7('0x35')](db[_0x7cd7('0x2f')]['rawAttributes']);_0x1ac3d3[_0x7cd7('0x34')]=_[_0x7cd7('0x35')](_0x366e55[_0x7cd7('0x34')]);_0x1ac3d3[_0x7cd7('0x36')]=_['intersection'](_0x1ac3d3['model'],_0x1ac3d3[_0x7cd7('0x34')]);_0x3ac2a2['attributes']=_[_0x7cd7('0x38')](_0x1ac3d3[_0x7cd7('0x33')],qs[_0x7cd7('0x39')](_0x366e55[_0x7cd7('0x34')]['fields']));_0x3ac2a2[_0x7cd7('0x37')]=_0x3ac2a2['attributes'][_0x7cd7('0x3a')]?_0x3ac2a2[_0x7cd7('0x37')]:_0x1ac3d3[_0x7cd7('0x33')];if(_0x366e55[_0x7cd7('0x34')]['includeAll']){_0x3ac2a2['include']=[{'all':!![]}];}_0x3ac2a2=_[_0x7cd7('0x3f')]({},_0x3ac2a2,_0x366e55[_0x7cd7('0x42')]);return db['ServicenowConfiguration'][_0x7cd7('0x47')](_0x3ac2a2)[_0x7cd7('0x28')](handleEntityNotFound(_0x30126e,null))[_0x7cd7('0x28')](respondWithResult(_0x30126e,null))[_0x7cd7('0x48')](handleError(_0x30126e,null));};exports[_0x7cd7('0x49')]=function(_0x4d2795,_0x27a0e7){return db[_0x7cd7('0x2f')]['create'](_0x4d2795['body'],{})[_0x7cd7('0x28')](respondWithResult(_0x27a0e7,0xc9))[_0x7cd7('0x48')](handleError(_0x27a0e7,null));};exports[_0x7cd7('0x27')]=function(_0x388b70,_0x208384){if(_0x388b70[_0x7cd7('0x4a')]['id']){delete _0x388b70['body']['id'];}return db[_0x7cd7('0x2f')][_0x7cd7('0x47')]({'where':{'id':_0x388b70[_0x7cd7('0x4b')]['id']}})[_0x7cd7('0x28')](handleEntityNotFound(_0x208384,null))['then'](saveUpdates(_0x388b70[_0x7cd7('0x4a')],null))['then'](respondWithResult(_0x208384,null))[_0x7cd7('0x48')](handleError(_0x208384,null));};exports[_0x7cd7('0x29')]=function(_0x94b652,_0x48b35d){return db[_0x7cd7('0x2f')]['find']({'where':{'id':_0x94b652[_0x7cd7('0x4b')]['id']}})[_0x7cd7('0x28')](handleEntityNotFound(_0x48b35d,null))['then'](removeEntity(_0x48b35d,null))[_0x7cd7('0x48')](handleError(_0x48b35d,null));};exports[_0x7cd7('0x4c')]=function(_0x4cec95,_0x42a7b8,_0x3a20cf){var _0x360db8={};var _0x4e9e24={};var _0x3f5a12;var _0x2b0808;return db[_0x7cd7('0x2f')]['findOne']({'where':{'id':_0x4cec95[_0x7cd7('0x4b')]['id']}})[_0x7cd7('0x28')](handleEntityNotFound(_0x42a7b8,null))[_0x7cd7('0x28')](function(_0x470b16){if(_0x470b16){_0x3f5a12=_0x470b16;_0x4e9e24['model']=_[_0x7cd7('0x35')](db['ServicenowField']['rawAttributes']);_0x4e9e24['query']=_[_0x7cd7('0x35')](_0x4cec95[_0x7cd7('0x34')]);_0x4e9e24[_0x7cd7('0x36')]=_[_0x7cd7('0x38')](_0x4e9e24['model'],_0x4e9e24[_0x7cd7('0x34')]);_0x360db8[_0x7cd7('0x37')]=_[_0x7cd7('0x38')](_0x4e9e24[_0x7cd7('0x33')],qs['fields'](_0x4cec95[_0x7cd7('0x34')]['fields']));_0x360db8[_0x7cd7('0x37')]=_0x360db8[_0x7cd7('0x37')][_0x7cd7('0x3a')]?_0x360db8[_0x7cd7('0x37')]:_0x4e9e24['model'];_0x360db8[_0x7cd7('0x4d')]=qs[_0x7cd7('0x3c')](_0x4cec95[_0x7cd7('0x34')][_0x7cd7('0x3c')]);_0x360db8[_0x7cd7('0x3d')]=qs[_0x7cd7('0x36')](_[_0x7cd7('0x4e')](_0x4cec95[_0x7cd7('0x34')],_0x4e9e24['filters']));if(_0x4cec95[_0x7cd7('0x34')][_0x7cd7('0x3e')]){_0x360db8[_0x7cd7('0x3d')]=_['merge'](_0x360db8['where'],{'$or':_[_0x7cd7('0x40')](_0x360db8[_0x7cd7('0x37')],function(_0x43afb9){var _0x3a277e={};_0x3a277e[_0x43afb9]={'$like':'%'+_0x4cec95['query']['filter']+'%'};return _0x3a277e;})});}_0x360db8=_['merge']({},_0x360db8,_0x4cec95[_0x7cd7('0x42')]);return _0x3f5a12[_0x7cd7('0x4c')](_0x360db8);}})['then'](function(_0x1cf73f){if(_0x1cf73f){_0x2b0808=_0x1cf73f[_0x7cd7('0x3a')];if(!_0x4cec95['query'][_0x7cd7('0x4f')](_0x7cd7('0x3b'))){_0x360db8[_0x7cd7('0x20')]=qs[_0x7cd7('0x20')](_0x4cec95['query']['limit']);_0x360db8[_0x7cd7('0x1e')]=qs['offset'](_0x4cec95[_0x7cd7('0x34')][_0x7cd7('0x1e')]);}return _0x3f5a12['getFields'](_0x360db8);}})[_0x7cd7('0x28')](function(_0x5705b0){if(_0x5705b0){return _0x5705b0?{'count':_0x2b0808,'rows':_0x5705b0}:null;}})[_0x7cd7('0x28')](respondWithResult(_0x42a7b8,null))[_0x7cd7('0x48')](handleError(_0x42a7b8,null));};exports[_0x7cd7('0x50')]=function(_0x347182,_0x42d5f0,_0x35c341){var _0x591d22={};var _0x5e3dee={};var _0x323ef9;var _0x481697;return db[_0x7cd7('0x2f')]['findOne']({'where':{'id':_0x347182[_0x7cd7('0x4b')]['id']}})[_0x7cd7('0x28')](handleEntityNotFound(_0x42d5f0,null))[_0x7cd7('0x28')](function(_0x3ae976){if(_0x3ae976){_0x323ef9=_0x3ae976;_0x5e3dee['model']=_[_0x7cd7('0x35')](db[_0x7cd7('0x51')][_0x7cd7('0x30')]);_0x5e3dee[_0x7cd7('0x34')]=_[_0x7cd7('0x35')](_0x347182['query']);_0x5e3dee[_0x7cd7('0x36')]=_['intersection'](_0x5e3dee[_0x7cd7('0x33')],_0x5e3dee[_0x7cd7('0x34')]);_0x591d22[_0x7cd7('0x37')]=_[_0x7cd7('0x38')](_0x5e3dee[_0x7cd7('0x33')],qs[_0x7cd7('0x39')](_0x347182[_0x7cd7('0x34')][_0x7cd7('0x39')]));_0x591d22[_0x7cd7('0x37')]=_0x591d22[_0x7cd7('0x37')][_0x7cd7('0x3a')]?_0x591d22[_0x7cd7('0x37')]:_0x5e3dee[_0x7cd7('0x33')];_0x591d22[_0x7cd7('0x4d')]=qs[_0x7cd7('0x3c')](_0x347182[_0x7cd7('0x34')]['sort']);_0x591d22[_0x7cd7('0x3d')]=qs[_0x7cd7('0x36')](_[_0x7cd7('0x4e')](_0x347182[_0x7cd7('0x34')],_0x5e3dee[_0x7cd7('0x36')]));if(_0x347182[_0x7cd7('0x34')]['filter']){_0x591d22[_0x7cd7('0x3d')]=_[_0x7cd7('0x3f')](_0x591d22[_0x7cd7('0x3d')],{'$or':_['map'](_0x591d22[_0x7cd7('0x37')],function(_0x42f65a){var _0x40f417={};_0x40f417[_0x42f65a]={'$like':'%'+_0x347182['query'][_0x7cd7('0x3e')]+'%'};return _0x40f417;})});}_0x591d22=_['merge']({},_0x591d22,_0x347182[_0x7cd7('0x42')]);return _0x323ef9[_0x7cd7('0x50')](_0x591d22);}})[_0x7cd7('0x28')](function(_0x28b003){if(_0x28b003){_0x481697=_0x28b003[_0x7cd7('0x3a')];if(!_0x347182[_0x7cd7('0x34')][_0x7cd7('0x4f')](_0x7cd7('0x3b'))){_0x591d22[_0x7cd7('0x20')]=qs['limit'](_0x347182['query'][_0x7cd7('0x20')]);_0x591d22['offset']=qs[_0x7cd7('0x1e')](_0x347182['query'][_0x7cd7('0x1e')]);}return _0x323ef9[_0x7cd7('0x50')](_0x591d22);}})[_0x7cd7('0x28')](function(_0x11068a){if(_0x11068a){return _0x11068a?{'count':_0x481697,'rows':_0x11068a}:null;}})[_0x7cd7('0x28')](respondWithResult(_0x42d5f0,null))[_0x7cd7('0x48')](handleError(_0x42d5f0,null));};exports['getDescriptions']=function(_0x20881e,_0x430281,_0x3851c4){var _0x3d894b={};var _0x4f1f1e={};var _0x442ac0;var _0x4c55c3;return db[_0x7cd7('0x2f')][_0x7cd7('0x52')]({'where':{'id':_0x20881e[_0x7cd7('0x4b')]['id']}})[_0x7cd7('0x28')](handleEntityNotFound(_0x430281,null))['then'](function(_0x4d03f0){if(_0x4d03f0){_0x442ac0=_0x4d03f0;_0x4f1f1e[_0x7cd7('0x33')]=_[_0x7cd7('0x35')](db[_0x7cd7('0x51')]['rawAttributes']);_0x4f1f1e[_0x7cd7('0x34')]=_['keys'](_0x20881e[_0x7cd7('0x34')]);_0x4f1f1e[_0x7cd7('0x36')]=_['intersection'](_0x4f1f1e[_0x7cd7('0x33')],_0x4f1f1e[_0x7cd7('0x34')]);_0x3d894b['attributes']=_[_0x7cd7('0x38')](_0x4f1f1e[_0x7cd7('0x33')],qs[_0x7cd7('0x39')](_0x20881e[_0x7cd7('0x34')][_0x7cd7('0x39')]));_0x3d894b[_0x7cd7('0x37')]=_0x3d894b[_0x7cd7('0x37')][_0x7cd7('0x3a')]?_0x3d894b[_0x7cd7('0x37')]:_0x4f1f1e[_0x7cd7('0x33')];_0x3d894b[_0x7cd7('0x4d')]=qs['sort'](_0x20881e['query'][_0x7cd7('0x3c')]);_0x3d894b[_0x7cd7('0x3d')]=qs[_0x7cd7('0x36')](_[_0x7cd7('0x4e')](_0x20881e[_0x7cd7('0x34')],_0x4f1f1e[_0x7cd7('0x36')]));if(_0x20881e['query'][_0x7cd7('0x3e')]){_0x3d894b[_0x7cd7('0x3d')]=_[_0x7cd7('0x3f')](_0x3d894b[_0x7cd7('0x3d')],{'$or':_[_0x7cd7('0x40')](_0x3d894b[_0x7cd7('0x37')],function(_0x3b5a2c){var _0x21741f={};_0x21741f[_0x3b5a2c]={'$like':'%'+_0x20881e[_0x7cd7('0x34')][_0x7cd7('0x3e')]+'%'};return _0x21741f;})});}_0x3d894b=_['merge']({},_0x3d894b,_0x20881e[_0x7cd7('0x42')]);return _0x442ac0['getDescriptions'](_0x3d894b);}})['then'](function(_0x499570){if(_0x499570){_0x4c55c3=_0x499570[_0x7cd7('0x3a')];if(!_0x20881e[_0x7cd7('0x34')][_0x7cd7('0x4f')](_0x7cd7('0x3b'))){_0x3d894b[_0x7cd7('0x20')]=qs['limit'](_0x20881e[_0x7cd7('0x34')]['limit']);_0x3d894b[_0x7cd7('0x1e')]=qs[_0x7cd7('0x1e')](_0x20881e[_0x7cd7('0x34')]['offset']);}return _0x442ac0[_0x7cd7('0x53')](_0x3d894b);}})[_0x7cd7('0x28')](function(_0x5c4efd){if(_0x5c4efd){return _0x5c4efd?{'count':_0x4c55c3,'rows':_0x5c4efd}:null;}})[_0x7cd7('0x28')](respondWithResult(_0x430281,null))['catch'](handleError(_0x430281,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index bc0b504..3fa7155 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 _0x1cbc=['../../config/environment','./intServicenowConfiguration.attributes','exports','ServicenowConfiguration','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3e9fba,_0x5a9b26){var _0x386128=function(_0x21d741){while(--_0x21d741){_0x3e9fba['push'](_0x3e9fba['shift']());}};_0x386128(++_0x5a9b26);}(_0x1cbc,0xf4));var _0xc1cb=function(_0x6c0123,_0x4c8d3b){_0x6c0123=_0x6c0123-0x0;var _0x5a87d2=_0x1cbc[_0x6c0123];return _0x5a87d2;};'use strict';var _=require(_0xc1cb('0x0'));var util=require('util');var logger=require(_0xc1cb('0x1'))(_0xc1cb('0x2'));var moment=require(_0xc1cb('0x3'));var BPromise=require(_0xc1cb('0x4'));var rp=require(_0xc1cb('0x5'));var fs=require('fs');var path=require(_0xc1cb('0x6'));var rimraf=require(_0xc1cb('0x7'));var config=require(_0xc1cb('0x8'));var attributes=require(_0xc1cb('0x9'));module[_0xc1cb('0xa')]=function(_0x1dacec,_0x27423b){return _0x1dacec['define'](_0xc1cb('0xb'),attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc7a7=['moment','bluebird','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','int_servicenow_configurations','lodash','util','../../config/logger'];(function(_0x2cf3f9,_0x4d14c6){var _0x26fb0a=function(_0xe16b7b){while(--_0xe16b7b){_0x2cf3f9['push'](_0x2cf3f9['shift']());}};_0x26fb0a(++_0x4d14c6);}(_0xc7a7,0x171));var _0x7c7a=function(_0x5d9c35,_0x52abe7){_0x5d9c35=_0x5d9c35-0x0;var _0x264022=_0xc7a7[_0x5d9c35];return _0x264022;};'use strict';var _=require(_0x7c7a('0x0'));var util=require(_0x7c7a('0x1'));var logger=require(_0x7c7a('0x2'))('api');var moment=require(_0x7c7a('0x3'));var BPromise=require(_0x7c7a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7c7a('0x5'));var rimraf=require(_0x7c7a('0x6'));var config=require(_0x7c7a('0x7'));var attributes=require(_0x7c7a('0x8'));module[_0x7c7a('0x9')]=function(_0xc84abf,_0x346f96){return _0xc84abf[_0x7c7a('0xa')]('ServicenowConfiguration',attributes,{'tableName':_0x7c7a('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 067753c..840c402 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 _0xb3a1=['debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x27edfc,_0x40c1da){var _0xc798fb=function(_0xc4a716){while(--_0xc4a716){_0x27edfc['push'](_0x27edfc['shift']());}};_0xc798fb(++_0x40c1da);}(_0xb3a1,0x91));var _0x1b3a=function(_0x5d7b78,_0x21ee2b){_0x5d7b78=_0x5d7b78-0x0;var _0x1ca2bc=_0xb3a1[_0x5d7b78];return _0x1ca2bc;};'use strict';var _=require(_0x1b3a('0x0'));var util=require(_0x1b3a('0x1'));var moment=require('moment');var BPromise=require(_0x1b3a('0x2'));var rs=require(_0x1b3a('0x3'));var fs=require('fs');var Redis=require(_0x1b3a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1b3a('0x5'));var logger=require(_0x1b3a('0x6'))(_0x1b3a('0x7'));var config=require(_0x1b3a('0x8'));var jayson=require(_0x1b3a('0x9'));var client=jayson[_0x1b3a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x13a3c5,_0x253e80,_0x356510){return new BPromise(function(_0x20846c,_0x3a2d4c){return client[_0x1b3a('0xb')](_0x13a3c5,_0x356510)['then'](function(_0x123c98){logger[_0x1b3a('0xc')](_0x1b3a('0xd'),_0x253e80,_0x1b3a('0xe'));logger[_0x1b3a('0xf')](_0x1b3a('0x10'),_0x253e80,_0x1b3a('0xe'),JSON['stringify'](_0x123c98));if(_0x123c98[_0x1b3a('0x11')]){if(_0x123c98[_0x1b3a('0x11')]['code']===0x1f4){logger[_0x1b3a('0x11')](_0x1b3a('0xd'),_0x253e80,_0x123c98[_0x1b3a('0x11')][_0x1b3a('0x12')]);return _0x3a2d4c(_0x123c98['error']['message']);}logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x253e80,_0x123c98['error']['message']);return _0x20846c(_0x123c98[_0x1b3a('0x11')]['message']);}else{logger[_0x1b3a('0xc')](_0x1b3a('0xd'),_0x253e80,_0x1b3a('0xe'));_0x20846c(_0x123c98[_0x1b3a('0x13')][_0x1b3a('0x12')]);}})['catch'](function(_0x3adcc9){logger[_0x1b3a('0x11')](_0x1b3a('0xd'),_0x253e80,_0x3adcc9);_0x3a2d4c(_0x3adcc9);});});} \ No newline at end of file +var _0x3725=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ServicenowConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5853eb,_0x482562){var _0x1101a7=function(_0x4ee70b){while(--_0x4ee70b){_0x5853eb['push'](_0x5853eb['shift']());}};_0x1101a7(++_0x482562);}(_0x3725,0xc1));var _0x5372=function(_0x7ec12b,_0x58dd58){_0x7ec12b=_0x7ec12b-0x0;var _0x5e6ace=_0x3725[_0x7ec12b];return _0x5e6ace;};'use strict';var _=require(_0x5372('0x0'));var util=require(_0x5372('0x1'));var moment=require(_0x5372('0x2'));var BPromise=require(_0x5372('0x3'));var rs=require(_0x5372('0x4'));var fs=require('fs');var Redis=require(_0x5372('0x5'));var db=require(_0x5372('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5372('0x7'));var config=require(_0x5372('0x8'));var jayson=require(_0x5372('0x9'));var client=jayson[_0x5372('0xa')][_0x5372('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf922f,_0x25ec57,_0x393fca){return new BPromise(function(_0x30c9cd,_0xadd416){return client[_0x5372('0xc')](_0xf922f,_0x393fca)[_0x5372('0xd')](function(_0x44ab92){logger[_0x5372('0xe')]('ServicenowConfiguration,\x20%s,\x20%s',_0x25ec57,_0x5372('0xf'));logger[_0x5372('0x10')](_0x5372('0x11'),_0x25ec57,'request\x20sent',JSON[_0x5372('0x12')](_0x44ab92));if(_0x44ab92[_0x5372('0x13')]){if(_0x44ab92[_0x5372('0x13')][_0x5372('0x14')]===0x1f4){logger[_0x5372('0x13')](_0x5372('0x15'),_0x25ec57,_0x44ab92[_0x5372('0x13')][_0x5372('0x16')]);return _0xadd416(_0x44ab92[_0x5372('0x13')][_0x5372('0x16')]);}logger[_0x5372('0x13')](_0x5372('0x15'),_0x25ec57,_0x44ab92[_0x5372('0x13')][_0x5372('0x16')]);return _0x30c9cd(_0x44ab92[_0x5372('0x13')]['message']);}else{logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x25ec57,'request\x20sent');_0x30c9cd(_0x44ab92[_0x5372('0x17')][_0x5372('0x16')]);}})[_0x5372('0x18')](function(_0x5632d1){logger[_0x5372('0x13')](_0x5372('0x15'),_0x25ec57,_0x5632d1);_0xadd416(_0x5632d1);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 80cac8e..7e1115a 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 _0x6c90=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowField.controller','get','index','/:id','isAuthenticated','create','put','destroy'];(function(_0x4eb3f6,_0x79c043){var _0x119311=function(_0x76411a){while(--_0x76411a){_0x4eb3f6['push'](_0x4eb3f6['shift']());}};_0x119311(++_0x79c043);}(_0x6c90,0x100));var _0x06c9=function(_0x1c268e,_0x4f201d){_0x1c268e=_0x1c268e-0x0;var _0x3a3357=_0x6c90[_0x1c268e];return _0x3a3357;};'use strict';var multer=require(_0x06c9('0x0'));var util=require(_0x06c9('0x1'));var path=require(_0x06c9('0x2'));var timeout=require(_0x06c9('0x3'));var express=require('express');var router=express[_0x06c9('0x4')]();var fs_extra=require(_0x06c9('0x5'));var auth=require(_0x06c9('0x6'));var interaction=require(_0x06c9('0x7'));var config=require('../../config/environment');var controller=require(_0x06c9('0x8'));router[_0x06c9('0x9')]('/',auth['isAuthenticated'](),controller[_0x06c9('0xa')]);router[_0x06c9('0x9')](_0x06c9('0xb'),auth[_0x06c9('0xc')](),controller['show']);router['post']('/',auth[_0x06c9('0xc')](),controller[_0x06c9('0xd')]);router[_0x06c9('0xe')](_0x06c9('0xb'),auth[_0x06c9('0xc')](),controller['update']);router['delete'](_0x06c9('0xb'),auth[_0x06c9('0xc')](),controller[_0x06c9('0xf')]);module['exports']=router; \ No newline at end of file +var _0x0942=['delete','exports','util','path','Router','../../config/environment','./intServicenowField.controller','isAuthenticated','index','get','/:id','post','create','put'];(function(_0x1eb3d6,_0x556eb4){var _0x3cc1ed=function(_0x5560f1){while(--_0x5560f1){_0x1eb3d6['push'](_0x1eb3d6['shift']());}};_0x3cc1ed(++_0x556eb4);}(_0x0942,0x198));var _0x2094=function(_0x2cad51,_0x521f37){_0x2cad51=_0x2cad51-0x0;var _0x334640=_0x0942[_0x2cad51];return _0x334640;};'use strict';var multer=require('multer');var util=require(_0x2094('0x0'));var path=require(_0x2094('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2094('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2094('0x3'));var controller=require(_0x2094('0x4'));router['get']('/',auth[_0x2094('0x5')](),controller[_0x2094('0x6')]);router[_0x2094('0x7')](_0x2094('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x2094('0x9')]('/',auth[_0x2094('0x5')](),controller[_0x2094('0xa')]);router[_0x2094('0xb')](_0x2094('0x8'),auth[_0x2094('0x5')](),controller['update']);router[_0x2094('0xc')](_0x2094('0x8'),auth[_0x2094('0x5')](),controller['destroy']);module[_0x2094('0xd')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index ac2cbcf..c3720fd 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 _0xa205=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x3ef45e,_0xe84f33){var _0x69e7c=function(_0x43ba11){while(--_0x43ba11){_0x3ef45e['push'](_0x3ef45e['shift']());}};_0x69e7c(++_0xe84f33);}(_0xa205,0x12e));var _0x5a20=function(_0x3b90ab,_0x174a22){_0x3b90ab=_0x3b90ab-0x0;var _0x206e92=_0xa205[_0x3b90ab];return _0x206e92;};'use strict';var Sequelize=require(_0x5a20('0x0'));module[_0x5a20('0x1')]={'type':{'type':Sequelize[_0x5a20('0x2')](_0x5a20('0x3'),_0x5a20('0x4'),_0x5a20('0x5'),_0x5a20('0x6'),_0x5a20('0x7')),'defaultValue':_0x5a20('0x3')},'content':{'type':Sequelize[_0x5a20('0x8')]},'key':{'type':Sequelize[_0x5a20('0x8')]},'keyType':{'type':Sequelize[_0x5a20('0x2')](_0x5a20('0x3'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x5a20('0x8')]},'idField':{'type':Sequelize[_0x5a20('0x8')]},'nameField':{'type':Sequelize[_0x5a20('0x8')]},'customField':{'type':Sequelize[_0x5a20('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5a20('0x8')]}}; \ No newline at end of file +var _0xd185=['ENUM','string','variable','picklist','STRING','customVariable','sequelize'];(function(_0x327463,_0x1d120a){var _0x1d6a52=function(_0x26a2ba){while(--_0x26a2ba){_0x327463['push'](_0x327463['shift']());}};_0x1d6a52(++_0x1d120a);}(_0xd185,0x156));var _0x5d18=function(_0x33be64,_0xe13784){_0x33be64=_0x33be64-0x0;var _0x31f893=_0xd185[_0x33be64];return _0x31f893;};'use strict';var Sequelize=require(_0x5d18('0x0'));module['exports']={'type':{'type':Sequelize[_0x5d18('0x1')](_0x5d18('0x2'),_0x5d18('0x3'),'customVariable','keyValue',_0x5d18('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x5d18('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x5d18('0x1')](_0x5d18('0x2'),_0x5d18('0x3'),_0x5d18('0x6'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x5d18('0x5')]},'nameField':{'type':Sequelize[_0x5d18('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index c43221c..2618fd4 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 _0xa9c0=['create','body','eml-format','rimraf','fast-json-patch','request-promise','bluebird','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','params','find'];(function(_0x37e2c8,_0x539b34){var _0x2549c5=function(_0x5639bc){while(--_0x5639bc){_0x37e2c8['push'](_0x37e2c8['shift']());}};_0x2549c5(++_0x539b34);}(_0xa9c0,0x1a6));var _0x0a9c=function(_0x2350d4,_0x42bc56){_0x2350d4=_0x2350d4-0x0;var _0x96c17a=_0xa9c0[_0x2350d4];return _0x96c17a;};'use strict';var emlformat=require(_0x0a9c('0x0'));var rimraf=require(_0x0a9c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0a9c('0x2'));var rp=require(_0x0a9c('0x3'));var moment=require('moment');var BPromise=require(_0x0a9c('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x0a9c('0x5'));var csv=require(_0x0a9c('0x6'));var ejs=require(_0x0a9c('0x7'));var fs=require('fs');var fs_extra=require(_0x0a9c('0x8'));var _=require('lodash');var squel=require(_0x0a9c('0x9'));var crypto=require(_0x0a9c('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x0a9c('0xb'));var toCsv=require(_0x0a9c('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0a9c('0xc'));var authService=require(_0x0a9c('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x0a9c('0xe'));var hardwareService=require(_0x0a9c('0xf'));var logger=require(_0x0a9c('0x10'))(_0x0a9c('0x11'));var utils=require('../../config/utils');var config=require(_0x0a9c('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28457a,_0xd44b72){_0xd44b72=_0xd44b72||0xcc;return function(_0x2bd18a){if(_0x2bd18a){return _0x28457a[_0x0a9c('0x13')](_0xd44b72);}return _0x28457a[_0x0a9c('0x14')](_0xd44b72)[_0x0a9c('0x15')]();};}function respondWithResult(_0x283917,_0x27477c){_0x27477c=_0x27477c||0xc8;return function(_0x52bee7){if(_0x52bee7){return _0x283917[_0x0a9c('0x14')](_0x27477c)[_0x0a9c('0x16')](_0x52bee7);}};}function respondWithFilteredResult(_0x52710f,_0x35d638){return function(_0x4ea80b){if(_0x4ea80b){var _0x36f7b0=typeof _0x35d638[_0x0a9c('0x17')]===_0x0a9c('0x18')&&typeof _0x35d638[_0x0a9c('0x19')]===_0x0a9c('0x18');var _0x5333ba=_0x4ea80b['count'];var _0x554eef=_0x36f7b0?0x0:_0x35d638[_0x0a9c('0x17')];var _0x2a2927=_0x36f7b0?_0x4ea80b['count']:_0x35d638[_0x0a9c('0x17')]+_0x35d638['limit'];var _0x38b787;if(_0x2a2927>=_0x5333ba){_0x2a2927=_0x5333ba;_0x38b787=0xc8;}else{_0x38b787=0xce;}_0x52710f[_0x0a9c('0x14')](_0x38b787);return _0x52710f[_0x0a9c('0x1a')](_0x0a9c('0x1b'),_0x554eef+'-'+_0x2a2927+'/'+_0x5333ba)[_0x0a9c('0x16')](_0x4ea80b);}return null;};}function patchUpdates(_0xf80740){return function(_0x147fd2){try{jsonpatch[_0x0a9c('0x1c')](_0x147fd2,_0xf80740,!![]);}catch(_0x13be51){return BPromise[_0x0a9c('0x1d')](_0x13be51);}return _0x147fd2[_0x0a9c('0x1e')]();};}function saveUpdates(_0x5bc43a,_0x431c77){return function(_0x1232fc){if(_0x1232fc){return _0x1232fc['update'](_0x5bc43a)['then'](function(_0x4b4011){return _0x4b4011;});}return null;};}function removeEntity(_0x3e6771,_0x51b2c1){return function(_0xdcf296){if(_0xdcf296){return _0xdcf296[_0x0a9c('0x1f')]()[_0x0a9c('0x20')](function(){_0x3e6771[_0x0a9c('0x14')](0xcc)[_0x0a9c('0x15')]();});}};}function handleEntityNotFound(_0x551668,_0x1c42eb){return function(_0x584494){if(!_0x584494){_0x551668['sendStatus'](0x194);}return _0x584494;};}function handleError(_0x280614,_0x5a94e3){_0x5a94e3=_0x5a94e3||0x1f4;return function(_0xc11bed){logger[_0x0a9c('0x21')](_0xc11bed[_0x0a9c('0x22')]);if(_0xc11bed[_0x0a9c('0x23')]){delete _0xc11bed[_0x0a9c('0x23')];}_0x280614[_0x0a9c('0x14')](_0x5a94e3)[_0x0a9c('0x24')](_0xc11bed);};}exports[_0x0a9c('0x25')]=function(_0x1022cb,_0x2220ab){var _0x35e52b={},_0x57db08={},_0x234fd8={'count':0x0,'rows':[]};var _0x5a3802=_[_0x0a9c('0x26')](db[_0x0a9c('0x27')][_0x0a9c('0x28')],function(_0x834cfc){return{'name':_0x834cfc[_0x0a9c('0x29')],'type':_0x834cfc[_0x0a9c('0x2a')][_0x0a9c('0x2b')]};});_0x57db08['model']=_[_0x0a9c('0x26')](_0x5a3802,'name');_0x57db08[_0x0a9c('0x2c')]=_[_0x0a9c('0x2d')](_0x1022cb['query']);_0x57db08[_0x0a9c('0x2e')]=_['intersection'](_0x57db08[_0x0a9c('0x2f')],_0x57db08[_0x0a9c('0x2c')]);_0x35e52b[_0x0a9c('0x30')]=_[_0x0a9c('0x31')](_0x57db08[_0x0a9c('0x2f')],qs[_0x0a9c('0x32')](_0x1022cb[_0x0a9c('0x2c')]['fields']));_0x35e52b[_0x0a9c('0x30')]=_0x35e52b[_0x0a9c('0x30')][_0x0a9c('0x33')]?_0x35e52b['attributes']:_0x57db08[_0x0a9c('0x2f')];if(!_0x1022cb[_0x0a9c('0x2c')][_0x0a9c('0x34')]('nolimit')){_0x35e52b['limit']=qs[_0x0a9c('0x19')](_0x1022cb[_0x0a9c('0x2c')][_0x0a9c('0x19')]);_0x35e52b[_0x0a9c('0x17')]=qs[_0x0a9c('0x17')](_0x1022cb[_0x0a9c('0x2c')][_0x0a9c('0x17')]);}_0x35e52b[_0x0a9c('0x35')]=qs['sort'](_0x1022cb[_0x0a9c('0x2c')][_0x0a9c('0x36')]);_0x35e52b[_0x0a9c('0x37')]=qs[_0x0a9c('0x2e')](_['pick'](_0x1022cb[_0x0a9c('0x2c')],_0x57db08[_0x0a9c('0x2e')]),_0x5a3802);if(_0x1022cb[_0x0a9c('0x2c')][_0x0a9c('0x38')]){_0x35e52b['where']=_[_0x0a9c('0x39')](_0x35e52b[_0x0a9c('0x37')],{'$or':_[_0x0a9c('0x26')](_0x5a3802,function(_0x2d1d65){if(_0x2d1d65['type']!=='VIRTUAL'){var _0x5d1903={};_0x5d1903[_0x2d1d65[_0x0a9c('0x23')]]={'$like':'%'+_0x1022cb[_0x0a9c('0x2c')]['filter']+'%'};return _0x5d1903;}})});}_0x35e52b=_[_0x0a9c('0x39')]({},_0x35e52b,_0x1022cb[_0x0a9c('0x3a')]);var _0x4f8167={'where':_0x35e52b[_0x0a9c('0x37')]};return db['ServicenowField'][_0x0a9c('0x3b')](_0x4f8167)[_0x0a9c('0x20')](function(_0x525b86){_0x234fd8[_0x0a9c('0x3b')]=_0x525b86;if(_0x1022cb[_0x0a9c('0x2c')][_0x0a9c('0x3c')]){_0x35e52b[_0x0a9c('0x3d')]=[{'all':!![]}];}return db[_0x0a9c('0x27')][_0x0a9c('0x3e')](_0x35e52b);})[_0x0a9c('0x20')](function(_0x2f07c7){_0x234fd8[_0x0a9c('0x3f')]=_0x2f07c7;return _0x234fd8;})[_0x0a9c('0x20')](respondWithFilteredResult(_0x2220ab,_0x35e52b))[_0x0a9c('0x40')](handleError(_0x2220ab,null));};exports[_0x0a9c('0x41')]=function(_0x2a6196,_0x389725){var _0x1edce0={'raw':!![],'where':{'id':_0x2a6196[_0x0a9c('0x42')]['id']}},_0x5bd46={};_0x5bd46['model']=_[_0x0a9c('0x2d')](db[_0x0a9c('0x27')][_0x0a9c('0x28')]);_0x5bd46[_0x0a9c('0x2c')]=_[_0x0a9c('0x2d')](_0x2a6196['query']);_0x5bd46[_0x0a9c('0x2e')]=_[_0x0a9c('0x31')](_0x5bd46['model'],_0x5bd46['query']);_0x1edce0[_0x0a9c('0x30')]=_[_0x0a9c('0x31')](_0x5bd46[_0x0a9c('0x2f')],qs[_0x0a9c('0x32')](_0x2a6196[_0x0a9c('0x2c')]['fields']));_0x1edce0['attributes']=_0x1edce0[_0x0a9c('0x30')][_0x0a9c('0x33')]?_0x1edce0[_0x0a9c('0x30')]:_0x5bd46[_0x0a9c('0x2f')];if(_0x2a6196[_0x0a9c('0x2c')][_0x0a9c('0x3c')]){_0x1edce0['include']=[{'all':!![]}];}_0x1edce0=_['merge']({},_0x1edce0,_0x2a6196[_0x0a9c('0x3a')]);return db[_0x0a9c('0x27')][_0x0a9c('0x43')](_0x1edce0)[_0x0a9c('0x20')](handleEntityNotFound(_0x389725,null))[_0x0a9c('0x20')](respondWithResult(_0x389725,null))[_0x0a9c('0x40')](handleError(_0x389725,null));};exports[_0x0a9c('0x44')]=function(_0x3c3dbb,_0x1cfc5a){return db[_0x0a9c('0x27')]['create'](_0x3c3dbb[_0x0a9c('0x45')],{})['then'](respondWithResult(_0x1cfc5a,0xc9))[_0x0a9c('0x40')](handleError(_0x1cfc5a,null));};exports['update']=function(_0x2c4da1,_0x405562){if(_0x2c4da1[_0x0a9c('0x45')]['id']){delete _0x2c4da1[_0x0a9c('0x45')]['id'];}return db['ServicenowField'][_0x0a9c('0x43')]({'where':{'id':_0x2c4da1['params']['id']}})[_0x0a9c('0x20')](handleEntityNotFound(_0x405562,null))[_0x0a9c('0x20')](saveUpdates(_0x2c4da1['body'],null))[_0x0a9c('0x20')](respondWithResult(_0x405562,null))[_0x0a9c('0x40')](handleError(_0x405562,null));};exports[_0x0a9c('0x1f')]=function(_0x2455e6,_0x5a2a8f){return db['ServicenowField'][_0x0a9c('0x43')]({'where':{'id':_0x2455e6[_0x0a9c('0x42')]['id']}})[_0x0a9c('0x20')](handleEntityNotFound(_0x5a2a8f,null))['then'](removeEntity(_0x5a2a8f,null))[_0x0a9c('0x40')](handleError(_0x5a2a8f,null));}; \ No newline at end of file +var _0xf21c=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','update','then','error','stack','name','send','map','ServicenowField','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','params','keys','include','find','catch','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x50a8ca,_0x43aa15){var _0x2ef4d4=function(_0x359a8a){while(--_0x359a8a){_0x50a8ca['push'](_0x50a8ca['shift']());}};_0x2ef4d4(++_0x43aa15);}(_0xf21c,0x124));var _0xcf21=function(_0x56e4e7,_0x1db098){_0x56e4e7=_0x56e4e7-0x0;var _0x383618=_0xf21c[_0x56e4e7];return _0x383618;};'use strict';var emlformat=require(_0xcf21('0x0'));var rimraf=require(_0xcf21('0x1'));var zipdir=require(_0xcf21('0x2'));var jsonpatch=require(_0xcf21('0x3'));var rp=require(_0xcf21('0x4'));var moment=require(_0xcf21('0x5'));var BPromise=require(_0xcf21('0x6'));var Mustache=require(_0xcf21('0x7'));var util=require(_0xcf21('0x8'));var path=require(_0xcf21('0x9'));var sox=require(_0xcf21('0xa'));var csv=require('to-csv');var ejs=require(_0xcf21('0xb'));var fs=require('fs');var fs_extra=require(_0xcf21('0xc'));var _=require(_0xcf21('0xd'));var squel=require(_0xcf21('0xe'));var crypto=require(_0xcf21('0xf'));var jsforce=require(_0xcf21('0x10'));var deskjs=require(_0xcf21('0x11'));var toCsv=require(_0xcf21('0x12'));var querystring=require(_0xcf21('0x13'));var Papa=require(_0xcf21('0x14'));var Redis=require(_0xcf21('0x15'));var authService=require(_0xcf21('0x16'));var qs=require(_0xcf21('0x17'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcf21('0x18'));var logger=require(_0xcf21('0x19'))(_0xcf21('0x1a'));var utils=require(_0xcf21('0x1b'));var config=require('../../config/environment');var licenseUtil=require(_0xcf21('0x1c'));var db=require(_0xcf21('0x1d'))['db'];function respondWithStatusCode(_0x44b41d,_0x18f99e){_0x18f99e=_0x18f99e||0xcc;return function(_0x49e620){if(_0x49e620){return _0x44b41d[_0xcf21('0x1e')](_0x18f99e);}return _0x44b41d[_0xcf21('0x1f')](_0x18f99e)[_0xcf21('0x20')]();};}function respondWithResult(_0x61daa3,_0x5d4c02){_0x5d4c02=_0x5d4c02||0xc8;return function(_0x3d526e){if(_0x3d526e){return _0x61daa3[_0xcf21('0x1f')](_0x5d4c02)[_0xcf21('0x21')](_0x3d526e);}};}function respondWithFilteredResult(_0x1bc3dd,_0xb6196){return function(_0x27bbcf){if(_0x27bbcf){var _0x3d2da8=typeof _0xb6196[_0xcf21('0x22')]==='undefined'&&typeof _0xb6196[_0xcf21('0x23')]===_0xcf21('0x24');var _0x5b7051=_0x27bbcf[_0xcf21('0x25')];var _0x30794e=_0x3d2da8?0x0:_0xb6196[_0xcf21('0x22')];var _0x5506d9=_0x3d2da8?_0x27bbcf['count']:_0xb6196[_0xcf21('0x22')]+_0xb6196[_0xcf21('0x23')];var _0x3f52b2;if(_0x5506d9>=_0x5b7051){_0x5506d9=_0x5b7051;_0x3f52b2=0xc8;}else{_0x3f52b2=0xce;}_0x1bc3dd[_0xcf21('0x1f')](_0x3f52b2);return _0x1bc3dd['set'](_0xcf21('0x26'),_0x30794e+'-'+_0x5506d9+'/'+_0x5b7051)['json'](_0x27bbcf);}return null;};}function patchUpdates(_0x4d2e92){return function(_0x3a42fe){try{jsonpatch[_0xcf21('0x27')](_0x3a42fe,_0x4d2e92,!![]);}catch(_0x5b1be9){return BPromise[_0xcf21('0x28')](_0x5b1be9);}return _0x3a42fe['save']();};}function saveUpdates(_0x31ffe7,_0x47da9a){return function(_0x45b87e){if(_0x45b87e){return _0x45b87e[_0xcf21('0x29')](_0x31ffe7)['then'](function(_0x4045d7){return _0x4045d7;});}return null;};}function removeEntity(_0x2abc67,_0x536211){return function(_0x56483e){if(_0x56483e){return _0x56483e['destroy']()[_0xcf21('0x2a')](function(){_0x2abc67['status'](0xcc)[_0xcf21('0x20')]();});}};}function handleEntityNotFound(_0x51d2f0,_0x78bda3){return function(_0x19d88a){if(!_0x19d88a){_0x51d2f0[_0xcf21('0x1e')](0x194);}return _0x19d88a;};}function handleError(_0x59c588,_0x4c9424){_0x4c9424=_0x4c9424||0x1f4;return function(_0x46be74){logger[_0xcf21('0x2b')](_0x46be74[_0xcf21('0x2c')]);if(_0x46be74[_0xcf21('0x2d')]){delete _0x46be74['name'];}_0x59c588[_0xcf21('0x1f')](_0x4c9424)[_0xcf21('0x2e')](_0x46be74);};}exports['index']=function(_0x5f4a51,_0x134d7b){var _0x1e438f={},_0x5046e7={},_0x5efa78={'count':0x0,'rows':[]};var _0xdb99ea=_[_0xcf21('0x2f')](db[_0xcf21('0x30')][_0xcf21('0x31')],function(_0x579d1d){return{'name':_0x579d1d[_0xcf21('0x32')],'type':_0x579d1d[_0xcf21('0x33')]['key']};});_0x5046e7[_0xcf21('0x34')]=_['map'](_0xdb99ea,_0xcf21('0x2d'));_0x5046e7[_0xcf21('0x35')]=_['keys'](_0x5f4a51[_0xcf21('0x35')]);_0x5046e7[_0xcf21('0x36')]=_[_0xcf21('0x37')](_0x5046e7[_0xcf21('0x34')],_0x5046e7[_0xcf21('0x35')]);_0x1e438f[_0xcf21('0x38')]=_[_0xcf21('0x37')](_0x5046e7[_0xcf21('0x34')],qs[_0xcf21('0x39')](_0x5f4a51['query']['fields']));_0x1e438f[_0xcf21('0x38')]=_0x1e438f[_0xcf21('0x38')][_0xcf21('0x3a')]?_0x1e438f[_0xcf21('0x38')]:_0x5046e7[_0xcf21('0x34')];if(!_0x5f4a51[_0xcf21('0x35')][_0xcf21('0x3b')](_0xcf21('0x3c'))){_0x1e438f[_0xcf21('0x23')]=qs[_0xcf21('0x23')](_0x5f4a51['query'][_0xcf21('0x23')]);_0x1e438f[_0xcf21('0x22')]=qs[_0xcf21('0x22')](_0x5f4a51[_0xcf21('0x35')][_0xcf21('0x22')]);}_0x1e438f[_0xcf21('0x3d')]=qs[_0xcf21('0x3e')](_0x5f4a51[_0xcf21('0x35')][_0xcf21('0x3e')]);_0x1e438f[_0xcf21('0x3f')]=qs[_0xcf21('0x36')](_[_0xcf21('0x40')](_0x5f4a51[_0xcf21('0x35')],_0x5046e7[_0xcf21('0x36')]),_0xdb99ea);if(_0x5f4a51[_0xcf21('0x35')][_0xcf21('0x41')]){_0x1e438f[_0xcf21('0x3f')]=_[_0xcf21('0x42')](_0x1e438f[_0xcf21('0x3f')],{'$or':_[_0xcf21('0x2f')](_0xdb99ea,function(_0x1f15d6){if(_0x1f15d6[_0xcf21('0x33')]!==_0xcf21('0x43')){var _0xc9233d={};_0xc9233d[_0x1f15d6[_0xcf21('0x2d')]]={'$like':'%'+_0x5f4a51['query'][_0xcf21('0x41')]+'%'};return _0xc9233d;}})});}_0x1e438f=_['merge']({},_0x1e438f,_0x5f4a51[_0xcf21('0x44')]);var _0x42285f={'where':_0x1e438f[_0xcf21('0x3f')]};return db[_0xcf21('0x30')]['count'](_0x42285f)[_0xcf21('0x2a')](function(_0x49ce2f){_0x5efa78['count']=_0x49ce2f;if(_0x5f4a51[_0xcf21('0x35')][_0xcf21('0x45')]){_0x1e438f['include']=[{'all':!![]}];}return db[_0xcf21('0x30')][_0xcf21('0x46')](_0x1e438f);})[_0xcf21('0x2a')](function(_0x5424cd){_0x5efa78[_0xcf21('0x47')]=_0x5424cd;return _0x5efa78;})[_0xcf21('0x2a')](respondWithFilteredResult(_0x134d7b,_0x1e438f))['catch'](handleError(_0x134d7b,null));};exports['show']=function(_0x1b9e0a,_0x4f7ec3){var _0x3cb366={'raw':!![],'where':{'id':_0x1b9e0a[_0xcf21('0x48')]['id']}},_0x4106cd={};_0x4106cd[_0xcf21('0x34')]=_[_0xcf21('0x49')](db['ServicenowField'][_0xcf21('0x31')]);_0x4106cd[_0xcf21('0x35')]=_[_0xcf21('0x49')](_0x1b9e0a[_0xcf21('0x35')]);_0x4106cd[_0xcf21('0x36')]=_[_0xcf21('0x37')](_0x4106cd['model'],_0x4106cd[_0xcf21('0x35')]);_0x3cb366[_0xcf21('0x38')]=_[_0xcf21('0x37')](_0x4106cd[_0xcf21('0x34')],qs[_0xcf21('0x39')](_0x1b9e0a[_0xcf21('0x35')][_0xcf21('0x39')]));_0x3cb366[_0xcf21('0x38')]=_0x3cb366[_0xcf21('0x38')][_0xcf21('0x3a')]?_0x3cb366[_0xcf21('0x38')]:_0x4106cd['model'];if(_0x1b9e0a[_0xcf21('0x35')]['includeAll']){_0x3cb366[_0xcf21('0x4a')]=[{'all':!![]}];}_0x3cb366=_[_0xcf21('0x42')]({},_0x3cb366,_0x1b9e0a[_0xcf21('0x44')]);return db[_0xcf21('0x30')][_0xcf21('0x4b')](_0x3cb366)[_0xcf21('0x2a')](handleEntityNotFound(_0x4f7ec3,null))[_0xcf21('0x2a')](respondWithResult(_0x4f7ec3,null))[_0xcf21('0x4c')](handleError(_0x4f7ec3,null));};exports[_0xcf21('0x4d')]=function(_0x368ec6,_0x183a6e){return db[_0xcf21('0x30')]['create'](_0x368ec6[_0xcf21('0x4e')],{})[_0xcf21('0x2a')](respondWithResult(_0x183a6e,0xc9))['catch'](handleError(_0x183a6e,null));};exports[_0xcf21('0x29')]=function(_0xc52d9f,_0xb3941f){if(_0xc52d9f[_0xcf21('0x4e')]['id']){delete _0xc52d9f[_0xcf21('0x4e')]['id'];}return db[_0xcf21('0x30')][_0xcf21('0x4b')]({'where':{'id':_0xc52d9f[_0xcf21('0x48')]['id']}})['then'](handleEntityNotFound(_0xb3941f,null))[_0xcf21('0x2a')](saveUpdates(_0xc52d9f['body'],null))[_0xcf21('0x2a')](respondWithResult(_0xb3941f,null))[_0xcf21('0x4c')](handleError(_0xb3941f,null));};exports[_0xcf21('0x4f')]=function(_0x4ffcc7,_0x359c47){return db['ServicenowField']['find']({'where':{'id':_0x4ffcc7[_0xcf21('0x48')]['id']}})[_0xcf21('0x2a')](handleEntityNotFound(_0x359c47,null))[_0xcf21('0x2a')](removeEntity(_0x359c47,null))[_0xcf21('0x4c')](handleError(_0x359c47,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index f7ca0ec..6954e22 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 _0xcf92=['idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','int_servicenow_fields','servicenow_unique_index'];(function(_0x44f5c5,_0x142796){var _0x1ea1bf=function(_0x434bb7){while(--_0x434bb7){_0x44f5c5['push'](_0x44f5c5['shift']());}};_0x1ea1bf(++_0x142796);}(_0xcf92,0xe2));var _0x2cf9=function(_0x8dd1b,_0x550d80){_0x8dd1b=_0x8dd1b-0x0;var _0x3de262=_0xcf92[_0x8dd1b];return _0x3de262;};'use strict';var _=require(_0x2cf9('0x0'));var util=require(_0x2cf9('0x1'));var logger=require(_0x2cf9('0x2'))(_0x2cf9('0x3'));var moment=require('moment');var BPromise=require(_0x2cf9('0x4'));var rp=require(_0x2cf9('0x5'));var fs=require('fs');var path=require(_0x2cf9('0x6'));var rimraf=require(_0x2cf9('0x7'));var config=require(_0x2cf9('0x8'));var attributes=require(_0x2cf9('0x9'));module[_0x2cf9('0xa')]=function(_0x107db3,_0x1b5f3b){return _0x107db3[_0x2cf9('0xb')]('ServicenowField',attributes,{'tableName':_0x2cf9('0xc'),'paranoid':![],'indexes':[{'name':_0x2cf9('0xd'),'fields':[_0x2cf9('0xe'),_0x2cf9('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf16d=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intServicenowField.attributes','exports','define','ServicenowField','idField','FieldId'];(function(_0x508926,_0xa05b4f){var _0x49ab00=function(_0x360b74){while(--_0x360b74){_0x508926['push'](_0x508926['shift']());}};_0x49ab00(++_0xa05b4f);}(_0xf16d,0x118));var _0xdf16=function(_0x4bcc90,_0x6e93e){_0x4bcc90=_0x4bcc90-0x0;var _0x610b02=_0xf16d[_0x4bcc90];return _0x610b02;};'use strict';var _=require('lodash');var util=require(_0xdf16('0x0'));var logger=require(_0xdf16('0x1'))(_0xdf16('0x2'));var moment=require(_0xdf16('0x3'));var BPromise=require(_0xdf16('0x4'));var rp=require(_0xdf16('0x5'));var fs=require('fs');var path=require(_0xdf16('0x6'));var rimraf=require(_0xdf16('0x7'));var config=require('../../config/environment');var attributes=require(_0xdf16('0x8'));module[_0xdf16('0x9')]=function(_0x5e9893,_0x193826){return _0x5e9893[_0xdf16('0xa')](_0xdf16('0xb'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0xdf16('0xc'),_0xdf16('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index f9e3cd1..f04fb21 100644 --- a/server/api/intServicenowField/intServicenowField.rpc.js +++ b/server/api/intServicenowField/intServicenowField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac4a=['ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xac4a,0x13f));var _0xaac4=function(_0x514a69,_0x7e375a){_0x514a69=_0x514a69-0x0;var _0x48d11a=_0xac4a[_0x514a69];return _0x48d11a;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('ServicenowField,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('ServicenowField,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});} \ No newline at end of file +var _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ServicenowField,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x38bc46,_0x220502){var _0x34c225=function(_0x4fa88f){while(--_0x4fa88f){_0x38bc46['push'](_0x38bc46['shift']());}};_0x34c225(++_0x220502);}(_0xb43b,0x1b2));var _0xbb43=function(_0x2b4451,_0x85a280){_0x2b4451=_0x2b4451-0x0;var _0x4c12a8=_0xb43b[_0x2b4451];return _0x4c12a8;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 53378ca..de36acb 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x200c2d,_0x56cb2c){var _0x1126e9=function(_0xbcd36c){while(--_0xbcd36c){_0x200c2d['push'](_0x200c2d['shift']());}};_0x1126e9(++_0x56cb2c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x3672ff,_0x2c2af3){var _0x570de8=function(_0x288ef2){while(--_0x288ef2){_0x3672ff['push'](_0x3672ff['shift']());}};_0x570de8(++_0x2c2af3);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index aec125f..de923a5 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(_0x252ca6,_0xd57427){var _0x17bbca=function(_0x392b73){while(--_0x392b73){_0x252ca6['push'](_0x252ca6['shift']());}};_0x17bbca(++_0xd57427);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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(_0x285617,_0x15eede){var _0x567b99=function(_0xd570e1){while(--_0xd570e1){_0x285617['push'](_0x285617['shift']());}};_0x567b99(++_0x15eede);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'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 ccf4b6a..cfdd258 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 _0x5334=['sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','then','status','stack','name','send','index','SugarcrmAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','sort','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','update','destroy','getConfigurations','SugarcrmConfiguration','order','where','length','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','findOne','username','password','remoteUri','slice','POST','format','/service/v4_1/rest.php','login','PLAIN','xCALLY\x20Motion\x20Integration','Password\x20Expired','get_module_fields','stringify','Calls','values','remove','includes','label','endsWith','value','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','path'];(function(_0x25bea7,_0x49ab45){var _0x175952=function(_0x56a0b5){while(--_0x56a0b5){_0x25bea7['push'](_0x25bea7['shift']());}};_0x175952(++_0x49ab45);}(_0x5334,0x1ef));var _0x4533=function(_0x3e739c,_0x16777c){_0x3e739c=_0x3e739c-0x0;var _0x4a3a6d=_0x5334[_0x3e739c];return _0x4a3a6d;};'use strict';var emlformat=require(_0x4533('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4533('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4533('0x2'));var moment=require(_0x4533('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x4533('0x4'));var sox=require(_0x4533('0x5'));var csv=require(_0x4533('0x6'));var ejs=require(_0x4533('0x7'));var fs=require('fs');var fs_extra=require(_0x4533('0x8'));var _=require('lodash');var squel=require(_0x4533('0x9'));var crypto=require(_0x4533('0xa'));var jsforce=require(_0x4533('0xb'));var deskjs=require(_0x4533('0xc'));var toCsv=require(_0x4533('0x6'));var querystring=require(_0x4533('0xd'));var Papa=require(_0x4533('0xe'));var Redis=require('ioredis');var authService=require(_0x4533('0xf'));var qs=require(_0x4533('0x10'));var as=require(_0x4533('0x11'));var hardwareService=require(_0x4533('0x12'));var logger=require(_0x4533('0x13'))(_0x4533('0x14'));var utils=require(_0x4533('0x15'));var config=require(_0x4533('0x16'));var licenseUtil=require(_0x4533('0x17'));var db=require(_0x4533('0x18'))['db'];var integrations=require(_0x4533('0x19'));function respondWithStatusCode(_0x1c8c54,_0x1c8578){_0x1c8578=_0x1c8578||0xcc;return function(_0x4a46d4){if(_0x4a46d4){return _0x1c8c54[_0x4533('0x1a')](_0x1c8578);}return _0x1c8c54['status'](_0x1c8578)[_0x4533('0x1b')]();};}function respondWithResult(_0x3e2468,_0x3281a6){_0x3281a6=_0x3281a6||0xc8;return function(_0x4151c6){if(_0x4151c6){return _0x3e2468['status'](_0x3281a6)['json'](_0x4151c6);}};}function respondWithFilteredResult(_0x5b0c90,_0x48a9f8){return function(_0x4f2d71){if(_0x4f2d71){var _0x2be3a5=typeof _0x48a9f8[_0x4533('0x1c')]==='undefined'&&typeof _0x48a9f8[_0x4533('0x1d')]===_0x4533('0x1e');var _0xa6fd8c=_0x4f2d71['count'];var _0x137539=_0x2be3a5?0x0:_0x48a9f8['offset'];var _0x5b05e8=_0x2be3a5?_0x4f2d71[_0x4533('0x1f')]:_0x48a9f8[_0x4533('0x1c')]+_0x48a9f8[_0x4533('0x1d')];var _0xc005c1;if(_0x5b05e8>=_0xa6fd8c){_0x5b05e8=_0xa6fd8c;_0xc005c1=0xc8;}else{_0xc005c1=0xce;}_0x5b0c90['status'](_0xc005c1);return _0x5b0c90[_0x4533('0x20')](_0x4533('0x21'),_0x137539+'-'+_0x5b05e8+'/'+_0xa6fd8c)[_0x4533('0x22')](_0x4f2d71);}return null;};}function patchUpdates(_0x45063){return function(_0x163058){try{jsonpatch[_0x4533('0x23')](_0x163058,_0x45063,!![]);}catch(_0x21117b){return BPromise[_0x4533('0x24')](_0x21117b);}return _0x163058['save']();};}function saveUpdates(_0x4b1e72,_0x3cde96){return function(_0x3e9214){if(_0x3e9214){return _0x3e9214['update'](_0x4b1e72)[_0x4533('0x25')](function(_0x203f1f){return _0x203f1f;});}return null;};}function removeEntity(_0x313515,_0x6443af){return function(_0x4a6521){if(_0x4a6521){return _0x4a6521['destroy']()[_0x4533('0x25')](function(){_0x313515[_0x4533('0x26')](0xcc)[_0x4533('0x1b')]();});}};}function handleEntityNotFound(_0x317649,_0x5884db){return function(_0x576839){if(!_0x576839){_0x317649['sendStatus'](0x194);}return _0x576839;};}function handleError(_0x372b05,_0x32397e){_0x32397e=_0x32397e||0x1f4;return function(_0x3815da){logger['error'](_0x3815da[_0x4533('0x27')]);if(_0x3815da[_0x4533('0x28')]){delete _0x3815da[_0x4533('0x28')];}_0x372b05[_0x4533('0x26')](_0x32397e)[_0x4533('0x29')](_0x3815da);};}exports[_0x4533('0x2a')]=function(_0xf33ed7,_0xdb40b7){var _0x5d17e7={},_0x42c172={},_0x524836={'count':0x0,'rows':[]};var _0x2b1957=_['map'](db[_0x4533('0x2b')][_0x4533('0x2c')],function(_0x151791){return{'name':_0x151791[_0x4533('0x2d')],'type':_0x151791[_0x4533('0x2e')][_0x4533('0x2f')]};});_0x42c172[_0x4533('0x30')]=_[_0x4533('0x31')](_0x2b1957,_0x4533('0x28'));_0x42c172[_0x4533('0x32')]=_[_0x4533('0x33')](_0xf33ed7[_0x4533('0x32')]);_0x42c172[_0x4533('0x34')]=_[_0x4533('0x35')](_0x42c172[_0x4533('0x30')],_0x42c172[_0x4533('0x32')]);_0x5d17e7['attributes']=_[_0x4533('0x35')](_0x42c172[_0x4533('0x30')],qs[_0x4533('0x36')](_0xf33ed7['query']['fields']));_0x5d17e7[_0x4533('0x37')]=_0x5d17e7[_0x4533('0x37')]['length']?_0x5d17e7[_0x4533('0x37')]:_0x42c172[_0x4533('0x30')];if(!_0xf33ed7['query'][_0x4533('0x38')]('nolimit')){_0x5d17e7[_0x4533('0x1d')]=qs[_0x4533('0x1d')](_0xf33ed7[_0x4533('0x32')][_0x4533('0x1d')]);_0x5d17e7[_0x4533('0x1c')]=qs['offset'](_0xf33ed7['query'][_0x4533('0x1c')]);}_0x5d17e7['order']=qs[_0x4533('0x39')](_0xf33ed7[_0x4533('0x32')][_0x4533('0x39')]);_0x5d17e7['where']=qs[_0x4533('0x34')](_[_0x4533('0x3a')](_0xf33ed7[_0x4533('0x32')],_0x42c172['filters']),_0x2b1957);if(_0xf33ed7[_0x4533('0x32')][_0x4533('0x3b')]){_0x5d17e7['where']=_['merge'](_0x5d17e7['where'],{'$or':_[_0x4533('0x31')](_0x2b1957,function(_0x3b96fa){if(_0x3b96fa[_0x4533('0x2e')]!==_0x4533('0x3c')){var _0x2b872d={};_0x2b872d[_0x3b96fa[_0x4533('0x28')]]={'$like':'%'+_0xf33ed7[_0x4533('0x32')][_0x4533('0x3b')]+'%'};return _0x2b872d;}})});}_0x5d17e7=_[_0x4533('0x3d')]({},_0x5d17e7,_0xf33ed7['options']);var _0xd02f50={'where':_0x5d17e7['where']};return db[_0x4533('0x2b')][_0x4533('0x1f')](_0xd02f50)[_0x4533('0x25')](function(_0x1011c1){_0x524836[_0x4533('0x1f')]=_0x1011c1;if(_0xf33ed7['query'][_0x4533('0x3e')]){_0x5d17e7[_0x4533('0x3f')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0x4533('0x40')](_0x5d17e7);})[_0x4533('0x25')](function(_0x742640){_0x524836[_0x4533('0x41')]=_0x742640;return _0x524836;})[_0x4533('0x25')](respondWithFilteredResult(_0xdb40b7,_0x5d17e7))[_0x4533('0x42')](handleError(_0xdb40b7,null));};exports[_0x4533('0x43')]=function(_0x56a731,_0x5ccd36){var _0xbab2e6={'raw':![],'where':{'id':_0x56a731[_0x4533('0x44')]['id']}},_0x3cfd7e={};_0x3cfd7e[_0x4533('0x30')]=_[_0x4533('0x33')](db['SugarcrmAccount'][_0x4533('0x2c')]);_0x3cfd7e[_0x4533('0x32')]=_['keys'](_0x56a731[_0x4533('0x32')]);_0x3cfd7e['filters']=_[_0x4533('0x35')](_0x3cfd7e[_0x4533('0x30')],_0x3cfd7e[_0x4533('0x32')]);_0xbab2e6[_0x4533('0x37')]=_[_0x4533('0x35')](_0x3cfd7e[_0x4533('0x30')],qs['fields'](_0x56a731[_0x4533('0x32')][_0x4533('0x36')]));_0xbab2e6[_0x4533('0x37')]=_0xbab2e6[_0x4533('0x37')]['length']?_0xbab2e6['attributes']:_0x3cfd7e[_0x4533('0x30')];if(_0x56a731[_0x4533('0x32')][_0x4533('0x3e')]){_0xbab2e6[_0x4533('0x3f')]=[{'all':!![]}];}_0xbab2e6=_['merge']({},_0xbab2e6,_0x56a731[_0x4533('0x45')]);return db['SugarcrmAccount'][_0x4533('0x46')](_0xbab2e6)[_0x4533('0x25')](handleEntityNotFound(_0x5ccd36,null))[_0x4533('0x25')](respondWithResult(_0x5ccd36,null))[_0x4533('0x42')](handleError(_0x5ccd36,null));};exports[_0x4533('0x47')]=function(_0x4722fc,_0x5d9858){return db[_0x4533('0x2b')][_0x4533('0x47')](_0x4722fc[_0x4533('0x48')],{})[_0x4533('0x25')](respondWithResult(_0x5d9858,0xc9))['catch'](handleError(_0x5d9858,null));};exports[_0x4533('0x49')]=function(_0x53c5c5,_0x1c4238){if(_0x53c5c5['body']['id']){delete _0x53c5c5[_0x4533('0x48')]['id'];}return db[_0x4533('0x2b')][_0x4533('0x46')]({'where':{'id':_0x53c5c5['params']['id']}})[_0x4533('0x25')](handleEntityNotFound(_0x1c4238,null))[_0x4533('0x25')](saveUpdates(_0x53c5c5[_0x4533('0x48')],null))[_0x4533('0x25')](respondWithResult(_0x1c4238,null))['catch'](handleError(_0x1c4238,null));};exports[_0x4533('0x4a')]=function(_0x3f68ae,_0x23a955){return db[_0x4533('0x2b')][_0x4533('0x46')]({'where':{'id':_0x3f68ae['params']['id']}})[_0x4533('0x25')](handleEntityNotFound(_0x23a955,null))[_0x4533('0x25')](removeEntity(_0x23a955,null))[_0x4533('0x42')](handleError(_0x23a955,null));};exports[_0x4533('0x4b')]=function(_0x395aff,_0x18ea01,_0x52b9e8){var _0x474dc2={};var _0x46bb5b={};var _0x5503b7;var _0x176f07;return db[_0x4533('0x2b')]['findOne']({'where':{'id':_0x395aff[_0x4533('0x44')]['id']}})[_0x4533('0x25')](handleEntityNotFound(_0x18ea01,null))['then'](function(_0x493051){if(_0x493051){_0x5503b7=_0x493051;_0x46bb5b[_0x4533('0x30')]=_[_0x4533('0x33')](db[_0x4533('0x4c')][_0x4533('0x2c')]);_0x46bb5b['query']=_[_0x4533('0x33')](_0x395aff[_0x4533('0x32')]);_0x46bb5b['filters']=_['intersection'](_0x46bb5b[_0x4533('0x30')],_0x46bb5b[_0x4533('0x32')]);_0x474dc2[_0x4533('0x37')]=_['intersection'](_0x46bb5b[_0x4533('0x30')],qs[_0x4533('0x36')](_0x395aff['query'][_0x4533('0x36')]));_0x474dc2['attributes']=_0x474dc2['attributes']['length']?_0x474dc2['attributes']:_0x46bb5b[_0x4533('0x30')];_0x474dc2[_0x4533('0x4d')]=qs['sort'](_0x395aff[_0x4533('0x32')]['sort']);_0x474dc2[_0x4533('0x4e')]=qs['filters'](_[_0x4533('0x3a')](_0x395aff['query'],_0x46bb5b[_0x4533('0x34')]));if(_0x395aff['query'][_0x4533('0x3b')]){_0x474dc2[_0x4533('0x4e')]=_[_0x4533('0x3d')](_0x474dc2[_0x4533('0x4e')],{'$or':_[_0x4533('0x31')](_0x474dc2[_0x4533('0x37')],function(_0x4e9db1){var _0x4422d4={};_0x4422d4[_0x4e9db1]={'$like':'%'+_0x395aff[_0x4533('0x32')]['filter']+'%'};return _0x4422d4;})});}_0x474dc2=_['merge']({},_0x474dc2,_0x395aff[_0x4533('0x45')]);return _0x5503b7[_0x4533('0x4b')](_0x474dc2);}})[_0x4533('0x25')](function(_0x593816){if(_0x593816){_0x176f07=_0x593816[_0x4533('0x4f')];if(!_0x395aff['query'][_0x4533('0x38')]('nolimit')){_0x474dc2[_0x4533('0x1d')]=qs[_0x4533('0x1d')](_0x395aff[_0x4533('0x32')][_0x4533('0x1d')]);_0x474dc2[_0x4533('0x1c')]=qs['offset'](_0x395aff['query'][_0x4533('0x1c')]);}return _0x5503b7[_0x4533('0x4b')](_0x474dc2);}})[_0x4533('0x25')](function(_0x179efd){if(_0x179efd){return _0x179efd?{'count':_0x176f07,'rows':_0x179efd}:null;}})[_0x4533('0x25')](respondWithResult(_0x18ea01,null))[_0x4533('0x42')](handleError(_0x18ea01,null));};exports[_0x4533('0x50')]=function(_0x1acb77,_0x17b5d5,_0x2c1c75){if(_0x1acb77[_0x4533('0x48')]['id']){delete _0x1acb77[_0x4533('0x48')]['id'];}return db[_0x4533('0x2b')]['findOne']({'where':{'id':_0x1acb77[_0x4533('0x44')]['id']}})[_0x4533('0x25')](handleEntityNotFound(_0x17b5d5,null))[_0x4533('0x25')](function(_0x124520){if(_0x124520){_0x1acb77[_0x4533('0x48')][_0x4533('0x51')]=_0x124520['id'];_0x1acb77[_0x4533('0x48')][_0x4533('0x52')]=integrations[_0x4533('0x53')](_0x1acb77[_0x4533('0x48')][_0x4533('0x54')],_0x1acb77[_0x4533('0x48')]['type']);_0x1acb77['body'][_0x4533('0x55')]=integrations[_0x4533('0x56')](_0x1acb77[_0x4533('0x48')]['channel'],_0x1acb77[_0x4533('0x48')][_0x4533('0x2e')]);return db[_0x4533('0x4c')][_0x4533('0x47')](_0x1acb77[_0x4533('0x48')],{'include':[{'model':db[_0x4533('0x57')],'as':_0x4533('0x52')},{'model':db[_0x4533('0x57')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x17b5d5,null))['catch'](handleError(_0x17b5d5,null));};exports['getFields']=function(_0x18eca3,_0xf76e09,_0x2ab2e3){var _0x5e85c3='';var _0x47c6b6=['id','name',_0x4533('0x58'),_0x4533('0x59'),_0x4533('0x5a'),_0x4533('0x5b'),_0x4533('0x5c'),_0x4533('0x5d'),_0x4533('0x5e'),_0x4533('0x5f'),_0x4533('0x60'),_0x4533('0x61')];return db['SugarcrmAccount'][_0x4533('0x62')]({'where':{'id':_0x18eca3[_0x4533('0x44')]['id']},'attributes':['id',_0x4533('0x63'),_0x4533('0x64'),_0x4533('0x65')]})[_0x4533('0x25')](handleEntityNotFound(_0xf76e09,null))[_0x4533('0x25')](function(_0x3c383c){if(_0x3c383c){_0x5e85c3=_0x3c383c[_0x4533('0x65')];var _0x1df357=_0x5e85c3[_0x4533('0x66')](-0x1);if(_0x1df357==='/'){_0x5e85c3=_0x5e85c3['substring'](0x0,_0x5e85c3['lastIndexOf'](_0x1df357));}return rp({'method':_0x4533('0x67'),'uri':util[_0x4533('0x68')]('%s%s',_0x5e85c3,_0x4533('0x69')),'json':!![],'form':{'method':_0x4533('0x6a'),'input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'user_auth':{'user_name':_0x3c383c['username'],'password':_0x3c383c[_0x4533('0x64')],'encryption':_0x4533('0x6b')},'application':_0x4533('0x6c')})}});}})[_0x4533('0x25')](function(_0x2d8f2f){if(_0x2d8f2f&&_0x2d8f2f['name']!=='Invalid\x20Login'&&_0x2d8f2f['name']!==_0x4533('0x6d')){return rp({'method':_0x4533('0x67'),'uri':util[_0x4533('0x68')]('%s%s',_0x5e85c3,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x4533('0x6e'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x4533('0x6f')]({'session':_0x2d8f2f['id'],'module_name':_0x4533('0x70')})}})[_0x4533('0x25')](function(_0x54f29e){if(_0x54f29e){var _0x387d69=_[_0x4533('0x71')](_0x54f29e['module_fields']);_[_0x4533('0x72')](_0x387d69,function(_0x4bc69d){return _0x47c6b6[_0x4533('0x73')](_0x4bc69d[_0x4533('0x28')]);});return{'count':_0x387d69[_0x4533('0x4f')],'rows':_[_0x4533('0x31')](_0x387d69,function(_0x3ceac4){return{'id':_0x3ceac4[_0x4533('0x28')],'name':_0x3ceac4[_0x4533('0x74')],'custom':_[_0x4533('0x75')](_0x3ceac4[_0x4533('0x28')],'_c')?!![]:![],'options':_0x3ceac4[_0x4533('0x45')]?_[_0x4533('0x31')](_[_0x4533('0x71')](_0x3ceac4[_0x4533('0x45')]),function(_0x4f4e50){return{'name':_0x4f4e50[_0x4533('0x76')],'value':_0x4f4e50[_0x4533('0x28')]};}):[]};})};}})['then'](respondWithResult(_0xf76e09,null))[_0x4533('0x42')](function(_0x5aae59){var _0x2b047a=_0x18eca3[_0x4533('0x32')][_0x4533('0x77')]?0x1f4:_0x5aae59[_0x4533('0x78')]||0x1f4;logger[_0x4533('0x79')](_0x4533('0x7a'),_0x4533('0x7b'),_0x2b047a,JSON[_0x4533('0x6f')](_0x5aae59));delete _0x5aae59[_0x4533('0x28')];if(_0x2b047a===0x191){_0x2b047a=0x190;}_0xf76e09[_0x4533('0x26')](_0x2b047a)['send'](_0x18eca3[_0x4533('0x32')][_0x4533('0x77')]?{'message':_0x4533('0x7c'),'statusCode':_0x5aae59['statusCode']}:_0x5aae59);});}else{var _0x13b0de=0x1f4;_0xf76e09[_0x4533('0x26')](_0x13b0de)[_0x4533('0x29')]({'message':_0x4533('0x7c'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x3ef0=['params','find','create','body','update','findOne','SugarcrmConfiguration','order','getConfigurations','hasOwnProperty','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','created_by','description','date_start','duration_hours','duration_minutes','parent_type','parent_name','direction','username','remoteUri','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','password','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','stringify','Calls','includes','label','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','send','Wrong\x20credentials','eml-format','zip-dir','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','destroy','then','error','stack','index','map','rawAttributes','fieldName','type','model','name','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','SugarcrmAccount','includeAll','include','findAll','rows','catch','show'];(function(_0x1cfbba,_0x4e7a29){var _0x4bc171=function(_0x449afb){while(--_0x449afb){_0x1cfbba['push'](_0x1cfbba['shift']());}};_0x4bc171(++_0x4e7a29);}(_0x3ef0,0x19a));var _0x03ef=function(_0x30b27c,_0x1c4f6e){_0x30b27c=_0x30b27c-0x0;var _0xd8512c=_0x3ef0[_0x30b27c];return _0xd8512c;};'use strict';var emlformat=require(_0x03ef('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x03ef('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x03ef('0x2'));var moment=require('moment');var BPromise=require(_0x03ef('0x3'));var Mustache=require(_0x03ef('0x4'));var util=require(_0x03ef('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x03ef('0x6'));var ejs=require(_0x03ef('0x7'));var fs=require('fs');var fs_extra=require(_0x03ef('0x8'));var _=require('lodash');var squel=require(_0x03ef('0x9'));var crypto=require(_0x03ef('0xa'));var jsforce=require(_0x03ef('0xb'));var deskjs=require(_0x03ef('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x03ef('0xd'));var Redis=require(_0x03ef('0xe'));var authService=require(_0x03ef('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x03ef('0x10'));var hardwareService=require(_0x03ef('0x11'));var logger=require('../../config/logger')(_0x03ef('0x12'));var utils=require(_0x03ef('0x13'));var config=require(_0x03ef('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x03ef('0x15'))['db'];var integrations=require(_0x03ef('0x16'));function respondWithStatusCode(_0x390cc2,_0x1e138e){_0x1e138e=_0x1e138e||0xcc;return function(_0x459f67){if(_0x459f67){return _0x390cc2[_0x03ef('0x17')](_0x1e138e);}return _0x390cc2[_0x03ef('0x18')](_0x1e138e)[_0x03ef('0x19')]();};}function respondWithResult(_0x1702a0,_0x3390ae){_0x3390ae=_0x3390ae||0xc8;return function(_0x336f72){if(_0x336f72){return _0x1702a0['status'](_0x3390ae)['json'](_0x336f72);}};}function respondWithFilteredResult(_0x16282b,_0x17b6ec){return function(_0x1a0113){if(_0x1a0113){var _0x2f6a35=typeof _0x17b6ec[_0x03ef('0x1a')]==='undefined'&&typeof _0x17b6ec['limit']===_0x03ef('0x1b');var _0x1f412c=_0x1a0113['count'];var _0x4a4e96=_0x2f6a35?0x0:_0x17b6ec[_0x03ef('0x1a')];var _0xa3ba09=_0x2f6a35?_0x1a0113[_0x03ef('0x1c')]:_0x17b6ec[_0x03ef('0x1a')]+_0x17b6ec[_0x03ef('0x1d')];var _0x5ee333;if(_0xa3ba09>=_0x1f412c){_0xa3ba09=_0x1f412c;_0x5ee333=0xc8;}else{_0x5ee333=0xce;}_0x16282b[_0x03ef('0x18')](_0x5ee333);return _0x16282b[_0x03ef('0x1e')]('Content-Range',_0x4a4e96+'-'+_0xa3ba09+'/'+_0x1f412c)[_0x03ef('0x1f')](_0x1a0113);}return null;};}function patchUpdates(_0x39f693){return function(_0x3459bc){try{jsonpatch[_0x03ef('0x20')](_0x3459bc,_0x39f693,!![]);}catch(_0x3c156d){return BPromise['reject'](_0x3c156d);}return _0x3459bc['save']();};}function saveUpdates(_0x41d7d7,_0x5d56e1){return function(_0x11073e){if(_0x11073e){return _0x11073e['update'](_0x41d7d7)['then'](function(_0x13b033){return _0x13b033;});}return null;};}function removeEntity(_0x27ac0d,_0x5efaf0){return function(_0x5f0084){if(_0x5f0084){return _0x5f0084[_0x03ef('0x21')]()[_0x03ef('0x22')](function(){_0x27ac0d['status'](0xcc)[_0x03ef('0x19')]();});}};}function handleEntityNotFound(_0x4d3908,_0x2a4c7f){return function(_0x54b217){if(!_0x54b217){_0x4d3908[_0x03ef('0x17')](0x194);}return _0x54b217;};}function handleError(_0x3dd14f,_0x31fd6f){_0x31fd6f=_0x31fd6f||0x1f4;return function(_0x3684e0){logger[_0x03ef('0x23')](_0x3684e0[_0x03ef('0x24')]);if(_0x3684e0['name']){delete _0x3684e0['name'];}_0x3dd14f[_0x03ef('0x18')](_0x31fd6f)['send'](_0x3684e0);};}exports[_0x03ef('0x25')]=function(_0x2b77cd,_0x391f82){var _0x4d9e6a={},_0x627997={},_0x732b3a={'count':0x0,'rows':[]};var _0x301caa=_[_0x03ef('0x26')](db['SugarcrmAccount'][_0x03ef('0x27')],function(_0x2cd00c){return{'name':_0x2cd00c[_0x03ef('0x28')],'type':_0x2cd00c[_0x03ef('0x29')]['key']};});_0x627997[_0x03ef('0x2a')]=_[_0x03ef('0x26')](_0x301caa,_0x03ef('0x2b'));_0x627997['query']=_[_0x03ef('0x2c')](_0x2b77cd[_0x03ef('0x2d')]);_0x627997[_0x03ef('0x2e')]=_[_0x03ef('0x2f')](_0x627997[_0x03ef('0x2a')],_0x627997['query']);_0x4d9e6a[_0x03ef('0x30')]=_[_0x03ef('0x2f')](_0x627997[_0x03ef('0x2a')],qs[_0x03ef('0x31')](_0x2b77cd[_0x03ef('0x2d')]['fields']));_0x4d9e6a[_0x03ef('0x30')]=_0x4d9e6a[_0x03ef('0x30')][_0x03ef('0x32')]?_0x4d9e6a[_0x03ef('0x30')]:_0x627997[_0x03ef('0x2a')];if(!_0x2b77cd['query']['hasOwnProperty'](_0x03ef('0x33'))){_0x4d9e6a[_0x03ef('0x1d')]=qs['limit'](_0x2b77cd[_0x03ef('0x2d')]['limit']);_0x4d9e6a[_0x03ef('0x1a')]=qs[_0x03ef('0x1a')](_0x2b77cd['query'][_0x03ef('0x1a')]);}_0x4d9e6a['order']=qs[_0x03ef('0x34')](_0x2b77cd[_0x03ef('0x2d')]['sort']);_0x4d9e6a['where']=qs[_0x03ef('0x2e')](_[_0x03ef('0x35')](_0x2b77cd['query'],_0x627997[_0x03ef('0x2e')]),_0x301caa);if(_0x2b77cd[_0x03ef('0x2d')][_0x03ef('0x36')]){_0x4d9e6a[_0x03ef('0x37')]=_[_0x03ef('0x38')](_0x4d9e6a[_0x03ef('0x37')],{'$or':_[_0x03ef('0x26')](_0x301caa,function(_0x3ca8e3){if(_0x3ca8e3['type']!==_0x03ef('0x39')){var _0x657c99={};_0x657c99[_0x3ca8e3[_0x03ef('0x2b')]]={'$like':'%'+_0x2b77cd['query'][_0x03ef('0x36')]+'%'};return _0x657c99;}})});}_0x4d9e6a=_[_0x03ef('0x38')]({},_0x4d9e6a,_0x2b77cd[_0x03ef('0x3a')]);var _0x318900={'where':_0x4d9e6a['where']};return db[_0x03ef('0x3b')][_0x03ef('0x1c')](_0x318900)[_0x03ef('0x22')](function(_0x5f8cb2){_0x732b3a['count']=_0x5f8cb2;if(_0x2b77cd[_0x03ef('0x2d')][_0x03ef('0x3c')]){_0x4d9e6a[_0x03ef('0x3d')]=[{'all':!![]}];}return db[_0x03ef('0x3b')][_0x03ef('0x3e')](_0x4d9e6a);})[_0x03ef('0x22')](function(_0x349e17){_0x732b3a[_0x03ef('0x3f')]=_0x349e17;return _0x732b3a;})[_0x03ef('0x22')](respondWithFilteredResult(_0x391f82,_0x4d9e6a))[_0x03ef('0x40')](handleError(_0x391f82,null));};exports[_0x03ef('0x41')]=function(_0x134200,_0x1a6ba6){var _0x8f7f42={'raw':![],'where':{'id':_0x134200[_0x03ef('0x42')]['id']}},_0x3b3638={};_0x3b3638[_0x03ef('0x2a')]=_[_0x03ef('0x2c')](db[_0x03ef('0x3b')][_0x03ef('0x27')]);_0x3b3638[_0x03ef('0x2d')]=_[_0x03ef('0x2c')](_0x134200['query']);_0x3b3638[_0x03ef('0x2e')]=_[_0x03ef('0x2f')](_0x3b3638[_0x03ef('0x2a')],_0x3b3638[_0x03ef('0x2d')]);_0x8f7f42[_0x03ef('0x30')]=_[_0x03ef('0x2f')](_0x3b3638[_0x03ef('0x2a')],qs[_0x03ef('0x31')](_0x134200[_0x03ef('0x2d')][_0x03ef('0x31')]));_0x8f7f42[_0x03ef('0x30')]=_0x8f7f42[_0x03ef('0x30')]['length']?_0x8f7f42[_0x03ef('0x30')]:_0x3b3638[_0x03ef('0x2a')];if(_0x134200['query'][_0x03ef('0x3c')]){_0x8f7f42[_0x03ef('0x3d')]=[{'all':!![]}];}_0x8f7f42=_['merge']({},_0x8f7f42,_0x134200[_0x03ef('0x3a')]);return db[_0x03ef('0x3b')][_0x03ef('0x43')](_0x8f7f42)['then'](handleEntityNotFound(_0x1a6ba6,null))[_0x03ef('0x22')](respondWithResult(_0x1a6ba6,null))[_0x03ef('0x40')](handleError(_0x1a6ba6,null));};exports['create']=function(_0x535607,_0x251ca9){return db[_0x03ef('0x3b')][_0x03ef('0x44')](_0x535607[_0x03ef('0x45')],{})[_0x03ef('0x22')](respondWithResult(_0x251ca9,0xc9))[_0x03ef('0x40')](handleError(_0x251ca9,null));};exports[_0x03ef('0x46')]=function(_0x2e3145,_0xdaf61d){if(_0x2e3145['body']['id']){delete _0x2e3145[_0x03ef('0x45')]['id'];}return db['SugarcrmAccount'][_0x03ef('0x43')]({'where':{'id':_0x2e3145[_0x03ef('0x42')]['id']}})['then'](handleEntityNotFound(_0xdaf61d,null))[_0x03ef('0x22')](saveUpdates(_0x2e3145[_0x03ef('0x45')],null))[_0x03ef('0x22')](respondWithResult(_0xdaf61d,null))[_0x03ef('0x40')](handleError(_0xdaf61d,null));};exports[_0x03ef('0x21')]=function(_0x4a052d,_0x1b7e2f){return db[_0x03ef('0x3b')]['find']({'where':{'id':_0x4a052d[_0x03ef('0x42')]['id']}})[_0x03ef('0x22')](handleEntityNotFound(_0x1b7e2f,null))['then'](removeEntity(_0x1b7e2f,null))[_0x03ef('0x40')](handleError(_0x1b7e2f,null));};exports['getConfigurations']=function(_0x48361c,_0xf4ed23,_0x1d6df5){var _0x5a0c23={};var _0x4a1d9b={};var _0x1eda74;var _0x5a5533;return db[_0x03ef('0x3b')][_0x03ef('0x47')]({'where':{'id':_0x48361c[_0x03ef('0x42')]['id']}})[_0x03ef('0x22')](handleEntityNotFound(_0xf4ed23,null))[_0x03ef('0x22')](function(_0x492b1d){if(_0x492b1d){_0x1eda74=_0x492b1d;_0x4a1d9b[_0x03ef('0x2a')]=_['keys'](db[_0x03ef('0x48')][_0x03ef('0x27')]);_0x4a1d9b[_0x03ef('0x2d')]=_[_0x03ef('0x2c')](_0x48361c[_0x03ef('0x2d')]);_0x4a1d9b[_0x03ef('0x2e')]=_[_0x03ef('0x2f')](_0x4a1d9b[_0x03ef('0x2a')],_0x4a1d9b[_0x03ef('0x2d')]);_0x5a0c23['attributes']=_['intersection'](_0x4a1d9b[_0x03ef('0x2a')],qs[_0x03ef('0x31')](_0x48361c[_0x03ef('0x2d')][_0x03ef('0x31')]));_0x5a0c23['attributes']=_0x5a0c23[_0x03ef('0x30')][_0x03ef('0x32')]?_0x5a0c23[_0x03ef('0x30')]:_0x4a1d9b[_0x03ef('0x2a')];_0x5a0c23[_0x03ef('0x49')]=qs[_0x03ef('0x34')](_0x48361c['query'][_0x03ef('0x34')]);_0x5a0c23[_0x03ef('0x37')]=qs[_0x03ef('0x2e')](_['pick'](_0x48361c[_0x03ef('0x2d')],_0x4a1d9b[_0x03ef('0x2e')]));if(_0x48361c[_0x03ef('0x2d')][_0x03ef('0x36')]){_0x5a0c23[_0x03ef('0x37')]=_[_0x03ef('0x38')](_0x5a0c23['where'],{'$or':_[_0x03ef('0x26')](_0x5a0c23[_0x03ef('0x30')],function(_0x4dad13){var _0x111e0d={};_0x111e0d[_0x4dad13]={'$like':'%'+_0x48361c[_0x03ef('0x2d')][_0x03ef('0x36')]+'%'};return _0x111e0d;})});}_0x5a0c23=_[_0x03ef('0x38')]({},_0x5a0c23,_0x48361c['options']);return _0x1eda74[_0x03ef('0x4a')](_0x5a0c23);}})[_0x03ef('0x22')](function(_0x376d60){if(_0x376d60){_0x5a5533=_0x376d60[_0x03ef('0x32')];if(!_0x48361c[_0x03ef('0x2d')][_0x03ef('0x4b')](_0x03ef('0x33'))){_0x5a0c23[_0x03ef('0x1d')]=qs[_0x03ef('0x1d')](_0x48361c[_0x03ef('0x2d')][_0x03ef('0x1d')]);_0x5a0c23['offset']=qs[_0x03ef('0x1a')](_0x48361c[_0x03ef('0x2d')][_0x03ef('0x1a')]);}return _0x1eda74[_0x03ef('0x4a')](_0x5a0c23);}})[_0x03ef('0x22')](function(_0x222f85){if(_0x222f85){return _0x222f85?{'count':_0x5a5533,'rows':_0x222f85}:null;}})[_0x03ef('0x22')](respondWithResult(_0xf4ed23,null))[_0x03ef('0x40')](handleError(_0xf4ed23,null));};exports[_0x03ef('0x4c')]=function(_0x6193f1,_0x5d9059,_0x365c2a){if(_0x6193f1[_0x03ef('0x45')]['id']){delete _0x6193f1[_0x03ef('0x45')]['id'];}return db[_0x03ef('0x3b')][_0x03ef('0x47')]({'where':{'id':_0x6193f1[_0x03ef('0x42')]['id']}})[_0x03ef('0x22')](handleEntityNotFound(_0x5d9059,null))[_0x03ef('0x22')](function(_0x39f3fd){if(_0x39f3fd){_0x6193f1[_0x03ef('0x45')]['AccountId']=_0x39f3fd['id'];_0x6193f1[_0x03ef('0x45')][_0x03ef('0x4d')]=integrations[_0x03ef('0x4e')](_0x6193f1[_0x03ef('0x45')][_0x03ef('0x4f')],_0x6193f1[_0x03ef('0x45')][_0x03ef('0x29')]);_0x6193f1[_0x03ef('0x45')][_0x03ef('0x50')]=integrations[_0x03ef('0x51')](_0x6193f1[_0x03ef('0x45')][_0x03ef('0x4f')],_0x6193f1['body'][_0x03ef('0x29')]);return db[_0x03ef('0x48')][_0x03ef('0x44')](_0x6193f1[_0x03ef('0x45')],{'include':[{'model':db[_0x03ef('0x52')],'as':_0x03ef('0x4d')},{'model':db[_0x03ef('0x52')],'as':_0x03ef('0x50')}]});}return null;})[_0x03ef('0x22')](respondWithResult(_0x5d9059,null))[_0x03ef('0x40')](handleError(_0x5d9059,null));};exports['getFields']=function(_0x340422,_0x5295e9,_0x4a1ec5){var _0x2f836e='';var _0x3de14a=['id',_0x03ef('0x2b'),'assigned_user_id',_0x03ef('0x53'),_0x03ef('0x54'),_0x03ef('0x55'),_0x03ef('0x56'),_0x03ef('0x57'),'parent_id',_0x03ef('0x58'),_0x03ef('0x59'),_0x03ef('0x5a')];return db[_0x03ef('0x3b')][_0x03ef('0x47')]({'where':{'id':_0x340422[_0x03ef('0x42')]['id']},'attributes':['id',_0x03ef('0x5b'),'password',_0x03ef('0x5c')]})[_0x03ef('0x22')](handleEntityNotFound(_0x5295e9,null))['then'](function(_0x4fa38f){if(_0x4fa38f){_0x2f836e=_0x4fa38f[_0x03ef('0x5c')];var _0x2f34f2=_0x2f836e['slice'](-0x1);if(_0x2f34f2==='/'){_0x2f836e=_0x2f836e[_0x03ef('0x5d')](0x0,_0x2f836e[_0x03ef('0x5e')](_0x2f34f2));}return rp({'method':_0x03ef('0x5f'),'uri':util[_0x03ef('0x60')](_0x03ef('0x61'),_0x2f836e,_0x03ef('0x62')),'json':!![],'form':{'method':_0x03ef('0x63'),'input_type':_0x03ef('0x64'),'response_type':_0x03ef('0x64'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x4fa38f['username'],'password':_0x4fa38f[_0x03ef('0x65')],'encryption':_0x03ef('0x66')},'application':_0x03ef('0x67')})}});}})['then'](function(_0x12513){if(_0x12513&&_0x12513[_0x03ef('0x2b')]!==_0x03ef('0x68')&&_0x12513['name']!==_0x03ef('0x69')){return rp({'method':'POST','uri':util[_0x03ef('0x60')](_0x03ef('0x61'),_0x2f836e,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x03ef('0x6a'),'input_type':'JSON','response_type':_0x03ef('0x64'),'rest_data':JSON[_0x03ef('0x6b')]({'session':_0x12513['id'],'module_name':_0x03ef('0x6c')})}})[_0x03ef('0x22')](function(_0x4f7dd5){if(_0x4f7dd5){var _0x228196=_['values'](_0x4f7dd5['module_fields']);_['remove'](_0x228196,function(_0x2f5307){return _0x3de14a[_0x03ef('0x6d')](_0x2f5307[_0x03ef('0x2b')]);});return{'count':_0x228196[_0x03ef('0x32')],'rows':_[_0x03ef('0x26')](_0x228196,function(_0x29912f){return{'id':_0x29912f[_0x03ef('0x2b')],'name':_0x29912f[_0x03ef('0x6e')],'custom':_[_0x03ef('0x6f')](_0x29912f['name'],'_c')?!![]:![],'options':_0x29912f['options']?_['map'](_['values'](_0x29912f['options']),function(_0x2ef0de){return{'name':_0x2ef0de[_0x03ef('0x70')],'value':_0x2ef0de[_0x03ef('0x2b')]};}):[]};})};}})[_0x03ef('0x22')](respondWithResult(_0x5295e9,null))[_0x03ef('0x40')](function(_0x7fdf2e){var _0x5934a1=_0x340422[_0x03ef('0x2d')][_0x03ef('0x71')]?0x1f4:_0x7fdf2e[_0x03ef('0x72')]||0x1f4;logger[_0x03ef('0x23')](_0x03ef('0x73'),_0x03ef('0x74'),_0x5934a1,JSON[_0x03ef('0x6b')](_0x7fdf2e));delete _0x7fdf2e[_0x03ef('0x2b')];if(_0x5934a1===0x191){_0x5934a1=0x190;}_0x5295e9[_0x03ef('0x18')](_0x5934a1)[_0x03ef('0x75')](_0x340422[_0x03ef('0x2d')][_0x03ef('0x71')]?{'message':_0x03ef('0x76'),'statusCode':_0x7fdf2e['statusCode']}:_0x7fdf2e);});}else{var _0x23eab9=0x1f4;_0x5295e9[_0x03ef('0x18')](_0x23eab9)[_0x03ef('0x75')]({'message':_0x03ef('0x76'),'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 4ec6d78..07b142b 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 _0x62d1=['path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','SugarcrmAccount','util','../../config/logger','moment','bluebird'];(function(_0x126f47,_0x2199e9){var _0x49508a=function(_0x20ba36){while(--_0x20ba36){_0x126f47['push'](_0x126f47['shift']());}};_0x49508a(++_0x2199e9);}(_0x62d1,0x75));var _0x162d=function(_0x26d51f,_0x1de895){_0x26d51f=_0x26d51f-0x0;var _0x48305d=_0x62d1[_0x26d51f];return _0x48305d;};'use strict';var _=require('lodash');var util=require(_0x162d('0x0'));var logger=require(_0x162d('0x1'))('api');var moment=require(_0x162d('0x2'));var BPromise=require(_0x162d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x162d('0x4'));var rimraf=require(_0x162d('0x5'));var config=require(_0x162d('0x6'));var attributes=require(_0x162d('0x7'));var integrations=require(_0x162d('0x8'));module[_0x162d('0x9')]=function(_0x1d40ac,_0x2c9312){return _0x1d40ac['define'](_0x162d('0xa'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7605=['define','SugarcrmAccount','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x37ca17,_0x11378a){var _0x266db7=function(_0x3f7c3b){while(--_0x3f7c3b){_0x37ca17['push'](_0x37ca17['shift']());}};_0x266db7(++_0x11378a);}(_0x7605,0xc2));var _0x5760=function(_0x23bebe,_0x4290c){_0x23bebe=_0x23bebe-0x0;var _0x18502f=_0x7605[_0x23bebe];return _0x18502f;};'use strict';var _=require('lodash');var util=require(_0x5760('0x0'));var logger=require(_0x5760('0x1'))(_0x5760('0x2'));var moment=require('moment');var BPromise=require(_0x5760('0x3'));var rp=require(_0x5760('0x4'));var fs=require('fs');var path=require(_0x5760('0x5'));var rimraf=require('rimraf');var config=require(_0x5760('0x6'));var attributes=require(_0x5760('0x7'));var integrations=require(_0x5760('0x8'));module[_0x5760('0x9')]=function(_0x5052ad,_0x564ef5){return _0x5052ad[_0x5760('0xa')](_0x5760('0xb'),attributes,{'tableName':'int_sugarcrm_accounts','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 d8de241..61618f4 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 _0x6153=['map','model','find','ShowSugarcrmAccount','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetSugarcrmAccount','SugarcrmAccount','options','raw','where','attributes','limit','include'];(function(_0x3a072a,_0x4559d2){var _0x1bb736=function(_0x4262c3){while(--_0x4262c3){_0x3a072a['push'](_0x3a072a['shift']());}};_0x1bb736(++_0x4559d2);}(_0x6153,0x10e));var _0x3615=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x6153[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x3615('0x0'));var util=require(_0x3615('0x1'));var moment=require('moment');var BPromise=require(_0x3615('0x2'));var rs=require(_0x3615('0x3'));var fs=require('fs');var Redis=require(_0x3615('0x4'));var db=require(_0x3615('0x5'))['db'];var utils=require(_0x3615('0x6'));var logger=require(_0x3615('0x7'))(_0x3615('0x8'));var config=require(_0x3615('0x9'));var jayson=require(_0x3615('0xa'));var client=jayson[_0x3615('0xb')][_0x3615('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1ae073,_0xf7668,_0x21a576){return new BPromise(function(_0x4d00e7,_0x921849){return client[_0x3615('0xd')](_0x1ae073,_0x21a576)[_0x3615('0xe')](function(_0xc40ace){logger['info'](_0x3615('0xf'),_0xf7668,_0x3615('0x10'));logger[_0x3615('0x11')](_0x3615('0x12'),_0xf7668,'request\x20sent',JSON[_0x3615('0x13')](_0xc40ace));if(_0xc40ace[_0x3615('0x14')]){if(_0xc40ace[_0x3615('0x14')][_0x3615('0x15')]===0x1f4){logger[_0x3615('0x14')]('SugarcrmAccount,\x20%s,\x20%s',_0xf7668,_0xc40ace[_0x3615('0x14')][_0x3615('0x16')]);return _0x921849(_0xc40ace['error'][_0x3615('0x16')]);}logger['error'](_0x3615('0xf'),_0xf7668,_0xc40ace[_0x3615('0x14')][_0x3615('0x16')]);return _0x4d00e7(_0xc40ace[_0x3615('0x14')]['message']);}else{logger[_0x3615('0x17')](_0x3615('0xf'),_0xf7668,_0x3615('0x10'));_0x4d00e7(_0xc40ace[_0x3615('0x18')][_0x3615('0x16')]);}})[_0x3615('0x19')](function(_0x2f41ff){logger[_0x3615('0x14')]('SugarcrmAccount,\x20%s,\x20%s',_0xf7668,_0x2f41ff);_0x921849(_0x2f41ff);});});}exports[_0x3615('0x1a')]=function(_0x1ef9a7){var _0x326120=this;return new Promise(function(_0x27126c,_0x551baf){return db[_0x3615('0x1b')]['findAll']({'raw':_0x1ef9a7[_0x3615('0x1c')]?_0x1ef9a7[_0x3615('0x1c')][_0x3615('0x1d')]===undefined?!![]:![]:!![],'where':_0x1ef9a7[_0x3615('0x1c')]?_0x1ef9a7[_0x3615('0x1c')][_0x3615('0x1e')]||null:null,'attributes':_0x1ef9a7[_0x3615('0x1c')]?_0x1ef9a7[_0x3615('0x1c')][_0x3615('0x1f')]||null:null,'limit':_0x1ef9a7['options']?_0x1ef9a7[_0x3615('0x1c')][_0x3615('0x20')]||null:null,'include':_0x1ef9a7[_0x3615('0x1c')]?_0x1ef9a7[_0x3615('0x1c')][_0x3615('0x21')]?_[_0x3615('0x22')](_0x1ef9a7[_0x3615('0x1c')][_0x3615('0x21')],function(_0x3fe961){return{'model':db[_0x3fe961['model']],'as':_0x3fe961['as'],'attributes':_0x3fe961[_0x3615('0x1f')],'include':_0x3fe961[_0x3615('0x21')]?_['map'](_0x3fe961[_0x3615('0x21')],function(_0x585054){return{'model':db[_0x585054[_0x3615('0x23')]],'as':_0x585054['as'],'attributes':_0x585054['attributes'],'include':_0x585054['include']?_['map'](_0x585054[_0x3615('0x21')],function(_0x2d9f32){return{'model':db[_0x2d9f32['model']],'as':_0x2d9f32['as'],'attributes':_0x2d9f32['attributes']};}):[]};}):[]};}):[]:[]})[_0x3615('0xe')](function(_0x426b13){logger[_0x3615('0x17')](_0x3615('0x1a'),_0x1ef9a7);logger[_0x3615('0x11')](_0x3615('0x1a'),_0x1ef9a7,JSON[_0x3615('0x13')](_0x426b13));_0x27126c(_0x426b13);})['catch'](function(_0x4c566b){logger[_0x3615('0x14')]('GetSugarcrmAccount',_0x4c566b['message'],_0x1ef9a7);_0x551baf(_0x326120[_0x3615('0x14')](0x1f4,_0x4c566b[_0x3615('0x16')]));});});};exports['ShowSugarcrmAccount']=function(_0x52de76){var _0x6afb88=this;return new Promise(function(_0x275519,_0x3edba9){return db[_0x3615('0x1b')][_0x3615('0x24')]({'raw':_0x52de76['options']?_0x52de76['options'][_0x3615('0x1d')]===undefined?!![]:![]:!![],'where':_0x52de76[_0x3615('0x1c')]?_0x52de76[_0x3615('0x1c')][_0x3615('0x1e')]||null:null,'attributes':_0x52de76[_0x3615('0x1c')]?_0x52de76[_0x3615('0x1c')][_0x3615('0x1f')]||null:null,'include':_0x52de76[_0x3615('0x1c')]?_0x52de76[_0x3615('0x1c')][_0x3615('0x21')]?_[_0x3615('0x22')](_0x52de76[_0x3615('0x1c')][_0x3615('0x21')],function(_0xffc526){return{'model':db[_0xffc526[_0x3615('0x23')]],'as':_0xffc526['as'],'attributes':_0xffc526[_0x3615('0x1f')],'include':_0xffc526[_0x3615('0x21')]?_[_0x3615('0x22')](_0xffc526['include'],function(_0x295169){return{'model':db[_0x295169[_0x3615('0x23')]],'as':_0x295169['as'],'attributes':_0x295169['attributes'],'include':_0x295169[_0x3615('0x21')]?_[_0x3615('0x22')](_0x295169[_0x3615('0x21')],function(_0x276407){return{'model':db[_0x276407[_0x3615('0x23')]],'as':_0x276407['as'],'attributes':_0x276407[_0x3615('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x3615('0xe')](function(_0x4e8926){logger[_0x3615('0x17')]('ShowSugarcrmAccount',_0x52de76);logger['debug'](_0x3615('0x25'),_0x52de76,JSON[_0x3615('0x13')](_0x4e8926));_0x275519(_0x4e8926);})[_0x3615('0x19')](function(_0x11ce5e){logger[_0x3615('0x14')](_0x3615('0x25'),_0x11ce5e['message'],_0x52de76);_0x3edba9(_0x6afb88[_0x3615('0x14')](0x1f4,_0x11ce5e[_0x3615('0x16')]));});});}; \ No newline at end of file +var _0x30b8=['info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','findAll','options','raw','attributes','limit','include','model','map','GetSugarcrmAccount','ShowSugarcrmAccount','SugarcrmAccount','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x30b8,0x9e));var _0x830b=function(_0x3cafea,_0x3ffede){_0x3cafea=_0x3cafea-0x0;var _0xd4d7c4=_0x30b8[_0x3cafea];return _0xd4d7c4;};'use strict';var _=require(_0x830b('0x0'));var util=require(_0x830b('0x1'));var moment=require(_0x830b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x830b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x830b('0x4'));var logger=require(_0x830b('0x5'))(_0x830b('0x6'));var config=require(_0x830b('0x7'));var jayson=require(_0x830b('0x8'));var client=jayson['client'][_0x830b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x43cf8a,_0x30e563,_0x51beb0){return new BPromise(function(_0x3e190c,_0x1dd4f){return client[_0x830b('0xa')](_0x43cf8a,_0x51beb0)[_0x830b('0xb')](function(_0x21e693){logger[_0x830b('0xc')](_0x830b('0xd'),_0x30e563,_0x830b('0xe'));logger[_0x830b('0xf')](_0x830b('0x10'),_0x30e563,_0x830b('0xe'),JSON[_0x830b('0x11')](_0x21e693));if(_0x21e693[_0x830b('0x12')]){if(_0x21e693[_0x830b('0x12')][_0x830b('0x13')]===0x1f4){logger[_0x830b('0x12')](_0x830b('0xd'),_0x30e563,_0x21e693[_0x830b('0x12')][_0x830b('0x14')]);return _0x1dd4f(_0x21e693[_0x830b('0x12')][_0x830b('0x14')]);}logger[_0x830b('0x12')](_0x830b('0xd'),_0x30e563,_0x21e693[_0x830b('0x12')][_0x830b('0x14')]);return _0x3e190c(_0x21e693[_0x830b('0x12')][_0x830b('0x14')]);}else{logger[_0x830b('0xc')](_0x830b('0xd'),_0x30e563,_0x830b('0xe'));_0x3e190c(_0x21e693[_0x830b('0x15')][_0x830b('0x14')]);}})['catch'](function(_0x5a16bf){logger[_0x830b('0x12')](_0x830b('0xd'),_0x30e563,_0x5a16bf);_0x1dd4f(_0x5a16bf);});});}exports['GetSugarcrmAccount']=function(_0x4cf749){var _0x71c50c=this;return new Promise(function(_0x5a882a,_0x49b6f3){return db['SugarcrmAccount'][_0x830b('0x16')]({'raw':_0x4cf749[_0x830b('0x17')]?_0x4cf749['options'][_0x830b('0x18')]===undefined?!![]:![]:!![],'where':_0x4cf749['options']?_0x4cf749[_0x830b('0x17')]['where']||null:null,'attributes':_0x4cf749[_0x830b('0x17')]?_0x4cf749[_0x830b('0x17')][_0x830b('0x19')]||null:null,'limit':_0x4cf749[_0x830b('0x17')]?_0x4cf749[_0x830b('0x17')][_0x830b('0x1a')]||null:null,'include':_0x4cf749[_0x830b('0x17')]?_0x4cf749['options'][_0x830b('0x1b')]?_['map'](_0x4cf749[_0x830b('0x17')][_0x830b('0x1b')],function(_0x22bc98){return{'model':db[_0x22bc98[_0x830b('0x1c')]],'as':_0x22bc98['as'],'attributes':_0x22bc98['attributes'],'include':_0x22bc98[_0x830b('0x1b')]?_[_0x830b('0x1d')](_0x22bc98['include'],function(_0x1d2c85){return{'model':db[_0x1d2c85['model']],'as':_0x1d2c85['as'],'attributes':_0x1d2c85[_0x830b('0x19')],'include':_0x1d2c85[_0x830b('0x1b')]?_[_0x830b('0x1d')](_0x1d2c85[_0x830b('0x1b')],function(_0x5a620b){return{'model':db[_0x5a620b[_0x830b('0x1c')]],'as':_0x5a620b['as'],'attributes':_0x5a620b[_0x830b('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x49e5e7){logger[_0x830b('0xc')]('GetSugarcrmAccount',_0x4cf749);logger[_0x830b('0xf')](_0x830b('0x1e'),_0x4cf749,JSON[_0x830b('0x11')](_0x49e5e7));_0x5a882a(_0x49e5e7);})['catch'](function(_0x21ebd2){logger[_0x830b('0x12')](_0x830b('0x1e'),_0x21ebd2['message'],_0x4cf749);_0x49b6f3(_0x71c50c['error'](0x1f4,_0x21ebd2[_0x830b('0x14')]));});});};exports[_0x830b('0x1f')]=function(_0x20d044){var _0x56c19a=this;return new Promise(function(_0x26cc9b,_0x2fce13){return db[_0x830b('0x20')]['find']({'raw':_0x20d044[_0x830b('0x17')]?_0x20d044[_0x830b('0x17')][_0x830b('0x18')]===undefined?!![]:![]:!![],'where':_0x20d044['options']?_0x20d044['options']['where']||null:null,'attributes':_0x20d044['options']?_0x20d044[_0x830b('0x17')][_0x830b('0x19')]||null:null,'include':_0x20d044[_0x830b('0x17')]?_0x20d044[_0x830b('0x17')]['include']?_[_0x830b('0x1d')](_0x20d044['options'][_0x830b('0x1b')],function(_0x6a648c){return{'model':db[_0x6a648c['model']],'as':_0x6a648c['as'],'attributes':_0x6a648c[_0x830b('0x19')],'include':_0x6a648c[_0x830b('0x1b')]?_[_0x830b('0x1d')](_0x6a648c[_0x830b('0x1b')],function(_0x4d5438){return{'model':db[_0x4d5438['model']],'as':_0x4d5438['as'],'attributes':_0x4d5438[_0x830b('0x19')],'include':_0x4d5438[_0x830b('0x1b')]?_[_0x830b('0x1d')](_0x4d5438[_0x830b('0x1b')],function(_0x36c9ba){return{'model':db[_0x36c9ba[_0x830b('0x1c')]],'as':_0x36c9ba['as'],'attributes':_0x36c9ba[_0x830b('0x19')]};}):[]};}):[]};}):[]:[]})[_0x830b('0xb')](function(_0x272984){logger['info'](_0x830b('0x1f'),_0x20d044);logger[_0x830b('0xf')](_0x830b('0x1f'),_0x20d044,JSON[_0x830b('0x11')](_0x272984));_0x26cc9b(_0x272984);})[_0x830b('0x21')](function(_0x5201dd){logger['error']('ShowSugarcrmAccount',_0x5201dd['message'],_0x20d044);_0x2fce13(_0x56c19a[_0x830b('0x12')](0x1f4,_0x5201dd[_0x830b('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 4779663..f2b30e2 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 _0xd7af=['update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post'];(function(_0x10dc60,_0x2fcce1){var _0x47dec5=function(_0x24b5e4){while(--_0x24b5e4){_0x10dc60['push'](_0x10dc60['shift']());}};_0x47dec5(++_0x2fcce1);}(_0xd7af,0x77));var _0xfd7a=function(_0x46de67,_0x294bbb){_0x46de67=_0x46de67-0x0;var _0x969b6a=_0xd7af[_0x46de67];return _0x969b6a;};'use strict';var multer=require(_0xfd7a('0x0'));var util=require(_0xfd7a('0x1'));var path=require(_0xfd7a('0x2'));var timeout=require(_0xfd7a('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xfd7a('0x4'));var config=require(_0xfd7a('0x5'));var controller=require(_0xfd7a('0x6'));router['get']('/',auth[_0xfd7a('0x7')](),controller[_0xfd7a('0x8')]);router[_0xfd7a('0x9')](_0xfd7a('0xa'),auth[_0xfd7a('0x7')](),controller[_0xfd7a('0xb')]);router[_0xfd7a('0x9')](_0xfd7a('0xc'),auth[_0xfd7a('0x7')](),controller[_0xfd7a('0xd')]);router[_0xfd7a('0x9')](_0xfd7a('0xe'),auth[_0xfd7a('0x7')](),controller[_0xfd7a('0xf')]);router[_0xfd7a('0x9')](_0xfd7a('0x10'),auth[_0xfd7a('0x7')](),controller[_0xfd7a('0x11')]);router[_0xfd7a('0x12')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xfd7a('0xa'),auth[_0xfd7a('0x7')](),controller[_0xfd7a('0x13')]);router[_0xfd7a('0x14')](_0xfd7a('0xa'),auth[_0xfd7a('0x7')](),controller[_0xfd7a('0x15')]);module[_0xfd7a('0x16')]=router; \ No newline at end of file +var _0x0607=['index','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','put','update','delete','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x3b72ab,_0x306780){var _0x1c0e3c=function(_0x448cf6){while(--_0x448cf6){_0x3b72ab['push'](_0x3b72ab['shift']());}};_0x1c0e3c(++_0x306780);}(_0x0607,0xe7));var _0x7060=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x0607[_0x1ac595];return _0x455fff;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x7060('0x0'));var express=require(_0x7060('0x1'));var router=express[_0x7060('0x2')]();var fs_extra=require(_0x7060('0x3'));var auth=require(_0x7060('0x4'));var interaction=require(_0x7060('0x5'));var config=require(_0x7060('0x6'));var controller=require('./intSugarcrmConfiguration.controller');router[_0x7060('0x7')]('/',auth[_0x7060('0x8')](),controller[_0x7060('0x9')]);router[_0x7060('0x7')](_0x7060('0xa'),auth[_0x7060('0x8')](),controller[_0x7060('0xb')]);router[_0x7060('0x7')](_0x7060('0xc'),auth[_0x7060('0x8')](),controller['getFields']);router[_0x7060('0x7')](_0x7060('0xd'),auth[_0x7060('0x8')](),controller[_0x7060('0xe')]);router[_0x7060('0x7')](_0x7060('0xf'),auth[_0x7060('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0x7060('0x8')](),controller['create']);router[_0x7060('0x10')](_0x7060('0xa'),auth[_0x7060('0x8')](),controller[_0x7060('0x11')]);router[_0x7060('0x12')](_0x7060('0xa'),auth[_0x7060('0x8')](),controller['destroy']);module[_0x7060('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 59dbec6..d6508c7 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 _0x1aac=['STRING','sequelize','exports'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x1aac,0x172));var _0xc1aa=function(_0x21ded6,_0x1c199b){_0x21ded6=_0x21ded6-0x0;var _0x540ec0=_0x1aac[_0x21ded6];return _0x540ec0;};'use strict';var Sequelize=require(_0xc1aa('0x0'));module[_0xc1aa('0x1')]={'name':{'type':Sequelize[_0xc1aa('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x138b=['STRING','sequelize'];(function(_0x4f8a14,_0x41bb12){var _0x1627d7=function(_0x357866){while(--_0x357866){_0x4f8a14['push'](_0x4f8a14['shift']());}};_0x1627d7(++_0x41bb12);}(_0x138b,0x65));var _0xb138=function(_0xa16fa5,_0x39ed8a){_0xa16fa5=_0xa16fa5-0x0;var _0x44e544=_0x138b[_0xa16fa5];return _0x44e544;};'use strict';var Sequelize=require(_0xb138('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb138('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 37e7ab0..e0b6603 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 _0xbcbd=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','SugarcrmConfiguration','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','nolimit','order','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','length','includeAll','find','create','body','getFields','findOne','SugarcrmField','sort','pick','getSubjects','hasOwnProperty','getDescriptions','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis'];(function(_0x122ef5,_0x50ff12){var _0x22e5de=function(_0x5292f1){while(--_0x5292f1){_0x122ef5['push'](_0x122ef5['shift']());}};_0x22e5de(++_0x50ff12);}(_0xbcbd,0x1dd));var _0xdbcb=function(_0x3d0e15,_0xdb46ae){_0x3d0e15=_0x3d0e15-0x0;var _0x4723bc=_0xbcbd[_0x3d0e15];return _0x4723bc;};'use strict';var emlformat=require(_0xdbcb('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xdbcb('0x1'));var rp=require(_0xdbcb('0x2'));var moment=require('moment');var BPromise=require(_0xdbcb('0x3'));var Mustache=require(_0xdbcb('0x4'));var util=require(_0xdbcb('0x5'));var path=require(_0xdbcb('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdbcb('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdbcb('0x8'));var squel=require(_0xdbcb('0x9'));var crypto=require(_0xdbcb('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xdbcb('0xb'));var toCsv=require(_0xdbcb('0xc'));var querystring=require('querystring');var Papa=require(_0xdbcb('0xd'));var Redis=require(_0xdbcb('0xe'));var authService=require(_0xdbcb('0xf'));var qs=require(_0xdbcb('0x10'));var as=require(_0xdbcb('0x11'));var hardwareService=require(_0xdbcb('0x12'));var logger=require(_0xdbcb('0x13'))(_0xdbcb('0x14'));var utils=require(_0xdbcb('0x15'));var config=require(_0xdbcb('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xdbcb('0x17'))['db'];function respondWithStatusCode(_0xa435df,_0x26ba3e){_0x26ba3e=_0x26ba3e||0xcc;return function(_0x389a59){if(_0x389a59){return _0xa435df['sendStatus'](_0x26ba3e);}return _0xa435df[_0xdbcb('0x18')](_0x26ba3e)[_0xdbcb('0x19')]();};}function respondWithResult(_0x4c2d76,_0x552ba5){_0x552ba5=_0x552ba5||0xc8;return function(_0x47fffa){if(_0x47fffa){return _0x4c2d76[_0xdbcb('0x18')](_0x552ba5)[_0xdbcb('0x1a')](_0x47fffa);}};}function respondWithFilteredResult(_0x12be3e,_0xc00a29){return function(_0x2f9fa9){if(_0x2f9fa9){var _0x29d8fb=typeof _0xc00a29[_0xdbcb('0x1b')]===_0xdbcb('0x1c')&&typeof _0xc00a29[_0xdbcb('0x1d')]==='undefined';var _0x1bd0fd=_0x2f9fa9['count'];var _0x3a90fe=_0x29d8fb?0x0:_0xc00a29['offset'];var _0xa05b07=_0x29d8fb?_0x2f9fa9[_0xdbcb('0x1e')]:_0xc00a29['offset']+_0xc00a29[_0xdbcb('0x1d')];var _0x17472c;if(_0xa05b07>=_0x1bd0fd){_0xa05b07=_0x1bd0fd;_0x17472c=0xc8;}else{_0x17472c=0xce;}_0x12be3e[_0xdbcb('0x18')](_0x17472c);return _0x12be3e[_0xdbcb('0x1f')](_0xdbcb('0x20'),_0x3a90fe+'-'+_0xa05b07+'/'+_0x1bd0fd)[_0xdbcb('0x1a')](_0x2f9fa9);}return null;};}function patchUpdates(_0x38e813){return function(_0x4cb460){try{jsonpatch[_0xdbcb('0x21')](_0x4cb460,_0x38e813,!![]);}catch(_0x3cf7ac){return BPromise['reject'](_0x3cf7ac);}return _0x4cb460[_0xdbcb('0x22')]();};}function saveUpdates(_0x5ba6ce,_0x4e1c99){return function(_0x4b7762){if(_0x4b7762){return _0x4b7762[_0xdbcb('0x23')](_0x5ba6ce)['then'](function(_0x1ab35d){return _0x1ab35d;});}return null;};}function removeEntity(_0x3c6e0c,_0x3c5913){return function(_0x16f257){if(_0x16f257){return _0x16f257[_0xdbcb('0x24')]()[_0xdbcb('0x25')](function(){_0x3c6e0c[_0xdbcb('0x18')](0xcc)[_0xdbcb('0x19')]();});}};}function handleEntityNotFound(_0x5b42ab,_0x3ea3bc){return function(_0x5742c0){if(!_0x5742c0){_0x5b42ab[_0xdbcb('0x26')](0x194);}return _0x5742c0;};}function handleError(_0x31c7b5,_0x2a8b7e){_0x2a8b7e=_0x2a8b7e||0x1f4;return function(_0x846c95){logger[_0xdbcb('0x27')](_0x846c95[_0xdbcb('0x28')]);if(_0x846c95[_0xdbcb('0x29')]){delete _0x846c95[_0xdbcb('0x29')];}_0x31c7b5[_0xdbcb('0x18')](_0x2a8b7e)[_0xdbcb('0x2a')](_0x846c95);};}exports[_0xdbcb('0x2b')]=function(_0x5d9a60,_0x4641b6){var _0x2f71f2={},_0xa449e1={},_0x41fe52={'count':0x0,'rows':[]};var _0x41f62e=_[_0xdbcb('0x2c')](db[_0xdbcb('0x2d')][_0xdbcb('0x2e')],function(_0x5230a1){return{'name':_0x5230a1['fieldName'],'type':_0x5230a1[_0xdbcb('0x2f')][_0xdbcb('0x30')]};});_0xa449e1[_0xdbcb('0x31')]=_[_0xdbcb('0x2c')](_0x41f62e,_0xdbcb('0x29'));_0xa449e1[_0xdbcb('0x32')]=_['keys'](_0x5d9a60[_0xdbcb('0x32')]);_0xa449e1[_0xdbcb('0x33')]=_[_0xdbcb('0x34')](_0xa449e1[_0xdbcb('0x31')],_0xa449e1[_0xdbcb('0x32')]);_0x2f71f2[_0xdbcb('0x35')]=_[_0xdbcb('0x34')](_0xa449e1[_0xdbcb('0x31')],qs[_0xdbcb('0x36')](_0x5d9a60[_0xdbcb('0x32')][_0xdbcb('0x36')]));_0x2f71f2[_0xdbcb('0x35')]=_0x2f71f2[_0xdbcb('0x35')]['length']?_0x2f71f2[_0xdbcb('0x35')]:_0xa449e1['model'];if(!_0x5d9a60[_0xdbcb('0x32')]['hasOwnProperty'](_0xdbcb('0x37'))){_0x2f71f2[_0xdbcb('0x1d')]=qs[_0xdbcb('0x1d')](_0x5d9a60['query']['limit']);_0x2f71f2[_0xdbcb('0x1b')]=qs[_0xdbcb('0x1b')](_0x5d9a60['query']['offset']);}_0x2f71f2[_0xdbcb('0x38')]=qs['sort'](_0x5d9a60[_0xdbcb('0x32')]['sort']);_0x2f71f2[_0xdbcb('0x39')]=qs['filters'](_['pick'](_0x5d9a60['query'],_0xa449e1['filters']),_0x41f62e);if(_0x5d9a60[_0xdbcb('0x32')][_0xdbcb('0x3a')]){_0x2f71f2[_0xdbcb('0x39')]=_[_0xdbcb('0x3b')](_0x2f71f2[_0xdbcb('0x39')],{'$or':_[_0xdbcb('0x2c')](_0x41f62e,function(_0x212601){if(_0x212601[_0xdbcb('0x2f')]!==_0xdbcb('0x3c')){var _0x3eee02={};_0x3eee02[_0x212601[_0xdbcb('0x29')]]={'$like':'%'+_0x5d9a60[_0xdbcb('0x32')]['filter']+'%'};return _0x3eee02;}})});}_0x2f71f2=_[_0xdbcb('0x3b')]({},_0x2f71f2,_0x5d9a60[_0xdbcb('0x3d')]);var _0x264646={'where':_0x2f71f2[_0xdbcb('0x39')]};return db[_0xdbcb('0x2d')][_0xdbcb('0x1e')](_0x264646)[_0xdbcb('0x25')](function(_0x121490){_0x41fe52[_0xdbcb('0x1e')]=_0x121490;if(_0x5d9a60[_0xdbcb('0x32')]['includeAll']){_0x2f71f2[_0xdbcb('0x3e')]=[{'all':!![]}];}return db[_0xdbcb('0x2d')][_0xdbcb('0x3f')](_0x2f71f2);})[_0xdbcb('0x25')](function(_0x4de8b7){_0x41fe52[_0xdbcb('0x40')]=_0x4de8b7;return _0x41fe52;})['then'](respondWithFilteredResult(_0x4641b6,_0x2f71f2))[_0xdbcb('0x41')](handleError(_0x4641b6,null));};exports[_0xdbcb('0x42')]=function(_0x24f900,_0x55c3b6){var _0x44ba46={'raw':![],'where':{'id':_0x24f900[_0xdbcb('0x43')]['id']}},_0x23d1ba={};_0x23d1ba[_0xdbcb('0x31')]=_['keys'](db['SugarcrmConfiguration'][_0xdbcb('0x2e')]);_0x23d1ba[_0xdbcb('0x32')]=_[_0xdbcb('0x44')](_0x24f900[_0xdbcb('0x32')]);_0x23d1ba[_0xdbcb('0x33')]=_[_0xdbcb('0x34')](_0x23d1ba['model'],_0x23d1ba['query']);_0x44ba46[_0xdbcb('0x35')]=_[_0xdbcb('0x34')](_0x23d1ba['model'],qs[_0xdbcb('0x36')](_0x24f900[_0xdbcb('0x32')][_0xdbcb('0x36')]));_0x44ba46[_0xdbcb('0x35')]=_0x44ba46[_0xdbcb('0x35')][_0xdbcb('0x45')]?_0x44ba46[_0xdbcb('0x35')]:_0x23d1ba['model'];if(_0x24f900[_0xdbcb('0x32')][_0xdbcb('0x46')]){_0x44ba46[_0xdbcb('0x3e')]=[{'all':!![]}];}_0x44ba46=_['merge']({},_0x44ba46,_0x24f900['options']);return db['SugarcrmConfiguration'][_0xdbcb('0x47')](_0x44ba46)['then'](handleEntityNotFound(_0x55c3b6,null))[_0xdbcb('0x25')](respondWithResult(_0x55c3b6,null))[_0xdbcb('0x41')](handleError(_0x55c3b6,null));};exports[_0xdbcb('0x48')]=function(_0x1ea0b9,_0x3971ba){return db[_0xdbcb('0x2d')][_0xdbcb('0x48')](_0x1ea0b9['body'],{})[_0xdbcb('0x25')](respondWithResult(_0x3971ba,0xc9))['catch'](handleError(_0x3971ba,null));};exports[_0xdbcb('0x23')]=function(_0xa35bc8,_0x552216){if(_0xa35bc8[_0xdbcb('0x49')]['id']){delete _0xa35bc8['body']['id'];}return db[_0xdbcb('0x2d')][_0xdbcb('0x47')]({'where':{'id':_0xa35bc8[_0xdbcb('0x43')]['id']}})['then'](handleEntityNotFound(_0x552216,null))['then'](saveUpdates(_0xa35bc8[_0xdbcb('0x49')],null))['then'](respondWithResult(_0x552216,null))[_0xdbcb('0x41')](handleError(_0x552216,null));};exports['destroy']=function(_0x23b696,_0x4e8ce8){return db[_0xdbcb('0x2d')]['find']({'where':{'id':_0x23b696[_0xdbcb('0x43')]['id']}})[_0xdbcb('0x25')](handleEntityNotFound(_0x4e8ce8,null))[_0xdbcb('0x25')](removeEntity(_0x4e8ce8,null))['catch'](handleError(_0x4e8ce8,null));};exports[_0xdbcb('0x4a')]=function(_0x5bd4fb,_0x2373cf,_0x9fe75c){var _0x4e8a86={};var _0x1c4407={};var _0x17daac;var _0x3a8d74;return db['SugarcrmConfiguration'][_0xdbcb('0x4b')]({'where':{'id':_0x5bd4fb[_0xdbcb('0x43')]['id']}})[_0xdbcb('0x25')](handleEntityNotFound(_0x2373cf,null))[_0xdbcb('0x25')](function(_0x57803b){if(_0x57803b){_0x17daac=_0x57803b;_0x1c4407['model']=_[_0xdbcb('0x44')](db[_0xdbcb('0x4c')][_0xdbcb('0x2e')]);_0x1c4407[_0xdbcb('0x32')]=_[_0xdbcb('0x44')](_0x5bd4fb[_0xdbcb('0x32')]);_0x1c4407[_0xdbcb('0x33')]=_['intersection'](_0x1c4407[_0xdbcb('0x31')],_0x1c4407[_0xdbcb('0x32')]);_0x4e8a86['attributes']=_[_0xdbcb('0x34')](_0x1c4407[_0xdbcb('0x31')],qs[_0xdbcb('0x36')](_0x5bd4fb['query']['fields']));_0x4e8a86[_0xdbcb('0x35')]=_0x4e8a86[_0xdbcb('0x35')][_0xdbcb('0x45')]?_0x4e8a86[_0xdbcb('0x35')]:_0x1c4407[_0xdbcb('0x31')];_0x4e8a86[_0xdbcb('0x38')]=qs[_0xdbcb('0x4d')](_0x5bd4fb[_0xdbcb('0x32')][_0xdbcb('0x4d')]);_0x4e8a86[_0xdbcb('0x39')]=qs['filters'](_[_0xdbcb('0x4e')](_0x5bd4fb[_0xdbcb('0x32')],_0x1c4407[_0xdbcb('0x33')]));if(_0x5bd4fb[_0xdbcb('0x32')][_0xdbcb('0x3a')]){_0x4e8a86[_0xdbcb('0x39')]=_[_0xdbcb('0x3b')](_0x4e8a86[_0xdbcb('0x39')],{'$or':_[_0xdbcb('0x2c')](_0x4e8a86[_0xdbcb('0x35')],function(_0x671b2c){var _0x42bb3b={};_0x42bb3b[_0x671b2c]={'$like':'%'+_0x5bd4fb[_0xdbcb('0x32')][_0xdbcb('0x3a')]+'%'};return _0x42bb3b;})});}_0x4e8a86=_['merge']({},_0x4e8a86,_0x5bd4fb[_0xdbcb('0x3d')]);return _0x17daac[_0xdbcb('0x4a')](_0x4e8a86);}})['then'](function(_0x1f7844){if(_0x1f7844){_0x3a8d74=_0x1f7844[_0xdbcb('0x45')];if(!_0x5bd4fb[_0xdbcb('0x32')]['hasOwnProperty']('nolimit')){_0x4e8a86[_0xdbcb('0x1d')]=qs[_0xdbcb('0x1d')](_0x5bd4fb[_0xdbcb('0x32')][_0xdbcb('0x1d')]);_0x4e8a86[_0xdbcb('0x1b')]=qs['offset'](_0x5bd4fb[_0xdbcb('0x32')]['offset']);}return _0x17daac['getFields'](_0x4e8a86);}})['then'](function(_0x313872){if(_0x313872){return _0x313872?{'count':_0x3a8d74,'rows':_0x313872}:null;}})[_0xdbcb('0x25')](respondWithResult(_0x2373cf,null))['catch'](handleError(_0x2373cf,null));};exports[_0xdbcb('0x4f')]=function(_0x2589a4,_0x44e6a9,_0x40f630){var _0x29850d={};var _0x2f391b={};var _0x3d11dc;var _0x36125b;return db[_0xdbcb('0x2d')]['findOne']({'where':{'id':_0x2589a4[_0xdbcb('0x43')]['id']}})[_0xdbcb('0x25')](handleEntityNotFound(_0x44e6a9,null))[_0xdbcb('0x25')](function(_0x2d95ed){if(_0x2d95ed){_0x3d11dc=_0x2d95ed;_0x2f391b[_0xdbcb('0x31')]=_[_0xdbcb('0x44')](db[_0xdbcb('0x4c')][_0xdbcb('0x2e')]);_0x2f391b[_0xdbcb('0x32')]=_['keys'](_0x2589a4[_0xdbcb('0x32')]);_0x2f391b[_0xdbcb('0x33')]=_[_0xdbcb('0x34')](_0x2f391b[_0xdbcb('0x31')],_0x2f391b[_0xdbcb('0x32')]);_0x29850d[_0xdbcb('0x35')]=_[_0xdbcb('0x34')](_0x2f391b[_0xdbcb('0x31')],qs[_0xdbcb('0x36')](_0x2589a4[_0xdbcb('0x32')][_0xdbcb('0x36')]));_0x29850d[_0xdbcb('0x35')]=_0x29850d[_0xdbcb('0x35')][_0xdbcb('0x45')]?_0x29850d['attributes']:_0x2f391b[_0xdbcb('0x31')];_0x29850d['order']=qs[_0xdbcb('0x4d')](_0x2589a4[_0xdbcb('0x32')]['sort']);_0x29850d[_0xdbcb('0x39')]=qs[_0xdbcb('0x33')](_['pick'](_0x2589a4[_0xdbcb('0x32')],_0x2f391b[_0xdbcb('0x33')]));if(_0x2589a4[_0xdbcb('0x32')][_0xdbcb('0x3a')]){_0x29850d[_0xdbcb('0x39')]=_[_0xdbcb('0x3b')](_0x29850d[_0xdbcb('0x39')],{'$or':_[_0xdbcb('0x2c')](_0x29850d[_0xdbcb('0x35')],function(_0x86985a){var _0x532520={};_0x532520[_0x86985a]={'$like':'%'+_0x2589a4['query']['filter']+'%'};return _0x532520;})});}_0x29850d=_[_0xdbcb('0x3b')]({},_0x29850d,_0x2589a4[_0xdbcb('0x3d')]);return _0x3d11dc['getSubjects'](_0x29850d);}})[_0xdbcb('0x25')](function(_0x226900){if(_0x226900){_0x36125b=_0x226900['length'];if(!_0x2589a4['query'][_0xdbcb('0x50')](_0xdbcb('0x37'))){_0x29850d[_0xdbcb('0x1d')]=qs[_0xdbcb('0x1d')](_0x2589a4[_0xdbcb('0x32')][_0xdbcb('0x1d')]);_0x29850d[_0xdbcb('0x1b')]=qs['offset'](_0x2589a4['query'][_0xdbcb('0x1b')]);}return _0x3d11dc[_0xdbcb('0x4f')](_0x29850d);}})[_0xdbcb('0x25')](function(_0x27e36e){if(_0x27e36e){return _0x27e36e?{'count':_0x36125b,'rows':_0x27e36e}:null;}})[_0xdbcb('0x25')](respondWithResult(_0x44e6a9,null))[_0xdbcb('0x41')](handleError(_0x44e6a9,null));};exports[_0xdbcb('0x51')]=function(_0x442a04,_0x31b8b3,_0x4de25a){var _0x3ccf47={};var _0x29dcc9={};var _0x15931c;var _0x489712;return db[_0xdbcb('0x2d')]['findOne']({'where':{'id':_0x442a04[_0xdbcb('0x43')]['id']}})[_0xdbcb('0x25')](handleEntityNotFound(_0x31b8b3,null))[_0xdbcb('0x25')](function(_0x2e0e5c){if(_0x2e0e5c){_0x15931c=_0x2e0e5c;_0x29dcc9[_0xdbcb('0x31')]=_[_0xdbcb('0x44')](db[_0xdbcb('0x4c')][_0xdbcb('0x2e')]);_0x29dcc9[_0xdbcb('0x32')]=_[_0xdbcb('0x44')](_0x442a04[_0xdbcb('0x32')]);_0x29dcc9[_0xdbcb('0x33')]=_[_0xdbcb('0x34')](_0x29dcc9[_0xdbcb('0x31')],_0x29dcc9[_0xdbcb('0x32')]);_0x3ccf47[_0xdbcb('0x35')]=_[_0xdbcb('0x34')](_0x29dcc9[_0xdbcb('0x31')],qs['fields'](_0x442a04['query'][_0xdbcb('0x36')]));_0x3ccf47['attributes']=_0x3ccf47['attributes'][_0xdbcb('0x45')]?_0x3ccf47[_0xdbcb('0x35')]:_0x29dcc9['model'];_0x3ccf47[_0xdbcb('0x38')]=qs[_0xdbcb('0x4d')](_0x442a04[_0xdbcb('0x32')][_0xdbcb('0x4d')]);_0x3ccf47[_0xdbcb('0x39')]=qs[_0xdbcb('0x33')](_[_0xdbcb('0x4e')](_0x442a04['query'],_0x29dcc9[_0xdbcb('0x33')]));if(_0x442a04[_0xdbcb('0x32')]['filter']){_0x3ccf47[_0xdbcb('0x39')]=_[_0xdbcb('0x3b')](_0x3ccf47[_0xdbcb('0x39')],{'$or':_['map'](_0x3ccf47[_0xdbcb('0x35')],function(_0x3c4f49){var _0x34d814={};_0x34d814[_0x3c4f49]={'$like':'%'+_0x442a04[_0xdbcb('0x32')]['filter']+'%'};return _0x34d814;})});}_0x3ccf47=_[_0xdbcb('0x3b')]({},_0x3ccf47,_0x442a04[_0xdbcb('0x3d')]);return _0x15931c['getDescriptions'](_0x3ccf47);}})[_0xdbcb('0x25')](function(_0x6e6523){if(_0x6e6523){_0x489712=_0x6e6523[_0xdbcb('0x45')];if(!_0x442a04['query'][_0xdbcb('0x50')]('nolimit')){_0x3ccf47[_0xdbcb('0x1d')]=qs['limit'](_0x442a04[_0xdbcb('0x32')][_0xdbcb('0x1d')]);_0x3ccf47['offset']=qs[_0xdbcb('0x1b')](_0x442a04[_0xdbcb('0x32')][_0xdbcb('0x1b')]);}return _0x15931c[_0xdbcb('0x51')](_0x3ccf47);}})[_0xdbcb('0x25')](function(_0x4d7269){if(_0x4d7269){return _0x4d7269?{'count':_0x489712,'rows':_0x4d7269}:null;}})[_0xdbcb('0x25')](respondWithResult(_0x31b8b3,null))[_0xdbcb('0x41')](handleError(_0x31b8b3,null));}; \ No newline at end of file +var _0x8d2b=['SugarcrmConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','merge','filter','options','include','findAll','rows','catch','show','params','length','create','body','find','getFields','findOne','order','nolimit','getSubjects','SugarcrmField','getDescriptions','eml-format','rimraf','request-promise','mustache','util','sox','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x8d2b,0x10a));var _0xb8d2=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x8d2b[_0x13d07a];return _0x5ee0ee;};'use strict';var emlformat=require(_0xb8d2('0x0'));var rimraf=require(_0xb8d2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb8d2('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb8d2('0x3'));var util=require(_0xb8d2('0x4'));var path=require('path');var sox=require(_0xb8d2('0x5'));var csv=require('to-csv');var ejs=require(_0xb8d2('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb8d2('0x7'));var squel=require(_0xb8d2('0x8'));var crypto=require('crypto');var jsforce=require(_0xb8d2('0x9'));var deskjs=require(_0xb8d2('0xa'));var toCsv=require('to-csv');var querystring=require(_0xb8d2('0xb'));var Papa=require('papaparse');var Redis=require(_0xb8d2('0xc'));var authService=require(_0xb8d2('0xd'));var qs=require(_0xb8d2('0xe'));var as=require(_0xb8d2('0xf'));var hardwareService=require(_0xb8d2('0x10'));var logger=require(_0xb8d2('0x11'))(_0xb8d2('0x12'));var utils=require(_0xb8d2('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xb8d2('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ad3ff,_0x366af2){_0x366af2=_0x366af2||0xcc;return function(_0x18b1be){if(_0x18b1be){return _0x4ad3ff[_0xb8d2('0x15')](_0x366af2);}return _0x4ad3ff[_0xb8d2('0x16')](_0x366af2)[_0xb8d2('0x17')]();};}function respondWithResult(_0x45aef0,_0x307939){_0x307939=_0x307939||0xc8;return function(_0x7899c7){if(_0x7899c7){return _0x45aef0[_0xb8d2('0x16')](_0x307939)[_0xb8d2('0x18')](_0x7899c7);}};}function respondWithFilteredResult(_0x5f4fb0,_0x5cc281){return function(_0x18cc72){if(_0x18cc72){var _0x151130=typeof _0x5cc281[_0xb8d2('0x19')]===_0xb8d2('0x1a')&&typeof _0x5cc281['limit']===_0xb8d2('0x1a');var _0x41e5a5=_0x18cc72[_0xb8d2('0x1b')];var _0x2de715=_0x151130?0x0:_0x5cc281[_0xb8d2('0x19')];var _0x18a9aa=_0x151130?_0x18cc72[_0xb8d2('0x1b')]:_0x5cc281[_0xb8d2('0x19')]+_0x5cc281[_0xb8d2('0x1c')];var _0x4d65a9;if(_0x18a9aa>=_0x41e5a5){_0x18a9aa=_0x41e5a5;_0x4d65a9=0xc8;}else{_0x4d65a9=0xce;}_0x5f4fb0[_0xb8d2('0x16')](_0x4d65a9);return _0x5f4fb0[_0xb8d2('0x1d')](_0xb8d2('0x1e'),_0x2de715+'-'+_0x18a9aa+'/'+_0x41e5a5)['json'](_0x18cc72);}return null;};}function patchUpdates(_0x1fba04){return function(_0x59d44e){try{jsonpatch[_0xb8d2('0x1f')](_0x59d44e,_0x1fba04,!![]);}catch(_0x5cb956){return BPromise[_0xb8d2('0x20')](_0x5cb956);}return _0x59d44e[_0xb8d2('0x21')]();};}function saveUpdates(_0x5dcd31,_0x233600){return function(_0x41e363){if(_0x41e363){return _0x41e363[_0xb8d2('0x22')](_0x5dcd31)[_0xb8d2('0x23')](function(_0x685e8a){return _0x685e8a;});}return null;};}function removeEntity(_0x527be0,_0x27de43){return function(_0x5d4408){if(_0x5d4408){return _0x5d4408[_0xb8d2('0x24')]()['then'](function(){_0x527be0['status'](0xcc)[_0xb8d2('0x17')]();});}};}function handleEntityNotFound(_0x315b64,_0x264bfc){return function(_0x1897c9){if(!_0x1897c9){_0x315b64[_0xb8d2('0x15')](0x194);}return _0x1897c9;};}function handleError(_0x2ca9c4,_0x9b1763){_0x9b1763=_0x9b1763||0x1f4;return function(_0xc22ee8){logger[_0xb8d2('0x25')](_0xc22ee8[_0xb8d2('0x26')]);if(_0xc22ee8[_0xb8d2('0x27')]){delete _0xc22ee8[_0xb8d2('0x27')];}_0x2ca9c4[_0xb8d2('0x16')](_0x9b1763)[_0xb8d2('0x28')](_0xc22ee8);};}exports['index']=function(_0x146cc5,_0x26a061){var _0x3a8343={},_0x4b0ed5={},_0x5ea953={'count':0x0,'rows':[]};var _0x457655=_[_0xb8d2('0x29')](db[_0xb8d2('0x2a')][_0xb8d2('0x2b')],function(_0x3b784e){return{'name':_0x3b784e[_0xb8d2('0x2c')],'type':_0x3b784e[_0xb8d2('0x2d')]['key']};});_0x4b0ed5[_0xb8d2('0x2e')]=_[_0xb8d2('0x29')](_0x457655,_0xb8d2('0x27'));_0x4b0ed5[_0xb8d2('0x2f')]=_[_0xb8d2('0x30')](_0x146cc5[_0xb8d2('0x2f')]);_0x4b0ed5[_0xb8d2('0x31')]=_[_0xb8d2('0x32')](_0x4b0ed5['model'],_0x4b0ed5[_0xb8d2('0x2f')]);_0x3a8343[_0xb8d2('0x33')]=_[_0xb8d2('0x32')](_0x4b0ed5['model'],qs[_0xb8d2('0x34')](_0x146cc5[_0xb8d2('0x2f')][_0xb8d2('0x34')]));_0x3a8343[_0xb8d2('0x33')]=_0x3a8343[_0xb8d2('0x33')]['length']?_0x3a8343[_0xb8d2('0x33')]:_0x4b0ed5[_0xb8d2('0x2e')];if(!_0x146cc5[_0xb8d2('0x2f')][_0xb8d2('0x35')]('nolimit')){_0x3a8343[_0xb8d2('0x1c')]=qs[_0xb8d2('0x1c')](_0x146cc5[_0xb8d2('0x2f')][_0xb8d2('0x1c')]);_0x3a8343[_0xb8d2('0x19')]=qs[_0xb8d2('0x19')](_0x146cc5[_0xb8d2('0x2f')][_0xb8d2('0x19')]);}_0x3a8343['order']=qs['sort'](_0x146cc5[_0xb8d2('0x2f')][_0xb8d2('0x36')]);_0x3a8343[_0xb8d2('0x37')]=qs[_0xb8d2('0x31')](_[_0xb8d2('0x38')](_0x146cc5[_0xb8d2('0x2f')],_0x4b0ed5[_0xb8d2('0x31')]),_0x457655);if(_0x146cc5['query']['filter']){_0x3a8343['where']=_[_0xb8d2('0x39')](_0x3a8343[_0xb8d2('0x37')],{'$or':_[_0xb8d2('0x29')](_0x457655,function(_0x28d317){if(_0x28d317[_0xb8d2('0x2d')]!=='VIRTUAL'){var _0x28113e={};_0x28113e[_0x28d317[_0xb8d2('0x27')]]={'$like':'%'+_0x146cc5['query'][_0xb8d2('0x3a')]+'%'};return _0x28113e;}})});}_0x3a8343=_['merge']({},_0x3a8343,_0x146cc5[_0xb8d2('0x3b')]);var _0x63b77e={'where':_0x3a8343['where']};return db['SugarcrmConfiguration'][_0xb8d2('0x1b')](_0x63b77e)[_0xb8d2('0x23')](function(_0x2b0657){_0x5ea953[_0xb8d2('0x1b')]=_0x2b0657;if(_0x146cc5['query']['includeAll']){_0x3a8343[_0xb8d2('0x3c')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0xb8d2('0x3d')](_0x3a8343);})[_0xb8d2('0x23')](function(_0x2180b6){_0x5ea953[_0xb8d2('0x3e')]=_0x2180b6;return _0x5ea953;})[_0xb8d2('0x23')](respondWithFilteredResult(_0x26a061,_0x3a8343))[_0xb8d2('0x3f')](handleError(_0x26a061,null));};exports[_0xb8d2('0x40')]=function(_0x30836b,_0x92b757){var _0x51f9a0={'raw':![],'where':{'id':_0x30836b[_0xb8d2('0x41')]['id']}},_0x10ecda={};_0x10ecda[_0xb8d2('0x2e')]=_['keys'](db[_0xb8d2('0x2a')][_0xb8d2('0x2b')]);_0x10ecda[_0xb8d2('0x2f')]=_[_0xb8d2('0x30')](_0x30836b[_0xb8d2('0x2f')]);_0x10ecda[_0xb8d2('0x31')]=_[_0xb8d2('0x32')](_0x10ecda[_0xb8d2('0x2e')],_0x10ecda[_0xb8d2('0x2f')]);_0x51f9a0[_0xb8d2('0x33')]=_[_0xb8d2('0x32')](_0x10ecda[_0xb8d2('0x2e')],qs['fields'](_0x30836b[_0xb8d2('0x2f')][_0xb8d2('0x34')]));_0x51f9a0[_0xb8d2('0x33')]=_0x51f9a0[_0xb8d2('0x33')][_0xb8d2('0x42')]?_0x51f9a0[_0xb8d2('0x33')]:_0x10ecda[_0xb8d2('0x2e')];if(_0x30836b[_0xb8d2('0x2f')]['includeAll']){_0x51f9a0[_0xb8d2('0x3c')]=[{'all':!![]}];}_0x51f9a0=_[_0xb8d2('0x39')]({},_0x51f9a0,_0x30836b[_0xb8d2('0x3b')]);return db['SugarcrmConfiguration']['find'](_0x51f9a0)[_0xb8d2('0x23')](handleEntityNotFound(_0x92b757,null))[_0xb8d2('0x23')](respondWithResult(_0x92b757,null))[_0xb8d2('0x3f')](handleError(_0x92b757,null));};exports[_0xb8d2('0x43')]=function(_0x4bc7aa,_0x3fe1ab){return db['SugarcrmConfiguration'][_0xb8d2('0x43')](_0x4bc7aa['body'],{})['then'](respondWithResult(_0x3fe1ab,0xc9))[_0xb8d2('0x3f')](handleError(_0x3fe1ab,null));};exports[_0xb8d2('0x22')]=function(_0x296154,_0x511c46){if(_0x296154[_0xb8d2('0x44')]['id']){delete _0x296154[_0xb8d2('0x44')]['id'];}return db[_0xb8d2('0x2a')][_0xb8d2('0x45')]({'where':{'id':_0x296154[_0xb8d2('0x41')]['id']}})['then'](handleEntityNotFound(_0x511c46,null))[_0xb8d2('0x23')](saveUpdates(_0x296154[_0xb8d2('0x44')],null))[_0xb8d2('0x23')](respondWithResult(_0x511c46,null))[_0xb8d2('0x3f')](handleError(_0x511c46,null));};exports['destroy']=function(_0x597ff5,_0x9f174b){return db['SugarcrmConfiguration'][_0xb8d2('0x45')]({'where':{'id':_0x597ff5[_0xb8d2('0x41')]['id']}})[_0xb8d2('0x23')](handleEntityNotFound(_0x9f174b,null))[_0xb8d2('0x23')](removeEntity(_0x9f174b,null))['catch'](handleError(_0x9f174b,null));};exports[_0xb8d2('0x46')]=function(_0x11a25b,_0x1fe419,_0x3e5e25){var _0x185acb={};var _0x4cf613={};var _0x5024ae;var _0x787be;return db[_0xb8d2('0x2a')][_0xb8d2('0x47')]({'where':{'id':_0x11a25b[_0xb8d2('0x41')]['id']}})['then'](handleEntityNotFound(_0x1fe419,null))[_0xb8d2('0x23')](function(_0x5b0fcd){if(_0x5b0fcd){_0x5024ae=_0x5b0fcd;_0x4cf613['model']=_[_0xb8d2('0x30')](db['SugarcrmField'][_0xb8d2('0x2b')]);_0x4cf613[_0xb8d2('0x2f')]=_[_0xb8d2('0x30')](_0x11a25b[_0xb8d2('0x2f')]);_0x4cf613[_0xb8d2('0x31')]=_[_0xb8d2('0x32')](_0x4cf613[_0xb8d2('0x2e')],_0x4cf613[_0xb8d2('0x2f')]);_0x185acb[_0xb8d2('0x33')]=_[_0xb8d2('0x32')](_0x4cf613['model'],qs[_0xb8d2('0x34')](_0x11a25b['query']['fields']));_0x185acb['attributes']=_0x185acb['attributes'][_0xb8d2('0x42')]?_0x185acb[_0xb8d2('0x33')]:_0x4cf613[_0xb8d2('0x2e')];_0x185acb[_0xb8d2('0x48')]=qs[_0xb8d2('0x36')](_0x11a25b[_0xb8d2('0x2f')]['sort']);_0x185acb[_0xb8d2('0x37')]=qs['filters'](_[_0xb8d2('0x38')](_0x11a25b[_0xb8d2('0x2f')],_0x4cf613[_0xb8d2('0x31')]));if(_0x11a25b[_0xb8d2('0x2f')][_0xb8d2('0x3a')]){_0x185acb['where']=_[_0xb8d2('0x39')](_0x185acb[_0xb8d2('0x37')],{'$or':_[_0xb8d2('0x29')](_0x185acb[_0xb8d2('0x33')],function(_0x5f21b2){var _0x462ca8={};_0x462ca8[_0x5f21b2]={'$like':'%'+_0x11a25b[_0xb8d2('0x2f')][_0xb8d2('0x3a')]+'%'};return _0x462ca8;})});}_0x185acb=_[_0xb8d2('0x39')]({},_0x185acb,_0x11a25b[_0xb8d2('0x3b')]);return _0x5024ae[_0xb8d2('0x46')](_0x185acb);}})[_0xb8d2('0x23')](function(_0x1cac04){if(_0x1cac04){_0x787be=_0x1cac04[_0xb8d2('0x42')];if(!_0x11a25b[_0xb8d2('0x2f')][_0xb8d2('0x35')](_0xb8d2('0x49'))){_0x185acb['limit']=qs[_0xb8d2('0x1c')](_0x11a25b[_0xb8d2('0x2f')][_0xb8d2('0x1c')]);_0x185acb['offset']=qs[_0xb8d2('0x19')](_0x11a25b[_0xb8d2('0x2f')][_0xb8d2('0x19')]);}return _0x5024ae[_0xb8d2('0x46')](_0x185acb);}})[_0xb8d2('0x23')](function(_0x43ff26){if(_0x43ff26){return _0x43ff26?{'count':_0x787be,'rows':_0x43ff26}:null;}})[_0xb8d2('0x23')](respondWithResult(_0x1fe419,null))[_0xb8d2('0x3f')](handleError(_0x1fe419,null));};exports[_0xb8d2('0x4a')]=function(_0x58d6d8,_0x1feb4e,_0x35d9d3){var _0x53d5d1={};var _0xd7dda9={};var _0x4db539;var _0xe8c594;return db[_0xb8d2('0x2a')][_0xb8d2('0x47')]({'where':{'id':_0x58d6d8[_0xb8d2('0x41')]['id']}})['then'](handleEntityNotFound(_0x1feb4e,null))['then'](function(_0xce0aa0){if(_0xce0aa0){_0x4db539=_0xce0aa0;_0xd7dda9['model']=_[_0xb8d2('0x30')](db[_0xb8d2('0x4b')][_0xb8d2('0x2b')]);_0xd7dda9[_0xb8d2('0x2f')]=_[_0xb8d2('0x30')](_0x58d6d8[_0xb8d2('0x2f')]);_0xd7dda9[_0xb8d2('0x31')]=_[_0xb8d2('0x32')](_0xd7dda9[_0xb8d2('0x2e')],_0xd7dda9[_0xb8d2('0x2f')]);_0x53d5d1[_0xb8d2('0x33')]=_[_0xb8d2('0x32')](_0xd7dda9['model'],qs[_0xb8d2('0x34')](_0x58d6d8[_0xb8d2('0x2f')][_0xb8d2('0x34')]));_0x53d5d1['attributes']=_0x53d5d1['attributes'][_0xb8d2('0x42')]?_0x53d5d1[_0xb8d2('0x33')]:_0xd7dda9[_0xb8d2('0x2e')];_0x53d5d1['order']=qs[_0xb8d2('0x36')](_0x58d6d8[_0xb8d2('0x2f')]['sort']);_0x53d5d1[_0xb8d2('0x37')]=qs[_0xb8d2('0x31')](_[_0xb8d2('0x38')](_0x58d6d8[_0xb8d2('0x2f')],_0xd7dda9[_0xb8d2('0x31')]));if(_0x58d6d8[_0xb8d2('0x2f')]['filter']){_0x53d5d1[_0xb8d2('0x37')]=_[_0xb8d2('0x39')](_0x53d5d1[_0xb8d2('0x37')],{'$or':_['map'](_0x53d5d1[_0xb8d2('0x33')],function(_0x4300a9){var _0x911cd4={};_0x911cd4[_0x4300a9]={'$like':'%'+_0x58d6d8['query'][_0xb8d2('0x3a')]+'%'};return _0x911cd4;})});}_0x53d5d1=_['merge']({},_0x53d5d1,_0x58d6d8[_0xb8d2('0x3b')]);return _0x4db539[_0xb8d2('0x4a')](_0x53d5d1);}})[_0xb8d2('0x23')](function(_0xda577d){if(_0xda577d){_0xe8c594=_0xda577d['length'];if(!_0x58d6d8['query'][_0xb8d2('0x35')]('nolimit')){_0x53d5d1['limit']=qs[_0xb8d2('0x1c')](_0x58d6d8['query'][_0xb8d2('0x1c')]);_0x53d5d1['offset']=qs[_0xb8d2('0x19')](_0x58d6d8[_0xb8d2('0x2f')][_0xb8d2('0x19')]);}return _0x4db539[_0xb8d2('0x4a')](_0x53d5d1);}})[_0xb8d2('0x23')](function(_0x121b8a){if(_0x121b8a){return _0x121b8a?{'count':_0xe8c594,'rows':_0x121b8a}:null;}})[_0xb8d2('0x23')](respondWithResult(_0x1feb4e,null))[_0xb8d2('0x3f')](handleError(_0x1feb4e,null));};exports[_0xb8d2('0x4c')]=function(_0x2558ba,_0x4f7497,_0x1b7c54){var _0x52084b={};var _0x42b089={};var _0x192aab;var _0x55d2d1;return db[_0xb8d2('0x2a')][_0xb8d2('0x47')]({'where':{'id':_0x2558ba[_0xb8d2('0x41')]['id']}})[_0xb8d2('0x23')](handleEntityNotFound(_0x4f7497,null))[_0xb8d2('0x23')](function(_0x221cfe){if(_0x221cfe){_0x192aab=_0x221cfe;_0x42b089[_0xb8d2('0x2e')]=_[_0xb8d2('0x30')](db['SugarcrmField'][_0xb8d2('0x2b')]);_0x42b089['query']=_[_0xb8d2('0x30')](_0x2558ba[_0xb8d2('0x2f')]);_0x42b089[_0xb8d2('0x31')]=_['intersection'](_0x42b089[_0xb8d2('0x2e')],_0x42b089['query']);_0x52084b['attributes']=_[_0xb8d2('0x32')](_0x42b089[_0xb8d2('0x2e')],qs[_0xb8d2('0x34')](_0x2558ba['query'][_0xb8d2('0x34')]));_0x52084b[_0xb8d2('0x33')]=_0x52084b[_0xb8d2('0x33')]['length']?_0x52084b['attributes']:_0x42b089['model'];_0x52084b['order']=qs[_0xb8d2('0x36')](_0x2558ba['query'][_0xb8d2('0x36')]);_0x52084b['where']=qs[_0xb8d2('0x31')](_[_0xb8d2('0x38')](_0x2558ba['query'],_0x42b089[_0xb8d2('0x31')]));if(_0x2558ba[_0xb8d2('0x2f')][_0xb8d2('0x3a')]){_0x52084b[_0xb8d2('0x37')]=_[_0xb8d2('0x39')](_0x52084b[_0xb8d2('0x37')],{'$or':_['map'](_0x52084b[_0xb8d2('0x33')],function(_0x1fd1bb){var _0x114750={};_0x114750[_0x1fd1bb]={'$like':'%'+_0x2558ba[_0xb8d2('0x2f')]['filter']+'%'};return _0x114750;})});}_0x52084b=_['merge']({},_0x52084b,_0x2558ba[_0xb8d2('0x3b')]);return _0x192aab[_0xb8d2('0x4c')](_0x52084b);}})[_0xb8d2('0x23')](function(_0x3a3138){if(_0x3a3138){_0x55d2d1=_0x3a3138[_0xb8d2('0x42')];if(!_0x2558ba[_0xb8d2('0x2f')][_0xb8d2('0x35')]('nolimit')){_0x52084b[_0xb8d2('0x1c')]=qs[_0xb8d2('0x1c')](_0x2558ba[_0xb8d2('0x2f')][_0xb8d2('0x1c')]);_0x52084b['offset']=qs[_0xb8d2('0x19')](_0x2558ba['query']['offset']);}return _0x192aab['getDescriptions'](_0x52084b);}})[_0xb8d2('0x23')](function(_0x207ed5){if(_0x207ed5){return _0x207ed5?{'count':_0x55d2d1,'rows':_0x207ed5}:null;}})[_0xb8d2('0x23')](respondWithResult(_0x4f7497,null))[_0xb8d2('0x3f')](handleError(_0x4f7497,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index d262712..88cde34 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 _0x5036=['request-promise','path','../../config/environment','./intSugarcrmConfiguration.attributes','exports','SugarcrmConfiguration','util','../../config/logger','api','moment'];(function(_0x17249c,_0x168d62){var _0x324e7b=function(_0x1b1397){while(--_0x1b1397){_0x17249c['push'](_0x17249c['shift']());}};_0x324e7b(++_0x168d62);}(_0x5036,0x164));var _0x6503=function(_0x27a997,_0x85f149){_0x27a997=_0x27a997-0x0;var _0x5aa288=_0x5036[_0x27a997];return _0x5aa288;};'use strict';var _=require('lodash');var util=require(_0x6503('0x0'));var logger=require(_0x6503('0x1'))(_0x6503('0x2'));var moment=require(_0x6503('0x3'));var BPromise=require('bluebird');var rp=require(_0x6503('0x4'));var fs=require('fs');var path=require(_0x6503('0x5'));var rimraf=require('rimraf');var config=require(_0x6503('0x6'));var attributes=require(_0x6503('0x7'));module[_0x6503('0x8')]=function(_0x5c73d8,_0x144d68){return _0x5c73d8['define'](_0x6503('0x9'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x73fd=['exports','define','int_sugarcrm_configurations','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes'];(function(_0x3a1dec,_0x1f943f){var _0x60ede0=function(_0x285fd5){while(--_0x285fd5){_0x3a1dec['push'](_0x3a1dec['shift']());}};_0x60ede0(++_0x1f943f);}(_0x73fd,0x1dc));var _0xd73f=function(_0x6465b0,_0x45653a){_0x6465b0=_0x6465b0-0x0;var _0x4884fe=_0x73fd[_0x6465b0];return _0x4884fe;};'use strict';var _=require(_0xd73f('0x0'));var util=require(_0xd73f('0x1'));var logger=require(_0xd73f('0x2'))(_0xd73f('0x3'));var moment=require('moment');var BPromise=require(_0xd73f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd73f('0x5'));var config=require(_0xd73f('0x6'));var attributes=require(_0xd73f('0x7'));module[_0xd73f('0x8')]=function(_0x41937e,_0x55a538){return _0x41937e[_0xd73f('0x9')]('SugarcrmConfiguration',attributes,{'tableName':_0xd73f('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 eae063b..d15883a 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 _0xf470=['ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xf470,0xed));var _0x0f47=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xf470[_0x88cd7b];return _0x56fcc8;};'use strict';var _=require(_0x0f47('0x0'));var util=require(_0x0f47('0x1'));var moment=require(_0x0f47('0x2'));var BPromise=require(_0x0f47('0x3'));var rs=require(_0x0f47('0x4'));var fs=require('fs');var Redis=require(_0x0f47('0x5'));var db=require(_0x0f47('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0f47('0x7'))('rpc');var config=require(_0x0f47('0x8'));var jayson=require(_0x0f47('0x9'));var client=jayson[_0x0f47('0xa')][_0x0f47('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3335ce,_0x5901d2,_0x2224a9){return new BPromise(function(_0x2ae596,_0x302ae2){return client[_0x0f47('0xc')](_0x3335ce,_0x2224a9)['then'](function(_0x45ec81){logger[_0x0f47('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x5901d2,_0x0f47('0xe'));logger[_0x0f47('0xf')](_0x0f47('0x10'),_0x5901d2,_0x0f47('0xe'),JSON['stringify'](_0x45ec81));if(_0x45ec81[_0x0f47('0x11')]){if(_0x45ec81[_0x0f47('0x11')][_0x0f47('0x12')]===0x1f4){logger[_0x0f47('0x11')](_0x0f47('0x13'),_0x5901d2,_0x45ec81[_0x0f47('0x11')]['message']);return _0x302ae2(_0x45ec81[_0x0f47('0x11')][_0x0f47('0x14')]);}logger[_0x0f47('0x11')](_0x0f47('0x13'),_0x5901d2,_0x45ec81['error'][_0x0f47('0x14')]);return _0x2ae596(_0x45ec81[_0x0f47('0x11')]['message']);}else{logger[_0x0f47('0xd')](_0x0f47('0x13'),_0x5901d2,_0x0f47('0xe'));_0x2ae596(_0x45ec81[_0x0f47('0x15')][_0x0f47('0x14')]);}})['catch'](function(_0x21eef3){logger[_0x0f47('0x11')](_0x0f47('0x13'),_0x5901d2,_0x21eef3);_0x302ae2(_0x21eef3);});});} \ No newline at end of file +var _0x2a86=['code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','SugarcrmConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x44731a,_0x3417bb){var _0x5541bd=function(_0x26d125){while(--_0x26d125){_0x44731a['push'](_0x44731a['shift']());}};_0x5541bd(++_0x3417bb);}(_0x2a86,0x1b9));var _0x62a8=function(_0x4a15fa,_0x51b92d){_0x4a15fa=_0x4a15fa-0x0;var _0x365444=_0x2a86[_0x4a15fa];return _0x365444;};'use strict';var _=require(_0x62a8('0x0'));var util=require(_0x62a8('0x1'));var moment=require(_0x62a8('0x2'));var BPromise=require(_0x62a8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x62a8('0x4'));var db=require(_0x62a8('0x5'))['db'];var utils=require(_0x62a8('0x6'));var logger=require(_0x62a8('0x7'))(_0x62a8('0x8'));var config=require('../../config/environment');var jayson=require(_0x62a8('0x9'));var client=jayson[_0x62a8('0xa')][_0x62a8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c197a,_0x330eb3,_0x2634b2){return new BPromise(function(_0x5b19e0,_0x781579){return client['request'](_0x1c197a,_0x2634b2)[_0x62a8('0xc')](function(_0x3d188c){logger[_0x62a8('0xd')](_0x62a8('0xe'),_0x330eb3,'request\x20sent');logger[_0x62a8('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x330eb3,_0x62a8('0x10'),JSON[_0x62a8('0x11')](_0x3d188c));if(_0x3d188c[_0x62a8('0x12')]){if(_0x3d188c[_0x62a8('0x12')][_0x62a8('0x13')]===0x1f4){logger['error'](_0x62a8('0xe'),_0x330eb3,_0x3d188c['error'][_0x62a8('0x14')]);return _0x781579(_0x3d188c[_0x62a8('0x12')][_0x62a8('0x14')]);}logger[_0x62a8('0x12')](_0x62a8('0xe'),_0x330eb3,_0x3d188c['error']['message']);return _0x5b19e0(_0x3d188c['error'][_0x62a8('0x14')]);}else{logger[_0x62a8('0xd')](_0x62a8('0xe'),_0x330eb3,_0x62a8('0x10'));_0x5b19e0(_0x3d188c[_0x62a8('0x15')][_0x62a8('0x14')]);}})[_0x62a8('0x16')](function(_0x41adc2){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x330eb3,_0x41adc2);_0x781579(_0x41adc2);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 4a0d3d2..8775fd6 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 _0xa068=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','index','get','/:id','isAuthenticated','post','create','update','delete','destroy','exports','connect-timeout','express','fs-extra'];(function(_0x907702,_0x11cc97){var _0x3974c5=function(_0x1eeb92){while(--_0x1eeb92){_0x907702['push'](_0x907702['shift']());}};_0x3974c5(++_0x11cc97);}(_0xa068,0x140));var _0x8a06=function(_0x25ee1f,_0x1d52b8){_0x25ee1f=_0x25ee1f-0x0;var _0x1b3e0f=_0xa068[_0x25ee1f];return _0x1b3e0f;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x8a06('0x0'));var express=require(_0x8a06('0x1'));var router=express['Router']();var fs_extra=require(_0x8a06('0x2'));var auth=require(_0x8a06('0x3'));var interaction=require(_0x8a06('0x4'));var config=require(_0x8a06('0x5'));var controller=require(_0x8a06('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x8a06('0x7')]);router[_0x8a06('0x8')](_0x8a06('0x9'),auth[_0x8a06('0xa')](),controller['show']);router[_0x8a06('0xb')]('/',auth[_0x8a06('0xa')](),controller[_0x8a06('0xc')]);router['put'](_0x8a06('0x9'),auth['isAuthenticated'](),controller[_0x8a06('0xd')]);router[_0x8a06('0xe')](_0x8a06('0x9'),auth['isAuthenticated'](),controller[_0x8a06('0xf')]);module[_0x8a06('0x10')]=router; \ No newline at end of file +var _0x4625=['connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/:id','show','create','put','delete','exports','multer','util','path'];(function(_0x3b2395,_0x1cf2c1){var _0x2e6751=function(_0x4ea274){while(--_0x4ea274){_0x3b2395['push'](_0x3b2395['shift']());}};_0x2e6751(++_0x1cf2c1);}(_0x4625,0x1b7));var _0x5462=function(_0x338b71,_0x467075){_0x338b71=_0x338b71-0x0;var _0x43636d=_0x4625[_0x338b71];return _0x43636d;};'use strict';var multer=require(_0x5462('0x0'));var util=require(_0x5462('0x1'));var path=require(_0x5462('0x2'));var timeout=require(_0x5462('0x3'));var express=require(_0x5462('0x4'));var router=express[_0x5462('0x5')]();var fs_extra=require(_0x5462('0x6'));var auth=require(_0x5462('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intSugarcrmField.controller');router[_0x5462('0x8')]('/',auth[_0x5462('0x9')](),controller[_0x5462('0xa')]);router[_0x5462('0x8')](_0x5462('0xb'),auth[_0x5462('0x9')](),controller[_0x5462('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5462('0xd')]);router[_0x5462('0xe')](_0x5462('0xb'),auth[_0x5462('0x9')](),controller['update']);router[_0x5462('0xf')](_0x5462('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x5462('0x10')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 1972b3b..68fcee4 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 _0x34d1=['BOOLEAN','exports','ENUM','variable','customVariable','picklist','string','STRING'];(function(_0x2972dc,_0x5e7bdd){var _0x242647=function(_0x57ebdb){while(--_0x57ebdb){_0x2972dc['push'](_0x2972dc['shift']());}};_0x242647(++_0x5e7bdd);}(_0x34d1,0xf9));var _0x134d=function(_0x190897,_0x54af5f){_0x190897=_0x190897-0x0;var _0x5a55a6=_0x34d1[_0x190897];return _0x5a55a6;};'use strict';var Sequelize=require('sequelize');module[_0x134d('0x0')]={'type':{'type':Sequelize[_0x134d('0x1')]('string',_0x134d('0x2'),_0x134d('0x3'),'keyValue',_0x134d('0x4')),'defaultValue':_0x134d('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x134d('0x6')]},'keyType':{'type':Sequelize[_0x134d('0x1')](_0x134d('0x5'),'variable',_0x134d('0x3'))},'keyContent':{'type':Sequelize[_0x134d('0x6')]},'idField':{'type':Sequelize[_0x134d('0x6')]},'nameField':{'type':Sequelize[_0x134d('0x6')]},'customField':{'type':Sequelize[_0x134d('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x134d('0x6')]}}; \ No newline at end of file +var _0x8260=['ENUM','string','variable','keyValue','picklist','STRING','customVariable','BOOLEAN','exports'];(function(_0x147fb8,_0x33299a){var _0x2d8e96=function(_0x4bc50d){while(--_0x4bc50d){_0x147fb8['push'](_0x147fb8['shift']());}};_0x2d8e96(++_0x33299a);}(_0x8260,0x1ca));var _0x0826=function(_0x16e690,_0x5d4683){_0x16e690=_0x16e690-0x0;var _0x3beb56=_0x8260[_0x16e690];return _0x3beb56;};'use strict';var Sequelize=require('sequelize');module[_0x0826('0x0')]={'type':{'type':Sequelize[_0x0826('0x1')](_0x0826('0x2'),_0x0826('0x3'),'customVariable',_0x0826('0x4'),_0x0826('0x5')),'defaultValue':_0x0826('0x2')},'content':{'type':Sequelize[_0x0826('0x6')]},'key':{'type':Sequelize[_0x0826('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0x0826('0x3'),_0x0826('0x7'))},'keyContent':{'type':Sequelize[_0x0826('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x0826('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0826('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index fea74ed..2201a99 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 _0x4f03=['error','stack','name','index','SugarcrmField','rawAttributes','fieldName','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','length','include','create','body','find','zip-dir','fast-json-patch','request-promise','moment','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../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'];(function(_0xee6490,_0x39ad5d){var _0x576ed1=function(_0x311627){while(--_0x311627){_0xee6490['push'](_0xee6490['shift']());}};_0x576ed1(++_0x39ad5d);}(_0x4f03,0x70));var _0x34f0=function(_0x1bd224,_0x4ff3cd){_0x1bd224=_0x1bd224-0x0;var _0x12f4e6=_0x4f03[_0x1bd224];return _0x12f4e6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x34f0('0x0'));var jsonpatch=require(_0x34f0('0x1'));var rp=require(_0x34f0('0x2'));var moment=require(_0x34f0('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x34f0('0x4'));var path=require(_0x34f0('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x34f0('0x6'));var fs=require('fs');var fs_extra=require(_0x34f0('0x7'));var _=require(_0x34f0('0x8'));var squel=require('squel');var crypto=require(_0x34f0('0x9'));var jsforce=require(_0x34f0('0xa'));var deskjs=require(_0x34f0('0xb'));var toCsv=require(_0x34f0('0xc'));var querystring=require('querystring');var Papa=require(_0x34f0('0xd'));var Redis=require(_0x34f0('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x34f0('0xf'));var logger=require(_0x34f0('0x10'))(_0x34f0('0x11'));var utils=require(_0x34f0('0x12'));var config=require(_0x34f0('0x13'));var licenseUtil=require(_0x34f0('0x14'));var db=require(_0x34f0('0x15'))['db'];function respondWithStatusCode(_0x4a99be,_0x52c43a){_0x52c43a=_0x52c43a||0xcc;return function(_0x5115cc){if(_0x5115cc){return _0x4a99be[_0x34f0('0x16')](_0x52c43a);}return _0x4a99be[_0x34f0('0x17')](_0x52c43a)[_0x34f0('0x18')]();};}function respondWithResult(_0x127087,_0x21a3e1){_0x21a3e1=_0x21a3e1||0xc8;return function(_0x57b7f4){if(_0x57b7f4){return _0x127087[_0x34f0('0x17')](_0x21a3e1)[_0x34f0('0x19')](_0x57b7f4);}};}function respondWithFilteredResult(_0x4fa8b2,_0x57c500){return function(_0x29bb56){if(_0x29bb56){var _0x55779b=typeof _0x57c500[_0x34f0('0x1a')]===_0x34f0('0x1b')&&typeof _0x57c500[_0x34f0('0x1c')]===_0x34f0('0x1b');var _0x5b6c7c=_0x29bb56[_0x34f0('0x1d')];var _0x22de97=_0x55779b?0x0:_0x57c500[_0x34f0('0x1a')];var _0x49c569=_0x55779b?_0x29bb56['count']:_0x57c500['offset']+_0x57c500['limit'];var _0x55e8b3;if(_0x49c569>=_0x5b6c7c){_0x49c569=_0x5b6c7c;_0x55e8b3=0xc8;}else{_0x55e8b3=0xce;}_0x4fa8b2['status'](_0x55e8b3);return _0x4fa8b2[_0x34f0('0x1e')](_0x34f0('0x1f'),_0x22de97+'-'+_0x49c569+'/'+_0x5b6c7c)['json'](_0x29bb56);}return null;};}function patchUpdates(_0x26fd40){return function(_0x3f3a8a){try{jsonpatch[_0x34f0('0x20')](_0x3f3a8a,_0x26fd40,!![]);}catch(_0x29c3b0){return BPromise[_0x34f0('0x21')](_0x29c3b0);}return _0x3f3a8a[_0x34f0('0x22')]();};}function saveUpdates(_0x354a80,_0x19bd5c){return function(_0x5179de){if(_0x5179de){return _0x5179de[_0x34f0('0x23')](_0x354a80)[_0x34f0('0x24')](function(_0x5cfdf0){return _0x5cfdf0;});}return null;};}function removeEntity(_0x17eaa5,_0xd95931){return function(_0x1e902b){if(_0x1e902b){return _0x1e902b[_0x34f0('0x25')]()[_0x34f0('0x24')](function(){_0x17eaa5[_0x34f0('0x17')](0xcc)[_0x34f0('0x18')]();});}};}function handleEntityNotFound(_0x22c23d,_0xf2f017){return function(_0x1cdfd2){if(!_0x1cdfd2){_0x22c23d[_0x34f0('0x16')](0x194);}return _0x1cdfd2;};}function handleError(_0x55516f,_0x4c5cf8){_0x4c5cf8=_0x4c5cf8||0x1f4;return function(_0x5eac25){logger[_0x34f0('0x26')](_0x5eac25[_0x34f0('0x27')]);if(_0x5eac25[_0x34f0('0x28')]){delete _0x5eac25[_0x34f0('0x28')];}_0x55516f[_0x34f0('0x17')](_0x4c5cf8)['send'](_0x5eac25);};}exports[_0x34f0('0x29')]=function(_0x280645,_0xfe8977){var _0x559d06={},_0x298066={},_0x4e7def={'count':0x0,'rows':[]};var _0x3e5f5f=_['map'](db[_0x34f0('0x2a')][_0x34f0('0x2b')],function(_0x4b7a37){return{'name':_0x4b7a37[_0x34f0('0x2c')],'type':_0x4b7a37['type']['key']};});_0x298066[_0x34f0('0x2d')]=_[_0x34f0('0x2e')](_0x3e5f5f,_0x34f0('0x28'));_0x298066['query']=_['keys'](_0x280645[_0x34f0('0x2f')]);_0x298066[_0x34f0('0x30')]=_[_0x34f0('0x31')](_0x298066[_0x34f0('0x2d')],_0x298066[_0x34f0('0x2f')]);_0x559d06[_0x34f0('0x32')]=_[_0x34f0('0x31')](_0x298066[_0x34f0('0x2d')],qs[_0x34f0('0x33')](_0x280645[_0x34f0('0x2f')][_0x34f0('0x33')]));_0x559d06[_0x34f0('0x32')]=_0x559d06[_0x34f0('0x32')]['length']?_0x559d06[_0x34f0('0x32')]:_0x298066[_0x34f0('0x2d')];if(!_0x280645[_0x34f0('0x2f')][_0x34f0('0x34')](_0x34f0('0x35'))){_0x559d06[_0x34f0('0x1c')]=qs[_0x34f0('0x1c')](_0x280645['query'][_0x34f0('0x1c')]);_0x559d06[_0x34f0('0x1a')]=qs['offset'](_0x280645[_0x34f0('0x2f')]['offset']);}_0x559d06[_0x34f0('0x36')]=qs[_0x34f0('0x37')](_0x280645['query'][_0x34f0('0x37')]);_0x559d06[_0x34f0('0x38')]=qs['filters'](_[_0x34f0('0x39')](_0x280645[_0x34f0('0x2f')],_0x298066[_0x34f0('0x30')]),_0x3e5f5f);if(_0x280645[_0x34f0('0x2f')][_0x34f0('0x3a')]){_0x559d06[_0x34f0('0x38')]=_[_0x34f0('0x3b')](_0x559d06[_0x34f0('0x38')],{'$or':_['map'](_0x3e5f5f,function(_0x30ee36){if(_0x30ee36[_0x34f0('0x3c')]!==_0x34f0('0x3d')){var _0x59fcdf={};_0x59fcdf[_0x30ee36[_0x34f0('0x28')]]={'$like':'%'+_0x280645[_0x34f0('0x2f')][_0x34f0('0x3a')]+'%'};return _0x59fcdf;}})});}_0x559d06=_[_0x34f0('0x3b')]({},_0x559d06,_0x280645[_0x34f0('0x3e')]);var _0x13f7ea={'where':_0x559d06[_0x34f0('0x38')]};return db['SugarcrmField']['count'](_0x13f7ea)[_0x34f0('0x24')](function(_0x1c4743){_0x4e7def[_0x34f0('0x1d')]=_0x1c4743;if(_0x280645[_0x34f0('0x2f')][_0x34f0('0x3f')]){_0x559d06['include']=[{'all':!![]}];}return db[_0x34f0('0x2a')][_0x34f0('0x40')](_0x559d06);})['then'](function(_0x30346){_0x4e7def[_0x34f0('0x41')]=_0x30346;return _0x4e7def;})['then'](respondWithFilteredResult(_0xfe8977,_0x559d06))[_0x34f0('0x42')](handleError(_0xfe8977,null));};exports[_0x34f0('0x43')]=function(_0x8abbc5,_0x7c5c56){var _0xa88ddf={'raw':!![],'where':{'id':_0x8abbc5[_0x34f0('0x44')]['id']}},_0x4bd48c={};_0x4bd48c[_0x34f0('0x2d')]=_[_0x34f0('0x45')](db[_0x34f0('0x2a')][_0x34f0('0x2b')]);_0x4bd48c[_0x34f0('0x2f')]=_['keys'](_0x8abbc5[_0x34f0('0x2f')]);_0x4bd48c[_0x34f0('0x30')]=_[_0x34f0('0x31')](_0x4bd48c[_0x34f0('0x2d')],_0x4bd48c[_0x34f0('0x2f')]);_0xa88ddf[_0x34f0('0x32')]=_[_0x34f0('0x31')](_0x4bd48c[_0x34f0('0x2d')],qs[_0x34f0('0x33')](_0x8abbc5[_0x34f0('0x2f')][_0x34f0('0x33')]));_0xa88ddf['attributes']=_0xa88ddf[_0x34f0('0x32')][_0x34f0('0x46')]?_0xa88ddf[_0x34f0('0x32')]:_0x4bd48c[_0x34f0('0x2d')];if(_0x8abbc5[_0x34f0('0x2f')][_0x34f0('0x3f')]){_0xa88ddf[_0x34f0('0x47')]=[{'all':!![]}];}_0xa88ddf=_[_0x34f0('0x3b')]({},_0xa88ddf,_0x8abbc5[_0x34f0('0x3e')]);return db[_0x34f0('0x2a')]['find'](_0xa88ddf)['then'](handleEntityNotFound(_0x7c5c56,null))[_0x34f0('0x24')](respondWithResult(_0x7c5c56,null))[_0x34f0('0x42')](handleError(_0x7c5c56,null));};exports['create']=function(_0x448568,_0x294843){return db[_0x34f0('0x2a')][_0x34f0('0x48')](_0x448568['body'],{})['then'](respondWithResult(_0x294843,0xc9))[_0x34f0('0x42')](handleError(_0x294843,null));};exports['update']=function(_0x28f0d8,_0x5942ec){if(_0x28f0d8[_0x34f0('0x49')]['id']){delete _0x28f0d8[_0x34f0('0x49')]['id'];}return db[_0x34f0('0x2a')][_0x34f0('0x4a')]({'where':{'id':_0x28f0d8[_0x34f0('0x44')]['id']}})[_0x34f0('0x24')](handleEntityNotFound(_0x5942ec,null))[_0x34f0('0x24')](saveUpdates(_0x28f0d8[_0x34f0('0x49')],null))[_0x34f0('0x24')](respondWithResult(_0x5942ec,null))[_0x34f0('0x42')](handleError(_0x5942ec,null));};exports[_0x34f0('0x25')]=function(_0x40a9cc,_0x1ab1cf){return db['SugarcrmField'][_0x34f0('0x4a')]({'where':{'id':_0x40a9cc['params']['id']}})['then'](handleEntityNotFound(_0x1ab1cf,null))[_0x34f0('0x24')](removeEntity(_0x1ab1cf,null))[_0x34f0('0x42')](handleError(_0x1ab1cf,null));}; \ No newline at end of file +var _0xc84f=['end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','index','SugarcrmField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','includeAll','rows','catch','show','include','merge','find','create','body','params','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','to-csv','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status'];(function(_0x1346fb,_0x441ea6){var _0x4a5f43=function(_0x5198ec){while(--_0x5198ec){_0x1346fb['push'](_0x1346fb['shift']());}};_0x4a5f43(++_0x441ea6);}(_0xc84f,0x79));var _0xfc84=function(_0x4cfc83,_0x571129){_0x4cfc83=_0x4cfc83-0x0;var _0x63d66d=_0xc84f[_0x4cfc83];return _0x63d66d;};'use strict';var emlformat=require(_0xfc84('0x0'));var rimraf=require(_0xfc84('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfc84('0x2'));var rp=require(_0xfc84('0x3'));var moment=require(_0xfc84('0x4'));var BPromise=require(_0xfc84('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xfc84('0x6'));var sox=require('sox');var csv=require(_0xfc84('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfc84('0x8'));var squel=require('squel');var crypto=require(_0xfc84('0x9'));var jsforce=require(_0xfc84('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xfc84('0x7'));var querystring=require('querystring');var Papa=require(_0xfc84('0xb'));var Redis=require(_0xfc84('0xc'));var authService=require(_0xfc84('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xfc84('0xe'));var hardwareService=require(_0xfc84('0xf'));var logger=require(_0xfc84('0x10'))(_0xfc84('0x11'));var utils=require(_0xfc84('0x12'));var config=require(_0xfc84('0x13'));var licenseUtil=require(_0xfc84('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3bc29f,_0x4acd16){_0x4acd16=_0x4acd16||0xcc;return function(_0x9a7cb5){if(_0x9a7cb5){return _0x3bc29f[_0xfc84('0x15')](_0x4acd16);}return _0x3bc29f[_0xfc84('0x16')](_0x4acd16)[_0xfc84('0x17')]();};}function respondWithResult(_0x366f1c,_0x3942a1){_0x3942a1=_0x3942a1||0xc8;return function(_0x1a43d2){if(_0x1a43d2){return _0x366f1c[_0xfc84('0x16')](_0x3942a1)['json'](_0x1a43d2);}};}function respondWithFilteredResult(_0xf5856f,_0x2b9ce7){return function(_0x475954){if(_0x475954){var _0x4cdff9=typeof _0x2b9ce7['offset']===_0xfc84('0x18')&&typeof _0x2b9ce7['limit']==='undefined';var _0x154779=_0x475954[_0xfc84('0x19')];var _0x40d6d0=_0x4cdff9?0x0:_0x2b9ce7[_0xfc84('0x1a')];var _0x4b5012=_0x4cdff9?_0x475954[_0xfc84('0x19')]:_0x2b9ce7[_0xfc84('0x1a')]+_0x2b9ce7[_0xfc84('0x1b')];var _0x564662;if(_0x4b5012>=_0x154779){_0x4b5012=_0x154779;_0x564662=0xc8;}else{_0x564662=0xce;}_0xf5856f[_0xfc84('0x16')](_0x564662);return _0xf5856f[_0xfc84('0x1c')](_0xfc84('0x1d'),_0x40d6d0+'-'+_0x4b5012+'/'+_0x154779)[_0xfc84('0x1e')](_0x475954);}return null;};}function patchUpdates(_0x58b7c5){return function(_0x1a5f9f){try{jsonpatch[_0xfc84('0x1f')](_0x1a5f9f,_0x58b7c5,!![]);}catch(_0x3db791){return BPromise[_0xfc84('0x20')](_0x3db791);}return _0x1a5f9f[_0xfc84('0x21')]();};}function saveUpdates(_0x320084,_0x15cee2){return function(_0x1b1541){if(_0x1b1541){return _0x1b1541[_0xfc84('0x22')](_0x320084)['then'](function(_0x31251f){return _0x31251f;});}return null;};}function removeEntity(_0x412571,_0xb4e3bd){return function(_0x401332){if(_0x401332){return _0x401332['destroy']()[_0xfc84('0x23')](function(){_0x412571[_0xfc84('0x16')](0xcc)[_0xfc84('0x17')]();});}};}function handleEntityNotFound(_0x10313b,_0x550dfc){return function(_0x4a7d50){if(!_0x4a7d50){_0x10313b[_0xfc84('0x15')](0x194);}return _0x4a7d50;};}function handleError(_0x221a35,_0x3d8a0c){_0x3d8a0c=_0x3d8a0c||0x1f4;return function(_0x393839){logger[_0xfc84('0x24')](_0x393839[_0xfc84('0x25')]);if(_0x393839[_0xfc84('0x26')]){delete _0x393839[_0xfc84('0x26')];}_0x221a35[_0xfc84('0x16')](_0x3d8a0c)['send'](_0x393839);};}exports[_0xfc84('0x27')]=function(_0x50cea1,_0x2efa91){var _0x11f9fc={},_0x2bbb99={},_0x396f31={'count':0x0,'rows':[]};var _0x11c070=_['map'](db[_0xfc84('0x28')][_0xfc84('0x29')],function(_0x350f22){return{'name':_0x350f22[_0xfc84('0x2a')],'type':_0x350f22[_0xfc84('0x2b')][_0xfc84('0x2c')]};});_0x2bbb99[_0xfc84('0x2d')]=_['map'](_0x11c070,_0xfc84('0x26'));_0x2bbb99[_0xfc84('0x2e')]=_[_0xfc84('0x2f')](_0x50cea1[_0xfc84('0x2e')]);_0x2bbb99[_0xfc84('0x30')]=_[_0xfc84('0x31')](_0x2bbb99[_0xfc84('0x2d')],_0x2bbb99[_0xfc84('0x2e')]);_0x11f9fc[_0xfc84('0x32')]=_[_0xfc84('0x31')](_0x2bbb99[_0xfc84('0x2d')],qs[_0xfc84('0x33')](_0x50cea1[_0xfc84('0x2e')]['fields']));_0x11f9fc['attributes']=_0x11f9fc[_0xfc84('0x32')][_0xfc84('0x34')]?_0x11f9fc['attributes']:_0x2bbb99[_0xfc84('0x2d')];if(!_0x50cea1[_0xfc84('0x2e')][_0xfc84('0x35')](_0xfc84('0x36'))){_0x11f9fc[_0xfc84('0x1b')]=qs['limit'](_0x50cea1[_0xfc84('0x2e')][_0xfc84('0x1b')]);_0x11f9fc['offset']=qs[_0xfc84('0x1a')](_0x50cea1['query'][_0xfc84('0x1a')]);}_0x11f9fc[_0xfc84('0x37')]=qs['sort'](_0x50cea1[_0xfc84('0x2e')][_0xfc84('0x38')]);_0x11f9fc[_0xfc84('0x39')]=qs['filters'](_[_0xfc84('0x3a')](_0x50cea1[_0xfc84('0x2e')],_0x2bbb99[_0xfc84('0x30')]),_0x11c070);if(_0x50cea1[_0xfc84('0x2e')][_0xfc84('0x3b')]){_0x11f9fc[_0xfc84('0x39')]=_['merge'](_0x11f9fc['where'],{'$or':_['map'](_0x11c070,function(_0x172c41){if(_0x172c41['type']!=='VIRTUAL'){var _0x4438a7={};_0x4438a7[_0x172c41['name']]={'$like':'%'+_0x50cea1[_0xfc84('0x2e')][_0xfc84('0x3b')]+'%'};return _0x4438a7;}})});}_0x11f9fc=_['merge']({},_0x11f9fc,_0x50cea1[_0xfc84('0x3c')]);var _0x2b5bf4={'where':_0x11f9fc[_0xfc84('0x39')]};return db[_0xfc84('0x28')][_0xfc84('0x19')](_0x2b5bf4)[_0xfc84('0x23')](function(_0xf6a503){_0x396f31[_0xfc84('0x19')]=_0xf6a503;if(_0x50cea1[_0xfc84('0x2e')][_0xfc84('0x3d')]){_0x11f9fc['include']=[{'all':!![]}];}return db['SugarcrmField']['findAll'](_0x11f9fc);})[_0xfc84('0x23')](function(_0x1637ab){_0x396f31[_0xfc84('0x3e')]=_0x1637ab;return _0x396f31;})[_0xfc84('0x23')](respondWithFilteredResult(_0x2efa91,_0x11f9fc))[_0xfc84('0x3f')](handleError(_0x2efa91,null));};exports[_0xfc84('0x40')]=function(_0x476ea0,_0xa25646){var _0x5a16be={'raw':!![],'where':{'id':_0x476ea0['params']['id']}},_0x36063e={};_0x36063e[_0xfc84('0x2d')]=_[_0xfc84('0x2f')](db[_0xfc84('0x28')]['rawAttributes']);_0x36063e[_0xfc84('0x2e')]=_[_0xfc84('0x2f')](_0x476ea0[_0xfc84('0x2e')]);_0x36063e[_0xfc84('0x30')]=_['intersection'](_0x36063e['model'],_0x36063e[_0xfc84('0x2e')]);_0x5a16be[_0xfc84('0x32')]=_[_0xfc84('0x31')](_0x36063e['model'],qs[_0xfc84('0x33')](_0x476ea0[_0xfc84('0x2e')][_0xfc84('0x33')]));_0x5a16be['attributes']=_0x5a16be[_0xfc84('0x32')][_0xfc84('0x34')]?_0x5a16be[_0xfc84('0x32')]:_0x36063e[_0xfc84('0x2d')];if(_0x476ea0[_0xfc84('0x2e')][_0xfc84('0x3d')]){_0x5a16be[_0xfc84('0x41')]=[{'all':!![]}];}_0x5a16be=_[_0xfc84('0x42')]({},_0x5a16be,_0x476ea0[_0xfc84('0x3c')]);return db[_0xfc84('0x28')][_0xfc84('0x43')](_0x5a16be)[_0xfc84('0x23')](handleEntityNotFound(_0xa25646,null))[_0xfc84('0x23')](respondWithResult(_0xa25646,null))[_0xfc84('0x3f')](handleError(_0xa25646,null));};exports[_0xfc84('0x44')]=function(_0x41bc66,_0x546b24){return db['SugarcrmField'][_0xfc84('0x44')](_0x41bc66[_0xfc84('0x45')],{})[_0xfc84('0x23')](respondWithResult(_0x546b24,0xc9))[_0xfc84('0x3f')](handleError(_0x546b24,null));};exports[_0xfc84('0x22')]=function(_0x473d12,_0x350df3){if(_0x473d12[_0xfc84('0x45')]['id']){delete _0x473d12['body']['id'];}return db[_0xfc84('0x28')][_0xfc84('0x43')]({'where':{'id':_0x473d12[_0xfc84('0x46')]['id']}})['then'](handleEntityNotFound(_0x350df3,null))[_0xfc84('0x23')](saveUpdates(_0x473d12['body'],null))[_0xfc84('0x23')](respondWithResult(_0x350df3,null))['catch'](handleError(_0x350df3,null));};exports[_0xfc84('0x47')]=function(_0x38c93f,_0x26c62e){return db[_0xfc84('0x28')][_0xfc84('0x43')]({'where':{'id':_0x38c93f[_0xfc84('0x46')]['id']}})[_0xfc84('0x23')](handleEntityNotFound(_0x26c62e,null))['then'](removeEntity(_0x26c62e,null))['catch'](handleError(_0x26c62e,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 8b7f2e8..d4f17ea 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 _0x4432=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intSugarcrmField.attributes','exports','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util'];(function(_0x54d4a8,_0x585a59){var _0x3b321b=function(_0x245c6a){while(--_0x245c6a){_0x54d4a8['push'](_0x54d4a8['shift']());}};_0x3b321b(++_0x585a59);}(_0x4432,0x9e));var _0x2443=function(_0x546ae1,_0x129298){_0x546ae1=_0x546ae1-0x0;var _0x1533a2=_0x4432[_0x546ae1];return _0x1533a2;};'use strict';var _=require(_0x2443('0x0'));var util=require(_0x2443('0x1'));var logger=require(_0x2443('0x2'))(_0x2443('0x3'));var moment=require(_0x2443('0x4'));var BPromise=require(_0x2443('0x5'));var rp=require(_0x2443('0x6'));var fs=require('fs');var path=require(_0x2443('0x7'));var rimraf=require(_0x2443('0x8'));var config=require('../../config/environment');var attributes=require(_0x2443('0x9'));module[_0x2443('0xa')]=function(_0x59a3e5,_0x4ac87b){return _0x59a3e5['define'](_0x2443('0xb'),attributes,{'tableName':_0x2443('0xc'),'paranoid':![],'indexes':[{'name':_0x2443('0xd'),'fields':[_0x2443('0xe'),_0x2443('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2af4=['FieldId','lodash','../../config/logger','bluebird','path','rimraf','../../config/environment','define','SugarcrmField','sugarcrm_unique_index','idField'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x2af4,0xf3));var _0x42af=function(_0x51bf37,_0x4345b7){_0x51bf37=_0x51bf37-0x0;var _0x153758=_0x2af4[_0x51bf37];return _0x153758;};'use strict';var _=require(_0x42af('0x0'));var util=require('util');var logger=require(_0x42af('0x1'))('api');var moment=require('moment');var BPromise=require(_0x42af('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x42af('0x3'));var rimraf=require(_0x42af('0x4'));var config=require(_0x42af('0x5'));var attributes=require('./intSugarcrmField.attributes');module['exports']=function(_0x981502,_0x296d4c){return _0x981502[_0x42af('0x6')](_0x42af('0x7'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0x42af('0x8'),'fields':[_0x42af('0x9'),_0x42af('0xa')],'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 4674d79..a69a336 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 _0xdccb=['error','message','info','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s'];(function(_0x2c0dc0,_0x19900d){var _0x4c0990=function(_0x530791){while(--_0x530791){_0x2c0dc0['push'](_0x2c0dc0['shift']());}};_0x4c0990(++_0x19900d);}(_0xdccb,0x131));var _0xbdcc=function(_0x5140bd,_0x51e12a){_0x5140bd=_0x5140bd-0x0;var _0x16c907=_0xdccb[_0x5140bd];return _0x16c907;};'use strict';var _=require(_0xbdcc('0x0'));var util=require('util');var moment=require(_0xbdcc('0x1'));var BPromise=require(_0xbdcc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbdcc('0x3'));var db=require(_0xbdcc('0x4'))['db'];var utils=require(_0xbdcc('0x5'));var logger=require('../../config/logger')(_0xbdcc('0x6'));var config=require(_0xbdcc('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xbdcc('0x8')][_0xbdcc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d9a31,_0x4e8178,_0x1138e0){return new BPromise(function(_0x488a42,_0x5ec845){return client['request'](_0x4d9a31,_0x1138e0)[_0xbdcc('0xa')](function(_0x353984){logger['info'](_0xbdcc('0xb'),_0x4e8178,_0xbdcc('0xc'));logger[_0xbdcc('0xd')](_0xbdcc('0xe'),_0x4e8178,_0xbdcc('0xc'),JSON['stringify'](_0x353984));if(_0x353984[_0xbdcc('0xf')]){if(_0x353984[_0xbdcc('0xf')]['code']===0x1f4){logger[_0xbdcc('0xf')](_0xbdcc('0xb'),_0x4e8178,_0x353984[_0xbdcc('0xf')][_0xbdcc('0x10')]);return _0x5ec845(_0x353984[_0xbdcc('0xf')][_0xbdcc('0x10')]);}logger[_0xbdcc('0xf')](_0xbdcc('0xb'),_0x4e8178,_0x353984[_0xbdcc('0xf')][_0xbdcc('0x10')]);return _0x488a42(_0x353984[_0xbdcc('0xf')][_0xbdcc('0x10')]);}else{logger[_0xbdcc('0x11')]('SugarcrmField,\x20%s,\x20%s',_0x4e8178,_0xbdcc('0xc'));_0x488a42(_0x353984[_0xbdcc('0x12')][_0xbdcc('0x10')]);}})[_0xbdcc('0x13')](function(_0x1a8eb0){logger[_0xbdcc('0xf')]('SugarcrmField,\x20%s,\x20%s',_0x4e8178,_0x1a8eb0);_0x5ec845(_0x1a8eb0);});});} \ No newline at end of file +var _0xf9ef=['catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x960205,_0x54f13e){var _0x12135d=function(_0x5518c7){while(--_0x5518c7){_0x960205['push'](_0x960205['shift']());}};_0x12135d(++_0x54f13e);}(_0xf9ef,0x157));var _0xff9e=function(_0x574c32,_0x4a083b){_0x574c32=_0x574c32-0x0;var _0x1ad6c2=_0xf9ef[_0x574c32];return _0x1ad6c2;};'use strict';var _=require(_0xff9e('0x0'));var util=require(_0xff9e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xff9e('0x2'));var db=require(_0xff9e('0x3'))['db'];var utils=require(_0xff9e('0x4'));var logger=require(_0xff9e('0x5'))(_0xff9e('0x6'));var config=require(_0xff9e('0x7'));var jayson=require(_0xff9e('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5cb61f,_0x2859f9,_0x224d9e){return new BPromise(function(_0x59fbc3,_0x54f7c2){return client[_0xff9e('0x9')](_0x5cb61f,_0x224d9e)[_0xff9e('0xa')](function(_0x4c54a8){logger[_0xff9e('0xb')](_0xff9e('0xc'),_0x2859f9,_0xff9e('0xd'));logger[_0xff9e('0xe')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x2859f9,'request\x20sent',JSON['stringify'](_0x4c54a8));if(_0x4c54a8['error']){if(_0x4c54a8[_0xff9e('0xf')][_0xff9e('0x10')]===0x1f4){logger[_0xff9e('0xf')](_0xff9e('0xc'),_0x2859f9,_0x4c54a8[_0xff9e('0xf')]['message']);return _0x54f7c2(_0x4c54a8['error']['message']);}logger[_0xff9e('0xf')]('SugarcrmField,\x20%s,\x20%s',_0x2859f9,_0x4c54a8[_0xff9e('0xf')][_0xff9e('0x11')]);return _0x59fbc3(_0x4c54a8[_0xff9e('0xf')][_0xff9e('0x11')]);}else{logger[_0xff9e('0xb')](_0xff9e('0xc'),_0x2859f9,_0xff9e('0xd'));_0x59fbc3(_0x4c54a8['result'][_0xff9e('0x11')]);}})[_0xff9e('0x12')](function(_0x4162a8){logger[_0xff9e('0xf')]('SugarcrmField,\x20%s,\x20%s',_0x2859f9,_0x4162a8);_0x54f7c2(_0x4162a8);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index e9db8a0..15af6e7 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 _0x3b59=['/:id/fields','getFields','post','create','addConfiguration','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','isAuthenticated','get','/:id','show','getConfigurations'];(function(_0x14bf63,_0xdbd373){var _0x410d22=function(_0x2e5e3a){while(--_0x2e5e3a){_0x14bf63['push'](_0x14bf63['shift']());}};_0x410d22(++_0xdbd373);}(_0x3b59,0xc0));var _0x93b5=function(_0x4be3ec,_0x218441){_0x4be3ec=_0x4be3ec-0x0;var _0x44b79f=_0x3b59[_0x4be3ec];return _0x44b79f;};'use strict';var multer=require(_0x93b5('0x0'));var util=require('util');var path=require(_0x93b5('0x1'));var timeout=require(_0x93b5('0x2'));var express=require(_0x93b5('0x3'));var router=express[_0x93b5('0x4')]();var fs_extra=require(_0x93b5('0x5'));var auth=require(_0x93b5('0x6'));var interaction=require(_0x93b5('0x7'));var config=require(_0x93b5('0x8'));var controller=require(_0x93b5('0x9'));router['get']('/',auth[_0x93b5('0xa')](),controller['index']);router[_0x93b5('0xb')](_0x93b5('0xc'),auth[_0x93b5('0xa')](),controller[_0x93b5('0xd')]);router[_0x93b5('0xb')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x93b5('0xe')]);router[_0x93b5('0xb')](_0x93b5('0xf'),auth[_0x93b5('0xa')](),controller[_0x93b5('0x10')]);router[_0x93b5('0x11')]('/',auth[_0x93b5('0xa')](),controller[_0x93b5('0x12')]);router[_0x93b5('0x11')]('/:id/configurations',auth[_0x93b5('0xa')](),controller[_0x93b5('0x13')]);router['put'](_0x93b5('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x93b5('0x14')](_0x93b5('0xc'),auth[_0x93b5('0xa')](),controller[_0x93b5('0x15')]);module[_0x93b5('0x16')]=router; \ No newline at end of file +var _0x9ca8=['/:id/fields','post','create','addConfiguration','put','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations'];(function(_0x401866,_0x3c1d7b){var _0x80decf=function(_0x1b1364){while(--_0x1b1364){_0x401866['push'](_0x401866['shift']());}};_0x80decf(++_0x3c1d7b);}(_0x9ca8,0x123));var _0x89ca=function(_0x2b8077,_0x453634){_0x2b8077=_0x2b8077-0x0;var _0x308091=_0x9ca8[_0x2b8077];return _0x308091;};'use strict';var multer=require('multer');var util=require(_0x89ca('0x0'));var path=require('path');var timeout=require(_0x89ca('0x1'));var express=require(_0x89ca('0x2'));var router=express[_0x89ca('0x3')]();var fs_extra=require(_0x89ca('0x4'));var auth=require(_0x89ca('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x89ca('0x6'));var controller=require(_0x89ca('0x7'));router[_0x89ca('0x8')]('/',auth[_0x89ca('0x9')](),controller[_0x89ca('0xa')]);router[_0x89ca('0x8')](_0x89ca('0xb'),auth[_0x89ca('0x9')](),controller['show']);router['get'](_0x89ca('0xc'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x89ca('0x8')](_0x89ca('0xd'),auth[_0x89ca('0x9')](),controller['getFields']);router[_0x89ca('0xe')]('/',auth[_0x89ca('0x9')](),controller[_0x89ca('0xf')]);router[_0x89ca('0xe')](_0x89ca('0xc'),auth[_0x89ca('0x9')](),controller[_0x89ca('0x10')]);router[_0x89ca('0x11')](_0x89ca('0xb'),auth[_0x89ca('0x9')](),controller['update']);router['delete'](_0x89ca('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x89ca('0x12')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index d634798..c10fd5a 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 _0xfe81=['HelpDesk','sequelize','exports','STRING'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xfe81,0xd1));var _0x1fe8=function(_0x3cc9d9,_0x69ed38){_0x3cc9d9=_0x3cc9d9-0x0;var _0x1a425d=_0xfe81[_0x3cc9d9];return _0x1a425d;};'use strict';var Sequelize=require(_0x1fe8('0x0'));module[_0x1fe8('0x1')]={'name':{'type':Sequelize[_0x1fe8('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x1fe8('0x2')]},'username':{'type':Sequelize[_0x1fe8('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1fe8('0x3')},'remoteUri':{'type':Sequelize[_0x1fe8('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0x1fe8('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xae45=['sequelize','STRING','HelpDesk'];(function(_0x2de447,_0x864592){var _0x527b48=function(_0x128943){while(--_0x128943){_0x2de447['push'](_0x2de447['shift']());}};_0x527b48(++_0x864592);}(_0xae45,0x129));var _0x5ae4=function(_0x395f9c,_0x1f6aa0){_0x395f9c=_0x395f9c-0x0;var _0x296560=_0xae45[_0x395f9c];return _0x296560;};'use strict';var Sequelize=require(_0x5ae4('0x0'));module['exports']={'name':{'type':Sequelize[_0x5ae4('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x5ae4('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x5ae4('0x1')],'allowNull':![],'defaultValue':_0x5ae4('0x2')},'remoteUri':{'type':Sequelize[_0x5ae4('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x5ae4('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x5ae4('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 3c785ed..71b1da5 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 _0x7c1e=['sendStatus','error','name','index','VtigerAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','map','VIRTUAL','filter','options','includeAll','include','catch','show','params','rawAttributes','find','create','body','destroy','getConfigurations','VtigerConfiguration','findOne','AccountId','channel','VtigerField','Subjects','Descriptions','md5','getFields','description','moduleName','remoteUri','serverUrl','username','slice','substring','lastIndexOf','format','%s/webservice.php','GET','success','login','result','describe','sessionName','reference','owner','includes','remove','editable','label','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','test','Wrong\x20credentials','eml-format','rimraf','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/license/util','status','json','offset','undefined','count','set','apply','reject','save','update','then'];(function(_0x1ec9d8,_0x17d87e){var _0x1509e6=function(_0x1d1be2){while(--_0x1d1be2){_0x1ec9d8['push'](_0x1ec9d8['shift']());}};_0x1509e6(++_0x17d87e);}(_0x7c1e,0x1ab));var _0xe7c1=function(_0x442cf8,_0x5e5aab){_0x442cf8=_0x442cf8-0x0;var _0x24e64e=_0x7c1e[_0x442cf8];return _0x24e64e;};'use strict';var emlformat=require(_0xe7c1('0x0'));var rimraf=require(_0xe7c1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe7c1('0x2'));var moment=require('moment');var BPromise=require(_0xe7c1('0x3'));var Mustache=require(_0xe7c1('0x4'));var util=require(_0xe7c1('0x5'));var path=require('path');var sox=require(_0xe7c1('0x6'));var csv=require(_0xe7c1('0x7'));var ejs=require(_0xe7c1('0x8'));var fs=require('fs');var fs_extra=require(_0xe7c1('0x9'));var _=require(_0xe7c1('0xa'));var squel=require(_0xe7c1('0xb'));var crypto=require(_0xe7c1('0xc'));var jsforce=require(_0xe7c1('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe7c1('0x7'));var querystring=require(_0xe7c1('0xe'));var Papa=require(_0xe7c1('0xf'));var Redis=require(_0xe7c1('0x10'));var authService=require(_0xe7c1('0x11'));var qs=require(_0xe7c1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe7c1('0x13'))(_0xe7c1('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe7c1('0x15'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2c5327,_0x2e5879){_0x2e5879=_0x2e5879||0xcc;return function(_0xe506f5){if(_0xe506f5){return _0x2c5327['sendStatus'](_0x2e5879);}return _0x2c5327[_0xe7c1('0x16')](_0x2e5879)['end']();};}function respondWithResult(_0x2e1964,_0x3f8008){_0x3f8008=_0x3f8008||0xc8;return function(_0x5092e7){if(_0x5092e7){return _0x2e1964[_0xe7c1('0x16')](_0x3f8008)[_0xe7c1('0x17')](_0x5092e7);}};}function respondWithFilteredResult(_0x4cd7a2,_0x15ffce){return function(_0x15f64d){if(_0x15f64d){var _0x996554=typeof _0x15ffce[_0xe7c1('0x18')]===_0xe7c1('0x19')&&typeof _0x15ffce['limit']===_0xe7c1('0x19');var _0x1cef9d=_0x15f64d[_0xe7c1('0x1a')];var _0xc4c49f=_0x996554?0x0:_0x15ffce[_0xe7c1('0x18')];var _0x401ead=_0x996554?_0x15f64d[_0xe7c1('0x1a')]:_0x15ffce[_0xe7c1('0x18')]+_0x15ffce['limit'];var _0x329bca;if(_0x401ead>=_0x1cef9d){_0x401ead=_0x1cef9d;_0x329bca=0xc8;}else{_0x329bca=0xce;}_0x4cd7a2[_0xe7c1('0x16')](_0x329bca);return _0x4cd7a2[_0xe7c1('0x1b')]('Content-Range',_0xc4c49f+'-'+_0x401ead+'/'+_0x1cef9d)[_0xe7c1('0x17')](_0x15f64d);}return null;};}function patchUpdates(_0x178a72){return function(_0x3393b9){try{jsonpatch[_0xe7c1('0x1c')](_0x3393b9,_0x178a72,!![]);}catch(_0x382a2c){return BPromise[_0xe7c1('0x1d')](_0x382a2c);}return _0x3393b9[_0xe7c1('0x1e')]();};}function saveUpdates(_0x34e33b,_0x4af1d6){return function(_0x263ee5){if(_0x263ee5){return _0x263ee5[_0xe7c1('0x1f')](_0x34e33b)[_0xe7c1('0x20')](function(_0x332c1e){return _0x332c1e;});}return null;};}function removeEntity(_0x90178f,_0x14eab5){return function(_0x1a8505){if(_0x1a8505){return _0x1a8505['destroy']()['then'](function(){_0x90178f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x500d9e,_0x599d7a){return function(_0x58aa92){if(!_0x58aa92){_0x500d9e[_0xe7c1('0x21')](0x194);}return _0x58aa92;};}function handleError(_0x433f69,_0xdf4234){_0xdf4234=_0xdf4234||0x1f4;return function(_0x417eb6){logger[_0xe7c1('0x22')](_0x417eb6['stack']);if(_0x417eb6[_0xe7c1('0x23')]){delete _0x417eb6[_0xe7c1('0x23')];}_0x433f69['status'](_0xdf4234)['send'](_0x417eb6);};}exports[_0xe7c1('0x24')]=function(_0x2ef0a7,_0x3ff342){var _0x590618={},_0x33632c={},_0xcfabe0={'count':0x0,'rows':[]};var _0xf67087=_['map'](db[_0xe7c1('0x25')]['rawAttributes'],function(_0x103dd9){return{'name':_0x103dd9[_0xe7c1('0x26')],'type':_0x103dd9[_0xe7c1('0x27')][_0xe7c1('0x28')]};});_0x33632c[_0xe7c1('0x29')]=_['map'](_0xf67087,_0xe7c1('0x23'));_0x33632c[_0xe7c1('0x2a')]=_[_0xe7c1('0x2b')](_0x2ef0a7[_0xe7c1('0x2a')]);_0x33632c[_0xe7c1('0x2c')]=_[_0xe7c1('0x2d')](_0x33632c[_0xe7c1('0x29')],_0x33632c[_0xe7c1('0x2a')]);_0x590618[_0xe7c1('0x2e')]=_[_0xe7c1('0x2d')](_0x33632c[_0xe7c1('0x29')],qs[_0xe7c1('0x2f')](_0x2ef0a7[_0xe7c1('0x2a')][_0xe7c1('0x2f')]));_0x590618[_0xe7c1('0x2e')]=_0x590618[_0xe7c1('0x2e')][_0xe7c1('0x30')]?_0x590618[_0xe7c1('0x2e')]:_0x33632c[_0xe7c1('0x29')];if(!_0x2ef0a7['query'][_0xe7c1('0x31')](_0xe7c1('0x32'))){_0x590618[_0xe7c1('0x33')]=qs['limit'](_0x2ef0a7[_0xe7c1('0x2a')][_0xe7c1('0x33')]);_0x590618[_0xe7c1('0x18')]=qs['offset'](_0x2ef0a7[_0xe7c1('0x2a')]['offset']);}_0x590618[_0xe7c1('0x34')]=qs[_0xe7c1('0x35')](_0x2ef0a7[_0xe7c1('0x2a')][_0xe7c1('0x35')]);_0x590618[_0xe7c1('0x36')]=qs['filters'](_[_0xe7c1('0x37')](_0x2ef0a7[_0xe7c1('0x2a')],_0x33632c[_0xe7c1('0x2c')]),_0xf67087);if(_0x2ef0a7[_0xe7c1('0x2a')]['filter']){_0x590618[_0xe7c1('0x36')]=_[_0xe7c1('0x38')](_0x590618['where'],{'$or':_[_0xe7c1('0x39')](_0xf67087,function(_0x1b9863){if(_0x1b9863['type']!==_0xe7c1('0x3a')){var _0x4a8e01={};_0x4a8e01[_0x1b9863['name']]={'$like':'%'+_0x2ef0a7[_0xe7c1('0x2a')][_0xe7c1('0x3b')]+'%'};return _0x4a8e01;}})});}_0x590618=_[_0xe7c1('0x38')]({},_0x590618,_0x2ef0a7[_0xe7c1('0x3c')]);var _0x3a8ce2={'where':_0x590618[_0xe7c1('0x36')]};return db[_0xe7c1('0x25')][_0xe7c1('0x1a')](_0x3a8ce2)[_0xe7c1('0x20')](function(_0x107c35){_0xcfabe0[_0xe7c1('0x1a')]=_0x107c35;if(_0x2ef0a7[_0xe7c1('0x2a')][_0xe7c1('0x3d')]){_0x590618[_0xe7c1('0x3e')]=[{'all':!![]}];}return db[_0xe7c1('0x25')]['findAll'](_0x590618);})[_0xe7c1('0x20')](function(_0x4fa5e5){_0xcfabe0['rows']=_0x4fa5e5;return _0xcfabe0;})[_0xe7c1('0x20')](respondWithFilteredResult(_0x3ff342,_0x590618))[_0xe7c1('0x3f')](handleError(_0x3ff342,null));};exports[_0xe7c1('0x40')]=function(_0x4b908b,_0x19aa14){var _0x4addbd={'raw':![],'where':{'id':_0x4b908b[_0xe7c1('0x41')]['id']}},_0x29e486={};_0x29e486[_0xe7c1('0x29')]=_[_0xe7c1('0x2b')](db['VtigerAccount'][_0xe7c1('0x42')]);_0x29e486[_0xe7c1('0x2a')]=_[_0xe7c1('0x2b')](_0x4b908b['query']);_0x29e486[_0xe7c1('0x2c')]=_[_0xe7c1('0x2d')](_0x29e486[_0xe7c1('0x29')],_0x29e486[_0xe7c1('0x2a')]);_0x4addbd[_0xe7c1('0x2e')]=_[_0xe7c1('0x2d')](_0x29e486[_0xe7c1('0x29')],qs['fields'](_0x4b908b[_0xe7c1('0x2a')][_0xe7c1('0x2f')]));_0x4addbd[_0xe7c1('0x2e')]=_0x4addbd[_0xe7c1('0x2e')][_0xe7c1('0x30')]?_0x4addbd['attributes']:_0x29e486[_0xe7c1('0x29')];if(_0x4b908b[_0xe7c1('0x2a')][_0xe7c1('0x3d')]){_0x4addbd[_0xe7c1('0x3e')]=[{'all':!![]}];}_0x4addbd=_[_0xe7c1('0x38')]({},_0x4addbd,_0x4b908b[_0xe7c1('0x3c')]);return db['VtigerAccount'][_0xe7c1('0x43')](_0x4addbd)['then'](handleEntityNotFound(_0x19aa14,null))[_0xe7c1('0x20')](respondWithResult(_0x19aa14,null))[_0xe7c1('0x3f')](handleError(_0x19aa14,null));};exports[_0xe7c1('0x44')]=function(_0x4e451a,_0x39166e){return db[_0xe7c1('0x25')]['create'](_0x4e451a[_0xe7c1('0x45')],{})[_0xe7c1('0x20')](respondWithResult(_0x39166e,0xc9))[_0xe7c1('0x3f')](handleError(_0x39166e,null));};exports[_0xe7c1('0x1f')]=function(_0x37c55c,_0x5df8be){if(_0x37c55c[_0xe7c1('0x45')]['id']){delete _0x37c55c['body']['id'];}return db[_0xe7c1('0x25')][_0xe7c1('0x43')]({'where':{'id':_0x37c55c[_0xe7c1('0x41')]['id']}})[_0xe7c1('0x20')](handleEntityNotFound(_0x5df8be,null))['then'](saveUpdates(_0x37c55c['body'],null))[_0xe7c1('0x20')](respondWithResult(_0x5df8be,null))[_0xe7c1('0x3f')](handleError(_0x5df8be,null));};exports[_0xe7c1('0x46')]=function(_0x534361,_0x3cef33){return db[_0xe7c1('0x25')][_0xe7c1('0x43')]({'where':{'id':_0x534361['params']['id']}})[_0xe7c1('0x20')](handleEntityNotFound(_0x3cef33,null))[_0xe7c1('0x20')](removeEntity(_0x3cef33,null))[_0xe7c1('0x3f')](handleError(_0x3cef33,null));};exports[_0xe7c1('0x47')]=function(_0x202e47,_0x5d429c,_0x575482){var _0x2dbd20={};var _0x57eefe={};var _0x5d5252;var _0x55335c;return db[_0xe7c1('0x25')]['findOne']({'where':{'id':_0x202e47[_0xe7c1('0x41')]['id']}})[_0xe7c1('0x20')](handleEntityNotFound(_0x5d429c,null))['then'](function(_0x4f7bed){if(_0x4f7bed){_0x5d5252=_0x4f7bed;_0x57eefe[_0xe7c1('0x29')]=_[_0xe7c1('0x2b')](db[_0xe7c1('0x48')][_0xe7c1('0x42')]);_0x57eefe[_0xe7c1('0x2a')]=_[_0xe7c1('0x2b')](_0x202e47[_0xe7c1('0x2a')]);_0x57eefe[_0xe7c1('0x2c')]=_[_0xe7c1('0x2d')](_0x57eefe['model'],_0x57eefe['query']);_0x2dbd20[_0xe7c1('0x2e')]=_[_0xe7c1('0x2d')](_0x57eefe[_0xe7c1('0x29')],qs['fields'](_0x202e47[_0xe7c1('0x2a')]['fields']));_0x2dbd20[_0xe7c1('0x2e')]=_0x2dbd20[_0xe7c1('0x2e')][_0xe7c1('0x30')]?_0x2dbd20[_0xe7c1('0x2e')]:_0x57eefe[_0xe7c1('0x29')];_0x2dbd20[_0xe7c1('0x34')]=qs['sort'](_0x202e47['query']['sort']);_0x2dbd20['where']=qs[_0xe7c1('0x2c')](_[_0xe7c1('0x37')](_0x202e47['query'],_0x57eefe['filters']));if(_0x202e47['query'][_0xe7c1('0x3b')]){_0x2dbd20[_0xe7c1('0x36')]=_[_0xe7c1('0x38')](_0x2dbd20['where'],{'$or':_['map'](_0x2dbd20[_0xe7c1('0x2e')],function(_0x16f707){var _0x1541e9={};_0x1541e9[_0x16f707]={'$like':'%'+_0x202e47['query']['filter']+'%'};return _0x1541e9;})});}_0x2dbd20=_[_0xe7c1('0x38')]({},_0x2dbd20,_0x202e47[_0xe7c1('0x3c')]);return _0x5d5252[_0xe7c1('0x47')](_0x2dbd20);}})['then'](function(_0x54990a){if(_0x54990a){_0x55335c=_0x54990a[_0xe7c1('0x30')];if(!_0x202e47[_0xe7c1('0x2a')][_0xe7c1('0x31')](_0xe7c1('0x32'))){_0x2dbd20[_0xe7c1('0x33')]=qs[_0xe7c1('0x33')](_0x202e47[_0xe7c1('0x2a')][_0xe7c1('0x33')]);_0x2dbd20[_0xe7c1('0x18')]=qs[_0xe7c1('0x18')](_0x202e47[_0xe7c1('0x2a')][_0xe7c1('0x18')]);}return _0x5d5252[_0xe7c1('0x47')](_0x2dbd20);}})[_0xe7c1('0x20')](function(_0x12b250){if(_0x12b250){return _0x12b250?{'count':_0x55335c,'rows':_0x12b250}:null;}})[_0xe7c1('0x20')](respondWithResult(_0x5d429c,null))['catch'](handleError(_0x5d429c,null));};exports['addConfiguration']=function(_0x387042,_0x5bcbed,_0x53ce74){if(_0x387042['body']['id']){delete _0x387042[_0xe7c1('0x45')]['id'];}return db['VtigerAccount'][_0xe7c1('0x49')]({'where':{'id':_0x387042[_0xe7c1('0x41')]['id']}})['then'](handleEntityNotFound(_0x5bcbed,null))[_0xe7c1('0x20')](function(_0x31771d){if(_0x31771d){_0x387042['body'][_0xe7c1('0x4a')]=_0x31771d['id'];_0x387042[_0xe7c1('0x45')]['Subjects']=integrations['getSubjects'](_0x387042[_0xe7c1('0x45')]['channel'],_0x387042['body']['type']);_0x387042[_0xe7c1('0x45')]['Descriptions']=integrations['getDescriptions'](_0x387042[_0xe7c1('0x45')][_0xe7c1('0x4b')],_0x387042['body']['type']);return db['VtigerConfiguration'][_0xe7c1('0x44')](_0x387042[_0xe7c1('0x45')],{'include':[{'model':db[_0xe7c1('0x4c')],'as':_0xe7c1('0x4d')},{'model':db[_0xe7c1('0x4c')],'as':_0xe7c1('0x4e')}]});}return null;})[_0xe7c1('0x20')](respondWithResult(_0x5bcbed,null))[_0xe7c1('0x3f')](handleError(_0x5bcbed,null));};var md5=require(_0xe7c1('0x4f'));exports[_0xe7c1('0x50')]=function(_0x405b12,_0x8b56d9,_0x446565){var _0x5a1dfd=null;var _0x13cae6=null;var _0x31d5c4=null;var _0x1b7772=null;var _0x4dc51d='';return db['VtigerAccount'][_0xe7c1('0x49')]({'where':{'id':_0x405b12['params']['id']},'attributes':['id',_0xe7c1('0x23'),'username',_0xe7c1('0x51'),_0xe7c1('0x52'),_0xe7c1('0x53'),_0xe7c1('0x54'),'accessKey']})[_0xe7c1('0x20')](handleEntityNotFound(_0x8b56d9,null))['then'](function(_0x555f88){if(_0x555f88){_0x5a1dfd=_0x555f88[_0xe7c1('0x55')];_0x13cae6=_0x555f88['accessKey'];_0x31d5c4=_0x555f88[_0xe7c1('0x52')];_0x4dc51d=_0x555f88[_0xe7c1('0x53')];var _0x17172e=_0x4dc51d[_0xe7c1('0x56')](-0x1);if(_0x17172e==='/'){_0x4dc51d=_0x4dc51d[_0xe7c1('0x57')](0x0,_0x4dc51d[_0xe7c1('0x58')](_0x17172e));}_0x1b7772=util[_0xe7c1('0x59')](_0xe7c1('0x5a'),_0x4dc51d);var _0x9ed77e={'method':_0xe7c1('0x5b'),'uri':_0x1b7772,'qs':{'operation':'getchallenge','username':_0x555f88[_0xe7c1('0x55')]},'json':!![]};return rp(_0x9ed77e);}})[_0xe7c1('0x20')](function(_0x40838a){if(_0x40838a[_0xe7c1('0x5c')]){var _0x30bfca={'method':'POST','uri':_0x1b7772,'form':{'operation':_0xe7c1('0x5d'),'username':_0x5a1dfd,'accessKey':md5(_0x40838a[_0xe7c1('0x5e')]['token']+_0x13cae6)},'json':!![]};return rp(_0x30bfca);}})[_0xe7c1('0x20')](function(_0x3296b3){if(_0x3296b3[_0xe7c1('0x5c')]){var _0x49c625={'method':_0xe7c1('0x5b'),'uri':_0x1b7772,'qs':{'operation':_0xe7c1('0x5f'),'username':_0x5a1dfd,'sessionName':_0x3296b3[_0xe7c1('0x5e')][_0xe7c1('0x60')],'elementType':_0x31d5c4},'json':!![]};return rp(_0x49c625);}})[_0xe7c1('0x20')](function(_0x3d0571){if(_0x3d0571[_0xe7c1('0x5c')]){var _0x331763=['autogenerated',_0xe7c1('0x61'),_0xe7c1('0x62')];_['remove'](_0x3d0571[_0xe7c1('0x5e')][_0xe7c1('0x2f')],function(_0x5199ae){return _0x331763[_0xe7c1('0x63')](_0x5199ae['type'][_0xe7c1('0x23')]);});_[_0xe7c1('0x64')](_0x3d0571['result'][_0xe7c1('0x2f')],function(_0x9b663e){return _0x9b663e[_0xe7c1('0x65')]==='false';});return{'count':_0x3d0571[_0xe7c1('0x5e')][_0xe7c1('0x2f')][_0xe7c1('0x30')],'rows':_[_0xe7c1('0x39')](_0x3d0571[_0xe7c1('0x5e')][_0xe7c1('0x2f')],function(_0x9a53f8){return{'id':_0x9a53f8[_0xe7c1('0x23')],'name':_0x9a53f8[_0xe7c1('0x66')],'custom':_['startsWith'](_0x9a53f8[_0xe7c1('0x23')],_0xe7c1('0x67'))?!![]:![],'options':_0x9a53f8['type'][_0xe7c1('0x23')]===_0xe7c1('0x68')&&_0x9a53f8['type'][_0xe7c1('0x69')][_0xe7c1('0x30')]>0x0?_[_0xe7c1('0x39')](_0x9a53f8['type']['picklistValues'],function(_0x507553){return{'name':_0x507553['label'],'value':_0x507553[_0xe7c1('0x6a')]};}):[]};})};}})[_0xe7c1('0x20')](respondWithResult(_0x8b56d9,null))['catch'](function(_0x22f202){console[_0xe7c1('0x6b')](_0xe7c1('0x6c')+_0x22f202);var _0x4a0518=_0x405b12[_0xe7c1('0x2a')]['test']?0x1f4:_0x22f202[_0xe7c1('0x6d')]||0x1f4;logger[_0xe7c1('0x22')](_0xe7c1('0x6e'),_0xe7c1('0x50'),_0x4a0518,JSON[_0xe7c1('0x6f')](_0x22f202));delete _0x22f202[_0xe7c1('0x23')];if(_0x4a0518===0x191){_0x4a0518=0x190;}_0x8b56d9[_0xe7c1('0x16')](_0x4a0518)[_0xe7c1('0x70')](_0x405b12[_0xe7c1('0x2a')][_0xe7c1('0x71')]?{'message':_0xe7c1('0x72'),'statusCode':_0x22f202[_0xe7c1('0x6d')]}:_0x22f202);});}; \ No newline at end of file +var _0xd7d5=['Content-Range','apply','reject','then','destroy','error','stack','name','map','VtigerAccount','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','rawAttributes','length','find','catch','create','body','update','getConfigurations','findOne','VtigerConfiguration','order','nolimit','addConfiguration','Subjects','channel','Descriptions','VtigerField','md5','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','lastIndexOf','%s/webservice.php','GET','getchallenge','success','POST','login','result','token','describe','autogenerated','owner','remove','includes','editable','false','label','startsWith','cf_','picklist','value','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','test','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count'];(function(_0x373afe,_0x4841f3){var _0x4decea=function(_0x441ed5){while(--_0x441ed5){_0x373afe['push'](_0x373afe['shift']());}};_0x4decea(++_0x4841f3);}(_0xd7d5,0xd0));var _0x5d7d=function(_0x2c1e97,_0x219c89){_0x2c1e97=_0x2c1e97-0x0;var _0x5ce32e=_0xd7d5[_0x2c1e97];return _0x5ce32e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5d7d('0x0'));var jsonpatch=require(_0x5d7d('0x1'));var rp=require(_0x5d7d('0x2'));var moment=require(_0x5d7d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5d7d('0x4'));var util=require('util');var path=require('path');var sox=require(_0x5d7d('0x5'));var csv=require(_0x5d7d('0x6'));var ejs=require(_0x5d7d('0x7'));var fs=require('fs');var fs_extra=require(_0x5d7d('0x8'));var _=require(_0x5d7d('0x9'));var squel=require(_0x5d7d('0xa'));var crypto=require(_0x5d7d('0xb'));var jsforce=require(_0x5d7d('0xc'));var deskjs=require(_0x5d7d('0xd'));var toCsv=require(_0x5d7d('0x6'));var querystring=require(_0x5d7d('0xe'));var Papa=require(_0x5d7d('0xf'));var Redis=require(_0x5d7d('0x10'));var authService=require(_0x5d7d('0x11'));var qs=require(_0x5d7d('0x12'));var as=require(_0x5d7d('0x13'));var hardwareService=require(_0x5d7d('0x14'));var logger=require(_0x5d7d('0x15'))(_0x5d7d('0x16'));var utils=require(_0x5d7d('0x17'));var config=require(_0x5d7d('0x18'));var licenseUtil=require(_0x5d7d('0x19'));var db=require('../../mysqldb')['db'];var integrations=require(_0x5d7d('0x1a'));function respondWithStatusCode(_0x27984a,_0x3dc629){_0x3dc629=_0x3dc629||0xcc;return function(_0x182cd3){if(_0x182cd3){return _0x27984a[_0x5d7d('0x1b')](_0x3dc629);}return _0x27984a[_0x5d7d('0x1c')](_0x3dc629)[_0x5d7d('0x1d')]();};}function respondWithResult(_0x2bb71d,_0x298789){_0x298789=_0x298789||0xc8;return function(_0x304c1a){if(_0x304c1a){return _0x2bb71d[_0x5d7d('0x1c')](_0x298789)[_0x5d7d('0x1e')](_0x304c1a);}};}function respondWithFilteredResult(_0x5090d9,_0x4a0b11){return function(_0x525a5a){if(_0x525a5a){var _0x2bf3d0=typeof _0x4a0b11[_0x5d7d('0x1f')]===_0x5d7d('0x20')&&typeof _0x4a0b11['limit']===_0x5d7d('0x20');var _0x595b47=_0x525a5a[_0x5d7d('0x21')];var _0x48f5c7=_0x2bf3d0?0x0:_0x4a0b11[_0x5d7d('0x1f')];var _0x3fb18b=_0x2bf3d0?_0x525a5a[_0x5d7d('0x21')]:_0x4a0b11[_0x5d7d('0x1f')]+_0x4a0b11['limit'];var _0x563096;if(_0x3fb18b>=_0x595b47){_0x3fb18b=_0x595b47;_0x563096=0xc8;}else{_0x563096=0xce;}_0x5090d9['status'](_0x563096);return _0x5090d9['set'](_0x5d7d('0x22'),_0x48f5c7+'-'+_0x3fb18b+'/'+_0x595b47)[_0x5d7d('0x1e')](_0x525a5a);}return null;};}function patchUpdates(_0x472616){return function(_0x49dd61){try{jsonpatch[_0x5d7d('0x23')](_0x49dd61,_0x472616,!![]);}catch(_0x8cb9ca){return BPromise[_0x5d7d('0x24')](_0x8cb9ca);}return _0x49dd61['save']();};}function saveUpdates(_0x331d10,_0x4e1c55){return function(_0x4c8157){if(_0x4c8157){return _0x4c8157['update'](_0x331d10)[_0x5d7d('0x25')](function(_0x39a71d){return _0x39a71d;});}return null;};}function removeEntity(_0x2ec537,_0x295e38){return function(_0x5c18c5){if(_0x5c18c5){return _0x5c18c5[_0x5d7d('0x26')]()[_0x5d7d('0x25')](function(){_0x2ec537[_0x5d7d('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43df4c,_0x43b3fb){return function(_0x461d0a){if(!_0x461d0a){_0x43df4c['sendStatus'](0x194);}return _0x461d0a;};}function handleError(_0x4a865b,_0x2df5fd){_0x2df5fd=_0x2df5fd||0x1f4;return function(_0x217c38){logger[_0x5d7d('0x27')](_0x217c38[_0x5d7d('0x28')]);if(_0x217c38[_0x5d7d('0x29')]){delete _0x217c38[_0x5d7d('0x29')];}_0x4a865b[_0x5d7d('0x1c')](_0x2df5fd)['send'](_0x217c38);};}exports['index']=function(_0x59dadf,_0x342559){var _0x376363={},_0x45246b={},_0x35ce66={'count':0x0,'rows':[]};var _0x1c4c2e=_[_0x5d7d('0x2a')](db[_0x5d7d('0x2b')]['rawAttributes'],function(_0x55e143){return{'name':_0x55e143['fieldName'],'type':_0x55e143[_0x5d7d('0x2c')][_0x5d7d('0x2d')]};});_0x45246b[_0x5d7d('0x2e')]=_[_0x5d7d('0x2a')](_0x1c4c2e,'name');_0x45246b[_0x5d7d('0x2f')]=_[_0x5d7d('0x30')](_0x59dadf[_0x5d7d('0x2f')]);_0x45246b[_0x5d7d('0x31')]=_[_0x5d7d('0x32')](_0x45246b[_0x5d7d('0x2e')],_0x45246b['query']);_0x376363[_0x5d7d('0x33')]=_['intersection'](_0x45246b['model'],qs[_0x5d7d('0x34')](_0x59dadf[_0x5d7d('0x2f')]['fields']));_0x376363[_0x5d7d('0x33')]=_0x376363[_0x5d7d('0x33')]['length']?_0x376363['attributes']:_0x45246b[_0x5d7d('0x2e')];if(!_0x59dadf['query'][_0x5d7d('0x35')]('nolimit')){_0x376363[_0x5d7d('0x36')]=qs[_0x5d7d('0x36')](_0x59dadf[_0x5d7d('0x2f')][_0x5d7d('0x36')]);_0x376363[_0x5d7d('0x1f')]=qs[_0x5d7d('0x1f')](_0x59dadf['query'][_0x5d7d('0x1f')]);}_0x376363['order']=qs[_0x5d7d('0x37')](_0x59dadf[_0x5d7d('0x2f')][_0x5d7d('0x37')]);_0x376363[_0x5d7d('0x38')]=qs[_0x5d7d('0x31')](_[_0x5d7d('0x39')](_0x59dadf[_0x5d7d('0x2f')],_0x45246b[_0x5d7d('0x31')]),_0x1c4c2e);if(_0x59dadf['query'][_0x5d7d('0x3a')]){_0x376363[_0x5d7d('0x38')]=_[_0x5d7d('0x3b')](_0x376363[_0x5d7d('0x38')],{'$or':_['map'](_0x1c4c2e,function(_0x32ae05){if(_0x32ae05[_0x5d7d('0x2c')]!==_0x5d7d('0x3c')){var _0x590c24={};_0x590c24[_0x32ae05[_0x5d7d('0x29')]]={'$like':'%'+_0x59dadf[_0x5d7d('0x2f')][_0x5d7d('0x3a')]+'%'};return _0x590c24;}})});}_0x376363=_['merge']({},_0x376363,_0x59dadf[_0x5d7d('0x3d')]);var _0x122d96={'where':_0x376363[_0x5d7d('0x38')]};return db[_0x5d7d('0x2b')][_0x5d7d('0x21')](_0x122d96)['then'](function(_0x1b5760){_0x35ce66[_0x5d7d('0x21')]=_0x1b5760;if(_0x59dadf[_0x5d7d('0x2f')][_0x5d7d('0x3e')]){_0x376363[_0x5d7d('0x3f')]=[{'all':!![]}];}return db[_0x5d7d('0x2b')][_0x5d7d('0x40')](_0x376363);})[_0x5d7d('0x25')](function(_0x2107c7){_0x35ce66[_0x5d7d('0x41')]=_0x2107c7;return _0x35ce66;})[_0x5d7d('0x25')](respondWithFilteredResult(_0x342559,_0x376363))['catch'](handleError(_0x342559,null));};exports['show']=function(_0x4cb9fb,_0x3aaea2){var _0x25c909={'raw':![],'where':{'id':_0x4cb9fb[_0x5d7d('0x42')]['id']}},_0x9a08c8={};_0x9a08c8[_0x5d7d('0x2e')]=_['keys'](db[_0x5d7d('0x2b')][_0x5d7d('0x43')]);_0x9a08c8['query']=_[_0x5d7d('0x30')](_0x4cb9fb[_0x5d7d('0x2f')]);_0x9a08c8[_0x5d7d('0x31')]=_['intersection'](_0x9a08c8['model'],_0x9a08c8[_0x5d7d('0x2f')]);_0x25c909['attributes']=_[_0x5d7d('0x32')](_0x9a08c8[_0x5d7d('0x2e')],qs['fields'](_0x4cb9fb[_0x5d7d('0x2f')]['fields']));_0x25c909[_0x5d7d('0x33')]=_0x25c909['attributes'][_0x5d7d('0x44')]?_0x25c909['attributes']:_0x9a08c8[_0x5d7d('0x2e')];if(_0x4cb9fb[_0x5d7d('0x2f')][_0x5d7d('0x3e')]){_0x25c909[_0x5d7d('0x3f')]=[{'all':!![]}];}_0x25c909=_[_0x5d7d('0x3b')]({},_0x25c909,_0x4cb9fb[_0x5d7d('0x3d')]);return db[_0x5d7d('0x2b')][_0x5d7d('0x45')](_0x25c909)[_0x5d7d('0x25')](handleEntityNotFound(_0x3aaea2,null))[_0x5d7d('0x25')](respondWithResult(_0x3aaea2,null))[_0x5d7d('0x46')](handleError(_0x3aaea2,null));};exports[_0x5d7d('0x47')]=function(_0x5369f5,_0x52ee9c){return db['VtigerAccount'][_0x5d7d('0x47')](_0x5369f5[_0x5d7d('0x48')],{})['then'](respondWithResult(_0x52ee9c,0xc9))['catch'](handleError(_0x52ee9c,null));};exports[_0x5d7d('0x49')]=function(_0x1ea90a,_0x2931ae){if(_0x1ea90a['body']['id']){delete _0x1ea90a[_0x5d7d('0x48')]['id'];}return db['VtigerAccount'][_0x5d7d('0x45')]({'where':{'id':_0x1ea90a[_0x5d7d('0x42')]['id']}})['then'](handleEntityNotFound(_0x2931ae,null))[_0x5d7d('0x25')](saveUpdates(_0x1ea90a[_0x5d7d('0x48')],null))[_0x5d7d('0x25')](respondWithResult(_0x2931ae,null))['catch'](handleError(_0x2931ae,null));};exports[_0x5d7d('0x26')]=function(_0x44041e,_0x37124c){return db[_0x5d7d('0x2b')]['find']({'where':{'id':_0x44041e[_0x5d7d('0x42')]['id']}})['then'](handleEntityNotFound(_0x37124c,null))[_0x5d7d('0x25')](removeEntity(_0x37124c,null))[_0x5d7d('0x46')](handleError(_0x37124c,null));};exports[_0x5d7d('0x4a')]=function(_0x413330,_0x102904,_0x188482){var _0x36c186={};var _0x490985={};var _0x135fe7;var _0x762789;return db[_0x5d7d('0x2b')][_0x5d7d('0x4b')]({'where':{'id':_0x413330[_0x5d7d('0x42')]['id']}})[_0x5d7d('0x25')](handleEntityNotFound(_0x102904,null))[_0x5d7d('0x25')](function(_0x461ae4){if(_0x461ae4){_0x135fe7=_0x461ae4;_0x490985[_0x5d7d('0x2e')]=_[_0x5d7d('0x30')](db[_0x5d7d('0x4c')][_0x5d7d('0x43')]);_0x490985[_0x5d7d('0x2f')]=_[_0x5d7d('0x30')](_0x413330[_0x5d7d('0x2f')]);_0x490985[_0x5d7d('0x31')]=_[_0x5d7d('0x32')](_0x490985[_0x5d7d('0x2e')],_0x490985[_0x5d7d('0x2f')]);_0x36c186[_0x5d7d('0x33')]=_[_0x5d7d('0x32')](_0x490985[_0x5d7d('0x2e')],qs[_0x5d7d('0x34')](_0x413330['query'][_0x5d7d('0x34')]));_0x36c186[_0x5d7d('0x33')]=_0x36c186[_0x5d7d('0x33')]['length']?_0x36c186[_0x5d7d('0x33')]:_0x490985['model'];_0x36c186[_0x5d7d('0x4d')]=qs['sort'](_0x413330[_0x5d7d('0x2f')][_0x5d7d('0x37')]);_0x36c186[_0x5d7d('0x38')]=qs[_0x5d7d('0x31')](_[_0x5d7d('0x39')](_0x413330[_0x5d7d('0x2f')],_0x490985['filters']));if(_0x413330[_0x5d7d('0x2f')][_0x5d7d('0x3a')]){_0x36c186[_0x5d7d('0x38')]=_[_0x5d7d('0x3b')](_0x36c186['where'],{'$or':_[_0x5d7d('0x2a')](_0x36c186[_0x5d7d('0x33')],function(_0xcd9b45){var _0x4e58e5={};_0x4e58e5[_0xcd9b45]={'$like':'%'+_0x413330[_0x5d7d('0x2f')][_0x5d7d('0x3a')]+'%'};return _0x4e58e5;})});}_0x36c186=_[_0x5d7d('0x3b')]({},_0x36c186,_0x413330['options']);return _0x135fe7[_0x5d7d('0x4a')](_0x36c186);}})[_0x5d7d('0x25')](function(_0x275cf8){if(_0x275cf8){_0x762789=_0x275cf8[_0x5d7d('0x44')];if(!_0x413330['query'][_0x5d7d('0x35')](_0x5d7d('0x4e'))){_0x36c186[_0x5d7d('0x36')]=qs[_0x5d7d('0x36')](_0x413330[_0x5d7d('0x2f')][_0x5d7d('0x36')]);_0x36c186[_0x5d7d('0x1f')]=qs['offset'](_0x413330[_0x5d7d('0x2f')][_0x5d7d('0x1f')]);}return _0x135fe7[_0x5d7d('0x4a')](_0x36c186);}})['then'](function(_0x151ce9){if(_0x151ce9){return _0x151ce9?{'count':_0x762789,'rows':_0x151ce9}:null;}})[_0x5d7d('0x25')](respondWithResult(_0x102904,null))[_0x5d7d('0x46')](handleError(_0x102904,null));};exports[_0x5d7d('0x4f')]=function(_0x5563fb,_0x2c6fc0,_0x287875){if(_0x5563fb[_0x5d7d('0x48')]['id']){delete _0x5563fb['body']['id'];}return db['VtigerAccount']['findOne']({'where':{'id':_0x5563fb['params']['id']}})[_0x5d7d('0x25')](handleEntityNotFound(_0x2c6fc0,null))[_0x5d7d('0x25')](function(_0x4ab786){if(_0x4ab786){_0x5563fb[_0x5d7d('0x48')]['AccountId']=_0x4ab786['id'];_0x5563fb[_0x5d7d('0x48')][_0x5d7d('0x50')]=integrations['getSubjects'](_0x5563fb['body'][_0x5d7d('0x51')],_0x5563fb[_0x5d7d('0x48')][_0x5d7d('0x2c')]);_0x5563fb[_0x5d7d('0x48')][_0x5d7d('0x52')]=integrations['getDescriptions'](_0x5563fb['body'][_0x5d7d('0x51')],_0x5563fb[_0x5d7d('0x48')][_0x5d7d('0x2c')]);return db['VtigerConfiguration'][_0x5d7d('0x47')](_0x5563fb[_0x5d7d('0x48')],{'include':[{'model':db[_0x5d7d('0x53')],'as':'Subjects'},{'model':db[_0x5d7d('0x53')],'as':_0x5d7d('0x52')}]});}return null;})[_0x5d7d('0x25')](respondWithResult(_0x2c6fc0,null))[_0x5d7d('0x46')](handleError(_0x2c6fc0,null));};var md5=require(_0x5d7d('0x54'));exports[_0x5d7d('0x55')]=function(_0x2d7b58,_0x5a8bd5,_0x7e316f){var _0x2562f4=null;var _0x184c65=null;var _0x1e85c6=null;var _0x5002ec=null;var _0x28a1cd='';return db[_0x5d7d('0x2b')][_0x5d7d('0x4b')]({'where':{'id':_0x2d7b58[_0x5d7d('0x42')]['id']},'attributes':['id',_0x5d7d('0x29'),_0x5d7d('0x56'),_0x5d7d('0x57'),_0x5d7d('0x58'),_0x5d7d('0x59'),_0x5d7d('0x5a'),'accessKey']})['then'](handleEntityNotFound(_0x5a8bd5,null))[_0x5d7d('0x25')](function(_0x101397){if(_0x101397){_0x2562f4=_0x101397[_0x5d7d('0x56')];_0x184c65=_0x101397[_0x5d7d('0x5b')];_0x1e85c6=_0x101397[_0x5d7d('0x58')];_0x28a1cd=_0x101397[_0x5d7d('0x59')];var _0xa0427a=_0x28a1cd[_0x5d7d('0x5c')](-0x1);if(_0xa0427a==='/'){_0x28a1cd=_0x28a1cd['substring'](0x0,_0x28a1cd[_0x5d7d('0x5d')](_0xa0427a));}_0x5002ec=util['format'](_0x5d7d('0x5e'),_0x28a1cd);var _0x37b187={'method':_0x5d7d('0x5f'),'uri':_0x5002ec,'qs':{'operation':_0x5d7d('0x60'),'username':_0x101397[_0x5d7d('0x56')]},'json':!![]};return rp(_0x37b187);}})[_0x5d7d('0x25')](function(_0x436443){if(_0x436443[_0x5d7d('0x61')]){var _0x287c7b={'method':_0x5d7d('0x62'),'uri':_0x5002ec,'form':{'operation':_0x5d7d('0x63'),'username':_0x2562f4,'accessKey':md5(_0x436443[_0x5d7d('0x64')][_0x5d7d('0x65')]+_0x184c65)},'json':!![]};return rp(_0x287c7b);}})['then'](function(_0x5dc6dd){if(_0x5dc6dd['success']){var _0x1bc1a4={'method':_0x5d7d('0x5f'),'uri':_0x5002ec,'qs':{'operation':_0x5d7d('0x66'),'username':_0x2562f4,'sessionName':_0x5dc6dd[_0x5d7d('0x64')]['sessionName'],'elementType':_0x1e85c6},'json':!![]};return rp(_0x1bc1a4);}})[_0x5d7d('0x25')](function(_0x23b1bb){if(_0x23b1bb[_0x5d7d('0x61')]){var _0x4fee64=[_0x5d7d('0x67'),'reference',_0x5d7d('0x68')];_[_0x5d7d('0x69')](_0x23b1bb[_0x5d7d('0x64')][_0x5d7d('0x34')],function(_0x314ebf){return _0x4fee64[_0x5d7d('0x6a')](_0x314ebf['type'][_0x5d7d('0x29')]);});_['remove'](_0x23b1bb[_0x5d7d('0x64')]['fields'],function(_0x18f63a){return _0x18f63a[_0x5d7d('0x6b')]===_0x5d7d('0x6c');});return{'count':_0x23b1bb[_0x5d7d('0x64')]['fields']['length'],'rows':_['map'](_0x23b1bb[_0x5d7d('0x64')]['fields'],function(_0x4be29a){return{'id':_0x4be29a['name'],'name':_0x4be29a[_0x5d7d('0x6d')],'custom':_[_0x5d7d('0x6e')](_0x4be29a[_0x5d7d('0x29')],_0x5d7d('0x6f'))?!![]:![],'options':_0x4be29a['type']['name']===_0x5d7d('0x70')&&_0x4be29a[_0x5d7d('0x2c')]['picklistValues'][_0x5d7d('0x44')]>0x0?_[_0x5d7d('0x2a')](_0x4be29a[_0x5d7d('0x2c')]['picklistValues'],function(_0x539a85){return{'name':_0x539a85[_0x5d7d('0x6d')],'value':_0x539a85[_0x5d7d('0x71')]};}):[]};})};}})[_0x5d7d('0x25')](respondWithResult(_0x5a8bd5,null))[_0x5d7d('0x46')](function(_0x129641){console['log'](_0x5d7d('0x72')+_0x129641);var _0x38700c=_0x2d7b58[_0x5d7d('0x2f')]['test']?0x1f4:_0x129641[_0x5d7d('0x73')]||0x1f4;logger[_0x5d7d('0x27')](_0x5d7d('0x74'),'getFields',_0x38700c,JSON[_0x5d7d('0x75')](_0x129641));delete _0x129641[_0x5d7d('0x29')];if(_0x38700c===0x191){_0x38700c=0x190;}_0x5a8bd5['status'](_0x38700c)[_0x5d7d('0x76')](_0x2d7b58[_0x5d7d('0x2f')][_0x5d7d('0x77')]?{'message':_0x5d7d('0x78'),'statusCode':_0x129641[_0x5d7d('0x73')]}:_0x129641);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 2ed4ff3..1b7fe85 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 _0xb72f=['bluebird','request-promise','path','rimraf','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','moment'];(function(_0x38286c,_0x188997){var _0x20d6f3=function(_0x508185){while(--_0x508185){_0x38286c['push'](_0x38286c['shift']());}};_0x20d6f3(++_0x188997);}(_0xb72f,0x1d8));var _0xfb72=function(_0x204ad4,_0x502841){_0x204ad4=_0x204ad4-0x0;var _0x50675f=_0xb72f[_0x204ad4];return _0x50675f;};'use strict';var _=require(_0xfb72('0x0'));var util=require(_0xfb72('0x1'));var logger=require(_0xfb72('0x2'))('api');var moment=require(_0xfb72('0x3'));var BPromise=require(_0xfb72('0x4'));var rp=require(_0xfb72('0x5'));var fs=require('fs');var path=require(_0xfb72('0x6'));var rimraf=require(_0xfb72('0x7'));var config=require('../../config/environment');var attributes=require(_0xfb72('0x8'));var integrations=require(_0xfb72('0x9'));module[_0xfb72('0xa')]=function(_0x145be9,_0x3e3e70){return _0x145be9[_0xfb72('0xb')](_0xfb72('0xc'),attributes,{'tableName':_0xfb72('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x14d8=['define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','api','moment','bluebird','path','../../components/integrations/configuration','exports'];(function(_0x3a9427,_0x27078f){var _0x2f8840=function(_0x546dbf){while(--_0x546dbf){_0x3a9427['push'](_0x3a9427['shift']());}};_0x2f8840(++_0x27078f);}(_0x14d8,0x87));var _0x814d=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x14d8[_0x465028];return _0xb783d4;};'use strict';var _=require(_0x814d('0x0'));var util=require(_0x814d('0x1'));var logger=require(_0x814d('0x2'))(_0x814d('0x3'));var moment=require(_0x814d('0x4'));var BPromise=require(_0x814d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x814d('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x814d('0x7'));module[_0x814d('0x8')]=function(_0x105932,_0x52e4c5){return _0x105932[_0x814d('0x9')](_0x814d('0xa'),attributes,{'tableName':_0x814d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 4629c68..34536ef 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 _0xa902=['include','map','model','ShowVtigerAccount','VtigerAccount','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetVtigerAccount','findAll','options','raw','where','attributes'];(function(_0x26b8b5,_0xf5c2c1){var _0x2150a9=function(_0x1ca1be){while(--_0x1ca1be){_0x26b8b5['push'](_0x26b8b5['shift']());}};_0x2150a9(++_0xf5c2c1);}(_0xa902,0x8d));var _0x2a90=function(_0x3df8da,_0x477434){_0x3df8da=_0x3df8da-0x0;var _0xbbd7c0=_0xa902[_0x3df8da];return _0xbbd7c0;};'use strict';var _=require(_0x2a90('0x0'));var util=require(_0x2a90('0x1'));var moment=require(_0x2a90('0x2'));var BPromise=require(_0x2a90('0x3'));var rs=require(_0x2a90('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2a90('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2a90('0x6'));var config=require(_0x2a90('0x7'));var jayson=require(_0x2a90('0x8'));var client=jayson[_0x2a90('0x9')][_0x2a90('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25bcfc,_0x58369a,_0x4109e6){return new BPromise(function(_0x570659,_0x5ec2b9){return client[_0x2a90('0xb')](_0x25bcfc,_0x4109e6)[_0x2a90('0xc')](function(_0xe500bc){logger[_0x2a90('0xd')](_0x2a90('0xe'),_0x58369a,'request\x20sent');logger[_0x2a90('0xf')](_0x2a90('0x10'),_0x58369a,_0x2a90('0x11'),JSON[_0x2a90('0x12')](_0xe500bc));if(_0xe500bc['error']){if(_0xe500bc[_0x2a90('0x13')]['code']===0x1f4){logger[_0x2a90('0x13')]('VtigerAccount,\x20%s,\x20%s',_0x58369a,_0xe500bc[_0x2a90('0x13')]['message']);return _0x5ec2b9(_0xe500bc[_0x2a90('0x13')][_0x2a90('0x14')]);}logger[_0x2a90('0x13')]('VtigerAccount,\x20%s,\x20%s',_0x58369a,_0xe500bc['error']['message']);return _0x570659(_0xe500bc[_0x2a90('0x13')][_0x2a90('0x14')]);}else{logger['info'](_0x2a90('0xe'),_0x58369a,_0x2a90('0x11'));_0x570659(_0xe500bc[_0x2a90('0x15')][_0x2a90('0x14')]);}})[_0x2a90('0x16')](function(_0x37858e){logger[_0x2a90('0x13')](_0x2a90('0xe'),_0x58369a,_0x37858e);_0x5ec2b9(_0x37858e);});});}exports[_0x2a90('0x17')]=function(_0x5c3e4b){var _0x162f0b=this;return new Promise(function(_0x1d9a28,_0x4190ff){return db['VtigerAccount'][_0x2a90('0x18')]({'raw':_0x5c3e4b[_0x2a90('0x19')]?_0x5c3e4b[_0x2a90('0x19')][_0x2a90('0x1a')]===undefined?!![]:![]:!![],'where':_0x5c3e4b[_0x2a90('0x19')]?_0x5c3e4b[_0x2a90('0x19')][_0x2a90('0x1b')]||null:null,'attributes':_0x5c3e4b[_0x2a90('0x19')]?_0x5c3e4b[_0x2a90('0x19')][_0x2a90('0x1c')]||null:null,'limit':_0x5c3e4b[_0x2a90('0x19')]?_0x5c3e4b[_0x2a90('0x19')]['limit']||null:null,'include':_0x5c3e4b[_0x2a90('0x19')]?_0x5c3e4b[_0x2a90('0x19')][_0x2a90('0x1d')]?_[_0x2a90('0x1e')](_0x5c3e4b['options'][_0x2a90('0x1d')],function(_0xd033d){return{'model':db[_0xd033d['model']],'as':_0xd033d['as'],'attributes':_0xd033d[_0x2a90('0x1c')],'include':_0xd033d[_0x2a90('0x1d')]?_[_0x2a90('0x1e')](_0xd033d[_0x2a90('0x1d')],function(_0x2a212c){return{'model':db[_0x2a212c[_0x2a90('0x1f')]],'as':_0x2a212c['as'],'attributes':_0x2a212c[_0x2a90('0x1c')],'include':_0x2a212c[_0x2a90('0x1d')]?_['map'](_0x2a212c[_0x2a90('0x1d')],function(_0x17f978){return{'model':db[_0x17f978[_0x2a90('0x1f')]],'as':_0x17f978['as'],'attributes':_0x17f978[_0x2a90('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x2a90('0xc')](function(_0x5208d8){logger['info'](_0x2a90('0x17'),_0x5c3e4b);logger['debug']('GetVtigerAccount',_0x5c3e4b,JSON['stringify'](_0x5208d8));_0x1d9a28(_0x5208d8);})[_0x2a90('0x16')](function(_0x3c78f5){logger['error']('GetVtigerAccount',_0x3c78f5[_0x2a90('0x14')],_0x5c3e4b);_0x4190ff(_0x162f0b['error'](0x1f4,_0x3c78f5[_0x2a90('0x14')]));});});};exports[_0x2a90('0x20')]=function(_0x3b580f){var _0x27b6b6=this;return new Promise(function(_0xf18d11,_0x11586c){return db[_0x2a90('0x21')]['find']({'raw':_0x3b580f[_0x2a90('0x19')]?_0x3b580f[_0x2a90('0x19')][_0x2a90('0x1a')]===undefined?!![]:![]:!![],'where':_0x3b580f['options']?_0x3b580f[_0x2a90('0x19')][_0x2a90('0x1b')]||null:null,'attributes':_0x3b580f[_0x2a90('0x19')]?_0x3b580f[_0x2a90('0x19')]['attributes']||null:null,'include':_0x3b580f[_0x2a90('0x19')]?_0x3b580f[_0x2a90('0x19')][_0x2a90('0x1d')]?_[_0x2a90('0x1e')](_0x3b580f[_0x2a90('0x19')][_0x2a90('0x1d')],function(_0x4d4149){return{'model':db[_0x4d4149[_0x2a90('0x1f')]],'as':_0x4d4149['as'],'attributes':_0x4d4149[_0x2a90('0x1c')],'include':_0x4d4149[_0x2a90('0x1d')]?_[_0x2a90('0x1e')](_0x4d4149['include'],function(_0x1bab1d){return{'model':db[_0x1bab1d[_0x2a90('0x1f')]],'as':_0x1bab1d['as'],'attributes':_0x1bab1d['attributes'],'include':_0x1bab1d[_0x2a90('0x1d')]?_[_0x2a90('0x1e')](_0x1bab1d['include'],function(_0x5073a4){return{'model':db[_0x5073a4[_0x2a90('0x1f')]],'as':_0x5073a4['as'],'attributes':_0x5073a4[_0x2a90('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x2a90('0xc')](function(_0x4cd36c){logger[_0x2a90('0xd')]('ShowVtigerAccount',_0x3b580f);logger[_0x2a90('0xf')]('ShowVtigerAccount',_0x3b580f,JSON[_0x2a90('0x12')](_0x4cd36c));_0xf18d11(_0x4cd36c);})['catch'](function(_0x5322dc){logger[_0x2a90('0x13')]('ShowVtigerAccount',_0x5322dc[_0x2a90('0x14')],_0x3b580f);_0x11586c(_0x27b6b6[_0x2a90('0x13')](0x1f4,_0x5322dc[_0x2a90('0x14')]));});});}; \ No newline at end of file +var _0x91a7=['VtigerAccount,\x20%s,\x20%s','catch','GetVtigerAccount','options','raw','where','attributes','limit','include','map','model','ShowVtigerAccount','VtigerAccount','find','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','code','message'];(function(_0x4a3553,_0x12e68f){var _0x569d42=function(_0x28860d){while(--_0x28860d){_0x4a3553['push'](_0x4a3553['shift']());}};_0x569d42(++_0x12e68f);}(_0x91a7,0xe7));var _0x791a=function(_0x502985,_0x2c995b){_0x502985=_0x502985-0x0;var _0x5b5499=_0x91a7[_0x502985];return _0x5b5499;};'use strict';var _=require('lodash');var util=require(_0x791a('0x0'));var moment=require(_0x791a('0x1'));var BPromise=require(_0x791a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x791a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x791a('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x791a('0x5'));var jayson=require(_0x791a('0x6'));var client=jayson['client'][_0x791a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5db6db,_0x33baac,_0x159e24){return new BPromise(function(_0x5aa10a,_0x1a32b4){return client[_0x791a('0x8')](_0x5db6db,_0x159e24)[_0x791a('0x9')](function(_0x80ff65){logger[_0x791a('0xa')]('VtigerAccount,\x20%s,\x20%s',_0x33baac,_0x791a('0xb'));logger[_0x791a('0xc')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x33baac,_0x791a('0xb'),JSON[_0x791a('0xd')](_0x80ff65));if(_0x80ff65[_0x791a('0xe')]){if(_0x80ff65[_0x791a('0xe')][_0x791a('0xf')]===0x1f4){logger[_0x791a('0xe')]('VtigerAccount,\x20%s,\x20%s',_0x33baac,_0x80ff65['error'][_0x791a('0x10')]);return _0x1a32b4(_0x80ff65[_0x791a('0xe')]['message']);}logger[_0x791a('0xe')](_0x791a('0x11'),_0x33baac,_0x80ff65['error'][_0x791a('0x10')]);return _0x5aa10a(_0x80ff65[_0x791a('0xe')][_0x791a('0x10')]);}else{logger[_0x791a('0xa')]('VtigerAccount,\x20%s,\x20%s',_0x33baac,_0x791a('0xb'));_0x5aa10a(_0x80ff65['result'][_0x791a('0x10')]);}})[_0x791a('0x12')](function(_0x49ae3e){logger[_0x791a('0xe')]('VtigerAccount,\x20%s,\x20%s',_0x33baac,_0x49ae3e);_0x1a32b4(_0x49ae3e);});});}exports[_0x791a('0x13')]=function(_0x52941d){var _0x4a84ee=this;return new Promise(function(_0x588d00,_0x40f0d3){return db['VtigerAccount']['findAll']({'raw':_0x52941d[_0x791a('0x14')]?_0x52941d[_0x791a('0x14')][_0x791a('0x15')]===undefined?!![]:![]:!![],'where':_0x52941d[_0x791a('0x14')]?_0x52941d['options'][_0x791a('0x16')]||null:null,'attributes':_0x52941d[_0x791a('0x14')]?_0x52941d[_0x791a('0x14')][_0x791a('0x17')]||null:null,'limit':_0x52941d['options']?_0x52941d[_0x791a('0x14')][_0x791a('0x18')]||null:null,'include':_0x52941d[_0x791a('0x14')]?_0x52941d[_0x791a('0x14')][_0x791a('0x19')]?_[_0x791a('0x1a')](_0x52941d[_0x791a('0x14')][_0x791a('0x19')],function(_0x323c6a){return{'model':db[_0x323c6a[_0x791a('0x1b')]],'as':_0x323c6a['as'],'attributes':_0x323c6a[_0x791a('0x17')],'include':_0x323c6a['include']?_[_0x791a('0x1a')](_0x323c6a[_0x791a('0x19')],function(_0x380329){return{'model':db[_0x380329[_0x791a('0x1b')]],'as':_0x380329['as'],'attributes':_0x380329['attributes'],'include':_0x380329[_0x791a('0x19')]?_[_0x791a('0x1a')](_0x380329['include'],function(_0xdfa84f){return{'model':db[_0xdfa84f[_0x791a('0x1b')]],'as':_0xdfa84f['as'],'attributes':_0xdfa84f[_0x791a('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x29194d){logger[_0x791a('0xa')](_0x791a('0x13'),_0x52941d);logger[_0x791a('0xc')](_0x791a('0x13'),_0x52941d,JSON[_0x791a('0xd')](_0x29194d));_0x588d00(_0x29194d);})[_0x791a('0x12')](function(_0x889534){logger['error'](_0x791a('0x13'),_0x889534[_0x791a('0x10')],_0x52941d);_0x40f0d3(_0x4a84ee[_0x791a('0xe')](0x1f4,_0x889534['message']));});});};exports[_0x791a('0x1c')]=function(_0x5df656){var _0xc59f5e=this;return new Promise(function(_0x2e4ec8,_0xcde862){return db[_0x791a('0x1d')][_0x791a('0x1e')]({'raw':_0x5df656[_0x791a('0x14')]?_0x5df656[_0x791a('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x5df656[_0x791a('0x14')]?_0x5df656[_0x791a('0x14')][_0x791a('0x16')]||null:null,'attributes':_0x5df656[_0x791a('0x14')]?_0x5df656[_0x791a('0x14')]['attributes']||null:null,'include':_0x5df656[_0x791a('0x14')]?_0x5df656[_0x791a('0x14')][_0x791a('0x19')]?_[_0x791a('0x1a')](_0x5df656[_0x791a('0x14')]['include'],function(_0x305836){return{'model':db[_0x305836[_0x791a('0x1b')]],'as':_0x305836['as'],'attributes':_0x305836[_0x791a('0x17')],'include':_0x305836[_0x791a('0x19')]?_[_0x791a('0x1a')](_0x305836['include'],function(_0xd5609){return{'model':db[_0xd5609['model']],'as':_0xd5609['as'],'attributes':_0xd5609[_0x791a('0x17')],'include':_0xd5609['include']?_['map'](_0xd5609[_0x791a('0x19')],function(_0x404530){return{'model':db[_0x404530[_0x791a('0x1b')]],'as':_0x404530['as'],'attributes':_0x404530[_0x791a('0x17')]};}):[]};}):[]};}):[]:[]})[_0x791a('0x9')](function(_0x3f46be){logger[_0x791a('0xa')]('ShowVtigerAccount',_0x5df656);logger[_0x791a('0xc')]('ShowVtigerAccount',_0x5df656,JSON[_0x791a('0xd')](_0x3f46be));_0x2e4ec8(_0x3f46be);})['catch'](function(_0x25e8cc){logger[_0x791a('0xe')]('ShowVtigerAccount',_0x25e8cc[_0x791a('0x10')],_0x5df656);_0xcde862(_0xc59f5e[_0x791a('0xe')](0x1f4,_0x25e8cc['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 5c1790e..f40b069 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 _0x1333=['./intVtigerConfiguration.controller','isAuthenticated','index','get','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','put','delete','/:id','destroy','exports','util','path','connect-timeout','fs-extra','../../config/environment'];(function(_0x2dc811,_0x269ee3){var _0x3295f3=function(_0x3fa7c8){while(--_0x3fa7c8){_0x2dc811['push'](_0x2dc811['shift']());}};_0x3295f3(++_0x269ee3);}(_0x1333,0x19d));var _0x3133=function(_0x5dc4a8,_0x3add48){_0x5dc4a8=_0x5dc4a8-0x0;var _0x2cef9a=_0x1333[_0x5dc4a8];return _0x2cef9a;};'use strict';var multer=require('multer');var util=require(_0x3133('0x0'));var path=require(_0x3133('0x1'));var timeout=require(_0x3133('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3133('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3133('0x4'));var controller=require(_0x3133('0x5'));router['get']('/',auth[_0x3133('0x6')](),controller[_0x3133('0x7')]);router[_0x3133('0x8')]('/:id',auth[_0x3133('0x6')](),controller['show']);router[_0x3133('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0x3133('0x9')]);router['get'](_0x3133('0xa'),auth['isAuthenticated'](),controller[_0x3133('0xb')]);router[_0x3133('0x8')](_0x3133('0xc'),auth[_0x3133('0x6')](),controller['getDescriptions']);router[_0x3133('0xd')]('/',auth[_0x3133('0x6')](),controller['create']);router[_0x3133('0xe')]('/:id',auth[_0x3133('0x6')](),controller['update']);router[_0x3133('0xf')](_0x3133('0x10'),auth[_0x3133('0x6')](),controller[_0x3133('0x11')]);module[_0x3133('0x12')]=router; \ No newline at end of file +var _0x4af0=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x51c70f,_0x27ed11){var _0x38adc8=function(_0x84f046){while(--_0x84f046){_0x51c70f['push'](_0x51c70f['shift']());}};_0x38adc8(++_0x27ed11);}(_0x4af0,0xad));var _0x04af=function(_0x28ae25,_0xe28f5){_0x28ae25=_0x28ae25-0x0;var _0x225012=_0x4af0[_0x28ae25];return _0x225012;};'use strict';var multer=require(_0x04af('0x0'));var util=require(_0x04af('0x1'));var path=require(_0x04af('0x2'));var timeout=require(_0x04af('0x3'));var express=require('express');var router=express[_0x04af('0x4')]();var fs_extra=require(_0x04af('0x5'));var auth=require(_0x04af('0x6'));var interaction=require(_0x04af('0x7'));var config=require(_0x04af('0x8'));var controller=require(_0x04af('0x9'));router[_0x04af('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x04af('0xa')](_0x04af('0xb'),auth[_0x04af('0xc')](),controller[_0x04af('0xd')]);router[_0x04af('0xa')](_0x04af('0xe'),auth[_0x04af('0xc')](),controller[_0x04af('0xf')]);router[_0x04af('0xa')](_0x04af('0x10'),auth[_0x04af('0xc')](),controller[_0x04af('0x11')]);router[_0x04af('0xa')]('/:id/descriptions',auth['isAuthenticated'](),controller['getDescriptions']);router[_0x04af('0x12')]('/',auth[_0x04af('0xc')](),controller[_0x04af('0x13')]);router[_0x04af('0x14')](_0x04af('0xb'),auth[_0x04af('0xc')](),controller[_0x04af('0x15')]);router[_0x04af('0x16')](_0x04af('0xb'),auth[_0x04af('0xc')](),controller[_0x04af('0x17')]);module[_0x04af('0x18')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 6f5c837..3e729c6 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 _0xa897=['sequelize','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa897,0x136));var _0x7a89=function(_0x4b5878,_0x38efd2){_0x4b5878=_0x4b5878-0x0;var _0x5e9192=_0xa897[_0x4b5878];return _0x5e9192;};'use strict';var Sequelize=require(_0x7a89('0x0'));module['exports']={'name':{'type':Sequelize[_0x7a89('0x1')]},'description':{'type':Sequelize[_0x7a89('0x1')]}}; \ No newline at end of file +var _0x3fd7=['exports','sequelize'];(function(_0x1c5142,_0x30ea72){var _0x1268cb=function(_0xaa2299){while(--_0xaa2299){_0x1c5142['push'](_0x1c5142['shift']());}};_0x1268cb(++_0x30ea72);}(_0x3fd7,0x9f));var _0x73fd=function(_0x1bd6c8,_0x4b786b){_0x1bd6c8=_0x1bd6c8-0x0;var _0x5378fc=_0x3fd7[_0x1bd6c8];return _0x5378fc;};'use strict';var Sequelize=require(_0x73fd('0x0'));module[_0x73fd('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index e5de28a..9682298 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 _0x336a=['bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','end','error','name','send','index','map','VtigerConfiguration','rawAttributes','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','destroy','getFields','findOne','getSubjects','VtigerField','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment'];(function(_0x50933f,_0x24cceb){var _0x26f003=function(_0x59d495){while(--_0x59d495){_0x50933f['push'](_0x50933f['shift']());}};_0x26f003(++_0x24cceb);}(_0x336a,0xa3));var _0xa336=function(_0x2555d0,_0x4150a6){_0x2555d0=_0x2555d0-0x0;var _0x3bb486=_0x336a[_0x2555d0];return _0x3bb486;};'use strict';var emlformat=require(_0xa336('0x0'));var rimraf=require(_0xa336('0x1'));var zipdir=require(_0xa336('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa336('0x3'));var moment=require(_0xa336('0x4'));var BPromise=require(_0xa336('0x5'));var Mustache=require('mustache');var util=require(_0xa336('0x6'));var path=require(_0xa336('0x7'));var sox=require(_0xa336('0x8'));var csv=require(_0xa336('0x9'));var ejs=require(_0xa336('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa336('0xb'));var squel=require(_0xa336('0xc'));var crypto=require(_0xa336('0xd'));var jsforce=require(_0xa336('0xe'));var deskjs=require(_0xa336('0xf'));var toCsv=require(_0xa336('0x9'));var querystring=require(_0xa336('0x10'));var Papa=require(_0xa336('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa336('0x12'));var as=require(_0xa336('0x13'));var hardwareService=require(_0xa336('0x14'));var logger=require(_0xa336('0x15'))(_0xa336('0x16'));var utils=require(_0xa336('0x17'));var config=require(_0xa336('0x18'));var licenseUtil=require(_0xa336('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ece16,_0x3d6114){_0x3d6114=_0x3d6114||0xcc;return function(_0x350900){if(_0x350900){return _0x1ece16[_0xa336('0x1a')](_0x3d6114);}return _0x1ece16['status'](_0x3d6114)['end']();};}function respondWithResult(_0x2da83c,_0x3f8f4e){_0x3f8f4e=_0x3f8f4e||0xc8;return function(_0xbdece9){if(_0xbdece9){return _0x2da83c[_0xa336('0x1b')](_0x3f8f4e)[_0xa336('0x1c')](_0xbdece9);}};}function respondWithFilteredResult(_0x186957,_0x382e2f){return function(_0x478b72){if(_0x478b72){var _0x2af4e8=typeof _0x382e2f[_0xa336('0x1d')]===_0xa336('0x1e')&&typeof _0x382e2f['limit']==='undefined';var _0x35a614=_0x478b72[_0xa336('0x1f')];var _0x30b5cc=_0x2af4e8?0x0:_0x382e2f[_0xa336('0x1d')];var _0x303861=_0x2af4e8?_0x478b72[_0xa336('0x1f')]:_0x382e2f[_0xa336('0x1d')]+_0x382e2f[_0xa336('0x20')];var _0x2accbc;if(_0x303861>=_0x35a614){_0x303861=_0x35a614;_0x2accbc=0xc8;}else{_0x2accbc=0xce;}_0x186957[_0xa336('0x1b')](_0x2accbc);return _0x186957[_0xa336('0x21')](_0xa336('0x22'),_0x30b5cc+'-'+_0x303861+'/'+_0x35a614)[_0xa336('0x1c')](_0x478b72);}return null;};}function patchUpdates(_0x53360d){return function(_0x2eddb9){try{jsonpatch[_0xa336('0x23')](_0x2eddb9,_0x53360d,!![]);}catch(_0x4c1e1d){return BPromise[_0xa336('0x24')](_0x4c1e1d);}return _0x2eddb9[_0xa336('0x25')]();};}function saveUpdates(_0x1625e4,_0x2b2dca){return function(_0x22fd23){if(_0x22fd23){return _0x22fd23[_0xa336('0x26')](_0x1625e4)[_0xa336('0x27')](function(_0x498b67){return _0x498b67;});}return null;};}function removeEntity(_0x4d5567,_0x50e3fb){return function(_0x50bd0f){if(_0x50bd0f){return _0x50bd0f['destroy']()[_0xa336('0x27')](function(){_0x4d5567[_0xa336('0x1b')](0xcc)[_0xa336('0x28')]();});}};}function handleEntityNotFound(_0xd0854b,_0x3c4e8f){return function(_0x1451b2){if(!_0x1451b2){_0xd0854b[_0xa336('0x1a')](0x194);}return _0x1451b2;};}function handleError(_0x144de8,_0x4170b2){_0x4170b2=_0x4170b2||0x1f4;return function(_0x13b593){logger[_0xa336('0x29')](_0x13b593['stack']);if(_0x13b593[_0xa336('0x2a')]){delete _0x13b593[_0xa336('0x2a')];}_0x144de8[_0xa336('0x1b')](_0x4170b2)[_0xa336('0x2b')](_0x13b593);};}exports[_0xa336('0x2c')]=function(_0xdde74c,_0x1b6a18){var _0x2916be={},_0x45c7f2={},_0x1df68d={'count':0x0,'rows':[]};var _0x7f5d00=_[_0xa336('0x2d')](db[_0xa336('0x2e')][_0xa336('0x2f')],function(_0x5c1a4f){return{'name':_0x5c1a4f['fieldName'],'type':_0x5c1a4f[_0xa336('0x30')][_0xa336('0x31')]};});_0x45c7f2[_0xa336('0x32')]=_['map'](_0x7f5d00,_0xa336('0x2a'));_0x45c7f2['query']=_[_0xa336('0x33')](_0xdde74c[_0xa336('0x34')]);_0x45c7f2[_0xa336('0x35')]=_['intersection'](_0x45c7f2[_0xa336('0x32')],_0x45c7f2[_0xa336('0x34')]);_0x2916be[_0xa336('0x36')]=_[_0xa336('0x37')](_0x45c7f2['model'],qs[_0xa336('0x38')](_0xdde74c[_0xa336('0x34')][_0xa336('0x38')]));_0x2916be[_0xa336('0x36')]=_0x2916be[_0xa336('0x36')][_0xa336('0x39')]?_0x2916be['attributes']:_0x45c7f2[_0xa336('0x32')];if(!_0xdde74c['query'][_0xa336('0x3a')](_0xa336('0x3b'))){_0x2916be['limit']=qs[_0xa336('0x20')](_0xdde74c['query'][_0xa336('0x20')]);_0x2916be[_0xa336('0x1d')]=qs[_0xa336('0x1d')](_0xdde74c[_0xa336('0x34')]['offset']);}_0x2916be[_0xa336('0x3c')]=qs[_0xa336('0x3d')](_0xdde74c[_0xa336('0x34')]['sort']);_0x2916be[_0xa336('0x3e')]=qs[_0xa336('0x35')](_[_0xa336('0x3f')](_0xdde74c[_0xa336('0x34')],_0x45c7f2[_0xa336('0x35')]),_0x7f5d00);if(_0xdde74c[_0xa336('0x34')][_0xa336('0x40')]){_0x2916be[_0xa336('0x3e')]=_[_0xa336('0x41')](_0x2916be[_0xa336('0x3e')],{'$or':_['map'](_0x7f5d00,function(_0x2d93c7){if(_0x2d93c7[_0xa336('0x30')]!==_0xa336('0x42')){var _0x581bf1={};_0x581bf1[_0x2d93c7[_0xa336('0x2a')]]={'$like':'%'+_0xdde74c['query'][_0xa336('0x40')]+'%'};return _0x581bf1;}})});}_0x2916be=_['merge']({},_0x2916be,_0xdde74c[_0xa336('0x43')]);var _0x2020bb={'where':_0x2916be['where']};return db[_0xa336('0x2e')][_0xa336('0x1f')](_0x2020bb)[_0xa336('0x27')](function(_0x1d05a6){_0x1df68d[_0xa336('0x1f')]=_0x1d05a6;if(_0xdde74c['query'][_0xa336('0x44')]){_0x2916be[_0xa336('0x45')]=[{'all':!![]}];}return db[_0xa336('0x2e')][_0xa336('0x46')](_0x2916be);})['then'](function(_0x861049){_0x1df68d[_0xa336('0x47')]=_0x861049;return _0x1df68d;})[_0xa336('0x27')](respondWithFilteredResult(_0x1b6a18,_0x2916be))['catch'](handleError(_0x1b6a18,null));};exports[_0xa336('0x48')]=function(_0x4d096e,_0x53abda){var _0x57c72c={'raw':![],'where':{'id':_0x4d096e[_0xa336('0x49')]['id']}},_0x377cc1={};_0x377cc1[_0xa336('0x32')]=_['keys'](db[_0xa336('0x2e')][_0xa336('0x2f')]);_0x377cc1[_0xa336('0x34')]=_[_0xa336('0x33')](_0x4d096e[_0xa336('0x34')]);_0x377cc1[_0xa336('0x35')]=_[_0xa336('0x37')](_0x377cc1[_0xa336('0x32')],_0x377cc1[_0xa336('0x34')]);_0x57c72c[_0xa336('0x36')]=_['intersection'](_0x377cc1['model'],qs[_0xa336('0x38')](_0x4d096e[_0xa336('0x34')][_0xa336('0x38')]));_0x57c72c[_0xa336('0x36')]=_0x57c72c[_0xa336('0x36')][_0xa336('0x39')]?_0x57c72c['attributes']:_0x377cc1[_0xa336('0x32')];if(_0x4d096e[_0xa336('0x34')]['includeAll']){_0x57c72c[_0xa336('0x45')]=[{'all':!![]}];}_0x57c72c=_[_0xa336('0x41')]({},_0x57c72c,_0x4d096e[_0xa336('0x43')]);return db[_0xa336('0x2e')][_0xa336('0x4a')](_0x57c72c)['then'](handleEntityNotFound(_0x53abda,null))[_0xa336('0x27')](respondWithResult(_0x53abda,null))[_0xa336('0x4b')](handleError(_0x53abda,null));};exports['create']=function(_0x564dee,_0x51992c){return db[_0xa336('0x2e')][_0xa336('0x4c')](_0x564dee[_0xa336('0x4d')],{})[_0xa336('0x27')](respondWithResult(_0x51992c,0xc9))[_0xa336('0x4b')](handleError(_0x51992c,null));};exports[_0xa336('0x26')]=function(_0xeda1d1,_0x118b93){if(_0xeda1d1[_0xa336('0x4d')]['id']){delete _0xeda1d1[_0xa336('0x4d')]['id'];}return db[_0xa336('0x2e')]['find']({'where':{'id':_0xeda1d1['params']['id']}})[_0xa336('0x27')](handleEntityNotFound(_0x118b93,null))[_0xa336('0x27')](saveUpdates(_0xeda1d1[_0xa336('0x4d')],null))['then'](respondWithResult(_0x118b93,null))[_0xa336('0x4b')](handleError(_0x118b93,null));};exports[_0xa336('0x4e')]=function(_0x52f4f0,_0x52afcb){return db[_0xa336('0x2e')][_0xa336('0x4a')]({'where':{'id':_0x52f4f0[_0xa336('0x49')]['id']}})[_0xa336('0x27')](handleEntityNotFound(_0x52afcb,null))[_0xa336('0x27')](removeEntity(_0x52afcb,null))[_0xa336('0x4b')](handleError(_0x52afcb,null));};exports[_0xa336('0x4f')]=function(_0x1d6e05,_0x23038c,_0x14a93e){var _0x451efb={};var _0x338166={};var _0x13fed1;var _0x26c91f;return db[_0xa336('0x2e')][_0xa336('0x50')]({'where':{'id':_0x1d6e05[_0xa336('0x49')]['id']}})[_0xa336('0x27')](handleEntityNotFound(_0x23038c,null))[_0xa336('0x27')](function(_0x1fa62b){if(_0x1fa62b){_0x13fed1=_0x1fa62b;_0x338166[_0xa336('0x32')]=_[_0xa336('0x33')](db['VtigerField'][_0xa336('0x2f')]);_0x338166[_0xa336('0x34')]=_[_0xa336('0x33')](_0x1d6e05[_0xa336('0x34')]);_0x338166[_0xa336('0x35')]=_[_0xa336('0x37')](_0x338166['model'],_0x338166[_0xa336('0x34')]);_0x451efb[_0xa336('0x36')]=_[_0xa336('0x37')](_0x338166['model'],qs[_0xa336('0x38')](_0x1d6e05[_0xa336('0x34')][_0xa336('0x38')]));_0x451efb[_0xa336('0x36')]=_0x451efb[_0xa336('0x36')][_0xa336('0x39')]?_0x451efb['attributes']:_0x338166[_0xa336('0x32')];_0x451efb[_0xa336('0x3c')]=qs['sort'](_0x1d6e05['query']['sort']);_0x451efb[_0xa336('0x3e')]=qs[_0xa336('0x35')](_[_0xa336('0x3f')](_0x1d6e05[_0xa336('0x34')],_0x338166[_0xa336('0x35')]));if(_0x1d6e05[_0xa336('0x34')][_0xa336('0x40')]){_0x451efb[_0xa336('0x3e')]=_[_0xa336('0x41')](_0x451efb['where'],{'$or':_[_0xa336('0x2d')](_0x451efb['attributes'],function(_0x50bf81){var _0x4ec670={};_0x4ec670[_0x50bf81]={'$like':'%'+_0x1d6e05[_0xa336('0x34')][_0xa336('0x40')]+'%'};return _0x4ec670;})});}_0x451efb=_[_0xa336('0x41')]({},_0x451efb,_0x1d6e05[_0xa336('0x43')]);return _0x13fed1[_0xa336('0x4f')](_0x451efb);}})[_0xa336('0x27')](function(_0x594fc6){if(_0x594fc6){_0x26c91f=_0x594fc6[_0xa336('0x39')];if(!_0x1d6e05[_0xa336('0x34')][_0xa336('0x3a')]('nolimit')){_0x451efb[_0xa336('0x20')]=qs['limit'](_0x1d6e05[_0xa336('0x34')]['limit']);_0x451efb[_0xa336('0x1d')]=qs[_0xa336('0x1d')](_0x1d6e05[_0xa336('0x34')][_0xa336('0x1d')]);}return _0x13fed1['getFields'](_0x451efb);}})['then'](function(_0x580a3b){if(_0x580a3b){return _0x580a3b?{'count':_0x26c91f,'rows':_0x580a3b}:null;}})[_0xa336('0x27')](respondWithResult(_0x23038c,null))['catch'](handleError(_0x23038c,null));};exports[_0xa336('0x51')]=function(_0x552582,_0x4fc29a,_0xebaf3f){var _0xbbddab={};var _0x269f86={};var _0x468e20;var _0xbd7937;return db[_0xa336('0x2e')]['findOne']({'where':{'id':_0x552582['params']['id']}})[_0xa336('0x27')](handleEntityNotFound(_0x4fc29a,null))[_0xa336('0x27')](function(_0x3057eb){if(_0x3057eb){_0x468e20=_0x3057eb;_0x269f86[_0xa336('0x32')]=_[_0xa336('0x33')](db[_0xa336('0x52')]['rawAttributes']);_0x269f86[_0xa336('0x34')]=_[_0xa336('0x33')](_0x552582[_0xa336('0x34')]);_0x269f86[_0xa336('0x35')]=_['intersection'](_0x269f86['model'],_0x269f86[_0xa336('0x34')]);_0xbbddab[_0xa336('0x36')]=_[_0xa336('0x37')](_0x269f86[_0xa336('0x32')],qs[_0xa336('0x38')](_0x552582[_0xa336('0x34')][_0xa336('0x38')]));_0xbbddab['attributes']=_0xbbddab['attributes'][_0xa336('0x39')]?_0xbbddab['attributes']:_0x269f86['model'];_0xbbddab['order']=qs[_0xa336('0x3d')](_0x552582[_0xa336('0x34')][_0xa336('0x3d')]);_0xbbddab[_0xa336('0x3e')]=qs[_0xa336('0x35')](_['pick'](_0x552582[_0xa336('0x34')],_0x269f86['filters']));if(_0x552582[_0xa336('0x34')][_0xa336('0x40')]){_0xbbddab['where']=_['merge'](_0xbbddab[_0xa336('0x3e')],{'$or':_[_0xa336('0x2d')](_0xbbddab[_0xa336('0x36')],function(_0x4b85fd){var _0x2eec10={};_0x2eec10[_0x4b85fd]={'$like':'%'+_0x552582['query'][_0xa336('0x40')]+'%'};return _0x2eec10;})});}_0xbbddab=_[_0xa336('0x41')]({},_0xbbddab,_0x552582[_0xa336('0x43')]);return _0x468e20[_0xa336('0x51')](_0xbbddab);}})[_0xa336('0x27')](function(_0x3d01fd){if(_0x3d01fd){_0xbd7937=_0x3d01fd[_0xa336('0x39')];if(!_0x552582[_0xa336('0x34')]['hasOwnProperty'](_0xa336('0x3b'))){_0xbbddab[_0xa336('0x20')]=qs[_0xa336('0x20')](_0x552582[_0xa336('0x34')][_0xa336('0x20')]);_0xbbddab[_0xa336('0x1d')]=qs[_0xa336('0x1d')](_0x552582['query'][_0xa336('0x1d')]);}return _0x468e20[_0xa336('0x51')](_0xbbddab);}})[_0xa336('0x27')](function(_0x3205bc){if(_0x3205bc){return _0x3205bc?{'count':_0xbd7937,'rows':_0x3205bc}:null;}})[_0xa336('0x27')](respondWithResult(_0x4fc29a,null))[_0xa336('0x4b')](handleError(_0x4fc29a,null));};exports[_0xa336('0x53')]=function(_0x5d4457,_0x3d64ff,_0x58421f){var _0x223480={};var _0x24e48d={};var _0x7d3626;var _0x12f3a6;return db['VtigerConfiguration'][_0xa336('0x50')]({'where':{'id':_0x5d4457[_0xa336('0x49')]['id']}})[_0xa336('0x27')](handleEntityNotFound(_0x3d64ff,null))['then'](function(_0x10b373){if(_0x10b373){_0x7d3626=_0x10b373;_0x24e48d[_0xa336('0x32')]=_[_0xa336('0x33')](db['VtigerField'][_0xa336('0x2f')]);_0x24e48d['query']=_[_0xa336('0x33')](_0x5d4457[_0xa336('0x34')]);_0x24e48d[_0xa336('0x35')]=_[_0xa336('0x37')](_0x24e48d[_0xa336('0x32')],_0x24e48d['query']);_0x223480[_0xa336('0x36')]=_['intersection'](_0x24e48d[_0xa336('0x32')],qs['fields'](_0x5d4457[_0xa336('0x34')][_0xa336('0x38')]));_0x223480['attributes']=_0x223480[_0xa336('0x36')][_0xa336('0x39')]?_0x223480[_0xa336('0x36')]:_0x24e48d['model'];_0x223480[_0xa336('0x3c')]=qs[_0xa336('0x3d')](_0x5d4457[_0xa336('0x34')][_0xa336('0x3d')]);_0x223480[_0xa336('0x3e')]=qs[_0xa336('0x35')](_['pick'](_0x5d4457[_0xa336('0x34')],_0x24e48d[_0xa336('0x35')]));if(_0x5d4457['query'][_0xa336('0x40')]){_0x223480['where']=_['merge'](_0x223480[_0xa336('0x3e')],{'$or':_[_0xa336('0x2d')](_0x223480['attributes'],function(_0x3be168){var _0x256d3c={};_0x256d3c[_0x3be168]={'$like':'%'+_0x5d4457[_0xa336('0x34')]['filter']+'%'};return _0x256d3c;})});}_0x223480=_[_0xa336('0x41')]({},_0x223480,_0x5d4457[_0xa336('0x43')]);return _0x7d3626[_0xa336('0x53')](_0x223480);}})[_0xa336('0x27')](function(_0x1ed1d3){if(_0x1ed1d3){_0x12f3a6=_0x1ed1d3[_0xa336('0x39')];if(!_0x5d4457[_0xa336('0x34')]['hasOwnProperty'](_0xa336('0x3b'))){_0x223480['limit']=qs['limit'](_0x5d4457[_0xa336('0x34')][_0xa336('0x20')]);_0x223480[_0xa336('0x1d')]=qs[_0xa336('0x1d')](_0x5d4457['query'][_0xa336('0x1d')]);}return _0x7d3626[_0xa336('0x53')](_0x223480);}})['then'](function(_0x40987f){if(_0x40987f){return _0x40987f?{'count':_0x12f3a6,'rows':_0x40987f}:null;}})[_0xa336('0x27')](respondWithResult(_0x3d64ff,null))[_0xa336('0x4b')](handleError(_0x3d64ff,null));}; \ No newline at end of file +var _0xcb67=['pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','rawAttributes','find','create','body','catch','params','getFields','findOne','VtigerField','nolimit','getSubjects','getDescriptions','eml-format','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','VtigerConfiguration','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where'];(function(_0x2c9b79,_0x7cf58b){var _0x265032=function(_0x188a92){while(--_0x188a92){_0x2c9b79['push'](_0x2c9b79['shift']());}};_0x265032(++_0x7cf58b);}(_0xcb67,0x15f));var _0x7cb6=function(_0x4c321c,_0x3e9da0){_0x4c321c=_0x4c321c-0x0;var _0x25accb=_0xcb67[_0x4c321c];return _0x25accb;};'use strict';var emlformat=require(_0x7cb6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7cb6('0x1'));var rp=require(_0x7cb6('0x2'));var moment=require(_0x7cb6('0x3'));var BPromise=require(_0x7cb6('0x4'));var Mustache=require('mustache');var util=require(_0x7cb6('0x5'));var path=require('path');var sox=require(_0x7cb6('0x6'));var csv=require('to-csv');var ejs=require(_0x7cb6('0x7'));var fs=require('fs');var fs_extra=require(_0x7cb6('0x8'));var _=require('lodash');var squel=require(_0x7cb6('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7cb6('0xa'));var toCsv=require(_0x7cb6('0xb'));var querystring=require(_0x7cb6('0xc'));var Papa=require(_0x7cb6('0xd'));var Redis=require(_0x7cb6('0xe'));var authService=require(_0x7cb6('0xf'));var qs=require(_0x7cb6('0x10'));var as=require(_0x7cb6('0x11'));var hardwareService=require(_0x7cb6('0x12'));var logger=require(_0x7cb6('0x13'))(_0x7cb6('0x14'));var utils=require(_0x7cb6('0x15'));var config=require(_0x7cb6('0x16'));var licenseUtil=require(_0x7cb6('0x17'));var db=require(_0x7cb6('0x18'))['db'];function respondWithStatusCode(_0x5bbd48,_0x518ed7){_0x518ed7=_0x518ed7||0xcc;return function(_0x3a2324){if(_0x3a2324){return _0x5bbd48[_0x7cb6('0x19')](_0x518ed7);}return _0x5bbd48['status'](_0x518ed7)[_0x7cb6('0x1a')]();};}function respondWithResult(_0x451822,_0x503e1f){_0x503e1f=_0x503e1f||0xc8;return function(_0x17af51){if(_0x17af51){return _0x451822[_0x7cb6('0x1b')](_0x503e1f)[_0x7cb6('0x1c')](_0x17af51);}};}function respondWithFilteredResult(_0x144811,_0x2e7bab){return function(_0x32d058){if(_0x32d058){var _0x277a1b=typeof _0x2e7bab[_0x7cb6('0x1d')]===_0x7cb6('0x1e')&&typeof _0x2e7bab['limit']==='undefined';var _0x1f9157=_0x32d058[_0x7cb6('0x1f')];var _0x5d6de9=_0x277a1b?0x0:_0x2e7bab[_0x7cb6('0x1d')];var _0x4421e6=_0x277a1b?_0x32d058['count']:_0x2e7bab[_0x7cb6('0x1d')]+_0x2e7bab[_0x7cb6('0x20')];var _0x3b872e;if(_0x4421e6>=_0x1f9157){_0x4421e6=_0x1f9157;_0x3b872e=0xc8;}else{_0x3b872e=0xce;}_0x144811['status'](_0x3b872e);return _0x144811['set'](_0x7cb6('0x21'),_0x5d6de9+'-'+_0x4421e6+'/'+_0x1f9157)[_0x7cb6('0x1c')](_0x32d058);}return null;};}function patchUpdates(_0x4f6145){return function(_0x1eeaf7){try{jsonpatch['apply'](_0x1eeaf7,_0x4f6145,!![]);}catch(_0x15dc20){return BPromise[_0x7cb6('0x22')](_0x15dc20);}return _0x1eeaf7[_0x7cb6('0x23')]();};}function saveUpdates(_0x5bef48,_0x4baec5){return function(_0x3e0bb5){if(_0x3e0bb5){return _0x3e0bb5[_0x7cb6('0x24')](_0x5bef48)[_0x7cb6('0x25')](function(_0x571b27){return _0x571b27;});}return null;};}function removeEntity(_0x155c19,_0x11d21d){return function(_0x42c179){if(_0x42c179){return _0x42c179[_0x7cb6('0x26')]()[_0x7cb6('0x25')](function(){_0x155c19['status'](0xcc)[_0x7cb6('0x1a')]();});}};}function handleEntityNotFound(_0x1ba53d,_0x4967bd){return function(_0x128f1d){if(!_0x128f1d){_0x1ba53d['sendStatus'](0x194);}return _0x128f1d;};}function handleError(_0x4429ff,_0x2cfa37){_0x2cfa37=_0x2cfa37||0x1f4;return function(_0x4a01b8){logger[_0x7cb6('0x27')](_0x4a01b8[_0x7cb6('0x28')]);if(_0x4a01b8[_0x7cb6('0x29')]){delete _0x4a01b8[_0x7cb6('0x29')];}_0x4429ff[_0x7cb6('0x1b')](_0x2cfa37)[_0x7cb6('0x2a')](_0x4a01b8);};}exports[_0x7cb6('0x2b')]=function(_0x5189d2,_0x15fbb4){var _0x4ea257={},_0x60b879={},_0xc24df0={'count':0x0,'rows':[]};var _0x2279e1=_[_0x7cb6('0x2c')](db[_0x7cb6('0x2d')]['rawAttributes'],function(_0x2bc6d1){return{'name':_0x2bc6d1['fieldName'],'type':_0x2bc6d1['type'][_0x7cb6('0x2e')]};});_0x60b879[_0x7cb6('0x2f')]=_[_0x7cb6('0x2c')](_0x2279e1,'name');_0x60b879[_0x7cb6('0x30')]=_[_0x7cb6('0x31')](_0x5189d2[_0x7cb6('0x30')]);_0x60b879[_0x7cb6('0x32')]=_[_0x7cb6('0x33')](_0x60b879[_0x7cb6('0x2f')],_0x60b879[_0x7cb6('0x30')]);_0x4ea257['attributes']=_[_0x7cb6('0x33')](_0x60b879[_0x7cb6('0x2f')],qs[_0x7cb6('0x34')](_0x5189d2['query']['fields']));_0x4ea257[_0x7cb6('0x35')]=_0x4ea257[_0x7cb6('0x35')][_0x7cb6('0x36')]?_0x4ea257[_0x7cb6('0x35')]:_0x60b879[_0x7cb6('0x2f')];if(!_0x5189d2['query'][_0x7cb6('0x37')]('nolimit')){_0x4ea257[_0x7cb6('0x20')]=qs['limit'](_0x5189d2[_0x7cb6('0x30')]['limit']);_0x4ea257[_0x7cb6('0x1d')]=qs['offset'](_0x5189d2['query'][_0x7cb6('0x1d')]);}_0x4ea257[_0x7cb6('0x38')]=qs['sort'](_0x5189d2[_0x7cb6('0x30')][_0x7cb6('0x39')]);_0x4ea257[_0x7cb6('0x3a')]=qs[_0x7cb6('0x32')](_[_0x7cb6('0x3b')](_0x5189d2['query'],_0x60b879[_0x7cb6('0x32')]),_0x2279e1);if(_0x5189d2['query'][_0x7cb6('0x3c')]){_0x4ea257[_0x7cb6('0x3a')]=_[_0x7cb6('0x3d')](_0x4ea257[_0x7cb6('0x3a')],{'$or':_[_0x7cb6('0x2c')](_0x2279e1,function(_0x5696f0){if(_0x5696f0[_0x7cb6('0x3e')]!==_0x7cb6('0x3f')){var _0x4b4d83={};_0x4b4d83[_0x5696f0[_0x7cb6('0x29')]]={'$like':'%'+_0x5189d2[_0x7cb6('0x30')][_0x7cb6('0x3c')]+'%'};return _0x4b4d83;}})});}_0x4ea257=_[_0x7cb6('0x3d')]({},_0x4ea257,_0x5189d2[_0x7cb6('0x40')]);var _0x4a1b14={'where':_0x4ea257['where']};return db[_0x7cb6('0x2d')][_0x7cb6('0x1f')](_0x4a1b14)[_0x7cb6('0x25')](function(_0x1a37d4){_0xc24df0['count']=_0x1a37d4;if(_0x5189d2[_0x7cb6('0x30')][_0x7cb6('0x41')]){_0x4ea257[_0x7cb6('0x42')]=[{'all':!![]}];}return db[_0x7cb6('0x2d')][_0x7cb6('0x43')](_0x4ea257);})[_0x7cb6('0x25')](function(_0x15e616){_0xc24df0[_0x7cb6('0x44')]=_0x15e616;return _0xc24df0;})[_0x7cb6('0x25')](respondWithFilteredResult(_0x15fbb4,_0x4ea257))['catch'](handleError(_0x15fbb4,null));};exports[_0x7cb6('0x45')]=function(_0x7d90d2,_0x49721b){var _0x2d5a5d={'raw':![],'where':{'id':_0x7d90d2['params']['id']}},_0x4c7dc3={};_0x4c7dc3[_0x7cb6('0x2f')]=_[_0x7cb6('0x31')](db[_0x7cb6('0x2d')][_0x7cb6('0x46')]);_0x4c7dc3['query']=_['keys'](_0x7d90d2[_0x7cb6('0x30')]);_0x4c7dc3[_0x7cb6('0x32')]=_[_0x7cb6('0x33')](_0x4c7dc3[_0x7cb6('0x2f')],_0x4c7dc3[_0x7cb6('0x30')]);_0x2d5a5d[_0x7cb6('0x35')]=_['intersection'](_0x4c7dc3[_0x7cb6('0x2f')],qs[_0x7cb6('0x34')](_0x7d90d2[_0x7cb6('0x30')][_0x7cb6('0x34')]));_0x2d5a5d[_0x7cb6('0x35')]=_0x2d5a5d[_0x7cb6('0x35')][_0x7cb6('0x36')]?_0x2d5a5d[_0x7cb6('0x35')]:_0x4c7dc3[_0x7cb6('0x2f')];if(_0x7d90d2['query'][_0x7cb6('0x41')]){_0x2d5a5d[_0x7cb6('0x42')]=[{'all':!![]}];}_0x2d5a5d=_[_0x7cb6('0x3d')]({},_0x2d5a5d,_0x7d90d2[_0x7cb6('0x40')]);return db[_0x7cb6('0x2d')][_0x7cb6('0x47')](_0x2d5a5d)[_0x7cb6('0x25')](handleEntityNotFound(_0x49721b,null))[_0x7cb6('0x25')](respondWithResult(_0x49721b,null))['catch'](handleError(_0x49721b,null));};exports[_0x7cb6('0x48')]=function(_0x53e026,_0x324264){return db[_0x7cb6('0x2d')][_0x7cb6('0x48')](_0x53e026[_0x7cb6('0x49')],{})['then'](respondWithResult(_0x324264,0xc9))[_0x7cb6('0x4a')](handleError(_0x324264,null));};exports[_0x7cb6('0x24')]=function(_0x186c91,_0x7af663){if(_0x186c91[_0x7cb6('0x49')]['id']){delete _0x186c91[_0x7cb6('0x49')]['id'];}return db[_0x7cb6('0x2d')]['find']({'where':{'id':_0x186c91[_0x7cb6('0x4b')]['id']}})[_0x7cb6('0x25')](handleEntityNotFound(_0x7af663,null))['then'](saveUpdates(_0x186c91[_0x7cb6('0x49')],null))[_0x7cb6('0x25')](respondWithResult(_0x7af663,null))[_0x7cb6('0x4a')](handleError(_0x7af663,null));};exports[_0x7cb6('0x26')]=function(_0x2391b9,_0x56dc26){return db['VtigerConfiguration'][_0x7cb6('0x47')]({'where':{'id':_0x2391b9[_0x7cb6('0x4b')]['id']}})[_0x7cb6('0x25')](handleEntityNotFound(_0x56dc26,null))[_0x7cb6('0x25')](removeEntity(_0x56dc26,null))[_0x7cb6('0x4a')](handleError(_0x56dc26,null));};exports[_0x7cb6('0x4c')]=function(_0x4dad08,_0x39c4cf,_0x1ffa0a){var _0x39f20d={};var _0x285799={};var _0x260309;var _0x4cd8c0;return db[_0x7cb6('0x2d')][_0x7cb6('0x4d')]({'where':{'id':_0x4dad08[_0x7cb6('0x4b')]['id']}})[_0x7cb6('0x25')](handleEntityNotFound(_0x39c4cf,null))[_0x7cb6('0x25')](function(_0x27e185){if(_0x27e185){_0x260309=_0x27e185;_0x285799[_0x7cb6('0x2f')]=_['keys'](db[_0x7cb6('0x4e')]['rawAttributes']);_0x285799[_0x7cb6('0x30')]=_[_0x7cb6('0x31')](_0x4dad08[_0x7cb6('0x30')]);_0x285799[_0x7cb6('0x32')]=_[_0x7cb6('0x33')](_0x285799[_0x7cb6('0x2f')],_0x285799[_0x7cb6('0x30')]);_0x39f20d[_0x7cb6('0x35')]=_[_0x7cb6('0x33')](_0x285799[_0x7cb6('0x2f')],qs[_0x7cb6('0x34')](_0x4dad08[_0x7cb6('0x30')][_0x7cb6('0x34')]));_0x39f20d[_0x7cb6('0x35')]=_0x39f20d[_0x7cb6('0x35')]['length']?_0x39f20d[_0x7cb6('0x35')]:_0x285799[_0x7cb6('0x2f')];_0x39f20d['order']=qs['sort'](_0x4dad08['query'][_0x7cb6('0x39')]);_0x39f20d['where']=qs['filters'](_[_0x7cb6('0x3b')](_0x4dad08['query'],_0x285799[_0x7cb6('0x32')]));if(_0x4dad08[_0x7cb6('0x30')][_0x7cb6('0x3c')]){_0x39f20d[_0x7cb6('0x3a')]=_[_0x7cb6('0x3d')](_0x39f20d[_0x7cb6('0x3a')],{'$or':_[_0x7cb6('0x2c')](_0x39f20d['attributes'],function(_0x1ee76a){var _0x35628a={};_0x35628a[_0x1ee76a]={'$like':'%'+_0x4dad08['query']['filter']+'%'};return _0x35628a;})});}_0x39f20d=_[_0x7cb6('0x3d')]({},_0x39f20d,_0x4dad08['options']);return _0x260309[_0x7cb6('0x4c')](_0x39f20d);}})[_0x7cb6('0x25')](function(_0x12e570){if(_0x12e570){_0x4cd8c0=_0x12e570['length'];if(!_0x4dad08['query']['hasOwnProperty'](_0x7cb6('0x4f'))){_0x39f20d['limit']=qs['limit'](_0x4dad08['query'][_0x7cb6('0x20')]);_0x39f20d[_0x7cb6('0x1d')]=qs['offset'](_0x4dad08[_0x7cb6('0x30')]['offset']);}return _0x260309[_0x7cb6('0x4c')](_0x39f20d);}})[_0x7cb6('0x25')](function(_0x3f23de){if(_0x3f23de){return _0x3f23de?{'count':_0x4cd8c0,'rows':_0x3f23de}:null;}})[_0x7cb6('0x25')](respondWithResult(_0x39c4cf,null))['catch'](handleError(_0x39c4cf,null));};exports[_0x7cb6('0x50')]=function(_0x3516d3,_0x1eb0f5,_0x25dca0){var _0x53b63a={};var _0x3f4d61={};var _0x353ec6;var _0x2e0241;return db[_0x7cb6('0x2d')]['findOne']({'where':{'id':_0x3516d3[_0x7cb6('0x4b')]['id']}})[_0x7cb6('0x25')](handleEntityNotFound(_0x1eb0f5,null))[_0x7cb6('0x25')](function(_0x57be14){if(_0x57be14){_0x353ec6=_0x57be14;_0x3f4d61[_0x7cb6('0x2f')]=_[_0x7cb6('0x31')](db['VtigerField']['rawAttributes']);_0x3f4d61['query']=_['keys'](_0x3516d3['query']);_0x3f4d61[_0x7cb6('0x32')]=_[_0x7cb6('0x33')](_0x3f4d61[_0x7cb6('0x2f')],_0x3f4d61[_0x7cb6('0x30')]);_0x53b63a[_0x7cb6('0x35')]=_[_0x7cb6('0x33')](_0x3f4d61[_0x7cb6('0x2f')],qs['fields'](_0x3516d3[_0x7cb6('0x30')][_0x7cb6('0x34')]));_0x53b63a[_0x7cb6('0x35')]=_0x53b63a[_0x7cb6('0x35')]['length']?_0x53b63a[_0x7cb6('0x35')]:_0x3f4d61['model'];_0x53b63a[_0x7cb6('0x38')]=qs['sort'](_0x3516d3[_0x7cb6('0x30')]['sort']);_0x53b63a[_0x7cb6('0x3a')]=qs[_0x7cb6('0x32')](_[_0x7cb6('0x3b')](_0x3516d3['query'],_0x3f4d61[_0x7cb6('0x32')]));if(_0x3516d3[_0x7cb6('0x30')][_0x7cb6('0x3c')]){_0x53b63a[_0x7cb6('0x3a')]=_['merge'](_0x53b63a['where'],{'$or':_[_0x7cb6('0x2c')](_0x53b63a[_0x7cb6('0x35')],function(_0x37e146){var _0x5450b5={};_0x5450b5[_0x37e146]={'$like':'%'+_0x3516d3[_0x7cb6('0x30')]['filter']+'%'};return _0x5450b5;})});}_0x53b63a=_[_0x7cb6('0x3d')]({},_0x53b63a,_0x3516d3[_0x7cb6('0x40')]);return _0x353ec6[_0x7cb6('0x50')](_0x53b63a);}})[_0x7cb6('0x25')](function(_0x4f5e7a){if(_0x4f5e7a){_0x2e0241=_0x4f5e7a[_0x7cb6('0x36')];if(!_0x3516d3[_0x7cb6('0x30')][_0x7cb6('0x37')](_0x7cb6('0x4f'))){_0x53b63a[_0x7cb6('0x20')]=qs['limit'](_0x3516d3[_0x7cb6('0x30')][_0x7cb6('0x20')]);_0x53b63a['offset']=qs[_0x7cb6('0x1d')](_0x3516d3[_0x7cb6('0x30')][_0x7cb6('0x1d')]);}return _0x353ec6['getSubjects'](_0x53b63a);}})['then'](function(_0x240619){if(_0x240619){return _0x240619?{'count':_0x2e0241,'rows':_0x240619}:null;}})[_0x7cb6('0x25')](respondWithResult(_0x1eb0f5,null))[_0x7cb6('0x4a')](handleError(_0x1eb0f5,null));};exports[_0x7cb6('0x51')]=function(_0x2fd4c0,_0x285b59,_0x119164){var _0x35b810={};var _0x5f2a3f={};var _0x60c9b9;var _0xd4f6fc;return db[_0x7cb6('0x2d')]['findOne']({'where':{'id':_0x2fd4c0[_0x7cb6('0x4b')]['id']}})[_0x7cb6('0x25')](handleEntityNotFound(_0x285b59,null))['then'](function(_0x3f76f0){if(_0x3f76f0){_0x60c9b9=_0x3f76f0;_0x5f2a3f[_0x7cb6('0x2f')]=_['keys'](db['VtigerField'][_0x7cb6('0x46')]);_0x5f2a3f[_0x7cb6('0x30')]=_[_0x7cb6('0x31')](_0x2fd4c0['query']);_0x5f2a3f[_0x7cb6('0x32')]=_['intersection'](_0x5f2a3f[_0x7cb6('0x2f')],_0x5f2a3f['query']);_0x35b810[_0x7cb6('0x35')]=_[_0x7cb6('0x33')](_0x5f2a3f[_0x7cb6('0x2f')],qs[_0x7cb6('0x34')](_0x2fd4c0[_0x7cb6('0x30')][_0x7cb6('0x34')]));_0x35b810[_0x7cb6('0x35')]=_0x35b810['attributes'][_0x7cb6('0x36')]?_0x35b810[_0x7cb6('0x35')]:_0x5f2a3f[_0x7cb6('0x2f')];_0x35b810[_0x7cb6('0x38')]=qs[_0x7cb6('0x39')](_0x2fd4c0['query'][_0x7cb6('0x39')]);_0x35b810[_0x7cb6('0x3a')]=qs[_0x7cb6('0x32')](_['pick'](_0x2fd4c0['query'],_0x5f2a3f[_0x7cb6('0x32')]));if(_0x2fd4c0[_0x7cb6('0x30')][_0x7cb6('0x3c')]){_0x35b810[_0x7cb6('0x3a')]=_[_0x7cb6('0x3d')](_0x35b810['where'],{'$or':_['map'](_0x35b810['attributes'],function(_0x5c1f17){var _0x9ba7a4={};_0x9ba7a4[_0x5c1f17]={'$like':'%'+_0x2fd4c0[_0x7cb6('0x30')][_0x7cb6('0x3c')]+'%'};return _0x9ba7a4;})});}_0x35b810=_[_0x7cb6('0x3d')]({},_0x35b810,_0x2fd4c0[_0x7cb6('0x40')]);return _0x60c9b9[_0x7cb6('0x51')](_0x35b810);}})['then'](function(_0x444498){if(_0x444498){_0xd4f6fc=_0x444498[_0x7cb6('0x36')];if(!_0x2fd4c0[_0x7cb6('0x30')][_0x7cb6('0x37')](_0x7cb6('0x4f'))){_0x35b810[_0x7cb6('0x20')]=qs[_0x7cb6('0x20')](_0x2fd4c0['query'][_0x7cb6('0x20')]);_0x35b810[_0x7cb6('0x1d')]=qs[_0x7cb6('0x1d')](_0x2fd4c0[_0x7cb6('0x30')][_0x7cb6('0x1d')]);}return _0x60c9b9[_0x7cb6('0x51')](_0x35b810);}})[_0x7cb6('0x25')](function(_0x21de37){if(_0x21de37){return _0x21de37?{'count':_0xd4f6fc,'rows':_0x21de37}:null;}})[_0x7cb6('0x25')](respondWithResult(_0x285b59,null))[_0x7cb6('0x4a')](handleError(_0x285b59,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index d646d80..1552253 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 _0x4f47=['int_vtiger_configurations','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define'];(function(_0x1bdc52,_0x4876a9){var _0xdf3fa3=function(_0x2a3ba4){while(--_0x2a3ba4){_0x1bdc52['push'](_0x1bdc52['shift']());}};_0xdf3fa3(++_0x4876a9);}(_0x4f47,0xdd));var _0x74f4=function(_0x36fd33,_0x319480){_0x36fd33=_0x36fd33-0x0;var _0x50b53d=_0x4f47[_0x36fd33];return _0x50b53d;};'use strict';var _=require(_0x74f4('0x0'));var util=require(_0x74f4('0x1'));var logger=require(_0x74f4('0x2'))('api');var moment=require('moment');var BPromise=require(_0x74f4('0x3'));var rp=require(_0x74f4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x74f4('0x5'));var config=require(_0x74f4('0x6'));var attributes=require(_0x74f4('0x7'));module[_0x74f4('0x8')]=function(_0x15580a,_0x4b86fd){return _0x15580a[_0x74f4('0x9')]('VtigerConfiguration',attributes,{'tableName':_0x74f4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0dc4=['request-promise','path','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4bc7f0,_0x7987a1){var _0x25d0e7=function(_0x5d0d35){while(--_0x5d0d35){_0x4bc7f0['push'](_0x4bc7f0['shift']());}};_0x25d0e7(++_0x7987a1);}(_0x0dc4,0xe8));var _0x40dc=function(_0x3399bb,_0x5e7c53){_0x3399bb=_0x3399bb-0x0;var _0x1afd51=_0x0dc4[_0x3399bb];return _0x1afd51;};'use strict';var _=require(_0x40dc('0x0'));var util=require(_0x40dc('0x1'));var logger=require(_0x40dc('0x2'))(_0x40dc('0x3'));var moment=require(_0x40dc('0x4'));var BPromise=require(_0x40dc('0x5'));var rp=require(_0x40dc('0x6'));var fs=require('fs');var path=require(_0x40dc('0x7'));var rimraf=require('rimraf');var config=require(_0x40dc('0x8'));var attributes=require(_0x40dc('0x9'));module[_0x40dc('0xa')]=function(_0x85ad62,_0xda53f2){return _0x85ad62[_0x40dc('0xb')](_0x40dc('0xc'),attributes,{'tableName':_0x40dc('0xd'),'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 563921d..1eba207 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 _0x9661=['debug','code','error','message','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x1763be,_0x46a5c9){var _0x57f21a=function(_0x25d156){while(--_0x25d156){_0x1763be['push'](_0x1763be['shift']());}};_0x57f21a(++_0x46a5c9);}(_0x9661,0x155));var _0x1966=function(_0x920b46,_0x1956c4){_0x920b46=_0x920b46-0x0;var _0x3cfb1d=_0x9661[_0x920b46];return _0x3cfb1d;};'use strict';var _=require(_0x1966('0x0'));var util=require('util');var moment=require(_0x1966('0x1'));var BPromise=require(_0x1966('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1966('0x3'));var db=require(_0x1966('0x4'))['db'];var utils=require(_0x1966('0x5'));var logger=require(_0x1966('0x6'))('rpc');var config=require(_0x1966('0x7'));var jayson=require(_0x1966('0x8'));var client=jayson[_0x1966('0x9')][_0x1966('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1dae6b,_0x554385,_0x170297){return new BPromise(function(_0x5cbf1a,_0x529122){return client[_0x1966('0xb')](_0x1dae6b,_0x170297)[_0x1966('0xc')](function(_0x4ab8fa){logger[_0x1966('0xd')](_0x1966('0xe'),_0x554385,_0x1966('0xf'));logger[_0x1966('0x10')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x554385,_0x1966('0xf'),JSON['stringify'](_0x4ab8fa));if(_0x4ab8fa['error']){if(_0x4ab8fa['error'][_0x1966('0x11')]===0x1f4){logger[_0x1966('0x12')](_0x1966('0xe'),_0x554385,_0x4ab8fa[_0x1966('0x12')][_0x1966('0x13')]);return _0x529122(_0x4ab8fa[_0x1966('0x12')]['message']);}logger[_0x1966('0x12')](_0x1966('0xe'),_0x554385,_0x4ab8fa[_0x1966('0x12')]['message']);return _0x5cbf1a(_0x4ab8fa[_0x1966('0x12')][_0x1966('0x13')]);}else{logger[_0x1966('0xd')](_0x1966('0xe'),_0x554385,_0x1966('0xf'));_0x5cbf1a(_0x4ab8fa[_0x1966('0x14')][_0x1966('0x13')]);}})['catch'](function(_0x2eeb00){logger['error'](_0x1966('0xe'),_0x554385,_0x2eeb00);_0x529122(_0x2eeb00);});});} \ No newline at end of file +var _0x5935=['request\x20sent','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x431ed2,_0x4f6213){var _0x168fb6=function(_0x3d63b9){while(--_0x3d63b9){_0x431ed2['push'](_0x431ed2['shift']());}};_0x168fb6(++_0x4f6213);}(_0x5935,0x13b));var _0x5593=function(_0x2d89ce,_0x24d58d){_0x2d89ce=_0x2d89ce-0x0;var _0x3fad10=_0x5935[_0x2d89ce];return _0x3fad10;};'use strict';var _=require(_0x5593('0x0'));var util=require('util');var moment=require(_0x5593('0x1'));var BPromise=require(_0x5593('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5593('0x3'));var db=require(_0x5593('0x4'))['db'];var utils=require(_0x5593('0x5'));var logger=require(_0x5593('0x6'))(_0x5593('0x7'));var config=require(_0x5593('0x8'));var jayson=require(_0x5593('0x9'));var client=jayson[_0x5593('0xa')][_0x5593('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x579d73,_0x28540e,_0x19bb18){return new BPromise(function(_0x2ff54c,_0x543be3){return client['request'](_0x579d73,_0x19bb18)[_0x5593('0xc')](function(_0xa836d7){logger[_0x5593('0xd')](_0x5593('0xe'),_0x28540e,'request\x20sent');logger[_0x5593('0xf')](_0x5593('0x10'),_0x28540e,'request\x20sent',JSON[_0x5593('0x11')](_0xa836d7));if(_0xa836d7[_0x5593('0x12')]){if(_0xa836d7['error'][_0x5593('0x13')]===0x1f4){logger[_0x5593('0x12')](_0x5593('0xe'),_0x28540e,_0xa836d7[_0x5593('0x12')][_0x5593('0x14')]);return _0x543be3(_0xa836d7[_0x5593('0x12')][_0x5593('0x14')]);}logger[_0x5593('0x12')](_0x5593('0xe'),_0x28540e,_0xa836d7[_0x5593('0x12')]['message']);return _0x2ff54c(_0xa836d7[_0x5593('0x12')][_0x5593('0x14')]);}else{logger['info'](_0x5593('0xe'),_0x28540e,_0x5593('0x15'));_0x2ff54c(_0xa836d7[_0x5593('0x16')][_0x5593('0x14')]);}})[_0x5593('0x17')](function(_0x3ec86a){logger[_0x5593('0x12')](_0x5593('0xe'),_0x28540e,_0x3ec86a);_0x543be3(_0x3ec86a);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 8d1788e..12fc018 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 _0xd53b=['connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','put','update','exports','multer','util','path'];(function(_0x470699,_0x385be3){var _0x222aa2=function(_0x4bc93a){while(--_0x4bc93a){_0x470699['push'](_0x470699['shift']());}};_0x222aa2(++_0x385be3);}(_0xd53b,0x11d));var _0xbd53=function(_0x2419d4,_0x24a840){_0x2419d4=_0x2419d4-0x0;var _0x257551=_0xd53b[_0x2419d4];return _0x257551;};'use strict';var multer=require(_0xbd53('0x0'));var util=require(_0xbd53('0x1'));var path=require(_0xbd53('0x2'));var timeout=require(_0xbd53('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xbd53('0x4'));var auth=require(_0xbd53('0x5'));var interaction=require(_0xbd53('0x6'));var config=require(_0xbd53('0x7'));var controller=require('./intVtigerField.controller');router[_0xbd53('0x8')]('/',auth[_0xbd53('0x9')](),controller['index']);router[_0xbd53('0x8')](_0xbd53('0xa'),auth[_0xbd53('0x9')](),controller[_0xbd53('0xb')]);router[_0xbd53('0xc')]('/',auth[_0xbd53('0x9')](),controller['create']);router[_0xbd53('0xd')](_0xbd53('0xa'),auth[_0xbd53('0x9')](),controller[_0xbd53('0xe')]);router['delete'](_0xbd53('0xa'),auth[_0xbd53('0x9')](),controller['destroy']);module[_0xbd53('0xf')]=router; \ No newline at end of file +var _0x53cf=['Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','post','create','put','delete','/:id','exports','connect-timeout','express'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0x53cf,0x116));var _0xf53c=function(_0x4a3b6c,_0x4abd5d){_0x4a3b6c=_0x4a3b6c-0x0;var _0x4895d4=_0x53cf[_0x4a3b6c];return _0x4895d4;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xf53c('0x0'));var express=require(_0xf53c('0x1'));var router=express[_0xf53c('0x2')]();var fs_extra=require(_0xf53c('0x3'));var auth=require(_0xf53c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf53c('0x5'));var controller=require('./intVtigerField.controller');router[_0xf53c('0x6')]('/',auth[_0xf53c('0x7')](),controller['index']);router[_0xf53c('0x6')]('/:id',auth[_0xf53c('0x7')](),controller['show']);router[_0xf53c('0x8')]('/',auth['isAuthenticated'](),controller[_0xf53c('0x9')]);router[_0xf53c('0xa')]('/:id',auth[_0xf53c('0x7')](),controller['update']);router[_0xf53c('0xb')](_0xf53c('0xc'),auth[_0xf53c('0x7')](),controller['destroy']);module[_0xf53c('0xd')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 41bdbc9..b74fefe 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 _0xbc40=['sequelize','ENUM','string','customVariable','keyValue','picklist','STRING','variable'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0xbc40,0x1d0));var _0x0bc4=function(_0x3c2601,_0x4fc5a9){_0x3c2601=_0x3c2601-0x0;var _0x315b13=_0xbc40[_0x3c2601];return _0x315b13;};'use strict';var Sequelize=require(_0x0bc4('0x0'));module['exports']={'type':{'type':Sequelize[_0x0bc4('0x1')](_0x0bc4('0x2'),'variable',_0x0bc4('0x3'),_0x0bc4('0x4'),_0x0bc4('0x5')),'defaultValue':_0x0bc4('0x2')},'content':{'type':Sequelize[_0x0bc4('0x6')]},'key':{'type':Sequelize[_0x0bc4('0x6')]},'keyType':{'type':Sequelize[_0x0bc4('0x1')](_0x0bc4('0x2'),_0x0bc4('0x7'),'customVariable')},'keyContent':{'type':Sequelize[_0x0bc4('0x6')]},'idField':{'type':Sequelize[_0x0bc4('0x6')]},'nameField':{'type':Sequelize[_0x0bc4('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0bc4('0x6')]}}; \ No newline at end of file +var _0x4745=['keyValue','picklist','string','STRING','BOOLEAN','sequelize','exports','variable','customVariable'];(function(_0x5b0043,_0xb3ac9a){var _0x14da2d=function(_0x514e0b){while(--_0x514e0b){_0x5b0043['push'](_0x5b0043['shift']());}};_0x14da2d(++_0xb3ac9a);}(_0x4745,0x68));var _0x5474=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x4745[_0x92c450];return _0x2a9599;};'use strict';var Sequelize=require(_0x5474('0x0'));module[_0x5474('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x5474('0x2'),_0x5474('0x3'),_0x5474('0x4'),_0x5474('0x5')),'defaultValue':_0x5474('0x6')},'content':{'type':Sequelize[_0x5474('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x5474('0x6'),_0x5474('0x2'),_0x5474('0x3'))},'keyContent':{'type':Sequelize[_0x5474('0x7')]},'idField':{'type':Sequelize[_0x5474('0x7')]},'nameField':{'type':Sequelize[_0x5474('0x7')]},'customField':{'type':Sequelize[_0x5474('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5474('0x7')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 4723de0..cadf7f0 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 _0x0ad0=['bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','VtigerField','rawAttributes','fieldName','map','query','keys','filters','model','attributes','intersection','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','fields','length','find','create','rimraf','moment'];(function(_0x433948,_0x2f1391){var _0x11c296=function(_0x4566e4){while(--_0x4566e4){_0x433948['push'](_0x433948['shift']());}};_0x11c296(++_0x2f1391);}(_0x0ad0,0x126));var _0x00ad=function(_0x37d17f,_0x178a30){_0x37d17f=_0x37d17f-0x0;var _0x250848=_0x0ad0[_0x37d17f];return _0x250848;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x00ad('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x00ad('0x1'));var BPromise=require(_0x00ad('0x2'));var Mustache=require(_0x00ad('0x3'));var util=require(_0x00ad('0x4'));var path=require('path');var sox=require(_0x00ad('0x5'));var csv=require(_0x00ad('0x6'));var ejs=require(_0x00ad('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x00ad('0x8'));var squel=require(_0x00ad('0x9'));var crypto=require(_0x00ad('0xa'));var jsforce=require(_0x00ad('0xb'));var deskjs=require(_0x00ad('0xc'));var toCsv=require(_0x00ad('0x6'));var querystring=require(_0x00ad('0xd'));var Papa=require(_0x00ad('0xe'));var Redis=require(_0x00ad('0xf'));var authService=require(_0x00ad('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x00ad('0x11'));var hardwareService=require(_0x00ad('0x12'));var logger=require(_0x00ad('0x13'))('api');var utils=require(_0x00ad('0x14'));var config=require(_0x00ad('0x15'));var licenseUtil=require(_0x00ad('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x7c7377,_0x2bb694){_0x2bb694=_0x2bb694||0xcc;return function(_0x5d3773){if(_0x5d3773){return _0x7c7377[_0x00ad('0x17')](_0x2bb694);}return _0x7c7377[_0x00ad('0x18')](_0x2bb694)[_0x00ad('0x19')]();};}function respondWithResult(_0x3b34fb,_0x1cead9){_0x1cead9=_0x1cead9||0xc8;return function(_0x3feae8){if(_0x3feae8){return _0x3b34fb['status'](_0x1cead9)['json'](_0x3feae8);}};}function respondWithFilteredResult(_0x5c25b1,_0x3a0013){return function(_0xc86335){if(_0xc86335){var _0x12009c=typeof _0x3a0013[_0x00ad('0x1a')]===_0x00ad('0x1b')&&typeof _0x3a0013[_0x00ad('0x1c')]==='undefined';var _0x5721fe=_0xc86335['count'];var _0x3c90c4=_0x12009c?0x0:_0x3a0013['offset'];var _0x11895d=_0x12009c?_0xc86335[_0x00ad('0x1d')]:_0x3a0013[_0x00ad('0x1a')]+_0x3a0013[_0x00ad('0x1c')];var _0x2dc94f;if(_0x11895d>=_0x5721fe){_0x11895d=_0x5721fe;_0x2dc94f=0xc8;}else{_0x2dc94f=0xce;}_0x5c25b1[_0x00ad('0x18')](_0x2dc94f);return _0x5c25b1[_0x00ad('0x1e')](_0x00ad('0x1f'),_0x3c90c4+'-'+_0x11895d+'/'+_0x5721fe)[_0x00ad('0x20')](_0xc86335);}return null;};}function patchUpdates(_0x287200){return function(_0x1c566f){try{jsonpatch[_0x00ad('0x21')](_0x1c566f,_0x287200,!![]);}catch(_0x2cde07){return BPromise[_0x00ad('0x22')](_0x2cde07);}return _0x1c566f[_0x00ad('0x23')]();};}function saveUpdates(_0x26d3b3,_0x24f44f){return function(_0x5e2b48){if(_0x5e2b48){return _0x5e2b48[_0x00ad('0x24')](_0x26d3b3)[_0x00ad('0x25')](function(_0x51c86b){return _0x51c86b;});}return null;};}function removeEntity(_0x41f0e7,_0x36c16c){return function(_0x56806c){if(_0x56806c){return _0x56806c[_0x00ad('0x26')]()[_0x00ad('0x25')](function(){_0x41f0e7[_0x00ad('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1180e3,_0x27c9f5){return function(_0x3fe6a5){if(!_0x3fe6a5){_0x1180e3[_0x00ad('0x17')](0x194);}return _0x3fe6a5;};}function handleError(_0x419377,_0x36b42d){_0x36b42d=_0x36b42d||0x1f4;return function(_0x21b1f1){logger[_0x00ad('0x27')](_0x21b1f1[_0x00ad('0x28')]);if(_0x21b1f1[_0x00ad('0x29')]){delete _0x21b1f1[_0x00ad('0x29')];}_0x419377[_0x00ad('0x18')](_0x36b42d)[_0x00ad('0x2a')](_0x21b1f1);};}exports[_0x00ad('0x2b')]=function(_0x235129,_0x45dbb5){var _0x13b533={},_0x4604cb={},_0x1c33bb={'count':0x0,'rows':[]};var _0x2b25f8=_['map'](db[_0x00ad('0x2c')][_0x00ad('0x2d')],function(_0x19a461){return{'name':_0x19a461[_0x00ad('0x2e')],'type':_0x19a461['type']['key']};});_0x4604cb['model']=_[_0x00ad('0x2f')](_0x2b25f8,_0x00ad('0x29'));_0x4604cb[_0x00ad('0x30')]=_[_0x00ad('0x31')](_0x235129[_0x00ad('0x30')]);_0x4604cb[_0x00ad('0x32')]=_['intersection'](_0x4604cb[_0x00ad('0x33')],_0x4604cb[_0x00ad('0x30')]);_0x13b533[_0x00ad('0x34')]=_[_0x00ad('0x35')](_0x4604cb[_0x00ad('0x33')],qs['fields'](_0x235129[_0x00ad('0x30')]['fields']));_0x13b533['attributes']=_0x13b533[_0x00ad('0x34')]['length']?_0x13b533[_0x00ad('0x34')]:_0x4604cb[_0x00ad('0x33')];if(!_0x235129['query'][_0x00ad('0x36')]('nolimit')){_0x13b533[_0x00ad('0x1c')]=qs[_0x00ad('0x1c')](_0x235129[_0x00ad('0x30')][_0x00ad('0x1c')]);_0x13b533[_0x00ad('0x1a')]=qs['offset'](_0x235129[_0x00ad('0x30')][_0x00ad('0x1a')]);}_0x13b533[_0x00ad('0x37')]=qs[_0x00ad('0x38')](_0x235129[_0x00ad('0x30')][_0x00ad('0x38')]);_0x13b533[_0x00ad('0x39')]=qs[_0x00ad('0x32')](_[_0x00ad('0x3a')](_0x235129[_0x00ad('0x30')],_0x4604cb['filters']),_0x2b25f8);if(_0x235129[_0x00ad('0x30')][_0x00ad('0x3b')]){_0x13b533['where']=_[_0x00ad('0x3c')](_0x13b533['where'],{'$or':_[_0x00ad('0x2f')](_0x2b25f8,function(_0x29cc7d){if(_0x29cc7d[_0x00ad('0x3d')]!==_0x00ad('0x3e')){var _0x5ed100={};_0x5ed100[_0x29cc7d[_0x00ad('0x29')]]={'$like':'%'+_0x235129[_0x00ad('0x30')]['filter']+'%'};return _0x5ed100;}})});}_0x13b533=_[_0x00ad('0x3c')]({},_0x13b533,_0x235129[_0x00ad('0x3f')]);var _0x4cce3e={'where':_0x13b533[_0x00ad('0x39')]};return db[_0x00ad('0x2c')]['count'](_0x4cce3e)[_0x00ad('0x25')](function(_0x31dc67){_0x1c33bb['count']=_0x31dc67;if(_0x235129[_0x00ad('0x30')][_0x00ad('0x40')]){_0x13b533[_0x00ad('0x41')]=[{'all':!![]}];}return db['VtigerField'][_0x00ad('0x42')](_0x13b533);})[_0x00ad('0x25')](function(_0xc37655){_0x1c33bb['rows']=_0xc37655;return _0x1c33bb;})[_0x00ad('0x25')](respondWithFilteredResult(_0x45dbb5,_0x13b533))[_0x00ad('0x43')](handleError(_0x45dbb5,null));};exports[_0x00ad('0x44')]=function(_0x15547c,_0x25ac32){var _0x410c2d={'raw':!![],'where':{'id':_0x15547c[_0x00ad('0x45')]['id']}},_0x22a1b6={};_0x22a1b6['model']=_[_0x00ad('0x31')](db[_0x00ad('0x2c')][_0x00ad('0x2d')]);_0x22a1b6[_0x00ad('0x30')]=_[_0x00ad('0x31')](_0x15547c[_0x00ad('0x30')]);_0x22a1b6['filters']=_['intersection'](_0x22a1b6[_0x00ad('0x33')],_0x22a1b6[_0x00ad('0x30')]);_0x410c2d[_0x00ad('0x34')]=_['intersection'](_0x22a1b6['model'],qs[_0x00ad('0x46')](_0x15547c[_0x00ad('0x30')][_0x00ad('0x46')]));_0x410c2d[_0x00ad('0x34')]=_0x410c2d[_0x00ad('0x34')][_0x00ad('0x47')]?_0x410c2d[_0x00ad('0x34')]:_0x22a1b6[_0x00ad('0x33')];if(_0x15547c['query']['includeAll']){_0x410c2d[_0x00ad('0x41')]=[{'all':!![]}];}_0x410c2d=_['merge']({},_0x410c2d,_0x15547c[_0x00ad('0x3f')]);return db[_0x00ad('0x2c')][_0x00ad('0x48')](_0x410c2d)['then'](handleEntityNotFound(_0x25ac32,null))[_0x00ad('0x25')](respondWithResult(_0x25ac32,null))[_0x00ad('0x43')](handleError(_0x25ac32,null));};exports[_0x00ad('0x49')]=function(_0x35b5ab,_0x4fffe4){return db[_0x00ad('0x2c')][_0x00ad('0x49')](_0x35b5ab['body'],{})[_0x00ad('0x25')](respondWithResult(_0x4fffe4,0xc9))['catch'](handleError(_0x4fffe4,null));};exports[_0x00ad('0x24')]=function(_0x1fe74e,_0x4f40ec){if(_0x1fe74e['body']['id']){delete _0x1fe74e['body']['id'];}return db['VtigerField'][_0x00ad('0x48')]({'where':{'id':_0x1fe74e['params']['id']}})[_0x00ad('0x25')](handleEntityNotFound(_0x4f40ec,null))['then'](saveUpdates(_0x1fe74e['body'],null))[_0x00ad('0x25')](respondWithResult(_0x4f40ec,null))['catch'](handleError(_0x4f40ec,null));};exports['destroy']=function(_0x245c26,_0x5db802){return db[_0x00ad('0x2c')]['find']({'where':{'id':_0x245c26[_0x00ad('0x45')]['id']}})[_0x00ad('0x25')](handleEntityNotFound(_0x5db802,null))[_0x00ad('0x25')](removeEntity(_0x5db802,null))['catch'](handleError(_0x5db802,null));}; \ No newline at end of file +var _0xffca=['api','../../config/utils','../../mysqldb','end','status','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','VtigerField','rawAttributes','fieldName','type','key','model','query','keys','filters','fields','length','attributes','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','intersection','find','catch','create','body','eml-format','zip-dir','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xffca,0x7f));var _0xaffc=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xffca[_0x53ccf2];return _0x5a2964;};'use strict';var emlformat=require(_0xaffc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaffc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xaffc('0x2'));var BPromise=require(_0xaffc('0x3'));var Mustache=require(_0xaffc('0x4'));var util=require('util');var path=require(_0xaffc('0x5'));var sox=require(_0xaffc('0x6'));var csv=require(_0xaffc('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaffc('0x8'));var _=require('lodash');var squel=require(_0xaffc('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xaffc('0xa'));var toCsv=require(_0xaffc('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xaffc('0xb'));var authService=require('../../components/auth/service');var qs=require(_0xaffc('0xc'));var as=require(_0xaffc('0xd'));var hardwareService=require(_0xaffc('0xe'));var logger=require('../../config/logger')(_0xaffc('0xf'));var utils=require(_0xaffc('0x10'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaffc('0x11'))['db'];function respondWithStatusCode(_0x12238d,_0x5d496d){_0x5d496d=_0x5d496d||0xcc;return function(_0x5cef6a){if(_0x5cef6a){return _0x12238d['sendStatus'](_0x5d496d);}return _0x12238d['status'](_0x5d496d)[_0xaffc('0x12')]();};}function respondWithResult(_0x57375c,_0x349e2b){_0x349e2b=_0x349e2b||0xc8;return function(_0x3ccb85){if(_0x3ccb85){return _0x57375c[_0xaffc('0x13')](_0x349e2b)['json'](_0x3ccb85);}};}function respondWithFilteredResult(_0x42b0ca,_0x26e589){return function(_0x33f7ef){if(_0x33f7ef){var _0x1a29a4=typeof _0x26e589['offset']===_0xaffc('0x14')&&typeof _0x26e589[_0xaffc('0x15')]===_0xaffc('0x14');var _0x38cc65=_0x33f7ef[_0xaffc('0x16')];var _0x4fbcb4=_0x1a29a4?0x0:_0x26e589['offset'];var _0x590726=_0x1a29a4?_0x33f7ef[_0xaffc('0x16')]:_0x26e589[_0xaffc('0x17')]+_0x26e589[_0xaffc('0x15')];var _0x4c76b9;if(_0x590726>=_0x38cc65){_0x590726=_0x38cc65;_0x4c76b9=0xc8;}else{_0x4c76b9=0xce;}_0x42b0ca[_0xaffc('0x13')](_0x4c76b9);return _0x42b0ca[_0xaffc('0x18')](_0xaffc('0x19'),_0x4fbcb4+'-'+_0x590726+'/'+_0x38cc65)['json'](_0x33f7ef);}return null;};}function patchUpdates(_0x41b30b){return function(_0x3a40ed){try{jsonpatch[_0xaffc('0x1a')](_0x3a40ed,_0x41b30b,!![]);}catch(_0x4eaac3){return BPromise[_0xaffc('0x1b')](_0x4eaac3);}return _0x3a40ed[_0xaffc('0x1c')]();};}function saveUpdates(_0x3f0b04,_0x5759c1){return function(_0x1c6395){if(_0x1c6395){return _0x1c6395[_0xaffc('0x1d')](_0x3f0b04)['then'](function(_0x8890e9){return _0x8890e9;});}return null;};}function removeEntity(_0x3891ac,_0x5e31a1){return function(_0x534cdc){if(_0x534cdc){return _0x534cdc[_0xaffc('0x1e')]()[_0xaffc('0x1f')](function(){_0x3891ac[_0xaffc('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50098f,_0x525a51){return function(_0x380216){if(!_0x380216){_0x50098f[_0xaffc('0x20')](0x194);}return _0x380216;};}function handleError(_0x1bebe5,_0x2df5ad){_0x2df5ad=_0x2df5ad||0x1f4;return function(_0x4d2f0f){logger[_0xaffc('0x21')](_0x4d2f0f[_0xaffc('0x22')]);if(_0x4d2f0f['name']){delete _0x4d2f0f[_0xaffc('0x23')];}_0x1bebe5[_0xaffc('0x13')](_0x2df5ad)[_0xaffc('0x24')](_0x4d2f0f);};}exports[_0xaffc('0x25')]=function(_0xf57722,_0x58dc5e){var _0x2e8349={},_0x476798={},_0x9f1c1f={'count':0x0,'rows':[]};var _0x320920=_[_0xaffc('0x26')](db[_0xaffc('0x27')][_0xaffc('0x28')],function(_0x565584){return{'name':_0x565584[_0xaffc('0x29')],'type':_0x565584[_0xaffc('0x2a')][_0xaffc('0x2b')]};});_0x476798[_0xaffc('0x2c')]=_['map'](_0x320920,'name');_0x476798[_0xaffc('0x2d')]=_[_0xaffc('0x2e')](_0xf57722[_0xaffc('0x2d')]);_0x476798[_0xaffc('0x2f')]=_['intersection'](_0x476798[_0xaffc('0x2c')],_0x476798['query']);_0x2e8349['attributes']=_['intersection'](_0x476798['model'],qs[_0xaffc('0x30')](_0xf57722[_0xaffc('0x2d')][_0xaffc('0x30')]));_0x2e8349['attributes']=_0x2e8349['attributes'][_0xaffc('0x31')]?_0x2e8349[_0xaffc('0x32')]:_0x476798[_0xaffc('0x2c')];if(!_0xf57722[_0xaffc('0x2d')]['hasOwnProperty'](_0xaffc('0x33'))){_0x2e8349['limit']=qs[_0xaffc('0x15')](_0xf57722['query'][_0xaffc('0x15')]);_0x2e8349[_0xaffc('0x17')]=qs['offset'](_0xf57722[_0xaffc('0x2d')][_0xaffc('0x17')]);}_0x2e8349[_0xaffc('0x34')]=qs[_0xaffc('0x35')](_0xf57722[_0xaffc('0x2d')][_0xaffc('0x35')]);_0x2e8349[_0xaffc('0x36')]=qs['filters'](_[_0xaffc('0x37')](_0xf57722[_0xaffc('0x2d')],_0x476798[_0xaffc('0x2f')]),_0x320920);if(_0xf57722[_0xaffc('0x2d')][_0xaffc('0x38')]){_0x2e8349[_0xaffc('0x36')]=_['merge'](_0x2e8349[_0xaffc('0x36')],{'$or':_[_0xaffc('0x26')](_0x320920,function(_0x3e982b){if(_0x3e982b['type']!==_0xaffc('0x39')){var _0x833662={};_0x833662[_0x3e982b[_0xaffc('0x23')]]={'$like':'%'+_0xf57722['query']['filter']+'%'};return _0x833662;}})});}_0x2e8349=_[_0xaffc('0x3a')]({},_0x2e8349,_0xf57722[_0xaffc('0x3b')]);var _0x4327be={'where':_0x2e8349[_0xaffc('0x36')]};return db[_0xaffc('0x27')][_0xaffc('0x16')](_0x4327be)[_0xaffc('0x1f')](function(_0x4695c7){_0x9f1c1f['count']=_0x4695c7;if(_0xf57722['query'][_0xaffc('0x3c')]){_0x2e8349[_0xaffc('0x3d')]=[{'all':!![]}];}return db[_0xaffc('0x27')][_0xaffc('0x3e')](_0x2e8349);})['then'](function(_0x1b86dc){_0x9f1c1f[_0xaffc('0x3f')]=_0x1b86dc;return _0x9f1c1f;})[_0xaffc('0x1f')](respondWithFilteredResult(_0x58dc5e,_0x2e8349))['catch'](handleError(_0x58dc5e,null));};exports[_0xaffc('0x40')]=function(_0x6d17b8,_0x447f6c){var _0x2cd1f8={'raw':!![],'where':{'id':_0x6d17b8[_0xaffc('0x41')]['id']}},_0x58749d={};_0x58749d[_0xaffc('0x2c')]=_['keys'](db[_0xaffc('0x27')][_0xaffc('0x28')]);_0x58749d[_0xaffc('0x2d')]=_['keys'](_0x6d17b8[_0xaffc('0x2d')]);_0x58749d[_0xaffc('0x2f')]=_[_0xaffc('0x42')](_0x58749d[_0xaffc('0x2c')],_0x58749d[_0xaffc('0x2d')]);_0x2cd1f8[_0xaffc('0x32')]=_[_0xaffc('0x42')](_0x58749d[_0xaffc('0x2c')],qs['fields'](_0x6d17b8['query'][_0xaffc('0x30')]));_0x2cd1f8[_0xaffc('0x32')]=_0x2cd1f8[_0xaffc('0x32')][_0xaffc('0x31')]?_0x2cd1f8[_0xaffc('0x32')]:_0x58749d['model'];if(_0x6d17b8['query'][_0xaffc('0x3c')]){_0x2cd1f8['include']=[{'all':!![]}];}_0x2cd1f8=_['merge']({},_0x2cd1f8,_0x6d17b8[_0xaffc('0x3b')]);return db[_0xaffc('0x27')][_0xaffc('0x43')](_0x2cd1f8)[_0xaffc('0x1f')](handleEntityNotFound(_0x447f6c,null))[_0xaffc('0x1f')](respondWithResult(_0x447f6c,null))[_0xaffc('0x44')](handleError(_0x447f6c,null));};exports[_0xaffc('0x45')]=function(_0x5dc70d,_0x15268c){return db[_0xaffc('0x27')][_0xaffc('0x45')](_0x5dc70d[_0xaffc('0x46')],{})[_0xaffc('0x1f')](respondWithResult(_0x15268c,0xc9))['catch'](handleError(_0x15268c,null));};exports['update']=function(_0x4680b7,_0x5c06ff){if(_0x4680b7['body']['id']){delete _0x4680b7[_0xaffc('0x46')]['id'];}return db[_0xaffc('0x27')]['find']({'where':{'id':_0x4680b7[_0xaffc('0x41')]['id']}})[_0xaffc('0x1f')](handleEntityNotFound(_0x5c06ff,null))[_0xaffc('0x1f')](saveUpdates(_0x4680b7[_0xaffc('0x46')],null))[_0xaffc('0x1f')](respondWithResult(_0x5c06ff,null))['catch'](handleError(_0x5c06ff,null));};exports[_0xaffc('0x1e')]=function(_0x3952b0,_0xe5031b){return db['VtigerField'][_0xaffc('0x43')]({'where':{'id':_0x3952b0[_0xaffc('0x41')]['id']}})['then'](handleEntityNotFound(_0xe5031b,null))['then'](removeEntity(_0xe5031b,null))['catch'](handleError(_0xe5031b,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index c36682d..e82ab19 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 _0xb30b=['int_vtiger_fields','lodash','util','api','moment','bluebird','path','../../config/environment','./intVtigerField.attributes','exports','define','VtigerField'];(function(_0x2ed208,_0xb84fa0){var _0x188adf=function(_0x33d7c7){while(--_0x33d7c7){_0x2ed208['push'](_0x2ed208['shift']());}};_0x188adf(++_0xb84fa0);}(_0xb30b,0x139));var _0xbb30=function(_0x51c938,_0x7b322){_0x51c938=_0x51c938-0x0;var _0x4bb8b2=_0xb30b[_0x51c938];return _0x4bb8b2;};'use strict';var _=require(_0xbb30('0x0'));var util=require(_0xbb30('0x1'));var logger=require('../../config/logger')(_0xbb30('0x2'));var moment=require(_0xbb30('0x3'));var BPromise=require(_0xbb30('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb30('0x5'));var rimraf=require('rimraf');var config=require(_0xbb30('0x6'));var attributes=require(_0xbb30('0x7'));module[_0xbb30('0x8')]=function(_0x68e4ac,_0x4c8350){return _0x68e4ac[_0xbb30('0x9')](_0xbb30('0xa'),attributes,{'tableName':_0xbb30('0xb'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x432b=['int_vtiger_fields','vtiger_unique_index','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intVtigerField.attributes','exports','define','VtigerField'];(function(_0x394c8a,_0x2e15fe){var _0x32ae17=function(_0x1b220e){while(--_0x1b220e){_0x394c8a['push'](_0x394c8a['shift']());}};_0x32ae17(++_0x2e15fe);}(_0x432b,0x14d));var _0xb432=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x432b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb432('0x0'));var util=require('util');var logger=require(_0xb432('0x1'))(_0xb432('0x2'));var moment=require(_0xb432('0x3'));var BPromise=require(_0xb432('0x4'));var rp=require(_0xb432('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb432('0x6'));var config=require(_0xb432('0x7'));var attributes=require(_0xb432('0x8'));module[_0xb432('0x9')]=function(_0x3abeac,_0xdcd25c){return _0x3abeac[_0xb432('0xa')](_0xb432('0xb'),attributes,{'tableName':_0xb432('0xc'),'paranoid':![],'indexes':[{'name':_0xb432('0xd'),'fields':['idField',_0xb432('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index 243c2b8..3946e56 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 _0xacc8=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x59b428,_0x137f88){var _0x87c226=function(_0x3598eb){while(--_0x3598eb){_0x59b428['push'](_0x59b428['shift']());}};_0x87c226(++_0x137f88);}(_0xacc8,0xc5));var _0x8acc=function(_0x474e07,_0x223d57){_0x474e07=_0x474e07-0x0;var _0x53f32b=_0xacc8[_0x474e07];return _0x53f32b;};'use strict';var _=require(_0x8acc('0x0'));var util=require('util');var moment=require(_0x8acc('0x1'));var BPromise=require(_0x8acc('0x2'));var rs=require(_0x8acc('0x3'));var fs=require('fs');var Redis=require(_0x8acc('0x4'));var db=require(_0x8acc('0x5'))['db'];var utils=require(_0x8acc('0x6'));var logger=require('../../config/logger')(_0x8acc('0x7'));var config=require(_0x8acc('0x8'));var jayson=require(_0x8acc('0x9'));var client=jayson['client'][_0x8acc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50e0cc,_0x5408f4,_0xa309fa){return new BPromise(function(_0x558546,_0xdf6810){return client['request'](_0x50e0cc,_0xa309fa)[_0x8acc('0xb')](function(_0x393c10){logger['info'](_0x8acc('0xc'),_0x5408f4,_0x8acc('0xd'));logger[_0x8acc('0xe')](_0x8acc('0xf'),_0x5408f4,_0x8acc('0xd'),JSON[_0x8acc('0x10')](_0x393c10));if(_0x393c10[_0x8acc('0x11')]){if(_0x393c10[_0x8acc('0x11')][_0x8acc('0x12')]===0x1f4){logger[_0x8acc('0x11')](_0x8acc('0xc'),_0x5408f4,_0x393c10['error'][_0x8acc('0x13')]);return _0xdf6810(_0x393c10['error'][_0x8acc('0x13')]);}logger[_0x8acc('0x11')]('VtigerField,\x20%s,\x20%s',_0x5408f4,_0x393c10[_0x8acc('0x11')]['message']);return _0x558546(_0x393c10[_0x8acc('0x11')][_0x8acc('0x13')]);}else{logger['info'](_0x8acc('0xc'),_0x5408f4,_0x8acc('0xd'));_0x558546(_0x393c10[_0x8acc('0x14')]['message']);}})[_0x8acc('0x15')](function(_0x696b3d){logger[_0x8acc('0x11')](_0x8acc('0xc'),_0x5408f4,_0x696b3d);_0xdf6810(_0x696b3d);});});} \ No newline at end of file +var _0x2f45=['VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0xcc2d2a,_0x239c5a){var _0x21e735=function(_0x398262){while(--_0x398262){_0xcc2d2a['push'](_0xcc2d2a['shift']());}};_0x21e735(++_0x239c5a);}(_0x2f45,0x18a));var _0x52f4=function(_0x14e280,_0x5a7096){_0x14e280=_0x14e280-0x0;var _0x41f0f8=_0x2f45[_0x14e280];return _0x41f0f8;};'use strict';var _=require(_0x52f4('0x0'));var util=require(_0x52f4('0x1'));var moment=require(_0x52f4('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x52f4('0x3'))['db'];var utils=require(_0x52f4('0x4'));var logger=require(_0x52f4('0x5'))(_0x52f4('0x6'));var config=require(_0x52f4('0x7'));var jayson=require(_0x52f4('0x8'));var client=jayson[_0x52f4('0x9')][_0x52f4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x26e3bf,_0x416987,_0x5ace0c){return new BPromise(function(_0x411dd9,_0x10a21f){return client[_0x52f4('0xb')](_0x26e3bf,_0x5ace0c)[_0x52f4('0xc')](function(_0xd40cf8){logger[_0x52f4('0xd')](_0x52f4('0xe'),_0x416987,_0x52f4('0xf'));logger[_0x52f4('0x10')](_0x52f4('0x11'),_0x416987,_0x52f4('0xf'),JSON[_0x52f4('0x12')](_0xd40cf8));if(_0xd40cf8[_0x52f4('0x13')]){if(_0xd40cf8[_0x52f4('0x13')][_0x52f4('0x14')]===0x1f4){logger[_0x52f4('0x13')]('VtigerField,\x20%s,\x20%s',_0x416987,_0xd40cf8[_0x52f4('0x13')][_0x52f4('0x15')]);return _0x10a21f(_0xd40cf8['error'][_0x52f4('0x15')]);}logger[_0x52f4('0x13')](_0x52f4('0xe'),_0x416987,_0xd40cf8[_0x52f4('0x13')][_0x52f4('0x15')]);return _0x411dd9(_0xd40cf8['error'][_0x52f4('0x15')]);}else{logger[_0x52f4('0xd')]('VtigerField,\x20%s,\x20%s',_0x416987,_0x52f4('0xf'));_0x411dd9(_0xd40cf8[_0x52f4('0x16')][_0x52f4('0x15')]);}})[_0x52f4('0x17')](function(_0xb9fdc){logger[_0x52f4('0x13')](_0x52f4('0xe'),_0x416987,_0xb9fdc);_0x10a21f(_0xb9fdc);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 150820c..fadbdf4 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 _0xd0e0=['./intZendeskAccount.controller','get','index','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','post','addConfiguration','put','delete','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x2bbdc4,_0x2cb88e){var _0x482d0c=function(_0x4da8ce){while(--_0x4da8ce){_0x2bbdc4['push'](_0x2bbdc4['shift']());}};_0x482d0c(++_0x2cb88e);}(_0xd0e0,0x103));var _0x0d0e=function(_0x25d87b,_0x5cd80){_0x25d87b=_0x25d87b-0x0;var _0x1b4bc5=_0xd0e0[_0x25d87b];return _0x1b4bc5;};'use strict';var multer=require(_0x0d0e('0x0'));var util=require(_0x0d0e('0x1'));var path=require('path');var timeout=require(_0x0d0e('0x2'));var express=require(_0x0d0e('0x3'));var router=express[_0x0d0e('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0d0e('0x5'));var config=require(_0x0d0e('0x6'));var controller=require(_0x0d0e('0x7'));router[_0x0d0e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0d0e('0x9')]);router[_0x0d0e('0x8')]('/:id',auth[_0x0d0e('0xa')](),controller['show']);router['get'](_0x0d0e('0xb'),auth['isAuthenticated'](),controller[_0x0d0e('0xc')]);router[_0x0d0e('0x8')](_0x0d0e('0xd'),auth[_0x0d0e('0xa')](),controller['getFields']);router[_0x0d0e('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0d0e('0xe')](_0x0d0e('0xb'),auth[_0x0d0e('0xa')](),controller[_0x0d0e('0xf')]);router[_0x0d0e('0x10')]('/:id',auth[_0x0d0e('0xa')](),controller['update']);router[_0x0d0e('0x11')]('/:id',auth[_0x0d0e('0xa')](),controller['destroy']);module[_0x0d0e('0x12')]=router; \ No newline at end of file +var _0xd668=['path','connect-timeout','express','Router','fs-extra','isAuthenticated','index','/:id','show','get','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','multer'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0xd668,0x18e));var _0x8d66=function(_0x2e4fb5,_0xf386ea){_0x2e4fb5=_0x2e4fb5-0x0;var _0x43c401=_0xd668[_0x2e4fb5];return _0x43c401;};'use strict';var multer=require(_0x8d66('0x0'));var util=require('util');var path=require(_0x8d66('0x1'));var timeout=require(_0x8d66('0x2'));var express=require(_0x8d66('0x3'));var router=express[_0x8d66('0x4')]();var fs_extra=require(_0x8d66('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intZendeskAccount.controller');router['get']('/',auth[_0x8d66('0x6')](),controller[_0x8d66('0x7')]);router['get'](_0x8d66('0x8'),auth['isAuthenticated'](),controller[_0x8d66('0x9')]);router[_0x8d66('0xa')](_0x8d66('0xb'),auth[_0x8d66('0x6')](),controller['getConfigurations']);router[_0x8d66('0xa')](_0x8d66('0xc'),auth[_0x8d66('0x6')](),controller[_0x8d66('0xd')]);router[_0x8d66('0xe')]('/',auth[_0x8d66('0x6')](),controller[_0x8d66('0xf')]);router['post'](_0x8d66('0xb'),auth[_0x8d66('0x6')](),controller[_0x8d66('0x10')]);router[_0x8d66('0x11')](_0x8d66('0x8'),auth[_0x8d66('0x6')](),controller[_0x8d66('0x12')]);router[_0x8d66('0x13')](_0x8d66('0x8'),auth['isAuthenticated'](),controller[_0x8d66('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 505d88c..e2da23e 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 _0x9666=['sequelize','exports','STRING','username','ENUM','password','token','newTab','integrationTab'];(function(_0x38500c,_0x1d3486){var _0x181de5=function(_0x40401b){while(--_0x40401b){_0x38500c['push'](_0x38500c['shift']());}};_0x181de5(++_0x1d3486);}(_0x9666,0x17a));var _0x6966=function(_0x432aab,_0x442b04){_0x432aab=_0x432aab-0x0;var _0x2d27b8=_0x9666[_0x432aab];return _0x2d27b8;};'use strict';var Sequelize=require(_0x6966('0x0'));module[_0x6966('0x1')]={'name':{'type':Sequelize[_0x6966('0x2')]},'description':{'type':Sequelize[_0x6966('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x6966('0x3')},'password':{'type':Sequelize[_0x6966('0x2')]},'token':{'type':Sequelize[_0x6966('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x6966('0x4')](_0x6966('0x5'),_0x6966('0x6')),'defaultValue':_0x6966('0x5')},'serverUrl':{'type':Sequelize[_0x6966('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x6966('0x4')]('integrationTab',_0x6966('0x7')),'defaultValue':_0x6966('0x8')}}; \ No newline at end of file +var _0x06ae=['username','remoteUri','password','ENUM','integrationTab','newTab','exports','STRING'];(function(_0x1ae31c,_0x8dcd2d){var _0x19519d=function(_0x22b8cd){while(--_0x22b8cd){_0x1ae31c['push'](_0x1ae31c['shift']());}};_0x19519d(++_0x8dcd2d);}(_0x06ae,0x16e));var _0xe06a=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x06ae[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require('sequelize');module[_0xe06a('0x0')]={'name':{'type':Sequelize[_0xe06a('0x1')]},'description':{'type':Sequelize[_0xe06a('0x1')]},'username':{'type':Sequelize[_0xe06a('0x1')],'unique':_0xe06a('0x2')},'password':{'type':Sequelize[_0xe06a('0x1')]},'token':{'type':Sequelize[_0xe06a('0x1')]},'remoteUri':{'type':Sequelize[_0xe06a('0x1')],'unique':_0xe06a('0x3')},'authType':{'type':Sequelize['ENUM']('password','token'),'defaultValue':_0xe06a('0x4')},'serverUrl':{'type':Sequelize[_0xe06a('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xe06a('0x5')](_0xe06a('0x6'),_0xe06a('0x7')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 57be0fa..f5dbc55 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 _0x76dc=['base64','token','headers','Basic\x20%s','%s/token:%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','assignee','remove','includes','position','title','system_field_options','custom_field_options','statusCode','error','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','name','send','index','ZendeskAccount','rawAttributes','fieldName','key','map','query','keys','attributes','intersection','model','fields','hasOwnProperty','nolimit','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','length','include','find','catch','create','body','destroy','getConfigurations','findOne','ZendeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','type','Descriptions','getDescriptions','ZendeskField','getFields','username','password','authType','remoteUri','substring','lastIndexOf','GET','format','ticket_fields','%s:%s','toString'];(function(_0xb28282,_0x29d2d3){var _0x4f0de7=function(_0x567cad){while(--_0x567cad){_0xb28282['push'](_0xb28282['shift']());}};_0x4f0de7(++_0x29d2d3);}(_0x76dc,0x1f2));var _0xc76d=function(_0x1a0d52,_0x307559){_0x1a0d52=_0x1a0d52-0x0;var _0x479802=_0x76dc[_0x1a0d52];return _0x479802;};'use strict';var emlformat=require(_0xc76d('0x0'));var rimraf=require(_0xc76d('0x1'));var zipdir=require(_0xc76d('0x2'));var jsonpatch=require(_0xc76d('0x3'));var rp=require('request-promise');var moment=require(_0xc76d('0x4'));var BPromise=require(_0xc76d('0x5'));var Mustache=require('mustache');var util=require(_0xc76d('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xc76d('0x7'));var ejs=require(_0xc76d('0x8'));var fs=require('fs');var fs_extra=require(_0xc76d('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc76d('0xa'));var jsforce=require(_0xc76d('0xb'));var deskjs=require(_0xc76d('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc76d('0xd'));var Redis=require(_0xc76d('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xc76d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc76d('0x10'));var logger=require(_0xc76d('0x11'))(_0xc76d('0x12'));var utils=require(_0xc76d('0x13'));var config=require(_0xc76d('0x14'));var licenseUtil=require(_0xc76d('0x15'));var db=require(_0xc76d('0x16'))['db'];var integrations=require(_0xc76d('0x17'));function respondWithStatusCode(_0x1722b3,_0x311814){_0x311814=_0x311814||0xcc;return function(_0x1a7b47){if(_0x1a7b47){return _0x1722b3[_0xc76d('0x18')](_0x311814);}return _0x1722b3[_0xc76d('0x19')](_0x311814)[_0xc76d('0x1a')]();};}function respondWithResult(_0x5cda20,_0x8696db){_0x8696db=_0x8696db||0xc8;return function(_0x2e9ec7){if(_0x2e9ec7){return _0x5cda20['status'](_0x8696db)[_0xc76d('0x1b')](_0x2e9ec7);}};}function respondWithFilteredResult(_0x2d23d2,_0x47a4ee){return function(_0x6f94e){if(_0x6f94e){var _0x5c680c=typeof _0x47a4ee[_0xc76d('0x1c')]==='undefined'&&typeof _0x47a4ee['limit']===_0xc76d('0x1d');var _0x31b032=_0x6f94e[_0xc76d('0x1e')];var _0x23f3ca=_0x5c680c?0x0:_0x47a4ee[_0xc76d('0x1c')];var _0x4b0402=_0x5c680c?_0x6f94e[_0xc76d('0x1e')]:_0x47a4ee[_0xc76d('0x1c')]+_0x47a4ee[_0xc76d('0x1f')];var _0x1c6d5b;if(_0x4b0402>=_0x31b032){_0x4b0402=_0x31b032;_0x1c6d5b=0xc8;}else{_0x1c6d5b=0xce;}_0x2d23d2[_0xc76d('0x19')](_0x1c6d5b);return _0x2d23d2['set'](_0xc76d('0x20'),_0x23f3ca+'-'+_0x4b0402+'/'+_0x31b032)[_0xc76d('0x1b')](_0x6f94e);}return null;};}function patchUpdates(_0x5dffde){return function(_0x455371){try{jsonpatch[_0xc76d('0x21')](_0x455371,_0x5dffde,!![]);}catch(_0x191e97){return BPromise[_0xc76d('0x22')](_0x191e97);}return _0x455371[_0xc76d('0x23')]();};}function saveUpdates(_0x3d357b,_0x42b89c){return function(_0x107fad){if(_0x107fad){return _0x107fad[_0xc76d('0x24')](_0x3d357b)[_0xc76d('0x25')](function(_0x15328d){return _0x15328d;});}return null;};}function removeEntity(_0x5de11f,_0x11b42f){return function(_0x17b46f){if(_0x17b46f){return _0x17b46f['destroy']()[_0xc76d('0x25')](function(){_0x5de11f[_0xc76d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x374b9e,_0x476aee){return function(_0x2cd06e){if(!_0x2cd06e){_0x374b9e[_0xc76d('0x18')](0x194);}return _0x2cd06e;};}function handleError(_0xfc4aea,_0x1949c4){_0x1949c4=_0x1949c4||0x1f4;return function(_0x89ee5){logger['error'](_0x89ee5['stack']);if(_0x89ee5[_0xc76d('0x26')]){delete _0x89ee5[_0xc76d('0x26')];}_0xfc4aea['status'](_0x1949c4)[_0xc76d('0x27')](_0x89ee5);};}exports[_0xc76d('0x28')]=function(_0x64899f,_0x49fa89){var _0x2039f4={},_0x5cf2e4={},_0x13b468={'count':0x0,'rows':[]};var _0x18a7fa=_['map'](db[_0xc76d('0x29')][_0xc76d('0x2a')],function(_0x9ab96c){return{'name':_0x9ab96c[_0xc76d('0x2b')],'type':_0x9ab96c['type'][_0xc76d('0x2c')]};});_0x5cf2e4['model']=_[_0xc76d('0x2d')](_0x18a7fa,'name');_0x5cf2e4[_0xc76d('0x2e')]=_[_0xc76d('0x2f')](_0x64899f['query']);_0x5cf2e4['filters']=_['intersection'](_0x5cf2e4['model'],_0x5cf2e4[_0xc76d('0x2e')]);_0x2039f4[_0xc76d('0x30')]=_[_0xc76d('0x31')](_0x5cf2e4[_0xc76d('0x32')],qs[_0xc76d('0x33')](_0x64899f['query'][_0xc76d('0x33')]));_0x2039f4['attributes']=_0x2039f4[_0xc76d('0x30')]['length']?_0x2039f4[_0xc76d('0x30')]:_0x5cf2e4[_0xc76d('0x32')];if(!_0x64899f[_0xc76d('0x2e')][_0xc76d('0x34')](_0xc76d('0x35'))){_0x2039f4['limit']=qs[_0xc76d('0x1f')](_0x64899f[_0xc76d('0x2e')][_0xc76d('0x1f')]);_0x2039f4['offset']=qs[_0xc76d('0x1c')](_0x64899f[_0xc76d('0x2e')][_0xc76d('0x1c')]);}_0x2039f4['order']=qs[_0xc76d('0x36')](_0x64899f[_0xc76d('0x2e')][_0xc76d('0x36')]);_0x2039f4[_0xc76d('0x37')]=qs[_0xc76d('0x38')](_[_0xc76d('0x39')](_0x64899f['query'],_0x5cf2e4['filters']),_0x18a7fa);if(_0x64899f[_0xc76d('0x2e')]['filter']){_0x2039f4[_0xc76d('0x37')]=_[_0xc76d('0x3a')](_0x2039f4[_0xc76d('0x37')],{'$or':_[_0xc76d('0x2d')](_0x18a7fa,function(_0x57b9bc){if(_0x57b9bc['type']!==_0xc76d('0x3b')){var _0x20a456={};_0x20a456[_0x57b9bc[_0xc76d('0x26')]]={'$like':'%'+_0x64899f[_0xc76d('0x2e')][_0xc76d('0x3c')]+'%'};return _0x20a456;}})});}_0x2039f4=_['merge']({},_0x2039f4,_0x64899f[_0xc76d('0x3d')]);var _0xb264b0={'where':_0x2039f4[_0xc76d('0x37')]};return db[_0xc76d('0x29')][_0xc76d('0x1e')](_0xb264b0)[_0xc76d('0x25')](function(_0x10ba23){_0x13b468[_0xc76d('0x1e')]=_0x10ba23;if(_0x64899f[_0xc76d('0x2e')][_0xc76d('0x3e')]){_0x2039f4['include']=[{'all':!![]}];}return db['ZendeskAccount'][_0xc76d('0x3f')](_0x2039f4);})[_0xc76d('0x25')](function(_0x1e5118){_0x13b468[_0xc76d('0x40')]=_0x1e5118;return _0x13b468;})['then'](respondWithFilteredResult(_0x49fa89,_0x2039f4))['catch'](handleError(_0x49fa89,null));};exports[_0xc76d('0x41')]=function(_0x13a895,_0x3e471e){var _0x15eb42={'raw':![],'where':{'id':_0x13a895[_0xc76d('0x42')]['id']}},_0x21c18f={};_0x21c18f[_0xc76d('0x32')]=_[_0xc76d('0x2f')](db['ZendeskAccount'][_0xc76d('0x2a')]);_0x21c18f[_0xc76d('0x2e')]=_[_0xc76d('0x2f')](_0x13a895[_0xc76d('0x2e')]);_0x21c18f['filters']=_['intersection'](_0x21c18f['model'],_0x21c18f['query']);_0x15eb42['attributes']=_['intersection'](_0x21c18f['model'],qs[_0xc76d('0x33')](_0x13a895[_0xc76d('0x2e')][_0xc76d('0x33')]));_0x15eb42[_0xc76d('0x30')]=_0x15eb42[_0xc76d('0x30')][_0xc76d('0x43')]?_0x15eb42[_0xc76d('0x30')]:_0x21c18f[_0xc76d('0x32')];if(_0x13a895['query'][_0xc76d('0x3e')]){_0x15eb42[_0xc76d('0x44')]=[{'all':!![]}];}_0x15eb42=_[_0xc76d('0x3a')]({},_0x15eb42,_0x13a895[_0xc76d('0x3d')]);return db[_0xc76d('0x29')][_0xc76d('0x45')](_0x15eb42)[_0xc76d('0x25')](handleEntityNotFound(_0x3e471e,null))[_0xc76d('0x25')](respondWithResult(_0x3e471e,null))[_0xc76d('0x46')](handleError(_0x3e471e,null));};exports['create']=function(_0x5b41d3,_0x144d09){return db[_0xc76d('0x29')][_0xc76d('0x47')](_0x5b41d3[_0xc76d('0x48')],{})[_0xc76d('0x25')](respondWithResult(_0x144d09,0xc9))['catch'](handleError(_0x144d09,null));};exports[_0xc76d('0x24')]=function(_0x1ede13,_0x5e48fe){if(_0x1ede13['body']['id']){delete _0x1ede13[_0xc76d('0x48')]['id'];}return db[_0xc76d('0x29')]['find']({'where':{'id':_0x1ede13[_0xc76d('0x42')]['id']}})[_0xc76d('0x25')](handleEntityNotFound(_0x5e48fe,null))[_0xc76d('0x25')](saveUpdates(_0x1ede13[_0xc76d('0x48')],null))[_0xc76d('0x25')](respondWithResult(_0x5e48fe,null))[_0xc76d('0x46')](handleError(_0x5e48fe,null));};exports[_0xc76d('0x49')]=function(_0x10b1b0,_0x4452a8){return db[_0xc76d('0x29')]['find']({'where':{'id':_0x10b1b0[_0xc76d('0x42')]['id']}})[_0xc76d('0x25')](handleEntityNotFound(_0x4452a8,null))[_0xc76d('0x25')](removeEntity(_0x4452a8,null))['catch'](handleError(_0x4452a8,null));};exports[_0xc76d('0x4a')]=function(_0x1afc6c,_0x506b03,_0x366d43){var _0x488783={};var _0xe90d83={};var _0x12c972;var _0x316978;return db[_0xc76d('0x29')][_0xc76d('0x4b')]({'where':{'id':_0x1afc6c['params']['id']}})['then'](handleEntityNotFound(_0x506b03,null))['then'](function(_0x320483){if(_0x320483){_0x12c972=_0x320483;_0xe90d83[_0xc76d('0x32')]=_[_0xc76d('0x2f')](db[_0xc76d('0x4c')][_0xc76d('0x2a')]);_0xe90d83[_0xc76d('0x2e')]=_['keys'](_0x1afc6c[_0xc76d('0x2e')]);_0xe90d83[_0xc76d('0x38')]=_[_0xc76d('0x31')](_0xe90d83[_0xc76d('0x32')],_0xe90d83[_0xc76d('0x2e')]);_0x488783['attributes']=_[_0xc76d('0x31')](_0xe90d83[_0xc76d('0x32')],qs[_0xc76d('0x33')](_0x1afc6c[_0xc76d('0x2e')][_0xc76d('0x33')]));_0x488783[_0xc76d('0x30')]=_0x488783['attributes'][_0xc76d('0x43')]?_0x488783[_0xc76d('0x30')]:_0xe90d83['model'];_0x488783['order']=qs[_0xc76d('0x36')](_0x1afc6c['query'][_0xc76d('0x36')]);_0x488783[_0xc76d('0x37')]=qs[_0xc76d('0x38')](_[_0xc76d('0x39')](_0x1afc6c[_0xc76d('0x2e')],_0xe90d83[_0xc76d('0x38')]));if(_0x1afc6c[_0xc76d('0x2e')][_0xc76d('0x3c')]){_0x488783[_0xc76d('0x37')]=_[_0xc76d('0x3a')](_0x488783[_0xc76d('0x37')],{'$or':_[_0xc76d('0x2d')](_0x488783[_0xc76d('0x30')],function(_0x3afeb6){var _0x4cd7bf={};_0x4cd7bf[_0x3afeb6]={'$like':'%'+_0x1afc6c[_0xc76d('0x2e')][_0xc76d('0x3c')]+'%'};return _0x4cd7bf;})});}_0x488783=_[_0xc76d('0x3a')]({},_0x488783,_0x1afc6c[_0xc76d('0x3d')]);return _0x12c972[_0xc76d('0x4a')](_0x488783);}})['then'](function(_0x40e866){if(_0x40e866){_0x316978=_0x40e866[_0xc76d('0x43')];if(!_0x1afc6c['query']['hasOwnProperty']('nolimit')){_0x488783[_0xc76d('0x1f')]=qs[_0xc76d('0x1f')](_0x1afc6c[_0xc76d('0x2e')][_0xc76d('0x1f')]);_0x488783[_0xc76d('0x1c')]=qs[_0xc76d('0x1c')](_0x1afc6c[_0xc76d('0x2e')][_0xc76d('0x1c')]);}return _0x12c972['getConfigurations'](_0x488783);}})[_0xc76d('0x25')](function(_0x5e2f0d){if(_0x5e2f0d){return _0x5e2f0d?{'count':_0x316978,'rows':_0x5e2f0d}:null;}})['then'](respondWithResult(_0x506b03,null))[_0xc76d('0x46')](handleError(_0x506b03,null));};exports[_0xc76d('0x4d')]=function(_0x1a0182,_0x502bd8,_0x11b544){if(_0x1a0182['body']['id']){delete _0x1a0182['body']['id'];}return db['ZendeskAccount'][_0xc76d('0x4b')]({'where':{'id':_0x1a0182[_0xc76d('0x42')]['id']}})['then'](handleEntityNotFound(_0x502bd8,null))[_0xc76d('0x25')](function(_0x382bc1){if(_0x382bc1){_0x1a0182[_0xc76d('0x48')][_0xc76d('0x4e')]=_0x382bc1['id'];_0x1a0182[_0xc76d('0x48')][_0xc76d('0x4f')]=integrations[_0xc76d('0x50')](_0x1a0182['body']['channel'],_0x1a0182['body'][_0xc76d('0x51')]);_0x1a0182[_0xc76d('0x48')][_0xc76d('0x52')]=integrations[_0xc76d('0x53')](_0x1a0182[_0xc76d('0x48')]['channel'],_0x1a0182[_0xc76d('0x48')][_0xc76d('0x51')]);return db[_0xc76d('0x4c')][_0xc76d('0x47')](_0x1a0182[_0xc76d('0x48')],{'include':[{'model':db[_0xc76d('0x54')],'as':_0xc76d('0x4f')},{'model':db[_0xc76d('0x54')],'as':'Descriptions'}]});}return null;})[_0xc76d('0x25')](respondWithResult(_0x502bd8,null))['catch'](handleError(_0x502bd8,null));};exports[_0xc76d('0x55')]=function(_0x40afa3,_0x35c60f,_0x55dd93){var _0x58c3ce='';return db[_0xc76d('0x29')]['findOne']({'where':{'id':_0x40afa3['params']['id']},'attributes':['id',_0xc76d('0x56'),_0xc76d('0x57'),'token',_0xc76d('0x58'),_0xc76d('0x59')]})['then'](handleEntityNotFound(_0x35c60f,null))[_0xc76d('0x25')](function(_0xef0e1b){if(_0xef0e1b){_0x58c3ce=_0xef0e1b['remoteUri'];var _0x450402=_0x58c3ce['slice'](-0x1);if(_0x450402==='/'){_0x58c3ce=_0x58c3ce[_0xc76d('0x5a')](0x0,_0x58c3ce[_0xc76d('0x5b')](_0x450402));}var _0x4cbaba={'method':_0xc76d('0x5c'),'uri':util[_0xc76d('0x5d')]('%s/%s',_0x58c3ce,_0xc76d('0x5e')),'json':!![]};switch(_0xef0e1b[_0xc76d('0x58')]){case _0xc76d('0x57'):_0x4cbaba['headers']={'Authorization':util[_0xc76d('0x5d')]('Basic\x20%s',new Buffer(util['format'](_0xc76d('0x5f'),_0xef0e1b[_0xc76d('0x56')],_0xef0e1b['password']))[_0xc76d('0x60')](_0xc76d('0x61')))};break;case _0xc76d('0x62'):_0x4cbaba[_0xc76d('0x63')]={'Authorization':util[_0xc76d('0x5d')](_0xc76d('0x64'),new Buffer(util[_0xc76d('0x5d')](_0xc76d('0x65'),_0xef0e1b[_0xc76d('0x56')],_0xef0e1b[_0xc76d('0x62')]))[_0xc76d('0x60')](_0xc76d('0x61')))};break;default:throw new db[(_0xc76d('0x66'))][(_0xc76d('0x67'))](_0xc76d('0x68'));}return rp(_0x4cbaba);}})[_0xc76d('0x25')](function(_0xa6508c){if(_0xa6508c){var _0xd16232=[_0xc76d('0x69'),_0xc76d('0x6a'),'group',_0xc76d('0x6b')];_[_0xc76d('0x6c')](_0xa6508c[_0xc76d('0x5e')],function(_0x1d97c3){return _0xd16232[_0xc76d('0x6d')](_0x1d97c3[_0xc76d('0x51')]);});return{'count':_0xa6508c[_0xc76d('0x5e')][_0xc76d('0x43')],'rows':_[_0xc76d('0x2d')](_0xa6508c[_0xc76d('0x5e')],function(_0x7210ee){return{'id':_0x7210ee['id'],'name':_0x7210ee[_0xc76d('0x6e')]>0x7?_0x7210ee[_0xc76d('0x6f')]:_0x7210ee[_0xc76d('0x51')],'custom':_0x7210ee[_0xc76d('0x6e')]>0x7?!![]:![],'options':_0x7210ee[_0xc76d('0x70')]?_0x7210ee[_0xc76d('0x70')]:_0x7210ee[_0xc76d('0x71')]?_0x7210ee[_0xc76d('0x71')]:[]};})};}})[_0xc76d('0x25')](respondWithResult(_0x35c60f,null))[_0xc76d('0x46')](function(_0x260874){var _0x508348=_0x40afa3[_0xc76d('0x2e')]['test']?0x1f4:_0x260874[_0xc76d('0x72')]||0x1f4;logger[_0xc76d('0x73')]('getFields,\x20%s,\x20%s,\x20%s',_0xc76d('0x55'),_0x508348,JSON[_0xc76d('0x74')](_0x260874));delete _0x260874['name'];if(_0x508348===0x191){_0x508348=0x190;}_0x35c60f[_0xc76d('0x19')](_0x508348)[_0xc76d('0x27')](_0x40afa3[_0xc76d('0x2e')][_0xc76d('0x75')]?{'message':_0xc76d('0x76'),'statusCode':_0x260874[_0xc76d('0x72')]}:_0x260874);});}; \ No newline at end of file +var _0x4483=['fields','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','options','ZendeskAccount','includeAll','include','findAll','then','rows','catch','params','rawAttributes','length','merge','find','create','body','update','getConfigurations','nolimit','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','username','authType','remoteUri','slice','lastIndexOf','format','%s/%s','password','headers','Basic\x20%s','%s:%s','toString','base64','token','%s/token:%s','Sequelize','ValidationError','subject','description','group','assignee','ticket_fields','includes','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','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','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','destroy','end','error','stack','name','send','index','map','fieldName','type','query','keys','filters','intersection','model','attributes'];(function(_0x1deb72,_0x3f6338){var _0x18bbdf=function(_0x1b4b9b){while(--_0x1b4b9b){_0x1deb72['push'](_0x1deb72['shift']());}};_0x18bbdf(++_0x3f6338);}(_0x4483,0x1a3));var _0x3448=function(_0x44717b,_0x251ea7){_0x44717b=_0x44717b-0x0;var _0x658526=_0x4483[_0x44717b];return _0x658526;};'use strict';var emlformat=require(_0x3448('0x0'));var rimraf=require(_0x3448('0x1'));var zipdir=require(_0x3448('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3448('0x3'));var moment=require(_0x3448('0x4'));var BPromise=require(_0x3448('0x5'));var Mustache=require(_0x3448('0x6'));var util=require(_0x3448('0x7'));var path=require('path');var sox=require(_0x3448('0x8'));var csv=require(_0x3448('0x9'));var ejs=require(_0x3448('0xa'));var fs=require('fs');var fs_extra=require(_0x3448('0xb'));var _=require(_0x3448('0xc'));var squel=require(_0x3448('0xd'));var crypto=require(_0x3448('0xe'));var jsforce=require(_0x3448('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3448('0x10'));var Papa=require(_0x3448('0x11'));var Redis=require(_0x3448('0x12'));var authService=require(_0x3448('0x13'));var qs=require(_0x3448('0x14'));var as=require(_0x3448('0x15'));var hardwareService=require(_0x3448('0x16'));var logger=require(_0x3448('0x17'))(_0x3448('0x18'));var utils=require(_0x3448('0x19'));var config=require(_0x3448('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x3448('0x1b'));function respondWithStatusCode(_0x38fbb1,_0x5f52bd){_0x5f52bd=_0x5f52bd||0xcc;return function(_0x2661e1){if(_0x2661e1){return _0x38fbb1[_0x3448('0x1c')](_0x5f52bd);}return _0x38fbb1[_0x3448('0x1d')](_0x5f52bd)['end']();};}function respondWithResult(_0x14104c,_0x2952a6){_0x2952a6=_0x2952a6||0xc8;return function(_0x4daf3e){if(_0x4daf3e){return _0x14104c[_0x3448('0x1d')](_0x2952a6)[_0x3448('0x1e')](_0x4daf3e);}};}function respondWithFilteredResult(_0x46784f,_0x4fc70f){return function(_0x472518){if(_0x472518){var _0x28f5b9=typeof _0x4fc70f[_0x3448('0x1f')]===_0x3448('0x20')&&typeof _0x4fc70f[_0x3448('0x21')]===_0x3448('0x20');var _0x247d1a=_0x472518[_0x3448('0x22')];var _0x4a348c=_0x28f5b9?0x0:_0x4fc70f[_0x3448('0x1f')];var _0x5b410d=_0x28f5b9?_0x472518['count']:_0x4fc70f['offset']+_0x4fc70f[_0x3448('0x21')];var _0x278736;if(_0x5b410d>=_0x247d1a){_0x5b410d=_0x247d1a;_0x278736=0xc8;}else{_0x278736=0xce;}_0x46784f[_0x3448('0x1d')](_0x278736);return _0x46784f['set'](_0x3448('0x23'),_0x4a348c+'-'+_0x5b410d+'/'+_0x247d1a)[_0x3448('0x1e')](_0x472518);}return null;};}function patchUpdates(_0x317de6){return function(_0x18608e){try{jsonpatch[_0x3448('0x24')](_0x18608e,_0x317de6,!![]);}catch(_0x715c3){return BPromise['reject'](_0x715c3);}return _0x18608e['save']();};}function saveUpdates(_0x4e6716,_0x1b3d5a){return function(_0x200f72){if(_0x200f72){return _0x200f72['update'](_0x4e6716)['then'](function(_0x2dcd40){return _0x2dcd40;});}return null;};}function removeEntity(_0x4371d6,_0x22ad5c){return function(_0x4368c7){if(_0x4368c7){return _0x4368c7[_0x3448('0x25')]()['then'](function(){_0x4371d6[_0x3448('0x1d')](0xcc)[_0x3448('0x26')]();});}};}function handleEntityNotFound(_0x114244,_0x2088de){return function(_0x951811){if(!_0x951811){_0x114244['sendStatus'](0x194);}return _0x951811;};}function handleError(_0x329947,_0x393081){_0x393081=_0x393081||0x1f4;return function(_0x52c163){logger[_0x3448('0x27')](_0x52c163[_0x3448('0x28')]);if(_0x52c163[_0x3448('0x29')]){delete _0x52c163[_0x3448('0x29')];}_0x329947[_0x3448('0x1d')](_0x393081)[_0x3448('0x2a')](_0x52c163);};}exports[_0x3448('0x2b')]=function(_0x95714e,_0x5911b8){var _0x3307dc={},_0x450704={},_0xcfdc5={'count':0x0,'rows':[]};var _0x52c09d=_[_0x3448('0x2c')](db['ZendeskAccount']['rawAttributes'],function(_0x493898){return{'name':_0x493898[_0x3448('0x2d')],'type':_0x493898[_0x3448('0x2e')]['key']};});_0x450704['model']=_[_0x3448('0x2c')](_0x52c09d,_0x3448('0x29'));_0x450704[_0x3448('0x2f')]=_[_0x3448('0x30')](_0x95714e['query']);_0x450704[_0x3448('0x31')]=_[_0x3448('0x32')](_0x450704[_0x3448('0x33')],_0x450704['query']);_0x3307dc[_0x3448('0x34')]=_[_0x3448('0x32')](_0x450704['model'],qs['fields'](_0x95714e[_0x3448('0x2f')][_0x3448('0x35')]));_0x3307dc[_0x3448('0x34')]=_0x3307dc[_0x3448('0x34')]['length']?_0x3307dc[_0x3448('0x34')]:_0x450704[_0x3448('0x33')];if(!_0x95714e[_0x3448('0x2f')][_0x3448('0x36')]('nolimit')){_0x3307dc[_0x3448('0x21')]=qs[_0x3448('0x21')](_0x95714e['query'][_0x3448('0x21')]);_0x3307dc[_0x3448('0x1f')]=qs[_0x3448('0x1f')](_0x95714e[_0x3448('0x2f')][_0x3448('0x1f')]);}_0x3307dc[_0x3448('0x37')]=qs[_0x3448('0x38')](_0x95714e[_0x3448('0x2f')][_0x3448('0x38')]);_0x3307dc['where']=qs['filters'](_[_0x3448('0x39')](_0x95714e['query'],_0x450704[_0x3448('0x31')]),_0x52c09d);if(_0x95714e[_0x3448('0x2f')][_0x3448('0x3a')]){_0x3307dc[_0x3448('0x3b')]=_['merge'](_0x3307dc[_0x3448('0x3b')],{'$or':_[_0x3448('0x2c')](_0x52c09d,function(_0x495d7){if(_0x495d7[_0x3448('0x2e')]!==_0x3448('0x3c')){var _0x249131={};_0x249131[_0x495d7[_0x3448('0x29')]]={'$like':'%'+_0x95714e[_0x3448('0x2f')][_0x3448('0x3a')]+'%'};return _0x249131;}})});}_0x3307dc=_['merge']({},_0x3307dc,_0x95714e[_0x3448('0x3d')]);var _0x3c92e2={'where':_0x3307dc[_0x3448('0x3b')]};return db[_0x3448('0x3e')][_0x3448('0x22')](_0x3c92e2)['then'](function(_0x18b297){_0xcfdc5[_0x3448('0x22')]=_0x18b297;if(_0x95714e[_0x3448('0x2f')][_0x3448('0x3f')]){_0x3307dc[_0x3448('0x40')]=[{'all':!![]}];}return db[_0x3448('0x3e')][_0x3448('0x41')](_0x3307dc);})[_0x3448('0x42')](function(_0x4a8f80){_0xcfdc5[_0x3448('0x43')]=_0x4a8f80;return _0xcfdc5;})[_0x3448('0x42')](respondWithFilteredResult(_0x5911b8,_0x3307dc))[_0x3448('0x44')](handleError(_0x5911b8,null));};exports['show']=function(_0x2465ff,_0x1d2a7c){var _0x21f989={'raw':![],'where':{'id':_0x2465ff[_0x3448('0x45')]['id']}},_0x26d6b8={};_0x26d6b8[_0x3448('0x33')]=_[_0x3448('0x30')](db['ZendeskAccount'][_0x3448('0x46')]);_0x26d6b8[_0x3448('0x2f')]=_[_0x3448('0x30')](_0x2465ff[_0x3448('0x2f')]);_0x26d6b8[_0x3448('0x31')]=_[_0x3448('0x32')](_0x26d6b8['model'],_0x26d6b8[_0x3448('0x2f')]);_0x21f989['attributes']=_['intersection'](_0x26d6b8[_0x3448('0x33')],qs[_0x3448('0x35')](_0x2465ff['query'][_0x3448('0x35')]));_0x21f989[_0x3448('0x34')]=_0x21f989['attributes'][_0x3448('0x47')]?_0x21f989[_0x3448('0x34')]:_0x26d6b8['model'];if(_0x2465ff[_0x3448('0x2f')][_0x3448('0x3f')]){_0x21f989[_0x3448('0x40')]=[{'all':!![]}];}_0x21f989=_[_0x3448('0x48')]({},_0x21f989,_0x2465ff[_0x3448('0x3d')]);return db[_0x3448('0x3e')][_0x3448('0x49')](_0x21f989)['then'](handleEntityNotFound(_0x1d2a7c,null))['then'](respondWithResult(_0x1d2a7c,null))[_0x3448('0x44')](handleError(_0x1d2a7c,null));};exports[_0x3448('0x4a')]=function(_0x1b82e7,_0x3f48e3){return db['ZendeskAccount'][_0x3448('0x4a')](_0x1b82e7[_0x3448('0x4b')],{})[_0x3448('0x42')](respondWithResult(_0x3f48e3,0xc9))[_0x3448('0x44')](handleError(_0x3f48e3,null));};exports[_0x3448('0x4c')]=function(_0x5d942b,_0x3edd60){if(_0x5d942b['body']['id']){delete _0x5d942b[_0x3448('0x4b')]['id'];}return db[_0x3448('0x3e')]['find']({'where':{'id':_0x5d942b[_0x3448('0x45')]['id']}})[_0x3448('0x42')](handleEntityNotFound(_0x3edd60,null))[_0x3448('0x42')](saveUpdates(_0x5d942b[_0x3448('0x4b')],null))[_0x3448('0x42')](respondWithResult(_0x3edd60,null))[_0x3448('0x44')](handleError(_0x3edd60,null));};exports[_0x3448('0x25')]=function(_0x53236c,_0x23dbda){return db[_0x3448('0x3e')]['find']({'where':{'id':_0x53236c['params']['id']}})[_0x3448('0x42')](handleEntityNotFound(_0x23dbda,null))[_0x3448('0x42')](removeEntity(_0x23dbda,null))['catch'](handleError(_0x23dbda,null));};exports['getConfigurations']=function(_0x371e8a,_0xb6c293,_0x2f795d){var _0x430e74={};var _0x176e60={};var _0x39db50;var _0x2aea70;return db['ZendeskAccount']['findOne']({'where':{'id':_0x371e8a['params']['id']}})[_0x3448('0x42')](handleEntityNotFound(_0xb6c293,null))[_0x3448('0x42')](function(_0x5cf3fe){if(_0x5cf3fe){_0x39db50=_0x5cf3fe;_0x176e60[_0x3448('0x33')]=_[_0x3448('0x30')](db['ZendeskConfiguration'][_0x3448('0x46')]);_0x176e60[_0x3448('0x2f')]=_['keys'](_0x371e8a[_0x3448('0x2f')]);_0x176e60[_0x3448('0x31')]=_[_0x3448('0x32')](_0x176e60[_0x3448('0x33')],_0x176e60[_0x3448('0x2f')]);_0x430e74[_0x3448('0x34')]=_[_0x3448('0x32')](_0x176e60[_0x3448('0x33')],qs[_0x3448('0x35')](_0x371e8a['query'][_0x3448('0x35')]));_0x430e74['attributes']=_0x430e74[_0x3448('0x34')][_0x3448('0x47')]?_0x430e74[_0x3448('0x34')]:_0x176e60[_0x3448('0x33')];_0x430e74[_0x3448('0x37')]=qs[_0x3448('0x38')](_0x371e8a['query'][_0x3448('0x38')]);_0x430e74['where']=qs[_0x3448('0x31')](_[_0x3448('0x39')](_0x371e8a[_0x3448('0x2f')],_0x176e60[_0x3448('0x31')]));if(_0x371e8a[_0x3448('0x2f')]['filter']){_0x430e74['where']=_[_0x3448('0x48')](_0x430e74[_0x3448('0x3b')],{'$or':_[_0x3448('0x2c')](_0x430e74['attributes'],function(_0x7c00fe){var _0x3eb57b={};_0x3eb57b[_0x7c00fe]={'$like':'%'+_0x371e8a[_0x3448('0x2f')][_0x3448('0x3a')]+'%'};return _0x3eb57b;})});}_0x430e74=_[_0x3448('0x48')]({},_0x430e74,_0x371e8a[_0x3448('0x3d')]);return _0x39db50[_0x3448('0x4d')](_0x430e74);}})[_0x3448('0x42')](function(_0x36a151){if(_0x36a151){_0x2aea70=_0x36a151[_0x3448('0x47')];if(!_0x371e8a[_0x3448('0x2f')][_0x3448('0x36')](_0x3448('0x4e'))){_0x430e74[_0x3448('0x21')]=qs[_0x3448('0x21')](_0x371e8a[_0x3448('0x2f')][_0x3448('0x21')]);_0x430e74[_0x3448('0x1f')]=qs['offset'](_0x371e8a[_0x3448('0x2f')]['offset']);}return _0x39db50[_0x3448('0x4d')](_0x430e74);}})['then'](function(_0x1f1e3c){if(_0x1f1e3c){return _0x1f1e3c?{'count':_0x2aea70,'rows':_0x1f1e3c}:null;}})[_0x3448('0x42')](respondWithResult(_0xb6c293,null))['catch'](handleError(_0xb6c293,null));};exports[_0x3448('0x4f')]=function(_0x2f6517,_0x54cddd,_0x4f6902){if(_0x2f6517[_0x3448('0x4b')]['id']){delete _0x2f6517['body']['id'];}return db['ZendeskAccount'][_0x3448('0x50')]({'where':{'id':_0x2f6517[_0x3448('0x45')]['id']}})['then'](handleEntityNotFound(_0x54cddd,null))['then'](function(_0x1385b9){if(_0x1385b9){_0x2f6517[_0x3448('0x4b')][_0x3448('0x51')]=_0x1385b9['id'];_0x2f6517[_0x3448('0x4b')][_0x3448('0x52')]=integrations[_0x3448('0x53')](_0x2f6517[_0x3448('0x4b')][_0x3448('0x54')],_0x2f6517[_0x3448('0x4b')][_0x3448('0x2e')]);_0x2f6517[_0x3448('0x4b')][_0x3448('0x55')]=integrations[_0x3448('0x56')](_0x2f6517[_0x3448('0x4b')]['channel'],_0x2f6517[_0x3448('0x4b')][_0x3448('0x2e')]);return db['ZendeskConfiguration'][_0x3448('0x4a')](_0x2f6517[_0x3448('0x4b')],{'include':[{'model':db['ZendeskField'],'as':_0x3448('0x52')},{'model':db[_0x3448('0x57')],'as':_0x3448('0x55')}]});}return null;})['then'](respondWithResult(_0x54cddd,null))['catch'](handleError(_0x54cddd,null));};exports[_0x3448('0x58')]=function(_0x489b70,_0x31dfc5,_0x42c146){var _0x5d952a='';return db['ZendeskAccount'][_0x3448('0x50')]({'where':{'id':_0x489b70[_0x3448('0x45')]['id']},'attributes':['id',_0x3448('0x59'),'password','token',_0x3448('0x5a'),_0x3448('0x5b')]})[_0x3448('0x42')](handleEntityNotFound(_0x31dfc5,null))[_0x3448('0x42')](function(_0x29dd31){if(_0x29dd31){_0x5d952a=_0x29dd31[_0x3448('0x5b')];var _0x526f38=_0x5d952a[_0x3448('0x5c')](-0x1);if(_0x526f38==='/'){_0x5d952a=_0x5d952a['substring'](0x0,_0x5d952a[_0x3448('0x5d')](_0x526f38));}var _0x2cca2f={'method':'GET','uri':util[_0x3448('0x5e')](_0x3448('0x5f'),_0x5d952a,'ticket_fields'),'json':!![]};switch(_0x29dd31['authType']){case _0x3448('0x60'):_0x2cca2f[_0x3448('0x61')]={'Authorization':util[_0x3448('0x5e')](_0x3448('0x62'),new Buffer(util[_0x3448('0x5e')](_0x3448('0x63'),_0x29dd31[_0x3448('0x59')],_0x29dd31[_0x3448('0x60')]))[_0x3448('0x64')](_0x3448('0x65')))};break;case _0x3448('0x66'):_0x2cca2f[_0x3448('0x61')]={'Authorization':util[_0x3448('0x5e')](_0x3448('0x62'),new Buffer(util[_0x3448('0x5e')](_0x3448('0x67'),_0x29dd31['username'],_0x29dd31['token']))[_0x3448('0x64')]('base64'))};break;default:throw new db[(_0x3448('0x68'))][(_0x3448('0x69'))]('Unknown\x20authentication\x20type');}return rp(_0x2cca2f);}})[_0x3448('0x42')](function(_0x5f4352){if(_0x5f4352){var _0x15d898=[_0x3448('0x6a'),_0x3448('0x6b'),_0x3448('0x6c'),_0x3448('0x6d')];_['remove'](_0x5f4352[_0x3448('0x6e')],function(_0x2e2b73){return _0x15d898[_0x3448('0x6f')](_0x2e2b73['type']);});return{'count':_0x5f4352[_0x3448('0x6e')][_0x3448('0x47')],'rows':_[_0x3448('0x2c')](_0x5f4352['ticket_fields'],function(_0xdb5d71){return{'id':_0xdb5d71['id'],'name':_0xdb5d71['position']>0x7?_0xdb5d71['title']:_0xdb5d71[_0x3448('0x2e')],'custom':_0xdb5d71['position']>0x7?!![]:![],'options':_0xdb5d71[_0x3448('0x70')]?_0xdb5d71['system_field_options']:_0xdb5d71[_0x3448('0x71')]?_0xdb5d71[_0x3448('0x71')]:[]};})};}})['then'](respondWithResult(_0x31dfc5,null))['catch'](function(_0x2a3e76){var _0x287e21=_0x489b70['query'][_0x3448('0x72')]?0x1f4:_0x2a3e76[_0x3448('0x73')]||0x1f4;logger['error'](_0x3448('0x74'),_0x3448('0x58'),_0x287e21,JSON[_0x3448('0x75')](_0x2a3e76));delete _0x2a3e76[_0x3448('0x29')];if(_0x287e21===0x191){_0x287e21=0x190;}_0x31dfc5['status'](_0x287e21)[_0x3448('0x2a')](_0x489b70['query'][_0x3448('0x72')]?{'message':'Wrong\x20credentials','statusCode':_0x2a3e76[_0x3448('0x73')]}:_0x2a3e76);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 7c7b288..3f67955 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 _0x08c1=['exports','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration'];(function(_0x258a16,_0x501fe0){var _0x337f7e=function(_0x435e70){while(--_0x435e70){_0x258a16['push'](_0x258a16['shift']());}};_0x337f7e(++_0x501fe0);}(_0x08c1,0x1df));var _0x108c=function(_0x3f6e63,_0xf0516b){_0x3f6e63=_0x3f6e63-0x0;var _0x7cb3ee=_0x08c1[_0x3f6e63];return _0x7cb3ee;};'use strict';var _=require(_0x108c('0x0'));var util=require(_0x108c('0x1'));var logger=require(_0x108c('0x2'))(_0x108c('0x3'));var moment=require(_0x108c('0x4'));var BPromise=require(_0x108c('0x5'));var rp=require(_0x108c('0x6'));var fs=require('fs');var path=require(_0x108c('0x7'));var rimraf=require(_0x108c('0x8'));var config=require(_0x108c('0x9'));var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0x108c('0xa'));module[_0x108c('0xb')]=function(_0xcee724,_0x121aec){return _0xcee724['define'](_0x108c('0xc'),attributes,{'tableName':_0x108c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc9e7=['../../components/integrations/configuration','exports','define','ZendeskAccount','util','../../config/logger','api','moment','bluebird','request-promise','path','./intZendeskAccount.attributes'];(function(_0x52308b,_0xfd7699){var _0x475f33=function(_0x408a4b){while(--_0x408a4b){_0x52308b['push'](_0x52308b['shift']());}};_0x475f33(++_0xfd7699);}(_0xc9e7,0x1cc));var _0x7c9e=function(_0x52f69b,_0x312b70){_0x52f69b=_0x52f69b-0x0;var _0xaacded=_0xc9e7[_0x52f69b];return _0xaacded;};'use strict';var _=require('lodash');var util=require(_0x7c9e('0x0'));var logger=require(_0x7c9e('0x1'))(_0x7c9e('0x2'));var moment=require(_0x7c9e('0x3'));var BPromise=require(_0x7c9e('0x4'));var rp=require(_0x7c9e('0x5'));var fs=require('fs');var path=require(_0x7c9e('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7c9e('0x7'));var integrations=require(_0x7c9e('0x8'));module[_0x7c9e('0x9')]=function(_0x4c8e84,_0x516f8f){return _0x4c8e84[_0x7c9e('0xa')](_0x7c9e('0xb'),attributes,{'tableName':'int_zendesk_accounts','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 0a86093..b0e6aee 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 _0x9230=['jayson/promise','client','request','then','info','ZendeskAccount,\x20%s,\x20%s','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','ZendeskAccount','options','attributes','limit','include','map','model','GetZendeskAccount','stringify','ShowZendeskAccount','find','raw','where','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x134e10,_0x1982fb){var _0x45bbb6=function(_0x15ff4c){while(--_0x15ff4c){_0x134e10['push'](_0x134e10['shift']());}};_0x45bbb6(++_0x1982fb);}(_0x9230,0xe6));var _0x0923=function(_0x55cc18,_0x18f494){_0x55cc18=_0x55cc18-0x0;var _0x2ecf76=_0x9230[_0x55cc18];return _0x2ecf76;};'use strict';var _=require(_0x0923('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0923('0x1'));var rs=require(_0x0923('0x2'));var fs=require('fs');var Redis=require(_0x0923('0x3'));var db=require(_0x0923('0x4'))['db'];var utils=require(_0x0923('0x5'));var logger=require(_0x0923('0x6'))('rpc');var config=require(_0x0923('0x7'));var jayson=require(_0x0923('0x8'));var client=jayson[_0x0923('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x578b53,_0x244b80,_0x259e05){return new BPromise(function(_0x4c55e4,_0x3ddf65){return client[_0x0923('0xa')](_0x578b53,_0x259e05)[_0x0923('0xb')](function(_0x5c5239){logger[_0x0923('0xc')](_0x0923('0xd'),_0x244b80,'request\x20sent');logger[_0x0923('0xe')](_0x0923('0xf'),_0x244b80,_0x0923('0x10'),JSON['stringify'](_0x5c5239));if(_0x5c5239['error']){if(_0x5c5239[_0x0923('0x11')]['code']===0x1f4){logger['error'](_0x0923('0xd'),_0x244b80,_0x5c5239[_0x0923('0x11')][_0x0923('0x12')]);return _0x3ddf65(_0x5c5239[_0x0923('0x11')]['message']);}logger['error'](_0x0923('0xd'),_0x244b80,_0x5c5239[_0x0923('0x11')]['message']);return _0x4c55e4(_0x5c5239[_0x0923('0x11')][_0x0923('0x12')]);}else{logger[_0x0923('0xc')](_0x0923('0xd'),_0x244b80,_0x0923('0x10'));_0x4c55e4(_0x5c5239[_0x0923('0x13')][_0x0923('0x12')]);}})[_0x0923('0x14')](function(_0x109a7d){logger[_0x0923('0x11')]('ZendeskAccount,\x20%s,\x20%s',_0x244b80,_0x109a7d);_0x3ddf65(_0x109a7d);});});}exports['GetZendeskAccount']=function(_0x39cdc4){var _0x417a4f=this;return new Promise(function(_0x2f704d,_0x2e0845){return db[_0x0923('0x15')]['findAll']({'raw':_0x39cdc4[_0x0923('0x16')]?_0x39cdc4[_0x0923('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x39cdc4[_0x0923('0x16')]?_0x39cdc4[_0x0923('0x16')]['where']||null:null,'attributes':_0x39cdc4[_0x0923('0x16')]?_0x39cdc4[_0x0923('0x16')][_0x0923('0x17')]||null:null,'limit':_0x39cdc4[_0x0923('0x16')]?_0x39cdc4['options'][_0x0923('0x18')]||null:null,'include':_0x39cdc4[_0x0923('0x16')]?_0x39cdc4[_0x0923('0x16')][_0x0923('0x19')]?_[_0x0923('0x1a')](_0x39cdc4['options']['include'],function(_0x1e70c7){return{'model':db[_0x1e70c7[_0x0923('0x1b')]],'as':_0x1e70c7['as'],'attributes':_0x1e70c7['attributes'],'include':_0x1e70c7[_0x0923('0x19')]?_[_0x0923('0x1a')](_0x1e70c7[_0x0923('0x19')],function(_0x2c0cf4){return{'model':db[_0x2c0cf4[_0x0923('0x1b')]],'as':_0x2c0cf4['as'],'attributes':_0x2c0cf4[_0x0923('0x17')],'include':_0x2c0cf4[_0x0923('0x19')]?_[_0x0923('0x1a')](_0x2c0cf4[_0x0923('0x19')],function(_0x53536b){return{'model':db[_0x53536b[_0x0923('0x1b')]],'as':_0x53536b['as'],'attributes':_0x53536b[_0x0923('0x17')]};}):[]};}):[]};}):[]:[]})[_0x0923('0xb')](function(_0x129149){logger[_0x0923('0xc')](_0x0923('0x1c'),_0x39cdc4);logger[_0x0923('0xe')](_0x0923('0x1c'),_0x39cdc4,JSON[_0x0923('0x1d')](_0x129149));_0x2f704d(_0x129149);})[_0x0923('0x14')](function(_0x3237b8){logger[_0x0923('0x11')](_0x0923('0x1c'),_0x3237b8[_0x0923('0x12')],_0x39cdc4);_0x2e0845(_0x417a4f[_0x0923('0x11')](0x1f4,_0x3237b8[_0x0923('0x12')]));});});};exports[_0x0923('0x1e')]=function(_0x403824){var _0x2a3ebf=this;return new Promise(function(_0x251b10,_0x1dbd3b){return db[_0x0923('0x15')][_0x0923('0x1f')]({'raw':_0x403824['options']?_0x403824['options'][_0x0923('0x20')]===undefined?!![]:![]:!![],'where':_0x403824[_0x0923('0x16')]?_0x403824[_0x0923('0x16')][_0x0923('0x21')]||null:null,'attributes':_0x403824[_0x0923('0x16')]?_0x403824[_0x0923('0x16')][_0x0923('0x17')]||null:null,'include':_0x403824['options']?_0x403824['options'][_0x0923('0x19')]?_[_0x0923('0x1a')](_0x403824[_0x0923('0x16')]['include'],function(_0x361bde){return{'model':db[_0x361bde[_0x0923('0x1b')]],'as':_0x361bde['as'],'attributes':_0x361bde[_0x0923('0x17')],'include':_0x361bde[_0x0923('0x19')]?_['map'](_0x361bde[_0x0923('0x19')],function(_0x44a8c5){return{'model':db[_0x44a8c5[_0x0923('0x1b')]],'as':_0x44a8c5['as'],'attributes':_0x44a8c5['attributes'],'include':_0x44a8c5[_0x0923('0x19')]?_[_0x0923('0x1a')](_0x44a8c5[_0x0923('0x19')],function(_0x4dd8b2){return{'model':db[_0x4dd8b2[_0x0923('0x1b')]],'as':_0x4dd8b2['as'],'attributes':_0x4dd8b2[_0x0923('0x17')]};}):[]};}):[]};}):[]:[]})[_0x0923('0xb')](function(_0x9214d2){logger['info']('ShowZendeskAccount',_0x403824);logger['debug'](_0x0923('0x1e'),_0x403824,JSON[_0x0923('0x1d')](_0x9214d2));_0x251b10(_0x9214d2);})[_0x0923('0x14')](function(_0x51a860){logger[_0x0923('0x11')](_0x0923('0x1e'),_0x51a860[_0x0923('0x12')],_0x403824);_0x1dbd3b(_0x2a3ebf[_0x0923('0x11')](0x1f4,_0x51a860['message']));});});}; \ No newline at end of file +var _0xdc97=['where','attributes','limit','include','map','model','GetZendeskAccount','find','ShowZendeskAccount','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','findAll','options','raw'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0xdc97,0x13b));var _0x7dc9=function(_0x244952,_0x475996){_0x244952=_0x244952-0x0;var _0x1ee663=_0xdc97[_0x244952];return _0x1ee663;};'use strict';var _=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var moment=require(_0x7dc9('0x2'));var BPromise=require('bluebird');var rs=require(_0x7dc9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7dc9('0x4'))['db'];var utils=require(_0x7dc9('0x5'));var logger=require('../../config/logger')(_0x7dc9('0x6'));var config=require(_0x7dc9('0x7'));var jayson=require(_0x7dc9('0x8'));var client=jayson[_0x7dc9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2636ef,_0x4f91c7,_0x4b3229){return new BPromise(function(_0x2ff923,_0x23737d){return client[_0x7dc9('0xa')](_0x2636ef,_0x4b3229)[_0x7dc9('0xb')](function(_0x3dd07e){logger['info'](_0x7dc9('0xc'),_0x4f91c7,_0x7dc9('0xd'));logger[_0x7dc9('0xe')](_0x7dc9('0xf'),_0x4f91c7,_0x7dc9('0xd'),JSON[_0x7dc9('0x10')](_0x3dd07e));if(_0x3dd07e[_0x7dc9('0x11')]){if(_0x3dd07e['error']['code']===0x1f4){logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x4f91c7,_0x3dd07e[_0x7dc9('0x11')][_0x7dc9('0x12')]);return _0x23737d(_0x3dd07e['error'][_0x7dc9('0x12')]);}logger[_0x7dc9('0x11')](_0x7dc9('0xc'),_0x4f91c7,_0x3dd07e[_0x7dc9('0x11')][_0x7dc9('0x12')]);return _0x2ff923(_0x3dd07e[_0x7dc9('0x11')]['message']);}else{logger[_0x7dc9('0x13')](_0x7dc9('0xc'),_0x4f91c7,_0x7dc9('0xd'));_0x2ff923(_0x3dd07e[_0x7dc9('0x14')][_0x7dc9('0x12')]);}})[_0x7dc9('0x15')](function(_0x45698c){logger[_0x7dc9('0x11')](_0x7dc9('0xc'),_0x4f91c7,_0x45698c);_0x23737d(_0x45698c);});});}exports['GetZendeskAccount']=function(_0x22577e){var _0x4afb47=this;return new Promise(function(_0x1f5906,_0x1cc237){return db['ZendeskAccount'][_0x7dc9('0x16')]({'raw':_0x22577e[_0x7dc9('0x17')]?_0x22577e[_0x7dc9('0x17')][_0x7dc9('0x18')]===undefined?!![]:![]:!![],'where':_0x22577e[_0x7dc9('0x17')]?_0x22577e[_0x7dc9('0x17')][_0x7dc9('0x19')]||null:null,'attributes':_0x22577e[_0x7dc9('0x17')]?_0x22577e[_0x7dc9('0x17')][_0x7dc9('0x1a')]||null:null,'limit':_0x22577e['options']?_0x22577e['options'][_0x7dc9('0x1b')]||null:null,'include':_0x22577e[_0x7dc9('0x17')]?_0x22577e['options'][_0x7dc9('0x1c')]?_[_0x7dc9('0x1d')](_0x22577e['options'][_0x7dc9('0x1c')],function(_0x43d31f){return{'model':db[_0x43d31f[_0x7dc9('0x1e')]],'as':_0x43d31f['as'],'attributes':_0x43d31f['attributes'],'include':_0x43d31f[_0x7dc9('0x1c')]?_[_0x7dc9('0x1d')](_0x43d31f[_0x7dc9('0x1c')],function(_0x55a482){return{'model':db[_0x55a482['model']],'as':_0x55a482['as'],'attributes':_0x55a482['attributes'],'include':_0x55a482[_0x7dc9('0x1c')]?_[_0x7dc9('0x1d')](_0x55a482['include'],function(_0x585eef){return{'model':db[_0x585eef[_0x7dc9('0x1e')]],'as':_0x585eef['as'],'attributes':_0x585eef['attributes']};}):[]};}):[]};}):[]:[]})[_0x7dc9('0xb')](function(_0x1c690b){logger[_0x7dc9('0x13')](_0x7dc9('0x1f'),_0x22577e);logger[_0x7dc9('0xe')](_0x7dc9('0x1f'),_0x22577e,JSON[_0x7dc9('0x10')](_0x1c690b));_0x1f5906(_0x1c690b);})[_0x7dc9('0x15')](function(_0x1fcf0e){logger[_0x7dc9('0x11')](_0x7dc9('0x1f'),_0x1fcf0e[_0x7dc9('0x12')],_0x22577e);_0x1cc237(_0x4afb47['error'](0x1f4,_0x1fcf0e['message']));});});};exports['ShowZendeskAccount']=function(_0x49a4a5){var _0x4a68f0=this;return new Promise(function(_0x553a03,_0x58c4e8){return db['ZendeskAccount'][_0x7dc9('0x20')]({'raw':_0x49a4a5[_0x7dc9('0x17')]?_0x49a4a5[_0x7dc9('0x17')][_0x7dc9('0x18')]===undefined?!![]:![]:!![],'where':_0x49a4a5[_0x7dc9('0x17')]?_0x49a4a5[_0x7dc9('0x17')]['where']||null:null,'attributes':_0x49a4a5['options']?_0x49a4a5['options'][_0x7dc9('0x1a')]||null:null,'include':_0x49a4a5['options']?_0x49a4a5[_0x7dc9('0x17')][_0x7dc9('0x1c')]?_[_0x7dc9('0x1d')](_0x49a4a5[_0x7dc9('0x17')][_0x7dc9('0x1c')],function(_0x165882){return{'model':db[_0x165882[_0x7dc9('0x1e')]],'as':_0x165882['as'],'attributes':_0x165882[_0x7dc9('0x1a')],'include':_0x165882['include']?_[_0x7dc9('0x1d')](_0x165882['include'],function(_0x421e1a){return{'model':db[_0x421e1a[_0x7dc9('0x1e')]],'as':_0x421e1a['as'],'attributes':_0x421e1a[_0x7dc9('0x1a')],'include':_0x421e1a[_0x7dc9('0x1c')]?_['map'](_0x421e1a[_0x7dc9('0x1c')],function(_0x47fb58){return{'model':db[_0x47fb58[_0x7dc9('0x1e')]],'as':_0x47fb58['as'],'attributes':_0x47fb58['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x265a5f){logger[_0x7dc9('0x13')](_0x7dc9('0x21'),_0x49a4a5);logger[_0x7dc9('0xe')]('ShowZendeskAccount',_0x49a4a5,JSON[_0x7dc9('0x10')](_0x265a5f));_0x553a03(_0x265a5f);})[_0x7dc9('0x15')](function(_0x138f33){logger[_0x7dc9('0x11')](_0x7dc9('0x21'),_0x138f33[_0x7dc9('0x12')],_0x49a4a5);_0x58c4e8(_0x4a68f0[_0x7dc9('0x11')](0x1f4,_0x138f33[_0x7dc9('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 3a3fd4b..d657cc3 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 _0xb10b=['getFields','/:id/subjects','/:id/descriptions','getTags','post','create','setTags','put','/:id','update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','index','isAuthenticated','show','/:id/fields'];(function(_0x4ed386,_0x5e9cd4){var _0x50ea50=function(_0x53d19e){while(--_0x53d19e){_0x4ed386['push'](_0x4ed386['shift']());}};_0x50ea50(++_0x5e9cd4);}(_0xb10b,0x12a));var _0xbb10=function(_0x2aed3,_0x5f9c05){_0x2aed3=_0x2aed3-0x0;var _0x160e00=_0xb10b[_0x2aed3];return _0x160e00;};'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['getSubjects']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getDescriptions']);router[_0xbb10('0x9')]('/:id/tags',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x12')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router[_0xbb10('0x12')]('/:id/tags',auth[_0xbb10('0xb')](),controller[_0xbb10('0x14')]);router[_0xbb10('0x15')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x18')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x19')]);module['exports']=router; \ No newline at end of file +var _0xf4eb=['put','update','delete','/:id','destroy','exports','multer','Router','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/tags','getTags','create','post','setTags'];(function(_0x19557d,_0x33ff6f){var _0x54aedc=function(_0xc4770d){while(--_0xc4770d){_0x19557d['push'](_0x19557d['shift']());}};_0x54aedc(++_0x33ff6f);}(_0xf4eb,0xec));var _0xbf4e=function(_0xce0b84,_0x2c4e85){_0xce0b84=_0xce0b84-0x0;var _0x10f02d=_0xf4eb[_0xce0b84];return _0x10f02d;};'use strict';var multer=require(_0xbf4e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbf4e('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbf4e('0x2'));var config=require(_0xbf4e('0x3'));var controller=require(_0xbf4e('0x4'));router[_0xbf4e('0x5')]('/',auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x7')]);router[_0xbf4e('0x5')]('/:id',auth[_0xbf4e('0x6')](),controller['show']);router['get'](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x9')]);router[_0xbf4e('0x5')](_0xbf4e('0xa'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0xb')]);router['get']('/:id/descriptions',auth[_0xbf4e('0x6')](),controller['getDescriptions']);router[_0xbf4e('0x5')](_0xbf4e('0xc'),auth['isAuthenticated'](),controller[_0xbf4e('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbf4e('0xe')]);router[_0xbf4e('0xf')](_0xbf4e('0xc'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x10')]);router[_0xbf4e('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xbf4e('0x12')]);router[_0xbf4e('0x13')](_0xbf4e('0x14'),auth['isAuthenticated'](),controller[_0xbf4e('0x15')]);module[_0xbf4e('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 674084b..be0ec87 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 _0xa480=['exports','STRING','sequelize'];(function(_0x3d1bc5,_0x546dcd){var _0x58a07c=function(_0x20f130){while(--_0x20f130){_0x3d1bc5['push'](_0x3d1bc5['shift']());}};_0x58a07c(++_0x546dcd);}(_0xa480,0x18b));var _0x0a48=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0xa480[_0x432fca];return _0x3adba4;};'use strict';var Sequelize=require(_0x0a48('0x0'));module[_0x0a48('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0a48('0x2')]}}; \ No newline at end of file +var _0x1f48=['exports','STRING'];(function(_0x571bc9,_0x47dd61){var _0x3d2e64=function(_0x7ac955){while(--_0x7ac955){_0x571bc9['push'](_0x571bc9['shift']());}};_0x3d2e64(++_0x47dd61);}(_0x1f48,0x8a));var _0x81f4=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0x1f48[_0x45bf86];return _0x1f02b7;};'use strict';var Sequelize=require('sequelize');module[_0x81f4('0x0')]={'name':{'type':Sequelize[_0x81f4('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 2d6d0b0..38be862 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 _0xa9d1=['intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','include','ZendeskConfiguration','findAll','rows','catch','params','includeAll','find','create','body','findOne','ZendeskField','order','getSubjects','getDescriptions','Tag','getTags','setTags','ids','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters'];(function(_0x872891,_0x2f615d){var _0xf5c75b=function(_0x4c8247){while(--_0x4c8247){_0x872891['push'](_0x872891['shift']());}};_0xf5c75b(++_0x2f615d);}(_0xa9d1,0x121));var _0x1a9d=function(_0x132fcd,_0x1f59d9){_0x132fcd=_0x132fcd-0x0;var _0x54ba20=_0xa9d1[_0x132fcd];return _0x54ba20;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1a9d('0x0'));var zipdir=require(_0x1a9d('0x1'));var jsonpatch=require(_0x1a9d('0x2'));var rp=require(_0x1a9d('0x3'));var moment=require(_0x1a9d('0x4'));var BPromise=require(_0x1a9d('0x5'));var Mustache=require(_0x1a9d('0x6'));var util=require(_0x1a9d('0x7'));var path=require(_0x1a9d('0x8'));var sox=require(_0x1a9d('0x9'));var csv=require(_0x1a9d('0xa'));var ejs=require(_0x1a9d('0xb'));var fs=require('fs');var fs_extra=require(_0x1a9d('0xc'));var _=require(_0x1a9d('0xd'));var squel=require(_0x1a9d('0xe'));var crypto=require(_0x1a9d('0xf'));var jsforce=require(_0x1a9d('0x10'));var deskjs=require(_0x1a9d('0x11'));var toCsv=require('to-csv');var querystring=require(_0x1a9d('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1a9d('0x13'));var qs=require(_0x1a9d('0x14'));var as=require(_0x1a9d('0x15'));var hardwareService=require(_0x1a9d('0x16'));var logger=require(_0x1a9d('0x17'))(_0x1a9d('0x18'));var utils=require(_0x1a9d('0x19'));var config=require(_0x1a9d('0x1a'));var licenseUtil=require(_0x1a9d('0x1b'));var db=require(_0x1a9d('0x1c'))['db'];function respondWithStatusCode(_0x2904d0,_0x294664){_0x294664=_0x294664||0xcc;return function(_0x22574a){if(_0x22574a){return _0x2904d0[_0x1a9d('0x1d')](_0x294664);}return _0x2904d0['status'](_0x294664)['end']();};}function respondWithResult(_0x323a03,_0x10a351){_0x10a351=_0x10a351||0xc8;return function(_0x22c240){if(_0x22c240){return _0x323a03[_0x1a9d('0x1e')](_0x10a351)[_0x1a9d('0x1f')](_0x22c240);}};}function respondWithFilteredResult(_0x124a7d,_0x25dc46){return function(_0x2d34c7){if(_0x2d34c7){var _0x22aafd=typeof _0x25dc46[_0x1a9d('0x20')]==='undefined'&&typeof _0x25dc46['limit']===_0x1a9d('0x21');var _0x457230=_0x2d34c7[_0x1a9d('0x22')];var _0x28934e=_0x22aafd?0x0:_0x25dc46[_0x1a9d('0x20')];var _0x38428c=_0x22aafd?_0x2d34c7[_0x1a9d('0x22')]:_0x25dc46[_0x1a9d('0x20')]+_0x25dc46[_0x1a9d('0x23')];var _0x406493;if(_0x38428c>=_0x457230){_0x38428c=_0x457230;_0x406493=0xc8;}else{_0x406493=0xce;}_0x124a7d['status'](_0x406493);return _0x124a7d['set'](_0x1a9d('0x24'),_0x28934e+'-'+_0x38428c+'/'+_0x457230)[_0x1a9d('0x1f')](_0x2d34c7);}return null;};}function patchUpdates(_0x4f2ee2){return function(_0x480a25){try{jsonpatch['apply'](_0x480a25,_0x4f2ee2,!![]);}catch(_0xba857a){return BPromise[_0x1a9d('0x25')](_0xba857a);}return _0x480a25[_0x1a9d('0x26')]();};}function saveUpdates(_0x35ba0c,_0x64f409){return function(_0x3dca4f){if(_0x3dca4f){return _0x3dca4f[_0x1a9d('0x27')](_0x35ba0c)[_0x1a9d('0x28')](function(_0x4fc5ce){return _0x4fc5ce;});}return null;};}function removeEntity(_0x3e15d8,_0x262206){return function(_0x344021){if(_0x344021){return _0x344021[_0x1a9d('0x29')]()[_0x1a9d('0x28')](function(){_0x3e15d8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x48435c,_0x19e8f9){return function(_0x580408){if(!_0x580408){_0x48435c['sendStatus'](0x194);}return _0x580408;};}function handleError(_0x1c766f,_0x3f4cac){_0x3f4cac=_0x3f4cac||0x1f4;return function(_0x2632d4){logger[_0x1a9d('0x2a')](_0x2632d4[_0x1a9d('0x2b')]);if(_0x2632d4[_0x1a9d('0x2c')]){delete _0x2632d4['name'];}_0x1c766f[_0x1a9d('0x1e')](_0x3f4cac)[_0x1a9d('0x2d')](_0x2632d4);};}exports[_0x1a9d('0x2e')]=function(_0x212cec,_0x293a99){var _0x35b755={},_0x1b43b2={},_0x4257bc={'count':0x0,'rows':[]};var _0x2f36d9=_[_0x1a9d('0x2f')](db['ZendeskConfiguration'][_0x1a9d('0x30')],function(_0x533526){return{'name':_0x533526[_0x1a9d('0x31')],'type':_0x533526[_0x1a9d('0x32')]['key']};});_0x1b43b2[_0x1a9d('0x33')]=_['map'](_0x2f36d9,_0x1a9d('0x2c'));_0x1b43b2[_0x1a9d('0x34')]=_[_0x1a9d('0x35')](_0x212cec[_0x1a9d('0x34')]);_0x1b43b2[_0x1a9d('0x36')]=_[_0x1a9d('0x37')](_0x1b43b2[_0x1a9d('0x33')],_0x1b43b2[_0x1a9d('0x34')]);_0x35b755[_0x1a9d('0x38')]=_['intersection'](_0x1b43b2[_0x1a9d('0x33')],qs[_0x1a9d('0x39')](_0x212cec['query'][_0x1a9d('0x39')]));_0x35b755[_0x1a9d('0x38')]=_0x35b755['attributes'][_0x1a9d('0x3a')]?_0x35b755[_0x1a9d('0x38')]:_0x1b43b2[_0x1a9d('0x33')];if(!_0x212cec[_0x1a9d('0x34')][_0x1a9d('0x3b')](_0x1a9d('0x3c'))){_0x35b755['limit']=qs[_0x1a9d('0x23')](_0x212cec['query'][_0x1a9d('0x23')]);_0x35b755[_0x1a9d('0x20')]=qs['offset'](_0x212cec[_0x1a9d('0x34')][_0x1a9d('0x20')]);}_0x35b755['order']=qs[_0x1a9d('0x3d')](_0x212cec[_0x1a9d('0x34')][_0x1a9d('0x3d')]);_0x35b755[_0x1a9d('0x3e')]=qs[_0x1a9d('0x36')](_[_0x1a9d('0x3f')](_0x212cec[_0x1a9d('0x34')],_0x1b43b2['filters']),_0x2f36d9);if(_0x212cec[_0x1a9d('0x34')][_0x1a9d('0x40')]){_0x35b755[_0x1a9d('0x3e')]=_['merge'](_0x35b755[_0x1a9d('0x3e')],{'$or':_[_0x1a9d('0x2f')](_0x2f36d9,function(_0x34f457){if(_0x34f457[_0x1a9d('0x32')]!=='VIRTUAL'){var _0x4dcee1={};_0x4dcee1[_0x34f457[_0x1a9d('0x2c')]]={'$like':'%'+_0x212cec[_0x1a9d('0x34')][_0x1a9d('0x40')]+'%'};return _0x4dcee1;}})});}_0x35b755=_[_0x1a9d('0x41')]({},_0x35b755,_0x212cec[_0x1a9d('0x42')]);var _0xdd5215={'where':_0x35b755[_0x1a9d('0x3e')]};return db['ZendeskConfiguration'][_0x1a9d('0x22')](_0xdd5215)['then'](function(_0x2429c1){_0x4257bc['count']=_0x2429c1;if(_0x212cec[_0x1a9d('0x34')]['includeAll']){_0x35b755[_0x1a9d('0x43')]=[{'all':!![]}];}return db[_0x1a9d('0x44')][_0x1a9d('0x45')](_0x35b755);})[_0x1a9d('0x28')](function(_0x150283){_0x4257bc[_0x1a9d('0x46')]=_0x150283;return _0x4257bc;})[_0x1a9d('0x28')](respondWithFilteredResult(_0x293a99,_0x35b755))[_0x1a9d('0x47')](handleError(_0x293a99,null));};exports['show']=function(_0x3ec988,_0x2f9ed7){var _0x29eb71={'raw':![],'where':{'id':_0x3ec988[_0x1a9d('0x48')]['id']}},_0x67513c={};_0x67513c['model']=_[_0x1a9d('0x35')](db[_0x1a9d('0x44')][_0x1a9d('0x30')]);_0x67513c['query']=_['keys'](_0x3ec988[_0x1a9d('0x34')]);_0x67513c[_0x1a9d('0x36')]=_[_0x1a9d('0x37')](_0x67513c[_0x1a9d('0x33')],_0x67513c[_0x1a9d('0x34')]);_0x29eb71[_0x1a9d('0x38')]=_[_0x1a9d('0x37')](_0x67513c[_0x1a9d('0x33')],qs[_0x1a9d('0x39')](_0x3ec988[_0x1a9d('0x34')][_0x1a9d('0x39')]));_0x29eb71['attributes']=_0x29eb71[_0x1a9d('0x38')][_0x1a9d('0x3a')]?_0x29eb71[_0x1a9d('0x38')]:_0x67513c[_0x1a9d('0x33')];if(_0x3ec988['query'][_0x1a9d('0x49')]){_0x29eb71[_0x1a9d('0x43')]=[{'all':!![]}];}_0x29eb71=_['merge']({},_0x29eb71,_0x3ec988[_0x1a9d('0x42')]);return db['ZendeskConfiguration'][_0x1a9d('0x4a')](_0x29eb71)[_0x1a9d('0x28')](handleEntityNotFound(_0x2f9ed7,null))[_0x1a9d('0x28')](respondWithResult(_0x2f9ed7,null))[_0x1a9d('0x47')](handleError(_0x2f9ed7,null));};exports[_0x1a9d('0x4b')]=function(_0x55f5a2,_0x4ad1b6){return db[_0x1a9d('0x44')][_0x1a9d('0x4b')](_0x55f5a2['body'],{})[_0x1a9d('0x28')](respondWithResult(_0x4ad1b6,0xc9))[_0x1a9d('0x47')](handleError(_0x4ad1b6,null));};exports['update']=function(_0x59671b,_0x23e875){if(_0x59671b[_0x1a9d('0x4c')]['id']){delete _0x59671b['body']['id'];}return db[_0x1a9d('0x44')][_0x1a9d('0x4a')]({'where':{'id':_0x59671b['params']['id']}})['then'](handleEntityNotFound(_0x23e875,null))[_0x1a9d('0x28')](saveUpdates(_0x59671b['body'],null))['then'](respondWithResult(_0x23e875,null))[_0x1a9d('0x47')](handleError(_0x23e875,null));};exports[_0x1a9d('0x29')]=function(_0x520034,_0x217f86){return db[_0x1a9d('0x44')]['find']({'where':{'id':_0x520034[_0x1a9d('0x48')]['id']}})[_0x1a9d('0x28')](handleEntityNotFound(_0x217f86,null))[_0x1a9d('0x28')](removeEntity(_0x217f86,null))[_0x1a9d('0x47')](handleError(_0x217f86,null));};exports['getFields']=function(_0x22ac78,_0x25af95,_0x21e632){var _0x3f1144={};var _0x570c35={};var _0x3c75a4;var _0x5c7ae3;return db['ZendeskConfiguration'][_0x1a9d('0x4d')]({'where':{'id':_0x22ac78['params']['id']}})['then'](handleEntityNotFound(_0x25af95,null))[_0x1a9d('0x28')](function(_0x1a2eda){if(_0x1a2eda){_0x3c75a4=_0x1a2eda;_0x570c35['model']=_[_0x1a9d('0x35')](db[_0x1a9d('0x4e')][_0x1a9d('0x30')]);_0x570c35[_0x1a9d('0x34')]=_[_0x1a9d('0x35')](_0x22ac78[_0x1a9d('0x34')]);_0x570c35['filters']=_['intersection'](_0x570c35[_0x1a9d('0x33')],_0x570c35[_0x1a9d('0x34')]);_0x3f1144[_0x1a9d('0x38')]=_['intersection'](_0x570c35[_0x1a9d('0x33')],qs[_0x1a9d('0x39')](_0x22ac78['query'][_0x1a9d('0x39')]));_0x3f1144[_0x1a9d('0x38')]=_0x3f1144[_0x1a9d('0x38')][_0x1a9d('0x3a')]?_0x3f1144[_0x1a9d('0x38')]:_0x570c35[_0x1a9d('0x33')];_0x3f1144[_0x1a9d('0x4f')]=qs['sort'](_0x22ac78[_0x1a9d('0x34')][_0x1a9d('0x3d')]);_0x3f1144['where']=qs[_0x1a9d('0x36')](_['pick'](_0x22ac78['query'],_0x570c35['filters']));if(_0x22ac78['query'][_0x1a9d('0x40')]){_0x3f1144[_0x1a9d('0x3e')]=_[_0x1a9d('0x41')](_0x3f1144[_0x1a9d('0x3e')],{'$or':_[_0x1a9d('0x2f')](_0x3f1144[_0x1a9d('0x38')],function(_0x886602){var _0x13a463={};_0x13a463[_0x886602]={'$like':'%'+_0x22ac78[_0x1a9d('0x34')][_0x1a9d('0x40')]+'%'};return _0x13a463;})});}_0x3f1144=_[_0x1a9d('0x41')]({},_0x3f1144,_0x22ac78[_0x1a9d('0x42')]);return _0x3c75a4['getFields'](_0x3f1144);}})[_0x1a9d('0x28')](function(_0x2b56e5){if(_0x2b56e5){_0x5c7ae3=_0x2b56e5['length'];if(!_0x22ac78['query'][_0x1a9d('0x3b')]('nolimit')){_0x3f1144[_0x1a9d('0x23')]=qs['limit'](_0x22ac78[_0x1a9d('0x34')][_0x1a9d('0x23')]);_0x3f1144[_0x1a9d('0x20')]=qs['offset'](_0x22ac78[_0x1a9d('0x34')][_0x1a9d('0x20')]);}return _0x3c75a4['getFields'](_0x3f1144);}})[_0x1a9d('0x28')](function(_0x1069bb){if(_0x1069bb){return _0x1069bb?{'count':_0x5c7ae3,'rows':_0x1069bb}:null;}})[_0x1a9d('0x28')](respondWithResult(_0x25af95,null))['catch'](handleError(_0x25af95,null));};exports[_0x1a9d('0x50')]=function(_0x437f31,_0x146021,_0x161e4b){var _0x22743d={};var _0x213a2b={};var _0x53c618;var _0x560e6e;return db[_0x1a9d('0x44')][_0x1a9d('0x4d')]({'where':{'id':_0x437f31[_0x1a9d('0x48')]['id']}})['then'](handleEntityNotFound(_0x146021,null))[_0x1a9d('0x28')](function(_0x38d019){if(_0x38d019){_0x53c618=_0x38d019;_0x213a2b[_0x1a9d('0x33')]=_[_0x1a9d('0x35')](db[_0x1a9d('0x4e')]['rawAttributes']);_0x213a2b[_0x1a9d('0x34')]=_[_0x1a9d('0x35')](_0x437f31[_0x1a9d('0x34')]);_0x213a2b[_0x1a9d('0x36')]=_['intersection'](_0x213a2b['model'],_0x213a2b[_0x1a9d('0x34')]);_0x22743d[_0x1a9d('0x38')]=_[_0x1a9d('0x37')](_0x213a2b['model'],qs[_0x1a9d('0x39')](_0x437f31['query']['fields']));_0x22743d[_0x1a9d('0x38')]=_0x22743d[_0x1a9d('0x38')][_0x1a9d('0x3a')]?_0x22743d[_0x1a9d('0x38')]:_0x213a2b[_0x1a9d('0x33')];_0x22743d['order']=qs[_0x1a9d('0x3d')](_0x437f31[_0x1a9d('0x34')][_0x1a9d('0x3d')]);_0x22743d[_0x1a9d('0x3e')]=qs[_0x1a9d('0x36')](_[_0x1a9d('0x3f')](_0x437f31[_0x1a9d('0x34')],_0x213a2b['filters']));if(_0x437f31[_0x1a9d('0x34')][_0x1a9d('0x40')]){_0x22743d[_0x1a9d('0x3e')]=_[_0x1a9d('0x41')](_0x22743d[_0x1a9d('0x3e')],{'$or':_[_0x1a9d('0x2f')](_0x22743d[_0x1a9d('0x38')],function(_0x31e5d4){var _0x146ed8={};_0x146ed8[_0x31e5d4]={'$like':'%'+_0x437f31[_0x1a9d('0x34')][_0x1a9d('0x40')]+'%'};return _0x146ed8;})});}_0x22743d=_[_0x1a9d('0x41')]({},_0x22743d,_0x437f31[_0x1a9d('0x42')]);return _0x53c618[_0x1a9d('0x50')](_0x22743d);}})[_0x1a9d('0x28')](function(_0x47dc4c){if(_0x47dc4c){_0x560e6e=_0x47dc4c[_0x1a9d('0x3a')];if(!_0x437f31['query']['hasOwnProperty'](_0x1a9d('0x3c'))){_0x22743d[_0x1a9d('0x23')]=qs[_0x1a9d('0x23')](_0x437f31[_0x1a9d('0x34')][_0x1a9d('0x23')]);_0x22743d[_0x1a9d('0x20')]=qs[_0x1a9d('0x20')](_0x437f31[_0x1a9d('0x34')][_0x1a9d('0x20')]);}return _0x53c618[_0x1a9d('0x50')](_0x22743d);}})['then'](function(_0x2a363){if(_0x2a363){return _0x2a363?{'count':_0x560e6e,'rows':_0x2a363}:null;}})[_0x1a9d('0x28')](respondWithResult(_0x146021,null))[_0x1a9d('0x47')](handleError(_0x146021,null));};exports[_0x1a9d('0x51')]=function(_0x27a830,_0x4fa099,_0xd50f4){var _0x394ddc={};var _0x44267c={};var _0x52f3d6;var _0x16bbf2;return db[_0x1a9d('0x44')][_0x1a9d('0x4d')]({'where':{'id':_0x27a830['params']['id']}})['then'](handleEntityNotFound(_0x4fa099,null))['then'](function(_0x1f6d4d){if(_0x1f6d4d){_0x52f3d6=_0x1f6d4d;_0x44267c[_0x1a9d('0x33')]=_[_0x1a9d('0x35')](db['ZendeskField']['rawAttributes']);_0x44267c[_0x1a9d('0x34')]=_[_0x1a9d('0x35')](_0x27a830[_0x1a9d('0x34')]);_0x44267c['filters']=_['intersection'](_0x44267c[_0x1a9d('0x33')],_0x44267c[_0x1a9d('0x34')]);_0x394ddc['attributes']=_[_0x1a9d('0x37')](_0x44267c[_0x1a9d('0x33')],qs['fields'](_0x27a830[_0x1a9d('0x34')][_0x1a9d('0x39')]));_0x394ddc['attributes']=_0x394ddc[_0x1a9d('0x38')]['length']?_0x394ddc[_0x1a9d('0x38')]:_0x44267c[_0x1a9d('0x33')];_0x394ddc[_0x1a9d('0x4f')]=qs[_0x1a9d('0x3d')](_0x27a830['query'][_0x1a9d('0x3d')]);_0x394ddc[_0x1a9d('0x3e')]=qs[_0x1a9d('0x36')](_[_0x1a9d('0x3f')](_0x27a830[_0x1a9d('0x34')],_0x44267c[_0x1a9d('0x36')]));if(_0x27a830['query'][_0x1a9d('0x40')]){_0x394ddc['where']=_[_0x1a9d('0x41')](_0x394ddc[_0x1a9d('0x3e')],{'$or':_[_0x1a9d('0x2f')](_0x394ddc[_0x1a9d('0x38')],function(_0x106b41){var _0x1c6d4d={};_0x1c6d4d[_0x106b41]={'$like':'%'+_0x27a830['query'][_0x1a9d('0x40')]+'%'};return _0x1c6d4d;})});}_0x394ddc=_[_0x1a9d('0x41')]({},_0x394ddc,_0x27a830[_0x1a9d('0x42')]);return _0x52f3d6[_0x1a9d('0x51')](_0x394ddc);}})[_0x1a9d('0x28')](function(_0x4b50ec){if(_0x4b50ec){_0x16bbf2=_0x4b50ec['length'];if(!_0x27a830[_0x1a9d('0x34')][_0x1a9d('0x3b')](_0x1a9d('0x3c'))){_0x394ddc[_0x1a9d('0x23')]=qs['limit'](_0x27a830[_0x1a9d('0x34')]['limit']);_0x394ddc[_0x1a9d('0x20')]=qs[_0x1a9d('0x20')](_0x27a830[_0x1a9d('0x34')][_0x1a9d('0x20')]);}return _0x52f3d6[_0x1a9d('0x51')](_0x394ddc);}})[_0x1a9d('0x28')](function(_0x378add){if(_0x378add){return _0x378add?{'count':_0x16bbf2,'rows':_0x378add}:null;}})[_0x1a9d('0x28')](respondWithResult(_0x4fa099,null))[_0x1a9d('0x47')](handleError(_0x4fa099,null));};exports['getTags']=function(_0x286afd,_0x16e691,_0x33cf7d){var _0x2d5050={};var _0x5b5236={};var _0x34cac3;var _0x2419bf;return db['ZendeskConfiguration'][_0x1a9d('0x4d')]({'where':{'id':_0x286afd['params']['id']}})[_0x1a9d('0x28')](handleEntityNotFound(_0x16e691,null))[_0x1a9d('0x28')](function(_0x35088e){if(_0x35088e){_0x34cac3=_0x35088e;_0x5b5236[_0x1a9d('0x33')]=_[_0x1a9d('0x35')](db[_0x1a9d('0x52')][_0x1a9d('0x30')]);_0x5b5236[_0x1a9d('0x34')]=_[_0x1a9d('0x35')](_0x286afd[_0x1a9d('0x34')]);_0x5b5236['filters']=_[_0x1a9d('0x37')](_0x5b5236[_0x1a9d('0x33')],_0x5b5236[_0x1a9d('0x34')]);_0x2d5050[_0x1a9d('0x38')]=_[_0x1a9d('0x37')](_0x5b5236[_0x1a9d('0x33')],qs[_0x1a9d('0x39')](_0x286afd['query'][_0x1a9d('0x39')]));_0x2d5050[_0x1a9d('0x38')]=_0x2d5050[_0x1a9d('0x38')][_0x1a9d('0x3a')]?_0x2d5050[_0x1a9d('0x38')]:_0x5b5236['model'];_0x2d5050[_0x1a9d('0x4f')]=qs['sort'](_0x286afd[_0x1a9d('0x34')]['sort']);_0x2d5050[_0x1a9d('0x3e')]=qs[_0x1a9d('0x36')](_[_0x1a9d('0x3f')](_0x286afd[_0x1a9d('0x34')],_0x5b5236['filters']));if(_0x286afd[_0x1a9d('0x34')]['filter']){_0x2d5050['where']=_[_0x1a9d('0x41')](_0x2d5050[_0x1a9d('0x3e')],{'$or':_[_0x1a9d('0x2f')](_0x2d5050[_0x1a9d('0x38')],function(_0x19f6ba){var _0x182b93={};_0x182b93[_0x19f6ba]={'$like':'%'+_0x286afd[_0x1a9d('0x34')][_0x1a9d('0x40')]+'%'};return _0x182b93;})});}_0x2d5050=_['merge']({},_0x2d5050,_0x286afd[_0x1a9d('0x42')]);return _0x34cac3[_0x1a9d('0x53')](_0x2d5050);}})[_0x1a9d('0x28')](function(_0xdfe171){if(_0xdfe171){_0x2419bf=_0xdfe171[_0x1a9d('0x3a')];if(!_0x286afd[_0x1a9d('0x34')][_0x1a9d('0x3b')](_0x1a9d('0x3c'))){_0x2d5050[_0x1a9d('0x23')]=qs['limit'](_0x286afd[_0x1a9d('0x34')]['limit']);_0x2d5050[_0x1a9d('0x20')]=qs['offset'](_0x286afd[_0x1a9d('0x34')][_0x1a9d('0x20')]);}return _0x34cac3[_0x1a9d('0x53')](_0x2d5050);}})[_0x1a9d('0x28')](function(_0x4c7977){if(_0x4c7977){return _0x4c7977?{'count':_0x2419bf,'rows':_0x4c7977}:null;}})[_0x1a9d('0x28')](respondWithResult(_0x16e691,null))[_0x1a9d('0x47')](handleError(_0x16e691,null));};exports[_0x1a9d('0x54')]=function(_0x808fe3,_0x43858f,_0x39c451){if(_0x808fe3[_0x1a9d('0x4c')]['id']){delete _0x808fe3[_0x1a9d('0x4c')]['id'];}return db[_0x1a9d('0x44')][_0x1a9d('0x4d')]({'where':{'id':_0x808fe3['params']['id']}})[_0x1a9d('0x28')](handleEntityNotFound(_0x43858f,null))[_0x1a9d('0x28')](function(_0x3966ec){if(_0x3966ec){return _0x3966ec[_0x1a9d('0x54')](_0x808fe3[_0x1a9d('0x4c')][_0x1a9d('0x55')]||[]);}return null;})[_0x1a9d('0x28')](respondWithResult(_0x43858f,null))[_0x1a9d('0x47')](handleError(_0x43858f,null));}; \ No newline at end of file +var _0x5012=['then','error','name','send','index','ZendeskConfiguration','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','map','VIRTUAL','filter','includeAll','include','rows','catch','show','params','keys','options','find','create','body','update','getFields','ZendeskField','nolimit','getSubjects','findOne','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','apply','save','destroy'];(function(_0x379fb9,_0x532b2a){var _0x242660=function(_0x4975af){while(--_0x4975af){_0x379fb9['push'](_0x379fb9['shift']());}};_0x242660(++_0x532b2a);}(_0x5012,0x12c));var _0x2501=function(_0x5b7788,_0x309ae5){_0x5b7788=_0x5b7788-0x0;var _0x573871=_0x5012[_0x5b7788];return _0x573871;};'use strict';var emlformat=require(_0x2501('0x0'));var rimraf=require(_0x2501('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2501('0x2'));var moment=require(_0x2501('0x3'));var BPromise=require(_0x2501('0x4'));var Mustache=require(_0x2501('0x5'));var util=require(_0x2501('0x6'));var path=require(_0x2501('0x7'));var sox=require(_0x2501('0x8'));var csv=require(_0x2501('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2501('0xa'));var _=require(_0x2501('0xb'));var squel=require('squel');var crypto=require(_0x2501('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2501('0xd'));var toCsv=require(_0x2501('0x9'));var querystring=require('querystring');var Papa=require(_0x2501('0xe'));var Redis=require(_0x2501('0xf'));var authService=require(_0x2501('0x10'));var qs=require(_0x2501('0x11'));var as=require(_0x2501('0x12'));var hardwareService=require(_0x2501('0x13'));var logger=require(_0x2501('0x14'))(_0x2501('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2501('0x16'));var db=require(_0x2501('0x17'))['db'];function respondWithStatusCode(_0x5cb1fd,_0x5285aa){_0x5285aa=_0x5285aa||0xcc;return function(_0x107e0d){if(_0x107e0d){return _0x5cb1fd[_0x2501('0x18')](_0x5285aa);}return _0x5cb1fd[_0x2501('0x19')](_0x5285aa)[_0x2501('0x1a')]();};}function respondWithResult(_0x552cfb,_0x462a94){_0x462a94=_0x462a94||0xc8;return function(_0x5bee18){if(_0x5bee18){return _0x552cfb[_0x2501('0x19')](_0x462a94)[_0x2501('0x1b')](_0x5bee18);}};}function respondWithFilteredResult(_0x26b79e,_0x433f43){return function(_0x7e3607){if(_0x7e3607){var _0x491370=typeof _0x433f43['offset']===_0x2501('0x1c')&&typeof _0x433f43['limit']==='undefined';var _0xf89697=_0x7e3607[_0x2501('0x1d')];var _0x557386=_0x491370?0x0:_0x433f43[_0x2501('0x1e')];var _0x49f5bb=_0x491370?_0x7e3607[_0x2501('0x1d')]:_0x433f43[_0x2501('0x1e')]+_0x433f43[_0x2501('0x1f')];var _0x20751e;if(_0x49f5bb>=_0xf89697){_0x49f5bb=_0xf89697;_0x20751e=0xc8;}else{_0x20751e=0xce;}_0x26b79e[_0x2501('0x19')](_0x20751e);return _0x26b79e[_0x2501('0x20')]('Content-Range',_0x557386+'-'+_0x49f5bb+'/'+_0xf89697)[_0x2501('0x1b')](_0x7e3607);}return null;};}function patchUpdates(_0x1432f4){return function(_0x466cfb){try{jsonpatch[_0x2501('0x21')](_0x466cfb,_0x1432f4,!![]);}catch(_0x19f6eb){return BPromise['reject'](_0x19f6eb);}return _0x466cfb[_0x2501('0x22')]();};}function saveUpdates(_0x361e91,_0x53614a){return function(_0x3c36b5){if(_0x3c36b5){return _0x3c36b5['update'](_0x361e91)['then'](function(_0x4753ad){return _0x4753ad;});}return null;};}function removeEntity(_0x1c36a5,_0x2a69ef){return function(_0x6965cb){if(_0x6965cb){return _0x6965cb[_0x2501('0x23')]()[_0x2501('0x24')](function(){_0x1c36a5[_0x2501('0x19')](0xcc)[_0x2501('0x1a')]();});}};}function handleEntityNotFound(_0x3b0f8d,_0x386bf9){return function(_0x255d09){if(!_0x255d09){_0x3b0f8d[_0x2501('0x18')](0x194);}return _0x255d09;};}function handleError(_0x321c96,_0x2dc7b7){_0x2dc7b7=_0x2dc7b7||0x1f4;return function(_0x1684ab){logger[_0x2501('0x25')](_0x1684ab['stack']);if(_0x1684ab[_0x2501('0x26')]){delete _0x1684ab[_0x2501('0x26')];}_0x321c96['status'](_0x2dc7b7)[_0x2501('0x27')](_0x1684ab);};}exports[_0x2501('0x28')]=function(_0x2148fe,_0x2ead50){var _0x7650dc={},_0x260c6a={},_0x27af8a={'count':0x0,'rows':[]};var _0x3c3a86=_['map'](db[_0x2501('0x29')][_0x2501('0x2a')],function(_0x2020e){return{'name':_0x2020e[_0x2501('0x2b')],'type':_0x2020e[_0x2501('0x2c')][_0x2501('0x2d')]};});_0x260c6a['model']=_['map'](_0x3c3a86,'name');_0x260c6a[_0x2501('0x2e')]=_['keys'](_0x2148fe[_0x2501('0x2e')]);_0x260c6a[_0x2501('0x2f')]=_[_0x2501('0x30')](_0x260c6a[_0x2501('0x31')],_0x260c6a['query']);_0x7650dc[_0x2501('0x32')]=_[_0x2501('0x30')](_0x260c6a[_0x2501('0x31')],qs[_0x2501('0x33')](_0x2148fe['query']['fields']));_0x7650dc['attributes']=_0x7650dc[_0x2501('0x32')][_0x2501('0x34')]?_0x7650dc[_0x2501('0x32')]:_0x260c6a[_0x2501('0x31')];if(!_0x2148fe[_0x2501('0x2e')][_0x2501('0x35')]('nolimit')){_0x7650dc[_0x2501('0x1f')]=qs[_0x2501('0x1f')](_0x2148fe[_0x2501('0x2e')]['limit']);_0x7650dc[_0x2501('0x1e')]=qs[_0x2501('0x1e')](_0x2148fe[_0x2501('0x2e')][_0x2501('0x1e')]);}_0x7650dc[_0x2501('0x36')]=qs[_0x2501('0x37')](_0x2148fe[_0x2501('0x2e')][_0x2501('0x37')]);_0x7650dc[_0x2501('0x38')]=qs[_0x2501('0x2f')](_[_0x2501('0x39')](_0x2148fe['query'],_0x260c6a[_0x2501('0x2f')]),_0x3c3a86);if(_0x2148fe[_0x2501('0x2e')]['filter']){_0x7650dc[_0x2501('0x38')]=_[_0x2501('0x3a')](_0x7650dc[_0x2501('0x38')],{'$or':_[_0x2501('0x3b')](_0x3c3a86,function(_0x1b20d2){if(_0x1b20d2[_0x2501('0x2c')]!==_0x2501('0x3c')){var _0x3d95ba={};_0x3d95ba[_0x1b20d2[_0x2501('0x26')]]={'$like':'%'+_0x2148fe['query'][_0x2501('0x3d')]+'%'};return _0x3d95ba;}})});}_0x7650dc=_[_0x2501('0x3a')]({},_0x7650dc,_0x2148fe['options']);var _0x5996d2={'where':_0x7650dc[_0x2501('0x38')]};return db['ZendeskConfiguration'][_0x2501('0x1d')](_0x5996d2)['then'](function(_0x45f3cb){_0x27af8a[_0x2501('0x1d')]=_0x45f3cb;if(_0x2148fe[_0x2501('0x2e')][_0x2501('0x3e')]){_0x7650dc[_0x2501('0x3f')]=[{'all':!![]}];}return db[_0x2501('0x29')]['findAll'](_0x7650dc);})['then'](function(_0x390ce1){_0x27af8a[_0x2501('0x40')]=_0x390ce1;return _0x27af8a;})['then'](respondWithFilteredResult(_0x2ead50,_0x7650dc))[_0x2501('0x41')](handleError(_0x2ead50,null));};exports[_0x2501('0x42')]=function(_0x348da6,_0x4d0e47){var _0x1b5228={'raw':![],'where':{'id':_0x348da6[_0x2501('0x43')]['id']}},_0x10e2b={};_0x10e2b[_0x2501('0x31')]=_[_0x2501('0x44')](db[_0x2501('0x29')][_0x2501('0x2a')]);_0x10e2b[_0x2501('0x2e')]=_[_0x2501('0x44')](_0x348da6[_0x2501('0x2e')]);_0x10e2b['filters']=_[_0x2501('0x30')](_0x10e2b[_0x2501('0x31')],_0x10e2b[_0x2501('0x2e')]);_0x1b5228[_0x2501('0x32')]=_[_0x2501('0x30')](_0x10e2b['model'],qs['fields'](_0x348da6['query'][_0x2501('0x33')]));_0x1b5228[_0x2501('0x32')]=_0x1b5228[_0x2501('0x32')][_0x2501('0x34')]?_0x1b5228['attributes']:_0x10e2b[_0x2501('0x31')];if(_0x348da6[_0x2501('0x2e')]['includeAll']){_0x1b5228['include']=[{'all':!![]}];}_0x1b5228=_[_0x2501('0x3a')]({},_0x1b5228,_0x348da6[_0x2501('0x45')]);return db[_0x2501('0x29')][_0x2501('0x46')](_0x1b5228)[_0x2501('0x24')](handleEntityNotFound(_0x4d0e47,null))[_0x2501('0x24')](respondWithResult(_0x4d0e47,null))[_0x2501('0x41')](handleError(_0x4d0e47,null));};exports[_0x2501('0x47')]=function(_0x5db18b,_0x4c7753){return db['ZendeskConfiguration'][_0x2501('0x47')](_0x5db18b[_0x2501('0x48')],{})[_0x2501('0x24')](respondWithResult(_0x4c7753,0xc9))['catch'](handleError(_0x4c7753,null));};exports[_0x2501('0x49')]=function(_0x519ae0,_0x5c0d99){if(_0x519ae0[_0x2501('0x48')]['id']){delete _0x519ae0[_0x2501('0x48')]['id'];}return db['ZendeskConfiguration'][_0x2501('0x46')]({'where':{'id':_0x519ae0['params']['id']}})['then'](handleEntityNotFound(_0x5c0d99,null))['then'](saveUpdates(_0x519ae0[_0x2501('0x48')],null))[_0x2501('0x24')](respondWithResult(_0x5c0d99,null))[_0x2501('0x41')](handleError(_0x5c0d99,null));};exports[_0x2501('0x23')]=function(_0x159cc9,_0x2f7ea5){return db[_0x2501('0x29')][_0x2501('0x46')]({'where':{'id':_0x159cc9['params']['id']}})['then'](handleEntityNotFound(_0x2f7ea5,null))[_0x2501('0x24')](removeEntity(_0x2f7ea5,null))[_0x2501('0x41')](handleError(_0x2f7ea5,null));};exports[_0x2501('0x4a')]=function(_0x1a2864,_0x14ef61,_0x1f184c){var _0x22ba45={};var _0x663dc6={};var _0x1b8ac1;var _0x3a2229;return db[_0x2501('0x29')]['findOne']({'where':{'id':_0x1a2864[_0x2501('0x43')]['id']}})[_0x2501('0x24')](handleEntityNotFound(_0x14ef61,null))[_0x2501('0x24')](function(_0x45ea55){if(_0x45ea55){_0x1b8ac1=_0x45ea55;_0x663dc6[_0x2501('0x31')]=_[_0x2501('0x44')](db[_0x2501('0x4b')][_0x2501('0x2a')]);_0x663dc6['query']=_[_0x2501('0x44')](_0x1a2864['query']);_0x663dc6[_0x2501('0x2f')]=_[_0x2501('0x30')](_0x663dc6[_0x2501('0x31')],_0x663dc6['query']);_0x22ba45[_0x2501('0x32')]=_[_0x2501('0x30')](_0x663dc6['model'],qs['fields'](_0x1a2864[_0x2501('0x2e')]['fields']));_0x22ba45['attributes']=_0x22ba45[_0x2501('0x32')][_0x2501('0x34')]?_0x22ba45[_0x2501('0x32')]:_0x663dc6[_0x2501('0x31')];_0x22ba45[_0x2501('0x36')]=qs['sort'](_0x1a2864['query'][_0x2501('0x37')]);_0x22ba45[_0x2501('0x38')]=qs['filters'](_[_0x2501('0x39')](_0x1a2864[_0x2501('0x2e')],_0x663dc6[_0x2501('0x2f')]));if(_0x1a2864[_0x2501('0x2e')]['filter']){_0x22ba45[_0x2501('0x38')]=_[_0x2501('0x3a')](_0x22ba45[_0x2501('0x38')],{'$or':_[_0x2501('0x3b')](_0x22ba45['attributes'],function(_0x5f3d0f){var _0x3859c4={};_0x3859c4[_0x5f3d0f]={'$like':'%'+_0x1a2864['query'][_0x2501('0x3d')]+'%'};return _0x3859c4;})});}_0x22ba45=_['merge']({},_0x22ba45,_0x1a2864[_0x2501('0x45')]);return _0x1b8ac1['getFields'](_0x22ba45);}})[_0x2501('0x24')](function(_0x323586){if(_0x323586){_0x3a2229=_0x323586['length'];if(!_0x1a2864[_0x2501('0x2e')][_0x2501('0x35')](_0x2501('0x4c'))){_0x22ba45['limit']=qs[_0x2501('0x1f')](_0x1a2864['query']['limit']);_0x22ba45[_0x2501('0x1e')]=qs[_0x2501('0x1e')](_0x1a2864[_0x2501('0x2e')]['offset']);}return _0x1b8ac1['getFields'](_0x22ba45);}})[_0x2501('0x24')](function(_0x27b5e3){if(_0x27b5e3){return _0x27b5e3?{'count':_0x3a2229,'rows':_0x27b5e3}:null;}})[_0x2501('0x24')](respondWithResult(_0x14ef61,null))[_0x2501('0x41')](handleError(_0x14ef61,null));};exports[_0x2501('0x4d')]=function(_0x4244cc,_0x6d9319,_0x568381){var _0x5917fc={};var _0x1165eb={};var _0x4ebc76;var _0x251c28;return db[_0x2501('0x29')][_0x2501('0x4e')]({'where':{'id':_0x4244cc['params']['id']}})['then'](handleEntityNotFound(_0x6d9319,null))[_0x2501('0x24')](function(_0x158137){if(_0x158137){_0x4ebc76=_0x158137;_0x1165eb[_0x2501('0x31')]=_[_0x2501('0x44')](db['ZendeskField'][_0x2501('0x2a')]);_0x1165eb[_0x2501('0x2e')]=_[_0x2501('0x44')](_0x4244cc[_0x2501('0x2e')]);_0x1165eb['filters']=_[_0x2501('0x30')](_0x1165eb[_0x2501('0x31')],_0x1165eb[_0x2501('0x2e')]);_0x5917fc['attributes']=_[_0x2501('0x30')](_0x1165eb[_0x2501('0x31')],qs[_0x2501('0x33')](_0x4244cc[_0x2501('0x2e')][_0x2501('0x33')]));_0x5917fc[_0x2501('0x32')]=_0x5917fc[_0x2501('0x32')]['length']?_0x5917fc['attributes']:_0x1165eb[_0x2501('0x31')];_0x5917fc[_0x2501('0x36')]=qs[_0x2501('0x37')](_0x4244cc['query'][_0x2501('0x37')]);_0x5917fc['where']=qs['filters'](_[_0x2501('0x39')](_0x4244cc[_0x2501('0x2e')],_0x1165eb[_0x2501('0x2f')]));if(_0x4244cc[_0x2501('0x2e')][_0x2501('0x3d')]){_0x5917fc[_0x2501('0x38')]=_['merge'](_0x5917fc[_0x2501('0x38')],{'$or':_[_0x2501('0x3b')](_0x5917fc['attributes'],function(_0x364341){var _0x2b383b={};_0x2b383b[_0x364341]={'$like':'%'+_0x4244cc[_0x2501('0x2e')]['filter']+'%'};return _0x2b383b;})});}_0x5917fc=_[_0x2501('0x3a')]({},_0x5917fc,_0x4244cc[_0x2501('0x45')]);return _0x4ebc76['getSubjects'](_0x5917fc);}})[_0x2501('0x24')](function(_0x3a9d68){if(_0x3a9d68){_0x251c28=_0x3a9d68['length'];if(!_0x4244cc[_0x2501('0x2e')][_0x2501('0x35')](_0x2501('0x4c'))){_0x5917fc[_0x2501('0x1f')]=qs['limit'](_0x4244cc[_0x2501('0x2e')][_0x2501('0x1f')]);_0x5917fc[_0x2501('0x1e')]=qs[_0x2501('0x1e')](_0x4244cc[_0x2501('0x2e')][_0x2501('0x1e')]);}return _0x4ebc76[_0x2501('0x4d')](_0x5917fc);}})['then'](function(_0xdb6f27){if(_0xdb6f27){return _0xdb6f27?{'count':_0x251c28,'rows':_0xdb6f27}:null;}})[_0x2501('0x24')](respondWithResult(_0x6d9319,null))['catch'](handleError(_0x6d9319,null));};exports[_0x2501('0x4f')]=function(_0x378ecf,_0x5b204b,_0x3cf46c){var _0x19ab01={};var _0x11b748={};var _0x426b0c;var _0x20d41f;return db[_0x2501('0x29')][_0x2501('0x4e')]({'where':{'id':_0x378ecf[_0x2501('0x43')]['id']}})[_0x2501('0x24')](handleEntityNotFound(_0x5b204b,null))[_0x2501('0x24')](function(_0xcf8e4f){if(_0xcf8e4f){_0x426b0c=_0xcf8e4f;_0x11b748['model']=_[_0x2501('0x44')](db['ZendeskField'][_0x2501('0x2a')]);_0x11b748[_0x2501('0x2e')]=_[_0x2501('0x44')](_0x378ecf[_0x2501('0x2e')]);_0x11b748[_0x2501('0x2f')]=_['intersection'](_0x11b748[_0x2501('0x31')],_0x11b748[_0x2501('0x2e')]);_0x19ab01[_0x2501('0x32')]=_['intersection'](_0x11b748[_0x2501('0x31')],qs[_0x2501('0x33')](_0x378ecf[_0x2501('0x2e')]['fields']));_0x19ab01[_0x2501('0x32')]=_0x19ab01[_0x2501('0x32')]['length']?_0x19ab01['attributes']:_0x11b748['model'];_0x19ab01[_0x2501('0x36')]=qs[_0x2501('0x37')](_0x378ecf[_0x2501('0x2e')][_0x2501('0x37')]);_0x19ab01['where']=qs[_0x2501('0x2f')](_['pick'](_0x378ecf['query'],_0x11b748[_0x2501('0x2f')]));if(_0x378ecf[_0x2501('0x2e')]['filter']){_0x19ab01[_0x2501('0x38')]=_[_0x2501('0x3a')](_0x19ab01['where'],{'$or':_[_0x2501('0x3b')](_0x19ab01[_0x2501('0x32')],function(_0x58eb55){var _0x50b08e={};_0x50b08e[_0x58eb55]={'$like':'%'+_0x378ecf[_0x2501('0x2e')][_0x2501('0x3d')]+'%'};return _0x50b08e;})});}_0x19ab01=_[_0x2501('0x3a')]({},_0x19ab01,_0x378ecf[_0x2501('0x45')]);return _0x426b0c[_0x2501('0x4f')](_0x19ab01);}})['then'](function(_0x8ff457){if(_0x8ff457){_0x20d41f=_0x8ff457[_0x2501('0x34')];if(!_0x378ecf[_0x2501('0x2e')][_0x2501('0x35')](_0x2501('0x4c'))){_0x19ab01[_0x2501('0x1f')]=qs[_0x2501('0x1f')](_0x378ecf[_0x2501('0x2e')][_0x2501('0x1f')]);_0x19ab01[_0x2501('0x1e')]=qs[_0x2501('0x1e')](_0x378ecf[_0x2501('0x2e')]['offset']);}return _0x426b0c[_0x2501('0x4f')](_0x19ab01);}})[_0x2501('0x24')](function(_0xfefabf){if(_0xfefabf){return _0xfefabf?{'count':_0x20d41f,'rows':_0xfefabf}:null;}})['then'](respondWithResult(_0x5b204b,null))[_0x2501('0x41')](handleError(_0x5b204b,null));};exports[_0x2501('0x50')]=function(_0x1dc46d,_0x5c6df7,_0x27fb6e){var _0x4db39a={};var _0x330307={};var _0x1eed76;var _0x483d94;return db[_0x2501('0x29')][_0x2501('0x4e')]({'where':{'id':_0x1dc46d[_0x2501('0x43')]['id']}})['then'](handleEntityNotFound(_0x5c6df7,null))[_0x2501('0x24')](function(_0x455555){if(_0x455555){_0x1eed76=_0x455555;_0x330307[_0x2501('0x31')]=_[_0x2501('0x44')](db[_0x2501('0x51')][_0x2501('0x2a')]);_0x330307[_0x2501('0x2e')]=_['keys'](_0x1dc46d[_0x2501('0x2e')]);_0x330307[_0x2501('0x2f')]=_[_0x2501('0x30')](_0x330307[_0x2501('0x31')],_0x330307[_0x2501('0x2e')]);_0x4db39a[_0x2501('0x32')]=_[_0x2501('0x30')](_0x330307[_0x2501('0x31')],qs[_0x2501('0x33')](_0x1dc46d[_0x2501('0x2e')][_0x2501('0x33')]));_0x4db39a[_0x2501('0x32')]=_0x4db39a[_0x2501('0x32')][_0x2501('0x34')]?_0x4db39a['attributes']:_0x330307[_0x2501('0x31')];_0x4db39a[_0x2501('0x36')]=qs[_0x2501('0x37')](_0x1dc46d[_0x2501('0x2e')][_0x2501('0x37')]);_0x4db39a[_0x2501('0x38')]=qs[_0x2501('0x2f')](_['pick'](_0x1dc46d['query'],_0x330307[_0x2501('0x2f')]));if(_0x1dc46d['query'][_0x2501('0x3d')]){_0x4db39a[_0x2501('0x38')]=_[_0x2501('0x3a')](_0x4db39a['where'],{'$or':_[_0x2501('0x3b')](_0x4db39a['attributes'],function(_0x158c80){var _0x24b0f9={};_0x24b0f9[_0x158c80]={'$like':'%'+_0x1dc46d['query'][_0x2501('0x3d')]+'%'};return _0x24b0f9;})});}_0x4db39a=_['merge']({},_0x4db39a,_0x1dc46d[_0x2501('0x45')]);return _0x1eed76[_0x2501('0x50')](_0x4db39a);}})[_0x2501('0x24')](function(_0x107597){if(_0x107597){_0x483d94=_0x107597[_0x2501('0x34')];if(!_0x1dc46d[_0x2501('0x2e')][_0x2501('0x35')](_0x2501('0x4c'))){_0x4db39a[_0x2501('0x1f')]=qs[_0x2501('0x1f')](_0x1dc46d[_0x2501('0x2e')][_0x2501('0x1f')]);_0x4db39a[_0x2501('0x1e')]=qs['offset'](_0x1dc46d[_0x2501('0x2e')][_0x2501('0x1e')]);}return _0x1eed76[_0x2501('0x50')](_0x4db39a);}})['then'](function(_0x58642c){if(_0x58642c){return _0x58642c?{'count':_0x483d94,'rows':_0x58642c}:null;}})[_0x2501('0x24')](respondWithResult(_0x5c6df7,null))[_0x2501('0x41')](handleError(_0x5c6df7,null));};exports[_0x2501('0x52')]=function(_0x4fed25,_0x1c368d,_0x1efb2b){if(_0x4fed25[_0x2501('0x48')]['id']){delete _0x4fed25[_0x2501('0x48')]['id'];}return db['ZendeskConfiguration'][_0x2501('0x4e')]({'where':{'id':_0x4fed25[_0x2501('0x43')]['id']}})[_0x2501('0x24')](handleEntityNotFound(_0x1c368d,null))['then'](function(_0x356acb){if(_0x356acb){return _0x356acb[_0x2501('0x52')](_0x4fed25['body'][_0x2501('0x53')]||[]);}return null;})[_0x2501('0x24')](respondWithResult(_0x1c368d,null))[_0x2501('0x41')](handleError(_0x1c368d,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 76fe798..4241186 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 _0x7334=['exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes'];(function(_0x5c84a6,_0x321f95){var _0xb8c5f0=function(_0x106d58){while(--_0x106d58){_0x5c84a6['push'](_0x5c84a6['shift']());}};_0xb8c5f0(++_0x321f95);}(_0x7334,0x184));var _0x4733=function(_0x2da4db,_0x11b589){_0x2da4db=_0x2da4db-0x0;var _0x5d6f6a=_0x7334[_0x2da4db];return _0x5d6f6a;};'use strict';var _=require(_0x4733('0x0'));var util=require(_0x4733('0x1'));var logger=require(_0x4733('0x2'))('api');var moment=require('moment');var BPromise=require(_0x4733('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4733('0x4'));var rimraf=require(_0x4733('0x5'));var config=require(_0x4733('0x6'));var attributes=require(_0x4733('0x7'));module[_0x4733('0x8')]=function(_0x449ead,_0x16d7cc){return _0x449ead[_0x4733('0x9')](_0x4733('0xa'),attributes,{'tableName':_0x4733('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xefda=['../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','api','moment','request-promise','path','rimraf'];(function(_0x223f3c,_0x46d049){var _0x1466f7=function(_0x1d8fb9){while(--_0x1d8fb9){_0x223f3c['push'](_0x223f3c['shift']());}};_0x1466f7(++_0x46d049);}(_0xefda,0x96));var _0xaefd=function(_0x3c67e4,_0xedd28b){_0x3c67e4=_0x3c67e4-0x0;var _0x1a348b=_0xefda[_0x3c67e4];return _0x1a348b;};'use strict';var _=require(_0xaefd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xaefd('0x1'));var moment=require(_0xaefd('0x2'));var BPromise=require('bluebird');var rp=require(_0xaefd('0x3'));var fs=require('fs');var path=require(_0xaefd('0x4'));var rimraf=require(_0xaefd('0x5'));var config=require(_0xaefd('0x6'));var attributes=require(_0xaefd('0x7'));module[_0xaefd('0x8')]=function(_0x497258,_0x3677ea){return _0x497258[_0xaefd('0x9')](_0xaefd('0xa'),attributes,{'tableName':_0xaefd('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 9889fc0..90f66bc 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 _0x1513=['request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','info'];(function(_0x4a6daa,_0x1f0b9e){var _0x53c44e=function(_0x5d57ca){while(--_0x5d57ca){_0x4a6daa['push'](_0x4a6daa['shift']());}};_0x53c44e(++_0x1f0b9e);}(_0x1513,0xaa));var _0x3151=function(_0x4c60ee,_0xf211d2){_0x4c60ee=_0x4c60ee-0x0;var _0x665ce6=_0x1513[_0x4c60ee];return _0x665ce6;};'use strict';var _=require(_0x3151('0x0'));var util=require(_0x3151('0x1'));var moment=require(_0x3151('0x2'));var BPromise=require(_0x3151('0x3'));var rs=require(_0x3151('0x4'));var fs=require('fs');var Redis=require(_0x3151('0x5'));var db=require(_0x3151('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3151('0x7'));var config=require('../../config/environment');var jayson=require(_0x3151('0x8'));var client=jayson[_0x3151('0x9')][_0x3151('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cadcf,_0x5c1cb2,_0x480967){return new BPromise(function(_0x214209,_0x2c39ba){return client[_0x3151('0xb')](_0x3cadcf,_0x480967)[_0x3151('0xc')](function(_0x3ba271){logger[_0x3151('0xd')]('ZendeskConfiguration,\x20%s,\x20%s',_0x5c1cb2,_0x3151('0xe'));logger[_0x3151('0xf')](_0x3151('0x10'),_0x5c1cb2,_0x3151('0xe'),JSON[_0x3151('0x11')](_0x3ba271));if(_0x3ba271[_0x3151('0x12')]){if(_0x3ba271['error'][_0x3151('0x13')]===0x1f4){logger[_0x3151('0x12')](_0x3151('0x14'),_0x5c1cb2,_0x3ba271[_0x3151('0x12')][_0x3151('0x15')]);return _0x2c39ba(_0x3ba271[_0x3151('0x12')]['message']);}logger[_0x3151('0x12')](_0x3151('0x14'),_0x5c1cb2,_0x3ba271[_0x3151('0x12')]['message']);return _0x214209(_0x3ba271[_0x3151('0x12')]['message']);}else{logger[_0x3151('0xd')](_0x3151('0x14'),_0x5c1cb2,_0x3151('0xe'));_0x214209(_0x3ba271[_0x3151('0x16')][_0x3151('0x15')]);}})['catch'](function(_0x5cd364){logger[_0x3151('0x12')](_0x3151('0x14'),_0x5c1cb2,_0x5cd364);_0x2c39ba(_0x5cd364);});});} \ No newline at end of file +var _0x522f=['request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','ZendeskConfiguration,\x20%s,\x20%s'];(function(_0x4a4a4a,_0x1b4057){var _0x18485e=function(_0x45676f){while(--_0x45676f){_0x4a4a4a['push'](_0x4a4a4a['shift']());}};_0x18485e(++_0x1b4057);}(_0x522f,0x183));var _0xf522=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x522f[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xf522('0x0'));var util=require(_0xf522('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf522('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf522('0x3'))['db'];var utils=require(_0xf522('0x4'));var logger=require('../../config/logger')(_0xf522('0x5'));var config=require(_0xf522('0x6'));var jayson=require(_0xf522('0x7'));var client=jayson[_0xf522('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x479b90,_0x55c660,_0x70292e){return new BPromise(function(_0x241f98,_0x428e8e){return client['request'](_0x479b90,_0x70292e)[_0xf522('0x9')](function(_0x207d31){logger[_0xf522('0xa')](_0xf522('0xb'),_0x55c660,_0xf522('0xc'));logger['debug'](_0xf522('0xd'),_0x55c660,_0xf522('0xc'),JSON[_0xf522('0xe')](_0x207d31));if(_0x207d31[_0xf522('0xf')]){if(_0x207d31[_0xf522('0xf')][_0xf522('0x10')]===0x1f4){logger[_0xf522('0xf')](_0xf522('0xb'),_0x55c660,_0x207d31[_0xf522('0xf')][_0xf522('0x11')]);return _0x428e8e(_0x207d31[_0xf522('0xf')]['message']);}logger[_0xf522('0xf')](_0xf522('0xb'),_0x55c660,_0x207d31[_0xf522('0xf')]['message']);return _0x241f98(_0x207d31[_0xf522('0xf')][_0xf522('0x11')]);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x55c660,'request\x20sent');_0x241f98(_0x207d31['result']['message']);}})[_0xf522('0x12')](function(_0x1c357f){logger['error'](_0xf522('0xb'),_0x55c660,_0x1c357f);_0x428e8e(_0x1c357f);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index efe1f09..b931b60 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 _0x84c1=['delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','show','post','create','put','/:id','update'];(function(_0x42a4e8,_0x1de107){var _0x505eb5=function(_0x4a352b){while(--_0x4a352b){_0x42a4e8['push'](_0x42a4e8['shift']());}};_0x505eb5(++_0x1de107);}(_0x84c1,0x12f));var _0x184c=function(_0x3d0d7c,_0x381fe5){_0x3d0d7c=_0x3d0d7c-0x0;var _0x1af985=_0x84c1[_0x3d0d7c];return _0x1af985;};'use strict';var multer=require(_0x184c('0x0'));var util=require(_0x184c('0x1'));var path=require(_0x184c('0x2'));var timeout=require(_0x184c('0x3'));var express=require(_0x184c('0x4'));var router=express['Router']();var fs_extra=require(_0x184c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x184c('0x6'));var config=require(_0x184c('0x7'));var controller=require(_0x184c('0x8'));router[_0x184c('0x9')]('/',auth[_0x184c('0xa')](),controller['index']);router[_0x184c('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x184c('0xb')]);router[_0x184c('0xc')]('/',auth[_0x184c('0xa')](),controller[_0x184c('0xd')]);router[_0x184c('0xe')](_0x184c('0xf'),auth['isAuthenticated'](),controller[_0x184c('0x10')]);router[_0x184c('0x11')](_0x184c('0xf'),auth[_0x184c('0xa')](),controller[_0x184c('0x12')]);module[_0x184c('0x13')]=router; \ No newline at end of file +var _0x8135=['isAuthenticated','show','post','create','put','/:id','util','express','Router','../../config/environment','./intZendeskField.controller','get'];(function(_0x2a43b9,_0x2aa7ea){var _0x3b6c90=function(_0x5be37f){while(--_0x5be37f){_0x2a43b9['push'](_0x2a43b9['shift']());}};_0x3b6c90(++_0x2aa7ea);}(_0x8135,0x1f2));var _0x5813=function(_0x310420,_0x435cbb){_0x310420=_0x310420-0x0;var _0x5ee909=_0x8135[_0x310420];return _0x5ee909;};'use strict';var multer=require('multer');var util=require(_0x5813('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5813('0x1'));var router=express[_0x5813('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5813('0x3'));var controller=require(_0x5813('0x4'));router[_0x5813('0x5')]('/',auth[_0x5813('0x6')](),controller['index']);router[_0x5813('0x5')]('/:id',auth[_0x5813('0x6')](),controller[_0x5813('0x7')]);router[_0x5813('0x8')]('/',auth[_0x5813('0x6')](),controller[_0x5813('0x9')]);router[_0x5813('0xa')](_0x5813('0xb'),auth[_0x5813('0x6')](),controller['update']);router['delete']('/:id',auth[_0x5813('0x6')](),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 28eab97..5536bda 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 _0x1914=['sequelize','exports','string','variable','customVariable','picklist','STRING','ENUM','BOOLEAN'];(function(_0x4914ad,_0x551a18){var _0x3cd61f=function(_0x2a773e){while(--_0x2a773e){_0x4914ad['push'](_0x4914ad['shift']());}};_0x3cd61f(++_0x551a18);}(_0x1914,0x1dd));var _0x4191=function(_0x243f97,_0x921128){_0x243f97=_0x243f97-0x0;var _0x5f4bea=_0x1914[_0x243f97];return _0x5f4bea;};'use strict';var Sequelize=require(_0x4191('0x0'));module[_0x4191('0x1')]={'type':{'type':Sequelize['ENUM'](_0x4191('0x2'),_0x4191('0x3'),_0x4191('0x4'),'keyValue',_0x4191('0x5')),'defaultValue':_0x4191('0x2')},'content':{'type':Sequelize[_0x4191('0x6')]},'key':{'type':Sequelize[_0x4191('0x6')]},'keyType':{'type':Sequelize[_0x4191('0x7')](_0x4191('0x2'),_0x4191('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x4191('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x4191('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf90b=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','exports','ENUM','string'];(function(_0x16f18c,_0x27b669){var _0x31fb69=function(_0x2075bf){while(--_0x2075bf){_0x16f18c['push'](_0x16f18c['shift']());}};_0x31fb69(++_0x27b669);}(_0xf90b,0x192));var _0xbf90=function(_0x276b79,_0x5317db){_0x276b79=_0x276b79-0x0;var _0x4ad802=_0xf90b[_0x276b79];return _0x4ad802;};'use strict';var Sequelize=require('sequelize');module[_0xbf90('0x0')]={'type':{'type':Sequelize[_0xbf90('0x1')](_0xbf90('0x2'),_0xbf90('0x3'),_0xbf90('0x4'),_0xbf90('0x5'),_0xbf90('0x6')),'defaultValue':_0xbf90('0x2')},'content':{'type':Sequelize[_0xbf90('0x7')]},'key':{'type':Sequelize[_0xbf90('0x7')]},'keyType':{'type':Sequelize['ENUM']('string',_0xbf90('0x3'),_0xbf90('0x4'))},'keyContent':{'type':Sequelize[_0xbf90('0x7')]},'idField':{'type':Sequelize[_0xbf90('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xbf90('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index c141001..3720cbb 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 _0xe524=['attributes','fields','hasOwnProperty','order','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','update','then','error','stack','name','send','index','map','ZendeskField','rawAttributes','fieldName','type','model','keys','query','filters','intersection'];(function(_0x54b283,_0x5eb8a6){var _0x2462b3=function(_0x13fca7){while(--_0x13fca7){_0x54b283['push'](_0x54b283['shift']());}};_0x2462b3(++_0x5eb8a6);}(_0xe524,0x1d8));var _0x4e52=function(_0x420724,_0x45bd61){_0x420724=_0x420724-0x0;var _0x22a025=_0xe524[_0x420724];return _0x22a025;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4e52('0x0'));var zipdir=require(_0x4e52('0x1'));var jsonpatch=require(_0x4e52('0x2'));var rp=require(_0x4e52('0x3'));var moment=require(_0x4e52('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4e52('0x5'));var util=require(_0x4e52('0x6'));var path=require(_0x4e52('0x7'));var sox=require(_0x4e52('0x8'));var csv=require(_0x4e52('0x9'));var ejs=require(_0x4e52('0xa'));var fs=require('fs');var fs_extra=require(_0x4e52('0xb'));var _=require(_0x4e52('0xc'));var squel=require('squel');var crypto=require(_0x4e52('0xd'));var jsforce=require(_0x4e52('0xe'));var deskjs=require(_0x4e52('0xf'));var toCsv=require(_0x4e52('0x9'));var querystring=require(_0x4e52('0x10'));var Papa=require(_0x4e52('0x11'));var Redis=require('ioredis');var authService=require(_0x4e52('0x12'));var qs=require(_0x4e52('0x13'));var as=require(_0x4e52('0x14'));var hardwareService=require(_0x4e52('0x15'));var logger=require(_0x4e52('0x16'))(_0x4e52('0x17'));var utils=require('../../config/utils');var config=require(_0x4e52('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x4e52('0x19'))['db'];function respondWithStatusCode(_0x4dd353,_0x2c9db4){_0x2c9db4=_0x2c9db4||0xcc;return function(_0x1e096c){if(_0x1e096c){return _0x4dd353[_0x4e52('0x1a')](_0x2c9db4);}return _0x4dd353[_0x4e52('0x1b')](_0x2c9db4)[_0x4e52('0x1c')]();};}function respondWithResult(_0x153d7a,_0x4d07e2){_0x4d07e2=_0x4d07e2||0xc8;return function(_0x3ebc75){if(_0x3ebc75){return _0x153d7a['status'](_0x4d07e2)['json'](_0x3ebc75);}};}function respondWithFilteredResult(_0x320284,_0x47b643){return function(_0x30902b){if(_0x30902b){var _0xf89798=typeof _0x47b643[_0x4e52('0x1d')]===_0x4e52('0x1e')&&typeof _0x47b643['limit']===_0x4e52('0x1e');var _0x406bbc=_0x30902b[_0x4e52('0x1f')];var _0x5bb281=_0xf89798?0x0:_0x47b643[_0x4e52('0x1d')];var _0x439096=_0xf89798?_0x30902b[_0x4e52('0x1f')]:_0x47b643[_0x4e52('0x1d')]+_0x47b643[_0x4e52('0x20')];var _0xadc0d9;if(_0x439096>=_0x406bbc){_0x439096=_0x406bbc;_0xadc0d9=0xc8;}else{_0xadc0d9=0xce;}_0x320284[_0x4e52('0x1b')](_0xadc0d9);return _0x320284[_0x4e52('0x21')](_0x4e52('0x22'),_0x5bb281+'-'+_0x439096+'/'+_0x406bbc)[_0x4e52('0x23')](_0x30902b);}return null;};}function patchUpdates(_0x16f252){return function(_0x13fe25){try{jsonpatch['apply'](_0x13fe25,_0x16f252,!![]);}catch(_0x5b5f4d){return BPromise['reject'](_0x5b5f4d);}return _0x13fe25['save']();};}function saveUpdates(_0x5a76dd,_0x59bf9f){return function(_0x407746){if(_0x407746){return _0x407746[_0x4e52('0x24')](_0x5a76dd)[_0x4e52('0x25')](function(_0x6e1578){return _0x6e1578;});}return null;};}function removeEntity(_0x251909,_0x5540af){return function(_0x395a2a){if(_0x395a2a){return _0x395a2a['destroy']()[_0x4e52('0x25')](function(){_0x251909[_0x4e52('0x1b')](0xcc)[_0x4e52('0x1c')]();});}};}function handleEntityNotFound(_0x18bb95,_0x463277){return function(_0x21e6e1){if(!_0x21e6e1){_0x18bb95['sendStatus'](0x194);}return _0x21e6e1;};}function handleError(_0x44127d,_0x2662d0){_0x2662d0=_0x2662d0||0x1f4;return function(_0x437acc){logger[_0x4e52('0x26')](_0x437acc[_0x4e52('0x27')]);if(_0x437acc[_0x4e52('0x28')]){delete _0x437acc[_0x4e52('0x28')];}_0x44127d[_0x4e52('0x1b')](_0x2662d0)[_0x4e52('0x29')](_0x437acc);};}exports[_0x4e52('0x2a')]=function(_0x18e473,_0x32923c){var _0x39b4b0={},_0x3e1888={},_0x12783e={'count':0x0,'rows':[]};var _0x3d65eb=_[_0x4e52('0x2b')](db[_0x4e52('0x2c')][_0x4e52('0x2d')],function(_0x515bfa){return{'name':_0x515bfa[_0x4e52('0x2e')],'type':_0x515bfa[_0x4e52('0x2f')]['key']};});_0x3e1888[_0x4e52('0x30')]=_['map'](_0x3d65eb,_0x4e52('0x28'));_0x3e1888['query']=_[_0x4e52('0x31')](_0x18e473[_0x4e52('0x32')]);_0x3e1888[_0x4e52('0x33')]=_[_0x4e52('0x34')](_0x3e1888[_0x4e52('0x30')],_0x3e1888['query']);_0x39b4b0[_0x4e52('0x35')]=_[_0x4e52('0x34')](_0x3e1888[_0x4e52('0x30')],qs['fields'](_0x18e473[_0x4e52('0x32')][_0x4e52('0x36')]));_0x39b4b0['attributes']=_0x39b4b0[_0x4e52('0x35')]['length']?_0x39b4b0[_0x4e52('0x35')]:_0x3e1888['model'];if(!_0x18e473[_0x4e52('0x32')][_0x4e52('0x37')]('nolimit')){_0x39b4b0[_0x4e52('0x20')]=qs[_0x4e52('0x20')](_0x18e473[_0x4e52('0x32')][_0x4e52('0x20')]);_0x39b4b0[_0x4e52('0x1d')]=qs[_0x4e52('0x1d')](_0x18e473[_0x4e52('0x32')][_0x4e52('0x1d')]);}_0x39b4b0[_0x4e52('0x38')]=qs['sort'](_0x18e473[_0x4e52('0x32')]['sort']);_0x39b4b0[_0x4e52('0x39')]=qs[_0x4e52('0x33')](_[_0x4e52('0x3a')](_0x18e473['query'],_0x3e1888[_0x4e52('0x33')]),_0x3d65eb);if(_0x18e473[_0x4e52('0x32')][_0x4e52('0x3b')]){_0x39b4b0[_0x4e52('0x39')]=_[_0x4e52('0x3c')](_0x39b4b0[_0x4e52('0x39')],{'$or':_[_0x4e52('0x2b')](_0x3d65eb,function(_0x3c69aa){if(_0x3c69aa[_0x4e52('0x2f')]!==_0x4e52('0x3d')){var _0xb3df94={};_0xb3df94[_0x3c69aa[_0x4e52('0x28')]]={'$like':'%'+_0x18e473[_0x4e52('0x32')]['filter']+'%'};return _0xb3df94;}})});}_0x39b4b0=_[_0x4e52('0x3c')]({},_0x39b4b0,_0x18e473[_0x4e52('0x3e')]);var _0x46a918={'where':_0x39b4b0[_0x4e52('0x39')]};return db[_0x4e52('0x2c')][_0x4e52('0x1f')](_0x46a918)[_0x4e52('0x25')](function(_0x2990de){_0x12783e[_0x4e52('0x1f')]=_0x2990de;if(_0x18e473[_0x4e52('0x32')][_0x4e52('0x3f')]){_0x39b4b0['include']=[{'all':!![]}];}return db[_0x4e52('0x2c')][_0x4e52('0x40')](_0x39b4b0);})[_0x4e52('0x25')](function(_0x213935){_0x12783e[_0x4e52('0x41')]=_0x213935;return _0x12783e;})[_0x4e52('0x25')](respondWithFilteredResult(_0x32923c,_0x39b4b0))[_0x4e52('0x42')](handleError(_0x32923c,null));};exports[_0x4e52('0x43')]=function(_0x5d5390,_0x4bc732){var _0x1c54ac={'raw':!![],'where':{'id':_0x5d5390[_0x4e52('0x44')]['id']}},_0x43fc1c={};_0x43fc1c[_0x4e52('0x30')]=_['keys'](db[_0x4e52('0x2c')][_0x4e52('0x2d')]);_0x43fc1c[_0x4e52('0x32')]=_[_0x4e52('0x31')](_0x5d5390[_0x4e52('0x32')]);_0x43fc1c[_0x4e52('0x33')]=_[_0x4e52('0x34')](_0x43fc1c['model'],_0x43fc1c['query']);_0x1c54ac['attributes']=_[_0x4e52('0x34')](_0x43fc1c['model'],qs[_0x4e52('0x36')](_0x5d5390['query'][_0x4e52('0x36')]));_0x1c54ac['attributes']=_0x1c54ac[_0x4e52('0x35')][_0x4e52('0x45')]?_0x1c54ac[_0x4e52('0x35')]:_0x43fc1c[_0x4e52('0x30')];if(_0x5d5390['query'][_0x4e52('0x3f')]){_0x1c54ac[_0x4e52('0x46')]=[{'all':!![]}];}_0x1c54ac=_['merge']({},_0x1c54ac,_0x5d5390['options']);return db[_0x4e52('0x2c')][_0x4e52('0x47')](_0x1c54ac)[_0x4e52('0x25')](handleEntityNotFound(_0x4bc732,null))[_0x4e52('0x25')](respondWithResult(_0x4bc732,null))[_0x4e52('0x42')](handleError(_0x4bc732,null));};exports[_0x4e52('0x48')]=function(_0x3c422a,_0x47ddcf){return db[_0x4e52('0x2c')]['create'](_0x3c422a['body'],{})[_0x4e52('0x25')](respondWithResult(_0x47ddcf,0xc9))['catch'](handleError(_0x47ddcf,null));};exports[_0x4e52('0x24')]=function(_0x3f2833,_0x253d65){if(_0x3f2833['body']['id']){delete _0x3f2833[_0x4e52('0x49')]['id'];}return db['ZendeskField'][_0x4e52('0x47')]({'where':{'id':_0x3f2833[_0x4e52('0x44')]['id']}})['then'](handleEntityNotFound(_0x253d65,null))[_0x4e52('0x25')](saveUpdates(_0x3f2833[_0x4e52('0x49')],null))['then'](respondWithResult(_0x253d65,null))[_0x4e52('0x42')](handleError(_0x253d65,null));};exports[_0x4e52('0x4a')]=function(_0x3c5d72,_0x377af1){return db['ZendeskField'][_0x4e52('0x47')]({'where':{'id':_0x3c5d72[_0x4e52('0x44')]['id']}})['then'](handleEntityNotFound(_0x377af1,null))[_0x4e52('0x25')](removeEntity(_0x377af1,null))[_0x4e52('0x42')](handleError(_0x377af1,null));}; \ No newline at end of file +var _0x8e7b=['keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','destroy','then','end','error','name','send','index','map','ZendeskField','rawAttributes','type','key','query'];(function(_0x43a84a,_0x6c500e){var _0x2ed43a=function(_0x8f88c3){while(--_0x8f88c3){_0x43a84a['push'](_0x43a84a['shift']());}};_0x2ed43a(++_0x6c500e);}(_0x8e7b,0xb2));var _0xb8e7=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0x8e7b[_0x2235bf];return _0x4c3a64;};'use strict';var emlformat=require(_0xb8e7('0x0'));var rimraf=require(_0xb8e7('0x1'));var zipdir=require(_0xb8e7('0x2'));var jsonpatch=require(_0xb8e7('0x3'));var rp=require(_0xb8e7('0x4'));var moment=require('moment');var BPromise=require(_0xb8e7('0x5'));var Mustache=require('mustache');var util=require(_0xb8e7('0x6'));var path=require(_0xb8e7('0x7'));var sox=require(_0xb8e7('0x8'));var csv=require('to-csv');var ejs=require(_0xb8e7('0x9'));var fs=require('fs');var fs_extra=require(_0xb8e7('0xa'));var _=require(_0xb8e7('0xb'));var squel=require(_0xb8e7('0xc'));var crypto=require('crypto');var jsforce=require(_0xb8e7('0xd'));var deskjs=require(_0xb8e7('0xe'));var toCsv=require(_0xb8e7('0xf'));var querystring=require(_0xb8e7('0x10'));var Papa=require(_0xb8e7('0x11'));var Redis=require('ioredis');var authService=require(_0xb8e7('0x12'));var qs=require(_0xb8e7('0x13'));var as=require(_0xb8e7('0x14'));var hardwareService=require(_0xb8e7('0x15'));var logger=require(_0xb8e7('0x16'))(_0xb8e7('0x17'));var utils=require(_0xb8e7('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb8e7('0x19'));var db=require(_0xb8e7('0x1a'))['db'];function respondWithStatusCode(_0x56dad8,_0x588657){_0x588657=_0x588657||0xcc;return function(_0x5900ea){if(_0x5900ea){return _0x56dad8[_0xb8e7('0x1b')](_0x588657);}return _0x56dad8['status'](_0x588657)['end']();};}function respondWithResult(_0x4c07b1,_0x42547c){_0x42547c=_0x42547c||0xc8;return function(_0x42be6f){if(_0x42be6f){return _0x4c07b1[_0xb8e7('0x1c')](_0x42547c)[_0xb8e7('0x1d')](_0x42be6f);}};}function respondWithFilteredResult(_0x5f1264,_0xc53048){return function(_0x41f633){if(_0x41f633){var _0x230c9e=typeof _0xc53048[_0xb8e7('0x1e')]===_0xb8e7('0x1f')&&typeof _0xc53048[_0xb8e7('0x20')]===_0xb8e7('0x1f');var _0x421aec=_0x41f633[_0xb8e7('0x21')];var _0x4f6ae7=_0x230c9e?0x0:_0xc53048[_0xb8e7('0x1e')];var _0x258716=_0x230c9e?_0x41f633[_0xb8e7('0x21')]:_0xc53048[_0xb8e7('0x1e')]+_0xc53048[_0xb8e7('0x20')];var _0x53ccc9;if(_0x258716>=_0x421aec){_0x258716=_0x421aec;_0x53ccc9=0xc8;}else{_0x53ccc9=0xce;}_0x5f1264[_0xb8e7('0x1c')](_0x53ccc9);return _0x5f1264['set'](_0xb8e7('0x22'),_0x4f6ae7+'-'+_0x258716+'/'+_0x421aec)[_0xb8e7('0x1d')](_0x41f633);}return null;};}function patchUpdates(_0x5978de){return function(_0x5e1b64){try{jsonpatch['apply'](_0x5e1b64,_0x5978de,!![]);}catch(_0x343564){return BPromise['reject'](_0x343564);}return _0x5e1b64[_0xb8e7('0x23')]();};}function saveUpdates(_0x4f02f0,_0xba2dd4){return function(_0x384a99){if(_0x384a99){return _0x384a99[_0xb8e7('0x24')](_0x4f02f0)['then'](function(_0x5e55e0){return _0x5e55e0;});}return null;};}function removeEntity(_0x99416f,_0x2289f8){return function(_0x5032ec){if(_0x5032ec){return _0x5032ec[_0xb8e7('0x25')]()[_0xb8e7('0x26')](function(){_0x99416f[_0xb8e7('0x1c')](0xcc)[_0xb8e7('0x27')]();});}};}function handleEntityNotFound(_0x517ebc,_0x1862ff){return function(_0x5a304e){if(!_0x5a304e){_0x517ebc[_0xb8e7('0x1b')](0x194);}return _0x5a304e;};}function handleError(_0x212a4d,_0x149e7e){_0x149e7e=_0x149e7e||0x1f4;return function(_0x350190){logger[_0xb8e7('0x28')](_0x350190['stack']);if(_0x350190[_0xb8e7('0x29')]){delete _0x350190[_0xb8e7('0x29')];}_0x212a4d[_0xb8e7('0x1c')](_0x149e7e)[_0xb8e7('0x2a')](_0x350190);};}exports[_0xb8e7('0x2b')]=function(_0x1384ad,_0x49cfec){var _0x4f8440={},_0xd0a4d8={},_0x558e23={'count':0x0,'rows':[]};var _0x356317=_[_0xb8e7('0x2c')](db[_0xb8e7('0x2d')][_0xb8e7('0x2e')],function(_0x34eee8){return{'name':_0x34eee8['fieldName'],'type':_0x34eee8[_0xb8e7('0x2f')][_0xb8e7('0x30')]};});_0xd0a4d8['model']=_[_0xb8e7('0x2c')](_0x356317,'name');_0xd0a4d8[_0xb8e7('0x31')]=_[_0xb8e7('0x32')](_0x1384ad[_0xb8e7('0x31')]);_0xd0a4d8[_0xb8e7('0x33')]=_[_0xb8e7('0x34')](_0xd0a4d8['model'],_0xd0a4d8[_0xb8e7('0x31')]);_0x4f8440[_0xb8e7('0x35')]=_[_0xb8e7('0x34')](_0xd0a4d8[_0xb8e7('0x36')],qs[_0xb8e7('0x37')](_0x1384ad[_0xb8e7('0x31')][_0xb8e7('0x37')]));_0x4f8440[_0xb8e7('0x35')]=_0x4f8440[_0xb8e7('0x35')]['length']?_0x4f8440[_0xb8e7('0x35')]:_0xd0a4d8[_0xb8e7('0x36')];if(!_0x1384ad[_0xb8e7('0x31')][_0xb8e7('0x38')](_0xb8e7('0x39'))){_0x4f8440[_0xb8e7('0x20')]=qs[_0xb8e7('0x20')](_0x1384ad[_0xb8e7('0x31')][_0xb8e7('0x20')]);_0x4f8440[_0xb8e7('0x1e')]=qs['offset'](_0x1384ad[_0xb8e7('0x31')]['offset']);}_0x4f8440[_0xb8e7('0x3a')]=qs['sort'](_0x1384ad[_0xb8e7('0x31')]['sort']);_0x4f8440[_0xb8e7('0x3b')]=qs[_0xb8e7('0x33')](_[_0xb8e7('0x3c')](_0x1384ad[_0xb8e7('0x31')],_0xd0a4d8['filters']),_0x356317);if(_0x1384ad['query'][_0xb8e7('0x3d')]){_0x4f8440[_0xb8e7('0x3b')]=_[_0xb8e7('0x3e')](_0x4f8440[_0xb8e7('0x3b')],{'$or':_[_0xb8e7('0x2c')](_0x356317,function(_0x37fc20){if(_0x37fc20[_0xb8e7('0x2f')]!==_0xb8e7('0x3f')){var _0x10c4bb={};_0x10c4bb[_0x37fc20['name']]={'$like':'%'+_0x1384ad['query'][_0xb8e7('0x3d')]+'%'};return _0x10c4bb;}})});}_0x4f8440=_[_0xb8e7('0x3e')]({},_0x4f8440,_0x1384ad[_0xb8e7('0x40')]);var _0x43588a={'where':_0x4f8440[_0xb8e7('0x3b')]};return db[_0xb8e7('0x2d')][_0xb8e7('0x21')](_0x43588a)['then'](function(_0x18c2fa){_0x558e23[_0xb8e7('0x21')]=_0x18c2fa;if(_0x1384ad['query'][_0xb8e7('0x41')]){_0x4f8440[_0xb8e7('0x42')]=[{'all':!![]}];}return db[_0xb8e7('0x2d')][_0xb8e7('0x43')](_0x4f8440);})[_0xb8e7('0x26')](function(_0x2d8c42){_0x558e23[_0xb8e7('0x44')]=_0x2d8c42;return _0x558e23;})['then'](respondWithFilteredResult(_0x49cfec,_0x4f8440))['catch'](handleError(_0x49cfec,null));};exports[_0xb8e7('0x45')]=function(_0x4b91dc,_0x22e388){var _0x23d629={'raw':!![],'where':{'id':_0x4b91dc[_0xb8e7('0x46')]['id']}},_0x32cfb5={};_0x32cfb5[_0xb8e7('0x36')]=_[_0xb8e7('0x32')](db[_0xb8e7('0x2d')][_0xb8e7('0x2e')]);_0x32cfb5[_0xb8e7('0x31')]=_[_0xb8e7('0x32')](_0x4b91dc[_0xb8e7('0x31')]);_0x32cfb5[_0xb8e7('0x33')]=_[_0xb8e7('0x34')](_0x32cfb5['model'],_0x32cfb5[_0xb8e7('0x31')]);_0x23d629[_0xb8e7('0x35')]=_[_0xb8e7('0x34')](_0x32cfb5[_0xb8e7('0x36')],qs[_0xb8e7('0x37')](_0x4b91dc['query'][_0xb8e7('0x37')]));_0x23d629['attributes']=_0x23d629[_0xb8e7('0x35')][_0xb8e7('0x47')]?_0x23d629[_0xb8e7('0x35')]:_0x32cfb5[_0xb8e7('0x36')];if(_0x4b91dc[_0xb8e7('0x31')][_0xb8e7('0x41')]){_0x23d629[_0xb8e7('0x42')]=[{'all':!![]}];}_0x23d629=_[_0xb8e7('0x3e')]({},_0x23d629,_0x4b91dc[_0xb8e7('0x40')]);return db[_0xb8e7('0x2d')]['find'](_0x23d629)[_0xb8e7('0x26')](handleEntityNotFound(_0x22e388,null))[_0xb8e7('0x26')](respondWithResult(_0x22e388,null))[_0xb8e7('0x48')](handleError(_0x22e388,null));};exports[_0xb8e7('0x49')]=function(_0x553f16,_0x148b3d){return db[_0xb8e7('0x2d')][_0xb8e7('0x49')](_0x553f16['body'],{})['then'](respondWithResult(_0x148b3d,0xc9))[_0xb8e7('0x48')](handleError(_0x148b3d,null));};exports[_0xb8e7('0x24')]=function(_0x54dac2,_0x48e922){if(_0x54dac2[_0xb8e7('0x4a')]['id']){delete _0x54dac2['body']['id'];}return db[_0xb8e7('0x2d')][_0xb8e7('0x4b')]({'where':{'id':_0x54dac2[_0xb8e7('0x46')]['id']}})[_0xb8e7('0x26')](handleEntityNotFound(_0x48e922,null))[_0xb8e7('0x26')](saveUpdates(_0x54dac2['body'],null))[_0xb8e7('0x26')](respondWithResult(_0x48e922,null))['catch'](handleError(_0x48e922,null));};exports[_0xb8e7('0x25')]=function(_0xa120da,_0x2a13fc){return db[_0xb8e7('0x2d')]['find']({'where':{'id':_0xa120da['params']['id']}})['then'](handleEntityNotFound(_0x2a13fc,null))[_0xb8e7('0x26')](removeEntity(_0x2a13fc,null))[_0xb8e7('0x48')](handleError(_0x2a13fc,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 2117e5a..1b155a0 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 _0x0baa=['int_zendesk_fields','zendesk_unique_index','idField','FieldId','util','../../config/logger','moment','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define'];(function(_0x72c40,_0x56ac10){var _0x1ff365=function(_0x4ed4a9){while(--_0x4ed4a9){_0x72c40['push'](_0x72c40['shift']());}};_0x1ff365(++_0x56ac10);}(_0x0baa,0x108));var _0xa0ba=function(_0xf7e9b3,_0x48b57b){_0xf7e9b3=_0xf7e9b3-0x0;var _0x33414b=_0x0baa[_0xf7e9b3];return _0x33414b;};'use strict';var _=require('lodash');var util=require(_0xa0ba('0x0'));var logger=require(_0xa0ba('0x1'))('api');var moment=require(_0xa0ba('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa0ba('0x3'));var rimraf=require(_0xa0ba('0x4'));var config=require(_0xa0ba('0x5'));var attributes=require(_0xa0ba('0x6'));module[_0xa0ba('0x7')]=function(_0x51dcd4,_0x31353f){return _0x51dcd4[_0xa0ba('0x8')]('ZendeskField',attributes,{'tableName':_0xa0ba('0x9'),'paranoid':![],'indexes':[{'name':_0xa0ba('0xa'),'fields':[_0xa0ba('0xb'),_0xa0ba('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x33d7=['zendesk_unique_index','idField','FieldId','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x33d7,0xc7));var _0x733d=function(_0x3ac15d,_0x3c07ba){_0x3ac15d=_0x3ac15d-0x0;var _0x131cb4=_0x33d7[_0x3ac15d];return _0x131cb4;};'use strict';var _=require(_0x733d('0x0'));var util=require('util');var logger=require(_0x733d('0x1'))('api');var moment=require(_0x733d('0x2'));var BPromise=require(_0x733d('0x3'));var rp=require(_0x733d('0x4'));var fs=require('fs');var path=require(_0x733d('0x5'));var rimraf=require('rimraf');var config=require(_0x733d('0x6'));var attributes=require(_0x733d('0x7'));module[_0x733d('0x8')]=function(_0x50574f,_0x427ebf){return _0x50574f[_0x733d('0x9')](_0x733d('0xa'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x733d('0xb'),'fields':[_0x733d('0xc'),_0x733d('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 fb06de2..ba470fc 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 _0x866e=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ZendeskField,\x20%s,\x20%s','result','catch'];(function(_0x8ec28f,_0x20225b){var _0x161357=function(_0x33c128){while(--_0x33c128){_0x8ec28f['push'](_0x8ec28f['shift']());}};_0x161357(++_0x20225b);}(_0x866e,0x1e0));var _0xe866=function(_0x1c39de,_0x277965){_0x1c39de=_0x1c39de-0x0;var _0x4c9ccf=_0x866e[_0x1c39de];return _0x4c9ccf;};'use strict';var _=require('lodash');var util=require(_0xe866('0x0'));var moment=require(_0xe866('0x1'));var BPromise=require(_0xe866('0x2'));var rs=require(_0xe866('0x3'));var fs=require('fs');var Redis=require(_0xe866('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe866('0x5'));var logger=require(_0xe866('0x6'))(_0xe866('0x7'));var config=require(_0xe866('0x8'));var jayson=require(_0xe866('0x9'));var client=jayson[_0xe866('0xa')][_0xe866('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x27c66f,_0x561375,_0x5bbc5f){return new BPromise(function(_0x4cc983,_0x42b4c4){return client[_0xe866('0xc')](_0x27c66f,_0x5bbc5f)['then'](function(_0x269b47){logger[_0xe866('0xd')]('ZendeskField,\x20%s,\x20%s',_0x561375,_0xe866('0xe'));logger[_0xe866('0xf')](_0xe866('0x10'),_0x561375,_0xe866('0xe'),JSON[_0xe866('0x11')](_0x269b47));if(_0x269b47[_0xe866('0x12')]){if(_0x269b47[_0xe866('0x12')][_0xe866('0x13')]===0x1f4){logger[_0xe866('0x12')]('ZendeskField,\x20%s,\x20%s',_0x561375,_0x269b47[_0xe866('0x12')][_0xe866('0x14')]);return _0x42b4c4(_0x269b47[_0xe866('0x12')]['message']);}logger['error']('ZendeskField,\x20%s,\x20%s',_0x561375,_0x269b47[_0xe866('0x12')][_0xe866('0x14')]);return _0x4cc983(_0x269b47[_0xe866('0x12')][_0xe866('0x14')]);}else{logger[_0xe866('0xd')](_0xe866('0x15'),_0x561375,'request\x20sent');_0x4cc983(_0x269b47[_0xe866('0x16')]['message']);}})[_0xe866('0x17')](function(_0x46369f){logger[_0xe866('0x12')](_0xe866('0x15'),_0x561375,_0x46369f);_0x42b4c4(_0x46369f);});});} \ No newline at end of file +var _0xf039=['ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x42d4b7,_0x5b15f7){var _0x42ad3e=function(_0x3b71db){while(--_0x3b71db){_0x42d4b7['push'](_0x42d4b7['shift']());}};_0x42ad3e(++_0x5b15f7);}(_0xf039,0xfb));var _0x9f03=function(_0x435f08,_0xc91841){_0x435f08=_0x435f08-0x0;var _0x4e40ba=_0xf039[_0x435f08];return _0x4e40ba;};'use strict';var _=require('lodash');var util=require(_0x9f03('0x0'));var moment=require(_0x9f03('0x1'));var BPromise=require(_0x9f03('0x2'));var rs=require(_0x9f03('0x3'));var fs=require('fs');var Redis=require(_0x9f03('0x4'));var db=require(_0x9f03('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9f03('0x6'))('rpc');var config=require(_0x9f03('0x7'));var jayson=require(_0x9f03('0x8'));var client=jayson['client'][_0x9f03('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x48a503,_0x5da272,_0x1c2f91){return new BPromise(function(_0x39851c,_0x463cc0){return client[_0x9f03('0xa')](_0x48a503,_0x1c2f91)[_0x9f03('0xb')](function(_0x1c60ee){logger[_0x9f03('0xc')](_0x9f03('0xd'),_0x5da272,_0x9f03('0xe'));logger[_0x9f03('0xf')](_0x9f03('0x10'),_0x5da272,'request\x20sent',JSON['stringify'](_0x1c60ee));if(_0x1c60ee[_0x9f03('0x11')]){if(_0x1c60ee[_0x9f03('0x11')][_0x9f03('0x12')]===0x1f4){logger[_0x9f03('0x11')](_0x9f03('0xd'),_0x5da272,_0x1c60ee['error'][_0x9f03('0x13')]);return _0x463cc0(_0x1c60ee[_0x9f03('0x11')][_0x9f03('0x13')]);}logger['error'](_0x9f03('0xd'),_0x5da272,_0x1c60ee[_0x9f03('0x11')][_0x9f03('0x13')]);return _0x39851c(_0x1c60ee[_0x9f03('0x11')][_0x9f03('0x13')]);}else{logger[_0x9f03('0xc')](_0x9f03('0xd'),_0x5da272,_0x9f03('0xe'));_0x39851c(_0x1c60ee[_0x9f03('0x14')][_0x9f03('0x13')]);}})[_0x9f03('0x15')](function(_0x58f67b){logger['error'](_0x9f03('0xd'),_0x5da272,_0x58f67b);_0x463cc0(_0x58f67b);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index c96a5ba..542fc73 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 _0xbf83=['isAuthenticated','index','get','/:id','show','getFields','post','create','addConfiguration','put','update','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoAccount.controller'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0xbf83,0x147));var _0x3bf8=function(_0xf6cbe3,_0x34f347){_0xf6cbe3=_0xf6cbe3-0x0;var _0x51c415=_0xbf83[_0xf6cbe3];return _0x51c415;};'use strict';var multer=require(_0x3bf8('0x0'));var util=require(_0x3bf8('0x1'));var path=require(_0x3bf8('0x2'));var timeout=require(_0x3bf8('0x3'));var express=require('express');var router=express[_0x3bf8('0x4')]();var fs_extra=require(_0x3bf8('0x5'));var auth=require(_0x3bf8('0x6'));var interaction=require(_0x3bf8('0x7'));var config=require('../../config/environment');var controller=require(_0x3bf8('0x8'));router['get']('/',auth[_0x3bf8('0x9')](),controller[_0x3bf8('0xa')]);router[_0x3bf8('0xb')](_0x3bf8('0xc'),auth[_0x3bf8('0x9')](),controller[_0x3bf8('0xd')]);router[_0x3bf8('0xb')]('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router[_0x3bf8('0xb')]('/:id/fields',auth[_0x3bf8('0x9')](),controller[_0x3bf8('0xe')]);router[_0x3bf8('0xf')]('/',auth[_0x3bf8('0x9')](),controller[_0x3bf8('0x10')]);router['post']('/:id/configurations',auth[_0x3bf8('0x9')](),controller[_0x3bf8('0x11')]);router[_0x3bf8('0x12')](_0x3bf8('0xc'),auth['isAuthenticated'](),controller[_0x3bf8('0x13')]);router['delete'](_0x3bf8('0xc'),auth[_0x3bf8('0x9')](),controller[_0x3bf8('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa191=['index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','delete','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./intZohoAccount.controller','get'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0xa191,0xa7));var _0x1a19=function(_0xb1e8a1,_0x7dbda3){_0xb1e8a1=_0xb1e8a1-0x0;var _0x583dd5=_0xa191[_0xb1e8a1];return _0x583dd5;};'use strict';var multer=require(_0x1a19('0x0'));var util=require(_0x1a19('0x1'));var path=require(_0x1a19('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1a19('0x3')]();var fs_extra=require(_0x1a19('0x4'));var auth=require(_0x1a19('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1a19('0x6'));var controller=require(_0x1a19('0x7'));router[_0x1a19('0x8')]('/',auth['isAuthenticated'](),controller[_0x1a19('0x9')]);router[_0x1a19('0x8')](_0x1a19('0xa'),auth[_0x1a19('0xb')](),controller[_0x1a19('0xc')]);router[_0x1a19('0x8')](_0x1a19('0xd'),auth['isAuthenticated'](),controller[_0x1a19('0xe')]);router[_0x1a19('0x8')](_0x1a19('0xf'),auth[_0x1a19('0xb')](),controller[_0x1a19('0x10')]);router[_0x1a19('0x11')]('/',auth[_0x1a19('0xb')](),controller[_0x1a19('0x12')]);router[_0x1a19('0x11')](_0x1a19('0xd'),auth[_0x1a19('0xb')](),controller['addConfiguration']);router[_0x1a19('0x13')](_0x1a19('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x1a19('0x14')]('/:id',auth[_0x1a19('0xb')](),controller[_0x1a19('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index ad5e506..f77caaa 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 _0x22fb=['STRING'];(function(_0x2fc2e3,_0x3d703b){var _0x301d40=function(_0x1587f6){while(--_0x1587f6){_0x2fc2e3['push'](_0x2fc2e3['shift']());}};_0x301d40(++_0x3d703b);}(_0x22fb,0x192));var _0xb22f=function(_0x47d289,_0x3fc0c7){_0x47d289=_0x47d289-0x0;var _0x4b2b26=_0x22fb[_0x47d289];return _0x4b2b26;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb22f('0x0')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xb22f('0x0')]},'zone':{'type':Sequelize[_0xb22f('0x0')]},'clientId':{'type':Sequelize[_0xb22f('0x0')]},'clientSecret':{'type':Sequelize[_0xb22f('0x0')]},'serverUrl':{'type':Sequelize[_0xb22f('0x0')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0xb22f('0x0')]}}; \ No newline at end of file +var _0x70e0=['STRING','sequelize','exports'];(function(_0x18f808,_0x15190d){var _0x1e7b6c=function(_0x5a91cb){while(--_0x5a91cb){_0x18f808['push'](_0x18f808['shift']());}};_0x1e7b6c(++_0x15190d);}(_0x70e0,0x17b));var _0x070e=function(_0x1fa502,_0x48ced0){_0x1fa502=_0x1fa502-0x0;var _0x19701c=_0x70e0[_0x1fa502];return _0x19701c;};'use strict';var Sequelize=require(_0x070e('0x0'));module[_0x070e('0x1')]={'name':{'type':Sequelize[_0x070e('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x070e('0x2')]},'clientId':{'type':Sequelize[_0x070e('0x2')]},'clientSecret':{'type':Sequelize[_0x070e('0x2')]},'serverUrl':{'type':Sequelize[_0x070e('0x2')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x070e('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 2dfe134..144093c 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 _0x2919=['fast-json-patch','request-promise','moment','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','ZohoAccount','fieldName','type','key','model','map','query','keys','filters','attributes','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','fields','include','merge','find','create','body','getConfigurations','ZohoConfiguration','options','nolimit','addConfiguration','findOne','AccountId','Subjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','clientSecret','code','zoho.eu','serverUrl','slice','format','Calls','Zoho-oauthtoken\x20','response','Owner','Subject','Description','Call_Result','Call_Type','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','zip-dir'];(function(_0x213f27,_0x2aa23c){var _0x16b479=function(_0x3ee218){while(--_0x3ee218){_0x213f27['push'](_0x213f27['shift']());}};_0x16b479(++_0x2aa23c);}(_0x2919,0x169));var _0x9291=function(_0x1d4d4d,_0x4addfa){_0x1d4d4d=_0x1d4d4d-0x0;var _0x34e53d=_0x2919[_0x1d4d4d];return _0x34e53d;};'use strict';var emlformat=require(_0x9291('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9291('0x1'));var jsonpatch=require(_0x9291('0x2'));var rp=require(_0x9291('0x3'));var moment=require(_0x9291('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9291('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x9291('0x6'));var ejs=require(_0x9291('0x7'));var fs=require('fs');var fs_extra=require(_0x9291('0x8'));var _=require(_0x9291('0x9'));var squel=require(_0x9291('0xa'));var crypto=require(_0x9291('0xb'));var jsforce=require(_0x9291('0xc'));var deskjs=require(_0x9291('0xd'));var toCsv=require(_0x9291('0x6'));var querystring=require('querystring');var Papa=require(_0x9291('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9291('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9291('0x10'));var logger=require(_0x9291('0x11'))(_0x9291('0x12'));var utils=require('../../config/utils');var config=require(_0x9291('0x13'));var licenseUtil=require(_0x9291('0x14'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x47ca40,_0x5e3c2d){_0x5e3c2d=_0x5e3c2d||0xcc;return function(_0x344293){if(_0x344293){return _0x47ca40[_0x9291('0x15')](_0x5e3c2d);}return _0x47ca40[_0x9291('0x16')](_0x5e3c2d)['end']();};}function respondWithResult(_0xcf8f31,_0x3cffa5){_0x3cffa5=_0x3cffa5||0xc8;return function(_0x4b0a3b){if(_0x4b0a3b){return _0xcf8f31[_0x9291('0x16')](_0x3cffa5)[_0x9291('0x17')](_0x4b0a3b);}};}function respondWithFilteredResult(_0x130db4,_0x519168){return function(_0x580ab9){if(_0x580ab9){var _0x260846=typeof _0x519168[_0x9291('0x18')]===_0x9291('0x19')&&typeof _0x519168['limit']===_0x9291('0x19');var _0x5d17f8=_0x580ab9[_0x9291('0x1a')];var _0x1a01b9=_0x260846?0x0:_0x519168[_0x9291('0x18')];var _0x5e8e46=_0x260846?_0x580ab9[_0x9291('0x1a')]:_0x519168[_0x9291('0x18')]+_0x519168[_0x9291('0x1b')];var _0x322226;if(_0x5e8e46>=_0x5d17f8){_0x5e8e46=_0x5d17f8;_0x322226=0xc8;}else{_0x322226=0xce;}_0x130db4[_0x9291('0x16')](_0x322226);return _0x130db4['set'](_0x9291('0x1c'),_0x1a01b9+'-'+_0x5e8e46+'/'+_0x5d17f8)[_0x9291('0x17')](_0x580ab9);}return null;};}function patchUpdates(_0x7488c4){return function(_0x3b9ff5){try{jsonpatch[_0x9291('0x1d')](_0x3b9ff5,_0x7488c4,!![]);}catch(_0x5ce10b){return BPromise[_0x9291('0x1e')](_0x5ce10b);}return _0x3b9ff5[_0x9291('0x1f')]();};}function saveUpdates(_0x590d98,_0xba660a){return function(_0x3fd105){if(_0x3fd105){return _0x3fd105[_0x9291('0x20')](_0x590d98)[_0x9291('0x21')](function(_0x542cd7){return _0x542cd7;});}return null;};}function removeEntity(_0x483b67,_0x508b67){return function(_0x7c260e){if(_0x7c260e){return _0x7c260e[_0x9291('0x22')]()[_0x9291('0x21')](function(){_0x483b67[_0x9291('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x306a2f,_0x46f0dc){return function(_0x1f1cd6){if(!_0x1f1cd6){_0x306a2f[_0x9291('0x15')](0x194);}return _0x1f1cd6;};}function handleError(_0x1074e9,_0x1d2095){_0x1d2095=_0x1d2095||0x1f4;return function(_0x1c9902){logger[_0x9291('0x23')](_0x1c9902['stack']);if(_0x1c9902['name']){delete _0x1c9902[_0x9291('0x24')];}_0x1074e9[_0x9291('0x16')](_0x1d2095)[_0x9291('0x25')](_0x1c9902);};}exports[_0x9291('0x26')]=function(_0x2ec470,_0x16c68b){var _0xf7ff11={},_0x358a06={},_0x3c87b9={'count':0x0,'rows':[]};var _0x23a329=_['map'](db[_0x9291('0x27')]['rawAttributes'],function(_0x516532){return{'name':_0x516532[_0x9291('0x28')],'type':_0x516532[_0x9291('0x29')][_0x9291('0x2a')]};});_0x358a06[_0x9291('0x2b')]=_[_0x9291('0x2c')](_0x23a329,'name');_0x358a06[_0x9291('0x2d')]=_[_0x9291('0x2e')](_0x2ec470[_0x9291('0x2d')]);_0x358a06[_0x9291('0x2f')]=_['intersection'](_0x358a06[_0x9291('0x2b')],_0x358a06[_0x9291('0x2d')]);_0xf7ff11['attributes']=_['intersection'](_0x358a06[_0x9291('0x2b')],qs['fields'](_0x2ec470[_0x9291('0x2d')]['fields']));_0xf7ff11[_0x9291('0x30')]=_0xf7ff11[_0x9291('0x30')][_0x9291('0x31')]?_0xf7ff11[_0x9291('0x30')]:_0x358a06[_0x9291('0x2b')];if(!_0x2ec470[_0x9291('0x2d')][_0x9291('0x32')]('nolimit')){_0xf7ff11[_0x9291('0x1b')]=qs[_0x9291('0x1b')](_0x2ec470[_0x9291('0x2d')][_0x9291('0x1b')]);_0xf7ff11[_0x9291('0x18')]=qs['offset'](_0x2ec470[_0x9291('0x2d')][_0x9291('0x18')]);}_0xf7ff11[_0x9291('0x33')]=qs[_0x9291('0x34')](_0x2ec470[_0x9291('0x2d')]['sort']);_0xf7ff11[_0x9291('0x35')]=qs['filters'](_['pick'](_0x2ec470[_0x9291('0x2d')],_0x358a06['filters']),_0x23a329);if(_0x2ec470[_0x9291('0x2d')][_0x9291('0x36')]){_0xf7ff11[_0x9291('0x35')]=_['merge'](_0xf7ff11[_0x9291('0x35')],{'$or':_[_0x9291('0x2c')](_0x23a329,function(_0x4d736a){if(_0x4d736a[_0x9291('0x29')]!==_0x9291('0x37')){var _0x1b0af5={};_0x1b0af5[_0x4d736a[_0x9291('0x24')]]={'$like':'%'+_0x2ec470['query'][_0x9291('0x36')]+'%'};return _0x1b0af5;}})});}_0xf7ff11=_['merge']({},_0xf7ff11,_0x2ec470['options']);var _0x2b1eac={'where':_0xf7ff11[_0x9291('0x35')]};return db['ZohoAccount']['count'](_0x2b1eac)[_0x9291('0x21')](function(_0x266311){_0x3c87b9['count']=_0x266311;if(_0x2ec470[_0x9291('0x2d')][_0x9291('0x38')]){_0xf7ff11['include']=[{'all':!![]}];}return db[_0x9291('0x27')][_0x9291('0x39')](_0xf7ff11);})[_0x9291('0x21')](function(_0x325285){_0x3c87b9[_0x9291('0x3a')]=_0x325285;return _0x3c87b9;})['then'](respondWithFilteredResult(_0x16c68b,_0xf7ff11))[_0x9291('0x3b')](handleError(_0x16c68b,null));};exports[_0x9291('0x3c')]=function(_0x5e34ef,_0x1d26c8){var _0x310a75={'raw':![],'where':{'id':_0x5e34ef[_0x9291('0x3d')]['id']}},_0x356a9a={};_0x356a9a[_0x9291('0x2b')]=_['keys'](db[_0x9291('0x27')][_0x9291('0x3e')]);_0x356a9a[_0x9291('0x2d')]=_['keys'](_0x5e34ef[_0x9291('0x2d')]);_0x356a9a[_0x9291('0x2f')]=_['intersection'](_0x356a9a[_0x9291('0x2b')],_0x356a9a[_0x9291('0x2d')]);_0x310a75[_0x9291('0x30')]=_[_0x9291('0x3f')](_0x356a9a[_0x9291('0x2b')],qs['fields'](_0x5e34ef[_0x9291('0x2d')][_0x9291('0x40')]));_0x310a75[_0x9291('0x30')]=_0x310a75[_0x9291('0x30')][_0x9291('0x31')]?_0x310a75[_0x9291('0x30')]:_0x356a9a['model'];if(_0x5e34ef[_0x9291('0x2d')][_0x9291('0x38')]){_0x310a75[_0x9291('0x41')]=[{'all':!![]}];}_0x310a75=_[_0x9291('0x42')]({},_0x310a75,_0x5e34ef['options']);return db[_0x9291('0x27')][_0x9291('0x43')](_0x310a75)[_0x9291('0x21')](handleEntityNotFound(_0x1d26c8,null))[_0x9291('0x21')](respondWithResult(_0x1d26c8,null))[_0x9291('0x3b')](handleError(_0x1d26c8,null));};exports[_0x9291('0x44')]=function(_0x1d8a40,_0x8948bd){return db['ZohoAccount'][_0x9291('0x44')](_0x1d8a40[_0x9291('0x45')],{})[_0x9291('0x21')](respondWithResult(_0x8948bd,0xc9))[_0x9291('0x3b')](handleError(_0x8948bd,null));};exports[_0x9291('0x20')]=function(_0x6d3c92,_0x3d9074){if(_0x6d3c92[_0x9291('0x45')]['id']){delete _0x6d3c92[_0x9291('0x45')]['id'];}return db[_0x9291('0x27')][_0x9291('0x43')]({'where':{'id':_0x6d3c92['params']['id']}})[_0x9291('0x21')](handleEntityNotFound(_0x3d9074,null))[_0x9291('0x21')](saveUpdates(_0x6d3c92[_0x9291('0x45')],null))['then'](respondWithResult(_0x3d9074,null))[_0x9291('0x3b')](handleError(_0x3d9074,null));};exports[_0x9291('0x22')]=function(_0x5ea2ac,_0x1e645f){return db[_0x9291('0x27')]['find']({'where':{'id':_0x5ea2ac[_0x9291('0x3d')]['id']}})[_0x9291('0x21')](handleEntityNotFound(_0x1e645f,null))['then'](removeEntity(_0x1e645f,null))[_0x9291('0x3b')](handleError(_0x1e645f,null));};exports[_0x9291('0x46')]=function(_0x4cf707,_0x2e62f8,_0x1f894a){var _0x10546b={};var _0x504c91={};var _0x1b3338;var _0x5b8214;return db[_0x9291('0x27')]['findOne']({'where':{'id':_0x4cf707[_0x9291('0x3d')]['id']}})['then'](handleEntityNotFound(_0x2e62f8,null))['then'](function(_0x2d922e){if(_0x2d922e){_0x1b3338=_0x2d922e;_0x504c91[_0x9291('0x2b')]=_['keys'](db[_0x9291('0x47')][_0x9291('0x3e')]);_0x504c91[_0x9291('0x2d')]=_[_0x9291('0x2e')](_0x4cf707['query']);_0x504c91[_0x9291('0x2f')]=_[_0x9291('0x3f')](_0x504c91[_0x9291('0x2b')],_0x504c91[_0x9291('0x2d')]);_0x10546b[_0x9291('0x30')]=_['intersection'](_0x504c91['model'],qs[_0x9291('0x40')](_0x4cf707[_0x9291('0x2d')][_0x9291('0x40')]));_0x10546b[_0x9291('0x30')]=_0x10546b[_0x9291('0x30')][_0x9291('0x31')]?_0x10546b['attributes']:_0x504c91[_0x9291('0x2b')];_0x10546b[_0x9291('0x33')]=qs[_0x9291('0x34')](_0x4cf707[_0x9291('0x2d')][_0x9291('0x34')]);_0x10546b['where']=qs[_0x9291('0x2f')](_['pick'](_0x4cf707[_0x9291('0x2d')],_0x504c91[_0x9291('0x2f')]));if(_0x4cf707[_0x9291('0x2d')][_0x9291('0x36')]){_0x10546b[_0x9291('0x35')]=_[_0x9291('0x42')](_0x10546b['where'],{'$or':_[_0x9291('0x2c')](_0x10546b[_0x9291('0x30')],function(_0x2eb542){var _0x53b31b={};_0x53b31b[_0x2eb542]={'$like':'%'+_0x4cf707[_0x9291('0x2d')][_0x9291('0x36')]+'%'};return _0x53b31b;})});}_0x10546b=_[_0x9291('0x42')]({},_0x10546b,_0x4cf707[_0x9291('0x48')]);return _0x1b3338[_0x9291('0x46')](_0x10546b);}})[_0x9291('0x21')](function(_0x41135d){if(_0x41135d){_0x5b8214=_0x41135d[_0x9291('0x31')];if(!_0x4cf707[_0x9291('0x2d')][_0x9291('0x32')](_0x9291('0x49'))){_0x10546b['limit']=qs[_0x9291('0x1b')](_0x4cf707[_0x9291('0x2d')][_0x9291('0x1b')]);_0x10546b[_0x9291('0x18')]=qs[_0x9291('0x18')](_0x4cf707[_0x9291('0x2d')][_0x9291('0x18')]);}return _0x1b3338[_0x9291('0x46')](_0x10546b);}})['then'](function(_0x8f8946){if(_0x8f8946){return _0x8f8946?{'count':_0x5b8214,'rows':_0x8f8946}:null;}})[_0x9291('0x21')](respondWithResult(_0x2e62f8,null))[_0x9291('0x3b')](handleError(_0x2e62f8,null));};exports[_0x9291('0x4a')]=function(_0x1e5ac6,_0xfe5588,_0x26fbfd){if(_0x1e5ac6[_0x9291('0x45')]['id']){delete _0x1e5ac6['body']['id'];}return db[_0x9291('0x27')][_0x9291('0x4b')]({'where':{'id':_0x1e5ac6[_0x9291('0x3d')]['id']}})[_0x9291('0x21')](handleEntityNotFound(_0xfe5588,null))[_0x9291('0x21')](function(_0x4cf0fd){if(_0x4cf0fd){_0x1e5ac6[_0x9291('0x45')][_0x9291('0x4c')]=_0x4cf0fd['id'];_0x1e5ac6['body'][_0x9291('0x4d')]=integrations['getSubjects'](_0x1e5ac6[_0x9291('0x45')][_0x9291('0x4e')],_0x1e5ac6[_0x9291('0x45')][_0x9291('0x29')]);_0x1e5ac6[_0x9291('0x45')][_0x9291('0x4f')]=integrations[_0x9291('0x50')](_0x1e5ac6[_0x9291('0x45')][_0x9291('0x4e')],_0x1e5ac6['body']['type']);return db['ZohoConfiguration'][_0x9291('0x44')](_0x1e5ac6[_0x9291('0x45')],{'include':[{'model':db[_0x9291('0x51')],'as':_0x9291('0x4d')},{'model':db['ZohoField'],'as':_0x9291('0x4f')}]});}return null;})[_0x9291('0x21')](respondWithResult(_0xfe5588,null))[_0x9291('0x3b')](handleError(_0xfe5588,null));};function getAccessToken(_0x2a1fc4){return new Promise(function(_0x1a5e5a,_0x1eb9d0){var _0x2894ca;switch(_0x2a1fc4[_0x9291('0x52')]){case'US':_0x2894ca=_0x9291('0x53');break;case'AU':_0x2894ca='https://accounts.zoho.com.au';break;case'EU':_0x2894ca=_0x9291('0x54');break;case'IN':_0x2894ca=_0x9291('0x55');break;case'CN':_0x2894ca=_0x9291('0x56');break;default:_0x2894ca=_0x9291('0x54');break;}var _0x4fe51d={'method':'POST','uri':_0x2894ca+_0x9291('0x57'),'qs':{'refresh_token':_0x2a1fc4[_0x9291('0x58')],'client_id':_0x2a1fc4[_0x9291('0x59')],'client_secret':_0x2a1fc4['clientSecret'],'grant_type':'refresh_token'},'json':!![]};return rp(_0x4fe51d)[_0x9291('0x21')](function(_0x3ebcaf){if(_0x3ebcaf[_0x9291('0x5a')]){_0x1a5e5a(_0x3ebcaf['access_token']);}else{_0x1eb9d0(_0x9291('0x5b'));}})[_0x9291('0x3b')](function(_0x555fa5){_0x1eb9d0(_0x555fa5);});});}exports[_0x9291('0x5c')]=function(_0x21c208,_0x4a6b89,_0x3f410c){var _0x55e1e4,_0x13cfb3,_0x2fceee,_0x3f9959,_0x5031a1;return db[_0x9291('0x27')][_0x9291('0x4b')]({'where':{'id':_0x21c208[_0x9291('0x3d')]['id']},'attributes':['id',_0x9291('0x5d'),_0x9291('0x52'),'clientId',_0x9291('0x5e'),'serverUrl',_0x9291('0x5f'),_0x9291('0x58')]})[_0x9291('0x21')](handleEntityNotFound(_0x4a6b89,null))[_0x9291('0x21')](function(_0x13a823){_0x5031a1=_0x13a823;_0x55e1e4=_0x5031a1[_0x9291('0x5d')];_0x13cfb3=_0x55e1e4===_0x9291('0x60')?'eu':'com';_0x2fceee=_0x5031a1[_0x9291('0x61')];var _0x11367d=_0x2fceee[_0x9291('0x62')](-0x1);if(_0x11367d==='/'||_0x11367d==='\x5c'||_0x11367d===':'){_0x2fceee=_0x2fceee['substring'](0x0,_0x2fceee['lastIndexOf'](_0x11367d));}if(!_0x5031a1['refreshToken']){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x5031a1);})[_0x9291('0x21')](function(_0x70037d){if(_0x70037d){return rp({'method':'GET','uri':util[_0x9291('0x63')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x13cfb3),'qs':{'module':_0x9291('0x64')},'headers':{'Authorization':_0x9291('0x65')+_0x70037d},'json':!![]});}})[_0x9291('0x21')](function(_0x3d9343){if(_0x3d9343){if(_0x3d9343[_0x9291('0x66')]&&_0x3d9343[_0x9291('0x66')][_0x9291('0x23')]){throw new Error(_0x3d9343[_0x9291('0x66')][_0x9291('0x23')]['message']);}var _0x58b669=[];var _0x4fe5bd=[];var _0x361d01=[_0x9291('0x67'),_0x9291('0x68'),_0x9291('0x69'),'WhoId','Call_Duration',_0x9291('0x6a'),'Call_Start_Time',_0x9291('0x6b')];_0x4fe5bd=_['remove'](_0x3d9343['fields'],function(_0x2779c2){return _0x361d01[_0x9291('0x6c')](_0x2779c2[_0x9291('0x6d')]);});for(var _0x37a777=0x0;_0x37a777<_0x4fe5bd[_0x9291('0x31')];_0x37a777++){if(_0x4fe5bd[_0x37a777][_0x9291('0x6e')]===![]){_0x58b669[_0x9291('0x6f')]({'id':_0x4fe5bd[_0x37a777]['id'],'name':_0x4fe5bd[_0x37a777][_0x9291('0x70')],'custom':_0x4fe5bd[_0x37a777][_0x9291('0x71')],'options':_0x4fe5bd[_0x37a777][_0x9291('0x72')]===_0x9291('0x73')&&_0x4fe5bd[_0x37a777][_0x9291('0x74')][_0x9291('0x31')]>-0x1?_[_0x9291('0x2c')](_0x4fe5bd[_0x37a777]['pick_list_values'],function(_0xf76c2a){return{'name':_0xf76c2a,'value':_0xf76c2a};}):[]});}}return{'count':_0x58b669[_0x9291('0x31')],'rows':_0x58b669};}else{return{'count':0x0,'rows':[]};}})[_0x9291('0x21')](respondWithResult(_0x4a6b89,null))[_0x9291('0x3b')](function(_0x1ae6b4){var _0xbb80c8=_0x21c208[_0x9291('0x2d')][_0x9291('0x75')]?0x1f4:_0x1ae6b4[_0x9291('0x76')]||0x1f4;logger[_0x9291('0x23')](_0x9291('0x77'),_0x9291('0x5c'),_0xbb80c8,JSON['stringify'](_0x1ae6b4));delete _0x1ae6b4[_0x9291('0x24')];if(_0xbb80c8===0x191){_0xbb80c8=0x190;}_0x4a6b89[_0x9291('0x16')](_0xbb80c8)['send'](_0x21c208[_0x9291('0x2d')][_0x9291('0x75')]?{'message':_0x9291('0x78'),'statusCode':_0x1ae6b4['statusCode']}:_0x1ae6b4);});}; \ No newline at end of file +var _0x9c36=['code','refreshToken','zoho.eu','serverUrl','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','error','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Start_Time','includes','api_name','system_mandatory','push','display_label','custom_field','pick_list_values','getFields,\x20%s,\x20%s,\x20%s','statusCode','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','end','stack','name','send','index','map','ZohoAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','find','create','body','findOne','order','filter','merge','options','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoConfiguration','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','clientId'];(function(_0xd299c3,_0x4ba0f1){var _0x376574=function(_0xc585f){while(--_0xc585f){_0xd299c3['push'](_0xd299c3['shift']());}};_0x376574(++_0x4ba0f1);}(_0x9c36,0x1b6));var _0x69c3=function(_0x9df9da,_0x328324){_0x9df9da=_0x9df9da-0x0;var _0x4af4ff=_0x9c36[_0x9df9da];return _0x4af4ff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x69c3('0x0'));var zipdir=require(_0x69c3('0x1'));var jsonpatch=require(_0x69c3('0x2'));var rp=require(_0x69c3('0x3'));var moment=require(_0x69c3('0x4'));var BPromise=require(_0x69c3('0x5'));var Mustache=require(_0x69c3('0x6'));var util=require(_0x69c3('0x7'));var path=require(_0x69c3('0x8'));var sox=require(_0x69c3('0x9'));var csv=require(_0x69c3('0xa'));var ejs=require(_0x69c3('0xb'));var fs=require('fs');var fs_extra=require(_0x69c3('0xc'));var _=require(_0x69c3('0xd'));var squel=require(_0x69c3('0xe'));var crypto=require(_0x69c3('0xf'));var jsforce=require(_0x69c3('0x10'));var deskjs=require(_0x69c3('0x11'));var toCsv=require(_0x69c3('0xa'));var querystring=require(_0x69c3('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x69c3('0x13'));var as=require(_0x69c3('0x14'));var hardwareService=require(_0x69c3('0x15'));var logger=require(_0x69c3('0x16'))(_0x69c3('0x17'));var utils=require(_0x69c3('0x18'));var config=require(_0x69c3('0x19'));var licenseUtil=require(_0x69c3('0x1a'));var db=require('../../mysqldb')['db'];var integrations=require(_0x69c3('0x1b'));function respondWithStatusCode(_0x25c65f,_0x254ac8){_0x254ac8=_0x254ac8||0xcc;return function(_0x43154c){if(_0x43154c){return _0x25c65f[_0x69c3('0x1c')](_0x254ac8);}return _0x25c65f[_0x69c3('0x1d')](_0x254ac8)['end']();};}function respondWithResult(_0x2b1713,_0x23f461){_0x23f461=_0x23f461||0xc8;return function(_0x5ce3c5){if(_0x5ce3c5){return _0x2b1713[_0x69c3('0x1d')](_0x23f461)[_0x69c3('0x1e')](_0x5ce3c5);}};}function respondWithFilteredResult(_0xdb61b1,_0x5022de){return function(_0x1a583c){if(_0x1a583c){var _0x25df39=typeof _0x5022de[_0x69c3('0x1f')]===_0x69c3('0x20')&&typeof _0x5022de['limit']===_0x69c3('0x20');var _0xa36ebe=_0x1a583c['count'];var _0x24f257=_0x25df39?0x0:_0x5022de[_0x69c3('0x1f')];var _0x3bf497=_0x25df39?_0x1a583c[_0x69c3('0x21')]:_0x5022de[_0x69c3('0x1f')]+_0x5022de[_0x69c3('0x22')];var _0x1c79fd;if(_0x3bf497>=_0xa36ebe){_0x3bf497=_0xa36ebe;_0x1c79fd=0xc8;}else{_0x1c79fd=0xce;}_0xdb61b1[_0x69c3('0x1d')](_0x1c79fd);return _0xdb61b1[_0x69c3('0x23')](_0x69c3('0x24'),_0x24f257+'-'+_0x3bf497+'/'+_0xa36ebe)[_0x69c3('0x1e')](_0x1a583c);}return null;};}function patchUpdates(_0x24b2fa){return function(_0x36d7c8){try{jsonpatch[_0x69c3('0x25')](_0x36d7c8,_0x24b2fa,!![]);}catch(_0x8dd539){return BPromise[_0x69c3('0x26')](_0x8dd539);}return _0x36d7c8[_0x69c3('0x27')]();};}function saveUpdates(_0x1df419,_0x575843){return function(_0x12122e){if(_0x12122e){return _0x12122e[_0x69c3('0x28')](_0x1df419)['then'](function(_0x38ea70){return _0x38ea70;});}return null;};}function removeEntity(_0x562dab,_0x4c067a){return function(_0x22230a){if(_0x22230a){return _0x22230a[_0x69c3('0x29')]()[_0x69c3('0x2a')](function(){_0x562dab[_0x69c3('0x1d')](0xcc)[_0x69c3('0x2b')]();});}};}function handleEntityNotFound(_0x1f7991,_0x17cd43){return function(_0x5cc85b){if(!_0x5cc85b){_0x1f7991[_0x69c3('0x1c')](0x194);}return _0x5cc85b;};}function handleError(_0x3136f1,_0x3e5f6b){_0x3e5f6b=_0x3e5f6b||0x1f4;return function(_0x3e5ac0){logger['error'](_0x3e5ac0[_0x69c3('0x2c')]);if(_0x3e5ac0[_0x69c3('0x2d')]){delete _0x3e5ac0[_0x69c3('0x2d')];}_0x3136f1[_0x69c3('0x1d')](_0x3e5f6b)[_0x69c3('0x2e')](_0x3e5ac0);};}exports[_0x69c3('0x2f')]=function(_0x1f3db8,_0xb78261){var _0x209e00={},_0x2f49c2={},_0x38be4a={'count':0x0,'rows':[]};var _0x573853=_[_0x69c3('0x30')](db[_0x69c3('0x31')][_0x69c3('0x32')],function(_0x321906){return{'name':_0x321906[_0x69c3('0x33')],'type':_0x321906[_0x69c3('0x34')][_0x69c3('0x35')]};});_0x2f49c2[_0x69c3('0x36')]=_[_0x69c3('0x30')](_0x573853,_0x69c3('0x2d'));_0x2f49c2[_0x69c3('0x37')]=_[_0x69c3('0x38')](_0x1f3db8[_0x69c3('0x37')]);_0x2f49c2[_0x69c3('0x39')]=_[_0x69c3('0x3a')](_0x2f49c2[_0x69c3('0x36')],_0x2f49c2[_0x69c3('0x37')]);_0x209e00['attributes']=_[_0x69c3('0x3a')](_0x2f49c2[_0x69c3('0x36')],qs[_0x69c3('0x3b')](_0x1f3db8[_0x69c3('0x37')][_0x69c3('0x3b')]));_0x209e00[_0x69c3('0x3c')]=_0x209e00[_0x69c3('0x3c')][_0x69c3('0x3d')]?_0x209e00[_0x69c3('0x3c')]:_0x2f49c2[_0x69c3('0x36')];if(!_0x1f3db8[_0x69c3('0x37')][_0x69c3('0x3e')](_0x69c3('0x3f'))){_0x209e00[_0x69c3('0x22')]=qs[_0x69c3('0x22')](_0x1f3db8['query']['limit']);_0x209e00[_0x69c3('0x1f')]=qs[_0x69c3('0x1f')](_0x1f3db8[_0x69c3('0x37')][_0x69c3('0x1f')]);}_0x209e00['order']=qs[_0x69c3('0x40')](_0x1f3db8[_0x69c3('0x37')][_0x69c3('0x40')]);_0x209e00[_0x69c3('0x41')]=qs[_0x69c3('0x39')](_[_0x69c3('0x42')](_0x1f3db8[_0x69c3('0x37')],_0x2f49c2['filters']),_0x573853);if(_0x1f3db8['query']['filter']){_0x209e00['where']=_['merge'](_0x209e00[_0x69c3('0x41')],{'$or':_[_0x69c3('0x30')](_0x573853,function(_0x270600){if(_0x270600[_0x69c3('0x34')]!==_0x69c3('0x43')){var _0x4781c0={};_0x4781c0[_0x270600[_0x69c3('0x2d')]]={'$like':'%'+_0x1f3db8[_0x69c3('0x37')]['filter']+'%'};return _0x4781c0;}})});}_0x209e00=_['merge']({},_0x209e00,_0x1f3db8['options']);var _0x1ea313={'where':_0x209e00[_0x69c3('0x41')]};return db[_0x69c3('0x31')][_0x69c3('0x21')](_0x1ea313)['then'](function(_0x1b3102){_0x38be4a['count']=_0x1b3102;if(_0x1f3db8[_0x69c3('0x37')][_0x69c3('0x44')]){_0x209e00[_0x69c3('0x45')]=[{'all':!![]}];}return db[_0x69c3('0x31')][_0x69c3('0x46')](_0x209e00);})['then'](function(_0x34d7b4){_0x38be4a[_0x69c3('0x47')]=_0x34d7b4;return _0x38be4a;})['then'](respondWithFilteredResult(_0xb78261,_0x209e00))[_0x69c3('0x48')](handleError(_0xb78261,null));};exports[_0x69c3('0x49')]=function(_0x4f2823,_0x183866){var _0x37aa35={'raw':![],'where':{'id':_0x4f2823[_0x69c3('0x4a')]['id']}},_0x5b59c6={};_0x5b59c6[_0x69c3('0x36')]=_[_0x69c3('0x38')](db['ZohoAccount'][_0x69c3('0x32')]);_0x5b59c6['query']=_[_0x69c3('0x38')](_0x4f2823[_0x69c3('0x37')]);_0x5b59c6[_0x69c3('0x39')]=_[_0x69c3('0x3a')](_0x5b59c6[_0x69c3('0x36')],_0x5b59c6['query']);_0x37aa35['attributes']=_[_0x69c3('0x3a')](_0x5b59c6['model'],qs[_0x69c3('0x3b')](_0x4f2823[_0x69c3('0x37')][_0x69c3('0x3b')]));_0x37aa35[_0x69c3('0x3c')]=_0x37aa35[_0x69c3('0x3c')]['length']?_0x37aa35[_0x69c3('0x3c')]:_0x5b59c6['model'];if(_0x4f2823[_0x69c3('0x37')][_0x69c3('0x44')]){_0x37aa35[_0x69c3('0x45')]=[{'all':!![]}];}_0x37aa35=_['merge']({},_0x37aa35,_0x4f2823['options']);return db[_0x69c3('0x31')][_0x69c3('0x4b')](_0x37aa35)[_0x69c3('0x2a')](handleEntityNotFound(_0x183866,null))[_0x69c3('0x2a')](respondWithResult(_0x183866,null))[_0x69c3('0x48')](handleError(_0x183866,null));};exports[_0x69c3('0x4c')]=function(_0x360373,_0xbe2f2e){return db[_0x69c3('0x31')]['create'](_0x360373[_0x69c3('0x4d')],{})[_0x69c3('0x2a')](respondWithResult(_0xbe2f2e,0xc9))[_0x69c3('0x48')](handleError(_0xbe2f2e,null));};exports[_0x69c3('0x28')]=function(_0x578d03,_0x4fb2d1){if(_0x578d03[_0x69c3('0x4d')]['id']){delete _0x578d03[_0x69c3('0x4d')]['id'];}return db[_0x69c3('0x31')][_0x69c3('0x4b')]({'where':{'id':_0x578d03[_0x69c3('0x4a')]['id']}})[_0x69c3('0x2a')](handleEntityNotFound(_0x4fb2d1,null))['then'](saveUpdates(_0x578d03[_0x69c3('0x4d')],null))[_0x69c3('0x2a')](respondWithResult(_0x4fb2d1,null))[_0x69c3('0x48')](handleError(_0x4fb2d1,null));};exports[_0x69c3('0x29')]=function(_0x1a73d4,_0xe662d4){return db[_0x69c3('0x31')][_0x69c3('0x4b')]({'where':{'id':_0x1a73d4[_0x69c3('0x4a')]['id']}})[_0x69c3('0x2a')](handleEntityNotFound(_0xe662d4,null))[_0x69c3('0x2a')](removeEntity(_0xe662d4,null))[_0x69c3('0x48')](handleError(_0xe662d4,null));};exports['getConfigurations']=function(_0x39bba3,_0x5bc2d0,_0x5cdb63){var _0x1b82d3={};var _0x254ef4={};var _0x209fd5;var _0x4be2ed;return db[_0x69c3('0x31')][_0x69c3('0x4e')]({'where':{'id':_0x39bba3['params']['id']}})[_0x69c3('0x2a')](handleEntityNotFound(_0x5bc2d0,null))['then'](function(_0x2b0c9a){if(_0x2b0c9a){_0x209fd5=_0x2b0c9a;_0x254ef4[_0x69c3('0x36')]=_[_0x69c3('0x38')](db['ZohoConfiguration'][_0x69c3('0x32')]);_0x254ef4[_0x69c3('0x37')]=_[_0x69c3('0x38')](_0x39bba3[_0x69c3('0x37')]);_0x254ef4[_0x69c3('0x39')]=_[_0x69c3('0x3a')](_0x254ef4['model'],_0x254ef4[_0x69c3('0x37')]);_0x1b82d3['attributes']=_[_0x69c3('0x3a')](_0x254ef4[_0x69c3('0x36')],qs[_0x69c3('0x3b')](_0x39bba3[_0x69c3('0x37')]['fields']));_0x1b82d3[_0x69c3('0x3c')]=_0x1b82d3[_0x69c3('0x3c')][_0x69c3('0x3d')]?_0x1b82d3[_0x69c3('0x3c')]:_0x254ef4['model'];_0x1b82d3[_0x69c3('0x4f')]=qs[_0x69c3('0x40')](_0x39bba3[_0x69c3('0x37')][_0x69c3('0x40')]);_0x1b82d3[_0x69c3('0x41')]=qs[_0x69c3('0x39')](_['pick'](_0x39bba3[_0x69c3('0x37')],_0x254ef4['filters']));if(_0x39bba3[_0x69c3('0x37')][_0x69c3('0x50')]){_0x1b82d3[_0x69c3('0x41')]=_['merge'](_0x1b82d3[_0x69c3('0x41')],{'$or':_[_0x69c3('0x30')](_0x1b82d3[_0x69c3('0x3c')],function(_0x3cc004){var _0x4c8d81={};_0x4c8d81[_0x3cc004]={'$like':'%'+_0x39bba3['query'][_0x69c3('0x50')]+'%'};return _0x4c8d81;})});}_0x1b82d3=_[_0x69c3('0x51')]({},_0x1b82d3,_0x39bba3[_0x69c3('0x52')]);return _0x209fd5[_0x69c3('0x53')](_0x1b82d3);}})[_0x69c3('0x2a')](function(_0x34ea72){if(_0x34ea72){_0x4be2ed=_0x34ea72[_0x69c3('0x3d')];if(!_0x39bba3[_0x69c3('0x37')]['hasOwnProperty'](_0x69c3('0x3f'))){_0x1b82d3['limit']=qs[_0x69c3('0x22')](_0x39bba3[_0x69c3('0x37')][_0x69c3('0x22')]);_0x1b82d3[_0x69c3('0x1f')]=qs[_0x69c3('0x1f')](_0x39bba3[_0x69c3('0x37')][_0x69c3('0x1f')]);}return _0x209fd5['getConfigurations'](_0x1b82d3);}})['then'](function(_0x292cca){if(_0x292cca){return _0x292cca?{'count':_0x4be2ed,'rows':_0x292cca}:null;}})['then'](respondWithResult(_0x5bc2d0,null))['catch'](handleError(_0x5bc2d0,null));};exports[_0x69c3('0x54')]=function(_0x5839bf,_0x5f3766,_0x7c838c){if(_0x5839bf[_0x69c3('0x4d')]['id']){delete _0x5839bf['body']['id'];}return db[_0x69c3('0x31')][_0x69c3('0x4e')]({'where':{'id':_0x5839bf[_0x69c3('0x4a')]['id']}})[_0x69c3('0x2a')](handleEntityNotFound(_0x5f3766,null))[_0x69c3('0x2a')](function(_0x2fc1eb){if(_0x2fc1eb){_0x5839bf[_0x69c3('0x4d')][_0x69c3('0x55')]=_0x2fc1eb['id'];_0x5839bf[_0x69c3('0x4d')][_0x69c3('0x56')]=integrations[_0x69c3('0x57')](_0x5839bf['body'][_0x69c3('0x58')],_0x5839bf[_0x69c3('0x4d')][_0x69c3('0x34')]);_0x5839bf['body'][_0x69c3('0x59')]=integrations[_0x69c3('0x5a')](_0x5839bf[_0x69c3('0x4d')][_0x69c3('0x58')],_0x5839bf[_0x69c3('0x4d')][_0x69c3('0x34')]);return db[_0x69c3('0x5b')][_0x69c3('0x4c')](_0x5839bf[_0x69c3('0x4d')],{'include':[{'model':db[_0x69c3('0x5c')],'as':_0x69c3('0x56')},{'model':db[_0x69c3('0x5c')],'as':_0x69c3('0x59')}]});}return null;})[_0x69c3('0x2a')](respondWithResult(_0x5f3766,null))[_0x69c3('0x48')](handleError(_0x5f3766,null));};function getAccessToken(_0x333353){return new Promise(function(_0x1643b7,_0x32cff0){var _0x54be04;switch(_0x333353[_0x69c3('0x5d')]){case'US':_0x54be04=_0x69c3('0x5e');break;case'AU':_0x54be04=_0x69c3('0x5f');break;case'EU':_0x54be04=_0x69c3('0x60');break;case'IN':_0x54be04=_0x69c3('0x61');break;case'CN':_0x54be04='https://accounts.zoho.com.cn';break;default:_0x54be04=_0x69c3('0x60');break;}var _0x397afa={'method':_0x69c3('0x62'),'uri':_0x54be04+'/oauth/v2/token','qs':{'refresh_token':_0x333353['refreshToken'],'client_id':_0x333353['clientId'],'client_secret':_0x333353[_0x69c3('0x63')],'grant_type':_0x69c3('0x64')},'json':!![]};return rp(_0x397afa)['then'](function(_0x15b136){if(_0x15b136[_0x69c3('0x65')]){_0x1643b7(_0x15b136['access_token']);}else{_0x32cff0(_0x69c3('0x66'));}})['catch'](function(_0x34fad8){_0x32cff0(_0x34fad8);});});}exports[_0x69c3('0x67')]=function(_0x47d467,_0xa1059d,_0x33c041){var _0x3dbdd7,_0x1e67de,_0x26b69e,_0x1d950f,_0x240c87;return db[_0x69c3('0x31')]['findOne']({'where':{'id':_0x47d467['params']['id']},'attributes':['id',_0x69c3('0x68'),_0x69c3('0x5d'),_0x69c3('0x69'),'clientSecret','serverUrl',_0x69c3('0x6a'),_0x69c3('0x6b')]})[_0x69c3('0x2a')](handleEntityNotFound(_0xa1059d,null))[_0x69c3('0x2a')](function(_0x49ad23){_0x240c87=_0x49ad23;_0x3dbdd7=_0x240c87[_0x69c3('0x68')];_0x1e67de=_0x3dbdd7===_0x69c3('0x6c')?'eu':'com';_0x26b69e=_0x240c87[_0x69c3('0x6d')];var _0x17cfb9=_0x26b69e['slice'](-0x1);if(_0x17cfb9==='/'||_0x17cfb9==='\x5c'||_0x17cfb9===':'){_0x26b69e=_0x26b69e[_0x69c3('0x6e')](0x0,_0x26b69e[_0x69c3('0x6f')](_0x17cfb9));}if(!_0x240c87['refreshToken']){throw new Error(_0x69c3('0x70'));}return getAccessToken(_0x240c87);})[_0x69c3('0x2a')](function(_0x551051){if(_0x551051){return rp({'method':_0x69c3('0x71'),'uri':util[_0x69c3('0x72')](_0x69c3('0x73'),_0x1e67de),'qs':{'module':_0x69c3('0x74')},'headers':{'Authorization':_0x69c3('0x75')+_0x551051},'json':!![]});}})[_0x69c3('0x2a')](function(_0x56102e){if(_0x56102e){if(_0x56102e[_0x69c3('0x76')]&&_0x56102e[_0x69c3('0x76')][_0x69c3('0x77')]){throw new Error(_0x56102e[_0x69c3('0x76')][_0x69c3('0x77')][_0x69c3('0x78')]);}var _0x3b4244=[];var _0xbd8737=[];var _0x42ac3e=[_0x69c3('0x79'),_0x69c3('0x7a'),_0x69c3('0x7b'),_0x69c3('0x7c'),_0x69c3('0x7d'),'Call_Result',_0x69c3('0x7e'),'Call_Type'];_0xbd8737=_['remove'](_0x56102e['fields'],function(_0x5e82fa){return _0x42ac3e[_0x69c3('0x7f')](_0x5e82fa[_0x69c3('0x80')]);});for(var _0x2882b0=0x0;_0x2882b0<_0xbd8737['length'];_0x2882b0++){if(_0xbd8737[_0x2882b0][_0x69c3('0x81')]===![]){_0x3b4244[_0x69c3('0x82')]({'id':_0xbd8737[_0x2882b0]['id'],'name':_0xbd8737[_0x2882b0][_0x69c3('0x83')],'custom':_0xbd8737[_0x2882b0][_0x69c3('0x84')],'options':_0xbd8737[_0x2882b0]['data_type']==='picklist'&&_0xbd8737[_0x2882b0][_0x69c3('0x85')][_0x69c3('0x3d')]>-0x1?_[_0x69c3('0x30')](_0xbd8737[_0x2882b0][_0x69c3('0x85')],function(_0x5b0ba5){return{'name':_0x5b0ba5,'value':_0x5b0ba5};}):[]});}}return{'count':_0x3b4244[_0x69c3('0x3d')],'rows':_0x3b4244};}else{return{'count':0x0,'rows':[]};}})[_0x69c3('0x2a')](respondWithResult(_0xa1059d,null))[_0x69c3('0x48')](function(_0x4d6cba){var _0x4087ce=_0x47d467[_0x69c3('0x37')]['test']?0x1f4:_0x4d6cba['statusCode']||0x1f4;logger[_0x69c3('0x77')](_0x69c3('0x86'),_0x69c3('0x67'),_0x4087ce,JSON['stringify'](_0x4d6cba));delete _0x4d6cba['name'];if(_0x4087ce===0x191){_0x4087ce=0x190;}_0xa1059d[_0x69c3('0x1d')](_0x4087ce)['send'](_0x47d467[_0x69c3('0x37')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x4d6cba[_0x69c3('0x87')]}:_0x4d6cba);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 4a65934..c07025b 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 _0x0ead=['refreshToken','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','name','catch','error','inspect','lastIndexOf','application/x-www-form-urlencoded','lodash','util','api','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','ZohoAccount','int_zoho_accounts','changed','serverUrl','clientId','code','host','slice','substring','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','authorization_code','clientSecret','then','parse','refresh_token'];(function(_0x1dd8a7,_0x139163){var _0x56355c=function(_0x1ca5ae){while(--_0x1ca5ae){_0x1dd8a7['push'](_0x1dd8a7['shift']());}};_0x56355c(++_0x139163);}(_0x0ead,0xaa));var _0xd0ea=function(_0x783bdb,_0x5c3572){_0x783bdb=_0x783bdb-0x0;var _0x34dc6f=_0x0ead[_0x783bdb];return _0x34dc6f;};'use strict';var _=require(_0xd0ea('0x0'));var util=require(_0xd0ea('0x1'));var logger=require('../../config/logger')(_0xd0ea('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd0ea('0x3'));var fs=require('fs');var path=require(_0xd0ea('0x4'));var rimraf=require(_0xd0ea('0x5'));var config=require(_0xd0ea('0x6'));var attributes=require(_0xd0ea('0x7'));var integrations=require(_0xd0ea('0x8'));module['exports']=function(_0x2ec539,_0x505340){return _0x2ec539['define'](_0xd0ea('0x9'),attributes,{'tableName':_0xd0ea('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x58181a,_0x31e10e,_0x16b36e){if(_0x58181a[_0xd0ea('0xb')]('zone')||_0x58181a[_0xd0ea('0xb')](_0xd0ea('0xc'))||_0x58181a[_0xd0ea('0xb')](_0xd0ea('0xd'))||_0x58181a[_0xd0ea('0xb')]('clientSecret')||_0x58181a[_0xd0ea('0xb')](_0xd0ea('0xe'))||_0x58181a[_0xd0ea('0xb')](_0xd0ea('0xf'))){var _0x490c09,_0x3269ff;_0x490c09=_0x58181a[_0xd0ea('0xc')];var _0x3d5f35=_0x490c09[_0xd0ea('0x10')](-0x1);if(_0x3d5f35==='/'||_0x3d5f35==='\x5c'||_0x3d5f35===':'){_0x490c09=_0x490c09[_0xd0ea('0x11')](0x0,_0x490c09['lastIndexOf'](_0x3d5f35));}switch(_0x58181a[_0xd0ea('0x12')]){case'US':_0x3269ff=_0xd0ea('0x13');break;case'AU':_0x3269ff=_0xd0ea('0x14');break;case'IN':_0x3269ff=_0xd0ea('0x15');break;case'CN':_0x3269ff=_0xd0ea('0x16');break;default:_0x3269ff='https://accounts.zoho.eu';break;}var _0x3f000d={'method':_0xd0ea('0x17'),'uri':_0x3269ff+_0xd0ea('0x18'),'form':{'grant_type':_0xd0ea('0x19'),'client_id':_0x58181a[_0xd0ea('0xd')],'client_secret':_0x58181a[_0xd0ea('0x1a')],'redirect_uri':_0x58181a['serverUrl'],'code':_0x58181a[_0xd0ea('0xe')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x3f000d)[_0xd0ea('0x1b')](function(_0x5a35ae){var _0x3686d4=JSON[_0xd0ea('0x1c')](_0x5a35ae);if(_0x3686d4[_0xd0ea('0x1d')]){_0x58181a[_0xd0ea('0x1e')]=_0x3686d4[_0xd0ea('0x1d')];logger['info'](util['format'](_0xd0ea('0x1f'),_0x58181a['name'],_0x58181a['id']));}else{logger['error'](util[_0xd0ea('0x20')](_0xd0ea('0x21'),_0x58181a[_0xd0ea('0x22')],_0x58181a['id']),util['inspect'](_0x3686d4,{'showHidden':![],'depth':null}));}return _0x16b36e(null,_0x31e10e);})[_0xd0ea('0x23')](function(_0x4cb672){logger[_0xd0ea('0x24')](util[_0xd0ea('0x20')](_0xd0ea('0x21'),_0x58181a[_0xd0ea('0x22')],_0x58181a['id']),util[_0xd0ea('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x16b36e(_0x4cb672);});}else{return _0x16b36e(null,_0x31e10e);}},'beforeUpdate':function(_0xad0070,_0x343c26,_0x4b01df){if(_0xad0070['changed']('zone')||_0xad0070[_0xd0ea('0xb')]('serverUrl')||_0xad0070[_0xd0ea('0xb')](_0xd0ea('0xd'))||_0xad0070[_0xd0ea('0xb')]('clientSecret')||_0xad0070['changed'](_0xd0ea('0xe'))||_0xad0070['changed'](_0xd0ea('0xf'))){var _0x50c638,_0x46703f;_0x50c638=_0xad0070[_0xd0ea('0xc')];var _0x1182b4=_0x50c638[_0xd0ea('0x10')](-0x1);if(_0x1182b4==='/'||_0x1182b4==='\x5c'||_0x1182b4===':'){_0x50c638=_0x50c638[_0xd0ea('0x11')](0x0,_0x50c638[_0xd0ea('0x26')](_0x1182b4));}switch(_0xad0070[_0xd0ea('0x12')]){case'US':_0x46703f=_0xd0ea('0x13');break;case'AU':_0x46703f=_0xd0ea('0x14');break;case'IN':_0x46703f=_0xd0ea('0x15');break;case'CN':_0x46703f=_0xd0ea('0x16');break;default:_0x46703f='https://accounts.zoho.eu';break;}var _0x4ba134={'method':_0xd0ea('0x17'),'uri':_0x46703f+_0xd0ea('0x18'),'form':{'grant_type':_0xd0ea('0x19'),'client_id':_0xad0070[_0xd0ea('0xd')],'client_secret':_0xad0070[_0xd0ea('0x1a')],'redirect_uri':_0xad0070['serverUrl'],'code':_0xad0070[_0xd0ea('0xe')]},'headers':{'Content-Type':_0xd0ea('0x27')}};return rp(_0x4ba134)[_0xd0ea('0x1b')](function(_0x33eadb){var _0x347694=JSON[_0xd0ea('0x1c')](_0x33eadb);if(_0x347694[_0xd0ea('0x1d')]){_0xad0070[_0xd0ea('0x1e')]=_0x347694['refresh_token'];logger['info'](util[_0xd0ea('0x20')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0xad0070[_0xd0ea('0x22')],_0xad0070['id']));}else{logger[_0xd0ea('0x24')](util['format'](_0xd0ea('0x21'),_0xad0070[_0xd0ea('0x22')],_0xad0070['id']),util[_0xd0ea('0x25')](_0x347694,{'showHidden':![],'depth':null}));}return _0x4b01df(null,_0x343c26);})['catch'](function(_0x4ed681){logger['error'](util[_0xd0ea('0x20')](_0xd0ea('0x21'),_0xad0070[_0xd0ea('0x22')],_0xad0070['id']),util[_0xd0ea('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x4b01df(_0x4ed681);});}else{return _0x4b01df(null,_0x343c26);}}}});}; \ No newline at end of file +var _0x48c6=['format','name','inspect','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','substring','https://accounts.zoho.com.au','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','changed','zone','serverUrl','clientId','clientSecret','code','host','slice','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error'];(function(_0x95c1d8,_0x35762d){var _0x12f0e8=function(_0x2cb198){while(--_0x2cb198){_0x95c1d8['push'](_0x95c1d8['shift']());}};_0x12f0e8(++_0x35762d);}(_0x48c6,0x1d5));var _0x648c=function(_0xe139be,_0x49ef39){_0xe139be=_0xe139be-0x0;var _0x2053da=_0x48c6[_0xe139be];return _0x2053da;};'use strict';var _=require(_0x648c('0x0'));var util=require('util');var logger=require(_0x648c('0x1'))('api');var moment=require(_0x648c('0x2'));var BPromise=require('bluebird');var rp=require(_0x648c('0x3'));var fs=require('fs');var path=require(_0x648c('0x4'));var rimraf=require(_0x648c('0x5'));var config=require(_0x648c('0x6'));var attributes=require(_0x648c('0x7'));var integrations=require(_0x648c('0x8'));module[_0x648c('0x9')]=function(_0x4816aa,_0x327666){return _0x4816aa[_0x648c('0xa')]('ZohoAccount',attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x350ab1,_0x3de337,_0x4a2ffc){if(_0x350ab1[_0x648c('0xb')](_0x648c('0xc'))||_0x350ab1[_0x648c('0xb')](_0x648c('0xd'))||_0x350ab1[_0x648c('0xb')](_0x648c('0xe'))||_0x350ab1[_0x648c('0xb')](_0x648c('0xf'))||_0x350ab1['changed'](_0x648c('0x10'))||_0x350ab1[_0x648c('0xb')](_0x648c('0x11'))){var _0x1b7f4c,_0x52147e;_0x1b7f4c=_0x350ab1[_0x648c('0xd')];var _0x18d105=_0x1b7f4c[_0x648c('0x12')](-0x1);if(_0x18d105==='/'||_0x18d105==='\x5c'||_0x18d105===':'){_0x1b7f4c=_0x1b7f4c['substring'](0x0,_0x1b7f4c[_0x648c('0x13')](_0x18d105));}switch(_0x350ab1[_0x648c('0xc')]){case'US':_0x52147e=_0x648c('0x14');break;case'AU':_0x52147e='https://accounts.zoho.com.au';break;case'IN':_0x52147e=_0x648c('0x15');break;case'CN':_0x52147e=_0x648c('0x16');break;default:_0x52147e=_0x648c('0x17');break;}var _0x374ed4={'method':_0x648c('0x18'),'uri':_0x52147e+_0x648c('0x19'),'form':{'grant_type':_0x648c('0x1a'),'client_id':_0x350ab1[_0x648c('0xe')],'client_secret':_0x350ab1[_0x648c('0xf')],'redirect_uri':_0x350ab1[_0x648c('0xd')],'code':_0x350ab1[_0x648c('0x10')]},'headers':{'Content-Type':_0x648c('0x1b')}};return rp(_0x374ed4)[_0x648c('0x1c')](function(_0x4437f0){var _0x181930=JSON[_0x648c('0x1d')](_0x4437f0);if(_0x181930[_0x648c('0x1e')]){_0x350ab1[_0x648c('0x1f')]=_0x181930['refresh_token'];logger[_0x648c('0x20')](util['format'](_0x648c('0x21'),_0x350ab1['name'],_0x350ab1['id']));}else{logger[_0x648c('0x22')](util[_0x648c('0x23')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x350ab1[_0x648c('0x24')],_0x350ab1['id']),util[_0x648c('0x25')](_0x181930,{'showHidden':![],'depth':null}));}return _0x4a2ffc(null,_0x3de337);})[_0x648c('0x26')](function(_0x4da4a0){logger['error'](util[_0x648c('0x23')](_0x648c('0x27'),_0x350ab1[_0x648c('0x24')],_0x350ab1['id']),util[_0x648c('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x4a2ffc(_0x4da4a0);});}else{return _0x4a2ffc(null,_0x3de337);}},'beforeUpdate':function(_0x49218a,_0x545455,_0x58c7ac){if(_0x49218a[_0x648c('0xb')]('zone')||_0x49218a['changed']('serverUrl')||_0x49218a[_0x648c('0xb')](_0x648c('0xe'))||_0x49218a[_0x648c('0xb')](_0x648c('0xf'))||_0x49218a[_0x648c('0xb')](_0x648c('0x10'))||_0x49218a['changed']('host')){var _0x463a39,_0x2b9c02;_0x463a39=_0x49218a[_0x648c('0xd')];var _0x534d67=_0x463a39[_0x648c('0x12')](-0x1);if(_0x534d67==='/'||_0x534d67==='\x5c'||_0x534d67===':'){_0x463a39=_0x463a39[_0x648c('0x28')](0x0,_0x463a39['lastIndexOf'](_0x534d67));}switch(_0x49218a[_0x648c('0xc')]){case'US':_0x2b9c02=_0x648c('0x14');break;case'AU':_0x2b9c02=_0x648c('0x29');break;case'IN':_0x2b9c02=_0x648c('0x15');break;case'CN':_0x2b9c02=_0x648c('0x16');break;default:_0x2b9c02='https://accounts.zoho.eu';break;}var _0x358112={'method':_0x648c('0x18'),'uri':_0x2b9c02+_0x648c('0x19'),'form':{'grant_type':'authorization_code','client_id':_0x49218a[_0x648c('0xe')],'client_secret':_0x49218a[_0x648c('0xf')],'redirect_uri':_0x49218a[_0x648c('0xd')],'code':_0x49218a[_0x648c('0x10')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x358112)[_0x648c('0x1c')](function(_0x3a81be){var _0x18c19b=JSON['parse'](_0x3a81be);if(_0x18c19b[_0x648c('0x1e')]){_0x49218a['refreshToken']=_0x18c19b[_0x648c('0x1e')];logger[_0x648c('0x20')](util['format'](_0x648c('0x21'),_0x49218a[_0x648c('0x24')],_0x49218a['id']));}else{logger[_0x648c('0x22')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x49218a[_0x648c('0x24')],_0x49218a['id']),util['inspect'](_0x18c19b,{'showHidden':![],'depth':null}));}return _0x58c7ac(null,_0x545455);})[_0x648c('0x26')](function(_0x3af291){logger['error'](util[_0x648c('0x23')](_0x648c('0x27'),_0x49218a[_0x648c('0x24')],_0x49218a['id']),util[_0x648c('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x58c7ac(_0x3af291);});}else{return _0x58c7ac(null,_0x545455);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 791cbd2..8da8150 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 _0xa329=['then','ShowZohoAccount','ZohoAccount','find','lodash','util','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetZohoAccount','findAll','options','raw','where','limit','include','model','map','attributes'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xa329,0x162));var _0x9a32=function(_0x5c32f7,_0x3fdd4d){_0x5c32f7=_0x5c32f7-0x0;var _0x230523=_0xa329[_0x5c32f7];return _0x230523;};'use strict';var _=require(_0x9a32('0x0'));var util=require(_0x9a32('0x1'));var moment=require('moment');var BPromise=require(_0x9a32('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9a32('0x3'));var db=require(_0x9a32('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9a32('0x5'));var config=require(_0x9a32('0x6'));var jayson=require(_0x9a32('0x7'));var client=jayson[_0x9a32('0x8')][_0x9a32('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x235b92,_0x4a8fba,_0x5b8b5e){return new BPromise(function(_0x4dc7f8,_0x344b35){return client[_0x9a32('0xa')](_0x235b92,_0x5b8b5e)['then'](function(_0x38f6cc){logger[_0x9a32('0xb')](_0x9a32('0xc'),_0x4a8fba,_0x9a32('0xd'));logger[_0x9a32('0xe')](_0x9a32('0xf'),_0x4a8fba,'request\x20sent',JSON[_0x9a32('0x10')](_0x38f6cc));if(_0x38f6cc[_0x9a32('0x11')]){if(_0x38f6cc['error']['code']===0x1f4){logger[_0x9a32('0x11')](_0x9a32('0xc'),_0x4a8fba,_0x38f6cc['error']['message']);return _0x344b35(_0x38f6cc[_0x9a32('0x11')][_0x9a32('0x12')]);}logger[_0x9a32('0x11')](_0x9a32('0xc'),_0x4a8fba,_0x38f6cc['error'][_0x9a32('0x12')]);return _0x4dc7f8(_0x38f6cc[_0x9a32('0x11')]['message']);}else{logger[_0x9a32('0xb')](_0x9a32('0xc'),_0x4a8fba,_0x9a32('0xd'));_0x4dc7f8(_0x38f6cc[_0x9a32('0x13')][_0x9a32('0x12')]);}})[_0x9a32('0x14')](function(_0x4fa645){logger[_0x9a32('0x11')](_0x9a32('0xc'),_0x4a8fba,_0x4fa645);_0x344b35(_0x4fa645);});});}exports[_0x9a32('0x15')]=function(_0x4cfd70){var _0x3606ab=this;return new Promise(function(_0x1448da,_0x49f517){return db['ZohoAccount'][_0x9a32('0x16')]({'raw':_0x4cfd70[_0x9a32('0x17')]?_0x4cfd70[_0x9a32('0x17')][_0x9a32('0x18')]===undefined?!![]:![]:!![],'where':_0x4cfd70[_0x9a32('0x17')]?_0x4cfd70['options'][_0x9a32('0x19')]||null:null,'attributes':_0x4cfd70[_0x9a32('0x17')]?_0x4cfd70[_0x9a32('0x17')]['attributes']||null:null,'limit':_0x4cfd70[_0x9a32('0x17')]?_0x4cfd70[_0x9a32('0x17')][_0x9a32('0x1a')]||null:null,'include':_0x4cfd70[_0x9a32('0x17')]?_0x4cfd70[_0x9a32('0x17')][_0x9a32('0x1b')]?_['map'](_0x4cfd70['options'][_0x9a32('0x1b')],function(_0x2cb1ff){return{'model':db[_0x2cb1ff[_0x9a32('0x1c')]],'as':_0x2cb1ff['as'],'attributes':_0x2cb1ff['attributes'],'include':_0x2cb1ff['include']?_[_0x9a32('0x1d')](_0x2cb1ff[_0x9a32('0x1b')],function(_0x301dac){return{'model':db[_0x301dac['model']],'as':_0x301dac['as'],'attributes':_0x301dac['attributes'],'include':_0x301dac['include']?_[_0x9a32('0x1d')](_0x301dac['include'],function(_0x527159){return{'model':db[_0x527159['model']],'as':_0x527159['as'],'attributes':_0x527159[_0x9a32('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9a32('0x1f')](function(_0x10edcf){logger[_0x9a32('0xb')](_0x9a32('0x15'),_0x4cfd70);logger[_0x9a32('0xe')](_0x9a32('0x15'),_0x4cfd70,JSON[_0x9a32('0x10')](_0x10edcf));_0x1448da(_0x10edcf);})[_0x9a32('0x14')](function(_0x35c1be){logger[_0x9a32('0x11')]('GetZohoAccount',_0x35c1be[_0x9a32('0x12')],_0x4cfd70);_0x49f517(_0x3606ab[_0x9a32('0x11')](0x1f4,_0x35c1be['message']));});});};exports[_0x9a32('0x20')]=function(_0x48674a){var _0x18a7b3=this;return new Promise(function(_0x227dbc,_0x416ba3){return db[_0x9a32('0x21')][_0x9a32('0x22')]({'raw':_0x48674a['options']?_0x48674a[_0x9a32('0x17')][_0x9a32('0x18')]===undefined?!![]:![]:!![],'where':_0x48674a[_0x9a32('0x17')]?_0x48674a[_0x9a32('0x17')][_0x9a32('0x19')]||null:null,'attributes':_0x48674a[_0x9a32('0x17')]?_0x48674a['options'][_0x9a32('0x1e')]||null:null,'include':_0x48674a[_0x9a32('0x17')]?_0x48674a[_0x9a32('0x17')][_0x9a32('0x1b')]?_[_0x9a32('0x1d')](_0x48674a['options'][_0x9a32('0x1b')],function(_0x4d113c){return{'model':db[_0x4d113c[_0x9a32('0x1c')]],'as':_0x4d113c['as'],'attributes':_0x4d113c['attributes'],'include':_0x4d113c['include']?_['map'](_0x4d113c['include'],function(_0x37f0f6){return{'model':db[_0x37f0f6[_0x9a32('0x1c')]],'as':_0x37f0f6['as'],'attributes':_0x37f0f6['attributes'],'include':_0x37f0f6[_0x9a32('0x1b')]?_[_0x9a32('0x1d')](_0x37f0f6[_0x9a32('0x1b')],function(_0x20cad1){return{'model':db[_0x20cad1[_0x9a32('0x1c')]],'as':_0x20cad1['as'],'attributes':_0x20cad1['attributes']};}):[]};}):[]};}):[]:[]})[_0x9a32('0x1f')](function(_0x319985){logger[_0x9a32('0xb')](_0x9a32('0x20'),_0x48674a);logger[_0x9a32('0xe')](_0x9a32('0x20'),_0x48674a,JSON[_0x9a32('0x10')](_0x319985));_0x227dbc(_0x319985);})[_0x9a32('0x14')](function(_0x15d70f){logger['error'](_0x9a32('0x20'),_0x15d70f['message'],_0x48674a);_0x416ba3(_0x18a7b3[_0x9a32('0x11')](0x1f4,_0x15d70f[_0x9a32('0x12')]));});});}; \ No newline at end of file +var _0x5942=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','where','attributes','limit','include','model','map','then','ShowZohoAccount','lodash'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x5942,0x16a));var _0x2594=function(_0x1fbf59,_0x2ed06a){_0x1fbf59=_0x1fbf59-0x0;var _0x5143d2=_0x5942[_0x1fbf59];return _0x5143d2;};'use strict';var _=require(_0x2594('0x0'));var util=require(_0x2594('0x1'));var moment=require(_0x2594('0x2'));var BPromise=require(_0x2594('0x3'));var rs=require(_0x2594('0x4'));var fs=require('fs');var Redis=require(_0x2594('0x5'));var db=require(_0x2594('0x6'))['db'];var utils=require(_0x2594('0x7'));var logger=require(_0x2594('0x8'))(_0x2594('0x9'));var config=require(_0x2594('0xa'));var jayson=require(_0x2594('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x381472,_0xd0ada5,_0x3d20aa){return new BPromise(function(_0x5707a0,_0x2b42d3){return client[_0x2594('0xc')](_0x381472,_0x3d20aa)['then'](function(_0x29517f){logger['info'](_0x2594('0xd'),_0xd0ada5,_0x2594('0xe'));logger[_0x2594('0xf')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0xd0ada5,_0x2594('0xe'),JSON[_0x2594('0x10')](_0x29517f));if(_0x29517f[_0x2594('0x11')]){if(_0x29517f[_0x2594('0x11')]['code']===0x1f4){logger[_0x2594('0x11')](_0x2594('0xd'),_0xd0ada5,_0x29517f[_0x2594('0x11')][_0x2594('0x12')]);return _0x2b42d3(_0x29517f[_0x2594('0x11')][_0x2594('0x12')]);}logger[_0x2594('0x11')](_0x2594('0xd'),_0xd0ada5,_0x29517f[_0x2594('0x11')]['message']);return _0x5707a0(_0x29517f[_0x2594('0x11')][_0x2594('0x12')]);}else{logger['info'](_0x2594('0xd'),_0xd0ada5,'request\x20sent');_0x5707a0(_0x29517f[_0x2594('0x13')][_0x2594('0x12')]);}})[_0x2594('0x14')](function(_0x33b4bc){logger[_0x2594('0x11')]('ZohoAccount,\x20%s,\x20%s',_0xd0ada5,_0x33b4bc);_0x2b42d3(_0x33b4bc);});});}exports[_0x2594('0x15')]=function(_0x457beb){var _0x223099=this;return new Promise(function(_0x31f24a,_0x373533){return db[_0x2594('0x16')][_0x2594('0x17')]({'raw':_0x457beb[_0x2594('0x18')]?_0x457beb[_0x2594('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x457beb['options']?_0x457beb[_0x2594('0x18')][_0x2594('0x19')]||null:null,'attributes':_0x457beb[_0x2594('0x18')]?_0x457beb[_0x2594('0x18')][_0x2594('0x1a')]||null:null,'limit':_0x457beb[_0x2594('0x18')]?_0x457beb['options'][_0x2594('0x1b')]||null:null,'include':_0x457beb[_0x2594('0x18')]?_0x457beb[_0x2594('0x18')][_0x2594('0x1c')]?_['map'](_0x457beb[_0x2594('0x18')]['include'],function(_0x281987){return{'model':db[_0x281987['model']],'as':_0x281987['as'],'attributes':_0x281987[_0x2594('0x1a')],'include':_0x281987[_0x2594('0x1c')]?_['map'](_0x281987[_0x2594('0x1c')],function(_0x48a306){return{'model':db[_0x48a306[_0x2594('0x1d')]],'as':_0x48a306['as'],'attributes':_0x48a306[_0x2594('0x1a')],'include':_0x48a306[_0x2594('0x1c')]?_[_0x2594('0x1e')](_0x48a306[_0x2594('0x1c')],function(_0xf60655){return{'model':db[_0xf60655[_0x2594('0x1d')]],'as':_0xf60655['as'],'attributes':_0xf60655[_0x2594('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a1058){logger['info']('GetZohoAccount',_0x457beb);logger[_0x2594('0xf')](_0x2594('0x15'),_0x457beb,JSON['stringify'](_0x3a1058));_0x31f24a(_0x3a1058);})[_0x2594('0x14')](function(_0xa8ee54){logger['error'](_0x2594('0x15'),_0xa8ee54[_0x2594('0x12')],_0x457beb);_0x373533(_0x223099[_0x2594('0x11')](0x1f4,_0xa8ee54[_0x2594('0x12')]));});});};exports['ShowZohoAccount']=function(_0x43ac77){var _0x139602=this;return new Promise(function(_0x2737ea,_0x11133a){return db[_0x2594('0x16')]['find']({'raw':_0x43ac77[_0x2594('0x18')]?_0x43ac77[_0x2594('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x43ac77['options']?_0x43ac77[_0x2594('0x18')][_0x2594('0x19')]||null:null,'attributes':_0x43ac77[_0x2594('0x18')]?_0x43ac77[_0x2594('0x18')]['attributes']||null:null,'include':_0x43ac77[_0x2594('0x18')]?_0x43ac77[_0x2594('0x18')]['include']?_['map'](_0x43ac77['options']['include'],function(_0x597915){return{'model':db[_0x597915[_0x2594('0x1d')]],'as':_0x597915['as'],'attributes':_0x597915[_0x2594('0x1a')],'include':_0x597915[_0x2594('0x1c')]?_[_0x2594('0x1e')](_0x597915[_0x2594('0x1c')],function(_0x20e253){return{'model':db[_0x20e253[_0x2594('0x1d')]],'as':_0x20e253['as'],'attributes':_0x20e253[_0x2594('0x1a')],'include':_0x20e253[_0x2594('0x1c')]?_[_0x2594('0x1e')](_0x20e253[_0x2594('0x1c')],function(_0x4271fd){return{'model':db[_0x4271fd[_0x2594('0x1d')]],'as':_0x4271fd['as'],'attributes':_0x4271fd[_0x2594('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x2594('0x1f')](function(_0x5b9052){logger['info'](_0x2594('0x20'),_0x43ac77);logger[_0x2594('0xf')](_0x2594('0x20'),_0x43ac77,JSON[_0x2594('0x10')](_0x5b9052));_0x2737ea(_0x5b9052);})[_0x2594('0x14')](function(_0x2e975b){logger[_0x2594('0x11')](_0x2594('0x20'),_0x2e975b[_0x2594('0x12')],_0x43ac77);_0x11133a(_0x139602['error'](0x1f4,_0x2e975b['message']));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 0aff033..9e20e17 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 _0x0032=['fs-extra','../../components/interaction/service','get','index','/:id','show','/:id/fields','isAuthenticated','getFields','/:id/subjects','/:id/descriptions','post','create','put','update','delete','exports','util','path','express'];(function(_0x258d2a,_0x3a48f6){var _0x5d6ebe=function(_0x5eb9b3){while(--_0x5eb9b3){_0x258d2a['push'](_0x258d2a['shift']());}};_0x5d6ebe(++_0x3a48f6);}(_0x0032,0xed));var _0x2003=function(_0x4ba351,_0x377d32){_0x4ba351=_0x4ba351-0x0;var _0x3074a4=_0x0032[_0x4ba351];return _0x3074a4;};'use strict';var multer=require('multer');var util=require(_0x2003('0x0'));var path=require(_0x2003('0x1'));var timeout=require('connect-timeout');var express=require(_0x2003('0x2'));var router=express['Router']();var fs_extra=require(_0x2003('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x2003('0x4'));var config=require('../../config/environment');var controller=require('./intZohoConfiguration.controller');router[_0x2003('0x5')]('/',auth['isAuthenticated'](),controller[_0x2003('0x6')]);router[_0x2003('0x5')](_0x2003('0x7'),auth['isAuthenticated'](),controller[_0x2003('0x8')]);router[_0x2003('0x5')](_0x2003('0x9'),auth[_0x2003('0xa')](),controller[_0x2003('0xb')]);router[_0x2003('0x5')](_0x2003('0xc'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x2003('0x5')](_0x2003('0xd'),auth[_0x2003('0xa')](),controller['getDescriptions']);router[_0x2003('0xe')]('/',auth['isAuthenticated'](),controller[_0x2003('0xf')]);router[_0x2003('0x10')](_0x2003('0x7'),auth[_0x2003('0xa')](),controller[_0x2003('0x11')]);router[_0x2003('0x12')]('/:id',auth[_0x2003('0xa')](),controller['destroy']);module[_0x2003('0x13')]=router; \ No newline at end of file +var _0x52b6=['../../config/environment','./intZohoConfiguration.controller','get','index','/:id','isAuthenticated','show','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x1373da,_0x286fce){var _0x467edc=function(_0x22a2ef){while(--_0x22a2ef){_0x1373da['push'](_0x1373da['shift']());}};_0x467edc(++_0x286fce);}(_0x52b6,0xc0));var _0x652b=function(_0x58a323,_0x5e1861){_0x58a323=_0x58a323-0x0;var _0x101356=_0x52b6[_0x58a323];return _0x101356;};'use strict';var multer=require(_0x652b('0x0'));var util=require(_0x652b('0x1'));var path=require(_0x652b('0x2'));var timeout=require('connect-timeout');var express=require(_0x652b('0x3'));var router=express[_0x652b('0x4')]();var fs_extra=require(_0x652b('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x652b('0x6'));var controller=require(_0x652b('0x7'));router[_0x652b('0x8')]('/',auth['isAuthenticated'](),controller[_0x652b('0x9')]);router['get'](_0x652b('0xa'),auth[_0x652b('0xb')](),controller[_0x652b('0xc')]);router[_0x652b('0x8')]('/:id/fields',auth[_0x652b('0xb')](),controller[_0x652b('0xd')]);router[_0x652b('0x8')](_0x652b('0xe'),auth[_0x652b('0xb')](),controller[_0x652b('0xf')]);router[_0x652b('0x8')]('/:id/descriptions',auth[_0x652b('0xb')](),controller[_0x652b('0x10')]);router[_0x652b('0x11')]('/',auth['isAuthenticated'](),controller[_0x652b('0x12')]);router[_0x652b('0x13')](_0x652b('0xa'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x652b('0x14')]);module[_0x652b('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 8612eb3..63a2986 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 _0x4115=['ENUM','lead','contact','nothing','contact_lead','STRING'];(function(_0x499c53,_0xb4be9b){var _0x312845=function(_0x486dc0){while(--_0x486dc0){_0x499c53['push'](_0x499c53['shift']());}};_0x312845(++_0xb4be9b);}(_0x4115,0x1eb));var _0x5411=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0x4115[_0x3740fe];return _0x55492b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x5411('0x0')]},'moduleCreate':{'type':Sequelize[_0x5411('0x1')](_0x5411('0x2'),_0x5411('0x3'),_0x5411('0x4')),'defaultValue':_0x5411('0x2')},'moduleSearch':{'type':Sequelize['ENUM'](_0x5411('0x5'),'contact',_0x5411('0x2')),'defaultValue':_0x5411('0x5')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0d05=['ENUM','lead','nothing','contact_lead','contact','sequelize','exports','STRING'];(function(_0x42884c,_0x4dfaf7){var _0x29b205=function(_0x586265){while(--_0x586265){_0x42884c['push'](_0x42884c['shift']());}};_0x29b205(++_0x4dfaf7);}(_0x0d05,0xed));var _0x50d0=function(_0x2e5baf,_0x4b77a1){_0x2e5baf=_0x2e5baf-0x0;var _0x4c0797=_0x0d05[_0x2e5baf];return _0x4c0797;};'use strict';var Sequelize=require(_0x50d0('0x0'));module[_0x50d0('0x1')]={'name':{'type':Sequelize[_0x50d0('0x2')]},'moduleCreate':{'type':Sequelize[_0x50d0('0x3')](_0x50d0('0x4'),'contact',_0x50d0('0x5')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0x50d0('0x3')](_0x50d0('0x6'),_0x50d0('0x7'),_0x50d0('0x4')),'defaultValue':_0x50d0('0x6')},'description':{'type':Sequelize[_0x50d0('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 4a7efc7..483a3e5 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 _0x4456=['findOne','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','ZohoConfiguration','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','getFields','order','pick','getSubjects','ZohoField','getDescriptions'];(function(_0x10c699,_0xad5649){var _0x4698b9=function(_0x59ce87){while(--_0x59ce87){_0x10c699['push'](_0x10c699['shift']());}};_0x4698b9(++_0xad5649);}(_0x4456,0x149));var _0x6445=function(_0x3a4277,_0x51bde3){_0x3a4277=_0x3a4277-0x0;var _0x4448eb=_0x4456[_0x3a4277];return _0x4448eb;};'use strict';var emlformat=require(_0x6445('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6445('0x1'));var jsonpatch=require(_0x6445('0x2'));var rp=require(_0x6445('0x3'));var moment=require(_0x6445('0x4'));var BPromise=require(_0x6445('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6445('0x6'));var sox=require(_0x6445('0x7'));var csv=require(_0x6445('0x8'));var ejs=require(_0x6445('0x9'));var fs=require('fs');var fs_extra=require(_0x6445('0xa'));var _=require(_0x6445('0xb'));var squel=require('squel');var crypto=require(_0x6445('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6445('0xd'));var toCsv=require(_0x6445('0x8'));var querystring=require(_0x6445('0xe'));var Papa=require(_0x6445('0xf'));var Redis=require(_0x6445('0x10'));var authService=require(_0x6445('0x11'));var qs=require(_0x6445('0x12'));var as=require(_0x6445('0x13'));var hardwareService=require(_0x6445('0x14'));var logger=require(_0x6445('0x15'))(_0x6445('0x16'));var utils=require(_0x6445('0x17'));var config=require(_0x6445('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x10b63b,_0x1145d9){_0x1145d9=_0x1145d9||0xcc;return function(_0x43dbca){if(_0x43dbca){return _0x10b63b[_0x6445('0x19')](_0x1145d9);}return _0x10b63b[_0x6445('0x1a')](_0x1145d9)[_0x6445('0x1b')]();};}function respondWithResult(_0x38e82c,_0x641a06){_0x641a06=_0x641a06||0xc8;return function(_0xc8506d){if(_0xc8506d){return _0x38e82c[_0x6445('0x1a')](_0x641a06)[_0x6445('0x1c')](_0xc8506d);}};}function respondWithFilteredResult(_0x16ac55,_0xa6f0c6){return function(_0x487fa1){if(_0x487fa1){var _0x4cc4b1=typeof _0xa6f0c6['offset']==='undefined'&&typeof _0xa6f0c6['limit']===_0x6445('0x1d');var _0x173349=_0x487fa1[_0x6445('0x1e')];var _0x3cb099=_0x4cc4b1?0x0:_0xa6f0c6[_0x6445('0x1f')];var _0x4c342d=_0x4cc4b1?_0x487fa1['count']:_0xa6f0c6['offset']+_0xa6f0c6[_0x6445('0x20')];var _0x2fe7e2;if(_0x4c342d>=_0x173349){_0x4c342d=_0x173349;_0x2fe7e2=0xc8;}else{_0x2fe7e2=0xce;}_0x16ac55[_0x6445('0x1a')](_0x2fe7e2);return _0x16ac55['set'](_0x6445('0x21'),_0x3cb099+'-'+_0x4c342d+'/'+_0x173349)[_0x6445('0x1c')](_0x487fa1);}return null;};}function patchUpdates(_0x2f8b85){return function(_0xdcbfe7){try{jsonpatch[_0x6445('0x22')](_0xdcbfe7,_0x2f8b85,!![]);}catch(_0x223857){return BPromise[_0x6445('0x23')](_0x223857);}return _0xdcbfe7['save']();};}function saveUpdates(_0x51ce6f,_0x454185){return function(_0x11a70e){if(_0x11a70e){return _0x11a70e[_0x6445('0x24')](_0x51ce6f)[_0x6445('0x25')](function(_0x53b063){return _0x53b063;});}return null;};}function removeEntity(_0x2f10fa,_0x20b07c){return function(_0x1c66aa){if(_0x1c66aa){return _0x1c66aa[_0x6445('0x26')]()[_0x6445('0x25')](function(){_0x2f10fa[_0x6445('0x1a')](0xcc)[_0x6445('0x1b')]();});}};}function handleEntityNotFound(_0x480744,_0x979b52){return function(_0x1e93db){if(!_0x1e93db){_0x480744[_0x6445('0x19')](0x194);}return _0x1e93db;};}function handleError(_0x370b88,_0x49c741){_0x49c741=_0x49c741||0x1f4;return function(_0x30cf0f){logger[_0x6445('0x27')](_0x30cf0f[_0x6445('0x28')]);if(_0x30cf0f[_0x6445('0x29')]){delete _0x30cf0f['name'];}_0x370b88['status'](_0x49c741)[_0x6445('0x2a')](_0x30cf0f);};}exports[_0x6445('0x2b')]=function(_0x1db60f,_0xe146e7){var _0x448885={},_0x1227ec={},_0x14d606={'count':0x0,'rows':[]};var _0x4024e3=_['map'](db['ZohoConfiguration'][_0x6445('0x2c')],function(_0x348b22){return{'name':_0x348b22[_0x6445('0x2d')],'type':_0x348b22[_0x6445('0x2e')][_0x6445('0x2f')]};});_0x1227ec[_0x6445('0x30')]=_[_0x6445('0x31')](_0x4024e3,_0x6445('0x29'));_0x1227ec[_0x6445('0x32')]=_[_0x6445('0x33')](_0x1db60f[_0x6445('0x32')]);_0x1227ec['filters']=_[_0x6445('0x34')](_0x1227ec[_0x6445('0x30')],_0x1227ec[_0x6445('0x32')]);_0x448885[_0x6445('0x35')]=_[_0x6445('0x34')](_0x1227ec[_0x6445('0x30')],qs[_0x6445('0x36')](_0x1db60f[_0x6445('0x32')]['fields']));_0x448885[_0x6445('0x35')]=_0x448885[_0x6445('0x35')][_0x6445('0x37')]?_0x448885[_0x6445('0x35')]:_0x1227ec[_0x6445('0x30')];if(!_0x1db60f[_0x6445('0x32')][_0x6445('0x38')](_0x6445('0x39'))){_0x448885[_0x6445('0x20')]=qs[_0x6445('0x20')](_0x1db60f[_0x6445('0x32')][_0x6445('0x20')]);_0x448885[_0x6445('0x1f')]=qs[_0x6445('0x1f')](_0x1db60f[_0x6445('0x32')][_0x6445('0x1f')]);}_0x448885['order']=qs['sort'](_0x1db60f[_0x6445('0x32')][_0x6445('0x3a')]);_0x448885[_0x6445('0x3b')]=qs[_0x6445('0x3c')](_['pick'](_0x1db60f[_0x6445('0x32')],_0x1227ec['filters']),_0x4024e3);if(_0x1db60f[_0x6445('0x32')]['filter']){_0x448885['where']=_['merge'](_0x448885[_0x6445('0x3b')],{'$or':_[_0x6445('0x31')](_0x4024e3,function(_0x10a23d){if(_0x10a23d[_0x6445('0x2e')]!=='VIRTUAL'){var _0x422ba3={};_0x422ba3[_0x10a23d[_0x6445('0x29')]]={'$like':'%'+_0x1db60f[_0x6445('0x32')][_0x6445('0x3d')]+'%'};return _0x422ba3;}})});}_0x448885=_[_0x6445('0x3e')]({},_0x448885,_0x1db60f['options']);var _0x2030ca={'where':_0x448885[_0x6445('0x3b')]};return db[_0x6445('0x3f')][_0x6445('0x1e')](_0x2030ca)[_0x6445('0x25')](function(_0x2b6297){_0x14d606[_0x6445('0x1e')]=_0x2b6297;if(_0x1db60f[_0x6445('0x32')][_0x6445('0x40')]){_0x448885[_0x6445('0x41')]=[{'all':!![]}];}return db[_0x6445('0x3f')][_0x6445('0x42')](_0x448885);})[_0x6445('0x25')](function(_0x5a669f){_0x14d606[_0x6445('0x43')]=_0x5a669f;return _0x14d606;})[_0x6445('0x25')](respondWithFilteredResult(_0xe146e7,_0x448885))[_0x6445('0x44')](handleError(_0xe146e7,null));};exports[_0x6445('0x45')]=function(_0xa98075,_0x6a816){var _0x1a91fb={'raw':![],'where':{'id':_0xa98075[_0x6445('0x46')]['id']}},_0x1cb77f={};_0x1cb77f[_0x6445('0x30')]=_[_0x6445('0x33')](db[_0x6445('0x3f')]['rawAttributes']);_0x1cb77f[_0x6445('0x32')]=_[_0x6445('0x33')](_0xa98075[_0x6445('0x32')]);_0x1cb77f['filters']=_[_0x6445('0x34')](_0x1cb77f[_0x6445('0x30')],_0x1cb77f['query']);_0x1a91fb[_0x6445('0x35')]=_[_0x6445('0x34')](_0x1cb77f[_0x6445('0x30')],qs[_0x6445('0x36')](_0xa98075[_0x6445('0x32')]['fields']));_0x1a91fb[_0x6445('0x35')]=_0x1a91fb[_0x6445('0x35')][_0x6445('0x37')]?_0x1a91fb[_0x6445('0x35')]:_0x1cb77f[_0x6445('0x30')];if(_0xa98075[_0x6445('0x32')][_0x6445('0x40')]){_0x1a91fb[_0x6445('0x41')]=[{'all':!![]}];}_0x1a91fb=_['merge']({},_0x1a91fb,_0xa98075[_0x6445('0x47')]);return db[_0x6445('0x3f')][_0x6445('0x48')](_0x1a91fb)[_0x6445('0x25')](handleEntityNotFound(_0x6a816,null))['then'](respondWithResult(_0x6a816,null))['catch'](handleError(_0x6a816,null));};exports[_0x6445('0x49')]=function(_0x4aebd9,_0x3db2c9){return db[_0x6445('0x3f')]['create'](_0x4aebd9['body'],{})[_0x6445('0x25')](respondWithResult(_0x3db2c9,0xc9))[_0x6445('0x44')](handleError(_0x3db2c9,null));};exports[_0x6445('0x24')]=function(_0x25b028,_0x170f86){if(_0x25b028[_0x6445('0x4a')]['id']){delete _0x25b028['body']['id'];}return db[_0x6445('0x3f')]['find']({'where':{'id':_0x25b028[_0x6445('0x46')]['id']}})[_0x6445('0x25')](handleEntityNotFound(_0x170f86,null))[_0x6445('0x25')](saveUpdates(_0x25b028['body'],null))['then'](respondWithResult(_0x170f86,null))[_0x6445('0x44')](handleError(_0x170f86,null));};exports['destroy']=function(_0x427cf8,_0x49645a){return db[_0x6445('0x3f')][_0x6445('0x48')]({'where':{'id':_0x427cf8[_0x6445('0x46')]['id']}})['then'](handleEntityNotFound(_0x49645a,null))[_0x6445('0x25')](removeEntity(_0x49645a,null))[_0x6445('0x44')](handleError(_0x49645a,null));};exports[_0x6445('0x4b')]=function(_0x94077e,_0x1d39d1,_0x151774){var _0x58e813={};var _0x293bbc={};var _0x35d23c;var _0x244dff;return db[_0x6445('0x3f')]['findOne']({'where':{'id':_0x94077e[_0x6445('0x46')]['id']}})[_0x6445('0x25')](handleEntityNotFound(_0x1d39d1,null))['then'](function(_0x33558d){if(_0x33558d){_0x35d23c=_0x33558d;_0x293bbc[_0x6445('0x30')]=_[_0x6445('0x33')](db['ZohoField'][_0x6445('0x2c')]);_0x293bbc[_0x6445('0x32')]=_[_0x6445('0x33')](_0x94077e[_0x6445('0x32')]);_0x293bbc['filters']=_[_0x6445('0x34')](_0x293bbc[_0x6445('0x30')],_0x293bbc[_0x6445('0x32')]);_0x58e813[_0x6445('0x35')]=_[_0x6445('0x34')](_0x293bbc[_0x6445('0x30')],qs['fields'](_0x94077e['query'][_0x6445('0x36')]));_0x58e813[_0x6445('0x35')]=_0x58e813['attributes'][_0x6445('0x37')]?_0x58e813['attributes']:_0x293bbc[_0x6445('0x30')];_0x58e813[_0x6445('0x4c')]=qs[_0x6445('0x3a')](_0x94077e['query']['sort']);_0x58e813[_0x6445('0x3b')]=qs[_0x6445('0x3c')](_[_0x6445('0x4d')](_0x94077e[_0x6445('0x32')],_0x293bbc['filters']));if(_0x94077e[_0x6445('0x32')][_0x6445('0x3d')]){_0x58e813[_0x6445('0x3b')]=_[_0x6445('0x3e')](_0x58e813[_0x6445('0x3b')],{'$or':_['map'](_0x58e813[_0x6445('0x35')],function(_0x3efec9){var _0x1016a0={};_0x1016a0[_0x3efec9]={'$like':'%'+_0x94077e[_0x6445('0x32')][_0x6445('0x3d')]+'%'};return _0x1016a0;})});}_0x58e813=_['merge']({},_0x58e813,_0x94077e[_0x6445('0x47')]);return _0x35d23c[_0x6445('0x4b')](_0x58e813);}})['then'](function(_0x429aae){if(_0x429aae){_0x244dff=_0x429aae[_0x6445('0x37')];if(!_0x94077e[_0x6445('0x32')][_0x6445('0x38')](_0x6445('0x39'))){_0x58e813['limit']=qs[_0x6445('0x20')](_0x94077e['query'][_0x6445('0x20')]);_0x58e813[_0x6445('0x1f')]=qs['offset'](_0x94077e[_0x6445('0x32')][_0x6445('0x1f')]);}return _0x35d23c['getFields'](_0x58e813);}})['then'](function(_0xf4f0e0){if(_0xf4f0e0){return _0xf4f0e0?{'count':_0x244dff,'rows':_0xf4f0e0}:null;}})[_0x6445('0x25')](respondWithResult(_0x1d39d1,null))[_0x6445('0x44')](handleError(_0x1d39d1,null));};exports[_0x6445('0x4e')]=function(_0xf911d5,_0x5f420a,_0x34dc30){var _0x587ff6={};var _0x247124={};var _0x1cf199;var _0x4c4f3f;return db[_0x6445('0x3f')]['findOne']({'where':{'id':_0xf911d5[_0x6445('0x46')]['id']}})[_0x6445('0x25')](handleEntityNotFound(_0x5f420a,null))['then'](function(_0x5604d2){if(_0x5604d2){_0x1cf199=_0x5604d2;_0x247124['model']=_[_0x6445('0x33')](db[_0x6445('0x4f')][_0x6445('0x2c')]);_0x247124[_0x6445('0x32')]=_['keys'](_0xf911d5['query']);_0x247124[_0x6445('0x3c')]=_['intersection'](_0x247124['model'],_0x247124[_0x6445('0x32')]);_0x587ff6[_0x6445('0x35')]=_[_0x6445('0x34')](_0x247124['model'],qs['fields'](_0xf911d5['query'][_0x6445('0x36')]));_0x587ff6['attributes']=_0x587ff6[_0x6445('0x35')][_0x6445('0x37')]?_0x587ff6[_0x6445('0x35')]:_0x247124['model'];_0x587ff6[_0x6445('0x4c')]=qs[_0x6445('0x3a')](_0xf911d5[_0x6445('0x32')][_0x6445('0x3a')]);_0x587ff6[_0x6445('0x3b')]=qs[_0x6445('0x3c')](_[_0x6445('0x4d')](_0xf911d5[_0x6445('0x32')],_0x247124[_0x6445('0x3c')]));if(_0xf911d5[_0x6445('0x32')]['filter']){_0x587ff6[_0x6445('0x3b')]=_[_0x6445('0x3e')](_0x587ff6['where'],{'$or':_[_0x6445('0x31')](_0x587ff6[_0x6445('0x35')],function(_0x195afe){var _0x2979ab={};_0x2979ab[_0x195afe]={'$like':'%'+_0xf911d5[_0x6445('0x32')][_0x6445('0x3d')]+'%'};return _0x2979ab;})});}_0x587ff6=_[_0x6445('0x3e')]({},_0x587ff6,_0xf911d5[_0x6445('0x47')]);return _0x1cf199[_0x6445('0x4e')](_0x587ff6);}})[_0x6445('0x25')](function(_0x19f59f){if(_0x19f59f){_0x4c4f3f=_0x19f59f[_0x6445('0x37')];if(!_0xf911d5[_0x6445('0x32')]['hasOwnProperty'](_0x6445('0x39'))){_0x587ff6[_0x6445('0x20')]=qs[_0x6445('0x20')](_0xf911d5[_0x6445('0x32')][_0x6445('0x20')]);_0x587ff6[_0x6445('0x1f')]=qs[_0x6445('0x1f')](_0xf911d5[_0x6445('0x32')][_0x6445('0x1f')]);}return _0x1cf199[_0x6445('0x4e')](_0x587ff6);}})[_0x6445('0x25')](function(_0x4b6488){if(_0x4b6488){return _0x4b6488?{'count':_0x4c4f3f,'rows':_0x4b6488}:null;}})[_0x6445('0x25')](respondWithResult(_0x5f420a,null))[_0x6445('0x44')](handleError(_0x5f420a,null));};exports[_0x6445('0x50')]=function(_0x4ca027,_0x30c950,_0x5e17c1){var _0x5729f4={};var _0x2730f0={};var _0x10d7a9;var _0x17b758;return db[_0x6445('0x3f')][_0x6445('0x51')]({'where':{'id':_0x4ca027['params']['id']}})[_0x6445('0x25')](handleEntityNotFound(_0x30c950,null))['then'](function(_0x189182){if(_0x189182){_0x10d7a9=_0x189182;_0x2730f0['model']=_[_0x6445('0x33')](db['ZohoField'][_0x6445('0x2c')]);_0x2730f0[_0x6445('0x32')]=_[_0x6445('0x33')](_0x4ca027['query']);_0x2730f0[_0x6445('0x3c')]=_[_0x6445('0x34')](_0x2730f0[_0x6445('0x30')],_0x2730f0[_0x6445('0x32')]);_0x5729f4['attributes']=_[_0x6445('0x34')](_0x2730f0[_0x6445('0x30')],qs['fields'](_0x4ca027['query']['fields']));_0x5729f4[_0x6445('0x35')]=_0x5729f4[_0x6445('0x35')][_0x6445('0x37')]?_0x5729f4[_0x6445('0x35')]:_0x2730f0[_0x6445('0x30')];_0x5729f4[_0x6445('0x4c')]=qs[_0x6445('0x3a')](_0x4ca027[_0x6445('0x32')]['sort']);_0x5729f4[_0x6445('0x3b')]=qs['filters'](_[_0x6445('0x4d')](_0x4ca027[_0x6445('0x32')],_0x2730f0[_0x6445('0x3c')]));if(_0x4ca027[_0x6445('0x32')]['filter']){_0x5729f4[_0x6445('0x3b')]=_[_0x6445('0x3e')](_0x5729f4[_0x6445('0x3b')],{'$or':_[_0x6445('0x31')](_0x5729f4['attributes'],function(_0x235b5d){var _0x57a150={};_0x57a150[_0x235b5d]={'$like':'%'+_0x4ca027[_0x6445('0x32')][_0x6445('0x3d')]+'%'};return _0x57a150;})});}_0x5729f4=_['merge']({},_0x5729f4,_0x4ca027[_0x6445('0x47')]);return _0x10d7a9[_0x6445('0x50')](_0x5729f4);}})['then'](function(_0x572e1c){if(_0x572e1c){_0x17b758=_0x572e1c[_0x6445('0x37')];if(!_0x4ca027[_0x6445('0x32')][_0x6445('0x38')](_0x6445('0x39'))){_0x5729f4[_0x6445('0x20')]=qs[_0x6445('0x20')](_0x4ca027[_0x6445('0x32')][_0x6445('0x20')]);_0x5729f4[_0x6445('0x1f')]=qs[_0x6445('0x1f')](_0x4ca027[_0x6445('0x32')]['offset']);}return _0x10d7a9['getDescriptions'](_0x5729f4);}})[_0x6445('0x25')](function(_0x1ad786){if(_0x1ad786){return _0x1ad786?{'count':_0x17b758,'rows':_0x1ad786}:null;}})['then'](respondWithResult(_0x30c950,null))[_0x6445('0x44')](handleError(_0x30c950,null));}; \ No newline at end of file +var _0x39b3=['reject','save','update','destroy','then','end','error','stack','name','send','map','rawAttributes','fieldName','key','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','ZohoConfiguration','includeAll','include','findAll','rows','catch','keys','find','create','body','params','getFields','findOne','ZohoField','nolimit','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply'];(function(_0x47a9fc,_0x32a6ee){var _0x4a3b3b=function(_0x128066){while(--_0x128066){_0x47a9fc['push'](_0x47a9fc['shift']());}};_0x4a3b3b(++_0x32a6ee);}(_0x39b3,0x80));var _0x339b=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x39b3[_0x433a86];return _0x23000c;};'use strict';var emlformat=require(_0x339b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x339b('0x1'));var jsonpatch=require(_0x339b('0x2'));var rp=require(_0x339b('0x3'));var moment=require('moment');var BPromise=require(_0x339b('0x4'));var Mustache=require(_0x339b('0x5'));var util=require(_0x339b('0x6'));var path=require('path');var sox=require(_0x339b('0x7'));var csv=require(_0x339b('0x8'));var ejs=require(_0x339b('0x9'));var fs=require('fs');var fs_extra=require(_0x339b('0xa'));var _=require(_0x339b('0xb'));var squel=require(_0x339b('0xc'));var crypto=require(_0x339b('0xd'));var jsforce=require(_0x339b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x339b('0x8'));var querystring=require(_0x339b('0xf'));var Papa=require(_0x339b('0x10'));var Redis=require(_0x339b('0x11'));var authService=require(_0x339b('0x12'));var qs=require(_0x339b('0x13'));var as=require(_0x339b('0x14'));var hardwareService=require(_0x339b('0x15'));var logger=require(_0x339b('0x16'))('api');var utils=require(_0x339b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x339b('0x18'));var db=require(_0x339b('0x19'))['db'];function respondWithStatusCode(_0xa58852,_0xce1f05){_0xce1f05=_0xce1f05||0xcc;return function(_0x3e5fa6){if(_0x3e5fa6){return _0xa58852[_0x339b('0x1a')](_0xce1f05);}return _0xa58852[_0x339b('0x1b')](_0xce1f05)['end']();};}function respondWithResult(_0x199712,_0x508c26){_0x508c26=_0x508c26||0xc8;return function(_0x4e0bc4){if(_0x4e0bc4){return _0x199712['status'](_0x508c26)[_0x339b('0x1c')](_0x4e0bc4);}};}function respondWithFilteredResult(_0x4f3c5e,_0x3c2ab4){return function(_0x2c1aa0){if(_0x2c1aa0){var _0x2169b5=typeof _0x3c2ab4['offset']===_0x339b('0x1d')&&typeof _0x3c2ab4[_0x339b('0x1e')]===_0x339b('0x1d');var _0x376dfa=_0x2c1aa0[_0x339b('0x1f')];var _0x238edc=_0x2169b5?0x0:_0x3c2ab4['offset'];var _0x25954f=_0x2169b5?_0x2c1aa0[_0x339b('0x1f')]:_0x3c2ab4[_0x339b('0x20')]+_0x3c2ab4[_0x339b('0x1e')];var _0x178baf;if(_0x25954f>=_0x376dfa){_0x25954f=_0x376dfa;_0x178baf=0xc8;}else{_0x178baf=0xce;}_0x4f3c5e[_0x339b('0x1b')](_0x178baf);return _0x4f3c5e[_0x339b('0x21')](_0x339b('0x22'),_0x238edc+'-'+_0x25954f+'/'+_0x376dfa)['json'](_0x2c1aa0);}return null;};}function patchUpdates(_0x15b52e){return function(_0x173496){try{jsonpatch[_0x339b('0x23')](_0x173496,_0x15b52e,!![]);}catch(_0x57394b){return BPromise[_0x339b('0x24')](_0x57394b);}return _0x173496[_0x339b('0x25')]();};}function saveUpdates(_0x13576c,_0xeaf8e0){return function(_0x43bbcf){if(_0x43bbcf){return _0x43bbcf[_0x339b('0x26')](_0x13576c)['then'](function(_0x4086be){return _0x4086be;});}return null;};}function removeEntity(_0x2cce8b,_0x1150c0){return function(_0x3b1baa){if(_0x3b1baa){return _0x3b1baa[_0x339b('0x27')]()[_0x339b('0x28')](function(){_0x2cce8b[_0x339b('0x1b')](0xcc)[_0x339b('0x29')]();});}};}function handleEntityNotFound(_0x2d4f89,_0x4ab59c){return function(_0x2dd84e){if(!_0x2dd84e){_0x2d4f89[_0x339b('0x1a')](0x194);}return _0x2dd84e;};}function handleError(_0x13774c,_0x29da27){_0x29da27=_0x29da27||0x1f4;return function(_0x45ae58){logger[_0x339b('0x2a')](_0x45ae58[_0x339b('0x2b')]);if(_0x45ae58[_0x339b('0x2c')]){delete _0x45ae58['name'];}_0x13774c[_0x339b('0x1b')](_0x29da27)[_0x339b('0x2d')](_0x45ae58);};}exports['index']=function(_0xbcbe75,_0xbf455e){var _0x39949c={},_0xdd5a84={},_0x50e74e={'count':0x0,'rows':[]};var _0x57c795=_[_0x339b('0x2e')](db['ZohoConfiguration'][_0x339b('0x2f')],function(_0x24a52b){return{'name':_0x24a52b[_0x339b('0x30')],'type':_0x24a52b['type'][_0x339b('0x31')]};});_0xdd5a84['model']=_[_0x339b('0x2e')](_0x57c795,_0x339b('0x2c'));_0xdd5a84[_0x339b('0x32')]=_['keys'](_0xbcbe75[_0x339b('0x32')]);_0xdd5a84[_0x339b('0x33')]=_['intersection'](_0xdd5a84[_0x339b('0x34')],_0xdd5a84[_0x339b('0x32')]);_0x39949c[_0x339b('0x35')]=_[_0x339b('0x36')](_0xdd5a84[_0x339b('0x34')],qs[_0x339b('0x37')](_0xbcbe75[_0x339b('0x32')]['fields']));_0x39949c[_0x339b('0x35')]=_0x39949c[_0x339b('0x35')][_0x339b('0x38')]?_0x39949c[_0x339b('0x35')]:_0xdd5a84[_0x339b('0x34')];if(!_0xbcbe75[_0x339b('0x32')][_0x339b('0x39')]('nolimit')){_0x39949c['limit']=qs[_0x339b('0x1e')](_0xbcbe75['query'][_0x339b('0x1e')]);_0x39949c[_0x339b('0x20')]=qs[_0x339b('0x20')](_0xbcbe75['query'][_0x339b('0x20')]);}_0x39949c[_0x339b('0x3a')]=qs[_0x339b('0x3b')](_0xbcbe75['query']['sort']);_0x39949c[_0x339b('0x3c')]=qs[_0x339b('0x33')](_[_0x339b('0x3d')](_0xbcbe75['query'],_0xdd5a84['filters']),_0x57c795);if(_0xbcbe75[_0x339b('0x32')][_0x339b('0x3e')]){_0x39949c[_0x339b('0x3c')]=_[_0x339b('0x3f')](_0x39949c[_0x339b('0x3c')],{'$or':_[_0x339b('0x2e')](_0x57c795,function(_0x4d5b1c){if(_0x4d5b1c['type']!=='VIRTUAL'){var _0x3c4f45={};_0x3c4f45[_0x4d5b1c[_0x339b('0x2c')]]={'$like':'%'+_0xbcbe75[_0x339b('0x32')][_0x339b('0x3e')]+'%'};return _0x3c4f45;}})});}_0x39949c=_[_0x339b('0x3f')]({},_0x39949c,_0xbcbe75[_0x339b('0x40')]);var _0x3ce9e1={'where':_0x39949c['where']};return db[_0x339b('0x41')][_0x339b('0x1f')](_0x3ce9e1)[_0x339b('0x28')](function(_0x475685){_0x50e74e[_0x339b('0x1f')]=_0x475685;if(_0xbcbe75[_0x339b('0x32')][_0x339b('0x42')]){_0x39949c[_0x339b('0x43')]=[{'all':!![]}];}return db[_0x339b('0x41')][_0x339b('0x44')](_0x39949c);})[_0x339b('0x28')](function(_0x509021){_0x50e74e[_0x339b('0x45')]=_0x509021;return _0x50e74e;})[_0x339b('0x28')](respondWithFilteredResult(_0xbf455e,_0x39949c))[_0x339b('0x46')](handleError(_0xbf455e,null));};exports['show']=function(_0x5dc4c4,_0x26b19e){var _0x5d179d={'raw':![],'where':{'id':_0x5dc4c4['params']['id']}},_0xc7beea={};_0xc7beea['model']=_[_0x339b('0x47')](db[_0x339b('0x41')]['rawAttributes']);_0xc7beea[_0x339b('0x32')]=_[_0x339b('0x47')](_0x5dc4c4['query']);_0xc7beea[_0x339b('0x33')]=_[_0x339b('0x36')](_0xc7beea[_0x339b('0x34')],_0xc7beea[_0x339b('0x32')]);_0x5d179d['attributes']=_[_0x339b('0x36')](_0xc7beea[_0x339b('0x34')],qs[_0x339b('0x37')](_0x5dc4c4[_0x339b('0x32')]['fields']));_0x5d179d[_0x339b('0x35')]=_0x5d179d['attributes'][_0x339b('0x38')]?_0x5d179d['attributes']:_0xc7beea[_0x339b('0x34')];if(_0x5dc4c4[_0x339b('0x32')][_0x339b('0x42')]){_0x5d179d[_0x339b('0x43')]=[{'all':!![]}];}_0x5d179d=_['merge']({},_0x5d179d,_0x5dc4c4['options']);return db['ZohoConfiguration'][_0x339b('0x48')](_0x5d179d)[_0x339b('0x28')](handleEntityNotFound(_0x26b19e,null))[_0x339b('0x28')](respondWithResult(_0x26b19e,null))[_0x339b('0x46')](handleError(_0x26b19e,null));};exports[_0x339b('0x49')]=function(_0x4a32a5,_0x53a376){return db[_0x339b('0x41')]['create'](_0x4a32a5['body'],{})['then'](respondWithResult(_0x53a376,0xc9))['catch'](handleError(_0x53a376,null));};exports[_0x339b('0x26')]=function(_0x560d38,_0x3a95ff){if(_0x560d38['body']['id']){delete _0x560d38[_0x339b('0x4a')]['id'];}return db[_0x339b('0x41')][_0x339b('0x48')]({'where':{'id':_0x560d38[_0x339b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3a95ff,null))[_0x339b('0x28')](saveUpdates(_0x560d38[_0x339b('0x4a')],null))[_0x339b('0x28')](respondWithResult(_0x3a95ff,null))['catch'](handleError(_0x3a95ff,null));};exports[_0x339b('0x27')]=function(_0x9b623f,_0x5688e6){return db[_0x339b('0x41')][_0x339b('0x48')]({'where':{'id':_0x9b623f[_0x339b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5688e6,null))[_0x339b('0x28')](removeEntity(_0x5688e6,null))[_0x339b('0x46')](handleError(_0x5688e6,null));};exports[_0x339b('0x4c')]=function(_0x1cffc8,_0x1035c8,_0x2e7cf0){var _0x175dcc={};var _0x4fcc69={};var _0x26aae0;var _0x3c34e3;return db[_0x339b('0x41')][_0x339b('0x4d')]({'where':{'id':_0x1cffc8[_0x339b('0x4b')]['id']}})[_0x339b('0x28')](handleEntityNotFound(_0x1035c8,null))['then'](function(_0x16719d){if(_0x16719d){_0x26aae0=_0x16719d;_0x4fcc69['model']=_[_0x339b('0x47')](db[_0x339b('0x4e')][_0x339b('0x2f')]);_0x4fcc69['query']=_[_0x339b('0x47')](_0x1cffc8['query']);_0x4fcc69[_0x339b('0x33')]=_[_0x339b('0x36')](_0x4fcc69[_0x339b('0x34')],_0x4fcc69[_0x339b('0x32')]);_0x175dcc['attributes']=_[_0x339b('0x36')](_0x4fcc69[_0x339b('0x34')],qs['fields'](_0x1cffc8['query']['fields']));_0x175dcc[_0x339b('0x35')]=_0x175dcc[_0x339b('0x35')][_0x339b('0x38')]?_0x175dcc[_0x339b('0x35')]:_0x4fcc69['model'];_0x175dcc[_0x339b('0x3a')]=qs['sort'](_0x1cffc8[_0x339b('0x32')][_0x339b('0x3b')]);_0x175dcc['where']=qs[_0x339b('0x33')](_[_0x339b('0x3d')](_0x1cffc8[_0x339b('0x32')],_0x4fcc69[_0x339b('0x33')]));if(_0x1cffc8[_0x339b('0x32')][_0x339b('0x3e')]){_0x175dcc['where']=_['merge'](_0x175dcc['where'],{'$or':_[_0x339b('0x2e')](_0x175dcc[_0x339b('0x35')],function(_0x38c233){var _0x3c9389={};_0x3c9389[_0x38c233]={'$like':'%'+_0x1cffc8[_0x339b('0x32')][_0x339b('0x3e')]+'%'};return _0x3c9389;})});}_0x175dcc=_['merge']({},_0x175dcc,_0x1cffc8[_0x339b('0x40')]);return _0x26aae0[_0x339b('0x4c')](_0x175dcc);}})[_0x339b('0x28')](function(_0x403037){if(_0x403037){_0x3c34e3=_0x403037[_0x339b('0x38')];if(!_0x1cffc8[_0x339b('0x32')][_0x339b('0x39')](_0x339b('0x4f'))){_0x175dcc['limit']=qs[_0x339b('0x1e')](_0x1cffc8[_0x339b('0x32')][_0x339b('0x1e')]);_0x175dcc[_0x339b('0x20')]=qs['offset'](_0x1cffc8['query']['offset']);}return _0x26aae0['getFields'](_0x175dcc);}})[_0x339b('0x28')](function(_0x707f0a){if(_0x707f0a){return _0x707f0a?{'count':_0x3c34e3,'rows':_0x707f0a}:null;}})[_0x339b('0x28')](respondWithResult(_0x1035c8,null))[_0x339b('0x46')](handleError(_0x1035c8,null));};exports[_0x339b('0x50')]=function(_0x3b9bf8,_0x16f1c1,_0x45adba){var _0x50a47a={};var _0x231abb={};var _0x247cfc;var _0x4ee2ed;return db['ZohoConfiguration'][_0x339b('0x4d')]({'where':{'id':_0x3b9bf8[_0x339b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x16f1c1,null))[_0x339b('0x28')](function(_0x293a9c){if(_0x293a9c){_0x247cfc=_0x293a9c;_0x231abb[_0x339b('0x34')]=_[_0x339b('0x47')](db[_0x339b('0x4e')]['rawAttributes']);_0x231abb[_0x339b('0x32')]=_[_0x339b('0x47')](_0x3b9bf8[_0x339b('0x32')]);_0x231abb['filters']=_[_0x339b('0x36')](_0x231abb[_0x339b('0x34')],_0x231abb[_0x339b('0x32')]);_0x50a47a[_0x339b('0x35')]=_[_0x339b('0x36')](_0x231abb[_0x339b('0x34')],qs[_0x339b('0x37')](_0x3b9bf8[_0x339b('0x32')][_0x339b('0x37')]));_0x50a47a[_0x339b('0x35')]=_0x50a47a[_0x339b('0x35')][_0x339b('0x38')]?_0x50a47a['attributes']:_0x231abb['model'];_0x50a47a[_0x339b('0x3a')]=qs[_0x339b('0x3b')](_0x3b9bf8[_0x339b('0x32')][_0x339b('0x3b')]);_0x50a47a[_0x339b('0x3c')]=qs[_0x339b('0x33')](_[_0x339b('0x3d')](_0x3b9bf8[_0x339b('0x32')],_0x231abb[_0x339b('0x33')]));if(_0x3b9bf8['query']['filter']){_0x50a47a[_0x339b('0x3c')]=_[_0x339b('0x3f')](_0x50a47a[_0x339b('0x3c')],{'$or':_['map'](_0x50a47a['attributes'],function(_0x1587db){var _0x450fd3={};_0x450fd3[_0x1587db]={'$like':'%'+_0x3b9bf8[_0x339b('0x32')][_0x339b('0x3e')]+'%'};return _0x450fd3;})});}_0x50a47a=_[_0x339b('0x3f')]({},_0x50a47a,_0x3b9bf8[_0x339b('0x40')]);return _0x247cfc[_0x339b('0x50')](_0x50a47a);}})['then'](function(_0x50de3b){if(_0x50de3b){_0x4ee2ed=_0x50de3b[_0x339b('0x38')];if(!_0x3b9bf8[_0x339b('0x32')][_0x339b('0x39')](_0x339b('0x4f'))){_0x50a47a['limit']=qs[_0x339b('0x1e')](_0x3b9bf8[_0x339b('0x32')][_0x339b('0x1e')]);_0x50a47a[_0x339b('0x20')]=qs[_0x339b('0x20')](_0x3b9bf8[_0x339b('0x32')][_0x339b('0x20')]);}return _0x247cfc[_0x339b('0x50')](_0x50a47a);}})['then'](function(_0x4a0388){if(_0x4a0388){return _0x4a0388?{'count':_0x4ee2ed,'rows':_0x4a0388}:null;}})['then'](respondWithResult(_0x16f1c1,null))[_0x339b('0x46')](handleError(_0x16f1c1,null));};exports['getDescriptions']=function(_0x1840fa,_0x5c8fa2,_0x41ec2d){var _0x2c1488={};var _0x3d1493={};var _0xab856c;var _0x1a2bbb;return db[_0x339b('0x41')]['findOne']({'where':{'id':_0x1840fa[_0x339b('0x4b')]['id']}})[_0x339b('0x28')](handleEntityNotFound(_0x5c8fa2,null))['then'](function(_0x319a2e){if(_0x319a2e){_0xab856c=_0x319a2e;_0x3d1493[_0x339b('0x34')]=_[_0x339b('0x47')](db[_0x339b('0x4e')][_0x339b('0x2f')]);_0x3d1493[_0x339b('0x32')]=_[_0x339b('0x47')](_0x1840fa[_0x339b('0x32')]);_0x3d1493[_0x339b('0x33')]=_[_0x339b('0x36')](_0x3d1493[_0x339b('0x34')],_0x3d1493[_0x339b('0x32')]);_0x2c1488['attributes']=_['intersection'](_0x3d1493['model'],qs['fields'](_0x1840fa[_0x339b('0x32')]['fields']));_0x2c1488['attributes']=_0x2c1488[_0x339b('0x35')][_0x339b('0x38')]?_0x2c1488[_0x339b('0x35')]:_0x3d1493['model'];_0x2c1488[_0x339b('0x3a')]=qs[_0x339b('0x3b')](_0x1840fa[_0x339b('0x32')][_0x339b('0x3b')]);_0x2c1488[_0x339b('0x3c')]=qs['filters'](_[_0x339b('0x3d')](_0x1840fa['query'],_0x3d1493['filters']));if(_0x1840fa[_0x339b('0x32')][_0x339b('0x3e')]){_0x2c1488[_0x339b('0x3c')]=_[_0x339b('0x3f')](_0x2c1488[_0x339b('0x3c')],{'$or':_[_0x339b('0x2e')](_0x2c1488[_0x339b('0x35')],function(_0x2c475f){var _0x5f6130={};_0x5f6130[_0x2c475f]={'$like':'%'+_0x1840fa[_0x339b('0x32')][_0x339b('0x3e')]+'%'};return _0x5f6130;})});}_0x2c1488=_[_0x339b('0x3f')]({},_0x2c1488,_0x1840fa['options']);return _0xab856c[_0x339b('0x51')](_0x2c1488);}})[_0x339b('0x28')](function(_0x1db8cb){if(_0x1db8cb){_0x1a2bbb=_0x1db8cb['length'];if(!_0x1840fa[_0x339b('0x32')][_0x339b('0x39')](_0x339b('0x4f'))){_0x2c1488[_0x339b('0x1e')]=qs[_0x339b('0x1e')](_0x1840fa[_0x339b('0x32')][_0x339b('0x1e')]);_0x2c1488['offset']=qs['offset'](_0x1840fa[_0x339b('0x32')][_0x339b('0x20')]);}return _0xab856c[_0x339b('0x51')](_0x2c1488);}})[_0x339b('0x28')](function(_0x4f873a){if(_0x4f873a){return _0x4f873a?{'count':_0x1a2bbb,'rows':_0x4f873a}:null;}})[_0x339b('0x28')](respondWithResult(_0x5c8fa2,null))['catch'](handleError(_0x5c8fa2,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 4a76f27..116c368 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 _0xc7c9=['ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','moment','request-promise','exports','define'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0xc7c9,0x18e));var _0x9c7c=function(_0x521860,_0x26c328){_0x521860=_0x521860-0x0;var _0xa83c01=_0xc7c9[_0x521860];return _0xa83c01;};'use strict';var _=require(_0x9c7c('0x0'));var util=require(_0x9c7c('0x1'));var logger=require(_0x9c7c('0x2'))('api');var moment=require(_0x9c7c('0x3'));var BPromise=require('bluebird');var rp=require(_0x9c7c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intZohoConfiguration.attributes');module[_0x9c7c('0x5')]=function(_0x48784a,_0x5a7835){return _0x48784a[_0x9c7c('0x6')](_0x9c7c('0x7'),attributes,{'tableName':_0x9c7c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x46ff=['bluebird','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api'];(function(_0xbe73ea,_0x54c41b){var _0x4f1a31=function(_0x1b7bfd){while(--_0x1b7bfd){_0xbe73ea['push'](_0xbe73ea['shift']());}};_0x4f1a31(++_0x54c41b);}(_0x46ff,0xa4));var _0xf46f=function(_0xe59625,_0x14ba71){_0xe59625=_0xe59625-0x0;var _0x480f98=_0x46ff[_0xe59625];return _0x480f98;};'use strict';var _=require(_0xf46f('0x0'));var util=require(_0xf46f('0x1'));var logger=require(_0xf46f('0x2'))(_0xf46f('0x3'));var moment=require('moment');var BPromise=require(_0xf46f('0x4'));var rp=require(_0xf46f('0x5'));var fs=require('fs');var path=require(_0xf46f('0x6'));var rimraf=require(_0xf46f('0x7'));var config=require(_0xf46f('0x8'));var attributes=require(_0xf46f('0x9'));module[_0xf46f('0xa')]=function(_0x3edb8c,_0x5b41ca){return _0x3edb8c[_0xf46f('0xb')](_0xf46f('0xc'),attributes,{'tableName':_0xf46f('0xd'),'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 0bc14d5..5cc6dd2 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 _0x6776=['ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0xaa282b,_0x2e5cd6){var _0x32bff0=function(_0x883d0e){while(--_0x883d0e){_0xaa282b['push'](_0xaa282b['shift']());}};_0x32bff0(++_0x2e5cd6);}(_0x6776,0xb6));var _0x6677=function(_0x16dd08,_0x17e217){_0x16dd08=_0x16dd08-0x0;var _0x4cc616=_0x6776[_0x16dd08];return _0x4cc616;};'use strict';var _=require(_0x6677('0x0'));var util=require(_0x6677('0x1'));var moment=require(_0x6677('0x2'));var BPromise=require(_0x6677('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6677('0x4'));var db=require(_0x6677('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6677('0x6'))(_0x6677('0x7'));var config=require(_0x6677('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6677('0x9')][_0x6677('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf62b12,_0x233a90,_0xa2e613){return new BPromise(function(_0x18156a,_0x2fdd54){return client[_0x6677('0xb')](_0xf62b12,_0xa2e613)[_0x6677('0xc')](function(_0x2f7e75){logger[_0x6677('0xd')](_0x6677('0xe'),_0x233a90,_0x6677('0xf'));logger['debug'](_0x6677('0x10'),_0x233a90,_0x6677('0xf'),JSON[_0x6677('0x11')](_0x2f7e75));if(_0x2f7e75['error']){if(_0x2f7e75['error']['code']===0x1f4){logger[_0x6677('0x12')](_0x6677('0xe'),_0x233a90,_0x2f7e75[_0x6677('0x12')][_0x6677('0x13')]);return _0x2fdd54(_0x2f7e75[_0x6677('0x12')][_0x6677('0x13')]);}logger['error'](_0x6677('0xe'),_0x233a90,_0x2f7e75[_0x6677('0x12')]['message']);return _0x18156a(_0x2f7e75[_0x6677('0x12')]['message']);}else{logger['info'](_0x6677('0xe'),_0x233a90,'request\x20sent');_0x18156a(_0x2f7e75[_0x6677('0x14')]['message']);}})[_0x6677('0x15')](function(_0x4487a5){logger[_0x6677('0x12')](_0x6677('0xe'),_0x233a90,_0x4487a5);_0x2fdd54(_0x4487a5);});});} \ No newline at end of file +var _0x56c6=['bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ZohoConfiguration,\x20%s,\x20%s','message','result','util','moment'];(function(_0x118f31,_0x1b936f){var _0x1094d8=function(_0x1680e7){while(--_0x1680e7){_0x118f31['push'](_0x118f31['shift']());}};_0x1094d8(++_0x1b936f);}(_0x56c6,0x1c6));var _0x656c=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x56c6[_0x1e4360];return _0x31e6b4;};'use strict';var _=require('lodash');var util=require(_0x656c('0x0'));var moment=require(_0x656c('0x1'));var BPromise=require(_0x656c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x656c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x656c('0x4'));var logger=require('../../config/logger')(_0x656c('0x5'));var config=require(_0x656c('0x6'));var jayson=require(_0x656c('0x7'));var client=jayson['client'][_0x656c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xd2e1f2,_0x445f26,_0x4ae844){return new BPromise(function(_0x4e3f68,_0x3dbbbf){return client['request'](_0xd2e1f2,_0x4ae844)[_0x656c('0x9')](function(_0x5393b6){logger[_0x656c('0xa')]('ZohoConfiguration,\x20%s,\x20%s',_0x445f26,'request\x20sent');logger[_0x656c('0xb')](_0x656c('0xc'),_0x445f26,_0x656c('0xd'),JSON['stringify'](_0x5393b6));if(_0x5393b6[_0x656c('0xe')]){if(_0x5393b6['error'][_0x656c('0xf')]===0x1f4){logger['error'](_0x656c('0x10'),_0x445f26,_0x5393b6[_0x656c('0xe')][_0x656c('0x11')]);return _0x3dbbbf(_0x5393b6[_0x656c('0xe')][_0x656c('0x11')]);}logger[_0x656c('0xe')]('ZohoConfiguration,\x20%s,\x20%s',_0x445f26,_0x5393b6[_0x656c('0xe')][_0x656c('0x11')]);return _0x4e3f68(_0x5393b6[_0x656c('0xe')]['message']);}else{logger[_0x656c('0xa')](_0x656c('0x10'),_0x445f26,_0x656c('0xd'));_0x4e3f68(_0x5393b6[_0x656c('0x12')][_0x656c('0x11')]);}})['catch'](function(_0x3a8692){logger[_0x656c('0xe')]('ZohoConfiguration,\x20%s,\x20%s',_0x445f26,_0x3a8692);_0x3dbbbf(_0x3a8692);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 3c6694a..cf12182 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 _0x2f92=['show','post','create','put','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./intZohoField.controller','get','isAuthenticated','index','/:id'];(function(_0x39823f,_0x5e2771){var _0x2b76e6=function(_0xdcccbe){while(--_0xdcccbe){_0x39823f['push'](_0x39823f['shift']());}};_0x2b76e6(++_0x5e2771);}(_0x2f92,0xba));var _0x22f9=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x2f92[_0x92c450];return _0x2a9599;};'use strict';var multer=require(_0x22f9('0x0'));var util=require(_0x22f9('0x1'));var path=require(_0x22f9('0x2'));var timeout=require(_0x22f9('0x3'));var express=require(_0x22f9('0x4'));var router=express[_0x22f9('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x22f9('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x22f9('0x7'));router[_0x22f9('0x8')]('/',auth[_0x22f9('0x9')](),controller[_0x22f9('0xa')]);router['get'](_0x22f9('0xb'),auth[_0x22f9('0x9')](),controller[_0x22f9('0xc')]);router[_0x22f9('0xd')]('/',auth[_0x22f9('0x9')](),controller[_0x22f9('0xe')]);router[_0x22f9('0xf')]('/:id',auth[_0x22f9('0x9')](),controller[_0x22f9('0x10')]);router['delete'](_0x22f9('0xb'),auth[_0x22f9('0x9')](),controller['destroy']);module[_0x22f9('0x11')]=router; \ No newline at end of file +var _0x8203=['isAuthenticated','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoField.controller','get','index','/:id','show','post'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x8203,0xfd));var _0x3820=function(_0x13d0c2,_0x194e1b){_0x13d0c2=_0x13d0c2-0x0;var _0x8bf2e5=_0x8203[_0x13d0c2];return _0x8bf2e5;};'use strict';var multer=require('multer');var util=require(_0x3820('0x0'));var path=require(_0x3820('0x1'));var timeout=require(_0x3820('0x2'));var express=require('express');var router=express[_0x3820('0x3')]();var fs_extra=require(_0x3820('0x4'));var auth=require(_0x3820('0x5'));var interaction=require(_0x3820('0x6'));var config=require('../../config/environment');var controller=require(_0x3820('0x7'));router[_0x3820('0x8')]('/',auth['isAuthenticated'](),controller[_0x3820('0x9')]);router[_0x3820('0x8')](_0x3820('0xa'),auth['isAuthenticated'](),controller[_0x3820('0xb')]);router[_0x3820('0xc')]('/',auth[_0x3820('0xd')](),controller['create']);router[_0x3820('0xe')]('/:id',auth[_0x3820('0xd')](),controller[_0x3820('0xf')]);router[_0x3820('0x10')](_0x3820('0xa'),auth[_0x3820('0xd')](),controller[_0x3820('0x11')]);module[_0x3820('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 3fc9c2b..b5f36e1 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 _0x2ed9=['keyValue','picklist','STRING','BOOLEAN','exports','string','variable','customVariable'];(function(_0x1416fc,_0x72e155){var _0x3a4b34=function(_0x455ac8){while(--_0x455ac8){_0x1416fc['push'](_0x1416fc['shift']());}};_0x3a4b34(++_0x72e155);}(_0x2ed9,0x19c));var _0x92ed=function(_0x390db1,_0x325439){_0x390db1=_0x390db1-0x0;var _0x40ae66=_0x2ed9[_0x390db1];return _0x40ae66;};'use strict';var Sequelize=require('sequelize');module[_0x92ed('0x0')]={'type':{'type':Sequelize['ENUM'](_0x92ed('0x1'),_0x92ed('0x2'),_0x92ed('0x3'),_0x92ed('0x4'),_0x92ed('0x5')),'defaultValue':_0x92ed('0x1')},'content':{'type':Sequelize[_0x92ed('0x6')]},'key':{'type':Sequelize[_0x92ed('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x92ed('0x1'),'variable',_0x92ed('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x92ed('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb2e7=['exports','ENUM','variable','customVariable','keyValue','picklist','STRING','string','BOOLEAN','sequelize'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xb2e7,0x117));var _0x7b2e=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xb2e7[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x7b2e('0x0'));module[_0x7b2e('0x1')]={'type':{'type':Sequelize[_0x7b2e('0x2')]('string',_0x7b2e('0x3'),_0x7b2e('0x4'),_0x7b2e('0x5'),_0x7b2e('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x7b2e('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x7b2e('0x2')](_0x7b2e('0x8'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x7b2e('0x7')]},'idField':{'type':Sequelize[_0x7b2e('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x7b2e('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7b2e('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 6d1f26d..dee74cd 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 _0x0f21=['count','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','rawAttributes','fieldName','type','key','model','map','keys','query','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','ZohoField','includeAll','include','findAll','catch','show','intersection','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined'];(function(_0x3e96e9,_0x264b9f){var _0x2a6d3d=function(_0x433f94){while(--_0x433f94){_0x3e96e9['push'](_0x3e96e9['shift']());}};_0x2a6d3d(++_0x264b9f);}(_0x0f21,0x118));var _0x10f2=function(_0x16e5b3,_0x30d91d){_0x16e5b3=_0x16e5b3-0x0;var _0x4d6874=_0x0f21[_0x16e5b3];return _0x4d6874;};'use strict';var emlformat=require(_0x10f2('0x0'));var rimraf=require(_0x10f2('0x1'));var zipdir=require(_0x10f2('0x2'));var jsonpatch=require(_0x10f2('0x3'));var rp=require(_0x10f2('0x4'));var moment=require(_0x10f2('0x5'));var BPromise=require(_0x10f2('0x6'));var Mustache=require('mustache');var util=require(_0x10f2('0x7'));var path=require(_0x10f2('0x8'));var sox=require(_0x10f2('0x9'));var csv=require(_0x10f2('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x10f2('0xb'));var _=require(_0x10f2('0xc'));var squel=require(_0x10f2('0xd'));var crypto=require(_0x10f2('0xe'));var jsforce=require(_0x10f2('0xf'));var deskjs=require(_0x10f2('0x10'));var toCsv=require(_0x10f2('0xa'));var querystring=require(_0x10f2('0x11'));var Papa=require('papaparse');var Redis=require(_0x10f2('0x12'));var authService=require(_0x10f2('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x10f2('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x10f2('0x15'))(_0x10f2('0x16'));var utils=require(_0x10f2('0x17'));var config=require(_0x10f2('0x18'));var licenseUtil=require(_0x10f2('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5f26c5,_0x1c0d8e){_0x1c0d8e=_0x1c0d8e||0xcc;return function(_0x458e99){if(_0x458e99){return _0x5f26c5[_0x10f2('0x1a')](_0x1c0d8e);}return _0x5f26c5[_0x10f2('0x1b')](_0x1c0d8e)[_0x10f2('0x1c')]();};}function respondWithResult(_0x3a620e,_0x36ca9d){_0x36ca9d=_0x36ca9d||0xc8;return function(_0x212de9){if(_0x212de9){return _0x3a620e[_0x10f2('0x1b')](_0x36ca9d)[_0x10f2('0x1d')](_0x212de9);}};}function respondWithFilteredResult(_0x2e7838,_0x535365){return function(_0x4fba52){if(_0x4fba52){var _0x434910=typeof _0x535365['offset']==='undefined'&&typeof _0x535365[_0x10f2('0x1e')]===_0x10f2('0x1f');var _0x1bfed5=_0x4fba52[_0x10f2('0x20')];var _0x1dd976=_0x434910?0x0:_0x535365['offset'];var _0x55fcc0=_0x434910?_0x4fba52['count']:_0x535365['offset']+_0x535365[_0x10f2('0x1e')];var _0x40d7ad;if(_0x55fcc0>=_0x1bfed5){_0x55fcc0=_0x1bfed5;_0x40d7ad=0xc8;}else{_0x40d7ad=0xce;}_0x2e7838[_0x10f2('0x1b')](_0x40d7ad);return _0x2e7838[_0x10f2('0x21')](_0x10f2('0x22'),_0x1dd976+'-'+_0x55fcc0+'/'+_0x1bfed5)[_0x10f2('0x1d')](_0x4fba52);}return null;};}function patchUpdates(_0x360223){return function(_0x5a12db){try{jsonpatch[_0x10f2('0x23')](_0x5a12db,_0x360223,!![]);}catch(_0x4d1fc7){return BPromise['reject'](_0x4d1fc7);}return _0x5a12db[_0x10f2('0x24')]();};}function saveUpdates(_0x72936f,_0x11a661){return function(_0x4335f6){if(_0x4335f6){return _0x4335f6[_0x10f2('0x25')](_0x72936f)['then'](function(_0x559f82){return _0x559f82;});}return null;};}function removeEntity(_0x126db0,_0x4ac744){return function(_0x4997b6){if(_0x4997b6){return _0x4997b6[_0x10f2('0x26')]()[_0x10f2('0x27')](function(){_0x126db0[_0x10f2('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14074c,_0x1fc8be){return function(_0xf6203f){if(!_0xf6203f){_0x14074c[_0x10f2('0x1a')](0x194);}return _0xf6203f;};}function handleError(_0x119236,_0x2bb52a){_0x2bb52a=_0x2bb52a||0x1f4;return function(_0x30c2c1){logger[_0x10f2('0x28')](_0x30c2c1[_0x10f2('0x29')]);if(_0x30c2c1['name']){delete _0x30c2c1[_0x10f2('0x2a')];}_0x119236[_0x10f2('0x1b')](_0x2bb52a)[_0x10f2('0x2b')](_0x30c2c1);};}exports['index']=function(_0x2dc5d2,_0x5b2ef5){var _0x4ff27d={},_0x213017={},_0x4c73ab={'count':0x0,'rows':[]};var _0x1b39cc=_['map'](db['ZohoField'][_0x10f2('0x2c')],function(_0x33b430){return{'name':_0x33b430[_0x10f2('0x2d')],'type':_0x33b430[_0x10f2('0x2e')][_0x10f2('0x2f')]};});_0x213017[_0x10f2('0x30')]=_[_0x10f2('0x31')](_0x1b39cc,_0x10f2('0x2a'));_0x213017['query']=_[_0x10f2('0x32')](_0x2dc5d2[_0x10f2('0x33')]);_0x213017['filters']=_['intersection'](_0x213017[_0x10f2('0x30')],_0x213017['query']);_0x4ff27d[_0x10f2('0x34')]=_['intersection'](_0x213017[_0x10f2('0x30')],qs[_0x10f2('0x35')](_0x2dc5d2[_0x10f2('0x33')][_0x10f2('0x35')]));_0x4ff27d[_0x10f2('0x34')]=_0x4ff27d[_0x10f2('0x34')][_0x10f2('0x36')]?_0x4ff27d[_0x10f2('0x34')]:_0x213017[_0x10f2('0x30')];if(!_0x2dc5d2[_0x10f2('0x33')][_0x10f2('0x37')](_0x10f2('0x38'))){_0x4ff27d['limit']=qs[_0x10f2('0x1e')](_0x2dc5d2[_0x10f2('0x33')][_0x10f2('0x1e')]);_0x4ff27d[_0x10f2('0x39')]=qs['offset'](_0x2dc5d2['query'][_0x10f2('0x39')]);}_0x4ff27d[_0x10f2('0x3a')]=qs[_0x10f2('0x3b')](_0x2dc5d2[_0x10f2('0x33')]['sort']);_0x4ff27d['where']=qs[_0x10f2('0x3c')](_[_0x10f2('0x3d')](_0x2dc5d2[_0x10f2('0x33')],_0x213017['filters']),_0x1b39cc);if(_0x2dc5d2[_0x10f2('0x33')][_0x10f2('0x3e')]){_0x4ff27d[_0x10f2('0x3f')]=_['merge'](_0x4ff27d[_0x10f2('0x3f')],{'$or':_['map'](_0x1b39cc,function(_0x466a93){if(_0x466a93[_0x10f2('0x2e')]!==_0x10f2('0x40')){var _0x15629b={};_0x15629b[_0x466a93[_0x10f2('0x2a')]]={'$like':'%'+_0x2dc5d2[_0x10f2('0x33')][_0x10f2('0x3e')]+'%'};return _0x15629b;}})});}_0x4ff27d=_[_0x10f2('0x41')]({},_0x4ff27d,_0x2dc5d2[_0x10f2('0x42')]);var _0x3fbd6a={'where':_0x4ff27d[_0x10f2('0x3f')]};return db[_0x10f2('0x43')][_0x10f2('0x20')](_0x3fbd6a)[_0x10f2('0x27')](function(_0x5934b4){_0x4c73ab[_0x10f2('0x20')]=_0x5934b4;if(_0x2dc5d2[_0x10f2('0x33')][_0x10f2('0x44')]){_0x4ff27d[_0x10f2('0x45')]=[{'all':!![]}];}return db[_0x10f2('0x43')][_0x10f2('0x46')](_0x4ff27d);})[_0x10f2('0x27')](function(_0x392cd5){_0x4c73ab['rows']=_0x392cd5;return _0x4c73ab;})[_0x10f2('0x27')](respondWithFilteredResult(_0x5b2ef5,_0x4ff27d))[_0x10f2('0x47')](handleError(_0x5b2ef5,null));};exports[_0x10f2('0x48')]=function(_0x800d7e,_0x3e54a4){var _0xcb7ba0={'raw':!![],'where':{'id':_0x800d7e['params']['id']}},_0x159f0d={};_0x159f0d['model']=_[_0x10f2('0x32')](db[_0x10f2('0x43')][_0x10f2('0x2c')]);_0x159f0d[_0x10f2('0x33')]=_['keys'](_0x800d7e[_0x10f2('0x33')]);_0x159f0d['filters']=_['intersection'](_0x159f0d[_0x10f2('0x30')],_0x159f0d[_0x10f2('0x33')]);_0xcb7ba0[_0x10f2('0x34')]=_[_0x10f2('0x49')](_0x159f0d[_0x10f2('0x30')],qs[_0x10f2('0x35')](_0x800d7e[_0x10f2('0x33')]['fields']));_0xcb7ba0[_0x10f2('0x34')]=_0xcb7ba0[_0x10f2('0x34')][_0x10f2('0x36')]?_0xcb7ba0['attributes']:_0x159f0d[_0x10f2('0x30')];if(_0x800d7e['query'][_0x10f2('0x44')]){_0xcb7ba0[_0x10f2('0x45')]=[{'all':!![]}];}_0xcb7ba0=_['merge']({},_0xcb7ba0,_0x800d7e['options']);return db[_0x10f2('0x43')][_0x10f2('0x4a')](_0xcb7ba0)[_0x10f2('0x27')](handleEntityNotFound(_0x3e54a4,null))[_0x10f2('0x27')](respondWithResult(_0x3e54a4,null))[_0x10f2('0x47')](handleError(_0x3e54a4,null));};exports[_0x10f2('0x4b')]=function(_0x2bb78b,_0x27975a){return db[_0x10f2('0x43')][_0x10f2('0x4b')](_0x2bb78b[_0x10f2('0x4c')],{})['then'](respondWithResult(_0x27975a,0xc9))['catch'](handleError(_0x27975a,null));};exports['update']=function(_0x5f06ab,_0x377890){if(_0x5f06ab['body']['id']){delete _0x5f06ab[_0x10f2('0x4c')]['id'];}return db['ZohoField'][_0x10f2('0x4a')]({'where':{'id':_0x5f06ab[_0x10f2('0x4d')]['id']}})[_0x10f2('0x27')](handleEntityNotFound(_0x377890,null))['then'](saveUpdates(_0x5f06ab[_0x10f2('0x4c')],null))[_0x10f2('0x27')](respondWithResult(_0x377890,null))[_0x10f2('0x47')](handleError(_0x377890,null));};exports['destroy']=function(_0x56f9b5,_0x3ddce6){return db[_0x10f2('0x43')][_0x10f2('0x4a')]({'where':{'id':_0x56f9b5[_0x10f2('0x4d')]['id']}})[_0x10f2('0x27')](handleEntityNotFound(_0x3ddce6,null))[_0x10f2('0x27')](removeEntity(_0x3ddce6,null))['catch'](handleError(_0x3ddce6,null));}; \ No newline at end of file +var _0x00ed=['order','sort','where','pick','filter','merge','options','ZohoField','includeAll','include','then','rows','catch','show','find','create','body','update','destroy','params','rimraf','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','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','error','stack','name','send','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit'];(function(_0x2aff6a,_0x45d18){var _0x8eb5fa=function(_0x5e9e30){while(--_0x5e9e30){_0x2aff6a['push'](_0x2aff6a['shift']());}};_0x8eb5fa(++_0x45d18);}(_0x00ed,0xe9));var _0xd00e=function(_0x54b6fe,_0x1cb0d1){_0x54b6fe=_0x54b6fe-0x0;var _0x3ce8dd=_0x00ed[_0x54b6fe];return _0x3ce8dd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd00e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd00e('0x1'));var rp=require(_0xd00e('0x2'));var moment=require(_0xd00e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd00e('0x4'));var util=require(_0xd00e('0x5'));var path=require(_0xd00e('0x6'));var sox=require(_0xd00e('0x7'));var csv=require(_0xd00e('0x8'));var ejs=require(_0xd00e('0x9'));var fs=require('fs');var fs_extra=require(_0xd00e('0xa'));var _=require(_0xd00e('0xb'));var squel=require(_0xd00e('0xc'));var crypto=require(_0xd00e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xd00e('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd00e('0xf'));var Papa=require('papaparse');var Redis=require(_0xd00e('0x10'));var authService=require(_0xd00e('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd00e('0x12'));var logger=require(_0xd00e('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xd00e('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xd00e('0x15'))['db'];function respondWithStatusCode(_0x8cac21,_0x5ab110){_0x5ab110=_0x5ab110||0xcc;return function(_0x4254cc){if(_0x4254cc){return _0x8cac21[_0xd00e('0x16')](_0x5ab110);}return _0x8cac21[_0xd00e('0x17')](_0x5ab110)[_0xd00e('0x18')]();};}function respondWithResult(_0x4acbdb,_0x5460d2){_0x5460d2=_0x5460d2||0xc8;return function(_0x26ec0e){if(_0x26ec0e){return _0x4acbdb[_0xd00e('0x17')](_0x5460d2)[_0xd00e('0x19')](_0x26ec0e);}};}function respondWithFilteredResult(_0x46e290,_0x52edde){return function(_0x618b09){if(_0x618b09){var _0x2c3445=typeof _0x52edde[_0xd00e('0x1a')]===_0xd00e('0x1b')&&typeof _0x52edde['limit']===_0xd00e('0x1b');var _0x36c0ac=_0x618b09[_0xd00e('0x1c')];var _0x48b77b=_0x2c3445?0x0:_0x52edde[_0xd00e('0x1a')];var _0x10c96f=_0x2c3445?_0x618b09[_0xd00e('0x1c')]:_0x52edde[_0xd00e('0x1a')]+_0x52edde[_0xd00e('0x1d')];var _0x151b0f;if(_0x10c96f>=_0x36c0ac){_0x10c96f=_0x36c0ac;_0x151b0f=0xc8;}else{_0x151b0f=0xce;}_0x46e290['status'](_0x151b0f);return _0x46e290[_0xd00e('0x1e')](_0xd00e('0x1f'),_0x48b77b+'-'+_0x10c96f+'/'+_0x36c0ac)[_0xd00e('0x19')](_0x618b09);}return null;};}function patchUpdates(_0x86928a){return function(_0x4ae0c9){try{jsonpatch[_0xd00e('0x20')](_0x4ae0c9,_0x86928a,!![]);}catch(_0x36c95d){return BPromise['reject'](_0x36c95d);}return _0x4ae0c9['save']();};}function saveUpdates(_0x5e4a51,_0x550553){return function(_0x2e1983){if(_0x2e1983){return _0x2e1983['update'](_0x5e4a51)['then'](function(_0x5eb28c){return _0x5eb28c;});}return null;};}function removeEntity(_0x3be542,_0x5f0cdc){return function(_0x257270){if(_0x257270){return _0x257270['destroy']()['then'](function(){_0x3be542['status'](0xcc)[_0xd00e('0x18')]();});}};}function handleEntityNotFound(_0x4e4835,_0x389e67){return function(_0x16ea72){if(!_0x16ea72){_0x4e4835[_0xd00e('0x16')](0x194);}return _0x16ea72;};}function handleError(_0x460e52,_0x2b1669){_0x2b1669=_0x2b1669||0x1f4;return function(_0x1f326a){logger[_0xd00e('0x21')](_0x1f326a[_0xd00e('0x22')]);if(_0x1f326a[_0xd00e('0x23')]){delete _0x1f326a[_0xd00e('0x23')];}_0x460e52[_0xd00e('0x17')](_0x2b1669)[_0xd00e('0x24')](_0x1f326a);};}exports['index']=function(_0x2c0943,_0x4cf615){var _0x44c772={},_0x4936f2={},_0x1c076e={'count':0x0,'rows':[]};var _0xe3d410=_['map'](db['ZohoField'][_0xd00e('0x25')],function(_0x599d44){return{'name':_0x599d44[_0xd00e('0x26')],'type':_0x599d44[_0xd00e('0x27')][_0xd00e('0x28')]};});_0x4936f2[_0xd00e('0x29')]=_[_0xd00e('0x2a')](_0xe3d410,_0xd00e('0x23'));_0x4936f2[_0xd00e('0x2b')]=_[_0xd00e('0x2c')](_0x2c0943[_0xd00e('0x2b')]);_0x4936f2[_0xd00e('0x2d')]=_['intersection'](_0x4936f2[_0xd00e('0x29')],_0x4936f2[_0xd00e('0x2b')]);_0x44c772[_0xd00e('0x2e')]=_[_0xd00e('0x2f')](_0x4936f2['model'],qs[_0xd00e('0x30')](_0x2c0943['query']['fields']));_0x44c772[_0xd00e('0x2e')]=_0x44c772[_0xd00e('0x2e')][_0xd00e('0x31')]?_0x44c772['attributes']:_0x4936f2['model'];if(!_0x2c0943[_0xd00e('0x2b')]['hasOwnProperty'](_0xd00e('0x32'))){_0x44c772[_0xd00e('0x1d')]=qs[_0xd00e('0x1d')](_0x2c0943[_0xd00e('0x2b')][_0xd00e('0x1d')]);_0x44c772['offset']=qs[_0xd00e('0x1a')](_0x2c0943[_0xd00e('0x2b')][_0xd00e('0x1a')]);}_0x44c772[_0xd00e('0x33')]=qs[_0xd00e('0x34')](_0x2c0943[_0xd00e('0x2b')][_0xd00e('0x34')]);_0x44c772[_0xd00e('0x35')]=qs[_0xd00e('0x2d')](_[_0xd00e('0x36')](_0x2c0943[_0xd00e('0x2b')],_0x4936f2['filters']),_0xe3d410);if(_0x2c0943[_0xd00e('0x2b')][_0xd00e('0x37')]){_0x44c772[_0xd00e('0x35')]=_[_0xd00e('0x38')](_0x44c772[_0xd00e('0x35')],{'$or':_[_0xd00e('0x2a')](_0xe3d410,function(_0x37c3c0){if(_0x37c3c0[_0xd00e('0x27')]!=='VIRTUAL'){var _0x243cb7={};_0x243cb7[_0x37c3c0[_0xd00e('0x23')]]={'$like':'%'+_0x2c0943['query']['filter']+'%'};return _0x243cb7;}})});}_0x44c772=_[_0xd00e('0x38')]({},_0x44c772,_0x2c0943[_0xd00e('0x39')]);var _0x288ac5={'where':_0x44c772['where']};return db[_0xd00e('0x3a')][_0xd00e('0x1c')](_0x288ac5)['then'](function(_0x33ed9d){_0x1c076e[_0xd00e('0x1c')]=_0x33ed9d;if(_0x2c0943[_0xd00e('0x2b')][_0xd00e('0x3b')]){_0x44c772[_0xd00e('0x3c')]=[{'all':!![]}];}return db['ZohoField']['findAll'](_0x44c772);})[_0xd00e('0x3d')](function(_0x104bad){_0x1c076e[_0xd00e('0x3e')]=_0x104bad;return _0x1c076e;})['then'](respondWithFilteredResult(_0x4cf615,_0x44c772))[_0xd00e('0x3f')](handleError(_0x4cf615,null));};exports[_0xd00e('0x40')]=function(_0x3d84c5,_0x4da8f4){var _0x4debd3={'raw':!![],'where':{'id':_0x3d84c5['params']['id']}},_0x1696f2={};_0x1696f2[_0xd00e('0x29')]=_[_0xd00e('0x2c')](db['ZohoField'][_0xd00e('0x25')]);_0x1696f2['query']=_[_0xd00e('0x2c')](_0x3d84c5['query']);_0x1696f2[_0xd00e('0x2d')]=_[_0xd00e('0x2f')](_0x1696f2[_0xd00e('0x29')],_0x1696f2[_0xd00e('0x2b')]);_0x4debd3['attributes']=_[_0xd00e('0x2f')](_0x1696f2['model'],qs[_0xd00e('0x30')](_0x3d84c5[_0xd00e('0x2b')][_0xd00e('0x30')]));_0x4debd3[_0xd00e('0x2e')]=_0x4debd3[_0xd00e('0x2e')][_0xd00e('0x31')]?_0x4debd3[_0xd00e('0x2e')]:_0x1696f2['model'];if(_0x3d84c5[_0xd00e('0x2b')][_0xd00e('0x3b')]){_0x4debd3[_0xd00e('0x3c')]=[{'all':!![]}];}_0x4debd3=_[_0xd00e('0x38')]({},_0x4debd3,_0x3d84c5[_0xd00e('0x39')]);return db[_0xd00e('0x3a')][_0xd00e('0x41')](_0x4debd3)[_0xd00e('0x3d')](handleEntityNotFound(_0x4da8f4,null))[_0xd00e('0x3d')](respondWithResult(_0x4da8f4,null))['catch'](handleError(_0x4da8f4,null));};exports[_0xd00e('0x42')]=function(_0x64bdf8,_0x633839){return db[_0xd00e('0x3a')]['create'](_0x64bdf8[_0xd00e('0x43')],{})['then'](respondWithResult(_0x633839,0xc9))['catch'](handleError(_0x633839,null));};exports[_0xd00e('0x44')]=function(_0xd2ed1,_0x3e05e5){if(_0xd2ed1[_0xd00e('0x43')]['id']){delete _0xd2ed1[_0xd00e('0x43')]['id'];}return db[_0xd00e('0x3a')][_0xd00e('0x41')]({'where':{'id':_0xd2ed1['params']['id']}})[_0xd00e('0x3d')](handleEntityNotFound(_0x3e05e5,null))[_0xd00e('0x3d')](saveUpdates(_0xd2ed1[_0xd00e('0x43')],null))[_0xd00e('0x3d')](respondWithResult(_0x3e05e5,null))['catch'](handleError(_0x3e05e5,null));};exports[_0xd00e('0x45')]=function(_0x5d78e7,_0x3e10bc){return db[_0xd00e('0x3a')][_0xd00e('0x41')]({'where':{'id':_0x5d78e7[_0xd00e('0x46')]['id']}})[_0xd00e('0x3d')](handleEntityNotFound(_0x3e10bc,null))[_0xd00e('0x3d')](removeEntity(_0x3e10bc,null))['catch'](handleError(_0x3e10bc,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 1538913..573be3b 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 _0xba34=['FieldId','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment','./intZohoField.attributes','exports','define','int_zoho_fields','zoho_unique_index','idField'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0xba34,0x119));var _0x4ba3=function(_0x38428b,_0x1a4a92){_0x38428b=_0x38428b-0x0;var _0x8be47e=_0xba34[_0x38428b];return _0x8be47e;};'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')]('ZohoField',attributes,{'tableName':_0x4ba3('0xa'),'paranoid':![],'indexes':[{'name':_0x4ba3('0xb'),'fields':[_0x4ba3('0xc'),_0x4ba3('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1a85=['rimraf','../../config/environment','exports','ZohoField','int_zoho_fields','idField','../../config/logger','api','moment','path'];(function(_0x195bb3,_0x4ff2b0){var _0x1fc21e=function(_0x150e8c){while(--_0x150e8c){_0x195bb3['push'](_0x195bb3['shift']());}};_0x1fc21e(++_0x4ff2b0);}(_0x1a85,0x178));var _0x51a8=function(_0x354bd6,_0x4a7c74){_0x354bd6=_0x354bd6-0x0;var _0x39bf52=_0x1a85[_0x354bd6];return _0x39bf52;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x51a8('0x0'))(_0x51a8('0x1'));var moment=require(_0x51a8('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x51a8('0x3'));var rimraf=require(_0x51a8('0x4'));var config=require(_0x51a8('0x5'));var attributes=require('./intZohoField.attributes');module[_0x51a8('0x6')]=function(_0x4b76a8,_0x2c1180){return _0x4b76a8['define'](_0x51a8('0x7'),attributes,{'tableName':_0x51a8('0x8'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0x51a8('0x9'),'FieldId'],'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 c42ce3b..c6908e8 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 _0x4b05=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x4b05,0x1b3));var _0x54b0=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x4b05[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x54b0('0x0'));var util=require(_0x54b0('0x1'));var moment=require(_0x54b0('0x2'));var BPromise=require(_0x54b0('0x3'));var rs=require(_0x54b0('0x4'));var fs=require('fs');var Redis=require(_0x54b0('0x5'));var db=require(_0x54b0('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x54b0('0x7'))(_0x54b0('0x8'));var config=require(_0x54b0('0x9'));var jayson=require(_0x54b0('0xa'));var client=jayson[_0x54b0('0xb')][_0x54b0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x387640,_0x1e8bf7,_0x2c1940){return new BPromise(function(_0x2de8b7,_0xa80a44){return client[_0x54b0('0xd')](_0x387640,_0x2c1940)[_0x54b0('0xe')](function(_0x7b4428){logger[_0x54b0('0xf')](_0x54b0('0x10'),_0x1e8bf7,_0x54b0('0x11'));logger[_0x54b0('0x12')](_0x54b0('0x13'),_0x1e8bf7,_0x54b0('0x11'),JSON[_0x54b0('0x14')](_0x7b4428));if(_0x7b4428['error']){if(_0x7b4428[_0x54b0('0x15')][_0x54b0('0x16')]===0x1f4){logger[_0x54b0('0x15')](_0x54b0('0x10'),_0x1e8bf7,_0x7b4428['error'][_0x54b0('0x17')]);return _0xa80a44(_0x7b4428['error']['message']);}logger[_0x54b0('0x15')]('ZohoField,\x20%s,\x20%s',_0x1e8bf7,_0x7b4428['error']['message']);return _0x2de8b7(_0x7b4428[_0x54b0('0x15')][_0x54b0('0x17')]);}else{logger[_0x54b0('0xf')]('ZohoField,\x20%s,\x20%s',_0x1e8bf7,_0x54b0('0x11'));_0x2de8b7(_0x7b4428[_0x54b0('0x18')][_0x54b0('0x17')]);}})[_0x54b0('0x19')](function(_0x376280){logger[_0x54b0('0x15')](_0x54b0('0x10'),_0x1e8bf7,_0x376280);_0xa80a44(_0x376280);});});} \ No newline at end of file +var _0x7ad0=['code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x548627,_0x4ec392){var _0x844a84=function(_0x2ffdd2){while(--_0x2ffdd2){_0x548627['push'](_0x548627['shift']());}};_0x844a84(++_0x4ec392);}(_0x7ad0,0xf4));var _0x07ad=function(_0xc4743b,_0x5d8f4e){_0xc4743b=_0xc4743b-0x0;var _0x317924=_0x7ad0[_0xc4743b];return _0x317924;};'use strict';var _=require('lodash');var util=require(_0x07ad('0x0'));var moment=require(_0x07ad('0x1'));var BPromise=require(_0x07ad('0x2'));var rs=require(_0x07ad('0x3'));var fs=require('fs');var Redis=require(_0x07ad('0x4'));var db=require(_0x07ad('0x5'))['db'];var utils=require(_0x07ad('0x6'));var logger=require(_0x07ad('0x7'))('rpc');var config=require(_0x07ad('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x07ad('0x9')][_0x07ad('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a6f19,_0x24c1b8,_0x2b01e5){return new BPromise(function(_0x18309d,_0x399a5f){return client[_0x07ad('0xb')](_0x2a6f19,_0x2b01e5)[_0x07ad('0xc')](function(_0x488910){logger[_0x07ad('0xd')](_0x07ad('0xe'),_0x24c1b8,'request\x20sent');logger[_0x07ad('0xf')](_0x07ad('0x10'),_0x24c1b8,_0x07ad('0x11'),JSON[_0x07ad('0x12')](_0x488910));if(_0x488910[_0x07ad('0x13')]){if(_0x488910[_0x07ad('0x13')][_0x07ad('0x14')]===0x1f4){logger[_0x07ad('0x13')](_0x07ad('0xe'),_0x24c1b8,_0x488910['error'][_0x07ad('0x15')]);return _0x399a5f(_0x488910['error']['message']);}logger['error']('ZohoField,\x20%s,\x20%s',_0x24c1b8,_0x488910['error']['message']);return _0x18309d(_0x488910[_0x07ad('0x13')][_0x07ad('0x15')]);}else{logger[_0x07ad('0xd')](_0x07ad('0xe'),_0x24c1b8,_0x07ad('0x11'));_0x18309d(_0x488910[_0x07ad('0x16')][_0x07ad('0x15')]);}})[_0x07ad('0x17')](function(_0xdfcebb){logger[_0x07ad('0x13')]('ZohoField,\x20%s,\x20%s',_0x24c1b8,_0xdfcebb);_0x399a5f(_0xdfcebb);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 1fa30f5..7dcceaf 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x3da7a1,_0x151473){var _0x3b7290=function(_0x28746c){while(--_0x28746c){_0x3da7a1['push'](_0x3da7a1['shift']());}};_0x3b7290(++_0x151473);}(_0x9c44,0x178));var _0x49c4=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x9c44[_0x17b6e3];return _0x3906f3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x585199,_0x10d223){var _0x4f5eaf=function(_0x19f4cf){while(--_0x19f4cf){_0x585199['push'](_0x585199['shift']());}};_0x4f5eaf(++_0x10d223);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index f82a962..baf1268 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 _0x1d3d=['sequelize','exports','STRING','unique_name_and_version','app.js','INTEGER','state'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0x1d3d,0x13b));var _0xd1d3=function(_0x131f62,_0x291337){_0x131f62=_0x131f62-0x0;var _0x2085e2=_0x1d3d[_0x131f62];return _0x2085e2;};'use strict';var Sequelize=require(_0xd1d3('0x0'));module[_0xd1d3('0x1')]={'name':{'type':Sequelize[_0xd1d3('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0xd1d3('0x2')],'allowNull':![],'unique':_0xd1d3('0x3')},'main':{'type':Sequelize[_0xd1d3('0x2')],'defaultValue':_0xd1d3('0x4')},'filename':{'type':Sequelize[_0xd1d3('0x2')]},'path':{'type':Sequelize[_0xd1d3('0x2')]},'type':{'type':Sequelize[_0xd1d3('0x2')]},'size':{'type':Sequelize[_0xd1d3('0x5')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0xd1d3('0x2')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0xd1d3('0x2')],'unique':_0xd1d3('0x6')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0xd1d3('0x2')]},'remoteUri':{'type':Sequelize[_0xd1d3('0x2')]},'link':{'type':Sequelize[_0xd1d3('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0xcba4=['state','sequelize','exports','STRING','unique_name_and_version','BOOLEAN'];(function(_0x53a740,_0x311877){var _0x10a7af=function(_0x21fce7){while(--_0x21fce7){_0x53a740['push'](_0x53a740['shift']());}};_0x10a7af(++_0x311877);}(_0xcba4,0x109));var _0x4cba=function(_0x1410b4,_0x56c67f){_0x1410b4=_0x1410b4-0x0;var _0x1671f3=_0xcba4[_0x1410b4];return _0x1671f3;};'use strict';var Sequelize=require(_0x4cba('0x0'));module[_0x4cba('0x1')]={'name':{'type':Sequelize[_0x4cba('0x2')],'allowNull':![],'unique':_0x4cba('0x3')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x4cba('0x3')},'main':{'type':Sequelize[_0x4cba('0x2')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0x4cba('0x2')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x4cba('0x2')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x4cba('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0x4cba('0x2')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x4cba('0x2')],'unique':_0x4cba('0x5')},'description':{'type':Sequelize[_0x4cba('0x2')]},'title':{'type':Sequelize[_0x4cba('0x2')]},'remoteUri':{'type':Sequelize[_0x4cba('0x2')]},'link':{'type':Sequelize[_0x4cba('0x2')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 87df07a..0a9736f 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 _0x4991=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','filter','options','Integration','includeAll','include','findAll','rows','show','params','keys','find','create','body','catch','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','map','rawAttributes','fieldName','key','model','query','filters'];(function(_0x49a2f7,_0x1602a3){var _0x1d015b=function(_0x22b50a){while(--_0x22b50a){_0x49a2f7['push'](_0x49a2f7['shift']());}};_0x1d015b(++_0x1602a3);}(_0x4991,0xf7));var _0x1499=function(_0x344f2b,_0x3b1e26){_0x344f2b=_0x344f2b-0x0;var _0x8174b1=_0x4991[_0x344f2b];return _0x8174b1;};'use strict';var emlformat=require(_0x1499('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1499('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1499('0x2'));var moment=require(_0x1499('0x3'));var BPromise=require(_0x1499('0x4'));var Mustache=require(_0x1499('0x5'));var util=require(_0x1499('0x6'));var path=require(_0x1499('0x7'));var sox=require(_0x1499('0x8'));var csv=require(_0x1499('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1499('0xa'));var _=require(_0x1499('0xb'));var squel=require(_0x1499('0xc'));var crypto=require(_0x1499('0xd'));var jsforce=require(_0x1499('0xe'));var deskjs=require(_0x1499('0xf'));var toCsv=require(_0x1499('0x9'));var querystring=require(_0x1499('0x10'));var Papa=require('papaparse');var Redis=require(_0x1499('0x11'));var authService=require(_0x1499('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1499('0x13'));var hardwareService=require(_0x1499('0x14'));var logger=require('../../config/logger')(_0x1499('0x15'));var utils=require(_0x1499('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3039ce,_0x274bc1){_0x274bc1=_0x274bc1||0xcc;return function(_0x34a928){if(_0x34a928){return _0x3039ce[_0x1499('0x17')](_0x274bc1);}return _0x3039ce[_0x1499('0x18')](_0x274bc1)['end']();};}function respondWithResult(_0x5f34f2,_0x308177){_0x308177=_0x308177||0xc8;return function(_0x4e5195){if(_0x4e5195){return _0x5f34f2[_0x1499('0x18')](_0x308177)[_0x1499('0x19')](_0x4e5195);}};}function respondWithFilteredResult(_0x308318,_0x3ab605){return function(_0x48f654){if(_0x48f654){var _0x1ed43b=typeof _0x3ab605[_0x1499('0x1a')]==='undefined'&&typeof _0x3ab605[_0x1499('0x1b')]===_0x1499('0x1c');var _0x46b364=_0x48f654[_0x1499('0x1d')];var _0x1e45a9=_0x1ed43b?0x0:_0x3ab605[_0x1499('0x1a')];var _0x5b9859=_0x1ed43b?_0x48f654['count']:_0x3ab605['offset']+_0x3ab605[_0x1499('0x1b')];var _0xad534b;if(_0x5b9859>=_0x46b364){_0x5b9859=_0x46b364;_0xad534b=0xc8;}else{_0xad534b=0xce;}_0x308318['status'](_0xad534b);return _0x308318[_0x1499('0x1e')](_0x1499('0x1f'),_0x1e45a9+'-'+_0x5b9859+'/'+_0x46b364)[_0x1499('0x19')](_0x48f654);}return null;};}function patchUpdates(_0x18e4a6){return function(_0x21e887){try{jsonpatch[_0x1499('0x20')](_0x21e887,_0x18e4a6,!![]);}catch(_0x2b0458){return BPromise[_0x1499('0x21')](_0x2b0458);}return _0x21e887[_0x1499('0x22')]();};}function saveUpdates(_0x15bcd4,_0x2bb71f){return function(_0x836081){if(_0x836081){return _0x836081[_0x1499('0x23')](_0x15bcd4)[_0x1499('0x24')](function(_0x4ec57a){return _0x4ec57a;});}return null;};}function removeEntity(_0x1e2c51,_0x2c7f57){return function(_0x5615b4){if(_0x5615b4){return _0x5615b4[_0x1499('0x25')]()[_0x1499('0x24')](function(){_0x1e2c51[_0x1499('0x18')](0xcc)[_0x1499('0x26')]();});}};}function handleEntityNotFound(_0x3968e0,_0x16d036){return function(_0x54f3c2){if(!_0x54f3c2){_0x3968e0['sendStatus'](0x194);}return _0x54f3c2;};}function handleError(_0x12739b,_0x3c9aca){_0x3c9aca=_0x3c9aca||0x1f4;return function(_0x3b9259){logger[_0x1499('0x27')](_0x3b9259[_0x1499('0x28')]);if(_0x3b9259['name']){delete _0x3b9259[_0x1499('0x29')];}_0x12739b['status'](_0x3c9aca)['send'](_0x3b9259);};}exports['index']=function(_0x21d204,_0x103efa){var _0x40932a={},_0x1b460b={},_0x3dad86={'count':0x0,'rows':[]};var _0x388513=_[_0x1499('0x2a')](db['Integration'][_0x1499('0x2b')],function(_0x1a2c99){return{'name':_0x1a2c99[_0x1499('0x2c')],'type':_0x1a2c99['type'][_0x1499('0x2d')]};});_0x1b460b[_0x1499('0x2e')]=_['map'](_0x388513,_0x1499('0x29'));_0x1b460b[_0x1499('0x2f')]=_['keys'](_0x21d204[_0x1499('0x2f')]);_0x1b460b[_0x1499('0x30')]=_[_0x1499('0x31')](_0x1b460b[_0x1499('0x2e')],_0x1b460b[_0x1499('0x2f')]);_0x40932a[_0x1499('0x32')]=_[_0x1499('0x31')](_0x1b460b[_0x1499('0x2e')],qs[_0x1499('0x33')](_0x21d204[_0x1499('0x2f')][_0x1499('0x33')]));_0x40932a[_0x1499('0x32')]=_0x40932a[_0x1499('0x32')][_0x1499('0x34')]?_0x40932a[_0x1499('0x32')]:_0x1b460b[_0x1499('0x2e')];if(!_0x21d204[_0x1499('0x2f')][_0x1499('0x35')](_0x1499('0x36'))){_0x40932a[_0x1499('0x1b')]=qs['limit'](_0x21d204[_0x1499('0x2f')][_0x1499('0x1b')]);_0x40932a[_0x1499('0x1a')]=qs[_0x1499('0x1a')](_0x21d204[_0x1499('0x2f')][_0x1499('0x1a')]);}_0x40932a[_0x1499('0x37')]=qs[_0x1499('0x38')](_0x21d204[_0x1499('0x2f')][_0x1499('0x38')]);_0x40932a[_0x1499('0x39')]=qs['filters'](_['pick'](_0x21d204[_0x1499('0x2f')],_0x1b460b['filters']),_0x388513);if(_0x21d204[_0x1499('0x2f')]['filter']){_0x40932a[_0x1499('0x39')]=_[_0x1499('0x3a')](_0x40932a[_0x1499('0x39')],{'$or':_[_0x1499('0x2a')](_0x388513,function(_0x531933){if(_0x531933[_0x1499('0x3b')]!=='VIRTUAL'){var _0x2f9c59={};_0x2f9c59[_0x531933[_0x1499('0x29')]]={'$like':'%'+_0x21d204[_0x1499('0x2f')][_0x1499('0x3c')]+'%'};return _0x2f9c59;}})});}_0x40932a=_['merge']({},_0x40932a,_0x21d204[_0x1499('0x3d')]);var _0x815a99={'where':_0x40932a[_0x1499('0x39')]};return db[_0x1499('0x3e')]['count'](_0x815a99)[_0x1499('0x24')](function(_0x4cc411){_0x3dad86[_0x1499('0x1d')]=_0x4cc411;if(_0x21d204[_0x1499('0x2f')][_0x1499('0x3f')]){_0x40932a[_0x1499('0x40')]=[{'all':!![]}];}return db[_0x1499('0x3e')][_0x1499('0x41')](_0x40932a);})[_0x1499('0x24')](function(_0xcb85eb){_0x3dad86[_0x1499('0x42')]=_0xcb85eb;return _0x3dad86;})[_0x1499('0x24')](respondWithFilteredResult(_0x103efa,_0x40932a))['catch'](handleError(_0x103efa,null));};exports[_0x1499('0x43')]=function(_0x5dd36c,_0x2cfdaf){var _0x1af1a1={'raw':![],'where':{'id':_0x5dd36c[_0x1499('0x44')]['id']}},_0x5646cf={};_0x5646cf[_0x1499('0x2e')]=_[_0x1499('0x45')](db[_0x1499('0x3e')][_0x1499('0x2b')]);_0x5646cf['query']=_['keys'](_0x5dd36c[_0x1499('0x2f')]);_0x5646cf[_0x1499('0x30')]=_['intersection'](_0x5646cf[_0x1499('0x2e')],_0x5646cf[_0x1499('0x2f')]);_0x1af1a1['attributes']=_['intersection'](_0x5646cf[_0x1499('0x2e')],qs[_0x1499('0x33')](_0x5dd36c[_0x1499('0x2f')]['fields']));_0x1af1a1[_0x1499('0x32')]=_0x1af1a1[_0x1499('0x32')][_0x1499('0x34')]?_0x1af1a1[_0x1499('0x32')]:_0x5646cf['model'];if(_0x5dd36c[_0x1499('0x2f')][_0x1499('0x3f')]){_0x1af1a1[_0x1499('0x40')]=[{'all':!![]}];}_0x1af1a1=_[_0x1499('0x3a')]({},_0x1af1a1,_0x5dd36c['options']);return db[_0x1499('0x3e')][_0x1499('0x46')](_0x1af1a1)[_0x1499('0x24')](handleEntityNotFound(_0x2cfdaf,null))['then'](respondWithResult(_0x2cfdaf,null))['catch'](handleError(_0x2cfdaf,null));};exports[_0x1499('0x47')]=function(_0x491777,_0x7fa101){return db[_0x1499('0x3e')][_0x1499('0x47')](_0x491777[_0x1499('0x48')],{})[_0x1499('0x24')](respondWithResult(_0x7fa101,0xc9))[_0x1499('0x49')](handleError(_0x7fa101,null));};exports[_0x1499('0x23')]=function(_0x591aa8,_0x420d16){if(_0x591aa8['body']['id']){delete _0x591aa8[_0x1499('0x48')]['id'];}return db[_0x1499('0x3e')]['find']({'where':{'id':_0x591aa8[_0x1499('0x44')]['id']}})[_0x1499('0x24')](handleEntityNotFound(_0x420d16,null))[_0x1499('0x24')](saveUpdates(_0x591aa8['body'],null))[_0x1499('0x24')](respondWithResult(_0x420d16,null))[_0x1499('0x49')](handleError(_0x420d16,null));};exports[_0x1499('0x25')]=function(_0x29ac0f,_0x305599){return db[_0x1499('0x3e')][_0x1499('0x46')]({'where':{'id':_0x29ac0f[_0x1499('0x44')]['id']}})[_0x1499('0x24')](handleEntityNotFound(_0x305599,null))[_0x1499('0x24')](removeEntity(_0x305599,null))['catch'](handleError(_0x305599,null));}; \ No newline at end of file +var _0x524e=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','apply','reject','save','update','destroy','name','send','index','map','rawAttributes','key','model','keys','filters','intersection','attributes','fields','query','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','Integration','then','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x524e,0x15e));var _0xe524=function(_0x2995fe,_0x139130){_0x2995fe=_0x2995fe-0x0;var _0x1c07cb=_0x524e[_0x2995fe];return _0x1c07cb;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe524('0x0'));var jsonpatch=require(_0xe524('0x1'));var rp=require(_0xe524('0x2'));var moment=require(_0xe524('0x3'));var BPromise=require(_0xe524('0x4'));var Mustache=require(_0xe524('0x5'));var util=require(_0xe524('0x6'));var path=require(_0xe524('0x7'));var sox=require(_0xe524('0x8'));var csv=require(_0xe524('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe524('0xa'));var _=require(_0xe524('0xb'));var squel=require(_0xe524('0xc'));var crypto=require('crypto');var jsforce=require(_0xe524('0xd'));var deskjs=require(_0xe524('0xe'));var toCsv=require(_0xe524('0x9'));var querystring=require(_0xe524('0xf'));var Papa=require(_0xe524('0x10'));var Redis=require(_0xe524('0x11'));var authService=require(_0xe524('0x12'));var qs=require(_0xe524('0x13'));var as=require(_0xe524('0x14'));var hardwareService=require(_0xe524('0x15'));var logger=require(_0xe524('0x16'))(_0xe524('0x17'));var utils=require(_0xe524('0x18'));var config=require(_0xe524('0x19'));var licenseUtil=require(_0xe524('0x1a'));var db=require(_0xe524('0x1b'))['db'];function respondWithStatusCode(_0x5077c1,_0x4b0f51){_0x4b0f51=_0x4b0f51||0xcc;return function(_0xfdc2a5){if(_0xfdc2a5){return _0x5077c1[_0xe524('0x1c')](_0x4b0f51);}return _0x5077c1[_0xe524('0x1d')](_0x4b0f51)[_0xe524('0x1e')]();};}function respondWithResult(_0x20a852,_0x57c1b6){_0x57c1b6=_0x57c1b6||0xc8;return function(_0x12ff75){if(_0x12ff75){return _0x20a852['status'](_0x57c1b6)[_0xe524('0x1f')](_0x12ff75);}};}function respondWithFilteredResult(_0x1b0af6,_0x48165e){return function(_0x569660){if(_0x569660){var _0x488fce=typeof _0x48165e[_0xe524('0x20')]==='undefined'&&typeof _0x48165e[_0xe524('0x21')]==='undefined';var _0x5c8736=_0x569660['count'];var _0x3a4027=_0x488fce?0x0:_0x48165e['offset'];var _0x11b2a1=_0x488fce?_0x569660[_0xe524('0x22')]:_0x48165e[_0xe524('0x20')]+_0x48165e[_0xe524('0x21')];var _0x5d7b17;if(_0x11b2a1>=_0x5c8736){_0x11b2a1=_0x5c8736;_0x5d7b17=0xc8;}else{_0x5d7b17=0xce;}_0x1b0af6[_0xe524('0x1d')](_0x5d7b17);return _0x1b0af6[_0xe524('0x23')]('Content-Range',_0x3a4027+'-'+_0x11b2a1+'/'+_0x5c8736)[_0xe524('0x1f')](_0x569660);}return null;};}function patchUpdates(_0x309f85){return function(_0x43a4f9){try{jsonpatch[_0xe524('0x24')](_0x43a4f9,_0x309f85,!![]);}catch(_0x1c4194){return BPromise[_0xe524('0x25')](_0x1c4194);}return _0x43a4f9[_0xe524('0x26')]();};}function saveUpdates(_0x375219,_0x7dfe97){return function(_0x5c4d21){if(_0x5c4d21){return _0x5c4d21[_0xe524('0x27')](_0x375219)['then'](function(_0x577d1f){return _0x577d1f;});}return null;};}function removeEntity(_0x2d2f83,_0x23df5e){return function(_0x1ad106){if(_0x1ad106){return _0x1ad106[_0xe524('0x28')]()['then'](function(){_0x2d2f83[_0xe524('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17e245,_0xcf5db){return function(_0xd62772){if(!_0xd62772){_0x17e245[_0xe524('0x1c')](0x194);}return _0xd62772;};}function handleError(_0x4102d9,_0xfd5965){_0xfd5965=_0xfd5965||0x1f4;return function(_0x2141db){logger['error'](_0x2141db['stack']);if(_0x2141db[_0xe524('0x29')]){delete _0x2141db[_0xe524('0x29')];}_0x4102d9[_0xe524('0x1d')](_0xfd5965)[_0xe524('0x2a')](_0x2141db);};}exports[_0xe524('0x2b')]=function(_0x5405e4,_0x52f140){var _0x4b1ff={},_0x25e7a7={},_0x3aedd9={'count':0x0,'rows':[]};var _0x8070e4=_[_0xe524('0x2c')](db['Integration'][_0xe524('0x2d')],function(_0x9a7e98){return{'name':_0x9a7e98['fieldName'],'type':_0x9a7e98['type'][_0xe524('0x2e')]};});_0x25e7a7[_0xe524('0x2f')]=_['map'](_0x8070e4,_0xe524('0x29'));_0x25e7a7['query']=_[_0xe524('0x30')](_0x5405e4['query']);_0x25e7a7[_0xe524('0x31')]=_[_0xe524('0x32')](_0x25e7a7[_0xe524('0x2f')],_0x25e7a7['query']);_0x4b1ff[_0xe524('0x33')]=_['intersection'](_0x25e7a7[_0xe524('0x2f')],qs[_0xe524('0x34')](_0x5405e4[_0xe524('0x35')]['fields']));_0x4b1ff[_0xe524('0x33')]=_0x4b1ff[_0xe524('0x33')]['length']?_0x4b1ff[_0xe524('0x33')]:_0x25e7a7[_0xe524('0x2f')];if(!_0x5405e4[_0xe524('0x35')][_0xe524('0x36')]('nolimit')){_0x4b1ff[_0xe524('0x21')]=qs[_0xe524('0x21')](_0x5405e4[_0xe524('0x35')][_0xe524('0x21')]);_0x4b1ff[_0xe524('0x20')]=qs[_0xe524('0x20')](_0x5405e4[_0xe524('0x35')][_0xe524('0x20')]);}_0x4b1ff['order']=qs[_0xe524('0x37')](_0x5405e4['query'][_0xe524('0x37')]);_0x4b1ff[_0xe524('0x38')]=qs['filters'](_[_0xe524('0x39')](_0x5405e4['query'],_0x25e7a7[_0xe524('0x31')]),_0x8070e4);if(_0x5405e4[_0xe524('0x35')][_0xe524('0x3a')]){_0x4b1ff[_0xe524('0x38')]=_[_0xe524('0x3b')](_0x4b1ff[_0xe524('0x38')],{'$or':_[_0xe524('0x2c')](_0x8070e4,function(_0x13762c){if(_0x13762c['type']!==_0xe524('0x3c')){var _0x940c05={};_0x940c05[_0x13762c[_0xe524('0x29')]]={'$like':'%'+_0x5405e4[_0xe524('0x35')][_0xe524('0x3a')]+'%'};return _0x940c05;}})});}_0x4b1ff=_[_0xe524('0x3b')]({},_0x4b1ff,_0x5405e4[_0xe524('0x3d')]);var _0x158d45={'where':_0x4b1ff['where']};return db[_0xe524('0x3e')][_0xe524('0x22')](_0x158d45)[_0xe524('0x3f')](function(_0x59781b){_0x3aedd9[_0xe524('0x22')]=_0x59781b;if(_0x5405e4['query'][_0xe524('0x40')]){_0x4b1ff[_0xe524('0x41')]=[{'all':!![]}];}return db[_0xe524('0x3e')][_0xe524('0x42')](_0x4b1ff);})[_0xe524('0x3f')](function(_0x4746cd){_0x3aedd9[_0xe524('0x43')]=_0x4746cd;return _0x3aedd9;})['then'](respondWithFilteredResult(_0x52f140,_0x4b1ff))[_0xe524('0x44')](handleError(_0x52f140,null));};exports[_0xe524('0x45')]=function(_0x13c54c,_0x376505){var _0x438962={'raw':![],'where':{'id':_0x13c54c['params']['id']}},_0x1ae283={};_0x1ae283[_0xe524('0x2f')]=_[_0xe524('0x30')](db[_0xe524('0x3e')]['rawAttributes']);_0x1ae283[_0xe524('0x35')]=_['keys'](_0x13c54c['query']);_0x1ae283[_0xe524('0x31')]=_[_0xe524('0x32')](_0x1ae283['model'],_0x1ae283[_0xe524('0x35')]);_0x438962[_0xe524('0x33')]=_[_0xe524('0x32')](_0x1ae283[_0xe524('0x2f')],qs['fields'](_0x13c54c['query'][_0xe524('0x34')]));_0x438962[_0xe524('0x33')]=_0x438962['attributes'][_0xe524('0x46')]?_0x438962['attributes']:_0x1ae283[_0xe524('0x2f')];if(_0x13c54c[_0xe524('0x35')][_0xe524('0x40')]){_0x438962[_0xe524('0x41')]=[{'all':!![]}];}_0x438962=_[_0xe524('0x3b')]({},_0x438962,_0x13c54c[_0xe524('0x3d')]);return db[_0xe524('0x3e')][_0xe524('0x47')](_0x438962)[_0xe524('0x3f')](handleEntityNotFound(_0x376505,null))[_0xe524('0x3f')](respondWithResult(_0x376505,null))[_0xe524('0x44')](handleError(_0x376505,null));};exports[_0xe524('0x48')]=function(_0x3d7ab7,_0x33b1c8){return db[_0xe524('0x3e')]['create'](_0x3d7ab7[_0xe524('0x49')],{})['then'](respondWithResult(_0x33b1c8,0xc9))['catch'](handleError(_0x33b1c8,null));};exports[_0xe524('0x27')]=function(_0x59fe6b,_0x232cf0){if(_0x59fe6b[_0xe524('0x49')]['id']){delete _0x59fe6b['body']['id'];}return db[_0xe524('0x3e')]['find']({'where':{'id':_0x59fe6b['params']['id']}})[_0xe524('0x3f')](handleEntityNotFound(_0x232cf0,null))[_0xe524('0x3f')](saveUpdates(_0x59fe6b[_0xe524('0x49')],null))['then'](respondWithResult(_0x232cf0,null))['catch'](handleError(_0x232cf0,null));};exports['destroy']=function(_0x4e9c3b,_0x4f7a64){return db['Integration'][_0xe524('0x47')]({'where':{'id':_0x4e9c3b[_0xe524('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4f7a64,null))[_0xe524('0x3f')](removeEntity(_0x4f7a64,null))[_0xe524('0x44')](handleError(_0x4f7a64,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 9f8cf2f..a5a1633 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 _0x60bb=['integrations','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports','define','Integration'];(function(_0x57ffdf,_0x2c77ee){var _0x148f50=function(_0x4aa945){while(--_0x4aa945){_0x57ffdf['push'](_0x57ffdf['shift']());}};_0x148f50(++_0x2c77ee);}(_0x60bb,0x199));var _0xb60b=function(_0x4c6d6f,_0x291557){_0x4c6d6f=_0x4c6d6f-0x0;var _0x2d4478=_0x60bb[_0x4c6d6f];return _0x2d4478;};'use strict';var _=require(_0xb60b('0x0'));var util=require(_0xb60b('0x1'));var logger=require(_0xb60b('0x2'))(_0xb60b('0x3'));var moment=require(_0xb60b('0x4'));var BPromise=require('bluebird');var rp=require(_0xb60b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb60b('0x6'));var config=require(_0xb60b('0x7'));var attributes=require('./integration.attributes');module[_0xb60b('0x8')]=function(_0x43db90,_0x17d832){return _0x43db90[_0xb60b('0x9')](_0xb60b('0xa'),attributes,{'tableName':_0xb60b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0edf=['Integration','integrations','lodash','util','moment','bluebird','request-promise','path','rimraf','./integration.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0edf,0xb6));var _0xf0ed=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x0edf[_0x1caf6a];return _0x1bf493;};'use strict';var _=require(_0xf0ed('0x0'));var util=require(_0xf0ed('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf0ed('0x2'));var BPromise=require(_0xf0ed('0x3'));var rp=require(_0xf0ed('0x4'));var fs=require('fs');var path=require(_0xf0ed('0x5'));var rimraf=require(_0xf0ed('0x6'));var config=require('../../config/environment');var attributes=require(_0xf0ed('0x7'));module[_0xf0ed('0x8')]=function(_0x4ec8ea,_0x96d4d8){return _0x4ec8ea[_0xf0ed('0x9')](_0xf0ed('0xa'),attributes,{'tableName':_0xf0ed('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 5299d40..1b112eb 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 _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x133d16,_0x199ad3){var _0x5d7191=function(_0x501044){while(--_0x501044){_0x133d16['push'](_0x133d16['shift']());}};_0x5d7191(++_0x199ad3);}(_0x5f66,0x1a0));var _0x65f6=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x5f66[_0x126558];return _0x1f6d14;};'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')]('Integration,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});} \ No newline at end of file +var _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x4975,0x86));var _0x5497=function(_0x33acfb,_0x482609){_0x33acfb=_0x33acfb-0x0;var _0xda8935=_0x4975[_0x33acfb];return _0xda8935;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('Integration,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 4003c7b..75fd98f 100644 --- a/server/api/integrationReport/index.js +++ b/server/api/integrationReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9f0e=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','multer','util'];(function(_0x3931d7,_0x34c702){var _0x2ec3f3=function(_0x2c1507){while(--_0x2c1507){_0x3931d7['push'](_0x3931d7['shift']());}};_0x2ec3f3(++_0x34c702);}(_0x9f0e,0x116));var _0xe9f0=function(_0x1fdde2,_0x206500){_0x1fdde2=_0x1fdde2-0x0;var _0xb76f0f=_0x9f0e[_0x1fdde2];return _0xb76f0f;};'use strict';var multer=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var path=require(_0xe9f0('0x2'));var timeout=require(_0xe9f0('0x3'));var express=require(_0xe9f0('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe9f0('0x5'));var interaction=require(_0xe9f0('0x6'));var config=require(_0xe9f0('0x7'));var controller=require(_0xe9f0('0x8'));router[_0xe9f0('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe9f0('0x9')](_0xe9f0('0xa'),auth[_0xe9f0('0xb')](),controller['describe']);router[_0xe9f0('0x9')](_0xe9f0('0xc'),auth[_0xe9f0('0xb')](),controller[_0xe9f0('0xd')]);router[_0xe9f0('0xe')]('/',auth[_0xe9f0('0xb')](),controller[_0xe9f0('0xf')]);router[_0xe9f0('0x10')](_0xe9f0('0xc'),auth['isAuthenticated'](),controller[_0xe9f0('0x11')]);router[_0xe9f0('0x12')](_0xe9f0('0xc'),auth['isAuthenticated'](),controller[_0xe9f0('0x13')]);module['exports']=router; \ No newline at end of file +var _0x9f0e=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','multer','util'];(function(_0x125339,_0x3e13b3){var _0x303dec=function(_0x299719){while(--_0x299719){_0x125339['push'](_0x125339['shift']());}};_0x303dec(++_0x3e13b3);}(_0x9f0e,0x116));var _0xe9f0=function(_0x45d2fa,_0x36752f){_0x45d2fa=_0x45d2fa-0x0;var _0x5df9d3=_0x9f0e[_0x45d2fa];return _0x5df9d3;};'use strict';var multer=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var path=require(_0xe9f0('0x2'));var timeout=require(_0xe9f0('0x3'));var express=require(_0xe9f0('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe9f0('0x5'));var interaction=require(_0xe9f0('0x6'));var config=require(_0xe9f0('0x7'));var controller=require(_0xe9f0('0x8'));router[_0xe9f0('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe9f0('0x9')](_0xe9f0('0xa'),auth[_0xe9f0('0xb')](),controller['describe']);router[_0xe9f0('0x9')](_0xe9f0('0xc'),auth[_0xe9f0('0xb')](),controller[_0xe9f0('0xd')]);router[_0xe9f0('0xe')]('/',auth[_0xe9f0('0xb')](),controller[_0xe9f0('0xf')]);router[_0xe9f0('0x10')](_0xe9f0('0xc'),auth['isAuthenticated'](),controller[_0xe9f0('0x11')]);router[_0xe9f0('0x12')](_0xe9f0('0xc'),auth['isAuthenticated'](),controller[_0xe9f0('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index f9025e7..0993e7b 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 _0xfb9c=['FAILED','exports','STRING','INTEGER','BOOLEAN','DATE','TEXT','ENUM','SENT','SENDING','RECEIVED'];(function(_0x4533e2,_0x480ad8){var _0x5b4cd5=function(_0x5a07fc){while(--_0x5a07fc){_0x4533e2['push'](_0x4533e2['shift']());}};_0x5b4cd5(++_0x480ad8);}(_0xfb9c,0x114));var _0xcfb9=function(_0x1667df,_0x266940){_0x1667df=_0x1667df-0x0;var _0x341abf=_0xfb9c[_0x1667df];return _0x341abf;};'use strict';var Sequelize=require('sequelize');module[_0xcfb9('0x0')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0xcfb9('0x1')]},'exitStatus':{'type':Sequelize[_0xcfb9('0x1')]},'ticketId':{'type':Sequelize[_0xcfb9('0x1')]},'integrationId':{'type':Sequelize[_0xcfb9('0x2')]},'contacts':{'type':Sequelize[_0xcfb9('0x1')]},'uniqueid':{'type':Sequelize[_0xcfb9('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xcfb9('0x1')]},'queue':{'type':Sequelize[_0xcfb9('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xcfb9('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xcfb9('0x2')]},'agentcomplete':{'type':Sequelize[_0xcfb9('0x3')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xcfb9('0x4')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0xcfb9('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xcfb9('0x2')]},'reason':{'type':Sequelize[_0xcfb9('0x1')]},'agentringnoanswer':{'type':Sequelize[_0xcfb9('0x3')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xcfb9('0x4')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xcfb9('0x1')]},'channelstate':{'type':Sequelize[_0xcfb9('0x2')]},'channelstatedesc':{'type':Sequelize[_0xcfb9('0x1')]},'connectedlinenum':{'type':Sequelize[_0xcfb9('0x1')]},'connectedlinename':{'type':Sequelize[_0xcfb9('0x1')]},'language':{'type':Sequelize[_0xcfb9('0x1')]},'accountcode':{'type':Sequelize[_0xcfb9('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xcfb9('0x1')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xcfb9('0x1')]},'destchannelstate':{'type':Sequelize[_0xcfb9('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xcfb9('0x1')]},'destcalleridnum':{'type':Sequelize[_0xcfb9('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xcfb9('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xcfb9('0x1')]},'destaccountcode':{'type':Sequelize[_0xcfb9('0x1')]},'destcontext':{'type':Sequelize[_0xcfb9('0x1')]},'destexten':{'type':Sequelize[_0xcfb9('0x1')]},'destpriority':{'type':Sequelize[_0xcfb9('0x1')]},'destuniqueid':{'type':Sequelize[_0xcfb9('0x1')]},'messageId':{'type':Sequelize[_0xcfb9('0x1')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0xcfb9('0x1')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xcfb9('0x1')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0xcfb9('0x5')]},'html':{'type':Sequelize[_0xcfb9('0x5')]},'text':{'type':Sequelize[_0xcfb9('0x5')]},'status':{'type':Sequelize[_0xcfb9('0x6')](_0xcfb9('0x7'),_0xcfb9('0x8'),_0xcfb9('0x9'),_0xcfb9('0xa'))},'url':{'type':Sequelize[_0xcfb9('0x1')]},'app':{'type':Sequelize[_0xcfb9('0x1')]},'appdata':{'type':Sequelize[_0xcfb9('0x1')]},'projectId':{'type':Sequelize[_0xcfb9('0x2')]}}; \ No newline at end of file +var _0x7359=['INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENDING','RECEIVED','sequelize','exports','STRING'];(function(_0xdd02,_0x18d520){var _0x1e5029=function(_0x246b3a){while(--_0x246b3a){_0xdd02['push'](_0xdd02['shift']());}};_0x1e5029(++_0x18d520);}(_0x7359,0x13d));var _0x9735=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x7359[_0x110c3d];return _0x226d67;};'use strict';var Sequelize=require(_0x9735('0x0'));module[_0x9735('0x1')]={'integration':{'type':Sequelize[_0x9735('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x9735('0x2')]},'ticketId':{'type':Sequelize[_0x9735('0x2')]},'integrationId':{'type':Sequelize[_0x9735('0x3')]},'contacts':{'type':Sequelize[_0x9735('0x2')]},'uniqueid':{'type':Sequelize[_0x9735('0x2')]},'calleridnum':{'type':Sequelize[_0x9735('0x2')]},'calleridname':{'type':Sequelize[_0x9735('0x2')]},'queue':{'type':Sequelize[_0x9735('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x9735('0x4')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x9735('0x3')]},'agentcomplete':{'type':Sequelize[_0x9735('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x9735('0x4')]},'talktime':{'type':Sequelize[_0x9735('0x3')]},'agentacw':{'type':Sequelize[_0x9735('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x9735('0x3')]},'reason':{'type':Sequelize[_0x9735('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x9735('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x9735('0x4')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x9735('0x4')]},'lastevent':{'type':Sequelize[_0x9735('0x2')]},'channel':{'type':Sequelize[_0x9735('0x2')]},'channelstate':{'type':Sequelize[_0x9735('0x3')]},'channelstatedesc':{'type':Sequelize[_0x9735('0x2')]},'connectedlinenum':{'type':Sequelize[_0x9735('0x2')]},'connectedlinename':{'type':Sequelize[_0x9735('0x2')]},'language':{'type':Sequelize[_0x9735('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x9735('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x9735('0x2')]},'destchannel':{'type':Sequelize[_0x9735('0x2')]},'destchannelstate':{'type':Sequelize[_0x9735('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x9735('0x2')]},'destcalleridnum':{'type':Sequelize[_0x9735('0x2')]},'destcalleridname':{'type':Sequelize[_0x9735('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x9735('0x2')]},'destlanguage':{'type':Sequelize[_0x9735('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x9735('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x9735('0x2')]},'subject':{'type':Sequelize[_0x9735('0x2')]},'from':{'type':Sequelize[_0x9735('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x9735('0x2')]},'attachment':{'type':Sequelize[_0x9735('0x6')]},'html':{'type':Sequelize[_0x9735('0x6')]},'text':{'type':Sequelize[_0x9735('0x6')]},'status':{'type':Sequelize[_0x9735('0x7')]('SENT',_0x9735('0x8'),_0x9735('0x9'),'FAILED')},'url':{'type':Sequelize[_0x9735('0x2')]},'app':{'type':Sequelize[_0x9735('0x2')]},'appdata':{'type':Sequelize[_0x9735('0x2')]},'projectId':{'type':Sequelize[_0x9735('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index bd6a3cd..b664e22 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 _0xc005=['nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','rawAttributes','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','index','map','IntegrationReport','fieldName','type','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x469451,_0x2bf174){var _0x2e7108=function(_0x43f8df){while(--_0x43f8df){_0x469451['push'](_0x469451['shift']());}};_0x2e7108(++_0x2bf174);}(_0xc005,0x148));var _0x5c00=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0xc005[_0x476bf4];return _0x788ffe;};'use strict';var emlformat=require(_0x5c00('0x0'));var rimraf=require(_0x5c00('0x1'));var zipdir=require(_0x5c00('0x2'));var jsonpatch=require(_0x5c00('0x3'));var rp=require(_0x5c00('0x4'));var moment=require(_0x5c00('0x5'));var BPromise=require(_0x5c00('0x6'));var Mustache=require(_0x5c00('0x7'));var util=require(_0x5c00('0x8'));var path=require(_0x5c00('0x9'));var sox=require(_0x5c00('0xa'));var csv=require(_0x5c00('0xb'));var ejs=require(_0x5c00('0xc'));var fs=require('fs');var fs_extra=require(_0x5c00('0xd'));var _=require(_0x5c00('0xe'));var squel=require(_0x5c00('0xf'));var crypto=require(_0x5c00('0x10'));var jsforce=require(_0x5c00('0x11'));var deskjs=require('desk.js');var toCsv=require(_0x5c00('0xb'));var querystring=require('querystring');var Papa=require(_0x5c00('0x12'));var Redis=require(_0x5c00('0x13'));var authService=require(_0x5c00('0x14'));var qs=require(_0x5c00('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5c00('0x16'))(_0x5c00('0x17'));var utils=require(_0x5c00('0x18'));var config=require(_0x5c00('0x19'));var licenseUtil=require(_0x5c00('0x1a'));var db=require(_0x5c00('0x1b'))['db'];function respondWithStatusCode(_0x5a6023,_0x5e8183){_0x5e8183=_0x5e8183||0xcc;return function(_0x4f8cc9){if(_0x4f8cc9){return _0x5a6023[_0x5c00('0x1c')](_0x5e8183);}return _0x5a6023[_0x5c00('0x1d')](_0x5e8183)[_0x5c00('0x1e')]();};}function respondWithResult(_0x117aa2,_0x120438){_0x120438=_0x120438||0xc8;return function(_0x213a3a){if(_0x213a3a){return _0x117aa2[_0x5c00('0x1d')](_0x120438)[_0x5c00('0x1f')](_0x213a3a);}};}function respondWithFilteredResult(_0x45ba1d,_0x2a9bb8){return function(_0x1c8557){if(_0x1c8557){var _0x476a5c=typeof _0x2a9bb8[_0x5c00('0x20')]===_0x5c00('0x21')&&typeof _0x2a9bb8[_0x5c00('0x22')]===_0x5c00('0x21');var _0x1c6c66=_0x1c8557[_0x5c00('0x23')];var _0x39827b=_0x476a5c?0x0:_0x2a9bb8[_0x5c00('0x20')];var _0x47ebea=_0x476a5c?_0x1c8557[_0x5c00('0x23')]:_0x2a9bb8[_0x5c00('0x20')]+_0x2a9bb8[_0x5c00('0x22')];var _0x9212a9;if(_0x47ebea>=_0x1c6c66){_0x47ebea=_0x1c6c66;_0x9212a9=0xc8;}else{_0x9212a9=0xce;}_0x45ba1d[_0x5c00('0x1d')](_0x9212a9);return _0x45ba1d[_0x5c00('0x24')](_0x5c00('0x25'),_0x39827b+'-'+_0x47ebea+'/'+_0x1c6c66)[_0x5c00('0x1f')](_0x1c8557);}return null;};}function patchUpdates(_0xcf3b48){return function(_0x3f72c0){try{jsonpatch['apply'](_0x3f72c0,_0xcf3b48,!![]);}catch(_0xfa350a){return BPromise[_0x5c00('0x26')](_0xfa350a);}return _0x3f72c0[_0x5c00('0x27')]();};}function saveUpdates(_0x49faad,_0x2ecfd0){return function(_0x4d60ee){if(_0x4d60ee){return _0x4d60ee[_0x5c00('0x28')](_0x49faad)[_0x5c00('0x29')](function(_0x30b1b6){return _0x30b1b6;});}return null;};}function removeEntity(_0x57f557,_0x4874d6){return function(_0x1a8dd5){if(_0x1a8dd5){return _0x1a8dd5[_0x5c00('0x2a')]()[_0x5c00('0x29')](function(){_0x57f557[_0x5c00('0x1d')](0xcc)[_0x5c00('0x1e')]();});}};}function handleEntityNotFound(_0x260f14,_0x393c6f){return function(_0x384f85){if(!_0x384f85){_0x260f14[_0x5c00('0x1c')](0x194);}return _0x384f85;};}function handleError(_0x11f276,_0x11fee2){_0x11fee2=_0x11fee2||0x1f4;return function(_0x2818ab){logger['error'](_0x2818ab['stack']);if(_0x2818ab['name']){delete _0x2818ab['name'];}_0x11f276['status'](_0x11fee2)['send'](_0x2818ab);};}exports[_0x5c00('0x2b')]=function(_0x444504,_0x1839e6){var _0x2cdf73={},_0x11b980={},_0x2009b5={'count':0x0,'rows':[]};var _0x5ddd33=_[_0x5c00('0x2c')](db[_0x5c00('0x2d')]['rawAttributes'],function(_0x34dfab){return{'name':_0x34dfab[_0x5c00('0x2e')],'type':_0x34dfab[_0x5c00('0x2f')]['key']};});_0x11b980[_0x5c00('0x30')]=_[_0x5c00('0x2c')](_0x5ddd33,_0x5c00('0x31'));_0x11b980[_0x5c00('0x32')]=_[_0x5c00('0x33')](_0x444504[_0x5c00('0x32')]);_0x11b980['filters']=_[_0x5c00('0x34')](_0x11b980['model'],_0x11b980['query']);_0x2cdf73[_0x5c00('0x35')]=_[_0x5c00('0x34')](_0x11b980['model'],qs['fields'](_0x444504[_0x5c00('0x32')][_0x5c00('0x36')]));_0x2cdf73['attributes']=_0x2cdf73[_0x5c00('0x35')][_0x5c00('0x37')]?_0x2cdf73[_0x5c00('0x35')]:_0x11b980['model'];if(!_0x444504[_0x5c00('0x32')][_0x5c00('0x38')](_0x5c00('0x39'))){_0x2cdf73[_0x5c00('0x22')]=qs[_0x5c00('0x22')](_0x444504[_0x5c00('0x32')][_0x5c00('0x22')]);_0x2cdf73[_0x5c00('0x20')]=qs[_0x5c00('0x20')](_0x444504['query']['offset']);}_0x2cdf73['order']=qs['sort'](_0x444504[_0x5c00('0x32')][_0x5c00('0x3a')]);_0x2cdf73[_0x5c00('0x3b')]=qs[_0x5c00('0x3c')](_[_0x5c00('0x3d')](_0x444504[_0x5c00('0x32')],_0x11b980[_0x5c00('0x3c')]),_0x5ddd33);if(_0x444504[_0x5c00('0x32')][_0x5c00('0x3e')]){_0x2cdf73[_0x5c00('0x3b')]=_[_0x5c00('0x3f')](_0x2cdf73[_0x5c00('0x3b')],{'$or':_[_0x5c00('0x2c')](_0x5ddd33,function(_0x18d79c){if(_0x18d79c['type']!==_0x5c00('0x40')){var _0x2ac107={};_0x2ac107[_0x18d79c[_0x5c00('0x31')]]={'$like':'%'+_0x444504[_0x5c00('0x32')][_0x5c00('0x3e')]+'%'};return _0x2ac107;}})});}_0x2cdf73=_[_0x5c00('0x3f')]({},_0x2cdf73,_0x444504[_0x5c00('0x41')]);var _0x3cd677={'where':_0x2cdf73[_0x5c00('0x3b')]};return db[_0x5c00('0x2d')][_0x5c00('0x23')](_0x3cd677)[_0x5c00('0x29')](function(_0x18de73){_0x2009b5['count']=_0x18de73;if(_0x444504[_0x5c00('0x32')]['includeAll']){_0x2cdf73[_0x5c00('0x42')]=[{'all':!![]}];}return db[_0x5c00('0x2d')][_0x5c00('0x43')](_0x2cdf73);})['then'](function(_0x24d310){_0x2009b5[_0x5c00('0x44')]=_0x24d310;return _0x2009b5;})[_0x5c00('0x29')](respondWithFilteredResult(_0x1839e6,_0x2cdf73))[_0x5c00('0x45')](handleError(_0x1839e6,null));};exports['show']=function(_0x3d5d91,_0x1eb797){var _0x40cdfe={'raw':![],'where':{'id':_0x3d5d91[_0x5c00('0x46')]['id']}},_0x178f3e={};_0x178f3e[_0x5c00('0x30')]=_[_0x5c00('0x33')](db[_0x5c00('0x2d')][_0x5c00('0x47')]);_0x178f3e[_0x5c00('0x32')]=_[_0x5c00('0x33')](_0x3d5d91[_0x5c00('0x32')]);_0x178f3e[_0x5c00('0x3c')]=_['intersection'](_0x178f3e['model'],_0x178f3e[_0x5c00('0x32')]);_0x40cdfe[_0x5c00('0x35')]=_[_0x5c00('0x34')](_0x178f3e[_0x5c00('0x30')],qs[_0x5c00('0x36')](_0x3d5d91[_0x5c00('0x32')][_0x5c00('0x36')]));_0x40cdfe[_0x5c00('0x35')]=_0x40cdfe[_0x5c00('0x35')]['length']?_0x40cdfe[_0x5c00('0x35')]:_0x178f3e[_0x5c00('0x30')];if(_0x3d5d91[_0x5c00('0x32')][_0x5c00('0x48')]){_0x40cdfe['include']=[{'all':!![]}];}_0x40cdfe=_['merge']({},_0x40cdfe,_0x3d5d91[_0x5c00('0x41')]);return db[_0x5c00('0x2d')][_0x5c00('0x49')](_0x40cdfe)[_0x5c00('0x29')](handleEntityNotFound(_0x1eb797,null))['then'](respondWithResult(_0x1eb797,null))[_0x5c00('0x45')](handleError(_0x1eb797,null));};exports[_0x5c00('0x4a')]=function(_0x124560,_0x178526){return db[_0x5c00('0x2d')][_0x5c00('0x4a')](_0x124560[_0x5c00('0x4b')],{})[_0x5c00('0x29')](respondWithResult(_0x178526,0xc9))[_0x5c00('0x45')](handleError(_0x178526,null));};exports[_0x5c00('0x28')]=function(_0x1d37a8,_0x35efab){if(_0x1d37a8[_0x5c00('0x4b')]['id']){delete _0x1d37a8[_0x5c00('0x4b')]['id'];}return db['IntegrationReport']['find']({'where':{'id':_0x1d37a8[_0x5c00('0x46')]['id']}})[_0x5c00('0x29')](handleEntityNotFound(_0x35efab,null))[_0x5c00('0x29')](saveUpdates(_0x1d37a8[_0x5c00('0x4b')],null))[_0x5c00('0x29')](respondWithResult(_0x35efab,null))[_0x5c00('0x45')](handleError(_0x35efab,null));};exports[_0x5c00('0x2a')]=function(_0x23d981,_0x555e1d){return db[_0x5c00('0x2d')][_0x5c00('0x49')]({'where':{'id':_0x23d981[_0x5c00('0x46')]['id']}})[_0x5c00('0x29')](handleEntityNotFound(_0x555e1d,null))[_0x5c00('0x29')](removeEntity(_0x555e1d,null))[_0x5c00('0x45')](handleError(_0x555e1d,null));};exports[_0x5c00('0x4c')]=function(_0x548dd8,_0x51e152){return db['IntegrationReport']['describe']()[_0x5c00('0x29')](respondWithResult(_0x51e152,null))['catch'](handleError(_0x51e152,null));}; \ No newline at end of file +var _0xc751=['query','hasOwnProperty','order','where','pick','filter','VIRTUAL','merge','options','then','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','save','update','destroy','sendStatus','error','stack','name','send','IntegrationReport','rawAttributes','type','key','model','map','filters','intersection','attributes','fields','length'];(function(_0x26b8db,_0x4b1ac9){var _0x168fd5=function(_0x196fe9){while(--_0x196fe9){_0x26b8db['push'](_0x26b8db['shift']());}};_0x168fd5(++_0x4b1ac9);}(_0xc751,0xfa));var _0x1c75=function(_0x236ed6,_0x562e24){_0x236ed6=_0x236ed6-0x0;var _0x2507e4=_0xc751[_0x236ed6];return _0x2507e4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1c75('0x0'));var zipdir=require(_0x1c75('0x1'));var jsonpatch=require(_0x1c75('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1c75('0x3'));var Mustache=require(_0x1c75('0x4'));var util=require(_0x1c75('0x5'));var path=require(_0x1c75('0x6'));var sox=require(_0x1c75('0x7'));var csv=require('to-csv');var ejs=require(_0x1c75('0x8'));var fs=require('fs');var fs_extra=require(_0x1c75('0x9'));var _=require('lodash');var squel=require(_0x1c75('0xa'));var crypto=require(_0x1c75('0xb'));var jsforce=require(_0x1c75('0xc'));var deskjs=require(_0x1c75('0xd'));var toCsv=require(_0x1c75('0xe'));var querystring=require(_0x1c75('0xf'));var Papa=require(_0x1c75('0x10'));var Redis=require(_0x1c75('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1c75('0x12'));var hardwareService=require(_0x1c75('0x13'));var logger=require(_0x1c75('0x14'))(_0x1c75('0x15'));var utils=require(_0x1c75('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1c75('0x17'));var db=require(_0x1c75('0x18'))['db'];function respondWithStatusCode(_0x535863,_0x2c763f){_0x2c763f=_0x2c763f||0xcc;return function(_0x428b23){if(_0x428b23){return _0x535863['sendStatus'](_0x2c763f);}return _0x535863[_0x1c75('0x19')](_0x2c763f)[_0x1c75('0x1a')]();};}function respondWithResult(_0x370944,_0x104e0f){_0x104e0f=_0x104e0f||0xc8;return function(_0x417c0e){if(_0x417c0e){return _0x370944[_0x1c75('0x19')](_0x104e0f)['json'](_0x417c0e);}};}function respondWithFilteredResult(_0x452c6c,_0x3f55f0){return function(_0x2cdc9c){if(_0x2cdc9c){var _0x368ac2=typeof _0x3f55f0['offset']===_0x1c75('0x1b')&&typeof _0x3f55f0['limit']===_0x1c75('0x1b');var _0x52f6a6=_0x2cdc9c[_0x1c75('0x1c')];var _0x3e4855=_0x368ac2?0x0:_0x3f55f0[_0x1c75('0x1d')];var _0x481467=_0x368ac2?_0x2cdc9c[_0x1c75('0x1c')]:_0x3f55f0[_0x1c75('0x1d')]+_0x3f55f0[_0x1c75('0x1e')];var _0x406136;if(_0x481467>=_0x52f6a6){_0x481467=_0x52f6a6;_0x406136=0xc8;}else{_0x406136=0xce;}_0x452c6c['status'](_0x406136);return _0x452c6c[_0x1c75('0x1f')](_0x1c75('0x20'),_0x3e4855+'-'+_0x481467+'/'+_0x52f6a6)[_0x1c75('0x21')](_0x2cdc9c);}return null;};}function patchUpdates(_0x1ab3f0){return function(_0x1df0b9){try{jsonpatch[_0x1c75('0x22')](_0x1df0b9,_0x1ab3f0,!![]);}catch(_0x2bf0de){return BPromise['reject'](_0x2bf0de);}return _0x1df0b9[_0x1c75('0x23')]();};}function saveUpdates(_0x5ca28e,_0xa7da5){return function(_0x1e04c0){if(_0x1e04c0){return _0x1e04c0[_0x1c75('0x24')](_0x5ca28e)['then'](function(_0x2eb78f){return _0x2eb78f;});}return null;};}function removeEntity(_0x37300e,_0x42c873){return function(_0x5259b2){if(_0x5259b2){return _0x5259b2[_0x1c75('0x25')]()['then'](function(){_0x37300e[_0x1c75('0x19')](0xcc)[_0x1c75('0x1a')]();});}};}function handleEntityNotFound(_0xca2ef1,_0x5f095f){return function(_0x1143d5){if(!_0x1143d5){_0xca2ef1[_0x1c75('0x26')](0x194);}return _0x1143d5;};}function handleError(_0x1a0264,_0x5d56e5){_0x5d56e5=_0x5d56e5||0x1f4;return function(_0x4c61dd){logger[_0x1c75('0x27')](_0x4c61dd[_0x1c75('0x28')]);if(_0x4c61dd['name']){delete _0x4c61dd[_0x1c75('0x29')];}_0x1a0264['status'](_0x5d56e5)[_0x1c75('0x2a')](_0x4c61dd);};}exports['index']=function(_0x2d9bc0,_0x4cf0c4){var _0x529d3d={},_0x32da41={},_0x4b12b1={'count':0x0,'rows':[]};var _0x11a444=_['map'](db[_0x1c75('0x2b')][_0x1c75('0x2c')],function(_0x21ceb1){return{'name':_0x21ceb1['fieldName'],'type':_0x21ceb1[_0x1c75('0x2d')][_0x1c75('0x2e')]};});_0x32da41[_0x1c75('0x2f')]=_[_0x1c75('0x30')](_0x11a444,_0x1c75('0x29'));_0x32da41['query']=_['keys'](_0x2d9bc0['query']);_0x32da41[_0x1c75('0x31')]=_[_0x1c75('0x32')](_0x32da41[_0x1c75('0x2f')],_0x32da41['query']);_0x529d3d[_0x1c75('0x33')]=_[_0x1c75('0x32')](_0x32da41[_0x1c75('0x2f')],qs[_0x1c75('0x34')](_0x2d9bc0['query'][_0x1c75('0x34')]));_0x529d3d[_0x1c75('0x33')]=_0x529d3d['attributes'][_0x1c75('0x35')]?_0x529d3d[_0x1c75('0x33')]:_0x32da41['model'];if(!_0x2d9bc0[_0x1c75('0x36')][_0x1c75('0x37')]('nolimit')){_0x529d3d['limit']=qs[_0x1c75('0x1e')](_0x2d9bc0[_0x1c75('0x36')][_0x1c75('0x1e')]);_0x529d3d[_0x1c75('0x1d')]=qs[_0x1c75('0x1d')](_0x2d9bc0[_0x1c75('0x36')][_0x1c75('0x1d')]);}_0x529d3d[_0x1c75('0x38')]=qs['sort'](_0x2d9bc0[_0x1c75('0x36')]['sort']);_0x529d3d[_0x1c75('0x39')]=qs[_0x1c75('0x31')](_[_0x1c75('0x3a')](_0x2d9bc0[_0x1c75('0x36')],_0x32da41['filters']),_0x11a444);if(_0x2d9bc0['query'][_0x1c75('0x3b')]){_0x529d3d['where']=_['merge'](_0x529d3d[_0x1c75('0x39')],{'$or':_[_0x1c75('0x30')](_0x11a444,function(_0x262824){if(_0x262824['type']!==_0x1c75('0x3c')){var _0x4876de={};_0x4876de[_0x262824['name']]={'$like':'%'+_0x2d9bc0[_0x1c75('0x36')][_0x1c75('0x3b')]+'%'};return _0x4876de;}})});}_0x529d3d=_[_0x1c75('0x3d')]({},_0x529d3d,_0x2d9bc0[_0x1c75('0x3e')]);var _0x19530d={'where':_0x529d3d['where']};return db[_0x1c75('0x2b')][_0x1c75('0x1c')](_0x19530d)[_0x1c75('0x3f')](function(_0x51ac6d){_0x4b12b1[_0x1c75('0x1c')]=_0x51ac6d;if(_0x2d9bc0[_0x1c75('0x36')][_0x1c75('0x40')]){_0x529d3d[_0x1c75('0x41')]=[{'all':!![]}];}return db['IntegrationReport'][_0x1c75('0x42')](_0x529d3d);})[_0x1c75('0x3f')](function(_0xfdff3b){_0x4b12b1[_0x1c75('0x43')]=_0xfdff3b;return _0x4b12b1;})[_0x1c75('0x3f')](respondWithFilteredResult(_0x4cf0c4,_0x529d3d))[_0x1c75('0x44')](handleError(_0x4cf0c4,null));};exports[_0x1c75('0x45')]=function(_0x9e554f,_0x5b8251){var _0x5ad7af={'raw':![],'where':{'id':_0x9e554f[_0x1c75('0x46')]['id']}},_0x5b6a72={};_0x5b6a72[_0x1c75('0x2f')]=_['keys'](db['IntegrationReport']['rawAttributes']);_0x5b6a72['query']=_[_0x1c75('0x47')](_0x9e554f[_0x1c75('0x36')]);_0x5b6a72[_0x1c75('0x31')]=_[_0x1c75('0x32')](_0x5b6a72[_0x1c75('0x2f')],_0x5b6a72[_0x1c75('0x36')]);_0x5ad7af[_0x1c75('0x33')]=_['intersection'](_0x5b6a72[_0x1c75('0x2f')],qs[_0x1c75('0x34')](_0x9e554f['query'][_0x1c75('0x34')]));_0x5ad7af['attributes']=_0x5ad7af[_0x1c75('0x33')]['length']?_0x5ad7af[_0x1c75('0x33')]:_0x5b6a72['model'];if(_0x9e554f[_0x1c75('0x36')][_0x1c75('0x40')]){_0x5ad7af[_0x1c75('0x41')]=[{'all':!![]}];}_0x5ad7af=_[_0x1c75('0x3d')]({},_0x5ad7af,_0x9e554f['options']);return db[_0x1c75('0x2b')][_0x1c75('0x48')](_0x5ad7af)[_0x1c75('0x3f')](handleEntityNotFound(_0x5b8251,null))[_0x1c75('0x3f')](respondWithResult(_0x5b8251,null))[_0x1c75('0x44')](handleError(_0x5b8251,null));};exports[_0x1c75('0x49')]=function(_0x2a7e06,_0x2b9d4a){return db['IntegrationReport'][_0x1c75('0x49')](_0x2a7e06[_0x1c75('0x4a')],{})[_0x1c75('0x3f')](respondWithResult(_0x2b9d4a,0xc9))[_0x1c75('0x44')](handleError(_0x2b9d4a,null));};exports['update']=function(_0x50c3ff,_0x284c39){if(_0x50c3ff[_0x1c75('0x4a')]['id']){delete _0x50c3ff[_0x1c75('0x4a')]['id'];}return db[_0x1c75('0x2b')]['find']({'where':{'id':_0x50c3ff[_0x1c75('0x46')]['id']}})['then'](handleEntityNotFound(_0x284c39,null))[_0x1c75('0x3f')](saveUpdates(_0x50c3ff['body'],null))[_0x1c75('0x3f')](respondWithResult(_0x284c39,null))[_0x1c75('0x44')](handleError(_0x284c39,null));};exports['destroy']=function(_0x1fb3db,_0x224a80){return db['IntegrationReport'][_0x1c75('0x48')]({'where':{'id':_0x1fb3db[_0x1c75('0x46')]['id']}})[_0x1c75('0x3f')](handleEntityNotFound(_0x224a80,null))['then'](removeEntity(_0x224a80,null))['catch'](handleError(_0x224a80,null));};exports[_0x1c75('0x4b')]=function(_0x563def,_0x59addf){return db[_0x1c75('0x2b')][_0x1c75('0x4b')]()[_0x1c75('0x3f')](respondWithResult(_0x59addf,null))['catch'](handleError(_0x59addf,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index bbf2ac5..99b4f26 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 _0x553f=['request-promise','rimraf','../../config/environment','define','report_integration','util','../../config/logger','moment','bluebird'];(function(_0x5f5cce,_0x138cc5){var _0x705ecf=function(_0x28bc5d){while(--_0x28bc5d){_0x5f5cce['push'](_0x5f5cce['shift']());}};_0x705ecf(++_0x138cc5);}(_0x553f,0xd4));var _0xf553=function(_0x580f11,_0x1c271c){_0x580f11=_0x580f11-0x0;var _0x231596=_0x553f[_0x580f11];return _0x231596;};'use strict';var _=require('lodash');var util=require(_0xf553('0x0'));var logger=require(_0xf553('0x1'))('api');var moment=require(_0xf553('0x2'));var BPromise=require(_0xf553('0x3'));var rp=require(_0xf553('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf553('0x5'));var config=require(_0xf553('0x6'));var attributes=require('./integrationReport.attributes');module['exports']=function(_0x1c6f1b,_0x420391){return _0x1c6f1b[_0xf553('0x7')]('IntegrationReport',attributes,{'tableName':_0xf553('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9ff8=['report_integration','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','define'];(function(_0x1809c5,_0x46cabc){var _0x5254a4=function(_0xd1d319){while(--_0xd1d319){_0x1809c5['push'](_0x1809c5['shift']());}};_0x5254a4(++_0x46cabc);}(_0x9ff8,0x79));var _0x89ff=function(_0x1243f4,_0x212a75){_0x1243f4=_0x1243f4-0x0;var _0x28c549=_0x9ff8[_0x1243f4];return _0x28c549;};'use strict';var _=require('lodash');var util=require(_0x89ff('0x0'));var logger=require(_0x89ff('0x1'))(_0x89ff('0x2'));var moment=require('moment');var BPromise=require(_0x89ff('0x3'));var rp=require(_0x89ff('0x4'));var fs=require('fs');var path=require(_0x89ff('0x5'));var rimraf=require(_0x89ff('0x6'));var config=require(_0x89ff('0x7'));var attributes=require('./integrationReport.attributes');module['exports']=function(_0x540d47,_0x9ce2ad){return _0x540d47[_0x89ff('0x8')]('IntegrationReport',attributes,{'tableName':_0x89ff('0x9'),'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 7993321..f614022 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 _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x53ec,0x192));var _0xc53e=function(_0x2ea174,_0xb3181){_0x2ea174=_0x2ea174-0x0;var _0x5987c7=_0x53ec[_0x2ea174];return _0x5987c7;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});} \ No newline at end of file +var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','IntegrationReport,\x20%s,\x20%s','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x165fa0,_0x3a25a9){var _0x5d58bb=function(_0x2dfaee){while(--_0x2dfaee){_0x165fa0['push'](_0x165fa0['shift']());}};_0x5d58bb(++_0x3a25a9);}(_0x2ef3,0xba));var _0x32ef=function(_0x1e2b69,_0x5781eb){_0x1e2b69=_0x1e2b69-0x0;var _0x8d585c=_0x2ef3[_0x1e2b69];return _0x8d585c;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('IntegrationReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('IntegrationReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 85166fb..aa723f4 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 _0xac0a=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','delete','destroy','exports','path','connect-timeout'];(function(_0x4f0c70,_0x423608){var _0x1a20ba=function(_0x3f2636){while(--_0x3f2636){_0x4f0c70['push'](_0x4f0c70['shift']());}};_0x1a20ba(++_0x423608);}(_0xac0a,0x11e));var _0xaac0=function(_0x23af57,_0x279ce6){_0x23af57=_0x23af57-0x0;var _0xa9170c=_0xac0a[_0x23af57];return _0xa9170c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xaac0('0x0'));var timeout=require(_0xaac0('0x1'));var express=require('express');var router=express[_0xaac0('0x2')]();var fs_extra=require(_0xaac0('0x3'));var auth=require(_0xaac0('0x4'));var interaction=require(_0xaac0('0x5'));var config=require(_0xaac0('0x6'));var controller=require(_0xaac0('0x7'));router[_0xaac0('0x8')]('/',auth[_0xaac0('0x9')](),controller[_0xaac0('0xa')]);router[_0xaac0('0x8')](_0xaac0('0xb'),auth[_0xaac0('0x9')](),controller['show']);router[_0xaac0('0x8')](_0xaac0('0xc'),auth['isAuthenticated'](),controller[_0xaac0('0xd')]);router[_0xaac0('0xe')]('/',auth[_0xaac0('0x9')](),controller[_0xaac0('0xf')]);router[_0xaac0('0xe')](_0xaac0('0xc'),auth[_0xaac0('0x9')](),controller[_0xaac0('0x10')]);router[_0xaac0('0xe')](_0xaac0('0x11'),auth[_0xaac0('0x9')](),controller[_0xaac0('0x12')]);router[_0xaac0('0x13')](_0xaac0('0xb'),auth[_0xaac0('0x9')](),controller[_0xaac0('0x14')]);router[_0xaac0('0x15')](_0xaac0('0xb'),auth[_0xaac0('0x9')](),controller[_0xaac0('0x16')]);module[_0xaac0('0x17')]=router; \ No newline at end of file +var _0x5692=['post','addIntervals','put','delete','/:id','destroy','exports','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','show','/:id/sub_intervals','getIntervals','addInterval'];(function(_0x9ac89b,_0x25b61d){var _0x40da74=function(_0x2643a2){while(--_0x2643a2){_0x9ac89b['push'](_0x9ac89b['shift']());}};_0x40da74(++_0x25b61d);}(_0x5692,0x8b));var _0x2569=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x5692[_0x126558];return _0x1f6d14;};'use strict';var multer=require('multer');var util=require(_0x2569('0x0'));var path=require(_0x2569('0x1'));var timeout=require('connect-timeout');var express=require(_0x2569('0x2'));var router=express[_0x2569('0x3')]();var fs_extra=require(_0x2569('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2569('0x5'));var config=require(_0x2569('0x6'));var controller=require(_0x2569('0x7'));router[_0x2569('0x8')]('/',auth[_0x2569('0x9')](),controller[_0x2569('0xa')]);router[_0x2569('0x8')]('/:id',auth[_0x2569('0x9')](),controller[_0x2569('0xb')]);router['get'](_0x2569('0xc'),auth[_0x2569('0x9')](),controller[_0x2569('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x2569('0xc'),auth['isAuthenticated'](),controller[_0x2569('0xe')]);router[_0x2569('0xf')]('/:id/sub_intervals/create_many',auth['isAuthenticated'](),controller[_0x2569('0x10')]);router[_0x2569('0x11')]('/:id',auth[_0x2569('0x9')](),controller['update']);router[_0x2569('0x12')](_0x2569('0x13'),auth[_0x2569('0x9')](),controller[_0x2569('0x14')]);module[_0x2569('0x15')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 15a9733..b5bbd6e 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 _0x5aa3=['exports','STRING','sequelize'];(function(_0x140327,_0x4ff244){var _0x46f126=function(_0x36568c){while(--_0x36568c){_0x140327['push'](_0x140327['shift']());}};_0x46f126(++_0x4ff244);}(_0x5aa3,0x179));var _0x35aa=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0x5aa3[_0x87b0ff];return _0x3bc0b2;};'use strict';var Sequelize=require(_0x35aa('0x0'));module[_0x35aa('0x1')]={'name':{'type':Sequelize[_0x35aa('0x2')]},'description':{'type':Sequelize[_0x35aa('0x2')]},'interval':{'type':Sequelize[_0x35aa('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x4297=['sequelize','STRING'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x4297,0x1b6));var _0x7429=function(_0x497df2,_0x2a44a4){_0x497df2=_0x497df2-0x0;var _0x460db7=_0x4297[_0x497df2];return _0x460db7;};'use strict';var Sequelize=require(_0x7429('0x0'));module['exports']={'name':{'type':Sequelize[_0x7429('0x1')]},'description':{'type':Sequelize[_0x7429('0x1')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index ed4e7ad..8fee8b9 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 _0xf9d3=['body','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','getIntervals','order','sequelize','transaction','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','update','destroy','then','get','Intervals','UserProfileResource','name','send','index','Interval','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','params','keys','options','find','create'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0xf9d3,0x1bf));var _0x3f9d=function(_0x2fb051,_0x5b2cb6){_0x2fb051=_0x2fb051-0x0;var _0x5609aa=_0xf9d3[_0x2fb051];return _0x5609aa;};'use strict';var emlformat=require(_0x3f9d('0x0'));var rimraf=require(_0x3f9d('0x1'));var zipdir=require(_0x3f9d('0x2'));var jsonpatch=require(_0x3f9d('0x3'));var rp=require(_0x3f9d('0x4'));var moment=require(_0x3f9d('0x5'));var BPromise=require(_0x3f9d('0x6'));var Mustache=require(_0x3f9d('0x7'));var util=require(_0x3f9d('0x8'));var path=require(_0x3f9d('0x9'));var sox=require(_0x3f9d('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3f9d('0xb'));var _=require(_0x3f9d('0xc'));var squel=require('squel');var crypto=require(_0x3f9d('0xd'));var jsforce=require(_0x3f9d('0xe'));var deskjs=require(_0x3f9d('0xf'));var toCsv=require(_0x3f9d('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3f9d('0x11'));var authService=require(_0x3f9d('0x12'));var qs=require(_0x3f9d('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3f9d('0x14'))(_0x3f9d('0x15'));var utils=require(_0x3f9d('0x16'));var config=require(_0x3f9d('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x3f9d('0x18'))['db'];var extensions=require(_0x3f9d('0x19'));function respondWithStatusCode(_0xdc35ba,_0x1f89cf){_0x1f89cf=_0x1f89cf||0xcc;return function(_0x1451a5){if(_0x1451a5){return _0xdc35ba['sendStatus'](_0x1f89cf);}return _0xdc35ba[_0x3f9d('0x1a')](_0x1f89cf)[_0x3f9d('0x1b')]();};}function respondWithResult(_0x2a93c9,_0xa0d345){_0xa0d345=_0xa0d345||0xc8;return function(_0x282745){if(_0x282745){return _0x2a93c9[_0x3f9d('0x1a')](_0xa0d345)['json'](_0x282745);}};}function respondWithFilteredResult(_0x57e169,_0x5a58bb){return function(_0x17138c){if(_0x17138c){var _0x1b2d3e=typeof _0x5a58bb[_0x3f9d('0x1c')]==='undefined'&&typeof _0x5a58bb['limit']===_0x3f9d('0x1d');var _0x211d2f=_0x17138c[_0x3f9d('0x1e')];var _0x25f6f0=_0x1b2d3e?0x0:_0x5a58bb['offset'];var _0x9e647e=_0x1b2d3e?_0x17138c['count']:_0x5a58bb[_0x3f9d('0x1c')]+_0x5a58bb[_0x3f9d('0x1f')];var _0x251445;if(_0x9e647e>=_0x211d2f){_0x9e647e=_0x211d2f;_0x251445=0xc8;}else{_0x251445=0xce;}_0x57e169[_0x3f9d('0x1a')](_0x251445);return _0x57e169[_0x3f9d('0x20')](_0x3f9d('0x21'),_0x25f6f0+'-'+_0x9e647e+'/'+_0x211d2f)[_0x3f9d('0x22')](_0x17138c);}return null;};}function patchUpdates(_0x42e9d4){return function(_0x23913f){try{jsonpatch['apply'](_0x23913f,_0x42e9d4,!![]);}catch(_0x41d7b1){return BPromise[_0x3f9d('0x23')](_0x41d7b1);}return _0x23913f['save']();};}function saveUpdates(_0x418b91,_0x4c42b1){return function(_0x3aa9b7){if(_0x3aa9b7){return _0x3aa9b7[_0x3f9d('0x24')](_0x418b91)['then'](function(_0x3ec3ad){return _0x3ec3ad;});}return null;};}function removeEntity(_0x532c1a,_0x950f27){return function(_0x4662f9){if(_0x4662f9){return _0x4662f9[_0x3f9d('0x25')]()[_0x3f9d('0x26')](function(){var _0x311cdf=_0x4662f9[_0x3f9d('0x27')]({'plain':!![]});var _0x56c68a=_0x3f9d('0x28');return db[_0x3f9d('0x29')][_0x3f9d('0x25')]({'where':{'type':_0x56c68a,'resourceId':_0x311cdf['id']}})[_0x3f9d('0x26')](function(){return _0x4662f9;});})['then'](function(){_0x532c1a['status'](0xcc)[_0x3f9d('0x1b')]();});}};}function handleEntityNotFound(_0x77e81e,_0xa64976){return function(_0x258fd4){if(!_0x258fd4){_0x77e81e['sendStatus'](0x194);}return _0x258fd4;};}function handleError(_0x9ff699,_0x217a29){_0x217a29=_0x217a29||0x1f4;return function(_0x1b4bfd){logger['error'](_0x1b4bfd['stack']);if(_0x1b4bfd[_0x3f9d('0x2a')]){delete _0x1b4bfd[_0x3f9d('0x2a')];}_0x9ff699[_0x3f9d('0x1a')](_0x217a29)[_0x3f9d('0x2b')](_0x1b4bfd);};}exports[_0x3f9d('0x2c')]=function(_0x6e4fd1,_0x2e862b){var _0x2f2ca9={},_0x52aef1={},_0x4ad1a6={'count':0x0,'rows':[]};var _0x3cdc5f=_['map'](db[_0x3f9d('0x2d')][_0x3f9d('0x2e')],function(_0x335b58){return{'name':_0x335b58[_0x3f9d('0x2f')],'type':_0x335b58[_0x3f9d('0x30')][_0x3f9d('0x31')]};});_0x52aef1[_0x3f9d('0x32')]=_[_0x3f9d('0x33')](_0x3cdc5f,_0x3f9d('0x2a'));_0x52aef1[_0x3f9d('0x34')]=_['keys'](_0x6e4fd1[_0x3f9d('0x34')]);_0x52aef1[_0x3f9d('0x35')]=_['intersection'](_0x52aef1[_0x3f9d('0x32')],_0x52aef1[_0x3f9d('0x34')]);_0x2f2ca9[_0x3f9d('0x36')]=_[_0x3f9d('0x37')](_0x52aef1[_0x3f9d('0x32')],qs[_0x3f9d('0x38')](_0x6e4fd1[_0x3f9d('0x34')]['fields']));_0x2f2ca9['attributes']=_0x2f2ca9[_0x3f9d('0x36')][_0x3f9d('0x39')]?_0x2f2ca9[_0x3f9d('0x36')]:_0x52aef1[_0x3f9d('0x32')];if(!_0x6e4fd1[_0x3f9d('0x34')][_0x3f9d('0x3a')](_0x3f9d('0x3b'))){_0x2f2ca9[_0x3f9d('0x1f')]=qs[_0x3f9d('0x1f')](_0x6e4fd1[_0x3f9d('0x34')]['limit']);_0x2f2ca9['offset']=qs[_0x3f9d('0x1c')](_0x6e4fd1[_0x3f9d('0x34')][_0x3f9d('0x1c')]);}_0x2f2ca9['order']=qs[_0x3f9d('0x3c')](_0x6e4fd1['query']['sort']);_0x2f2ca9[_0x3f9d('0x3d')]=qs[_0x3f9d('0x35')](_[_0x3f9d('0x3e')](_0x6e4fd1[_0x3f9d('0x34')],_0x52aef1['filters']),_0x3cdc5f);if(_0x6e4fd1[_0x3f9d('0x34')][_0x3f9d('0x3f')]){_0x2f2ca9[_0x3f9d('0x3d')]=_[_0x3f9d('0x40')](_0x2f2ca9[_0x3f9d('0x3d')],{'$or':_[_0x3f9d('0x33')](_0x3cdc5f,function(_0xa2d0a1){if(_0xa2d0a1[_0x3f9d('0x30')]!==_0x3f9d('0x41')){var _0xd66660={};_0xd66660[_0xa2d0a1[_0x3f9d('0x2a')]]={'$like':'%'+_0x6e4fd1[_0x3f9d('0x34')]['filter']+'%'};return _0xd66660;}})});}_0x2f2ca9=_[_0x3f9d('0x40')]({},_0x2f2ca9,_0x6e4fd1['options']);var _0x1bf42b={'where':_0x2f2ca9[_0x3f9d('0x3d')]};return db[_0x3f9d('0x2d')][_0x3f9d('0x1e')](_0x1bf42b)['then'](function(_0xdc6512){_0x4ad1a6[_0x3f9d('0x1e')]=_0xdc6512;if(_0x6e4fd1[_0x3f9d('0x34')][_0x3f9d('0x42')]){_0x2f2ca9[_0x3f9d('0x43')]=[{'all':!![]}];}return db['Interval']['findAll'](_0x2f2ca9);})[_0x3f9d('0x26')](function(_0x24a23c){_0x4ad1a6[_0x3f9d('0x44')]=_0x24a23c;return _0x4ad1a6;})[_0x3f9d('0x26')](respondWithFilteredResult(_0x2e862b,_0x2f2ca9))[_0x3f9d('0x45')](handleError(_0x2e862b,null));};exports['show']=function(_0x2241f0,_0x119e6b){var _0x46574a={'raw':!![],'where':{'id':_0x2241f0[_0x3f9d('0x46')]['id']}},_0x470c15={};_0x470c15[_0x3f9d('0x32')]=_['keys'](db['Interval'][_0x3f9d('0x2e')]);_0x470c15[_0x3f9d('0x34')]=_[_0x3f9d('0x47')](_0x2241f0[_0x3f9d('0x34')]);_0x470c15['filters']=_[_0x3f9d('0x37')](_0x470c15['model'],_0x470c15[_0x3f9d('0x34')]);_0x46574a['attributes']=_['intersection'](_0x470c15[_0x3f9d('0x32')],qs['fields'](_0x2241f0[_0x3f9d('0x34')][_0x3f9d('0x38')]));_0x46574a['attributes']=_0x46574a[_0x3f9d('0x36')][_0x3f9d('0x39')]?_0x46574a[_0x3f9d('0x36')]:_0x470c15[_0x3f9d('0x32')];if(_0x2241f0[_0x3f9d('0x34')]['includeAll']){_0x46574a[_0x3f9d('0x43')]=[{'all':!![]}];}_0x46574a=_[_0x3f9d('0x40')]({},_0x46574a,_0x2241f0[_0x3f9d('0x48')]);return db[_0x3f9d('0x2d')][_0x3f9d('0x49')](_0x46574a)[_0x3f9d('0x26')](handleEntityNotFound(_0x119e6b,null))['then'](respondWithResult(_0x119e6b,null))[_0x3f9d('0x45')](handleError(_0x119e6b,null));};exports[_0x3f9d('0x4a')]=function(_0x207ac1,_0x499a00){return db[_0x3f9d('0x2d')][_0x3f9d('0x4a')](_0x207ac1[_0x3f9d('0x4b')],{})[_0x3f9d('0x26')](function(_0x5d4d1e){var _0x4ec0a7=_0x207ac1[_0x3f9d('0x4c')][_0x3f9d('0x27')]({'plain':!![]});if(!_0x4ec0a7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ec0a7[_0x3f9d('0x4d')]===_0x3f9d('0x4c')){var _0x5e878c=_0x5d4d1e[_0x3f9d('0x27')]({'plain':!![]});var _0x1d77d4=_0x3f9d('0x28');return db[_0x3f9d('0x4e')][_0x3f9d('0x49')]({'where':{'name':_0x1d77d4,'userProfileId':_0x4ec0a7[_0x3f9d('0x4f')]},'raw':!![]})[_0x3f9d('0x26')](function(_0x26cb49){if(_0x26cb49&&_0x26cb49['autoAssociation']===0x0){return db[_0x3f9d('0x29')][_0x3f9d('0x4a')]({'name':_0x5e878c['name'],'resourceId':_0x5e878c['id'],'type':_0x26cb49[_0x3f9d('0x2a')],'sectionId':_0x26cb49['id']},{})['then'](function(){return _0x5d4d1e;});}else{return _0x5d4d1e;}})[_0x3f9d('0x45')](function(_0xca229b){logger['error'](_0x3f9d('0x50'),_0xca229b);throw _0xca229b;});}return _0x5d4d1e;})[_0x3f9d('0x26')](respondWithResult(_0x499a00,0xc9))['catch'](handleError(_0x499a00,null));};exports[_0x3f9d('0x24')]=function(_0x160763,_0x5cb7bb){if(_0x160763[_0x3f9d('0x4b')]['id']){delete _0x160763['body']['id'];}return db['Interval'][_0x3f9d('0x49')]({'where':{'id':_0x160763['params']['id']}})[_0x3f9d('0x26')](handleEntityNotFound(_0x5cb7bb,null))['then'](saveUpdates(_0x160763['body'],null))[_0x3f9d('0x26')](respondWithResult(_0x5cb7bb,null))[_0x3f9d('0x45')](handleError(_0x5cb7bb,null));};exports[_0x3f9d('0x25')]=function(_0x3d8587,_0xa67745){return db[_0x3f9d('0x2d')][_0x3f9d('0x49')]({'where':{'id':_0x3d8587[_0x3f9d('0x46')]['id']}})[_0x3f9d('0x26')](handleEntityNotFound(_0xa67745,null))[_0x3f9d('0x26')](removeEntity(_0xa67745,null))[_0x3f9d('0x45')](handleError(_0xa67745,null));};exports[_0x3f9d('0x51')]=function(_0xb086a6,_0x5184ce,_0x66d044){if(_0xb086a6[_0x3f9d('0x4b')]['id']){delete _0xb086a6[_0x3f9d('0x4b')]['id'];}return db['Interval'][_0x3f9d('0x49')]({'where':{'id':_0xb086a6['params']['id']}})[_0x3f9d('0x26')](handleEntityNotFound(_0x5184ce,null))[_0x3f9d('0x26')](function(_0x4b11a3){if(_0x4b11a3){_0xb086a6['body'][_0x3f9d('0x52')]=_0x4b11a3['id'];return db['Interval'][_0x3f9d('0x4a')](_0xb086a6[_0x3f9d('0x4b')]);}})[_0x3f9d('0x26')](respondWithResult(_0x5184ce,null))[_0x3f9d('0x45')](handleError(_0x5184ce,null));};exports[_0x3f9d('0x53')]=function(_0x2fefbc,_0x298966,_0x477cb6){var _0x4c11ae={};var _0xbd91d7={};var _0x5f507e;var _0x31b933;return db[_0x3f9d('0x2d')]['findOne']({'where':{'id':_0x2fefbc[_0x3f9d('0x46')]['id']}})['then'](handleEntityNotFound(_0x298966,null))[_0x3f9d('0x26')](function(_0x6f93e9){if(_0x6f93e9){_0x5f507e=_0x6f93e9;_0xbd91d7[_0x3f9d('0x32')]=_['keys'](db[_0x3f9d('0x2d')][_0x3f9d('0x2e')]);_0xbd91d7[_0x3f9d('0x34')]=_[_0x3f9d('0x47')](_0x2fefbc[_0x3f9d('0x34')]);_0xbd91d7[_0x3f9d('0x35')]=_[_0x3f9d('0x37')](_0xbd91d7['model'],_0xbd91d7[_0x3f9d('0x34')]);_0x4c11ae[_0x3f9d('0x36')]=_[_0x3f9d('0x37')](_0xbd91d7['model'],qs[_0x3f9d('0x38')](_0x2fefbc[_0x3f9d('0x34')][_0x3f9d('0x38')]));_0x4c11ae[_0x3f9d('0x36')]=_0x4c11ae[_0x3f9d('0x36')][_0x3f9d('0x39')]?_0x4c11ae[_0x3f9d('0x36')]:_0xbd91d7[_0x3f9d('0x32')];_0x4c11ae[_0x3f9d('0x54')]=qs[_0x3f9d('0x3c')](_0x2fefbc[_0x3f9d('0x34')][_0x3f9d('0x3c')]);_0x4c11ae[_0x3f9d('0x3d')]=qs[_0x3f9d('0x35')](_[_0x3f9d('0x3e')](_0x2fefbc[_0x3f9d('0x34')],_0xbd91d7['filters']));if(_0x2fefbc['query'][_0x3f9d('0x3f')]){_0x4c11ae[_0x3f9d('0x3d')]=_[_0x3f9d('0x40')](_0x4c11ae[_0x3f9d('0x3d')],{'$or':_[_0x3f9d('0x33')](_0x4c11ae['attributes'],function(_0x4898c9){var _0x2be958={};_0x2be958[_0x4898c9]={'$like':'%'+_0x2fefbc[_0x3f9d('0x34')]['filter']+'%'};return _0x2be958;})});}_0x4c11ae=_[_0x3f9d('0x40')]({},_0x4c11ae,_0x2fefbc[_0x3f9d('0x48')]);return _0x5f507e[_0x3f9d('0x53')](_0x4c11ae);}})[_0x3f9d('0x26')](function(_0x4e0917){if(_0x4e0917){_0x31b933=_0x4e0917[_0x3f9d('0x39')];if(!_0x2fefbc[_0x3f9d('0x34')][_0x3f9d('0x3a')](_0x3f9d('0x3b'))){_0x4c11ae[_0x3f9d('0x1f')]=qs[_0x3f9d('0x1f')](_0x2fefbc[_0x3f9d('0x34')][_0x3f9d('0x1f')]);_0x4c11ae[_0x3f9d('0x1c')]=qs[_0x3f9d('0x1c')](_0x2fefbc[_0x3f9d('0x34')][_0x3f9d('0x1c')]);}return _0x5f507e['getIntervals'](_0x4c11ae);}})[_0x3f9d('0x26')](function(_0x280146){if(_0x280146){return _0x280146?{'count':_0x31b933,'rows':_0x280146}:null;}})[_0x3f9d('0x26')](respondWithResult(_0x298966,null))[_0x3f9d('0x45')](handleError(_0x298966,null));};exports['addIntervals']=function(_0x216b04,_0x27124f,_0x2364b9){return db[_0x3f9d('0x2d')]['findOne']({'where':{'id':_0x216b04[_0x3f9d('0x46')]['id']}})['then'](handleEntityNotFound(_0x27124f,null))[_0x3f9d('0x26')](function(_0x34697d){if(_0x34697d){return db[_0x3f9d('0x55')][_0x3f9d('0x56')](function(_0x68f51a){return db[_0x3f9d('0x2d')][_0x3f9d('0x25')]({'where':{'IntervalId':_0x216b04[_0x3f9d('0x46')]['id']},'transaction':_0x68f51a})[_0x3f9d('0x26')](function(_0x2911e5){var _0x3d6ec1=_[_0x3f9d('0x33')](_0x216b04[_0x3f9d('0x4b')],function(_0x55532d){delete _0x55532d['id'];_0x55532d[_0x3f9d('0x52')]=_0x216b04[_0x3f9d('0x46')]['id'];return _0x55532d;});return db[_0x3f9d('0x2d')]['bulkCreate'](_0x3d6ec1,{'transaction':_0x68f51a});});})[_0x3f9d('0x26')](function(){return db[_0x3f9d('0x2d')]['findAll']({'where':{'IntervalId':_0x216b04[_0x3f9d('0x46')]['id']}});});}})[_0x3f9d('0x26')](respondWithResult(_0x27124f,null))['catch'](handleError(_0x27124f,null));}; \ No newline at end of file +var _0xb68e=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','addInterval','IntervalId','getIntervals','findOne','length','sort','nolimit','addIntervals','sequelize','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','status','end','json','undefined','count','offset','set','Content-Range','reject','save','update','then','destroy','get','Intervals','UserProfileResource','stack','name','send','index','map','Interval','rawAttributes','fieldName','query','keys','filters','intersection','attributes','fields','model','hasOwnProperty','limit','order','where','pick','type','VIRTUAL','filter','merge','options','findAll','rows','catch','params','include','find'];(function(_0x4b9a3c,_0x40898a){var _0x4c16e9=function(_0x20d018){while(--_0x20d018){_0x4b9a3c['push'](_0x4b9a3c['shift']());}};_0x4c16e9(++_0x40898a);}(_0xb68e,0x122));var _0xeb68=function(_0x169845,_0x33d35b){_0x169845=_0x169845-0x0;var _0x45fc96=_0xb68e[_0x169845];return _0x45fc96;};'use strict';var emlformat=require(_0xeb68('0x0'));var rimraf=require(_0xeb68('0x1'));var zipdir=require(_0xeb68('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xeb68('0x3'));var moment=require('moment');var BPromise=require(_0xeb68('0x4'));var Mustache=require(_0xeb68('0x5'));var util=require(_0xeb68('0x6'));var path=require(_0xeb68('0x7'));var sox=require(_0xeb68('0x8'));var csv=require('to-csv');var ejs=require(_0xeb68('0x9'));var fs=require('fs');var fs_extra=require(_0xeb68('0xa'));var _=require(_0xeb68('0xb'));var squel=require(_0xeb68('0xc'));var crypto=require(_0xeb68('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xeb68('0xe'));var toCsv=require('to-csv');var querystring=require(_0xeb68('0xf'));var Papa=require(_0xeb68('0x10'));var Redis=require(_0xeb68('0x11'));var authService=require(_0xeb68('0x12'));var qs=require(_0xeb68('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xeb68('0x14'));var logger=require('../../config/logger')(_0xeb68('0x15'));var utils=require(_0xeb68('0x16'));var config=require(_0xeb68('0x17'));var licenseUtil=require(_0xeb68('0x18'));var db=require(_0xeb68('0x19'))['db'];var extensions=require(_0xeb68('0x1a'));function respondWithStatusCode(_0x4a4746,_0x301001){_0x301001=_0x301001||0xcc;return function(_0x228769){if(_0x228769){return _0x4a4746['sendStatus'](_0x301001);}return _0x4a4746[_0xeb68('0x1b')](_0x301001)[_0xeb68('0x1c')]();};}function respondWithResult(_0x4d3a2a,_0x3ed07a){_0x3ed07a=_0x3ed07a||0xc8;return function(_0x5f0799){if(_0x5f0799){return _0x4d3a2a['status'](_0x3ed07a)[_0xeb68('0x1d')](_0x5f0799);}};}function respondWithFilteredResult(_0xe3967a,_0x37da52){return function(_0x23e9e5){if(_0x23e9e5){var _0x5a6236=typeof _0x37da52['offset']==='undefined'&&typeof _0x37da52['limit']===_0xeb68('0x1e');var _0x397f7c=_0x23e9e5[_0xeb68('0x1f')];var _0x3c9b4d=_0x5a6236?0x0:_0x37da52['offset'];var _0x40300a=_0x5a6236?_0x23e9e5['count']:_0x37da52[_0xeb68('0x20')]+_0x37da52['limit'];var _0x2e28e3;if(_0x40300a>=_0x397f7c){_0x40300a=_0x397f7c;_0x2e28e3=0xc8;}else{_0x2e28e3=0xce;}_0xe3967a[_0xeb68('0x1b')](_0x2e28e3);return _0xe3967a[_0xeb68('0x21')](_0xeb68('0x22'),_0x3c9b4d+'-'+_0x40300a+'/'+_0x397f7c)[_0xeb68('0x1d')](_0x23e9e5);}return null;};}function patchUpdates(_0x111451){return function(_0x35986b){try{jsonpatch['apply'](_0x35986b,_0x111451,!![]);}catch(_0x152278){return BPromise[_0xeb68('0x23')](_0x152278);}return _0x35986b[_0xeb68('0x24')]();};}function saveUpdates(_0x2ac6ce,_0x2321fc){return function(_0x2531a5){if(_0x2531a5){return _0x2531a5[_0xeb68('0x25')](_0x2ac6ce)[_0xeb68('0x26')](function(_0xaa580c){return _0xaa580c;});}return null;};}function removeEntity(_0x5b4545,_0x178817){return function(_0x1c6df0){if(_0x1c6df0){return _0x1c6df0[_0xeb68('0x27')]()[_0xeb68('0x26')](function(){var _0x4df0e0=_0x1c6df0[_0xeb68('0x28')]({'plain':!![]});var _0x31c2bb=_0xeb68('0x29');return db[_0xeb68('0x2a')][_0xeb68('0x27')]({'where':{'type':_0x31c2bb,'resourceId':_0x4df0e0['id']}})[_0xeb68('0x26')](function(){return _0x1c6df0;});})[_0xeb68('0x26')](function(){_0x5b4545[_0xeb68('0x1b')](0xcc)[_0xeb68('0x1c')]();});}};}function handleEntityNotFound(_0x8be6c5,_0x4cac0a){return function(_0x502e76){if(!_0x502e76){_0x8be6c5['sendStatus'](0x194);}return _0x502e76;};}function handleError(_0x5d2053,_0x25940b){_0x25940b=_0x25940b||0x1f4;return function(_0x414a51){logger['error'](_0x414a51[_0xeb68('0x2b')]);if(_0x414a51[_0xeb68('0x2c')]){delete _0x414a51[_0xeb68('0x2c')];}_0x5d2053[_0xeb68('0x1b')](_0x25940b)[_0xeb68('0x2d')](_0x414a51);};}exports[_0xeb68('0x2e')]=function(_0x3b5e62,_0x213df2){var _0x61e549={},_0x6f045e={},_0x4b145e={'count':0x0,'rows':[]};var _0x22a33f=_[_0xeb68('0x2f')](db[_0xeb68('0x30')][_0xeb68('0x31')],function(_0x307659){return{'name':_0x307659[_0xeb68('0x32')],'type':_0x307659['type']['key']};});_0x6f045e['model']=_[_0xeb68('0x2f')](_0x22a33f,_0xeb68('0x2c'));_0x6f045e[_0xeb68('0x33')]=_[_0xeb68('0x34')](_0x3b5e62['query']);_0x6f045e[_0xeb68('0x35')]=_[_0xeb68('0x36')](_0x6f045e['model'],_0x6f045e['query']);_0x61e549[_0xeb68('0x37')]=_['intersection'](_0x6f045e['model'],qs['fields'](_0x3b5e62[_0xeb68('0x33')][_0xeb68('0x38')]));_0x61e549[_0xeb68('0x37')]=_0x61e549[_0xeb68('0x37')]['length']?_0x61e549[_0xeb68('0x37')]:_0x6f045e[_0xeb68('0x39')];if(!_0x3b5e62[_0xeb68('0x33')][_0xeb68('0x3a')]('nolimit')){_0x61e549[_0xeb68('0x3b')]=qs[_0xeb68('0x3b')](_0x3b5e62[_0xeb68('0x33')][_0xeb68('0x3b')]);_0x61e549[_0xeb68('0x20')]=qs[_0xeb68('0x20')](_0x3b5e62[_0xeb68('0x33')][_0xeb68('0x20')]);}_0x61e549[_0xeb68('0x3c')]=qs['sort'](_0x3b5e62['query']['sort']);_0x61e549[_0xeb68('0x3d')]=qs[_0xeb68('0x35')](_[_0xeb68('0x3e')](_0x3b5e62[_0xeb68('0x33')],_0x6f045e[_0xeb68('0x35')]),_0x22a33f);if(_0x3b5e62[_0xeb68('0x33')]['filter']){_0x61e549[_0xeb68('0x3d')]=_['merge'](_0x61e549[_0xeb68('0x3d')],{'$or':_[_0xeb68('0x2f')](_0x22a33f,function(_0x4be157){if(_0x4be157[_0xeb68('0x3f')]!==_0xeb68('0x40')){var _0x46eca6={};_0x46eca6[_0x4be157[_0xeb68('0x2c')]]={'$like':'%'+_0x3b5e62[_0xeb68('0x33')][_0xeb68('0x41')]+'%'};return _0x46eca6;}})});}_0x61e549=_[_0xeb68('0x42')]({},_0x61e549,_0x3b5e62[_0xeb68('0x43')]);var _0x1bdd14={'where':_0x61e549[_0xeb68('0x3d')]};return db[_0xeb68('0x30')][_0xeb68('0x1f')](_0x1bdd14)['then'](function(_0x53c172){_0x4b145e[_0xeb68('0x1f')]=_0x53c172;if(_0x3b5e62[_0xeb68('0x33')]['includeAll']){_0x61e549['include']=[{'all':!![]}];}return db[_0xeb68('0x30')][_0xeb68('0x44')](_0x61e549);})[_0xeb68('0x26')](function(_0x2dcd4c){_0x4b145e[_0xeb68('0x45')]=_0x2dcd4c;return _0x4b145e;})['then'](respondWithFilteredResult(_0x213df2,_0x61e549))[_0xeb68('0x46')](handleError(_0x213df2,null));};exports['show']=function(_0x4cabcc,_0x28c629){var _0x269a5d={'raw':!![],'where':{'id':_0x4cabcc[_0xeb68('0x47')]['id']}},_0x1c655f={};_0x1c655f[_0xeb68('0x39')]=_['keys'](db[_0xeb68('0x30')][_0xeb68('0x31')]);_0x1c655f[_0xeb68('0x33')]=_[_0xeb68('0x34')](_0x4cabcc[_0xeb68('0x33')]);_0x1c655f[_0xeb68('0x35')]=_[_0xeb68('0x36')](_0x1c655f[_0xeb68('0x39')],_0x1c655f[_0xeb68('0x33')]);_0x269a5d[_0xeb68('0x37')]=_['intersection'](_0x1c655f[_0xeb68('0x39')],qs[_0xeb68('0x38')](_0x4cabcc[_0xeb68('0x33')][_0xeb68('0x38')]));_0x269a5d[_0xeb68('0x37')]=_0x269a5d['attributes']['length']?_0x269a5d[_0xeb68('0x37')]:_0x1c655f[_0xeb68('0x39')];if(_0x4cabcc[_0xeb68('0x33')]['includeAll']){_0x269a5d[_0xeb68('0x48')]=[{'all':!![]}];}_0x269a5d=_[_0xeb68('0x42')]({},_0x269a5d,_0x4cabcc['options']);return db[_0xeb68('0x30')][_0xeb68('0x49')](_0x269a5d)['then'](handleEntityNotFound(_0x28c629,null))[_0xeb68('0x26')](respondWithResult(_0x28c629,null))['catch'](handleError(_0x28c629,null));};exports[_0xeb68('0x4a')]=function(_0x1bee19,_0x5765e1){return db[_0xeb68('0x30')][_0xeb68('0x4a')](_0x1bee19[_0xeb68('0x4b')],{})[_0xeb68('0x26')](function(_0xee49cd){var _0x22c855=_0x1bee19[_0xeb68('0x4c')][_0xeb68('0x28')]({'plain':!![]});if(!_0x22c855)throw new Error(_0xeb68('0x4d'));if(_0x22c855[_0xeb68('0x4e')]==='user'){var _0x1f65b4=_0xee49cd['get']({'plain':!![]});var _0x6ce704=_0xeb68('0x29');return db[_0xeb68('0x4f')]['find']({'where':{'name':_0x6ce704,'userProfileId':_0x22c855[_0xeb68('0x50')]},'raw':!![]})['then'](function(_0x2611b4){if(_0x2611b4&&_0x2611b4['autoAssociation']===0x0){return db[_0xeb68('0x2a')][_0xeb68('0x4a')]({'name':_0x1f65b4[_0xeb68('0x2c')],'resourceId':_0x1f65b4['id'],'type':_0x2611b4[_0xeb68('0x2c')],'sectionId':_0x2611b4['id']},{})[_0xeb68('0x26')](function(){return _0xee49cd;});}else{return _0xee49cd;}})[_0xeb68('0x46')](function(_0x179210){logger[_0xeb68('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x179210);throw _0x179210;});}return _0xee49cd;})['then'](respondWithResult(_0x5765e1,0xc9))[_0xeb68('0x46')](handleError(_0x5765e1,null));};exports['update']=function(_0x42f6ea,_0x51caf1){if(_0x42f6ea['body']['id']){delete _0x42f6ea[_0xeb68('0x4b')]['id'];}return db['Interval'][_0xeb68('0x49')]({'where':{'id':_0x42f6ea[_0xeb68('0x47')]['id']}})['then'](handleEntityNotFound(_0x51caf1,null))[_0xeb68('0x26')](saveUpdates(_0x42f6ea[_0xeb68('0x4b')],null))[_0xeb68('0x26')](respondWithResult(_0x51caf1,null))['catch'](handleError(_0x51caf1,null));};exports[_0xeb68('0x27')]=function(_0x262def,_0x166308){return db[_0xeb68('0x30')][_0xeb68('0x49')]({'where':{'id':_0x262def[_0xeb68('0x47')]['id']}})[_0xeb68('0x26')](handleEntityNotFound(_0x166308,null))['then'](removeEntity(_0x166308,null))[_0xeb68('0x46')](handleError(_0x166308,null));};exports[_0xeb68('0x52')]=function(_0x89ba36,_0xd8e218,_0x17a2ea){if(_0x89ba36[_0xeb68('0x4b')]['id']){delete _0x89ba36[_0xeb68('0x4b')]['id'];}return db['Interval'][_0xeb68('0x49')]({'where':{'id':_0x89ba36[_0xeb68('0x47')]['id']}})[_0xeb68('0x26')](handleEntityNotFound(_0xd8e218,null))['then'](function(_0x1412d8){if(_0x1412d8){_0x89ba36[_0xeb68('0x4b')][_0xeb68('0x53')]=_0x1412d8['id'];return db[_0xeb68('0x30')][_0xeb68('0x4a')](_0x89ba36[_0xeb68('0x4b')]);}})[_0xeb68('0x26')](respondWithResult(_0xd8e218,null))[_0xeb68('0x46')](handleError(_0xd8e218,null));};exports[_0xeb68('0x54')]=function(_0x1bb0c6,_0x3106ce,_0x3813ec){var _0x380b7e={};var _0x5cf423={};var _0x556554;var _0x14f10b;return db[_0xeb68('0x30')][_0xeb68('0x55')]({'where':{'id':_0x1bb0c6[_0xeb68('0x47')]['id']}})[_0xeb68('0x26')](handleEntityNotFound(_0x3106ce,null))[_0xeb68('0x26')](function(_0x1e5480){if(_0x1e5480){_0x556554=_0x1e5480;_0x5cf423['model']=_[_0xeb68('0x34')](db[_0xeb68('0x30')][_0xeb68('0x31')]);_0x5cf423[_0xeb68('0x33')]=_['keys'](_0x1bb0c6[_0xeb68('0x33')]);_0x5cf423['filters']=_[_0xeb68('0x36')](_0x5cf423['model'],_0x5cf423['query']);_0x380b7e[_0xeb68('0x37')]=_[_0xeb68('0x36')](_0x5cf423[_0xeb68('0x39')],qs[_0xeb68('0x38')](_0x1bb0c6['query']['fields']));_0x380b7e['attributes']=_0x380b7e['attributes'][_0xeb68('0x56')]?_0x380b7e[_0xeb68('0x37')]:_0x5cf423[_0xeb68('0x39')];_0x380b7e[_0xeb68('0x3c')]=qs['sort'](_0x1bb0c6['query'][_0xeb68('0x57')]);_0x380b7e[_0xeb68('0x3d')]=qs['filters'](_['pick'](_0x1bb0c6[_0xeb68('0x33')],_0x5cf423[_0xeb68('0x35')]));if(_0x1bb0c6[_0xeb68('0x33')][_0xeb68('0x41')]){_0x380b7e[_0xeb68('0x3d')]=_[_0xeb68('0x42')](_0x380b7e[_0xeb68('0x3d')],{'$or':_['map'](_0x380b7e[_0xeb68('0x37')],function(_0x52c2b9){var _0x389524={};_0x389524[_0x52c2b9]={'$like':'%'+_0x1bb0c6[_0xeb68('0x33')][_0xeb68('0x41')]+'%'};return _0x389524;})});}_0x380b7e=_[_0xeb68('0x42')]({},_0x380b7e,_0x1bb0c6['options']);return _0x556554[_0xeb68('0x54')](_0x380b7e);}})[_0xeb68('0x26')](function(_0x5976c6){if(_0x5976c6){_0x14f10b=_0x5976c6['length'];if(!_0x1bb0c6[_0xeb68('0x33')][_0xeb68('0x3a')](_0xeb68('0x58'))){_0x380b7e[_0xeb68('0x3b')]=qs[_0xeb68('0x3b')](_0x1bb0c6['query']['limit']);_0x380b7e[_0xeb68('0x20')]=qs[_0xeb68('0x20')](_0x1bb0c6[_0xeb68('0x33')][_0xeb68('0x20')]);}return _0x556554['getIntervals'](_0x380b7e);}})['then'](function(_0x30de41){if(_0x30de41){return _0x30de41?{'count':_0x14f10b,'rows':_0x30de41}:null;}})[_0xeb68('0x26')](respondWithResult(_0x3106ce,null))[_0xeb68('0x46')](handleError(_0x3106ce,null));};exports[_0xeb68('0x59')]=function(_0x3d21c3,_0x4a4f8d,_0x3fa5e1){return db[_0xeb68('0x30')]['findOne']({'where':{'id':_0x3d21c3['params']['id']}})['then'](handleEntityNotFound(_0x4a4f8d,null))[_0xeb68('0x26')](function(_0x3b38bf){if(_0x3b38bf){return db[_0xeb68('0x5a')]['transaction'](function(_0x1b0c41){return db['Interval'][_0xeb68('0x27')]({'where':{'IntervalId':_0x3d21c3[_0xeb68('0x47')]['id']},'transaction':_0x1b0c41})['then'](function(_0x422b98){var _0x1baddf=_[_0xeb68('0x2f')](_0x3d21c3[_0xeb68('0x4b')],function(_0x2294fd){delete _0x2294fd['id'];_0x2294fd[_0xeb68('0x53')]=_0x3d21c3[_0xeb68('0x47')]['id'];return _0x2294fd;});return db[_0xeb68('0x30')]['bulkCreate'](_0x1baddf,{'transaction':_0x1b0c41});});})['then'](function(){return db[_0xeb68('0x30')][_0xeb68('0x44')]({'where':{'IntervalId':_0x3d21c3[_0xeb68('0x47')]['id']}});});}})[_0xeb68('0x26')](respondWithResult(_0x4a4f8d,null))[_0xeb68('0x46')](handleError(_0x4a4f8d,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 56027f2..a01490b 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 _0x5f02=['Interval','rewrite','interval','getIntervals','then','all','ifTime','./interval.attributes','../../components/extensions/rewrite','exports','define'];(function(_0x5de3a4,_0x24ae74){var _0x299957=function(_0x100f47){while(--_0x100f47){_0x5de3a4['push'](_0x5de3a4['shift']());}};_0x299957(++_0x24ae74);}(_0x5f02,0xb7));var _0x25f0=function(_0x323193,_0x4a167e){_0x323193=_0x323193-0x0;var _0x40dc5b=_0x5f02[_0x323193];return _0x40dc5b;};'use strict';var attributes=require(_0x25f0('0x0'));var extensions=require(_0x25f0('0x1'));var iftime=require('../../utils/iftime')['iftime'];module[_0x25f0('0x2')]=function(_0x15a043){return _0x15a043[_0x25f0('0x3')](_0x25f0('0x4'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5daf23){extensions[_0x25f0('0x5')](_0x15a043,_0x5daf23);},'afterBulkCreate':function(_0x1856a7,_0xb49b7a,_0x417b95){_0x417b95();extensions['rewrite'](_0x15a043,_0x1856a7[0x0]);},'afterUpdate':function(_0x206565){extensions[_0x25f0('0x5')](_0x15a043,_0x206565);},'afterDestroy':function(_0x415104){extensions['rewrite'](_0x15a043,_0x415104);}},'instanceMethods':{'ifTime':function(_0xbf2ff2=undefined,_0x297269=new Date()){if(typeof this[_0x25f0('0x6')]==='string'){return iftime(this[_0x25f0('0x6')],_0xbf2ff2,_0x297269);}else{return this[_0x25f0('0x7')]()[_0x25f0('0x8')](function(_0x445ad8){return Promise[_0x25f0('0x9')](_0x445ad8['map'](function(_0x21b5ce){return _0x21b5ce[_0x25f0('0xa')](_0xbf2ff2,_0x297269);}));})['then'](function(_0x9088f1){return _0x9088f1['reduce'](function(_0x45f9b7,_0x576ce6){return _0x45f9b7||_0x576ce6;},![]);});}}}});}; \ No newline at end of file +var _0xc8e7=['getIntervals','then','map','reduce','./interval.attributes','../../components/extensions/rewrite','../../utils/iftime','exports','define','Interval','tools_intervals','rewrite','interval','string'];(function(_0x56fa7d,_0x521d83){var _0x13beb2=function(_0x274bd1){while(--_0x274bd1){_0x56fa7d['push'](_0x56fa7d['shift']());}};_0x13beb2(++_0x521d83);}(_0xc8e7,0x1e0));var _0x7c8e=function(_0x455893,_0x909838){_0x455893=_0x455893-0x0;var _0x3851e8=_0xc8e7[_0x455893];return _0x3851e8;};'use strict';var attributes=require(_0x7c8e('0x0'));var extensions=require(_0x7c8e('0x1'));var iftime=require(_0x7c8e('0x2'))['iftime'];module[_0x7c8e('0x3')]=function(_0x3ba27f){return _0x3ba27f[_0x7c8e('0x4')](_0x7c8e('0x5'),attributes,{'tableName':_0x7c8e('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x34297c){extensions[_0x7c8e('0x7')](_0x3ba27f,_0x34297c);},'afterBulkCreate':function(_0xa10753,_0x8893e6,_0x35500b){_0x35500b();extensions[_0x7c8e('0x7')](_0x3ba27f,_0xa10753[0x0]);},'afterUpdate':function(_0x227dcd){extensions[_0x7c8e('0x7')](_0x3ba27f,_0x227dcd);},'afterDestroy':function(_0x1208f8){extensions['rewrite'](_0x3ba27f,_0x1208f8);}},'instanceMethods':{'ifTime':function(_0x533210=undefined,_0x5ea1fe=new Date()){if(typeof this[_0x7c8e('0x8')]===_0x7c8e('0x9')){return iftime(this[_0x7c8e('0x8')],_0x533210,_0x5ea1fe);}else{return this[_0x7c8e('0xa')]()[_0x7c8e('0xb')](function(_0x663db4){return Promise['all'](_0x663db4[_0x7c8e('0xc')](function(_0x20fadf){return _0x20fadf['ifTime'](_0x533210,_0x5ea1fe);}));})[_0x7c8e('0xb')](function(_0x1f8e4b){return _0x1f8e4b[_0x7c8e('0xd')](function(_0x598473,_0x6b8cef){return _0x598473||_0x6b8cef;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index e013040..a9ef409 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 _0x9ae5=['message','ShowInterval','Interval','find','info','error','then','reduce','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','ifTime','IntervalIftime','intervalIds','isArray','intervals','string','timezone','length','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','silly','resolve','catch','lodash','util','../../mysqldb','../../utils/iftime','iftime','../../config/logger','GetInterval','findAll','options','raw','where','attributes','limit','include','map','model','debug','stringify'];(function(_0x5bc9dc,_0x2debc7){var _0x3b999f=function(_0x2a81e3){while(--_0x2a81e3){_0x5bc9dc['push'](_0x5bc9dc['shift']());}};_0x3b999f(++_0x2debc7);}(_0x9ae5,0x1dd));var _0x59ae=function(_0x4722d9,_0x4d2d6a){_0x4722d9=_0x4722d9-0x0;var _0xf1514f=_0x9ae5[_0x4722d9];return _0xf1514f;};'use strict';var _=require(_0x59ae('0x0'));var util=require(_0x59ae('0x1'));var db=require(_0x59ae('0x2'))['db'];var iftime=require(_0x59ae('0x3'))[_0x59ae('0x4')];var logger=require(_0x59ae('0x5'))('rpc');exports[_0x59ae('0x6')]=function(_0x1baf7c){var _0x1f7751=this;return new Promise(function(_0xc0aa7b,_0x5f356e){return db['Interval'][_0x59ae('0x7')]({'raw':_0x1baf7c[_0x59ae('0x8')]?_0x1baf7c[_0x59ae('0x8')][_0x59ae('0x9')]===undefined?!![]:![]:!![],'where':_0x1baf7c['options']?_0x1baf7c['options'][_0x59ae('0xa')]||null:null,'attributes':_0x1baf7c[_0x59ae('0x8')]?_0x1baf7c[_0x59ae('0x8')][_0x59ae('0xb')]||null:null,'limit':_0x1baf7c[_0x59ae('0x8')]?_0x1baf7c[_0x59ae('0x8')][_0x59ae('0xc')]||null:null,'include':_0x1baf7c[_0x59ae('0x8')]?_0x1baf7c[_0x59ae('0x8')][_0x59ae('0xd')]?_[_0x59ae('0xe')](_0x1baf7c[_0x59ae('0x8')][_0x59ae('0xd')],function(_0x3d464d){return{'model':db[_0x3d464d[_0x59ae('0xf')]],'as':_0x3d464d['as'],'attributes':_0x3d464d['attributes'],'include':_0x3d464d[_0x59ae('0xd')]?_[_0x59ae('0xe')](_0x3d464d[_0x59ae('0xd')],function(_0x2e33f8){return{'model':db[_0x2e33f8['model']],'as':_0x2e33f8['as'],'attributes':_0x2e33f8[_0x59ae('0xb')],'include':_0x2e33f8[_0x59ae('0xd')]?_[_0x59ae('0xe')](_0x2e33f8[_0x59ae('0xd')],function(_0x543004){return{'model':db[_0x543004[_0x59ae('0xf')]],'as':_0x543004['as'],'attributes':_0x543004[_0x59ae('0xb')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x665d0f){logger['info']('GetInterval',_0x1baf7c);logger[_0x59ae('0x10')](_0x59ae('0x6'),_0x1baf7c,JSON[_0x59ae('0x11')](_0x665d0f));_0xc0aa7b(_0x665d0f);})['catch'](function(_0x5bac14){logger['error'](_0x59ae('0x6'),_0x5bac14['message'],_0x1baf7c);_0x5f356e(_0x1f7751['error'](0x1f4,_0x5bac14[_0x59ae('0x12')]));});});};exports[_0x59ae('0x13')]=function(_0x5521bb){var _0x27a3a7=this;return new Promise(function(_0x23e735,_0x14dc05){return db[_0x59ae('0x14')][_0x59ae('0x15')]({'raw':_0x5521bb[_0x59ae('0x8')]?_0x5521bb['options'][_0x59ae('0x9')]===undefined?!![]:![]:!![],'where':_0x5521bb[_0x59ae('0x8')]?_0x5521bb[_0x59ae('0x8')][_0x59ae('0xa')]||null:null,'attributes':_0x5521bb[_0x59ae('0x8')]?_0x5521bb['options']['attributes']||null:null,'include':_0x5521bb['options']?_0x5521bb[_0x59ae('0x8')][_0x59ae('0xd')]?_[_0x59ae('0xe')](_0x5521bb[_0x59ae('0x8')][_0x59ae('0xd')],function(_0x3bd85c){return{'model':db[_0x3bd85c['model']],'as':_0x3bd85c['as'],'attributes':_0x3bd85c['attributes'],'include':_0x3bd85c[_0x59ae('0xd')]?_['map'](_0x3bd85c[_0x59ae('0xd')],function(_0x48c959){return{'model':db[_0x48c959[_0x59ae('0xf')]],'as':_0x48c959['as'],'attributes':_0x48c959[_0x59ae('0xb')],'include':_0x48c959[_0x59ae('0xd')]?_['map'](_0x48c959[_0x59ae('0xd')],function(_0x266283){return{'model':db[_0x266283[_0x59ae('0xf')]],'as':_0x266283['as'],'attributes':_0x266283['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5cd9d2){logger[_0x59ae('0x16')](_0x59ae('0x13'),_0x5521bb);logger[_0x59ae('0x10')](_0x59ae('0x13'),_0x5521bb,JSON[_0x59ae('0x11')](_0x5cd9d2));_0x23e735(_0x5cd9d2);})['catch'](function(_0x477d69){logger[_0x59ae('0x17')](_0x59ae('0x13'),_0x477d69[_0x59ae('0x12')],_0x5521bb);_0x14dc05(_0x27a3a7[_0x59ae('0x17')](0x1f4,_0x477d69[_0x59ae('0x12')]));});});};function checkArrayOfIntervals(_0x45935a,_0x3e2ba6){var _0x5d233a=[];return db[_0x59ae('0x14')][_0x59ae('0x7')]({'where':{'id':_0x45935a}})[_0x59ae('0x18')](function(_0x471d9b){_0x5d233a=_0x471d9b;return Promise['all'](_0x5d233a['map'](function(_0x14efde){return _0x14efde['ifTime'](_0x3e2ba6);}));})[_0x59ae('0x18')](function(_0x3dc078){var _0x814166=_0x3dc078[_0x59ae('0x19')](function(_0x2dc3e1,_0x4d81f4){return _0x2dc3e1||_0x4d81f4;},![]);logger['info'](util[_0x59ae('0x1a')](_0x59ae('0x1b'),_0x5d233a[_0x59ae('0xe')](function(_0x14874e){return _0x14874e[_0x59ae('0x1c')];})[_0x59ae('0x1d')](',\x20'),_0x5d233a[_0x59ae('0xe')](function(_0x23b2df){return _0x23b2df['id'];})[_0x59ae('0x1d')](',\x20')));return _0x814166;});}function checkSingleInterval(_0x376454,_0x492ece){return db[_0x59ae('0x14')][_0x59ae('0x1e')](_0x376454)['then'](function(_0x279109){if(_0x279109){logger[_0x59ae('0x16')](util[_0x59ae('0x1a')](_0x59ae('0x1f'),_0x279109['name'],_0x279109['id']));return _0x279109[_0x59ae('0x20')](_0x492ece);}});}exports[_0x59ae('0x21')]=function(_0x41ba88){var _0x3f4c75=_0x41ba88[_0x59ae('0x22')];var _0xf6be0b=Array[_0x59ae('0x23')](_0x41ba88[_0x59ae('0x24')])?_0x41ba88['intervals']:typeof _0x41ba88[_0x59ae('0x24')]===_0x59ae('0x25')?[_0x41ba88['intervals']]:[];var _0x4022b8=_0x41ba88[_0x59ae('0x26')]||undefined;var _0x7ef4aa=![];if(_0xf6be0b[_0x59ae('0x27')]){logger[_0x59ae('0x16')](util['format']('IntervalIftime:\x20interval\x20strings\x20=\x20%s',_0xf6be0b['join'](';\x20')));}if(_0x4022b8){logger[_0x59ae('0x16')](util['format'](_0x59ae('0x28'),_0x4022b8));}logger['debug'](_0x59ae('0x29'),_0x7ef4aa);logger[_0x59ae('0x2a')]('IntervalIftime',_0x41ba88);return Promise[_0x59ae('0x2b')]()[_0x59ae('0x18')](function(){if(Array['isArray'](_0x3f4c75)){return checkArrayOfIntervals(_0x3f4c75,_0x4022b8);}else if(_0x3f4c75){return checkSingleInterval(_0x3f4c75,_0x4022b8);}})[_0x59ae('0x18')](function(_0x4e0a4a){var _0x4f039d=_0xf6be0b[_0x59ae('0x19')](function(_0x2aa106,_0x603095){return _0x2aa106||iftime(_0x603095,_0x4022b8);},![]);_0x7ef4aa=_0x4e0a4a||_0x4f039d;return _0x7ef4aa;})[_0x59ae('0x2c')](function(_0x2d062b){logger['error'](_0x59ae('0x21'),_0x41ba88,_0x2d062b);throw this[_0x59ae('0x17')](0x1f4,_0x2d062b['message']);});}; \ No newline at end of file +var _0xa517=['all','ifTime','reduce','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','findById','intervalIds','isArray','intervals','string','length','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','silly','IntervalIftime','resolve','lodash','../../mysqldb','../../utils/iftime','iftime','../../config/logger','GetInterval','Interval','findAll','options','where','attributes','limit','include','map','model','info','debug','error','message','ShowInterval','find','then','catch'];(function(_0x32f897,_0x2d1995){var _0x204715=function(_0x5512e7){while(--_0x5512e7){_0x32f897['push'](_0x32f897['shift']());}};_0x204715(++_0x2d1995);}(_0xa517,0x131));var _0x7a51=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0xa517[_0x263a74];return _0x2aa86c;};'use strict';var _=require(_0x7a51('0x0'));var util=require('util');var db=require(_0x7a51('0x1'))['db'];var iftime=require(_0x7a51('0x2'))[_0x7a51('0x3')];var logger=require(_0x7a51('0x4'))('rpc');exports[_0x7a51('0x5')]=function(_0x5ed170){var _0x12a879=this;return new Promise(function(_0x1082d8,_0x338779){return db[_0x7a51('0x6')][_0x7a51('0x7')]({'raw':_0x5ed170[_0x7a51('0x8')]?_0x5ed170[_0x7a51('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x5ed170[_0x7a51('0x8')]?_0x5ed170[_0x7a51('0x8')][_0x7a51('0x9')]||null:null,'attributes':_0x5ed170['options']?_0x5ed170[_0x7a51('0x8')][_0x7a51('0xa')]||null:null,'limit':_0x5ed170['options']?_0x5ed170[_0x7a51('0x8')][_0x7a51('0xb')]||null:null,'include':_0x5ed170[_0x7a51('0x8')]?_0x5ed170[_0x7a51('0x8')][_0x7a51('0xc')]?_[_0x7a51('0xd')](_0x5ed170[_0x7a51('0x8')][_0x7a51('0xc')],function(_0x33ccdd){return{'model':db[_0x33ccdd[_0x7a51('0xe')]],'as':_0x33ccdd['as'],'attributes':_0x33ccdd['attributes'],'include':_0x33ccdd['include']?_[_0x7a51('0xd')](_0x33ccdd[_0x7a51('0xc')],function(_0x143d96){return{'model':db[_0x143d96[_0x7a51('0xe')]],'as':_0x143d96['as'],'attributes':_0x143d96[_0x7a51('0xa')],'include':_0x143d96['include']?_[_0x7a51('0xd')](_0x143d96['include'],function(_0x172e10){return{'model':db[_0x172e10['model']],'as':_0x172e10['as'],'attributes':_0x172e10['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x515378){logger[_0x7a51('0xf')]('GetInterval',_0x5ed170);logger[_0x7a51('0x10')]('GetInterval',_0x5ed170,JSON['stringify'](_0x515378));_0x1082d8(_0x515378);})['catch'](function(_0x3bd438){logger[_0x7a51('0x11')](_0x7a51('0x5'),_0x3bd438[_0x7a51('0x12')],_0x5ed170);_0x338779(_0x12a879[_0x7a51('0x11')](0x1f4,_0x3bd438[_0x7a51('0x12')]));});});};exports[_0x7a51('0x13')]=function(_0x4b08ca){var _0x35906d=this;return new Promise(function(_0x39204d,_0x5f54cf){return db[_0x7a51('0x6')][_0x7a51('0x14')]({'raw':_0x4b08ca[_0x7a51('0x8')]?_0x4b08ca[_0x7a51('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x4b08ca['options']?_0x4b08ca[_0x7a51('0x8')][_0x7a51('0x9')]||null:null,'attributes':_0x4b08ca[_0x7a51('0x8')]?_0x4b08ca[_0x7a51('0x8')][_0x7a51('0xa')]||null:null,'include':_0x4b08ca[_0x7a51('0x8')]?_0x4b08ca['options'][_0x7a51('0xc')]?_[_0x7a51('0xd')](_0x4b08ca[_0x7a51('0x8')][_0x7a51('0xc')],function(_0x457020){return{'model':db[_0x457020['model']],'as':_0x457020['as'],'attributes':_0x457020[_0x7a51('0xa')],'include':_0x457020[_0x7a51('0xc')]?_[_0x7a51('0xd')](_0x457020['include'],function(_0x1cc699){return{'model':db[_0x1cc699[_0x7a51('0xe')]],'as':_0x1cc699['as'],'attributes':_0x1cc699[_0x7a51('0xa')],'include':_0x1cc699[_0x7a51('0xc')]?_[_0x7a51('0xd')](_0x1cc699[_0x7a51('0xc')],function(_0x23bc8d){return{'model':db[_0x23bc8d[_0x7a51('0xe')]],'as':_0x23bc8d['as'],'attributes':_0x23bc8d['attributes']};}):[]};}):[]};}):[]:[]})[_0x7a51('0x15')](function(_0x1a093a){logger[_0x7a51('0xf')]('ShowInterval',_0x4b08ca);logger[_0x7a51('0x10')]('ShowInterval',_0x4b08ca,JSON['stringify'](_0x1a093a));_0x39204d(_0x1a093a);})[_0x7a51('0x16')](function(_0x4b4b76){logger['error'](_0x7a51('0x13'),_0x4b4b76[_0x7a51('0x12')],_0x4b08ca);_0x5f54cf(_0x35906d[_0x7a51('0x11')](0x1f4,_0x4b4b76[_0x7a51('0x12')]));});});};function checkArrayOfIntervals(_0x1e82a6,_0x29517e){var _0x4587db=[];return db['Interval']['findAll']({'where':{'id':_0x1e82a6}})[_0x7a51('0x15')](function(_0x64974d){_0x4587db=_0x64974d;return Promise[_0x7a51('0x17')](_0x4587db['map'](function(_0xd4b4a6){return _0xd4b4a6[_0x7a51('0x18')](_0x29517e);}));})[_0x7a51('0x15')](function(_0x442c0b){var _0x3c0fc1=_0x442c0b[_0x7a51('0x19')](function(_0xeae91a,_0x119717){return _0xeae91a||_0x119717;},![]);logger[_0x7a51('0xf')](util[_0x7a51('0x1a')](_0x7a51('0x1b'),_0x4587db[_0x7a51('0xd')](function(_0x3eeb50){return _0x3eeb50[_0x7a51('0x1c')];})[_0x7a51('0x1d')](',\x20'),_0x4587db['map'](function(_0x149cda){return _0x149cda['id'];})[_0x7a51('0x1d')](',\x20')));return _0x3c0fc1;});}function checkSingleInterval(_0x10deb9,_0x2531ee){return db[_0x7a51('0x6')][_0x7a51('0x1e')](_0x10deb9)[_0x7a51('0x15')](function(_0x470e83){if(_0x470e83){logger[_0x7a51('0xf')](util[_0x7a51('0x1a')]('IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)',_0x470e83['name'],_0x470e83['id']));return _0x470e83[_0x7a51('0x18')](_0x2531ee);}});}exports['IntervalIftime']=function(_0x38eb97){var _0x4dc22d=_0x38eb97[_0x7a51('0x1f')];var _0x2e8e8a=Array[_0x7a51('0x20')](_0x38eb97[_0x7a51('0x21')])?_0x38eb97[_0x7a51('0x21')]:typeof _0x38eb97[_0x7a51('0x21')]===_0x7a51('0x22')?[_0x38eb97[_0x7a51('0x21')]]:[];var _0x2d4562=_0x38eb97['timezone']||undefined;var _0x20e06a=![];if(_0x2e8e8a[_0x7a51('0x23')]){logger[_0x7a51('0xf')](util[_0x7a51('0x1a')]('IntervalIftime:\x20interval\x20strings\x20=\x20%s',_0x2e8e8a['join'](';\x20')));}if(_0x2d4562){logger[_0x7a51('0xf')](util[_0x7a51('0x1a')](_0x7a51('0x24'),_0x2d4562));}logger['debug'](_0x7a51('0x25'),_0x20e06a);logger[_0x7a51('0x26')](_0x7a51('0x27'),_0x38eb97);return Promise[_0x7a51('0x28')]()[_0x7a51('0x15')](function(){if(Array[_0x7a51('0x20')](_0x4dc22d)){return checkArrayOfIntervals(_0x4dc22d,_0x2d4562);}else if(_0x4dc22d){return checkSingleInterval(_0x4dc22d,_0x2d4562);}})['then'](function(_0x597636){var _0x58b981=_0x2e8e8a[_0x7a51('0x19')](function(_0x49e4a5,_0x302a5d){return _0x49e4a5||iftime(_0x302a5d,_0x2d4562);},![]);_0x20e06a=_0x597636||_0x58b981;return _0x20e06a;})[_0x7a51('0x16')](function(_0x103dfd){logger['error'](_0x7a51('0x27'),_0x38eb97,_0x103dfd);throw this['error'](0x1f4,_0x103dfd[_0x7a51('0x12')]);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 43b5688..d60e6f4 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 _0x5f2f=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller','post'];(function(_0x5d7ce4,_0x38ecae){var _0x1f12e7=function(_0xe28d07){while(--_0xe28d07){_0x5d7ce4['push'](_0x5d7ce4['shift']());}};_0x1f12e7(++_0x38ecae);}(_0x5f2f,0x73));var _0xf5f2=function(_0x510ccc,_0x3b997d){_0x510ccc=_0x510ccc-0x0;var _0x32c374=_0x5f2f[_0x510ccc];return _0x32c374;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);module[_0xf5f2('0x7')]=router; \ No newline at end of file +var _0x5f66=['send','exports','Router','./jira.controller','post','isAuthenticated'];(function(_0x2a1b33,_0x409f50){var _0x4c50e7=function(_0x13e16d){while(--_0x13e16d){_0x2a1b33['push'](_0x2a1b33['shift']());}};_0x4c50e7(++_0x409f50);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x5f66[_0x3947c9];return _0x2e7871;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);module[_0x65f6('0x5')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index fbe6533..15ff074 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 _0xe1c0=['key','MOTGUI','stringify','issuetype','Bug','fields','customfield_11500','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','request','setEncoding','utf8','end','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','headers','x-forwarded-for','connection','socket','remoteAddress','body','https','../../config/logger','api','support'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xe1c0,0x10a));var _0x0e1c=function(_0x44fd0d,_0xd9d38){_0x44fd0d=_0x44fd0d-0x0;var _0x482424=_0xe1c0[_0x44fd0d];return _0x482424;};'use strict';var BPromise=require('bluebird');var https=require(_0x0e1c('0x0'));var logger=require(_0x0e1c('0x1'))(_0x0e1c('0x2'));var USERNAME=_0x0e1c('0x3');var PASSWORD='3eAmWpBVP0';function openIssue(_0x424d3e,_0x444762){var _0x2c2012={'fields':{'project':{'key':_0x424d3e[_0x0e1c('0x4')]||_0x0e1c('0x5')},'summary':(_0x424d3e['summary']||'Report')+'\x20from\x20'+_0x424d3e['ip'],'description':_0x424d3e['description']||JSON[_0x0e1c('0x6')](_0x424d3e),'issuetype':{'name':_0x424d3e[_0x0e1c('0x7')]||_0x0e1c('0x8')}}};_0x2c2012[_0x0e1c('0x9')][_0x0e1c('0xa')]=_0x424d3e['email'];_0x2c2012['fields']['customfield_11501']=_0x424d3e[_0x0e1c('0xb')];_0x2c2012[_0x0e1c('0x9')][_0x0e1c('0xc')]=_0x424d3e[_0x0e1c('0xd')];_0x2c2012[_0x0e1c('0x9')][_0x0e1c('0xe')]=_0x424d3e[_0x0e1c('0xf')];_0x2c2012[_0x0e1c('0x9')][_0x0e1c('0x10')]=_0x424d3e[_0x0e1c('0x11')];_0x2c2012[_0x0e1c('0x9')][_0x0e1c('0x12')]=_0x424d3e['ip'];var _0x47c6d3={'host':_0x0e1c('0x13'),'port':0x1bb,'path':_0x0e1c('0x14'),'method':_0x0e1c('0x15'),'timeout':0x4e20,'headers':{'Content-Type':_0x0e1c('0x16'),'Authorization':_0x0e1c('0x17')+new Buffer(USERNAME+':'+PASSWORD)[_0x0e1c('0x18')]('base64')}};var _0x3e485f=JSON[_0x0e1c('0x6')](_0x2c2012);var _0x2de732=https[_0x0e1c('0x19')](_0x47c6d3,function(_0x42403e){_0x42403e[_0x0e1c('0x1a')](_0x0e1c('0x1b'));var _0x7c3d6b='';_0x42403e['on']('data',function(_0x46465e){_0x7c3d6b+=_0x46465e;});_0x42403e['on'](_0x0e1c('0x1c'),function(){if(_0x444762){return _0x444762[_0x0e1c('0x1d')](_0x42403e[_0x0e1c('0x1e')])[_0x0e1c('0x1f')](JSON[_0x0e1c('0x20')](_0x7c3d6b));}});});_0x2de732['on'](_0x0e1c('0x21'),function(_0x55e0c6){if(_0x444762){return _0x444762[_0x0e1c('0x1d')](0x1f4)[_0x0e1c('0x1f')]({'errors':[{'message':_0x0e1c('0x22'),'type':_0x0e1c('0x23')}]});}});_0x2de732[_0x0e1c('0x24')](_0x3e485f);_0x2de732[_0x0e1c('0x1c')]();}exports[_0x0e1c('0x25')]=openIssue;exports[_0x0e1c('0x26')]=function(_0x46d9a9,_0x5a152d){_0x46d9a9['body']['ip']=_0x46d9a9[_0x0e1c('0x27')][_0x0e1c('0x28')]||_0x46d9a9[_0x0e1c('0x29')]['remoteAddress']||_0x46d9a9[_0x0e1c('0x2a')][_0x0e1c('0x2b')]||_0x46d9a9[_0x0e1c('0x29')][_0x0e1c('0x2a')][_0x0e1c('0x2b')];return openIssue(_0x46d9a9[_0x0e1c('0x2c')],_0x5a152d);}; \ No newline at end of file +var _0x1824=['data','end','statusCode','json','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','body','headers','x-forwarded-for','connection','socket','bluebird','../../config/logger','support','3eAmWpBVP0','summary','Report','\x20from\x20','description','issuetype','Bug','fields','email','customfield_11501','oldToken','customfield_11502','name','customfield_11504','reason','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','stringify','request','setEncoding','utf8'];(function(_0x5bc2ef,_0x4d677b){var _0x76f2ac=function(_0x449c9d){while(--_0x449c9d){_0x5bc2ef['push'](_0x5bc2ef['shift']());}};_0x76f2ac(++_0x4d677b);}(_0x1824,0xe5));var _0x4182=function(_0x53dd3e,_0x4be502){_0x53dd3e=_0x53dd3e-0x0;var _0x2795a6=_0x1824[_0x53dd3e];return _0x2795a6;};'use strict';var BPromise=require(_0x4182('0x0'));var https=require('https');var logger=require(_0x4182('0x1'))('api');var USERNAME=_0x4182('0x2');var PASSWORD=_0x4182('0x3');function openIssue(_0x6e095a,_0x40ef46){var _0x57a255={'fields':{'project':{'key':_0x6e095a['key']||'MOTGUI'},'summary':(_0x6e095a[_0x4182('0x4')]||_0x4182('0x5'))+_0x4182('0x6')+_0x6e095a['ip'],'description':_0x6e095a[_0x4182('0x7')]||JSON['stringify'](_0x6e095a),'issuetype':{'name':_0x6e095a[_0x4182('0x8')]||_0x4182('0x9')}}};_0x57a255[_0x4182('0xa')]['customfield_11500']=_0x6e095a[_0x4182('0xb')];_0x57a255[_0x4182('0xa')][_0x4182('0xc')]=_0x6e095a[_0x4182('0xd')];_0x57a255['fields'][_0x4182('0xe')]=_0x6e095a['newToken'];_0x57a255['fields']['customfield_11503']=_0x6e095a[_0x4182('0xf')];_0x57a255['fields'][_0x4182('0x10')]=_0x6e095a[_0x4182('0x11')];_0x57a255[_0x4182('0xa')]['customfield_10102']=_0x6e095a['ip'];var _0x1755e7={'host':_0x4182('0x12'),'port':0x1bb,'path':_0x4182('0x13'),'method':_0x4182('0x14'),'timeout':0x4e20,'headers':{'Content-Type':_0x4182('0x15'),'Authorization':_0x4182('0x16')+new Buffer(USERNAME+':'+PASSWORD)[_0x4182('0x17')](_0x4182('0x18'))}};var _0x47daa7=JSON[_0x4182('0x19')](_0x57a255);var _0x5f1ea3=https[_0x4182('0x1a')](_0x1755e7,function(_0xc319cb){_0xc319cb[_0x4182('0x1b')](_0x4182('0x1c'));var _0x567bd4='';_0xc319cb['on'](_0x4182('0x1d'),function(_0x50b955){_0x567bd4+=_0x50b955;});_0xc319cb['on'](_0x4182('0x1e'),function(){if(_0x40ef46){return _0x40ef46['status'](_0xc319cb[_0x4182('0x1f')])[_0x4182('0x20')](JSON['parse'](_0x567bd4));}});});_0x5f1ea3['on'](_0x4182('0x21'),function(_0x35ce19){if(_0x40ef46){return _0x40ef46['status'](0x1f4)['json']({'errors':[{'message':_0x4182('0x22'),'type':_0x4182('0x23')}]});}});_0x5f1ea3[_0x4182('0x24')](_0x47daa7);_0x5f1ea3[_0x4182('0x1e')]();}exports[_0x4182('0x25')]=openIssue;exports['send']=function(_0x5a7330,_0x2eee65){_0x5a7330[_0x4182('0x26')]['ip']=_0x5a7330[_0x4182('0x27')][_0x4182('0x28')]||_0x5a7330[_0x4182('0x29')]['remoteAddress']||_0x5a7330[_0x4182('0x2a')]['remoteAddress']||_0x5a7330[_0x4182('0x29')][_0x4182('0x2a')]['remoteAddress'];return openIssue(_0x5a7330['body'],_0x2eee65);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 6182d4c..f05cb20 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 _0x22fb=['./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2a7812,_0x1ce83a){var _0x3e1342=function(_0x3ff9fb){while(--_0x3ff9fb){_0x2a7812['push'](_0x2a7812['shift']());}};_0x3e1342(++_0x1ce83a);}(_0x22fb,0x192));var _0xb22f=function(_0x1b044c,_0x277b6a){_0x1b044c=_0x1b044c-0x0;var _0x146ea6=_0x22fb[_0x1b044c];return _0x146ea6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb22f('0x0'));var timeout=require('connect-timeout');var express=require(_0xb22f('0x1'));var router=express[_0xb22f('0x2')]();var fs_extra=require(_0xb22f('0x3'));var auth=require(_0xb22f('0x4'));var interaction=require(_0xb22f('0x5'));var config=require('../../config/environment');var controller=require(_0xb22f('0x6'));router[_0xb22f('0x7')]('/',auth[_0xb22f('0x8')](),controller[_0xb22f('0x9')]);router[_0xb22f('0x7')](_0xb22f('0xa'),auth['isAuthenticated'](),controller[_0xb22f('0xb')]);router[_0xb22f('0x7')](_0xb22f('0xc'),auth[_0xb22f('0x8')](),controller[_0xb22f('0xd')]);router[_0xb22f('0xe')]('/',auth[_0xb22f('0x8')](),controller[_0xb22f('0xf')]);router[_0xb22f('0x10')](_0xb22f('0xc'),auth[_0xb22f('0x8')](),controller['update']);router['delete']('/:id',auth[_0xb22f('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x99e9=['update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put'];(function(_0x1ef7b2,_0x21aeb0){var _0x2381dd=function(_0x255872){while(--_0x255872){_0x1ef7b2['push'](_0x1ef7b2['shift']());}};_0x2381dd(++_0x21aeb0);}(_0x99e9,0xb4));var _0x999e=function(_0x10dfdf,_0x36b623){_0x10dfdf=_0x10dfdf-0x0;var _0x4d857d=_0x99e9[_0x10dfdf];return _0x4d857d;};'use strict';var multer=require('multer');var util=require(_0x999e('0x0'));var path=require(_0x999e('0x1'));var timeout=require(_0x999e('0x2'));var express=require(_0x999e('0x3'));var router=express['Router']();var fs_extra=require(_0x999e('0x4'));var auth=require(_0x999e('0x5'));var interaction=require(_0x999e('0x6'));var config=require('../../config/environment');var controller=require(_0x999e('0x7'));router['get']('/',auth[_0x999e('0x8')](),controller[_0x999e('0x9')]);router[_0x999e('0xa')](_0x999e('0xb'),auth['isAuthenticated'](),controller[_0x999e('0xc')]);router[_0x999e('0xa')](_0x999e('0xd'),auth[_0x999e('0x8')](),controller[_0x999e('0xe')]);router[_0x999e('0xf')]('/',auth[_0x999e('0x8')](),controller[_0x999e('0x10')]);router[_0x999e('0x11')](_0x999e('0xd'),auth[_0x999e('0x8')](),controller[_0x999e('0x12')]);router[_0x999e('0x13')](_0x999e('0xd'),auth[_0x999e('0x8')](),controller[_0x999e('0x14')]);module[_0x999e('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index f1eec60..4b1ca14 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(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x7a54,0x106));var _0x47a5=function(_0x21e18f,_0x435341){_0x21e18f=_0x21e18f-0x0;var _0x5b1bb9=_0x7a54[_0x21e18f];return _0x5b1bb9;};'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(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7a54,0x106));var _0x47a5=function(_0x3a913d,_0x236e6c){_0x3a913d=_0x3a913d-0x0;var _0x301873=_0x7a54[_0x3a913d];return _0x301873;};'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 a6dbf60..d1df5e4 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 _0xf8b2=['sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','filter','JscriptyAnswerReport','include','findAll','then','rows','catch','show','params','options','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy'];(function(_0x572df6,_0x316656){var _0x465da1=function(_0x4b7318){while(--_0x4b7318){_0x572df6['push'](_0x572df6['shift']());}};_0x465da1(++_0x316656);}(_0xf8b2,0x15e));var _0x2f8b=function(_0x40eef4,_0x74fb3a){_0x40eef4=_0x40eef4-0x0;var _0x1af016=_0xf8b2[_0x40eef4];return _0x1af016;};'use strict';var emlformat=require(_0x2f8b('0x0'));var rimraf=require(_0x2f8b('0x1'));var zipdir=require(_0x2f8b('0x2'));var jsonpatch=require(_0x2f8b('0x3'));var rp=require(_0x2f8b('0x4'));var moment=require(_0x2f8b('0x5'));var BPromise=require(_0x2f8b('0x6'));var Mustache=require(_0x2f8b('0x7'));var util=require('util');var path=require('path');var sox=require(_0x2f8b('0x8'));var csv=require(_0x2f8b('0x9'));var ejs=require(_0x2f8b('0xa'));var fs=require('fs');var fs_extra=require(_0x2f8b('0xb'));var _=require(_0x2f8b('0xc'));var squel=require(_0x2f8b('0xd'));var crypto=require(_0x2f8b('0xe'));var jsforce=require(_0x2f8b('0xf'));var deskjs=require(_0x2f8b('0x10'));var toCsv=require('to-csv');var querystring=require(_0x2f8b('0x11'));var Papa=require(_0x2f8b('0x12'));var Redis=require(_0x2f8b('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x2f8b('0x14'));var as=require(_0x2f8b('0x15'));var hardwareService=require(_0x2f8b('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x2f8b('0x17'));var config=require(_0x2f8b('0x18'));var licenseUtil=require(_0x2f8b('0x19'));var db=require(_0x2f8b('0x1a'))['db'];function respondWithStatusCode(_0x175111,_0x4cb1e0){_0x4cb1e0=_0x4cb1e0||0xcc;return function(_0x16d5a2){if(_0x16d5a2){return _0x175111['sendStatus'](_0x4cb1e0);}return _0x175111[_0x2f8b('0x1b')](_0x4cb1e0)[_0x2f8b('0x1c')]();};}function respondWithResult(_0x1b6a17,_0x15634){_0x15634=_0x15634||0xc8;return function(_0xf9cbe0){if(_0xf9cbe0){return _0x1b6a17[_0x2f8b('0x1b')](_0x15634)[_0x2f8b('0x1d')](_0xf9cbe0);}};}function respondWithFilteredResult(_0x2b6003,_0x532fe4){return function(_0x14a248){if(_0x14a248){var _0xdec711=typeof _0x532fe4[_0x2f8b('0x1e')]===_0x2f8b('0x1f')&&typeof _0x532fe4[_0x2f8b('0x20')]===_0x2f8b('0x1f');var _0x3d65ee=_0x14a248[_0x2f8b('0x21')];var _0x35ec40=_0xdec711?0x0:_0x532fe4['offset'];var _0x23dd63=_0xdec711?_0x14a248[_0x2f8b('0x21')]:_0x532fe4[_0x2f8b('0x1e')]+_0x532fe4['limit'];var _0xdc8171;if(_0x23dd63>=_0x3d65ee){_0x23dd63=_0x3d65ee;_0xdc8171=0xc8;}else{_0xdc8171=0xce;}_0x2b6003['status'](_0xdc8171);return _0x2b6003[_0x2f8b('0x22')](_0x2f8b('0x23'),_0x35ec40+'-'+_0x23dd63+'/'+_0x3d65ee)[_0x2f8b('0x1d')](_0x14a248);}return null;};}function patchUpdates(_0x26d78f){return function(_0x3be6dc){try{jsonpatch['apply'](_0x3be6dc,_0x26d78f,!![]);}catch(_0x29c2f3){return BPromise[_0x2f8b('0x24')](_0x29c2f3);}return _0x3be6dc[_0x2f8b('0x25')]();};}function saveUpdates(_0x17b251,_0x3ad38b){return function(_0x1ffbae){if(_0x1ffbae){return _0x1ffbae[_0x2f8b('0x26')](_0x17b251)['then'](function(_0x273950){return _0x273950;});}return null;};}function removeEntity(_0x23f73c,_0x3560c4){return function(_0x41e12b){if(_0x41e12b){return _0x41e12b[_0x2f8b('0x27')]()['then'](function(){_0x23f73c[_0x2f8b('0x1b')](0xcc)[_0x2f8b('0x1c')]();});}};}function handleEntityNotFound(_0x152492,_0x46a95a){return function(_0x183e51){if(!_0x183e51){_0x152492[_0x2f8b('0x28')](0x194);}return _0x183e51;};}function handleError(_0x45e313,_0x347f5a){_0x347f5a=_0x347f5a||0x1f4;return function(_0x4145b3){logger['error'](_0x4145b3[_0x2f8b('0x29')]);if(_0x4145b3['name']){delete _0x4145b3[_0x2f8b('0x2a')];}_0x45e313[_0x2f8b('0x1b')](_0x347f5a)[_0x2f8b('0x2b')](_0x4145b3);};}exports[_0x2f8b('0x2c')]=function(_0x72b23b,_0x4adacd){var _0x2cfbea={},_0x5cc78c={},_0x5207a8={'count':0x0,'rows':[]};var _0x194e75=_[_0x2f8b('0x2d')](db['JscriptyAnswerReport'][_0x2f8b('0x2e')],function(_0x20d80c){return{'name':_0x20d80c[_0x2f8b('0x2f')],'type':_0x20d80c[_0x2f8b('0x30')][_0x2f8b('0x31')]};});_0x5cc78c[_0x2f8b('0x32')]=_['map'](_0x194e75,_0x2f8b('0x2a'));_0x5cc78c[_0x2f8b('0x33')]=_[_0x2f8b('0x34')](_0x72b23b[_0x2f8b('0x33')]);_0x5cc78c[_0x2f8b('0x35')]=_[_0x2f8b('0x36')](_0x5cc78c[_0x2f8b('0x32')],_0x5cc78c['query']);_0x2cfbea[_0x2f8b('0x37')]=_['intersection'](_0x5cc78c[_0x2f8b('0x32')],qs[_0x2f8b('0x38')](_0x72b23b[_0x2f8b('0x33')][_0x2f8b('0x38')]));_0x2cfbea[_0x2f8b('0x37')]=_0x2cfbea[_0x2f8b('0x37')][_0x2f8b('0x39')]?_0x2cfbea[_0x2f8b('0x37')]:_0x5cc78c[_0x2f8b('0x32')];if(!_0x72b23b['query']['hasOwnProperty'](_0x2f8b('0x3a'))){_0x2cfbea[_0x2f8b('0x20')]=qs[_0x2f8b('0x20')](_0x72b23b[_0x2f8b('0x33')]['limit']);_0x2cfbea[_0x2f8b('0x1e')]=qs[_0x2f8b('0x1e')](_0x72b23b[_0x2f8b('0x33')][_0x2f8b('0x1e')]);}_0x2cfbea[_0x2f8b('0x3b')]=qs['sort'](_0x72b23b['query'][_0x2f8b('0x3c')]);_0x2cfbea[_0x2f8b('0x3d')]=qs[_0x2f8b('0x35')](_[_0x2f8b('0x3e')](_0x72b23b[_0x2f8b('0x33')],_0x5cc78c[_0x2f8b('0x35')]),_0x194e75);if(_0x72b23b[_0x2f8b('0x33')]['filter']){_0x2cfbea[_0x2f8b('0x3d')]=_[_0x2f8b('0x3f')](_0x2cfbea['where'],{'$or':_[_0x2f8b('0x2d')](_0x194e75,function(_0x4594b2){if(_0x4594b2[_0x2f8b('0x30')]!=='VIRTUAL'){var _0xa1d8de={};_0xa1d8de[_0x4594b2[_0x2f8b('0x2a')]]={'$like':'%'+_0x72b23b['query'][_0x2f8b('0x40')]+'%'};return _0xa1d8de;}})});}_0x2cfbea=_[_0x2f8b('0x3f')]({},_0x2cfbea,_0x72b23b['options']);var _0x92b37a={'where':_0x2cfbea['where']};return db[_0x2f8b('0x41')][_0x2f8b('0x21')](_0x92b37a)['then'](function(_0x9030da){_0x5207a8[_0x2f8b('0x21')]=_0x9030da;if(_0x72b23b[_0x2f8b('0x33')]['includeAll']){_0x2cfbea[_0x2f8b('0x42')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x2f8b('0x43')](_0x2cfbea);})[_0x2f8b('0x44')](function(_0x1ff6e7){_0x5207a8[_0x2f8b('0x45')]=_0x1ff6e7;return _0x5207a8;})[_0x2f8b('0x44')](respondWithFilteredResult(_0x4adacd,_0x2cfbea))[_0x2f8b('0x46')](handleError(_0x4adacd,null));};exports[_0x2f8b('0x47')]=function(_0xa2fc94,_0x1c0b64){var _0x40577c={'raw':!![],'where':{'id':_0xa2fc94[_0x2f8b('0x48')]['id']}},_0x45c92c={};_0x45c92c[_0x2f8b('0x32')]=_[_0x2f8b('0x34')](db[_0x2f8b('0x41')][_0x2f8b('0x2e')]);_0x45c92c[_0x2f8b('0x33')]=_[_0x2f8b('0x34')](_0xa2fc94[_0x2f8b('0x33')]);_0x45c92c[_0x2f8b('0x35')]=_[_0x2f8b('0x36')](_0x45c92c[_0x2f8b('0x32')],_0x45c92c[_0x2f8b('0x33')]);_0x40577c[_0x2f8b('0x37')]=_[_0x2f8b('0x36')](_0x45c92c['model'],qs['fields'](_0xa2fc94['query'][_0x2f8b('0x38')]));_0x40577c['attributes']=_0x40577c[_0x2f8b('0x37')][_0x2f8b('0x39')]?_0x40577c[_0x2f8b('0x37')]:_0x45c92c['model'];if(_0xa2fc94[_0x2f8b('0x33')]['includeAll']){_0x40577c[_0x2f8b('0x42')]=[{'all':!![]}];}_0x40577c=_['merge']({},_0x40577c,_0xa2fc94[_0x2f8b('0x49')]);return db[_0x2f8b('0x41')]['find'](_0x40577c)[_0x2f8b('0x44')](handleEntityNotFound(_0x1c0b64,null))[_0x2f8b('0x44')](respondWithResult(_0x1c0b64,null))[_0x2f8b('0x46')](handleError(_0x1c0b64,null));};exports[_0x2f8b('0x4a')]=function(_0x1e6ac2,_0x465d59){return db[_0x2f8b('0x41')][_0x2f8b('0x4a')](_0x1e6ac2[_0x2f8b('0x4b')],{})['then'](respondWithResult(_0x465d59,0xc9))[_0x2f8b('0x46')](handleError(_0x465d59,null));};exports[_0x2f8b('0x26')]=function(_0x2d79f9,_0x1bb257){if(_0x2d79f9[_0x2f8b('0x4b')]['id']){delete _0x2d79f9['body']['id'];}return db[_0x2f8b('0x41')][_0x2f8b('0x4c')]({'where':{'id':_0x2d79f9[_0x2f8b('0x48')]['id']}})['then'](handleEntityNotFound(_0x1bb257,null))[_0x2f8b('0x44')](saveUpdates(_0x2d79f9['body'],null))[_0x2f8b('0x44')](respondWithResult(_0x1bb257,null))[_0x2f8b('0x46')](handleError(_0x1bb257,null));};exports[_0x2f8b('0x27')]=function(_0x3a25bb,_0x17b855){return db['JscriptyAnswerReport']['find']({'where':{'id':_0x3a25bb['params']['id']}})[_0x2f8b('0x44')](handleEntityNotFound(_0x17b855,null))[_0x2f8b('0x44')](removeEntity(_0x17b855,null))[_0x2f8b('0x46')](handleError(_0x17b855,null));};exports[_0x2f8b('0x4d')]=function(_0x49e047,_0x5ea07d){return db[_0x2f8b('0x41')][_0x2f8b('0x4d')]()[_0x2f8b('0x44')](respondWithResult(_0x5ea07d,null))[_0x2f8b('0x46')](handleError(_0x5ea07d,null));}; \ No newline at end of file +var _0x9576=['rows','catch','show','params','intersection','includeAll','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','count','set','Content-Range','json','reject','save','update','then','destroy','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','include','findAll'];(function(_0x31a3fb,_0x189fba){var _0x375314=function(_0xc09024){while(--_0xc09024){_0x31a3fb['push'](_0x31a3fb['shift']());}};_0x375314(++_0x189fba);}(_0x9576,0x182));var _0x6957=function(_0x5dfc7f,_0x430784){_0x5dfc7f=_0x5dfc7f-0x0;var _0x2f9440=_0x9576[_0x5dfc7f];return _0x2f9440;};'use strict';var emlformat=require(_0x6957('0x0'));var rimraf=require(_0x6957('0x1'));var zipdir=require(_0x6957('0x2'));var jsonpatch=require(_0x6957('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6957('0x4'));var Mustache=require(_0x6957('0x5'));var util=require(_0x6957('0x6'));var path=require(_0x6957('0x7'));var sox=require(_0x6957('0x8'));var csv=require(_0x6957('0x9'));var ejs=require(_0x6957('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6957('0xb'));var squel=require(_0x6957('0xc'));var crypto=require(_0x6957('0xd'));var jsforce=require(_0x6957('0xe'));var deskjs=require(_0x6957('0xf'));var toCsv=require(_0x6957('0x9'));var querystring=require('querystring');var Papa=require(_0x6957('0x10'));var Redis=require(_0x6957('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6957('0x12'));var hardwareService=require(_0x6957('0x13'));var logger=require(_0x6957('0x14'))(_0x6957('0x15'));var utils=require(_0x6957('0x16'));var config=require(_0x6957('0x17'));var licenseUtil=require(_0x6957('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5888d6,_0x548647){_0x548647=_0x548647||0xcc;return function(_0x3f40f0){if(_0x3f40f0){return _0x5888d6[_0x6957('0x19')](_0x548647);}return _0x5888d6[_0x6957('0x1a')](_0x548647)[_0x6957('0x1b')]();};}function respondWithResult(_0x345c3e,_0x1fd3d9){_0x1fd3d9=_0x1fd3d9||0xc8;return function(_0x25d32e){if(_0x25d32e){return _0x345c3e['status'](_0x1fd3d9)['json'](_0x25d32e);}};}function respondWithFilteredResult(_0x4f82cb,_0x35fffc){return function(_0x256ac7){if(_0x256ac7){var _0x228f76=typeof _0x35fffc[_0x6957('0x1c')]==='undefined'&&typeof _0x35fffc[_0x6957('0x1d')]==='undefined';var _0x2a39b5=_0x256ac7[_0x6957('0x1e')];var _0x49aa31=_0x228f76?0x0:_0x35fffc[_0x6957('0x1c')];var _0x448ff6=_0x228f76?_0x256ac7[_0x6957('0x1e')]:_0x35fffc['offset']+_0x35fffc[_0x6957('0x1d')];var _0x2c103c;if(_0x448ff6>=_0x2a39b5){_0x448ff6=_0x2a39b5;_0x2c103c=0xc8;}else{_0x2c103c=0xce;}_0x4f82cb[_0x6957('0x1a')](_0x2c103c);return _0x4f82cb[_0x6957('0x1f')](_0x6957('0x20'),_0x49aa31+'-'+_0x448ff6+'/'+_0x2a39b5)[_0x6957('0x21')](_0x256ac7);}return null;};}function patchUpdates(_0x35ee5b){return function(_0x3081b2){try{jsonpatch['apply'](_0x3081b2,_0x35ee5b,!![]);}catch(_0x5ee3f8){return BPromise[_0x6957('0x22')](_0x5ee3f8);}return _0x3081b2[_0x6957('0x23')]();};}function saveUpdates(_0x18037f,_0x2569f4){return function(_0x3591fa){if(_0x3591fa){return _0x3591fa[_0x6957('0x24')](_0x18037f)[_0x6957('0x25')](function(_0x310a5e){return _0x310a5e;});}return null;};}function removeEntity(_0x56b0ba,_0x2b2dcd){return function(_0x3c9de7){if(_0x3c9de7){return _0x3c9de7[_0x6957('0x26')]()[_0x6957('0x25')](function(){_0x56b0ba['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xa1e6af,_0x2a57b6){return function(_0x5c4e49){if(!_0x5c4e49){_0xa1e6af['sendStatus'](0x194);}return _0x5c4e49;};}function handleError(_0x320e7d,_0xa2f92f){_0xa2f92f=_0xa2f92f||0x1f4;return function(_0x3bc22f){logger['error'](_0x3bc22f[_0x6957('0x27')]);if(_0x3bc22f[_0x6957('0x28')]){delete _0x3bc22f[_0x6957('0x28')];}_0x320e7d[_0x6957('0x1a')](_0xa2f92f)[_0x6957('0x29')](_0x3bc22f);};}exports[_0x6957('0x2a')]=function(_0x2d33ef,_0x320e1a){var _0x595770={},_0x2e7fe1={},_0x3a6e07={'count':0x0,'rows':[]};var _0xd02a9=_[_0x6957('0x2b')](db[_0x6957('0x2c')][_0x6957('0x2d')],function(_0x3f8745){return{'name':_0x3f8745[_0x6957('0x2e')],'type':_0x3f8745[_0x6957('0x2f')][_0x6957('0x30')]};});_0x2e7fe1[_0x6957('0x31')]=_['map'](_0xd02a9,'name');_0x2e7fe1[_0x6957('0x32')]=_[_0x6957('0x33')](_0x2d33ef[_0x6957('0x32')]);_0x2e7fe1[_0x6957('0x34')]=_['intersection'](_0x2e7fe1[_0x6957('0x31')],_0x2e7fe1[_0x6957('0x32')]);_0x595770[_0x6957('0x35')]=_['intersection'](_0x2e7fe1['model'],qs[_0x6957('0x36')](_0x2d33ef[_0x6957('0x32')][_0x6957('0x36')]));_0x595770['attributes']=_0x595770[_0x6957('0x35')][_0x6957('0x37')]?_0x595770[_0x6957('0x35')]:_0x2e7fe1[_0x6957('0x31')];if(!_0x2d33ef[_0x6957('0x32')][_0x6957('0x38')](_0x6957('0x39'))){_0x595770[_0x6957('0x1d')]=qs[_0x6957('0x1d')](_0x2d33ef['query'][_0x6957('0x1d')]);_0x595770[_0x6957('0x1c')]=qs[_0x6957('0x1c')](_0x2d33ef['query']['offset']);}_0x595770['order']=qs[_0x6957('0x3a')](_0x2d33ef['query']['sort']);_0x595770[_0x6957('0x3b')]=qs[_0x6957('0x34')](_['pick'](_0x2d33ef['query'],_0x2e7fe1[_0x6957('0x34')]),_0xd02a9);if(_0x2d33ef[_0x6957('0x32')][_0x6957('0x3c')]){_0x595770[_0x6957('0x3b')]=_[_0x6957('0x3d')](_0x595770['where'],{'$or':_[_0x6957('0x2b')](_0xd02a9,function(_0x5c9be3){if(_0x5c9be3['type']!=='VIRTUAL'){var _0x5ab079={};_0x5ab079[_0x5c9be3['name']]={'$like':'%'+_0x2d33ef['query']['filter']+'%'};return _0x5ab079;}})});}_0x595770=_['merge']({},_0x595770,_0x2d33ef['options']);var _0x20caa3={'where':_0x595770[_0x6957('0x3b')]};return db[_0x6957('0x2c')][_0x6957('0x1e')](_0x20caa3)[_0x6957('0x25')](function(_0x51b189){_0x3a6e07[_0x6957('0x1e')]=_0x51b189;if(_0x2d33ef[_0x6957('0x32')]['includeAll']){_0x595770[_0x6957('0x3e')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x6957('0x3f')](_0x595770);})[_0x6957('0x25')](function(_0x22ec26){_0x3a6e07[_0x6957('0x40')]=_0x22ec26;return _0x3a6e07;})[_0x6957('0x25')](respondWithFilteredResult(_0x320e1a,_0x595770))[_0x6957('0x41')](handleError(_0x320e1a,null));};exports[_0x6957('0x42')]=function(_0x16575e,_0x18fb2a){var _0x35fa2d={'raw':!![],'where':{'id':_0x16575e[_0x6957('0x43')]['id']}},_0x421526={};_0x421526[_0x6957('0x31')]=_[_0x6957('0x33')](db[_0x6957('0x2c')][_0x6957('0x2d')]);_0x421526['query']=_[_0x6957('0x33')](_0x16575e['query']);_0x421526['filters']=_[_0x6957('0x44')](_0x421526['model'],_0x421526['query']);_0x35fa2d[_0x6957('0x35')]=_[_0x6957('0x44')](_0x421526[_0x6957('0x31')],qs[_0x6957('0x36')](_0x16575e[_0x6957('0x32')][_0x6957('0x36')]));_0x35fa2d[_0x6957('0x35')]=_0x35fa2d[_0x6957('0x35')][_0x6957('0x37')]?_0x35fa2d[_0x6957('0x35')]:_0x421526['model'];if(_0x16575e['query'][_0x6957('0x45')]){_0x35fa2d['include']=[{'all':!![]}];}_0x35fa2d=_[_0x6957('0x3d')]({},_0x35fa2d,_0x16575e[_0x6957('0x46')]);return db['JscriptyAnswerReport'][_0x6957('0x47')](_0x35fa2d)[_0x6957('0x25')](handleEntityNotFound(_0x18fb2a,null))[_0x6957('0x25')](respondWithResult(_0x18fb2a,null))[_0x6957('0x41')](handleError(_0x18fb2a,null));};exports[_0x6957('0x48')]=function(_0x497e99,_0x9763aa){return db[_0x6957('0x2c')][_0x6957('0x48')](_0x497e99[_0x6957('0x49')],{})['then'](respondWithResult(_0x9763aa,0xc9))[_0x6957('0x41')](handleError(_0x9763aa,null));};exports[_0x6957('0x24')]=function(_0x5c5d5b,_0x1768ba){if(_0x5c5d5b[_0x6957('0x49')]['id']){delete _0x5c5d5b[_0x6957('0x49')]['id'];}return db[_0x6957('0x2c')]['find']({'where':{'id':_0x5c5d5b['params']['id']}})[_0x6957('0x25')](handleEntityNotFound(_0x1768ba,null))[_0x6957('0x25')](saveUpdates(_0x5c5d5b[_0x6957('0x49')],null))[_0x6957('0x25')](respondWithResult(_0x1768ba,null))['catch'](handleError(_0x1768ba,null));};exports[_0x6957('0x26')]=function(_0x4ca6dc,_0x10fac5){return db['JscriptyAnswerReport'][_0x6957('0x47')]({'where':{'id':_0x4ca6dc['params']['id']}})[_0x6957('0x25')](handleEntityNotFound(_0x10fac5,null))['then'](removeEntity(_0x10fac5,null))['catch'](handleError(_0x10fac5,null));};exports[_0x6957('0x4a')]=function(_0x371e29,_0x38e917){return db[_0x6957('0x2c')][_0x6957('0x4a')]()[_0x6957('0x25')](respondWithResult(_0x38e917,null))[_0x6957('0x41')](handleError(_0x38e917,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index c277de1..ead7411 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 _0x2ee8=['lodash','util','../../config/logger','api','moment','rimraf','../../config/environment','exports','define','JscriptyAnswerReport'];(function(_0x58d42e,_0x5c4d47){var _0x4589c3=function(_0x5a4de1){while(--_0x5a4de1){_0x58d42e['push'](_0x58d42e['shift']());}};_0x4589c3(++_0x5c4d47);}(_0x2ee8,0x136));var _0x82ee=function(_0x4738f9,_0x158414){_0x4738f9=_0x4738f9-0x0;var _0x50994a=_0x2ee8[_0x4738f9];return _0x50994a;};'use strict';var _=require(_0x82ee('0x0'));var util=require(_0x82ee('0x1'));var logger=require(_0x82ee('0x2'))(_0x82ee('0x3'));var moment=require(_0x82ee('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x82ee('0x5'));var config=require(_0x82ee('0x6'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0x82ee('0x7')]=function(_0x2d1fbc,_0x3412c7){return _0x2d1fbc[_0x82ee('0x8')](_0x82ee('0x9'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x741a=['bluebird','path','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','report_jscripty_answers','lodash','api','moment'];(function(_0x21c48,_0x49ac0a){var _0x1f2cea=function(_0x51a5eb){while(--_0x51a5eb){_0x21c48['push'](_0x21c48['shift']());}};_0x1f2cea(++_0x49ac0a);}(_0x741a,0xb1));var _0xa741=function(_0x4a3e73,_0x4fea7c){_0x4a3e73=_0x4a3e73-0x0;var _0x2d8eb9=_0x741a[_0x4a3e73];return _0x2d8eb9;};'use strict';var _=require(_0xa741('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa741('0x1'));var moment=require(_0xa741('0x2'));var BPromise=require(_0xa741('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa741('0x4'));var rimraf=require('rimraf');var config=require(_0xa741('0x5'));var attributes=require(_0xa741('0x6'));module[_0xa741('0x7')]=function(_0x4f1253,_0x2f1d11){return _0x4f1253[_0xa741('0x8')]('JscriptyAnswerReport',attributes,{'tableName':_0xa741('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index 49b83ec..0b78c2e 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 _0xcb73=['catch','lodash','util','moment','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xcb73,0xbe));var _0x3cb7=function(_0x2f8c7b,_0x5b5b2a){_0x2f8c7b=_0x2f8c7b-0x0;var _0x1ab0b5=_0xcb73[_0x2f8c7b];return _0x1ab0b5;};'use strict';var _=require(_0x3cb7('0x0'));var util=require(_0x3cb7('0x1'));var moment=require(_0x3cb7('0x2'));var BPromise=require('bluebird');var rs=require(_0x3cb7('0x3'));var fs=require('fs');var Redis=require(_0x3cb7('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3cb7('0x5'));var config=require(_0x3cb7('0x6'));var jayson=require(_0x3cb7('0x7'));var client=jayson[_0x3cb7('0x8')][_0x3cb7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x35776c,_0x29dfcd,_0x1f7608){return new BPromise(function(_0x5dc0c9,_0x532f6c){return client[_0x3cb7('0xa')](_0x35776c,_0x1f7608)[_0x3cb7('0xb')](function(_0xeff358){logger[_0x3cb7('0xc')](_0x3cb7('0xd'),_0x29dfcd,_0x3cb7('0xe'));logger['debug'](_0x3cb7('0xf'),_0x29dfcd,_0x3cb7('0xe'),JSON['stringify'](_0xeff358));if(_0xeff358[_0x3cb7('0x10')]){if(_0xeff358[_0x3cb7('0x10')][_0x3cb7('0x11')]===0x1f4){logger[_0x3cb7('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x29dfcd,_0xeff358[_0x3cb7('0x10')]['message']);return _0x532f6c(_0xeff358[_0x3cb7('0x10')][_0x3cb7('0x12')]);}logger[_0x3cb7('0x10')](_0x3cb7('0xd'),_0x29dfcd,_0xeff358[_0x3cb7('0x10')][_0x3cb7('0x12')]);return _0x5dc0c9(_0xeff358['error'][_0x3cb7('0x12')]);}else{logger['info'](_0x3cb7('0xd'),_0x29dfcd,_0x3cb7('0xe'));_0x5dc0c9(_0xeff358[_0x3cb7('0x13')][_0x3cb7('0x12')]);}})[_0x3cb7('0x14')](function(_0x3e1f3f){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x29dfcd,_0x3e1f3f);_0x532f6c(_0x3e1f3f);});});} \ No newline at end of file +var _0x656a=['JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','lodash','util','bluebird','ioredis','rpc','../../config/environment','jayson/promise','then'];(function(_0x51b362,_0x2a3af3){var _0x18bd6=function(_0xd5fcdb){while(--_0xd5fcdb){_0x51b362['push'](_0x51b362['shift']());}};_0x18bd6(++_0x2a3af3);}(_0x656a,0x68));var _0xa656=function(_0x2ace95,_0x186b37){_0x2ace95=_0x2ace95-0x0;var _0x35ecfa=_0x656a[_0x2ace95];return _0x35ecfa;};'use strict';var _=require(_0xa656('0x0'));var util=require(_0xa656('0x1'));var moment=require('moment');var BPromise=require(_0xa656('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa656('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa656('0x4'));var config=require(_0xa656('0x5'));var jayson=require(_0xa656('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x66669c,_0x318717,_0x4dbdfa){return new BPromise(function(_0x225083,_0x2bffa6){return client['request'](_0x66669c,_0x4dbdfa)[_0xa656('0x7')](function(_0x500fff){logger['info'](_0xa656('0x8'),_0x318717,_0xa656('0x9'));logger['debug'](_0xa656('0xa'),_0x318717,'request\x20sent',JSON[_0xa656('0xb')](_0x500fff));if(_0x500fff[_0xa656('0xc')]){if(_0x500fff[_0xa656('0xc')][_0xa656('0xd')]===0x1f4){logger['error'](_0xa656('0x8'),_0x318717,_0x500fff['error'][_0xa656('0xe')]);return _0x2bffa6(_0x500fff[_0xa656('0xc')][_0xa656('0xe')]);}logger['error'](_0xa656('0x8'),_0x318717,_0x500fff[_0xa656('0xc')][_0xa656('0xe')]);return _0x225083(_0x500fff['error'][_0xa656('0xe')]);}else{logger[_0xa656('0xf')](_0xa656('0x8'),_0x318717,'request\x20sent');_0x225083(_0x500fff['result']['message']);}})['catch'](function(_0x1879a4){logger['error'](_0xa656('0x8'),_0x318717,_0x1879a4);_0x2bffa6(_0x1879a4);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 15f1a49..0096ffc 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 _0xc705=['getAnswers','/:id/summary','30s','create','post','clone','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','/:id/sessions','getSessions','/:id/answers'];(function(_0x4aaf5c,_0x33b1a7){var _0x3f32e2=function(_0x1afa7d){while(--_0x1afa7d){_0x4aaf5c['push'](_0x4aaf5c['shift']());}};_0x3f32e2(++_0x33b1a7);}(_0xc705,0x192));var _0x5c70=function(_0x999b85,_0x1edc2b){_0x999b85=_0x999b85-0x0;var _0x1d7124=_0xc705[_0x999b85];return _0x1d7124;};'use strict';var multer=require(_0x5c70('0x0'));var util=require(_0x5c70('0x1'));var path=require(_0x5c70('0x2'));var timeout=require(_0x5c70('0x3'));var express=require('express');var router=express[_0x5c70('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5c70('0x5'));var interaction=require(_0x5c70('0x6'));var config=require(_0x5c70('0x7'));var controller=require(_0x5c70('0x8'));router[_0x5c70('0x9')]('/',auth[_0x5c70('0xa')](),controller['index']);router[_0x5c70('0x9')]('/:id',auth[_0x5c70('0xa')](),controller['show']);router[_0x5c70('0x9')](_0x5c70('0xb'),auth[_0x5c70('0xa')](),controller[_0x5c70('0xc')]);router[_0x5c70('0x9')](_0x5c70('0xd'),auth[_0x5c70('0xa')](),controller[_0x5c70('0xe')]);router[_0x5c70('0x9')](_0x5c70('0xf'),auth[_0x5c70('0xa')](),timeout(_0x5c70('0x10')),controller['getSummary']);router['post']('/',auth[_0x5c70('0xa')](),controller[_0x5c70('0x11')]);router[_0x5c70('0x12')]('/:id/clone',auth['isAuthenticated'](),controller[_0x5c70('0x13')]);router[_0x5c70('0x14')](_0x5c70('0x15'),auth[_0x5c70('0xa')](),controller[_0x5c70('0x16')]);router[_0x5c70('0x17')](_0x5c70('0x15'),auth[_0x5c70('0xa')](),controller[_0x5c70('0x18')]);module[_0x5c70('0x19')]=router; \ No newline at end of file +var _0x5568=['isAuthenticated','index','/:id','/:id/sessions','getSessions','/:id/answers','getAnswers','30s','getSummary','post','/:id/clone','clone','put','update','delete','destroy','exports','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get'];(function(_0xcf581b,_0x4359dd){var _0x4f454d=function(_0x182d58){while(--_0x182d58){_0xcf581b['push'](_0xcf581b['shift']());}};_0x4f454d(++_0x4359dd);}(_0x5568,0x119));var _0x8556=function(_0x2b618e,_0x2dd4f0){_0x2b618e=_0x2b618e-0x0;var _0x1b7f9f=_0x5568[_0x2b618e];return _0x1b7f9f;};'use strict';var multer=require('multer');var util=require(_0x8556('0x0'));var path=require('path');var timeout=require(_0x8556('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8556('0x2'));var interaction=require(_0x8556('0x3'));var config=require(_0x8556('0x4'));var controller=require(_0x8556('0x5'));router[_0x8556('0x6')]('/',auth[_0x8556('0x7')](),controller[_0x8556('0x8')]);router[_0x8556('0x6')](_0x8556('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x8556('0x6')](_0x8556('0xa'),auth[_0x8556('0x7')](),controller[_0x8556('0xb')]);router['get'](_0x8556('0xc'),auth[_0x8556('0x7')](),controller[_0x8556('0xd')]);router[_0x8556('0x6')]('/:id/summary',auth['isAuthenticated'](),timeout(_0x8556('0xe')),controller[_0x8556('0xf')]);router[_0x8556('0x10')]('/',auth[_0x8556('0x7')](),controller['create']);router[_0x8556('0x10')](_0x8556('0x11'),auth[_0x8556('0x7')](),controller[_0x8556('0x12')]);router[_0x8556('0x13')](_0x8556('0x9'),auth['isAuthenticated'](),controller[_0x8556('0x14')]);router[_0x8556('0x15')](_0x8556('0x9'),auth[_0x8556('0x7')](),controller[_0x8556('0x16')]);module[_0x8556('0x17')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 3de17f9..2430081 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 _0x3012=['isString','setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','BOOLEAN','sequelize','util','exports','STRING','name','TEXT','long','isObjectLike','formData','stringify'];(function(_0x2cf5c6,_0x2933c9){var _0xf7d000=function(_0x4fb23c){while(--_0x4fb23c){_0x2cf5c6['push'](_0x2cf5c6['shift']());}};_0xf7d000(++_0x2933c9);}(_0x3012,0x1a6));var _0x2301=function(_0x3d6ea3,_0xbbdff2){_0x3d6ea3=_0x3d6ea3-0x0;var _0x1f24b7=_0x3012[_0x3d6ea3];return _0x1f24b7;};'use strict';var Sequelize=require(_0x2301('0x0'));var _=require('lodash');var util=require(_0x2301('0x1'));module[_0x2301('0x2')]={'name':{'type':Sequelize[_0x2301('0x3')],'unique':_0x2301('0x4')},'description':{'type':Sequelize[_0x2301('0x3')]},'formData':{'type':Sequelize[_0x2301('0x5')](_0x2301('0x6')),'set':function(_0x59990e){if(_[_0x2301('0x7')](_0x59990e)){this['setDataValue'](_0x2301('0x8'),JSON[_0x2301('0x9')](_0x59990e));}else if(_[_0x2301('0xa')](_0x59990e)){this[_0x2301('0xb')](_0x2301('0x8'),_0x59990e);}else{this[_0x2301('0xb')](_0x2301('0x8'),util[_0x2301('0xc')](_0x2301('0xd'),this[_0x2301('0xe')](_0x2301('0x4'))||'',this[_0x2301('0xe')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x2301('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x2301('0xf')],'defaultValue':![]}}; \ No newline at end of file +var _0x9f0c=['isString','setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','util','exports','STRING','name','TEXT','long','isObjectLike'];(function(_0x586a05,_0x213f1d){var _0x536a90=function(_0x497a1f){while(--_0x497a1f){_0x586a05['push'](_0x586a05['shift']());}};_0x536a90(++_0x213f1d);}(_0x9f0c,0x137));var _0xc9f0=function(_0x5b0ba6,_0x1596de){_0x5b0ba6=_0x5b0ba6-0x0;var _0x57460f=_0x9f0c[_0x5b0ba6];return _0x57460f;};'use strict';var Sequelize=require(_0xc9f0('0x0'));var _=require(_0xc9f0('0x1'));var util=require(_0xc9f0('0x2'));module[_0xc9f0('0x3')]={'name':{'type':Sequelize[_0xc9f0('0x4')],'unique':_0xc9f0('0x5')},'description':{'type':Sequelize[_0xc9f0('0x4')]},'formData':{'type':Sequelize[_0xc9f0('0x6')](_0xc9f0('0x7')),'set':function(_0xdd5cb1){if(_[_0xc9f0('0x8')](_0xdd5cb1)){this['setDataValue']('formData',JSON['stringify'](_0xdd5cb1));}else if(_[_0xc9f0('0x9')](_0xdd5cb1)){this[_0xc9f0('0xa')]('formData',_0xdd5cb1);}else{this['setDataValue']('formData',util[_0xc9f0('0xb')](_0xc9f0('0xc'),this[_0xc9f0('0xd')](_0xc9f0('0x5'))||'',this['getDataValue'](_0xc9f0('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xc9f0('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xc9f0('0xf')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 44c6183..123c7ea 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 _0xe6f1=['VIRTUAL','includeAll','include','rows','catch','show','params','rawAttributes','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Projects','UserProfileSection','clone','length','createdAt','updatedAt','omit','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getSessions','findOne','hasOwnProperty','order','ProjectId','JscriptySessionReport','findAll','JscriptyAnswerReport','number','fromCharCode','indexOf','toString','replace','getSummary','startTime','starttime','parse','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-type','text/csv','eml-format','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','send','map','JscriptyProject','fieldName','type','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','merge'];(function(_0x378985,_0x4332d2){var _0x28198f=function(_0x54d0c1){while(--_0x54d0c1){_0x378985['push'](_0x378985['shift']());}};_0x28198f(++_0x4332d2);}(_0xe6f1,0x19c));var _0x1e6f=function(_0xd3348b,_0x288d47){_0xd3348b=_0xd3348b-0x0;var _0x583cdc=_0xe6f1[_0xd3348b];return _0x583cdc;};'use strict';var emlformat=require(_0x1e6f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1e6f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1e6f('0x2'));var moment=require('moment');var BPromise=require(_0x1e6f('0x3'));var Mustache=require('mustache');var util=require(_0x1e6f('0x4'));var path=require(_0x1e6f('0x5'));var sox=require(_0x1e6f('0x6'));var csv=require(_0x1e6f('0x7'));var ejs=require(_0x1e6f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1e6f('0x9'));var deskjs=require(_0x1e6f('0xa'));var toCsv=require('to-csv');var querystring=require(_0x1e6f('0xb'));var Papa=require(_0x1e6f('0xc'));var Redis=require(_0x1e6f('0xd'));var authService=require(_0x1e6f('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x1e6f('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1e6f('0x10'))(_0x1e6f('0x11'));var utils=require(_0x1e6f('0x12'));var config=require(_0x1e6f('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x1e6f('0x14'))['db'];function respondWithStatusCode(_0x4ab83a,_0x90208a){_0x90208a=_0x90208a||0xcc;return function(_0x15ae75){if(_0x15ae75){return _0x4ab83a[_0x1e6f('0x15')](_0x90208a);}return _0x4ab83a[_0x1e6f('0x16')](_0x90208a)[_0x1e6f('0x17')]();};}function respondWithResult(_0x4f2cf0,_0xd7e41c){_0xd7e41c=_0xd7e41c||0xc8;return function(_0x3c574c){if(_0x3c574c){return _0x4f2cf0[_0x1e6f('0x16')](_0xd7e41c)[_0x1e6f('0x18')](_0x3c574c);}};}function respondWithFilteredResult(_0x344930,_0x26b192){return function(_0x1deb79){if(_0x1deb79){var _0x344672=typeof _0x26b192[_0x1e6f('0x19')]===_0x1e6f('0x1a')&&typeof _0x26b192['limit']===_0x1e6f('0x1a');var _0x34c88a=_0x1deb79[_0x1e6f('0x1b')];var _0x27c1aa=_0x344672?0x0:_0x26b192[_0x1e6f('0x19')];var _0x48dadd=_0x344672?_0x1deb79[_0x1e6f('0x1b')]:_0x26b192[_0x1e6f('0x19')]+_0x26b192[_0x1e6f('0x1c')];var _0x18574b;if(_0x48dadd>=_0x34c88a){_0x48dadd=_0x34c88a;_0x18574b=0xc8;}else{_0x18574b=0xce;}_0x344930[_0x1e6f('0x16')](_0x18574b);return _0x344930[_0x1e6f('0x1d')](_0x1e6f('0x1e'),_0x27c1aa+'-'+_0x48dadd+'/'+_0x34c88a)[_0x1e6f('0x18')](_0x1deb79);}return null;};}function patchUpdates(_0x323bc8){return function(_0x2db8e2){try{jsonpatch[_0x1e6f('0x1f')](_0x2db8e2,_0x323bc8,!![]);}catch(_0x59bffe){return BPromise[_0x1e6f('0x20')](_0x59bffe);}return _0x2db8e2[_0x1e6f('0x21')]();};}function saveUpdates(_0x36f8fd,_0x4d4e21){return function(_0x35fa28){if(_0x35fa28){return _0x35fa28[_0x1e6f('0x22')](_0x36f8fd)['then'](function(_0x1f157e){return _0x1f157e;});}return null;};}function removeEntity(_0x192365,_0x2656fd){return function(_0x30af19){if(_0x30af19){return _0x30af19['destroy']()[_0x1e6f('0x23')](function(){var _0x2479d1=_0x30af19[_0x1e6f('0x24')]({'plain':!![]});var _0x4894fb='Projects';return db[_0x1e6f('0x25')][_0x1e6f('0x26')]({'where':{'type':_0x4894fb,'resourceId':_0x2479d1['id']}})[_0x1e6f('0x23')](function(){return _0x30af19;});})[_0x1e6f('0x23')](function(){_0x192365[_0x1e6f('0x16')](0xcc)[_0x1e6f('0x17')]();});}};}function handleEntityNotFound(_0x100684,_0x3a856e){return function(_0x5caa63){if(!_0x5caa63){_0x100684['sendStatus'](0x194);}return _0x5caa63;};}function handleError(_0x12d211,_0x3065ad){_0x3065ad=_0x3065ad||0x1f4;return function(_0x3fef2f){logger[_0x1e6f('0x27')](_0x3fef2f[_0x1e6f('0x28')]);if(_0x3fef2f[_0x1e6f('0x29')]){delete _0x3fef2f[_0x1e6f('0x29')];}_0x12d211['status'](_0x3065ad)[_0x1e6f('0x2a')](_0x3fef2f);};}exports['index']=function(_0x1474d7,_0x15e948){var _0x41f53e={},_0x5393b5={},_0x200277={'count':0x0,'rows':[]};var _0x121884=_[_0x1e6f('0x2b')](db[_0x1e6f('0x2c')]['rawAttributes'],function(_0x395cc0){return{'name':_0x395cc0[_0x1e6f('0x2d')],'type':_0x395cc0[_0x1e6f('0x2e')]['key']};});_0x5393b5[_0x1e6f('0x2f')]=_[_0x1e6f('0x2b')](_0x121884,_0x1e6f('0x29'));_0x5393b5[_0x1e6f('0x30')]=_[_0x1e6f('0x31')](_0x1474d7[_0x1e6f('0x30')]);_0x5393b5[_0x1e6f('0x32')]=_[_0x1e6f('0x33')](_0x5393b5[_0x1e6f('0x2f')],_0x5393b5[_0x1e6f('0x30')]);_0x41f53e[_0x1e6f('0x34')]=_[_0x1e6f('0x33')](_0x5393b5[_0x1e6f('0x2f')],qs['fields'](_0x1474d7['query'][_0x1e6f('0x35')]));_0x41f53e[_0x1e6f('0x34')]=_0x41f53e[_0x1e6f('0x34')]['length']?_0x41f53e[_0x1e6f('0x34')]:_0x5393b5['model'];if(!_0x1474d7[_0x1e6f('0x30')]['hasOwnProperty'](_0x1e6f('0x36'))){_0x41f53e[_0x1e6f('0x1c')]=qs[_0x1e6f('0x1c')](_0x1474d7[_0x1e6f('0x30')]['limit']);_0x41f53e['offset']=qs[_0x1e6f('0x19')](_0x1474d7[_0x1e6f('0x30')][_0x1e6f('0x19')]);}_0x41f53e['order']=qs['sort'](_0x1474d7[_0x1e6f('0x30')][_0x1e6f('0x37')]);_0x41f53e[_0x1e6f('0x38')]=qs[_0x1e6f('0x32')](_[_0x1e6f('0x39')](_0x1474d7[_0x1e6f('0x30')],_0x5393b5['filters']),_0x121884);if(_0x1474d7[_0x1e6f('0x30')][_0x1e6f('0x3a')]){_0x41f53e[_0x1e6f('0x38')]=_[_0x1e6f('0x3b')](_0x41f53e[_0x1e6f('0x38')],{'$or':_[_0x1e6f('0x2b')](_0x121884,function(_0xe6cc56){if(_0xe6cc56[_0x1e6f('0x2e')]!==_0x1e6f('0x3c')){var _0x1be7c9={};_0x1be7c9[_0xe6cc56[_0x1e6f('0x29')]]={'$like':'%'+_0x1474d7[_0x1e6f('0x30')][_0x1e6f('0x3a')]+'%'};return _0x1be7c9;}})});}_0x41f53e=_['merge']({},_0x41f53e,_0x1474d7['options']);var _0x1e39bf={'where':_0x41f53e[_0x1e6f('0x38')]};return db['JscriptyProject'][_0x1e6f('0x1b')](_0x1e39bf)[_0x1e6f('0x23')](function(_0x20ce5e){_0x200277[_0x1e6f('0x1b')]=_0x20ce5e;if(_0x1474d7[_0x1e6f('0x30')][_0x1e6f('0x3d')]){_0x41f53e[_0x1e6f('0x3e')]=[{'all':!![]}];}return db[_0x1e6f('0x2c')]['findAll'](_0x41f53e);})['then'](function(_0xafc2c3){_0x200277[_0x1e6f('0x3f')]=_0xafc2c3;return _0x200277;})[_0x1e6f('0x23')](respondWithFilteredResult(_0x15e948,_0x41f53e))[_0x1e6f('0x40')](handleError(_0x15e948,null));};exports[_0x1e6f('0x41')]=function(_0x161f30,_0x286896){var _0x518d2f={'raw':![],'where':{'id':_0x161f30[_0x1e6f('0x42')]['id']}},_0x16e9ed={};_0x16e9ed[_0x1e6f('0x2f')]=_['keys'](db[_0x1e6f('0x2c')][_0x1e6f('0x43')]);_0x16e9ed[_0x1e6f('0x30')]=_[_0x1e6f('0x31')](_0x161f30[_0x1e6f('0x30')]);_0x16e9ed[_0x1e6f('0x32')]=_['intersection'](_0x16e9ed[_0x1e6f('0x2f')],_0x16e9ed['query']);_0x518d2f[_0x1e6f('0x34')]=_[_0x1e6f('0x33')](_0x16e9ed[_0x1e6f('0x2f')],qs[_0x1e6f('0x35')](_0x161f30['query'][_0x1e6f('0x35')]));_0x518d2f[_0x1e6f('0x34')]=_0x518d2f[_0x1e6f('0x34')]['length']?_0x518d2f[_0x1e6f('0x34')]:_0x16e9ed[_0x1e6f('0x2f')];if(_0x161f30['query'][_0x1e6f('0x3d')]){_0x518d2f[_0x1e6f('0x3e')]=[{'all':!![]}];}_0x518d2f=_[_0x1e6f('0x3b')]({},_0x518d2f,_0x161f30[_0x1e6f('0x44')]);return db[_0x1e6f('0x2c')][_0x1e6f('0x45')](_0x518d2f)['then'](handleEntityNotFound(_0x286896,null))[_0x1e6f('0x23')](respondWithResult(_0x286896,null))['catch'](handleError(_0x286896,null));};exports[_0x1e6f('0x46')]=function(_0x1ff109,_0x4df943){return db[_0x1e6f('0x2c')][_0x1e6f('0x46')](_0x1ff109[_0x1e6f('0x47')],{})[_0x1e6f('0x23')](function(_0xcc09a4){var _0x2f6078=_0x1ff109[_0x1e6f('0x48')][_0x1e6f('0x24')]({'plain':!![]});if(!_0x2f6078)throw new Error(_0x1e6f('0x49'));if(_0x2f6078[_0x1e6f('0x4a')]==='user'){var _0x42e205=_0xcc09a4['get']({'plain':!![]});var _0x49ab51=_0x1e6f('0x4b');return db[_0x1e6f('0x4c')]['find']({'where':{'name':_0x49ab51,'userProfileId':_0x2f6078['userProfileId']},'raw':!![]})[_0x1e6f('0x23')](function(_0x808268){if(_0x808268&&_0x808268['autoAssociation']===0x0){return db[_0x1e6f('0x25')][_0x1e6f('0x46')]({'name':_0x42e205[_0x1e6f('0x29')],'resourceId':_0x42e205['id'],'type':_0x808268[_0x1e6f('0x29')],'sectionId':_0x808268['id']},{})[_0x1e6f('0x23')](function(){return _0xcc09a4;});}else{return _0xcc09a4;}})[_0x1e6f('0x40')](function(_0x5efeae){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5efeae);throw _0x5efeae;});}return _0xcc09a4;})[_0x1e6f('0x23')](respondWithResult(_0x4df943,0xc9))[_0x1e6f('0x40')](handleError(_0x4df943,null));};exports[_0x1e6f('0x4d')]=function(_0x2e1b05,_0x2cc13b){var _0x43755f={'where':{'id':_0x2e1b05['params']['id']}},_0x282ecd={};_0x282ecd['model']=_[_0x1e6f('0x31')](db[_0x1e6f('0x2c')]['rawAttributes']);_0x43755f[_0x1e6f('0x34')]=_[_0x1e6f('0x33')](_0x282ecd[_0x1e6f('0x2f')],qs[_0x1e6f('0x35')](_0x2e1b05[_0x1e6f('0x30')]['fields']));_0x43755f[_0x1e6f('0x34')]=_0x43755f[_0x1e6f('0x34')][_0x1e6f('0x4e')]?_0x43755f[_0x1e6f('0x34')]:_0x282ecd[_0x1e6f('0x2f')];if(_0x2e1b05[_0x1e6f('0x30')][_0x1e6f('0x3d')]){_0x43755f[_0x1e6f('0x3e')]=[{'all':!![]}];}_0x43755f=_[_0x1e6f('0x3b')]({},_0x43755f,_0x2e1b05[_0x1e6f('0x44')]);return db['JscriptyProject'][_0x1e6f('0x45')](_0x43755f)['then'](handleEntityNotFound(_0x2cc13b,null))[_0x1e6f('0x23')](function(_0x2b613f){if(_0x2b613f){var _0x2e6b3d=_0x2b613f['get']({'plain':!![]});_0x2e6b3d=qs['omit'](_0x2e6b3d,['id',_0x1e6f('0x4f'),_0x1e6f('0x50')]);_0x2e1b05['body']=_[_0x1e6f('0x51')](_0x2e1b05['body'],['id','createdAt',_0x1e6f('0x50')]);return db['JscriptyProject'][_0x1e6f('0x46')](_[_0x1e6f('0x3b')](_0x2e6b3d,_0x2e1b05[_0x1e6f('0x47')]),{'include':_0x2e1b05['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x5daf09){var _0xf2ab69=_0x2e1b05[_0x1e6f('0x48')]['get']({'plain':!![]});if(!_0xf2ab69)throw new Error(_0x1e6f('0x49'));if(_0xf2ab69[_0x1e6f('0x4a')]==='user'){var _0x1263e4=_0x5daf09['get']({'plain':!![]});var _0x16d6cb=_0x1e6f('0x4b');return db[_0x1e6f('0x4c')][_0x1e6f('0x45')]({'where':{'name':_0x16d6cb,'userProfileId':_0xf2ab69[_0x1e6f('0x52')]},'raw':!![]})[_0x1e6f('0x23')](function(_0xf8b41c){if(_0xf8b41c&&_0xf8b41c[_0x1e6f('0x53')]===0x0){return db[_0x1e6f('0x25')][_0x1e6f('0x46')]({'name':_0x1263e4[_0x1e6f('0x29')],'resourceId':_0x1263e4['id'],'type':_0xf8b41c['name'],'sectionId':_0xf8b41c['id']},{})[_0x1e6f('0x23')](function(){return _0x5daf09;});}else{return _0x5daf09;}})[_0x1e6f('0x40')](function(_0x432f40){logger[_0x1e6f('0x27')](_0x1e6f('0x54'),_0x432f40);throw _0x432f40;});}return _0x5daf09;});}})['then'](respondWithResult(_0x2cc13b,0xc9))[_0x1e6f('0x40')](handleError(_0x2cc13b,null));};exports[_0x1e6f('0x22')]=function(_0x217c67,_0x131594){if(_0x217c67[_0x1e6f('0x47')]['id']){delete _0x217c67[_0x1e6f('0x47')]['id'];}return db[_0x1e6f('0x2c')]['find']({'where':{'id':_0x217c67[_0x1e6f('0x42')]['id']}})['then'](handleEntityNotFound(_0x131594,null))[_0x1e6f('0x23')](saveUpdates(_0x217c67[_0x1e6f('0x47')],null))['then'](respondWithResult(_0x131594,null))[_0x1e6f('0x40')](handleError(_0x131594,null));};exports['destroy']=function(_0x30fe27,_0x318992){return db[_0x1e6f('0x2c')][_0x1e6f('0x45')]({'where':{'id':_0x30fe27[_0x1e6f('0x42')]['id']}})['then'](handleEntityNotFound(_0x318992,null))[_0x1e6f('0x23')](removeEntity(_0x318992,null))[_0x1e6f('0x40')](handleError(_0x318992,null));};exports[_0x1e6f('0x55')]=function(_0x512df3,_0x4c67cd,_0x291cc3){var _0x4c8606={'raw':!![],'where':{}};var _0x4a4196={};var _0x29609d={'count':0x0,'rows':[]};return db[_0x1e6f('0x2c')][_0x1e6f('0x56')]({'where':{'id':_0x512df3[_0x1e6f('0x42')]['id']}})[_0x1e6f('0x23')](handleEntityNotFound(_0x4c67cd,null))[_0x1e6f('0x23')](function(_0x48fae7){if(_0x48fae7){_0x4a4196['model']=_['keys'](db['JscriptySessionReport'][_0x1e6f('0x43')]);_0x4a4196[_0x1e6f('0x30')]=_[_0x1e6f('0x31')](_0x512df3[_0x1e6f('0x30')]);_0x4a4196[_0x1e6f('0x32')]=_['intersection'](_0x4a4196[_0x1e6f('0x2f')],_0x4a4196[_0x1e6f('0x30')]);_0x4c8606[_0x1e6f('0x34')]=_['intersection'](_0x4a4196[_0x1e6f('0x2f')],qs['fields'](_0x512df3[_0x1e6f('0x30')][_0x1e6f('0x35')]));_0x4c8606[_0x1e6f('0x34')]=_0x4c8606[_0x1e6f('0x34')][_0x1e6f('0x4e')]?_0x4c8606[_0x1e6f('0x34')]:_0x4a4196['model'];if(!_0x512df3[_0x1e6f('0x30')][_0x1e6f('0x57')](_0x1e6f('0x36'))){_0x4c8606['limit']=qs[_0x1e6f('0x1c')](_0x512df3['query'][_0x1e6f('0x1c')]);_0x4c8606[_0x1e6f('0x19')]=qs[_0x1e6f('0x19')](_0x512df3[_0x1e6f('0x30')]['offset']);}_0x4c8606[_0x1e6f('0x58')]=qs[_0x1e6f('0x37')](_0x512df3[_0x1e6f('0x30')][_0x1e6f('0x37')]);_0x4c8606[_0x1e6f('0x38')]=qs[_0x1e6f('0x32')](_['pick'](_0x512df3['query'],_0x4a4196[_0x1e6f('0x32')]));_0x4c8606[_0x1e6f('0x38')][_0x1e6f('0x59')]=_0x48fae7['id'];if(_0x512df3['query'][_0x1e6f('0x3a')]){_0x4c8606['where']=_[_0x1e6f('0x3b')](_0x4c8606['where'],{'$or':_[_0x1e6f('0x2b')](_0x4c8606[_0x1e6f('0x34')],function(_0x275697){var _0xafc617={};_0xafc617[_0x275697]={'$like':'%'+_0x512df3[_0x1e6f('0x30')]['filter']+'%'};return _0xafc617;})});}_0x4c8606=_['merge']({},_0x4c8606,_0x512df3[_0x1e6f('0x44')]);return db[_0x1e6f('0x5a')]['count']({'where':_0x4c8606[_0x1e6f('0x38')]})[_0x1e6f('0x23')](function(_0xbf1b00){_0x29609d[_0x1e6f('0x1b')]=_0xbf1b00;if(_0x512df3[_0x1e6f('0x30')]['includeAll']){_0x4c8606['include']=[{'all':!![]}];}return db[_0x1e6f('0x5a')][_0x1e6f('0x5b')](_0x4c8606);})[_0x1e6f('0x23')](function(_0x446af8){_0x29609d[_0x1e6f('0x3f')]=_0x446af8;return _0x29609d;});}})[_0x1e6f('0x23')](respondWithFilteredResult(_0x4c67cd,_0x4c8606))[_0x1e6f('0x40')](handleError(_0x4c67cd,null));};exports['getAnswers']=function(_0xa40dc,_0x286bb1,_0x4211f3){var _0x1b2469={'raw':!![],'where':{}};var _0xaf632a={};var _0xfd7511={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x1e6f('0x56')]({'where':{'id':_0xa40dc[_0x1e6f('0x42')]['id']}})['then'](handleEntityNotFound(_0x286bb1,null))[_0x1e6f('0x23')](function(_0x1cadbe){if(_0x1cadbe){_0xaf632a['model']=_[_0x1e6f('0x31')](db[_0x1e6f('0x5c')]['rawAttributes']);_0xaf632a[_0x1e6f('0x30')]=_['keys'](_0xa40dc[_0x1e6f('0x30')]);_0xaf632a[_0x1e6f('0x32')]=_[_0x1e6f('0x33')](_0xaf632a[_0x1e6f('0x2f')],_0xaf632a[_0x1e6f('0x30')]);_0x1b2469[_0x1e6f('0x34')]=_[_0x1e6f('0x33')](_0xaf632a[_0x1e6f('0x2f')],qs[_0x1e6f('0x35')](_0xa40dc[_0x1e6f('0x30')][_0x1e6f('0x35')]));_0x1b2469[_0x1e6f('0x34')]=_0x1b2469['attributes']['length']?_0x1b2469[_0x1e6f('0x34')]:_0xaf632a['model'];if(!_0xa40dc[_0x1e6f('0x30')][_0x1e6f('0x57')]('nolimit')){_0x1b2469['limit']=qs['limit'](_0xa40dc['query']['limit']);_0x1b2469[_0x1e6f('0x19')]=qs[_0x1e6f('0x19')](_0xa40dc['query'][_0x1e6f('0x19')]);}_0x1b2469[_0x1e6f('0x58')]=qs[_0x1e6f('0x37')](_0xa40dc[_0x1e6f('0x30')][_0x1e6f('0x37')]);_0x1b2469['where']=qs['filters'](_[_0x1e6f('0x39')](_0xa40dc[_0x1e6f('0x30')],_0xaf632a[_0x1e6f('0x32')]));_0x1b2469[_0x1e6f('0x38')][_0x1e6f('0x59')]=_0x1cadbe['id'];if(_0xa40dc[_0x1e6f('0x30')][_0x1e6f('0x3a')]){_0x1b2469[_0x1e6f('0x38')]=_[_0x1e6f('0x3b')](_0x1b2469[_0x1e6f('0x38')],{'$or':_['map'](_0x1b2469[_0x1e6f('0x34')],function(_0x512cb4){var _0xfedf16={};_0xfedf16[_0x512cb4]={'$like':'%'+_0xa40dc[_0x1e6f('0x30')][_0x1e6f('0x3a')]+'%'};return _0xfedf16;})});}_0x1b2469=_['merge']({},_0x1b2469,_0xa40dc['options']);return db[_0x1e6f('0x5c')][_0x1e6f('0x1b')]({'where':_0x1b2469[_0x1e6f('0x38')]})[_0x1e6f('0x23')](function(_0x1d49c3){_0xfd7511[_0x1e6f('0x1b')]=_0x1d49c3;if(_0xa40dc['query'][_0x1e6f('0x3d')]){_0x1b2469[_0x1e6f('0x3e')]=[{'all':!![]}];}return db[_0x1e6f('0x5c')]['findAll'](_0x1b2469);})[_0x1e6f('0x23')](function(_0x11805c){_0xfd7511[_0x1e6f('0x3f')]=_0x11805c;return _0xfd7511;});}})[_0x1e6f('0x23')](respondWithFilteredResult(_0x286bb1,_0x1b2469))[_0x1e6f('0x40')](handleError(_0x286bb1,null));};function char(_0x5e265b){return _0x1e6f('0x5d')===typeof _0x5e265b?String[_0x1e6f('0x5e')][_0x1e6f('0x1f')](null,arguments):_0x5e265b;}function needsEncapsulation(_0x535434){return!!_0x535434&&(_0x535434['toString']()[_0x1e6f('0x5f')](char(0xd))>=0x0||_0x535434['toString']()[_0x1e6f('0x5f')](char(0xa))>=0x0||_0x535434[_0x1e6f('0x60')]()[_0x1e6f('0x5f')](char(0x2c))>=0x0||_0x535434[_0x1e6f('0x60')]()[_0x1e6f('0x5f')](char(0x22))>=0x0);}function encapsulate(_0x2b3dc7){var _0x127a50=char(0x22),_0x5c9891='\x5c'+char(0x22),_0x3b75a3=_0x2b3dc7[_0x1e6f('0x60')]()[_0x1e6f('0x61')](new RegExp(_0x127a50,'g'),_0x5c9891);return _0x127a50+_0x3b75a3+_0x127a50;}exports[_0x1e6f('0x62')]=function(_0x6a0f6b,_0x1071fb,_0x88c2a7){var _0x2657c0,_0x37a88e;var _0x33c89f={'where':{'ProjectId':_0x6a0f6b[_0x1e6f('0x42')]['id']}};if(_0x6a0f6b[_0x1e6f('0x30')][_0x1e6f('0x63')]){_0x33c89f[_0x1e6f('0x38')][_0x1e6f('0x64')]=JSON[_0x1e6f('0x65')](_0x6a0f6b[_0x1e6f('0x30')][_0x1e6f('0x63')]);}return db[_0x1e6f('0x5a')]['findAll'](_0x33c89f)[_0x1e6f('0x23')](handleEntityNotFound(_0x1071fb,null))[_0x1e6f('0x23')](function(_0x25ed8c){if(_0x25ed8c){_0x2657c0=_0x25ed8c;return db['JscriptyQuestionReport'][_0x1e6f('0x5b')]({'where':{'SessionId':{'$in':_[_0x1e6f('0x2b')](_0x2657c0,'id')},'ProjectId':_0x6a0f6b[_0x1e6f('0x42')]['id']},'order':'-createdAt'});}})['then'](handleEntityNotFound(_0x1071fb,null))[_0x1e6f('0x23')](function(_0xcebdd1){if(_0xcebdd1){_0x37a88e=_0xcebdd1;var _0x197fea={};for(var _0x45314f=0x0,_0x30c63c=_0x37a88e[_0x1e6f('0x4e')];_0x45314f<_0x30c63c;_0x45314f++){if(!_0x197fea[_0x1e6f('0x57')](_0x37a88e[_0x45314f][_0x1e6f('0x66')])){_0x197fea[_0x37a88e[_0x45314f]['questionId']]=needsEncapsulation(_0x37a88e[_0x45314f]['question'])?encapsulate(_0x37a88e[_0x45314f][_0x1e6f('0x67')]):_0x37a88e[_0x45314f][_0x1e6f('0x67')];}}var _0xa78af4=[],_0x49a8e3={};for(var _0x19155c=0x0,_0xb63dd1=_0x2657c0['length'];_0x19155c<_0xb63dd1;_0x19155c++){_0x49a8e3={'ProjectId':_0x6a0f6b['params']['id'],'SessionId':_0x2657c0[_0x19155c]['id'],'StartTime':moment(_0x2657c0[_0x19155c]['starttime'])[_0x1e6f('0x68')](_0x1e6f('0x69'))};for(var _0x3093cc=0x0,_0x1d031c=_0x37a88e[_0x1e6f('0x4e')];_0x3093cc<_0x1d031c;_0x3093cc++){if(_0x37a88e[_0x3093cc][_0x1e6f('0x6a')]==_0x2657c0[_0x19155c]['id']&&_0x197fea[_0x1e6f('0x57')](_0x37a88e[_0x3093cc][_0x1e6f('0x66')])){_0x49a8e3[_0x197fea[_0x37a88e[_0x3093cc]['questionId']]]=_0x37a88e[_0x3093cc][_0x1e6f('0x6b')];}}for(var _0x1bfcd5 in _0x197fea){if(!_0x49a8e3[_0x1e6f('0x57')](_0x197fea[_0x1bfcd5])){_0x49a8e3[_0x197fea[_0x1bfcd5]]=null;}}_0xa78af4[_0x1e6f('0x6c')](_0x49a8e3);}return _0xa78af4;}})[_0x1e6f('0x23')](function(_0x19d0fe){if(!_[_0x1e6f('0x6d')](_0x19d0fe)){var _0x137fef=toCsv(_0x19d0fe);var _0x122510=Date[_0x1e6f('0x6e')]();fs[_0x1e6f('0x6f')](util['format'](_0x1e6f('0x70'),_0x6a0f6b['params']['id'],_0x122510),_0x137fef);_0x1071fb['setHeader']('Content-disposition',_0x1e6f('0x71')+util['format'](_0x1e6f('0x72'),_0x6a0f6b['params']['id'],_0x122510));_0x1071fb[_0x1e6f('0x73')](_0x1e6f('0x74'),_0x1e6f('0x75'));return _0x1071fb['download'](util[_0x1e6f('0x68')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x6a0f6b[_0x1e6f('0x42')]['id'],_0x122510));}else{return _0x1071fb[_0x1e6f('0x15')](0xcc);}})[_0x1e6f('0x40')](handleError(_0x1071fb,null));}; \ No newline at end of file +var _0xb1fa=['params','keys','find','create','body','user','role','Projects','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','getSessions','findOne','JscriptySessionReport','order','ProjectId','rows','getAnswers','JscriptyAnswerReport','number','fromCharCode','apply','indexOf','toString','getSummary','startTime','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','now','writeFileSync','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','download','sendStatus','zip-dir','request-promise','sox','lodash','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show'];(function(_0x3ae87c,_0x3eff99){var _0x1e2270=function(_0x115497){while(--_0x115497){_0x3ae87c['push'](_0x3ae87c['shift']());}};_0x1e2270(++_0x3eff99);}(_0xb1fa,0x9e));var _0xab1f=function(_0x15fef5,_0x4b9ec6){_0x15fef5=_0x15fef5-0x0;var _0x5a6199=_0xb1fa[_0x15fef5];return _0x5a6199;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xab1f('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xab1f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xab1f('0x2'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xab1f('0x3'));var squel=require('squel');var crypto=require(_0xab1f('0x4'));var jsforce=require(_0xab1f('0x5'));var deskjs=require('desk.js');var toCsv=require(_0xab1f('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xab1f('0x7'));var authService=require(_0xab1f('0x8'));var qs=require(_0xab1f('0x9'));var as=require(_0xab1f('0xa'));var hardwareService=require(_0xab1f('0xb'));var logger=require('../../config/logger')(_0xab1f('0xc'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xab1f('0xd'));var db=require(_0xab1f('0xe'))['db'];function respondWithStatusCode(_0x5168bb,_0x4cb402){_0x4cb402=_0x4cb402||0xcc;return function(_0xea4a03){if(_0xea4a03){return _0x5168bb['sendStatus'](_0x4cb402);}return _0x5168bb[_0xab1f('0xf')](_0x4cb402)[_0xab1f('0x10')]();};}function respondWithResult(_0x68b4e4,_0x58a0fb){_0x58a0fb=_0x58a0fb||0xc8;return function(_0x2ee266){if(_0x2ee266){return _0x68b4e4[_0xab1f('0xf')](_0x58a0fb)[_0xab1f('0x11')](_0x2ee266);}};}function respondWithFilteredResult(_0x1c0260,_0x5124d6){return function(_0x33fc3a){if(_0x33fc3a){var _0x4c68b0=typeof _0x5124d6[_0xab1f('0x12')]===_0xab1f('0x13')&&typeof _0x5124d6[_0xab1f('0x14')]==='undefined';var _0x1582bd=_0x33fc3a[_0xab1f('0x15')];var _0x558c52=_0x4c68b0?0x0:_0x5124d6[_0xab1f('0x12')];var _0x4ba3f4=_0x4c68b0?_0x33fc3a[_0xab1f('0x15')]:_0x5124d6[_0xab1f('0x12')]+_0x5124d6[_0xab1f('0x14')];var _0x547fc0;if(_0x4ba3f4>=_0x1582bd){_0x4ba3f4=_0x1582bd;_0x547fc0=0xc8;}else{_0x547fc0=0xce;}_0x1c0260[_0xab1f('0xf')](_0x547fc0);return _0x1c0260[_0xab1f('0x16')]('Content-Range',_0x558c52+'-'+_0x4ba3f4+'/'+_0x1582bd)[_0xab1f('0x11')](_0x33fc3a);}return null;};}function patchUpdates(_0x30f973){return function(_0x4fe6d7){try{jsonpatch['apply'](_0x4fe6d7,_0x30f973,!![]);}catch(_0x3103e1){return BPromise[_0xab1f('0x17')](_0x3103e1);}return _0x4fe6d7[_0xab1f('0x18')]();};}function saveUpdates(_0x425b61,_0x1bd51b){return function(_0x2915b9){if(_0x2915b9){return _0x2915b9[_0xab1f('0x19')](_0x425b61)['then'](function(_0x37ae5e){return _0x37ae5e;});}return null;};}function removeEntity(_0x85f20a,_0x3662b8){return function(_0x33b647){if(_0x33b647){return _0x33b647['destroy']()[_0xab1f('0x1a')](function(){var _0x219f01=_0x33b647[_0xab1f('0x1b')]({'plain':!![]});var _0x162041='Projects';return db[_0xab1f('0x1c')][_0xab1f('0x1d')]({'where':{'type':_0x162041,'resourceId':_0x219f01['id']}})[_0xab1f('0x1a')](function(){return _0x33b647;});})[_0xab1f('0x1a')](function(){_0x85f20a[_0xab1f('0xf')](0xcc)[_0xab1f('0x10')]();});}};}function handleEntityNotFound(_0x357c51,_0x4ffb2e){return function(_0x2216ca){if(!_0x2216ca){_0x357c51['sendStatus'](0x194);}return _0x2216ca;};}function handleError(_0x38ee2b,_0x5b869d){_0x5b869d=_0x5b869d||0x1f4;return function(_0x3357b9){logger[_0xab1f('0x1e')](_0x3357b9[_0xab1f('0x1f')]);if(_0x3357b9[_0xab1f('0x20')]){delete _0x3357b9[_0xab1f('0x20')];}_0x38ee2b[_0xab1f('0xf')](_0x5b869d)[_0xab1f('0x21')](_0x3357b9);};}exports[_0xab1f('0x22')]=function(_0x12be07,_0x5d924b){var _0x355706={},_0x5e6170={},_0x1c1bce={'count':0x0,'rows':[]};var _0x24c678=_[_0xab1f('0x23')](db[_0xab1f('0x24')][_0xab1f('0x25')],function(_0x5c3de8){return{'name':_0x5c3de8[_0xab1f('0x26')],'type':_0x5c3de8[_0xab1f('0x27')][_0xab1f('0x28')]};});_0x5e6170['model']=_[_0xab1f('0x23')](_0x24c678,'name');_0x5e6170[_0xab1f('0x29')]=_['keys'](_0x12be07[_0xab1f('0x29')]);_0x5e6170['filters']=_[_0xab1f('0x2a')](_0x5e6170[_0xab1f('0x2b')],_0x5e6170[_0xab1f('0x29')]);_0x355706[_0xab1f('0x2c')]=_['intersection'](_0x5e6170['model'],qs[_0xab1f('0x2d')](_0x12be07['query'][_0xab1f('0x2d')]));_0x355706[_0xab1f('0x2c')]=_0x355706[_0xab1f('0x2c')][_0xab1f('0x2e')]?_0x355706[_0xab1f('0x2c')]:_0x5e6170[_0xab1f('0x2b')];if(!_0x12be07['query'][_0xab1f('0x2f')](_0xab1f('0x30'))){_0x355706['limit']=qs['limit'](_0x12be07[_0xab1f('0x29')][_0xab1f('0x14')]);_0x355706[_0xab1f('0x12')]=qs[_0xab1f('0x12')](_0x12be07[_0xab1f('0x29')][_0xab1f('0x12')]);}_0x355706['order']=qs[_0xab1f('0x31')](_0x12be07[_0xab1f('0x29')][_0xab1f('0x31')]);_0x355706[_0xab1f('0x32')]=qs[_0xab1f('0x33')](_[_0xab1f('0x34')](_0x12be07[_0xab1f('0x29')],_0x5e6170['filters']),_0x24c678);if(_0x12be07[_0xab1f('0x29')][_0xab1f('0x35')]){_0x355706[_0xab1f('0x32')]=_[_0xab1f('0x36')](_0x355706[_0xab1f('0x32')],{'$or':_[_0xab1f('0x23')](_0x24c678,function(_0x353ec8){if(_0x353ec8[_0xab1f('0x27')]!==_0xab1f('0x37')){var _0x5b28b0={};_0x5b28b0[_0x353ec8[_0xab1f('0x20')]]={'$like':'%'+_0x12be07[_0xab1f('0x29')][_0xab1f('0x35')]+'%'};return _0x5b28b0;}})});}_0x355706=_[_0xab1f('0x36')]({},_0x355706,_0x12be07[_0xab1f('0x38')]);var _0x1da2dc={'where':_0x355706[_0xab1f('0x32')]};return db[_0xab1f('0x24')][_0xab1f('0x15')](_0x1da2dc)[_0xab1f('0x1a')](function(_0xe349a6){_0x1c1bce[_0xab1f('0x15')]=_0xe349a6;if(_0x12be07[_0xab1f('0x29')][_0xab1f('0x39')]){_0x355706[_0xab1f('0x3a')]=[{'all':!![]}];}return db['JscriptyProject'][_0xab1f('0x3b')](_0x355706);})['then'](function(_0x3e12c3){_0x1c1bce['rows']=_0x3e12c3;return _0x1c1bce;})[_0xab1f('0x1a')](respondWithFilteredResult(_0x5d924b,_0x355706))[_0xab1f('0x3c')](handleError(_0x5d924b,null));};exports[_0xab1f('0x3d')]=function(_0x2240cc,_0x57e397){var _0x1fd5ee={'raw':![],'where':{'id':_0x2240cc[_0xab1f('0x3e')]['id']}},_0x26c50c={};_0x26c50c['model']=_[_0xab1f('0x3f')](db['JscriptyProject']['rawAttributes']);_0x26c50c[_0xab1f('0x29')]=_['keys'](_0x2240cc[_0xab1f('0x29')]);_0x26c50c['filters']=_['intersection'](_0x26c50c[_0xab1f('0x2b')],_0x26c50c[_0xab1f('0x29')]);_0x1fd5ee[_0xab1f('0x2c')]=_['intersection'](_0x26c50c[_0xab1f('0x2b')],qs['fields'](_0x2240cc[_0xab1f('0x29')][_0xab1f('0x2d')]));_0x1fd5ee[_0xab1f('0x2c')]=_0x1fd5ee['attributes'][_0xab1f('0x2e')]?_0x1fd5ee[_0xab1f('0x2c')]:_0x26c50c['model'];if(_0x2240cc[_0xab1f('0x29')][_0xab1f('0x39')]){_0x1fd5ee[_0xab1f('0x3a')]=[{'all':!![]}];}_0x1fd5ee=_['merge']({},_0x1fd5ee,_0x2240cc[_0xab1f('0x38')]);return db[_0xab1f('0x24')][_0xab1f('0x40')](_0x1fd5ee)[_0xab1f('0x1a')](handleEntityNotFound(_0x57e397,null))[_0xab1f('0x1a')](respondWithResult(_0x57e397,null))['catch'](handleError(_0x57e397,null));};exports[_0xab1f('0x41')]=function(_0xa21313,_0x2c11df){return db[_0xab1f('0x24')]['create'](_0xa21313[_0xab1f('0x42')],{})['then'](function(_0x3491d3){var _0x1d3d41=_0xa21313[_0xab1f('0x43')]['get']({'plain':!![]});if(!_0x1d3d41)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1d3d41[_0xab1f('0x44')]==='user'){var _0x4905b0=_0x3491d3['get']({'plain':!![]});var _0xe2eced=_0xab1f('0x45');return db[_0xab1f('0x46')][_0xab1f('0x40')]({'where':{'name':_0xe2eced,'userProfileId':_0x1d3d41['userProfileId']},'raw':!![]})[_0xab1f('0x1a')](function(_0x37f819){if(_0x37f819&&_0x37f819['autoAssociation']===0x0){return db[_0xab1f('0x1c')][_0xab1f('0x41')]({'name':_0x4905b0[_0xab1f('0x20')],'resourceId':_0x4905b0['id'],'type':_0x37f819['name'],'sectionId':_0x37f819['id']},{})[_0xab1f('0x1a')](function(){return _0x3491d3;});}else{return _0x3491d3;}})[_0xab1f('0x3c')](function(_0x331754){logger[_0xab1f('0x1e')](_0xab1f('0x47'),_0x331754);throw _0x331754;});}return _0x3491d3;})[_0xab1f('0x1a')](respondWithResult(_0x2c11df,0xc9))[_0xab1f('0x3c')](handleError(_0x2c11df,null));};exports[_0xab1f('0x48')]=function(_0x2b1400,_0x3bf108){var _0x308e3e={'where':{'id':_0x2b1400[_0xab1f('0x3e')]['id']}},_0xb09f6d={};_0xb09f6d[_0xab1f('0x2b')]=_[_0xab1f('0x3f')](db['JscriptyProject'][_0xab1f('0x25')]);_0x308e3e[_0xab1f('0x2c')]=_[_0xab1f('0x2a')](_0xb09f6d[_0xab1f('0x2b')],qs[_0xab1f('0x2d')](_0x2b1400[_0xab1f('0x29')][_0xab1f('0x2d')]));_0x308e3e[_0xab1f('0x2c')]=_0x308e3e[_0xab1f('0x2c')][_0xab1f('0x2e')]?_0x308e3e[_0xab1f('0x2c')]:_0xb09f6d[_0xab1f('0x2b')];if(_0x2b1400['query'][_0xab1f('0x39')]){_0x308e3e[_0xab1f('0x3a')]=[{'all':!![]}];}_0x308e3e=_['merge']({},_0x308e3e,_0x2b1400[_0xab1f('0x38')]);return db[_0xab1f('0x24')][_0xab1f('0x40')](_0x308e3e)[_0xab1f('0x1a')](handleEntityNotFound(_0x3bf108,null))[_0xab1f('0x1a')](function(_0x557b50){if(_0x557b50){var _0x26ba40=_0x557b50[_0xab1f('0x1b')]({'plain':!![]});_0x26ba40=qs['omit'](_0x26ba40,['id',_0xab1f('0x49'),_0xab1f('0x4a')]);_0x2b1400['body']=_['omit'](_0x2b1400['body'],['id',_0xab1f('0x49'),_0xab1f('0x4a')]);return db[_0xab1f('0x24')]['create'](_[_0xab1f('0x36')](_0x26ba40,_0x2b1400[_0xab1f('0x42')]),{'include':_0x2b1400[_0xab1f('0x29')][_0xab1f('0x39')]?[{'all':!![]}]:undefined})[_0xab1f('0x1a')](function(_0x1899df){var _0x20e5af=_0x2b1400['user'][_0xab1f('0x1b')]({'plain':!![]});if(!_0x20e5af)throw new Error(_0xab1f('0x4b'));if(_0x20e5af[_0xab1f('0x44')]===_0xab1f('0x43')){var _0x28e5a4=_0x1899df['get']({'plain':!![]});var _0x3ff76e=_0xab1f('0x45');return db['UserProfileSection'][_0xab1f('0x40')]({'where':{'name':_0x3ff76e,'userProfileId':_0x20e5af['userProfileId']},'raw':!![]})['then'](function(_0x4bf0f3){if(_0x4bf0f3&&_0x4bf0f3[_0xab1f('0x4c')]===0x0){return db['UserProfileResource'][_0xab1f('0x41')]({'name':_0x28e5a4[_0xab1f('0x20')],'resourceId':_0x28e5a4['id'],'type':_0x4bf0f3[_0xab1f('0x20')],'sectionId':_0x4bf0f3['id']},{})[_0xab1f('0x1a')](function(){return _0x1899df;});}else{return _0x1899df;}})[_0xab1f('0x3c')](function(_0x2832f3){logger[_0xab1f('0x1e')](_0xab1f('0x47'),_0x2832f3);throw _0x2832f3;});}return _0x1899df;});}})[_0xab1f('0x1a')](respondWithResult(_0x3bf108,0xc9))[_0xab1f('0x3c')](handleError(_0x3bf108,null));};exports[_0xab1f('0x19')]=function(_0x260456,_0x1ce532){if(_0x260456[_0xab1f('0x42')]['id']){delete _0x260456[_0xab1f('0x42')]['id'];}return db['JscriptyProject'][_0xab1f('0x40')]({'where':{'id':_0x260456[_0xab1f('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1ce532,null))[_0xab1f('0x1a')](saveUpdates(_0x260456['body'],null))['then'](respondWithResult(_0x1ce532,null))[_0xab1f('0x3c')](handleError(_0x1ce532,null));};exports[_0xab1f('0x1d')]=function(_0x15b9a4,_0x43e45b){return db[_0xab1f('0x24')]['find']({'where':{'id':_0x15b9a4[_0xab1f('0x3e')]['id']}})[_0xab1f('0x1a')](handleEntityNotFound(_0x43e45b,null))['then'](removeEntity(_0x43e45b,null))[_0xab1f('0x3c')](handleError(_0x43e45b,null));};exports[_0xab1f('0x4d')]=function(_0x51a9e3,_0x340298,_0x340652){var _0x2562c6={'raw':!![],'where':{}};var _0x557dab={};var _0x49e901={'count':0x0,'rows':[]};return db[_0xab1f('0x24')][_0xab1f('0x4e')]({'where':{'id':_0x51a9e3[_0xab1f('0x3e')]['id']}})[_0xab1f('0x1a')](handleEntityNotFound(_0x340298,null))[_0xab1f('0x1a')](function(_0x21502c){if(_0x21502c){_0x557dab['model']=_[_0xab1f('0x3f')](db[_0xab1f('0x4f')][_0xab1f('0x25')]);_0x557dab['query']=_[_0xab1f('0x3f')](_0x51a9e3['query']);_0x557dab[_0xab1f('0x33')]=_[_0xab1f('0x2a')](_0x557dab[_0xab1f('0x2b')],_0x557dab[_0xab1f('0x29')]);_0x2562c6['attributes']=_[_0xab1f('0x2a')](_0x557dab[_0xab1f('0x2b')],qs['fields'](_0x51a9e3['query'][_0xab1f('0x2d')]));_0x2562c6[_0xab1f('0x2c')]=_0x2562c6[_0xab1f('0x2c')][_0xab1f('0x2e')]?_0x2562c6['attributes']:_0x557dab[_0xab1f('0x2b')];if(!_0x51a9e3[_0xab1f('0x29')][_0xab1f('0x2f')](_0xab1f('0x30'))){_0x2562c6[_0xab1f('0x14')]=qs[_0xab1f('0x14')](_0x51a9e3[_0xab1f('0x29')]['limit']);_0x2562c6[_0xab1f('0x12')]=qs['offset'](_0x51a9e3[_0xab1f('0x29')][_0xab1f('0x12')]);}_0x2562c6[_0xab1f('0x50')]=qs['sort'](_0x51a9e3[_0xab1f('0x29')][_0xab1f('0x31')]);_0x2562c6[_0xab1f('0x32')]=qs[_0xab1f('0x33')](_[_0xab1f('0x34')](_0x51a9e3['query'],_0x557dab[_0xab1f('0x33')]));_0x2562c6[_0xab1f('0x32')][_0xab1f('0x51')]=_0x21502c['id'];if(_0x51a9e3['query'][_0xab1f('0x35')]){_0x2562c6[_0xab1f('0x32')]=_[_0xab1f('0x36')](_0x2562c6[_0xab1f('0x32')],{'$or':_['map'](_0x2562c6[_0xab1f('0x2c')],function(_0x331d06){var _0x5a6cb3={};_0x5a6cb3[_0x331d06]={'$like':'%'+_0x51a9e3[_0xab1f('0x29')][_0xab1f('0x35')]+'%'};return _0x5a6cb3;})});}_0x2562c6=_['merge']({},_0x2562c6,_0x51a9e3['options']);return db[_0xab1f('0x4f')][_0xab1f('0x15')]({'where':_0x2562c6[_0xab1f('0x32')]})[_0xab1f('0x1a')](function(_0x5055d7){_0x49e901['count']=_0x5055d7;if(_0x51a9e3[_0xab1f('0x29')][_0xab1f('0x39')]){_0x2562c6[_0xab1f('0x3a')]=[{'all':!![]}];}return db[_0xab1f('0x4f')][_0xab1f('0x3b')](_0x2562c6);})[_0xab1f('0x1a')](function(_0x15733b){_0x49e901[_0xab1f('0x52')]=_0x15733b;return _0x49e901;});}})[_0xab1f('0x1a')](respondWithFilteredResult(_0x340298,_0x2562c6))['catch'](handleError(_0x340298,null));};exports[_0xab1f('0x53')]=function(_0x573953,_0x36b5d2,_0x1b744a){var _0x5118b3={'raw':!![],'where':{}};var _0x3dc03a={};var _0x19e16a={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xab1f('0x4e')]({'where':{'id':_0x573953[_0xab1f('0x3e')]['id']}})[_0xab1f('0x1a')](handleEntityNotFound(_0x36b5d2,null))[_0xab1f('0x1a')](function(_0x405368){if(_0x405368){_0x3dc03a[_0xab1f('0x2b')]=_['keys'](db[_0xab1f('0x54')][_0xab1f('0x25')]);_0x3dc03a[_0xab1f('0x29')]=_['keys'](_0x573953[_0xab1f('0x29')]);_0x3dc03a['filters']=_[_0xab1f('0x2a')](_0x3dc03a[_0xab1f('0x2b')],_0x3dc03a[_0xab1f('0x29')]);_0x5118b3[_0xab1f('0x2c')]=_['intersection'](_0x3dc03a[_0xab1f('0x2b')],qs[_0xab1f('0x2d')](_0x573953[_0xab1f('0x29')][_0xab1f('0x2d')]));_0x5118b3[_0xab1f('0x2c')]=_0x5118b3[_0xab1f('0x2c')]['length']?_0x5118b3['attributes']:_0x3dc03a[_0xab1f('0x2b')];if(!_0x573953[_0xab1f('0x29')]['hasOwnProperty'](_0xab1f('0x30'))){_0x5118b3[_0xab1f('0x14')]=qs[_0xab1f('0x14')](_0x573953[_0xab1f('0x29')][_0xab1f('0x14')]);_0x5118b3[_0xab1f('0x12')]=qs[_0xab1f('0x12')](_0x573953[_0xab1f('0x29')][_0xab1f('0x12')]);}_0x5118b3[_0xab1f('0x50')]=qs[_0xab1f('0x31')](_0x573953[_0xab1f('0x29')][_0xab1f('0x31')]);_0x5118b3[_0xab1f('0x32')]=qs['filters'](_[_0xab1f('0x34')](_0x573953['query'],_0x3dc03a['filters']));_0x5118b3[_0xab1f('0x32')][_0xab1f('0x51')]=_0x405368['id'];if(_0x573953['query'][_0xab1f('0x35')]){_0x5118b3['where']=_[_0xab1f('0x36')](_0x5118b3[_0xab1f('0x32')],{'$or':_[_0xab1f('0x23')](_0x5118b3[_0xab1f('0x2c')],function(_0x42005f){var _0x3e1472={};_0x3e1472[_0x42005f]={'$like':'%'+_0x573953['query']['filter']+'%'};return _0x3e1472;})});}_0x5118b3=_[_0xab1f('0x36')]({},_0x5118b3,_0x573953[_0xab1f('0x38')]);return db[_0xab1f('0x54')][_0xab1f('0x15')]({'where':_0x5118b3['where']})[_0xab1f('0x1a')](function(_0x28f1b6){_0x19e16a['count']=_0x28f1b6;if(_0x573953[_0xab1f('0x29')][_0xab1f('0x39')]){_0x5118b3['include']=[{'all':!![]}];}return db[_0xab1f('0x54')][_0xab1f('0x3b')](_0x5118b3);})[_0xab1f('0x1a')](function(_0x14cb9d){_0x19e16a[_0xab1f('0x52')]=_0x14cb9d;return _0x19e16a;});}})[_0xab1f('0x1a')](respondWithFilteredResult(_0x36b5d2,_0x5118b3))['catch'](handleError(_0x36b5d2,null));};function char(_0x3d3f51){return _0xab1f('0x55')===typeof _0x3d3f51?String[_0xab1f('0x56')][_0xab1f('0x57')](null,arguments):_0x3d3f51;}function needsEncapsulation(_0xe851f7){return!!_0xe851f7&&(_0xe851f7['toString']()[_0xab1f('0x58')](char(0xd))>=0x0||_0xe851f7[_0xab1f('0x59')]()[_0xab1f('0x58')](char(0xa))>=0x0||_0xe851f7['toString']()[_0xab1f('0x58')](char(0x2c))>=0x0||_0xe851f7['toString']()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x21a891){var _0x44d765=char(0x22),_0x4e0da0='\x5c'+char(0x22),_0x1686c0=_0x21a891['toString']()['replace'](new RegExp(_0x44d765,'g'),_0x4e0da0);return _0x44d765+_0x1686c0+_0x44d765;}exports[_0xab1f('0x5a')]=function(_0x45af59,_0x461683,_0x3f9cd0){var _0x18b816,_0x2aa733;var _0x1bed49={'where':{'ProjectId':_0x45af59[_0xab1f('0x3e')]['id']}};if(_0x45af59[_0xab1f('0x29')]['startTime']){_0x1bed49[_0xab1f('0x32')]['starttime']=JSON['parse'](_0x45af59['query'][_0xab1f('0x5b')]);}return db[_0xab1f('0x4f')]['findAll'](_0x1bed49)[_0xab1f('0x1a')](handleEntityNotFound(_0x461683,null))[_0xab1f('0x1a')](function(_0x2d3a50){if(_0x2d3a50){_0x18b816=_0x2d3a50;return db[_0xab1f('0x5c')]['findAll']({'where':{'SessionId':{'$in':_[_0xab1f('0x23')](_0x18b816,'id')},'ProjectId':_0x45af59[_0xab1f('0x3e')]['id']},'order':_0xab1f('0x5d')});}})['then'](handleEntityNotFound(_0x461683,null))[_0xab1f('0x1a')](function(_0xa4ed29){if(_0xa4ed29){_0x2aa733=_0xa4ed29;var _0x4fea54={};for(var _0x1f14ed=0x0,_0x3b2ba0=_0x2aa733[_0xab1f('0x2e')];_0x1f14ed<_0x3b2ba0;_0x1f14ed++){if(!_0x4fea54[_0xab1f('0x2f')](_0x2aa733[_0x1f14ed][_0xab1f('0x5e')])){_0x4fea54[_0x2aa733[_0x1f14ed][_0xab1f('0x5e')]]=needsEncapsulation(_0x2aa733[_0x1f14ed][_0xab1f('0x5f')])?encapsulate(_0x2aa733[_0x1f14ed][_0xab1f('0x5f')]):_0x2aa733[_0x1f14ed][_0xab1f('0x5f')];}}var _0x19d501=[],_0x3ac58f={};for(var _0x14d6ff=0x0,_0x3d7d1f=_0x18b816[_0xab1f('0x2e')];_0x14d6ff<_0x3d7d1f;_0x14d6ff++){_0x3ac58f={'ProjectId':_0x45af59[_0xab1f('0x3e')]['id'],'SessionId':_0x18b816[_0x14d6ff]['id'],'StartTime':moment(_0x18b816[_0x14d6ff]['starttime'])[_0xab1f('0x60')](_0xab1f('0x61'))};for(var _0x377858=0x0,_0x1c8efd=_0x2aa733['length'];_0x377858<_0x1c8efd;_0x377858++){if(_0x2aa733[_0x377858][_0xab1f('0x62')]==_0x18b816[_0x14d6ff]['id']&&_0x4fea54['hasOwnProperty'](_0x2aa733[_0x377858]['questionId'])){_0x3ac58f[_0x4fea54[_0x2aa733[_0x377858]['questionId']]]=_0x2aa733[_0x377858][_0xab1f('0x63')];}}for(var _0x8a57e1 in _0x4fea54){if(!_0x3ac58f[_0xab1f('0x2f')](_0x4fea54[_0x8a57e1])){_0x3ac58f[_0x4fea54[_0x8a57e1]]=null;}}_0x19d501[_0xab1f('0x64')](_0x3ac58f);}return _0x19d501;}})[_0xab1f('0x1a')](function(_0x56fb8a){if(!_['isEmpty'](_0x56fb8a)){var _0x522fd2=toCsv(_0x56fb8a);var _0x5b2d62=Date[_0xab1f('0x65')]();fs[_0xab1f('0x66')](util[_0xab1f('0x60')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x45af59[_0xab1f('0x3e')]['id'],_0x5b2d62),_0x522fd2);_0x461683[_0xab1f('0x67')](_0xab1f('0x68'),_0xab1f('0x69')+util['format']('Jscripty_Project_%d_Summary_%s.csv',_0x45af59['params']['id'],_0x5b2d62));_0x461683[_0xab1f('0x67')](_0xab1f('0x6a'),_0xab1f('0x6b'));return _0x461683[_0xab1f('0x6c')](util['format']('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x45af59[_0xab1f('0x3e')]['id'],_0x5b2d62));}else{return _0x461683[_0xab1f('0x6d')](0xcc);}})[_0xab1f('0x3c')](handleError(_0x461683,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 428966c..cdb9dc5 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 _0x3981=['JscriptyProject','jscripty_projects','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define'];(function(_0x31f0cc,_0x36e038){var _0x5199ee=function(_0xd0b0b8){while(--_0xd0b0b8){_0x31f0cc['push'](_0x31f0cc['shift']());}};_0x5199ee(++_0x36e038);}(_0x3981,0x144));var _0x1398=function(_0x227de9,_0x3e7c62){_0x227de9=_0x227de9-0x0;var _0x18ddae=_0x3981[_0x227de9];return _0x18ddae;};'use strict';var _=require(_0x1398('0x0'));var util=require('util');var logger=require(_0x1398('0x1'))(_0x1398('0x2'));var moment=require(_0x1398('0x3'));var BPromise=require(_0x1398('0x4'));var rp=require(_0x1398('0x5'));var fs=require('fs');var path=require(_0x1398('0x6'));var rimraf=require(_0x1398('0x7'));var config=require(_0x1398('0x8'));var attributes=require(_0x1398('0x9'));module[_0x1398('0xa')]=function(_0x199a50,_0x5c5fe0){return _0x199a50[_0x1398('0xb')](_0x1398('0xc'),attributes,{'tableName':_0x1398('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xac0a=['bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects','../../config/logger','api'];(function(_0x148ccb,_0x251799){var _0x15e08a=function(_0x3e209d){while(--_0x3e209d){_0x148ccb['push'](_0x148ccb['shift']());}};_0x15e08a(++_0x251799);}(_0xac0a,0x11e));var _0xaac0=function(_0x39761b,_0x32982c){_0x39761b=_0x39761b-0x0;var _0x4429e9=_0xac0a[_0x39761b];return _0x4429e9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xaac0('0x0'))(_0xaac0('0x1'));var moment=require('moment');var BPromise=require(_0xaac0('0x2'));var rp=require(_0xaac0('0x3'));var fs=require('fs');var path=require(_0xaac0('0x4'));var rimraf=require(_0xaac0('0x5'));var config=require(_0xaac0('0x6'));var attributes=require(_0xaac0('0x7'));module[_0xaac0('0x8')]=function(_0x1c92d1,_0x2cefc3){return _0x1c92d1[_0xaac0('0x9')](_0xaac0('0xa'),attributes,{'tableName':_0xaac0('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 969a358..87571c4 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 _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(_0x4a2d1c,_0x27a0fe){var _0x41dcc4=function(_0x38988a){while(--_0x38988a){_0x4a2d1c['push'](_0x4a2d1c['shift']());}};_0x41dcc4(++_0x27a0fe);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xcb91[_0x11005e];return _0x29338f;};'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 +var _0xa9e0=['http','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x34cd72,_0x2e18aa){var _0x1bb902=function(_0x305d97){while(--_0x305d97){_0x34cd72['push'](_0x34cd72['shift']());}};_0x1bb902(++_0x2e18aa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'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/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 569619b..65aed3a 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 _0x5fd2=['show','post','create','put','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id'];(function(_0x55bef4,_0x3583ab){var _0xbc81f7=function(_0x146f88){while(--_0x146f88){_0x55bef4['push'](_0x55bef4['shift']());}};_0xbc81f7(++_0x3583ab);}(_0x5fd2,0x92));var _0x25fd=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x5fd2[_0xfae23b];return _0x200640;};'use strict';var multer=require('multer');var util=require(_0x25fd('0x0'));var path=require(_0x25fd('0x1'));var timeout=require(_0x25fd('0x2'));var express=require(_0x25fd('0x3'));var router=express[_0x25fd('0x4')]();var fs_extra=require(_0x25fd('0x5'));var auth=require(_0x25fd('0x6'));var interaction=require(_0x25fd('0x7'));var config=require(_0x25fd('0x8'));var controller=require('./jscriptyQuestionReport.controller');router[_0x25fd('0x9')]('/',auth[_0x25fd('0xa')](),controller[_0x25fd('0xb')]);router['get']('/describe',auth[_0x25fd('0xa')](),controller[_0x25fd('0xc')]);router[_0x25fd('0x9')](_0x25fd('0xd'),auth['isAuthenticated'](),controller[_0x25fd('0xe')]);router[_0x25fd('0xf')]('/',auth[_0x25fd('0xa')](),controller[_0x25fd('0x10')]);router[_0x25fd('0x11')](_0x25fd('0xd'),auth[_0x25fd('0xa')](),controller['update']);router[_0x25fd('0x12')](_0x25fd('0xd'),auth[_0x25fd('0xa')](),controller['destroy']);module[_0x25fd('0x13')]=router; \ No newline at end of file +var _0x4c8e=['isAuthenticated','index','/describe','describe','/:id','show','post','put','update','destroy','multer','util','path','express','Router','fs-extra','../../components/interaction/service','./jscriptyQuestionReport.controller','get'];(function(_0x56c394,_0x5e9757){var _0x1eeb36=function(_0x302142){while(--_0x302142){_0x56c394['push'](_0x56c394['shift']());}};_0x1eeb36(++_0x5e9757);}(_0x4c8e,0x14d));var _0xe4c8=function(_0x311909,_0x414bf7){_0x311909=_0x311909-0x0;var _0x8d3163=_0x4c8e[_0x311909];return _0x8d3163;};'use strict';var multer=require(_0xe4c8('0x0'));var util=require(_0xe4c8('0x1'));var path=require(_0xe4c8('0x2'));var timeout=require('connect-timeout');var express=require(_0xe4c8('0x3'));var router=express[_0xe4c8('0x4')]();var fs_extra=require(_0xe4c8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe4c8('0x6'));var config=require('../../config/environment');var controller=require(_0xe4c8('0x7'));router[_0xe4c8('0x8')]('/',auth[_0xe4c8('0x9')](),controller[_0xe4c8('0xa')]);router['get'](_0xe4c8('0xb'),auth[_0xe4c8('0x9')](),controller[_0xe4c8('0xc')]);router[_0xe4c8('0x8')](_0xe4c8('0xd'),auth[_0xe4c8('0x9')](),controller[_0xe4c8('0xe')]);router[_0xe4c8('0xf')]('/',auth[_0xe4c8('0x9')](),controller['create']);router[_0xe4c8('0x10')](_0xe4c8('0xd'),auth[_0xe4c8('0x9')](),controller[_0xe4c8('0x11')]);router['delete'](_0xe4c8('0xd'),auth['isAuthenticated'](),controller[_0xe4c8('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index a9e69d0..9048ab7 100644 --- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js +++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x7a54,0x106));var _0x47a5=function(_0x2aa4ca,_0x41eecd){_0x2aa4ca=_0x2aa4ca-0x0;var _0x557da3=_0x7a54[_0x2aa4ca];return _0x557da3;};'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(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x7a54,0x106));var _0x47a5=function(_0x21c4f6,_0x41c728){_0x21c4f6=_0x21c4f6-0x0;var _0x796aee=_0x7a54[_0x21c4f6];return _0x796aee;};'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 b224544..72a08e7 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 _0x670a=['save','update','then','destroy','sendStatus','error','stack','name','send','index','JscriptyQuestionReport','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','include','findAll','catch','params','keys','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','end','offset','undefined','count','limit','status','set','apply'];(function(_0x110347,_0x17b660){var _0xa304af=function(_0x378463){while(--_0x378463){_0x110347['push'](_0x110347['shift']());}};_0xa304af(++_0x17b660);}(_0x670a,0x74));var _0xa670=function(_0x13de9b,_0x4239e7){_0x13de9b=_0x13de9b-0x0;var _0x50e011=_0x670a[_0x13de9b];return _0x50e011;};'use strict';var emlformat=require(_0xa670('0x0'));var rimraf=require(_0xa670('0x1'));var zipdir=require(_0xa670('0x2'));var jsonpatch=require(_0xa670('0x3'));var rp=require(_0xa670('0x4'));var moment=require('moment');var BPromise=require(_0xa670('0x5'));var Mustache=require(_0xa670('0x6'));var util=require(_0xa670('0x7'));var path=require(_0xa670('0x8'));var sox=require(_0xa670('0x9'));var csv=require(_0xa670('0xa'));var ejs=require(_0xa670('0xb'));var fs=require('fs');var fs_extra=require(_0xa670('0xc'));var _=require(_0xa670('0xd'));var squel=require(_0xa670('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa670('0xf'));var toCsv=require(_0xa670('0xa'));var querystring=require(_0xa670('0x10'));var Papa=require(_0xa670('0x11'));var Redis=require(_0xa670('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa670('0x13'));var as=require(_0xa670('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa670('0x15'))(_0xa670('0x16'));var utils=require('../../config/utils');var config=require(_0xa670('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c6be1,_0x4a97b0){_0x4a97b0=_0x4a97b0||0xcc;return function(_0x2dd0eb){if(_0x2dd0eb){return _0x2c6be1['sendStatus'](_0x4a97b0);}return _0x2c6be1['status'](_0x4a97b0)[_0xa670('0x18')]();};}function respondWithResult(_0x547c09,_0x18c524){_0x18c524=_0x18c524||0xc8;return function(_0xab9648){if(_0xab9648){return _0x547c09['status'](_0x18c524)['json'](_0xab9648);}};}function respondWithFilteredResult(_0x50f1fa,_0x1f83fc){return function(_0x266c67){if(_0x266c67){var _0x100be9=typeof _0x1f83fc[_0xa670('0x19')]==='undefined'&&typeof _0x1f83fc['limit']===_0xa670('0x1a');var _0x5c1570=_0x266c67[_0xa670('0x1b')];var _0x537b5f=_0x100be9?0x0:_0x1f83fc[_0xa670('0x19')];var _0x49931a=_0x100be9?_0x266c67['count']:_0x1f83fc['offset']+_0x1f83fc[_0xa670('0x1c')];var _0x32a9b0;if(_0x49931a>=_0x5c1570){_0x49931a=_0x5c1570;_0x32a9b0=0xc8;}else{_0x32a9b0=0xce;}_0x50f1fa[_0xa670('0x1d')](_0x32a9b0);return _0x50f1fa[_0xa670('0x1e')]('Content-Range',_0x537b5f+'-'+_0x49931a+'/'+_0x5c1570)['json'](_0x266c67);}return null;};}function patchUpdates(_0x332f66){return function(_0x2189dd){try{jsonpatch[_0xa670('0x1f')](_0x2189dd,_0x332f66,!![]);}catch(_0x182724){return BPromise['reject'](_0x182724);}return _0x2189dd[_0xa670('0x20')]();};}function saveUpdates(_0x198859,_0x5ca556){return function(_0x348029){if(_0x348029){return _0x348029[_0xa670('0x21')](_0x198859)[_0xa670('0x22')](function(_0x206c3c){return _0x206c3c;});}return null;};}function removeEntity(_0x1db9c7,_0x36b437){return function(_0x34e00e){if(_0x34e00e){return _0x34e00e[_0xa670('0x23')]()[_0xa670('0x22')](function(){_0x1db9c7[_0xa670('0x1d')](0xcc)[_0xa670('0x18')]();});}};}function handleEntityNotFound(_0x219d72,_0x35a605){return function(_0xc008e0){if(!_0xc008e0){_0x219d72[_0xa670('0x24')](0x194);}return _0xc008e0;};}function handleError(_0x87d12a,_0x3571b3){_0x3571b3=_0x3571b3||0x1f4;return function(_0xa92df5){logger[_0xa670('0x25')](_0xa92df5[_0xa670('0x26')]);if(_0xa92df5['name']){delete _0xa92df5[_0xa670('0x27')];}_0x87d12a['status'](_0x3571b3)[_0xa670('0x28')](_0xa92df5);};}exports[_0xa670('0x29')]=function(_0x172704,_0x4dc3a0){var _0x4b725d={},_0x45ee61={},_0x232a55={'count':0x0,'rows':[]};var _0x449266=_['map'](db[_0xa670('0x2a')][_0xa670('0x2b')],function(_0x29e20c){return{'name':_0x29e20c[_0xa670('0x2c')],'type':_0x29e20c['type'][_0xa670('0x2d')]};});_0x45ee61[_0xa670('0x2e')]=_[_0xa670('0x2f')](_0x449266,'name');_0x45ee61[_0xa670('0x30')]=_['keys'](_0x172704[_0xa670('0x30')]);_0x45ee61[_0xa670('0x31')]=_[_0xa670('0x32')](_0x45ee61['model'],_0x45ee61[_0xa670('0x30')]);_0x4b725d[_0xa670('0x33')]=_[_0xa670('0x32')](_0x45ee61['model'],qs[_0xa670('0x34')](_0x172704[_0xa670('0x30')][_0xa670('0x34')]));_0x4b725d[_0xa670('0x33')]=_0x4b725d['attributes'][_0xa670('0x35')]?_0x4b725d[_0xa670('0x33')]:_0x45ee61[_0xa670('0x2e')];if(!_0x172704[_0xa670('0x30')][_0xa670('0x36')](_0xa670('0x37'))){_0x4b725d['limit']=qs[_0xa670('0x1c')](_0x172704['query']['limit']);_0x4b725d[_0xa670('0x19')]=qs[_0xa670('0x19')](_0x172704[_0xa670('0x30')][_0xa670('0x19')]);}_0x4b725d['order']=qs['sort'](_0x172704[_0xa670('0x30')][_0xa670('0x38')]);_0x4b725d[_0xa670('0x39')]=qs[_0xa670('0x31')](_[_0xa670('0x3a')](_0x172704[_0xa670('0x30')],_0x45ee61[_0xa670('0x31')]),_0x449266);if(_0x172704['query']['filter']){_0x4b725d['where']=_[_0xa670('0x3b')](_0x4b725d[_0xa670('0x39')],{'$or':_[_0xa670('0x2f')](_0x449266,function(_0x25fd5c){if(_0x25fd5c[_0xa670('0x3c')]!==_0xa670('0x3d')){var _0x1f6dfa={};_0x1f6dfa[_0x25fd5c['name']]={'$like':'%'+_0x172704[_0xa670('0x30')][_0xa670('0x3e')]+'%'};return _0x1f6dfa;}})});}_0x4b725d=_[_0xa670('0x3b')]({},_0x4b725d,_0x172704[_0xa670('0x3f')]);var _0x355c28={'where':_0x4b725d['where']};return db[_0xa670('0x2a')]['count'](_0x355c28)['then'](function(_0x9bc93){_0x232a55[_0xa670('0x1b')]=_0x9bc93;if(_0x172704['query']['includeAll']){_0x4b725d[_0xa670('0x40')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0xa670('0x41')](_0x4b725d);})[_0xa670('0x22')](function(_0x2bec7d){_0x232a55['rows']=_0x2bec7d;return _0x232a55;})['then'](respondWithFilteredResult(_0x4dc3a0,_0x4b725d))[_0xa670('0x42')](handleError(_0x4dc3a0,null));};exports['show']=function(_0x48b729,_0x256433){var _0x266dcd={'raw':!![],'where':{'id':_0x48b729[_0xa670('0x43')]['id']}},_0x330426={};_0x330426[_0xa670('0x2e')]=_[_0xa670('0x44')](db[_0xa670('0x2a')]['rawAttributes']);_0x330426[_0xa670('0x30')]=_[_0xa670('0x44')](_0x48b729[_0xa670('0x30')]);_0x330426[_0xa670('0x31')]=_[_0xa670('0x32')](_0x330426[_0xa670('0x2e')],_0x330426[_0xa670('0x30')]);_0x266dcd[_0xa670('0x33')]=_[_0xa670('0x32')](_0x330426['model'],qs[_0xa670('0x34')](_0x48b729['query']['fields']));_0x266dcd[_0xa670('0x33')]=_0x266dcd[_0xa670('0x33')][_0xa670('0x35')]?_0x266dcd[_0xa670('0x33')]:_0x330426['model'];if(_0x48b729[_0xa670('0x30')][_0xa670('0x45')]){_0x266dcd[_0xa670('0x40')]=[{'all':!![]}];}_0x266dcd=_[_0xa670('0x3b')]({},_0x266dcd,_0x48b729['options']);return db[_0xa670('0x2a')][_0xa670('0x46')](_0x266dcd)[_0xa670('0x22')](handleEntityNotFound(_0x256433,null))[_0xa670('0x22')](respondWithResult(_0x256433,null))['catch'](handleError(_0x256433,null));};exports[_0xa670('0x47')]=function(_0x4464af,_0xf97298){return db[_0xa670('0x2a')][_0xa670('0x47')](_0x4464af[_0xa670('0x48')],{})[_0xa670('0x22')](respondWithResult(_0xf97298,0xc9))['catch'](handleError(_0xf97298,null));};exports['update']=function(_0x17cb67,_0x56f301){if(_0x17cb67['body']['id']){delete _0x17cb67[_0xa670('0x48')]['id'];}return db[_0xa670('0x2a')][_0xa670('0x46')]({'where':{'id':_0x17cb67[_0xa670('0x43')]['id']}})['then'](handleEntityNotFound(_0x56f301,null))['then'](saveUpdates(_0x17cb67[_0xa670('0x48')],null))['then'](respondWithResult(_0x56f301,null))['catch'](handleError(_0x56f301,null));};exports[_0xa670('0x23')]=function(_0x5f16c9,_0x4581f3){return db['JscriptyQuestionReport'][_0xa670('0x46')]({'where':{'id':_0x5f16c9['params']['id']}})[_0xa670('0x22')](handleEntityNotFound(_0x4581f3,null))['then'](removeEntity(_0x4581f3,null))[_0xa670('0x42')](handleError(_0x4581f3,null));};exports[_0xa670('0x49')]=function(_0x4589a4,_0xf9debd){return db[_0xa670('0x2a')][_0xa670('0x49')]()[_0xa670('0x22')](respondWithResult(_0xf9debd,null))['catch'](handleError(_0xf9debd,null));}; \ No newline at end of file +var _0x809a=['length','hasOwnProperty','nolimit','order','sort','where','filters','filter','options','include','findAll','show','params','rawAttributes','keys','includeAll','merge','find','catch','create','body','describe','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','end','error','stack','name','index','map','JscriptyQuestionReport','type','query','intersection','attributes','model','fields'];(function(_0x1af66e,_0xbb55bb){var _0x193670=function(_0x2c05f2){while(--_0x2c05f2){_0x1af66e['push'](_0x1af66e['shift']());}};_0x193670(++_0xbb55bb);}(_0x809a,0x179));var _0xa809=function(_0x7f9ac4,_0x2302ea){_0x7f9ac4=_0x7f9ac4-0x0;var _0x19b578=_0x809a[_0x7f9ac4];return _0x19b578;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa809('0x0'));var zipdir=require(_0xa809('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa809('0x2'));var moment=require(_0xa809('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa809('0x4'));var util=require(_0xa809('0x5'));var path=require(_0xa809('0x6'));var sox=require(_0xa809('0x7'));var csv=require(_0xa809('0x8'));var ejs=require(_0xa809('0x9'));var fs=require('fs');var fs_extra=require(_0xa809('0xa'));var _=require(_0xa809('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa809('0xc'));var toCsv=require(_0xa809('0x8'));var querystring=require('querystring');var Papa=require(_0xa809('0xd'));var Redis=require('ioredis');var authService=require(_0xa809('0xe'));var qs=require(_0xa809('0xf'));var as=require(_0xa809('0x10'));var hardwareService=require(_0xa809('0x11'));var logger=require(_0xa809('0x12'))(_0xa809('0x13'));var utils=require(_0xa809('0x14'));var config=require(_0xa809('0x15'));var licenseUtil=require(_0xa809('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4749f3,_0x487d77){_0x487d77=_0x487d77||0xcc;return function(_0x3e8233){if(_0x3e8233){return _0x4749f3[_0xa809('0x17')](_0x487d77);}return _0x4749f3['status'](_0x487d77)['end']();};}function respondWithResult(_0x520844,_0x4a3c2c){_0x4a3c2c=_0x4a3c2c||0xc8;return function(_0x3ce147){if(_0x3ce147){return _0x520844[_0xa809('0x18')](_0x4a3c2c)[_0xa809('0x19')](_0x3ce147);}};}function respondWithFilteredResult(_0x28a5ec,_0x5cffcf){return function(_0x56e552){if(_0x56e552){var _0x115eb9=typeof _0x5cffcf['offset']===_0xa809('0x1a')&&typeof _0x5cffcf[_0xa809('0x1b')]==='undefined';var _0x2473a8=_0x56e552[_0xa809('0x1c')];var _0x17ea7e=_0x115eb9?0x0:_0x5cffcf[_0xa809('0x1d')];var _0x24f25c=_0x115eb9?_0x56e552['count']:_0x5cffcf['offset']+_0x5cffcf['limit'];var _0x402df2;if(_0x24f25c>=_0x2473a8){_0x24f25c=_0x2473a8;_0x402df2=0xc8;}else{_0x402df2=0xce;}_0x28a5ec[_0xa809('0x18')](_0x402df2);return _0x28a5ec['set'](_0xa809('0x1e'),_0x17ea7e+'-'+_0x24f25c+'/'+_0x2473a8)[_0xa809('0x19')](_0x56e552);}return null;};}function patchUpdates(_0x42f268){return function(_0x5ad1b2){try{jsonpatch[_0xa809('0x1f')](_0x5ad1b2,_0x42f268,!![]);}catch(_0x412b6c){return BPromise[_0xa809('0x20')](_0x412b6c);}return _0x5ad1b2[_0xa809('0x21')]();};}function saveUpdates(_0x13b67c,_0x5da85c){return function(_0x3b135a){if(_0x3b135a){return _0x3b135a['update'](_0x13b67c)['then'](function(_0x228d1c){return _0x228d1c;});}return null;};}function removeEntity(_0x5939f5,_0x270fb0){return function(_0x11089d){if(_0x11089d){return _0x11089d[_0xa809('0x22')]()[_0xa809('0x23')](function(){_0x5939f5[_0xa809('0x18')](0xcc)[_0xa809('0x24')]();});}};}function handleEntityNotFound(_0x12c2eb,_0x5941f8){return function(_0x38253e){if(!_0x38253e){_0x12c2eb['sendStatus'](0x194);}return _0x38253e;};}function handleError(_0x3207d8,_0x4addfe){_0x4addfe=_0x4addfe||0x1f4;return function(_0x3edf8e){logger[_0xa809('0x25')](_0x3edf8e[_0xa809('0x26')]);if(_0x3edf8e[_0xa809('0x27')]){delete _0x3edf8e['name'];}_0x3207d8[_0xa809('0x18')](_0x4addfe)['send'](_0x3edf8e);};}exports[_0xa809('0x28')]=function(_0x682d45,_0x37e7ca){var _0x518a8e={},_0x217f0b={},_0x12dc80={'count':0x0,'rows':[]};var _0x59914f=_[_0xa809('0x29')](db[_0xa809('0x2a')]['rawAttributes'],function(_0x11938f){return{'name':_0x11938f['fieldName'],'type':_0x11938f[_0xa809('0x2b')]['key']};});_0x217f0b['model']=_[_0xa809('0x29')](_0x59914f,_0xa809('0x27'));_0x217f0b[_0xa809('0x2c')]=_['keys'](_0x682d45[_0xa809('0x2c')]);_0x217f0b['filters']=_[_0xa809('0x2d')](_0x217f0b['model'],_0x217f0b[_0xa809('0x2c')]);_0x518a8e[_0xa809('0x2e')]=_['intersection'](_0x217f0b[_0xa809('0x2f')],qs[_0xa809('0x30')](_0x682d45[_0xa809('0x2c')][_0xa809('0x30')]));_0x518a8e[_0xa809('0x2e')]=_0x518a8e[_0xa809('0x2e')][_0xa809('0x31')]?_0x518a8e['attributes']:_0x217f0b[_0xa809('0x2f')];if(!_0x682d45[_0xa809('0x2c')][_0xa809('0x32')](_0xa809('0x33'))){_0x518a8e[_0xa809('0x1b')]=qs[_0xa809('0x1b')](_0x682d45[_0xa809('0x2c')][_0xa809('0x1b')]);_0x518a8e['offset']=qs[_0xa809('0x1d')](_0x682d45[_0xa809('0x2c')]['offset']);}_0x518a8e[_0xa809('0x34')]=qs[_0xa809('0x35')](_0x682d45['query'][_0xa809('0x35')]);_0x518a8e[_0xa809('0x36')]=qs[_0xa809('0x37')](_['pick'](_0x682d45[_0xa809('0x2c')],_0x217f0b[_0xa809('0x37')]),_0x59914f);if(_0x682d45[_0xa809('0x2c')][_0xa809('0x38')]){_0x518a8e[_0xa809('0x36')]=_['merge'](_0x518a8e[_0xa809('0x36')],{'$or':_[_0xa809('0x29')](_0x59914f,function(_0x6d5c68){if(_0x6d5c68[_0xa809('0x2b')]!=='VIRTUAL'){var _0x1b7366={};_0x1b7366[_0x6d5c68[_0xa809('0x27')]]={'$like':'%'+_0x682d45[_0xa809('0x2c')][_0xa809('0x38')]+'%'};return _0x1b7366;}})});}_0x518a8e=_['merge']({},_0x518a8e,_0x682d45[_0xa809('0x39')]);var _0x40da18={'where':_0x518a8e[_0xa809('0x36')]};return db[_0xa809('0x2a')][_0xa809('0x1c')](_0x40da18)[_0xa809('0x23')](function(_0x1d3be3){_0x12dc80[_0xa809('0x1c')]=_0x1d3be3;if(_0x682d45['query']['includeAll']){_0x518a8e[_0xa809('0x3a')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0xa809('0x3b')](_0x518a8e);})[_0xa809('0x23')](function(_0x70408a){_0x12dc80['rows']=_0x70408a;return _0x12dc80;})[_0xa809('0x23')](respondWithFilteredResult(_0x37e7ca,_0x518a8e))['catch'](handleError(_0x37e7ca,null));};exports[_0xa809('0x3c')]=function(_0x2c471e,_0x1f4eba){var _0x2fdac3={'raw':!![],'where':{'id':_0x2c471e[_0xa809('0x3d')]['id']}},_0x4f5c1f={};_0x4f5c1f[_0xa809('0x2f')]=_['keys'](db[_0xa809('0x2a')][_0xa809('0x3e')]);_0x4f5c1f['query']=_[_0xa809('0x3f')](_0x2c471e[_0xa809('0x2c')]);_0x4f5c1f[_0xa809('0x37')]=_['intersection'](_0x4f5c1f[_0xa809('0x2f')],_0x4f5c1f[_0xa809('0x2c')]);_0x2fdac3[_0xa809('0x2e')]=_[_0xa809('0x2d')](_0x4f5c1f[_0xa809('0x2f')],qs[_0xa809('0x30')](_0x2c471e[_0xa809('0x2c')][_0xa809('0x30')]));_0x2fdac3[_0xa809('0x2e')]=_0x2fdac3['attributes'][_0xa809('0x31')]?_0x2fdac3[_0xa809('0x2e')]:_0x4f5c1f['model'];if(_0x2c471e[_0xa809('0x2c')][_0xa809('0x40')]){_0x2fdac3[_0xa809('0x3a')]=[{'all':!![]}];}_0x2fdac3=_[_0xa809('0x41')]({},_0x2fdac3,_0x2c471e['options']);return db[_0xa809('0x2a')][_0xa809('0x42')](_0x2fdac3)['then'](handleEntityNotFound(_0x1f4eba,null))['then'](respondWithResult(_0x1f4eba,null))[_0xa809('0x43')](handleError(_0x1f4eba,null));};exports[_0xa809('0x44')]=function(_0x31366b,_0x652776){return db[_0xa809('0x2a')][_0xa809('0x44')](_0x31366b[_0xa809('0x45')],{})['then'](respondWithResult(_0x652776,0xc9))[_0xa809('0x43')](handleError(_0x652776,null));};exports['update']=function(_0x470e5c,_0x419b7d){if(_0x470e5c[_0xa809('0x45')]['id']){delete _0x470e5c[_0xa809('0x45')]['id'];}return db[_0xa809('0x2a')][_0xa809('0x42')]({'where':{'id':_0x470e5c[_0xa809('0x3d')]['id']}})[_0xa809('0x23')](handleEntityNotFound(_0x419b7d,null))[_0xa809('0x23')](saveUpdates(_0x470e5c['body'],null))[_0xa809('0x23')](respondWithResult(_0x419b7d,null))[_0xa809('0x43')](handleError(_0x419b7d,null));};exports[_0xa809('0x22')]=function(_0x29c37a,_0x759ae8){return db['JscriptyQuestionReport']['find']({'where':{'id':_0x29c37a['params']['id']}})[_0xa809('0x23')](handleEntityNotFound(_0x759ae8,null))[_0xa809('0x23')](removeEntity(_0x759ae8,null))[_0xa809('0x43')](handleError(_0x759ae8,null));};exports[_0xa809('0x46')]=function(_0x674c12,_0x27ed4a){return db[_0xa809('0x2a')]['describe']()[_0xa809('0x23')](respondWithResult(_0x27ed4a,null))[_0xa809('0x43')](handleError(_0x27ed4a,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 40e7be3..18ad301 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 _0xcc16=['../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x45b2db,_0x7a24cd){var _0xcf6de2=function(_0x9b03f4){while(--_0x9b03f4){_0x45b2db['push'](_0x45b2db['shift']());}};_0xcf6de2(++_0x7a24cd);}(_0xcc16,0x14a));var _0x6cc1=function(_0x20a9b7,_0x508010){_0x20a9b7=_0x20a9b7-0x0;var _0x936702=_0xcc16[_0x20a9b7];return _0x936702;};'use strict';var _=require('lodash');var util=require(_0x6cc1('0x0'));var logger=require(_0x6cc1('0x1'))('api');var moment=require('moment');var BPromise=require(_0x6cc1('0x2'));var rp=require(_0x6cc1('0x3'));var fs=require('fs');var path=require(_0x6cc1('0x4'));var rimraf=require(_0x6cc1('0x5'));var config=require(_0x6cc1('0x6'));var attributes=require(_0x6cc1('0x7'));module[_0x6cc1('0x8')]=function(_0xb9b0bd,_0xa54075){return _0xb9b0bd[_0x6cc1('0x9')](_0x6cc1('0xa'),attributes,{'tableName':_0x6cc1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55d3=['path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','report_jscripty_questions','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x246bcc,_0x4051a2){var _0x2e5f50=function(_0x1e118f){while(--_0x1e118f){_0x246bcc['push'](_0x246bcc['shift']());}};_0x2e5f50(++_0x4051a2);}(_0x55d3,0x1f1));var _0x355d=function(_0x301f96,_0x21beec){_0x301f96=_0x301f96-0x0;var _0x265a71=_0x55d3[_0x301f96];return _0x265a71;};'use strict';var _=require(_0x355d('0x0'));var util=require(_0x355d('0x1'));var logger=require(_0x355d('0x2'))(_0x355d('0x3'));var moment=require(_0x355d('0x4'));var BPromise=require(_0x355d('0x5'));var rp=require(_0x355d('0x6'));var fs=require('fs');var path=require(_0x355d('0x7'));var rimraf=require(_0x355d('0x8'));var config=require(_0x355d('0x9'));var attributes=require(_0x355d('0xa'));module[_0x355d('0xb')]=function(_0x339ffd,_0x460df5){return _0x339ffd[_0x355d('0xc')]('JscriptyQuestionReport',attributes,{'tableName':_0x355d('0xd'),'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 ffe41a7..b7871ab 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 _0x72ab=['jayson/promise','client','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x72ab,0xd5));var _0xb72a=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x72ab[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require(_0xb72a('0x0'));var moment=require(_0xb72a('0x1'));var BPromise=require(_0xb72a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb72a('0x3'));var db=require(_0xb72a('0x4'))['db'];var utils=require(_0xb72a('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xb72a('0x6'));var jayson=require(_0xb72a('0x7'));var client=jayson[_0xb72a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x478a11,_0x1ed385,_0x9dcd62){return new BPromise(function(_0x2622ed,_0x1ba6ff){return client['request'](_0x478a11,_0x9dcd62)[_0xb72a('0x9')](function(_0x1b5335){logger[_0xb72a('0xa')](_0xb72a('0xb'),_0x1ed385,_0xb72a('0xc'));logger[_0xb72a('0xd')](_0xb72a('0xe'),_0x1ed385,_0xb72a('0xc'),JSON[_0xb72a('0xf')](_0x1b5335));if(_0x1b5335[_0xb72a('0x10')]){if(_0x1b5335[_0xb72a('0x10')][_0xb72a('0x11')]===0x1f4){logger[_0xb72a('0x10')](_0xb72a('0xb'),_0x1ed385,_0x1b5335['error'][_0xb72a('0x12')]);return _0x1ba6ff(_0x1b5335[_0xb72a('0x10')][_0xb72a('0x12')]);}logger[_0xb72a('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x1ed385,_0x1b5335[_0xb72a('0x10')][_0xb72a('0x12')]);return _0x2622ed(_0x1b5335[_0xb72a('0x10')][_0xb72a('0x12')]);}else{logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x1ed385,_0xb72a('0xc'));_0x2622ed(_0x1b5335['result'][_0xb72a('0x12')]);}})[_0xb72a('0x13')](function(_0x39f927){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x1ed385,_0x39f927);_0x1ba6ff(_0x39f927);});});} \ No newline at end of file +var _0x79ce=['../../config/environment','jayson/promise','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x18546c,_0x4daf94){var _0x46ef43=function(_0x559377){while(--_0x559377){_0x18546c['push'](_0x18546c['shift']());}};_0x46ef43(++_0x4daf94);}(_0x79ce,0x66));var _0xe79c=function(_0x4eb76e,_0x1c82c7){_0x4eb76e=_0x4eb76e-0x0;var _0x16bb60=_0x79ce[_0x4eb76e];return _0x16bb60;};'use strict';var _=require(_0xe79c('0x0'));var util=require(_0xe79c('0x1'));var moment=require(_0xe79c('0x2'));var BPromise=require(_0xe79c('0x3'));var rs=require(_0xe79c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe79c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe79c('0x6'))(_0xe79c('0x7'));var config=require(_0xe79c('0x8'));var jayson=require(_0xe79c('0x9'));var client=jayson[_0xe79c('0xa')][_0xe79c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x20eeeb,_0x2598a8,_0x222579){return new BPromise(function(_0x58d60e,_0x4077f1){return client[_0xe79c('0xc')](_0x20eeeb,_0x222579)[_0xe79c('0xd')](function(_0x128d19){logger[_0xe79c('0xe')](_0xe79c('0xf'),_0x2598a8,_0xe79c('0x10'));logger[_0xe79c('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x2598a8,'request\x20sent',JSON[_0xe79c('0x12')](_0x128d19));if(_0x128d19[_0xe79c('0x13')]){if(_0x128d19[_0xe79c('0x13')]['code']===0x1f4){logger[_0xe79c('0x13')](_0xe79c('0xf'),_0x2598a8,_0x128d19[_0xe79c('0x13')]['message']);return _0x4077f1(_0x128d19[_0xe79c('0x13')][_0xe79c('0x14')]);}logger['error'](_0xe79c('0xf'),_0x2598a8,_0x128d19[_0xe79c('0x13')][_0xe79c('0x14')]);return _0x58d60e(_0x128d19[_0xe79c('0x13')][_0xe79c('0x14')]);}else{logger[_0xe79c('0xe')](_0xe79c('0xf'),_0x2598a8,_0xe79c('0x10'));_0x58d60e(_0x128d19[_0xe79c('0x15')][_0xe79c('0x14')]);}})['catch'](function(_0x5e25ed){logger['error'](_0xe79c('0xf'),_0x2598a8,_0x5e25ed);_0x4077f1(_0x5e25ed);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index ecaf114..2f7d744 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 _0x2e70=['./jscriptySessionReport.controller','get','/describe','describe','show','/:id/questions','isAuthenticated','getQuestions','put','delete','/:id','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2e70,0x174));var _0x02e7=function(_0x3f13bf,_0xd18f7e){_0x3f13bf=_0x3f13bf-0x0;var _0x1cf9c5=_0x2e70[_0x3f13bf];return _0x1cf9c5;};'use strict';var multer=require(_0x02e7('0x0'));var util=require(_0x02e7('0x1'));var path=require('path');var timeout=require(_0x02e7('0x2'));var express=require(_0x02e7('0x3'));var router=express['Router']();var fs_extra=require(_0x02e7('0x4'));var auth=require(_0x02e7('0x5'));var interaction=require(_0x02e7('0x6'));var config=require(_0x02e7('0x7'));var controller=require(_0x02e7('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x02e7('0x9')](_0x02e7('0xa'),auth['isAuthenticated'](),controller[_0x02e7('0xb')]);router[_0x02e7('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x02e7('0xc')]);router['get'](_0x02e7('0xd'),auth[_0x02e7('0xe')](),controller[_0x02e7('0xf')]);router['post']('/',auth[_0x02e7('0xe')](),controller['create']);router[_0x02e7('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x02e7('0x11')](_0x02e7('0x12'),auth[_0x02e7('0xe')](),controller['destroy']);module[_0x02e7('0x13')]=router; \ No newline at end of file +var _0xd0c8=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','/describe','isAuthenticated','describe','/:id','getQuestions','post','create','put','update','delete','destroy','multer'];(function(_0x335412,_0x459891){var _0x24fa5c=function(_0x43df14){while(--_0x43df14){_0x335412['push'](_0x335412['shift']());}};_0x24fa5c(++_0x459891);}(_0xd0c8,0x179));var _0x8d0c=function(_0x22ae37,_0x55c142){_0x22ae37=_0x22ae37-0x0;var _0x5874e9=_0xd0c8[_0x22ae37];return _0x5874e9;};'use strict';var multer=require(_0x8d0c('0x0'));var util=require(_0x8d0c('0x1'));var path=require(_0x8d0c('0x2'));var timeout=require(_0x8d0c('0x3'));var express=require(_0x8d0c('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8d0c('0x5'));var interaction=require(_0x8d0c('0x6'));var config=require(_0x8d0c('0x7'));var controller=require(_0x8d0c('0x8'));router[_0x8d0c('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8d0c('0x9')](_0x8d0c('0xa'),auth[_0x8d0c('0xb')](),controller[_0x8d0c('0xc')]);router[_0x8d0c('0x9')](_0x8d0c('0xd'),auth[_0x8d0c('0xb')](),controller['show']);router[_0x8d0c('0x9')]('/:id/questions',auth[_0x8d0c('0xb')](),controller[_0x8d0c('0xe')]);router[_0x8d0c('0xf')]('/',auth[_0x8d0c('0xb')](),controller[_0x8d0c('0x10')]);router[_0x8d0c('0x11')](_0x8d0c('0xd'),auth[_0x8d0c('0xb')](),controller[_0x8d0c('0x12')]);router[_0x8d0c('0x13')](_0x8d0c('0xd'),auth[_0x8d0c('0xb')](),controller[_0x8d0c('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 0748e7d..769937e 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 _0xaa92=['DATE','STRING','BOOLEAN','moment','sequelize','exports','setDataValue','starttime','endtime','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x402b9a,_0x13f9c7){var _0x4507ff=function(_0x3f5b88){while(--_0x3f5b88){_0x402b9a['push'](_0x402b9a['shift']());}};_0x4507ff(++_0x13f9c7);}(_0xaa92,0x19d));var _0x2aa9=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xaa92[_0x484e36];return _0xafc85d;};'use strict';var moment=require(_0x2aa9('0x0'));var Sequelize=require(_0x2aa9('0x1'));module[_0x2aa9('0x2')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x163e60){this[_0x2aa9('0x3')](_0x2aa9('0x4'),_0x163e60);this[_0x2aa9('0x3')](_0x2aa9('0x5'),moment()['format'](_0x2aa9('0x6')));}},'endtime':{'type':Sequelize[_0x2aa9('0x7')]},'membername':{'type':Sequelize[_0x2aa9('0x8')]},'projectname':{'type':Sequelize[_0x2aa9('0x8')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x2aa9('0x8')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x2aa9('0x8')]},'completed':{'type':Sequelize[_0x2aa9('0x9')],'defaultValue':![]}}; \ No newline at end of file +var _0xf762=['setDataValue','endtime','YYYY-MM-DD\x20HH:mm:ss','STRING','moment','exports','DATE'];(function(_0x5b6cf1,_0x32fdcd){var _0x46278c=function(_0x53fd9b){while(--_0x53fd9b){_0x5b6cf1['push'](_0x5b6cf1['shift']());}};_0x46278c(++_0x32fdcd);}(_0xf762,0x1af));var _0x2f76=function(_0x563bf5,_0x1de761){_0x563bf5=_0x563bf5-0x0;var _0xd8ccdf=_0xf762[_0x563bf5];return _0xd8ccdf;};'use strict';var moment=require(_0x2f76('0x0'));var Sequelize=require('sequelize');module[_0x2f76('0x1')]={'starttime':{'type':Sequelize[_0x2f76('0x2')],'set':function(_0x4c46d7){this[_0x2f76('0x3')]('starttime',_0x4c46d7);this[_0x2f76('0x3')](_0x2f76('0x4'),moment()['format'](_0x2f76('0x5')));}},'endtime':{'type':Sequelize[_0x2f76('0x2')]},'membername':{'type':Sequelize[_0x2f76('0x6')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x2f76('0x6')]},'uniqueid':{'type':Sequelize[_0x2f76('0x6')]},'calleridname':{'type':Sequelize[_0x2f76('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 82df742..a034bc5 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 _0xb3f2=['stack','name','index','JscriptySessionReport','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','merge','map','type','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','rawAttributes','include','catch','create','body','find','describe','getQuestions','JscriptyQuestionReport','SessionId','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','reject','save','update','destroy','then','error'];(function(_0x56930f,_0x978287){var _0x1e32ca=function(_0x1cdb91){while(--_0x1cdb91){_0x56930f['push'](_0x56930f['shift']());}};_0x1e32ca(++_0x978287);}(_0xb3f2,0x117));var _0x2b3f=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0xb3f2[_0x4b2863];return _0x567d67;};'use strict';var emlformat=require(_0x2b3f('0x0'));var rimraf=require(_0x2b3f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2b3f('0x2'));var rp=require(_0x2b3f('0x3'));var moment=require(_0x2b3f('0x4'));var BPromise=require(_0x2b3f('0x5'));var Mustache=require('mustache');var util=require(_0x2b3f('0x6'));var path=require(_0x2b3f('0x7'));var sox=require(_0x2b3f('0x8'));var csv=require(_0x2b3f('0x9'));var ejs=require(_0x2b3f('0xa'));var fs=require('fs');var fs_extra=require(_0x2b3f('0xb'));var _=require('lodash');var squel=require(_0x2b3f('0xc'));var crypto=require(_0x2b3f('0xd'));var jsforce=require(_0x2b3f('0xe'));var deskjs=require(_0x2b3f('0xf'));var toCsv=require(_0x2b3f('0x9'));var querystring=require(_0x2b3f('0x10'));var Papa=require('papaparse');var Redis=require(_0x2b3f('0x11'));var authService=require(_0x2b3f('0x12'));var qs=require(_0x2b3f('0x13'));var as=require(_0x2b3f('0x14'));var hardwareService=require(_0x2b3f('0x15'));var logger=require(_0x2b3f('0x16'))(_0x2b3f('0x17'));var utils=require('../../config/utils');var config=require(_0x2b3f('0x18'));var licenseUtil=require(_0x2b3f('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3896ec,_0x2dfade){_0x2dfade=_0x2dfade||0xcc;return function(_0x2994e8){if(_0x2994e8){return _0x3896ec[_0x2b3f('0x1a')](_0x2dfade);}return _0x3896ec[_0x2b3f('0x1b')](_0x2dfade)[_0x2b3f('0x1c')]();};}function respondWithResult(_0x223499,_0x4358d7){_0x4358d7=_0x4358d7||0xc8;return function(_0x95ee54){if(_0x95ee54){return _0x223499[_0x2b3f('0x1b')](_0x4358d7)[_0x2b3f('0x1d')](_0x95ee54);}};}function respondWithFilteredResult(_0x4d0e20,_0x19825a){return function(_0x194c56){if(_0x194c56){var _0x31c1b8=typeof _0x19825a[_0x2b3f('0x1e')]===_0x2b3f('0x1f')&&typeof _0x19825a['limit']===_0x2b3f('0x1f');var _0x2cd182=_0x194c56[_0x2b3f('0x20')];var _0x3feab1=_0x31c1b8?0x0:_0x19825a[_0x2b3f('0x1e')];var _0x29ca7f=_0x31c1b8?_0x194c56[_0x2b3f('0x20')]:_0x19825a[_0x2b3f('0x1e')]+_0x19825a[_0x2b3f('0x21')];var _0x28cbb4;if(_0x29ca7f>=_0x2cd182){_0x29ca7f=_0x2cd182;_0x28cbb4=0xc8;}else{_0x28cbb4=0xce;}_0x4d0e20[_0x2b3f('0x1b')](_0x28cbb4);return _0x4d0e20['set'](_0x2b3f('0x22'),_0x3feab1+'-'+_0x29ca7f+'/'+_0x2cd182)[_0x2b3f('0x1d')](_0x194c56);}return null;};}function patchUpdates(_0x1c7943){return function(_0x2789bd){try{jsonpatch['apply'](_0x2789bd,_0x1c7943,!![]);}catch(_0x10d09b){return BPromise[_0x2b3f('0x23')](_0x10d09b);}return _0x2789bd[_0x2b3f('0x24')]();};}function saveUpdates(_0x29de98,_0x3a9690){return function(_0x5f27c8){if(_0x5f27c8){return _0x5f27c8[_0x2b3f('0x25')](_0x29de98)['then'](function(_0x398c0b){return _0x398c0b;});}return null;};}function removeEntity(_0xb60748,_0x43f091){return function(_0x508201){if(_0x508201){return _0x508201[_0x2b3f('0x26')]()[_0x2b3f('0x27')](function(){_0xb60748[_0x2b3f('0x1b')](0xcc)[_0x2b3f('0x1c')]();});}};}function handleEntityNotFound(_0x49c096,_0x40d614){return function(_0xb530b4){if(!_0xb530b4){_0x49c096['sendStatus'](0x194);}return _0xb530b4;};}function handleError(_0x5d6557,_0x319519){_0x319519=_0x319519||0x1f4;return function(_0x120369){logger[_0x2b3f('0x28')](_0x120369[_0x2b3f('0x29')]);if(_0x120369[_0x2b3f('0x2a')]){delete _0x120369[_0x2b3f('0x2a')];}_0x5d6557['status'](_0x319519)['send'](_0x120369);};}exports[_0x2b3f('0x2b')]=function(_0x490c21,_0xbb691b){var _0x9669e0={},_0x1c5159={},_0x1311cd={'count':0x0,'rows':[]};var _0x277274=_['map'](db[_0x2b3f('0x2c')]['rawAttributes'],function(_0x29284a){return{'name':_0x29284a[_0x2b3f('0x2d')],'type':_0x29284a['type']['key']};});_0x1c5159[_0x2b3f('0x2e')]=_['map'](_0x277274,_0x2b3f('0x2a'));_0x1c5159[_0x2b3f('0x2f')]=_[_0x2b3f('0x30')](_0x490c21['query']);_0x1c5159[_0x2b3f('0x31')]=_[_0x2b3f('0x32')](_0x1c5159[_0x2b3f('0x2e')],_0x1c5159['query']);_0x9669e0['attributes']=_[_0x2b3f('0x32')](_0x1c5159[_0x2b3f('0x2e')],qs['fields'](_0x490c21[_0x2b3f('0x2f')][_0x2b3f('0x33')]));_0x9669e0[_0x2b3f('0x34')]=_0x9669e0[_0x2b3f('0x34')][_0x2b3f('0x35')]?_0x9669e0[_0x2b3f('0x34')]:_0x1c5159[_0x2b3f('0x2e')];if(!_0x490c21[_0x2b3f('0x2f')][_0x2b3f('0x36')](_0x2b3f('0x37'))){_0x9669e0[_0x2b3f('0x21')]=qs['limit'](_0x490c21[_0x2b3f('0x2f')]['limit']);_0x9669e0[_0x2b3f('0x1e')]=qs[_0x2b3f('0x1e')](_0x490c21['query'][_0x2b3f('0x1e')]);}_0x9669e0[_0x2b3f('0x38')]=qs['sort'](_0x490c21[_0x2b3f('0x2f')]['sort']);_0x9669e0[_0x2b3f('0x39')]=qs[_0x2b3f('0x31')](_[_0x2b3f('0x3a')](_0x490c21[_0x2b3f('0x2f')],_0x1c5159['filters']),_0x277274);if(_0x490c21['query']['filter']){_0x9669e0[_0x2b3f('0x39')]=_[_0x2b3f('0x3b')](_0x9669e0['where'],{'$or':_[_0x2b3f('0x3c')](_0x277274,function(_0x17a29b){if(_0x17a29b[_0x2b3f('0x3d')]!==_0x2b3f('0x3e')){var _0x5a64bf={};_0x5a64bf[_0x17a29b[_0x2b3f('0x2a')]]={'$like':'%'+_0x490c21[_0x2b3f('0x2f')][_0x2b3f('0x3f')]+'%'};return _0x5a64bf;}})});}_0x9669e0=_['merge']({},_0x9669e0,_0x490c21[_0x2b3f('0x40')]);var _0x529fd8={'where':_0x9669e0[_0x2b3f('0x39')]};return db[_0x2b3f('0x2c')][_0x2b3f('0x20')](_0x529fd8)[_0x2b3f('0x27')](function(_0x2d0efa){_0x1311cd[_0x2b3f('0x20')]=_0x2d0efa;if(_0x490c21[_0x2b3f('0x2f')][_0x2b3f('0x41')]){_0x9669e0['include']=[{'all':!![]}];}return db[_0x2b3f('0x2c')][_0x2b3f('0x42')](_0x9669e0);})[_0x2b3f('0x27')](function(_0x3980e0){_0x1311cd[_0x2b3f('0x43')]=_0x3980e0;return _0x1311cd;})[_0x2b3f('0x27')](respondWithFilteredResult(_0xbb691b,_0x9669e0))['catch'](handleError(_0xbb691b,null));};exports[_0x2b3f('0x44')]=function(_0x47a3e4,_0x3960be){var _0x5469c6={'raw':!![],'where':{'id':_0x47a3e4[_0x2b3f('0x45')]['id']}},_0x2a3312={};_0x2a3312['model']=_[_0x2b3f('0x30')](db[_0x2b3f('0x2c')][_0x2b3f('0x46')]);_0x2a3312['query']=_[_0x2b3f('0x30')](_0x47a3e4[_0x2b3f('0x2f')]);_0x2a3312[_0x2b3f('0x31')]=_[_0x2b3f('0x32')](_0x2a3312['model'],_0x2a3312['query']);_0x5469c6[_0x2b3f('0x34')]=_[_0x2b3f('0x32')](_0x2a3312[_0x2b3f('0x2e')],qs['fields'](_0x47a3e4[_0x2b3f('0x2f')][_0x2b3f('0x33')]));_0x5469c6[_0x2b3f('0x34')]=_0x5469c6[_0x2b3f('0x34')][_0x2b3f('0x35')]?_0x5469c6['attributes']:_0x2a3312['model'];if(_0x47a3e4['query'][_0x2b3f('0x41')]){_0x5469c6[_0x2b3f('0x47')]=[{'all':!![]}];}_0x5469c6=_[_0x2b3f('0x3b')]({},_0x5469c6,_0x47a3e4[_0x2b3f('0x40')]);return db[_0x2b3f('0x2c')]['find'](_0x5469c6)[_0x2b3f('0x27')](handleEntityNotFound(_0x3960be,null))['then'](respondWithResult(_0x3960be,null))[_0x2b3f('0x48')](handleError(_0x3960be,null));};exports[_0x2b3f('0x49')]=function(_0x4308b8,_0x48950c){return db['JscriptySessionReport'][_0x2b3f('0x49')](_0x4308b8[_0x2b3f('0x4a')],{})[_0x2b3f('0x27')](respondWithResult(_0x48950c,0xc9))['catch'](handleError(_0x48950c,null));};exports[_0x2b3f('0x25')]=function(_0x2462eb,_0x5c1cc3){if(_0x2462eb[_0x2b3f('0x4a')]['id']){delete _0x2462eb[_0x2b3f('0x4a')]['id'];}return db[_0x2b3f('0x2c')][_0x2b3f('0x4b')]({'where':{'id':_0x2462eb[_0x2b3f('0x45')]['id']}})[_0x2b3f('0x27')](handleEntityNotFound(_0x5c1cc3,null))[_0x2b3f('0x27')](saveUpdates(_0x2462eb['body'],null))[_0x2b3f('0x27')](respondWithResult(_0x5c1cc3,null))[_0x2b3f('0x48')](handleError(_0x5c1cc3,null));};exports[_0x2b3f('0x26')]=function(_0x2db9a1,_0x3f8e84){return db[_0x2b3f('0x2c')][_0x2b3f('0x4b')]({'where':{'id':_0x2db9a1[_0x2b3f('0x45')]['id']}})[_0x2b3f('0x27')](handleEntityNotFound(_0x3f8e84,null))[_0x2b3f('0x27')](removeEntity(_0x3f8e84,null))['catch'](handleError(_0x3f8e84,null));};exports[_0x2b3f('0x4c')]=function(_0x3a2d1e,_0x3f5473){return db['JscriptySessionReport']['describe']()['then'](respondWithResult(_0x3f5473,null))[_0x2b3f('0x48')](handleError(_0x3f5473,null));};exports[_0x2b3f('0x4d')]=function(_0x312bac,_0x274f56,_0x523473){var _0x24f23f={'raw':!![],'where':{}};var _0x593393={};var _0x3aed83={'count':0x0,'rows':[]};return db[_0x2b3f('0x2c')]['findOne']({'where':{'id':_0x312bac['params']['id']}})[_0x2b3f('0x27')](handleEntityNotFound(_0x274f56,null))[_0x2b3f('0x27')](function(_0x1a5b01){if(_0x1a5b01){_0x593393[_0x2b3f('0x2e')]=_[_0x2b3f('0x30')](db[_0x2b3f('0x4e')]['rawAttributes']);_0x593393[_0x2b3f('0x2f')]=_[_0x2b3f('0x30')](_0x312bac[_0x2b3f('0x2f')]);_0x593393['filters']=_[_0x2b3f('0x32')](_0x593393[_0x2b3f('0x2e')],_0x593393[_0x2b3f('0x2f')]);_0x24f23f['attributes']=_[_0x2b3f('0x32')](_0x593393['model'],qs[_0x2b3f('0x33')](_0x312bac[_0x2b3f('0x2f')][_0x2b3f('0x33')]));_0x24f23f[_0x2b3f('0x34')]=_0x24f23f['attributes'][_0x2b3f('0x35')]?_0x24f23f[_0x2b3f('0x34')]:_0x593393[_0x2b3f('0x2e')];if(!_0x312bac['query'][_0x2b3f('0x36')](_0x2b3f('0x37'))){_0x24f23f[_0x2b3f('0x21')]=qs[_0x2b3f('0x21')](_0x312bac['query'][_0x2b3f('0x21')]);_0x24f23f['offset']=qs[_0x2b3f('0x1e')](_0x312bac[_0x2b3f('0x2f')][_0x2b3f('0x1e')]);}_0x24f23f[_0x2b3f('0x38')]=qs['sort'](_0x312bac[_0x2b3f('0x2f')]['sort']);_0x24f23f[_0x2b3f('0x39')]=qs[_0x2b3f('0x31')](_[_0x2b3f('0x3a')](_0x312bac[_0x2b3f('0x2f')],_0x593393['filters']));_0x24f23f[_0x2b3f('0x39')][_0x2b3f('0x4f')]=_0x1a5b01['id'];if(_0x312bac[_0x2b3f('0x2f')]['filter']){_0x24f23f['where']=_[_0x2b3f('0x3b')](_0x24f23f[_0x2b3f('0x39')],{'$or':_[_0x2b3f('0x3c')](_0x24f23f[_0x2b3f('0x34')],function(_0x531d1c){var _0x5f1f7c={};_0x5f1f7c[_0x531d1c]={'$like':'%'+_0x312bac[_0x2b3f('0x2f')]['filter']+'%'};return _0x5f1f7c;})});}_0x24f23f=_[_0x2b3f('0x3b')]({},_0x24f23f,_0x312bac[_0x2b3f('0x40')]);return db[_0x2b3f('0x4e')][_0x2b3f('0x20')]({'where':_0x24f23f[_0x2b3f('0x39')]})[_0x2b3f('0x27')](function(_0x153dbf){_0x3aed83[_0x2b3f('0x20')]=_0x153dbf;if(_0x312bac[_0x2b3f('0x2f')][_0x2b3f('0x41')]){_0x24f23f[_0x2b3f('0x47')]=[{'all':!![]}];}return db[_0x2b3f('0x4e')][_0x2b3f('0x42')](_0x24f23f);})['then'](function(_0x1c3e87){_0x3aed83[_0x2b3f('0x43')]=_0x1c3e87;return _0x3aed83;});}})[_0x2b3f('0x27')](respondWithFilteredResult(_0x274f56,_0x24f23f))[_0x2b3f('0x48')](handleError(_0x274f56,null));}; \ No newline at end of file +var _0xbf75=['getQuestions','findOne','order','SessionId','JscriptyQuestionReport','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','sendStatus','error','stack','name','send','index','map','JscriptySessionReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','update','body','describe'];(function(_0x42a865,_0x40fdf9){var _0x15de7c=function(_0x5d9032){while(--_0x5d9032){_0x42a865['push'](_0x42a865['shift']());}};_0x15de7c(++_0x40fdf9);}(_0xbf75,0x155));var _0x5bf7=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0xbf75[_0x58dc25];return _0x21b0a7;};'use strict';var emlformat=require(_0x5bf7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5bf7('0x1'));var jsonpatch=require(_0x5bf7('0x2'));var rp=require(_0x5bf7('0x3'));var moment=require(_0x5bf7('0x4'));var BPromise=require(_0x5bf7('0x5'));var Mustache=require(_0x5bf7('0x6'));var util=require(_0x5bf7('0x7'));var path=require(_0x5bf7('0x8'));var sox=require('sox');var csv=require(_0x5bf7('0x9'));var ejs=require(_0x5bf7('0xa'));var fs=require('fs');var fs_extra=require(_0x5bf7('0xb'));var _=require(_0x5bf7('0xc'));var squel=require(_0x5bf7('0xd'));var crypto=require(_0x5bf7('0xe'));var jsforce=require(_0x5bf7('0xf'));var deskjs=require(_0x5bf7('0x10'));var toCsv=require('to-csv');var querystring=require(_0x5bf7('0x11'));var Papa=require(_0x5bf7('0x12'));var Redis=require(_0x5bf7('0x13'));var authService=require(_0x5bf7('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5bf7('0x15'));var logger=require(_0x5bf7('0x16'))(_0x5bf7('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5bf7('0x18'));var db=require(_0x5bf7('0x19'))['db'];function respondWithStatusCode(_0xcfb515,_0x1a7a12){_0x1a7a12=_0x1a7a12||0xcc;return function(_0x29945d){if(_0x29945d){return _0xcfb515['sendStatus'](_0x1a7a12);}return _0xcfb515[_0x5bf7('0x1a')](_0x1a7a12)[_0x5bf7('0x1b')]();};}function respondWithResult(_0x5ee552,_0x25f0da){_0x25f0da=_0x25f0da||0xc8;return function(_0x598da4){if(_0x598da4){return _0x5ee552[_0x5bf7('0x1a')](_0x25f0da)[_0x5bf7('0x1c')](_0x598da4);}};}function respondWithFilteredResult(_0x14ce5d,_0x4ae771){return function(_0x31f3d4){if(_0x31f3d4){var _0x32e7a1=typeof _0x4ae771['offset']==='undefined'&&typeof _0x4ae771[_0x5bf7('0x1d')]===_0x5bf7('0x1e');var _0x5a0497=_0x31f3d4[_0x5bf7('0x1f')];var _0x4b0014=_0x32e7a1?0x0:_0x4ae771[_0x5bf7('0x20')];var _0x5c9fa6=_0x32e7a1?_0x31f3d4[_0x5bf7('0x1f')]:_0x4ae771[_0x5bf7('0x20')]+_0x4ae771['limit'];var _0x280631;if(_0x5c9fa6>=_0x5a0497){_0x5c9fa6=_0x5a0497;_0x280631=0xc8;}else{_0x280631=0xce;}_0x14ce5d['status'](_0x280631);return _0x14ce5d[_0x5bf7('0x21')](_0x5bf7('0x22'),_0x4b0014+'-'+_0x5c9fa6+'/'+_0x5a0497)[_0x5bf7('0x1c')](_0x31f3d4);}return null;};}function patchUpdates(_0x360f02){return function(_0x5dfaf5){try{jsonpatch[_0x5bf7('0x23')](_0x5dfaf5,_0x360f02,!![]);}catch(_0x283332){return BPromise[_0x5bf7('0x24')](_0x283332);}return _0x5dfaf5[_0x5bf7('0x25')]();};}function saveUpdates(_0x2ffad2,_0x4a868d){return function(_0x3f7af4){if(_0x3f7af4){return _0x3f7af4['update'](_0x2ffad2)['then'](function(_0x5534d6){return _0x5534d6;});}return null;};}function removeEntity(_0x5862d8,_0x117bfb){return function(_0x5087b6){if(_0x5087b6){return _0x5087b6['destroy']()[_0x5bf7('0x26')](function(){_0x5862d8[_0x5bf7('0x1a')](0xcc)[_0x5bf7('0x1b')]();});}};}function handleEntityNotFound(_0x54ef2f,_0x4f1034){return function(_0x3e7ed3){if(!_0x3e7ed3){_0x54ef2f[_0x5bf7('0x27')](0x194);}return _0x3e7ed3;};}function handleError(_0xf8d10a,_0x5a5ecf){_0x5a5ecf=_0x5a5ecf||0x1f4;return function(_0x17dfe4){logger[_0x5bf7('0x28')](_0x17dfe4[_0x5bf7('0x29')]);if(_0x17dfe4['name']){delete _0x17dfe4[_0x5bf7('0x2a')];}_0xf8d10a[_0x5bf7('0x1a')](_0x5a5ecf)[_0x5bf7('0x2b')](_0x17dfe4);};}exports[_0x5bf7('0x2c')]=function(_0x1d25d7,_0x69391d){var _0x5e136b={},_0x3d2f54={},_0x3cd22c={'count':0x0,'rows':[]};var _0x1585ec=_[_0x5bf7('0x2d')](db[_0x5bf7('0x2e')]['rawAttributes'],function(_0xeac632){return{'name':_0xeac632[_0x5bf7('0x2f')],'type':_0xeac632[_0x5bf7('0x30')][_0x5bf7('0x31')]};});_0x3d2f54[_0x5bf7('0x32')]=_[_0x5bf7('0x2d')](_0x1585ec,_0x5bf7('0x2a'));_0x3d2f54[_0x5bf7('0x33')]=_[_0x5bf7('0x34')](_0x1d25d7['query']);_0x3d2f54[_0x5bf7('0x35')]=_[_0x5bf7('0x36')](_0x3d2f54['model'],_0x3d2f54[_0x5bf7('0x33')]);_0x5e136b[_0x5bf7('0x37')]=_['intersection'](_0x3d2f54[_0x5bf7('0x32')],qs[_0x5bf7('0x38')](_0x1d25d7[_0x5bf7('0x33')]['fields']));_0x5e136b[_0x5bf7('0x37')]=_0x5e136b[_0x5bf7('0x37')][_0x5bf7('0x39')]?_0x5e136b[_0x5bf7('0x37')]:_0x3d2f54[_0x5bf7('0x32')];if(!_0x1d25d7['query'][_0x5bf7('0x3a')](_0x5bf7('0x3b'))){_0x5e136b[_0x5bf7('0x1d')]=qs['limit'](_0x1d25d7['query'][_0x5bf7('0x1d')]);_0x5e136b[_0x5bf7('0x20')]=qs[_0x5bf7('0x20')](_0x1d25d7[_0x5bf7('0x33')][_0x5bf7('0x20')]);}_0x5e136b['order']=qs[_0x5bf7('0x3c')](_0x1d25d7[_0x5bf7('0x33')][_0x5bf7('0x3c')]);_0x5e136b[_0x5bf7('0x3d')]=qs[_0x5bf7('0x35')](_[_0x5bf7('0x3e')](_0x1d25d7[_0x5bf7('0x33')],_0x3d2f54[_0x5bf7('0x35')]),_0x1585ec);if(_0x1d25d7[_0x5bf7('0x33')][_0x5bf7('0x3f')]){_0x5e136b[_0x5bf7('0x3d')]=_[_0x5bf7('0x40')](_0x5e136b['where'],{'$or':_['map'](_0x1585ec,function(_0x221b24){if(_0x221b24[_0x5bf7('0x30')]!=='VIRTUAL'){var _0x35aab8={};_0x35aab8[_0x221b24['name']]={'$like':'%'+_0x1d25d7[_0x5bf7('0x33')]['filter']+'%'};return _0x35aab8;}})});}_0x5e136b=_[_0x5bf7('0x40')]({},_0x5e136b,_0x1d25d7[_0x5bf7('0x41')]);var _0x5b5642={'where':_0x5e136b[_0x5bf7('0x3d')]};return db[_0x5bf7('0x2e')][_0x5bf7('0x1f')](_0x5b5642)['then'](function(_0xb0af17){_0x3cd22c[_0x5bf7('0x1f')]=_0xb0af17;if(_0x1d25d7[_0x5bf7('0x33')][_0x5bf7('0x42')]){_0x5e136b[_0x5bf7('0x43')]=[{'all':!![]}];}return db[_0x5bf7('0x2e')][_0x5bf7('0x44')](_0x5e136b);})[_0x5bf7('0x26')](function(_0x29a536){_0x3cd22c[_0x5bf7('0x45')]=_0x29a536;return _0x3cd22c;})[_0x5bf7('0x26')](respondWithFilteredResult(_0x69391d,_0x5e136b))[_0x5bf7('0x46')](handleError(_0x69391d,null));};exports[_0x5bf7('0x47')]=function(_0x33316f,_0x126e3b){var _0x789bb8={'raw':!![],'where':{'id':_0x33316f[_0x5bf7('0x48')]['id']}},_0x49b2e4={};_0x49b2e4[_0x5bf7('0x32')]=_[_0x5bf7('0x34')](db[_0x5bf7('0x2e')][_0x5bf7('0x49')]);_0x49b2e4[_0x5bf7('0x33')]=_[_0x5bf7('0x34')](_0x33316f['query']);_0x49b2e4['filters']=_[_0x5bf7('0x36')](_0x49b2e4[_0x5bf7('0x32')],_0x49b2e4[_0x5bf7('0x33')]);_0x789bb8['attributes']=_[_0x5bf7('0x36')](_0x49b2e4[_0x5bf7('0x32')],qs[_0x5bf7('0x38')](_0x33316f[_0x5bf7('0x33')][_0x5bf7('0x38')]));_0x789bb8['attributes']=_0x789bb8[_0x5bf7('0x37')]['length']?_0x789bb8[_0x5bf7('0x37')]:_0x49b2e4[_0x5bf7('0x32')];if(_0x33316f[_0x5bf7('0x33')][_0x5bf7('0x42')]){_0x789bb8[_0x5bf7('0x43')]=[{'all':!![]}];}_0x789bb8=_[_0x5bf7('0x40')]({},_0x789bb8,_0x33316f[_0x5bf7('0x41')]);return db['JscriptySessionReport'][_0x5bf7('0x4a')](_0x789bb8)[_0x5bf7('0x26')](handleEntityNotFound(_0x126e3b,null))[_0x5bf7('0x26')](respondWithResult(_0x126e3b,null))[_0x5bf7('0x46')](handleError(_0x126e3b,null));};exports['create']=function(_0x38b9f6,_0x1ba994){return db['JscriptySessionReport'][_0x5bf7('0x4b')](_0x38b9f6['body'],{})[_0x5bf7('0x26')](respondWithResult(_0x1ba994,0xc9))['catch'](handleError(_0x1ba994,null));};exports[_0x5bf7('0x4c')]=function(_0x19b9ce,_0x321c10){if(_0x19b9ce['body']['id']){delete _0x19b9ce[_0x5bf7('0x4d')]['id'];}return db[_0x5bf7('0x2e')][_0x5bf7('0x4a')]({'where':{'id':_0x19b9ce[_0x5bf7('0x48')]['id']}})[_0x5bf7('0x26')](handleEntityNotFound(_0x321c10,null))['then'](saveUpdates(_0x19b9ce[_0x5bf7('0x4d')],null))[_0x5bf7('0x26')](respondWithResult(_0x321c10,null))[_0x5bf7('0x46')](handleError(_0x321c10,null));};exports['destroy']=function(_0x7ffa77,_0x24bbb1){return db[_0x5bf7('0x2e')][_0x5bf7('0x4a')]({'where':{'id':_0x7ffa77[_0x5bf7('0x48')]['id']}})[_0x5bf7('0x26')](handleEntityNotFound(_0x24bbb1,null))['then'](removeEntity(_0x24bbb1,null))[_0x5bf7('0x46')](handleError(_0x24bbb1,null));};exports['describe']=function(_0x26acd8,_0x331e15){return db['JscriptySessionReport'][_0x5bf7('0x4e')]()[_0x5bf7('0x26')](respondWithResult(_0x331e15,null))[_0x5bf7('0x46')](handleError(_0x331e15,null));};exports[_0x5bf7('0x4f')]=function(_0x43252e,_0x2a9157,_0x1232bf){var _0x54be74={'raw':!![],'where':{}};var _0xb98cbc={};var _0x599117={'count':0x0,'rows':[]};return db[_0x5bf7('0x2e')][_0x5bf7('0x50')]({'where':{'id':_0x43252e[_0x5bf7('0x48')]['id']}})['then'](handleEntityNotFound(_0x2a9157,null))['then'](function(_0x357604){if(_0x357604){_0xb98cbc[_0x5bf7('0x32')]=_[_0x5bf7('0x34')](db['JscriptyQuestionReport'][_0x5bf7('0x49')]);_0xb98cbc[_0x5bf7('0x33')]=_['keys'](_0x43252e[_0x5bf7('0x33')]);_0xb98cbc['filters']=_['intersection'](_0xb98cbc[_0x5bf7('0x32')],_0xb98cbc[_0x5bf7('0x33')]);_0x54be74[_0x5bf7('0x37')]=_['intersection'](_0xb98cbc[_0x5bf7('0x32')],qs[_0x5bf7('0x38')](_0x43252e[_0x5bf7('0x33')][_0x5bf7('0x38')]));_0x54be74[_0x5bf7('0x37')]=_0x54be74[_0x5bf7('0x37')][_0x5bf7('0x39')]?_0x54be74[_0x5bf7('0x37')]:_0xb98cbc[_0x5bf7('0x32')];if(!_0x43252e[_0x5bf7('0x33')][_0x5bf7('0x3a')](_0x5bf7('0x3b'))){_0x54be74[_0x5bf7('0x1d')]=qs[_0x5bf7('0x1d')](_0x43252e[_0x5bf7('0x33')][_0x5bf7('0x1d')]);_0x54be74[_0x5bf7('0x20')]=qs[_0x5bf7('0x20')](_0x43252e['query']['offset']);}_0x54be74[_0x5bf7('0x51')]=qs[_0x5bf7('0x3c')](_0x43252e[_0x5bf7('0x33')][_0x5bf7('0x3c')]);_0x54be74[_0x5bf7('0x3d')]=qs['filters'](_['pick'](_0x43252e[_0x5bf7('0x33')],_0xb98cbc[_0x5bf7('0x35')]));_0x54be74[_0x5bf7('0x3d')][_0x5bf7('0x52')]=_0x357604['id'];if(_0x43252e[_0x5bf7('0x33')]['filter']){_0x54be74[_0x5bf7('0x3d')]=_['merge'](_0x54be74['where'],{'$or':_[_0x5bf7('0x2d')](_0x54be74[_0x5bf7('0x37')],function(_0x2692b6){var _0x5f471e={};_0x5f471e[_0x2692b6]={'$like':'%'+_0x43252e[_0x5bf7('0x33')][_0x5bf7('0x3f')]+'%'};return _0x5f471e;})});}_0x54be74=_[_0x5bf7('0x40')]({},_0x54be74,_0x43252e[_0x5bf7('0x41')]);return db['JscriptyQuestionReport'][_0x5bf7('0x1f')]({'where':_0x54be74['where']})['then'](function(_0x57f797){_0x599117['count']=_0x57f797;if(_0x43252e['query']['includeAll']){_0x54be74[_0x5bf7('0x43')]=[{'all':!![]}];}return db[_0x5bf7('0x53')][_0x5bf7('0x44')](_0x54be74);})[_0x5bf7('0x26')](function(_0x3c6742){_0x599117[_0x5bf7('0x45')]=_0x3c6742;return _0x599117;});}})['then'](respondWithFilteredResult(_0x2a9157,_0x54be74))[_0x5bf7('0x46')](handleError(_0x2a9157,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index b800b16..c58ce82 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 _0xbd51=['exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','../../config/logger','api','moment','bluebird','./jscriptySessionReport.attributes'];(function(_0x32505c,_0x1c6d6d){var _0x25a39f=function(_0x2ebc4f){while(--_0x2ebc4f){_0x32505c['push'](_0x32505c['shift']());}};_0x25a39f(++_0x1c6d6d);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x54ab70,_0x1a27a4){_0x54ab70=_0x54ab70-0x0;var _0x504707=_0xbd51[_0x54ab70];return _0x504707;};'use strict';var _=require(_0x1bd5('0x0'));var util=require('util');var logger=require(_0x1bd5('0x1'))(_0x1bd5('0x2'));var moment=require(_0x1bd5('0x3'));var BPromise=require(_0x1bd5('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(_0x1bd5('0x5'));module[_0x1bd5('0x6')]=function(_0x43e6b6,_0x59ddfb){return _0x43e6b6[_0x1bd5('0x7')](_0x1bd5('0x8'),attributes,{'tableName':_0x1bd5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5075=['bluebird','request-promise','rimraf','../../config/environment','./jscriptySessionReport.attributes','define','report_jscripty_sessions','lodash','util','../../config/logger','api','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5075,0x73));var _0x5507=function(_0xc08f00,_0x28067f){_0xc08f00=_0xc08f00-0x0;var _0x8649f7=_0x5075[_0xc08f00];return _0x8649f7;};'use strict';var _=require(_0x5507('0x0'));var util=require(_0x5507('0x1'));var logger=require(_0x5507('0x2'))(_0x5507('0x3'));var moment=require(_0x5507('0x4'));var BPromise=require(_0x5507('0x5'));var rp=require(_0x5507('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5507('0x7'));var config=require(_0x5507('0x8'));var attributes=require(_0x5507('0x9'));module['exports']=function(_0x5b6d7f,_0x2cd9ee){return _0x5b6d7f[_0x5507('0xa')]('JscriptySessionReport',attributes,{'tableName':_0x5507('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 f32b6b9..b96832a 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 _0xf61e=['info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x18b0fa,_0x38d8d7){var _0x5a15ae=function(_0x136adb){while(--_0x136adb){_0x18b0fa['push'](_0x18b0fa['shift']());}};_0x5a15ae(++_0x38d8d7);}(_0xf61e,0x191));var _0xef61=function(_0x2c5c9c,_0x6ec7dd){_0x2c5c9c=_0x2c5c9c-0x0;var _0x313713=_0xf61e[_0x2c5c9c];return _0x313713;};'use strict';var _=require(_0xef61('0x0'));var util=require(_0xef61('0x1'));var moment=require(_0xef61('0x2'));var BPromise=require(_0xef61('0x3'));var rs=require(_0xef61('0x4'));var fs=require('fs');var Redis=require(_0xef61('0x5'));var db=require(_0xef61('0x6'))['db'];var utils=require(_0xef61('0x7'));var logger=require(_0xef61('0x8'))(_0xef61('0x9'));var config=require(_0xef61('0xa'));var jayson=require(_0xef61('0xb'));var client=jayson['client'][_0xef61('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3e2f79,_0x4f0cc5,_0x2242a7){return new BPromise(function(_0x277fa1,_0x106e7f){return client['request'](_0x3e2f79,_0x2242a7)['then'](function(_0x188894){logger[_0xef61('0xd')](_0xef61('0xe'),_0x4f0cc5,_0xef61('0xf'));logger[_0xef61('0x10')](_0xef61('0x11'),_0x4f0cc5,_0xef61('0xf'),JSON[_0xef61('0x12')](_0x188894));if(_0x188894[_0xef61('0x13')]){if(_0x188894[_0xef61('0x13')][_0xef61('0x14')]===0x1f4){logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x188894[_0xef61('0x13')]['message']);return _0x106e7f(_0x188894[_0xef61('0x13')]['message']);}logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x188894[_0xef61('0x13')][_0xef61('0x15')]);return _0x277fa1(_0x188894['error'][_0xef61('0x15')]);}else{logger[_0xef61('0xd')](_0xef61('0xe'),_0x4f0cc5,_0xef61('0xf'));_0x277fa1(_0x188894['result'][_0xef61('0x15')]);}})[_0xef61('0x16')](function(_0x4f7a62){logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x4f7a62);_0x106e7f(_0x4f7a62);});});} \ No newline at end of file +var _0x8952=['JscriptySessionReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error'];(function(_0x1726e1,_0x1cc1f4){var _0x44eccc=function(_0x29d671){while(--_0x29d671){_0x1726e1['push'](_0x1726e1['shift']());}};_0x44eccc(++_0x1cc1f4);}(_0x8952,0x17e));var _0x2895=function(_0x30c76f,_0x5ba061){_0x30c76f=_0x30c76f-0x0;var _0x23811c=_0x8952[_0x30c76f];return _0x23811c;};'use strict';var _=require('lodash');var util=require(_0x2895('0x0'));var moment=require(_0x2895('0x1'));var BPromise=require(_0x2895('0x2'));var rs=require(_0x2895('0x3'));var fs=require('fs');var Redis=require(_0x2895('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2895('0x5'));var logger=require(_0x2895('0x6'))(_0x2895('0x7'));var config=require('../../config/environment');var jayson=require(_0x2895('0x8'));var client=jayson[_0x2895('0x9')][_0x2895('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ea619,_0x526c32,_0x238b4a){return new BPromise(function(_0x335002,_0x159f86){return client[_0x2895('0xb')](_0x4ea619,_0x238b4a)[_0x2895('0xc')](function(_0x4952fa){logger[_0x2895('0xd')]('JscriptySessionReport,\x20%s,\x20%s',_0x526c32,_0x2895('0xe'));logger['debug']('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x526c32,'request\x20sent',JSON[_0x2895('0xf')](_0x4952fa));if(_0x4952fa[_0x2895('0x10')]){if(_0x4952fa[_0x2895('0x10')]['code']===0x1f4){logger[_0x2895('0x10')](_0x2895('0x11'),_0x526c32,_0x4952fa['error'][_0x2895('0x12')]);return _0x159f86(_0x4952fa[_0x2895('0x10')]['message']);}logger['error'](_0x2895('0x11'),_0x526c32,_0x4952fa[_0x2895('0x10')]['message']);return _0x335002(_0x4952fa[_0x2895('0x10')][_0x2895('0x12')]);}else{logger[_0x2895('0xd')](_0x2895('0x11'),_0x526c32,_0x2895('0xe'));_0x335002(_0x4952fa[_0x2895('0x13')][_0x2895('0x12')]);}})[_0x2895('0x14')](function(_0x3e96d7){logger[_0x2895('0x10')](_0x2895('0x11'),_0x526c32,_0x3e96d7);_0x159f86(_0x3e96d7);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 9121387..f971605 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 _0x53b9=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index','/:id','isAuthenticated','update','/download_log_file','exports','multer','util','path','connect-timeout'];(function(_0x186219,_0x3e7421){var _0x21ce72=function(_0x46c8d1){while(--_0x46c8d1){_0x186219['push'](_0x186219['shift']());}};_0x21ce72(++_0x3e7421);}(_0x53b9,0x1ac));var _0x953b=function(_0x123888,_0x5a42d8){_0x123888=_0x123888-0x0;var _0x471023=_0x53b9[_0x123888];return _0x471023;};'use strict';var multer=require(_0x953b('0x0'));var util=require(_0x953b('0x1'));var path=require(_0x953b('0x2'));var timeout=require(_0x953b('0x3'));var express=require(_0x953b('0x4'));var router=express[_0x953b('0x5')]();var fs_extra=require(_0x953b('0x6'));var auth=require(_0x953b('0x7'));var interaction=require(_0x953b('0x8'));var config=require(_0x953b('0x9'));var controller=require(_0x953b('0xa'));router[_0x953b('0xb')]('/',controller[_0x953b('0xc')]);router['put'](_0x953b('0xd'),auth[_0x953b('0xe')](),controller[_0x953b('0xf')]);router[_0x953b('0xb')](_0x953b('0x10'),auth[_0x953b('0xe')](),controller['downloadLogFile']);module[_0x953b('0x11')]=router; \ No newline at end of file +var _0x66a5=['update','isAuthenticated','downloadLogFile','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index','put','/:id'];(function(_0x54a3eb,_0xb59e45){var _0x206931=function(_0x29f3fb){while(--_0x29f3fb){_0x54a3eb['push'](_0x54a3eb['shift']());}};_0x206931(++_0xb59e45);}(_0x66a5,0x7b));var _0x566a=function(_0x83d08e,_0x228942){_0x83d08e=_0x83d08e-0x0;var _0x404d4f=_0x66a5[_0x83d08e];return _0x404d4f;};'use strict';var multer=require(_0x566a('0x0'));var util=require(_0x566a('0x1'));var path=require(_0x566a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x566a('0x3')]();var fs_extra=require(_0x566a('0x4'));var auth=require(_0x566a('0x5'));var interaction=require(_0x566a('0x6'));var config=require(_0x566a('0x7'));var controller=require(_0x566a('0x8'));router[_0x566a('0x9')]('/',controller[_0x566a('0xa')]);router[_0x566a('0xb')](_0x566a('0xc'),auth['isAuthenticated'](),controller[_0x566a('0xd')]);router[_0x566a('0x9')]('/download_log_file',auth[_0x566a('0xe')](),controller[_0x566a('0xf')]);module[_0x566a('0x10')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index a7ebbca..847fe88 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 _0x1b26=['INTEGER','sequelize','exports','TEXT','STRING'];(function(_0x4ce805,_0x4817a9){var _0x4e94e5=function(_0x4f22c5){while(--_0x4f22c5){_0x4ce805['push'](_0x4ce805['shift']());}};_0x4e94e5(++_0x4817a9);}(_0x1b26,0x1b4));var _0x61b2=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x1b26[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x61b2('0x0'));module[_0x61b2('0x1')]={'license':{'type':Sequelize[_0x61b2('0x2')]},'data1':{'type':Sequelize[_0x61b2('0x3')]},'data2':{'type':Sequelize[_0x61b2('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x61b2('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc1e4=['exports','TEXT','STRING','INTEGER'];(function(_0x421526,_0x368eca){var _0xc44c07=function(_0x31b0cc){while(--_0x31b0cc){_0x421526['push'](_0x421526['shift']());}};_0xc44c07(++_0x368eca);}(_0xc1e4,0x104));var _0x4c1e=function(_0x518b69,_0x12758d){_0x518b69=_0x518b69-0x0;var _0x47604e=_0xc1e4[_0x518b69];return _0x47604e;};'use strict';var Sequelize=require('sequelize');module[_0x4c1e('0x0')]={'license':{'type':Sequelize[_0x4c1e('0x1')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x4c1e('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x4c1e('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 cbce849..4290815 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 _0x527c=['attachment;\x20filename=','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','keys','License','rawAttributes','query','filters','model','attributes','intersection','fields','length','merge','options','getLicense','body','find','params','get','checkLicense','key','demo','join','/var','log','setHeader','Content-disposition'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x527c,0xd6));var _0xc527=function(_0x4f0057,_0x23c77a){_0x4f0057=_0x4f0057-0x0;var _0x45e03a=_0x527c[_0x4f0057];return _0x45e03a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc527('0x0'));var jsonpatch=require(_0xc527('0x1'));var rp=require(_0xc527('0x2'));var moment=require(_0xc527('0x3'));var BPromise=require(_0xc527('0x4'));var Mustache=require(_0xc527('0x5'));var util=require('util');var path=require(_0xc527('0x6'));var sox=require(_0xc527('0x7'));var csv=require(_0xc527('0x8'));var ejs=require(_0xc527('0x9'));var fs=require('fs');var fs_extra=require(_0xc527('0xa'));var _=require(_0xc527('0xb'));var squel=require(_0xc527('0xc'));var crypto=require(_0xc527('0xd'));var jsforce=require(_0xc527('0xe'));var deskjs=require(_0xc527('0xf'));var toCsv=require(_0xc527('0x8'));var querystring=require(_0xc527('0x10'));var Papa=require(_0xc527('0x11'));var Redis=require('ioredis');var authService=require(_0xc527('0x12'));var qs=require(_0xc527('0x13'));var as=require(_0xc527('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc527('0x15'))(_0xc527('0x16'));var utils=require('../../config/utils');var config=require(_0xc527('0x17'));var licenseUtil=require(_0xc527('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d4a10,_0x505752){_0x505752=_0x505752||0xcc;return function(_0xc29a2c){if(_0xc29a2c){return _0x4d4a10[_0xc527('0x19')](_0x505752);}return _0x4d4a10[_0xc527('0x1a')](_0x505752)[_0xc527('0x1b')]();};}function respondWithResult(_0x210a0f,_0xd8e1b6){_0xd8e1b6=_0xd8e1b6||0xc8;return function(_0x476e71){if(_0x476e71){return _0x210a0f[_0xc527('0x1a')](_0xd8e1b6)[_0xc527('0x1c')](_0x476e71);}};}function respondWithFilteredResult(_0x4ba554,_0xc65faa){return function(_0x5f4804){if(_0x5f4804){var _0xa852ec=typeof _0xc65faa[_0xc527('0x1d')]===_0xc527('0x1e')&&typeof _0xc65faa['limit']==='undefined';var _0x460b39=_0x5f4804[_0xc527('0x1f')];var _0x16c07a=_0xa852ec?0x0:_0xc65faa[_0xc527('0x1d')];var _0x50ac75=_0xa852ec?_0x5f4804[_0xc527('0x1f')]:_0xc65faa[_0xc527('0x1d')]+_0xc65faa[_0xc527('0x20')];var _0x36b941;if(_0x50ac75>=_0x460b39){_0x50ac75=_0x460b39;_0x36b941=0xc8;}else{_0x36b941=0xce;}_0x4ba554[_0xc527('0x1a')](_0x36b941);return _0x4ba554[_0xc527('0x21')](_0xc527('0x22'),_0x16c07a+'-'+_0x50ac75+'/'+_0x460b39)['json'](_0x5f4804);}return null;};}function patchUpdates(_0xd0a692){return function(_0x2543ef){try{jsonpatch[_0xc527('0x23')](_0x2543ef,_0xd0a692,!![]);}catch(_0x2d5890){return BPromise[_0xc527('0x24')](_0x2d5890);}return _0x2543ef['save']();};}function saveUpdates(_0x433ee9,_0x5c2148){return function(_0x16b513){if(_0x16b513){return _0x16b513[_0xc527('0x25')](_0x433ee9)[_0xc527('0x26')](function(_0x42a96f){return _0x42a96f;});}return null;};}function removeEntity(_0x3aaf1b,_0x24f891){return function(_0x535aed){if(_0x535aed){return _0x535aed[_0xc527('0x27')]()[_0xc527('0x26')](function(){_0x3aaf1b['status'](0xcc)[_0xc527('0x1b')]();});}};}function handleEntityNotFound(_0x13a5a9,_0x3323cc){return function(_0x268d11){if(!_0x268d11){_0x13a5a9['sendStatus'](0x194);}return _0x268d11;};}function handleError(_0x55e411,_0x145127){_0x145127=_0x145127||0x1f4;return function(_0x39b31e){logger[_0xc527('0x28')](_0x39b31e[_0xc527('0x29')]);if(_0x39b31e[_0xc527('0x2a')]){delete _0x39b31e[_0xc527('0x2a')];}_0x55e411[_0xc527('0x1a')](_0x145127)[_0xc527('0x2b')](_0x39b31e);};}var utilLicense=require(_0xc527('0x18'));exports[_0xc527('0x2c')]=function(_0x2c6859,_0x530fc6){var _0x467454={'raw':!![],'where':{'id':0x1}},_0x440c66={};_0x440c66['model']=_[_0xc527('0x2d')](db[_0xc527('0x2e')][_0xc527('0x2f')]);_0x440c66[_0xc527('0x30')]=_['keys'](_0x2c6859[_0xc527('0x30')]);_0x440c66[_0xc527('0x31')]=_['intersection'](_0x440c66[_0xc527('0x32')],_0x440c66[_0xc527('0x30')]);_0x467454[_0xc527('0x33')]=_[_0xc527('0x34')](_0x440c66[_0xc527('0x32')],qs[_0xc527('0x35')](_0x2c6859[_0xc527('0x30')][_0xc527('0x35')]));_0x467454[_0xc527('0x33')]=_0x467454[_0xc527('0x33')][_0xc527('0x36')]?_0x467454[_0xc527('0x33')]:_0x440c66[_0xc527('0x32')];_0x467454=_[_0xc527('0x37')]({},_0x467454,_0x2c6859[_0xc527('0x38')]);return utilLicense[_0xc527('0x39')](_0x467454)['then'](respondWithResult(_0x530fc6,null))['catch'](handleError(_0x530fc6,null));};exports['update']=function(_0x7ac55c,_0x519846){if(_0x7ac55c[_0xc527('0x3a')]['id']){delete _0x7ac55c[_0xc527('0x3a')]['id'];}return db[_0xc527('0x2e')][_0xc527('0x3b')]({'where':{'id':_0x7ac55c[_0xc527('0x3c')]['id']}})[_0xc527('0x26')](handleEntityNotFound(_0x519846,null))[_0xc527('0x26')](function(_0x21f62a){var _0x172a9e=_0x21f62a[_0xc527('0x3d')]({'plain':!![]});return utilLicense[_0xc527('0x3e')](_0x172a9e,_0x7ac55c[_0xc527('0x3a')][_0xc527('0x3f')]);})[_0xc527('0x26')](function(_0x5e5355){if(!_0x5e5355[_0xc527('0x40')]){return saveUpdates(_0x7ac55c[_0xc527('0x3a')],null);}return _0x5e5355;})['then'](respondWithResult(_0x519846,null))['catch'](handleError(_0x519846,null));};exports['downloadLogFile']=function(_0x26e1c4,_0x1081d8){var _0x6f8de2='license-info.log';var _0x56052d=path[_0xc527('0x41')](_0xc527('0x42'),_0xc527('0x43'),'xcally',_0x6f8de2);_0x1081d8[_0xc527('0x44')](_0xc527('0x45'),_0xc527('0x46')+_0x6f8de2);_0x1081d8[_0xc527('0x21')]('Content-Type','text/plain');_0x1081d8['download'](_0x56052d);}; \ No newline at end of file +var _0x11be=['set','Content-Range','reject','save','update','then','destroy','stack','name','send','model','keys','License','rawAttributes','query','filters','attributes','intersection','fields','merge','options','getLicense','catch','body','find','params','get','key','demo','license-info.log','join','log','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','eml-format','request-promise','moment','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/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count'];(function(_0x11eadc,_0x155efe){var _0x253972=function(_0x395109){while(--_0x395109){_0x11eadc['push'](_0x11eadc['shift']());}};_0x253972(++_0x155efe);}(_0x11be,0x67));var _0xe11b=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0x11be[_0x38ced4];return _0x547c07;};'use strict';var emlformat=require(_0xe11b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe11b('0x1'));var moment=require(_0xe11b('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xe11b('0x3'));var util=require(_0xe11b('0x4'));var path=require(_0xe11b('0x5'));var sox=require(_0xe11b('0x6'));var csv=require(_0xe11b('0x7'));var ejs=require(_0xe11b('0x8'));var fs=require('fs');var fs_extra=require(_0xe11b('0x9'));var _=require(_0xe11b('0xa'));var squel=require('squel');var crypto=require(_0xe11b('0xb'));var jsforce=require(_0xe11b('0xc'));var deskjs=require(_0xe11b('0xd'));var toCsv=require(_0xe11b('0x7'));var querystring=require(_0xe11b('0xe'));var Papa=require(_0xe11b('0xf'));var Redis=require(_0xe11b('0x10'));var authService=require(_0xe11b('0x11'));var qs=require(_0xe11b('0x12'));var as=require(_0xe11b('0x13'));var hardwareService=require(_0xe11b('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xe11b('0x15'));var config=require(_0xe11b('0x16'));var licenseUtil=require(_0xe11b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd647f7,_0x118809){_0x118809=_0x118809||0xcc;return function(_0x1120d3){if(_0x1120d3){return _0xd647f7[_0xe11b('0x18')](_0x118809);}return _0xd647f7[_0xe11b('0x19')](_0x118809)['end']();};}function respondWithResult(_0x2aa21e,_0x98313c){_0x98313c=_0x98313c||0xc8;return function(_0x5b6fbe){if(_0x5b6fbe){return _0x2aa21e[_0xe11b('0x19')](_0x98313c)[_0xe11b('0x1a')](_0x5b6fbe);}};}function respondWithFilteredResult(_0x251d5f,_0x4b2de4){return function(_0x574251){if(_0x574251){var _0x50cf9a=typeof _0x4b2de4[_0xe11b('0x1b')]===_0xe11b('0x1c')&&typeof _0x4b2de4[_0xe11b('0x1d')]===_0xe11b('0x1c');var _0x1b4292=_0x574251[_0xe11b('0x1e')];var _0x3bdefb=_0x50cf9a?0x0:_0x4b2de4[_0xe11b('0x1b')];var _0xd2986=_0x50cf9a?_0x574251['count']:_0x4b2de4[_0xe11b('0x1b')]+_0x4b2de4['limit'];var _0x298a06;if(_0xd2986>=_0x1b4292){_0xd2986=_0x1b4292;_0x298a06=0xc8;}else{_0x298a06=0xce;}_0x251d5f['status'](_0x298a06);return _0x251d5f[_0xe11b('0x1f')](_0xe11b('0x20'),_0x3bdefb+'-'+_0xd2986+'/'+_0x1b4292)[_0xe11b('0x1a')](_0x574251);}return null;};}function patchUpdates(_0x18ce2a){return function(_0x201b90){try{jsonpatch['apply'](_0x201b90,_0x18ce2a,!![]);}catch(_0xdee4f0){return BPromise[_0xe11b('0x21')](_0xdee4f0);}return _0x201b90[_0xe11b('0x22')]();};}function saveUpdates(_0x38c680,_0x1816e2){return function(_0x1b18c5){if(_0x1b18c5){return _0x1b18c5[_0xe11b('0x23')](_0x38c680)[_0xe11b('0x24')](function(_0x1475e6){return _0x1475e6;});}return null;};}function removeEntity(_0xce5e52,_0x1b3567){return function(_0x1975f9){if(_0x1975f9){return _0x1975f9[_0xe11b('0x25')]()[_0xe11b('0x24')](function(){_0xce5e52[_0xe11b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27b94d,_0x10d872){return function(_0x447c58){if(!_0x447c58){_0x27b94d[_0xe11b('0x18')](0x194);}return _0x447c58;};}function handleError(_0x5e7336,_0x6a3ffd){_0x6a3ffd=_0x6a3ffd||0x1f4;return function(_0x302d6e){logger['error'](_0x302d6e[_0xe11b('0x26')]);if(_0x302d6e[_0xe11b('0x27')]){delete _0x302d6e[_0xe11b('0x27')];}_0x5e7336['status'](_0x6a3ffd)[_0xe11b('0x28')](_0x302d6e);};}var utilLicense=require('../../config/license/util');exports['index']=function(_0x3ead2d,_0x4aefdc){var _0x1be8e9={'raw':!![],'where':{'id':0x1}},_0x4c8b1f={};_0x4c8b1f[_0xe11b('0x29')]=_[_0xe11b('0x2a')](db[_0xe11b('0x2b')][_0xe11b('0x2c')]);_0x4c8b1f[_0xe11b('0x2d')]=_['keys'](_0x3ead2d[_0xe11b('0x2d')]);_0x4c8b1f[_0xe11b('0x2e')]=_['intersection'](_0x4c8b1f[_0xe11b('0x29')],_0x4c8b1f[_0xe11b('0x2d')]);_0x1be8e9[_0xe11b('0x2f')]=_[_0xe11b('0x30')](_0x4c8b1f[_0xe11b('0x29')],qs[_0xe11b('0x31')](_0x3ead2d[_0xe11b('0x2d')][_0xe11b('0x31')]));_0x1be8e9[_0xe11b('0x2f')]=_0x1be8e9[_0xe11b('0x2f')]['length']?_0x1be8e9[_0xe11b('0x2f')]:_0x4c8b1f[_0xe11b('0x29')];_0x1be8e9=_[_0xe11b('0x32')]({},_0x1be8e9,_0x3ead2d[_0xe11b('0x33')]);return utilLicense[_0xe11b('0x34')](_0x1be8e9)[_0xe11b('0x24')](respondWithResult(_0x4aefdc,null))[_0xe11b('0x35')](handleError(_0x4aefdc,null));};exports[_0xe11b('0x23')]=function(_0x57eb05,_0x57cf48){if(_0x57eb05[_0xe11b('0x36')]['id']){delete _0x57eb05[_0xe11b('0x36')]['id'];}return db[_0xe11b('0x2b')][_0xe11b('0x37')]({'where':{'id':_0x57eb05[_0xe11b('0x38')]['id']}})[_0xe11b('0x24')](handleEntityNotFound(_0x57cf48,null))[_0xe11b('0x24')](function(_0x485ae1){var _0x56d985=_0x485ae1[_0xe11b('0x39')]({'plain':!![]});return utilLicense['checkLicense'](_0x56d985,_0x57eb05[_0xe11b('0x36')][_0xe11b('0x3a')]);})['then'](function(_0x4ba582){if(!_0x4ba582[_0xe11b('0x3b')]){return saveUpdates(_0x57eb05[_0xe11b('0x36')],null);}return _0x4ba582;})['then'](respondWithResult(_0x57cf48,null))['catch'](handleError(_0x57cf48,null));};exports['downloadLogFile']=function(_0x409658,_0x119119){var _0xc12ec3=_0xe11b('0x3c');var _0x378601=path[_0xe11b('0x3d')]('/var',_0xe11b('0x3e'),'xcally',_0xc12ec3);_0x119119[_0xe11b('0x3f')](_0xe11b('0x40'),_0xe11b('0x41')+_0xc12ec3);_0x119119['set'](_0xe11b('0x42'),'text/plain');_0x119119['download'](_0x378601);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 46d6c61..023add2 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 _0x3549=['license','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./license.attributes','exports','define','License'];(function(_0x192acd,_0x43f6e4){var _0x5acfff=function(_0x1f5e1a){while(--_0x1f5e1a){_0x192acd['push'](_0x192acd['shift']());}};_0x5acfff(++_0x43f6e4);}(_0x3549,0x135));var _0x9354=function(_0x49cf85,_0xfdf2d7){_0x49cf85=_0x49cf85-0x0;var _0x24f687=_0x3549[_0x49cf85];return _0x24f687;};'use strict';var _=require(_0x9354('0x0'));var util=require(_0x9354('0x1'));var logger=require(_0x9354('0x2'))(_0x9354('0x3'));var moment=require(_0x9354('0x4'));var BPromise=require(_0x9354('0x5'));var rp=require(_0x9354('0x6'));var fs=require('fs');var path=require(_0x9354('0x7'));var rimraf=require(_0x9354('0x8'));var config=require('../../config/environment');var attributes=require(_0x9354('0x9'));module[_0x9354('0xa')]=function(_0x5574e6,_0x23b9cd){return _0x5574e6[_0x9354('0xb')](_0x9354('0xc'),attributes,{'tableName':_0x9354('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9156=['License','lodash','util','moment','request-promise','path','rimraf','../../config/environment','./license.attributes','define'];(function(_0x3e8d78,_0xef4524){var _0x50532d=function(_0x358963){while(--_0x358963){_0x3e8d78['push'](_0x3e8d78['shift']());}};_0x50532d(++_0xef4524);}(_0x9156,0x155));var _0x6915=function(_0x537b82,_0x1ec5d7){_0x537b82=_0x537b82-0x0;var _0x5863ad=_0x9156[_0x537b82];return _0x5863ad;};'use strict';var _=require(_0x6915('0x0'));var util=require(_0x6915('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6915('0x2'));var BPromise=require('bluebird');var rp=require(_0x6915('0x3'));var fs=require('fs');var path=require(_0x6915('0x4'));var rimraf=require(_0x6915('0x5'));var config=require(_0x6915('0x6'));var attributes=require(_0x6915('0x7'));module['exports']=function(_0x5eec15,_0x44951f){return _0x5eec15[_0x6915('0x8')](_0x6915('0x9'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index e2832a3..ce78ae7 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 _0xf55d=['client','request','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x655079,_0x326f5b){var _0x2f8d8a=function(_0x1d4a36){while(--_0x1d4a36){_0x655079['push'](_0x655079['shift']());}};_0x2f8d8a(++_0x326f5b);}(_0xf55d,0x8a));var _0xdf55=function(_0x2ecf30,_0xba962d){_0x2ecf30=_0x2ecf30-0x0;var _0x4490f2=_0xf55d[_0x2ecf30];return _0x4490f2;};'use strict';var _=require(_0xdf55('0x0'));var util=require('util');var moment=require(_0xdf55('0x1'));var BPromise=require(_0xdf55('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdf55('0x3'));var db=require(_0xdf55('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xdf55('0x5'))(_0xdf55('0x6'));var config=require(_0xdf55('0x7'));var jayson=require(_0xdf55('0x8'));var client=jayson[_0xdf55('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30eb20,_0xaa636c,_0xe729c6){return new BPromise(function(_0x1f0e00,_0x23797c){return client[_0xdf55('0xa')](_0x30eb20,_0xe729c6)['then'](function(_0x5136db){logger['info'](_0xdf55('0xb'),_0xaa636c,_0xdf55('0xc'));logger[_0xdf55('0xd')](_0xdf55('0xe'),_0xaa636c,_0xdf55('0xc'),JSON[_0xdf55('0xf')](_0x5136db));if(_0x5136db[_0xdf55('0x10')]){if(_0x5136db[_0xdf55('0x10')]['code']===0x1f4){logger['error'](_0xdf55('0xb'),_0xaa636c,_0x5136db['error'][_0xdf55('0x11')]);return _0x23797c(_0x5136db[_0xdf55('0x10')]['message']);}logger[_0xdf55('0x10')](_0xdf55('0xb'),_0xaa636c,_0x5136db['error'][_0xdf55('0x11')]);return _0x1f0e00(_0x5136db[_0xdf55('0x10')][_0xdf55('0x11')]);}else{logger[_0xdf55('0x12')]('License,\x20%s,\x20%s',_0xaa636c,_0xdf55('0xc'));_0x1f0e00(_0x5136db[_0xdf55('0x13')][_0xdf55('0x11')]);}})[_0xdf55('0x14')](function(_0x8d10e8){logger[_0xdf55('0x10')](_0xdf55('0xb'),_0xaa636c,_0x8d10e8);_0x23797c(_0x8d10e8);});});} \ No newline at end of file +var _0x32e2=['bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','License,\x20%s,\x20%s','message','info','result','catch','lodash','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x32e2,0xf0));var _0x232e=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0x32e2[_0x88cd7b];return _0x56fcc8;};'use strict';var _=require(_0x232e('0x0'));var util=require('util');var moment=require(_0x232e('0x1'));var BPromise=require(_0x232e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x232e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x232e('0x4'));var logger=require(_0x232e('0x5'))(_0x232e('0x6'));var config=require(_0x232e('0x7'));var jayson=require(_0x232e('0x8'));var client=jayson[_0x232e('0x9')][_0x232e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9ae8d5,_0x32d3bc,_0x3ff6b4){return new BPromise(function(_0x121c56,_0x536992){return client['request'](_0x9ae8d5,_0x3ff6b4)[_0x232e('0xb')](function(_0x2ecaf8){logger['info']('License,\x20%s,\x20%s',_0x32d3bc,_0x232e('0xc'));logger[_0x232e('0xd')](_0x232e('0xe'),_0x32d3bc,'request\x20sent',JSON[_0x232e('0xf')](_0x2ecaf8));if(_0x2ecaf8[_0x232e('0x10')]){if(_0x2ecaf8[_0x232e('0x10')]['code']===0x1f4){logger['error'](_0x232e('0x11'),_0x32d3bc,_0x2ecaf8[_0x232e('0x10')][_0x232e('0x12')]);return _0x536992(_0x2ecaf8['error'][_0x232e('0x12')]);}logger['error'](_0x232e('0x11'),_0x32d3bc,_0x2ecaf8[_0x232e('0x10')]['message']);return _0x121c56(_0x2ecaf8['error']['message']);}else{logger[_0x232e('0x13')](_0x232e('0x11'),_0x32d3bc,_0x232e('0xc'));_0x121c56(_0x2ecaf8[_0x232e('0x14')][_0x232e('0x12')]);}})[_0x232e('0x15')](function(_0x22c335){logger[_0x232e('0x10')](_0x232e('0x11'),_0x32d3bc,_0x22c335);_0x536992(_0x22c335);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 0421698..7440440 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 _0x50d3=['path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/dispositions','/:id/canned_answers','/:id/in_servers','/:id/applications','getApplications','/:id/messages','/:id/verify','verifySmtp','getAgents','post','addDisposition','addAnswer','create','addImap','addSmtp','/:id/interactions','addInteraction','addApplications','/:id/send','/:id/users','addAgents','put','update','delete','removeDispositions','/:id/out_servers','removeSmtp','destroy','exports'];(function(_0x443b11,_0x4793ad){var _0x582f4e=function(_0x30f220){while(--_0x30f220){_0x443b11['push'](_0x443b11['shift']());}};_0x582f4e(++_0x4793ad);}(_0x50d3,0xf0));var _0x350d=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x50d3[_0x3ab9ee];return _0x82ee88;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x350d('0x0'));var timeout=require('connect-timeout');var express=require(_0x350d('0x1'));var router=express[_0x350d('0x2')]();var fs_extra=require(_0x350d('0x3'));var auth=require(_0x350d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x350d('0x5'));var controller=require('./mailAccount.controller');router[_0x350d('0x6')]('/',auth[_0x350d('0x7')](),controller[_0x350d('0x8')]);router[_0x350d('0x6')]('/describe',auth[_0x350d('0x7')](),controller['describe']);router[_0x350d('0x6')](_0x350d('0x9'),auth[_0x350d('0x7')](),controller[_0x350d('0xa')]);router['get'](_0x350d('0xb'),auth[_0x350d('0x7')](),controller['getDispositions']);router[_0x350d('0x6')](_0x350d('0xc'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x350d('0x6')](_0x350d('0xd'),auth[_0x350d('0x7')](),controller['getImap']);router['get']('/:id/out_servers',auth[_0x350d('0x7')](),controller['getSmtp']);router[_0x350d('0x6')]('/:id/interactions',auth[_0x350d('0x7')](),controller['getInteractions']);router[_0x350d('0x6')](_0x350d('0xe'),auth[_0x350d('0x7')](),controller[_0x350d('0xf')]);router[_0x350d('0x6')](_0x350d('0x10'),auth[_0x350d('0x7')](),controller['getMessages']);router[_0x350d('0x6')](_0x350d('0x11'),auth[_0x350d('0x7')](),controller[_0x350d('0x12')]);router[_0x350d('0x6')]('/:id/users',auth[_0x350d('0x7')](),controller[_0x350d('0x13')]);router[_0x350d('0x14')]('/:id/dispositions',auth[_0x350d('0x7')](),controller[_0x350d('0x15')]);router[_0x350d('0x14')]('/:id/canned_answers',auth[_0x350d('0x7')](),controller[_0x350d('0x16')]);router[_0x350d('0x14')]('/',auth[_0x350d('0x7')](),controller[_0x350d('0x17')]);router[_0x350d('0x14')](_0x350d('0xd'),auth[_0x350d('0x7')](),controller[_0x350d('0x18')]);router[_0x350d('0x14')]('/:id/out_servers',auth[_0x350d('0x7')](),controller[_0x350d('0x19')]);router['post'](_0x350d('0x1a'),auth[_0x350d('0x7')](),controller[_0x350d('0x1b')]);router[_0x350d('0x14')](_0x350d('0xe'),auth[_0x350d('0x7')](),controller[_0x350d('0x1c')]);router['post'](_0x350d('0x1d'),auth[_0x350d('0x7')](),controller['send']);router['post'](_0x350d('0x1e'),auth[_0x350d('0x7')](),controller[_0x350d('0x1f')]);router[_0x350d('0x20')](_0x350d('0x9'),auth[_0x350d('0x7')](),controller[_0x350d('0x21')]);router[_0x350d('0x22')](_0x350d('0xb'),auth['isAuthenticated'](),controller[_0x350d('0x23')]);router['delete'](_0x350d('0xc'),auth['isAuthenticated'](),controller['removeAnswers']);router['delete'](_0x350d('0xd'),auth[_0x350d('0x7')](),controller['removeImap']);router[_0x350d('0x22')](_0x350d('0x24'),auth['isAuthenticated'](),controller[_0x350d('0x25')]);router[_0x350d('0x22')](_0x350d('0x9'),auth[_0x350d('0x7')](),controller[_0x350d('0x26')]);router[_0x350d('0x22')](_0x350d('0x1e'),auth[_0x350d('0x7')](),controller['removeAgents']);module[_0x350d('0x27')]=router; \ No newline at end of file +var _0x7a43=['removeDispositions','removeAnswers','removeSmtp','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','/describe','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','/:id/users','getAgents','post','addDisposition','addAnswer','create','addImap','addSmtp','/:id/interactions','addInteraction','addApplications','/:id/send','send','addAgents','put','update','delete'];(function(_0x1d04b5,_0x30792c){var _0x161342=function(_0x94ff92){while(--_0x94ff92){_0x1d04b5['push'](_0x1d04b5['shift']());}};_0x161342(++_0x30792c);}(_0x7a43,0x137));var _0x37a4=function(_0x2f12eb,_0x1be312){_0x2f12eb=_0x2f12eb-0x0;var _0x334308=_0x7a43[_0x2f12eb];return _0x334308;};'use strict';var multer=require(_0x37a4('0x0'));var util=require(_0x37a4('0x1'));var path=require(_0x37a4('0x2'));var timeout=require(_0x37a4('0x3'));var express=require(_0x37a4('0x4'));var router=express[_0x37a4('0x5')]();var fs_extra=require(_0x37a4('0x6'));var auth=require(_0x37a4('0x7'));var interaction=require(_0x37a4('0x8'));var config=require(_0x37a4('0x9'));var controller=require(_0x37a4('0xa'));router[_0x37a4('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0x37a4('0xb')](_0x37a4('0xc'),auth[_0x37a4('0xd')](),controller['describe']);router[_0x37a4('0xb')](_0x37a4('0xe'),auth[_0x37a4('0xd')](),controller[_0x37a4('0xf')]);router[_0x37a4('0xb')](_0x37a4('0x10'),auth[_0x37a4('0xd')](),controller[_0x37a4('0x11')]);router[_0x37a4('0xb')](_0x37a4('0x12'),auth['isAuthenticated'](),controller[_0x37a4('0x13')]);router[_0x37a4('0xb')](_0x37a4('0x14'),auth[_0x37a4('0xd')](),controller[_0x37a4('0x15')]);router[_0x37a4('0xb')](_0x37a4('0x16'),auth[_0x37a4('0xd')](),controller[_0x37a4('0x17')]);router[_0x37a4('0xb')]('/:id/interactions',auth[_0x37a4('0xd')](),controller['getInteractions']);router['get'](_0x37a4('0x18'),auth[_0x37a4('0xd')](),controller[_0x37a4('0x19')]);router[_0x37a4('0xb')](_0x37a4('0x1a'),auth[_0x37a4('0xd')](),controller[_0x37a4('0x1b')]);router[_0x37a4('0xb')](_0x37a4('0x1c'),auth[_0x37a4('0xd')](),controller['verifySmtp']);router[_0x37a4('0xb')](_0x37a4('0x1d'),auth[_0x37a4('0xd')](),controller[_0x37a4('0x1e')]);router[_0x37a4('0x1f')](_0x37a4('0x10'),auth[_0x37a4('0xd')](),controller[_0x37a4('0x20')]);router[_0x37a4('0x1f')](_0x37a4('0x12'),auth[_0x37a4('0xd')](),controller[_0x37a4('0x21')]);router[_0x37a4('0x1f')]('/',auth[_0x37a4('0xd')](),controller[_0x37a4('0x22')]);router[_0x37a4('0x1f')](_0x37a4('0x14'),auth['isAuthenticated'](),controller[_0x37a4('0x23')]);router[_0x37a4('0x1f')](_0x37a4('0x16'),auth[_0x37a4('0xd')](),controller[_0x37a4('0x24')]);router[_0x37a4('0x1f')](_0x37a4('0x25'),auth[_0x37a4('0xd')](),controller[_0x37a4('0x26')]);router[_0x37a4('0x1f')]('/:id/applications',auth[_0x37a4('0xd')](),controller[_0x37a4('0x27')]);router['post'](_0x37a4('0x28'),auth[_0x37a4('0xd')](),controller[_0x37a4('0x29')]);router[_0x37a4('0x1f')](_0x37a4('0x1d'),auth[_0x37a4('0xd')](),controller[_0x37a4('0x2a')]);router[_0x37a4('0x2b')]('/:id',auth[_0x37a4('0xd')](),controller[_0x37a4('0x2c')]);router[_0x37a4('0x2d')](_0x37a4('0x10'),auth[_0x37a4('0xd')](),controller[_0x37a4('0x2e')]);router[_0x37a4('0x2d')]('/:id/canned_answers',auth[_0x37a4('0xd')](),controller[_0x37a4('0x2f')]);router[_0x37a4('0x2d')](_0x37a4('0x14'),auth[_0x37a4('0xd')](),controller['removeImap']);router[_0x37a4('0x2d')]('/:id/out_servers',auth[_0x37a4('0xd')](),controller[_0x37a4('0x30')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x37a4('0x31')]);router[_0x37a4('0x2d')](_0x37a4('0x1d'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x37a4('0x32')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 0943c41..6606ff3 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 _0x8485=['setDataValue','hotmail','getDataValue','custom','provider','sequelize','exports','STRING','BOOLEAN','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId'];(function(_0xf2628e,_0x521bf7){var _0x13863a=function(_0x2b04ab){while(--_0x2b04ab){_0xf2628e['push'](_0xf2628e['shift']());}};_0x13863a(++_0x521bf7);}(_0x8485,0x6b));var _0x5848=function(_0x2a2d69,_0x284b12){_0x2a2d69=_0x2a2d69-0x0;var _0x219e8f=_0x8485[_0x2a2d69];return _0x219e8f;};'use strict';var Sequelize=require(_0x5848('0x0'));module[_0x5848('0x1')]={'description':{'type':Sequelize[_0x5848('0x2')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x5848('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x5848('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x5848('0x2')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x5848('0x2')],'allowNull':![],'defaultValue':_0x5848('0x4')},'fontSize':{'type':Sequelize[_0x5848('0x5')](0x2)[_0x5848('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x5848('0x7')],'defaultValue':function(){return _0x5848('0x8');}},'notificationSound':{'type':Sequelize[_0x5848('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5848('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5848('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x5848('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5848('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5848('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5848('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5848('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x5848('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x5848('0x3')],'defaultValue':![],'comment':_0x5848('0xa'),'set':function(_0x1464bf){if(!_0x1464bf)this['setDataValue'](_0x5848('0xb'),null);this[_0x5848('0xc')]('mandatoryDisposition',_0x1464bf);}},'provider':{'type':Sequelize['ENUM']('gmail',_0x5848('0xd'),'yahoo','outlook365'),'defaultValue':null,'get':function(){var _0x2d7771=this[_0x5848('0xe')]('provider');return _0x2d7771||'custom';},'set':function(_0x3cc3ca){if(_0x3cc3ca===_0x5848('0xf')){_0x3cc3ca=null;}return this[_0x5848('0xc')](_0x5848('0x10'),_0x3cc3ca);}}}; \ No newline at end of file +var _0xf68a=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','hotmail','outlook365','getDataValue','provider','sequelize','STRING','BOOLEAN','TEXT','INTEGER','UNSIGNED'];(function(_0xe38dbe,_0x2648a7){var _0x536f04=function(_0x2867be){while(--_0x2867be){_0xe38dbe['push'](_0xe38dbe['shift']());}};_0x536f04(++_0x2648a7);}(_0xf68a,0x104));var _0xaf68=function(_0x463ddb,_0xae9b68){_0x463ddb=_0x463ddb-0x0;var _0x3b07ce=_0xf68a[_0x463ddb];return _0x3b07ce;};'use strict';var Sequelize=require(_0xaf68('0x0'));module['exports']={'description':{'type':Sequelize[_0xaf68('0x1')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0xaf68('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xaf68('0x2')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0xaf68('0x3')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0xaf68('0x4')](0x2)[_0xaf68('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xaf68('0x3')],'defaultValue':function(){return _0xaf68('0x6');}},'notificationSound':{'type':Sequelize[_0xaf68('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xaf68('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xaf68('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xaf68('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xaf68('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xaf68('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xaf68('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xaf68('0x4')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xaf68('0x2')],'defaultValue':![],'comment':_0xaf68('0x7'),'set':function(_0x332fcd){if(!_0x332fcd)this[_0xaf68('0x8')]('mandatoryDispositionPauseId',null);this[_0xaf68('0x8')](_0xaf68('0x9'),_0x332fcd);}},'provider':{'type':Sequelize['ENUM']('gmail',_0xaf68('0xa'),'yahoo',_0xaf68('0xb')),'defaultValue':null,'get':function(){var _0x32229a=this[_0xaf68('0xc')]('provider');return _0x32229a||'custom';},'set':function(_0x27b854){if(_0x27b854==='custom'){_0x27b854=null;}return this[_0xaf68('0x8')](_0xaf68('0xd'),_0x27b854);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index acc2820..ba76fcc 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 _0x8b0e=['model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','options','include','findAll','rows','show','params','MailServerIn','mandatoryDispositionPause','rawAttributes','includeAll','find','body','provider','custom','describe','addDisposition','MailAccountId','create','getDispositions','findOne','Disposition','pick','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','email','ListId','isNil','active','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MailAccounts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','Contact','internal','Tag','tag','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','MailApplication','bulkCreate','getApplications','MailMessage','$gte','split','format','true','Contacts','DESC','CloudProvider','from','attachments','join','root','server/files/attachments','basename','getSmtpOptions','SendMail','List\x20not\x20found','List','CmContact','subject','attach','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','Messages','verifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','User','moment','bluebird','util','path','lodash','juice','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','http','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','update','destroy','get','UserProfileResource','end','stack','send','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','gmail','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','smtp.office365.com','user','username','pass','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','password','Imap','Smtp','index','MailServerOut','Pause','map','MailAccount','fieldName','key','name','query','keys','filters','intersection'];(function(_0x2328b2,_0xc40194){var _0x2c0ba7=function(_0x177544){while(--_0x177544){_0x2328b2['push'](_0x2328b2['shift']());}};_0x2c0ba7(++_0xc40194);}(_0x8b0e,0x6d));var _0xe8b0=function(_0x5ba549,_0x425afd){_0x5ba549=_0x5ba549-0x0;var _0x36e3a1=_0x8b0e[_0x5ba549];return _0x36e3a1;};'use strict';var moment=require(_0xe8b0('0x0'));var BPromise=require(_0xe8b0('0x1'));var util=require(_0xe8b0('0x2'));var path=require(_0xe8b0('0x3'));var _=require(_0xe8b0('0x4'));var juice=require(_0xe8b0('0x5'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xe8b0('0x6'))(_0xe8b0('0x7'));var config=require(_0xe8b0('0x8'));var db=require(_0xe8b0('0x9'))['db'];config[_0xe8b0('0xa')]=_[_0xe8b0('0xb')](config[_0xe8b0('0xa')],{'host':_0xe8b0('0xc'),'port':0x18eb});var socket=require(_0xe8b0('0xd'))(new Redis(config[_0xe8b0('0xa')]));require(_0xe8b0('0xe'))[_0xe8b0('0xf')](socket);var jayson=require(_0xe8b0('0x10'));var client=jayson['client'][_0xe8b0('0x11')]({'port':0x232b});function respondWithRpcPromise(_0xd0038f,_0x13841b,_0x3e9e51,_0x51598c){return new BPromise(function(_0x3d8b48,_0x173eec){var _0xc393ba=_0x51598c||client;return _0xc393ba['request'](_0xd0038f,_0x3e9e51)[_0xe8b0('0x12')](function(_0x3a0994){logger[_0xe8b0('0x13')]('MailAccount,\x20%s,\x20%s',_0x13841b,_0xe8b0('0x14'));logger[_0xe8b0('0x15')](_0xe8b0('0x16'),_0x13841b,'request\x20sent',JSON[_0xe8b0('0x17')](_0x3a0994));if(_0x3a0994[_0xe8b0('0x18')]){if(_0x3a0994[_0xe8b0('0x18')][_0xe8b0('0x19')]===0x1f4){logger[_0xe8b0('0x18')](_0xe8b0('0x1a'),_0x13841b,_0x3a0994[_0xe8b0('0x18')][_0xe8b0('0x1b')]);return _0x173eec(_0x3a0994[_0xe8b0('0x18')][_0xe8b0('0x1b')]);}logger[_0xe8b0('0x18')]('MailAccount,\x20%s,\x20%s',_0x13841b,_0x3a0994[_0xe8b0('0x18')][_0xe8b0('0x1b')]);return _0x3d8b48(_0x3a0994['error'][_0xe8b0('0x1b')]);}else{logger[_0xe8b0('0x13')](_0xe8b0('0x1a'),_0x13841b,_0xe8b0('0x14'));_0x3d8b48(_0x3a0994[_0xe8b0('0x1c')]['message']);}})[_0xe8b0('0x1d')](function(_0x3c74de){logger[_0xe8b0('0x18')](_0xe8b0('0x1a'),_0x13841b,_0x3c74de);_0x173eec(_0x3c74de);});});}function respondWithStatusCode(_0x36085a,_0x1beeda){_0x1beeda=_0x1beeda||0xcc;return function(_0x10848c){if(_0x10848c){return _0x36085a[_0xe8b0('0x1e')](_0x1beeda);}return _0x36085a[_0xe8b0('0x1f')](_0x1beeda)['end']();};}function respondWithResult(_0x2d72da,_0x131c28){_0x131c28=_0x131c28||0xc8;return function(_0x3bd98e){if(_0x3bd98e){return _0x2d72da[_0xe8b0('0x1f')](_0x131c28)[_0xe8b0('0x20')](_0x3bd98e);}};}function respondWithFilteredResult(_0x4cce7f,_0xf88411){return function(_0x54ccdb){if(_0x54ccdb){var _0x336c7f=typeof _0xf88411['offset']===_0xe8b0('0x21')&&typeof _0xf88411[_0xe8b0('0x22')]==='undefined';var _0x936b=_0x54ccdb[_0xe8b0('0x23')];var _0x34a6fe=_0x336c7f?0x0:_0xf88411[_0xe8b0('0x24')];var _0x11c005=_0x336c7f?_0x54ccdb[_0xe8b0('0x23')]:_0xf88411[_0xe8b0('0x24')]+_0xf88411['limit'];var _0x1ba8b8;if(_0x11c005>=_0x936b){_0x11c005=_0x936b;_0x1ba8b8=0xc8;}else{_0x1ba8b8=0xce;}_0x4cce7f[_0xe8b0('0x1f')](_0x1ba8b8);return _0x4cce7f[_0xe8b0('0x25')](_0xe8b0('0x26'),_0x34a6fe+'-'+_0x11c005+'/'+_0x936b)['json'](_0x54ccdb);}return null;};}function saveUpdates(_0x299d4f){return function(_0x2e60ef){if(_0x2e60ef){return _0x2e60ef[_0xe8b0('0x27')](_0x299d4f)[_0xe8b0('0x12')](function(_0x11592a){return _0x11592a;});}return null;};}function removeEntity(_0x17a483){return function(_0x5ea1bc){if(_0x5ea1bc){return _0x5ea1bc[_0xe8b0('0x28')]()['then'](function(){var _0x3c0a90=_0x5ea1bc[_0xe8b0('0x29')]({'plain':!![]});var _0x5a96a5='MailAccounts';return db[_0xe8b0('0x2a')][_0xe8b0('0x28')]({'where':{'type':_0x5a96a5,'resourceId':_0x3c0a90['id']}})[_0xe8b0('0x12')](function(){return _0x5ea1bc;});})[_0xe8b0('0x12')](function(){_0x17a483[_0xe8b0('0x1f')](0xcc)[_0xe8b0('0x2b')]();});}};}function handleEntityNotFound(_0x2e4ead){return function(_0x475a02){if(!_0x475a02){_0x2e4ead['sendStatus'](0x194);}return _0x475a02;};}function handleError(_0x1afb14,_0x3aa173){_0x3aa173=_0x3aa173||0x1f4;return function(_0x53d8d5){logger[_0xe8b0('0x18')](_0x53d8d5[_0xe8b0('0x2c')]);if(_0x53d8d5['name']){delete _0x53d8d5['name'];}_0x1afb14[_0xe8b0('0x1f')](_0x3aa173)[_0xe8b0('0x2d')](_0x53d8d5);};}function getImapHost(_0x137262){switch(_0x137262){case'gmail':return _0xe8b0('0x2e');case _0xe8b0('0x2f'):return _0xe8b0('0x30');case _0xe8b0('0x31'):return _0xe8b0('0x32');case _0xe8b0('0x33'):return _0xe8b0('0x34');}throw new Error(_0xe8b0('0x35'),_0x137262);}function getSmtpHost(_0x2de57d){switch(_0x2de57d){case _0xe8b0('0x36'):return _0xe8b0('0x37');case'yahoo':return _0xe8b0('0x38');case _0xe8b0('0x31'):return _0xe8b0('0x39');case _0xe8b0('0x33'):return _0xe8b0('0x3a');}throw new Error(_0xe8b0('0x35'),_0x2de57d);}function getAuthenticationOptions(_0x299f51,_0x41ff0d){var _0x1fedba={};var _0x7030e5={};if(_0x299f51){_0x1fedba[_0xe8b0('0x3b')]=_0x7030e5[_0xe8b0('0x3b')]=_0x41ff0d[_0xe8b0('0x3c')];_0x1fedba['password']=_0x7030e5[_0xe8b0('0x3d')]=_0x41ff0d['password'];if(_0x41ff0d[_0xe8b0('0x3e')]){_0x1fedba[_0xe8b0('0x3e')]=_0x7030e5['modernAuthentication']=!![];_0x1fedba[_0xe8b0('0x3f')]=_0x7030e5[_0xe8b0('0x3f')]=_0x41ff0d['CloudProviderId'];_0x1fedba['password']=_0x7030e5[_0xe8b0('0x3d')]=null;}else{_0x1fedba[_0xe8b0('0x3f')]=_0x7030e5['CloudProviderId']=null;}_0x1fedba[_0xe8b0('0x40')]=getImapHost(_0x299f51);_0x1fedba[_0xe8b0('0x41')]=0x3e1;_0x7030e5[_0xe8b0('0x40')]=getSmtpHost(_0x299f51);_0x7030e5[_0xe8b0('0x41')]=0x24b;_0x7030e5[_0xe8b0('0x42')]=![];_0x1fedba[_0xe8b0('0x43')]=_0x7030e5[_0xe8b0('0x43')]=null;}else{if(_0x41ff0d[_0xe8b0('0x44')]){_0x1fedba['user']=_0x7030e5[_0xe8b0('0x3b')]=_0x41ff0d[_0xe8b0('0x3c')];_0x1fedba[_0xe8b0('0x45')]=_0x7030e5[_0xe8b0('0x3d')]=_0x41ff0d[_0xe8b0('0x45')];}else{_0x1fedba[_0xe8b0('0x44')]=_0x7030e5[_0xe8b0('0x44')]=![];_0x1fedba[_0xe8b0('0x3b')]=_0x7030e5[_0xe8b0('0x3b')]=null;_0x1fedba[_0xe8b0('0x45')]=_0x7030e5[_0xe8b0('0x3d')]=null;}_0x1fedba['host']=_0x41ff0d[_0xe8b0('0x46')][_0xe8b0('0x40')];_0x1fedba[_0xe8b0('0x41')]=_0x41ff0d['Imap'][_0xe8b0('0x41')];_0x7030e5[_0xe8b0('0x40')]=_0x41ff0d[_0xe8b0('0x47')][_0xe8b0('0x40')];_0x7030e5[_0xe8b0('0x41')]=_0x41ff0d['Smtp']['port'];}return{'Imap':_0x1fedba,'Smtp':_0x7030e5};}exports[_0xe8b0('0x48')]=function(_0x7921a6,_0x401d48){var _0x12a411={'include':[{'model':db['MailServerIn'],'as':_0xe8b0('0x46')},{'model':db[_0xe8b0('0x49')],'as':_0xe8b0('0x47')},{'model':db[_0xe8b0('0x4a')],'as':'mandatoryDispositionPause'}]},_0x3e6378={},_0x49ff11={'count':0x0,'rows':[]};var _0x2fa18c=_[_0xe8b0('0x4b')](db[_0xe8b0('0x4c')]['rawAttributes'],function(_0x5c879d){return{'name':_0x5c879d[_0xe8b0('0x4d')],'type':_0x5c879d['type'][_0xe8b0('0x4e')]};});_0x3e6378['model']=_[_0xe8b0('0x4b')](_0x2fa18c,_0xe8b0('0x4f'));_0x3e6378[_0xe8b0('0x50')]=_[_0xe8b0('0x51')](_0x7921a6[_0xe8b0('0x50')]);_0x3e6378[_0xe8b0('0x52')]=_[_0xe8b0('0x53')](_0x3e6378[_0xe8b0('0x54')],_0x3e6378['query']);_0x12a411[_0xe8b0('0x55')]=_[_0xe8b0('0x53')](_0x3e6378[_0xe8b0('0x54')],qs[_0xe8b0('0x56')](_0x7921a6[_0xe8b0('0x50')][_0xe8b0('0x56')]));_0x12a411[_0xe8b0('0x55')]=_0x12a411['attributes'][_0xe8b0('0x57')]?_0x12a411['attributes']:_0x3e6378[_0xe8b0('0x54')];if(!_0x7921a6[_0xe8b0('0x50')][_0xe8b0('0x58')](_0xe8b0('0x59'))){_0x12a411[_0xe8b0('0x22')]=qs['limit'](_0x7921a6[_0xe8b0('0x50')][_0xe8b0('0x22')]);_0x12a411['offset']=qs[_0xe8b0('0x24')](_0x7921a6[_0xe8b0('0x50')][_0xe8b0('0x24')]);}_0x12a411[_0xe8b0('0x5a')]=qs[_0xe8b0('0x5b')](_0x7921a6['query'][_0xe8b0('0x5b')]);_0x12a411[_0xe8b0('0x5c')]=qs[_0xe8b0('0x52')](_['pick'](_0x7921a6[_0xe8b0('0x50')],_0x3e6378[_0xe8b0('0x52')]),_0x2fa18c);if(_0x7921a6['query'][_0xe8b0('0x5d')]){_0x12a411[_0xe8b0('0x5c')]=_[_0xe8b0('0x5e')](_0x12a411[_0xe8b0('0x5c')],{'$or':_[_0xe8b0('0x4b')](_0x2fa18c,function(_0x5d44ec){if(_0x5d44ec[_0xe8b0('0x5f')]!=='VIRTUAL'){var _0x2e192a={};_0x2e192a[_0x5d44ec['name']]={'$like':'%'+_0x7921a6['query'][_0xe8b0('0x5d')]+'%'};return _0x2e192a;}})});}_0x12a411=_['merge']({},_0x12a411,_0x7921a6[_0xe8b0('0x60')]);var _0xf45258={'where':_0x12a411[_0xe8b0('0x5c')]};return db['MailAccount'][_0xe8b0('0x23')](_0xf45258)[_0xe8b0('0x12')](function(_0x2fc7bc){_0x49ff11[_0xe8b0('0x23')]=_0x2fc7bc;if(_0x7921a6['query']['includeAll']){_0x12a411[_0xe8b0('0x61')]=[{'all':!![]}];}return db['MailAccount'][_0xe8b0('0x62')](_0x12a411);})['then'](function(_0x19481c){_0x49ff11[_0xe8b0('0x63')]=_0x19481c;return _0x49ff11;})[_0xe8b0('0x12')](respondWithFilteredResult(_0x401d48,_0x12a411))[_0xe8b0('0x1d')](handleError(_0x401d48,null));};exports[_0xe8b0('0x64')]=function(_0x1be0f5,_0x23ebac){var _0x137b37={'raw':![],'where':{'id':_0x1be0f5[_0xe8b0('0x65')]['id']},'include':[{'model':db[_0xe8b0('0x66')],'as':_0xe8b0('0x46')},{'model':db[_0xe8b0('0x49')],'as':_0xe8b0('0x47')},{'model':db[_0xe8b0('0x4a')],'as':_0xe8b0('0x67')}]},_0xe20ea2={};_0xe20ea2[_0xe8b0('0x54')]=_['keys'](db[_0xe8b0('0x4c')][_0xe8b0('0x68')]);_0xe20ea2[_0xe8b0('0x50')]=_[_0xe8b0('0x51')](_0x1be0f5[_0xe8b0('0x50')]);_0xe20ea2['filters']=_[_0xe8b0('0x53')](_0xe20ea2[_0xe8b0('0x54')],_0xe20ea2[_0xe8b0('0x50')]);_0x137b37[_0xe8b0('0x55')]=_['intersection'](_0xe20ea2['model'],qs[_0xe8b0('0x56')](_0x1be0f5[_0xe8b0('0x50')][_0xe8b0('0x56')]));_0x137b37[_0xe8b0('0x55')]=_0x137b37[_0xe8b0('0x55')]['length']?_0x137b37['attributes']:_0xe20ea2['model'];if(_0x1be0f5['query'][_0xe8b0('0x69')]){_0x137b37[_0xe8b0('0x61')]=[{'all':!![]}];}_0x137b37=_[_0xe8b0('0x5e')]({},_0x137b37,_0x1be0f5[_0xe8b0('0x60')]);return db['MailAccount'][_0xe8b0('0x6a')](_0x137b37)[_0xe8b0('0x12')](handleEntityNotFound(_0x23ebac,null))['then'](respondWithResult(_0x23ebac,null))[_0xe8b0('0x1d')](handleError(_0x23ebac,null));};exports[_0xe8b0('0x27')]=function(_0x49fab0,_0x4c57dc){if(_0x49fab0[_0xe8b0('0x6b')]['id']){delete _0x49fab0[_0xe8b0('0x6b')]['id'];}var _0x3589d2=_0x49fab0['body'][_0xe8b0('0x6c')]===_0xe8b0('0x6d')?null:_0x49fab0['body']['provider'];var _0x852c94=_0x49fab0[_0xe8b0('0x6b')][_0xe8b0('0x46')]||{};var _0x12b535=_0x49fab0[_0xe8b0('0x6b')]['Smtp']||{};if(_0x3589d2){_0x852c94[_0xe8b0('0x40')]=getImapHost(_0x3589d2);_0x852c94['port']=0x3e1;_0x12b535[_0xe8b0('0x40')]=getSmtpHost(_0x3589d2);_0x12b535['port']=0x24b;_0x12b535[_0xe8b0('0x42')]=![];}if(_0x12b535[_0xe8b0('0x3e')]){_0x12b535[_0xe8b0('0x42')]=![];}else{_0x12b535[_0xe8b0('0x3f')]=null;}if(!_0x852c94[_0xe8b0('0x3e')])_0x852c94[_0xe8b0('0x3f')]=null;_0x49fab0[_0xe8b0('0x6b')]['Imap']=_0x852c94;_0x49fab0[_0xe8b0('0x6b')][_0xe8b0('0x47')]=_0x12b535;return db[_0xe8b0('0x4c')][_0xe8b0('0x6a')]({'where':{'id':_0x49fab0[_0xe8b0('0x65')]['id']},'include':[{'model':db['MailServerIn'],'as':_0xe8b0('0x46')},{'model':db[_0xe8b0('0x49')],'as':_0xe8b0('0x47')},{'model':db[_0xe8b0('0x4a')],'as':_0xe8b0('0x67')}]})['then'](handleEntityNotFound(_0x4c57dc,null))['then'](function(_0x1d2ab8){if(!_0x1d2ab8)throw new Error('Mail\x20Account\x20not\x20found');if(_0x1d2ab8[_0xe8b0('0x43')])delete _0x49fab0[_0xe8b0('0x6b')][_0xe8b0('0x46')];return _0x1d2ab8;})['then'](saveUpdates(_0x49fab0[_0xe8b0('0x6b')],null))['then'](function(_0x21cb52){if(!_0x49fab0['body'][_0xe8b0('0x46')])return _0x21cb52;return db['MailServerIn']['update'](_0x49fab0[_0xe8b0('0x6b')][_0xe8b0('0x46')],{'where':{'MailAccountId':_0x21cb52['id']}})[_0xe8b0('0x12')](function(){return _0x21cb52;});})[_0xe8b0('0x12')](function(_0x59dd3c){if(!_0x49fab0['body'][_0xe8b0('0x47')])return _0x59dd3c;return db[_0xe8b0('0x49')][_0xe8b0('0x27')](_0x49fab0['body'][_0xe8b0('0x47')],{'where':{'MailAccountId':_0x59dd3c['id']}})['then'](function(){return _0x59dd3c;});})[_0xe8b0('0x12')](respondWithResult(_0x4c57dc,null))['catch'](handleError(_0x4c57dc,null));};exports[_0xe8b0('0x6e')]=function(_0x4546f5,_0x383f8c){return db['MailAccount']['describe']()['then'](respondWithResult(_0x383f8c,null))[_0xe8b0('0x1d')](handleError(_0x383f8c,null));};exports[_0xe8b0('0x6f')]=function(_0x3dfd04,_0x136450){if(_0x3dfd04[_0xe8b0('0x6b')]['id']){delete _0x3dfd04[_0xe8b0('0x6b')]['id'];}return db[_0xe8b0('0x4c')]['find']({'where':{'id':_0x3dfd04[_0xe8b0('0x65')]['id']}})['then'](handleEntityNotFound(_0x136450,null))[_0xe8b0('0x12')](function(_0x292d21){if(_0x292d21){_0x3dfd04[_0xe8b0('0x6b')][_0xe8b0('0x70')]=_0x292d21['id'];return db['Disposition'][_0xe8b0('0x71')](_0x3dfd04[_0xe8b0('0x6b')]);}})['then'](respondWithResult(_0x136450,null))['catch'](handleError(_0x136450,null));};exports[_0xe8b0('0x72')]=function(_0x293cd4,_0x556a21){var _0x365844={'raw':![],'where':{}};var _0x12d09c={};var _0x33eaa6={'count':0x0,'rows':[]};return db[_0xe8b0('0x4c')][_0xe8b0('0x73')]({'where':{'id':_0x293cd4[_0xe8b0('0x65')]['id']}})[_0xe8b0('0x12')](handleEntityNotFound(_0x556a21,null))[_0xe8b0('0x12')](function(_0x1c68b5){if(_0x1c68b5){_0x12d09c[_0xe8b0('0x54')]=_[_0xe8b0('0x51')](db[_0xe8b0('0x74')][_0xe8b0('0x68')]);_0x12d09c[_0xe8b0('0x50')]=_[_0xe8b0('0x51')](_0x293cd4['query']);_0x12d09c[_0xe8b0('0x52')]=_[_0xe8b0('0x53')](_0x12d09c[_0xe8b0('0x54')],_0x12d09c[_0xe8b0('0x50')]);_0x365844[_0xe8b0('0x55')]=_[_0xe8b0('0x53')](_0x12d09c[_0xe8b0('0x54')],qs[_0xe8b0('0x56')](_0x293cd4[_0xe8b0('0x50')][_0xe8b0('0x56')]));_0x365844[_0xe8b0('0x55')]=_0x365844['attributes'][_0xe8b0('0x57')]?_0x365844[_0xe8b0('0x55')]:_0x12d09c[_0xe8b0('0x54')];if(!_0x293cd4[_0xe8b0('0x50')]['hasOwnProperty']('nolimit')){_0x365844[_0xe8b0('0x22')]=qs['limit'](_0x293cd4[_0xe8b0('0x50')][_0xe8b0('0x22')]);_0x365844[_0xe8b0('0x24')]=qs['offset'](_0x293cd4[_0xe8b0('0x50')][_0xe8b0('0x24')]);}_0x365844['order']=qs[_0xe8b0('0x5b')](_0x293cd4[_0xe8b0('0x50')]['sort']);_0x365844[_0xe8b0('0x5c')]=qs[_0xe8b0('0x52')](_[_0xe8b0('0x75')](_0x293cd4[_0xe8b0('0x50')],_0x12d09c[_0xe8b0('0x52')]));_0x365844[_0xe8b0('0x5c')][_0xe8b0('0x70')]=_0x1c68b5['id'];if(_0x293cd4[_0xe8b0('0x50')][_0xe8b0('0x5d')]){_0x365844[_0xe8b0('0x5c')]=_['merge'](_0x365844[_0xe8b0('0x5c')],{'$or':_[_0xe8b0('0x4b')](_0x365844[_0xe8b0('0x55')],function(_0x489f9b){var _0x4513e2={};_0x4513e2[_0x489f9b]={'$like':'%'+_0x293cd4['query'][_0xe8b0('0x5d')]+'%'};return _0x4513e2;})});}_0x365844=_[_0xe8b0('0x5e')]({},_0x365844,_0x293cd4[_0xe8b0('0x60')]);return db[_0xe8b0('0x74')][_0xe8b0('0x23')]({'where':_0x365844[_0xe8b0('0x5c')]})['then'](function(_0xd4b34){_0x33eaa6['count']=_0xd4b34;if(_0x293cd4['query']['includeAll']){_0x365844['include']=[{'all':!![]}];}return db['Disposition'][_0xe8b0('0x62')](_0x365844);})['then'](function(_0x26e4d1){_0x33eaa6[_0xe8b0('0x63')]=_0x26e4d1;return _0x33eaa6;});}})['then'](respondWithFilteredResult(_0x556a21,_0x365844))[_0xe8b0('0x1d')](handleError(_0x556a21,null));};exports[_0xe8b0('0x76')]=function(_0x580c27,_0xdebd84){return db[_0xe8b0('0x4c')]['find']({'where':{'id':_0x580c27[_0xe8b0('0x65')]['id']}})[_0xe8b0('0x12')](handleEntityNotFound(_0xdebd84,null))['then'](function(_0x2feae6){if(_0x2feae6){return _0x2feae6['removeDispositions'](_0x580c27['query'][_0xe8b0('0x77')]);}})['then'](respondWithStatusCode(_0xdebd84,null))['catch'](handleError(_0xdebd84,null));};exports[_0xe8b0('0x78')]=function(_0x3eadfd,_0x13782c){if(_0x3eadfd[_0xe8b0('0x6b')]['id']){delete _0x3eadfd[_0xe8b0('0x6b')]['id'];}return db['MailAccount'][_0xe8b0('0x6a')]({'where':{'id':_0x3eadfd['params']['id']}})[_0xe8b0('0x12')](handleEntityNotFound(_0x13782c,null))['then'](function(_0x3a1018){if(_0x3a1018){_0x3eadfd['body'][_0xe8b0('0x70')]=_0x3a1018['id'];return db[_0xe8b0('0x79')][_0xe8b0('0x71')](_0x3eadfd[_0xe8b0('0x6b')]);}})['then'](respondWithResult(_0x13782c,null))[_0xe8b0('0x1d')](handleError(_0x13782c,null));};exports['getAnswers']=function(_0x267600,_0x465132){var _0x4d6751={'raw':![],'where':{}};var _0x2da20c={};var _0x3c0bb4={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x267600[_0xe8b0('0x65')]['id']}})[_0xe8b0('0x12')](handleEntityNotFound(_0x465132,null))['then'](function(_0x13e48b){if(_0x13e48b){_0x2da20c[_0xe8b0('0x54')]=_[_0xe8b0('0x51')](db[_0xe8b0('0x79')][_0xe8b0('0x68')]);_0x2da20c[_0xe8b0('0x50')]=_[_0xe8b0('0x51')](_0x267600[_0xe8b0('0x50')]);_0x2da20c['filters']=_[_0xe8b0('0x53')](_0x2da20c[_0xe8b0('0x54')],_0x2da20c[_0xe8b0('0x50')]);_0x4d6751[_0xe8b0('0x55')]=_['intersection'](_0x2da20c[_0xe8b0('0x54')],qs[_0xe8b0('0x56')](_0x267600[_0xe8b0('0x50')][_0xe8b0('0x56')]));_0x4d6751[_0xe8b0('0x55')]=_0x4d6751[_0xe8b0('0x55')][_0xe8b0('0x57')]?_0x4d6751[_0xe8b0('0x55')]:_0x2da20c['model'];if(!_0x267600[_0xe8b0('0x50')]['hasOwnProperty']('nolimit')){_0x4d6751[_0xe8b0('0x22')]=qs[_0xe8b0('0x22')](_0x267600[_0xe8b0('0x50')][_0xe8b0('0x22')]);_0x4d6751['offset']=qs[_0xe8b0('0x24')](_0x267600[_0xe8b0('0x50')][_0xe8b0('0x24')]);}_0x4d6751['order']=qs[_0xe8b0('0x5b')](_0x267600[_0xe8b0('0x50')][_0xe8b0('0x5b')]);_0x4d6751[_0xe8b0('0x5c')]=qs[_0xe8b0('0x52')](_[_0xe8b0('0x75')](_0x267600[_0xe8b0('0x50')],_0x2da20c[_0xe8b0('0x52')]));_0x4d6751[_0xe8b0('0x5c')][_0xe8b0('0x70')]=_0x13e48b['id'];if(_0x267600[_0xe8b0('0x50')][_0xe8b0('0x5d')]){_0x4d6751[_0xe8b0('0x5c')]=_[_0xe8b0('0x5e')](_0x4d6751[_0xe8b0('0x5c')],{'$or':_[_0xe8b0('0x4b')](_0x4d6751[_0xe8b0('0x55')],function(_0x512e20){var _0x40fc06={};_0x40fc06[_0x512e20]={'$like':'%'+_0x267600[_0xe8b0('0x50')][_0xe8b0('0x5d')]+'%'};return _0x40fc06;})});}_0x4d6751=_[_0xe8b0('0x5e')]({},_0x4d6751,_0x267600[_0xe8b0('0x60')]);return db['CannedAnswer'][_0xe8b0('0x23')]({'where':_0x4d6751[_0xe8b0('0x5c')]})[_0xe8b0('0x12')](function(_0x35523e){_0x3c0bb4['count']=_0x35523e;if(_0x267600[_0xe8b0('0x50')][_0xe8b0('0x69')]){_0x4d6751[_0xe8b0('0x61')]=[{'all':!![]}];}return db[_0xe8b0('0x79')]['findAll'](_0x4d6751);})[_0xe8b0('0x12')](function(_0x559157){_0x3c0bb4['rows']=_0x559157;return _0x3c0bb4;});}})[_0xe8b0('0x12')](respondWithFilteredResult(_0x465132,_0x4d6751))[_0xe8b0('0x1d')](handleError(_0x465132,null));};exports[_0xe8b0('0x7a')]=function(_0x3a2d44,_0x16baa5){return db['MailAccount']['find']({'where':{'id':_0x3a2d44['params']['id']}})[_0xe8b0('0x12')](handleEntityNotFound(_0x16baa5,null))[_0xe8b0('0x12')](function(_0x431040){if(_0x431040){return _0x431040['removeAnswers'](_0x3a2d44['query'][_0xe8b0('0x77')]);}})[_0xe8b0('0x12')](respondWithStatusCode(_0x16baa5,null))['catch'](handleError(_0x16baa5,null));};exports[_0xe8b0('0x71')]=function(_0x31a8ea,_0x4b2fd6){var _0x51e577={'name':_0x31a8ea['body'][_0xe8b0('0x4f')],'key':_0x31a8ea[_0xe8b0('0x6b')][_0xe8b0('0x4e')],'provider':_0x31a8ea[_0xe8b0('0x6b')][_0xe8b0('0x6c')]===_0xe8b0('0x6d')?null:_0x31a8ea[_0xe8b0('0x6b')][_0xe8b0('0x6c')],'email':_0x31a8ea[_0xe8b0('0x6b')][_0xe8b0('0x7b')],'ListId':_0x31a8ea['body'][_0xe8b0('0x7c')],'active':!_[_0xe8b0('0x7d')](_0x31a8ea[_0xe8b0('0x6b')][_0xe8b0('0x7e')])?_0x31a8ea['body'][_0xe8b0('0x7e')]:!![],'description':_0x31a8ea[_0xe8b0('0x6b')]['description']||null};var _0x11c1b5=getAuthenticationOptions(_0x51e577[_0xe8b0('0x6c')],_0x31a8ea['body']);_0x51e577[_0xe8b0('0x46')]=_0x11c1b5[_0xe8b0('0x46')];_0x51e577[_0xe8b0('0x47')]=_0x11c1b5['Smtp'];return db['MailAccount'][_0xe8b0('0x71')](_0x51e577,{'include':[{'model':db[_0xe8b0('0x49')],'as':_0xe8b0('0x47')},{'model':db[_0xe8b0('0x66')],'as':_0xe8b0('0x46')}]})[_0xe8b0('0x12')](function(_0x2f4a34){var _0x1f20d9=_0x31a8ea['user']['get']({'plain':!![]});if(!_0x1f20d9)throw new Error(_0xe8b0('0x7f'));if(_0x1f20d9[_0xe8b0('0x80')]===_0xe8b0('0x3b')){var _0x3ad0c5=_0x2f4a34[_0xe8b0('0x29')]({'plain':!![]});return db[_0xe8b0('0x81')][_0xe8b0('0x6a')]({'where':{'name':_0xe8b0('0x82'),'userProfileId':_0x1f20d9[_0xe8b0('0x83')]},'raw':!![]})['then'](function(_0x3e9303){if(_0x3e9303&&_0x3e9303[_0xe8b0('0x84')]===0x0){return db[_0xe8b0('0x2a')][_0xe8b0('0x71')]({'name':_0x3ad0c5['name'],'resourceId':_0x3ad0c5['id'],'type':_0x3e9303[_0xe8b0('0x4f')],'sectionId':_0x3e9303['id']},{})[_0xe8b0('0x12')](function(){return _0x2f4a34;});}else{return _0x2f4a34;}})['catch'](function(_0x473656){logger['error'](_0xe8b0('0x85'),_0x473656);throw _0x473656;});}return _0x2f4a34;})[_0xe8b0('0x12')](respondWithResult(_0x4b2fd6,0xc9))[_0xe8b0('0x1d')](handleError(_0x4b2fd6,null));};exports[_0xe8b0('0x86')]=function(_0x33c28d,_0x14b351){return db[_0xe8b0('0x4c')][_0xe8b0('0x73')]({'where':{'id':_0x33c28d[_0xe8b0('0x65')]['id']}})[_0xe8b0('0x12')](handleEntityNotFound(_0x14b351,null))[_0xe8b0('0x12')](function(_0x51abb7){if(_0x51abb7){return _0x51abb7[_0xe8b0('0x86')]();}return null;})['then'](respondWithResult(_0x14b351,null))[_0xe8b0('0x1d')](handleError(_0x14b351,null));};exports[_0xe8b0('0x87')]=function(_0x1b0187,_0x4223dd){if(_0x1b0187[_0xe8b0('0x6b')]['id']){delete _0x1b0187[_0xe8b0('0x6b')]['id'];}return db[_0xe8b0('0x4c')][_0xe8b0('0x6a')]({'where':{'id':_0x1b0187[_0xe8b0('0x65')]['id']}})[_0xe8b0('0x12')](handleEntityNotFound(_0x4223dd,null))[_0xe8b0('0x12')](function(_0x1a3381){if(_0x1a3381){_0x1b0187[_0xe8b0('0x6b')][_0xe8b0('0x70')]=_0x1a3381['id'];return db['MailServerIn']['create'](_0x1b0187[_0xe8b0('0x6b')]);}})['then'](respondWithResult(_0x4223dd,null))[_0xe8b0('0x1d')](handleError(_0x4223dd,null));};exports[_0xe8b0('0x88')]=function(_0x4c80ab,_0x3d12a0){return db[_0xe8b0('0x4c')]['findOne']({'where':{'id':_0x4c80ab['params']['id']}})['then'](handleEntityNotFound(_0x3d12a0,null))['then'](function(_0x14d67c){if(_0x14d67c){return _0x14d67c['setImap'](null);}return null;})[_0xe8b0('0x12')](respondWithStatusCode(_0x3d12a0,null))[_0xe8b0('0x1d')](handleError(_0x3d12a0,null));};exports[_0xe8b0('0x89')]=function(_0x5202d6,_0x107a7a){return db['MailAccount']['findOne']({'where':{'id':_0x5202d6['params']['id']}})[_0xe8b0('0x12')](handleEntityNotFound(_0x107a7a,null))['then'](function(_0x3ca305){if(_0x3ca305){return _0x3ca305[_0xe8b0('0x89')]();}return null;})[_0xe8b0('0x12')](respondWithResult(_0x107a7a,null))['catch'](handleError(_0x107a7a,null));};exports[_0xe8b0('0x8a')]=function(_0x3cf1ef,_0x4cdf63){if(_0x3cf1ef['body']['id']){delete _0x3cf1ef[_0xe8b0('0x6b')]['id'];}return db['MailAccount'][_0xe8b0('0x6a')]({'where':{'id':_0x3cf1ef[_0xe8b0('0x65')]['id']}})[_0xe8b0('0x12')](handleEntityNotFound(_0x4cdf63,null))['then'](function(_0x40ca4b){if(_0x40ca4b){_0x3cf1ef[_0xe8b0('0x6b')][_0xe8b0('0x70')]=_0x40ca4b['id'];return db[_0xe8b0('0x49')][_0xe8b0('0x71')](_0x3cf1ef[_0xe8b0('0x6b')]);}})['then'](respondWithResult(_0x4cdf63,null))[_0xe8b0('0x1d')](handleError(_0x4cdf63,null));};exports[_0xe8b0('0x8b')]=function(_0x4035a6,_0x48059a){return db[_0xe8b0('0x4c')]['findOne']({'where':{'id':_0x4035a6['params']['id']}})['then'](handleEntityNotFound(_0x48059a,null))[_0xe8b0('0x12')](function(_0x4c3ca7){if(_0x4c3ca7){return _0x4c3ca7[_0xe8b0('0x8c')](null);}return null;})[_0xe8b0('0x12')](respondWithStatusCode(_0x48059a,null))['catch'](handleError(_0x48059a,null));};exports[_0xe8b0('0x8d')]=function(_0x284824,_0x5cdecc){return db[_0xe8b0('0x8e')][_0xe8b0('0x6a')]({'where':{'id':_0x284824[_0xe8b0('0x65')]['id']}})[_0xe8b0('0x12')](handleEntityNotFound(_0x5cdecc,null))['then'](function(_0x11cc77){if(_0x11cc77){return _0x11cc77[_0xe8b0('0x8d')](_0x284824[_0xe8b0('0x6b')][_0xe8b0('0x77')],_[_0xe8b0('0x8f')](_0x284824[_0xe8b0('0x6b')],[_0xe8b0('0x77'),'id'])||{});}})['then'](respondWithResult(_0x5cdecc,null))[_0xe8b0('0x1d')](handleError(_0x5cdecc,null));};exports[_0xe8b0('0x90')]=function(_0x592d54,_0x16f01d){var _0x56c074={'raw':![],'where':{}};var _0x1b5773={};var _0x511fd0={'count':0x0,'rows':[]};return db[_0xe8b0('0x4c')]['findOne']({'where':{'id':_0x592d54['params']['id']}})[_0xe8b0('0x12')](handleEntityNotFound(_0x16f01d,null))[_0xe8b0('0x12')](function(_0x42c547){if(_0x42c547){_0x1b5773['model']=_[_0xe8b0('0x51')](db[_0xe8b0('0x8e')]['rawAttributes']);_0x1b5773['query']=_[_0xe8b0('0x51')](_0x592d54[_0xe8b0('0x50')]);_0x1b5773[_0xe8b0('0x52')]=_[_0xe8b0('0x53')](_0x1b5773[_0xe8b0('0x54')],_0x1b5773[_0xe8b0('0x50')]);_0x56c074[_0xe8b0('0x55')]=_[_0xe8b0('0x53')](_0x1b5773[_0xe8b0('0x54')],qs['fields'](_0x592d54[_0xe8b0('0x50')]['fields']));_0x56c074['attributes']=_0x56c074[_0xe8b0('0x55')][_0xe8b0('0x57')]?_0x56c074[_0xe8b0('0x55')]:_0x1b5773[_0xe8b0('0x54')];if(!_0x592d54[_0xe8b0('0x50')]['hasOwnProperty']('nolimit')){_0x56c074[_0xe8b0('0x22')]=qs[_0xe8b0('0x22')](_0x592d54[_0xe8b0('0x50')][_0xe8b0('0x22')]);_0x56c074[_0xe8b0('0x24')]=qs[_0xe8b0('0x24')](_0x592d54['query'][_0xe8b0('0x24')]);}_0x56c074['order']=qs[_0xe8b0('0x5b')](_0x592d54[_0xe8b0('0x50')][_0xe8b0('0x5b')]);_0x56c074[_0xe8b0('0x5c')]=qs[_0xe8b0('0x52')](_['pick'](_0x592d54[_0xe8b0('0x50')],_0x1b5773[_0xe8b0('0x52')]));_0x56c074['where'][_0xe8b0('0x70')]=_0x42c547['id'];if(_0x592d54[_0xe8b0('0x50')][_0xe8b0('0x5d')]){_0x56c074[_0xe8b0('0x5c')]=_[_0xe8b0('0x5e')](_0x56c074[_0xe8b0('0x5c')],{'$or':_[_0xe8b0('0x4b')](_0x56c074[_0xe8b0('0x55')],function(_0x43c370){var _0x209a0={};_0x209a0[_0x43c370]={'$like':'%'+_0x592d54[_0xe8b0('0x50')][_0xe8b0('0x5d')]+'%'};return _0x209a0;})});}_0x56c074=_[_0xe8b0('0x5e')]({},_0x56c074,_0x592d54[_0xe8b0('0x60')]);return db[_0xe8b0('0x8e')][_0xe8b0('0x23')]({'where':_0x56c074['where']})[_0xe8b0('0x12')](function(_0x5d125f){_0x511fd0[_0xe8b0('0x23')]=_0x5d125f;if(_0x592d54[_0xe8b0('0x50')][_0xe8b0('0x69')]){_0x56c074['include']=[{'model':db['CmContact'],'as':_0xe8b0('0x91'),'required':![]},{'model':db['User'],'as':'Owner','attributes':['name','fullname',_0xe8b0('0x92')],'required':![]},{'model':db[_0xe8b0('0x93')],'as':'Tags','attributes':['id',_0xe8b0('0x4f'),'color'],'where':_0x592d54[_0xe8b0('0x50')][_0xe8b0('0x94')]?{'id':_0x592d54[_0xe8b0('0x50')]['tag']}:undefined,'required':_0x592d54['query'][_0xe8b0('0x94')]?!![]:![]}];}return db[_0xe8b0('0x8e')][_0xe8b0('0x62')](_0x56c074);})[_0xe8b0('0x12')](function(_0x289706){_0x511fd0['rows']=_0x289706;return _0x511fd0;});}})['then'](respondWithFilteredResult(_0x16f01d,_0x56c074))[_0xe8b0('0x1d')](handleError(_0x16f01d,null));};exports[_0xe8b0('0x95')]=function addApplications(_0x4243a2,_0x258cb2){var _0x33197a=_0x4243a2[_0xe8b0('0x65')]['id'];var _0x2b95ac=_0x4243a2[_0xe8b0('0x6b')];var _0x41bc1a=0xc8;var _0x23d4bc=null;return db[_0xe8b0('0x96')][_0xe8b0('0x97')]({'isolationLevel':db[_0xe8b0('0x96')][_0xe8b0('0x98')]['ISOLATION_LEVELS'][_0xe8b0('0x99')]},function(_0x33992e){return db[_0xe8b0('0x4c')][_0xe8b0('0x73')]({'where':{'id':_0x33197a},'transaction':_0x33992e})['then'](function(_0x108f93){if(_0x108f93){return db[_0xe8b0('0x9a')][_0xe8b0('0x28')]({'where':{'MailAccountId':_0x33197a},'transaction':_0x33992e})['then'](function(){var _0x3a600a=_[_0xe8b0('0x4b')](_0x2b95ac,function(_0x31cdb5){_0x31cdb5[_0xe8b0('0x70')]=_0x33197a;return _0x31cdb5;});return db[_0xe8b0('0x9a')][_0xe8b0('0x9b')](_0x3a600a,{'transaction':_0x33992e});});}else{_0x41bc1a=0x194;_0x23d4bc=[];}});})['then'](function(){if(_0x41bc1a!==0x194){return db[_0xe8b0('0x9a')]['findAndCountAll']({'where':{'MailAccountId':_0x33197a},'order':'priority'})[_0xe8b0('0x12')](function(_0x4b5d0b){_0x23d4bc=_0x4b5d0b;});}})[_0xe8b0('0x1d')](function(_0x35612f){_0x41bc1a=0x1f4;logger['error'](_0x35612f[_0xe8b0('0x2c')]);if(_0x35612f[_0xe8b0('0x4f')]){delete _0x35612f[_0xe8b0('0x4f')];}_0x23d4bc=_0x35612f;})['finally'](function(){if(_0x23d4bc===null){_0x258cb2[_0xe8b0('0x1e')](_0x41bc1a);}else{if(_0x41bc1a===0x1f4){_0x258cb2[_0xe8b0('0x1f')](_0x41bc1a)['send'](_0x23d4bc);}else{_0x258cb2[_0xe8b0('0x1f')](_0x41bc1a)[_0xe8b0('0x20')](_0x23d4bc);}}});};exports[_0xe8b0('0x9c')]=function(_0x149c35,_0xb32ee8){var _0x28b703={};var _0x4fd662={};var _0x4280c2;var _0x2c112e;return db[_0xe8b0('0x4c')][_0xe8b0('0x73')]({'where':{'id':_0x149c35['params']['id']}})[_0xe8b0('0x12')](handleEntityNotFound(_0xb32ee8,null))[_0xe8b0('0x12')](function(_0x5a36c0){if(_0x5a36c0){_0x4280c2=_0x5a36c0;_0x4fd662['model']=_['keys'](db[_0xe8b0('0x9a')][_0xe8b0('0x68')]);_0x4fd662[_0xe8b0('0x50')]=_[_0xe8b0('0x51')](_0x149c35[_0xe8b0('0x50')]);_0x4fd662[_0xe8b0('0x52')]=_['intersection'](_0x4fd662[_0xe8b0('0x54')],_0x4fd662['query']);_0x28b703[_0xe8b0('0x55')]=_[_0xe8b0('0x53')](_0x4fd662['model'],qs[_0xe8b0('0x56')](_0x149c35[_0xe8b0('0x50')][_0xe8b0('0x56')]));_0x28b703['attributes']=_0x28b703[_0xe8b0('0x55')]['length']?_0x28b703[_0xe8b0('0x55')]:_0x4fd662['model'];_0x28b703[_0xe8b0('0x5a')]=qs['sort'](_0x149c35[_0xe8b0('0x50')][_0xe8b0('0x5b')]);_0x28b703[_0xe8b0('0x5c')]=qs[_0xe8b0('0x52')](_[_0xe8b0('0x75')](_0x149c35[_0xe8b0('0x50')],_0x4fd662[_0xe8b0('0x52')]));if(_0x149c35[_0xe8b0('0x50')][_0xe8b0('0x5d')]){_0x28b703['where']=_['merge'](_0x28b703[_0xe8b0('0x5c')],{'$or':_[_0xe8b0('0x4b')](_0x28b703[_0xe8b0('0x55')],function(_0x1f2f1d){var _0x56299a={};_0x56299a[_0x1f2f1d]={'$like':'%'+_0x149c35['query'][_0xe8b0('0x5d')]+'%'};return _0x56299a;})});}_0x28b703=_[_0xe8b0('0x5e')]({},_0x28b703,_0x149c35[_0xe8b0('0x60')]);return _0x4280c2[_0xe8b0('0x9c')](_0x28b703);}})[_0xe8b0('0x12')](function(_0x591eb4){if(_0x591eb4){_0x2c112e=_0x591eb4[_0xe8b0('0x57')];if(!_0x149c35[_0xe8b0('0x50')][_0xe8b0('0x58')]('nolimit')){_0x28b703[_0xe8b0('0x22')]=qs[_0xe8b0('0x22')](_0x149c35[_0xe8b0('0x50')][_0xe8b0('0x22')]);_0x28b703[_0xe8b0('0x24')]=qs['offset'](_0x149c35[_0xe8b0('0x50')][_0xe8b0('0x24')]);}return _0x4280c2[_0xe8b0('0x9c')](_0x28b703);}})[_0xe8b0('0x12')](function(_0x2c5b6a){if(_0x2c5b6a){return _0x2c5b6a?{'count':_0x2c112e,'rows':_0x2c5b6a}:null;}})[_0xe8b0('0x12')](respondWithResult(_0xb32ee8,null))['catch'](handleError(_0xb32ee8,null));};exports['getMessages']=function(_0xaa1c79,_0x3a5a9a){var _0x1cfb19={'raw':!![],'where':{}};var _0x14d430={};var _0x4e34d7={'count':0x0,'rows':[]};return db[_0xe8b0('0x4c')][_0xe8b0('0x73')]({'where':{'id':_0xaa1c79[_0xe8b0('0x65')]['id']}})[_0xe8b0('0x12')](handleEntityNotFound(_0x3a5a9a,null))['then'](function(_0x534721){if(_0x534721){_0x14d430['model']=_['keys'](db[_0xe8b0('0x9d')][_0xe8b0('0x68')]);_0x14d430[_0xe8b0('0x50')]=_['keys'](_0xaa1c79[_0xe8b0('0x50')]);_0x14d430[_0xe8b0('0x52')]=_[_0xe8b0('0x53')](_0x14d430[_0xe8b0('0x54')],_0x14d430['query']);_0x1cfb19[_0xe8b0('0x55')]=_[_0xe8b0('0x53')](_0x14d430[_0xe8b0('0x54')],qs[_0xe8b0('0x56')](_0xaa1c79[_0xe8b0('0x50')]['fields']));_0x1cfb19[_0xe8b0('0x55')]=_0x1cfb19[_0xe8b0('0x55')]['length']?_0x1cfb19[_0xe8b0('0x55')]:_0x14d430[_0xe8b0('0x54')];if(!_0xaa1c79[_0xe8b0('0x50')]['hasOwnProperty'](_0xe8b0('0x59'))){_0x1cfb19['limit']=qs[_0xe8b0('0x22')](_0xaa1c79[_0xe8b0('0x50')][_0xe8b0('0x22')]);_0x1cfb19[_0xe8b0('0x24')]=qs['offset'](_0xaa1c79['query'][_0xe8b0('0x24')]);}_0x1cfb19[_0xe8b0('0x5a')]=qs[_0xe8b0('0x5b')](_0xaa1c79[_0xe8b0('0x50')][_0xe8b0('0x5b')]);_0x1cfb19['where']=qs[_0xe8b0('0x52')](_[_0xe8b0('0x75')](_0xaa1c79[_0xe8b0('0x50')],_0x14d430[_0xe8b0('0x52')]));_0x1cfb19['where']['MailAccountId']=_0x534721['id'];if(_0xaa1c79['query']['filter']){_0x1cfb19[_0xe8b0('0x5c')]=_[_0xe8b0('0x5e')](_0x1cfb19[_0xe8b0('0x5c')],{'$or':_['map'](_0x1cfb19[_0xe8b0('0x55')],function(_0x15eb7a){var _0xe4ce77={};_0xe4ce77[_0x15eb7a]={'$like':'%'+_0xaa1c79[_0xe8b0('0x50')]['filter']+'%'};return _0xe4ce77;})});}if(_0xaa1c79[_0xe8b0('0x50')][_0xe8b0('0x9e')]){var _0x2f3cc6=_0xaa1c79[_0xe8b0('0x50')][_0xe8b0('0x9e')][_0xe8b0('0x9f')](',');var _0x66199e={};_0x66199e[_0x2f3cc6[0x0]]={'$gte':moment(_0x2f3cc6[0x1])[_0xe8b0('0xa0')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1cfb19['where']=_[_0xe8b0('0x5e')](_0x1cfb19[_0xe8b0('0x5c')],_0x66199e);}_0x1cfb19=_[_0xe8b0('0x5e')]({},_0x1cfb19,_0xaa1c79[_0xe8b0('0x60')]);return db['MailMessage']['count']({'where':_0x1cfb19[_0xe8b0('0x5c')]})[_0xe8b0('0x12')](function(_0x2980a0){_0x4e34d7[_0xe8b0('0x23')]=_0x2980a0;if(_0xaa1c79[_0xe8b0('0x50')][_0xe8b0('0x69')]){_0x1cfb19[_0xe8b0('0x61')]=[{'all':!![]}];}return db['MailMessage'][_0xe8b0('0x62')](_0x1cfb19);})[_0xe8b0('0x12')](function(_0x4d55f0){if(_0xaa1c79[_0xe8b0('0x50')]['inlineCss']===_0xe8b0('0xa1')){for(var _0xd230b3=0x0;_0xd230b3<_0x4d55f0[_0xe8b0('0x57')];_0xd230b3++){_0x4d55f0[_0xd230b3][_0xe8b0('0x6b')]=juice(_0x4d55f0[_0xd230b3][_0xe8b0('0x6b')]);}}_0x4e34d7[_0xe8b0('0x63')]=_0x4d55f0;return _0x4e34d7;});}})['then'](respondWithFilteredResult(_0x3a5a9a,_0x1cfb19))[_0xe8b0('0x1d')](handleError(_0x3a5a9a,null));};exports[_0xe8b0('0x2d')]=function(_0x552be9,_0x3a33b8){var _0x14056f,_0x2373e0={},_0x3fa9c3;if(_0x552be9[_0xe8b0('0x6b')]['to']){_0x3fa9c3=_0x552be9[_0xe8b0('0x6b')]['to']['split'](',')[0x0];}return db['MailAccount'][_0xe8b0('0x6a')]({'where':{'id':_0x552be9[_0xe8b0('0x65')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':_0xe8b0('0xa2'),'where':{'email':_0x3fa9c3},'limit':0x1,'order':[['updatedAt',_0xe8b0('0xa3')]]}]},{'model':db['MailServerOut'],'as':_0xe8b0('0x47'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xe8b0('0xa4'),'raw':!![]}]}]})[_0xe8b0('0x12')](handleEntityNotFound(_0x3a33b8,null))[_0xe8b0('0x12')](function(_0x582ec0){if(!_0x582ec0)return;_0x14056f=_0x582ec0;if(!_0x582ec0[_0xe8b0('0x47')])throw new Error('Smtp\x20configuration\x20not\x20found');if(_[_0xe8b0('0x7d')](_0x552be9[_0xe8b0('0x6b')]['from'])){_0x552be9['body'][_0xe8b0('0xa5')]=util['format']('%s\x20<%s>',_0x582ec0[_0xe8b0('0x4f')],_0x582ec0[_0xe8b0('0x7b')]||_0x582ec0['Smtp']['user']);}if(_0x552be9[_0xe8b0('0x6b')][_0xe8b0('0xa6')]&&_0x552be9[_0xe8b0('0x6b')][_0xe8b0('0xa6')][_0xe8b0('0x57')]){for(var _0x3b7ad3=0x0;_0x3b7ad3<_0x552be9[_0xe8b0('0x6b')][_0xe8b0('0xa6')][_0xe8b0('0x57')];_0x3b7ad3+=0x1){_0x552be9[_0xe8b0('0x6b')][_0xe8b0('0xa6')][_0x3b7ad3]={'filename':_0x552be9[_0xe8b0('0x6b')][_0xe8b0('0xa6')][_0x3b7ad3][_0xe8b0('0x4f')],'path':path[_0xe8b0('0xa7')](config[_0xe8b0('0xa8')],_0xe8b0('0xa9'),_0x552be9[_0xe8b0('0x6b')][_0xe8b0('0xa6')][_0x3b7ad3][_0xe8b0('0xaa')])};}}var _0x534726=_0x582ec0[_0xe8b0('0xab')]();return respondWithRpcPromise(_0xe8b0('0xac'),'sendMail',{'account':_0x534726,'message':_0x552be9[_0xe8b0('0x6b')]});})['then'](function(_0x4864b4){if(!_0x4864b4)return;_0x2373e0=_0x4864b4;if(!_0x14056f['List'])throw new Error(_0xe8b0('0xad'));if(_0x14056f[_0xe8b0('0xae')][_0xe8b0('0xa2')]['length'])return _0x14056f[_0xe8b0('0xae')][_0xe8b0('0xa2')][0x0];return db[_0xe8b0('0xaf')][_0xe8b0('0x71')](_[_0xe8b0('0xb')](_0x552be9['body'],{'firstName':_0x552be9['body']['to'],'email':_0x552be9[_0xe8b0('0x6b')]['to'],'phone':_0x552be9[_0xe8b0('0x6b')]['to'],'ListId':_0x14056f['ListId']}));})[_0xe8b0('0x12')](function(_0xa6cbd1){if(!_0xa6cbd1)return;var _0x5cd616={'UserId':_0x552be9[_0xe8b0('0x3b')]['id'],'ContactId':_0xa6cbd1['id'],'MailAccountId':_0x14056f['id'],'inReplyTo':_0x2373e0['messageId'],'to':_0x552be9['body'][_0xe8b0('0xa5')],'cc':_0x552be9[_0xe8b0('0x6b')]['cc'],'subject':_0x552be9[_0xe8b0('0x6b')][_0xe8b0('0xb0')],'attach':_0x552be9[_0xe8b0('0x6b')][_0xe8b0('0xb1')],'firstMsgDirection':_0xe8b0('0xb2'),'lastMsgAt':moment()[_0xe8b0('0xa0')](_0xe8b0('0xb3')),'lastMsgDirection':'out','Messages':[_[_0xe8b0('0x5e')](_0x552be9[_0xe8b0('0x6b')],{'messageId':_0x2373e0['messageId'],'sentAt':moment()[_0xe8b0('0xa0')](_0xe8b0('0xb3')),'read':!![],'MailAccountId':_0x14056f['id'],'UserId':_0x552be9[_0xe8b0('0x3b')]['id'],'ContactId':_0xa6cbd1['id']})]};if(_0x552be9[_0xe8b0('0x6b')][_0xe8b0('0xb4')]){_0x5cd616=_[_0xe8b0('0x5e')](_0x5cd616,_0x552be9['body'][_0xe8b0('0xb4')]);}return db[_0xe8b0('0x8e')][_0xe8b0('0x71')](_0x5cd616,{'include':[{'model':db['MailMessage'],'as':_0xe8b0('0xb5')}]});})[_0xe8b0('0x12')](respondWithResult(_0x3a33b8,null))[_0xe8b0('0x1d')](handleError(_0x3a33b8,null));};exports[_0xe8b0('0xb6')]=function(_0x2f3fa5,_0x1d988c){return db[_0xe8b0('0x4c')][_0xe8b0('0x6a')]({'where':{'id':_0x2f3fa5[_0xe8b0('0x65')]['id']},'include':[{'model':db[_0xe8b0('0x49')],'as':_0xe8b0('0x47'),'raw':!![],'include':[{'model':db[_0xe8b0('0xa4')],'as':_0xe8b0('0xa4'),'raw':!![]}]}]})[_0xe8b0('0x12')](handleEntityNotFound(_0x1d988c,null))[_0xe8b0('0x12')](function(_0x4d6076){if(!_0x4d6076[_0xe8b0('0x47')])return;var _0x48899e=_0x4d6076[_0xe8b0('0xab')]();return respondWithRpcPromise('VerifySmtp','verifySmtp',{'account':_0x48899e});})[_0xe8b0('0x12')](respondWithResult(_0x1d988c,null))['catch'](handleError(_0x1d988c,null));};exports[_0xe8b0('0x28')]=function(_0x5077da,_0x37ab51){return db[_0xe8b0('0x4c')][_0xe8b0('0x6a')]({'where':{'id':_0x5077da[_0xe8b0('0x65')]['id']}})[_0xe8b0('0x12')](handleEntityNotFound(_0x37ab51,null))[_0xe8b0('0x12')](function(_0x30ed17){if(_0x30ed17&&_0x30ed17[_0xe8b0('0x43')]){throw new db['Sequelize'][(_0xe8b0('0xb7'))](_0xe8b0('0xb8'));}return _0x30ed17;})[_0xe8b0('0x12')](removeEntity(_0x37ab51,null))[_0xe8b0('0x1d')](handleError(_0x37ab51,null));};exports['addAgents']=function(_0x10fe30,_0x4aacfd){return db['MailAccount'][_0xe8b0('0x6a')]({'where':{'id':_0x10fe30[_0xe8b0('0x65')]['id']}})[_0xe8b0('0x12')](handleEntityNotFound(_0x4aacfd,null))[_0xe8b0('0x12')](function(_0x52433d){if(_0x52433d){return _0x52433d[_0xe8b0('0xb9')](_0x10fe30[_0xe8b0('0x6b')][_0xe8b0('0x77')],_[_0xe8b0('0x8f')](_0x10fe30[_0xe8b0('0x6b')],[_0xe8b0('0x77'),'id'])||{})['spread'](function(_0x2361ca){for(var _0x66213a=0x0;_0x66213a<_0x10fe30[_0xe8b0('0x6b')][_0xe8b0('0x77')][_0xe8b0('0x57')];_0x66213a+=0x1){socket[_0xe8b0('0xba')](_0xe8b0('0xbb'),{'UserId':Number(_0x10fe30[_0xe8b0('0x6b')][_0xe8b0('0x77')][_0x66213a]),'MailAccountId':Number(_0x10fe30[_0xe8b0('0x65')]['id'])});}return _0x2361ca;});}})[_0xe8b0('0x12')](respondWithResult(_0x4aacfd,null))[_0xe8b0('0x1d')](handleError(_0x4aacfd,null));};exports['removeAgents']=function(_0x175ddc,_0x5aaba5){return db[_0xe8b0('0x4c')][_0xe8b0('0x6a')]({'where':{'id':_0x175ddc['params']['id']}})[_0xe8b0('0x12')](handleEntityNotFound(_0x5aaba5,null))[_0xe8b0('0x12')](function(_0x59775c){if(_0x59775c){return _0x59775c[_0xe8b0('0xbc')](_0x175ddc['query'][_0xe8b0('0x77')])['then'](function(){if(_[_0xe8b0('0xbd')](_0x175ddc[_0xe8b0('0x50')][_0xe8b0('0x77')])){for(var _0x538adf=0x0;_0x538adf<_0x175ddc[_0xe8b0('0x50')][_0xe8b0('0x77')][_0xe8b0('0x57')];_0x538adf+=0x1){socket[_0xe8b0('0xba')](_0xe8b0('0xbe'),{'UserId':Number(_0x175ddc[_0xe8b0('0x50')]['ids'][_0x538adf]),'MailAccountId':Number(_0x175ddc[_0xe8b0('0x65')]['id'])});}}else{socket['emit'](_0xe8b0('0xbe'),{'UserId':Number(_0x175ddc[_0xe8b0('0x50')][_0xe8b0('0x77')]),'MailAccountId':Number(_0x175ddc['params']['id'])});}});}})['then'](respondWithStatusCode(_0x5aaba5,null))[_0xe8b0('0x1d')](handleError(_0x5aaba5,null));};exports[_0xe8b0('0xbf')]=function(_0x75eb2c,_0x57f5e5){var _0x50954e={};var _0xa75b93={};var _0x55657e;var _0x88d485;return db[_0xe8b0('0x4c')]['findOne']({'where':{'id':_0x75eb2c[_0xe8b0('0x65')]['id']}})[_0xe8b0('0x12')](handleEntityNotFound(_0x57f5e5,null))['then'](function(_0x1c8bd9){if(_0x1c8bd9){_0x55657e=_0x1c8bd9;_0xa75b93[_0xe8b0('0x54')]=_[_0xe8b0('0x51')](db[_0xe8b0('0xc0')][_0xe8b0('0x68')]);_0xa75b93[_0xe8b0('0x50')]=_[_0xe8b0('0x51')](_0x75eb2c[_0xe8b0('0x50')]);_0xa75b93[_0xe8b0('0x52')]=_['intersection'](_0xa75b93[_0xe8b0('0x54')],_0xa75b93[_0xe8b0('0x50')]);_0x50954e[_0xe8b0('0x55')]=_[_0xe8b0('0x53')](_0xa75b93[_0xe8b0('0x54')],qs['fields'](_0x75eb2c[_0xe8b0('0x50')][_0xe8b0('0x56')]));_0x50954e['attributes']=_0x50954e[_0xe8b0('0x55')][_0xe8b0('0x57')]?_0x50954e['attributes']:_0xa75b93[_0xe8b0('0x54')];_0x50954e[_0xe8b0('0x5a')]=qs[_0xe8b0('0x5b')](_0x75eb2c[_0xe8b0('0x50')][_0xe8b0('0x5b')]);_0x50954e[_0xe8b0('0x5c')]=qs[_0xe8b0('0x52')](_[_0xe8b0('0x75')](_0x75eb2c[_0xe8b0('0x50')],_0xa75b93[_0xe8b0('0x52')]));if(_0x75eb2c[_0xe8b0('0x50')][_0xe8b0('0x5d')]){_0x50954e[_0xe8b0('0x5c')]=_[_0xe8b0('0x5e')](_0x50954e[_0xe8b0('0x5c')],{'$or':_[_0xe8b0('0x4b')](_0x50954e[_0xe8b0('0x55')],function(_0x5167bc){var _0x490251={};_0x490251[_0x5167bc]={'$like':'%'+_0x75eb2c[_0xe8b0('0x50')][_0xe8b0('0x5d')]+'%'};return _0x490251;})});}_0x50954e=_[_0xe8b0('0x5e')]({},_0x50954e,_0x75eb2c['options']);return _0x55657e[_0xe8b0('0xbf')](_0x50954e);}})['then'](function(_0x586c31){if(_0x586c31){_0x88d485=_0x586c31[_0xe8b0('0x57')];if(!_0x75eb2c['query']['hasOwnProperty'](_0xe8b0('0x59'))){_0x50954e['limit']=qs[_0xe8b0('0x22')](_0x75eb2c[_0xe8b0('0x50')][_0xe8b0('0x22')]);_0x50954e[_0xe8b0('0x24')]=qs['offset'](_0x75eb2c[_0xe8b0('0x50')][_0xe8b0('0x24')]);}return _0x55657e['getAgents'](_0x50954e);}})[_0xe8b0('0x12')](function(_0x2aa17f){if(_0x2aa17f){return _0x2aa17f?{'count':_0x88d485,'rows':_0x2aa17f}:null;}})[_0xe8b0('0x12')](respondWithResult(_0x57f5e5,null))[_0xe8b0('0x1d')](handleError(_0x57f5e5,null));}; \ No newline at end of file +var _0x978c=['addAgents','omit','spread','emit','removeAgents','isArray','userMailAccount:remove','getAgents','moment','lodash','juice','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','get','MailAccounts','stack','name','send','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','gmail','smtp-mail.outlook.com','password','pass','CloudProviderId','host','port','secure','service','authentication','user','username','Imap','index','Smtp','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','MailAccount','rawAttributes','find','body','provider','custom','modernAuthentication','describe','addDisposition','MailAccountId','Disposition','create','hasOwnProperty','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','email','ListId','isNil','active','description','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','removeImap','setImap','getSmtp','removeSmtp','addInteraction','getInteractions','MailInteraction','Contact','Owner','fullname','Tag','Tags','color','tag','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmContact','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','attachments','root','server/files/attachments','basename','getSmtpOptions','SendMail','List','List\x20not\x20found','Contacts','messageId','subject','attach','out','Messages','VerifySmtp','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account'];(function(_0x284c77,_0xe71aea){var _0x49a322=function(_0xb598d){while(--_0xb598d){_0x284c77['push'](_0x284c77['shift']());}};_0x49a322(++_0xe71aea);}(_0x978c,0xc4));var _0xc978=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0x978c[_0x43d11d];return _0x38cd08;};'use strict';var moment=require(_0xc978('0x0'));var BPromise=require('bluebird');var util=require('util');var path=require('path');var _=require(_0xc978('0x1'));var juice=require(_0xc978('0x2'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xc978('0x3'))(_0xc978('0x4'));var config=require(_0xc978('0x5'));var db=require(_0xc978('0x6'))['db'];config[_0xc978('0x7')]=_[_0xc978('0x8')](config[_0xc978('0x7')],{'host':_0xc978('0x9'),'port':0x18eb});var socket=require(_0xc978('0xa'))(new Redis(config['redis']));require(_0xc978('0xb'))[_0xc978('0xc')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232b});function respondWithRpcPromise(_0x1f0587,_0x574707,_0x1094cc,_0x33ebee){return new BPromise(function(_0x398c49,_0x1d83dd){var _0x274144=_0x33ebee||client;return _0x274144[_0xc978('0xd')](_0x1f0587,_0x1094cc)[_0xc978('0xe')](function(_0x30d1c9){logger[_0xc978('0xf')](_0xc978('0x10'),_0x574707,_0xc978('0x11'));logger[_0xc978('0x12')](_0xc978('0x13'),_0x574707,_0xc978('0x11'),JSON['stringify'](_0x30d1c9));if(_0x30d1c9[_0xc978('0x14')]){if(_0x30d1c9[_0xc978('0x14')][_0xc978('0x15')]===0x1f4){logger['error'](_0xc978('0x10'),_0x574707,_0x30d1c9[_0xc978('0x14')][_0xc978('0x16')]);return _0x1d83dd(_0x30d1c9[_0xc978('0x14')][_0xc978('0x16')]);}logger[_0xc978('0x14')](_0xc978('0x10'),_0x574707,_0x30d1c9[_0xc978('0x14')]['message']);return _0x398c49(_0x30d1c9[_0xc978('0x14')]['message']);}else{logger['info'](_0xc978('0x10'),_0x574707,_0xc978('0x11'));_0x398c49(_0x30d1c9['result'][_0xc978('0x16')]);}})['catch'](function(_0x4059af){logger['error'](_0xc978('0x10'),_0x574707,_0x4059af);_0x1d83dd(_0x4059af);});});}function respondWithStatusCode(_0x27dd46,_0x22338c){_0x22338c=_0x22338c||0xcc;return function(_0x5a6d5b){if(_0x5a6d5b){return _0x27dd46[_0xc978('0x17')](_0x22338c);}return _0x27dd46[_0xc978('0x18')](_0x22338c)[_0xc978('0x19')]();};}function respondWithResult(_0x18fc03,_0x11a722){_0x11a722=_0x11a722||0xc8;return function(_0x1da50b){if(_0x1da50b){return _0x18fc03[_0xc978('0x18')](_0x11a722)[_0xc978('0x1a')](_0x1da50b);}};}function respondWithFilteredResult(_0x422332,_0x2a581e){return function(_0x2b97fc){if(_0x2b97fc){var _0x57639a=typeof _0x2a581e[_0xc978('0x1b')]===_0xc978('0x1c')&&typeof _0x2a581e[_0xc978('0x1d')]===_0xc978('0x1c');var _0x4d430d=_0x2b97fc[_0xc978('0x1e')];var _0x46323b=_0x57639a?0x0:_0x2a581e[_0xc978('0x1b')];var _0x4cc1a9=_0x57639a?_0x2b97fc[_0xc978('0x1e')]:_0x2a581e[_0xc978('0x1b')]+_0x2a581e[_0xc978('0x1d')];var _0x402807;if(_0x4cc1a9>=_0x4d430d){_0x4cc1a9=_0x4d430d;_0x402807=0xc8;}else{_0x402807=0xce;}_0x422332[_0xc978('0x18')](_0x402807);return _0x422332[_0xc978('0x1f')](_0xc978('0x20'),_0x46323b+'-'+_0x4cc1a9+'/'+_0x4d430d)[_0xc978('0x1a')](_0x2b97fc);}return null;};}function saveUpdates(_0x48af17){return function(_0x236070){if(_0x236070){return _0x236070[_0xc978('0x21')](_0x48af17)[_0xc978('0xe')](function(_0xdc92f9){return _0xdc92f9;});}return null;};}function removeEntity(_0x84180e){return function(_0x26b47c){if(_0x26b47c){return _0x26b47c[_0xc978('0x22')]()[_0xc978('0xe')](function(){var _0x537da1=_0x26b47c[_0xc978('0x23')]({'plain':!![]});var _0x218049=_0xc978('0x24');return db['UserProfileResource'][_0xc978('0x22')]({'where':{'type':_0x218049,'resourceId':_0x537da1['id']}})[_0xc978('0xe')](function(){return _0x26b47c;});})['then'](function(){_0x84180e[_0xc978('0x18')](0xcc)[_0xc978('0x19')]();});}};}function handleEntityNotFound(_0xfc79d4){return function(_0x4dac93){if(!_0x4dac93){_0xfc79d4[_0xc978('0x17')](0x194);}return _0x4dac93;};}function handleError(_0x4eda34,_0x2e491f){_0x2e491f=_0x2e491f||0x1f4;return function(_0x1b62a5){logger[_0xc978('0x14')](_0x1b62a5[_0xc978('0x25')]);if(_0x1b62a5['name']){delete _0x1b62a5[_0xc978('0x26')];}_0x4eda34['status'](_0x2e491f)[_0xc978('0x27')](_0x1b62a5);};}function getImapHost(_0x53d66a){switch(_0x53d66a){case'gmail':return _0xc978('0x28');case _0xc978('0x29'):return _0xc978('0x2a');case _0xc978('0x2b'):return'imap-mail.outlook.com';case _0xc978('0x2c'):return _0xc978('0x2d');}throw new Error(_0xc978('0x2e'),_0x53d66a);}function getSmtpHost(_0x1e42a8){switch(_0x1e42a8){case _0xc978('0x2f'):return'smtp.gmail.com';case _0xc978('0x29'):return'smtp.mail.yahoo.com';case'hotmail':return _0xc978('0x30');case'outlook365':return'smtp.office365.com';}throw new Error(_0xc978('0x2e'),_0x1e42a8);}function getAuthenticationOptions(_0x3d050f,_0x462a4f){var _0x263ecf={};var _0xde1e6b={};if(_0x3d050f){_0x263ecf['user']=_0xde1e6b['user']=_0x462a4f['username'];_0x263ecf[_0xc978('0x31')]=_0xde1e6b[_0xc978('0x32')]=_0x462a4f[_0xc978('0x31')];if(_0x462a4f['modernAuthentication']){_0x263ecf['modernAuthentication']=_0xde1e6b['modernAuthentication']=!![];_0x263ecf[_0xc978('0x33')]=_0xde1e6b['CloudProviderId']=_0x462a4f[_0xc978('0x33')];_0x263ecf[_0xc978('0x31')]=_0xde1e6b[_0xc978('0x32')]=null;}else{_0x263ecf[_0xc978('0x33')]=_0xde1e6b[_0xc978('0x33')]=null;}_0x263ecf[_0xc978('0x34')]=getImapHost(_0x3d050f);_0x263ecf[_0xc978('0x35')]=0x3e1;_0xde1e6b[_0xc978('0x34')]=getSmtpHost(_0x3d050f);_0xde1e6b[_0xc978('0x35')]=0x24b;_0xde1e6b[_0xc978('0x36')]=![];_0x263ecf[_0xc978('0x37')]=_0xde1e6b['service']=null;}else{if(_0x462a4f[_0xc978('0x38')]){_0x263ecf[_0xc978('0x39')]=_0xde1e6b['user']=_0x462a4f[_0xc978('0x3a')];_0x263ecf['password']=_0xde1e6b[_0xc978('0x32')]=_0x462a4f['password'];}else{_0x263ecf['authentication']=_0xde1e6b[_0xc978('0x38')]=![];_0x263ecf['user']=_0xde1e6b['user']=null;_0x263ecf['password']=_0xde1e6b[_0xc978('0x32')]=null;}_0x263ecf[_0xc978('0x34')]=_0x462a4f[_0xc978('0x3b')]['host'];_0x263ecf['port']=_0x462a4f['Imap'][_0xc978('0x35')];_0xde1e6b['host']=_0x462a4f['Smtp'][_0xc978('0x34')];_0xde1e6b[_0xc978('0x35')]=_0x462a4f['Smtp'][_0xc978('0x35')];}return{'Imap':_0x263ecf,'Smtp':_0xde1e6b};}exports[_0xc978('0x3c')]=function(_0x217b23,_0x2e2379){var _0x5405db={'include':[{'model':db['MailServerIn'],'as':_0xc978('0x3b')},{'model':db['MailServerOut'],'as':_0xc978('0x3d')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x497987={},_0x20794a={'count':0x0,'rows':[]};var _0x1e4fee=_['map'](db['MailAccount']['rawAttributes'],function(_0x1fbcdb){return{'name':_0x1fbcdb[_0xc978('0x3e')],'type':_0x1fbcdb[_0xc978('0x3f')][_0xc978('0x40')]};});_0x497987['model']=_['map'](_0x1e4fee,'name');_0x497987[_0xc978('0x41')]=_[_0xc978('0x42')](_0x217b23[_0xc978('0x41')]);_0x497987[_0xc978('0x43')]=_[_0xc978('0x44')](_0x497987[_0xc978('0x45')],_0x497987['query']);_0x5405db[_0xc978('0x46')]=_['intersection'](_0x497987[_0xc978('0x45')],qs[_0xc978('0x47')](_0x217b23['query'][_0xc978('0x47')]));_0x5405db[_0xc978('0x46')]=_0x5405db[_0xc978('0x46')][_0xc978('0x48')]?_0x5405db[_0xc978('0x46')]:_0x497987[_0xc978('0x45')];if(!_0x217b23['query']['hasOwnProperty'](_0xc978('0x49'))){_0x5405db['limit']=qs[_0xc978('0x1d')](_0x217b23[_0xc978('0x41')][_0xc978('0x1d')]);_0x5405db['offset']=qs['offset'](_0x217b23['query'][_0xc978('0x1b')]);}_0x5405db[_0xc978('0x4a')]=qs[_0xc978('0x4b')](_0x217b23[_0xc978('0x41')][_0xc978('0x4b')]);_0x5405db['where']=qs[_0xc978('0x43')](_[_0xc978('0x4c')](_0x217b23['query'],_0x497987[_0xc978('0x43')]),_0x1e4fee);if(_0x217b23[_0xc978('0x41')][_0xc978('0x4d')]){_0x5405db[_0xc978('0x4e')]=_[_0xc978('0x4f')](_0x5405db[_0xc978('0x4e')],{'$or':_[_0xc978('0x50')](_0x1e4fee,function(_0x5786fa){if(_0x5786fa[_0xc978('0x3f')]!==_0xc978('0x51')){var _0x3c100f={};_0x3c100f[_0x5786fa[_0xc978('0x26')]]={'$like':'%'+_0x217b23[_0xc978('0x41')][_0xc978('0x4d')]+'%'};return _0x3c100f;}})});}_0x5405db=_[_0xc978('0x4f')]({},_0x5405db,_0x217b23[_0xc978('0x52')]);var _0xaa65dc={'where':_0x5405db['where']};return db['MailAccount'][_0xc978('0x1e')](_0xaa65dc)[_0xc978('0xe')](function(_0x1cc4dd){_0x20794a['count']=_0x1cc4dd;if(_0x217b23[_0xc978('0x41')][_0xc978('0x53')]){_0x5405db[_0xc978('0x54')]=[{'all':!![]}];}return db['MailAccount'][_0xc978('0x55')](_0x5405db);})['then'](function(_0x2668fb){_0x20794a[_0xc978('0x56')]=_0x2668fb;return _0x20794a;})[_0xc978('0xe')](respondWithFilteredResult(_0x2e2379,_0x5405db))[_0xc978('0x57')](handleError(_0x2e2379,null));};exports[_0xc978('0x58')]=function(_0x5efa49,_0x137faa){var _0x7f8253={'raw':![],'where':{'id':_0x5efa49[_0xc978('0x59')]['id']},'include':[{'model':db[_0xc978('0x5a')],'as':'Imap'},{'model':db[_0xc978('0x5b')],'as':_0xc978('0x3d')},{'model':db[_0xc978('0x5c')],'as':_0xc978('0x5d')}]},_0x596248={};_0x596248[_0xc978('0x45')]=_[_0xc978('0x42')](db[_0xc978('0x5e')][_0xc978('0x5f')]);_0x596248[_0xc978('0x41')]=_['keys'](_0x5efa49[_0xc978('0x41')]);_0x596248[_0xc978('0x43')]=_['intersection'](_0x596248['model'],_0x596248[_0xc978('0x41')]);_0x7f8253[_0xc978('0x46')]=_[_0xc978('0x44')](_0x596248[_0xc978('0x45')],qs['fields'](_0x5efa49[_0xc978('0x41')][_0xc978('0x47')]));_0x7f8253[_0xc978('0x46')]=_0x7f8253[_0xc978('0x46')]['length']?_0x7f8253[_0xc978('0x46')]:_0x596248['model'];if(_0x5efa49['query']['includeAll']){_0x7f8253[_0xc978('0x54')]=[{'all':!![]}];}_0x7f8253=_[_0xc978('0x4f')]({},_0x7f8253,_0x5efa49[_0xc978('0x52')]);return db['MailAccount'][_0xc978('0x60')](_0x7f8253)[_0xc978('0xe')](handleEntityNotFound(_0x137faa,null))[_0xc978('0xe')](respondWithResult(_0x137faa,null))[_0xc978('0x57')](handleError(_0x137faa,null));};exports[_0xc978('0x21')]=function(_0x3b6f64,_0x20f3f3){if(_0x3b6f64['body']['id']){delete _0x3b6f64[_0xc978('0x61')]['id'];}var _0x122ecb=_0x3b6f64[_0xc978('0x61')][_0xc978('0x62')]===_0xc978('0x63')?null:_0x3b6f64[_0xc978('0x61')]['provider'];var _0x473ec0=_0x3b6f64['body'][_0xc978('0x3b')]||{};var _0x5bda24=_0x3b6f64['body'][_0xc978('0x3d')]||{};if(_0x122ecb){_0x473ec0[_0xc978('0x34')]=getImapHost(_0x122ecb);_0x473ec0[_0xc978('0x35')]=0x3e1;_0x5bda24[_0xc978('0x34')]=getSmtpHost(_0x122ecb);_0x5bda24[_0xc978('0x35')]=0x24b;_0x5bda24['secure']=![];}if(_0x5bda24[_0xc978('0x64')]){_0x5bda24[_0xc978('0x36')]=![];}else{_0x5bda24[_0xc978('0x33')]=null;}if(!_0x473ec0[_0xc978('0x64')])_0x473ec0['CloudProviderId']=null;_0x3b6f64[_0xc978('0x61')][_0xc978('0x3b')]=_0x473ec0;_0x3b6f64[_0xc978('0x61')]['Smtp']=_0x5bda24;return db[_0xc978('0x5e')][_0xc978('0x60')]({'where':{'id':_0x3b6f64[_0xc978('0x59')]['id']},'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0xc978('0x5c')],'as':_0xc978('0x5d')}]})['then'](handleEntityNotFound(_0x20f3f3,null))['then'](function(_0x46a425){if(!_0x46a425)throw new Error('Mail\x20Account\x20not\x20found');if(_0x46a425[_0xc978('0x37')])delete _0x3b6f64[_0xc978('0x61')][_0xc978('0x3b')];return _0x46a425;})[_0xc978('0xe')](saveUpdates(_0x3b6f64[_0xc978('0x61')],null))['then'](function(_0x5664f3){if(!_0x3b6f64[_0xc978('0x61')][_0xc978('0x3b')])return _0x5664f3;return db[_0xc978('0x5a')][_0xc978('0x21')](_0x3b6f64[_0xc978('0x61')][_0xc978('0x3b')],{'where':{'MailAccountId':_0x5664f3['id']}})[_0xc978('0xe')](function(){return _0x5664f3;});})[_0xc978('0xe')](function(_0x3e25c8){if(!_0x3b6f64['body']['Smtp'])return _0x3e25c8;return db[_0xc978('0x5b')][_0xc978('0x21')](_0x3b6f64[_0xc978('0x61')]['Smtp'],{'where':{'MailAccountId':_0x3e25c8['id']}})[_0xc978('0xe')](function(){return _0x3e25c8;});})['then'](respondWithResult(_0x20f3f3,null))[_0xc978('0x57')](handleError(_0x20f3f3,null));};exports['describe']=function(_0x5bcf42,_0xd849e9){return db[_0xc978('0x5e')][_0xc978('0x65')]()[_0xc978('0xe')](respondWithResult(_0xd849e9,null))[_0xc978('0x57')](handleError(_0xd849e9,null));};exports[_0xc978('0x66')]=function(_0x249f23,_0x53e4dd){if(_0x249f23[_0xc978('0x61')]['id']){delete _0x249f23['body']['id'];}return db[_0xc978('0x5e')][_0xc978('0x60')]({'where':{'id':_0x249f23['params']['id']}})[_0xc978('0xe')](handleEntityNotFound(_0x53e4dd,null))['then'](function(_0x338db5){if(_0x338db5){_0x249f23['body'][_0xc978('0x67')]=_0x338db5['id'];return db[_0xc978('0x68')][_0xc978('0x69')](_0x249f23[_0xc978('0x61')]);}})[_0xc978('0xe')](respondWithResult(_0x53e4dd,null))[_0xc978('0x57')](handleError(_0x53e4dd,null));};exports['getDispositions']=function(_0x479ebc,_0x39111b){var _0x2a1ccc={'raw':![],'where':{}};var _0x59050c={};var _0x42276e={'count':0x0,'rows':[]};return db[_0xc978('0x5e')]['findOne']({'where':{'id':_0x479ebc[_0xc978('0x59')]['id']}})[_0xc978('0xe')](handleEntityNotFound(_0x39111b,null))[_0xc978('0xe')](function(_0x11f18d){if(_0x11f18d){_0x59050c['model']=_['keys'](db[_0xc978('0x68')][_0xc978('0x5f')]);_0x59050c['query']=_[_0xc978('0x42')](_0x479ebc[_0xc978('0x41')]);_0x59050c[_0xc978('0x43')]=_[_0xc978('0x44')](_0x59050c[_0xc978('0x45')],_0x59050c['query']);_0x2a1ccc[_0xc978('0x46')]=_[_0xc978('0x44')](_0x59050c[_0xc978('0x45')],qs[_0xc978('0x47')](_0x479ebc[_0xc978('0x41')][_0xc978('0x47')]));_0x2a1ccc[_0xc978('0x46')]=_0x2a1ccc[_0xc978('0x46')]['length']?_0x2a1ccc[_0xc978('0x46')]:_0x59050c[_0xc978('0x45')];if(!_0x479ebc['query'][_0xc978('0x6a')]('nolimit')){_0x2a1ccc[_0xc978('0x1d')]=qs[_0xc978('0x1d')](_0x479ebc[_0xc978('0x41')][_0xc978('0x1d')]);_0x2a1ccc['offset']=qs[_0xc978('0x1b')](_0x479ebc[_0xc978('0x41')][_0xc978('0x1b')]);}_0x2a1ccc[_0xc978('0x4a')]=qs[_0xc978('0x4b')](_0x479ebc[_0xc978('0x41')][_0xc978('0x4b')]);_0x2a1ccc['where']=qs[_0xc978('0x43')](_[_0xc978('0x4c')](_0x479ebc['query'],_0x59050c[_0xc978('0x43')]));_0x2a1ccc['where'][_0xc978('0x67')]=_0x11f18d['id'];if(_0x479ebc[_0xc978('0x41')][_0xc978('0x4d')]){_0x2a1ccc['where']=_['merge'](_0x2a1ccc['where'],{'$or':_[_0xc978('0x50')](_0x2a1ccc[_0xc978('0x46')],function(_0x1be856){var _0x31dcc0={};_0x31dcc0[_0x1be856]={'$like':'%'+_0x479ebc[_0xc978('0x41')][_0xc978('0x4d')]+'%'};return _0x31dcc0;})});}_0x2a1ccc=_[_0xc978('0x4f')]({},_0x2a1ccc,_0x479ebc[_0xc978('0x52')]);return db['Disposition']['count']({'where':_0x2a1ccc['where']})[_0xc978('0xe')](function(_0x3d553b){_0x42276e['count']=_0x3d553b;if(_0x479ebc[_0xc978('0x41')][_0xc978('0x53')]){_0x2a1ccc[_0xc978('0x54')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x2a1ccc);})[_0xc978('0xe')](function(_0x23bfe2){_0x42276e[_0xc978('0x56')]=_0x23bfe2;return _0x42276e;});}})[_0xc978('0xe')](respondWithFilteredResult(_0x39111b,_0x2a1ccc))[_0xc978('0x57')](handleError(_0x39111b,null));};exports[_0xc978('0x6b')]=function(_0x4e02b9,_0x141be8){return db['MailAccount'][_0xc978('0x60')]({'where':{'id':_0x4e02b9[_0xc978('0x59')]['id']}})[_0xc978('0xe')](handleEntityNotFound(_0x141be8,null))[_0xc978('0xe')](function(_0x3ebd84){if(_0x3ebd84){return _0x3ebd84['removeDispositions'](_0x4e02b9[_0xc978('0x41')][_0xc978('0x6c')]);}})[_0xc978('0xe')](respondWithStatusCode(_0x141be8,null))[_0xc978('0x57')](handleError(_0x141be8,null));};exports[_0xc978('0x6d')]=function(_0x257c8c,_0x2e5c11){if(_0x257c8c[_0xc978('0x61')]['id']){delete _0x257c8c['body']['id'];}return db['MailAccount'][_0xc978('0x60')]({'where':{'id':_0x257c8c['params']['id']}})[_0xc978('0xe')](handleEntityNotFound(_0x2e5c11,null))[_0xc978('0xe')](function(_0x18b0d4){if(_0x18b0d4){_0x257c8c['body'][_0xc978('0x67')]=_0x18b0d4['id'];return db[_0xc978('0x6e')][_0xc978('0x69')](_0x257c8c[_0xc978('0x61')]);}})[_0xc978('0xe')](respondWithResult(_0x2e5c11,null))[_0xc978('0x57')](handleError(_0x2e5c11,null));};exports[_0xc978('0x6f')]=function(_0x1908e2,_0x3b205e){var _0x267c3e={'raw':![],'where':{}};var _0x4cd9a6={};var _0x5186e0={'count':0x0,'rows':[]};return db[_0xc978('0x5e')][_0xc978('0x70')]({'where':{'id':_0x1908e2[_0xc978('0x59')]['id']}})['then'](handleEntityNotFound(_0x3b205e,null))[_0xc978('0xe')](function(_0x475935){if(_0x475935){_0x4cd9a6[_0xc978('0x45')]=_[_0xc978('0x42')](db[_0xc978('0x6e')][_0xc978('0x5f')]);_0x4cd9a6[_0xc978('0x41')]=_[_0xc978('0x42')](_0x1908e2[_0xc978('0x41')]);_0x4cd9a6[_0xc978('0x43')]=_[_0xc978('0x44')](_0x4cd9a6[_0xc978('0x45')],_0x4cd9a6[_0xc978('0x41')]);_0x267c3e[_0xc978('0x46')]=_[_0xc978('0x44')](_0x4cd9a6[_0xc978('0x45')],qs[_0xc978('0x47')](_0x1908e2[_0xc978('0x41')][_0xc978('0x47')]));_0x267c3e[_0xc978('0x46')]=_0x267c3e[_0xc978('0x46')]['length']?_0x267c3e[_0xc978('0x46')]:_0x4cd9a6[_0xc978('0x45')];if(!_0x1908e2[_0xc978('0x41')]['hasOwnProperty'](_0xc978('0x49'))){_0x267c3e[_0xc978('0x1d')]=qs[_0xc978('0x1d')](_0x1908e2[_0xc978('0x41')][_0xc978('0x1d')]);_0x267c3e[_0xc978('0x1b')]=qs[_0xc978('0x1b')](_0x1908e2[_0xc978('0x41')][_0xc978('0x1b')]);}_0x267c3e['order']=qs[_0xc978('0x4b')](_0x1908e2[_0xc978('0x41')][_0xc978('0x4b')]);_0x267c3e[_0xc978('0x4e')]=qs[_0xc978('0x43')](_['pick'](_0x1908e2[_0xc978('0x41')],_0x4cd9a6[_0xc978('0x43')]));_0x267c3e[_0xc978('0x4e')][_0xc978('0x67')]=_0x475935['id'];if(_0x1908e2[_0xc978('0x41')][_0xc978('0x4d')]){_0x267c3e['where']=_[_0xc978('0x4f')](_0x267c3e[_0xc978('0x4e')],{'$or':_['map'](_0x267c3e[_0xc978('0x46')],function(_0x1fcf7f){var _0x33f5f4={};_0x33f5f4[_0x1fcf7f]={'$like':'%'+_0x1908e2[_0xc978('0x41')][_0xc978('0x4d')]+'%'};return _0x33f5f4;})});}_0x267c3e=_[_0xc978('0x4f')]({},_0x267c3e,_0x1908e2[_0xc978('0x52')]);return db['CannedAnswer'][_0xc978('0x1e')]({'where':_0x267c3e[_0xc978('0x4e')]})['then'](function(_0x106c68){_0x5186e0[_0xc978('0x1e')]=_0x106c68;if(_0x1908e2[_0xc978('0x41')][_0xc978('0x53')]){_0x267c3e['include']=[{'all':!![]}];}return db[_0xc978('0x6e')][_0xc978('0x55')](_0x267c3e);})['then'](function(_0x2c4919){_0x5186e0[_0xc978('0x56')]=_0x2c4919;return _0x5186e0;});}})['then'](respondWithFilteredResult(_0x3b205e,_0x267c3e))[_0xc978('0x57')](handleError(_0x3b205e,null));};exports[_0xc978('0x71')]=function(_0x4392ef,_0x3a3788){return db['MailAccount'][_0xc978('0x60')]({'where':{'id':_0x4392ef[_0xc978('0x59')]['id']}})[_0xc978('0xe')](handleEntityNotFound(_0x3a3788,null))[_0xc978('0xe')](function(_0x56ab08){if(_0x56ab08){return _0x56ab08[_0xc978('0x71')](_0x4392ef['query'][_0xc978('0x6c')]);}})[_0xc978('0xe')](respondWithStatusCode(_0x3a3788,null))[_0xc978('0x57')](handleError(_0x3a3788,null));};exports[_0xc978('0x69')]=function(_0x5461af,_0x3d450f){var _0x3b9553={'name':_0x5461af[_0xc978('0x61')][_0xc978('0x26')],'key':_0x5461af[_0xc978('0x61')][_0xc978('0x40')],'provider':_0x5461af[_0xc978('0x61')][_0xc978('0x62')]==='custom'?null:_0x5461af[_0xc978('0x61')][_0xc978('0x62')],'email':_0x5461af[_0xc978('0x61')][_0xc978('0x72')],'ListId':_0x5461af[_0xc978('0x61')][_0xc978('0x73')],'active':!_[_0xc978('0x74')](_0x5461af[_0xc978('0x61')][_0xc978('0x75')])?_0x5461af[_0xc978('0x61')]['active']:!![],'description':_0x5461af[_0xc978('0x61')][_0xc978('0x76')]||null};var _0x54920e=getAuthenticationOptions(_0x3b9553['provider'],_0x5461af[_0xc978('0x61')]);_0x3b9553[_0xc978('0x3b')]=_0x54920e[_0xc978('0x3b')];_0x3b9553[_0xc978('0x3d')]=_0x54920e[_0xc978('0x3d')];return db['MailAccount'][_0xc978('0x69')](_0x3b9553,{'include':[{'model':db[_0xc978('0x5b')],'as':_0xc978('0x3d')},{'model':db['MailServerIn'],'as':_0xc978('0x3b')}]})['then'](function(_0x4be413){var _0x5dc308=_0x5461af[_0xc978('0x39')][_0xc978('0x23')]({'plain':!![]});if(!_0x5dc308)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5dc308['role']===_0xc978('0x39')){var _0x395255=_0x4be413['get']({'plain':!![]});return db[_0xc978('0x77')][_0xc978('0x60')]({'where':{'name':'MailAccounts','userProfileId':_0x5dc308[_0xc978('0x78')]},'raw':!![]})[_0xc978('0xe')](function(_0x471f1d){if(_0x471f1d&&_0x471f1d[_0xc978('0x79')]===0x0){return db[_0xc978('0x7a')][_0xc978('0x69')]({'name':_0x395255[_0xc978('0x26')],'resourceId':_0x395255['id'],'type':_0x471f1d[_0xc978('0x26')],'sectionId':_0x471f1d['id']},{})[_0xc978('0xe')](function(){return _0x4be413;});}else{return _0x4be413;}})['catch'](function(_0xcea7c4){logger[_0xc978('0x14')](_0xc978('0x7b'),_0xcea7c4);throw _0xcea7c4;});}return _0x4be413;})[_0xc978('0xe')](respondWithResult(_0x3d450f,0xc9))[_0xc978('0x57')](handleError(_0x3d450f,null));};exports['getImap']=function(_0xf42ec6,_0x1d7232){return db[_0xc978('0x5e')][_0xc978('0x70')]({'where':{'id':_0xf42ec6[_0xc978('0x59')]['id']}})[_0xc978('0xe')](handleEntityNotFound(_0x1d7232,null))[_0xc978('0xe')](function(_0x1314e8){if(_0x1314e8){return _0x1314e8['getImap']();}return null;})['then'](respondWithResult(_0x1d7232,null))['catch'](handleError(_0x1d7232,null));};exports['addImap']=function(_0x369b82,_0x47d756){if(_0x369b82[_0xc978('0x61')]['id']){delete _0x369b82[_0xc978('0x61')]['id'];}return db[_0xc978('0x5e')]['find']({'where':{'id':_0x369b82['params']['id']}})['then'](handleEntityNotFound(_0x47d756,null))[_0xc978('0xe')](function(_0x152134){if(_0x152134){_0x369b82[_0xc978('0x61')][_0xc978('0x67')]=_0x152134['id'];return db[_0xc978('0x5a')][_0xc978('0x69')](_0x369b82[_0xc978('0x61')]);}})['then'](respondWithResult(_0x47d756,null))[_0xc978('0x57')](handleError(_0x47d756,null));};exports[_0xc978('0x7c')]=function(_0x1573df,_0x14a072){return db['MailAccount'][_0xc978('0x70')]({'where':{'id':_0x1573df[_0xc978('0x59')]['id']}})[_0xc978('0xe')](handleEntityNotFound(_0x14a072,null))['then'](function(_0x22dba3){if(_0x22dba3){return _0x22dba3[_0xc978('0x7d')](null);}return null;})['then'](respondWithStatusCode(_0x14a072,null))[_0xc978('0x57')](handleError(_0x14a072,null));};exports[_0xc978('0x7e')]=function(_0x549541,_0x49bd28){return db[_0xc978('0x5e')][_0xc978('0x70')]({'where':{'id':_0x549541[_0xc978('0x59')]['id']}})[_0xc978('0xe')](handleEntityNotFound(_0x49bd28,null))['then'](function(_0x1ae128){if(_0x1ae128){return _0x1ae128['getSmtp']();}return null;})[_0xc978('0xe')](respondWithResult(_0x49bd28,null))[_0xc978('0x57')](handleError(_0x49bd28,null));};exports['addSmtp']=function(_0x3f79d8,_0x2c3df9){if(_0x3f79d8['body']['id']){delete _0x3f79d8[_0xc978('0x61')]['id'];}return db[_0xc978('0x5e')][_0xc978('0x60')]({'where':{'id':_0x3f79d8['params']['id']}})[_0xc978('0xe')](handleEntityNotFound(_0x2c3df9,null))['then'](function(_0x4a48b4){if(_0x4a48b4){_0x3f79d8[_0xc978('0x61')][_0xc978('0x67')]=_0x4a48b4['id'];return db['MailServerOut'][_0xc978('0x69')](_0x3f79d8['body']);}})[_0xc978('0xe')](respondWithResult(_0x2c3df9,null))[_0xc978('0x57')](handleError(_0x2c3df9,null));};exports[_0xc978('0x7f')]=function(_0x3cb62b,_0x52bd13){return db['MailAccount'][_0xc978('0x70')]({'where':{'id':_0x3cb62b[_0xc978('0x59')]['id']}})[_0xc978('0xe')](handleEntityNotFound(_0x52bd13,null))[_0xc978('0xe')](function(_0x319e52){if(_0x319e52){return _0x319e52['setSmtp'](null);}return null;})[_0xc978('0xe')](respondWithStatusCode(_0x52bd13,null))[_0xc978('0x57')](handleError(_0x52bd13,null));};exports[_0xc978('0x80')]=function(_0x4bc7bc,_0x34b7a6){return db['MailInteraction']['find']({'where':{'id':_0x4bc7bc[_0xc978('0x59')]['id']}})['then'](handleEntityNotFound(_0x34b7a6,null))['then'](function(_0x1d310c){if(_0x1d310c){return _0x1d310c[_0xc978('0x80')](_0x4bc7bc[_0xc978('0x61')][_0xc978('0x6c')],_['omit'](_0x4bc7bc['body'],[_0xc978('0x6c'),'id'])||{});}})[_0xc978('0xe')](respondWithResult(_0x34b7a6,null))['catch'](handleError(_0x34b7a6,null));};exports[_0xc978('0x81')]=function(_0x4ff00d,_0x4b502f){var _0x43ae55={'raw':![],'where':{}};var _0x4bef97={};var _0x333df8={'count':0x0,'rows':[]};return db[_0xc978('0x5e')][_0xc978('0x70')]({'where':{'id':_0x4ff00d['params']['id']}})[_0xc978('0xe')](handleEntityNotFound(_0x4b502f,null))['then'](function(_0x2658cc){if(_0x2658cc){_0x4bef97['model']=_['keys'](db['MailInteraction'][_0xc978('0x5f')]);_0x4bef97['query']=_[_0xc978('0x42')](_0x4ff00d[_0xc978('0x41')]);_0x4bef97[_0xc978('0x43')]=_[_0xc978('0x44')](_0x4bef97[_0xc978('0x45')],_0x4bef97[_0xc978('0x41')]);_0x43ae55[_0xc978('0x46')]=_[_0xc978('0x44')](_0x4bef97['model'],qs[_0xc978('0x47')](_0x4ff00d['query']['fields']));_0x43ae55[_0xc978('0x46')]=_0x43ae55[_0xc978('0x46')][_0xc978('0x48')]?_0x43ae55['attributes']:_0x4bef97[_0xc978('0x45')];if(!_0x4ff00d[_0xc978('0x41')][_0xc978('0x6a')]('nolimit')){_0x43ae55[_0xc978('0x1d')]=qs[_0xc978('0x1d')](_0x4ff00d[_0xc978('0x41')][_0xc978('0x1d')]);_0x43ae55[_0xc978('0x1b')]=qs[_0xc978('0x1b')](_0x4ff00d[_0xc978('0x41')]['offset']);}_0x43ae55[_0xc978('0x4a')]=qs['sort'](_0x4ff00d['query'][_0xc978('0x4b')]);_0x43ae55[_0xc978('0x4e')]=qs[_0xc978('0x43')](_[_0xc978('0x4c')](_0x4ff00d[_0xc978('0x41')],_0x4bef97['filters']));_0x43ae55[_0xc978('0x4e')]['MailAccountId']=_0x2658cc['id'];if(_0x4ff00d[_0xc978('0x41')][_0xc978('0x4d')]){_0x43ae55[_0xc978('0x4e')]=_[_0xc978('0x4f')](_0x43ae55[_0xc978('0x4e')],{'$or':_[_0xc978('0x50')](_0x43ae55[_0xc978('0x46')],function(_0x460fdd){var _0x39f85f={};_0x39f85f[_0x460fdd]={'$like':'%'+_0x4ff00d['query'][_0xc978('0x4d')]+'%'};return _0x39f85f;})});}_0x43ae55=_['merge']({},_0x43ae55,_0x4ff00d['options']);return db[_0xc978('0x82')][_0xc978('0x1e')]({'where':_0x43ae55[_0xc978('0x4e')]})['then'](function(_0x588843){_0x333df8[_0xc978('0x1e')]=_0x588843;if(_0x4ff00d[_0xc978('0x41')]['includeAll']){_0x43ae55[_0xc978('0x54')]=[{'model':db['CmContact'],'as':_0xc978('0x83'),'required':![]},{'model':db['User'],'as':_0xc978('0x84'),'attributes':['name',_0xc978('0x85'),'internal'],'required':![]},{'model':db[_0xc978('0x86')],'as':_0xc978('0x87'),'attributes':['id',_0xc978('0x26'),_0xc978('0x88')],'where':_0x4ff00d[_0xc978('0x41')][_0xc978('0x89')]?{'id':_0x4ff00d[_0xc978('0x41')][_0xc978('0x89')]}:undefined,'required':_0x4ff00d[_0xc978('0x41')]['tag']?!![]:![]}];}return db['MailInteraction'][_0xc978('0x55')](_0x43ae55);})[_0xc978('0xe')](function(_0x2431d0){_0x333df8[_0xc978('0x56')]=_0x2431d0;return _0x333df8;});}})[_0xc978('0xe')](respondWithFilteredResult(_0x4b502f,_0x43ae55))[_0xc978('0x57')](handleError(_0x4b502f,null));};exports['addApplications']=function addApplications(_0x3f5edb,_0xfe91ad){var _0x45c65b=_0x3f5edb['params']['id'];var _0xb4a37c=_0x3f5edb['body'];var _0x1100ba=0xc8;var _0x4922e6=null;return db[_0xc978('0x8a')]['transaction']({'isolationLevel':db['sequelize'][_0xc978('0x8b')][_0xc978('0x8c')][_0xc978('0x8d')]},function(_0x2e1968){return db[_0xc978('0x5e')][_0xc978('0x70')]({'where':{'id':_0x45c65b},'transaction':_0x2e1968})[_0xc978('0xe')](function(_0x4c4da4){if(_0x4c4da4){return db[_0xc978('0x8e')][_0xc978('0x22')]({'where':{'MailAccountId':_0x45c65b},'transaction':_0x2e1968})['then'](function(){var _0xfd1e0=_[_0xc978('0x50')](_0xb4a37c,function(_0x44d8e6){_0x44d8e6[_0xc978('0x67')]=_0x45c65b;return _0x44d8e6;});return db[_0xc978('0x8e')][_0xc978('0x8f')](_0xfd1e0,{'transaction':_0x2e1968});});}else{_0x1100ba=0x194;_0x4922e6=[];}});})['then'](function(){if(_0x1100ba!==0x194){return db[_0xc978('0x8e')][_0xc978('0x90')]({'where':{'MailAccountId':_0x45c65b},'order':_0xc978('0x91')})[_0xc978('0xe')](function(_0x26b736){_0x4922e6=_0x26b736;});}})[_0xc978('0x57')](function(_0x3e23a6){_0x1100ba=0x1f4;logger[_0xc978('0x14')](_0x3e23a6[_0xc978('0x25')]);if(_0x3e23a6['name']){delete _0x3e23a6[_0xc978('0x26')];}_0x4922e6=_0x3e23a6;})['finally'](function(){if(_0x4922e6===null){_0xfe91ad[_0xc978('0x17')](_0x1100ba);}else{if(_0x1100ba===0x1f4){_0xfe91ad[_0xc978('0x18')](_0x1100ba)[_0xc978('0x27')](_0x4922e6);}else{_0xfe91ad[_0xc978('0x18')](_0x1100ba)['json'](_0x4922e6);}}});};exports[_0xc978('0x92')]=function(_0x1e78c9,_0x36e759){var _0x5bee6e={};var _0x1dea3b={};var _0x3da3d3;var _0x3a4850;return db[_0xc978('0x5e')][_0xc978('0x70')]({'where':{'id':_0x1e78c9['params']['id']}})['then'](handleEntityNotFound(_0x36e759,null))[_0xc978('0xe')](function(_0x482036){if(_0x482036){_0x3da3d3=_0x482036;_0x1dea3b[_0xc978('0x45')]=_[_0xc978('0x42')](db[_0xc978('0x8e')][_0xc978('0x5f')]);_0x1dea3b[_0xc978('0x41')]=_[_0xc978('0x42')](_0x1e78c9[_0xc978('0x41')]);_0x1dea3b['filters']=_[_0xc978('0x44')](_0x1dea3b[_0xc978('0x45')],_0x1dea3b['query']);_0x5bee6e[_0xc978('0x46')]=_[_0xc978('0x44')](_0x1dea3b[_0xc978('0x45')],qs[_0xc978('0x47')](_0x1e78c9[_0xc978('0x41')][_0xc978('0x47')]));_0x5bee6e[_0xc978('0x46')]=_0x5bee6e[_0xc978('0x46')][_0xc978('0x48')]?_0x5bee6e[_0xc978('0x46')]:_0x1dea3b[_0xc978('0x45')];_0x5bee6e[_0xc978('0x4a')]=qs[_0xc978('0x4b')](_0x1e78c9['query'][_0xc978('0x4b')]);_0x5bee6e[_0xc978('0x4e')]=qs['filters'](_['pick'](_0x1e78c9[_0xc978('0x41')],_0x1dea3b[_0xc978('0x43')]));if(_0x1e78c9['query'][_0xc978('0x4d')]){_0x5bee6e[_0xc978('0x4e')]=_['merge'](_0x5bee6e[_0xc978('0x4e')],{'$or':_[_0xc978('0x50')](_0x5bee6e['attributes'],function(_0x135a19){var _0x5591c5={};_0x5591c5[_0x135a19]={'$like':'%'+_0x1e78c9[_0xc978('0x41')][_0xc978('0x4d')]+'%'};return _0x5591c5;})});}_0x5bee6e=_[_0xc978('0x4f')]({},_0x5bee6e,_0x1e78c9[_0xc978('0x52')]);return _0x3da3d3[_0xc978('0x92')](_0x5bee6e);}})['then'](function(_0x439437){if(_0x439437){_0x3a4850=_0x439437[_0xc978('0x48')];if(!_0x1e78c9[_0xc978('0x41')][_0xc978('0x6a')]('nolimit')){_0x5bee6e[_0xc978('0x1d')]=qs[_0xc978('0x1d')](_0x1e78c9[_0xc978('0x41')][_0xc978('0x1d')]);_0x5bee6e[_0xc978('0x1b')]=qs['offset'](_0x1e78c9[_0xc978('0x41')][_0xc978('0x1b')]);}return _0x3da3d3[_0xc978('0x92')](_0x5bee6e);}})['then'](function(_0x1840d1){if(_0x1840d1){return _0x1840d1?{'count':_0x3a4850,'rows':_0x1840d1}:null;}})[_0xc978('0xe')](respondWithResult(_0x36e759,null))[_0xc978('0x57')](handleError(_0x36e759,null));};exports[_0xc978('0x93')]=function(_0x3e1502,_0x456cd9){var _0x261810={'raw':!![],'where':{}};var _0x15b9cf={};var _0x404439={'count':0x0,'rows':[]};return db[_0xc978('0x5e')][_0xc978('0x70')]({'where':{'id':_0x3e1502['params']['id']}})[_0xc978('0xe')](handleEntityNotFound(_0x456cd9,null))[_0xc978('0xe')](function(_0x27c220){if(_0x27c220){_0x15b9cf[_0xc978('0x45')]=_[_0xc978('0x42')](db[_0xc978('0x94')][_0xc978('0x5f')]);_0x15b9cf[_0xc978('0x41')]=_['keys'](_0x3e1502['query']);_0x15b9cf[_0xc978('0x43')]=_['intersection'](_0x15b9cf['model'],_0x15b9cf[_0xc978('0x41')]);_0x261810[_0xc978('0x46')]=_['intersection'](_0x15b9cf['model'],qs[_0xc978('0x47')](_0x3e1502[_0xc978('0x41')][_0xc978('0x47')]));_0x261810[_0xc978('0x46')]=_0x261810[_0xc978('0x46')][_0xc978('0x48')]?_0x261810[_0xc978('0x46')]:_0x15b9cf[_0xc978('0x45')];if(!_0x3e1502[_0xc978('0x41')][_0xc978('0x6a')](_0xc978('0x49'))){_0x261810[_0xc978('0x1d')]=qs[_0xc978('0x1d')](_0x3e1502[_0xc978('0x41')][_0xc978('0x1d')]);_0x261810[_0xc978('0x1b')]=qs[_0xc978('0x1b')](_0x3e1502[_0xc978('0x41')][_0xc978('0x1b')]);}_0x261810[_0xc978('0x4a')]=qs[_0xc978('0x4b')](_0x3e1502['query'][_0xc978('0x4b')]);_0x261810[_0xc978('0x4e')]=qs[_0xc978('0x43')](_[_0xc978('0x4c')](_0x3e1502[_0xc978('0x41')],_0x15b9cf[_0xc978('0x43')]));_0x261810[_0xc978('0x4e')][_0xc978('0x67')]=_0x27c220['id'];if(_0x3e1502[_0xc978('0x41')][_0xc978('0x4d')]){_0x261810[_0xc978('0x4e')]=_[_0xc978('0x4f')](_0x261810[_0xc978('0x4e')],{'$or':_[_0xc978('0x50')](_0x261810['attributes'],function(_0x2a260e){var _0x9b665={};_0x9b665[_0x2a260e]={'$like':'%'+_0x3e1502[_0xc978('0x41')][_0xc978('0x4d')]+'%'};return _0x9b665;})});}if(_0x3e1502[_0xc978('0x41')]['$gte']){var _0x498ca8=_0x3e1502[_0xc978('0x41')][_0xc978('0x95')][_0xc978('0x96')](',');var _0x105954={};_0x105954[_0x498ca8[0x0]]={'$gte':moment(_0x498ca8[0x1])[_0xc978('0x97')](_0xc978('0x98'))};_0x261810[_0xc978('0x4e')]=_[_0xc978('0x4f')](_0x261810['where'],_0x105954);}_0x261810=_['merge']({},_0x261810,_0x3e1502[_0xc978('0x52')]);return db[_0xc978('0x94')][_0xc978('0x1e')]({'where':_0x261810[_0xc978('0x4e')]})[_0xc978('0xe')](function(_0x59b65b){_0x404439[_0xc978('0x1e')]=_0x59b65b;if(_0x3e1502['query'][_0xc978('0x53')]){_0x261810[_0xc978('0x54')]=[{'all':!![]}];}return db['MailMessage'][_0xc978('0x55')](_0x261810);})[_0xc978('0xe')](function(_0xe591e1){if(_0x3e1502[_0xc978('0x41')][_0xc978('0x99')]===_0xc978('0x9a')){for(var _0x528b4c=0x0;_0x528b4c<_0xe591e1[_0xc978('0x48')];_0x528b4c++){_0xe591e1[_0x528b4c]['body']=juice(_0xe591e1[_0x528b4c][_0xc978('0x61')]);}}_0x404439[_0xc978('0x56')]=_0xe591e1;return _0x404439;});}})[_0xc978('0xe')](respondWithFilteredResult(_0x456cd9,_0x261810))[_0xc978('0x57')](handleError(_0x456cd9,null));};exports[_0xc978('0x27')]=function(_0x51cd8b,_0x52aae9){var _0x25596d,_0xbd1c32={},_0x430164;if(_0x51cd8b[_0xc978('0x61')]['to']){_0x430164=_0x51cd8b[_0xc978('0x61')]['to'][_0xc978('0x96')](',')[0x0];}return db[_0xc978('0x5e')][_0xc978('0x60')]({'where':{'id':_0x51cd8b[_0xc978('0x59')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xc978('0x9b')],'as':'Contacts','where':{'email':_0x430164},'limit':0x1,'order':[['updatedAt',_0xc978('0x9c')]]}]},{'model':db[_0xc978('0x5b')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xc978('0x9d')],'as':_0xc978('0x9d'),'raw':!![]}]}]})[_0xc978('0xe')](handleEntityNotFound(_0x52aae9,null))[_0xc978('0xe')](function(_0x26f06c){if(!_0x26f06c)return;_0x25596d=_0x26f06c;if(!_0x26f06c[_0xc978('0x3d')])throw new Error(_0xc978('0x9e'));if(_[_0xc978('0x74')](_0x51cd8b['body'][_0xc978('0x9f')])){_0x51cd8b['body'][_0xc978('0x9f')]=util[_0xc978('0x97')](_0xc978('0xa0'),_0x26f06c[_0xc978('0x26')],_0x26f06c[_0xc978('0x72')]||_0x26f06c[_0xc978('0x3d')][_0xc978('0x39')]);}if(_0x51cd8b[_0xc978('0x61')][_0xc978('0xa1')]&&_0x51cd8b[_0xc978('0x61')][_0xc978('0xa1')][_0xc978('0x48')]){for(var _0x178f1f=0x0;_0x178f1f<_0x51cd8b[_0xc978('0x61')][_0xc978('0xa1')][_0xc978('0x48')];_0x178f1f+=0x1){_0x51cd8b['body'][_0xc978('0xa1')][_0x178f1f]={'filename':_0x51cd8b[_0xc978('0x61')][_0xc978('0xa1')][_0x178f1f]['name'],'path':path['join'](config[_0xc978('0xa2')],_0xc978('0xa3'),_0x51cd8b[_0xc978('0x61')]['attachments'][_0x178f1f][_0xc978('0xa4')])};}}var _0x5cf575=_0x26f06c[_0xc978('0xa5')]();return respondWithRpcPromise(_0xc978('0xa6'),'sendMail',{'account':_0x5cf575,'message':_0x51cd8b[_0xc978('0x61')]});})[_0xc978('0xe')](function(_0x2d0036){if(!_0x2d0036)return;_0xbd1c32=_0x2d0036;if(!_0x25596d[_0xc978('0xa7')])throw new Error(_0xc978('0xa8'));if(_0x25596d['List']['Contacts'][_0xc978('0x48')])return _0x25596d['List'][_0xc978('0xa9')][0x0];return db[_0xc978('0x9b')]['create'](_['defaults'](_0x51cd8b['body'],{'firstName':_0x51cd8b[_0xc978('0x61')]['to'],'email':_0x51cd8b['body']['to'],'phone':_0x51cd8b[_0xc978('0x61')]['to'],'ListId':_0x25596d[_0xc978('0x73')]}));})[_0xc978('0xe')](function(_0x331c56){if(!_0x331c56)return;var _0x32b914={'UserId':_0x51cd8b['user']['id'],'ContactId':_0x331c56['id'],'MailAccountId':_0x25596d['id'],'inReplyTo':_0xbd1c32[_0xc978('0xaa')],'to':_0x51cd8b['body'][_0xc978('0x9f')],'cc':_0x51cd8b['body']['cc'],'subject':_0x51cd8b[_0xc978('0x61')][_0xc978('0xab')],'attach':_0x51cd8b['body'][_0xc978('0xac')],'firstMsgDirection':'out','lastMsgAt':moment()[_0xc978('0x97')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0xc978('0xad'),'Messages':[_[_0xc978('0x4f')](_0x51cd8b['body'],{'messageId':_0xbd1c32['messageId'],'sentAt':moment()['format'](_0xc978('0x98')),'read':!![],'MailAccountId':_0x25596d['id'],'UserId':_0x51cd8b[_0xc978('0x39')]['id'],'ContactId':_0x331c56['id']})]};if(_0x51cd8b['body']['Interaction']){_0x32b914=_[_0xc978('0x4f')](_0x32b914,_0x51cd8b[_0xc978('0x61')]['Interaction']);}return db['MailInteraction'][_0xc978('0x69')](_0x32b914,{'include':[{'model':db[_0xc978('0x94')],'as':_0xc978('0xae')}]});})[_0xc978('0xe')](respondWithResult(_0x52aae9,null))[_0xc978('0x57')](handleError(_0x52aae9,null));};exports['verifySmtp']=function(_0x8e838c,_0x35edef){return db[_0xc978('0x5e')]['find']({'where':{'id':_0x8e838c[_0xc978('0x59')]['id']},'include':[{'model':db[_0xc978('0x5b')],'as':_0xc978('0x3d'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xc978('0x9d'),'raw':!![]}]}]})[_0xc978('0xe')](handleEntityNotFound(_0x35edef,null))[_0xc978('0xe')](function(_0x3b9145){if(!_0x3b9145['Smtp'])return;var _0x11efc7=_0x3b9145[_0xc978('0xa5')]();return respondWithRpcPromise(_0xc978('0xaf'),_0xc978('0xb0'),{'account':_0x11efc7});})['then'](respondWithResult(_0x35edef,null))[_0xc978('0x57')](handleError(_0x35edef,null));};exports[_0xc978('0x22')]=function(_0x2041cc,_0x1e64c8){return db['MailAccount'][_0xc978('0x60')]({'where':{'id':_0x2041cc[_0xc978('0x59')]['id']}})[_0xc978('0xe')](handleEntityNotFound(_0x1e64c8,null))[_0xc978('0xe')](function(_0x79fc3c){if(_0x79fc3c&&_0x79fc3c[_0xc978('0x37')]){throw new db[(_0xc978('0xb1'))][(_0xc978('0xb2'))](_0xc978('0xb3'));}return _0x79fc3c;})[_0xc978('0xe')](removeEntity(_0x1e64c8,null))[_0xc978('0x57')](handleError(_0x1e64c8,null));};exports[_0xc978('0xb4')]=function(_0x550f63,_0x492465){return db['MailAccount']['find']({'where':{'id':_0x550f63['params']['id']}})[_0xc978('0xe')](handleEntityNotFound(_0x492465,null))['then'](function(_0x380083){if(_0x380083){return _0x380083[_0xc978('0xb4')](_0x550f63[_0xc978('0x61')][_0xc978('0x6c')],_[_0xc978('0xb5')](_0x550f63['body'],['ids','id'])||{})[_0xc978('0xb6')](function(_0x97ed0e){for(var _0x4a8f2b=0x0;_0x4a8f2b<_0x550f63[_0xc978('0x61')][_0xc978('0x6c')][_0xc978('0x48')];_0x4a8f2b+=0x1){socket[_0xc978('0xb7')]('userMailAccount:save',{'UserId':Number(_0x550f63[_0xc978('0x61')][_0xc978('0x6c')][_0x4a8f2b]),'MailAccountId':Number(_0x550f63[_0xc978('0x59')]['id'])});}return _0x97ed0e;});}})['then'](respondWithResult(_0x492465,null))[_0xc978('0x57')](handleError(_0x492465,null));};exports[_0xc978('0xb8')]=function(_0x24462b,_0x368c0f){return db[_0xc978('0x5e')]['find']({'where':{'id':_0x24462b[_0xc978('0x59')]['id']}})['then'](handleEntityNotFound(_0x368c0f,null))['then'](function(_0x393b8b){if(_0x393b8b){return _0x393b8b[_0xc978('0xb8')](_0x24462b[_0xc978('0x41')][_0xc978('0x6c')])[_0xc978('0xe')](function(){if(_[_0xc978('0xb9')](_0x24462b[_0xc978('0x41')]['ids'])){for(var _0x351288=0x0;_0x351288<_0x24462b['query']['ids'][_0xc978('0x48')];_0x351288+=0x1){socket[_0xc978('0xb7')](_0xc978('0xba'),{'UserId':Number(_0x24462b[_0xc978('0x41')][_0xc978('0x6c')][_0x351288]),'MailAccountId':Number(_0x24462b[_0xc978('0x59')]['id'])});}}else{socket['emit'](_0xc978('0xba'),{'UserId':Number(_0x24462b[_0xc978('0x41')][_0xc978('0x6c')]),'MailAccountId':Number(_0x24462b[_0xc978('0x59')]['id'])});}});}})[_0xc978('0xe')](respondWithStatusCode(_0x368c0f,null))[_0xc978('0x57')](handleError(_0x368c0f,null));};exports[_0xc978('0xbb')]=function(_0x599444,_0x15ccac){var _0x18818b={};var _0x5613c5={};var _0x31dd4c;var _0x174f27;return db[_0xc978('0x5e')]['findOne']({'where':{'id':_0x599444[_0xc978('0x59')]['id']}})['then'](handleEntityNotFound(_0x15ccac,null))[_0xc978('0xe')](function(_0x2041f6){if(_0x2041f6){_0x31dd4c=_0x2041f6;_0x5613c5[_0xc978('0x45')]=_['keys'](db['User'][_0xc978('0x5f')]);_0x5613c5[_0xc978('0x41')]=_[_0xc978('0x42')](_0x599444[_0xc978('0x41')]);_0x5613c5[_0xc978('0x43')]=_[_0xc978('0x44')](_0x5613c5[_0xc978('0x45')],_0x5613c5[_0xc978('0x41')]);_0x18818b['attributes']=_[_0xc978('0x44')](_0x5613c5['model'],qs[_0xc978('0x47')](_0x599444['query'][_0xc978('0x47')]));_0x18818b['attributes']=_0x18818b[_0xc978('0x46')][_0xc978('0x48')]?_0x18818b[_0xc978('0x46')]:_0x5613c5[_0xc978('0x45')];_0x18818b[_0xc978('0x4a')]=qs[_0xc978('0x4b')](_0x599444[_0xc978('0x41')][_0xc978('0x4b')]);_0x18818b[_0xc978('0x4e')]=qs[_0xc978('0x43')](_[_0xc978('0x4c')](_0x599444[_0xc978('0x41')],_0x5613c5[_0xc978('0x43')]));if(_0x599444[_0xc978('0x41')][_0xc978('0x4d')]){_0x18818b[_0xc978('0x4e')]=_[_0xc978('0x4f')](_0x18818b[_0xc978('0x4e')],{'$or':_[_0xc978('0x50')](_0x18818b[_0xc978('0x46')],function(_0x16937d){var _0x5a597c={};_0x5a597c[_0x16937d]={'$like':'%'+_0x599444[_0xc978('0x41')]['filter']+'%'};return _0x5a597c;})});}_0x18818b=_['merge']({},_0x18818b,_0x599444['options']);return _0x31dd4c[_0xc978('0xbb')](_0x18818b);}})[_0xc978('0xe')](function(_0x471aea){if(_0x471aea){_0x174f27=_0x471aea['length'];if(!_0x599444[_0xc978('0x41')][_0xc978('0x6a')](_0xc978('0x49'))){_0x18818b[_0xc978('0x1d')]=qs['limit'](_0x599444[_0xc978('0x41')][_0xc978('0x1d')]);_0x18818b['offset']=qs[_0xc978('0x1b')](_0x599444[_0xc978('0x41')][_0xc978('0x1b')]);}return _0x31dd4c[_0xc978('0xbb')](_0x18818b);}})[_0xc978('0xe')](function(_0x50bca4){if(_0x50bca4){return _0x50bca4?{'count':_0x174f27,'rows':_0x50bca4}:null;}})[_0xc978('0xe')](respondWithResult(_0x15ccac,null))[_0xc978('0x57')](handleError(_0x15ccac,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 1d930c3..b6ed46e 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 _0xdadc=['save','update','remove','emit','hasOwnProperty','events','setMaxListeners'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0xdadc,0x75));var _0xcdad=function(_0x25b86a,_0x286507){_0x25b86a=_0x25b86a-0x0;var _0x1e5aad=_0xdadc[_0x25b86a];return _0x1e5aad;};'use strict';var EventEmitter=require(_0xcdad('0x0'));var MailAccount=require('../../mysqldb')['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xcdad('0x1')](0x0);var events={'afterCreate':_0xcdad('0x2'),'afterUpdate':_0xcdad('0x3'),'afterDestroy':_0xcdad('0x4')};function emitEvent(_0x2cb908){return function(_0xc667e6,_0x12c875,_0x55eef5){MailAccountEvents[_0xcdad('0x5')](_0x2cb908+':'+_0xc667e6['id'],_0xc667e6);MailAccountEvents[_0xcdad('0x5')](_0x2cb908,_0xc667e6);_0x55eef5(null);};}for(var e in events){if(events[_0xcdad('0x6')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file +var _0x930b=['setMaxListeners','save','update','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x177b30,_0x26b916){var _0x3f148c=function(_0x3c6216){while(--_0x3c6216){_0x177b30['push'](_0x177b30['shift']());}};_0x3f148c(++_0x26b916);}(_0x930b,0x106));var _0xb930=function(_0x3aa82c,_0x45b770){_0x3aa82c=_0x3aa82c-0x0;var _0x4afcbe=_0x930b[_0x3aa82c];return _0x4afcbe;};'use strict';var EventEmitter=require(_0xb930('0x0'));var MailAccount=require(_0xb930('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xb930('0x2')](0x0);var events={'afterCreate':_0xb930('0x3'),'afterUpdate':_0xb930('0x4'),'afterDestroy':'remove'};function emitEvent(_0x59c730){return function(_0x3bf5d0,_0x31400f,_0xa9cacd){MailAccountEvents['emit'](_0x59c730+':'+_0x3bf5d0['id'],_0x3bf5d0);MailAccountEvents[_0xb930('0x5')](_0x59c730,_0x3bf5d0);_0xa9cacd(null);};}for(var e in events){if(events[_0xb930('0x6')](e)){var event=events[e];MailAccount[_0xb930('0x7')](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 5c63623..4ee8ff3 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 _0x99d5=['Smtp','port','secure','authentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','user','pass','./mailAccount.attributes','define','MailAccount','provider','custom','service','host'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x99d5,0x14d));var _0x599d=function(_0x3935df,_0x46b253){_0x3935df=_0x3935df-0x0;var _0x388ce6=_0x99d5[_0x3935df];return _0x388ce6;};'use strict';var attributes=require(_0x599d('0x0'));module['exports']=function(_0x11aa98){return _0x11aa98[_0x599d('0x1')](_0x599d('0x2'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x467352=this;var _0x43faec={'id':_0x467352['id'],'tls':{'rejectUnauthorized':![]}};if(_0x467352[_0x599d('0x3')]!==_0x599d('0x4')){_0x43faec[_0x599d('0x5')]=_0x467352[_0x599d('0x3')];}else{_0x43faec[_0x599d('0x6')]=_0x467352[_0x599d('0x7')]['host'];_0x43faec['port']=_0x467352['Smtp'][_0x599d('0x8')];_0x43faec[_0x599d('0x9')]=_0x467352[_0x599d('0x7')][_0x599d('0x9')];}if(_0x467352[_0x599d('0x7')][_0x599d('0xa')]){if(_0x467352[_0x599d('0x7')]['modernAuthentication']){if(!_0x467352[_0x599d('0x7')][_0x599d('0xb')])throw new Error(_0x599d('0xc'));_0x43faec[_0x599d('0xd')]={'type':_0x599d('0xe'),'user':_0x467352[_0x599d('0x7')][_0x599d('0xf')],'accessToken':_0x467352['Smtp'][_0x599d('0xb')]['data5']};}else{_0x43faec[_0x599d('0xd')]={'user':_0x467352[_0x599d('0x7')]['user'],'pass':_0x467352[_0x599d('0x7')][_0x599d('0x10')]};}}return _0x43faec;}}});}; \ No newline at end of file +var _0xbe55=['exports','MailAccount','mail_accounts','provider','service','host','Smtp','port','secure','Cloud\x20Provider\x20configuration\x20not\x20found','auth','CloudProvider','data5','user','pass','./mailAccount.attributes'];(function(_0x5c58f4,_0x2b37d1){var _0x3e230e=function(_0x30344a){while(--_0x30344a){_0x5c58f4['push'](_0x5c58f4['shift']());}};_0x3e230e(++_0x2b37d1);}(_0xbe55,0x13f));var _0x5be5=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xbe55[_0x1b349a];return _0x5d1f7c;};'use strict';var attributes=require(_0x5be5('0x0'));module[_0x5be5('0x1')]=function(_0x22a72e){return _0x22a72e['define'](_0x5be5('0x2'),attributes,{'tableName':_0x5be5('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x33d0a3=this;var _0x4962f8={'id':_0x33d0a3['id'],'tls':{'rejectUnauthorized':![]}};if(_0x33d0a3[_0x5be5('0x4')]!=='custom'){_0x4962f8[_0x5be5('0x5')]=_0x33d0a3[_0x5be5('0x4')];}else{_0x4962f8[_0x5be5('0x6')]=_0x33d0a3['Smtp']['host'];_0x4962f8['port']=_0x33d0a3[_0x5be5('0x7')][_0x5be5('0x8')];_0x4962f8[_0x5be5('0x9')]=_0x33d0a3['Smtp'][_0x5be5('0x9')];}if(_0x33d0a3[_0x5be5('0x7')]['authentication']){if(_0x33d0a3[_0x5be5('0x7')]['modernAuthentication']){if(!_0x33d0a3['Smtp']['CloudProvider'])throw new Error(_0x5be5('0xa'));_0x4962f8[_0x5be5('0xb')]={'type':'OAuth2','user':_0x33d0a3[_0x5be5('0x7')]['user'],'accessToken':_0x33d0a3[_0x5be5('0x7')][_0x5be5('0xc')][_0x5be5('0xd')]};}else{_0x4962f8[_0x5be5('0xb')]={'user':_0x33d0a3[_0x5be5('0x7')][_0x5be5('0xe')],'pass':_0x33d0a3[_0x5be5('0x7')][_0x5be5('0xf')]};}}return _0x4962f8;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 3ade7bb..6839b5a 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 _0x0e4b=['unshift','agent','waitForTheAssignedAgent','MailQueue','queueId','queue','Start','startRouting','lodash','moment','bluebird','ioredis','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','message','result','GetMailAccount','MailAccount','findAll','options','attributes','include','map','model','stringify','catch','ShowMailAccount','raw','where','setDataValue','getSmtpOptions','NotifyMailAccount','mail','difference','keys','CmContact','rawAttributes','updatedAt','CompanyId','ListId','body','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Contacts','MailApplication','Applications','CloudProvider','smtpOptions','applications','list','orderBy','priority','asc','push','length','autoclose','*,*,*,*','List\x20not\x20found','messageId','subject','attach','MailInteraction','MailMessage','Messages','inReplyTo','create','Contact\x20not\x20found','update','format','YYYY-MM-DD\x20HH:mm:ss','interaction','get','created','contact','originTo','originCc','ChatWebsiteId','originChannel','ChatOfflineMessageId','Attachment','Attachments','name','UserId'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x0e4b,0xdc));var _0xb0e4=function(_0x3dab54,_0x17ae72){_0x3dab54=_0x3dab54-0x0;var _0x144d02=_0x0e4b[_0x3dab54];return _0x144d02;};'use strict';var _=require(_0xb0e4('0x0'));var moment=require(_0xb0e4('0x1'));var BPromise=require(_0xb0e4('0x2'));var rs=require('randomstring');var Redis=require(_0xb0e4('0x3'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xb0e4('0x4'));var client=jayson[_0xb0e4('0x5')]['http']({'port':0x232c});config[_0xb0e4('0x6')]=_[_0xb0e4('0x7')](config[_0xb0e4('0x6')],{'host':_0xb0e4('0x8'),'port':0x18eb});var socket=require(_0xb0e4('0x9'))(new Redis(config['redis']));require('./mailAccount.socket')[_0xb0e4('0xa')](socket);function respondWithRpcPromise(_0x9d4a99,_0x1d6452,_0x23555b){return new BPromise(function(_0x12a36a,_0x140b7e){return client[_0xb0e4('0xb')](_0x9d4a99,_0x23555b)[_0xb0e4('0xc')](function(_0x38019d){logger[_0xb0e4('0xd')](_0xb0e4('0xe'),_0x1d6452,_0xb0e4('0xf'));logger[_0xb0e4('0x10')](_0xb0e4('0x11'),_0x1d6452,_0xb0e4('0xf'),JSON['stringify'](_0x38019d));if(_0x38019d[_0xb0e4('0x12')]){if(_0x38019d[_0xb0e4('0x12')]['code']===0x1f4){logger[_0xb0e4('0x12')](_0xb0e4('0xe'),_0x1d6452,_0x38019d[_0xb0e4('0x12')][_0xb0e4('0x13')]);return _0x140b7e(_0x38019d[_0xb0e4('0x12')]['message']);}logger['error'](_0xb0e4('0xe'),_0x1d6452,_0x38019d[_0xb0e4('0x12')]['message']);return _0x12a36a(_0x38019d[_0xb0e4('0x12')][_0xb0e4('0x13')]);}else{logger[_0xb0e4('0xd')](_0xb0e4('0xe'),_0x1d6452,_0xb0e4('0xf'));_0x12a36a(_0x38019d[_0xb0e4('0x14')]['message']);}})['catch'](function(_0x4ba49e){logger[_0xb0e4('0x12')](_0xb0e4('0xe'),_0x1d6452,_0x4ba49e);_0x140b7e(_0x4ba49e);});});}exports[_0xb0e4('0x15')]=function(_0x690682){var _0x2ce0c6=this;return new Promise(function(_0x2f3809,_0x54b7ff){return db[_0xb0e4('0x16')][_0xb0e4('0x17')]({'raw':_0x690682[_0xb0e4('0x18')]?_0x690682[_0xb0e4('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x690682[_0xb0e4('0x18')]?_0x690682[_0xb0e4('0x18')]['where']||null:null,'attributes':_0x690682[_0xb0e4('0x18')]?_0x690682[_0xb0e4('0x18')][_0xb0e4('0x19')]||null:null,'limit':_0x690682['options']?_0x690682[_0xb0e4('0x18')]['limit']||null:null,'include':_0x690682['options']?_0x690682[_0xb0e4('0x18')][_0xb0e4('0x1a')]?_[_0xb0e4('0x1b')](_0x690682[_0xb0e4('0x18')][_0xb0e4('0x1a')],function(_0x248aa5){return{'model':db[_0x248aa5[_0xb0e4('0x1c')]],'as':_0x248aa5['as'],'attributes':_0x248aa5['attributes'],'include':_0x248aa5[_0xb0e4('0x1a')]?_['map'](_0x248aa5[_0xb0e4('0x1a')],function(_0x22033f){return{'model':db[_0x22033f[_0xb0e4('0x1c')]],'as':_0x22033f['as'],'attributes':_0x22033f[_0xb0e4('0x19')],'include':_0x22033f['include']?_[_0xb0e4('0x1b')](_0x22033f[_0xb0e4('0x1a')],function(_0x15d402){return{'model':db[_0x15d402[_0xb0e4('0x1c')]],'as':_0x15d402['as'],'attributes':_0x15d402[_0xb0e4('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb0e4('0xc')](function(_0x1dad0e){logger[_0xb0e4('0xd')]('GetMailAccount',_0x690682);logger[_0xb0e4('0x10')]('GetMailAccount',_0x690682,JSON[_0xb0e4('0x1d')](_0x1dad0e));_0x2f3809(_0x1dad0e);})[_0xb0e4('0x1e')](function(_0x50cef9){logger[_0xb0e4('0x12')](_0xb0e4('0x15'),_0x50cef9[_0xb0e4('0x13')],_0x690682);_0x54b7ff(_0x2ce0c6[_0xb0e4('0x12')](0x1f4,_0x50cef9[_0xb0e4('0x13')]));});});};exports[_0xb0e4('0x1f')]=function(_0x5e8667){var _0x30d324=this;return new Promise(function(_0x57339c,_0x5b3d93){return db[_0xb0e4('0x16')]['find']({'raw':_0x5e8667[_0xb0e4('0x18')]?_0x5e8667['options'][_0xb0e4('0x20')]===undefined?!![]:![]:!![],'where':_0x5e8667['options']?_0x5e8667[_0xb0e4('0x18')][_0xb0e4('0x21')]||null:null,'attributes':_0x5e8667[_0xb0e4('0x18')]?_0x5e8667['options'][_0xb0e4('0x19')]||null:null,'include':_0x5e8667['options']?_0x5e8667[_0xb0e4('0x18')][_0xb0e4('0x1a')]?_[_0xb0e4('0x1b')](_0x5e8667[_0xb0e4('0x18')][_0xb0e4('0x1a')],function(_0x59870f){return{'model':db[_0x59870f[_0xb0e4('0x1c')]],'as':_0x59870f['as'],'attributes':_0x59870f['attributes'],'include':_0x59870f[_0xb0e4('0x1a')]?_[_0xb0e4('0x1b')](_0x59870f[_0xb0e4('0x1a')],function(_0x5451f2){return{'model':db[_0x5451f2[_0xb0e4('0x1c')]],'as':_0x5451f2['as'],'attributes':_0x5451f2[_0xb0e4('0x19')],'include':_0x5451f2[_0xb0e4('0x1a')]?_[_0xb0e4('0x1b')](_0x5451f2['include'],function(_0x4b6f58){return{'model':db[_0x4b6f58['model']],'as':_0x4b6f58['as'],'attributes':_0x4b6f58['attributes']};}):[]};}):[]};}):[]:[]})[_0xb0e4('0xc')](function(_0x4b924d){if(_0x5e8667[_0xb0e4('0x18')]['smtp']===!![])_0x4b924d[_0xb0e4('0x22')]('smtpOptions',_0x4b924d[_0xb0e4('0x23')]());logger[_0xb0e4('0xd')](_0xb0e4('0x1f'),_0x5e8667);logger[_0xb0e4('0x10')]('ShowMailAccount',_0x5e8667,JSON[_0xb0e4('0x1d')](_0x4b924d));_0x57339c(_0x4b924d);})[_0xb0e4('0x1e')](function(_0x5dc154){logger[_0xb0e4('0x12')]('ShowMailAccount',_0x5dc154[_0xb0e4('0x13')],_0x5e8667);_0x5b3d93(_0x30d324[_0xb0e4('0x12')](0x1f4,_0x5dc154['message']));});});};exports[_0xb0e4('0x24')]=function(_0x4f7f39){var _0x52f41e=this;return new Promise(function(_0x4ec8c6,_0x114098){var _0x3fbde8={'body':_0x4f7f39['body'],'channel':_0xb0e4('0x25')};var _0x5eb2f4=_[_0xb0e4('0x26')](_[_0xb0e4('0x27')](db[_0xb0e4('0x28')][_0xb0e4('0x29')]),['createdAt',_0xb0e4('0x2a'),_0xb0e4('0x2b'),_0xb0e4('0x2c')]);var _0x3e839e=![];if(_0x4f7f39[_0xb0e4('0x2d')]['id']){delete _0x4f7f39[_0xb0e4('0x2d')]['id'];}if(_[_0xb0e4('0x2e')](_0x4f7f39[_0xb0e4('0x2d')][_0xb0e4('0x2f')])){return _0x114098(_0x52f41e[_0xb0e4('0x12')](0x1f4,_0xb0e4('0x30')));}if(_[_0xb0e4('0x2e')](_0x4f7f39[_0xb0e4('0x2d')][_0xb0e4('0x2d')])||_0x4f7f39[_0xb0e4('0x2d')][_0xb0e4('0x2d')]===''){return _0x114098(_0x52f41e['error'](0x1f4,_0xb0e4('0x31')));}if(_[_0xb0e4('0x2e')](_0x4f7f39[_0xb0e4('0x2d')][_0xb0e4('0x32')])){return _0x114098(_0x52f41e['error'](0x1f4,_0xb0e4('0x33')+_0x5eb2f4));}if(!_[_0xb0e4('0x34')](_0x5eb2f4,_0x4f7f39['body'][_0xb0e4('0x32')])){return _0x114098(_0x52f41e[_0xb0e4('0x12')](0x1f4,_0xb0e4('0x35')+_0x5eb2f4));}var _0x40a365={};_0x40a365[_0x4f7f39['body'][_0xb0e4('0x32')]]=_0x4f7f39[_0xb0e4('0x2d')][_0xb0e4('0x2f')];return db[_0xb0e4('0x16')][_0xb0e4('0x36')]({'where':{'id':_0x4f7f39[_0xb0e4('0x37')]['id']},'include':[{'model':db[_0xb0e4('0x38')],'as':_0xb0e4('0x39'),'include':[{'model':db[_0xb0e4('0x28')],'as':_0xb0e4('0x3a'),'where':_0x40a365,'limit':0x1,'order':[[_0xb0e4('0x2a'),'DESC']]}]},{'model':db[_0xb0e4('0x3b')],'as':_0xb0e4('0x3c')},{'model':db['MailServerOut'],'as':'Smtp','include':[{'model':db['CloudProvider'],'as':_0xb0e4('0x3d')}]}]})[_0xb0e4('0xc')](function(_0x4c2036){if(_0x4c2036&&_0x4c2036['List']){var _0x5e8a9a=_0x4c2036['get']({'plain':!![]});_0x3fbde8['account']=_['omit'](_0x5e8a9a,[_0xb0e4('0x3c'),'List']);_0x3fbde8[_0xb0e4('0x37')][_0xb0e4('0x3e')]=_0x4c2036[_0xb0e4('0x23')]();_0x3fbde8[_0xb0e4('0x3f')]=_0x5e8a9a['Applications'];_0x3fbde8[_0xb0e4('0x40')]=_0x5e8a9a[_0xb0e4('0x39')];_0x3fbde8['applications']=_[_0xb0e4('0x41')](_0x3fbde8['applications'],[_0xb0e4('0x42')],[_0xb0e4('0x43')]);if(_0x3fbde8[_0xb0e4('0x37')]&&_0x3fbde8[_0xb0e4('0x37')]['autoclose']){_0x3fbde8[_0xb0e4('0x3f')][_0xb0e4('0x44')]({'id':0x0,'priority':_0x3fbde8[_0xb0e4('0x3f')][_0xb0e4('0x45')]+0x1,'app':'close','appdata':_0xb0e4('0x46'),'interval':_0xb0e4('0x47')});}if(_0x3fbde8[_0xb0e4('0x37')]['Applications']){delete _0x3fbde8['account']['Applications'];}if(_0x3fbde8['account']['List']){delete _0x3fbde8[_0xb0e4('0x37')]['List'];}if(_0x5e8a9a[_0xb0e4('0x39')][_0xb0e4('0x3a')][_0xb0e4('0x45')]){return _0x5e8a9a[_0xb0e4('0x39')]['Contacts'][0x0];}var _0x387319=_[_0xb0e4('0x7')](_0x4f7f39['body'],{'firstName':_0x4f7f39[_0xb0e4('0x2d')]['from'],'ListId':_0x5e8a9a[_0xb0e4('0x2c')]});_0x387319[_0x4f7f39[_0xb0e4('0x2d')][_0xb0e4('0x32')]]=_0x4f7f39['body'][_0xb0e4('0x2f')];return db[_0xb0e4('0x28')]['create'](_0x387319);}else{throw new Error(_0xb0e4('0x48'));}})[_0xb0e4('0xc')](function(_0x4cf438){_0x3fbde8['contact']=_0x4cf438;if(_0x4cf438){if(!_0x4f7f39[_0xb0e4('0x2d')][_0xb0e4('0x13')][_0xb0e4('0x49')]){_0x4f7f39['body'][_0xb0e4('0x13')][_0xb0e4('0x49')]=rs['generate']()+'\x20'+_0x4f7f39[_0xb0e4('0x2d')][_0xb0e4('0x13')]['from'];}var _0x108395={'ContactId':_0x4cf438['id'],'MailAccountId':_0x4f7f39[_0xb0e4('0x37')]['id'],'inReplyTo':_0x4f7f39[_0xb0e4('0x2d')]['message'][_0xb0e4('0x49')],'to':_0x4f7f39[_0xb0e4('0x2d')][_0xb0e4('0x13')][_0xb0e4('0x2f')],'cc':_0x4f7f39['body'][_0xb0e4('0x13')]['cc'],'subject':_0x4f7f39[_0xb0e4('0x2d')][_0xb0e4('0x13')][_0xb0e4('0x4a')],'attach':_0x4f7f39[_0xb0e4('0x2d')][_0xb0e4('0x13')][_0xb0e4('0x4b')],'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0xb0e4('0x4c')][_0xb0e4('0x36')]({'where':{'closed':![],'MailAccountId':_0x4f7f39[_0xb0e4('0x37')]['id']},'include':[{'model':db[_0xb0e4('0x4d')],'as':_0xb0e4('0x4e'),'attributes':[_0xb0e4('0x49')],'where':{'messageId':_0x4f7f39[_0xb0e4('0x2d')][_0xb0e4('0x13')][_0xb0e4('0x4f')]}}]})[_0xb0e4('0xc')](function(_0x115dc7){if(_0x115dc7){return[_0x115dc7,![]];}return db[_0xb0e4('0x4c')][_0xb0e4('0x50')](_0x108395)[_0xb0e4('0xc')](function(_0xd3115a){return[_0xd3115a,!![]];});});}else{throw new Error(_0xb0e4('0x51'));}})['spread'](function(_0x4b1c07,_0x55868c){if(_0x4b1c07){_0x3e839e=_0x55868c;if(!_0x55868c){return _0x4b1c07[_0xb0e4('0x52')]({'inReplyTo':_0x4f7f39[_0xb0e4('0x2d')][_0xb0e4('0x13')][_0xb0e4('0x49')],'to':_0x4f7f39['body']['message'][_0xb0e4('0x2f')],'cc':_0x4f7f39[_0xb0e4('0x2d')][_0xb0e4('0x13')]['cc'],'subject':_0x4f7f39['body'][_0xb0e4('0x13')][_0xb0e4('0x4a')],'attach':_0x4b1c07['attach']?_0x4b1c07['attach']:_0x4f7f39[_0xb0e4('0x2d')]['message'][_0xb0e4('0x4b')],'substatus':null,'substatusAt':moment()[_0xb0e4('0x53')](_0xb0e4('0x54')),'lastMsgAt':moment()[_0xb0e4('0x53')](_0xb0e4('0x54')),'lastMsgDirection':'in'});}else{return _0x4b1c07;}}})[_0xb0e4('0xc')](function(_0x164c79){_0x3fbde8[_0xb0e4('0x55')]=_0x164c79[_0xb0e4('0x56')]({'plain':!![]});_0x3fbde8[_0xb0e4('0x55')][_0xb0e4('0x57')]=_0x3e839e;return db['MailMessage'][_0xb0e4('0x50')]({'body':_0x4f7f39[_0xb0e4('0x2d')][_0xb0e4('0x2d')],'MailAccountId':_0x4f7f39[_0xb0e4('0x37')]['id'],'MailInteractionId':_0x164c79['id'],'direction':'in','ContactId':_0x3fbde8[_0xb0e4('0x58')]['id'],'messageId':_0x4f7f39[_0xb0e4('0x2d')][_0xb0e4('0x13')][_0xb0e4('0x49')],'from':_0x4f7f39['body'][_0xb0e4('0x13')][_0xb0e4('0x2f')],'to':_0x4f7f39[_0xb0e4('0x2d')][_0xb0e4('0x13')]['to'],'cc':_0x4f7f39[_0xb0e4('0x2d')][_0xb0e4('0x13')]['cc'],'subject':_0x4f7f39[_0xb0e4('0x2d')][_0xb0e4('0x13')][_0xb0e4('0x4a')],'attach':_0x4f7f39['body'][_0xb0e4('0x13')]['attach'],'Attachments':_0x4f7f39[_0xb0e4('0x2d')]['message']['attachments'],'originTo':_0x4f7f39['body'][_0xb0e4('0x13')][_0xb0e4('0x59')],'originCc':_0x4f7f39[_0xb0e4('0x2d')][_0xb0e4('0x13')][_0xb0e4('0x5a')],'bcc':_0x4f7f39[_0xb0e4('0x2d')][_0xb0e4('0x13')]['bcc'],'ChatWebsiteId':_0x4f7f39[_0xb0e4('0x2d')]['message'][_0xb0e4('0x5b')]||null,'originChannel':_0x4f7f39['body']['message'][_0xb0e4('0x5c')]||'Email','ChatOfflineMessageId':_0x4f7f39['body'][_0xb0e4('0x13')][_0xb0e4('0x5d')]||null},{'include':[{'model':db[_0xb0e4('0x5e')],'as':_0xb0e4('0x5f')}]});})['then'](function(_0x193a35){_0x3fbde8[_0xb0e4('0x13')]=_0x193a35;if(!_0x3fbde8[_0xb0e4('0x55')]['UserId']){return;}return db['User'][_0xb0e4('0x36')]({'attributes':['id',_0xb0e4('0x60')],'where':{'id':_0x3fbde8[_0xb0e4('0x55')][_0xb0e4('0x61')]}});})['then'](function(_0x2ef0a4){if(_0x2ef0a4){_0x3fbde8['applications'][_0xb0e4('0x62')]({'id':0x0,'priority':0x0,'app':_0xb0e4('0x63'),'appdata':_0x2ef0a4[_0xb0e4('0x60')]+','+(_0x3fbde8[_0xb0e4('0x37')][_0xb0e4('0x64')]||0xa),'interval':_0xb0e4('0x47')});}if(!_0x3fbde8[_0xb0e4('0x55')]['queueId']){return;}return db[_0xb0e4('0x65')][_0xb0e4('0x36')]({'attributes':['id',_0xb0e4('0x60')],'where':{'id':_0x3fbde8[_0xb0e4('0x55')][_0xb0e4('0x66')]}});})[_0xb0e4('0xc')](function(_0x2f4b49){if(_0x2f4b49){_0x3fbde8[_0xb0e4('0x3f')][_0xb0e4('0x62')]({'id':0x0,'priority':0x1,'app':_0xb0e4('0x67'),'appdata':_0x2f4b49[_0xb0e4('0x60')]+','+(_0x3fbde8[_0xb0e4('0x37')]['waitForTheAssignedQueue']||0x12c),'interval':_0xb0e4('0x47')});}return respondWithRpcPromise(_0xb0e4('0x68'),_0xb0e4('0x69'),_0x3fbde8);})['then'](function(_0x359148){_0x4ec8c6(_0x359148);})[_0xb0e4('0x1e')](function(_0x467277){_0x114098(_0x52f41e[_0xb0e4('0x12')](0x1f4,_0x467277[_0xb0e4('0x13')]));});});}; \ No newline at end of file +var _0xf006=['agent','waitForTheAssignedAgent','MailQueue','queueId','queue','waitForTheAssignedQueue','Start','startRouting','bluebird','randomstring','../../mysqldb','rpc','client','http','redis','socket.io-emitter','./mailAccount.socket','register','request','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','MailAccount,\x20%s,\x20%s','result','catch','GetMailAccount','MailAccount','raw','options','attributes','limit','map','include','model','find','where','setDataValue','getSmtpOptions','ShowMailAccount','NotifyMailAccount','body','mail','difference','rawAttributes','createdAt','updatedAt','CompanyId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','account','List','CmContact','Contacts','DESC','MailApplication','Applications','MailServerOut','CloudProvider','omit','smtpOptions','applications','orderBy','priority','autoclose','push','length','close','*,*,*,*','defaults','ListId','create','contact','messageId','subject','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','Messages','inReplyTo','Contact\x20not\x20found','update','attach','get','interaction','created','MailMessage','attachments','originTo','originCc','bcc','ChatWebsiteId','ChatOfflineMessageId','Attachment','UserId','User','name','unshift'];(function(_0x1070b5,_0x3398bc){var _0x1eee10=function(_0x2bfffe){while(--_0x2bfffe){_0x1070b5['push'](_0x1070b5['shift']());}};_0x1eee10(++_0x3398bc);}(_0xf006,0x146));var _0x6f00=function(_0x40edf5,_0x468936){_0x40edf5=_0x40edf5-0x0;var _0x267c71=_0xf006[_0x40edf5];return _0x267c71;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require(_0x6f00('0x0'));var rs=require(_0x6f00('0x1'));var Redis=require('ioredis');var db=require(_0x6f00('0x2'))['db'];var logger=require('../../config/logger')(_0x6f00('0x3'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6f00('0x4')][_0x6f00('0x5')]({'port':0x232c});config[_0x6f00('0x6')]=_['defaults'](config[_0x6f00('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x6f00('0x7'))(new Redis(config[_0x6f00('0x6')]));require(_0x6f00('0x8'))[_0x6f00('0x9')](socket);function respondWithRpcPromise(_0x286d32,_0x3001c6,_0x44b63c){return new BPromise(function(_0x1e0720,_0x2aa181){return client[_0x6f00('0xa')](_0x286d32,_0x44b63c)[_0x6f00('0xb')](function(_0x13b052){logger[_0x6f00('0xc')]('MailAccount,\x20%s,\x20%s',_0x3001c6,_0x6f00('0xd'));logger[_0x6f00('0xe')](_0x6f00('0xf'),_0x3001c6,_0x6f00('0xd'),JSON[_0x6f00('0x10')](_0x13b052));if(_0x13b052['error']){if(_0x13b052[_0x6f00('0x11')]['code']===0x1f4){logger[_0x6f00('0x11')]('MailAccount,\x20%s,\x20%s',_0x3001c6,_0x13b052[_0x6f00('0x11')][_0x6f00('0x12')]);return _0x2aa181(_0x13b052[_0x6f00('0x11')][_0x6f00('0x12')]);}logger[_0x6f00('0x11')](_0x6f00('0x13'),_0x3001c6,_0x13b052[_0x6f00('0x11')][_0x6f00('0x12')]);return _0x1e0720(_0x13b052[_0x6f00('0x11')]['message']);}else{logger[_0x6f00('0xc')]('MailAccount,\x20%s,\x20%s',_0x3001c6,'request\x20sent');_0x1e0720(_0x13b052[_0x6f00('0x14')][_0x6f00('0x12')]);}})[_0x6f00('0x15')](function(_0x340f78){logger[_0x6f00('0x11')](_0x6f00('0x13'),_0x3001c6,_0x340f78);_0x2aa181(_0x340f78);});});}exports[_0x6f00('0x16')]=function(_0x295640){var _0x9844bf=this;return new Promise(function(_0x198cc7,_0x2d807f){return db[_0x6f00('0x17')]['findAll']({'raw':_0x295640['options']?_0x295640['options'][_0x6f00('0x18')]===undefined?!![]:![]:!![],'where':_0x295640[_0x6f00('0x19')]?_0x295640[_0x6f00('0x19')]['where']||null:null,'attributes':_0x295640[_0x6f00('0x19')]?_0x295640[_0x6f00('0x19')][_0x6f00('0x1a')]||null:null,'limit':_0x295640[_0x6f00('0x19')]?_0x295640[_0x6f00('0x19')][_0x6f00('0x1b')]||null:null,'include':_0x295640[_0x6f00('0x19')]?_0x295640[_0x6f00('0x19')]['include']?_[_0x6f00('0x1c')](_0x295640[_0x6f00('0x19')][_0x6f00('0x1d')],function(_0x4d41ef){return{'model':db[_0x4d41ef[_0x6f00('0x1e')]],'as':_0x4d41ef['as'],'attributes':_0x4d41ef['attributes'],'include':_0x4d41ef[_0x6f00('0x1d')]?_['map'](_0x4d41ef[_0x6f00('0x1d')],function(_0x39375d){return{'model':db[_0x39375d[_0x6f00('0x1e')]],'as':_0x39375d['as'],'attributes':_0x39375d[_0x6f00('0x1a')],'include':_0x39375d[_0x6f00('0x1d')]?_['map'](_0x39375d[_0x6f00('0x1d')],function(_0x25cc71){return{'model':db[_0x25cc71[_0x6f00('0x1e')]],'as':_0x25cc71['as'],'attributes':_0x25cc71[_0x6f00('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x6f00('0xb')](function(_0x235a86){logger[_0x6f00('0xc')](_0x6f00('0x16'),_0x295640);logger[_0x6f00('0xe')](_0x6f00('0x16'),_0x295640,JSON[_0x6f00('0x10')](_0x235a86));_0x198cc7(_0x235a86);})[_0x6f00('0x15')](function(_0x29555d){logger[_0x6f00('0x11')]('GetMailAccount',_0x29555d['message'],_0x295640);_0x2d807f(_0x9844bf['error'](0x1f4,_0x29555d['message']));});});};exports['ShowMailAccount']=function(_0x4edc83){var _0xc5ad42=this;return new Promise(function(_0x56338c,_0x3c0e5d){return db[_0x6f00('0x17')][_0x6f00('0x1f')]({'raw':_0x4edc83[_0x6f00('0x19')]?_0x4edc83[_0x6f00('0x19')][_0x6f00('0x18')]===undefined?!![]:![]:!![],'where':_0x4edc83['options']?_0x4edc83[_0x6f00('0x19')][_0x6f00('0x20')]||null:null,'attributes':_0x4edc83[_0x6f00('0x19')]?_0x4edc83[_0x6f00('0x19')][_0x6f00('0x1a')]||null:null,'include':_0x4edc83['options']?_0x4edc83['options']['include']?_[_0x6f00('0x1c')](_0x4edc83[_0x6f00('0x19')][_0x6f00('0x1d')],function(_0x27ebb4){return{'model':db[_0x27ebb4[_0x6f00('0x1e')]],'as':_0x27ebb4['as'],'attributes':_0x27ebb4['attributes'],'include':_0x27ebb4[_0x6f00('0x1d')]?_[_0x6f00('0x1c')](_0x27ebb4[_0x6f00('0x1d')],function(_0x4646dc){return{'model':db[_0x4646dc[_0x6f00('0x1e')]],'as':_0x4646dc['as'],'attributes':_0x4646dc[_0x6f00('0x1a')],'include':_0x4646dc[_0x6f00('0x1d')]?_['map'](_0x4646dc[_0x6f00('0x1d')],function(_0x1dee52){return{'model':db[_0x1dee52[_0x6f00('0x1e')]],'as':_0x1dee52['as'],'attributes':_0x1dee52['attributes']};}):[]};}):[]};}):[]:[]})[_0x6f00('0xb')](function(_0x389ff9){if(_0x4edc83[_0x6f00('0x19')]['smtp']===!![])_0x389ff9[_0x6f00('0x21')]('smtpOptions',_0x389ff9[_0x6f00('0x22')]());logger['info'](_0x6f00('0x23'),_0x4edc83);logger[_0x6f00('0xe')](_0x6f00('0x23'),_0x4edc83,JSON[_0x6f00('0x10')](_0x389ff9));_0x56338c(_0x389ff9);})['catch'](function(_0xcfcc78){logger['error'](_0x6f00('0x23'),_0xcfcc78['message'],_0x4edc83);_0x3c0e5d(_0xc5ad42[_0x6f00('0x11')](0x1f4,_0xcfcc78[_0x6f00('0x12')]));});});};exports[_0x6f00('0x24')]=function(_0x1ed015){var _0x57c72d=this;return new Promise(function(_0x53dc8c,_0x2e745c){var _0x51bfbd={'body':_0x1ed015[_0x6f00('0x25')],'channel':_0x6f00('0x26')};var _0x4a70ea=_[_0x6f00('0x27')](_['keys'](db['CmContact'][_0x6f00('0x28')]),[_0x6f00('0x29'),_0x6f00('0x2a'),_0x6f00('0x2b'),'ListId']);var _0x38ee25=![];if(_0x1ed015[_0x6f00('0x25')]['id']){delete _0x1ed015[_0x6f00('0x25')]['id'];}if(_[_0x6f00('0x2c')](_0x1ed015[_0x6f00('0x25')][_0x6f00('0x2d')])){return _0x2e745c(_0x57c72d['error'](0x1f4,_0x6f00('0x2e')));}if(_[_0x6f00('0x2c')](_0x1ed015[_0x6f00('0x25')][_0x6f00('0x25')])||_0x1ed015[_0x6f00('0x25')][_0x6f00('0x25')]===''){return _0x2e745c(_0x57c72d['error'](0x1f4,_0x6f00('0x2f')));}if(_[_0x6f00('0x2c')](_0x1ed015[_0x6f00('0x25')]['mapKey'])){return _0x2e745c(_0x57c72d[_0x6f00('0x11')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4a70ea));}if(!_[_0x6f00('0x30')](_0x4a70ea,_0x1ed015[_0x6f00('0x25')]['mapKey'])){return _0x2e745c(_0x57c72d[_0x6f00('0x11')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4a70ea));}var _0xadd6d8={};_0xadd6d8[_0x1ed015[_0x6f00('0x25')][_0x6f00('0x31')]]=_0x1ed015[_0x6f00('0x25')]['from'];return db[_0x6f00('0x17')]['find']({'where':{'id':_0x1ed015[_0x6f00('0x32')]['id']},'include':[{'model':db['CmList'],'as':_0x6f00('0x33'),'include':[{'model':db[_0x6f00('0x34')],'as':_0x6f00('0x35'),'where':_0xadd6d8,'limit':0x1,'order':[[_0x6f00('0x2a'),_0x6f00('0x36')]]}]},{'model':db[_0x6f00('0x37')],'as':_0x6f00('0x38')},{'model':db[_0x6f00('0x39')],'as':'Smtp','include':[{'model':db[_0x6f00('0x3a')],'as':'CloudProvider'}]}]})[_0x6f00('0xb')](function(_0x31fb17){if(_0x31fb17&&_0x31fb17[_0x6f00('0x33')]){var _0x5eec08=_0x31fb17['get']({'plain':!![]});_0x51bfbd[_0x6f00('0x32')]=_[_0x6f00('0x3b')](_0x5eec08,['Applications',_0x6f00('0x33')]);_0x51bfbd['account'][_0x6f00('0x3c')]=_0x31fb17['getSmtpOptions']();_0x51bfbd[_0x6f00('0x3d')]=_0x5eec08[_0x6f00('0x38')];_0x51bfbd['list']=_0x5eec08['List'];_0x51bfbd[_0x6f00('0x3d')]=_[_0x6f00('0x3e')](_0x51bfbd['applications'],[_0x6f00('0x3f')],['asc']);if(_0x51bfbd[_0x6f00('0x32')]&&_0x51bfbd[_0x6f00('0x32')][_0x6f00('0x40')]){_0x51bfbd[_0x6f00('0x3d')][_0x6f00('0x41')]({'id':0x0,'priority':_0x51bfbd[_0x6f00('0x3d')][_0x6f00('0x42')]+0x1,'app':_0x6f00('0x43'),'appdata':_0x6f00('0x40'),'interval':_0x6f00('0x44')});}if(_0x51bfbd[_0x6f00('0x32')][_0x6f00('0x38')]){delete _0x51bfbd[_0x6f00('0x32')][_0x6f00('0x38')];}if(_0x51bfbd[_0x6f00('0x32')][_0x6f00('0x33')]){delete _0x51bfbd[_0x6f00('0x32')][_0x6f00('0x33')];}if(_0x5eec08[_0x6f00('0x33')][_0x6f00('0x35')]['length']){return _0x5eec08['List'][_0x6f00('0x35')][0x0];}var _0x5eda94=_[_0x6f00('0x45')](_0x1ed015[_0x6f00('0x25')],{'firstName':_0x1ed015['body'][_0x6f00('0x2d')],'ListId':_0x5eec08[_0x6f00('0x46')]});_0x5eda94[_0x1ed015[_0x6f00('0x25')]['mapKey']]=_0x1ed015[_0x6f00('0x25')]['from'];return db[_0x6f00('0x34')][_0x6f00('0x47')](_0x5eda94);}else{throw new Error('List\x20not\x20found');}})[_0x6f00('0xb')](function(_0x28677d){_0x51bfbd[_0x6f00('0x48')]=_0x28677d;if(_0x28677d){if(!_0x1ed015[_0x6f00('0x25')][_0x6f00('0x12')][_0x6f00('0x49')]){_0x1ed015[_0x6f00('0x25')]['message']['messageId']=rs['generate']()+'\x20'+_0x1ed015['body'][_0x6f00('0x12')][_0x6f00('0x2d')];}var _0x5bbfdb={'ContactId':_0x28677d['id'],'MailAccountId':_0x1ed015['account']['id'],'inReplyTo':_0x1ed015[_0x6f00('0x25')][_0x6f00('0x12')][_0x6f00('0x49')],'to':_0x1ed015[_0x6f00('0x25')]['message'][_0x6f00('0x2d')],'cc':_0x1ed015['body']['message']['cc'],'subject':_0x1ed015[_0x6f00('0x25')][_0x6f00('0x12')][_0x6f00('0x4a')],'attach':_0x1ed015[_0x6f00('0x25')][_0x6f00('0x12')]['attach'],'lastMsgAt':moment()[_0x6f00('0x4b')](_0x6f00('0x4c')),'lastMsgDirection':'in'};return db[_0x6f00('0x4d')][_0x6f00('0x1f')]({'where':{'closed':![],'MailAccountId':_0x1ed015['account']['id']},'include':[{'model':db['MailMessage'],'as':_0x6f00('0x4e'),'attributes':['messageId'],'where':{'messageId':_0x1ed015[_0x6f00('0x25')][_0x6f00('0x12')][_0x6f00('0x4f')]}}]})[_0x6f00('0xb')](function(_0x53e55c){if(_0x53e55c){return[_0x53e55c,![]];}return db['MailInteraction'][_0x6f00('0x47')](_0x5bbfdb)[_0x6f00('0xb')](function(_0x4ff6dc){return[_0x4ff6dc,!![]];});});}else{throw new Error(_0x6f00('0x50'));}})['spread'](function(_0x14554c,_0x37af94){if(_0x14554c){_0x38ee25=_0x37af94;if(!_0x37af94){return _0x14554c[_0x6f00('0x51')]({'inReplyTo':_0x1ed015[_0x6f00('0x25')][_0x6f00('0x12')]['messageId'],'to':_0x1ed015['body']['message'][_0x6f00('0x2d')],'cc':_0x1ed015[_0x6f00('0x25')]['message']['cc'],'subject':_0x1ed015['body'][_0x6f00('0x12')][_0x6f00('0x4a')],'attach':_0x14554c['attach']?_0x14554c['attach']:_0x1ed015[_0x6f00('0x25')][_0x6f00('0x12')][_0x6f00('0x52')],'substatus':null,'substatusAt':moment()[_0x6f00('0x4b')](_0x6f00('0x4c')),'lastMsgAt':moment()[_0x6f00('0x4b')](_0x6f00('0x4c')),'lastMsgDirection':'in'});}else{return _0x14554c;}}})[_0x6f00('0xb')](function(_0x5ee0b6){_0x51bfbd['interaction']=_0x5ee0b6[_0x6f00('0x53')]({'plain':!![]});_0x51bfbd[_0x6f00('0x54')][_0x6f00('0x55')]=_0x38ee25;return db[_0x6f00('0x56')][_0x6f00('0x47')]({'body':_0x1ed015[_0x6f00('0x25')][_0x6f00('0x25')],'MailAccountId':_0x1ed015[_0x6f00('0x32')]['id'],'MailInteractionId':_0x5ee0b6['id'],'direction':'in','ContactId':_0x51bfbd[_0x6f00('0x48')]['id'],'messageId':_0x1ed015[_0x6f00('0x25')][_0x6f00('0x12')][_0x6f00('0x49')],'from':_0x1ed015[_0x6f00('0x25')][_0x6f00('0x12')][_0x6f00('0x2d')],'to':_0x1ed015[_0x6f00('0x25')][_0x6f00('0x12')]['to'],'cc':_0x1ed015['body']['message']['cc'],'subject':_0x1ed015[_0x6f00('0x25')]['message'][_0x6f00('0x4a')],'attach':_0x1ed015[_0x6f00('0x25')][_0x6f00('0x12')][_0x6f00('0x52')],'Attachments':_0x1ed015[_0x6f00('0x25')]['message'][_0x6f00('0x57')],'originTo':_0x1ed015[_0x6f00('0x25')][_0x6f00('0x12')][_0x6f00('0x58')],'originCc':_0x1ed015[_0x6f00('0x25')][_0x6f00('0x12')][_0x6f00('0x59')],'bcc':_0x1ed015[_0x6f00('0x25')][_0x6f00('0x12')][_0x6f00('0x5a')],'ChatWebsiteId':_0x1ed015[_0x6f00('0x25')]['message'][_0x6f00('0x5b')]||null,'originChannel':_0x1ed015[_0x6f00('0x25')][_0x6f00('0x12')]['originChannel']||'Email','ChatOfflineMessageId':_0x1ed015[_0x6f00('0x25')][_0x6f00('0x12')][_0x6f00('0x5c')]||null},{'include':[{'model':db[_0x6f00('0x5d')],'as':'Attachments'}]});})['then'](function(_0x4cb62d){_0x51bfbd['message']=_0x4cb62d;if(!_0x51bfbd[_0x6f00('0x54')][_0x6f00('0x5e')]){return;}return db[_0x6f00('0x5f')][_0x6f00('0x1f')]({'attributes':['id',_0x6f00('0x60')],'where':{'id':_0x51bfbd['interaction'][_0x6f00('0x5e')]}});})[_0x6f00('0xb')](function(_0x538143){if(_0x538143){_0x51bfbd[_0x6f00('0x3d')][_0x6f00('0x61')]({'id':0x0,'priority':0x0,'app':_0x6f00('0x62'),'appdata':_0x538143[_0x6f00('0x60')]+','+(_0x51bfbd[_0x6f00('0x32')][_0x6f00('0x63')]||0xa),'interval':_0x6f00('0x44')});}if(!_0x51bfbd[_0x6f00('0x54')]['queueId']){return;}return db[_0x6f00('0x64')]['find']({'attributes':['id',_0x6f00('0x60')],'where':{'id':_0x51bfbd[_0x6f00('0x54')][_0x6f00('0x65')]}});})[_0x6f00('0xb')](function(_0x1ad295){if(_0x1ad295){_0x51bfbd[_0x6f00('0x3d')][_0x6f00('0x61')]({'id':0x0,'priority':0x1,'app':_0x6f00('0x66'),'appdata':_0x1ad295[_0x6f00('0x60')]+','+(_0x51bfbd[_0x6f00('0x32')][_0x6f00('0x67')]||0x12c),'interval':_0x6f00('0x44')});}return respondWithRpcPromise(_0x6f00('0x68'),_0x6f00('0x69'),_0x51bfbd);})['then'](function(_0x3ba021){_0x53dc8c(_0x3ba021);})[_0x6f00('0x15')](function(_0x1be439){_0x2e745c(_0x57c72d['error'](0x1f4,_0x1be439[_0x6f00('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 682dcb6..090d402 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 _0xc30e=['emit','register','length','mailAccount:','save','update'];(function(_0x152b6c,_0x43847e){var _0x1c5335=function(_0x3a3bcf){while(--_0x3a3bcf){_0x152b6c['push'](_0x152b6c['shift']());}};_0x1c5335(++_0x43847e);}(_0xc30e,0x15a));var _0xec30=function(_0x24ef32,_0x5a731d){_0x24ef32=_0x24ef32-0x0;var _0x140acd=_0xc30e[_0x24ef32];return _0x140acd;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0xec30('0x0'),'remove',_0xec30('0x1')];function createListener(_0x1e3ebd,_0x2209cc){return function(_0x299e39){_0x2209cc[_0xec30('0x2')](_0x1e3ebd,_0x299e39);};}function removeListener(_0x1b7a23,_0x5622fd){return function(){MailAccountEvents['removeListener'](_0x1b7a23,_0x5622fd);};}exports[_0xec30('0x3')]=function(_0x1a2c15){for(var _0xf4286d=0x0,_0x5a1daf=events[_0xec30('0x4')];_0xf4286d<_0x5a1daf;_0xf4286d++){var _0x275ea2=events[_0xf4286d];var _0x1e46f9=createListener(_0xec30('0x5')+_0x275ea2,_0x1a2c15);MailAccountEvents['on'](_0x275ea2,_0x1e46f9);}}; \ No newline at end of file +var _0xd6dc=['removeListener','register','length','mailAccount:','./mailAccount.events','save','update','emit'];(function(_0x48a31c,_0x2897f6){var _0x213ddd=function(_0x52b953){while(--_0x52b953){_0x48a31c['push'](_0x48a31c['shift']());}};_0x213ddd(++_0x2897f6);}(_0xd6dc,0x184));var _0xcd6d=function(_0x5f0964,_0x407e25){_0x5f0964=_0x5f0964-0x0;var _0x18873e=_0xd6dc[_0x5f0964];return _0x18873e;};'use strict';var MailAccountEvents=require(_0xcd6d('0x0'));var events=[_0xcd6d('0x1'),'remove',_0xcd6d('0x2')];function createListener(_0x325305,_0x35f502){return function(_0x49c797){_0x35f502[_0xcd6d('0x3')](_0x325305,_0x49c797);};}function removeListener(_0x170703,_0x5a8dbe){return function(){MailAccountEvents[_0xcd6d('0x4')](_0x170703,_0x5a8dbe);};}exports[_0xcd6d('0x5')]=function(_0x4be466){for(var _0xbb2564=0x0,_0x52c3c9=events[_0xcd6d('0x6')];_0xbb2564<_0x52c3c9;_0xbb2564++){var _0x31345d=events[_0xbb2564];var _0x4d9f05=createListener(_0xcd6d('0x7')+_0x31345d,_0x4be466);MailAccountEvents['on'](_0x31345d,_0x4d9f05);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 2145218..fc19c2c 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 _0x1998=['../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','/:id','isAuthenticated','show','put','update','destroy','exports','path','connect-timeout','express','Router','fs-extra'];(function(_0x30e932,_0x5586b6){var _0x49c44f=function(_0x84971e){while(--_0x84971e){_0x30e932['push'](_0x30e932['shift']());}};_0x49c44f(++_0x5586b6);}(_0x1998,0xdb));var _0x8199=function(_0x527425,_0x36fa2e){_0x527425=_0x527425-0x0;var _0x5b3184=_0x1998[_0x527425];return _0x5b3184;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8199('0x0'));var timeout=require(_0x8199('0x1'));var express=require(_0x8199('0x2'));var router=express[_0x8199('0x3')]();var fs_extra=require(_0x8199('0x4'));var auth=require(_0x8199('0x5'));var interaction=require(_0x8199('0x6'));var config=require(_0x8199('0x7'));var controller=require(_0x8199('0x8'));router['get'](_0x8199('0x9'),auth[_0x8199('0xa')](),controller[_0x8199('0xb')]);router[_0x8199('0xc')](_0x8199('0x9'),auth['isAuthenticated'](),controller[_0x8199('0xd')]);router['delete'](_0x8199('0x9'),auth['isAuthenticated'](),controller[_0x8199('0xe')]);module[_0x8199('0xf')]=router; \ No newline at end of file +var _0x450a=['./mailApplication.controller','get','isAuthenticated','put','/:id','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xf3121d,_0x26340a){var _0x511854=function(_0x328f11){while(--_0x328f11){_0xf3121d['push'](_0xf3121d['shift']());}};_0x511854(++_0x26340a);}(_0x450a,0x86));var _0xa450=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x450a[_0x19950b];return _0x3c6b41;};'use strict';var multer=require(_0xa450('0x0'));var util=require(_0xa450('0x1'));var path=require(_0xa450('0x2'));var timeout=require(_0xa450('0x3'));var express=require(_0xa450('0x4'));var router=express[_0xa450('0x5')]();var fs_extra=require(_0xa450('0x6'));var auth=require(_0xa450('0x7'));var interaction=require(_0xa450('0x8'));var config=require(_0xa450('0x9'));var controller=require(_0xa450('0xa'));router[_0xa450('0xb')]('/:id',auth[_0xa450('0xc')](),controller['show']);router[_0xa450('0xd')](_0xa450('0xe'),auth[_0xa450('0xc')](),controller['update']);router['delete'](_0xa450('0xe'),auth['isAuthenticated'](),controller[_0xa450('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 506a6ad..859a2b2 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 _0xbbff=['STRING','TEXT','sequelize','exports','INTEGER'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0xbbff,0x192));var _0xfbbf=function(_0x96ed90,_0x305c52){_0x96ed90=_0x96ed90-0x0;var _0x9df507=_0xbbff[_0x96ed90];return _0x9df507;};'use strict';var Sequelize=require(_0xfbbf('0x0'));module[_0xfbbf('0x1')]={'priority':{'type':Sequelize[_0xfbbf('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xfbbf('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xfbbf('0x4')]()},'description':{'type':Sequelize[_0xfbbf('0x3')]},'interval':{'type':Sequelize[_0xfbbf('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x7809=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0xd11863,_0x1a251f){var _0x5904c0=function(_0x336d99){while(--_0x336d99){_0xd11863['push'](_0xd11863['shift']());}};_0x5904c0(++_0x1a251f);}(_0x7809,0xf2));var _0x9780=function(_0x5036aa,_0x46ea5a){_0x5036aa=_0x5036aa-0x0;var _0x1e4814=_0x7809[_0x5036aa];return _0x1e4814;};'use strict';var Sequelize=require(_0x9780('0x0'));module[_0x9780('0x1')]={'priority':{'type':Sequelize[_0x9780('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x9780('0x3')],'allowNull':![],'defaultValue':_0x9780('0x4')},'appdata':{'type':Sequelize[_0x9780('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x9780('0x3')],'defaultValue':_0x9780('0x6')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index f58f251..8eadabb 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 _0x54ef=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','name','show','params','model','rawAttributes','query','keys','filters','intersection','attributes','fields','length','merge','options','MailApplication','find','body','catch','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x25c151,_0x5df87a){var _0x19b175=function(_0x4e5d81){while(--_0x4e5d81){_0x25c151['push'](_0x25c151['shift']());}};_0x19b175(++_0x5df87a);}(_0x54ef,0x112));var _0xf54e=function(_0x138b19,_0x2fca69){_0x138b19=_0x138b19-0x0;var _0x308b78=_0x54ef[_0x138b19];return _0x308b78;};'use strict';var emlformat=require(_0xf54e('0x0'));var rimraf=require(_0xf54e('0x1'));var zipdir=require(_0xf54e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf54e('0x3'));var moment=require(_0xf54e('0x4'));var BPromise=require(_0xf54e('0x5'));var Mustache=require(_0xf54e('0x6'));var util=require(_0xf54e('0x7'));var path=require(_0xf54e('0x8'));var sox=require(_0xf54e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf54e('0xa'));var _=require(_0xf54e('0xb'));var squel=require(_0xf54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf54e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf54e('0xe'));var querystring=require(_0xf54e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf54e('0x10'));var authService=require(_0xf54e('0x11'));var qs=require(_0xf54e('0x12'));var as=require(_0xf54e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf54e('0x14'))(_0xf54e('0x15'));var utils=require(_0xf54e('0x16'));var config=require(_0xf54e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf54e('0x18'))['db'];function respondWithStatusCode(_0x4b0ee1,_0x4bd828){_0x4bd828=_0x4bd828||0xcc;return function(_0x15a9d4){if(_0x15a9d4){return _0x4b0ee1[_0xf54e('0x19')](_0x4bd828);}return _0x4b0ee1[_0xf54e('0x1a')](_0x4bd828)[_0xf54e('0x1b')]();};}function respondWithResult(_0x5644aa,_0x331732){_0x331732=_0x331732||0xc8;return function(_0x1bbeaa){if(_0x1bbeaa){return _0x5644aa[_0xf54e('0x1a')](_0x331732)[_0xf54e('0x1c')](_0x1bbeaa);}};}function respondWithFilteredResult(_0x56828e,_0x2366ee){return function(_0x389abc){if(_0x389abc){var _0x3eb415=typeof _0x2366ee['offset']==='undefined'&&typeof _0x2366ee[_0xf54e('0x1d')]===_0xf54e('0x1e');var _0x1c02e7=_0x389abc[_0xf54e('0x1f')];var _0x15cc48=_0x3eb415?0x0:_0x2366ee[_0xf54e('0x20')];var _0x2e27b6=_0x3eb415?_0x389abc[_0xf54e('0x1f')]:_0x2366ee[_0xf54e('0x20')]+_0x2366ee[_0xf54e('0x1d')];var _0x226c96;if(_0x2e27b6>=_0x1c02e7){_0x2e27b6=_0x1c02e7;_0x226c96=0xc8;}else{_0x226c96=0xce;}_0x56828e['status'](_0x226c96);return _0x56828e['set'](_0xf54e('0x21'),_0x15cc48+'-'+_0x2e27b6+'/'+_0x1c02e7)['json'](_0x389abc);}return null;};}function patchUpdates(_0x3e1556){return function(_0x1bfe99){try{jsonpatch[_0xf54e('0x22')](_0x1bfe99,_0x3e1556,!![]);}catch(_0x9903fc){return BPromise[_0xf54e('0x23')](_0x9903fc);}return _0x1bfe99[_0xf54e('0x24')]();};}function saveUpdates(_0x388aa0,_0x11985e){return function(_0x3c0169){if(_0x3c0169){return _0x3c0169[_0xf54e('0x25')](_0x388aa0)[_0xf54e('0x26')](function(_0x5b83df){return _0x5b83df;});}return null;};}function removeEntity(_0x6f6d29,_0x54f914){return function(_0x264a8f){if(_0x264a8f){return _0x264a8f[_0xf54e('0x27')]()[_0xf54e('0x26')](function(){_0x6f6d29[_0xf54e('0x1a')](0xcc)[_0xf54e('0x1b')]();});}};}function handleEntityNotFound(_0x160160,_0x1e08d1){return function(_0x43488d){if(!_0x43488d){_0x160160[_0xf54e('0x19')](0x194);}return _0x43488d;};}function handleError(_0x33457f,_0xf6cdd7){_0xf6cdd7=_0xf6cdd7||0x1f4;return function(_0x39c0ae){logger[_0xf54e('0x28')](_0x39c0ae['stack']);if(_0x39c0ae[_0xf54e('0x29')]){delete _0x39c0ae['name'];}_0x33457f[_0xf54e('0x1a')](_0xf6cdd7)['send'](_0x39c0ae);};}exports[_0xf54e('0x2a')]=function(_0x269f47,_0x21ba00){var _0xa13cd0={'raw':!![],'where':{'id':_0x269f47[_0xf54e('0x2b')]['id']}},_0x25b643={};_0x25b643[_0xf54e('0x2c')]=_['keys'](db['MailApplication'][_0xf54e('0x2d')]);_0x25b643[_0xf54e('0x2e')]=_[_0xf54e('0x2f')](_0x269f47[_0xf54e('0x2e')]);_0x25b643[_0xf54e('0x30')]=_[_0xf54e('0x31')](_0x25b643[_0xf54e('0x2c')],_0x25b643[_0xf54e('0x2e')]);_0xa13cd0[_0xf54e('0x32')]=_[_0xf54e('0x31')](_0x25b643['model'],qs['fields'](_0x269f47[_0xf54e('0x2e')][_0xf54e('0x33')]));_0xa13cd0['attributes']=_0xa13cd0[_0xf54e('0x32')][_0xf54e('0x34')]?_0xa13cd0[_0xf54e('0x32')]:_0x25b643[_0xf54e('0x2c')];if(_0x269f47['query']['includeAll']){_0xa13cd0['include']=[{'all':!![]}];}_0xa13cd0=_[_0xf54e('0x35')]({},_0xa13cd0,_0x269f47[_0xf54e('0x36')]);return db[_0xf54e('0x37')][_0xf54e('0x38')](_0xa13cd0)[_0xf54e('0x26')](handleEntityNotFound(_0x21ba00,null))[_0xf54e('0x26')](respondWithResult(_0x21ba00,null))['catch'](handleError(_0x21ba00,null));};exports['update']=function(_0x530cee,_0xc04e04){if(_0x530cee[_0xf54e('0x39')]['id']){delete _0x530cee['body']['id'];}return db['MailApplication'][_0xf54e('0x38')]({'where':{'id':_0x530cee[_0xf54e('0x2b')]['id']}})[_0xf54e('0x26')](handleEntityNotFound(_0xc04e04,null))['then'](saveUpdates(_0x530cee[_0xf54e('0x39')],null))[_0xf54e('0x26')](respondWithResult(_0xc04e04,null))['catch'](handleError(_0xc04e04,null));};exports[_0xf54e('0x27')]=function(_0x6e5bdf,_0x5af03){return db[_0xf54e('0x37')][_0xf54e('0x38')]({'where':{'id':_0x6e5bdf[_0xf54e('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5af03,null))['then'](removeEntity(_0x5af03,null))[_0xf54e('0x3a')](handleError(_0x5af03,null));}; \ No newline at end of file +var _0xda3f=['includeAll','include','merge','find','catch','body','MailApplication','destroy','rimraf','zip-dir','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','end','stack','name','send','params','model','keys','query','filters','intersection','attributes','fields','length'];(function(_0x313823,_0x530249){var _0x4d2f81=function(_0x40023f){while(--_0x40023f){_0x313823['push'](_0x313823['shift']());}};_0x4d2f81(++_0x530249);}(_0xda3f,0xec));var _0xfda3=function(_0x3005b5,_0x27978d){_0x3005b5=_0x3005b5-0x0;var _0x2ef4e8=_0xda3f[_0x3005b5];return _0x2ef4e8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfda3('0x0'));var zipdir=require(_0xfda3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfda3('0x2'));var Mustache=require('mustache');var util=require(_0xfda3('0x3'));var path=require(_0xfda3('0x4'));var sox=require('sox');var csv=require(_0xfda3('0x5'));var ejs=require(_0xfda3('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfda3('0x7'));var crypto=require(_0xfda3('0x8'));var jsforce=require(_0xfda3('0x9'));var deskjs=require(_0xfda3('0xa'));var toCsv=require(_0xfda3('0x5'));var querystring=require(_0xfda3('0xb'));var Papa=require(_0xfda3('0xc'));var Redis=require(_0xfda3('0xd'));var authService=require(_0xfda3('0xe'));var qs=require(_0xfda3('0xf'));var as=require(_0xfda3('0x10'));var hardwareService=require(_0xfda3('0x11'));var logger=require('../../config/logger')(_0xfda3('0x12'));var utils=require(_0xfda3('0x13'));var config=require(_0xfda3('0x14'));var licenseUtil=require(_0xfda3('0x15'));var db=require(_0xfda3('0x16'))['db'];function respondWithStatusCode(_0x4b77ea,_0x583125){_0x583125=_0x583125||0xcc;return function(_0x5d7d5b){if(_0x5d7d5b){return _0x4b77ea[_0xfda3('0x17')](_0x583125);}return _0x4b77ea[_0xfda3('0x18')](_0x583125)['end']();};}function respondWithResult(_0x501588,_0x587e9b){_0x587e9b=_0x587e9b||0xc8;return function(_0x227d72){if(_0x227d72){return _0x501588[_0xfda3('0x18')](_0x587e9b)['json'](_0x227d72);}};}function respondWithFilteredResult(_0x57a229,_0x533365){return function(_0x80ea80){if(_0x80ea80){var _0x474707=typeof _0x533365[_0xfda3('0x19')]===_0xfda3('0x1a')&&typeof _0x533365[_0xfda3('0x1b')]===_0xfda3('0x1a');var _0x2aadcb=_0x80ea80[_0xfda3('0x1c')];var _0x4680bf=_0x474707?0x0:_0x533365[_0xfda3('0x19')];var _0x54a7c6=_0x474707?_0x80ea80[_0xfda3('0x1c')]:_0x533365[_0xfda3('0x19')]+_0x533365[_0xfda3('0x1b')];var _0x32855a;if(_0x54a7c6>=_0x2aadcb){_0x54a7c6=_0x2aadcb;_0x32855a=0xc8;}else{_0x32855a=0xce;}_0x57a229['status'](_0x32855a);return _0x57a229[_0xfda3('0x1d')](_0xfda3('0x1e'),_0x4680bf+'-'+_0x54a7c6+'/'+_0x2aadcb)[_0xfda3('0x1f')](_0x80ea80);}return null;};}function patchUpdates(_0x51e731){return function(_0x5ad52a){try{jsonpatch[_0xfda3('0x20')](_0x5ad52a,_0x51e731,!![]);}catch(_0x38d428){return BPromise[_0xfda3('0x21')](_0x38d428);}return _0x5ad52a['save']();};}function saveUpdates(_0x3cf5a9,_0xef2535){return function(_0x1e15a8){if(_0x1e15a8){return _0x1e15a8[_0xfda3('0x22')](_0x3cf5a9)[_0xfda3('0x23')](function(_0x2b84b7){return _0x2b84b7;});}return null;};}function removeEntity(_0x2677f6,_0xc6fb9a){return function(_0x16eaa6){if(_0x16eaa6){return _0x16eaa6['destroy']()[_0xfda3('0x23')](function(){_0x2677f6[_0xfda3('0x18')](0xcc)[_0xfda3('0x24')]();});}};}function handleEntityNotFound(_0x4ae9b9,_0x45a977){return function(_0x39e246){if(!_0x39e246){_0x4ae9b9[_0xfda3('0x17')](0x194);}return _0x39e246;};}function handleError(_0x38946d,_0x1cb831){_0x1cb831=_0x1cb831||0x1f4;return function(_0xad9f7b){logger['error'](_0xad9f7b[_0xfda3('0x25')]);if(_0xad9f7b[_0xfda3('0x26')]){delete _0xad9f7b[_0xfda3('0x26')];}_0x38946d[_0xfda3('0x18')](_0x1cb831)[_0xfda3('0x27')](_0xad9f7b);};}exports['show']=function(_0x3c1549,_0x4101b1){var _0x301509={'raw':!![],'where':{'id':_0x3c1549[_0xfda3('0x28')]['id']}},_0x474992={};_0x474992[_0xfda3('0x29')]=_[_0xfda3('0x2a')](db['MailApplication']['rawAttributes']);_0x474992[_0xfda3('0x2b')]=_['keys'](_0x3c1549['query']);_0x474992[_0xfda3('0x2c')]=_[_0xfda3('0x2d')](_0x474992[_0xfda3('0x29')],_0x474992[_0xfda3('0x2b')]);_0x301509[_0xfda3('0x2e')]=_[_0xfda3('0x2d')](_0x474992[_0xfda3('0x29')],qs[_0xfda3('0x2f')](_0x3c1549[_0xfda3('0x2b')]['fields']));_0x301509[_0xfda3('0x2e')]=_0x301509[_0xfda3('0x2e')][_0xfda3('0x30')]?_0x301509[_0xfda3('0x2e')]:_0x474992[_0xfda3('0x29')];if(_0x3c1549[_0xfda3('0x2b')][_0xfda3('0x31')]){_0x301509[_0xfda3('0x32')]=[{'all':!![]}];}_0x301509=_[_0xfda3('0x33')]({},_0x301509,_0x3c1549['options']);return db['MailApplication'][_0xfda3('0x34')](_0x301509)[_0xfda3('0x23')](handleEntityNotFound(_0x4101b1,null))['then'](respondWithResult(_0x4101b1,null))[_0xfda3('0x35')](handleError(_0x4101b1,null));};exports[_0xfda3('0x22')]=function(_0x28ca96,_0x52ee98){if(_0x28ca96[_0xfda3('0x36')]['id']){delete _0x28ca96[_0xfda3('0x36')]['id'];}return db[_0xfda3('0x37')][_0xfda3('0x34')]({'where':{'id':_0x28ca96[_0xfda3('0x28')]['id']}})['then'](handleEntityNotFound(_0x52ee98,null))[_0xfda3('0x23')](saveUpdates(_0x28ca96[_0xfda3('0x36')],null))[_0xfda3('0x23')](respondWithResult(_0x52ee98,null))['catch'](handleError(_0x52ee98,null));};exports[_0xfda3('0x38')]=function(_0x4854b1,_0x2d9a3f){return db[_0xfda3('0x37')][_0xfda3('0x34')]({'where':{'id':_0x4854b1[_0xfda3('0x28')]['id']}})[_0xfda3('0x23')](handleEntityNotFound(_0x2d9a3f,null))[_0xfda3('0x23')](removeEntity(_0x2d9a3f,null))[_0xfda3('0x35')](handleError(_0x2d9a3f,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 35127b0..883c90c 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 _0xf2f1=['request-promise','path','rimraf','../../config/environment','exports','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','api','moment','bluebird'];(function(_0x35e524,_0x418c45){var _0x1e3020=function(_0x451466){while(--_0x451466){_0x35e524['push'](_0x35e524['shift']());}};_0x1e3020(++_0x418c45);}(_0xf2f1,0x99));var _0x1f2f=function(_0x3b16e1,_0x3bda3e){_0x3b16e1=_0x3b16e1-0x0;var _0x311d1b=_0xf2f1[_0x3b16e1];return _0x311d1b;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x1f2f('0x0'));var moment=require(_0x1f2f('0x1'));var BPromise=require(_0x1f2f('0x2'));var rp=require(_0x1f2f('0x3'));var fs=require('fs');var path=require(_0x1f2f('0x4'));var rimraf=require(_0x1f2f('0x5'));var config=require(_0x1f2f('0x6'));var attributes=require('./mailApplication.attributes');module[_0x1f2f('0x7')]=function(_0x2afdd9,_0xdc4261){return _0x2afdd9[_0x1f2f('0x8')](_0x1f2f('0x9'),attributes,{'tableName':_0x1f2f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1f2f('0xb'),'collate':_0x1f2f('0xc')});}; \ No newline at end of file +var _0x7774=['moment','bluebird','request-promise','path','exports','define','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api'];(function(_0x44f470,_0x74d1a8){var _0x54f0f5=function(_0x1bddbe){while(--_0x1bddbe){_0x44f470['push'](_0x44f470['shift']());}};_0x54f0f5(++_0x74d1a8);}(_0x7774,0xe1));var _0x4777=function(_0x5ecadc,_0x1cf9f1){_0x5ecadc=_0x5ecadc-0x0;var _0x565037=_0x7774[_0x5ecadc];return _0x565037;};'use strict';var _=require(_0x4777('0x0'));var util=require('util');var logger=require(_0x4777('0x1'))(_0x4777('0x2'));var moment=require(_0x4777('0x3'));var BPromise=require(_0x4777('0x4'));var rp=require(_0x4777('0x5'));var fs=require('fs');var path=require(_0x4777('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./mailApplication.attributes');module[_0x4777('0x7')]=function(_0x4dc8e6,_0x212929){return _0x4dc8e6[_0x4777('0x8')]('MailApplication',attributes,{'tableName':_0x4777('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4777('0xa'),'collate':_0x4777('0xb')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 7c3d625..c87c8a3 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 _0x5d84=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','error','code','message','catch','update','body','options','raw','attributes','then','UpdateMailApplication','stringify','lodash','util'];(function(_0x3b9b11,_0x4b4081){var _0x2e7a02=function(_0x88db1a){while(--_0x88db1a){_0x3b9b11['push'](_0x3b9b11['shift']());}};_0x2e7a02(++_0x4b4081);}(_0x5d84,0x85));var _0x45d8=function(_0x151ea7,_0x3dc52f){_0x151ea7=_0x151ea7-0x0;var _0x3a002b=_0x5d84[_0x151ea7];return _0x3a002b;};'use strict';var _=require(_0x45d8('0x0'));var util=require(_0x45d8('0x1'));var moment=require('moment');var BPromise=require(_0x45d8('0x2'));var rs=require(_0x45d8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x45d8('0x4'))['db'];var utils=require(_0x45d8('0x5'));var logger=require(_0x45d8('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x45d8('0x7'));var client=jayson[_0x45d8('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ca59a,_0x5b0e3d,_0x23830c){return new BPromise(function(_0x3209bb,_0x79f748){return client[_0x45d8('0x9')](_0x5ca59a,_0x23830c)['then'](function(_0x28230a){logger[_0x45d8('0xa')](_0x45d8('0xb'),_0x5b0e3d,_0x45d8('0xc'));logger[_0x45d8('0xd')](_0x45d8('0xe'),_0x5b0e3d,'request\x20sent',JSON['stringify'](_0x28230a));if(_0x28230a[_0x45d8('0xf')]){if(_0x28230a['error'][_0x45d8('0x10')]===0x1f4){logger[_0x45d8('0xf')](_0x45d8('0xb'),_0x5b0e3d,_0x28230a[_0x45d8('0xf')][_0x45d8('0x11')]);return _0x79f748(_0x28230a[_0x45d8('0xf')][_0x45d8('0x11')]);}logger['error'](_0x45d8('0xb'),_0x5b0e3d,_0x28230a['error']['message']);return _0x3209bb(_0x28230a['error']['message']);}else{logger['info']('MailApplication,\x20%s,\x20%s',_0x5b0e3d,_0x45d8('0xc'));_0x3209bb(_0x28230a['result']['message']);}})[_0x45d8('0x12')](function(_0x2b3b55){logger[_0x45d8('0xf')](_0x45d8('0xb'),_0x5b0e3d,_0x2b3b55);_0x79f748(_0x2b3b55);});});}exports['UpdateMailApplication']=function(_0x414adb){var _0x27e984=this;return new Promise(function(_0x1d7880,_0x938b64){return db['MailApplication'][_0x45d8('0x13')](_0x414adb[_0x45d8('0x14')],{'raw':_0x414adb[_0x45d8('0x15')]?_0x414adb['options'][_0x45d8('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x414adb[_0x45d8('0x15')]?_0x414adb[_0x45d8('0x15')]['where']||null:null,'attributes':_0x414adb['options']?_0x414adb['options'][_0x45d8('0x17')]||null:null,'limit':_0x414adb[_0x45d8('0x15')]?_0x414adb[_0x45d8('0x15')]['limit']||null:null})[_0x45d8('0x18')](function(_0x410e7e){logger['info'](_0x45d8('0x19'),_0x414adb);logger['debug']('UpdateMailApplication',_0x414adb,JSON[_0x45d8('0x1a')](_0x410e7e));_0x1d7880(_0x410e7e);})[_0x45d8('0x12')](function(_0x50e115){logger[_0x45d8('0xf')](_0x45d8('0x19'),_0x50e115[_0x45d8('0x11')],_0x414adb);_0x938b64(_0x27e984[_0x45d8('0xf')](0x1f4,_0x50e115[_0x45d8('0x11')]));});});}; \ No newline at end of file +var _0x1e52=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','UpdateMailApplication','MailApplication','update','body','options','raw','where','limit'];(function(_0x23459b,_0x5e788d){var _0x1f5839=function(_0x216836){while(--_0x216836){_0x23459b['push'](_0x23459b['shift']());}};_0x1f5839(++_0x5e788d);}(_0x1e52,0x7c));var _0x21e5=function(_0x332e65,_0x368a12){_0x332e65=_0x332e65-0x0;var _0x1b19dc=_0x1e52[_0x332e65];return _0x1b19dc;};'use strict';var _=require('lodash');var util=require(_0x21e5('0x0'));var moment=require(_0x21e5('0x1'));var BPromise=require(_0x21e5('0x2'));var rs=require(_0x21e5('0x3'));var fs=require('fs');var Redis=require(_0x21e5('0x4'));var db=require(_0x21e5('0x5'))['db'];var utils=require(_0x21e5('0x6'));var logger=require(_0x21e5('0x7'))(_0x21e5('0x8'));var config=require(_0x21e5('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x21e5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ef4be,_0x1101eb,_0x232a46){return new BPromise(function(_0x5a4c4f,_0x15bd86){return client[_0x21e5('0xb')](_0x1ef4be,_0x232a46)[_0x21e5('0xc')](function(_0x155657){logger['info'](_0x21e5('0xd'),_0x1101eb,_0x21e5('0xe'));logger[_0x21e5('0xf')](_0x21e5('0x10'),_0x1101eb,_0x21e5('0xe'),JSON[_0x21e5('0x11')](_0x155657));if(_0x155657[_0x21e5('0x12')]){if(_0x155657[_0x21e5('0x12')][_0x21e5('0x13')]===0x1f4){logger['error']('MailApplication,\x20%s,\x20%s',_0x1101eb,_0x155657[_0x21e5('0x12')][_0x21e5('0x14')]);return _0x15bd86(_0x155657['error']['message']);}logger['error'](_0x21e5('0xd'),_0x1101eb,_0x155657[_0x21e5('0x12')]['message']);return _0x5a4c4f(_0x155657['error'][_0x21e5('0x14')]);}else{logger[_0x21e5('0x15')](_0x21e5('0xd'),_0x1101eb,_0x21e5('0xe'));_0x5a4c4f(_0x155657['result'][_0x21e5('0x14')]);}})[_0x21e5('0x16')](function(_0x1e4cfd){logger['error']('MailApplication,\x20%s,\x20%s',_0x1101eb,_0x1e4cfd);_0x15bd86(_0x1e4cfd);});});}exports[_0x21e5('0x17')]=function(_0x1a254a){var _0x3a9b2f=this;return new Promise(function(_0x278799,_0x5c529a){return db[_0x21e5('0x18')][_0x21e5('0x19')](_0x1a254a[_0x21e5('0x1a')],{'raw':_0x1a254a[_0x21e5('0x1b')]?_0x1a254a[_0x21e5('0x1b')][_0x21e5('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a254a[_0x21e5('0x1b')]?_0x1a254a[_0x21e5('0x1b')][_0x21e5('0x1d')]||null:null,'attributes':_0x1a254a[_0x21e5('0x1b')]?_0x1a254a['options']['attributes']||null:null,'limit':_0x1a254a['options']?_0x1a254a[_0x21e5('0x1b')][_0x21e5('0x1e')]||null:null})[_0x21e5('0xc')](function(_0x36325d){logger[_0x21e5('0x15')]('UpdateMailApplication',_0x1a254a);logger[_0x21e5('0xf')](_0x21e5('0x17'),_0x1a254a,JSON[_0x21e5('0x11')](_0x36325d));_0x278799(_0x36325d);})['catch'](function(_0x1b5df0){logger[_0x21e5('0x12')]('UpdateMailApplication',_0x1b5df0[_0x21e5('0x14')],_0x1a254a);_0x5c529a(_0x3a9b2f['error'](0x1f4,_0x1b5df0[_0x21e5('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 6c191af..201c267 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 _0x7394=['removeTags','Router','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','post','/:id/messages','addMessage','/:id/tags','mail','addTags','put','mailinteraction:update','update','delete','/:id','tracked','mailinteraction:destroy','destroy'];(function(_0x1d8f23,_0x1d4573){var _0x9499d7=function(_0x32af9b){while(--_0x32af9b){_0x1d8f23['push'](_0x1d8f23['shift']());}};_0x9499d7(++_0x1d4573);}(_0x7394,0x14b));var _0x4739=function(_0x2de568,_0x29bba9){_0x2de568=_0x2de568-0x0;var _0x134ecc=_0x7394[_0x2de568];return _0x134ecc;};'use strict';var express=require('express');var router=express[_0x4739('0x0')]();var auth=require('../../components/auth/service');var interaction=require(_0x4739('0x1'));var controller=require('./mailInteraction.controller');router[_0x4739('0x2')]('/',auth['isAuthenticated'](),controller[_0x4739('0x3')]);router[_0x4739('0x2')](_0x4739('0x4'),auth[_0x4739('0x5')](),controller[_0x4739('0x6')]);router[_0x4739('0x2')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x4739('0x2')]('/:id/messages',auth[_0x4739('0x5')](),controller['getMessages']);router['get']('/:id/download',auth[_0x4739('0x5')](),controller['download']);router[_0x4739('0x7')]('/',auth[_0x4739('0x5')](),controller['create']);router[_0x4739('0x7')](_0x4739('0x8'),auth[_0x4739('0x5')](),controller[_0x4739('0x9')]);router[_0x4739('0x7')](_0x4739('0xa'),auth['isAuthenticated'](),interaction['tracked'](_0x4739('0xb'),'mailinteraction:addtags'),controller[_0x4739('0xc')]);router[_0x4739('0xd')]('/:id',auth[_0x4739('0x5')](),interaction['tracked'](_0x4739('0xb'),_0x4739('0xe')),controller[_0x4739('0xf')]);router[_0x4739('0x10')](_0x4739('0x11'),auth[_0x4739('0x5')](),interaction[_0x4739('0x12')]('mail',_0x4739('0x13')),controller[_0x4739('0x14')]);router[_0x4739('0x10')]('/:id/tags',auth[_0x4739('0x5')](),controller[_0x4739('0x15')]);module['exports']=router; \ No newline at end of file +var _0xd47d=['update','mailinteraction:destroy','removeTags','exports','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','download','create','addMessage','post','/:id/tags','mail','mailinteraction:addtags','addTags','put','tracked','mailinteraction:update'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd47d,0x9a));var _0xdd47=function(_0x43b06b,_0x1929c7){_0x43b06b=_0x43b06b-0x0;var _0x2c555b=_0xd47d[_0x43b06b];return _0x2c555b;};'use strict';var express=require('express');var router=express[_0xdd47('0x0')]();var auth=require(_0xdd47('0x1'));var interaction=require(_0xdd47('0x2'));var controller=require('./mailInteraction.controller');router[_0xdd47('0x3')]('/',auth[_0xdd47('0x4')](),controller[_0xdd47('0x5')]);router[_0xdd47('0x3')](_0xdd47('0x6'),auth[_0xdd47('0x4')](),controller[_0xdd47('0x7')]);router[_0xdd47('0x3')](_0xdd47('0x8'),auth[_0xdd47('0x4')](),controller['show']);router[_0xdd47('0x3')](_0xdd47('0x9'),auth['isAuthenticated'](),controller['getMessages']);router[_0xdd47('0x3')]('/:id/download',auth[_0xdd47('0x4')](),controller[_0xdd47('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0xdd47('0xb')]);router['post'](_0xdd47('0x9'),auth[_0xdd47('0x4')](),controller[_0xdd47('0xc')]);router[_0xdd47('0xd')](_0xdd47('0xe'),auth[_0xdd47('0x4')](),interaction['tracked'](_0xdd47('0xf'),_0xdd47('0x10')),controller[_0xdd47('0x11')]);router[_0xdd47('0x12')](_0xdd47('0x8'),auth[_0xdd47('0x4')](),interaction[_0xdd47('0x13')](_0xdd47('0xf'),_0xdd47('0x14')),controller[_0xdd47('0x15')]);router['delete'](_0xdd47('0x8'),auth[_0xdd47('0x4')](),interaction[_0xdd47('0x13')]('mail',_0xdd47('0x16')),controller['destroy']);router['delete'](_0xdd47('0xe'),auth[_0xdd47('0x4')](),controller[_0xdd47('0x17')]);module[_0xdd47('0x18')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 4d93010..d3a77fb 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 _0xd4c3=['INTEGER','sequelize','exports','BOOLEAN','STRING','TEXT','DATE','ENUM','out'];(function(_0x5694bd,_0x23625e){var _0x2a050a=function(_0x53c617){while(--_0x53c617){_0x5694bd['push'](_0x5694bd['shift']());}};_0x2a050a(++_0x23625e);}(_0xd4c3,0x10f));var _0x3d4c=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0xd4c3[_0x5834bc];return _0x3e183a;};'use strict';var Sequelize=require(_0x3d4c('0x0'));var iconv=require('iconv');module[_0x3d4c('0x1')]={'closed':{'type':Sequelize[_0x3d4c('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x3d4c('0x3')]},'secondDisposition':{'type':Sequelize[_0x3d4c('0x3')]},'thirdDisposition':{'type':Sequelize[_0x3d4c('0x3')]},'note':{'type':Sequelize[_0x3d4c('0x3')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x3d4c('0x4')]('long')},'subject':{'type':Sequelize[_0x3d4c('0x4')]()},'attach':{'type':Sequelize[_0x3d4c('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x3d4c('0x5')]},'substatus':{'type':Sequelize[_0x3d4c('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0x3d4c('0x5')]},'firstMsgDirection':{'type':Sequelize[_0x3d4c('0x6')]('in',_0x3d4c('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3d4c('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x3d4c('0x6')]('in',_0x3d4c('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x3d4c('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x3d4c('0x8')]}}; \ No newline at end of file +var _0x5555=['out','BOOLEAN','sequelize','iconv','DATE','STRING','ENUM'];(function(_0x98fb05,_0xe0654c){var _0x2ebdaa=function(_0x26e107){while(--_0x26e107){_0x98fb05['push'](_0x98fb05['shift']());}};_0x2ebdaa(++_0xe0654c);}(_0x5555,0xa3));var _0x5555=function(_0x36dc4d,_0x3c1e38){_0x36dc4d=_0x36dc4d-0x0;var _0x5e894d=_0x5555[_0x36dc4d];return _0x5e894d;};'use strict';var Sequelize=require(_0x5555('0x0'));var iconv=require(_0x5555('0x1'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5555('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x5555('0x3')]},'thirdDisposition':{'type':Sequelize[_0x5555('0x3')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x5555('0x3')]},'cc':{'type':Sequelize['TEXT']('long')},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x5555('0x2')]},'substatus':{'type':Sequelize[_0x5555('0x3')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x5555('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x5555('0x4')]('in',_0x5555('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x5555('0x6')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 2b2484f..fee0052 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 _0xa6ad=['path','lodash','juice','ioredis','../../components/interaction/service','../../config/logger','../../config/environment','html-entities','defaults','redis','localhost','socket.io-emitter','register','sendStatus','end','json','limit','undefined','count','offset','Content-Range','update','then','destroy','status','error','stack','name','send','index','map','MailInteraction','fieldName','type','mail','user','catch','model','keys','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','body','params','addMessage','MailMessage','ids','getMessages','findOne','rawAttributes','hasOwnProperty','nolimit','order','sort','where','pick','MailInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','rows','spread','findAll','color','emit','mailInteractionTags:save','removeTags','download','unix','join','root','files','tmp','attachments','transcript-%d-%s.zip','push','Attachment','Attachments','Messages','from','subject','get','mkdirSync','each','missing.recipient@your.company.com','decode','createdAt','headers','bcc','Bcc','basename','existsSync','readFileSync','build','writeFileSync','unlinkSync','eml-format','rimraf','zip-dir','bluebird','util'];(function(_0x2f2f7f,_0xca8aca){var _0x418fe3=function(_0x420e55){while(--_0x420e55){_0x2f2f7f['push'](_0x2f2f7f['shift']());}};_0x418fe3(++_0xca8aca);}(_0xa6ad,0x14e));var _0xda6a=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0xa6ad[_0x1da527];return _0x40fc7c;};'use strict';var emlformat=require(_0xda6a('0x0'));var rimraf=require(_0xda6a('0x1'));var zipdir=require(_0xda6a('0x2'));var moment=require('moment');var BPromise=require(_0xda6a('0x3'));var util=require(_0xda6a('0x4'));var path=require(_0xda6a('0x5'));var fs=require('fs');var _=require(_0xda6a('0x6'));var juice=require(_0xda6a('0x7'));var Redis=require(_0xda6a('0x8'));var interaction=require(_0xda6a('0x9'));var qs=require('../../components/parsers/qs');var logger=require(_0xda6a('0xa'))('api');var config=require(_0xda6a('0xb'));var db=require('../../mysqldb')['db'];var htmlEntities=require(_0xda6a('0xc'));config['redis']=_[_0xda6a('0xd')](config[_0xda6a('0xe')],{'host':_0xda6a('0xf'),'port':0x18eb});var socket=require(_0xda6a('0x10'))(new Redis(config[_0xda6a('0xe')]));require('./mailInteraction.socket')[_0xda6a('0x11')](socket);function respondWithStatusCode(_0x20048b,_0x25dab0){_0x25dab0=_0x25dab0||0xcc;return function(_0x4eb23b){if(_0x4eb23b){return _0x20048b[_0xda6a('0x12')](_0x25dab0);}return _0x20048b['status'](_0x25dab0)[_0xda6a('0x13')]();};}function respondWithResult(_0x4089bc,_0x51198e){_0x51198e=_0x51198e||0xc8;return function(_0x418ff6){if(_0x418ff6){return _0x4089bc['status'](_0x51198e)[_0xda6a('0x14')](_0x418ff6);}};}function respondWithFilteredResult(_0x46818d,_0x41a01b){return function(_0x33a96f){if(_0x33a96f){var _0x4a3775=typeof _0x41a01b['offset']==='undefined'&&typeof _0x41a01b[_0xda6a('0x15')]===_0xda6a('0x16');var _0x327e09=_0x33a96f[_0xda6a('0x17')];var _0x367d1f=_0x4a3775?0x0:_0x41a01b['offset'];var _0x233347=_0x4a3775?_0x33a96f[_0xda6a('0x17')]:_0x41a01b[_0xda6a('0x18')]+_0x41a01b[_0xda6a('0x15')];var _0x4d1b21;if(_0x233347>=_0x327e09){_0x233347=_0x327e09;_0x4d1b21=0xc8;}else{_0x4d1b21=0xce;}_0x46818d['status'](_0x4d1b21);return _0x46818d['set'](_0xda6a('0x19'),_0x367d1f+'-'+_0x233347+'/'+_0x327e09)['json'](_0x33a96f);}return null;};}function saveUpdates(_0x2b853d){return function(_0x7b13cd){if(_0x7b13cd){return _0x7b13cd[_0xda6a('0x1a')](_0x2b853d)[_0xda6a('0x1b')](function(_0x1b37c4){return _0x1b37c4;});}return null;};}function removeEntity(_0x1e0d51){return function(_0x2b86e7){if(_0x2b86e7){return _0x2b86e7[_0xda6a('0x1c')]()[_0xda6a('0x1b')](function(){_0x1e0d51[_0xda6a('0x1d')](0xcc)[_0xda6a('0x13')]();});}};}function handleEntityNotFound(_0x5c7f56){return function(_0x3dd22c){if(!_0x3dd22c){_0x5c7f56[_0xda6a('0x12')](0x194);}return _0x3dd22c;};}function handleError(_0x57e2a2,_0x433159){_0x433159=_0x433159||0x1f4;return function(_0x88ee02){logger[_0xda6a('0x1e')](_0x88ee02[_0xda6a('0x1f')]);if(_0x88ee02['name']){delete _0x88ee02[_0xda6a('0x20')];}_0x57e2a2[_0xda6a('0x1d')](_0x433159)[_0xda6a('0x21')](_0x88ee02);};}exports[_0xda6a('0x22')]=function(_0x5ccb3f,_0x2a37b2){var _0x1afbbb={};var _0x4c4721=_[_0xda6a('0x23')](db[_0xda6a('0x24')]['rawAttributes'],function(_0x509f58){return{'name':_0x509f58[_0xda6a('0x25')],'type':_0x509f58[_0xda6a('0x26')]['key']};});_0x1afbbb=qs['getOptions'](_0x4c4721,_0x5ccb3f);return interaction['findAll'](_0xda6a('0x27'),_0x5ccb3f['query'],_0x5ccb3f[_0xda6a('0x28')],_0x1afbbb,_0x4c4721)[_0xda6a('0x1b')](respondWithFilteredResult(_0x2a37b2,_0x1afbbb))[_0xda6a('0x29')](handleError(_0x2a37b2,null));};exports['show']=function(_0x364087,_0x458243){var _0x4d35c6={'raw':![],'where':{'id':_0x364087['params']['id']}},_0xf38760={};_0xf38760[_0xda6a('0x2a')]=_[_0xda6a('0x2b')](db['MailInteraction']['rawAttributes']);_0xf38760[_0xda6a('0x2c')]=_[_0xda6a('0x2b')](_0x364087[_0xda6a('0x2c')]);_0xf38760[_0xda6a('0x2d')]=_[_0xda6a('0x2e')](_0xf38760[_0xda6a('0x2a')],_0xf38760[_0xda6a('0x2c')]);_0x4d35c6[_0xda6a('0x2f')]=_['intersection'](_0xf38760[_0xda6a('0x2a')],qs[_0xda6a('0x30')](_0x364087[_0xda6a('0x2c')]['fields']));_0x4d35c6[_0xda6a('0x2f')]=_0x4d35c6['attributes'][_0xda6a('0x31')]?_0x4d35c6[_0xda6a('0x2f')]:_0xf38760[_0xda6a('0x2a')];if(_0x364087[_0xda6a('0x2c')][_0xda6a('0x32')]){_0x4d35c6[_0xda6a('0x33')]=[{'all':!![]}];}_0x4d35c6=_[_0xda6a('0x34')]({},_0x4d35c6,_0x364087[_0xda6a('0x35')]);return db[_0xda6a('0x24')][_0xda6a('0x36')](_0x4d35c6)[_0xda6a('0x1b')](handleEntityNotFound(_0x458243,null))['then'](respondWithResult(_0x458243,null))['catch'](handleError(_0x458243,null));};exports['create']=function(_0x44b1f7,_0x1a6e82){return db['MailInteraction'][_0xda6a('0x37')](_0x44b1f7[_0xda6a('0x38')],{})[_0xda6a('0x1b')](respondWithResult(_0x1a6e82,0xc9))['catch'](handleError(_0x1a6e82,null));};exports[_0xda6a('0x1a')]=function(_0x5098d5,_0x5b7eaf){if(_0x5098d5[_0xda6a('0x38')]['id']){delete _0x5098d5['body']['id'];}return db['MailInteraction'][_0xda6a('0x36')]({'where':{'id':_0x5098d5[_0xda6a('0x39')]['id']}})[_0xda6a('0x1b')](handleEntityNotFound(_0x5b7eaf,null))[_0xda6a('0x1b')](saveUpdates(_0x5098d5[_0xda6a('0x38')],null))['then'](respondWithResult(_0x5b7eaf,null))['catch'](handleError(_0x5b7eaf,null));};exports['destroy']=function(_0x38897a,_0x37e311){return db[_0xda6a('0x24')]['find']({'where':{'id':_0x38897a['params']['id']}})[_0xda6a('0x1b')](handleEntityNotFound(_0x37e311,null))[_0xda6a('0x1b')](removeEntity(_0x37e311,null))[_0xda6a('0x29')](handleError(_0x37e311,null));};exports['describe']=function(_0xfb7f67,_0x101f6a){return db[_0xda6a('0x24')]['describe']()[_0xda6a('0x1b')](respondWithResult(_0x101f6a,null))[_0xda6a('0x29')](handleError(_0x101f6a,null));};exports[_0xda6a('0x3a')]=function(_0x38be6e,_0x3ef32d){return db[_0xda6a('0x3b')][_0xda6a('0x36')]({'where':{'id':_0x38be6e[_0xda6a('0x39')]['id']}})[_0xda6a('0x1b')](handleEntityNotFound(_0x3ef32d,null))[_0xda6a('0x1b')](function(_0x3709d4){if(_0x3709d4){return _0x3709d4[_0xda6a('0x3a')](_0x38be6e[_0xda6a('0x38')][_0xda6a('0x3c')],_['omit'](_0x38be6e[_0xda6a('0x38')],[_0xda6a('0x3c'),'id'])||{});}})[_0xda6a('0x1b')](respondWithResult(_0x3ef32d,null))[_0xda6a('0x29')](handleError(_0x3ef32d,null));};exports[_0xda6a('0x3d')]=function(_0x2f7a82,_0x17ab62){var _0x42752c={'raw':![],'where':{}};var _0x5cd7a9={};var _0x3175e2={'count':0x0,'rows':[]};return db[_0xda6a('0x24')][_0xda6a('0x3e')]({'where':{'id':_0x2f7a82['params']['id']}})[_0xda6a('0x1b')](handleEntityNotFound(_0x17ab62,null))['then'](function(_0x51a606){if(_0x51a606){_0x5cd7a9[_0xda6a('0x2a')]=_['keys'](db[_0xda6a('0x3b')][_0xda6a('0x3f')]);_0x5cd7a9['query']=_[_0xda6a('0x2b')](_0x2f7a82[_0xda6a('0x2c')]);_0x5cd7a9[_0xda6a('0x2d')]=_[_0xda6a('0x2e')](_0x5cd7a9[_0xda6a('0x2a')],_0x5cd7a9['query']);_0x42752c[_0xda6a('0x2f')]=_[_0xda6a('0x2e')](_0x5cd7a9['model'],qs[_0xda6a('0x30')](_0x2f7a82[_0xda6a('0x2c')][_0xda6a('0x30')]));_0x42752c['attributes']=_0x42752c[_0xda6a('0x2f')][_0xda6a('0x31')]?_0x42752c[_0xda6a('0x2f')]:_0x5cd7a9[_0xda6a('0x2a')];if(!_0x2f7a82[_0xda6a('0x2c')][_0xda6a('0x40')](_0xda6a('0x41'))){_0x42752c[_0xda6a('0x15')]=qs[_0xda6a('0x15')](_0x2f7a82[_0xda6a('0x2c')][_0xda6a('0x15')]);_0x42752c['offset']=qs[_0xda6a('0x18')](_0x2f7a82[_0xda6a('0x2c')]['offset']);}_0x42752c[_0xda6a('0x42')]=qs[_0xda6a('0x43')](_0x2f7a82[_0xda6a('0x2c')][_0xda6a('0x43')]);_0x42752c[_0xda6a('0x44')]=qs[_0xda6a('0x2d')](_[_0xda6a('0x45')](_0x2f7a82['query'],_0x5cd7a9[_0xda6a('0x2d')]));_0x42752c[_0xda6a('0x44')][_0xda6a('0x46')]=_0x51a606['id'];if(_0x2f7a82[_0xda6a('0x2c')][_0xda6a('0x47')]){_0x42752c[_0xda6a('0x44')]=_[_0xda6a('0x34')](_0x42752c['where'],{'$or':_['map'](_0x42752c[_0xda6a('0x2f')],function(_0x544a08){var _0x1279c8={};_0x1279c8[_0x544a08]={'$like':'%'+_0x2f7a82['query'][_0xda6a('0x47')]+'%'};return _0x1279c8;})});}if(_0x2f7a82['query'][_0xda6a('0x48')]){var _0x2b348d=_0x2f7a82[_0xda6a('0x2c')][_0xda6a('0x48')]['split'](',');var _0x389204={};_0x389204[_0x2b348d[0x0]]={'$gte':moment(_0x2b348d[0x1])[_0xda6a('0x49')](_0xda6a('0x4a'))};_0x42752c[_0xda6a('0x44')]=_['merge'](_0x42752c[_0xda6a('0x44')],_0x389204);}_0x42752c=_[_0xda6a('0x34')]({},_0x42752c,_0x2f7a82[_0xda6a('0x35')]);return db[_0xda6a('0x3b')][_0xda6a('0x17')]({'where':_0x42752c['where']})[_0xda6a('0x1b')](function(_0x4d42d7){_0x3175e2['count']=_0x4d42d7;if(_0x2f7a82['query']['includeAll']){_0x42752c[_0xda6a('0x33')]=[{'all':!![]}];}return db[_0xda6a('0x3b')]['findAll'](_0x42752c);})['then'](function(_0x4a1afb){if(_0x2f7a82[_0xda6a('0x2c')][_0xda6a('0x4b')]===_0xda6a('0x4c')){for(var _0x1fd027=0x0;_0x1fd027<_0x4a1afb[_0xda6a('0x31')];_0x1fd027++){_0x4a1afb[_0x1fd027][_0xda6a('0x38')]=juice(_0x4a1afb[_0x1fd027][_0xda6a('0x38')]);}}_0x3175e2[_0xda6a('0x4d')]=_0x4a1afb;return _0x3175e2;});}})[_0xda6a('0x1b')](respondWithFilteredResult(_0x17ab62,_0x42752c))[_0xda6a('0x29')](handleError(_0x17ab62,null));};exports['addTags']=function(_0x4a4efb,_0x1926b2){return db[_0xda6a('0x24')][_0xda6a('0x36')]({'where':{'id':_0x4a4efb[_0xda6a('0x39')]['id']}})[_0xda6a('0x1b')](handleEntityNotFound(_0x1926b2,null))[_0xda6a('0x1b')](function(_0xf369b4){if(_0xf369b4){return _0xf369b4['setTags'](_0x4a4efb['body'][_0xda6a('0x3c')],_['omit'](_0x4a4efb[_0xda6a('0x38')],[_0xda6a('0x3c'),'id'])||{})[_0xda6a('0x4e')](function(){return db['Tag'][_0xda6a('0x4f')]({'attributes':['id','name',_0xda6a('0x50')],'where':{'id':_0x4a4efb[_0xda6a('0x38')]['ids']}});})[_0xda6a('0x1b')](function(_0x524cd1){socket[_0xda6a('0x51')](_0xda6a('0x52'),{'id':Number(_0x4a4efb[_0xda6a('0x39')]['id']),'tags':_0x524cd1||[]});return{'id':Number(_0x4a4efb[_0xda6a('0x39')]['id']),'tags':_0x524cd1||[]};});}})[_0xda6a('0x1b')](respondWithResult(_0x1926b2,null))[_0xda6a('0x29')](handleError(_0x1926b2,null));};exports[_0xda6a('0x53')]=function(_0xed2f84,_0x5f5604){return db[_0xda6a('0x24')][_0xda6a('0x36')]({'where':{'id':_0xed2f84[_0xda6a('0x39')]['id']}})['then'](handleEntityNotFound(_0x5f5604,null))['then'](function(_0x3f80c7){if(_0x3f80c7){return _0x3f80c7[_0xda6a('0x53')](_0xed2f84[_0xda6a('0x2c')][_0xda6a('0x3c')]);}})[_0xda6a('0x1b')](respondWithStatusCode(_0x5f5604,null))[_0xda6a('0x29')](handleError(_0x5f5604,null));};exports[_0xda6a('0x54')]=function(_0x2dc1c1,_0x4bbc88){var _0x63fe6b=moment()[_0xda6a('0x55')]()['toString']();var _0x40f476=path[_0xda6a('0x56')](config[_0xda6a('0x57')],'server',_0xda6a('0x58'),_0xda6a('0x59'));var _0x486597=path[_0xda6a('0x56')](config[_0xda6a('0x57')],'server','files',_0xda6a('0x5a'));var _0x3f2e92=path[_0xda6a('0x56')](_0x40f476,_0x63fe6b);var _0x3942d1=util['format'](_0xda6a('0x5b'),_0x2dc1c1[_0xda6a('0x39')]['id'],_0x63fe6b);var _0xf977e3=path['join'](_0x40f476,_0x3942d1);var _0x7d2787=[];if(_0x2dc1c1[_0xda6a('0x2c')][_0xda6a('0x5a')]){_0x7d2787[_0xda6a('0x5c')]({'model':db[_0xda6a('0x5d')],'as':_0xda6a('0x5e'),'raw':!![]});}var _0x4cf087=[{'model':db['MailMessage'],'as':_0xda6a('0x5f'),'attributes':['id',_0xda6a('0x38'),_0xda6a('0x60'),'to','cc','bcc',_0xda6a('0x61'),'createdAt'],'where':{'secret':![]},'order':qs[_0xda6a('0x43')]('id'),'include':_0x7d2787}];return db['MailInteraction']['find']({'where':{'id':_0x2dc1c1[_0xda6a('0x39')]['id']},'include':_0x4cf087})[_0xda6a('0x1b')](handleEntityNotFound(_0x4bbc88,null))['then'](function(_0xc9b9a1){if(_0xc9b9a1&&_0xc9b9a1['Messages']){var _0x1425fd=_0xc9b9a1[_0xda6a('0x62')]({'plain':!![]});fs[_0xda6a('0x63')](_0x3f2e92);return BPromise[_0xda6a('0x64')](_0x1425fd[_0xda6a('0x5f')],function(_0x5f469b,_0xd4945a){var _0x57a5b5={'from':_0x5f469b[_0xda6a('0x60')],'to':_0x5f469b['to']||_0xda6a('0x65'),'subject':_0x5f469b[_0xda6a('0x61')],'html':htmlEntities[_0xda6a('0x66')](_0x5f469b[_0xda6a('0x38')]),'headers':{'Date':moment(_0x5f469b[_0xda6a('0x67')])['format']('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x5f469b['cc']){_0x57a5b5[_0xda6a('0x68')]['Cc']=_0x5f469b['cc'];}if(_0x5f469b[_0xda6a('0x69')]){_0x57a5b5[_0xda6a('0x68')][_0xda6a('0x6a')]=_0x5f469b[_0xda6a('0x69')];}return new BPromise(function(_0x8e317a,_0x1bc30a){if(_0x5f469b['Attachments']){for(var _0x4ce21e=0x0;_0x4ce21e<_0x5f469b[_0xda6a('0x5e')][_0xda6a('0x31')];_0x4ce21e++){var _0x1af14a=_0x5f469b[_0xda6a('0x5e')][_0x4ce21e];var _0x3c171d=path[_0xda6a('0x56')](_0x486597,_0x1af14a[_0xda6a('0x6b')]);if(fs[_0xda6a('0x6c')](_0x3c171d)){_0x57a5b5['attachments']['push']({'name':_0x1af14a[_0xda6a('0x20')],'contentType':_0x1af14a[_0xda6a('0x26')],'data':fs[_0xda6a('0x6d')](_0x3c171d)});}}}emlformat[_0xda6a('0x6e')](_0x57a5b5,function(_0x3162d9,_0x46b1ad){if(_0x3162d9)return _0x1bc30a(_0x3162d9);fs[_0xda6a('0x6f')](path['join'](_0x3f2e92,util[_0xda6a('0x49')]('message%d.eml',_0xd4945a)),_0x46b1ad);return _0x8e317a(_0x46b1ad);});});})['then'](function(){return new BPromise(function(_0x4b820c,_0x4e8a9c){zipdir(_0x3f2e92,{'saveTo':_0xf977e3},function(_0x33530e,_0x53e859){if(_0x33530e)return _0x4e8a9c(_0x33530e);return _0x4b820c(_0x53e859);});})[_0xda6a('0x1b')](function(){return new BPromise(function(_0x1e2a7e,_0x5a8114){rimraf(_0x3f2e92,function(_0x1a1148){if(_0x1a1148)_0x5a8114(_0x1a1148);return _0x1e2a7e();});});})[_0xda6a('0x1b')](function(){return _0x4bbc88[_0xda6a('0x54')](_0xf977e3,_0x3942d1,function(_0xd49e48){if(!_0xd49e48)fs[_0xda6a('0x70')](_0xf977e3);});});});}else{return _0x4bbc88['sendStatus'](0xc8);}})[_0xda6a('0x29')](handleError(_0x4bbc88,null));}; \ No newline at end of file +var _0xf696=['map','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','rows','addTags','setTags','color','mailInteractionTags:save','removeTags','download','unix','toString','join','root','files','tmp','server','attachments','transcript-%d-%s.zip','push','Attachment','Messages','from','bcc','subject','get','mkdirSync','each','missing.recipient@your.company.com','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','basename','existsSync','build','unlinkSync','rimraf','moment','bluebird','util','path','lodash','juice','ioredis','../../components/interaction/service','../../components/parsers/qs','api','../../mysqldb','html-entities','redis','defaults','localhost','socket.io-emitter','register','status','end','undefined','count','offset','limit','set','json','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','type','key','getOptions','findAll','query','user','catch','show','params','keys','MailInteraction','filters','intersection','model','attributes','fields','length','includeAll','include','options','find','create','update','body','describe','addMessage','MailMessage','ids','omit','findOne','hasOwnProperty','nolimit','order','sort','where','filter','merge'];(function(_0x591356,_0xb2befd){var _0x5c533f=function(_0x2242bc){while(--_0x2242bc){_0x591356['push'](_0x591356['shift']());}};_0x5c533f(++_0xb2befd);}(_0xf696,0x180));var _0x6f69=function(_0x24b33c,_0x34703a){_0x24b33c=_0x24b33c-0x0;var _0x300961=_0xf696[_0x24b33c];return _0x300961;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6f69('0x0'));var zipdir=require('zip-dir');var moment=require(_0x6f69('0x1'));var BPromise=require(_0x6f69('0x2'));var util=require(_0x6f69('0x3'));var path=require(_0x6f69('0x4'));var fs=require('fs');var _=require(_0x6f69('0x5'));var juice=require(_0x6f69('0x6'));var Redis=require(_0x6f69('0x7'));var interaction=require(_0x6f69('0x8'));var qs=require(_0x6f69('0x9'));var logger=require('../../config/logger')(_0x6f69('0xa'));var config=require('../../config/environment');var db=require(_0x6f69('0xb'))['db'];var htmlEntities=require(_0x6f69('0xc'));config[_0x6f69('0xd')]=_[_0x6f69('0xe')](config[_0x6f69('0xd')],{'host':_0x6f69('0xf'),'port':0x18eb});var socket=require(_0x6f69('0x10'))(new Redis(config[_0x6f69('0xd')]));require('./mailInteraction.socket')[_0x6f69('0x11')](socket);function respondWithStatusCode(_0x44ec31,_0x2a3786){_0x2a3786=_0x2a3786||0xcc;return function(_0x1e25d3){if(_0x1e25d3){return _0x44ec31['sendStatus'](_0x2a3786);}return _0x44ec31[_0x6f69('0x12')](_0x2a3786)[_0x6f69('0x13')]();};}function respondWithResult(_0x5e0e8d,_0x45d088){_0x45d088=_0x45d088||0xc8;return function(_0x443019){if(_0x443019){return _0x5e0e8d[_0x6f69('0x12')](_0x45d088)['json'](_0x443019);}};}function respondWithFilteredResult(_0x10a2db,_0xbbc161){return function(_0x31b0d6){if(_0x31b0d6){var _0x15ff46=typeof _0xbbc161['offset']===_0x6f69('0x14')&&typeof _0xbbc161['limit']===_0x6f69('0x14');var _0x3e0f21=_0x31b0d6[_0x6f69('0x15')];var _0xb69209=_0x15ff46?0x0:_0xbbc161[_0x6f69('0x16')];var _0x483f50=_0x15ff46?_0x31b0d6[_0x6f69('0x15')]:_0xbbc161['offset']+_0xbbc161[_0x6f69('0x17')];var _0x186fa3;if(_0x483f50>=_0x3e0f21){_0x483f50=_0x3e0f21;_0x186fa3=0xc8;}else{_0x186fa3=0xce;}_0x10a2db[_0x6f69('0x12')](_0x186fa3);return _0x10a2db[_0x6f69('0x18')]('Content-Range',_0xb69209+'-'+_0x483f50+'/'+_0x3e0f21)[_0x6f69('0x19')](_0x31b0d6);}return null;};}function saveUpdates(_0x3521d1){return function(_0x214a3e){if(_0x214a3e){return _0x214a3e['update'](_0x3521d1)[_0x6f69('0x1a')](function(_0x33f18b){return _0x33f18b;});}return null;};}function removeEntity(_0x51f1c8){return function(_0x579663){if(_0x579663){return _0x579663[_0x6f69('0x1b')]()['then'](function(){_0x51f1c8[_0x6f69('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x386871){return function(_0x268d70){if(!_0x268d70){_0x386871[_0x6f69('0x1c')](0x194);}return _0x268d70;};}function handleError(_0x848625,_0x3e3dd4){_0x3e3dd4=_0x3e3dd4||0x1f4;return function(_0x3d7e83){logger[_0x6f69('0x1d')](_0x3d7e83[_0x6f69('0x1e')]);if(_0x3d7e83[_0x6f69('0x1f')]){delete _0x3d7e83[_0x6f69('0x1f')];}_0x848625[_0x6f69('0x12')](_0x3e3dd4)[_0x6f69('0x20')](_0x3d7e83);};}exports[_0x6f69('0x21')]=function(_0x48480d,_0x3063a7){var _0x2bb119={};var _0x440946=_['map'](db['MailInteraction'][_0x6f69('0x22')],function(_0x2906e7){return{'name':_0x2906e7['fieldName'],'type':_0x2906e7[_0x6f69('0x23')][_0x6f69('0x24')]};});_0x2bb119=qs[_0x6f69('0x25')](_0x440946,_0x48480d);return interaction[_0x6f69('0x26')]('mail',_0x48480d[_0x6f69('0x27')],_0x48480d[_0x6f69('0x28')],_0x2bb119,_0x440946)[_0x6f69('0x1a')](respondWithFilteredResult(_0x3063a7,_0x2bb119))[_0x6f69('0x29')](handleError(_0x3063a7,null));};exports[_0x6f69('0x2a')]=function(_0x3e58e8,_0x4fe1dd){var _0x1580a1={'raw':![],'where':{'id':_0x3e58e8[_0x6f69('0x2b')]['id']}},_0x2e6189={};_0x2e6189['model']=_[_0x6f69('0x2c')](db[_0x6f69('0x2d')][_0x6f69('0x22')]);_0x2e6189[_0x6f69('0x27')]=_[_0x6f69('0x2c')](_0x3e58e8[_0x6f69('0x27')]);_0x2e6189[_0x6f69('0x2e')]=_[_0x6f69('0x2f')](_0x2e6189[_0x6f69('0x30')],_0x2e6189[_0x6f69('0x27')]);_0x1580a1[_0x6f69('0x31')]=_[_0x6f69('0x2f')](_0x2e6189[_0x6f69('0x30')],qs[_0x6f69('0x32')](_0x3e58e8['query']['fields']));_0x1580a1[_0x6f69('0x31')]=_0x1580a1[_0x6f69('0x31')][_0x6f69('0x33')]?_0x1580a1['attributes']:_0x2e6189[_0x6f69('0x30')];if(_0x3e58e8[_0x6f69('0x27')][_0x6f69('0x34')]){_0x1580a1[_0x6f69('0x35')]=[{'all':!![]}];}_0x1580a1=_['merge']({},_0x1580a1,_0x3e58e8[_0x6f69('0x36')]);return db[_0x6f69('0x2d')][_0x6f69('0x37')](_0x1580a1)[_0x6f69('0x1a')](handleEntityNotFound(_0x4fe1dd,null))['then'](respondWithResult(_0x4fe1dd,null))[_0x6f69('0x29')](handleError(_0x4fe1dd,null));};exports[_0x6f69('0x38')]=function(_0x50d203,_0x21f20){return db[_0x6f69('0x2d')][_0x6f69('0x38')](_0x50d203['body'],{})[_0x6f69('0x1a')](respondWithResult(_0x21f20,0xc9))[_0x6f69('0x29')](handleError(_0x21f20,null));};exports[_0x6f69('0x39')]=function(_0x27a980,_0x11b665){if(_0x27a980[_0x6f69('0x3a')]['id']){delete _0x27a980[_0x6f69('0x3a')]['id'];}return db[_0x6f69('0x2d')][_0x6f69('0x37')]({'where':{'id':_0x27a980[_0x6f69('0x2b')]['id']}})[_0x6f69('0x1a')](handleEntityNotFound(_0x11b665,null))[_0x6f69('0x1a')](saveUpdates(_0x27a980[_0x6f69('0x3a')],null))['then'](respondWithResult(_0x11b665,null))[_0x6f69('0x29')](handleError(_0x11b665,null));};exports[_0x6f69('0x1b')]=function(_0x285b5c,_0x18fd85){return db[_0x6f69('0x2d')][_0x6f69('0x37')]({'where':{'id':_0x285b5c['params']['id']}})['then'](handleEntityNotFound(_0x18fd85,null))[_0x6f69('0x1a')](removeEntity(_0x18fd85,null))[_0x6f69('0x29')](handleError(_0x18fd85,null));};exports[_0x6f69('0x3b')]=function(_0x25bbc7,_0x4c7adc){return db[_0x6f69('0x2d')][_0x6f69('0x3b')]()[_0x6f69('0x1a')](respondWithResult(_0x4c7adc,null))[_0x6f69('0x29')](handleError(_0x4c7adc,null));};exports[_0x6f69('0x3c')]=function(_0x49d4b2,_0x6a0de5){return db[_0x6f69('0x3d')][_0x6f69('0x37')]({'where':{'id':_0x49d4b2[_0x6f69('0x2b')]['id']}})[_0x6f69('0x1a')](handleEntityNotFound(_0x6a0de5,null))[_0x6f69('0x1a')](function(_0x2d2904){if(_0x2d2904){return _0x2d2904[_0x6f69('0x3c')](_0x49d4b2[_0x6f69('0x3a')][_0x6f69('0x3e')],_[_0x6f69('0x3f')](_0x49d4b2[_0x6f69('0x3a')],[_0x6f69('0x3e'),'id'])||{});}})[_0x6f69('0x1a')](respondWithResult(_0x6a0de5,null))[_0x6f69('0x29')](handleError(_0x6a0de5,null));};exports['getMessages']=function(_0xe39093,_0x3fb32a){var _0x14e1fb={'raw':![],'where':{}};var _0x5172c0={};var _0x48a096={'count':0x0,'rows':[]};return db['MailInteraction'][_0x6f69('0x40')]({'where':{'id':_0xe39093[_0x6f69('0x2b')]['id']}})[_0x6f69('0x1a')](handleEntityNotFound(_0x3fb32a,null))[_0x6f69('0x1a')](function(_0x528c90){if(_0x528c90){_0x5172c0['model']=_[_0x6f69('0x2c')](db[_0x6f69('0x3d')]['rawAttributes']);_0x5172c0[_0x6f69('0x27')]=_[_0x6f69('0x2c')](_0xe39093[_0x6f69('0x27')]);_0x5172c0[_0x6f69('0x2e')]=_[_0x6f69('0x2f')](_0x5172c0[_0x6f69('0x30')],_0x5172c0[_0x6f69('0x27')]);_0x14e1fb[_0x6f69('0x31')]=_[_0x6f69('0x2f')](_0x5172c0['model'],qs[_0x6f69('0x32')](_0xe39093['query'][_0x6f69('0x32')]));_0x14e1fb[_0x6f69('0x31')]=_0x14e1fb[_0x6f69('0x31')][_0x6f69('0x33')]?_0x14e1fb[_0x6f69('0x31')]:_0x5172c0[_0x6f69('0x30')];if(!_0xe39093[_0x6f69('0x27')][_0x6f69('0x41')](_0x6f69('0x42'))){_0x14e1fb['limit']=qs[_0x6f69('0x17')](_0xe39093['query'][_0x6f69('0x17')]);_0x14e1fb[_0x6f69('0x16')]=qs[_0x6f69('0x16')](_0xe39093[_0x6f69('0x27')][_0x6f69('0x16')]);}_0x14e1fb[_0x6f69('0x43')]=qs[_0x6f69('0x44')](_0xe39093[_0x6f69('0x27')][_0x6f69('0x44')]);_0x14e1fb['where']=qs[_0x6f69('0x2e')](_['pick'](_0xe39093[_0x6f69('0x27')],_0x5172c0[_0x6f69('0x2e')]));_0x14e1fb[_0x6f69('0x45')]['MailInteractionId']=_0x528c90['id'];if(_0xe39093[_0x6f69('0x27')][_0x6f69('0x46')]){_0x14e1fb[_0x6f69('0x45')]=_[_0x6f69('0x47')](_0x14e1fb[_0x6f69('0x45')],{'$or':_[_0x6f69('0x48')](_0x14e1fb[_0x6f69('0x31')],function(_0x36cc9e){var _0x4a72a5={};_0x4a72a5[_0x36cc9e]={'$like':'%'+_0xe39093[_0x6f69('0x27')][_0x6f69('0x46')]+'%'};return _0x4a72a5;})});}if(_0xe39093[_0x6f69('0x27')]['$gte']){var _0x4cac04=_0xe39093[_0x6f69('0x27')][_0x6f69('0x49')][_0x6f69('0x4a')](',');var _0x4a9c76={};_0x4a9c76[_0x4cac04[0x0]]={'$gte':moment(_0x4cac04[0x1])[_0x6f69('0x4b')](_0x6f69('0x4c'))};_0x14e1fb[_0x6f69('0x45')]=_[_0x6f69('0x47')](_0x14e1fb[_0x6f69('0x45')],_0x4a9c76);}_0x14e1fb=_[_0x6f69('0x47')]({},_0x14e1fb,_0xe39093[_0x6f69('0x36')]);return db[_0x6f69('0x3d')]['count']({'where':_0x14e1fb[_0x6f69('0x45')]})[_0x6f69('0x1a')](function(_0x11f519){_0x48a096['count']=_0x11f519;if(_0xe39093[_0x6f69('0x27')][_0x6f69('0x34')]){_0x14e1fb[_0x6f69('0x35')]=[{'all':!![]}];}return db[_0x6f69('0x3d')][_0x6f69('0x26')](_0x14e1fb);})[_0x6f69('0x1a')](function(_0x5f4c73){if(_0xe39093['query'][_0x6f69('0x4d')]===_0x6f69('0x4e')){for(var _0x55551e=0x0;_0x55551e<_0x5f4c73[_0x6f69('0x33')];_0x55551e++){_0x5f4c73[_0x55551e][_0x6f69('0x3a')]=juice(_0x5f4c73[_0x55551e][_0x6f69('0x3a')]);}}_0x48a096[_0x6f69('0x4f')]=_0x5f4c73;return _0x48a096;});}})[_0x6f69('0x1a')](respondWithFilteredResult(_0x3fb32a,_0x14e1fb))[_0x6f69('0x29')](handleError(_0x3fb32a,null));};exports[_0x6f69('0x50')]=function(_0x3b9bf6,_0x4fe88f){return db[_0x6f69('0x2d')][_0x6f69('0x37')]({'where':{'id':_0x3b9bf6['params']['id']}})[_0x6f69('0x1a')](handleEntityNotFound(_0x4fe88f,null))['then'](function(_0x14431c){if(_0x14431c){return _0x14431c[_0x6f69('0x51')](_0x3b9bf6[_0x6f69('0x3a')][_0x6f69('0x3e')],_[_0x6f69('0x3f')](_0x3b9bf6[_0x6f69('0x3a')],[_0x6f69('0x3e'),'id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id',_0x6f69('0x1f'),_0x6f69('0x52')],'where':{'id':_0x3b9bf6[_0x6f69('0x3a')][_0x6f69('0x3e')]}});})[_0x6f69('0x1a')](function(_0x20fa43){socket['emit'](_0x6f69('0x53'),{'id':Number(_0x3b9bf6[_0x6f69('0x2b')]['id']),'tags':_0x20fa43||[]});return{'id':Number(_0x3b9bf6['params']['id']),'tags':_0x20fa43||[]};});}})['then'](respondWithResult(_0x4fe88f,null))[_0x6f69('0x29')](handleError(_0x4fe88f,null));};exports[_0x6f69('0x54')]=function(_0x25034f,_0xbc25ee){return db[_0x6f69('0x2d')]['find']({'where':{'id':_0x25034f[_0x6f69('0x2b')]['id']}})[_0x6f69('0x1a')](handleEntityNotFound(_0xbc25ee,null))[_0x6f69('0x1a')](function(_0x487ccc){if(_0x487ccc){return _0x487ccc['removeTags'](_0x25034f[_0x6f69('0x27')][_0x6f69('0x3e')]);}})[_0x6f69('0x1a')](respondWithStatusCode(_0xbc25ee,null))['catch'](handleError(_0xbc25ee,null));};exports[_0x6f69('0x55')]=function(_0x53a5b7,_0x14a51e){var _0x36a479=moment()[_0x6f69('0x56')]()[_0x6f69('0x57')]();var _0x5129a2=path[_0x6f69('0x58')](config[_0x6f69('0x59')],'server',_0x6f69('0x5a'),_0x6f69('0x5b'));var _0x4381de=path[_0x6f69('0x58')](config[_0x6f69('0x59')],_0x6f69('0x5c'),_0x6f69('0x5a'),_0x6f69('0x5d'));var _0xa7ce7=path[_0x6f69('0x58')](_0x5129a2,_0x36a479);var _0x5cd767=util['format'](_0x6f69('0x5e'),_0x53a5b7[_0x6f69('0x2b')]['id'],_0x36a479);var _0x552d85=path[_0x6f69('0x58')](_0x5129a2,_0x5cd767);var _0x1825a5=[];if(_0x53a5b7[_0x6f69('0x27')][_0x6f69('0x5d')]){_0x1825a5[_0x6f69('0x5f')]({'model':db[_0x6f69('0x60')],'as':'Attachments','raw':!![]});}var _0x6fe196=[{'model':db[_0x6f69('0x3d')],'as':_0x6f69('0x61'),'attributes':['id',_0x6f69('0x3a'),_0x6f69('0x62'),'to','cc',_0x6f69('0x63'),_0x6f69('0x64'),'createdAt'],'where':{'secret':![]},'order':qs[_0x6f69('0x44')]('id'),'include':_0x1825a5}];return db['MailInteraction']['find']({'where':{'id':_0x53a5b7['params']['id']},'include':_0x6fe196})[_0x6f69('0x1a')](handleEntityNotFound(_0x14a51e,null))[_0x6f69('0x1a')](function(_0x326ab7){if(_0x326ab7&&_0x326ab7['Messages']){var _0xfef872=_0x326ab7[_0x6f69('0x65')]({'plain':!![]});fs[_0x6f69('0x66')](_0xa7ce7);return BPromise[_0x6f69('0x67')](_0xfef872['Messages'],function(_0x41f88d,_0x3bba06){var _0x5c7df8={'from':_0x41f88d[_0x6f69('0x62')],'to':_0x41f88d['to']||_0x6f69('0x68'),'subject':_0x41f88d[_0x6f69('0x64')],'html':htmlEntities[_0x6f69('0x69')](_0x41f88d[_0x6f69('0x3a')]),'headers':{'Date':moment(_0x41f88d['createdAt'])['format'](_0x6f69('0x6a'))},'attachments':[]};if(_0x41f88d['cc']){_0x5c7df8['headers']['Cc']=_0x41f88d['cc'];}if(_0x41f88d['bcc']){_0x5c7df8[_0x6f69('0x6b')][_0x6f69('0x6c')]=_0x41f88d[_0x6f69('0x63')];}return new BPromise(function(_0x520fea,_0x3a7207){if(_0x41f88d[_0x6f69('0x6d')]){for(var _0x32e704=0x0;_0x32e704<_0x41f88d[_0x6f69('0x6d')][_0x6f69('0x33')];_0x32e704++){var _0x525103=_0x41f88d[_0x6f69('0x6d')][_0x32e704];var _0x2b817e=path[_0x6f69('0x58')](_0x4381de,_0x525103[_0x6f69('0x6e')]);if(fs[_0x6f69('0x6f')](_0x2b817e)){_0x5c7df8[_0x6f69('0x5d')][_0x6f69('0x5f')]({'name':_0x525103[_0x6f69('0x1f')],'contentType':_0x525103['type'],'data':fs['readFileSync'](_0x2b817e)});}}}emlformat[_0x6f69('0x70')](_0x5c7df8,function(_0xd1e3d,_0x18238){if(_0xd1e3d)return _0x3a7207(_0xd1e3d);fs['writeFileSync'](path[_0x6f69('0x58')](_0xa7ce7,util[_0x6f69('0x4b')]('message%d.eml',_0x3bba06)),_0x18238);return _0x520fea(_0x18238);});});})[_0x6f69('0x1a')](function(){return new BPromise(function(_0x1e4208,_0x5b22d5){zipdir(_0xa7ce7,{'saveTo':_0x552d85},function(_0xad851,_0x366011){if(_0xad851)return _0x5b22d5(_0xad851);return _0x1e4208(_0x366011);});})[_0x6f69('0x1a')](function(){return new BPromise(function(_0x28cb0e,_0x5a2f2d){rimraf(_0xa7ce7,function(_0x376316){if(_0x376316)_0x5a2f2d(_0x376316);return _0x28cb0e();});});})['then'](function(){return _0x14a51e[_0x6f69('0x55')](_0x552d85,_0x5cd767,function(_0x4bf712){if(!_0x4bf712)fs[_0x6f69('0x71')](_0x552d85);});});});}else{return _0x14a51e[_0x6f69('0x1c')](0xc8);}})['catch'](handleError(_0x14a51e,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index c693f8c..6afdfa8 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 _0xbda7=['events','MailInteraction','../../mysqldb','MailMessage','setMaxListeners','save','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports'];(function(_0x4ea6af,_0x4aa32e){var _0x4cb1e6=function(_0xc9edd0){while(--_0xc9edd0){_0x4ea6af['push'](_0x4ea6af['shift']());}};_0x4cb1e6(++_0x4aa32e);}(_0xbda7,0x118));var _0x7bda=function(_0x56cd55,_0x118cf4){_0x56cd55=_0x56cd55-0x0;var _0x169d98=_0xbda7[_0x56cd55];return _0x169d98;};'use strict';var EventEmitter=require(_0x7bda('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0x7bda('0x1')];var MailMessage=require(_0x7bda('0x2'))['db'][_0x7bda('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x7bda('0x4')](0x0);var events={'afterCreate':_0x7bda('0x5'),'afterUpdate':'update','afterDestroy':_0x7bda('0x6')};function emitEvent(_0x2e0b4b){return function(_0x3e0f1e,_0x4c1f67,_0x5b34a8){_0x3e0f1e[_0x7bda('0x7')]({'attributes':['id'],'raw':!![]})[_0x7bda('0x8')](function(_0x3891dc){_0x3e0f1e[_0x7bda('0x9')](_0x7bda('0xa'),_0x3891dc[_0x7bda('0xb')](function(_0x27cad3){return{'id':_0x27cad3['id']};}));return MailMessage[_0x7bda('0xc')]({'where':{'MailInteractionId':_0x3e0f1e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7bda('0x8')](function(_0xc6fb39){_0x3e0f1e['setDataValue'](_0x7bda('0xd'),_0xc6fb39[_0x7bda('0xe')]);MailInteractionEvents[_0x7bda('0xf')](_0x2e0b4b+':'+_0x3e0f1e['id'],_0x3e0f1e);MailInteractionEvents[_0x7bda('0xf')](_0x2e0b4b,_0x3e0f1e);_0x5b34a8(null);})[_0x7bda('0x10')](_0x5b34a8(null));};}for(var e in events){if(events[_0x7bda('0x11')](e)){var event=events[e];MailInteraction[_0x7bda('0x12')](e,emitEvent(event));}}module[_0x7bda('0x13')]=MailInteractionEvents; \ No newline at end of file +var _0xe339=['exports','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','remove','getUsers','then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x2bed89,_0x1556ef){var _0x3b46c6=function(_0x103df1){while(--_0x103df1){_0x2bed89['push'](_0x2bed89['shift']());}};_0x3b46c6(++_0x1556ef);}(_0xe339,0x91));var _0x9e33=function(_0x5d2699,_0xbb63f2){_0x5d2699=_0x5d2699-0x0;var _0x2a2ee6=_0xe339[_0x5d2699];return _0x2a2ee6;};'use strict';var EventEmitter=require(_0x9e33('0x0'));var MailInteraction=require(_0x9e33('0x1'))['db'][_0x9e33('0x2')];var MailMessage=require(_0x9e33('0x1'))['db'][_0x9e33('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x9e33('0x4')](0x0);var events={'afterCreate':_0x9e33('0x5'),'afterUpdate':'update','afterDestroy':_0x9e33('0x6')};function emitEvent(_0x45d1d6){return function(_0x34de42,_0x1c530e,_0x1f0e8d){_0x34de42[_0x9e33('0x7')]({'attributes':['id'],'raw':!![]})[_0x9e33('0x8')](function(_0x202eb8){_0x34de42[_0x9e33('0x9')]('Users',_0x202eb8[_0x9e33('0xa')](function(_0x16e748){return{'id':_0x16e748['id']};}));return MailMessage[_0x9e33('0xb')]({'where':{'MailInteractionId':_0x34de42['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9e33('0x8')](function(_0x36a0ab){_0x34de42['setDataValue'](_0x9e33('0xc'),_0x36a0ab[_0x9e33('0xd')]);MailInteractionEvents['emit'](_0x45d1d6+':'+_0x34de42['id'],_0x34de42);MailInteractionEvents[_0x9e33('0xe')](_0x45d1d6,_0x34de42);_0x1f0e8d(null);})[_0x9e33('0xf')](_0x1f0e8d(null));};}for(var e in events){if(events[_0x9e33('0x10')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x9e33('0x11')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 332fa98..8508885 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 _0xaff6=['mail_interactions','subject','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','models','get','update','catch','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction'];(function(_0x2fb1dd,_0x543b7f){var _0x2575a5=function(_0xb0e4a0){while(--_0xb0e4a0){_0x2fb1dd['push'](_0x2fb1dd['shift']());}};_0x2575a5(++_0x543b7f);}(_0xaff6,0x1f4));var _0x6aff=function(_0x292e87,_0x9b2eb5){_0x292e87=_0x292e87-0x0;var _0x5186f6=_0xaff6[_0x292e87];return _0x5186f6;};'use strict';var _=require('lodash');var util=require(_0x6aff('0x0'));var logger=require(_0x6aff('0x1'))(_0x6aff('0x2'));var moment=require(_0x6aff('0x3'));var BPromise=require(_0x6aff('0x4'));var rp=require(_0x6aff('0x5'));var fs=require('fs');var path=require(_0x6aff('0x6'));var rimraf=require(_0x6aff('0x7'));var config=require(_0x6aff('0x8'));var attributes=require(_0x6aff('0x9'));module[_0x6aff('0xa')]=function(_0x1b0e85,_0x5278ef){return _0x1b0e85[_0x6aff('0xb')](_0x6aff('0xc'),attributes,{'tableName':_0x6aff('0xd'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x6aff('0xe'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0xeecb61,_0x52afbf,_0x394ce0){if(_0xeecb61[_0x6aff('0xf')]){_0xeecb61[_0x6aff('0x10')]=moment()[_0x6aff('0x11')](_0x6aff('0x12'));}if(_0xeecb61[_0x6aff('0x13')]){_0xeecb61[_0x6aff('0x14')]=moment()['format'](_0x6aff('0x12'));}_0x394ce0(null,_0x52afbf);},'beforeUpdate':function(_0x5cdb35,_0x6cbcff,_0x16a4f5){if(_0x5cdb35['changed']('substatus')){_0x5cdb35[_0x6aff('0x10')]=_0x5cdb35[_0x6aff('0xf')]?moment()[_0x6aff('0x11')](_0x6aff('0x12')):null;}if(_0x5cdb35['changed'](_0x6aff('0x13'))){_0x5cdb35[_0x6aff('0x14')]=moment()[_0x6aff('0x11')](_0x6aff('0x12'));_0x5cdb35[_0x6aff('0xf')]=null;_0x5cdb35[_0x6aff('0x10')]=null;}_0x16a4f5(null,_0x5cdb35);},'afterUpdate':function(_0x1517de,_0x716e8f,_0x10b910){var _0x4ded53=_0x1b0e85[_0x6aff('0x15')];var _0x2c7c4a=_0x1517de[_0x6aff('0x16')]({'plain':!![]});if(_0x2c7c4a[_0x6aff('0x13')]){return _0x4ded53['MailMessage'][_0x6aff('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x2c7c4a['id']}})['then'](function(){_0x10b910();})[_0x6aff('0x18')](function(_0x2a985a){_0x10b910(_0x2a985a);});}else{_0x10b910();}}},'charset':_0x6aff('0x19'),'collate':_0x6aff('0x1a')});}; \ No newline at end of file +var _0x4694=['../../config/logger','api','path','../../config/environment','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatusAt','format','closed','YYYY-MM-DD\x20HH:mm:ss','changed','substatus','models','get','MailMessage','update','catch','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x4694,0xce));var _0x4469=function(_0xdeefbd,_0x9e1b3d){_0xdeefbd=_0xdeefbd-0x0;var _0x4ff63f=_0x4694[_0xdeefbd];return _0x4ff63f;};'use strict';var _=require(_0x4469('0x0'));var util=require('util');var logger=require(_0x4469('0x1'))(_0x4469('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4469('0x3'));var rimraf=require('rimraf');var config=require(_0x4469('0x4'));var attributes=require('./mailInteraction.attributes');module['exports']=function(_0x541183,_0x1bcee2){return _0x541183['define'](_0x4469('0x5'),attributes,{'tableName':_0x4469('0x6'),'paranoid':![],'indexes':[{'name':_0x4469('0x7'),'fields':[_0x4469('0x8'),'to'],'type':_0x4469('0x9')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4e3150,_0x1f1454,_0x269f6f){if(_0x4e3150['substatus']){_0x4e3150[_0x4469('0xa')]=moment()[_0x4469('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x4e3150[_0x4469('0xc')]){_0x4e3150['closedAt']=moment()[_0x4469('0xb')](_0x4469('0xd'));}_0x269f6f(null,_0x1f1454);},'beforeUpdate':function(_0x38c8ee,_0x46bcf7,_0xa186d9){if(_0x38c8ee[_0x4469('0xe')](_0x4469('0xf'))){_0x38c8ee['substatusAt']=_0x38c8ee['substatus']?moment()[_0x4469('0xb')](_0x4469('0xd')):null;}if(_0x38c8ee[_0x4469('0xe')](_0x4469('0xc'))){_0x38c8ee['closedAt']=moment()[_0x4469('0xb')]('YYYY-MM-DD\x20HH:mm:ss');_0x38c8ee[_0x4469('0xf')]=null;_0x38c8ee[_0x4469('0xa')]=null;}_0xa186d9(null,_0x38c8ee);},'afterUpdate':function(_0x35094f,_0x426fd7,_0x1ad83c){var _0x11ed43=_0x541183[_0x4469('0x10')];var _0x2e3b3c=_0x35094f[_0x4469('0x11')]({'plain':!![]});if(_0x2e3b3c['closed']){return _0x11ed43[_0x4469('0x12')][_0x4469('0x13')]({'read':!![]},{'where':{'MailInteractionId':_0x2e3b3c['id']}})['then'](function(){_0x1ad83c();})[_0x4469('0x14')](function(_0x33da12){_0x1ad83c(_0x33da12);});}else{_0x1ad83c();}}},'charset':_0x4469('0x15'),'collate':_0x4469('0x16')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index b685ccb..1208dec 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 _0x7cd3=['AddTagsToMailInteraction','find','addTags','body','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','info','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','error','MailInteraction,\x20%s,\x20%s','result','message','UpdateMailInteraction','MailInteraction','options','where','attributes','limit','then','stringify'];(function(_0x3107b5,_0xf2f18c){var _0x395756=function(_0x4fa441){while(--_0x4fa441){_0x3107b5['push'](_0x3107b5['shift']());}};_0x395756(++_0xf2f18c);}(_0x7cd3,0x181));var _0x37cd=function(_0x5cccb9,_0x44ff71){_0x5cccb9=_0x5cccb9-0x0;var _0x3e29fb=_0x7cd3[_0x5cccb9];return _0x3e29fb;};'use strict';var _=require(_0x37cd('0x0'));var util=require(_0x37cd('0x1'));var moment=require(_0x37cd('0x2'));var BPromise=require(_0x37cd('0x3'));var rs=require(_0x37cd('0x4'));var fs=require('fs');var Redis=require(_0x37cd('0x5'));var db=require(_0x37cd('0x6'))['db'];var utils=require(_0x37cd('0x7'));var logger=require('../../config/logger')(_0x37cd('0x8'));var config=require(_0x37cd('0x9'));var jayson=require(_0x37cd('0xa'));var client=jayson[_0x37cd('0xb')][_0x37cd('0xc')]({'port':0x232a});config[_0x37cd('0xd')]=_[_0x37cd('0xe')](config[_0x37cd('0xd')],{'host':_0x37cd('0xf'),'port':0x18eb});var socket=require(_0x37cd('0x10'))(new Redis(config[_0x37cd('0xd')]));require('./mailInteraction.socket')[_0x37cd('0x11')](socket);function respondWithRpcPromise(_0x79e34e,_0x4eda48,_0x38f144){return new BPromise(function(_0x4fddf5,_0x50ebcd){return client[_0x37cd('0x12')](_0x79e34e,_0x38f144)['then'](function(_0x20fc91){logger[_0x37cd('0x13')]('MailInteraction,\x20%s,\x20%s',_0x4eda48,_0x37cd('0x14'));logger[_0x37cd('0x15')](_0x37cd('0x16'),_0x4eda48,_0x37cd('0x14'),JSON['stringify'](_0x20fc91));if(_0x20fc91['error']){if(_0x20fc91[_0x37cd('0x17')]['code']===0x1f4){logger[_0x37cd('0x17')](_0x37cd('0x18'),_0x4eda48,_0x20fc91[_0x37cd('0x17')]['message']);return _0x50ebcd(_0x20fc91['error']['message']);}logger[_0x37cd('0x17')]('MailInteraction,\x20%s,\x20%s',_0x4eda48,_0x20fc91['error']['message']);return _0x4fddf5(_0x20fc91[_0x37cd('0x17')]['message']);}else{logger[_0x37cd('0x13')]('MailInteraction,\x20%s,\x20%s',_0x4eda48,_0x37cd('0x14'));_0x4fddf5(_0x20fc91[_0x37cd('0x19')][_0x37cd('0x1a')]);}})['catch'](function(_0x4c7e90){logger[_0x37cd('0x17')](_0x37cd('0x18'),_0x4eda48,_0x4c7e90);_0x50ebcd(_0x4c7e90);});});}exports[_0x37cd('0x1b')]=function(_0x493377){var _0x6be20d=this;return new Promise(function(_0x3de6a6,_0x32bedd){return db[_0x37cd('0x1c')]['update'](_0x493377['body'],{'raw':_0x493377[_0x37cd('0x1d')]?_0x493377['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x493377[_0x37cd('0x1d')]?_0x493377[_0x37cd('0x1d')][_0x37cd('0x1e')]||null:null,'attributes':_0x493377['options']?_0x493377[_0x37cd('0x1d')][_0x37cd('0x1f')]||null:null,'limit':_0x493377[_0x37cd('0x1d')]?_0x493377[_0x37cd('0x1d')][_0x37cd('0x20')]||null:null})[_0x37cd('0x21')](function(_0x1da229){logger['info']('UpdateMailInteraction',_0x493377);logger[_0x37cd('0x15')](_0x37cd('0x1b'),_0x493377,JSON[_0x37cd('0x22')](_0x1da229));_0x3de6a6(_0x1da229);})['catch'](function(_0xbef306){logger[_0x37cd('0x17')]('UpdateMailInteraction',_0xbef306[_0x37cd('0x1a')],_0x493377);_0x32bedd(_0x6be20d[_0x37cd('0x17')](0x1f4,_0xbef306[_0x37cd('0x1a')]));});});};exports[_0x37cd('0x23')]=function(_0x4a0f83){return new Promise(function(_0x28ede5,_0x67f3d4){return db[_0x37cd('0x1c')][_0x37cd('0x24')]({'where':_0x4a0f83[_0x37cd('0x1d')]?_0x4a0f83[_0x37cd('0x1d')][_0x37cd('0x1e')]||null:null})[_0x37cd('0x21')](function(_0x2831a4){if(_0x2831a4){return _0x2831a4[_0x37cd('0x25')](_0x4a0f83[_0x37cd('0x26')][_0x37cd('0x27')],_[_0x37cd('0x28')](_0x4a0f83['body'],[_0x37cd('0x27'),'id'])||{});}})['spread'](function(_0x1bb600){logger[_0x37cd('0x13')](_0x37cd('0x29'),_0x4a0f83);logger[_0x37cd('0x15')](_0x37cd('0x29'),_0x4a0f83,JSON[_0x37cd('0x22')](_0x1bb600));_0x28ede5(_0x1bb600);})['catch'](function(_0x257bb0){logger['error']('AddTags',_0x257bb0[_0x37cd('0x1a')],_0x4a0f83);_0x67f3d4(_this[_0x37cd('0x17')](0x1f4,_0x257bb0['message']));});});}; \ No newline at end of file +var _0xabf7=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','then','request\x20sent','debug','error','code','message','MailInteraction,\x20%s,\x20%s','info','result','catch','UpdateMailInteraction','body','options','raw','limit','stringify','find','ids','spread','AddTags','lodash','moment','bluebird','randomstring','../../mysqldb','rpc'];(function(_0x4a2be6,_0x4c22e0){var _0xf600aa=function(_0x4ad2c6){while(--_0x4ad2c6){_0x4a2be6['push'](_0x4a2be6['shift']());}};_0xf600aa(++_0x4c22e0);}(_0xabf7,0xae));var _0x7abf=function(_0x3154a3,_0x45d16d){_0x3154a3=_0x3154a3-0x0;var _0x553af5=_0xabf7[_0x3154a3];return _0x553af5;};'use strict';var _=require(_0x7abf('0x0'));var util=require('util');var moment=require(_0x7abf('0x1'));var BPromise=require(_0x7abf('0x2'));var rs=require(_0x7abf('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7abf('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7abf('0x5'));var config=require(_0x7abf('0x6'));var jayson=require(_0x7abf('0x7'));var client=jayson[_0x7abf('0x8')][_0x7abf('0x9')]({'port':0x232a});config[_0x7abf('0xa')]=_[_0x7abf('0xb')](config['redis'],{'host':_0x7abf('0xc'),'port':0x18eb});var socket=require(_0x7abf('0xd'))(new Redis(config[_0x7abf('0xa')]));require(_0x7abf('0xe'))[_0x7abf('0xf')](socket);function respondWithRpcPromise(_0x5a0ce2,_0x5c9da3,_0x3e8c13){return new BPromise(function(_0x10e5ee,_0x54ae39){return client['request'](_0x5a0ce2,_0x3e8c13)[_0x7abf('0x10')](function(_0x15748a){logger['info']('MailInteraction,\x20%s,\x20%s',_0x5c9da3,_0x7abf('0x11'));logger[_0x7abf('0x12')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x5c9da3,_0x7abf('0x11'),JSON['stringify'](_0x15748a));if(_0x15748a['error']){if(_0x15748a[_0x7abf('0x13')][_0x7abf('0x14')]===0x1f4){logger[_0x7abf('0x13')]('MailInteraction,\x20%s,\x20%s',_0x5c9da3,_0x15748a[_0x7abf('0x13')][_0x7abf('0x15')]);return _0x54ae39(_0x15748a[_0x7abf('0x13')][_0x7abf('0x15')]);}logger[_0x7abf('0x13')](_0x7abf('0x16'),_0x5c9da3,_0x15748a[_0x7abf('0x13')][_0x7abf('0x15')]);return _0x10e5ee(_0x15748a[_0x7abf('0x13')][_0x7abf('0x15')]);}else{logger[_0x7abf('0x17')](_0x7abf('0x16'),_0x5c9da3,_0x7abf('0x11'));_0x10e5ee(_0x15748a[_0x7abf('0x18')][_0x7abf('0x15')]);}})[_0x7abf('0x19')](function(_0x3d8105){logger['error'](_0x7abf('0x16'),_0x5c9da3,_0x3d8105);_0x54ae39(_0x3d8105);});});}exports[_0x7abf('0x1a')]=function(_0x464c48){var _0x37d04a=this;return new Promise(function(_0x5375d5,_0x570385){return db['MailInteraction']['update'](_0x464c48[_0x7abf('0x1b')],{'raw':_0x464c48[_0x7abf('0x1c')]?_0x464c48[_0x7abf('0x1c')][_0x7abf('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x464c48[_0x7abf('0x1c')]?_0x464c48[_0x7abf('0x1c')]['where']||null:null,'attributes':_0x464c48[_0x7abf('0x1c')]?_0x464c48[_0x7abf('0x1c')]['attributes']||null:null,'limit':_0x464c48[_0x7abf('0x1c')]?_0x464c48[_0x7abf('0x1c')][_0x7abf('0x1e')]||null:null})['then'](function(_0x245c9b){logger[_0x7abf('0x17')](_0x7abf('0x1a'),_0x464c48);logger[_0x7abf('0x12')]('UpdateMailInteraction',_0x464c48,JSON[_0x7abf('0x1f')](_0x245c9b));_0x5375d5(_0x245c9b);})[_0x7abf('0x19')](function(_0x313db0){logger[_0x7abf('0x13')](_0x7abf('0x1a'),_0x313db0[_0x7abf('0x15')],_0x464c48);_0x570385(_0x37d04a[_0x7abf('0x13')](0x1f4,_0x313db0['message']));});});};exports['AddTagsToMailInteraction']=function(_0x5e8c9e){return new Promise(function(_0x2d3795,_0x5844bf){return db['MailInteraction'][_0x7abf('0x20')]({'where':_0x5e8c9e[_0x7abf('0x1c')]?_0x5e8c9e[_0x7abf('0x1c')]['where']||null:null})[_0x7abf('0x10')](function(_0x40f1e8){if(_0x40f1e8){return _0x40f1e8['addTags'](_0x5e8c9e[_0x7abf('0x1b')][_0x7abf('0x21')],_['omit'](_0x5e8c9e[_0x7abf('0x1b')],[_0x7abf('0x21'),'id'])||{});}})[_0x7abf('0x22')](function(_0x1a083b){logger[_0x7abf('0x17')](_0x7abf('0x23'),_0x5e8c9e);logger['debug'](_0x7abf('0x23'),_0x5e8c9e,JSON['stringify'](_0x1a083b));_0x2d3795(_0x1a083b);})[_0x7abf('0x19')](function(_0xfdc784){logger[_0x7abf('0x13')](_0x7abf('0x23'),_0xfdc784[_0x7abf('0x15')],_0x5e8c9e);_0x5844bf(_this[_0x7abf('0x13')](0x1f4,_0xfdc784['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 397eb80..29c7535 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 _0x05db=['save','update','emit','length','mailInteraction:','./mailInteraction.events'];(function(_0xb25c71,_0x184611){var _0x4ad3a4=function(_0x1bf446){while(--_0x1bf446){_0xb25c71['push'](_0xb25c71['shift']());}};_0x4ad3a4(++_0x184611);}(_0x05db,0xb9));var _0xb05d=function(_0x334fea,_0x1f1e18){_0x334fea=_0x334fea-0x0;var _0x3c5829=_0x05db[_0x334fea];return _0x3c5829;};'use strict';var MailInteractionEvents=require(_0xb05d('0x0'));var events=[_0xb05d('0x1'),'remove',_0xb05d('0x2')];function createListener(_0x7184c,_0x14e2f2){return function(_0x226bb2){_0x14e2f2[_0xb05d('0x3')](_0x7184c,_0x226bb2);};}function removeListener(_0x5e1689,_0x367445){return function(){MailInteractionEvents['removeListener'](_0x5e1689,_0x367445);};}exports['register']=function(_0x41600f){for(var _0x3e65b7=0x0,_0x2d1ded=events[_0xb05d('0x4')];_0x3e65b7<_0x2d1ded;_0x3e65b7++){var _0x502589=events[_0x3e65b7];var _0x15f89b=createListener(_0xb05d('0x5')+_0x502589,_0x41600f);MailInteractionEvents['on'](_0x502589,_0x15f89b);}}; \ No newline at end of file +var _0x400f=['save','remove','update','emit','register','length','mailInteraction:','./mailInteraction.events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x400f,0x19f));var _0xf400=function(_0xe409a6,_0x5b9ce6){_0xe409a6=_0xe409a6-0x0;var _0x40a2f8=_0x400f[_0xe409a6];return _0x40a2f8;};'use strict';var MailInteractionEvents=require(_0xf400('0x0'));var events=[_0xf400('0x1'),_0xf400('0x2'),_0xf400('0x3')];function createListener(_0x2b66f2,_0x7ce8cd){return function(_0x3d5b01){_0x7ce8cd[_0xf400('0x4')](_0x2b66f2,_0x3d5b01);};}function removeListener(_0x5784f7,_0x4f034e){return function(){MailInteractionEvents['removeListener'](_0x5784f7,_0x4f034e);};}exports[_0xf400('0x5')]=function(_0x50b1d4){for(var _0x3e3556=0x0,_0x3de70d=events[_0xf400('0x6')];_0x3e3556<_0x3de70d;_0x3e3556++){var _0x572863=events[_0x3e3556];var _0x33f830=createListener(_0xf400('0x7')+_0x572863,_0x50b1d4);MailInteractionEvents['on'](_0x572863,_0x33f830);}}; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/index.js b/server/api/mailInteractionHasTag/index.js index 2f05052..3d4034f 100644 --- a/server/api/mailInteractionHasTag/index.js +++ b/server/api/mailInteractionHasTag/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x97a0=['get','describe','express','Router','../../components/auth/service'];(function(_0x5835b9,_0x2f25eb){var _0x3553e9=function(_0x3ea513){while(--_0x3ea513){_0x5835b9['push'](_0x5835b9['shift']());}};_0x3553e9(++_0x2f25eb);}(_0x97a0,0xc5));var _0x097a=function(_0x14d4f8,_0x1d40d3){_0x14d4f8=_0x14d4f8-0x0;var _0x36bd82=_0x97a0[_0x14d4f8];return _0x36bd82;};'use strict';var express=require(_0x097a('0x0'));var router=express[_0x097a('0x1')]();var auth=require(_0x097a('0x2'));var controller=require('./mailInteractionHasTag.controller');router[_0x097a('0x3')]('/describe',auth['isAuthenticated'](),controller[_0x097a('0x4')]);module['exports']=router; \ No newline at end of file +var _0xf6fa=['Router','./mailInteractionHasTag.controller','get','/describe','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xf6fa,0x87));var _0xaf6f=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xf6fa[_0x126558];return _0x1f6d14;};'use strict';var express=require('express');var router=express[_0xaf6f('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0xaf6f('0x1'));router[_0xaf6f('0x2')](_0xaf6f('0x3'),auth['isAuthenticated'](),controller['describe']);module[_0xaf6f('0x4')]=router; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js b/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js index 37c9075..4f0d610 100644 --- a/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js +++ b/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','../../config/logger','api','../../mysqldb','json','error','name','status','describe','then'];(function(_0x225298,_0x27651f){var _0x5657e0=function(_0x8fc9a0){while(--_0x8fc9a0){_0x225298['push'](_0x225298['shift']());}};_0x5657e0(++_0x27651f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var logger=require(_0x0a9e('0x0'))(_0x0a9e('0x1'));var db=require(_0x0a9e('0x2'))['db'];function respondWithResult(_0x5dd881,_0x550fbc){_0x550fbc=_0x550fbc||0xc8;return function(_0x18d5c9){if(_0x18d5c9){return _0x5dd881['status'](_0x550fbc)[_0x0a9e('0x3')](_0x18d5c9);}};}function handleError(_0x432180,_0x2ab90b){_0x2ab90b=_0x2ab90b||0x1f4;return function(_0x991246){logger[_0x0a9e('0x4')](_0x991246['stack']);if(_0x991246[_0x0a9e('0x5')]){delete _0x991246[_0x0a9e('0x5')];}_0x432180[_0x0a9e('0x6')](_0x2ab90b)['send'](_0x991246);};}exports['describe']=function(_0xe42b77,_0x56465b){return db['MailInteractionHasTag'][_0x0a9e('0x7')]()[_0x0a9e('0x8')](respondWithResult(_0x56465b,null))[_0x0a9e('0x9')](handleError(_0x56465b,null));}; \ No newline at end of file +var _0xa9e0=['catch','../../config/logger','api','../../mysqldb','json','error','name','status','describe','then'];(function(_0x15e42d,_0x35bd15){var _0x1e62a1=function(_0x9f71e3){while(--_0x9f71e3){_0x15e42d['push'](_0x15e42d['shift']());}};_0x1e62a1(++_0x35bd15);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'use strict';var logger=require(_0x0a9e('0x0'))(_0x0a9e('0x1'));var db=require(_0x0a9e('0x2'))['db'];function respondWithResult(_0x5dd881,_0x550fbc){_0x550fbc=_0x550fbc||0xc8;return function(_0x18d5c9){if(_0x18d5c9){return _0x5dd881['status'](_0x550fbc)[_0x0a9e('0x3')](_0x18d5c9);}};}function handleError(_0x432180,_0x2ab90b){_0x2ab90b=_0x2ab90b||0x1f4;return function(_0x991246){logger[_0x0a9e('0x4')](_0x991246['stack']);if(_0x991246[_0x0a9e('0x5')]){delete _0x991246[_0x0a9e('0x5')];}_0x432180[_0x0a9e('0x6')](_0x2ab90b)['send'](_0x991246);};}exports['describe']=function(_0xe42b77,_0x56465b){return db['MailInteractionHasTag'][_0x0a9e('0x7')]()[_0x0a9e('0x8')](respondWithResult(_0x56465b,null))[_0x0a9e('0x9')](handleError(_0x56465b,null));}; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/mailInteractionHasTag.js b/server/api/mailInteractionHasTag/mailInteractionHasTag.js index 35cb836..c689973 100644 --- a/server/api/mailInteractionHasTag/mailInteractionHasTag.js +++ b/server/api/mailInteractionHasTag/mailInteractionHasTag.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5188=['exports','sequelize'];(function(_0x51263f,_0x15d4b0){var _0x4d3f80=function(_0xf1e3e0){while(--_0xf1e3e0){_0x51263f['push'](_0x51263f['shift']());}};_0x4d3f80(++_0x15d4b0);}(_0x5188,0xb5));var _0x8518=function(_0x258119,_0x559962){_0x258119=_0x258119-0x0;var _0x24a58d=_0x5188[_0x258119];return _0x24a58d;};'use strict';var Sequelize=require(_0x8518('0x0'));module[_0x8518('0x1')]={'MailInteractionId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'TagId':{'type':Sequelize['INTEGER'],'defaultValue':null}}; \ No newline at end of file +var _0xe6dd=['sequelize','INTEGER'];(function(_0x53c2b7,_0x16563d){var _0x3d1806=function(_0x53b51d){while(--_0x53b51d){_0x53c2b7['push'](_0x53c2b7['shift']());}};_0x3d1806(++_0x16563d);}(_0xe6dd,0x11c));var _0xde6d=function(_0x2af462,_0xba428e){_0x2af462=_0x2af462-0x0;var _0x37cb1e=_0xe6dd[_0x2af462];return _0x37cb1e;};'use strict';var Sequelize=require(_0xde6d('0x0'));module['exports']={'MailInteractionId':{'type':Sequelize[_0xde6d('0x1')],'primaryKey':!![]},'TagId':{'type':Sequelize['INTEGER'],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/mailInteractionHasTag.model.js b/server/api/mailInteractionHasTag/mailInteractionHasTag.model.js index 0ca444b..86af3bc 100644 --- a/server/api/mailInteractionHasTag/mailInteractionHasTag.model.js +++ b/server/api/mailInteractionHasTag/mailInteractionHasTag.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7796=['exports','define','MailInteractionHasTag','mail_interaction_has_tags','./mailInteractionHasTag'];(function(_0x39618e,_0x489a95){var _0x3d41cf=function(_0x5d6d3f){while(--_0x5d6d3f){_0x39618e['push'](_0x39618e['shift']());}};_0x3d41cf(++_0x489a95);}(_0x7796,0xe5));var _0x6779=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7796[_0x3dd15e];return _0x231fd0;};'use strict';var attributes=require(_0x6779('0x0'));module[_0x6779('0x1')]=function(_0x44bbd5){return _0x44bbd5[_0x6779('0x2')](_0x6779('0x3'),attributes,{'tableName':_0x6779('0x4'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x04eb=['exports','MailInteractionHasTag','./mailInteractionHasTag'];(function(_0x29e0eb,_0x9acb52){var _0x597d2d=function(_0x596ef9){while(--_0x596ef9){_0x29e0eb['push'](_0x29e0eb['shift']());}};_0x597d2d(++_0x9acb52);}(_0x04eb,0x18b));var _0xb04e=function(_0xac3c81,_0x14317f){_0xac3c81=_0xac3c81-0x0;var _0x424433=_0x04eb[_0xac3c81];return _0x424433;};'use strict';var attributes=require(_0xb04e('0x0'));module[_0xb04e('0x1')]=function(_0x171ccb){return _0x171ccb['define'](_0xb04e('0x2'),attributes,{'tableName':'mail_interaction_has_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 3a1d40a..f5b3b38 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 _0xffe1=['exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','tracked','mail','mailmessage:create','create','update','put','/:id/accept','accept','reject','delete','destroy'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0xffe1,0x187));var _0x1ffe=function(_0x214543,_0x380fee){_0x214543=_0x214543-0x0;var _0x1f8231=_0xffe1[_0x214543];return _0x1f8231;};'use strict';var multer=require(_0x1ffe('0x0'));var util=require(_0x1ffe('0x1'));var path=require('path');var timeout=require(_0x1ffe('0x2'));var express=require('express');var router=express[_0x1ffe('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1ffe('0x4'));var interaction=require(_0x1ffe('0x5'));var config=require(_0x1ffe('0x6'));var controller=require(_0x1ffe('0x7'));router[_0x1ffe('0x8')]('/',auth[_0x1ffe('0x9')](),controller[_0x1ffe('0xa')]);router[_0x1ffe('0x8')](_0x1ffe('0xb'),auth['isAuthenticated'](),controller[_0x1ffe('0xc')]);router['get'](_0x1ffe('0xd'),auth['isAuthenticated'](),controller[_0x1ffe('0xe')]);router['get'](_0x1ffe('0xf'),auth[_0x1ffe('0x9')](),controller[_0x1ffe('0x10')]);router[_0x1ffe('0x11')]('/',auth[_0x1ffe('0x9')](),interaction[_0x1ffe('0x12')](_0x1ffe('0x13'),_0x1ffe('0x14')),controller[_0x1ffe('0x15')]);router['put']('/:id',auth[_0x1ffe('0x9')](),controller[_0x1ffe('0x16')]);router[_0x1ffe('0x17')](_0x1ffe('0x18'),auth[_0x1ffe('0x9')](),controller[_0x1ffe('0x19')]);router[_0x1ffe('0x17')]('/:id/reject',auth[_0x1ffe('0x9')](),controller[_0x1ffe('0x1a')]);router[_0x1ffe('0x1b')](_0x1ffe('0xd'),auth[_0x1ffe('0x9')](),controller[_0x1ffe('0x1c')]);module[_0x1ffe('0x1d')]=router; \ No newline at end of file +var _0x195e=['create','put','update','/:id/accept','accept','reject','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','/describe','describe','/:id/download','download','tracked','mail'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x195e,0xfb));var _0xe195=function(_0x71b795,_0x46affc){_0x71b795=_0x71b795-0x0;var _0xb409a3=_0x195e[_0x71b795];return _0xb409a3;};'use strict';var multer=require(_0xe195('0x0'));var util=require(_0xe195('0x1'));var path=require(_0xe195('0x2'));var timeout=require(_0xe195('0x3'));var express=require(_0xe195('0x4'));var router=express[_0xe195('0x5')]();var fs_extra=require(_0xe195('0x6'));var auth=require(_0xe195('0x7'));var interaction=require(_0xe195('0x8'));var config=require(_0xe195('0x9'));var controller=require(_0xe195('0xa'));router[_0xe195('0xb')]('/',auth[_0xe195('0xc')](),controller['index']);router[_0xe195('0xb')](_0xe195('0xd'),auth[_0xe195('0xc')](),controller[_0xe195('0xe')]);router[_0xe195('0xb')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xe195('0xb')](_0xe195('0xf'),auth[_0xe195('0xc')](),controller[_0xe195('0x10')]);router['post']('/',auth[_0xe195('0xc')](),interaction[_0xe195('0x11')](_0xe195('0x12'),'mailmessage:create'),controller[_0xe195('0x13')]);router[_0xe195('0x14')]('/:id',auth[_0xe195('0xc')](),controller[_0xe195('0x15')]);router[_0xe195('0x14')](_0xe195('0x16'),auth['isAuthenticated'](),controller[_0xe195('0x17')]);router[_0xe195('0x14')]('/:id/reject',auth['isAuthenticated'](),controller[_0xe195('0x18')]);router['delete'](_0xe195('0x19'),auth['isAuthenticated'](),controller['destroy']);module[_0xe195('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 5ce48d4..7801ea0 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 _0x8ebd=['out','STRING','long','DATE','INTEGER','Chat','Email','lodash','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x3c5765,_0x50b2d9){var _0x3fa5e8=function(_0x3f8ef6){while(--_0x3f8ef6){_0x3c5765['push'](_0x3c5765['shift']());}};_0x3fa5e8(++_0x50b2d9);}(_0x8ebd,0x96));var _0xd8eb=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x8ebd[_0x50a0c2];return _0x5ebadd;};'use strict';var Sequelize=require('sequelize');var _=require(_0xd8eb('0x0'));module[_0xd8eb('0x1')]={'body':{'type':Sequelize[_0xd8eb('0x2')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xd8eb('0x2')](_0xd8eb('0x3'))},'read':{'type':Sequelize[_0xd8eb('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd8eb('0x5')]('in',_0xd8eb('0x6')),'defaultValue':_0xd8eb('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xd8eb('0x7')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xd8eb('0x2')]('long')},'cc':{'type':Sequelize['TEXT'](_0xd8eb('0x8'))},'bcc':{'type':Sequelize[_0xd8eb('0x2')](_0xd8eb('0x8'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0xd8eb('0x9')]},'attach':{'type':Sequelize[_0xd8eb('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xd8eb('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xd8eb('0x9')]},'originTo':{'type':Sequelize[_0xd8eb('0x2')](_0xd8eb('0x8'))},'originCc':{'type':Sequelize['TEXT'](_0xd8eb('0x8'))},'originChannel':{'type':Sequelize['ENUM']('Email',_0xd8eb('0xb')),'defaultValue':_0xd8eb('0xc'),'allowNull':![]}}; \ No newline at end of file +var _0x4996=['BOOLEAN','ENUM','out','STRING','DATE','Email','Chat','sequelize','lodash','exports','TEXT','long','medium'];(function(_0x20dadd,_0x364e56){var _0x24a247=function(_0x5a48c2){while(--_0x5a48c2){_0x20dadd['push'](_0x20dadd['shift']());}};_0x24a247(++_0x364e56);}(_0x4996,0x173));var _0x6499=function(_0xacabb,_0x1fbcd9){_0xacabb=_0xacabb-0x0;var _0x2b4a14=_0x4996[_0xacabb];return _0x2b4a14;};'use strict';var Sequelize=require(_0x6499('0x0'));var _=require(_0x6499('0x1'));module[_0x6499('0x2')]={'body':{'type':Sequelize[_0x6499('0x3')](_0x6499('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x6499('0x3')](_0x6499('0x5'))},'read':{'type':Sequelize[_0x6499('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6499('0x7')]('in','out'),'defaultValue':_0x6499('0x8'),'allowNull':![]},'messageId':{'type':Sequelize[_0x6499('0x9')](0x1fe)},'from':{'type':Sequelize[_0x6499('0x9')]},'to':{'type':Sequelize[_0x6499('0x3')]('long')},'cc':{'type':Sequelize['TEXT']('long')},'bcc':{'type':Sequelize['TEXT'](_0x6499('0x4'))},'subject':{'type':Sequelize[_0x6499('0x3')]},'sentAt':{'type':Sequelize[_0x6499('0xa')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0x6499('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x6499('0xa')]},'originTo':{'type':Sequelize['TEXT']('long')},'originCc':{'type':Sequelize[_0x6499('0x3')](_0x6499('0x4'))},'originChannel':{'type':Sequelize[_0x6499('0x7')](_0x6499('0xb'),_0x6499('0xc')),'defaultValue':_0x6499('0xb'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index af404e8..dd553d1 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 _0x4924=['interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','manual','interface','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','RejectMessage','rejectMessage','SIP/%s','rejectmessage','unix','toString','join','server','files','tmp','from','bcc','subject','createdAt','Attachment','decode','headers','Bcc','Attachments','push','build','download','moment','bluebird','util','path','lodash','ioredis','html-to-text','../../config/logger','api','../../mysqldb','defaults','redis','localhost','html-entities','register','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','status','json','offset','undefined','limit','count','set','update','destroy','stack','name','send','map','MailMessage','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','show','include','find','body','params','describe','create','direction','out','secret','MailAccount','findOne','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','CloudProvider','attachments','root','basename','List\x20not\x20found','SendMail','sendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','accept','mail','readAt','format','UserId','user','get','MailInteraction','MailInteractionId','isNil','read1stAt'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x4924,0xc9));var _0x4492=function(_0x36fbef,_0x4ffc84){_0x36fbef=_0x36fbef-0x0;var _0x45e270=_0x4924[_0x36fbef];return _0x45e270;};'use strict';var emlformat=require('eml-format');var moment=require(_0x4492('0x0'));var BPromise=require(_0x4492('0x1'));var util=require(_0x4492('0x2'));var path=require(_0x4492('0x3'));var fs=require('fs');var _=require(_0x4492('0x4'));var Redis=require(_0x4492('0x5'));var htmlToText=require(_0x4492('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0x4492('0x7'))(_0x4492('0x8'));var interaction_log=require(_0x4492('0x7'))('mail-interactions');var config=require('../../config/environment');var db=require(_0x4492('0x9'))['db'];config['redis']=_[_0x4492('0xa')](config[_0x4492('0xb')],{'host':_0x4492('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4492('0xb')]));var htmlEntities=require(_0x4492('0xd'));require('./mailMessage.socket')[_0x4492('0xe')](socket);var jayson=require('jayson/promise');var client=jayson[_0x4492('0xf')][_0x4492('0x10')]({'port':0x232c});var client9003=jayson[_0x4492('0xf')][_0x4492('0x10')]({'port':0x232b});var client9002=jayson[_0x4492('0xf')][_0x4492('0x10')]({'port':0x232a});function respondWithRpcPromise(_0x46fad0,_0x753712,_0x2b726c,_0x157d24){return new BPromise(function(_0x1a2c7f,_0x211f1d){var _0x412a84=_0x157d24||client;return _0x412a84[_0x4492('0x11')](_0x46fad0,_0x2b726c)[_0x4492('0x12')](function(_0x499e57){logger[_0x4492('0x13')](_0x4492('0x14'),_0x753712,_0x4492('0x15'));logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0x753712,_0x4492('0x15'),JSON[_0x4492('0x16')](_0x499e57));if(_0x499e57[_0x4492('0x17')]){if(_0x499e57[_0x4492('0x17')]['code']===0x1f4){logger[_0x4492('0x17')](_0x4492('0x14'),_0x753712,_0x499e57[_0x4492('0x17')][_0x4492('0x18')]);return _0x211f1d(_0x499e57[_0x4492('0x17')][_0x4492('0x18')]);}logger[_0x4492('0x17')](_0x4492('0x14'),_0x753712,_0x499e57[_0x4492('0x17')]['message']);return _0x1a2c7f(_0x499e57[_0x4492('0x17')][_0x4492('0x18')]);}else{logger[_0x4492('0x13')](_0x4492('0x14'),_0x753712,'request\x20sent');_0x1a2c7f(_0x499e57[_0x4492('0x19')][_0x4492('0x18')]);}})[_0x4492('0x1a')](function(_0x4118e0){logger['error'](_0x4492('0x14'),_0x753712,_0x4118e0);_0x211f1d(_0x4118e0);});});}function respondWithResult(_0x302e78,_0x128ea3){_0x128ea3=_0x128ea3||0xc8;return function(_0x4ce7db){if(_0x4ce7db){return _0x302e78[_0x4492('0x1b')](_0x128ea3)[_0x4492('0x1c')](_0x4ce7db);}};}function respondWithFilteredResult(_0x5d778d,_0x204816){return function(_0xbd14e2){if(_0xbd14e2){var _0x4160dc=typeof _0x204816[_0x4492('0x1d')]===_0x4492('0x1e')&&typeof _0x204816[_0x4492('0x1f')]==='undefined';var _0x3b6dd5=_0xbd14e2[_0x4492('0x20')];var _0x447b04=_0x4160dc?0x0:_0x204816[_0x4492('0x1d')];var _0x3c501c=_0x4160dc?_0xbd14e2[_0x4492('0x20')]:_0x204816['offset']+_0x204816['limit'];var _0x57b665;if(_0x3c501c>=_0x3b6dd5){_0x3c501c=_0x3b6dd5;_0x57b665=0xc8;}else{_0x57b665=0xce;}_0x5d778d[_0x4492('0x1b')](_0x57b665);return _0x5d778d[_0x4492('0x21')]('Content-Range',_0x447b04+'-'+_0x3c501c+'/'+_0x3b6dd5)['json'](_0xbd14e2);}return null;};}function saveUpdates(_0x22a0e1){return function(_0xdba2af){if(_0xdba2af){return _0xdba2af[_0x4492('0x22')](_0x22a0e1)[_0x4492('0x12')](function(_0x308da2){return _0x308da2;});}return null;};}function removeEntity(_0x15a70a){return function(_0x5ccb34){if(_0x5ccb34){return _0x5ccb34[_0x4492('0x23')]()[_0x4492('0x12')](function(){_0x15a70a[_0x4492('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ae5fd){return function(_0x263b35){if(!_0x263b35){_0x5ae5fd['sendStatus'](0x194);}return _0x263b35;};}function handleError(_0x5244ba,_0xeb2395){_0xeb2395=_0xeb2395||0x1f4;return function(_0x14945d){logger[_0x4492('0x17')](_0x14945d[_0x4492('0x24')]);if(_0x14945d[_0x4492('0x25')]){delete _0x14945d[_0x4492('0x25')];}_0x5244ba[_0x4492('0x1b')](_0xeb2395)[_0x4492('0x26')](_0x14945d);};}exports['index']=function(_0x277501,_0x407f20){var _0x444fa2={},_0x5a216a={},_0x3e649b={'count':0x0,'rows':[]};var _0x3886c0=_[_0x4492('0x27')](db[_0x4492('0x28')][_0x4492('0x29')],function(_0x10186e){return{'name':_0x10186e[_0x4492('0x2a')],'type':_0x10186e[_0x4492('0x2b')][_0x4492('0x2c')]};});_0x5a216a[_0x4492('0x2d')]=_[_0x4492('0x27')](_0x3886c0,_0x4492('0x25'));_0x5a216a[_0x4492('0x2e')]=_[_0x4492('0x2f')](_0x277501[_0x4492('0x2e')]);_0x5a216a['filters']=_[_0x4492('0x30')](_0x5a216a['model'],_0x5a216a[_0x4492('0x2e')]);_0x444fa2[_0x4492('0x31')]=_['intersection'](_0x5a216a[_0x4492('0x2d')],qs[_0x4492('0x32')](_0x277501[_0x4492('0x2e')][_0x4492('0x32')]));_0x444fa2[_0x4492('0x31')]=_0x444fa2[_0x4492('0x31')][_0x4492('0x33')]?_0x444fa2[_0x4492('0x31')]:_0x5a216a[_0x4492('0x2d')];if(!_0x277501['query'][_0x4492('0x34')](_0x4492('0x35'))){_0x444fa2[_0x4492('0x1f')]=qs['limit'](_0x277501[_0x4492('0x2e')][_0x4492('0x1f')]);_0x444fa2[_0x4492('0x1d')]=qs[_0x4492('0x1d')](_0x277501[_0x4492('0x2e')][_0x4492('0x1d')]);}_0x444fa2[_0x4492('0x36')]=qs[_0x4492('0x37')](_0x277501[_0x4492('0x2e')][_0x4492('0x37')]);_0x444fa2[_0x4492('0x38')]=qs[_0x4492('0x39')](_[_0x4492('0x3a')](_0x277501[_0x4492('0x2e')],_0x5a216a[_0x4492('0x39')]),_0x3886c0);if(_0x277501[_0x4492('0x2e')][_0x4492('0x3b')]){_0x444fa2[_0x4492('0x38')]=_[_0x4492('0x3c')](_0x444fa2['where'],{'$or':_[_0x4492('0x27')](_0x3886c0,function(_0x21c467){if(_0x21c467[_0x4492('0x2b')]!==_0x4492('0x3d')){var _0x27d1f9={};_0x27d1f9[_0x21c467[_0x4492('0x25')]]={'$like':'%'+_0x277501[_0x4492('0x2e')][_0x4492('0x3b')]+'%'};return _0x27d1f9;}})});}_0x444fa2=_['merge']({},_0x444fa2,_0x277501['options']);var _0x469fce={'where':_0x444fa2[_0x4492('0x38')]};return db[_0x4492('0x28')][_0x4492('0x20')](_0x469fce)['then'](function(_0x1d28f4){_0x3e649b[_0x4492('0x20')]=_0x1d28f4;if(_0x277501[_0x4492('0x2e')][_0x4492('0x3e')]){_0x444fa2['include']=[{'all':!![]}];}return db[_0x4492('0x28')][_0x4492('0x3f')](_0x444fa2);})[_0x4492('0x12')](function(_0x52f5e1){_0x3e649b[_0x4492('0x40')]=_0x52f5e1;return _0x3e649b;})['then'](respondWithFilteredResult(_0x407f20,_0x444fa2))[_0x4492('0x1a')](handleError(_0x407f20,null));};exports[_0x4492('0x41')]=function(_0x137843,_0x5313c0){var _0x4ba820={'raw':!![],'where':{'id':_0x137843['params']['id']}},_0x1b0e1e={};_0x1b0e1e[_0x4492('0x2d')]=_['keys'](db[_0x4492('0x28')]['rawAttributes']);_0x1b0e1e[_0x4492('0x2e')]=_[_0x4492('0x2f')](_0x137843[_0x4492('0x2e')]);_0x1b0e1e[_0x4492('0x39')]=_['intersection'](_0x1b0e1e[_0x4492('0x2d')],_0x1b0e1e[_0x4492('0x2e')]);_0x4ba820[_0x4492('0x31')]=_[_0x4492('0x30')](_0x1b0e1e['model'],qs['fields'](_0x137843[_0x4492('0x2e')][_0x4492('0x32')]));_0x4ba820[_0x4492('0x31')]=_0x4ba820[_0x4492('0x31')][_0x4492('0x33')]?_0x4ba820[_0x4492('0x31')]:_0x1b0e1e[_0x4492('0x2d')];if(_0x137843[_0x4492('0x2e')][_0x4492('0x3e')]){_0x4ba820[_0x4492('0x42')]=[{'all':!![]}];}_0x4ba820=_[_0x4492('0x3c')]({},_0x4ba820,_0x137843['options']);return db[_0x4492('0x28')][_0x4492('0x43')](_0x4ba820)[_0x4492('0x12')](handleEntityNotFound(_0x5313c0,null))[_0x4492('0x12')](respondWithResult(_0x5313c0,null))[_0x4492('0x1a')](handleError(_0x5313c0,null));};exports[_0x4492('0x22')]=function(_0x111215,_0x5a3d4b){if(_0x111215['body']['id']){delete _0x111215[_0x4492('0x44')]['id'];}return db[_0x4492('0x28')][_0x4492('0x43')]({'where':{'id':_0x111215['params']['id']}})[_0x4492('0x12')](handleEntityNotFound(_0x5a3d4b,null))[_0x4492('0x12')](saveUpdates(_0x111215[_0x4492('0x44')],null))['then'](respondWithResult(_0x5a3d4b,null))[_0x4492('0x1a')](handleError(_0x5a3d4b,null));};exports['destroy']=function(_0x335da7,_0x18e32f){return db['MailMessage'][_0x4492('0x43')]({'where':{'id':_0x335da7[_0x4492('0x45')]['id']}})[_0x4492('0x12')](handleEntityNotFound(_0x18e32f,null))[_0x4492('0x12')](removeEntity(_0x18e32f,null))['catch'](handleError(_0x18e32f,null));};exports[_0x4492('0x46')]=function(_0x486ca6,_0x36f8df){return db[_0x4492('0x28')][_0x4492('0x46')]()[_0x4492('0x12')](respondWithResult(_0x36f8df,null))[_0x4492('0x1a')](handleError(_0x36f8df,null));};exports[_0x4492('0x47')]=function(_0x202640,_0x49b257){return db['MailMessage']['create'](_0x202640[_0x4492('0x44')])[_0x4492('0x12')](function(_0x53ee36){if(_0x53ee36){if(_0x53ee36[_0x4492('0x48')]===_0x4492('0x49')&&!_0x53ee36[_0x4492('0x4a')]){var _0x6f07e4,_0x417533,_0x3cb804;if(_0x202640[_0x4492('0x44')]['to']){_0x417533=_0x202640[_0x4492('0x44')]['to']['split'](',')[0x0];}return db[_0x4492('0x4b')][_0x4492('0x4c')]({'where':{'id':_0x53ee36[_0x4492('0x4d')]},'include':[{'model':db[_0x4492('0x4e')],'as':_0x4492('0x4f'),'include':[{'model':db[_0x4492('0x50')],'as':_0x4492('0x51'),'where':{'email':_0x417533},'limit':0x1,'order':[[_0x4492('0x52'),_0x4492('0x53')]]}]},{'model':db[_0x4492('0x54')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x4492('0x55')],'as':'CloudProvider','raw':!![]}]}]})[_0x4492('0x12')](function(_0xb50ab0){_0x6f07e4=_0xb50ab0;if(!_0x6f07e4||!_0x6f07e4['Smtp'])return;var _0x4b89d1=_0x6f07e4['getSmtpOptions']();if(_0x202640[_0x4492('0x44')][_0x4492('0x56')]&&_0x202640[_0x4492('0x44')][_0x4492('0x56')][_0x4492('0x33')]){for(var _0x474ec0=0x0;_0x474ec0<_0x202640[_0x4492('0x44')][_0x4492('0x56')]['length'];_0x474ec0+=0x1){_0x202640[_0x4492('0x44')][_0x4492('0x56')][_0x474ec0]={'filename':_0x202640['body']['attachments'][_0x474ec0][_0x4492('0x25')],'path':path['join'](config[_0x4492('0x57')],'server/files/attachments',_0x202640[_0x4492('0x44')][_0x4492('0x56')][_0x474ec0][_0x4492('0x58')])};}}_0x3cb804={'account':_0x4b89d1,'message':_0x202640[_0x4492('0x44')]};return;})['then'](function(){if(_0x6f07e4[_0x4492('0x4f')]){if(_0x6f07e4[_0x4492('0x4f')]['Contacts'][_0x4492('0x33')]){return _0x6f07e4[_0x4492('0x4f')]['Contacts'][0x0];}else{return db[_0x4492('0x50')][_0x4492('0x47')](_[_0x4492('0xa')](_0x202640['body'],{'firstName':_0x202640['body']['to'],'email':_0x202640[_0x4492('0x44')]['to'],'phone':_0x202640[_0x4492('0x44')]['to'],'ListId':_0x6f07e4['ListId']}));}}else{throw new Error(_0x4492('0x59'));}})[_0x4492('0x12')](function(){if(_0x3cb804){return respondWithRpcPromise(_0x4492('0x5a'),_0x4492('0x5b'),_0x3cb804,client9003)['then'](function(_0x17f6f9){return _0x53ee36[_0x4492('0x22')]({'read':!![],'messageId':_0x17f6f9[_0x4492('0x5c')],'sentAt':moment()['format'](_0x4492('0x5d'))});})[_0x4492('0x1a')](function(_0x5a6d64){logger['error']('%s',JSON[_0x4492('0x16')](_0x5a6d64));return _0x53ee36;});}return _0x53ee36;});}return _0x53ee36;}})[_0x4492('0x12')](respondWithResult(_0x49b257,0xc9))[_0x4492('0x1a')](handleError(_0x49b257,null));};exports[_0x4492('0x5e')]=function(_0x26a1db,_0x2d90a5){var _0x5bb3da={'agent':{},'channel':_0x4492('0x5f')};if(_0x26a1db[_0x4492('0x44')]['id']){delete _0x26a1db[_0x4492('0x44')]['id'];}_0x26a1db['body']['read']=!![];_0x26a1db[_0x4492('0x44')][_0x4492('0x60')]=moment()[_0x4492('0x61')](_0x4492('0x5d'));_0x26a1db['body'][_0x4492('0x62')]=_0x26a1db['body'][_0x4492('0x62')]||_0x26a1db[_0x4492('0x63')]['id'];_0x5bb3da['agent']['id']=_0x26a1db[_0x4492('0x44')][_0x4492('0x62')];return db['MailMessage'][_0x4492('0x43')]({'where':{'id':_0x26a1db[_0x4492('0x45')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2d90a5,null))[_0x4492('0x12')](saveUpdates(_0x26a1db[_0x4492('0x44')],null))[_0x4492('0x12')](function(_0x4059dd){if(_0x4059dd){_0x5bb3da[_0x4492('0x18')]=_0x4059dd[_0x4492('0x64')]({'plain':!![]});return db[_0x4492('0x65')][_0x4492('0x43')]({'where':{'id':_0x4059dd[_0x4492('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x2d90a5,null))[_0x4492('0x12')](function(_0x133ba6){if(_0x133ba6){return _0x133ba6['update']({'UserId':_0x26a1db[_0x4492('0x44')][_0x4492('0x62')],'read1stAt':_[_0x4492('0x67')](_0x133ba6[_0x4492('0x68')])?moment()[_0x4492('0x61')](_0x4492('0x5d')):undefined});}return null;})[_0x4492('0x12')](function(_0x9a17b6){if(_0x9a17b6){_0x5bb3da[_0x4492('0x69')]=_0x9a17b6['get']({'plain':!![]});interaction_log[_0x4492('0x13')](_0x4492('0x6a'),_0x26a1db[_0x4492('0x63')]['id'],_0x26a1db[_0x4492('0x63')]['name'],_0x26a1db[_0x4492('0x63')][_0x4492('0x6b')],_0x5bb3da[_0x4492('0x69')]['id'],_0x26a1db['body']?JSON[_0x4492('0x16')](_0x26a1db[_0x4492('0x44')]):'null');return respondWithRpcPromise(_0x4492('0x6c'),_0x4492('0x6d'),_0x5bb3da);}return null;})[_0x4492('0x12')](function(_0x562432){var _0x3bd84f=_0x4492('0x6e')+_0x562432[_0x4492('0x18')][_0x4492('0x6f')];return db[_0x4492('0x70')][_0x4492('0x2e')](_0x3bd84f,{'type':db[_0x4492('0x71')][_0x4492('0x72')][_0x4492('0x73')],'raw':!![]})[_0x4492('0x12')](function(_0x315a3e){return _0x315a3e;});})['then'](function(_0x5035d2){if(_0x5035d2){_0x5bb3da[_0x4492('0x18')][_0x4492('0x74')]=_0x5035d2[0x0];if(!_0x26a1db[_0x4492('0x44')]['UserId'])return;return db[_0x4492('0x75')][_0x4492('0x43')]({'where':{'id':_0x26a1db[_0x4492('0x44')][_0x4492('0x62')],'role':_0x4492('0x76')},'attributes':['id',_0x4492('0x25'),_0x4492('0x77'),_0x4492('0x78'),_0x4492('0x79')],'raw':!![]});}return null;})[_0x4492('0x12')](function(_0xd41a38){if(!_0xd41a38)return null;_0x5bb3da['message'][_0x4492('0x76')]=_0xd41a38;return _0x5bb3da;})['then'](function(_0x3b1087){if(_0x3b1087){if(_0x26a1db[_0x4492('0x44')][_0x4492('0x7a')]){_0x5bb3da['message'][_0x4492('0x7b')]=util[_0x4492('0x61')]('SIP/%s',_0x26a1db[_0x4492('0x63')]['name']);_0x5bb3da['message'][_0x4492('0x7c')]=_0x5bb3da[_0x4492('0x7c')];_0x5bb3da[_0x4492('0x18')][_0x4492('0x7d')]=_0x5bb3da['channel'];_0x5bb3da[_0x4492('0x18')][_0x4492('0x7e')]=_0x4492('0x5e');_0x5bb3da['message'][_0x4492('0x44')]=htmlToText[_0x4492('0x7f')](_0x5bb3da['message']['body']);return respondWithRpcPromise(_0x4492('0x80'),_0x4492('0x80'),{'event':_0x4492('0x81'),'message':_0x5bb3da[_0x4492('0x18')]},client9002)[_0x4492('0x12')](function(){return _0x5bb3da;});}return _0x5bb3da;}return null;})['then'](respondWithResult(_0x2d90a5,null))[_0x4492('0x1a')](handleError(_0x2d90a5,null));};exports[_0x4492('0x82')]=function(_0x46c884,_0xc4fe7d){var _0x3000d4={'agent':{},'channel':_0x4492('0x5f')};if(_0x46c884['body']['id']){delete _0x46c884['body']['id'];}_0x46c884[_0x4492('0x44')]['UserId']=_0x46c884[_0x4492('0x44')][_0x4492('0x62')]||_0x46c884[_0x4492('0x63')]['id'];_0x3000d4[_0x4492('0x76')]['id']=_0x46c884['body'][_0x4492('0x62')];return db[_0x4492('0x28')][_0x4492('0x43')]({'where':{'id':_0x46c884[_0x4492('0x45')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xc4fe7d,null))[_0x4492('0x12')](function(_0x3f4efa){if(_0x3f4efa){_0x3000d4[_0x4492('0x18')]=_0x3f4efa['get']({'plain':!![]});return db[_0x4492('0x65')]['find']({'where':{'id':_0x3f4efa['MailInteractionId']}});}return null;})['then'](handleEntityNotFound(_0xc4fe7d,null))['then'](function(_0x55aeb0){if(_0x55aeb0){_0x3000d4[_0x4492('0x69')]=_0x55aeb0[_0x4492('0x64')]({'plain':!![]});interaction_log[_0x4492('0x13')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x46c884[_0x4492('0x63')]['id'],_0x46c884['user'][_0x4492('0x25')],_0x46c884['user'][_0x4492('0x6b')],_0x3000d4[_0x4492('0x69')]['id'],_0x46c884[_0x4492('0x44')]?JSON['stringify'](_0x46c884[_0x4492('0x44')]):'null');return respondWithRpcPromise(_0x4492('0x83'),_0x4492('0x84'),_0x3000d4);}return null;})['then'](function(_0x11a594){var _0x3013d2=_0x4492('0x6e')+_0x11a594['message'][_0x4492('0x6f')];return db['sequelize'][_0x4492('0x2e')](_0x3013d2,{'type':db[_0x4492('0x71')][_0x4492('0x72')][_0x4492('0x73')],'raw':!![]})[_0x4492('0x12')](function(_0x2749af){return _0x2749af;});})[_0x4492('0x12')](function(_0x633755){if(_0x633755){_0x3000d4[_0x4492('0x18')][_0x4492('0x74')]=_0x633755[0x0];if(!_0x46c884[_0x4492('0x44')][_0x4492('0x62')])return;return db['User'][_0x4492('0x43')]({'where':{'id':_0x46c884[_0x4492('0x44')][_0x4492('0x62')],'role':_0x4492('0x76')},'attributes':['id',_0x4492('0x25'),'fullname','email',_0x4492('0x79')],'raw':!![]});}return null;})['then'](function(_0x4445bd){if(!_0x4445bd)return null;_0x3000d4[_0x4492('0x18')][_0x4492('0x76')]=_0x4445bd;return _0x3000d4;})[_0x4492('0x12')](function(_0x136eab){if(_0x136eab){_0x136eab[_0x4492('0x18')][_0x4492('0x7b')]=util[_0x4492('0x61')](_0x4492('0x85'),_0x46c884[_0x4492('0x63')][_0x4492('0x25')]);_0x136eab[_0x4492('0x18')][_0x4492('0x7c')]=_0x3000d4['channel'];_0x136eab[_0x4492('0x18')][_0x4492('0x7d')]=_0x3000d4[_0x4492('0x7c')];_0x136eab['message'][_0x4492('0x7e')]='reject';_0x136eab[_0x4492('0x18')][_0x4492('0x44')]=htmlToText[_0x4492('0x7f')](_0x3000d4[_0x4492('0x18')][_0x4492('0x44')]);respondWithRpcPromise('EventManager',_0x4492('0x80'),{'event':_0x4492('0x86'),'message':_0x136eab[_0x4492('0x18')]},client9002);return _0x3000d4;}return null;})[_0x4492('0x12')](respondWithResult(_0xc4fe7d,null))['catch'](handleError(_0xc4fe7d,null));};exports['download']=function(_0xf265fa,_0x31406c){var _0x2a3dfb=moment()[_0x4492('0x87')]()[_0x4492('0x88')]();var _0x5c31b9=path[_0x4492('0x89')](config[_0x4492('0x57')],_0x4492('0x8a'),_0x4492('0x8b'),_0x4492('0x8c'));var _0x5c4d8e=path['join'](config['root'],'server','files',_0x4492('0x56'));var _0x579a8b=util[_0x4492('0x61')]('message-%s.eml',_0x2a3dfb);return db[_0x4492('0x28')]['find']({'where':{'id':_0xf265fa['params']['id']},'attributes':['id',_0x4492('0x44'),_0x4492('0x8d'),'to','cc',_0x4492('0x8e'),_0x4492('0x8f'),_0x4492('0x90')],'include':_0xf265fa[_0x4492('0x2e')][_0x4492('0x56')]?[{'model':db[_0x4492('0x91')],'as':'Attachments'}]:undefined})[_0x4492('0x12')](handleEntityNotFound(_0x31406c,null))['then'](function(_0x4da71e){if(_0x4da71e){var _0x1d5210=_0x4da71e;var _0x58b79a={'from':_0x1d5210[_0x4492('0x8d')],'to':_0x1d5210['to'],'subject':_0x1d5210[_0x4492('0x8f')],'html':htmlEntities[_0x4492('0x92')](_0x1d5210[_0x4492('0x44')]),'headers':{'Date':moment(_0x1d5210[_0x4492('0x90')])[_0x4492('0x61')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x4da71e['cc']){_0x58b79a[_0x4492('0x93')]['Cc']=_0x4da71e['cc'];}if(_0x4da71e[_0x4492('0x8e')]){_0x58b79a[_0x4492('0x93')][_0x4492('0x94')]=_0x4da71e[_0x4492('0x8e')];}return new BPromise(function(_0x4d2c85,_0x2fce08){if(_0x4da71e[_0x4492('0x95')]){for(var _0x8111fc=0x0;_0x8111fc<_0x4da71e[_0x4492('0x95')]['length'];_0x8111fc++){var _0x181b84=_0x4da71e[_0x4492('0x95')][_0x8111fc];var _0x1dc32c=path['join'](_0x5c4d8e,_0x181b84[_0x4492('0x58')]);if(fs['existsSync'](_0x1dc32c)){_0x58b79a[_0x4492('0x56')][_0x4492('0x96')]({'name':_0x181b84[_0x4492('0x25')],'contentType':_0x181b84[_0x4492('0x2b')],'data':fs['readFileSync'](_0x1dc32c)});}}}emlformat[_0x4492('0x97')](_0x58b79a,function(_0x125046,_0x8df1b0){if(_0x125046)return _0x2fce08(_0x125046);fs['writeFileSync'](path[_0x4492('0x89')](_0x5c31b9,_0x579a8b),_0x8df1b0);return _0x4d2c85(_0x8df1b0);});});}})[_0x4492('0x12')](function(_0x447b42){if(_0x447b42){return _0x31406c[_0x4492('0x98')](path[_0x4492('0x89')](_0x5c31b9,_0x579a8b),_0x579a8b,function(_0x194873){if(!_0x194873)fs['unlinkSync'](path[_0x4492('0x89')](_0x5c31b9,_0x579a8b));});}})[_0x4492('0x1a')](handleError(_0x31406c,null));}; \ No newline at end of file +var _0x6e0d=['getSmtpOptions','attachments','join','root','server/files/attachments','basename','List','Contacts','ListId','List\x20not\x20found','sendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','format','UserId','user','get','MailInteraction','MailInteractionId','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','SELECT','contact','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','event','fromString','EventManager','acceptmessage','reject','rejectMessage','ContactId','Sequelize','QueryTypes','motionChannel','rejectmessage','download','files','tmp','server','message-%s.eml','subject','Attachment','Attachments','from','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','push','readFileSync','build','writeFileSync','unlinkSync','eml-format','moment','bluebird','util','path','lodash','ioredis','html-to-text','api','../../config/logger','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','html-entities','./mailMessage.socket','jayson/promise','http','client','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','undefined','limit','count','offset','Content-Range','json','update','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','where','filter','merge','options','MailMessage','include','findAll','rows','catch','keys','length','body','find','params','describe','create','direction','out','secret','split','findOne','MailAccountId','CmList','CmContact','updatedAt','DESC','CloudProvider','Smtp'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x6e0d,0x188));var _0xd6e0=function(_0x3fea3b,_0x3bcebe){_0x3fea3b=_0x3fea3b-0x0;var _0x18b180=_0x6e0d[_0x3fea3b];return _0x18b180;};'use strict';var emlformat=require(_0xd6e0('0x0'));var moment=require(_0xd6e0('0x1'));var BPromise=require(_0xd6e0('0x2'));var util=require(_0xd6e0('0x3'));var path=require(_0xd6e0('0x4'));var fs=require('fs');var _=require(_0xd6e0('0x5'));var Redis=require(_0xd6e0('0x6'));var htmlToText=require(_0xd6e0('0x7'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xd6e0('0x8'));var interaction_log=require(_0xd6e0('0x9'))('mail-interactions');var config=require(_0xd6e0('0xa'));var db=require(_0xd6e0('0xb'))['db'];config['redis']=_[_0xd6e0('0xc')](config[_0xd6e0('0xd')],{'host':_0xd6e0('0xe'),'port':0x18eb});var socket=require(_0xd6e0('0xf'))(new Redis(config[_0xd6e0('0xd')]));var htmlEntities=require(_0xd6e0('0x10'));require(_0xd6e0('0x11'))['register'](socket);var jayson=require(_0xd6e0('0x12'));var client=jayson['client'][_0xd6e0('0x13')]({'port':0x232c});var client9003=jayson[_0xd6e0('0x14')][_0xd6e0('0x13')]({'port':0x232b});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1f7712,_0x226ec2,_0x5f17b,_0x1c3b8a){return new BPromise(function(_0x392d6d,_0x3bc69e){var _0x26d24d=_0x1c3b8a||client;return _0x26d24d[_0xd6e0('0x15')](_0x1f7712,_0x5f17b)[_0xd6e0('0x16')](function(_0x3df0b2){logger[_0xd6e0('0x17')](_0xd6e0('0x18'),_0x226ec2,_0xd6e0('0x19'));logger[_0xd6e0('0x1a')](_0xd6e0('0x1b'),_0x226ec2,_0xd6e0('0x19'),JSON[_0xd6e0('0x1c')](_0x3df0b2));if(_0x3df0b2[_0xd6e0('0x1d')]){if(_0x3df0b2[_0xd6e0('0x1d')][_0xd6e0('0x1e')]===0x1f4){logger[_0xd6e0('0x1d')]('MailMessage,\x20%s,\x20%s',_0x226ec2,_0x3df0b2[_0xd6e0('0x1d')][_0xd6e0('0x1f')]);return _0x3bc69e(_0x3df0b2[_0xd6e0('0x1d')][_0xd6e0('0x1f')]);}logger[_0xd6e0('0x1d')]('MailMessage,\x20%s,\x20%s',_0x226ec2,_0x3df0b2['error'][_0xd6e0('0x1f')]);return _0x392d6d(_0x3df0b2[_0xd6e0('0x1d')][_0xd6e0('0x1f')]);}else{logger[_0xd6e0('0x17')](_0xd6e0('0x18'),_0x226ec2,_0xd6e0('0x19'));_0x392d6d(_0x3df0b2[_0xd6e0('0x20')][_0xd6e0('0x1f')]);}})['catch'](function(_0x4a2c3d){logger[_0xd6e0('0x1d')](_0xd6e0('0x18'),_0x226ec2,_0x4a2c3d);_0x3bc69e(_0x4a2c3d);});});}function respondWithResult(_0x1229f2,_0x39df99){_0x39df99=_0x39df99||0xc8;return function(_0x243361){if(_0x243361){return _0x1229f2[_0xd6e0('0x21')](_0x39df99)['json'](_0x243361);}};}function respondWithFilteredResult(_0x5c3134,_0x4c3dfd){return function(_0x47f2c2){if(_0x47f2c2){var _0x35f4de=typeof _0x4c3dfd['offset']===_0xd6e0('0x22')&&typeof _0x4c3dfd[_0xd6e0('0x23')]===_0xd6e0('0x22');var _0x2c05d5=_0x47f2c2[_0xd6e0('0x24')];var _0xf97552=_0x35f4de?0x0:_0x4c3dfd[_0xd6e0('0x25')];var _0x14fd73=_0x35f4de?_0x47f2c2[_0xd6e0('0x24')]:_0x4c3dfd[_0xd6e0('0x25')]+_0x4c3dfd[_0xd6e0('0x23')];var _0x29b2c4;if(_0x14fd73>=_0x2c05d5){_0x14fd73=_0x2c05d5;_0x29b2c4=0xc8;}else{_0x29b2c4=0xce;}_0x5c3134[_0xd6e0('0x21')](_0x29b2c4);return _0x5c3134['set'](_0xd6e0('0x26'),_0xf97552+'-'+_0x14fd73+'/'+_0x2c05d5)[_0xd6e0('0x27')](_0x47f2c2);}return null;};}function saveUpdates(_0x203286){return function(_0x5c413f){if(_0x5c413f){return _0x5c413f[_0xd6e0('0x28')](_0x203286)[_0xd6e0('0x16')](function(_0x4a610a){return _0x4a610a;});}return null;};}function removeEntity(_0xd6cc7b){return function(_0x250590){if(_0x250590){return _0x250590[_0xd6e0('0x29')]()[_0xd6e0('0x16')](function(){_0xd6cc7b[_0xd6e0('0x21')](0xcc)[_0xd6e0('0x2a')]();});}};}function handleEntityNotFound(_0x1e49a3){return function(_0x3d3757){if(!_0x3d3757){_0x1e49a3[_0xd6e0('0x2b')](0x194);}return _0x3d3757;};}function handleError(_0x3a89f5,_0x353ee6){_0x353ee6=_0x353ee6||0x1f4;return function(_0x442c03){logger[_0xd6e0('0x1d')](_0x442c03[_0xd6e0('0x2c')]);if(_0x442c03[_0xd6e0('0x2d')]){delete _0x442c03[_0xd6e0('0x2d')];}_0x3a89f5[_0xd6e0('0x21')](_0x353ee6)[_0xd6e0('0x2e')](_0x442c03);};}exports[_0xd6e0('0x2f')]=function(_0x11fad2,_0x3b09f2){var _0x59c443={},_0xd4f0a5={},_0x17cc2a={'count':0x0,'rows':[]};var _0x5f5a33=_[_0xd6e0('0x30')](db['MailMessage'][_0xd6e0('0x31')],function(_0x5359b4){return{'name':_0x5359b4[_0xd6e0('0x32')],'type':_0x5359b4[_0xd6e0('0x33')][_0xd6e0('0x34')]};});_0xd4f0a5[_0xd6e0('0x35')]=_[_0xd6e0('0x30')](_0x5f5a33,'name');_0xd4f0a5[_0xd6e0('0x36')]=_['keys'](_0x11fad2['query']);_0xd4f0a5['filters']=_[_0xd6e0('0x37')](_0xd4f0a5[_0xd6e0('0x35')],_0xd4f0a5[_0xd6e0('0x36')]);_0x59c443[_0xd6e0('0x38')]=_['intersection'](_0xd4f0a5[_0xd6e0('0x35')],qs[_0xd6e0('0x39')](_0x11fad2[_0xd6e0('0x36')]['fields']));_0x59c443['attributes']=_0x59c443[_0xd6e0('0x38')]['length']?_0x59c443[_0xd6e0('0x38')]:_0xd4f0a5['model'];if(!_0x11fad2[_0xd6e0('0x36')][_0xd6e0('0x3a')](_0xd6e0('0x3b'))){_0x59c443[_0xd6e0('0x23')]=qs['limit'](_0x11fad2['query'][_0xd6e0('0x23')]);_0x59c443[_0xd6e0('0x25')]=qs['offset'](_0x11fad2[_0xd6e0('0x36')][_0xd6e0('0x25')]);}_0x59c443[_0xd6e0('0x3c')]=qs['sort'](_0x11fad2[_0xd6e0('0x36')][_0xd6e0('0x3d')]);_0x59c443['where']=qs[_0xd6e0('0x3e')](_['pick'](_0x11fad2[_0xd6e0('0x36')],_0xd4f0a5[_0xd6e0('0x3e')]),_0x5f5a33);if(_0x11fad2[_0xd6e0('0x36')]['filter']){_0x59c443[_0xd6e0('0x3f')]=_['merge'](_0x59c443[_0xd6e0('0x3f')],{'$or':_['map'](_0x5f5a33,function(_0x2dc84c){if(_0x2dc84c[_0xd6e0('0x33')]!=='VIRTUAL'){var _0x1430b2={};_0x1430b2[_0x2dc84c[_0xd6e0('0x2d')]]={'$like':'%'+_0x11fad2['query'][_0xd6e0('0x40')]+'%'};return _0x1430b2;}})});}_0x59c443=_[_0xd6e0('0x41')]({},_0x59c443,_0x11fad2[_0xd6e0('0x42')]);var _0x30328b={'where':_0x59c443[_0xd6e0('0x3f')]};return db[_0xd6e0('0x43')][_0xd6e0('0x24')](_0x30328b)[_0xd6e0('0x16')](function(_0xfbf61c){_0x17cc2a[_0xd6e0('0x24')]=_0xfbf61c;if(_0x11fad2[_0xd6e0('0x36')]['includeAll']){_0x59c443[_0xd6e0('0x44')]=[{'all':!![]}];}return db['MailMessage'][_0xd6e0('0x45')](_0x59c443);})[_0xd6e0('0x16')](function(_0x2952ef){_0x17cc2a[_0xd6e0('0x46')]=_0x2952ef;return _0x17cc2a;})[_0xd6e0('0x16')](respondWithFilteredResult(_0x3b09f2,_0x59c443))[_0xd6e0('0x47')](handleError(_0x3b09f2,null));};exports['show']=function(_0x38ee5c,_0x5c4121){var _0x32ca37={'raw':!![],'where':{'id':_0x38ee5c['params']['id']}},_0x3760df={};_0x3760df['model']=_[_0xd6e0('0x48')](db[_0xd6e0('0x43')][_0xd6e0('0x31')]);_0x3760df[_0xd6e0('0x36')]=_[_0xd6e0('0x48')](_0x38ee5c[_0xd6e0('0x36')]);_0x3760df[_0xd6e0('0x3e')]=_[_0xd6e0('0x37')](_0x3760df[_0xd6e0('0x35')],_0x3760df[_0xd6e0('0x36')]);_0x32ca37['attributes']=_['intersection'](_0x3760df[_0xd6e0('0x35')],qs[_0xd6e0('0x39')](_0x38ee5c[_0xd6e0('0x36')][_0xd6e0('0x39')]));_0x32ca37[_0xd6e0('0x38')]=_0x32ca37['attributes'][_0xd6e0('0x49')]?_0x32ca37[_0xd6e0('0x38')]:_0x3760df['model'];if(_0x38ee5c[_0xd6e0('0x36')]['includeAll']){_0x32ca37[_0xd6e0('0x44')]=[{'all':!![]}];}_0x32ca37=_[_0xd6e0('0x41')]({},_0x32ca37,_0x38ee5c[_0xd6e0('0x42')]);return db[_0xd6e0('0x43')]['find'](_0x32ca37)[_0xd6e0('0x16')](handleEntityNotFound(_0x5c4121,null))['then'](respondWithResult(_0x5c4121,null))['catch'](handleError(_0x5c4121,null));};exports[_0xd6e0('0x28')]=function(_0xbdc36a,_0x2b8f53){if(_0xbdc36a[_0xd6e0('0x4a')]['id']){delete _0xbdc36a['body']['id'];}return db['MailMessage'][_0xd6e0('0x4b')]({'where':{'id':_0xbdc36a['params']['id']}})[_0xd6e0('0x16')](handleEntityNotFound(_0x2b8f53,null))['then'](saveUpdates(_0xbdc36a['body'],null))[_0xd6e0('0x16')](respondWithResult(_0x2b8f53,null))[_0xd6e0('0x47')](handleError(_0x2b8f53,null));};exports['destroy']=function(_0x297455,_0xcdd69f){return db[_0xd6e0('0x43')][_0xd6e0('0x4b')]({'where':{'id':_0x297455[_0xd6e0('0x4c')]['id']}})[_0xd6e0('0x16')](handleEntityNotFound(_0xcdd69f,null))[_0xd6e0('0x16')](removeEntity(_0xcdd69f,null))['catch'](handleError(_0xcdd69f,null));};exports[_0xd6e0('0x4d')]=function(_0x46d795,_0x113375){return db[_0xd6e0('0x43')][_0xd6e0('0x4d')]()[_0xd6e0('0x16')](respondWithResult(_0x113375,null))[_0xd6e0('0x47')](handleError(_0x113375,null));};exports['create']=function(_0x4a394e,_0x49d61f){return db['MailMessage'][_0xd6e0('0x4e')](_0x4a394e[_0xd6e0('0x4a')])[_0xd6e0('0x16')](function(_0x3a8fa9){if(_0x3a8fa9){if(_0x3a8fa9[_0xd6e0('0x4f')]===_0xd6e0('0x50')&&!_0x3a8fa9[_0xd6e0('0x51')]){var _0x4d1b07,_0x19e366,_0x596343;if(_0x4a394e['body']['to']){_0x19e366=_0x4a394e['body']['to'][_0xd6e0('0x52')](',')[0x0];}return db['MailAccount'][_0xd6e0('0x53')]({'where':{'id':_0x3a8fa9[_0xd6e0('0x54')]},'include':[{'model':db[_0xd6e0('0x55')],'as':'List','include':[{'model':db[_0xd6e0('0x56')],'as':'Contacts','where':{'email':_0x19e366},'limit':0x1,'order':[[_0xd6e0('0x57'),_0xd6e0('0x58')]]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0xd6e0('0x59')],'as':_0xd6e0('0x59'),'raw':!![]}]}]})[_0xd6e0('0x16')](function(_0x339d88){_0x4d1b07=_0x339d88;if(!_0x4d1b07||!_0x4d1b07[_0xd6e0('0x5a')])return;var _0x26451a=_0x4d1b07[_0xd6e0('0x5b')]();if(_0x4a394e['body'][_0xd6e0('0x5c')]&&_0x4a394e[_0xd6e0('0x4a')][_0xd6e0('0x5c')][_0xd6e0('0x49')]){for(var _0x30cbae=0x0;_0x30cbae<_0x4a394e[_0xd6e0('0x4a')]['attachments'][_0xd6e0('0x49')];_0x30cbae+=0x1){_0x4a394e[_0xd6e0('0x4a')][_0xd6e0('0x5c')][_0x30cbae]={'filename':_0x4a394e[_0xd6e0('0x4a')][_0xd6e0('0x5c')][_0x30cbae][_0xd6e0('0x2d')],'path':path[_0xd6e0('0x5d')](config[_0xd6e0('0x5e')],_0xd6e0('0x5f'),_0x4a394e[_0xd6e0('0x4a')]['attachments'][_0x30cbae][_0xd6e0('0x60')])};}}_0x596343={'account':_0x26451a,'message':_0x4a394e[_0xd6e0('0x4a')]};return;})['then'](function(){if(_0x4d1b07[_0xd6e0('0x61')]){if(_0x4d1b07[_0xd6e0('0x61')][_0xd6e0('0x62')]['length']){return _0x4d1b07[_0xd6e0('0x61')][_0xd6e0('0x62')][0x0];}else{return db[_0xd6e0('0x56')][_0xd6e0('0x4e')](_[_0xd6e0('0xc')](_0x4a394e[_0xd6e0('0x4a')],{'firstName':_0x4a394e['body']['to'],'email':_0x4a394e['body']['to'],'phone':_0x4a394e[_0xd6e0('0x4a')]['to'],'ListId':_0x4d1b07[_0xd6e0('0x63')]}));}}else{throw new Error(_0xd6e0('0x64'));}})[_0xd6e0('0x16')](function(){if(_0x596343){return respondWithRpcPromise('SendMail',_0xd6e0('0x65'),_0x596343,client9003)[_0xd6e0('0x16')](function(_0x2f4ea9){return _0x3a8fa9[_0xd6e0('0x28')]({'read':!![],'messageId':_0x2f4ea9[_0xd6e0('0x66')],'sentAt':moment()['format'](_0xd6e0('0x67'))});})[_0xd6e0('0x47')](function(_0x4d513e){logger[_0xd6e0('0x1d')]('%s',JSON[_0xd6e0('0x1c')](_0x4d513e));return _0x3a8fa9;});}return _0x3a8fa9;});}return _0x3a8fa9;}})['then'](respondWithResult(_0x49d61f,0xc9))[_0xd6e0('0x47')](handleError(_0x49d61f,null));};exports[_0xd6e0('0x68')]=function(_0x35c8c0,_0x2e424b){var _0x1c37db={'agent':{},'channel':_0xd6e0('0x69')};if(_0x35c8c0[_0xd6e0('0x4a')]['id']){delete _0x35c8c0[_0xd6e0('0x4a')]['id'];}_0x35c8c0[_0xd6e0('0x4a')][_0xd6e0('0x6a')]=!![];_0x35c8c0[_0xd6e0('0x4a')][_0xd6e0('0x6b')]=moment()[_0xd6e0('0x6c')](_0xd6e0('0x67'));_0x35c8c0[_0xd6e0('0x4a')][_0xd6e0('0x6d')]=_0x35c8c0[_0xd6e0('0x4a')][_0xd6e0('0x6d')]||_0x35c8c0[_0xd6e0('0x6e')]['id'];_0x1c37db['agent']['id']=_0x35c8c0[_0xd6e0('0x4a')][_0xd6e0('0x6d')];return db[_0xd6e0('0x43')]['find']({'where':{'id':_0x35c8c0[_0xd6e0('0x4c')]['id'],'UserId':null}})[_0xd6e0('0x16')](handleEntityNotFound(_0x2e424b,null))['then'](saveUpdates(_0x35c8c0[_0xd6e0('0x4a')],null))[_0xd6e0('0x16')](function(_0x1db9f6){if(_0x1db9f6){_0x1c37db[_0xd6e0('0x1f')]=_0x1db9f6[_0xd6e0('0x6f')]({'plain':!![]});return db[_0xd6e0('0x70')][_0xd6e0('0x4b')]({'where':{'id':_0x1db9f6[_0xd6e0('0x71')]}});}return null;})['then'](handleEntityNotFound(_0x2e424b,null))[_0xd6e0('0x16')](function(_0x25233b){if(_0x25233b){return _0x25233b['update']({'UserId':_0x35c8c0[_0xd6e0('0x4a')]['UserId'],'read1stAt':_['isNil'](_0x25233b[_0xd6e0('0x72')])?moment()[_0xd6e0('0x6c')](_0xd6e0('0x67')):undefined});}return null;})[_0xd6e0('0x16')](function(_0x2ee9d4){if(_0x2ee9d4){_0x1c37db[_0xd6e0('0x73')]=_0x2ee9d4[_0xd6e0('0x6f')]({'plain':!![]});interaction_log['info'](_0xd6e0('0x74'),_0x35c8c0[_0xd6e0('0x6e')]['id'],_0x35c8c0[_0xd6e0('0x6e')][_0xd6e0('0x2d')],_0x35c8c0['user'][_0xd6e0('0x75')],_0x1c37db[_0xd6e0('0x73')]['id'],_0x35c8c0['body']?JSON[_0xd6e0('0x1c')](_0x35c8c0[_0xd6e0('0x4a')]):_0xd6e0('0x76'));return respondWithRpcPromise('AcceptMessage',_0xd6e0('0x77'),_0x1c37db);}return null;})[_0xd6e0('0x16')](function(_0x1519af){var _0x2bac1a=_0xd6e0('0x78')+_0x1519af[_0xd6e0('0x1f')]['ContactId'];return db['sequelize']['query'](_0x2bac1a,{'type':db['Sequelize']['QueryTypes'][_0xd6e0('0x79')],'raw':!![]})[_0xd6e0('0x16')](function(_0x4e4a48){return _0x4e4a48;});})[_0xd6e0('0x16')](function(_0xe17810){if(_0xe17810){_0x1c37db[_0xd6e0('0x1f')][_0xd6e0('0x7a')]=_0xe17810[0x0];if(!_0x35c8c0[_0xd6e0('0x4a')][_0xd6e0('0x6d')])return;return db[_0xd6e0('0x7b')][_0xd6e0('0x4b')]({'where':{'id':_0x35c8c0[_0xd6e0('0x4a')]['UserId'],'role':_0xd6e0('0x7c')},'attributes':['id','name',_0xd6e0('0x7d'),_0xd6e0('0x7e'),_0xd6e0('0x7f')],'raw':!![]});}return null;})[_0xd6e0('0x16')](function(_0x1b703d){if(!_0x1b703d)return null;_0x1c37db[_0xd6e0('0x1f')][_0xd6e0('0x7c')]=_0x1b703d;return _0x1c37db;})[_0xd6e0('0x16')](function(_0x22c0cc){if(_0x22c0cc){if(_0x35c8c0[_0xd6e0('0x4a')][_0xd6e0('0x80')]){_0x1c37db[_0xd6e0('0x1f')][_0xd6e0('0x81')]=util['format'](_0xd6e0('0x82'),_0x35c8c0[_0xd6e0('0x6e')][_0xd6e0('0x2d')]);_0x1c37db[_0xd6e0('0x1f')]['channel']=_0x1c37db[_0xd6e0('0x83')];_0x1c37db[_0xd6e0('0x1f')]['motionChannel']=_0x1c37db[_0xd6e0('0x83')];_0x1c37db['message'][_0xd6e0('0x84')]=_0xd6e0('0x68');_0x1c37db[_0xd6e0('0x1f')][_0xd6e0('0x4a')]=htmlToText[_0xd6e0('0x85')](_0x1c37db['message'][_0xd6e0('0x4a')]);return respondWithRpcPromise(_0xd6e0('0x86'),'EventManager',{'event':_0xd6e0('0x87'),'message':_0x1c37db[_0xd6e0('0x1f')]},client9002)[_0xd6e0('0x16')](function(){return _0x1c37db;});}return _0x1c37db;}return null;})[_0xd6e0('0x16')](respondWithResult(_0x2e424b,null))['catch'](handleError(_0x2e424b,null));};exports[_0xd6e0('0x88')]=function(_0x1ddd47,_0x35f8fa){var _0x196d0f={'agent':{},'channel':'mail'};if(_0x1ddd47[_0xd6e0('0x4a')]['id']){delete _0x1ddd47[_0xd6e0('0x4a')]['id'];}_0x1ddd47[_0xd6e0('0x4a')]['UserId']=_0x1ddd47['body'][_0xd6e0('0x6d')]||_0x1ddd47[_0xd6e0('0x6e')]['id'];_0x196d0f[_0xd6e0('0x7c')]['id']=_0x1ddd47[_0xd6e0('0x4a')][_0xd6e0('0x6d')];return db[_0xd6e0('0x43')]['find']({'where':{'id':_0x1ddd47[_0xd6e0('0x4c')]['id'],'UserId':null}})[_0xd6e0('0x16')](handleEntityNotFound(_0x35f8fa,null))[_0xd6e0('0x16')](function(_0x5d41c1){if(_0x5d41c1){_0x196d0f[_0xd6e0('0x1f')]=_0x5d41c1['get']({'plain':!![]});return db[_0xd6e0('0x70')][_0xd6e0('0x4b')]({'where':{'id':_0x5d41c1['MailInteractionId']}});}return null;})[_0xd6e0('0x16')](handleEntityNotFound(_0x35f8fa,null))['then'](function(_0x1bf651){if(_0x1bf651){_0x196d0f[_0xd6e0('0x73')]=_0x1bf651[_0xd6e0('0x6f')]({'plain':!![]});interaction_log[_0xd6e0('0x17')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1ddd47[_0xd6e0('0x6e')]['id'],_0x1ddd47[_0xd6e0('0x6e')][_0xd6e0('0x2d')],_0x1ddd47[_0xd6e0('0x6e')]['role'],_0x196d0f[_0xd6e0('0x73')]['id'],_0x1ddd47[_0xd6e0('0x4a')]?JSON[_0xd6e0('0x1c')](_0x1ddd47[_0xd6e0('0x4a')]):'null');return respondWithRpcPromise('RejectMessage',_0xd6e0('0x89'),_0x196d0f);}return null;})[_0xd6e0('0x16')](function(_0x12f01e){var _0x18bcac=_0xd6e0('0x78')+_0x12f01e[_0xd6e0('0x1f')][_0xd6e0('0x8a')];return db['sequelize']['query'](_0x18bcac,{'type':db[_0xd6e0('0x8b')][_0xd6e0('0x8c')][_0xd6e0('0x79')],'raw':!![]})[_0xd6e0('0x16')](function(_0x5828d8){return _0x5828d8;});})['then'](function(_0xe185b1){if(_0xe185b1){_0x196d0f[_0xd6e0('0x1f')][_0xd6e0('0x7a')]=_0xe185b1[0x0];if(!_0x1ddd47['body'][_0xd6e0('0x6d')])return;return db['User'][_0xd6e0('0x4b')]({'where':{'id':_0x1ddd47[_0xd6e0('0x4a')][_0xd6e0('0x6d')],'role':_0xd6e0('0x7c')},'attributes':['id',_0xd6e0('0x2d'),_0xd6e0('0x7d'),'email',_0xd6e0('0x7f')],'raw':!![]});}return null;})[_0xd6e0('0x16')](function(_0x46dd3e){if(!_0x46dd3e)return null;_0x196d0f[_0xd6e0('0x1f')]['agent']=_0x46dd3e;return _0x196d0f;})[_0xd6e0('0x16')](function(_0x149d9f){if(_0x149d9f){_0x149d9f[_0xd6e0('0x1f')][_0xd6e0('0x81')]=util['format'](_0xd6e0('0x82'),_0x1ddd47[_0xd6e0('0x6e')][_0xd6e0('0x2d')]);_0x149d9f[_0xd6e0('0x1f')][_0xd6e0('0x83')]=_0x196d0f[_0xd6e0('0x83')];_0x149d9f[_0xd6e0('0x1f')][_0xd6e0('0x8d')]=_0x196d0f[_0xd6e0('0x83')];_0x149d9f['message'][_0xd6e0('0x84')]='reject';_0x149d9f[_0xd6e0('0x1f')][_0xd6e0('0x4a')]=htmlToText['fromString'](_0x196d0f['message']['body']);respondWithRpcPromise(_0xd6e0('0x86'),_0xd6e0('0x86'),{'event':_0xd6e0('0x8e'),'message':_0x149d9f[_0xd6e0('0x1f')]},client9002);return _0x196d0f;}return null;})[_0xd6e0('0x16')](respondWithResult(_0x35f8fa,null))[_0xd6e0('0x47')](handleError(_0x35f8fa,null));};exports[_0xd6e0('0x8f')]=function(_0xcfccbc,_0x33fa58){var _0x3a5dd3=moment()['unix']()['toString']();var _0x275589=path[_0xd6e0('0x5d')](config['root'],'server',_0xd6e0('0x90'),_0xd6e0('0x91'));var _0x3b4e5e=path[_0xd6e0('0x5d')](config[_0xd6e0('0x5e')],_0xd6e0('0x92'),'files',_0xd6e0('0x5c'));var _0x3597a2=util[_0xd6e0('0x6c')](_0xd6e0('0x93'),_0x3a5dd3);return db[_0xd6e0('0x43')]['find']({'where':{'id':_0xcfccbc[_0xd6e0('0x4c')]['id']},'attributes':['id','body','from','to','cc','bcc',_0xd6e0('0x94'),'createdAt'],'include':_0xcfccbc[_0xd6e0('0x36')][_0xd6e0('0x5c')]?[{'model':db[_0xd6e0('0x95')],'as':_0xd6e0('0x96')}]:undefined})[_0xd6e0('0x16')](handleEntityNotFound(_0x33fa58,null))[_0xd6e0('0x16')](function(_0x1bb6cc){if(_0x1bb6cc){var _0x3eaf47=_0x1bb6cc;var _0x1c648e={'from':_0x3eaf47[_0xd6e0('0x97')],'to':_0x3eaf47['to'],'subject':_0x3eaf47['subject'],'html':htmlEntities['decode'](_0x3eaf47[_0xd6e0('0x4a')]),'headers':{'Date':moment(_0x3eaf47['createdAt'])[_0xd6e0('0x6c')](_0xd6e0('0x98'))},'attachments':[]};if(_0x1bb6cc['cc']){_0x1c648e['headers']['Cc']=_0x1bb6cc['cc'];}if(_0x1bb6cc['bcc']){_0x1c648e[_0xd6e0('0x99')][_0xd6e0('0x9a')]=_0x1bb6cc['bcc'];}return new BPromise(function(_0x3736f0,_0x435088){if(_0x1bb6cc[_0xd6e0('0x96')]){for(var _0x48fa24=0x0;_0x48fa24<_0x1bb6cc['Attachments'][_0xd6e0('0x49')];_0x48fa24++){var _0x109959=_0x1bb6cc[_0xd6e0('0x96')][_0x48fa24];var _0x1cd031=path['join'](_0x3b4e5e,_0x109959[_0xd6e0('0x60')]);if(fs[_0xd6e0('0x9b')](_0x1cd031)){_0x1c648e[_0xd6e0('0x5c')][_0xd6e0('0x9c')]({'name':_0x109959[_0xd6e0('0x2d')],'contentType':_0x109959[_0xd6e0('0x33')],'data':fs[_0xd6e0('0x9d')](_0x1cd031)});}}}emlformat[_0xd6e0('0x9e')](_0x1c648e,function(_0x10a834,_0x45a510){if(_0x10a834)return _0x435088(_0x10a834);fs[_0xd6e0('0x9f')](path['join'](_0x275589,_0x3597a2),_0x45a510);return _0x3736f0(_0x45a510);});});}})[_0xd6e0('0x16')](function(_0x5955c9){if(_0x5955c9){return _0x33fa58['download'](path[_0xd6e0('0x5d')](_0x275589,_0x3597a2),_0x3597a2,function(_0x6526da){if(!_0x6526da)fs[_0xd6e0('0xa0')](path[_0xd6e0('0x5d')](_0x275589,_0x3597a2));});}})[_0xd6e0('0x47')](handleError(_0x33fa58,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 7fff08a..ef7cc8a 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 _0x10ad=['MailMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x51e6cb,_0xc81f49){var _0x1a4508=function(_0x517812){while(--_0x517812){_0x51e6cb['push'](_0x51e6cb['shift']());}};_0x1a4508(++_0xc81f49);}(_0x10ad,0x94));var _0xd10a=function(_0x352f1e,_0x4cb201){_0x352f1e=_0x352f1e-0x0;var _0x528bf2=_0x10ad[_0x352f1e];return _0x528bf2;};'use strict';var EventEmitter=require(_0xd10a('0x0'));var MailMessage=require(_0xd10a('0x1'))['db'][_0xd10a('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xd10a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd10a('0x4'),'afterDestroy':_0xd10a('0x5')};function emitEvent(_0x5574ff){return function(_0x4455ff,_0x2e4f9e,_0xaa9197){MailMessageEvents[_0xd10a('0x6')](_0x5574ff+':'+_0x4455ff['id'],_0x4455ff);MailMessageEvents[_0xd10a('0x6')](_0x5574ff,_0x4455ff);_0xaa9197(null);};}for(var e in events){if(events[_0xd10a('0x7')](e)){var event=events[e];MailMessage[_0xd10a('0x8')](e,emitEvent(event));}}module[_0xd10a('0x9')]=MailMessageEvents; \ No newline at end of file +var _0x1a10=['emit','hasOwnProperty','hook','exports','../../mysqldb','MailMessage','setMaxListeners','save','update','remove'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x1a10,0x1e4));var _0x01a1=function(_0x23940b,_0x494433){_0x23940b=_0x23940b-0x0;var _0x3822de=_0x1a10[_0x23940b];return _0x3822de;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x01a1('0x0'))['db'][_0x01a1('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x01a1('0x2')](0x0);var events={'afterCreate':_0x01a1('0x3'),'afterUpdate':_0x01a1('0x4'),'afterDestroy':_0x01a1('0x5')};function emitEvent(_0x17bac9){return function(_0x536165,_0x36318d,_0x4c95ad){MailMessageEvents[_0x01a1('0x6')](_0x17bac9+':'+_0x536165['id'],_0x536165);MailMessageEvents[_0x01a1('0x6')](_0x17bac9,_0x536165);_0x4c95ad(null);};}for(var e in events){if(events[_0x01a1('0x7')](e)){var event=events[e];MailMessage[_0x01a1('0x8')](e,emitEvent(event));}}module[_0x01a1('0x9')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index d6bc679..ca996df 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 _0xe94e=['./mailMessage.attributes','exports','define','mail_messages','messageId','fti_mail_messages','plainBody','body','fromString','models','get','direction','out','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','bluebird','html-to-text','path','../../config/environment'];(function(_0xe8daff,_0x4ed9b4){var _0x859575=function(_0x4a0eec){while(--_0x4a0eec){_0xe8daff['push'](_0xe8daff['shift']());}};_0x859575(++_0x4ed9b4);}(_0xe94e,0xae));var _0xee94=function(_0x259424,_0x57e976){_0x259424=_0x259424-0x0;var _0x6de86b=_0xe94e[_0x259424];return _0x6de86b;};'use strict';var _=require('lodash');var util=require(_0xee94('0x0'));var logger=require(_0xee94('0x1'))('api');var moment=require('moment');var BPromise=require(_0xee94('0x2'));var rp=require('request-promise');var htmlToText=require(_0xee94('0x3'));var fs=require('fs');var path=require(_0xee94('0x4'));var rimraf=require('rimraf');var config=require(_0xee94('0x5'));var attributes=require(_0xee94('0x6'));module[_0xee94('0x7')]=function(_0x2daca7,_0x172e64){return _0x2daca7[_0xee94('0x8')]('MailMessage',attributes,{'tableName':_0xee94('0x9'),'paranoid':![],'indexes':[{'name':_0xee94('0xa'),'fields':[_0xee94('0xa')]},{'name':_0xee94('0xb'),'fields':[_0xee94('0xc'),'subject'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1b2cf0,_0x2cd9b3,_0x187f60){if(_0x1b2cf0[_0xee94('0xd')]){_0x1b2cf0[_0xee94('0xc')]=htmlToText[_0xee94('0xe')](_0x1b2cf0['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x187f60(null,_0x2cd9b3);},'afterCreate':function(_0x81f8b,_0x3f8c5c,_0x56bd39){var _0x41570e=_0x2daca7[_0xee94('0xf')];var _0xae8a11=_0x81f8b[_0xee94('0x10')]({'plain':!![]});if(_0xae8a11[_0xee94('0x11')]['toLowerCase']()==='in'||_0xae8a11['direction']['toLowerCase']()===_0xee94('0x12')&&!_0xae8a11['secret']&&!_[_0xee94('0x13')](_0xae8a11[_0xee94('0x14')])){_0x41570e[_0xee94('0x15')][_0xee94('0x16')]({'where':{'id':_0xae8a11[_0xee94('0x17')]}})[_0xee94('0x18')](function(_0x474add){if(_0x474add){_0x474add[_0xee94('0x19')]({'lastMsgAt':_0xae8a11[_0xee94('0x1a')],'lastMsgDirection':_0xae8a11[_0xee94('0x11')]['toLowerCase']()});}})[_0xee94('0x1b')](function(_0x524880){console['error'](_0x524880);});}_0x56bd39();}},'charset':_0xee94('0x1c'),'collate':_0xee94('0x1d')});}; \ No newline at end of file +var _0xce61=['MailMessage','messageId','fti_mail_messages','subject','FULLTEXT','body','plainBody','fromString','get','direction','toLowerCase','secret','isNil','UserId','MailInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports'];(function(_0x255fa3,_0x5165c1){var _0x184639=function(_0x3af8c1){while(--_0x3af8c1){_0x255fa3['push'](_0x255fa3['shift']());}};_0x184639(++_0x5165c1);}(_0xce61,0x1e4));var _0x1ce6=function(_0x4d9133,_0x1572b5){_0x4d9133=_0x4d9133-0x0;var _0xd96f1c=_0xce61[_0x4d9133];return _0xd96f1c;};'use strict';var _=require(_0x1ce6('0x0'));var util=require('util');var logger=require(_0x1ce6('0x1'))('api');var moment=require(_0x1ce6('0x2'));var BPromise=require(_0x1ce6('0x3'));var rp=require(_0x1ce6('0x4'));var htmlToText=require(_0x1ce6('0x5'));var fs=require('fs');var path=require(_0x1ce6('0x6'));var rimraf=require(_0x1ce6('0x7'));var config=require(_0x1ce6('0x8'));var attributes=require(_0x1ce6('0x9'));module[_0x1ce6('0xa')]=function(_0x302e4a,_0x558d09){return _0x302e4a['define'](_0x1ce6('0xb'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x1ce6('0xc'),'fields':['messageId']},{'name':_0x1ce6('0xd'),'fields':['plainBody',_0x1ce6('0xe')],'type':_0x1ce6('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1dbf6b,_0x5e3a5d,_0x416720){if(_0x1dbf6b[_0x1ce6('0x10')]){_0x1dbf6b[_0x1ce6('0x11')]=htmlToText[_0x1ce6('0x12')](_0x1dbf6b['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x416720(null,_0x5e3a5d);},'afterCreate':function(_0x1c978e,_0x2b7ab2,_0x4e9e99){var _0x2f97de=_0x302e4a['models'];var _0x421ee9=_0x1c978e[_0x1ce6('0x13')]({'plain':!![]});if(_0x421ee9[_0x1ce6('0x14')][_0x1ce6('0x15')]()==='in'||_0x421ee9[_0x1ce6('0x14')][_0x1ce6('0x15')]()==='out'&&!_0x421ee9[_0x1ce6('0x16')]&&!_[_0x1ce6('0x17')](_0x421ee9[_0x1ce6('0x18')])){_0x2f97de['MailInteraction']['findOne']({'where':{'id':_0x421ee9[_0x1ce6('0x19')]}})[_0x1ce6('0x1a')](function(_0x41f8fa){if(_0x41f8fa){_0x41f8fa[_0x1ce6('0x1b')]({'lastMsgAt':_0x421ee9[_0x1ce6('0x1c')],'lastMsgDirection':_0x421ee9[_0x1ce6('0x14')][_0x1ce6('0x15')]()});}})[_0x1ce6('0x1d')](function(_0x31dd35){console[_0x1ce6('0x1e')](_0x31dd35);});}_0x4e9e99();}},'charset':_0x1ce6('0x1f'),'collate':_0x1ce6('0x20')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index fd43cac..125bd35 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 _0xfff0=['rpc','../../config/environment','client','http','redis','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','create','body','options','CreateMailMessage','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x4489c,_0x24f141){var _0x305e3d=function(_0x5f1b0c){while(--_0x5f1b0c){_0x4489c['push'](_0x4489c['shift']());}};_0x305e3d(++_0x24f141);}(_0xfff0,0x139));var _0x0fff=function(_0x4f0127,_0x4f6c00){_0x4f0127=_0x4f0127-0x0;var _0x4be7aa=_0xfff0[_0x4f0127];return _0x4be7aa;};'use strict';var _=require('lodash');var util=require(_0x0fff('0x0'));var moment=require(_0x0fff('0x1'));var BPromise=require(_0x0fff('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0fff('0x3'));var db=require(_0x0fff('0x4'))['db'];var utils=require(_0x0fff('0x5'));var logger=require('../../config/logger')(_0x0fff('0x6'));var config=require(_0x0fff('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0fff('0x8')][_0x0fff('0x9')]({'port':0x232a});config[_0x0fff('0xa')]=_['defaults'](config[_0x0fff('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x0fff('0xb'))(new Redis(config['redis']));require(_0x0fff('0xc'))[_0x0fff('0xd')](socket);function respondWithRpcPromise(_0x4cc3f3,_0x227d28,_0x377b2f){return new BPromise(function(_0x1de923,_0x289e01){return client[_0x0fff('0xe')](_0x4cc3f3,_0x377b2f)[_0x0fff('0xf')](function(_0x363c0d){logger[_0x0fff('0x10')](_0x0fff('0x11'),_0x227d28,_0x0fff('0x12'));logger[_0x0fff('0x13')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x227d28,_0x0fff('0x12'),JSON['stringify'](_0x363c0d));if(_0x363c0d[_0x0fff('0x14')]){if(_0x363c0d[_0x0fff('0x14')][_0x0fff('0x15')]===0x1f4){logger[_0x0fff('0x14')]('MailMessage,\x20%s,\x20%s',_0x227d28,_0x363c0d['error'][_0x0fff('0x16')]);return _0x289e01(_0x363c0d['error']['message']);}logger['error'](_0x0fff('0x11'),_0x227d28,_0x363c0d[_0x0fff('0x14')]['message']);return _0x1de923(_0x363c0d[_0x0fff('0x14')][_0x0fff('0x16')]);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x227d28,'request\x20sent');_0x1de923(_0x363c0d[_0x0fff('0x17')][_0x0fff('0x16')]);}})[_0x0fff('0x18')](function(_0x3762dc){logger[_0x0fff('0x14')](_0x0fff('0x11'),_0x227d28,_0x3762dc);_0x289e01(_0x3762dc);});});}exports['CreateMailMessage']=function(_0x44a54a){var _0x136520=this;return new Promise(function(_0x48e6f9,_0x49d211){return db['MailMessage'][_0x0fff('0x19')](_0x44a54a[_0x0fff('0x1a')],{'raw':_0x44a54a[_0x0fff('0x1b')]?_0x44a54a[_0x0fff('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x0fff('0xf')](function(_0x2f8665){logger[_0x0fff('0x10')](_0x0fff('0x1c'),_0x44a54a);logger[_0x0fff('0x13')](_0x0fff('0x1c'),_0x44a54a,JSON['stringify'](_0x2f8665));_0x48e6f9(_0x2f8665);})[_0x0fff('0x18')](function(_0x29f702){logger[_0x0fff('0x14')](_0x0fff('0x1c'),_0x29f702[_0x0fff('0x16')],_0x44a54a);_0x49d211(_0x136520[_0x0fff('0x14')](0x1f4,_0x29f702['message']));});});}; \ No newline at end of file +var _0x0abf=['MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateMailMessage','MailMessage','create','options','raw','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','then','info'];(function(_0xd6165e,_0x2195e1){var _0x207e4f=function(_0xb5ac83){while(--_0xb5ac83){_0xd6165e['push'](_0xd6165e['shift']());}};_0x207e4f(++_0x2195e1);}(_0x0abf,0xe8));var _0xf0ab=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x0abf[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0xf0ab('0x0'));var util=require('util');var moment=require(_0xf0ab('0x1'));var BPromise=require(_0xf0ab('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf0ab('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf0ab('0x4'))(_0xf0ab('0x5'));var config=require(_0xf0ab('0x6'));var jayson=require(_0xf0ab('0x7'));var client=jayson[_0xf0ab('0x8')][_0xf0ab('0x9')]({'port':0x232a});config[_0xf0ab('0xa')]=_['defaults'](config[_0xf0ab('0xa')],{'host':_0xf0ab('0xb'),'port':0x18eb});var socket=require(_0xf0ab('0xc'))(new Redis(config[_0xf0ab('0xa')]));require('./mailMessage.socket')[_0xf0ab('0xd')](socket);function respondWithRpcPromise(_0x4688d8,_0x1e7887,_0x4ab8e7){return new BPromise(function(_0x5d25a0,_0x30042c){return client['request'](_0x4688d8,_0x4ab8e7)[_0xf0ab('0xe')](function(_0x10a5a2){logger[_0xf0ab('0xf')](_0xf0ab('0x10'),_0x1e7887,_0xf0ab('0x11'));logger[_0xf0ab('0x12')](_0xf0ab('0x13'),_0x1e7887,'request\x20sent',JSON[_0xf0ab('0x14')](_0x10a5a2));if(_0x10a5a2[_0xf0ab('0x15')]){if(_0x10a5a2[_0xf0ab('0x15')][_0xf0ab('0x16')]===0x1f4){logger[_0xf0ab('0x15')](_0xf0ab('0x10'),_0x1e7887,_0x10a5a2[_0xf0ab('0x15')][_0xf0ab('0x17')]);return _0x30042c(_0x10a5a2[_0xf0ab('0x15')][_0xf0ab('0x17')]);}logger[_0xf0ab('0x15')](_0xf0ab('0x10'),_0x1e7887,_0x10a5a2[_0xf0ab('0x15')][_0xf0ab('0x17')]);return _0x5d25a0(_0x10a5a2[_0xf0ab('0x15')]['message']);}else{logger[_0xf0ab('0xf')](_0xf0ab('0x10'),_0x1e7887,_0xf0ab('0x11'));_0x5d25a0(_0x10a5a2[_0xf0ab('0x18')][_0xf0ab('0x17')]);}})[_0xf0ab('0x19')](function(_0x3a0edf){logger[_0xf0ab('0x15')](_0xf0ab('0x10'),_0x1e7887,_0x3a0edf);_0x30042c(_0x3a0edf);});});}exports[_0xf0ab('0x1a')]=function(_0x715579){var _0xdfcfb2=this;return new Promise(function(_0xf43bc4,_0x22a205){return db[_0xf0ab('0x1b')][_0xf0ab('0x1c')](_0x715579['body'],{'raw':_0x715579[_0xf0ab('0x1d')]?_0x715579[_0xf0ab('0x1d')][_0xf0ab('0x1e')]===undefined?!![]:![]:!![]})[_0xf0ab('0xe')](function(_0x3bf6a1){logger[_0xf0ab('0xf')](_0xf0ab('0x1a'),_0x715579);logger[_0xf0ab('0x12')](_0xf0ab('0x1a'),_0x715579,JSON[_0xf0ab('0x14')](_0x3bf6a1));_0xf43bc4(_0x3bf6a1);})[_0xf0ab('0x19')](function(_0x5645b2){logger['error']('CreateMailMessage',_0x5645b2[_0xf0ab('0x17')],_0x715579);_0x22a205(_0xdfcfb2['error'](0x1f4,_0x5645b2[_0xf0ab('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index b58ed15..43300b6 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 _0xa6cd=['update','emit','removeListener','length','./mailMessage.events','save','remove'];(function(_0x4c2623,_0x4838bb){var _0x2be431=function(_0x55829d){while(--_0x55829d){_0x4c2623['push'](_0x4c2623['shift']());}};_0x2be431(++_0x4838bb);}(_0xa6cd,0x107));var _0xda6c=function(_0x2816cb,_0x107fbb){_0x2816cb=_0x2816cb-0x0;var _0x52ae2c=_0xa6cd[_0x2816cb];return _0x52ae2c;};'use strict';var MailMessageEvents=require(_0xda6c('0x0'));var events=[_0xda6c('0x1'),_0xda6c('0x2'),_0xda6c('0x3')];function createListener(_0x191713,_0xe5d2bd){return function(_0x2d3661){_0xe5d2bd[_0xda6c('0x4')](_0x191713,_0x2d3661);};}function removeListener(_0x330183,_0x358344){return function(){MailMessageEvents[_0xda6c('0x5')](_0x330183,_0x358344);};}exports['register']=function(_0x24aa61){for(var _0x1cce50=0x0,_0xfd2470=events[_0xda6c('0x6')];_0x1cce50<_0xfd2470;_0x1cce50++){var _0x25ffd2=events[_0x1cce50];var _0x4fe6e5=createListener('mailMessage:'+_0x25ffd2,_0x24aa61);MailMessageEvents['on'](_0x25ffd2,_0x4fe6e5);}}; \ No newline at end of file +var _0x5c85=['update','emit','removeListener','length','./mailMessage.events','save','remove'];(function(_0x28d282,_0x31213c){var _0x191fd7=function(_0x1abe10){while(--_0x1abe10){_0x28d282['push'](_0x28d282['shift']());}};_0x191fd7(++_0x31213c);}(_0x5c85,0xc1));var _0x55c8=function(_0x5e4602,_0x4b2a34){_0x5e4602=_0x5e4602-0x0;var _0x3f5f15=_0x5c85[_0x5e4602];return _0x3f5f15;};'use strict';var MailMessageEvents=require(_0x55c8('0x0'));var events=[_0x55c8('0x1'),_0x55c8('0x2'),_0x55c8('0x3')];function createListener(_0x1b0fa6,_0x15c0f2){return function(_0x255906){_0x15c0f2[_0x55c8('0x4')](_0x1b0fa6,_0x255906);};}function removeListener(_0x5637e2,_0x54ec80){return function(){MailMessageEvents[_0x55c8('0x5')](_0x5637e2,_0x54ec80);};}exports['register']=function(_0x58dec5){for(var _0x3472aa=0x0,_0x15b7b5=events[_0x55c8('0x6')];_0x3472aa<_0x15b7b5;_0x3472aa++){var _0x5a3fbc=events[_0x3472aa];var _0x3805f6=createListener('mailMessage:'+_0x5a3fbc,_0x58dec5);MailMessageEvents['on'](_0x5a3fbc,_0x3805f6);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 1edac68..4fc3313 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 _0x056c=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','isAuthenticated','get','/describe','describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','addAgents','put','/:id','delete','destroy','removeTeams','removeAgents','multer','util','connect-timeout','express'];(function(_0x37d594,_0x2a1508){var _0x3dd37e=function(_0x779671){while(--_0x779671){_0x37d594['push'](_0x37d594['shift']());}};_0x3dd37e(++_0x2a1508);}(_0x056c,0x70));var _0xc056=function(_0x118969,_0x3bea3e){_0x118969=_0x118969-0x0;var _0x12ffc8=_0x056c[_0x118969];return _0x12ffc8;};'use strict';var multer=require(_0xc056('0x0'));var util=require(_0xc056('0x1'));var path=require('path');var timeout=require(_0xc056('0x2'));var express=require(_0xc056('0x3'));var router=express[_0xc056('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc056('0x5'));var interaction=require(_0xc056('0x6'));var config=require(_0xc056('0x7'));var controller=require(_0xc056('0x8'));router['get']('/',auth[_0xc056('0x9')](),controller['index']);router[_0xc056('0xa')](_0xc056('0xb'),auth['isAuthenticated'](),controller[_0xc056('0xc')]);router[_0xc056('0xa')]('/:id',auth[_0xc056('0x9')](),controller[_0xc056('0xd')]);router[_0xc056('0xa')](_0xc056('0xe'),auth[_0xc056('0x9')](),controller['getMembers']);router['get'](_0xc056('0xf'),auth['isAuthenticated'](),controller[_0xc056('0x10')]);router[_0xc056('0xa')](_0xc056('0x11'),auth[_0xc056('0x9')](),controller[_0xc056('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc056('0x13')]);router[_0xc056('0x14')](_0xc056('0xf'),auth[_0xc056('0x9')](),controller[_0xc056('0x15')]);router['post'](_0xc056('0x11'),auth[_0xc056('0x9')](),controller[_0xc056('0x16')]);router[_0xc056('0x17')](_0xc056('0x18'),auth['isAuthenticated'](),controller['update']);router[_0xc056('0x19')]('/:id',auth[_0xc056('0x9')](),controller[_0xc056('0x1a')]);router[_0xc056('0x19')](_0xc056('0xf'),auth[_0xc056('0x9')](),controller[_0xc056('0x1b')]);router[_0xc056('0x19')]('/:id/users',auth[_0xc056('0x9')](),controller[_0xc056('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x3e0a=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addAgents','put','update','delete','destroy','removeTeams','removeAgents','multer'];(function(_0x276468,_0x29685a){var _0x36dc3a=function(_0x291f0a){while(--_0x291f0a){_0x276468['push'](_0x276468['shift']());}};_0x36dc3a(++_0x29685a);}(_0x3e0a,0x151));var _0xa3e0=function(_0x2a8c21,_0x163576){_0x2a8c21=_0x2a8c21-0x0;var _0x5f3061=_0x3e0a[_0x2a8c21];return _0x5f3061;};'use strict';var multer=require(_0xa3e0('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa3e0('0x1'));var express=require('express');var router=express[_0xa3e0('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xa3e0('0x3'));var interaction=require(_0xa3e0('0x4'));var config=require(_0xa3e0('0x5'));var controller=require('./mailQueue.controller');router[_0xa3e0('0x6')]('/',auth[_0xa3e0('0x7')](),controller[_0xa3e0('0x8')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xa3e0('0x9')]);router[_0xa3e0('0x6')](_0xa3e0('0xa'),auth[_0xa3e0('0x7')](),controller[_0xa3e0('0xb')]);router['get'](_0xa3e0('0xc'),auth[_0xa3e0('0x7')](),controller[_0xa3e0('0xd')]);router[_0xa3e0('0x6')](_0xa3e0('0xe'),auth[_0xa3e0('0x7')](),controller['getTeams']);router['get'](_0xa3e0('0xf'),auth['isAuthenticated'](),controller[_0xa3e0('0x10')]);router[_0xa3e0('0x11')]('/',auth[_0xa3e0('0x7')](),controller[_0xa3e0('0x12')]);router[_0xa3e0('0x11')](_0xa3e0('0xe'),auth[_0xa3e0('0x7')](),controller['addTeams']);router[_0xa3e0('0x11')]('/:id/users',auth['isAuthenticated'](),controller[_0xa3e0('0x13')]);router[_0xa3e0('0x14')]('/:id',auth[_0xa3e0('0x7')](),controller[_0xa3e0('0x15')]);router[_0xa3e0('0x16')](_0xa3e0('0xa'),auth[_0xa3e0('0x7')](),controller[_0xa3e0('0x17')]);router[_0xa3e0('0x16')](_0xa3e0('0xe'),auth['isAuthenticated'](),controller[_0xa3e0('0x18')]);router[_0xa3e0('0x16')](_0xa3e0('0xf'),auth[_0xa3e0('0x7')](),controller[_0xa3e0('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 7a28a3f..8ba8ec3 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 _0xfc00=['rrmemory','beepall','exports','name','STRING','ENUM'];(function(_0x503af5,_0x13f56c){var _0x397c12=function(_0x3f522a){while(--_0x3f522a){_0x503af5['push'](_0x503af5['shift']());}};_0x397c12(++_0x13f56c);}(_0xfc00,0x110));var _0x0fc0=function(_0x27e811,_0x20137c){_0x27e811=_0x27e811-0x0;var _0x1627fa=_0xfc00[_0x27e811];return _0x1627fa;};'use strict';var Sequelize=require('sequelize');module[_0x0fc0('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x0fc0('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0fc0('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0fc0('0x3')](_0x0fc0('0x4'),_0x0fc0('0x5'),'roundrobin')}}; \ No newline at end of file +var _0xb0d4=['sequelize','exports','STRING','name','ENUM','beepall','roundrobin'];(function(_0x494a42,_0x1f2103){var _0x254792=function(_0x5f1c1d){while(--_0x5f1c1d){_0x494a42['push'](_0x494a42['shift']());}};_0x254792(++_0x1f2103);}(_0xb0d4,0x13b));var _0x4b0d=function(_0x33dc75,_0x425795){_0x33dc75=_0x33dc75-0x0;var _0x1a227d=_0xb0d4[_0x33dc75];return _0x1a227d;};'use strict';var Sequelize=require(_0x4b0d('0x0'));module[_0x4b0d('0x1')]={'name':{'type':Sequelize[_0x4b0d('0x2')],'unique':_0x4b0d('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4b0d('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4b0d('0x4')]('rrmemory',_0x4b0d('0x5'),_0x4b0d('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 60773f7..f10f367 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 _0x17fc=['filter','User','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','nolimit','addTeams','ids','Agents','online','interface','flatMap','each','forEach','emit','userMailQueue:save','select','field','tq.TeamId','team_has_mail_queues','join','user_has_teams','push','sequelize','toString','QueryTypes','every','includes','all','union','compact','value','removeTeams','isEmpty','userMailQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','bluebird','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','update','then','get','error','stack','name','send','map','MailQueue','rawAttributes','type','key','getOptions','where','include','findAll','rows','catch','params','model','query','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','MailQueues','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','getMembers','findOne','UserMailQueue','hasOwnProperty','order','sort','pick','MailQueueId'];(function(_0x144d9c,_0x3ec497){var _0x54db44=function(_0x11bbc3){while(--_0x11bbc3){_0x144d9c['push'](_0x144d9c['shift']());}};_0x54db44(++_0x3ec497);}(_0x17fc,0x192));var _0xc17f=function(_0x56ed68,_0x5921d9){_0x56ed68=_0x56ed68-0x0;var _0xd29dbf=_0x17fc[_0x56ed68];return _0xd29dbf;};'use strict';var BPromise=require(_0xc17f('0x0'));var util=require('util');var _=require(_0xc17f('0x1'));var squel=require('squel');var Redis=require(_0xc17f('0x2'));var qs=require(_0xc17f('0x3'));var logger=require(_0xc17f('0x4'))('api');var config=require(_0xc17f('0x5'));var db=require(_0xc17f('0x6'))['db'];config[_0xc17f('0x7')]=_['defaults'](config[_0xc17f('0x7')],{'host':_0xc17f('0x8'),'port':0x18eb});var socket=require(_0xc17f('0x9'))(new Redis(config[_0xc17f('0x7')]));require(_0xc17f('0xa'))[_0xc17f('0xb')](socket);function respondWithStatusCode(_0x377dd4,_0x2f6035){_0x2f6035=_0x2f6035||0xcc;return function(_0x39584f){if(_0x39584f){return _0x377dd4[_0xc17f('0xc')](_0x2f6035);}return _0x377dd4[_0xc17f('0xd')](_0x2f6035)[_0xc17f('0xe')]();};}function respondWithResult(_0x3a2793,_0x2888d){_0x2888d=_0x2888d||0xc8;return function(_0x268019){if(_0x268019){return _0x3a2793['status'](_0x2888d)[_0xc17f('0xf')](_0x268019);}};}function respondWithFilteredResult(_0x59ada3,_0x129660){return function(_0x433969){if(_0x433969){var _0x13d85f=typeof _0x129660['offset']===_0xc17f('0x10')&&typeof _0x129660[_0xc17f('0x11')]==='undefined';var _0x27e294=_0x433969[_0xc17f('0x12')];var _0x4e95ec=_0x13d85f?0x0:_0x129660[_0xc17f('0x13')];var _0xcb384f=_0x13d85f?_0x433969[_0xc17f('0x12')]:_0x129660[_0xc17f('0x13')]+_0x129660['limit'];var _0x72f5a3;if(_0xcb384f>=_0x27e294){_0xcb384f=_0x27e294;_0x72f5a3=0xc8;}else{_0x72f5a3=0xce;}_0x59ada3['status'](_0x72f5a3);return _0x59ada3['set'](_0xc17f('0x14'),_0x4e95ec+'-'+_0xcb384f+'/'+_0x27e294)[_0xc17f('0xf')](_0x433969);}return null;};}function saveUpdates(_0x847e84){return function(_0xbd7050){if(_0xbd7050){return _0xbd7050[_0xc17f('0x15')](_0x847e84)['then'](function(_0x146bbb){return _0x146bbb;});}return null;};}function removeEntity(_0xf4e141){return function(_0x4262d4){if(_0x4262d4){return _0x4262d4['destroy']()[_0xc17f('0x16')](function(){var _0x4b3fe6=_0x4262d4[_0xc17f('0x17')]({'plain':!![]});var _0x46b3c1='MailQueues';return db['UserProfileResource']['destroy']({'where':{'type':_0x46b3c1,'resourceId':_0x4b3fe6['id']}})['then'](function(){return _0x4262d4;});})[_0xc17f('0x16')](function(){_0xf4e141[_0xc17f('0xd')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25a97e){return function(_0x14b6c8){if(!_0x14b6c8){_0x25a97e[_0xc17f('0xc')](0x194);}return _0x14b6c8;};}function handleError(_0x66501f,_0x4a3166){_0x4a3166=_0x4a3166||0x1f4;return function(_0x5b7c8a){logger[_0xc17f('0x18')](_0x5b7c8a[_0xc17f('0x19')]);if(_0x5b7c8a[_0xc17f('0x1a')]){delete _0x5b7c8a[_0xc17f('0x1a')];}_0x66501f['status'](_0x4a3166)[_0xc17f('0x1b')](_0x5b7c8a);};}exports['index']=function(_0x571416,_0x4e9ea4){var _0x49d062={};var _0x35be0e={'count':0x0,'rows':[]};var _0x5333fd=_[_0xc17f('0x1c')](db[_0xc17f('0x1d')][_0xc17f('0x1e')],function(_0x1985c3){return{'name':_0x1985c3['fieldName'],'type':_0x1985c3[_0xc17f('0x1f')][_0xc17f('0x20')]};});_0x49d062=qs[_0xc17f('0x21')](_0x5333fd,_0x571416);var _0x5303c4={'where':_0x49d062[_0xc17f('0x22')]};return db['MailQueue'][_0xc17f('0x12')](_0x5303c4)['then'](function(_0x219d1c){_0x35be0e[_0xc17f('0x12')]=_0x219d1c;_0x49d062[_0xc17f('0x23')]=qs[_0xc17f('0x23')](_0x571416['query']);return db[_0xc17f('0x1d')][_0xc17f('0x24')](_0x49d062);})[_0xc17f('0x16')](function(_0x330856){_0x35be0e[_0xc17f('0x25')]=_0x330856;return _0x35be0e;})[_0xc17f('0x16')](respondWithFilteredResult(_0x4e9ea4,_0x49d062))[_0xc17f('0x26')](handleError(_0x4e9ea4,null));};exports['show']=function(_0x1c6be4,_0x131a6d){var _0x139af8={'raw':!![],'where':{'id':_0x1c6be4[_0xc17f('0x27')]['id']}},_0x2b20f9={};_0x2b20f9[_0xc17f('0x28')]=_['keys'](db['MailQueue'][_0xc17f('0x1e')]);_0x2b20f9[_0xc17f('0x29')]=_[_0xc17f('0x2a')](_0x1c6be4[_0xc17f('0x29')]);_0x2b20f9[_0xc17f('0x2b')]=_[_0xc17f('0x2c')](_0x2b20f9[_0xc17f('0x28')],_0x2b20f9['query']);_0x139af8[_0xc17f('0x2d')]=_[_0xc17f('0x2c')](_0x2b20f9[_0xc17f('0x28')],qs[_0xc17f('0x2e')](_0x1c6be4[_0xc17f('0x29')][_0xc17f('0x2e')]));_0x139af8[_0xc17f('0x2d')]=_0x139af8['attributes'][_0xc17f('0x2f')]?_0x139af8[_0xc17f('0x2d')]:_0x2b20f9[_0xc17f('0x28')];if(_0x1c6be4[_0xc17f('0x29')][_0xc17f('0x30')]){_0x139af8[_0xc17f('0x23')]=[{'all':!![]}];}_0x139af8=_[_0xc17f('0x31')]({},_0x139af8,_0x1c6be4[_0xc17f('0x32')]);return db[_0xc17f('0x1d')][_0xc17f('0x33')](_0x139af8)[_0xc17f('0x16')](handleEntityNotFound(_0x131a6d,null))['then'](respondWithResult(_0x131a6d,null))[_0xc17f('0x26')](handleError(_0x131a6d,null));};exports[_0xc17f('0x34')]=function(_0x5ab6cb,_0x4aa2e0){return db[_0xc17f('0x1d')][_0xc17f('0x34')](_0x5ab6cb[_0xc17f('0x35')],{})[_0xc17f('0x16')](function(_0x95c8ca){var _0x350d09=_0x5ab6cb[_0xc17f('0x36')][_0xc17f('0x17')]({'plain':!![]});if(!_0x350d09)throw new Error(_0xc17f('0x37'));if(_0x350d09['role']===_0xc17f('0x36')){var _0x2cc407=_0x95c8ca[_0xc17f('0x17')]({'plain':!![]});var _0xb57fb2=_0xc17f('0x38');return db[_0xc17f('0x39')][_0xc17f('0x33')]({'where':{'name':_0xb57fb2,'userProfileId':_0x350d09['userProfileId']},'raw':!![]})[_0xc17f('0x16')](function(_0x2f0ffc){if(_0x2f0ffc&&_0x2f0ffc['autoAssociation']===0x0){return db[_0xc17f('0x3a')][_0xc17f('0x34')]({'name':_0x2cc407[_0xc17f('0x1a')],'resourceId':_0x2cc407['id'],'type':_0x2f0ffc['name'],'sectionId':_0x2f0ffc['id']},{})['then'](function(){return _0x95c8ca;});}else{return _0x95c8ca;}})[_0xc17f('0x26')](function(_0xf5c735){logger[_0xc17f('0x18')](_0xc17f('0x3b'),_0xf5c735);throw _0xf5c735;});}return _0x95c8ca;})[_0xc17f('0x16')](respondWithResult(_0x4aa2e0,0xc9))['catch'](handleError(_0x4aa2e0,null));};exports[_0xc17f('0x15')]=function(_0x1af9ab,_0x317308){if(_0x1af9ab[_0xc17f('0x35')]['id']){delete _0x1af9ab[_0xc17f('0x35')]['id'];}return db[_0xc17f('0x1d')][_0xc17f('0x33')]({'where':{'id':_0x1af9ab['params']['id']}})['then'](handleEntityNotFound(_0x317308,null))[_0xc17f('0x16')](saveUpdates(_0x1af9ab[_0xc17f('0x35')],null))['then'](respondWithResult(_0x317308,null))['catch'](handleError(_0x317308,null));};exports[_0xc17f('0x3c')]=function(_0x4ce1d7,_0x5521c4){return db[_0xc17f('0x1d')][_0xc17f('0x33')]({'where':{'id':_0x4ce1d7['params']['id']}})[_0xc17f('0x16')](handleEntityNotFound(_0x5521c4,null))[_0xc17f('0x16')](removeEntity(_0x5521c4,null))['catch'](handleError(_0x5521c4,null));};exports[_0xc17f('0x3d')]=function(_0x24c0d7,_0x16a29f){return db[_0xc17f('0x1d')][_0xc17f('0x3d')]()['then'](respondWithResult(_0x16a29f,null))['catch'](handleError(_0x16a29f,null));};exports[_0xc17f('0x3e')]=function(_0x58c0fa,_0x5cceb3){var _0x2f0318={'raw':!![],'where':{}},_0x1d7a25={},_0x26ad41;return db[_0xc17f('0x1d')][_0xc17f('0x3f')]({'where':{'id':_0x58c0fa[_0xc17f('0x27')]['id']}})[_0xc17f('0x16')](handleEntityNotFound(_0x5cceb3,null))[_0xc17f('0x16')](function(_0x5bd34d){if(_0x5bd34d){_0x26ad41=_0x5bd34d[_0xc17f('0x17')]({'plain':!![]});_0x1d7a25['model']=_['keys'](db[_0xc17f('0x40')][_0xc17f('0x1e')]);_0x1d7a25['query']=_[_0xc17f('0x2a')](_0x58c0fa['query']);_0x1d7a25[_0xc17f('0x2b')]=_['intersection'](_0x1d7a25['model'],_0x1d7a25[_0xc17f('0x29')]);_0x2f0318['attributes']=_[_0xc17f('0x2c')](_0x1d7a25['model'],qs[_0xc17f('0x2e')](_0x58c0fa[_0xc17f('0x29')][_0xc17f('0x2e')]));_0x2f0318[_0xc17f('0x2d')]=_0x2f0318[_0xc17f('0x2d')][_0xc17f('0x2f')]?_0x2f0318[_0xc17f('0x2d')]:_0x1d7a25['model'];if(!_0x58c0fa['query'][_0xc17f('0x41')]('nolimit')){_0x2f0318[_0xc17f('0x11')]=qs[_0xc17f('0x11')](_0x58c0fa[_0xc17f('0x29')][_0xc17f('0x11')]);_0x2f0318[_0xc17f('0x13')]=qs['offset'](_0x58c0fa['query'][_0xc17f('0x13')]);}_0x2f0318[_0xc17f('0x42')]=qs[_0xc17f('0x43')](_0x58c0fa['query'][_0xc17f('0x43')]);_0x2f0318[_0xc17f('0x22')]=qs[_0xc17f('0x2b')](_[_0xc17f('0x44')](_0x58c0fa[_0xc17f('0x29')],_0x1d7a25['filters']));_0x2f0318[_0xc17f('0x22')][_0xc17f('0x45')]=_0x5bd34d['id'];if(_0x58c0fa[_0xc17f('0x29')][_0xc17f('0x46')]){_0x2f0318['where']=_['merge'](_0x2f0318['where'],{'$or':_[_0xc17f('0x1c')](_0x2f0318['attributes'],function(_0x1bbc87){var _0x4a04e8={};_0x4a04e8[_0x1bbc87]={'$like':'%'+_0x58c0fa[_0xc17f('0x29')][_0xc17f('0x46')]+'%'};return _0x4a04e8;})});}_0x2f0318=_[_0xc17f('0x31')]({},_0x2f0318,_0x58c0fa[_0xc17f('0x32')]);return db[_0xc17f('0x40')]['findAll'](_0x2f0318);}})[_0xc17f('0x16')](function(_0x3a6375){if(_0x3a6375){return db[_0xc17f('0x47')]['findAndCountAll']({'where':{'id':_[_0xc17f('0x1c')](_0x3a6375,_0xc17f('0x48')),'role':_0xc17f('0x49')},'attributes':['id','name',_0xc17f('0x4a'),_0xc17f('0x4b'),_0xc17f('0x4c')]});}})[_0xc17f('0x16')](function(_0x412932){if(_0x412932){return{'count':_0x412932[_0xc17f('0x12')],'rows':_[_0xc17f('0x1c')](_0x412932[_0xc17f('0x25')],function(_0x1daef5){return{'membername':_0x1daef5['name'],'UserId':_0x1daef5['id'],'queue_name':_0x26ad41[_0xc17f('0x1a')],'MailQueueId':_0x26ad41['id'],'interface':util[_0xc17f('0x4d')](_0xc17f('0x4e'),_0xc17f('0x4f'),_0x1daef5[_0xc17f('0x1a')]),'penalty':0x0,'paused':_0x1daef5[_0xc17f('0x4a')],'createdAt':_0x1daef5[_0xc17f('0x4c')],'updatedAt':_0x1daef5[_0xc17f('0x4b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc17f('0x16')](respondWithFilteredResult(_0x5cceb3,_0x2f0318))['catch'](handleError(_0x5cceb3,null));};exports[_0xc17f('0x50')]=function(_0x4b2f9a,_0x2216cd){var _0x2776de={};var _0x5f44d5={};var _0x218e31;var _0x33e692;return db[_0xc17f('0x1d')][_0xc17f('0x3f')]({'where':{'id':_0x4b2f9a[_0xc17f('0x27')]['id']}})[_0xc17f('0x16')](handleEntityNotFound(_0x2216cd,null))[_0xc17f('0x16')](function(_0x19e513){if(_0x19e513){_0x218e31=_0x19e513;_0x5f44d5['model']=_[_0xc17f('0x2a')](db[_0xc17f('0x51')]['rawAttributes']);_0x5f44d5[_0xc17f('0x29')]=_[_0xc17f('0x2a')](_0x4b2f9a[_0xc17f('0x29')]);_0x5f44d5[_0xc17f('0x2b')]=_[_0xc17f('0x2c')](_0x5f44d5[_0xc17f('0x28')],_0x5f44d5[_0xc17f('0x29')]);_0x2776de[_0xc17f('0x2d')]=_['intersection'](_0x5f44d5[_0xc17f('0x28')],qs[_0xc17f('0x2e')](_0x4b2f9a[_0xc17f('0x29')]['fields']));_0x2776de['attributes']=_0x2776de['attributes'][_0xc17f('0x2f')]?_0x2776de[_0xc17f('0x2d')]:_0x5f44d5[_0xc17f('0x28')];_0x2776de[_0xc17f('0x42')]=qs[_0xc17f('0x43')](_0x4b2f9a[_0xc17f('0x29')]['sort']);_0x2776de[_0xc17f('0x22')]=qs['filters'](_[_0xc17f('0x44')](_0x4b2f9a[_0xc17f('0x29')],_0x5f44d5[_0xc17f('0x2b')]));if(_0x4b2f9a[_0xc17f('0x29')][_0xc17f('0x46')]){_0x2776de[_0xc17f('0x22')]=_[_0xc17f('0x31')](_0x2776de[_0xc17f('0x22')],{'$or':_[_0xc17f('0x1c')](_0x2776de['attributes'],function(_0x492f32){var _0x17cbb5={};_0x17cbb5[_0x492f32]={'$like':'%'+_0x4b2f9a[_0xc17f('0x29')][_0xc17f('0x46')]+'%'};return _0x17cbb5;})});}_0x2776de=_['merge']({},_0x2776de,_0x4b2f9a[_0xc17f('0x32')]);return _0x218e31[_0xc17f('0x50')](_0x2776de);}})[_0xc17f('0x16')](function(_0x53482e){if(_0x53482e){_0x33e692=_0x53482e[_0xc17f('0x2f')];if(!_0x4b2f9a[_0xc17f('0x29')][_0xc17f('0x41')](_0xc17f('0x52'))){_0x2776de[_0xc17f('0x11')]=qs[_0xc17f('0x11')](_0x4b2f9a[_0xc17f('0x29')]['limit']);_0x2776de['offset']=qs[_0xc17f('0x13')](_0x4b2f9a[_0xc17f('0x29')][_0xc17f('0x13')]);}return _0x218e31[_0xc17f('0x50')](_0x2776de);}})['then'](function(_0x243b81){if(_0x243b81){return _0x243b81?{'count':_0x33e692,'rows':_0x243b81}:null;}})[_0xc17f('0x16')](respondWithResult(_0x2216cd,null))[_0xc17f('0x26')](handleError(_0x2216cd,null));};exports[_0xc17f('0x53')]=function(_0x4cac81,_0x14aa4e){var _0x362671=_0x4cac81[_0xc17f('0x35')][_0xc17f('0x54')];return db['Team'][_0xc17f('0x24')]({'where':{'id':_0x362671},'attributes':['id'],'include':[{'model':db[_0xc17f('0x47')],'as':_0xc17f('0x55'),'attributes':['id',_0xc17f('0x1a'),_0xc17f('0x56'),'voicePause',_0xc17f('0x57')],'raw':!![]}]})[_0xc17f('0x16')](function(_0x4b90ee){if(_0x4b90ee){var _0x5d5706=_[_0xc17f('0x58')](_0x4b90ee,function(_0x5010f2){var _0x464bbc=_0x5010f2['get']({'plain':!![]});return _0x464bbc[_0xc17f('0x55')];});return db['MailQueue'][_0xc17f('0x33')]({'where':{'id':_0x4cac81[_0xc17f('0x27')]['id']}})['then'](function(_0xf80141){return db['sequelize']['transaction'](function(_0x391847){return _0xf80141[_0xc17f('0x53')](_0x362671,{'transaction':_0x391847})[_0xc17f('0x16')](function(){return BPromise[_0xc17f('0x59')](_0x5d5706,function(_0x162407){return db[_0xc17f('0x40')]['findOrCreate']({'where':{'UserId':_0x162407['id'],'MailQueueId':_0x4cac81[_0xc17f('0x27')]['id']},'transaction':_0x391847});});})[_0xc17f('0x16')](function(){_0x5d5706[_0xc17f('0x5a')](function(_0x51b4e1){socket[_0xc17f('0x5b')](_0xc17f('0x5c'),{'UserId':_0x51b4e1['id'],'MailQueueId':_0xf80141['id']});});});});});}})[_0xc17f('0x16')](respondWithStatusCode(_0x14aa4e,null))[_0xc17f('0x26')](handleError(_0x14aa4e,null));};exports['removeTeams']=function(_0x3f3c9f,_0x3524c1){return db[_0xc17f('0x51')][_0xc17f('0x24')]({'where':{'id':_0x3f3c9f[_0xc17f('0x29')][_0xc17f('0x54')]},'attributes':['id'],'include':[{'model':db[_0xc17f('0x47')],'as':_0xc17f('0x55'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3524c1,null))['then'](function(_0x397e1f){var _0x1cfffa=_[_0xc17f('0x1c')](_0x397e1f,'id');var _0x3df5f9=[];var _0x51cf07=[];var _0x108276=squel[_0xc17f('0x5d')]();_0x108276[_0xc17f('0x5e')](_0xc17f('0x5f'))['from'](_0xc17f('0x60'),'tq')[_0xc17f('0x61')](_0xc17f('0x62'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xc17f('0x22')]('MailQueueId\x20=\x20?',_0x3f3c9f[_0xc17f('0x27')]['id']);for(var _0x58b4eb=0x0;_0x58b4eb<_0x397e1f[_0xc17f('0x2f')];_0x58b4eb+=0x1){let _0x4e1aa0=_0x397e1f[_0x58b4eb];for(var _0x4ab325=0x0;_0x4ab325<_0x4e1aa0[_0xc17f('0x55')]['length'];_0x4ab325+=0x1){let _0x2909bb=_0x4e1aa0[_0xc17f('0x55')][_0x4ab325];var _0x6607c1=_0x108276['clone']();_0x6607c1[_0xc17f('0x22')]('ut.UserId\x20=\x20?',_0x2909bb['id']);_0x51cf07[_0xc17f('0x63')](db[_0xc17f('0x64')][_0xc17f('0x29')](_0x6607c1[_0xc17f('0x65')](),{'type':db[_0xc17f('0x64')][_0xc17f('0x66')]['SELECT']})[_0xc17f('0x16')](function(_0x349ee5){if(_0x349ee5[_0xc17f('0x2f')]===0x1){return _0x2909bb['id'];}else{var _0x39c5c7=_[_0xc17f('0x67')](_[_0xc17f('0x1c')](_0x349ee5,'TeamId'),function(_0x2cb617){return _[_0xc17f('0x68')](_0x1cfffa,_0x2cb617);});if(_0x39c5c7){return _0x2909bb['id'];}}}));}}return BPromise[_0xc17f('0x69')](_0x51cf07)[_0xc17f('0x16')](function(_0x52d60f){_0x3df5f9=_(_0x3df5f9)[_0xc17f('0x6a')](_0x52d60f)[_0xc17f('0x6b')]()[_0xc17f('0x6c')]();return db[_0xc17f('0x1d')][_0xc17f('0x33')]({'where':{'id':_0x3f3c9f['params']['id']}})['then'](function(_0x2fb71a){return db[_0xc17f('0x64')]['transaction'](function(_0x3e066e){return _0x2fb71a[_0xc17f('0x6d')](_0x3f3c9f[_0xc17f('0x29')][_0xc17f('0x54')],{'transaction':_0x3e066e})[_0xc17f('0x16')](function(){if(!_[_0xc17f('0x6e')](_0x3df5f9)){return _0x2fb71a['removeAgents'](_0x3df5f9,{'transaction':_0x3e066e});}})[_0xc17f('0x16')](function(){_0x3df5f9['forEach'](function(_0x38a1b3){socket['emit'](_0xc17f('0x6f'),{'UserId':_0x38a1b3,'MailQueueId':_0x2fb71a['id']});});});});});});})[_0xc17f('0x16')](respondWithStatusCode(_0x3524c1,null))[_0xc17f('0x26')](handleError(_0x3524c1,null));};exports[_0xc17f('0x70')]=function(_0x542693,_0x1bd2e1){return db['MailQueue'][_0xc17f('0x33')]({'where':{'id':_0x542693['params']['id']}})['then'](handleEntityNotFound(_0x1bd2e1,null))[_0xc17f('0x16')](function(_0x5490b7){if(_0x5490b7){return _0x5490b7[_0xc17f('0x70')](_0x542693[_0xc17f('0x35')][_0xc17f('0x54')],_[_0xc17f('0x71')](_0x542693[_0xc17f('0x35')],['ids','id'])||{})[_0xc17f('0x72')](function(_0x41e71c){for(var _0x981247=0x0;_0x981247<_0x542693['body'][_0xc17f('0x54')][_0xc17f('0x2f')];_0x981247+=0x1){socket['emit'](_0xc17f('0x5c'),{'UserId':Number(_0x542693[_0xc17f('0x35')]['ids'][_0x981247]),'MailQueueId':Number(_0x542693[_0xc17f('0x27')]['id'])});}return _0x41e71c;});}})[_0xc17f('0x16')](respondWithResult(_0x1bd2e1,null))[_0xc17f('0x26')](handleError(_0x1bd2e1,null));};exports[_0xc17f('0x73')]=function(_0x6690d7,_0xfe9df4){return db['MailQueue'][_0xc17f('0x33')]({'where':{'id':_0x6690d7[_0xc17f('0x27')]['id']}})[_0xc17f('0x16')](handleEntityNotFound(_0xfe9df4,null))[_0xc17f('0x16')](function(_0x482469){if(_0x482469){return _0x482469[_0xc17f('0x73')](_0x6690d7[_0xc17f('0x29')][_0xc17f('0x54')])[_0xc17f('0x16')](function(){if(_[_0xc17f('0x74')](_0x6690d7[_0xc17f('0x29')][_0xc17f('0x54')])){for(var _0x2ac4c2=0x0;_0x2ac4c2<_0x6690d7[_0xc17f('0x29')][_0xc17f('0x54')]['length'];_0x2ac4c2+=0x1){socket[_0xc17f('0x5b')]('userMailQueue:remove',{'UserId':Number(_0x6690d7[_0xc17f('0x29')][_0xc17f('0x54')][_0x2ac4c2]),'MailQueueId':Number(_0x6690d7[_0xc17f('0x27')]['id'])});}}else{socket[_0xc17f('0x5b')]('userMailQueue:remove',{'UserId':Number(_0x6690d7['query'][_0xc17f('0x54')]),'MailQueueId':Number(_0x6690d7[_0xc17f('0x27')]['id'])});}});}})[_0xc17f('0x16')](respondWithStatusCode(_0xfe9df4,null))[_0xc17f('0x26')](handleError(_0xfe9df4,null));};exports[_0xc17f('0x75')]=function(_0x10f147,_0x3ae764){var _0x3ff464={};var _0x1bafca={};var _0x4eaf40;var _0x12ba01;return db[_0xc17f('0x1d')]['findOne']({'where':{'id':_0x10f147[_0xc17f('0x27')]['id']}})[_0xc17f('0x16')](handleEntityNotFound(_0x3ae764,null))[_0xc17f('0x16')](function(_0x11fc5b){if(_0x11fc5b){_0x4eaf40=_0x11fc5b;_0x1bafca['model']=_['keys'](db[_0xc17f('0x47')][_0xc17f('0x1e')]);_0x1bafca['query']=_[_0xc17f('0x2a')](_0x10f147[_0xc17f('0x29')]);_0x1bafca[_0xc17f('0x2b')]=_[_0xc17f('0x2c')](_0x1bafca['model'],_0x1bafca['query']);_0x3ff464[_0xc17f('0x2d')]=_[_0xc17f('0x2c')](_0x1bafca[_0xc17f('0x28')],qs[_0xc17f('0x2e')](_0x10f147[_0xc17f('0x29')][_0xc17f('0x2e')]));_0x3ff464[_0xc17f('0x2d')]=_0x3ff464[_0xc17f('0x2d')]['length']?_0x3ff464['attributes']:_0x1bafca[_0xc17f('0x28')];_0x3ff464[_0xc17f('0x42')]=qs[_0xc17f('0x43')](_0x10f147['query'][_0xc17f('0x43')]);_0x3ff464[_0xc17f('0x22')]=qs['filters'](_['pick'](_0x10f147[_0xc17f('0x29')],_0x1bafca[_0xc17f('0x2b')]));if(_0x10f147[_0xc17f('0x29')]['filter']){_0x3ff464[_0xc17f('0x22')]=_[_0xc17f('0x31')](_0x3ff464[_0xc17f('0x22')],{'$or':_[_0xc17f('0x1c')](_0x3ff464[_0xc17f('0x2d')],function(_0x31c2fe){var _0x3aea43={};_0x3aea43[_0x31c2fe]={'$like':'%'+_0x10f147[_0xc17f('0x29')]['filter']+'%'};return _0x3aea43;})});}_0x3ff464=_[_0xc17f('0x31')]({},_0x3ff464,_0x10f147[_0xc17f('0x32')]);return _0x4eaf40[_0xc17f('0x75')](_0x3ff464);}})[_0xc17f('0x16')](function(_0x3c12d8){if(_0x3c12d8){_0x12ba01=_0x3c12d8['length'];if(!_0x10f147[_0xc17f('0x29')][_0xc17f('0x41')](_0xc17f('0x52'))){_0x3ff464[_0xc17f('0x11')]=qs[_0xc17f('0x11')](_0x10f147['query'][_0xc17f('0x11')]);_0x3ff464[_0xc17f('0x13')]=qs[_0xc17f('0x13')](_0x10f147[_0xc17f('0x29')][_0xc17f('0x13')]);}return _0x4eaf40[_0xc17f('0x75')](_0x3ff464);}})[_0xc17f('0x16')](function(_0x4e71a0){if(_0x4e71a0){return _0x4e71a0?{'count':_0x12ba01,'rows':_0x4e71a0}:null;}})[_0xc17f('0x16')](respondWithResult(_0x3ae764,null))[_0xc17f('0x26')](handleError(_0x3ae764,null));}; \ No newline at end of file +var _0x28f7=['defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','update','then','UserProfileResource','destroy','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','type','key','getOptions','where','include','query','findAll','rows','catch','params','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MailQueues','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','hasOwnProperty','sort','pick','filter','User','findAndCountAll','UserId','mailPause','updatedAt','createdAt','format','SIP','getTeams','Team','order','addTeams','ids','online','voicePause','interface','flatMap','Agents','transaction','each','findOrCreate','forEach','userMailQueue:save','removeTeams','select','field','from','team_has_mail_queues','join','user_has_teams','clone','ut.UserId\x20=\x20?','push','toString','sequelize','SELECT','every','TeamId','includes','compact','isEmpty','userMailQueue:remove','addAgents','omit','spread','emit','removeAgents','getAgents','nolimit','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','redis'];(function(_0x1d2520,_0x105606){var _0x22fd54=function(_0x2c3123){while(--_0x2c3123){_0x1d2520['push'](_0x1d2520['shift']());}};_0x22fd54(++_0x105606);}(_0x28f7,0xea));var _0x728f=function(_0x1f4f18,_0x525ce3){_0x1f4f18=_0x1f4f18-0x0;var _0x73b1e4=_0x28f7[_0x1f4f18];return _0x73b1e4;};'use strict';var BPromise=require('bluebird');var util=require(_0x728f('0x0'));var _=require(_0x728f('0x1'));var squel=require(_0x728f('0x2'));var Redis=require(_0x728f('0x3'));var qs=require(_0x728f('0x4'));var logger=require(_0x728f('0x5'))(_0x728f('0x6'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x728f('0x7')]=_[_0x728f('0x8')](config['redis'],{'host':_0x728f('0x9'),'port':0x18eb});var socket=require(_0x728f('0xa'))(new Redis(config['redis']));require(_0x728f('0xb'))[_0x728f('0xc')](socket);function respondWithStatusCode(_0x2f4d00,_0x555b58){_0x555b58=_0x555b58||0xcc;return function(_0x340d4c){if(_0x340d4c){return _0x2f4d00[_0x728f('0xd')](_0x555b58);}return _0x2f4d00[_0x728f('0xe')](_0x555b58)['end']();};}function respondWithResult(_0x37dce2,_0x5e7f30){_0x5e7f30=_0x5e7f30||0xc8;return function(_0x42d1a6){if(_0x42d1a6){return _0x37dce2['status'](_0x5e7f30)[_0x728f('0xf')](_0x42d1a6);}};}function respondWithFilteredResult(_0x42f562,_0x3b2038){return function(_0x404cd6){if(_0x404cd6){var _0x577681=typeof _0x3b2038['offset']===_0x728f('0x10')&&typeof _0x3b2038['limit']==='undefined';var _0x20370e=_0x404cd6[_0x728f('0x11')];var _0x43b092=_0x577681?0x0:_0x3b2038[_0x728f('0x12')];var _0x70b34a=_0x577681?_0x404cd6[_0x728f('0x11')]:_0x3b2038[_0x728f('0x12')]+_0x3b2038[_0x728f('0x13')];var _0x1fc067;if(_0x70b34a>=_0x20370e){_0x70b34a=_0x20370e;_0x1fc067=0xc8;}else{_0x1fc067=0xce;}_0x42f562[_0x728f('0xe')](_0x1fc067);return _0x42f562[_0x728f('0x14')](_0x728f('0x15'),_0x43b092+'-'+_0x70b34a+'/'+_0x20370e)[_0x728f('0xf')](_0x404cd6);}return null;};}function saveUpdates(_0x3bf48d){return function(_0x368575){if(_0x368575){return _0x368575[_0x728f('0x16')](_0x3bf48d)[_0x728f('0x17')](function(_0x1571a6){return _0x1571a6;});}return null;};}function removeEntity(_0x371764){return function(_0x6fffe5){if(_0x6fffe5){return _0x6fffe5['destroy']()[_0x728f('0x17')](function(){var _0x1d79b9=_0x6fffe5['get']({'plain':!![]});var _0x3e3dc9='MailQueues';return db[_0x728f('0x18')][_0x728f('0x19')]({'where':{'type':_0x3e3dc9,'resourceId':_0x1d79b9['id']}})[_0x728f('0x17')](function(){return _0x6fffe5;});})[_0x728f('0x17')](function(){_0x371764[_0x728f('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe3ead9){return function(_0x5174f5){if(!_0x5174f5){_0xe3ead9[_0x728f('0xd')](0x194);}return _0x5174f5;};}function handleError(_0x251785,_0x470d8c){_0x470d8c=_0x470d8c||0x1f4;return function(_0x1b3cfe){logger['error'](_0x1b3cfe[_0x728f('0x1a')]);if(_0x1b3cfe[_0x728f('0x1b')]){delete _0x1b3cfe[_0x728f('0x1b')];}_0x251785['status'](_0x470d8c)[_0x728f('0x1c')](_0x1b3cfe);};}exports[_0x728f('0x1d')]=function(_0x490ad2,_0x4f744c){var _0x4b19a0={};var _0x36dd3f={'count':0x0,'rows':[]};var _0x1baa10=_[_0x728f('0x1e')](db[_0x728f('0x1f')][_0x728f('0x20')],function(_0x7ebbe9){return{'name':_0x7ebbe9[_0x728f('0x21')],'type':_0x7ebbe9[_0x728f('0x22')][_0x728f('0x23')]};});_0x4b19a0=qs[_0x728f('0x24')](_0x1baa10,_0x490ad2);var _0x26c18d={'where':_0x4b19a0[_0x728f('0x25')]};return db[_0x728f('0x1f')][_0x728f('0x11')](_0x26c18d)['then'](function(_0x43b235){_0x36dd3f[_0x728f('0x11')]=_0x43b235;_0x4b19a0[_0x728f('0x26')]=qs[_0x728f('0x26')](_0x490ad2[_0x728f('0x27')]);return db[_0x728f('0x1f')][_0x728f('0x28')](_0x4b19a0);})['then'](function(_0x27947c){_0x36dd3f[_0x728f('0x29')]=_0x27947c;return _0x36dd3f;})[_0x728f('0x17')](respondWithFilteredResult(_0x4f744c,_0x4b19a0))[_0x728f('0x2a')](handleError(_0x4f744c,null));};exports['show']=function(_0x210856,_0x5118a1){var _0x3ad293={'raw':!![],'where':{'id':_0x210856[_0x728f('0x2b')]['id']}},_0xac0c3b={};_0xac0c3b[_0x728f('0x2c')]=_[_0x728f('0x2d')](db[_0x728f('0x1f')][_0x728f('0x20')]);_0xac0c3b[_0x728f('0x27')]=_[_0x728f('0x2d')](_0x210856['query']);_0xac0c3b[_0x728f('0x2e')]=_[_0x728f('0x2f')](_0xac0c3b[_0x728f('0x2c')],_0xac0c3b['query']);_0x3ad293[_0x728f('0x30')]=_['intersection'](_0xac0c3b[_0x728f('0x2c')],qs[_0x728f('0x31')](_0x210856[_0x728f('0x27')]['fields']));_0x3ad293['attributes']=_0x3ad293['attributes'][_0x728f('0x32')]?_0x3ad293['attributes']:_0xac0c3b[_0x728f('0x2c')];if(_0x210856[_0x728f('0x27')][_0x728f('0x33')]){_0x3ad293['include']=[{'all':!![]}];}_0x3ad293=_[_0x728f('0x34')]({},_0x3ad293,_0x210856[_0x728f('0x35')]);return db['MailQueue']['find'](_0x3ad293)[_0x728f('0x17')](handleEntityNotFound(_0x5118a1,null))[_0x728f('0x17')](respondWithResult(_0x5118a1,null))[_0x728f('0x2a')](handleError(_0x5118a1,null));};exports['create']=function(_0x54f18b,_0x1e798b){return db['MailQueue'][_0x728f('0x36')](_0x54f18b[_0x728f('0x37')],{})['then'](function(_0x5182db){var _0x40a992=_0x54f18b['user'][_0x728f('0x38')]({'plain':!![]});if(!_0x40a992)throw new Error(_0x728f('0x39'));if(_0x40a992[_0x728f('0x3a')]==='user'){var _0x494333=_0x5182db['get']({'plain':!![]});var _0x522759=_0x728f('0x3b');return db[_0x728f('0x3c')][_0x728f('0x3d')]({'where':{'name':_0x522759,'userProfileId':_0x40a992[_0x728f('0x3e')]},'raw':!![]})[_0x728f('0x17')](function(_0x5adddf){if(_0x5adddf&&_0x5adddf['autoAssociation']===0x0){return db[_0x728f('0x18')][_0x728f('0x36')]({'name':_0x494333[_0x728f('0x1b')],'resourceId':_0x494333['id'],'type':_0x5adddf[_0x728f('0x1b')],'sectionId':_0x5adddf['id']},{})[_0x728f('0x17')](function(){return _0x5182db;});}else{return _0x5182db;}})[_0x728f('0x2a')](function(_0x411043){logger['error'](_0x728f('0x3f'),_0x411043);throw _0x411043;});}return _0x5182db;})[_0x728f('0x17')](respondWithResult(_0x1e798b,0xc9))[_0x728f('0x2a')](handleError(_0x1e798b,null));};exports['update']=function(_0x16f0ab,_0x350847){if(_0x16f0ab[_0x728f('0x37')]['id']){delete _0x16f0ab['body']['id'];}return db[_0x728f('0x1f')][_0x728f('0x3d')]({'where':{'id':_0x16f0ab[_0x728f('0x2b')]['id']}})[_0x728f('0x17')](handleEntityNotFound(_0x350847,null))[_0x728f('0x17')](saveUpdates(_0x16f0ab[_0x728f('0x37')],null))['then'](respondWithResult(_0x350847,null))['catch'](handleError(_0x350847,null));};exports['destroy']=function(_0x39f3c2,_0x16ac57){return db[_0x728f('0x1f')][_0x728f('0x3d')]({'where':{'id':_0x39f3c2[_0x728f('0x2b')]['id']}})[_0x728f('0x17')](handleEntityNotFound(_0x16ac57,null))[_0x728f('0x17')](removeEntity(_0x16ac57,null))['catch'](handleError(_0x16ac57,null));};exports['describe']=function(_0x3c92e5,_0x58f8a4){return db[_0x728f('0x1f')][_0x728f('0x40')]()['then'](respondWithResult(_0x58f8a4,null))[_0x728f('0x2a')](handleError(_0x58f8a4,null));};exports[_0x728f('0x41')]=function(_0x5f28e9,_0x279d4e){var _0x3d625f={'raw':!![],'where':{}},_0x54f6eb={},_0x3aa234;return db[_0x728f('0x1f')][_0x728f('0x42')]({'where':{'id':_0x5f28e9[_0x728f('0x2b')]['id']}})[_0x728f('0x17')](handleEntityNotFound(_0x279d4e,null))[_0x728f('0x17')](function(_0x19fac1){if(_0x19fac1){_0x3aa234=_0x19fac1[_0x728f('0x38')]({'plain':!![]});_0x54f6eb[_0x728f('0x2c')]=_[_0x728f('0x2d')](db[_0x728f('0x43')][_0x728f('0x20')]);_0x54f6eb[_0x728f('0x27')]=_[_0x728f('0x2d')](_0x5f28e9[_0x728f('0x27')]);_0x54f6eb['filters']=_[_0x728f('0x2f')](_0x54f6eb['model'],_0x54f6eb[_0x728f('0x27')]);_0x3d625f[_0x728f('0x30')]=_[_0x728f('0x2f')](_0x54f6eb[_0x728f('0x2c')],qs['fields'](_0x5f28e9['query']['fields']));_0x3d625f[_0x728f('0x30')]=_0x3d625f[_0x728f('0x30')]['length']?_0x3d625f[_0x728f('0x30')]:_0x54f6eb['model'];if(!_0x5f28e9['query'][_0x728f('0x44')]('nolimit')){_0x3d625f[_0x728f('0x13')]=qs['limit'](_0x5f28e9[_0x728f('0x27')]['limit']);_0x3d625f[_0x728f('0x12')]=qs['offset'](_0x5f28e9['query'][_0x728f('0x12')]);}_0x3d625f['order']=qs[_0x728f('0x45')](_0x5f28e9[_0x728f('0x27')][_0x728f('0x45')]);_0x3d625f['where']=qs[_0x728f('0x2e')](_[_0x728f('0x46')](_0x5f28e9['query'],_0x54f6eb[_0x728f('0x2e')]));_0x3d625f['where']['MailQueueId']=_0x19fac1['id'];if(_0x5f28e9[_0x728f('0x27')][_0x728f('0x47')]){_0x3d625f[_0x728f('0x25')]=_[_0x728f('0x34')](_0x3d625f['where'],{'$or':_[_0x728f('0x1e')](_0x3d625f['attributes'],function(_0x186c1b){var _0x81ac10={};_0x81ac10[_0x186c1b]={'$like':'%'+_0x5f28e9[_0x728f('0x27')][_0x728f('0x47')]+'%'};return _0x81ac10;})});}_0x3d625f=_['merge']({},_0x3d625f,_0x5f28e9['options']);return db['UserMailQueue'][_0x728f('0x28')](_0x3d625f);}})[_0x728f('0x17')](function(_0x5594ac){if(_0x5594ac){return db[_0x728f('0x48')][_0x728f('0x49')]({'where':{'id':_[_0x728f('0x1e')](_0x5594ac,_0x728f('0x4a')),'role':'agent'},'attributes':['id',_0x728f('0x1b'),_0x728f('0x4b'),_0x728f('0x4c'),_0x728f('0x4d')]});}})[_0x728f('0x17')](function(_0x12dc35){if(_0x12dc35){return{'count':_0x12dc35[_0x728f('0x11')],'rows':_[_0x728f('0x1e')](_0x12dc35[_0x728f('0x29')],function(_0x30620e){return{'membername':_0x30620e[_0x728f('0x1b')],'UserId':_0x30620e['id'],'queue_name':_0x3aa234[_0x728f('0x1b')],'MailQueueId':_0x3aa234['id'],'interface':util[_0x728f('0x4e')]('%s/%s',_0x728f('0x4f'),_0x30620e[_0x728f('0x1b')]),'penalty':0x0,'paused':_0x30620e[_0x728f('0x4b')],'createdAt':_0x30620e['createdAt'],'updatedAt':_0x30620e[_0x728f('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x728f('0x17')](respondWithFilteredResult(_0x279d4e,_0x3d625f))[_0x728f('0x2a')](handleError(_0x279d4e,null));};exports[_0x728f('0x50')]=function(_0x4c1f1f,_0x298f6c){var _0x4682d4={};var _0x3b6116={};var _0x3ea94f;var _0x423872;return db[_0x728f('0x1f')]['findOne']({'where':{'id':_0x4c1f1f[_0x728f('0x2b')]['id']}})[_0x728f('0x17')](handleEntityNotFound(_0x298f6c,null))[_0x728f('0x17')](function(_0x28bcce){if(_0x28bcce){_0x3ea94f=_0x28bcce;_0x3b6116[_0x728f('0x2c')]=_[_0x728f('0x2d')](db[_0x728f('0x51')][_0x728f('0x20')]);_0x3b6116['query']=_[_0x728f('0x2d')](_0x4c1f1f[_0x728f('0x27')]);_0x3b6116[_0x728f('0x2e')]=_[_0x728f('0x2f')](_0x3b6116[_0x728f('0x2c')],_0x3b6116['query']);_0x4682d4[_0x728f('0x30')]=_['intersection'](_0x3b6116['model'],qs[_0x728f('0x31')](_0x4c1f1f[_0x728f('0x27')][_0x728f('0x31')]));_0x4682d4[_0x728f('0x30')]=_0x4682d4[_0x728f('0x30')][_0x728f('0x32')]?_0x4682d4[_0x728f('0x30')]:_0x3b6116['model'];_0x4682d4[_0x728f('0x52')]=qs[_0x728f('0x45')](_0x4c1f1f['query'][_0x728f('0x45')]);_0x4682d4[_0x728f('0x25')]=qs[_0x728f('0x2e')](_[_0x728f('0x46')](_0x4c1f1f[_0x728f('0x27')],_0x3b6116[_0x728f('0x2e')]));if(_0x4c1f1f['query'][_0x728f('0x47')]){_0x4682d4[_0x728f('0x25')]=_[_0x728f('0x34')](_0x4682d4[_0x728f('0x25')],{'$or':_[_0x728f('0x1e')](_0x4682d4[_0x728f('0x30')],function(_0xd0cc20){var _0x7b8909={};_0x7b8909[_0xd0cc20]={'$like':'%'+_0x4c1f1f[_0x728f('0x27')][_0x728f('0x47')]+'%'};return _0x7b8909;})});}_0x4682d4=_[_0x728f('0x34')]({},_0x4682d4,_0x4c1f1f[_0x728f('0x35')]);return _0x3ea94f[_0x728f('0x50')](_0x4682d4);}})[_0x728f('0x17')](function(_0x2c1759){if(_0x2c1759){_0x423872=_0x2c1759['length'];if(!_0x4c1f1f[_0x728f('0x27')]['hasOwnProperty']('nolimit')){_0x4682d4[_0x728f('0x13')]=qs[_0x728f('0x13')](_0x4c1f1f[_0x728f('0x27')][_0x728f('0x13')]);_0x4682d4[_0x728f('0x12')]=qs[_0x728f('0x12')](_0x4c1f1f['query']['offset']);}return _0x3ea94f['getTeams'](_0x4682d4);}})[_0x728f('0x17')](function(_0x12496c){if(_0x12496c){return _0x12496c?{'count':_0x423872,'rows':_0x12496c}:null;}})[_0x728f('0x17')](respondWithResult(_0x298f6c,null))[_0x728f('0x2a')](handleError(_0x298f6c,null));};exports[_0x728f('0x53')]=function(_0x5ad363,_0x4c781b){var _0x478c07=_0x5ad363['body'][_0x728f('0x54')];return db['Team'][_0x728f('0x28')]({'where':{'id':_0x478c07},'attributes':['id'],'include':[{'model':db[_0x728f('0x48')],'as':'Agents','attributes':['id',_0x728f('0x1b'),_0x728f('0x55'),_0x728f('0x56'),_0x728f('0x57')],'raw':!![]}]})[_0x728f('0x17')](function(_0x360c45){if(_0x360c45){var _0x447c5b=_[_0x728f('0x58')](_0x360c45,function(_0x4dc5e1){var _0x25db78=_0x4dc5e1[_0x728f('0x38')]({'plain':!![]});return _0x25db78[_0x728f('0x59')];});return db[_0x728f('0x1f')][_0x728f('0x3d')]({'where':{'id':_0x5ad363[_0x728f('0x2b')]['id']}})[_0x728f('0x17')](function(_0x4e4d26){return db['sequelize'][_0x728f('0x5a')](function(_0x49f809){return _0x4e4d26[_0x728f('0x53')](_0x478c07,{'transaction':_0x49f809})['then'](function(){return BPromise[_0x728f('0x5b')](_0x447c5b,function(_0x393c22){return db[_0x728f('0x43')][_0x728f('0x5c')]({'where':{'UserId':_0x393c22['id'],'MailQueueId':_0x5ad363[_0x728f('0x2b')]['id']},'transaction':_0x49f809});});})['then'](function(){_0x447c5b[_0x728f('0x5d')](function(_0x321705){socket['emit'](_0x728f('0x5e'),{'UserId':_0x321705['id'],'MailQueueId':_0x4e4d26['id']});});});});});}})['then'](respondWithStatusCode(_0x4c781b,null))[_0x728f('0x2a')](handleError(_0x4c781b,null));};exports[_0x728f('0x5f')]=function(_0x1bb9b9,_0x40cb4c){return db['Team'][_0x728f('0x28')]({'where':{'id':_0x1bb9b9[_0x728f('0x27')][_0x728f('0x54')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x728f('0x59'),'attributes':['id'],'raw':!![]}]})[_0x728f('0x17')](handleEntityNotFound(_0x40cb4c,null))['then'](function(_0x5728f2){var _0x3d4305=_[_0x728f('0x1e')](_0x5728f2,'id');var _0x3ec73d=[];var _0x178145=[];var _0x246f34=squel[_0x728f('0x60')]();_0x246f34[_0x728f('0x61')]('tq.TeamId')[_0x728f('0x62')](_0x728f('0x63'),'tq')[_0x728f('0x64')](_0x728f('0x65'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('MailQueueId\x20=\x20?',_0x1bb9b9[_0x728f('0x2b')]['id']);for(var _0x5dc9a4=0x0;_0x5dc9a4<_0x5728f2[_0x728f('0x32')];_0x5dc9a4+=0x1){let _0x2d6fa5=_0x5728f2[_0x5dc9a4];for(var _0x5126d0=0x0;_0x5126d0<_0x2d6fa5[_0x728f('0x59')][_0x728f('0x32')];_0x5126d0+=0x1){let _0x3ef9eb=_0x2d6fa5[_0x728f('0x59')][_0x5126d0];var _0xdaf8e9=_0x246f34[_0x728f('0x66')]();_0xdaf8e9[_0x728f('0x25')](_0x728f('0x67'),_0x3ef9eb['id']);_0x178145[_0x728f('0x68')](db['sequelize'][_0x728f('0x27')](_0xdaf8e9[_0x728f('0x69')](),{'type':db[_0x728f('0x6a')]['QueryTypes'][_0x728f('0x6b')]})[_0x728f('0x17')](function(_0x1b1eef){if(_0x1b1eef['length']===0x1){return _0x3ef9eb['id'];}else{var _0x31b93f=_[_0x728f('0x6c')](_[_0x728f('0x1e')](_0x1b1eef,_0x728f('0x6d')),function(_0x1104cb){return _[_0x728f('0x6e')](_0x3d4305,_0x1104cb);});if(_0x31b93f){return _0x3ef9eb['id'];}}}));}}return BPromise['all'](_0x178145)['then'](function(_0x372151){_0x3ec73d=_(_0x3ec73d)['union'](_0x372151)[_0x728f('0x6f')]()['value']();return db['MailQueue'][_0x728f('0x3d')]({'where':{'id':_0x1bb9b9[_0x728f('0x2b')]['id']}})[_0x728f('0x17')](function(_0x11e149){return db[_0x728f('0x6a')][_0x728f('0x5a')](function(_0x28df23){return _0x11e149[_0x728f('0x5f')](_0x1bb9b9[_0x728f('0x27')][_0x728f('0x54')],{'transaction':_0x28df23})[_0x728f('0x17')](function(){if(!_[_0x728f('0x70')](_0x3ec73d)){return _0x11e149['removeAgents'](_0x3ec73d,{'transaction':_0x28df23});}})['then'](function(){_0x3ec73d['forEach'](function(_0x4bb3ef){socket['emit'](_0x728f('0x71'),{'UserId':_0x4bb3ef,'MailQueueId':_0x11e149['id']});});});});});});})[_0x728f('0x17')](respondWithStatusCode(_0x40cb4c,null))['catch'](handleError(_0x40cb4c,null));};exports[_0x728f('0x72')]=function(_0xdc30e3,_0x1d2379){return db[_0x728f('0x1f')][_0x728f('0x3d')]({'where':{'id':_0xdc30e3[_0x728f('0x2b')]['id']}})['then'](handleEntityNotFound(_0x1d2379,null))[_0x728f('0x17')](function(_0x517bae){if(_0x517bae){return _0x517bae[_0x728f('0x72')](_0xdc30e3['body']['ids'],_[_0x728f('0x73')](_0xdc30e3[_0x728f('0x37')],[_0x728f('0x54'),'id'])||{})[_0x728f('0x74')](function(_0x15a3b1){for(var _0x38f9b2=0x0;_0x38f9b2<_0xdc30e3['body'][_0x728f('0x54')][_0x728f('0x32')];_0x38f9b2+=0x1){socket[_0x728f('0x75')]('userMailQueue:save',{'UserId':Number(_0xdc30e3[_0x728f('0x37')][_0x728f('0x54')][_0x38f9b2]),'MailQueueId':Number(_0xdc30e3['params']['id'])});}return _0x15a3b1;});}})[_0x728f('0x17')](respondWithResult(_0x1d2379,null))[_0x728f('0x2a')](handleError(_0x1d2379,null));};exports[_0x728f('0x76')]=function(_0x199c3a,_0x46f6cd){return db[_0x728f('0x1f')][_0x728f('0x3d')]({'where':{'id':_0x199c3a[_0x728f('0x2b')]['id']}})[_0x728f('0x17')](handleEntityNotFound(_0x46f6cd,null))['then'](function(_0x5b382e){if(_0x5b382e){return _0x5b382e[_0x728f('0x76')](_0x199c3a[_0x728f('0x27')][_0x728f('0x54')])[_0x728f('0x17')](function(){if(_['isArray'](_0x199c3a[_0x728f('0x27')][_0x728f('0x54')])){for(var _0x101cff=0x0;_0x101cff<_0x199c3a[_0x728f('0x27')][_0x728f('0x54')]['length'];_0x101cff+=0x1){socket[_0x728f('0x75')](_0x728f('0x71'),{'UserId':Number(_0x199c3a[_0x728f('0x27')][_0x728f('0x54')][_0x101cff]),'MailQueueId':Number(_0x199c3a[_0x728f('0x2b')]['id'])});}}else{socket[_0x728f('0x75')](_0x728f('0x71'),{'UserId':Number(_0x199c3a['query'][_0x728f('0x54')]),'MailQueueId':Number(_0x199c3a[_0x728f('0x2b')]['id'])});}});}})['then'](respondWithStatusCode(_0x46f6cd,null))['catch'](handleError(_0x46f6cd,null));};exports[_0x728f('0x77')]=function(_0x13e66c,_0x4c331d){var _0x4d624e={};var _0x396b20={};var _0x5d6aac;var _0x7949ea;return db[_0x728f('0x1f')][_0x728f('0x42')]({'where':{'id':_0x13e66c[_0x728f('0x2b')]['id']}})['then'](handleEntityNotFound(_0x4c331d,null))[_0x728f('0x17')](function(_0x29b3ea){if(_0x29b3ea){_0x5d6aac=_0x29b3ea;_0x396b20[_0x728f('0x2c')]=_[_0x728f('0x2d')](db[_0x728f('0x48')][_0x728f('0x20')]);_0x396b20[_0x728f('0x27')]=_['keys'](_0x13e66c['query']);_0x396b20[_0x728f('0x2e')]=_[_0x728f('0x2f')](_0x396b20[_0x728f('0x2c')],_0x396b20['query']);_0x4d624e[_0x728f('0x30')]=_[_0x728f('0x2f')](_0x396b20[_0x728f('0x2c')],qs[_0x728f('0x31')](_0x13e66c[_0x728f('0x27')][_0x728f('0x31')]));_0x4d624e['attributes']=_0x4d624e[_0x728f('0x30')][_0x728f('0x32')]?_0x4d624e[_0x728f('0x30')]:_0x396b20[_0x728f('0x2c')];_0x4d624e['order']=qs[_0x728f('0x45')](_0x13e66c[_0x728f('0x27')][_0x728f('0x45')]);_0x4d624e[_0x728f('0x25')]=qs[_0x728f('0x2e')](_[_0x728f('0x46')](_0x13e66c[_0x728f('0x27')],_0x396b20[_0x728f('0x2e')]));if(_0x13e66c[_0x728f('0x27')][_0x728f('0x47')]){_0x4d624e[_0x728f('0x25')]=_[_0x728f('0x34')](_0x4d624e[_0x728f('0x25')],{'$or':_[_0x728f('0x1e')](_0x4d624e['attributes'],function(_0x3a101e){var _0x330272={};_0x330272[_0x3a101e]={'$like':'%'+_0x13e66c[_0x728f('0x27')][_0x728f('0x47')]+'%'};return _0x330272;})});}_0x4d624e=_[_0x728f('0x34')]({},_0x4d624e,_0x13e66c[_0x728f('0x35')]);return _0x5d6aac['getAgents'](_0x4d624e);}})[_0x728f('0x17')](function(_0x389918){if(_0x389918){_0x7949ea=_0x389918['length'];if(!_0x13e66c['query'][_0x728f('0x44')](_0x728f('0x78'))){_0x4d624e[_0x728f('0x13')]=qs['limit'](_0x13e66c[_0x728f('0x27')][_0x728f('0x13')]);_0x4d624e[_0x728f('0x12')]=qs['offset'](_0x13e66c[_0x728f('0x27')][_0x728f('0x12')]);}return _0x5d6aac[_0x728f('0x77')](_0x4d624e);}})[_0x728f('0x17')](function(_0x28b8ac){if(_0x28b8ac){return _0x28b8ac?{'count':_0x7949ea,'rows':_0x28b8ac}:null;}})[_0x728f('0x17')](respondWithResult(_0x4c331d,null))[_0x728f('0x2a')](handleError(_0x4c331d,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index edd84c6..c58be10 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 _0x5383=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x5383,0x112));var _0x3538=function(_0x3996ca,_0x26cc41){_0x3996ca=_0x3996ca-0x0;var _0x4a2817=_0x5383[_0x3996ca];return _0x4a2817;};'use strict';var EventEmitter=require(_0x3538('0x0'));var MailQueue=require(_0x3538('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x3538('0x2')](0x0);var events={'afterCreate':_0x3538('0x3'),'afterUpdate':_0x3538('0x4'),'afterDestroy':_0x3538('0x5')};function emitEvent(_0x58f00a){return function(_0x28ce4e,_0x1616c1,_0x53311b){MailQueueEvents['emit'](_0x58f00a+':'+_0x28ce4e['id'],_0x28ce4e);MailQueueEvents[_0x3538('0x6')](_0x58f00a,_0x28ce4e);_0x53311b(null);};}for(var e in events){if(events[_0x3538('0x7')](e)){var event=events[e];MailQueue[_0x3538('0x8')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file +var _0xc0c2=['exports','events','../../mysqldb','MailQueue','setMaxListeners','remove','emit'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc0c2,0x151));var _0x2c0c=function(_0x533e4e,_0x4eba54){_0x533e4e=_0x533e4e-0x0;var _0x1f14bb=_0xc0c2[_0x533e4e];return _0x1f14bb;};'use strict';var EventEmitter=require(_0x2c0c('0x0'));var MailQueue=require(_0x2c0c('0x1'))['db'][_0x2c0c('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x2c0c('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x2c0c('0x4')};function emitEvent(_0x265dff){return function(_0xab4efb,_0x27b0cf,_0x46dc27){MailQueueEvents['emit'](_0x265dff+':'+_0xab4efb['id'],_0xab4efb);MailQueueEvents[_0x2c0c('0x5')](_0x265dff,_0xab4efb);_0x46dc27(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0x2c0c('0x6')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 5cd6da0..f56e20d 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 _0xc851=['bluebird','request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','define','MailQueue','mail_queues','lodash','util','../../config/logger','api','moment'];(function(_0x6d1f2,_0x38c55b){var _0x247f90=function(_0x4f8772){while(--_0x4f8772){_0x6d1f2['push'](_0x6d1f2['shift']());}};_0x247f90(++_0x38c55b);}(_0xc851,0x191));var _0x1c85=function(_0x5c1217,_0x1083a9){_0x5c1217=_0x5c1217-0x0;var _0x44106e=_0xc851[_0x5c1217];return _0x44106e;};'use strict';var _=require(_0x1c85('0x0'));var util=require(_0x1c85('0x1'));var logger=require(_0x1c85('0x2'))(_0x1c85('0x3'));var moment=require(_0x1c85('0x4'));var BPromise=require(_0x1c85('0x5'));var rp=require(_0x1c85('0x6'));var fs=require('fs');var path=require(_0x1c85('0x7'));var rimraf=require(_0x1c85('0x8'));var config=require(_0x1c85('0x9'));var attributes=require(_0x1c85('0xa'));module['exports']=function(_0x146551,_0x46b2af){return _0x146551[_0x1c85('0xb')](_0x1c85('0xc'),attributes,{'tableName':_0x1c85('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf807=['rimraf','./mailQueue.attributes','exports','define','MailQueue','mail_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0xf807,0x1cd));var _0x7f80=function(_0x487a0b,_0x33c302){_0x487a0b=_0x487a0b-0x0;var _0x4cb1ba=_0xf807[_0x487a0b];return _0x4cb1ba;};'use strict';var _=require(_0x7f80('0x0'));var util=require(_0x7f80('0x1'));var logger=require(_0x7f80('0x2'))(_0x7f80('0x3'));var moment=require(_0x7f80('0x4'));var BPromise=require(_0x7f80('0x5'));var rp=require(_0x7f80('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7f80('0x7'));var config=require('../../config/environment');var attributes=require(_0x7f80('0x8'));module[_0x7f80('0x9')]=function(_0x13f9b4,_0x49ec50){return _0x13f9b4[_0x7f80('0xa')](_0x7f80('0xb'),attributes,{'tableName':_0x7f80('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index 46ec491..fc8b5a3 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 _0x2fe3=['code','MailQueue,\x20%s,\x20%s','message','result','catch','MailQueue','findAll','raw','options','where','attributes','limit','include','model','map','GetMailQueue','ShowMailQueue','find','lodash','util','randomstring','../../mysqldb','rpc','../../config/environment','client','http','redis','defaults','localhost','./mailQueue.socket','register','request','then','info','debug','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x2abc64,_0x1c55a9){var _0x4a87d3=function(_0x4183e3){while(--_0x4183e3){_0x2abc64['push'](_0x2abc64['shift']());}};_0x4a87d3(++_0x1c55a9);}(_0x2fe3,0x87));var _0x32fe=function(_0x550aaa,_0xbfe26c){_0x550aaa=_0x550aaa-0x0;var _0x40e5e6=_0x2fe3[_0x550aaa];return _0x40e5e6;};'use strict';var _=require(_0x32fe('0x0'));var util=require(_0x32fe('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x32fe('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x32fe('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x32fe('0x4'));var config=require(_0x32fe('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x32fe('0x6')][_0x32fe('0x7')]({'port':0x232a});config[_0x32fe('0x8')]=_[_0x32fe('0x9')](config[_0x32fe('0x8')],{'host':_0x32fe('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x32fe('0x8')]));require(_0x32fe('0xb'))[_0x32fe('0xc')](socket);function respondWithRpcPromise(_0x2b9bb7,_0x47abd9,_0x5448d8){return new BPromise(function(_0x3b2d24,_0x37b3ae){return client[_0x32fe('0xd')](_0x2b9bb7,_0x5448d8)[_0x32fe('0xe')](function(_0x501ddd){logger[_0x32fe('0xf')]('MailQueue,\x20%s,\x20%s',_0x47abd9,'request\x20sent');logger[_0x32fe('0x10')](_0x32fe('0x11'),_0x47abd9,_0x32fe('0x12'),JSON[_0x32fe('0x13')](_0x501ddd));if(_0x501ddd[_0x32fe('0x14')]){if(_0x501ddd[_0x32fe('0x14')][_0x32fe('0x15')]===0x1f4){logger[_0x32fe('0x14')](_0x32fe('0x16'),_0x47abd9,_0x501ddd[_0x32fe('0x14')][_0x32fe('0x17')]);return _0x37b3ae(_0x501ddd[_0x32fe('0x14')][_0x32fe('0x17')]);}logger[_0x32fe('0x14')](_0x32fe('0x16'),_0x47abd9,_0x501ddd['error']['message']);return _0x3b2d24(_0x501ddd[_0x32fe('0x14')][_0x32fe('0x17')]);}else{logger['info'](_0x32fe('0x16'),_0x47abd9,_0x32fe('0x12'));_0x3b2d24(_0x501ddd[_0x32fe('0x18')]['message']);}})[_0x32fe('0x19')](function(_0xb7ac89){logger[_0x32fe('0x14')](_0x32fe('0x16'),_0x47abd9,_0xb7ac89);_0x37b3ae(_0xb7ac89);});});}exports['GetMailQueue']=function(_0x26a555){var _0x4881cf=this;return new Promise(function(_0xd5a771,_0x2702ad){return db[_0x32fe('0x1a')][_0x32fe('0x1b')]({'raw':_0x26a555['options']?_0x26a555['options'][_0x32fe('0x1c')]===undefined?!![]:![]:!![],'where':_0x26a555[_0x32fe('0x1d')]?_0x26a555[_0x32fe('0x1d')][_0x32fe('0x1e')]||null:null,'attributes':_0x26a555[_0x32fe('0x1d')]?_0x26a555[_0x32fe('0x1d')][_0x32fe('0x1f')]||null:null,'limit':_0x26a555[_0x32fe('0x1d')]?_0x26a555['options'][_0x32fe('0x20')]||null:null,'include':_0x26a555['options']?_0x26a555[_0x32fe('0x1d')][_0x32fe('0x21')]?_['map'](_0x26a555[_0x32fe('0x1d')][_0x32fe('0x21')],function(_0x84f0c4){return{'model':db[_0x84f0c4[_0x32fe('0x22')]],'as':_0x84f0c4['as'],'attributes':_0x84f0c4['attributes'],'include':_0x84f0c4['include']?_[_0x32fe('0x23')](_0x84f0c4['include'],function(_0x5e20ac){return{'model':db[_0x5e20ac[_0x32fe('0x22')]],'as':_0x5e20ac['as'],'attributes':_0x5e20ac['attributes'],'include':_0x5e20ac[_0x32fe('0x21')]?_[_0x32fe('0x23')](_0x5e20ac[_0x32fe('0x21')],function(_0x382242){return{'model':db[_0x382242['model']],'as':_0x382242['as'],'attributes':_0x382242[_0x32fe('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xcd74fa){logger['info']('GetMailQueue',_0x26a555);logger[_0x32fe('0x10')]('GetMailQueue',_0x26a555,JSON[_0x32fe('0x13')](_0xcd74fa));_0xd5a771(_0xcd74fa);})['catch'](function(_0x231b06){logger[_0x32fe('0x14')](_0x32fe('0x24'),_0x231b06[_0x32fe('0x17')],_0x26a555);_0x2702ad(_0x4881cf[_0x32fe('0x14')](0x1f4,_0x231b06[_0x32fe('0x17')]));});});};exports[_0x32fe('0x25')]=function(_0x1c42cb){var _0x3559c0=this;return new Promise(function(_0x5f5869,_0x3c6a22){return db[_0x32fe('0x1a')][_0x32fe('0x26')]({'raw':_0x1c42cb['options']?_0x1c42cb[_0x32fe('0x1d')][_0x32fe('0x1c')]===undefined?!![]:![]:!![],'where':_0x1c42cb[_0x32fe('0x1d')]?_0x1c42cb[_0x32fe('0x1d')][_0x32fe('0x1e')]||null:null,'attributes':_0x1c42cb['options']?_0x1c42cb['options'][_0x32fe('0x1f')]||null:null,'include':_0x1c42cb[_0x32fe('0x1d')]?_0x1c42cb['options'][_0x32fe('0x21')]?_[_0x32fe('0x23')](_0x1c42cb[_0x32fe('0x1d')][_0x32fe('0x21')],function(_0x35b8a0){return{'model':db[_0x35b8a0[_0x32fe('0x22')]],'as':_0x35b8a0['as'],'attributes':_0x35b8a0['attributes'],'include':_0x35b8a0[_0x32fe('0x21')]?_[_0x32fe('0x23')](_0x35b8a0['include'],function(_0x34fd3c){return{'model':db[_0x34fd3c[_0x32fe('0x22')]],'as':_0x34fd3c['as'],'attributes':_0x34fd3c[_0x32fe('0x1f')],'include':_0x34fd3c[_0x32fe('0x21')]?_[_0x32fe('0x23')](_0x34fd3c[_0x32fe('0x21')],function(_0x28ac9d){return{'model':db[_0x28ac9d[_0x32fe('0x22')]],'as':_0x28ac9d['as'],'attributes':_0x28ac9d[_0x32fe('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x32fe('0xe')](function(_0x900870){logger[_0x32fe('0xf')]('ShowMailQueue',_0x1c42cb);logger[_0x32fe('0x10')]('ShowMailQueue',_0x1c42cb,JSON['stringify'](_0x900870));_0x5f5869(_0x900870);})[_0x32fe('0x19')](function(_0x41d7b2){logger[_0x32fe('0x14')]('ShowMailQueue',_0x41d7b2[_0x32fe('0x17')],_0x1c42cb);_0x3c6a22(_0x3559c0['error'](0x1f4,_0x41d7b2[_0x32fe('0x17')]));});});}; \ No newline at end of file +var _0xfacc=['error','message','result','catch','GetMailQueue','MailQueue','findAll','options','raw','where','attributes','limit','map','include','model','stringify','ShowMailQueue','find','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s'];(function(_0x3aacd1,_0x13b72e){var _0xec5062=function(_0x3ddaad){while(--_0x3ddaad){_0x3aacd1['push'](_0x3aacd1['shift']());}};_0xec5062(++_0x13b72e);}(_0xfacc,0x8a));var _0xcfac=function(_0x4d5e00,_0x4d3c5d){_0x4d5e00=_0x4d5e00-0x0;var _0x3fe9b2=_0xfacc[_0x4d5e00];return _0x3fe9b2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xcfac('0x0'));var BPromise=require(_0xcfac('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcfac('0x2'));var db=require(_0xcfac('0x3'))['db'];var utils=require(_0xcfac('0x4'));var logger=require(_0xcfac('0x5'))('rpc');var config=require(_0xcfac('0x6'));var jayson=require(_0xcfac('0x7'));var client=jayson[_0xcfac('0x8')]['http']({'port':0x232a});config['redis']=_[_0xcfac('0x9')](config['redis'],{'host':_0xcfac('0xa'),'port':0x18eb});var socket=require(_0xcfac('0xb'))(new Redis(config[_0xcfac('0xc')]));require(_0xcfac('0xd'))[_0xcfac('0xe')](socket);function respondWithRpcPromise(_0x4cdc99,_0x5c2f9d,_0x1dfab3){return new BPromise(function(_0x4645ed,_0x366bd8){return client[_0xcfac('0xf')](_0x4cdc99,_0x1dfab3)[_0xcfac('0x10')](function(_0x1736d8){logger[_0xcfac('0x11')](_0xcfac('0x12'),_0x5c2f9d,_0xcfac('0x13'));logger[_0xcfac('0x14')](_0xcfac('0x15'),_0x5c2f9d,_0xcfac('0x13'),JSON['stringify'](_0x1736d8));if(_0x1736d8[_0xcfac('0x16')]){if(_0x1736d8[_0xcfac('0x16')]['code']===0x1f4){logger[_0xcfac('0x16')](_0xcfac('0x12'),_0x5c2f9d,_0x1736d8[_0xcfac('0x16')][_0xcfac('0x17')]);return _0x366bd8(_0x1736d8['error'][_0xcfac('0x17')]);}logger[_0xcfac('0x16')](_0xcfac('0x12'),_0x5c2f9d,_0x1736d8[_0xcfac('0x16')]['message']);return _0x4645ed(_0x1736d8[_0xcfac('0x16')][_0xcfac('0x17')]);}else{logger['info'](_0xcfac('0x12'),_0x5c2f9d,_0xcfac('0x13'));_0x4645ed(_0x1736d8[_0xcfac('0x18')][_0xcfac('0x17')]);}})[_0xcfac('0x19')](function(_0x143187){logger[_0xcfac('0x16')](_0xcfac('0x12'),_0x5c2f9d,_0x143187);_0x366bd8(_0x143187);});});}exports[_0xcfac('0x1a')]=function(_0x59168a){var _0x426126=this;return new Promise(function(_0x36bc98,_0x10228b){return db[_0xcfac('0x1b')][_0xcfac('0x1c')]({'raw':_0x59168a[_0xcfac('0x1d')]?_0x59168a[_0xcfac('0x1d')][_0xcfac('0x1e')]===undefined?!![]:![]:!![],'where':_0x59168a[_0xcfac('0x1d')]?_0x59168a[_0xcfac('0x1d')][_0xcfac('0x1f')]||null:null,'attributes':_0x59168a[_0xcfac('0x1d')]?_0x59168a['options'][_0xcfac('0x20')]||null:null,'limit':_0x59168a[_0xcfac('0x1d')]?_0x59168a[_0xcfac('0x1d')][_0xcfac('0x21')]||null:null,'include':_0x59168a[_0xcfac('0x1d')]?_0x59168a[_0xcfac('0x1d')]['include']?_[_0xcfac('0x22')](_0x59168a[_0xcfac('0x1d')][_0xcfac('0x23')],function(_0x45f028){return{'model':db[_0x45f028[_0xcfac('0x24')]],'as':_0x45f028['as'],'attributes':_0x45f028[_0xcfac('0x20')],'include':_0x45f028['include']?_[_0xcfac('0x22')](_0x45f028[_0xcfac('0x23')],function(_0x2d89be){return{'model':db[_0x2d89be[_0xcfac('0x24')]],'as':_0x2d89be['as'],'attributes':_0x2d89be[_0xcfac('0x20')],'include':_0x2d89be[_0xcfac('0x23')]?_[_0xcfac('0x22')](_0x2d89be['include'],function(_0x5b71a4){return{'model':db[_0x5b71a4[_0xcfac('0x24')]],'as':_0x5b71a4['as'],'attributes':_0x5b71a4[_0xcfac('0x20')]};}):[]};}):[]};}):[]:[]})[_0xcfac('0x10')](function(_0x4f8ee2){logger[_0xcfac('0x11')](_0xcfac('0x1a'),_0x59168a);logger['debug'](_0xcfac('0x1a'),_0x59168a,JSON[_0xcfac('0x25')](_0x4f8ee2));_0x36bc98(_0x4f8ee2);})[_0xcfac('0x19')](function(_0x495e96){logger[_0xcfac('0x16')]('GetMailQueue',_0x495e96[_0xcfac('0x17')],_0x59168a);_0x10228b(_0x426126[_0xcfac('0x16')](0x1f4,_0x495e96[_0xcfac('0x17')]));});});};exports[_0xcfac('0x26')]=function(_0x284f5a){var _0x363777=this;return new Promise(function(_0x4c8df0,_0x59ddcb){return db[_0xcfac('0x1b')][_0xcfac('0x27')]({'raw':_0x284f5a[_0xcfac('0x1d')]?_0x284f5a[_0xcfac('0x1d')][_0xcfac('0x1e')]===undefined?!![]:![]:!![],'where':_0x284f5a[_0xcfac('0x1d')]?_0x284f5a[_0xcfac('0x1d')][_0xcfac('0x1f')]||null:null,'attributes':_0x284f5a[_0xcfac('0x1d')]?_0x284f5a[_0xcfac('0x1d')]['attributes']||null:null,'include':_0x284f5a[_0xcfac('0x1d')]?_0x284f5a[_0xcfac('0x1d')]['include']?_['map'](_0x284f5a[_0xcfac('0x1d')][_0xcfac('0x23')],function(_0x580e51){return{'model':db[_0x580e51[_0xcfac('0x24')]],'as':_0x580e51['as'],'attributes':_0x580e51[_0xcfac('0x20')],'include':_0x580e51[_0xcfac('0x23')]?_[_0xcfac('0x22')](_0x580e51[_0xcfac('0x23')],function(_0x2aea2f){return{'model':db[_0x2aea2f[_0xcfac('0x24')]],'as':_0x2aea2f['as'],'attributes':_0x2aea2f[_0xcfac('0x20')],'include':_0x2aea2f['include']?_[_0xcfac('0x22')](_0x2aea2f[_0xcfac('0x23')],function(_0x15ad04){return{'model':db[_0x15ad04[_0xcfac('0x24')]],'as':_0x15ad04['as'],'attributes':_0x15ad04['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x47b737){logger[_0xcfac('0x11')](_0xcfac('0x26'),_0x284f5a);logger['debug'](_0xcfac('0x26'),_0x284f5a,JSON[_0xcfac('0x25')](_0x47b737));_0x4c8df0(_0x47b737);})['catch'](function(_0x2b30be){logger['error'](_0xcfac('0x26'),_0x2b30be[_0xcfac('0x17')],_0x284f5a);_0x59ddcb(_0x363777[_0xcfac('0x16')](0x1f4,_0x2b30be[_0xcfac('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index e4ea110..ca43a5b 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 _0xaec0=['./mailQueue.events','save','remove','update','emit','register','length','mailQueue:'];(function(_0x3d6e69,_0x5abbf3){var _0x230335=function(_0x1ff08b){while(--_0x1ff08b){_0x3d6e69['push'](_0x3d6e69['shift']());}};_0x230335(++_0x5abbf3);}(_0xaec0,0x100));var _0x0aec=function(_0xce0317,_0x5d4e5c){_0xce0317=_0xce0317-0x0;var _0x42dc95=_0xaec0[_0xce0317];return _0x42dc95;};'use strict';var MailQueueEvents=require(_0x0aec('0x0'));var events=[_0x0aec('0x1'),_0x0aec('0x2'),_0x0aec('0x3')];function createListener(_0x27dadc,_0x37456f){return function(_0x449a1a){_0x37456f[_0x0aec('0x4')](_0x27dadc,_0x449a1a);};}function removeListener(_0x2900c4,_0x6a5eaf){return function(){MailQueueEvents['removeListener'](_0x2900c4,_0x6a5eaf);};}exports[_0x0aec('0x5')]=function(_0x10bbc6){for(var _0x543b2a=0x0,_0x58b424=events[_0x0aec('0x6')];_0x543b2a<_0x58b424;_0x543b2a++){var _0x531221=events[_0x543b2a];var _0x4eba45=createListener(_0x0aec('0x7')+_0x531221,_0x10bbc6);MailQueueEvents['on'](_0x531221,_0x4eba45);}}; \ No newline at end of file +var _0xc125=['save','update','emit','removeListener','length','mailQueue:','./mailQueue.events'];(function(_0x12c280,_0x51dd07){var _0x3638d3=function(_0x53b273){while(--_0x53b273){_0x12c280['push'](_0x12c280['shift']());}};_0x3638d3(++_0x51dd07);}(_0xc125,0x19c));var _0x5c12=function(_0x582467,_0x553c42){_0x582467=_0x582467-0x0;var _0x1919a0=_0xc125[_0x582467];return _0x1919a0;};'use strict';var MailQueueEvents=require(_0x5c12('0x0'));var events=[_0x5c12('0x1'),'remove',_0x5c12('0x2')];function createListener(_0x70a5db,_0x4a568c){return function(_0x16aced){_0x4a568c[_0x5c12('0x3')](_0x70a5db,_0x16aced);};}function removeListener(_0x2a26bc,_0x5ae246){return function(){MailQueueEvents[_0x5c12('0x4')](_0x2a26bc,_0x5ae246);};}exports['register']=function(_0x221d83){for(var _0x4bfd21=0x0,_0x22bff5=events[_0x5c12('0x5')];_0x4bfd21<_0x22bff5;_0x4bfd21++){var _0x19d2a0=events[_0x4bfd21];var _0x4853fc=createListener(_0x5c12('0x6')+_0x19d2a0,_0x221d83);MailQueueEvents['on'](_0x19d2a0,_0x4853fc);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 481892e..0b920c5 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 _0x4b1f=['index','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated'];(function(_0xb06499,_0x41d817){var _0x6afa46=function(_0x49cd4a){while(--_0x49cd4a){_0xb06499['push'](_0xb06499['shift']());}};_0x6afa46(++_0x41d817);}(_0x4b1f,0xe7));var _0xf4b1=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x4b1f[_0x1203f];return _0x365f0a;};'use strict';var multer=require('multer');var util=require(_0xf4b1('0x0'));var path=require(_0xf4b1('0x1'));var timeout=require(_0xf4b1('0x2'));var express=require(_0xf4b1('0x3'));var router=express['Router']();var fs_extra=require(_0xf4b1('0x4'));var auth=require(_0xf4b1('0x5'));var interaction=require(_0xf4b1('0x6'));var config=require(_0xf4b1('0x7'));var controller=require(_0xf4b1('0x8'));router[_0xf4b1('0x9')]('/',auth[_0xf4b1('0xa')](),controller[_0xf4b1('0xb')]);router[_0xf4b1('0x9')](_0xf4b1('0xc'),auth[_0xf4b1('0xa')](),controller[_0xf4b1('0xd')]);router[_0xf4b1('0x9')](_0xf4b1('0xe'),auth[_0xf4b1('0xa')](),controller[_0xf4b1('0xf')]);router[_0xf4b1('0x10')]('/',auth[_0xf4b1('0xa')](),controller[_0xf4b1('0x11')]);router[_0xf4b1('0x12')](_0xf4b1('0xe'),auth[_0xf4b1('0xa')](),controller['update']);router[_0xf4b1('0x13')](_0xf4b1('0xe'),auth[_0xf4b1('0xa')](),controller[_0xf4b1('0x14')]);module[_0xf4b1('0x15')]=router; \ No newline at end of file +var _0x4bc5=['describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./mailQueueReport.controller','get','isAuthenticated','index','/describe'];(function(_0x46c318,_0x3a5b3f){var _0x143050=function(_0x38a645){while(--_0x38a645){_0x46c318['push'](_0x46c318['shift']());}};_0x143050(++_0x3a5b3f);}(_0x4bc5,0x11b));var _0x54bc=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0x4bc5[_0x2d34d6];return _0x1d3d12;};'use strict';var multer=require(_0x54bc('0x0'));var util=require('util');var path=require(_0x54bc('0x1'));var timeout=require(_0x54bc('0x2'));var express=require(_0x54bc('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x54bc('0x4'));var interaction=require(_0x54bc('0x5'));var config=require('../../config/environment');var controller=require(_0x54bc('0x6'));router[_0x54bc('0x7')]('/',auth[_0x54bc('0x8')](),controller[_0x54bc('0x9')]);router[_0x54bc('0x7')](_0x54bc('0xa'),auth[_0x54bc('0x8')](),controller[_0x54bc('0xb')]);router['get'](_0x54bc('0xc'),auth['isAuthenticated'](),controller[_0x54bc('0xd')]);router[_0x54bc('0xe')]('/',auth['isAuthenticated'](),controller[_0x54bc('0xf')]);router[_0x54bc('0x10')](_0x54bc('0xc'),auth[_0x54bc('0x8')](),controller[_0x54bc('0x11')]);router[_0x54bc('0x12')]('/:id',auth[_0x54bc('0x8')](),controller[_0x54bc('0x13')]);module[_0x54bc('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index bb8709c..adbd847 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 _0x9561=['exports','STRING','DATE','moment','sequelize'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x9561,0x17f));var _0x1956=function(_0x23d7a7,_0x4b0f57){_0x23d7a7=_0x23d7a7-0x0;var _0x43f390=_0x9561[_0x23d7a7];return _0x43f390;};'use strict';var moment=require(_0x1956('0x0'));var Sequelize=require(_0x1956('0x1'));module[_0x1956('0x2')]={'uniqueid':{'type':Sequelize[_0x1956('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x1956('0x3')]},'joinAt':{'type':Sequelize[_0x1956('0x4')]},'leaveAt':{'type':Sequelize[_0x1956('0x4')]},'acceptAt':{'type':Sequelize[_0x1956('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x1956('0x3')]}}; \ No newline at end of file +var _0xf220=['exports','STRING','DATE','sequelize'];(function(_0x16f6f6,_0x5d6f57){var _0x15d80a=function(_0x3876d2){while(--_0x3876d2){_0x16f6f6['push'](_0x16f6f6['shift']());}};_0x15d80a(++_0x5d6f57);}(_0xf220,0x113));var _0x0f22=function(_0x305351,_0x36103c){_0x305351=_0x305351-0x0;var _0x16a638=_0xf220[_0x305351];return _0x16a638;};'use strict';var moment=require('moment');var Sequelize=require(_0x0f22('0x0'));module[_0x0f22('0x1')]={'uniqueid':{'type':Sequelize[_0x0f22('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x0f22('0x2')]},'joinAt':{'type':Sequelize[_0x0f22('0x3')]},'leaveAt':{'type':Sequelize[_0x0f22('0x3')]},'acceptAt':{'type':Sequelize[_0x0f22('0x3')]},'exitAt':{'type':Sequelize[_0x0f22('0x3')]},'reason':{'type':Sequelize[_0x0f22('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index d288d53..073259a 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 _0x6a95=['query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','filter','where','merge','options','MailQueueReport','includeAll','include','findAll','rows','show','length','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','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','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','model'];(function(_0x287a47,_0x2f731c){var _0x3fb726=function(_0xbedc33){while(--_0xbedc33){_0x287a47['push'](_0x287a47['shift']());}};_0x3fb726(++_0x2f731c);}(_0x6a95,0x1db));var _0x56a9=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0x6a95[_0x1c546c];return _0x2cc384;};'use strict';var emlformat=require(_0x56a9('0x0'));var rimraf=require(_0x56a9('0x1'));var zipdir=require(_0x56a9('0x2'));var jsonpatch=require(_0x56a9('0x3'));var rp=require(_0x56a9('0x4'));var moment=require(_0x56a9('0x5'));var BPromise=require(_0x56a9('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x56a9('0x7'));var sox=require(_0x56a9('0x8'));var csv=require(_0x56a9('0x9'));var ejs=require(_0x56a9('0xa'));var fs=require('fs');var fs_extra=require(_0x56a9('0xb'));var _=require(_0x56a9('0xc'));var squel=require(_0x56a9('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x56a9('0xe'));var toCsv=require(_0x56a9('0x9'));var querystring=require('querystring');var Papa=require(_0x56a9('0xf'));var Redis=require(_0x56a9('0x10'));var authService=require(_0x56a9('0x11'));var qs=require(_0x56a9('0x12'));var as=require(_0x56a9('0x13'));var hardwareService=require(_0x56a9('0x14'));var logger=require(_0x56a9('0x15'))(_0x56a9('0x16'));var utils=require(_0x56a9('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x56a9('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b2c7f,_0x4552ce){_0x4552ce=_0x4552ce||0xcc;return function(_0x420667){if(_0x420667){return _0x2b2c7f[_0x56a9('0x19')](_0x4552ce);}return _0x2b2c7f[_0x56a9('0x1a')](_0x4552ce)[_0x56a9('0x1b')]();};}function respondWithResult(_0x124ab8,_0x1a2eb4){_0x1a2eb4=_0x1a2eb4||0xc8;return function(_0x40b2cb){if(_0x40b2cb){return _0x124ab8['status'](_0x1a2eb4)['json'](_0x40b2cb);}};}function respondWithFilteredResult(_0x2e0dfd,_0x2a0714){return function(_0x42007b){if(_0x42007b){var _0x46f854=typeof _0x2a0714['offset']===_0x56a9('0x1c')&&typeof _0x2a0714['limit']==='undefined';var _0x4e292f=_0x42007b[_0x56a9('0x1d')];var _0x576bdf=_0x46f854?0x0:_0x2a0714[_0x56a9('0x1e')];var _0x105fe5=_0x46f854?_0x42007b[_0x56a9('0x1d')]:_0x2a0714[_0x56a9('0x1e')]+_0x2a0714[_0x56a9('0x1f')];var _0xbfeb1a;if(_0x105fe5>=_0x4e292f){_0x105fe5=_0x4e292f;_0xbfeb1a=0xc8;}else{_0xbfeb1a=0xce;}_0x2e0dfd[_0x56a9('0x1a')](_0xbfeb1a);return _0x2e0dfd[_0x56a9('0x20')](_0x56a9('0x21'),_0x576bdf+'-'+_0x105fe5+'/'+_0x4e292f)[_0x56a9('0x22')](_0x42007b);}return null;};}function patchUpdates(_0x5f145f){return function(_0x5bc03a){try{jsonpatch[_0x56a9('0x23')](_0x5bc03a,_0x5f145f,!![]);}catch(_0x16f9de){return BPromise[_0x56a9('0x24')](_0x16f9de);}return _0x5bc03a[_0x56a9('0x25')]();};}function saveUpdates(_0x4a09e5,_0x6100fe){return function(_0x3355c4){if(_0x3355c4){return _0x3355c4[_0x56a9('0x26')](_0x4a09e5)[_0x56a9('0x27')](function(_0x5a82e0){return _0x5a82e0;});}return null;};}function removeEntity(_0x44762e,_0x32839b){return function(_0x21ab38){if(_0x21ab38){return _0x21ab38[_0x56a9('0x28')]()[_0x56a9('0x27')](function(){_0x44762e['status'](0xcc)[_0x56a9('0x1b')]();});}};}function handleEntityNotFound(_0x217bda,_0x35fe6d){return function(_0x5e3052){if(!_0x5e3052){_0x217bda[_0x56a9('0x19')](0x194);}return _0x5e3052;};}function handleError(_0x583b22,_0x22744f){_0x22744f=_0x22744f||0x1f4;return function(_0x8d41d6){logger[_0x56a9('0x29')](_0x8d41d6[_0x56a9('0x2a')]);if(_0x8d41d6[_0x56a9('0x2b')]){delete _0x8d41d6[_0x56a9('0x2b')];}_0x583b22[_0x56a9('0x1a')](_0x22744f)[_0x56a9('0x2c')](_0x8d41d6);};}exports['index']=function(_0x437ccf,_0x2bb1eb){var _0x5f23e1={},_0x4441ce={},_0x4f9be1={'count':0x0,'rows':[]};var _0x54a343=_[_0x56a9('0x2d')](db['MailQueueReport'][_0x56a9('0x2e')],function(_0x11002a){return{'name':_0x11002a[_0x56a9('0x2f')],'type':_0x11002a[_0x56a9('0x30')]['key']};});_0x4441ce[_0x56a9('0x31')]=_[_0x56a9('0x2d')](_0x54a343,_0x56a9('0x2b'));_0x4441ce[_0x56a9('0x32')]=_[_0x56a9('0x33')](_0x437ccf[_0x56a9('0x32')]);_0x4441ce[_0x56a9('0x34')]=_[_0x56a9('0x35')](_0x4441ce[_0x56a9('0x31')],_0x4441ce[_0x56a9('0x32')]);_0x5f23e1[_0x56a9('0x36')]=_[_0x56a9('0x35')](_0x4441ce['model'],qs[_0x56a9('0x37')](_0x437ccf[_0x56a9('0x32')][_0x56a9('0x37')]));_0x5f23e1['attributes']=_0x5f23e1[_0x56a9('0x36')]['length']?_0x5f23e1['attributes']:_0x4441ce['model'];if(!_0x437ccf[_0x56a9('0x32')][_0x56a9('0x38')]('nolimit')){_0x5f23e1['limit']=qs[_0x56a9('0x1f')](_0x437ccf[_0x56a9('0x32')][_0x56a9('0x1f')]);_0x5f23e1[_0x56a9('0x1e')]=qs[_0x56a9('0x1e')](_0x437ccf[_0x56a9('0x32')][_0x56a9('0x1e')]);}_0x5f23e1[_0x56a9('0x39')]=qs[_0x56a9('0x3a')](_0x437ccf[_0x56a9('0x32')]['sort']);_0x5f23e1['where']=qs['filters'](_['pick'](_0x437ccf[_0x56a9('0x32')],_0x4441ce[_0x56a9('0x34')]),_0x54a343);if(_0x437ccf['query'][_0x56a9('0x3b')]){_0x5f23e1[_0x56a9('0x3c')]=_[_0x56a9('0x3d')](_0x5f23e1[_0x56a9('0x3c')],{'$or':_[_0x56a9('0x2d')](_0x54a343,function(_0x38932){if(_0x38932[_0x56a9('0x30')]!=='VIRTUAL'){var _0x4630c7={};_0x4630c7[_0x38932[_0x56a9('0x2b')]]={'$like':'%'+_0x437ccf['query']['filter']+'%'};return _0x4630c7;}})});}_0x5f23e1=_[_0x56a9('0x3d')]({},_0x5f23e1,_0x437ccf[_0x56a9('0x3e')]);var _0x1534d7={'where':_0x5f23e1[_0x56a9('0x3c')]};return db[_0x56a9('0x3f')][_0x56a9('0x1d')](_0x1534d7)[_0x56a9('0x27')](function(_0x26b251){_0x4f9be1[_0x56a9('0x1d')]=_0x26b251;if(_0x437ccf[_0x56a9('0x32')][_0x56a9('0x40')]){_0x5f23e1[_0x56a9('0x41')]=[{'all':!![]}];}return db[_0x56a9('0x3f')][_0x56a9('0x42')](_0x5f23e1);})[_0x56a9('0x27')](function(_0xe57cfb){_0x4f9be1[_0x56a9('0x43')]=_0xe57cfb;return _0x4f9be1;})[_0x56a9('0x27')](respondWithFilteredResult(_0x2bb1eb,_0x5f23e1))['catch'](handleError(_0x2bb1eb,null));};exports[_0x56a9('0x44')]=function(_0x43acf6,_0xfc1800){var _0x5ce001={'raw':!![],'where':{'id':_0x43acf6['params']['id']}},_0x1f8b30={};_0x1f8b30[_0x56a9('0x31')]=_['keys'](db[_0x56a9('0x3f')][_0x56a9('0x2e')]);_0x1f8b30[_0x56a9('0x32')]=_[_0x56a9('0x33')](_0x43acf6['query']);_0x1f8b30['filters']=_['intersection'](_0x1f8b30[_0x56a9('0x31')],_0x1f8b30[_0x56a9('0x32')]);_0x5ce001[_0x56a9('0x36')]=_[_0x56a9('0x35')](_0x1f8b30[_0x56a9('0x31')],qs[_0x56a9('0x37')](_0x43acf6[_0x56a9('0x32')][_0x56a9('0x37')]));_0x5ce001[_0x56a9('0x36')]=_0x5ce001[_0x56a9('0x36')][_0x56a9('0x45')]?_0x5ce001[_0x56a9('0x36')]:_0x1f8b30[_0x56a9('0x31')];if(_0x43acf6[_0x56a9('0x32')]['includeAll']){_0x5ce001[_0x56a9('0x41')]=[{'all':!![]}];}_0x5ce001=_[_0x56a9('0x3d')]({},_0x5ce001,_0x43acf6[_0x56a9('0x3e')]);return db['MailQueueReport'][_0x56a9('0x46')](_0x5ce001)[_0x56a9('0x27')](handleEntityNotFound(_0xfc1800,null))['then'](respondWithResult(_0xfc1800,null))[_0x56a9('0x47')](handleError(_0xfc1800,null));};exports[_0x56a9('0x48')]=function(_0x4186e0,_0x208452){return db['MailQueueReport'][_0x56a9('0x48')](_0x4186e0[_0x56a9('0x49')],{})[_0x56a9('0x27')](respondWithResult(_0x208452,0xc9))[_0x56a9('0x47')](handleError(_0x208452,null));};exports[_0x56a9('0x26')]=function(_0x3942d8,_0x31aaf5){if(_0x3942d8[_0x56a9('0x49')]['id']){delete _0x3942d8[_0x56a9('0x49')]['id'];}return db[_0x56a9('0x3f')][_0x56a9('0x46')]({'where':{'id':_0x3942d8['params']['id']}})['then'](handleEntityNotFound(_0x31aaf5,null))[_0x56a9('0x27')](saveUpdates(_0x3942d8[_0x56a9('0x49')],null))[_0x56a9('0x27')](respondWithResult(_0x31aaf5,null))[_0x56a9('0x47')](handleError(_0x31aaf5,null));};exports['destroy']=function(_0x1986f2,_0x942bee){return db[_0x56a9('0x3f')][_0x56a9('0x46')]({'where':{'id':_0x1986f2['params']['id']}})[_0x56a9('0x27')](handleEntityNotFound(_0x942bee,null))[_0x56a9('0x27')](removeEntity(_0x942bee,null))['catch'](handleError(_0x942bee,null));};exports[_0x56a9('0x4a')]=function(_0x14dea7,_0x4d68d7){return db[_0x56a9('0x3f')][_0x56a9('0x4a')]()[_0x56a9('0x27')](respondWithResult(_0x4d68d7,null))[_0x56a9('0x47')](handleError(_0x4d68d7,null));}; \ No newline at end of file +var _0xbbbc=['query','intersection','fields','attributes','length','order','sort','where','merge','VIRTUAL','filter','options','findAll','rows','catch','params','keys','filters','includeAll','include','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','error','name','send','index','map','MailQueueReport','rawAttributes','fieldName','type','key','model'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x40dc22,_0x21aa75){_0x40dc22=_0x40dc22-0x0;var _0x413c19=_0xbbbc[_0x40dc22];return _0x413c19;};'use strict';var emlformat=require(_0xcbbb('0x0'));var rimraf=require(_0xcbbb('0x1'));var zipdir=require(_0xcbbb('0x2'));var jsonpatch=require(_0xcbbb('0x3'));var rp=require(_0xcbbb('0x4'));var moment=require(_0xcbbb('0x5'));var BPromise=require(_0xcbbb('0x6'));var Mustache=require('mustache');var util=require(_0xcbbb('0x7'));var path=require(_0xcbbb('0x8'));var sox=require(_0xcbbb('0x9'));var csv=require(_0xcbbb('0xa'));var ejs=require(_0xcbbb('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcbbb('0xc'));var squel=require(_0xcbbb('0xd'));var crypto=require(_0xcbbb('0xe'));var jsforce=require(_0xcbbb('0xf'));var deskjs=require(_0xcbbb('0x10'));var toCsv=require(_0xcbbb('0xa'));var querystring=require(_0xcbbb('0x11'));var Papa=require('papaparse');var Redis=require(_0xcbbb('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xcbbb('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcbbb('0x14'))('api');var utils=require(_0xcbbb('0x15'));var config=require(_0xcbbb('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xcbbb('0x17'))['db'];function respondWithStatusCode(_0x53e651,_0x56f81){_0x56f81=_0x56f81||0xcc;return function(_0x523c50){if(_0x523c50){return _0x53e651[_0xcbbb('0x18')](_0x56f81);}return _0x53e651[_0xcbbb('0x19')](_0x56f81)[_0xcbbb('0x1a')]();};}function respondWithResult(_0x47ea6a,_0x27ba56){_0x27ba56=_0x27ba56||0xc8;return function(_0x3ff767){if(_0x3ff767){return _0x47ea6a[_0xcbbb('0x19')](_0x27ba56)[_0xcbbb('0x1b')](_0x3ff767);}};}function respondWithFilteredResult(_0x47e679,_0x5af226){return function(_0x1bba39){if(_0x1bba39){var _0x30297d=typeof _0x5af226[_0xcbbb('0x1c')]===_0xcbbb('0x1d')&&typeof _0x5af226['limit']===_0xcbbb('0x1d');var _0x4ff973=_0x1bba39[_0xcbbb('0x1e')];var _0x3436af=_0x30297d?0x0:_0x5af226[_0xcbbb('0x1c')];var _0x5052df=_0x30297d?_0x1bba39['count']:_0x5af226['offset']+_0x5af226[_0xcbbb('0x1f')];var _0x3ae91b;if(_0x5052df>=_0x4ff973){_0x5052df=_0x4ff973;_0x3ae91b=0xc8;}else{_0x3ae91b=0xce;}_0x47e679[_0xcbbb('0x19')](_0x3ae91b);return _0x47e679[_0xcbbb('0x20')](_0xcbbb('0x21'),_0x3436af+'-'+_0x5052df+'/'+_0x4ff973)[_0xcbbb('0x1b')](_0x1bba39);}return null;};}function patchUpdates(_0x45de5f){return function(_0x2be36c){try{jsonpatch[_0xcbbb('0x22')](_0x2be36c,_0x45de5f,!![]);}catch(_0x2d4335){return BPromise['reject'](_0x2d4335);}return _0x2be36c[_0xcbbb('0x23')]();};}function saveUpdates(_0xe07b0,_0x159c62){return function(_0x42aaf1){if(_0x42aaf1){return _0x42aaf1[_0xcbbb('0x24')](_0xe07b0)[_0xcbbb('0x25')](function(_0x297eae){return _0x297eae;});}return null;};}function removeEntity(_0xabb565,_0x3ca570){return function(_0x5e3970){if(_0x5e3970){return _0x5e3970[_0xcbbb('0x26')]()[_0xcbbb('0x25')](function(){_0xabb565['status'](0xcc)[_0xcbbb('0x1a')]();});}};}function handleEntityNotFound(_0x4ffa80,_0x48dfc4){return function(_0x575d56){if(!_0x575d56){_0x4ffa80[_0xcbbb('0x18')](0x194);}return _0x575d56;};}function handleError(_0x548440,_0x59c422){_0x59c422=_0x59c422||0x1f4;return function(_0x5499a1){logger[_0xcbbb('0x27')](_0x5499a1['stack']);if(_0x5499a1['name']){delete _0x5499a1[_0xcbbb('0x28')];}_0x548440[_0xcbbb('0x19')](_0x59c422)[_0xcbbb('0x29')](_0x5499a1);};}exports[_0xcbbb('0x2a')]=function(_0x372024,_0x39ba8b){var _0x3d4c0d={},_0x1c986d={},_0x2a023f={'count':0x0,'rows':[]};var _0x26c05e=_[_0xcbbb('0x2b')](db[_0xcbbb('0x2c')][_0xcbbb('0x2d')],function(_0x1ce741){return{'name':_0x1ce741[_0xcbbb('0x2e')],'type':_0x1ce741[_0xcbbb('0x2f')][_0xcbbb('0x30')]};});_0x1c986d[_0xcbbb('0x31')]=_['map'](_0x26c05e,_0xcbbb('0x28'));_0x1c986d[_0xcbbb('0x32')]=_['keys'](_0x372024[_0xcbbb('0x32')]);_0x1c986d['filters']=_[_0xcbbb('0x33')](_0x1c986d[_0xcbbb('0x31')],_0x1c986d[_0xcbbb('0x32')]);_0x3d4c0d['attributes']=_[_0xcbbb('0x33')](_0x1c986d[_0xcbbb('0x31')],qs[_0xcbbb('0x34')](_0x372024[_0xcbbb('0x32')][_0xcbbb('0x34')]));_0x3d4c0d[_0xcbbb('0x35')]=_0x3d4c0d[_0xcbbb('0x35')][_0xcbbb('0x36')]?_0x3d4c0d[_0xcbbb('0x35')]:_0x1c986d[_0xcbbb('0x31')];if(!_0x372024['query']['hasOwnProperty']('nolimit')){_0x3d4c0d['limit']=qs[_0xcbbb('0x1f')](_0x372024[_0xcbbb('0x32')][_0xcbbb('0x1f')]);_0x3d4c0d[_0xcbbb('0x1c')]=qs[_0xcbbb('0x1c')](_0x372024[_0xcbbb('0x32')][_0xcbbb('0x1c')]);}_0x3d4c0d[_0xcbbb('0x37')]=qs[_0xcbbb('0x38')](_0x372024[_0xcbbb('0x32')][_0xcbbb('0x38')]);_0x3d4c0d[_0xcbbb('0x39')]=qs['filters'](_['pick'](_0x372024[_0xcbbb('0x32')],_0x1c986d['filters']),_0x26c05e);if(_0x372024['query']['filter']){_0x3d4c0d[_0xcbbb('0x39')]=_[_0xcbbb('0x3a')](_0x3d4c0d[_0xcbbb('0x39')],{'$or':_[_0xcbbb('0x2b')](_0x26c05e,function(_0x38e59d){if(_0x38e59d[_0xcbbb('0x2f')]!==_0xcbbb('0x3b')){var _0x14c1a2={};_0x14c1a2[_0x38e59d[_0xcbbb('0x28')]]={'$like':'%'+_0x372024[_0xcbbb('0x32')][_0xcbbb('0x3c')]+'%'};return _0x14c1a2;}})});}_0x3d4c0d=_['merge']({},_0x3d4c0d,_0x372024[_0xcbbb('0x3d')]);var _0x55d349={'where':_0x3d4c0d[_0xcbbb('0x39')]};return db[_0xcbbb('0x2c')][_0xcbbb('0x1e')](_0x55d349)[_0xcbbb('0x25')](function(_0x433065){_0x2a023f[_0xcbbb('0x1e')]=_0x433065;if(_0x372024['query']['includeAll']){_0x3d4c0d['include']=[{'all':!![]}];}return db[_0xcbbb('0x2c')][_0xcbbb('0x3e')](_0x3d4c0d);})[_0xcbbb('0x25')](function(_0x162979){_0x2a023f[_0xcbbb('0x3f')]=_0x162979;return _0x2a023f;})[_0xcbbb('0x25')](respondWithFilteredResult(_0x39ba8b,_0x3d4c0d))[_0xcbbb('0x40')](handleError(_0x39ba8b,null));};exports['show']=function(_0x1a7799,_0x22076a){var _0x5550d2={'raw':!![],'where':{'id':_0x1a7799[_0xcbbb('0x41')]['id']}},_0x15b3bc={};_0x15b3bc[_0xcbbb('0x31')]=_[_0xcbbb('0x42')](db[_0xcbbb('0x2c')]['rawAttributes']);_0x15b3bc[_0xcbbb('0x32')]=_['keys'](_0x1a7799['query']);_0x15b3bc[_0xcbbb('0x43')]=_[_0xcbbb('0x33')](_0x15b3bc[_0xcbbb('0x31')],_0x15b3bc[_0xcbbb('0x32')]);_0x5550d2[_0xcbbb('0x35')]=_[_0xcbbb('0x33')](_0x15b3bc[_0xcbbb('0x31')],qs[_0xcbbb('0x34')](_0x1a7799[_0xcbbb('0x32')][_0xcbbb('0x34')]));_0x5550d2[_0xcbbb('0x35')]=_0x5550d2[_0xcbbb('0x35')][_0xcbbb('0x36')]?_0x5550d2[_0xcbbb('0x35')]:_0x15b3bc['model'];if(_0x1a7799[_0xcbbb('0x32')][_0xcbbb('0x44')]){_0x5550d2[_0xcbbb('0x45')]=[{'all':!![]}];}_0x5550d2=_[_0xcbbb('0x3a')]({},_0x5550d2,_0x1a7799['options']);return db['MailQueueReport']['find'](_0x5550d2)[_0xcbbb('0x25')](handleEntityNotFound(_0x22076a,null))[_0xcbbb('0x25')](respondWithResult(_0x22076a,null))[_0xcbbb('0x40')](handleError(_0x22076a,null));};exports[_0xcbbb('0x46')]=function(_0x146f37,_0x1ef25b){return db[_0xcbbb('0x2c')]['create'](_0x146f37[_0xcbbb('0x47')],{})[_0xcbbb('0x25')](respondWithResult(_0x1ef25b,0xc9))[_0xcbbb('0x40')](handleError(_0x1ef25b,null));};exports[_0xcbbb('0x24')]=function(_0x478c22,_0x3378cd){if(_0x478c22[_0xcbbb('0x47')]['id']){delete _0x478c22[_0xcbbb('0x47')]['id'];}return db[_0xcbbb('0x2c')]['find']({'where':{'id':_0x478c22['params']['id']}})[_0xcbbb('0x25')](handleEntityNotFound(_0x3378cd,null))[_0xcbbb('0x25')](saveUpdates(_0x478c22[_0xcbbb('0x47')],null))['then'](respondWithResult(_0x3378cd,null))['catch'](handleError(_0x3378cd,null));};exports['destroy']=function(_0x189a40,_0x3070d9){return db['MailQueueReport'][_0xcbbb('0x48')]({'where':{'id':_0x189a40[_0xcbbb('0x41')]['id']}})[_0xcbbb('0x25')](handleEntityNotFound(_0x3070d9,null))[_0xcbbb('0x25')](removeEntity(_0x3070d9,null))['catch'](handleError(_0x3070d9,null));};exports[_0xcbbb('0x49')]=function(_0x1e4bb0,_0x39640d){return db[_0xcbbb('0x2c')][_0xcbbb('0x49')]()[_0xcbbb('0x25')](respondWithResult(_0x39640d,null))[_0xcbbb('0x40')](handleError(_0x39640d,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index b3851b2..eeee468 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 _0xea98=['./mailQueueReport.attributes','exports','define','uniqueid','lodash','util','../../config/logger','moment','request-promise','../../config/environment'];(function(_0x4abc02,_0x12dd97){var _0x11f1fe=function(_0x10cf15){while(--_0x10cf15){_0x4abc02['push'](_0x4abc02['shift']());}};_0x11f1fe(++_0x12dd97);}(_0xea98,0x19e));var _0x8ea9=function(_0x5a970a,_0x378385){_0x5a970a=_0x5a970a-0x0;var _0x5b29df=_0xea98[_0x5a970a];return _0x5b29df;};'use strict';var _=require(_0x8ea9('0x0'));var util=require(_0x8ea9('0x1'));var logger=require(_0x8ea9('0x2'))('api');var moment=require(_0x8ea9('0x3'));var BPromise=require('bluebird');var rp=require(_0x8ea9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8ea9('0x5'));var attributes=require(_0x8ea9('0x6'));module[_0x8ea9('0x7')]=function(_0x2e88a5,_0x16b009){return _0x2e88a5[_0x8ea9('0x8')]('MailQueueReport',attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x8ea9('0x9'),'fields':[_0x8ea9('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4e52=['uniqueid','util','../../config/logger','moment','bluebird','request-promise','rimraf','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue'];(function(_0x4b5bf1,_0x3a9485){var _0x48be71=function(_0x437109){while(--_0x437109){_0x4b5bf1['push'](_0x4b5bf1['shift']());}};_0x48be71(++_0x3a9485);}(_0x4e52,0x115));var _0x24e5=function(_0x5efc2e,_0x494a0b){_0x5efc2e=_0x5efc2e-0x0;var _0x3ba2c1=_0x4e52[_0x5efc2e];return _0x3ba2c1;};'use strict';var _=require('lodash');var util=require(_0x24e5('0x0'));var logger=require(_0x24e5('0x1'))('api');var moment=require(_0x24e5('0x2'));var BPromise=require(_0x24e5('0x3'));var rp=require(_0x24e5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x24e5('0x5'));var config=require('../../config/environment');var attributes=require(_0x24e5('0x6'));module[_0x24e5('0x7')]=function(_0x5d5665,_0x443e75){return _0x5d5665[_0x24e5('0x8')](_0x24e5('0x9'),attributes,{'tableName':_0x24e5('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x24e5('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index bdfdc09..0f13b30 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 _0xadb5=['MailQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateMailQueueReport','create','options','raw','debug','MailQueueReport','body','attributes','limit','UpdateMailQueueReport','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x25f4ec,_0x587e63){var _0x5c35fe=function(_0x42a0a6){while(--_0x42a0a6){_0x25f4ec['push'](_0x25f4ec['shift']());}};_0x5c35fe(++_0x587e63);}(_0xadb5,0xad));var _0x5adb=function(_0x559f9f,_0x26a059){_0x559f9f=_0x559f9f-0x0;var _0x2070b5=_0xadb5[_0x559f9f];return _0x2070b5;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailQueueReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}exports[_0x5adb('0x15')]=function(_0x529b65){var _0x3fff62=this;return new Promise(function(_0x5de028,_0x1d9e86){return db['MailQueueReport'][_0x5adb('0x16')](_0x529b65['body'],{'raw':_0x529b65['options']?_0x529b65[_0x5adb('0x17')][_0x5adb('0x18')]===undefined?!![]:![]:!![]})[_0x5adb('0xb')](function(_0x1fd4a7){logger[_0x5adb('0xc')]('CreateMailQueueReport',_0x529b65);logger[_0x5adb('0x19')]('CreateMailQueueReport',_0x529b65,JSON['stringify'](_0x1fd4a7));_0x5de028(_0x1fd4a7);})[_0x5adb('0x14')](function(_0x379b33){logger[_0x5adb('0x10')](_0x5adb('0x15'),_0x379b33[_0x5adb('0x12')],_0x529b65);_0x1d9e86(_0x3fff62[_0x5adb('0x10')](0x1f4,_0x379b33[_0x5adb('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x4b1957){var _0x373cc3=this;return new Promise(function(_0x3220cd,_0x3839fb){return db[_0x5adb('0x1a')]['update'](_0x4b1957[_0x5adb('0x1b')],{'raw':_0x4b1957[_0x5adb('0x17')]?_0x4b1957['options'][_0x5adb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')]['where']||null:null,'attributes':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1c')]||null:null,'limit':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1d')]||null:null})['then'](function(_0x49992e){logger['info'](_0x5adb('0x1e'),_0x4b1957);logger[_0x5adb('0x19')](_0x5adb('0x1e'),_0x4b1957,JSON[_0x5adb('0xf')](_0x49992e));_0x3220cd(_0x49992e);})[_0x5adb('0x14')](function(_0x4de310){logger[_0x5adb('0x10')](_0x5adb('0x1e'),_0x4de310[_0x5adb('0x12')],_0x4b1957);_0x3839fb(_0x373cc3[_0x5adb('0x10')](0x1f4,_0x4de310[_0x5adb('0x12')]));});});}; \ No newline at end of file +var _0x7a54=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','MailQueueReport','create','body','options','raw','CreateMailQueueReport','UpdateMailQueueReport','update','where','attributes','limit','then','lodash','util'];(function(_0x1f418a,_0x3336a1){var _0x261511=function(_0x1d8492){while(--_0x1d8492){_0x1f418a['push'](_0x1f418a['shift']());}};_0x261511(++_0x3336a1);}(_0x7a54,0x106));var _0x47a5=function(_0x4242c1,_0x3bfa6d){_0x4242c1=_0x4242c1-0x0;var _0x48aa94=_0x7a54[_0x4242c1];return _0x48aa94;};'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')]('MailQueueReport,\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['CreateMailQueueReport']=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')]('CreateMailQueueReport',_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')]));});});};exports[_0x47a5('0x1b')]=function(_0x513981){var _0x28747d=this;return new Promise(function(_0xc4cd63,_0x4437f1){return db[_0x47a5('0x15')][_0x47a5('0x1c')](_0x513981['body'],{'raw':_0x513981['options']?_0x513981[_0x47a5('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x513981[_0x47a5('0x18')]?_0x513981['options'][_0x47a5('0x1d')]||null:null,'attributes':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1e')]||null:null,'limit':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1f')]||null:null})[_0x47a5('0x20')](function(_0x16631f){logger[_0x47a5('0xb')](_0x47a5('0x1b'),_0x513981);logger[_0x47a5('0xd')](_0x47a5('0x1b'),_0x513981,JSON['stringify'](_0x16631f));_0xc4cd63(_0x16631f);})[_0x47a5('0x14')](function(_0x51833b){logger[_0x47a5('0xf')](_0x47a5('0x1b'),_0x51833b[_0x47a5('0x11')],_0x513981);_0x4437f1(_0x28747d['error'](0x1f4,_0x51833b[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 2b75fa2..68eeea5 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x3aff6c,_0x29e141){var _0x229d9e=function(_0x3df456){while(--_0x3df456){_0x3aff6c['push'](_0x3aff6c['shift']());}};_0x229d9e(++_0x29e141);}(_0x9c44,0x178));var _0x49c4=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x9c44[_0x279d37];return _0x530173;};'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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x38a814,_0x339349){var _0x54b539=function(_0x2ded1c){while(--_0x2ded1c){_0x38a814['push'](_0x38a814['shift']());}};_0x54b539(++_0x339349);}(_0xe706,0xa3));var _0x6e70=function(_0x1f5143,_0x5e31e6){_0x1f5143=_0x1f5143-0x0;var _0x383a38=_0xe706[_0x1f5143];return _0x383a38;};'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/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index b377e8c..5a9e6d4 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 _0x119e=['exports','STRING','INTEGER','BOOLEAN','INBOX','sequelize'];(function(_0x2f8364,_0x2caaa8){var _0x55825f=function(_0x24be05){while(--_0x24be05){_0x2f8364['push'](_0x2f8364['shift']());}};_0x55825f(++_0x2caaa8);}(_0x119e,0x11f));var _0xe119=function(_0x3fc7db,_0x350aff){_0x3fc7db=_0x3fc7db-0x0;var _0x2fe592=_0x119e[_0x3fc7db];return _0x2fe592;};'use strict';var Sequelize=require(_0xe119('0x0'));module[_0xe119('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0xe119('0x2')]},'password':{'type':Sequelize[_0xe119('0x2')]},'port':{'type':Sequelize[_0xe119('0x3')]},'tls':{'type':Sequelize[_0xe119('0x4')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0xe119('0x5')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xe119('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0xe119('0x2')]},'modernAuthentication':{'type':Sequelize[_0xe119('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x7d8f=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x364471,_0x302e8a){var _0x59236f=function(_0x524944){while(--_0x524944){_0x364471['push'](_0x364471['shift']());}};_0x59236f(++_0x302e8a);}(_0x7d8f,0x178));var _0xf7d8=function(_0x11a95a,_0x3c4bbd){_0x11a95a=_0x11a95a-0x0;var _0x4e92ec=_0x7d8f[_0x11a95a];return _0x4e92ec;};'use strict';var Sequelize=require(_0xf7d8('0x0'));module[_0xf7d8('0x1')]={'description':{'type':Sequelize[_0xf7d8('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xf7d8('0x3')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xf7d8('0x4')]},'tls':{'type':Sequelize[_0xf7d8('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xf7d8('0x2')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0xf7d8('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xf7d8('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0xf7d8('0x2')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index af6caf6..7958ac2 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 _0xd1f2=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailServerIn.attributes','lodash'];(function(_0x19316e,_0x74606a){var _0x46e4b0=function(_0x53e2e1){while(--_0x53e2e1){_0x19316e['push'](_0x19316e['shift']());}};_0x46e4b0(++_0x74606a);}(_0xd1f2,0x1e9));var _0x2d1f=function(_0x36c80d,_0x19935e){_0x36c80d=_0x36c80d-0x0;var _0xb3120b=_0xd1f2[_0x36c80d];return _0xb3120b;};'use strict';var _=require(_0x2d1f('0x0'));var util=require(_0x2d1f('0x1'));var logger=require(_0x2d1f('0x2'))(_0x2d1f('0x3'));var moment=require(_0x2d1f('0x4'));var BPromise=require(_0x2d1f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2d1f('0x6'));var rimraf=require(_0x2d1f('0x7'));var config=require(_0x2d1f('0x8'));var attributes=require(_0x2d1f('0x9'));module['exports']=function(_0x2ae79c,_0x3ffa70){return _0x2ae79c['define']('MailServerIn',attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x47e7=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','exports','MailServerIn','mail_servers_in','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x47e7,0x129));var _0x747e=function(_0xa4923a,_0x16d2f1){_0xa4923a=_0xa4923a-0x0;var _0x391b71=_0x47e7[_0xa4923a];return _0x391b71;};'use strict';var _=require(_0x747e('0x0'));var util=require(_0x747e('0x1'));var logger=require(_0x747e('0x2'))('api');var moment=require(_0x747e('0x3'));var BPromise=require(_0x747e('0x4'));var rp=require(_0x747e('0x5'));var fs=require('fs');var path=require(_0x747e('0x6'));var rimraf=require(_0x747e('0x7'));var config=require(_0x747e('0x8'));var attributes=require(_0x747e('0x9'));module[_0x747e('0xa')]=function(_0x3c7ddf,_0x1de9ea){return _0x3c7ddf['define'](_0x747e('0xb'),attributes,{'tableName':_0x747e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index 6fb4559..e14b2b8 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 _0xb7f1=['debug','GetMailServerIn','stringify','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','MailServerIn','findAll','options','raw','limit','map','include','attributes','model'];(function(_0x299f90,_0xf21fd){var _0x32ae55=function(_0x21b2e8){while(--_0x21b2e8){_0x299f90['push'](_0x299f90['shift']());}};_0x32ae55(++_0xf21fd);}(_0xb7f1,0xdc));var _0x1b7f=function(_0x28ddec,_0x2c2a6c){_0x28ddec=_0x28ddec-0x0;var _0x5572be=_0xb7f1[_0x28ddec];return _0x5572be;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1b7f('0x0'));var BPromise=require(_0x1b7f('0x1'));var rs=require(_0x1b7f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1b7f('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1b7f('0x4'));var config=require(_0x1b7f('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x1b7f('0x6')][_0x1b7f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2b58f7,_0x6c9f9,_0x34213c){return new BPromise(function(_0x4dda12,_0x16935b){return client[_0x1b7f('0x8')](_0x2b58f7,_0x34213c)[_0x1b7f('0x9')](function(_0x1ee997){logger[_0x1b7f('0xa')](_0x1b7f('0xb'),_0x6c9f9,_0x1b7f('0xc'));logger['debug'](_0x1b7f('0xd'),_0x6c9f9,'request\x20sent',JSON['stringify'](_0x1ee997));if(_0x1ee997[_0x1b7f('0xe')]){if(_0x1ee997[_0x1b7f('0xe')][_0x1b7f('0xf')]===0x1f4){logger[_0x1b7f('0xe')](_0x1b7f('0xb'),_0x6c9f9,_0x1ee997[_0x1b7f('0xe')]['message']);return _0x16935b(_0x1ee997[_0x1b7f('0xe')][_0x1b7f('0x10')]);}logger[_0x1b7f('0xe')](_0x1b7f('0xb'),_0x6c9f9,_0x1ee997[_0x1b7f('0xe')][_0x1b7f('0x10')]);return _0x4dda12(_0x1ee997[_0x1b7f('0xe')][_0x1b7f('0x10')]);}else{logger['info']('MailServerIn,\x20%s,\x20%s',_0x6c9f9,_0x1b7f('0xc'));_0x4dda12(_0x1ee997[_0x1b7f('0x11')]['message']);}})[_0x1b7f('0x12')](function(_0x45735f){logger[_0x1b7f('0xe')](_0x1b7f('0xb'),_0x6c9f9,_0x45735f);_0x16935b(_0x45735f);});});}exports['GetMailServerIn']=function(_0x44b143){var _0x163b55=this;return new Promise(function(_0xa9a3de,_0x1b0d47){return db[_0x1b7f('0x13')][_0x1b7f('0x14')]({'raw':_0x44b143['options']?_0x44b143[_0x1b7f('0x15')][_0x1b7f('0x16')]===undefined?!![]:![]:!![],'where':_0x44b143[_0x1b7f('0x15')]?_0x44b143[_0x1b7f('0x15')]['where']||null:null,'attributes':_0x44b143['options']?_0x44b143[_0x1b7f('0x15')]['attributes']||null:null,'limit':_0x44b143[_0x1b7f('0x15')]?_0x44b143['options'][_0x1b7f('0x17')]||null:null,'include':_0x44b143['options']?_0x44b143[_0x1b7f('0x15')]['include']?_[_0x1b7f('0x18')](_0x44b143[_0x1b7f('0x15')][_0x1b7f('0x19')],function(_0x50e60f){return{'model':db[_0x50e60f['model']],'as':_0x50e60f['as'],'attributes':_0x50e60f[_0x1b7f('0x1a')],'include':_0x50e60f[_0x1b7f('0x19')]?_[_0x1b7f('0x18')](_0x50e60f[_0x1b7f('0x19')],function(_0x3d9659){return{'model':db[_0x3d9659[_0x1b7f('0x1b')]],'as':_0x3d9659['as'],'attributes':_0x3d9659[_0x1b7f('0x1a')],'include':_0x3d9659[_0x1b7f('0x19')]?_[_0x1b7f('0x18')](_0x3d9659[_0x1b7f('0x19')],function(_0x1624ea){return{'model':db[_0x1624ea['model']],'as':_0x1624ea['as'],'attributes':_0x1624ea['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x575f26){logger[_0x1b7f('0xa')]('GetMailServerIn',_0x44b143);logger[_0x1b7f('0x1c')](_0x1b7f('0x1d'),_0x44b143,JSON[_0x1b7f('0x1e')](_0x575f26));_0xa9a3de(_0x575f26);})['catch'](function(_0x54d52c){logger[_0x1b7f('0xe')](_0x1b7f('0x1d'),_0x54d52c[_0x1b7f('0x10')],_0x44b143);_0x1b0d47(_0x163b55[_0x1b7f('0xe')](0x1f4,_0x54d52c[_0x1b7f('0x10')]));});});}; \ No newline at end of file +var _0x4e6e=['map','model','then','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','request','info','MailServerIn,\x20%s,\x20%s','debug','MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetMailServerIn','findAll','raw','options','where','attributes','limit','include'];(function(_0x2ab6d0,_0x2331d0){var _0x5d78bb=function(_0x139d93){while(--_0x139d93){_0x2ab6d0['push'](_0x2ab6d0['shift']());}};_0x5d78bb(++_0x2331d0);}(_0x4e6e,0x1c5));var _0xe4e6=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0x4e6e[_0x486f4a];return _0x135d99;};'use strict';var _=require(_0xe4e6('0x0'));var util=require('util');var moment=require(_0xe4e6('0x1'));var BPromise=require(_0xe4e6('0x2'));var rs=require(_0xe4e6('0x3'));var fs=require('fs');var Redis=require(_0xe4e6('0x4'));var db=require(_0xe4e6('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xe4e6('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x51c7a7,_0x5102e3,_0x53f7f0){return new BPromise(function(_0x58602b,_0x558d23){return client[_0xe4e6('0x7')](_0x51c7a7,_0x53f7f0)['then'](function(_0x5571af){logger[_0xe4e6('0x8')](_0xe4e6('0x9'),_0x5102e3,'request\x20sent');logger[_0xe4e6('0xa')](_0xe4e6('0xb'),_0x5102e3,_0xe4e6('0xc'),JSON[_0xe4e6('0xd')](_0x5571af));if(_0x5571af['error']){if(_0x5571af[_0xe4e6('0xe')][_0xe4e6('0xf')]===0x1f4){logger['error'](_0xe4e6('0x9'),_0x5102e3,_0x5571af[_0xe4e6('0xe')][_0xe4e6('0x10')]);return _0x558d23(_0x5571af[_0xe4e6('0xe')]['message']);}logger[_0xe4e6('0xe')](_0xe4e6('0x9'),_0x5102e3,_0x5571af['error'][_0xe4e6('0x10')]);return _0x58602b(_0x5571af[_0xe4e6('0xe')][_0xe4e6('0x10')]);}else{logger[_0xe4e6('0x8')](_0xe4e6('0x9'),_0x5102e3,_0xe4e6('0xc'));_0x58602b(_0x5571af[_0xe4e6('0x11')][_0xe4e6('0x10')]);}})[_0xe4e6('0x12')](function(_0x54f055){logger[_0xe4e6('0xe')](_0xe4e6('0x9'),_0x5102e3,_0x54f055);_0x558d23(_0x54f055);});});}exports[_0xe4e6('0x13')]=function(_0x346445){var _0x580cd9=this;return new Promise(function(_0x49934c,_0x250f30){return db['MailServerIn'][_0xe4e6('0x14')]({'raw':_0x346445['options']?_0x346445['options'][_0xe4e6('0x15')]===undefined?!![]:![]:!![],'where':_0x346445[_0xe4e6('0x16')]?_0x346445[_0xe4e6('0x16')][_0xe4e6('0x17')]||null:null,'attributes':_0x346445['options']?_0x346445['options'][_0xe4e6('0x18')]||null:null,'limit':_0x346445['options']?_0x346445['options'][_0xe4e6('0x19')]||null:null,'include':_0x346445['options']?_0x346445[_0xe4e6('0x16')][_0xe4e6('0x1a')]?_[_0xe4e6('0x1b')](_0x346445['options']['include'],function(_0x51c4d4){return{'model':db[_0x51c4d4[_0xe4e6('0x1c')]],'as':_0x51c4d4['as'],'attributes':_0x51c4d4[_0xe4e6('0x18')],'include':_0x51c4d4[_0xe4e6('0x1a')]?_[_0xe4e6('0x1b')](_0x51c4d4[_0xe4e6('0x1a')],function(_0x17ad9d){return{'model':db[_0x17ad9d[_0xe4e6('0x1c')]],'as':_0x17ad9d['as'],'attributes':_0x17ad9d[_0xe4e6('0x18')],'include':_0x17ad9d[_0xe4e6('0x1a')]?_['map'](_0x17ad9d[_0xe4e6('0x1a')],function(_0x23da59){return{'model':db[_0x23da59[_0xe4e6('0x1c')]],'as':_0x23da59['as'],'attributes':_0x23da59['attributes']};}):[]};}):[]};}):[]:[]})[_0xe4e6('0x1d')](function(_0x51dbb9){logger[_0xe4e6('0x8')](_0xe4e6('0x13'),_0x346445);logger[_0xe4e6('0xa')]('GetMailServerIn',_0x346445,JSON[_0xe4e6('0xd')](_0x51dbb9));_0x49934c(_0x51dbb9);})[_0xe4e6('0x12')](function(_0x1d2675){logger['error'](_0xe4e6('0x13'),_0x1d2675['message'],_0x346445);_0x250f30(_0x580cd9[_0xe4e6('0xe')](0x1f4,_0x1d2675[_0xe4e6('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index f817b35..0baa56f 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x7a54,0x106));var _0x47a5=function(_0x43f6a2,_0x379a3a){_0x43f6a2=_0x43f6a2-0x0;var _0x40c269=_0x7a54[_0x43f6a2];return _0x40c269;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file +var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x7a54,0x106));var _0x47a5=function(_0x284bb6,_0x25aefb){_0x284bb6=_0x284bb6-0x0;var _0x30b1b6=_0x7a54[_0x284bb6];return _0x30b1b6;};'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 7078062..a1ef89f 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 _0x236c=['BOOLEAN','sequelize','STRING','INTEGER'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x236c,0x155));var _0xc236=function(_0x1cdf6c,_0x42e9ba){_0x1cdf6c=_0x1cdf6c-0x0;var _0x52208d=_0x236c[_0x1cdf6c];return _0x52208d;};'use strict';var Sequelize=require(_0xc236('0x0'));module['exports']={'description':{'type':Sequelize[_0xc236('0x1')]},'host':{'type':Sequelize[_0xc236('0x1')]},'user':{'type':Sequelize[_0xc236('0x1')]},'pass':{'type':Sequelize[_0xc236('0x1')]},'port':{'type':Sequelize[_0xc236('0x2')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0xc236('0x1')]},'authentication':{'type':Sequelize[_0xc236('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xc236('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x0abf=['sequelize','STRING','INTEGER','BOOLEAN'];(function(_0x13ff59,_0x31281b){var _0x520b47=function(_0x2b13cf){while(--_0x2b13cf){_0x13ff59['push'](_0x13ff59['shift']());}};_0x520b47(++_0x31281b);}(_0x0abf,0xe8));var _0xf0ab=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x0abf[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0xf0ab('0x0'));module['exports']={'description':{'type':Sequelize[_0xf0ab('0x1')]},'host':{'type':Sequelize[_0xf0ab('0x1')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xf0ab('0x2')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0xf0ab('0x1')]},'authentication':{'type':Sequelize[_0xf0ab('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xf0ab('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index e42ca4c..48805bc 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 _0x7cb5=['update','then','error','stack','name','map','MailServerOut','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','create','body','find','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','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','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','apply','reject','save'];(function(_0x4bea50,_0x18ea16){var _0x500311=function(_0x3c3a76){while(--_0x3c3a76){_0x4bea50['push'](_0x4bea50['shift']());}};_0x500311(++_0x18ea16);}(_0x7cb5,0x10e));var _0x57cb=function(_0x56ae64,_0x15f99f){_0x56ae64=_0x56ae64-0x0;var _0x563095=_0x7cb5[_0x56ae64];return _0x563095;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x57cb('0x0'));var zipdir=require(_0x57cb('0x1'));var jsonpatch=require(_0x57cb('0x2'));var rp=require(_0x57cb('0x3'));var moment=require(_0x57cb('0x4'));var BPromise=require(_0x57cb('0x5'));var Mustache=require(_0x57cb('0x6'));var util=require(_0x57cb('0x7'));var path=require('path');var sox=require(_0x57cb('0x8'));var csv=require(_0x57cb('0x9'));var ejs=require(_0x57cb('0xa'));var fs=require('fs');var fs_extra=require(_0x57cb('0xb'));var _=require(_0x57cb('0xc'));var squel=require(_0x57cb('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x57cb('0xe'));var toCsv=require(_0x57cb('0x9'));var querystring=require(_0x57cb('0xf'));var Papa=require(_0x57cb('0x10'));var Redis=require('ioredis');var authService=require(_0x57cb('0x11'));var qs=require(_0x57cb('0x12'));var as=require(_0x57cb('0x13'));var hardwareService=require(_0x57cb('0x14'));var logger=require(_0x57cb('0x15'))('api');var utils=require(_0x57cb('0x16'));var config=require(_0x57cb('0x17'));var licenseUtil=require(_0x57cb('0x18'));var db=require(_0x57cb('0x19'))['db'];function respondWithStatusCode(_0x26330e,_0x13ef90){_0x13ef90=_0x13ef90||0xcc;return function(_0x103d19){if(_0x103d19){return _0x26330e[_0x57cb('0x1a')](_0x13ef90);}return _0x26330e[_0x57cb('0x1b')](_0x13ef90)[_0x57cb('0x1c')]();};}function respondWithResult(_0x399d92,_0x23e68a){_0x23e68a=_0x23e68a||0xc8;return function(_0x2d83e1){if(_0x2d83e1){return _0x399d92[_0x57cb('0x1b')](_0x23e68a)[_0x57cb('0x1d')](_0x2d83e1);}};}function respondWithFilteredResult(_0x1b0618,_0x1f6ef6){return function(_0x3ede58){if(_0x3ede58){var _0x39e10a=typeof _0x1f6ef6['offset']==='undefined'&&typeof _0x1f6ef6[_0x57cb('0x1e')]===_0x57cb('0x1f');var _0x50f8f7=_0x3ede58[_0x57cb('0x20')];var _0x5741fb=_0x39e10a?0x0:_0x1f6ef6[_0x57cb('0x21')];var _0x100169=_0x39e10a?_0x3ede58[_0x57cb('0x20')]:_0x1f6ef6[_0x57cb('0x21')]+_0x1f6ef6['limit'];var _0x306c74;if(_0x100169>=_0x50f8f7){_0x100169=_0x50f8f7;_0x306c74=0xc8;}else{_0x306c74=0xce;}_0x1b0618['status'](_0x306c74);return _0x1b0618[_0x57cb('0x22')]('Content-Range',_0x5741fb+'-'+_0x100169+'/'+_0x50f8f7)[_0x57cb('0x1d')](_0x3ede58);}return null;};}function patchUpdates(_0xb20049){return function(_0x180e66){try{jsonpatch[_0x57cb('0x23')](_0x180e66,_0xb20049,!![]);}catch(_0x13c597){return BPromise[_0x57cb('0x24')](_0x13c597);}return _0x180e66[_0x57cb('0x25')]();};}function saveUpdates(_0x95de64,_0x5918ae){return function(_0x5c18d7){if(_0x5c18d7){return _0x5c18d7[_0x57cb('0x26')](_0x95de64)[_0x57cb('0x27')](function(_0x3eb73b){return _0x3eb73b;});}return null;};}function removeEntity(_0x224336,_0x1c4416){return function(_0x12c12c){if(_0x12c12c){return _0x12c12c['destroy']()[_0x57cb('0x27')](function(){_0x224336['status'](0xcc)[_0x57cb('0x1c')]();});}};}function handleEntityNotFound(_0xfb2857,_0xc17db6){return function(_0x5d4af7){if(!_0x5d4af7){_0xfb2857[_0x57cb('0x1a')](0x194);}return _0x5d4af7;};}function handleError(_0x734805,_0x5683cd){_0x5683cd=_0x5683cd||0x1f4;return function(_0xce36ec){logger[_0x57cb('0x28')](_0xce36ec[_0x57cb('0x29')]);if(_0xce36ec[_0x57cb('0x2a')]){delete _0xce36ec[_0x57cb('0x2a')];}_0x734805[_0x57cb('0x1b')](_0x5683cd)['send'](_0xce36ec);};}exports['index']=function(_0x570922,_0x35f36c){var _0x1f17cb={},_0x434389={},_0x57da8c={'count':0x0,'rows':[]};var _0x5f3d73=_[_0x57cb('0x2b')](db[_0x57cb('0x2c')][_0x57cb('0x2d')],function(_0x236d10){return{'name':_0x236d10[_0x57cb('0x2e')],'type':_0x236d10['type'][_0x57cb('0x2f')]};});_0x434389[_0x57cb('0x30')]=_['map'](_0x5f3d73,'name');_0x434389[_0x57cb('0x31')]=_[_0x57cb('0x32')](_0x570922[_0x57cb('0x31')]);_0x434389[_0x57cb('0x33')]=_['intersection'](_0x434389[_0x57cb('0x30')],_0x434389[_0x57cb('0x31')]);_0x1f17cb['attributes']=_[_0x57cb('0x34')](_0x434389[_0x57cb('0x30')],qs[_0x57cb('0x35')](_0x570922['query'][_0x57cb('0x35')]));_0x1f17cb['attributes']=_0x1f17cb[_0x57cb('0x36')]['length']?_0x1f17cb[_0x57cb('0x36')]:_0x434389[_0x57cb('0x30')];if(!_0x570922[_0x57cb('0x31')][_0x57cb('0x37')](_0x57cb('0x38'))){_0x1f17cb[_0x57cb('0x1e')]=qs[_0x57cb('0x1e')](_0x570922[_0x57cb('0x31')][_0x57cb('0x1e')]);_0x1f17cb[_0x57cb('0x21')]=qs[_0x57cb('0x21')](_0x570922['query'][_0x57cb('0x21')]);}_0x1f17cb[_0x57cb('0x39')]=qs[_0x57cb('0x3a')](_0x570922[_0x57cb('0x31')][_0x57cb('0x3a')]);_0x1f17cb[_0x57cb('0x3b')]=qs['filters'](_[_0x57cb('0x3c')](_0x570922[_0x57cb('0x31')],_0x434389[_0x57cb('0x33')]),_0x5f3d73);if(_0x570922[_0x57cb('0x31')][_0x57cb('0x3d')]){_0x1f17cb[_0x57cb('0x3b')]=_[_0x57cb('0x3e')](_0x1f17cb[_0x57cb('0x3b')],{'$or':_[_0x57cb('0x2b')](_0x5f3d73,function(_0x399f67){if(_0x399f67['type']!==_0x57cb('0x3f')){var _0x2851b1={};_0x2851b1[_0x399f67[_0x57cb('0x2a')]]={'$like':'%'+_0x570922[_0x57cb('0x31')][_0x57cb('0x3d')]+'%'};return _0x2851b1;}})});}_0x1f17cb=_[_0x57cb('0x3e')]({},_0x1f17cb,_0x570922[_0x57cb('0x40')]);var _0x5e03fd={'where':_0x1f17cb[_0x57cb('0x3b')]};return db[_0x57cb('0x2c')][_0x57cb('0x20')](_0x5e03fd)[_0x57cb('0x27')](function(_0x4065e8){_0x57da8c[_0x57cb('0x20')]=_0x4065e8;if(_0x570922[_0x57cb('0x31')][_0x57cb('0x41')]){_0x1f17cb['include']=[{'all':!![]}];}return db[_0x57cb('0x2c')][_0x57cb('0x42')](_0x1f17cb);})[_0x57cb('0x27')](function(_0x5415e1){_0x57da8c[_0x57cb('0x43')]=_0x5415e1;return _0x57da8c;})[_0x57cb('0x27')](respondWithFilteredResult(_0x35f36c,_0x1f17cb))[_0x57cb('0x44')](handleError(_0x35f36c,null));};exports[_0x57cb('0x45')]=function(_0x1578f1,_0x4a12dd){var _0x4eed39={'raw':!![],'where':{'id':_0x1578f1[_0x57cb('0x46')]['id']}},_0x1303a5={};_0x1303a5['model']=_[_0x57cb('0x32')](db[_0x57cb('0x2c')]['rawAttributes']);_0x1303a5['query']=_[_0x57cb('0x32')](_0x1578f1[_0x57cb('0x31')]);_0x1303a5[_0x57cb('0x33')]=_[_0x57cb('0x34')](_0x1303a5[_0x57cb('0x30')],_0x1303a5['query']);_0x4eed39[_0x57cb('0x36')]=_[_0x57cb('0x34')](_0x1303a5[_0x57cb('0x30')],qs['fields'](_0x1578f1[_0x57cb('0x31')]['fields']));_0x4eed39[_0x57cb('0x36')]=_0x4eed39[_0x57cb('0x36')][_0x57cb('0x47')]?_0x4eed39['attributes']:_0x1303a5['model'];if(_0x1578f1[_0x57cb('0x31')]['includeAll']){_0x4eed39[_0x57cb('0x48')]=[{'all':!![]}];}_0x4eed39=_[_0x57cb('0x3e')]({},_0x4eed39,_0x1578f1[_0x57cb('0x40')]);return db[_0x57cb('0x2c')]['find'](_0x4eed39)[_0x57cb('0x27')](handleEntityNotFound(_0x4a12dd,null))['then'](respondWithResult(_0x4a12dd,null))[_0x57cb('0x44')](handleError(_0x4a12dd,null));};exports['create']=function(_0x35b495,_0x596942){return db[_0x57cb('0x2c')][_0x57cb('0x49')](_0x35b495[_0x57cb('0x4a')],{})[_0x57cb('0x27')](respondWithResult(_0x596942,0xc9))[_0x57cb('0x44')](handleError(_0x596942,null));};exports[_0x57cb('0x26')]=function(_0x65fd8d,_0x39e371){if(_0x65fd8d['body']['id']){delete _0x65fd8d['body']['id'];}return db[_0x57cb('0x2c')][_0x57cb('0x4b')]({'where':{'id':_0x65fd8d[_0x57cb('0x46')]['id']}})[_0x57cb('0x27')](handleEntityNotFound(_0x39e371,null))[_0x57cb('0x27')](saveUpdates(_0x65fd8d['body'],null))[_0x57cb('0x27')](respondWithResult(_0x39e371,null))[_0x57cb('0x44')](handleError(_0x39e371,null));};exports[_0x57cb('0x4c')]=function(_0x461941,_0x1a63f5){return db[_0x57cb('0x2c')][_0x57cb('0x4b')]({'where':{'id':_0x461941['params']['id']}})['then'](handleEntityNotFound(_0x1a63f5,null))[_0x57cb('0x27')](removeEntity(_0x1a63f5,null))[_0x57cb('0x44')](handleError(_0x1a63f5,null));}; \ No newline at end of file +var _0x1f8f=['show','params','includeAll','catch','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','Content-Range','apply','reject','update','destroy','end','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','order','sort','where','filters','pick','filter','merge','options','MailServerOut','then','include','rows'];(function(_0x1f9f27,_0x1d63df){var _0x5ec68d=function(_0x258546){while(--_0x258546){_0x1f9f27['push'](_0x1f9f27['shift']());}};_0x5ec68d(++_0x1d63df);}(_0x1f8f,0x95));var _0xf1f8=function(_0x110129,_0x2ed398){_0x110129=_0x110129-0x0;var _0x375002=_0x1f8f[_0x110129];return _0x375002;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf1f8('0x0'));var zipdir=require(_0xf1f8('0x1'));var jsonpatch=require(_0xf1f8('0x2'));var rp=require(_0xf1f8('0x3'));var moment=require('moment');var BPromise=require(_0xf1f8('0x4'));var Mustache=require(_0xf1f8('0x5'));var util=require(_0xf1f8('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xf1f8('0x7'));var ejs=require(_0xf1f8('0x8'));var fs=require('fs');var fs_extra=require(_0xf1f8('0x9'));var _=require(_0xf1f8('0xa'));var squel=require(_0xf1f8('0xb'));var crypto=require(_0xf1f8('0xc'));var jsforce=require(_0xf1f8('0xd'));var deskjs=require(_0xf1f8('0xe'));var toCsv=require(_0xf1f8('0x7'));var querystring=require(_0xf1f8('0xf'));var Papa=require(_0xf1f8('0x10'));var Redis=require(_0xf1f8('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf1f8('0x12'));var hardwareService=require(_0xf1f8('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xf1f8('0x14'));var config=require(_0xf1f8('0x15'));var licenseUtil=require(_0xf1f8('0x16'));var db=require(_0xf1f8('0x17'))['db'];function respondWithStatusCode(_0x409f21,_0x3dd928){_0x3dd928=_0x3dd928||0xcc;return function(_0x755b2d){if(_0x755b2d){return _0x409f21[_0xf1f8('0x18')](_0x3dd928);}return _0x409f21[_0xf1f8('0x19')](_0x3dd928)['end']();};}function respondWithResult(_0x870b6b,_0x379130){_0x379130=_0x379130||0xc8;return function(_0x64ee24){if(_0x64ee24){return _0x870b6b['status'](_0x379130)[_0xf1f8('0x1a')](_0x64ee24);}};}function respondWithFilteredResult(_0x3423b5,_0x4f06b4){return function(_0x48931a){if(_0x48931a){var _0x525447=typeof _0x4f06b4['offset']===_0xf1f8('0x1b')&&typeof _0x4f06b4['limit']==='undefined';var _0xe98095=_0x48931a[_0xf1f8('0x1c')];var _0x15b471=_0x525447?0x0:_0x4f06b4[_0xf1f8('0x1d')];var _0x1f5717=_0x525447?_0x48931a[_0xf1f8('0x1c')]:_0x4f06b4[_0xf1f8('0x1d')]+_0x4f06b4[_0xf1f8('0x1e')];var _0x4e5dde;if(_0x1f5717>=_0xe98095){_0x1f5717=_0xe98095;_0x4e5dde=0xc8;}else{_0x4e5dde=0xce;}_0x3423b5['status'](_0x4e5dde);return _0x3423b5['set'](_0xf1f8('0x1f'),_0x15b471+'-'+_0x1f5717+'/'+_0xe98095)[_0xf1f8('0x1a')](_0x48931a);}return null;};}function patchUpdates(_0x2fb898){return function(_0x3a5b99){try{jsonpatch[_0xf1f8('0x20')](_0x3a5b99,_0x2fb898,!![]);}catch(_0x35b6c5){return BPromise[_0xf1f8('0x21')](_0x35b6c5);}return _0x3a5b99['save']();};}function saveUpdates(_0x3d2c79,_0x37d565){return function(_0x21c664){if(_0x21c664){return _0x21c664[_0xf1f8('0x22')](_0x3d2c79)['then'](function(_0x2ae578){return _0x2ae578;});}return null;};}function removeEntity(_0x13ca4f,_0x1a0341){return function(_0xf56780){if(_0xf56780){return _0xf56780[_0xf1f8('0x23')]()['then'](function(){_0x13ca4f['status'](0xcc)[_0xf1f8('0x24')]();});}};}function handleEntityNotFound(_0x1ccadc,_0x35dbc5){return function(_0x22f5ac){if(!_0x22f5ac){_0x1ccadc[_0xf1f8('0x18')](0x194);}return _0x22f5ac;};}function handleError(_0x3e9fc5,_0x184f99){_0x184f99=_0x184f99||0x1f4;return function(_0x320eed){logger['error'](_0x320eed[_0xf1f8('0x25')]);if(_0x320eed[_0xf1f8('0x26')]){delete _0x320eed[_0xf1f8('0x26')];}_0x3e9fc5[_0xf1f8('0x19')](_0x184f99)[_0xf1f8('0x27')](_0x320eed);};}exports['index']=function(_0x5692c6,_0x291b4b){var _0x574a1b={},_0x21b0d7={},_0x4d3eee={'count':0x0,'rows':[]};var _0x365acc=_[_0xf1f8('0x28')](db['MailServerOut'][_0xf1f8('0x29')],function(_0x13149d){return{'name':_0x13149d[_0xf1f8('0x2a')],'type':_0x13149d[_0xf1f8('0x2b')][_0xf1f8('0x2c')]};});_0x21b0d7[_0xf1f8('0x2d')]=_[_0xf1f8('0x28')](_0x365acc,_0xf1f8('0x26'));_0x21b0d7['query']=_[_0xf1f8('0x2e')](_0x5692c6[_0xf1f8('0x2f')]);_0x21b0d7['filters']=_[_0xf1f8('0x30')](_0x21b0d7[_0xf1f8('0x2d')],_0x21b0d7[_0xf1f8('0x2f')]);_0x574a1b[_0xf1f8('0x31')]=_[_0xf1f8('0x30')](_0x21b0d7[_0xf1f8('0x2d')],qs[_0xf1f8('0x32')](_0x5692c6[_0xf1f8('0x2f')][_0xf1f8('0x32')]));_0x574a1b[_0xf1f8('0x31')]=_0x574a1b[_0xf1f8('0x31')][_0xf1f8('0x33')]?_0x574a1b[_0xf1f8('0x31')]:_0x21b0d7[_0xf1f8('0x2d')];if(!_0x5692c6[_0xf1f8('0x2f')]['hasOwnProperty']('nolimit')){_0x574a1b[_0xf1f8('0x1e')]=qs[_0xf1f8('0x1e')](_0x5692c6[_0xf1f8('0x2f')][_0xf1f8('0x1e')]);_0x574a1b[_0xf1f8('0x1d')]=qs[_0xf1f8('0x1d')](_0x5692c6[_0xf1f8('0x2f')][_0xf1f8('0x1d')]);}_0x574a1b[_0xf1f8('0x34')]=qs['sort'](_0x5692c6[_0xf1f8('0x2f')][_0xf1f8('0x35')]);_0x574a1b[_0xf1f8('0x36')]=qs[_0xf1f8('0x37')](_[_0xf1f8('0x38')](_0x5692c6[_0xf1f8('0x2f')],_0x21b0d7[_0xf1f8('0x37')]),_0x365acc);if(_0x5692c6[_0xf1f8('0x2f')][_0xf1f8('0x39')]){_0x574a1b['where']=_[_0xf1f8('0x3a')](_0x574a1b[_0xf1f8('0x36')],{'$or':_[_0xf1f8('0x28')](_0x365acc,function(_0x423517){if(_0x423517[_0xf1f8('0x2b')]!=='VIRTUAL'){var _0x4c8c3a={};_0x4c8c3a[_0x423517[_0xf1f8('0x26')]]={'$like':'%'+_0x5692c6[_0xf1f8('0x2f')][_0xf1f8('0x39')]+'%'};return _0x4c8c3a;}})});}_0x574a1b=_[_0xf1f8('0x3a')]({},_0x574a1b,_0x5692c6[_0xf1f8('0x3b')]);var _0xe630b4={'where':_0x574a1b['where']};return db[_0xf1f8('0x3c')][_0xf1f8('0x1c')](_0xe630b4)[_0xf1f8('0x3d')](function(_0xa34835){_0x4d3eee[_0xf1f8('0x1c')]=_0xa34835;if(_0x5692c6[_0xf1f8('0x2f')]['includeAll']){_0x574a1b[_0xf1f8('0x3e')]=[{'all':!![]}];}return db[_0xf1f8('0x3c')]['findAll'](_0x574a1b);})[_0xf1f8('0x3d')](function(_0xba9f98){_0x4d3eee[_0xf1f8('0x3f')]=_0xba9f98;return _0x4d3eee;})[_0xf1f8('0x3d')](respondWithFilteredResult(_0x291b4b,_0x574a1b))['catch'](handleError(_0x291b4b,null));};exports[_0xf1f8('0x40')]=function(_0x21e326,_0x3656b1){var _0x2b1eff={'raw':!![],'where':{'id':_0x21e326[_0xf1f8('0x41')]['id']}},_0xf2dc2a={};_0xf2dc2a[_0xf1f8('0x2d')]=_[_0xf1f8('0x2e')](db[_0xf1f8('0x3c')]['rawAttributes']);_0xf2dc2a[_0xf1f8('0x2f')]=_[_0xf1f8('0x2e')](_0x21e326['query']);_0xf2dc2a['filters']=_[_0xf1f8('0x30')](_0xf2dc2a[_0xf1f8('0x2d')],_0xf2dc2a[_0xf1f8('0x2f')]);_0x2b1eff[_0xf1f8('0x31')]=_[_0xf1f8('0x30')](_0xf2dc2a[_0xf1f8('0x2d')],qs[_0xf1f8('0x32')](_0x21e326['query'][_0xf1f8('0x32')]));_0x2b1eff[_0xf1f8('0x31')]=_0x2b1eff[_0xf1f8('0x31')]['length']?_0x2b1eff[_0xf1f8('0x31')]:_0xf2dc2a['model'];if(_0x21e326['query'][_0xf1f8('0x42')]){_0x2b1eff['include']=[{'all':!![]}];}_0x2b1eff=_[_0xf1f8('0x3a')]({},_0x2b1eff,_0x21e326['options']);return db[_0xf1f8('0x3c')]['find'](_0x2b1eff)[_0xf1f8('0x3d')](handleEntityNotFound(_0x3656b1,null))[_0xf1f8('0x3d')](respondWithResult(_0x3656b1,null))[_0xf1f8('0x43')](handleError(_0x3656b1,null));};exports[_0xf1f8('0x44')]=function(_0x5557b5,_0x350beb){return db[_0xf1f8('0x3c')][_0xf1f8('0x44')](_0x5557b5[_0xf1f8('0x45')],{})[_0xf1f8('0x3d')](respondWithResult(_0x350beb,0xc9))['catch'](handleError(_0x350beb,null));};exports['update']=function(_0x5c988d,_0x12bd0f){if(_0x5c988d[_0xf1f8('0x45')]['id']){delete _0x5c988d[_0xf1f8('0x45')]['id'];}return db[_0xf1f8('0x3c')][_0xf1f8('0x46')]({'where':{'id':_0x5c988d[_0xf1f8('0x41')]['id']}})['then'](handleEntityNotFound(_0x12bd0f,null))[_0xf1f8('0x3d')](saveUpdates(_0x5c988d[_0xf1f8('0x45')],null))[_0xf1f8('0x3d')](respondWithResult(_0x12bd0f,null))[_0xf1f8('0x43')](handleError(_0x12bd0f,null));};exports[_0xf1f8('0x23')]=function(_0x26b05a,_0x59e0c6){return db[_0xf1f8('0x3c')][_0xf1f8('0x46')]({'where':{'id':_0x26b05a['params']['id']}})[_0xf1f8('0x3d')](handleEntityNotFound(_0x59e0c6,null))[_0xf1f8('0x3d')](removeEntity(_0x59e0c6,null))[_0xf1f8('0x43')](handleError(_0x59e0c6,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 1ed47e4..561eae0 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 _0x9f0f=['mail_servers_out','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./mailServerOut.attributes','exports','define','MailServerOut'];(function(_0x15106b,_0x4d96f6){var _0x521203=function(_0x4dbe23){while(--_0x4dbe23){_0x15106b['push'](_0x15106b['shift']());}};_0x521203(++_0x4d96f6);}(_0x9f0f,0x1cf));var _0xf9f0=function(_0x47a12b,_0x50c182){_0x47a12b=_0x47a12b-0x0;var _0x588200=_0x9f0f[_0x47a12b];return _0x588200;};'use strict';var _=require(_0xf9f0('0x0'));var util=require(_0xf9f0('0x1'));var logger=require(_0xf9f0('0x2'))(_0xf9f0('0x3'));var moment=require(_0xf9f0('0x4'));var BPromise=require(_0xf9f0('0x5'));var rp=require(_0xf9f0('0x6'));var fs=require('fs');var path=require(_0xf9f0('0x7'));var rimraf=require(_0xf9f0('0x8'));var config=require('../../config/environment');var attributes=require(_0xf9f0('0x9'));module[_0xf9f0('0xa')]=function(_0x1ba97d,_0x1419aa){return _0x1ba97d[_0xf9f0('0xb')](_0xf9f0('0xc'),attributes,{'tableName':_0xf9f0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xca16=['../../config/logger','api','request-promise','path','./mailServerOut.attributes','MailServerOut','lodash','util'];(function(_0x5b8c1b,_0x500d78){var _0x81587a=function(_0x393b5a){while(--_0x393b5a){_0x5b8c1b['push'](_0x5b8c1b['shift']());}};_0x81587a(++_0x500d78);}(_0xca16,0xa6));var _0x6ca1=function(_0x45482b,_0x203bcb){_0x45482b=_0x45482b-0x0;var _0x4db7df=_0xca16[_0x45482b];return _0x4db7df;};'use strict';var _=require(_0x6ca1('0x0'));var util=require(_0x6ca1('0x1'));var logger=require(_0x6ca1('0x2'))(_0x6ca1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6ca1('0x4'));var fs=require('fs');var path=require(_0x6ca1('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6ca1('0x6'));module['exports']=function(_0x9877c4,_0x396785){return _0x9877c4['define'](_0x6ca1('0x7'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 7fa34f7..57a0b81 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x12675a,_0x56b4a2){var _0x22fc70=function(_0x316071){while(--_0x316071){_0x12675a['push'](_0x12675a['shift']());}};_0x22fc70(++_0x56b4a2);}(_0xdb28,0x106));var _0x8db2=function(_0x1f16a2,_0x4fb9aa){_0x1f16a2=_0x1f16a2-0x0;var _0xdb1f4e=_0xdb28[_0x1f16a2];return _0xdb1f4e;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file +var _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(_0x11c1a1,_0x17ba8c){var _0x483746=function(_0x5253c3){while(--_0x5253c3){_0x11c1a1['push'](_0x11c1a1['shift']());}};_0x483746(++_0x17ba8c);}(_0xadb5,0xad));var _0x5adb=function(_0x55a444,_0x3ffb39){_0x55a444=_0x55a444-0x0;var _0x53c2ba=_0xadb5[_0x55a444];return _0x53c2ba;};'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 1bdfd2e..21f725f 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 _0x33d3=['post','create','put','update','delete','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','isAuthenticated','index','get','/describe','describe','/:id','show'];(function(_0x52548b,_0x178a6e){var _0x34025e=function(_0x36ab25){while(--_0x36ab25){_0x52548b['push'](_0x52548b['shift']());}};_0x34025e(++_0x178a6e);}(_0x33d3,0x159));var _0x333d=function(_0x5d76cc,_0x195736){_0x5d76cc=_0x5d76cc-0x0;var _0x4acce4=_0x33d3[_0x5d76cc];return _0x4acce4;};'use strict';var multer=require('multer');var util=require(_0x333d('0x0'));var path=require(_0x333d('0x1'));var timeout=require(_0x333d('0x2'));var express=require(_0x333d('0x3'));var router=express[_0x333d('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x333d('0x5'));var config=require(_0x333d('0x6'));var controller=require(_0x333d('0x7'));router['get']('/',auth[_0x333d('0x8')](),controller[_0x333d('0x9')]);router[_0x333d('0xa')](_0x333d('0xb'),auth[_0x333d('0x8')](),controller[_0x333d('0xc')]);router[_0x333d('0xa')](_0x333d('0xd'),auth[_0x333d('0x8')](),controller[_0x333d('0xe')]);router[_0x333d('0xf')]('/',auth[_0x333d('0x8')](),controller[_0x333d('0x10')]);router[_0x333d('0x11')](_0x333d('0xd'),auth[_0x333d('0x8')](),controller[_0x333d('0x12')]);router[_0x333d('0x13')]('/:id',auth[_0x333d('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xdaef=['create','put','update','delete','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post'];(function(_0x58386b,_0xe17103){var _0x3af06d=function(_0x205769){while(--_0x205769){_0x58386b['push'](_0x58386b['shift']());}};_0x3af06d(++_0xe17103);}(_0xdaef,0x1e0));var _0xfdae=function(_0x2c92f5,_0x46280b){_0x2c92f5=_0x2c92f5-0x0;var _0x3b3a97=_0xdaef[_0x2c92f5];return _0x3b3a97;};'use strict';var multer=require(_0xfdae('0x0'));var util=require('util');var path=require(_0xfdae('0x1'));var timeout=require(_0xfdae('0x2'));var express=require('express');var router=express[_0xfdae('0x3')]();var fs_extra=require(_0xfdae('0x4'));var auth=require(_0xfdae('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfdae('0x6'));var controller=require('./mailSubstatus.controller');router[_0xfdae('0x7')]('/',auth[_0xfdae('0x8')](),controller[_0xfdae('0x9')]);router[_0xfdae('0x7')](_0xfdae('0xa'),auth[_0xfdae('0x8')](),controller['describe']);router[_0xfdae('0x7')](_0xfdae('0xb'),auth[_0xfdae('0x8')](),controller[_0xfdae('0xc')]);router[_0xfdae('0xd')]('/',auth[_0xfdae('0x8')](),controller[_0xfdae('0xe')]);router[_0xfdae('0xf')]('/:id',auth[_0xfdae('0x8')](),controller[_0xfdae('0x10')]);router[_0xfdae('0x11')](_0xfdae('0xb'),auth[_0xfdae('0x8')](),controller['destroy']);module[_0xfdae('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 3fd959f..63aa6bb 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 _0xc4aa=['exports','STRING','name','sequelize'];(function(_0x590859,_0x10ed61){var _0x24534e=function(_0x365404){while(--_0x365404){_0x590859['push'](_0x590859['shift']());}};_0x24534e(++_0x10ed61);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xc4aa[_0x16b9ed];return _0x66b1f8;};'use strict';var Sequelize=require(_0xac4a('0x0'));module[_0xac4a('0x1')]={'name':{'type':Sequelize[_0xac4a('0x2')],'unique':_0xac4a('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xac4a('0x2')]}}; \ No newline at end of file +var _0x6657=['STRING','name','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6657,0x17f));var _0x7665=function(_0x227c55,_0x49db56){_0x227c55=_0x227c55-0x0;var _0x49e02b=_0x6657[_0x227c55];return _0x49e02b;};'use strict';var Sequelize=require(_0x7665('0x0'));module['exports']={'name':{'type':Sequelize[_0x7665('0x1')],'unique':_0x7665('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7665('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 8c98a7f..eeea428 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 _0x04f2=['status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','destroy','error','stack','name','send','index','map','MailSubstatus','rawAttributes','key','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','catch','params','model','find','create','body','update','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x5b68f7,_0x483a99){var _0x3e64fd=function(_0x1a237b){while(--_0x1a237b){_0x5b68f7['push'](_0x5b68f7['shift']());}};_0x3e64fd(++_0x483a99);}(_0x04f2,0x1e5));var _0x204f=function(_0x209a41,_0x2eaa07){_0x209a41=_0x209a41-0x0;var _0x17f73d=_0x04f2[_0x209a41];return _0x17f73d;};'use strict';var emlformat=require(_0x204f('0x0'));var rimraf=require(_0x204f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x204f('0x2'));var rp=require(_0x204f('0x3'));var moment=require(_0x204f('0x4'));var BPromise=require(_0x204f('0x5'));var Mustache=require(_0x204f('0x6'));var util=require(_0x204f('0x7'));var path=require('path');var sox=require(_0x204f('0x8'));var csv=require(_0x204f('0x9'));var ejs=require(_0x204f('0xa'));var fs=require('fs');var fs_extra=require(_0x204f('0xb'));var _=require(_0x204f('0xc'));var squel=require(_0x204f('0xd'));var crypto=require(_0x204f('0xe'));var jsforce=require(_0x204f('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x204f('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x204f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x204f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x204f('0x13'))(_0x204f('0x14'));var utils=require(_0x204f('0x15'));var config=require(_0x204f('0x16'));var licenseUtil=require(_0x204f('0x17'));var db=require(_0x204f('0x18'))['db'];function respondWithStatusCode(_0x11918f,_0x587c00){_0x587c00=_0x587c00||0xcc;return function(_0x24863f){if(_0x24863f){return _0x11918f[_0x204f('0x19')](_0x587c00);}return _0x11918f[_0x204f('0x1a')](_0x587c00)[_0x204f('0x1b')]();};}function respondWithResult(_0x452a53,_0x1bb04e){_0x1bb04e=_0x1bb04e||0xc8;return function(_0x801d9){if(_0x801d9){return _0x452a53[_0x204f('0x1a')](_0x1bb04e)['json'](_0x801d9);}};}function respondWithFilteredResult(_0x5232dd,_0x2c2e71){return function(_0x1acb13){if(_0x1acb13){var _0x8c69ff=typeof _0x2c2e71[_0x204f('0x1c')]===_0x204f('0x1d')&&typeof _0x2c2e71[_0x204f('0x1e')]===_0x204f('0x1d');var _0x3a57b2=_0x1acb13[_0x204f('0x1f')];var _0x471a36=_0x8c69ff?0x0:_0x2c2e71[_0x204f('0x1c')];var _0x1d1491=_0x8c69ff?_0x1acb13[_0x204f('0x1f')]:_0x2c2e71[_0x204f('0x1c')]+_0x2c2e71[_0x204f('0x1e')];var _0x1846d9;if(_0x1d1491>=_0x3a57b2){_0x1d1491=_0x3a57b2;_0x1846d9=0xc8;}else{_0x1846d9=0xce;}_0x5232dd[_0x204f('0x1a')](_0x1846d9);return _0x5232dd[_0x204f('0x20')](_0x204f('0x21'),_0x471a36+'-'+_0x1d1491+'/'+_0x3a57b2)[_0x204f('0x22')](_0x1acb13);}return null;};}function patchUpdates(_0x3adac2){return function(_0x552cf0){try{jsonpatch[_0x204f('0x23')](_0x552cf0,_0x3adac2,!![]);}catch(_0x3e6569){return BPromise['reject'](_0x3e6569);}return _0x552cf0[_0x204f('0x24')]();};}function saveUpdates(_0x358d09,_0xa6e37a){return function(_0x1b820a){if(_0x1b820a){return _0x1b820a['update'](_0x358d09)[_0x204f('0x25')](function(_0x317180){return _0x317180;});}return null;};}function removeEntity(_0x4d229a,_0x17c696){return function(_0x2bec4d){if(_0x2bec4d){return _0x2bec4d[_0x204f('0x26')]()[_0x204f('0x25')](function(){_0x4d229a[_0x204f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42e0fa,_0x2a1b20){return function(_0x2e0558){if(!_0x2e0558){_0x42e0fa[_0x204f('0x19')](0x194);}return _0x2e0558;};}function handleError(_0x15a4fc,_0x13aadf){_0x13aadf=_0x13aadf||0x1f4;return function(_0x32f9de){logger[_0x204f('0x27')](_0x32f9de[_0x204f('0x28')]);if(_0x32f9de[_0x204f('0x29')]){delete _0x32f9de['name'];}_0x15a4fc['status'](_0x13aadf)[_0x204f('0x2a')](_0x32f9de);};}exports[_0x204f('0x2b')]=function(_0x488aad,_0x26cdb){var _0x542f63={},_0x19c7d0={},_0xdf643a={'count':0x0,'rows':[]};var _0x17077a=_[_0x204f('0x2c')](db[_0x204f('0x2d')][_0x204f('0x2e')],function(_0x5b63d0){return{'name':_0x5b63d0['fieldName'],'type':_0x5b63d0['type'][_0x204f('0x2f')]};});_0x19c7d0['model']=_[_0x204f('0x2c')](_0x17077a,_0x204f('0x29'));_0x19c7d0[_0x204f('0x30')]=_[_0x204f('0x31')](_0x488aad[_0x204f('0x30')]);_0x19c7d0[_0x204f('0x32')]=_[_0x204f('0x33')](_0x19c7d0['model'],_0x19c7d0[_0x204f('0x30')]);_0x542f63[_0x204f('0x34')]=_[_0x204f('0x33')](_0x19c7d0['model'],qs[_0x204f('0x35')](_0x488aad['query'][_0x204f('0x35')]));_0x542f63['attributes']=_0x542f63[_0x204f('0x34')][_0x204f('0x36')]?_0x542f63['attributes']:_0x19c7d0['model'];if(!_0x488aad[_0x204f('0x30')][_0x204f('0x37')]('nolimit')){_0x542f63[_0x204f('0x1e')]=qs[_0x204f('0x1e')](_0x488aad[_0x204f('0x30')][_0x204f('0x1e')]);_0x542f63[_0x204f('0x1c')]=qs[_0x204f('0x1c')](_0x488aad[_0x204f('0x30')][_0x204f('0x1c')]);}_0x542f63['order']=qs[_0x204f('0x38')](_0x488aad[_0x204f('0x30')][_0x204f('0x38')]);_0x542f63[_0x204f('0x39')]=qs[_0x204f('0x32')](_[_0x204f('0x3a')](_0x488aad['query'],_0x19c7d0[_0x204f('0x32')]),_0x17077a);if(_0x488aad['query'][_0x204f('0x3b')]){_0x542f63[_0x204f('0x39')]=_['merge'](_0x542f63[_0x204f('0x39')],{'$or':_['map'](_0x17077a,function(_0x49c8e9){if(_0x49c8e9[_0x204f('0x3c')]!==_0x204f('0x3d')){var _0x1682b2={};_0x1682b2[_0x49c8e9['name']]={'$like':'%'+_0x488aad[_0x204f('0x30')][_0x204f('0x3b')]+'%'};return _0x1682b2;}})});}_0x542f63=_[_0x204f('0x3e')]({},_0x542f63,_0x488aad[_0x204f('0x3f')]);var _0x1d27ee={'where':_0x542f63[_0x204f('0x39')]};return db[_0x204f('0x2d')][_0x204f('0x1f')](_0x1d27ee)[_0x204f('0x25')](function(_0x2da904){_0xdf643a[_0x204f('0x1f')]=_0x2da904;if(_0x488aad[_0x204f('0x30')][_0x204f('0x40')]){_0x542f63[_0x204f('0x41')]=[{'all':!![]}];}return db[_0x204f('0x2d')]['findAll'](_0x542f63);})['then'](function(_0x4c66c5){_0xdf643a['rows']=_0x4c66c5;return _0xdf643a;})[_0x204f('0x25')](respondWithFilteredResult(_0x26cdb,_0x542f63))[_0x204f('0x42')](handleError(_0x26cdb,null));};exports['show']=function(_0xda4cae,_0xac2774){var _0x21145f={'raw':!![],'where':{'id':_0xda4cae[_0x204f('0x43')]['id']}},_0x3970c4={};_0x3970c4[_0x204f('0x44')]=_['keys'](db[_0x204f('0x2d')]['rawAttributes']);_0x3970c4['query']=_[_0x204f('0x31')](_0xda4cae['query']);_0x3970c4['filters']=_['intersection'](_0x3970c4[_0x204f('0x44')],_0x3970c4[_0x204f('0x30')]);_0x21145f[_0x204f('0x34')]=_['intersection'](_0x3970c4['model'],qs[_0x204f('0x35')](_0xda4cae[_0x204f('0x30')]['fields']));_0x21145f[_0x204f('0x34')]=_0x21145f[_0x204f('0x34')][_0x204f('0x36')]?_0x21145f[_0x204f('0x34')]:_0x3970c4[_0x204f('0x44')];if(_0xda4cae[_0x204f('0x30')][_0x204f('0x40')]){_0x21145f[_0x204f('0x41')]=[{'all':!![]}];}_0x21145f=_[_0x204f('0x3e')]({},_0x21145f,_0xda4cae[_0x204f('0x3f')]);return db[_0x204f('0x2d')][_0x204f('0x45')](_0x21145f)['then'](handleEntityNotFound(_0xac2774,null))[_0x204f('0x25')](respondWithResult(_0xac2774,null))[_0x204f('0x42')](handleError(_0xac2774,null));};exports[_0x204f('0x46')]=function(_0x4fb1af,_0x1792f5){return db[_0x204f('0x2d')][_0x204f('0x46')](_0x4fb1af[_0x204f('0x47')],{})['then'](respondWithResult(_0x1792f5,0xc9))[_0x204f('0x42')](handleError(_0x1792f5,null));};exports[_0x204f('0x48')]=function(_0x4c6ffb,_0x501b84){if(_0x4c6ffb[_0x204f('0x47')]['id']){delete _0x4c6ffb['body']['id'];}return db[_0x204f('0x2d')][_0x204f('0x45')]({'where':{'id':_0x4c6ffb['params']['id']}})[_0x204f('0x25')](handleEntityNotFound(_0x501b84,null))['then'](saveUpdates(_0x4c6ffb[_0x204f('0x47')],null))[_0x204f('0x25')](respondWithResult(_0x501b84,null))[_0x204f('0x42')](handleError(_0x501b84,null));};exports['destroy']=function(_0xe85721,_0x49906b){return db[_0x204f('0x2d')]['find']({'where':{'id':_0xe85721['params']['id']}})[_0x204f('0x25')](handleEntityNotFound(_0x49906b,null))[_0x204f('0x25')](removeEntity(_0x49906b,null))[_0x204f('0x42')](handleError(_0x49906b,null));};exports['describe']=function(_0x3e91dc,_0x27d257){return db[_0x204f('0x2d')]['describe']()[_0x204f('0x25')](respondWithResult(_0x27d257,null))[_0x204f('0x42')](handleError(_0x27d257,null));}; \ No newline at end of file +var _0x58a5=['zip-dir','bluebird','mustache','util','path','sox','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','map','MailSubstatus','rawAttributes','key','model','query','keys','filters','intersection','fields','length','attributes','nolimit','order','sort','where','pick','type','filter','merge','findAll','rows','catch','show','params','includeAll','include','options','find','create','body','update','describe'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0x58a5,0x1aa));var _0x558a=function(_0x648163,_0x241576){_0x648163=_0x648163-0x0;var _0x199d4d=_0x58a5[_0x648163];return _0x199d4d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x558a('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x558a('0x1'));var Mustache=require(_0x558a('0x2'));var util=require(_0x558a('0x3'));var path=require(_0x558a('0x4'));var sox=require(_0x558a('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x558a('0x6'));var squel=require(_0x558a('0x7'));var crypto=require(_0x558a('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x558a('0x9'));var toCsv=require('to-csv');var querystring=require(_0x558a('0xa'));var Papa=require(_0x558a('0xb'));var Redis=require(_0x558a('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x558a('0xd'));var as=require(_0x558a('0xe'));var hardwareService=require(_0x558a('0xf'));var logger=require('../../config/logger')(_0x558a('0x10'));var utils=require(_0x558a('0x11'));var config=require(_0x558a('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb0c083,_0x5b83b4){_0x5b83b4=_0x5b83b4||0xcc;return function(_0x20d448){if(_0x20d448){return _0xb0c083[_0x558a('0x13')](_0x5b83b4);}return _0xb0c083['status'](_0x5b83b4)['end']();};}function respondWithResult(_0x3f2928,_0x4acdfc){_0x4acdfc=_0x4acdfc||0xc8;return function(_0x1a38dc){if(_0x1a38dc){return _0x3f2928['status'](_0x4acdfc)[_0x558a('0x14')](_0x1a38dc);}};}function respondWithFilteredResult(_0x15b1d5,_0x19aee2){return function(_0x26e515){if(_0x26e515){var _0x3339f0=typeof _0x19aee2[_0x558a('0x15')]===_0x558a('0x16')&&typeof _0x19aee2[_0x558a('0x17')]===_0x558a('0x16');var _0x14ff6e=_0x26e515[_0x558a('0x18')];var _0x3de2de=_0x3339f0?0x0:_0x19aee2[_0x558a('0x15')];var _0x6b7e7f=_0x3339f0?_0x26e515[_0x558a('0x18')]:_0x19aee2[_0x558a('0x15')]+_0x19aee2[_0x558a('0x17')];var _0x2e2214;if(_0x6b7e7f>=_0x14ff6e){_0x6b7e7f=_0x14ff6e;_0x2e2214=0xc8;}else{_0x2e2214=0xce;}_0x15b1d5[_0x558a('0x19')](_0x2e2214);return _0x15b1d5[_0x558a('0x1a')](_0x558a('0x1b'),_0x3de2de+'-'+_0x6b7e7f+'/'+_0x14ff6e)[_0x558a('0x14')](_0x26e515);}return null;};}function patchUpdates(_0x2b8c54){return function(_0x5a6b9b){try{jsonpatch[_0x558a('0x1c')](_0x5a6b9b,_0x2b8c54,!![]);}catch(_0x1bfdeb){return BPromise[_0x558a('0x1d')](_0x1bfdeb);}return _0x5a6b9b[_0x558a('0x1e')]();};}function saveUpdates(_0x19ff70,_0x3910d5){return function(_0x5c290b){if(_0x5c290b){return _0x5c290b['update'](_0x19ff70)[_0x558a('0x1f')](function(_0x32c78f){return _0x32c78f;});}return null;};}function removeEntity(_0x473f9b,_0x564877){return function(_0x3ef8fb){if(_0x3ef8fb){return _0x3ef8fb[_0x558a('0x20')]()[_0x558a('0x1f')](function(){_0x473f9b['status'](0xcc)[_0x558a('0x21')]();});}};}function handleEntityNotFound(_0x323736,_0x2c8a8a){return function(_0x51eca1){if(!_0x51eca1){_0x323736[_0x558a('0x13')](0x194);}return _0x51eca1;};}function handleError(_0xe44ef8,_0x5c7d66){_0x5c7d66=_0x5c7d66||0x1f4;return function(_0xaac5d8){logger[_0x558a('0x22')](_0xaac5d8[_0x558a('0x23')]);if(_0xaac5d8[_0x558a('0x24')]){delete _0xaac5d8[_0x558a('0x24')];}_0xe44ef8[_0x558a('0x19')](_0x5c7d66)[_0x558a('0x25')](_0xaac5d8);};}exports['index']=function(_0x1c11be,_0x3e4929){var _0xb0975b={},_0x17783d={},_0x5a0a98={'count':0x0,'rows':[]};var _0x5b91fa=_[_0x558a('0x26')](db[_0x558a('0x27')][_0x558a('0x28')],function(_0x593ccd){return{'name':_0x593ccd['fieldName'],'type':_0x593ccd['type'][_0x558a('0x29')]};});_0x17783d[_0x558a('0x2a')]=_[_0x558a('0x26')](_0x5b91fa,'name');_0x17783d[_0x558a('0x2b')]=_[_0x558a('0x2c')](_0x1c11be[_0x558a('0x2b')]);_0x17783d[_0x558a('0x2d')]=_[_0x558a('0x2e')](_0x17783d[_0x558a('0x2a')],_0x17783d[_0x558a('0x2b')]);_0xb0975b['attributes']=_[_0x558a('0x2e')](_0x17783d[_0x558a('0x2a')],qs[_0x558a('0x2f')](_0x1c11be['query'][_0x558a('0x2f')]));_0xb0975b['attributes']=_0xb0975b['attributes'][_0x558a('0x30')]?_0xb0975b[_0x558a('0x31')]:_0x17783d['model'];if(!_0x1c11be[_0x558a('0x2b')]['hasOwnProperty'](_0x558a('0x32'))){_0xb0975b[_0x558a('0x17')]=qs['limit'](_0x1c11be['query']['limit']);_0xb0975b[_0x558a('0x15')]=qs[_0x558a('0x15')](_0x1c11be[_0x558a('0x2b')][_0x558a('0x15')]);}_0xb0975b[_0x558a('0x33')]=qs['sort'](_0x1c11be[_0x558a('0x2b')][_0x558a('0x34')]);_0xb0975b[_0x558a('0x35')]=qs[_0x558a('0x2d')](_[_0x558a('0x36')](_0x1c11be[_0x558a('0x2b')],_0x17783d['filters']),_0x5b91fa);if(_0x1c11be['query']['filter']){_0xb0975b[_0x558a('0x35')]=_['merge'](_0xb0975b[_0x558a('0x35')],{'$or':_[_0x558a('0x26')](_0x5b91fa,function(_0x9a3dba){if(_0x9a3dba[_0x558a('0x37')]!=='VIRTUAL'){var _0x18b510={};_0x18b510[_0x9a3dba[_0x558a('0x24')]]={'$like':'%'+_0x1c11be['query'][_0x558a('0x38')]+'%'};return _0x18b510;}})});}_0xb0975b=_[_0x558a('0x39')]({},_0xb0975b,_0x1c11be['options']);var _0x5bdf0d={'where':_0xb0975b[_0x558a('0x35')]};return db['MailSubstatus']['count'](_0x5bdf0d)[_0x558a('0x1f')](function(_0x14e1fb){_0x5a0a98[_0x558a('0x18')]=_0x14e1fb;if(_0x1c11be[_0x558a('0x2b')]['includeAll']){_0xb0975b['include']=[{'all':!![]}];}return db[_0x558a('0x27')][_0x558a('0x3a')](_0xb0975b);})[_0x558a('0x1f')](function(_0x1e346f){_0x5a0a98[_0x558a('0x3b')]=_0x1e346f;return _0x5a0a98;})[_0x558a('0x1f')](respondWithFilteredResult(_0x3e4929,_0xb0975b))[_0x558a('0x3c')](handleError(_0x3e4929,null));};exports[_0x558a('0x3d')]=function(_0xed331c,_0x28bfe7){var _0x1071b7={'raw':!![],'where':{'id':_0xed331c[_0x558a('0x3e')]['id']}},_0x59789c={};_0x59789c[_0x558a('0x2a')]=_['keys'](db[_0x558a('0x27')][_0x558a('0x28')]);_0x59789c[_0x558a('0x2b')]=_['keys'](_0xed331c[_0x558a('0x2b')]);_0x59789c[_0x558a('0x2d')]=_[_0x558a('0x2e')](_0x59789c[_0x558a('0x2a')],_0x59789c[_0x558a('0x2b')]);_0x1071b7[_0x558a('0x31')]=_[_0x558a('0x2e')](_0x59789c['model'],qs['fields'](_0xed331c['query']['fields']));_0x1071b7[_0x558a('0x31')]=_0x1071b7[_0x558a('0x31')][_0x558a('0x30')]?_0x1071b7[_0x558a('0x31')]:_0x59789c[_0x558a('0x2a')];if(_0xed331c[_0x558a('0x2b')][_0x558a('0x3f')]){_0x1071b7[_0x558a('0x40')]=[{'all':!![]}];}_0x1071b7=_[_0x558a('0x39')]({},_0x1071b7,_0xed331c[_0x558a('0x41')]);return db[_0x558a('0x27')][_0x558a('0x42')](_0x1071b7)[_0x558a('0x1f')](handleEntityNotFound(_0x28bfe7,null))[_0x558a('0x1f')](respondWithResult(_0x28bfe7,null))[_0x558a('0x3c')](handleError(_0x28bfe7,null));};exports[_0x558a('0x43')]=function(_0x3897f8,_0x4f2e24){return db[_0x558a('0x27')][_0x558a('0x43')](_0x3897f8[_0x558a('0x44')],{})[_0x558a('0x1f')](respondWithResult(_0x4f2e24,0xc9))[_0x558a('0x3c')](handleError(_0x4f2e24,null));};exports[_0x558a('0x45')]=function(_0x2d00f,_0x2b624a){if(_0x2d00f[_0x558a('0x44')]['id']){delete _0x2d00f[_0x558a('0x44')]['id'];}return db['MailSubstatus'][_0x558a('0x42')]({'where':{'id':_0x2d00f[_0x558a('0x3e')]['id']}})[_0x558a('0x1f')](handleEntityNotFound(_0x2b624a,null))[_0x558a('0x1f')](saveUpdates(_0x2d00f[_0x558a('0x44')],null))['then'](respondWithResult(_0x2b624a,null))[_0x558a('0x3c')](handleError(_0x2b624a,null));};exports['destroy']=function(_0x545eb5,_0xda842b){return db[_0x558a('0x27')][_0x558a('0x42')]({'where':{'id':_0x545eb5[_0x558a('0x3e')]['id']}})['then'](handleEntityNotFound(_0xda842b,null))[_0x558a('0x1f')](removeEntity(_0xda842b,null))['catch'](handleError(_0xda842b,null));};exports[_0x558a('0x46')]=function(_0x496b85,_0x3f840f){return db['MailSubstatus']['describe']()[_0x558a('0x1f')](respondWithResult(_0x3f840f,null))[_0x558a('0x3c')](handleError(_0x3f840f,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 913128b..885d10c 100644 --- a/server/api/mailSubstatus/mailSubstatus.events.js +++ b/server/api/mailSubstatus/mailSubstatus.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5a53=['../../mysqldb','update','emit','hasOwnProperty','hook','exports'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x5a53,0x156));var _0x35a5=function(_0x3e37e2,_0x5800f5){_0x3e37e2=_0x3e37e2-0x0;var _0xc220b9=_0x5a53[_0x3e37e2];return _0xc220b9;};'use strict';var EventEmitter=require('events');var MailSubstatus=require(_0x35a5('0x0'))['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0x35a5('0x1')};function emitEvent(_0x228c02){return function(_0x1182b8,_0xe1444,_0x3c2d2e){MailSubstatusEvents[_0x35a5('0x2')](_0x228c02+':'+_0x1182b8['id'],_0x1182b8);MailSubstatusEvents[_0x35a5('0x2')](_0x228c02,_0x1182b8);_0x3c2d2e(null);};}for(var e in events){if(events[_0x35a5('0x3')](e)){var event=events[e];MailSubstatus[_0x35a5('0x4')](e,emitEvent(event));}}module[_0x35a5('0x5')]=MailSubstatusEvents; \ No newline at end of file +var _0xe086=['hook','exports','events','../../mysqldb','MailSubstatus','setMaxListeners','update','emit'];(function(_0x37eb7c,_0x3f53f0){var _0x1a1167=function(_0x48f751){while(--_0x48f751){_0x37eb7c['push'](_0x37eb7c['shift']());}};_0x1a1167(++_0x3f53f0);}(_0xe086,0x142));var _0x6e08=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe086[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x6e08('0x0'));var MailSubstatus=require(_0x6e08('0x1'))['db'][_0x6e08('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x6e08('0x3')](0x0);var events={'afterUpdate':_0x6e08('0x4')};function emitEvent(_0x58e5a4){return function(_0x3b33f5,_0x4fd445,_0x42cb5f){MailSubstatusEvents[_0x6e08('0x5')](_0x58e5a4+':'+_0x3b33f5['id'],_0x3b33f5);MailSubstatusEvents[_0x6e08('0x5')](_0x58e5a4,_0x3b33f5);_0x42cb5f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0x6e08('0x6')](e,emitEvent(event));}}module[_0x6e08('0x7')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 4b13168..042039e 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 _0x222a=['exports','models','MailSubstatus','mail_substatuses','Condition','update','name','then','catch','./mailSubstatus.attributes'];(function(_0x1328c5,_0x191c67){var _0x16d639=function(_0x208198){while(--_0x208198){_0x1328c5['push'](_0x1328c5['shift']());}};_0x16d639(++_0x191c67);}(_0x222a,0xb3));var _0xa222=function(_0x2ebedc,_0x2f1711){_0x2ebedc=_0x2ebedc-0x0;var _0x16f026=_0x222a[_0x2ebedc];return _0x16f026;};'use strict';var attributes=require(_0xa222('0x0'));module[_0xa222('0x1')]=function(_0x22c006){var _0x18a10d=_0x22c006[_0xa222('0x2')];return _0x22c006['define'](_0xa222('0x3'),attributes,{'tableName':_0xa222('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x3af606,_0x52c8c8,_0xe0f254){return _0x18a10d[_0xa222('0x5')][_0xa222('0x6')]({'value':_0x3af606[_0xa222('0x7')]},{'where':{'field':'mailSubstatus','value':_0x3af606['_previousDataValues'][_0xa222('0x7')]}})[_0xa222('0x8')](function(){_0xe0f254();})[_0xa222('0x9')](function(_0x2f90f2){_0xe0f254(_0x2f90f2);});}}});}; \ No newline at end of file +var _0xea59=['Condition','update','mailSubstatus','name','then','catch','./mailSubstatus.attributes','exports','models','define','mail_substatuses'];(function(_0x35cafb,_0x5e3489){var _0x4f7d13=function(_0x5c11b8){while(--_0x5c11b8){_0x35cafb['push'](_0x35cafb['shift']());}};_0x4f7d13(++_0x5e3489);}(_0xea59,0x1ea));var _0x9ea5=function(_0x3df364,_0x3943d2){_0x3df364=_0x3df364-0x0;var _0xe6547a=_0xea59[_0x3df364];return _0xe6547a;};'use strict';var attributes=require(_0x9ea5('0x0'));module[_0x9ea5('0x1')]=function(_0x488c6e){var _0x17df1b=_0x488c6e[_0x9ea5('0x2')];return _0x488c6e[_0x9ea5('0x3')]('MailSubstatus',attributes,{'tableName':_0x9ea5('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x300433,_0x260e8b,_0x25d57f){return _0x17df1b[_0x9ea5('0x5')][_0x9ea5('0x6')]({'value':_0x300433['name']},{'where':{'field':_0x9ea5('0x7'),'value':_0x300433['_previousDataValues'][_0x9ea5('0x8')]}})[_0x9ea5('0x9')](function(){_0x25d57f();})[_0x9ea5('0xa')](function(_0x216abf){_0x25d57f(_0x216abf);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index a57a93d..6f8b2f8 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 _0x80bf=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x45ba00,_0x13f636){var _0x1db066=function(_0x1f65ab){while(--_0x1f65ab){_0x45ba00['push'](_0x45ba00['shift']());}};_0x1db066(++_0x13f636);}(_0x80bf,0x168));var _0xf80b=function(_0x24097d,_0x2ceff5){_0x24097d=_0x24097d-0x0;var _0x106003=_0x80bf[_0x24097d];return _0x106003;};'use strict';var _=require(_0xf80b('0x0'));var util=require(_0xf80b('0x1'));var moment=require(_0xf80b('0x2'));var BPromise=require(_0xf80b('0x3'));var rs=require(_0xf80b('0x4'));var fs=require('fs');var Redis=require(_0xf80b('0x5'));var db=require(_0xf80b('0x6'))['db'];var utils=require(_0xf80b('0x7'));var logger=require(_0xf80b('0x8'))(_0xf80b('0x9'));var config=require('../../config/environment');var jayson=require(_0xf80b('0xa'));var client=jayson[_0xf80b('0xb')][_0xf80b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x464728,_0x88afcd,_0x12e62d){return new BPromise(function(_0x3e3a80,_0x1e464f){return client[_0xf80b('0xd')](_0x464728,_0x12e62d)[_0xf80b('0xe')](function(_0xd6ac64){logger[_0xf80b('0xf')](_0xf80b('0x10'),_0x88afcd,_0xf80b('0x11'));logger[_0xf80b('0x12')](_0xf80b('0x13'),_0x88afcd,'request\x20sent',JSON[_0xf80b('0x14')](_0xd6ac64));if(_0xd6ac64['error']){if(_0xd6ac64[_0xf80b('0x15')]['code']===0x1f4){logger[_0xf80b('0x15')](_0xf80b('0x10'),_0x88afcd,_0xd6ac64['error'][_0xf80b('0x16')]);return _0x1e464f(_0xd6ac64[_0xf80b('0x15')][_0xf80b('0x16')]);}logger['error'](_0xf80b('0x10'),_0x88afcd,_0xd6ac64[_0xf80b('0x15')]['message']);return _0x3e3a80(_0xd6ac64[_0xf80b('0x15')][_0xf80b('0x16')]);}else{logger['info'](_0xf80b('0x10'),_0x88afcd,_0xf80b('0x11'));_0x3e3a80(_0xd6ac64[_0xf80b('0x17')][_0xf80b('0x16')]);}})['catch'](function(_0x1cf192){logger['error'](_0xf80b('0x10'),_0x88afcd,_0x1cf192);_0x1e464f(_0x1cf192);});});} \ No newline at end of file +var _0xb514=['MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info'];(function(_0x40d9ed,_0x21b85a){var _0x37c713=function(_0x4da0ce){while(--_0x4da0ce){_0x40d9ed['push'](_0x40d9ed['shift']());}};_0x37c713(++_0x21b85a);}(_0xb514,0xc6));var _0x4b51=function(_0x1b3a5c,_0x2f9d5f){_0x1b3a5c=_0x1b3a5c-0x0;var _0x2ae8cb=_0xb514[_0x1b3a5c];return _0x2ae8cb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4b51('0x0'));var BPromise=require(_0x4b51('0x1'));var rs=require(_0x4b51('0x2'));var fs=require('fs');var Redis=require(_0x4b51('0x3'));var db=require(_0x4b51('0x4'))['db'];var utils=require(_0x4b51('0x5'));var logger=require('../../config/logger')(_0x4b51('0x6'));var config=require(_0x4b51('0x7'));var jayson=require(_0x4b51('0x8'));var client=jayson[_0x4b51('0x9')][_0x4b51('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59ca87,_0x1f8a25,_0x5ce9be){return new BPromise(function(_0x28dc82,_0x2326d0){return client['request'](_0x59ca87,_0x5ce9be)['then'](function(_0x52e371){logger[_0x4b51('0xb')](_0x4b51('0xc'),_0x1f8a25,_0x4b51('0xd'));logger[_0x4b51('0xe')](_0x4b51('0xf'),_0x1f8a25,'request\x20sent',JSON[_0x4b51('0x10')](_0x52e371));if(_0x52e371[_0x4b51('0x11')]){if(_0x52e371[_0x4b51('0x11')][_0x4b51('0x12')]===0x1f4){logger[_0x4b51('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x1f8a25,_0x52e371['error'][_0x4b51('0x13')]);return _0x2326d0(_0x52e371[_0x4b51('0x11')][_0x4b51('0x13')]);}logger[_0x4b51('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x1f8a25,_0x52e371[_0x4b51('0x11')][_0x4b51('0x13')]);return _0x28dc82(_0x52e371[_0x4b51('0x11')]['message']);}else{logger[_0x4b51('0xb')](_0x4b51('0xc'),_0x1f8a25,_0x4b51('0xd'));_0x28dc82(_0x52e371[_0x4b51('0x14')][_0x4b51('0x13')]);}})['catch'](function(_0xfa1285){logger[_0x4b51('0x11')](_0x4b51('0xc'),_0x1f8a25,_0xfa1285);_0x2326d0(_0xfa1285);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index ac6f498..9b3a081 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 _0xeaa3=['put','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./mailTransferReport.controller','get','isAuthenticated','/describe','/:id','show','post'];(function(_0x8b4953,_0x2c2740){var _0x3d31a6=function(_0x592150){while(--_0x592150){_0x8b4953['push'](_0x8b4953['shift']());}};_0x3d31a6(++_0x2c2740);}(_0xeaa3,0x1f3));var _0x3eaa=function(_0x22101d,_0xf364a4){_0x22101d=_0x22101d-0x0;var _0x42a3ca=_0xeaa3[_0x22101d];return _0x42a3ca;};'use strict';var multer=require('multer');var util=require(_0x3eaa('0x0'));var path=require(_0x3eaa('0x1'));var timeout=require(_0x3eaa('0x2'));var express=require(_0x3eaa('0x3'));var router=express['Router']();var fs_extra=require(_0x3eaa('0x4'));var auth=require(_0x3eaa('0x5'));var interaction=require(_0x3eaa('0x6'));var config=require('../../config/environment');var controller=require(_0x3eaa('0x7'));router[_0x3eaa('0x8')]('/',auth[_0x3eaa('0x9')](),controller['index']);router[_0x3eaa('0x8')](_0x3eaa('0xa'),auth[_0x3eaa('0x9')](),controller['describe']);router['get'](_0x3eaa('0xb'),auth['isAuthenticated'](),controller[_0x3eaa('0xc')]);router[_0x3eaa('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3eaa('0xe')]('/:id',auth[_0x3eaa('0x9')](),controller[_0x3eaa('0xf')]);router[_0x3eaa('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x3eaa('0x11')]);module[_0x3eaa('0x12')]=router; \ No newline at end of file +var _0x6ae3=['multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','/describe','describe','post','create','/:id','update','destroy','exports'];(function(_0x182baf,_0x1375fb){var _0x4d10f1=function(_0x1e0dde){while(--_0x1e0dde){_0x182baf['push'](_0x182baf['shift']());}};_0x4d10f1(++_0x1375fb);}(_0x6ae3,0x1c2));var _0x36ae=function(_0x4952af,_0x33bf56){_0x4952af=_0x4952af-0x0;var _0xe0819a=_0x6ae3[_0x4952af];return _0xe0819a;};'use strict';var multer=require(_0x36ae('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x36ae('0x1'));var express=require(_0x36ae('0x2'));var router=express[_0x36ae('0x3')]();var fs_extra=require(_0x36ae('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x36ae('0x5'));var config=require(_0x36ae('0x6'));var controller=require(_0x36ae('0x7'));router[_0x36ae('0x8')]('/',auth[_0x36ae('0x9')](),controller['index']);router[_0x36ae('0x8')](_0x36ae('0xa'),auth[_0x36ae('0x9')](),controller[_0x36ae('0xb')]);router[_0x36ae('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x36ae('0xc')]('/',auth[_0x36ae('0x9')](),controller[_0x36ae('0xd')]);router['put'](_0x36ae('0xe'),auth[_0x36ae('0x9')](),controller[_0x36ae('0xf')]);router['delete']('/:id',auth[_0x36ae('0x9')](),controller[_0x36ae('0x10')]);module[_0x36ae('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 90063f5..4d39cd6 100644 --- a/server/api/mailTransferReport/mailTransferReport.attributes.js +++ b/server/api/mailTransferReport/mailTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x42fe9c,_0x8ea8df){var _0xe8737f=function(_0x14c22c){while(--_0x14c22c){_0x42fe9c['push'](_0x42fe9c['shift']());}};_0xe8737f(++_0x8ea8df);}(_0x54ef,0x112));var _0xf54e=function(_0x364580,_0x44e11b){_0x364580=_0x364580-0x0;var _0x469f6d=_0x54ef[_0x364580];return _0x469f6d;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file +var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x5209ef,_0x3a4592){var _0x63f75f=function(_0x2591e1){while(--_0x2591e1){_0x5209ef['push'](_0x5209ef['shift']());}};_0x63f75f(++_0x3a4592);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 8f5e20b..0ac35c3 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 _0xbfec=['jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','error','stack','name','index','map','MailTransferReport','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','params','length','find','create','body','catch','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash'];(function(_0x3428b3,_0x4396cc){var _0x4474ad=function(_0x5df2bc){while(--_0x5df2bc){_0x3428b3['push'](_0x3428b3['shift']());}};_0x4474ad(++_0x4396cc);}(_0xbfec,0x1f4));var _0xcbfe=function(_0x36fecc,_0x3fa5e1){_0x36fecc=_0x36fecc-0x0;var _0x36ac22=_0xbfec[_0x36fecc];return _0x36ac22;};'use strict';var emlformat=require(_0xcbfe('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcbfe('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcbfe('0x2'));var moment=require(_0xcbfe('0x3'));var BPromise=require(_0xcbfe('0x4'));var Mustache=require(_0xcbfe('0x5'));var util=require(_0xcbfe('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xcbfe('0x7'));var ejs=require(_0xcbfe('0x8'));var fs=require('fs');var fs_extra=require(_0xcbfe('0x9'));var _=require(_0xcbfe('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xcbfe('0xb'));var deskjs=require(_0xcbfe('0xc'));var toCsv=require(_0xcbfe('0x7'));var querystring=require('querystring');var Papa=require(_0xcbfe('0xd'));var Redis=require(_0xcbfe('0xe'));var authService=require(_0xcbfe('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xcbfe('0x10'));var hardwareService=require(_0xcbfe('0x11'));var logger=require('../../config/logger')(_0xcbfe('0x12'));var utils=require('../../config/utils');var config=require(_0xcbfe('0x13'));var licenseUtil=require(_0xcbfe('0x14'));var db=require(_0xcbfe('0x15'))['db'];function respondWithStatusCode(_0x193f82,_0x33c3f6){_0x33c3f6=_0x33c3f6||0xcc;return function(_0xc0c793){if(_0xc0c793){return _0x193f82[_0xcbfe('0x16')](_0x33c3f6);}return _0x193f82[_0xcbfe('0x17')](_0x33c3f6)[_0xcbfe('0x18')]();};}function respondWithResult(_0x5d985e,_0x2880f9){_0x2880f9=_0x2880f9||0xc8;return function(_0x4e893a){if(_0x4e893a){return _0x5d985e[_0xcbfe('0x17')](_0x2880f9)[_0xcbfe('0x19')](_0x4e893a);}};}function respondWithFilteredResult(_0x54bd53,_0x407a63){return function(_0xd53f9e){if(_0xd53f9e){var _0xa772fa=typeof _0x407a63[_0xcbfe('0x1a')]===_0xcbfe('0x1b')&&typeof _0x407a63[_0xcbfe('0x1c')]==='undefined';var _0x365e50=_0xd53f9e[_0xcbfe('0x1d')];var _0x5c2e9d=_0xa772fa?0x0:_0x407a63[_0xcbfe('0x1a')];var _0x4f89e7=_0xa772fa?_0xd53f9e['count']:_0x407a63['offset']+_0x407a63[_0xcbfe('0x1c')];var _0x36d6dc;if(_0x4f89e7>=_0x365e50){_0x4f89e7=_0x365e50;_0x36d6dc=0xc8;}else{_0x36d6dc=0xce;}_0x54bd53[_0xcbfe('0x17')](_0x36d6dc);return _0x54bd53[_0xcbfe('0x1e')](_0xcbfe('0x1f'),_0x5c2e9d+'-'+_0x4f89e7+'/'+_0x365e50)[_0xcbfe('0x19')](_0xd53f9e);}return null;};}function patchUpdates(_0x30cd9b){return function(_0x2b305d){try{jsonpatch['apply'](_0x2b305d,_0x30cd9b,!![]);}catch(_0xf1bc96){return BPromise['reject'](_0xf1bc96);}return _0x2b305d[_0xcbfe('0x20')]();};}function saveUpdates(_0xab6b11,_0x184d3c){return function(_0x7c4f53){if(_0x7c4f53){return _0x7c4f53[_0xcbfe('0x21')](_0xab6b11)[_0xcbfe('0x22')](function(_0x314a11){return _0x314a11;});}return null;};}function removeEntity(_0x5a799a,_0x3ffe07){return function(_0x2a62cf){if(_0x2a62cf){return _0x2a62cf[_0xcbfe('0x23')]()[_0xcbfe('0x22')](function(){_0x5a799a[_0xcbfe('0x17')](0xcc)[_0xcbfe('0x18')]();});}};}function handleEntityNotFound(_0x1a6568,_0x39d6ec){return function(_0x33afe9){if(!_0x33afe9){_0x1a6568[_0xcbfe('0x16')](0x194);}return _0x33afe9;};}function handleError(_0x51c579,_0x110bc5){_0x110bc5=_0x110bc5||0x1f4;return function(_0x4e1c06){logger[_0xcbfe('0x24')](_0x4e1c06[_0xcbfe('0x25')]);if(_0x4e1c06[_0xcbfe('0x26')]){delete _0x4e1c06[_0xcbfe('0x26')];}_0x51c579[_0xcbfe('0x17')](_0x110bc5)['send'](_0x4e1c06);};}exports[_0xcbfe('0x27')]=function(_0x2f80cf,_0x111d6c){var _0x12f06b={},_0xc05a1f={},_0x3e2c68={'count':0x0,'rows':[]};var _0x5d272a=_[_0xcbfe('0x28')](db[_0xcbfe('0x29')][_0xcbfe('0x2a')],function(_0x474c65){return{'name':_0x474c65[_0xcbfe('0x2b')],'type':_0x474c65['type'][_0xcbfe('0x2c')]};});_0xc05a1f['model']=_[_0xcbfe('0x28')](_0x5d272a,_0xcbfe('0x26'));_0xc05a1f[_0xcbfe('0x2d')]=_[_0xcbfe('0x2e')](_0x2f80cf[_0xcbfe('0x2d')]);_0xc05a1f[_0xcbfe('0x2f')]=_[_0xcbfe('0x30')](_0xc05a1f[_0xcbfe('0x31')],_0xc05a1f[_0xcbfe('0x2d')]);_0x12f06b[_0xcbfe('0x32')]=_[_0xcbfe('0x30')](_0xc05a1f['model'],qs[_0xcbfe('0x33')](_0x2f80cf[_0xcbfe('0x2d')][_0xcbfe('0x33')]));_0x12f06b['attributes']=_0x12f06b[_0xcbfe('0x32')]['length']?_0x12f06b[_0xcbfe('0x32')]:_0xc05a1f[_0xcbfe('0x31')];if(!_0x2f80cf[_0xcbfe('0x2d')][_0xcbfe('0x34')](_0xcbfe('0x35'))){_0x12f06b[_0xcbfe('0x1c')]=qs[_0xcbfe('0x1c')](_0x2f80cf['query'][_0xcbfe('0x1c')]);_0x12f06b['offset']=qs[_0xcbfe('0x1a')](_0x2f80cf['query'][_0xcbfe('0x1a')]);}_0x12f06b[_0xcbfe('0x36')]=qs[_0xcbfe('0x37')](_0x2f80cf[_0xcbfe('0x2d')][_0xcbfe('0x37')]);_0x12f06b[_0xcbfe('0x38')]=qs[_0xcbfe('0x2f')](_[_0xcbfe('0x39')](_0x2f80cf[_0xcbfe('0x2d')],_0xc05a1f[_0xcbfe('0x2f')]),_0x5d272a);if(_0x2f80cf[_0xcbfe('0x2d')][_0xcbfe('0x3a')]){_0x12f06b[_0xcbfe('0x38')]=_[_0xcbfe('0x3b')](_0x12f06b['where'],{'$or':_['map'](_0x5d272a,function(_0x3ef91e){if(_0x3ef91e[_0xcbfe('0x3c')]!=='VIRTUAL'){var _0x11048d={};_0x11048d[_0x3ef91e[_0xcbfe('0x26')]]={'$like':'%'+_0x2f80cf[_0xcbfe('0x2d')][_0xcbfe('0x3a')]+'%'};return _0x11048d;}})});}_0x12f06b=_['merge']({},_0x12f06b,_0x2f80cf[_0xcbfe('0x3d')]);var _0x5ee7ee={'where':_0x12f06b['where']};return db['MailTransferReport'][_0xcbfe('0x1d')](_0x5ee7ee)[_0xcbfe('0x22')](function(_0x51557b){_0x3e2c68[_0xcbfe('0x1d')]=_0x51557b;if(_0x2f80cf[_0xcbfe('0x2d')][_0xcbfe('0x3e')]){_0x12f06b[_0xcbfe('0x3f')]=[{'all':!![]}];}return db[_0xcbfe('0x29')][_0xcbfe('0x40')](_0x12f06b);})['then'](function(_0x5bb691){_0x3e2c68[_0xcbfe('0x41')]=_0x5bb691;return _0x3e2c68;})[_0xcbfe('0x22')](respondWithFilteredResult(_0x111d6c,_0x12f06b))['catch'](handleError(_0x111d6c,null));};exports['show']=function(_0x2ef4bf,_0x3a8e30){var _0x297f66={'raw':!![],'where':{'id':_0x2ef4bf[_0xcbfe('0x42')]['id']}},_0x190d61={};_0x190d61[_0xcbfe('0x31')]=_[_0xcbfe('0x2e')](db[_0xcbfe('0x29')][_0xcbfe('0x2a')]);_0x190d61['query']=_['keys'](_0x2ef4bf[_0xcbfe('0x2d')]);_0x190d61[_0xcbfe('0x2f')]=_[_0xcbfe('0x30')](_0x190d61[_0xcbfe('0x31')],_0x190d61['query']);_0x297f66[_0xcbfe('0x32')]=_[_0xcbfe('0x30')](_0x190d61[_0xcbfe('0x31')],qs[_0xcbfe('0x33')](_0x2ef4bf[_0xcbfe('0x2d')]['fields']));_0x297f66[_0xcbfe('0x32')]=_0x297f66[_0xcbfe('0x32')][_0xcbfe('0x43')]?_0x297f66[_0xcbfe('0x32')]:_0x190d61[_0xcbfe('0x31')];if(_0x2ef4bf[_0xcbfe('0x2d')][_0xcbfe('0x3e')]){_0x297f66[_0xcbfe('0x3f')]=[{'all':!![]}];}_0x297f66=_[_0xcbfe('0x3b')]({},_0x297f66,_0x2ef4bf['options']);return db['MailTransferReport'][_0xcbfe('0x44')](_0x297f66)['then'](handleEntityNotFound(_0x3a8e30,null))[_0xcbfe('0x22')](respondWithResult(_0x3a8e30,null))['catch'](handleError(_0x3a8e30,null));};exports['create']=function(_0x2a242b,_0x2c6403){return db[_0xcbfe('0x29')][_0xcbfe('0x45')](_0x2a242b[_0xcbfe('0x46')],{})[_0xcbfe('0x22')](respondWithResult(_0x2c6403,0xc9))[_0xcbfe('0x47')](handleError(_0x2c6403,null));};exports[_0xcbfe('0x21')]=function(_0x261846,_0x109ad2){if(_0x261846[_0xcbfe('0x46')]['id']){delete _0x261846[_0xcbfe('0x46')]['id'];}return db['MailTransferReport'][_0xcbfe('0x44')]({'where':{'id':_0x261846[_0xcbfe('0x42')]['id']}})[_0xcbfe('0x22')](handleEntityNotFound(_0x109ad2,null))[_0xcbfe('0x22')](saveUpdates(_0x261846[_0xcbfe('0x46')],null))['then'](respondWithResult(_0x109ad2,null))[_0xcbfe('0x47')](handleError(_0x109ad2,null));};exports[_0xcbfe('0x23')]=function(_0x16c1e1,_0x208aac){return db[_0xcbfe('0x29')][_0xcbfe('0x44')]({'where':{'id':_0x16c1e1[_0xcbfe('0x42')]['id']}})[_0xcbfe('0x22')](handleEntityNotFound(_0x208aac,null))[_0xcbfe('0x22')](removeEntity(_0x208aac,null))[_0xcbfe('0x47')](handleError(_0x208aac,null));};exports[_0xcbfe('0x48')]=function(_0x2739df,_0xdca796){return db[_0xcbfe('0x29')][_0xcbfe('0x48')]()[_0xcbfe('0x22')](respondWithResult(_0xdca796,null))[_0xcbfe('0x47')](handleError(_0xdca796,null));}; \ No newline at end of file +var _0xf57f=['rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','VIRTUAL','merge','options','where','includeAll','include','findAll','rows','show','params','length','find','catch','body','destroy','describe','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','end','error','stack','name','send','index','MailTransferReport'];(function(_0x1b4aa4,_0x1c8a03){var _0x565266=function(_0xb5746a){while(--_0xb5746a){_0x1b4aa4['push'](_0x1b4aa4['shift']());}};_0x565266(++_0x1c8a03);}(_0xf57f,0x6d));var _0xff57=function(_0x2a99ea,_0x1bfb13){_0x2a99ea=_0x2a99ea-0x0;var _0x5887ae=_0xf57f[_0x2a99ea];return _0x5887ae;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xff57('0x0'));var jsonpatch=require(_0xff57('0x1'));var rp=require(_0xff57('0x2'));var moment=require(_0xff57('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xff57('0x4'));var util=require(_0xff57('0x5'));var path=require(_0xff57('0x6'));var sox=require('sox');var csv=require(_0xff57('0x7'));var ejs=require(_0xff57('0x8'));var fs=require('fs');var fs_extra=require(_0xff57('0x9'));var _=require(_0xff57('0xa'));var squel=require(_0xff57('0xb'));var crypto=require(_0xff57('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xff57('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xff57('0xe'));var Redis=require(_0xff57('0xf'));var authService=require(_0xff57('0x10'));var qs=require(_0xff57('0x11'));var as=require(_0xff57('0x12'));var hardwareService=require(_0xff57('0x13'));var logger=require(_0xff57('0x14'))(_0xff57('0x15'));var utils=require(_0xff57('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5f4ba2,_0x29fc4d){_0x29fc4d=_0x29fc4d||0xcc;return function(_0x46187c){if(_0x46187c){return _0x5f4ba2[_0xff57('0x17')](_0x29fc4d);}return _0x5f4ba2[_0xff57('0x18')](_0x29fc4d)['end']();};}function respondWithResult(_0x5da1cb,_0xdc6769){_0xdc6769=_0xdc6769||0xc8;return function(_0x2e72aa){if(_0x2e72aa){return _0x5da1cb[_0xff57('0x18')](_0xdc6769)['json'](_0x2e72aa);}};}function respondWithFilteredResult(_0x317caa,_0x3070da){return function(_0x215c2d){if(_0x215c2d){var _0x1bf780=typeof _0x3070da[_0xff57('0x19')]===_0xff57('0x1a')&&typeof _0x3070da[_0xff57('0x1b')]===_0xff57('0x1a');var _0x378b6c=_0x215c2d[_0xff57('0x1c')];var _0x593b45=_0x1bf780?0x0:_0x3070da[_0xff57('0x19')];var _0x209ad7=_0x1bf780?_0x215c2d[_0xff57('0x1c')]:_0x3070da[_0xff57('0x19')]+_0x3070da['limit'];var _0x32196a;if(_0x209ad7>=_0x378b6c){_0x209ad7=_0x378b6c;_0x32196a=0xc8;}else{_0x32196a=0xce;}_0x317caa[_0xff57('0x18')](_0x32196a);return _0x317caa[_0xff57('0x1d')](_0xff57('0x1e'),_0x593b45+'-'+_0x209ad7+'/'+_0x378b6c)[_0xff57('0x1f')](_0x215c2d);}return null;};}function patchUpdates(_0x505ab1){return function(_0x6c5f90){try{jsonpatch[_0xff57('0x20')](_0x6c5f90,_0x505ab1,!![]);}catch(_0x2f31b4){return BPromise['reject'](_0x2f31b4);}return _0x6c5f90[_0xff57('0x21')]();};}function saveUpdates(_0x2a1c76,_0x28265d){return function(_0x1e1425){if(_0x1e1425){return _0x1e1425[_0xff57('0x22')](_0x2a1c76)[_0xff57('0x23')](function(_0x2506ea){return _0x2506ea;});}return null;};}function removeEntity(_0x28091a,_0x11ece5){return function(_0x399d8e){if(_0x399d8e){return _0x399d8e['destroy']()[_0xff57('0x23')](function(){_0x28091a[_0xff57('0x18')](0xcc)[_0xff57('0x24')]();});}};}function handleEntityNotFound(_0x1c9483,_0x2da72f){return function(_0x2b4cbb){if(!_0x2b4cbb){_0x1c9483[_0xff57('0x17')](0x194);}return _0x2b4cbb;};}function handleError(_0xeefea0,_0x574621){_0x574621=_0x574621||0x1f4;return function(_0x1035c7){logger[_0xff57('0x25')](_0x1035c7[_0xff57('0x26')]);if(_0x1035c7[_0xff57('0x27')]){delete _0x1035c7['name'];}_0xeefea0[_0xff57('0x18')](_0x574621)[_0xff57('0x28')](_0x1035c7);};}exports[_0xff57('0x29')]=function(_0x31c6d3,_0x244928){var _0x12bdc4={},_0x2be948={},_0x3974ae={'count':0x0,'rows':[]};var _0x2cf65c=_['map'](db[_0xff57('0x2a')][_0xff57('0x2b')],function(_0x53a012){return{'name':_0x53a012[_0xff57('0x2c')],'type':_0x53a012[_0xff57('0x2d')]['key']};});_0x2be948[_0xff57('0x2e')]=_[_0xff57('0x2f')](_0x2cf65c,'name');_0x2be948[_0xff57('0x30')]=_[_0xff57('0x31')](_0x31c6d3['query']);_0x2be948[_0xff57('0x32')]=_[_0xff57('0x33')](_0x2be948[_0xff57('0x2e')],_0x2be948[_0xff57('0x30')]);_0x12bdc4[_0xff57('0x34')]=_[_0xff57('0x33')](_0x2be948[_0xff57('0x2e')],qs[_0xff57('0x35')](_0x31c6d3[_0xff57('0x30')][_0xff57('0x35')]));_0x12bdc4['attributes']=_0x12bdc4[_0xff57('0x34')]['length']?_0x12bdc4['attributes']:_0x2be948[_0xff57('0x2e')];if(!_0x31c6d3['query'][_0xff57('0x36')](_0xff57('0x37'))){_0x12bdc4[_0xff57('0x1b')]=qs['limit'](_0x31c6d3[_0xff57('0x30')]['limit']);_0x12bdc4[_0xff57('0x19')]=qs[_0xff57('0x19')](_0x31c6d3['query'][_0xff57('0x19')]);}_0x12bdc4[_0xff57('0x38')]=qs[_0xff57('0x39')](_0x31c6d3[_0xff57('0x30')]['sort']);_0x12bdc4['where']=qs['filters'](_[_0xff57('0x3a')](_0x31c6d3[_0xff57('0x30')],_0x2be948[_0xff57('0x32')]),_0x2cf65c);if(_0x31c6d3[_0xff57('0x30')][_0xff57('0x3b')]){_0x12bdc4['where']=_['merge'](_0x12bdc4['where'],{'$or':_[_0xff57('0x2f')](_0x2cf65c,function(_0x3664f3){if(_0x3664f3['type']!==_0xff57('0x3c')){var _0x11ade7={};_0x11ade7[_0x3664f3[_0xff57('0x27')]]={'$like':'%'+_0x31c6d3[_0xff57('0x30')]['filter']+'%'};return _0x11ade7;}})});}_0x12bdc4=_[_0xff57('0x3d')]({},_0x12bdc4,_0x31c6d3[_0xff57('0x3e')]);var _0x51c993={'where':_0x12bdc4[_0xff57('0x3f')]};return db[_0xff57('0x2a')][_0xff57('0x1c')](_0x51c993)[_0xff57('0x23')](function(_0x4bb42b){_0x3974ae['count']=_0x4bb42b;if(_0x31c6d3[_0xff57('0x30')][_0xff57('0x40')]){_0x12bdc4[_0xff57('0x41')]=[{'all':!![]}];}return db[_0xff57('0x2a')][_0xff57('0x42')](_0x12bdc4);})[_0xff57('0x23')](function(_0x3372f0){_0x3974ae[_0xff57('0x43')]=_0x3372f0;return _0x3974ae;})[_0xff57('0x23')](respondWithFilteredResult(_0x244928,_0x12bdc4))['catch'](handleError(_0x244928,null));};exports[_0xff57('0x44')]=function(_0x25edf0,_0x3b563e){var _0x562daf={'raw':!![],'where':{'id':_0x25edf0[_0xff57('0x45')]['id']}},_0x46ea8c={};_0x46ea8c[_0xff57('0x2e')]=_[_0xff57('0x31')](db['MailTransferReport'][_0xff57('0x2b')]);_0x46ea8c[_0xff57('0x30')]=_[_0xff57('0x31')](_0x25edf0['query']);_0x46ea8c[_0xff57('0x32')]=_[_0xff57('0x33')](_0x46ea8c[_0xff57('0x2e')],_0x46ea8c[_0xff57('0x30')]);_0x562daf[_0xff57('0x34')]=_[_0xff57('0x33')](_0x46ea8c[_0xff57('0x2e')],qs['fields'](_0x25edf0['query'][_0xff57('0x35')]));_0x562daf[_0xff57('0x34')]=_0x562daf[_0xff57('0x34')][_0xff57('0x46')]?_0x562daf[_0xff57('0x34')]:_0x46ea8c[_0xff57('0x2e')];if(_0x25edf0[_0xff57('0x30')]['includeAll']){_0x562daf['include']=[{'all':!![]}];}_0x562daf=_[_0xff57('0x3d')]({},_0x562daf,_0x25edf0[_0xff57('0x3e')]);return db['MailTransferReport'][_0xff57('0x47')](_0x562daf)[_0xff57('0x23')](handleEntityNotFound(_0x3b563e,null))[_0xff57('0x23')](respondWithResult(_0x3b563e,null))[_0xff57('0x48')](handleError(_0x3b563e,null));};exports['create']=function(_0x5f5995,_0x1bef64){return db[_0xff57('0x2a')]['create'](_0x5f5995['body'],{})[_0xff57('0x23')](respondWithResult(_0x1bef64,0xc9))[_0xff57('0x48')](handleError(_0x1bef64,null));};exports[_0xff57('0x22')]=function(_0x4bc9f9,_0x4f843e){if(_0x4bc9f9[_0xff57('0x49')]['id']){delete _0x4bc9f9[_0xff57('0x49')]['id'];}return db[_0xff57('0x2a')]['find']({'where':{'id':_0x4bc9f9[_0xff57('0x45')]['id']}})[_0xff57('0x23')](handleEntityNotFound(_0x4f843e,null))[_0xff57('0x23')](saveUpdates(_0x4bc9f9['body'],null))[_0xff57('0x23')](respondWithResult(_0x4f843e,null))[_0xff57('0x48')](handleError(_0x4f843e,null));};exports[_0xff57('0x4a')]=function(_0x2a343f,_0x1f6ed3){return db[_0xff57('0x2a')][_0xff57('0x47')]({'where':{'id':_0x2a343f[_0xff57('0x45')]['id']}})[_0xff57('0x23')](handleEntityNotFound(_0x1f6ed3,null))[_0xff57('0x23')](removeEntity(_0x1f6ed3,null))[_0xff57('0x48')](handleError(_0x1f6ed3,null));};exports[_0xff57('0x4b')]=function(_0x362047,_0x3030c6){return db[_0xff57('0x2a')][_0xff57('0x4b')]()[_0xff57('0x23')](respondWithResult(_0x3030c6,null))[_0xff57('0x48')](handleError(_0x3030c6,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 7a12f32..fecedc6 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 _0x58dc=['../../config/environment','./mailTransferReport.attributes','exports','define','report_mail_transfer','uniqueid','lodash','util','api','moment','bluebird','path','rimraf'];(function(_0x146484,_0x27a7f0){var _0x4c7aa3=function(_0x481b98){while(--_0x481b98){_0x146484['push'](_0x146484['shift']());}};_0x4c7aa3(++_0x27a7f0);}(_0x58dc,0x199));var _0xc58d=function(_0x1bf740,_0x57be1d){_0x1bf740=_0x1bf740-0x0;var _0x552216=_0x58dc[_0x1bf740];return _0x552216;};'use strict';var _=require(_0xc58d('0x0'));var util=require(_0xc58d('0x1'));var logger=require('../../config/logger')(_0xc58d('0x2'));var moment=require(_0xc58d('0x3'));var BPromise=require(_0xc58d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc58d('0x5'));var rimraf=require(_0xc58d('0x6'));var config=require(_0xc58d('0x7'));var attributes=require(_0xc58d('0x8'));module[_0xc58d('0x9')]=function(_0x457f65,_0x6adf2f){return _0x457f65[_0xc58d('0xa')]('MailTransferReport',attributes,{'tableName':_0xc58d('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xc58d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0a9f=['bluebird','path','MailTransferReport','uniqueid','util','../../config/logger'];(function(_0x5796c5,_0x2b436f){var _0x374ff0=function(_0x87f8ff){while(--_0x87f8ff){_0x5796c5['push'](_0x5796c5['shift']());}};_0x374ff0(++_0x2b436f);}(_0x0a9f,0x64));var _0xf0a9=function(_0x401a04,_0x27cd04){_0x401a04=_0x401a04-0x0;var _0x469676=_0x0a9f[_0x401a04];return _0x469676;};'use strict';var _=require('lodash');var util=require(_0xf0a9('0x0'));var logger=require(_0xf0a9('0x1'))('api');var moment=require('moment');var BPromise=require(_0xf0a9('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf0a9('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./mailTransferReport.attributes');module['exports']=function(_0x5343c2,_0x2502a2){return _0x5343c2['define'](_0xf0a9('0x4'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0xf0a9('0x5'),'fields':[_0xf0a9('0x5')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index ec75964..020a23a 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 _0x153f=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x9fe4b9,_0x316792){var _0x539243=function(_0x3e8fdc){while(--_0x3e8fdc){_0x9fe4b9['push'](_0x9fe4b9['shift']());}};_0x539243(++_0x316792);}(_0x153f,0x181));var _0xf153=function(_0x3ca778,_0x4067d3){_0x3ca778=_0x3ca778-0x0;var _0x552abb=_0x153f[_0x3ca778];return _0x552abb;};'use strict';var _=require(_0xf153('0x0'));var util=require(_0xf153('0x1'));var moment=require(_0xf153('0x2'));var BPromise=require(_0xf153('0x3'));var rs=require(_0xf153('0x4'));var fs=require('fs');var Redis=require(_0xf153('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf153('0x6'));var logger=require(_0xf153('0x7'))(_0xf153('0x8'));var config=require(_0xf153('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf153('0xa')][_0xf153('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x18560d,_0x235af7,_0x40d7db){return new BPromise(function(_0x3bb260,_0x4e959e){return client[_0xf153('0xc')](_0x18560d,_0x40d7db)[_0xf153('0xd')](function(_0x11fd6d){logger['info'](_0xf153('0xe'),_0x235af7,_0xf153('0xf'));logger[_0xf153('0x10')](_0xf153('0x11'),_0x235af7,'request\x20sent',JSON['stringify'](_0x11fd6d));if(_0x11fd6d[_0xf153('0x12')]){if(_0x11fd6d[_0xf153('0x12')][_0xf153('0x13')]===0x1f4){logger['error'](_0xf153('0xe'),_0x235af7,_0x11fd6d[_0xf153('0x12')][_0xf153('0x14')]);return _0x4e959e(_0x11fd6d[_0xf153('0x12')][_0xf153('0x14')]);}logger[_0xf153('0x12')](_0xf153('0xe'),_0x235af7,_0x11fd6d[_0xf153('0x12')][_0xf153('0x14')]);return _0x3bb260(_0x11fd6d[_0xf153('0x12')]['message']);}else{logger[_0xf153('0x15')](_0xf153('0xe'),_0x235af7,_0xf153('0xf'));_0x3bb260(_0x11fd6d['result']['message']);}})[_0xf153('0x16')](function(_0x3acb0e){logger[_0xf153('0x12')](_0xf153('0xe'),_0x235af7,_0x3acb0e);_0x4e959e(_0x3acb0e);});});} \ No newline at end of file +var _0x7987=['../../mysqldb','rpc','jayson/promise','http','then','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MailTransferReport,\x20%s,\x20%s','message','info','catch','lodash','moment','ioredis'];(function(_0xf63a33,_0xf38cbc){var _0x3c809d=function(_0x161767){while(--_0x161767){_0xf63a33['push'](_0xf63a33['shift']());}};_0x3c809d(++_0xf38cbc);}(_0x7987,0x11d));var _0x7798=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x7987[_0x543084];return _0x306a57;};'use strict';var _=require(_0x7798('0x0'));var util=require('util');var moment=require(_0x7798('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7798('0x2'));var db=require(_0x7798('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7798('0x4'));var config=require('../../config/environment');var jayson=require(_0x7798('0x5'));var client=jayson['client'][_0x7798('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x38de8f,_0x279756,_0x292f7b){return new BPromise(function(_0x35b966,_0x557773){return client['request'](_0x38de8f,_0x292f7b)[_0x7798('0x7')](function(_0x5bed0d){logger['info']('MailTransferReport,\x20%s,\x20%s',_0x279756,_0x7798('0x8'));logger[_0x7798('0x9')](_0x7798('0xa'),_0x279756,_0x7798('0x8'),JSON[_0x7798('0xb')](_0x5bed0d));if(_0x5bed0d['error']){if(_0x5bed0d[_0x7798('0xc')][_0x7798('0xd')]===0x1f4){logger[_0x7798('0xc')](_0x7798('0xe'),_0x279756,_0x5bed0d[_0x7798('0xc')][_0x7798('0xf')]);return _0x557773(_0x5bed0d['error'][_0x7798('0xf')]);}logger[_0x7798('0xc')](_0x7798('0xe'),_0x279756,_0x5bed0d[_0x7798('0xc')][_0x7798('0xf')]);return _0x35b966(_0x5bed0d['error'][_0x7798('0xf')]);}else{logger[_0x7798('0x10')](_0x7798('0xe'),_0x279756,_0x7798('0x8'));_0x35b966(_0x5bed0d['result'][_0x7798('0xf')]);}})[_0x7798('0x11')](function(_0x442879){logger[_0x7798('0xc')](_0x7798('0xe'),_0x279756,_0x442879);_0x557773(_0x442879);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 566239d..e0793dc 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 _0xbdfc=['isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./memberReport.controller','get'];(function(_0x110c44,_0x2aa503){var _0x18a905=function(_0x4ba431){while(--_0x4ba431){_0x110c44['push'](_0x110c44['shift']());}};_0x18a905(++_0x2aa503);}(_0xbdfc,0xe8));var _0xcbdf=function(_0x6348e,_0x567edf){_0x6348e=_0x6348e-0x0;var _0x56c7d1=_0xbdfc[_0x6348e];return _0x56c7d1;};'use strict';var multer=require(_0xcbdf('0x0'));var util=require('util');var path=require(_0xcbdf('0x1'));var timeout=require(_0xcbdf('0x2'));var express=require(_0xcbdf('0x3'));var router=express[_0xcbdf('0x4')]();var fs_extra=require(_0xcbdf('0x5'));var auth=require(_0xcbdf('0x6'));var interaction=require(_0xcbdf('0x7'));var config=require('../../config/environment');var controller=require(_0xcbdf('0x8'));router[_0xcbdf('0x9')]('/',auth[_0xcbdf('0xa')](),controller[_0xcbdf('0xb')]);router[_0xcbdf('0x9')](_0xcbdf('0xc'),auth[_0xcbdf('0xa')](),controller[_0xcbdf('0xd')]);router[_0xcbdf('0x9')](_0xcbdf('0xe'),auth[_0xcbdf('0xa')](),controller['show']);router[_0xcbdf('0xf')]('/',auth['isAuthenticated'](),controller[_0xcbdf('0x10')]);router[_0xcbdf('0x11')](_0xcbdf('0xe'),auth[_0xcbdf('0xa')](),controller[_0xcbdf('0x12')]);router[_0xcbdf('0x13')](_0xcbdf('0xe'),auth[_0xcbdf('0xa')](),controller[_0xcbdf('0x14')]);module[_0xcbdf('0x15')]=router; \ No newline at end of file +var _0xe1fa=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./memberReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x1749a0,_0x52fe61){var _0x2fd1af=function(_0x27241c){while(--_0x27241c){_0x1749a0['push'](_0x1749a0['shift']());}};_0x2fd1af(++_0x52fe61);}(_0xe1fa,0x11e));var _0xae1f=function(_0x35665e,_0x3247c0){_0x35665e=_0x35665e-0x0;var _0x5c30bf=_0xe1fa[_0x35665e];return _0x5c30bf;};'use strict';var multer=require(_0xae1f('0x0'));var util=require(_0xae1f('0x1'));var path=require(_0xae1f('0x2'));var timeout=require(_0xae1f('0x3'));var express=require(_0xae1f('0x4'));var router=express[_0xae1f('0x5')]();var fs_extra=require(_0xae1f('0x6'));var auth=require(_0xae1f('0x7'));var interaction=require(_0xae1f('0x8'));var config=require('../../config/environment');var controller=require(_0xae1f('0x9'));router[_0xae1f('0xa')]('/',auth[_0xae1f('0xb')](),controller[_0xae1f('0xc')]);router[_0xae1f('0xa')](_0xae1f('0xd'),auth[_0xae1f('0xb')](),controller[_0xae1f('0xe')]);router[_0xae1f('0xa')](_0xae1f('0xf'),auth[_0xae1f('0xb')](),controller[_0xae1f('0x10')]);router[_0xae1f('0x11')]('/',auth['isAuthenticated'](),controller[_0xae1f('0x12')]);router[_0xae1f('0x13')]('/:id',auth[_0xae1f('0xb')](),controller[_0xae1f('0x14')]);router[_0xae1f('0x15')]('/:id',auth[_0xae1f('0xb')](),controller[_0xae1f('0x16')]);module[_0xae1f('0x17')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index dc2753d..e99f0cc 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 _0xbc35=['moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','seconds','setDataValue','exitAt','duration','talk:[start]','talk:[dial\x20string]','talk:[queue]','sequelize'];(function(_0x106214,_0x454b8d){var _0x5f5cea=function(_0x247841){while(--_0x247841){_0x106214['push'](_0x106214['shift']());}};_0x5f5cea(++_0x454b8d);}(_0xbc35,0x186));var _0x5bc3=function(_0xac1362,_0x39f3f3){_0xac1362=_0xac1362-0x0;var _0x5b6c9a=_0xbc35[_0xac1362];return _0x5b6c9a;};'use strict';var Sequelize=require(_0x5bc3('0x0'));var moment=require(_0x5bc3('0x1'));module[_0x5bc3('0x2')]={'channel':{'type':Sequelize[_0x5bc3('0x3')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING'],'defaultValue':_0x5bc3('0x4'),'comment':_0x5bc3('0x5')},'duration':{'type':Sequelize[_0x5bc3('0x6')]},'enterAt':{'type':Sequelize[_0x5bc3('0x7')]},'exitAt':{'type':Sequelize[_0x5bc3('0x7')],'set':function(_0x4d1904){var _0x284201=moment(_0x4d1904);var _0x21a95e=moment(this[_0x5bc3('0x8')](_0x5bc3('0x9')));var _0x2f8a6c=_0x284201['diff'](_0x21a95e,_0x5bc3('0xa'));this[_0x5bc3('0xb')](_0x5bc3('0xc'),_0x4d1904);this[_0x5bc3('0xb')](_0x5bc3('0xd'),_0x2f8a6c>=0x0?_0x2f8a6c:null);}},'data1':{'type':Sequelize['STRING'],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize['STRING'],'comment':_0x5bc3('0xe')},'data3':{'type':Sequelize[_0x5bc3('0x3')],'comment':'talk:[destination]'},'data4':{'type':Sequelize['STRING'],'comment':_0x5bc3('0xf')},'data5':{'type':Sequelize['STRING'],'comment':_0x5bc3('0x10')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x5bc3('0x6')]},'uniqueid':{'type':Sequelize[_0x5bc3('0x3')]}}; \ No newline at end of file +var _0xd30f=['STRING','INTEGER','DATE','enterAt','seconds','setDataValue','exitAt','duration','talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports'];(function(_0x412e27,_0x20a978){var _0x53da42=function(_0x43cae5){while(--_0x43cae5){_0x412e27['push'](_0x412e27['shift']());}};_0x53da42(++_0x20a978);}(_0xd30f,0x7f));var _0xfd30=function(_0x256ba6,_0x18d545){_0x256ba6=_0x256ba6-0x0;var _0x1b51e5=_0xd30f[_0x256ba6];return _0x1b51e5;};'use strict';var Sequelize=require(_0xfd30('0x0'));var moment=require(_0xfd30('0x1'));module[_0xfd30('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xfd30('0x3')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xfd30('0x3')],'defaultValue':'DEFAULT\x20PAUSE','comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0xfd30('0x4')]},'enterAt':{'type':Sequelize[_0xfd30('0x5')]},'exitAt':{'type':Sequelize[_0xfd30('0x5')],'set':function(_0xf9f4e1){var _0x3cdb9f=moment(_0xf9f4e1);var _0x28f311=moment(this['getDataValue'](_0xfd30('0x6')));var _0x4c8dbf=_0x3cdb9f['diff'](_0x28f311,_0xfd30('0x7'));this[_0xfd30('0x8')](_0xfd30('0x9'),_0xf9f4e1);this['setDataValue'](_0xfd30('0xa'),_0x4c8dbf>=0x0?_0x4c8dbf:null);}},'data1':{'type':Sequelize[_0xfd30('0x3')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0xfd30('0x3')],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0xfd30('0x3')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0xfd30('0x3')],'comment':_0xfd30('0xb')},'data5':{'type':Sequelize['STRING'],'comment':_0xfd30('0xc')},'role':{'type':Sequelize[_0xfd30('0x3')]},'internal':{'type':Sequelize[_0xfd30('0x4')]},'uniqueid':{'type':Sequelize[_0xfd30('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 80ff3a7..fcecbaa 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(_0x466b8c,_0x492ed0){var _0x3f461d=function(_0x1bb52c){while(--_0x1bb52c){_0x466b8c['push'](_0x466b8c['shift']());}};_0x3f461d(++_0x492ed0);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){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 _0x9c44=['catch','params','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','MemberReport','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows'];(function(_0x106cbe,_0x51f293){var _0x1a5c17=function(_0x58d401){while(--_0x58d401){_0x106cbe['push'](_0x106cbe['shift']());}};_0x1a5c17(++_0x51f293);}(_0x9c44,0x178));var _0x49c4=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x9c44[_0x68c979];return _0x4f0001;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={},_0x46e04d={},_0x4f28a2={'count':0x0,'rows':[]};var _0x6329b3=_[_0x49c4('0x29')](db[_0x49c4('0x2a')][_0x49c4('0x2b')],function(_0x17b50f){return{'name':_0x17b50f[_0x49c4('0x2c')],'type':_0x17b50f[_0x49c4('0x2d')]['key']};});_0x46e04d['model']=_['map'](_0x6329b3,_0x49c4('0x26'));_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d[_0x49c4('0x30')]=_['intersection'](_0x46e04d[_0x49c4('0x31')],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x46e04d['model'],qs['fields'](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x2b2793[_0x49c4('0x32')]=_0x2b2793[_0x49c4('0x32')][_0x49c4('0x35')]?_0x2b2793['attributes']:_0x46e04d[_0x49c4('0x31')];if(!_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x36')]('nolimit')){_0x2b2793['limit']=qs[_0x49c4('0x1b')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x1b')]);_0x2b2793[_0x49c4('0x19')]=qs[_0x49c4('0x19')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x19')]);}_0x2b2793[_0x49c4('0x37')]=qs[_0x49c4('0x38')](_0x5987ae['query'][_0x49c4('0x38')]);_0x2b2793['where']=qs[_0x49c4('0x30')](_[_0x49c4('0x39')](_0x5987ae[_0x49c4('0x2e')],_0x46e04d[_0x49c4('0x30')]),_0x6329b3);if(_0x5987ae['query'][_0x49c4('0x3a')]){_0x2b2793[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x2b2793['where'],{'$or':_[_0x49c4('0x29')](_0x6329b3,function(_0x21d8c7){if(_0x21d8c7[_0x49c4('0x2d')]!==_0x49c4('0x3d')){var _0x1ba7a0={};_0x1ba7a0[_0x21d8c7[_0x49c4('0x26')]]={'$like':'%'+_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x3a')]+'%'};return _0x1ba7a0;}})});}_0x2b2793=_[_0x49c4('0x3c')]({},_0x2b2793,_0x5987ae[_0x49c4('0x3e')]);var _0x1e506a={'where':_0x2b2793['where']};return db[_0x49c4('0x2a')][_0x49c4('0x1c')](_0x1e506a)[_0x49c4('0x3f')](function(_0x23aa32){_0x4f28a2[_0x49c4('0x1c')]=_0x23aa32;if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x2b2793[_0x49c4('0x41')]=[{'all':!![]}];}return db[_0x49c4('0x2a')][_0x49c4('0x42')](_0x2b2793);})[_0x49c4('0x3f')](function(_0xa3d59e){_0x4f28a2[_0x49c4('0x43')]=_0xa3d59e;return _0x4f28a2;})['then'](respondWithFilteredResult(_0x889909,_0x2b2793))[_0x49c4('0x44')](handleError(_0x889909,null));};exports['show']=function(_0x104efb,_0x4915bc){var _0x28d4fb={'raw':!![],'where':{'id':_0x104efb[_0x49c4('0x45')]['id']}},_0x1480da={};_0x1480da[_0x49c4('0x31')]=_['keys'](db['MemberReport'][_0x49c4('0x2b')]);_0x1480da[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x104efb[_0x49c4('0x2e')]);_0x1480da['filters']=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],_0x1480da[_0x49c4('0x2e')]);_0x28d4fb[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],qs[_0x49c4('0x34')](_0x104efb[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x28d4fb['attributes']=_0x28d4fb[_0x49c4('0x32')]['length']?_0x28d4fb[_0x49c4('0x32')]:_0x1480da[_0x49c4('0x31')];if(_0x104efb[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x28d4fb[_0x49c4('0x41')]=[{'all':!![]}];}_0x28d4fb=_['merge']({},_0x28d4fb,_0x104efb[_0x49c4('0x3e')]);return db[_0x49c4('0x2a')][_0x49c4('0x46')](_0x28d4fb)[_0x49c4('0x3f')](handleEntityNotFound(_0x4915bc,null))[_0x49c4('0x3f')](respondWithResult(_0x4915bc,null))[_0x49c4('0x44')](handleError(_0x4915bc,null));};exports[_0x49c4('0x47')]=function(_0x4d89e0,_0x3bac1b){return db['MemberReport'][_0x49c4('0x47')](_0x4d89e0[_0x49c4('0x48')],{})[_0x49c4('0x3f')](respondWithResult(_0x3bac1b,0xc9))[_0x49c4('0x44')](handleError(_0x3bac1b,null));};exports[_0x49c4('0x22')]=function(_0x30bea5,_0x2c6be1){if(_0x30bea5['body']['id']){delete _0x30bea5[_0x49c4('0x48')]['id'];}return db[_0x49c4('0x2a')]['find']({'where':{'id':_0x30bea5[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x2c6be1,null))[_0x49c4('0x3f')](saveUpdates(_0x30bea5[_0x49c4('0x48')],null))['then'](respondWithResult(_0x2c6be1,null))['catch'](handleError(_0x2c6be1,null));};exports[_0x49c4('0x23')]=function(_0x4e8221,_0x4597c3){return db[_0x49c4('0x2a')][_0x49c4('0x46')]({'where':{'id':_0x4e8221[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x4597c3,null))[_0x49c4('0x3f')](removeEntity(_0x4597c3,null))[_0x49c4('0x44')](handleError(_0x4597c3,null));};exports['describe']=function(_0x1f26c2,_0x1550ce){return db[_0x49c4('0x2a')][_0x49c4('0x49')]()[_0x49c4('0x3f')](respondWithResult(_0x1550ce,null))[_0x49c4('0x44')](handleError(_0x1550ce,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 8540107..855a826 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 _0xf02c=['rimraf','../../config/environment','./memberReport.attributes','exports','define','report_member','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0xf02c,0x92));var _0xcf02=function(_0xdf306b,_0x47ecde){_0xdf306b=_0xdf306b-0x0;var _0x1569ec=_0xf02c[_0xdf306b];return _0x1569ec;};'use strict';var _=require(_0xcf02('0x0'));var util=require(_0xcf02('0x1'));var logger=require(_0xcf02('0x2'))(_0xcf02('0x3'));var moment=require(_0xcf02('0x4'));var BPromise=require(_0xcf02('0x5'));var rp=require(_0xcf02('0x6'));var fs=require('fs');var path=require(_0xcf02('0x7'));var rimraf=require(_0xcf02('0x8'));var config=require(_0xcf02('0x9'));var attributes=require(_0xcf02('0xa'));module[_0xcf02('0xb')]=function(_0x162df7,_0x2fe41e){return _0x162df7[_0xcf02('0xc')]('MemberReport',attributes,{'tableName':_0xcf02('0xd'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':['membername','interface']}],'timestamps':!![]});}; \ No newline at end of file +var _0x4771=['../../config/environment','./memberReport.attributes','exports','MemberReport','report_member','membername_interface','membername','interface','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x4be7a5,_0x573b3c){var _0x5acc8b=function(_0x256f59){while(--_0x256f59){_0x4be7a5['push'](_0x4be7a5['shift']());}};_0x5acc8b(++_0x573b3c);}(_0x4771,0x1d9));var _0x1477=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x4771[_0x1da527];return _0x40fc7c;};'use strict';var _=require(_0x1477('0x0'));var util=require(_0x1477('0x1'));var logger=require(_0x1477('0x2'))(_0x1477('0x3'));var moment=require('moment');var BPromise=require(_0x1477('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1477('0x5'));var rimraf=require(_0x1477('0x6'));var config=require(_0x1477('0x7'));var attributes=require(_0x1477('0x8'));module[_0x1477('0x9')]=function(_0x59f54e,_0x526f3b){return _0x59f54e['define'](_0x1477('0xa'),attributes,{'tableName':_0x1477('0xb'),'paranoid':![],'indexes':[{'name':_0x1477('0xc'),'fields':[_0x1477('0xd'),_0x1477('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 676bf6f..e5d0119 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 _0x326f=['request\x20sent','debug','error','code','message','result','catch','GetMemberReport','MemberReport','raw','options','include','model','attributes','map','then','stringify','CreateMemberReport','create','body','UpdateMemberReport','update','where','limit','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','MemberReport,\x20%s,\x20%s'];(function(_0x54fe1c,_0x5d208c){var _0x460aaa=function(_0x430e7a){while(--_0x430e7a){_0x54fe1c['push'](_0x54fe1c['shift']());}};_0x460aaa(++_0x5d208c);}(_0x326f,0xd1));var _0xf326=function(_0x1dd0a6,_0x5d192b){_0x1dd0a6=_0x1dd0a6-0x0;var _0x3be868=_0x326f[_0x1dd0a6];return _0x3be868;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('MemberReport,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}exports[_0xf326('0x14')]=function(_0x453100){var _0x18bee3=this;return new Promise(function(_0x31ffb9,_0xcef2b5){return db[_0xf326('0x15')]['findAll']({'raw':_0x453100['options']?_0x453100['options'][_0xf326('0x16')]===undefined?!![]:![]:!![],'where':_0x453100[_0xf326('0x17')]?_0x453100['options']['where']||null:null,'attributes':_0x453100[_0xf326('0x17')]?_0x453100['options']['attributes']||null:null,'limit':_0x453100[_0xf326('0x17')]?_0x453100[_0xf326('0x17')]['limit']||null:null,'include':_0x453100['options']?_0x453100[_0xf326('0x17')][_0xf326('0x18')]?_['map'](_0x453100[_0xf326('0x17')][_0xf326('0x18')],function(_0x43c53e){return{'model':db[_0x43c53e[_0xf326('0x19')]],'as':_0x43c53e['as'],'attributes':_0x43c53e[_0xf326('0x1a')],'include':_0x43c53e[_0xf326('0x18')]?_['map'](_0x43c53e['include'],function(_0x4f31f6){return{'model':db[_0x4f31f6[_0xf326('0x19')]],'as':_0x4f31f6['as'],'attributes':_0x4f31f6[_0xf326('0x1a')],'include':_0x4f31f6[_0xf326('0x18')]?_[_0xf326('0x1b')](_0x4f31f6[_0xf326('0x18')],function(_0x410237){return{'model':db[_0x410237['model']],'as':_0x410237['as'],'attributes':_0x410237[_0xf326('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf326('0x1c')](function(_0x212d5d){logger['info'](_0xf326('0x14'),_0x453100);logger['debug']('GetMemberReport',_0x453100,JSON[_0xf326('0x1d')](_0x212d5d));_0x31ffb9(_0x212d5d);})[_0xf326('0x13')](function(_0x2fa28e){logger['error'](_0xf326('0x14'),_0x2fa28e[_0xf326('0x11')],_0x453100);_0xcef2b5(_0x18bee3['error'](0x1f4,_0x2fa28e[_0xf326('0x11')]));});});};exports[_0xf326('0x1e')]=function(_0xd77aba){var _0x18d110=this;return new Promise(function(_0xa80156,_0x269be9){return db[_0xf326('0x15')][_0xf326('0x1f')](_0xd77aba[_0xf326('0x20')],{'raw':_0xd77aba[_0xf326('0x17')]?_0xd77aba['options'][_0xf326('0x16')]===undefined?!![]:![]:!![]})[_0xf326('0x1c')](function(_0x21b23d){logger['info'](_0xf326('0x1e'),_0xd77aba);logger[_0xf326('0xe')](_0xf326('0x1e'),_0xd77aba,JSON['stringify'](_0x21b23d));_0xa80156(_0x21b23d);})['catch'](function(_0x2b8b31){logger[_0xf326('0xf')](_0xf326('0x1e'),_0x2b8b31[_0xf326('0x11')],_0xd77aba);_0x269be9(_0x18d110[_0xf326('0xf')](0x1f4,_0x2b8b31[_0xf326('0x11')]));});});};exports[_0xf326('0x21')]=function(_0x2d5f20){var _0x580374=this;return new Promise(function(_0x461e93,_0x1981bc){return db['MemberReport'][_0xf326('0x22')](_0x2d5f20['body'],{'raw':_0x2d5f20[_0xf326('0x17')]?_0x2d5f20['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d5f20[_0xf326('0x17')]?_0x2d5f20['options'][_0xf326('0x23')]||null:null,'attributes':_0x2d5f20['options']?_0x2d5f20[_0xf326('0x17')][_0xf326('0x1a')]||null:null,'limit':_0x2d5f20[_0xf326('0x17')]?_0x2d5f20['options'][_0xf326('0x24')]||null:null})[_0xf326('0x1c')](function(_0x48525a){logger[_0xf326('0xb')](_0xf326('0x21'),_0x2d5f20);logger[_0xf326('0xe')](_0xf326('0x21'),_0x2d5f20,JSON['stringify'](_0x48525a));_0x461e93(_0x48525a);})[_0xf326('0x13')](function(_0xb1ef35){logger[_0xf326('0xf')](_0xf326('0x21'),_0xb1ef35[_0xf326('0x11')],_0x2d5f20);_0x1981bc(_0x580374['error'](0x1f4,_0xb1ef35[_0xf326('0x11')]));});});}; \ No newline at end of file +var _0x87d3=['stringify','error','code','message','result','catch','GetMemberReport','findAll','options','where','limit','include','map','model','attributes','MemberReport','body','CreateMemberReport','update','UpdateMemberReport','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','MemberReport,\x20%s,\x20%s','debug','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x14a129,_0x319fc4){var _0x20d46d=function(_0x22a8ce){while(--_0x22a8ce){_0x14a129['push'](_0x14a129['shift']());}};_0x20d46d(++_0x319fc4);}(_0x87d3,0x86));var _0x387d=function(_0x22a3f0,_0x513d0e){_0x22a3f0=_0x22a3f0-0x0;var _0x2d8a9c=_0x87d3[_0x22a3f0];return _0x2d8a9c;};'use strict';var _=require(_0x387d('0x0'));var util=require(_0x387d('0x1'));var moment=require(_0x387d('0x2'));var BPromise=require(_0x387d('0x3'));var rs=require(_0x387d('0x4'));var fs=require('fs');var Redis=require(_0x387d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x387d('0x6'));var logger=require('../../config/logger')(_0x387d('0x7'));var config=require(_0x387d('0x8'));var jayson=require(_0x387d('0x9'));var client=jayson['client'][_0x387d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x265532,_0x3b1d5b,_0x689c51){return new BPromise(function(_0x86e92e,_0x39fece){return client[_0x387d('0xb')](_0x265532,_0x689c51)[_0x387d('0xc')](function(_0x47568d){logger[_0x387d('0xd')](_0x387d('0xe'),_0x3b1d5b,'request\x20sent');logger[_0x387d('0xf')](_0x387d('0x10'),_0x3b1d5b,_0x387d('0x11'),JSON[_0x387d('0x12')](_0x47568d));if(_0x47568d[_0x387d('0x13')]){if(_0x47568d[_0x387d('0x13')][_0x387d('0x14')]===0x1f4){logger[_0x387d('0x13')](_0x387d('0xe'),_0x3b1d5b,_0x47568d[_0x387d('0x13')][_0x387d('0x15')]);return _0x39fece(_0x47568d[_0x387d('0x13')][_0x387d('0x15')]);}logger[_0x387d('0x13')](_0x387d('0xe'),_0x3b1d5b,_0x47568d['error']['message']);return _0x86e92e(_0x47568d[_0x387d('0x13')]['message']);}else{logger['info']('MemberReport,\x20%s,\x20%s',_0x3b1d5b,_0x387d('0x11'));_0x86e92e(_0x47568d[_0x387d('0x16')][_0x387d('0x15')]);}})[_0x387d('0x17')](function(_0x3cd7ce){logger[_0x387d('0x13')](_0x387d('0xe'),_0x3b1d5b,_0x3cd7ce);_0x39fece(_0x3cd7ce);});});}exports[_0x387d('0x18')]=function(_0x560b1c){var _0xf8ae7b=this;return new Promise(function(_0xa50585,_0x178fe4){return db['MemberReport'][_0x387d('0x19')]({'raw':_0x560b1c['options']?_0x560b1c[_0x387d('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x560b1c[_0x387d('0x1a')]?_0x560b1c[_0x387d('0x1a')][_0x387d('0x1b')]||null:null,'attributes':_0x560b1c[_0x387d('0x1a')]?_0x560b1c[_0x387d('0x1a')]['attributes']||null:null,'limit':_0x560b1c['options']?_0x560b1c[_0x387d('0x1a')][_0x387d('0x1c')]||null:null,'include':_0x560b1c[_0x387d('0x1a')]?_0x560b1c[_0x387d('0x1a')][_0x387d('0x1d')]?_[_0x387d('0x1e')](_0x560b1c[_0x387d('0x1a')][_0x387d('0x1d')],function(_0x36ee8b){return{'model':db[_0x36ee8b['model']],'as':_0x36ee8b['as'],'attributes':_0x36ee8b['attributes'],'include':_0x36ee8b['include']?_[_0x387d('0x1e')](_0x36ee8b['include'],function(_0x5c567b){return{'model':db[_0x5c567b['model']],'as':_0x5c567b['as'],'attributes':_0x5c567b['attributes'],'include':_0x5c567b[_0x387d('0x1d')]?_[_0x387d('0x1e')](_0x5c567b[_0x387d('0x1d')],function(_0x31b8fc){return{'model':db[_0x31b8fc[_0x387d('0x1f')]],'as':_0x31b8fc['as'],'attributes':_0x31b8fc[_0x387d('0x20')]};}):[]};}):[]};}):[]:[]})[_0x387d('0xc')](function(_0x2df701){logger[_0x387d('0xd')](_0x387d('0x18'),_0x560b1c);logger[_0x387d('0xf')](_0x387d('0x18'),_0x560b1c,JSON[_0x387d('0x12')](_0x2df701));_0xa50585(_0x2df701);})[_0x387d('0x17')](function(_0x601f52){logger[_0x387d('0x13')]('GetMemberReport',_0x601f52[_0x387d('0x15')],_0x560b1c);_0x178fe4(_0xf8ae7b[_0x387d('0x13')](0x1f4,_0x601f52[_0x387d('0x15')]));});});};exports['CreateMemberReport']=function(_0x370689){var _0x452a11=this;return new Promise(function(_0x386af6,_0x23a388){return db[_0x387d('0x21')]['create'](_0x370689[_0x387d('0x22')],{'raw':_0x370689[_0x387d('0x1a')]?_0x370689['options']['raw']===undefined?!![]:![]:!![]})[_0x387d('0xc')](function(_0x3c1bee){logger[_0x387d('0xd')](_0x387d('0x23'),_0x370689);logger[_0x387d('0xf')](_0x387d('0x23'),_0x370689,JSON['stringify'](_0x3c1bee));_0x386af6(_0x3c1bee);})[_0x387d('0x17')](function(_0x265e8f){logger[_0x387d('0x13')](_0x387d('0x23'),_0x265e8f[_0x387d('0x15')],_0x370689);_0x23a388(_0x452a11[_0x387d('0x13')](0x1f4,_0x265e8f[_0x387d('0x15')]));});});};exports['UpdateMemberReport']=function(_0x16ca2c){var _0x29fe6b=this;return new Promise(function(_0x2d6350,_0x1a4762){return db[_0x387d('0x21')][_0x387d('0x24')](_0x16ca2c['body'],{'raw':_0x16ca2c['options']?_0x16ca2c['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16ca2c[_0x387d('0x1a')]?_0x16ca2c[_0x387d('0x1a')]['where']||null:null,'attributes':_0x16ca2c[_0x387d('0x1a')]?_0x16ca2c[_0x387d('0x1a')]['attributes']||null:null,'limit':_0x16ca2c[_0x387d('0x1a')]?_0x16ca2c[_0x387d('0x1a')][_0x387d('0x1c')]||null:null})['then'](function(_0x1de229){logger['info'](_0x387d('0x25'),_0x16ca2c);logger[_0x387d('0xf')](_0x387d('0x25'),_0x16ca2c,JSON[_0x387d('0x12')](_0x1de229));_0x2d6350(_0x1de229);})['catch'](function(_0xc2c15b){logger[_0x387d('0x13')]('UpdateMemberReport',_0xc2c15b[_0x387d('0x15')],_0x16ca2c);_0x1a4762(_0x29fe6b['error'](0x1f4,_0xc2c15b[_0x387d('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index d2fcc42..695fdb6 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 _0x26bb=['connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./migration.controller','exports','multer','util'];(function(_0x87506e,_0x5680ec){var _0x5496a4=function(_0x1e29ab){while(--_0x1e29ab){_0x87506e['push'](_0x87506e['shift']());}};_0x5496a4(++_0x5680ec);}(_0x26bb,0x8e));var _0xb26b=function(_0x447b2b,_0x5bbcc5){_0x447b2b=_0x447b2b-0x0;var _0x471d98=_0x26bb[_0x447b2b];return _0x471d98;};'use strict';var multer=require(_0xb26b('0x0'));var util=require(_0xb26b('0x1'));var path=require('path');var timeout=require(_0xb26b('0x2'));var express=require('express');var router=express[_0xb26b('0x3')]();var fs_extra=require(_0xb26b('0x4'));var auth=require(_0xb26b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb26b('0x6'));var controller=require(_0xb26b('0x7'));router['get']('/',controller['index']);module[_0xb26b('0x8')]=router; \ No newline at end of file +var _0xe7fe=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x26489d,_0x2c0901){var _0x143823=function(_0x34dbcd){while(--_0x34dbcd){_0x26489d['push'](_0x26489d['shift']());}};_0x143823(++_0x2c0901);}(_0xe7fe,0x19f));var _0xee7f=function(_0x54f895,_0x16cc3d){_0x54f895=_0x54f895-0x0;var _0xd47d66=_0xe7fe[_0x54f895];return _0xd47d66;};'use strict';var multer=require(_0xee7f('0x0'));var util=require(_0xee7f('0x1'));var path=require(_0xee7f('0x2'));var timeout=require(_0xee7f('0x3'));var express=require('express');var router=express[_0xee7f('0x4')]();var fs_extra=require(_0xee7f('0x5'));var auth=require(_0xee7f('0x6'));var interaction=require(_0xee7f('0x7'));var config=require('../../config/environment');var controller=require('./migration.controller');router['get']('/',controller['index']);module[_0xee7f('0x8')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 966a6cc..9d6b399 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 _0xadec=['version','exports'];(function(_0x3fa168,_0x1ca17a){var _0x13d36e=function(_0x4c22e4){while(--_0x4c22e4){_0x3fa168['push'](_0x3fa168['shift']());}};_0x13d36e(++_0x1ca17a);}(_0xadec,0x1cd));var _0xcade=function(_0x13e919,_0x29c91b){_0x13e919=_0x13e919-0x0;var _0x452b86=_0xadec[_0x13e919];return _0x452b86;};'use strict';var Sequelize=require('sequelize');module[_0xcade('0x0')]={'version':{'type':Sequelize['STRING'],'unique':_0xcade('0x1')}}; \ No newline at end of file +var _0x7263=['STRING','version','exports'];(function(_0x234f28,_0x1a311c){var _0x38bcb6=function(_0x2e7739){while(--_0x2e7739){_0x234f28['push'](_0x234f28['shift']());}};_0x38bcb6(++_0x1a311c);}(_0x7263,0xc5));var _0x3726=function(_0x18baa4,_0x5e35f2){_0x18baa4=_0x18baa4-0x0;var _0x370834=_0x7263[_0x18baa4];return _0x370834;};'use strict';var Sequelize=require('sequelize');module[_0x3726('0x0')]={'version':{'type':Sequelize[_0x3726('0x1')],'unique':_0x3726('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 25cf1fc..1532d2e 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 _0x9566=['sox','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','Migration','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','type','includeAll','include','findAll','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path'];(function(_0x4a9fb7,_0x4cbfd7){var _0x40b90e=function(_0x59664c){while(--_0x59664c){_0x4a9fb7['push'](_0x4a9fb7['shift']());}};_0x40b90e(++_0x4cbfd7);}(_0x9566,0xc9));var _0x6956=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x9566[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require(_0x6956('0x0'));var rimraf=require(_0x6956('0x1'));var zipdir=require(_0x6956('0x2'));var jsonpatch=require(_0x6956('0x3'));var rp=require(_0x6956('0x4'));var moment=require('moment');var BPromise=require(_0x6956('0x5'));var Mustache=require(_0x6956('0x6'));var util=require(_0x6956('0x7'));var path=require(_0x6956('0x8'));var sox=require(_0x6956('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6956('0xa'));var _=require(_0x6956('0xb'));var squel=require(_0x6956('0xc'));var crypto=require(_0x6956('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6956('0xe'));var querystring=require(_0x6956('0xf'));var Papa=require(_0x6956('0x10'));var Redis=require('ioredis');var authService=require(_0x6956('0x11'));var qs=require(_0x6956('0x12'));var as=require(_0x6956('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6956('0x14'))(_0x6956('0x15'));var utils=require(_0x6956('0x16'));var config=require(_0x6956('0x17'));var licenseUtil=require(_0x6956('0x18'));var db=require(_0x6956('0x19'))['db'];function respondWithStatusCode(_0xb46b7e,_0x5277e7){_0x5277e7=_0x5277e7||0xcc;return function(_0x29f89b){if(_0x29f89b){return _0xb46b7e[_0x6956('0x1a')](_0x5277e7);}return _0xb46b7e[_0x6956('0x1b')](_0x5277e7)[_0x6956('0x1c')]();};}function respondWithResult(_0x362e10,_0x5d2609){_0x5d2609=_0x5d2609||0xc8;return function(_0x4658e1){if(_0x4658e1){return _0x362e10[_0x6956('0x1b')](_0x5d2609)[_0x6956('0x1d')](_0x4658e1);}};}function respondWithFilteredResult(_0xe788d5,_0x2f788e){return function(_0x39e73a){if(_0x39e73a){var _0xde0889=typeof _0x2f788e[_0x6956('0x1e')]==='undefined'&&typeof _0x2f788e[_0x6956('0x1f')]===_0x6956('0x20');var _0x40f5ac=_0x39e73a[_0x6956('0x21')];var _0x1cef05=_0xde0889?0x0:_0x2f788e[_0x6956('0x1e')];var _0x581b5c=_0xde0889?_0x39e73a[_0x6956('0x21')]:_0x2f788e[_0x6956('0x1e')]+_0x2f788e[_0x6956('0x1f')];var _0x5417a4;if(_0x581b5c>=_0x40f5ac){_0x581b5c=_0x40f5ac;_0x5417a4=0xc8;}else{_0x5417a4=0xce;}_0xe788d5['status'](_0x5417a4);return _0xe788d5[_0x6956('0x22')](_0x6956('0x23'),_0x1cef05+'-'+_0x581b5c+'/'+_0x40f5ac)[_0x6956('0x1d')](_0x39e73a);}return null;};}function patchUpdates(_0xb5640e){return function(_0x5f2453){try{jsonpatch[_0x6956('0x24')](_0x5f2453,_0xb5640e,!![]);}catch(_0x2c2c77){return BPromise[_0x6956('0x25')](_0x2c2c77);}return _0x5f2453[_0x6956('0x26')]();};}function saveUpdates(_0x400dd8,_0x5a4db1){return function(_0xcfcbad){if(_0xcfcbad){return _0xcfcbad[_0x6956('0x27')](_0x400dd8)[_0x6956('0x28')](function(_0x3ac63d){return _0x3ac63d;});}return null;};}function removeEntity(_0x17d03b,_0x31b211){return function(_0x576b84){if(_0x576b84){return _0x576b84[_0x6956('0x29')]()['then'](function(){_0x17d03b[_0x6956('0x1b')](0xcc)[_0x6956('0x1c')]();});}};}function handleEntityNotFound(_0x2892a4,_0x3848a3){return function(_0x559b94){if(!_0x559b94){_0x2892a4['sendStatus'](0x194);}return _0x559b94;};}function handleError(_0x49f44d,_0x378926){_0x378926=_0x378926||0x1f4;return function(_0x260387){logger[_0x6956('0x2a')](_0x260387['stack']);if(_0x260387[_0x6956('0x2b')]){delete _0x260387[_0x6956('0x2b')];}_0x49f44d['status'](_0x378926)['send'](_0x260387);};}exports[_0x6956('0x2c')]=function(_0x34bd50,_0x177977){var _0x1b191f={},_0x5ad508={},_0x55f182={'count':0x0,'rows':[]};var _0x20372c=_['map'](db[_0x6956('0x2d')]['rawAttributes'],function(_0x3980dc){return{'name':_0x3980dc[_0x6956('0x2e')],'type':_0x3980dc['type'][_0x6956('0x2f')]};});_0x5ad508[_0x6956('0x30')]=_['map'](_0x20372c,_0x6956('0x2b'));_0x5ad508[_0x6956('0x31')]=_[_0x6956('0x32')](_0x34bd50[_0x6956('0x31')]);_0x5ad508[_0x6956('0x33')]=_[_0x6956('0x34')](_0x5ad508['model'],_0x5ad508[_0x6956('0x31')]);_0x1b191f[_0x6956('0x35')]=_[_0x6956('0x34')](_0x5ad508[_0x6956('0x30')],qs[_0x6956('0x36')](_0x34bd50[_0x6956('0x31')][_0x6956('0x36')]));_0x1b191f[_0x6956('0x35')]=_0x1b191f['attributes'][_0x6956('0x37')]?_0x1b191f[_0x6956('0x35')]:_0x5ad508[_0x6956('0x30')];if(!_0x34bd50[_0x6956('0x31')]['hasOwnProperty'](_0x6956('0x38'))){_0x1b191f['limit']=qs[_0x6956('0x1f')](_0x34bd50[_0x6956('0x31')][_0x6956('0x1f')]);_0x1b191f[_0x6956('0x1e')]=qs[_0x6956('0x1e')](_0x34bd50[_0x6956('0x31')][_0x6956('0x1e')]);}_0x1b191f[_0x6956('0x39')]=qs[_0x6956('0x3a')](_0x34bd50[_0x6956('0x31')][_0x6956('0x3a')]);_0x1b191f[_0x6956('0x3b')]=qs[_0x6956('0x33')](_[_0x6956('0x3c')](_0x34bd50[_0x6956('0x31')],_0x5ad508[_0x6956('0x33')]),_0x20372c);if(_0x34bd50[_0x6956('0x31')][_0x6956('0x3d')]){_0x1b191f[_0x6956('0x3b')]=_[_0x6956('0x3e')](_0x1b191f[_0x6956('0x3b')],{'$or':_[_0x6956('0x3f')](_0x20372c,function(_0x5b9f3d){if(_0x5b9f3d[_0x6956('0x40')]!=='VIRTUAL'){var _0x2feebe={};_0x2feebe[_0x5b9f3d[_0x6956('0x2b')]]={'$like':'%'+_0x34bd50[_0x6956('0x31')][_0x6956('0x3d')]+'%'};return _0x2feebe;}})});}_0x1b191f=_['merge']({},_0x1b191f,_0x34bd50['options']);var _0x4060ec={'where':_0x1b191f[_0x6956('0x3b')]};return db[_0x6956('0x2d')][_0x6956('0x21')](_0x4060ec)['then'](function(_0x231c32){_0x55f182[_0x6956('0x21')]=_0x231c32;if(_0x34bd50[_0x6956('0x31')][_0x6956('0x41')]){_0x1b191f[_0x6956('0x42')]=[{'all':!![]}];}return db[_0x6956('0x2d')][_0x6956('0x43')](_0x1b191f);})[_0x6956('0x28')](function(_0x3e28d4){_0x55f182[_0x6956('0x44')]=_0x3e28d4;return _0x55f182;})['then'](respondWithFilteredResult(_0x177977,_0x1b191f))[_0x6956('0x45')](handleError(_0x177977,null));}; \ No newline at end of file +var _0xd662=['fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','Migration','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','includeAll','include','findAll','catch','eml-format','rimraf','zip-dir'];(function(_0x2f9604,_0x445a20){var _0x228267=function(_0x53d9aa){while(--_0x53d9aa){_0x2f9604['push'](_0x2f9604['shift']());}};_0x228267(++_0x445a20);}(_0xd662,0x85));var _0x2d66=function(_0x3e9d0f,_0x291760){_0x3e9d0f=_0x3e9d0f-0x0;var _0x215d13=_0xd662[_0x3e9d0f];return _0x215d13;};'use strict';var emlformat=require(_0x2d66('0x0'));var rimraf=require(_0x2d66('0x1'));var zipdir=require(_0x2d66('0x2'));var jsonpatch=require(_0x2d66('0x3'));var rp=require('request-promise');var moment=require(_0x2d66('0x4'));var BPromise=require(_0x2d66('0x5'));var Mustache=require(_0x2d66('0x6'));var util=require(_0x2d66('0x7'));var path=require(_0x2d66('0x8'));var sox=require(_0x2d66('0x9'));var csv=require(_0x2d66('0xa'));var ejs=require(_0x2d66('0xb'));var fs=require('fs');var fs_extra=require(_0x2d66('0xc'));var _=require('lodash');var squel=require(_0x2d66('0xd'));var crypto=require(_0x2d66('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x2d66('0xf'));var toCsv=require(_0x2d66('0xa'));var querystring=require(_0x2d66('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2d66('0x11'));var as=require(_0x2d66('0x12'));var hardwareService=require(_0x2d66('0x13'));var logger=require(_0x2d66('0x14'))(_0x2d66('0x15'));var utils=require(_0x2d66('0x16'));var config=require(_0x2d66('0x17'));var licenseUtil=require(_0x2d66('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3cdf7e,_0x3825fa){_0x3825fa=_0x3825fa||0xcc;return function(_0x1e765e){if(_0x1e765e){return _0x3cdf7e[_0x2d66('0x19')](_0x3825fa);}return _0x3cdf7e[_0x2d66('0x1a')](_0x3825fa)[_0x2d66('0x1b')]();};}function respondWithResult(_0x28f2c6,_0x4c8a1d){_0x4c8a1d=_0x4c8a1d||0xc8;return function(_0x54cd84){if(_0x54cd84){return _0x28f2c6[_0x2d66('0x1a')](_0x4c8a1d)[_0x2d66('0x1c')](_0x54cd84);}};}function respondWithFilteredResult(_0x295728,_0x149808){return function(_0x3c8982){if(_0x3c8982){var _0x30524d=typeof _0x149808[_0x2d66('0x1d')]===_0x2d66('0x1e')&&typeof _0x149808[_0x2d66('0x1f')]===_0x2d66('0x1e');var _0x32ad98=_0x3c8982['count'];var _0x260040=_0x30524d?0x0:_0x149808[_0x2d66('0x1d')];var _0xabcef9=_0x30524d?_0x3c8982['count']:_0x149808[_0x2d66('0x1d')]+_0x149808[_0x2d66('0x1f')];var _0x90f423;if(_0xabcef9>=_0x32ad98){_0xabcef9=_0x32ad98;_0x90f423=0xc8;}else{_0x90f423=0xce;}_0x295728[_0x2d66('0x1a')](_0x90f423);return _0x295728[_0x2d66('0x20')](_0x2d66('0x21'),_0x260040+'-'+_0xabcef9+'/'+_0x32ad98)[_0x2d66('0x1c')](_0x3c8982);}return null;};}function patchUpdates(_0x255b53){return function(_0x536131){try{jsonpatch[_0x2d66('0x22')](_0x536131,_0x255b53,!![]);}catch(_0x37aac4){return BPromise[_0x2d66('0x23')](_0x37aac4);}return _0x536131[_0x2d66('0x24')]();};}function saveUpdates(_0x1d1934,_0x28dc34){return function(_0x2887b2){if(_0x2887b2){return _0x2887b2[_0x2d66('0x25')](_0x1d1934)[_0x2d66('0x26')](function(_0x3274b5){return _0x3274b5;});}return null;};}function removeEntity(_0x5d0351,_0x2bbfe3){return function(_0x5a4563){if(_0x5a4563){return _0x5a4563[_0x2d66('0x27')]()[_0x2d66('0x26')](function(){_0x5d0351['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x141c72,_0x6001a){return function(_0x4292d8){if(!_0x4292d8){_0x141c72['sendStatus'](0x194);}return _0x4292d8;};}function handleError(_0x3982ab,_0x3ef552){_0x3ef552=_0x3ef552||0x1f4;return function(_0x198084){logger[_0x2d66('0x28')](_0x198084[_0x2d66('0x29')]);if(_0x198084[_0x2d66('0x2a')]){delete _0x198084[_0x2d66('0x2a')];}_0x3982ab[_0x2d66('0x1a')](_0x3ef552)[_0x2d66('0x2b')](_0x198084);};}exports['index']=function(_0x1cafaa,_0x1d5b25){var _0xfe0c7c={},_0x45704f={},_0x1e03e4={'count':0x0,'rows':[]};var _0xd6c658=_[_0x2d66('0x2c')](db[_0x2d66('0x2d')][_0x2d66('0x2e')],function(_0x318a69){return{'name':_0x318a69[_0x2d66('0x2f')],'type':_0x318a69[_0x2d66('0x30')][_0x2d66('0x31')]};});_0x45704f['model']=_[_0x2d66('0x2c')](_0xd6c658,_0x2d66('0x2a'));_0x45704f[_0x2d66('0x32')]=_['keys'](_0x1cafaa['query']);_0x45704f['filters']=_[_0x2d66('0x33')](_0x45704f[_0x2d66('0x34')],_0x45704f['query']);_0xfe0c7c[_0x2d66('0x35')]=_[_0x2d66('0x33')](_0x45704f[_0x2d66('0x34')],qs[_0x2d66('0x36')](_0x1cafaa[_0x2d66('0x32')][_0x2d66('0x36')]));_0xfe0c7c[_0x2d66('0x35')]=_0xfe0c7c[_0x2d66('0x35')][_0x2d66('0x37')]?_0xfe0c7c[_0x2d66('0x35')]:_0x45704f[_0x2d66('0x34')];if(!_0x1cafaa['query'][_0x2d66('0x38')]('nolimit')){_0xfe0c7c[_0x2d66('0x1f')]=qs['limit'](_0x1cafaa[_0x2d66('0x32')][_0x2d66('0x1f')]);_0xfe0c7c['offset']=qs[_0x2d66('0x1d')](_0x1cafaa[_0x2d66('0x32')][_0x2d66('0x1d')]);}_0xfe0c7c[_0x2d66('0x39')]=qs[_0x2d66('0x3a')](_0x1cafaa['query'][_0x2d66('0x3a')]);_0xfe0c7c[_0x2d66('0x3b')]=qs[_0x2d66('0x3c')](_[_0x2d66('0x3d')](_0x1cafaa[_0x2d66('0x32')],_0x45704f[_0x2d66('0x3c')]),_0xd6c658);if(_0x1cafaa[_0x2d66('0x32')]['filter']){_0xfe0c7c['where']=_[_0x2d66('0x3e')](_0xfe0c7c[_0x2d66('0x3b')],{'$or':_[_0x2d66('0x2c')](_0xd6c658,function(_0x47af24){if(_0x47af24[_0x2d66('0x30')]!==_0x2d66('0x3f')){var _0x3b3c03={};_0x3b3c03[_0x47af24[_0x2d66('0x2a')]]={'$like':'%'+_0x1cafaa[_0x2d66('0x32')]['filter']+'%'};return _0x3b3c03;}})});}_0xfe0c7c=_[_0x2d66('0x3e')]({},_0xfe0c7c,_0x1cafaa['options']);var _0x45a6c0={'where':_0xfe0c7c[_0x2d66('0x3b')]};return db[_0x2d66('0x2d')]['count'](_0x45a6c0)['then'](function(_0x4306c1){_0x1e03e4['count']=_0x4306c1;if(_0x1cafaa[_0x2d66('0x32')][_0x2d66('0x40')]){_0xfe0c7c[_0x2d66('0x41')]=[{'all':!![]}];}return db[_0x2d66('0x2d')][_0x2d66('0x42')](_0xfe0c7c);})[_0x2d66('0x26')](function(_0xf80467){_0x1e03e4['rows']=_0xf80467;return _0x1e03e4;})[_0x2d66('0x26')](respondWithFilteredResult(_0x1d5b25,_0xfe0c7c))[_0x2d66('0x43')](handleError(_0x1d5b25,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index b70e052..54ea485 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 _0x7f37=['api','request-promise','path','rimraf','./migration.attributes','lodash','util'];(function(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0x7f37,0x17f));var _0x77f3=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x7f37[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x77f3('0x0'));var util=require(_0x77f3('0x1'));var logger=require('../../config/logger')(_0x77f3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x77f3('0x3'));var fs=require('fs');var path=require(_0x77f3('0x4'));var rimraf=require(_0x77f3('0x5'));var config=require('../../config/environment');var attributes=require(_0x77f3('0x6'));module['exports']=function(_0x472718,_0x4c4ee6){return _0x472718['define']('Migration',attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1477=['exports','define','migrations','util','bluebird','request-promise','../../config/environment','./migration.attributes'];(function(_0x141904,_0x3ee01f){var _0x337da8=function(_0x43055a){while(--_0x43055a){_0x141904['push'](_0x141904['shift']());}};_0x337da8(++_0x3ee01f);}(_0x1477,0xa3));var _0x7147=function(_0x1bcf80,_0x4568ff){_0x1bcf80=_0x1bcf80-0x0;var _0x2b39a=_0x1477[_0x1bcf80];return _0x2b39a;};'use strict';var _=require('lodash');var util=require(_0x7147('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x7147('0x1'));var rp=require(_0x7147('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7147('0x3'));var attributes=require(_0x7147('0x4'));module[_0x7147('0x5')]=function(_0x2e03a2,_0xeaa23b){return _0x2e03a2[_0x7147('0x6')]('Migration',attributes,{'tableName':_0x7147('0x7'),'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 74c1d58..43ad78d 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 _0x0fd9=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','../../config/utils'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0x0fd9,0xa3));var _0x90fd=function(_0x506172,_0xbc3a3){_0x506172=_0x506172-0x0;var _0x2723c0=_0x0fd9[_0x506172];return _0x2723c0;};'use strict';var _=require('lodash');var util=require(_0x90fd('0x0'));var moment=require(_0x90fd('0x1'));var BPromise=require(_0x90fd('0x2'));var rs=require(_0x90fd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x90fd('0x4'));var logger=require(_0x90fd('0x5'))(_0x90fd('0x6'));var config=require(_0x90fd('0x7'));var jayson=require(_0x90fd('0x8'));var client=jayson[_0x90fd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ff2d4,_0x128c17,_0x50c778){return new BPromise(function(_0x5a604a,_0x2acef7){return client[_0x90fd('0xa')](_0x4ff2d4,_0x50c778)['then'](function(_0x234ba9){logger[_0x90fd('0xb')](_0x90fd('0xc'),_0x128c17,_0x90fd('0xd'));logger[_0x90fd('0xe')](_0x90fd('0xf'),_0x128c17,_0x90fd('0xd'),JSON[_0x90fd('0x10')](_0x234ba9));if(_0x234ba9[_0x90fd('0x11')]){if(_0x234ba9['error'][_0x90fd('0x12')]===0x1f4){logger[_0x90fd('0x11')]('Migration,\x20%s,\x20%s',_0x128c17,_0x234ba9[_0x90fd('0x11')][_0x90fd('0x13')]);return _0x2acef7(_0x234ba9[_0x90fd('0x11')]['message']);}logger[_0x90fd('0x11')]('Migration,\x20%s,\x20%s',_0x128c17,_0x234ba9[_0x90fd('0x11')][_0x90fd('0x13')]);return _0x5a604a(_0x234ba9[_0x90fd('0x11')][_0x90fd('0x13')]);}else{logger[_0x90fd('0xb')](_0x90fd('0xc'),_0x128c17,_0x90fd('0xd'));_0x5a604a(_0x234ba9['result']['message']);}})[_0x90fd('0x14')](function(_0x43d804){logger['error'](_0x90fd('0xc'),_0x128c17,_0x43d804);_0x2acef7(_0x43d804);});});} \ No newline at end of file +var _0xc368=['client','request','then','request\x20sent','debug','stringify','error','code','Migration,\x20%s,\x20%s','message','info','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x3ddf57,_0x541ef1){var _0x17cf01=function(_0x48885f){while(--_0x48885f){_0x3ddf57['push'](_0x3ddf57['shift']());}};_0x17cf01(++_0x541ef1);}(_0xc368,0x7b));var _0x8c36=function(_0x3c6e93,_0x207f5e){_0x3c6e93=_0x3c6e93-0x0;var _0x77a2da=_0xc368[_0x3c6e93];return _0x77a2da;};'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']('Migration,\x20%s,\x20%s',_0x8ed437,_0x8c36('0xc'));logger[_0x8c36('0xd')]('Migration,\x20%s,\x20%s,\x20%s',_0x8ed437,_0x8c36('0xc'),JSON[_0x8c36('0xe')](_0x569f29));if(_0x569f29[_0x8c36('0xf')]){if(_0x569f29[_0x8c36('0xf')][_0x8c36('0x10')]===0x1f4){logger[_0x8c36('0xf')](_0x8c36('0x11'),_0x8ed437,_0x569f29[_0x8c36('0xf')][_0x8c36('0x12')]);return _0x26bad1(_0x569f29[_0x8c36('0xf')][_0x8c36('0x12')]);}logger[_0x8c36('0xf')](_0x8c36('0x11'),_0x8ed437,_0x569f29[_0x8c36('0xf')]['message']);return _0x3e76be(_0x569f29[_0x8c36('0xf')]['message']);}else{logger[_0x8c36('0x13')](_0x8c36('0x11'),_0x8ed437,_0x8c36('0xc'));_0x3e76be(_0x569f29[_0x8c36('0x14')][_0x8c36('0x12')]);}})[_0x8c36('0x15')](function(_0x3c10eb){logger[_0x8c36('0xf')](_0x8c36('0x11'),_0x8ed437,_0x3c10eb);_0x26bad1(_0x3c10eb);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index e81ed73..d4cdc67 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 _0xe9e5=['index','/:id','post','create','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x282a1f,_0x49a6ef){var _0x296ea7=function(_0x4bac68){while(--_0x4bac68){_0x282a1f['push'](_0x282a1f['shift']());}};_0x296ea7(++_0x49a6ef);}(_0xe9e5,0x138));var _0x5e9e=function(_0x268056,_0xf931de){_0x268056=_0x268056-0x0;var _0x2652c6=_0xe9e5[_0x268056];return _0x2652c6;};'use strict';var multer=require(_0x5e9e('0x0'));var util=require(_0x5e9e('0x1'));var path=require(_0x5e9e('0x2'));var timeout=require(_0x5e9e('0x3'));var express=require(_0x5e9e('0x4'));var router=express[_0x5e9e('0x5')]();var fs_extra=require(_0x5e9e('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5e9e('0x7'));var config=require(_0x5e9e('0x8'));var controller=require('./network.controller');router[_0x5e9e('0x9')]('/',auth[_0x5e9e('0xa')](),controller[_0x5e9e('0xb')]);router[_0x5e9e('0x9')](_0x5e9e('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x5e9e('0xd')]('/',auth[_0x5e9e('0xa')](),controller[_0x5e9e('0xe')]);router['put'](_0x5e9e('0xc'),auth[_0x5e9e('0xa')](),controller[_0x5e9e('0xf')]);router['delete'](_0x5e9e('0xc'),auth['isAuthenticated'](),controller[_0x5e9e('0x10')]);module['exports']=router; \ No newline at end of file +var _0x3144=['destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./network.controller','get','isAuthenticated','index','show','post','create','put','delete'];(function(_0x48cb1f,_0x5ca68d){var _0x172c4d=function(_0x85040){while(--_0x85040){_0x48cb1f['push'](_0x48cb1f['shift']());}};_0x172c4d(++_0x5ca68d);}(_0x3144,0x17c));var _0x4314=function(_0x5bf181,_0x50c830){_0x5bf181=_0x5bf181-0x0;var _0x5b99ed=_0x3144[_0x5bf181];return _0x5b99ed;};'use strict';var multer=require('multer');var util=require(_0x4314('0x0'));var path=require(_0x4314('0x1'));var timeout=require(_0x4314('0x2'));var express=require('express');var router=express[_0x4314('0x3')]();var fs_extra=require(_0x4314('0x4'));var auth=require(_0x4314('0x5'));var interaction=require(_0x4314('0x6'));var config=require('../../config/environment');var controller=require(_0x4314('0x7'));router[_0x4314('0x8')]('/',auth[_0x4314('0x9')](),controller[_0x4314('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x4314('0xb')]);router[_0x4314('0xc')]('/',auth[_0x4314('0x9')](),controller[_0x4314('0xd')]);router[_0x4314('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x4314('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x4314('0x10')]);module[_0x4314('0x11')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 552ddf5..c6e5e97 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 _0x9420=['STRING','sequelize','ENUM','localnet','externip','turn'];(function(_0x46f121,_0x1c7e77){var _0x45661d=function(_0x199486){while(--_0x199486){_0x46f121['push'](_0x46f121['shift']());}};_0x45661d(++_0x1c7e77);}(_0x9420,0x85));var _0x0942=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x9420[_0x550d12];return _0x12103d;};'use strict';var Sequelize=require(_0x0942('0x0'));module['exports']={'type':{'type':Sequelize[_0x0942('0x1')](_0x0942('0x2'),_0x0942('0x3'),'stun',_0x0942('0x4'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x0942('0x5')]}}; \ No newline at end of file +var _0x7883=['STRING','ENUM','externip','stun','turn'];(function(_0x34a0f7,_0x18dbf5){var _0x4da84c=function(_0x3a5815){while(--_0x3a5815){_0x34a0f7['push'](_0x34a0f7['shift']());}};_0x4da84c(++_0x18dbf5);}(_0x7883,0x128));var _0x3788=function(_0x48d699,_0x475482){_0x48d699=_0x48d699-0x0;var _0x56f317=_0x7883[_0x48d699];return _0x56f317;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x3788('0x0')]('localnet',_0x3788('0x1'),_0x3788('0x2'),_0x3788('0x3'))},'value':{'type':Sequelize[_0x3788('0x4')]},'username':{'type':Sequelize[_0x3788('0x4')]},'password':{'type':Sequelize[_0x3788('0x4')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 4146d92..011f957 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 _0xee37=['order','sort','where','pick','merge','VIRTUAL','options','includeAll','findAll','catch','params','rawAttributes','include','find','create','body','toUpperCase','readFileSync','join','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','root','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','STUN','util','path','lodash','../../config/logger','api','jayson/promise','client','http','request','then','Network,\x20%s,\x20%s','request\x20sent','error','code','message','info','status','offset','undefined','limit','count','Content-Range','json','update','destroy','end','sendStatus','stack','name','index','map','Network','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit'];(function(_0x36f9bd,_0x2a8f5d){var _0x48c6b3=function(_0x202b2d){while(--_0x202b2d){_0x36f9bd['push'](_0x36f9bd['shift']());}};_0x48c6b3(++_0x2a8f5d);}(_0xee37,0xc2));var _0x7ee3=function(_0x1b1e76,_0x31695b){_0x1b1e76=_0x1b1e76-0x0;var _0x3d743a=_0xee37[_0x1b1e76];return _0x3d743a;};'use strict';var util=require(_0x7ee3('0x0'));var path=require(_0x7ee3('0x1'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7ee3('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0x7ee3('0x3'))(_0x7ee3('0x4'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x7ee3('0x5'));var client=jayson[_0x7ee3('0x6')][_0x7ee3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4fa154,_0x3b40c1,_0x332f07,_0x1de115){return new Promise(function(_0x397dfb,_0xe6d136){var _0x152342=_0x1de115||client;return _0x152342[_0x7ee3('0x8')](_0x4fa154,_0x332f07)[_0x7ee3('0x9')](function(_0x571c0a){logger['info'](_0x7ee3('0xa'),_0x3b40c1,_0x7ee3('0xb'));logger['debug']('Network,\x20%s,\x20%s,\x20%s',_0x3b40c1,_0x7ee3('0xb'),JSON['stringify'](_0x571c0a));if(_0x571c0a[_0x7ee3('0xc')]){if(_0x571c0a[_0x7ee3('0xc')][_0x7ee3('0xd')]===0x1f4){logger[_0x7ee3('0xc')](_0x7ee3('0xa'),_0x3b40c1,_0x571c0a[_0x7ee3('0xc')][_0x7ee3('0xe')]);return _0xe6d136(_0x571c0a[_0x7ee3('0xc')][_0x7ee3('0xe')]);}logger['error']('Network,\x20%s,\x20%s',_0x3b40c1,_0x571c0a[_0x7ee3('0xc')][_0x7ee3('0xe')]);return _0x397dfb(_0x571c0a[_0x7ee3('0xc')][_0x7ee3('0xe')]);}else{logger[_0x7ee3('0xf')](_0x7ee3('0xa'),_0x3b40c1,_0x7ee3('0xb'));_0x397dfb(_0x571c0a['result'][_0x7ee3('0xe')]);}})['catch'](function(_0x12c621){logger['error'](_0x7ee3('0xa'),_0x3b40c1,_0x12c621);_0xe6d136(_0x12c621);});});}function respondWithResult(_0x2c4f0b,_0x376156){_0x376156=_0x376156||0xc8;return function(_0xb98f4c){if(_0xb98f4c){return _0x2c4f0b[_0x7ee3('0x10')](_0x376156)['json'](_0xb98f4c);}};}function respondWithFilteredResult(_0x18ee6a,_0x3fe8cf){return function(_0x2368ab){if(_0x2368ab){var _0x4d42e7=typeof _0x3fe8cf[_0x7ee3('0x11')]===_0x7ee3('0x12')&&typeof _0x3fe8cf[_0x7ee3('0x13')]==='undefined';var _0x2fe591=_0x2368ab[_0x7ee3('0x14')];var _0x4096c0=_0x4d42e7?0x0:_0x3fe8cf[_0x7ee3('0x11')];var _0x2fa240=_0x4d42e7?_0x2368ab['count']:_0x3fe8cf[_0x7ee3('0x11')]+_0x3fe8cf[_0x7ee3('0x13')];var _0x5b65ca;if(_0x2fa240>=_0x2fe591){_0x2fa240=_0x2fe591;_0x5b65ca=0xc8;}else{_0x5b65ca=0xce;}_0x18ee6a[_0x7ee3('0x10')](_0x5b65ca);return _0x18ee6a['set'](_0x7ee3('0x15'),_0x4096c0+'-'+_0x2fa240+'/'+_0x2fe591)[_0x7ee3('0x16')](_0x2368ab);}return null;};}function saveUpdates(_0x151c77){return function(_0x590145){if(_0x590145){return _0x590145[_0x7ee3('0x17')](_0x151c77)[_0x7ee3('0x9')](function(_0x40c30e){return _0x40c30e;});}return null;};}function removeEntity(_0x20e355){return function(_0x231c4c){if(_0x231c4c){return _0x231c4c[_0x7ee3('0x18')]()[_0x7ee3('0x9')](function(){_0x20e355[_0x7ee3('0x10')](0xcc)[_0x7ee3('0x19')]();});}};}function handleEntityNotFound(_0x25abda){return function(_0x477577){if(!_0x477577){_0x25abda[_0x7ee3('0x1a')](0x194);}return _0x477577;};}function handleError(_0x310c49,_0x403440){_0x403440=_0x403440||0x1f4;return function(_0x4eaa2a){logger['error'](_0x4eaa2a[_0x7ee3('0x1b')]);if(_0x4eaa2a[_0x7ee3('0x1c')]){delete _0x4eaa2a[_0x7ee3('0x1c')];}_0x310c49[_0x7ee3('0x10')](_0x403440)['send'](_0x4eaa2a);};}exports[_0x7ee3('0x1d')]=function(_0x11b272,_0x41d884){var _0x3571c7={},_0x18b946={},_0x36e8e8={'count':0x0,'rows':[]};var _0x4308ef=_[_0x7ee3('0x1e')](db[_0x7ee3('0x1f')]['rawAttributes'],function(_0x3c2508){return{'name':_0x3c2508[_0x7ee3('0x20')],'type':_0x3c2508[_0x7ee3('0x21')]['key']};});_0x18b946[_0x7ee3('0x22')]=_[_0x7ee3('0x1e')](_0x4308ef,_0x7ee3('0x1c'));_0x18b946[_0x7ee3('0x23')]=_[_0x7ee3('0x24')](_0x11b272[_0x7ee3('0x23')]);_0x18b946[_0x7ee3('0x25')]=_[_0x7ee3('0x26')](_0x18b946[_0x7ee3('0x22')],_0x18b946[_0x7ee3('0x23')]);_0x3571c7[_0x7ee3('0x27')]=_[_0x7ee3('0x26')](_0x18b946[_0x7ee3('0x22')],qs[_0x7ee3('0x28')](_0x11b272[_0x7ee3('0x23')][_0x7ee3('0x28')]));_0x3571c7[_0x7ee3('0x27')]=_0x3571c7[_0x7ee3('0x27')][_0x7ee3('0x29')]?_0x3571c7[_0x7ee3('0x27')]:_0x18b946[_0x7ee3('0x22')];if(!_0x11b272[_0x7ee3('0x23')]['hasOwnProperty'](_0x7ee3('0x2a'))){_0x3571c7[_0x7ee3('0x13')]=qs[_0x7ee3('0x13')](_0x11b272[_0x7ee3('0x23')][_0x7ee3('0x13')]);_0x3571c7[_0x7ee3('0x11')]=qs['offset'](_0x11b272['query']['offset']);}_0x3571c7[_0x7ee3('0x2b')]=qs[_0x7ee3('0x2c')](_0x11b272[_0x7ee3('0x23')]['sort']);_0x3571c7[_0x7ee3('0x2d')]=qs[_0x7ee3('0x25')](_[_0x7ee3('0x2e')](_0x11b272[_0x7ee3('0x23')],_0x18b946[_0x7ee3('0x25')]),_0x4308ef);if(_0x11b272[_0x7ee3('0x23')]['filter']){_0x3571c7['where']=_[_0x7ee3('0x2f')](_0x3571c7[_0x7ee3('0x2d')],{'$or':_[_0x7ee3('0x1e')](_0x4308ef,function(_0x409716){if(_0x409716[_0x7ee3('0x21')]!==_0x7ee3('0x30')){var _0x860848={};_0x860848[_0x409716[_0x7ee3('0x1c')]]={'$like':'%'+_0x11b272[_0x7ee3('0x23')]['filter']+'%'};return _0x860848;}})});}_0x3571c7=_['merge']({},_0x3571c7,_0x11b272[_0x7ee3('0x31')]);var _0x51eb0b={'where':_0x3571c7['where']};return db[_0x7ee3('0x1f')]['count'](_0x51eb0b)['then'](function(_0x6b938a){_0x36e8e8['count']=_0x6b938a;if(_0x11b272[_0x7ee3('0x23')][_0x7ee3('0x32')]){_0x3571c7['include']=[{'all':!![]}];}return db[_0x7ee3('0x1f')][_0x7ee3('0x33')](_0x3571c7);})[_0x7ee3('0x9')](function(_0xdb9f77){_0x36e8e8['rows']=_0xdb9f77;return _0x36e8e8;})[_0x7ee3('0x9')](respondWithFilteredResult(_0x41d884,_0x3571c7))[_0x7ee3('0x34')](handleError(_0x41d884,null));};exports['show']=function(_0x469d3a,_0x468924){var _0x4827fc={'raw':!![],'where':{'id':_0x469d3a[_0x7ee3('0x35')]['id']}},_0xc351b9={};_0xc351b9['model']=_[_0x7ee3('0x24')](db[_0x7ee3('0x1f')][_0x7ee3('0x36')]);_0xc351b9[_0x7ee3('0x23')]=_[_0x7ee3('0x24')](_0x469d3a['query']);_0xc351b9['filters']=_[_0x7ee3('0x26')](_0xc351b9[_0x7ee3('0x22')],_0xc351b9[_0x7ee3('0x23')]);_0x4827fc[_0x7ee3('0x27')]=_['intersection'](_0xc351b9['model'],qs[_0x7ee3('0x28')](_0x469d3a[_0x7ee3('0x23')][_0x7ee3('0x28')]));_0x4827fc['attributes']=_0x4827fc[_0x7ee3('0x27')][_0x7ee3('0x29')]?_0x4827fc[_0x7ee3('0x27')]:_0xc351b9[_0x7ee3('0x22')];if(_0x469d3a[_0x7ee3('0x23')][_0x7ee3('0x32')]){_0x4827fc[_0x7ee3('0x37')]=[{'all':!![]}];}_0x4827fc=_['merge']({},_0x4827fc,_0x469d3a[_0x7ee3('0x31')]);return db['Network'][_0x7ee3('0x38')](_0x4827fc)[_0x7ee3('0x9')](handleEntityNotFound(_0x468924,null))[_0x7ee3('0x9')](respondWithResult(_0x468924,null))[_0x7ee3('0x34')](handleError(_0x468924,null));};exports[_0x7ee3('0x39')]=function(_0x52c90c,_0x155e99){var _0x54d19e;return db[_0x7ee3('0x1f')]['create'](_0x52c90c['body'],{'raw':!![]})['then'](function(_0x31344a){_0x54d19e=_0x31344a;return db[_0x7ee3('0x1f')]['findAll']({'where':{'type':_0x52c90c[_0x7ee3('0x3a')]['type']},'raw':!![]});})['then'](function(_0x117da9){if(_0x54d19e[_0x7ee3('0x21')][_0x7ee3('0x3b')]()=='STUN'){var _0x442c83=fs[_0x7ee3('0x3c')](path[_0x7ee3('0x3d')](config['root'],_0x7ee3('0x3e')),_0x7ee3('0x3f'));var _0x122087=ejs[_0x7ee3('0x40')](_0x442c83,{'networks':_0x117da9||[]});fs[_0x7ee3('0x41')](_0x7ee3('0x42'),_0x122087);return respondWithRpcPromise(_0x7ee3('0x43'),_0x7ee3('0x39'),{'module':_0x7ee3('0x44')});}else if(_0x54d19e[_0x7ee3('0x21')][_0x7ee3('0x3b')]()==_0x7ee3('0x45')){var _0x1da08b=fs[_0x7ee3('0x3c')](path['join'](config[_0x7ee3('0x46')],_0x7ee3('0x47')),'utf8');var _0x384067=ejs['render'](_0x1da08b,{'networks':_0x117da9||[]});fs[_0x7ee3('0x41')](_0x7ee3('0x48'),_0x384067);return respondWithRpcPromise('Reload',_0x7ee3('0x39'),{'module':'res_stun_monitor.so'});}else{var _0x596671=fs[_0x7ee3('0x3c')](path[_0x7ee3('0x3d')](config['root'],_0x7ee3('0x49')),_0x7ee3('0x3f'));var _0x286746=ejs[_0x7ee3('0x40')](_0x596671,{'networks':_0x117da9||[]});fs[_0x7ee3('0x41')](util[_0x7ee3('0x4a')](_0x7ee3('0x4b'),_0x52c90c[_0x7ee3('0x3a')][_0x7ee3('0x21')][_0x7ee3('0x4c')]()),_0x286746);return respondWithRpcPromise(_0x7ee3('0x43'),_0x7ee3('0x39'),{'module':_0x7ee3('0x4d')});}})['then'](function(){return _0x54d19e;})[_0x7ee3('0x9')](respondWithResult(_0x155e99,0xc9))[_0x7ee3('0x34')](handleError(_0x155e99,null));};exports['update']=function(_0x20703c,_0x40c6ee){var _0x17e1ea;return db['Network'][_0x7ee3('0x38')]({'where':{'id':_0x20703c[_0x7ee3('0x35')]['id']}})[_0x7ee3('0x9')](handleEntityNotFound(_0x40c6ee,null))['then'](saveUpdates(_0x20703c['body'],null))[_0x7ee3('0x9')](function(_0xc26461){if(_0xc26461){_0x17e1ea=_0xc26461;return db[_0x7ee3('0x1f')][_0x7ee3('0x33')]({'where':{'type':_0x17e1ea['type']},'raw':!![]});}return null;})[_0x7ee3('0x9')](function(_0x5a6536){if(_0x17e1ea['type'][_0x7ee3('0x3b')]()=='STUN'){var _0xf73dc7=fs[_0x7ee3('0x3c')](path[_0x7ee3('0x3d')](config[_0x7ee3('0x46')],_0x7ee3('0x3e')),'utf8');var _0x319d03=ejs[_0x7ee3('0x40')](_0xf73dc7,{'networks':_0x5a6536||[]});fs[_0x7ee3('0x41')](_0x7ee3('0x42'),_0x319d03);return respondWithRpcPromise(_0x7ee3('0x43'),_0x7ee3('0x17'),{'module':'res_stun_monitor.so'});}else if(_0x17e1ea[_0x7ee3('0x21')][_0x7ee3('0x3b')]()==_0x7ee3('0x45')){var _0x6b57ef=fs[_0x7ee3('0x3c')](path[_0x7ee3('0x3d')](config['root'],_0x7ee3('0x47')),'utf8');var _0x4b2718=ejs[_0x7ee3('0x40')](_0x6b57ef,{'networks':_0x5a6536||[]});fs['writeFileSync'](_0x7ee3('0x48'),_0x4b2718);return respondWithRpcPromise(_0x7ee3('0x43'),_0x7ee3('0x17'),{'module':_0x7ee3('0x44')});}else{var _0x364b33=fs[_0x7ee3('0x3c')](path[_0x7ee3('0x3d')](config[_0x7ee3('0x46')],_0x7ee3('0x49')),_0x7ee3('0x3f'));var _0x5d8c88=ejs['render'](_0x364b33,{'networks':_0x5a6536||[]});fs[_0x7ee3('0x41')](util[_0x7ee3('0x4a')]('/etc/asterisk/sip_xcally_%s.conf',_0x20703c['body'][_0x7ee3('0x21')]['toLowerCase']()),_0x5d8c88);return respondWithRpcPromise(_0x7ee3('0x43'),_0x7ee3('0x17'),{'module':_0x7ee3('0x4d')});}})[_0x7ee3('0x9')](function(_0x3b1539){if(_0x3b1539){return _0x17e1ea;}return null;})['then'](respondWithResult(_0x40c6ee,null))[_0x7ee3('0x34')](handleError(_0x40c6ee,null));};exports[_0x7ee3('0x18')]=function(_0x18156d,_0x130a7a){var _0x24832e;return db[_0x7ee3('0x1f')][_0x7ee3('0x38')]({'where':{'id':_0x18156d[_0x7ee3('0x35')]['id']}})[_0x7ee3('0x9')](function(_0x1c3a5f){_0x24832e=_0x1c3a5f;return _0x1c3a5f;})[_0x7ee3('0x9')](handleEntityNotFound(_0x130a7a,null))[_0x7ee3('0x9')](removeEntity(_0x130a7a,null))['then'](function(){if(_0x24832e){return db['Network'][_0x7ee3('0x33')]({'where':{'type':_0x24832e[_0x7ee3('0x21')]},'raw':!![]});}})[_0x7ee3('0x9')](function(_0xa7cf95){if(_0x24832e[_0x7ee3('0x21')]['toUpperCase']()==_0x7ee3('0x4e')){var _0x2a5bf8=fs[_0x7ee3('0x3c')](path[_0x7ee3('0x3d')](config[_0x7ee3('0x46')],_0x7ee3('0x3e')),'utf8');var _0x529cc1=ejs[_0x7ee3('0x40')](_0x2a5bf8,{'networks':_0xa7cf95||[]});fs[_0x7ee3('0x41')](_0x7ee3('0x42'),_0x529cc1);return respondWithRpcPromise(_0x7ee3('0x43'),_0x7ee3('0x18'),{'module':_0x7ee3('0x44')});}else if(_0x24832e['type']['toUpperCase']()==_0x7ee3('0x45')){var _0x2b4a9b=fs['readFileSync'](path['join'](config[_0x7ee3('0x46')],_0x7ee3('0x47')),_0x7ee3('0x3f'));var _0x575b93=ejs[_0x7ee3('0x40')](_0x2b4a9b,{'networks':_0xa7cf95||[]});fs[_0x7ee3('0x41')](_0x7ee3('0x48'),_0x575b93);return respondWithRpcPromise(_0x7ee3('0x43'),_0x7ee3('0x18'),{'module':_0x7ee3('0x44')});}else{var _0x2af669=fs[_0x7ee3('0x3c')](path[_0x7ee3('0x3d')](config[_0x7ee3('0x46')],_0x7ee3('0x49')),'utf8');var _0x1648f0=ejs['render'](_0x2af669,{'networks':_0xa7cf95||[]});fs[_0x7ee3('0x41')](util[_0x7ee3('0x4a')](_0x7ee3('0x4b'),_0x24832e[_0x7ee3('0x21')][_0x7ee3('0x4c')]()),_0x1648f0);return respondWithRpcPromise(_0x7ee3('0x43'),_0x7ee3('0x18'),{'module':'chan_sip.so'});}})[_0x7ee3('0x34')](handleError(_0x130a7a,null));}; \ No newline at end of file +var _0xed6f=['set','Content-Range','update','end','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','Network','include','findAll','rows','params','rawAttributes','merge','find','create','body','toUpperCase','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','TURN','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','STUN','server/files/templates/turn_multiple.ejs','destroy','util','path','lodash','api','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','status','json','undefined','limit','count','offset'];(function(_0x45bd07,_0x27fa33){var _0x23ec0a=function(_0x14a3a0){while(--_0x14a3a0){_0x45bd07['push'](_0x45bd07['shift']());}};_0x23ec0a(++_0x27fa33);}(_0xed6f,0x8e));var _0xfed6=function(_0x5779dd,_0x3e6fdc){_0x5779dd=_0x5779dd-0x0;var _0xc84315=_0xed6f[_0x5779dd];return _0xc84315;};'use strict';var util=require(_0xfed6('0x0'));var path=require(_0xfed6('0x1'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfed6('0x2'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xfed6('0x3'));var config=require(_0xfed6('0x4'));var db=require(_0xfed6('0x5'))['db'];var jayson=require(_0xfed6('0x6'));var client=jayson[_0xfed6('0x7')][_0xfed6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4535ce,_0x35d04e,_0x25df7e,_0x27a89e){return new Promise(function(_0x274d9a,_0x122357){var _0x4acf7d=_0x27a89e||client;return _0x4acf7d[_0xfed6('0x9')](_0x4535ce,_0x25df7e)[_0xfed6('0xa')](function(_0x5b2da1){logger[_0xfed6('0xb')](_0xfed6('0xc'),_0x35d04e,_0xfed6('0xd'));logger[_0xfed6('0xe')](_0xfed6('0xf'),_0x35d04e,_0xfed6('0xd'),JSON[_0xfed6('0x10')](_0x5b2da1));if(_0x5b2da1[_0xfed6('0x11')]){if(_0x5b2da1[_0xfed6('0x11')]['code']===0x1f4){logger['error'](_0xfed6('0xc'),_0x35d04e,_0x5b2da1[_0xfed6('0x11')]['message']);return _0x122357(_0x5b2da1['error'][_0xfed6('0x12')]);}logger['error'](_0xfed6('0xc'),_0x35d04e,_0x5b2da1['error'][_0xfed6('0x12')]);return _0x274d9a(_0x5b2da1[_0xfed6('0x11')][_0xfed6('0x12')]);}else{logger[_0xfed6('0xb')](_0xfed6('0xc'),_0x35d04e,'request\x20sent');_0x274d9a(_0x5b2da1['result']['message']);}})[_0xfed6('0x13')](function(_0x42ce06){logger['error']('Network,\x20%s,\x20%s',_0x35d04e,_0x42ce06);_0x122357(_0x42ce06);});});}function respondWithResult(_0x6d93b3,_0x1e407a){_0x1e407a=_0x1e407a||0xc8;return function(_0xd75a17){if(_0xd75a17){return _0x6d93b3[_0xfed6('0x14')](_0x1e407a)[_0xfed6('0x15')](_0xd75a17);}};}function respondWithFilteredResult(_0x4e69bf,_0x3640ab){return function(_0x71c083){if(_0x71c083){var _0x409cc7=typeof _0x3640ab['offset']===_0xfed6('0x16')&&typeof _0x3640ab[_0xfed6('0x17')]===_0xfed6('0x16');var _0x906a30=_0x71c083[_0xfed6('0x18')];var _0x3b23ea=_0x409cc7?0x0:_0x3640ab['offset'];var _0x104c34=_0x409cc7?_0x71c083['count']:_0x3640ab[_0xfed6('0x19')]+_0x3640ab[_0xfed6('0x17')];var _0x351638;if(_0x104c34>=_0x906a30){_0x104c34=_0x906a30;_0x351638=0xc8;}else{_0x351638=0xce;}_0x4e69bf[_0xfed6('0x14')](_0x351638);return _0x4e69bf[_0xfed6('0x1a')](_0xfed6('0x1b'),_0x3b23ea+'-'+_0x104c34+'/'+_0x906a30)[_0xfed6('0x15')](_0x71c083);}return null;};}function saveUpdates(_0x1357da){return function(_0x5e26fa){if(_0x5e26fa){return _0x5e26fa[_0xfed6('0x1c')](_0x1357da)[_0xfed6('0xa')](function(_0xb0007e){return _0xb0007e;});}return null;};}function removeEntity(_0x2ab5c6){return function(_0xea0a6f){if(_0xea0a6f){return _0xea0a6f['destroy']()[_0xfed6('0xa')](function(){_0x2ab5c6[_0xfed6('0x14')](0xcc)[_0xfed6('0x1d')]();});}};}function handleEntityNotFound(_0x1ca3a3){return function(_0x13107f){if(!_0x13107f){_0x1ca3a3['sendStatus'](0x194);}return _0x13107f;};}function handleError(_0x2afbc7,_0x855fe0){_0x855fe0=_0x855fe0||0x1f4;return function(_0x27f137){logger[_0xfed6('0x11')](_0x27f137['stack']);if(_0x27f137[_0xfed6('0x1e')]){delete _0x27f137[_0xfed6('0x1e')];}_0x2afbc7[_0xfed6('0x14')](_0x855fe0)[_0xfed6('0x1f')](_0x27f137);};}exports[_0xfed6('0x20')]=function(_0x131742,_0x1c671d){var _0x191c8d={},_0xf9652b={},_0x5c3e91={'count':0x0,'rows':[]};var _0x3fd6fd=_[_0xfed6('0x21')](db['Network']['rawAttributes'],function(_0x2327b4){return{'name':_0x2327b4[_0xfed6('0x22')],'type':_0x2327b4[_0xfed6('0x23')][_0xfed6('0x24')]};});_0xf9652b[_0xfed6('0x25')]=_[_0xfed6('0x21')](_0x3fd6fd,_0xfed6('0x1e'));_0xf9652b[_0xfed6('0x26')]=_[_0xfed6('0x27')](_0x131742[_0xfed6('0x26')]);_0xf9652b[_0xfed6('0x28')]=_[_0xfed6('0x29')](_0xf9652b[_0xfed6('0x25')],_0xf9652b[_0xfed6('0x26')]);_0x191c8d[_0xfed6('0x2a')]=_[_0xfed6('0x29')](_0xf9652b[_0xfed6('0x25')],qs[_0xfed6('0x2b')](_0x131742[_0xfed6('0x26')][_0xfed6('0x2b')]));_0x191c8d[_0xfed6('0x2a')]=_0x191c8d[_0xfed6('0x2a')][_0xfed6('0x2c')]?_0x191c8d[_0xfed6('0x2a')]:_0xf9652b['model'];if(!_0x131742[_0xfed6('0x26')][_0xfed6('0x2d')](_0xfed6('0x2e'))){_0x191c8d[_0xfed6('0x17')]=qs[_0xfed6('0x17')](_0x131742[_0xfed6('0x26')]['limit']);_0x191c8d[_0xfed6('0x19')]=qs['offset'](_0x131742[_0xfed6('0x26')]['offset']);}_0x191c8d[_0xfed6('0x2f')]=qs[_0xfed6('0x30')](_0x131742[_0xfed6('0x26')][_0xfed6('0x30')]);_0x191c8d[_0xfed6('0x31')]=qs[_0xfed6('0x28')](_[_0xfed6('0x32')](_0x131742[_0xfed6('0x26')],_0xf9652b[_0xfed6('0x28')]),_0x3fd6fd);if(_0x131742['query'][_0xfed6('0x33')]){_0x191c8d[_0xfed6('0x31')]=_['merge'](_0x191c8d[_0xfed6('0x31')],{'$or':_[_0xfed6('0x21')](_0x3fd6fd,function(_0x377807){if(_0x377807['type']!==_0xfed6('0x34')){var _0x42dd9d={};_0x42dd9d[_0x377807[_0xfed6('0x1e')]]={'$like':'%'+_0x131742[_0xfed6('0x26')][_0xfed6('0x33')]+'%'};return _0x42dd9d;}})});}_0x191c8d=_['merge']({},_0x191c8d,_0x131742[_0xfed6('0x35')]);var _0x269460={'where':_0x191c8d[_0xfed6('0x31')]};return db[_0xfed6('0x36')][_0xfed6('0x18')](_0x269460)[_0xfed6('0xa')](function(_0x5c3243){_0x5c3e91[_0xfed6('0x18')]=_0x5c3243;if(_0x131742['query']['includeAll']){_0x191c8d[_0xfed6('0x37')]=[{'all':!![]}];}return db[_0xfed6('0x36')][_0xfed6('0x38')](_0x191c8d);})[_0xfed6('0xa')](function(_0x74768d){_0x5c3e91[_0xfed6('0x39')]=_0x74768d;return _0x5c3e91;})[_0xfed6('0xa')](respondWithFilteredResult(_0x1c671d,_0x191c8d))['catch'](handleError(_0x1c671d,null));};exports['show']=function(_0x429b4b,_0x117882){var _0x303834={'raw':!![],'where':{'id':_0x429b4b[_0xfed6('0x3a')]['id']}},_0x23c43c={};_0x23c43c[_0xfed6('0x25')]=_[_0xfed6('0x27')](db[_0xfed6('0x36')][_0xfed6('0x3b')]);_0x23c43c[_0xfed6('0x26')]=_[_0xfed6('0x27')](_0x429b4b['query']);_0x23c43c[_0xfed6('0x28')]=_[_0xfed6('0x29')](_0x23c43c['model'],_0x23c43c[_0xfed6('0x26')]);_0x303834[_0xfed6('0x2a')]=_[_0xfed6('0x29')](_0x23c43c[_0xfed6('0x25')],qs[_0xfed6('0x2b')](_0x429b4b[_0xfed6('0x26')][_0xfed6('0x2b')]));_0x303834[_0xfed6('0x2a')]=_0x303834[_0xfed6('0x2a')][_0xfed6('0x2c')]?_0x303834['attributes']:_0x23c43c[_0xfed6('0x25')];if(_0x429b4b[_0xfed6('0x26')]['includeAll']){_0x303834['include']=[{'all':!![]}];}_0x303834=_[_0xfed6('0x3c')]({},_0x303834,_0x429b4b[_0xfed6('0x35')]);return db[_0xfed6('0x36')][_0xfed6('0x3d')](_0x303834)['then'](handleEntityNotFound(_0x117882,null))[_0xfed6('0xa')](respondWithResult(_0x117882,null))[_0xfed6('0x13')](handleError(_0x117882,null));};exports[_0xfed6('0x3e')]=function(_0x201d0c,_0x5cee29){var _0x517925;return db[_0xfed6('0x36')][_0xfed6('0x3e')](_0x201d0c['body'],{'raw':!![]})['then'](function(_0x489630){_0x517925=_0x489630;return db['Network'][_0xfed6('0x38')]({'where':{'type':_0x201d0c[_0xfed6('0x3f')]['type']},'raw':!![]});})[_0xfed6('0xa')](function(_0x15e26a){if(_0x517925['type'][_0xfed6('0x40')]()=='STUN'){var _0x2140ee=fs[_0xfed6('0x41')](path[_0xfed6('0x42')](config[_0xfed6('0x43')],_0xfed6('0x44')),_0xfed6('0x45'));var _0x4c5b20=ejs[_0xfed6('0x46')](_0x2140ee,{'networks':_0x15e26a||[]});fs[_0xfed6('0x47')](_0xfed6('0x48'),_0x4c5b20);return respondWithRpcPromise(_0xfed6('0x49'),_0xfed6('0x3e'),{'module':'res_stun_monitor.so'});}else if(_0x517925['type']['toUpperCase']()==_0xfed6('0x4a')){var _0x1174be=fs[_0xfed6('0x41')](path['join'](config[_0xfed6('0x43')],'server/files/templates/turn_multiple.ejs'),_0xfed6('0x45'));var _0x2cfdcf=ejs[_0xfed6('0x46')](_0x1174be,{'networks':_0x15e26a||[]});fs['writeFileSync'](_0xfed6('0x4b'),_0x2cfdcf);return respondWithRpcPromise(_0xfed6('0x49'),_0xfed6('0x3e'),{'module':_0xfed6('0x4c')});}else{var _0x166d0c=fs['readFileSync'](path['join'](config[_0xfed6('0x43')],_0xfed6('0x4d')),_0xfed6('0x45'));var _0x1caebf=ejs['render'](_0x166d0c,{'networks':_0x15e26a||[]});fs[_0xfed6('0x47')](util[_0xfed6('0x4e')](_0xfed6('0x4f'),_0x201d0c[_0xfed6('0x3f')][_0xfed6('0x23')]['toLowerCase']()),_0x1caebf);return respondWithRpcPromise(_0xfed6('0x49'),_0xfed6('0x3e'),{'module':_0xfed6('0x50')});}})[_0xfed6('0xa')](function(){return _0x517925;})[_0xfed6('0xa')](respondWithResult(_0x5cee29,0xc9))[_0xfed6('0x13')](handleError(_0x5cee29,null));};exports['update']=function(_0x448ef4,_0x3e3054){var _0x22ee3c;return db['Network'][_0xfed6('0x3d')]({'where':{'id':_0x448ef4[_0xfed6('0x3a')]['id']}})['then'](handleEntityNotFound(_0x3e3054,null))[_0xfed6('0xa')](saveUpdates(_0x448ef4[_0xfed6('0x3f')],null))['then'](function(_0x333e06){if(_0x333e06){_0x22ee3c=_0x333e06;return db[_0xfed6('0x36')][_0xfed6('0x38')]({'where':{'type':_0x22ee3c['type']},'raw':!![]});}return null;})[_0xfed6('0xa')](function(_0x228c72){if(_0x22ee3c[_0xfed6('0x23')][_0xfed6('0x40')]()==_0xfed6('0x51')){var _0x152870=fs['readFileSync'](path['join'](config['root'],_0xfed6('0x44')),_0xfed6('0x45'));var _0x1a5527=ejs[_0xfed6('0x46')](_0x152870,{'networks':_0x228c72||[]});fs[_0xfed6('0x47')](_0xfed6('0x48'),_0x1a5527);return respondWithRpcPromise(_0xfed6('0x49'),_0xfed6('0x1c'),{'module':_0xfed6('0x4c')});}else if(_0x22ee3c['type']['toUpperCase']()==_0xfed6('0x4a')){var _0x505b00=fs[_0xfed6('0x41')](path[_0xfed6('0x42')](config[_0xfed6('0x43')],_0xfed6('0x52')),'utf8');var _0x288ff3=ejs['render'](_0x505b00,{'networks':_0x228c72||[]});fs[_0xfed6('0x47')]('/etc/asterisk/turn_xcally.conf',_0x288ff3);return respondWithRpcPromise(_0xfed6('0x49'),_0xfed6('0x1c'),{'module':_0xfed6('0x4c')});}else{var _0x350d63=fs[_0xfed6('0x41')](path[_0xfed6('0x42')](config[_0xfed6('0x43')],_0xfed6('0x4d')),_0xfed6('0x45'));var _0x3e5c5b=ejs[_0xfed6('0x46')](_0x350d63,{'networks':_0x228c72||[]});fs['writeFileSync'](util[_0xfed6('0x4e')](_0xfed6('0x4f'),_0x448ef4['body'][_0xfed6('0x23')]['toLowerCase']()),_0x3e5c5b);return respondWithRpcPromise(_0xfed6('0x49'),_0xfed6('0x1c'),{'module':_0xfed6('0x50')});}})[_0xfed6('0xa')](function(_0x122b60){if(_0x122b60){return _0x22ee3c;}return null;})[_0xfed6('0xa')](respondWithResult(_0x3e3054,null))[_0xfed6('0x13')](handleError(_0x3e3054,null));};exports[_0xfed6('0x53')]=function(_0x49c646,_0x3ca759){var _0x2bbfbe;return db[_0xfed6('0x36')][_0xfed6('0x3d')]({'where':{'id':_0x49c646[_0xfed6('0x3a')]['id']}})[_0xfed6('0xa')](function(_0x346aca){_0x2bbfbe=_0x346aca;return _0x346aca;})[_0xfed6('0xa')](handleEntityNotFound(_0x3ca759,null))[_0xfed6('0xa')](removeEntity(_0x3ca759,null))[_0xfed6('0xa')](function(){if(_0x2bbfbe){return db['Network'][_0xfed6('0x38')]({'where':{'type':_0x2bbfbe[_0xfed6('0x23')]},'raw':!![]});}})[_0xfed6('0xa')](function(_0x5b4029){if(_0x2bbfbe[_0xfed6('0x23')][_0xfed6('0x40')]()==_0xfed6('0x51')){var _0x2f13dc=fs['readFileSync'](path['join'](config[_0xfed6('0x43')],'server/files/templates/stun_multiple.ejs'),_0xfed6('0x45'));var _0x40233d=ejs[_0xfed6('0x46')](_0x2f13dc,{'networks':_0x5b4029||[]});fs[_0xfed6('0x47')]('/etc/asterisk/stun_xcally.conf',_0x40233d);return respondWithRpcPromise(_0xfed6('0x49'),_0xfed6('0x53'),{'module':_0xfed6('0x4c')});}else if(_0x2bbfbe[_0xfed6('0x23')]['toUpperCase']()==_0xfed6('0x4a')){var _0x326f71=fs['readFileSync'](path['join'](config[_0xfed6('0x43')],_0xfed6('0x52')),'utf8');var _0xd42608=ejs[_0xfed6('0x46')](_0x326f71,{'networks':_0x5b4029||[]});fs[_0xfed6('0x47')](_0xfed6('0x4b'),_0xd42608);return respondWithRpcPromise(_0xfed6('0x49'),_0xfed6('0x53'),{'module':_0xfed6('0x4c')});}else{var _0x429f10=fs['readFileSync'](path[_0xfed6('0x42')](config[_0xfed6('0x43')],_0xfed6('0x4d')),_0xfed6('0x45'));var _0x28f4a7=ejs[_0xfed6('0x46')](_0x429f10,{'networks':_0x5b4029||[]});fs[_0xfed6('0x47')](util[_0xfed6('0x4e')](_0xfed6('0x4f'),_0x2bbfbe[_0xfed6('0x23')]['toLowerCase']()),_0x28f4a7);return respondWithRpcPromise(_0xfed6('0x49'),_0xfed6('0x53'),{'module':_0xfed6('0x50')});}})[_0xfed6('0x13')](handleError(_0x3ca759,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index fc86161..cff3363 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 _0x2dae=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./network.attributes','exports','define','Network','network'];(function(_0x48de86,_0x1a7656){var _0x1551de=function(_0x320057){while(--_0x320057){_0x48de86['push'](_0x48de86['shift']());}};_0x1551de(++_0x1a7656);}(_0x2dae,0xc3));var _0xe2da=function(_0x512c83,_0x42a67a){_0x512c83=_0x512c83-0x0;var _0x1f7f25=_0x2dae[_0x512c83];return _0x1f7f25;};'use strict';var _=require(_0xe2da('0x0'));var util=require('util');var logger=require(_0xe2da('0x1'))(_0xe2da('0x2'));var moment=require(_0xe2da('0x3'));var BPromise=require(_0xe2da('0x4'));var rp=require(_0xe2da('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe2da('0x6'));var config=require(_0xe2da('0x7'));var attributes=require(_0xe2da('0x8'));module[_0xe2da('0x9')]=function(_0x523c60,_0x3e3e25){return _0x523c60[_0xe2da('0xa')](_0xe2da('0xb'),attributes,{'tableName':_0xe2da('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2f68=['Network','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports'];(function(_0x2d4421,_0x15a84f){var _0x2d3b01=function(_0xb9e94c){while(--_0xb9e94c){_0x2d4421['push'](_0x2d4421['shift']());}};_0x2d3b01(++_0x15a84f);}(_0x2f68,0x9a));var _0x82f6=function(_0x230016,_0x27fc50){_0x230016=_0x230016-0x0;var _0x19b201=_0x2f68[_0x230016];return _0x19b201;};'use strict';var _=require('lodash');var util=require(_0x82f6('0x0'));var logger=require(_0x82f6('0x1'))(_0x82f6('0x2'));var moment=require(_0x82f6('0x3'));var BPromise=require('bluebird');var rp=require(_0x82f6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x82f6('0x5'));var config=require(_0x82f6('0x6'));var attributes=require('./network.attributes');module[_0x82f6('0x7')]=function(_0x2c4302,_0x542737){return _0x2c4302['define'](_0x82f6('0x8'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 94529e9..b47300a 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(_0x5ab9e9,_0x2e51ee){var _0x33bc65=function(_0xf2e980){while(--_0xf2e980){_0x5ab9e9['push'](_0x5ab9e9['shift']());}};_0x33bc65(++_0x2e51ee);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var 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(_0x19e884,_0x562e79){var _0x34cdac=function(_0x2ff28c){while(--_0x2ff28c){_0x19e884['push'](_0x19e884['shift']());}};_0x34cdac(++_0x562e79);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var 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 ad8d0d1..d48b0ed 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 _0x1775=['getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addAnswer','/:id/notify','addAgents','/:id/send','send','put','update','delete','destroy','removeDispositions','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x1775,0x1db));var _0x5177=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x1775[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require('multer');var util=require(_0x5177('0x0'));var path=require(_0x5177('0x1'));var timeout=require(_0x5177('0x2'));var express=require(_0x5177('0x3'));var router=express[_0x5177('0x4')]();var fs_extra=require(_0x5177('0x5'));var auth=require(_0x5177('0x6'));var interaction=require(_0x5177('0x7'));var config=require(_0x5177('0x8'));var controller=require(_0x5177('0x9'));router[_0x5177('0xa')]('/',auth[_0x5177('0xb')](),controller[_0x5177('0xc')]);router[_0x5177('0xa')](_0x5177('0xd'),auth[_0x5177('0xb')](),controller[_0x5177('0xe')]);router[_0x5177('0xa')](_0x5177('0xf'),auth[_0x5177('0xb')](),controller[_0x5177('0x10')]);router[_0x5177('0xa')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x5177('0x11')]);router[_0x5177('0xa')](_0x5177('0x12'),auth[_0x5177('0xb')](),controller[_0x5177('0x13')]);router['get'](_0x5177('0x14'),auth[_0x5177('0xb')](),controller[_0x5177('0x15')]);router[_0x5177('0xa')](_0x5177('0x16'),auth[_0x5177('0xb')](),controller[_0x5177('0x17')]);router[_0x5177('0xa')](_0x5177('0x18'),auth[_0x5177('0xb')](),controller[_0x5177('0x19')]);router[_0x5177('0x1a')]('/',auth[_0x5177('0xb')](),controller[_0x5177('0x1b')]);router[_0x5177('0x1a')](_0x5177('0x1c'),auth[_0x5177('0xb')](),controller[_0x5177('0x1d')]);router[_0x5177('0x1a')]('/:id/canned_answers',auth[_0x5177('0xb')](),controller[_0x5177('0x1e')]);router[_0x5177('0x1a')](_0x5177('0x1f'),controller['notify']);router[_0x5177('0x1a')](_0x5177('0x14'),auth[_0x5177('0xb')](),controller['addApplications']);router[_0x5177('0x1a')]('/:id/users',auth[_0x5177('0xb')](),controller[_0x5177('0x20')]);router[_0x5177('0x1a')](_0x5177('0x21'),auth[_0x5177('0xb')](),controller[_0x5177('0x22')]);router[_0x5177('0x23')](_0x5177('0xf'),auth[_0x5177('0xb')](),controller[_0x5177('0x24')]);router[_0x5177('0x25')](_0x5177('0xf'),auth['isAuthenticated'](),controller[_0x5177('0x26')]);router['delete'](_0x5177('0x1c'),auth[_0x5177('0xb')](),controller[_0x5177('0x27')]);router[_0x5177('0x25')]('/:id/canned_answers',auth[_0x5177('0xb')](),controller['removeAnswers']);router['delete'](_0x5177('0x18'),auth[_0x5177('0xb')](),controller['removeAgents']);module[_0x5177('0x28')]=router; \ No newline at end of file +var _0x7b84=['notify','addAgents','/:id/send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','create','post','addDisposition'];(function(_0x57b9a1,_0x1bbe43){var _0x1c7cd8=function(_0x38d801){while(--_0x38d801){_0x57b9a1['push'](_0x57b9a1['shift']());}};_0x1c7cd8(++_0x1bbe43);}(_0x7b84,0x17c));var _0x47b8=function(_0x541724,_0x3e8574){_0x541724=_0x541724-0x0;var _0x30d7b9=_0x7b84[_0x541724];return _0x30d7b9;};'use strict';var multer=require(_0x47b8('0x0'));var util=require(_0x47b8('0x1'));var path=require(_0x47b8('0x2'));var timeout=require(_0x47b8('0x3'));var express=require(_0x47b8('0x4'));var router=express[_0x47b8('0x5')]();var fs_extra=require(_0x47b8('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x47b8('0x7'));var config=require(_0x47b8('0x8'));var controller=require(_0x47b8('0x9'));router[_0x47b8('0xa')]('/',auth[_0x47b8('0xb')](),controller[_0x47b8('0xc')]);router['get'](_0x47b8('0xd'),auth[_0x47b8('0xb')](),controller[_0x47b8('0xe')]);router[_0x47b8('0xa')](_0x47b8('0xf'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x10')]);router[_0x47b8('0xa')](_0x47b8('0x11'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x12')]);router[_0x47b8('0xa')](_0x47b8('0x13'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x14')]);router[_0x47b8('0xa')](_0x47b8('0x15'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x16')]);router[_0x47b8('0xa')](_0x47b8('0x17'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x18')]);router[_0x47b8('0xa')](_0x47b8('0x19'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x1a')]);router['post']('/',auth[_0x47b8('0xb')](),controller[_0x47b8('0x1b')]);router[_0x47b8('0x1c')](_0x47b8('0x11'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x1d')]);router[_0x47b8('0x1c')]('/:id/canned_answers',auth[_0x47b8('0xb')](),controller['addAnswer']);router['post']('/:id/notify',controller[_0x47b8('0x1e')]);router[_0x47b8('0x1c')](_0x47b8('0x15'),auth['isAuthenticated'](),controller['addApplications']);router['post'](_0x47b8('0x19'),auth['isAuthenticated'](),controller[_0x47b8('0x1f')]);router[_0x47b8('0x1c')](_0x47b8('0x20'),auth[_0x47b8('0xb')](),controller['send']);router[_0x47b8('0x21')](_0x47b8('0xf'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x22')]);router[_0x47b8('0x23')](_0x47b8('0xf'),auth['isAuthenticated'](),controller[_0x47b8('0x24')]);router[_0x47b8('0x23')]('/:id/dispositions',auth[_0x47b8('0xb')](),controller[_0x47b8('0x25')]);router[_0x47b8('0x23')](_0x47b8('0x13'),auth['isAuthenticated'](),controller[_0x47b8('0x26')]);router[_0x47b8('0x23')](_0x47b8('0x19'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x27')]);module[_0x47b8('0x28')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 97adb7b..cd1ef5f 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 _0x50d9=['setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','name','STRING','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x417774,_0x1b95e6){var _0x10015d=function(_0x2526b3){while(--_0x2526b3){_0x417774['push'](_0x417774['shift']());}};_0x10015d(++_0x1b95e6);}(_0x50d9,0x107));var _0x950d=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x50d9[_0x5783f4];return _0x28e380;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x950d('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x950d('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x950d('0x2')]},'token':{'type':Sequelize[_0x950d('0x2')],'defaultValue':function(){return rs[_0x950d('0x3')]();}},'replyUri':{'type':Sequelize[_0x950d('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x950d('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x950d('0x4')],'defaultValue':function(){return _0x950d('0x5');}},'notificationSound':{'type':Sequelize[_0x950d('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x950d('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x950d('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x950d('0x2')]},'queueTransfer':{'type':Sequelize[_0x950d('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x950d('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x950d('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x950d('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x950d('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x950d('0x6')],'defaultValue':![],'comment':_0x950d('0x9'),'set':function(_0x1bffee){if(!_0x1bffee)this[_0x950d('0xa')](_0x950d('0xb'),null);this[_0x950d('0xa')](_0x950d('0xc'),_0x1bffee);}}}; \ No newline at end of file +var _0x9e11=['BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','STRING','name','generate','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x87239,_0x38c793){var _0x53af1e=function(_0x11eb5f){while(--_0x11eb5f){_0x87239['push'](_0x87239['shift']());}};_0x53af1e(++_0x38c793);}(_0x9e11,0xaf));var _0x19e1=function(_0x2001ab,_0x37a84d){_0x2001ab=_0x2001ab-0x0;var _0x4e226a=_0x9e11[_0x2001ab];return _0x4e226a;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x19e1('0x0'));module['exports']={'name':{'type':Sequelize[_0x19e1('0x1')],'unique':_0x19e1('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x19e1('0x1')]},'token':{'type':Sequelize[_0x19e1('0x1')],'defaultValue':function(){return rs[_0x19e1('0x3')]();}},'replyUri':{'type':Sequelize[_0x19e1('0x1')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x19e1('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x19e1('0x4');}},'notificationSound':{'type':Sequelize[_0x19e1('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x19e1('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x19e1('0x1')]},'queueTransfer':{'type':Sequelize[_0x19e1('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x19e1('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x19e1('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x19e1('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x19e1('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x19e1('0x5')],'defaultValue':![],'comment':_0x19e1('0x8'),'set':function(_0x339de1){if(!_0x339de1)this[_0x19e1('0x9')](_0x19e1('0xa'),null);this[_0x19e1('0x9')](_0x19e1('0xb'),_0x339de1);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index a35f22a..a11e8ea 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 _0x2f74=['intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','mandatoryDispositionPause','filters','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','update','body','find','params','describe','OpenchannelAccountId','Disposition','hasOwnProperty','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','notify','openchannel','CmContact','Sequelize','no\x20available\x20attributes','createdAt','difference','updatedAt','CompanyId','ListId','isNil','from','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','List','DESC','OpenchannelApplication','account','applications','list','priority','asc','Applications','firstName','lastName','threadId','externalUrl','OpenchannelInteraction','ContactId','spread','contact','messageId','interaction','created','push','close','OpenchannelMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','OpenchannelQueue','queueId','waitForTheAssignedQueue','Start','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','omit','emit','removeAgents','isArray','userOpenchannelAccount:remove','send','Contacts','user','out','dataValues','Messages','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./openchannelAccount.socket','register','jayson/promise','client','http','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','count','limit','set','Content-Range','json','reject','save','then','destroy','OpenchannelAccounts','stack','name','Pause','OpenchannelAccount','rawAttributes','type','model','map','keys','query'];(function(_0x4fe454,_0x1e37b2){var _0x17e929=function(_0x4c9fcd){while(--_0x4c9fcd){_0x4fe454['push'](_0x4fe454['shift']());}};_0x17e929(++_0x1e37b2);}(_0x2f74,0x7b));var _0x42f7=function(_0x13f601,_0x4dc50f){_0x13f601=_0x13f601-0x0;var _0xad44c0=_0x2f74[_0x13f601];return _0xad44c0;};'use strict';var emlformat=require(_0x42f7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x42f7('0x1'));var jsonpatch=require(_0x42f7('0x2'));var rp=require(_0x42f7('0x3'));var moment=require(_0x42f7('0x4'));var BPromise=require(_0x42f7('0x5'));var Mustache=require(_0x42f7('0x6'));var util=require(_0x42f7('0x7'));var path=require(_0x42f7('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x42f7('0x9'));var _=require(_0x42f7('0xa'));var squel=require(_0x42f7('0xb'));var crypto=require(_0x42f7('0xc'));var jsforce=require(_0x42f7('0xd'));var deskjs=require(_0x42f7('0xe'));var toCsv=require(_0x42f7('0xf'));var querystring=require(_0x42f7('0x10'));var Papa=require('papaparse');var Redis=require(_0x42f7('0x11'));var authService=require(_0x42f7('0x12'));var qs=require(_0x42f7('0x13'));var as=require(_0x42f7('0x14'));var hardwareService=require(_0x42f7('0x15'));var logger=require(_0x42f7('0x16'))('api');var utils=require(_0x42f7('0x17'));var config=require(_0x42f7('0x18'));var licenseUtil=require(_0x42f7('0x19'));var db=require(_0x42f7('0x1a'))['db'];config[_0x42f7('0x1b')]=_[_0x42f7('0x1c')](config[_0x42f7('0x1b')],{'host':_0x42f7('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x42f7('0x1e'))[_0x42f7('0x1f')](socket);var jayson=require(_0x42f7('0x20'));var client=jayson[_0x42f7('0x21')][_0x42f7('0x22')]({'port':0x232c});var client9002=jayson['client'][_0x42f7('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x4d7944,_0x3e7fd8,_0x225a6b,_0x16d842){return new BPromise(function(_0x19eff3,_0x423876){var _0xa1bb54=_0x16d842||client;return _0xa1bb54[_0x42f7('0x23')](_0x4d7944,_0x225a6b)['then'](function(_0x3fc38d){logger[_0x42f7('0x24')](_0x42f7('0x25'),_0x3e7fd8,_0x42f7('0x26'));logger[_0x42f7('0x27')](_0x42f7('0x28'),_0x3e7fd8,'request\x20sent',JSON[_0x42f7('0x29')](_0x3fc38d));if(_0x3fc38d['error']){if(_0x3fc38d[_0x42f7('0x2a')]['code']===0x1f4){logger[_0x42f7('0x2a')]('OpenchannelAccount,\x20%s,\x20%s',_0x3e7fd8,_0x3fc38d['error']['message']);return _0x423876(_0x3fc38d[_0x42f7('0x2a')][_0x42f7('0x2b')]);}logger[_0x42f7('0x2a')](_0x42f7('0x25'),_0x3e7fd8,_0x3fc38d[_0x42f7('0x2a')][_0x42f7('0x2b')]);return _0x19eff3(_0x3fc38d[_0x42f7('0x2a')][_0x42f7('0x2b')]);}else{logger[_0x42f7('0x24')](_0x42f7('0x25'),_0x3e7fd8,_0x42f7('0x26'));_0x19eff3(_0x3fc38d[_0x42f7('0x2c')][_0x42f7('0x2b')]);}})[_0x42f7('0x2d')](function(_0x553531){logger['error'](_0x42f7('0x25'),_0x3e7fd8,_0x553531);_0x423876(_0x553531);});});}function respondWithStatusCode(_0x35f941,_0x445e03){_0x445e03=_0x445e03||0xcc;return function(_0x3bb6bc){if(_0x3bb6bc){return _0x35f941[_0x42f7('0x2e')](_0x445e03);}return _0x35f941[_0x42f7('0x2f')](_0x445e03)[_0x42f7('0x30')]();};}function respondWithResult(_0x64859,_0xe53027){_0xe53027=_0xe53027||0xc8;return function(_0x1118ab){if(_0x1118ab){return _0x64859['status'](_0xe53027)['json'](_0x1118ab);}};}function respondWithFilteredResult(_0x4022dd,_0x1b0977){return function(_0x1c4dc9){if(_0x1c4dc9){var _0x4d7137=typeof _0x1b0977[_0x42f7('0x31')]===_0x42f7('0x32')&&typeof _0x1b0977['limit']==='undefined';var _0x36e6d4=_0x1c4dc9[_0x42f7('0x33')];var _0x210054=_0x4d7137?0x0:_0x1b0977[_0x42f7('0x31')];var _0x1e245c=_0x4d7137?_0x1c4dc9[_0x42f7('0x33')]:_0x1b0977[_0x42f7('0x31')]+_0x1b0977[_0x42f7('0x34')];var _0x3322d2;if(_0x1e245c>=_0x36e6d4){_0x1e245c=_0x36e6d4;_0x3322d2=0xc8;}else{_0x3322d2=0xce;}_0x4022dd['status'](_0x3322d2);return _0x4022dd[_0x42f7('0x35')](_0x42f7('0x36'),_0x210054+'-'+_0x1e245c+'/'+_0x36e6d4)[_0x42f7('0x37')](_0x1c4dc9);}return null;};}function patchUpdates(_0xd26ccf){return function(_0x1ac7e0){try{jsonpatch['apply'](_0x1ac7e0,_0xd26ccf,!![]);}catch(_0x27db26){return BPromise[_0x42f7('0x38')](_0x27db26);}return _0x1ac7e0[_0x42f7('0x39')]();};}function saveUpdates(_0x310872,_0x505310){return function(_0x3ef7a8){if(_0x3ef7a8){return _0x3ef7a8['update'](_0x310872)[_0x42f7('0x3a')](function(_0x2bb14b){return _0x2bb14b;});}return null;};}function removeEntity(_0xec377d,_0x27518d){return function(_0x14cae3){if(_0x14cae3){return _0x14cae3[_0x42f7('0x3b')]()[_0x42f7('0x3a')](function(){var _0x4e506f=_0x14cae3['get']({'plain':!![]});var _0x2ce93f=_0x42f7('0x3c');return db['UserProfileResource'][_0x42f7('0x3b')]({'where':{'type':_0x2ce93f,'resourceId':_0x4e506f['id']}})['then'](function(){return _0x14cae3;});})[_0x42f7('0x3a')](function(){_0xec377d[_0x42f7('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bb1cf,_0x48b79e){return function(_0x43a108){if(!_0x43a108){_0x4bb1cf['sendStatus'](0x194);}return _0x43a108;};}function handleError(_0xc3a6a1,_0x19d067){_0x19d067=_0x19d067||0x1f4;return function(_0x44ec4b){logger[_0x42f7('0x2a')](_0x44ec4b[_0x42f7('0x3d')]);if(_0x44ec4b['name']){delete _0x44ec4b[_0x42f7('0x3e')];}_0xc3a6a1[_0x42f7('0x2f')](_0x19d067)['send'](_0x44ec4b);};}exports['index']=function(_0x151c80,_0x164553){var _0x33bf56={'include':[{'model':db[_0x42f7('0x3f')],'as':'mandatoryDispositionPause'}]},_0x2204a1={},_0xaa39b4={'count':0x0,'rows':[]};var _0x3037f8=_['map'](db[_0x42f7('0x40')][_0x42f7('0x41')],function(_0x21bca2){return{'name':_0x21bca2['fieldName'],'type':_0x21bca2[_0x42f7('0x42')]['key']};});_0x2204a1[_0x42f7('0x43')]=_[_0x42f7('0x44')](_0x3037f8,_0x42f7('0x3e'));_0x2204a1['query']=_[_0x42f7('0x45')](_0x151c80[_0x42f7('0x46')]);_0x2204a1['filters']=_[_0x42f7('0x47')](_0x2204a1['model'],_0x2204a1[_0x42f7('0x46')]);_0x33bf56['attributes']=_[_0x42f7('0x47')](_0x2204a1[_0x42f7('0x43')],qs['fields'](_0x151c80[_0x42f7('0x46')][_0x42f7('0x48')]));_0x33bf56['attributes']=_0x33bf56[_0x42f7('0x49')][_0x42f7('0x4a')]?_0x33bf56[_0x42f7('0x49')]:_0x2204a1[_0x42f7('0x43')];if(!_0x151c80[_0x42f7('0x46')]['hasOwnProperty'](_0x42f7('0x4b'))){_0x33bf56['limit']=qs[_0x42f7('0x34')](_0x151c80[_0x42f7('0x46')][_0x42f7('0x34')]);_0x33bf56[_0x42f7('0x31')]=qs['offset'](_0x151c80[_0x42f7('0x46')][_0x42f7('0x31')]);}_0x33bf56[_0x42f7('0x4c')]=qs[_0x42f7('0x4d')](_0x151c80[_0x42f7('0x46')][_0x42f7('0x4d')]);_0x33bf56['where']=qs['filters'](_[_0x42f7('0x4e')](_0x151c80[_0x42f7('0x46')],_0x2204a1['filters']),_0x3037f8);if(_0x151c80[_0x42f7('0x46')][_0x42f7('0x4f')]){_0x33bf56[_0x42f7('0x50')]=_[_0x42f7('0x51')](_0x33bf56[_0x42f7('0x50')],{'$or':_[_0x42f7('0x44')](_0x3037f8,function(_0x30e81f){if(_0x30e81f[_0x42f7('0x42')]!==_0x42f7('0x52')){var _0x5334fe={};_0x5334fe[_0x30e81f[_0x42f7('0x3e')]]={'$like':'%'+_0x151c80[_0x42f7('0x46')][_0x42f7('0x4f')]+'%'};return _0x5334fe;}})});}_0x33bf56=_[_0x42f7('0x51')]({},_0x33bf56,_0x151c80[_0x42f7('0x53')]);var _0x211cba={'where':_0x33bf56[_0x42f7('0x50')]};return db[_0x42f7('0x40')]['count'](_0x211cba)[_0x42f7('0x3a')](function(_0x20da5f){_0xaa39b4[_0x42f7('0x33')]=_0x20da5f;if(_0x151c80[_0x42f7('0x46')][_0x42f7('0x54')]){_0x33bf56[_0x42f7('0x55')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0x42f7('0x56')](_0x33bf56);})[_0x42f7('0x3a')](function(_0x4e61a9){_0xaa39b4[_0x42f7('0x57')]=_0x4e61a9;return _0xaa39b4;})['then'](respondWithFilteredResult(_0x164553,_0x33bf56))[_0x42f7('0x2d')](handleError(_0x164553,null));};exports[_0x42f7('0x58')]=function(_0x1a3e1f,_0x5df782){var _0x27f709={'raw':![],'where':{'id':_0x1a3e1f['params']['id']},'include':[{'model':db[_0x42f7('0x3f')],'as':_0x42f7('0x59')}]},_0x291605={};_0x291605[_0x42f7('0x43')]=_[_0x42f7('0x45')](db[_0x42f7('0x40')][_0x42f7('0x41')]);_0x291605[_0x42f7('0x46')]=_[_0x42f7('0x45')](_0x1a3e1f[_0x42f7('0x46')]);_0x291605[_0x42f7('0x5a')]=_[_0x42f7('0x47')](_0x291605[_0x42f7('0x43')],_0x291605[_0x42f7('0x46')]);_0x27f709['attributes']=_[_0x42f7('0x47')](_0x291605['model'],qs[_0x42f7('0x48')](_0x1a3e1f[_0x42f7('0x46')][_0x42f7('0x48')]));_0x27f709[_0x42f7('0x49')]=_0x27f709[_0x42f7('0x49')][_0x42f7('0x4a')]?_0x27f709[_0x42f7('0x49')]:_0x291605[_0x42f7('0x43')];if(_0x1a3e1f['query'][_0x42f7('0x54')]){_0x27f709[_0x42f7('0x55')]=[{'all':!![]}];}_0x27f709=_['merge']({},_0x27f709,_0x1a3e1f['options']);return db[_0x42f7('0x40')]['find'](_0x27f709)['then'](handleEntityNotFound(_0x5df782,null))[_0x42f7('0x3a')](respondWithResult(_0x5df782,null))[_0x42f7('0x2d')](handleError(_0x5df782,null));};exports['create']=function(_0x4c7a0e,_0x3c9828){return db['OpenchannelAccount'][_0x42f7('0x5b')](_0x4c7a0e['body'],{})['then'](function(_0x460c69){var _0x3230e9=_0x4c7a0e['user']['get']({'plain':!![]});if(!_0x3230e9)throw new Error(_0x42f7('0x5c'));if(_0x3230e9[_0x42f7('0x5d')]==='user'){var _0x475ab0=_0x460c69[_0x42f7('0x5e')]({'plain':!![]});var _0x329152=_0x42f7('0x3c');return db[_0x42f7('0x5f')]['find']({'where':{'name':_0x329152,'userProfileId':_0x3230e9[_0x42f7('0x60')]},'raw':!![]})['then'](function(_0x3b28d5){if(_0x3b28d5&&_0x3b28d5[_0x42f7('0x61')]===0x0){return db[_0x42f7('0x62')][_0x42f7('0x5b')]({'name':_0x475ab0[_0x42f7('0x3e')],'resourceId':_0x475ab0['id'],'type':_0x3b28d5[_0x42f7('0x3e')],'sectionId':_0x3b28d5['id']},{})[_0x42f7('0x3a')](function(){return _0x460c69;});}else{return _0x460c69;}})['catch'](function(_0x419be3){logger[_0x42f7('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x419be3);throw _0x419be3;});}return _0x460c69;})[_0x42f7('0x3a')](respondWithResult(_0x3c9828,0xc9))[_0x42f7('0x2d')](handleError(_0x3c9828,null));};exports[_0x42f7('0x63')]=function(_0x264a49,_0x49e9b3){if(_0x264a49[_0x42f7('0x64')]['id']){delete _0x264a49['body']['id'];}return db[_0x42f7('0x40')][_0x42f7('0x65')]({'where':{'id':_0x264a49['params']['id']},'include':[{'model':db[_0x42f7('0x3f')],'as':_0x42f7('0x59')}]})[_0x42f7('0x3a')](handleEntityNotFound(_0x49e9b3,null))[_0x42f7('0x3a')](saveUpdates(_0x264a49[_0x42f7('0x64')],null))[_0x42f7('0x3a')](respondWithResult(_0x49e9b3,null))[_0x42f7('0x2d')](handleError(_0x49e9b3,null));};exports['destroy']=function(_0x13d5be,_0x998bb2){return db[_0x42f7('0x40')]['find']({'where':{'id':_0x13d5be[_0x42f7('0x66')]['id']}})['then'](handleEntityNotFound(_0x998bb2,null))[_0x42f7('0x3a')](removeEntity(_0x998bb2,null))['catch'](handleError(_0x998bb2,null));};exports['describe']=function(_0x4a9786,_0x2fd4bd){return db['OpenchannelAccount'][_0x42f7('0x67')]()[_0x42f7('0x3a')](respondWithResult(_0x2fd4bd,null))['catch'](handleError(_0x2fd4bd,null));};exports['addDisposition']=function(_0x1baaba,_0x53d9fd,_0x114c8b){if(_0x1baaba['body']['id']){delete _0x1baaba[_0x42f7('0x64')]['id'];}return db['OpenchannelAccount'][_0x42f7('0x65')]({'where':{'id':_0x1baaba[_0x42f7('0x66')]['id']}})[_0x42f7('0x3a')](handleEntityNotFound(_0x53d9fd,null))[_0x42f7('0x3a')](function(_0x406720){if(_0x406720){_0x1baaba[_0x42f7('0x64')][_0x42f7('0x68')]=_0x406720['id'];return db['Disposition'][_0x42f7('0x5b')](_0x1baaba[_0x42f7('0x64')]);}})[_0x42f7('0x3a')](respondWithResult(_0x53d9fd,null))[_0x42f7('0x2d')](handleError(_0x53d9fd,null));};exports['getDispositions']=function(_0x2ac4b8,_0xc2ca02,_0x3c98a3){var _0x5dadd6={'raw':![],'where':{}};var _0x285fa8={};var _0x328033={'count':0x0,'rows':[]};return db[_0x42f7('0x40')]['findOne']({'where':{'id':_0x2ac4b8[_0x42f7('0x66')]['id']}})['then'](handleEntityNotFound(_0xc2ca02,null))[_0x42f7('0x3a')](function(_0x390f27){if(_0x390f27){_0x285fa8[_0x42f7('0x43')]=_[_0x42f7('0x45')](db[_0x42f7('0x69')][_0x42f7('0x41')]);_0x285fa8[_0x42f7('0x46')]=_[_0x42f7('0x45')](_0x2ac4b8[_0x42f7('0x46')]);_0x285fa8['filters']=_['intersection'](_0x285fa8[_0x42f7('0x43')],_0x285fa8[_0x42f7('0x46')]);_0x5dadd6['attributes']=_[_0x42f7('0x47')](_0x285fa8['model'],qs[_0x42f7('0x48')](_0x2ac4b8['query'][_0x42f7('0x48')]));_0x5dadd6[_0x42f7('0x49')]=_0x5dadd6['attributes']['length']?_0x5dadd6['attributes']:_0x285fa8[_0x42f7('0x43')];if(!_0x2ac4b8['query'][_0x42f7('0x6a')](_0x42f7('0x4b'))){_0x5dadd6[_0x42f7('0x34')]=qs[_0x42f7('0x34')](_0x2ac4b8[_0x42f7('0x46')][_0x42f7('0x34')]);_0x5dadd6[_0x42f7('0x31')]=qs[_0x42f7('0x31')](_0x2ac4b8['query'][_0x42f7('0x31')]);}_0x5dadd6[_0x42f7('0x4c')]=qs[_0x42f7('0x4d')](_0x2ac4b8[_0x42f7('0x46')]['sort']);_0x5dadd6[_0x42f7('0x50')]=qs[_0x42f7('0x5a')](_['pick'](_0x2ac4b8[_0x42f7('0x46')],_0x285fa8[_0x42f7('0x5a')]));_0x5dadd6[_0x42f7('0x50')]['OpenchannelAccountId']=_0x390f27['id'];if(_0x2ac4b8[_0x42f7('0x46')][_0x42f7('0x4f')]){_0x5dadd6[_0x42f7('0x50')]=_[_0x42f7('0x51')](_0x5dadd6[_0x42f7('0x50')],{'$or':_[_0x42f7('0x44')](_0x5dadd6[_0x42f7('0x49')],function(_0x3e3b1e){var _0x28c543={};_0x28c543[_0x3e3b1e]={'$like':'%'+_0x2ac4b8['query'][_0x42f7('0x4f')]+'%'};return _0x28c543;})});}_0x5dadd6=_['merge']({},_0x5dadd6,_0x2ac4b8[_0x42f7('0x53')]);return db[_0x42f7('0x69')][_0x42f7('0x33')]({'where':_0x5dadd6[_0x42f7('0x50')]})[_0x42f7('0x3a')](function(_0x17c556){_0x328033[_0x42f7('0x33')]=_0x17c556;if(_0x2ac4b8[_0x42f7('0x46')][_0x42f7('0x54')]){_0x5dadd6['include']=[{'all':!![]}];}return db[_0x42f7('0x69')][_0x42f7('0x56')](_0x5dadd6);})[_0x42f7('0x3a')](function(_0x3b43f7){_0x328033[_0x42f7('0x57')]=_0x3b43f7;return _0x328033;});}})['then'](respondWithFilteredResult(_0xc2ca02,_0x5dadd6))[_0x42f7('0x2d')](handleError(_0xc2ca02,null));};exports[_0x42f7('0x6b')]=function(_0x2f0beb,_0x786c4c,_0x5c81d6){return db[_0x42f7('0x40')][_0x42f7('0x65')]({'where':{'id':_0x2f0beb[_0x42f7('0x66')]['id']}})[_0x42f7('0x3a')](handleEntityNotFound(_0x786c4c,null))[_0x42f7('0x3a')](function(_0x57b632){if(_0x57b632){return _0x57b632[_0x42f7('0x6b')](_0x2f0beb[_0x42f7('0x46')][_0x42f7('0x6c')]);}})[_0x42f7('0x3a')](respondWithStatusCode(_0x786c4c,null))[_0x42f7('0x2d')](handleError(_0x786c4c,null));};exports[_0x42f7('0x6d')]=function(_0x2566a7,_0x2ad980,_0x697c8a){if(_0x2566a7['body']['id']){delete _0x2566a7[_0x42f7('0x64')]['id'];}return db['OpenchannelAccount'][_0x42f7('0x65')]({'where':{'id':_0x2566a7[_0x42f7('0x66')]['id']}})[_0x42f7('0x3a')](handleEntityNotFound(_0x2ad980,null))[_0x42f7('0x3a')](function(_0x163925){if(_0x163925){_0x2566a7[_0x42f7('0x64')][_0x42f7('0x68')]=_0x163925['id'];return db[_0x42f7('0x6e')][_0x42f7('0x5b')](_0x2566a7[_0x42f7('0x64')]);}})[_0x42f7('0x3a')](respondWithResult(_0x2ad980,null))[_0x42f7('0x2d')](handleError(_0x2ad980,null));};exports[_0x42f7('0x6f')]=function(_0x3d0676,_0x170e25,_0x3f30f8){var _0x548834={'raw':![],'where':{}};var _0x4e8408={};var _0x115903={'count':0x0,'rows':[]};return db[_0x42f7('0x40')][_0x42f7('0x70')]({'where':{'id':_0x3d0676[_0x42f7('0x66')]['id']}})['then'](handleEntityNotFound(_0x170e25,null))['then'](function(_0x2264d5){if(_0x2264d5){_0x4e8408[_0x42f7('0x43')]=_[_0x42f7('0x45')](db[_0x42f7('0x6e')]['rawAttributes']);_0x4e8408[_0x42f7('0x46')]=_[_0x42f7('0x45')](_0x3d0676[_0x42f7('0x46')]);_0x4e8408['filters']=_['intersection'](_0x4e8408[_0x42f7('0x43')],_0x4e8408[_0x42f7('0x46')]);_0x548834[_0x42f7('0x49')]=_['intersection'](_0x4e8408[_0x42f7('0x43')],qs['fields'](_0x3d0676['query'][_0x42f7('0x48')]));_0x548834[_0x42f7('0x49')]=_0x548834['attributes']['length']?_0x548834['attributes']:_0x4e8408['model'];if(!_0x3d0676[_0x42f7('0x46')][_0x42f7('0x6a')](_0x42f7('0x4b'))){_0x548834['limit']=qs[_0x42f7('0x34')](_0x3d0676[_0x42f7('0x46')]['limit']);_0x548834[_0x42f7('0x31')]=qs[_0x42f7('0x31')](_0x3d0676[_0x42f7('0x46')][_0x42f7('0x31')]);}_0x548834['order']=qs[_0x42f7('0x4d')](_0x3d0676[_0x42f7('0x46')]['sort']);_0x548834[_0x42f7('0x50')]=qs[_0x42f7('0x5a')](_[_0x42f7('0x4e')](_0x3d0676[_0x42f7('0x46')],_0x4e8408['filters']));_0x548834['where'][_0x42f7('0x68')]=_0x2264d5['id'];if(_0x3d0676[_0x42f7('0x46')][_0x42f7('0x4f')]){_0x548834[_0x42f7('0x50')]=_['merge'](_0x548834[_0x42f7('0x50')],{'$or':_[_0x42f7('0x44')](_0x548834[_0x42f7('0x49')],function(_0x4ab205){var _0x594f4f={};_0x594f4f[_0x4ab205]={'$like':'%'+_0x3d0676[_0x42f7('0x46')][_0x42f7('0x4f')]+'%'};return _0x594f4f;})});}_0x548834=_['merge']({},_0x548834,_0x3d0676[_0x42f7('0x53')]);return db['CannedAnswer'][_0x42f7('0x33')]({'where':_0x548834[_0x42f7('0x50')]})['then'](function(_0x2cf17d){_0x115903[_0x42f7('0x33')]=_0x2cf17d;if(_0x3d0676[_0x42f7('0x46')]['includeAll']){_0x548834[_0x42f7('0x55')]=[{'all':!![]}];}return db[_0x42f7('0x6e')][_0x42f7('0x56')](_0x548834);})[_0x42f7('0x3a')](function(_0x27d8a1){_0x115903['rows']=_0x27d8a1;return _0x115903;});}})[_0x42f7('0x3a')](respondWithFilteredResult(_0x170e25,_0x548834))[_0x42f7('0x2d')](handleError(_0x170e25,null));};exports['removeAnswers']=function(_0xf5758d,_0x4e3ac8,_0x3e4c88){return db[_0x42f7('0x40')][_0x42f7('0x65')]({'where':{'id':_0xf5758d[_0x42f7('0x66')]['id']}})[_0x42f7('0x3a')](handleEntityNotFound(_0x4e3ac8,null))[_0x42f7('0x3a')](function(_0xeed92a){if(_0xeed92a){return _0xeed92a['removeAnswers'](_0xf5758d[_0x42f7('0x46')][_0x42f7('0x6c')]);}})[_0x42f7('0x3a')](respondWithStatusCode(_0x4e3ac8,null))[_0x42f7('0x2d')](handleError(_0x4e3ac8,null));};exports[_0x42f7('0x71')]=function(_0x2b8ea2,_0x3a3144,_0x407421){var _0x1475e9={'body':_0x2b8ea2['body'],'channel':_0x42f7('0x72')};var _0x59546e=[];var _0x56c1c5=[];var _0x518ab8={};var _0x197947=![];return db[_0x42f7('0x73')][_0x42f7('0x67')]()['then'](function(_0x206367){if(!_0x206367){throw new db[(_0x42f7('0x74'))]['ValidationError'](_0x42f7('0x75'));}_0x59546e=_['difference'](_['keys'](_0x206367),[_0x42f7('0x76'),'updatedAt']);_0x56c1c5=_[_0x42f7('0x77')](_[_0x42f7('0x45')](_0x206367),[_0x42f7('0x76'),_0x42f7('0x78'),_0x42f7('0x79'),_0x42f7('0x7a')]);if(_0x2b8ea2['body']['id']){delete _0x2b8ea2['body']['id'];}if(_[_0x42f7('0x7b')](_0x2b8ea2[_0x42f7('0x64')][_0x42f7('0x7c')])){throw new db['Sequelize'][(_0x42f7('0x7d'))]('from\x20is\x20mandatory');}if(_[_0x42f7('0x7b')](_0x2b8ea2['body'][_0x42f7('0x64')])||_0x2b8ea2[_0x42f7('0x64')][_0x42f7('0x64')]===''){throw new db['Sequelize'][(_0x42f7('0x7d'))](_0x42f7('0x7e'));}if(_[_0x42f7('0x7b')](_0x2b8ea2[_0x42f7('0x64')][_0x42f7('0x7f')])){throw new db[(_0x42f7('0x74'))][(_0x42f7('0x7d'))](_0x42f7('0x80')+_0x56c1c5);}if(!_[_0x42f7('0x81')](_0x56c1c5,_0x2b8ea2['body'][_0x42f7('0x7f')])){throw new db[(_0x42f7('0x74'))][(_0x42f7('0x7d'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x56c1c5);}_0x518ab8[_0x2b8ea2[_0x42f7('0x64')][_0x42f7('0x7f')]]=_0x2b8ea2[_0x42f7('0x64')][_0x42f7('0x7c')];})[_0x42f7('0x3a')](function(){return db[_0x42f7('0x40')][_0x42f7('0x65')]({'where':{'id':_0x2b8ea2[_0x42f7('0x66')]['id']},'include':[{'model':db[_0x42f7('0x82')],'as':_0x42f7('0x83'),'include':[{'model':db[_0x42f7('0x73')],'as':'Contacts','where':_0x518ab8,'limit':0x1,'order':[[_0x42f7('0x78'),_0x42f7('0x84')]]}]},{'model':db[_0x42f7('0x85')],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x3a3144,null))[_0x42f7('0x3a')](function(_0x4426e1){if(_0x4426e1&&_0x4426e1[_0x42f7('0x83')]){_0x1475e9[_0x42f7('0x86')]=_0x4426e1;_0x1475e9[_0x42f7('0x87')]=_0x4426e1['Applications'];_0x1475e9[_0x42f7('0x88')]=_0x4426e1[_0x42f7('0x83')];_0x1475e9[_0x42f7('0x87')]=_['orderBy'](_0x1475e9[_0x42f7('0x87')],[_0x42f7('0x89')],[_0x42f7('0x8a')]);if(_0x1475e9[_0x42f7('0x86')][_0x42f7('0x8b')]){delete _0x1475e9[_0x42f7('0x86')][_0x42f7('0x8b')];}if(_0x1475e9['account'][_0x42f7('0x83')]&&_0x1475e9[_0x42f7('0x86')][_0x42f7('0x83')]['Contacts'][_0x42f7('0x4a')]){return _0x1475e9[_0x42f7('0x86')]['List']['Contacts'][0x0];}var _0x534dcd=_[_0x42f7('0x1c')](_0x2b8ea2['body'],{'firstName':_0x2b8ea2[_0x42f7('0x64')][_0x42f7('0x7c')],'ListId':_0x4426e1[_0x42f7('0x7a')]});_0x534dcd[_0x2b8ea2[_0x42f7('0x64')][_0x42f7('0x7f')]]=_0x2b8ea2['body']['from'];return db[_0x42f7('0x73')][_0x42f7('0x5b')](_0x534dcd,{'fields':_0x59546e,'raw':!![]});}})[_0x42f7('0x3a')](handleEntityNotFound(_0x3a3144,null))['then'](function(_0x4b8360){_0x1475e9['contact']=_0x4b8360;if(_0x4b8360){var _0x1fd945={'ContactId':_0x4b8360['id'],'OpenchannelAccountId':_0x2b8ea2[_0x42f7('0x66')]['id'],'from':(_0x4b8360[_0x42f7('0x8c')]||'')+'\x20'+(_0x4b8360[_0x42f7('0x8d')]||'')};var _0x4339fc={'OpenchannelAccountId':_0x2b8ea2['params']['id'],'closed':![]};if(_0x2b8ea2[_0x42f7('0x64')]['threadId']){_0x4339fc[_0x42f7('0x8e')]=_0x2b8ea2[_0x42f7('0x64')][_0x42f7('0x8e')];return db['OpenchannelInteraction'][_0x42f7('0x65')]({'where':_0x4339fc})[_0x42f7('0x3a')](function(_0x202980){if(_0x202980){return[_0x202980,![]];}_0x1fd945[_0x42f7('0x8e')]=_0x2b8ea2[_0x42f7('0x64')][_0x42f7('0x8e')];_0x1fd945[_0x42f7('0x8f')]=_0x2b8ea2[_0x42f7('0x64')]['externalUrl'];return db[_0x42f7('0x90')]['create'](_0x1fd945)[_0x42f7('0x3a')](function(_0x1500d3){return[_0x1500d3,!![]];});});}else{_0x4339fc[_0x42f7('0x8e')]=null;}_0x4339fc[_0x42f7('0x91')]=_0x4b8360['id'];return db['OpenchannelInteraction']['find']({'where':_0x4339fc})[_0x42f7('0x3a')](function(_0xa13d6b){if(_0xa13d6b){return[_0xa13d6b,![]];}return db[_0x42f7('0x90')][_0x42f7('0x5b')](_0x1fd945)[_0x42f7('0x3a')](function(_0x3b3ca7){return[_0x3b3ca7,!![]];});});}})[_0x42f7('0x92')](function(_0xf033eb,_0x53c0f9){if(_0xf033eb){_0x197947=_0x53c0f9;if(!_0x53c0f9){var _0x2a5d2c={'from':(_0x1475e9[_0x42f7('0x93')][_0x42f7('0x8c')]||'')+'\x20'+(_0x1475e9['contact']['lastName']||'')};if(_0x2b8ea2[_0x42f7('0x64')][_0x42f7('0x8e')]&&_0x2b8ea2['body'][_0x42f7('0x94')]&&_0x2b8ea2[_0x42f7('0x64')]['threadId']!=_0x2b8ea2['body'][_0x42f7('0x94')]){_0x2a5d2c[_0x42f7('0x8e')]=_0x2b8ea2[_0x42f7('0x64')][_0x42f7('0x94')];}return _0xf033eb[_0x42f7('0x63')](_0x2a5d2c);}else{return _0xf033eb;}}})[_0x42f7('0x3a')](function(_0x41ab2f){_0x1475e9[_0x42f7('0x95')]=_0x41ab2f[_0x42f7('0x5e')]({'plain':!![]});_0x1475e9[_0x42f7('0x95')][_0x42f7('0x96')]=_0x197947;if(_0x1475e9[_0x42f7('0x95')][_0x42f7('0x96')]){if(_0x1475e9['account']['autoclose']){_0x1475e9[_0x42f7('0x87')][_0x42f7('0x97')]({'id':0x0,'priority':_0x1475e9[_0x42f7('0x87')]['length']+0x1,'app':_0x42f7('0x98'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0x42f7('0x99')][_0x42f7('0x5b')]({'body':_0x2b8ea2[_0x42f7('0x64')]['body'],'OpenchannelAccountId':_0x2b8ea2[_0x42f7('0x66')]['id'],'OpenchannelInteractionId':_0x41ab2f['id'],'direction':'in','ContactId':_0x1475e9[_0x42f7('0x93')]['id'],'AttachmentId':_0x2b8ea2[_0x42f7('0x64')][_0x42f7('0x9a')]});})[_0x42f7('0x3a')](function(_0x2e8fa1){_0x1475e9[_0x42f7('0x2b')]=_0x2e8fa1;if(!_0x1475e9[_0x42f7('0x95')][_0x42f7('0x9b')])return;return db[_0x42f7('0x9c')][_0x42f7('0x65')]({'attributes':['id',_0x42f7('0x3e')],'where':{'id':_0x1475e9[_0x42f7('0x95')][_0x42f7('0x9b')]}});})[_0x42f7('0x3a')](function(_0x3332ef){if(_0x3332ef){_0x1475e9[_0x42f7('0x87')]['unshift']({'id':0x0,'priority':0x0,'app':_0x42f7('0x9d'),'appdata':_0x3332ef[_0x42f7('0x3e')]+','+(_0x1475e9[_0x42f7('0x86')][_0x42f7('0x9e')]||0xa),'interval':'*,*,*,*'});}if(!_0x1475e9['interaction']['queueId'])return;return db[_0x42f7('0x9f')][_0x42f7('0x65')]({'attributes':['id','name'],'where':{'id':_0x1475e9[_0x42f7('0x95')][_0x42f7('0xa0')]}});})[_0x42f7('0x3a')](function(_0x2c3c7c){if(_0x2c3c7c){_0x1475e9[_0x42f7('0x87')]['unshift']({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x2c3c7c[_0x42f7('0x3e')]+','+(_0x1475e9['account'][_0x42f7('0xa1')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x42f7('0xa2'),_0x42f7('0xa3'),_0x1475e9);})[_0x42f7('0x3a')](function(_0x171de4){respondWithRpcPromise('EventManager',_0x42f7('0xa4'),{'event':_0x42f7('0x71'),'message':_0x171de4},client9002);return _0x171de4;})[_0x42f7('0x3a')](respondWithResult(_0x3a3144,null))[_0x42f7('0x2d')](handleError(_0x3a3144,null));};exports[_0x42f7('0xa5')]=function(_0x56f5cd,_0x3cb9bc){var _0x32c99d=_0x56f5cd[_0x42f7('0x66')]['id'];var _0x5eeeb4=_0x56f5cd['body'];var _0x5498be=0xc8;var _0x5b31c4=null;return db[_0x42f7('0xa6')][_0x42f7('0xa7')]({'isolationLevel':db[_0x42f7('0xa6')][_0x42f7('0xa8')][_0x42f7('0xa9')][_0x42f7('0xaa')]},function(_0x16ec39){return db[_0x42f7('0x40')]['findOne']({'where':{'id':_0x32c99d},'transaction':_0x16ec39})[_0x42f7('0x3a')](function(_0x1d35c1){if(_0x1d35c1){return db[_0x42f7('0x85')][_0x42f7('0x3b')]({'where':{'OpenchannelAccountId':_0x32c99d},'transaction':_0x16ec39})['then'](function(){var _0x22037c=_['map'](_0x5eeeb4,function(_0x25490b){_0x25490b[_0x42f7('0x68')]=_0x32c99d;return _0x25490b;});return db['OpenchannelApplication'][_0x42f7('0xab')](_0x22037c,{'transaction':_0x16ec39});});}else{_0x5498be=0x194;_0x5b31c4=[];}});})[_0x42f7('0x3a')](function(){if(_0x5498be!==0x194){return db[_0x42f7('0x85')][_0x42f7('0xac')]({'where':{'OpenchannelAccountId':_0x32c99d},'order':_0x42f7('0x89')})[_0x42f7('0x3a')](function(_0x559155){_0x5b31c4=_0x559155;});}})[_0x42f7('0x2d')](function(_0x3eb494){_0x5498be=0x1f4;logger[_0x42f7('0x2a')](_0x3eb494['stack']);if(_0x3eb494[_0x42f7('0x3e')]){delete _0x3eb494[_0x42f7('0x3e')];}_0x5b31c4=_0x3eb494;})['finally'](function(){if(_0x5b31c4===null){_0x3cb9bc[_0x42f7('0x2e')](_0x5498be);}else{if(_0x5498be===0x1f4){_0x3cb9bc['status'](_0x5498be)['send'](_0x5b31c4);}else{_0x3cb9bc['status'](_0x5498be)[_0x42f7('0x37')](_0x5b31c4);}}});};exports['getApplications']=function(_0x309431,_0x54e689,_0x1d2d7d){var _0x58451a={};var _0x474053={};var _0x2a1b51;var _0x4858a6;return db[_0x42f7('0x40')][_0x42f7('0x70')]({'where':{'id':_0x309431[_0x42f7('0x66')]['id']}})[_0x42f7('0x3a')](handleEntityNotFound(_0x54e689,null))[_0x42f7('0x3a')](function(_0x57fd76){if(_0x57fd76){_0x2a1b51=_0x57fd76;_0x474053[_0x42f7('0x43')]=_[_0x42f7('0x45')](db['OpenchannelApplication'][_0x42f7('0x41')]);_0x474053['query']=_[_0x42f7('0x45')](_0x309431['query']);_0x474053[_0x42f7('0x5a')]=_[_0x42f7('0x47')](_0x474053[_0x42f7('0x43')],_0x474053['query']);_0x58451a[_0x42f7('0x49')]=_[_0x42f7('0x47')](_0x474053[_0x42f7('0x43')],qs['fields'](_0x309431['query'][_0x42f7('0x48')]));_0x58451a['attributes']=_0x58451a[_0x42f7('0x49')][_0x42f7('0x4a')]?_0x58451a[_0x42f7('0x49')]:_0x474053[_0x42f7('0x43')];_0x58451a['order']=qs['sort'](_0x309431['query'][_0x42f7('0x4d')]);_0x58451a[_0x42f7('0x50')]=qs[_0x42f7('0x5a')](_[_0x42f7('0x4e')](_0x309431[_0x42f7('0x46')],_0x474053[_0x42f7('0x5a')]));if(_0x309431[_0x42f7('0x46')][_0x42f7('0x4f')]){_0x58451a[_0x42f7('0x50')]=_['merge'](_0x58451a['where'],{'$or':_[_0x42f7('0x44')](_0x58451a['attributes'],function(_0x3eb636){var _0x37bad3={};_0x37bad3[_0x3eb636]={'$like':'%'+_0x309431[_0x42f7('0x46')]['filter']+'%'};return _0x37bad3;})});}_0x58451a=_[_0x42f7('0x51')]({},_0x58451a,_0x309431[_0x42f7('0x53')]);return _0x2a1b51[_0x42f7('0xad')](_0x58451a);}})[_0x42f7('0x3a')](function(_0x5bd44d){if(_0x5bd44d){_0x4858a6=_0x5bd44d[_0x42f7('0x4a')];if(!_0x309431[_0x42f7('0x46')][_0x42f7('0x6a')](_0x42f7('0x4b'))){_0x58451a[_0x42f7('0x34')]=qs[_0x42f7('0x34')](_0x309431[_0x42f7('0x46')][_0x42f7('0x34')]);_0x58451a[_0x42f7('0x31')]=qs['offset'](_0x309431[_0x42f7('0x46')]['offset']);}return _0x2a1b51[_0x42f7('0xad')](_0x58451a);}})[_0x42f7('0x3a')](function(_0x4dd19b){if(_0x4dd19b){return _0x4dd19b?{'count':_0x4858a6,'rows':_0x4dd19b}:null;}})[_0x42f7('0x3a')](respondWithResult(_0x54e689,null))[_0x42f7('0x2d')](handleError(_0x54e689,null));};exports[_0x42f7('0xae')]=function(_0x579c46,_0x357183,_0xed6746){var _0xfdf09c={'raw':![],'where':{}};var _0x175d1c={};var _0x4f0c5c={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x42f7('0x70')]({'where':{'id':_0x579c46[_0x42f7('0x66')]['id']}})[_0x42f7('0x3a')](handleEntityNotFound(_0x357183,null))[_0x42f7('0x3a')](function(_0x3c203d){if(_0x3c203d){_0x175d1c[_0x42f7('0x43')]=_[_0x42f7('0x45')](db[_0x42f7('0x90')][_0x42f7('0x41')]);_0x175d1c[_0x42f7('0x46')]=_['keys'](_0x579c46[_0x42f7('0x46')]);_0x175d1c[_0x42f7('0x5a')]=_[_0x42f7('0x47')](_0x175d1c[_0x42f7('0x43')],_0x175d1c[_0x42f7('0x46')]);_0xfdf09c[_0x42f7('0x49')]=_[_0x42f7('0x47')](_0x175d1c[_0x42f7('0x43')],qs[_0x42f7('0x48')](_0x579c46[_0x42f7('0x46')][_0x42f7('0x48')]));_0xfdf09c[_0x42f7('0x49')]=_0xfdf09c[_0x42f7('0x49')][_0x42f7('0x4a')]?_0xfdf09c[_0x42f7('0x49')]:_0x175d1c[_0x42f7('0x43')];if(!_0x579c46[_0x42f7('0x46')][_0x42f7('0x6a')](_0x42f7('0x4b'))){_0xfdf09c['limit']=qs[_0x42f7('0x34')](_0x579c46[_0x42f7('0x46')][_0x42f7('0x34')]);_0xfdf09c[_0x42f7('0x31')]=qs[_0x42f7('0x31')](_0x579c46[_0x42f7('0x46')][_0x42f7('0x31')]);}_0xfdf09c['order']=qs[_0x42f7('0x4d')](_0x579c46[_0x42f7('0x46')]['sort']);_0xfdf09c['where']=qs[_0x42f7('0x5a')](_['pick'](_0x579c46[_0x42f7('0x46')],_0x175d1c['filters']));_0xfdf09c[_0x42f7('0x50')][_0x42f7('0x68')]=_0x3c203d['id'];if(_0x579c46[_0x42f7('0x46')][_0x42f7('0x4f')]){_0xfdf09c[_0x42f7('0x50')]=_[_0x42f7('0x51')](_0xfdf09c[_0x42f7('0x50')],{'$or':_['map'](_0xfdf09c['attributes'],function(_0x117ee4){var _0x2198a2={};_0x2198a2[_0x117ee4]={'$like':'%'+_0x579c46[_0x42f7('0x46')][_0x42f7('0x4f')]+'%'};return _0x2198a2;})});}_0xfdf09c=_['merge']({},_0xfdf09c,_0x579c46[_0x42f7('0x53')]);return db[_0x42f7('0x90')]['count']({'where':_0xfdf09c[_0x42f7('0x50')]})[_0x42f7('0x3a')](function(_0x43c310){_0x4f0c5c[_0x42f7('0x33')]=_0x43c310;if(_0x579c46[_0x42f7('0x46')][_0x42f7('0x54')]){_0xfdf09c[_0x42f7('0x55')]=[{'model':db['CmContact'],'as':_0x42f7('0xaf'),'required':![]},{'model':db[_0x42f7('0x9c')],'as':_0x42f7('0xb0'),'attributes':[_0x42f7('0x3e'),_0x42f7('0xb1'),_0x42f7('0xb2')],'required':![]},{'model':db[_0x42f7('0xb3')],'as':_0x42f7('0xb4'),'attributes':['id',_0x42f7('0x3e'),_0x42f7('0xb5')],'where':_0x579c46[_0x42f7('0x46')]['tag']?{'id':_0x579c46[_0x42f7('0x46')][_0x42f7('0xb6')]}:undefined,'required':_0x579c46[_0x42f7('0x46')][_0x42f7('0xb6')]?!![]:![]}];}return db[_0x42f7('0x90')]['findAll'](_0xfdf09c);})[_0x42f7('0x3a')](function(_0x85c766){_0x4f0c5c[_0x42f7('0x57')]=_0x85c766;return _0x4f0c5c;});}})[_0x42f7('0x3a')](respondWithFilteredResult(_0x357183,_0xfdf09c))[_0x42f7('0x2d')](handleError(_0x357183,null));};exports['addAgents']=function(_0x4de73c,_0x4e919d,_0x4c5f76){return db['OpenchannelAccount']['find']({'where':{'id':_0x4de73c[_0x42f7('0x66')]['id']}})['then'](handleEntityNotFound(_0x4e919d,null))[_0x42f7('0x3a')](function(_0x2f3d0c){if(_0x2f3d0c){return _0x2f3d0c['addAgents'](_0x4de73c[_0x42f7('0x64')][_0x42f7('0x6c')],_[_0x42f7('0xb7')](_0x4de73c[_0x42f7('0x64')],[_0x42f7('0x6c'),'id'])||{})[_0x42f7('0x92')](function(_0x1b7063){for(var _0x526b64=0x0;_0x526b64<_0x4de73c['body'][_0x42f7('0x6c')][_0x42f7('0x4a')];_0x526b64+=0x1){socket[_0x42f7('0xb8')]('userOpenchannelAccount:save',{'UserId':Number(_0x4de73c[_0x42f7('0x64')][_0x42f7('0x6c')][_0x526b64]),'OpenchannelAccountId':Number(_0x4de73c['params']['id'])});}return _0x1b7063;});}})[_0x42f7('0x3a')](respondWithResult(_0x4e919d,null))[_0x42f7('0x2d')](handleError(_0x4e919d,null));};exports[_0x42f7('0xb9')]=function(_0x4426da,_0x2880eb,_0x22d8e9){return db['OpenchannelAccount']['find']({'where':{'id':_0x4426da[_0x42f7('0x66')]['id']}})[_0x42f7('0x3a')](handleEntityNotFound(_0x2880eb,null))[_0x42f7('0x3a')](function(_0x2c5605){if(_0x2c5605){return _0x2c5605[_0x42f7('0xb9')](_0x4426da[_0x42f7('0x46')][_0x42f7('0x6c')])['then'](function(){if(_[_0x42f7('0xba')](_0x4426da[_0x42f7('0x46')][_0x42f7('0x6c')])){for(var _0x4964e5=0x0;_0x4964e5<_0x4426da[_0x42f7('0x46')][_0x42f7('0x6c')][_0x42f7('0x4a')];_0x4964e5+=0x1){socket['emit']('userOpenchannelAccount:remove',{'UserId':Number(_0x4426da['query'][_0x42f7('0x6c')][_0x4964e5]),'OpenchannelAccountId':Number(_0x4426da[_0x42f7('0x66')]['id'])});}}else{socket['emit'](_0x42f7('0xbb'),{'UserId':Number(_0x4426da[_0x42f7('0x46')][_0x42f7('0x6c')]),'OpenchannelAccountId':Number(_0x4426da[_0x42f7('0x66')]['id'])});}});}})[_0x42f7('0x3a')](respondWithStatusCode(_0x2880eb,null))[_0x42f7('0x2d')](handleError(_0x2880eb,null));};exports['getAgents']=function(_0x407f27,_0x42ebf1,_0xfb9ee1){var _0x29ca7c={};var _0x464292={};var _0x42bb71;var _0x183813;return db[_0x42f7('0x40')][_0x42f7('0x70')]({'where':{'id':_0x407f27[_0x42f7('0x66')]['id']}})[_0x42f7('0x3a')](handleEntityNotFound(_0x42ebf1,null))[_0x42f7('0x3a')](function(_0x39baab){if(_0x39baab){_0x42bb71=_0x39baab;_0x464292[_0x42f7('0x43')]=_[_0x42f7('0x45')](db[_0x42f7('0x9c')]['rawAttributes']);_0x464292[_0x42f7('0x46')]=_[_0x42f7('0x45')](_0x407f27[_0x42f7('0x46')]);_0x464292[_0x42f7('0x5a')]=_[_0x42f7('0x47')](_0x464292[_0x42f7('0x43')],_0x464292[_0x42f7('0x46')]);_0x29ca7c['attributes']=_[_0x42f7('0x47')](_0x464292[_0x42f7('0x43')],qs['fields'](_0x407f27[_0x42f7('0x46')][_0x42f7('0x48')]));_0x29ca7c[_0x42f7('0x49')]=_0x29ca7c[_0x42f7('0x49')][_0x42f7('0x4a')]?_0x29ca7c[_0x42f7('0x49')]:_0x464292['model'];_0x29ca7c[_0x42f7('0x4c')]=qs[_0x42f7('0x4d')](_0x407f27[_0x42f7('0x46')][_0x42f7('0x4d')]);_0x29ca7c[_0x42f7('0x50')]=qs['filters'](_[_0x42f7('0x4e')](_0x407f27['query'],_0x464292[_0x42f7('0x5a')]));if(_0x407f27[_0x42f7('0x46')]['filter']){_0x29ca7c[_0x42f7('0x50')]=_[_0x42f7('0x51')](_0x29ca7c[_0x42f7('0x50')],{'$or':_[_0x42f7('0x44')](_0x29ca7c[_0x42f7('0x49')],function(_0x5ba5bd){var _0x5316c6={};_0x5316c6[_0x5ba5bd]={'$like':'%'+_0x407f27[_0x42f7('0x46')]['filter']+'%'};return _0x5316c6;})});}_0x29ca7c=_[_0x42f7('0x51')]({},_0x29ca7c,_0x407f27[_0x42f7('0x53')]);return _0x42bb71['getAgents'](_0x29ca7c);}})['then'](function(_0x24949f){if(_0x24949f){_0x183813=_0x24949f['length'];if(!_0x407f27['query'][_0x42f7('0x6a')](_0x42f7('0x4b'))){_0x29ca7c[_0x42f7('0x34')]=qs[_0x42f7('0x34')](_0x407f27['query']['limit']);_0x29ca7c[_0x42f7('0x31')]=qs[_0x42f7('0x31')](_0x407f27['query'][_0x42f7('0x31')]);}return _0x42bb71['getAgents'](_0x29ca7c);}})['then'](function(_0x540ccc){if(_0x540ccc){return _0x540ccc?{'count':_0x183813,'rows':_0x540ccc}:null;}})[_0x42f7('0x3a')](respondWithResult(_0x42ebf1,null))[_0x42f7('0x2d')](handleError(_0x42ebf1,null));};exports[_0x42f7('0xbc')]=function(_0x3a7a99,_0x1a7e0c,_0x1a4a4c){var _0x5c24df,_0x3a316a,_0x280989;if(_['isNil'](_0x3a7a99[_0x42f7('0x64')][_0x42f7('0x64')])||_0x3a7a99['body']['body']===''){throw new db['Sequelize'][(_0x42f7('0x7d'))](_0x42f7('0x7e'));}if(_['isNil'](_0x3a7a99['body']['to'])){}_0x5c24df=_0x3a7a99[_0x42f7('0x64')]['to'];return db['OpenchannelAccount'][_0x42f7('0x70')]({'where':{'id':_0x3a7a99['params']['id']}})[_0x42f7('0x3a')](handleEntityNotFound(_0x1a7e0c,null))[_0x42f7('0x3a')](function(_0xf9a55e){if(_0xf9a55e){return db[_0x42f7('0x40')]['find']({'where':{'id':_0xf9a55e['id']},'include':[{'model':db[_0x42f7('0x82')],'as':_0x42f7('0x83'),'include':[{'model':db[_0x42f7('0x73')],'as':_0x42f7('0xbd'),'where':{[_0xf9a55e['mapKey']]:_0x5c24df},'limit':0x1,'order':[[_0x42f7('0x78'),_0x42f7('0x84')]]}]}]})['then'](handleEntityNotFound(_0x1a7e0c,null))['then'](function(_0x1d80d4){if(_0x1d80d4&&_0x1d80d4[_0x42f7('0x83')]){_0x3a316a=_0x1d80d4[_0x42f7('0x5e')]({'plain':!![]});if(_0x3a316a[_0x42f7('0x83')]&&_0x3a316a[_0x42f7('0x83')][_0x42f7('0xbd')][_0x42f7('0x4a')]){return _0x3a316a[_0x42f7('0x83')][_0x42f7('0xbd')][0x0];}return db[_0x42f7('0x73')][_0x42f7('0x5b')](_['defaults'](_0x3a7a99[_0x42f7('0x64')],{'firstName':_0x5c24df,[_0x1d80d4[_0x42f7('0x7f')]]:_0x5c24df,'phone':_0x5c24df,'ListId':_0x3a316a['ListId']}));}})[_0x42f7('0x3a')](handleEntityNotFound(_0x1a7e0c,null))[_0x42f7('0x3a')](function(_0x763032){if(_0x763032){_0x280989=_0x763032;return db[_0x42f7('0x90')][_0x42f7('0x65')]({'where':{'ContactId':_0x280989['id'],'closed':![],'OpenchannelAccountId':_0x3a316a['id']}})[_0x42f7('0x3a')](function(_0x2ded65){if(_0x2ded65){return[_0x2ded65,![]];}return db[_0x42f7('0x90')][_0x42f7('0x5b')]({'UserId':_0x3a7a99[_0x42f7('0xbe')]['id'],'ContactId':_0x280989['id'],'OpenchannelAccountId':_0x3a316a['id'],'lastMsgDirection':_0x42f7('0xbf'),'firstMsgDirection':_0x42f7('0xbf'),'Messages':[_[_0x42f7('0x51')](_0x3a7a99[_0x42f7('0x64')],{'read':![],'body':_0x3a7a99['body']['body'],'OpenchannelAccountId':_0x3a316a['id'],'UserId':_0x3a7a99[_0x42f7('0xbe')]['id'],'ContactId':_0x280989['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':'Messages'}]})['then'](function(_0x13aac2){return[_0x13aac2,!![]];});});}})[_0x42f7('0x92')](function(_0x183b4d,_0x12923f){if(_0x12923f){return _0x183b4d;}return db[_0x42f7('0x99')][_0x42f7('0x5b')](_[_0x42f7('0x51')](_0x3a7a99[_0x42f7('0x64')],{'read':![],'body':_0x3a7a99['body'][_0x42f7('0x64')],'OpenchannelAccountId':_0x3a316a['id'],'OpenchannelInteractionId':_0x183b4d['id'],'UserId':_0x3a7a99['user']['id'],'ContactId':_0x280989['id']}))[_0x42f7('0x3a')](function(_0x3f3405){_0x183b4d[_0x42f7('0xc0')][_0x42f7('0xc1')]=[];_0x183b4d[_0x42f7('0xc0')][_0x42f7('0xc1')][_0x42f7('0x97')](_0x3f3405[_0x42f7('0xc0')]);return _0x183b4d;});});}})['then'](respondWithResult(_0x1a7e0c,null))[_0x42f7('0x2d')](handleError(_0x1a7e0c,null));}; \ No newline at end of file +var _0x7f05=['Transaction','ISOLATION_LEVELS','READ_COMMITTED','OpenchannelApplication','bulkCreate','findAndCountAll','priority','stack','finally','getApplications','getInteractions','Contact','User','Owner','fullname','internal','Tag','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','CmList','defaults','out','Messages','dataValues','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','redis','localhost','socket.io-emitter','jayson/promise','client','http','then','info','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','get','OpenchannelAccounts','UserProfileResource','destroy','end','sendStatus','name','send','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','OpenchannelAccount','includeAll','include','findAll','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','Disposition','getDispositions','findOne','order','OpenchannelAccountId','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','DESC','Applications','account','list','applications','firstName','threadId','OpenchannelInteraction','spread','contact','lastName','messageId','interaction','autoclose','push','close','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','queueId','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','addApplications','transaction','sequelize'];(function(_0x499826,_0xc37e60){var _0x23da09=function(_0x46bb64){while(--_0x46bb64){_0x499826['push'](_0x499826['shift']());}};_0x23da09(++_0xc37e60);}(_0x7f05,0xdc));var _0x57f0=function(_0x501192,_0x20aff9){_0x501192=_0x501192-0x0;var _0x563ed4=_0x7f05[_0x501192];return _0x563ed4;};'use strict';var emlformat=require(_0x57f0('0x0'));var rimraf=require(_0x57f0('0x1'));var zipdir=require(_0x57f0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x57f0('0x3'));var moment=require('moment');var BPromise=require(_0x57f0('0x4'));var Mustache=require(_0x57f0('0x5'));var util=require('util');var path=require(_0x57f0('0x6'));var sox=require(_0x57f0('0x7'));var csv=require('to-csv');var ejs=require(_0x57f0('0x8'));var fs=require('fs');var fs_extra=require(_0x57f0('0x9'));var _=require('lodash');var squel=require(_0x57f0('0xa'));var crypto=require(_0x57f0('0xb'));var jsforce=require(_0x57f0('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x57f0('0xd'));var Papa=require('papaparse');var Redis=require(_0x57f0('0xe'));var authService=require(_0x57f0('0xf'));var qs=require(_0x57f0('0x10'));var as=require(_0x57f0('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x57f0('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x57f0('0x13')],{'host':_0x57f0('0x14'),'port':0x18eb});var socket=require(_0x57f0('0x15'))(new Redis(config[_0x57f0('0x13')]));require('./openchannelAccount.socket')['register'](socket);var jayson=require(_0x57f0('0x16'));var client=jayson[_0x57f0('0x17')][_0x57f0('0x18')]({'port':0x232c});var client9002=jayson[_0x57f0('0x17')][_0x57f0('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x2130ca,_0x555e18,_0x51dac4,_0x40a925){return new BPromise(function(_0x5be425,_0x56b342){var _0x48eadd=_0x40a925||client;return _0x48eadd['request'](_0x2130ca,_0x51dac4)[_0x57f0('0x19')](function(_0x2a382e){logger[_0x57f0('0x1a')]('OpenchannelAccount,\x20%s,\x20%s',_0x555e18,_0x57f0('0x1b'));logger[_0x57f0('0x1c')](_0x57f0('0x1d'),_0x555e18,'request\x20sent',JSON[_0x57f0('0x1e')](_0x2a382e));if(_0x2a382e[_0x57f0('0x1f')]){if(_0x2a382e['error']['code']===0x1f4){logger[_0x57f0('0x1f')](_0x57f0('0x20'),_0x555e18,_0x2a382e['error'][_0x57f0('0x21')]);return _0x56b342(_0x2a382e['error'][_0x57f0('0x21')]);}logger[_0x57f0('0x1f')](_0x57f0('0x20'),_0x555e18,_0x2a382e[_0x57f0('0x1f')]['message']);return _0x5be425(_0x2a382e['error'][_0x57f0('0x21')]);}else{logger['info'](_0x57f0('0x20'),_0x555e18,_0x57f0('0x1b'));_0x5be425(_0x2a382e[_0x57f0('0x22')][_0x57f0('0x21')]);}})[_0x57f0('0x23')](function(_0x1c2cae){logger[_0x57f0('0x1f')](_0x57f0('0x20'),_0x555e18,_0x1c2cae);_0x56b342(_0x1c2cae);});});}function respondWithStatusCode(_0x5a079e,_0x44a353){_0x44a353=_0x44a353||0xcc;return function(_0x5a176f){if(_0x5a176f){return _0x5a079e['sendStatus'](_0x44a353);}return _0x5a079e[_0x57f0('0x24')](_0x44a353)['end']();};}function respondWithResult(_0x407829,_0x50347e){_0x50347e=_0x50347e||0xc8;return function(_0x4f85b7){if(_0x4f85b7){return _0x407829[_0x57f0('0x24')](_0x50347e)[_0x57f0('0x25')](_0x4f85b7);}};}function respondWithFilteredResult(_0x16c711,_0x3ac9d3){return function(_0x1858ea){if(_0x1858ea){var _0x114b1d=typeof _0x3ac9d3[_0x57f0('0x26')]===_0x57f0('0x27')&&typeof _0x3ac9d3[_0x57f0('0x28')]===_0x57f0('0x27');var _0x5c7095=_0x1858ea[_0x57f0('0x29')];var _0x390400=_0x114b1d?0x0:_0x3ac9d3[_0x57f0('0x26')];var _0xa224e0=_0x114b1d?_0x1858ea[_0x57f0('0x29')]:_0x3ac9d3[_0x57f0('0x26')]+_0x3ac9d3[_0x57f0('0x28')];var _0x40c45a;if(_0xa224e0>=_0x5c7095){_0xa224e0=_0x5c7095;_0x40c45a=0xc8;}else{_0x40c45a=0xce;}_0x16c711[_0x57f0('0x24')](_0x40c45a);return _0x16c711[_0x57f0('0x2a')](_0x57f0('0x2b'),_0x390400+'-'+_0xa224e0+'/'+_0x5c7095)[_0x57f0('0x25')](_0x1858ea);}return null;};}function patchUpdates(_0x12fb54){return function(_0x3a8e5f){try{jsonpatch['apply'](_0x3a8e5f,_0x12fb54,!![]);}catch(_0x21a1c2){return BPromise[_0x57f0('0x2c')](_0x21a1c2);}return _0x3a8e5f[_0x57f0('0x2d')]();};}function saveUpdates(_0x3751d7,_0x5cf226){return function(_0x562247){if(_0x562247){return _0x562247['update'](_0x3751d7)[_0x57f0('0x19')](function(_0x4c0876){return _0x4c0876;});}return null;};}function removeEntity(_0xc88d03,_0x29587a){return function(_0x2f3f1b){if(_0x2f3f1b){return _0x2f3f1b['destroy']()[_0x57f0('0x19')](function(){var _0x277edf=_0x2f3f1b[_0x57f0('0x2e')]({'plain':!![]});var _0x302301=_0x57f0('0x2f');return db[_0x57f0('0x30')][_0x57f0('0x31')]({'where':{'type':_0x302301,'resourceId':_0x277edf['id']}})[_0x57f0('0x19')](function(){return _0x2f3f1b;});})[_0x57f0('0x19')](function(){_0xc88d03[_0x57f0('0x24')](0xcc)[_0x57f0('0x32')]();});}};}function handleEntityNotFound(_0x13f4ed,_0xd8f0ca){return function(_0x854d35){if(!_0x854d35){_0x13f4ed[_0x57f0('0x33')](0x194);}return _0x854d35;};}function handleError(_0x1c5345,_0x1769de){_0x1769de=_0x1769de||0x1f4;return function(_0x3ec2ad){logger[_0x57f0('0x1f')](_0x3ec2ad['stack']);if(_0x3ec2ad['name']){delete _0x3ec2ad[_0x57f0('0x34')];}_0x1c5345[_0x57f0('0x24')](_0x1769de)[_0x57f0('0x35')](_0x3ec2ad);};}exports['index']=function(_0x23d181,_0x294756){var _0x3c40d1={'include':[{'model':db[_0x57f0('0x36')],'as':_0x57f0('0x37')}]},_0x1f4f7d={},_0x15d4ea={'count':0x0,'rows':[]};var _0x2cf365=_[_0x57f0('0x38')](db['OpenchannelAccount'][_0x57f0('0x39')],function(_0x2d7388){return{'name':_0x2d7388[_0x57f0('0x3a')],'type':_0x2d7388[_0x57f0('0x3b')]['key']};});_0x1f4f7d[_0x57f0('0x3c')]=_[_0x57f0('0x38')](_0x2cf365,'name');_0x1f4f7d[_0x57f0('0x3d')]=_[_0x57f0('0x3e')](_0x23d181[_0x57f0('0x3d')]);_0x1f4f7d[_0x57f0('0x3f')]=_[_0x57f0('0x40')](_0x1f4f7d[_0x57f0('0x3c')],_0x1f4f7d[_0x57f0('0x3d')]);_0x3c40d1['attributes']=_[_0x57f0('0x40')](_0x1f4f7d['model'],qs[_0x57f0('0x41')](_0x23d181['query'][_0x57f0('0x41')]));_0x3c40d1[_0x57f0('0x42')]=_0x3c40d1[_0x57f0('0x42')][_0x57f0('0x43')]?_0x3c40d1[_0x57f0('0x42')]:_0x1f4f7d[_0x57f0('0x3c')];if(!_0x23d181[_0x57f0('0x3d')][_0x57f0('0x44')](_0x57f0('0x45'))){_0x3c40d1[_0x57f0('0x28')]=qs[_0x57f0('0x28')](_0x23d181['query'][_0x57f0('0x28')]);_0x3c40d1[_0x57f0('0x26')]=qs['offset'](_0x23d181['query'][_0x57f0('0x26')]);}_0x3c40d1['order']=qs[_0x57f0('0x46')](_0x23d181[_0x57f0('0x3d')][_0x57f0('0x46')]);_0x3c40d1['where']=qs[_0x57f0('0x3f')](_[_0x57f0('0x47')](_0x23d181['query'],_0x1f4f7d[_0x57f0('0x3f')]),_0x2cf365);if(_0x23d181[_0x57f0('0x3d')][_0x57f0('0x48')]){_0x3c40d1[_0x57f0('0x49')]=_[_0x57f0('0x4a')](_0x3c40d1[_0x57f0('0x49')],{'$or':_['map'](_0x2cf365,function(_0x262199){if(_0x262199[_0x57f0('0x3b')]!=='VIRTUAL'){var _0x2c957a={};_0x2c957a[_0x262199['name']]={'$like':'%'+_0x23d181[_0x57f0('0x3d')]['filter']+'%'};return _0x2c957a;}})});}_0x3c40d1=_[_0x57f0('0x4a')]({},_0x3c40d1,_0x23d181['options']);var _0x4c6eb1={'where':_0x3c40d1[_0x57f0('0x49')]};return db[_0x57f0('0x4b')][_0x57f0('0x29')](_0x4c6eb1)['then'](function(_0x238983){_0x15d4ea[_0x57f0('0x29')]=_0x238983;if(_0x23d181[_0x57f0('0x3d')][_0x57f0('0x4c')]){_0x3c40d1[_0x57f0('0x4d')]=[{'all':!![]}];}return db[_0x57f0('0x4b')][_0x57f0('0x4e')](_0x3c40d1);})[_0x57f0('0x19')](function(_0x7f6cf5){_0x15d4ea['rows']=_0x7f6cf5;return _0x15d4ea;})[_0x57f0('0x19')](respondWithFilteredResult(_0x294756,_0x3c40d1))[_0x57f0('0x23')](handleError(_0x294756,null));};exports['show']=function(_0x3c60de,_0x3e891e){var _0x5ee6dd={'raw':![],'where':{'id':_0x3c60de[_0x57f0('0x4f')]['id']},'include':[{'model':db[_0x57f0('0x36')],'as':'mandatoryDispositionPause'}]},_0x58ca0d={};_0x58ca0d['model']=_['keys'](db[_0x57f0('0x4b')][_0x57f0('0x39')]);_0x58ca0d['query']=_[_0x57f0('0x3e')](_0x3c60de['query']);_0x58ca0d[_0x57f0('0x3f')]=_[_0x57f0('0x40')](_0x58ca0d['model'],_0x58ca0d[_0x57f0('0x3d')]);_0x5ee6dd[_0x57f0('0x42')]=_['intersection'](_0x58ca0d[_0x57f0('0x3c')],qs[_0x57f0('0x41')](_0x3c60de['query'][_0x57f0('0x41')]));_0x5ee6dd[_0x57f0('0x42')]=_0x5ee6dd[_0x57f0('0x42')]['length']?_0x5ee6dd[_0x57f0('0x42')]:_0x58ca0d[_0x57f0('0x3c')];if(_0x3c60de[_0x57f0('0x3d')]['includeAll']){_0x5ee6dd[_0x57f0('0x4d')]=[{'all':!![]}];}_0x5ee6dd=_[_0x57f0('0x4a')]({},_0x5ee6dd,_0x3c60de[_0x57f0('0x50')]);return db[_0x57f0('0x4b')][_0x57f0('0x51')](_0x5ee6dd)[_0x57f0('0x19')](handleEntityNotFound(_0x3e891e,null))[_0x57f0('0x19')](respondWithResult(_0x3e891e,null))[_0x57f0('0x23')](handleError(_0x3e891e,null));};exports[_0x57f0('0x52')]=function(_0x4af55b,_0x1f0d2c){return db[_0x57f0('0x4b')][_0x57f0('0x52')](_0x4af55b[_0x57f0('0x53')],{})[_0x57f0('0x19')](function(_0x1ee690){var _0x53406d=_0x4af55b[_0x57f0('0x54')][_0x57f0('0x2e')]({'plain':!![]});if(!_0x53406d)throw new Error(_0x57f0('0x55'));if(_0x53406d['role']===_0x57f0('0x54')){var _0x1b59a2=_0x1ee690[_0x57f0('0x2e')]({'plain':!![]});var _0x35e315=_0x57f0('0x2f');return db[_0x57f0('0x56')][_0x57f0('0x51')]({'where':{'name':_0x35e315,'userProfileId':_0x53406d[_0x57f0('0x57')]},'raw':!![]})[_0x57f0('0x19')](function(_0x3074d4){if(_0x3074d4&&_0x3074d4[_0x57f0('0x58')]===0x0){return db[_0x57f0('0x30')][_0x57f0('0x52')]({'name':_0x1b59a2[_0x57f0('0x34')],'resourceId':_0x1b59a2['id'],'type':_0x3074d4[_0x57f0('0x34')],'sectionId':_0x3074d4['id']},{})[_0x57f0('0x19')](function(){return _0x1ee690;});}else{return _0x1ee690;}})[_0x57f0('0x23')](function(_0x649599){logger[_0x57f0('0x1f')](_0x57f0('0x59'),_0x649599);throw _0x649599;});}return _0x1ee690;})['then'](respondWithResult(_0x1f0d2c,0xc9))[_0x57f0('0x23')](handleError(_0x1f0d2c,null));};exports[_0x57f0('0x5a')]=function(_0x510542,_0x1a6787){if(_0x510542[_0x57f0('0x53')]['id']){delete _0x510542['body']['id'];}return db['OpenchannelAccount'][_0x57f0('0x51')]({'where':{'id':_0x510542[_0x57f0('0x4f')]['id']},'include':[{'model':db[_0x57f0('0x36')],'as':'mandatoryDispositionPause'}]})[_0x57f0('0x19')](handleEntityNotFound(_0x1a6787,null))[_0x57f0('0x19')](saveUpdates(_0x510542['body'],null))['then'](respondWithResult(_0x1a6787,null))[_0x57f0('0x23')](handleError(_0x1a6787,null));};exports[_0x57f0('0x31')]=function(_0x5aff07,_0x409ebe){return db[_0x57f0('0x4b')][_0x57f0('0x51')]({'where':{'id':_0x5aff07[_0x57f0('0x4f')]['id']}})[_0x57f0('0x19')](handleEntityNotFound(_0x409ebe,null))[_0x57f0('0x19')](removeEntity(_0x409ebe,null))[_0x57f0('0x23')](handleError(_0x409ebe,null));};exports[_0x57f0('0x5b')]=function(_0x7825d7,_0x13745e){return db['OpenchannelAccount']['describe']()['then'](respondWithResult(_0x13745e,null))[_0x57f0('0x23')](handleError(_0x13745e,null));};exports['addDisposition']=function(_0x5cbcf3,_0x117f8b,_0x30ac3e){if(_0x5cbcf3[_0x57f0('0x53')]['id']){delete _0x5cbcf3['body']['id'];}return db['OpenchannelAccount'][_0x57f0('0x51')]({'where':{'id':_0x5cbcf3['params']['id']}})[_0x57f0('0x19')](handleEntityNotFound(_0x117f8b,null))[_0x57f0('0x19')](function(_0x16a021){if(_0x16a021){_0x5cbcf3[_0x57f0('0x53')]['OpenchannelAccountId']=_0x16a021['id'];return db[_0x57f0('0x5c')]['create'](_0x5cbcf3[_0x57f0('0x53')]);}})[_0x57f0('0x19')](respondWithResult(_0x117f8b,null))[_0x57f0('0x23')](handleError(_0x117f8b,null));};exports[_0x57f0('0x5d')]=function(_0x2f9385,_0x4528f1,_0x3ec3e4){var _0x287cd1={'raw':![],'where':{}};var _0x4300e5={};var _0x539e1c={'count':0x0,'rows':[]};return db[_0x57f0('0x4b')][_0x57f0('0x5e')]({'where':{'id':_0x2f9385[_0x57f0('0x4f')]['id']}})[_0x57f0('0x19')](handleEntityNotFound(_0x4528f1,null))[_0x57f0('0x19')](function(_0x370592){if(_0x370592){_0x4300e5[_0x57f0('0x3c')]=_[_0x57f0('0x3e')](db[_0x57f0('0x5c')][_0x57f0('0x39')]);_0x4300e5[_0x57f0('0x3d')]=_[_0x57f0('0x3e')](_0x2f9385[_0x57f0('0x3d')]);_0x4300e5['filters']=_[_0x57f0('0x40')](_0x4300e5[_0x57f0('0x3c')],_0x4300e5[_0x57f0('0x3d')]);_0x287cd1['attributes']=_[_0x57f0('0x40')](_0x4300e5[_0x57f0('0x3c')],qs[_0x57f0('0x41')](_0x2f9385[_0x57f0('0x3d')]['fields']));_0x287cd1['attributes']=_0x287cd1[_0x57f0('0x42')]['length']?_0x287cd1['attributes']:_0x4300e5[_0x57f0('0x3c')];if(!_0x2f9385[_0x57f0('0x3d')]['hasOwnProperty'](_0x57f0('0x45'))){_0x287cd1['limit']=qs[_0x57f0('0x28')](_0x2f9385['query'][_0x57f0('0x28')]);_0x287cd1[_0x57f0('0x26')]=qs['offset'](_0x2f9385[_0x57f0('0x3d')]['offset']);}_0x287cd1[_0x57f0('0x5f')]=qs['sort'](_0x2f9385[_0x57f0('0x3d')][_0x57f0('0x46')]);_0x287cd1[_0x57f0('0x49')]=qs[_0x57f0('0x3f')](_[_0x57f0('0x47')](_0x2f9385['query'],_0x4300e5[_0x57f0('0x3f')]));_0x287cd1['where'][_0x57f0('0x60')]=_0x370592['id'];if(_0x2f9385[_0x57f0('0x3d')][_0x57f0('0x48')]){_0x287cd1[_0x57f0('0x49')]=_[_0x57f0('0x4a')](_0x287cd1['where'],{'$or':_[_0x57f0('0x38')](_0x287cd1[_0x57f0('0x42')],function(_0x59a801){var _0x4509df={};_0x4509df[_0x59a801]={'$like':'%'+_0x2f9385[_0x57f0('0x3d')]['filter']+'%'};return _0x4509df;})});}_0x287cd1=_[_0x57f0('0x4a')]({},_0x287cd1,_0x2f9385[_0x57f0('0x50')]);return db[_0x57f0('0x5c')][_0x57f0('0x29')]({'where':_0x287cd1[_0x57f0('0x49')]})[_0x57f0('0x19')](function(_0x123923){_0x539e1c[_0x57f0('0x29')]=_0x123923;if(_0x2f9385['query'][_0x57f0('0x4c')]){_0x287cd1['include']=[{'all':!![]}];}return db[_0x57f0('0x5c')][_0x57f0('0x4e')](_0x287cd1);})['then'](function(_0x20d88f){_0x539e1c[_0x57f0('0x61')]=_0x20d88f;return _0x539e1c;});}})[_0x57f0('0x19')](respondWithFilteredResult(_0x4528f1,_0x287cd1))[_0x57f0('0x23')](handleError(_0x4528f1,null));};exports[_0x57f0('0x62')]=function(_0x403bd6,_0x297c3a,_0xdbbdcd){return db[_0x57f0('0x4b')]['find']({'where':{'id':_0x403bd6['params']['id']}})[_0x57f0('0x19')](handleEntityNotFound(_0x297c3a,null))['then'](function(_0x541125){if(_0x541125){return _0x541125[_0x57f0('0x62')](_0x403bd6['query'][_0x57f0('0x63')]);}})[_0x57f0('0x19')](respondWithStatusCode(_0x297c3a,null))[_0x57f0('0x23')](handleError(_0x297c3a,null));};exports[_0x57f0('0x64')]=function(_0x547829,_0x37e32a,_0x231baa){if(_0x547829[_0x57f0('0x53')]['id']){delete _0x547829[_0x57f0('0x53')]['id'];}return db[_0x57f0('0x4b')][_0x57f0('0x51')]({'where':{'id':_0x547829[_0x57f0('0x4f')]['id']}})[_0x57f0('0x19')](handleEntityNotFound(_0x37e32a,null))['then'](function(_0x4c651d){if(_0x4c651d){_0x547829[_0x57f0('0x53')][_0x57f0('0x60')]=_0x4c651d['id'];return db[_0x57f0('0x65')]['create'](_0x547829['body']);}})['then'](respondWithResult(_0x37e32a,null))['catch'](handleError(_0x37e32a,null));};exports[_0x57f0('0x66')]=function(_0x448a42,_0x50e2bd,_0x2cfd47){var _0x208fdf={'raw':![],'where':{}};var _0x43f8dc={};var _0x5f090a={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x448a42[_0x57f0('0x4f')]['id']}})[_0x57f0('0x19')](handleEntityNotFound(_0x50e2bd,null))['then'](function(_0x17d9f4){if(_0x17d9f4){_0x43f8dc[_0x57f0('0x3c')]=_[_0x57f0('0x3e')](db[_0x57f0('0x65')]['rawAttributes']);_0x43f8dc[_0x57f0('0x3d')]=_[_0x57f0('0x3e')](_0x448a42['query']);_0x43f8dc[_0x57f0('0x3f')]=_['intersection'](_0x43f8dc[_0x57f0('0x3c')],_0x43f8dc[_0x57f0('0x3d')]);_0x208fdf['attributes']=_[_0x57f0('0x40')](_0x43f8dc['model'],qs[_0x57f0('0x41')](_0x448a42['query'][_0x57f0('0x41')]));_0x208fdf[_0x57f0('0x42')]=_0x208fdf[_0x57f0('0x42')][_0x57f0('0x43')]?_0x208fdf[_0x57f0('0x42')]:_0x43f8dc['model'];if(!_0x448a42[_0x57f0('0x3d')][_0x57f0('0x44')](_0x57f0('0x45'))){_0x208fdf[_0x57f0('0x28')]=qs['limit'](_0x448a42['query'][_0x57f0('0x28')]);_0x208fdf['offset']=qs['offset'](_0x448a42[_0x57f0('0x3d')][_0x57f0('0x26')]);}_0x208fdf[_0x57f0('0x5f')]=qs['sort'](_0x448a42[_0x57f0('0x3d')][_0x57f0('0x46')]);_0x208fdf[_0x57f0('0x49')]=qs['filters'](_[_0x57f0('0x47')](_0x448a42[_0x57f0('0x3d')],_0x43f8dc[_0x57f0('0x3f')]));_0x208fdf[_0x57f0('0x49')][_0x57f0('0x60')]=_0x17d9f4['id'];if(_0x448a42['query']['filter']){_0x208fdf[_0x57f0('0x49')]=_['merge'](_0x208fdf[_0x57f0('0x49')],{'$or':_[_0x57f0('0x38')](_0x208fdf[_0x57f0('0x42')],function(_0x321a27){var _0x162448={};_0x162448[_0x321a27]={'$like':'%'+_0x448a42[_0x57f0('0x3d')][_0x57f0('0x48')]+'%'};return _0x162448;})});}_0x208fdf=_['merge']({},_0x208fdf,_0x448a42[_0x57f0('0x50')]);return db[_0x57f0('0x65')][_0x57f0('0x29')]({'where':_0x208fdf[_0x57f0('0x49')]})[_0x57f0('0x19')](function(_0x2aaf91){_0x5f090a['count']=_0x2aaf91;if(_0x448a42[_0x57f0('0x3d')][_0x57f0('0x4c')]){_0x208fdf[_0x57f0('0x4d')]=[{'all':!![]}];}return db[_0x57f0('0x65')][_0x57f0('0x4e')](_0x208fdf);})[_0x57f0('0x19')](function(_0x5cad65){_0x5f090a[_0x57f0('0x61')]=_0x5cad65;return _0x5f090a;});}})['then'](respondWithFilteredResult(_0x50e2bd,_0x208fdf))[_0x57f0('0x23')](handleError(_0x50e2bd,null));};exports[_0x57f0('0x67')]=function(_0x5358cf,_0x4e1457,_0x5844c7){return db[_0x57f0('0x4b')][_0x57f0('0x51')]({'where':{'id':_0x5358cf[_0x57f0('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4e1457,null))[_0x57f0('0x19')](function(_0x3a6238){if(_0x3a6238){return _0x3a6238[_0x57f0('0x67')](_0x5358cf[_0x57f0('0x3d')][_0x57f0('0x63')]);}})['then'](respondWithStatusCode(_0x4e1457,null))[_0x57f0('0x23')](handleError(_0x4e1457,null));};exports[_0x57f0('0x68')]=function(_0x1040b7,_0x42899f,_0x3d9aad){var _0x25de99={'body':_0x1040b7[_0x57f0('0x53')],'channel':_0x57f0('0x69')};var _0x10164f=[];var _0x60af3f=[];var _0x26a466={};var _0x1478b2=![];return db[_0x57f0('0x6a')][_0x57f0('0x5b')]()[_0x57f0('0x19')](function(_0xd3054){if(!_0xd3054){throw new db[(_0x57f0('0x6b'))][(_0x57f0('0x6c'))]('no\x20available\x20attributes');}_0x10164f=_[_0x57f0('0x6d')](_['keys'](_0xd3054),[_0x57f0('0x6e'),_0x57f0('0x6f')]);_0x60af3f=_[_0x57f0('0x6d')](_['keys'](_0xd3054),[_0x57f0('0x6e'),_0x57f0('0x6f'),_0x57f0('0x70'),_0x57f0('0x71')]);if(_0x1040b7[_0x57f0('0x53')]['id']){delete _0x1040b7['body']['id'];}if(_['isNil'](_0x1040b7[_0x57f0('0x53')][_0x57f0('0x72')])){throw new db['Sequelize'][(_0x57f0('0x6c'))](_0x57f0('0x73'));}if(_[_0x57f0('0x74')](_0x1040b7['body']['body'])||_0x1040b7[_0x57f0('0x53')][_0x57f0('0x53')]===''){throw new db[(_0x57f0('0x6b'))][(_0x57f0('0x6c'))](_0x57f0('0x75'));}if(_['isNil'](_0x1040b7[_0x57f0('0x53')][_0x57f0('0x76')])){throw new db[(_0x57f0('0x6b'))]['ValidationError'](_0x57f0('0x77')+_0x60af3f);}if(!_[_0x57f0('0x78')](_0x60af3f,_0x1040b7[_0x57f0('0x53')][_0x57f0('0x76')])){throw new db['Sequelize'][(_0x57f0('0x6c'))](_0x57f0('0x79')+_0x60af3f);}_0x26a466[_0x1040b7[_0x57f0('0x53')]['mapKey']]=_0x1040b7[_0x57f0('0x53')][_0x57f0('0x72')];})[_0x57f0('0x19')](function(){return db[_0x57f0('0x4b')][_0x57f0('0x51')]({'where':{'id':_0x1040b7[_0x57f0('0x4f')]['id']},'include':[{'model':db['CmList'],'as':_0x57f0('0x7a'),'include':[{'model':db['CmContact'],'as':_0x57f0('0x7b'),'where':_0x26a466,'limit':0x1,'order':[[_0x57f0('0x6f'),_0x57f0('0x7c')]]}]},{'model':db['OpenchannelApplication'],'as':_0x57f0('0x7d')}]});})[_0x57f0('0x19')](handleEntityNotFound(_0x42899f,null))[_0x57f0('0x19')](function(_0x170933){if(_0x170933&&_0x170933[_0x57f0('0x7a')]){_0x25de99[_0x57f0('0x7e')]=_0x170933;_0x25de99['applications']=_0x170933[_0x57f0('0x7d')];_0x25de99[_0x57f0('0x7f')]=_0x170933[_0x57f0('0x7a')];_0x25de99[_0x57f0('0x80')]=_['orderBy'](_0x25de99[_0x57f0('0x80')],['priority'],['asc']);if(_0x25de99[_0x57f0('0x7e')][_0x57f0('0x7d')]){delete _0x25de99['account'][_0x57f0('0x7d')];}if(_0x25de99[_0x57f0('0x7e')][_0x57f0('0x7a')]&&_0x25de99[_0x57f0('0x7e')]['List']['Contacts'][_0x57f0('0x43')]){return _0x25de99[_0x57f0('0x7e')][_0x57f0('0x7a')]['Contacts'][0x0];}var _0x13e815=_['defaults'](_0x1040b7[_0x57f0('0x53')],{'firstName':_0x1040b7[_0x57f0('0x53')][_0x57f0('0x72')],'ListId':_0x170933['ListId']});_0x13e815[_0x1040b7[_0x57f0('0x53')][_0x57f0('0x76')]]=_0x1040b7['body'][_0x57f0('0x72')];return db[_0x57f0('0x6a')][_0x57f0('0x52')](_0x13e815,{'fields':_0x10164f,'raw':!![]});}})[_0x57f0('0x19')](handleEntityNotFound(_0x42899f,null))['then'](function(_0xd5ef79){_0x25de99['contact']=_0xd5ef79;if(_0xd5ef79){var _0x916e1d={'ContactId':_0xd5ef79['id'],'OpenchannelAccountId':_0x1040b7[_0x57f0('0x4f')]['id'],'from':(_0xd5ef79[_0x57f0('0x81')]||'')+'\x20'+(_0xd5ef79['lastName']||'')};var _0x5ec5b5={'OpenchannelAccountId':_0x1040b7[_0x57f0('0x4f')]['id'],'closed':![]};if(_0x1040b7[_0x57f0('0x53')]['threadId']){_0x5ec5b5['threadId']=_0x1040b7[_0x57f0('0x53')][_0x57f0('0x82')];return db['OpenchannelInteraction'][_0x57f0('0x51')]({'where':_0x5ec5b5})[_0x57f0('0x19')](function(_0x5d2905){if(_0x5d2905){return[_0x5d2905,![]];}_0x916e1d[_0x57f0('0x82')]=_0x1040b7[_0x57f0('0x53')]['threadId'];_0x916e1d['externalUrl']=_0x1040b7['body']['externalUrl'];return db['OpenchannelInteraction'][_0x57f0('0x52')](_0x916e1d)['then'](function(_0x16ab4d){return[_0x16ab4d,!![]];});});}else{_0x5ec5b5['threadId']=null;}_0x5ec5b5['ContactId']=_0xd5ef79['id'];return db[_0x57f0('0x83')]['find']({'where':_0x5ec5b5})[_0x57f0('0x19')](function(_0x4bcd47){if(_0x4bcd47){return[_0x4bcd47,![]];}return db[_0x57f0('0x83')][_0x57f0('0x52')](_0x916e1d)[_0x57f0('0x19')](function(_0x880eab){return[_0x880eab,!![]];});});}})[_0x57f0('0x84')](function(_0x16cf49,_0x1995fe){if(_0x16cf49){_0x1478b2=_0x1995fe;if(!_0x1995fe){var _0x39b10d={'from':(_0x25de99[_0x57f0('0x85')][_0x57f0('0x81')]||'')+'\x20'+(_0x25de99[_0x57f0('0x85')][_0x57f0('0x86')]||'')};if(_0x1040b7[_0x57f0('0x53')]['threadId']&&_0x1040b7[_0x57f0('0x53')]['messageId']&&_0x1040b7['body'][_0x57f0('0x82')]!=_0x1040b7['body']['messageId']){_0x39b10d[_0x57f0('0x82')]=_0x1040b7[_0x57f0('0x53')][_0x57f0('0x87')];}return _0x16cf49[_0x57f0('0x5a')](_0x39b10d);}else{return _0x16cf49;}}})[_0x57f0('0x19')](function(_0x5abf88){_0x25de99['interaction']=_0x5abf88['get']({'plain':!![]});_0x25de99[_0x57f0('0x88')]['created']=_0x1478b2;if(_0x25de99[_0x57f0('0x88')]['created']){if(_0x25de99['account'][_0x57f0('0x89')]){_0x25de99[_0x57f0('0x80')][_0x57f0('0x8a')]({'id':0x0,'priority':_0x25de99[_0x57f0('0x80')][_0x57f0('0x43')]+0x1,'app':_0x57f0('0x8b'),'appdata':'unmanaged','interval':_0x57f0('0x8c')});}}return db[_0x57f0('0x8d')][_0x57f0('0x52')]({'body':_0x1040b7[_0x57f0('0x53')][_0x57f0('0x53')],'OpenchannelAccountId':_0x1040b7[_0x57f0('0x4f')]['id'],'OpenchannelInteractionId':_0x5abf88['id'],'direction':'in','ContactId':_0x25de99[_0x57f0('0x85')]['id'],'AttachmentId':_0x1040b7[_0x57f0('0x53')][_0x57f0('0x8e')]});})[_0x57f0('0x19')](function(_0x15cf3e){_0x25de99[_0x57f0('0x21')]=_0x15cf3e;if(!_0x25de99[_0x57f0('0x88')][_0x57f0('0x8f')])return;return db['User'][_0x57f0('0x51')]({'attributes':['id',_0x57f0('0x34')],'where':{'id':_0x25de99[_0x57f0('0x88')][_0x57f0('0x8f')]}});})[_0x57f0('0x19')](function(_0x56c1bf){if(_0x56c1bf){_0x25de99['applications'][_0x57f0('0x90')]({'id':0x0,'priority':0x0,'app':_0x57f0('0x91'),'appdata':_0x56c1bf[_0x57f0('0x34')]+','+(_0x25de99[_0x57f0('0x7e')][_0x57f0('0x92')]||0xa),'interval':_0x57f0('0x8c')});}if(!_0x25de99['interaction'][_0x57f0('0x93')])return;return db['OpenchannelQueue']['find']({'attributes':['id',_0x57f0('0x34')],'where':{'id':_0x25de99[_0x57f0('0x88')]['queueId']}});})[_0x57f0('0x19')](function(_0x5176c7){if(_0x5176c7){_0x25de99[_0x57f0('0x80')][_0x57f0('0x90')]({'id':0x0,'priority':0x1,'app':_0x57f0('0x94'),'appdata':_0x5176c7[_0x57f0('0x34')]+','+(_0x25de99[_0x57f0('0x7e')][_0x57f0('0x95')]||0x12c),'interval':_0x57f0('0x8c')});}return respondWithRpcPromise(_0x57f0('0x96'),_0x57f0('0x97'),_0x25de99);})[_0x57f0('0x19')](function(_0x227a45){respondWithRpcPromise(_0x57f0('0x98'),_0x57f0('0x98'),{'event':_0x57f0('0x68'),'message':_0x227a45},client9002);return _0x227a45;})[_0x57f0('0x19')](respondWithResult(_0x42899f,null))['catch'](handleError(_0x42899f,null));};exports[_0x57f0('0x99')]=function(_0x320abe,_0x18b894){var _0x32bdac=_0x320abe[_0x57f0('0x4f')]['id'];var _0x3f6ed9=_0x320abe[_0x57f0('0x53')];var _0x20dbea=0xc8;var _0x5dd734=null;return db['sequelize'][_0x57f0('0x9a')]({'isolationLevel':db[_0x57f0('0x9b')][_0x57f0('0x9c')][_0x57f0('0x9d')][_0x57f0('0x9e')]},function(_0x103f08){return db['OpenchannelAccount'][_0x57f0('0x5e')]({'where':{'id':_0x32bdac},'transaction':_0x103f08})[_0x57f0('0x19')](function(_0x28c382){if(_0x28c382){return db[_0x57f0('0x9f')][_0x57f0('0x31')]({'where':{'OpenchannelAccountId':_0x32bdac},'transaction':_0x103f08})[_0x57f0('0x19')](function(){var _0xb33d44=_['map'](_0x3f6ed9,function(_0x353565){_0x353565[_0x57f0('0x60')]=_0x32bdac;return _0x353565;});return db[_0x57f0('0x9f')][_0x57f0('0xa0')](_0xb33d44,{'transaction':_0x103f08});});}else{_0x20dbea=0x194;_0x5dd734=[];}});})[_0x57f0('0x19')](function(){if(_0x20dbea!==0x194){return db[_0x57f0('0x9f')][_0x57f0('0xa1')]({'where':{'OpenchannelAccountId':_0x32bdac},'order':_0x57f0('0xa2')})[_0x57f0('0x19')](function(_0x17b22f){_0x5dd734=_0x17b22f;});}})[_0x57f0('0x23')](function(_0x3cfced){_0x20dbea=0x1f4;logger[_0x57f0('0x1f')](_0x3cfced[_0x57f0('0xa3')]);if(_0x3cfced[_0x57f0('0x34')]){delete _0x3cfced[_0x57f0('0x34')];}_0x5dd734=_0x3cfced;})[_0x57f0('0xa4')](function(){if(_0x5dd734===null){_0x18b894[_0x57f0('0x33')](_0x20dbea);}else{if(_0x20dbea===0x1f4){_0x18b894[_0x57f0('0x24')](_0x20dbea)[_0x57f0('0x35')](_0x5dd734);}else{_0x18b894[_0x57f0('0x24')](_0x20dbea)['json'](_0x5dd734);}}});};exports[_0x57f0('0xa5')]=function(_0x3d9984,_0x44a035,_0x17a4ae){var _0x1cd8a3={};var _0x205c82={};var _0x201def;var _0x522d4c;return db[_0x57f0('0x4b')][_0x57f0('0x5e')]({'where':{'id':_0x3d9984[_0x57f0('0x4f')]['id']}})[_0x57f0('0x19')](handleEntityNotFound(_0x44a035,null))[_0x57f0('0x19')](function(_0x10bd6f){if(_0x10bd6f){_0x201def=_0x10bd6f;_0x205c82[_0x57f0('0x3c')]=_[_0x57f0('0x3e')](db[_0x57f0('0x9f')][_0x57f0('0x39')]);_0x205c82['query']=_[_0x57f0('0x3e')](_0x3d9984[_0x57f0('0x3d')]);_0x205c82[_0x57f0('0x3f')]=_[_0x57f0('0x40')](_0x205c82[_0x57f0('0x3c')],_0x205c82['query']);_0x1cd8a3[_0x57f0('0x42')]=_['intersection'](_0x205c82[_0x57f0('0x3c')],qs['fields'](_0x3d9984[_0x57f0('0x3d')][_0x57f0('0x41')]));_0x1cd8a3['attributes']=_0x1cd8a3[_0x57f0('0x42')][_0x57f0('0x43')]?_0x1cd8a3[_0x57f0('0x42')]:_0x205c82[_0x57f0('0x3c')];_0x1cd8a3[_0x57f0('0x5f')]=qs[_0x57f0('0x46')](_0x3d9984['query'][_0x57f0('0x46')]);_0x1cd8a3[_0x57f0('0x49')]=qs['filters'](_[_0x57f0('0x47')](_0x3d9984[_0x57f0('0x3d')],_0x205c82[_0x57f0('0x3f')]));if(_0x3d9984['query'][_0x57f0('0x48')]){_0x1cd8a3[_0x57f0('0x49')]=_[_0x57f0('0x4a')](_0x1cd8a3[_0x57f0('0x49')],{'$or':_['map'](_0x1cd8a3[_0x57f0('0x42')],function(_0x327815){var _0x55fed1={};_0x55fed1[_0x327815]={'$like':'%'+_0x3d9984[_0x57f0('0x3d')]['filter']+'%'};return _0x55fed1;})});}_0x1cd8a3=_[_0x57f0('0x4a')]({},_0x1cd8a3,_0x3d9984[_0x57f0('0x50')]);return _0x201def['getApplications'](_0x1cd8a3);}})[_0x57f0('0x19')](function(_0x51a540){if(_0x51a540){_0x522d4c=_0x51a540['length'];if(!_0x3d9984[_0x57f0('0x3d')][_0x57f0('0x44')](_0x57f0('0x45'))){_0x1cd8a3['limit']=qs[_0x57f0('0x28')](_0x3d9984[_0x57f0('0x3d')]['limit']);_0x1cd8a3[_0x57f0('0x26')]=qs[_0x57f0('0x26')](_0x3d9984[_0x57f0('0x3d')][_0x57f0('0x26')]);}return _0x201def[_0x57f0('0xa5')](_0x1cd8a3);}})['then'](function(_0x39ed0b){if(_0x39ed0b){return _0x39ed0b?{'count':_0x522d4c,'rows':_0x39ed0b}:null;}})['then'](respondWithResult(_0x44a035,null))[_0x57f0('0x23')](handleError(_0x44a035,null));};exports[_0x57f0('0xa6')]=function(_0x53299a,_0x422433,_0x52d268){var _0x5ebec4={'raw':![],'where':{}};var _0x1af1ed={};var _0x818a3c={'count':0x0,'rows':[]};return db[_0x57f0('0x4b')]['findOne']({'where':{'id':_0x53299a[_0x57f0('0x4f')]['id']}})[_0x57f0('0x19')](handleEntityNotFound(_0x422433,null))[_0x57f0('0x19')](function(_0x141b53){if(_0x141b53){_0x1af1ed[_0x57f0('0x3c')]=_['keys'](db[_0x57f0('0x83')]['rawAttributes']);_0x1af1ed[_0x57f0('0x3d')]=_[_0x57f0('0x3e')](_0x53299a[_0x57f0('0x3d')]);_0x1af1ed[_0x57f0('0x3f')]=_[_0x57f0('0x40')](_0x1af1ed[_0x57f0('0x3c')],_0x1af1ed[_0x57f0('0x3d')]);_0x5ebec4['attributes']=_['intersection'](_0x1af1ed[_0x57f0('0x3c')],qs[_0x57f0('0x41')](_0x53299a[_0x57f0('0x3d')][_0x57f0('0x41')]));_0x5ebec4['attributes']=_0x5ebec4[_0x57f0('0x42')][_0x57f0('0x43')]?_0x5ebec4[_0x57f0('0x42')]:_0x1af1ed[_0x57f0('0x3c')];if(!_0x53299a[_0x57f0('0x3d')][_0x57f0('0x44')](_0x57f0('0x45'))){_0x5ebec4[_0x57f0('0x28')]=qs[_0x57f0('0x28')](_0x53299a[_0x57f0('0x3d')]['limit']);_0x5ebec4[_0x57f0('0x26')]=qs[_0x57f0('0x26')](_0x53299a[_0x57f0('0x3d')]['offset']);}_0x5ebec4[_0x57f0('0x5f')]=qs['sort'](_0x53299a[_0x57f0('0x3d')][_0x57f0('0x46')]);_0x5ebec4[_0x57f0('0x49')]=qs['filters'](_[_0x57f0('0x47')](_0x53299a[_0x57f0('0x3d')],_0x1af1ed[_0x57f0('0x3f')]));_0x5ebec4[_0x57f0('0x49')][_0x57f0('0x60')]=_0x141b53['id'];if(_0x53299a[_0x57f0('0x3d')][_0x57f0('0x48')]){_0x5ebec4[_0x57f0('0x49')]=_[_0x57f0('0x4a')](_0x5ebec4[_0x57f0('0x49')],{'$or':_[_0x57f0('0x38')](_0x5ebec4['attributes'],function(_0x425ad7){var _0x5cc0e1={};_0x5cc0e1[_0x425ad7]={'$like':'%'+_0x53299a[_0x57f0('0x3d')]['filter']+'%'};return _0x5cc0e1;})});}_0x5ebec4=_[_0x57f0('0x4a')]({},_0x5ebec4,_0x53299a[_0x57f0('0x50')]);return db[_0x57f0('0x83')][_0x57f0('0x29')]({'where':_0x5ebec4['where']})[_0x57f0('0x19')](function(_0x3cdba7){_0x818a3c[_0x57f0('0x29')]=_0x3cdba7;if(_0x53299a[_0x57f0('0x3d')][_0x57f0('0x4c')]){_0x5ebec4['include']=[{'model':db[_0x57f0('0x6a')],'as':_0x57f0('0xa7'),'required':![]},{'model':db[_0x57f0('0xa8')],'as':_0x57f0('0xa9'),'attributes':['name',_0x57f0('0xaa'),_0x57f0('0xab')],'required':![]},{'model':db[_0x57f0('0xac')],'as':'Tags','attributes':['id',_0x57f0('0x34'),_0x57f0('0xad')],'where':_0x53299a[_0x57f0('0x3d')]['tag']?{'id':_0x53299a['query'][_0x57f0('0xae')]}:undefined,'required':_0x53299a[_0x57f0('0x3d')][_0x57f0('0xae')]?!![]:![]}];}return db[_0x57f0('0x83')][_0x57f0('0x4e')](_0x5ebec4);})[_0x57f0('0x19')](function(_0xad8d48){_0x818a3c[_0x57f0('0x61')]=_0xad8d48;return _0x818a3c;});}})[_0x57f0('0x19')](respondWithFilteredResult(_0x422433,_0x5ebec4))[_0x57f0('0x23')](handleError(_0x422433,null));};exports[_0x57f0('0xaf')]=function(_0x16e928,_0x40760c,_0x189bdf){return db[_0x57f0('0x4b')][_0x57f0('0x51')]({'where':{'id':_0x16e928[_0x57f0('0x4f')]['id']}})[_0x57f0('0x19')](handleEntityNotFound(_0x40760c,null))[_0x57f0('0x19')](function(_0x2a1335){if(_0x2a1335){return _0x2a1335[_0x57f0('0xaf')](_0x16e928['body'][_0x57f0('0x63')],_[_0x57f0('0xb0')](_0x16e928[_0x57f0('0x53')],[_0x57f0('0x63'),'id'])||{})[_0x57f0('0x84')](function(_0x167e99){for(var _0x4e3982=0x0;_0x4e3982<_0x16e928[_0x57f0('0x53')][_0x57f0('0x63')][_0x57f0('0x43')];_0x4e3982+=0x1){socket[_0x57f0('0xb1')](_0x57f0('0xb2'),{'UserId':Number(_0x16e928[_0x57f0('0x53')]['ids'][_0x4e3982]),'OpenchannelAccountId':Number(_0x16e928[_0x57f0('0x4f')]['id'])});}return _0x167e99;});}})[_0x57f0('0x19')](respondWithResult(_0x40760c,null))['catch'](handleError(_0x40760c,null));};exports[_0x57f0('0xb3')]=function(_0x78f3c9,_0x3d2c6c,_0x48db9b){return db[_0x57f0('0x4b')][_0x57f0('0x51')]({'where':{'id':_0x78f3c9[_0x57f0('0x4f')]['id']}})[_0x57f0('0x19')](handleEntityNotFound(_0x3d2c6c,null))[_0x57f0('0x19')](function(_0x38f9b2){if(_0x38f9b2){return _0x38f9b2[_0x57f0('0xb3')](_0x78f3c9[_0x57f0('0x3d')][_0x57f0('0x63')])[_0x57f0('0x19')](function(){if(_[_0x57f0('0xb4')](_0x78f3c9['query'][_0x57f0('0x63')])){for(var _0x27cbc5=0x0;_0x27cbc5<_0x78f3c9[_0x57f0('0x3d')]['ids']['length'];_0x27cbc5+=0x1){socket[_0x57f0('0xb1')](_0x57f0('0xb5'),{'UserId':Number(_0x78f3c9['query'][_0x57f0('0x63')][_0x27cbc5]),'OpenchannelAccountId':Number(_0x78f3c9[_0x57f0('0x4f')]['id'])});}}else{socket[_0x57f0('0xb1')]('userOpenchannelAccount:remove',{'UserId':Number(_0x78f3c9[_0x57f0('0x3d')][_0x57f0('0x63')]),'OpenchannelAccountId':Number(_0x78f3c9[_0x57f0('0x4f')]['id'])});}});}})[_0x57f0('0x19')](respondWithStatusCode(_0x3d2c6c,null))['catch'](handleError(_0x3d2c6c,null));};exports['getAgents']=function(_0x26ce4b,_0x3ee259,_0x280420){var _0x1c2744={};var _0x4419ac={};var _0x35fb48;var _0x35af29;return db[_0x57f0('0x4b')][_0x57f0('0x5e')]({'where':{'id':_0x26ce4b[_0x57f0('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3ee259,null))['then'](function(_0x4a3acb){if(_0x4a3acb){_0x35fb48=_0x4a3acb;_0x4419ac[_0x57f0('0x3c')]=_[_0x57f0('0x3e')](db[_0x57f0('0xa8')][_0x57f0('0x39')]);_0x4419ac[_0x57f0('0x3d')]=_[_0x57f0('0x3e')](_0x26ce4b[_0x57f0('0x3d')]);_0x4419ac[_0x57f0('0x3f')]=_[_0x57f0('0x40')](_0x4419ac[_0x57f0('0x3c')],_0x4419ac[_0x57f0('0x3d')]);_0x1c2744[_0x57f0('0x42')]=_[_0x57f0('0x40')](_0x4419ac[_0x57f0('0x3c')],qs[_0x57f0('0x41')](_0x26ce4b['query'][_0x57f0('0x41')]));_0x1c2744[_0x57f0('0x42')]=_0x1c2744[_0x57f0('0x42')][_0x57f0('0x43')]?_0x1c2744['attributes']:_0x4419ac['model'];_0x1c2744['order']=qs[_0x57f0('0x46')](_0x26ce4b[_0x57f0('0x3d')][_0x57f0('0x46')]);_0x1c2744[_0x57f0('0x49')]=qs[_0x57f0('0x3f')](_['pick'](_0x26ce4b[_0x57f0('0x3d')],_0x4419ac['filters']));if(_0x26ce4b['query']['filter']){_0x1c2744[_0x57f0('0x49')]=_[_0x57f0('0x4a')](_0x1c2744['where'],{'$or':_[_0x57f0('0x38')](_0x1c2744[_0x57f0('0x42')],function(_0x578218){var _0x1d5542={};_0x1d5542[_0x578218]={'$like':'%'+_0x26ce4b[_0x57f0('0x3d')]['filter']+'%'};return _0x1d5542;})});}_0x1c2744=_[_0x57f0('0x4a')]({},_0x1c2744,_0x26ce4b[_0x57f0('0x50')]);return _0x35fb48[_0x57f0('0xb6')](_0x1c2744);}})[_0x57f0('0x19')](function(_0x2c9fe5){if(_0x2c9fe5){_0x35af29=_0x2c9fe5[_0x57f0('0x43')];if(!_0x26ce4b[_0x57f0('0x3d')]['hasOwnProperty']('nolimit')){_0x1c2744['limit']=qs[_0x57f0('0x28')](_0x26ce4b[_0x57f0('0x3d')][_0x57f0('0x28')]);_0x1c2744[_0x57f0('0x26')]=qs[_0x57f0('0x26')](_0x26ce4b[_0x57f0('0x3d')][_0x57f0('0x26')]);}return _0x35fb48['getAgents'](_0x1c2744);}})[_0x57f0('0x19')](function(_0x330eff){if(_0x330eff){return _0x330eff?{'count':_0x35af29,'rows':_0x330eff}:null;}})[_0x57f0('0x19')](respondWithResult(_0x3ee259,null))['catch'](handleError(_0x3ee259,null));};exports[_0x57f0('0x35')]=function(_0x353cd1,_0x5a7cfa,_0x12ac70){var _0x204999,_0x36089c,_0x55f209;if(_[_0x57f0('0x74')](_0x353cd1[_0x57f0('0x53')][_0x57f0('0x53')])||_0x353cd1['body'][_0x57f0('0x53')]===''){throw new db['Sequelize']['ValidationError'](_0x57f0('0x75'));}if(_[_0x57f0('0x74')](_0x353cd1[_0x57f0('0x53')]['to'])){}_0x204999=_0x353cd1[_0x57f0('0x53')]['to'];return db['OpenchannelAccount'][_0x57f0('0x5e')]({'where':{'id':_0x353cd1[_0x57f0('0x4f')]['id']}})[_0x57f0('0x19')](handleEntityNotFound(_0x5a7cfa,null))[_0x57f0('0x19')](function(_0x597ffd){if(_0x597ffd){return db['OpenchannelAccount'][_0x57f0('0x51')]({'where':{'id':_0x597ffd['id']},'include':[{'model':db[_0x57f0('0xb7')],'as':_0x57f0('0x7a'),'include':[{'model':db[_0x57f0('0x6a')],'as':_0x57f0('0x7b'),'where':{[_0x597ffd[_0x57f0('0x76')]]:_0x204999},'limit':0x1,'order':[[_0x57f0('0x6f'),'DESC']]}]}]})[_0x57f0('0x19')](handleEntityNotFound(_0x5a7cfa,null))[_0x57f0('0x19')](function(_0x52358e){if(_0x52358e&&_0x52358e[_0x57f0('0x7a')]){_0x36089c=_0x52358e['get']({'plain':!![]});if(_0x36089c['List']&&_0x36089c[_0x57f0('0x7a')][_0x57f0('0x7b')][_0x57f0('0x43')]){return _0x36089c[_0x57f0('0x7a')][_0x57f0('0x7b')][0x0];}return db[_0x57f0('0x6a')]['create'](_[_0x57f0('0xb8')](_0x353cd1[_0x57f0('0x53')],{'firstName':_0x204999,[_0x52358e[_0x57f0('0x76')]]:_0x204999,'phone':_0x204999,'ListId':_0x36089c['ListId']}));}})[_0x57f0('0x19')](handleEntityNotFound(_0x5a7cfa,null))['then'](function(_0x180352){if(_0x180352){_0x55f209=_0x180352;return db[_0x57f0('0x83')][_0x57f0('0x51')]({'where':{'ContactId':_0x55f209['id'],'closed':![],'OpenchannelAccountId':_0x36089c['id']}})[_0x57f0('0x19')](function(_0x227b5b){if(_0x227b5b){return[_0x227b5b,![]];}return db[_0x57f0('0x83')]['create']({'UserId':_0x353cd1[_0x57f0('0x54')]['id'],'ContactId':_0x55f209['id'],'OpenchannelAccountId':_0x36089c['id'],'lastMsgDirection':_0x57f0('0xb9'),'firstMsgDirection':_0x57f0('0xb9'),'Messages':[_[_0x57f0('0x4a')](_0x353cd1[_0x57f0('0x53')],{'read':![],'body':_0x353cd1[_0x57f0('0x53')][_0x57f0('0x53')],'OpenchannelAccountId':_0x36089c['id'],'UserId':_0x353cd1[_0x57f0('0x54')]['id'],'ContactId':_0x55f209['id']})]},{'include':[{'model':db[_0x57f0('0x8d')],'as':_0x57f0('0xba')}]})['then'](function(_0x5caf05){return[_0x5caf05,!![]];});});}})[_0x57f0('0x84')](function(_0x39835d,_0x2b714f){if(_0x2b714f){return _0x39835d;}return db['OpenchannelMessage'][_0x57f0('0x52')](_[_0x57f0('0x4a')](_0x353cd1['body'],{'read':![],'body':_0x353cd1[_0x57f0('0x53')][_0x57f0('0x53')],'OpenchannelAccountId':_0x36089c['id'],'OpenchannelInteractionId':_0x39835d['id'],'UserId':_0x353cd1[_0x57f0('0x54')]['id'],'ContactId':_0x55f209['id']}))[_0x57f0('0x19')](function(_0x33ae6c){_0x39835d[_0x57f0('0xbb')][_0x57f0('0xba')]=[];_0x39835d['dataValues'][_0x57f0('0xba')][_0x57f0('0x8a')](_0x33ae6c[_0x57f0('0xbb')]);return _0x39835d;});});}})[_0x57f0('0x19')](respondWithResult(_0x5a7cfa,null))['catch'](handleError(_0x5a7cfa,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 41fd421..c9b5fa4 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 _0xd64b=['exports','events','OpenchannelAccount','save','update','remove','hasOwnProperty','hook'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xd64b,0xc1));var _0xbd64=function(_0x508911,_0x231622){_0x508911=_0x508911-0x0;var _0x3ce3c0=_0xd64b[_0x508911];return _0x3ce3c0;};'use strict';var EventEmitter=require(_0xbd64('0x0'));var OpenchannelAccount=require('../../mysqldb')['db'][_0xbd64('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbd64('0x2'),'afterUpdate':_0xbd64('0x3'),'afterDestroy':_0xbd64('0x4')};function emitEvent(_0x3f1f05){return function(_0x30fe29,_0x5458d8,_0x5446e4){OpenchannelAccountEvents['emit'](_0x3f1f05+':'+_0x30fe29['id'],_0x30fe29);OpenchannelAccountEvents['emit'](_0x3f1f05,_0x30fe29);_0x5446e4(null);};}for(var e in events){if(events[_0xbd64('0x5')](e)){var event=events[e];OpenchannelAccount[_0xbd64('0x6')](e,emitEvent(event));}}module[_0xbd64('0x7')]=OpenchannelAccountEvents; \ No newline at end of file +var _0xee5b=['remove','emit','hasOwnProperty','hook','events','OpenchannelAccount','setMaxListeners','update'];(function(_0x6adac5,_0x49bf44){var _0x112c7=function(_0x4021d9){while(--_0x4021d9){_0x6adac5['push'](_0x6adac5['shift']());}};_0x112c7(++_0x49bf44);}(_0xee5b,0x1f4));var _0xbee5=function(_0x779626,_0x4f2fc2){_0x779626=_0x779626-0x0;var _0x5d5d71=_0xee5b[_0x779626];return _0x5d5d71;};'use strict';var EventEmitter=require(_0xbee5('0x0'));var OpenchannelAccount=require('../../mysqldb')['db'][_0xbee5('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xbee5('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbee5('0x3'),'afterDestroy':_0xbee5('0x4')};function emitEvent(_0x2eb857){return function(_0x210159,_0x4bd202,_0x5200b1){OpenchannelAccountEvents[_0xbee5('0x5')](_0x2eb857+':'+_0x210159['id'],_0x210159);OpenchannelAccountEvents[_0xbee5('0x5')](_0x2eb857,_0x210159);_0x5200b1(null);};}for(var e in events){if(events[_0xbee5('0x6')](e)){var event=events[e];OpenchannelAccount[_0xbee5('0x7')](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 5b78a30..5043028 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(_0x332cc7,_0x41f7d1){var _0x18b17e=function(_0x19a21e){while(--_0x19a21e){_0x332cc7['push'](_0x332cc7['shift']());}};_0x18b17e(++_0x41f7d1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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(_0x144abc,_0x497a41){var _0x398a80=function(_0x56c0b5){while(--_0x56c0b5){_0x144abc['push'](_0x144abc['shift']());}};_0x398a80(++_0x497a41);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'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 712cd65..44d0f8b 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 _0x7462=['OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x7462,0x165));var _0x2746=function(_0x45096e,_0x17e82d){_0x45096e=_0x45096e-0x0;var _0xba1fa3=_0x7462[_0x45096e];return _0xba1fa3;};'use strict';var _=require(_0x2746('0x0'));var util=require(_0x2746('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2746('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2746('0x3'));var logger=require(_0x2746('0x4'))('rpc');var config=require(_0x2746('0x5'));var jayson=require(_0x2746('0x6'));var client=jayson[_0x2746('0x7')][_0x2746('0x8')]({'port':0x232a});config[_0x2746('0x9')]=_[_0x2746('0xa')](config[_0x2746('0x9')],{'host':_0x2746('0xb'),'port':0x18eb});var socket=require(_0x2746('0xc'))(new Redis(config['redis']));require(_0x2746('0xd'))[_0x2746('0xe')](socket);function respondWithRpcPromise(_0x4f9eb7,_0x19bec3,_0x1a6329){return new BPromise(function(_0x2ea416,_0x5aef7e){return client[_0x2746('0xf')](_0x4f9eb7,_0x1a6329)[_0x2746('0x10')](function(_0x1a6d97){logger[_0x2746('0x11')](_0x2746('0x12'),_0x19bec3,_0x2746('0x13'));logger[_0x2746('0x14')](_0x2746('0x15'),_0x19bec3,_0x2746('0x13'),JSON[_0x2746('0x16')](_0x1a6d97));if(_0x1a6d97[_0x2746('0x17')]){if(_0x1a6d97['error']['code']===0x1f4){logger[_0x2746('0x17')](_0x2746('0x12'),_0x19bec3,_0x1a6d97[_0x2746('0x17')][_0x2746('0x18')]);return _0x5aef7e(_0x1a6d97['error'][_0x2746('0x18')]);}logger[_0x2746('0x17')]('OpenchannelAccount,\x20%s,\x20%s',_0x19bec3,_0x1a6d97['error'][_0x2746('0x18')]);return _0x2ea416(_0x1a6d97[_0x2746('0x17')][_0x2746('0x18')]);}else{logger[_0x2746('0x11')](_0x2746('0x12'),_0x19bec3,_0x2746('0x13'));_0x2ea416(_0x1a6d97[_0x2746('0x19')][_0x2746('0x18')]);}})[_0x2746('0x1a')](function(_0x509879){logger[_0x2746('0x17')]('OpenchannelAccount,\x20%s,\x20%s',_0x19bec3,_0x509879);_0x5aef7e(_0x509879);});});} \ No newline at end of file +var _0x34b7=['redis','defaults','localhost','socket.io-emitter','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0xd4f90b,_0x148333){var _0x451848=function(_0x12c95c){while(--_0x12c95c){_0xd4f90b['push'](_0xd4f90b['shift']());}};_0x451848(++_0x148333);}(_0x34b7,0x196));var _0x734b=function(_0x583bf0,_0x4b59aa){_0x583bf0=_0x583bf0-0x0;var _0x210ec6=_0x34b7[_0x583bf0];return _0x210ec6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x734b('0x0'));var BPromise=require(_0x734b('0x1'));var rs=require(_0x734b('0x2'));var fs=require('fs');var Redis=require(_0x734b('0x3'));var db=require(_0x734b('0x4'))['db'];var utils=require(_0x734b('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x734b('0x6'));var jayson=require(_0x734b('0x7'));var client=jayson[_0x734b('0x8')][_0x734b('0x9')]({'port':0x232a});config[_0x734b('0xa')]=_[_0x734b('0xb')](config['redis'],{'host':_0x734b('0xc'),'port':0x18eb});var socket=require(_0x734b('0xd'))(new Redis(config['redis']));require('./openchannelAccount.socket')['register'](socket);function respondWithRpcPromise(_0x19a88e,_0x598dee,_0x43c5e0){return new BPromise(function(_0x333738,_0x2860a2){return client[_0x734b('0xe')](_0x19a88e,_0x43c5e0)[_0x734b('0xf')](function(_0x16e451){logger[_0x734b('0x10')](_0x734b('0x11'),_0x598dee,_0x734b('0x12'));logger[_0x734b('0x13')](_0x734b('0x14'),_0x598dee,_0x734b('0x12'),JSON[_0x734b('0x15')](_0x16e451));if(_0x16e451[_0x734b('0x16')]){if(_0x16e451['error'][_0x734b('0x17')]===0x1f4){logger[_0x734b('0x16')](_0x734b('0x11'),_0x598dee,_0x16e451[_0x734b('0x16')][_0x734b('0x18')]);return _0x2860a2(_0x16e451[_0x734b('0x16')][_0x734b('0x18')]);}logger[_0x734b('0x16')](_0x734b('0x11'),_0x598dee,_0x16e451[_0x734b('0x16')][_0x734b('0x18')]);return _0x333738(_0x16e451['error'][_0x734b('0x18')]);}else{logger[_0x734b('0x10')](_0x734b('0x11'),_0x598dee,_0x734b('0x12'));_0x333738(_0x16e451['result']['message']);}})[_0x734b('0x19')](function(_0x3033cd){logger[_0x734b('0x16')](_0x734b('0x11'),_0x598dee,_0x3033cd);_0x2860a2(_0x3033cd);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index aab1dd3..b710de1 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 _0xc79f=['register','openchannelAccount:','./openchannelAccount.events','save','remove','update','emit','removeListener'];(function(_0xa2097b,_0x44a392){var _0x3e2450=function(_0xa62249){while(--_0xa62249){_0xa2097b['push'](_0xa2097b['shift']());}};_0x3e2450(++_0x44a392);}(_0xc79f,0x82));var _0xfc79=function(_0x4c49da,_0x5bf4a5){_0x4c49da=_0x4c49da-0x0;var _0x165067=_0xc79f[_0x4c49da];return _0x165067;};'use strict';var OpenchannelAccountEvents=require(_0xfc79('0x0'));var events=[_0xfc79('0x1'),_0xfc79('0x2'),_0xfc79('0x3')];function createListener(_0x33533f,_0x5e2603){return function(_0x34c2d6){_0x5e2603[_0xfc79('0x4')](_0x33533f,_0x34c2d6);};}function removeListener(_0xa5d8da,_0x274bb5){return function(){OpenchannelAccountEvents[_0xfc79('0x5')](_0xa5d8da,_0x274bb5);};}exports[_0xfc79('0x6')]=function(_0x660769){for(var _0x1ba054=0x0,_0x3df358=events['length'];_0x1ba054<_0x3df358;_0x1ba054++){var _0x8c8b37=events[_0x1ba054];var _0x59bf11=createListener(_0xfc79('0x7')+_0x8c8b37,_0x660769);OpenchannelAccountEvents['on'](_0x8c8b37,_0x59bf11);}}; \ No newline at end of file +var _0x2242=['register','length','openchannelAccount:','./openchannelAccount.events','save','remove','emit','removeListener'];(function(_0xbc4659,_0x578fba){var _0x5831f9=function(_0x5eb0eb){while(--_0x5eb0eb){_0xbc4659['push'](_0xbc4659['shift']());}};_0x5831f9(++_0x578fba);}(_0x2242,0x1a3));var _0x2224=function(_0x2610db,_0x2d13f2){_0x2610db=_0x2610db-0x0;var _0x118629=_0x2242[_0x2610db];return _0x118629;};'use strict';var OpenchannelAccountEvents=require(_0x2224('0x0'));var events=[_0x2224('0x1'),_0x2224('0x2'),'update'];function createListener(_0x3180c8,_0x317565){return function(_0x4acc10){_0x317565[_0x2224('0x3')](_0x3180c8,_0x4acc10);};}function removeListener(_0xb65b2f,_0x4b2099){return function(){OpenchannelAccountEvents[_0x2224('0x4')](_0xb65b2f,_0x4b2099);};}exports[_0x2224('0x5')]=function(_0x23a873){for(var _0x54d057=0x0,_0x28833b=events[_0x2224('0x6')];_0x54d057<_0x28833b;_0x54d057++){var _0x35f807=events[_0x54d057];var _0x25c6d4=createListener(_0x2224('0x7')+_0x35f807,_0x23a873);OpenchannelAccountEvents['on'](_0x35f807,_0x25c6d4);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 47eb712..f2b3a5b 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 _0x1dc5=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','util','path'];(function(_0x59b2a1,_0x1f631f){var _0x4908d1=function(_0x14c9b8){while(--_0x14c9b8){_0x59b2a1['push'](_0x59b2a1['shift']());}};_0x4908d1(++_0x1f631f);}(_0x1dc5,0x75));var _0x51dc=function(_0x19d9fa,_0x2d5edd){_0x19d9fa=_0x19d9fa-0x0;var _0x42ea59=_0x1dc5[_0x19d9fa];return _0x42ea59;};'use strict';var multer=require(_0x51dc('0x0'));var util=require(_0x51dc('0x1'));var path=require(_0x51dc('0x2'));var timeout=require(_0x51dc('0x3'));var express=require(_0x51dc('0x4'));var router=express[_0x51dc('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x51dc('0x6'));var interaction=require(_0x51dc('0x7'));var config=require('../../config/environment');var controller=require(_0x51dc('0x8'));router[_0x51dc('0x9')]('/',auth[_0x51dc('0xa')](),controller[_0x51dc('0xb')]);router[_0x51dc('0x9')](_0x51dc('0xc'),auth[_0x51dc('0xa')](),controller[_0x51dc('0xd')]);router[_0x51dc('0xe')]('/',auth['isAuthenticated'](),controller[_0x51dc('0xf')]);router[_0x51dc('0x10')](_0x51dc('0xc'),auth[_0x51dc('0xa')](),controller[_0x51dc('0x11')]);router[_0x51dc('0x12')](_0x51dc('0xc'),auth[_0x51dc('0xa')](),controller['destroy']);module[_0x51dc('0x13')]=router; \ No newline at end of file +var _0x634b=['../../components/auth/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','path','connect-timeout','Router'];(function(_0x4b43cf,_0x314e49){var _0x4f8add=function(_0x3f2ff1){while(--_0x3f2ff1){_0x4b43cf['push'](_0x4b43cf['shift']());}};_0x4f8add(++_0x314e49);}(_0x634b,0x11c));var _0xb634=function(_0x48a5e5,_0x2a7c15){_0x48a5e5=_0x48a5e5-0x0;var _0x2da266=_0x634b[_0x48a5e5];return _0x2da266;};'use strict';var multer=require(_0xb634('0x0'));var util=require('util');var path=require(_0xb634('0x1'));var timeout=require(_0xb634('0x2'));var express=require('express');var router=express[_0xb634('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb634('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb634('0x5'));var controller=require(_0xb634('0x6'));router[_0xb634('0x7')]('/',auth[_0xb634('0x8')](),controller[_0xb634('0x9')]);router[_0xb634('0x7')](_0xb634('0xa'),auth[_0xb634('0x8')](),controller[_0xb634('0xb')]);router[_0xb634('0xc')]('/',auth[_0xb634('0x8')](),controller['create']);router[_0xb634('0xd')](_0xb634('0xa'),auth[_0xb634('0x8')](),controller[_0xb634('0xe')]);router[_0xb634('0xf')]('/:id',auth[_0xb634('0x8')](),controller[_0xb634('0x10')]);module[_0xb634('0x11')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 586016c..5f6af0b 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 _0x6f14=['noop','TEXT','exports','STRING'];(function(_0x261f9a,_0x207fd9){var _0x551378=function(_0x4c11ef){while(--_0x4c11ef){_0x261f9a['push'](_0x261f9a['shift']());}};_0x551378(++_0x207fd9);}(_0x6f14,0x8e));var _0x46f1=function(_0x89e0f5,_0x5652e6){_0x89e0f5=_0x89e0f5-0x0;var _0x119e69=_0x6f14[_0x89e0f5];return _0x119e69;};'use strict';var Sequelize=require('sequelize');module[_0x46f1('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x46f1('0x1')],'allowNull':![],'defaultValue':_0x46f1('0x2')},'appdata':{'type':Sequelize[_0x46f1('0x3')]()},'description':{'type':Sequelize[_0x46f1('0x1')]},'interval':{'type':Sequelize[_0x46f1('0x1')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x68de=['sequelize','exports','STRING','*,*,*,*'];(function(_0x2b152a,_0x3dd988){var _0x2ad4c7=function(_0x2fa97c){while(--_0x2fa97c){_0x2b152a['push'](_0x2b152a['shift']());}};_0x2ad4c7(++_0x3dd988);}(_0x68de,0x1c0));var _0xe68d=function(_0x374ccf,_0xa945c4){_0x374ccf=_0x374ccf-0x0;var _0x443cde=_0x68de[_0x374ccf];return _0x443cde;};'use strict';var Sequelize=require(_0xe68d('0x0'));module[_0xe68d('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xe68d('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xe68d('0x2')]},'interval':{'type':Sequelize[_0xe68d('0x2')],'defaultValue':_0xe68d('0x3')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index a97c53e..ae30a39 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 _0x708e=['../../mysqldb','end','json','undefined','count','offset','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','send','map','OpenchannelApplication','type','key','name','query','keys','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x227cce,_0x46477b){var _0x339dfb=function(_0x43ef09){while(--_0x43ef09){_0x227cce['push'](_0x227cce['shift']());}};_0x339dfb(++_0x46477b);}(_0x708e,0xcf));var _0xe708=function(_0x36a469,_0x59d84c){_0x36a469=_0x36a469-0x0;var _0x3347fc=_0x708e[_0x36a469];return _0x3347fc;};'use strict';var emlformat=require(_0xe708('0x0'));var rimraf=require(_0xe708('0x1'));var zipdir=require(_0xe708('0x2'));var jsonpatch=require(_0xe708('0x3'));var rp=require(_0xe708('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe708('0x5'));var util=require(_0xe708('0x6'));var path=require(_0xe708('0x7'));var sox=require(_0xe708('0x8'));var csv=require(_0xe708('0x9'));var ejs=require(_0xe708('0xa'));var fs=require('fs');var fs_extra=require(_0xe708('0xb'));var _=require(_0xe708('0xc'));var squel=require('squel');var crypto=require(_0xe708('0xd'));var jsforce=require(_0xe708('0xe'));var deskjs=require(_0xe708('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe708('0x10'));var Papa=require(_0xe708('0x11'));var Redis=require(_0xe708('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xe708('0x13'));var as=require(_0xe708('0x14'));var hardwareService=require(_0xe708('0x15'));var logger=require(_0xe708('0x16'))(_0xe708('0x17'));var utils=require(_0xe708('0x18'));var config=require(_0xe708('0x19'));var licenseUtil=require(_0xe708('0x1a'));var db=require(_0xe708('0x1b'))['db'];function respondWithStatusCode(_0x4d2ed6,_0x43cc3f){_0x43cc3f=_0x43cc3f||0xcc;return function(_0x1b490b){if(_0x1b490b){return _0x4d2ed6['sendStatus'](_0x43cc3f);}return _0x4d2ed6['status'](_0x43cc3f)[_0xe708('0x1c')]();};}function respondWithResult(_0x150795,_0x43b314){_0x43b314=_0x43b314||0xc8;return function(_0x5d5634){if(_0x5d5634){return _0x150795['status'](_0x43b314)[_0xe708('0x1d')](_0x5d5634);}};}function respondWithFilteredResult(_0x1cf81c,_0x916eda){return function(_0x3b9b83){if(_0x3b9b83){var _0x1c894d=typeof _0x916eda['offset']===_0xe708('0x1e')&&typeof _0x916eda['limit']===_0xe708('0x1e');var _0xda5a42=_0x3b9b83[_0xe708('0x1f')];var _0x120c41=_0x1c894d?0x0:_0x916eda['offset'];var _0x11a25b=_0x1c894d?_0x3b9b83['count']:_0x916eda[_0xe708('0x20')]+_0x916eda[_0xe708('0x21')];var _0x2acce0;if(_0x11a25b>=_0xda5a42){_0x11a25b=_0xda5a42;_0x2acce0=0xc8;}else{_0x2acce0=0xce;}_0x1cf81c[_0xe708('0x22')](_0x2acce0);return _0x1cf81c[_0xe708('0x23')](_0xe708('0x24'),_0x120c41+'-'+_0x11a25b+'/'+_0xda5a42)['json'](_0x3b9b83);}return null;};}function patchUpdates(_0x4645e6){return function(_0x30fff8){try{jsonpatch[_0xe708('0x25')](_0x30fff8,_0x4645e6,!![]);}catch(_0x1d9a55){return BPromise[_0xe708('0x26')](_0x1d9a55);}return _0x30fff8[_0xe708('0x27')]();};}function saveUpdates(_0x143287,_0x7aff39){return function(_0xd8e18c){if(_0xd8e18c){return _0xd8e18c[_0xe708('0x28')](_0x143287)[_0xe708('0x29')](function(_0x63be1){return _0x63be1;});}return null;};}function removeEntity(_0x1b5be7,_0x24b99b){return function(_0x58c6d9){if(_0x58c6d9){return _0x58c6d9[_0xe708('0x2a')]()[_0xe708('0x29')](function(){_0x1b5be7[_0xe708('0x22')](0xcc)[_0xe708('0x1c')]();});}};}function handleEntityNotFound(_0x2ea2ff,_0x1ac5c8){return function(_0x53d5dc){if(!_0x53d5dc){_0x2ea2ff[_0xe708('0x2b')](0x194);}return _0x53d5dc;};}function handleError(_0x219e59,_0x3ad2f1){_0x3ad2f1=_0x3ad2f1||0x1f4;return function(_0x393915){logger['error'](_0x393915['stack']);if(_0x393915['name']){delete _0x393915['name'];}_0x219e59[_0xe708('0x22')](_0x3ad2f1)[_0xe708('0x2c')](_0x393915);};}exports['index']=function(_0x11a0af,_0x144325){var _0x3d8932={},_0x6b56b3={},_0x369430={'count':0x0,'rows':[]};var _0x41de1f=_[_0xe708('0x2d')](db[_0xe708('0x2e')]['rawAttributes'],function(_0x2480dd){return{'name':_0x2480dd['fieldName'],'type':_0x2480dd[_0xe708('0x2f')][_0xe708('0x30')]};});_0x6b56b3['model']=_[_0xe708('0x2d')](_0x41de1f,_0xe708('0x31'));_0x6b56b3[_0xe708('0x32')]=_[_0xe708('0x33')](_0x11a0af['query']);_0x6b56b3[_0xe708('0x34')]=_['intersection'](_0x6b56b3[_0xe708('0x35')],_0x6b56b3[_0xe708('0x32')]);_0x3d8932[_0xe708('0x36')]=_[_0xe708('0x37')](_0x6b56b3[_0xe708('0x35')],qs[_0xe708('0x38')](_0x11a0af[_0xe708('0x32')][_0xe708('0x38')]));_0x3d8932[_0xe708('0x36')]=_0x3d8932[_0xe708('0x36')][_0xe708('0x39')]?_0x3d8932[_0xe708('0x36')]:_0x6b56b3['model'];if(!_0x11a0af[_0xe708('0x32')]['hasOwnProperty'](_0xe708('0x3a'))){_0x3d8932[_0xe708('0x21')]=qs[_0xe708('0x21')](_0x11a0af[_0xe708('0x32')][_0xe708('0x21')]);_0x3d8932[_0xe708('0x20')]=qs[_0xe708('0x20')](_0x11a0af[_0xe708('0x32')]['offset']);}_0x3d8932[_0xe708('0x3b')]=qs['sort'](_0x11a0af[_0xe708('0x32')][_0xe708('0x3c')]);_0x3d8932[_0xe708('0x3d')]=qs[_0xe708('0x34')](_[_0xe708('0x3e')](_0x11a0af['query'],_0x6b56b3[_0xe708('0x34')]),_0x41de1f);if(_0x11a0af['query'][_0xe708('0x3f')]){_0x3d8932[_0xe708('0x3d')]=_[_0xe708('0x40')](_0x3d8932[_0xe708('0x3d')],{'$or':_[_0xe708('0x2d')](_0x41de1f,function(_0x120e64){if(_0x120e64[_0xe708('0x2f')]!==_0xe708('0x41')){var _0x31639b={};_0x31639b[_0x120e64[_0xe708('0x31')]]={'$like':'%'+_0x11a0af[_0xe708('0x32')][_0xe708('0x3f')]+'%'};return _0x31639b;}})});}_0x3d8932=_[_0xe708('0x40')]({},_0x3d8932,_0x11a0af[_0xe708('0x42')]);var _0xb9c7f7={'where':_0x3d8932[_0xe708('0x3d')]};return db[_0xe708('0x2e')][_0xe708('0x1f')](_0xb9c7f7)[_0xe708('0x29')](function(_0x2175d5){_0x369430['count']=_0x2175d5;if(_0x11a0af['query'][_0xe708('0x43')]){_0x3d8932[_0xe708('0x44')]=[{'all':!![]}];}return db['OpenchannelApplication'][_0xe708('0x45')](_0x3d8932);})['then'](function(_0x5d07d7){_0x369430[_0xe708('0x46')]=_0x5d07d7;return _0x369430;})[_0xe708('0x29')](respondWithFilteredResult(_0x144325,_0x3d8932))[_0xe708('0x47')](handleError(_0x144325,null));};exports[_0xe708('0x48')]=function(_0x555df3,_0x575463){var _0xfee3da={'raw':!![],'where':{'id':_0x555df3[_0xe708('0x49')]['id']}},_0x58c61e={};_0x58c61e[_0xe708('0x35')]=_[_0xe708('0x33')](db[_0xe708('0x2e')][_0xe708('0x4a')]);_0x58c61e[_0xe708('0x32')]=_[_0xe708('0x33')](_0x555df3[_0xe708('0x32')]);_0x58c61e['filters']=_['intersection'](_0x58c61e[_0xe708('0x35')],_0x58c61e[_0xe708('0x32')]);_0xfee3da[_0xe708('0x36')]=_['intersection'](_0x58c61e[_0xe708('0x35')],qs['fields'](_0x555df3[_0xe708('0x32')][_0xe708('0x38')]));_0xfee3da[_0xe708('0x36')]=_0xfee3da[_0xe708('0x36')][_0xe708('0x39')]?_0xfee3da[_0xe708('0x36')]:_0x58c61e[_0xe708('0x35')];if(_0x555df3[_0xe708('0x32')][_0xe708('0x43')]){_0xfee3da['include']=[{'all':!![]}];}_0xfee3da=_['merge']({},_0xfee3da,_0x555df3[_0xe708('0x42')]);return db[_0xe708('0x2e')][_0xe708('0x4b')](_0xfee3da)[_0xe708('0x29')](handleEntityNotFound(_0x575463,null))[_0xe708('0x29')](respondWithResult(_0x575463,null))[_0xe708('0x47')](handleError(_0x575463,null));};exports[_0xe708('0x4c')]=function(_0x4cf41c,_0x10eb40){return db['OpenchannelApplication'][_0xe708('0x4c')](_0x4cf41c[_0xe708('0x4d')],{})[_0xe708('0x29')](respondWithResult(_0x10eb40,0xc9))['catch'](handleError(_0x10eb40,null));};exports['update']=function(_0x2930f2,_0x1ac599){if(_0x2930f2[_0xe708('0x4d')]['id']){delete _0x2930f2[_0xe708('0x4d')]['id'];}return db[_0xe708('0x2e')][_0xe708('0x4b')]({'where':{'id':_0x2930f2[_0xe708('0x49')]['id']}})['then'](handleEntityNotFound(_0x1ac599,null))[_0xe708('0x29')](saveUpdates(_0x2930f2['body'],null))[_0xe708('0x29')](respondWithResult(_0x1ac599,null))[_0xe708('0x47')](handleError(_0x1ac599,null));};exports[_0xe708('0x2a')]=function(_0x11c398,_0x297946){return db[_0xe708('0x2e')][_0xe708('0x4b')]({'where':{'id':_0x11c398[_0xe708('0x49')]['id']}})[_0xe708('0x29')](handleEntityNotFound(_0x297946,null))[_0xe708('0x29')](removeEntity(_0x297946,null))['catch'](handleError(_0x297946,null));}; \ No newline at end of file +var _0x8c02=['papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','json','undefined','count','limit','set','apply','reject','update','then','destroy','sendStatus','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','options','OpenchannelApplication','findAll','rows','show','params','includeAll','include','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring'];(function(_0x4623ef,_0x41adee){var _0x493a39=function(_0x41bc60){while(--_0x41bc60){_0x4623ef['push'](_0x4623ef['shift']());}};_0x493a39(++_0x41adee);}(_0x8c02,0x155));var _0x28c0=function(_0x524447,_0x37b7c8){_0x524447=_0x524447-0x0;var _0x4cb266=_0x8c02[_0x524447];return _0x4cb266;};'use strict';var emlformat=require(_0x28c0('0x0'));var rimraf=require(_0x28c0('0x1'));var zipdir=require(_0x28c0('0x2'));var jsonpatch=require(_0x28c0('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x28c0('0x4'));var util=require(_0x28c0('0x5'));var path=require(_0x28c0('0x6'));var sox=require(_0x28c0('0x7'));var csv=require(_0x28c0('0x8'));var ejs=require(_0x28c0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x28c0('0xa'));var crypto=require(_0x28c0('0xb'));var jsforce=require(_0x28c0('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x28c0('0x8'));var querystring=require(_0x28c0('0xd'));var Papa=require(_0x28c0('0xe'));var Redis=require('ioredis');var authService=require(_0x28c0('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x28c0('0x10'));var hardwareService=require(_0x28c0('0x11'));var logger=require(_0x28c0('0x12'))(_0x28c0('0x13'));var utils=require(_0x28c0('0x14'));var config=require(_0x28c0('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x118e33,_0x49ffdf){_0x49ffdf=_0x49ffdf||0xcc;return function(_0x4b291c){if(_0x4b291c){return _0x118e33['sendStatus'](_0x49ffdf);}return _0x118e33[_0x28c0('0x16')](_0x49ffdf)['end']();};}function respondWithResult(_0x5a8afc,_0x1e3017){_0x1e3017=_0x1e3017||0xc8;return function(_0x18fd9a){if(_0x18fd9a){return _0x5a8afc['status'](_0x1e3017)[_0x28c0('0x17')](_0x18fd9a);}};}function respondWithFilteredResult(_0x2ad616,_0x4e17f8){return function(_0x5730b6){if(_0x5730b6){var _0x43fef7=typeof _0x4e17f8['offset']===_0x28c0('0x18')&&typeof _0x4e17f8['limit']===_0x28c0('0x18');var _0x2f99da=_0x5730b6[_0x28c0('0x19')];var _0x52d9db=_0x43fef7?0x0:_0x4e17f8['offset'];var _0x46bd28=_0x43fef7?_0x5730b6['count']:_0x4e17f8['offset']+_0x4e17f8[_0x28c0('0x1a')];var _0x1fb951;if(_0x46bd28>=_0x2f99da){_0x46bd28=_0x2f99da;_0x1fb951=0xc8;}else{_0x1fb951=0xce;}_0x2ad616[_0x28c0('0x16')](_0x1fb951);return _0x2ad616[_0x28c0('0x1b')]('Content-Range',_0x52d9db+'-'+_0x46bd28+'/'+_0x2f99da)[_0x28c0('0x17')](_0x5730b6);}return null;};}function patchUpdates(_0xfa874){return function(_0x29e645){try{jsonpatch[_0x28c0('0x1c')](_0x29e645,_0xfa874,!![]);}catch(_0xdae2){return BPromise[_0x28c0('0x1d')](_0xdae2);}return _0x29e645['save']();};}function saveUpdates(_0x2919b7,_0x5e8c1a){return function(_0x37ffdc){if(_0x37ffdc){return _0x37ffdc[_0x28c0('0x1e')](_0x2919b7)[_0x28c0('0x1f')](function(_0x100656){return _0x100656;});}return null;};}function removeEntity(_0x2065bc,_0x40ceeb){return function(_0x4a9aa7){if(_0x4a9aa7){return _0x4a9aa7[_0x28c0('0x20')]()[_0x28c0('0x1f')](function(){_0x2065bc[_0x28c0('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x450125,_0x479e68){return function(_0xf0040c){if(!_0xf0040c){_0x450125[_0x28c0('0x21')](0x194);}return _0xf0040c;};}function handleError(_0x1ab935,_0x423b57){_0x423b57=_0x423b57||0x1f4;return function(_0x2f2421){logger['error'](_0x2f2421['stack']);if(_0x2f2421[_0x28c0('0x22')]){delete _0x2f2421[_0x28c0('0x22')];}_0x1ab935['status'](_0x423b57)[_0x28c0('0x23')](_0x2f2421);};}exports[_0x28c0('0x24')]=function(_0x24608e,_0x51574d){var _0x1904f9={},_0x2ae8c9={},_0x4db3a8={'count':0x0,'rows':[]};var _0xdf2028=_['map'](db['OpenchannelApplication'][_0x28c0('0x25')],function(_0x2c1815){return{'name':_0x2c1815[_0x28c0('0x26')],'type':_0x2c1815[_0x28c0('0x27')][_0x28c0('0x28')]};});_0x2ae8c9['model']=_[_0x28c0('0x29')](_0xdf2028,_0x28c0('0x22'));_0x2ae8c9[_0x28c0('0x2a')]=_[_0x28c0('0x2b')](_0x24608e['query']);_0x2ae8c9[_0x28c0('0x2c')]=_[_0x28c0('0x2d')](_0x2ae8c9[_0x28c0('0x2e')],_0x2ae8c9[_0x28c0('0x2a')]);_0x1904f9['attributes']=_[_0x28c0('0x2d')](_0x2ae8c9[_0x28c0('0x2e')],qs[_0x28c0('0x2f')](_0x24608e[_0x28c0('0x2a')][_0x28c0('0x2f')]));_0x1904f9['attributes']=_0x1904f9[_0x28c0('0x30')][_0x28c0('0x31')]?_0x1904f9[_0x28c0('0x30')]:_0x2ae8c9[_0x28c0('0x2e')];if(!_0x24608e['query'][_0x28c0('0x32')](_0x28c0('0x33'))){_0x1904f9[_0x28c0('0x1a')]=qs[_0x28c0('0x1a')](_0x24608e[_0x28c0('0x2a')][_0x28c0('0x1a')]);_0x1904f9[_0x28c0('0x34')]=qs[_0x28c0('0x34')](_0x24608e['query']['offset']);}_0x1904f9[_0x28c0('0x35')]=qs[_0x28c0('0x36')](_0x24608e[_0x28c0('0x2a')]['sort']);_0x1904f9[_0x28c0('0x37')]=qs[_0x28c0('0x2c')](_[_0x28c0('0x38')](_0x24608e['query'],_0x2ae8c9[_0x28c0('0x2c')]),_0xdf2028);if(_0x24608e['query'][_0x28c0('0x39')]){_0x1904f9[_0x28c0('0x37')]=_['merge'](_0x1904f9[_0x28c0('0x37')],{'$or':_[_0x28c0('0x29')](_0xdf2028,function(_0x11dd12){if(_0x11dd12[_0x28c0('0x27')]!=='VIRTUAL'){var _0x5a3313={};_0x5a3313[_0x11dd12['name']]={'$like':'%'+_0x24608e[_0x28c0('0x2a')][_0x28c0('0x39')]+'%'};return _0x5a3313;}})});}_0x1904f9=_[_0x28c0('0x3a')]({},_0x1904f9,_0x24608e[_0x28c0('0x3b')]);var _0x299909={'where':_0x1904f9['where']};return db[_0x28c0('0x3c')][_0x28c0('0x19')](_0x299909)[_0x28c0('0x1f')](function(_0x27dc68){_0x4db3a8[_0x28c0('0x19')]=_0x27dc68;if(_0x24608e[_0x28c0('0x2a')]['includeAll']){_0x1904f9['include']=[{'all':!![]}];}return db[_0x28c0('0x3c')][_0x28c0('0x3d')](_0x1904f9);})[_0x28c0('0x1f')](function(_0x5c1c98){_0x4db3a8[_0x28c0('0x3e')]=_0x5c1c98;return _0x4db3a8;})['then'](respondWithFilteredResult(_0x51574d,_0x1904f9))['catch'](handleError(_0x51574d,null));};exports[_0x28c0('0x3f')]=function(_0x512d73,_0x5e2deb){var _0x4a5ed0={'raw':!![],'where':{'id':_0x512d73[_0x28c0('0x40')]['id']}},_0x48d437={};_0x48d437[_0x28c0('0x2e')]=_[_0x28c0('0x2b')](db[_0x28c0('0x3c')][_0x28c0('0x25')]);_0x48d437[_0x28c0('0x2a')]=_[_0x28c0('0x2b')](_0x512d73[_0x28c0('0x2a')]);_0x48d437[_0x28c0('0x2c')]=_['intersection'](_0x48d437[_0x28c0('0x2e')],_0x48d437[_0x28c0('0x2a')]);_0x4a5ed0[_0x28c0('0x30')]=_[_0x28c0('0x2d')](_0x48d437[_0x28c0('0x2e')],qs[_0x28c0('0x2f')](_0x512d73['query']['fields']));_0x4a5ed0[_0x28c0('0x30')]=_0x4a5ed0[_0x28c0('0x30')][_0x28c0('0x31')]?_0x4a5ed0[_0x28c0('0x30')]:_0x48d437['model'];if(_0x512d73[_0x28c0('0x2a')][_0x28c0('0x41')]){_0x4a5ed0[_0x28c0('0x42')]=[{'all':!![]}];}_0x4a5ed0=_['merge']({},_0x4a5ed0,_0x512d73['options']);return db['OpenchannelApplication']['find'](_0x4a5ed0)[_0x28c0('0x1f')](handleEntityNotFound(_0x5e2deb,null))['then'](respondWithResult(_0x5e2deb,null))[_0x28c0('0x43')](handleError(_0x5e2deb,null));};exports[_0x28c0('0x44')]=function(_0x1c8f47,_0x42ff96){return db[_0x28c0('0x3c')][_0x28c0('0x44')](_0x1c8f47[_0x28c0('0x45')],{})[_0x28c0('0x1f')](respondWithResult(_0x42ff96,0xc9))[_0x28c0('0x43')](handleError(_0x42ff96,null));};exports['update']=function(_0x2a34d6,_0x2419ed){if(_0x2a34d6[_0x28c0('0x45')]['id']){delete _0x2a34d6[_0x28c0('0x45')]['id'];}return db[_0x28c0('0x3c')][_0x28c0('0x46')]({'where':{'id':_0x2a34d6[_0x28c0('0x40')]['id']}})[_0x28c0('0x1f')](handleEntityNotFound(_0x2419ed,null))[_0x28c0('0x1f')](saveUpdates(_0x2a34d6[_0x28c0('0x45')],null))[_0x28c0('0x1f')](respondWithResult(_0x2419ed,null))[_0x28c0('0x43')](handleError(_0x2419ed,null));};exports[_0x28c0('0x20')]=function(_0x4b1668,_0x386762){return db['OpenchannelApplication'][_0x28c0('0x46')]({'where':{'id':_0x4b1668[_0x28c0('0x40')]['id']}})[_0x28c0('0x1f')](handleEntityNotFound(_0x386762,null))[_0x28c0('0x1f')](removeEntity(_0x386762,null))['catch'](handleError(_0x386762,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index e8a80cb..b93ad72 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 _0x901e=['request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes','exports','OpenchannelApplication','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird'];(function(_0x2842a7,_0x2e906d){var _0x5338b3=function(_0x316f58){while(--_0x316f58){_0x2842a7['push'](_0x2842a7['shift']());}};_0x5338b3(++_0x2e906d);}(_0x901e,0xe6));var _0xe901=function(_0x2e030a,_0x8e4c48){_0x2e030a=_0x2e030a-0x0;var _0x597df6=_0x901e[_0x2e030a];return _0x597df6;};'use strict';var _=require('lodash');var util=require(_0xe901('0x0'));var logger=require('../../config/logger')(_0xe901('0x1'));var moment=require(_0xe901('0x2'));var BPromise=require(_0xe901('0x3'));var rp=require(_0xe901('0x4'));var fs=require('fs');var path=require(_0xe901('0x5'));var rimraf=require(_0xe901('0x6'));var config=require(_0xe901('0x7'));var attributes=require(_0xe901('0x8'));module[_0xe901('0x9')]=function(_0x4bcad0,_0x37c283){return _0x4bcad0['define'](_0xe901('0xa'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe901('0xb'),'collate':_0xe901('0xc')});}; \ No newline at end of file +var _0xb5d9=['define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','path','rimraf','../../config/environment','exports'];(function(_0x3a2e49,_0x21ebea){var _0x257140=function(_0x5a2362){while(--_0x5a2362){_0x3a2e49['push'](_0x3a2e49['shift']());}};_0x257140(++_0x21ebea);}(_0xb5d9,0x101));var _0x9b5d=function(_0x348077,_0xe82a34){_0x348077=_0x348077-0x0;var _0x5de059=_0xb5d9[_0x348077];return _0x5de059;};'use strict';var _=require(_0x9b5d('0x0'));var util=require(_0x9b5d('0x1'));var logger=require(_0x9b5d('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9b5d('0x3'));var rimraf=require(_0x9b5d('0x4'));var config=require(_0x9b5d('0x5'));var attributes=require('./openchannelApplication.attributes');module[_0x9b5d('0x6')]=function(_0x25a10a,_0x44c1a3){return _0x25a10a[_0x9b5d('0x7')](_0x9b5d('0x8'),attributes,{'tableName':_0x9b5d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9b5d('0xa'),'collate':_0x9b5d('0xb')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 8f04aa8..2d808b2 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 _0xff73=['body','options','limit','then','info','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','OpenchannelApplication,\x20%s,\x20%s','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update'];(function(_0x35b3d6,_0x20cac0){var _0xfa7473=function(_0x45f5c9){while(--_0x45f5c9){_0x35b3d6['push'](_0x35b3d6['shift']());}};_0xfa7473(++_0x20cac0);}(_0xff73,0x19b));var _0x3ff7=function(_0x99f838,_0xe376e2){_0x99f838=_0x99f838-0x0;var _0x432cd7=_0xff73[_0x99f838];return _0x432cd7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3ff7('0x0'));var BPromise=require('bluebird');var rs=require(_0x3ff7('0x1'));var fs=require('fs');var Redis=require(_0x3ff7('0x2'));var db=require(_0x3ff7('0x3'))['db'];var utils=require(_0x3ff7('0x4'));var logger=require(_0x3ff7('0x5'))(_0x3ff7('0x6'));var config=require('../../config/environment');var jayson=require(_0x3ff7('0x7'));var client=jayson[_0x3ff7('0x8')][_0x3ff7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x239f78,_0x8f824e,_0x38ece9){return new BPromise(function(_0x4ec6ce,_0x2407e2){return client[_0x3ff7('0xa')](_0x239f78,_0x38ece9)['then'](function(_0x30a458){logger['info'](_0x3ff7('0xb'),_0x8f824e,'request\x20sent');logger[_0x3ff7('0xc')](_0x3ff7('0xd'),_0x8f824e,_0x3ff7('0xe'),JSON[_0x3ff7('0xf')](_0x30a458));if(_0x30a458['error']){if(_0x30a458[_0x3ff7('0x10')][_0x3ff7('0x11')]===0x1f4){logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x8f824e,_0x30a458[_0x3ff7('0x10')][_0x3ff7('0x12')]);return _0x2407e2(_0x30a458[_0x3ff7('0x10')][_0x3ff7('0x12')]);}logger['error'](_0x3ff7('0xb'),_0x8f824e,_0x30a458['error'][_0x3ff7('0x12')]);return _0x4ec6ce(_0x30a458['error']['message']);}else{logger['info'](_0x3ff7('0xb'),_0x8f824e,_0x3ff7('0xe'));_0x4ec6ce(_0x30a458[_0x3ff7('0x13')][_0x3ff7('0x12')]);}})[_0x3ff7('0x14')](function(_0x5aae67){logger[_0x3ff7('0x10')](_0x3ff7('0xb'),_0x8f824e,_0x5aae67);_0x2407e2(_0x5aae67);});});}exports[_0x3ff7('0x15')]=function(_0x3cd8df){var _0x2f6376=this;return new Promise(function(_0x5001b8,_0x5b51a6){return db[_0x3ff7('0x16')][_0x3ff7('0x17')](_0x3cd8df[_0x3ff7('0x18')],{'raw':_0x3cd8df[_0x3ff7('0x19')]?_0x3cd8df[_0x3ff7('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3cd8df[_0x3ff7('0x19')]?_0x3cd8df[_0x3ff7('0x19')]['where']||null:null,'attributes':_0x3cd8df[_0x3ff7('0x19')]?_0x3cd8df[_0x3ff7('0x19')]['attributes']||null:null,'limit':_0x3cd8df['options']?_0x3cd8df[_0x3ff7('0x19')][_0x3ff7('0x1a')]||null:null})[_0x3ff7('0x1b')](function(_0x4e2f28){logger[_0x3ff7('0x1c')](_0x3ff7('0x15'),_0x3cd8df);logger['debug'](_0x3ff7('0x15'),_0x3cd8df,JSON[_0x3ff7('0xf')](_0x4e2f28));_0x5001b8(_0x4e2f28);})['catch'](function(_0x25febc){logger['error']('UpdateOpenchannelApplication',_0x25febc[_0x3ff7('0x12')],_0x3cd8df);_0x5b51a6(_0x2f6376['error'](0x1f4,_0x25febc[_0x3ff7('0x12')]));});});}; \ No newline at end of file +var _0x97b5=['message','result','OpenchannelApplication','body','options','where','attributes','UpdateOpenchannelApplication','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0x97b5,0x135));var _0x597b=function(_0x2abf68,_0x4ec499){_0x2abf68=_0x2abf68-0x0;var _0x2adec3=_0x97b5[_0x2abf68];return _0x2adec3;};'use strict';var _=require(_0x597b('0x0'));var util=require(_0x597b('0x1'));var moment=require(_0x597b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x597b('0x3'));var db=require(_0x597b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x597b('0x5'))(_0x597b('0x6'));var config=require(_0x597b('0x7'));var jayson=require(_0x597b('0x8'));var client=jayson[_0x597b('0x9')][_0x597b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x966fd1,_0x25cfa7,_0xf4b6d5){return new BPromise(function(_0x237c51,_0x194691){return client[_0x597b('0xb')](_0x966fd1,_0xf4b6d5)[_0x597b('0xc')](function(_0x4f1156){logger[_0x597b('0xd')](_0x597b('0xe'),_0x25cfa7,_0x597b('0xf'));logger[_0x597b('0x10')](_0x597b('0x11'),_0x25cfa7,_0x597b('0xf'),JSON[_0x597b('0x12')](_0x4f1156));if(_0x4f1156[_0x597b('0x13')]){if(_0x4f1156[_0x597b('0x13')][_0x597b('0x14')]===0x1f4){logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x25cfa7,_0x4f1156[_0x597b('0x13')][_0x597b('0x15')]);return _0x194691(_0x4f1156[_0x597b('0x13')]['message']);}logger[_0x597b('0x13')](_0x597b('0xe'),_0x25cfa7,_0x4f1156[_0x597b('0x13')]['message']);return _0x237c51(_0x4f1156[_0x597b('0x13')][_0x597b('0x15')]);}else{logger[_0x597b('0xd')]('OpenchannelApplication,\x20%s,\x20%s',_0x25cfa7,'request\x20sent');_0x237c51(_0x4f1156[_0x597b('0x16')]['message']);}})['catch'](function(_0x1f0955){logger[_0x597b('0x13')](_0x597b('0xe'),_0x25cfa7,_0x1f0955);_0x194691(_0x1f0955);});});}exports['UpdateOpenchannelApplication']=function(_0x4e8def){var _0x165576=this;return new Promise(function(_0x1b1a1d,_0x49a7b3){return db[_0x597b('0x17')]['update'](_0x4e8def[_0x597b('0x18')],{'raw':_0x4e8def[_0x597b('0x19')]?_0x4e8def[_0x597b('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e8def[_0x597b('0x19')]?_0x4e8def['options'][_0x597b('0x1a')]||null:null,'attributes':_0x4e8def['options']?_0x4e8def['options'][_0x597b('0x1b')]||null:null,'limit':_0x4e8def[_0x597b('0x19')]?_0x4e8def[_0x597b('0x19')]['limit']||null:null})[_0x597b('0xc')](function(_0x37062e){logger[_0x597b('0xd')](_0x597b('0x1c'),_0x4e8def);logger[_0x597b('0x10')](_0x597b('0x1c'),_0x4e8def,JSON[_0x597b('0x12')](_0x37062e));_0x1b1a1d(_0x37062e);})[_0x597b('0x1d')](function(_0x65bb46){logger[_0x597b('0x13')](_0x597b('0x1c'),_0x65bb46[_0x597b('0x15')],_0x4e8def);_0x49a7b3(_0x165576[_0x597b('0x13')](0x1f4,_0x65bb46['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 30ffb95..ecce9d6 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 _0xf360=['get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages','/:id/download','download','post','create','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','delete','openchannelinteraction:destroy','removeTags','exports','multer','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x3ba81a,_0x5a8d1a){var _0x551b14=function(_0x3a8913){while(--_0x3a8913){_0x3ba81a['push'](_0x3ba81a['shift']());}};_0x551b14(++_0x5a8d1a);}(_0xf360,0x8b));var _0x0f36=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xf360[_0x2be8c2];return _0x97f531;};'use strict';var multer=require(_0x0f36('0x0'));var util=require('util');var path=require(_0x0f36('0x1'));var timeout=require('connect-timeout');var express=require(_0x0f36('0x2'));var router=express[_0x0f36('0x3')]();var fs_extra=require(_0x0f36('0x4'));var auth=require(_0x0f36('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./openchannelInteraction.controller');router[_0x0f36('0x6')]('/',auth['isAuthenticated'](),controller[_0x0f36('0x7')]);router['get'](_0x0f36('0x8'),auth[_0x0f36('0x9')](),controller[_0x0f36('0xa')]);router[_0x0f36('0x6')](_0x0f36('0xb'),auth[_0x0f36('0x9')](),controller[_0x0f36('0xc')]);router['get'](_0x0f36('0xd'),auth[_0x0f36('0x9')](),controller['getMessages']);router[_0x0f36('0x6')](_0x0f36('0xe'),auth[_0x0f36('0x9')](),controller[_0x0f36('0xf')]);router[_0x0f36('0x10')]('/',auth[_0x0f36('0x9')](),controller[_0x0f36('0x11')]);router['post'](_0x0f36('0xd'),auth[_0x0f36('0x9')](),controller['addMessage']);router[_0x0f36('0x10')](_0x0f36('0x12'),auth['isAuthenticated'](),interaction[_0x0f36('0x13')](_0x0f36('0x14'),_0x0f36('0x15')),controller[_0x0f36('0x16')]);router[_0x0f36('0x17')](_0x0f36('0xb'),auth[_0x0f36('0x9')](),interaction[_0x0f36('0x13')](_0x0f36('0x14'),_0x0f36('0x18')),controller['update']);router[_0x0f36('0x19')](_0x0f36('0xb'),auth[_0x0f36('0x9')](),interaction[_0x0f36('0x13')](_0x0f36('0x14'),_0x0f36('0x1a')),controller['destroy']);router['delete']('/:id/tags',auth['isAuthenticated'](),controller[_0x0f36('0x1b')]);module[_0x0f36('0x1c')]=router; \ No newline at end of file +var _0x6425=['util','path','connect-timeout','Router','fs-extra','./openchannelInteraction.controller','get','isAuthenticated','/describe','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','/:id','update','delete','openchannelinteraction:destroy','destroy','exports','multer'];(function(_0x53d9a7,_0x44c4a3){var _0x1c8958=function(_0x597d99){while(--_0x597d99){_0x53d9a7['push'](_0x53d9a7['shift']());}};_0x1c8958(++_0x44c4a3);}(_0x6425,0x194));var _0x5642=function(_0xc79a93,_0x2cb42a){_0xc79a93=_0xc79a93-0x0;var _0x477faf=_0x6425[_0xc79a93];return _0x477faf;};'use strict';var multer=require(_0x5642('0x0'));var util=require(_0x5642('0x1'));var path=require(_0x5642('0x2'));var timeout=require(_0x5642('0x3'));var express=require('express');var router=express[_0x5642('0x4')]();var fs_extra=require(_0x5642('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5642('0x6'));router[_0x5642('0x7')]('/',auth[_0x5642('0x8')](),controller['index']);router[_0x5642('0x7')](_0x5642('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x5642('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x5642('0xa')]);router['get'](_0x5642('0xb'),auth[_0x5642('0x8')](),controller[_0x5642('0xc')]);router[_0x5642('0x7')](_0x5642('0xd'),auth[_0x5642('0x8')](),controller[_0x5642('0xe')]);router[_0x5642('0xf')]('/',auth[_0x5642('0x8')](),controller['create']);router[_0x5642('0xf')](_0x5642('0xb'),auth['isAuthenticated'](),controller[_0x5642('0x10')]);router[_0x5642('0xf')](_0x5642('0x11'),auth[_0x5642('0x8')](),interaction[_0x5642('0x12')](_0x5642('0x13'),_0x5642('0x14')),controller['addTags']);router['put'](_0x5642('0x15'),auth[_0x5642('0x8')](),interaction[_0x5642('0x12')]('openchannel','openchannelinteraction:update'),controller[_0x5642('0x16')]);router[_0x5642('0x17')](_0x5642('0x15'),auth[_0x5642('0x8')](),interaction[_0x5642('0x12')](_0x5642('0x13'),_0x5642('0x18')),controller[_0x5642('0x19')]);router[_0x5642('0x17')]('/:id/tags',auth['isAuthenticated'](),controller['removeTags']);module[_0x5642('0x1a')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index e2765fb..4692958 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 _0xfaf3=['sequelize','BOOLEAN','DATE','STRING','ENUM','out','INTEGER'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0xfaf3,0x93));var _0x3faf=function(_0x18990e,_0x1bd156){_0x18990e=_0x18990e-0x0;var _0x21ffae=_0xfaf3[_0x18990e];return _0x21ffae;};'use strict';var Sequelize=require(_0x3faf('0x0'));module['exports']={'closed':{'type':Sequelize[_0x3faf('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3faf('0x2')]},'disposition':{'type':Sequelize[_0x3faf('0x3')]},'secondDisposition':{'type':Sequelize[_0x3faf('0x3')]},'thirdDisposition':{'type':Sequelize[_0x3faf('0x3')]},'note':{'type':Sequelize[_0x3faf('0x3')]},'read1stAt':{'type':Sequelize[_0x3faf('0x2')]},'threadId':{'type':Sequelize[_0x3faf('0x3')]},'externalUrl':{'type':Sequelize[_0x3faf('0x3')]},'lastMsgAt':{'type':Sequelize[_0x3faf('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x3faf('0x4')]('in',_0x3faf('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x3faf('0x4')]('in',_0x3faf('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x3faf('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x3faf('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x3faf('0x6')]}}; \ No newline at end of file +var _0xb78e=['INTEGER','sequelize','exports','DATE','STRING','ENUM','out','BOOLEAN'];(function(_0x5a511b,_0x9259c9){var _0x58f997=function(_0x4fb254){while(--_0x4fb254){_0x5a511b['push'](_0x5a511b['shift']());}};_0x58f997(++_0x9259c9);}(_0xb78e,0x1c9));var _0xeb78=function(_0x107069,_0x26a147){_0x107069=_0x107069-0x0;var _0x509d66=_0xb78e[_0x107069];return _0x509d66;};'use strict';var Sequelize=require(_0xeb78('0x0'));module[_0xeb78('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xeb78('0x2')]},'disposition':{'type':Sequelize[_0xeb78('0x3')]},'secondDisposition':{'type':Sequelize[_0xeb78('0x3')]},'thirdDisposition':{'type':Sequelize[_0xeb78('0x3')]},'note':{'type':Sequelize[_0xeb78('0x3')]},'read1stAt':{'type':Sequelize[_0xeb78('0x2')]},'threadId':{'type':Sequelize[_0xeb78('0x3')]},'externalUrl':{'type':Sequelize[_0xeb78('0x3')]},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xeb78('0x4')]('in',_0xeb78('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xeb78('0x4')]('in',_0xeb78('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xeb78('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0xeb78('0x6')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xeb78('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index a0ef0cd..0f112da 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 _0xcbe8=['../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','update','then','destroy','error','stack','name','send','index','map','fieldName','type','key','getOptions','openchannel','catch','show','query','from','params','model','keys','OpenchannelInteraction','rawAttributes','filters','intersection','attributes','fields','length','include','merge','options','find','create','body','describe','addMessage','ids','omit','findOne','OpenchannelMessage','hasOwnProperty','order','where','pick','OpenchannelInteractionId','filter','$gte','includeAll','findAll','rows','addTags','setTags','spread','color','openchannelInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','format','User','fullname','push','Contact','firstName','lastName','Attachment','Messages','secret','read','OpenchannelAccount','Owner','get','mkdirSync','Openchannel','Account','N.A.','createdAt','YYYY-MM-DD\x20HH:mm:ss','toString','closed','closedAt','disposition','threadId','Public','Private','basename','existsSync','createReadStream','pipe','createWriteStream','direction','out','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','zip-dir','moment','util','path','ejs','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment'];(function(_0x244a27,_0x49a279){var _0x26c81e=function(_0x428c0d){while(--_0x428c0d){_0x244a27['push'](_0x244a27['shift']());}};_0x26c81e(++_0x49a279);}(_0xcbe8,0x1ed));var _0x8cbe=function(_0x4b232b,_0x26ed34){_0x4b232b=_0x4b232b-0x0;var _0x586088=_0xcbe8[_0x4b232b];return _0x586088;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x8cbe('0x0'));var moment=require(_0x8cbe('0x1'));var util=require(_0x8cbe('0x2'));var path=require(_0x8cbe('0x3'));var ejs=require(_0x8cbe('0x4'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0x8cbe('0x5'));var qs=require(_0x8cbe('0x6'));var pdf=require(_0x8cbe('0x7'));var logger=require(_0x8cbe('0x8'))(_0x8cbe('0x9'));var config=require(_0x8cbe('0xa'));var db=require(_0x8cbe('0xb'))['db'];config[_0x8cbe('0xc')]=_['defaults'](config[_0x8cbe('0xc')],{'host':_0x8cbe('0xd'),'port':0x18eb});var socket=require(_0x8cbe('0xe'))(new Redis(config[_0x8cbe('0xc')]));require('./openchannelInteraction.socket')['register'](socket);function respondWithStatusCode(_0x4d93a2,_0x5a8999){_0x5a8999=_0x5a8999||0xcc;return function(_0x4c0949){if(_0x4c0949){return _0x4d93a2[_0x8cbe('0xf')](_0x5a8999);}return _0x4d93a2[_0x8cbe('0x10')](_0x5a8999)[_0x8cbe('0x11')]();};}function respondWithResult(_0x2c0a21,_0x4cc6b5){_0x4cc6b5=_0x4cc6b5||0xc8;return function(_0x4e66bc){if(_0x4e66bc){return _0x2c0a21['status'](_0x4cc6b5)['json'](_0x4e66bc);}};}function respondWithFilteredResult(_0x27b9a8,_0x5c7861){return function(_0x2308fb){if(_0x2308fb){var _0x55ff13=typeof _0x5c7861[_0x8cbe('0x12')]===_0x8cbe('0x13')&&typeof _0x5c7861['limit']===_0x8cbe('0x13');var _0x574379=_0x2308fb[_0x8cbe('0x14')];var _0x22b5aa=_0x55ff13?0x0:_0x5c7861[_0x8cbe('0x12')];var _0x2861f2=_0x55ff13?_0x2308fb[_0x8cbe('0x14')]:_0x5c7861[_0x8cbe('0x12')]+_0x5c7861[_0x8cbe('0x15')];var _0x151252;if(_0x2861f2>=_0x574379){_0x2861f2=_0x574379;_0x151252=0xc8;}else{_0x151252=0xce;}_0x27b9a8[_0x8cbe('0x10')](_0x151252);return _0x27b9a8[_0x8cbe('0x16')](_0x8cbe('0x17'),_0x22b5aa+'-'+_0x2861f2+'/'+_0x574379)['json'](_0x2308fb);}return null;};}function saveUpdates(_0x1fe161){return function(_0x1a190a){if(_0x1a190a){return _0x1a190a[_0x8cbe('0x18')](_0x1fe161)[_0x8cbe('0x19')](function(_0x2d0c50){return _0x2d0c50;});}return null;};}function removeEntity(_0x1d4a02){return function(_0x19994b){if(_0x19994b){return _0x19994b[_0x8cbe('0x1a')]()[_0x8cbe('0x19')](function(){_0x1d4a02[_0x8cbe('0x10')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52a1b9){return function(_0x1741de){if(!_0x1741de){_0x52a1b9[_0x8cbe('0xf')](0x194);}return _0x1741de;};}function handleError(_0x45d978,_0x5f4a90){_0x5f4a90=_0x5f4a90||0x1f4;return function(_0x329db9){logger[_0x8cbe('0x1b')](_0x329db9[_0x8cbe('0x1c')]);if(_0x329db9['name']){delete _0x329db9[_0x8cbe('0x1d')];}_0x45d978[_0x8cbe('0x10')](_0x5f4a90)[_0x8cbe('0x1e')](_0x329db9);};}exports[_0x8cbe('0x1f')]=function(_0x3fa457,_0x5ce982){var _0x3abae0={};var _0x5666a5=_[_0x8cbe('0x20')](db['OpenchannelInteraction']['rawAttributes'],function(_0x4830d6){return{'name':_0x4830d6[_0x8cbe('0x21')],'type':_0x4830d6[_0x8cbe('0x22')][_0x8cbe('0x23')]};});_0x3abae0=qs[_0x8cbe('0x24')](_0x5666a5,_0x3fa457);return interaction['findAll'](_0x8cbe('0x25'),_0x3fa457['query'],_0x3fa457['user'],_0x3abae0,_0x5666a5)['then'](respondWithFilteredResult(_0x5ce982,_0x3abae0))[_0x8cbe('0x26')](handleError(_0x5ce982,null));};exports[_0x8cbe('0x27')]=function(_0x4af643,_0x4523fe){var _0x11dde2={};if(_0x4af643[_0x8cbe('0x28')]['type']&&_0x4af643[_0x8cbe('0x28')]['type']==='from'){_0x11dde2[_0x8cbe('0x29')]=_0x4af643[_0x8cbe('0x2a')]['id'];}else{_0x11dde2['id']=_0x4af643['params']['id'];}var _0x18e945={'raw':![],'where':_0x11dde2},_0x574a4a={};_0x574a4a[_0x8cbe('0x2b')]=_[_0x8cbe('0x2c')](db[_0x8cbe('0x2d')][_0x8cbe('0x2e')]);_0x574a4a[_0x8cbe('0x28')]=_['keys'](_0x4af643[_0x8cbe('0x28')]);_0x574a4a[_0x8cbe('0x2f')]=_[_0x8cbe('0x30')](_0x574a4a[_0x8cbe('0x2b')],_0x574a4a['query']);_0x18e945[_0x8cbe('0x31')]=_['intersection'](_0x574a4a[_0x8cbe('0x2b')],qs[_0x8cbe('0x32')](_0x4af643[_0x8cbe('0x28')][_0x8cbe('0x32')]));_0x18e945[_0x8cbe('0x31')]=_0x18e945['attributes'][_0x8cbe('0x33')]?_0x18e945[_0x8cbe('0x31')]:_0x574a4a[_0x8cbe('0x2b')];if(_0x4af643[_0x8cbe('0x28')]['includeAll']){_0x18e945[_0x8cbe('0x34')]=[{'all':!![]}];}_0x18e945=_[_0x8cbe('0x35')]({},_0x18e945,_0x4af643[_0x8cbe('0x36')]);return db['OpenchannelInteraction'][_0x8cbe('0x37')](_0x18e945)['then'](handleEntityNotFound(_0x4523fe,null))[_0x8cbe('0x19')](respondWithResult(_0x4523fe,null))[_0x8cbe('0x26')](handleError(_0x4523fe,null));};exports[_0x8cbe('0x38')]=function(_0x2d3b94,_0x21f9f4){return db[_0x8cbe('0x2d')][_0x8cbe('0x38')](_0x2d3b94[_0x8cbe('0x39')],{})[_0x8cbe('0x19')](respondWithResult(_0x21f9f4,0xc9))[_0x8cbe('0x26')](handleError(_0x21f9f4,null));};exports[_0x8cbe('0x18')]=function(_0x4e39e2,_0xbd231b){if(_0x4e39e2[_0x8cbe('0x39')]['id']){delete _0x4e39e2[_0x8cbe('0x39')]['id'];}return db[_0x8cbe('0x2d')][_0x8cbe('0x37')]({'where':{'id':_0x4e39e2[_0x8cbe('0x2a')]['id']}})[_0x8cbe('0x19')](handleEntityNotFound(_0xbd231b,null))[_0x8cbe('0x19')](saveUpdates(_0x4e39e2[_0x8cbe('0x39')],null))['then'](respondWithResult(_0xbd231b,null))[_0x8cbe('0x26')](handleError(_0xbd231b,null));};exports[_0x8cbe('0x1a')]=function(_0x4274ff,_0x4a6c56){return db[_0x8cbe('0x2d')]['find']({'where':{'id':_0x4274ff[_0x8cbe('0x2a')]['id']}})['then'](handleEntityNotFound(_0x4a6c56,null))[_0x8cbe('0x19')](removeEntity(_0x4a6c56,null))['catch'](handleError(_0x4a6c56,null));};exports['describe']=function(_0x243aa6,_0x123996){return db[_0x8cbe('0x2d')][_0x8cbe('0x3a')]()[_0x8cbe('0x19')](respondWithResult(_0x123996,null))[_0x8cbe('0x26')](handleError(_0x123996,null));};exports[_0x8cbe('0x3b')]=function(_0x52b450,_0x3115f5){return db['OpenchannelMessage'][_0x8cbe('0x37')]({'where':{'id':_0x52b450[_0x8cbe('0x2a')]['id']}})['then'](handleEntityNotFound(_0x3115f5,null))[_0x8cbe('0x19')](function(_0x1ed867){if(_0x1ed867){return _0x1ed867[_0x8cbe('0x3b')](_0x52b450['body'][_0x8cbe('0x3c')],_[_0x8cbe('0x3d')](_0x52b450[_0x8cbe('0x39')],[_0x8cbe('0x3c'),'id'])||{});}})[_0x8cbe('0x19')](respondWithResult(_0x3115f5,null))[_0x8cbe('0x26')](handleError(_0x3115f5,null));};exports['getMessages']=function(_0x42c996,_0x4874cd){var _0x3e516c={'raw':![],'where':{}};var _0x181d74={};var _0x368bae={'count':0x0,'rows':[]};return db[_0x8cbe('0x2d')][_0x8cbe('0x3e')]({'where':{'id':_0x42c996[_0x8cbe('0x2a')]['id']}})['then'](handleEntityNotFound(_0x4874cd,null))['then'](function(_0x570e72){if(_0x570e72){_0x181d74[_0x8cbe('0x2b')]=_[_0x8cbe('0x2c')](db[_0x8cbe('0x3f')][_0x8cbe('0x2e')]);_0x181d74[_0x8cbe('0x28')]=_[_0x8cbe('0x2c')](_0x42c996[_0x8cbe('0x28')]);_0x181d74[_0x8cbe('0x2f')]=_[_0x8cbe('0x30')](_0x181d74[_0x8cbe('0x2b')],_0x181d74[_0x8cbe('0x28')]);_0x3e516c[_0x8cbe('0x31')]=_[_0x8cbe('0x30')](_0x181d74[_0x8cbe('0x2b')],qs[_0x8cbe('0x32')](_0x42c996[_0x8cbe('0x28')][_0x8cbe('0x32')]));_0x3e516c[_0x8cbe('0x31')]=_0x3e516c[_0x8cbe('0x31')]['length']?_0x3e516c[_0x8cbe('0x31')]:_0x181d74[_0x8cbe('0x2b')];if(!_0x42c996[_0x8cbe('0x28')][_0x8cbe('0x40')]('nolimit')){_0x3e516c[_0x8cbe('0x15')]=qs[_0x8cbe('0x15')](_0x42c996[_0x8cbe('0x28')][_0x8cbe('0x15')]);_0x3e516c['offset']=qs[_0x8cbe('0x12')](_0x42c996['query'][_0x8cbe('0x12')]);}_0x3e516c[_0x8cbe('0x41')]=qs['sort'](_0x42c996[_0x8cbe('0x28')]['sort']);_0x3e516c[_0x8cbe('0x42')]=qs[_0x8cbe('0x2f')](_[_0x8cbe('0x43')](_0x42c996['query'],_0x181d74['filters']));_0x3e516c[_0x8cbe('0x42')][_0x8cbe('0x44')]=_0x570e72['id'];if(_0x42c996[_0x8cbe('0x28')]['filter']){_0x3e516c['where']=_[_0x8cbe('0x35')](_0x3e516c['where'],{'$or':_['map'](_0x3e516c[_0x8cbe('0x31')],function(_0x3a60e0){var _0x520e52={};_0x520e52[_0x3a60e0]={'$like':'%'+_0x42c996[_0x8cbe('0x28')][_0x8cbe('0x45')]+'%'};return _0x520e52;})});}if(_0x42c996[_0x8cbe('0x28')][_0x8cbe('0x46')]){var _0x1d7525=_0x42c996['query'][_0x8cbe('0x46')]['split'](',');var _0xb1e2f={};_0xb1e2f[_0x1d7525[0x0]]={'$gte':moment(_0x1d7525[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x3e516c[_0x8cbe('0x42')]=_[_0x8cbe('0x35')](_0x3e516c[_0x8cbe('0x42')],_0xb1e2f);}_0x3e516c=_['merge']({},_0x3e516c,_0x42c996[_0x8cbe('0x36')]);return db[_0x8cbe('0x3f')][_0x8cbe('0x14')]({'where':_0x3e516c['where']})[_0x8cbe('0x19')](function(_0x115f82){_0x368bae[_0x8cbe('0x14')]=_0x115f82;if(_0x42c996[_0x8cbe('0x28')][_0x8cbe('0x47')]){_0x3e516c[_0x8cbe('0x34')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x8cbe('0x48')](_0x3e516c);})[_0x8cbe('0x19')](function(_0x1a3334){_0x368bae[_0x8cbe('0x49')]=_0x1a3334;return _0x368bae;});}})[_0x8cbe('0x19')](respondWithFilteredResult(_0x4874cd,_0x3e516c))[_0x8cbe('0x26')](handleError(_0x4874cd,null));};exports[_0x8cbe('0x4a')]=function(_0x2fd568,_0x1a9e05){return db[_0x8cbe('0x2d')][_0x8cbe('0x37')]({'where':{'id':_0x2fd568[_0x8cbe('0x2a')]['id']}})[_0x8cbe('0x19')](handleEntityNotFound(_0x1a9e05,null))[_0x8cbe('0x19')](function(_0x5a37f9){if(_0x5a37f9){return _0x5a37f9[_0x8cbe('0x4b')](_0x2fd568['body'][_0x8cbe('0x3c')],_[_0x8cbe('0x3d')](_0x2fd568[_0x8cbe('0x39')],[_0x8cbe('0x3c'),'id'])||{})[_0x8cbe('0x4c')](function(){return db['Tag'][_0x8cbe('0x48')]({'attributes':['id',_0x8cbe('0x1d'),_0x8cbe('0x4d')],'where':{'id':_0x2fd568[_0x8cbe('0x39')][_0x8cbe('0x3c')]}});})['then'](function(_0x444c4b){socket['emit'](_0x8cbe('0x4e'),{'id':Number(_0x2fd568[_0x8cbe('0x2a')]['id']),'tags':_0x444c4b||[]});return{'id':Number(_0x2fd568[_0x8cbe('0x2a')]['id']),'tags':_0x444c4b||[]};});}})[_0x8cbe('0x19')](respondWithResult(_0x1a9e05,null))[_0x8cbe('0x26')](handleError(_0x1a9e05,null));};exports['removeTags']=function(_0x35675c,_0x2de9fd){return db[_0x8cbe('0x2d')][_0x8cbe('0x37')]({'where':{'id':_0x35675c['params']['id']}})[_0x8cbe('0x19')](handleEntityNotFound(_0x2de9fd,null))[_0x8cbe('0x19')](function(_0xdd1b3){if(_0xdd1b3){return _0xdd1b3[_0x8cbe('0x4f')](_0x35675c[_0x8cbe('0x28')][_0x8cbe('0x3c')]);}})['then'](respondWithStatusCode(_0x2de9fd,null))[_0x8cbe('0x26')](handleError(_0x2de9fd,null));};exports[_0x8cbe('0x50')]=function(_0xc0a19a,_0x404f40){var _0x118e22=moment()[_0x8cbe('0x51')]()['toString']();var _0x983ac4=path[_0x8cbe('0x52')](config[_0x8cbe('0x53')],_0x8cbe('0x54'),_0x8cbe('0x55'),_0x8cbe('0x56'));var _0x26b45d=path[_0x8cbe('0x52')](config['root'],'server',_0x8cbe('0x55'),'attachments');var _0xace39c=path['join'](_0x983ac4,_0x118e22);var _0x3b1e2d=util[_0x8cbe('0x57')]('transcript-%d-%s.zip',_0xc0a19a[_0x8cbe('0x2a')]['id'],_0x118e22);var _0x18b448=path[_0x8cbe('0x52')](_0x983ac4,_0x3b1e2d);var _0x2f4d1d=[];_0x2f4d1d['push']({'model':db[_0x8cbe('0x58')],'as':_0x8cbe('0x58'),'attributes':['id',_0x8cbe('0x59')],'raw':!![]});_0x2f4d1d[_0x8cbe('0x5a')]({'model':db['CmContact'],'as':_0x8cbe('0x5b'),'attributes':['id',_0x8cbe('0x5c'),_0x8cbe('0x5d')],'raw':!![]});if(_0xc0a19a['query']['attachments']){_0x2f4d1d[_0x8cbe('0x5a')]({'model':db['Attachment'],'as':_0x8cbe('0x5e'),'raw':!![]});}var _0x22d974=[{'model':db[_0x8cbe('0x3f')],'as':_0x8cbe('0x5f'),'attributes':['id',_0x8cbe('0x39'),'createdAt','direction',_0x8cbe('0x60'),_0x8cbe('0x61')],'include':_0x2f4d1d}];_0x22d974[_0x8cbe('0x5a')]({'model':db[_0x8cbe('0x62')],'as':'Account','attributes':['id','name']});_0x22d974['push']({'model':db[_0x8cbe('0x58')],'as':_0x8cbe('0x63'),'attributes':['id',_0x8cbe('0x59')]});return db[_0x8cbe('0x2d')]['find']({'where':{'id':_0xc0a19a[_0x8cbe('0x2a')]['id']},'include':_0x22d974})[_0x8cbe('0x19')](handleEntityNotFound(_0x404f40,null))[_0x8cbe('0x19')](function(_0x3f88f0){if(_0x3f88f0){var _0x360d11=_0x3f88f0[_0x8cbe('0x64')]({'plain':!![]});fs[_0x8cbe('0x65')](_0xace39c);var _0xf8e81f={'channel':_0x8cbe('0x66'),'account':_0x360d11[_0x8cbe('0x67')][_0x8cbe('0x1d')],'agent':_0x360d11['Owner']?_0x360d11[_0x8cbe('0x63')]['fullname']:_0x8cbe('0x68'),'createdAt':moment(_0x360d11[_0x8cbe('0x69')])[_0x8cbe('0x57')](_0x8cbe('0x6a'))[_0x8cbe('0x6b')](),'closedAt':_0x360d11[_0x8cbe('0x6c')]?moment(_0x360d11[_0x8cbe('0x6d')])['format'](_0x8cbe('0x6a'))[_0x8cbe('0x6b')]():'','disposition':_0x360d11[_0x8cbe('0x6e')],'visibility':_0x360d11[_0x8cbe('0x6f')]?_0x8cbe('0x70'):_0x8cbe('0x71'),'messages':_(_0x360d11[_0x8cbe('0x5f')])[_0x8cbe('0x45')]({'secret':![]})[_0x8cbe('0x20')](function(_0x48f65f){if(_0x48f65f[_0x8cbe('0x5e')]){var _0x413b33=path[_0x8cbe('0x52')](_0x26b45d,_0x48f65f[_0x8cbe('0x5e')][_0x8cbe('0x72')]);if(fs[_0x8cbe('0x73')](_0x413b33)){fs[_0x8cbe('0x74')](_0x413b33)[_0x8cbe('0x75')](fs[_0x8cbe('0x76')](path[_0x8cbe('0x52')](_0xace39c,_0x48f65f['Attachment'][_0x8cbe('0x72')])));}}return{'date':moment(_0x48f65f['createdAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x8cbe('0x6b')](),'sender':_0x48f65f[_0x8cbe('0x77')]==='out'?_0x48f65f[_0x8cbe('0x58')]?_0x48f65f[_0x8cbe('0x58')][_0x8cbe('0x59')]:'System':_0x48f65f[_0x8cbe('0x5b')]['firstName']+(_0x48f65f[_0x8cbe('0x5b')]['lastName']?'\x20'+_0x48f65f[_0x8cbe('0x5b')][_0x8cbe('0x5d')]:''),'body':_0x48f65f[_0x8cbe('0x5e')]?_0x48f65f[_0x8cbe('0x5e')][_0x8cbe('0x72')]:_0x48f65f['body'],'direction':_0x48f65f[_0x8cbe('0x77')]===_0x8cbe('0x78')?'A':'C','secret':_0x48f65f['secret'],'read':_0x48f65f[_0x8cbe('0x61')],'attachment':_0x48f65f[_0x8cbe('0x5e')]};})['value']()};return ejs[_0x8cbe('0x79')](path[_0x8cbe('0x52')](config[_0x8cbe('0x53')],'server',_0x8cbe('0x7a'),_0x8cbe('0x7b')),{'interaction':_0xf8e81f})[_0x8cbe('0x19')](function(_0x14d88f){var _0x550c78=path[_0x8cbe('0x52')](_0xace39c,'transcript-'+_0x360d11['id']+'-'+_0x118e22+_0x8cbe('0x7c'));var _0x39fdfa={'path':_0x550c78,'channel':_0x8cbe('0x66'),'interactionId':_0x360d11['id']};return pdf[_0x8cbe('0x7d')](_0x14d88f,_0x39fdfa);})[_0x8cbe('0x19')](function(){return new Promise(function(_0x77cdb9,_0x43f140){zipdir(_0xace39c,{'saveTo':_0x18b448},function(_0x25ca74,_0x17b381){if(_0x25ca74)return _0x43f140(_0x25ca74);return _0x77cdb9(_0x17b381);});})['then'](function(){return new Promise(function(_0x10cfa7,_0x4e0137){rimraf(_0xace39c,function(_0x4a38cd){if(_0x4a38cd)_0x4e0137(_0x4a38cd);return _0x10cfa7();});});})[_0x8cbe('0x19')](function(){return _0x404f40[_0x8cbe('0x50')](_0x18b448,_0x3b1e2d,function(_0x3836be){if(_0x3836be){logger[_0x8cbe('0x1b')]('Unable\x20to\x20delete\x20zip\x20file',_0x3836be);}else{fs['unlinkSync'](_0x18b448);}});});});}else{return _0x404f40[_0x8cbe('0xf')](0xc8);}})[_0x8cbe('0x26')](handleError(_0x404f40,null));}; \ No newline at end of file +var _0x2e57=['name','send','index','map','OpenchannelInteraction','fieldName','key','getOptions','openchannel','user','catch','show','type','from','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','create','body','find','describe','addMessage','OpenchannelMessage','omit','getMessages','hasOwnProperty','nolimit','order','sort','pick','where','OpenchannelInteractionId','filter','$gte','split','format','count','findAll','addTags','setTags','ids','spread','Tag','color','emit','removeTags','download','unix','toString','join','root','server','files','tmp','transcript-%d-%s.zip','push','User','firstName','Attachment','createdAt','direction','read','OpenchannelAccount','Account','fullname','get','mkdirSync','Owner','N.A.','closedAt','YYYY-MM-DD\x20HH:mm:ss','disposition','threadId','Public','Private','Messages','basename','createReadStream','pipe','createWriteStream','out','System','Contact','lastName','secret','value','renderFile','views','transcript-','.pdf','Openchannel','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','sendStatus','moment','util','path','ejs','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','defaults','localhost','register','status','end','json','offset','limit','undefined','set','Content-Range','update','then','destroy','error','stack'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2e57,0x6a));var _0x72e5=function(_0x48582d,_0x5520ff){_0x48582d=_0x48582d-0x0;var _0x4c76d6=_0x2e57[_0x48582d];return _0x4c76d6;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require(_0x72e5('0x0'));var util=require(_0x72e5('0x1'));var path=require(_0x72e5('0x2'));var ejs=require(_0x72e5('0x3'));var fs=require('fs');var _=require(_0x72e5('0x4'));var Redis=require(_0x72e5('0x5'));var interaction=require('../../components/interaction/service');var qs=require(_0x72e5('0x6'));var pdf=require(_0x72e5('0x7'));var logger=require(_0x72e5('0x8'))(_0x72e5('0x9'));var config=require('../../config/environment');var db=require(_0x72e5('0xa'))['db'];config[_0x72e5('0xb')]=_[_0x72e5('0xc')](config['redis'],{'host':_0x72e5('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x72e5('0xb')]));require('./openchannelInteraction.socket')[_0x72e5('0xe')](socket);function respondWithStatusCode(_0x1e483f,_0x2ea783){_0x2ea783=_0x2ea783||0xcc;return function(_0x42b78d){if(_0x42b78d){return _0x1e483f['sendStatus'](_0x2ea783);}return _0x1e483f[_0x72e5('0xf')](_0x2ea783)[_0x72e5('0x10')]();};}function respondWithResult(_0x2f42bd,_0x4a996b){_0x4a996b=_0x4a996b||0xc8;return function(_0x3bcdb6){if(_0x3bcdb6){return _0x2f42bd['status'](_0x4a996b)[_0x72e5('0x11')](_0x3bcdb6);}};}function respondWithFilteredResult(_0x275985,_0x16ed63){return function(_0xd729ad){if(_0xd729ad){var _0x34c9ac=typeof _0x16ed63[_0x72e5('0x12')]==='undefined'&&typeof _0x16ed63[_0x72e5('0x13')]===_0x72e5('0x14');var _0x266aca=_0xd729ad['count'];var _0x32748b=_0x34c9ac?0x0:_0x16ed63['offset'];var _0x23ef99=_0x34c9ac?_0xd729ad['count']:_0x16ed63[_0x72e5('0x12')]+_0x16ed63[_0x72e5('0x13')];var _0x2d7395;if(_0x23ef99>=_0x266aca){_0x23ef99=_0x266aca;_0x2d7395=0xc8;}else{_0x2d7395=0xce;}_0x275985[_0x72e5('0xf')](_0x2d7395);return _0x275985[_0x72e5('0x15')](_0x72e5('0x16'),_0x32748b+'-'+_0x23ef99+'/'+_0x266aca)[_0x72e5('0x11')](_0xd729ad);}return null;};}function saveUpdates(_0x5005db){return function(_0x4aa38b){if(_0x4aa38b){return _0x4aa38b[_0x72e5('0x17')](_0x5005db)[_0x72e5('0x18')](function(_0xe28caa){return _0xe28caa;});}return null;};}function removeEntity(_0x3b9481){return function(_0xb58073){if(_0xb58073){return _0xb58073[_0x72e5('0x19')]()[_0x72e5('0x18')](function(){_0x3b9481[_0x72e5('0xf')](0xcc)[_0x72e5('0x10')]();});}};}function handleEntityNotFound(_0x2d95f9){return function(_0x4517fe){if(!_0x4517fe){_0x2d95f9['sendStatus'](0x194);}return _0x4517fe;};}function handleError(_0x14d350,_0x22999f){_0x22999f=_0x22999f||0x1f4;return function(_0x436692){logger[_0x72e5('0x1a')](_0x436692[_0x72e5('0x1b')]);if(_0x436692[_0x72e5('0x1c')]){delete _0x436692[_0x72e5('0x1c')];}_0x14d350[_0x72e5('0xf')](_0x22999f)[_0x72e5('0x1d')](_0x436692);};}exports[_0x72e5('0x1e')]=function(_0x3609b6,_0x107e98){var _0x4770ec={};var _0xd50d5=_[_0x72e5('0x1f')](db[_0x72e5('0x20')]['rawAttributes'],function(_0xbbc8fc){return{'name':_0xbbc8fc[_0x72e5('0x21')],'type':_0xbbc8fc['type'][_0x72e5('0x22')]};});_0x4770ec=qs[_0x72e5('0x23')](_0xd50d5,_0x3609b6);return interaction['findAll'](_0x72e5('0x24'),_0x3609b6['query'],_0x3609b6[_0x72e5('0x25')],_0x4770ec,_0xd50d5)['then'](respondWithFilteredResult(_0x107e98,_0x4770ec))[_0x72e5('0x26')](handleError(_0x107e98,null));};exports[_0x72e5('0x27')]=function(_0x4eb721,_0x17a547){var _0x4bfe16={};if(_0x4eb721['query']['type']&&_0x4eb721['query'][_0x72e5('0x28')]==='from'){_0x4bfe16[_0x72e5('0x29')]=_0x4eb721[_0x72e5('0x2a')]['id'];}else{_0x4bfe16['id']=_0x4eb721[_0x72e5('0x2a')]['id'];}var _0x413d08={'raw':![],'where':_0x4bfe16},_0x2698cc={};_0x2698cc[_0x72e5('0x2b')]=_[_0x72e5('0x2c')](db['OpenchannelInteraction'][_0x72e5('0x2d')]);_0x2698cc[_0x72e5('0x2e')]=_[_0x72e5('0x2c')](_0x4eb721[_0x72e5('0x2e')]);_0x2698cc[_0x72e5('0x2f')]=_[_0x72e5('0x30')](_0x2698cc[_0x72e5('0x2b')],_0x2698cc[_0x72e5('0x2e')]);_0x413d08[_0x72e5('0x31')]=_[_0x72e5('0x30')](_0x2698cc['model'],qs[_0x72e5('0x32')](_0x4eb721[_0x72e5('0x2e')][_0x72e5('0x32')]));_0x413d08[_0x72e5('0x31')]=_0x413d08['attributes'][_0x72e5('0x33')]?_0x413d08[_0x72e5('0x31')]:_0x2698cc[_0x72e5('0x2b')];if(_0x4eb721[_0x72e5('0x2e')][_0x72e5('0x34')]){_0x413d08[_0x72e5('0x35')]=[{'all':!![]}];}_0x413d08=_[_0x72e5('0x36')]({},_0x413d08,_0x4eb721[_0x72e5('0x37')]);return db[_0x72e5('0x20')]['find'](_0x413d08)['then'](handleEntityNotFound(_0x17a547,null))[_0x72e5('0x18')](respondWithResult(_0x17a547,null))[_0x72e5('0x26')](handleError(_0x17a547,null));};exports[_0x72e5('0x38')]=function(_0x1b2ea6,_0x442f6e){return db[_0x72e5('0x20')]['create'](_0x1b2ea6[_0x72e5('0x39')],{})['then'](respondWithResult(_0x442f6e,0xc9))[_0x72e5('0x26')](handleError(_0x442f6e,null));};exports[_0x72e5('0x17')]=function(_0x5249f7,_0x2ffbc7){if(_0x5249f7[_0x72e5('0x39')]['id']){delete _0x5249f7['body']['id'];}return db[_0x72e5('0x20')][_0x72e5('0x3a')]({'where':{'id':_0x5249f7[_0x72e5('0x2a')]['id']}})['then'](handleEntityNotFound(_0x2ffbc7,null))[_0x72e5('0x18')](saveUpdates(_0x5249f7[_0x72e5('0x39')],null))[_0x72e5('0x18')](respondWithResult(_0x2ffbc7,null))[_0x72e5('0x26')](handleError(_0x2ffbc7,null));};exports[_0x72e5('0x19')]=function(_0xa20343,_0xdb73d5){return db[_0x72e5('0x20')][_0x72e5('0x3a')]({'where':{'id':_0xa20343[_0x72e5('0x2a')]['id']}})[_0x72e5('0x18')](handleEntityNotFound(_0xdb73d5,null))[_0x72e5('0x18')](removeEntity(_0xdb73d5,null))['catch'](handleError(_0xdb73d5,null));};exports[_0x72e5('0x3b')]=function(_0x77a328,_0x356890){return db[_0x72e5('0x20')]['describe']()[_0x72e5('0x18')](respondWithResult(_0x356890,null))[_0x72e5('0x26')](handleError(_0x356890,null));};exports[_0x72e5('0x3c')]=function(_0x5f8523,_0x16491a){return db[_0x72e5('0x3d')]['find']({'where':{'id':_0x5f8523[_0x72e5('0x2a')]['id']}})['then'](handleEntityNotFound(_0x16491a,null))[_0x72e5('0x18')](function(_0x45238d){if(_0x45238d){return _0x45238d['addMessage'](_0x5f8523[_0x72e5('0x39')]['ids'],_[_0x72e5('0x3e')](_0x5f8523[_0x72e5('0x39')],['ids','id'])||{});}})[_0x72e5('0x18')](respondWithResult(_0x16491a,null))[_0x72e5('0x26')](handleError(_0x16491a,null));};exports[_0x72e5('0x3f')]=function(_0x244e08,_0x345d38){var _0x1d43c3={'raw':![],'where':{}};var _0x11da00={};var _0x21d153={'count':0x0,'rows':[]};return db['OpenchannelInteraction']['findOne']({'where':{'id':_0x244e08[_0x72e5('0x2a')]['id']}})[_0x72e5('0x18')](handleEntityNotFound(_0x345d38,null))[_0x72e5('0x18')](function(_0x32cad0){if(_0x32cad0){_0x11da00[_0x72e5('0x2b')]=_[_0x72e5('0x2c')](db[_0x72e5('0x3d')][_0x72e5('0x2d')]);_0x11da00[_0x72e5('0x2e')]=_[_0x72e5('0x2c')](_0x244e08[_0x72e5('0x2e')]);_0x11da00['filters']=_[_0x72e5('0x30')](_0x11da00['model'],_0x11da00[_0x72e5('0x2e')]);_0x1d43c3['attributes']=_[_0x72e5('0x30')](_0x11da00['model'],qs[_0x72e5('0x32')](_0x244e08['query'][_0x72e5('0x32')]));_0x1d43c3['attributes']=_0x1d43c3['attributes'][_0x72e5('0x33')]?_0x1d43c3['attributes']:_0x11da00[_0x72e5('0x2b')];if(!_0x244e08[_0x72e5('0x2e')][_0x72e5('0x40')](_0x72e5('0x41'))){_0x1d43c3[_0x72e5('0x13')]=qs['limit'](_0x244e08[_0x72e5('0x2e')]['limit']);_0x1d43c3[_0x72e5('0x12')]=qs[_0x72e5('0x12')](_0x244e08[_0x72e5('0x2e')][_0x72e5('0x12')]);}_0x1d43c3[_0x72e5('0x42')]=qs[_0x72e5('0x43')](_0x244e08[_0x72e5('0x2e')][_0x72e5('0x43')]);_0x1d43c3['where']=qs[_0x72e5('0x2f')](_[_0x72e5('0x44')](_0x244e08[_0x72e5('0x2e')],_0x11da00[_0x72e5('0x2f')]));_0x1d43c3[_0x72e5('0x45')][_0x72e5('0x46')]=_0x32cad0['id'];if(_0x244e08[_0x72e5('0x2e')][_0x72e5('0x47')]){_0x1d43c3[_0x72e5('0x45')]=_[_0x72e5('0x36')](_0x1d43c3[_0x72e5('0x45')],{'$or':_[_0x72e5('0x1f')](_0x1d43c3[_0x72e5('0x31')],function(_0x558248){var _0x582393={};_0x582393[_0x558248]={'$like':'%'+_0x244e08[_0x72e5('0x2e')][_0x72e5('0x47')]+'%'};return _0x582393;})});}if(_0x244e08['query'][_0x72e5('0x48')]){var _0x5a8288=_0x244e08['query'][_0x72e5('0x48')][_0x72e5('0x49')](',');var _0xd2c873={};_0xd2c873[_0x5a8288[0x0]]={'$gte':moment(_0x5a8288[0x1])[_0x72e5('0x4a')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1d43c3[_0x72e5('0x45')]=_['merge'](_0x1d43c3[_0x72e5('0x45')],_0xd2c873);}_0x1d43c3=_[_0x72e5('0x36')]({},_0x1d43c3,_0x244e08[_0x72e5('0x37')]);return db['OpenchannelMessage'][_0x72e5('0x4b')]({'where':_0x1d43c3[_0x72e5('0x45')]})[_0x72e5('0x18')](function(_0x1d8000){_0x21d153[_0x72e5('0x4b')]=_0x1d8000;if(_0x244e08[_0x72e5('0x2e')][_0x72e5('0x34')]){_0x1d43c3[_0x72e5('0x35')]=[{'all':!![]}];}return db[_0x72e5('0x3d')][_0x72e5('0x4c')](_0x1d43c3);})['then'](function(_0x3501e6){_0x21d153['rows']=_0x3501e6;return _0x21d153;});}})[_0x72e5('0x18')](respondWithFilteredResult(_0x345d38,_0x1d43c3))['catch'](handleError(_0x345d38,null));};exports[_0x72e5('0x4d')]=function(_0x8b482,_0x31692a){return db[_0x72e5('0x20')][_0x72e5('0x3a')]({'where':{'id':_0x8b482[_0x72e5('0x2a')]['id']}})[_0x72e5('0x18')](handleEntityNotFound(_0x31692a,null))[_0x72e5('0x18')](function(_0x1b4677){if(_0x1b4677){return _0x1b4677[_0x72e5('0x4e')](_0x8b482[_0x72e5('0x39')]['ids'],_[_0x72e5('0x3e')](_0x8b482[_0x72e5('0x39')],[_0x72e5('0x4f'),'id'])||{})[_0x72e5('0x50')](function(){return db[_0x72e5('0x51')]['findAll']({'attributes':['id','name',_0x72e5('0x52')],'where':{'id':_0x8b482[_0x72e5('0x39')][_0x72e5('0x4f')]}});})[_0x72e5('0x18')](function(_0x239af4){socket[_0x72e5('0x53')]('openchannelInteractionTags:save',{'id':Number(_0x8b482[_0x72e5('0x2a')]['id']),'tags':_0x239af4||[]});return{'id':Number(_0x8b482[_0x72e5('0x2a')]['id']),'tags':_0x239af4||[]};});}})[_0x72e5('0x18')](respondWithResult(_0x31692a,null))[_0x72e5('0x26')](handleError(_0x31692a,null));};exports[_0x72e5('0x54')]=function(_0x4358aa,_0x3eb9a7){return db[_0x72e5('0x20')][_0x72e5('0x3a')]({'where':{'id':_0x4358aa[_0x72e5('0x2a')]['id']}})[_0x72e5('0x18')](handleEntityNotFound(_0x3eb9a7,null))[_0x72e5('0x18')](function(_0x391828){if(_0x391828){return _0x391828[_0x72e5('0x54')](_0x4358aa[_0x72e5('0x2e')][_0x72e5('0x4f')]);}})[_0x72e5('0x18')](respondWithStatusCode(_0x3eb9a7,null))['catch'](handleError(_0x3eb9a7,null));};exports[_0x72e5('0x55')]=function(_0x4b15e1,_0x1b205d){var _0x203bbf=moment()[_0x72e5('0x56')]()[_0x72e5('0x57')]();var _0x439e74=path[_0x72e5('0x58')](config[_0x72e5('0x59')],_0x72e5('0x5a'),_0x72e5('0x5b'),_0x72e5('0x5c'));var _0x123039=path[_0x72e5('0x58')](config[_0x72e5('0x59')],_0x72e5('0x5a'),_0x72e5('0x5b'),'attachments');var _0x39f9a5=path[_0x72e5('0x58')](_0x439e74,_0x203bbf);var _0x2c93b=util['format'](_0x72e5('0x5d'),_0x4b15e1[_0x72e5('0x2a')]['id'],_0x203bbf);var _0x36c2e3=path[_0x72e5('0x58')](_0x439e74,_0x2c93b);var _0x9ff93f=[];_0x9ff93f[_0x72e5('0x5e')]({'model':db[_0x72e5('0x5f')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x9ff93f[_0x72e5('0x5e')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0x72e5('0x60'),'lastName'],'raw':!![]});if(_0x4b15e1['query']['attachments']){_0x9ff93f[_0x72e5('0x5e')]({'model':db[_0x72e5('0x61')],'as':_0x72e5('0x61'),'raw':!![]});}var _0x2eb4ed=[{'model':db[_0x72e5('0x3d')],'as':'Messages','attributes':['id',_0x72e5('0x39'),_0x72e5('0x62'),_0x72e5('0x63'),'secret',_0x72e5('0x64')],'include':_0x9ff93f}];_0x2eb4ed[_0x72e5('0x5e')]({'model':db[_0x72e5('0x65')],'as':_0x72e5('0x66'),'attributes':['id','name']});_0x2eb4ed[_0x72e5('0x5e')]({'model':db['User'],'as':'Owner','attributes':['id',_0x72e5('0x67')]});return db[_0x72e5('0x20')]['find']({'where':{'id':_0x4b15e1[_0x72e5('0x2a')]['id']},'include':_0x2eb4ed})[_0x72e5('0x18')](handleEntityNotFound(_0x1b205d,null))['then'](function(_0x440d32){if(_0x440d32){var _0x2908d2=_0x440d32[_0x72e5('0x68')]({'plain':!![]});fs[_0x72e5('0x69')](_0x39f9a5);var _0x26a2b5={'channel':'Openchannel','account':_0x2908d2[_0x72e5('0x66')]['name'],'agent':_0x2908d2['Owner']?_0x2908d2[_0x72e5('0x6a')][_0x72e5('0x67')]:_0x72e5('0x6b'),'createdAt':moment(_0x2908d2['createdAt'])[_0x72e5('0x4a')]('YYYY-MM-DD\x20HH:mm:ss')[_0x72e5('0x57')](),'closedAt':_0x2908d2['closed']?moment(_0x2908d2[_0x72e5('0x6c')])['format'](_0x72e5('0x6d'))['toString']():'','disposition':_0x2908d2[_0x72e5('0x6e')],'visibility':_0x2908d2[_0x72e5('0x6f')]?_0x72e5('0x70'):_0x72e5('0x71'),'messages':_(_0x2908d2[_0x72e5('0x72')])[_0x72e5('0x47')]({'secret':![]})[_0x72e5('0x1f')](function(_0x444fb2){if(_0x444fb2[_0x72e5('0x61')]){var _0x10f9a1=path[_0x72e5('0x58')](_0x123039,_0x444fb2[_0x72e5('0x61')][_0x72e5('0x73')]);if(fs['existsSync'](_0x10f9a1)){fs[_0x72e5('0x74')](_0x10f9a1)[_0x72e5('0x75')](fs[_0x72e5('0x76')](path[_0x72e5('0x58')](_0x39f9a5,_0x444fb2[_0x72e5('0x61')][_0x72e5('0x73')])));}}return{'date':moment(_0x444fb2[_0x72e5('0x62')])[_0x72e5('0x4a')](_0x72e5('0x6d'))[_0x72e5('0x57')](),'sender':_0x444fb2['direction']===_0x72e5('0x77')?_0x444fb2['User']?_0x444fb2['User'][_0x72e5('0x67')]:_0x72e5('0x78'):_0x444fb2[_0x72e5('0x79')][_0x72e5('0x60')]+(_0x444fb2['Contact'][_0x72e5('0x7a')]?'\x20'+_0x444fb2[_0x72e5('0x79')][_0x72e5('0x7a')]:''),'body':_0x444fb2['Attachment']?_0x444fb2[_0x72e5('0x61')][_0x72e5('0x73')]:_0x444fb2[_0x72e5('0x39')],'direction':_0x444fb2['direction']==='out'?'A':'C','secret':_0x444fb2[_0x72e5('0x7b')],'read':_0x444fb2[_0x72e5('0x64')],'attachment':_0x444fb2[_0x72e5('0x61')]};})[_0x72e5('0x7c')]()};return ejs[_0x72e5('0x7d')](path[_0x72e5('0x58')](config[_0x72e5('0x59')],_0x72e5('0x5a'),_0x72e5('0x7e'),'downloadInteraction.ejs'),{'interaction':_0x26a2b5})[_0x72e5('0x18')](function(_0x4591ae){var _0x48b48a=path[_0x72e5('0x58')](_0x39f9a5,_0x72e5('0x7f')+_0x2908d2['id']+'-'+_0x203bbf+_0x72e5('0x80'));var _0x90bd95={'path':_0x48b48a,'channel':_0x72e5('0x81'),'interactionId':_0x2908d2['id']};return pdf[_0x72e5('0x82')](_0x4591ae,_0x90bd95);})['then'](function(){return new Promise(function(_0x37dec5,_0x5c04c1){zipdir(_0x39f9a5,{'saveTo':_0x36c2e3},function(_0x493419,_0x423b45){if(_0x493419)return _0x5c04c1(_0x493419);return _0x37dec5(_0x423b45);});})[_0x72e5('0x18')](function(){return new Promise(function(_0x3e443f,_0x1070b6){rimraf(_0x39f9a5,function(_0x48a69a){if(_0x48a69a)_0x1070b6(_0x48a69a);return _0x3e443f();});});})[_0x72e5('0x18')](function(){return _0x1b205d[_0x72e5('0x55')](_0x36c2e3,_0x2c93b,function(_0x5776f0){if(_0x5776f0){logger[_0x72e5('0x1a')](_0x72e5('0x83'),_0x5776f0);}else{fs[_0x72e5('0x84')](_0x36c2e3);}});});});}else{return _0x1b205d[_0x72e5('0x85')](0xc8);}})[_0x72e5('0x26')](handleError(_0x1b205d,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 2c40369..34c91b3 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 _0x2302=['OpenchannelMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','Users','map','findAll','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelInteraction'];(function(_0x2ba961,_0x26b1be){var _0x5a7e88=function(_0x5d25b9){while(--_0x5d25b9){_0x2ba961['push'](_0x2ba961['shift']());}};_0x5a7e88(++_0x26b1be);}(_0x2302,0xe7));var _0x2230=function(_0x41fb98,_0x470189){_0x41fb98=_0x41fb98-0x0;var _0x4b0044=_0x2302[_0x41fb98];return _0x4b0044;};'use strict';var EventEmitter=require(_0x2230('0x0'));var OpenchannelInteraction=require(_0x2230('0x1'))['db'][_0x2230('0x2')];var OpenchannelMessage=require(_0x2230('0x1'))['db'][_0x2230('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x2230('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2230('0x5'),'afterDestroy':_0x2230('0x6')};function emitEvent(_0x39d4e7){return function(_0x3b44b0,_0x454dea,_0x136c17){_0x3b44b0[_0x2230('0x7')]({'attributes':['id'],'raw':!![]})[_0x2230('0x8')](function(_0x7c6adc){_0x3b44b0[_0x2230('0x9')](_0x2230('0xa'),_0x7c6adc[_0x2230('0xb')](function(_0x513f17){return{'id':_0x513f17['id']};}));return OpenchannelMessage[_0x2230('0xc')]({'where':{'OpenchannelInteractionId':_0x3b44b0['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x455ea2){_0x3b44b0[_0x2230('0x9')]('unreadMessages',_0x455ea2['length']);OpenchannelInteractionEvents['emit'](_0x39d4e7+':'+_0x3b44b0['id'],_0x3b44b0);OpenchannelInteractionEvents[_0x2230('0xd')](_0x39d4e7,_0x3b44b0);_0x136c17(null);})[_0x2230('0xe')](_0x136c17(null));};}for(var e in events){if(events[_0x2230('0xf')](e)){var event=events[e];OpenchannelInteraction[_0x2230('0x10')](e,emitEvent(event));}}module[_0x2230('0x11')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x68f4=['emit','catch','hook','exports','events','../../mysqldb','OpenchannelInteraction','setMaxListeners','save','remove','then','Users','map','setDataValue','unreadMessages','length'];(function(_0x1ae31c,_0x8dcd2d){var _0x19519d=function(_0x22b8cd){while(--_0x22b8cd){_0x1ae31c['push'](_0x1ae31c['shift']());}};_0x19519d(++_0x8dcd2d);}(_0x68f4,0x114));var _0x468f=function(_0x3fe6df,_0x5a04d4){_0x3fe6df=_0x3fe6df-0x0;var _0x372a0e=_0x68f4[_0x3fe6df];return _0x372a0e;};'use strict';var EventEmitter=require(_0x468f('0x0'));var OpenchannelInteraction=require(_0x468f('0x1'))['db'][_0x468f('0x2')];var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x468f('0x3')](0x0);var events={'afterCreate':_0x468f('0x4'),'afterUpdate':'update','afterDestroy':_0x468f('0x5')};function emitEvent(_0x38cd14){return function(_0x102c30,_0xd013d6,_0x10090e){_0x102c30['getUsers']({'attributes':['id'],'raw':!![]})[_0x468f('0x6')](function(_0x5c5825){_0x102c30['setDataValue'](_0x468f('0x7'),_0x5c5825[_0x468f('0x8')](function(_0x7153df){return{'id':_0x7153df['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x102c30['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x508900){_0x102c30[_0x468f('0x9')](_0x468f('0xa'),_0x508900[_0x468f('0xb')]);OpenchannelInteractionEvents['emit'](_0x38cd14+':'+_0x102c30['id'],_0x102c30);OpenchannelInteractionEvents[_0x468f('0xc')](_0x38cd14,_0x102c30);_0x10090e(null);})[_0x468f('0xd')](_0x10090e(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x468f('0xe')](e,emitEvent(event));}}module[_0x468f('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 f037073..9a7e64d 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 _0x8587=['../../config/environment','./openchannelInteraction.attributes','exports','OpenchannelInteraction','utf8mb4_unicode_ci','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x1e79b4,_0x72c9d0){var _0x16d61b=function(_0x1dfd35){while(--_0x1dfd35){_0x1e79b4['push'](_0x1e79b4['shift']());}};_0x16d61b(++_0x72c9d0);}(_0x8587,0x1a1));var _0x7858=function(_0x764659,_0x2e97c4){_0x764659=_0x764659-0x0;var _0x445bf4=_0x8587[_0x764659];return _0x445bf4;};'use strict';var _=require(_0x7858('0x0'));var util=require(_0x7858('0x1'));var logger=require(_0x7858('0x2'))(_0x7858('0x3'));var moment=require('moment');var BPromise=require(_0x7858('0x4'));var rp=require(_0x7858('0x5'));var fs=require('fs');var path=require(_0x7858('0x6'));var rimraf=require(_0x7858('0x7'));var config=require(_0x7858('0x8'));var attributes=require(_0x7858('0x9'));module[_0x7858('0xa')]=function(_0x33b800,_0x23aec3){return _0x33b800['define'](_0x7858('0xb'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x7858('0xc'),'hooks':{'beforeUpdate':function(_0x51bd9e,_0x44dadc,_0x42c073){if(_0x51bd9e[_0x7858('0xd')]('closed')){_0x51bd9e[_0x7858('0xe')]=moment()[_0x7858('0xf')](_0x7858('0x10'));}_0x42c073(null,_0x51bd9e);}}});}; \ No newline at end of file +var _0x0931=['closedAt','format','lodash','api','request-promise','path','rimraf','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4_unicode_ci','closed'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x0931,0x16e));var _0x1093=function(_0x1c6622,_0x13a4b6){_0x1c6622=_0x1c6622-0x0;var _0x1ec3bb=_0x0931[_0x1c6622];return _0x1ec3bb;};'use strict';var _=require(_0x1093('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1093('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1093('0x2'));var fs=require('fs');var path=require(_0x1093('0x3'));var rimraf=require(_0x1093('0x4'));var config=require('../../config/environment');var attributes=require('./openchannelInteraction.attributes');module[_0x1093('0x5')]=function(_0x1ba4b4,_0x68deeb){return _0x1ba4b4[_0x1093('0x6')](_0x1093('0x7'),attributes,{'tableName':_0x1093('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x1093('0x9'),'hooks':{'beforeUpdate':function(_0x2f2a31,_0x9fddb5,_0x4936b7){if(_0x2f2a31['changed'](_0x1093('0xa'))){_0x2f2a31[_0x1093('0xb')]=moment()[_0x1093('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x4936b7(null,_0x2f2a31);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 7a10790..dea7406 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 _0x4d6c=['OpenchannelInteraction','update','options','raw','where','attributes','stringify','AddTagsToOpenchannelInteraction','body','ids','omit','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateOpenchannelInteraction'];(function(_0x1ea809,_0x4fa8bb){var _0x54be42=function(_0xe51094){while(--_0xe51094){_0x1ea809['push'](_0x1ea809['shift']());}};_0x54be42(++_0x4fa8bb);}(_0x4d6c,0x1b1));var _0xc4d6=function(_0x22592c,_0x5f08a){_0x22592c=_0x22592c-0x0;var _0x2fc9eb=_0x4d6c[_0x22592c];return _0x2fc9eb;};'use strict';var _=require(_0xc4d6('0x0'));var util=require(_0xc4d6('0x1'));var moment=require(_0xc4d6('0x2'));var BPromise=require('bluebird');var rs=require(_0xc4d6('0x3'));var fs=require('fs');var Redis=require(_0xc4d6('0x4'));var db=require(_0xc4d6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc4d6('0x6'))(_0xc4d6('0x7'));var config=require(_0xc4d6('0x8'));var jayson=require(_0xc4d6('0x9'));var client=jayson['client'][_0xc4d6('0xa')]({'port':0x232a});config['redis']=_[_0xc4d6('0xb')](config[_0xc4d6('0xc')],{'host':_0xc4d6('0xd'),'port':0x18eb});var socket=require(_0xc4d6('0xe'))(new Redis(config['redis']));require(_0xc4d6('0xf'))[_0xc4d6('0x10')](socket);function respondWithRpcPromise(_0x3686a0,_0x37f14e,_0x554b08){return new BPromise(function(_0x3c391e,_0x1053ec){return client['request'](_0x3686a0,_0x554b08)[_0xc4d6('0x11')](function(_0x31e604){logger[_0xc4d6('0x12')](_0xc4d6('0x13'),_0x37f14e,_0xc4d6('0x14'));logger[_0xc4d6('0x15')](_0xc4d6('0x16'),_0x37f14e,_0xc4d6('0x14'),JSON['stringify'](_0x31e604));if(_0x31e604['error']){if(_0x31e604[_0xc4d6('0x17')][_0xc4d6('0x18')]===0x1f4){logger[_0xc4d6('0x17')]('OpenchannelInteraction,\x20%s,\x20%s',_0x37f14e,_0x31e604[_0xc4d6('0x17')][_0xc4d6('0x19')]);return _0x1053ec(_0x31e604['error'][_0xc4d6('0x19')]);}logger['error'](_0xc4d6('0x13'),_0x37f14e,_0x31e604[_0xc4d6('0x17')][_0xc4d6('0x19')]);return _0x3c391e(_0x31e604['error'][_0xc4d6('0x19')]);}else{logger[_0xc4d6('0x12')](_0xc4d6('0x13'),_0x37f14e,_0xc4d6('0x14'));_0x3c391e(_0x31e604[_0xc4d6('0x1a')][_0xc4d6('0x19')]);}})[_0xc4d6('0x1b')](function(_0x978641){logger[_0xc4d6('0x17')]('OpenchannelInteraction,\x20%s,\x20%s',_0x37f14e,_0x978641);_0x1053ec(_0x978641);});});}exports[_0xc4d6('0x1c')]=function(_0x53c7f8){var _0x15c9d6=this;return new Promise(function(_0x54557b,_0x411ad8){return db[_0xc4d6('0x1d')][_0xc4d6('0x1e')](_0x53c7f8['body'],{'raw':_0x53c7f8[_0xc4d6('0x1f')]?_0x53c7f8[_0xc4d6('0x1f')][_0xc4d6('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53c7f8[_0xc4d6('0x1f')]?_0x53c7f8[_0xc4d6('0x1f')][_0xc4d6('0x21')]||null:null,'attributes':_0x53c7f8[_0xc4d6('0x1f')]?_0x53c7f8[_0xc4d6('0x1f')][_0xc4d6('0x22')]||null:null,'limit':_0x53c7f8[_0xc4d6('0x1f')]?_0x53c7f8[_0xc4d6('0x1f')]['limit']||null:null})[_0xc4d6('0x11')](function(_0x293e93){logger[_0xc4d6('0x12')](_0xc4d6('0x1c'),_0x53c7f8);logger[_0xc4d6('0x15')](_0xc4d6('0x1c'),_0x53c7f8,JSON[_0xc4d6('0x23')](_0x293e93));_0x54557b(_0x293e93);})[_0xc4d6('0x1b')](function(_0xa35715){logger[_0xc4d6('0x17')](_0xc4d6('0x1c'),_0xa35715['message'],_0x53c7f8);_0x411ad8(_0x15c9d6['error'](0x1f4,_0xa35715['message']));});});};exports[_0xc4d6('0x24')]=function(_0x3a96c3){return new Promise(function(_0x64095b,_0x446730){return db['OpenchannelInteraction']['find']({'where':_0x3a96c3[_0xc4d6('0x1f')]?_0x3a96c3[_0xc4d6('0x1f')]['where']||null:null})[_0xc4d6('0x11')](function(_0x5ec51a){if(_0x5ec51a){return _0x5ec51a['addTags'](_0x3a96c3[_0xc4d6('0x25')][_0xc4d6('0x26')],_[_0xc4d6('0x27')](_0x3a96c3[_0xc4d6('0x25')],[_0xc4d6('0x26'),'id'])||{});}})[_0xc4d6('0x28')](function(_0x343cf5){logger[_0xc4d6('0x12')](_0xc4d6('0x29'),_0x3a96c3);logger[_0xc4d6('0x15')](_0xc4d6('0x29'),_0x3a96c3,JSON[_0xc4d6('0x23')](_0x343cf5));_0x64095b(_0x343cf5);})[_0xc4d6('0x1b')](function(_0x5da958){logger[_0xc4d6('0x17')](_0xc4d6('0x29'),_0x5da958['message'],_0x3a96c3);_0x446730(_this[_0xc4d6('0x17')](0x1f4,_0x5da958['message']));});});}; \ No newline at end of file +var _0x4d73=['catch','OpenchannelInteraction','update','body','options','raw','where','attributes','limit','UpdateOpenchannelInteraction','find','addTags','ids','omit','spread','AddTags','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x4d73,0xf2));var _0x34d7=function(_0x181672,_0x1d614d){_0x181672=_0x181672-0x0;var _0x35100d=_0x4d73[_0x181672];return _0x35100d;};'use strict';var _=require(_0x34d7('0x0'));var util=require(_0x34d7('0x1'));var moment=require(_0x34d7('0x2'));var BPromise=require(_0x34d7('0x3'));var rs=require(_0x34d7('0x4'));var fs=require('fs');var Redis=require(_0x34d7('0x5'));var db=require(_0x34d7('0x6'))['db'];var utils=require(_0x34d7('0x7'));var logger=require(_0x34d7('0x8'))('rpc');var config=require(_0x34d7('0x9'));var jayson=require(_0x34d7('0xa'));var client=jayson['client'][_0x34d7('0xb')]({'port':0x232a});config[_0x34d7('0xc')]=_[_0x34d7('0xd')](config[_0x34d7('0xc')],{'host':_0x34d7('0xe'),'port':0x18eb});var socket=require(_0x34d7('0xf'))(new Redis(config['redis']));require(_0x34d7('0x10'))[_0x34d7('0x11')](socket);function respondWithRpcPromise(_0x2f051f,_0x4760f3,_0x5a96b7){return new BPromise(function(_0x2d4e4e,_0x3973ac){return client[_0x34d7('0x12')](_0x2f051f,_0x5a96b7)[_0x34d7('0x13')](function(_0x526bd2){logger['info'](_0x34d7('0x14'),_0x4760f3,'request\x20sent');logger[_0x34d7('0x15')](_0x34d7('0x16'),_0x4760f3,_0x34d7('0x17'),JSON['stringify'](_0x526bd2));if(_0x526bd2[_0x34d7('0x18')]){if(_0x526bd2[_0x34d7('0x18')][_0x34d7('0x19')]===0x1f4){logger['error'](_0x34d7('0x14'),_0x4760f3,_0x526bd2[_0x34d7('0x18')][_0x34d7('0x1a')]);return _0x3973ac(_0x526bd2['error'][_0x34d7('0x1a')]);}logger[_0x34d7('0x18')]('OpenchannelInteraction,\x20%s,\x20%s',_0x4760f3,_0x526bd2['error'][_0x34d7('0x1a')]);return _0x2d4e4e(_0x526bd2[_0x34d7('0x18')][_0x34d7('0x1a')]);}else{logger[_0x34d7('0x1b')](_0x34d7('0x14'),_0x4760f3,_0x34d7('0x17'));_0x2d4e4e(_0x526bd2['result']['message']);}})[_0x34d7('0x1c')](function(_0x5db778){logger[_0x34d7('0x18')]('OpenchannelInteraction,\x20%s,\x20%s',_0x4760f3,_0x5db778);_0x3973ac(_0x5db778);});});}exports['UpdateOpenchannelInteraction']=function(_0x441f72){var _0x2646ed=this;return new Promise(function(_0x54b09d,_0x5ac819){return db[_0x34d7('0x1d')][_0x34d7('0x1e')](_0x441f72[_0x34d7('0x1f')],{'raw':_0x441f72['options']?_0x441f72[_0x34d7('0x20')][_0x34d7('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x441f72[_0x34d7('0x20')]?_0x441f72[_0x34d7('0x20')][_0x34d7('0x22')]||null:null,'attributes':_0x441f72[_0x34d7('0x20')]?_0x441f72[_0x34d7('0x20')][_0x34d7('0x23')]||null:null,'limit':_0x441f72['options']?_0x441f72[_0x34d7('0x20')][_0x34d7('0x24')]||null:null})[_0x34d7('0x13')](function(_0x1a16a0){logger[_0x34d7('0x1b')](_0x34d7('0x25'),_0x441f72);logger[_0x34d7('0x15')]('UpdateOpenchannelInteraction',_0x441f72,JSON['stringify'](_0x1a16a0));_0x54b09d(_0x1a16a0);})[_0x34d7('0x1c')](function(_0x6b08aa){logger[_0x34d7('0x18')](_0x34d7('0x25'),_0x6b08aa['message'],_0x441f72);_0x5ac819(_0x2646ed['error'](0x1f4,_0x6b08aa[_0x34d7('0x1a')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x1bc11a){return new Promise(function(_0x5f5213,_0x59b3f0){return db[_0x34d7('0x1d')][_0x34d7('0x26')]({'where':_0x1bc11a[_0x34d7('0x20')]?_0x1bc11a[_0x34d7('0x20')][_0x34d7('0x22')]||null:null})[_0x34d7('0x13')](function(_0x3c87ea){if(_0x3c87ea){return _0x3c87ea[_0x34d7('0x27')](_0x1bc11a[_0x34d7('0x1f')][_0x34d7('0x28')],_[_0x34d7('0x29')](_0x1bc11a[_0x34d7('0x1f')],[_0x34d7('0x28'),'id'])||{});}})[_0x34d7('0x2a')](function(_0x12ee14){logger['info'](_0x34d7('0x2b'),_0x1bc11a);logger[_0x34d7('0x15')](_0x34d7('0x2b'),_0x1bc11a,JSON[_0x34d7('0x2c')](_0x12ee14));_0x5f5213(_0x12ee14);})[_0x34d7('0x1c')](function(_0x236666){logger[_0x34d7('0x18')]('AddTags',_0x236666[_0x34d7('0x1a')],_0x1bc11a);_0x59b3f0(_this[_0x34d7('0x18')](0x1f4,_0x236666['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index c72388b..3b8c10d 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 _0x6f8a=['emit','register','length','openchannelInteraction:','./openchannelInteraction.events','remove','update'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0x6f8a,0xeb));var _0xa6f8=function(_0xe13b30,_0x5ed38a){_0xe13b30=_0xe13b30-0x0;var _0x479a33=_0x6f8a[_0xe13b30];return _0x479a33;};'use strict';var OpenchannelInteractionEvents=require(_0xa6f8('0x0'));var events=['save',_0xa6f8('0x1'),_0xa6f8('0x2')];function createListener(_0x5ee199,_0x5c47e2){return function(_0x2fbc73){_0x5c47e2[_0xa6f8('0x3')](_0x5ee199,_0x2fbc73);};}function removeListener(_0x5be027,_0x47e1f0){return function(){OpenchannelInteractionEvents['removeListener'](_0x5be027,_0x47e1f0);};}exports[_0xa6f8('0x4')]=function(_0xf5015){for(var _0x5787fc=0x0,_0x7a782e=events[_0xa6f8('0x5')];_0x5787fc<_0x7a782e;_0x5787fc++){var _0x4b8653=events[_0x5787fc];var _0x169342=createListener(_0xa6f8('0x6')+_0x4b8653,_0xf5015);OpenchannelInteractionEvents['on'](_0x4b8653,_0x169342);}}; \ No newline at end of file +var _0xef6e=['remove','update','emit','register','length','openchannelInteraction:','./openchannelInteraction.events','save'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xef6e,0xee));var _0xeef6=function(_0xad5769,_0x2530ca){_0xad5769=_0xad5769-0x0;var _0x476fed=_0xef6e[_0xad5769];return _0x476fed;};'use strict';var OpenchannelInteractionEvents=require(_0xeef6('0x0'));var events=[_0xeef6('0x1'),_0xeef6('0x2'),_0xeef6('0x3')];function createListener(_0x578cd6,_0x2bac83){return function(_0x4de7cb){_0x2bac83[_0xeef6('0x4')](_0x578cd6,_0x4de7cb);};}function removeListener(_0x396901,_0x121145){return function(){OpenchannelInteractionEvents['removeListener'](_0x396901,_0x121145);};}exports[_0xeef6('0x5')]=function(_0x519698){for(var _0x3365c8=0x0,_0x1fcfad=events[_0xeef6('0x6')];_0x3365c8<_0x1fcfad;_0x3365c8++){var _0x193cbd=events[_0x3365c8];var _0xcb6d4=createListener(_0xeef6('0x7')+_0x193cbd,_0x519698);OpenchannelInteractionEvents['on'](_0x193cbd,_0xcb6d4);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 1e54f73..edcd787 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(_0x153458,_0x24ee17){var _0x5d6da7=function(_0x9e96f6){while(--_0x9e96f6){_0x153458['push'](_0x153458['shift']());}};_0x5d6da7(++_0x24ee17);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'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 _0x9c44=['index','get','/describe','/:id','show','tracked','openchannel','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelMessage.controller','isAuthenticated'];(function(_0x3564d8,_0x167f6d){var _0x14fbcc=function(_0x299432){while(--_0x299432){_0x3564d8['push'](_0x3564d8['shift']());}};_0x14fbcc(++_0x167f6d);}(_0x9c44,0x178));var _0x49c4=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x9c44[_0x5d2803];return _0xdcad2c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['describe']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x49c4('0xd')](_0x49c4('0xe'),'openchannelmessage:create'),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0x11')]);router[_0x49c4('0x10')]('/:id/accept',auth[_0x49c4('0x7')](),controller[_0x49c4('0x12')]);router['put'](_0x49c4('0x13'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);router[_0x49c4('0x15')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x16')]);module[_0x49c4('0x17')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index b4d14d8..460567f 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 _0x6ea9=['STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x2a6252,_0x7b6f66){var _0x50bb13=function(_0x554ffc){while(--_0x554ffc){_0x2a6252['push'](_0x2a6252['shift']());}};_0x50bb13(++_0x7b6f66);}(_0x6ea9,0x89));var _0x96ea=function(_0x4a3f3d,_0x4ab2c0){_0x4a3f3d=_0x4a3f3d-0x0;var _0x57b577=_0x6ea9[_0x4a3f3d];return _0x57b577;};'use strict';var Sequelize=require(_0x96ea('0x0'));module[_0x96ea('0x1')]={'body':{'type':Sequelize[_0x96ea('0x2')](_0x96ea('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x96ea('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x96ea('0x5')]('in',_0x96ea('0x6')),'defaultValue':_0x96ea('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x96ea('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x566f=['ENUM','out','DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x16bd14,_0x214dfd){var _0x496083=function(_0x36e630){while(--_0x36e630){_0x16bd14['push'](_0x16bd14['shift']());}};_0x496083(++_0x214dfd);}(_0x566f,0x124));var _0xf566=function(_0x5f2b47,_0x19e1e7){_0x5f2b47=_0x5f2b47-0x0;var _0x2fcf51=_0x566f[_0x5f2b47];return _0x2fcf51;};'use strict';var Sequelize=require(_0xf566('0x0'));module[_0xf566('0x1')]={'body':{'type':Sequelize[_0xf566('0x2')](_0xf566('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xf566('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xf566('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xf566('0x5')]('in',_0xf566('0x6')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xf566('0x7')]},'providerName':{'type':Sequelize[_0xf566('0x8')]},'providerResponse':{'type':Sequelize[_0xf566('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 8365d5b..a60c1b7 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 _0x386f=['motionChannel','EventManager','acceptmessage','reject','openchannel','rejectMessage','QueryTypes','contact','fullname','SIP/%s','event','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','http','request','then','request\x20sent','debug','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','info','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','name','send','index','OpenchannelMessage','rawAttributes','fieldName','type','query','filters','model','attributes','fields','length','nolimit','order','sort','where','pick','merge','map','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','keys','intersection','create','body','find','describe','openchannel-interactions','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','format','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','SELECT','email','internal','manual','interface','channel'];(function(_0x2425ed,_0x3a6637){var _0x8ce321=function(_0x3bcef7){while(--_0x3bcef7){_0x2425ed['push'](_0x2425ed['shift']());}};_0x8ce321(++_0x3a6637);}(_0x386f,0x11a));var _0xf386=function(_0x13160e,_0x444ab5){_0x13160e=_0x13160e-0x0;var _0x402e7a=_0x386f[_0x13160e];return _0x402e7a;};'use strict';var emlformat=require(_0xf386('0x0'));var rimraf=require(_0xf386('0x1'));var zipdir=require(_0xf386('0x2'));var jsonpatch=require(_0xf386('0x3'));var rp=require(_0xf386('0x4'));var moment=require(_0xf386('0x5'));var BPromise=require(_0xf386('0x6'));var Mustache=require(_0xf386('0x7'));var util=require(_0xf386('0x8'));var path=require('path');var sox=require(_0xf386('0x9'));var csv=require('to-csv');var ejs=require(_0xf386('0xa'));var fs=require('fs');var fs_extra=require(_0xf386('0xb'));var _=require(_0xf386('0xc'));var squel=require(_0xf386('0xd'));var crypto=require(_0xf386('0xe'));var jsforce=require(_0xf386('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xf386('0x10'));var querystring=require(_0xf386('0x11'));var Papa=require(_0xf386('0x12'));var Redis=require(_0xf386('0x13'));var authService=require(_0xf386('0x14'));var qs=require(_0xf386('0x15'));var as=require(_0xf386('0x16'));var hardwareService=require(_0xf386('0x17'));var logger=require('../../config/logger')(_0xf386('0x18'));var utils=require(_0xf386('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xf386('0x1a'));var db=require(_0xf386('0x1b'))['db'];config[_0xf386('0x1c')]=_[_0xf386('0x1d')](config[_0xf386('0x1c')],{'host':_0xf386('0x1e'),'port':0x18eb});var socket=require(_0xf386('0x1f'))(new Redis(config[_0xf386('0x1c')]));require(_0xf386('0x20'))[_0xf386('0x21')](socket);var jayson=require(_0xf386('0x22'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client'][_0xf386('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x413eb9,_0x12309c,_0x11f043,_0x17c22b){return new BPromise(function(_0x5344f1,_0x2e881a){var _0x22794f=_0x17c22b||client;return _0x22794f[_0xf386('0x24')](_0x413eb9,_0x11f043)[_0xf386('0x25')](function(_0x512986){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x12309c,_0xf386('0x26'));logger[_0xf386('0x27')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x12309c,'request\x20sent',JSON[_0xf386('0x28')](_0x512986));if(_0x512986[_0xf386('0x29')]){if(_0x512986[_0xf386('0x29')][_0xf386('0x2a')]===0x1f4){logger[_0xf386('0x29')](_0xf386('0x2b'),_0x12309c,_0x512986['error'][_0xf386('0x2c')]);return _0x2e881a(_0x512986[_0xf386('0x29')][_0xf386('0x2c')]);}logger['error'](_0xf386('0x2b'),_0x12309c,_0x512986[_0xf386('0x29')][_0xf386('0x2c')]);return _0x5344f1(_0x512986['error']['message']);}else{logger[_0xf386('0x2d')](_0xf386('0x2b'),_0x12309c,_0xf386('0x26'));_0x5344f1(_0x512986['result'][_0xf386('0x2c')]);}})[_0xf386('0x2e')](function(_0x41ba23){logger[_0xf386('0x29')](_0xf386('0x2b'),_0x12309c,_0x41ba23);_0x2e881a(_0x41ba23);});});}function respondWithStatusCode(_0x55b4db,_0xf17e25){_0xf17e25=_0xf17e25||0xcc;return function(_0x221714){if(_0x221714){return _0x55b4db[_0xf386('0x2f')](_0xf17e25);}return _0x55b4db[_0xf386('0x30')](_0xf17e25)[_0xf386('0x31')]();};}function respondWithResult(_0x1cd98c,_0x336f5f){_0x336f5f=_0x336f5f||0xc8;return function(_0x167e38){if(_0x167e38){return _0x1cd98c['status'](_0x336f5f)[_0xf386('0x32')](_0x167e38);}};}function respondWithFilteredResult(_0x182a2c,_0x1b74de){return function(_0x2c5947){if(_0x2c5947){var _0x2b622d=typeof _0x1b74de[_0xf386('0x33')]===_0xf386('0x34')&&typeof _0x1b74de['limit']===_0xf386('0x34');var _0x3dd17b=_0x2c5947[_0xf386('0x35')];var _0xbf880b=_0x2b622d?0x0:_0x1b74de[_0xf386('0x33')];var _0x4c4521=_0x2b622d?_0x2c5947[_0xf386('0x35')]:_0x1b74de[_0xf386('0x33')]+_0x1b74de[_0xf386('0x36')];var _0xe4721d;if(_0x4c4521>=_0x3dd17b){_0x4c4521=_0x3dd17b;_0xe4721d=0xc8;}else{_0xe4721d=0xce;}_0x182a2c[_0xf386('0x30')](_0xe4721d);return _0x182a2c[_0xf386('0x37')](_0xf386('0x38'),_0xbf880b+'-'+_0x4c4521+'/'+_0x3dd17b)[_0xf386('0x32')](_0x2c5947);}return null;};}function patchUpdates(_0x71e143){return function(_0x307dfe){try{jsonpatch[_0xf386('0x39')](_0x307dfe,_0x71e143,!![]);}catch(_0x30334c){return BPromise['reject'](_0x30334c);}return _0x307dfe[_0xf386('0x3a')]();};}function saveUpdates(_0x578741,_0x5592ed){return function(_0x12d5ba){if(_0x12d5ba){return _0x12d5ba[_0xf386('0x3b')](_0x578741)['then'](function(_0x369aa7){return _0x369aa7;});}return null;};}function removeEntity(_0x4589ff,_0x8caac8){return function(_0x212f14){if(_0x212f14){return _0x212f14[_0xf386('0x3c')]()['then'](function(){_0x4589ff[_0xf386('0x30')](0xcc)[_0xf386('0x31')]();});}};}function handleEntityNotFound(_0x44762b,_0x1525da){return function(_0xc05447){if(!_0xc05447){_0x44762b[_0xf386('0x2f')](0x194);}return _0xc05447;};}function handleError(_0x27c2ff,_0xc82f35){_0xc82f35=_0xc82f35||0x1f4;return function(_0x3c6bfd){logger[_0xf386('0x29')](_0x3c6bfd['stack']);if(_0x3c6bfd[_0xf386('0x3d')]){delete _0x3c6bfd[_0xf386('0x3d')];}_0x27c2ff[_0xf386('0x30')](_0xc82f35)[_0xf386('0x3e')](_0x3c6bfd);};}exports[_0xf386('0x3f')]=function(_0x4a4ad8,_0x4f3f56){var _0x4523be={},_0x1a9435={},_0x4632b2={'count':0x0,'rows':[]};var _0x468980=_['map'](db[_0xf386('0x40')][_0xf386('0x41')],function(_0x5ec625){return{'name':_0x5ec625[_0xf386('0x42')],'type':_0x5ec625[_0xf386('0x43')]['key']};});_0x1a9435['model']=_['map'](_0x468980,_0xf386('0x3d'));_0x1a9435[_0xf386('0x44')]=_['keys'](_0x4a4ad8['query']);_0x1a9435[_0xf386('0x45')]=_['intersection'](_0x1a9435[_0xf386('0x46')],_0x1a9435[_0xf386('0x44')]);_0x4523be[_0xf386('0x47')]=_['intersection'](_0x1a9435[_0xf386('0x46')],qs[_0xf386('0x48')](_0x4a4ad8[_0xf386('0x44')][_0xf386('0x48')]));_0x4523be[_0xf386('0x47')]=_0x4523be[_0xf386('0x47')][_0xf386('0x49')]?_0x4523be[_0xf386('0x47')]:_0x1a9435[_0xf386('0x46')];if(!_0x4a4ad8[_0xf386('0x44')]['hasOwnProperty'](_0xf386('0x4a'))){_0x4523be[_0xf386('0x36')]=qs[_0xf386('0x36')](_0x4a4ad8[_0xf386('0x44')][_0xf386('0x36')]);_0x4523be['offset']=qs[_0xf386('0x33')](_0x4a4ad8[_0xf386('0x44')][_0xf386('0x33')]);}_0x4523be[_0xf386('0x4b')]=qs[_0xf386('0x4c')](_0x4a4ad8['query'][_0xf386('0x4c')]);_0x4523be[_0xf386('0x4d')]=qs['filters'](_[_0xf386('0x4e')](_0x4a4ad8['query'],_0x1a9435['filters']),_0x468980);if(_0x4a4ad8['query']['filter']){_0x4523be[_0xf386('0x4d')]=_[_0xf386('0x4f')](_0x4523be[_0xf386('0x4d')],{'$or':_[_0xf386('0x50')](_0x468980,function(_0x2ae992){if(_0x2ae992[_0xf386('0x43')]!==_0xf386('0x51')){var _0x3556d7={};_0x3556d7[_0x2ae992['name']]={'$like':'%'+_0x4a4ad8[_0xf386('0x44')][_0xf386('0x52')]+'%'};return _0x3556d7;}})});}_0x4523be=_['merge']({},_0x4523be,_0x4a4ad8[_0xf386('0x53')]);var _0x126584={'where':_0x4523be[_0xf386('0x4d')]};return db[_0xf386('0x40')][_0xf386('0x35')](_0x126584)[_0xf386('0x25')](function(_0x24859f){_0x4632b2[_0xf386('0x35')]=_0x24859f;if(_0x4a4ad8[_0xf386('0x44')][_0xf386('0x54')]){_0x4523be['include']=[{'all':!![]}];}return db['OpenchannelMessage'][_0xf386('0x55')](_0x4523be);})[_0xf386('0x25')](function(_0x279c9d){_0x4632b2[_0xf386('0x56')]=_0x279c9d;return _0x4632b2;})['then'](respondWithFilteredResult(_0x4f3f56,_0x4523be))[_0xf386('0x2e')](handleError(_0x4f3f56,null));};exports[_0xf386('0x57')]=function(_0xaf899a,_0x2db26e){var _0xe10e3a={'raw':!![],'where':{'id':_0xaf899a[_0xf386('0x58')]['id']}},_0x1bbc2b={};_0x1bbc2b['model']=_[_0xf386('0x59')](db[_0xf386('0x40')][_0xf386('0x41')]);_0x1bbc2b['query']=_[_0xf386('0x59')](_0xaf899a['query']);_0x1bbc2b[_0xf386('0x45')]=_[_0xf386('0x5a')](_0x1bbc2b[_0xf386('0x46')],_0x1bbc2b['query']);_0xe10e3a[_0xf386('0x47')]=_['intersection'](_0x1bbc2b['model'],qs[_0xf386('0x48')](_0xaf899a['query']['fields']));_0xe10e3a[_0xf386('0x47')]=_0xe10e3a[_0xf386('0x47')]['length']?_0xe10e3a[_0xf386('0x47')]:_0x1bbc2b[_0xf386('0x46')];if(_0xaf899a['query']['includeAll']){_0xe10e3a['include']=[{'all':!![]}];}_0xe10e3a=_[_0xf386('0x4f')]({},_0xe10e3a,_0xaf899a[_0xf386('0x53')]);return db['OpenchannelMessage']['find'](_0xe10e3a)[_0xf386('0x25')](handleEntityNotFound(_0x2db26e,null))[_0xf386('0x25')](respondWithResult(_0x2db26e,null))[_0xf386('0x2e')](handleError(_0x2db26e,null));};exports['create']=function(_0x51fca7,_0x137ba6){return db['OpenchannelMessage'][_0xf386('0x5b')](_0x51fca7[_0xf386('0x5c')],{})[_0xf386('0x25')](respondWithResult(_0x137ba6,0xc9))[_0xf386('0x2e')](handleError(_0x137ba6,null));};exports[_0xf386('0x3b')]=function(_0x258be3,_0x5975ee){if(_0x258be3[_0xf386('0x5c')]['id']){delete _0x258be3[_0xf386('0x5c')]['id'];}return db[_0xf386('0x40')][_0xf386('0x5d')]({'where':{'id':_0x258be3[_0xf386('0x58')]['id']}})[_0xf386('0x25')](handleEntityNotFound(_0x5975ee,null))[_0xf386('0x25')](saveUpdates(_0x258be3[_0xf386('0x5c')],null))[_0xf386('0x25')](respondWithResult(_0x5975ee,null))[_0xf386('0x2e')](handleError(_0x5975ee,null));};exports[_0xf386('0x3c')]=function(_0x42c7b0,_0x53bea7){return db[_0xf386('0x40')][_0xf386('0x5d')]({'where':{'id':_0x42c7b0['params']['id']}})['then'](handleEntityNotFound(_0x53bea7,null))['then'](removeEntity(_0x53bea7,null))[_0xf386('0x2e')](handleError(_0x53bea7,null));};exports[_0xf386('0x5e')]=function(_0x5dd255,_0x281eea){return db[_0xf386('0x40')][_0xf386('0x5e')]()[_0xf386('0x25')](respondWithResult(_0x281eea,null))[_0xf386('0x2e')](handleError(_0x281eea,null));};var interaction_log=require('../../config/logger')(_0xf386('0x5f'));exports[_0xf386('0x60')]=function(_0x5269a1,_0x4ec70e,_0x4dfe9e){var _0x4eeb12={'agent':{},'channel':'openchannel'};if(_0x5269a1[_0xf386('0x5c')]['id']){delete _0x5269a1[_0xf386('0x5c')]['id'];}_0x5269a1[_0xf386('0x5c')][_0xf386('0x61')]=!![];_0x5269a1[_0xf386('0x5c')][_0xf386('0x62')]=moment()['format'](_0xf386('0x63'));_0x5269a1['body'][_0xf386('0x64')]=_0x5269a1['body'][_0xf386('0x64')]||_0x5269a1['user']['id'];_0x4eeb12[_0xf386('0x65')]['id']=_0x5269a1[_0xf386('0x5c')][_0xf386('0x64')];return db[_0xf386('0x40')]['find']({'where':{'id':_0x5269a1[_0xf386('0x58')]['id'],'UserId':null}})[_0xf386('0x25')](handleEntityNotFound(_0x4ec70e,null))[_0xf386('0x25')](saveUpdates(_0x5269a1[_0xf386('0x5c')],null))[_0xf386('0x25')](function(_0x13db19){if(_0x13db19){_0x4eeb12[_0xf386('0x2c')]=_0x13db19[_0xf386('0x66')]({'plain':!![]});return db[_0xf386('0x67')][_0xf386('0x5d')]({'where':{'id':_0x13db19[_0xf386('0x68')]}});}return null;})[_0xf386('0x25')](handleEntityNotFound(_0x4ec70e,null))[_0xf386('0x25')](function(_0x8c80f1){if(_0x8c80f1){return _0x8c80f1[_0xf386('0x3b')]({'UserId':_0x5269a1[_0xf386('0x5c')][_0xf386('0x64')],'read1stAt':_[_0xf386('0x69')](_0x8c80f1['read1stAt'])?moment()[_0xf386('0x6a')](_0xf386('0x63')):undefined});}return null;})[_0xf386('0x25')](function(_0x5f47fc){if(_0x5f47fc){_0x4eeb12[_0xf386('0x6b')]=_0x5f47fc[_0xf386('0x66')]({'plain':!![]});interaction_log[_0xf386('0x2d')](_0xf386('0x6c'),_0x5269a1[_0xf386('0x6d')]['id'],_0x5269a1[_0xf386('0x6d')][_0xf386('0x3d')],_0x5269a1['user'][_0xf386('0x6e')],_0x4eeb12[_0xf386('0x6b')]['id'],_0x5269a1['body']?JSON[_0xf386('0x28')](_0x5269a1[_0xf386('0x5c')]):_0xf386('0x6f'));return respondWithRpcPromise(_0xf386('0x70'),_0xf386('0x71'),_0x4eeb12);}return null;})['then'](function(_0x546ce6){var _0x1423f6='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x546ce6[_0xf386('0x2c')][_0xf386('0x72')];return db[_0xf386('0x73')][_0xf386('0x44')](_0x1423f6,{'type':db[_0xf386('0x74')]['QueryTypes'][_0xf386('0x75')],'raw':!![]})[_0xf386('0x25')](function(_0x3e16c3){return _0x3e16c3;});})[_0xf386('0x25')](function(_0x403dd5){if(_0x403dd5){_0x4eeb12[_0xf386('0x2c')]['contact']=_0x403dd5[0x0];if(!_0x5269a1[_0xf386('0x5c')][_0xf386('0x64')])return;return db['User']['find']({'where':{'id':_0x5269a1[_0xf386('0x5c')]['UserId'],'role':_0xf386('0x65')},'attributes':['id',_0xf386('0x3d'),'fullname',_0xf386('0x76'),_0xf386('0x77')],'raw':!![]});}return null;})['then'](function(_0x49ec01){if(!_0x49ec01)return null;_0x4eeb12[_0xf386('0x2c')][_0xf386('0x65')]=_0x49ec01;return _0x4eeb12;})[_0xf386('0x25')](function(_0x258306){if(_0x258306){if(_0x5269a1[_0xf386('0x5c')][_0xf386('0x78')]){_0x4eeb12[_0xf386('0x2c')][_0xf386('0x79')]=util['format']('SIP/%s',_0x5269a1[_0xf386('0x6d')][_0xf386('0x3d')]);_0x4eeb12[_0xf386('0x2c')][_0xf386('0x7a')]=_0x4eeb12[_0xf386('0x7a')];_0x4eeb12[_0xf386('0x2c')][_0xf386('0x7b')]=_0x4eeb12[_0xf386('0x7a')];_0x4eeb12[_0xf386('0x2c')]['event']=_0xf386('0x60');return respondWithRpcPromise(_0xf386('0x7c'),_0xf386('0x7c'),{'event':_0xf386('0x7d'),'message':_0x4eeb12['message']},client9002)['then'](function(){return _0x4eeb12;});}return _0x4eeb12;}return null;})['then'](respondWithResult(_0x4ec70e,null))['catch'](handleError(_0x4ec70e,null));};var interaction_log=require('../../config/logger')(_0xf386('0x5f'));exports[_0xf386('0x7e')]=function(_0x2e4e97,_0x4b9a84,_0x2dbc8c){var _0x749872={'agent':{},'channel':_0xf386('0x7f')};if(_0x2e4e97[_0xf386('0x5c')]['id']){delete _0x2e4e97[_0xf386('0x5c')]['id'];}_0x2e4e97[_0xf386('0x5c')][_0xf386('0x64')]=_0x2e4e97[_0xf386('0x5c')][_0xf386('0x64')]||_0x2e4e97[_0xf386('0x6d')]['id'];_0x749872['agent']['id']=_0x2e4e97['body']['UserId'];return db[_0xf386('0x40')][_0xf386('0x5d')]({'where':{'id':_0x2e4e97[_0xf386('0x58')]['id'],'UserId':null}})[_0xf386('0x25')](handleEntityNotFound(_0x4b9a84,null))[_0xf386('0x25')](function(_0x2da7ff){if(_0x2da7ff){_0x749872[_0xf386('0x2c')]=_0x2da7ff[_0xf386('0x66')]({'plain':!![]});return db[_0xf386('0x67')][_0xf386('0x5d')]({'where':{'id':_0x2da7ff[_0xf386('0x68')]}});}return null;})['then'](handleEntityNotFound(_0x4b9a84,null))[_0xf386('0x25')](function(_0x407053){if(_0x407053){_0x749872[_0xf386('0x6b')]=_0x407053[_0xf386('0x66')]({'plain':!![]});interaction_log[_0xf386('0x2d')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2e4e97[_0xf386('0x6d')]['id'],_0x2e4e97[_0xf386('0x6d')][_0xf386('0x3d')],_0x2e4e97['user'][_0xf386('0x6e')],_0x749872[_0xf386('0x6b')]['id'],_0x2e4e97[_0xf386('0x5c')]?JSON[_0xf386('0x28')](_0x2e4e97[_0xf386('0x5c')]):_0xf386('0x6f'));return respondWithRpcPromise('RejectMessage',_0xf386('0x80'),_0x749872);}return null;})[_0xf386('0x25')](function(_0x1f4417){var _0x3ac612='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1f4417[_0xf386('0x2c')][_0xf386('0x72')];return db[_0xf386('0x73')][_0xf386('0x44')](_0x3ac612,{'type':db[_0xf386('0x74')][_0xf386('0x81')][_0xf386('0x75')],'raw':!![]})['then'](function(_0x3916c8){return _0x3916c8;});})[_0xf386('0x25')](function(_0x3945d2){if(_0x3945d2){_0x749872[_0xf386('0x2c')][_0xf386('0x82')]=_0x3945d2[0x0];if(!_0x2e4e97['body'][_0xf386('0x64')])return;return db['User'][_0xf386('0x5d')]({'where':{'id':_0x2e4e97['body'][_0xf386('0x64')],'role':_0xf386('0x65')},'attributes':['id',_0xf386('0x3d'),_0xf386('0x83'),_0xf386('0x76'),_0xf386('0x77')],'raw':!![]});}return null;})[_0xf386('0x25')](function(_0x44cc8f){if(!_0x44cc8f)return null;_0x749872[_0xf386('0x2c')][_0xf386('0x65')]=_0x44cc8f;return _0x749872;})[_0xf386('0x25')](function(_0x4987c6){if(_0x4987c6){_0x4987c6[_0xf386('0x2c')]['interface']=util['format'](_0xf386('0x84'),_0x2e4e97[_0xf386('0x6d')][_0xf386('0x3d')]);_0x4987c6[_0xf386('0x2c')]['channel']=_0x749872[_0xf386('0x7a')];_0x4987c6[_0xf386('0x2c')][_0xf386('0x7b')]=_0x749872['channel'];_0x4987c6[_0xf386('0x2c')][_0xf386('0x85')]='reject';respondWithRpcPromise(_0xf386('0x7c'),_0xf386('0x7c'),{'event':_0xf386('0x86'),'message':_0x4987c6[_0xf386('0x2c')]},client9002);return _0x749872;}return null;})['then'](respondWithResult(_0x4b9a84,null))[_0xf386('0x2e')](handleError(_0x4b9a84,null));}; \ No newline at end of file +var _0x3955=['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/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','./openchannelMessage.socket','register','jayson/promise','client','http','request','info','OpenchannelMessage,\x20%s,\x20%s','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','status','end','json','undefined','offset','count','limit','Content-Range','apply','save','update','destroy','then','sendStatus','stack','send','index','map','OpenchannelMessage','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','VIRTUAL','name','filter','includeAll','include','findAll','rows','catch','show','params','length','merge','options','find','body','describe','../../config/logger','openchannel-interactions','openchannel','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteractionId','isNil','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','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','channel','motionChannel','event','EventManager','acceptmessage','reject','OpenchannelInteraction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','ContactId','SIP/%s','eml-format','zip-dir','request-promise','moment','bluebird','path','sox'];(function(_0x3c2b87,_0x50248e){var _0x246d3a=function(_0x49fb59){while(--_0x49fb59){_0x3c2b87['push'](_0x3c2b87['shift']());}};_0x246d3a(++_0x50248e);}(_0x3955,0x7b));var _0x5395=function(_0x425617,_0x3c4e5f){_0x425617=_0x425617-0x0;var _0x3f636e=_0x3955[_0x425617];return _0x3f636e;};'use strict';var emlformat=require(_0x5395('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5395('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5395('0x2'));var moment=require(_0x5395('0x3'));var BPromise=require(_0x5395('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5395('0x5'));var sox=require(_0x5395('0x6'));var csv=require(_0x5395('0x7'));var ejs=require(_0x5395('0x8'));var fs=require('fs');var fs_extra=require(_0x5395('0x9'));var _=require(_0x5395('0xa'));var squel=require('squel');var crypto=require(_0x5395('0xb'));var jsforce=require(_0x5395('0xc'));var deskjs=require(_0x5395('0xd'));var toCsv=require(_0x5395('0x7'));var querystring=require('querystring');var Papa=require(_0x5395('0xe'));var Redis=require(_0x5395('0xf'));var authService=require(_0x5395('0x10'));var qs=require(_0x5395('0x11'));var as=require(_0x5395('0x12'));var hardwareService=require(_0x5395('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x5395('0x14'));var config=require(_0x5395('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x5395('0x16'))['db'];config['redis']=_[_0x5395('0x17')](config[_0x5395('0x18')],{'host':_0x5395('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5395('0x18')]));require(_0x5395('0x1a'))[_0x5395('0x1b')](socket);var jayson=require(_0x5395('0x1c'));var client=jayson[_0x5395('0x1d')][_0x5395('0x1e')]({'port':0x232c});var client9002=jayson[_0x5395('0x1d')][_0x5395('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x3fe73e,_0x2206fa,_0x59e08e,_0x50d141){return new BPromise(function(_0x186918,_0x5c094b){var _0x5d7c0c=_0x50d141||client;return _0x5d7c0c[_0x5395('0x1f')](_0x3fe73e,_0x59e08e)['then'](function(_0x3dbd7c){logger[_0x5395('0x20')](_0x5395('0x21'),_0x2206fa,'request\x20sent');logger['debug'](_0x5395('0x22'),_0x2206fa,_0x5395('0x23'),JSON[_0x5395('0x24')](_0x3dbd7c));if(_0x3dbd7c[_0x5395('0x25')]){if(_0x3dbd7c['error'][_0x5395('0x26')]===0x1f4){logger[_0x5395('0x25')](_0x5395('0x21'),_0x2206fa,_0x3dbd7c['error'][_0x5395('0x27')]);return _0x5c094b(_0x3dbd7c[_0x5395('0x25')][_0x5395('0x27')]);}logger[_0x5395('0x25')](_0x5395('0x21'),_0x2206fa,_0x3dbd7c[_0x5395('0x25')][_0x5395('0x27')]);return _0x186918(_0x3dbd7c['error'][_0x5395('0x27')]);}else{logger['info'](_0x5395('0x21'),_0x2206fa,_0x5395('0x23'));_0x186918(_0x3dbd7c['result']['message']);}})['catch'](function(_0x44a40c){logger[_0x5395('0x25')](_0x5395('0x21'),_0x2206fa,_0x44a40c);_0x5c094b(_0x44a40c);});});}function respondWithStatusCode(_0x4416fe,_0x199c83){_0x199c83=_0x199c83||0xcc;return function(_0x4e35b2){if(_0x4e35b2){return _0x4416fe['sendStatus'](_0x199c83);}return _0x4416fe[_0x5395('0x28')](_0x199c83)[_0x5395('0x29')]();};}function respondWithResult(_0x1e0dcd,_0x16fed7){_0x16fed7=_0x16fed7||0xc8;return function(_0x39224e){if(_0x39224e){return _0x1e0dcd['status'](_0x16fed7)[_0x5395('0x2a')](_0x39224e);}};}function respondWithFilteredResult(_0x5be66b,_0x1278ca){return function(_0x45b3d5){if(_0x45b3d5){var _0x20b175=typeof _0x1278ca['offset']==='undefined'&&typeof _0x1278ca['limit']===_0x5395('0x2b');var _0x5d44f5=_0x45b3d5['count'];var _0x341d2f=_0x20b175?0x0:_0x1278ca[_0x5395('0x2c')];var _0x45e7a2=_0x20b175?_0x45b3d5[_0x5395('0x2d')]:_0x1278ca[_0x5395('0x2c')]+_0x1278ca[_0x5395('0x2e')];var _0x1d5e7d;if(_0x45e7a2>=_0x5d44f5){_0x45e7a2=_0x5d44f5;_0x1d5e7d=0xc8;}else{_0x1d5e7d=0xce;}_0x5be66b[_0x5395('0x28')](_0x1d5e7d);return _0x5be66b['set'](_0x5395('0x2f'),_0x341d2f+'-'+_0x45e7a2+'/'+_0x5d44f5)['json'](_0x45b3d5);}return null;};}function patchUpdates(_0x877ce2){return function(_0x414a0a){try{jsonpatch[_0x5395('0x30')](_0x414a0a,_0x877ce2,!![]);}catch(_0x43dd48){return BPromise['reject'](_0x43dd48);}return _0x414a0a[_0x5395('0x31')]();};}function saveUpdates(_0x47c4f3,_0x21caca){return function(_0x44d582){if(_0x44d582){return _0x44d582[_0x5395('0x32')](_0x47c4f3)['then'](function(_0x28cc00){return _0x28cc00;});}return null;};}function removeEntity(_0x1ef767,_0xa69928){return function(_0x52e297){if(_0x52e297){return _0x52e297[_0x5395('0x33')]()[_0x5395('0x34')](function(){_0x1ef767[_0x5395('0x28')](0xcc)[_0x5395('0x29')]();});}};}function handleEntityNotFound(_0x8ce67a,_0xa30249){return function(_0x42ebb4){if(!_0x42ebb4){_0x8ce67a[_0x5395('0x35')](0x194);}return _0x42ebb4;};}function handleError(_0x30dc2e,_0x57e661){_0x57e661=_0x57e661||0x1f4;return function(_0x1a843a){logger['error'](_0x1a843a[_0x5395('0x36')]);if(_0x1a843a['name']){delete _0x1a843a['name'];}_0x30dc2e[_0x5395('0x28')](_0x57e661)[_0x5395('0x37')](_0x1a843a);};}exports[_0x5395('0x38')]=function(_0x58f537,_0x5a0098){var _0x3c51d2={},_0x32232a={},_0xc68f57={'count':0x0,'rows':[]};var _0x5f4750=_[_0x5395('0x39')](db[_0x5395('0x3a')][_0x5395('0x3b')],function(_0x12e86f){return{'name':_0x12e86f['fieldName'],'type':_0x12e86f[_0x5395('0x3c')][_0x5395('0x3d')]};});_0x32232a[_0x5395('0x3e')]=_[_0x5395('0x39')](_0x5f4750,'name');_0x32232a[_0x5395('0x3f')]=_[_0x5395('0x40')](_0x58f537[_0x5395('0x3f')]);_0x32232a[_0x5395('0x41')]=_[_0x5395('0x42')](_0x32232a[_0x5395('0x3e')],_0x32232a[_0x5395('0x3f')]);_0x3c51d2[_0x5395('0x43')]=_[_0x5395('0x42')](_0x32232a[_0x5395('0x3e')],qs[_0x5395('0x44')](_0x58f537[_0x5395('0x3f')]['fields']));_0x3c51d2[_0x5395('0x43')]=_0x3c51d2[_0x5395('0x43')]['length']?_0x3c51d2[_0x5395('0x43')]:_0x32232a[_0x5395('0x3e')];if(!_0x58f537[_0x5395('0x3f')][_0x5395('0x45')]('nolimit')){_0x3c51d2[_0x5395('0x2e')]=qs[_0x5395('0x2e')](_0x58f537[_0x5395('0x3f')][_0x5395('0x2e')]);_0x3c51d2[_0x5395('0x2c')]=qs[_0x5395('0x2c')](_0x58f537[_0x5395('0x3f')]['offset']);}_0x3c51d2[_0x5395('0x46')]=qs[_0x5395('0x47')](_0x58f537[_0x5395('0x3f')]['sort']);_0x3c51d2[_0x5395('0x48')]=qs[_0x5395('0x41')](_[_0x5395('0x49')](_0x58f537['query'],_0x32232a[_0x5395('0x41')]),_0x5f4750);if(_0x58f537[_0x5395('0x3f')]['filter']){_0x3c51d2[_0x5395('0x48')]=_['merge'](_0x3c51d2[_0x5395('0x48')],{'$or':_[_0x5395('0x39')](_0x5f4750,function(_0x2c903a){if(_0x2c903a[_0x5395('0x3c')]!==_0x5395('0x4a')){var _0x190b4f={};_0x190b4f[_0x2c903a[_0x5395('0x4b')]]={'$like':'%'+_0x58f537[_0x5395('0x3f')][_0x5395('0x4c')]+'%'};return _0x190b4f;}})});}_0x3c51d2=_['merge']({},_0x3c51d2,_0x58f537['options']);var _0x2b610d={'where':_0x3c51d2[_0x5395('0x48')]};return db['OpenchannelMessage']['count'](_0x2b610d)[_0x5395('0x34')](function(_0x26eb51){_0xc68f57['count']=_0x26eb51;if(_0x58f537[_0x5395('0x3f')][_0x5395('0x4d')]){_0x3c51d2[_0x5395('0x4e')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x5395('0x4f')](_0x3c51d2);})[_0x5395('0x34')](function(_0x1304da){_0xc68f57[_0x5395('0x50')]=_0x1304da;return _0xc68f57;})[_0x5395('0x34')](respondWithFilteredResult(_0x5a0098,_0x3c51d2))[_0x5395('0x51')](handleError(_0x5a0098,null));};exports[_0x5395('0x52')]=function(_0xbfc438,_0x329867){var _0x33435f={'raw':!![],'where':{'id':_0xbfc438[_0x5395('0x53')]['id']}},_0x9fd28f={};_0x9fd28f['model']=_[_0x5395('0x40')](db[_0x5395('0x3a')][_0x5395('0x3b')]);_0x9fd28f['query']=_[_0x5395('0x40')](_0xbfc438['query']);_0x9fd28f[_0x5395('0x41')]=_[_0x5395('0x42')](_0x9fd28f[_0x5395('0x3e')],_0x9fd28f[_0x5395('0x3f')]);_0x33435f['attributes']=_[_0x5395('0x42')](_0x9fd28f['model'],qs[_0x5395('0x44')](_0xbfc438[_0x5395('0x3f')][_0x5395('0x44')]));_0x33435f[_0x5395('0x43')]=_0x33435f['attributes'][_0x5395('0x54')]?_0x33435f[_0x5395('0x43')]:_0x9fd28f[_0x5395('0x3e')];if(_0xbfc438['query'][_0x5395('0x4d')]){_0x33435f[_0x5395('0x4e')]=[{'all':!![]}];}_0x33435f=_[_0x5395('0x55')]({},_0x33435f,_0xbfc438[_0x5395('0x56')]);return db[_0x5395('0x3a')][_0x5395('0x57')](_0x33435f)[_0x5395('0x34')](handleEntityNotFound(_0x329867,null))['then'](respondWithResult(_0x329867,null))[_0x5395('0x51')](handleError(_0x329867,null));};exports['create']=function(_0x57f050,_0x2ab0c3){return db['OpenchannelMessage']['create'](_0x57f050[_0x5395('0x58')],{})[_0x5395('0x34')](respondWithResult(_0x2ab0c3,0xc9))[_0x5395('0x51')](handleError(_0x2ab0c3,null));};exports[_0x5395('0x32')]=function(_0x32875b,_0x382fb0){if(_0x32875b[_0x5395('0x58')]['id']){delete _0x32875b[_0x5395('0x58')]['id'];}return db['OpenchannelMessage']['find']({'where':{'id':_0x32875b[_0x5395('0x53')]['id']}})[_0x5395('0x34')](handleEntityNotFound(_0x382fb0,null))[_0x5395('0x34')](saveUpdates(_0x32875b[_0x5395('0x58')],null))['then'](respondWithResult(_0x382fb0,null))[_0x5395('0x51')](handleError(_0x382fb0,null));};exports[_0x5395('0x33')]=function(_0x14f0a8,_0x1822e7){return db[_0x5395('0x3a')][_0x5395('0x57')]({'where':{'id':_0x14f0a8[_0x5395('0x53')]['id']}})['then'](handleEntityNotFound(_0x1822e7,null))['then'](removeEntity(_0x1822e7,null))[_0x5395('0x51')](handleError(_0x1822e7,null));};exports[_0x5395('0x59')]=function(_0x4841e0,_0x49a200){return db[_0x5395('0x3a')]['describe']()['then'](respondWithResult(_0x49a200,null))[_0x5395('0x51')](handleError(_0x49a200,null));};var interaction_log=require(_0x5395('0x5a'))(_0x5395('0x5b'));exports['accept']=function(_0x504cb1,_0x4f1430,_0x39c511){var _0x570f44={'agent':{},'channel':_0x5395('0x5c')};if(_0x504cb1[_0x5395('0x58')]['id']){delete _0x504cb1['body']['id'];}_0x504cb1['body']['read']=!![];_0x504cb1[_0x5395('0x58')][_0x5395('0x5d')]=moment()[_0x5395('0x5e')](_0x5395('0x5f'));_0x504cb1[_0x5395('0x58')][_0x5395('0x60')]=_0x504cb1[_0x5395('0x58')][_0x5395('0x60')]||_0x504cb1[_0x5395('0x61')]['id'];_0x570f44[_0x5395('0x62')]['id']=_0x504cb1[_0x5395('0x58')][_0x5395('0x60')];return db[_0x5395('0x3a')][_0x5395('0x57')]({'where':{'id':_0x504cb1[_0x5395('0x53')]['id'],'UserId':null}})[_0x5395('0x34')](handleEntityNotFound(_0x4f1430,null))['then'](saveUpdates(_0x504cb1[_0x5395('0x58')],null))[_0x5395('0x34')](function(_0x3d66f6){if(_0x3d66f6){_0x570f44[_0x5395('0x27')]=_0x3d66f6[_0x5395('0x63')]({'plain':!![]});return db['OpenchannelInteraction']['find']({'where':{'id':_0x3d66f6[_0x5395('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x4f1430,null))[_0x5395('0x34')](function(_0x3b1f7f){if(_0x3b1f7f){return _0x3b1f7f[_0x5395('0x32')]({'UserId':_0x504cb1[_0x5395('0x58')][_0x5395('0x60')],'read1stAt':_[_0x5395('0x65')](_0x3b1f7f['read1stAt'])?moment()[_0x5395('0x5e')](_0x5395('0x5f')):undefined});}return null;})[_0x5395('0x34')](function(_0x3dbdfb){if(_0x3dbdfb){_0x570f44[_0x5395('0x66')]=_0x3dbdfb[_0x5395('0x63')]({'plain':!![]});interaction_log['info'](_0x5395('0x67'),_0x504cb1[_0x5395('0x61')]['id'],_0x504cb1[_0x5395('0x61')][_0x5395('0x4b')],_0x504cb1[_0x5395('0x61')][_0x5395('0x68')],_0x570f44[_0x5395('0x66')]['id'],_0x504cb1[_0x5395('0x58')]?JSON[_0x5395('0x24')](_0x504cb1[_0x5395('0x58')]):_0x5395('0x69'));return respondWithRpcPromise(_0x5395('0x6a'),_0x5395('0x6b'),_0x570f44);}return null;})['then'](function(_0x5d2bd6){var _0x47a7db=_0x5395('0x6c')+_0x5d2bd6[_0x5395('0x27')]['ContactId'];return db[_0x5395('0x6d')]['query'](_0x47a7db,{'type':db[_0x5395('0x6e')][_0x5395('0x6f')][_0x5395('0x70')],'raw':!![]})[_0x5395('0x34')](function(_0x4e5633){return _0x4e5633;});})[_0x5395('0x34')](function(_0x42ef9c){if(_0x42ef9c){_0x570f44[_0x5395('0x27')][_0x5395('0x71')]=_0x42ef9c[0x0];if(!_0x504cb1[_0x5395('0x58')][_0x5395('0x60')])return;return db[_0x5395('0x72')][_0x5395('0x57')]({'where':{'id':_0x504cb1[_0x5395('0x58')][_0x5395('0x60')],'role':_0x5395('0x62')},'attributes':['id',_0x5395('0x4b'),_0x5395('0x73'),_0x5395('0x74'),_0x5395('0x75')],'raw':!![]});}return null;})[_0x5395('0x34')](function(_0x59778b){if(!_0x59778b)return null;_0x570f44['message']['agent']=_0x59778b;return _0x570f44;})[_0x5395('0x34')](function(_0x9f1f28){if(_0x9f1f28){if(_0x504cb1[_0x5395('0x58')][_0x5395('0x76')]){_0x570f44[_0x5395('0x27')]['interface']=util[_0x5395('0x5e')]('SIP/%s',_0x504cb1['user']['name']);_0x570f44['message'][_0x5395('0x77')]=_0x570f44['channel'];_0x570f44[_0x5395('0x27')][_0x5395('0x78')]=_0x570f44[_0x5395('0x77')];_0x570f44['message'][_0x5395('0x79')]='accept';return respondWithRpcPromise(_0x5395('0x7a'),_0x5395('0x7a'),{'event':_0x5395('0x7b'),'message':_0x570f44[_0x5395('0x27')]},client9002)[_0x5395('0x34')](function(){return _0x570f44;});}return _0x570f44;}return null;})[_0x5395('0x34')](respondWithResult(_0x4f1430,null))[_0x5395('0x51')](handleError(_0x4f1430,null));};var interaction_log=require('../../config/logger')(_0x5395('0x5b'));exports[_0x5395('0x7c')]=function(_0x10ee5b,_0x3a4b8f,_0x30e722){var _0x365ff6={'agent':{},'channel':_0x5395('0x5c')};if(_0x10ee5b[_0x5395('0x58')]['id']){delete _0x10ee5b[_0x5395('0x58')]['id'];}_0x10ee5b['body'][_0x5395('0x60')]=_0x10ee5b[_0x5395('0x58')][_0x5395('0x60')]||_0x10ee5b['user']['id'];_0x365ff6[_0x5395('0x62')]['id']=_0x10ee5b[_0x5395('0x58')]['UserId'];return db['OpenchannelMessage']['find']({'where':{'id':_0x10ee5b['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3a4b8f,null))[_0x5395('0x34')](function(_0x5951af){if(_0x5951af){_0x365ff6[_0x5395('0x27')]=_0x5951af['get']({'plain':!![]});return db[_0x5395('0x7d')]['find']({'where':{'id':_0x5951af[_0x5395('0x64')]}});}return null;})[_0x5395('0x34')](handleEntityNotFound(_0x3a4b8f,null))[_0x5395('0x34')](function(_0x2d1c7f){if(_0x2d1c7f){_0x365ff6[_0x5395('0x66')]=_0x2d1c7f[_0x5395('0x63')]({'plain':!![]});interaction_log[_0x5395('0x20')](_0x5395('0x7e'),_0x10ee5b[_0x5395('0x61')]['id'],_0x10ee5b['user'][_0x5395('0x4b')],_0x10ee5b[_0x5395('0x61')][_0x5395('0x68')],_0x365ff6[_0x5395('0x66')]['id'],_0x10ee5b['body']?JSON[_0x5395('0x24')](_0x10ee5b['body']):_0x5395('0x69'));return respondWithRpcPromise(_0x5395('0x7f'),'rejectMessage',_0x365ff6);}return null;})[_0x5395('0x34')](function(_0x12e155){var _0x1395c6='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x12e155[_0x5395('0x27')][_0x5395('0x80')];return db['sequelize']['query'](_0x1395c6,{'type':db[_0x5395('0x6e')][_0x5395('0x6f')][_0x5395('0x70')],'raw':!![]})['then'](function(_0x4166f2){return _0x4166f2;});})[_0x5395('0x34')](function(_0x13d065){if(_0x13d065){_0x365ff6[_0x5395('0x27')][_0x5395('0x71')]=_0x13d065[0x0];if(!_0x10ee5b[_0x5395('0x58')][_0x5395('0x60')])return;return db[_0x5395('0x72')][_0x5395('0x57')]({'where':{'id':_0x10ee5b[_0x5395('0x58')][_0x5395('0x60')],'role':_0x5395('0x62')},'attributes':['id',_0x5395('0x4b'),_0x5395('0x73'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0x371031){if(!_0x371031)return null;_0x365ff6[_0x5395('0x27')][_0x5395('0x62')]=_0x371031;return _0x365ff6;})[_0x5395('0x34')](function(_0x3e4e23){if(_0x3e4e23){_0x3e4e23[_0x5395('0x27')]['interface']=util[_0x5395('0x5e')](_0x5395('0x81'),_0x10ee5b[_0x5395('0x61')]['name']);_0x3e4e23[_0x5395('0x27')][_0x5395('0x77')]=_0x365ff6[_0x5395('0x77')];_0x3e4e23[_0x5395('0x27')][_0x5395('0x78')]=_0x365ff6[_0x5395('0x77')];_0x3e4e23[_0x5395('0x27')][_0x5395('0x79')]='reject';respondWithRpcPromise('EventManager',_0x5395('0x7a'),{'event':'rejectmessage','message':_0x3e4e23[_0x5395('0x27')]},client9002);return _0x365ff6;}return null;})[_0x5395('0x34')](respondWithResult(_0x3a4b8f,null))[_0x5395('0x51')](handleError(_0x3a4b8f,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 82f7d01..85c5019 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 _0xd0f0=['emit','hook','exports','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update'];(function(_0x279fae,_0x248413){var _0x3be4ab=function(_0x5de4b8){while(--_0x5de4b8){_0x279fae['push'](_0x279fae['shift']());}};_0x3be4ab(++_0x248413);}(_0xd0f0,0x11b));var _0x0d0f=function(_0x17b0d4,_0x377add){_0x17b0d4=_0x17b0d4-0x0;var _0x2d02c7=_0xd0f0[_0x17b0d4];return _0x2d02c7;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x0d0f('0x0'))['db'][_0x0d0f('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x0d0f('0x2')](0x0);var events={'afterCreate':_0x0d0f('0x3'),'afterUpdate':_0x0d0f('0x4'),'afterDestroy':'remove'};function emitEvent(_0x27d60b){return function(_0x4b9dc4,_0x6b48b3,_0x4627ab){OpenchannelMessageEvents[_0x0d0f('0x5')](_0x27d60b+':'+_0x4b9dc4['id'],_0x4b9dc4);OpenchannelMessageEvents[_0x0d0f('0x5')](_0x27d60b,_0x4b9dc4);_0x4627ab(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0x0d0f('0x6')](e,emitEvent(event));}}module[_0x0d0f('0x7')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x575d=['update','emit','hasOwnProperty','exports','events','../../mysqldb','OpenchannelMessage'];(function(_0xd54582,_0x59d0cf){var _0x4af38a=function(_0x4f534b){while(--_0x4f534b){_0xd54582['push'](_0xd54582['shift']());}};_0x4af38a(++_0x59d0cf);}(_0x575d,0x1af));var _0xd575=function(_0x459e32,_0x4cc5ce){_0x459e32=_0x459e32-0x0;var _0x36e453=_0x575d[_0x459e32];return _0x36e453;};'use strict';var EventEmitter=require(_0xd575('0x0'));var OpenchannelMessage=require(_0xd575('0x1'))['db'][_0xd575('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xd575('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3927d5){return function(_0x47ff51,_0x48f65a,_0x47ba1e){OpenchannelMessageEvents['emit'](_0x3927d5+':'+_0x47ff51['id'],_0x47ff51);OpenchannelMessageEvents[_0xd575('0x4')](_0x3927d5,_0x47ff51);_0x47ba1e(null);};}for(var e in events){if(events[_0xd575('0x5')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0xd575('0x6')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index ee7c1d4..009aa7e 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 _0x4506=['createdAt','catch','error','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','Contact','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','replyUri','method','GET','POST','body','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','path','rimraf','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','get','toLowerCase','direction','out','isNil','OpenchannelInteraction','OpenchannelInteractionId','then','update'];(function(_0x509083,_0xa6676b){var _0x4b2495=function(_0x2a14f5){while(--_0x2a14f5){_0x509083['push'](_0x509083['shift']());}};_0x4b2495(++_0xa6676b);}(_0x4506,0x1df));var _0x6450=function(_0x4eace0,_0x36c65f){_0x4eace0=_0x4eace0-0x0;var _0x24256e=_0x4506[_0x4eace0];return _0x24256e;};'use strict';var _=require(_0x6450('0x0'));var util=require(_0x6450('0x1'));var logger=require(_0x6450('0x2'))(_0x6450('0x3'));var moment=require(_0x6450('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6450('0x5'));var rimraf=require(_0x6450('0x6'));var config=require('../../config/environment');var attributes=require(_0x6450('0x7'));module[_0x6450('0x8')]=function(_0x21e54b,_0x1295e1){return _0x21e54b[_0x6450('0x9')](_0x6450('0xa'),attributes,{'tableName':_0x6450('0xb'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1ace2f,_0x402a31,_0x5a851b){var _0x32635e=_0x21e54b['models'];var _0xb1a794=_0x1ace2f[_0x6450('0xc')]({'plain':!![]});if(_0xb1a794['direction'][_0x6450('0xd')]()==='in'||_0xb1a794[_0x6450('0xe')][_0x6450('0xd')]()===_0x6450('0xf')&&!_0xb1a794['secret']&&!_[_0x6450('0x10')](_0xb1a794['UserId'])){_0x32635e[_0x6450('0x11')]['findOne']({'where':{'id':_0xb1a794[_0x6450('0x12')]}})[_0x6450('0x13')](function(_0x4e6b0e){if(_0x4e6b0e){_0x4e6b0e[_0x6450('0x14')]({'lastMsgAt':_0xb1a794[_0x6450('0x15')],'lastMsgDirection':_0xb1a794[_0x6450('0xe')]['toLowerCase']()});}})[_0x6450('0x16')](function(_0x1d1b9e){console[_0x6450('0x17')](_0x1d1b9e);});}if(_0xb1a794[_0x6450('0xe')]===_0x6450('0xf')&&!_0xb1a794['secret']){var _0x535941;_0x32635e[_0x6450('0x18')][_0x6450('0x19')]()[_0x6450('0x13')](function(_0x5b74f4){return _0x32635e[_0x6450('0x1a')][_0x6450('0x1b')]({'where':{'id':_0xb1a794[_0x6450('0x1c')]},'include':[{'model':_0x32635e[_0x6450('0x11')],'as':_0x6450('0x1d'),'where':{'id':_0xb1a794['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x32635e[_0x6450('0x18')],'as':_0x6450('0x1e'),'attributes':_['keys'](_0x5b74f4)}]}]});})[_0x6450('0x13')](function(_0x1ca3dd){_0x535941=_0x1ca3dd[_0x6450('0xc')]({'plain':!![]});if(_0x535941&&_0x535941['replyUri']){logger[_0x6450('0x1f')](_0x6450('0x20'),_0x6450('0x21'),util[_0x6450('0x22')](_0x6450('0x23'),_0xb1a794['id'],_0x535941['replyUri']));if(_0x535941[_0x6450('0x1d')]&&_0x535941[_0x6450('0x1d')][_0x6450('0x24')]){_0xb1a794[_0x6450('0x25')]=_[_0x6450('0x26')](_0x535941[_0x6450('0x1d')][0x0],_0x6450('0x1e'));_0xb1a794[_0x6450('0x1e')]=_0x535941[_0x6450('0x1d')][0x0][_0x6450('0x1e')];}var _0x402a31={'method':'POST','uri':encodeURI(_0x535941[_0x6450('0x27')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x402a31[_0x6450('0x28')]){case _0x6450('0x29'):_0x402a31['qs']=_0xb1a794;break;case _0x6450('0x2a'):_0x402a31[_0x6450('0x2b')]=_0xb1a794;break;}return rp(_0x402a31)[_0x6450('0x13')](function(_0x1ea43c){logger[_0x6450('0x1f')]('OpenchannelMessage,\x20%s,\x20%s',_0x6450('0x21'),util[_0x6450('0x22')](_0x6450('0x2c'),_0xb1a794['id'],_0x535941['replyUri']));if(_0x1ea43c[_0x6450('0x2b')][_0x6450('0x2d')]&&_0x1ea43c['body']['threadId']!=_0xb1a794[_0x6450('0x25')][_0x6450('0x2d')]){return _0x32635e['OpenchannelInteraction'][_0x6450('0x14')]({'threadId':_0x1ea43c['body'][_0x6450('0x2d')]},{'where':{'id':_0xb1a794[_0x6450('0x25')]['id']}});}else{return;}})['then'](function(){return _0x1ace2f[_0x6450('0x14')]({'read':!![]});})[_0x6450('0x16')](function(_0x7c3072){logger[_0x6450('0x17')]('OpenchannelMessage,\x20%s,\x20%s',_0x6450('0x21'),util[_0x6450('0x2e')](_0x7c3072,{'showHidden':![],'depth':null}));_0x5a851b();});}else{_0x5a851b();}})[_0x6450('0x2f')](function(){_0x5a851b();});}else{_0x5a851b();}}},'charset':_0x6450('0x30'),'collate':_0x6450('0x31')});}; \ No newline at end of file +var _0x6d90=['out','secret','isNil','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','createdAt','catch','error','describe','OpenchannelAccount','find','Interactions','CmContact','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','POST','method','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','update','afterCreate','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x6d90,0x16d));var _0x06d9=function(_0x2eae28,_0x4f6c29){_0x2eae28=_0x2eae28-0x0;var _0x5c0750=_0x6d90[_0x2eae28];return _0x5c0750;};'use strict';var _=require(_0x06d9('0x0'));var util=require(_0x06d9('0x1'));var logger=require(_0x06d9('0x2'))(_0x06d9('0x3'));var moment=require(_0x06d9('0x4'));var BPromise=require(_0x06d9('0x5'));var rp=require(_0x06d9('0x6'));var fs=require('fs');var path=require(_0x06d9('0x7'));var rimraf=require(_0x06d9('0x8'));var config=require(_0x06d9('0x9'));var attributes=require(_0x06d9('0xa'));module[_0x06d9('0xb')]=function(_0x15b6d8,_0x1299f8){return _0x15b6d8[_0x06d9('0xc')]('OpenchannelMessage',attributes,{'tableName':_0x06d9('0xd'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0x06d9('0xe')],'type':_0x06d9('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1c2b7a,_0x3fd096,_0x10459c){var _0x20c4c6=_0x15b6d8[_0x06d9('0x10')];var _0x52921b=_0x1c2b7a[_0x06d9('0x11')]({'plain':!![]});if(_0x52921b[_0x06d9('0x12')][_0x06d9('0x13')]()==='in'||_0x52921b['direction'][_0x06d9('0x13')]()===_0x06d9('0x14')&&!_0x52921b[_0x06d9('0x15')]&&!_[_0x06d9('0x16')](_0x52921b['UserId'])){_0x20c4c6[_0x06d9('0x17')][_0x06d9('0x18')]({'where':{'id':_0x52921b[_0x06d9('0x19')]}})[_0x06d9('0x1a')](function(_0x3f25a2){if(_0x3f25a2){_0x3f25a2['update']({'lastMsgAt':_0x52921b[_0x06d9('0x1b')],'lastMsgDirection':_0x52921b[_0x06d9('0x12')][_0x06d9('0x13')]()});}})[_0x06d9('0x1c')](function(_0x123448){console[_0x06d9('0x1d')](_0x123448);});}if(_0x52921b[_0x06d9('0x12')]===_0x06d9('0x14')&&!_0x52921b[_0x06d9('0x15')]){var _0x60ad0f;_0x20c4c6['CmContact'][_0x06d9('0x1e')]()[_0x06d9('0x1a')](function(_0xf8456e){return _0x20c4c6[_0x06d9('0x1f')][_0x06d9('0x20')]({'where':{'id':_0x52921b['OpenchannelAccountId']},'include':[{'model':_0x20c4c6[_0x06d9('0x17')],'as':_0x06d9('0x21'),'where':{'id':_0x52921b[_0x06d9('0x19')]},'limit':0x1,'include':[{'model':_0x20c4c6[_0x06d9('0x22')],'as':_0x06d9('0x23'),'attributes':_[_0x06d9('0x24')](_0xf8456e)}]}]});})[_0x06d9('0x1a')](function(_0x471453){_0x60ad0f=_0x471453[_0x06d9('0x11')]({'plain':!![]});if(_0x60ad0f&&_0x60ad0f[_0x06d9('0x25')]){logger[_0x06d9('0x26')](_0x06d9('0x27'),'afterCreate',util[_0x06d9('0x28')](_0x06d9('0x29'),_0x52921b['id'],_0x60ad0f['replyUri']));if(_0x60ad0f[_0x06d9('0x21')]&&_0x60ad0f[_0x06d9('0x21')][_0x06d9('0x2a')]){_0x52921b[_0x06d9('0x2b')]=_[_0x06d9('0x2c')](_0x60ad0f[_0x06d9('0x21')][0x0],_0x06d9('0x23'));_0x52921b[_0x06d9('0x23')]=_0x60ad0f[_0x06d9('0x21')][0x0][_0x06d9('0x23')];}var _0x3fd096={'method':_0x06d9('0x2d'),'uri':encodeURI(_0x60ad0f[_0x06d9('0x25')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x3fd096[_0x06d9('0x2e')]){case _0x06d9('0x2f'):_0x3fd096['qs']=_0x52921b;break;case _0x06d9('0x2d'):_0x3fd096[_0x06d9('0xe')]=_0x52921b;break;}return rp(_0x3fd096)[_0x06d9('0x1a')](function(_0x1fc943){logger['info']('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0x06d9('0x28')](_0x06d9('0x30'),_0x52921b['id'],_0x60ad0f['replyUri']));if(_0x1fc943[_0x06d9('0xe')]['threadId']&&_0x1fc943[_0x06d9('0xe')][_0x06d9('0x31')]!=_0x52921b[_0x06d9('0x2b')][_0x06d9('0x31')]){return _0x20c4c6[_0x06d9('0x17')][_0x06d9('0x32')]({'threadId':_0x1fc943[_0x06d9('0xe')][_0x06d9('0x31')]},{'where':{'id':_0x52921b[_0x06d9('0x2b')]['id']}});}else{return;}})[_0x06d9('0x1a')](function(){return _0x1c2b7a['update']({'read':!![]});})[_0x06d9('0x1c')](function(_0x81b32e){logger[_0x06d9('0x1d')]('OpenchannelMessage,\x20%s,\x20%s',_0x06d9('0x33'),util['inspect'](_0x81b32e,{'showHidden':![],'depth':null}));_0x10459c();});}else{_0x10459c();}})[_0x06d9('0x34')](function(){_0x10459c();});}else{_0x10459c();}}},'charset':_0x06d9('0x35'),'collate':_0x06d9('0x36')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index ddc4785..4771d60 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(_0x1ab35d,_0x3f401d){var _0x133d6d=function(_0x381b41){while(--_0x381b41){_0x1ab35d['push'](_0x1ab35d['shift']());}};_0x133d6d(++_0x3f401d);}(_0xdb28,0x106));var _0x8db2=function(_0x15ba0b,_0x5a0a10){_0x15ba0b=_0x15ba0b-0x0;var _0x329996=_0xdb28[_0x15ba0b];return _0x329996;};'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 _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./openchannelMessage.socket','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','OpenchannelMessage','options','raw','then','CreateOpenchannelMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x45f7ca,_0x2a15ea){var _0x2124ce=function(_0x40b5e6){while(--_0x40b5e6){_0x45f7ca['push'](_0x45f7ca['shift']());}};_0x2124ce(++_0x2a15ea);}(_0x1261,0x144));var _0x1126=function(_0x5c4e16,_0x113035){_0x5c4e16=_0x5c4e16-0x0;var _0x36044a=_0x1261[_0x5c4e16];return _0x36044a;};'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});config[_0x1126('0xb')]=_['defaults'](config[_0x1126('0xb')],{'host':_0x1126('0xc'),'port':0x18eb});var socket=require(_0x1126('0xd'))(new Redis(config[_0x1126('0xb')]));require(_0x1126('0xe'))['register'](socket);function respondWithRpcPromise(_0x3f09ac,_0x18dbe6,_0x167ef1){return new BPromise(function(_0x5e72e2,_0x34571c){return client['request'](_0x3f09ac,_0x167ef1)['then'](function(_0x15c071){logger['info'](_0x1126('0xf'),_0x18dbe6,_0x1126('0x10'));logger[_0x1126('0x11')](_0x1126('0x12'),_0x18dbe6,_0x1126('0x10'),JSON[_0x1126('0x13')](_0x15c071));if(_0x15c071[_0x1126('0x14')]){if(_0x15c071[_0x1126('0x14')][_0x1126('0x15')]===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x34571c(_0x15c071[_0x1126('0x14')]['message']);}logger[_0x1126('0x14')]('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x5e72e2(_0x15c071[_0x1126('0x14')]['message']);}else{logger[_0x1126('0x17')](_0x1126('0xf'),_0x18dbe6,'request\x20sent');_0x5e72e2(_0x15c071['result'][_0x1126('0x16')]);}})[_0x1126('0x18')](function(_0x58d11a){logger['error'](_0x1126('0xf'),_0x18dbe6,_0x58d11a);_0x34571c(_0x58d11a);});});}exports['CreateOpenchannelMessage']=function(_0x22ed37){var _0x1d6d19=this;return new Promise(function(_0x2f70ac,_0x54400a){return db[_0x1126('0x19')]['create'](_0x22ed37['body'],{'raw':_0x22ed37[_0x1126('0x1a')]?_0x22ed37[_0x1126('0x1a')][_0x1126('0x1b')]===undefined?!![]:![]:!![]})[_0x1126('0x1c')](function(_0x526ca1){logger[_0x1126('0x17')](_0x1126('0x1d'),_0x22ed37);logger['debug'](_0x1126('0x1d'),_0x22ed37,JSON['stringify'](_0x526ca1));_0x2f70ac(_0x526ca1);})['catch'](function(_0x4b57ab){logger[_0x1126('0x14')](_0x1126('0x1d'),_0x4b57ab[_0x1126('0x16')],_0x22ed37);_0x54400a(_0x1d6d19[_0x1126('0x14')](0x1f4,_0x4b57ab[_0x1126('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 3bd4602..08f33d2 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 _0xd765=['save','remove','update','emit','removeListener','length','./openchannelMessage.events'];(function(_0xbdb708,_0x22accd){var _0x2a09c7=function(_0x35a6c9){while(--_0x35a6c9){_0xbdb708['push'](_0xbdb708['shift']());}};_0x2a09c7(++_0x22accd);}(_0xd765,0xdf));var _0x5d76=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xd765[_0x2be8c2];return _0x97f531;};'use strict';var OpenchannelMessageEvents=require(_0x5d76('0x0'));var events=[_0x5d76('0x1'),_0x5d76('0x2'),_0x5d76('0x3')];function createListener(_0x245264,_0x44fed4){return function(_0x4ce5da){_0x44fed4[_0x5d76('0x4')](_0x245264,_0x4ce5da);};}function removeListener(_0x5f18e0,_0x1a7983){return function(){OpenchannelMessageEvents[_0x5d76('0x5')](_0x5f18e0,_0x1a7983);};}exports['register']=function(_0x280536){for(var _0x175058=0x0,_0x444693=events[_0x5d76('0x6')];_0x175058<_0x444693;_0x175058++){var _0x333db6=events[_0x175058];var _0x116d32=createListener('openchannelMessage:'+_0x333db6,_0x280536);OpenchannelMessageEvents['on'](_0x333db6,_0x116d32);}}; \ No newline at end of file +var _0x770d=['length','openchannelMessage:','./openchannelMessage.events','save','remove','update','removeListener','register'];(function(_0x478414,_0xcf142d){var _0x5eb6b9=function(_0x10e6fe){while(--_0x10e6fe){_0x478414['push'](_0x478414['shift']());}};_0x5eb6b9(++_0xcf142d);}(_0x770d,0x122));var _0xd770=function(_0x11a4dd,_0x722077){_0x11a4dd=_0x11a4dd-0x0;var _0x186bf5=_0x770d[_0x11a4dd];return _0x186bf5;};'use strict';var OpenchannelMessageEvents=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(){OpenchannelMessageEvents[_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);OpenchannelMessageEvents['on'](_0x2224c4,_0x433e3d);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index a205ec2..83d5a9a 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 _0xe0fc=['index','getMembers','getTeams','/:id/users','getAgents','post','/:id/teams','addTeams','addAgents','put','update','/:id','destroy','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','get','isAuthenticated'];(function(_0x13f50a,_0x2bba41){var _0x544e1e=function(_0x1c28fa){while(--_0x1c28fa){_0x13f50a['push'](_0x13f50a['shift']());}};_0x544e1e(++_0x2bba41);}(_0xe0fc,0x145));var _0xce0f=function(_0x429948,_0x1a6851){_0x429948=_0x429948-0x0;var _0x35d5d1=_0xe0fc[_0x429948];return _0x35d5d1;};'use strict';var multer=require(_0xce0f('0x0'));var util=require(_0xce0f('0x1'));var path=require(_0xce0f('0x2'));var timeout=require(_0xce0f('0x3'));var express=require(_0xce0f('0x4'));var router=express[_0xce0f('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xce0f('0x6'));var interaction=require(_0xce0f('0x7'));var config=require('../../config/environment');var controller=require(_0xce0f('0x8'));router[_0xce0f('0x9')]('/',auth[_0xce0f('0xa')](),controller[_0xce0f('0xb')]);router['get']('/describe',auth[_0xce0f('0xa')](),controller['describe']);router[_0xce0f('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xce0f('0x9')]('/:id/members',auth[_0xce0f('0xa')](),controller[_0xce0f('0xc')]);router[_0xce0f('0x9')]('/:id/teams',auth[_0xce0f('0xa')](),controller[_0xce0f('0xd')]);router[_0xce0f('0x9')](_0xce0f('0xe'),auth[_0xce0f('0xa')](),controller[_0xce0f('0xf')]);router[_0xce0f('0x10')]('/',auth[_0xce0f('0xa')](),controller['create']);router[_0xce0f('0x10')](_0xce0f('0x11'),auth['isAuthenticated'](),controller[_0xce0f('0x12')]);router[_0xce0f('0x10')](_0xce0f('0xe'),auth[_0xce0f('0xa')](),controller[_0xce0f('0x13')]);router[_0xce0f('0x14')]('/:id',auth[_0xce0f('0xa')](),controller[_0xce0f('0x15')]);router['delete'](_0xce0f('0x16'),auth[_0xce0f('0xa')](),controller[_0xce0f('0x17')]);router[_0xce0f('0x18')](_0xce0f('0x11'),auth[_0xce0f('0xa')](),controller[_0xce0f('0x19')]);router['delete'](_0xce0f('0xe'),auth[_0xce0f('0xa')](),controller[_0xce0f('0x1a')]);module[_0xce0f('0x1b')]=router; \ No newline at end of file +var _0xa48a=['index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','get','isAuthenticated'];(function(_0x2028d5,_0x31e421){var _0x1620fb=function(_0xc32f4a){while(--_0xc32f4a){_0x2028d5['push'](_0x2028d5['shift']());}};_0x1620fb(++_0x31e421);}(_0xa48a,0xa4));var _0xaa48=function(_0x5cd54f,_0xc513d7){_0x5cd54f=_0x5cd54f-0x0;var _0x48811b=_0xa48a[_0x5cd54f];return _0x48811b;};'use strict';var multer=require(_0xaa48('0x0'));var util=require(_0xaa48('0x1'));var path=require(_0xaa48('0x2'));var timeout=require('connect-timeout');var express=require(_0xaa48('0x3'));var router=express[_0xaa48('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xaa48('0x5'));var interaction=require(_0xaa48('0x6'));var config=require('../../config/environment');var controller=require(_0xaa48('0x7'));router[_0xaa48('0x8')]('/',auth[_0xaa48('0x9')](),controller[_0xaa48('0xa')]);router[_0xaa48('0x8')](_0xaa48('0xb'),auth[_0xaa48('0x9')](),controller[_0xaa48('0xc')]);router[_0xaa48('0x8')](_0xaa48('0xd'),auth['isAuthenticated'](),controller[_0xaa48('0xe')]);router['get']('/:id/members',auth[_0xaa48('0x9')](),controller[_0xaa48('0xf')]);router[_0xaa48('0x8')](_0xaa48('0x10'),auth[_0xaa48('0x9')](),controller[_0xaa48('0x11')]);router['get'](_0xaa48('0x12'),auth[_0xaa48('0x9')](),controller[_0xaa48('0x13')]);router[_0xaa48('0x14')]('/',auth[_0xaa48('0x9')](),controller['create']);router['post'](_0xaa48('0x10'),auth[_0xaa48('0x9')](),controller[_0xaa48('0x15')]);router[_0xaa48('0x14')](_0xaa48('0x12'),auth[_0xaa48('0x9')](),controller[_0xaa48('0x16')]);router[_0xaa48('0x17')](_0xaa48('0xd'),auth[_0xaa48('0x9')](),controller[_0xaa48('0x18')]);router[_0xaa48('0x19')]('/:id',auth[_0xaa48('0x9')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xaa48('0x9')](),controller[_0xaa48('0x1a')]);router[_0xaa48('0x19')](_0xaa48('0x12'),auth[_0xaa48('0x9')](),controller[_0xaa48('0x1b')]);module[_0xaa48('0x1c')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index bbe03b1..4a21eee 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 _0x5169=['exports','STRING','INTEGER','ENUM','rrmemory','beepall','sequelize'];(function(_0x5f4acf,_0x55bb4e){var _0x7cc103=function(_0x4e3762){while(--_0x4e3762){_0x5f4acf['push'](_0x5f4acf['shift']());}};_0x7cc103(++_0x55bb4e);}(_0x5169,0xd1));var _0x9516=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x5169[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0x9516('0x0'));module[_0x9516('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9516('0x2')]},'timeout':{'type':Sequelize[_0x9516('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9516('0x4')](_0x9516('0x5'),_0x9516('0x6'),'roundrobin')}}; \ No newline at end of file +var _0xcb26=['rrmemory','beepall','roundrobin','exports','STRING','ENUM'];(function(_0x10a904,_0x2bf292){var _0x53815a=function(_0x2e6ce4){while(--_0x2e6ce4){_0x10a904['push'](_0x10a904['shift']());}};_0x53815a(++_0x2bf292);}(_0xcb26,0x1a7));var _0x6cb2=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xcb26[_0x16b9ed];return _0x66b1f8;};'use strict';var Sequelize=require('sequelize');module[_0x6cb2('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6cb2('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6cb2('0x2')](_0x6cb2('0x3'),_0x6cb2('0x4'),_0x6cb2('0x5'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 29b7df2..4cc8f75 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 _0xee99=['addAgents','spread','isArray','userOpenchannelQueue:remove','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/environment','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','then','get','UserProfileResource','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','where','OpenchannelQueue','include','query','rows','catch','show','keys','model','attributes','fields','length','merge','options','create','body','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserOpenchannelQueue','filters','intersection','hasOwnProperty','nolimit','order','sort','pick','OpenchannelQueueId','filter','findAll','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','Team','getTeams','addTeams','ids','Agents','online','interface','transaction','each','forEach','emit','userOpenchannelQueue:save','removeTeams','select','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','sequelize','SELECT','every','TeamId','includes','all','union','compact','value','removeAgents'];(function(_0x4b7fc4,_0x99901c){var _0x602389=function(_0x1f4531){while(--_0x1f4531){_0x4b7fc4['push'](_0x4b7fc4['shift']());}};_0x602389(++_0x99901c);}(_0xee99,0x7c));var _0x9ee9=function(_0x553c8b,_0x53edb2){_0x553c8b=_0x553c8b-0x0;var _0x39a4be=_0xee99[_0x553c8b];return _0x39a4be;};'use strict';var BPromise=require(_0x9ee9('0x0'));var util=require(_0x9ee9('0x1'));var _=require(_0x9ee9('0x2'));var squel=require(_0x9ee9('0x3'));var Redis=require(_0x9ee9('0x4'));var qs=require(_0x9ee9('0x5'));var logger=require('../../config/logger')('api');var config=require(_0x9ee9('0x6'));var db=require('../../mysqldb')['db'];config[_0x9ee9('0x7')]=_[_0x9ee9('0x8')](config[_0x9ee9('0x7')],{'host':_0x9ee9('0x9'),'port':0x18eb});var socket=require(_0x9ee9('0xa'))(new Redis(config['redis']));require(_0x9ee9('0xb'))[_0x9ee9('0xc')](socket);function respondWithStatusCode(_0x4ad5c1,_0x2092ce){_0x2092ce=_0x2092ce||0xcc;return function(_0x3f2a60){if(_0x3f2a60){return _0x4ad5c1[_0x9ee9('0xd')](_0x2092ce);}return _0x4ad5c1[_0x9ee9('0xe')](_0x2092ce)[_0x9ee9('0xf')]();};}function respondWithResult(_0x147c08,_0x1214e8){_0x1214e8=_0x1214e8||0xc8;return function(_0x144a99){if(_0x144a99){return _0x147c08[_0x9ee9('0xe')](_0x1214e8)[_0x9ee9('0x10')](_0x144a99);}};}function respondWithFilteredResult(_0x292f16,_0x10c7a0){return function(_0x145583){if(_0x145583){var _0x477c94=typeof _0x10c7a0[_0x9ee9('0x11')]===_0x9ee9('0x12')&&typeof _0x10c7a0[_0x9ee9('0x13')]===_0x9ee9('0x12');var _0x40cf8d=_0x145583[_0x9ee9('0x14')];var _0x92c4b4=_0x477c94?0x0:_0x10c7a0[_0x9ee9('0x11')];var _0x18dfda=_0x477c94?_0x145583[_0x9ee9('0x14')]:_0x10c7a0[_0x9ee9('0x11')]+_0x10c7a0[_0x9ee9('0x13')];var _0x2a91e6;if(_0x18dfda>=_0x40cf8d){_0x18dfda=_0x40cf8d;_0x2a91e6=0xc8;}else{_0x2a91e6=0xce;}_0x292f16[_0x9ee9('0xe')](_0x2a91e6);return _0x292f16['set'](_0x9ee9('0x15'),_0x92c4b4+'-'+_0x18dfda+'/'+_0x40cf8d)[_0x9ee9('0x10')](_0x145583);}return null;};}function saveUpdates(_0x4f8a6c){return function(_0x28fcf6){if(_0x28fcf6){return _0x28fcf6[_0x9ee9('0x16')](_0x4f8a6c)[_0x9ee9('0x17')](function(_0x386738){return _0x386738;});}return null;};}function removeEntity(_0x3afbb8){return function(_0xd9d4aa){if(_0xd9d4aa){return _0xd9d4aa['destroy']()['then'](function(){var _0x525f4a=_0xd9d4aa[_0x9ee9('0x18')]({'plain':!![]});var _0xfcd9f2='OpenchannelQueues';return db[_0x9ee9('0x19')][_0x9ee9('0x1a')]({'where':{'type':_0xfcd9f2,'resourceId':_0x525f4a['id']}})['then'](function(){return _0xd9d4aa;});})[_0x9ee9('0x17')](function(){_0x3afbb8[_0x9ee9('0xe')](0xcc)[_0x9ee9('0xf')]();});}};}function handleEntityNotFound(_0x5083dd){return function(_0x39c702){if(!_0x39c702){_0x5083dd[_0x9ee9('0xd')](0x194);}return _0x39c702;};}function handleError(_0x19495d,_0x4b7e6d){_0x4b7e6d=_0x4b7e6d||0x1f4;return function(_0x56a497){logger[_0x9ee9('0x1b')](_0x56a497['stack']);if(_0x56a497[_0x9ee9('0x1c')]){delete _0x56a497[_0x9ee9('0x1c')];}_0x19495d[_0x9ee9('0xe')](_0x4b7e6d)[_0x9ee9('0x1d')](_0x56a497);};}exports[_0x9ee9('0x1e')]=function(_0x50af64,_0x5d78d3){var _0x1e9c5c={};var _0x26a60e={'count':0x0,'rows':[]};var _0x959f7a=_[_0x9ee9('0x1f')](db['OpenchannelQueue'][_0x9ee9('0x20')],function(_0x5e401d){return{'name':_0x5e401d[_0x9ee9('0x21')],'type':_0x5e401d[_0x9ee9('0x22')][_0x9ee9('0x23')]};});_0x1e9c5c=qs['getOptions'](_0x959f7a,_0x50af64);var _0x2e349d={'where':_0x1e9c5c[_0x9ee9('0x24')]};return db[_0x9ee9('0x25')]['count'](_0x2e349d)[_0x9ee9('0x17')](function(_0x20065f){_0x26a60e[_0x9ee9('0x14')]=_0x20065f;_0x1e9c5c[_0x9ee9('0x26')]=qs[_0x9ee9('0x26')](_0x50af64[_0x9ee9('0x27')]);return db[_0x9ee9('0x25')]['findAll'](_0x1e9c5c);})[_0x9ee9('0x17')](function(_0x16334d){_0x26a60e[_0x9ee9('0x28')]=_0x16334d;return _0x26a60e;})['then'](respondWithFilteredResult(_0x5d78d3,_0x1e9c5c))[_0x9ee9('0x29')](handleError(_0x5d78d3,null));};exports[_0x9ee9('0x2a')]=function(_0x2994c,_0x1c35ad){var _0x595399={'raw':!![],'where':{'id':_0x2994c['params']['id']}},_0x1d1a01={};_0x1d1a01['model']=_[_0x9ee9('0x2b')](db[_0x9ee9('0x25')]['rawAttributes']);_0x1d1a01[_0x9ee9('0x27')]=_[_0x9ee9('0x2b')](_0x2994c['query']);_0x1d1a01['filters']=_['intersection'](_0x1d1a01[_0x9ee9('0x2c')],_0x1d1a01[_0x9ee9('0x27')]);_0x595399[_0x9ee9('0x2d')]=_['intersection'](_0x1d1a01[_0x9ee9('0x2c')],qs['fields'](_0x2994c['query'][_0x9ee9('0x2e')]));_0x595399[_0x9ee9('0x2d')]=_0x595399[_0x9ee9('0x2d')][_0x9ee9('0x2f')]?_0x595399[_0x9ee9('0x2d')]:_0x1d1a01[_0x9ee9('0x2c')];if(_0x2994c['query']['includeAll']){_0x595399[_0x9ee9('0x26')]=[{'all':!![]}];}_0x595399=_[_0x9ee9('0x30')]({},_0x595399,_0x2994c[_0x9ee9('0x31')]);return db[_0x9ee9('0x25')]['find'](_0x595399)[_0x9ee9('0x17')](handleEntityNotFound(_0x1c35ad,null))['then'](respondWithResult(_0x1c35ad,null))[_0x9ee9('0x29')](handleError(_0x1c35ad,null));};exports[_0x9ee9('0x32')]=function(_0x21aecc,_0x2cbd49){return db['OpenchannelQueue'][_0x9ee9('0x32')](_0x21aecc[_0x9ee9('0x33')],{})[_0x9ee9('0x17')](function(_0x4dc233){var _0x4575d1=_0x21aecc['user']['get']({'plain':!![]});if(!_0x4575d1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4575d1['role']==='user'){var _0xdce212=_0x4dc233[_0x9ee9('0x18')]({'plain':!![]});var _0x9bd4a8='OpenchannelQueues';return db['UserProfileSection'][_0x9ee9('0x34')]({'where':{'name':_0x9bd4a8,'userProfileId':_0x4575d1['userProfileId']},'raw':!![]})[_0x9ee9('0x17')](function(_0x2fced4){if(_0x2fced4&&_0x2fced4[_0x9ee9('0x35')]===0x0){return db['UserProfileResource'][_0x9ee9('0x32')]({'name':_0xdce212[_0x9ee9('0x1c')],'resourceId':_0xdce212['id'],'type':_0x2fced4[_0x9ee9('0x1c')],'sectionId':_0x2fced4['id']},{})[_0x9ee9('0x17')](function(){return _0x4dc233;});}else{return _0x4dc233;}})['catch'](function(_0x39cf45){logger[_0x9ee9('0x1b')](_0x9ee9('0x36'),_0x39cf45);throw _0x39cf45;});}return _0x4dc233;})['then'](respondWithResult(_0x2cbd49,0xc9))[_0x9ee9('0x29')](handleError(_0x2cbd49,null));};exports[_0x9ee9('0x16')]=function(_0x60f6fa,_0x2de432){if(_0x60f6fa['body']['id']){delete _0x60f6fa['body']['id'];}return db[_0x9ee9('0x25')]['find']({'where':{'id':_0x60f6fa[_0x9ee9('0x37')]['id']}})[_0x9ee9('0x17')](handleEntityNotFound(_0x2de432,null))[_0x9ee9('0x17')](saveUpdates(_0x60f6fa['body'],null))[_0x9ee9('0x17')](respondWithResult(_0x2de432,null))[_0x9ee9('0x29')](handleError(_0x2de432,null));};exports['destroy']=function(_0x4c36ba,_0xe672c){return db[_0x9ee9('0x25')][_0x9ee9('0x34')]({'where':{'id':_0x4c36ba[_0x9ee9('0x37')]['id']}})[_0x9ee9('0x17')](handleEntityNotFound(_0xe672c,null))[_0x9ee9('0x17')](removeEntity(_0xe672c,null))[_0x9ee9('0x29')](handleError(_0xe672c,null));};exports['describe']=function(_0x4bf61f,_0x4ed3f5){return db[_0x9ee9('0x25')][_0x9ee9('0x38')]()['then'](respondWithResult(_0x4ed3f5,null))[_0x9ee9('0x29')](handleError(_0x4ed3f5,null));};exports[_0x9ee9('0x39')]=function(_0x591650,_0x3aabb7){var _0x3e3c02={'raw':!![],'where':{}},_0x143259={},_0x55d457;return db['OpenchannelQueue'][_0x9ee9('0x3a')]({'where':{'id':_0x591650[_0x9ee9('0x37')]['id']}})[_0x9ee9('0x17')](handleEntityNotFound(_0x3aabb7,null))['then'](function(_0x4ad4f7){if(_0x4ad4f7){_0x55d457=_0x4ad4f7[_0x9ee9('0x18')]({'plain':!![]});_0x143259[_0x9ee9('0x2c')]=_['keys'](db[_0x9ee9('0x3b')]['rawAttributes']);_0x143259['query']=_[_0x9ee9('0x2b')](_0x591650[_0x9ee9('0x27')]);_0x143259[_0x9ee9('0x3c')]=_[_0x9ee9('0x3d')](_0x143259['model'],_0x143259[_0x9ee9('0x27')]);_0x3e3c02[_0x9ee9('0x2d')]=_[_0x9ee9('0x3d')](_0x143259[_0x9ee9('0x2c')],qs[_0x9ee9('0x2e')](_0x591650['query'][_0x9ee9('0x2e')]));_0x3e3c02[_0x9ee9('0x2d')]=_0x3e3c02[_0x9ee9('0x2d')][_0x9ee9('0x2f')]?_0x3e3c02['attributes']:_0x143259[_0x9ee9('0x2c')];if(!_0x591650['query'][_0x9ee9('0x3e')](_0x9ee9('0x3f'))){_0x3e3c02['limit']=qs[_0x9ee9('0x13')](_0x591650['query'][_0x9ee9('0x13')]);_0x3e3c02[_0x9ee9('0x11')]=qs[_0x9ee9('0x11')](_0x591650[_0x9ee9('0x27')]['offset']);}_0x3e3c02[_0x9ee9('0x40')]=qs[_0x9ee9('0x41')](_0x591650[_0x9ee9('0x27')]['sort']);_0x3e3c02[_0x9ee9('0x24')]=qs[_0x9ee9('0x3c')](_[_0x9ee9('0x42')](_0x591650[_0x9ee9('0x27')],_0x143259[_0x9ee9('0x3c')]));_0x3e3c02[_0x9ee9('0x24')][_0x9ee9('0x43')]=_0x4ad4f7['id'];if(_0x591650[_0x9ee9('0x27')]['filter']){_0x3e3c02['where']=_['merge'](_0x3e3c02['where'],{'$or':_[_0x9ee9('0x1f')](_0x3e3c02['attributes'],function(_0x35b4db){var _0x3f208a={};_0x3f208a[_0x35b4db]={'$like':'%'+_0x591650[_0x9ee9('0x27')][_0x9ee9('0x44')]+'%'};return _0x3f208a;})});}_0x3e3c02=_[_0x9ee9('0x30')]({},_0x3e3c02,_0x591650[_0x9ee9('0x31')]);return db[_0x9ee9('0x3b')][_0x9ee9('0x45')](_0x3e3c02);}})[_0x9ee9('0x17')](function(_0x1d112d){if(_0x1d112d){return db[_0x9ee9('0x46')][_0x9ee9('0x47')]({'where':{'id':_[_0x9ee9('0x1f')](_0x1d112d,_0x9ee9('0x48')),'role':_0x9ee9('0x49')},'attributes':['id',_0x9ee9('0x1c'),_0x9ee9('0x4a'),_0x9ee9('0x4b'),_0x9ee9('0x4c')]});}})['then'](function(_0x51c7b6){if(_0x51c7b6){return{'count':_0x51c7b6[_0x9ee9('0x14')],'rows':_[_0x9ee9('0x1f')](_0x51c7b6[_0x9ee9('0x28')],function(_0x1ccde2){return{'membername':_0x1ccde2[_0x9ee9('0x1c')],'UserId':_0x1ccde2['id'],'queue_name':_0x55d457[_0x9ee9('0x1c')],'OpenchannelQueueId':_0x55d457['id'],'interface':util[_0x9ee9('0x4d')](_0x9ee9('0x4e'),'SIP',_0x1ccde2[_0x9ee9('0x1c')]),'penalty':0x0,'paused':_0x1ccde2[_0x9ee9('0x4a')],'createdAt':_0x1ccde2[_0x9ee9('0x4c')],'updatedAt':_0x1ccde2[_0x9ee9('0x4b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9ee9('0x17')](respondWithFilteredResult(_0x3aabb7,_0x3e3c02))[_0x9ee9('0x29')](handleError(_0x3aabb7,null));};exports['getTeams']=function(_0x208a24,_0x39827b){var _0x1aa5bb={};var _0x31a143={};var _0x50aa28;var _0x52b1cb;return db['OpenchannelQueue'][_0x9ee9('0x3a')]({'where':{'id':_0x208a24[_0x9ee9('0x37')]['id']}})[_0x9ee9('0x17')](handleEntityNotFound(_0x39827b,null))['then'](function(_0x52338f){if(_0x52338f){_0x50aa28=_0x52338f;_0x31a143[_0x9ee9('0x2c')]=_[_0x9ee9('0x2b')](db[_0x9ee9('0x4f')][_0x9ee9('0x20')]);_0x31a143[_0x9ee9('0x27')]=_[_0x9ee9('0x2b')](_0x208a24[_0x9ee9('0x27')]);_0x31a143[_0x9ee9('0x3c')]=_[_0x9ee9('0x3d')](_0x31a143[_0x9ee9('0x2c')],_0x31a143['query']);_0x1aa5bb[_0x9ee9('0x2d')]=_[_0x9ee9('0x3d')](_0x31a143[_0x9ee9('0x2c')],qs[_0x9ee9('0x2e')](_0x208a24[_0x9ee9('0x27')][_0x9ee9('0x2e')]));_0x1aa5bb[_0x9ee9('0x2d')]=_0x1aa5bb[_0x9ee9('0x2d')][_0x9ee9('0x2f')]?_0x1aa5bb[_0x9ee9('0x2d')]:_0x31a143[_0x9ee9('0x2c')];_0x1aa5bb[_0x9ee9('0x40')]=qs[_0x9ee9('0x41')](_0x208a24[_0x9ee9('0x27')][_0x9ee9('0x41')]);_0x1aa5bb[_0x9ee9('0x24')]=qs['filters'](_['pick'](_0x208a24[_0x9ee9('0x27')],_0x31a143[_0x9ee9('0x3c')]));if(_0x208a24[_0x9ee9('0x27')][_0x9ee9('0x44')]){_0x1aa5bb[_0x9ee9('0x24')]=_[_0x9ee9('0x30')](_0x1aa5bb[_0x9ee9('0x24')],{'$or':_[_0x9ee9('0x1f')](_0x1aa5bb[_0x9ee9('0x2d')],function(_0x50be05){var _0x45e33d={};_0x45e33d[_0x50be05]={'$like':'%'+_0x208a24[_0x9ee9('0x27')][_0x9ee9('0x44')]+'%'};return _0x45e33d;})});}_0x1aa5bb=_[_0x9ee9('0x30')]({},_0x1aa5bb,_0x208a24[_0x9ee9('0x31')]);return _0x50aa28[_0x9ee9('0x50')](_0x1aa5bb);}})[_0x9ee9('0x17')](function(_0x49b4bc){if(_0x49b4bc){_0x52b1cb=_0x49b4bc['length'];if(!_0x208a24[_0x9ee9('0x27')][_0x9ee9('0x3e')]('nolimit')){_0x1aa5bb[_0x9ee9('0x13')]=qs[_0x9ee9('0x13')](_0x208a24[_0x9ee9('0x27')][_0x9ee9('0x13')]);_0x1aa5bb['offset']=qs[_0x9ee9('0x11')](_0x208a24[_0x9ee9('0x27')][_0x9ee9('0x11')]);}return _0x50aa28[_0x9ee9('0x50')](_0x1aa5bb);}})[_0x9ee9('0x17')](function(_0x58e49d){if(_0x58e49d){return _0x58e49d?{'count':_0x52b1cb,'rows':_0x58e49d}:null;}})['then'](respondWithResult(_0x39827b,null))[_0x9ee9('0x29')](handleError(_0x39827b,null));};exports[_0x9ee9('0x51')]=function(_0x45604b,_0x472606){var _0x51070f=_0x45604b[_0x9ee9('0x33')][_0x9ee9('0x52')];return db[_0x9ee9('0x4f')][_0x9ee9('0x45')]({'where':{'id':_0x51070f},'attributes':['id'],'include':[{'model':db[_0x9ee9('0x46')],'as':_0x9ee9('0x53'),'attributes':['id',_0x9ee9('0x1c'),_0x9ee9('0x54'),'voicePause',_0x9ee9('0x55')],'raw':!![]}]})['then'](function(_0x3648d2){if(_0x3648d2){var _0x5d5742=_['flatMap'](_0x3648d2,function(_0x1e68a5){var _0x16aa7e=_0x1e68a5[_0x9ee9('0x18')]({'plain':!![]});return _0x16aa7e[_0x9ee9('0x53')];});return db[_0x9ee9('0x25')][_0x9ee9('0x34')]({'where':{'id':_0x45604b['params']['id']}})[_0x9ee9('0x17')](function(_0x38fe37){return db['sequelize'][_0x9ee9('0x56')](function(_0x384a7a){return _0x38fe37[_0x9ee9('0x51')](_0x51070f,{'transaction':_0x384a7a})[_0x9ee9('0x17')](function(){return BPromise[_0x9ee9('0x57')](_0x5d5742,function(_0x3d356b){return db[_0x9ee9('0x3b')]['findOrCreate']({'where':{'UserId':_0x3d356b['id'],'OpenchannelQueueId':_0x45604b[_0x9ee9('0x37')]['id']},'transaction':_0x384a7a});});})[_0x9ee9('0x17')](function(){_0x5d5742[_0x9ee9('0x58')](function(_0x284060){socket[_0x9ee9('0x59')](_0x9ee9('0x5a'),{'UserId':_0x284060['id'],'OpenchannelQueueId':_0x38fe37['id']});});});});});}})['then'](respondWithStatusCode(_0x472606,null))[_0x9ee9('0x29')](handleError(_0x472606,null));};exports[_0x9ee9('0x5b')]=function(_0x33e206,_0x359206){return db[_0x9ee9('0x4f')]['findAll']({'where':{'id':_0x33e206['query'][_0x9ee9('0x52')]},'attributes':['id'],'include':[{'model':db[_0x9ee9('0x46')],'as':_0x9ee9('0x53'),'attributes':['id'],'raw':!![]}]})[_0x9ee9('0x17')](handleEntityNotFound(_0x359206,null))[_0x9ee9('0x17')](function(_0x22f7a3){var _0x228000=_[_0x9ee9('0x1f')](_0x22f7a3,'id');var _0x780f36=[];var _0x330ca7=[];var _0x1a4781=squel[_0x9ee9('0x5c')]();_0x1a4781['field'](_0x9ee9('0x5d'))[_0x9ee9('0x5e')](_0x9ee9('0x5f'),'tq')[_0x9ee9('0x60')](_0x9ee9('0x61'),'ut',_0x9ee9('0x62'))[_0x9ee9('0x24')](_0x9ee9('0x63'),_0x33e206[_0x9ee9('0x37')]['id']);for(var _0x254e74=0x0;_0x254e74<_0x22f7a3[_0x9ee9('0x2f')];_0x254e74+=0x1){let _0xe8ad5f=_0x22f7a3[_0x254e74];for(var _0x55b6ce=0x0;_0x55b6ce<_0xe8ad5f[_0x9ee9('0x53')][_0x9ee9('0x2f')];_0x55b6ce+=0x1){let _0x3de235=_0xe8ad5f[_0x9ee9('0x53')][_0x55b6ce];var _0x564450=_0x1a4781[_0x9ee9('0x64')]();_0x564450[_0x9ee9('0x24')](_0x9ee9('0x65'),_0x3de235['id']);_0x330ca7[_0x9ee9('0x66')](db['sequelize'][_0x9ee9('0x27')](_0x564450[_0x9ee9('0x67')](),{'type':db[_0x9ee9('0x68')]['QueryTypes'][_0x9ee9('0x69')]})['then'](function(_0x7bb3a5){if(_0x7bb3a5[_0x9ee9('0x2f')]===0x1){return _0x3de235['id'];}else{var _0x21e96b=_[_0x9ee9('0x6a')](_['map'](_0x7bb3a5,_0x9ee9('0x6b')),function(_0x3dee27){return _[_0x9ee9('0x6c')](_0x228000,_0x3dee27);});if(_0x21e96b){return _0x3de235['id'];}}}));}}return BPromise[_0x9ee9('0x6d')](_0x330ca7)[_0x9ee9('0x17')](function(_0x16d262){_0x780f36=_(_0x780f36)[_0x9ee9('0x6e')](_0x16d262)[_0x9ee9('0x6f')]()[_0x9ee9('0x70')]();return db['OpenchannelQueue'][_0x9ee9('0x34')]({'where':{'id':_0x33e206['params']['id']}})[_0x9ee9('0x17')](function(_0x23a285){return db[_0x9ee9('0x68')][_0x9ee9('0x56')](function(_0x167f20){return _0x23a285[_0x9ee9('0x5b')](_0x33e206[_0x9ee9('0x27')]['ids'],{'transaction':_0x167f20})[_0x9ee9('0x17')](function(){if(!_['isEmpty'](_0x780f36)){return _0x23a285[_0x9ee9('0x71')](_0x780f36,{'transaction':_0x167f20});}})[_0x9ee9('0x17')](function(){_0x780f36[_0x9ee9('0x58')](function(_0x1e2c89){socket['emit']('userOpenchannelQueue:remove',{'UserId':_0x1e2c89,'OpenchannelQueueId':_0x23a285['id']});});});});});});})[_0x9ee9('0x17')](respondWithStatusCode(_0x359206,null))[_0x9ee9('0x29')](handleError(_0x359206,null));};exports[_0x9ee9('0x72')]=function(_0x3e2374,_0x354734){return db[_0x9ee9('0x25')]['find']({'where':{'id':_0x3e2374['params']['id']}})[_0x9ee9('0x17')](handleEntityNotFound(_0x354734,null))['then'](function(_0x1fab68){if(_0x1fab68){return _0x1fab68['addAgents'](_0x3e2374[_0x9ee9('0x33')][_0x9ee9('0x52')],_['omit'](_0x3e2374[_0x9ee9('0x33')],['ids','id'])||{})[_0x9ee9('0x73')](function(_0x1a1fd5){for(var _0x5c4e5a=0x0;_0x5c4e5a<_0x3e2374[_0x9ee9('0x33')]['ids']['length'];_0x5c4e5a+=0x1){socket[_0x9ee9('0x59')](_0x9ee9('0x5a'),{'UserId':Number(_0x3e2374['body'][_0x9ee9('0x52')][_0x5c4e5a]),'OpenchannelQueueId':Number(_0x3e2374[_0x9ee9('0x37')]['id'])});}return _0x1a1fd5;});}})['then'](respondWithResult(_0x354734,null))['catch'](handleError(_0x354734,null));};exports[_0x9ee9('0x71')]=function(_0x509d83,_0xcaa71b){return db[_0x9ee9('0x25')]['find']({'where':{'id':_0x509d83['params']['id']}})['then'](handleEntityNotFound(_0xcaa71b,null))[_0x9ee9('0x17')](function(_0x3e013e){if(_0x3e013e){return _0x3e013e[_0x9ee9('0x71')](_0x509d83[_0x9ee9('0x27')][_0x9ee9('0x52')])[_0x9ee9('0x17')](function(){if(_[_0x9ee9('0x74')](_0x509d83[_0x9ee9('0x27')][_0x9ee9('0x52')])){for(var _0x41e44c=0x0;_0x41e44c<_0x509d83['query'][_0x9ee9('0x52')][_0x9ee9('0x2f')];_0x41e44c+=0x1){socket['emit'](_0x9ee9('0x75'),{'UserId':Number(_0x509d83[_0x9ee9('0x27')]['ids'][_0x41e44c]),'OpenchannelQueueId':Number(_0x509d83[_0x9ee9('0x37')]['id'])});}}else{socket['emit'](_0x9ee9('0x75'),{'UserId':Number(_0x509d83['query']['ids']),'OpenchannelQueueId':Number(_0x509d83[_0x9ee9('0x37')]['id'])});}});}})[_0x9ee9('0x17')](respondWithStatusCode(_0xcaa71b,null))[_0x9ee9('0x29')](handleError(_0xcaa71b,null));};exports['getAgents']=function(_0x3f29d8,_0x2688c3){var _0x397829={};var _0xca894a={};var _0x18b07a;var _0x875192;return db['OpenchannelQueue'][_0x9ee9('0x3a')]({'where':{'id':_0x3f29d8['params']['id']}})[_0x9ee9('0x17')](handleEntityNotFound(_0x2688c3,null))[_0x9ee9('0x17')](function(_0x432e35){if(_0x432e35){_0x18b07a=_0x432e35;_0xca894a[_0x9ee9('0x2c')]=_[_0x9ee9('0x2b')](db[_0x9ee9('0x46')][_0x9ee9('0x20')]);_0xca894a[_0x9ee9('0x27')]=_[_0x9ee9('0x2b')](_0x3f29d8[_0x9ee9('0x27')]);_0xca894a[_0x9ee9('0x3c')]=_['intersection'](_0xca894a['model'],_0xca894a[_0x9ee9('0x27')]);_0x397829['attributes']=_[_0x9ee9('0x3d')](_0xca894a[_0x9ee9('0x2c')],qs[_0x9ee9('0x2e')](_0x3f29d8[_0x9ee9('0x27')][_0x9ee9('0x2e')]));_0x397829['attributes']=_0x397829[_0x9ee9('0x2d')][_0x9ee9('0x2f')]?_0x397829['attributes']:_0xca894a['model'];_0x397829[_0x9ee9('0x40')]=qs[_0x9ee9('0x41')](_0x3f29d8[_0x9ee9('0x27')][_0x9ee9('0x41')]);_0x397829[_0x9ee9('0x24')]=qs['filters'](_['pick'](_0x3f29d8[_0x9ee9('0x27')],_0xca894a['filters']));if(_0x3f29d8[_0x9ee9('0x27')][_0x9ee9('0x44')]){_0x397829[_0x9ee9('0x24')]=_[_0x9ee9('0x30')](_0x397829[_0x9ee9('0x24')],{'$or':_[_0x9ee9('0x1f')](_0x397829[_0x9ee9('0x2d')],function(_0x5d6216){var _0x1d027c={};_0x1d027c[_0x5d6216]={'$like':'%'+_0x3f29d8[_0x9ee9('0x27')][_0x9ee9('0x44')]+'%'};return _0x1d027c;})});}_0x397829=_[_0x9ee9('0x30')]({},_0x397829,_0x3f29d8['options']);return _0x18b07a[_0x9ee9('0x76')](_0x397829);}})[_0x9ee9('0x17')](function(_0x32e971){if(_0x32e971){_0x875192=_0x32e971[_0x9ee9('0x2f')];if(!_0x3f29d8['query'][_0x9ee9('0x3e')](_0x9ee9('0x3f'))){_0x397829[_0x9ee9('0x13')]=qs[_0x9ee9('0x13')](_0x3f29d8[_0x9ee9('0x27')][_0x9ee9('0x13')]);_0x397829['offset']=qs[_0x9ee9('0x11')](_0x3f29d8[_0x9ee9('0x27')]['offset']);}return _0x18b07a[_0x9ee9('0x76')](_0x397829);}})[_0x9ee9('0x17')](function(_0x6e2919){if(_0x6e2919){return _0x6e2919?{'count':_0x875192,'rows':_0x6e2919}:null;}})[_0x9ee9('0x17')](respondWithResult(_0x2688c3,null))[_0x9ee9('0x29')](handleError(_0x2688c3,null));}; \ No newline at end of file +var _0xdca3=['transaction','each','findOrCreate','emit','userOpenchannelQueue:save','ids','select','field','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','includes','all','union','compact','value','removeTeams','isEmpty','forEach','userOpenchannelQueue:remove','addAgents','omit','removeAgents','isArray','getAgents','pick','bluebird','util','lodash','squel','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','UserProfileResource','error','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','type','key','getOptions','where','include','query','findAll','rows','catch','params','model','keys','attributes','intersection','fields','length','includeAll','merge','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','body','describe','getMembers','findOne','UserOpenchannelQueue','filters','hasOwnProperty','nolimit','order','sort','filter','User','agent','openchannelPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','addTeams','Agents','online','voicePause','interface','flatMap','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xdca3,0x9b));var _0x3dca=function(_0x57e80b,_0x1ecd5d){_0x57e80b=_0x57e80b-0x0;var _0x3884ed=_0xdca3[_0x57e80b];return _0x3884ed;};'use strict';var BPromise=require(_0x3dca('0x0'));var util=require(_0x3dca('0x1'));var _=require(_0x3dca('0x2'));var squel=require(_0x3dca('0x3'));var Redis=require('ioredis');var qs=require(_0x3dca('0x4'));var logger=require(_0x3dca('0x5'))(_0x3dca('0x6'));var config=require('../../config/environment');var db=require(_0x3dca('0x7'))['db'];config[_0x3dca('0x8')]=_[_0x3dca('0x9')](config['redis'],{'host':_0x3dca('0xa'),'port':0x18eb});var socket=require(_0x3dca('0xb'))(new Redis(config[_0x3dca('0x8')]));require('./openchannelQueue.socket')[_0x3dca('0xc')](socket);function respondWithStatusCode(_0x2815f6,_0x354b21){_0x354b21=_0x354b21||0xcc;return function(_0x235889){if(_0x235889){return _0x2815f6[_0x3dca('0xd')](_0x354b21);}return _0x2815f6[_0x3dca('0xe')](_0x354b21)['end']();};}function respondWithResult(_0x1aed69,_0x186884){_0x186884=_0x186884||0xc8;return function(_0x4b8710){if(_0x4b8710){return _0x1aed69['status'](_0x186884)[_0x3dca('0xf')](_0x4b8710);}};}function respondWithFilteredResult(_0x264563,_0x2e39ae){return function(_0x51e15){if(_0x51e15){var _0x1430d5=typeof _0x2e39ae[_0x3dca('0x10')]===_0x3dca('0x11')&&typeof _0x2e39ae[_0x3dca('0x12')]===_0x3dca('0x11');var _0x4ff997=_0x51e15[_0x3dca('0x13')];var _0x372d7b=_0x1430d5?0x0:_0x2e39ae[_0x3dca('0x10')];var _0x5b9263=_0x1430d5?_0x51e15[_0x3dca('0x13')]:_0x2e39ae[_0x3dca('0x10')]+_0x2e39ae[_0x3dca('0x12')];var _0xbf323a;if(_0x5b9263>=_0x4ff997){_0x5b9263=_0x4ff997;_0xbf323a=0xc8;}else{_0xbf323a=0xce;}_0x264563[_0x3dca('0xe')](_0xbf323a);return _0x264563[_0x3dca('0x14')](_0x3dca('0x15'),_0x372d7b+'-'+_0x5b9263+'/'+_0x4ff997)[_0x3dca('0xf')](_0x51e15);}return null;};}function saveUpdates(_0x48bab1){return function(_0x1e3ffd){if(_0x1e3ffd){return _0x1e3ffd[_0x3dca('0x16')](_0x48bab1)[_0x3dca('0x17')](function(_0x361f36){return _0x361f36;});}return null;};}function removeEntity(_0x39334a){return function(_0x13c8cf){if(_0x13c8cf){return _0x13c8cf[_0x3dca('0x18')]()[_0x3dca('0x17')](function(){var _0x39e216=_0x13c8cf[_0x3dca('0x19')]({'plain':!![]});var _0x258c84='OpenchannelQueues';return db[_0x3dca('0x1a')]['destroy']({'where':{'type':_0x258c84,'resourceId':_0x39e216['id']}})[_0x3dca('0x17')](function(){return _0x13c8cf;});})[_0x3dca('0x17')](function(){_0x39334a[_0x3dca('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ac0bd){return function(_0x42c2ce){if(!_0x42c2ce){_0x2ac0bd[_0x3dca('0xd')](0x194);}return _0x42c2ce;};}function handleError(_0x35a5ba,_0x2a19e5){_0x2a19e5=_0x2a19e5||0x1f4;return function(_0x4ccb65){logger[_0x3dca('0x1b')](_0x4ccb65['stack']);if(_0x4ccb65[_0x3dca('0x1c')]){delete _0x4ccb65['name'];}_0x35a5ba[_0x3dca('0xe')](_0x2a19e5)[_0x3dca('0x1d')](_0x4ccb65);};}exports[_0x3dca('0x1e')]=function(_0x386f50,_0x2fdce2){var _0x8c6471={};var _0x5191dc={'count':0x0,'rows':[]};var _0xce2973=_[_0x3dca('0x1f')](db[_0x3dca('0x20')][_0x3dca('0x21')],function(_0x59a637){return{'name':_0x59a637[_0x3dca('0x22')],'type':_0x59a637[_0x3dca('0x23')][_0x3dca('0x24')]};});_0x8c6471=qs[_0x3dca('0x25')](_0xce2973,_0x386f50);var _0x4e52e2={'where':_0x8c6471[_0x3dca('0x26')]};return db[_0x3dca('0x20')]['count'](_0x4e52e2)['then'](function(_0x367860){_0x5191dc['count']=_0x367860;_0x8c6471[_0x3dca('0x27')]=qs[_0x3dca('0x27')](_0x386f50[_0x3dca('0x28')]);return db[_0x3dca('0x20')][_0x3dca('0x29')](_0x8c6471);})[_0x3dca('0x17')](function(_0x3a4f25){_0x5191dc[_0x3dca('0x2a')]=_0x3a4f25;return _0x5191dc;})[_0x3dca('0x17')](respondWithFilteredResult(_0x2fdce2,_0x8c6471))[_0x3dca('0x2b')](handleError(_0x2fdce2,null));};exports['show']=function(_0x556394,_0x4c73d8){var _0x5ce2e7={'raw':!![],'where':{'id':_0x556394[_0x3dca('0x2c')]['id']}},_0x226cf0={};_0x226cf0[_0x3dca('0x2d')]=_[_0x3dca('0x2e')](db[_0x3dca('0x20')][_0x3dca('0x21')]);_0x226cf0['query']=_[_0x3dca('0x2e')](_0x556394['query']);_0x226cf0['filters']=_['intersection'](_0x226cf0[_0x3dca('0x2d')],_0x226cf0[_0x3dca('0x28')]);_0x5ce2e7[_0x3dca('0x2f')]=_[_0x3dca('0x30')](_0x226cf0['model'],qs[_0x3dca('0x31')](_0x556394[_0x3dca('0x28')][_0x3dca('0x31')]));_0x5ce2e7[_0x3dca('0x2f')]=_0x5ce2e7['attributes'][_0x3dca('0x32')]?_0x5ce2e7['attributes']:_0x226cf0[_0x3dca('0x2d')];if(_0x556394[_0x3dca('0x28')][_0x3dca('0x33')]){_0x5ce2e7['include']=[{'all':!![]}];}_0x5ce2e7=_[_0x3dca('0x34')]({},_0x5ce2e7,_0x556394[_0x3dca('0x35')]);return db['OpenchannelQueue'][_0x3dca('0x36')](_0x5ce2e7)['then'](handleEntityNotFound(_0x4c73d8,null))['then'](respondWithResult(_0x4c73d8,null))[_0x3dca('0x2b')](handleError(_0x4c73d8,null));};exports['create']=function(_0xc2fbdf,_0x5d2af4){return db[_0x3dca('0x20')][_0x3dca('0x37')](_0xc2fbdf['body'],{})[_0x3dca('0x17')](function(_0xca9c30){var _0x5640db=_0xc2fbdf[_0x3dca('0x38')]['get']({'plain':!![]});if(!_0x5640db)throw new Error(_0x3dca('0x39'));if(_0x5640db[_0x3dca('0x3a')]===_0x3dca('0x38')){var _0x2ab75b=_0xca9c30[_0x3dca('0x19')]({'plain':!![]});var _0x32c4f5='OpenchannelQueues';return db[_0x3dca('0x3b')][_0x3dca('0x36')]({'where':{'name':_0x32c4f5,'userProfileId':_0x5640db[_0x3dca('0x3c')]},'raw':!![]})[_0x3dca('0x17')](function(_0xa05c21){if(_0xa05c21&&_0xa05c21[_0x3dca('0x3d')]===0x0){return db['UserProfileResource'][_0x3dca('0x37')]({'name':_0x2ab75b[_0x3dca('0x1c')],'resourceId':_0x2ab75b['id'],'type':_0xa05c21['name'],'sectionId':_0xa05c21['id']},{})[_0x3dca('0x17')](function(){return _0xca9c30;});}else{return _0xca9c30;}})[_0x3dca('0x2b')](function(_0x5942de){logger[_0x3dca('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5942de);throw _0x5942de;});}return _0xca9c30;})[_0x3dca('0x17')](respondWithResult(_0x5d2af4,0xc9))[_0x3dca('0x2b')](handleError(_0x5d2af4,null));};exports[_0x3dca('0x16')]=function(_0x1452e6,_0x223d5c){if(_0x1452e6[_0x3dca('0x3e')]['id']){delete _0x1452e6[_0x3dca('0x3e')]['id'];}return db[_0x3dca('0x20')][_0x3dca('0x36')]({'where':{'id':_0x1452e6[_0x3dca('0x2c')]['id']}})[_0x3dca('0x17')](handleEntityNotFound(_0x223d5c,null))[_0x3dca('0x17')](saveUpdates(_0x1452e6[_0x3dca('0x3e')],null))[_0x3dca('0x17')](respondWithResult(_0x223d5c,null))['catch'](handleError(_0x223d5c,null));};exports[_0x3dca('0x18')]=function(_0x22af32,_0x68ea8f){return db[_0x3dca('0x20')][_0x3dca('0x36')]({'where':{'id':_0x22af32['params']['id']}})['then'](handleEntityNotFound(_0x68ea8f,null))['then'](removeEntity(_0x68ea8f,null))['catch'](handleError(_0x68ea8f,null));};exports['describe']=function(_0xc6f673,_0x58bf79){return db[_0x3dca('0x20')][_0x3dca('0x3f')]()[_0x3dca('0x17')](respondWithResult(_0x58bf79,null))['catch'](handleError(_0x58bf79,null));};exports[_0x3dca('0x40')]=function(_0x420622,_0x182421){var _0xaef35={'raw':!![],'where':{}},_0x5353e2={},_0x1e66d3;return db[_0x3dca('0x20')][_0x3dca('0x41')]({'where':{'id':_0x420622[_0x3dca('0x2c')]['id']}})['then'](handleEntityNotFound(_0x182421,null))[_0x3dca('0x17')](function(_0x19d5ab){if(_0x19d5ab){_0x1e66d3=_0x19d5ab['get']({'plain':!![]});_0x5353e2[_0x3dca('0x2d')]=_[_0x3dca('0x2e')](db[_0x3dca('0x42')][_0x3dca('0x21')]);_0x5353e2[_0x3dca('0x28')]=_[_0x3dca('0x2e')](_0x420622[_0x3dca('0x28')]);_0x5353e2[_0x3dca('0x43')]=_['intersection'](_0x5353e2[_0x3dca('0x2d')],_0x5353e2[_0x3dca('0x28')]);_0xaef35[_0x3dca('0x2f')]=_['intersection'](_0x5353e2[_0x3dca('0x2d')],qs[_0x3dca('0x31')](_0x420622[_0x3dca('0x28')][_0x3dca('0x31')]));_0xaef35[_0x3dca('0x2f')]=_0xaef35[_0x3dca('0x2f')][_0x3dca('0x32')]?_0xaef35[_0x3dca('0x2f')]:_0x5353e2[_0x3dca('0x2d')];if(!_0x420622[_0x3dca('0x28')][_0x3dca('0x44')](_0x3dca('0x45'))){_0xaef35['limit']=qs['limit'](_0x420622[_0x3dca('0x28')][_0x3dca('0x12')]);_0xaef35[_0x3dca('0x10')]=qs[_0x3dca('0x10')](_0x420622[_0x3dca('0x28')]['offset']);}_0xaef35[_0x3dca('0x46')]=qs[_0x3dca('0x47')](_0x420622[_0x3dca('0x28')]['sort']);_0xaef35[_0x3dca('0x26')]=qs[_0x3dca('0x43')](_['pick'](_0x420622[_0x3dca('0x28')],_0x5353e2['filters']));_0xaef35[_0x3dca('0x26')]['OpenchannelQueueId']=_0x19d5ab['id'];if(_0x420622[_0x3dca('0x28')][_0x3dca('0x48')]){_0xaef35[_0x3dca('0x26')]=_[_0x3dca('0x34')](_0xaef35[_0x3dca('0x26')],{'$or':_[_0x3dca('0x1f')](_0xaef35[_0x3dca('0x2f')],function(_0x3ab876){var _0x390180={};_0x390180[_0x3ab876]={'$like':'%'+_0x420622['query']['filter']+'%'};return _0x390180;})});}_0xaef35=_['merge']({},_0xaef35,_0x420622['options']);return db[_0x3dca('0x42')][_0x3dca('0x29')](_0xaef35);}})[_0x3dca('0x17')](function(_0x4c50e0){if(_0x4c50e0){return db[_0x3dca('0x49')]['findAndCountAll']({'where':{'id':_[_0x3dca('0x1f')](_0x4c50e0,'UserId'),'role':_0x3dca('0x4a')},'attributes':['id',_0x3dca('0x1c'),_0x3dca('0x4b'),_0x3dca('0x4c'),_0x3dca('0x4d')]});}})[_0x3dca('0x17')](function(_0x1a0d31){if(_0x1a0d31){return{'count':_0x1a0d31['count'],'rows':_['map'](_0x1a0d31[_0x3dca('0x2a')],function(_0x1841a8){return{'membername':_0x1841a8['name'],'UserId':_0x1841a8['id'],'queue_name':_0x1e66d3[_0x3dca('0x1c')],'OpenchannelQueueId':_0x1e66d3['id'],'interface':util['format'](_0x3dca('0x4e'),_0x3dca('0x4f'),_0x1841a8[_0x3dca('0x1c')]),'penalty':0x0,'paused':_0x1841a8['openchannelPause'],'createdAt':_0x1841a8[_0x3dca('0x4d')],'updatedAt':_0x1841a8[_0x3dca('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3dca('0x17')](respondWithFilteredResult(_0x182421,_0xaef35))[_0x3dca('0x2b')](handleError(_0x182421,null));};exports[_0x3dca('0x50')]=function(_0x50a915,_0x1a36af){var _0x4ca4cb={};var _0x4a65e6={};var _0x1ad85f;var _0x4777a8;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x50a915[_0x3dca('0x2c')]['id']}})[_0x3dca('0x17')](handleEntityNotFound(_0x1a36af,null))[_0x3dca('0x17')](function(_0x4d4eaa){if(_0x4d4eaa){_0x1ad85f=_0x4d4eaa;_0x4a65e6['model']=_[_0x3dca('0x2e')](db[_0x3dca('0x51')][_0x3dca('0x21')]);_0x4a65e6['query']=_['keys'](_0x50a915['query']);_0x4a65e6['filters']=_[_0x3dca('0x30')](_0x4a65e6[_0x3dca('0x2d')],_0x4a65e6[_0x3dca('0x28')]);_0x4ca4cb[_0x3dca('0x2f')]=_[_0x3dca('0x30')](_0x4a65e6['model'],qs[_0x3dca('0x31')](_0x50a915['query']['fields']));_0x4ca4cb[_0x3dca('0x2f')]=_0x4ca4cb[_0x3dca('0x2f')][_0x3dca('0x32')]?_0x4ca4cb['attributes']:_0x4a65e6[_0x3dca('0x2d')];_0x4ca4cb[_0x3dca('0x46')]=qs[_0x3dca('0x47')](_0x50a915[_0x3dca('0x28')][_0x3dca('0x47')]);_0x4ca4cb['where']=qs['filters'](_['pick'](_0x50a915['query'],_0x4a65e6[_0x3dca('0x43')]));if(_0x50a915[_0x3dca('0x28')][_0x3dca('0x48')]){_0x4ca4cb['where']=_[_0x3dca('0x34')](_0x4ca4cb[_0x3dca('0x26')],{'$or':_[_0x3dca('0x1f')](_0x4ca4cb[_0x3dca('0x2f')],function(_0x5c7e39){var _0x3424af={};_0x3424af[_0x5c7e39]={'$like':'%'+_0x50a915['query'][_0x3dca('0x48')]+'%'};return _0x3424af;})});}_0x4ca4cb=_['merge']({},_0x4ca4cb,_0x50a915[_0x3dca('0x35')]);return _0x1ad85f[_0x3dca('0x50')](_0x4ca4cb);}})[_0x3dca('0x17')](function(_0x486bfc){if(_0x486bfc){_0x4777a8=_0x486bfc[_0x3dca('0x32')];if(!_0x50a915['query'][_0x3dca('0x44')](_0x3dca('0x45'))){_0x4ca4cb[_0x3dca('0x12')]=qs[_0x3dca('0x12')](_0x50a915[_0x3dca('0x28')][_0x3dca('0x12')]);_0x4ca4cb['offset']=qs[_0x3dca('0x10')](_0x50a915['query'][_0x3dca('0x10')]);}return _0x1ad85f[_0x3dca('0x50')](_0x4ca4cb);}})['then'](function(_0x366160){if(_0x366160){return _0x366160?{'count':_0x4777a8,'rows':_0x366160}:null;}})['then'](respondWithResult(_0x1a36af,null))[_0x3dca('0x2b')](handleError(_0x1a36af,null));};exports[_0x3dca('0x52')]=function(_0x9ab06e,_0x2649c6){var _0x2c54cc=_0x9ab06e[_0x3dca('0x3e')]['ids'];return db[_0x3dca('0x51')][_0x3dca('0x29')]({'where':{'id':_0x2c54cc},'attributes':['id'],'include':[{'model':db[_0x3dca('0x49')],'as':_0x3dca('0x53'),'attributes':['id',_0x3dca('0x1c'),_0x3dca('0x54'),_0x3dca('0x55'),_0x3dca('0x56')],'raw':!![]}]})[_0x3dca('0x17')](function(_0x2c0d91){if(_0x2c0d91){var _0xbf8361=_[_0x3dca('0x57')](_0x2c0d91,function(_0x469787){var _0x81cf1f=_0x469787['get']({'plain':!![]});return _0x81cf1f[_0x3dca('0x53')];});return db[_0x3dca('0x20')][_0x3dca('0x36')]({'where':{'id':_0x9ab06e[_0x3dca('0x2c')]['id']}})[_0x3dca('0x17')](function(_0x10d8ed){return db[_0x3dca('0x58')][_0x3dca('0x59')](function(_0xef53c8){return _0x10d8ed[_0x3dca('0x52')](_0x2c54cc,{'transaction':_0xef53c8})[_0x3dca('0x17')](function(){return BPromise[_0x3dca('0x5a')](_0xbf8361,function(_0x1d5d58){return db[_0x3dca('0x42')][_0x3dca('0x5b')]({'where':{'UserId':_0x1d5d58['id'],'OpenchannelQueueId':_0x9ab06e['params']['id']},'transaction':_0xef53c8});});})['then'](function(){_0xbf8361['forEach'](function(_0x33c2a4){socket[_0x3dca('0x5c')](_0x3dca('0x5d'),{'UserId':_0x33c2a4['id'],'OpenchannelQueueId':_0x10d8ed['id']});});});});});}})[_0x3dca('0x17')](respondWithStatusCode(_0x2649c6,null))[_0x3dca('0x2b')](handleError(_0x2649c6,null));};exports['removeTeams']=function(_0x5d5e97,_0x2af4b0){return db[_0x3dca('0x51')][_0x3dca('0x29')]({'where':{'id':_0x5d5e97[_0x3dca('0x28')][_0x3dca('0x5e')]},'attributes':['id'],'include':[{'model':db[_0x3dca('0x49')],'as':_0x3dca('0x53'),'attributes':['id'],'raw':!![]}]})[_0x3dca('0x17')](handleEntityNotFound(_0x2af4b0,null))['then'](function(_0x5ae28f){var _0x5b362a=_['map'](_0x5ae28f,'id');var _0x3cab5e=[];var _0x3df237=[];var _0x4b83b4=squel[_0x3dca('0x5f')]();_0x4b83b4[_0x3dca('0x60')]('tq.TeamId')[_0x3dca('0x61')](_0x3dca('0x62'),'tq')[_0x3dca('0x63')](_0x3dca('0x64'),'ut',_0x3dca('0x65'))[_0x3dca('0x26')]('OpenchannelQueueId\x20=\x20?',_0x5d5e97[_0x3dca('0x2c')]['id']);for(var _0x53cfb6=0x0;_0x53cfb6<_0x5ae28f[_0x3dca('0x32')];_0x53cfb6+=0x1){let _0x3e8b68=_0x5ae28f[_0x53cfb6];for(var _0x5ffde7=0x0;_0x5ffde7<_0x3e8b68[_0x3dca('0x53')][_0x3dca('0x32')];_0x5ffde7+=0x1){let _0x5c3178=_0x3e8b68[_0x3dca('0x53')][_0x5ffde7];var _0x27703c=_0x4b83b4[_0x3dca('0x66')]();_0x27703c['where'](_0x3dca('0x67'),_0x5c3178['id']);_0x3df237[_0x3dca('0x68')](db['sequelize'][_0x3dca('0x28')](_0x27703c[_0x3dca('0x69')](),{'type':db[_0x3dca('0x58')][_0x3dca('0x6a')]['SELECT']})[_0x3dca('0x17')](function(_0x2512ab){if(_0x2512ab['length']===0x1){return _0x5c3178['id'];}else{var _0x79b2f9=_['every'](_[_0x3dca('0x1f')](_0x2512ab,'TeamId'),function(_0x2d4fa6){return _[_0x3dca('0x6b')](_0x5b362a,_0x2d4fa6);});if(_0x79b2f9){return _0x5c3178['id'];}}}));}}return BPromise[_0x3dca('0x6c')](_0x3df237)[_0x3dca('0x17')](function(_0x46ce31){_0x3cab5e=_(_0x3cab5e)[_0x3dca('0x6d')](_0x46ce31)[_0x3dca('0x6e')]()[_0x3dca('0x6f')]();return db[_0x3dca('0x20')][_0x3dca('0x36')]({'where':{'id':_0x5d5e97[_0x3dca('0x2c')]['id']}})[_0x3dca('0x17')](function(_0x1d610e){return db[_0x3dca('0x58')][_0x3dca('0x59')](function(_0x32133f){return _0x1d610e[_0x3dca('0x70')](_0x5d5e97[_0x3dca('0x28')][_0x3dca('0x5e')],{'transaction':_0x32133f})['then'](function(){if(!_[_0x3dca('0x71')](_0x3cab5e)){return _0x1d610e['removeAgents'](_0x3cab5e,{'transaction':_0x32133f});}})[_0x3dca('0x17')](function(){_0x3cab5e[_0x3dca('0x72')](function(_0x211fd5){socket[_0x3dca('0x5c')](_0x3dca('0x73'),{'UserId':_0x211fd5,'OpenchannelQueueId':_0x1d610e['id']});});});});});});})[_0x3dca('0x17')](respondWithStatusCode(_0x2af4b0,null))['catch'](handleError(_0x2af4b0,null));};exports['addAgents']=function(_0x2b6169,_0xdff527){return db['OpenchannelQueue']['find']({'where':{'id':_0x2b6169[_0x3dca('0x2c')]['id']}})['then'](handleEntityNotFound(_0xdff527,null))['then'](function(_0x8ccc08){if(_0x8ccc08){return _0x8ccc08[_0x3dca('0x74')](_0x2b6169[_0x3dca('0x3e')]['ids'],_[_0x3dca('0x75')](_0x2b6169[_0x3dca('0x3e')],[_0x3dca('0x5e'),'id'])||{})['spread'](function(_0x5248a6){for(var _0xd1a00a=0x0;_0xd1a00a<_0x2b6169['body']['ids']['length'];_0xd1a00a+=0x1){socket[_0x3dca('0x5c')](_0x3dca('0x5d'),{'UserId':Number(_0x2b6169['body'][_0x3dca('0x5e')][_0xd1a00a]),'OpenchannelQueueId':Number(_0x2b6169['params']['id'])});}return _0x5248a6;});}})['then'](respondWithResult(_0xdff527,null))[_0x3dca('0x2b')](handleError(_0xdff527,null));};exports[_0x3dca('0x76')]=function(_0x523b7c,_0x415feb){return db[_0x3dca('0x20')][_0x3dca('0x36')]({'where':{'id':_0x523b7c[_0x3dca('0x2c')]['id']}})[_0x3dca('0x17')](handleEntityNotFound(_0x415feb,null))[_0x3dca('0x17')](function(_0x308fde){if(_0x308fde){return _0x308fde[_0x3dca('0x76')](_0x523b7c['query'][_0x3dca('0x5e')])[_0x3dca('0x17')](function(){if(_[_0x3dca('0x77')](_0x523b7c['query'][_0x3dca('0x5e')])){for(var _0x39c357=0x0;_0x39c357<_0x523b7c[_0x3dca('0x28')][_0x3dca('0x5e')][_0x3dca('0x32')];_0x39c357+=0x1){socket[_0x3dca('0x5c')](_0x3dca('0x73'),{'UserId':Number(_0x523b7c[_0x3dca('0x28')]['ids'][_0x39c357]),'OpenchannelQueueId':Number(_0x523b7c[_0x3dca('0x2c')]['id'])});}}else{socket[_0x3dca('0x5c')](_0x3dca('0x73'),{'UserId':Number(_0x523b7c[_0x3dca('0x28')][_0x3dca('0x5e')]),'OpenchannelQueueId':Number(_0x523b7c['params']['id'])});}});}})[_0x3dca('0x17')](respondWithStatusCode(_0x415feb,null))['catch'](handleError(_0x415feb,null));};exports[_0x3dca('0x78')]=function(_0x49d937,_0x95173a){var _0x7e2519={};var _0x1e3de9={};var _0x3df12f;var _0x1d31ab;return db[_0x3dca('0x20')]['findOne']({'where':{'id':_0x49d937[_0x3dca('0x2c')]['id']}})[_0x3dca('0x17')](handleEntityNotFound(_0x95173a,null))[_0x3dca('0x17')](function(_0x218c43){if(_0x218c43){_0x3df12f=_0x218c43;_0x1e3de9[_0x3dca('0x2d')]=_[_0x3dca('0x2e')](db['User'][_0x3dca('0x21')]);_0x1e3de9[_0x3dca('0x28')]=_[_0x3dca('0x2e')](_0x49d937[_0x3dca('0x28')]);_0x1e3de9[_0x3dca('0x43')]=_[_0x3dca('0x30')](_0x1e3de9[_0x3dca('0x2d')],_0x1e3de9[_0x3dca('0x28')]);_0x7e2519[_0x3dca('0x2f')]=_['intersection'](_0x1e3de9['model'],qs['fields'](_0x49d937[_0x3dca('0x28')][_0x3dca('0x31')]));_0x7e2519[_0x3dca('0x2f')]=_0x7e2519[_0x3dca('0x2f')][_0x3dca('0x32')]?_0x7e2519[_0x3dca('0x2f')]:_0x1e3de9[_0x3dca('0x2d')];_0x7e2519[_0x3dca('0x46')]=qs['sort'](_0x49d937[_0x3dca('0x28')][_0x3dca('0x47')]);_0x7e2519[_0x3dca('0x26')]=qs[_0x3dca('0x43')](_[_0x3dca('0x79')](_0x49d937[_0x3dca('0x28')],_0x1e3de9['filters']));if(_0x49d937[_0x3dca('0x28')][_0x3dca('0x48')]){_0x7e2519[_0x3dca('0x26')]=_[_0x3dca('0x34')](_0x7e2519[_0x3dca('0x26')],{'$or':_['map'](_0x7e2519[_0x3dca('0x2f')],function(_0x1eb59d){var _0x485f13={};_0x485f13[_0x1eb59d]={'$like':'%'+_0x49d937[_0x3dca('0x28')][_0x3dca('0x48')]+'%'};return _0x485f13;})});}_0x7e2519=_[_0x3dca('0x34')]({},_0x7e2519,_0x49d937[_0x3dca('0x35')]);return _0x3df12f[_0x3dca('0x78')](_0x7e2519);}})[_0x3dca('0x17')](function(_0x427aa7){if(_0x427aa7){_0x1d31ab=_0x427aa7['length'];if(!_0x49d937[_0x3dca('0x28')]['hasOwnProperty'](_0x3dca('0x45'))){_0x7e2519[_0x3dca('0x12')]=qs[_0x3dca('0x12')](_0x49d937[_0x3dca('0x28')][_0x3dca('0x12')]);_0x7e2519[_0x3dca('0x10')]=qs[_0x3dca('0x10')](_0x49d937[_0x3dca('0x28')][_0x3dca('0x10')]);}return _0x3df12f[_0x3dca('0x78')](_0x7e2519);}})['then'](function(_0x57a88a){if(_0x57a88a){return _0x57a88a?{'count':_0x1d31ab,'rows':_0x57a88a}:null;}})[_0x3dca('0x17')](respondWithResult(_0x95173a,null))[_0x3dca('0x2b')](handleError(_0x95173a,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 64d26f7..30b2c3f 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 _0x1abc=['save','update','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners'];(function(_0x143932,_0x4e5308){var _0x5cf2dc=function(_0x3d72a2){while(--_0x3d72a2){_0x143932['push'](_0x143932['shift']());}};_0x5cf2dc(++_0x4e5308);}(_0x1abc,0x191));var _0xc1ab=function(_0xab3958,_0x2aff3e){_0xab3958=_0xab3958-0x0;var _0x309147=_0x1abc[_0xab3958];return _0x309147;};'use strict';var EventEmitter=require(_0xc1ab('0x0'));var OpenchannelQueue=require(_0xc1ab('0x1'))['db'][_0xc1ab('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xc1ab('0x3')](0x0);var events={'afterCreate':_0xc1ab('0x4'),'afterUpdate':_0xc1ab('0x5'),'afterDestroy':'remove'};function emitEvent(_0x37a326){return function(_0x224128,_0x37338a,_0x58ae05){OpenchannelQueueEvents['emit'](_0x37a326+':'+_0x224128['id'],_0x224128);OpenchannelQueueEvents['emit'](_0x37a326,_0x224128);_0x58ae05(null);};}for(var e in events){if(events[_0xc1ab('0x6')](e)){var event=events[e];OpenchannelQueue[_0xc1ab('0x7')](e,emitEvent(event));}}module[_0xc1ab('0x8')]=OpenchannelQueueEvents; \ No newline at end of file +var _0xe909=['save','update','remove','emit','exports','../../mysqldb','OpenchannelQueue','setMaxListeners'];(function(_0x113de1,_0x9c179a){var _0xa1aa86=function(_0x3d84ff){while(--_0x3d84ff){_0x113de1['push'](_0x113de1['shift']());}};_0xa1aa86(++_0x9c179a);}(_0xe909,0x1c5));var _0x9e90=function(_0x4efb22,_0x53b3eb){_0x4efb22=_0x4efb22-0x0;var _0x389e1f=_0xe909[_0x4efb22];return _0x389e1f;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x9e90('0x0'))['db'][_0x9e90('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x9e90('0x2')](0x0);var events={'afterCreate':_0x9e90('0x3'),'afterUpdate':_0x9e90('0x4'),'afterDestroy':_0x9e90('0x5')};function emitEvent(_0x5b5435){return function(_0x870d5a,_0x4416e1,_0x1d0306){OpenchannelQueueEvents[_0x9e90('0x6')](_0x5b5435+':'+_0x870d5a['id'],_0x870d5a);OpenchannelQueueEvents[_0x9e90('0x6')](_0x5b5435,_0x870d5a);_0x1d0306(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0x9e90('0x7')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 036d094..857268e 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 _0x4ec4=['OpenchannelQueue','openchannel_queues','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define'];(function(_0x5af740,_0x578334){var _0x5a671e=function(_0x29c5b0){while(--_0x29c5b0){_0x5af740['push'](_0x5af740['shift']());}};_0x5a671e(++_0x578334);}(_0x4ec4,0x12d));var _0x44ec=function(_0x86a88d,_0x11a46c){_0x86a88d=_0x86a88d-0x0;var _0x2514a7=_0x4ec4[_0x86a88d];return _0x2514a7;};'use strict';var _=require(_0x44ec('0x0'));var util=require(_0x44ec('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x44ec('0x2'));var BPromise=require(_0x44ec('0x3'));var rp=require(_0x44ec('0x4'));var fs=require('fs');var path=require(_0x44ec('0x5'));var rimraf=require(_0x44ec('0x6'));var config=require(_0x44ec('0x7'));var attributes=require(_0x44ec('0x8'));module[_0x44ec('0x9')]=function(_0x1cf77d,_0x1d1bef){return _0x1cf77d[_0x44ec('0xa')](_0x44ec('0xb'),attributes,{'tableName':_0x44ec('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc5f9=['../../config/logger','api','moment','bluebird','path','../../config/environment','./openchannelQueue.attributes','lodash','util'];(function(_0x96ac9b,_0x4104e0){var _0x7c45c8=function(_0x580b50){while(--_0x580b50){_0x96ac9b['push'](_0x96ac9b['shift']());}};_0x7c45c8(++_0x4104e0);}(_0xc5f9,0x142));var _0x9c5f=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xc5f9[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x9c5f('0x0'));var util=require(_0x9c5f('0x1'));var logger=require(_0x9c5f('0x2'))(_0x9c5f('0x3'));var moment=require(_0x9c5f('0x4'));var BPromise=require(_0x9c5f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9c5f('0x6'));var rimraf=require('rimraf');var config=require(_0x9c5f('0x7'));var attributes=require(_0x9c5f('0x8'));module['exports']=function(_0x5d01fd,_0x3fb15d){return _0x5d01fd['define']('OpenchannelQueue',attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index 32b54b4..f1a6d9a 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 _0x851c=['../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','request','then','info','request\x20sent','debug','stringify','error','message','OpenchannelQueue,\x20%s,\x20%s','result','GetOpenchannelQueue','OpenchannelQueue','findAll','options','include','model','attributes','map','catch','find','raw','where','ShowOpenchannelQueue','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x191ed2,_0x49f10c){var _0x4df96b=function(_0x46aaf7){while(--_0x46aaf7){_0x191ed2['push'](_0x191ed2['shift']());}};_0x4df96b(++_0x49f10c);}(_0x851c,0x176));var _0xc851=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x851c[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xc851('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc851('0x1'));var rs=require(_0xc851('0x2'));var fs=require('fs');var Redis=require(_0xc851('0x3'));var db=require(_0xc851('0x4'))['db'];var utils=require(_0xc851('0x5'));var logger=require(_0xc851('0x6'))('rpc');var config=require(_0xc851('0x7'));var jayson=require(_0xc851('0x8'));var client=jayson['client'][_0xc851('0x9')]({'port':0x232a});config[_0xc851('0xa')]=_[_0xc851('0xb')](config[_0xc851('0xa')],{'host':_0xc851('0xc'),'port':0x18eb});var socket=require(_0xc851('0xd'))(new Redis(config[_0xc851('0xa')]));require(_0xc851('0xe'))['register'](socket);function respondWithRpcPromise(_0x459c4f,_0x132379,_0x7393b3){return new BPromise(function(_0x116a17,_0x2768e8){return client[_0xc851('0xf')](_0x459c4f,_0x7393b3)[_0xc851('0x10')](function(_0x36512b){logger[_0xc851('0x11')]('OpenchannelQueue,\x20%s,\x20%s',_0x132379,_0xc851('0x12'));logger[_0xc851('0x13')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x132379,_0xc851('0x12'),JSON[_0xc851('0x14')](_0x36512b));if(_0x36512b['error']){if(_0x36512b[_0xc851('0x15')]['code']===0x1f4){logger[_0xc851('0x15')]('OpenchannelQueue,\x20%s,\x20%s',_0x132379,_0x36512b['error'][_0xc851('0x16')]);return _0x2768e8(_0x36512b[_0xc851('0x15')][_0xc851('0x16')]);}logger[_0xc851('0x15')](_0xc851('0x17'),_0x132379,_0x36512b[_0xc851('0x15')]['message']);return _0x116a17(_0x36512b[_0xc851('0x15')][_0xc851('0x16')]);}else{logger[_0xc851('0x11')](_0xc851('0x17'),_0x132379,_0xc851('0x12'));_0x116a17(_0x36512b[_0xc851('0x18')]['message']);}})['catch'](function(_0x1c7b26){logger['error'](_0xc851('0x17'),_0x132379,_0x1c7b26);_0x2768e8(_0x1c7b26);});});}exports[_0xc851('0x19')]=function(_0x11e5d6){var _0x32baa8=this;return new Promise(function(_0x49808b,_0xbd04f5){return db[_0xc851('0x1a')][_0xc851('0x1b')]({'raw':_0x11e5d6[_0xc851('0x1c')]?_0x11e5d6[_0xc851('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x11e5d6[_0xc851('0x1c')]?_0x11e5d6['options']['where']||null:null,'attributes':_0x11e5d6['options']?_0x11e5d6['options']['attributes']||null:null,'limit':_0x11e5d6[_0xc851('0x1c')]?_0x11e5d6[_0xc851('0x1c')]['limit']||null:null,'include':_0x11e5d6[_0xc851('0x1c')]?_0x11e5d6[_0xc851('0x1c')][_0xc851('0x1d')]?_['map'](_0x11e5d6[_0xc851('0x1c')][_0xc851('0x1d')],function(_0x227e8d){return{'model':db[_0x227e8d[_0xc851('0x1e')]],'as':_0x227e8d['as'],'attributes':_0x227e8d[_0xc851('0x1f')],'include':_0x227e8d[_0xc851('0x1d')]?_[_0xc851('0x20')](_0x227e8d[_0xc851('0x1d')],function(_0x1982b2){return{'model':db[_0x1982b2[_0xc851('0x1e')]],'as':_0x1982b2['as'],'attributes':_0x1982b2['attributes'],'include':_0x1982b2[_0xc851('0x1d')]?_[_0xc851('0x20')](_0x1982b2[_0xc851('0x1d')],function(_0x5b7e85){return{'model':db[_0x5b7e85[_0xc851('0x1e')]],'as':_0x5b7e85['as'],'attributes':_0x5b7e85['attributes']};}):[]};}):[]};}):[]:[]})[_0xc851('0x10')](function(_0xb5fb38){logger[_0xc851('0x11')]('GetOpenchannelQueue',_0x11e5d6);logger['debug']('GetOpenchannelQueue',_0x11e5d6,JSON[_0xc851('0x14')](_0xb5fb38));_0x49808b(_0xb5fb38);})[_0xc851('0x21')](function(_0x283fad){logger[_0xc851('0x15')]('GetOpenchannelQueue',_0x283fad[_0xc851('0x16')],_0x11e5d6);_0xbd04f5(_0x32baa8[_0xc851('0x15')](0x1f4,_0x283fad[_0xc851('0x16')]));});});};exports['ShowOpenchannelQueue']=function(_0xe2ca02){var _0x405472=this;return new Promise(function(_0x3a2b22,_0x272105){return db[_0xc851('0x1a')][_0xc851('0x22')]({'raw':_0xe2ca02[_0xc851('0x1c')]?_0xe2ca02['options'][_0xc851('0x23')]===undefined?!![]:![]:!![],'where':_0xe2ca02[_0xc851('0x1c')]?_0xe2ca02[_0xc851('0x1c')][_0xc851('0x24')]||null:null,'attributes':_0xe2ca02[_0xc851('0x1c')]?_0xe2ca02[_0xc851('0x1c')][_0xc851('0x1f')]||null:null,'include':_0xe2ca02['options']?_0xe2ca02['options'][_0xc851('0x1d')]?_[_0xc851('0x20')](_0xe2ca02[_0xc851('0x1c')][_0xc851('0x1d')],function(_0x12d293){return{'model':db[_0x12d293['model']],'as':_0x12d293['as'],'attributes':_0x12d293[_0xc851('0x1f')],'include':_0x12d293[_0xc851('0x1d')]?_[_0xc851('0x20')](_0x12d293[_0xc851('0x1d')],function(_0x58c8b3){return{'model':db[_0x58c8b3['model']],'as':_0x58c8b3['as'],'attributes':_0x58c8b3[_0xc851('0x1f')],'include':_0x58c8b3[_0xc851('0x1d')]?_[_0xc851('0x20')](_0x58c8b3[_0xc851('0x1d')],function(_0x314d14){return{'model':db[_0x314d14[_0xc851('0x1e')]],'as':_0x314d14['as'],'attributes':_0x314d14['attributes']};}):[]};}):[]};}):[]:[]})[_0xc851('0x10')](function(_0x37900c){logger[_0xc851('0x11')](_0xc851('0x25'),_0xe2ca02);logger['debug'](_0xc851('0x25'),_0xe2ca02,JSON['stringify'](_0x37900c));_0x3a2b22(_0x37900c);})[_0xc851('0x21')](function(_0x5244eb){logger['error']('ShowOpenchannelQueue',_0x5244eb[_0xc851('0x16')],_0xe2ca02);_0x272105(_0x405472[_0xc851('0x15')](0x1f4,_0x5244eb[_0xc851('0x16')]));});});}; \ No newline at end of file +var _0x9f14=['request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','OpenchannelQueue','findAll','options','attributes','limit','include','map','model','GetOpenchannelQueue','catch','ShowOpenchannelQueue','find','raw','where','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./openchannelQueue.socket','register','then','OpenchannelQueue,\x20%s,\x20%s'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0x9f14,0xbf));var _0x49f1=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x9f14[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0x49f1('0x0'));var util=require(_0x49f1('0x1'));var moment=require(_0x49f1('0x2'));var BPromise=require(_0x49f1('0x3'));var rs=require(_0x49f1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x49f1('0x5'))['db'];var utils=require(_0x49f1('0x6'));var logger=require(_0x49f1('0x7'))(_0x49f1('0x8'));var config=require(_0x49f1('0x9'));var jayson=require(_0x49f1('0xa'));var client=jayson['client'][_0x49f1('0xb')]({'port':0x232a});config[_0x49f1('0xc')]=_[_0x49f1('0xd')](config[_0x49f1('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x49f1('0xe'))(new Redis(config[_0x49f1('0xc')]));require(_0x49f1('0xf'))[_0x49f1('0x10')](socket);function respondWithRpcPromise(_0x2a1cfc,_0x2b2eee,_0x4d4ac5){return new BPromise(function(_0x388dfe,_0x46b230){return client['request'](_0x2a1cfc,_0x4d4ac5)[_0x49f1('0x11')](function(_0x5a9caa){logger['info'](_0x49f1('0x12'),_0x2b2eee,_0x49f1('0x13'));logger[_0x49f1('0x14')](_0x49f1('0x15'),_0x2b2eee,_0x49f1('0x13'),JSON[_0x49f1('0x16')](_0x5a9caa));if(_0x5a9caa[_0x49f1('0x17')]){if(_0x5a9caa[_0x49f1('0x17')][_0x49f1('0x18')]===0x1f4){logger[_0x49f1('0x17')](_0x49f1('0x12'),_0x2b2eee,_0x5a9caa[_0x49f1('0x17')][_0x49f1('0x19')]);return _0x46b230(_0x5a9caa['error'][_0x49f1('0x19')]);}logger[_0x49f1('0x17')](_0x49f1('0x12'),_0x2b2eee,_0x5a9caa[_0x49f1('0x17')][_0x49f1('0x19')]);return _0x388dfe(_0x5a9caa[_0x49f1('0x17')][_0x49f1('0x19')]);}else{logger[_0x49f1('0x1a')](_0x49f1('0x12'),_0x2b2eee,_0x49f1('0x13'));_0x388dfe(_0x5a9caa[_0x49f1('0x1b')][_0x49f1('0x19')]);}})['catch'](function(_0x54ebb3){logger[_0x49f1('0x17')](_0x49f1('0x12'),_0x2b2eee,_0x54ebb3);_0x46b230(_0x54ebb3);});});}exports['GetOpenchannelQueue']=function(_0x58f84b){var _0x5ae0cd=this;return new Promise(function(_0x325354,_0x9e5609){return db[_0x49f1('0x1c')][_0x49f1('0x1d')]({'raw':_0x58f84b[_0x49f1('0x1e')]?_0x58f84b[_0x49f1('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x58f84b[_0x49f1('0x1e')]?_0x58f84b['options']['where']||null:null,'attributes':_0x58f84b[_0x49f1('0x1e')]?_0x58f84b['options'][_0x49f1('0x1f')]||null:null,'limit':_0x58f84b[_0x49f1('0x1e')]?_0x58f84b[_0x49f1('0x1e')][_0x49f1('0x20')]||null:null,'include':_0x58f84b[_0x49f1('0x1e')]?_0x58f84b['options'][_0x49f1('0x21')]?_[_0x49f1('0x22')](_0x58f84b[_0x49f1('0x1e')][_0x49f1('0x21')],function(_0x2daea7){return{'model':db[_0x2daea7[_0x49f1('0x23')]],'as':_0x2daea7['as'],'attributes':_0x2daea7[_0x49f1('0x1f')],'include':_0x2daea7[_0x49f1('0x21')]?_['map'](_0x2daea7['include'],function(_0x5f50ad){return{'model':db[_0x5f50ad[_0x49f1('0x23')]],'as':_0x5f50ad['as'],'attributes':_0x5f50ad[_0x49f1('0x1f')],'include':_0x5f50ad[_0x49f1('0x21')]?_[_0x49f1('0x22')](_0x5f50ad['include'],function(_0x301f76){return{'model':db[_0x301f76[_0x49f1('0x23')]],'as':_0x301f76['as'],'attributes':_0x301f76[_0x49f1('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2d3893){logger['info'](_0x49f1('0x24'),_0x58f84b);logger[_0x49f1('0x14')]('GetOpenchannelQueue',_0x58f84b,JSON[_0x49f1('0x16')](_0x2d3893));_0x325354(_0x2d3893);})[_0x49f1('0x25')](function(_0x3249d2){logger[_0x49f1('0x17')](_0x49f1('0x24'),_0x3249d2[_0x49f1('0x19')],_0x58f84b);_0x9e5609(_0x5ae0cd[_0x49f1('0x17')](0x1f4,_0x3249d2[_0x49f1('0x19')]));});});};exports[_0x49f1('0x26')]=function(_0x338f2a){var _0x2b2a1d=this;return new Promise(function(_0x3c0be8,_0x207bb3){return db['OpenchannelQueue'][_0x49f1('0x27')]({'raw':_0x338f2a[_0x49f1('0x1e')]?_0x338f2a[_0x49f1('0x1e')][_0x49f1('0x28')]===undefined?!![]:![]:!![],'where':_0x338f2a[_0x49f1('0x1e')]?_0x338f2a[_0x49f1('0x1e')][_0x49f1('0x29')]||null:null,'attributes':_0x338f2a['options']?_0x338f2a[_0x49f1('0x1e')][_0x49f1('0x1f')]||null:null,'include':_0x338f2a[_0x49f1('0x1e')]?_0x338f2a['options'][_0x49f1('0x21')]?_['map'](_0x338f2a[_0x49f1('0x1e')][_0x49f1('0x21')],function(_0x47683e){return{'model':db[_0x47683e[_0x49f1('0x23')]],'as':_0x47683e['as'],'attributes':_0x47683e[_0x49f1('0x1f')],'include':_0x47683e[_0x49f1('0x21')]?_[_0x49f1('0x22')](_0x47683e[_0x49f1('0x21')],function(_0x514e14){return{'model':db[_0x514e14['model']],'as':_0x514e14['as'],'attributes':_0x514e14['attributes'],'include':_0x514e14[_0x49f1('0x21')]?_[_0x49f1('0x22')](_0x514e14[_0x49f1('0x21')],function(_0x493d04){return{'model':db[_0x493d04[_0x49f1('0x23')]],'as':_0x493d04['as'],'attributes':_0x493d04[_0x49f1('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x42facc){logger[_0x49f1('0x1a')](_0x49f1('0x26'),_0x338f2a);logger[_0x49f1('0x14')](_0x49f1('0x26'),_0x338f2a,JSON[_0x49f1('0x16')](_0x42facc));_0x3c0be8(_0x42facc);})[_0x49f1('0x25')](function(_0x359589){logger[_0x49f1('0x17')](_0x49f1('0x26'),_0x359589[_0x49f1('0x19')],_0x338f2a);_0x207bb3(_0x2b2a1d['error'](0x1f4,_0x359589[_0x49f1('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 2be35b9..1552607 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 _0xffe8=['openchannelQueue:','./openchannelQueue.events','update','removeListener','length'];(function(_0x2feb53,_0x264ef7){var _0x5700ee=function(_0x700c98){while(--_0x700c98){_0x2feb53['push'](_0x2feb53['shift']());}};_0x5700ee(++_0x264ef7);}(_0xffe8,0xe2));var _0x8ffe=function(_0x140edf,_0x153d02){_0x140edf=_0x140edf-0x0;var _0x51b39f=_0xffe8[_0x140edf];return _0x51b39f;};'use strict';var OpenchannelQueueEvents=require(_0x8ffe('0x0'));var events=['save','remove',_0x8ffe('0x1')];function createListener(_0x270a9c,_0x4fefbe){return function(_0x5eb987){_0x4fefbe['emit'](_0x270a9c,_0x5eb987);};}function removeListener(_0x2b1d6f,_0x36b398){return function(){OpenchannelQueueEvents[_0x8ffe('0x2')](_0x2b1d6f,_0x36b398);};}exports['register']=function(_0x37bce6){for(var _0xdfce0=0x0,_0x5d09d5=events[_0x8ffe('0x3')];_0xdfce0<_0x5d09d5;_0xdfce0++){var _0x498553=events[_0xdfce0];var _0x481b2a=createListener(_0x8ffe('0x4')+_0x498553,_0x37bce6);OpenchannelQueueEvents['on'](_0x498553,_0x481b2a);}}; \ No newline at end of file +var _0xd69d=['save','remove','length'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xd69d,0x171));var _0xdd69=function(_0xf2de17,_0x2daf0f){_0xf2de17=_0xf2de17-0x0;var _0x49f796=_0xd69d[_0xf2de17];return _0x49f796;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0xdd69('0x0'),_0xdd69('0x1'),'update'];function createListener(_0x33d476,_0x22236e){return function(_0x4e3bf0){_0x22236e['emit'](_0x33d476,_0x4e3bf0);};}function removeListener(_0x3e3df,_0x21977a){return function(){OpenchannelQueueEvents['removeListener'](_0x3e3df,_0x21977a);};}exports['register']=function(_0x13466a){for(var _0x19c244=0x0,_0x595a87=events[_0xdd69('0x2')];_0x19c244<_0x595a87;_0x19c244++){var _0x232443=events[_0x19c244];var _0x46f559=createListener('openchannelQueue:'+_0x232443,_0x13466a);OpenchannelQueueEvents['on'](_0x232443,_0x46f559);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 02fe267..69a9986 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 _0x8869=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','describe','/:id','show','post','delete','destroy','exports','multer'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0x8869,0x84));var _0x9886=function(_0x2485f1,_0x126dc4){_0x2485f1=_0x2485f1-0x0;var _0x3fc3e3=_0x8869[_0x2485f1];return _0x3fc3e3;};'use strict';var multer=require(_0x9886('0x0'));var util=require(_0x9886('0x1'));var path=require(_0x9886('0x2'));var timeout=require(_0x9886('0x3'));var express=require('express');var router=express[_0x9886('0x4')]();var fs_extra=require(_0x9886('0x5'));var auth=require(_0x9886('0x6'));var interaction=require(_0x9886('0x7'));var config=require(_0x9886('0x8'));var controller=require(_0x9886('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x9886('0xa')]('/describe',auth[_0x9886('0xb')](),controller[_0x9886('0xc')]);router['get'](_0x9886('0xd'),auth[_0x9886('0xb')](),controller[_0x9886('0xe')]);router[_0x9886('0xf')]('/',auth[_0x9886('0xb')](),controller['create']);router['put'](_0x9886('0xd'),auth[_0x9886('0xb')](),controller['update']);router[_0x9886('0x10')](_0x9886('0xd'),auth[_0x9886('0xb')](),controller[_0x9886('0x11')]);module[_0x9886('0x12')]=router; \ No newline at end of file +var _0x963f=['/:id','show','post','create','put','update','delete','destroy','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0x963f,0x9b));var _0xf963=function(_0x2dd615,_0x18099c){_0x2dd615=_0x2dd615-0x0;var _0x5255a4=_0x963f[_0x2dd615];return _0x5255a4;};'use strict';var multer=require('multer');var util=require(_0xf963('0x0'));var path=require(_0xf963('0x1'));var timeout=require('connect-timeout');var express=require(_0xf963('0x2'));var router=express[_0xf963('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf963('0x4'));var interaction=require(_0xf963('0x5'));var config=require(_0xf963('0x6'));var controller=require(_0xf963('0x7'));router[_0xf963('0x8')]('/',auth[_0xf963('0x9')](),controller[_0xf963('0xa')]);router[_0xf963('0x8')](_0xf963('0xb'),auth[_0xf963('0x9')](),controller[_0xf963('0xc')]);router['get'](_0xf963('0xd'),auth[_0xf963('0x9')](),controller[_0xf963('0xe')]);router[_0xf963('0xf')]('/',auth[_0xf963('0x9')](),controller[_0xf963('0x10')]);router[_0xf963('0x11')](_0xf963('0xd'),auth['isAuthenticated'](),controller[_0xf963('0x12')]);router[_0xf963('0x13')](_0xf963('0xd'),auth[_0xf963('0x9')](),controller[_0xf963('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index da8524c..53991ba 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 _0xc0b9=['DATE','moment','sequelize','exports','STRING'];(function(_0x3a3204,_0x2bbd11){var _0x1cf6a0=function(_0x2d4b1b){while(--_0x2d4b1b){_0x3a3204['push'](_0x3a3204['shift']());}};_0x1cf6a0(++_0x2bbd11);}(_0xc0b9,0x12d));var _0x9c0b=function(_0x4d0956,_0x20747b){_0x4d0956=_0x4d0956-0x0;var _0x57b9bf=_0xc0b9[_0x4d0956];return _0x57b9bf;};'use strict';var moment=require(_0x9c0b('0x0'));var Sequelize=require(_0x9c0b('0x1'));module[_0x9c0b('0x2')]={'uniqueid':{'type':Sequelize[_0x9c0b('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x9c0b('0x3')]},'joinAt':{'type':Sequelize[_0x9c0b('0x4')]},'leaveAt':{'type':Sequelize[_0x9c0b('0x4')]},'acceptAt':{'type':Sequelize[_0x9c0b('0x4')]},'exitAt':{'type':Sequelize[_0x9c0b('0x4')]},'reason':{'type':Sequelize[_0x9c0b('0x3')]}}; \ No newline at end of file +var _0x5f2b=['exports','STRING','DATE','moment','sequelize'];(function(_0x3bac03,_0x52ff06){var _0x3f9c56=function(_0x14b0c1){while(--_0x14b0c1){_0x3bac03['push'](_0x3bac03['shift']());}};_0x3f9c56(++_0x52ff06);}(_0x5f2b,0x17a));var _0xb5f2=function(_0x3137ad,_0x28cd46){_0x3137ad=_0x3137ad-0x0;var _0x18bfc8=_0x5f2b[_0x3137ad];return _0x18bfc8;};'use strict';var moment=require(_0xb5f2('0x0'));var Sequelize=require(_0xb5f2('0x1'));module[_0xb5f2('0x2')]={'uniqueid':{'type':Sequelize[_0xb5f2('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xb5f2('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xb5f2('0x4')]},'acceptAt':{'type':Sequelize[_0xb5f2('0x4')]},'exitAt':{'type':Sequelize[_0xb5f2('0x4')]},'reason':{'type':Sequelize[_0xb5f2('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 605a6c8..cc4c4f9 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 _0xf693=['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','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','OpenchannelQueueReport','fieldName','type','key','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','findAll','rows','catch','show','include','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0xcd6f70,_0x3089a7){var _0x3ff788=function(_0x496b89){while(--_0x496b89){_0xcd6f70['push'](_0xcd6f70['shift']());}};_0x3ff788(++_0x3089a7);}(_0xf693,0x1da));var _0x3f69=function(_0x1fab5d,_0x5af2b6){_0x1fab5d=_0x1fab5d-0x0;var _0x2c755f=_0xf693[_0x1fab5d];return _0x2c755f;};'use strict';var emlformat=require(_0x3f69('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3f69('0x1'));var jsonpatch=require(_0x3f69('0x2'));var rp=require(_0x3f69('0x3'));var moment=require(_0x3f69('0x4'));var BPromise=require(_0x3f69('0x5'));var Mustache=require(_0x3f69('0x6'));var util=require(_0x3f69('0x7'));var path=require(_0x3f69('0x8'));var sox=require(_0x3f69('0x9'));var csv=require(_0x3f69('0xa'));var ejs=require(_0x3f69('0xb'));var fs=require('fs');var fs_extra=require(_0x3f69('0xc'));var _=require(_0x3f69('0xd'));var squel=require('squel');var crypto=require(_0x3f69('0xe'));var jsforce=require(_0x3f69('0xf'));var deskjs=require(_0x3f69('0x10'));var toCsv=require(_0x3f69('0xa'));var querystring=require('querystring');var Papa=require(_0x3f69('0x11'));var Redis=require(_0x3f69('0x12'));var authService=require(_0x3f69('0x13'));var qs=require(_0x3f69('0x14'));var as=require(_0x3f69('0x15'));var hardwareService=require(_0x3f69('0x16'));var logger=require(_0x3f69('0x17'))(_0x3f69('0x18'));var utils=require(_0x3f69('0x19'));var config=require(_0x3f69('0x1a'));var licenseUtil=require(_0x3f69('0x1b'));var db=require(_0x3f69('0x1c'))['db'];function respondWithStatusCode(_0x206e28,_0x59273a){_0x59273a=_0x59273a||0xcc;return function(_0x12516e){if(_0x12516e){return _0x206e28['sendStatus'](_0x59273a);}return _0x206e28[_0x3f69('0x1d')](_0x59273a)[_0x3f69('0x1e')]();};}function respondWithResult(_0x5cfcf3,_0x49ac9f){_0x49ac9f=_0x49ac9f||0xc8;return function(_0x1bc4fb){if(_0x1bc4fb){return _0x5cfcf3[_0x3f69('0x1d')](_0x49ac9f)[_0x3f69('0x1f')](_0x1bc4fb);}};}function respondWithFilteredResult(_0x33df7d,_0x4b066d){return function(_0x371682){if(_0x371682){var _0x5b5a1b=typeof _0x4b066d[_0x3f69('0x20')]===_0x3f69('0x21')&&typeof _0x4b066d[_0x3f69('0x22')]==='undefined';var _0x52eea8=_0x371682[_0x3f69('0x23')];var _0x3ff6a4=_0x5b5a1b?0x0:_0x4b066d['offset'];var _0x581c6d=_0x5b5a1b?_0x371682[_0x3f69('0x23')]:_0x4b066d[_0x3f69('0x20')]+_0x4b066d[_0x3f69('0x22')];var _0x3e0a35;if(_0x581c6d>=_0x52eea8){_0x581c6d=_0x52eea8;_0x3e0a35=0xc8;}else{_0x3e0a35=0xce;}_0x33df7d[_0x3f69('0x1d')](_0x3e0a35);return _0x33df7d[_0x3f69('0x24')]('Content-Range',_0x3ff6a4+'-'+_0x581c6d+'/'+_0x52eea8)[_0x3f69('0x1f')](_0x371682);}return null;};}function patchUpdates(_0x3e166b){return function(_0x30e65d){try{jsonpatch[_0x3f69('0x25')](_0x30e65d,_0x3e166b,!![]);}catch(_0x2709fa){return BPromise[_0x3f69('0x26')](_0x2709fa);}return _0x30e65d['save']();};}function saveUpdates(_0x19d09d,_0x3173ed){return function(_0x48ca57){if(_0x48ca57){return _0x48ca57[_0x3f69('0x27')](_0x19d09d)[_0x3f69('0x28')](function(_0xf55046){return _0xf55046;});}return null;};}function removeEntity(_0x5e178c,_0x1a8472){return function(_0x17fcd0){if(_0x17fcd0){return _0x17fcd0[_0x3f69('0x29')]()[_0x3f69('0x28')](function(){_0x5e178c['status'](0xcc)[_0x3f69('0x1e')]();});}};}function handleEntityNotFound(_0x359141,_0x2ce56d){return function(_0x5b6cfa){if(!_0x5b6cfa){_0x359141[_0x3f69('0x2a')](0x194);}return _0x5b6cfa;};}function handleError(_0x26f3a2,_0x30dd9f){_0x30dd9f=_0x30dd9f||0x1f4;return function(_0x32e552){logger[_0x3f69('0x2b')](_0x32e552[_0x3f69('0x2c')]);if(_0x32e552['name']){delete _0x32e552[_0x3f69('0x2d')];}_0x26f3a2[_0x3f69('0x1d')](_0x30dd9f)[_0x3f69('0x2e')](_0x32e552);};}exports[_0x3f69('0x2f')]=function(_0x308e74,_0x1fd251){var _0x288da2={},_0x387f62={},_0x11531e={'count':0x0,'rows':[]};var _0x305256=_[_0x3f69('0x30')](db[_0x3f69('0x31')]['rawAttributes'],function(_0x3f9dcc){return{'name':_0x3f9dcc[_0x3f69('0x32')],'type':_0x3f9dcc[_0x3f69('0x33')][_0x3f69('0x34')]};});_0x387f62['model']=_['map'](_0x305256,_0x3f69('0x2d'));_0x387f62['query']=_[_0x3f69('0x35')](_0x308e74['query']);_0x387f62[_0x3f69('0x36')]=_[_0x3f69('0x37')](_0x387f62[_0x3f69('0x38')],_0x387f62[_0x3f69('0x39')]);_0x288da2[_0x3f69('0x3a')]=_[_0x3f69('0x37')](_0x387f62[_0x3f69('0x38')],qs[_0x3f69('0x3b')](_0x308e74[_0x3f69('0x39')][_0x3f69('0x3b')]));_0x288da2[_0x3f69('0x3a')]=_0x288da2['attributes'][_0x3f69('0x3c')]?_0x288da2[_0x3f69('0x3a')]:_0x387f62[_0x3f69('0x38')];if(!_0x308e74[_0x3f69('0x39')][_0x3f69('0x3d')]('nolimit')){_0x288da2['limit']=qs[_0x3f69('0x22')](_0x308e74[_0x3f69('0x39')][_0x3f69('0x22')]);_0x288da2[_0x3f69('0x20')]=qs[_0x3f69('0x20')](_0x308e74[_0x3f69('0x39')]['offset']);}_0x288da2[_0x3f69('0x3e')]=qs[_0x3f69('0x3f')](_0x308e74['query'][_0x3f69('0x3f')]);_0x288da2['where']=qs[_0x3f69('0x36')](_[_0x3f69('0x40')](_0x308e74[_0x3f69('0x39')],_0x387f62['filters']),_0x305256);if(_0x308e74['query'][_0x3f69('0x41')]){_0x288da2['where']=_[_0x3f69('0x42')](_0x288da2[_0x3f69('0x43')],{'$or':_[_0x3f69('0x30')](_0x305256,function(_0x575532){if(_0x575532['type']!==_0x3f69('0x44')){var _0x1e372f={};_0x1e372f[_0x575532[_0x3f69('0x2d')]]={'$like':'%'+_0x308e74[_0x3f69('0x39')][_0x3f69('0x41')]+'%'};return _0x1e372f;}})});}_0x288da2=_[_0x3f69('0x42')]({},_0x288da2,_0x308e74[_0x3f69('0x45')]);var _0x24c4e5={'where':_0x288da2[_0x3f69('0x43')]};return db[_0x3f69('0x31')]['count'](_0x24c4e5)['then'](function(_0x30f51b){_0x11531e[_0x3f69('0x23')]=_0x30f51b;if(_0x308e74[_0x3f69('0x39')][_0x3f69('0x46')]){_0x288da2['include']=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0x3f69('0x47')](_0x288da2);})[_0x3f69('0x28')](function(_0x391b60){_0x11531e[_0x3f69('0x48')]=_0x391b60;return _0x11531e;})[_0x3f69('0x28')](respondWithFilteredResult(_0x1fd251,_0x288da2))[_0x3f69('0x49')](handleError(_0x1fd251,null));};exports[_0x3f69('0x4a')]=function(_0x39104a,_0x1bded7){var _0x484587={'raw':!![],'where':{'id':_0x39104a['params']['id']}},_0x1794b1={};_0x1794b1[_0x3f69('0x38')]=_[_0x3f69('0x35')](db[_0x3f69('0x31')]['rawAttributes']);_0x1794b1[_0x3f69('0x39')]=_['keys'](_0x39104a['query']);_0x1794b1[_0x3f69('0x36')]=_[_0x3f69('0x37')](_0x1794b1[_0x3f69('0x38')],_0x1794b1[_0x3f69('0x39')]);_0x484587[_0x3f69('0x3a')]=_[_0x3f69('0x37')](_0x1794b1[_0x3f69('0x38')],qs['fields'](_0x39104a['query'][_0x3f69('0x3b')]));_0x484587['attributes']=_0x484587['attributes'][_0x3f69('0x3c')]?_0x484587['attributes']:_0x1794b1[_0x3f69('0x38')];if(_0x39104a[_0x3f69('0x39')][_0x3f69('0x46')]){_0x484587[_0x3f69('0x4b')]=[{'all':!![]}];}_0x484587=_[_0x3f69('0x42')]({},_0x484587,_0x39104a[_0x3f69('0x45')]);return db[_0x3f69('0x31')][_0x3f69('0x4c')](_0x484587)[_0x3f69('0x28')](handleEntityNotFound(_0x1bded7,null))[_0x3f69('0x28')](respondWithResult(_0x1bded7,null))[_0x3f69('0x49')](handleError(_0x1bded7,null));};exports[_0x3f69('0x4d')]=function(_0x5e0484,_0x404db0){return db[_0x3f69('0x31')][_0x3f69('0x4d')](_0x5e0484[_0x3f69('0x4e')],{})[_0x3f69('0x28')](respondWithResult(_0x404db0,0xc9))[_0x3f69('0x49')](handleError(_0x404db0,null));};exports['update']=function(_0x152a06,_0x3bc3af){if(_0x152a06['body']['id']){delete _0x152a06[_0x3f69('0x4e')]['id'];}return db[_0x3f69('0x31')][_0x3f69('0x4c')]({'where':{'id':_0x152a06[_0x3f69('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3bc3af,null))[_0x3f69('0x28')](saveUpdates(_0x152a06[_0x3f69('0x4e')],null))['then'](respondWithResult(_0x3bc3af,null))[_0x3f69('0x49')](handleError(_0x3bc3af,null));};exports[_0x3f69('0x29')]=function(_0x44ffc4,_0x19fadc){return db[_0x3f69('0x31')]['find']({'where':{'id':_0x44ffc4['params']['id']}})[_0x3f69('0x28')](handleEntityNotFound(_0x19fadc,null))['then'](removeEntity(_0x19fadc,null))[_0x3f69('0x49')](handleError(_0x19fadc,null));};exports['describe']=function(_0x3f658f,_0x2d5e67){return db[_0x3f69('0x31')][_0x3f69('0x50')]()[_0x3f69('0x28')](respondWithResult(_0x2d5e67,null))[_0x3f69('0x49')](handleError(_0x2d5e67,null));}; \ No newline at end of file +var _0x0b5d=['create','body','describe','rimraf','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','end','error','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','params','keys','options','find','catch'];(function(_0x2816ca,_0x4c990a){var _0x18fefe=function(_0x525e11){while(--_0x525e11){_0x2816ca['push'](_0x2816ca['shift']());}};_0x18fefe(++_0x4c990a);}(_0x0b5d,0x11f));var _0xd0b5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0b5d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd0b5('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd0b5('0x1'));var moment=require('moment');var BPromise=require(_0xd0b5('0x2'));var Mustache=require('mustache');var util=require(_0xd0b5('0x3'));var path=require(_0xd0b5('0x4'));var sox=require(_0xd0b5('0x5'));var csv=require('to-csv');var ejs=require(_0xd0b5('0x6'));var fs=require('fs');var fs_extra=require(_0xd0b5('0x7'));var _=require(_0xd0b5('0x8'));var squel=require(_0xd0b5('0x9'));var crypto=require('crypto');var jsforce=require(_0xd0b5('0xa'));var deskjs=require(_0xd0b5('0xb'));var toCsv=require(_0xd0b5('0xc'));var querystring=require(_0xd0b5('0xd'));var Papa=require(_0xd0b5('0xe'));var Redis=require('ioredis');var authService=require(_0xd0b5('0xf'));var qs=require(_0xd0b5('0x10'));var as=require(_0xd0b5('0x11'));var hardwareService=require(_0xd0b5('0x12'));var logger=require('../../config/logger')(_0xd0b5('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f3518,_0x5d0fe6){_0x5d0fe6=_0x5d0fe6||0xcc;return function(_0x30cb73){if(_0x30cb73){return _0x4f3518[_0xd0b5('0x14')](_0x5d0fe6);}return _0x4f3518['status'](_0x5d0fe6)['end']();};}function respondWithResult(_0x325601,_0x78c3a0){_0x78c3a0=_0x78c3a0||0xc8;return function(_0x3812aa){if(_0x3812aa){return _0x325601[_0xd0b5('0x15')](_0x78c3a0)[_0xd0b5('0x16')](_0x3812aa);}};}function respondWithFilteredResult(_0x1ec0e1,_0x319d1f){return function(_0x388209){if(_0x388209){var _0xc169da=typeof _0x319d1f[_0xd0b5('0x17')]===_0xd0b5('0x18')&&typeof _0x319d1f[_0xd0b5('0x19')]===_0xd0b5('0x18');var _0x1fed3a=_0x388209[_0xd0b5('0x1a')];var _0x14dcc0=_0xc169da?0x0:_0x319d1f['offset'];var _0x2e4b16=_0xc169da?_0x388209[_0xd0b5('0x1a')]:_0x319d1f[_0xd0b5('0x17')]+_0x319d1f[_0xd0b5('0x19')];var _0x3cd119;if(_0x2e4b16>=_0x1fed3a){_0x2e4b16=_0x1fed3a;_0x3cd119=0xc8;}else{_0x3cd119=0xce;}_0x1ec0e1[_0xd0b5('0x15')](_0x3cd119);return _0x1ec0e1[_0xd0b5('0x1b')](_0xd0b5('0x1c'),_0x14dcc0+'-'+_0x2e4b16+'/'+_0x1fed3a)[_0xd0b5('0x16')](_0x388209);}return null;};}function patchUpdates(_0x50c527){return function(_0x5552ba){try{jsonpatch[_0xd0b5('0x1d')](_0x5552ba,_0x50c527,!![]);}catch(_0x305970){return BPromise[_0xd0b5('0x1e')](_0x305970);}return _0x5552ba['save']();};}function saveUpdates(_0x4ae797,_0x27c1ea){return function(_0x223831){if(_0x223831){return _0x223831[_0xd0b5('0x1f')](_0x4ae797)[_0xd0b5('0x20')](function(_0x5ddb81){return _0x5ddb81;});}return null;};}function removeEntity(_0xf9cdec,_0xdddb62){return function(_0x5db422){if(_0x5db422){return _0x5db422['destroy']()['then'](function(){_0xf9cdec[_0xd0b5('0x15')](0xcc)[_0xd0b5('0x21')]();});}};}function handleEntityNotFound(_0x32d307,_0x18560f){return function(_0x4f4285){if(!_0x4f4285){_0x32d307['sendStatus'](0x194);}return _0x4f4285;};}function handleError(_0x14a7d4,_0x20e3fa){_0x20e3fa=_0x20e3fa||0x1f4;return function(_0x2bd2c3){logger[_0xd0b5('0x22')](_0x2bd2c3[_0xd0b5('0x23')]);if(_0x2bd2c3[_0xd0b5('0x24')]){delete _0x2bd2c3[_0xd0b5('0x24')];}_0x14a7d4['status'](_0x20e3fa)[_0xd0b5('0x25')](_0x2bd2c3);};}exports[_0xd0b5('0x26')]=function(_0x462abc,_0x5b42f8){var _0x46772b={},_0x238811={},_0x438f67={'count':0x0,'rows':[]};var _0x71d252=_[_0xd0b5('0x27')](db[_0xd0b5('0x28')][_0xd0b5('0x29')],function(_0x298610){return{'name':_0x298610[_0xd0b5('0x2a')],'type':_0x298610[_0xd0b5('0x2b')]['key']};});_0x238811['model']=_['map'](_0x71d252,_0xd0b5('0x24'));_0x238811[_0xd0b5('0x2c')]=_['keys'](_0x462abc[_0xd0b5('0x2c')]);_0x238811[_0xd0b5('0x2d')]=_['intersection'](_0x238811[_0xd0b5('0x2e')],_0x238811[_0xd0b5('0x2c')]);_0x46772b[_0xd0b5('0x2f')]=_[_0xd0b5('0x30')](_0x238811['model'],qs[_0xd0b5('0x31')](_0x462abc['query'][_0xd0b5('0x31')]));_0x46772b['attributes']=_0x46772b['attributes'][_0xd0b5('0x32')]?_0x46772b[_0xd0b5('0x2f')]:_0x238811[_0xd0b5('0x2e')];if(!_0x462abc[_0xd0b5('0x2c')][_0xd0b5('0x33')](_0xd0b5('0x34'))){_0x46772b[_0xd0b5('0x19')]=qs[_0xd0b5('0x19')](_0x462abc[_0xd0b5('0x2c')]['limit']);_0x46772b['offset']=qs[_0xd0b5('0x17')](_0x462abc[_0xd0b5('0x2c')][_0xd0b5('0x17')]);}_0x46772b['order']=qs[_0xd0b5('0x35')](_0x462abc[_0xd0b5('0x2c')][_0xd0b5('0x35')]);_0x46772b['where']=qs[_0xd0b5('0x2d')](_[_0xd0b5('0x36')](_0x462abc['query'],_0x238811['filters']),_0x71d252);if(_0x462abc[_0xd0b5('0x2c')][_0xd0b5('0x37')]){_0x46772b[_0xd0b5('0x38')]=_[_0xd0b5('0x39')](_0x46772b[_0xd0b5('0x38')],{'$or':_[_0xd0b5('0x27')](_0x71d252,function(_0x566fd9){if(_0x566fd9[_0xd0b5('0x2b')]!==_0xd0b5('0x3a')){var _0x239731={};_0x239731[_0x566fd9[_0xd0b5('0x24')]]={'$like':'%'+_0x462abc[_0xd0b5('0x2c')][_0xd0b5('0x37')]+'%'};return _0x239731;}})});}_0x46772b=_[_0xd0b5('0x39')]({},_0x46772b,_0x462abc['options']);var _0x274d35={'where':_0x46772b[_0xd0b5('0x38')]};return db[_0xd0b5('0x28')][_0xd0b5('0x1a')](_0x274d35)[_0xd0b5('0x20')](function(_0x86e7db){_0x438f67[_0xd0b5('0x1a')]=_0x86e7db;if(_0x462abc[_0xd0b5('0x2c')][_0xd0b5('0x3b')]){_0x46772b[_0xd0b5('0x3c')]=[{'all':!![]}];}return db[_0xd0b5('0x28')][_0xd0b5('0x3d')](_0x46772b);})[_0xd0b5('0x20')](function(_0x28d8dc){_0x438f67[_0xd0b5('0x3e')]=_0x28d8dc;return _0x438f67;})['then'](respondWithFilteredResult(_0x5b42f8,_0x46772b))['catch'](handleError(_0x5b42f8,null));};exports['show']=function(_0x2da99c,_0x63ecdb){var _0x2c5500={'raw':!![],'where':{'id':_0x2da99c[_0xd0b5('0x3f')]['id']}},_0x2ea5ee={};_0x2ea5ee[_0xd0b5('0x2e')]=_[_0xd0b5('0x40')](db[_0xd0b5('0x28')][_0xd0b5('0x29')]);_0x2ea5ee['query']=_['keys'](_0x2da99c[_0xd0b5('0x2c')]);_0x2ea5ee[_0xd0b5('0x2d')]=_[_0xd0b5('0x30')](_0x2ea5ee['model'],_0x2ea5ee['query']);_0x2c5500[_0xd0b5('0x2f')]=_[_0xd0b5('0x30')](_0x2ea5ee[_0xd0b5('0x2e')],qs[_0xd0b5('0x31')](_0x2da99c['query'][_0xd0b5('0x31')]));_0x2c5500[_0xd0b5('0x2f')]=_0x2c5500[_0xd0b5('0x2f')][_0xd0b5('0x32')]?_0x2c5500[_0xd0b5('0x2f')]:_0x2ea5ee[_0xd0b5('0x2e')];if(_0x2da99c['query'][_0xd0b5('0x3b')]){_0x2c5500[_0xd0b5('0x3c')]=[{'all':!![]}];}_0x2c5500=_['merge']({},_0x2c5500,_0x2da99c[_0xd0b5('0x41')]);return db[_0xd0b5('0x28')][_0xd0b5('0x42')](_0x2c5500)['then'](handleEntityNotFound(_0x63ecdb,null))['then'](respondWithResult(_0x63ecdb,null))[_0xd0b5('0x43')](handleError(_0x63ecdb,null));};exports['create']=function(_0x334fb4,_0x35b312){return db[_0xd0b5('0x28')][_0xd0b5('0x44')](_0x334fb4[_0xd0b5('0x45')],{})[_0xd0b5('0x20')](respondWithResult(_0x35b312,0xc9))[_0xd0b5('0x43')](handleError(_0x35b312,null));};exports[_0xd0b5('0x1f')]=function(_0x3e5e11,_0x1e1763){if(_0x3e5e11[_0xd0b5('0x45')]['id']){delete _0x3e5e11[_0xd0b5('0x45')]['id'];}return db[_0xd0b5('0x28')][_0xd0b5('0x42')]({'where':{'id':_0x3e5e11[_0xd0b5('0x3f')]['id']}})[_0xd0b5('0x20')](handleEntityNotFound(_0x1e1763,null))[_0xd0b5('0x20')](saveUpdates(_0x3e5e11[_0xd0b5('0x45')],null))[_0xd0b5('0x20')](respondWithResult(_0x1e1763,null))[_0xd0b5('0x43')](handleError(_0x1e1763,null));};exports['destroy']=function(_0x4d2ab4,_0x15daa7){return db['OpenchannelQueueReport']['find']({'where':{'id':_0x4d2ab4[_0xd0b5('0x3f')]['id']}})[_0xd0b5('0x20')](handleEntityNotFound(_0x15daa7,null))['then'](removeEntity(_0x15daa7,null))[_0xd0b5('0x43')](handleError(_0x15daa7,null));};exports['describe']=function(_0x5c4d16,_0x33637a){return db['OpenchannelQueueReport'][_0xd0b5('0x46')]()[_0xd0b5('0x20')](respondWithResult(_0x33637a,null))[_0xd0b5('0x43')](handleError(_0x33637a,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 7c493f4..031af38 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0x946a8a,_0x3b0caf){var _0x2ff4c1=function(_0x2d6673){while(--_0x2d6673){_0x946a8a['push'](_0x946a8a['shift']());}};_0x2ff4c1(++_0x3b0caf);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xc4aa[_0x3511d3];return _0x5d6321;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash'];(function(_0x469cce,_0x272783){var _0x5e6205=function(_0xe419c5){while(--_0xe419c5){_0x469cce['push'](_0x469cce['shift']());}};_0x5e6205(++_0x272783);}(_0x326f,0xd1));var _0xf326=function(_0x5c3c12,_0x160737){_0x5c3c12=_0x5c3c12-0x0;var _0x24fa7c=_0x326f[_0x5c3c12];return _0x24fa7c;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'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 ba3d3f9..d760a96 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 _0xdc91=['stringify','error','code','message','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','UpdateOpenchannelQueueReport','update','attributes','limit','lodash','util','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x3b600b,_0x4c6c27){var _0x305bf6=function(_0x1a52e0){while(--_0x1a52e0){_0x3b600b['push'](_0x3b600b['shift']());}};_0x305bf6(++_0x4c6c27);}(_0xdc91,0x8b));var _0x1dc9=function(_0x163df7,_0xc290de){_0x163df7=_0x163df7-0x0;var _0x24bf6e=_0xdc91[_0x163df7];return _0x24bf6e;};'use strict';var _=require(_0x1dc9('0x0'));var util=require(_0x1dc9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1dc9('0x2'))['db'];var utils=require(_0x1dc9('0x3'));var logger=require(_0x1dc9('0x4'))(_0x1dc9('0x5'));var config=require(_0x1dc9('0x6'));var jayson=require(_0x1dc9('0x7'));var client=jayson[_0x1dc9('0x8')][_0x1dc9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ac058,_0x2c6e6c,_0x25a752){return new BPromise(function(_0x316995,_0x3d1772){return client[_0x1dc9('0xa')](_0x5ac058,_0x25a752)[_0x1dc9('0xb')](function(_0x43c405){logger[_0x1dc9('0xc')](_0x1dc9('0xd'),_0x2c6e6c,_0x1dc9('0xe'));logger['debug'](_0x1dc9('0xf'),_0x2c6e6c,'request\x20sent',JSON[_0x1dc9('0x10')](_0x43c405));if(_0x43c405['error']){if(_0x43c405[_0x1dc9('0x11')][_0x1dc9('0x12')]===0x1f4){logger[_0x1dc9('0x11')](_0x1dc9('0xd'),_0x2c6e6c,_0x43c405['error'][_0x1dc9('0x13')]);return _0x3d1772(_0x43c405[_0x1dc9('0x11')]['message']);}logger[_0x1dc9('0x11')](_0x1dc9('0xd'),_0x2c6e6c,_0x43c405['error']['message']);return _0x316995(_0x43c405[_0x1dc9('0x11')][_0x1dc9('0x13')]);}else{logger[_0x1dc9('0xc')](_0x1dc9('0xd'),_0x2c6e6c,'request\x20sent');_0x316995(_0x43c405['result'][_0x1dc9('0x13')]);}})[_0x1dc9('0x14')](function(_0x5cccb9){logger[_0x1dc9('0x11')](_0x1dc9('0xd'),_0x2c6e6c,_0x5cccb9);_0x3d1772(_0x5cccb9);});});}exports[_0x1dc9('0x15')]=function(_0x197bcd){var _0x335590=this;return new Promise(function(_0x1e845a,_0x2442d0){return db[_0x1dc9('0x16')][_0x1dc9('0x17')](_0x197bcd[_0x1dc9('0x18')],{'raw':_0x197bcd[_0x1dc9('0x19')]?_0x197bcd[_0x1dc9('0x19')][_0x1dc9('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x49bd5b){logger[_0x1dc9('0xc')]('CreateOpenchannelQueueReport',_0x197bcd);logger['debug']('CreateOpenchannelQueueReport',_0x197bcd,JSON[_0x1dc9('0x10')](_0x49bd5b));_0x1e845a(_0x49bd5b);})[_0x1dc9('0x14')](function(_0x277499){logger[_0x1dc9('0x11')](_0x1dc9('0x15'),_0x277499[_0x1dc9('0x13')],_0x197bcd);_0x2442d0(_0x335590[_0x1dc9('0x11')](0x1f4,_0x277499['message']));});});};exports[_0x1dc9('0x1b')]=function(_0x2a4740){var _0x14181d=this;return new Promise(function(_0x4c6e65,_0x39f3f7){return db[_0x1dc9('0x16')][_0x1dc9('0x1c')](_0x2a4740[_0x1dc9('0x18')],{'raw':_0x2a4740[_0x1dc9('0x19')]?_0x2a4740[_0x1dc9('0x19')][_0x1dc9('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a4740[_0x1dc9('0x19')]?_0x2a4740[_0x1dc9('0x19')]['where']||null:null,'attributes':_0x2a4740['options']?_0x2a4740[_0x1dc9('0x19')][_0x1dc9('0x1d')]||null:null,'limit':_0x2a4740[_0x1dc9('0x19')]?_0x2a4740[_0x1dc9('0x19')][_0x1dc9('0x1e')]||null:null})[_0x1dc9('0xb')](function(_0x10123d){logger[_0x1dc9('0xc')](_0x1dc9('0x1b'),_0x2a4740);logger['debug'](_0x1dc9('0x1b'),_0x2a4740,JSON[_0x1dc9('0x10')](_0x10123d));_0x4c6e65(_0x10123d);})[_0x1dc9('0x14')](function(_0x2d75bc){logger[_0x1dc9('0x11')](_0x1dc9('0x1b'),_0x2d75bc['message'],_0x2a4740);_0x39f3f7(_0x14181d['error'](0x1f4,_0x2d75bc[_0x1dc9('0x13')]));});});}; \ No newline at end of file +var _0x47c5=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','OpenchannelQueueReport','create','body','options','raw','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x11e81d,_0xce9b6b){var _0x8bfd50=function(_0xf7e7da){while(--_0xf7e7da){_0x11e81d['push'](_0x11e81d['shift']());}};_0x8bfd50(++_0xce9b6b);}(_0x47c5,0x165));var _0x547c=function(_0x120891,_0x415544){_0x120891=_0x120891-0x0;var _0x2c52b7=_0x47c5[_0x120891];return _0x2c52b7;};'use strict';var _=require(_0x547c('0x0'));var util=require(_0x547c('0x1'));var moment=require(_0x547c('0x2'));var BPromise=require(_0x547c('0x3'));var rs=require(_0x547c('0x4'));var fs=require('fs');var Redis=require(_0x547c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x547c('0x6'));var logger=require(_0x547c('0x7'))('rpc');var config=require(_0x547c('0x8'));var jayson=require(_0x547c('0x9'));var client=jayson['client'][_0x547c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x439f25,_0x381f2e,_0x10a334){return new BPromise(function(_0x12fb7d,_0x4ef079){return client[_0x547c('0xb')](_0x439f25,_0x10a334)[_0x547c('0xc')](function(_0x10dec9){logger[_0x547c('0xd')](_0x547c('0xe'),_0x381f2e,_0x547c('0xf'));logger[_0x547c('0x10')](_0x547c('0x11'),_0x381f2e,_0x547c('0xf'),JSON[_0x547c('0x12')](_0x10dec9));if(_0x10dec9[_0x547c('0x13')]){if(_0x10dec9['error'][_0x547c('0x14')]===0x1f4){logger[_0x547c('0x13')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x381f2e,_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);return _0x4ef079(_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);}logger[_0x547c('0x13')](_0x547c('0xe'),_0x381f2e,_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);return _0x12fb7d(_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);}else{logger[_0x547c('0xd')](_0x547c('0xe'),_0x381f2e,_0x547c('0xf'));_0x12fb7d(_0x10dec9[_0x547c('0x16')][_0x547c('0x15')]);}})[_0x547c('0x17')](function(_0x39498d){logger[_0x547c('0x13')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x381f2e,_0x39498d);_0x4ef079(_0x39498d);});});}exports['CreateOpenchannelQueueReport']=function(_0x23fa9e){var _0x199e4f=this;return new Promise(function(_0xeb059e,_0x4a8901){return db[_0x547c('0x18')][_0x547c('0x19')](_0x23fa9e[_0x547c('0x1a')],{'raw':_0x23fa9e['options']?_0x23fa9e[_0x547c('0x1b')][_0x547c('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x5453f9){logger[_0x547c('0xd')](_0x547c('0x1d'),_0x23fa9e);logger['debug'](_0x547c('0x1d'),_0x23fa9e,JSON[_0x547c('0x12')](_0x5453f9));_0xeb059e(_0x5453f9);})['catch'](function(_0x2e317a){logger[_0x547c('0x13')](_0x547c('0x1d'),_0x2e317a['message'],_0x23fa9e);_0x4a8901(_0x199e4f[_0x547c('0x13')](0x1f4,_0x2e317a[_0x547c('0x15')]));});});};exports[_0x547c('0x1e')]=function(_0x26823c){var _0x1f3581=this;return new Promise(function(_0x2663bc,_0x2ab2cc){return db[_0x547c('0x18')]['update'](_0x26823c[_0x547c('0x1a')],{'raw':_0x26823c['options']?_0x26823c['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26823c['options']?_0x26823c[_0x547c('0x1b')]['where']||null:null,'attributes':_0x26823c[_0x547c('0x1b')]?_0x26823c['options'][_0x547c('0x1f')]||null:null,'limit':_0x26823c['options']?_0x26823c[_0x547c('0x1b')][_0x547c('0x20')]||null:null})[_0x547c('0xc')](function(_0x30a96c){logger[_0x547c('0xd')]('UpdateOpenchannelQueueReport',_0x26823c);logger['debug'](_0x547c('0x1e'),_0x26823c,JSON['stringify'](_0x30a96c));_0x2663bc(_0x30a96c);})[_0x547c('0x17')](function(_0xed2d39){logger[_0x547c('0x13')](_0x547c('0x1e'),_0xed2d39[_0x547c('0x15')],_0x26823c);_0x2ab2cc(_0x1f3581[_0x547c('0x13')](0x1f4,_0xed2d39[_0x547c('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 8abb490..898631e 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 _0xf400=['get','isAuthenticated','index','/describe','describe','show','post','create','put','update','delete','destroy','multer','util','path','fs-extra','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller'];(function(_0x257280,_0x2921df){var _0xc4550e=function(_0x35bcfd){while(--_0x35bcfd){_0x257280['push'](_0x257280['shift']());}};_0xc4550e(++_0x2921df);}(_0xf400,0x103));var _0x0f40=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xf400[_0x4c7fb5];return _0x2e10ac;};'use strict';var multer=require(_0x0f40('0x0'));var util=require(_0x0f40('0x1'));var path=require(_0x0f40('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x0f40('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0f40('0x4'));var config=require(_0x0f40('0x5'));var controller=require(_0x0f40('0x6'));router[_0x0f40('0x7')]('/',auth[_0x0f40('0x8')](),controller[_0x0f40('0x9')]);router[_0x0f40('0x7')](_0x0f40('0xa'),auth[_0x0f40('0x8')](),controller[_0x0f40('0xb')]);router['get']('/:id',auth[_0x0f40('0x8')](),controller[_0x0f40('0xc')]);router[_0x0f40('0xd')]('/',auth[_0x0f40('0x8')](),controller[_0x0f40('0xe')]);router[_0x0f40('0xf')]('/:id',auth[_0x0f40('0x8')](),controller[_0x0f40('0x10')]);router[_0x0f40('0x11')]('/:id',auth[_0x0f40('0x8')](),controller[_0x0f40('0x12')]);module['exports']=router; \ No newline at end of file +var _0x01e4=['update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','isAuthenticated','/describe','get','/:id','show','post','create'];(function(_0x569c8f,_0x519095){var _0x48fa26=function(_0x46be6f){while(--_0x46be6f){_0x569c8f['push'](_0x569c8f['shift']());}};_0x48fa26(++_0x519095);}(_0x01e4,0x147));var _0x401e=function(_0x50a4ee,_0x4dad3c){_0x50a4ee=_0x50a4ee-0x0;var _0x710c9b=_0x01e4[_0x50a4ee];return _0x710c9b;};'use strict';var multer=require(_0x401e('0x0'));var util=require('util');var path=require(_0x401e('0x1'));var timeout=require(_0x401e('0x2'));var express=require('express');var router=express[_0x401e('0x3')]();var fs_extra=require(_0x401e('0x4'));var auth=require(_0x401e('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./openchannelTransferReport.controller');router['get']('/',auth[_0x401e('0x6')](),controller['index']);router['get'](_0x401e('0x7'),auth[_0x401e('0x6')](),controller['describe']);router[_0x401e('0x8')](_0x401e('0x9'),auth['isAuthenticated'](),controller[_0x401e('0xa')]);router[_0x401e('0xb')]('/',auth['isAuthenticated'](),controller[_0x401e('0xc')]);router['put'](_0x401e('0x9'),auth[_0x401e('0x6')](),controller[_0x401e('0xd')]);router[_0x401e('0xe')]('/:id',auth[_0x401e('0x6')](),controller[_0x401e('0xf')]);module[_0x401e('0x10')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 12941e8..bfa013f 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x236bf3,_0x41d090){var _0x116c83=function(_0x31af4e){while(--_0x31af4e){_0x236bf3['push'](_0x236bf3['shift']());}};_0x116c83(++_0x41d090);}(_0x70e0,0x17b));var _0x070e=function(_0x2d8a1b,_0x21755a){_0x2d8a1b=_0x2d8a1b-0x0;var _0x527780=_0x70e0[_0x2d8a1b];return _0x527780;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file +var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x1af5b2,_0x1b82fe){var _0xf1aa2d=function(_0x2ceae2){while(--_0x2ceae2){_0x1af5b2['push'](_0x1af5b2['shift']());}};_0xf1aa2d(++_0x1b82fe);}(_0x9c44,0x178));var _0x49c4=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x9c44[_0x2d2c16];return _0x53f2fb;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 6fcb12d..bc8b493 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 _0x2c73=['request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','count','limit','set','json','apply','reject','update','destroy','then','end','error','stack','name','send','index','rawAttributes','fieldName','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','offset','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','OpenchannelTransferReport','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','rimraf','fast-json-patch'];(function(_0x37519f,_0x202f12){var _0xebaefa=function(_0x4eb1e0){while(--_0x4eb1e0){_0x37519f['push'](_0x37519f['shift']());}};_0xebaefa(++_0x202f12);}(_0x2c73,0x96));var _0x32c7=function(_0x1d4e3f,_0x15553f){_0x1d4e3f=_0x1d4e3f-0x0;var _0x3f7c2c=_0x2c73[_0x1d4e3f];return _0x3f7c2c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x32c7('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x32c7('0x1'));var rp=require(_0x32c7('0x2'));var moment=require(_0x32c7('0x3'));var BPromise=require(_0x32c7('0x4'));var Mustache=require(_0x32c7('0x5'));var util=require('util');var path=require(_0x32c7('0x6'));var sox=require(_0x32c7('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x32c7('0x8'));var _=require(_0x32c7('0x9'));var squel=require(_0x32c7('0xa'));var crypto=require(_0x32c7('0xb'));var jsforce=require(_0x32c7('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x32c7('0xd'));var querystring=require('querystring');var Papa=require(_0x32c7('0xe'));var Redis=require(_0x32c7('0xf'));var authService=require(_0x32c7('0x10'));var qs=require(_0x32c7('0x11'));var as=require(_0x32c7('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x32c7('0x13'))('api');var utils=require(_0x32c7('0x14'));var config=require(_0x32c7('0x15'));var licenseUtil=require(_0x32c7('0x16'));var db=require(_0x32c7('0x17'))['db'];function respondWithStatusCode(_0x119ec4,_0x17e8e1){_0x17e8e1=_0x17e8e1||0xcc;return function(_0x3848f8){if(_0x3848f8){return _0x119ec4[_0x32c7('0x18')](_0x17e8e1);}return _0x119ec4[_0x32c7('0x19')](_0x17e8e1)['end']();};}function respondWithResult(_0x7d278b,_0x45bf8a){_0x45bf8a=_0x45bf8a||0xc8;return function(_0xf52662){if(_0xf52662){return _0x7d278b[_0x32c7('0x19')](_0x45bf8a)['json'](_0xf52662);}};}function respondWithFilteredResult(_0x472bcf,_0x5f252f){return function(_0x13b3e5){if(_0x13b3e5){var _0x9393c2=typeof _0x5f252f['offset']===_0x32c7('0x1a')&&typeof _0x5f252f['limit']===_0x32c7('0x1a');var _0x4b9432=_0x13b3e5[_0x32c7('0x1b')];var _0xfa1cf=_0x9393c2?0x0:_0x5f252f['offset'];var _0xaf9067=_0x9393c2?_0x13b3e5[_0x32c7('0x1b')]:_0x5f252f['offset']+_0x5f252f[_0x32c7('0x1c')];var _0x10a665;if(_0xaf9067>=_0x4b9432){_0xaf9067=_0x4b9432;_0x10a665=0xc8;}else{_0x10a665=0xce;}_0x472bcf[_0x32c7('0x19')](_0x10a665);return _0x472bcf[_0x32c7('0x1d')]('Content-Range',_0xfa1cf+'-'+_0xaf9067+'/'+_0x4b9432)[_0x32c7('0x1e')](_0x13b3e5);}return null;};}function patchUpdates(_0x2ca203){return function(_0x43918f){try{jsonpatch[_0x32c7('0x1f')](_0x43918f,_0x2ca203,!![]);}catch(_0x4072fd){return BPromise[_0x32c7('0x20')](_0x4072fd);}return _0x43918f['save']();};}function saveUpdates(_0xf2b7d8,_0x3e1f4a){return function(_0x4d0f9a){if(_0x4d0f9a){return _0x4d0f9a[_0x32c7('0x21')](_0xf2b7d8)['then'](function(_0x2ef06a){return _0x2ef06a;});}return null;};}function removeEntity(_0x3c844a,_0x2c32e8){return function(_0x3eabcf){if(_0x3eabcf){return _0x3eabcf[_0x32c7('0x22')]()[_0x32c7('0x23')](function(){_0x3c844a['status'](0xcc)[_0x32c7('0x24')]();});}};}function handleEntityNotFound(_0x21d670,_0xc4bce0){return function(_0x2bab27){if(!_0x2bab27){_0x21d670[_0x32c7('0x18')](0x194);}return _0x2bab27;};}function handleError(_0x4af448,_0x38ffd9){_0x38ffd9=_0x38ffd9||0x1f4;return function(_0x146fb5){logger[_0x32c7('0x25')](_0x146fb5[_0x32c7('0x26')]);if(_0x146fb5[_0x32c7('0x27')]){delete _0x146fb5[_0x32c7('0x27')];}_0x4af448['status'](_0x38ffd9)[_0x32c7('0x28')](_0x146fb5);};}exports[_0x32c7('0x29')]=function(_0xca1d44,_0x236de6){var _0x7d06a5={},_0x4137ad={},_0x1c4e1f={'count':0x0,'rows':[]};var _0x465dea=_['map'](db['OpenchannelTransferReport'][_0x32c7('0x2a')],function(_0x10f620){return{'name':_0x10f620[_0x32c7('0x2b')],'type':_0x10f620['type'][_0x32c7('0x2c')]};});_0x4137ad['model']=_['map'](_0x465dea,_0x32c7('0x27'));_0x4137ad[_0x32c7('0x2d')]=_[_0x32c7('0x2e')](_0xca1d44[_0x32c7('0x2d')]);_0x4137ad['filters']=_[_0x32c7('0x2f')](_0x4137ad[_0x32c7('0x30')],_0x4137ad['query']);_0x7d06a5[_0x32c7('0x31')]=_['intersection'](_0x4137ad[_0x32c7('0x30')],qs[_0x32c7('0x32')](_0xca1d44[_0x32c7('0x2d')]['fields']));_0x7d06a5['attributes']=_0x7d06a5[_0x32c7('0x31')][_0x32c7('0x33')]?_0x7d06a5['attributes']:_0x4137ad[_0x32c7('0x30')];if(!_0xca1d44[_0x32c7('0x2d')][_0x32c7('0x34')]('nolimit')){_0x7d06a5['limit']=qs[_0x32c7('0x1c')](_0xca1d44[_0x32c7('0x2d')][_0x32c7('0x1c')]);_0x7d06a5['offset']=qs['offset'](_0xca1d44[_0x32c7('0x2d')][_0x32c7('0x35')]);}_0x7d06a5[_0x32c7('0x36')]=qs[_0x32c7('0x37')](_0xca1d44['query']['sort']);_0x7d06a5[_0x32c7('0x38')]=qs[_0x32c7('0x39')](_[_0x32c7('0x3a')](_0xca1d44[_0x32c7('0x2d')],_0x4137ad[_0x32c7('0x39')]),_0x465dea);if(_0xca1d44[_0x32c7('0x2d')][_0x32c7('0x3b')]){_0x7d06a5[_0x32c7('0x38')]=_[_0x32c7('0x3c')](_0x7d06a5[_0x32c7('0x38')],{'$or':_['map'](_0x465dea,function(_0x25c7fc){if(_0x25c7fc[_0x32c7('0x3d')]!==_0x32c7('0x3e')){var _0x4cf764={};_0x4cf764[_0x25c7fc[_0x32c7('0x27')]]={'$like':'%'+_0xca1d44['query'][_0x32c7('0x3b')]+'%'};return _0x4cf764;}})});}_0x7d06a5=_[_0x32c7('0x3c')]({},_0x7d06a5,_0xca1d44[_0x32c7('0x3f')]);var _0x2ac5f6={'where':_0x7d06a5[_0x32c7('0x38')]};return db[_0x32c7('0x40')]['count'](_0x2ac5f6)['then'](function(_0x28405b){_0x1c4e1f[_0x32c7('0x1b')]=_0x28405b;if(_0xca1d44['query'][_0x32c7('0x41')]){_0x7d06a5['include']=[{'all':!![]}];}return db[_0x32c7('0x40')][_0x32c7('0x42')](_0x7d06a5);})['then'](function(_0x35b3e0){_0x1c4e1f[_0x32c7('0x43')]=_0x35b3e0;return _0x1c4e1f;})[_0x32c7('0x23')](respondWithFilteredResult(_0x236de6,_0x7d06a5))[_0x32c7('0x44')](handleError(_0x236de6,null));};exports[_0x32c7('0x45')]=function(_0x4fdd6d,_0x1d54de){var _0x292c2b={'raw':!![],'where':{'id':_0x4fdd6d[_0x32c7('0x46')]['id']}},_0x1d0a95={};_0x1d0a95[_0x32c7('0x30')]=_[_0x32c7('0x2e')](db[_0x32c7('0x40')][_0x32c7('0x2a')]);_0x1d0a95[_0x32c7('0x2d')]=_[_0x32c7('0x2e')](_0x4fdd6d['query']);_0x1d0a95[_0x32c7('0x39')]=_[_0x32c7('0x2f')](_0x1d0a95[_0x32c7('0x30')],_0x1d0a95['query']);_0x292c2b[_0x32c7('0x31')]=_['intersection'](_0x1d0a95[_0x32c7('0x30')],qs[_0x32c7('0x32')](_0x4fdd6d[_0x32c7('0x2d')][_0x32c7('0x32')]));_0x292c2b[_0x32c7('0x31')]=_0x292c2b[_0x32c7('0x31')][_0x32c7('0x33')]?_0x292c2b[_0x32c7('0x31')]:_0x1d0a95[_0x32c7('0x30')];if(_0x4fdd6d[_0x32c7('0x2d')][_0x32c7('0x41')]){_0x292c2b[_0x32c7('0x47')]=[{'all':!![]}];}_0x292c2b=_[_0x32c7('0x3c')]({},_0x292c2b,_0x4fdd6d['options']);return db[_0x32c7('0x40')][_0x32c7('0x48')](_0x292c2b)[_0x32c7('0x23')](handleEntityNotFound(_0x1d54de,null))[_0x32c7('0x23')](respondWithResult(_0x1d54de,null))[_0x32c7('0x44')](handleError(_0x1d54de,null));};exports[_0x32c7('0x49')]=function(_0xa1c0f0,_0x33c7b3){return db[_0x32c7('0x40')][_0x32c7('0x49')](_0xa1c0f0['body'],{})[_0x32c7('0x23')](respondWithResult(_0x33c7b3,0xc9))['catch'](handleError(_0x33c7b3,null));};exports[_0x32c7('0x21')]=function(_0x1e3fec,_0x575d17){if(_0x1e3fec[_0x32c7('0x4a')]['id']){delete _0x1e3fec['body']['id'];}return db['OpenchannelTransferReport']['find']({'where':{'id':_0x1e3fec[_0x32c7('0x46')]['id']}})['then'](handleEntityNotFound(_0x575d17,null))['then'](saveUpdates(_0x1e3fec[_0x32c7('0x4a')],null))['then'](respondWithResult(_0x575d17,null))[_0x32c7('0x44')](handleError(_0x575d17,null));};exports[_0x32c7('0x22')]=function(_0x2db13c,_0x301076){return db[_0x32c7('0x40')][_0x32c7('0x48')]({'where':{'id':_0x2db13c[_0x32c7('0x46')]['id']}})[_0x32c7('0x23')](handleEntityNotFound(_0x301076,null))[_0x32c7('0x23')](removeEntity(_0x301076,null))[_0x32c7('0x44')](handleError(_0x301076,null));};exports[_0x32c7('0x4b')]=function(_0x1162e3,_0x547856){return db[_0x32c7('0x40')]['describe']()[_0x32c7('0x23')](respondWithResult(_0x547856,null))[_0x32c7('0x44')](handleError(_0x547856,null));}; \ No newline at end of file +var _0xe6c5=['undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','OpenchannelTransferReport','fieldName','type','query','filters','intersection','model','fields','attributes','nolimit','sort','where','pick','filter','merge','options','includeAll','include','show','params','keys','rawAttributes','length','find','catch','create','body','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x514718,_0xdcbcd2){var _0xf5beda=function(_0x4c962c){while(--_0x4c962c){_0x514718['push'](_0x514718['shift']());}};_0xf5beda(++_0xdcbcd2);}(_0xe6c5,0x155));var _0x5e6c=function(_0x49bedd,_0x469f40){_0x49bedd=_0x49bedd-0x0;var _0x2dc886=_0xe6c5[_0x49bedd];return _0x2dc886;};'use strict';var emlformat=require(_0x5e6c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5e6c('0x1'));var rp=require(_0x5e6c('0x2'));var moment=require(_0x5e6c('0x3'));var BPromise=require(_0x5e6c('0x4'));var Mustache=require('mustache');var util=require(_0x5e6c('0x5'));var path=require(_0x5e6c('0x6'));var sox=require(_0x5e6c('0x7'));var csv=require(_0x5e6c('0x8'));var ejs=require(_0x5e6c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5e6c('0xa'));var crypto=require(_0x5e6c('0xb'));var jsforce=require(_0x5e6c('0xc'));var deskjs=require(_0x5e6c('0xd'));var toCsv=require(_0x5e6c('0x8'));var querystring=require(_0x5e6c('0xe'));var Papa=require(_0x5e6c('0xf'));var Redis=require('ioredis');var authService=require(_0x5e6c('0x10'));var qs=require(_0x5e6c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5e6c('0x12'));var logger=require(_0x5e6c('0x13'))(_0x5e6c('0x14'));var utils=require(_0x5e6c('0x15'));var config=require(_0x5e6c('0x16'));var licenseUtil=require(_0x5e6c('0x17'));var db=require(_0x5e6c('0x18'))['db'];function respondWithStatusCode(_0x4a202e,_0x40f827){_0x40f827=_0x40f827||0xcc;return function(_0xff9826){if(_0xff9826){return _0x4a202e[_0x5e6c('0x19')](_0x40f827);}return _0x4a202e[_0x5e6c('0x1a')](_0x40f827)[_0x5e6c('0x1b')]();};}function respondWithResult(_0x70c550,_0xfab85f){_0xfab85f=_0xfab85f||0xc8;return function(_0x481a63){if(_0x481a63){return _0x70c550[_0x5e6c('0x1a')](_0xfab85f)[_0x5e6c('0x1c')](_0x481a63);}};}function respondWithFilteredResult(_0x528556,_0x62ed7f){return function(_0x9244d9){if(_0x9244d9){var _0x5be190=typeof _0x62ed7f['offset']===_0x5e6c('0x1d')&&typeof _0x62ed7f[_0x5e6c('0x1e')]===_0x5e6c('0x1d');var _0xcfc557=_0x9244d9[_0x5e6c('0x1f')];var _0x39ce22=_0x5be190?0x0:_0x62ed7f[_0x5e6c('0x20')];var _0x20f44f=_0x5be190?_0x9244d9[_0x5e6c('0x1f')]:_0x62ed7f[_0x5e6c('0x20')]+_0x62ed7f[_0x5e6c('0x1e')];var _0x44c374;if(_0x20f44f>=_0xcfc557){_0x20f44f=_0xcfc557;_0x44c374=0xc8;}else{_0x44c374=0xce;}_0x528556['status'](_0x44c374);return _0x528556[_0x5e6c('0x21')](_0x5e6c('0x22'),_0x39ce22+'-'+_0x20f44f+'/'+_0xcfc557)['json'](_0x9244d9);}return null;};}function patchUpdates(_0x1447f8){return function(_0x4317aa){try{jsonpatch['apply'](_0x4317aa,_0x1447f8,!![]);}catch(_0x5167a9){return BPromise[_0x5e6c('0x23')](_0x5167a9);}return _0x4317aa[_0x5e6c('0x24')]();};}function saveUpdates(_0x1feae5,_0x570556){return function(_0x1ce49c){if(_0x1ce49c){return _0x1ce49c[_0x5e6c('0x25')](_0x1feae5)[_0x5e6c('0x26')](function(_0x4afebc){return _0x4afebc;});}return null;};}function removeEntity(_0x29d6d9,_0x419d68){return function(_0x41be5c){if(_0x41be5c){return _0x41be5c[_0x5e6c('0x27')]()['then'](function(){_0x29d6d9[_0x5e6c('0x1a')](0xcc)[_0x5e6c('0x1b')]();});}};}function handleEntityNotFound(_0x356779,_0x3fd7b1){return function(_0x31c9a3){if(!_0x31c9a3){_0x356779['sendStatus'](0x194);}return _0x31c9a3;};}function handleError(_0x53085c,_0x2d28c2){_0x2d28c2=_0x2d28c2||0x1f4;return function(_0x455b81){logger[_0x5e6c('0x28')](_0x455b81[_0x5e6c('0x29')]);if(_0x455b81['name']){delete _0x455b81[_0x5e6c('0x2a')];}_0x53085c[_0x5e6c('0x1a')](_0x2d28c2)[_0x5e6c('0x2b')](_0x455b81);};}exports[_0x5e6c('0x2c')]=function(_0x19d25c,_0x44bc4e){var _0x313b10={},_0x2e76cd={},_0x1e08f5={'count':0x0,'rows':[]};var _0x2ea161=_[_0x5e6c('0x2d')](db[_0x5e6c('0x2e')]['rawAttributes'],function(_0x583ec7){return{'name':_0x583ec7[_0x5e6c('0x2f')],'type':_0x583ec7[_0x5e6c('0x30')]['key']};});_0x2e76cd['model']=_['map'](_0x2ea161,_0x5e6c('0x2a'));_0x2e76cd[_0x5e6c('0x31')]=_['keys'](_0x19d25c[_0x5e6c('0x31')]);_0x2e76cd[_0x5e6c('0x32')]=_[_0x5e6c('0x33')](_0x2e76cd[_0x5e6c('0x34')],_0x2e76cd[_0x5e6c('0x31')]);_0x313b10['attributes']=_[_0x5e6c('0x33')](_0x2e76cd['model'],qs[_0x5e6c('0x35')](_0x19d25c['query']['fields']));_0x313b10[_0x5e6c('0x36')]=_0x313b10[_0x5e6c('0x36')]['length']?_0x313b10[_0x5e6c('0x36')]:_0x2e76cd[_0x5e6c('0x34')];if(!_0x19d25c[_0x5e6c('0x31')]['hasOwnProperty'](_0x5e6c('0x37'))){_0x313b10['limit']=qs['limit'](_0x19d25c[_0x5e6c('0x31')]['limit']);_0x313b10[_0x5e6c('0x20')]=qs[_0x5e6c('0x20')](_0x19d25c[_0x5e6c('0x31')]['offset']);}_0x313b10['order']=qs[_0x5e6c('0x38')](_0x19d25c[_0x5e6c('0x31')][_0x5e6c('0x38')]);_0x313b10[_0x5e6c('0x39')]=qs[_0x5e6c('0x32')](_[_0x5e6c('0x3a')](_0x19d25c['query'],_0x2e76cd[_0x5e6c('0x32')]),_0x2ea161);if(_0x19d25c[_0x5e6c('0x31')][_0x5e6c('0x3b')]){_0x313b10[_0x5e6c('0x39')]=_[_0x5e6c('0x3c')](_0x313b10[_0x5e6c('0x39')],{'$or':_[_0x5e6c('0x2d')](_0x2ea161,function(_0x304085){if(_0x304085[_0x5e6c('0x30')]!=='VIRTUAL'){var _0x399736={};_0x399736[_0x304085['name']]={'$like':'%'+_0x19d25c[_0x5e6c('0x31')][_0x5e6c('0x3b')]+'%'};return _0x399736;}})});}_0x313b10=_['merge']({},_0x313b10,_0x19d25c[_0x5e6c('0x3d')]);var _0x3fb303={'where':_0x313b10[_0x5e6c('0x39')]};return db[_0x5e6c('0x2e')][_0x5e6c('0x1f')](_0x3fb303)[_0x5e6c('0x26')](function(_0x5beb6b){_0x1e08f5[_0x5e6c('0x1f')]=_0x5beb6b;if(_0x19d25c[_0x5e6c('0x31')][_0x5e6c('0x3e')]){_0x313b10[_0x5e6c('0x3f')]=[{'all':!![]}];}return db['OpenchannelTransferReport']['findAll'](_0x313b10);})[_0x5e6c('0x26')](function(_0x2e79e0){_0x1e08f5['rows']=_0x2e79e0;return _0x1e08f5;})[_0x5e6c('0x26')](respondWithFilteredResult(_0x44bc4e,_0x313b10))['catch'](handleError(_0x44bc4e,null));};exports[_0x5e6c('0x40')]=function(_0x22a3cb,_0xb2025f){var _0x57b0e0={'raw':!![],'where':{'id':_0x22a3cb[_0x5e6c('0x41')]['id']}},_0x2b5162={};_0x2b5162[_0x5e6c('0x34')]=_[_0x5e6c('0x42')](db[_0x5e6c('0x2e')][_0x5e6c('0x43')]);_0x2b5162[_0x5e6c('0x31')]=_['keys'](_0x22a3cb[_0x5e6c('0x31')]);_0x2b5162[_0x5e6c('0x32')]=_[_0x5e6c('0x33')](_0x2b5162[_0x5e6c('0x34')],_0x2b5162['query']);_0x57b0e0['attributes']=_[_0x5e6c('0x33')](_0x2b5162[_0x5e6c('0x34')],qs[_0x5e6c('0x35')](_0x22a3cb[_0x5e6c('0x31')][_0x5e6c('0x35')]));_0x57b0e0['attributes']=_0x57b0e0[_0x5e6c('0x36')][_0x5e6c('0x44')]?_0x57b0e0[_0x5e6c('0x36')]:_0x2b5162[_0x5e6c('0x34')];if(_0x22a3cb[_0x5e6c('0x31')][_0x5e6c('0x3e')]){_0x57b0e0[_0x5e6c('0x3f')]=[{'all':!![]}];}_0x57b0e0=_[_0x5e6c('0x3c')]({},_0x57b0e0,_0x22a3cb[_0x5e6c('0x3d')]);return db[_0x5e6c('0x2e')][_0x5e6c('0x45')](_0x57b0e0)[_0x5e6c('0x26')](handleEntityNotFound(_0xb2025f,null))['then'](respondWithResult(_0xb2025f,null))[_0x5e6c('0x46')](handleError(_0xb2025f,null));};exports['create']=function(_0x37ec14,_0x20858a){return db['OpenchannelTransferReport'][_0x5e6c('0x47')](_0x37ec14['body'],{})[_0x5e6c('0x26')](respondWithResult(_0x20858a,0xc9))['catch'](handleError(_0x20858a,null));};exports['update']=function(_0x35b5f9,_0x284f96){if(_0x35b5f9[_0x5e6c('0x48')]['id']){delete _0x35b5f9[_0x5e6c('0x48')]['id'];}return db[_0x5e6c('0x2e')][_0x5e6c('0x45')]({'where':{'id':_0x35b5f9[_0x5e6c('0x41')]['id']}})[_0x5e6c('0x26')](handleEntityNotFound(_0x284f96,null))[_0x5e6c('0x26')](saveUpdates(_0x35b5f9[_0x5e6c('0x48')],null))[_0x5e6c('0x26')](respondWithResult(_0x284f96,null))[_0x5e6c('0x46')](handleError(_0x284f96,null));};exports[_0x5e6c('0x27')]=function(_0xa0bf68,_0x2230af){return db[_0x5e6c('0x2e')][_0x5e6c('0x45')]({'where':{'id':_0xa0bf68['params']['id']}})[_0x5e6c('0x26')](handleEntityNotFound(_0x2230af,null))[_0x5e6c('0x26')](removeEntity(_0x2230af,null))[_0x5e6c('0x46')](handleError(_0x2230af,null));};exports[_0x5e6c('0x49')]=function(_0x29ed91,_0x577e56){return db[_0x5e6c('0x2e')][_0x5e6c('0x49')]()['then'](respondWithResult(_0x577e56,null))[_0x5e6c('0x46')](handleError(_0x577e56,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 040f290..a398958 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 _0xa622=['../../config/environment','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xa622,0x10a));var _0x2a62=function(_0xf14c84,_0x55666b){_0xf14c84=_0xf14c84-0x0;var _0x267ee4=_0xa622[_0xf14c84];return _0x267ee4;};'use strict';var _=require(_0x2a62('0x0'));var util=require(_0x2a62('0x1'));var logger=require(_0x2a62('0x2'))(_0x2a62('0x3'));var moment=require(_0x2a62('0x4'));var BPromise=require(_0x2a62('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2a62('0x6'));var rimraf=require('rimraf');var config=require(_0x2a62('0x7'));var attributes=require('./openchannelTransferReport.attributes');module[_0x2a62('0x8')]=function(_0x21d903,_0x5a40c4){return _0x21d903[_0x2a62('0x9')](_0x2a62('0xa'),attributes,{'tableName':_0x2a62('0xb'),'paranoid':![],'indexes':[{'name':_0x2a62('0xc'),'fields':[_0x2a62('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6bbd=['rimraf','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x1923e4,_0xd6764b){var _0x135d5e=function(_0x3a61cd){while(--_0x3a61cd){_0x1923e4['push'](_0x1923e4['shift']());}};_0x135d5e(++_0xd6764b);}(_0x6bbd,0x124));var _0xd6bb=function(_0x4a7273,_0x19c9ca){_0x4a7273=_0x4a7273-0x0;var _0x135ca9=_0x6bbd[_0x4a7273];return _0x135ca9;};'use strict';var _=require(_0xd6bb('0x0'));var util=require(_0xd6bb('0x1'));var logger=require(_0xd6bb('0x2'))(_0xd6bb('0x3'));var moment=require(_0xd6bb('0x4'));var BPromise=require(_0xd6bb('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd6bb('0x6'));var rimraf=require(_0xd6bb('0x7'));var config=require('../../config/environment');var attributes=require(_0xd6bb('0x8'));module[_0xd6bb('0x9')]=function(_0x13ea9e,_0x15f751){return _0x13ea9e[_0xd6bb('0xa')](_0xd6bb('0xb'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0xd6bb('0xc'),'fields':[_0xd6bb('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 4b663cc..641a629 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 _0x818f=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x3d7420,_0x41467c){var _0x6d218e=function(_0x8612c3){while(--_0x8612c3){_0x3d7420['push'](_0x3d7420['shift']());}};_0x6d218e(++_0x41467c);}(_0x818f,0x1da));var _0xf818=function(_0x589389,_0x2535d3){_0x589389=_0x589389-0x0;var _0x4ff959=_0x818f[_0x589389];return _0x4ff959;};'use strict';var _=require(_0xf818('0x0'));var util=require(_0xf818('0x1'));var moment=require(_0xf818('0x2'));var BPromise=require(_0xf818('0x3'));var rs=require(_0xf818('0x4'));var fs=require('fs');var Redis=require(_0xf818('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf818('0x6'));var logger=require(_0xf818('0x7'))(_0xf818('0x8'));var config=require(_0xf818('0x9'));var jayson=require(_0xf818('0xa'));var client=jayson[_0xf818('0xb')][_0xf818('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42a23e,_0x860f80,_0x55540d){return new BPromise(function(_0x1dbfc8,_0x7849aa){return client[_0xf818('0xd')](_0x42a23e,_0x55540d)['then'](function(_0x52556a){logger[_0xf818('0xe')](_0xf818('0xf'),_0x860f80,_0xf818('0x10'));logger[_0xf818('0x11')](_0xf818('0x12'),_0x860f80,'request\x20sent',JSON[_0xf818('0x13')](_0x52556a));if(_0x52556a[_0xf818('0x14')]){if(_0x52556a[_0xf818('0x14')][_0xf818('0x15')]===0x1f4){logger[_0xf818('0x14')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x860f80,_0x52556a['error'][_0xf818('0x16')]);return _0x7849aa(_0x52556a[_0xf818('0x14')][_0xf818('0x16')]);}logger[_0xf818('0x14')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x860f80,_0x52556a[_0xf818('0x14')][_0xf818('0x16')]);return _0x1dbfc8(_0x52556a[_0xf818('0x14')][_0xf818('0x16')]);}else{logger[_0xf818('0xe')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x860f80,'request\x20sent');_0x1dbfc8(_0x52556a[_0xf818('0x17')]['message']);}})[_0xf818('0x18')](function(_0x28cfcf){logger['error'](_0xf818('0xf'),_0x860f80,_0x28cfcf);_0x7849aa(_0x28cfcf);});});} \ No newline at end of file +var _0xa7e6=['stringify','error','OpenchannelTransferReport,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa7e6,0x74));var _0x6a7e=function(_0x15c211,_0x13093b){_0x15c211=_0x15c211-0x0;var _0x2fc84c=_0xa7e6[_0x15c211];return _0x2fc84c;};'use strict';var _=require(_0x6a7e('0x0'));var util=require(_0x6a7e('0x1'));var moment=require(_0x6a7e('0x2'));var BPromise=require(_0x6a7e('0x3'));var rs=require(_0x6a7e('0x4'));var fs=require('fs');var Redis=require(_0x6a7e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6a7e('0x6'));var logger=require(_0x6a7e('0x7'))(_0x6a7e('0x8'));var config=require(_0x6a7e('0x9'));var jayson=require(_0x6a7e('0xa'));var client=jayson['client'][_0x6a7e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16249d,_0x37165d,_0x342c96){return new BPromise(function(_0x45e92e,_0x3f3f2f){return client[_0x6a7e('0xc')](_0x16249d,_0x342c96)[_0x6a7e('0xd')](function(_0xdaa33d){logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x37165d,'request\x20sent');logger['debug'](_0x6a7e('0xe'),_0x37165d,_0x6a7e('0xf'),JSON[_0x6a7e('0x10')](_0xdaa33d));if(_0xdaa33d[_0x6a7e('0x11')]){if(_0xdaa33d[_0x6a7e('0x11')]['code']===0x1f4){logger[_0x6a7e('0x11')](_0x6a7e('0x12'),_0x37165d,_0xdaa33d['error']['message']);return _0x3f3f2f(_0xdaa33d[_0x6a7e('0x11')][_0x6a7e('0x13')]);}logger[_0x6a7e('0x11')](_0x6a7e('0x12'),_0x37165d,_0xdaa33d['error'][_0x6a7e('0x13')]);return _0x45e92e(_0xdaa33d[_0x6a7e('0x11')][_0x6a7e('0x13')]);}else{logger[_0x6a7e('0x14')](_0x6a7e('0x12'),_0x37165d,'request\x20sent');_0x45e92e(_0xdaa33d[_0x6a7e('0x15')]['message']);}})['catch'](function(_0x454561){logger['error'](_0x6a7e('0x12'),_0x37165d,_0x454561);_0x3f3f2f(_0x454561);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index ce4d8a0..5008ae4 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 _0x4ee4=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','multer','util','path'];(function(_0x1c391b,_0x331dc5){var _0x3da0c1=function(_0x200487){while(--_0x200487){_0x1c391b['push'](_0x1c391b['shift']());}};_0x3da0c1(++_0x331dc5);}(_0x4ee4,0x179));var _0x44ee=function(_0x30b0d8,_0x57470c){_0x30b0d8=_0x30b0d8-0x0;var _0x459c09=_0x4ee4[_0x30b0d8];return _0x459c09;};'use strict';var multer=require(_0x44ee('0x0'));var util=require(_0x44ee('0x1'));var path=require(_0x44ee('0x2'));var timeout=require(_0x44ee('0x3'));var express=require('express');var router=express[_0x44ee('0x4')]();var fs_extra=require(_0x44ee('0x5'));var auth=require(_0x44ee('0x6'));var interaction=require(_0x44ee('0x7'));var config=require(_0x44ee('0x8'));var controller=require(_0x44ee('0x9'));router[_0x44ee('0xa')]('/',auth[_0x44ee('0xb')](),controller[_0x44ee('0xc')]);router[_0x44ee('0xa')](_0x44ee('0xd'),auth[_0x44ee('0xb')](),controller[_0x44ee('0xe')]);router[_0x44ee('0xf')]('/',auth[_0x44ee('0xb')](),controller[_0x44ee('0x10')]);router['put'](_0x44ee('0xd'),auth[_0x44ee('0xb')](),controller[_0x44ee('0x11')]);router[_0x44ee('0x12')]('/:id',auth[_0x44ee('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xbc72=['../../components/auth/service','../../config/environment','./pause.controller','get','/:id','isAuthenticated','show','post','create','put','update','destroy','multer','util','path','express','Router','fs-extra'];(function(_0x171fdc,_0x16ae91){var _0x3782ea=function(_0x58b691){while(--_0x58b691){_0x171fdc['push'](_0x171fdc['shift']());}};_0x3782ea(++_0x16ae91);}(_0xbc72,0x8a));var _0x2bc7=function(_0x4ec16b,_0x5bc004){_0x4ec16b=_0x4ec16b-0x0;var _0x38d25f=_0xbc72[_0x4ec16b];return _0x38d25f;};'use strict';var multer=require(_0x2bc7('0x0'));var util=require(_0x2bc7('0x1'));var path=require(_0x2bc7('0x2'));var timeout=require('connect-timeout');var express=require(_0x2bc7('0x3'));var router=express[_0x2bc7('0x4')]();var fs_extra=require(_0x2bc7('0x5'));var auth=require(_0x2bc7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2bc7('0x7'));var controller=require(_0x2bc7('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x2bc7('0x9')](_0x2bc7('0xa'),auth[_0x2bc7('0xb')](),controller[_0x2bc7('0xc')]);router[_0x2bc7('0xd')]('/',auth['isAuthenticated'](),controller[_0x2bc7('0xe')]);router[_0x2bc7('0xf')](_0x2bc7('0xa'),auth[_0x2bc7('0xb')](),controller[_0x2bc7('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x2bc7('0x11')]);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 053e981..ed3529d 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 _0xecc6=['sequelize','STRING'];(function(_0x42a62a,_0x2d3511){var _0x1a52d9=function(_0x279c51){while(--_0x279c51){_0x42a62a['push'](_0x42a62a['shift']());}};_0x1a52d9(++_0x2d3511);}(_0xecc6,0x94));var _0x6ecc=function(_0x4bbdef,_0x34acfe){_0x4bbdef=_0x4bbdef-0x0;var _0x17021c=_0xecc6[_0x4bbdef];return _0x17021c;};'use strict';var Sequelize=require(_0x6ecc('0x0'));module['exports']={'name':{'type':Sequelize[_0x6ecc('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xaf44=['STRING','sequelize','exports','name'];(function(_0x3048ed,_0x511d4e){var _0x2b3578=function(_0x563a69){while(--_0x563a69){_0x3048ed['push'](_0x3048ed['shift']());}};_0x2b3578(++_0x511d4e);}(_0xaf44,0x145));var _0x4af4=function(_0x2e2cfb,_0x51d703){_0x2e2cfb=_0x2e2cfb-0x0;var _0x1b7f7b=_0xaf44[_0x2e2cfb];return _0x1b7f7b;};'use strict';var Sequelize=require(_0x4af4('0x0'));module[_0x4af4('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x4af4('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x4af4('0x3')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 49a629f..263ded4 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 _0x2c74=['name','send','map','rawAttributes','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','Pause','includeAll','include','rows','show','params','keys','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','destroy','then','Pauses','UserProfileResource','error','stack'];(function(_0x46a3ba,_0x1b12fb){var _0x2c1bd4=function(_0x2fa1c2){while(--_0x2fa1c2){_0x46a3ba['push'](_0x46a3ba['shift']());}};_0x2c1bd4(++_0x1b12fb);}(_0x2c74,0x7f));var _0x42c7=function(_0x2d2201,_0x3cfe3d){_0x2d2201=_0x2d2201-0x0;var _0x12e6cd=_0x2c74[_0x2d2201];return _0x12e6cd;};'use strict';var emlformat=require(_0x42c7('0x0'));var rimraf=require(_0x42c7('0x1'));var zipdir=require(_0x42c7('0x2'));var jsonpatch=require(_0x42c7('0x3'));var rp=require('request-promise');var moment=require(_0x42c7('0x4'));var BPromise=require(_0x42c7('0x5'));var Mustache=require(_0x42c7('0x6'));var util=require(_0x42c7('0x7'));var path=require(_0x42c7('0x8'));var sox=require(_0x42c7('0x9'));var csv=require(_0x42c7('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x42c7('0xb'));var _=require(_0x42c7('0xc'));var squel=require(_0x42c7('0xd'));var crypto=require(_0x42c7('0xe'));var jsforce=require(_0x42c7('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x42c7('0x10'));var Papa=require('papaparse');var Redis=require(_0x42c7('0x11'));var authService=require(_0x42c7('0x12'));var qs=require(_0x42c7('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x42c7('0x14'))('api');var utils=require(_0x42c7('0x15'));var config=require(_0x42c7('0x16'));var licenseUtil=require(_0x42c7('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x432b75,_0x5cb95a){_0x5cb95a=_0x5cb95a||0xcc;return function(_0x4eb57c){if(_0x4eb57c){return _0x432b75[_0x42c7('0x18')](_0x5cb95a);}return _0x432b75[_0x42c7('0x19')](_0x5cb95a)[_0x42c7('0x1a')]();};}function respondWithResult(_0x457089,_0x4b7023){_0x4b7023=_0x4b7023||0xc8;return function(_0x2606dd){if(_0x2606dd){return _0x457089['status'](_0x4b7023)[_0x42c7('0x1b')](_0x2606dd);}};}function respondWithFilteredResult(_0x26d31b,_0x5d35df){return function(_0x4e88a2){if(_0x4e88a2){var _0x3317da=typeof _0x5d35df['offset']===_0x42c7('0x1c')&&typeof _0x5d35df[_0x42c7('0x1d')]===_0x42c7('0x1c');var _0x382190=_0x4e88a2[_0x42c7('0x1e')];var _0x5b9f25=_0x3317da?0x0:_0x5d35df[_0x42c7('0x1f')];var _0x24001b=_0x3317da?_0x4e88a2[_0x42c7('0x1e')]:_0x5d35df[_0x42c7('0x1f')]+_0x5d35df['limit'];var _0x1f637c;if(_0x24001b>=_0x382190){_0x24001b=_0x382190;_0x1f637c=0xc8;}else{_0x1f637c=0xce;}_0x26d31b[_0x42c7('0x19')](_0x1f637c);return _0x26d31b[_0x42c7('0x20')]('Content-Range',_0x5b9f25+'-'+_0x24001b+'/'+_0x382190)[_0x42c7('0x1b')](_0x4e88a2);}return null;};}function patchUpdates(_0xaf9462){return function(_0x2b6850){try{jsonpatch[_0x42c7('0x21')](_0x2b6850,_0xaf9462,!![]);}catch(_0x21caeb){return BPromise[_0x42c7('0x22')](_0x21caeb);}return _0x2b6850[_0x42c7('0x23')]();};}function saveUpdates(_0x8bdfef,_0x330845){return function(_0x309d7f){if(_0x309d7f){return _0x309d7f[_0x42c7('0x24')](_0x8bdfef)['then'](function(_0x370231){return _0x370231;});}return null;};}function removeEntity(_0x2d35b1,_0x1b962e){return function(_0x152cfc){if(_0x152cfc){return _0x152cfc[_0x42c7('0x25')]()[_0x42c7('0x26')](function(){var _0x1274ce=_0x152cfc['get']({'plain':!![]});var _0x2a5bb1=_0x42c7('0x27');return db[_0x42c7('0x28')][_0x42c7('0x25')]({'where':{'type':_0x2a5bb1,'resourceId':_0x1274ce['id']}})[_0x42c7('0x26')](function(){return _0x152cfc;});})['then'](function(){_0x2d35b1['status'](0xcc)[_0x42c7('0x1a')]();});}};}function handleEntityNotFound(_0x504d7b,_0x1501d1){return function(_0x186017){if(!_0x186017){_0x504d7b[_0x42c7('0x18')](0x194);}return _0x186017;};}function handleError(_0xfcf8bc,_0x59c0d1){_0x59c0d1=_0x59c0d1||0x1f4;return function(_0xe071f0){logger[_0x42c7('0x29')](_0xe071f0[_0x42c7('0x2a')]);if(_0xe071f0[_0x42c7('0x2b')]){delete _0xe071f0[_0x42c7('0x2b')];}_0xfcf8bc['status'](_0x59c0d1)[_0x42c7('0x2c')](_0xe071f0);};}exports['index']=function(_0x30c9ab,_0x460b60){var _0x464117={},_0x1ec2b3={},_0x4f1399={'count':0x0,'rows':[]};var _0x118db9=_[_0x42c7('0x2d')](db['Pause'][_0x42c7('0x2e')],function(_0x5ac1b3){return{'name':_0x5ac1b3['fieldName'],'type':_0x5ac1b3[_0x42c7('0x2f')][_0x42c7('0x30')]};});_0x1ec2b3['model']=_[_0x42c7('0x2d')](_0x118db9,_0x42c7('0x2b'));_0x1ec2b3['query']=_['keys'](_0x30c9ab[_0x42c7('0x31')]);_0x1ec2b3['filters']=_[_0x42c7('0x32')](_0x1ec2b3[_0x42c7('0x33')],_0x1ec2b3[_0x42c7('0x31')]);_0x464117[_0x42c7('0x34')]=_['intersection'](_0x1ec2b3['model'],qs[_0x42c7('0x35')](_0x30c9ab[_0x42c7('0x31')][_0x42c7('0x35')]));_0x464117[_0x42c7('0x34')]=_0x464117['attributes'][_0x42c7('0x36')]?_0x464117[_0x42c7('0x34')]:_0x1ec2b3[_0x42c7('0x33')];if(!_0x30c9ab['query'][_0x42c7('0x37')](_0x42c7('0x38'))){_0x464117['limit']=qs[_0x42c7('0x1d')](_0x30c9ab[_0x42c7('0x31')]['limit']);_0x464117[_0x42c7('0x1f')]=qs['offset'](_0x30c9ab[_0x42c7('0x31')][_0x42c7('0x1f')]);}_0x464117[_0x42c7('0x39')]=qs[_0x42c7('0x3a')](_0x30c9ab[_0x42c7('0x31')][_0x42c7('0x3a')]);_0x464117[_0x42c7('0x3b')]=qs[_0x42c7('0x3c')](_[_0x42c7('0x3d')](_0x30c9ab[_0x42c7('0x31')],_0x1ec2b3[_0x42c7('0x3c')]),_0x118db9);if(_0x30c9ab['query']['filter']){_0x464117[_0x42c7('0x3b')]=_[_0x42c7('0x3e')](_0x464117[_0x42c7('0x3b')],{'$or':_[_0x42c7('0x2d')](_0x118db9,function(_0x5ac043){if(_0x5ac043[_0x42c7('0x2f')]!==_0x42c7('0x3f')){var _0xaed7e4={};_0xaed7e4[_0x5ac043['name']]={'$like':'%'+_0x30c9ab[_0x42c7('0x31')][_0x42c7('0x40')]+'%'};return _0xaed7e4;}})});}_0x464117=_['merge']({},_0x464117,_0x30c9ab[_0x42c7('0x41')]);var _0x81cd2e={'where':_0x464117[_0x42c7('0x3b')]};return db[_0x42c7('0x42')]['count'](_0x81cd2e)[_0x42c7('0x26')](function(_0x1aa93a){_0x4f1399['count']=_0x1aa93a;if(_0x30c9ab['query'][_0x42c7('0x43')]){_0x464117[_0x42c7('0x44')]=[{'all':!![]}];}return db[_0x42c7('0x42')]['findAll'](_0x464117);})[_0x42c7('0x26')](function(_0x2d583a){_0x4f1399[_0x42c7('0x45')]=_0x2d583a;return _0x4f1399;})['then'](respondWithFilteredResult(_0x460b60,_0x464117))['catch'](handleError(_0x460b60,null));};exports[_0x42c7('0x46')]=function(_0x4e91cb,_0x339d07){var _0x41a0af={'raw':!![],'where':{'id':_0x4e91cb[_0x42c7('0x47')]['id']}},_0x1b87c7={};_0x1b87c7[_0x42c7('0x33')]=_['keys'](db[_0x42c7('0x42')][_0x42c7('0x2e')]);_0x1b87c7['query']=_[_0x42c7('0x48')](_0x4e91cb['query']);_0x1b87c7['filters']=_[_0x42c7('0x32')](_0x1b87c7[_0x42c7('0x33')],_0x1b87c7[_0x42c7('0x31')]);_0x41a0af[_0x42c7('0x34')]=_[_0x42c7('0x32')](_0x1b87c7[_0x42c7('0x33')],qs[_0x42c7('0x35')](_0x4e91cb[_0x42c7('0x31')][_0x42c7('0x35')]));_0x41a0af[_0x42c7('0x34')]=_0x41a0af[_0x42c7('0x34')][_0x42c7('0x36')]?_0x41a0af[_0x42c7('0x34')]:_0x1b87c7[_0x42c7('0x33')];if(_0x4e91cb[_0x42c7('0x31')]['includeAll']){_0x41a0af[_0x42c7('0x44')]=[{'all':!![]}];}_0x41a0af=_[_0x42c7('0x3e')]({},_0x41a0af,_0x4e91cb['options']);return db[_0x42c7('0x42')][_0x42c7('0x49')](_0x41a0af)['then'](handleEntityNotFound(_0x339d07,null))[_0x42c7('0x26')](respondWithResult(_0x339d07,null))['catch'](handleError(_0x339d07,null));};exports[_0x42c7('0x4a')]=function(_0x573adf,_0x31beb6){return db[_0x42c7('0x42')][_0x42c7('0x4a')](_0x573adf[_0x42c7('0x4b')],{})[_0x42c7('0x26')](function(_0x331d0d){var _0x34702f=_0x573adf[_0x42c7('0x4c')][_0x42c7('0x4d')]({'plain':!![]});if(!_0x34702f)throw new Error(_0x42c7('0x4e'));if(_0x34702f[_0x42c7('0x4f')]===_0x42c7('0x4c')){var _0x31c272=_0x331d0d[_0x42c7('0x4d')]({'plain':!![]});var _0x134123=_0x42c7('0x27');return db[_0x42c7('0x50')]['find']({'where':{'name':_0x134123,'userProfileId':_0x34702f[_0x42c7('0x51')]},'raw':!![]})[_0x42c7('0x26')](function(_0x164243){if(_0x164243&&_0x164243[_0x42c7('0x52')]===0x0){return db[_0x42c7('0x28')][_0x42c7('0x4a')]({'name':_0x31c272[_0x42c7('0x2b')],'resourceId':_0x31c272['id'],'type':_0x164243['name'],'sectionId':_0x164243['id']},{})[_0x42c7('0x26')](function(){return _0x331d0d;});}else{return _0x331d0d;}})[_0x42c7('0x53')](function(_0x11367c){logger['error'](_0x42c7('0x54'),_0x11367c);throw _0x11367c;});}return _0x331d0d;})['then'](respondWithResult(_0x31beb6,0xc9))[_0x42c7('0x53')](handleError(_0x31beb6,null));};exports[_0x42c7('0x24')]=function(_0x398f6f,_0xbcecb3){if(_0x398f6f['body']['id']){delete _0x398f6f['body']['id'];}return db['Pause']['find']({'where':{'id':_0x398f6f[_0x42c7('0x47')]['id']}})[_0x42c7('0x26')](handleEntityNotFound(_0xbcecb3,null))['then'](saveUpdates(_0x398f6f[_0x42c7('0x4b')],null))[_0x42c7('0x26')](respondWithResult(_0xbcecb3,null))['catch'](handleError(_0xbcecb3,null));};exports[_0x42c7('0x25')]=function(_0x578eb4,_0x1662ad){return db[_0x42c7('0x42')][_0x42c7('0x49')]({'where':{'id':_0x578eb4[_0x42c7('0x47')]['id']}})[_0x42c7('0x26')](handleEntityNotFound(_0x1662ad,null))[_0x42c7('0x26')](removeEntity(_0x1662ad,null))[_0x42c7('0x53')](handleError(_0x1662ad,null));}; \ No newline at end of file +var _0x4ba0=['index','map','Pause','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','reject','save','update','then','get','Pauses','UserProfileResource','destroy','sendStatus','stack','name','send'];(function(_0x28f02b,_0x39c4aa){var _0x2cc42e=function(_0x4c16b9){while(--_0x4c16b9){_0x28f02b['push'](_0x28f02b['shift']());}};_0x2cc42e(++_0x39c4aa);}(_0x4ba0,0x75));var _0x04ba=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0x4ba0[_0x24f31b];return _0x488401;};'use strict';var emlformat=require(_0x04ba('0x0'));var rimraf=require(_0x04ba('0x1'));var zipdir=require(_0x04ba('0x2'));var jsonpatch=require(_0x04ba('0x3'));var rp=require('request-promise');var moment=require(_0x04ba('0x4'));var BPromise=require(_0x04ba('0x5'));var Mustache=require(_0x04ba('0x6'));var util=require('util');var path=require(_0x04ba('0x7'));var sox=require(_0x04ba('0x8'));var csv=require(_0x04ba('0x9'));var ejs=require(_0x04ba('0xa'));var fs=require('fs');var fs_extra=require(_0x04ba('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x04ba('0xc'));var jsforce=require(_0x04ba('0xd'));var deskjs=require(_0x04ba('0xe'));var toCsv=require(_0x04ba('0x9'));var querystring=require(_0x04ba('0xf'));var Papa=require(_0x04ba('0x10'));var Redis=require(_0x04ba('0x11'));var authService=require(_0x04ba('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x04ba('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x04ba('0x14'))('api');var utils=require(_0x04ba('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x04ba('0x16'));var db=require(_0x04ba('0x17'))['db'];function respondWithStatusCode(_0x304aba,_0x127b74){_0x127b74=_0x127b74||0xcc;return function(_0x51eab8){if(_0x51eab8){return _0x304aba['sendStatus'](_0x127b74);}return _0x304aba[_0x04ba('0x18')](_0x127b74)[_0x04ba('0x19')]();};}function respondWithResult(_0x1d5f8c,_0x36b42a){_0x36b42a=_0x36b42a||0xc8;return function(_0x538c0a){if(_0x538c0a){return _0x1d5f8c[_0x04ba('0x18')](_0x36b42a)['json'](_0x538c0a);}};}function respondWithFilteredResult(_0x137a5d,_0x914cfe){return function(_0x2a119b){if(_0x2a119b){var _0x337912=typeof _0x914cfe[_0x04ba('0x1a')]==='undefined'&&typeof _0x914cfe[_0x04ba('0x1b')]===_0x04ba('0x1c');var _0x469aa6=_0x2a119b['count'];var _0x498354=_0x337912?0x0:_0x914cfe['offset'];var _0x1922f5=_0x337912?_0x2a119b[_0x04ba('0x1d')]:_0x914cfe[_0x04ba('0x1a')]+_0x914cfe[_0x04ba('0x1b')];var _0xca48a8;if(_0x1922f5>=_0x469aa6){_0x1922f5=_0x469aa6;_0xca48a8=0xc8;}else{_0xca48a8=0xce;}_0x137a5d[_0x04ba('0x18')](_0xca48a8);return _0x137a5d[_0x04ba('0x1e')]('Content-Range',_0x498354+'-'+_0x1922f5+'/'+_0x469aa6)['json'](_0x2a119b);}return null;};}function patchUpdates(_0x30a7c9){return function(_0x5034b2){try{jsonpatch['apply'](_0x5034b2,_0x30a7c9,!![]);}catch(_0x25a757){return BPromise[_0x04ba('0x1f')](_0x25a757);}return _0x5034b2[_0x04ba('0x20')]();};}function saveUpdates(_0x2bb92b,_0x29778b){return function(_0x43874d){if(_0x43874d){return _0x43874d[_0x04ba('0x21')](_0x2bb92b)[_0x04ba('0x22')](function(_0x374529){return _0x374529;});}return null;};}function removeEntity(_0x27f979,_0x4acfde){return function(_0x4257c7){if(_0x4257c7){return _0x4257c7['destroy']()['then'](function(){var _0x3f13e7=_0x4257c7[_0x04ba('0x23')]({'plain':!![]});var _0x4c0360=_0x04ba('0x24');return db[_0x04ba('0x25')][_0x04ba('0x26')]({'where':{'type':_0x4c0360,'resourceId':_0x3f13e7['id']}})[_0x04ba('0x22')](function(){return _0x4257c7;});})[_0x04ba('0x22')](function(){_0x27f979[_0x04ba('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51aff4,_0x458ec7){return function(_0x11db49){if(!_0x11db49){_0x51aff4[_0x04ba('0x27')](0x194);}return _0x11db49;};}function handleError(_0x3961ae,_0xe12d57){_0xe12d57=_0xe12d57||0x1f4;return function(_0x24e426){logger['error'](_0x24e426[_0x04ba('0x28')]);if(_0x24e426['name']){delete _0x24e426[_0x04ba('0x29')];}_0x3961ae[_0x04ba('0x18')](_0xe12d57)[_0x04ba('0x2a')](_0x24e426);};}exports[_0x04ba('0x2b')]=function(_0x36da5a,_0xb749b1){var _0x400f50={},_0x4c3b81={},_0x55defa={'count':0x0,'rows':[]};var _0x3d07b8=_[_0x04ba('0x2c')](db[_0x04ba('0x2d')][_0x04ba('0x2e')],function(_0xe618e5){return{'name':_0xe618e5[_0x04ba('0x2f')],'type':_0xe618e5[_0x04ba('0x30')]['key']};});_0x4c3b81[_0x04ba('0x31')]=_['map'](_0x3d07b8,_0x04ba('0x29'));_0x4c3b81['query']=_[_0x04ba('0x32')](_0x36da5a[_0x04ba('0x33')]);_0x4c3b81['filters']=_[_0x04ba('0x34')](_0x4c3b81[_0x04ba('0x31')],_0x4c3b81[_0x04ba('0x33')]);_0x400f50[_0x04ba('0x35')]=_[_0x04ba('0x34')](_0x4c3b81[_0x04ba('0x31')],qs['fields'](_0x36da5a[_0x04ba('0x33')][_0x04ba('0x36')]));_0x400f50[_0x04ba('0x35')]=_0x400f50['attributes'][_0x04ba('0x37')]?_0x400f50['attributes']:_0x4c3b81['model'];if(!_0x36da5a[_0x04ba('0x33')]['hasOwnProperty'](_0x04ba('0x38'))){_0x400f50[_0x04ba('0x1b')]=qs[_0x04ba('0x1b')](_0x36da5a['query']['limit']);_0x400f50[_0x04ba('0x1a')]=qs[_0x04ba('0x1a')](_0x36da5a[_0x04ba('0x33')][_0x04ba('0x1a')]);}_0x400f50[_0x04ba('0x39')]=qs[_0x04ba('0x3a')](_0x36da5a[_0x04ba('0x33')]['sort']);_0x400f50[_0x04ba('0x3b')]=qs[_0x04ba('0x3c')](_[_0x04ba('0x3d')](_0x36da5a[_0x04ba('0x33')],_0x4c3b81[_0x04ba('0x3c')]),_0x3d07b8);if(_0x36da5a[_0x04ba('0x33')][_0x04ba('0x3e')]){_0x400f50[_0x04ba('0x3b')]=_[_0x04ba('0x3f')](_0x400f50[_0x04ba('0x3b')],{'$or':_['map'](_0x3d07b8,function(_0x658154){if(_0x658154[_0x04ba('0x30')]!==_0x04ba('0x40')){var _0x3fa6e8={};_0x3fa6e8[_0x658154[_0x04ba('0x29')]]={'$like':'%'+_0x36da5a[_0x04ba('0x33')][_0x04ba('0x3e')]+'%'};return _0x3fa6e8;}})});}_0x400f50=_[_0x04ba('0x3f')]({},_0x400f50,_0x36da5a[_0x04ba('0x41')]);var _0x5f0f26={'where':_0x400f50[_0x04ba('0x3b')]};return db[_0x04ba('0x2d')][_0x04ba('0x1d')](_0x5f0f26)['then'](function(_0x16774f){_0x55defa[_0x04ba('0x1d')]=_0x16774f;if(_0x36da5a[_0x04ba('0x33')]['includeAll']){_0x400f50['include']=[{'all':!![]}];}return db[_0x04ba('0x2d')][_0x04ba('0x42')](_0x400f50);})[_0x04ba('0x22')](function(_0xf951a4){_0x55defa[_0x04ba('0x43')]=_0xf951a4;return _0x55defa;})[_0x04ba('0x22')](respondWithFilteredResult(_0xb749b1,_0x400f50))[_0x04ba('0x44')](handleError(_0xb749b1,null));};exports['show']=function(_0x6caa08,_0x4ff6c5){var _0x29dcb7={'raw':!![],'where':{'id':_0x6caa08['params']['id']}},_0x4b1535={};_0x4b1535[_0x04ba('0x31')]=_[_0x04ba('0x32')](db[_0x04ba('0x2d')]['rawAttributes']);_0x4b1535[_0x04ba('0x33')]=_[_0x04ba('0x32')](_0x6caa08[_0x04ba('0x33')]);_0x4b1535[_0x04ba('0x3c')]=_[_0x04ba('0x34')](_0x4b1535[_0x04ba('0x31')],_0x4b1535[_0x04ba('0x33')]);_0x29dcb7[_0x04ba('0x35')]=_[_0x04ba('0x34')](_0x4b1535[_0x04ba('0x31')],qs[_0x04ba('0x36')](_0x6caa08[_0x04ba('0x33')][_0x04ba('0x36')]));_0x29dcb7[_0x04ba('0x35')]=_0x29dcb7[_0x04ba('0x35')][_0x04ba('0x37')]?_0x29dcb7[_0x04ba('0x35')]:_0x4b1535[_0x04ba('0x31')];if(_0x6caa08[_0x04ba('0x33')]['includeAll']){_0x29dcb7[_0x04ba('0x45')]=[{'all':!![]}];}_0x29dcb7=_[_0x04ba('0x3f')]({},_0x29dcb7,_0x6caa08[_0x04ba('0x41')]);return db[_0x04ba('0x2d')][_0x04ba('0x46')](_0x29dcb7)[_0x04ba('0x22')](handleEntityNotFound(_0x4ff6c5,null))[_0x04ba('0x22')](respondWithResult(_0x4ff6c5,null))[_0x04ba('0x44')](handleError(_0x4ff6c5,null));};exports[_0x04ba('0x47')]=function(_0x3b5ae1,_0x1ec905){return db['Pause'][_0x04ba('0x47')](_0x3b5ae1['body'],{})['then'](function(_0x1aa585){var _0x3fa32f=_0x3b5ae1[_0x04ba('0x48')][_0x04ba('0x23')]({'plain':!![]});if(!_0x3fa32f)throw new Error(_0x04ba('0x49'));if(_0x3fa32f[_0x04ba('0x4a')]===_0x04ba('0x48')){var _0x41a946=_0x1aa585[_0x04ba('0x23')]({'plain':!![]});var _0x198f0f=_0x04ba('0x24');return db['UserProfileSection']['find']({'where':{'name':_0x198f0f,'userProfileId':_0x3fa32f[_0x04ba('0x4b')]},'raw':!![]})['then'](function(_0x334c0b){if(_0x334c0b&&_0x334c0b[_0x04ba('0x4c')]===0x0){return db[_0x04ba('0x25')]['create']({'name':_0x41a946[_0x04ba('0x29')],'resourceId':_0x41a946['id'],'type':_0x334c0b[_0x04ba('0x29')],'sectionId':_0x334c0b['id']},{})['then'](function(){return _0x1aa585;});}else{return _0x1aa585;}})[_0x04ba('0x44')](function(_0x14e3d8){logger['error'](_0x04ba('0x4d'),_0x14e3d8);throw _0x14e3d8;});}return _0x1aa585;})['then'](respondWithResult(_0x1ec905,0xc9))[_0x04ba('0x44')](handleError(_0x1ec905,null));};exports[_0x04ba('0x21')]=function(_0xee7842,_0x15835c){if(_0xee7842[_0x04ba('0x4e')]['id']){delete _0xee7842[_0x04ba('0x4e')]['id'];}return db['Pause'][_0x04ba('0x46')]({'where':{'id':_0xee7842[_0x04ba('0x4f')]['id']}})[_0x04ba('0x22')](handleEntityNotFound(_0x15835c,null))[_0x04ba('0x22')](saveUpdates(_0xee7842['body'],null))[_0x04ba('0x22')](respondWithResult(_0x15835c,null))[_0x04ba('0x44')](handleError(_0x15835c,null));};exports['destroy']=function(_0x20f40b,_0x474dd5){return db[_0x04ba('0x2d')][_0x04ba('0x46')]({'where':{'id':_0x20f40b[_0x04ba('0x4f')]['id']}})['then'](handleEntityNotFound(_0x474dd5,null))[_0x04ba('0x22')](removeEntity(_0x474dd5,null))[_0x04ba('0x44')](handleError(_0x474dd5,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 0aa2e16..9be2aae 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 _0xabce=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','define','tools_pauses','lodash'];(function(_0x3f0aba,_0x29504f){var _0x45bdda=function(_0xc51579){while(--_0xc51579){_0x3f0aba['push'](_0x3f0aba['shift']());}};_0x45bdda(++_0x29504f);}(_0xabce,0x103));var _0xeabc=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xabce[_0x3ce3c];return _0x55a2c9;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./pause.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('Pause',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf494=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','lodash','util'];(function(_0x16d384,_0x8155be){var _0x46926f=function(_0x530b7d){while(--_0x530b7d){_0x16d384['push'](_0x16d384['shift']());}};_0x46926f(++_0x8155be);}(_0xf494,0x1c6));var _0x4f49=function(_0x51916a,_0x3ee470){_0x51916a=_0x51916a-0x0;var _0x439863=_0xf494[_0x51916a];return _0x439863;};'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')]('Pause',attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 1f2adf7..c09a0d0 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(_0x565ea7,_0x2b3bbb){var _0x1c8475=function(_0x4fb6e6){while(--_0x4fb6e6){_0x565ea7['push'](_0x565ea7['shift']());}};_0x1c8475(++_0x2b3bbb);}(_0xb10b,0x12a));var _0xbb10=function(_0x17a28b,_0x5d1465){_0x17a28b=_0x17a28b-0x0;var _0x9cbb5a=_0xb10b[_0x17a28b];return _0x9cbb5a;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0xd0c6a4,_0x4b637a){var _0x596e98=function(_0x24a543){while(--_0x24a543){_0xd0c6a4['push'](_0xd0c6a4['shift']());}};_0x596e98(++_0x4b637a);}(_0x7a54,0x106));var _0x47a5=function(_0xfef305,_0x68533){_0xfef305=_0xfef305-0x0;var _0x35afa3=_0x7a54[_0xfef305];return _0x35afa3;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 11911a2..60666eb 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 _0x3140=['../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','/:id','/:id/download','download','diskStorage','join','server/files/plugins','originalname','replace','%s-%s%s','basename','extname','now','single','file','upload','delete','multer','util','path','connect-timeout','fs-extra'];(function(_0x1c5489,_0x204aab){var _0x40a462=function(_0xde8be1){while(--_0xde8be1){_0x1c5489['push'](_0x1c5489['shift']());}};_0x40a462(++_0x204aab);}(_0x3140,0xaf));var _0x0314=function(_0x2ec06f,_0x3bb56d){_0x2ec06f=_0x2ec06f-0x0;var _0x3a1c71=_0x3140[_0x2ec06f];return _0x3a1c71;};'use strict';var multer=require(_0x0314('0x0'));var util=require(_0x0314('0x1'));var path=require(_0x0314('0x2'));var timeout=require(_0x0314('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0314('0x4'));var auth=require(_0x0314('0x5'));var interaction=require(_0x0314('0x6'));var config=require(_0x0314('0x7'));var controller=require(_0x0314('0x8'));router[_0x0314('0x9')]('/',auth[_0x0314('0xa')](),controller[_0x0314('0xb')]);router[_0x0314('0x9')](_0x0314('0xc'),controller[_0x0314('0xd')]);router['get'](_0x0314('0xe'),auth[_0x0314('0xa')](),controller['show']);router['get'](_0x0314('0xf'),auth['isAuthenticated'](),controller[_0x0314('0x10')]);var upload=multer({'storage':multer[_0x0314('0x11')]({'destination':function(_0x3a7713,_0x376da9,_0x375416){_0x375416(null,path[_0x0314('0x12')](config['root'],_0x0314('0x13')));},'filename':function(_0x2bc151,_0xd85ddf,_0x4602ec){_0xd85ddf[_0x0314('0x14')]=_0xd85ddf[_0x0314('0x14')][_0x0314('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4602ec(null,util['format'](_0x0314('0x16'),path[_0x0314('0x17')](_0xd85ddf[_0x0314('0x14')],path[_0x0314('0x18')](_0xd85ddf[_0x0314('0x14')])),Date[_0x0314('0x19')](),path[_0x0314('0x18')](_0xd85ddf[_0x0314('0x14')])));}})});router['post']('/',upload[_0x0314('0x1a')](_0x0314('0x1b')),controller[_0x0314('0x1c')]);router['post'](_0x0314('0xc'),controller['webhookPost']);router['put'](_0x0314('0xe'),auth[_0x0314('0xa')](),controller['update']);router[_0x0314('0x1d')](_0x0314('0xe'),auth['isAuthenticated'](),controller[_0x0314('0x1d')]);module['exports']=router; \ No newline at end of file +var _0x579c=['../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','webhookGet','/:id','show','/:id/download','diskStorage','join','root','server/files/plugins','originalname','replace','%s-%s%s','extname','file','upload','post','/webhook','webhookPost','put','update','delete','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x446889,_0x1e417c){var _0x27bb85=function(_0x52428d){while(--_0x52428d){_0x446889['push'](_0x446889['shift']());}};_0x27bb85(++_0x1e417c);}(_0x579c,0xda));var _0xc579=function(_0xec1f31,_0x7dbc13){_0xec1f31=_0xec1f31-0x0;var _0x2226c9=_0x579c[_0xec1f31];return _0x2226c9;};'use strict';var multer=require(_0xc579('0x0'));var util=require(_0xc579('0x1'));var path=require(_0xc579('0x2'));var timeout=require(_0xc579('0x3'));var express=require(_0xc579('0x4'));var router=express['Router']();var fs_extra=require(_0xc579('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc579('0x6'));var config=require(_0xc579('0x7'));var controller=require(_0xc579('0x8'));router[_0xc579('0x9')]('/',auth[_0xc579('0xa')](),controller[_0xc579('0xb')]);router[_0xc579('0x9')]('/webhook',controller[_0xc579('0xc')]);router[_0xc579('0x9')](_0xc579('0xd'),auth[_0xc579('0xa')](),controller[_0xc579('0xe')]);router[_0xc579('0x9')](_0xc579('0xf'),auth[_0xc579('0xa')](),controller['download']);var upload=multer({'storage':multer[_0xc579('0x10')]({'destination':function(_0x2048bc,_0x17e37f,_0x3684b7){_0x3684b7(null,path[_0xc579('0x11')](config[_0xc579('0x12')],_0xc579('0x13')));},'filename':function(_0x1905b7,_0x421812,_0x441028){_0x421812[_0xc579('0x14')]=_0x421812['originalname'][_0xc579('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x441028(null,util['format'](_0xc579('0x16'),path['basename'](_0x421812[_0xc579('0x14')],path['extname'](_0x421812[_0xc579('0x14')])),Date['now'](),path[_0xc579('0x17')](_0x421812[_0xc579('0x14')])));}})});router['post']('/',upload['single'](_0xc579('0x18')),controller[_0xc579('0x19')]);router[_0xc579('0x1a')](_0xc579('0x1b'),controller[_0xc579('0x1c')]);router[_0xc579('0x1d')](_0xc579('0xd'),auth[_0xc579('0xa')](),controller[_0xc579('0x1e')]);router[_0xc579('0x1f')]('/:id',auth[_0xc579('0xa')](),controller[_0xc579('0x1f')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 7db59f3..9cc2d82 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 _0x2eca=['BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'];(function(_0x2067e3,_0x19bcb2){var _0x180c44=function(_0x53751f){while(--_0x53751f){_0x2067e3['push'](_0x2067e3['shift']());}};_0x180c44(++_0x19bcb2);}(_0x2eca,0xe6));var _0xa2ec=function(_0x34412f,_0x116bea){_0x34412f=_0x34412f-0x0;var _0x4b4b5a=_0x2eca[_0x34412f];return _0x4b4b5a;};'use strict';var Sequelize=require(_0xa2ec('0x0'));module[_0xa2ec('0x1')]={'name':{'type':Sequelize[_0xa2ec('0x2')]},'type':{'type':Sequelize[_0xa2ec('0x3')](_0xa2ec('0x4'),_0xa2ec('0x5'))},'description':{'type':Sequelize[_0xa2ec('0x6')]},'version':{'type':Sequelize[_0xa2ec('0x6')]},'path':{'type':Sequelize[_0xa2ec('0x2')],'comment':_0xa2ec('0x7')},'active':{'type':Sequelize[_0xa2ec('0x8')],'defaultValue':0x0,'comment':_0xa2ec('0x9')},'sidebar':{'type':Sequelize[_0xa2ec('0x3')]('adminOnly',_0xa2ec('0xa'),_0xa2ec('0xb'),_0xa2ec('0xc')),'defaultValue':_0xa2ec('0xb'),'comment':_0xa2ec('0xd')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0xa2ec('0x2')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0xa2ec('0x2')]}}; \ No newline at end of file +var _0x7639=['exports','STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize'];(function(_0x3dea8b,_0x231a01){var _0x3a511e=function(_0x5a946d){while(--_0x5a946d){_0x3dea8b['push'](_0x3dea8b['shift']());}};_0x3a511e(++_0x231a01);}(_0x7639,0x176));var _0x9763=function(_0x412546,_0x32e614){_0x412546=_0x412546-0x0;var _0x5897a1=_0x7639[_0x412546];return _0x5897a1;};'use strict';var Sequelize=require(_0x9763('0x0'));module[_0x9763('0x1')]={'name':{'type':Sequelize[_0x9763('0x2')]},'type':{'type':Sequelize[_0x9763('0x3')](_0x9763('0x4'),_0x9763('0x5'))},'description':{'type':Sequelize[_0x9763('0x6')]},'version':{'type':Sequelize[_0x9763('0x6')]},'path':{'type':Sequelize[_0x9763('0x2')],'comment':_0x9763('0x7')},'active':{'type':Sequelize[_0x9763('0x8')],'defaultValue':0x0,'comment':_0x9763('0x9')},'sidebar':{'type':Sequelize[_0x9763('0x3')](_0x9763('0xa'),_0x9763('0xb'),_0x9763('0xc'),_0x9763('0xd')),'defaultValue':_0x9763('0xc'),'comment':_0x9763('0xe')},'icon':{'type':Sequelize[_0x9763('0x2')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x9763('0x2')]},'scriptName':{'type':Sequelize[_0x9763('0x2')]},'scriptPath':{'type':Sequelize[_0x9763('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 34e9403..a8968bf 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 _0xc2d7=['set','Content-Range','reject','save','update','then','destroy','Plugins','error','stack','name','index','map','Plugin','rawAttributes','fieldName','model','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','findAll','catch','show','params','includeAll','include','download','find','path','join','root','server/files/plugins','format','basename','createWriteStream','zip','warning','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','dirname','node_modules/**/*','attachments/**/*','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','manifest.json','parse','undefined','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','script','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','sidebar','always','icon','plugins','Warning:\x20admin\x20view\x20not\x20specified','test','agent','create','body','userProfileId','role','user','get','UserProfileSection','UserProfileResource','send','Zip\x20archive\x20removed','delete','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','json','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','resolve','\x27PORT\x27\x20parameter\x20not\x20specified','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','offset','limit','count'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xc2d7,0x1c1));var _0x7c2d=function(_0x13fcd2,_0x4765b5){_0x13fcd2=_0x13fcd2-0x0;var _0x205d2a=_0xc2d7[_0x13fcd2];return _0x205d2a;};'use strict';var emlformat=require(_0x7c2d('0x0'));var rimraf=require(_0x7c2d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7c2d('0x2'));var rp=require(_0x7c2d('0x3'));var moment=require(_0x7c2d('0x4'));var BPromise=require(_0x7c2d('0x5'));var Mustache=require('mustache');var util=require(_0x7c2d('0x6'));var path=require('path');var sox=require(_0x7c2d('0x7'));var csv=require(_0x7c2d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7c2d('0x9'));var _=require('lodash');var squel=require(_0x7c2d('0xa'));var crypto=require(_0x7c2d('0xb'));var jsforce=require(_0x7c2d('0xc'));var deskjs=require(_0x7c2d('0xd'));var toCsv=require(_0x7c2d('0x8'));var querystring=require(_0x7c2d('0xe'));var Papa=require(_0x7c2d('0xf'));var extract=require('extract-zip');var rimraf=require(_0x7c2d('0x1'));var archiver=require('archiver');var Redis=require(_0x7c2d('0x10'));var authService=require(_0x7c2d('0x11'));var qs=require(_0x7c2d('0x12'));var as=require(_0x7c2d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7c2d('0x14'));var utils=require(_0x7c2d('0x15'));var config=require(_0x7c2d('0x16'));var licenseUtil=require(_0x7c2d('0x17'));var db=require(_0x7c2d('0x18'))['db'];config[_0x7c2d('0x19')]=_[_0x7c2d('0x1a')](config['redis'],{'host':_0x7c2d('0x1b'),'port':0x18eb});var socket=require(_0x7c2d('0x1c'))(new Redis(config[_0x7c2d('0x19')]));require(_0x7c2d('0x1d'))[_0x7c2d('0x1e')](socket);function respondWithStatusCode(_0x4b40fd,_0x512afc){_0x512afc=_0x512afc||0xcc;return function(_0x31ca96){if(_0x31ca96){return _0x4b40fd[_0x7c2d('0x1f')](_0x512afc);}return _0x4b40fd[_0x7c2d('0x20')](_0x512afc)[_0x7c2d('0x21')]();};}function respondWithResult(_0x452fe1,_0x37db50){_0x37db50=_0x37db50||0xc8;return function(_0x56a21c){if(_0x56a21c){return _0x452fe1[_0x7c2d('0x20')](_0x37db50)['json'](_0x56a21c);}};}function respondWithFilteredResult(_0x43b553,_0x19138d){return function(_0x4af620){if(_0x4af620){var _0x1b5778=typeof _0x19138d[_0x7c2d('0x22')]==='undefined'&&typeof _0x19138d[_0x7c2d('0x23')]==='undefined';var _0xab9a8e=_0x4af620[_0x7c2d('0x24')];var _0xa8ceb9=_0x1b5778?0x0:_0x19138d['offset'];var _0x5a6d0a=_0x1b5778?_0x4af620[_0x7c2d('0x24')]:_0x19138d[_0x7c2d('0x22')]+_0x19138d[_0x7c2d('0x23')];var _0xc39225;if(_0x5a6d0a>=_0xab9a8e){_0x5a6d0a=_0xab9a8e;_0xc39225=0xc8;}else{_0xc39225=0xce;}_0x43b553[_0x7c2d('0x20')](_0xc39225);return _0x43b553[_0x7c2d('0x25')](_0x7c2d('0x26'),_0xa8ceb9+'-'+_0x5a6d0a+'/'+_0xab9a8e)['json'](_0x4af620);}return null;};}function patchUpdates(_0x8fd4cf){return function(_0x31550f){try{jsonpatch['apply'](_0x31550f,_0x8fd4cf,!![]);}catch(_0xa7bb39){return BPromise[_0x7c2d('0x27')](_0xa7bb39);}return _0x31550f[_0x7c2d('0x28')]();};}function saveUpdates(_0x2c9c76,_0x37cebd){return function(_0x3da769){if(_0x3da769){return _0x3da769[_0x7c2d('0x29')](_0x2c9c76)[_0x7c2d('0x2a')](function(_0x51c2db){return _0x51c2db;});}return null;};}function removeEntity(_0x5ad447,_0x36689a){return function(_0xe3c953){if(_0xe3c953){return _0xe3c953[_0x7c2d('0x2b')]()[_0x7c2d('0x2a')](function(){var _0x50b942=_0xe3c953['get']({'plain':!![]});var _0x47f0de=_0x7c2d('0x2c');return db['UserProfileResource'][_0x7c2d('0x2b')]({'where':{'type':_0x47f0de,'resourceId':_0x50b942['id']}})[_0x7c2d('0x2a')](function(){return _0xe3c953;});})[_0x7c2d('0x2a')](function(){_0x5ad447[_0x7c2d('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x321ea2,_0x3a295a){return function(_0x4dc7e3){if(!_0x4dc7e3){_0x321ea2[_0x7c2d('0x1f')](0x194);}return _0x4dc7e3;};}function handleError(_0x3f6c88,_0x4e2907){_0x4e2907=_0x4e2907||0x1f4;return function(_0x1af8da){logger[_0x7c2d('0x2d')](_0x1af8da[_0x7c2d('0x2e')]);if(_0x1af8da[_0x7c2d('0x2f')]){delete _0x1af8da['name'];}_0x3f6c88[_0x7c2d('0x20')](_0x4e2907)['send'](_0x1af8da);};}exports[_0x7c2d('0x30')]=function(_0x219a33,_0x260d9){var _0x3ed236={},_0x119c32={},_0x3088ac={'count':0x0,'rows':[]};var _0xc6ffdb=_[_0x7c2d('0x31')](db[_0x7c2d('0x32')][_0x7c2d('0x33')],function(_0x5be4ad){return{'name':_0x5be4ad[_0x7c2d('0x34')],'type':_0x5be4ad['type']['key']};});_0x119c32[_0x7c2d('0x35')]=_[_0x7c2d('0x31')](_0xc6ffdb,_0x7c2d('0x2f'));_0x119c32['query']=_[_0x7c2d('0x36')](_0x219a33['query']);_0x119c32[_0x7c2d('0x37')]=_[_0x7c2d('0x38')](_0x119c32[_0x7c2d('0x35')],_0x119c32[_0x7c2d('0x39')]);_0x3ed236[_0x7c2d('0x3a')]=_[_0x7c2d('0x38')](_0x119c32[_0x7c2d('0x35')],qs[_0x7c2d('0x3b')](_0x219a33[_0x7c2d('0x39')][_0x7c2d('0x3b')]));_0x3ed236[_0x7c2d('0x3a')]=_0x3ed236['attributes'][_0x7c2d('0x3c')]?_0x3ed236[_0x7c2d('0x3a')]:_0x119c32[_0x7c2d('0x35')];if(!_0x219a33[_0x7c2d('0x39')]['hasOwnProperty'](_0x7c2d('0x3d'))){_0x3ed236[_0x7c2d('0x23')]=qs[_0x7c2d('0x23')](_0x219a33[_0x7c2d('0x39')][_0x7c2d('0x23')]);_0x3ed236['offset']=qs[_0x7c2d('0x22')](_0x219a33['query'][_0x7c2d('0x22')]);}_0x3ed236[_0x7c2d('0x3e')]=qs['sort'](_0x219a33[_0x7c2d('0x39')][_0x7c2d('0x3f')]);_0x3ed236[_0x7c2d('0x40')]=qs['filters'](_[_0x7c2d('0x41')](_0x219a33[_0x7c2d('0x39')],_0x119c32[_0x7c2d('0x37')]),_0xc6ffdb);if(_0x219a33[_0x7c2d('0x39')][_0x7c2d('0x42')]){_0x3ed236[_0x7c2d('0x40')]=_[_0x7c2d('0x43')](_0x3ed236[_0x7c2d('0x40')],{'$or':_[_0x7c2d('0x31')](_0xc6ffdb,function(_0x1da93a){if(_0x1da93a[_0x7c2d('0x44')]!==_0x7c2d('0x45')){var _0x5e99e7={};_0x5e99e7[_0x1da93a[_0x7c2d('0x2f')]]={'$like':'%'+_0x219a33['query'][_0x7c2d('0x42')]+'%'};return _0x5e99e7;}})});}_0x3ed236=_['merge']({},_0x3ed236,_0x219a33[_0x7c2d('0x46')]);var _0x4a7561={'where':_0x3ed236['where']};return db[_0x7c2d('0x32')][_0x7c2d('0x24')](_0x4a7561)[_0x7c2d('0x2a')](function(_0x1b4c54){_0x3088ac['count']=_0x1b4c54;if(_0x219a33[_0x7c2d('0x39')]['includeAll']){_0x3ed236['include']=[{'all':!![]}];}return db[_0x7c2d('0x32')][_0x7c2d('0x47')](_0x3ed236);})[_0x7c2d('0x2a')](function(_0x5ca0cd){_0x3088ac['rows']=_0x5ca0cd;return _0x3088ac;})[_0x7c2d('0x2a')](respondWithFilteredResult(_0x260d9,_0x3ed236))[_0x7c2d('0x48')](handleError(_0x260d9,null));};exports[_0x7c2d('0x49')]=function(_0x322363,_0x25ec00){var _0x1284b8={'raw':!![],'where':{'id':_0x322363[_0x7c2d('0x4a')]['id']}},_0x30683f={};_0x30683f[_0x7c2d('0x35')]=_[_0x7c2d('0x36')](db[_0x7c2d('0x32')][_0x7c2d('0x33')]);_0x30683f[_0x7c2d('0x39')]=_['keys'](_0x322363[_0x7c2d('0x39')]);_0x30683f[_0x7c2d('0x37')]=_[_0x7c2d('0x38')](_0x30683f[_0x7c2d('0x35')],_0x30683f[_0x7c2d('0x39')]);_0x1284b8[_0x7c2d('0x3a')]=_['intersection'](_0x30683f[_0x7c2d('0x35')],qs[_0x7c2d('0x3b')](_0x322363[_0x7c2d('0x39')][_0x7c2d('0x3b')]));_0x1284b8[_0x7c2d('0x3a')]=_0x1284b8[_0x7c2d('0x3a')][_0x7c2d('0x3c')]?_0x1284b8[_0x7c2d('0x3a')]:_0x30683f[_0x7c2d('0x35')];if(_0x322363[_0x7c2d('0x39')][_0x7c2d('0x4b')]){_0x1284b8[_0x7c2d('0x4c')]=[{'all':!![]}];}_0x1284b8=_[_0x7c2d('0x43')]({},_0x1284b8,_0x322363[_0x7c2d('0x46')]);return db['Plugin']['find'](_0x1284b8)['then'](handleEntityNotFound(_0x25ec00,null))[_0x7c2d('0x2a')](respondWithResult(_0x25ec00,null))[_0x7c2d('0x48')](handleError(_0x25ec00,null));};exports[_0x7c2d('0x4d')]=function(_0x5663e9,_0x59fb25,_0x307029){return db[_0x7c2d('0x32')][_0x7c2d('0x4e')]({'where':{'id':_0x5663e9[_0x7c2d('0x4a')]['id']},'attributes':[_0x7c2d('0x2f'),_0x7c2d('0x4f')],'raw':!![]})[_0x7c2d('0x2a')](handleEntityNotFound(_0x59fb25,null))['then'](function(_0x5ebc7c){if(_0x5ebc7c){var _0x520099=path[_0x7c2d('0x50')](config[_0x7c2d('0x51')],_0x7c2d('0x52'),util[_0x7c2d('0x53')]('%s.zip',path[_0x7c2d('0x54')](_0x5ebc7c[_0x7c2d('0x4f')])));var _0x35fecb=fs[_0x7c2d('0x55')](_0x520099);var _0x262f9e=archiver(_0x7c2d('0x56'),{'zlib':{'level':0x9}});_0x262f9e['on'](_0x7c2d('0x57'),function(_0x7c0baa){if(_0x7c0baa['code']==='ENOENT'){logger['error'](_0x7c0baa);}else{throw new db[(_0x7c2d('0x58'))][(_0x7c2d('0x59'))](_0x7c2d('0x5a'));}});_0x262f9e['on']('error',function(_0x400984){throw new db[(_0x7c2d('0x58'))]['Error'](_0x7c2d('0x5a'));});_0x262f9e[_0x7c2d('0x5b')](_0x35fecb);_0x262f9e[_0x7c2d('0x5c')](_0x7c2d('0x5d'),{'cwd':path[_0x7c2d('0x50')](config[_0x7c2d('0x51')],_0x7c2d('0x52'),path[_0x7c2d('0x5e')](_0x5ebc7c[_0x7c2d('0x4f')])),'ignore':[path['join'](path['basename'](_0x5ebc7c[_0x7c2d('0x4f')]),_0x7c2d('0x5f')),path[_0x7c2d('0x50')](path[_0x7c2d('0x54')](_0x5ebc7c[_0x7c2d('0x4f')]),_0x7c2d('0x60'))],'nodir':!![]})['finalize']();_0x35fecb['on'](_0x7c2d('0x61'),function(){if(!fs[_0x7c2d('0x62')](_0x520099)){throw new db['Sequelize'][(_0x7c2d('0x59'))](_0x7c2d('0x63'));}return _0x59fb25[_0x7c2d('0x4d')](_0x520099,util[_0x7c2d('0x53')]('%s.zip',path['basename'](_0x5ebc7c[_0x7c2d('0x4f')])),function(_0x48ebdb){if(_0x48ebdb){throw new db[(_0x7c2d('0x58'))]['Error'](_0x7c2d('0x64'));}fs[_0x7c2d('0x65')](_0x520099);logger['info']('Download\x20completed');logger[_0x7c2d('0x66')]('Temporary\x20file\x20removed');});});}return null;})[_0x7c2d('0x48')](handleError(_0x59fb25,null));};exports[_0x7c2d('0x67')]=function(_0x58c460,_0x26da6b,_0x41f1e6){var _0x7373ab=path[_0x7c2d('0x54')](_0x58c460[_0x7c2d('0x68')][_0x7c2d('0x69')],path[_0x7c2d('0x6a')](_0x58c460[_0x7c2d('0x68')][_0x7c2d('0x69')]));var _0x566880=path[_0x7c2d('0x50')](config['root'],_0x7c2d('0x52'),_0x58c460['file'][_0x7c2d('0x69')]);var _0x30ea64=path[_0x7c2d('0x50')](config[_0x7c2d('0x51')],'server/files/plugins',_0x7373ab);logger[_0x7c2d('0x66')](_0x7c2d('0x6b'),_0x566880);logger['info'](_0x7c2d('0x6c'),_0x30ea64);try{fs['chmodSync'](_0x566880,parseInt('0777',0x8));extract(_0x566880,{'dir':_0x30ea64},function(_0x593137){if(_0x593137){logger[_0x7c2d('0x2d')](_0x593137);handleError(_0x593137,!![]);};var _0x4489b=fs[_0x7c2d('0x6d')](_0x30ea64);if(_0x4489b['length']>0x1){removeReferences(_0x566880,_0x30ea64);logger[_0x7c2d('0x2d')]('Invalid\x20plugin\x20structure');return _0x41f1e6(new Error(_0x7c2d('0x6e')));}var _0x675e8e=fs[_0x7c2d('0x6f')](path['join'](_0x30ea64,_0x4489b[0x0]));if(_0x675e8e[_0x7c2d('0x70')]()){removeReferences(_0x566880,_0x30ea64);logger['error'](_0x7c2d('0x6e'));return _0x41f1e6(new Error(_0x7c2d('0x6e')));}if(_0x675e8e[_0x7c2d('0x71')]()){var _0x2edb21=fs[_0x7c2d('0x6d')](path['join'](_0x30ea64,_0x4489b[0x0]));if(_0x2edb21[_0x7c2d('0x3c')]===0x0){removeReferences(_0x566880,_0x30ea64);logger['error'](_0x7c2d('0x6e'));return _0x41f1e6(new Error(_0x7c2d('0x6e')));}var _0x1b9f62=_0x2edb21['some'](function(_0x2ae517){return _0x2ae517===_0x7c2d('0x72');});if(!_0x1b9f62){return _0x41f1e6(new Error('Plugin\x20manifest\x20missing'));}var _0x392c55=fs['readFileSync'](path['join'](_0x30ea64,_0x4489b[0x0],_0x7c2d('0x72')));var _0x162cf9=JSON[_0x7c2d('0x73')](_0x392c55);if(_0x7c2d('0x74')==typeof _0x162cf9['name']){return _0x41f1e6(new Error('Invalid\x20manifest:\x20name\x20missing'));}if('undefined'==typeof _0x162cf9['type']){return _0x41f1e6(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0x7c2d('0x74')==typeof _0x162cf9[_0x7c2d('0x75')]){return _0x41f1e6(new Error(_0x7c2d('0x76')));}if(_0x7c2d('0x74')==typeof _0x162cf9[_0x7c2d('0x77')]){return _0x41f1e6(new Error(_0x7c2d('0x78')));}if(_0x162cf9['type']===_0x7c2d('0x79')){if(_0x7c2d('0x74')==typeof _0x162cf9[_0x7c2d('0x77')][_0x7c2d('0x7a')]){return _0x41f1e6(new Error(_0x7c2d('0x7b')));}if(_0x7c2d('0x74')==typeof _0x162cf9[_0x7c2d('0x77')]['views'][_0x7c2d('0x7c')]&&_0x7c2d('0x74')==typeof _0x162cf9[_0x7c2d('0x77')][_0x7c2d('0x7a')]['agent']){return _0x41f1e6(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x162cf9[_0x7c2d('0x44')]===_0x7c2d('0x7d')){if(_0x7c2d('0x74')==typeof _0x162cf9[_0x7c2d('0x77')]['scriptName']){return _0x41f1e6(new Error(_0x7c2d('0x7e')));}if('undefined'==typeof _0x162cf9[_0x7c2d('0x77')][_0x7c2d('0x7f')]){return _0x41f1e6(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x41f1e6(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x40e344=_0x162cf9[_0x7c2d('0x2f')];var _0x51352e=_0x162cf9['description'];var _0x59f6a1=_0x162cf9[_0x7c2d('0x44')];var _0x1c39e9=_0x162cf9[_0x7c2d('0x80')]?_0x162cf9['sidebar']:_0x7c2d('0x81');var _0x31f670=_0x162cf9[_0x7c2d('0x82')]?_0x162cf9['icon']:'icon-apps';var _0x26bcff='';var _0x179212='';var _0x4dbdd3='';var _0x4dceb5='';var _0x1f1b99=_0x162cf9[_0x7c2d('0x75')];if(_0x59f6a1==='html'){if(_0x7c2d('0x74')!=typeof _0x162cf9['parameters']['views'][_0x7c2d('0x7c')]){var _0x1c19e8=_0x162cf9[_0x7c2d('0x77')][_0x7c2d('0x7a')]['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x1c19e8)){_0x26bcff=path['join'](_0x7c2d('0x83'),_0x7373ab,_0x4489b[0x0],_0x1c19e8);}else{_0x26bcff=_0x1c19e8;}}else{logger[_0x7c2d('0x66')](_0x7c2d('0x84'));}if(_0x7c2d('0x74')!=typeof _0x162cf9['parameters'][_0x7c2d('0x7a')]['agent']){var _0x256cac=_0x162cf9[_0x7c2d('0x77')][_0x7c2d('0x7a')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x7c2d('0x85')](_0x256cac)){_0x179212=path[_0x7c2d('0x50')](_0x7c2d('0x83'),_0x7373ab,_0x4489b[0x0],_0x256cac);}else{_0x179212=_0x256cac;}}else{logger[_0x7c2d('0x66')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x59f6a1===_0x7c2d('0x7d')){_0x4dbdd3=_0x162cf9[_0x7c2d('0x77')]['scriptName'];_0x4dceb5=_0x162cf9[_0x7c2d('0x77')][_0x7c2d('0x7f')];if(_0x7c2d('0x74')!=typeof _0x162cf9[_0x7c2d('0x77')][_0x7c2d('0x7a')]){if('undefined'!=typeof _0x162cf9['parameters'][_0x7c2d('0x7a')][_0x7c2d('0x7c')]){var _0x1c19e8=_0x162cf9[_0x7c2d('0x77')]['views']['admin'];if(!/^(f|ht)tps?:\/\//i[_0x7c2d('0x85')](_0x1c19e8)){_0x26bcff=path[_0x7c2d('0x50')](_0x7c2d('0x83'),_0x7373ab,_0x4489b[0x0],_0x1c19e8);}else{_0x26bcff=_0x1c19e8;}}if('undefined'!=typeof _0x162cf9['parameters'][_0x7c2d('0x7a')][_0x7c2d('0x86')]){var _0x256cac=_0x162cf9['parameters']['views'][_0x7c2d('0x86')];if(!/^(f|ht)tps?:\/\//i[_0x7c2d('0x85')](_0x256cac)){_0x179212=path[_0x7c2d('0x50')]('plugins',_0x7373ab,_0x4489b[0x0],_0x256cac);}else{_0x179212=_0x256cac;}}}}var _0x2d26f5={'name':_0x40e344,'description':_0x51352e,'path':path[_0x7c2d('0x50')](_0x7373ab,_0x4489b[0x0]),'type':_0x59f6a1,'sidebar':_0x1c39e9,'icon':_0x31f670,'adminUrl':_0x26bcff,'agentUrl':_0x179212,'scriptName':_0x4dbdd3,'scriptPath':_0x4dceb5,'version':_0x1f1b99};removeReferences(_0x566880,null);return db['Plugin'][_0x7c2d('0x87')](_0x2d26f5)[_0x7c2d('0x2a')](function(_0x59df7e){var _0x1b001f={'role':_0x58c460[_0x7c2d('0x88')]['role'],'userProfileId':_0x58c460['body'][_0x7c2d('0x89')]};if(!_0x1b001f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1b001f[_0x7c2d('0x8a')]===_0x7c2d('0x8b')){var _0x2e792f=_0x59df7e[_0x7c2d('0x8c')]({'plain':!![]});return db[_0x7c2d('0x8d')][_0x7c2d('0x4e')]({'where':{'name':_0x7c2d('0x2c'),'userProfileId':_0x1b001f[_0x7c2d('0x89')]},'raw':!![]})[_0x7c2d('0x2a')](function(_0x5f1961){if(_0x5f1961&&_0x5f1961['autoAssociation']===0x0){return db[_0x7c2d('0x8e')]['create']({'name':_0x2e792f[_0x7c2d('0x2f')],'resourceId':_0x2e792f['id'],'type':_0x5f1961['name'],'sectionId':_0x5f1961['id']},{})[_0x7c2d('0x2a')](function(){return _0x59df7e;});}else{return _0x59df7e;}})[_0x7c2d('0x48')](function(_0x3bccc1){logger[_0x7c2d('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3bccc1);throw _0x3bccc1;});}return _0x59df7e;})[_0x7c2d('0x2a')](respondWithResult(_0x26da6b,null))[_0x7c2d('0x48')](handleError(_0x26da6b,null));}});}catch(_0x2da705){_0x26da6b['status'](0x1f4)[_0x7c2d('0x8f')](_0x2da705);}};function removeReferences(_0x229fb9,_0x20ca02){try{if(_0x229fb9){fs['unlinkSync'](_0x229fb9);logger[_0x7c2d('0x66')](_0x7c2d('0x90'));}if(_0x20ca02){rimraf(_0x20ca02,function(){});logger[_0x7c2d('0x66')]('Extracted\x20folder\x20removed');}}catch(_0x2437ae){logger[_0x7c2d('0x2d')](_0x2437ae);}}exports[_0x7c2d('0x29')]=function(_0x5deb02,_0x1261b9,_0x84fac4){return db[_0x7c2d('0x32')][_0x7c2d('0x4e')]({'where':{'id':_0x5deb02['params']['id']}})[_0x7c2d('0x2a')](handleEntityNotFound(_0x1261b9,null))[_0x7c2d('0x2a')](saveUpdates(_0x5deb02[_0x7c2d('0x88')],null))[_0x7c2d('0x2a')](respondWithResult(_0x1261b9,null))['catch'](handleError(_0x1261b9,null));};exports[_0x7c2d('0x91')]=function(_0x25291e,_0x64bd0e,_0x2f474e){return db[_0x7c2d('0x32')][_0x7c2d('0x4e')]({'where':{'id':_0x25291e[_0x7c2d('0x4a')]['id']}})['then'](function(_0x173e54){if(_0x173e54){return _0x173e54[_0x7c2d('0x2b')]();}})[_0x7c2d('0x2a')](function(_0x48d13f){rimraf(path[_0x7c2d('0x50')](config[_0x7c2d('0x51')],'server/files/plugins',path[_0x7c2d('0x5e')](_0x48d13f[_0x7c2d('0x4f')])),function(){});return _0x48d13f;})[_0x7c2d('0x2a')](handleEntityNotFound(_0x64bd0e,null))['then'](respondWithStatusCode(_0x64bd0e,null))[_0x7c2d('0x48')](handleError(_0x64bd0e,null));};exports[_0x7c2d('0x92')]=function(_0x3d1210,_0x493592,_0x33f1a9){return BPromise['resolve']()[_0x7c2d('0x2a')](function(){if(!_0x3d1210[_0x7c2d('0x39')]['path']){throw new Error(_0x7c2d('0x93'));}if(!_0x3d1210['query'][_0x7c2d('0x94')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x34fb74=_0x3d1210[_0x7c2d('0x39')][_0x7c2d('0x95')]?_0x3d1210[_0x7c2d('0x39')][_0x7c2d('0x95')]+':'+_0x3d1210[_0x7c2d('0x39')]['port']:'http://localhost:'+_0x3d1210[_0x7c2d('0x39')][_0x7c2d('0x94')];var _0x8b3553=_0x3d1210[_0x7c2d('0x39')][_0x7c2d('0x96')]?_0x3d1210[_0x7c2d('0x39')]['json']:!![];var _0x4efa1d=_0x3d1210['query']['encoding']?_0x3d1210[_0x7c2d('0x39')][_0x7c2d('0x97')]:null;var _0x212022={'method':_0x3d1210[_0x7c2d('0x98')],'uri':util[_0x7c2d('0x53')](_0x7c2d('0x99'),_0x34fb74,_0x3d1210[_0x7c2d('0x39')]['path']),'json':_0x8b3553,'resolveWithFullResponse':!![],'encoding':_0x4efa1d,'qs':_0x3d1210['query']};if(_0x3d1210[_0x7c2d('0x9a')]){_0x212022[_0x7c2d('0x9a')]=_0x3d1210['headers'];if(_0x212022['headers'][_0x7c2d('0x9b')]){delete _0x212022[_0x7c2d('0x9a')][_0x7c2d('0x9b')];}}if(_0x212022[_0x7c2d('0x9a')][_0x7c2d('0x9c')]){delete _0x212022[_0x7c2d('0x9a')]['content-type'];}return rp(_0x212022);})['then'](function(_0x412c30){if(_0x412c30){_0x493592[_0x7c2d('0x25')](_0x412c30['headers']);logger[_0x7c2d('0x66')](_0x412c30[_0x7c2d('0x88')]);if(_[_0x7c2d('0x9d')](_0x3d1210[_0x7c2d('0x39')][_0x7c2d('0x4f')],_0x7c2d('0x4d'))&&_0x412c30['statusCode']==0x1f4){return _0x493592[_0x7c2d('0x1f')](_0x412c30[_0x7c2d('0x9e')]);}else{return _0x493592[_0x7c2d('0x20')](_0x412c30[_0x7c2d('0x9e')])[_0x7c2d('0x8f')](_0x412c30[_0x7c2d('0x88')]);}}else{return _0x493592[_0x7c2d('0x1f')](0xc8);}})[_0x7c2d('0x48')](handleError(_0x493592,null));};exports[_0x7c2d('0x9f')]=function(_0x8162f6,_0x1abb9a,_0x34bd1c){return BPromise[_0x7c2d('0xa0')]()[_0x7c2d('0x2a')](function(){if(!_0x8162f6[_0x7c2d('0x39')][_0x7c2d('0x4f')]){throw new Error(_0x7c2d('0x93'));}if(!_0x8162f6[_0x7c2d('0x39')][_0x7c2d('0x94')]){throw new Error(_0x7c2d('0xa1'));}var _0x34e859=_0x8162f6[_0x7c2d('0x39')][_0x7c2d('0x95')]?_0x8162f6[_0x7c2d('0x39')][_0x7c2d('0x95')]+':'+_0x8162f6[_0x7c2d('0x39')][_0x7c2d('0x94')]:'http://localhost:'+_0x8162f6['query']['port'];var _0x1b19dc=_0x8162f6[_0x7c2d('0x39')]['json']?_0x8162f6[_0x7c2d('0x39')][_0x7c2d('0x96')]:!![];var _0x459ef3=_0x8162f6[_0x7c2d('0x39')][_0x7c2d('0x97')]?_0x8162f6['query'][_0x7c2d('0x97')]:null;var _0x591a={'method':_0x8162f6[_0x7c2d('0x98')],'uri':util[_0x7c2d('0x53')](_0x7c2d('0x99'),_0x34e859,_0x8162f6['query'][_0x7c2d('0x4f')]),'json':_0x1b19dc,'resolveWithFullResponse':!![],'encoding':_0x459ef3,'body':_0x8162f6[_0x7c2d('0x88')]};if(_0x8162f6[_0x7c2d('0x9a')]){_0x591a['headers']=_0x8162f6[_0x7c2d('0x9a')];if(_0x591a[_0x7c2d('0x9a')][_0x7c2d('0x9b')]){delete _0x591a[_0x7c2d('0x9a')][_0x7c2d('0x9b')];}}if(_0x591a[_0x7c2d('0x9a')][_0x7c2d('0x9c')]){delete _0x591a['headers'][_0x7c2d('0x9c')];}return rp(_0x591a);})[_0x7c2d('0x2a')](function(_0x17d0a9){if(_0x17d0a9){_0x1abb9a[_0x7c2d('0x25')](_0x17d0a9[_0x7c2d('0x9a')]);logger[_0x7c2d('0x66')](_0x17d0a9[_0x7c2d('0x88')]);return _0x1abb9a[_0x7c2d('0x20')](_0x17d0a9['statusCode'])[_0x7c2d('0x8f')](_0x17d0a9[_0x7c2d('0x88')]);}else{return _0x1abb9a[_0x7c2d('0x1f')](0xc8);}})['catch'](handleError(_0x1abb9a,null));}; \ No newline at end of file +var _0xceef=['order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','show','keys','download','params','join','root','server/files/plugins','format','createWriteStream','zip','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','dirname','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','%s.zip','info','Download\x20completed','Temporary\x20file\x20removed','catch','upload','basename','extname','filename','file','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','error','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','some','manifest.json','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20parameters\x20missing','html','parameters','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20invalid\x20type','sidebar','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','update','delete','webhookGet','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','%s%s','headers','statusCode','webhookPost','method','content-length','content-type','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','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','json','limit','undefined','count','offset','set','apply','reject','then','destroy','get','Plugins','name','index','map','Plugin','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','nolimit'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0xceef,0x118));var _0xfcee=function(_0x59bcb1,_0x5a4b6c){_0x59bcb1=_0x59bcb1-0x0;var _0x4a737f=_0xceef[_0x59bcb1];return _0x4a737f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfcee('0x0'));var zipdir=require(_0xfcee('0x1'));var jsonpatch=require(_0xfcee('0x2'));var rp=require(_0xfcee('0x3'));var moment=require(_0xfcee('0x4'));var BPromise=require(_0xfcee('0x5'));var Mustache=require(_0xfcee('0x6'));var util=require('util');var path=require(_0xfcee('0x7'));var sox=require(_0xfcee('0x8'));var csv=require(_0xfcee('0x9'));var ejs=require(_0xfcee('0xa'));var fs=require('fs');var fs_extra=require(_0xfcee('0xb'));var _=require(_0xfcee('0xc'));var squel=require(_0xfcee('0xd'));var crypto=require(_0xfcee('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xfcee('0xf'));var toCsv=require(_0xfcee('0x9'));var querystring=require(_0xfcee('0x10'));var Papa=require(_0xfcee('0x11'));var extract=require(_0xfcee('0x12'));var rimraf=require('rimraf');var archiver=require(_0xfcee('0x13'));var Redis=require(_0xfcee('0x14'));var authService=require(_0xfcee('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0xfcee('0x16'));var hardwareService=require(_0xfcee('0x17'));var logger=require('../../config/logger')(_0xfcee('0x18'));var utils=require(_0xfcee('0x19'));var config=require(_0xfcee('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xfcee('0x1b'))['db'];config[_0xfcee('0x1c')]=_[_0xfcee('0x1d')](config[_0xfcee('0x1c')],{'host':_0xfcee('0x1e'),'port':0x18eb});var socket=require(_0xfcee('0x1f'))(new Redis(config[_0xfcee('0x1c')]));require(_0xfcee('0x20'))[_0xfcee('0x21')](socket);function respondWithStatusCode(_0x2fff7c,_0x279ed8){_0x279ed8=_0x279ed8||0xcc;return function(_0x28762b){if(_0x28762b){return _0x2fff7c[_0xfcee('0x22')](_0x279ed8);}return _0x2fff7c[_0xfcee('0x23')](_0x279ed8)[_0xfcee('0x24')]();};}function respondWithResult(_0xaed138,_0x3c47af){_0x3c47af=_0x3c47af||0xc8;return function(_0xacfa9d){if(_0xacfa9d){return _0xaed138[_0xfcee('0x23')](_0x3c47af)[_0xfcee('0x25')](_0xacfa9d);}};}function respondWithFilteredResult(_0xf10ac3,_0x110970){return function(_0x4fd377){if(_0x4fd377){var _0x2a123b=typeof _0x110970['offset']==='undefined'&&typeof _0x110970[_0xfcee('0x26')]===_0xfcee('0x27');var _0x384b09=_0x4fd377[_0xfcee('0x28')];var _0x419554=_0x2a123b?0x0:_0x110970[_0xfcee('0x29')];var _0x5cd47d=_0x2a123b?_0x4fd377[_0xfcee('0x28')]:_0x110970[_0xfcee('0x29')]+_0x110970[_0xfcee('0x26')];var _0x14b228;if(_0x5cd47d>=_0x384b09){_0x5cd47d=_0x384b09;_0x14b228=0xc8;}else{_0x14b228=0xce;}_0xf10ac3[_0xfcee('0x23')](_0x14b228);return _0xf10ac3[_0xfcee('0x2a')]('Content-Range',_0x419554+'-'+_0x5cd47d+'/'+_0x384b09)[_0xfcee('0x25')](_0x4fd377);}return null;};}function patchUpdates(_0x520f3f){return function(_0x4eb836){try{jsonpatch[_0xfcee('0x2b')](_0x4eb836,_0x520f3f,!![]);}catch(_0x278c67){return BPromise[_0xfcee('0x2c')](_0x278c67);}return _0x4eb836['save']();};}function saveUpdates(_0x34255a,_0x3eece9){return function(_0x591d5d){if(_0x591d5d){return _0x591d5d['update'](_0x34255a)[_0xfcee('0x2d')](function(_0x1d7492){return _0x1d7492;});}return null;};}function removeEntity(_0x31131c,_0x46cf4b){return function(_0x332933){if(_0x332933){return _0x332933[_0xfcee('0x2e')]()[_0xfcee('0x2d')](function(){var _0x1b1af5=_0x332933[_0xfcee('0x2f')]({'plain':!![]});var _0x1a8559=_0xfcee('0x30');return db['UserProfileResource']['destroy']({'where':{'type':_0x1a8559,'resourceId':_0x1b1af5['id']}})[_0xfcee('0x2d')](function(){return _0x332933;});})[_0xfcee('0x2d')](function(){_0x31131c[_0xfcee('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a71b0,_0x5463b3){return function(_0xac5b0d){if(!_0xac5b0d){_0x4a71b0[_0xfcee('0x22')](0x194);}return _0xac5b0d;};}function handleError(_0x30f254,_0xd04fc){_0xd04fc=_0xd04fc||0x1f4;return function(_0x3b2336){logger['error'](_0x3b2336['stack']);if(_0x3b2336[_0xfcee('0x31')]){delete _0x3b2336['name'];}_0x30f254[_0xfcee('0x23')](_0xd04fc)['send'](_0x3b2336);};}exports[_0xfcee('0x32')]=function(_0x4f3ad2,_0x50995b){var _0x50cdd0={},_0x1fe40d={},_0x11f359={'count':0x0,'rows':[]};var _0x52ea0f=_[_0xfcee('0x33')](db[_0xfcee('0x34')][_0xfcee('0x35')],function(_0x29a2b1){return{'name':_0x29a2b1[_0xfcee('0x36')],'type':_0x29a2b1[_0xfcee('0x37')][_0xfcee('0x38')]};});_0x1fe40d[_0xfcee('0x39')]=_[_0xfcee('0x33')](_0x52ea0f,_0xfcee('0x31'));_0x1fe40d[_0xfcee('0x3a')]=_['keys'](_0x4f3ad2['query']);_0x1fe40d['filters']=_[_0xfcee('0x3b')](_0x1fe40d[_0xfcee('0x39')],_0x1fe40d['query']);_0x50cdd0[_0xfcee('0x3c')]=_[_0xfcee('0x3b')](_0x1fe40d['model'],qs[_0xfcee('0x3d')](_0x4f3ad2[_0xfcee('0x3a')][_0xfcee('0x3d')]));_0x50cdd0[_0xfcee('0x3c')]=_0x50cdd0[_0xfcee('0x3c')][_0xfcee('0x3e')]?_0x50cdd0[_0xfcee('0x3c')]:_0x1fe40d[_0xfcee('0x39')];if(!_0x4f3ad2['query']['hasOwnProperty'](_0xfcee('0x3f'))){_0x50cdd0['limit']=qs['limit'](_0x4f3ad2[_0xfcee('0x3a')][_0xfcee('0x26')]);_0x50cdd0[_0xfcee('0x29')]=qs['offset'](_0x4f3ad2['query'][_0xfcee('0x29')]);}_0x50cdd0[_0xfcee('0x40')]=qs['sort'](_0x4f3ad2[_0xfcee('0x3a')][_0xfcee('0x41')]);_0x50cdd0['where']=qs[_0xfcee('0x42')](_[_0xfcee('0x43')](_0x4f3ad2[_0xfcee('0x3a')],_0x1fe40d['filters']),_0x52ea0f);if(_0x4f3ad2[_0xfcee('0x3a')][_0xfcee('0x44')]){_0x50cdd0[_0xfcee('0x45')]=_[_0xfcee('0x46')](_0x50cdd0['where'],{'$or':_[_0xfcee('0x33')](_0x52ea0f,function(_0x242270){if(_0x242270[_0xfcee('0x37')]!==_0xfcee('0x47')){var _0x3b24fb={};_0x3b24fb[_0x242270[_0xfcee('0x31')]]={'$like':'%'+_0x4f3ad2[_0xfcee('0x3a')][_0xfcee('0x44')]+'%'};return _0x3b24fb;}})});}_0x50cdd0=_[_0xfcee('0x46')]({},_0x50cdd0,_0x4f3ad2[_0xfcee('0x48')]);var _0x2f4273={'where':_0x50cdd0[_0xfcee('0x45')]};return db['Plugin'][_0xfcee('0x28')](_0x2f4273)[_0xfcee('0x2d')](function(_0x2843a9){_0x11f359[_0xfcee('0x28')]=_0x2843a9;if(_0x4f3ad2['query'][_0xfcee('0x49')]){_0x50cdd0['include']=[{'all':!![]}];}return db[_0xfcee('0x34')][_0xfcee('0x4a')](_0x50cdd0);})['then'](function(_0x53d8da){_0x11f359[_0xfcee('0x4b')]=_0x53d8da;return _0x11f359;})[_0xfcee('0x2d')](respondWithFilteredResult(_0x50995b,_0x50cdd0))['catch'](handleError(_0x50995b,null));};exports[_0xfcee('0x4c')]=function(_0x341a46,_0x51a192){var _0x7538b3={'raw':!![],'where':{'id':_0x341a46['params']['id']}},_0x565a45={};_0x565a45[_0xfcee('0x39')]=_[_0xfcee('0x4d')](db[_0xfcee('0x34')][_0xfcee('0x35')]);_0x565a45[_0xfcee('0x3a')]=_[_0xfcee('0x4d')](_0x341a46[_0xfcee('0x3a')]);_0x565a45[_0xfcee('0x42')]=_[_0xfcee('0x3b')](_0x565a45[_0xfcee('0x39')],_0x565a45[_0xfcee('0x3a')]);_0x7538b3[_0xfcee('0x3c')]=_[_0xfcee('0x3b')](_0x565a45[_0xfcee('0x39')],qs['fields'](_0x341a46[_0xfcee('0x3a')][_0xfcee('0x3d')]));_0x7538b3['attributes']=_0x7538b3[_0xfcee('0x3c')]['length']?_0x7538b3['attributes']:_0x565a45[_0xfcee('0x39')];if(_0x341a46[_0xfcee('0x3a')][_0xfcee('0x49')]){_0x7538b3['include']=[{'all':!![]}];}_0x7538b3=_[_0xfcee('0x46')]({},_0x7538b3,_0x341a46[_0xfcee('0x48')]);return db[_0xfcee('0x34')]['find'](_0x7538b3)[_0xfcee('0x2d')](handleEntityNotFound(_0x51a192,null))[_0xfcee('0x2d')](respondWithResult(_0x51a192,null))['catch'](handleError(_0x51a192,null));};exports[_0xfcee('0x4e')]=function(_0x54d672,_0x3f3b8a,_0x2e1505){return db['Plugin']['find']({'where':{'id':_0x54d672[_0xfcee('0x4f')]['id']},'attributes':[_0xfcee('0x31'),'path'],'raw':!![]})[_0xfcee('0x2d')](handleEntityNotFound(_0x3f3b8a,null))['then'](function(_0x25629c){if(_0x25629c){var _0x23a757=path[_0xfcee('0x50')](config[_0xfcee('0x51')],_0xfcee('0x52'),util[_0xfcee('0x53')]('%s.zip',path['basename'](_0x25629c[_0xfcee('0x7')])));var _0x2d60df=fs[_0xfcee('0x54')](_0x23a757);var _0x3502d2=archiver(_0xfcee('0x55'),{'zlib':{'level':0x9}});_0x3502d2['on']('warning',function(_0x4df77c){if(_0x4df77c[_0xfcee('0x56')]===_0xfcee('0x57')){logger['error'](_0x4df77c);}else{throw new db[(_0xfcee('0x58'))][(_0xfcee('0x59'))](_0xfcee('0x5a'));}});_0x3502d2['on']('error',function(_0x2c088f){throw new db[(_0xfcee('0x58'))][(_0xfcee('0x59'))](_0xfcee('0x5a'));});_0x3502d2[_0xfcee('0x5b')](_0x2d60df);_0x3502d2['glob']('**/*',{'cwd':path['join'](config[_0xfcee('0x51')],_0xfcee('0x52'),path[_0xfcee('0x5c')](_0x25629c['path'])),'ignore':[path[_0xfcee('0x50')](path['basename'](_0x25629c[_0xfcee('0x7')]),'node_modules/**/*'),path[_0xfcee('0x50')](path['basename'](_0x25629c[_0xfcee('0x7')]),_0xfcee('0x5d'))],'nodir':!![]})[_0xfcee('0x5e')]();_0x2d60df['on'](_0xfcee('0x5f'),function(){if(!fs[_0xfcee('0x60')](_0x23a757)){throw new db[(_0xfcee('0x58'))][(_0xfcee('0x59'))](_0xfcee('0x61'));}return _0x3f3b8a[_0xfcee('0x4e')](_0x23a757,util[_0xfcee('0x53')](_0xfcee('0x62'),path['basename'](_0x25629c[_0xfcee('0x7')])),function(_0xe8056d){if(_0xe8056d){throw new db[(_0xfcee('0x58'))][(_0xfcee('0x59'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs['unlinkSync'](_0x23a757);logger[_0xfcee('0x63')](_0xfcee('0x64'));logger['info'](_0xfcee('0x65'));});});}return null;})[_0xfcee('0x66')](handleError(_0x3f3b8a,null));};exports[_0xfcee('0x67')]=function(_0x116cf9,_0x2cbd88,_0x55c7dd){var _0x580dc7=path[_0xfcee('0x68')](_0x116cf9['file']['filename'],path[_0xfcee('0x69')](_0x116cf9['file'][_0xfcee('0x6a')]));var _0x2deb38=path['join'](config[_0xfcee('0x51')],'server/files/plugins',_0x116cf9[_0xfcee('0x6b')][_0xfcee('0x6a')]);var _0x1f81a7=path[_0xfcee('0x50')](config[_0xfcee('0x51')],'server/files/plugins',_0x580dc7);logger[_0xfcee('0x63')]('Plugin\x20upload\x20filepath:\x20%s',_0x2deb38);logger[_0xfcee('0x63')](_0xfcee('0x6c'),_0x1f81a7);try{fs[_0xfcee('0x6d')](_0x2deb38,parseInt(_0xfcee('0x6e'),0x8));extract(_0x2deb38,{'dir':_0x1f81a7},function(_0x42c7e9){if(_0x42c7e9){logger[_0xfcee('0x6f')](_0x42c7e9);handleError(_0x42c7e9,!![]);};var _0x3c3b07=fs[_0xfcee('0x70')](_0x1f81a7);if(_0x3c3b07[_0xfcee('0x3e')]>0x1){removeReferences(_0x2deb38,_0x1f81a7);logger['error'](_0xfcee('0x71'));return _0x55c7dd(new Error('Invalid\x20plugin\x20structure'));}var _0x54d56a=fs[_0xfcee('0x72')](path[_0xfcee('0x50')](_0x1f81a7,_0x3c3b07[0x0]));if(_0x54d56a[_0xfcee('0x73')]()){removeReferences(_0x2deb38,_0x1f81a7);logger['error'](_0xfcee('0x71'));return _0x55c7dd(new Error('Invalid\x20plugin\x20structure'));}if(_0x54d56a['isDirectory']()){var _0x179ddc=fs[_0xfcee('0x70')](path[_0xfcee('0x50')](_0x1f81a7,_0x3c3b07[0x0]));if(_0x179ddc[_0xfcee('0x3e')]===0x0){removeReferences(_0x2deb38,_0x1f81a7);logger[_0xfcee('0x6f')]('Invalid\x20plugin\x20structure');return _0x55c7dd(new Error('Invalid\x20plugin\x20structure'));}var _0xe2e2c4=_0x179ddc[_0xfcee('0x74')](function(_0x2eabda){return _0x2eabda===_0xfcee('0x75');});if(!_0xe2e2c4){return _0x55c7dd(new Error('Plugin\x20manifest\x20missing'));}var _0x55b73a=fs[_0xfcee('0x76')](path[_0xfcee('0x50')](_0x1f81a7,_0x3c3b07[0x0],_0xfcee('0x75')));var _0x7e8cba=JSON[_0xfcee('0x77')](_0x55b73a);if(_0xfcee('0x27')==typeof _0x7e8cba[_0xfcee('0x31')]){return _0x55c7dd(new Error(_0xfcee('0x78')));}if(_0xfcee('0x27')==typeof _0x7e8cba[_0xfcee('0x37')]){return _0x55c7dd(new Error(_0xfcee('0x79')));}if(_0xfcee('0x27')==typeof _0x7e8cba[_0xfcee('0x7a')]){return _0x55c7dd(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0xfcee('0x27')==typeof _0x7e8cba['parameters']){return _0x55c7dd(new Error(_0xfcee('0x7b')));}if(_0x7e8cba[_0xfcee('0x37')]===_0xfcee('0x7c')){if(_0xfcee('0x27')==typeof _0x7e8cba[_0xfcee('0x7d')][_0xfcee('0x7e')]){return _0x55c7dd(new Error(_0xfcee('0x7f')));}if(_0xfcee('0x27')==typeof _0x7e8cba[_0xfcee('0x7d')][_0xfcee('0x7e')][_0xfcee('0x80')]&&_0xfcee('0x27')==typeof _0x7e8cba[_0xfcee('0x7d')][_0xfcee('0x7e')][_0xfcee('0x81')]){return _0x55c7dd(new Error(_0xfcee('0x82')));}}else if(_0x7e8cba[_0xfcee('0x37')]===_0xfcee('0x83')){if(_0xfcee('0x27')==typeof _0x7e8cba['parameters'][_0xfcee('0x84')]){return _0x55c7dd(new Error(_0xfcee('0x85')));}if(_0xfcee('0x27')==typeof _0x7e8cba['parameters'][_0xfcee('0x86')]){return _0x55c7dd(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x55c7dd(new Error(_0xfcee('0x87')));}var _0x5adf86=_0x7e8cba[_0xfcee('0x31')];var _0x5be83d=_0x7e8cba['description'];var _0x38329f=_0x7e8cba[_0xfcee('0x37')];var _0x533d49=_0x7e8cba[_0xfcee('0x88')]?_0x7e8cba[_0xfcee('0x88')]:'always';var _0x1aa906=_0x7e8cba[_0xfcee('0x89')]?_0x7e8cba['icon']:_0xfcee('0x8a');var _0x58a089='';var _0x5a4d0b='';var _0x486c54='';var _0x39d3aa='';var _0x3c483a=_0x7e8cba[_0xfcee('0x7a')];if(_0x38329f===_0xfcee('0x7c')){if(_0xfcee('0x27')!=typeof _0x7e8cba[_0xfcee('0x7d')][_0xfcee('0x7e')]['admin']){var _0x58daab=_0x7e8cba[_0xfcee('0x7d')][_0xfcee('0x7e')][_0xfcee('0x80')];if(!/^(f|ht)tps?:\/\//i[_0xfcee('0x8b')](_0x58daab)){_0x58a089=path['join'](_0xfcee('0x8c'),_0x580dc7,_0x3c3b07[0x0],_0x58daab);}else{_0x58a089=_0x58daab;}}else{logger[_0xfcee('0x63')](_0xfcee('0x8d'));}if(_0xfcee('0x27')!=typeof _0x7e8cba[_0xfcee('0x7d')][_0xfcee('0x7e')][_0xfcee('0x81')]){var _0x23eb65=_0x7e8cba[_0xfcee('0x7d')][_0xfcee('0x7e')][_0xfcee('0x81')];if(!/^(f|ht)tps?:\/\//i[_0xfcee('0x8b')](_0x23eb65)){_0x5a4d0b=path[_0xfcee('0x50')](_0xfcee('0x8c'),_0x580dc7,_0x3c3b07[0x0],_0x23eb65);}else{_0x5a4d0b=_0x23eb65;}}else{logger[_0xfcee('0x63')](_0xfcee('0x8e'));}}else if(_0x38329f===_0xfcee('0x83')){_0x486c54=_0x7e8cba[_0xfcee('0x7d')]['scriptName'];_0x39d3aa=_0x7e8cba[_0xfcee('0x7d')][_0xfcee('0x86')];if(_0xfcee('0x27')!=typeof _0x7e8cba[_0xfcee('0x7d')]['views']){if('undefined'!=typeof _0x7e8cba[_0xfcee('0x7d')][_0xfcee('0x7e')]['admin']){var _0x58daab=_0x7e8cba[_0xfcee('0x7d')][_0xfcee('0x7e')][_0xfcee('0x80')];if(!/^(f|ht)tps?:\/\//i[_0xfcee('0x8b')](_0x58daab)){_0x58a089=path[_0xfcee('0x50')](_0xfcee('0x8c'),_0x580dc7,_0x3c3b07[0x0],_0x58daab);}else{_0x58a089=_0x58daab;}}if(_0xfcee('0x27')!=typeof _0x7e8cba[_0xfcee('0x7d')][_0xfcee('0x7e')][_0xfcee('0x81')]){var _0x23eb65=_0x7e8cba[_0xfcee('0x7d')]['views'][_0xfcee('0x81')];if(!/^(f|ht)tps?:\/\//i[_0xfcee('0x8b')](_0x23eb65)){_0x5a4d0b=path[_0xfcee('0x50')](_0xfcee('0x8c'),_0x580dc7,_0x3c3b07[0x0],_0x23eb65);}else{_0x5a4d0b=_0x23eb65;}}}}var _0x6a2f4={'name':_0x5adf86,'description':_0x5be83d,'path':path[_0xfcee('0x50')](_0x580dc7,_0x3c3b07[0x0]),'type':_0x38329f,'sidebar':_0x533d49,'icon':_0x1aa906,'adminUrl':_0x58a089,'agentUrl':_0x5a4d0b,'scriptName':_0x486c54,'scriptPath':_0x39d3aa,'version':_0x3c483a};removeReferences(_0x2deb38,null);return db['Plugin'][_0xfcee('0x8f')](_0x6a2f4)[_0xfcee('0x2d')](function(_0x3ecbfe){var _0xeed4bf={'role':_0x116cf9[_0xfcee('0x90')][_0xfcee('0x91')],'userProfileId':_0x116cf9[_0xfcee('0x90')][_0xfcee('0x92')]};if(!_0xeed4bf)throw new Error(_0xfcee('0x93'));if(_0xeed4bf['role']===_0xfcee('0x94')){var _0x36331f=_0x3ecbfe['get']({'plain':!![]});return db['UserProfileSection'][_0xfcee('0x95')]({'where':{'name':_0xfcee('0x30'),'userProfileId':_0xeed4bf[_0xfcee('0x92')]},'raw':!![]})[_0xfcee('0x2d')](function(_0x5ef397){if(_0x5ef397&&_0x5ef397[_0xfcee('0x96')]===0x0){return db[_0xfcee('0x97')]['create']({'name':_0x36331f[_0xfcee('0x31')],'resourceId':_0x36331f['id'],'type':_0x5ef397[_0xfcee('0x31')],'sectionId':_0x5ef397['id']},{})[_0xfcee('0x2d')](function(){return _0x3ecbfe;});}else{return _0x3ecbfe;}})['catch'](function(_0x1b44c9){logger[_0xfcee('0x6f')](_0xfcee('0x98'),_0x1b44c9);throw _0x1b44c9;});}return _0x3ecbfe;})['then'](respondWithResult(_0x2cbd88,null))[_0xfcee('0x66')](handleError(_0x2cbd88,null));}});}catch(_0x3bb3db){_0x2cbd88[_0xfcee('0x23')](0x1f4)[_0xfcee('0x99')](_0x3bb3db);}};function removeReferences(_0x2afe95,_0x41291c){try{if(_0x2afe95){fs[_0xfcee('0x9a')](_0x2afe95);logger[_0xfcee('0x63')](_0xfcee('0x9b'));}if(_0x41291c){rimraf(_0x41291c,function(){});logger[_0xfcee('0x63')](_0xfcee('0x9c'));}}catch(_0x2337c6){logger[_0xfcee('0x6f')](_0x2337c6);}}exports[_0xfcee('0x9d')]=function(_0x1dbf42,_0x499ff3,_0x34fa87){return db[_0xfcee('0x34')]['find']({'where':{'id':_0x1dbf42[_0xfcee('0x4f')]['id']}})[_0xfcee('0x2d')](handleEntityNotFound(_0x499ff3,null))[_0xfcee('0x2d')](saveUpdates(_0x1dbf42[_0xfcee('0x90')],null))[_0xfcee('0x2d')](respondWithResult(_0x499ff3,null))['catch'](handleError(_0x499ff3,null));};exports[_0xfcee('0x9e')]=function(_0x1ebc24,_0x179525,_0x55fc9a){return db['Plugin'][_0xfcee('0x95')]({'where':{'id':_0x1ebc24['params']['id']}})[_0xfcee('0x2d')](function(_0x2972ea){if(_0x2972ea){return _0x2972ea[_0xfcee('0x2e')]();}})['then'](function(_0x301308){rimraf(path[_0xfcee('0x50')](config[_0xfcee('0x51')],_0xfcee('0x52'),path['dirname'](_0x301308['path'])),function(){});return _0x301308;})[_0xfcee('0x2d')](handleEntityNotFound(_0x179525,null))[_0xfcee('0x2d')](respondWithStatusCode(_0x179525,null))[_0xfcee('0x66')](handleError(_0x179525,null));};exports[_0xfcee('0x9f')]=function(_0x362fd5,_0x53f1a8,_0x17cf1a){return BPromise['resolve']()[_0xfcee('0x2d')](function(){if(!_0x362fd5['query'][_0xfcee('0x7')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x362fd5[_0xfcee('0x3a')][_0xfcee('0xa0')]){throw new Error(_0xfcee('0xa1'));}var _0x21f31d=_0x362fd5[_0xfcee('0x3a')][_0xfcee('0xa2')]?_0x362fd5[_0xfcee('0x3a')][_0xfcee('0xa2')]+':'+_0x362fd5['query']['port']:_0xfcee('0xa3')+_0x362fd5['query']['port'];var _0x356121=_0x362fd5[_0xfcee('0x3a')][_0xfcee('0x25')]?_0x362fd5['query']['json']:!![];var _0x3b584a=_0x362fd5[_0xfcee('0x3a')][_0xfcee('0xa4')]?_0x362fd5[_0xfcee('0x3a')][_0xfcee('0xa4')]:null;var _0x560838={'method':_0x362fd5['method'],'uri':util['format'](_0xfcee('0xa5'),_0x21f31d,_0x362fd5[_0xfcee('0x3a')][_0xfcee('0x7')]),'json':_0x356121,'resolveWithFullResponse':!![],'encoding':_0x3b584a,'qs':_0x362fd5[_0xfcee('0x3a')]};if(_0x362fd5['headers']){_0x560838[_0xfcee('0xa6')]=_0x362fd5[_0xfcee('0xa6')];if(_0x560838[_0xfcee('0xa6')]['content-length']){delete _0x560838[_0xfcee('0xa6')]['content-length'];}}if(_0x560838[_0xfcee('0xa6')]['content-type']){delete _0x560838[_0xfcee('0xa6')]['content-type'];}return rp(_0x560838);})[_0xfcee('0x2d')](function(_0x3554dd){if(_0x3554dd){_0x53f1a8[_0xfcee('0x2a')](_0x3554dd[_0xfcee('0xa6')]);logger[_0xfcee('0x63')](_0x3554dd[_0xfcee('0x90')]);if(_['endsWith'](_0x362fd5[_0xfcee('0x3a')][_0xfcee('0x7')],_0xfcee('0x4e'))&&_0x3554dd[_0xfcee('0xa7')]==0x1f4){return _0x53f1a8[_0xfcee('0x22')](_0x3554dd[_0xfcee('0xa7')]);}else{return _0x53f1a8[_0xfcee('0x23')](_0x3554dd[_0xfcee('0xa7')])['send'](_0x3554dd[_0xfcee('0x90')]);}}else{return _0x53f1a8[_0xfcee('0x22')](0xc8);}})[_0xfcee('0x66')](handleError(_0x53f1a8,null));};exports[_0xfcee('0xa8')]=function(_0x58c388,_0x5c067c,_0x484174){return BPromise['resolve']()[_0xfcee('0x2d')](function(){if(!_0x58c388['query'][_0xfcee('0x7')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x58c388['query']['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x5d8318=_0x58c388[_0xfcee('0x3a')][_0xfcee('0xa2')]?_0x58c388['query'][_0xfcee('0xa2')]+':'+_0x58c388[_0xfcee('0x3a')]['port']:_0xfcee('0xa3')+_0x58c388['query'][_0xfcee('0xa0')];var _0x3da9ce=_0x58c388[_0xfcee('0x3a')][_0xfcee('0x25')]?_0x58c388[_0xfcee('0x3a')]['json']:!![];var _0x9d4c11=_0x58c388[_0xfcee('0x3a')][_0xfcee('0xa4')]?_0x58c388[_0xfcee('0x3a')][_0xfcee('0xa4')]:null;var _0x276cab={'method':_0x58c388[_0xfcee('0xa9')],'uri':util[_0xfcee('0x53')](_0xfcee('0xa5'),_0x5d8318,_0x58c388['query'][_0xfcee('0x7')]),'json':_0x3da9ce,'resolveWithFullResponse':!![],'encoding':_0x9d4c11,'body':_0x58c388['body']};if(_0x58c388['headers']){_0x276cab['headers']=_0x58c388[_0xfcee('0xa6')];if(_0x276cab[_0xfcee('0xa6')][_0xfcee('0xaa')]){delete _0x276cab[_0xfcee('0xa6')]['content-length'];}}if(_0x276cab[_0xfcee('0xa6')][_0xfcee('0xab')]){delete _0x276cab['headers'][_0xfcee('0xab')];}return rp(_0x276cab);})[_0xfcee('0x2d')](function(_0x26a643){if(_0x26a643){_0x5c067c[_0xfcee('0x2a')](_0x26a643[_0xfcee('0xa6')]);logger[_0xfcee('0x63')](_0x26a643[_0xfcee('0x90')]);return _0x5c067c[_0xfcee('0x23')](_0x26a643['statusCode'])['send'](_0x26a643['body']);}else{return _0x5c067c['sendStatus'](0xc8);}})[_0xfcee('0x66')](handleError(_0x5c067c,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 63f7427..63b756c 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 _0x52ad=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','Plugin','setMaxListeners','update'];(function(_0x455555,_0x2147fd){var _0x3cb183=function(_0x516a72){while(--_0x516a72){_0x455555['push'](_0x455555['shift']());}};_0x3cb183(++_0x2147fd);}(_0x52ad,0x1d8));var _0xd52a=function(_0x2bcf70,_0x717f08){_0x2bcf70=_0x2bcf70-0x0;var _0x18823a=_0x52ad[_0x2bcf70];return _0x18823a;};'use strict';var EventEmitter=require(_0xd52a('0x0'));var Plugin=require(_0xd52a('0x1'))['db'][_0xd52a('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xd52a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd52a('0x4'),'afterDestroy':_0xd52a('0x5')};function emitEvent(_0x2dbf7a){return function(_0xf1d12e,_0x69fd93,_0xc135cb){PluginEvents[_0xd52a('0x6')](_0x2dbf7a+':'+_0xf1d12e['id'],_0xf1d12e);PluginEvents[_0xd52a('0x6')](_0x2dbf7a,_0xf1d12e);_0xc135cb(null);};}for(var e in events){if(events[_0xd52a('0x7')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0xd52a('0x8')]=PluginEvents; \ No newline at end of file +var _0x812d=['setMaxListeners','save','update','remove','emit','exports','../../mysqldb','Plugin'];(function(_0x4fc168,_0xf06de2){var _0x19f8e8=function(_0x5236ff){while(--_0x5236ff){_0x4fc168['push'](_0x4fc168['shift']());}};_0x19f8e8(++_0xf06de2);}(_0x812d,0x6e));var _0xd812=function(_0x5bba41,_0x593378){_0x5bba41=_0x5bba41-0x0;var _0x4e3deb=_0x812d[_0x5bba41];return _0x4e3deb;};'use strict';var EventEmitter=require('events');var Plugin=require(_0xd812('0x0'))['db'][_0xd812('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xd812('0x2')](0x0);var events={'afterCreate':_0xd812('0x3'),'afterUpdate':_0xd812('0x4'),'afterDestroy':_0xd812('0x5')};function emitEvent(_0x15181f){return function(_0x2fba72,_0x47efde,_0x39c083){PluginEvents[_0xd812('0x6')](_0x15181f+':'+_0x2fba72['id'],_0x2fba72);PluginEvents[_0xd812('0x6')](_0x15181f,_0x2fba72);_0x39c083(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0xd812('0x7')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 441653c..c2fa202 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 _0xdccf=['path','rimraf','../../config/environment','./plugin.attributes','exports','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x588e89,_0x5b7947){var _0x194f27=function(_0x46f662){while(--_0x46f662){_0x588e89['push'](_0x588e89['shift']());}};_0x194f27(++_0x5b7947);}(_0xdccf,0x118));var _0xfdcc=function(_0x56eeff,_0x5abcbd){_0x56eeff=_0x56eeff-0x0;var _0x221ece=_0xdccf[_0x56eeff];return _0x221ece;};'use strict';var _=require('lodash');var util=require(_0xfdcc('0x0'));var logger=require(_0xfdcc('0x1'))(_0xfdcc('0x2'));var moment=require(_0xfdcc('0x3'));var BPromise=require(_0xfdcc('0x4'));var rp=require(_0xfdcc('0x5'));var fs=require('fs');var path=require(_0xfdcc('0x6'));var rimraf=require(_0xfdcc('0x7'));var config=require(_0xfdcc('0x8'));var attributes=require(_0xfdcc('0x9'));module[_0xfdcc('0xa')]=function(_0x494590,_0x4d0828){return _0x494590['define']('Plugin',attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf57a=['lodash','../../config/logger','request-promise','../../config/environment','exports','Plugin'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0xf57a,0x108));var _0xaf57=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xf57a[_0x17b6e3];return _0x3906f3;};'use strict';var _=require(_0xaf57('0x0'));var util=require('util');var logger=require(_0xaf57('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xaf57('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xaf57('0x3'));var attributes=require('./plugin.attributes');module[_0xaf57('0x4')]=function(_0x58077d,_0x49c8ae){return _0x58077d['define'](_0xaf57('0x5'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index b8b0c68..7c2cdf2 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 _0x1dc3=['error','message','info','catch','CreatePlugin','body','options','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','then','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x358535,_0x5b11fb){var _0x1ce7b4=function(_0x1c27a3){while(--_0x1c27a3){_0x358535['push'](_0x358535['shift']());}};_0x1ce7b4(++_0x5b11fb);}(_0x1dc3,0x13b));var _0x31dc=function(_0x59b727,_0x3bba33){_0x59b727=_0x59b727-0x0;var _0x87054e=_0x1dc3[_0x59b727];return _0x87054e;};'use strict';var _=require(_0x31dc('0x0'));var util=require(_0x31dc('0x1'));var moment=require('moment');var BPromise=require(_0x31dc('0x2'));var rs=require(_0x31dc('0x3'));var fs=require('fs');var Redis=require(_0x31dc('0x4'));var db=require(_0x31dc('0x5'))['db'];var utils=require(_0x31dc('0x6'));var logger=require(_0x31dc('0x7'))(_0x31dc('0x8'));var config=require(_0x31dc('0x9'));var jayson=require(_0x31dc('0xa'));var client=jayson[_0x31dc('0xb')]['http']({'port':0x232a});config[_0x31dc('0xc')]=_[_0x31dc('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x31dc('0xe'))(new Redis(config[_0x31dc('0xc')]));require('./plugin.socket')['register'](socket);function respondWithRpcPromise(_0x2a3872,_0x17c27e,_0x549b7d){return new BPromise(function(_0x43ed85,_0x47837a){return client['request'](_0x2a3872,_0x549b7d)[_0x31dc('0xf')](function(_0x4b67e4){logger['info'](_0x31dc('0x10'),_0x17c27e,_0x31dc('0x11'));logger[_0x31dc('0x12')](_0x31dc('0x13'),_0x17c27e,'request\x20sent',JSON[_0x31dc('0x14')](_0x4b67e4));if(_0x4b67e4['error']){if(_0x4b67e4[_0x31dc('0x15')]['code']===0x1f4){logger['error']('Plugin,\x20%s,\x20%s',_0x17c27e,_0x4b67e4[_0x31dc('0x15')]['message']);return _0x47837a(_0x4b67e4[_0x31dc('0x15')]['message']);}logger[_0x31dc('0x15')](_0x31dc('0x10'),_0x17c27e,_0x4b67e4[_0x31dc('0x15')][_0x31dc('0x16')]);return _0x43ed85(_0x4b67e4[_0x31dc('0x15')][_0x31dc('0x16')]);}else{logger[_0x31dc('0x17')](_0x31dc('0x10'),_0x17c27e,_0x31dc('0x11'));_0x43ed85(_0x4b67e4['result'][_0x31dc('0x16')]);}})[_0x31dc('0x18')](function(_0x12e7ea){logger[_0x31dc('0x15')](_0x31dc('0x10'),_0x17c27e,_0x12e7ea);_0x47837a(_0x12e7ea);});});}exports[_0x31dc('0x19')]=function(_0x356e87){var _0x32f0d5=this;return new Promise(function(_0x39119b,_0x442e4a){return db['Plugin']['create'](_0x356e87[_0x31dc('0x1a')],{'raw':_0x356e87['options']?_0x356e87[_0x31dc('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x31dc('0xf')](function(_0x2f71a3){logger[_0x31dc('0x17')](_0x31dc('0x19'),_0x356e87);logger[_0x31dc('0x12')](_0x31dc('0x19'),_0x356e87,JSON[_0x31dc('0x14')](_0x2f71a3));_0x39119b(_0x2f71a3);})[_0x31dc('0x18')](function(_0x2dce87){logger[_0x31dc('0x15')](_0x31dc('0x19'),_0x2dce87['message'],_0x356e87);_0x442e4a(_0x32f0d5[_0x31dc('0x15')](0x1f4,_0x2dce87[_0x31dc('0x16')]));});});}; \ No newline at end of file +var _0x1cd8=['redis','defaults','localhost','socket.io-emitter','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreatePlugin','Plugin','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x438075,_0x59ca9e){var _0x3c2ff0=function(_0x305e6e){while(--_0x305e6e){_0x438075['push'](_0x438075['shift']());}};_0x3c2ff0(++_0x59ca9e);}(_0x1cd8,0x198));var _0x81cd=function(_0x552505,_0x521218){_0x552505=_0x552505-0x0;var _0x49a65c=_0x1cd8[_0x552505];return _0x49a65c;};'use strict';var _=require(_0x81cd('0x0'));var util=require(_0x81cd('0x1'));var moment=require(_0x81cd('0x2'));var BPromise=require(_0x81cd('0x3'));var rs=require(_0x81cd('0x4'));var fs=require('fs');var Redis=require(_0x81cd('0x5'));var db=require(_0x81cd('0x6'))['db'];var utils=require(_0x81cd('0x7'));var logger=require(_0x81cd('0x8'))(_0x81cd('0x9'));var config=require('../../config/environment');var jayson=require(_0x81cd('0xa'));var client=jayson[_0x81cd('0xb')]['http']({'port':0x232a});config[_0x81cd('0xc')]=_[_0x81cd('0xd')](config[_0x81cd('0xc')],{'host':_0x81cd('0xe'),'port':0x18eb});var socket=require(_0x81cd('0xf'))(new Redis(config[_0x81cd('0xc')]));require('./plugin.socket')[_0x81cd('0x10')](socket);function respondWithRpcPromise(_0x1fa17c,_0x5eb47e,_0x25cf40){return new BPromise(function(_0x4991f5,_0x41da1e){return client[_0x81cd('0x11')](_0x1fa17c,_0x25cf40)[_0x81cd('0x12')](function(_0x4b669a){logger[_0x81cd('0x13')](_0x81cd('0x14'),_0x5eb47e,_0x81cd('0x15'));logger[_0x81cd('0x16')](_0x81cd('0x17'),_0x5eb47e,_0x81cd('0x15'),JSON[_0x81cd('0x18')](_0x4b669a));if(_0x4b669a[_0x81cd('0x19')]){if(_0x4b669a[_0x81cd('0x19')][_0x81cd('0x1a')]===0x1f4){logger[_0x81cd('0x19')](_0x81cd('0x14'),_0x5eb47e,_0x4b669a[_0x81cd('0x19')][_0x81cd('0x1b')]);return _0x41da1e(_0x4b669a[_0x81cd('0x19')]['message']);}logger[_0x81cd('0x19')](_0x81cd('0x14'),_0x5eb47e,_0x4b669a[_0x81cd('0x19')][_0x81cd('0x1b')]);return _0x4991f5(_0x4b669a[_0x81cd('0x19')][_0x81cd('0x1b')]);}else{logger['info'](_0x81cd('0x14'),_0x5eb47e,_0x81cd('0x15'));_0x4991f5(_0x4b669a['result']['message']);}})[_0x81cd('0x1c')](function(_0x612a72){logger[_0x81cd('0x19')](_0x81cd('0x14'),_0x5eb47e,_0x612a72);_0x41da1e(_0x612a72);});});}exports[_0x81cd('0x1d')]=function(_0x9b74a0){var _0x19097b=this;return new Promise(function(_0x324e1a,_0x2efb81){return db[_0x81cd('0x1e')][_0x81cd('0x1f')](_0x9b74a0[_0x81cd('0x20')],{'raw':_0x9b74a0[_0x81cd('0x21')]?_0x9b74a0[_0x81cd('0x21')][_0x81cd('0x22')]===undefined?!![]:![]:!![]})[_0x81cd('0x12')](function(_0x57f81e){logger[_0x81cd('0x13')]('CreatePlugin',_0x9b74a0);logger[_0x81cd('0x16')]('CreatePlugin',_0x9b74a0,JSON[_0x81cd('0x18')](_0x57f81e));_0x324e1a(_0x57f81e);})[_0x81cd('0x1c')](function(_0x2a5593){logger[_0x81cd('0x19')]('CreatePlugin',_0x2a5593[_0x81cd('0x1b')],_0x9b74a0);_0x2efb81(_0x19097b['error'](0x1f4,_0x2a5593['message']));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 7618b74..69651d3 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 _0xd3aa=['register','length','save','update','removeListener'];(function(_0x393500,_0x1037af){var _0x120d3b=function(_0x17234e){while(--_0x17234e){_0x393500['push'](_0x393500['shift']());}};_0x120d3b(++_0x1037af);}(_0xd3aa,0x106));var _0xad3a=function(_0x9b2bb0,_0x3965b1){_0x9b2bb0=_0x9b2bb0-0x0;var _0x2cdb3b=_0xd3aa[_0x9b2bb0];return _0x2cdb3b;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0xad3a('0x0'),'remove',_0xad3a('0x1')];function createListener(_0xd88ed8,_0x11399e){return function(_0x12bd1a){_0x11399e['emit'](_0xd88ed8,_0x12bd1a);};}function removeListener(_0x166bc3,_0x23063e){return function(){PluginEvents[_0xad3a('0x2')](_0x166bc3,_0x23063e);};}exports[_0xad3a('0x3')]=function(_0x179d82){for(var _0x54194c=0x0,_0x13d2b2=events[_0xad3a('0x4')];_0x54194c<_0x13d2b2;_0x54194c++){var _0x1c9065=events[_0x54194c];var _0x34410c=createListener('plugin:'+_0x1c9065,_0x179d82);PluginEvents['on'](_0x1c9065,_0x34410c);}}; \ No newline at end of file +var _0x5706=['removeListener','length','plugin:','save','remove','update','emit'];(function(_0x2afd07,_0x3da1c6){var _0x28ecb5=function(_0x3a3f5b){while(--_0x3a3f5b){_0x2afd07['push'](_0x2afd07['shift']());}};_0x28ecb5(++_0x3da1c6);}(_0x5706,0x96));var _0x6570=function(_0x27dc36,_0x15e84c){_0x27dc36=_0x27dc36-0x0;var _0x3efb5c=_0x5706[_0x27dc36];return _0x3efb5c;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0x6570('0x0'),_0x6570('0x1'),_0x6570('0x2')];function createListener(_0x1ff82c,_0x1859c7){return function(_0x2d856d){_0x1859c7[_0x6570('0x3')](_0x1ff82c,_0x2d856d);};}function removeListener(_0x5364e7,_0x12d8e6){return function(){PluginEvents[_0x6570('0x4')](_0x5364e7,_0x12d8e6);};}exports['register']=function(_0x529c5e){for(var _0x5793b6=0x0,_0x1d5ec8=events[_0x6570('0x5')];_0x5793b6<_0x1d5ec8;_0x5793b6++){var _0x5e8a68=events[_0x5793b6];var _0x3adf73=createListener(_0x6570('0x6')+_0x5e8a68,_0x529c5e);PluginEvents['on'](_0x5e8a68,_0x3adf73);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 4b205aa..c3c7993 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(_0x412e27,_0x20a978){var _0x53da42=function(_0x43cae5){while(--_0x43cae5){_0x412e27['push'](_0x412e27['shift']());}};_0x53da42(++_0x20a978);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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(_0x20be39,_0x3d1520){var _0x10c677=function(_0x2da761){while(--_0x2da761){_0x20be39['push'](_0x20be39['shift']());}};_0x10c677(++_0x3d1520);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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 71dcc91..a09875c 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 _0xc788=['body','script','join','../../files/plugins','chdir','dirname','start','dump','send','update','stop','hasOwnProperty','Unknown\x20status','params','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','child_process','exec','bluebird','sendStatus','status','error','stack','name','info','index','list','then','reject','motion2','catch','show','describe'];(function(_0x5e848d,_0x1dbd20){var _0x3785e5=function(_0xc82b39){while(--_0xc82b39){_0x5e848d['push'](_0x5e848d['shift']());}};_0x3785e5(++_0x1dbd20);}(_0xc788,0xc4));var _0x8c78=function(_0x2605dc,_0x50cf7e){_0x2605dc=_0x2605dc-0x0;var _0x4568c9=_0xc788[_0x2605dc];return _0x4568c9;};'use strict';var _=require(_0x8c78('0x0'));var pm2=require(_0x8c78('0x1'));var logger=require(_0x8c78('0x2'))('api');var path=require('path');var exec=require(_0x8c78('0x3'))[_0x8c78('0x4')];var BPromise=require(_0x8c78('0x5'));function handleEntityNotFound(_0x1d0670,_0x386f0a){return function(_0x5498f9){if(!_0x5498f9){_0x1d0670[_0x8c78('0x6')](0x194);;}return _0x5498f9;};}function respondWithResult(_0x4555da,_0x329152){_0x329152=_0x329152||0xc8;return function(_0x1ac27f){if(_0x1ac27f){return _0x4555da[_0x8c78('0x7')](_0x329152)['json'](_0x1ac27f);}return null;};}function handleError(_0x247188,_0x299d9d){_0x299d9d=_0x299d9d||0x1f4;return function(_0x9bc075){logger[_0x8c78('0x8')](_0x9bc075[_0x8c78('0x9')]);if(_0x9bc075[_0x8c78('0xa')]){delete _0x9bc075['name'];}_0x247188[_0x8c78('0x7')](_0x299d9d)['send'](_0x9bc075);};}function execChildProcess(){return new BPromise(function(_0x3d55f0,_0x45935a){exec('npm\x20install',function(_0x1a05a7,_0x95e78e,_0x5ee642){logger[_0x8c78('0xb')](_0x95e78e);logger['info'](_0x5ee642);if(_0x1a05a7){logger['error'](_0x1a05a7);return _0x45935a(_0x1a05a7);}return _0x3d55f0(_0x95e78e);});});}exports[_0x8c78('0xc')]=function(_0x1b1d0e,_0x26178c){return pm2[_0x8c78('0xd')]()[_0x8c78('0xe')](function(_0x3d1306){if(_0x3d1306){var _0xe5f8ae=_[_0x8c78('0xf')](_0x3d1306,function(_0x2f44af){return _0x2f44af[_0x8c78('0xa')]==='express'||_0x2f44af[_0x8c78('0xa')]===_0x8c78('0x10');});return{'rows':_0xe5f8ae,'count':_0xe5f8ae['length']};}return null;})[_0x8c78('0xe')](respondWithResult(_0x26178c,null))[_0x8c78('0x11')](handleError(_0x26178c,null));};exports[_0x8c78('0x12')]=function(_0x23824e,_0x2a982c){return pm2[_0x8c78('0x13')](_0x23824e['params']['id'])['then'](respondWithResult(_0x2a982c,null))[_0x8c78('0xe')](handleEntityNotFound(_0x2a982c,null))['catch'](handleError(_0x2a982c,null));};exports['create']=function(_0xece4f0,_0x56c191){if(_0xece4f0[_0x8c78('0x14')][_0x8c78('0xa')]&&_0xece4f0['body'][_0x8c78('0x15')]){var _0x5b111b=path[_0x8c78('0x16')](__dirname,_0x8c78('0x17'),_0xece4f0['body'][_0x8c78('0x15')]);var _0x188cc3=process['cwd']();process[_0x8c78('0x18')](path[_0x8c78('0x19')](_0x5b111b));return execChildProcess()[_0x8c78('0xe')](function(_0x9581c6){process[_0x8c78('0x18')](_0x188cc3);return pm2[_0x8c78('0x1a')]({'name':_0xece4f0[_0x8c78('0x14')][_0x8c78('0xa')],'script':_0x5b111b});})[_0x8c78('0xe')](function(_0x4a7d20){pm2[_0x8c78('0x1b')]();return _0x4a7d20[0x0];})[_0x8c78('0xe')](respondWithResult(_0x56c191,0xc9))[_0x8c78('0x11')](handleError(_0x56c191,null));}else{return _0x56c191['status'](0x1f4)[_0x8c78('0x1c')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x8c78('0x1d')]=function(_0x24f9a7,_0x8d9ff9){if(_0x24f9a7['body']['id']){delete _0x24f9a7[_0x8c78('0x14')]['id'];}var _0x2568d5={'online':'restart','stopped':_0x8c78('0x1e')};if(_0x2568d5[_0x8c78('0x1f')](_0x24f9a7[_0x8c78('0x14')][_0x8c78('0x7')])){return pm2[_0x2568d5[_0x24f9a7[_0x8c78('0x14')][_0x8c78('0x7')]]](_0x24f9a7['params']['id'])[_0x8c78('0xe')](respondWithResult(_0x8d9ff9,0xc8))['catch'](handleError(_0x8d9ff9,null));}else{return _0x8d9ff9[_0x8c78('0x7')](0x1f4)[_0x8c78('0x1c')]({'message':_0x8c78('0x20')});}};exports['destroy']=function(_0x1f1a0c,_0x3816d2){if(_0x1f1a0c['body']['id']){delete _0x1f1a0c[_0x8c78('0x14')]['id'];}if(_0x1f1a0c[_0x8c78('0x21')]['id']){return pm2[_0x8c78('0x22')](_0x1f1a0c['params']['id'])[_0x8c78('0xe')](function(_0x63307e){pm2[_0x8c78('0x1b')]();return _0x63307e[0x0];})['then'](respondWithResult(_0x3816d2,null))[_0x8c78('0x11')](handleError(_0x3816d2,null));}else{return _0x3816d2[_0x8c78('0x7')](0x1f4)['send']({'message':_0x8c78('0x23')});}}; \ No newline at end of file +var _0x750a=['restart','stop','Unknown\x20status','delete','Unknown\x20id','../../config/pm2','path','child_process','exec','bluebird','sendStatus','status','json','stack','name','send','npm\x20install','info','error','index','list','then','reject','express','length','describe','params','body','../../files/plugins','chdir','start','dump','catch','Missing\x20name\x20and/or\x20path','update'];(function(_0xf73c09,_0x4e424e){var _0xa8923c=function(_0x4831c1){while(--_0x4831c1){_0xf73c09['push'](_0xf73c09['shift']());}};_0xa8923c(++_0x4e424e);}(_0x750a,0x140));var _0xa750=function(_0x3b982d,_0x50a501){_0x3b982d=_0x3b982d-0x0;var _0x905ba9=_0x750a[_0x3b982d];return _0x905ba9;};'use strict';var _=require('lodash');var pm2=require(_0xa750('0x0'));var logger=require('../../config/logger')('api');var path=require(_0xa750('0x1'));var exec=require(_0xa750('0x2'))[_0xa750('0x3')];var BPromise=require(_0xa750('0x4'));function handleEntityNotFound(_0x457cae,_0x43d704){return function(_0x562911){if(!_0x562911){_0x457cae[_0xa750('0x5')](0x194);;}return _0x562911;};}function respondWithResult(_0x10b4d9,_0x2497df){_0x2497df=_0x2497df||0xc8;return function(_0x197299){if(_0x197299){return _0x10b4d9[_0xa750('0x6')](_0x2497df)[_0xa750('0x7')](_0x197299);}return null;};}function handleError(_0x47a4dd,_0x53f2cb){_0x53f2cb=_0x53f2cb||0x1f4;return function(_0x2678ff){logger['error'](_0x2678ff[_0xa750('0x8')]);if(_0x2678ff[_0xa750('0x9')]){delete _0x2678ff['name'];}_0x47a4dd[_0xa750('0x6')](_0x53f2cb)[_0xa750('0xa')](_0x2678ff);};}function execChildProcess(){return new BPromise(function(_0x5870f0,_0x5aca9c){exec(_0xa750('0xb'),function(_0x4b19a1,_0x174fd0,_0x5adaae){logger['info'](_0x174fd0);logger[_0xa750('0xc')](_0x5adaae);if(_0x4b19a1){logger[_0xa750('0xd')](_0x4b19a1);return _0x5aca9c(_0x4b19a1);}return _0x5870f0(_0x174fd0);});});}exports[_0xa750('0xe')]=function(_0x567c51,_0x2f670f){return pm2[_0xa750('0xf')]()[_0xa750('0x10')](function(_0x24e48a){if(_0x24e48a){var _0xa66181=_[_0xa750('0x11')](_0x24e48a,function(_0x5806ed){return _0x5806ed[_0xa750('0x9')]===_0xa750('0x12')||_0x5806ed[_0xa750('0x9')]==='motion2';});return{'rows':_0xa66181,'count':_0xa66181[_0xa750('0x13')]};}return null;})[_0xa750('0x10')](respondWithResult(_0x2f670f,null))['catch'](handleError(_0x2f670f,null));};exports['show']=function(_0x321eb2,_0x5b1e6b){return pm2[_0xa750('0x14')](_0x321eb2[_0xa750('0x15')]['id'])['then'](respondWithResult(_0x5b1e6b,null))[_0xa750('0x10')](handleEntityNotFound(_0x5b1e6b,null))['catch'](handleError(_0x5b1e6b,null));};exports['create']=function(_0x25e335,_0x5d0935){if(_0x25e335[_0xa750('0x16')]['name']&&_0x25e335[_0xa750('0x16')]['script']){var _0x3dc7f1=path['join'](__dirname,_0xa750('0x17'),_0x25e335['body']['script']);var _0xaa9d3e=process['cwd']();process[_0xa750('0x18')](path['dirname'](_0x3dc7f1));return execChildProcess()['then'](function(_0x5b433d){process['chdir'](_0xaa9d3e);return pm2[_0xa750('0x19')]({'name':_0x25e335[_0xa750('0x16')][_0xa750('0x9')],'script':_0x3dc7f1});})[_0xa750('0x10')](function(_0x1b80a5){pm2[_0xa750('0x1a')]();return _0x1b80a5[0x0];})[_0xa750('0x10')](respondWithResult(_0x5d0935,0xc9))[_0xa750('0x1b')](handleError(_0x5d0935,null));}else{return _0x5d0935[_0xa750('0x6')](0x1f4)[_0xa750('0xa')]({'message':_0xa750('0x1c')});}};exports[_0xa750('0x1d')]=function(_0x31ea63,_0x3f7d6d){if(_0x31ea63[_0xa750('0x16')]['id']){delete _0x31ea63['body']['id'];}var _0x3d3923={'online':_0xa750('0x1e'),'stopped':_0xa750('0x1f')};if(_0x3d3923['hasOwnProperty'](_0x31ea63[_0xa750('0x16')][_0xa750('0x6')])){return pm2[_0x3d3923[_0x31ea63[_0xa750('0x16')][_0xa750('0x6')]]](_0x31ea63['params']['id'])[_0xa750('0x10')](respondWithResult(_0x3f7d6d,0xc8))[_0xa750('0x1b')](handleError(_0x3f7d6d,null));}else{return _0x3f7d6d[_0xa750('0x6')](0x1f4)[_0xa750('0xa')]({'message':_0xa750('0x20')});}};exports['destroy']=function(_0x46cc11,_0x4c2c9e){if(_0x46cc11[_0xa750('0x16')]['id']){delete _0x46cc11[_0xa750('0x16')]['id'];}if(_0x46cc11['params']['id']){return pm2[_0xa750('0x21')](_0x46cc11[_0xa750('0x15')]['id'])[_0xa750('0x10')](function(_0x314f88){pm2[_0xa750('0x1a')]();return _0x314f88[0x0];})[_0xa750('0x10')](respondWithResult(_0x4c2c9e,null))[_0xa750('0x1b')](handleError(_0x4c2c9e,null));}else{return _0x4c2c9e[_0xa750('0x6')](0x1f4)['send']({'message':_0xa750('0x22')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index dba7798..cba08cc 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 _0xbab8=['./realtime.controller','get','/agents','isAuthenticated','getAgents','getQueues','exports','Router','../../components/auth/service'];(function(_0x316bd2,_0x334e3b){var _0x1008f8=function(_0x2d20a4){while(--_0x2d20a4){_0x316bd2['push'](_0x316bd2['shift']());}};_0x1008f8(++_0x334e3b);}(_0xbab8,0x1d2));var _0x8bab=function(_0x4d72aa,_0x5752e3){_0x4d72aa=_0x4d72aa-0x0;var _0x22c759=_0xbab8[_0x4d72aa];return _0x22c759;};'use strict';var express=require('express');var router=express[_0x8bab('0x0')]();var auth=require(_0x8bab('0x1'));var controller=require(_0x8bab('0x2'));router[_0x8bab('0x3')](_0x8bab('0x4'),auth[_0x8bab('0x5')](),controller[_0x8bab('0x6')]);router[_0x8bab('0x3')]('/queues',auth[_0x8bab('0x5')](),controller[_0x8bab('0x7')]);module[_0x8bab('0x8')]=router; \ No newline at end of file +var _0xaeee=['./realtime.controller','/agents','isAuthenticated','get','express'];(function(_0x41fde7,_0x292321){var _0x452ce6=function(_0xce7714){while(--_0xce7714){_0x41fde7['push'](_0x41fde7['shift']());}};_0x452ce6(++_0x292321);}(_0xaeee,0x1c1));var _0xeaee=function(_0x456d5a,_0x27866d){_0x456d5a=_0x456d5a-0x0;var _0x10bcf1=_0xaeee[_0x456d5a];return _0x10bcf1;};'use strict';var express=require(_0xeaee('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0xeaee('0x1'));router['get'](_0xeaee('0x2'),auth[_0xeaee('0x3')](),controller['getAgents']);router[_0xeaee('0x4')]('/queues',auth[_0xeaee('0x3')](),controller['getQueues']);module['exports']=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 03b5ed6..bf24157 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 _0x32d9=['status','set','Content-Range','getAgents','getChannels','query','pauseTypeFilter','pause','resolve','then','channel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','globalStatus','validateSortParameter','getUpdatedSortOptions','join','getAgentIdsByQueues','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','length','map','User','rawAttributes','type','key','role','agent','getOptions','raw','push','literal','FIELD(id,','Pause','where','merge','user','online','extraQueryConditions','UserProfile','findAndCountAll','find','filterAgentAttributes','includes','forEach','voiceStatus','talking','sortAgentsByStatus','getRealtimeAgentsQueryFields','pick','getQueues','isValidChannel','Queue','fieldName','fields','name','voice','outbound','dialActive','dialMethod','userProfileId','QueueCampaigns','Queues','filter','assign','getResources','getRealtimeQueues','initializeQueues','catch','lodash','util','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../mysqldb','../../errors/api','handleError','offset','undefined','limit','count'];(function(_0x57d485,_0x4ddb6a){var _0x3f6177=function(_0x4e122e){while(--_0x4e122e){_0x57d485['push'](_0x57d485['shift']());}};_0x3f6177(++_0x4ddb6a);}(_0x32d9,0x198));var _0x932d=function(_0xf3029,_0x4573b3){_0xf3029=_0xf3029-0x0;var _0x2c019f=_0x32d9[_0xf3029];return _0x2c019f;};'use strict';var _=require(_0x932d('0x0'));var util=require(_0x932d('0x1'));var rta=require(_0x932d('0x2'));var rtq=require(_0x932d('0x3'));var qs=require(_0x932d('0x4'));var utils=require('../../config/utils');var db=require(_0x932d('0x5'))['db'];var APIBadRequestError=require(_0x932d('0x6'))['APIBadRequestError'];var APIHandleError=require(_0x932d('0x6'))[_0x932d('0x7')];function respondWithFilteredResult(_0x1cc707,_0x34f738){return function(_0x370b9f){if(_0x370b9f){var _0xce082f=typeof _0x34f738[_0x932d('0x8')]===_0x932d('0x9')&&typeof _0x34f738[_0x932d('0xa')]==='undefined';var _0x53b0f8=_0x370b9f[_0x932d('0xb')];var _0x307eb8=_0xce082f?0x0:_0x34f738['offset'];var _0x3f912f=_0xce082f?_0x370b9f[_0x932d('0xb')]:_0x34f738['offset']+_0x34f738[_0x932d('0xa')];var _0x2037b4;if(_0x3f912f>=_0x53b0f8){_0x3f912f=_0x53b0f8;_0x2037b4=0xc8;}else{_0x2037b4=0xce;}_0x1cc707[_0x932d('0xc')](_0x2037b4);return _0x1cc707[_0x932d('0xd')](_0x932d('0xe'),_0x307eb8+'-'+_0x3f912f+'/'+_0x53b0f8)['json'](_0x370b9f);}return null;};}exports[_0x932d('0xf')]=function(_0x2be5c4,_0x41fa59){var _0x9e85e9={'count':0x0,'rows':[]};var _0x102e3a={};var _0x528eff;var _0x3298fd=utils[_0x932d('0x10')]();var _0x5c126a;var _0x41e92e;var _0x48e417=_0x2be5c4[_0x932d('0x11')]['globalQueueFilter'];var _0x20a02f=_0x2be5c4[_0x932d('0x11')]['globalStatusFilter'];var _0x1f4d1f=_0x2be5c4[_0x932d('0x11')][_0x932d('0x12')];var _0x2fda9e=_0x20a02f===_0x932d('0x13')||_0x20a02f==='*pause'?!![]:![];var _0x335b90=[];var _0xfa3652;var _0x1beae0;Promise[_0x932d('0x14')]()[_0x932d('0x15')](function(){if(_0x2be5c4['query'][_0x932d('0x16')]){if(!utils['isValidChannel'](_0x2be5c4['query'][_0x932d('0x16')])){throw new APIBadRequestError(util[_0x932d('0x17')](_0x932d('0x18'),_0x2be5c4['query'][_0x932d('0x16')]));}_0x528eff=_0x2be5c4[_0x932d('0x11')][_0x932d('0x16')][_0x932d('0x19')]();}if(!_0x2be5c4['query']['sort']||!_0x2be5c4['query'][_0x932d('0x1a')]['includes'](_0x932d('0x1b'))){_0x2be5c4[_0x932d('0x11')][_0x932d('0x1a')]=rta[_0x932d('0x1c')](_0x2be5c4['query'][_0x932d('0x1a')]);return;}var _0x530257=rta[_0x932d('0x1d')](_0x2be5c4['query']['sort']);_0x2be5c4[_0x932d('0x11')][_0x932d('0x1a')]=_0x530257['fields'][_0x932d('0x1e')](',');_0xfa3652=_0x530257['order'];})[_0x932d('0x15')](function(){if(!_0x48e417){return[];}return rta[_0x932d('0x1f')](_0x48e417,_0x528eff);})[_0x932d('0x15')](function(_0x3d7677){_0x335b90=_0x3d7677;return rta[_0x932d('0x20')]();})[_0x932d('0x15')](function(_0x3ea9be){_0x41e92e=_0x3ea9be[_0x932d('0x21')];if((!_0x20a02f||_0x2fda9e)&&!_0xfa3652){return _0x335b90;}if(_0xfa3652&&!_0x20a02f){return rta[_0x932d('0x22')](_0x41e92e,_0x335b90,_0xfa3652);}else{return rta['getAgentIdsByStatus'](_0x41e92e,_0x335b90,_0x20a02f);}})[_0x932d('0x15')](function(_0x2ccc06){_0x335b90=_0x2ccc06;var _0x3cd641=![];if(_0x335b90[_0x932d('0x23')]===0x0){if(_0x48e417||_0x20a02f){_0x3cd641=!![];}if(_0x2fda9e){_0x3cd641=![];}}if(_0x3cd641){return _0x9e85e9;}var _0x3fd783=_[_0x932d('0x24')](db[_0x932d('0x25')][_0x932d('0x26')],function(_0x453504){return{'name':_0x453504['fieldName'],'type':_0x453504[_0x932d('0x27')][_0x932d('0x28')]};});_0x2be5c4[_0x932d('0x11')][_0x932d('0x29')]=_0x932d('0x2a');_0x102e3a=qs[_0x932d('0x2b')](_0x3fd783,_0x2be5c4);_0x102e3a[_0x932d('0x2c')]=!![];var _0x3b903a=[];if(_0x335b90[_0x932d('0x23')]>0x0){_0x3b903a[_0x932d('0x2d')]({'id':{'$in':_0x335b90}});if(_0xfa3652&&!_0x20a02f){_0x1beae0=[db['sequelize'][_0x932d('0x2e')](_0x932d('0x2f')+_0x335b90+')')];_0x102e3a['order']=_0x1beae0;}}if(_0x2fda9e){_0x3298fd['forEach'](function(_0x2d36cf){var _0x16386d=!![];if(_0x20a02f==='*pause'&&_0x528eff!==_0x2d36cf){_0x16386d=![];}_0x3b903a['push']({[_0x2d36cf+_0x932d('0x30')]:_0x16386d});});if(_0x1f4d1f){_0x3b903a[_0x932d('0x2d')]({'pauseType':_0x1f4d1f});}}else if(_0x20a02f){_0x3298fd['forEach'](function(_0x475163){_0x3b903a[_0x932d('0x2d')]({[_0x475163+_0x932d('0x30')]:![]});});}_0x102e3a[_0x932d('0x31')]=_[_0x932d('0x32')](_0x102e3a[_0x932d('0x31')],{'$and':_0x3b903a});if(_0x2be5c4[_0x932d('0x33')][_0x932d('0x29')]===_0x932d('0x33')){var _0xd6156e={'params':{'id':_0x2be5c4[_0x932d('0x33')]['userProfileId']},'query':{'section':'Agents','role':'agent','raw':!![],'ids':_0x335b90,'customSorting':_0x1beae0}};if(_0x2be5c4[_0x932d('0x11')][_0x932d('0x34')]){_0xd6156e[_0x932d('0x11')]['online']=!![];}if(_0x2fda9e){_0xd6156e[_0x932d('0x11')][_0x932d('0x35')]=_0x3b903a;}_0xd6156e[_0x932d('0x11')]=Object['assign'](_0xd6156e[_0x932d('0x11')],_0x2be5c4[_0x932d('0x11')]);return db[_0x932d('0x36')]['getResources'](_0xd6156e);}return db[_0x932d('0x25')][_0x932d('0x37')](_0x102e3a);})[_0x932d('0x15')](function(_0x5c4f74){_0x9e85e9[_0x932d('0xb')]=_0x5c4f74['count'];_0x5c126a=_0x5c4f74[_0x932d('0x21')];return _0x5c126a[_0x932d('0x24')](function(_0x22d270){var _0x252f7f=_[_0x932d('0x38')](_0x41e92e,['id',_0x22d270['id']]);if(_0x252f7f){var _0x4fa1bd=rta[_0x932d('0x39')](_0x252f7f);_[_0x932d('0x32')](_0x22d270,_0x4fa1bd);}_0x22d270['globalStatus']=rta['getAgentStatus'](_0x22d270);if(_0x22d270['globalStatus'][_0x932d('0x3a')](_0x932d('0x13'))){_0x3298fd[_0x932d('0x3b')](function(_0x1bbeaf){if(_0x22d270[_0x1bbeaf+_0x932d('0x30')]){if(_0x1bbeaf==='voice'){if(_0x22d270[_0x932d('0x3c')]!==_0x932d('0x3d')){_0x22d270[_0x932d('0x3c')]=_0x932d('0x13');}}else{_0x22d270[_0x1bbeaf+'Status']=_0x932d('0x13');}}});}return _0x22d270;});})[_0x932d('0x15')](function(_0xdaf20){if(!_0xfa3652||_0x1beae0){return _0xdaf20;}return rta[_0x932d('0x3e')](_0xdaf20,_0xfa3652);})[_0x932d('0x15')](function(_0x832de3){var _0x3a835d=rta[_0x932d('0x3f')]();_0x9e85e9[_0x932d('0x21')]=_0x832de3[_0x932d('0x24')](function(_0x495635){return _[_0x932d('0x40')](_0x495635,_0x3a835d);});return _0x9e85e9;})[_0x932d('0x15')](respondWithFilteredResult(_0x41fa59,_0x102e3a))['catch'](APIHandleError(_0x41fa59));};exports[_0x932d('0x41')]=function(_0x41a6ee,_0x460414){var _0xd42d28={'count':0x0,'rows':[]};var _0x528a74={};var _0x3a69dc;var _0x26a1c5;var _0x395254;Promise[_0x932d('0x14')]()[_0x932d('0x15')](function(){if(_0x41a6ee[_0x932d('0x11')][_0x932d('0x16')]){if(!utils[_0x932d('0x42')](_0x41a6ee[_0x932d('0x11')][_0x932d('0x16')])){throw new APIBadRequestError(util[_0x932d('0x17')](_0x932d('0x18'),_0x41a6ee[_0x932d('0x11')][_0x932d('0x16')]));}_0x3a69dc=_0x41a6ee[_0x932d('0x11')][_0x932d('0x16')][_0x932d('0x19')]();}var _0x6d2100=_['startCase'](_0x3a69dc)+_0x932d('0x43');var _0x2e3f15=_[_0x932d('0x24')](db[_0x6d2100][_0x932d('0x26')],function(_0x1cf59d){return{'name':_0x1cf59d[_0x932d('0x44')],'type':_0x1cf59d[_0x932d('0x27')][_0x932d('0x28')]};});if(!_0x41a6ee['query'][_0x932d('0x45')]){var _0x13b30f=['id',_0x932d('0x46')];if(_0x3a69dc===_0x932d('0x47')){_0x13b30f[_0x932d('0x2d')](_0x932d('0x27'));if(_0x41a6ee[_0x932d('0x11')][_0x932d('0x27')]===_0x932d('0x48')){_0x13b30f[_0x932d('0x2d')]([_0x932d('0x49'),_0x932d('0x4a')]);}}_0x41a6ee[_0x932d('0x11')][_0x932d('0x45')]=_0x13b30f[_0x932d('0x1e')](',');}_0x528a74=qs[_0x932d('0x2b')](_0x2e3f15,_0x41a6ee);if(_0x41a6ee[_0x932d('0x33')][_0x932d('0x29')]==='user'){var _0xe89cb5={'params':{'id':_0x41a6ee[_0x932d('0x33')][_0x932d('0x4b')]},'query':{'section':_0x3a69dc===_0x932d('0x47')&&_0x41a6ee['query'][_0x932d('0x27')]===_0x932d('0x48')?_0x932d('0x4c'):_['startCase'](_0x3a69dc)+_0x932d('0x4d'),'type':_0x41a6ee[_0x932d('0x11')]['type'],'nolimit':!![],'sort':'name','filter':_0x41a6ee[_0x932d('0x11')][_0x932d('0x4e')]}};_0xe89cb5['query']=Object[_0x932d('0x4f')](_0xe89cb5['query'],_0x41a6ee[_0x932d('0x11')]);delete _0xe89cb5['query']['id'];return db['UserProfile'][_0x932d('0x50')](_0xe89cb5);}return db[_0x6d2100][_0x932d('0x37')](_0x528a74);})['then'](function(_0xaa199f){_0xd42d28[_0x932d('0xb')]=_0xaa199f[_0x932d('0xb')];_0x26a1c5=_0xaa199f[_0x932d('0x21')];return rtq[_0x932d('0x51')](_0x41a6ee,_0x3a69dc);})['then'](function(_0x4757a1){_0x395254=_0x4757a1['rows'];return rtq[_0x932d('0x52')](_0x26a1c5,_0x395254,_0x3a69dc,_0x41a6ee[_0x932d('0x11')][_0x932d('0x27')]);})[_0x932d('0x15')](function(_0x444111){_0xd42d28[_0x932d('0x21')]=_0x444111;return _0xd42d28;})[_0x932d('0x15')](respondWithFilteredResult(_0x460414,_0x528a74))[_0x932d('0x53')](APIHandleError(_0x460414));}; \ No newline at end of file +var _0xeda4=['limit','count','offset','status','set','Content-Range','json','getAgents','getChannels','query','globalQueueFilter','globalStatusFilter','pauseTypeFilter','pause','resolve','then','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','channel','toLowerCase','sort','includes','globalStatus','validateSortParameter','fields','order','getAgentIdsByQueues','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','length','map','User','rawAttributes','fieldName','type','role','agent','getOptions','raw','push','sequelize','literal','FIELD(id,','forEach','*pause','Pause','where','merge','user','userProfileId','Agents','online','extraQueryConditions','assign','UserProfile','getResources','filterAgentAttributes','getAgentStatus','voice','voiceStatus','talking','Status','sortAgentsByStatus','getRealtimeAgentsQueryFields','pick','catch','Queue','key','name','outbound','dialActive','dialMethod','startCase','Queues','filter','findAndCountAll','lodash','util','../../components/realtime/queues','../../components/parsers/qs','../../config/utils','../../mysqldb','../../errors/api','handleError','undefined'];(function(_0x1240a5,_0x43c02d){var _0x19955b=function(_0x4686dc){while(--_0x4686dc){_0x1240a5['push'](_0x1240a5['shift']());}};_0x19955b(++_0x43c02d);}(_0xeda4,0xa5));var _0x4eda=function(_0x291d3f,_0x3ef99f){_0x291d3f=_0x291d3f-0x0;var _0x242080=_0xeda4[_0x291d3f];return _0x242080;};'use strict';var _=require(_0x4eda('0x0'));var util=require(_0x4eda('0x1'));var rta=require('../../components/realtime/agents');var rtq=require(_0x4eda('0x2'));var qs=require(_0x4eda('0x3'));var utils=require(_0x4eda('0x4'));var db=require(_0x4eda('0x5'))['db'];var APIBadRequestError=require(_0x4eda('0x6'))['APIBadRequestError'];var APIHandleError=require(_0x4eda('0x6'))[_0x4eda('0x7')];function respondWithFilteredResult(_0xb112fc,_0x1248a3){return function(_0x180872){if(_0x180872){var _0xe024f4=typeof _0x1248a3['offset']===_0x4eda('0x8')&&typeof _0x1248a3[_0x4eda('0x9')]===_0x4eda('0x8');var _0x57d161=_0x180872[_0x4eda('0xa')];var _0x1c465f=_0xe024f4?0x0:_0x1248a3[_0x4eda('0xb')];var _0x51ed1f=_0xe024f4?_0x180872['count']:_0x1248a3[_0x4eda('0xb')]+_0x1248a3[_0x4eda('0x9')];var _0x393d47;if(_0x51ed1f>=_0x57d161){_0x51ed1f=_0x57d161;_0x393d47=0xc8;}else{_0x393d47=0xce;}_0xb112fc[_0x4eda('0xc')](_0x393d47);return _0xb112fc[_0x4eda('0xd')](_0x4eda('0xe'),_0x1c465f+'-'+_0x51ed1f+'/'+_0x57d161)[_0x4eda('0xf')](_0x180872);}return null;};}exports[_0x4eda('0x10')]=function(_0x43eb68,_0x2cfadf){var _0xbc13={'count':0x0,'rows':[]};var _0x321004={};var _0x29952f;var _0x5294f6=utils[_0x4eda('0x11')]();var _0x35fdb6;var _0x5d6a75;var _0x4c7281=_0x43eb68[_0x4eda('0x12')][_0x4eda('0x13')];var _0x28dc84=_0x43eb68[_0x4eda('0x12')][_0x4eda('0x14')];var _0x490e7a=_0x43eb68[_0x4eda('0x12')][_0x4eda('0x15')];var _0x447b43=_0x28dc84===_0x4eda('0x16')||_0x28dc84==='*pause'?!![]:![];var _0x41b367=[];var _0x1479a5;var _0x12ffb6;Promise[_0x4eda('0x17')]()[_0x4eda('0x18')](function(){if(_0x43eb68['query']['channel']){if(!utils[_0x4eda('0x19')](_0x43eb68[_0x4eda('0x12')]['channel'])){throw new APIBadRequestError(util[_0x4eda('0x1a')](_0x4eda('0x1b'),_0x43eb68[_0x4eda('0x12')][_0x4eda('0x1c')]));}_0x29952f=_0x43eb68['query'][_0x4eda('0x1c')][_0x4eda('0x1d')]();}if(!_0x43eb68[_0x4eda('0x12')][_0x4eda('0x1e')]||!_0x43eb68[_0x4eda('0x12')][_0x4eda('0x1e')][_0x4eda('0x1f')](_0x4eda('0x20'))){_0x43eb68[_0x4eda('0x12')][_0x4eda('0x1e')]=rta[_0x4eda('0x21')](_0x43eb68[_0x4eda('0x12')][_0x4eda('0x1e')]);return;}var _0x7c646=rta['getUpdatedSortOptions'](_0x43eb68['query'][_0x4eda('0x1e')]);_0x43eb68[_0x4eda('0x12')][_0x4eda('0x1e')]=_0x7c646[_0x4eda('0x22')]['join'](',');_0x1479a5=_0x7c646[_0x4eda('0x23')];})[_0x4eda('0x18')](function(){if(!_0x4c7281){return[];}return rta[_0x4eda('0x24')](_0x4c7281,_0x29952f);})[_0x4eda('0x18')](function(_0x54e31e){_0x41b367=_0x54e31e;return rta[_0x4eda('0x25')]();})[_0x4eda('0x18')](function(_0x35bdf6){_0x5d6a75=_0x35bdf6[_0x4eda('0x26')];if((!_0x28dc84||_0x447b43)&&!_0x1479a5){return _0x41b367;}if(_0x1479a5&&!_0x28dc84){return rta[_0x4eda('0x27')](_0x5d6a75,_0x41b367,_0x1479a5);}else{return rta['getAgentIdsByStatus'](_0x5d6a75,_0x41b367,_0x28dc84);}})['then'](function(_0x1f0ce3){_0x41b367=_0x1f0ce3;var _0x5694eb=![];if(_0x41b367[_0x4eda('0x28')]===0x0){if(_0x4c7281||_0x28dc84){_0x5694eb=!![];}if(_0x447b43){_0x5694eb=![];}}if(_0x5694eb){return _0xbc13;}var _0x575c73=_[_0x4eda('0x29')](db[_0x4eda('0x2a')][_0x4eda('0x2b')],function(_0x3b480c){return{'name':_0x3b480c[_0x4eda('0x2c')],'type':_0x3b480c[_0x4eda('0x2d')]['key']};});_0x43eb68[_0x4eda('0x12')][_0x4eda('0x2e')]=_0x4eda('0x2f');_0x321004=qs[_0x4eda('0x30')](_0x575c73,_0x43eb68);_0x321004[_0x4eda('0x31')]=!![];var _0x1e69c3=[];if(_0x41b367[_0x4eda('0x28')]>0x0){_0x1e69c3[_0x4eda('0x32')]({'id':{'$in':_0x41b367}});if(_0x1479a5&&!_0x28dc84){_0x12ffb6=[db[_0x4eda('0x33')][_0x4eda('0x34')](_0x4eda('0x35')+_0x41b367+')')];_0x321004[_0x4eda('0x23')]=_0x12ffb6;}}if(_0x447b43){_0x5294f6[_0x4eda('0x36')](function(_0x543aa9){var _0xd273b3=!![];if(_0x28dc84===_0x4eda('0x37')&&_0x29952f!==_0x543aa9){_0xd273b3=![];}_0x1e69c3[_0x4eda('0x32')]({[_0x543aa9+_0x4eda('0x38')]:_0xd273b3});});if(_0x490e7a){_0x1e69c3[_0x4eda('0x32')]({'pauseType':_0x490e7a});}}else if(_0x28dc84){_0x5294f6['forEach'](function(_0x15ab22){_0x1e69c3[_0x4eda('0x32')]({[_0x15ab22+_0x4eda('0x38')]:![]});});}_0x321004[_0x4eda('0x39')]=_[_0x4eda('0x3a')](_0x321004[_0x4eda('0x39')],{'$and':_0x1e69c3});if(_0x43eb68[_0x4eda('0x3b')][_0x4eda('0x2e')]===_0x4eda('0x3b')){var _0x19782c={'params':{'id':_0x43eb68['user'][_0x4eda('0x3c')]},'query':{'section':_0x4eda('0x3d'),'role':_0x4eda('0x2f'),'raw':!![],'ids':_0x41b367,'customSorting':_0x12ffb6}};if(_0x43eb68[_0x4eda('0x12')][_0x4eda('0x3e')]){_0x19782c[_0x4eda('0x12')]['online']=!![];}if(_0x447b43){_0x19782c[_0x4eda('0x12')][_0x4eda('0x3f')]=_0x1e69c3;}_0x19782c['query']=Object[_0x4eda('0x40')](_0x19782c[_0x4eda('0x12')],_0x43eb68[_0x4eda('0x12')]);return db[_0x4eda('0x41')][_0x4eda('0x42')](_0x19782c);}return db['User']['findAndCountAll'](_0x321004);})['then'](function(_0x49901c){_0xbc13[_0x4eda('0xa')]=_0x49901c[_0x4eda('0xa')];_0x35fdb6=_0x49901c[_0x4eda('0x26')];return _0x35fdb6['map'](function(_0x22b89f){var _0x3bf8be=_['find'](_0x5d6a75,['id',_0x22b89f['id']]);if(_0x3bf8be){var _0x406d2e=rta[_0x4eda('0x43')](_0x3bf8be);_[_0x4eda('0x3a')](_0x22b89f,_0x406d2e);}_0x22b89f[_0x4eda('0x20')]=rta[_0x4eda('0x44')](_0x22b89f);if(_0x22b89f['globalStatus']['includes']('pause')){_0x5294f6[_0x4eda('0x36')](function(_0x506674){if(_0x22b89f[_0x506674+_0x4eda('0x38')]){if(_0x506674===_0x4eda('0x45')){if(_0x22b89f[_0x4eda('0x46')]!==_0x4eda('0x47')){_0x22b89f[_0x4eda('0x46')]=_0x4eda('0x16');}}else{_0x22b89f[_0x506674+_0x4eda('0x48')]='pause';}}});}return _0x22b89f;});})[_0x4eda('0x18')](function(_0x501b2a){if(!_0x1479a5||_0x12ffb6){return _0x501b2a;}return rta[_0x4eda('0x49')](_0x501b2a,_0x1479a5);})[_0x4eda('0x18')](function(_0x3a86c9){var _0x3ef17d=rta[_0x4eda('0x4a')]();_0xbc13['rows']=_0x3a86c9[_0x4eda('0x29')](function(_0xbd637c){return _[_0x4eda('0x4b')](_0xbd637c,_0x3ef17d);});return _0xbc13;})[_0x4eda('0x18')](respondWithFilteredResult(_0x2cfadf,_0x321004))[_0x4eda('0x4c')](APIHandleError(_0x2cfadf));};exports['getQueues']=function(_0x20f517,_0xbe5129){var _0x9167bb={'count':0x0,'rows':[]};var _0x84465d={};var _0xdd67d2;var _0x363b52;var _0x1ce425;Promise[_0x4eda('0x17')]()[_0x4eda('0x18')](function(){if(_0x20f517[_0x4eda('0x12')][_0x4eda('0x1c')]){if(!utils[_0x4eda('0x19')](_0x20f517['query']['channel'])){throw new APIBadRequestError(util['format']('Channel\x20parameter\x20%s\x20is\x20invalid',_0x20f517['query'][_0x4eda('0x1c')]));}_0xdd67d2=_0x20f517[_0x4eda('0x12')][_0x4eda('0x1c')]['toLowerCase']();}var _0x102634=_['startCase'](_0xdd67d2)+_0x4eda('0x4d');var _0x1f2735=_[_0x4eda('0x29')](db[_0x102634][_0x4eda('0x2b')],function(_0x4d8f38){return{'name':_0x4d8f38['fieldName'],'type':_0x4d8f38['type'][_0x4eda('0x4e')]};});if(!_0x20f517['query'][_0x4eda('0x22')]){var _0x2586ae=['id',_0x4eda('0x4f')];if(_0xdd67d2===_0x4eda('0x45')){_0x2586ae[_0x4eda('0x32')](_0x4eda('0x2d'));if(_0x20f517['query'][_0x4eda('0x2d')]===_0x4eda('0x50')){_0x2586ae['push']([_0x4eda('0x51'),_0x4eda('0x52')]);}}_0x20f517[_0x4eda('0x12')][_0x4eda('0x22')]=_0x2586ae['join'](',');}_0x84465d=qs[_0x4eda('0x30')](_0x1f2735,_0x20f517);if(_0x20f517[_0x4eda('0x3b')][_0x4eda('0x2e')]==='user'){var _0x48d1e9={'params':{'id':_0x20f517[_0x4eda('0x3b')][_0x4eda('0x3c')]},'query':{'section':_0xdd67d2===_0x4eda('0x45')&&_0x20f517['query'][_0x4eda('0x2d')]===_0x4eda('0x50')?'QueueCampaigns':_[_0x4eda('0x53')](_0xdd67d2)+_0x4eda('0x54'),'type':_0x20f517[_0x4eda('0x12')]['type'],'nolimit':!![],'sort':_0x4eda('0x4f'),'filter':_0x20f517[_0x4eda('0x12')][_0x4eda('0x55')]}};_0x48d1e9[_0x4eda('0x12')]=Object['assign'](_0x48d1e9[_0x4eda('0x12')],_0x20f517['query']);delete _0x48d1e9['query']['id'];return db[_0x4eda('0x41')][_0x4eda('0x42')](_0x48d1e9);}return db[_0x102634][_0x4eda('0x56')](_0x84465d);})[_0x4eda('0x18')](function(_0xa99b84){_0x9167bb[_0x4eda('0xa')]=_0xa99b84[_0x4eda('0xa')];_0x363b52=_0xa99b84[_0x4eda('0x26')];return rtq['getRealtimeQueues'](_0x20f517,_0xdd67d2);})['then'](function(_0x1aabdc){_0x1ce425=_0x1aabdc['rows'];return rtq['initializeQueues'](_0x363b52,_0x1ce425,_0xdd67d2,_0x20f517[_0x4eda('0x12')]['type']);})['then'](function(_0x242b43){_0x9167bb[_0x4eda('0x26')]=_0x242b43;return _0x9167bb;})[_0x4eda('0x18')](respondWithFilteredResult(_0xbe5129,_0x84465d))['catch'](APIHandleError(_0xbe5129));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index e1394f1..2f2eb08 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x3cb0e6,_0x1a5ba4){var _0x585d95=function(_0x187262){while(--_0x187262){_0x3cb0e6['push'](_0x3cb0e6['shift']());}};_0x585d95(++_0x1a5ba4);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x34df4a,_0x209d10){_0x34df4a=_0x34df4a-0x0;var _0x145c69=_0xcb91[_0x34df4a];return _0x145c69;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x508d43,_0x11ac44){var _0x38336d=function(_0x537248){while(--_0x537248){_0x508d43['push'](_0x508d43['shift']());}};_0x38336d(++_0x11ac44);}(_0xedd9,0xfc));var _0x9edd=function(_0x2b9ebe,_0x44aa6b){_0x2b9ebe=_0x2b9ebe-0x0;var _0x558677=_0xedd9[_0x2b9ebe];return _0x558677;};'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 e12058e..9e53726 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 _0x1354=['exports','INTEGER','STRING','DATE','sequelize'];(function(_0x15ec78,_0x1e3a18){var _0x191f90=function(_0x11e616){while(--_0x11e616){_0x15ec78['push'](_0x15ec78['shift']());}};_0x191f90(++_0x1e3a18);}(_0x1354,0x95));var _0x4135=function(_0x31282b,_0xa476db){_0x31282b=_0x31282b-0x0;var _0x19c632=_0x1354[_0x31282b];return _0x19c632;};'use strict';var Sequelize=require(_0x4135('0x0'));module[_0x4135('0x1')]={'state':{'type':Sequelize[_0x4135('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x4135('0x3')]},'scheduledat':{'type':Sequelize[_0x4135('0x4')]},'uniqueid':{'type':Sequelize[_0x4135('0x3')]},'starttime':{'type':Sequelize[_0x4135('0x4')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x4135('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x4135('0x3')]},'campaigntype':{'type':Sequelize[_0x4135('0x3')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xee8f=['DATE','exports','STRING'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xee8f,0x1ed));var _0xfee8=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xee8f[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require('sequelize');module[_0xfee8('0x0')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xfee8('0x1')]},'scheduledat':{'type':Sequelize[_0xfee8('0x2')]},'uniqueid':{'type':Sequelize[_0xfee8('0x1')]},'starttime':{'type':Sequelize[_0xfee8('0x2')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xfee8('0x1')]},'membername':{'type':Sequelize[_0xfee8('0x1')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index b643511..d5d1c4b 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 _0x1b32=['exports','define','ReportAgentPreview','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes'];(function(_0x265176,_0x4d21dc){var _0x173fac=function(_0x415521){while(--_0x415521){_0x265176['push'](_0x265176['shift']());}};_0x173fac(++_0x4d21dc);}(_0x1b32,0x85));var _0x21b3=function(_0x4a3898,_0x4c9853){_0x4a3898=_0x4a3898-0x0;var _0x25ceb0=_0x1b32[_0x4a3898];return _0x25ceb0;};'use strict';var _=require('lodash');var util=require(_0x21b3('0x0'));var logger=require(_0x21b3('0x1'))(_0x21b3('0x2'));var moment=require(_0x21b3('0x3'));var BPromise=require(_0x21b3('0x4'));var rp=require(_0x21b3('0x5'));var fs=require('fs');var path=require(_0x21b3('0x6'));var rimraf=require(_0x21b3('0x7'));var config=require(_0x21b3('0x8'));var attributes=require(_0x21b3('0x9'));module[_0x21b3('0xa')]=function(_0x403803,_0x37859f){return _0x403803[_0x21b3('0xb')](_0x21b3('0xc'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x715c=['moment','request-promise','path','rimraf','./reportAgentPreview.attributes','exports','define','util','../../config/logger','api'];(function(_0x53174f,_0x986a3b){var _0x1cbd1c=function(_0x5bbcb1){while(--_0x5bbcb1){_0x53174f['push'](_0x53174f['shift']());}};_0x1cbd1c(++_0x986a3b);}(_0x715c,0x1c9));var _0xc715=function(_0x311468,_0x451a2b){_0x311468=_0x311468-0x0;var _0x415c4b=_0x715c[_0x311468];return _0x415c4b;};'use strict';var _=require('lodash');var util=require(_0xc715('0x0'));var logger=require(_0xc715('0x1'))(_0xc715('0x2'));var moment=require(_0xc715('0x3'));var BPromise=require('bluebird');var rp=require(_0xc715('0x4'));var fs=require('fs');var path=require(_0xc715('0x5'));var rimraf=require(_0xc715('0x6'));var config=require('../../config/environment');var attributes=require(_0xc715('0x7'));module[_0xc715('0x8')]=function(_0x1700d7,_0x1f2b8c){return _0x1700d7[_0xc715('0x9')]('ReportAgentPreview',attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index d23b529..1f7245d 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 _0xe381=['ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','CreateReportAgentPreview','ReportAgentPreview','create','body','options','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','debug'];(function(_0x46764d,_0x4fab5d){var _0x1eece9=function(_0x53b82c){while(--_0x53b82c){_0x46764d['push'](_0x46764d['shift']());}};_0x1eece9(++_0x4fab5d);}(_0xe381,0x93));var _0x1e38=function(_0x4b7f28,_0x27d23a){_0x4b7f28=_0x4b7f28-0x0;var _0xf5b553=_0xe381[_0x4b7f28];return _0xf5b553;};'use strict';var _=require('lodash');var util=require(_0x1e38('0x0'));var moment=require(_0x1e38('0x1'));var BPromise=require(_0x1e38('0x2'));var rs=require(_0x1e38('0x3'));var fs=require('fs');var Redis=require(_0x1e38('0x4'));var db=require(_0x1e38('0x5'))['db'];var utils=require(_0x1e38('0x6'));var logger=require(_0x1e38('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1e38('0x8'));var client=jayson['client'][_0x1e38('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x341063,_0x1d004e,_0xf5b6f){return new BPromise(function(_0x1d656d,_0x4fc956){return client[_0x1e38('0xa')](_0x341063,_0xf5b6f)[_0x1e38('0xb')](function(_0x296030){logger[_0x1e38('0xc')](_0x1e38('0xd'),_0x1d004e,'request\x20sent');logger[_0x1e38('0xe')](_0x1e38('0xf'),_0x1d004e,_0x1e38('0x10'),JSON['stringify'](_0x296030));if(_0x296030[_0x1e38('0x11')]){if(_0x296030[_0x1e38('0x11')][_0x1e38('0x12')]===0x1f4){logger[_0x1e38('0x11')](_0x1e38('0xd'),_0x1d004e,_0x296030[_0x1e38('0x11')]['message']);return _0x4fc956(_0x296030['error'][_0x1e38('0x13')]);}logger[_0x1e38('0x11')]('ReportAgentPreview,\x20%s,\x20%s',_0x1d004e,_0x296030[_0x1e38('0x11')][_0x1e38('0x13')]);return _0x1d656d(_0x296030[_0x1e38('0x11')]['message']);}else{logger[_0x1e38('0xc')](_0x1e38('0xd'),_0x1d004e,_0x1e38('0x10'));_0x1d656d(_0x296030[_0x1e38('0x14')][_0x1e38('0x13')]);}})['catch'](function(_0x2010fe){logger[_0x1e38('0x11')]('ReportAgentPreview,\x20%s,\x20%s',_0x1d004e,_0x2010fe);_0x4fc956(_0x2010fe);});});}exports[_0x1e38('0x15')]=function(_0x5c6134){var _0x5047ed=this;return new Promise(function(_0x18246c,_0xd27c7b){return db[_0x1e38('0x16')][_0x1e38('0x17')](_0x5c6134[_0x1e38('0x18')],{'raw':_0x5c6134[_0x1e38('0x19')]?_0x5c6134[_0x1e38('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x1e38('0xb')](function(_0x3686af){logger['info']('CreateReportAgentPreview',_0x5c6134);logger['debug']('CreateReportAgentPreview',_0x5c6134,JSON['stringify'](_0x3686af));_0x18246c(_0x3686af);})[_0x1e38('0x1a')](function(_0xc9fffd){logger[_0x1e38('0x11')](_0x1e38('0x15'),_0xc9fffd[_0x1e38('0x13')],_0x5c6134);_0xd27c7b(_0x5047ed[_0x1e38('0x11')](0x1f4,_0xc9fffd['message']));});});}; \ No newline at end of file +var _0xa468=['rpc','../../config/environment','jayson/promise','then','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ReportAgentPreview,\x20%s,\x20%s','message','info','catch','CreateReportAgentPreview','create','body','options','raw','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x305fbd,_0x1ac19e){var _0xd4469=function(_0x4172ec){while(--_0x4172ec){_0x305fbd['push'](_0x305fbd['shift']());}};_0xd4469(++_0x1ac19e);}(_0xa468,0x1d3));var _0x8a46=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xa468[_0x160c73];return _0xd9302;};'use strict';var _=require(_0x8a46('0x0'));var util=require(_0x8a46('0x1'));var moment=require(_0x8a46('0x2'));var BPromise=require(_0x8a46('0x3'));var rs=require(_0x8a46('0x4'));var fs=require('fs');var Redis=require(_0x8a46('0x5'));var db=require(_0x8a46('0x6'))['db'];var utils=require(_0x8a46('0x7'));var logger=require(_0x8a46('0x8'))(_0x8a46('0x9'));var config=require(_0x8a46('0xa'));var jayson=require(_0x8a46('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4520ce,_0xcbc898,_0x454563){return new BPromise(function(_0x334dfa,_0x45f3ac){return client['request'](_0x4520ce,_0x454563)[_0x8a46('0xc')](function(_0x2ebdb4){logger['info']('ReportAgentPreview,\x20%s,\x20%s',_0xcbc898,'request\x20sent');logger['debug'](_0x8a46('0xd'),_0xcbc898,_0x8a46('0xe'),JSON[_0x8a46('0xf')](_0x2ebdb4));if(_0x2ebdb4[_0x8a46('0x10')]){if(_0x2ebdb4['error'][_0x8a46('0x11')]===0x1f4){logger['error'](_0x8a46('0x12'),_0xcbc898,_0x2ebdb4['error']['message']);return _0x45f3ac(_0x2ebdb4[_0x8a46('0x10')][_0x8a46('0x13')]);}logger[_0x8a46('0x10')](_0x8a46('0x12'),_0xcbc898,_0x2ebdb4['error'][_0x8a46('0x13')]);return _0x334dfa(_0x2ebdb4['error'][_0x8a46('0x13')]);}else{logger[_0x8a46('0x14')](_0x8a46('0x12'),_0xcbc898,_0x8a46('0xe'));_0x334dfa(_0x2ebdb4['result'][_0x8a46('0x13')]);}})[_0x8a46('0x15')](function(_0x437394){logger['error'](_0x8a46('0x12'),_0xcbc898,_0x437394);_0x45f3ac(_0x437394);});});}exports[_0x8a46('0x16')]=function(_0x507c78){var _0x3f0f39=this;return new Promise(function(_0x2530b7,_0x4b3bb2){return db['ReportAgentPreview'][_0x8a46('0x17')](_0x507c78[_0x8a46('0x18')],{'raw':_0x507c78['options']?_0x507c78[_0x8a46('0x19')][_0x8a46('0x1a')]===undefined?!![]:![]:!![]})[_0x8a46('0xc')](function(_0x421d65){logger[_0x8a46('0x14')]('CreateReportAgentPreview',_0x507c78);logger[_0x8a46('0x1b')](_0x8a46('0x16'),_0x507c78,JSON[_0x8a46('0xf')](_0x421d65));_0x2530b7(_0x421d65);})[_0x8a46('0x15')](function(_0x3a9c80){logger['error']('CreateReportAgentPreview',_0x3a9c80['message'],_0x507c78);_0x4b3bb2(_0x3f0f39[_0x8a46('0x10')](0x1f4,_0x3a9c80[_0x8a46('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 9282de9..8aa3024 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 _0xba41=['/voice/channels','voiceChannels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','/openchannel/queues','/sms/queues','smsQueues','/whatsapp/queues','/fax/queues','faxQueues','voiceQueuesPreview','voiceQueuesChannels','/voice/queues/channels/:uniqueid','/voice/queues/:id','showVoiceQueues','/outbound','outbound','/outbound/channels','outboundChannels','/agents','/agents/:id/capacity','agentCapacity','/trunks','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','/fax/queues/waitinginteractions','post','/mail/queues/:id/notify','queueNotify','/mail/queues/:id','chat','/chat/queues/:id','showChatQueues','fax','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','/whatsapp/queues/:id/notify','/sms/queues/:id','showWhatsappQueues','agentNotify','exports','util','path','Router','./rpc.controller','get'];(function(_0x3e18b7,_0x1e6f07){var _0x5ab2e7=function(_0x21bec4){while(--_0x21bec4){_0x3e18b7['push'](_0x3e18b7['shift']());}};_0x5ab2e7(++_0x1e6f07);}(_0xba41,0x154));var _0x1ba4=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0xba41[_0x35885a];return _0xe86249;};'use strict';var multer=require('multer');var util=require(_0x1ba4('0x0'));var path=require(_0x1ba4('0x1'));var express=require('express');var router=express[_0x1ba4('0x2')]();var auth=require('../../components/auth/service');var controller=require(_0x1ba4('0x3'));router[_0x1ba4('0x4')](_0x1ba4('0x5'),auth['isAuthenticated'](),controller[_0x1ba4('0x6')]);router[_0x1ba4('0x4')](_0x1ba4('0x7'),auth[_0x1ba4('0x8')](),controller[_0x1ba4('0x9')]);router[_0x1ba4('0x4')](_0x1ba4('0xa'),auth[_0x1ba4('0x8')](),controller[_0x1ba4('0xb')]);router['get'](_0x1ba4('0xc'),auth[_0x1ba4('0x8')](),controller['voiceQueues']);router['get']('/chat/queues',auth['isAuthenticated'](),controller[_0x1ba4('0xd')]);router[_0x1ba4('0x4')](_0x1ba4('0xe'),auth[_0x1ba4('0x8')](),controller[_0x1ba4('0xf')]);router['get'](_0x1ba4('0x10'),auth[_0x1ba4('0x8')](),controller['mailAccounts']);router[_0x1ba4('0x4')](_0x1ba4('0x11'),auth['isAuthenticated'](),controller['openchannelQueues']);router[_0x1ba4('0x4')](_0x1ba4('0x12'),auth[_0x1ba4('0x8')](),controller[_0x1ba4('0x13')]);router['get'](_0x1ba4('0x14'),auth['isAuthenticated'](),controller['whatsappQueues']);router[_0x1ba4('0x4')](_0x1ba4('0x15'),auth['isAuthenticated'](),controller[_0x1ba4('0x16')]);router['get']('/voice/queues/preview/:id',auth[_0x1ba4('0x8')](),controller[_0x1ba4('0x17')]);router[_0x1ba4('0x4')]('/voice/queues/channels',auth['isAuthenticated'](),controller[_0x1ba4('0x18')]);router[_0x1ba4('0x4')](_0x1ba4('0x19'),auth[_0x1ba4('0x8')](),controller['voiceQueuesChannel']);router['get']('/voice/queues/channels/:uniqueid/hangup',auth[_0x1ba4('0x8')](),controller['voiceQueuesChannelHangup']);router[_0x1ba4('0x4')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x1ba4('0x8')](),controller['voiceQueuesChannelRedirect']);router[_0x1ba4('0x4')](_0x1ba4('0x1a'),auth[_0x1ba4('0x8')](),controller[_0x1ba4('0x1b')]);router['put']('/voice/queues/:id',auth['isAuthenticated'](),controller['updateVoiceQueue']);router['get'](_0x1ba4('0x1c'),auth[_0x1ba4('0x8')](),controller[_0x1ba4('0x1d')]);router['get'](_0x1ba4('0x1e'),auth[_0x1ba4('0x8')](),controller[_0x1ba4('0x1f')]);router[_0x1ba4('0x4')](_0x1ba4('0x20'),auth[_0x1ba4('0x8')](),controller['agents']);router['put'](_0x1ba4('0x21'),auth[_0x1ba4('0x8')](),controller[_0x1ba4('0x22')]);router[_0x1ba4('0x4')]('/telephones',auth[_0x1ba4('0x8')](),controller['telephones']);router[_0x1ba4('0x4')](_0x1ba4('0x23'),auth[_0x1ba4('0x8')](),controller[_0x1ba4('0x24')]);router[_0x1ba4('0x4')](_0x1ba4('0x25'),auth['isAuthenticated'](),controller['campaigns']);router[_0x1ba4('0x4')](_0x1ba4('0x26'),auth[_0x1ba4('0x8')](),controller[_0x1ba4('0x27')]);router[_0x1ba4('0x4')](_0x1ba4('0x28'),auth[_0x1ba4('0x8')](),controller[_0x1ba4('0x29')]);router['get'](_0x1ba4('0x2a'),auth['isAuthenticated'](),controller[_0x1ba4('0x2b')]);router[_0x1ba4('0x4')](_0x1ba4('0x2c'),auth[_0x1ba4('0x8')](),controller[_0x1ba4('0x2d')]);router[_0x1ba4('0x4')](_0x1ba4('0x2e'),auth[_0x1ba4('0x8')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x1ba4('0x4')](_0x1ba4('0x2f'),auth[_0x1ba4('0x8')](),controller[_0x1ba4('0x30')]);router['get'](_0x1ba4('0x31'),auth[_0x1ba4('0x8')](),controller['whatsappQueuesWaitingInteractions']);router['get'](_0x1ba4('0x32'),auth['isAuthenticated'](),controller['faxQueuesWaitingInteractions']);router[_0x1ba4('0x33')](_0x1ba4('0x34'),auth[_0x1ba4('0x8')](),controller[_0x1ba4('0x35')]('mail'));router[_0x1ba4('0x4')](_0x1ba4('0x36'),auth[_0x1ba4('0x8')](),controller['showMailQueues']);router[_0x1ba4('0x33')]('/chat/queues/:id/notify',auth[_0x1ba4('0x8')](),controller[_0x1ba4('0x35')](_0x1ba4('0x37')));router[_0x1ba4('0x4')](_0x1ba4('0x38'),auth[_0x1ba4('0x8')](),controller[_0x1ba4('0x39')]);router[_0x1ba4('0x33')]('/fax/queues/:id/notify',auth[_0x1ba4('0x8')](),controller['queueNotify'](_0x1ba4('0x3a')));router[_0x1ba4('0x4')]('/fax/queues/:id',auth['isAuthenticated'](),controller['showFaxQueues']);router[_0x1ba4('0x33')](_0x1ba4('0x3b'),auth[_0x1ba4('0x8')](),controller[_0x1ba4('0x35')](_0x1ba4('0x3c')));router[_0x1ba4('0x4')](_0x1ba4('0x3d'),auth[_0x1ba4('0x8')](),controller[_0x1ba4('0x3e')]);router[_0x1ba4('0x33')](_0x1ba4('0x3f'),auth[_0x1ba4('0x8')](),controller[_0x1ba4('0x35')]('sms'));router['post'](_0x1ba4('0x40'),auth[_0x1ba4('0x8')](),controller['queueNotify']('whatsapp'));router[_0x1ba4('0x4')](_0x1ba4('0x41'),auth['isAuthenticated'](),controller['showSmsQueues']);router[_0x1ba4('0x4')]('/whatsapp/queues/:id',auth[_0x1ba4('0x8')](),controller[_0x1ba4('0x42')]);router[_0x1ba4('0x33')]('/agents/:id/notify',auth[_0x1ba4('0x8')](),controller[_0x1ba4('0x43')]);module[_0x1ba4('0x44')]=router; \ No newline at end of file +var _0xaf88=['outbound','/outbound/channels','agents','put','/agents/:id/capacity','agentCapacity','/telephones','telephones','trunks','/campaigns','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','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','showOpenchannelQueues','/sms/queues/:id/notify','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','showWhatsappQueues','agentNotify','exports','multer','util','path','express','Router','../../components/auth/service','/voice/channels','isAuthenticated','voiceChannels','voiceChannelMixMonitor','get','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','updateVoiceQueue'];(function(_0x3592d1,_0x41c43a){var _0x326a80=function(_0x5c4f7f){while(--_0x5c4f7f){_0x3592d1['push'](_0x3592d1['shift']());}};_0x326a80(++_0x41c43a);}(_0xaf88,0x141));var _0x8af8=function(_0x2d141e,_0x3097c6){_0x2d141e=_0x2d141e-0x0;var _0x486401=_0xaf88[_0x2d141e];return _0x486401;};'use strict';var multer=require(_0x8af8('0x0'));var util=require(_0x8af8('0x1'));var path=require(_0x8af8('0x2'));var express=require(_0x8af8('0x3'));var router=express[_0x8af8('0x4')]();var auth=require(_0x8af8('0x5'));var controller=require('./rpc.controller');router['get'](_0x8af8('0x6'),auth[_0x8af8('0x7')](),controller[_0x8af8('0x8')]);router['get']('/voice/channels/:uniqueid/mixmonitor',auth['isAuthenticated'](),controller[_0x8af8('0x9')]);router[_0x8af8('0xa')](_0x8af8('0xb'),auth[_0x8af8('0x7')](),controller[_0x8af8('0xc')]);router[_0x8af8('0xa')](_0x8af8('0xd'),auth['isAuthenticated'](),controller[_0x8af8('0xe')]);router[_0x8af8('0xa')](_0x8af8('0xf'),auth['isAuthenticated'](),controller[_0x8af8('0x10')]);router['get'](_0x8af8('0x11'),auth[_0x8af8('0x7')](),controller[_0x8af8('0x12')]);router[_0x8af8('0xa')](_0x8af8('0x13'),auth[_0x8af8('0x7')](),controller[_0x8af8('0x14')]);router[_0x8af8('0xa')](_0x8af8('0x15'),auth[_0x8af8('0x7')](),controller[_0x8af8('0x16')]);router['get']('/sms/queues',auth[_0x8af8('0x7')](),controller[_0x8af8('0x17')]);router[_0x8af8('0xa')](_0x8af8('0x18'),auth['isAuthenticated'](),controller[_0x8af8('0x19')]);router[_0x8af8('0xa')](_0x8af8('0x1a'),auth[_0x8af8('0x7')](),controller[_0x8af8('0x1b')]);router['get'](_0x8af8('0x1c'),auth['isAuthenticated'](),controller[_0x8af8('0x1d')]);router[_0x8af8('0xa')]('/voice/queues/channels',auth['isAuthenticated'](),controller[_0x8af8('0x1e')]);router[_0x8af8('0xa')]('/voice/queues/channels/:uniqueid',auth[_0x8af8('0x7')](),controller[_0x8af8('0x1f')]);router['get'](_0x8af8('0x20'),auth['isAuthenticated'](),controller[_0x8af8('0x21')]);router[_0x8af8('0xa')](_0x8af8('0x22'),auth[_0x8af8('0x7')](),controller[_0x8af8('0x23')]);router['get'](_0x8af8('0x24'),auth[_0x8af8('0x7')](),controller[_0x8af8('0x25')]);router['put'](_0x8af8('0x24'),auth[_0x8af8('0x7')](),controller[_0x8af8('0x26')]);router['get']('/outbound',auth[_0x8af8('0x7')](),controller[_0x8af8('0x27')]);router[_0x8af8('0xa')](_0x8af8('0x28'),auth['isAuthenticated'](),controller['outboundChannels']);router[_0x8af8('0xa')]('/agents',auth[_0x8af8('0x7')](),controller[_0x8af8('0x29')]);router[_0x8af8('0x2a')](_0x8af8('0x2b'),auth[_0x8af8('0x7')](),controller[_0x8af8('0x2c')]);router['get'](_0x8af8('0x2d'),auth[_0x8af8('0x7')](),controller[_0x8af8('0x2e')]);router[_0x8af8('0xa')]('/trunks',auth[_0x8af8('0x7')](),controller[_0x8af8('0x2f')]);router[_0x8af8('0xa')](_0x8af8('0x30'),auth[_0x8af8('0x7')](),controller[_0x8af8('0x31')]);router[_0x8af8('0xa')](_0x8af8('0x32'),auth[_0x8af8('0x7')](),controller[_0x8af8('0x33')]);router[_0x8af8('0xa')](_0x8af8('0x34'),auth[_0x8af8('0x7')](),controller[_0x8af8('0x35')]);router[_0x8af8('0xa')](_0x8af8('0x36'),auth[_0x8af8('0x7')](),controller[_0x8af8('0x37')]);router['get'](_0x8af8('0x38'),auth['isAuthenticated'](),controller[_0x8af8('0x39')]);router[_0x8af8('0xa')](_0x8af8('0x3a'),auth[_0x8af8('0x7')](),controller['openchannelQueuesIdWaitingInteractions']);router['get'](_0x8af8('0x3b'),auth[_0x8af8('0x7')](),controller[_0x8af8('0x3c')]);router[_0x8af8('0xa')](_0x8af8('0x3d'),auth[_0x8af8('0x7')](),controller[_0x8af8('0x3e')]);router[_0x8af8('0xa')](_0x8af8('0x3f'),auth[_0x8af8('0x7')](),controller[_0x8af8('0x40')]);router[_0x8af8('0x41')](_0x8af8('0x42'),auth[_0x8af8('0x7')](),controller[_0x8af8('0x43')](_0x8af8('0x44')));router['get'](_0x8af8('0x45'),auth[_0x8af8('0x7')](),controller[_0x8af8('0x46')]);router[_0x8af8('0x41')](_0x8af8('0x47'),auth['isAuthenticated'](),controller[_0x8af8('0x43')](_0x8af8('0x48')));router[_0x8af8('0xa')](_0x8af8('0x49'),auth[_0x8af8('0x7')](),controller[_0x8af8('0x4a')]);router['post'](_0x8af8('0x4b'),auth[_0x8af8('0x7')](),controller[_0x8af8('0x43')](_0x8af8('0x4c')));router[_0x8af8('0xa')](_0x8af8('0x4d'),auth[_0x8af8('0x7')](),controller[_0x8af8('0x4e')]);router[_0x8af8('0x41')](_0x8af8('0x4f'),auth[_0x8af8('0x7')](),controller[_0x8af8('0x43')](_0x8af8('0x50')));router[_0x8af8('0xa')]('/openchannel/queues/:id',auth[_0x8af8('0x7')](),controller[_0x8af8('0x51')]);router['post'](_0x8af8('0x52'),auth[_0x8af8('0x7')](),controller['queueNotify']('sms'));router[_0x8af8('0x41')](_0x8af8('0x53'),auth['isAuthenticated'](),controller[_0x8af8('0x43')](_0x8af8('0x54')));router[_0x8af8('0xa')](_0x8af8('0x55'),auth['isAuthenticated'](),controller[_0x8af8('0x56')]);router['get']('/whatsapp/queues/:id',auth['isAuthenticated'](),controller[_0x8af8('0x57')]);router[_0x8af8('0x41')]('/agents/:id/notify',auth[_0x8af8('0x7')](),controller[_0x8af8('0x58')]);module[_0x8af8('0x59')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 60a737d..79cd3ec 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 _0xe706=['indexOf','queue_id','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','Website','Queue','\x20Queue\x20not\x20found','Message','findOne','Interaction','Account','update','queue','MessageId','InteractionId','TransferReport','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','chat','User','Agent\x20not\x20found','messageId','\x20Message\x20not\x20found','From','create','Start','agentTransferTimeout','bluebird','moment','lodash','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','result','catch','status','json','name','send','isNil','rows','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','user','hasOwnProperty','MemberReport','findAll','INTERACTION','interaction','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','SIP/%s','interface','agent','internal','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','OpenchannelQueues','showOpenchannelQueues','showSmsQueues','SmsQueues','whatsappQueues','WhatsappQueues','faxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','uniq'];(function(_0x6dfebd,_0x37bcb4){var _0x3bd189=function(_0x5f389c){while(--_0x5f389c){_0x6dfebd['push'](_0x6dfebd['shift']());}};_0x3bd189(++_0x37bcb4);}(_0xe706,0xa3));var _0x6e70=function(_0x4ef1b6,_0x502ac2){_0x4ef1b6=_0x4ef1b6-0x0;var _0x164c1f=_0xe706[_0x4ef1b6];return _0x164c1f;};'use strict';var BPromise=require(_0x6e70('0x0'));var moment=require(_0x6e70('0x1'));var _=require(_0x6e70('0x2'));var util=require('util');var db=require(_0x6e70('0x3'))['db'];var logger=require(_0x6e70('0x4'))(_0x6e70('0x5'));var jayson=require(_0x6e70('0x6'));var amiClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232a});var mailClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232b});var routingClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){var _0x449b48=_0x45a2d4?_0x45a2d4:amiClient;return _0x449b48[_0x6e70('0x9')](_0x36357b,_0x293ce7)[_0x6e70('0xa')](function(_0x100eb7){if(_0x100eb7[_0x6e70('0xb')]){if(_0x100eb7[_0x6e70('0xb')][_0x6e70('0xc')]===0x1f4){return _0x3c4843(_0x100eb7[_0x6e70('0xb')][_0x6e70('0xd')]);}return _0x188ed3(_0x100eb7['error']['message']);}else{_0x188ed3(_0x100eb7[_0x6e70('0xe')]);}})[_0x6e70('0xf')](function(_0x18cf27){_0x3c4843(_0x18cf27);});});}function respondWithResult(_0x27dd9b,_0x3b38f3){_0x3b38f3=_0x3b38f3||0xc8;return function(_0x310eb7){if(_0x310eb7){return _0x27dd9b[_0x6e70('0x10')](_0x3b38f3)[_0x6e70('0x11')](_0x310eb7);}return _0x27dd9b['sendStatus'](0x194);};}function handleError(_0x52737e,_0x48bc72){_0x48bc72=_0x48bc72||0x1f4;return function(_0x257e81){logger['error'](_0x257e81['stack']);if(_0x257e81[_0x6e70('0x12')]){delete _0x257e81[_0x6e70('0x12')];}_0x52737e['status'](_0x48bc72)[_0x6e70('0x13')](_0x257e81);};}function findById(_0x5c3fe7){return function(_0x2efc0f){if(!_[_0x6e70('0x14')](_0x5c3fe7)&&!_['isNil'](_0x2efc0f)&&!_['isNil'](_0x2efc0f[_0x6e70('0x15')])){return _['find'](_0x2efc0f[_0x6e70('0x15')],function(_0x173afe){return _0x173afe['id']==_0x5c3fe7;});}return null;};}exports['voiceChannels']=function(_0x497d61,_0xc238ba){return respondWithRpcPromise(_0x6e70('0x16'),_0x497d61[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0xc238ba,null))[_0x6e70('0xf')](handleError(_0xc238ba,null));};exports[_0x6e70('0x18')]=function(_0x1b2453,_0x44a49f){return respondWithRpcPromise(_0x6e70('0x19'),_[_0x6e70('0x1a')](_0x1b2453['query'],_0x1b2453[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x44a49f,null))[_0x6e70('0xf')](handleError(_0x44a49f,null));};exports['voiceChannelStopMixMonitor']=function(_0x3ccd87,_0xa5d49){return respondWithRpcPromise(_0x6e70('0x1c'),_['merge'](_0x3ccd87[_0x6e70('0x17')],_0x3ccd87['params']))['then'](respondWithResult(_0xa5d49,null))['catch'](handleError(_0xa5d49,null));};exports[_0x6e70('0x1d')]=function(_0x19c5ae,_0x51d292){return respondWithRpcPromise(_0x6e70('0x1e'),_0x19c5ae[_0x6e70('0x17')])['then'](respondWithResult(_0x51d292,null))[_0x6e70('0xf')](handleError(_0x51d292,null));};exports[_0x6e70('0x1f')]=function(_0x2bb231,_0x4a67ac){return respondWithRpcPromise('VoiceQueues',_0x2bb231[_0x6e70('0x17')])[_0x6e70('0xa')](findById(_0x2bb231[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x4a67ac,null))[_0x6e70('0xf')](handleError(_0x4a67ac,null));};exports['updateVoiceQueue']=function(_0x1952ea,_0x406f29){return respondWithRpcPromise(_0x6e70('0x20'),_[_0x6e70('0x1a')](_0x1952ea[_0x6e70('0x21')],_0x1952ea[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x406f29,null))[_0x6e70('0xf')](handleError(_0x406f29,null));};exports[_0x6e70('0x22')]=function(_0x3a5d30,_0x4b1229){return respondWithRpcPromise(_0x6e70('0x23'),_['merge'](_0x3a5d30[_0x6e70('0x17')],_0x3a5d30['params']))[_0x6e70('0xa')](respondWithResult(_0x4b1229,null))[_0x6e70('0xf')](handleError(_0x4b1229,null));};exports[_0x6e70('0x24')]=function(_0x56f6f7,_0x38c40d){return respondWithRpcPromise(_0x6e70('0x25'),_0x56f6f7['query'])[_0x6e70('0xa')](respondWithResult(_0x38c40d,null))[_0x6e70('0xf')](handleError(_0x38c40d,null));};exports['voiceQueuesChannel']=function(_0x10d8f6,_0x3665a1){return respondWithRpcPromise(_0x6e70('0x26'),_[_0x6e70('0x1a')](_0x10d8f6[_0x6e70('0x17')],_0x10d8f6[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x3665a1,null))[_0x6e70('0xf')](handleError(_0x3665a1,null));};exports[_0x6e70('0x27')]=function(_0x419a41,_0x4d32d8){return respondWithRpcPromise(_0x6e70('0x28'),_['merge'](_0x419a41[_0x6e70('0x17')],_0x419a41[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x4d32d8,null))[_0x6e70('0xf')](handleError(_0x4d32d8,null));};exports[_0x6e70('0x29')]=function(_0x989b80,_0x2440be){return respondWithRpcPromise(_0x6e70('0x2a'),_[_0x6e70('0x1a')](_0x989b80[_0x6e70('0x17')],_0x989b80[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x2440be,null))[_0x6e70('0xf')](handleError(_0x2440be,null));};exports['outbound']=function(_0x5446a2,_0x5424eb){return respondWithRpcPromise(_0x6e70('0x2b'),_0x5446a2[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x5424eb,null))[_0x6e70('0xf')](handleError(_0x5424eb,null));};exports[_0x6e70('0x2c')]=function(_0x3bdd87,_0x572a71){return respondWithRpcPromise(_0x6e70('0x2d'),_0x3bdd87[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x572a71,null))[_0x6e70('0xf')](handleError(_0x572a71,null));};exports[_0x6e70('0x2e')]=function(_0x37bf46,_0x246e61){var _0x16fc7d;return respondWithRpcPromise('Agents',_0x37bf46[_0x6e70('0x17')])[_0x6e70('0xa')](function(_0x22fce9){_0x16fc7d=_0x22fce9;return respondWithRpcPromise(_0x6e70('0x2f'),_0x37bf46[_0x6e70('0x17')],routingClient);})[_0x6e70('0xa')](function(_0x21b0e7){return _['merge']({},_0x21b0e7,_0x16fc7d);})['then'](respondWithResult(_0x246e61,null))['catch'](handleError(_0x246e61,null));};exports[_0x6e70('0x30')]=function(_0x2b63cc,_0x83847b){if(_0x2b63cc[_0x6e70('0x21')]&&_0x2b63cc[_0x6e70('0x21')]['interaction']&&_0x2b63cc[_0x6e70('0x31')]&&_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x12')]){for(var _0x52b197 in _0x2b63cc['body']['interaction']){if(_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x6e70('0x32')](_0x52b197)){db[_0x6e70('0x33')][_0x6e70('0x34')]({'where':{'channel':_0x52b197,'membername':_0x2b63cc[_0x6e70('0x31')]['name'],'type':_0x6e70('0x35'),'exitAt':null,'uniqueid':_0x2b63cc['body'][_0x6e70('0x36')][_0x52b197]&&_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x36')][_0x52b197][_0x6e70('0x37')]?{'$notIn':_0x2b63cc['body'][_0x6e70('0x36')][_0x52b197]}:{'$ne':null}}})[_0x6e70('0xa')](function(_0x3d39c3){var _0xac87d6=moment()[_0x6e70('0x38')](_0x6e70('0x39'));for(var _0x3d9c5=0x0,_0x552e7e=_0x3d39c3[_0x6e70('0x37')];_0x3d9c5<_0x552e7e;_0x3d9c5+=0x1){_0x3d39c3[_0x3d9c5][_0x6e70('0x3a')]({'exitAt':_0xac87d6});}});for(var _0x10de2a=0x0;_0x10de2a<_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x36')][_0x52b197][_0x6e70('0x37')];_0x10de2a+=0x1){db[_0x6e70('0x33')]['findOrCreate']({'where':{'channel':_0x52b197,'membername':_0x2b63cc[_0x6e70('0x31')]['name'],'type':_0x6e70('0x35'),'uniqueid':_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x52b197][_0x10de2a],'exitAt':null},'defaults':{'channel':_0x52b197,'membername':_0x2b63cc['user'][_0x6e70('0x12')],'interface':_[_0x6e70('0x14')](_0x2b63cc[_0x6e70('0x31')]['interface'])?util['format'](_0x6e70('0x3b'),_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x12')]):_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x3c')],'type':_0x6e70('0x35'),'enterAt':moment()['format'](_0x6e70('0x39')),'role':_0x6e70('0x3d'),'internal':_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x3e')],'uniqueid':_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x52b197][_0x10de2a]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x2b63cc[_0x6e70('0x1b')]['id'],'capacity':_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x3f')]},routingClient)[_0x6e70('0xa')](respondWithResult(_0x83847b,null))[_0x6e70('0xf')](handleError(_0x83847b,null));};exports['telephones']=function(_0x41bd0b,_0x232366){return respondWithRpcPromise(_0x6e70('0x40'),_0x41bd0b[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x232366,null))['catch'](handleError(_0x232366,null));};exports[_0x6e70('0x41')]=function(_0x1dd242,_0x2c20d3){return respondWithRpcPromise(_0x6e70('0x42'),_0x1dd242[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x2c20d3,null))['catch'](handleError(_0x2c20d3,null));};exports[_0x6e70('0x43')]=function(_0x8d425d,_0x5c2396){return respondWithRpcPromise(_0x6e70('0x44'),_0x8d425d[_0x6e70('0x17')])['then'](respondWithResult(_0x5c2396,null))[_0x6e70('0xf')](handleError(_0x5c2396,null));};exports[_0x6e70('0x45')]=function(_0x2134c4,_0x46d536){return respondWithRpcPromise(_0x6e70('0x46'),_0x2134c4['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x46d536,null))[_0x6e70('0xf')](handleError(_0x46d536,null));};exports[_0x6e70('0x47')]=function(_0x13be81,_0x1c02d7){return respondWithRpcPromise(_0x6e70('0x46'),_0x13be81[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x13be81[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x1c02d7,null))[_0x6e70('0xf')](handleError(_0x1c02d7,null));};exports[_0x6e70('0x48')]=function(_0xb8f78,_0x1fd9a6){return respondWithRpcPromise(_0x6e70('0x49'),_0xb8f78[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x1fd9a6,null))[_0x6e70('0xf')](handleError(_0x1fd9a6,null));};exports[_0x6e70('0x4a')]=function(_0x1c7dca,_0x4c6aab){return respondWithRpcPromise(_0x6e70('0x49'),_0x1c7dca[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x1c7dca[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x4c6aab,null))[_0x6e70('0xf')](handleError(_0x4c6aab,null));};exports['mailAccounts']=function(_0x42bd85,_0x6cabf0){return respondWithRpcPromise('MailAccounts',_0x42bd85[_0x6e70('0x17')],mailClient)[_0x6e70('0xa')](respondWithResult(_0x6cabf0,null))[_0x6e70('0xf')](handleError(_0x6cabf0,null));};exports['openchannelQueues']=function(_0x51f268,_0x2f9be4){return respondWithRpcPromise(_0x6e70('0x4b'),_0x51f268[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x2f9be4,null))[_0x6e70('0xf')](handleError(_0x2f9be4,null));};exports[_0x6e70('0x4c')]=function(_0x30cd88,_0x57bfe5){return respondWithRpcPromise('OpenchannelQueues',_0x30cd88[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x30cd88[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x57bfe5,null))['catch'](handleError(_0x57bfe5,null));};exports['smsQueues']=function(_0x2e972b,_0x4e5545){return respondWithRpcPromise('SmsQueues',_0x2e972b['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x4e5545,null))['catch'](handleError(_0x4e5545,null));};exports[_0x6e70('0x4d')]=function(_0x23900b,_0x3b4da0){return respondWithRpcPromise(_0x6e70('0x4e'),_0x23900b[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x23900b[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x3b4da0,null))['catch'](handleError(_0x3b4da0,null));};exports[_0x6e70('0x4f')]=function(_0x6a560f,_0x22c836){return respondWithRpcPromise(_0x6e70('0x50'),_0x6a560f[_0x6e70('0x17')],routingClient)['then'](respondWithResult(_0x22c836,null))['catch'](handleError(_0x22c836,null));};exports['showWhatsappQueues']=function(_0x1bb338,_0xd91b9){return respondWithRpcPromise(_0x6e70('0x50'),_0x1bb338['query'],routingClient)['then'](findById(_0x1bb338[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0xd91b9,null))[_0x6e70('0xf')](handleError(_0xd91b9,null));};exports[_0x6e70('0x51')]=function(_0x2285f1,_0x32b884){return respondWithRpcPromise('FaxQueues',_0x2285f1[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x32b884,null))[_0x6e70('0xf')](handleError(_0x32b884,null));};exports[_0x6e70('0x52')]=function(_0x515c0c,_0xce964b){return respondWithRpcPromise('FaxQueues',_0x515c0c['query'],routingClient)[_0x6e70('0xa')](findById(_0x515c0c[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0xce964b,null))[_0x6e70('0xf')](handleError(_0xce964b,null));};exports[_0x6e70('0x53')]=function(_0x2be0fc,_0x4b5b19){return respondWithRpcPromise(_0x6e70('0x54'),_0x2be0fc[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x4b5b19,null))[_0x6e70('0xf')](handleError(_0x4b5b19,null));};exports[_0x6e70('0x55')]=function(_0x13c092,_0x363722){return respondWithRpcPromise(_0x6e70('0x56'),_0x13c092[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x363722,null))['catch'](handleError(_0x363722,null));};exports[_0x6e70('0x57')]=function(_0x303c5a,_0x577c3b){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x303c5a['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x577c3b,null))[_0x6e70('0xf')](handleError(_0x577c3b,null));};exports[_0x6e70('0x58')]=function(_0x14bb74,_0x5a3dcb){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x14bb74['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x5a3dcb,null))[_0x6e70('0xf')](handleError(_0x5a3dcb,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x58666a,_0x1c7c5f){return respondWithRpcPromise(_0x6e70('0x59'),_0x58666a[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](function(_0x44bf96){if(_0x58666a[_0x6e70('0x17')][_0x6e70('0x5a')]!==undefined){var _0x3650e9=_(_0x44bf96[_0x6e70('0x15')])[_0x6e70('0x5b')]([_0x58666a[_0x6e70('0x17')][_0x6e70('0x5a')],_0x58666a[_0x6e70('0x1b')]['id']])['map']('queue_id')[_0x6e70('0x5c')]()['value']();return _0x44bf96[_0x6e70('0x15')]['filter'](function(_0x5b5471){return _0x3650e9[_0x6e70('0x5d')](_0x5b5471['queue_id'])>-0x1;});}else{return _0x44bf96['rows'][_0x6e70('0x5b')](function(_0x21e4c2){return _0x21e4c2[_0x6e70('0x5e')]===parseInt(_0x58666a['params']['id']);});}})['then'](respondWithResult(_0x1c7c5f,null))['catch'](handleError(_0x1c7c5f,null));};exports[_0x6e70('0x5f')]=function(_0x512b0a,_0x2e8ed3){return respondWithRpcPromise(_0x6e70('0x60'),_0x512b0a[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x2e8ed3,null))[_0x6e70('0xf')](handleError(_0x2e8ed3,null));};exports[_0x6e70('0x61')]=function(_0x214a8f,_0x50046a){return respondWithRpcPromise(_0x6e70('0x62'),_0x214a8f[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x50046a,null))['catch'](handleError(_0x50046a,null));};exports[_0x6e70('0x63')]=function(_0x227d94,_0x11a615){return respondWithRpcPromise(_0x6e70('0x64'),_0x227d94[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x11a615,null))[_0x6e70('0xf')](handleError(_0x11a615,null));};exports[_0x6e70('0x65')]=function(_0x461ec0){return function(_0x48f6fd,_0x463eed){var _0x39e6db,_0x53acc8;var _0x252f07=_[_0x6e70('0x66')](_0x461ec0);var _0x51be27=_0x461ec0==='chat'?_0x6e70('0x67'):'Account';return db[_0x252f07+_0x6e70('0x68')]['findOne']({'raw':!![],'where':{'id':_0x48f6fd[_0x6e70('0x1b')]['id']}})[_0x6e70('0xa')](function(_0x106f32){if(_[_0x6e70('0x14')](_0x106f32)){throw new Error(_0x252f07+_0x6e70('0x69'));}_0x39e6db=_0x106f32;return db[_0x252f07+_0x6e70('0x6a')][_0x6e70('0x6b')]({'where':{'id':_0x48f6fd['body']['messageId']},'include':[{'model':db[_0x252f07+_0x6e70('0x6c')],'as':'Interaction'},{'model':db[_0x252f07+_0x51be27],'as':_0x6e70('0x6d')}]});})[_0x6e70('0xa')](function(_0x28e5b1){if(_[_0x6e70('0x14')](_0x28e5b1)){throw new Error(_0x252f07+'\x20Message\x20not\x20found');}_0x53acc8=_0x28e5b1;return _0x28e5b1[_0x6e70('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x260dfa={'uniqueid':_0x461ec0+'.'+_0x53acc8['id']+'.'+_0x53acc8[_0x6e70('0x6c')]['id'],'FromUserId':_0x48f6fd[_0x6e70('0x31')]['id'],'type':_0x6e70('0x6f')};_0x260dfa[_0x252f07+_0x6e70('0x70')]=_0x53acc8['id'];_0x260dfa[_0x252f07+_0x6e70('0x71')]=_0x53acc8[_0x6e70('0x6c')]['id'];_0x260dfa['From'+_0x252f07+_0x51be27+'Id']=_0x53acc8[_0x6e70('0x6d')]['id'];_0x260dfa['To'+_0x252f07+'QueueId']=_0x39e6db['id'];return db[_0x252f07+_0x6e70('0x72')]['create'](_0x260dfa);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x461ec0,'interaction':_0x53acc8[_0x6e70('0x6c')],'message':_0x53acc8,'account':_0x53acc8[_0x6e70('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':_0x6e70('0x6f'),'appdata':_0x39e6db[_0x6e70('0x12')]+','+(_0x53acc8[_0x6e70('0x6d')]['queueTransferTimeout']||0x12c),'interval':_0x6e70('0x73')}],'transfer':!![]},routingClient);})[_0x6e70('0xa')](respondWithResult(_0x463eed,null))['catch'](handleError(_0x463eed,null));};};exports[_0x6e70('0x74')]=function(_0x50e494,_0x17d3a4){var _0x5d0585,_0x4a87e2;if(_[_0x6e70('0x14')](_0x50e494[_0x6e70('0x21')][_0x6e70('0x75')])){throw new Error(_0x6e70('0x76'));}var _0x3e6661=_0x50e494[_0x6e70('0x21')][_0x6e70('0x75')];var _0x5c0276=_[_0x6e70('0x66')](_0x3e6661);var _0x4f4a16=_0x3e6661===_0x6e70('0x77')?_0x6e70('0x67'):_0x6e70('0x6d');return db[_0x6e70('0x78')][_0x6e70('0x6b')]({'raw':!![],'where':{'id':_0x50e494[_0x6e70('0x1b')]['id'],'role':_0x6e70('0x3d')}})['then'](function(_0x4466f0){if(_['isNil'](_0x4466f0)){throw new Error(_0x6e70('0x79'));}_0x5d0585=_0x4466f0;return db[_0x5c0276+_0x6e70('0x6a')][_0x6e70('0x6b')]({'where':{'id':_0x50e494[_0x6e70('0x21')][_0x6e70('0x7a')]},'include':[{'model':db[_0x5c0276+_0x6e70('0x6c')],'as':_0x6e70('0x6c')},{'model':db[_0x5c0276+_0x4f4a16],'as':_0x6e70('0x6d')}]});})[_0x6e70('0xa')](function(_0x162bc3){if(_['isNil'](_0x162bc3)){throw new Error(_0x5c0276+_0x6e70('0x7b'));}_0x4a87e2=_0x162bc3;return _0x162bc3[_0x6e70('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})[_0x6e70('0xa')](function(){var _0x181802={'uniqueid':_0x3e6661+'.'+_0x4a87e2['id']+'.'+_0x4a87e2[_0x6e70('0x6c')]['id'],'FromUserId':_0x50e494['user']['id'],'type':'agent','ToUserId':_0x5d0585['id']};_0x181802[_0x5c0276+'MessageId']=_0x4a87e2['id'];_0x181802[_0x5c0276+_0x6e70('0x71')]=_0x4a87e2[_0x6e70('0x6c')]['id'];_0x181802[_0x6e70('0x7c')+_0x5c0276+_0x4f4a16+'Id']=_0x4a87e2[_0x6e70('0x6d')]['id'];return db[_0x5c0276+_0x6e70('0x72')][_0x6e70('0x7d')](_0x181802);})[_0x6e70('0xa')](function(){return respondWithRpcPromise(_0x6e70('0x7e'),{'channel':_0x3e6661,'interaction':_0x4a87e2[_0x6e70('0x6c')],'message':_0x4a87e2,'account':_0x4a87e2[_0x6e70('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':_0x6e70('0x3d'),'appdata':_0x5d0585[_0x6e70('0x12')]+','+(_0x4a87e2[_0x6e70('0x6d')][_0x6e70('0x7f')]||0x12c),'interval':_0x6e70('0x73')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x17d3a4,null))[_0x6e70('0xf')](handleError(_0x17d3a4,null));}; \ No newline at end of file +var _0xa9e0=['mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','filter','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','chat','Website','Account','findOne','\x20Queue\x20not\x20found','Message','Interaction','\x20Message\x20not\x20found','MessageId','InteractionId','From','QueueId','create','Start','queue','queueTransferTimeout','*,*,*,*','agentNotify','Channel\x20field\x20is\x20mandatory','channel','capitalize','User','messageId','update','bluebird','moment','lodash','../../config/logger','jayson/promise','client','http','then','error','code','catch','status','sendStatus','stack','name','send','isNil','find','rows','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','showVoiceQueues','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','INTERACTION','interface','SIP/%s','agent','internal','AgentCapacity','telephones','Telephones','Trunks','campaigns','ChatQueues','mailQueues','showMailQueues','MailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'use strict';var BPromise=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var util=require('util');var db=require('../../mysqldb')['db'];var logger=require(_0x0a9e('0x3'))('api');var jayson=require(_0x0a9e('0x4'));var amiClient=jayson[_0x0a9e('0x5')][_0x0a9e('0x6')]({'port':0x232a});var mailClient=jayson[_0x0a9e('0x5')][_0x0a9e('0x6')]({'port':0x232b});var routingClient=jayson['client'][_0x0a9e('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){var _0x56465b=_0x5f41ea?_0x5f41ea:amiClient;return _0x56465b['request'](_0x441e3a,_0x2cc193)[_0x0a9e('0x7')](function(_0xf81284){if(_0xf81284[_0x0a9e('0x8')]){if(_0xf81284[_0x0a9e('0x8')][_0x0a9e('0x9')]===0x1f4){return _0xe42b77(_0xf81284[_0x0a9e('0x8')]['message']);}return _0x503809(_0xf81284['error']['message']);}else{_0x503809(_0xf81284['result']);}})[_0x0a9e('0xa')](function(_0x36471c){_0xe42b77(_0x36471c);});});}function respondWithResult(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xc8;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0xb')](_0x26d672)['json'](_0x32d742);}return _0xd5b662[_0x0a9e('0xc')](0x194);};}function handleError(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0x1f4;return function(_0x281129){logger[_0x0a9e('0x8')](_0x281129[_0x0a9e('0xd')]);if(_0x281129['name']){delete _0x281129[_0x0a9e('0xe')];}_0x239b12['status'](_0x2b4227)[_0x0a9e('0xf')](_0x281129);};}function findById(_0x519dfd){return function(_0x16033c){if(!_[_0x0a9e('0x10')](_0x519dfd)&&!_['isNil'](_0x16033c)&&!_[_0x0a9e('0x10')](_0x16033c['rows'])){return _[_0x0a9e('0x11')](_0x16033c[_0x0a9e('0x12')],function(_0x106033){return _0x106033['id']==_0x519dfd;});}return null;};}exports[_0x0a9e('0x13')]=function(_0x31b1ca,_0x2eb11f){return respondWithRpcPromise(_0x0a9e('0x14'),_0x31b1ca[_0x0a9e('0x15')])[_0x0a9e('0x7')](respondWithResult(_0x2eb11f,null))[_0x0a9e('0xa')](handleError(_0x2eb11f,null));};exports[_0x0a9e('0x16')]=function(_0x105080,_0x4bb1e3){return respondWithRpcPromise(_0x0a9e('0x17'),_[_0x0a9e('0x18')](_0x105080['query'],_0x105080[_0x0a9e('0x19')]))['then'](respondWithResult(_0x4bb1e3,null))['catch'](handleError(_0x4bb1e3,null));};exports[_0x0a9e('0x1a')]=function(_0x432e56,_0x38e7c4){return respondWithRpcPromise(_0x0a9e('0x1b'),_['merge'](_0x432e56[_0x0a9e('0x15')],_0x432e56[_0x0a9e('0x19')]))[_0x0a9e('0x7')](respondWithResult(_0x38e7c4,null))[_0x0a9e('0xa')](handleError(_0x38e7c4,null));};exports[_0x0a9e('0x1c')]=function(_0x42ac8f,_0x16b1ca){return respondWithRpcPromise('VoiceQueues',_0x42ac8f['query'])[_0x0a9e('0x7')](respondWithResult(_0x16b1ca,null))[_0x0a9e('0xa')](handleError(_0x16b1ca,null));};exports[_0x0a9e('0x1d')]=function(_0x33161b,_0x526cf3){return respondWithRpcPromise(_0x0a9e('0x1e'),_0x33161b['query'])[_0x0a9e('0x7')](findById(_0x33161b['params']['id']))[_0x0a9e('0x7')](respondWithResult(_0x526cf3,null))[_0x0a9e('0xa')](handleError(_0x526cf3,null));};exports[_0x0a9e('0x1f')]=function(_0x14433c,_0x140511){return respondWithRpcPromise(_0x0a9e('0x20'),_[_0x0a9e('0x18')](_0x14433c[_0x0a9e('0x21')],_0x14433c['params']))[_0x0a9e('0x7')](respondWithResult(_0x140511,null))[_0x0a9e('0xa')](handleError(_0x140511,null));};exports[_0x0a9e('0x22')]=function(_0x2ec755,_0x5c877d){return respondWithRpcPromise(_0x0a9e('0x23'),_[_0x0a9e('0x18')](_0x2ec755[_0x0a9e('0x15')],_0x2ec755[_0x0a9e('0x19')]))[_0x0a9e('0x7')](respondWithResult(_0x5c877d,null))[_0x0a9e('0xa')](handleError(_0x5c877d,null));};exports[_0x0a9e('0x24')]=function(_0x2e8759,_0x1dbde2){return respondWithRpcPromise('VoiceQueuesChannels',_0x2e8759[_0x0a9e('0x15')])['then'](respondWithResult(_0x1dbde2,null))[_0x0a9e('0xa')](handleError(_0x1dbde2,null));};exports[_0x0a9e('0x25')]=function(_0x1122db,_0x33bdb7){return respondWithRpcPromise(_0x0a9e('0x26'),_['merge'](_0x1122db[_0x0a9e('0x15')],_0x1122db[_0x0a9e('0x19')]))[_0x0a9e('0x7')](respondWithResult(_0x33bdb7,null))[_0x0a9e('0xa')](handleError(_0x33bdb7,null));};exports[_0x0a9e('0x27')]=function(_0x409319,_0x332d35){return respondWithRpcPromise(_0x0a9e('0x28'),_['merge'](_0x409319[_0x0a9e('0x15')],_0x409319['params']))[_0x0a9e('0x7')](respondWithResult(_0x332d35,null))[_0x0a9e('0xa')](handleError(_0x332d35,null));};exports[_0x0a9e('0x29')]=function(_0x3f3d41,_0x567193){return respondWithRpcPromise(_0x0a9e('0x2a'),_[_0x0a9e('0x18')](_0x3f3d41[_0x0a9e('0x15')],_0x3f3d41[_0x0a9e('0x19')]))['then'](respondWithResult(_0x567193,null))['catch'](handleError(_0x567193,null));};exports[_0x0a9e('0x2b')]=function(_0x5640eb,_0x24936a){return respondWithRpcPromise(_0x0a9e('0x2c'),_0x5640eb[_0x0a9e('0x15')])[_0x0a9e('0x7')](respondWithResult(_0x24936a,null))['catch'](handleError(_0x24936a,null));};exports[_0x0a9e('0x2d')]=function(_0x3bfce8,_0x3cae){return respondWithRpcPromise('OutboundChannels',_0x3bfce8[_0x0a9e('0x15')])[_0x0a9e('0x7')](respondWithResult(_0x3cae,null))[_0x0a9e('0xa')](handleError(_0x3cae,null));};exports['agents']=function(_0x546ef8,_0x11b61d){var _0x40d766;return respondWithRpcPromise('Agents',_0x546ef8[_0x0a9e('0x15')])[_0x0a9e('0x7')](function(_0x2e1b3a){_0x40d766=_0x2e1b3a;return respondWithRpcPromise(_0x0a9e('0x2e'),_0x546ef8['query'],routingClient);})['then'](function(_0x15e37d){return _[_0x0a9e('0x18')]({},_0x15e37d,_0x40d766);})['then'](respondWithResult(_0x11b61d,null))[_0x0a9e('0xa')](handleError(_0x11b61d,null));};exports[_0x0a9e('0x2f')]=function(_0x1459bb,_0x5b4f5e){if(_0x1459bb[_0x0a9e('0x21')]&&_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')]&&_0x1459bb[_0x0a9e('0x31')]&&_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0xe')]){for(var _0x2881b3 in _0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')]){if(_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x0a9e('0x32')](_0x2881b3)){db[_0x0a9e('0x33')][_0x0a9e('0x34')]({'where':{'channel':_0x2881b3,'membername':_0x1459bb[_0x0a9e('0x31')]['name'],'type':'INTERACTION','exitAt':null,'uniqueid':_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x2881b3]&&_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x2881b3][_0x0a9e('0x35')]?{'$notIn':_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x2881b3]}:{'$ne':null}}})[_0x0a9e('0x7')](function(_0x432fcc){var _0x25c6e6=moment()[_0x0a9e('0x36')](_0x0a9e('0x37'));for(var _0x5026aa=0x0,_0x117c99=_0x432fcc[_0x0a9e('0x35')];_0x5026aa<_0x117c99;_0x5026aa+=0x1){_0x432fcc[_0x5026aa][_0x0a9e('0x38')]({'exitAt':_0x25c6e6});}});for(var _0xfbd5ad=0x0;_0xfbd5ad<_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x2881b3][_0x0a9e('0x35')];_0xfbd5ad+=0x1){db[_0x0a9e('0x33')]['findOrCreate']({'where':{'channel':_0x2881b3,'membername':_0x1459bb[_0x0a9e('0x31')]['name'],'type':_0x0a9e('0x39'),'uniqueid':_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x2881b3][_0xfbd5ad],'exitAt':null},'defaults':{'channel':_0x2881b3,'membername':_0x1459bb['user'][_0x0a9e('0xe')],'interface':_[_0x0a9e('0x10')](_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x3a')])?util[_0x0a9e('0x36')](_0x0a9e('0x3b'),_0x1459bb[_0x0a9e('0x31')]['name']):_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x3a')],'type':_0x0a9e('0x39'),'enterAt':moment()[_0x0a9e('0x36')](_0x0a9e('0x37')),'role':_0x0a9e('0x3c'),'internal':_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x3d')],'uniqueid':_0x1459bb[_0x0a9e('0x21')]['interaction'][_0x2881b3][_0xfbd5ad]}});}}}}return respondWithRpcPromise(_0x0a9e('0x3e'),{'id':_0x1459bb[_0x0a9e('0x19')]['id'],'capacity':_0x1459bb['body']['capacity']},routingClient)['then'](respondWithResult(_0x5b4f5e,null))[_0x0a9e('0xa')](handleError(_0x5b4f5e,null));};exports[_0x0a9e('0x3f')]=function(_0x37edaa,_0x11545a){return respondWithRpcPromise(_0x0a9e('0x40'),_0x37edaa[_0x0a9e('0x15')])[_0x0a9e('0x7')](respondWithResult(_0x11545a,null))[_0x0a9e('0xa')](handleError(_0x11545a,null));};exports['trunks']=function(_0x4b1b9f,_0x53975a){return respondWithRpcPromise(_0x0a9e('0x41'),_0x4b1b9f[_0x0a9e('0x15')])[_0x0a9e('0x7')](respondWithResult(_0x53975a,null))['catch'](handleError(_0x53975a,null));};exports[_0x0a9e('0x42')]=function(_0x161aa7,_0x53d113){return respondWithRpcPromise('Campaigns',_0x161aa7[_0x0a9e('0x15')])['then'](respondWithResult(_0x53d113,null))[_0x0a9e('0xa')](handleError(_0x53d113,null));};exports['chatQueues']=function(_0x2e5e62,_0x3c20b2){return respondWithRpcPromise(_0x0a9e('0x43'),_0x2e5e62['query'],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x3c20b2,null))[_0x0a9e('0xa')](handleError(_0x3c20b2,null));};exports['showChatQueues']=function(_0x50f687,_0x128aa6){return respondWithRpcPromise(_0x0a9e('0x43'),_0x50f687['query'],routingClient)[_0x0a9e('0x7')](findById(_0x50f687['params']['id']))[_0x0a9e('0x7')](respondWithResult(_0x128aa6,null))['catch'](handleError(_0x128aa6,null));};exports[_0x0a9e('0x44')]=function(_0x4a6deb,_0x5da27d){return respondWithRpcPromise('MailQueues',_0x4a6deb[_0x0a9e('0x15')],routingClient)['then'](respondWithResult(_0x5da27d,null))[_0x0a9e('0xa')](handleError(_0x5da27d,null));};exports[_0x0a9e('0x45')]=function(_0x3cfd00,_0x19b4df){return respondWithRpcPromise(_0x0a9e('0x46'),_0x3cfd00[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](findById(_0x3cfd00[_0x0a9e('0x19')]['id']))['then'](respondWithResult(_0x19b4df,null))[_0x0a9e('0xa')](handleError(_0x19b4df,null));};exports[_0x0a9e('0x47')]=function(_0x2642bb,_0x30c491){return respondWithRpcPromise(_0x0a9e('0x48'),_0x2642bb[_0x0a9e('0x15')],mailClient)['then'](respondWithResult(_0x30c491,null))[_0x0a9e('0xa')](handleError(_0x30c491,null));};exports[_0x0a9e('0x49')]=function(_0x5239ef,_0x3649cc){return respondWithRpcPromise('OpenchannelQueues',_0x5239ef[_0x0a9e('0x15')],routingClient)['then'](respondWithResult(_0x3649cc,null))['catch'](handleError(_0x3649cc,null));};exports['showOpenchannelQueues']=function(_0x273cb5,_0x49d231){return respondWithRpcPromise(_0x0a9e('0x4a'),_0x273cb5[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](findById(_0x273cb5[_0x0a9e('0x19')]['id']))[_0x0a9e('0x7')](respondWithResult(_0x49d231,null))[_0x0a9e('0xa')](handleError(_0x49d231,null));};exports['smsQueues']=function(_0x1627a7,_0x5854cc){return respondWithRpcPromise(_0x0a9e('0x4b'),_0x1627a7[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x5854cc,null))['catch'](handleError(_0x5854cc,null));};exports[_0x0a9e('0x4c')]=function(_0x156f1c,_0x119677){return respondWithRpcPromise(_0x0a9e('0x4b'),_0x156f1c['query'],routingClient)[_0x0a9e('0x7')](findById(_0x156f1c[_0x0a9e('0x19')]['id']))['then'](respondWithResult(_0x119677,null))[_0x0a9e('0xa')](handleError(_0x119677,null));};exports[_0x0a9e('0x4d')]=function(_0x88dcbf,_0x409b29){return respondWithRpcPromise(_0x0a9e('0x4e'),_0x88dcbf['query'],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x409b29,null))[_0x0a9e('0xa')](handleError(_0x409b29,null));};exports[_0x0a9e('0x4f')]=function(_0x47bb43,_0x3528b7){return respondWithRpcPromise('WhatsappQueues',_0x47bb43['query'],routingClient)[_0x0a9e('0x7')](findById(_0x47bb43[_0x0a9e('0x19')]['id']))[_0x0a9e('0x7')](respondWithResult(_0x3528b7,null))[_0x0a9e('0xa')](handleError(_0x3528b7,null));};exports[_0x0a9e('0x50')]=function(_0xc8c264,_0x387489){return respondWithRpcPromise(_0x0a9e('0x51'),_0xc8c264[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x387489,null))[_0x0a9e('0xa')](handleError(_0x387489,null));};exports[_0x0a9e('0x52')]=function(_0x2bbb86,_0x2b8192){return respondWithRpcPromise(_0x0a9e('0x51'),_0x2bbb86[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](findById(_0x2bbb86[_0x0a9e('0x19')]['id']))['then'](respondWithResult(_0x2b8192,null))[_0x0a9e('0xa')](handleError(_0x2b8192,null));};exports[_0x0a9e('0x53')]=function(_0x243d12,_0x4edbb0){return respondWithRpcPromise(_0x0a9e('0x54'),_0x243d12[_0x0a9e('0x15')])['then'](respondWithResult(_0x4edbb0,null))[_0x0a9e('0xa')](handleError(_0x4edbb0,null));};exports[_0x0a9e('0x55')]=function(_0x3ef315,_0x427946){return respondWithRpcPromise(_0x0a9e('0x56'),_0x3ef315['query'],routingClient)['then'](respondWithResult(_0x427946,null))['catch'](handleError(_0x427946,null));};exports[_0x0a9e('0x57')]=function(_0x18bf5d,_0x1104ad){return respondWithRpcPromise(_0x0a9e('0x58'),_0x18bf5d[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x1104ad,null))[_0x0a9e('0xa')](handleError(_0x1104ad,null));};exports[_0x0a9e('0x59')]=function(_0x5512d1,_0x235f8f){return respondWithRpcPromise(_0x0a9e('0x5a'),_0x5512d1[_0x0a9e('0x15')],routingClient)['then'](respondWithResult(_0x235f8f,null))[_0x0a9e('0xa')](handleError(_0x235f8f,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x4437ff,_0x44351d){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x4437ff[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](function(_0x2cc7a7){if(_0x4437ff[_0x0a9e('0x15')]['type']!==undefined){var _0x1d442c=_(_0x2cc7a7[_0x0a9e('0x12')])[_0x0a9e('0x5b')]([_0x4437ff[_0x0a9e('0x15')]['type'],_0x4437ff[_0x0a9e('0x19')]['id']])[_0x0a9e('0x5c')](_0x0a9e('0x5d'))[_0x0a9e('0x5e')]()['value']();return _0x2cc7a7[_0x0a9e('0x12')][_0x0a9e('0x5b')](function(_0x30a4c7){return _0x1d442c[_0x0a9e('0x5f')](_0x30a4c7[_0x0a9e('0x5d')])>-0x1;});}else{return _0x2cc7a7[_0x0a9e('0x12')][_0x0a9e('0x5b')](function(_0x3df0e3){return _0x3df0e3[_0x0a9e('0x5d')]===parseInt(_0x4437ff[_0x0a9e('0x19')]['id']);});}})[_0x0a9e('0x7')](respondWithResult(_0x44351d,null))[_0x0a9e('0xa')](handleError(_0x44351d,null));};exports[_0x0a9e('0x60')]=function(_0xe0749e,_0x5b35db){return respondWithRpcPromise(_0x0a9e('0x61'),_0xe0749e[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x5b35db,null))['catch'](handleError(_0x5b35db,null));};exports[_0x0a9e('0x62')]=function(_0x33dda0,_0x8cea96){return respondWithRpcPromise(_0x0a9e('0x63'),_0x33dda0['query'],routingClient)['then'](respondWithResult(_0x8cea96,null))[_0x0a9e('0xa')](handleError(_0x8cea96,null));};exports[_0x0a9e('0x64')]=function(_0x4c54fa,_0x45108c){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x4c54fa[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x45108c,null))['catch'](handleError(_0x45108c,null));};exports[_0x0a9e('0x65')]=function(_0x41cf12){return function(_0x2d2286,_0x42b959){var _0x3755fe,_0x1f42a0;var _0x444f1f=_['capitalize'](_0x41cf12);var _0x2973d3=_0x41cf12===_0x0a9e('0x66')?_0x0a9e('0x67'):_0x0a9e('0x68');return db[_0x444f1f+'Queue'][_0x0a9e('0x69')]({'raw':!![],'where':{'id':_0x2d2286[_0x0a9e('0x19')]['id']}})['then'](function(_0x1d6834){if(_['isNil'](_0x1d6834)){throw new Error(_0x444f1f+_0x0a9e('0x6a'));}_0x3755fe=_0x1d6834;return db[_0x444f1f+_0x0a9e('0x6b')][_0x0a9e('0x69')]({'where':{'id':_0x2d2286[_0x0a9e('0x21')]['messageId']},'include':[{'model':db[_0x444f1f+'Interaction'],'as':_0x0a9e('0x6c')},{'model':db[_0x444f1f+_0x2973d3],'as':_0x0a9e('0x68')}]});})[_0x0a9e('0x7')](function(_0x5ac73d){if(_[_0x0a9e('0x10')](_0x5ac73d)){throw new Error(_0x444f1f+_0x0a9e('0x6d'));}_0x1f42a0=_0x5ac73d;return _0x5ac73d['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0xf0a802={'uniqueid':_0x41cf12+'.'+_0x1f42a0['id']+'.'+_0x1f42a0['Interaction']['id'],'FromUserId':_0x2d2286['user']['id'],'type':'queue'};_0xf0a802[_0x444f1f+_0x0a9e('0x6e')]=_0x1f42a0['id'];_0xf0a802[_0x444f1f+_0x0a9e('0x6f')]=_0x1f42a0[_0x0a9e('0x6c')]['id'];_0xf0a802[_0x0a9e('0x70')+_0x444f1f+_0x2973d3+'Id']=_0x1f42a0[_0x0a9e('0x68')]['id'];_0xf0a802['To'+_0x444f1f+_0x0a9e('0x71')]=_0x3755fe['id'];return db[_0x444f1f+'TransferReport'][_0x0a9e('0x72')](_0xf0a802);})['then'](function(){return respondWithRpcPromise(_0x0a9e('0x73'),{'channel':_0x41cf12,'interaction':_0x1f42a0[_0x0a9e('0x6c')],'message':_0x1f42a0,'account':_0x1f42a0[_0x0a9e('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0a9e('0x74'),'appdata':_0x3755fe['name']+','+(_0x1f42a0[_0x0a9e('0x68')][_0x0a9e('0x75')]||0x12c),'interval':_0x0a9e('0x76')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x42b959,null))[_0x0a9e('0xa')](handleError(_0x42b959,null));};};exports[_0x0a9e('0x77')]=function(_0x2a563d,_0x22063c){var _0x255e49,_0x1910bf;if(_[_0x0a9e('0x10')](_0x2a563d[_0x0a9e('0x21')]['channel'])){throw new Error(_0x0a9e('0x78'));}var _0x3325c5=_0x2a563d['body'][_0x0a9e('0x79')];var _0x982340=_[_0x0a9e('0x7a')](_0x3325c5);var _0x5a26c8=_0x3325c5===_0x0a9e('0x66')?'Website':_0x0a9e('0x68');return db[_0x0a9e('0x7b')][_0x0a9e('0x69')]({'raw':!![],'where':{'id':_0x2a563d[_0x0a9e('0x19')]['id'],'role':_0x0a9e('0x3c')}})[_0x0a9e('0x7')](function(_0x16a039){if(_[_0x0a9e('0x10')](_0x16a039)){throw new Error('Agent\x20not\x20found');}_0x255e49=_0x16a039;return db[_0x982340+_0x0a9e('0x6b')][_0x0a9e('0x69')]({'where':{'id':_0x2a563d[_0x0a9e('0x21')][_0x0a9e('0x7c')]},'include':[{'model':db[_0x982340+_0x0a9e('0x6c')],'as':_0x0a9e('0x6c')},{'model':db[_0x982340+_0x5a26c8],'as':_0x0a9e('0x68')}]});})[_0x0a9e('0x7')](function(_0x1808ba){if(_[_0x0a9e('0x10')](_0x1808ba)){throw new Error(_0x982340+_0x0a9e('0x6d'));}_0x1910bf=_0x1808ba;return _0x1808ba[_0x0a9e('0x7d')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0a9e('0x7')](function(){var _0x4989f9={'uniqueid':_0x3325c5+'.'+_0x1910bf['id']+'.'+_0x1910bf[_0x0a9e('0x6c')]['id'],'FromUserId':_0x2a563d[_0x0a9e('0x31')]['id'],'type':_0x0a9e('0x3c'),'ToUserId':_0x255e49['id']};_0x4989f9[_0x982340+_0x0a9e('0x6e')]=_0x1910bf['id'];_0x4989f9[_0x982340+_0x0a9e('0x6f')]=_0x1910bf['Interaction']['id'];_0x4989f9[_0x0a9e('0x70')+_0x982340+_0x5a26c8+'Id']=_0x1910bf[_0x0a9e('0x68')]['id'];return db[_0x982340+'TransferReport'][_0x0a9e('0x72')](_0x4989f9);})['then'](function(){return respondWithRpcPromise(_0x0a9e('0x73'),{'channel':_0x3325c5,'interaction':_0x1910bf[_0x0a9e('0x6c')],'message':_0x1910bf,'account':_0x1910bf[_0x0a9e('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0a9e('0x3c'),'appdata':_0x255e49['name']+','+(_0x1910bf[_0x0a9e('0x68')]['agentTransferTimeout']||0x12c),'interval':_0x0a9e('0x76')}],'transfer':!![]},routingClient);})[_0x0a9e('0x7')](respondWithResult(_0x22063c,null))['catch'](handleError(_0x22063c,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index b703411..f3128ed 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 _0xc11d=['/:id/run','post','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','show'];(function(_0x59d6e9,_0x46770b){var _0x41aa3e=function(_0x4e363b){while(--_0x4e363b){_0x59d6e9['push'](_0x59d6e9['shift']());}};_0x41aa3e(++_0x46770b);}(_0xc11d,0xaf));var _0xdc11=function(_0x513690,_0x513e80){_0x513690=_0x513690-0x0;var _0x3e6b15=_0xc11d[_0x513690];return _0x3e6b15;};'use strict';var multer=require(_0xdc11('0x0'));var util=require(_0xdc11('0x1'));var path=require(_0xdc11('0x2'));var timeout=require(_0xdc11('0x3'));var express=require(_0xdc11('0x4'));var router=express['Router']();var fs_extra=require(_0xdc11('0x5'));var auth=require(_0xdc11('0x6'));var interaction=require(_0xdc11('0x7'));var config=require(_0xdc11('0x8'));var controller=require(_0xdc11('0x9'));router[_0xdc11('0xa')]('/',auth[_0xdc11('0xb')](),controller[_0xdc11('0xc')]);router[_0xdc11('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xdc11('0xd')]);router['get'](_0xdc11('0xe'),auth['isAuthenticated'](),controller['run']);router[_0xdc11('0xf')]('/',auth[_0xdc11('0xb')](),controller['create']);router[_0xdc11('0x10')](_0xdc11('0x11'),auth[_0xdc11('0xb')](),controller['update']);router[_0xdc11('0x12')]('/:id',auth[_0xdc11('0xb')](),controller[_0xdc11('0x13')]);module[_0xdc11('0x14')]=router; \ No newline at end of file +var _0x0108=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','isAuthenticated','get','/:id','show','/:id/run','run','post','create','put','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x267665,_0x889bef){var _0x3dd35c=function(_0x2869da){while(--_0x2869da){_0x267665['push'](_0x267665['shift']());}};_0x3dd35c(++_0x889bef);}(_0x0108,0x129));var _0x8010=function(_0x3f1710,_0x3877a2){_0x3f1710=_0x3f1710-0x0;var _0x528458=_0x0108[_0x3f1710];return _0x528458;};'use strict';var multer=require(_0x8010('0x0'));var util=require('util');var path=require(_0x8010('0x1'));var timeout=require(_0x8010('0x2'));var express=require('express');var router=express[_0x8010('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8010('0x4'));var interaction=require(_0x8010('0x5'));var config=require(_0x8010('0x6'));var controller=require(_0x8010('0x7'));router['get']('/',auth[_0x8010('0x8')](),controller['index']);router[_0x8010('0x9')](_0x8010('0xa'),auth['isAuthenticated'](),controller[_0x8010('0xb')]);router[_0x8010('0x9')](_0x8010('0xc'),auth['isAuthenticated'](),controller[_0x8010('0xd')]);router[_0x8010('0xe')]('/',auth['isAuthenticated'](),controller[_0x8010('0xf')]);router[_0x8010('0x10')]('/:id',auth[_0x8010('0x8')](),controller['update']);router[_0x8010('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x8010('0x12')]);module[_0x8010('0x13')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 2dd69e0..25a5654 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 _0x5bcd=['exports','STRING','BOOLEAN','DATE','INTEGER','ENUM','years','quarters','months','weeks','days','minutes','csv','pdf','xlsx','custom','default','TEXT','sequelize'];(function(_0x1b70e3,_0x3a15b1){var _0x1452ab=function(_0x692883){while(--_0x692883){_0x1b70e3['push'](_0x1b70e3['shift']());}};_0x1452ab(++_0x3a15b1);}(_0x5bcd,0x168));var _0xd5bc=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x5bcd[_0x6c993a];return _0x27f547;};'use strict';var Sequelize=require(_0xd5bc('0x0'));module[_0xd5bc('0x1')]={'name':{'type':Sequelize[_0xd5bc('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd5bc('0x2')]},'active':{'type':Sequelize[_0xd5bc('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xd5bc('0x2')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0xd5bc('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0xd5bc('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xd5bc('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xd5bc('0x6')](_0xd5bc('0x7'),_0xd5bc('0x8'),_0xd5bc('0x9'),_0xd5bc('0xa'),_0xd5bc('0xb'),'hours',_0xd5bc('0xc')),'allowNull':![],'defaultValue':_0xd5bc('0xb')},'output':{'type':Sequelize['ENUM'](_0xd5bc('0xd'),_0xd5bc('0xe'),_0xd5bc('0xf')),'allowNull':![],'defaultValue':_0xd5bc('0xd')},'type':{'type':Sequelize[_0xd5bc('0x6')](_0xd5bc('0x10'),_0xd5bc('0x11')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0xd5bc('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xd5bc('0x2')]},'cc':{'type':Sequelize[_0xd5bc('0x12')]},'bcc':{'type':Sequelize[_0xd5bc('0x12')]},'sendIfEmpty':{'type':Sequelize[_0xd5bc('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x6dd1=['quarters','months','weeks','hours','minutes','csv','default','custom','TEXT','sequelize','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','ENUM','years'];(function(_0x1040c8,_0x1baa50){var _0x5d0df0=function(_0x182b7f){while(--_0x182b7f){_0x1040c8['push'](_0x1040c8['shift']());}};_0x5d0df0(++_0x1baa50);}(_0x6dd1,0x179));var _0x16dd=function(_0x22e434,_0x496014){_0x22e434=_0x22e434-0x0;var _0x350da1=_0x6dd1[_0x22e434];return _0x350da1;};'use strict';var Sequelize=require(_0x16dd('0x0'));module['exports']={'name':{'type':Sequelize[_0x16dd('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x16dd('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x16dd('0x1')],'allowNull':![],'defaultValue':_0x16dd('0x3')},'startAt':{'type':Sequelize[_0x16dd('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x16dd('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x16dd('0x5')](_0x16dd('0x6'),_0x16dd('0x7'),_0x16dd('0x8'),_0x16dd('0x9'),'days',_0x16dd('0xa'),_0x16dd('0xb')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0x16dd('0x5')]('csv','pdf','xlsx'),'allowNull':![],'defaultValue':_0x16dd('0xc')},'type':{'type':Sequelize[_0x16dd('0x5')]('custom',_0x16dd('0xd')),'allowNull':![],'defaultValue':_0x16dd('0xe')},'sendMail':{'type':Sequelize[_0x16dd('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x16dd('0x1')]},'cc':{'type':Sequelize[_0x16dd('0xf')]},'bcc':{'type':Sequelize[_0x16dd('0xf')]},'sendIfEmpty':{'type':Sequelize[_0x16dd('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index e6705c5..0fb4578 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 _0x78e9=['ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','get','Scheduler','UserProfileResource','error','stack','name','index','map','Schedule','fieldName','type','model','query','filters','intersection','attributes','fields','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','show','params','keys','rawAttributes','find','catch','create','body','role','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','eml-format','zip-dir','moment','bluebird','mustache','sox','to-csv'];(function(_0x5bca84,_0x284d94){var _0x47d684=function(_0x519977){while(--_0x519977){_0x5bca84['push'](_0x5bca84['shift']());}};_0x47d684(++_0x284d94);}(_0x78e9,0x12d));var _0x978e=function(_0x2d7e66,_0x26fb93){_0x2d7e66=_0x2d7e66-0x0;var _0x96c048=_0x78e9[_0x2d7e66];return _0x96c048;};'use strict';var emlformat=require(_0x978e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x978e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x978e('0x2'));var BPromise=require(_0x978e('0x3'));var Mustache=require(_0x978e('0x4'));var util=require('util');var path=require('path');var sox=require(_0x978e('0x5'));var csv=require(_0x978e('0x6'));var ejs=require(_0x978e('0x7'));var fs=require('fs');var fs_extra=require(_0x978e('0x8'));var _=require(_0x978e('0x9'));var squel=require(_0x978e('0xa'));var crypto=require(_0x978e('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x978e('0xc'));var toCsv=require('to-csv');var querystring=require(_0x978e('0xd'));var Papa=require(_0x978e('0xe'));var Redis=require(_0x978e('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x978e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x978e('0x11'));var logger=require(_0x978e('0x12'))(_0x978e('0x13'));var utils=require('../../config/utils');var config=require(_0x978e('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x572c2a,_0x2297ee){_0x2297ee=_0x2297ee||0xcc;return function(_0x26abb6){if(_0x26abb6){return _0x572c2a[_0x978e('0x15')](_0x2297ee);}return _0x572c2a[_0x978e('0x16')](_0x2297ee)[_0x978e('0x17')]();};}function respondWithResult(_0x233097,_0xf35930){_0xf35930=_0xf35930||0xc8;return function(_0x147d58){if(_0x147d58){return _0x233097[_0x978e('0x16')](_0xf35930)[_0x978e('0x18')](_0x147d58);}};}function respondWithFilteredResult(_0xbc6f9b,_0x3a2be0){return function(_0x336f57){if(_0x336f57){var _0x1f3709=typeof _0x3a2be0[_0x978e('0x19')]===_0x978e('0x1a')&&typeof _0x3a2be0['limit']===_0x978e('0x1a');var _0x3eb6c5=_0x336f57['count'];var _0x5d55cf=_0x1f3709?0x0:_0x3a2be0['offset'];var _0x5b452f=_0x1f3709?_0x336f57[_0x978e('0x1b')]:_0x3a2be0[_0x978e('0x19')]+_0x3a2be0[_0x978e('0x1c')];var _0x17716d;if(_0x5b452f>=_0x3eb6c5){_0x5b452f=_0x3eb6c5;_0x17716d=0xc8;}else{_0x17716d=0xce;}_0xbc6f9b['status'](_0x17716d);return _0xbc6f9b['set'](_0x978e('0x1d'),_0x5d55cf+'-'+_0x5b452f+'/'+_0x3eb6c5)[_0x978e('0x18')](_0x336f57);}return null;};}function patchUpdates(_0x36adb1){return function(_0x48a88b){try{jsonpatch[_0x978e('0x1e')](_0x48a88b,_0x36adb1,!![]);}catch(_0x1a74ed){return BPromise[_0x978e('0x1f')](_0x1a74ed);}return _0x48a88b[_0x978e('0x20')]();};}function saveUpdates(_0x31fff7,_0x1d9698){return function(_0x55d9fc){if(_0x55d9fc){return _0x55d9fc[_0x978e('0x21')](_0x31fff7)[_0x978e('0x22')](function(_0x405da6){return _0x405da6;});}return null;};}function removeEntity(_0x2201fc,_0xb2cd1a){return function(_0xd6a8c6){if(_0xd6a8c6){return _0xd6a8c6[_0x978e('0x23')]()[_0x978e('0x22')](function(){var _0x4cd5fb=_0xd6a8c6[_0x978e('0x24')]({'plain':!![]});var _0x12a375=_0x978e('0x25');return db[_0x978e('0x26')][_0x978e('0x23')]({'where':{'type':_0x12a375,'resourceId':_0x4cd5fb['id']}})['then'](function(){return _0xd6a8c6;});})['then'](function(){_0x2201fc[_0x978e('0x16')](0xcc)[_0x978e('0x17')]();});}};}function handleEntityNotFound(_0x16886d,_0x1edeb5){return function(_0x25f748){if(!_0x25f748){_0x16886d[_0x978e('0x15')](0x194);}return _0x25f748;};}function handleError(_0x4647d6,_0x379186){_0x379186=_0x379186||0x1f4;return function(_0x53a12a){logger[_0x978e('0x27')](_0x53a12a[_0x978e('0x28')]);if(_0x53a12a[_0x978e('0x29')]){delete _0x53a12a[_0x978e('0x29')];}_0x4647d6[_0x978e('0x16')](_0x379186)['send'](_0x53a12a);};}exports[_0x978e('0x2a')]=function(_0x33be7f,_0x418db0){var _0x3d1fcb={},_0x1f0abb={},_0x3f6a50={'count':0x0,'rows':[]};var _0x538ace=_[_0x978e('0x2b')](db[_0x978e('0x2c')]['rawAttributes'],function(_0x51f916){return{'name':_0x51f916[_0x978e('0x2d')],'type':_0x51f916[_0x978e('0x2e')]['key']};});_0x1f0abb[_0x978e('0x2f')]=_[_0x978e('0x2b')](_0x538ace,'name');_0x1f0abb[_0x978e('0x30')]=_['keys'](_0x33be7f['query']);_0x1f0abb[_0x978e('0x31')]=_[_0x978e('0x32')](_0x1f0abb['model'],_0x1f0abb[_0x978e('0x30')]);_0x3d1fcb[_0x978e('0x33')]=_[_0x978e('0x32')](_0x1f0abb['model'],qs['fields'](_0x33be7f[_0x978e('0x30')][_0x978e('0x34')]));_0x3d1fcb[_0x978e('0x33')]=_0x3d1fcb[_0x978e('0x33')]['length']?_0x3d1fcb[_0x978e('0x33')]:_0x1f0abb[_0x978e('0x2f')];if(!_0x33be7f[_0x978e('0x30')]['hasOwnProperty']('nolimit')){_0x3d1fcb['limit']=qs[_0x978e('0x1c')](_0x33be7f[_0x978e('0x30')][_0x978e('0x1c')]);_0x3d1fcb[_0x978e('0x19')]=qs[_0x978e('0x19')](_0x33be7f[_0x978e('0x30')]['offset']);}_0x3d1fcb[_0x978e('0x35')]=qs[_0x978e('0x36')](_0x33be7f[_0x978e('0x30')][_0x978e('0x36')]);_0x3d1fcb[_0x978e('0x37')]=qs[_0x978e('0x31')](_[_0x978e('0x38')](_0x33be7f[_0x978e('0x30')],_0x1f0abb[_0x978e('0x31')]),_0x538ace);if(_0x33be7f[_0x978e('0x30')][_0x978e('0x39')]){_0x3d1fcb[_0x978e('0x37')]=_[_0x978e('0x3a')](_0x3d1fcb[_0x978e('0x37')],{'$or':_['map'](_0x538ace,function(_0x4b46f1){if(_0x4b46f1[_0x978e('0x2e')]!=='VIRTUAL'){var _0x2a8b0b={};_0x2a8b0b[_0x4b46f1[_0x978e('0x29')]]={'$like':'%'+_0x33be7f['query'][_0x978e('0x39')]+'%'};return _0x2a8b0b;}})});}_0x3d1fcb=_[_0x978e('0x3a')]({},_0x3d1fcb,_0x33be7f['options']);var _0xabb625={'where':_0x3d1fcb['where']};return db[_0x978e('0x2c')][_0x978e('0x1b')](_0xabb625)[_0x978e('0x22')](function(_0x10862c){_0x3f6a50['count']=_0x10862c;if(_0x33be7f[_0x978e('0x30')][_0x978e('0x3b')]){_0x3d1fcb[_0x978e('0x3c')]=[{'all':!![]}];}return db[_0x978e('0x2c')][_0x978e('0x3d')](_0x3d1fcb);})[_0x978e('0x22')](function(_0x10afd7){_0x3f6a50[_0x978e('0x3e')]=_0x10afd7;return _0x3f6a50;})[_0x978e('0x22')](respondWithFilteredResult(_0x418db0,_0x3d1fcb))['catch'](handleError(_0x418db0,null));};exports[_0x978e('0x3f')]=function(_0x2c4550,_0x47b593){var _0x299470={'raw':![],'where':{'id':_0x2c4550[_0x978e('0x40')]['id']}},_0x1bcda3={};_0x1bcda3['model']=_[_0x978e('0x41')](db[_0x978e('0x2c')][_0x978e('0x42')]);_0x1bcda3[_0x978e('0x30')]=_[_0x978e('0x41')](_0x2c4550[_0x978e('0x30')]);_0x1bcda3[_0x978e('0x31')]=_[_0x978e('0x32')](_0x1bcda3[_0x978e('0x2f')],_0x1bcda3['query']);_0x299470[_0x978e('0x33')]=_[_0x978e('0x32')](_0x1bcda3[_0x978e('0x2f')],qs[_0x978e('0x34')](_0x2c4550['query'][_0x978e('0x34')]));_0x299470[_0x978e('0x33')]=_0x299470['attributes']['length']?_0x299470[_0x978e('0x33')]:_0x1bcda3[_0x978e('0x2f')];if(_0x2c4550[_0x978e('0x30')]['includeAll']){_0x299470[_0x978e('0x3c')]=[{'all':!![]}];}_0x299470=_[_0x978e('0x3a')]({},_0x299470,_0x2c4550['options']);return db[_0x978e('0x2c')][_0x978e('0x43')](_0x299470)['then'](handleEntityNotFound(_0x47b593,null))['then'](respondWithResult(_0x47b593,null))[_0x978e('0x44')](handleError(_0x47b593,null));};exports[_0x978e('0x45')]=function(_0x59f10a,_0x916bcf){return db['Schedule']['create'](_0x59f10a[_0x978e('0x46')],{})[_0x978e('0x22')](function(_0x4f7513){var _0x30c8a3=_0x59f10a['user']['get']({'plain':!![]});if(!_0x30c8a3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x30c8a3[_0x978e('0x47')]===_0x978e('0x48')){var _0x25e12e=_0x4f7513[_0x978e('0x24')]({'plain':!![]});var _0x3cc6a9=_0x978e('0x25');return db['UserProfileSection'][_0x978e('0x43')]({'where':{'name':_0x3cc6a9,'userProfileId':_0x30c8a3[_0x978e('0x49')]},'raw':!![]})[_0x978e('0x22')](function(_0x29d2a7){if(_0x29d2a7&&_0x29d2a7['autoAssociation']===0x0){return db['UserProfileResource'][_0x978e('0x45')]({'name':_0x25e12e[_0x978e('0x29')],'resourceId':_0x25e12e['id'],'type':_0x29d2a7[_0x978e('0x29')],'sectionId':_0x29d2a7['id']},{})[_0x978e('0x22')](function(){return _0x4f7513;});}else{return _0x4f7513;}})[_0x978e('0x44')](function(_0xb98c5){logger[_0x978e('0x27')](_0x978e('0x4a'),_0xb98c5);throw _0xb98c5;});}return _0x4f7513;})['then'](respondWithResult(_0x916bcf,0xc9))[_0x978e('0x44')](handleError(_0x916bcf,null));};exports[_0x978e('0x21')]=function(_0x4364ba,_0x4b2823){if(_0x4364ba[_0x978e('0x46')]['id']){delete _0x4364ba[_0x978e('0x46')]['id'];}return db[_0x978e('0x2c')][_0x978e('0x43')]({'where':{'id':_0x4364ba[_0x978e('0x40')]['id']}})[_0x978e('0x22')](handleEntityNotFound(_0x4b2823,null))['then'](saveUpdates(_0x4364ba[_0x978e('0x46')],null))[_0x978e('0x22')](respondWithResult(_0x4b2823,null))[_0x978e('0x44')](handleError(_0x4b2823,null));};exports[_0x978e('0x23')]=function(_0x1aa540,_0xafd99a){return db[_0x978e('0x2c')]['find']({'where':{'id':_0x1aa540[_0x978e('0x40')]['id']}})[_0x978e('0x22')](handleEntityNotFound(_0xafd99a,null))[_0x978e('0x22')](removeEntity(_0xafd99a,null))[_0x978e('0x44')](handleError(_0xafd99a,null));};exports[_0x978e('0x4b')]=function(_0x1f2150,_0x21d5ac,_0x2c28c7){var _0x37aae6=require(_0x978e('0x4c'));return db[_0x978e('0x2c')][_0x978e('0x43')]({'where':{'id':_0x1f2150[_0x978e('0x40')]['id']},'raw':!![]})[_0x978e('0x22')](handleEntityNotFound(_0x21d5ac,null))[_0x978e('0x22')](function(){_0x37aae6['run'](_0x1f2150[_0x978e('0x40')]['id']);})[_0x978e('0x22')](respondWithStatusCode(_0x21d5ac,null))[_0x978e('0x44')](handleError(_0x21d5ac,null));}; \ No newline at end of file +var _0x7253=['Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','../../config/schedule','run','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','then','destroy','get','Scheduler','UserProfileResource','stack','name','send','index','Schedule','rawAttributes','fieldName','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','type','VIRTUAL','options','includeAll','include','rows','catch','merge','find','create','body','user'];(function(_0x59dd4f,_0x2a082f){var _0x1ff6d3=function(_0x23372c){while(--_0x23372c){_0x59dd4f['push'](_0x59dd4f['shift']());}};_0x1ff6d3(++_0x2a082f);}(_0x7253,0x159));var _0x3725=function(_0x294c73,_0x2801b2){_0x294c73=_0x294c73-0x0;var _0xc44764=_0x7253[_0x294c73];return _0xc44764;};'use strict';var emlformat=require(_0x3725('0x0'));var rimraf=require(_0x3725('0x1'));var zipdir=require(_0x3725('0x2'));var jsonpatch=require(_0x3725('0x3'));var rp=require(_0x3725('0x4'));var moment=require(_0x3725('0x5'));var BPromise=require(_0x3725('0x6'));var Mustache=require(_0x3725('0x7'));var util=require(_0x3725('0x8'));var path=require(_0x3725('0x9'));var sox=require(_0x3725('0xa'));var csv=require(_0x3725('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3725('0xc'));var _=require(_0x3725('0xd'));var squel=require(_0x3725('0xe'));var crypto=require(_0x3725('0xf'));var jsforce=require(_0x3725('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x3725('0xb'));var querystring=require('querystring');var Papa=require(_0x3725('0x11'));var Redis=require(_0x3725('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x3725('0x13'));var as=require(_0x3725('0x14'));var hardwareService=require(_0x3725('0x15'));var logger=require(_0x3725('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x3725('0x17'));var licenseUtil=require(_0x3725('0x18'));var db=require(_0x3725('0x19'))['db'];function respondWithStatusCode(_0x412a3d,_0xcecdc5){_0xcecdc5=_0xcecdc5||0xcc;return function(_0x39acc8){if(_0x39acc8){return _0x412a3d[_0x3725('0x1a')](_0xcecdc5);}return _0x412a3d['status'](_0xcecdc5)[_0x3725('0x1b')]();};}function respondWithResult(_0x189d41,_0x5b93e9){_0x5b93e9=_0x5b93e9||0xc8;return function(_0x250db4){if(_0x250db4){return _0x189d41[_0x3725('0x1c')](_0x5b93e9)[_0x3725('0x1d')](_0x250db4);}};}function respondWithFilteredResult(_0x1bb3c5,_0x39fa05){return function(_0x291571){if(_0x291571){var _0x2058b9=typeof _0x39fa05[_0x3725('0x1e')]===_0x3725('0x1f')&&typeof _0x39fa05['limit']===_0x3725('0x1f');var _0x3fbc9f=_0x291571[_0x3725('0x20')];var _0x20080d=_0x2058b9?0x0:_0x39fa05[_0x3725('0x1e')];var _0x4e24d1=_0x2058b9?_0x291571['count']:_0x39fa05[_0x3725('0x1e')]+_0x39fa05[_0x3725('0x21')];var _0x2834be;if(_0x4e24d1>=_0x3fbc9f){_0x4e24d1=_0x3fbc9f;_0x2834be=0xc8;}else{_0x2834be=0xce;}_0x1bb3c5[_0x3725('0x1c')](_0x2834be);return _0x1bb3c5[_0x3725('0x22')](_0x3725('0x23'),_0x20080d+'-'+_0x4e24d1+'/'+_0x3fbc9f)['json'](_0x291571);}return null;};}function patchUpdates(_0x2151e8){return function(_0x1b839a){try{jsonpatch[_0x3725('0x24')](_0x1b839a,_0x2151e8,!![]);}catch(_0x46fe45){return BPromise['reject'](_0x46fe45);}return _0x1b839a['save']();};}function saveUpdates(_0x62644c,_0x426b92){return function(_0x1fa419){if(_0x1fa419){return _0x1fa419['update'](_0x62644c)[_0x3725('0x25')](function(_0x529c67){return _0x529c67;});}return null;};}function removeEntity(_0x50b56d,_0x2fec5c){return function(_0x560f98){if(_0x560f98){return _0x560f98[_0x3725('0x26')]()['then'](function(){var _0x287db9=_0x560f98[_0x3725('0x27')]({'plain':!![]});var _0x54fad2=_0x3725('0x28');return db[_0x3725('0x29')][_0x3725('0x26')]({'where':{'type':_0x54fad2,'resourceId':_0x287db9['id']}})[_0x3725('0x25')](function(){return _0x560f98;});})[_0x3725('0x25')](function(){_0x50b56d['status'](0xcc)[_0x3725('0x1b')]();});}};}function handleEntityNotFound(_0x209ad9,_0x5f3760){return function(_0x249b0a){if(!_0x249b0a){_0x209ad9[_0x3725('0x1a')](0x194);}return _0x249b0a;};}function handleError(_0x1e70d8,_0x47a2c3){_0x47a2c3=_0x47a2c3||0x1f4;return function(_0x519d31){logger['error'](_0x519d31[_0x3725('0x2a')]);if(_0x519d31['name']){delete _0x519d31[_0x3725('0x2b')];}_0x1e70d8['status'](_0x47a2c3)[_0x3725('0x2c')](_0x519d31);};}exports[_0x3725('0x2d')]=function(_0xf014b7,_0x405b95){var _0x9eb700={},_0x49fdf5={},_0xc383b4={'count':0x0,'rows':[]};var _0x437c17=_['map'](db[_0x3725('0x2e')][_0x3725('0x2f')],function(_0x521f4b){return{'name':_0x521f4b[_0x3725('0x30')],'type':_0x521f4b['type']['key']};});_0x49fdf5[_0x3725('0x31')]=_[_0x3725('0x32')](_0x437c17,_0x3725('0x2b'));_0x49fdf5[_0x3725('0x33')]=_[_0x3725('0x34')](_0xf014b7['query']);_0x49fdf5[_0x3725('0x35')]=_[_0x3725('0x36')](_0x49fdf5[_0x3725('0x31')],_0x49fdf5[_0x3725('0x33')]);_0x9eb700[_0x3725('0x37')]=_['intersection'](_0x49fdf5[_0x3725('0x31')],qs[_0x3725('0x38')](_0xf014b7['query'][_0x3725('0x38')]));_0x9eb700[_0x3725('0x37')]=_0x9eb700[_0x3725('0x37')][_0x3725('0x39')]?_0x9eb700[_0x3725('0x37')]:_0x49fdf5[_0x3725('0x31')];if(!_0xf014b7['query'][_0x3725('0x3a')]('nolimit')){_0x9eb700[_0x3725('0x21')]=qs[_0x3725('0x21')](_0xf014b7[_0x3725('0x33')][_0x3725('0x21')]);_0x9eb700[_0x3725('0x1e')]=qs[_0x3725('0x1e')](_0xf014b7['query']['offset']);}_0x9eb700[_0x3725('0x3b')]=qs[_0x3725('0x3c')](_0xf014b7[_0x3725('0x33')][_0x3725('0x3c')]);_0x9eb700[_0x3725('0x3d')]=qs['filters'](_[_0x3725('0x3e')](_0xf014b7[_0x3725('0x33')],_0x49fdf5['filters']),_0x437c17);if(_0xf014b7[_0x3725('0x33')]['filter']){_0x9eb700[_0x3725('0x3d')]=_['merge'](_0x9eb700[_0x3725('0x3d')],{'$or':_[_0x3725('0x32')](_0x437c17,function(_0x5b2125){if(_0x5b2125[_0x3725('0x3f')]!==_0x3725('0x40')){var _0x1b63ab={};_0x1b63ab[_0x5b2125[_0x3725('0x2b')]]={'$like':'%'+_0xf014b7[_0x3725('0x33')]['filter']+'%'};return _0x1b63ab;}})});}_0x9eb700=_['merge']({},_0x9eb700,_0xf014b7[_0x3725('0x41')]);var _0x178ac4={'where':_0x9eb700['where']};return db[_0x3725('0x2e')][_0x3725('0x20')](_0x178ac4)['then'](function(_0x43ec4f){_0xc383b4[_0x3725('0x20')]=_0x43ec4f;if(_0xf014b7[_0x3725('0x33')][_0x3725('0x42')]){_0x9eb700[_0x3725('0x43')]=[{'all':!![]}];}return db[_0x3725('0x2e')]['findAll'](_0x9eb700);})[_0x3725('0x25')](function(_0x4bd8e5){_0xc383b4[_0x3725('0x44')]=_0x4bd8e5;return _0xc383b4;})[_0x3725('0x25')](respondWithFilteredResult(_0x405b95,_0x9eb700))[_0x3725('0x45')](handleError(_0x405b95,null));};exports['show']=function(_0x5c5eec,_0xda581d){var _0x5ec93e={'raw':![],'where':{'id':_0x5c5eec['params']['id']}},_0x1d972c={};_0x1d972c[_0x3725('0x31')]=_[_0x3725('0x34')](db['Schedule'][_0x3725('0x2f')]);_0x1d972c[_0x3725('0x33')]=_['keys'](_0x5c5eec['query']);_0x1d972c['filters']=_[_0x3725('0x36')](_0x1d972c['model'],_0x1d972c['query']);_0x5ec93e[_0x3725('0x37')]=_[_0x3725('0x36')](_0x1d972c[_0x3725('0x31')],qs['fields'](_0x5c5eec[_0x3725('0x33')][_0x3725('0x38')]));_0x5ec93e[_0x3725('0x37')]=_0x5ec93e['attributes'][_0x3725('0x39')]?_0x5ec93e[_0x3725('0x37')]:_0x1d972c[_0x3725('0x31')];if(_0x5c5eec[_0x3725('0x33')]['includeAll']){_0x5ec93e[_0x3725('0x43')]=[{'all':!![]}];}_0x5ec93e=_[_0x3725('0x46')]({},_0x5ec93e,_0x5c5eec[_0x3725('0x41')]);return db[_0x3725('0x2e')][_0x3725('0x47')](_0x5ec93e)[_0x3725('0x25')](handleEntityNotFound(_0xda581d,null))[_0x3725('0x25')](respondWithResult(_0xda581d,null))['catch'](handleError(_0xda581d,null));};exports[_0x3725('0x48')]=function(_0x5eb4b7,_0x397263){return db[_0x3725('0x2e')][_0x3725('0x48')](_0x5eb4b7[_0x3725('0x49')],{})[_0x3725('0x25')](function(_0x13813d){var _0xea9db3=_0x5eb4b7[_0x3725('0x4a')][_0x3725('0x27')]({'plain':!![]});if(!_0xea9db3)throw new Error(_0x3725('0x4b'));if(_0xea9db3['role']===_0x3725('0x4a')){var _0x56213d=_0x13813d[_0x3725('0x27')]({'plain':!![]});var _0x20ee7b=_0x3725('0x28');return db[_0x3725('0x4c')][_0x3725('0x47')]({'where':{'name':_0x20ee7b,'userProfileId':_0xea9db3['userProfileId']},'raw':!![]})[_0x3725('0x25')](function(_0x22ed79){if(_0x22ed79&&_0x22ed79[_0x3725('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x56213d[_0x3725('0x2b')],'resourceId':_0x56213d['id'],'type':_0x22ed79['name'],'sectionId':_0x22ed79['id']},{})[_0x3725('0x25')](function(){return _0x13813d;});}else{return _0x13813d;}})[_0x3725('0x45')](function(_0x20e306){logger[_0x3725('0x4e')](_0x3725('0x4f'),_0x20e306);throw _0x20e306;});}return _0x13813d;})[_0x3725('0x25')](respondWithResult(_0x397263,0xc9))[_0x3725('0x45')](handleError(_0x397263,null));};exports[_0x3725('0x50')]=function(_0x49b340,_0x281dbc){if(_0x49b340[_0x3725('0x49')]['id']){delete _0x49b340[_0x3725('0x49')]['id'];}return db[_0x3725('0x2e')][_0x3725('0x47')]({'where':{'id':_0x49b340[_0x3725('0x51')]['id']}})[_0x3725('0x25')](handleEntityNotFound(_0x281dbc,null))[_0x3725('0x25')](saveUpdates(_0x49b340[_0x3725('0x49')],null))[_0x3725('0x25')](respondWithResult(_0x281dbc,null))['catch'](handleError(_0x281dbc,null));};exports['destroy']=function(_0x43bf73,_0x3b836a){return db[_0x3725('0x2e')]['find']({'where':{'id':_0x43bf73[_0x3725('0x51')]['id']}})[_0x3725('0x25')](handleEntityNotFound(_0x3b836a,null))[_0x3725('0x25')](removeEntity(_0x3b836a,null))[_0x3725('0x45')](handleError(_0x3b836a,null));};exports['run']=function(_0x39ba8b,_0x4ad79c,_0x16c2f5){var _0x142a69=require(_0x3725('0x52'));return db['Schedule']['find']({'where':{'id':_0x39ba8b[_0x3725('0x51')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x4ad79c,null))['then'](function(){_0x142a69[_0x3725('0x53')](_0x39ba8b[_0x3725('0x51')]['id']);})[_0x3725('0x25')](respondWithStatusCode(_0x4ad79c,null))[_0x3725('0x45')](handleError(_0x4ad79c,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 3dbb470..a89fe18 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 _0x976b=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./schedule.attributes','define','tools_schedules'];(function(_0x5bae74,_0x1ee595){var _0xfef773=function(_0x5db0cb){while(--_0x5db0cb){_0x5bae74['push'](_0x5bae74['shift']());}};_0xfef773(++_0x1ee595);}(_0x976b,0x108));var _0xb976=function(_0x8eb3ce,_0x130a49){_0x8eb3ce=_0x8eb3ce-0x0;var _0x44df65=_0x976b[_0x8eb3ce];return _0x44df65;};'use strict';var _=require(_0xb976('0x0'));var util=require(_0xb976('0x1'));var logger=require(_0xb976('0x2'))(_0xb976('0x3'));var moment=require('moment');var BPromise=require(_0xb976('0x4'));var rp=require(_0xb976('0x5'));var fs=require('fs');var path=require(_0xb976('0x6'));var rimraf=require(_0xb976('0x7'));var config=require('../../config/environment');var attributes=require(_0xb976('0x8'));module['exports']=function(_0x5b8808,_0x19b5f2){return _0x5b8808[_0xb976('0x9')]('Schedule',attributes,{'tableName':_0xb976('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x61b7=['bluebird','path','rimraf','../../config/environment','./schedule.attributes','define','Schedule','tools_schedules','lodash','util','../../config/logger'];(function(_0x293b78,_0x42c367){var _0x2b63c1=function(_0x14d912){while(--_0x14d912){_0x293b78['push'](_0x293b78['shift']());}};_0x2b63c1(++_0x42c367);}(_0x61b7,0x194));var _0x761b=function(_0x2a4e01,_0x177610){_0x2a4e01=_0x2a4e01-0x0;var _0x58e960=_0x61b7[_0x2a4e01];return _0x58e960;};'use strict';var _=require(_0x761b('0x0'));var util=require(_0x761b('0x1'));var logger=require(_0x761b('0x2'))('api');var moment=require('moment');var BPromise=require(_0x761b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x761b('0x4'));var rimraf=require(_0x761b('0x5'));var config=require(_0x761b('0x6'));var attributes=require(_0x761b('0x7'));module['exports']=function(_0x245920,_0x5bfb97){return _0x245920[_0x761b('0x8')](_0x761b('0x9'),attributes,{'tableName':_0x761b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 2522671..2bb0b7a 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 _0x6066=['rpc','client','request','info','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Schedule,\x20%s,\x20%s','message','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4d8666,_0x2ff19d){var _0x37175b=function(_0x1b8de6){while(--_0x1b8de6){_0x4d8666['push'](_0x4d8666['shift']());}};_0x37175b(++_0x2ff19d);}(_0x6066,0xe7));var _0x6606=function(_0x1ca9e9,_0x1c4391){_0x1ca9e9=_0x1ca9e9-0x0;var _0x309f3c=_0x6066[_0x1ca9e9];return _0x309f3c;};'use strict';var _=require(_0x6606('0x0'));var util=require(_0x6606('0x1'));var moment=require(_0x6606('0x2'));var BPromise=require('bluebird');var rs=require(_0x6606('0x3'));var fs=require('fs');var Redis=require(_0x6606('0x4'));var db=require(_0x6606('0x5'))['db'];var utils=require(_0x6606('0x6'));var logger=require('../../config/logger')(_0x6606('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6606('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3fab10,_0x56d6a9,_0x4fa909){return new BPromise(function(_0x123cf0,_0x3386a8){return client[_0x6606('0x9')](_0x3fab10,_0x4fa909)['then'](function(_0x7f31ce){logger[_0x6606('0xa')]('Schedule,\x20%s,\x20%s',_0x56d6a9,'request\x20sent');logger['debug'](_0x6606('0xb'),_0x56d6a9,_0x6606('0xc'),JSON['stringify'](_0x7f31ce));if(_0x7f31ce[_0x6606('0xd')]){if(_0x7f31ce[_0x6606('0xd')][_0x6606('0xe')]===0x1f4){logger[_0x6606('0xd')](_0x6606('0xf'),_0x56d6a9,_0x7f31ce[_0x6606('0xd')][_0x6606('0x10')]);return _0x3386a8(_0x7f31ce[_0x6606('0xd')][_0x6606('0x10')]);}logger[_0x6606('0xd')]('Schedule,\x20%s,\x20%s',_0x56d6a9,_0x7f31ce[_0x6606('0xd')][_0x6606('0x10')]);return _0x123cf0(_0x7f31ce[_0x6606('0xd')][_0x6606('0x10')]);}else{logger[_0x6606('0xa')](_0x6606('0xf'),_0x56d6a9,_0x6606('0xc'));_0x123cf0(_0x7f31ce['result'][_0x6606('0x10')]);}})['catch'](function(_0x354cb8){logger[_0x6606('0xd')](_0x6606('0xf'),_0x56d6a9,_0x354cb8);_0x3386a8(_0x354cb8);});});} \ No newline at end of file +var _0x6c7f=['../../config/environment','jayson/promise','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x342eea,_0x390da7){var _0x5b7094=function(_0x378f70){while(--_0x378f70){_0x342eea['push'](_0x342eea['shift']());}};_0x5b7094(++_0x390da7);}(_0x6c7f,0x93));var _0xf6c7=function(_0x3a7ece,_0x52dbca){_0x3a7ece=_0x3a7ece-0x0;var _0x52f617=_0x6c7f[_0x3a7ece];return _0x52f617;};'use strict';var _=require(_0xf6c7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf6c7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf6c7('0x2'))['db'];var utils=require(_0xf6c7('0x3'));var logger=require(_0xf6c7('0x4'))('rpc');var config=require(_0xf6c7('0x5'));var jayson=require(_0xf6c7('0x6'));var client=jayson['client'][_0xf6c7('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x485f75,_0x4602e6,_0xbbf5ad){return new BPromise(function(_0x9bba2,_0x482b78){return client[_0xf6c7('0x8')](_0x485f75,_0xbbf5ad)[_0xf6c7('0x9')](function(_0x1d2613){logger[_0xf6c7('0xa')](_0xf6c7('0xb'),_0x4602e6,_0xf6c7('0xc'));logger[_0xf6c7('0xd')]('Schedule,\x20%s,\x20%s,\x20%s',_0x4602e6,'request\x20sent',JSON[_0xf6c7('0xe')](_0x1d2613));if(_0x1d2613['error']){if(_0x1d2613[_0xf6c7('0xf')]['code']===0x1f4){logger[_0xf6c7('0xf')](_0xf6c7('0xb'),_0x4602e6,_0x1d2613[_0xf6c7('0xf')][_0xf6c7('0x10')]);return _0x482b78(_0x1d2613[_0xf6c7('0xf')][_0xf6c7('0x10')]);}logger['error'](_0xf6c7('0xb'),_0x4602e6,_0x1d2613[_0xf6c7('0xf')][_0xf6c7('0x10')]);return _0x9bba2(_0x1d2613[_0xf6c7('0xf')][_0xf6c7('0x10')]);}else{logger[_0xf6c7('0xa')](_0xf6c7('0xb'),_0x4602e6,'request\x20sent');_0x9bba2(_0x1d2613[_0xf6c7('0x11')]['message']);}})[_0xf6c7('0x12')](function(_0xda01dd){logger[_0xf6c7('0xf')]('Schedule,\x20%s,\x20%s',_0x4602e6,_0xda01dd);_0x482b78(_0xda01dd);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 4cdadec..7c0be97 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 _0xc131=['../../config/environment','get','index','/describe','describe','isAuthenticated','show','/:id/download','download','post','create','put','/:id','delete','destroy','exports','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc131,0x82));var _0x1c13=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xc131[_0x57b54c];return _0x59cc19;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1c13('0x0')]();var fs_extra=require('fs-extra');var auth=require(_0x1c13('0x1'));var interaction=require(_0x1c13('0x2'));var config=require(_0x1c13('0x3'));var controller=require('./screenRecording.controller');router[_0x1c13('0x4')]('/',auth['isAuthenticated'](),controller[_0x1c13('0x5')]);router[_0x1c13('0x4')](_0x1c13('0x6'),auth['isAuthenticated'](),controller[_0x1c13('0x7')]);router[_0x1c13('0x4')]('/:id',auth[_0x1c13('0x8')](),controller[_0x1c13('0x9')]);router[_0x1c13('0x4')](_0x1c13('0xa'),auth['isAuthenticated'](),controller[_0x1c13('0xb')]);router[_0x1c13('0xc')]('/',auth[_0x1c13('0x8')](),controller[_0x1c13('0xd')]);router[_0x1c13('0xe')](_0x1c13('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x1c13('0x10')](_0x1c13('0xf'),auth[_0x1c13('0x8')](),controller[_0x1c13('0x11')]);module[_0x1c13('0x12')]=router; \ No newline at end of file +var _0xf965=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/describe','/:id','show','/:id/download','download','post','put'];(function(_0x2db63a,_0x52ee8e){var _0x556b91=function(_0x4ad3aa){while(--_0x4ad3aa){_0x2db63a['push'](_0x2db63a['shift']());}};_0x556b91(++_0x52ee8e);}(_0xf965,0xb6));var _0x5f96=function(_0x27875e,_0x588823){_0x27875e=_0x27875e-0x0;var _0x3882ca=_0xf965[_0x27875e];return _0x3882ca;};'use strict';var multer=require(_0x5f96('0x0'));var util=require(_0x5f96('0x1'));var path=require(_0x5f96('0x2'));var timeout=require(_0x5f96('0x3'));var express=require(_0x5f96('0x4'));var router=express[_0x5f96('0x5')]();var fs_extra=require(_0x5f96('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5f96('0x7'));var config=require('../../config/environment');var controller=require('./screenRecording.controller');router[_0x5f96('0x8')]('/',auth[_0x5f96('0x9')](),controller[_0x5f96('0xa')]);router[_0x5f96('0x8')](_0x5f96('0xb'),auth[_0x5f96('0x9')](),controller['describe']);router['get'](_0x5f96('0xc'),auth[_0x5f96('0x9')](),controller[_0x5f96('0xd')]);router['get'](_0x5f96('0xe'),auth[_0x5f96('0x9')](),controller[_0x5f96('0xf')]);router[_0x5f96('0x10')]('/',auth[_0x5f96('0x9')](),controller['create']);router[_0x5f96('0x11')](_0x5f96('0xc'),auth[_0x5f96('0x9')](),controller['update']);router['delete'](_0x5f96('0xc'),auth[_0x5f96('0x9')](),controller[_0x5f96('0x12')]);module[_0x5f96('0x13')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 636e634..12cdef9 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 _0x2272=['startedAt','format','MM-DD-YYYY\x20HH:mm','toString','DATE','updatedAt','sequelize','moment','path','../../config/environment','exports','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','subtract','closedAt','duration'];(function(_0x3f22fa,_0x23fbfd){var _0x50778d=function(_0x11d6da){while(--_0x11d6da){_0x3f22fa['push'](_0x3f22fa['shift']());}};_0x50778d(++_0x23fbfd);}(_0x2272,0xd8));var _0x2227=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x2272[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0x2227('0x0'));var moment=require(_0x2227('0x1'));var path=require(_0x2227('0x2'));var config=require(_0x2227('0x3'));module[_0x2227('0x4')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x2227('0x5')](_0x2227('0x6'))?path[_0x2227('0x7')](this['getDataValue']('value')):undefined;}},'interactionid':{'type':Sequelize[_0x2227('0x8')]},'channel':{'type':Sequelize[_0x2227('0x8')]},'value':{'type':Sequelize[_0x2227('0x8')],'set':function(_0x2591db){var _0xaec623=_0x2591db[_0x2227('0x9')](/\\/g,'/');this[_0x2227('0xa')](_0x2227('0x6'),_0xaec623);}},'rating':{'type':Sequelize[_0x2227('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x2227('0xb')],'set':function(_0x496bbd){this[_0x2227('0xa')]('startedAt',moment()[_0x2227('0xc')](_0x496bbd,'ms'));this[_0x2227('0xa')](_0x2227('0xd'),moment());this[_0x2227('0xa')](_0x2227('0xe'),_0x496bbd);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x2227('0x5')](_0x2227('0xf')))[_0x2227('0x10')](_0x2227('0x11'))[_0x2227('0x12')]();}},'closedAt':{'type':Sequelize[_0x2227('0x13')],'get':function(){return moment(this['getDataValue']('closedAt'))['format'](_0x2227('0x11'))['toString']();}},'createdAt':{'type':Sequelize[_0x2227('0x13')],'get':function(){return moment(this[_0x2227('0x5')]('createdAt'))[_0x2227('0x10')](_0x2227('0x11'))[_0x2227('0x12')]();}},'updatedAt':{'type':Sequelize[_0x2227('0x13')],'get':function(){return moment(this[_0x2227('0x5')](_0x2227('0x14')))['format'](_0x2227('0x11'))[_0x2227('0x12')]();}}}; \ No newline at end of file +var _0x7669=['path','exports','VIRTUAL','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','subtract','closedAt','duration','startedAt','toString','format','MM-DD-YYYY\x20HH:mm','DATE','createdAt','sequelize','moment'];(function(_0x18432e,_0x57521b){var _0x189dc5=function(_0x303bde){while(--_0x303bde){_0x18432e['push'](_0x18432e['shift']());}};_0x189dc5(++_0x57521b);}(_0x7669,0xe5));var _0x9766=function(_0x44c097,_0x4f09e5){_0x44c097=_0x44c097-0x0;var _0x253779=_0x7669[_0x44c097];return _0x253779;};'use strict';var Sequelize=require(_0x9766('0x0'));var moment=require(_0x9766('0x1'));var path=require(_0x9766('0x2'));var config=require('../../config/environment');module[_0x9766('0x3')]={'format':{'type':Sequelize[_0x9766('0x4')],'get':function(){return this[_0x9766('0x5')](_0x9766('0x6'))?path[_0x9766('0x7')](this[_0x9766('0x5')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0x9766('0x8')]},'channel':{'type':Sequelize[_0x9766('0x8')]},'value':{'type':Sequelize[_0x9766('0x8')],'set':function(_0x251329){var _0x4f85e7=_0x251329[_0x9766('0x9')](/\\/g,'/');this[_0x9766('0xa')](_0x9766('0x6'),_0x4f85e7);}},'rating':{'type':Sequelize[_0x9766('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x9766('0xb')],'set':function(_0x5cb787){this[_0x9766('0xa')]('startedAt',moment()[_0x9766('0xc')](_0x5cb787,'ms'));this['setDataValue'](_0x9766('0xd'),moment());this['setDataValue'](_0x9766('0xe'),_0x5cb787);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x9766('0x5')](_0x9766('0xf')))['format']('MM-DD-YYYY\x20HH:mm')[_0x9766('0x10')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x9766('0x5')]('closedAt'))[_0x9766('0x11')](_0x9766('0x12'))['toString']();}},'createdAt':{'type':Sequelize[_0x9766('0x13')],'get':function(){return moment(this['getDataValue'](_0x9766('0x14')))[_0x9766('0x11')](_0x9766('0x12'))[_0x9766('0x10')]();}},'updatedAt':{'type':Sequelize[_0x9766('0x13')],'get':function(){return moment(this[_0x9766('0x5')]('updatedAt'))[_0x9766('0x11')](_0x9766('0x12'))[_0x9766('0x10')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index b78cd1e..b361160 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 _0xb4c7=['rawAttributes','fieldName','type','format','query','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','keys','include','find','create','body','duration','createdAt','closedAt','value','describe','../../components/encryptor','uniqueid','params','join','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','root','ValidationError','download','filename','extname','unlink','message','Not\x20found','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ScreenRecording'];(function(_0xed9dd,_0x184eb5){var _0x2b0faf=function(_0x437e21){while(--_0x437e21){_0xed9dd['push'](_0xed9dd['shift']());}};_0x2b0faf(++_0x184eb5);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x458ee2,_0x548397){_0x458ee2=_0x458ee2-0x0;var _0x367602=_0xb4c7[_0x458ee2];return _0x367602;};'use strict';var emlformat=require(_0x7b4c('0x0'));var rimraf=require(_0x7b4c('0x1'));var zipdir=require(_0x7b4c('0x2'));var jsonpatch=require(_0x7b4c('0x3'));var rp=require(_0x7b4c('0x4'));var moment=require('moment');var BPromise=require(_0x7b4c('0x5'));var Mustache=require(_0x7b4c('0x6'));var util=require(_0x7b4c('0x7'));var path=require(_0x7b4c('0x8'));var sox=require(_0x7b4c('0x9'));var csv=require('to-csv');var ejs=require(_0x7b4c('0xa'));var fs=require('fs');var fs_extra=require(_0x7b4c('0xb'));var _=require(_0x7b4c('0xc'));var squel=require('squel');var crypto=require(_0x7b4c('0xd'));var jsforce=require(_0x7b4c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7b4c('0xf'));var querystring=require(_0x7b4c('0x10'));var Papa=require(_0x7b4c('0x11'));var Redis=require(_0x7b4c('0x12'));var authService=require(_0x7b4c('0x13'));var qs=require(_0x7b4c('0x14'));var as=require(_0x7b4c('0x15'));var hardwareService=require(_0x7b4c('0x16'));var logger=require(_0x7b4c('0x17'))(_0x7b4c('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7b4c('0x19'));var db=require(_0x7b4c('0x1a'))['db'];function respondWithStatusCode(_0x38656b,_0x1722ad){_0x1722ad=_0x1722ad||0xcc;return function(_0x3e1558){if(_0x3e1558){return _0x38656b[_0x7b4c('0x1b')](_0x1722ad);}return _0x38656b[_0x7b4c('0x1c')](_0x1722ad)[_0x7b4c('0x1d')]();};}function respondWithResult(_0x25b90b,_0x387488){_0x387488=_0x387488||0xc8;return function(_0x593a19){if(_0x593a19){return _0x25b90b[_0x7b4c('0x1c')](_0x387488)[_0x7b4c('0x1e')](_0x593a19);}};}function respondWithFilteredResult(_0xdc71cd,_0x2a0e2f){return function(_0xa0a812){if(_0xa0a812){var _0x2471b3=typeof _0x2a0e2f[_0x7b4c('0x1f')]===_0x7b4c('0x20')&&typeof _0x2a0e2f['limit']===_0x7b4c('0x20');var _0xe71d88=_0xa0a812[_0x7b4c('0x21')];var _0x36c02a=_0x2471b3?0x0:_0x2a0e2f['offset'];var _0x3ce10c=_0x2471b3?_0xa0a812[_0x7b4c('0x21')]:_0x2a0e2f[_0x7b4c('0x1f')]+_0x2a0e2f[_0x7b4c('0x22')];var _0x2d4c72;if(_0x3ce10c>=_0xe71d88){_0x3ce10c=_0xe71d88;_0x2d4c72=0xc8;}else{_0x2d4c72=0xce;}_0xdc71cd[_0x7b4c('0x1c')](_0x2d4c72);return _0xdc71cd[_0x7b4c('0x23')](_0x7b4c('0x24'),_0x36c02a+'-'+_0x3ce10c+'/'+_0xe71d88)[_0x7b4c('0x1e')](_0xa0a812);}return null;};}function patchUpdates(_0x55e3df){return function(_0x1f06ec){try{jsonpatch[_0x7b4c('0x25')](_0x1f06ec,_0x55e3df,!![]);}catch(_0x11996d){return BPromise[_0x7b4c('0x26')](_0x11996d);}return _0x1f06ec[_0x7b4c('0x27')]();};}function saveUpdates(_0x168ac9,_0x176704){return function(_0x3d4826){if(_0x3d4826){return _0x3d4826[_0x7b4c('0x28')](_0x168ac9)[_0x7b4c('0x29')](function(_0x5eec1e){return _0x5eec1e;});}return null;};}function removeEntity(_0x45438c,_0x4350c9){return function(_0x276271){if(_0x276271){return _0x276271[_0x7b4c('0x2a')]()[_0x7b4c('0x29')](function(){_0x45438c[_0x7b4c('0x1c')](0xcc)[_0x7b4c('0x1d')]();});}};}function handleEntityNotFound(_0x459eb4,_0x1f311e){return function(_0x1a69db){if(!_0x1a69db){_0x459eb4[_0x7b4c('0x1b')](0x194);}return _0x1a69db;};}function handleError(_0x257da2,_0x316e5f){_0x316e5f=_0x316e5f||0x1f4;return function(_0x501f75){logger[_0x7b4c('0x2b')](_0x501f75[_0x7b4c('0x2c')]);if(_0x501f75[_0x7b4c('0x2d')]){delete _0x501f75[_0x7b4c('0x2d')];}_0x257da2[_0x7b4c('0x1c')](_0x316e5f)[_0x7b4c('0x2e')](_0x501f75);};}exports[_0x7b4c('0x2f')]=function(_0x2552f9,_0x3e4a46){var _0x9a799b={},_0x3585cd={},_0x130ace={'count':0x0,'rows':[]};var _0x3544bc=_[_0x7b4c('0x30')](db[_0x7b4c('0x31')][_0x7b4c('0x32')],function(_0x1d0724){return{'name':_0x1d0724[_0x7b4c('0x33')],'type':_0x1d0724[_0x7b4c('0x34')]['key']};});_0x3585cd['model']=_['differenceBy'](_[_0x7b4c('0x30')](_0x3544bc,_0x7b4c('0x2d')),[_0x7b4c('0x35')]);_0x3585cd[_0x7b4c('0x36')]=_['keys'](_0x2552f9[_0x7b4c('0x36')]);_0x3585cd[_0x7b4c('0x37')]=_['intersection'](_0x3585cd[_0x7b4c('0x38')],_0x3585cd['query']);_0x9a799b[_0x7b4c('0x39')]=_[_0x7b4c('0x3a')](_0x3585cd[_0x7b4c('0x38')],qs['fields'](_0x2552f9[_0x7b4c('0x36')][_0x7b4c('0x3b')]));_0x9a799b['attributes']=_0x9a799b[_0x7b4c('0x39')][_0x7b4c('0x3c')]?_0x9a799b[_0x7b4c('0x39')]:_0x3585cd[_0x7b4c('0x38')];if(!_0x2552f9['query']['hasOwnProperty'](_0x7b4c('0x3d'))){_0x9a799b[_0x7b4c('0x22')]=qs['limit'](_0x2552f9[_0x7b4c('0x36')]['limit']);_0x9a799b['offset']=qs[_0x7b4c('0x1f')](_0x2552f9[_0x7b4c('0x36')][_0x7b4c('0x1f')]);}_0x9a799b[_0x7b4c('0x3e')]=qs['sort'](_0x2552f9[_0x7b4c('0x36')][_0x7b4c('0x3f')]);_0x9a799b[_0x7b4c('0x40')]=qs[_0x7b4c('0x37')](_[_0x7b4c('0x41')](_0x2552f9[_0x7b4c('0x36')],_0x3585cd[_0x7b4c('0x37')]),_0x3544bc);if(_0x2552f9['query']['filter']){_0x9a799b[_0x7b4c('0x40')]=_[_0x7b4c('0x42')](_0x9a799b[_0x7b4c('0x40')],{'$or':_[_0x7b4c('0x30')](_0x3544bc,function(_0xb8486d){if(_0xb8486d['type']!==_0x7b4c('0x43')){var _0x902367={};_0x902367[_0xb8486d[_0x7b4c('0x2d')]]={'$like':'%'+_0x2552f9[_0x7b4c('0x36')][_0x7b4c('0x44')]+'%'};return _0x902367;}})});}_0x9a799b=_[_0x7b4c('0x42')]({},_0x9a799b,_0x2552f9[_0x7b4c('0x45')]);var _0x1080fc={'where':_0x9a799b[_0x7b4c('0x40')]};return db['ScreenRecording'][_0x7b4c('0x21')](_0x1080fc)['then'](function(_0x2a3a74){_0x130ace['count']=_0x2a3a74;if(_0x2552f9[_0x7b4c('0x36')][_0x7b4c('0x46')]){_0x9a799b['include']=[{'all':!![]}];}return db['ScreenRecording'][_0x7b4c('0x47')](_0x9a799b);})[_0x7b4c('0x29')](function(_0x1def44){_0x130ace[_0x7b4c('0x48')]=_0x1def44;return _0x130ace;})['then'](respondWithFilteredResult(_0x3e4a46,_0x9a799b))[_0x7b4c('0x49')](handleError(_0x3e4a46,null));};exports[_0x7b4c('0x4a')]=function(_0x100774,_0x5d4ed8){var _0x45ad59={'raw':![],'where':{'id':_0x100774['params']['id']}},_0x4b4757={};_0x4b4757[_0x7b4c('0x38')]=_['keys'](db[_0x7b4c('0x31')][_0x7b4c('0x32')]);_0x4b4757[_0x7b4c('0x36')]=_[_0x7b4c('0x4b')](_0x100774[_0x7b4c('0x36')]);_0x4b4757[_0x7b4c('0x37')]=_[_0x7b4c('0x3a')](_0x4b4757[_0x7b4c('0x38')],_0x4b4757[_0x7b4c('0x36')]);_0x45ad59['attributes']=_[_0x7b4c('0x3a')](_0x4b4757['model'],qs['fields'](_0x100774[_0x7b4c('0x36')][_0x7b4c('0x3b')]));_0x45ad59['attributes']=_0x45ad59['attributes'][_0x7b4c('0x3c')]?_0x45ad59[_0x7b4c('0x39')]:_0x4b4757[_0x7b4c('0x38')];if(_0x100774[_0x7b4c('0x36')][_0x7b4c('0x46')]){_0x45ad59[_0x7b4c('0x4c')]=[{'all':!![]}];}_0x45ad59=_[_0x7b4c('0x42')]({},_0x45ad59,_0x100774[_0x7b4c('0x45')]);return db['ScreenRecording'][_0x7b4c('0x4d')](_0x45ad59)[_0x7b4c('0x29')](handleEntityNotFound(_0x5d4ed8,null))[_0x7b4c('0x29')](respondWithResult(_0x5d4ed8,null))[_0x7b4c('0x49')](handleError(_0x5d4ed8,null));};exports[_0x7b4c('0x4e')]=function(_0x379f15,_0x11a6f9){return db[_0x7b4c('0x31')][_0x7b4c('0x4e')](_0x379f15['body'],{})['then'](respondWithResult(_0x11a6f9,0xc9))[_0x7b4c('0x49')](handleError(_0x11a6f9,null));};exports[_0x7b4c('0x28')]=function(_0x97eadf,_0x5d4192){if(_0x97eadf[_0x7b4c('0x4f')]['id']){delete _0x97eadf[_0x7b4c('0x4f')]['id'];}delete _0x97eadf['body'][_0x7b4c('0x50')];delete _0x97eadf['body'][_0x7b4c('0x51')];delete _0x97eadf['body'][_0x7b4c('0x52')];delete _0x97eadf['body'][_0x7b4c('0x53')];return db[_0x7b4c('0x31')]['find']({'where':{'id':_0x97eadf['params']['id']}})[_0x7b4c('0x29')](handleEntityNotFound(_0x5d4192,null))[_0x7b4c('0x29')](saveUpdates(_0x97eadf[_0x7b4c('0x4f')],null))['then'](respondWithResult(_0x5d4192,null))['catch'](handleError(_0x5d4192,null));};exports[_0x7b4c('0x54')]=function(_0x1c118a,_0x4cbf1b){return db['ScreenRecording'][_0x7b4c('0x54')]()[_0x7b4c('0x29')](respondWithResult(_0x4cbf1b,null))[_0x7b4c('0x49')](handleError(_0x4cbf1b,null));};exports['download']=function(_0x1d017d,_0x2f009a,_0x4aaf57){var _0x484e80=require(_0x7b4c('0x55'));var _0x4d8491=![];var _0x59db20={};if(_0x1d017d[_0x7b4c('0x36')]['type']&&_0x1d017d['query'][_0x7b4c('0x34')]===_0x7b4c('0x56')){_0x59db20[_0x7b4c('0x56')]=_0x1d017d[_0x7b4c('0x57')]['id'];}else{_0x59db20['id']=_0x1d017d['params']['id'];}return db['ScreenRecording'][_0x7b4c('0x4d')]({'where':_0x59db20,'attributes':['id',_0x7b4c('0x53')],'raw':!![]})[_0x7b4c('0x29')](handleEntityNotFound(_0x2f009a,null))['then'](function(_0x255262){if(_0x255262){var _0x3d81fb=path[_0x7b4c('0x58')](config['root'],_0x7b4c('0x59'),_0x255262[_0x7b4c('0x53')]);var _0x529803=util[_0x7b4c('0x35')](_0x7b4c('0x5a'),_0x3d81fb);if(fs[_0x7b4c('0x5b')](_0x529803)){_0x4d8491=!![];return _0x484e80[_0x7b4c('0x5c')](_0x529803,_0x3d81fb,config[_0x7b4c('0x5d')][_0x7b4c('0x5e')])[_0x7b4c('0x29')](function(){return _0x255262;});}return _0x255262;}})['then'](function(_0x4443d0){if(_0x4443d0){var _0x2dc79a=path['join'](config[_0x7b4c('0x5f')],_0x7b4c('0x59'),_0x4443d0[_0x7b4c('0x53')]);if(!fs[_0x7b4c('0x5b')](_0x2dc79a)){throw new db['Sequelize'][(_0x7b4c('0x60'))]('ScreenRecording\x20not\x20found');}if(_0x4443d0['filename']){return _0x2f009a[_0x7b4c('0x61')](_0x2dc79a,_0x4443d0[_0x7b4c('0x62')]+path[_0x7b4c('0x63')](_0x2dc79a),function(){if(_0x4d8491){fs[_0x7b4c('0x64')](_0x2dc79a);}});}else{return _0x2f009a[_0x7b4c('0x61')](_0x2dc79a,function(_0x5b24f6){if(_0x4d8491){fs['unlink'](_0x2dc79a);}});}}})[_0x7b4c('0x49')](function(_0x3c84af){if(_0x3c84af[_0x7b4c('0x65')]==='ScreenRecording\x20not\x20found'){_0x2f009a[_0x7b4c('0x1c')](0x194)[_0x7b4c('0x2e')](_0x7b4c('0x66'));}else{return handleError(_0x2f009a,null);}});};exports['destroy']=function(_0x222b47,_0x3b2144){return db[_0x7b4c('0x31')]['find']({'where':{'id':_0x222b47[_0x7b4c('0x57')]['id']}})[_0x7b4c('0x29')](function(_0x4ac03e){if(_[_0x7b4c('0x67')](_0x4ac03e)){throw new ReferenceError('Entity\x20not\x20found');}return _0x4ac03e;})[_0x7b4c('0x29')](function(_0x11ae6e){var _0x3a3713=path['join'](config['root'],_0x7b4c('0x59'),_0x11ae6e[_0x7b4c('0x53')]);logger[_0x7b4c('0x68')]('cancellazione\x20fisica\x20documento\x20%s',_0x3a3713);if(!_[_0x7b4c('0x67')](_0x11ae6e['value'])&&fs[_0x7b4c('0x5b')](_0x3a3713)){logger[_0x7b4c('0x68')](_0x7b4c('0x69')+_0x3a3713+_0x7b4c('0x6a'));fs[_0x7b4c('0x6b')](_0x3a3713);}_0x3a3713=_0x3a3713+'.cypher';if(!_[_0x7b4c('0x67')](_0x11ae6e[_0x7b4c('0x53')])&&fs['existsSync'](_0x3a3713)){logger[_0x7b4c('0x68')](_0x7b4c('0x69')+_0x3a3713+_0x7b4c('0x6a'));fs[_0x7b4c('0x6b')](_0x3a3713);}return _0x11ae6e;})[_0x7b4c('0x29')](function(_0x2befd7){if(!_0x2befd7)throw new InternalError();return _0x2befd7[_0x7b4c('0x2a')]();})[_0x7b4c('0x29')](function(){_0x3b2144['status'](0xcc)[_0x7b4c('0x1d')]();})[_0x7b4c('0x49')](handleError(_0x3b2144,null));}; \ No newline at end of file +var _0x1cb9=['ValidationError','filename','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','filters','intersection','fields','attributes','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','includeAll','findAll','rows','catch','show','keys','length','include','options','find','create','body','duration','createdAt','value','params','describe','download','../../components/encryptor','uniqueid','join','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','recording','root','Sequelize'];(function(_0x1d9dfe,_0x556a07){var _0x1f9c68=function(_0x59be7d){while(--_0x59be7d){_0x1d9dfe['push'](_0x1d9dfe['shift']());}};_0x1f9c68(++_0x556a07);}(_0x1cb9,0x14e));var _0x91cb=function(_0x1bd383,_0x25e163){_0x1bd383=_0x1bd383-0x0;var _0x471b5d=_0x1cb9[_0x1bd383];return _0x471b5d;};'use strict';var emlformat=require(_0x91cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91cb('0x1'));var jsonpatch=require(_0x91cb('0x2'));var rp=require(_0x91cb('0x3'));var moment=require(_0x91cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91cb('0x5'));var util=require(_0x91cb('0x6'));var path=require('path');var sox=require(_0x91cb('0x7'));var csv=require(_0x91cb('0x8'));var ejs=require(_0x91cb('0x9'));var fs=require('fs');var fs_extra=require(_0x91cb('0xa'));var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x8'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x91cb('0x18'))['db'];function respondWithStatusCode(_0x366f09,_0x4ba2f2){_0x4ba2f2=_0x4ba2f2||0xcc;return function(_0x20e6e0){if(_0x20e6e0){return _0x366f09[_0x91cb('0x19')](_0x4ba2f2);}return _0x366f09[_0x91cb('0x1a')](_0x4ba2f2)[_0x91cb('0x1b')]();};}function respondWithResult(_0x4a7d45,_0x4cc6ef){_0x4cc6ef=_0x4cc6ef||0xc8;return function(_0x4aae25){if(_0x4aae25){return _0x4a7d45[_0x91cb('0x1a')](_0x4cc6ef)['json'](_0x4aae25);}};}function respondWithFilteredResult(_0x528f73,_0x576369){return function(_0xc3629e){if(_0xc3629e){var _0x347980=typeof _0x576369['offset']===_0x91cb('0x1c')&&typeof _0x576369[_0x91cb('0x1d')]==='undefined';var _0xc594e3=_0xc3629e[_0x91cb('0x1e')];var _0x1cd34b=_0x347980?0x0:_0x576369[_0x91cb('0x1f')];var _0x5cc1c3=_0x347980?_0xc3629e[_0x91cb('0x1e')]:_0x576369[_0x91cb('0x1f')]+_0x576369['limit'];var _0x123847;if(_0x5cc1c3>=_0xc594e3){_0x5cc1c3=_0xc594e3;_0x123847=0xc8;}else{_0x123847=0xce;}_0x528f73['status'](_0x123847);return _0x528f73['set'](_0x91cb('0x20'),_0x1cd34b+'-'+_0x5cc1c3+'/'+_0xc594e3)[_0x91cb('0x21')](_0xc3629e);}return null;};}function patchUpdates(_0x56e409){return function(_0x51a1d5){try{jsonpatch['apply'](_0x51a1d5,_0x56e409,!![]);}catch(_0x438162){return BPromise[_0x91cb('0x22')](_0x438162);}return _0x51a1d5[_0x91cb('0x23')]();};}function saveUpdates(_0x1dbee2,_0x5c6a15){return function(_0x45c4b3){if(_0x45c4b3){return _0x45c4b3[_0x91cb('0x24')](_0x1dbee2)[_0x91cb('0x25')](function(_0x55fa78){return _0x55fa78;});}return null;};}function removeEntity(_0x26f18f,_0x1a7a54){return function(_0x2447e7){if(_0x2447e7){return _0x2447e7[_0x91cb('0x26')]()[_0x91cb('0x25')](function(){_0x26f18f[_0x91cb('0x1a')](0xcc)[_0x91cb('0x1b')]();});}};}function handleEntityNotFound(_0x423c4f,_0x264e9b){return function(_0x4c8438){if(!_0x4c8438){_0x423c4f['sendStatus'](0x194);}return _0x4c8438;};}function handleError(_0x234eb1,_0x554350){_0x554350=_0x554350||0x1f4;return function(_0x1c67d2){logger[_0x91cb('0x27')](_0x1c67d2[_0x91cb('0x28')]);if(_0x1c67d2['name']){delete _0x1c67d2[_0x91cb('0x29')];}_0x234eb1['status'](_0x554350)[_0x91cb('0x2a')](_0x1c67d2);};}exports[_0x91cb('0x2b')]=function(_0x3b3ee6,_0x2fb473){var _0x468908={},_0x504275={},_0x2f04a3={'count':0x0,'rows':[]};var _0x52670a=_[_0x91cb('0x2c')](db[_0x91cb('0x2d')][_0x91cb('0x2e')],function(_0x4944bd){return{'name':_0x4944bd[_0x91cb('0x2f')],'type':_0x4944bd[_0x91cb('0x30')][_0x91cb('0x31')]};});_0x504275[_0x91cb('0x32')]=_[_0x91cb('0x33')](_[_0x91cb('0x2c')](_0x52670a,_0x91cb('0x29')),[_0x91cb('0x34')]);_0x504275[_0x91cb('0x35')]=_['keys'](_0x3b3ee6[_0x91cb('0x35')]);_0x504275[_0x91cb('0x36')]=_[_0x91cb('0x37')](_0x504275[_0x91cb('0x32')],_0x504275[_0x91cb('0x35')]);_0x468908['attributes']=_[_0x91cb('0x37')](_0x504275[_0x91cb('0x32')],qs[_0x91cb('0x38')](_0x3b3ee6[_0x91cb('0x35')][_0x91cb('0x38')]));_0x468908['attributes']=_0x468908[_0x91cb('0x39')]['length']?_0x468908['attributes']:_0x504275['model'];if(!_0x3b3ee6[_0x91cb('0x35')]['hasOwnProperty'](_0x91cb('0x3a'))){_0x468908['limit']=qs['limit'](_0x3b3ee6[_0x91cb('0x35')][_0x91cb('0x1d')]);_0x468908[_0x91cb('0x1f')]=qs[_0x91cb('0x1f')](_0x3b3ee6[_0x91cb('0x35')]['offset']);}_0x468908[_0x91cb('0x3b')]=qs[_0x91cb('0x3c')](_0x3b3ee6[_0x91cb('0x35')][_0x91cb('0x3c')]);_0x468908['where']=qs['filters'](_[_0x91cb('0x3d')](_0x3b3ee6[_0x91cb('0x35')],_0x504275['filters']),_0x52670a);if(_0x3b3ee6[_0x91cb('0x35')][_0x91cb('0x3e')]){_0x468908['where']=_[_0x91cb('0x3f')](_0x468908[_0x91cb('0x40')],{'$or':_['map'](_0x52670a,function(_0x43d4fe){if(_0x43d4fe['type']!==_0x91cb('0x41')){var _0xabe6a3={};_0xabe6a3[_0x43d4fe[_0x91cb('0x29')]]={'$like':'%'+_0x3b3ee6[_0x91cb('0x35')][_0x91cb('0x3e')]+'%'};return _0xabe6a3;}})});}_0x468908=_[_0x91cb('0x3f')]({},_0x468908,_0x3b3ee6['options']);var _0xa90111={'where':_0x468908[_0x91cb('0x40')]};return db['ScreenRecording'][_0x91cb('0x1e')](_0xa90111)['then'](function(_0x2c6102){_0x2f04a3[_0x91cb('0x1e')]=_0x2c6102;if(_0x3b3ee6[_0x91cb('0x35')][_0x91cb('0x42')]){_0x468908['include']=[{'all':!![]}];}return db[_0x91cb('0x2d')][_0x91cb('0x43')](_0x468908);})[_0x91cb('0x25')](function(_0x37e777){_0x2f04a3[_0x91cb('0x44')]=_0x37e777;return _0x2f04a3;})[_0x91cb('0x25')](respondWithFilteredResult(_0x2fb473,_0x468908))[_0x91cb('0x45')](handleError(_0x2fb473,null));};exports[_0x91cb('0x46')]=function(_0x325dca,_0x3cc4c1){var _0x49bc42={'raw':![],'where':{'id':_0x325dca['params']['id']}},_0x16993f={};_0x16993f[_0x91cb('0x32')]=_['keys'](db[_0x91cb('0x2d')]['rawAttributes']);_0x16993f[_0x91cb('0x35')]=_[_0x91cb('0x47')](_0x325dca[_0x91cb('0x35')]);_0x16993f[_0x91cb('0x36')]=_['intersection'](_0x16993f[_0x91cb('0x32')],_0x16993f[_0x91cb('0x35')]);_0x49bc42['attributes']=_[_0x91cb('0x37')](_0x16993f[_0x91cb('0x32')],qs[_0x91cb('0x38')](_0x325dca[_0x91cb('0x35')][_0x91cb('0x38')]));_0x49bc42[_0x91cb('0x39')]=_0x49bc42[_0x91cb('0x39')][_0x91cb('0x48')]?_0x49bc42[_0x91cb('0x39')]:_0x16993f['model'];if(_0x325dca[_0x91cb('0x35')][_0x91cb('0x42')]){_0x49bc42[_0x91cb('0x49')]=[{'all':!![]}];}_0x49bc42=_[_0x91cb('0x3f')]({},_0x49bc42,_0x325dca[_0x91cb('0x4a')]);return db[_0x91cb('0x2d')][_0x91cb('0x4b')](_0x49bc42)[_0x91cb('0x25')](handleEntityNotFound(_0x3cc4c1,null))['then'](respondWithResult(_0x3cc4c1,null))[_0x91cb('0x45')](handleError(_0x3cc4c1,null));};exports[_0x91cb('0x4c')]=function(_0x2b8b7f,_0x3b8cfd){return db['ScreenRecording'][_0x91cb('0x4c')](_0x2b8b7f[_0x91cb('0x4d')],{})['then'](respondWithResult(_0x3b8cfd,0xc9))[_0x91cb('0x45')](handleError(_0x3b8cfd,null));};exports['update']=function(_0x2c419b,_0x4c0acd){if(_0x2c419b['body']['id']){delete _0x2c419b['body']['id'];}delete _0x2c419b[_0x91cb('0x4d')][_0x91cb('0x4e')];delete _0x2c419b[_0x91cb('0x4d')][_0x91cb('0x4f')];delete _0x2c419b[_0x91cb('0x4d')]['closedAt'];delete _0x2c419b['body'][_0x91cb('0x50')];return db[_0x91cb('0x2d')][_0x91cb('0x4b')]({'where':{'id':_0x2c419b[_0x91cb('0x51')]['id']}})['then'](handleEntityNotFound(_0x4c0acd,null))['then'](saveUpdates(_0x2c419b['body'],null))[_0x91cb('0x25')](respondWithResult(_0x4c0acd,null))['catch'](handleError(_0x4c0acd,null));};exports[_0x91cb('0x52')]=function(_0x4aa670,_0x21463a){return db[_0x91cb('0x2d')][_0x91cb('0x52')]()[_0x91cb('0x25')](respondWithResult(_0x21463a,null))[_0x91cb('0x45')](handleError(_0x21463a,null));};exports[_0x91cb('0x53')]=function(_0x3ec250,_0x30fd4e,_0xff7c3f){var _0x20fc0a=require(_0x91cb('0x54'));var _0x5752ed=![];var _0x1e445a={};if(_0x3ec250[_0x91cb('0x35')]['type']&&_0x3ec250[_0x91cb('0x35')][_0x91cb('0x30')]==='uniqueid'){_0x1e445a[_0x91cb('0x55')]=_0x3ec250[_0x91cb('0x51')]['id'];}else{_0x1e445a['id']=_0x3ec250[_0x91cb('0x51')]['id'];}return db[_0x91cb('0x2d')][_0x91cb('0x4b')]({'where':_0x1e445a,'attributes':['id',_0x91cb('0x50')],'raw':!![]})[_0x91cb('0x25')](handleEntityNotFound(_0x30fd4e,null))[_0x91cb('0x25')](function(_0x3320bd){if(_0x3320bd){var _0x93ef52=path[_0x91cb('0x56')](config['root'],_0x91cb('0x57'),_0x3320bd['value']);var _0x37221e=util['format'](_0x91cb('0x58'),_0x93ef52);if(fs[_0x91cb('0x59')](_0x37221e)){_0x5752ed=!![];return _0x20fc0a[_0x91cb('0x5a')](_0x37221e,_0x93ef52,config['secrets'][_0x91cb('0x5b')])[_0x91cb('0x25')](function(){return _0x3320bd;});}return _0x3320bd;}})['then'](function(_0xef4754){if(_0xef4754){var _0x102025=path[_0x91cb('0x56')](config[_0x91cb('0x5c')],'server/files/screen_recordings',_0xef4754[_0x91cb('0x50')]);if(!fs[_0x91cb('0x59')](_0x102025)){throw new db[(_0x91cb('0x5d'))][(_0x91cb('0x5e'))]('ScreenRecording\x20not\x20found');}if(_0xef4754[_0x91cb('0x5f')]){return _0x30fd4e[_0x91cb('0x53')](_0x102025,_0xef4754['filename']+path['extname'](_0x102025),function(){if(_0x5752ed){fs[_0x91cb('0x60')](_0x102025);}});}else{return _0x30fd4e['download'](_0x102025,function(_0x1180ac){if(_0x5752ed){fs[_0x91cb('0x60')](_0x102025);}});}}})['catch'](function(_0x4f19c8){if(_0x4f19c8[_0x91cb('0x61')]==='ScreenRecording\x20not\x20found'){_0x30fd4e[_0x91cb('0x1a')](0x194)[_0x91cb('0x2a')](_0x91cb('0x62'));}else{return handleError(_0x30fd4e,null);}});};exports['destroy']=function(_0x22fea8,_0x524400){return db[_0x91cb('0x2d')][_0x91cb('0x4b')]({'where':{'id':_0x22fea8[_0x91cb('0x51')]['id']}})[_0x91cb('0x25')](function(_0x483172){if(_[_0x91cb('0x63')](_0x483172)){throw new ReferenceError(_0x91cb('0x64'));}return _0x483172;})[_0x91cb('0x25')](function(_0x443c72){var _0xaf70c5=path[_0x91cb('0x56')](config[_0x91cb('0x5c')],_0x91cb('0x57'),_0x443c72[_0x91cb('0x50')]);logger[_0x91cb('0x65')](_0x91cb('0x66'),_0xaf70c5);if(!_[_0x91cb('0x63')](_0x443c72['value'])&&fs[_0x91cb('0x59')](_0xaf70c5)){logger[_0x91cb('0x65')](_0x91cb('0x67')+_0xaf70c5+_0x91cb('0x68'));fs[_0x91cb('0x69')](_0xaf70c5);}_0xaf70c5=_0xaf70c5+_0x91cb('0x6a');if(!_[_0x91cb('0x63')](_0x443c72['value'])&&fs[_0x91cb('0x59')](_0xaf70c5)){logger['info'](_0x91cb('0x67')+_0xaf70c5+_0x91cb('0x68'));fs[_0x91cb('0x69')](_0xaf70c5);}return _0x443c72;})[_0x91cb('0x25')](function(_0x48fcfe){if(!_0x48fcfe)throw new InternalError();return _0x48fcfe[_0x91cb('0x26')]();})[_0x91cb('0x25')](function(){_0x524400[_0x91cb('0x1a')](0xcc)[_0x91cb('0x1b')]();})[_0x91cb('0x45')](handleError(_0x524400,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index defeedc..4c71dac 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 _0xcf95=['screen_recordings','interactionid','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./screenRecording.attributes','exports','define'];(function(_0x22ce56,_0xec1274){var _0x66390=function(_0x3b92a9){while(--_0x3b92a9){_0x22ce56['push'](_0x22ce56['shift']());}};_0x66390(++_0xec1274);}(_0xcf95,0x18e));var _0x5cf9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcf95[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5cf9('0x0'));var util=require('util');var logger=require(_0x5cf9('0x1'))(_0x5cf9('0x2'));var moment=require(_0x5cf9('0x3'));var BPromise=require('bluebird');var rp=require(_0x5cf9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5cf9('0x5'));var config=require(_0x5cf9('0x6'));var attributes=require(_0x5cf9('0x7'));module[_0x5cf9('0x8')]=function(_0x353cf2,_0x59ff42){return _0x353cf2[_0x5cf9('0x9')]('ScreenRecording',attributes,{'tableName':_0x5cf9('0xa'),'paranoid':![],'indexes':[{'name':_0x5cf9('0xb'),'fields':[_0x5cf9('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x33a3=['path','rimraf','../../config/environment','define','ScreenRecording','interactionid','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0x33a3,0x103));var _0x333a=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x33a3[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x333a('0x0'))(_0x333a('0x1'));var moment=require(_0x333a('0x2'));var BPromise=require(_0x333a('0x3'));var rp=require(_0x333a('0x4'));var fs=require('fs');var path=require(_0x333a('0x5'));var rimraf=require(_0x333a('0x6'));var config=require(_0x333a('0x7'));var attributes=require('./screenRecording.attributes');module['exports']=function(_0x2d5813,_0x183963){return _0x2d5813[_0x333a('0x8')](_0x333a('0x9'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x333a('0xa'),'fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 5e9bfc9..5100c66 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 _0x60a3=['result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','ScreenRecording,\x20%s,\x20%s','request\x20sent','ScreenRecording,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x498c85,_0x4bd176){var _0x33e3ef=function(_0x37634b){while(--_0x37634b){_0x498c85['push'](_0x498c85['shift']());}};_0x33e3ef(++_0x4bd176);}(_0x60a3,0xbf));var _0x360a=function(_0x3a07d4,_0x3e0ce4){_0x3a07d4=_0x3a07d4-0x0;var _0x563d32=_0x60a3[_0x3a07d4];return _0x563d32;};'use strict';var _=require(_0x360a('0x0'));var util=require(_0x360a('0x1'));var moment=require(_0x360a('0x2'));var BPromise=require('bluebird');var rs=require(_0x360a('0x3'));var fs=require('fs');var Redis=require(_0x360a('0x4'));var db=require(_0x360a('0x5'))['db'];var utils=require(_0x360a('0x6'));var logger=require(_0x360a('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x360a('0x8'));var client=jayson[_0x360a('0x9')][_0x360a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3abcd5,_0x259666,_0x37fb33){return new BPromise(function(_0x2cdfa7,_0x170f2d){return client[_0x360a('0xb')](_0x3abcd5,_0x37fb33)['then'](function(_0x665882){logger['info'](_0x360a('0xc'),_0x259666,_0x360a('0xd'));logger['debug'](_0x360a('0xe'),_0x259666,_0x360a('0xd'),JSON['stringify'](_0x665882));if(_0x665882[_0x360a('0xf')]){if(_0x665882[_0x360a('0xf')][_0x360a('0x10')]===0x1f4){logger['error'](_0x360a('0xc'),_0x259666,_0x665882['error'][_0x360a('0x11')]);return _0x170f2d(_0x665882[_0x360a('0xf')]['message']);}logger[_0x360a('0xf')](_0x360a('0xc'),_0x259666,_0x665882['error'][_0x360a('0x11')]);return _0x2cdfa7(_0x665882[_0x360a('0xf')][_0x360a('0x11')]);}else{logger[_0x360a('0x12')](_0x360a('0xc'),_0x259666,_0x360a('0xd'));_0x2cdfa7(_0x665882[_0x360a('0x13')][_0x360a('0x11')]);}})[_0x360a('0x14')](function(_0x1f50a6){logger[_0x360a('0xf')](_0x360a('0xc'),_0x259666,_0x1f50a6);_0x170f2d(_0x1f50a6);});});} \ No newline at end of file +var _0x8787=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ScreenRecording,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash'];(function(_0xe2406d,_0x20b53e){var _0x38826b=function(_0x238edf){while(--_0x238edf){_0xe2406d['push'](_0xe2406d['shift']());}};_0x38826b(++_0x20b53e);}(_0x8787,0x158));var _0x7878=function(_0x2480cd,_0x433aec){_0x2480cd=_0x2480cd-0x0;var _0x1ca300=_0x8787[_0x2480cd];return _0x1ca300;};'use strict';var _=require(_0x7878('0x0'));var util=require(_0x7878('0x1'));var moment=require('moment');var BPromise=require(_0x7878('0x2'));var rs=require(_0x7878('0x3'));var fs=require('fs');var Redis=require(_0x7878('0x4'));var db=require(_0x7878('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7878('0x6'))(_0x7878('0x7'));var config=require('../../config/environment');var jayson=require(_0x7878('0x8'));var client=jayson[_0x7878('0x9')][_0x7878('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7955d1,_0x2e4213,_0x257c26){return new BPromise(function(_0x51bb9f,_0x2d569a){return client[_0x7878('0xb')](_0x7955d1,_0x257c26)[_0x7878('0xc')](function(_0x2bbf8c){logger[_0x7878('0xd')](_0x7878('0xe'),_0x2e4213,'request\x20sent');logger[_0x7878('0xf')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x2e4213,_0x7878('0x10'),JSON[_0x7878('0x11')](_0x2bbf8c));if(_0x2bbf8c[_0x7878('0x12')]){if(_0x2bbf8c['error'][_0x7878('0x13')]===0x1f4){logger[_0x7878('0x12')](_0x7878('0xe'),_0x2e4213,_0x2bbf8c[_0x7878('0x12')][_0x7878('0x14')]);return _0x2d569a(_0x2bbf8c[_0x7878('0x12')][_0x7878('0x14')]);}logger[_0x7878('0x12')](_0x7878('0xe'),_0x2e4213,_0x2bbf8c['error'][_0x7878('0x14')]);return _0x51bb9f(_0x2bbf8c[_0x7878('0x12')][_0x7878('0x14')]);}else{logger[_0x7878('0xd')](_0x7878('0xe'),_0x2e4213,_0x7878('0x10'));_0x51bb9f(_0x2bbf8c[_0x7878('0x15')][_0x7878('0x14')]);}})[_0x7878('0x16')](function(_0x5e55a2){logger['error']('ScreenRecording,\x20%s,\x20%s',_0x2e4213,_0x5e55a2);_0x2d569a(_0x5e55a2);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 681663e..a8ea2b7 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 _0x69d6=['/:id/logo_login','getLogoLogin','/:id/gdpr','/:id/preferred','/:id/favicon','getFavicon','diskStorage','root','server/files/images/logos/','%s%s','extname','originalname','file','logologin','post','single','format','addPreferred','join','favicon','addFavicon','put','isAuthenticated','update','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./setting.controller','index','get','/now','getDate','/:id','show','/:id/logo'];(function(_0x1dcca3,_0x1c727c){var _0x4835f9=function(_0x33b94a){while(--_0x33b94a){_0x1dcca3['push'](_0x1dcca3['shift']());}};_0x4835f9(++_0x1c727c);}(_0x69d6,0x69));var _0x669d=function(_0xb571d0,_0xf3430b){_0xb571d0=_0xb571d0-0x0;var _0x4b89b7=_0x69d6[_0xb571d0];return _0x4b89b7;};'use strict';var multer=require('multer');var util=require(_0x669d('0x0'));var path=require(_0x669d('0x1'));var timeout=require('connect-timeout');var express=require(_0x669d('0x2'));var router=express[_0x669d('0x3')]();var fs_extra=require(_0x669d('0x4'));var auth=require(_0x669d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x669d('0x6'));var controller=require(_0x669d('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x669d('0x8')]);router[_0x669d('0x9')](_0x669d('0xa'),controller[_0x669d('0xb')]);router['get'](_0x669d('0xc'),controller[_0x669d('0xd')]);router[_0x669d('0x9')](_0x669d('0xe'),controller['getLogo']);router[_0x669d('0x9')](_0x669d('0xf'),controller[_0x669d('0x10')]);router[_0x669d('0x9')](_0x669d('0x11'),controller['gdpr']);router[_0x669d('0x9')](_0x669d('0x12'),controller['getPreferred']);router[_0x669d('0x9')](_0x669d('0x13'),controller[_0x669d('0x14')]);var upload=multer({'storage':multer[_0x669d('0x15')]({'destination':function(_0x3dc109,_0x44c935,_0x2f770d){_0x2f770d(null,path['join'](config[_0x669d('0x16')],_0x669d('0x17')));},'filename':function(_0x38c512,_0x127ef5,_0x266dfc){_0x266dfc(null,util['format'](_0x669d('0x18'),'logo',path[_0x669d('0x19')](_0x127ef5[_0x669d('0x1a')])));}})});router['post'](_0x669d('0xe'),upload['single'](_0x669d('0x1b')),controller['addLogo']);var upload=multer({'storage':multer[_0x669d('0x15')]({'destination':function(_0x1ae3f4,_0x3c1391,_0x4b5963){_0x4b5963(null,path['join'](config[_0x669d('0x16')],_0x669d('0x17')));},'filename':function(_0x2156c5,_0x39a377,_0x5b0ab8){_0x5b0ab8(null,util['format'](_0x669d('0x18'),_0x669d('0x1c'),path['extname'](_0x39a377[_0x669d('0x1a')])));}})});router[_0x669d('0x1d')](_0x669d('0xf'),upload[_0x669d('0x1e')]('file'),controller['addLogoLogin']);var upload=multer({'storage':multer[_0x669d('0x15')]({'destination':function(_0x14b098,_0x579be9,_0x442e8b){_0x442e8b(null,path['join'](config[_0x669d('0x16')],_0x669d('0x17')));},'filename':function(_0x4f4496,_0xb897eb,_0x269672){_0x269672(null,util[_0x669d('0x1f')](_0x669d('0x18'),'preferred',path[_0x669d('0x19')](_0xb897eb[_0x669d('0x1a')])));}})});router[_0x669d('0x1d')](_0x669d('0x12'),upload[_0x669d('0x1e')]('file'),controller[_0x669d('0x20')]);var upload=multer({'storage':multer[_0x669d('0x15')]({'destination':function(_0x1fda48,_0xd532b3,_0x314535){_0x314535(null,path[_0x669d('0x21')](config['root'],'server/files/images/logos/'));},'filename':function(_0x312b0d,_0x3d6b31,_0x5a8d39){_0x5a8d39(null,util[_0x669d('0x1f')](_0x669d('0x18'),_0x669d('0x22'),path['extname'](_0x3d6b31[_0x669d('0x1a')])));}})});router['post'](_0x669d('0x13'),upload[_0x669d('0x1e')](_0x669d('0x1b')),controller[_0x669d('0x23')]);router[_0x669d('0x24')](_0x669d('0xc'),auth[_0x669d('0x25')](),controller[_0x669d('0x26')]);module[_0x669d('0x27')]=router; \ No newline at end of file +var _0x17ab=['/:id','/:id/logo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','root','server/files/images/logos/','format','%s%s','logo','extname','originalname','post','file','addLogo','join','logologin','single','addLogoLogin','preferred','addPreferred','favicon','addFavicon','put','update','exports','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','getDate'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x17ab,0x154));var _0xb17a=function(_0x1105bc,_0x45f698){_0x1105bc=_0x1105bc-0x0;var _0x46a675=_0x17ab[_0x1105bc];return _0x46a675;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb17a('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb17a('0x1')]();var fs_extra=require(_0xb17a('0x2'));var auth=require(_0xb17a('0x3'));var interaction=require(_0xb17a('0x4'));var config=require(_0xb17a('0x5'));var controller=require(_0xb17a('0x6'));router[_0xb17a('0x7')]('/',auth[_0xb17a('0x8')](),controller[_0xb17a('0x9')]);router[_0xb17a('0x7')](_0xb17a('0xa'),controller[_0xb17a('0xb')]);router[_0xb17a('0x7')](_0xb17a('0xc'),controller['show']);router[_0xb17a('0x7')](_0xb17a('0xd'),controller['getLogo']);router[_0xb17a('0x7')](_0xb17a('0xe'),controller[_0xb17a('0xf')]);router[_0xb17a('0x7')](_0xb17a('0x10'),controller[_0xb17a('0x11')]);router[_0xb17a('0x7')](_0xb17a('0x12'),controller[_0xb17a('0x13')]);router[_0xb17a('0x7')](_0xb17a('0x14'),controller[_0xb17a('0x15')]);var upload=multer({'storage':multer[_0xb17a('0x16')]({'destination':function(_0x2dd517,_0x5142c5,_0x4704b5){_0x4704b5(null,path['join'](config[_0xb17a('0x17')],_0xb17a('0x18')));},'filename':function(_0xa9dcc2,_0xa4b09b,_0xbf5965){_0xbf5965(null,util[_0xb17a('0x19')](_0xb17a('0x1a'),_0xb17a('0x1b'),path[_0xb17a('0x1c')](_0xa4b09b[_0xb17a('0x1d')])));}})});router[_0xb17a('0x1e')](_0xb17a('0xd'),upload['single'](_0xb17a('0x1f')),controller[_0xb17a('0x20')]);var upload=multer({'storage':multer[_0xb17a('0x16')]({'destination':function(_0xc6eae3,_0x5f0034,_0x1941c5){_0x1941c5(null,path[_0xb17a('0x21')](config['root'],_0xb17a('0x18')));},'filename':function(_0x5ecbbe,_0x4baf69,_0xca6d18){_0xca6d18(null,util[_0xb17a('0x19')](_0xb17a('0x1a'),_0xb17a('0x22'),path['extname'](_0x4baf69[_0xb17a('0x1d')])));}})});router[_0xb17a('0x1e')](_0xb17a('0xe'),upload[_0xb17a('0x23')](_0xb17a('0x1f')),controller[_0xb17a('0x24')]);var upload=multer({'storage':multer[_0xb17a('0x16')]({'destination':function(_0x17f4ff,_0x3b9ca6,_0x4f1f5c){_0x4f1f5c(null,path[_0xb17a('0x21')](config[_0xb17a('0x17')],_0xb17a('0x18')));},'filename':function(_0x4f2737,_0x3972a8,_0x148579){_0x148579(null,util['format'](_0xb17a('0x1a'),_0xb17a('0x25'),path[_0xb17a('0x1c')](_0x3972a8[_0xb17a('0x1d')])));}})});router['post'](_0xb17a('0x12'),upload[_0xb17a('0x23')]('file'),controller[_0xb17a('0x26')]);var upload=multer({'storage':multer[_0xb17a('0x16')]({'destination':function(_0x10071d,_0x3340ae,_0x5c6572){_0x5c6572(null,path[_0xb17a('0x21')](config[_0xb17a('0x17')],'server/files/images/logos/'));},'filename':function(_0xf31b73,_0x23de4a,_0x49377a){_0x49377a(null,util[_0xb17a('0x19')](_0xb17a('0x1a'),_0xb17a('0x27'),path[_0xb17a('0x1c')](_0x23de4a['originalname'])));}})});router[_0xb17a('0x1e')](_0xb17a('0x14'),upload[_0xb17a('0x23')]('file'),controller[_0xb17a('0x28')]);router[_0xb17a('0x29')](_0xb17a('0xc'),auth[_0xb17a('0x8')](),controller[_0xb17a('0x2a')]);module[_0xb17a('0x2b')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 13a41c4..ffae03f 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 _0xd6b3=['alternate','UNSIGNED','sequelize','exports','INTEGER','min_internal','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd6b3,0x1e8));var _0x3d6b=function(_0xac0822,_0x2e5253){_0xac0822=_0xac0822-0x0;var _0x4ad4e5=_0xd6b3[_0xac0822];return _0x4ad4e5;};'use strict';var Sequelize=require(_0x3d6b('0x0'));module[_0x3d6b('0x1')]={'min_internal':{'type':Sequelize[_0x3d6b('0x2')](0xb),'unique':_0x3d6b('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x3d6b('0x2')](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x3d6b('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x3d6b('0x4')],'defaultValue':_0x3d6b('0x5')},'logo':{'type':Sequelize[_0x3d6b('0x4')]},'defaultLogo':{'type':Sequelize[_0x3d6b('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x3d6b('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x3d6b('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x3d6b('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x3d6b('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x3d6b('0x4')]},'turnaddr':{'type':Sequelize['STRING']},'turnusername':{'type':Sequelize[_0x3d6b('0x4')]},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x3d6b('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x3d6b('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x3d6b('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x3d6b('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x3d6b('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize[_0x3d6b('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x3d6b('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x3d6b('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x3d6b('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x3d6b('0x4')],'defaultValue':_0x3d6b('0x7')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x3d6b('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x3d6b('0x4')]},'defaultPreferred':{'type':Sequelize[_0x3d6b('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x3d6b('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize[_0x3d6b('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x3d6b('0x4')]},'defaultFavicon':{'type':Sequelize[_0x3d6b('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x3d6b('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x3d6b('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x3d6b('0x2')]},'transcribeRegion':{'type':Sequelize[_0x3d6b('0x4')]},'sentiment':{'type':Sequelize[_0x3d6b('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x3d6b('0x2')]},'sentimentRegion':{'type':Sequelize[_0x3d6b('0x4')]},'language':{'type':Sequelize[_0x3d6b('0x4')]},'bucket':{'type':Sequelize[_0x3d6b('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x3d6b('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x3d6b('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x3d6b('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x3d6b('0x2')](0x2)[_0x3d6b('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x3d6b('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x3d6b('0x2')](0x2)[_0x3d6b('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x3d6b('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x3d6b('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x3d6b('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x3d6b('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x3d6b('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize[_0x3d6b('0x6')],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x3d6b('0x2')],'defaultValue':0x14},'filterFullName':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x5cea=['min_internal','STRING','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','UNSIGNED','sequelize','INTEGER'];(function(_0x72895a,_0x433607){var _0x5226d5=function(_0x5b7d21){while(--_0x5b7d21){_0x72895a['push'](_0x72895a['shift']());}};_0x5226d5(++_0x433607);}(_0x5cea,0x15c));var _0xa5ce=function(_0x1b7ed6,_0x2387bc){_0x1b7ed6=_0x1b7ed6-0x0;var _0x3d3655=_0x5cea[_0x1b7ed6];return _0x3d3655;};'use strict';var Sequelize=require(_0xa5ce('0x0'));module['exports']={'min_internal':{'type':Sequelize[_0xa5ce('0x1')](0xb),'unique':_0xa5ce('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xa5ce('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xa5ce('0x3')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize[_0xa5ce('0x3')]},'defaultLogo':{'type':Sequelize[_0xa5ce('0x4')],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize[_0xa5ce('0x4')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xa5ce('0x3')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xa5ce('0x4')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0xa5ce('0x4')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xa5ce('0x3')]},'turnaddr':{'type':Sequelize[_0xa5ce('0x3')]},'turnusername':{'type':Sequelize[_0xa5ce('0x3')]},'turnpassword':{'type':Sequelize[_0xa5ce('0x3')]},'pageTitle':{'type':Sequelize[_0xa5ce('0x3')]},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xa5ce('0x4')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0xa5ce('0x5')},'enableEmailPreview':{'type':Sequelize[_0xa5ce('0x4')],'defaultValue':![]},'split':{'type':Sequelize[_0xa5ce('0x4')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xa5ce('0x1')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xa5ce('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xa5ce('0x3')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize[_0xa5ce('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xa5ce('0x4')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xa5ce('0x4')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xa5ce('0x3')]},'allowedLoginAttempts':{'type':Sequelize[_0xa5ce('0x1')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xa5ce('0x1')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0xa5ce('0x4')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xa5ce('0x1')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xa5ce('0x4')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0xa5ce('0x1')]},'transcribeRegion':{'type':Sequelize[_0xa5ce('0x3')]},'sentiment':{'type':Sequelize[_0xa5ce('0x4')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xa5ce('0x4')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xa5ce('0x1')]},'sentimentRegion':{'type':Sequelize[_0xa5ce('0x3')]},'language':{'type':Sequelize[_0xa5ce('0x3')]},'bucket':{'type':Sequelize[_0xa5ce('0x3')]},'googleSsoEnabled':{'type':Sequelize[_0xa5ce('0x4')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xa5ce('0x4')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0xa5ce('0x4')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0xa5ce('0x1')](0x2)[_0xa5ce('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0xa5ce('0x1')](0x2)[_0xa5ce('0x6')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xa5ce('0x1')](0x2)[_0xa5ce('0x6')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0xa5ce('0x1')](0x2)[_0xa5ce('0x6')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xa5ce('0x4')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xa5ce('0x1')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0xa5ce('0x1')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xa5ce('0x1')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xa5ce('0x1')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0xa5ce('0x1')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0xa5ce('0x4')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0xa5ce('0x4')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize['INTEGER'],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize[_0xa5ce('0x4')],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0xa5ce('0x1')],'defaultValue':0x14},'filterFullName':{'type':Sequelize[_0xa5ce('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 012da1a..c2d4c61 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 _0xb9da=['http','request','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','stack','name','send','index','Setting','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','order','sort','pick','filter','where','merge','options','include','findAll','rows','show','params','includeAll','find','body','file','filename','getLogo','server/files/images/logos','getLicense','loginLogo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','logo','existsSync','join','toLower','root','default_logo.svg','default','custom','Sequelize','ValidationError','upperFirst','\x20not\x20found','download','getLogoLogin','default_loginLogo.svg','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','jayson/promise','client'];(function(_0x2d61df,_0x49c811){var _0x5c4331=function(_0x738bdc){while(--_0x738bdc){_0x2d61df['push'](_0x2d61df['shift']());}};_0x5c4331(++_0x49c811);}(_0xb9da,0x1d6));var _0xab9d=function(_0x2d5805,_0x21954e){_0x2d5805=_0x2d5805-0x0;var _0x1cae4f=_0xb9da[_0x2d5805];return _0x1cae4f;};'use strict';var emlformat=require(_0xab9d('0x0'));var rimraf=require(_0xab9d('0x1'));var zipdir=require(_0xab9d('0x2'));var jsonpatch=require(_0xab9d('0x3'));var rp=require('request-promise');var moment=require(_0xab9d('0x4'));var BPromise=require(_0xab9d('0x5'));var Mustache=require(_0xab9d('0x6'));var util=require(_0xab9d('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xab9d('0x8'));var ejs=require(_0xab9d('0x9'));var fs=require('fs');var fs_extra=require(_0xab9d('0xa'));var _=require(_0xab9d('0xb'));var squel=require(_0xab9d('0xc'));var crypto=require(_0xab9d('0xd'));var jsforce=require(_0xab9d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xab9d('0x8'));var querystring=require('querystring');var Papa=require(_0xab9d('0xf'));var Redis=require(_0xab9d('0x10'));var authService=require(_0xab9d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xab9d('0x12'));var hardwareService=require(_0xab9d('0x13'));var logger=require(_0xab9d('0x14'))(_0xab9d('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xab9d('0x16'));var db=require(_0xab9d('0x17'))['db'];var jayson=require(_0xab9d('0x18'));var client=jayson[_0xab9d('0x19')][_0xab9d('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0xa70572,_0x35ff1a,_0x218803,_0x4e9c25){return new BPromise(function(_0x416005,_0x4431bc){var _0x4a0a66=_0x4e9c25||client;return _0x4a0a66[_0xab9d('0x1b')](_0xa70572,_0x218803)['then'](function(_0xfbff88){logger[_0xab9d('0x1c')](_0xab9d('0x1d'),_0x35ff1a,'request\x20sent');logger[_0xab9d('0x1e')](_0xab9d('0x1f'),_0x35ff1a,_0xab9d('0x20'),JSON[_0xab9d('0x21')](_0xfbff88));if(_0xfbff88[_0xab9d('0x22')]){if(_0xfbff88[_0xab9d('0x22')]['code']===0x1f4){logger['error']('Setting,\x20%s,\x20%s',_0x35ff1a,_0xfbff88[_0xab9d('0x22')]['message']);return _0x4431bc(_0xfbff88[_0xab9d('0x22')][_0xab9d('0x23')]);}logger[_0xab9d('0x22')](_0xab9d('0x1d'),_0x35ff1a,_0xfbff88['error']['message']);return _0x416005(_0xfbff88[_0xab9d('0x22')]['message']);}else{logger[_0xab9d('0x1c')](_0xab9d('0x1d'),_0x35ff1a,_0xab9d('0x20'));_0x416005(_0xfbff88['result']['message']);}})[_0xab9d('0x24')](function(_0x1c32ce){logger[_0xab9d('0x22')](_0xab9d('0x1d'),_0x35ff1a,_0x1c32ce);_0x4431bc(_0x1c32ce);});});}function respondWithStatusCode(_0x3f1afb,_0x414f03){_0x414f03=_0x414f03||0xcc;return function(_0x21d727){if(_0x21d727){return _0x3f1afb[_0xab9d('0x25')](_0x414f03);}return _0x3f1afb['status'](_0x414f03)[_0xab9d('0x26')]();};}function respondWithResult(_0x15b4d5,_0x4e89ec){_0x4e89ec=_0x4e89ec||0xc8;return function(_0x185b45){if(_0x185b45){return _0x15b4d5[_0xab9d('0x27')](_0x4e89ec)[_0xab9d('0x28')](_0x185b45);}};}function respondWithFilteredResult(_0x4810b4,_0xb70788){return function(_0x9954fb){if(_0x9954fb){var _0x4b144b=typeof _0xb70788[_0xab9d('0x29')]===_0xab9d('0x2a')&&typeof _0xb70788[_0xab9d('0x2b')]==='undefined';var _0x5d3ca5=_0x9954fb[_0xab9d('0x2c')];var _0x2fdc2f=_0x4b144b?0x0:_0xb70788[_0xab9d('0x29')];var _0x3663a4=_0x4b144b?_0x9954fb[_0xab9d('0x2c')]:_0xb70788[_0xab9d('0x29')]+_0xb70788[_0xab9d('0x2b')];var _0x250d4a;if(_0x3663a4>=_0x5d3ca5){_0x3663a4=_0x5d3ca5;_0x250d4a=0xc8;}else{_0x250d4a=0xce;}_0x4810b4['status'](_0x250d4a);return _0x4810b4[_0xab9d('0x2d')]('Content-Range',_0x2fdc2f+'-'+_0x3663a4+'/'+_0x5d3ca5)[_0xab9d('0x28')](_0x9954fb);}return null;};}function patchUpdates(_0x2815d0){return function(_0x38c0a3){try{jsonpatch[_0xab9d('0x2e')](_0x38c0a3,_0x2815d0,!![]);}catch(_0x4f3f80){return BPromise[_0xab9d('0x2f')](_0x4f3f80);}return _0x38c0a3['save']();};}function saveUpdates(_0x4fdd45,_0x5dbbfa){return function(_0x3a3c22){if(_0x3a3c22){return _0x3a3c22[_0xab9d('0x30')](_0x4fdd45)[_0xab9d('0x31')](function(_0x2ebfd7){return _0x2ebfd7;});}return null;};}function removeEntity(_0x314d6c,_0x1a133b){return function(_0x5eaa20){if(_0x5eaa20){return _0x5eaa20[_0xab9d('0x32')]()[_0xab9d('0x31')](function(){_0x314d6c[_0xab9d('0x27')](0xcc)[_0xab9d('0x26')]();});}};}function handleEntityNotFound(_0x1ee2f9,_0x21546e){return function(_0x437122){if(!_0x437122){_0x1ee2f9[_0xab9d('0x25')](0x194);}return _0x437122;};}function handleError(_0x51b9a8,_0x3a286d){_0x3a286d=_0x3a286d||0x1f4;return function(_0x21694f){logger[_0xab9d('0x22')](_0x21694f[_0xab9d('0x33')]);if(_0x21694f[_0xab9d('0x34')]){delete _0x21694f[_0xab9d('0x34')];}_0x51b9a8[_0xab9d('0x27')](_0x3a286d)[_0xab9d('0x35')](_0x21694f);};}exports[_0xab9d('0x36')]=function(_0x4868b2,_0x4f9d3a){var _0x1cef51={},_0x5ee01a={},_0xab5b68={'count':0x0,'rows':[]};var _0x38cd54=_['map'](db[_0xab9d('0x37')][_0xab9d('0x38')],function(_0x1f552e){return{'name':_0x1f552e[_0xab9d('0x39')],'type':_0x1f552e[_0xab9d('0x3a')][_0xab9d('0x3b')]};});_0x5ee01a[_0xab9d('0x3c')]=_[_0xab9d('0x3d')](_0x38cd54,_0xab9d('0x34'));_0x5ee01a['query']=_[_0xab9d('0x3e')](_0x4868b2[_0xab9d('0x3f')]);_0x5ee01a[_0xab9d('0x40')]=_[_0xab9d('0x41')](_0x5ee01a['model'],_0x5ee01a['query']);_0x1cef51[_0xab9d('0x42')]=_[_0xab9d('0x41')](_0x5ee01a[_0xab9d('0x3c')],qs[_0xab9d('0x43')](_0x4868b2[_0xab9d('0x3f')]['fields']));_0x1cef51[_0xab9d('0x42')]=_0x1cef51[_0xab9d('0x42')][_0xab9d('0x44')]?_0x1cef51[_0xab9d('0x42')]:_0x5ee01a[_0xab9d('0x3c')];if(!_0x4868b2[_0xab9d('0x3f')]['hasOwnProperty']('nolimit')){_0x1cef51[_0xab9d('0x2b')]=qs[_0xab9d('0x2b')](_0x4868b2[_0xab9d('0x3f')][_0xab9d('0x2b')]);_0x1cef51[_0xab9d('0x29')]=qs[_0xab9d('0x29')](_0x4868b2[_0xab9d('0x3f')][_0xab9d('0x29')]);}_0x1cef51[_0xab9d('0x45')]=qs[_0xab9d('0x46')](_0x4868b2[_0xab9d('0x3f')]['sort']);_0x1cef51['where']=qs[_0xab9d('0x40')](_[_0xab9d('0x47')](_0x4868b2[_0xab9d('0x3f')],_0x5ee01a['filters']),_0x38cd54);if(_0x4868b2[_0xab9d('0x3f')][_0xab9d('0x48')]){_0x1cef51[_0xab9d('0x49')]=_[_0xab9d('0x4a')](_0x1cef51[_0xab9d('0x49')],{'$or':_[_0xab9d('0x3d')](_0x38cd54,function(_0x256e80){if(_0x256e80[_0xab9d('0x3a')]!=='VIRTUAL'){var _0x397cd9={};_0x397cd9[_0x256e80['name']]={'$like':'%'+_0x4868b2[_0xab9d('0x3f')][_0xab9d('0x48')]+'%'};return _0x397cd9;}})});}_0x1cef51=_['merge']({},_0x1cef51,_0x4868b2[_0xab9d('0x4b')]);var _0x44f153={'where':_0x1cef51[_0xab9d('0x49')]};return db[_0xab9d('0x37')][_0xab9d('0x2c')](_0x44f153)[_0xab9d('0x31')](function(_0xf5f242){_0xab5b68[_0xab9d('0x2c')]=_0xf5f242;if(_0x4868b2[_0xab9d('0x3f')]['includeAll']){_0x1cef51[_0xab9d('0x4c')]=[{'all':!![]}];}return db[_0xab9d('0x37')][_0xab9d('0x4d')](_0x1cef51);})[_0xab9d('0x31')](function(_0x279957){_0xab5b68[_0xab9d('0x4e')]=_0x279957;return _0xab5b68;})[_0xab9d('0x31')](respondWithFilteredResult(_0x4f9d3a,_0x1cef51))[_0xab9d('0x24')](handleError(_0x4f9d3a,null));};exports[_0xab9d('0x4f')]=function(_0x348184,_0x47901c){var _0x3b5f06={'raw':![],'where':{'id':_0x348184[_0xab9d('0x50')]['id']}},_0x20c70b={};_0x20c70b[_0xab9d('0x3c')]=_[_0xab9d('0x3e')](db['Setting']['rawAttributes']);_0x20c70b['query']=_[_0xab9d('0x3e')](_0x348184['query']);_0x20c70b['filters']=_['intersection'](_0x20c70b[_0xab9d('0x3c')],_0x20c70b[_0xab9d('0x3f')]);_0x3b5f06[_0xab9d('0x42')]=_[_0xab9d('0x41')](_0x20c70b[_0xab9d('0x3c')],qs[_0xab9d('0x43')](_0x348184[_0xab9d('0x3f')][_0xab9d('0x43')]));_0x3b5f06[_0xab9d('0x42')]=_0x3b5f06[_0xab9d('0x42')]['length']?_0x3b5f06[_0xab9d('0x42')]:_0x20c70b[_0xab9d('0x3c')];if(_0x348184['query'][_0xab9d('0x51')]){_0x3b5f06[_0xab9d('0x4c')]=[{'all':!![]}];}_0x3b5f06=_[_0xab9d('0x4a')]({},_0x3b5f06,_0x348184[_0xab9d('0x4b')]);return db[_0xab9d('0x37')][_0xab9d('0x52')](_0x3b5f06)['then'](handleEntityNotFound(_0x47901c,null))[_0xab9d('0x31')](respondWithResult(_0x47901c,null))['catch'](handleError(_0x47901c,null));};exports[_0xab9d('0x30')]=function(_0x590a4b,_0x16a51a){if(_0x590a4b[_0xab9d('0x53')]['id']){delete _0x590a4b[_0xab9d('0x53')]['id'];}return db[_0xab9d('0x37')]['find']({'where':{'id':_0x590a4b[_0xab9d('0x50')]['id']}})[_0xab9d('0x31')](handleEntityNotFound(_0x16a51a,null))[_0xab9d('0x31')](saveUpdates(_0x590a4b[_0xab9d('0x53')],null))[_0xab9d('0x31')](respondWithResult(_0x16a51a,null))[_0xab9d('0x24')](handleError(_0x16a51a,null));};exports['addLogo']=function(_0x3bf0f8,_0x4b09b6,_0x2ac841){if(_0x3bf0f8[_0xab9d('0x54')]&&_0x3bf0f8[_0xab9d('0x54')]['filename']){_0x3bf0f8[_0xab9d('0x53')]['logo']=_0x3bf0f8[_0xab9d('0x54')]['filename'];}return db[_0xab9d('0x37')][_0xab9d('0x52')]({'where':{'id':_0x3bf0f8['params']['id']}})[_0xab9d('0x31')](handleEntityNotFound(_0x4b09b6,null))[_0xab9d('0x31')](saveUpdates(_0x3bf0f8[_0xab9d('0x53')],null))['then'](respondWithResult(_0x4b09b6,null))[_0xab9d('0x24')](handleError(_0x4b09b6,null));};exports['addLogoLogin']=function(_0x994330,_0x5dc0ff,_0x151e86){if(_0x994330[_0xab9d('0x54')]&&_0x994330['file'][_0xab9d('0x55')]){_0x994330[_0xab9d('0x53')]['loginLogo']=_0x994330[_0xab9d('0x54')][_0xab9d('0x55')];}return db[_0xab9d('0x37')][_0xab9d('0x52')]({'where':{'id':_0x994330['params']['id']}})[_0xab9d('0x31')](handleEntityNotFound(_0x5dc0ff,null))[_0xab9d('0x31')](saveUpdates(_0x994330[_0xab9d('0x53')],null))['then'](respondWithResult(_0x5dc0ff,null))[_0xab9d('0x24')](handleError(_0x5dc0ff,null));};var utilLicense=require('../../config/license/util');exports[_0xab9d('0x56')]=function(_0x255a4e,_0x504fa3,_0x6b6f78){var _0xc9251d=_0xab9d('0x57');var _0x5e8b57={'custom':![]};return utilLicense[_0xab9d('0x58')]()[_0xab9d('0x31')](function(_0xa4e46d){if(_0xa4e46d){_0x5e8b57=_0xa4e46d;}return db[_0xab9d('0x37')][_0xab9d('0x52')]({'where':{'id':_0x255a4e['params']['id']},'attributes':['logo',_0xab9d('0x59'),_0xab9d('0x5a'),_0xab9d('0x5b'),_0xab9d('0x5c'),_0xab9d('0x5d'),_0xab9d('0x5e'),_0xab9d('0x5f')],'raw':!![]});})[_0xab9d('0x31')](handleEntityNotFound(_0x504fa3,null))[_0xab9d('0x31')](function(_0x4c9bbb){if(_0x4c9bbb){var _0x30fcb9=_0x4c9bbb[_0xab9d('0x60')]&&fs[_0xab9d('0x61')](path[_0xab9d('0x62')](config['root'],_0xc9251d,_[_0xab9d('0x63')](_0x4c9bbb[_0xab9d('0x60')])))?path[_0xab9d('0x62')](config[_0xab9d('0x64')],_0xc9251d,_[_0xab9d('0x63')](_0x4c9bbb[_0xab9d('0x60')])):path[_0xab9d('0x62')](config[_0xab9d('0x64')],_0xc9251d,_[_0xab9d('0x63')](_0xab9d('0x65')));var _0x173618=_0xab9d('0x66')+_['upperFirst'](_0xab9d('0x60'));if(_0x4c9bbb[_0x173618]||!_0x5e8b57[_0xab9d('0x67')]){_0x30fcb9=path[_0xab9d('0x62')](config[_0xab9d('0x64')],_0xc9251d,_[_0xab9d('0x63')]('default_logo.svg'));}if(!fs['existsSync'](_0x30fcb9)){throw new db[(_0xab9d('0x68'))][(_0xab9d('0x69'))](_[_0xab9d('0x6a')](_0xab9d('0x60'))+_0xab9d('0x6b'));}return _0x504fa3[_0xab9d('0x6c')](_0x30fcb9);}})[_0xab9d('0x24')](handleError(_0x504fa3,null));};var utilLicense=require('../../config/license/util');exports[_0xab9d('0x6d')]=function(_0x43d24a,_0x15f6e8,_0x2028cd){var _0x15a20e=_0xab9d('0x57');var _0x4ad617={'custom':![]};return utilLicense['getLicense']()[_0xab9d('0x31')](function(_0x2c161c){if(_0x2c161c){_0x4ad617=_0x2c161c;}return db[_0xab9d('0x37')][_0xab9d('0x52')]({'where':{'id':_0x43d24a[_0xab9d('0x50')]['id']},'attributes':[_0xab9d('0x60'),_0xab9d('0x59'),_0xab9d('0x5a'),_0xab9d('0x5b'),_0xab9d('0x5c'),_0xab9d('0x5d'),_0xab9d('0x5e'),_0xab9d('0x5f')],'raw':!![]});})[_0xab9d('0x31')](handleEntityNotFound(_0x15f6e8,null))['then'](function(_0x36af60){if(_0x36af60){var _0x3ba7db=_0x36af60[_0xab9d('0x59')]&&fs['existsSync'](path[_0xab9d('0x62')](config[_0xab9d('0x64')],_0x15a20e,_['toLower'](_0x36af60['loginLogo'])))?path[_0xab9d('0x62')](config['root'],_0x15a20e,_[_0xab9d('0x63')](_0x36af60[_0xab9d('0x59')])):path[_0xab9d('0x62')](config[_0xab9d('0x64')],_0x15a20e,_[_0xab9d('0x63')]('default_loginLogo.svg'));var _0x264ba2='default'+_[_0xab9d('0x6a')](_0xab9d('0x59'));if(_0x36af60[_0x264ba2]||!_0x4ad617[_0xab9d('0x67')]){_0x3ba7db=path[_0xab9d('0x62')](config['root'],_0x15a20e,_[_0xab9d('0x63')](_0xab9d('0x6e')));}if(!fs[_0xab9d('0x61')](_0x3ba7db)){throw new db[(_0xab9d('0x68'))][(_0xab9d('0x69'))](_[_0xab9d('0x6a')]('loginLogo')+'\x20not\x20found');}return _0x15f6e8['download'](_0x3ba7db);}})['catch'](handleError(_0x15f6e8,null));};exports[_0xab9d('0x6f')]=function(_0x270b8f,_0x520e5e){return db[_0xab9d('0x37')]['find']({'where':{'id':_0x270b8f[_0xab9d('0x50')]['id']},'attributes':[_0xab9d('0x70')]})['then'](respondWithResult(_0x520e5e,null))[_0xab9d('0x24')](handleError(_0x520e5e,null));};exports[_0xab9d('0x71')]=function(_0x31dac1,_0x4a7389,_0x290d09){if(_0x31dac1[_0xab9d('0x54')]&&_0x31dac1['file'][_0xab9d('0x55')]){_0x31dac1[_0xab9d('0x53')][_0xab9d('0x5a')]=_0x31dac1[_0xab9d('0x54')][_0xab9d('0x55')];}return db[_0xab9d('0x37')][_0xab9d('0x52')]({'where':{'id':_0x31dac1['params']['id']}})['then'](handleEntityNotFound(_0x4a7389,null))['then'](saveUpdates(_0x31dac1[_0xab9d('0x53')],null))[_0xab9d('0x31')](respondWithResult(_0x4a7389,null))['catch'](handleError(_0x4a7389,null));};var utilLicense=require(_0xab9d('0x16'));exports[_0xab9d('0x72')]=function(_0x597d2a,_0xc7a579,_0x2565bf){var _0x29e957=_0xab9d('0x57');var _0x121b58={'custom':![]};return utilLicense[_0xab9d('0x58')]()[_0xab9d('0x31')](function(_0x3c7e2e){if(_0x3c7e2e){_0x121b58=_0x3c7e2e;}return db['Setting'][_0xab9d('0x52')]({'where':{'id':_0x597d2a[_0xab9d('0x50')]['id']},'attributes':[_0xab9d('0x60'),_0xab9d('0x59'),_0xab9d('0x5a'),_0xab9d('0x5b'),_0xab9d('0x5c'),_0xab9d('0x5d'),_0xab9d('0x5e'),_0xab9d('0x5f')],'raw':!![]});})['then'](handleEntityNotFound(_0xc7a579,null))[_0xab9d('0x31')](function(_0x213b53){if(_0x213b53){var _0x3ff206=_0x213b53[_0xab9d('0x5a')]&&fs[_0xab9d('0x61')](path[_0xab9d('0x62')](config[_0xab9d('0x64')],_0x29e957,_[_0xab9d('0x63')](_0x213b53[_0xab9d('0x5a')])))?path[_0xab9d('0x62')](config[_0xab9d('0x64')],_0x29e957,_['toLower'](_0x213b53['preferred'])):path[_0xab9d('0x62')](config[_0xab9d('0x64')],_0x29e957,_[_0xab9d('0x63')](_0xab9d('0x73')));var _0x31e0ab=_0xab9d('0x66')+_[_0xab9d('0x6a')](_0xab9d('0x5a'));if(_0x213b53[_0x31e0ab]||!_0x121b58[_0xab9d('0x67')]||!_0x121b58[_0xab9d('0x5a')]){_0x3ff206=path[_0xab9d('0x62')](config[_0xab9d('0x64')],_0x29e957,_[_0xab9d('0x63')]('default_preferred.png'));}if(!fs['existsSync'](_0x3ff206)){throw new db['Sequelize']['ValidationError'](_[_0xab9d('0x6a')](_0xab9d('0x5a'))+_0xab9d('0x6b'));}return _0xc7a579['download'](_0x3ff206);}})[_0xab9d('0x24')](handleError(_0xc7a579,null));};exports[_0xab9d('0x74')]=function(_0x208756,_0x374d4f,_0x5e123b){if(_0x208756[_0xab9d('0x54')]&&_0x208756[_0xab9d('0x54')]['filename']){_0x208756[_0xab9d('0x53')][_0xab9d('0x5b')]=_0x208756[_0xab9d('0x54')]['filename'];}return db[_0xab9d('0x37')][_0xab9d('0x52')]({'where':{'id':_0x208756[_0xab9d('0x50')]['id']}})[_0xab9d('0x31')](handleEntityNotFound(_0x374d4f,null))['then'](saveUpdates(_0x208756[_0xab9d('0x53')],null))[_0xab9d('0x31')](respondWithResult(_0x374d4f,null))[_0xab9d('0x24')](handleError(_0x374d4f,null));};var utilLicense=require(_0xab9d('0x16'));exports[_0xab9d('0x75')]=function(_0x1908f2,_0x558879,_0x5980d7){var _0x13bb51='server/files/images/logos';var _0x2acd6f={'custom':![]};return utilLicense[_0xab9d('0x58')]()['then'](function(_0x4d4aa4){if(_0x4d4aa4){_0x2acd6f=_0x4d4aa4;}return db[_0xab9d('0x37')][_0xab9d('0x52')]({'where':{'id':_0x1908f2[_0xab9d('0x50')]['id']},'attributes':[_0xab9d('0x60'),_0xab9d('0x59'),_0xab9d('0x5a'),_0xab9d('0x5b'),_0xab9d('0x5c'),_0xab9d('0x5d'),_0xab9d('0x5e'),_0xab9d('0x5f')],'raw':!![]});})[_0xab9d('0x31')](handleEntityNotFound(_0x558879,null))['then'](function(_0x5c6a1c){if(_0x5c6a1c){var _0x5a28e8=_0x5c6a1c['favicon']&&fs[_0xab9d('0x61')](path['join'](config['root'],_0x13bb51,_[_0xab9d('0x63')](_0x5c6a1c['favicon'])))?path[_0xab9d('0x62')](config['root'],_0x13bb51,_[_0xab9d('0x63')](_0x5c6a1c['favicon'])):path[_0xab9d('0x62')](config[_0xab9d('0x64')],_0x13bb51,_[_0xab9d('0x63')](_0xab9d('0x76')));var _0x422adc=_0xab9d('0x66')+_['upperFirst'](_0xab9d('0x5b'));if(_0x5c6a1c[_0x422adc]||!_0x2acd6f[_0xab9d('0x67')]){_0x5a28e8=path[_0xab9d('0x62')](config['root'],_0x13bb51,_[_0xab9d('0x63')](_0xab9d('0x76')));}if(!fs[_0xab9d('0x61')](_0x5a28e8)){throw new db['Sequelize'][(_0xab9d('0x69'))](_[_0xab9d('0x6a')](_0xab9d('0x5b'))+_0xab9d('0x6b'));}return _0x558879['download'](_0x5a28e8);}})['catch'](handleError(_0x558879,null));};exports[_0xab9d('0x77')]=function(_0x151297,_0x44497b){var _0x133715={'offset':moment()[_0xab9d('0x78')]()};_0x133715[_0xab9d('0x79')]=moment()['utcOffset'](_0x133715[_0xab9d('0x29')])[_0xab9d('0x7a')](_0xab9d('0x7b'));return _0x44497b['status'](0xc8)['send'](_0x133715);}; \ No newline at end of file +var _0xdcab=['../../mysqldb','jayson/promise','http','request','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','Setting','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','find','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','join','root','toLower','default','upperFirst','custom','default_logo.svg','existsSync','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','server/files/images/logos','default_loginLogo.svg','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x52e187,_0xf0db3a){var _0x32cd17=function(_0xe9ffae){while(--_0xe9ffae){_0x52e187['push'](_0x52e187['shift']());}};_0x32cd17(++_0xf0db3a);}(_0xdcab,0x1e9));var _0xbdca=function(_0x594140,_0x21fa9d){_0x594140=_0x594140-0x0;var _0x179ec8=_0xdcab[_0x594140];return _0x179ec8;};'use strict';var emlformat=require(_0xbdca('0x0'));var rimraf=require(_0xbdca('0x1'));var zipdir=require(_0xbdca('0x2'));var jsonpatch=require(_0xbdca('0x3'));var rp=require(_0xbdca('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbdca('0x5'));var util=require(_0xbdca('0x6'));var path=require(_0xbdca('0x7'));var sox=require(_0xbdca('0x8'));var csv=require(_0xbdca('0x9'));var ejs=require(_0xbdca('0xa'));var fs=require('fs');var fs_extra=require(_0xbdca('0xb'));var _=require(_0xbdca('0xc'));var squel=require(_0xbdca('0xd'));var crypto=require(_0xbdca('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xbdca('0xf'));var toCsv=require('to-csv');var querystring=require(_0xbdca('0x10'));var Papa=require(_0xbdca('0x11'));var Redis=require(_0xbdca('0x12'));var authService=require(_0xbdca('0x13'));var qs=require(_0xbdca('0x14'));var as=require(_0xbdca('0x15'));var hardwareService=require(_0xbdca('0x16'));var logger=require(_0xbdca('0x17'))(_0xbdca('0x18'));var utils=require('../../config/utils');var config=require(_0xbdca('0x19'));var licenseUtil=require(_0xbdca('0x1a'));var db=require(_0xbdca('0x1b'))['db'];var jayson=require(_0xbdca('0x1c'));var client=jayson['client'][_0xbdca('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x559c84,_0x249f54,_0x446421,_0x115564){return new BPromise(function(_0x5c4080,_0x5775ef){var _0x18c27a=_0x115564||client;return _0x18c27a[_0xbdca('0x1e')](_0x559c84,_0x446421)[_0xbdca('0x1f')](function(_0x16944f){logger[_0xbdca('0x20')](_0xbdca('0x21'),_0x249f54,'request\x20sent');logger[_0xbdca('0x22')](_0xbdca('0x23'),_0x249f54,_0xbdca('0x24'),JSON[_0xbdca('0x25')](_0x16944f));if(_0x16944f['error']){if(_0x16944f[_0xbdca('0x26')][_0xbdca('0x27')]===0x1f4){logger[_0xbdca('0x26')](_0xbdca('0x21'),_0x249f54,_0x16944f['error'][_0xbdca('0x28')]);return _0x5775ef(_0x16944f[_0xbdca('0x26')]['message']);}logger[_0xbdca('0x26')](_0xbdca('0x21'),_0x249f54,_0x16944f['error'][_0xbdca('0x28')]);return _0x5c4080(_0x16944f[_0xbdca('0x26')][_0xbdca('0x28')]);}else{logger[_0xbdca('0x20')](_0xbdca('0x21'),_0x249f54,_0xbdca('0x24'));_0x5c4080(_0x16944f['result'][_0xbdca('0x28')]);}})[_0xbdca('0x29')](function(_0x4b73b1){logger['error'](_0xbdca('0x21'),_0x249f54,_0x4b73b1);_0x5775ef(_0x4b73b1);});});}function respondWithStatusCode(_0x3f581f,_0x3fb260){_0x3fb260=_0x3fb260||0xcc;return function(_0x27299c){if(_0x27299c){return _0x3f581f[_0xbdca('0x2a')](_0x3fb260);}return _0x3f581f[_0xbdca('0x2b')](_0x3fb260)[_0xbdca('0x2c')]();};}function respondWithResult(_0x379e58,_0x3b260c){_0x3b260c=_0x3b260c||0xc8;return function(_0x3a647c){if(_0x3a647c){return _0x379e58[_0xbdca('0x2b')](_0x3b260c)['json'](_0x3a647c);}};}function respondWithFilteredResult(_0x5ebea6,_0x4eecc1){return function(_0x4cdc60){if(_0x4cdc60){var _0x5d6cb8=typeof _0x4eecc1[_0xbdca('0x2d')]===_0xbdca('0x2e')&&typeof _0x4eecc1[_0xbdca('0x2f')]===_0xbdca('0x2e');var _0x452488=_0x4cdc60[_0xbdca('0x30')];var _0x4c495e=_0x5d6cb8?0x0:_0x4eecc1[_0xbdca('0x2d')];var _0x170948=_0x5d6cb8?_0x4cdc60['count']:_0x4eecc1[_0xbdca('0x2d')]+_0x4eecc1['limit'];var _0x3b6675;if(_0x170948>=_0x452488){_0x170948=_0x452488;_0x3b6675=0xc8;}else{_0x3b6675=0xce;}_0x5ebea6[_0xbdca('0x2b')](_0x3b6675);return _0x5ebea6[_0xbdca('0x31')](_0xbdca('0x32'),_0x4c495e+'-'+_0x170948+'/'+_0x452488)['json'](_0x4cdc60);}return null;};}function patchUpdates(_0x230f32){return function(_0x1998d8){try{jsonpatch[_0xbdca('0x33')](_0x1998d8,_0x230f32,!![]);}catch(_0x155268){return BPromise[_0xbdca('0x34')](_0x155268);}return _0x1998d8[_0xbdca('0x35')]();};}function saveUpdates(_0x593b35,_0x345829){return function(_0x4f5ea9){if(_0x4f5ea9){return _0x4f5ea9[_0xbdca('0x36')](_0x593b35)[_0xbdca('0x1f')](function(_0x41a482){return _0x41a482;});}return null;};}function removeEntity(_0x3d4311,_0x34d66c){return function(_0x253a51){if(_0x253a51){return _0x253a51[_0xbdca('0x37')]()[_0xbdca('0x1f')](function(){_0x3d4311['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x45496b,_0xe2b451){return function(_0x3adccb){if(!_0x3adccb){_0x45496b['sendStatus'](0x194);}return _0x3adccb;};}function handleError(_0x1a5f5f,_0x41372c){_0x41372c=_0x41372c||0x1f4;return function(_0x58a8c0){logger['error'](_0x58a8c0[_0xbdca('0x38')]);if(_0x58a8c0[_0xbdca('0x39')]){delete _0x58a8c0['name'];}_0x1a5f5f[_0xbdca('0x2b')](_0x41372c)[_0xbdca('0x3a')](_0x58a8c0);};}exports['index']=function(_0x1f54ec,_0x220ffc){var _0x11a714={},_0x11e109={},_0x394329={'count':0x0,'rows':[]};var _0x12ad2b=_['map'](db[_0xbdca('0x3b')][_0xbdca('0x3c')],function(_0x3b1ba5){return{'name':_0x3b1ba5[_0xbdca('0x3d')],'type':_0x3b1ba5[_0xbdca('0x3e')]['key']};});_0x11e109[_0xbdca('0x3f')]=_[_0xbdca('0x40')](_0x12ad2b,_0xbdca('0x39'));_0x11e109['query']=_[_0xbdca('0x41')](_0x1f54ec[_0xbdca('0x42')]);_0x11e109[_0xbdca('0x43')]=_[_0xbdca('0x44')](_0x11e109[_0xbdca('0x3f')],_0x11e109[_0xbdca('0x42')]);_0x11a714[_0xbdca('0x45')]=_[_0xbdca('0x44')](_0x11e109[_0xbdca('0x3f')],qs[_0xbdca('0x46')](_0x1f54ec[_0xbdca('0x42')]['fields']));_0x11a714[_0xbdca('0x45')]=_0x11a714[_0xbdca('0x45')][_0xbdca('0x47')]?_0x11a714[_0xbdca('0x45')]:_0x11e109[_0xbdca('0x3f')];if(!_0x1f54ec[_0xbdca('0x42')][_0xbdca('0x48')](_0xbdca('0x49'))){_0x11a714[_0xbdca('0x2f')]=qs[_0xbdca('0x2f')](_0x1f54ec[_0xbdca('0x42')][_0xbdca('0x2f')]);_0x11a714[_0xbdca('0x2d')]=qs[_0xbdca('0x2d')](_0x1f54ec[_0xbdca('0x42')][_0xbdca('0x2d')]);}_0x11a714[_0xbdca('0x4a')]=qs['sort'](_0x1f54ec[_0xbdca('0x42')]['sort']);_0x11a714[_0xbdca('0x4b')]=qs[_0xbdca('0x43')](_[_0xbdca('0x4c')](_0x1f54ec[_0xbdca('0x42')],_0x11e109['filters']),_0x12ad2b);if(_0x1f54ec['query']['filter']){_0x11a714[_0xbdca('0x4b')]=_[_0xbdca('0x4d')](_0x11a714['where'],{'$or':_['map'](_0x12ad2b,function(_0x12ba96){if(_0x12ba96[_0xbdca('0x3e')]!==_0xbdca('0x4e')){var _0x3f02b5={};_0x3f02b5[_0x12ba96[_0xbdca('0x39')]]={'$like':'%'+_0x1f54ec['query'][_0xbdca('0x4f')]+'%'};return _0x3f02b5;}})});}_0x11a714=_[_0xbdca('0x4d')]({},_0x11a714,_0x1f54ec[_0xbdca('0x50')]);var _0x39d85e={'where':_0x11a714[_0xbdca('0x4b')]};return db[_0xbdca('0x3b')][_0xbdca('0x30')](_0x39d85e)[_0xbdca('0x1f')](function(_0x30d7e3){_0x394329[_0xbdca('0x30')]=_0x30d7e3;if(_0x1f54ec[_0xbdca('0x42')][_0xbdca('0x51')]){_0x11a714[_0xbdca('0x52')]=[{'all':!![]}];}return db[_0xbdca('0x3b')][_0xbdca('0x53')](_0x11a714);})[_0xbdca('0x1f')](function(_0x2c8775){_0x394329[_0xbdca('0x54')]=_0x2c8775;return _0x394329;})[_0xbdca('0x1f')](respondWithFilteredResult(_0x220ffc,_0x11a714))[_0xbdca('0x29')](handleError(_0x220ffc,null));};exports[_0xbdca('0x55')]=function(_0x1996a2,_0x1b99c3){var _0x3beda2={'raw':![],'where':{'id':_0x1996a2[_0xbdca('0x56')]['id']}},_0x1e8d25={};_0x1e8d25['model']=_['keys'](db[_0xbdca('0x3b')][_0xbdca('0x3c')]);_0x1e8d25[_0xbdca('0x42')]=_[_0xbdca('0x41')](_0x1996a2[_0xbdca('0x42')]);_0x1e8d25[_0xbdca('0x43')]=_[_0xbdca('0x44')](_0x1e8d25[_0xbdca('0x3f')],_0x1e8d25[_0xbdca('0x42')]);_0x3beda2[_0xbdca('0x45')]=_[_0xbdca('0x44')](_0x1e8d25[_0xbdca('0x3f')],qs[_0xbdca('0x46')](_0x1996a2[_0xbdca('0x42')][_0xbdca('0x46')]));_0x3beda2[_0xbdca('0x45')]=_0x3beda2[_0xbdca('0x45')][_0xbdca('0x47')]?_0x3beda2['attributes']:_0x1e8d25['model'];if(_0x1996a2[_0xbdca('0x42')][_0xbdca('0x51')]){_0x3beda2[_0xbdca('0x52')]=[{'all':!![]}];}_0x3beda2=_[_0xbdca('0x4d')]({},_0x3beda2,_0x1996a2[_0xbdca('0x50')]);return db[_0xbdca('0x3b')][_0xbdca('0x57')](_0x3beda2)['then'](handleEntityNotFound(_0x1b99c3,null))[_0xbdca('0x1f')](respondWithResult(_0x1b99c3,null))[_0xbdca('0x29')](handleError(_0x1b99c3,null));};exports[_0xbdca('0x36')]=function(_0x177b69,_0x174b84){if(_0x177b69[_0xbdca('0x58')]['id']){delete _0x177b69['body']['id'];}return db[_0xbdca('0x3b')][_0xbdca('0x57')]({'where':{'id':_0x177b69[_0xbdca('0x56')]['id']}})['then'](handleEntityNotFound(_0x174b84,null))[_0xbdca('0x1f')](saveUpdates(_0x177b69['body'],null))[_0xbdca('0x1f')](respondWithResult(_0x174b84,null))[_0xbdca('0x29')](handleError(_0x174b84,null));};exports[_0xbdca('0x59')]=function(_0x40648c,_0x283284,_0x2aa46a){if(_0x40648c[_0xbdca('0x5a')]&&_0x40648c['file'][_0xbdca('0x5b')]){_0x40648c[_0xbdca('0x58')][_0xbdca('0x5c')]=_0x40648c[_0xbdca('0x5a')][_0xbdca('0x5b')];}return db[_0xbdca('0x3b')][_0xbdca('0x57')]({'where':{'id':_0x40648c['params']['id']}})['then'](handleEntityNotFound(_0x283284,null))[_0xbdca('0x1f')](saveUpdates(_0x40648c[_0xbdca('0x58')],null))[_0xbdca('0x1f')](respondWithResult(_0x283284,null))['catch'](handleError(_0x283284,null));};exports[_0xbdca('0x5d')]=function(_0x479144,_0x14f482,_0x12527f){if(_0x479144['file']&&_0x479144[_0xbdca('0x5a')][_0xbdca('0x5b')]){_0x479144[_0xbdca('0x58')][_0xbdca('0x5e')]=_0x479144[_0xbdca('0x5a')][_0xbdca('0x5b')];}return db[_0xbdca('0x3b')]['find']({'where':{'id':_0x479144[_0xbdca('0x56')]['id']}})[_0xbdca('0x1f')](handleEntityNotFound(_0x14f482,null))[_0xbdca('0x1f')](saveUpdates(_0x479144[_0xbdca('0x58')],null))[_0xbdca('0x1f')](respondWithResult(_0x14f482,null))[_0xbdca('0x29')](handleError(_0x14f482,null));};var utilLicense=require(_0xbdca('0x1a'));exports['getLogo']=function(_0xe56b25,_0x128872,_0x5325bd){var _0x4ab816='server/files/images/logos';var _0x10d955={'custom':![]};return utilLicense[_0xbdca('0x5f')]()[_0xbdca('0x1f')](function(_0x1a6830){if(_0x1a6830){_0x10d955=_0x1a6830;}return db['Setting'][_0xbdca('0x57')]({'where':{'id':_0xe56b25[_0xbdca('0x56')]['id']},'attributes':[_0xbdca('0x5c'),_0xbdca('0x5e'),_0xbdca('0x60'),_0xbdca('0x61'),_0xbdca('0x62'),_0xbdca('0x63'),_0xbdca('0x64'),_0xbdca('0x65')],'raw':!![]});})[_0xbdca('0x1f')](handleEntityNotFound(_0x128872,null))[_0xbdca('0x1f')](function(_0x494389){if(_0x494389){var _0x3967d8=_0x494389[_0xbdca('0x5c')]&&fs['existsSync'](path[_0xbdca('0x66')](config[_0xbdca('0x67')],_0x4ab816,_[_0xbdca('0x68')](_0x494389[_0xbdca('0x5c')])))?path[_0xbdca('0x66')](config[_0xbdca('0x67')],_0x4ab816,_[_0xbdca('0x68')](_0x494389[_0xbdca('0x5c')])):path[_0xbdca('0x66')](config[_0xbdca('0x67')],_0x4ab816,_['toLower']('default_logo.svg'));var _0x54e262=_0xbdca('0x69')+_[_0xbdca('0x6a')](_0xbdca('0x5c'));if(_0x494389[_0x54e262]||!_0x10d955[_0xbdca('0x6b')]){_0x3967d8=path['join'](config[_0xbdca('0x67')],_0x4ab816,_['toLower'](_0xbdca('0x6c')));}if(!fs[_0xbdca('0x6d')](_0x3967d8)){throw new db[(_0xbdca('0x6e'))][(_0xbdca('0x6f'))](_['upperFirst'](_0xbdca('0x5c'))+_0xbdca('0x70'));}return _0x128872[_0xbdca('0x71')](_0x3967d8);}})[_0xbdca('0x29')](handleError(_0x128872,null));};var utilLicense=require(_0xbdca('0x1a'));exports[_0xbdca('0x72')]=function(_0x539ced,_0x432854,_0x114258){var _0x2b1767=_0xbdca('0x73');var _0x3e99ee={'custom':![]};return utilLicense[_0xbdca('0x5f')]()['then'](function(_0x44eeb0){if(_0x44eeb0){_0x3e99ee=_0x44eeb0;}return db[_0xbdca('0x3b')][_0xbdca('0x57')]({'where':{'id':_0x539ced[_0xbdca('0x56')]['id']},'attributes':[_0xbdca('0x5c'),_0xbdca('0x5e'),_0xbdca('0x60'),_0xbdca('0x61'),_0xbdca('0x62'),_0xbdca('0x63'),_0xbdca('0x64'),'defaultFavicon'],'raw':!![]});})[_0xbdca('0x1f')](handleEntityNotFound(_0x432854,null))[_0xbdca('0x1f')](function(_0x57e90f){if(_0x57e90f){var _0x216ca3=_0x57e90f['loginLogo']&&fs['existsSync'](path[_0xbdca('0x66')](config[_0xbdca('0x67')],_0x2b1767,_[_0xbdca('0x68')](_0x57e90f[_0xbdca('0x5e')])))?path['join'](config[_0xbdca('0x67')],_0x2b1767,_['toLower'](_0x57e90f[_0xbdca('0x5e')])):path[_0xbdca('0x66')](config['root'],_0x2b1767,_[_0xbdca('0x68')]('default_loginLogo.svg'));var _0x28ef0f=_0xbdca('0x69')+_[_0xbdca('0x6a')](_0xbdca('0x5e'));if(_0x57e90f[_0x28ef0f]||!_0x3e99ee['custom']){_0x216ca3=path[_0xbdca('0x66')](config[_0xbdca('0x67')],_0x2b1767,_[_0xbdca('0x68')](_0xbdca('0x74')));}if(!fs[_0xbdca('0x6d')](_0x216ca3)){throw new db['Sequelize'][(_0xbdca('0x6f'))](_[_0xbdca('0x6a')](_0xbdca('0x5e'))+_0xbdca('0x70'));}return _0x432854[_0xbdca('0x71')](_0x216ca3);}})['catch'](handleError(_0x432854,null));};exports[_0xbdca('0x75')]=function(_0x30c128,_0x49d298){return db['Setting'][_0xbdca('0x57')]({'where':{'id':_0x30c128[_0xbdca('0x56')]['id']},'attributes':[_0xbdca('0x76')]})['then'](respondWithResult(_0x49d298,null))[_0xbdca('0x29')](handleError(_0x49d298,null));};exports[_0xbdca('0x77')]=function(_0x19bf4a,_0x266360,_0x2d49e5){if(_0x19bf4a[_0xbdca('0x5a')]&&_0x19bf4a[_0xbdca('0x5a')][_0xbdca('0x5b')]){_0x19bf4a[_0xbdca('0x58')][_0xbdca('0x60')]=_0x19bf4a[_0xbdca('0x5a')][_0xbdca('0x5b')];}return db[_0xbdca('0x3b')][_0xbdca('0x57')]({'where':{'id':_0x19bf4a[_0xbdca('0x56')]['id']}})['then'](handleEntityNotFound(_0x266360,null))[_0xbdca('0x1f')](saveUpdates(_0x19bf4a[_0xbdca('0x58')],null))[_0xbdca('0x1f')](respondWithResult(_0x266360,null))[_0xbdca('0x29')](handleError(_0x266360,null));};var utilLicense=require(_0xbdca('0x1a'));exports[_0xbdca('0x78')]=function(_0x5033dc,_0x18d3d3,_0x3149d5){var _0x3bb96c='server/files/images/logos';var _0x46c24b={'custom':![]};return utilLicense[_0xbdca('0x5f')]()[_0xbdca('0x1f')](function(_0x552d81){if(_0x552d81){_0x46c24b=_0x552d81;}return db['Setting'][_0xbdca('0x57')]({'where':{'id':_0x5033dc[_0xbdca('0x56')]['id']},'attributes':[_0xbdca('0x5c'),'loginLogo',_0xbdca('0x60'),_0xbdca('0x61'),'defaultLogo',_0xbdca('0x63'),_0xbdca('0x64'),_0xbdca('0x65')],'raw':!![]});})[_0xbdca('0x1f')](handleEntityNotFound(_0x18d3d3,null))[_0xbdca('0x1f')](function(_0x26d151){if(_0x26d151){var _0x18f635=_0x26d151[_0xbdca('0x60')]&&fs[_0xbdca('0x6d')](path[_0xbdca('0x66')](config[_0xbdca('0x67')],_0x3bb96c,_[_0xbdca('0x68')](_0x26d151['preferred'])))?path[_0xbdca('0x66')](config['root'],_0x3bb96c,_[_0xbdca('0x68')](_0x26d151[_0xbdca('0x60')])):path[_0xbdca('0x66')](config[_0xbdca('0x67')],_0x3bb96c,_['toLower']('default_preferred.png'));var _0x345738=_0xbdca('0x69')+_[_0xbdca('0x6a')](_0xbdca('0x60'));if(_0x26d151[_0x345738]||!_0x46c24b[_0xbdca('0x6b')]||!_0x46c24b[_0xbdca('0x60')]){_0x18f635=path[_0xbdca('0x66')](config[_0xbdca('0x67')],_0x3bb96c,_[_0xbdca('0x68')](_0xbdca('0x79')));}if(!fs[_0xbdca('0x6d')](_0x18f635)){throw new db[(_0xbdca('0x6e'))][(_0xbdca('0x6f'))](_['upperFirst'](_0xbdca('0x60'))+_0xbdca('0x70'));}return _0x18d3d3['download'](_0x18f635);}})[_0xbdca('0x29')](handleError(_0x18d3d3,null));};exports[_0xbdca('0x7a')]=function(_0x353b04,_0x296fb6,_0x2f7f88){if(_0x353b04['file']&&_0x353b04[_0xbdca('0x5a')][_0xbdca('0x5b')]){_0x353b04['body'][_0xbdca('0x61')]=_0x353b04[_0xbdca('0x5a')][_0xbdca('0x5b')];}return db[_0xbdca('0x3b')][_0xbdca('0x57')]({'where':{'id':_0x353b04['params']['id']}})[_0xbdca('0x1f')](handleEntityNotFound(_0x296fb6,null))[_0xbdca('0x1f')](saveUpdates(_0x353b04[_0xbdca('0x58')],null))[_0xbdca('0x1f')](respondWithResult(_0x296fb6,null))['catch'](handleError(_0x296fb6,null));};var utilLicense=require(_0xbdca('0x1a'));exports[_0xbdca('0x7b')]=function(_0x10883a,_0x67d436,_0x4eb5ff){var _0x3ddbd7=_0xbdca('0x73');var _0x211a4b={'custom':![]};return utilLicense[_0xbdca('0x5f')]()['then'](function(_0x128b1a){if(_0x128b1a){_0x211a4b=_0x128b1a;}return db[_0xbdca('0x3b')]['find']({'where':{'id':_0x10883a[_0xbdca('0x56')]['id']},'attributes':[_0xbdca('0x5c'),'loginLogo',_0xbdca('0x60'),_0xbdca('0x61'),_0xbdca('0x62'),_0xbdca('0x63'),'defaultPreferred',_0xbdca('0x65')],'raw':!![]});})[_0xbdca('0x1f')](handleEntityNotFound(_0x67d436,null))[_0xbdca('0x1f')](function(_0x54dc84){if(_0x54dc84){var _0x546980=_0x54dc84[_0xbdca('0x61')]&&fs['existsSync'](path[_0xbdca('0x66')](config[_0xbdca('0x67')],_0x3ddbd7,_[_0xbdca('0x68')](_0x54dc84['favicon'])))?path[_0xbdca('0x66')](config[_0xbdca('0x67')],_0x3ddbd7,_[_0xbdca('0x68')](_0x54dc84[_0xbdca('0x61')])):path[_0xbdca('0x66')](config[_0xbdca('0x67')],_0x3ddbd7,_['toLower'](_0xbdca('0x7c')));var _0x599b50=_0xbdca('0x69')+_[_0xbdca('0x6a')]('favicon');if(_0x54dc84[_0x599b50]||!_0x211a4b[_0xbdca('0x6b')]){_0x546980=path['join'](config['root'],_0x3ddbd7,_[_0xbdca('0x68')](_0xbdca('0x7c')));}if(!fs['existsSync'](_0x546980)){throw new db[(_0xbdca('0x6e'))][(_0xbdca('0x6f'))](_[_0xbdca('0x6a')](_0xbdca('0x61'))+_0xbdca('0x70'));}return _0x67d436[_0xbdca('0x71')](_0x546980);}})[_0xbdca('0x29')](handleError(_0x67d436,null));};exports[_0xbdca('0x7d')]=function(_0x3fa5c1,_0x48eb9d){var _0x34a1c1={'offset':moment()['utcOffset']()};_0x34a1c1['now']=moment()[_0xbdca('0x7e')](_0x34a1c1[_0xbdca('0x2d')])[_0xbdca('0x7f')](_0xbdca('0x80'));return _0x48eb9d[_0xbdca('0x2b')](0xc8)[_0xbdca('0x3a')](_0x34a1c1);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index d724f84..10ee181 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 _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./setting.attributes','exports','Setting','util'];(function(_0x55fba9,_0xc50969){var _0x1536ae=function(_0x58ce2d){while(--_0x58ce2d){_0x55fba9['push'](_0x55fba9['shift']());}};_0x1536ae(++_0xc50969);}(_0xedd9,0xfc));var _0x9edd=function(_0x21eef2,_0x1480ea){_0x21eef2=_0x21eef2-0x0;var _0x32f106=_0xedd9[_0x21eef2];return _0x32f106;};'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':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Setting','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./setting.attributes'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_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 logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index fb6b1b0..7be8fab 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 _0xd1f0=['rpc','../../config/environment','client','http','request','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','Setting,\x20%s,\x20%s','message','result','catch','ShowSetting','Setting','find','options','where','attributes','include','map','model','then','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1e29a2,_0x1850da){var _0x55f488=function(_0x375bb0){while(--_0x375bb0){_0x1e29a2['push'](_0x1e29a2['shift']());}};_0x55f488(++_0x1850da);}(_0xd1f0,0x100));var _0x0d1f=function(_0x1dee0c,_0x13b016){_0x1dee0c=_0x1dee0c-0x0;var _0x12d97e=_0xd1f0[_0x1dee0c];return _0x12d97e;};'use strict';var _=require(_0x0d1f('0x0'));var util=require(_0x0d1f('0x1'));var moment=require('moment');var BPromise=require(_0x0d1f('0x2'));var rs=require(_0x0d1f('0x3'));var fs=require('fs');var Redis=require(_0x0d1f('0x4'));var db=require(_0x0d1f('0x5'))['db'];var utils=require(_0x0d1f('0x6'));var logger=require(_0x0d1f('0x7'))(_0x0d1f('0x8'));var config=require(_0x0d1f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0d1f('0xa')][_0x0d1f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1e0169,_0x1d55f4,_0x55fe10){return new BPromise(function(_0x22bd7e,_0x47120d){return client[_0x0d1f('0xc')](_0x1e0169,_0x55fe10)['then'](function(_0x38bae1){logger[_0x0d1f('0xd')]('Setting,\x20%s,\x20%s',_0x1d55f4,_0x0d1f('0xe'));logger[_0x0d1f('0xf')](_0x0d1f('0x10'),_0x1d55f4,'request\x20sent',JSON['stringify'](_0x38bae1));if(_0x38bae1[_0x0d1f('0x11')]){if(_0x38bae1['error']['code']===0x1f4){logger[_0x0d1f('0x11')](_0x0d1f('0x12'),_0x1d55f4,_0x38bae1['error'][_0x0d1f('0x13')]);return _0x47120d(_0x38bae1[_0x0d1f('0x11')][_0x0d1f('0x13')]);}logger[_0x0d1f('0x11')](_0x0d1f('0x12'),_0x1d55f4,_0x38bae1[_0x0d1f('0x11')][_0x0d1f('0x13')]);return _0x22bd7e(_0x38bae1[_0x0d1f('0x11')][_0x0d1f('0x13')]);}else{logger[_0x0d1f('0xd')](_0x0d1f('0x12'),_0x1d55f4,_0x0d1f('0xe'));_0x22bd7e(_0x38bae1[_0x0d1f('0x14')][_0x0d1f('0x13')]);}})[_0x0d1f('0x15')](function(_0x483be8){logger[_0x0d1f('0x11')]('Setting,\x20%s,\x20%s',_0x1d55f4,_0x483be8);_0x47120d(_0x483be8);});});}exports[_0x0d1f('0x16')]=function(_0x49e3fb){var _0x5b894b=this;return new Promise(function(_0x27bdb3,_0x28156d){return db[_0x0d1f('0x17')][_0x0d1f('0x18')]({'raw':_0x49e3fb['options']?_0x49e3fb[_0x0d1f('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x49e3fb[_0x0d1f('0x19')]?_0x49e3fb[_0x0d1f('0x19')][_0x0d1f('0x1a')]||null:null,'attributes':_0x49e3fb[_0x0d1f('0x19')]?_0x49e3fb[_0x0d1f('0x19')][_0x0d1f('0x1b')]||null:null,'include':_0x49e3fb[_0x0d1f('0x19')]?_0x49e3fb['options']['include']?_['map'](_0x49e3fb['options'][_0x0d1f('0x1c')],function(_0x47d9db){return{'model':db[_0x47d9db['model']],'as':_0x47d9db['as'],'attributes':_0x47d9db['attributes'],'include':_0x47d9db[_0x0d1f('0x1c')]?_[_0x0d1f('0x1d')](_0x47d9db[_0x0d1f('0x1c')],function(_0x2768b8){return{'model':db[_0x2768b8[_0x0d1f('0x1e')]],'as':_0x2768b8['as'],'attributes':_0x2768b8[_0x0d1f('0x1b')],'include':_0x2768b8[_0x0d1f('0x1c')]?_[_0x0d1f('0x1d')](_0x2768b8['include'],function(_0x1e9089){return{'model':db[_0x1e9089[_0x0d1f('0x1e')]],'as':_0x1e9089['as'],'attributes':_0x1e9089[_0x0d1f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0d1f('0x1f')](function(_0x211263){logger[_0x0d1f('0xd')]('ShowSetting',_0x49e3fb);logger[_0x0d1f('0xf')](_0x0d1f('0x16'),_0x49e3fb,JSON[_0x0d1f('0x20')](_0x211263));_0x27bdb3(_0x211263);})['catch'](function(_0xcc1bdf){logger[_0x0d1f('0x11')](_0x0d1f('0x16'),_0xcc1bdf[_0x0d1f('0x13')],_0x49e3fb);_0x28156d(_0x5b894b['error'](0x1f4,_0xcc1bdf['message']));});});}; \ No newline at end of file +var _0x72b7=['randomstring','ioredis','../../config/logger','../../config/environment','client','http','request','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowSetting','Setting','find','options','raw','where','attributes','include','model','map','then','lodash','util','bluebird'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x72b7,0x114));var _0x772b=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x72b7[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x772b('0x0'));var util=require(_0x772b('0x1'));var moment=require('moment');var BPromise=require(_0x772b('0x2'));var rs=require(_0x772b('0x3'));var fs=require('fs');var Redis=require(_0x772b('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x772b('0x5'))('rpc');var config=require(_0x772b('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x772b('0x7')][_0x772b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4bed17,_0x32b4de,_0x77ddc){return new BPromise(function(_0x59756f,_0x44304d){return client[_0x772b('0x9')](_0x4bed17,_0x77ddc)['then'](function(_0x1ce686){logger[_0x772b('0xa')](_0x772b('0xb'),_0x32b4de,_0x772b('0xc'));logger[_0x772b('0xd')](_0x772b('0xe'),_0x32b4de,_0x772b('0xc'),JSON[_0x772b('0xf')](_0x1ce686));if(_0x1ce686[_0x772b('0x10')]){if(_0x1ce686[_0x772b('0x10')]['code']===0x1f4){logger[_0x772b('0x10')]('Setting,\x20%s,\x20%s',_0x32b4de,_0x1ce686[_0x772b('0x10')][_0x772b('0x11')]);return _0x44304d(_0x1ce686[_0x772b('0x10')][_0x772b('0x11')]);}logger[_0x772b('0x10')]('Setting,\x20%s,\x20%s',_0x32b4de,_0x1ce686[_0x772b('0x10')][_0x772b('0x11')]);return _0x59756f(_0x1ce686[_0x772b('0x10')]['message']);}else{logger[_0x772b('0xa')](_0x772b('0xb'),_0x32b4de,'request\x20sent');_0x59756f(_0x1ce686[_0x772b('0x12')][_0x772b('0x11')]);}})[_0x772b('0x13')](function(_0x5e282c){logger[_0x772b('0x10')](_0x772b('0xb'),_0x32b4de,_0x5e282c);_0x44304d(_0x5e282c);});});}exports[_0x772b('0x14')]=function(_0x174a77){var _0x220f1d=this;return new Promise(function(_0x49ded1,_0x9ea698){return db[_0x772b('0x15')][_0x772b('0x16')]({'raw':_0x174a77[_0x772b('0x17')]?_0x174a77[_0x772b('0x17')][_0x772b('0x18')]===undefined?!![]:![]:!![],'where':_0x174a77[_0x772b('0x17')]?_0x174a77['options'][_0x772b('0x19')]||null:null,'attributes':_0x174a77['options']?_0x174a77[_0x772b('0x17')][_0x772b('0x1a')]||null:null,'include':_0x174a77[_0x772b('0x17')]?_0x174a77[_0x772b('0x17')]['include']?_['map'](_0x174a77[_0x772b('0x17')][_0x772b('0x1b')],function(_0x4eaf1d){return{'model':db[_0x4eaf1d[_0x772b('0x1c')]],'as':_0x4eaf1d['as'],'attributes':_0x4eaf1d[_0x772b('0x1a')],'include':_0x4eaf1d[_0x772b('0x1b')]?_['map'](_0x4eaf1d[_0x772b('0x1b')],function(_0x299559){return{'model':db[_0x299559[_0x772b('0x1c')]],'as':_0x299559['as'],'attributes':_0x299559['attributes'],'include':_0x299559[_0x772b('0x1b')]?_[_0x772b('0x1d')](_0x299559[_0x772b('0x1b')],function(_0x2b018f){return{'model':db[_0x2b018f[_0x772b('0x1c')]],'as':_0x2b018f['as'],'attributes':_0x2b018f[_0x772b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x772b('0x1e')](function(_0x333205){logger[_0x772b('0xa')](_0x772b('0x14'),_0x174a77);logger[_0x772b('0xd')](_0x772b('0x14'),_0x174a77,JSON[_0x772b('0xf')](_0x333205));_0x49ded1(_0x333205);})[_0x772b('0x13')](function(_0x2f7a02){logger['error'](_0x772b('0x14'),_0x2f7a02[_0x772b('0x11')],_0x174a77);_0x9ea698(_0x220f1d[_0x772b('0x10')](0x1f4,_0x2f7a02['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 229bd1c..2405c54 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 _0x7a54=['getInteractions','/:id/status','statusGet','/:id/users','post','create','addAnswer','/:id/notify','notify','addApplications','send','status','addAgents','put','/:id','update','delete','destroy','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','index','/describe','isAuthenticated','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications'];(function(_0x4d62b2,_0x468765){var _0x1f49c2=function(_0x4cf8e4){while(--_0x4cf8e4){_0x4d62b2['push'](_0x4d62b2['shift']());}};_0x1f49c2(++_0x468765);}(_0x7a54,0x106));var _0x47a5=function(_0x46fc68,_0x4a5873){_0x46fc68=_0x46fc68-0x0;var _0x51206b=_0x7a54[_0x46fc68];return _0x51206b;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['describe']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/canned_answers',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x9')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x9')]('/:id/interactions',auth[_0x47a5('0xc')](),controller[_0x47a5('0x12')]);router[_0x47a5('0x9')](_0x47a5('0x13'),controller[_0x47a5('0x14')]);router[_0x47a5('0x9')](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller['getAgents']);router[_0x47a5('0x16')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x17')]);router[_0x47a5('0x16')](_0x47a5('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x47a5('0x16')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x47a5('0x18')]);router[_0x47a5('0x16')](_0x47a5('0x19'),controller[_0x47a5('0x1a')]);router[_0x47a5('0x16')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x1b')]);router[_0x47a5('0x16')]('/:id/send',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1c')]);router['post'](_0x47a5('0x13'),controller[_0x47a5('0x1d')]);router[_0x47a5('0x16')]('/:id/users',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1e')]);router[_0x47a5('0x1f')](_0x47a5('0x20'),auth['isAuthenticated'](),controller[_0x47a5('0x21')]);router[_0x47a5('0x22')]('/:id',auth[_0x47a5('0xc')](),controller[_0x47a5('0x23')]);router[_0x47a5('0x22')](_0x47a5('0xd'),auth[_0x47a5('0xc')](),controller['removeDispositions']);router['delete'](_0x47a5('0x24'),auth['isAuthenticated'](),controller[_0x47a5('0x25')]);router['delete'](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x26')]);module[_0x47a5('0x27')]=router; \ No newline at end of file +var _0x7a54=['getInteractions','/:id/status','statusGet','/:id/users','post','create','addAnswer','/:id/notify','notify','addApplications','send','status','addAgents','put','/:id','update','delete','destroy','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','index','/describe','isAuthenticated','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications'];(function(_0x1f39c9,_0x39ca18){var _0x5627d7=function(_0xc3d8fa){while(--_0xc3d8fa){_0x1f39c9['push'](_0x1f39c9['shift']());}};_0x5627d7(++_0x39ca18);}(_0x7a54,0x106));var _0x47a5=function(_0x505c96,_0x5d93e9){_0x505c96=_0x505c96-0x0;var _0x5c1d54=_0x7a54[_0x505c96];return _0x5c1d54;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['describe']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/canned_answers',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x9')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x9')]('/:id/interactions',auth[_0x47a5('0xc')](),controller[_0x47a5('0x12')]);router[_0x47a5('0x9')](_0x47a5('0x13'),controller[_0x47a5('0x14')]);router[_0x47a5('0x9')](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller['getAgents']);router[_0x47a5('0x16')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x17')]);router[_0x47a5('0x16')](_0x47a5('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x47a5('0x16')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x47a5('0x18')]);router[_0x47a5('0x16')](_0x47a5('0x19'),controller[_0x47a5('0x1a')]);router[_0x47a5('0x16')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x1b')]);router[_0x47a5('0x16')]('/:id/send',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1c')]);router['post'](_0x47a5('0x13'),controller[_0x47a5('0x1d')]);router[_0x47a5('0x16')]('/:id/users',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1e')]);router[_0x47a5('0x1f')](_0x47a5('0x20'),auth['isAuthenticated'](),controller[_0x47a5('0x21')]);router[_0x47a5('0x22')]('/:id',auth[_0x47a5('0xc')](),controller[_0x47a5('0x23')]);router[_0x47a5('0x22')](_0x47a5('0xd'),auth[_0x47a5('0xc')](),controller['removeDispositions']);router['delete'](_0x47a5('0x24'),auth['isAuthenticated'](),controller[_0x47a5('0x25')]);router['delete'](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x26')]);module[_0x47a5('0x27')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 020fb1e..ab39d46 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 _0x0304=['connectel','clicksend','plivo','bandwidth','csc','infobip','intelepeer','ENUM','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','STRING','generate','skebby'];(function(_0x3216f5,_0xe32e8a){var _0x17035a=function(_0x5f28cd){while(--_0x5f28cd){_0x3216f5['push'](_0x3216f5['shift']());}};_0x17035a(++_0xe32e8a);}(_0x0304,0x1c7));var _0x4030=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x0304[_0x2070da];return _0x4f9fe1;};'use strict';var Sequelize=require(_0x4030('0x0'));var rs=require(_0x4030('0x1'));module['exports']={'name':{'type':Sequelize[_0x4030('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x4030('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x4030('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x4030('0x2')],'defaultValue':function(){return rs[_0x4030('0x3')]();}},'phone':{'type':Sequelize[_0x4030('0x2')]},'type':{'type':Sequelize['ENUM']('twilio',_0x4030('0x4'),_0x4030('0x5'),_0x4030('0x6'),_0x4030('0x7'),'clickatell',_0x4030('0x8'),_0x4030('0x9'),_0x4030('0xa'),_0x4030('0xb'))},'accountSid':{'type':Sequelize[_0x4030('0x2')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x4030('0x2')]},'smsMethod':{'type':Sequelize[_0x4030('0xc')]('SI','TI','GP')},'username':{'type':Sequelize[_0x4030('0x2')]},'password':{'type':Sequelize[_0x4030('0x2')]},'apiKey':{'type':Sequelize[_0x4030('0x2')]},'applicationId':{'type':Sequelize[_0x4030('0x2')]},'accountId':{'type':Sequelize[_0x4030('0x2')]},'senderString':{'type':Sequelize[_0x4030('0x2')]},'deliveryReport':{'type':Sequelize[_0x4030('0xd')],'defaultValue':![]},'description':{'type':Sequelize[_0x4030('0x2')]},'notificationTemplate':{'type':Sequelize[_0x4030('0xe')],'defaultValue':function(){return _0x4030('0xf');}},'notificationSound':{'type':Sequelize[_0x4030('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4030('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4030('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x4030('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x4030('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4030('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x4030('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x4030('0xd')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x51c5e6){if(!_0x51c5e6)this[_0x4030('0x11')](_0x4030('0x12'),null);this[_0x4030('0x11')](_0x4030('0x13'),_0x51c5e6);}}}; \ No newline at end of file +var _0x4a44=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','ENUM','twilio','skebby','clicksend','plivo','bandwidth','csc','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x2d7711,_0x279f33){var _0xaa8fef=function(_0x619cc0){while(--_0x619cc0){_0x2d7711['push'](_0x2d7711['shift']());}};_0xaa8fef(++_0x279f33);}(_0x4a44,0x1d0));var _0x44a4=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4a44[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x44a4('0x0'));var rs=require(_0x44a4('0x1'));module[_0x44a4('0x2')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x44a4('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x44a4('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x44a4('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x44a4('0x3')]},'type':{'type':Sequelize[_0x44a4('0x4')](_0x44a4('0x5'),_0x44a4('0x6'),'connectel',_0x44a4('0x7'),_0x44a4('0x8'),'clickatell',_0x44a4('0x9'),_0x44a4('0xa'),'infobip','intelepeer')},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0x44a4('0x3')]},'authToken':{'type':Sequelize[_0x44a4('0x3')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0x44a4('0x3')]},'password':{'type':Sequelize[_0x44a4('0x3')]},'apiKey':{'type':Sequelize[_0x44a4('0x3')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize[_0x44a4('0x3')]},'senderString':{'type':Sequelize[_0x44a4('0x3')]},'deliveryReport':{'type':Sequelize[_0x44a4('0xb')],'defaultValue':![]},'description':{'type':Sequelize[_0x44a4('0x3')]},'notificationTemplate':{'type':Sequelize[_0x44a4('0xc')],'defaultValue':function(){return _0x44a4('0xd');}},'notificationSound':{'type':Sequelize[_0x44a4('0xb')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x44a4('0xb')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x44a4('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x44a4('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x44a4('0xb')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x44a4('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x44a4('0xb')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x44a4('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x44a4('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x44a4('0xe')],'comment':_0x44a4('0xf')},'mandatoryDisposition':{'type':Sequelize[_0x44a4('0xb')],'defaultValue':![],'comment':_0x44a4('0x10'),'set':function(_0x5d735d){if(!_0x5d735d)this[_0x44a4('0x11')](_0x44a4('0x12'),null);this['setDataValue'](_0x44a4('0x13'),_0x5d735d);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 69e6223..8ddca04 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 _0xba4f=['statusGet','received\x20delivery\x20report\x20from','addAgents','emit','removeAgents','userSmsAccount:remove','getAgents','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','get','SmsAccounts','UserProfileResource','stack','name','send','map','SmsAccount','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','show','params','Pause','mandatoryDispositionPause','rawAttributes','includeAll','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','SmsAccountId','findOne','Disposition','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','notify','sms','SmsApplication','Applications','account','orderBy','priority','asc','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','From','Body','messageId','skebby','from','sender','text','connectel','message_id','plivo','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmContact','Contacts','DESC','list','omit','SmsInteraction','spread','interaction','created','applications','close','SmsMessage','UserId','User','unshift','agent','*,*,*,*','queueId','SmsQueue','queue','waitForTheAssignedQueue','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','Contact','Owner','fullname','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','inspect','skebby_dispatch_id','statusInt','clicksend','status_code','groupName','DELIVERED','redif','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD'];(function(_0x1bed12,_0x3d7588){var _0x5c6b8d=function(_0x57627d){while(--_0x57627d){_0x1bed12['push'](_0x1bed12['shift']());}};_0x5c6b8d(++_0x3d7588);}(_0xba4f,0x1cb));var _0xfba4=function(_0x5a5a28,_0x3c2085){_0x5a5a28=_0x5a5a28-0x0;var _0x2bf498=_0xba4f[_0x5a5a28];return _0x2bf498;};'use strict';var emlformat=require(_0xfba4('0x0'));var rimraf=require(_0xfba4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfba4('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfba4('0x3'));var Mustache=require(_0xfba4('0x4'));var util=require(_0xfba4('0x5'));var path=require(_0xfba4('0x6'));var sox=require(_0xfba4('0x7'));var csv=require(_0xfba4('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfba4('0x9'));var _=require(_0xfba4('0xa'));var squel=require(_0xfba4('0xb'));var crypto=require('crypto');var jsforce=require(_0xfba4('0xc'));var deskjs=require(_0xfba4('0xd'));var toCsv=require(_0xfba4('0x8'));var querystring=require(_0xfba4('0xe'));var Papa=require('papaparse');var Redis=require(_0xfba4('0xf'));var authService=require(_0xfba4('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfba4('0x11'));var logger=require(_0xfba4('0x12'))(_0xfba4('0x13'));var utils=require(_0xfba4('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xfba4('0x15'))['db'];config[_0xfba4('0x16')]=_[_0xfba4('0x17')](config[_0xfba4('0x16')],{'host':_0xfba4('0x18'),'port':0x18eb});var socket=require(_0xfba4('0x19'))(new Redis(config[_0xfba4('0x16')]));require(_0xfba4('0x1a'))[_0xfba4('0x1b')](socket);var jayson=require(_0xfba4('0x1c'));var client=jayson[_0xfba4('0x1d')][_0xfba4('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x106a44,_0x5d44da,_0x360acc,_0x1870d5){return new BPromise(function(_0x5418ff,_0x524d22){var _0xf1a417=_0x1870d5||client;return _0xf1a417[_0xfba4('0x1f')](_0x106a44,_0x360acc)[_0xfba4('0x20')](function(_0x5b5c7e){logger[_0xfba4('0x21')](_0xfba4('0x22'),_0x5d44da,_0xfba4('0x23'));logger[_0xfba4('0x24')](_0xfba4('0x25'),_0x5d44da,_0xfba4('0x23'),JSON[_0xfba4('0x26')](_0x5b5c7e));if(_0x5b5c7e['error']){if(_0x5b5c7e[_0xfba4('0x27')][_0xfba4('0x28')]===0x1f4){logger[_0xfba4('0x27')](_0xfba4('0x22'),_0x5d44da,_0x5b5c7e[_0xfba4('0x27')]['message']);return _0x524d22(_0x5b5c7e[_0xfba4('0x27')][_0xfba4('0x29')]);}logger[_0xfba4('0x27')](_0xfba4('0x22'),_0x5d44da,_0x5b5c7e[_0xfba4('0x27')]['message']);return _0x5418ff(_0x5b5c7e[_0xfba4('0x27')][_0xfba4('0x29')]);}else{logger[_0xfba4('0x21')](_0xfba4('0x22'),_0x5d44da,'request\x20sent');_0x5418ff(_0x5b5c7e[_0xfba4('0x2a')][_0xfba4('0x29')]);}})[_0xfba4('0x2b')](function(_0xce229c){logger['error'](_0xfba4('0x22'),_0x5d44da,_0xce229c);_0x524d22(_0xce229c);});});}function respondWithStatusCode(_0x3ccd1d,_0x8eeb9f){_0x8eeb9f=_0x8eeb9f||0xcc;return function(_0x4fd6a7){if(_0x4fd6a7){return _0x3ccd1d[_0xfba4('0x2c')](_0x8eeb9f);}return _0x3ccd1d[_0xfba4('0x2d')](_0x8eeb9f)[_0xfba4('0x2e')]();};}function respondWithResult(_0x3442c1,_0x4805e1){_0x4805e1=_0x4805e1||0xc8;return function(_0x1c5d5b){if(_0x1c5d5b){return _0x3442c1[_0xfba4('0x2d')](_0x4805e1)[_0xfba4('0x2f')](_0x1c5d5b);}};}function respondWithFilteredResult(_0x56d0a2,_0x1ccd5b){return function(_0x1b4c09){if(_0x1b4c09){var _0x1408d5=typeof _0x1ccd5b[_0xfba4('0x30')]===_0xfba4('0x31')&&typeof _0x1ccd5b[_0xfba4('0x32')]===_0xfba4('0x31');var _0x42cec2=_0x1b4c09[_0xfba4('0x33')];var _0x27cc90=_0x1408d5?0x0:_0x1ccd5b['offset'];var _0x479684=_0x1408d5?_0x1b4c09['count']:_0x1ccd5b[_0xfba4('0x30')]+_0x1ccd5b[_0xfba4('0x32')];var _0x4f0ae;if(_0x479684>=_0x42cec2){_0x479684=_0x42cec2;_0x4f0ae=0xc8;}else{_0x4f0ae=0xce;}_0x56d0a2[_0xfba4('0x2d')](_0x4f0ae);return _0x56d0a2[_0xfba4('0x34')](_0xfba4('0x35'),_0x27cc90+'-'+_0x479684+'/'+_0x42cec2)[_0xfba4('0x2f')](_0x1b4c09);}return null;};}function patchUpdates(_0x4dc48f){return function(_0x4e2845){try{jsonpatch[_0xfba4('0x36')](_0x4e2845,_0x4dc48f,!![]);}catch(_0x56e075){return BPromise[_0xfba4('0x37')](_0x56e075);}return _0x4e2845['save']();};}function saveUpdates(_0x421b82,_0x5e8ed2){return function(_0x495af4){if(_0x495af4){return _0x495af4[_0xfba4('0x38')](_0x421b82)[_0xfba4('0x20')](function(_0x2f65de){return _0x2f65de;});}return null;};}function removeEntity(_0x34c09b,_0x183277){return function(_0x2b43cc){if(_0x2b43cc){return _0x2b43cc[_0xfba4('0x39')]()[_0xfba4('0x20')](function(){var _0x415c39=_0x2b43cc[_0xfba4('0x3a')]({'plain':!![]});var _0x2b9615=_0xfba4('0x3b');return db[_0xfba4('0x3c')][_0xfba4('0x39')]({'where':{'type':_0x2b9615,'resourceId':_0x415c39['id']}})[_0xfba4('0x20')](function(){return _0x2b43cc;});})['then'](function(){_0x34c09b['status'](0xcc)[_0xfba4('0x2e')]();});}};}function handleEntityNotFound(_0x48e4f8,_0x52a129){return function(_0x24ecaa){if(!_0x24ecaa){_0x48e4f8['sendStatus'](0x194);}return _0x24ecaa;};}function handleError(_0x279519,_0x18b940){_0x18b940=_0x18b940||0x1f4;return function(_0x140f61){logger[_0xfba4('0x27')](_0x140f61[_0xfba4('0x3d')]);if(_0x140f61[_0xfba4('0x3e')]){delete _0x140f61[_0xfba4('0x3e')];}_0x279519[_0xfba4('0x2d')](_0x18b940)[_0xfba4('0x3f')](_0x140f61);};}exports['index']=function(_0x502189,_0x669309){var _0x83fabd={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x1a1c9b={},_0x2e74a3={'count':0x0,'rows':[]};var _0x1949d5=_[_0xfba4('0x40')](db[_0xfba4('0x41')]['rawAttributes'],function(_0x417f67){return{'name':_0x417f67[_0xfba4('0x42')],'type':_0x417f67[_0xfba4('0x43')][_0xfba4('0x44')]};});_0x1a1c9b[_0xfba4('0x45')]=_[_0xfba4('0x40')](_0x1949d5,_0xfba4('0x3e'));_0x1a1c9b[_0xfba4('0x46')]=_[_0xfba4('0x47')](_0x502189[_0xfba4('0x46')]);_0x1a1c9b[_0xfba4('0x48')]=_[_0xfba4('0x49')](_0x1a1c9b[_0xfba4('0x45')],_0x1a1c9b[_0xfba4('0x46')]);_0x83fabd['attributes']=_[_0xfba4('0x49')](_0x1a1c9b['model'],qs[_0xfba4('0x4a')](_0x502189[_0xfba4('0x46')][_0xfba4('0x4a')]));_0x83fabd[_0xfba4('0x4b')]=_0x83fabd[_0xfba4('0x4b')][_0xfba4('0x4c')]?_0x83fabd[_0xfba4('0x4b')]:_0x1a1c9b[_0xfba4('0x45')];if(!_0x502189[_0xfba4('0x46')][_0xfba4('0x4d')](_0xfba4('0x4e'))){_0x83fabd[_0xfba4('0x32')]=qs[_0xfba4('0x32')](_0x502189['query'][_0xfba4('0x32')]);_0x83fabd[_0xfba4('0x30')]=qs[_0xfba4('0x30')](_0x502189[_0xfba4('0x46')][_0xfba4('0x30')]);}_0x83fabd[_0xfba4('0x4f')]=qs[_0xfba4('0x50')](_0x502189['query']['sort']);_0x83fabd['where']=qs[_0xfba4('0x48')](_[_0xfba4('0x51')](_0x502189[_0xfba4('0x46')],_0x1a1c9b[_0xfba4('0x48')]),_0x1949d5);if(_0x502189[_0xfba4('0x46')][_0xfba4('0x52')]){_0x83fabd[_0xfba4('0x53')]=_[_0xfba4('0x54')](_0x83fabd[_0xfba4('0x53')],{'$or':_[_0xfba4('0x40')](_0x1949d5,function(_0x132e6b){if(_0x132e6b['type']!==_0xfba4('0x55')){var _0x336582={};_0x336582[_0x132e6b['name']]={'$like':'%'+_0x502189[_0xfba4('0x46')][_0xfba4('0x52')]+'%'};return _0x336582;}})});}_0x83fabd=_['merge']({},_0x83fabd,_0x502189[_0xfba4('0x56')]);var _0x47d9b8={'where':_0x83fabd[_0xfba4('0x53')]};return db[_0xfba4('0x41')][_0xfba4('0x33')](_0x47d9b8)[_0xfba4('0x20')](function(_0x540c59){_0x2e74a3[_0xfba4('0x33')]=_0x540c59;if(_0x502189[_0xfba4('0x46')]['includeAll']){_0x83fabd[_0xfba4('0x57')]=[{'all':!![]}];}return db[_0xfba4('0x41')][_0xfba4('0x58')](_0x83fabd);})[_0xfba4('0x20')](function(_0x3e398e){_0x2e74a3['rows']=_0x3e398e;return _0x2e74a3;})[_0xfba4('0x20')](respondWithFilteredResult(_0x669309,_0x83fabd))[_0xfba4('0x2b')](handleError(_0x669309,null));};exports[_0xfba4('0x59')]=function(_0x2ee8ae,_0x52c03d){var _0x1e13e8={'raw':![],'where':{'id':_0x2ee8ae[_0xfba4('0x5a')]['id']},'include':[{'model':db[_0xfba4('0x5b')],'as':_0xfba4('0x5c')}]},_0x3aab99={};_0x3aab99['model']=_['keys'](db['SmsAccount'][_0xfba4('0x5d')]);_0x3aab99[_0xfba4('0x46')]=_[_0xfba4('0x47')](_0x2ee8ae['query']);_0x3aab99['filters']=_[_0xfba4('0x49')](_0x3aab99[_0xfba4('0x45')],_0x3aab99['query']);_0x1e13e8[_0xfba4('0x4b')]=_[_0xfba4('0x49')](_0x3aab99[_0xfba4('0x45')],qs[_0xfba4('0x4a')](_0x2ee8ae[_0xfba4('0x46')]['fields']));_0x1e13e8[_0xfba4('0x4b')]=_0x1e13e8['attributes'][_0xfba4('0x4c')]?_0x1e13e8['attributes']:_0x3aab99[_0xfba4('0x45')];if(_0x2ee8ae[_0xfba4('0x46')][_0xfba4('0x5e')]){_0x1e13e8[_0xfba4('0x57')]=[{'all':!![]}];}_0x1e13e8=_['merge']({},_0x1e13e8,_0x2ee8ae[_0xfba4('0x56')]);return db['SmsAccount'][_0xfba4('0x5f')](_0x1e13e8)[_0xfba4('0x20')](handleEntityNotFound(_0x52c03d,null))[_0xfba4('0x20')](respondWithResult(_0x52c03d,null))[_0xfba4('0x2b')](handleError(_0x52c03d,null));};exports['create']=function(_0x2ee7a4,_0x4e9c18){return db[_0xfba4('0x41')][_0xfba4('0x60')](_0x2ee7a4[_0xfba4('0x61')],{})[_0xfba4('0x20')](function(_0x57388d){var _0x59d0fc=_0x2ee7a4['user'][_0xfba4('0x3a')]({'plain':!![]});if(!_0x59d0fc)throw new Error(_0xfba4('0x62'));if(_0x59d0fc['role']===_0xfba4('0x63')){var _0x1880fc=_0x57388d[_0xfba4('0x3a')]({'plain':!![]});var _0x4d7987=_0xfba4('0x3b');return db[_0xfba4('0x64')][_0xfba4('0x5f')]({'where':{'name':_0x4d7987,'userProfileId':_0x59d0fc[_0xfba4('0x65')]},'raw':!![]})[_0xfba4('0x20')](function(_0x4bcd42){if(_0x4bcd42&&_0x4bcd42[_0xfba4('0x66')]===0x0){return db[_0xfba4('0x3c')][_0xfba4('0x60')]({'name':_0x1880fc[_0xfba4('0x3e')],'resourceId':_0x1880fc['id'],'type':_0x4bcd42['name'],'sectionId':_0x4bcd42['id']},{})[_0xfba4('0x20')](function(){return _0x57388d;});}else{return _0x57388d;}})['catch'](function(_0x1788da){logger[_0xfba4('0x27')](_0xfba4('0x67'),_0x1788da);throw _0x1788da;});}return _0x57388d;})[_0xfba4('0x20')](respondWithResult(_0x4e9c18,0xc9))[_0xfba4('0x2b')](handleError(_0x4e9c18,null));};exports[_0xfba4('0x38')]=function(_0x200088,_0x1a73c8){if(_0x200088['body']['id']){delete _0x200088[_0xfba4('0x61')]['id'];}return db[_0xfba4('0x41')][_0xfba4('0x5f')]({'where':{'id':_0x200088[_0xfba4('0x5a')]['id']},'include':[{'model':db[_0xfba4('0x5b')],'as':_0xfba4('0x5c')}]})[_0xfba4('0x20')](handleEntityNotFound(_0x1a73c8,null))['then'](saveUpdates(_0x200088[_0xfba4('0x61')],null))[_0xfba4('0x20')](respondWithResult(_0x1a73c8,null))[_0xfba4('0x2b')](handleError(_0x1a73c8,null));};exports[_0xfba4('0x39')]=function(_0x4c15d9,_0x3bce37){return db[_0xfba4('0x41')][_0xfba4('0x5f')]({'where':{'id':_0x4c15d9['params']['id']}})[_0xfba4('0x20')](handleEntityNotFound(_0x3bce37,null))[_0xfba4('0x20')](removeEntity(_0x3bce37,null))['catch'](handleError(_0x3bce37,null));};exports[_0xfba4('0x68')]=function(_0x3b963b,_0xc7dfda){return db[_0xfba4('0x41')][_0xfba4('0x68')]()['then'](respondWithResult(_0xc7dfda,null))[_0xfba4('0x2b')](handleError(_0xc7dfda,null));};exports[_0xfba4('0x69')]=function(_0x35e93e,_0x4df4da,_0x24cbec){if(_0x35e93e['body']['id']){delete _0x35e93e[_0xfba4('0x61')]['id'];}return db[_0xfba4('0x41')]['find']({'where':{'id':_0x35e93e[_0xfba4('0x5a')]['id']}})[_0xfba4('0x20')](handleEntityNotFound(_0x4df4da,null))[_0xfba4('0x20')](function(_0x385fa1){if(_0x385fa1){_0x35e93e[_0xfba4('0x61')][_0xfba4('0x6a')]=_0x385fa1['id'];return db['Disposition']['create'](_0x35e93e[_0xfba4('0x61')]);}})[_0xfba4('0x20')](respondWithResult(_0x4df4da,null))['catch'](handleError(_0x4df4da,null));};exports['getDispositions']=function(_0x3571f5,_0x53d65f,_0x13df08){var _0x487515={'raw':![],'where':{}};var _0x34396e={};var _0x4ef04c={'count':0x0,'rows':[]};return db[_0xfba4('0x41')][_0xfba4('0x6b')]({'where':{'id':_0x3571f5['params']['id']}})[_0xfba4('0x20')](handleEntityNotFound(_0x53d65f,null))[_0xfba4('0x20')](function(_0x5a1392){if(_0x5a1392){_0x34396e[_0xfba4('0x45')]=_['keys'](db[_0xfba4('0x6c')]['rawAttributes']);_0x34396e[_0xfba4('0x46')]=_[_0xfba4('0x47')](_0x3571f5[_0xfba4('0x46')]);_0x34396e['filters']=_[_0xfba4('0x49')](_0x34396e['model'],_0x34396e['query']);_0x487515[_0xfba4('0x4b')]=_[_0xfba4('0x49')](_0x34396e[_0xfba4('0x45')],qs[_0xfba4('0x4a')](_0x3571f5[_0xfba4('0x46')]['fields']));_0x487515['attributes']=_0x487515[_0xfba4('0x4b')][_0xfba4('0x4c')]?_0x487515[_0xfba4('0x4b')]:_0x34396e[_0xfba4('0x45')];if(!_0x3571f5[_0xfba4('0x46')]['hasOwnProperty'](_0xfba4('0x4e'))){_0x487515[_0xfba4('0x32')]=qs[_0xfba4('0x32')](_0x3571f5[_0xfba4('0x46')][_0xfba4('0x32')]);_0x487515[_0xfba4('0x30')]=qs[_0xfba4('0x30')](_0x3571f5[_0xfba4('0x46')][_0xfba4('0x30')]);}_0x487515['order']=qs['sort'](_0x3571f5['query'][_0xfba4('0x50')]);_0x487515[_0xfba4('0x53')]=qs[_0xfba4('0x48')](_[_0xfba4('0x51')](_0x3571f5['query'],_0x34396e[_0xfba4('0x48')]));_0x487515[_0xfba4('0x53')][_0xfba4('0x6a')]=_0x5a1392['id'];if(_0x3571f5[_0xfba4('0x46')][_0xfba4('0x52')]){_0x487515[_0xfba4('0x53')]=_[_0xfba4('0x54')](_0x487515['where'],{'$or':_[_0xfba4('0x40')](_0x487515[_0xfba4('0x4b')],function(_0x180307){var _0x580433={};_0x580433[_0x180307]={'$like':'%'+_0x3571f5['query']['filter']+'%'};return _0x580433;})});}_0x487515=_[_0xfba4('0x54')]({},_0x487515,_0x3571f5[_0xfba4('0x56')]);return db['Disposition'][_0xfba4('0x33')]({'where':_0x487515[_0xfba4('0x53')]})[_0xfba4('0x20')](function(_0x592c4c){_0x4ef04c[_0xfba4('0x33')]=_0x592c4c;if(_0x3571f5[_0xfba4('0x46')]['includeAll']){_0x487515[_0xfba4('0x57')]=[{'all':!![]}];}return db['Disposition'][_0xfba4('0x58')](_0x487515);})[_0xfba4('0x20')](function(_0x243056){_0x4ef04c['rows']=_0x243056;return _0x4ef04c;});}})[_0xfba4('0x20')](respondWithFilteredResult(_0x53d65f,_0x487515))[_0xfba4('0x2b')](handleError(_0x53d65f,null));};exports[_0xfba4('0x6d')]=function(_0x39938c,_0xfc273e,_0x24997c){return db['SmsAccount'][_0xfba4('0x5f')]({'where':{'id':_0x39938c['params']['id']}})[_0xfba4('0x20')](handleEntityNotFound(_0xfc273e,null))[_0xfba4('0x20')](function(_0x156fbe){if(_0x156fbe){return _0x156fbe[_0xfba4('0x6d')](_0x39938c['query']['ids']);}})['then'](respondWithStatusCode(_0xfc273e,null))[_0xfba4('0x2b')](handleError(_0xfc273e,null));};exports[_0xfba4('0x6e')]=function(_0x396f21,_0x25c9b3,_0xefb3bd){if(_0x396f21[_0xfba4('0x61')]['id']){delete _0x396f21[_0xfba4('0x61')]['id'];}return db['SmsAccount'][_0xfba4('0x5f')]({'where':{'id':_0x396f21[_0xfba4('0x5a')]['id']}})[_0xfba4('0x20')](handleEntityNotFound(_0x25c9b3,null))[_0xfba4('0x20')](function(_0x577c49){if(_0x577c49){_0x396f21[_0xfba4('0x61')][_0xfba4('0x6a')]=_0x577c49['id'];return db[_0xfba4('0x6f')][_0xfba4('0x60')](_0x396f21[_0xfba4('0x61')]);}})[_0xfba4('0x20')](respondWithResult(_0x25c9b3,null))[_0xfba4('0x2b')](handleError(_0x25c9b3,null));};exports[_0xfba4('0x70')]=function(_0x336cb3,_0x3f653e,_0x56e8c5){var _0x110ba3={'raw':![],'where':{}};var _0x44442c={};var _0xd66e77={'count':0x0,'rows':[]};return db['SmsAccount'][_0xfba4('0x6b')]({'where':{'id':_0x336cb3[_0xfba4('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3f653e,null))[_0xfba4('0x20')](function(_0x2a0d65){if(_0x2a0d65){_0x44442c[_0xfba4('0x45')]=_[_0xfba4('0x47')](db['CannedAnswer'][_0xfba4('0x5d')]);_0x44442c[_0xfba4('0x46')]=_['keys'](_0x336cb3[_0xfba4('0x46')]);_0x44442c[_0xfba4('0x48')]=_['intersection'](_0x44442c[_0xfba4('0x45')],_0x44442c[_0xfba4('0x46')]);_0x110ba3[_0xfba4('0x4b')]=_[_0xfba4('0x49')](_0x44442c[_0xfba4('0x45')],qs[_0xfba4('0x4a')](_0x336cb3['query'][_0xfba4('0x4a')]));_0x110ba3[_0xfba4('0x4b')]=_0x110ba3[_0xfba4('0x4b')][_0xfba4('0x4c')]?_0x110ba3['attributes']:_0x44442c[_0xfba4('0x45')];if(!_0x336cb3[_0xfba4('0x46')]['hasOwnProperty'](_0xfba4('0x4e'))){_0x110ba3[_0xfba4('0x32')]=qs[_0xfba4('0x32')](_0x336cb3[_0xfba4('0x46')][_0xfba4('0x32')]);_0x110ba3[_0xfba4('0x30')]=qs[_0xfba4('0x30')](_0x336cb3[_0xfba4('0x46')][_0xfba4('0x30')]);}_0x110ba3[_0xfba4('0x4f')]=qs[_0xfba4('0x50')](_0x336cb3[_0xfba4('0x46')][_0xfba4('0x50')]);_0x110ba3[_0xfba4('0x53')]=qs[_0xfba4('0x48')](_['pick'](_0x336cb3[_0xfba4('0x46')],_0x44442c[_0xfba4('0x48')]));_0x110ba3[_0xfba4('0x53')]['SmsAccountId']=_0x2a0d65['id'];if(_0x336cb3[_0xfba4('0x46')][_0xfba4('0x52')]){_0x110ba3[_0xfba4('0x53')]=_[_0xfba4('0x54')](_0x110ba3[_0xfba4('0x53')],{'$or':_[_0xfba4('0x40')](_0x110ba3[_0xfba4('0x4b')],function(_0x586496){var _0x4c3404={};_0x4c3404[_0x586496]={'$like':'%'+_0x336cb3[_0xfba4('0x46')]['filter']+'%'};return _0x4c3404;})});}_0x110ba3=_[_0xfba4('0x54')]({},_0x110ba3,_0x336cb3[_0xfba4('0x56')]);return db[_0xfba4('0x6f')][_0xfba4('0x33')]({'where':_0x110ba3[_0xfba4('0x53')]})['then'](function(_0x474b27){_0xd66e77[_0xfba4('0x33')]=_0x474b27;if(_0x336cb3['query'][_0xfba4('0x5e')]){_0x110ba3[_0xfba4('0x57')]=[{'all':!![]}];}return db[_0xfba4('0x6f')][_0xfba4('0x58')](_0x110ba3);})[_0xfba4('0x20')](function(_0x1b8188){_0xd66e77['rows']=_0x1b8188;return _0xd66e77;});}})[_0xfba4('0x20')](respondWithFilteredResult(_0x3f653e,_0x110ba3))[_0xfba4('0x2b')](handleError(_0x3f653e,null));};exports[_0xfba4('0x71')]=function(_0x275a34,_0x13d971,_0x188a04){return db['SmsAccount']['find']({'where':{'id':_0x275a34['params']['id']}})[_0xfba4('0x20')](handleEntityNotFound(_0x13d971,null))[_0xfba4('0x20')](function(_0x9d9508){if(_0x9d9508){return _0x9d9508[_0xfba4('0x71')](_0x275a34[_0xfba4('0x46')][_0xfba4('0x72')]);}})[_0xfba4('0x20')](respondWithStatusCode(_0x13d971,null))['catch'](handleError(_0x13d971,null));};exports[_0xfba4('0x73')]=function(_0x4fddeb,_0x4d44a2,_0x34c8f3){var _0x148d2e={'channel':_0xfba4('0x74')};var _0x594e73=[];var _0x565213=[];var _0x38e0e1={};return db[_0xfba4('0x41')][_0xfba4('0x5f')]({'where':{'id':_0x4fddeb[_0xfba4('0x5a')]['id']},'include':[{'model':db[_0xfba4('0x75')],'as':_0xfba4('0x76')}]})[_0xfba4('0x20')](handleEntityNotFound(_0x4d44a2,null))[_0xfba4('0x20')](function(_0x1df052){_0x148d2e[_0xfba4('0x77')]=_0x1df052;_0x148d2e['applications']=_[_0xfba4('0x78')](_0x1df052[_0xfba4('0x76')],[_0xfba4('0x79')],[_0xfba4('0x7a')]);if(_0x148d2e[_0xfba4('0x77')][_0xfba4('0x76')]){delete _0x148d2e[_0xfba4('0x77')][_0xfba4('0x76')];}return db['CmContact'][_0xfba4('0x68')]();})[_0xfba4('0x20')](function(_0x3ebc07){if(!_0x3ebc07){throw new db[(_0xfba4('0x7b'))][(_0xfba4('0x7c'))](_0xfba4('0x7d'));}_0x594e73=_[_0xfba4('0x7e')](_[_0xfba4('0x47')](_0x3ebc07),[_0xfba4('0x7f'),'updatedAt']);_0x565213=_['difference'](_[_0xfba4('0x47')](_0x3ebc07),[_0xfba4('0x7f'),_0xfba4('0x80'),_0xfba4('0x81'),_0xfba4('0x82')]);_0x148d2e[_0xfba4('0x61')]={'mapKey':_0xfba4('0x83')};if(_0x148d2e[_0xfba4('0x77')][_0xfba4('0x43')]){switch(_0x148d2e[_0xfba4('0x77')]['type']){case _0xfba4('0x84'):_0x148d2e[_0xfba4('0x61')]['from']=_0x4fddeb[_0xfba4('0x61')][_0xfba4('0x85')];_0x148d2e[_0xfba4('0x61')]['body']=_0x4fddeb[_0xfba4('0x61')][_0xfba4('0x86')];_0x148d2e['body'][_0xfba4('0x87')]=_0x4fddeb[_0xfba4('0x61')]['MessageSid'];break;case _0xfba4('0x88'):_0x148d2e[_0xfba4('0x61')][_0xfba4('0x89')]='+'+_0x4fddeb[_0xfba4('0x61')][_0xfba4('0x8a')];_0x148d2e['body'][_0xfba4('0x61')]=_0x4fddeb[_0xfba4('0x61')][_0xfba4('0x8b')];break;case _0xfba4('0x8c'):_0x148d2e['body']['from']=_0x4fddeb[_0xfba4('0x61')][_0xfba4('0x89')];_0x148d2e[_0xfba4('0x61')][_0xfba4('0x61')]=_0x4fddeb[_0xfba4('0x61')][_0xfba4('0x29')];break;case'clicksend':_0x148d2e[_0xfba4('0x61')][_0xfba4('0x89')]=_0x4fddeb['body'][_0xfba4('0x89')];_0x148d2e[_0xfba4('0x61')][_0xfba4('0x61')]=_0x4fddeb['body']['body'];_0x148d2e[_0xfba4('0x61')]['messageId']=_0x4fddeb['body'][_0xfba4('0x8d')];break;case _0xfba4('0x8e'):_0x148d2e['body'][_0xfba4('0x89')]=_0x4fddeb[_0xfba4('0x61')][_0xfba4('0x85')];_0x148d2e[_0xfba4('0x61')][_0xfba4('0x61')]=_0x4fddeb[_0xfba4('0x61')]['Text'];_0x148d2e[_0xfba4('0x61')][_0xfba4('0x87')]=_0x4fddeb['body'][_0xfba4('0x8f')];break;case _0xfba4('0x90'):_0x148d2e[_0xfba4('0x61')][_0xfba4('0x89')]='+'+_0x4fddeb['body'][_0xfba4('0x91')][0x0][_0xfba4('0x89')];_0x148d2e['body'][_0xfba4('0x61')]=_0x4fddeb['body'][_0xfba4('0x91')][0x0][_0xfba4('0x8b')];_0x148d2e[_0xfba4('0x61')][_0xfba4('0x87')]=_0x4fddeb['body'][_0xfba4('0x91')][0x0][_0xfba4('0x87')];break;case _0xfba4('0x92'):_0x148d2e[_0xfba4('0x61')][_0xfba4('0x89')]=_0x4fddeb[_0xfba4('0x61')][_0xfba4('0x93')];_0x148d2e[_0xfba4('0x61')][_0xfba4('0x61')]=_0x4fddeb[_0xfba4('0x61')][_0xfba4('0x94')][_0xfba4('0x29')];break;case _0xfba4('0x95'):_0x148d2e[_0xfba4('0x61')]['from']=_0x4fddeb[_0xfba4('0x61')][_0xfba4('0x96')];_0x148d2e['body'][_0xfba4('0x61')]=_0x4fddeb[_0xfba4('0x61')][_0xfba4('0x8b')];_0x148d2e['body'][_0xfba4('0x87')]=_0x4fddeb[_0xfba4('0x61')][_0xfba4('0x97')];break;case _0xfba4('0x98'):_0x148d2e[_0xfba4('0x61')][_0xfba4('0x87')]=_0x4fddeb[_0xfba4('0x61')][0x0][_0xfba4('0x29')]['id'];_0x148d2e['body'][_0xfba4('0x89')]=_0x4fddeb[_0xfba4('0x61')][0x0][_0xfba4('0x29')][_0xfba4('0x89')];_0x148d2e[_0xfba4('0x61')]['body']=_0x4fddeb[_0xfba4('0x61')][0x0][_0xfba4('0x29')][_0xfba4('0x8b')];break;case _0xfba4('0x99'):_0x148d2e['body'][_0xfba4('0x89')]=_0x4fddeb[_0xfba4('0x61')][_0xfba4('0x89')];_0x148d2e[_0xfba4('0x61')]['body']=_0x4fddeb['body'][_0xfba4('0x29')];_0x148d2e[_0xfba4('0x61')][_0xfba4('0x87')]=_0x4fddeb['body']['refid'];break;}}if(_0x148d2e[_0xfba4('0x61')]['id']){delete _0x148d2e[_0xfba4('0x61')]['id'];}if(_[_0xfba4('0x9a')](_0x148d2e['body'][_0xfba4('0x89')])){throw new db[(_0xfba4('0x7b'))][(_0xfba4('0x7c'))]('from\x20is\x20mandatory');}if(_[_0xfba4('0x9a')](_0x148d2e[_0xfba4('0x61')][_0xfba4('0x61')])||_0x148d2e[_0xfba4('0x61')][_0xfba4('0x61')]===''){throw new db[(_0xfba4('0x7b'))][(_0xfba4('0x7c'))](_0xfba4('0x9b'));}if(_[_0xfba4('0x9a')](_0x148d2e['body'][_0xfba4('0x9c')])){throw new db[(_0xfba4('0x7b'))][(_0xfba4('0x7c'))](_0xfba4('0x9d')+_0x565213);}if(!_[_0xfba4('0x9e')](_0x565213,_0x148d2e['body'][_0xfba4('0x9c')])){throw new db['Sequelize']['ValidationError'](_0xfba4('0x9f')+_0x565213);}_0x38e0e1[_0x148d2e['body'][_0xfba4('0x9c')]]=_0x148d2e[_0xfba4('0x61')]['from'];return db['CmList'][_0xfba4('0x5f')]({'where':{'id':_0x148d2e[_0xfba4('0x77')][_0xfba4('0x82')]},'include':[{'model':db[_0xfba4('0xa0')],'as':_0xfba4('0xa1'),'where':_0x38e0e1,'limit':0x1,'order':[[_0xfba4('0x80'),_0xfba4('0xa2')]]}]});})['then'](handleEntityNotFound(_0x4d44a2,null))[_0xfba4('0x20')](function(_0x4fb4c4){if(_0x4fb4c4){_0x148d2e[_0xfba4('0xa3')]=_[_0xfba4('0xa4')](_0x4fb4c4,[_0xfba4('0xa1')]);if(_0x4fb4c4[_0xfba4('0xa1')]['length']){return _0x4fb4c4['Contacts'][0x0];}var _0x9f1018=_[_0xfba4('0x17')](_0x148d2e[_0xfba4('0x61')],{'firstName':_0x148d2e['body']['from'],'ListId':_0x4fb4c4['id']});_0x9f1018[_0x148d2e[_0xfba4('0x61')][_0xfba4('0x9c')]]=_0x148d2e['body'][_0xfba4('0x89')];return db[_0xfba4('0xa0')][_0xfba4('0x60')](_0x9f1018,{'fields':_0x594e73,'raw':!![]});}})[_0xfba4('0x20')](handleEntityNotFound(_0x4d44a2,null))[_0xfba4('0x20')](function(_0x497d97){if(_0x497d97){_0x148d2e['contact']=_0x497d97;var _0x8d7c8f={'ContactId':_0x497d97['id'],'phone':_0x148d2e['body'][_0xfba4('0x89')],'SmsAccountId':_0x4fddeb[_0xfba4('0x5a')]['id']};var _0x2b8414={'ContactId':_0x497d97['id'],'SmsAccountId':_0x4fddeb[_0xfba4('0x5a')]['id'],'closed':![]};return db[_0xfba4('0xa5')][_0xfba4('0x5f')]({'where':_0x2b8414})[_0xfba4('0x20')](function(_0x1039c4){if(_0x1039c4){return[_0x1039c4,![]];}return db[_0xfba4('0xa5')][_0xfba4('0x60')](_0x8d7c8f)[_0xfba4('0x20')](function(_0x314fa7){return[_0x314fa7,!![]];});});}})[_0xfba4('0xa6')](function(_0x597230,_0x4cec42){_0x148d2e['interaction']=_0x597230[_0xfba4('0x3a')]({'plain':!![]});_0x148d2e[_0xfba4('0xa7')][_0xfba4('0xa8')]=![];if(_0x4cec42){if(_0x148d2e['account']['autoclose']){_0x148d2e[_0xfba4('0xa9')]['push']({'id':0x0,'priority':_0x148d2e[_0xfba4('0xa9')][_0xfba4('0x4c')]+0x1,'app':_0xfba4('0xaa'),'appdata':'unmanaged','interval':'*,*,*,*'});}_0x148d2e[_0xfba4('0xa7')][_0xfba4('0xa8')]=!![];}return db[_0xfba4('0xab')][_0xfba4('0x60')]({'phone':_0x148d2e[_0xfba4('0x61')][_0xfba4('0x89')],'messageId':_0x148d2e[_0xfba4('0x61')]['messageId'],'body':_0x148d2e[_0xfba4('0x61')]['body'],'SmsAccountId':_0x4fddeb['params']['id'],'SmsInteractionId':_0x597230['id'],'direction':'in','ContactId':_0x597230['ContactId'],'AttachmentId':_0x148d2e[_0xfba4('0x61')]['AttachmentId']});})[_0xfba4('0x20')](function(_0x75ccd1){_0x148d2e['message']=_0x75ccd1;if(!_0x148d2e[_0xfba4('0xa7')][_0xfba4('0xac')])return;return db[_0xfba4('0xad')][_0xfba4('0x5f')]({'attributes':['id',_0xfba4('0x3e')],'where':{'id':_0x148d2e[_0xfba4('0xa7')][_0xfba4('0xac')]}});})[_0xfba4('0x20')](function(_0x6a72a6){if(_0x6a72a6){_0x148d2e['applications'][_0xfba4('0xae')]({'id':0x0,'priority':0x0,'app':_0xfba4('0xaf'),'appdata':_0x6a72a6[_0xfba4('0x3e')]+','+(_0x148d2e[_0xfba4('0x77')]['waitForTheAssignedAgent']||0xa),'interval':_0xfba4('0xb0')});}if(!_0x148d2e[_0xfba4('0xa7')][_0xfba4('0xb1')])return;return db[_0xfba4('0xb2')][_0xfba4('0x5f')]({'attributes':['id','name'],'where':{'id':_0x148d2e[_0xfba4('0xa7')]['queueId']}});})[_0xfba4('0x20')](function(_0x594cd9){if(_0x594cd9){_0x148d2e[_0xfba4('0xa9')][_0xfba4('0xae')]({'id':0x0,'priority':0x1,'app':_0xfba4('0xb3'),'appdata':_0x594cd9[_0xfba4('0x3e')]+','+(_0x148d2e['account'][_0xfba4('0xb4')]||0x12c),'interval':_0xfba4('0xb0')});}return respondWithRpcPromise(_0xfba4('0xb5'),_0xfba4('0xb6'),_0x148d2e);})['then'](function(_0x6a1d2b){if(_0x6a1d2b){var _0x4baf94=0xc8;var _0x3bfb42=_0xfba4('0xb7');logger['info'](_0xfba4('0x25'),_0x3bfb42,_0x4baf94,_0xfba4('0xb8'));logger[_0xfba4('0x24')](_0xfba4('0xb9'),_0x3bfb42,_0x4baf94,_0xfba4('0xb8'),JSON[_0xfba4('0x26')](_0x6a1d2b));if(_0x148d2e[_0xfba4('0x77')][_0xfba4('0x43')]===_0xfba4('0x84')){return _0x4d44a2[_0xfba4('0x2d')](_0x4baf94)['set'](_0xfba4('0xba'),_0xfba4('0xbb'))[_0xfba4('0x3f')](_0xfba4('0xbc'));}else{return _0x4d44a2[_0xfba4('0x2d')](_0x4baf94)[_0xfba4('0x2f')](_0x6a1d2b);}}})['catch'](handleError(_0x4d44a2,null));};exports['addApplications']=function(_0xf6a723,_0x358808){var _0x22e80e=_0xf6a723['params']['id'];var _0x13957a=_0xf6a723[_0xfba4('0x61')];var _0x3f85a7=0xc8;var _0x15a39b=null;return db['sequelize'][_0xfba4('0xbd')]({'isolationLevel':db['sequelize'][_0xfba4('0xbe')][_0xfba4('0xbf')][_0xfba4('0xc0')]},function(_0x1be1f3){return db[_0xfba4('0x41')][_0xfba4('0x6b')]({'where':{'id':_0x22e80e},'transaction':_0x1be1f3})['then'](function(_0x31d468){if(_0x31d468){return db[_0xfba4('0x75')][_0xfba4('0x39')]({'where':{'SmsAccountId':_0x22e80e},'transaction':_0x1be1f3})[_0xfba4('0x20')](function(){var _0x869012=_[_0xfba4('0x40')](_0x13957a,function(_0x21d5ae){_0x21d5ae['SmsAccountId']=_0x22e80e;return _0x21d5ae;});return db[_0xfba4('0x75')]['bulkCreate'](_0x869012,{'transaction':_0x1be1f3});});}else{_0x3f85a7=0x194;_0x15a39b=[];}});})['then'](function(){if(_0x3f85a7!==0x194){return db[_0xfba4('0x75')][_0xfba4('0xc1')]({'where':{'SmsAccountId':_0x22e80e},'order':_0xfba4('0x79')})[_0xfba4('0x20')](function(_0x59002a){_0x15a39b=_0x59002a;});}})[_0xfba4('0x2b')](function(_0x2062ab){_0x3f85a7=0x1f4;logger[_0xfba4('0x27')](_0x2062ab['stack']);if(_0x2062ab[_0xfba4('0x3e')]){delete _0x2062ab[_0xfba4('0x3e')];}_0x15a39b=_0x2062ab;})[_0xfba4('0xc2')](function(){if(_0x15a39b===null){_0x358808[_0xfba4('0x2c')](_0x3f85a7);}else{if(_0x3f85a7===0x1f4){_0x358808[_0xfba4('0x2d')](_0x3f85a7)[_0xfba4('0x3f')](_0x15a39b);}else{_0x358808[_0xfba4('0x2d')](_0x3f85a7)[_0xfba4('0x2f')](_0x15a39b);}}});};exports['getApplications']=function(_0x14dcc2,_0x1f6b03,_0x4fd1bf){var _0x168920={};var _0x52d96a={};var _0x181cbf;var _0x200a06;return db[_0xfba4('0x41')][_0xfba4('0x6b')]({'where':{'id':_0x14dcc2['params']['id']}})['then'](handleEntityNotFound(_0x1f6b03,null))[_0xfba4('0x20')](function(_0x512851){if(_0x512851){_0x181cbf=_0x512851;_0x52d96a['model']=_[_0xfba4('0x47')](db[_0xfba4('0x75')][_0xfba4('0x5d')]);_0x52d96a[_0xfba4('0x46')]=_['keys'](_0x14dcc2[_0xfba4('0x46')]);_0x52d96a[_0xfba4('0x48')]=_[_0xfba4('0x49')](_0x52d96a[_0xfba4('0x45')],_0x52d96a['query']);_0x168920[_0xfba4('0x4b')]=_[_0xfba4('0x49')](_0x52d96a[_0xfba4('0x45')],qs['fields'](_0x14dcc2[_0xfba4('0x46')][_0xfba4('0x4a')]));_0x168920[_0xfba4('0x4b')]=_0x168920[_0xfba4('0x4b')]['length']?_0x168920[_0xfba4('0x4b')]:_0x52d96a[_0xfba4('0x45')];_0x168920[_0xfba4('0x4f')]=qs[_0xfba4('0x50')](_0x14dcc2[_0xfba4('0x46')][_0xfba4('0x50')]);_0x168920[_0xfba4('0x53')]=qs[_0xfba4('0x48')](_['pick'](_0x14dcc2['query'],_0x52d96a['filters']));if(_0x14dcc2['query']['filter']){_0x168920[_0xfba4('0x53')]=_['merge'](_0x168920[_0xfba4('0x53')],{'$or':_[_0xfba4('0x40')](_0x168920[_0xfba4('0x4b')],function(_0xe173b){var _0x4da1f1={};_0x4da1f1[_0xe173b]={'$like':'%'+_0x14dcc2[_0xfba4('0x46')][_0xfba4('0x52')]+'%'};return _0x4da1f1;})});}_0x168920=_[_0xfba4('0x54')]({},_0x168920,_0x14dcc2[_0xfba4('0x56')]);return _0x181cbf['getApplications'](_0x168920);}})[_0xfba4('0x20')](function(_0x1ace83){if(_0x1ace83){_0x200a06=_0x1ace83[_0xfba4('0x4c')];if(!_0x14dcc2[_0xfba4('0x46')][_0xfba4('0x4d')](_0xfba4('0x4e'))){_0x168920[_0xfba4('0x32')]=qs[_0xfba4('0x32')](_0x14dcc2['query']['limit']);_0x168920['offset']=qs[_0xfba4('0x30')](_0x14dcc2[_0xfba4('0x46')]['offset']);}return _0x181cbf[_0xfba4('0xc3')](_0x168920);}})[_0xfba4('0x20')](function(_0x5c23c9){if(_0x5c23c9){return _0x5c23c9?{'count':_0x200a06,'rows':_0x5c23c9}:null;}})[_0xfba4('0x20')](respondWithResult(_0x1f6b03,null))['catch'](handleError(_0x1f6b03,null));};exports['getInteractions']=function(_0x2d7d05,_0x1520e9,_0x105c8f){var _0x811b2e={'raw':![],'where':{}};var _0x4991f9={};var _0xfd003d={'count':0x0,'rows':[]};return db[_0xfba4('0x41')]['findOne']({'where':{'id':_0x2d7d05[_0xfba4('0x5a')]['id']}})[_0xfba4('0x20')](handleEntityNotFound(_0x1520e9,null))[_0xfba4('0x20')](function(_0x692265){if(_0x692265){_0x4991f9[_0xfba4('0x45')]=_['keys'](db['SmsInteraction'][_0xfba4('0x5d')]);_0x4991f9['query']=_[_0xfba4('0x47')](_0x2d7d05[_0xfba4('0x46')]);_0x4991f9['filters']=_[_0xfba4('0x49')](_0x4991f9[_0xfba4('0x45')],_0x4991f9[_0xfba4('0x46')]);_0x811b2e['attributes']=_[_0xfba4('0x49')](_0x4991f9[_0xfba4('0x45')],qs[_0xfba4('0x4a')](_0x2d7d05[_0xfba4('0x46')][_0xfba4('0x4a')]));_0x811b2e[_0xfba4('0x4b')]=_0x811b2e[_0xfba4('0x4b')][_0xfba4('0x4c')]?_0x811b2e['attributes']:_0x4991f9['model'];if(!_0x2d7d05[_0xfba4('0x46')][_0xfba4('0x4d')]('nolimit')){_0x811b2e[_0xfba4('0x32')]=qs['limit'](_0x2d7d05[_0xfba4('0x46')][_0xfba4('0x32')]);_0x811b2e[_0xfba4('0x30')]=qs[_0xfba4('0x30')](_0x2d7d05[_0xfba4('0x46')][_0xfba4('0x30')]);}_0x811b2e[_0xfba4('0x4f')]=qs['sort'](_0x2d7d05[_0xfba4('0x46')][_0xfba4('0x50')]);_0x811b2e[_0xfba4('0x53')]=qs[_0xfba4('0x48')](_[_0xfba4('0x51')](_0x2d7d05[_0xfba4('0x46')],_0x4991f9['filters']));_0x811b2e[_0xfba4('0x53')][_0xfba4('0x6a')]=_0x692265['id'];if(_0x2d7d05[_0xfba4('0x46')]['filter']){_0x811b2e[_0xfba4('0x53')]=_['merge'](_0x811b2e[_0xfba4('0x53')],{'$or':_[_0xfba4('0x40')](_0x811b2e['attributes'],function(_0x402123){var _0x37fee5={};_0x37fee5[_0x402123]={'$like':'%'+_0x2d7d05['query']['filter']+'%'};return _0x37fee5;})});}_0x811b2e=_[_0xfba4('0x54')]({},_0x811b2e,_0x2d7d05['options']);return db[_0xfba4('0xa5')]['count']({'where':_0x811b2e[_0xfba4('0x53')]})[_0xfba4('0x20')](function(_0x1961c0){_0xfd003d[_0xfba4('0x33')]=_0x1961c0;if(_0x2d7d05['query'][_0xfba4('0x5e')]){_0x811b2e['include']=[{'model':db[_0xfba4('0xa0')],'as':_0xfba4('0xc4'),'required':![]},{'model':db[_0xfba4('0xad')],'as':_0xfba4('0xc5'),'attributes':[_0xfba4('0x3e'),_0xfba4('0xc6'),'internal'],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xfba4('0x3e'),'color'],'where':_0x2d7d05[_0xfba4('0x46')]['tag']?{'id':_0x2d7d05['query'][_0xfba4('0xc7')]}:undefined,'required':_0x2d7d05['query'][_0xfba4('0xc7')]?!![]:![]}];}return db[_0xfba4('0xa5')][_0xfba4('0x58')](_0x811b2e);})[_0xfba4('0x20')](function(_0x2ac115){_0xfd003d['rows']=_0x2ac115;return _0xfd003d;});}})[_0xfba4('0x20')](respondWithFilteredResult(_0x1520e9,_0x811b2e))[_0xfba4('0x2b')](handleError(_0x1520e9,null));};exports[_0xfba4('0x3f')]=function(_0x44934a,_0x1384db,_0x5ac144){var _0x8a160f,_0x11a72e,_0x202de2;if(_['isNil'](_0x44934a[_0xfba4('0x61')][_0xfba4('0x61')])||_0x44934a[_0xfba4('0x61')][_0xfba4('0x61')]===''){throw new db[(_0xfba4('0x7b'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x44934a[_0xfba4('0x61')]['to'])){throw new db[(_0xfba4('0x7b'))][(_0xfba4('0x7c'))](_0xfba4('0xc8'));}_0x8a160f=_0x44934a[_0xfba4('0x61')]['to'];return db[_0xfba4('0x41')][_0xfba4('0x5f')]({'where':{'id':_0x44934a[_0xfba4('0x5a')]['id']},'include':[{'model':db['CmList'],'as':_0xfba4('0xc9'),'include':[{'model':db['CmContact'],'as':_0xfba4('0xa1'),'where':{'mobile':_0x8a160f},'limit':0x1,'order':[[_0xfba4('0x80'),'DESC']]}]}]})[_0xfba4('0x20')](handleEntityNotFound(_0x1384db,null))[_0xfba4('0x20')](function(_0x11172e){if(_0x11172e&&_0x11172e[_0xfba4('0xc9')]){_0x11a72e=_0x11172e[_0xfba4('0x3a')]({'plain':!![]});if(_0x11a72e[_0xfba4('0xc9')]&&_0x11a72e[_0xfba4('0xc9')][_0xfba4('0xa1')][_0xfba4('0x4c')]){return _0x11a72e[_0xfba4('0xc9')][_0xfba4('0xa1')][0x0];}return db[_0xfba4('0xa0')][_0xfba4('0x60')](_[_0xfba4('0x17')](_0x44934a[_0xfba4('0x61')],{'firstName':_0x8a160f,'mobile':_0x8a160f,'phone':_0x8a160f,'ListId':_0x11a72e['ListId']}));}})[_0xfba4('0x20')](handleEntityNotFound(_0x1384db,null))[_0xfba4('0x20')](function(_0x507bea){if(_0x507bea){_0x202de2=_0x507bea;return db[_0xfba4('0xa5')]['find']({'where':{'ContactId':_0x202de2['id'],'closed':![],'SmsAccountId':_0x11a72e['id']}})[_0xfba4('0x20')](function(_0x596e38){if(_0x596e38){return[_0x596e38,![]];}return db[_0xfba4('0xa5')][_0xfba4('0x60')]({'UserId':_0x44934a[_0xfba4('0x63')]['id'],'ContactId':_0x202de2['id'],'SmsAccountId':_0x11a72e['id'],'phone':_0x8a160f,'firstMsgDirection':_0xfba4('0xca'),'Messages':[_[_0xfba4('0x54')](_0x44934a['body'],{'read':![],'body':_0x44934a[_0xfba4('0x61')][_0xfba4('0x61')],'phone':_0x8a160f,'SmsAccountId':_0x11a72e['id'],'UserId':_0x44934a[_0xfba4('0x63')]['id'],'ContactId':_0x202de2['id']})]},{'include':[{'model':db[_0xfba4('0xab')],'as':_0xfba4('0xcb')}]})[_0xfba4('0x20')](function(_0x355adf){return[_0x355adf,!![]];});});}})[_0xfba4('0xa6')](function(_0x34306d,_0xb95124){if(_0xb95124){return _0x34306d;}return db[_0xfba4('0xab')][_0xfba4('0x60')](_[_0xfba4('0x54')](_0x44934a['body'],{'read':![],'body':_0x44934a[_0xfba4('0x61')]['body'],'phone':_0x8a160f,'SmsAccountId':_0x11a72e['id'],'SmsInteractionId':_0x34306d['id'],'UserId':_0x44934a[_0xfba4('0x63')]['id'],'ContactId':_0x202de2['id']}))[_0xfba4('0x20')](function(_0x4efa78){_0x34306d[_0xfba4('0xcc')][_0xfba4('0xcb')]=[];_0x34306d[_0xfba4('0xcc')][_0xfba4('0xcb')]['push'](_0x4efa78[_0xfba4('0xcc')]);return _0x34306d;});})['then'](respondWithResult(_0x1384db,null))['catch'](handleError(_0x1384db,null));};exports[_0xfba4('0x2d')]=function(_0x40cb82,_0x4dd6bc,_0x3998e6){if(_0x40cb82[_0xfba4('0x61')]['id']){delete _0x40cb82['body']['id'];}var _0x53401b,_0x3b60dc,_0x5d4f90;return db[_0xfba4('0x41')]['find']({'where':{'id':_0x40cb82['params']['id']}})[_0xfba4('0x20')](handleEntityNotFound(_0x4dd6bc,null))['then'](function(_0x5e850c){if(_0x5e850c){_0x5d4f90=_0x5e850c;logger[_0xfba4('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xfba4('0x2d'),'received\x20delivery\x20report\x20from',_0x5e850c[_0xfba4('0x43')],util[_0xfba4('0xcd')](_0x40cb82[_0xfba4('0x61')],{'showHidden':![],'depth':null}));switch(_0x5e850c[_0xfba4('0x43')]){case _0xfba4('0x88'):if(_0x40cb82[_0xfba4('0x61')][_0xfba4('0xce')]&&_0x40cb82[_0xfba4('0x61')]['status']){_0x3b60dc=_0x40cb82['body'][_0xfba4('0x2d')];return db['SmsMessage']['find']({'where':{'messageId':_0x40cb82['body'][_0xfba4('0xce')]}});}break;case _0xfba4('0x8c'):if(_0x40cb82['body']['requestid']&&_0x40cb82['body'][_0xfba4('0xcf')]){_0x3b60dc=_0x40cb82[_0xfba4('0x61')][_0xfba4('0xcf')];return db['SmsMessage'][_0xfba4('0x5f')]({'where':{'messageId':_0x40cb82['body']['requestid']}});}break;case _0xfba4('0xd0'):if(_0x40cb82[_0xfba4('0x61')]['message_id']&&_0x40cb82[_0xfba4('0x61')][_0xfba4('0xd1')]){_0x3b60dc=_0x40cb82[_0xfba4('0x61')]['status_code'];return db[_0xfba4('0xab')][_0xfba4('0x5f')]({'where':{'messageId':_0x40cb82[_0xfba4('0x61')][_0xfba4('0x8d')]}});}break;case _0xfba4('0x90'):var _0x520fe0=_0x40cb82[_0xfba4('0x61')][_0xfba4('0x91')][0x0];if(_0x520fe0[_0xfba4('0x87')]&&_0x520fe0[_0xfba4('0x2d')][_0xfba4('0xd2')]===_0xfba4('0xd3')){_0x3b60dc=_0x520fe0[_0xfba4('0x2d')][_0xfba4('0xd2')];return db[_0xfba4('0xab')][_0xfba4('0x5f')]({'where':{'messageId':_0x520fe0[_0xfba4('0x87')]}});}break;case _0xfba4('0x95'):if(_0x40cb82[_0xfba4('0x61')]['messageId']&&_0x40cb82['body'][_0xfba4('0x2d')]){_0x3b60dc=_0x40cb82[_0xfba4('0x61')][_0xfba4('0x2d')];return db[_0xfba4('0xab')][_0xfba4('0x5f')]({'where':{'messageId':_0x40cb82[_0xfba4('0x61')][_0xfba4('0x87')]}});}break;case'bandwidth':if(_0x40cb82[_0xfba4('0x61')][0x0][_0xfba4('0x29')]['id']){_0x3b60dc=_0x40cb82[_0xfba4('0x61')][0x0]['type'];return db[_0xfba4('0xab')]['find']({'where':{'messageId':_0x40cb82['body'][0x0][_0xfba4('0x29')]['id']}});}break;case _0xfba4('0x99'):if(_0x40cb82['body'][_0xfba4('0xd4')]&&_0x40cb82['body'][_0xfba4('0x2d')]){_0x3b60dc=_0x40cb82[_0xfba4('0x61')]['status'];return db[_0xfba4('0xab')]['find']({'where':{'messageId':_0x40cb82['body']['redif']}});}break;}}})[_0xfba4('0x20')](handleEntityNotFound(_0x4dd6bc,null))[_0xfba4('0x20')](function(_0x44846d){if(_0x44846d){_0x53401b=_0x44846d;switch(_0x5d4f90[_0xfba4('0x43')]){case _0xfba4('0x88'):if(_0x3b60dc===_0xfba4('0xd3')){return _0x53401b['update']({'read':!![]});}else{logger[_0xfba4('0x27')](_0xfba4('0x25'),_0xfba4('0x2d'),'skebby',util[_0xfba4('0xcd')](_0x40cb82[_0xfba4('0x61')],{'showHidden':![],'depth':null}));}break;case _0xfba4('0x8c'):if(_0x3b60dc==='1'){return _0x53401b['update']({'read':!![]});}else{logger[_0xfba4('0x27')](_0xfba4('0x25'),_0xfba4('0x2d'),'skebby',util[_0xfba4('0xcd')](_0x40cb82[_0xfba4('0x61')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x40cb82[_0xfba4('0x61')][_0xfba4('0xd5')]&&_0x3b60dc>=0xc8&&_0x3b60dc<=0xce){return _0x53401b[_0xfba4('0x38')]({'read':!![]});}else{logger[_0xfba4('0x27')](_0xfba4('0x25'),_0xfba4('0x2d'),_0xfba4('0xd0'),util[_0xfba4('0xcd')](_0x40cb82[_0xfba4('0x61')],{'showHidden':![],'depth':null}));}break;case _0xfba4('0x90'):var _0xb0d553=_0x40cb82[_0xfba4('0x61')][_0xfba4('0x91')][0x0];if(_0xb0d553[_0xfba4('0x2d')][_0xfba4('0xd2')]===_0xfba4('0xd3')){return _0x53401b[_0xfba4('0x38')]({'read':!![]});}else{logger[_0xfba4('0x27')](_0xfba4('0x25'),_0xfba4('0x2d'),'infobip',util[_0xfba4('0xcd')](_0x40cb82[_0xfba4('0x61')],{'showHidden':![],'depth':null}));}break;case _0xfba4('0x95'):if(_0x3b60dc==_0xfba4('0xd6')||_0x3b60dc==_0xfba4('0xd7')){return _0x53401b[_0xfba4('0x38')]({'read':!![]});}else{logger[_0xfba4('0x27')](_0xfba4('0x25'),_0xfba4('0x2d'),'clickatell',util[_0xfba4('0xcd')](_0x40cb82[_0xfba4('0x61')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x3b60dc==_0xfba4('0xd8')){return _0x53401b[_0xfba4('0x38')]({'read':!![]});}else{logger[_0xfba4('0x27')](_0xfba4('0x25'),_0xfba4('0x2d'),_0xfba4('0x98'),util['inspect'](_0x40cb82[_0xfba4('0x61')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x3b60dc===_0xfba4('0xd9')||_0x3b60dc===_0xfba4('0xda')){return _0x53401b['update']({'read':!![]});}else{logger[_0xfba4('0x27')](_0xfba4('0x25'),_0xfba4('0x2d'),_0xfba4('0x99'),util[_0xfba4('0xcd')](_0x40cb82[_0xfba4('0x61')],{'showHidden':![],'depth':null}));}break;}return _0x53401b;}})[_0xfba4('0x20')](respondWithResult(_0x4dd6bc,null))[_0xfba4('0x2b')](handleError(_0x4dd6bc,null));};exports[_0xfba4('0xdb')]=function(_0x11a7a5,_0x1f1008,_0x662c72){var _0x559f90,_0x578a07,_0x2ce87b;return db['SmsAccount']['find']({'where':{'id':_0x11a7a5[_0xfba4('0x5a')]['id']}})[_0xfba4('0x20')](handleEntityNotFound(_0x1f1008,null))[_0xfba4('0x20')](function(_0x376e58){if(_0x376e58){_0x2ce87b=_0x376e58;logger[_0xfba4('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xfba4('0x2d'),_0xfba4('0xdc'),_0x376e58['type'],util['inspect'](_0x11a7a5[_0xfba4('0x46')],{'showHidden':![],'depth':null}));switch(_0x376e58['type']){case'csc':if(_0x11a7a5[_0xfba4('0x46')]['message-id']&&_0x11a7a5['query']['state']){_0x578a07=_0x11a7a5['query']['state'];return db['SmsMessage'][_0xfba4('0x5f')]({'where':{'messageId':_0x11a7a5[_0xfba4('0x46')]['message-id']}});}break;}}})[_0xfba4('0x20')](handleEntityNotFound(_0x1f1008,null))[_0xfba4('0x20')](function(_0x1a3415){if(_0x1a3415){_0x559f90=_0x1a3415;switch(_0x2ce87b[_0xfba4('0x43')]){case _0xfba4('0x92'):if(_0x578a07==='2'||_0x578a07==='6'){return _0x559f90[_0xfba4('0x38')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xfba4('0x2d'),_0xfba4('0x92'),util[_0xfba4('0xcd')](_0x11a7a5[_0xfba4('0x46')],{'showHidden':![],'depth':null}));};break;}return _0x559f90;}})[_0xfba4('0x20')](respondWithResult(_0x1f1008,null))[_0xfba4('0x2b')](handleError(_0x1f1008,null));};exports[_0xfba4('0xdd')]=function(_0x55667f,_0x4f604b,_0x132567){return db[_0xfba4('0x41')][_0xfba4('0x5f')]({'where':{'id':_0x55667f['params']['id']}})[_0xfba4('0x20')](handleEntityNotFound(_0x4f604b,null))[_0xfba4('0x20')](function(_0x22be49){if(_0x22be49){return _0x22be49[_0xfba4('0xdd')](_0x55667f[_0xfba4('0x61')][_0xfba4('0x72')],_[_0xfba4('0xa4')](_0x55667f['body'],['ids','id'])||{})[_0xfba4('0xa6')](function(_0x2817bb){for(var _0x1d82b7=0x0;_0x1d82b7<_0x55667f[_0xfba4('0x61')][_0xfba4('0x72')][_0xfba4('0x4c')];_0x1d82b7+=0x1){socket[_0xfba4('0xde')]('userSmsAccount:save',{'UserId':Number(_0x55667f[_0xfba4('0x61')]['ids'][_0x1d82b7]),'SmsAccountId':Number(_0x55667f[_0xfba4('0x5a')]['id'])});}return _0x2817bb;});}})[_0xfba4('0x20')](respondWithResult(_0x4f604b,null))[_0xfba4('0x2b')](handleError(_0x4f604b,null));};exports['removeAgents']=function(_0x53c4f6,_0x216bbb,_0x32521a){return db[_0xfba4('0x41')][_0xfba4('0x5f')]({'where':{'id':_0x53c4f6[_0xfba4('0x5a')]['id']}})['then'](handleEntityNotFound(_0x216bbb,null))[_0xfba4('0x20')](function(_0x5ad547){if(_0x5ad547){return _0x5ad547[_0xfba4('0xdf')](_0x53c4f6['query'][_0xfba4('0x72')])['then'](function(){if(_['isArray'](_0x53c4f6[_0xfba4('0x46')][_0xfba4('0x72')])){for(var _0x1c68b3=0x0;_0x1c68b3<_0x53c4f6['query']['ids'][_0xfba4('0x4c')];_0x1c68b3+=0x1){socket[_0xfba4('0xde')](_0xfba4('0xe0'),{'UserId':Number(_0x53c4f6[_0xfba4('0x46')][_0xfba4('0x72')][_0x1c68b3]),'SmsAccountId':Number(_0x53c4f6[_0xfba4('0x5a')]['id'])});}}else{socket[_0xfba4('0xde')](_0xfba4('0xe0'),{'UserId':Number(_0x53c4f6[_0xfba4('0x46')][_0xfba4('0x72')]),'SmsAccountId':Number(_0x53c4f6[_0xfba4('0x5a')]['id'])});}});}})[_0xfba4('0x20')](respondWithStatusCode(_0x216bbb,null))[_0xfba4('0x2b')](handleError(_0x216bbb,null));};exports[_0xfba4('0xe1')]=function(_0x18ccef,_0x463f89,_0x515c37){var _0x165a70={};var _0xf0a6f5={};var _0xc9cfd1;var _0x50bef2;return db[_0xfba4('0x41')][_0xfba4('0x6b')]({'where':{'id':_0x18ccef[_0xfba4('0x5a')]['id']}})[_0xfba4('0x20')](handleEntityNotFound(_0x463f89,null))['then'](function(_0x1aa8bb){if(_0x1aa8bb){_0xc9cfd1=_0x1aa8bb;_0xf0a6f5[_0xfba4('0x45')]=_['keys'](db[_0xfba4('0xad')][_0xfba4('0x5d')]);_0xf0a6f5[_0xfba4('0x46')]=_['keys'](_0x18ccef['query']);_0xf0a6f5['filters']=_[_0xfba4('0x49')](_0xf0a6f5['model'],_0xf0a6f5[_0xfba4('0x46')]);_0x165a70[_0xfba4('0x4b')]=_['intersection'](_0xf0a6f5[_0xfba4('0x45')],qs[_0xfba4('0x4a')](_0x18ccef[_0xfba4('0x46')][_0xfba4('0x4a')]));_0x165a70[_0xfba4('0x4b')]=_0x165a70[_0xfba4('0x4b')][_0xfba4('0x4c')]?_0x165a70['attributes']:_0xf0a6f5['model'];_0x165a70[_0xfba4('0x4f')]=qs[_0xfba4('0x50')](_0x18ccef[_0xfba4('0x46')]['sort']);_0x165a70[_0xfba4('0x53')]=qs[_0xfba4('0x48')](_[_0xfba4('0x51')](_0x18ccef[_0xfba4('0x46')],_0xf0a6f5[_0xfba4('0x48')]));if(_0x18ccef[_0xfba4('0x46')][_0xfba4('0x52')]){_0x165a70['where']=_[_0xfba4('0x54')](_0x165a70[_0xfba4('0x53')],{'$or':_[_0xfba4('0x40')](_0x165a70[_0xfba4('0x4b')],function(_0x4dcf77){var _0x1fa440={};_0x1fa440[_0x4dcf77]={'$like':'%'+_0x18ccef['query']['filter']+'%'};return _0x1fa440;})});}_0x165a70=_['merge']({},_0x165a70,_0x18ccef[_0xfba4('0x56')]);return _0xc9cfd1[_0xfba4('0xe1')](_0x165a70);}})[_0xfba4('0x20')](function(_0x53c65f){if(_0x53c65f){_0x50bef2=_0x53c65f[_0xfba4('0x4c')];if(!_0x18ccef[_0xfba4('0x46')]['hasOwnProperty'](_0xfba4('0x4e'))){_0x165a70[_0xfba4('0x32')]=qs['limit'](_0x18ccef['query']['limit']);_0x165a70[_0xfba4('0x30')]=qs[_0xfba4('0x30')](_0x18ccef[_0xfba4('0x46')][_0xfba4('0x30')]);}return _0xc9cfd1[_0xfba4('0xe1')](_0x165a70);}})['then'](function(_0x5b0653){if(_0x5b0653){return _0x5b0653?{'count':_0x50bef2,'rows':_0x5b0653}:null;}})[_0xfba4('0x20')](respondWithResult(_0x463f89,null))[_0xfba4('0x2b')](handleError(_0x463f89,null));}; \ No newline at end of file +var _0x2cbe=['message-id','state','addAgents','omit','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','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','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','defaults','redis','localhost','register','jayson/promise','http','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','get','SmsAccounts','sendStatus','stack','name','send','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','rows','show','params','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','SmsAccountId','Disposition','findOne','findAll','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','Applications','account','applications','orderBy','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','Body','MessageSid','text','connectel','clicksend','messageId','Text','MessageUUID','infobip','results','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','intelepeer','refid','ValidationError','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','contact','SmsInteraction','spread','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','agent','SmsQueue','queueId','queue','waitForTheAssignedQueue','Start','startRouting','entity\x20found','Content-Type','\x0a','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','bulkCreate','findAndCountAll','priority','finally','getApplications','SmsApplication','hasOwnProperty','getInteractions','Contact','Owner','fullname','internal','Tag','color','tag','CmList','List','SmsMessage','Messages','dataValues','debug','received\x20delivery\x20report\x20from','inspect','skebby','requestid','statusInt','status_code','message_id','groupName','bandwidth','redif','error_code','update','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','csc'];(function(_0x3e444a,_0x5def2c){var _0x192cf9=function(_0x5d2abb){while(--_0x5d2abb){_0x3e444a['push'](_0x3e444a['shift']());}};_0x192cf9(++_0x5def2c);}(_0x2cbe,0xeb));var _0xe2cb=function(_0x4f75b5,_0x4db76d){_0x4f75b5=_0x4f75b5-0x0;var _0x5c263b=_0x2cbe[_0x4f75b5];return _0x5c263b;};'use strict';var emlformat=require(_0xe2cb('0x0'));var rimraf=require(_0xe2cb('0x1'));var zipdir=require(_0xe2cb('0x2'));var jsonpatch=require(_0xe2cb('0x3'));var rp=require(_0xe2cb('0x4'));var moment=require(_0xe2cb('0x5'));var BPromise=require(_0xe2cb('0x6'));var Mustache=require('mustache');var util=require(_0xe2cb('0x7'));var path=require(_0xe2cb('0x8'));var sox=require(_0xe2cb('0x9'));var csv=require(_0xe2cb('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe2cb('0xb'));var _=require(_0xe2cb('0xc'));var squel=require(_0xe2cb('0xd'));var crypto=require(_0xe2cb('0xe'));var jsforce=require(_0xe2cb('0xf'));var deskjs=require(_0xe2cb('0x10'));var toCsv=require(_0xe2cb('0xa'));var querystring=require('querystring');var Papa=require(_0xe2cb('0x11'));var Redis=require(_0xe2cb('0x12'));var authService=require(_0xe2cb('0x13'));var qs=require(_0xe2cb('0x14'));var as=require(_0xe2cb('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe2cb('0x16'))(_0xe2cb('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe2cb('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xe2cb('0x19')](config[_0xe2cb('0x1a')],{'host':_0xe2cb('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe2cb('0x1a')]));require('./smsAccount.socket')[_0xe2cb('0x1c')](socket);var jayson=require(_0xe2cb('0x1d'));var client=jayson['client'][_0xe2cb('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x44adb5,_0x1fef32,_0x19cad9,_0xf066cc){return new BPromise(function(_0x5ec517,_0x4ea3dd){var _0x480270=_0xf066cc||client;return _0x480270[_0xe2cb('0x1f')](_0x44adb5,_0x19cad9)['then'](function(_0x1bffe2){logger[_0xe2cb('0x20')](_0xe2cb('0x21'),_0x1fef32,_0xe2cb('0x22'));logger['debug'](_0xe2cb('0x23'),_0x1fef32,_0xe2cb('0x22'),JSON[_0xe2cb('0x24')](_0x1bffe2));if(_0x1bffe2['error']){if(_0x1bffe2[_0xe2cb('0x25')]['code']===0x1f4){logger[_0xe2cb('0x25')](_0xe2cb('0x21'),_0x1fef32,_0x1bffe2['error']['message']);return _0x4ea3dd(_0x1bffe2[_0xe2cb('0x25')][_0xe2cb('0x26')]);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x1fef32,_0x1bffe2[_0xe2cb('0x25')][_0xe2cb('0x26')]);return _0x5ec517(_0x1bffe2[_0xe2cb('0x25')][_0xe2cb('0x26')]);}else{logger[_0xe2cb('0x20')](_0xe2cb('0x21'),_0x1fef32,'request\x20sent');_0x5ec517(_0x1bffe2['result'][_0xe2cb('0x26')]);}})[_0xe2cb('0x27')](function(_0x1f22a7){logger[_0xe2cb('0x25')](_0xe2cb('0x21'),_0x1fef32,_0x1f22a7);_0x4ea3dd(_0x1f22a7);});});}function respondWithStatusCode(_0x4a5b28,_0x1958bb){_0x1958bb=_0x1958bb||0xcc;return function(_0x36f74c){if(_0x36f74c){return _0x4a5b28['sendStatus'](_0x1958bb);}return _0x4a5b28['status'](_0x1958bb)[_0xe2cb('0x28')]();};}function respondWithResult(_0x191afa,_0x3820e3){_0x3820e3=_0x3820e3||0xc8;return function(_0x370807){if(_0x370807){return _0x191afa[_0xe2cb('0x29')](_0x3820e3)[_0xe2cb('0x2a')](_0x370807);}};}function respondWithFilteredResult(_0x3c0cfc,_0x228984){return function(_0x1fe82b){if(_0x1fe82b){var _0x1e30d5=typeof _0x228984[_0xe2cb('0x2b')]===_0xe2cb('0x2c')&&typeof _0x228984['limit']==='undefined';var _0x4929ad=_0x1fe82b[_0xe2cb('0x2d')];var _0x229770=_0x1e30d5?0x0:_0x228984[_0xe2cb('0x2b')];var _0x542981=_0x1e30d5?_0x1fe82b[_0xe2cb('0x2d')]:_0x228984[_0xe2cb('0x2b')]+_0x228984[_0xe2cb('0x2e')];var _0x122f67;if(_0x542981>=_0x4929ad){_0x542981=_0x4929ad;_0x122f67=0xc8;}else{_0x122f67=0xce;}_0x3c0cfc[_0xe2cb('0x29')](_0x122f67);return _0x3c0cfc[_0xe2cb('0x2f')](_0xe2cb('0x30'),_0x229770+'-'+_0x542981+'/'+_0x4929ad)['json'](_0x1fe82b);}return null;};}function patchUpdates(_0x1d1d25){return function(_0x41374a){try{jsonpatch[_0xe2cb('0x31')](_0x41374a,_0x1d1d25,!![]);}catch(_0x3b8111){return BPromise['reject'](_0x3b8111);}return _0x41374a[_0xe2cb('0x32')]();};}function saveUpdates(_0x4c0c88,_0x21805f){return function(_0x3756b5){if(_0x3756b5){return _0x3756b5['update'](_0x4c0c88)[_0xe2cb('0x33')](function(_0x40fda9){return _0x40fda9;});}return null;};}function removeEntity(_0x55c808,_0x59dee5){return function(_0x409c4e){if(_0x409c4e){return _0x409c4e[_0xe2cb('0x34')]()[_0xe2cb('0x33')](function(){var _0x30735f=_0x409c4e[_0xe2cb('0x35')]({'plain':!![]});var _0x620677=_0xe2cb('0x36');return db['UserProfileResource'][_0xe2cb('0x34')]({'where':{'type':_0x620677,'resourceId':_0x30735f['id']}})[_0xe2cb('0x33')](function(){return _0x409c4e;});})[_0xe2cb('0x33')](function(){_0x55c808[_0xe2cb('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3310f6,_0x563334){return function(_0x5a2b29){if(!_0x5a2b29){_0x3310f6[_0xe2cb('0x37')](0x194);}return _0x5a2b29;};}function handleError(_0x4231d7,_0x10909f){_0x10909f=_0x10909f||0x1f4;return function(_0x4e70db){logger[_0xe2cb('0x25')](_0x4e70db[_0xe2cb('0x38')]);if(_0x4e70db[_0xe2cb('0x39')]){delete _0x4e70db['name'];}_0x4231d7[_0xe2cb('0x29')](_0x10909f)[_0xe2cb('0x3a')](_0x4e70db);};}exports['index']=function(_0x38838f,_0x5e7e5c){var _0x508856={'include':[{'model':db['Pause'],'as':_0xe2cb('0x3b')}]},_0xf24ae0={},_0x20c790={'count':0x0,'rows':[]};var _0x565772=_[_0xe2cb('0x3c')](db[_0xe2cb('0x3d')][_0xe2cb('0x3e')],function(_0x1b667f){return{'name':_0x1b667f[_0xe2cb('0x3f')],'type':_0x1b667f[_0xe2cb('0x40')][_0xe2cb('0x41')]};});_0xf24ae0[_0xe2cb('0x42')]=_[_0xe2cb('0x3c')](_0x565772,_0xe2cb('0x39'));_0xf24ae0['query']=_['keys'](_0x38838f[_0xe2cb('0x43')]);_0xf24ae0[_0xe2cb('0x44')]=_[_0xe2cb('0x45')](_0xf24ae0['model'],_0xf24ae0[_0xe2cb('0x43')]);_0x508856[_0xe2cb('0x46')]=_['intersection'](_0xf24ae0[_0xe2cb('0x42')],qs[_0xe2cb('0x47')](_0x38838f[_0xe2cb('0x43')]['fields']));_0x508856['attributes']=_0x508856['attributes'][_0xe2cb('0x48')]?_0x508856[_0xe2cb('0x46')]:_0xf24ae0['model'];if(!_0x38838f[_0xe2cb('0x43')]['hasOwnProperty'](_0xe2cb('0x49'))){_0x508856[_0xe2cb('0x2e')]=qs['limit'](_0x38838f['query']['limit']);_0x508856[_0xe2cb('0x2b')]=qs[_0xe2cb('0x2b')](_0x38838f[_0xe2cb('0x43')][_0xe2cb('0x2b')]);}_0x508856[_0xe2cb('0x4a')]=qs[_0xe2cb('0x4b')](_0x38838f[_0xe2cb('0x43')][_0xe2cb('0x4b')]);_0x508856['where']=qs['filters'](_[_0xe2cb('0x4c')](_0x38838f[_0xe2cb('0x43')],_0xf24ae0[_0xe2cb('0x44')]),_0x565772);if(_0x38838f[_0xe2cb('0x43')][_0xe2cb('0x4d')]){_0x508856[_0xe2cb('0x4e')]=_['merge'](_0x508856[_0xe2cb('0x4e')],{'$or':_[_0xe2cb('0x3c')](_0x565772,function(_0x24b762){if(_0x24b762['type']!=='VIRTUAL'){var _0x3f137e={};_0x3f137e[_0x24b762[_0xe2cb('0x39')]]={'$like':'%'+_0x38838f[_0xe2cb('0x43')][_0xe2cb('0x4d')]+'%'};return _0x3f137e;}})});}_0x508856=_[_0xe2cb('0x4f')]({},_0x508856,_0x38838f[_0xe2cb('0x50')]);var _0x2791eb={'where':_0x508856[_0xe2cb('0x4e')]};return db[_0xe2cb('0x3d')][_0xe2cb('0x2d')](_0x2791eb)['then'](function(_0x50bbf8){_0x20c790[_0xe2cb('0x2d')]=_0x50bbf8;if(_0x38838f[_0xe2cb('0x43')][_0xe2cb('0x51')]){_0x508856[_0xe2cb('0x52')]=[{'all':!![]}];}return db[_0xe2cb('0x3d')]['findAll'](_0x508856);})['then'](function(_0x1787db){_0x20c790[_0xe2cb('0x53')]=_0x1787db;return _0x20c790;})[_0xe2cb('0x33')](respondWithFilteredResult(_0x5e7e5c,_0x508856))['catch'](handleError(_0x5e7e5c,null));};exports[_0xe2cb('0x54')]=function(_0x48312f,_0x4ea6de){var _0x3e9aa9={'raw':![],'where':{'id':_0x48312f[_0xe2cb('0x55')]['id']},'include':[{'model':db['Pause'],'as':_0xe2cb('0x3b')}]},_0x50ca7b={};_0x50ca7b[_0xe2cb('0x42')]=_[_0xe2cb('0x56')](db['SmsAccount'][_0xe2cb('0x3e')]);_0x50ca7b[_0xe2cb('0x43')]=_[_0xe2cb('0x56')](_0x48312f['query']);_0x50ca7b['filters']=_[_0xe2cb('0x45')](_0x50ca7b[_0xe2cb('0x42')],_0x50ca7b[_0xe2cb('0x43')]);_0x3e9aa9['attributes']=_[_0xe2cb('0x45')](_0x50ca7b[_0xe2cb('0x42')],qs[_0xe2cb('0x47')](_0x48312f[_0xe2cb('0x43')]['fields']));_0x3e9aa9[_0xe2cb('0x46')]=_0x3e9aa9[_0xe2cb('0x46')][_0xe2cb('0x48')]?_0x3e9aa9['attributes']:_0x50ca7b[_0xe2cb('0x42')];if(_0x48312f[_0xe2cb('0x43')][_0xe2cb('0x51')]){_0x3e9aa9[_0xe2cb('0x52')]=[{'all':!![]}];}_0x3e9aa9=_[_0xe2cb('0x4f')]({},_0x3e9aa9,_0x48312f['options']);return db['SmsAccount']['find'](_0x3e9aa9)[_0xe2cb('0x33')](handleEntityNotFound(_0x4ea6de,null))[_0xe2cb('0x33')](respondWithResult(_0x4ea6de,null))['catch'](handleError(_0x4ea6de,null));};exports[_0xe2cb('0x57')]=function(_0x9c86fc,_0x49148f){return db[_0xe2cb('0x3d')][_0xe2cb('0x57')](_0x9c86fc[_0xe2cb('0x58')],{})['then'](function(_0x2c322b){var _0x3ec0f4=_0x9c86fc[_0xe2cb('0x59')][_0xe2cb('0x35')]({'plain':!![]});if(!_0x3ec0f4)throw new Error(_0xe2cb('0x5a'));if(_0x3ec0f4[_0xe2cb('0x5b')]===_0xe2cb('0x59')){var _0x273513=_0x2c322b[_0xe2cb('0x35')]({'plain':!![]});var _0x1f3d3c=_0xe2cb('0x36');return db[_0xe2cb('0x5c')][_0xe2cb('0x5d')]({'where':{'name':_0x1f3d3c,'userProfileId':_0x3ec0f4['userProfileId']},'raw':!![]})[_0xe2cb('0x33')](function(_0xa3f040){if(_0xa3f040&&_0xa3f040['autoAssociation']===0x0){return db[_0xe2cb('0x5e')]['create']({'name':_0x273513[_0xe2cb('0x39')],'resourceId':_0x273513['id'],'type':_0xa3f040[_0xe2cb('0x39')],'sectionId':_0xa3f040['id']},{})['then'](function(){return _0x2c322b;});}else{return _0x2c322b;}})[_0xe2cb('0x27')](function(_0x5471e8){logger['error'](_0xe2cb('0x5f'),_0x5471e8);throw _0x5471e8;});}return _0x2c322b;})[_0xe2cb('0x33')](respondWithResult(_0x49148f,0xc9))[_0xe2cb('0x27')](handleError(_0x49148f,null));};exports['update']=function(_0x2d0ecd,_0xa4722a){if(_0x2d0ecd['body']['id']){delete _0x2d0ecd[_0xe2cb('0x58')]['id'];}return db[_0xe2cb('0x3d')]['find']({'where':{'id':_0x2d0ecd[_0xe2cb('0x55')]['id']},'include':[{'model':db['Pause'],'as':_0xe2cb('0x3b')}]})[_0xe2cb('0x33')](handleEntityNotFound(_0xa4722a,null))[_0xe2cb('0x33')](saveUpdates(_0x2d0ecd[_0xe2cb('0x58')],null))['then'](respondWithResult(_0xa4722a,null))[_0xe2cb('0x27')](handleError(_0xa4722a,null));};exports[_0xe2cb('0x34')]=function(_0x2e3582,_0x263f65){return db['SmsAccount']['find']({'where':{'id':_0x2e3582['params']['id']}})[_0xe2cb('0x33')](handleEntityNotFound(_0x263f65,null))[_0xe2cb('0x33')](removeEntity(_0x263f65,null))[_0xe2cb('0x27')](handleError(_0x263f65,null));};exports[_0xe2cb('0x60')]=function(_0x4dea7e,_0x24e642){return db['SmsAccount'][_0xe2cb('0x60')]()['then'](respondWithResult(_0x24e642,null))[_0xe2cb('0x27')](handleError(_0x24e642,null));};exports[_0xe2cb('0x61')]=function(_0x5451d9,_0x11163c,_0x3b54ea){if(_0x5451d9[_0xe2cb('0x58')]['id']){delete _0x5451d9['body']['id'];}return db[_0xe2cb('0x3d')]['find']({'where':{'id':_0x5451d9[_0xe2cb('0x55')]['id']}})[_0xe2cb('0x33')](handleEntityNotFound(_0x11163c,null))[_0xe2cb('0x33')](function(_0x2a0672){if(_0x2a0672){_0x5451d9[_0xe2cb('0x58')][_0xe2cb('0x62')]=_0x2a0672['id'];return db[_0xe2cb('0x63')][_0xe2cb('0x57')](_0x5451d9['body']);}})[_0xe2cb('0x33')](respondWithResult(_0x11163c,null))[_0xe2cb('0x27')](handleError(_0x11163c,null));};exports['getDispositions']=function(_0x44819f,_0x573db4,_0x3cf74f){var _0x454564={'raw':![],'where':{}};var _0x2a0f21={};var _0x98b073={'count':0x0,'rows':[]};return db[_0xe2cb('0x3d')][_0xe2cb('0x64')]({'where':{'id':_0x44819f[_0xe2cb('0x55')]['id']}})[_0xe2cb('0x33')](handleEntityNotFound(_0x573db4,null))[_0xe2cb('0x33')](function(_0x4bc724){if(_0x4bc724){_0x2a0f21[_0xe2cb('0x42')]=_[_0xe2cb('0x56')](db[_0xe2cb('0x63')][_0xe2cb('0x3e')]);_0x2a0f21['query']=_[_0xe2cb('0x56')](_0x44819f[_0xe2cb('0x43')]);_0x2a0f21['filters']=_[_0xe2cb('0x45')](_0x2a0f21[_0xe2cb('0x42')],_0x2a0f21[_0xe2cb('0x43')]);_0x454564['attributes']=_[_0xe2cb('0x45')](_0x2a0f21[_0xe2cb('0x42')],qs[_0xe2cb('0x47')](_0x44819f[_0xe2cb('0x43')]['fields']));_0x454564[_0xe2cb('0x46')]=_0x454564[_0xe2cb('0x46')][_0xe2cb('0x48')]?_0x454564[_0xe2cb('0x46')]:_0x2a0f21[_0xe2cb('0x42')];if(!_0x44819f[_0xe2cb('0x43')]['hasOwnProperty'](_0xe2cb('0x49'))){_0x454564[_0xe2cb('0x2e')]=qs[_0xe2cb('0x2e')](_0x44819f[_0xe2cb('0x43')][_0xe2cb('0x2e')]);_0x454564[_0xe2cb('0x2b')]=qs['offset'](_0x44819f[_0xe2cb('0x43')][_0xe2cb('0x2b')]);}_0x454564[_0xe2cb('0x4a')]=qs[_0xe2cb('0x4b')](_0x44819f[_0xe2cb('0x43')][_0xe2cb('0x4b')]);_0x454564['where']=qs[_0xe2cb('0x44')](_[_0xe2cb('0x4c')](_0x44819f['query'],_0x2a0f21[_0xe2cb('0x44')]));_0x454564[_0xe2cb('0x4e')][_0xe2cb('0x62')]=_0x4bc724['id'];if(_0x44819f['query'][_0xe2cb('0x4d')]){_0x454564['where']=_[_0xe2cb('0x4f')](_0x454564[_0xe2cb('0x4e')],{'$or':_[_0xe2cb('0x3c')](_0x454564[_0xe2cb('0x46')],function(_0x2505f4){var _0x208d38={};_0x208d38[_0x2505f4]={'$like':'%'+_0x44819f['query'][_0xe2cb('0x4d')]+'%'};return _0x208d38;})});}_0x454564=_[_0xe2cb('0x4f')]({},_0x454564,_0x44819f[_0xe2cb('0x50')]);return db[_0xe2cb('0x63')]['count']({'where':_0x454564['where']})['then'](function(_0x13485d){_0x98b073[_0xe2cb('0x2d')]=_0x13485d;if(_0x44819f['query'][_0xe2cb('0x51')]){_0x454564[_0xe2cb('0x52')]=[{'all':!![]}];}return db['Disposition'][_0xe2cb('0x65')](_0x454564);})[_0xe2cb('0x33')](function(_0x33301a){_0x98b073['rows']=_0x33301a;return _0x98b073;});}})['then'](respondWithFilteredResult(_0x573db4,_0x454564))[_0xe2cb('0x27')](handleError(_0x573db4,null));};exports[_0xe2cb('0x66')]=function(_0xa5b3cb,_0x51be50,_0x3071a7){return db['SmsAccount'][_0xe2cb('0x5d')]({'where':{'id':_0xa5b3cb[_0xe2cb('0x55')]['id']}})[_0xe2cb('0x33')](handleEntityNotFound(_0x51be50,null))[_0xe2cb('0x33')](function(_0x206cec){if(_0x206cec){return _0x206cec[_0xe2cb('0x66')](_0xa5b3cb[_0xe2cb('0x43')][_0xe2cb('0x67')]);}})['then'](respondWithStatusCode(_0x51be50,null))[_0xe2cb('0x27')](handleError(_0x51be50,null));};exports['addAnswer']=function(_0x378625,_0x283f8b,_0x29e75f){if(_0x378625[_0xe2cb('0x58')]['id']){delete _0x378625[_0xe2cb('0x58')]['id'];}return db[_0xe2cb('0x3d')]['find']({'where':{'id':_0x378625[_0xe2cb('0x55')]['id']}})[_0xe2cb('0x33')](handleEntityNotFound(_0x283f8b,null))[_0xe2cb('0x33')](function(_0x2a9c1f){if(_0x2a9c1f){_0x378625[_0xe2cb('0x58')][_0xe2cb('0x62')]=_0x2a9c1f['id'];return db[_0xe2cb('0x68')]['create'](_0x378625['body']);}})[_0xe2cb('0x33')](respondWithResult(_0x283f8b,null))[_0xe2cb('0x27')](handleError(_0x283f8b,null));};exports[_0xe2cb('0x69')]=function(_0x2aaab0,_0x499c6e,_0x43918f){var _0x1229ae={'raw':![],'where':{}};var _0x147e63={};var _0x11783d={'count':0x0,'rows':[]};return db['SmsAccount'][_0xe2cb('0x64')]({'where':{'id':_0x2aaab0[_0xe2cb('0x55')]['id']}})[_0xe2cb('0x33')](handleEntityNotFound(_0x499c6e,null))[_0xe2cb('0x33')](function(_0x53732b){if(_0x53732b){_0x147e63[_0xe2cb('0x42')]=_[_0xe2cb('0x56')](db[_0xe2cb('0x68')][_0xe2cb('0x3e')]);_0x147e63['query']=_[_0xe2cb('0x56')](_0x2aaab0['query']);_0x147e63['filters']=_[_0xe2cb('0x45')](_0x147e63[_0xe2cb('0x42')],_0x147e63[_0xe2cb('0x43')]);_0x1229ae[_0xe2cb('0x46')]=_['intersection'](_0x147e63[_0xe2cb('0x42')],qs['fields'](_0x2aaab0[_0xe2cb('0x43')]['fields']));_0x1229ae[_0xe2cb('0x46')]=_0x1229ae[_0xe2cb('0x46')][_0xe2cb('0x48')]?_0x1229ae[_0xe2cb('0x46')]:_0x147e63['model'];if(!_0x2aaab0['query']['hasOwnProperty'](_0xe2cb('0x49'))){_0x1229ae[_0xe2cb('0x2e')]=qs[_0xe2cb('0x2e')](_0x2aaab0[_0xe2cb('0x43')][_0xe2cb('0x2e')]);_0x1229ae[_0xe2cb('0x2b')]=qs['offset'](_0x2aaab0['query'][_0xe2cb('0x2b')]);}_0x1229ae[_0xe2cb('0x4a')]=qs[_0xe2cb('0x4b')](_0x2aaab0[_0xe2cb('0x43')][_0xe2cb('0x4b')]);_0x1229ae[_0xe2cb('0x4e')]=qs[_0xe2cb('0x44')](_[_0xe2cb('0x4c')](_0x2aaab0[_0xe2cb('0x43')],_0x147e63[_0xe2cb('0x44')]));_0x1229ae['where']['SmsAccountId']=_0x53732b['id'];if(_0x2aaab0[_0xe2cb('0x43')][_0xe2cb('0x4d')]){_0x1229ae[_0xe2cb('0x4e')]=_[_0xe2cb('0x4f')](_0x1229ae[_0xe2cb('0x4e')],{'$or':_[_0xe2cb('0x3c')](_0x1229ae[_0xe2cb('0x46')],function(_0x526945){var _0x26ecf1={};_0x26ecf1[_0x526945]={'$like':'%'+_0x2aaab0[_0xe2cb('0x43')]['filter']+'%'};return _0x26ecf1;})});}_0x1229ae=_[_0xe2cb('0x4f')]({},_0x1229ae,_0x2aaab0[_0xe2cb('0x50')]);return db[_0xe2cb('0x68')][_0xe2cb('0x2d')]({'where':_0x1229ae[_0xe2cb('0x4e')]})['then'](function(_0x782837){_0x11783d[_0xe2cb('0x2d')]=_0x782837;if(_0x2aaab0[_0xe2cb('0x43')][_0xe2cb('0x51')]){_0x1229ae[_0xe2cb('0x52')]=[{'all':!![]}];}return db[_0xe2cb('0x68')][_0xe2cb('0x65')](_0x1229ae);})[_0xe2cb('0x33')](function(_0x53a9d6){_0x11783d[_0xe2cb('0x53')]=_0x53a9d6;return _0x11783d;});}})[_0xe2cb('0x33')](respondWithFilteredResult(_0x499c6e,_0x1229ae))[_0xe2cb('0x27')](handleError(_0x499c6e,null));};exports['removeAnswers']=function(_0x3e0b1a,_0x182ffd,_0xffc224){return db[_0xe2cb('0x3d')][_0xe2cb('0x5d')]({'where':{'id':_0x3e0b1a[_0xe2cb('0x55')]['id']}})[_0xe2cb('0x33')](handleEntityNotFound(_0x182ffd,null))[_0xe2cb('0x33')](function(_0x53ab77){if(_0x53ab77){return _0x53ab77[_0xe2cb('0x6a')](_0x3e0b1a['query']['ids']);}})[_0xe2cb('0x33')](respondWithStatusCode(_0x182ffd,null))['catch'](handleError(_0x182ffd,null));};exports['notify']=function(_0x3361a2,_0x1746c4,_0x72eeae){var _0xaf7685={'channel':'sms'};var _0x37c2c5=[];var _0x197c21=[];var _0x596f1a={};return db[_0xe2cb('0x3d')][_0xe2cb('0x5d')]({'where':{'id':_0x3361a2[_0xe2cb('0x55')]['id']},'include':[{'model':db['SmsApplication'],'as':_0xe2cb('0x6b')}]})[_0xe2cb('0x33')](handleEntityNotFound(_0x1746c4,null))[_0xe2cb('0x33')](function(_0x65c980){_0xaf7685[_0xe2cb('0x6c')]=_0x65c980;_0xaf7685[_0xe2cb('0x6d')]=_[_0xe2cb('0x6e')](_0x65c980[_0xe2cb('0x6b')],['priority'],['asc']);if(_0xaf7685[_0xe2cb('0x6c')][_0xe2cb('0x6b')]){delete _0xaf7685[_0xe2cb('0x6c')][_0xe2cb('0x6b')];}return db[_0xe2cb('0x6f')][_0xe2cb('0x60')]();})[_0xe2cb('0x33')](function(_0x4c7561){if(!_0x4c7561){throw new db[(_0xe2cb('0x70'))]['ValidationError'](_0xe2cb('0x71'));}_0x37c2c5=_[_0xe2cb('0x72')](_[_0xe2cb('0x56')](_0x4c7561),['createdAt','updatedAt']);_0x197c21=_[_0xe2cb('0x72')](_[_0xe2cb('0x56')](_0x4c7561),[_0xe2cb('0x73'),_0xe2cb('0x74'),_0xe2cb('0x75'),_0xe2cb('0x76')]);_0xaf7685['body']={'mapKey':_0xe2cb('0x77')};if(_0xaf7685[_0xe2cb('0x6c')][_0xe2cb('0x40')]){switch(_0xaf7685[_0xe2cb('0x6c')][_0xe2cb('0x40')]){case _0xe2cb('0x78'):_0xaf7685['body'][_0xe2cb('0x79')]=_0x3361a2[_0xe2cb('0x58')][_0xe2cb('0x7a')];_0xaf7685[_0xe2cb('0x58')][_0xe2cb('0x58')]=_0x3361a2[_0xe2cb('0x58')][_0xe2cb('0x7b')];_0xaf7685[_0xe2cb('0x58')]['messageId']=_0x3361a2[_0xe2cb('0x58')][_0xe2cb('0x7c')];break;case'skebby':_0xaf7685[_0xe2cb('0x58')][_0xe2cb('0x79')]='+'+_0x3361a2[_0xe2cb('0x58')]['sender'];_0xaf7685[_0xe2cb('0x58')][_0xe2cb('0x58')]=_0x3361a2[_0xe2cb('0x58')][_0xe2cb('0x7d')];break;case _0xe2cb('0x7e'):_0xaf7685[_0xe2cb('0x58')][_0xe2cb('0x79')]=_0x3361a2['body'][_0xe2cb('0x79')];_0xaf7685['body'][_0xe2cb('0x58')]=_0x3361a2[_0xe2cb('0x58')][_0xe2cb('0x26')];break;case _0xe2cb('0x7f'):_0xaf7685[_0xe2cb('0x58')]['from']=_0x3361a2[_0xe2cb('0x58')]['from'];_0xaf7685[_0xe2cb('0x58')][_0xe2cb('0x58')]=_0x3361a2['body'][_0xe2cb('0x58')];_0xaf7685[_0xe2cb('0x58')][_0xe2cb('0x80')]=_0x3361a2[_0xe2cb('0x58')]['message_id'];break;case'plivo':_0xaf7685[_0xe2cb('0x58')][_0xe2cb('0x79')]=_0x3361a2[_0xe2cb('0x58')][_0xe2cb('0x7a')];_0xaf7685[_0xe2cb('0x58')][_0xe2cb('0x58')]=_0x3361a2[_0xe2cb('0x58')][_0xe2cb('0x81')];_0xaf7685['body']['messageId']=_0x3361a2[_0xe2cb('0x58')][_0xe2cb('0x82')];break;case _0xe2cb('0x83'):_0xaf7685[_0xe2cb('0x58')][_0xe2cb('0x79')]='+'+_0x3361a2[_0xe2cb('0x58')][_0xe2cb('0x84')][0x0][_0xe2cb('0x79')];_0xaf7685['body'][_0xe2cb('0x58')]=_0x3361a2[_0xe2cb('0x58')][_0xe2cb('0x84')][0x0][_0xe2cb('0x7d')];_0xaf7685[_0xe2cb('0x58')]['messageId']=_0x3361a2[_0xe2cb('0x58')]['results'][0x0][_0xe2cb('0x80')];break;case'csc':_0xaf7685[_0xe2cb('0x58')]['from']=_0x3361a2[_0xe2cb('0x58')][_0xe2cb('0x85')];_0xaf7685[_0xe2cb('0x58')][_0xe2cb('0x58')]=_0x3361a2[_0xe2cb('0x58')][_0xe2cb('0x86')][_0xe2cb('0x26')];break;case _0xe2cb('0x87'):_0xaf7685[_0xe2cb('0x58')][_0xe2cb('0x79')]=_0x3361a2[_0xe2cb('0x58')][_0xe2cb('0x88')];_0xaf7685['body'][_0xe2cb('0x58')]=_0x3361a2[_0xe2cb('0x58')][_0xe2cb('0x7d')];_0xaf7685['body'][_0xe2cb('0x80')]=_0x3361a2[_0xe2cb('0x58')][_0xe2cb('0x89')];break;case'bandwidth':_0xaf7685[_0xe2cb('0x58')][_0xe2cb('0x80')]=_0x3361a2[_0xe2cb('0x58')][0x0][_0xe2cb('0x26')]['id'];_0xaf7685[_0xe2cb('0x58')][_0xe2cb('0x79')]=_0x3361a2[_0xe2cb('0x58')][0x0]['message'][_0xe2cb('0x79')];_0xaf7685[_0xe2cb('0x58')][_0xe2cb('0x58')]=_0x3361a2[_0xe2cb('0x58')][0x0][_0xe2cb('0x26')][_0xe2cb('0x7d')];break;case _0xe2cb('0x8a'):_0xaf7685[_0xe2cb('0x58')][_0xe2cb('0x79')]=_0x3361a2[_0xe2cb('0x58')][_0xe2cb('0x79')];_0xaf7685[_0xe2cb('0x58')][_0xe2cb('0x58')]=_0x3361a2[_0xe2cb('0x58')]['message'];_0xaf7685[_0xe2cb('0x58')]['messageId']=_0x3361a2[_0xe2cb('0x58')][_0xe2cb('0x8b')];break;}}if(_0xaf7685['body']['id']){delete _0xaf7685[_0xe2cb('0x58')]['id'];}if(_['isNil'](_0xaf7685['body'][_0xe2cb('0x79')])){throw new db[(_0xe2cb('0x70'))][(_0xe2cb('0x8c'))]('from\x20is\x20mandatory');}if(_[_0xe2cb('0x8d')](_0xaf7685[_0xe2cb('0x58')][_0xe2cb('0x58')])||_0xaf7685['body']['body']===''){throw new db[(_0xe2cb('0x70'))]['ValidationError'](_0xe2cb('0x8e'));}if(_['isNil'](_0xaf7685[_0xe2cb('0x58')][_0xe2cb('0x8f')])){throw new db[(_0xe2cb('0x70'))]['ValidationError'](_0xe2cb('0x90')+_0x197c21);}if(!_['includes'](_0x197c21,_0xaf7685['body'][_0xe2cb('0x8f')])){throw new db[(_0xe2cb('0x70'))]['ValidationError'](_0xe2cb('0x91')+_0x197c21);}_0x596f1a[_0xaf7685[_0xe2cb('0x58')][_0xe2cb('0x8f')]]=_0xaf7685[_0xe2cb('0x58')][_0xe2cb('0x79')];return db['CmList'][_0xe2cb('0x5d')]({'where':{'id':_0xaf7685[_0xe2cb('0x6c')][_0xe2cb('0x76')]},'include':[{'model':db['CmContact'],'as':_0xe2cb('0x92'),'where':_0x596f1a,'limit':0x1,'order':[[_0xe2cb('0x74'),_0xe2cb('0x93')]]}]});})[_0xe2cb('0x33')](handleEntityNotFound(_0x1746c4,null))[_0xe2cb('0x33')](function(_0x5b25d7){if(_0x5b25d7){_0xaf7685['list']=_['omit'](_0x5b25d7,[_0xe2cb('0x92')]);if(_0x5b25d7[_0xe2cb('0x92')][_0xe2cb('0x48')]){return _0x5b25d7['Contacts'][0x0];}var _0x467a76=_[_0xe2cb('0x19')](_0xaf7685[_0xe2cb('0x58')],{'firstName':_0xaf7685['body'][_0xe2cb('0x79')],'ListId':_0x5b25d7['id']});_0x467a76[_0xaf7685[_0xe2cb('0x58')][_0xe2cb('0x8f')]]=_0xaf7685[_0xe2cb('0x58')]['from'];return db['CmContact'][_0xe2cb('0x57')](_0x467a76,{'fields':_0x37c2c5,'raw':!![]});}})[_0xe2cb('0x33')](handleEntityNotFound(_0x1746c4,null))[_0xe2cb('0x33')](function(_0x50c9e0){if(_0x50c9e0){_0xaf7685[_0xe2cb('0x94')]=_0x50c9e0;var _0x595362={'ContactId':_0x50c9e0['id'],'phone':_0xaf7685['body'][_0xe2cb('0x79')],'SmsAccountId':_0x3361a2[_0xe2cb('0x55')]['id']};var _0x3ccfc8={'ContactId':_0x50c9e0['id'],'SmsAccountId':_0x3361a2[_0xe2cb('0x55')]['id'],'closed':![]};return db[_0xe2cb('0x95')]['find']({'where':_0x3ccfc8})['then'](function(_0xc1250b){if(_0xc1250b){return[_0xc1250b,![]];}return db[_0xe2cb('0x95')][_0xe2cb('0x57')](_0x595362)[_0xe2cb('0x33')](function(_0x2faddd){return[_0x2faddd,!![]];});});}})[_0xe2cb('0x96')](function(_0x54f0c6,_0xf10ce9){_0xaf7685[_0xe2cb('0x97')]=_0x54f0c6[_0xe2cb('0x35')]({'plain':!![]});_0xaf7685['interaction'][_0xe2cb('0x98')]=![];if(_0xf10ce9){if(_0xaf7685[_0xe2cb('0x6c')][_0xe2cb('0x99')]){_0xaf7685[_0xe2cb('0x6d')][_0xe2cb('0x9a')]({'id':0x0,'priority':_0xaf7685['applications'][_0xe2cb('0x48')]+0x1,'app':_0xe2cb('0x9b'),'appdata':_0xe2cb('0x9c'),'interval':_0xe2cb('0x9d')});}_0xaf7685['interaction'][_0xe2cb('0x98')]=!![];}return db['SmsMessage']['create']({'phone':_0xaf7685[_0xe2cb('0x58')][_0xe2cb('0x79')],'messageId':_0xaf7685['body'][_0xe2cb('0x80')],'body':_0xaf7685[_0xe2cb('0x58')]['body'],'SmsAccountId':_0x3361a2[_0xe2cb('0x55')]['id'],'SmsInteractionId':_0x54f0c6['id'],'direction':'in','ContactId':_0x54f0c6['ContactId'],'AttachmentId':_0xaf7685[_0xe2cb('0x58')][_0xe2cb('0x9e')]});})['then'](function(_0x2c4b2c){_0xaf7685[_0xe2cb('0x26')]=_0x2c4b2c;if(!_0xaf7685[_0xe2cb('0x97')][_0xe2cb('0x9f')])return;return db[_0xe2cb('0xa0')]['find']({'attributes':['id',_0xe2cb('0x39')],'where':{'id':_0xaf7685[_0xe2cb('0x97')]['UserId']}});})['then'](function(_0x2730f4){if(_0x2730f4){_0xaf7685['applications'][_0xe2cb('0xa1')]({'id':0x0,'priority':0x0,'app':_0xe2cb('0xa2'),'appdata':_0x2730f4[_0xe2cb('0x39')]+','+(_0xaf7685['account']['waitForTheAssignedAgent']||0xa),'interval':_0xe2cb('0x9d')});}if(!_0xaf7685[_0xe2cb('0x97')]['queueId'])return;return db[_0xe2cb('0xa3')][_0xe2cb('0x5d')]({'attributes':['id',_0xe2cb('0x39')],'where':{'id':_0xaf7685[_0xe2cb('0x97')][_0xe2cb('0xa4')]}});})[_0xe2cb('0x33')](function(_0x41e5f9){if(_0x41e5f9){_0xaf7685[_0xe2cb('0x6d')][_0xe2cb('0xa1')]({'id':0x0,'priority':0x1,'app':_0xe2cb('0xa5'),'appdata':_0x41e5f9[_0xe2cb('0x39')]+','+(_0xaf7685[_0xe2cb('0x6c')][_0xe2cb('0xa6')]||0x12c),'interval':_0xe2cb('0x9d')});}return respondWithRpcPromise(_0xe2cb('0xa7'),_0xe2cb('0xa8'),_0xaf7685);})[_0xe2cb('0x33')](function(_0x284553){if(_0x284553){var _0x5f0fbd=0xc8;var _0x3d208c='receiveMessage';logger[_0xe2cb('0x20')](_0xe2cb('0x23'),_0x3d208c,_0x5f0fbd,_0xe2cb('0xa9'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x3d208c,_0x5f0fbd,'entity\x20found',JSON[_0xe2cb('0x24')](_0x284553));if(_0xaf7685[_0xe2cb('0x6c')]['type']===_0xe2cb('0x78')){return _0x1746c4['status'](_0x5f0fbd)[_0xe2cb('0x2f')](_0xe2cb('0xaa'),'text/xml')[_0xe2cb('0x3a')](_0xe2cb('0xab'));}else{return _0x1746c4[_0xe2cb('0x29')](_0x5f0fbd)['json'](_0x284553);}}})['catch'](handleError(_0x1746c4,null));};exports[_0xe2cb('0xac')]=function(_0x52328e,_0x473b74){var _0x549df3=_0x52328e[_0xe2cb('0x55')]['id'];var _0x15c9a6=_0x52328e[_0xe2cb('0x58')];var _0x10b3a8=0xc8;var _0x5c175b=null;return db[_0xe2cb('0xad')][_0xe2cb('0xae')]({'isolationLevel':db[_0xe2cb('0xad')][_0xe2cb('0xaf')]['ISOLATION_LEVELS'][_0xe2cb('0xb0')]},function(_0xfbe6c7){return db[_0xe2cb('0x3d')][_0xe2cb('0x64')]({'where':{'id':_0x549df3},'transaction':_0xfbe6c7})[_0xe2cb('0x33')](function(_0xb622a8){if(_0xb622a8){return db['SmsApplication'][_0xe2cb('0x34')]({'where':{'SmsAccountId':_0x549df3},'transaction':_0xfbe6c7})['then'](function(){var _0xc79907=_[_0xe2cb('0x3c')](_0x15c9a6,function(_0x1c516e){_0x1c516e[_0xe2cb('0x62')]=_0x549df3;return _0x1c516e;});return db['SmsApplication'][_0xe2cb('0xb1')](_0xc79907,{'transaction':_0xfbe6c7});});}else{_0x10b3a8=0x194;_0x5c175b=[];}});})[_0xe2cb('0x33')](function(){if(_0x10b3a8!==0x194){return db['SmsApplication'][_0xe2cb('0xb2')]({'where':{'SmsAccountId':_0x549df3},'order':_0xe2cb('0xb3')})['then'](function(_0x3dbdc7){_0x5c175b=_0x3dbdc7;});}})['catch'](function(_0xc61360){_0x10b3a8=0x1f4;logger['error'](_0xc61360[_0xe2cb('0x38')]);if(_0xc61360[_0xe2cb('0x39')]){delete _0xc61360[_0xe2cb('0x39')];}_0x5c175b=_0xc61360;})[_0xe2cb('0xb4')](function(){if(_0x5c175b===null){_0x473b74[_0xe2cb('0x37')](_0x10b3a8);}else{if(_0x10b3a8===0x1f4){_0x473b74[_0xe2cb('0x29')](_0x10b3a8)[_0xe2cb('0x3a')](_0x5c175b);}else{_0x473b74[_0xe2cb('0x29')](_0x10b3a8)[_0xe2cb('0x2a')](_0x5c175b);}}});};exports[_0xe2cb('0xb5')]=function(_0x1f9a29,_0x594cec,_0x272bd3){var _0x4cc0e5={};var _0x1dcb09={};var _0x178aa3;var _0x4c6b6e;return db[_0xe2cb('0x3d')]['findOne']({'where':{'id':_0x1f9a29['params']['id']}})[_0xe2cb('0x33')](handleEntityNotFound(_0x594cec,null))[_0xe2cb('0x33')](function(_0x253b61){if(_0x253b61){_0x178aa3=_0x253b61;_0x1dcb09[_0xe2cb('0x42')]=_['keys'](db[_0xe2cb('0xb6')][_0xe2cb('0x3e')]);_0x1dcb09[_0xe2cb('0x43')]=_[_0xe2cb('0x56')](_0x1f9a29[_0xe2cb('0x43')]);_0x1dcb09[_0xe2cb('0x44')]=_[_0xe2cb('0x45')](_0x1dcb09[_0xe2cb('0x42')],_0x1dcb09[_0xe2cb('0x43')]);_0x4cc0e5[_0xe2cb('0x46')]=_['intersection'](_0x1dcb09[_0xe2cb('0x42')],qs[_0xe2cb('0x47')](_0x1f9a29['query'][_0xe2cb('0x47')]));_0x4cc0e5['attributes']=_0x4cc0e5[_0xe2cb('0x46')][_0xe2cb('0x48')]?_0x4cc0e5[_0xe2cb('0x46')]:_0x1dcb09[_0xe2cb('0x42')];_0x4cc0e5[_0xe2cb('0x4a')]=qs[_0xe2cb('0x4b')](_0x1f9a29[_0xe2cb('0x43')][_0xe2cb('0x4b')]);_0x4cc0e5[_0xe2cb('0x4e')]=qs[_0xe2cb('0x44')](_[_0xe2cb('0x4c')](_0x1f9a29[_0xe2cb('0x43')],_0x1dcb09[_0xe2cb('0x44')]));if(_0x1f9a29[_0xe2cb('0x43')][_0xe2cb('0x4d')]){_0x4cc0e5[_0xe2cb('0x4e')]=_[_0xe2cb('0x4f')](_0x4cc0e5[_0xe2cb('0x4e')],{'$or':_[_0xe2cb('0x3c')](_0x4cc0e5[_0xe2cb('0x46')],function(_0x2796bc){var _0x47ec26={};_0x47ec26[_0x2796bc]={'$like':'%'+_0x1f9a29[_0xe2cb('0x43')]['filter']+'%'};return _0x47ec26;})});}_0x4cc0e5=_['merge']({},_0x4cc0e5,_0x1f9a29[_0xe2cb('0x50')]);return _0x178aa3[_0xe2cb('0xb5')](_0x4cc0e5);}})[_0xe2cb('0x33')](function(_0x17ea0a){if(_0x17ea0a){_0x4c6b6e=_0x17ea0a[_0xe2cb('0x48')];if(!_0x1f9a29[_0xe2cb('0x43')][_0xe2cb('0xb7')]('nolimit')){_0x4cc0e5[_0xe2cb('0x2e')]=qs[_0xe2cb('0x2e')](_0x1f9a29[_0xe2cb('0x43')][_0xe2cb('0x2e')]);_0x4cc0e5[_0xe2cb('0x2b')]=qs['offset'](_0x1f9a29[_0xe2cb('0x43')][_0xe2cb('0x2b')]);}return _0x178aa3[_0xe2cb('0xb5')](_0x4cc0e5);}})[_0xe2cb('0x33')](function(_0x52904d){if(_0x52904d){return _0x52904d?{'count':_0x4c6b6e,'rows':_0x52904d}:null;}})[_0xe2cb('0x33')](respondWithResult(_0x594cec,null))[_0xe2cb('0x27')](handleError(_0x594cec,null));};exports[_0xe2cb('0xb8')]=function(_0x19c3e0,_0x53bd22,_0x2f9ae9){var _0x473d6d={'raw':![],'where':{}};var _0x26f932={};var _0x2e5643={'count':0x0,'rows':[]};return db[_0xe2cb('0x3d')][_0xe2cb('0x64')]({'where':{'id':_0x19c3e0[_0xe2cb('0x55')]['id']}})[_0xe2cb('0x33')](handleEntityNotFound(_0x53bd22,null))[_0xe2cb('0x33')](function(_0x15b657){if(_0x15b657){_0x26f932[_0xe2cb('0x42')]=_['keys'](db[_0xe2cb('0x95')][_0xe2cb('0x3e')]);_0x26f932[_0xe2cb('0x43')]=_[_0xe2cb('0x56')](_0x19c3e0['query']);_0x26f932[_0xe2cb('0x44')]=_[_0xe2cb('0x45')](_0x26f932[_0xe2cb('0x42')],_0x26f932[_0xe2cb('0x43')]);_0x473d6d[_0xe2cb('0x46')]=_[_0xe2cb('0x45')](_0x26f932[_0xe2cb('0x42')],qs['fields'](_0x19c3e0[_0xe2cb('0x43')][_0xe2cb('0x47')]));_0x473d6d[_0xe2cb('0x46')]=_0x473d6d['attributes']['length']?_0x473d6d[_0xe2cb('0x46')]:_0x26f932[_0xe2cb('0x42')];if(!_0x19c3e0[_0xe2cb('0x43')][_0xe2cb('0xb7')](_0xe2cb('0x49'))){_0x473d6d[_0xe2cb('0x2e')]=qs['limit'](_0x19c3e0[_0xe2cb('0x43')][_0xe2cb('0x2e')]);_0x473d6d[_0xe2cb('0x2b')]=qs[_0xe2cb('0x2b')](_0x19c3e0[_0xe2cb('0x43')][_0xe2cb('0x2b')]);}_0x473d6d['order']=qs[_0xe2cb('0x4b')](_0x19c3e0[_0xe2cb('0x43')][_0xe2cb('0x4b')]);_0x473d6d[_0xe2cb('0x4e')]=qs[_0xe2cb('0x44')](_[_0xe2cb('0x4c')](_0x19c3e0[_0xe2cb('0x43')],_0x26f932['filters']));_0x473d6d[_0xe2cb('0x4e')][_0xe2cb('0x62')]=_0x15b657['id'];if(_0x19c3e0[_0xe2cb('0x43')]['filter']){_0x473d6d['where']=_['merge'](_0x473d6d[_0xe2cb('0x4e')],{'$or':_['map'](_0x473d6d[_0xe2cb('0x46')],function(_0x556fe5){var _0x5b4625={};_0x5b4625[_0x556fe5]={'$like':'%'+_0x19c3e0['query']['filter']+'%'};return _0x5b4625;})});}_0x473d6d=_['merge']({},_0x473d6d,_0x19c3e0[_0xe2cb('0x50')]);return db[_0xe2cb('0x95')]['count']({'where':_0x473d6d[_0xe2cb('0x4e')]})['then'](function(_0x334750){_0x2e5643[_0xe2cb('0x2d')]=_0x334750;if(_0x19c3e0[_0xe2cb('0x43')]['includeAll']){_0x473d6d[_0xe2cb('0x52')]=[{'model':db[_0xe2cb('0x6f')],'as':_0xe2cb('0xb9'),'required':![]},{'model':db['User'],'as':_0xe2cb('0xba'),'attributes':['name',_0xe2cb('0xbb'),_0xe2cb('0xbc')],'required':![]},{'model':db[_0xe2cb('0xbd')],'as':'Tags','attributes':['id','name',_0xe2cb('0xbe')],'where':_0x19c3e0[_0xe2cb('0x43')][_0xe2cb('0xbf')]?{'id':_0x19c3e0[_0xe2cb('0x43')]['tag']}:undefined,'required':_0x19c3e0[_0xe2cb('0x43')][_0xe2cb('0xbf')]?!![]:![]}];}return db[_0xe2cb('0x95')][_0xe2cb('0x65')](_0x473d6d);})[_0xe2cb('0x33')](function(_0x178ab8){_0x2e5643[_0xe2cb('0x53')]=_0x178ab8;return _0x2e5643;});}})[_0xe2cb('0x33')](respondWithFilteredResult(_0x53bd22,_0x473d6d))[_0xe2cb('0x27')](handleError(_0x53bd22,null));};exports['send']=function(_0x249461,_0x3636f8,_0x448674){var _0x225080,_0x39644f,_0x13a464;if(_[_0xe2cb('0x8d')](_0x249461['body'][_0xe2cb('0x58')])||_0x249461['body'][_0xe2cb('0x58')]===''){throw new db['Sequelize'][(_0xe2cb('0x8c'))](_0xe2cb('0x8e'));}if(_[_0xe2cb('0x8d')](_0x249461['body']['to'])){throw new db['Sequelize'][(_0xe2cb('0x8c'))]('to\x20is\x20mandatory');}_0x225080=_0x249461[_0xe2cb('0x58')]['to'];return db[_0xe2cb('0x3d')]['find']({'where':{'id':_0x249461[_0xe2cb('0x55')]['id']},'include':[{'model':db[_0xe2cb('0xc0')],'as':_0xe2cb('0xc1'),'include':[{'model':db['CmContact'],'as':_0xe2cb('0x92'),'where':{'mobile':_0x225080},'limit':0x1,'order':[[_0xe2cb('0x74'),_0xe2cb('0x93')]]}]}]})[_0xe2cb('0x33')](handleEntityNotFound(_0x3636f8,null))[_0xe2cb('0x33')](function(_0x4a7124){if(_0x4a7124&&_0x4a7124[_0xe2cb('0xc1')]){_0x39644f=_0x4a7124[_0xe2cb('0x35')]({'plain':!![]});if(_0x39644f[_0xe2cb('0xc1')]&&_0x39644f[_0xe2cb('0xc1')][_0xe2cb('0x92')][_0xe2cb('0x48')]){return _0x39644f[_0xe2cb('0xc1')][_0xe2cb('0x92')][0x0];}return db[_0xe2cb('0x6f')][_0xe2cb('0x57')](_[_0xe2cb('0x19')](_0x249461[_0xe2cb('0x58')],{'firstName':_0x225080,'mobile':_0x225080,'phone':_0x225080,'ListId':_0x39644f[_0xe2cb('0x76')]}));}})['then'](handleEntityNotFound(_0x3636f8,null))['then'](function(_0x46f621){if(_0x46f621){_0x13a464=_0x46f621;return db[_0xe2cb('0x95')][_0xe2cb('0x5d')]({'where':{'ContactId':_0x13a464['id'],'closed':![],'SmsAccountId':_0x39644f['id']}})[_0xe2cb('0x33')](function(_0x493b8){if(_0x493b8){return[_0x493b8,![]];}return db[_0xe2cb('0x95')]['create']({'UserId':_0x249461[_0xe2cb('0x59')]['id'],'ContactId':_0x13a464['id'],'SmsAccountId':_0x39644f['id'],'phone':_0x225080,'firstMsgDirection':'out','Messages':[_[_0xe2cb('0x4f')](_0x249461[_0xe2cb('0x58')],{'read':![],'body':_0x249461[_0xe2cb('0x58')][_0xe2cb('0x58')],'phone':_0x225080,'SmsAccountId':_0x39644f['id'],'UserId':_0x249461[_0xe2cb('0x59')]['id'],'ContactId':_0x13a464['id']})]},{'include':[{'model':db[_0xe2cb('0xc2')],'as':_0xe2cb('0xc3')}]})[_0xe2cb('0x33')](function(_0x25189c){return[_0x25189c,!![]];});});}})[_0xe2cb('0x96')](function(_0x4c0d51,_0x26d059){if(_0x26d059){return _0x4c0d51;}return db[_0xe2cb('0xc2')][_0xe2cb('0x57')](_[_0xe2cb('0x4f')](_0x249461[_0xe2cb('0x58')],{'read':![],'body':_0x249461[_0xe2cb('0x58')]['body'],'phone':_0x225080,'SmsAccountId':_0x39644f['id'],'SmsInteractionId':_0x4c0d51['id'],'UserId':_0x249461[_0xe2cb('0x59')]['id'],'ContactId':_0x13a464['id']}))[_0xe2cb('0x33')](function(_0x1d33ea){_0x4c0d51[_0xe2cb('0xc4')][_0xe2cb('0xc3')]=[];_0x4c0d51['dataValues'][_0xe2cb('0xc3')]['push'](_0x1d33ea['dataValues']);return _0x4c0d51;});})['then'](respondWithResult(_0x3636f8,null))[_0xe2cb('0x27')](handleError(_0x3636f8,null));};exports[_0xe2cb('0x29')]=function(_0x45d233,_0x26146c,_0x551c21){if(_0x45d233[_0xe2cb('0x58')]['id']){delete _0x45d233[_0xe2cb('0x58')]['id'];}var _0x20a3b5,_0x4b5412,_0x440529;return db[_0xe2cb('0x3d')][_0xe2cb('0x5d')]({'where':{'id':_0x45d233[_0xe2cb('0x55')]['id']}})[_0xe2cb('0x33')](handleEntityNotFound(_0x26146c,null))[_0xe2cb('0x33')](function(_0x27c74d){if(_0x27c74d){_0x440529=_0x27c74d;logger[_0xe2cb('0xc5')](_0xe2cb('0x23'),_0xe2cb('0x29'),_0xe2cb('0xc6'),_0x27c74d[_0xe2cb('0x40')],util[_0xe2cb('0xc7')](_0x45d233[_0xe2cb('0x58')],{'showHidden':![],'depth':null}));switch(_0x27c74d[_0xe2cb('0x40')]){case _0xe2cb('0xc8'):if(_0x45d233[_0xe2cb('0x58')]['skebby_dispatch_id']&&_0x45d233[_0xe2cb('0x58')][_0xe2cb('0x29')]){_0x4b5412=_0x45d233[_0xe2cb('0x58')]['status'];return db['SmsMessage']['find']({'where':{'messageId':_0x45d233['body']['skebby_dispatch_id']}});}break;case'connectel':if(_0x45d233[_0xe2cb('0x58')][_0xe2cb('0xc9')]&&_0x45d233[_0xe2cb('0x58')][_0xe2cb('0xca')]){_0x4b5412=_0x45d233[_0xe2cb('0x58')][_0xe2cb('0xca')];return db[_0xe2cb('0xc2')][_0xe2cb('0x5d')]({'where':{'messageId':_0x45d233[_0xe2cb('0x58')][_0xe2cb('0xc9')]}});}break;case _0xe2cb('0x7f'):if(_0x45d233[_0xe2cb('0x58')]['message_id']&&_0x45d233[_0xe2cb('0x58')][_0xe2cb('0xcb')]){_0x4b5412=_0x45d233[_0xe2cb('0x58')][_0xe2cb('0xcb')];return db[_0xe2cb('0xc2')][_0xe2cb('0x5d')]({'where':{'messageId':_0x45d233[_0xe2cb('0x58')][_0xe2cb('0xcc')]}});}break;case'infobip':var _0x3fe199=_0x45d233['body'][_0xe2cb('0x84')][0x0];if(_0x3fe199[_0xe2cb('0x80')]&&_0x3fe199[_0xe2cb('0x29')][_0xe2cb('0xcd')]==='DELIVERED'){_0x4b5412=_0x3fe199[_0xe2cb('0x29')]['groupName'];return db[_0xe2cb('0xc2')][_0xe2cb('0x5d')]({'where':{'messageId':_0x3fe199['messageId']}});}break;case _0xe2cb('0x87'):if(_0x45d233[_0xe2cb('0x58')]['messageId']&&_0x45d233[_0xe2cb('0x58')][_0xe2cb('0x29')]){_0x4b5412=_0x45d233[_0xe2cb('0x58')]['status'];return db[_0xe2cb('0xc2')]['find']({'where':{'messageId':_0x45d233[_0xe2cb('0x58')][_0xe2cb('0x80')]}});}break;case _0xe2cb('0xce'):if(_0x45d233[_0xe2cb('0x58')][0x0][_0xe2cb('0x26')]['id']){_0x4b5412=_0x45d233['body'][0x0]['type'];return db[_0xe2cb('0xc2')][_0xe2cb('0x5d')]({'where':{'messageId':_0x45d233[_0xe2cb('0x58')][0x0][_0xe2cb('0x26')]['id']}});}break;case'intelepeer':if(_0x45d233[_0xe2cb('0x58')][_0xe2cb('0xcf')]&&_0x45d233['body'][_0xe2cb('0x29')]){_0x4b5412=_0x45d233[_0xe2cb('0x58')][_0xe2cb('0x29')];return db['SmsMessage'][_0xe2cb('0x5d')]({'where':{'messageId':_0x45d233[_0xe2cb('0x58')]['redif']}});}break;}}})[_0xe2cb('0x33')](handleEntityNotFound(_0x26146c,null))[_0xe2cb('0x33')](function(_0x517816){if(_0x517816){_0x20a3b5=_0x517816;switch(_0x440529[_0xe2cb('0x40')]){case _0xe2cb('0xc8'):if(_0x4b5412==='DELIVERED'){return _0x20a3b5['update']({'read':!![]});}else{logger[_0xe2cb('0x25')](_0xe2cb('0x23'),_0xe2cb('0x29'),'skebby',util[_0xe2cb('0xc7')](_0x45d233['body'],{'showHidden':![],'depth':null}));}break;case _0xe2cb('0x7e'):if(_0x4b5412==='1'){return _0x20a3b5['update']({'read':!![]});}else{logger[_0xe2cb('0x25')](_0xe2cb('0x23'),'status',_0xe2cb('0xc8'),util['inspect'](_0x45d233[_0xe2cb('0x58')],{'showHidden':![],'depth':null}));}break;case _0xe2cb('0x7f'):if(!_0x45d233[_0xe2cb('0x58')][_0xe2cb('0xd0')]&&_0x4b5412>=0xc8&&_0x4b5412<=0xce){return _0x20a3b5[_0xe2cb('0xd1')]({'read':!![]});}else{logger[_0xe2cb('0x25')](_0xe2cb('0x23'),_0xe2cb('0x29'),_0xe2cb('0x7f'),util['inspect'](_0x45d233[_0xe2cb('0x58')],{'showHidden':![],'depth':null}));}break;case _0xe2cb('0x83'):var _0xce858a=_0x45d233[_0xe2cb('0x58')][_0xe2cb('0x84')][0x0];if(_0xce858a[_0xe2cb('0x29')]['groupName']==='DELIVERED'){return _0x20a3b5['update']({'read':!![]});}else{logger[_0xe2cb('0x25')](_0xe2cb('0x23'),_0xe2cb('0x29'),_0xe2cb('0x83'),util[_0xe2cb('0xc7')](_0x45d233['body'],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x4b5412=='DELIVERED_TO_GATEWAY'||_0x4b5412==_0xe2cb('0xd2')){return _0x20a3b5[_0xe2cb('0xd1')]({'read':!![]});}else{logger['error'](_0xe2cb('0x23'),'status',_0xe2cb('0x87'),util[_0xe2cb('0xc7')](_0x45d233[_0xe2cb('0x58')],{'showHidden':![],'depth':null}));}break;case _0xe2cb('0xce'):if(_0x4b5412=='message-delivered'){return _0x20a3b5[_0xe2cb('0xd1')]({'read':!![]});}else{logger[_0xe2cb('0x25')](_0xe2cb('0x23'),_0xe2cb('0x29'),_0xe2cb('0xce'),util[_0xe2cb('0xc7')](_0x45d233[_0xe2cb('0x58')],{'showHidden':![],'depth':null}));}break;case _0xe2cb('0x8a'):if(_0x4b5412===_0xe2cb('0xd3')||_0x4b5412===_0xe2cb('0xd4')){return _0x20a3b5[_0xe2cb('0xd1')]({'read':!![]});}else{logger[_0xe2cb('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xe2cb('0x29'),_0xe2cb('0x8a'),util[_0xe2cb('0xc7')](_0x45d233[_0xe2cb('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x20a3b5;}})['then'](respondWithResult(_0x26146c,null))[_0xe2cb('0x27')](handleError(_0x26146c,null));};exports[_0xe2cb('0xd5')]=function(_0x249f94,_0x58cb2a,_0x52b297){var _0x3dbf91,_0x1c1237,_0x1f3f7b;return db[_0xe2cb('0x3d')][_0xe2cb('0x5d')]({'where':{'id':_0x249f94[_0xe2cb('0x55')]['id']}})[_0xe2cb('0x33')](handleEntityNotFound(_0x58cb2a,null))[_0xe2cb('0x33')](function(_0x12af78){if(_0x12af78){_0x1f3f7b=_0x12af78;logger[_0xe2cb('0xc5')](_0xe2cb('0x23'),_0xe2cb('0x29'),_0xe2cb('0xc6'),_0x12af78[_0xe2cb('0x40')],util[_0xe2cb('0xc7')](_0x249f94[_0xe2cb('0x43')],{'showHidden':![],'depth':null}));switch(_0x12af78[_0xe2cb('0x40')]){case _0xe2cb('0xd6'):if(_0x249f94[_0xe2cb('0x43')][_0xe2cb('0xd7')]&&_0x249f94[_0xe2cb('0x43')][_0xe2cb('0xd8')]){_0x1c1237=_0x249f94['query']['state'];return db[_0xe2cb('0xc2')][_0xe2cb('0x5d')]({'where':{'messageId':_0x249f94[_0xe2cb('0x43')][_0xe2cb('0xd7')]}});}break;}}})[_0xe2cb('0x33')](handleEntityNotFound(_0x58cb2a,null))[_0xe2cb('0x33')](function(_0x590a7d){if(_0x590a7d){_0x3dbf91=_0x590a7d;switch(_0x1f3f7b['type']){case _0xe2cb('0xd6'):if(_0x1c1237==='2'||_0x1c1237==='6'){return _0x3dbf91['update']({'read':!![]});}else{logger[_0xe2cb('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xe2cb('0xd6'),util['inspect'](_0x249f94[_0xe2cb('0x43')],{'showHidden':![],'depth':null}));};break;}return _0x3dbf91;}})['then'](respondWithResult(_0x58cb2a,null))[_0xe2cb('0x27')](handleError(_0x58cb2a,null));};exports[_0xe2cb('0xd9')]=function(_0x11eb9d,_0x2d7d43,_0x4a343f){return db['SmsAccount']['find']({'where':{'id':_0x11eb9d[_0xe2cb('0x55')]['id']}})[_0xe2cb('0x33')](handleEntityNotFound(_0x2d7d43,null))[_0xe2cb('0x33')](function(_0x126379){if(_0x126379){return _0x126379[_0xe2cb('0xd9')](_0x11eb9d[_0xe2cb('0x58')][_0xe2cb('0x67')],_[_0xe2cb('0xda')](_0x11eb9d[_0xe2cb('0x58')],[_0xe2cb('0x67'),'id'])||{})[_0xe2cb('0x96')](function(_0x13619a){for(var _0x1bff7a=0x0;_0x1bff7a<_0x11eb9d['body'][_0xe2cb('0x67')][_0xe2cb('0x48')];_0x1bff7a+=0x1){socket[_0xe2cb('0xdb')](_0xe2cb('0xdc'),{'UserId':Number(_0x11eb9d[_0xe2cb('0x58')][_0xe2cb('0x67')][_0x1bff7a]),'SmsAccountId':Number(_0x11eb9d['params']['id'])});}return _0x13619a;});}})[_0xe2cb('0x33')](respondWithResult(_0x2d7d43,null))[_0xe2cb('0x27')](handleError(_0x2d7d43,null));};exports[_0xe2cb('0xdd')]=function(_0x165673,_0xefe54b,_0x2efc00){return db[_0xe2cb('0x3d')][_0xe2cb('0x5d')]({'where':{'id':_0x165673[_0xe2cb('0x55')]['id']}})[_0xe2cb('0x33')](handleEntityNotFound(_0xefe54b,null))['then'](function(_0x22fb08){if(_0x22fb08){return _0x22fb08[_0xe2cb('0xdd')](_0x165673[_0xe2cb('0x43')]['ids'])[_0xe2cb('0x33')](function(){if(_[_0xe2cb('0xde')](_0x165673[_0xe2cb('0x43')][_0xe2cb('0x67')])){for(var _0x1e1953=0x0;_0x1e1953<_0x165673[_0xe2cb('0x43')][_0xe2cb('0x67')]['length'];_0x1e1953+=0x1){socket[_0xe2cb('0xdb')](_0xe2cb('0xdf'),{'UserId':Number(_0x165673[_0xe2cb('0x43')][_0xe2cb('0x67')][_0x1e1953]),'SmsAccountId':Number(_0x165673[_0xe2cb('0x55')]['id'])});}}else{socket[_0xe2cb('0xdb')]('userSmsAccount:remove',{'UserId':Number(_0x165673['query'][_0xe2cb('0x67')]),'SmsAccountId':Number(_0x165673[_0xe2cb('0x55')]['id'])});}});}})[_0xe2cb('0x33')](respondWithStatusCode(_0xefe54b,null))[_0xe2cb('0x27')](handleError(_0xefe54b,null));};exports[_0xe2cb('0xe0')]=function(_0x75f4b2,_0x5a6c71,_0x4d8e9e){var _0x103729={};var _0x24ae42={};var _0x578917;var _0x358c75;return db[_0xe2cb('0x3d')][_0xe2cb('0x64')]({'where':{'id':_0x75f4b2['params']['id']}})[_0xe2cb('0x33')](handleEntityNotFound(_0x5a6c71,null))[_0xe2cb('0x33')](function(_0x294445){if(_0x294445){_0x578917=_0x294445;_0x24ae42[_0xe2cb('0x42')]=_[_0xe2cb('0x56')](db[_0xe2cb('0xa0')][_0xe2cb('0x3e')]);_0x24ae42[_0xe2cb('0x43')]=_['keys'](_0x75f4b2[_0xe2cb('0x43')]);_0x24ae42[_0xe2cb('0x44')]=_[_0xe2cb('0x45')](_0x24ae42[_0xe2cb('0x42')],_0x24ae42[_0xe2cb('0x43')]);_0x103729['attributes']=_['intersection'](_0x24ae42[_0xe2cb('0x42')],qs[_0xe2cb('0x47')](_0x75f4b2[_0xe2cb('0x43')]['fields']));_0x103729[_0xe2cb('0x46')]=_0x103729[_0xe2cb('0x46')]['length']?_0x103729['attributes']:_0x24ae42['model'];_0x103729[_0xe2cb('0x4a')]=qs['sort'](_0x75f4b2['query'][_0xe2cb('0x4b')]);_0x103729[_0xe2cb('0x4e')]=qs['filters'](_[_0xe2cb('0x4c')](_0x75f4b2['query'],_0x24ae42['filters']));if(_0x75f4b2[_0xe2cb('0x43')]['filter']){_0x103729['where']=_[_0xe2cb('0x4f')](_0x103729['where'],{'$or':_[_0xe2cb('0x3c')](_0x103729[_0xe2cb('0x46')],function(_0x2271a5){var _0x26a707={};_0x26a707[_0x2271a5]={'$like':'%'+_0x75f4b2[_0xe2cb('0x43')][_0xe2cb('0x4d')]+'%'};return _0x26a707;})});}_0x103729=_['merge']({},_0x103729,_0x75f4b2[_0xe2cb('0x50')]);return _0x578917['getAgents'](_0x103729);}})[_0xe2cb('0x33')](function(_0x8afb31){if(_0x8afb31){_0x358c75=_0x8afb31['length'];if(!_0x75f4b2['query'][_0xe2cb('0xb7')](_0xe2cb('0x49'))){_0x103729[_0xe2cb('0x2e')]=qs['limit'](_0x75f4b2[_0xe2cb('0x43')][_0xe2cb('0x2e')]);_0x103729[_0xe2cb('0x2b')]=qs[_0xe2cb('0x2b')](_0x75f4b2['query'][_0xe2cb('0x2b')]);}return _0x578917[_0xe2cb('0xe0')](_0x103729);}})[_0xe2cb('0x33')](function(_0x497cdf){if(_0x497cdf){return _0x497cdf?{'count':_0x358c75,'rows':_0x497cdf}:null;}})[_0xe2cb('0x33')](respondWithResult(_0x5a6c71,null))[_0xe2cb('0x27')](handleError(_0x5a6c71,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 97679c5..04c0d62 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 _0x5b4f=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','../../mysqldb','SmsAccount'];(function(_0x139b42,_0x3dd1d2){var _0x2d02b2=function(_0x2a20ff){while(--_0x2a20ff){_0x139b42['push'](_0x139b42['shift']());}};_0x2d02b2(++_0x3dd1d2);}(_0x5b4f,0x1a5));var _0xf5b4=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x5b4f[_0x278e3c];return _0x3e2d9b;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0xf5b4('0x0'))['db'][_0xf5b4('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xf5b4('0x2')](0x0);var events={'afterCreate':_0xf5b4('0x3'),'afterUpdate':_0xf5b4('0x4'),'afterDestroy':'remove'};function emitEvent(_0x57c1c2){return function(_0x33289d,_0x3dfd7d,_0x467ea9){SmsAccountEvents[_0xf5b4('0x5')](_0x57c1c2+':'+_0x33289d['id'],_0x33289d);SmsAccountEvents['emit'](_0x57c1c2,_0x33289d);_0x467ea9(null);};}for(var e in events){if(events[_0xf5b4('0x6')](e)){var event=events[e];SmsAccount[_0xf5b4('0x7')](e,emitEvent(event));}}module[_0xf5b4('0x8')]=SmsAccountEvents; \ No newline at end of file +var _0xfc65=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','SmsAccount','setMaxListeners','save'];(function(_0x409c75,_0x50c9aa){var _0x38a7f3=function(_0x2eca5d){while(--_0x2eca5d){_0x409c75['push'](_0x409c75['shift']());}};_0x38a7f3(++_0x50c9aa);}(_0xfc65,0x181));var _0x5fc6=function(_0x2fc018,_0x4747d7){_0x2fc018=_0x2fc018-0x0;var _0x2eaba0=_0xfc65[_0x2fc018];return _0x2eaba0;};'use strict';var EventEmitter=require(_0x5fc6('0x0'));var SmsAccount=require(_0x5fc6('0x1'))['db'][_0x5fc6('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x5fc6('0x3')](0x0);var events={'afterCreate':_0x5fc6('0x4'),'afterUpdate':_0x5fc6('0x5'),'afterDestroy':_0x5fc6('0x6')};function emitEvent(_0x1d11aa){return function(_0x400787,_0x516dea,_0x3c3abd){SmsAccountEvents['emit'](_0x1d11aa+':'+_0x400787['id'],_0x400787);SmsAccountEvents[_0x5fc6('0x7')](_0x1d11aa,_0x400787);_0x3c3abd(null);};}for(var e in events){if(events[_0x5fc6('0x8')](e)){var event=events[e];SmsAccount[_0x5fc6('0x9')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 02c0226..2163cb5 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 _0x0dd4=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','lodash','util'];(function(_0xe4577a,_0x893069){var _0x1fdff8=function(_0x415ce2){while(--_0x415ce2){_0xe4577a['push'](_0xe4577a['shift']());}};_0x1fdff8(++_0x893069);}(_0x0dd4,0x1b6));var _0x40dd=function(_0x572a06,_0x369fb6){_0x572a06=_0x572a06-0x0;var _0x36dbbf=_0x0dd4[_0x572a06];return _0x36dbbf;};'use strict';var _=require(_0x40dd('0x0'));var util=require(_0x40dd('0x1'));var logger=require(_0x40dd('0x2'))(_0x40dd('0x3'));var moment=require('moment');var BPromise=require(_0x40dd('0x4'));var rp=require(_0x40dd('0x5'));var fs=require('fs');var path=require(_0x40dd('0x6'));var rimraf=require(_0x40dd('0x7'));var config=require(_0x40dd('0x8'));var attributes=require('./smsAccount.attributes');module[_0x40dd('0x9')]=function(_0x2cac07,_0x542176){return _0x2cac07[_0x40dd('0xa')]('SmsAccount',attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4aef=['./smsAccount.attributes','exports','lodash','util','../../config/logger','api','bluebird','path','../../config/environment'];(function(_0x130f71,_0x3501c0){var _0x4aed4c=function(_0x5d51a9){while(--_0x5d51a9){_0x130f71['push'](_0x130f71['shift']());}};_0x4aed4c(++_0x3501c0);}(_0x4aef,0x197));var _0xf4ae=function(_0x271a80,_0x268bac){_0x271a80=_0x271a80-0x0;var _0xf8233e=_0x4aef[_0x271a80];return _0xf8233e;};'use strict';var _=require(_0xf4ae('0x0'));var util=require(_0xf4ae('0x1'));var logger=require(_0xf4ae('0x2'))(_0xf4ae('0x3'));var moment=require('moment');var BPromise=require(_0xf4ae('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf4ae('0x5'));var rimraf=require('rimraf');var config=require(_0xf4ae('0x6'));var attributes=require(_0xf4ae('0x7'));module[_0xf4ae('0x8')]=function(_0x1a85bb,_0x56ad02){return _0x1a85bb['define']('SmsAccount',attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index 48ee0e8..6f05172 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 _0x4b78=['SmsAccount','find','options','raw','where','include','map','model','attributes','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','localhost','socket.io-emitter','./smsAccount.socket','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSmsAccount'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x4b78,0x78));var _0x84b7=function(_0x2b3ba7,_0x155597){_0x2b3ba7=_0x2b3ba7-0x0;var _0x12f1a6=_0x4b78[_0x2b3ba7];return _0x12f1a6;};'use strict';var _=require(_0x84b7('0x0'));var util=require(_0x84b7('0x1'));var moment=require(_0x84b7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x84b7('0x3'));var db=require(_0x84b7('0x4'))['db'];var utils=require(_0x84b7('0x5'));var logger=require(_0x84b7('0x6'))('rpc');var config=require(_0x84b7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x84b7('0x8')][_0x84b7('0x9')]({'port':0x232a});config[_0x84b7('0xa')]=_['defaults'](config[_0x84b7('0xa')],{'host':_0x84b7('0xb'),'port':0x18eb});var socket=require(_0x84b7('0xc'))(new Redis(config['redis']));require(_0x84b7('0xd'))['register'](socket);function respondWithRpcPromise(_0x585192,_0x4372d6,_0xb4bac5){return new BPromise(function(_0x44d06f,_0x42f144){return client[_0x84b7('0xe')](_0x585192,_0xb4bac5)[_0x84b7('0xf')](function(_0x4f81a6){logger[_0x84b7('0x10')](_0x84b7('0x11'),_0x4372d6,_0x84b7('0x12'));logger[_0x84b7('0x13')](_0x84b7('0x14'),_0x4372d6,_0x84b7('0x12'),JSON[_0x84b7('0x15')](_0x4f81a6));if(_0x4f81a6['error']){if(_0x4f81a6[_0x84b7('0x16')][_0x84b7('0x17')]===0x1f4){logger['error']('SmsAccount,\x20%s,\x20%s',_0x4372d6,_0x4f81a6['error'][_0x84b7('0x18')]);return _0x42f144(_0x4f81a6[_0x84b7('0x16')][_0x84b7('0x18')]);}logger[_0x84b7('0x16')](_0x84b7('0x11'),_0x4372d6,_0x4f81a6['error'][_0x84b7('0x18')]);return _0x44d06f(_0x4f81a6['error'][_0x84b7('0x18')]);}else{logger[_0x84b7('0x10')]('SmsAccount,\x20%s,\x20%s',_0x4372d6,_0x84b7('0x12'));_0x44d06f(_0x4f81a6[_0x84b7('0x19')][_0x84b7('0x18')]);}})[_0x84b7('0x1a')](function(_0x4d1d83){logger['error'](_0x84b7('0x11'),_0x4372d6,_0x4d1d83);_0x42f144(_0x4d1d83);});});}exports[_0x84b7('0x1b')]=function(_0x4a85e9){var _0x5e4a02=this;return new Promise(function(_0x16e16b,_0x5887e9){return db[_0x84b7('0x1c')][_0x84b7('0x1d')]({'raw':_0x4a85e9['options']?_0x4a85e9[_0x84b7('0x1e')][_0x84b7('0x1f')]===undefined?!![]:![]:!![],'where':_0x4a85e9['options']?_0x4a85e9[_0x84b7('0x1e')][_0x84b7('0x20')]||null:null,'attributes':_0x4a85e9[_0x84b7('0x1e')]?_0x4a85e9[_0x84b7('0x1e')]['attributes']||null:null,'include':_0x4a85e9['options']?_0x4a85e9[_0x84b7('0x1e')][_0x84b7('0x21')]?_[_0x84b7('0x22')](_0x4a85e9[_0x84b7('0x1e')][_0x84b7('0x21')],function(_0x263a96){return{'model':db[_0x263a96[_0x84b7('0x23')]],'as':_0x263a96['as'],'attributes':_0x263a96['attributes'],'include':_0x263a96[_0x84b7('0x21')]?_[_0x84b7('0x22')](_0x263a96[_0x84b7('0x21')],function(_0x599fed){return{'model':db[_0x599fed[_0x84b7('0x23')]],'as':_0x599fed['as'],'attributes':_0x599fed[_0x84b7('0x24')],'include':_0x599fed[_0x84b7('0x21')]?_['map'](_0x599fed['include'],function(_0xed6aff){return{'model':db[_0xed6aff[_0x84b7('0x23')]],'as':_0xed6aff['as'],'attributes':_0xed6aff['attributes']};}):[]};}):[]};}):[]:[]})[_0x84b7('0xf')](function(_0x1183cb){logger['info'](_0x84b7('0x1b'),_0x4a85e9);logger['debug'](_0x84b7('0x1b'),_0x4a85e9,JSON['stringify'](_0x1183cb));_0x16e16b(_0x1183cb);})[_0x84b7('0x1a')](function(_0x377c30){logger[_0x84b7('0x16')](_0x84b7('0x1b'),_0x377c30[_0x84b7('0x18')],_0x4a85e9);_0x5887e9(_0x5e4a02[_0x84b7('0x16')](0x1f4,_0x377c30[_0x84b7('0x18')]));});});}; \ No newline at end of file +var _0x663d=['attributes','include','model','map','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSmsAccount','SmsAccount','options','raw'];(function(_0x18b0d3,_0x3e8830){var _0x2d4949=function(_0x57e2c6){while(--_0x57e2c6){_0x18b0d3['push'](_0x18b0d3['shift']());}};_0x2d4949(++_0x3e8830);}(_0x663d,0x185));var _0xd663=function(_0x5e4748,_0x379e05){_0x5e4748=_0x5e4748-0x0;var _0x3073b5=_0x663d[_0x5e4748];return _0x3073b5;};'use strict';var _=require(_0xd663('0x0'));var util=require(_0xd663('0x1'));var moment=require('moment');var BPromise=require(_0xd663('0x2'));var rs=require(_0xd663('0x3'));var fs=require('fs');var Redis=require(_0xd663('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd663('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xd663('0x6'));var jayson=require(_0xd663('0x7'));var client=jayson[_0xd663('0x8')]['http']({'port':0x232a});config[_0xd663('0x9')]=_[_0xd663('0xa')](config[_0xd663('0x9')],{'host':_0xd663('0xb'),'port':0x18eb});var socket=require(_0xd663('0xc'))(new Redis(config[_0xd663('0x9')]));require('./smsAccount.socket')[_0xd663('0xd')](socket);function respondWithRpcPromise(_0x3f53f7,_0x6a97c8,_0x217eb3){return new BPromise(function(_0x5e58f2,_0x65479c){return client[_0xd663('0xe')](_0x3f53f7,_0x217eb3)[_0xd663('0xf')](function(_0x578702){logger[_0xd663('0x10')](_0xd663('0x11'),_0x6a97c8,_0xd663('0x12'));logger[_0xd663('0x13')](_0xd663('0x14'),_0x6a97c8,_0xd663('0x12'),JSON[_0xd663('0x15')](_0x578702));if(_0x578702[_0xd663('0x16')]){if(_0x578702[_0xd663('0x16')][_0xd663('0x17')]===0x1f4){logger[_0xd663('0x16')]('SmsAccount,\x20%s,\x20%s',_0x6a97c8,_0x578702[_0xd663('0x16')][_0xd663('0x18')]);return _0x65479c(_0x578702['error'][_0xd663('0x18')]);}logger['error'](_0xd663('0x11'),_0x6a97c8,_0x578702[_0xd663('0x16')][_0xd663('0x18')]);return _0x5e58f2(_0x578702[_0xd663('0x16')][_0xd663('0x18')]);}else{logger[_0xd663('0x10')](_0xd663('0x11'),_0x6a97c8,_0xd663('0x12'));_0x5e58f2(_0x578702[_0xd663('0x19')][_0xd663('0x18')]);}})[_0xd663('0x1a')](function(_0x430a7f){logger[_0xd663('0x16')](_0xd663('0x11'),_0x6a97c8,_0x430a7f);_0x65479c(_0x430a7f);});});}exports[_0xd663('0x1b')]=function(_0x20025e){var _0x179b73=this;return new Promise(function(_0x438e03,_0x1d772a){return db[_0xd663('0x1c')]['find']({'raw':_0x20025e[_0xd663('0x1d')]?_0x20025e['options'][_0xd663('0x1e')]===undefined?!![]:![]:!![],'where':_0x20025e[_0xd663('0x1d')]?_0x20025e[_0xd663('0x1d')]['where']||null:null,'attributes':_0x20025e[_0xd663('0x1d')]?_0x20025e[_0xd663('0x1d')][_0xd663('0x1f')]||null:null,'include':_0x20025e[_0xd663('0x1d')]?_0x20025e[_0xd663('0x1d')][_0xd663('0x20')]?_['map'](_0x20025e[_0xd663('0x1d')][_0xd663('0x20')],function(_0x56c1e7){return{'model':db[_0x56c1e7[_0xd663('0x21')]],'as':_0x56c1e7['as'],'attributes':_0x56c1e7[_0xd663('0x1f')],'include':_0x56c1e7[_0xd663('0x20')]?_[_0xd663('0x22')](_0x56c1e7['include'],function(_0xe8848d){return{'model':db[_0xe8848d[_0xd663('0x21')]],'as':_0xe8848d['as'],'attributes':_0xe8848d['attributes'],'include':_0xe8848d[_0xd663('0x20')]?_[_0xd663('0x22')](_0xe8848d['include'],function(_0x3c8f9c){return{'model':db[_0x3c8f9c['model']],'as':_0x3c8f9c['as'],'attributes':_0x3c8f9c[_0xd663('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xd663('0xf')](function(_0x12e95a){logger[_0xd663('0x10')](_0xd663('0x1b'),_0x20025e);logger[_0xd663('0x13')](_0xd663('0x1b'),_0x20025e,JSON['stringify'](_0x12e95a));_0x438e03(_0x12e95a);})[_0xd663('0x1a')](function(_0x311ec2){logger['error']('ShowSmsAccount',_0x311ec2[_0xd663('0x18')],_0x20025e);_0x1d772a(_0x179b73[_0xd663('0x16')](0x1f4,_0x311ec2[_0xd663('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 2556da2..4575a5a 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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'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 119383d..1e7e7d5 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['update','delete','/:id','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','show','create'];(function(_0x69ad02,_0x3a6bc1){var _0x564bb4=function(_0x48e358){while(--_0x48e358){_0x69ad02['push'](_0x69ad02['shift']());}};_0x564bb4(++_0x3a6bc1);}(_0x55ca,0x126));var _0xa55c=function(_0x380a3f,_0x202483){_0x380a3f=_0x380a3f-0x0;var _0x2b4eca=_0x55ca[_0x380a3f];return _0x2b4eca;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['post']('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0xb')]);router['put']('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xc')]);router[_0xa55c('0xd')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);module[_0xa55c('0x10')]=router; \ No newline at end of file +var _0xedd9=['post','create','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x28cec4,_0xaa9dca){var _0x110db5=function(_0x52439f){while(--_0x52439f){_0x28cec4['push'](_0x28cec4['shift']());}};_0x110db5(++_0xaa9dca);}(_0xedd9,0xfc));var _0x9edd=function(_0x204441,_0x955413){_0x204441=_0x204441-0x0;var _0x382819=_0xedd9[_0x204441];return _0x382819;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0xe')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['put'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 676db87..9f4f677 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 _0x0f56=['*,*,*,*','sequelize','INTEGER','noop','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0f56,0x17d));var _0x60f5=function(_0xd96485,_0x7e90f8){_0xd96485=_0xd96485-0x0;var _0x2bb791=_0x0f56[_0xd96485];return _0x2bb791;};'use strict';var Sequelize=require(_0x60f5('0x0'));module['exports']={'priority':{'type':Sequelize[_0x60f5('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x60f5('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x60f5('0x3')]},'interval':{'type':Sequelize[_0x60f5('0x3')],'defaultValue':_0x60f5('0x4')}}; \ No newline at end of file +var _0xf987=['INTEGER','STRING','exports'];(function(_0x98ad9d,_0xe0aba){var _0x375413=function(_0x3099d3){while(--_0x3099d3){_0x98ad9d['push'](_0x98ad9d['shift']());}};_0x375413(++_0xe0aba);}(_0xf987,0x1d6));var _0x7f98=function(_0x4c69f2,_0x22a0b0){_0x4c69f2=_0x4c69f2-0x0;var _0x8d5088=_0xf987[_0x4c69f2];return _0x8d5088;};'use strict';var Sequelize=require('sequelize');module[_0x7f98('0x0')]={'priority':{'type':Sequelize[_0x7f98('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x7f98('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x7f98('0x2')]},'interval':{'type':Sequelize[_0x7f98('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index fb3fd1d..7e38fcf 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 _0x5de9=['crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','offset','undefined','set','apply','save','update','then','destroy','sendStatus','error','stack','name','map','SmsApplication','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','filter','where','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch','show','keys','create','body','find','params','eml-format','rimraf','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','squel'];(function(_0x19f3a4,_0x272d62){var _0x251b28=function(_0x6cf0a8){while(--_0x6cf0a8){_0x19f3a4['push'](_0x19f3a4['shift']());}};_0x251b28(++_0x272d62);}(_0x5de9,0x1e0));var _0x95de=function(_0x2d1371,_0x43aef7){_0x2d1371=_0x2d1371-0x0;var _0xf17680=_0x5de9[_0x2d1371];return _0xf17680;};'use strict';var emlformat=require(_0x95de('0x0'));var rimraf=require(_0x95de('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x95de('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x95de('0x3'));var Mustache=require('mustache');var util=require(_0x95de('0x4'));var path=require(_0x95de('0x5'));var sox=require(_0x95de('0x6'));var csv=require('to-csv');var ejs=require(_0x95de('0x7'));var fs=require('fs');var fs_extra=require(_0x95de('0x8'));var _=require('lodash');var squel=require(_0x95de('0x9'));var crypto=require(_0x95de('0xa'));var jsforce=require(_0x95de('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x95de('0xc'));var querystring=require(_0x95de('0xd'));var Papa=require('papaparse');var Redis=require(_0x95de('0xe'));var authService=require(_0x95de('0xf'));var qs=require(_0x95de('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x95de('0x11'))(_0x95de('0x12'));var utils=require(_0x95de('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x95de('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc08068,_0xa47a28){_0xa47a28=_0xa47a28||0xcc;return function(_0x374939){if(_0x374939){return _0xc08068['sendStatus'](_0xa47a28);}return _0xc08068[_0x95de('0x15')](_0xa47a28)[_0x95de('0x16')]();};}function respondWithResult(_0x316e76,_0x48e254){_0x48e254=_0x48e254||0xc8;return function(_0x336df0){if(_0x336df0){return _0x316e76[_0x95de('0x15')](_0x48e254)[_0x95de('0x17')](_0x336df0);}};}function respondWithFilteredResult(_0x180aeb,_0x3b15eb){return function(_0x2f44af){if(_0x2f44af){var _0x54d7fe=typeof _0x3b15eb[_0x95de('0x18')]===_0x95de('0x19')&&typeof _0x3b15eb['limit']==='undefined';var _0x30e73f=_0x2f44af['count'];var _0x335e78=_0x54d7fe?0x0:_0x3b15eb[_0x95de('0x18')];var _0xac26c8=_0x54d7fe?_0x2f44af['count']:_0x3b15eb[_0x95de('0x18')]+_0x3b15eb['limit'];var _0xe6cdda;if(_0xac26c8>=_0x30e73f){_0xac26c8=_0x30e73f;_0xe6cdda=0xc8;}else{_0xe6cdda=0xce;}_0x180aeb[_0x95de('0x15')](_0xe6cdda);return _0x180aeb[_0x95de('0x1a')]('Content-Range',_0x335e78+'-'+_0xac26c8+'/'+_0x30e73f)[_0x95de('0x17')](_0x2f44af);}return null;};}function patchUpdates(_0x1edd32){return function(_0x126a04){try{jsonpatch[_0x95de('0x1b')](_0x126a04,_0x1edd32,!![]);}catch(_0x24ac03){return BPromise['reject'](_0x24ac03);}return _0x126a04[_0x95de('0x1c')]();};}function saveUpdates(_0x378f60,_0x25a2a4){return function(_0xa5c3a7){if(_0xa5c3a7){return _0xa5c3a7[_0x95de('0x1d')](_0x378f60)[_0x95de('0x1e')](function(_0x4aa2d5){return _0x4aa2d5;});}return null;};}function removeEntity(_0x340a67,_0x30ac9e){return function(_0x13a21d){if(_0x13a21d){return _0x13a21d[_0x95de('0x1f')]()[_0x95de('0x1e')](function(){_0x340a67[_0x95de('0x15')](0xcc)[_0x95de('0x16')]();});}};}function handleEntityNotFound(_0x4beb8e,_0x1d8736){return function(_0x1d51b5){if(!_0x1d51b5){_0x4beb8e[_0x95de('0x20')](0x194);}return _0x1d51b5;};}function handleError(_0x18b9d5,_0x185c21){_0x185c21=_0x185c21||0x1f4;return function(_0x290483){logger[_0x95de('0x21')](_0x290483[_0x95de('0x22')]);if(_0x290483[_0x95de('0x23')]){delete _0x290483[_0x95de('0x23')];}_0x18b9d5[_0x95de('0x15')](_0x185c21)['send'](_0x290483);};}exports['index']=function(_0x35a15f,_0x192758){var _0x2fb81e={},_0x12b91f={},_0x122776={'count':0x0,'rows':[]};var _0x47e0f1=_[_0x95de('0x24')](db[_0x95de('0x25')][_0x95de('0x26')],function(_0x427246){return{'name':_0x427246['fieldName'],'type':_0x427246[_0x95de('0x27')][_0x95de('0x28')]};});_0x12b91f['model']=_[_0x95de('0x24')](_0x47e0f1,_0x95de('0x23'));_0x12b91f[_0x95de('0x29')]=_['keys'](_0x35a15f[_0x95de('0x29')]);_0x12b91f[_0x95de('0x2a')]=_[_0x95de('0x2b')](_0x12b91f[_0x95de('0x2c')],_0x12b91f[_0x95de('0x29')]);_0x2fb81e[_0x95de('0x2d')]=_[_0x95de('0x2b')](_0x12b91f[_0x95de('0x2c')],qs[_0x95de('0x2e')](_0x35a15f[_0x95de('0x29')]['fields']));_0x2fb81e[_0x95de('0x2d')]=_0x2fb81e['attributes'][_0x95de('0x2f')]?_0x2fb81e[_0x95de('0x2d')]:_0x12b91f[_0x95de('0x2c')];if(!_0x35a15f[_0x95de('0x29')][_0x95de('0x30')](_0x95de('0x31'))){_0x2fb81e[_0x95de('0x32')]=qs[_0x95de('0x32')](_0x35a15f[_0x95de('0x29')]['limit']);_0x2fb81e[_0x95de('0x18')]=qs['offset'](_0x35a15f[_0x95de('0x29')][_0x95de('0x18')]);}_0x2fb81e['order']=qs[_0x95de('0x33')](_0x35a15f[_0x95de('0x29')][_0x95de('0x33')]);_0x2fb81e['where']=qs[_0x95de('0x2a')](_[_0x95de('0x34')](_0x35a15f[_0x95de('0x29')],_0x12b91f['filters']),_0x47e0f1);if(_0x35a15f[_0x95de('0x29')][_0x95de('0x35')]){_0x2fb81e[_0x95de('0x36')]=_['merge'](_0x2fb81e[_0x95de('0x36')],{'$or':_[_0x95de('0x24')](_0x47e0f1,function(_0x4103d2){if(_0x4103d2[_0x95de('0x27')]!==_0x95de('0x37')){var _0x1de203={};_0x1de203[_0x4103d2['name']]={'$like':'%'+_0x35a15f['query'][_0x95de('0x35')]+'%'};return _0x1de203;}})});}_0x2fb81e=_[_0x95de('0x38')]({},_0x2fb81e,_0x35a15f[_0x95de('0x39')]);var _0x262c12={'where':_0x2fb81e['where']};return db[_0x95de('0x25')][_0x95de('0x3a')](_0x262c12)['then'](function(_0x1407d0){_0x122776[_0x95de('0x3a')]=_0x1407d0;if(_0x35a15f[_0x95de('0x29')][_0x95de('0x3b')]){_0x2fb81e[_0x95de('0x3c')]=[{'all':!![]}];}return db['SmsApplication'][_0x95de('0x3d')](_0x2fb81e);})[_0x95de('0x1e')](function(_0xa22f65){_0x122776[_0x95de('0x3e')]=_0xa22f65;return _0x122776;})[_0x95de('0x1e')](respondWithFilteredResult(_0x192758,_0x2fb81e))[_0x95de('0x3f')](handleError(_0x192758,null));};exports[_0x95de('0x40')]=function(_0x119271,_0x784a70){var _0x2bc3ad={'raw':!![],'where':{'id':_0x119271['params']['id']}},_0x5a584d={};_0x5a584d['model']=_[_0x95de('0x41')](db['SmsApplication'][_0x95de('0x26')]);_0x5a584d['query']=_[_0x95de('0x41')](_0x119271[_0x95de('0x29')]);_0x5a584d[_0x95de('0x2a')]=_[_0x95de('0x2b')](_0x5a584d[_0x95de('0x2c')],_0x5a584d[_0x95de('0x29')]);_0x2bc3ad[_0x95de('0x2d')]=_['intersection'](_0x5a584d['model'],qs[_0x95de('0x2e')](_0x119271[_0x95de('0x29')]['fields']));_0x2bc3ad['attributes']=_0x2bc3ad[_0x95de('0x2d')][_0x95de('0x2f')]?_0x2bc3ad[_0x95de('0x2d')]:_0x5a584d[_0x95de('0x2c')];if(_0x119271[_0x95de('0x29')]['includeAll']){_0x2bc3ad[_0x95de('0x3c')]=[{'all':!![]}];}_0x2bc3ad=_[_0x95de('0x38')]({},_0x2bc3ad,_0x119271[_0x95de('0x39')]);return db[_0x95de('0x25')]['find'](_0x2bc3ad)[_0x95de('0x1e')](handleEntityNotFound(_0x784a70,null))[_0x95de('0x1e')](respondWithResult(_0x784a70,null))['catch'](handleError(_0x784a70,null));};exports[_0x95de('0x42')]=function(_0x517b11,_0x36e510){return db['SmsApplication']['create'](_0x517b11[_0x95de('0x43')],{})[_0x95de('0x1e')](respondWithResult(_0x36e510,0xc9))[_0x95de('0x3f')](handleError(_0x36e510,null));};exports['update']=function(_0x344ae8,_0x5bbb63){if(_0x344ae8['body']['id']){delete _0x344ae8[_0x95de('0x43')]['id'];}return db[_0x95de('0x25')][_0x95de('0x44')]({'where':{'id':_0x344ae8[_0x95de('0x45')]['id']}})['then'](handleEntityNotFound(_0x5bbb63,null))[_0x95de('0x1e')](saveUpdates(_0x344ae8[_0x95de('0x43')],null))[_0x95de('0x1e')](respondWithResult(_0x5bbb63,null))[_0x95de('0x3f')](handleError(_0x5bbb63,null));};exports[_0x95de('0x1f')]=function(_0x9aa1fb,_0x18ea35){return db[_0x95de('0x25')][_0x95de('0x44')]({'where':{'id':_0x9aa1fb[_0x95de('0x45')]['id']}})[_0x95de('0x1e')](handleEntityNotFound(_0x18ea35,null))[_0x95de('0x1e')](removeEntity(_0x18ea35,null))[_0x95de('0x3f')](handleError(_0x18ea35,null));}; \ No newline at end of file +var _0x4ca2=['pick','filter','merge','type','VIRTUAL','then','include','findAll','catch','show','params','keys','includeAll','options','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','lodash','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','end','error','stack','name','index','map','SmsApplication','rawAttributes','fieldName','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x4ca2,0x166));var _0x24ca=function(_0x51f9bf,_0x24d5b7){_0x51f9bf=_0x51f9bf-0x0;var _0x2986e3=_0x4ca2[_0x51f9bf];return _0x2986e3;};'use strict';var emlformat=require(_0x24ca('0x0'));var rimraf=require(_0x24ca('0x1'));var zipdir=require(_0x24ca('0x2'));var jsonpatch=require(_0x24ca('0x3'));var rp=require(_0x24ca('0x4'));var moment=require('moment');var BPromise=require(_0x24ca('0x5'));var Mustache=require(_0x24ca('0x6'));var util=require(_0x24ca('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x24ca('0x8'));var ejs=require(_0x24ca('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x24ca('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x24ca('0x8'));var querystring=require('querystring');var Papa=require(_0x24ca('0xb'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x24ca('0xc'));var as=require(_0x24ca('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x24ca('0xe'))(_0x24ca('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x24ca('0x10'));var db=require(_0x24ca('0x11'))['db'];function respondWithStatusCode(_0x2d79bb,_0x58e86e){_0x58e86e=_0x58e86e||0xcc;return function(_0x40885f){if(_0x40885f){return _0x2d79bb[_0x24ca('0x12')](_0x58e86e);}return _0x2d79bb[_0x24ca('0x13')](_0x58e86e)['end']();};}function respondWithResult(_0x1bb413,_0x56daea){_0x56daea=_0x56daea||0xc8;return function(_0x255666){if(_0x255666){return _0x1bb413[_0x24ca('0x13')](_0x56daea)[_0x24ca('0x14')](_0x255666);}};}function respondWithFilteredResult(_0x863631,_0x332f56){return function(_0x11e415){if(_0x11e415){var _0x3125c1=typeof _0x332f56[_0x24ca('0x15')]==='undefined'&&typeof _0x332f56[_0x24ca('0x16')]===_0x24ca('0x17');var _0x5f01b7=_0x11e415['count'];var _0x7b29c2=_0x3125c1?0x0:_0x332f56[_0x24ca('0x15')];var _0x222f1e=_0x3125c1?_0x11e415[_0x24ca('0x18')]:_0x332f56['offset']+_0x332f56[_0x24ca('0x16')];var _0x2772ae;if(_0x222f1e>=_0x5f01b7){_0x222f1e=_0x5f01b7;_0x2772ae=0xc8;}else{_0x2772ae=0xce;}_0x863631['status'](_0x2772ae);return _0x863631[_0x24ca('0x19')](_0x24ca('0x1a'),_0x7b29c2+'-'+_0x222f1e+'/'+_0x5f01b7)['json'](_0x11e415);}return null;};}function patchUpdates(_0x52cedf){return function(_0x1217ea){try{jsonpatch[_0x24ca('0x1b')](_0x1217ea,_0x52cedf,!![]);}catch(_0x5de14f){return BPromise[_0x24ca('0x1c')](_0x5de14f);}return _0x1217ea['save']();};}function saveUpdates(_0xed8bd9,_0x180cf0){return function(_0x4a89df){if(_0x4a89df){return _0x4a89df['update'](_0xed8bd9)['then'](function(_0x224b70){return _0x224b70;});}return null;};}function removeEntity(_0x26ac81,_0x2b3818){return function(_0x446caa){if(_0x446caa){return _0x446caa['destroy']()['then'](function(){_0x26ac81[_0x24ca('0x13')](0xcc)[_0x24ca('0x1d')]();});}};}function handleEntityNotFound(_0xff13d,_0x9d8a08){return function(_0x976d7e){if(!_0x976d7e){_0xff13d['sendStatus'](0x194);}return _0x976d7e;};}function handleError(_0x4a3c62,_0x55b018){_0x55b018=_0x55b018||0x1f4;return function(_0x250de6){logger[_0x24ca('0x1e')](_0x250de6[_0x24ca('0x1f')]);if(_0x250de6['name']){delete _0x250de6[_0x24ca('0x20')];}_0x4a3c62[_0x24ca('0x13')](_0x55b018)['send'](_0x250de6);};}exports[_0x24ca('0x21')]=function(_0xdaf8d3,_0x11c7a9){var _0x3d1de8={},_0x4816e5={},_0x36c39b={'count':0x0,'rows':[]};var _0x375444=_[_0x24ca('0x22')](db[_0x24ca('0x23')][_0x24ca('0x24')],function(_0x46606e){return{'name':_0x46606e[_0x24ca('0x25')],'type':_0x46606e['type']['key']};});_0x4816e5[_0x24ca('0x26')]=_['map'](_0x375444,_0x24ca('0x20'));_0x4816e5['query']=_['keys'](_0xdaf8d3[_0x24ca('0x27')]);_0x4816e5[_0x24ca('0x28')]=_[_0x24ca('0x29')](_0x4816e5['model'],_0x4816e5[_0x24ca('0x27')]);_0x3d1de8['attributes']=_[_0x24ca('0x29')](_0x4816e5[_0x24ca('0x26')],qs[_0x24ca('0x2a')](_0xdaf8d3[_0x24ca('0x27')][_0x24ca('0x2a')]));_0x3d1de8['attributes']=_0x3d1de8[_0x24ca('0x2b')][_0x24ca('0x2c')]?_0x3d1de8[_0x24ca('0x2b')]:_0x4816e5[_0x24ca('0x26')];if(!_0xdaf8d3[_0x24ca('0x27')][_0x24ca('0x2d')](_0x24ca('0x2e'))){_0x3d1de8['limit']=qs['limit'](_0xdaf8d3[_0x24ca('0x27')]['limit']);_0x3d1de8[_0x24ca('0x15')]=qs['offset'](_0xdaf8d3[_0x24ca('0x27')]['offset']);}_0x3d1de8[_0x24ca('0x2f')]=qs['sort'](_0xdaf8d3[_0x24ca('0x27')][_0x24ca('0x30')]);_0x3d1de8[_0x24ca('0x31')]=qs['filters'](_[_0x24ca('0x32')](_0xdaf8d3[_0x24ca('0x27')],_0x4816e5[_0x24ca('0x28')]),_0x375444);if(_0xdaf8d3['query'][_0x24ca('0x33')]){_0x3d1de8[_0x24ca('0x31')]=_[_0x24ca('0x34')](_0x3d1de8[_0x24ca('0x31')],{'$or':_[_0x24ca('0x22')](_0x375444,function(_0x3d32c0){if(_0x3d32c0[_0x24ca('0x35')]!==_0x24ca('0x36')){var _0x5b32ef={};_0x5b32ef[_0x3d32c0[_0x24ca('0x20')]]={'$like':'%'+_0xdaf8d3[_0x24ca('0x27')]['filter']+'%'};return _0x5b32ef;}})});}_0x3d1de8=_[_0x24ca('0x34')]({},_0x3d1de8,_0xdaf8d3['options']);var _0xcb7fa2={'where':_0x3d1de8[_0x24ca('0x31')]};return db[_0x24ca('0x23')][_0x24ca('0x18')](_0xcb7fa2)[_0x24ca('0x37')](function(_0x2b5291){_0x36c39b['count']=_0x2b5291;if(_0xdaf8d3[_0x24ca('0x27')]['includeAll']){_0x3d1de8[_0x24ca('0x38')]=[{'all':!![]}];}return db[_0x24ca('0x23')][_0x24ca('0x39')](_0x3d1de8);})[_0x24ca('0x37')](function(_0x5a32e6){_0x36c39b['rows']=_0x5a32e6;return _0x36c39b;})['then'](respondWithFilteredResult(_0x11c7a9,_0x3d1de8))[_0x24ca('0x3a')](handleError(_0x11c7a9,null));};exports[_0x24ca('0x3b')]=function(_0x2d6d26,_0xa9623a){var _0x39434e={'raw':!![],'where':{'id':_0x2d6d26[_0x24ca('0x3c')]['id']}},_0x395a86={};_0x395a86[_0x24ca('0x26')]=_[_0x24ca('0x3d')](db[_0x24ca('0x23')]['rawAttributes']);_0x395a86[_0x24ca('0x27')]=_[_0x24ca('0x3d')](_0x2d6d26['query']);_0x395a86[_0x24ca('0x28')]=_[_0x24ca('0x29')](_0x395a86[_0x24ca('0x26')],_0x395a86['query']);_0x39434e[_0x24ca('0x2b')]=_['intersection'](_0x395a86[_0x24ca('0x26')],qs[_0x24ca('0x2a')](_0x2d6d26[_0x24ca('0x27')][_0x24ca('0x2a')]));_0x39434e[_0x24ca('0x2b')]=_0x39434e[_0x24ca('0x2b')][_0x24ca('0x2c')]?_0x39434e[_0x24ca('0x2b')]:_0x395a86[_0x24ca('0x26')];if(_0x2d6d26[_0x24ca('0x27')][_0x24ca('0x3e')]){_0x39434e[_0x24ca('0x38')]=[{'all':!![]}];}_0x39434e=_[_0x24ca('0x34')]({},_0x39434e,_0x2d6d26[_0x24ca('0x3f')]);return db[_0x24ca('0x23')][_0x24ca('0x40')](_0x39434e)['then'](handleEntityNotFound(_0xa9623a,null))[_0x24ca('0x37')](respondWithResult(_0xa9623a,null))[_0x24ca('0x3a')](handleError(_0xa9623a,null));};exports[_0x24ca('0x41')]=function(_0x5e4c83,_0x462d16){return db['SmsApplication'][_0x24ca('0x41')](_0x5e4c83[_0x24ca('0x42')],{})[_0x24ca('0x37')](respondWithResult(_0x462d16,0xc9))['catch'](handleError(_0x462d16,null));};exports[_0x24ca('0x43')]=function(_0x4cf462,_0xe97f17){if(_0x4cf462[_0x24ca('0x42')]['id']){delete _0x4cf462[_0x24ca('0x42')]['id'];}return db[_0x24ca('0x23')]['find']({'where':{'id':_0x4cf462[_0x24ca('0x3c')]['id']}})[_0x24ca('0x37')](handleEntityNotFound(_0xe97f17,null))[_0x24ca('0x37')](saveUpdates(_0x4cf462[_0x24ca('0x42')],null))[_0x24ca('0x37')](respondWithResult(_0xe97f17,null))[_0x24ca('0x3a')](handleError(_0xe97f17,null));};exports['destroy']=function(_0x26c90a,_0x1cdbb9){return db[_0x24ca('0x23')][_0x24ca('0x40')]({'where':{'id':_0x26c90a['params']['id']}})[_0x24ca('0x37')](handleEntityNotFound(_0x1cdbb9,null))['then'](removeEntity(_0x1cdbb9,null))[_0x24ca('0x3a')](handleError(_0x1cdbb9,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index c8a403e..ce8e89f 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 _0x96e4=['lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','./smsApplication.attributes','exports','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x1f2d06,_0x30a314){var _0x56bc10=function(_0x4b4a7a){while(--_0x4b4a7a){_0x1f2d06['push'](_0x1f2d06['shift']());}};_0x56bc10(++_0x30a314);}(_0x96e4,0x111));var _0x496e=function(_0xb0fe92,_0x147e42){_0xb0fe92=_0xb0fe92-0x0;var _0x41787f=_0x96e4[_0xb0fe92];return _0x41787f;};'use strict';var _=require(_0x496e('0x0'));var util=require('util');var logger=require(_0x496e('0x1'))(_0x496e('0x2'));var moment=require(_0x496e('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x496e('0x4'));var rimraf=require(_0x496e('0x5'));var config=require(_0x496e('0x6'));var attributes=require(_0x496e('0x7'));module[_0x496e('0x8')]=function(_0x3b506f,_0x32d0f9){return _0x3b506f['define'](_0x496e('0x9'),attributes,{'tableName':_0x496e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x496e('0xb'),'collate':_0x496e('0xc')});}; \ No newline at end of file +var _0x7499=['define','SmsApplication','sms_applications','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x8d38b6,_0x4b6bee){var _0x303125=function(_0x1dc4cd){while(--_0x1dc4cd){_0x8d38b6['push'](_0x8d38b6['shift']());}};_0x303125(++_0x4b6bee);}(_0x7499,0x162));var _0x9749=function(_0x24c405,_0x56d6fb){_0x24c405=_0x24c405-0x0;var _0x383aef=_0x7499[_0x24c405];return _0x383aef;};'use strict';var _=require(_0x9749('0x0'));var util=require(_0x9749('0x1'));var logger=require('../../config/logger')(_0x9749('0x2'));var moment=require(_0x9749('0x3'));var BPromise=require(_0x9749('0x4'));var rp=require(_0x9749('0x5'));var fs=require('fs');var path=require(_0x9749('0x6'));var rimraf=require(_0x9749('0x7'));var config=require(_0x9749('0x8'));var attributes=require('./smsApplication.attributes');module[_0x9749('0x9')]=function(_0x71a2b2,_0x3587cc){return _0x71a2b2[_0x9749('0xa')](_0x9749('0xb'),attributes,{'tableName':_0x9749('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x9749('0xd')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 0e49c6a..eb9740a 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 _0x9e6d=['error','code','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','SmsApplication,\x20%s,\x20%s','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x3ea64e,_0x46b01d){var _0x4cc02a=function(_0x24d28e){while(--_0x24d28e){_0x3ea64e['push'](_0x3ea64e['shift']());}};_0x4cc02a(++_0x46b01d);}(_0x9e6d,0x1d2));var _0xd9e6=function(_0x5e434e,_0x1e080c){_0x5e434e=_0x5e434e-0x0;var _0x401326=_0x9e6d[_0x5e434e];return _0x401326;};'use strict';var _=require(_0xd9e6('0x0'));var util=require('util');var moment=require(_0xd9e6('0x1'));var BPromise=require(_0xd9e6('0x2'));var rs=require(_0xd9e6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd9e6('0x4'))['db'];var utils=require(_0xd9e6('0x5'));var logger=require(_0xd9e6('0x6'))(_0xd9e6('0x7'));var config=require('../../config/environment');var jayson=require(_0xd9e6('0x8'));var client=jayson[_0xd9e6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57a688,_0x1cb696,_0x44ac22){return new BPromise(function(_0x1103ba,_0x5b296b){return client[_0xd9e6('0xa')](_0x57a688,_0x44ac22)[_0xd9e6('0xb')](function(_0x596895){logger[_0xd9e6('0xc')](_0xd9e6('0xd'),_0x1cb696,'request\x20sent');logger['debug'](_0xd9e6('0xe'),_0x1cb696,_0xd9e6('0xf'),JSON[_0xd9e6('0x10')](_0x596895));if(_0x596895[_0xd9e6('0x11')]){if(_0x596895[_0xd9e6('0x11')][_0xd9e6('0x12')]===0x1f4){logger[_0xd9e6('0x11')](_0xd9e6('0xd'),_0x1cb696,_0x596895[_0xd9e6('0x11')]['message']);return _0x5b296b(_0x596895[_0xd9e6('0x11')][_0xd9e6('0x13')]);}logger['error']('SmsApplication,\x20%s,\x20%s',_0x1cb696,_0x596895[_0xd9e6('0x11')]['message']);return _0x1103ba(_0x596895[_0xd9e6('0x11')][_0xd9e6('0x13')]);}else{logger[_0xd9e6('0xc')](_0xd9e6('0xd'),_0x1cb696,_0xd9e6('0xf'));_0x1103ba(_0x596895['result']['message']);}})[_0xd9e6('0x14')](function(_0x5dfc4b){logger[_0xd9e6('0x11')](_0xd9e6('0xd'),_0x1cb696,_0x5dfc4b);_0x5b296b(_0x5dfc4b);});});} \ No newline at end of file +var _0x4959=['../../config/logger','rpc','jayson/promise','client','http','request','then','SmsApplication,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x4959,0x9b));var _0x9495=function(_0x2f8612,_0x5ca6ed){_0x2f8612=_0x2f8612-0x0;var _0x1c3a07=_0x4959[_0x2f8612];return _0x1c3a07;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9495('0x0'));var BPromise=require(_0x9495('0x1'));var rs=require(_0x9495('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9495('0x3'))['db'];var utils=require(_0x9495('0x4'));var logger=require(_0x9495('0x5'))(_0x9495('0x6'));var config=require('../../config/environment');var jayson=require(_0x9495('0x7'));var client=jayson[_0x9495('0x8')][_0x9495('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21f4e7,_0xd77231,_0x34744d){return new BPromise(function(_0x2a4754,_0x19f08c){return client[_0x9495('0xa')](_0x21f4e7,_0x34744d)[_0x9495('0xb')](function(_0x6b1466){logger['info'](_0x9495('0xc'),_0xd77231,'request\x20sent');logger['debug']('SmsApplication,\x20%s,\x20%s,\x20%s',_0xd77231,'request\x20sent',JSON[_0x9495('0xd')](_0x6b1466));if(_0x6b1466[_0x9495('0xe')]){if(_0x6b1466[_0x9495('0xe')][_0x9495('0xf')]===0x1f4){logger[_0x9495('0xe')](_0x9495('0xc'),_0xd77231,_0x6b1466[_0x9495('0xe')][_0x9495('0x10')]);return _0x19f08c(_0x6b1466[_0x9495('0xe')][_0x9495('0x10')]);}logger[_0x9495('0xe')](_0x9495('0xc'),_0xd77231,_0x6b1466[_0x9495('0xe')][_0x9495('0x10')]);return _0x2a4754(_0x6b1466[_0x9495('0xe')][_0x9495('0x10')]);}else{logger['info'](_0x9495('0xc'),_0xd77231,_0x9495('0x11'));_0x2a4754(_0x6b1466[_0x9495('0x12')][_0x9495('0x10')]);}})[_0x9495('0x13')](function(_0x4c1d9d){logger[_0x9495('0xe')](_0x9495('0xc'),_0xd77231,_0x4c1d9d);_0x19f08c(_0x4c1d9d);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 909d30d..194f461 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 _0x955f=['fs-extra','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','download','post','create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express'];(function(_0x4c76eb,_0x1ddff6){var _0xf94aa6=function(_0x484117){while(--_0x484117){_0x4c76eb['push'](_0x4c76eb['shift']());}};_0xf94aa6(++_0x1ddff6);}(_0x955f,0x1eb));var _0xf955=function(_0xf4976d,_0x127776){_0xf4976d=_0xf4976d-0x0;var _0x128052=_0x955f[_0xf4976d];return _0x128052;};'use strict';var multer=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var path=require(_0xf955('0x2'));var timeout=require(_0xf955('0x3'));var express=require(_0xf955('0x4'));var router=express['Router']();var fs_extra=require(_0xf955('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf955('0x6'));var controller=require('./smsInteraction.controller');router[_0xf955('0x7')]('/',auth[_0xf955('0x8')](),controller[_0xf955('0x9')]);router['get'](_0xf955('0xa'),auth[_0xf955('0x8')](),controller['describe']);router[_0xf955('0x7')](_0xf955('0xb'),auth[_0xf955('0x8')](),controller[_0xf955('0xc')]);router[_0xf955('0x7')](_0xf955('0xd'),auth[_0xf955('0x8')](),controller['getMessages']);router[_0xf955('0x7')]('/:id/download',auth[_0xf955('0x8')](),controller[_0xf955('0xe')]);router[_0xf955('0xf')]('/',auth['isAuthenticated'](),controller[_0xf955('0x10')]);router['post'](_0xf955('0xd'),auth['isAuthenticated'](),controller[_0xf955('0x11')]);router[_0xf955('0xf')](_0xf955('0x12'),auth[_0xf955('0x8')](),interaction[_0xf955('0x13')](_0xf955('0x14'),_0xf955('0x15')),controller[_0xf955('0x16')]);router[_0xf955('0x17')](_0xf955('0xb'),auth['isAuthenticated'](),interaction[_0xf955('0x13')]('sms',_0xf955('0x18')),controller[_0xf955('0x19')]);router[_0xf955('0x1a')](_0xf955('0xb'),auth['isAuthenticated'](),interaction['tracked'](_0xf955('0x14'),_0xf955('0x1b')),controller[_0xf955('0x1c')]);router['delete'](_0xf955('0x12'),auth[_0xf955('0x8')](),controller[_0xf955('0x1d')]);module[_0xf955('0x1e')]=router; \ No newline at end of file +var _0x2032=['./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','create','/:id/tags','sms','smsinteraction:addtags','addTags','put','/:id','tracked','smsinteraction:update','update','smsinteraction:destroy','delete','removeTags','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x315216,_0x15d0cc){var _0x4dfb84=function(_0x7e1a19){while(--_0x7e1a19){_0x315216['push'](_0x315216['shift']());}};_0x4dfb84(++_0x15d0cc);}(_0x2032,0xd9));var _0x2203=function(_0x148021,_0xc0730b){_0x148021=_0x148021-0x0;var _0x1d5d4e=_0x2032[_0x148021];return _0x1d5d4e;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['get'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);router['get'](_0x2203('0x10'),auth['isAuthenticated'](),controller[_0x2203('0x11')]);router['post']('/',auth[_0x2203('0x9')](),controller[_0x2203('0x12')]);router['post']('/:id/messages',auth['isAuthenticated'](),controller['addMessage']);router['post'](_0x2203('0x13'),auth['isAuthenticated'](),interaction['tracked'](_0x2203('0x14'),_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0x18'),auth[_0x2203('0x9')](),interaction[_0x2203('0x19')](_0x2203('0x14'),_0x2203('0x1a')),controller[_0x2203('0x1b')]);router['delete'](_0x2203('0x18'),auth[_0x2203('0x9')](),interaction['tracked'](_0x2203('0x14'),_0x2203('0x1c')),controller['destroy']);router[_0x2203('0x1d')]('/:id/tags',auth[_0x2203('0x9')](),controller[_0x2203('0x1e')]);module[_0x2203('0x1f')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index c7a2356..32fc7c4 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 _0x5c3c=['sequelize','moment','exports','BOOLEAN','STRING','DATE','ENUM','out','INTEGER'];(function(_0x4bb8c3,_0x5b6ec4){var _0x154a96=function(_0x32b746){while(--_0x32b746){_0x4bb8c3['push'](_0x4bb8c3['shift']());}};_0x154a96(++_0x5b6ec4);}(_0x5c3c,0x132));var _0xc5c3=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x5c3c[_0x4154a6];return _0x3b2786;};'use strict';var Sequelize=require(_0xc5c3('0x0'));var moment=require(_0xc5c3('0x1'));module[_0xc5c3('0x2')]={'closed':{'type':Sequelize[_0xc5c3('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xc5c3('0x4')]},'secondDisposition':{'type':Sequelize[_0xc5c3('0x4')]},'thirdDisposition':{'type':Sequelize[_0xc5c3('0x4')]},'note':{'type':Sequelize[_0xc5c3('0x4')]},'phone':{'type':Sequelize[_0xc5c3('0x4')]},'read1stAt':{'type':Sequelize[_0xc5c3('0x5')]},'firstMsgDirection':{'type':Sequelize[_0xc5c3('0x6')]('in',_0xc5c3('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xc5c3('0x5')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0xc5c3('0x8')]}}; \ No newline at end of file +var _0x4888=['ENUM','out','moment','exports','BOOLEAN','DATE','STRING'];(function(_0xdd561f,_0x5d5e9a){var _0x5631d6=function(_0x2ae923){while(--_0x2ae923){_0xdd561f['push'](_0xdd561f['shift']());}};_0x5631d6(++_0x5d5e9a);}(_0x4888,0x198));var _0x8488=function(_0x91ec40,_0xa1ec3b){_0x91ec40=_0x91ec40-0x0;var _0x428c7a=_0x4888[_0x91ec40];return _0x428c7a;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x8488('0x0'));module[_0x8488('0x1')]={'closed':{'type':Sequelize[_0x8488('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8488('0x3')]},'disposition':{'type':Sequelize[_0x8488('0x4')]},'secondDisposition':{'type':Sequelize[_0x8488('0x4')]},'thirdDisposition':{'type':Sequelize[_0x8488('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x8488('0x4')]},'read1stAt':{'type':Sequelize[_0x8488('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x8488('0x5')]('in',_0x8488('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x8488('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x8488('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 23ee6b7..b1a0007 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 _0xe51a=['find','create','body','SmsMessage','addMessage','ids','getMessages','findOne','filters','hasOwnProperty','nolimit','sort','where','SmsInteractionId','filter','merge','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','setTags','omit','spread','Tag','emit','removeTags','download','unix','join','root','server','files','tmp','transcript-%d-%s.zip','push','User','fullname','Contact','Messages','createdAt','direction','secret','SmsAccount','Account','Owner','get','N.A.','closed','closedAt','toString','out','System','firstName','lastName','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Sms','createPdfFromHTML','log','err','unlinkSync','zip-dir','moment','bluebird','util','path','ejs','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','status','end','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','type','key','getOptions','findAll','sms','query','user','catch','params','model','keys','SmsInteraction','intersection','attributes','fields','length','includeAll','include','options'];(function(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0xe51a,0x133));var _0xae51=function(_0x11b1f2,_0x313f70){_0x11b1f2=_0x11b1f2-0x0;var _0x1f09e7=_0xe51a[_0x11b1f2];return _0x1f09e7;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xae51('0x0'));var moment=require(_0xae51('0x1'));var BPromise=require(_0xae51('0x2'));var util=require(_0xae51('0x3'));var path=require(_0xae51('0x4'));var ejs=require(_0xae51('0x5'));var fs=require('fs');var _=require(_0xae51('0x6'));var Redis=require(_0xae51('0x7'));var interaction=require('../../components/interaction/service');var qs=require(_0xae51('0x8'));var pdf=require(_0xae51('0x9'));var logger=require('../../config/logger')('api');var config=require(_0xae51('0xa'));var db=require(_0xae51('0xb'))['db'];config[_0xae51('0xc')]=_[_0xae51('0xd')](config[_0xae51('0xc')],{'host':_0xae51('0xe'),'port':0x18eb});var socket=require(_0xae51('0xf'))(new Redis(config[_0xae51('0xc')]));require(_0xae51('0x10'))[_0xae51('0x11')](socket);function respondWithStatusCode(_0x1450d5,_0x54bf65){_0x54bf65=_0x54bf65||0xcc;return function(_0x5afe9c){if(_0x5afe9c){return _0x1450d5['sendStatus'](_0x54bf65);}return _0x1450d5[_0xae51('0x12')](_0x54bf65)[_0xae51('0x13')]();};}function respondWithResult(_0x211ad6,_0x4b5847){_0x4b5847=_0x4b5847||0xc8;return function(_0xefd91b){if(_0xefd91b){return _0x211ad6[_0xae51('0x12')](_0x4b5847)[_0xae51('0x14')](_0xefd91b);}};}function respondWithFilteredResult(_0x95cdc8,_0x1c24f9){return function(_0x371906){if(_0x371906){var _0x575fe2=typeof _0x1c24f9['offset']===_0xae51('0x15')&&typeof _0x1c24f9[_0xae51('0x16')]===_0xae51('0x15');var _0x314c30=_0x371906[_0xae51('0x17')];var _0x137903=_0x575fe2?0x0:_0x1c24f9[_0xae51('0x18')];var _0x18659b=_0x575fe2?_0x371906['count']:_0x1c24f9[_0xae51('0x18')]+_0x1c24f9[_0xae51('0x16')];var _0x5e4b02;if(_0x18659b>=_0x314c30){_0x18659b=_0x314c30;_0x5e4b02=0xc8;}else{_0x5e4b02=0xce;}_0x95cdc8['status'](_0x5e4b02);return _0x95cdc8[_0xae51('0x19')](_0xae51('0x1a'),_0x137903+'-'+_0x18659b+'/'+_0x314c30)[_0xae51('0x14')](_0x371906);}return null;};}function saveUpdates(_0x143a55){return function(_0x505835){if(_0x505835){return _0x505835[_0xae51('0x1b')](_0x143a55)[_0xae51('0x1c')](function(_0x19a58d){return _0x19a58d;});}return null;};}function removeEntity(_0x59f185){return function(_0x19a5a4){if(_0x19a5a4){return _0x19a5a4[_0xae51('0x1d')]()['then'](function(){_0x59f185[_0xae51('0x12')](0xcc)[_0xae51('0x13')]();});}};}function handleEntityNotFound(_0x2847ed){return function(_0x5216d9){if(!_0x5216d9){_0x2847ed[_0xae51('0x1e')](0x194);}return _0x5216d9;};}function handleError(_0x3e8817,_0x3a5f29){_0x3a5f29=_0x3a5f29||0x1f4;return function(_0x2f211e){logger[_0xae51('0x1f')](_0x2f211e['stack']);if(_0x2f211e[_0xae51('0x20')]){delete _0x2f211e[_0xae51('0x20')];}_0x3e8817['status'](_0x3a5f29)[_0xae51('0x21')](_0x2f211e);};}exports[_0xae51('0x22')]=function(_0x13ed2e,_0x510d08){var _0x10c806={};var _0xfb07b9=_[_0xae51('0x23')](db['SmsInteraction'][_0xae51('0x24')],function(_0x246a36){return{'name':_0x246a36['fieldName'],'type':_0x246a36[_0xae51('0x25')][_0xae51('0x26')]};});_0x10c806=qs[_0xae51('0x27')](_0xfb07b9,_0x13ed2e);return interaction[_0xae51('0x28')](_0xae51('0x29'),_0x13ed2e[_0xae51('0x2a')],_0x13ed2e[_0xae51('0x2b')],_0x10c806,_0xfb07b9)[_0xae51('0x1c')](respondWithFilteredResult(_0x510d08,_0x10c806))[_0xae51('0x2c')](handleError(_0x510d08,null));};exports['show']=function(_0x378261,_0x523ecb){var _0x582863={'raw':![],'where':{'id':_0x378261[_0xae51('0x2d')]['id']}},_0x3c95fa={};_0x3c95fa[_0xae51('0x2e')]=_[_0xae51('0x2f')](db[_0xae51('0x30')][_0xae51('0x24')]);_0x3c95fa['query']=_[_0xae51('0x2f')](_0x378261['query']);_0x3c95fa['filters']=_[_0xae51('0x31')](_0x3c95fa[_0xae51('0x2e')],_0x3c95fa[_0xae51('0x2a')]);_0x582863[_0xae51('0x32')]=_[_0xae51('0x31')](_0x3c95fa[_0xae51('0x2e')],qs[_0xae51('0x33')](_0x378261['query'][_0xae51('0x33')]));_0x582863[_0xae51('0x32')]=_0x582863[_0xae51('0x32')][_0xae51('0x34')]?_0x582863['attributes']:_0x3c95fa[_0xae51('0x2e')];if(_0x378261[_0xae51('0x2a')][_0xae51('0x35')]){_0x582863[_0xae51('0x36')]=[{'all':!![]}];}_0x582863=_['merge']({},_0x582863,_0x378261[_0xae51('0x37')]);return db[_0xae51('0x30')][_0xae51('0x38')](_0x582863)[_0xae51('0x1c')](handleEntityNotFound(_0x523ecb,null))[_0xae51('0x1c')](respondWithResult(_0x523ecb,null))['catch'](handleError(_0x523ecb,null));};exports[_0xae51('0x39')]=function(_0x814986,_0x6dcf32){return db[_0xae51('0x30')]['create'](_0x814986[_0xae51('0x3a')],{})[_0xae51('0x1c')](respondWithResult(_0x6dcf32,0xc9))['catch'](handleError(_0x6dcf32,null));};exports['update']=function(_0x1b905d,_0x523851){if(_0x1b905d[_0xae51('0x3a')]['id']){delete _0x1b905d[_0xae51('0x3a')]['id'];}return db['SmsInteraction'][_0xae51('0x38')]({'where':{'id':_0x1b905d[_0xae51('0x2d')]['id']}})[_0xae51('0x1c')](handleEntityNotFound(_0x523851,null))[_0xae51('0x1c')](saveUpdates(_0x1b905d[_0xae51('0x3a')],null))['then'](respondWithResult(_0x523851,null))[_0xae51('0x2c')](handleError(_0x523851,null));};exports[_0xae51('0x1d')]=function(_0x1f14cb,_0x190e8a){return db['SmsInteraction']['find']({'where':{'id':_0x1f14cb[_0xae51('0x2d')]['id']}})[_0xae51('0x1c')](handleEntityNotFound(_0x190e8a,null))[_0xae51('0x1c')](removeEntity(_0x190e8a,null))[_0xae51('0x2c')](handleError(_0x190e8a,null));};exports['describe']=function(_0x463177,_0x200dbe){return db['SmsInteraction']['describe']()[_0xae51('0x1c')](respondWithResult(_0x200dbe,null))[_0xae51('0x2c')](handleError(_0x200dbe,null));};exports['addMessage']=function(_0x494b1,_0x4fb946){return db[_0xae51('0x3b')][_0xae51('0x38')]({'where':{'id':_0x494b1['params']['id']}})[_0xae51('0x1c')](handleEntityNotFound(_0x4fb946,null))['then'](function(_0x3b4012){if(_0x3b4012){return _0x3b4012[_0xae51('0x3c')](_0x494b1[_0xae51('0x3a')][_0xae51('0x3d')],_['omit'](_0x494b1[_0xae51('0x3a')],[_0xae51('0x3d'),'id'])||{});}})[_0xae51('0x1c')](respondWithResult(_0x4fb946,null))['catch'](handleError(_0x4fb946,null));};exports[_0xae51('0x3e')]=function(_0x2a9eed,_0x32ddc5){var _0x2d2cbd={'raw':![],'where':{}};var _0x486d60={};var _0x44f366={'count':0x0,'rows':[]};return db['SmsInteraction'][_0xae51('0x3f')]({'where':{'id':_0x2a9eed[_0xae51('0x2d')]['id']}})[_0xae51('0x1c')](handleEntityNotFound(_0x32ddc5,null))['then'](function(_0x2c6ba6){if(_0x2c6ba6){_0x486d60[_0xae51('0x2e')]=_[_0xae51('0x2f')](db[_0xae51('0x3b')][_0xae51('0x24')]);_0x486d60[_0xae51('0x2a')]=_[_0xae51('0x2f')](_0x2a9eed['query']);_0x486d60[_0xae51('0x40')]=_['intersection'](_0x486d60[_0xae51('0x2e')],_0x486d60[_0xae51('0x2a')]);_0x2d2cbd[_0xae51('0x32')]=_['intersection'](_0x486d60['model'],qs[_0xae51('0x33')](_0x2a9eed['query']['fields']));_0x2d2cbd[_0xae51('0x32')]=_0x2d2cbd[_0xae51('0x32')][_0xae51('0x34')]?_0x2d2cbd['attributes']:_0x486d60[_0xae51('0x2e')];if(!_0x2a9eed['query'][_0xae51('0x41')](_0xae51('0x42'))){_0x2d2cbd[_0xae51('0x16')]=qs['limit'](_0x2a9eed[_0xae51('0x2a')]['limit']);_0x2d2cbd[_0xae51('0x18')]=qs[_0xae51('0x18')](_0x2a9eed[_0xae51('0x2a')]['offset']);}_0x2d2cbd['order']=qs[_0xae51('0x43')](_0x2a9eed[_0xae51('0x2a')][_0xae51('0x43')]);_0x2d2cbd[_0xae51('0x44')]=qs['filters'](_['pick'](_0x2a9eed[_0xae51('0x2a')],_0x486d60[_0xae51('0x40')]));_0x2d2cbd[_0xae51('0x44')][_0xae51('0x45')]=_0x2c6ba6['id'];if(_0x2a9eed[_0xae51('0x2a')][_0xae51('0x46')]){_0x2d2cbd[_0xae51('0x44')]=_[_0xae51('0x47')](_0x2d2cbd['where'],{'$or':_['map'](_0x2d2cbd['attributes'],function(_0x8f8a33){var _0x49098a={};_0x49098a[_0x8f8a33]={'$like':'%'+_0x2a9eed[_0xae51('0x2a')][_0xae51('0x46')]+'%'};return _0x49098a;})});}if(_0x2a9eed['query'][_0xae51('0x48')]){var _0x3b1ff2=_0x2a9eed[_0xae51('0x2a')]['$gte'][_0xae51('0x49')](',');var _0x1f2a87={};_0x1f2a87[_0x3b1ff2[0x0]]={'$gte':moment(_0x3b1ff2[0x1])[_0xae51('0x4a')](_0xae51('0x4b'))};_0x2d2cbd['where']=_[_0xae51('0x47')](_0x2d2cbd[_0xae51('0x44')],_0x1f2a87);}_0x2d2cbd=_['merge']({},_0x2d2cbd,_0x2a9eed[_0xae51('0x37')]);return db[_0xae51('0x3b')][_0xae51('0x17')]({'where':_0x2d2cbd[_0xae51('0x44')]})[_0xae51('0x1c')](function(_0x5f12f8){_0x44f366['count']=_0x5f12f8;if(_0x2a9eed[_0xae51('0x2a')][_0xae51('0x35')]){_0x2d2cbd[_0xae51('0x36')]=[{'all':!![]}];}return db[_0xae51('0x3b')]['findAll'](_0x2d2cbd);})[_0xae51('0x1c')](function(_0x508a6d){_0x44f366['rows']=_0x508a6d;return _0x44f366;});}})['then'](respondWithFilteredResult(_0x32ddc5,_0x2d2cbd))[_0xae51('0x2c')](handleError(_0x32ddc5,null));};exports['addTags']=function(_0x44add8,_0x789a20){return db[_0xae51('0x30')]['find']({'where':{'id':_0x44add8['params']['id']}})[_0xae51('0x1c')](handleEntityNotFound(_0x789a20,null))['then'](function(_0x27db9d){if(_0x27db9d){return _0x27db9d[_0xae51('0x4c')](_0x44add8[_0xae51('0x3a')][_0xae51('0x3d')],_[_0xae51('0x4d')](_0x44add8[_0xae51('0x3a')],[_0xae51('0x3d'),'id'])||{})[_0xae51('0x4e')](function(){return db[_0xae51('0x4f')][_0xae51('0x28')]({'attributes':['id',_0xae51('0x20'),'color'],'where':{'id':_0x44add8[_0xae51('0x3a')][_0xae51('0x3d')]}});})[_0xae51('0x1c')](function(_0x4d3ea1){socket[_0xae51('0x50')]('smsInteractionTags:save',{'id':Number(_0x44add8[_0xae51('0x2d')]['id']),'tags':_0x4d3ea1||[]});return{'id':Number(_0x44add8[_0xae51('0x2d')]['id']),'tags':_0x4d3ea1||[]};});}})['then'](respondWithResult(_0x789a20,null))[_0xae51('0x2c')](handleError(_0x789a20,null));};exports[_0xae51('0x51')]=function(_0xc4866c,_0x70f7cc){return db[_0xae51('0x30')][_0xae51('0x38')]({'where':{'id':_0xc4866c['params']['id']}})[_0xae51('0x1c')](handleEntityNotFound(_0x70f7cc,null))[_0xae51('0x1c')](function(_0x2d9081){if(_0x2d9081){return _0x2d9081['removeTags'](_0xc4866c[_0xae51('0x2a')][_0xae51('0x3d')]);}})[_0xae51('0x1c')](respondWithStatusCode(_0x70f7cc,null))[_0xae51('0x2c')](handleError(_0x70f7cc,null));};exports[_0xae51('0x52')]=function(_0x273c8d,_0x9a76a4){var _0x26df51=moment()[_0xae51('0x53')]()['toString']();var _0x69f386=path[_0xae51('0x54')](config[_0xae51('0x55')],_0xae51('0x56'),_0xae51('0x57'),_0xae51('0x58'));var _0x372c18=path[_0xae51('0x54')](_0x69f386,_0x26df51);var _0x5aa17a=util[_0xae51('0x4a')](_0xae51('0x59'),_0x273c8d[_0xae51('0x2d')]['id'],_0x26df51);var _0x3cae16=path[_0xae51('0x54')](_0x69f386,_0x5aa17a);var _0x185ede=[];_0x185ede[_0xae51('0x5a')]({'model':db['User'],'as':_0xae51('0x5b'),'attributes':['id',_0xae51('0x5c')],'raw':!![]});_0x185ede[_0xae51('0x5a')]({'model':db['CmContact'],'as':_0xae51('0x5d'),'attributes':['id','firstName','lastName'],'raw':!![]});var _0x499dca=[{'model':db[_0xae51('0x3b')],'as':_0xae51('0x5e'),'attributes':['id',_0xae51('0x3a'),_0xae51('0x5f'),_0xae51('0x60'),_0xae51('0x61'),'read'],'include':_0x185ede}];_0x499dca[_0xae51('0x5a')]({'model':db[_0xae51('0x62')],'as':_0xae51('0x63'),'attributes':['id',_0xae51('0x20')]});_0x499dca[_0xae51('0x5a')]({'model':db[_0xae51('0x5b')],'as':_0xae51('0x64'),'attributes':['id',_0xae51('0x5c')]});return db[_0xae51('0x30')]['find']({'where':{'id':_0x273c8d[_0xae51('0x2d')]['id']},'include':_0x499dca})[_0xae51('0x1c')](handleEntityNotFound(_0x9a76a4,null))[_0xae51('0x1c')](function(_0x656026){if(_0x656026){var _0x7e47cc=_0x656026[_0xae51('0x65')]({'plain':!![]});fs['mkdirSync'](_0x372c18);var _0x20cbce={'channel':'Sms','account':_0x7e47cc[_0xae51('0x63')]['name'],'agent':_0x7e47cc[_0xae51('0x64')]?_0x7e47cc[_0xae51('0x64')]['fullname']:_0xae51('0x66'),'createdAt':moment(_0x7e47cc[_0xae51('0x5f')])[_0xae51('0x4a')](_0xae51('0x4b'))['toString'](),'closedAt':_0x7e47cc[_0xae51('0x67')]?moment(_0x7e47cc[_0xae51('0x68')])[_0xae51('0x4a')](_0xae51('0x4b'))[_0xae51('0x69')]():'','disposition':_0x7e47cc['disposition'],'messages':_(_0x7e47cc[_0xae51('0x5e')])[_0xae51('0x46')]({'secret':![]})[_0xae51('0x23')](function(_0x55288a){return{'date':moment(_0x55288a['createdAt'])['format'](_0xae51('0x4b'))['toString'](),'sender':_0x55288a[_0xae51('0x60')]===_0xae51('0x6a')?_0x55288a[_0xae51('0x5b')]?_0x55288a[_0xae51('0x5b')][_0xae51('0x5c')]:_0xae51('0x6b'):_0x55288a[_0xae51('0x5d')][_0xae51('0x6c')]+(_0x55288a[_0xae51('0x5d')][_0xae51('0x6d')]?'\x20'+_0x55288a[_0xae51('0x5d')][_0xae51('0x6d')]:''),'body':_0x55288a[_0xae51('0x3a')],'direction':_0x55288a['direction']===_0xae51('0x6a')?'A':'C','secret':_0x55288a[_0xae51('0x61')],'read':_0x55288a['read']};})[_0xae51('0x6e')]()};return ejs[_0xae51('0x6f')](path[_0xae51('0x54')](config[_0xae51('0x55')],'server',_0xae51('0x70'),_0xae51('0x71')),{'interaction':_0x20cbce})['then'](function(_0x9495fe){var _0x180f3e=path[_0xae51('0x54')](_0x372c18,_0xae51('0x72')+_0x7e47cc['id']+'-'+_0x26df51+_0xae51('0x73'));var _0x2e2362={'path':_0x180f3e,'channel':_0xae51('0x74'),'interactionId':_0x7e47cc['id']};return pdf[_0xae51('0x75')](_0x9495fe,_0x2e2362);})[_0xae51('0x1c')](function(){return new BPromise(function(_0x558d99,_0x3aaaf5){zipdir(_0x372c18,{'saveTo':_0x3cae16},function(_0x56c8f2,_0x251212){if(_0x56c8f2)return _0x3aaaf5(_0x56c8f2);return _0x558d99(_0x251212);});})[_0xae51('0x1c')](function(){return new BPromise(function(_0x1a7ace,_0x22da68){rimraf(_0x372c18,function(_0x552242){if(_0x552242)_0x22da68(_0x552242);return _0x1a7ace();});});})['then'](function(){return _0x9a76a4[_0xae51('0x52')](_0x3cae16,_0x5aa17a,function(_0x917645){if(_0x917645){console[_0xae51('0x76')](_0xae51('0x77'),_0x917645);}else{fs[_0xae51('0x78')](_0x3cae16);}});});});}else{return _0x9a76a4[_0xae51('0x1e')](0xc8);}})['catch'](handleError(_0x9a76a4,null));}; \ No newline at end of file +var _0x70e9=['split','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','spread','smsInteractionTags:save','removeTags','download','join','root','server','files','tmp','format','transcript-%d-%s.zip','push','User','fullname','Contact','firstName','lastName','Messages','createdAt','direction','secret','read','SmsAccount','Account','get','mkdirSync','Owner','N.A.','toString','closed','closedAt','out','value','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','rimraf','zip-dir','moment','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','redis','register','end','json','offset','limit','undefined','count','status','set','Content-Range','update','then','error','stack','name','send','index','map','fieldName','type','key','getOptions','findAll','sms','query','user','catch','show','model','keys','SmsInteraction','rawAttributes','intersection','attributes','length','includeAll','include','merge','options','create','body','find','params','destroy','describe','addMessage','SmsMessage','omit','ids','getMessages','filters','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','$gte'];(function(_0x47568e,_0x5ccdaf){var _0x33815b=function(_0x56b026){while(--_0x56b026){_0x47568e['push'](_0x47568e['shift']());}};_0x33815b(++_0x5ccdaf);}(_0x70e9,0xa2));var _0x970e=function(_0x76dc7e,_0x2a1697){_0x76dc7e=_0x76dc7e-0x0;var _0x2e4e9e=_0x70e9[_0x76dc7e];return _0x2e4e9e;};'use strict';var rimraf=require(_0x970e('0x0'));var zipdir=require(_0x970e('0x1'));var moment=require(_0x970e('0x2'));var BPromise=require('bluebird');var util=require(_0x970e('0x3'));var path=require(_0x970e('0x4'));var ejs=require(_0x970e('0x5'));var fs=require('fs');var _=require(_0x970e('0x6'));var Redis=require(_0x970e('0x7'));var interaction=require(_0x970e('0x8'));var qs=require(_0x970e('0x9'));var pdf=require(_0x970e('0xa'));var logger=require('../../config/logger')(_0x970e('0xb'));var config=require(_0x970e('0xc'));var db=require('../../mysqldb')['db'];config[_0x970e('0xd')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsInteraction.socket')[_0x970e('0xe')](socket);function respondWithStatusCode(_0x5dd488,_0x3c356e){_0x3c356e=_0x3c356e||0xcc;return function(_0x280694){if(_0x280694){return _0x5dd488['sendStatus'](_0x3c356e);}return _0x5dd488['status'](_0x3c356e)[_0x970e('0xf')]();};}function respondWithResult(_0xe65e7,_0x7e7dab){_0x7e7dab=_0x7e7dab||0xc8;return function(_0x41b18e){if(_0x41b18e){return _0xe65e7['status'](_0x7e7dab)[_0x970e('0x10')](_0x41b18e);}};}function respondWithFilteredResult(_0x598ca2,_0x3e72e0){return function(_0x563997){if(_0x563997){var _0x654d82=typeof _0x3e72e0[_0x970e('0x11')]==='undefined'&&typeof _0x3e72e0[_0x970e('0x12')]===_0x970e('0x13');var _0x37b090=_0x563997[_0x970e('0x14')];var _0x8a87f=_0x654d82?0x0:_0x3e72e0['offset'];var _0x2d3373=_0x654d82?_0x563997['count']:_0x3e72e0[_0x970e('0x11')]+_0x3e72e0[_0x970e('0x12')];var _0x4fd61e;if(_0x2d3373>=_0x37b090){_0x2d3373=_0x37b090;_0x4fd61e=0xc8;}else{_0x4fd61e=0xce;}_0x598ca2[_0x970e('0x15')](_0x4fd61e);return _0x598ca2[_0x970e('0x16')](_0x970e('0x17'),_0x8a87f+'-'+_0x2d3373+'/'+_0x37b090)[_0x970e('0x10')](_0x563997);}return null;};}function saveUpdates(_0x2b175e){return function(_0xfed2ae){if(_0xfed2ae){return _0xfed2ae[_0x970e('0x18')](_0x2b175e)[_0x970e('0x19')](function(_0x32f66c){return _0x32f66c;});}return null;};}function removeEntity(_0x3dbe1c){return function(_0xea132b){if(_0xea132b){return _0xea132b['destroy']()[_0x970e('0x19')](function(){_0x3dbe1c[_0x970e('0x15')](0xcc)[_0x970e('0xf')]();});}};}function handleEntityNotFound(_0x2de937){return function(_0xf35d2d){if(!_0xf35d2d){_0x2de937['sendStatus'](0x194);}return _0xf35d2d;};}function handleError(_0x580a6e,_0x32e1e6){_0x32e1e6=_0x32e1e6||0x1f4;return function(_0x4b6747){logger[_0x970e('0x1a')](_0x4b6747[_0x970e('0x1b')]);if(_0x4b6747[_0x970e('0x1c')]){delete _0x4b6747[_0x970e('0x1c')];}_0x580a6e[_0x970e('0x15')](_0x32e1e6)[_0x970e('0x1d')](_0x4b6747);};}exports[_0x970e('0x1e')]=function(_0x5cdebd,_0x447a13){var _0x38dfe6={};var _0x47db66=_[_0x970e('0x1f')](db['SmsInteraction']['rawAttributes'],function(_0x2c5180){return{'name':_0x2c5180[_0x970e('0x20')],'type':_0x2c5180[_0x970e('0x21')][_0x970e('0x22')]};});_0x38dfe6=qs[_0x970e('0x23')](_0x47db66,_0x5cdebd);return interaction[_0x970e('0x24')](_0x970e('0x25'),_0x5cdebd[_0x970e('0x26')],_0x5cdebd[_0x970e('0x27')],_0x38dfe6,_0x47db66)[_0x970e('0x19')](respondWithFilteredResult(_0x447a13,_0x38dfe6))[_0x970e('0x28')](handleError(_0x447a13,null));};exports[_0x970e('0x29')]=function(_0x23e503,_0x2a6a31){var _0x48ccbb={'raw':![],'where':{'id':_0x23e503['params']['id']}},_0x1d1ebb={};_0x1d1ebb[_0x970e('0x2a')]=_[_0x970e('0x2b')](db[_0x970e('0x2c')][_0x970e('0x2d')]);_0x1d1ebb[_0x970e('0x26')]=_[_0x970e('0x2b')](_0x23e503[_0x970e('0x26')]);_0x1d1ebb['filters']=_[_0x970e('0x2e')](_0x1d1ebb['model'],_0x1d1ebb[_0x970e('0x26')]);_0x48ccbb[_0x970e('0x2f')]=_[_0x970e('0x2e')](_0x1d1ebb[_0x970e('0x2a')],qs['fields'](_0x23e503[_0x970e('0x26')]['fields']));_0x48ccbb[_0x970e('0x2f')]=_0x48ccbb[_0x970e('0x2f')][_0x970e('0x30')]?_0x48ccbb[_0x970e('0x2f')]:_0x1d1ebb['model'];if(_0x23e503[_0x970e('0x26')][_0x970e('0x31')]){_0x48ccbb[_0x970e('0x32')]=[{'all':!![]}];}_0x48ccbb=_[_0x970e('0x33')]({},_0x48ccbb,_0x23e503[_0x970e('0x34')]);return db['SmsInteraction']['find'](_0x48ccbb)[_0x970e('0x19')](handleEntityNotFound(_0x2a6a31,null))[_0x970e('0x19')](respondWithResult(_0x2a6a31,null))[_0x970e('0x28')](handleError(_0x2a6a31,null));};exports[_0x970e('0x35')]=function(_0x41c498,_0x40e84b){return db[_0x970e('0x2c')]['create'](_0x41c498[_0x970e('0x36')],{})[_0x970e('0x19')](respondWithResult(_0x40e84b,0xc9))[_0x970e('0x28')](handleError(_0x40e84b,null));};exports[_0x970e('0x18')]=function(_0x502c2,_0x3d4a18){if(_0x502c2['body']['id']){delete _0x502c2[_0x970e('0x36')]['id'];}return db['SmsInteraction'][_0x970e('0x37')]({'where':{'id':_0x502c2[_0x970e('0x38')]['id']}})[_0x970e('0x19')](handleEntityNotFound(_0x3d4a18,null))['then'](saveUpdates(_0x502c2[_0x970e('0x36')],null))[_0x970e('0x19')](respondWithResult(_0x3d4a18,null))[_0x970e('0x28')](handleError(_0x3d4a18,null));};exports[_0x970e('0x39')]=function(_0x5934fd,_0x4b55b5){return db['SmsInteraction']['find']({'where':{'id':_0x5934fd['params']['id']}})[_0x970e('0x19')](handleEntityNotFound(_0x4b55b5,null))[_0x970e('0x19')](removeEntity(_0x4b55b5,null))['catch'](handleError(_0x4b55b5,null));};exports[_0x970e('0x3a')]=function(_0x1885ee,_0x4d7edf){return db[_0x970e('0x2c')]['describe']()['then'](respondWithResult(_0x4d7edf,null))[_0x970e('0x28')](handleError(_0x4d7edf,null));};exports[_0x970e('0x3b')]=function(_0x64d289,_0x3cc99e){return db[_0x970e('0x3c')][_0x970e('0x37')]({'where':{'id':_0x64d289[_0x970e('0x38')]['id']}})[_0x970e('0x19')](handleEntityNotFound(_0x3cc99e,null))[_0x970e('0x19')](function(_0x337e08){if(_0x337e08){return _0x337e08[_0x970e('0x3b')](_0x64d289[_0x970e('0x36')]['ids'],_[_0x970e('0x3d')](_0x64d289[_0x970e('0x36')],[_0x970e('0x3e'),'id'])||{});}})[_0x970e('0x19')](respondWithResult(_0x3cc99e,null))[_0x970e('0x28')](handleError(_0x3cc99e,null));};exports[_0x970e('0x3f')]=function(_0x49ac7c,_0x18eded){var _0x5a3de7={'raw':![],'where':{}};var _0x115202={};var _0x40e0bd={'count':0x0,'rows':[]};return db['SmsInteraction']['findOne']({'where':{'id':_0x49ac7c[_0x970e('0x38')]['id']}})[_0x970e('0x19')](handleEntityNotFound(_0x18eded,null))['then'](function(_0x3a8d82){if(_0x3a8d82){_0x115202['model']=_['keys'](db[_0x970e('0x3c')]['rawAttributes']);_0x115202[_0x970e('0x26')]=_['keys'](_0x49ac7c[_0x970e('0x26')]);_0x115202[_0x970e('0x40')]=_[_0x970e('0x2e')](_0x115202[_0x970e('0x2a')],_0x115202[_0x970e('0x26')]);_0x5a3de7[_0x970e('0x2f')]=_[_0x970e('0x2e')](_0x115202[_0x970e('0x2a')],qs['fields'](_0x49ac7c[_0x970e('0x26')][_0x970e('0x41')]));_0x5a3de7['attributes']=_0x5a3de7[_0x970e('0x2f')][_0x970e('0x30')]?_0x5a3de7[_0x970e('0x2f')]:_0x115202[_0x970e('0x2a')];if(!_0x49ac7c[_0x970e('0x26')][_0x970e('0x42')](_0x970e('0x43'))){_0x5a3de7['limit']=qs['limit'](_0x49ac7c['query'][_0x970e('0x12')]);_0x5a3de7[_0x970e('0x11')]=qs[_0x970e('0x11')](_0x49ac7c[_0x970e('0x26')][_0x970e('0x11')]);}_0x5a3de7[_0x970e('0x44')]=qs[_0x970e('0x45')](_0x49ac7c[_0x970e('0x26')][_0x970e('0x45')]);_0x5a3de7[_0x970e('0x46')]=qs['filters'](_[_0x970e('0x47')](_0x49ac7c[_0x970e('0x26')],_0x115202['filters']));_0x5a3de7[_0x970e('0x46')]['SmsInteractionId']=_0x3a8d82['id'];if(_0x49ac7c['query'][_0x970e('0x48')]){_0x5a3de7['where']=_[_0x970e('0x33')](_0x5a3de7[_0x970e('0x46')],{'$or':_['map'](_0x5a3de7['attributes'],function(_0x3da39b){var _0x46d605={};_0x46d605[_0x3da39b]={'$like':'%'+_0x49ac7c['query'][_0x970e('0x48')]+'%'};return _0x46d605;})});}if(_0x49ac7c[_0x970e('0x26')][_0x970e('0x49')]){var _0x18a73d=_0x49ac7c['query'][_0x970e('0x49')][_0x970e('0x4a')](',');var _0xe0d8e4={};_0xe0d8e4[_0x18a73d[0x0]]={'$gte':moment(_0x18a73d[0x1])['format'](_0x970e('0x4b'))};_0x5a3de7['where']=_['merge'](_0x5a3de7[_0x970e('0x46')],_0xe0d8e4);}_0x5a3de7=_['merge']({},_0x5a3de7,_0x49ac7c[_0x970e('0x34')]);return db['SmsMessage'][_0x970e('0x14')]({'where':_0x5a3de7['where']})[_0x970e('0x19')](function(_0xc801ed){_0x40e0bd[_0x970e('0x14')]=_0xc801ed;if(_0x49ac7c['query'][_0x970e('0x31')]){_0x5a3de7[_0x970e('0x32')]=[{'all':!![]}];}return db[_0x970e('0x3c')][_0x970e('0x24')](_0x5a3de7);})[_0x970e('0x19')](function(_0x44655d){_0x40e0bd[_0x970e('0x4c')]=_0x44655d;return _0x40e0bd;});}})[_0x970e('0x19')](respondWithFilteredResult(_0x18eded,_0x5a3de7))[_0x970e('0x28')](handleError(_0x18eded,null));};exports[_0x970e('0x4d')]=function(_0xec62fa,_0x437304){return db[_0x970e('0x2c')]['find']({'where':{'id':_0xec62fa[_0x970e('0x38')]['id']}})['then'](handleEntityNotFound(_0x437304,null))['then'](function(_0x45a3a5){if(_0x45a3a5){return _0x45a3a5['setTags'](_0xec62fa[_0x970e('0x36')][_0x970e('0x3e')],_[_0x970e('0x3d')](_0xec62fa[_0x970e('0x36')],['ids','id'])||{})[_0x970e('0x4e')](function(){return db['Tag'][_0x970e('0x24')]({'attributes':['id','name','color'],'where':{'id':_0xec62fa['body'][_0x970e('0x3e')]}});})['then'](function(_0x48549b){socket['emit'](_0x970e('0x4f'),{'id':Number(_0xec62fa[_0x970e('0x38')]['id']),'tags':_0x48549b||[]});return{'id':Number(_0xec62fa[_0x970e('0x38')]['id']),'tags':_0x48549b||[]};});}})[_0x970e('0x19')](respondWithResult(_0x437304,null))[_0x970e('0x28')](handleError(_0x437304,null));};exports[_0x970e('0x50')]=function(_0x267aa5,_0x1d770c){return db['SmsInteraction'][_0x970e('0x37')]({'where':{'id':_0x267aa5[_0x970e('0x38')]['id']}})[_0x970e('0x19')](handleEntityNotFound(_0x1d770c,null))[_0x970e('0x19')](function(_0x2061fa){if(_0x2061fa){return _0x2061fa[_0x970e('0x50')](_0x267aa5['query']['ids']);}})[_0x970e('0x19')](respondWithStatusCode(_0x1d770c,null))[_0x970e('0x28')](handleError(_0x1d770c,null));};exports[_0x970e('0x51')]=function(_0x2e9495,_0x2d49a1){var _0x40a9ed=moment()['unix']()['toString']();var _0x4b0e78=path[_0x970e('0x52')](config[_0x970e('0x53')],_0x970e('0x54'),_0x970e('0x55'),_0x970e('0x56'));var _0x37e17d=path[_0x970e('0x52')](_0x4b0e78,_0x40a9ed);var _0x5b3ca3=util[_0x970e('0x57')](_0x970e('0x58'),_0x2e9495[_0x970e('0x38')]['id'],_0x40a9ed);var _0x4b45bc=path[_0x970e('0x52')](_0x4b0e78,_0x5b3ca3);var _0x9a3eed=[];_0x9a3eed[_0x970e('0x59')]({'model':db[_0x970e('0x5a')],'as':'User','attributes':['id',_0x970e('0x5b')],'raw':!![]});_0x9a3eed[_0x970e('0x59')]({'model':db['CmContact'],'as':_0x970e('0x5c'),'attributes':['id',_0x970e('0x5d'),_0x970e('0x5e')],'raw':!![]});var _0x253cd6=[{'model':db[_0x970e('0x3c')],'as':_0x970e('0x5f'),'attributes':['id',_0x970e('0x36'),_0x970e('0x60'),_0x970e('0x61'),_0x970e('0x62'),_0x970e('0x63')],'include':_0x9a3eed}];_0x253cd6[_0x970e('0x59')]({'model':db[_0x970e('0x64')],'as':_0x970e('0x65'),'attributes':['id','name']});_0x253cd6[_0x970e('0x59')]({'model':db['User'],'as':'Owner','attributes':['id',_0x970e('0x5b')]});return db[_0x970e('0x2c')][_0x970e('0x37')]({'where':{'id':_0x2e9495[_0x970e('0x38')]['id']},'include':_0x253cd6})[_0x970e('0x19')](handleEntityNotFound(_0x2d49a1,null))[_0x970e('0x19')](function(_0x490fba){if(_0x490fba){var _0x3a5f11=_0x490fba[_0x970e('0x66')]({'plain':!![]});fs[_0x970e('0x67')](_0x37e17d);var _0x3d1283={'channel':'Sms','account':_0x3a5f11[_0x970e('0x65')]['name'],'agent':_0x3a5f11[_0x970e('0x68')]?_0x3a5f11[_0x970e('0x68')][_0x970e('0x5b')]:_0x970e('0x69'),'createdAt':moment(_0x3a5f11[_0x970e('0x60')])[_0x970e('0x57')]('YYYY-MM-DD\x20HH:mm:ss')[_0x970e('0x6a')](),'closedAt':_0x3a5f11[_0x970e('0x6b')]?moment(_0x3a5f11[_0x970e('0x6c')])[_0x970e('0x57')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x3a5f11['disposition'],'messages':_(_0x3a5f11[_0x970e('0x5f')])['filter']({'secret':![]})[_0x970e('0x1f')](function(_0x567e20){return{'date':moment(_0x567e20[_0x970e('0x60')])[_0x970e('0x57')](_0x970e('0x4b'))[_0x970e('0x6a')](),'sender':_0x567e20[_0x970e('0x61')]===_0x970e('0x6d')?_0x567e20['User']?_0x567e20['User']['fullname']:'System':_0x567e20[_0x970e('0x5c')][_0x970e('0x5d')]+(_0x567e20[_0x970e('0x5c')][_0x970e('0x5e')]?'\x20'+_0x567e20['Contact']['lastName']:''),'body':_0x567e20[_0x970e('0x36')],'direction':_0x567e20[_0x970e('0x61')]===_0x970e('0x6d')?'A':'C','secret':_0x567e20[_0x970e('0x62')],'read':_0x567e20[_0x970e('0x63')]};})[_0x970e('0x6e')]()};return ejs['renderFile'](path['join'](config[_0x970e('0x53')],_0x970e('0x54'),_0x970e('0x6f'),_0x970e('0x70')),{'interaction':_0x3d1283})[_0x970e('0x19')](function(_0x1c33d4){var _0x4e937a=path[_0x970e('0x52')](_0x37e17d,_0x970e('0x71')+_0x3a5f11['id']+'-'+_0x40a9ed+_0x970e('0x72'));var _0x371d1f={'path':_0x4e937a,'channel':'Sms','interactionId':_0x3a5f11['id']};return pdf[_0x970e('0x73')](_0x1c33d4,_0x371d1f);})[_0x970e('0x19')](function(){return new BPromise(function(_0x51db71,_0x1bdb7d){zipdir(_0x37e17d,{'saveTo':_0x4b45bc},function(_0xa9d8b1,_0x3bd661){if(_0xa9d8b1)return _0x1bdb7d(_0xa9d8b1);return _0x51db71(_0x3bd661);});})[_0x970e('0x19')](function(){return new BPromise(function(_0x156347,_0x160fe1){rimraf(_0x37e17d,function(_0x21593f){if(_0x21593f)_0x160fe1(_0x21593f);return _0x156347();});});})[_0x970e('0x19')](function(){return _0x2d49a1[_0x970e('0x51')](_0x4b45bc,_0x5b3ca3,function(_0x3afd5b){if(_0x3afd5b){console[_0x970e('0x74')](_0x970e('0x75'),_0x3afd5b);}else{fs['unlinkSync'](_0x4b45bc);}});});});}else{return _0x2d49a1['sendStatus'](0xc8);}})[_0x970e('0x28')](handleError(_0x2d49a1,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 3b3e8c4..d178144 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 _0xb574=['setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','events','../../mysqldb','SmsMessage','save','update','remove','getUsers','map','findAll','then'];(function(_0x33154d,_0x854047){var _0x3b2f03=function(_0x35f7a6){while(--_0x35f7a6){_0x33154d['push'](_0x33154d['shift']());}};_0x3b2f03(++_0x854047);}(_0xb574,0x106));var _0x4b57=function(_0x39522e,_0x3c3987){_0x39522e=_0x39522e-0x0;var _0x552e40=_0xb574[_0x39522e];return _0x552e40;};'use strict';var EventEmitter=require(_0x4b57('0x0'));var SmsInteraction=require(_0x4b57('0x1'))['db']['SmsInteraction'];var SmsMessage=require(_0x4b57('0x1'))['db'][_0x4b57('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4b57('0x3'),'afterUpdate':_0x4b57('0x4'),'afterDestroy':_0x4b57('0x5')};function emitEvent(_0x919851){return function(_0xe2ae86,_0x4a3efa,_0x4eb019){_0xe2ae86[_0x4b57('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x585d86){_0xe2ae86['setDataValue']('Users',_0x585d86[_0x4b57('0x7')](function(_0x2bf397){return{'id':_0x2bf397['id']};}));return SmsMessage[_0x4b57('0x8')]({'where':{'SmsInteractionId':_0xe2ae86['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4b57('0x9')](function(_0xce47ad){_0xe2ae86[_0x4b57('0xa')](_0x4b57('0xb'),_0xce47ad[_0x4b57('0xc')]);SmsInteractionEvents['emit'](_0x919851+':'+_0xe2ae86['id'],_0xe2ae86);SmsInteractionEvents[_0x4b57('0xd')](_0x919851,_0xe2ae86);_0x4eb019(null);})[_0x4b57('0xe')](_0x4eb019(null));};}for(var e in events){if(events[_0x4b57('0xf')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file +var _0x6cb4=['../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','then','setDataValue','Users','map','unreadMessages','length','emit','catch','events'];(function(_0x116930,_0x10327c){var _0x5bb1fa=function(_0x4077a9){while(--_0x4077a9){_0x116930['push'](_0x116930['shift']());}};_0x5bb1fa(++_0x10327c);}(_0x6cb4,0xff));var _0x46cb=function(_0x2c3996,_0x286abe){_0x2c3996=_0x2c3996-0x0;var _0x5cdd2f=_0x6cb4[_0x2c3996];return _0x5cdd2f;};'use strict';var EventEmitter=require(_0x46cb('0x0'));var SmsInteraction=require(_0x46cb('0x1'))['db'][_0x46cb('0x2')];var SmsMessage=require(_0x46cb('0x1'))['db'][_0x46cb('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x46cb('0x4')](0x0);var events={'afterCreate':_0x46cb('0x5'),'afterUpdate':_0x46cb('0x6'),'afterDestroy':_0x46cb('0x7')};function emitEvent(_0x5032a4){return function(_0x1a3fe4,_0x5cb9a4,_0x3d9d3c){_0x1a3fe4['getUsers']({'attributes':['id'],'raw':!![]})[_0x46cb('0x8')](function(_0x148d0f){_0x1a3fe4[_0x46cb('0x9')](_0x46cb('0xa'),_0x148d0f[_0x46cb('0xb')](function(_0x196a93){return{'id':_0x196a93['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x1a3fe4['id'],'direction':'in','read':![]},'raw':!![]});})[_0x46cb('0x8')](function(_0x34f9e9){_0x1a3fe4['setDataValue'](_0x46cb('0xc'),_0x34f9e9[_0x46cb('0xd')]);SmsInteractionEvents['emit'](_0x5032a4+':'+_0x1a3fe4['id'],_0x1a3fe4);SmsInteractionEvents[_0x46cb('0xe')](_0x5032a4,_0x1a3fe4);_0x3d9d3c(null);})[_0x46cb('0xf')](_0x3d9d3c(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 643c324..ed61932 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 _0x37f2=['sms_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','moment','bluebird','path','rimraf','./smsInteraction.attributes','exports'];(function(_0x4c3070,_0xc2fb4c){var _0x536a44=function(_0x1412a5){while(--_0x1412a5){_0x4c3070['push'](_0x4c3070['shift']());}};_0x536a44(++_0xc2fb4c);}(_0x37f2,0x1f0));var _0x237f=function(_0x1ac862,_0xb70bc){_0x1ac862=_0x1ac862-0x0;var _0x1aab58=_0x37f2[_0x1ac862];return _0x1aab58;};'use strict';var _=require(_0x237f('0x0'));var util=require('util');var logger=require(_0x237f('0x1'))('api');var moment=require(_0x237f('0x2'));var BPromise=require(_0x237f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x237f('0x4'));var rimraf=require(_0x237f('0x5'));var config=require('../../config/environment');var attributes=require(_0x237f('0x6'));module[_0x237f('0x7')]=function(_0x28910e,_0x45a5ee){return _0x28910e['define']('SmsInteraction',attributes,{'tableName':_0x237f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1d723e,_0x6fe7c,_0x3294b6){if(_0x1d723e[_0x237f('0x9')](_0x237f('0xa'))){_0x1d723e[_0x237f('0xb')]=moment()[_0x237f('0xc')](_0x237f('0xd'));}_0x3294b6(null,_0x1d723e);}}});}; \ No newline at end of file +var _0xa7df=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','SmsInteraction','sms_interactions','changed','closed','closedAt','format','util','../../config/logger'];(function(_0xde9c4f,_0x2697df){var _0x252ce2=function(_0x4b0d4c){while(--_0x4b0d4c){_0xde9c4f['push'](_0xde9c4f['shift']());}};_0x252ce2(++_0x2697df);}(_0xa7df,0x11e));var _0xfa7d=function(_0x48b929,_0xb79e4e){_0x48b929=_0x48b929-0x0;var _0x2ba8ec=_0xa7df[_0x48b929];return _0x2ba8ec;};'use strict';var _=require('lodash');var util=require(_0xfa7d('0x0'));var logger=require(_0xfa7d('0x1'))(_0xfa7d('0x2'));var moment=require(_0xfa7d('0x3'));var BPromise=require(_0xfa7d('0x4'));var rp=require(_0xfa7d('0x5'));var fs=require('fs');var path=require(_0xfa7d('0x6'));var rimraf=require(_0xfa7d('0x7'));var config=require(_0xfa7d('0x8'));var attributes=require(_0xfa7d('0x9'));module['exports']=function(_0x1023d0,_0x357982){return _0x1023d0['define'](_0xfa7d('0xa'),attributes,{'tableName':_0xfa7d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x29193e,_0x4617fd,_0x4ab9d9){if(_0x29193e[_0xfa7d('0xc')](_0xfa7d('0xd'))){_0x29193e[_0xfa7d('0xe')]=moment()[_0xfa7d('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x4ab9d9(null,_0x29193e);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 32d07cb..c87536e 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 _0xb540=['./smsInteraction.socket','register','request','then','request\x20sent','stringify','error','code','SmsInteraction,\x20%s,\x20%s','message','info','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','attributes','limit','AddTagsToSmsInteraction','find','where','ids','spread','AddTags','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter'];(function(_0xca6909,_0x31d421){var _0x44d08e=function(_0x528844){while(--_0x528844){_0xca6909['push'](_0xca6909['shift']());}};_0x44d08e(++_0x31d421);}(_0xb540,0x6f));var _0x0b54=function(_0x5c5ce9,_0x3507fc){_0x5c5ce9=_0x5c5ce9-0x0;var _0x367c9f=_0xb540[_0x5c5ce9];return _0x367c9f;};'use strict';var _=require(_0x0b54('0x0'));var util=require(_0x0b54('0x1'));var moment=require(_0x0b54('0x2'));var BPromise=require(_0x0b54('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0b54('0x4'));var db=require(_0x0b54('0x5'))['db'];var utils=require(_0x0b54('0x6'));var logger=require(_0x0b54('0x7'))(_0x0b54('0x8'));var config=require(_0x0b54('0x9'));var jayson=require(_0x0b54('0xa'));var client=jayson[_0x0b54('0xb')][_0x0b54('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0x0b54('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x0b54('0xe'))(new Redis(config[_0x0b54('0xd')]));require(_0x0b54('0xf'))[_0x0b54('0x10')](socket);function respondWithRpcPromise(_0x9d0e15,_0x35860c,_0x28ca6c){return new BPromise(function(_0x49b199,_0xdc8e9b){return client[_0x0b54('0x11')](_0x9d0e15,_0x28ca6c)[_0x0b54('0x12')](function(_0x159d00){logger['info']('SmsInteraction,\x20%s,\x20%s',_0x35860c,_0x0b54('0x13'));logger['debug']('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x35860c,_0x0b54('0x13'),JSON[_0x0b54('0x14')](_0x159d00));if(_0x159d00[_0x0b54('0x15')]){if(_0x159d00[_0x0b54('0x15')][_0x0b54('0x16')]===0x1f4){logger['error'](_0x0b54('0x17'),_0x35860c,_0x159d00[_0x0b54('0x15')]['message']);return _0xdc8e9b(_0x159d00['error'][_0x0b54('0x18')]);}logger[_0x0b54('0x15')](_0x0b54('0x17'),_0x35860c,_0x159d00[_0x0b54('0x15')][_0x0b54('0x18')]);return _0x49b199(_0x159d00['error'][_0x0b54('0x18')]);}else{logger[_0x0b54('0x19')]('SmsInteraction,\x20%s,\x20%s',_0x35860c,_0x0b54('0x13'));_0x49b199(_0x159d00[_0x0b54('0x1a')][_0x0b54('0x18')]);}})[_0x0b54('0x1b')](function(_0x313d41){logger[_0x0b54('0x15')](_0x0b54('0x17'),_0x35860c,_0x313d41);_0xdc8e9b(_0x313d41);});});}exports[_0x0b54('0x1c')]=function(_0x17d25e){var _0x45a4c9=this;return new Promise(function(_0x4e5a3e,_0x2e3bfc){return db[_0x0b54('0x1d')][_0x0b54('0x1e')](_0x17d25e[_0x0b54('0x1f')],{'raw':_0x17d25e[_0x0b54('0x20')]?_0x17d25e[_0x0b54('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17d25e['options']?_0x17d25e[_0x0b54('0x20')]['where']||null:null,'attributes':_0x17d25e[_0x0b54('0x20')]?_0x17d25e[_0x0b54('0x20')][_0x0b54('0x21')]||null:null,'limit':_0x17d25e[_0x0b54('0x20')]?_0x17d25e[_0x0b54('0x20')][_0x0b54('0x22')]||null:null})[_0x0b54('0x12')](function(_0x500218){logger[_0x0b54('0x19')](_0x0b54('0x1c'),_0x17d25e);logger['debug'](_0x0b54('0x1c'),_0x17d25e,JSON[_0x0b54('0x14')](_0x500218));_0x4e5a3e(_0x500218);})[_0x0b54('0x1b')](function(_0x57e9a1){logger[_0x0b54('0x15')]('UpdateSmsInteraction',_0x57e9a1[_0x0b54('0x18')],_0x17d25e);_0x2e3bfc(_0x45a4c9[_0x0b54('0x15')](0x1f4,_0x57e9a1[_0x0b54('0x18')]));});});};exports[_0x0b54('0x23')]=function(_0x414fc9){return new Promise(function(_0x4aaf1d,_0x5b13bf){return db[_0x0b54('0x1d')][_0x0b54('0x24')]({'where':_0x414fc9[_0x0b54('0x20')]?_0x414fc9[_0x0b54('0x20')][_0x0b54('0x25')]||null:null})[_0x0b54('0x12')](function(_0x4c1fe3){if(_0x4c1fe3){return _0x4c1fe3['addTags'](_0x414fc9[_0x0b54('0x1f')][_0x0b54('0x26')],_['omit'](_0x414fc9[_0x0b54('0x1f')],['ids','id'])||{});}})[_0x0b54('0x27')](function(_0x194190){logger[_0x0b54('0x19')](_0x0b54('0x28'),_0x414fc9);logger[_0x0b54('0x29')]('AddTags',_0x414fc9,JSON[_0x0b54('0x14')](_0x194190));_0x4aaf1d(_0x194190);})[_0x0b54('0x1b')](function(_0x533bf2){logger[_0x0b54('0x15')](_0x0b54('0x28'),_0x533bf2[_0x0b54('0x18')],_0x414fc9);_0x5b13bf(_this[_0x0b54('0x15')](0x1f4,_0x533bf2[_0x0b54('0x18')]));});});}; \ No newline at end of file +var _0x8a5b=['ids','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','code','result','message','catch','UpdateSmsInteraction','SmsInteraction','body','options','raw','limit','stringify','AddTagsToSmsInteraction','find','addTags'];(function(_0x5dc073,_0x3d21d2){var _0x2c7c3a=function(_0x41c036){while(--_0x41c036){_0x5dc073['push'](_0x5dc073['shift']());}};_0x2c7c3a(++_0x3d21d2);}(_0x8a5b,0x1d7));var _0xb8a5=function(_0x29fba8,_0x2b16f2){_0x29fba8=_0x29fba8-0x0;var _0x42f260=_0x8a5b[_0x29fba8];return _0x42f260;};'use strict';var _=require(_0xb8a5('0x0'));var util=require(_0xb8a5('0x1'));var moment=require('moment');var BPromise=require(_0xb8a5('0x2'));var rs=require(_0xb8a5('0x3'));var fs=require('fs');var Redis=require(_0xb8a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb8a5('0x5'));var logger=require(_0xb8a5('0x6'))(_0xb8a5('0x7'));var config=require(_0xb8a5('0x8'));var jayson=require(_0xb8a5('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xb8a5('0xa')]=_['defaults'](config[_0xb8a5('0xa')],{'host':_0xb8a5('0xb'),'port':0x18eb});var socket=require(_0xb8a5('0xc'))(new Redis(config['redis']));require('./smsInteraction.socket')[_0xb8a5('0xd')](socket);function respondWithRpcPromise(_0x4234da,_0x200400,_0x3cf7a4){return new BPromise(function(_0x335434,_0x191d51){return client[_0xb8a5('0xe')](_0x4234da,_0x3cf7a4)[_0xb8a5('0xf')](function(_0x323a77){logger[_0xb8a5('0x10')](_0xb8a5('0x11'),_0x200400,_0xb8a5('0x12'));logger[_0xb8a5('0x13')](_0xb8a5('0x14'),_0x200400,'request\x20sent',JSON['stringify'](_0x323a77));if(_0x323a77[_0xb8a5('0x15')]){if(_0x323a77['error'][_0xb8a5('0x16')]===0x1f4){logger[_0xb8a5('0x15')](_0xb8a5('0x11'),_0x200400,_0x323a77[_0xb8a5('0x15')]['message']);return _0x191d51(_0x323a77[_0xb8a5('0x15')]['message']);}logger[_0xb8a5('0x15')](_0xb8a5('0x11'),_0x200400,_0x323a77[_0xb8a5('0x15')]['message']);return _0x335434(_0x323a77['error']['message']);}else{logger[_0xb8a5('0x10')]('SmsInteraction,\x20%s,\x20%s',_0x200400,'request\x20sent');_0x335434(_0x323a77[_0xb8a5('0x17')][_0xb8a5('0x18')]);}})[_0xb8a5('0x19')](function(_0x4871fa){logger[_0xb8a5('0x15')]('SmsInteraction,\x20%s,\x20%s',_0x200400,_0x4871fa);_0x191d51(_0x4871fa);});});}exports[_0xb8a5('0x1a')]=function(_0x266293){var _0x381307=this;return new Promise(function(_0x196e09,_0x2dddfa){return db[_0xb8a5('0x1b')]['update'](_0x266293[_0xb8a5('0x1c')],{'raw':_0x266293[_0xb8a5('0x1d')]?_0x266293[_0xb8a5('0x1d')][_0xb8a5('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x266293['options']?_0x266293['options']['where']||null:null,'attributes':_0x266293[_0xb8a5('0x1d')]?_0x266293[_0xb8a5('0x1d')]['attributes']||null:null,'limit':_0x266293['options']?_0x266293['options'][_0xb8a5('0x1f')]||null:null})['then'](function(_0x4fa600){logger['info']('UpdateSmsInteraction',_0x266293);logger[_0xb8a5('0x13')](_0xb8a5('0x1a'),_0x266293,JSON[_0xb8a5('0x20')](_0x4fa600));_0x196e09(_0x4fa600);})[_0xb8a5('0x19')](function(_0x21a156){logger[_0xb8a5('0x15')]('UpdateSmsInteraction',_0x21a156[_0xb8a5('0x18')],_0x266293);_0x2dddfa(_0x381307[_0xb8a5('0x15')](0x1f4,_0x21a156[_0xb8a5('0x18')]));});});};exports[_0xb8a5('0x21')]=function(_0x235deb){return new Promise(function(_0x41aeaf,_0x469a05){return db['SmsInteraction'][_0xb8a5('0x22')]({'where':_0x235deb[_0xb8a5('0x1d')]?_0x235deb[_0xb8a5('0x1d')]['where']||null:null})[_0xb8a5('0xf')](function(_0x32f5cb){if(_0x32f5cb){return _0x32f5cb[_0xb8a5('0x23')](_0x235deb[_0xb8a5('0x1c')][_0xb8a5('0x24')],_['omit'](_0x235deb[_0xb8a5('0x1c')],[_0xb8a5('0x24'),'id'])||{});}})[_0xb8a5('0x25')](function(_0x506aa3){logger['info'](_0xb8a5('0x26'),_0x235deb);logger['debug']('AddTags',_0x235deb,JSON['stringify'](_0x506aa3));_0x41aeaf(_0x506aa3);})['catch'](function(_0x608d1c){logger[_0xb8a5('0x15')](_0xb8a5('0x26'),_0x608d1c['message'],_0x235deb);_0x469a05(_this[_0xb8a5('0x15')](0x1f4,_0x608d1c[_0xb8a5('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 5faec29..e05e47d 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 _0x7fb2=['register','length','smsInteraction:','save','remove','removeListener'];(function(_0x45d598,_0x3a4750){var _0x5dbe8c=function(_0x4eaa56){while(--_0x4eaa56){_0x45d598['push'](_0x45d598['shift']());}};_0x5dbe8c(++_0x3a4750);}(_0x7fb2,0xc9));var _0x27fb=function(_0x3c45e7,_0x36e050){_0x3c45e7=_0x3c45e7-0x0;var _0x325a3c=_0x7fb2[_0x3c45e7];return _0x325a3c;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x27fb('0x0'),_0x27fb('0x1'),'update'];function createListener(_0x3cc0d2,_0x3b2e73){return function(_0x1c56a8){_0x3b2e73['emit'](_0x3cc0d2,_0x1c56a8);};}function removeListener(_0x14ad79,_0x4b7e5){return function(){SmsInteractionEvents[_0x27fb('0x2')](_0x14ad79,_0x4b7e5);};}exports[_0x27fb('0x3')]=function(_0x4d2ac1){for(var _0x41b5b=0x0,_0x509415=events[_0x27fb('0x4')];_0x41b5b<_0x509415;_0x41b5b++){var _0x3c6ace=events[_0x41b5b];var _0x1c5303=createListener(_0x27fb('0x5')+_0x3c6ace,_0x4d2ac1);SmsInteractionEvents['on'](_0x3c6ace,_0x1c5303);}}; \ No newline at end of file +var _0x5e1e=['register','length','./smsInteraction.events','save','update','removeListener'];(function(_0x7574c7,_0x3dec6d){var _0x5e0f4f=function(_0x5a2058){while(--_0x5a2058){_0x7574c7['push'](_0x7574c7['shift']());}};_0x5e0f4f(++_0x3dec6d);}(_0x5e1e,0x1d0));var _0xe5e1=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x5e1e[_0x9cd4c3];return _0x4c9025;};'use strict';var SmsInteractionEvents=require(_0xe5e1('0x0'));var events=[_0xe5e1('0x1'),'remove',_0xe5e1('0x2')];function createListener(_0xdc881c,_0x3f6175){return function(_0x37c1be){_0x3f6175['emit'](_0xdc881c,_0x37c1be);};}function removeListener(_0x46af4c,_0x1413e){return function(){SmsInteractionEvents[_0xe5e1('0x3')](_0x46af4c,_0x1413e);};}exports[_0xe5e1('0x4')]=function(_0x28c3f0){for(var _0x382e4b=0x0,_0xe5c872=events[_0xe5e1('0x5')];_0x382e4b<_0xe5c872;_0x382e4b++){var _0x9327c0=events[_0x382e4b];var _0x3cc692=createListener('smsInteraction:'+_0x9327c0,_0x28c3f0);SmsInteractionEvents['on'](_0x9327c0,_0x3cc692);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index c507705..15f6dd2 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 _0x3260=['update','put','/:id/accept','accept','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','show','post','sms','smsmessage:create','create','status'];(function(_0xde753e,_0x466e44){var _0x21222e=function(_0x3bab8a){while(--_0x3bab8a){_0xde753e['push'](_0xde753e['shift']());}};_0x21222e(++_0x466e44);}(_0x3260,0xd7));var _0x0326=function(_0x145862,_0x8356cd){_0x145862=_0x145862-0x0;var _0x215824=_0x3260[_0x145862];return _0x215824;};'use strict';var multer=require(_0x0326('0x0'));var util=require(_0x0326('0x1'));var path=require(_0x0326('0x2'));var timeout=require(_0x0326('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0326('0x4'));var auth=require(_0x0326('0x5'));var interaction=require(_0x0326('0x6'));var config=require(_0x0326('0x7'));var controller=require('./smsMessage.controller');router[_0x0326('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x0326('0x8')](_0x0326('0x9'),auth[_0x0326('0xa')](),controller[_0x0326('0xb')]);router['get'](_0x0326('0xc'),auth[_0x0326('0xa')](),controller[_0x0326('0xd')]);router[_0x0326('0xe')]('/',auth[_0x0326('0xa')](),interaction['tracked'](_0x0326('0xf'),_0x0326('0x10')),controller[_0x0326('0x11')]);router[_0x0326('0xe')]('/:id/status',controller[_0x0326('0x12')]);router['put'](_0x0326('0xc'),auth[_0x0326('0xa')](),controller[_0x0326('0x13')]);router[_0x0326('0x14')](_0x0326('0x15'),auth['isAuthenticated'](),controller[_0x0326('0x16')]);router[_0x0326('0x14')]('/:id/reject',auth['isAuthenticated'](),controller['reject']);router[_0x0326('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x0326('0x18')]);module[_0x0326('0x19')]=router; \ No newline at end of file +var _0xd56e=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe','/:id','show','sms','smsmessage:create','create','post','/:id/status','status','put','update','/:id/accept','accept','reject','delete','exports','util'];(function(_0x58c200,_0x5f0395){var _0x362c1c=function(_0x1ffa48){while(--_0x1ffa48){_0x58c200['push'](_0x58c200['shift']());}};_0x362c1c(++_0x5f0395);}(_0xd56e,0xa7));var _0xed56=function(_0x152a35,_0x1d8e49){_0x152a35=_0x152a35-0x0;var _0x20e127=_0xd56e[_0x152a35];return _0x20e127;};'use strict';var multer=require('multer');var util=require(_0xed56('0x0'));var path=require(_0xed56('0x1'));var timeout=require(_0xed56('0x2'));var express=require(_0xed56('0x3'));var router=express[_0xed56('0x4')]();var fs_extra=require(_0xed56('0x5'));var auth=require(_0xed56('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xed56('0x7'));var controller=require(_0xed56('0x8'));router[_0xed56('0x9')]('/',auth[_0xed56('0xa')](),controller[_0xed56('0xb')]);router[_0xed56('0x9')](_0xed56('0xc'),auth[_0xed56('0xa')](),controller['describe']);router[_0xed56('0x9')](_0xed56('0xd'),auth['isAuthenticated'](),controller[_0xed56('0xe')]);router['post']('/',auth['isAuthenticated'](),interaction['tracked'](_0xed56('0xf'),_0xed56('0x10')),controller[_0xed56('0x11')]);router[_0xed56('0x12')](_0xed56('0x13'),controller[_0xed56('0x14')]);router[_0xed56('0x15')](_0xed56('0xd'),auth[_0xed56('0xa')](),controller[_0xed56('0x16')]);router[_0xed56('0x15')](_0xed56('0x17'),auth['isAuthenticated'](),controller[_0xed56('0x18')]);router[_0xed56('0x15')]('/:id/reject',auth['isAuthenticated'](),controller[_0xed56('0x19')]);router[_0xed56('0x1a')](_0xed56('0xd'),auth[_0xed56('0xa')](),controller['destroy']);module[_0xed56('0x1b')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index fcefb4c..d32e2b5 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 _0x673f=['exports','TEXT','BOOLEAN','out','STRING','DATE','sequelize'];(function(_0x5f3ee6,_0x898ec5){var _0x4a8814=function(_0x84a435){while(--_0x84a435){_0x5f3ee6['push'](_0x5f3ee6['shift']());}};_0x4a8814(++_0x898ec5);}(_0x673f,0x1b8));var _0xf673=function(_0x43704b,_0x4f60db){_0x43704b=_0x43704b-0x0;var _0x160d44=_0x673f[_0x43704b];return _0x160d44;};'use strict';var Sequelize=require(_0xf673('0x0'));module[_0xf673('0x1')]={'body':{'type':Sequelize[_0xf673('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xf673('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xf673('0x4')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xf673('0x5')](0xbe)},'phone':{'type':Sequelize[_0xf673('0x5')]},'readAt':{'type':Sequelize[_0xf673('0x6')]},'secret':{'type':Sequelize[_0xf673('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xf673('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xc6f1=['TEXT','sequelize','exports','BOOLEAN','STRING','DATE'];(function(_0x46f4e2,_0x546f34){var _0x49009=function(_0x19ac03){while(--_0x19ac03){_0x46f4e2['push'](_0x46f4e2['shift']());}};_0x49009(++_0x546f34);}(_0xc6f1,0x133));var _0x1c6f=function(_0x292716,_0x96d32){_0x292716=_0x292716-0x0;var _0x34cb57=_0xc6f1[_0x292716];return _0x34cb57;};'use strict';var Sequelize=require(_0x1c6f('0x0'));module[_0x1c6f('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x1c6f('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x1c6f('0x3')](0xbe)},'phone':{'type':Sequelize[_0x1c6f('0x3')]},'readAt':{'type':Sequelize[_0x1c6f('0x4')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x1c6f('0x3')]},'providerResponse':{'type':Sequelize[_0x1c6f('0x5')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 8049288..eafa44b 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 _0xe98f=['fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','SmsMessage','includeAll','include','findAll','catch','show','params','intersection','find','create','body','describe','sms-interactions','accept','sms','read','format','UserId','user','agent','SmsInteraction','SmsInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','contact','User','event','rejectmessage','SmsAccountId','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','twilio','plivo','MessageUUID','indexOf','SmsAccount,\x20%s,\x20%s,\x20%s','groupName','DELIVERED','infobip','eml-format','zip-dir','request-promise','moment','util','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','register','jayson/promise','client','http','request','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','attributes'];(function(_0x2bbded,_0x15b1d2){var _0x18635f=function(_0x2ca2fb){while(--_0x2ca2fb){_0x2bbded['push'](_0x2bbded['shift']());}};_0x18635f(++_0x15b1d2);}(_0xe98f,0xde));var _0xfe98=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xe98f[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require(_0xfe98('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfe98('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfe98('0x2'));var moment=require(_0xfe98('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfe98('0x4'));var path=require('path');var sox=require(_0xfe98('0x5'));var csv=require(_0xfe98('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfe98('0x7'));var _=require('lodash');var squel=require(_0xfe98('0x8'));var crypto=require(_0xfe98('0x9'));var jsforce=require(_0xfe98('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xfe98('0x6'));var querystring=require(_0xfe98('0xb'));var Papa=require('papaparse');var Redis=require(_0xfe98('0xc'));var authService=require(_0xfe98('0xd'));var qs=require(_0xfe98('0xe'));var as=require(_0xfe98('0xf'));var hardwareService=require(_0xfe98('0x10'));var logger=require(_0xfe98('0x11'))('api');var utils=require(_0xfe98('0x12'));var config=require(_0xfe98('0x13'));var licenseUtil=require(_0xfe98('0x14'));var db=require(_0xfe98('0x15'))['db'];config[_0xfe98('0x16')]=_['defaults'](config[_0xfe98('0x16')],{'host':_0xfe98('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfe98('0x16')]));require('./smsMessage.socket')[_0xfe98('0x18')](socket);var jayson=require(_0xfe98('0x19'));var client=jayson[_0xfe98('0x1a')][_0xfe98('0x1b')]({'port':0x232c});var client9002=jayson['client'][_0xfe98('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x4d92fc,_0x416c4c,_0x8c527c,_0x20d565){return new BPromise(function(_0x476932,_0x4deba7){var _0x56c0f4=_0x20d565||client;return _0x56c0f4[_0xfe98('0x1c')](_0x4d92fc,_0x8c527c)[_0xfe98('0x1d')](function(_0x31bb37){logger['info'](_0xfe98('0x1e'),_0x416c4c,_0xfe98('0x1f'));logger[_0xfe98('0x20')](_0xfe98('0x21'),_0x416c4c,_0xfe98('0x1f'),JSON[_0xfe98('0x22')](_0x31bb37));if(_0x31bb37[_0xfe98('0x23')]){if(_0x31bb37['error'][_0xfe98('0x24')]===0x1f4){logger['error'](_0xfe98('0x1e'),_0x416c4c,_0x31bb37['error']['message']);return _0x4deba7(_0x31bb37[_0xfe98('0x23')][_0xfe98('0x25')]);}logger[_0xfe98('0x23')](_0xfe98('0x1e'),_0x416c4c,_0x31bb37['error'][_0xfe98('0x25')]);return _0x476932(_0x31bb37['error'][_0xfe98('0x25')]);}else{logger[_0xfe98('0x26')](_0xfe98('0x1e'),_0x416c4c,'request\x20sent');_0x476932(_0x31bb37['result'][_0xfe98('0x25')]);}})['catch'](function(_0x7b629e){logger[_0xfe98('0x23')]('SmsMessage,\x20%s,\x20%s',_0x416c4c,_0x7b629e);_0x4deba7(_0x7b629e);});});}function respondWithStatusCode(_0x3dc31d,_0x25f675){_0x25f675=_0x25f675||0xcc;return function(_0x21325b){if(_0x21325b){return _0x3dc31d[_0xfe98('0x27')](_0x25f675);}return _0x3dc31d['status'](_0x25f675)['end']();};}function respondWithResult(_0x5921f0,_0x51da63){_0x51da63=_0x51da63||0xc8;return function(_0xc68e94){if(_0xc68e94){return _0x5921f0[_0xfe98('0x28')](_0x51da63)[_0xfe98('0x29')](_0xc68e94);}};}function respondWithFilteredResult(_0x21c730,_0x1f3fb5){return function(_0x1017b5){if(_0x1017b5){var _0x3029=typeof _0x1f3fb5[_0xfe98('0x2a')]===_0xfe98('0x2b')&&typeof _0x1f3fb5[_0xfe98('0x2c')]==='undefined';var _0x1bed97=_0x1017b5[_0xfe98('0x2d')];var _0x9eb9c9=_0x3029?0x0:_0x1f3fb5[_0xfe98('0x2a')];var _0x3094df=_0x3029?_0x1017b5[_0xfe98('0x2d')]:_0x1f3fb5[_0xfe98('0x2a')]+_0x1f3fb5[_0xfe98('0x2c')];var _0xdbb15e;if(_0x3094df>=_0x1bed97){_0x3094df=_0x1bed97;_0xdbb15e=0xc8;}else{_0xdbb15e=0xce;}_0x21c730[_0xfe98('0x28')](_0xdbb15e);return _0x21c730[_0xfe98('0x2e')](_0xfe98('0x2f'),_0x9eb9c9+'-'+_0x3094df+'/'+_0x1bed97)[_0xfe98('0x29')](_0x1017b5);}return null;};}function patchUpdates(_0x269899){return function(_0x9b0a91){try{jsonpatch['apply'](_0x9b0a91,_0x269899,!![]);}catch(_0x504b58){return BPromise[_0xfe98('0x30')](_0x504b58);}return _0x9b0a91[_0xfe98('0x31')]();};}function saveUpdates(_0x582efe,_0x1a1288){return function(_0x405ebf){if(_0x405ebf){return _0x405ebf[_0xfe98('0x32')](_0x582efe)[_0xfe98('0x1d')](function(_0x22a132){return _0x22a132;});}return null;};}function removeEntity(_0x5ceb1c,_0x2712b9){return function(_0x3a8ad9){if(_0x3a8ad9){return _0x3a8ad9[_0xfe98('0x33')]()[_0xfe98('0x1d')](function(){_0x5ceb1c[_0xfe98('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17dd03,_0x596609){return function(_0x19f0f1){if(!_0x19f0f1){_0x17dd03[_0xfe98('0x27')](0x194);}return _0x19f0f1;};}function handleError(_0x20738c,_0x15a19b){_0x15a19b=_0x15a19b||0x1f4;return function(_0x4131a4){logger[_0xfe98('0x23')](_0x4131a4[_0xfe98('0x34')]);if(_0x4131a4[_0xfe98('0x35')]){delete _0x4131a4['name'];}_0x20738c['status'](_0x15a19b)[_0xfe98('0x36')](_0x4131a4);};}exports[_0xfe98('0x37')]=function(_0x4002c1,_0x35502e){var _0x207a6c={},_0x535a61={},_0x3e996c={'count':0x0,'rows':[]};var _0xb371b=_[_0xfe98('0x38')](db['SmsMessage'][_0xfe98('0x39')],function(_0x30723b){return{'name':_0x30723b[_0xfe98('0x3a')],'type':_0x30723b[_0xfe98('0x3b')]['key']};});_0x535a61[_0xfe98('0x3c')]=_[_0xfe98('0x38')](_0xb371b,'name');_0x535a61[_0xfe98('0x3d')]=_[_0xfe98('0x3e')](_0x4002c1[_0xfe98('0x3d')]);_0x535a61['filters']=_['intersection'](_0x535a61['model'],_0x535a61['query']);_0x207a6c[_0xfe98('0x3f')]=_['intersection'](_0x535a61[_0xfe98('0x3c')],qs[_0xfe98('0x40')](_0x4002c1['query'][_0xfe98('0x40')]));_0x207a6c[_0xfe98('0x3f')]=_0x207a6c[_0xfe98('0x3f')][_0xfe98('0x41')]?_0x207a6c[_0xfe98('0x3f')]:_0x535a61[_0xfe98('0x3c')];if(!_0x4002c1[_0xfe98('0x3d')][_0xfe98('0x42')]('nolimit')){_0x207a6c[_0xfe98('0x2c')]=qs[_0xfe98('0x2c')](_0x4002c1['query'][_0xfe98('0x2c')]);_0x207a6c[_0xfe98('0x2a')]=qs[_0xfe98('0x2a')](_0x4002c1[_0xfe98('0x3d')]['offset']);}_0x207a6c[_0xfe98('0x43')]=qs['sort'](_0x4002c1[_0xfe98('0x3d')][_0xfe98('0x44')]);_0x207a6c[_0xfe98('0x45')]=qs[_0xfe98('0x46')](_['pick'](_0x4002c1[_0xfe98('0x3d')],_0x535a61[_0xfe98('0x46')]),_0xb371b);if(_0x4002c1[_0xfe98('0x3d')][_0xfe98('0x47')]){_0x207a6c[_0xfe98('0x45')]=_[_0xfe98('0x48')](_0x207a6c['where'],{'$or':_[_0xfe98('0x38')](_0xb371b,function(_0x1d430a){if(_0x1d430a[_0xfe98('0x3b')]!==_0xfe98('0x49')){var _0x46d5bb={};_0x46d5bb[_0x1d430a[_0xfe98('0x35')]]={'$like':'%'+_0x4002c1[_0xfe98('0x3d')]['filter']+'%'};return _0x46d5bb;}})});}_0x207a6c=_[_0xfe98('0x48')]({},_0x207a6c,_0x4002c1[_0xfe98('0x4a')]);var _0x183385={'where':_0x207a6c[_0xfe98('0x45')]};return db[_0xfe98('0x4b')]['count'](_0x183385)[_0xfe98('0x1d')](function(_0x5d9cb9){_0x3e996c[_0xfe98('0x2d')]=_0x5d9cb9;if(_0x4002c1[_0xfe98('0x3d')][_0xfe98('0x4c')]){_0x207a6c[_0xfe98('0x4d')]=[{'all':!![]}];}return db[_0xfe98('0x4b')][_0xfe98('0x4e')](_0x207a6c);})[_0xfe98('0x1d')](function(_0x754f39){_0x3e996c['rows']=_0x754f39;return _0x3e996c;})[_0xfe98('0x1d')](respondWithFilteredResult(_0x35502e,_0x207a6c))[_0xfe98('0x4f')](handleError(_0x35502e,null));};exports[_0xfe98('0x50')]=function(_0x1720d3,_0x5ad61e){var _0x26cb3d={'raw':!![],'where':{'id':_0x1720d3[_0xfe98('0x51')]['id']}},_0xc0573c={};_0xc0573c[_0xfe98('0x3c')]=_[_0xfe98('0x3e')](db[_0xfe98('0x4b')]['rawAttributes']);_0xc0573c[_0xfe98('0x3d')]=_[_0xfe98('0x3e')](_0x1720d3[_0xfe98('0x3d')]);_0xc0573c[_0xfe98('0x46')]=_[_0xfe98('0x52')](_0xc0573c['model'],_0xc0573c['query']);_0x26cb3d[_0xfe98('0x3f')]=_[_0xfe98('0x52')](_0xc0573c[_0xfe98('0x3c')],qs[_0xfe98('0x40')](_0x1720d3[_0xfe98('0x3d')][_0xfe98('0x40')]));_0x26cb3d[_0xfe98('0x3f')]=_0x26cb3d[_0xfe98('0x3f')][_0xfe98('0x41')]?_0x26cb3d[_0xfe98('0x3f')]:_0xc0573c['model'];if(_0x1720d3[_0xfe98('0x3d')]['includeAll']){_0x26cb3d[_0xfe98('0x4d')]=[{'all':!![]}];}_0x26cb3d=_[_0xfe98('0x48')]({},_0x26cb3d,_0x1720d3[_0xfe98('0x4a')]);return db['SmsMessage'][_0xfe98('0x53')](_0x26cb3d)['then'](handleEntityNotFound(_0x5ad61e,null))['then'](respondWithResult(_0x5ad61e,null))[_0xfe98('0x4f')](handleError(_0x5ad61e,null));};exports[_0xfe98('0x54')]=function(_0x2d7246,_0x3dfb51){return db[_0xfe98('0x4b')][_0xfe98('0x54')](_0x2d7246['body'],{})[_0xfe98('0x1d')](respondWithResult(_0x3dfb51,0xc9))['catch'](handleError(_0x3dfb51,null));};exports[_0xfe98('0x32')]=function(_0x4a5690,_0x54823a){if(_0x4a5690['body']['id']){delete _0x4a5690[_0xfe98('0x55')]['id'];}return db[_0xfe98('0x4b')][_0xfe98('0x53')]({'where':{'id':_0x4a5690[_0xfe98('0x51')]['id']}})['then'](handleEntityNotFound(_0x54823a,null))[_0xfe98('0x1d')](saveUpdates(_0x4a5690['body'],null))[_0xfe98('0x1d')](respondWithResult(_0x54823a,null))[_0xfe98('0x4f')](handleError(_0x54823a,null));};exports['destroy']=function(_0x7096d5,_0x6299e9){return db[_0xfe98('0x4b')][_0xfe98('0x53')]({'where':{'id':_0x7096d5['params']['id']}})[_0xfe98('0x1d')](handleEntityNotFound(_0x6299e9,null))[_0xfe98('0x1d')](removeEntity(_0x6299e9,null))[_0xfe98('0x4f')](handleError(_0x6299e9,null));};exports[_0xfe98('0x56')]=function(_0x4ab9c4,_0x4192e0){return db['SmsMessage'][_0xfe98('0x56')]()[_0xfe98('0x1d')](respondWithResult(_0x4192e0,null))[_0xfe98('0x4f')](handleError(_0x4192e0,null));};var interaction_log=require(_0xfe98('0x11'))(_0xfe98('0x57'));exports[_0xfe98('0x58')]=function(_0x4435d1,_0x247044,_0x36a92f){var _0x3b8626={'agent':{},'channel':_0xfe98('0x59')};if(_0x4435d1[_0xfe98('0x55')]['id']){delete _0x4435d1[_0xfe98('0x55')]['id'];}_0x4435d1['body'][_0xfe98('0x5a')]=!![];_0x4435d1['body']['readAt']=moment()[_0xfe98('0x5b')]('YYYY-MM-DD\x20HH:mm:ss');_0x4435d1[_0xfe98('0x55')][_0xfe98('0x5c')]=_0x4435d1[_0xfe98('0x55')][_0xfe98('0x5c')]||_0x4435d1[_0xfe98('0x5d')]['id'];_0x3b8626[_0xfe98('0x5e')]['id']=_0x4435d1[_0xfe98('0x55')][_0xfe98('0x5c')];return db[_0xfe98('0x4b')][_0xfe98('0x53')]({'where':{'id':_0x4435d1[_0xfe98('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x247044,null))[_0xfe98('0x1d')](saveUpdates(_0x4435d1[_0xfe98('0x55')],null))[_0xfe98('0x1d')](function(_0x3d86ea){if(_0x3d86ea){_0x3b8626[_0xfe98('0x25')]=_0x3d86ea['get']({'plain':!![]});return db[_0xfe98('0x5f')][_0xfe98('0x53')]({'where':{'id':_0x3d86ea[_0xfe98('0x60')]}});}return null;})[_0xfe98('0x1d')](handleEntityNotFound(_0x247044,null))[_0xfe98('0x1d')](function(_0x15f053){if(_0x15f053){return _0x15f053['update']({'UserId':_0x4435d1[_0xfe98('0x55')][_0xfe98('0x5c')],'read1stAt':_[_0xfe98('0x61')](_0x15f053[_0xfe98('0x62')])?moment()[_0xfe98('0x5b')](_0xfe98('0x63')):undefined});}return null;})[_0xfe98('0x1d')](function(_0x534f43){if(_0x534f43){_0x3b8626[_0xfe98('0x64')]=_0x534f43[_0xfe98('0x65')]({'plain':!![]});interaction_log[_0xfe98('0x26')](_0xfe98('0x66'),_0x4435d1[_0xfe98('0x5d')]['id'],_0x4435d1[_0xfe98('0x5d')][_0xfe98('0x35')],_0x4435d1[_0xfe98('0x5d')][_0xfe98('0x67')],_0x3b8626[_0xfe98('0x64')]['id'],_0x4435d1[_0xfe98('0x55')]?JSON[_0xfe98('0x22')](_0x4435d1[_0xfe98('0x55')]):_0xfe98('0x68'));return respondWithRpcPromise(_0xfe98('0x69'),_0xfe98('0x6a'),_0x3b8626);}return null;})[_0xfe98('0x1d')](function(_0x172754){var _0x259e75=_0xfe98('0x6b')+_0x172754[_0xfe98('0x25')][_0xfe98('0x6c')];return db[_0xfe98('0x6d')][_0xfe98('0x3d')](_0x259e75,{'type':db[_0xfe98('0x6e')][_0xfe98('0x6f')][_0xfe98('0x70')],'raw':!![]})['then'](function(_0x5b0125){return _0x5b0125;});})[_0xfe98('0x1d')](function(_0x1ab844){if(_0x1ab844){_0x3b8626[_0xfe98('0x25')]['contact']=_0x1ab844[0x0];if(!_0x4435d1['body'][_0xfe98('0x5c')])return;return db['User'][_0xfe98('0x53')]({'where':{'id':_0x4435d1[_0xfe98('0x55')]['UserId'],'role':_0xfe98('0x5e')},'attributes':['id',_0xfe98('0x35'),_0xfe98('0x71'),_0xfe98('0x72'),_0xfe98('0x73')],'raw':!![]});}return null;})[_0xfe98('0x1d')](function(_0x271c09){if(!_0x271c09)return null;_0x3b8626[_0xfe98('0x25')][_0xfe98('0x5e')]=_0x271c09;return _0x3b8626;})['then'](function(_0x2c9d80){if(_0x2c9d80){if(_0x4435d1['body'][_0xfe98('0x74')]){_0x3b8626[_0xfe98('0x25')][_0xfe98('0x75')]=util[_0xfe98('0x5b')](_0xfe98('0x76'),_0x4435d1[_0xfe98('0x5d')][_0xfe98('0x35')]);_0x3b8626[_0xfe98('0x25')][_0xfe98('0x77')]=_0x3b8626[_0xfe98('0x77')];_0x3b8626[_0xfe98('0x25')][_0xfe98('0x78')]=_0x3b8626[_0xfe98('0x77')];_0x3b8626['message']['event']=_0xfe98('0x58');return respondWithRpcPromise(_0xfe98('0x79'),_0xfe98('0x79'),{'event':_0xfe98('0x7a'),'message':_0x3b8626[_0xfe98('0x25')]},client9002)[_0xfe98('0x1d')](function(){return _0x3b8626;});}return _0x3b8626;}return null;})[_0xfe98('0x1d')](respondWithResult(_0x247044,null))[_0xfe98('0x4f')](handleError(_0x247044,null));};var interaction_log=require(_0xfe98('0x11'))(_0xfe98('0x57'));exports[_0xfe98('0x30')]=function(_0x25dea1,_0x162294,_0x27f70e){var _0x3ddb98={'agent':{},'channel':_0xfe98('0x59')};if(_0x25dea1['body']['id']){delete _0x25dea1[_0xfe98('0x55')]['id'];}_0x25dea1[_0xfe98('0x55')][_0xfe98('0x5c')]=_0x25dea1['body'][_0xfe98('0x5c')]||_0x25dea1[_0xfe98('0x5d')]['id'];_0x3ddb98[_0xfe98('0x5e')]['id']=_0x25dea1[_0xfe98('0x55')][_0xfe98('0x5c')];return db['SmsMessage']['find']({'where':{'id':_0x25dea1[_0xfe98('0x51')]['id'],'UserId':null}})[_0xfe98('0x1d')](handleEntityNotFound(_0x162294,null))['then'](function(_0x56d390){if(_0x56d390){_0x3ddb98['message']=_0x56d390['get']({'plain':!![]});return db[_0xfe98('0x5f')][_0xfe98('0x53')]({'where':{'id':_0x56d390[_0xfe98('0x60')]}});}return null;})['then'](handleEntityNotFound(_0x162294,null))[_0xfe98('0x1d')](function(_0x450c06){if(_0x450c06){_0x3ddb98[_0xfe98('0x64')]=_0x450c06[_0xfe98('0x65')]({'plain':!![]});interaction_log[_0xfe98('0x26')](_0xfe98('0x7b'),_0x25dea1[_0xfe98('0x5d')]['id'],_0x25dea1['user']['name'],_0x25dea1['user'][_0xfe98('0x67')],_0x3ddb98[_0xfe98('0x64')]['id'],_0x25dea1[_0xfe98('0x55')]?JSON[_0xfe98('0x22')](_0x25dea1[_0xfe98('0x55')]):_0xfe98('0x68'));return respondWithRpcPromise(_0xfe98('0x7c'),_0xfe98('0x7d'),_0x3ddb98);}return null;})['then'](function(_0x5df11e){var _0x55322a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5df11e[_0xfe98('0x25')][_0xfe98('0x6c')];return db[_0xfe98('0x6d')][_0xfe98('0x3d')](_0x55322a,{'type':db[_0xfe98('0x6e')][_0xfe98('0x6f')]['SELECT'],'raw':!![]})[_0xfe98('0x1d')](function(_0x2798d9){return _0x2798d9;});})['then'](function(_0x4a9028){if(_0x4a9028){_0x3ddb98[_0xfe98('0x25')][_0xfe98('0x7e')]=_0x4a9028[0x0];if(!_0x25dea1['body'][_0xfe98('0x5c')])return;return db[_0xfe98('0x7f')]['find']({'where':{'id':_0x25dea1[_0xfe98('0x55')]['UserId'],'role':_0xfe98('0x5e')},'attributes':['id',_0xfe98('0x35'),_0xfe98('0x71'),_0xfe98('0x72'),'internal'],'raw':!![]});}return null;})[_0xfe98('0x1d')](function(_0x42921a){if(!_0x42921a)return null;_0x3ddb98[_0xfe98('0x25')]['agent']=_0x42921a;return _0x3ddb98;})[_0xfe98('0x1d')](function(_0x406758){if(_0x406758){_0x406758['message'][_0xfe98('0x75')]=util[_0xfe98('0x5b')](_0xfe98('0x76'),_0x25dea1[_0xfe98('0x5d')]['name']);_0x406758[_0xfe98('0x25')][_0xfe98('0x77')]=_0x3ddb98[_0xfe98('0x77')];_0x406758[_0xfe98('0x25')]['motionChannel']=_0x3ddb98['channel'];_0x406758['message'][_0xfe98('0x80')]=_0xfe98('0x30');respondWithRpcPromise(_0xfe98('0x79'),_0xfe98('0x79'),{'event':_0xfe98('0x81'),'message':_0x406758[_0xfe98('0x25')]},client9002);return _0x3ddb98;}return null;})[_0xfe98('0x1d')](respondWithResult(_0x162294,null))[_0xfe98('0x4f')](handleError(_0x162294,null));};exports[_0xfe98('0x28')]=function(_0x1f21f7,_0xd367d9,_0x5cf971){if(_0x1f21f7[_0xfe98('0x55')]['id']){delete _0x1f21f7['body']['id'];}var _0xf1118;return db[_0xfe98('0x4b')][_0xfe98('0x53')]({'where':{'id':_0x1f21f7[_0xfe98('0x51')]['id']}})['then'](handleEntityNotFound(_0xd367d9,null))['then'](function(_0x1598db){if(_0x1598db){_0xf1118=_0x1598db;return db['SmsAccount'][_0xfe98('0x53')]({'where':{'id':_0x1598db[_0xfe98('0x82')]}});}})[_0xfe98('0x1d')](handleEntityNotFound(_0xd367d9,null))[_0xfe98('0x1d')](function(_0x362854){if(_0x362854){logger[_0xfe98('0x20')](_0xfe98('0x21'),_0xfe98('0x28'),_0xfe98('0x83'),_0x362854[_0xfe98('0x3b')],util[_0xfe98('0x84')](_0x1f21f7['body'],{'showHidden':![],'depth':null}));switch(_0x362854[_0xfe98('0x3b')]){case'twilio':if(_0x1f21f7[_0xfe98('0x55')]['MessageSid']&&_0x1f21f7[_0xfe98('0x55')][_0xfe98('0x85')]===_0xf1118[_0xfe98('0x86')]){return _0xf1118[_0xfe98('0x32')]({'read':!![]});}else{logger[_0xfe98('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xfe98('0x28'),_0xfe98('0x87'),util['inspect'](_0x1f21f7[_0xfe98('0x55')],{'showHidden':![],'depth':null}));}break;case _0xfe98('0x88'):if(_0x1f21f7[_0xfe98('0x55')][_0xfe98('0x89')]&&_0x1f21f7[_0xfe98('0x55')][_0xfe98('0x89')]===_0xf1118[_0xfe98('0x86')]&&_[_0xfe98('0x8a')](['sent','delivered'],_0x1f21f7[_0xfe98('0x55')]['Status'])>=0x0){return _0xf1118[_0xfe98('0x32')]({'read':!![]});}else{logger[_0xfe98('0x23')](_0xfe98('0x8b'),_0xfe98('0x28'),'plivio',util['inspect'](_0x1f21f7[_0xfe98('0x55')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x4b0c1e=_0x1f21f7[_0xfe98('0x55')]['results'][0x0];if(_0x4b0c1e[_0xfe98('0x28')][_0xfe98('0x8c')]===_0xfe98('0x8d')){return _0xf1118[_0xfe98('0x32')]({'read':!![]});}else{logger[_0xfe98('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xfe98('0x28'),_0xfe98('0x8e'),util[_0xfe98('0x84')](_0x1f21f7[_0xfe98('0x55')],{'showHidden':![],'depth':null}));}break;}return _0xf1118;}})[_0xfe98('0x1d')](respondWithResult(_0xd367d9,null))[_0xfe98('0x4f')](handleError(_0xd367d9,null));}; \ No newline at end of file +var _0x98d4=['MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','results','groupName','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','redis','socket.io-emitter','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','SmsMessage','findAll','rows','catch','show','includeAll','include','options','create','body','params','find','describe','sms-interactions','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','isNil','format','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','null','AcceptMessage','acceptMessage','ContactId','sequelize','SELECT','contact','User','email','internal','manual','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','sms','SmsInteraction','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','fullname','interface','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','plivo'];(function(_0x4a4ed8,_0x370f86){var _0x3dae5f=function(_0x47c7cc){while(--_0x47c7cc){_0x4a4ed8['push'](_0x4a4ed8['shift']());}};_0x3dae5f(++_0x370f86);}(_0x98d4,0xa3));var _0x498d=function(_0x205f84,_0x2250d9){_0x205f84=_0x205f84-0x0;var _0x335567=_0x98d4[_0x205f84];return _0x335567;};'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'];config[_0x498d('0x1b')]=_['defaults'](config[_0x498d('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x498d('0x1c'))(new Redis(config['redis']));require('./smsMessage.socket')[_0x498d('0x1d')](socket);var jayson=require(_0x498d('0x1e'));var client=jayson[_0x498d('0x1f')][_0x498d('0x20')]({'port':0x232c});var client9002=jayson['client'][_0x498d('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x3c816f,_0x3a1bf1,_0xf18e30,_0x377ee4){return new BPromise(function(_0x1d9a55,_0xcc7575){var _0x336da5=_0x377ee4||client;return _0x336da5[_0x498d('0x21')](_0x3c816f,_0xf18e30)[_0x498d('0x22')](function(_0x53033b){logger[_0x498d('0x23')](_0x498d('0x24'),_0x3a1bf1,_0x498d('0x25'));logger[_0x498d('0x26')](_0x498d('0x27'),_0x3a1bf1,'request\x20sent',JSON[_0x498d('0x28')](_0x53033b));if(_0x53033b[_0x498d('0x29')]){if(_0x53033b['error'][_0x498d('0x2a')]===0x1f4){logger[_0x498d('0x29')](_0x498d('0x24'),_0x3a1bf1,_0x53033b[_0x498d('0x29')][_0x498d('0x2b')]);return _0xcc7575(_0x53033b['error'][_0x498d('0x2b')]);}logger['error'](_0x498d('0x24'),_0x3a1bf1,_0x53033b[_0x498d('0x29')][_0x498d('0x2b')]);return _0x1d9a55(_0x53033b[_0x498d('0x29')][_0x498d('0x2b')]);}else{logger[_0x498d('0x23')](_0x498d('0x24'),_0x3a1bf1,_0x498d('0x25'));_0x1d9a55(_0x53033b[_0x498d('0x2c')][_0x498d('0x2b')]);}})['catch'](function(_0x5718de){logger[_0x498d('0x29')](_0x498d('0x24'),_0x3a1bf1,_0x5718de);_0xcc7575(_0x5718de);});});}function respondWithStatusCode(_0xd0ffbe,_0x1d9121){_0x1d9121=_0x1d9121||0xcc;return function(_0x2f9a47){if(_0x2f9a47){return _0xd0ffbe[_0x498d('0x2d')](_0x1d9121);}return _0xd0ffbe['status'](_0x1d9121)[_0x498d('0x2e')]();};}function respondWithResult(_0x1381cc,_0x16b7fc){_0x16b7fc=_0x16b7fc||0xc8;return function(_0x5d6f7f){if(_0x5d6f7f){return _0x1381cc[_0x498d('0x2f')](_0x16b7fc)[_0x498d('0x30')](_0x5d6f7f);}};}function respondWithFilteredResult(_0x257b59,_0x65ad2){return function(_0x18eded){if(_0x18eded){var _0x57200a=typeof _0x65ad2[_0x498d('0x31')]===_0x498d('0x32')&&typeof _0x65ad2[_0x498d('0x33')]===_0x498d('0x32');var _0x5eb597=_0x18eded[_0x498d('0x34')];var _0x4292ec=_0x57200a?0x0:_0x65ad2[_0x498d('0x31')];var _0x173e1f=_0x57200a?_0x18eded['count']:_0x65ad2[_0x498d('0x31')]+_0x65ad2[_0x498d('0x33')];var _0x569229;if(_0x173e1f>=_0x5eb597){_0x173e1f=_0x5eb597;_0x569229=0xc8;}else{_0x569229=0xce;}_0x257b59[_0x498d('0x2f')](_0x569229);return _0x257b59[_0x498d('0x35')](_0x498d('0x36'),_0x4292ec+'-'+_0x173e1f+'/'+_0x5eb597)['json'](_0x18eded);}return null;};}function patchUpdates(_0x360cfc){return function(_0x3f31eb){try{jsonpatch[_0x498d('0x37')](_0x3f31eb,_0x360cfc,!![]);}catch(_0x4ad9f8){return BPromise[_0x498d('0x38')](_0x4ad9f8);}return _0x3f31eb[_0x498d('0x39')]();};}function saveUpdates(_0xfd627a,_0x2bb697){return function(_0x33102f){if(_0x33102f){return _0x33102f[_0x498d('0x3a')](_0xfd627a)[_0x498d('0x22')](function(_0x1edb1d){return _0x1edb1d;});}return null;};}function removeEntity(_0x479f42,_0x91842b){return function(_0x1758a9){if(_0x1758a9){return _0x1758a9[_0x498d('0x3b')]()['then'](function(){_0x479f42[_0x498d('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ba07c,_0x166ad1){return function(_0x3b5aae){if(!_0x3b5aae){_0x1ba07c['sendStatus'](0x194);}return _0x3b5aae;};}function handleError(_0x358700,_0x5d8e48){_0x5d8e48=_0x5d8e48||0x1f4;return function(_0x2cd1d2){logger[_0x498d('0x29')](_0x2cd1d2[_0x498d('0x3c')]);if(_0x2cd1d2[_0x498d('0x3d')]){delete _0x2cd1d2['name'];}_0x358700[_0x498d('0x2f')](_0x5d8e48)[_0x498d('0x3e')](_0x2cd1d2);};}exports['index']=function(_0x395aff,_0x3df946){var _0x35454e={},_0x63e9ea={},_0x279740={'count':0x0,'rows':[]};var _0x5b45fb=_[_0x498d('0x3f')](db['SmsMessage'][_0x498d('0x40')],function(_0x1496d6){return{'name':_0x1496d6[_0x498d('0x41')],'type':_0x1496d6['type'][_0x498d('0x42')]};});_0x63e9ea[_0x498d('0x43')]=_[_0x498d('0x3f')](_0x5b45fb,'name');_0x63e9ea['query']=_[_0x498d('0x44')](_0x395aff[_0x498d('0x45')]);_0x63e9ea[_0x498d('0x46')]=_[_0x498d('0x47')](_0x63e9ea['model'],_0x63e9ea[_0x498d('0x45')]);_0x35454e[_0x498d('0x48')]=_[_0x498d('0x47')](_0x63e9ea[_0x498d('0x43')],qs[_0x498d('0x49')](_0x395aff[_0x498d('0x45')][_0x498d('0x49')]));_0x35454e[_0x498d('0x48')]=_0x35454e[_0x498d('0x48')][_0x498d('0x4a')]?_0x35454e['attributes']:_0x63e9ea[_0x498d('0x43')];if(!_0x395aff[_0x498d('0x45')][_0x498d('0x4b')]('nolimit')){_0x35454e['limit']=qs['limit'](_0x395aff['query'][_0x498d('0x33')]);_0x35454e[_0x498d('0x31')]=qs[_0x498d('0x31')](_0x395aff[_0x498d('0x45')][_0x498d('0x31')]);}_0x35454e[_0x498d('0x4c')]=qs[_0x498d('0x4d')](_0x395aff['query'][_0x498d('0x4d')]);_0x35454e[_0x498d('0x4e')]=qs[_0x498d('0x46')](_[_0x498d('0x4f')](_0x395aff[_0x498d('0x45')],_0x63e9ea[_0x498d('0x46')]),_0x5b45fb);if(_0x395aff[_0x498d('0x45')][_0x498d('0x50')]){_0x35454e[_0x498d('0x4e')]=_[_0x498d('0x51')](_0x35454e[_0x498d('0x4e')],{'$or':_['map'](_0x5b45fb,function(_0x505fa1){if(_0x505fa1[_0x498d('0x52')]!=='VIRTUAL'){var _0x3c64a5={};_0x3c64a5[_0x505fa1['name']]={'$like':'%'+_0x395aff[_0x498d('0x45')][_0x498d('0x50')]+'%'};return _0x3c64a5;}})});}_0x35454e=_[_0x498d('0x51')]({},_0x35454e,_0x395aff['options']);var _0x50f520={'where':_0x35454e['where']};return db[_0x498d('0x53')][_0x498d('0x34')](_0x50f520)[_0x498d('0x22')](function(_0x14b2e4){_0x279740[_0x498d('0x34')]=_0x14b2e4;if(_0x395aff['query']['includeAll']){_0x35454e['include']=[{'all':!![]}];}return db[_0x498d('0x53')][_0x498d('0x54')](_0x35454e);})[_0x498d('0x22')](function(_0x298465){_0x279740[_0x498d('0x55')]=_0x298465;return _0x279740;})['then'](respondWithFilteredResult(_0x3df946,_0x35454e))[_0x498d('0x56')](handleError(_0x3df946,null));};exports[_0x498d('0x57')]=function(_0x27e2fe,_0x1352fc){var _0x249a78={'raw':!![],'where':{'id':_0x27e2fe['params']['id']}},_0x1b9e60={};_0x1b9e60[_0x498d('0x43')]=_[_0x498d('0x44')](db[_0x498d('0x53')]['rawAttributes']);_0x1b9e60['query']=_[_0x498d('0x44')](_0x27e2fe['query']);_0x1b9e60[_0x498d('0x46')]=_[_0x498d('0x47')](_0x1b9e60[_0x498d('0x43')],_0x1b9e60[_0x498d('0x45')]);_0x249a78[_0x498d('0x48')]=_[_0x498d('0x47')](_0x1b9e60[_0x498d('0x43')],qs[_0x498d('0x49')](_0x27e2fe[_0x498d('0x45')][_0x498d('0x49')]));_0x249a78[_0x498d('0x48')]=_0x249a78[_0x498d('0x48')][_0x498d('0x4a')]?_0x249a78['attributes']:_0x1b9e60[_0x498d('0x43')];if(_0x27e2fe[_0x498d('0x45')][_0x498d('0x58')]){_0x249a78[_0x498d('0x59')]=[{'all':!![]}];}_0x249a78=_['merge']({},_0x249a78,_0x27e2fe[_0x498d('0x5a')]);return db[_0x498d('0x53')]['find'](_0x249a78)[_0x498d('0x22')](handleEntityNotFound(_0x1352fc,null))[_0x498d('0x22')](respondWithResult(_0x1352fc,null))[_0x498d('0x56')](handleError(_0x1352fc,null));};exports[_0x498d('0x5b')]=function(_0xf86225,_0x10680f){return db[_0x498d('0x53')]['create'](_0xf86225[_0x498d('0x5c')],{})['then'](respondWithResult(_0x10680f,0xc9))[_0x498d('0x56')](handleError(_0x10680f,null));};exports[_0x498d('0x3a')]=function(_0x2fa5c1,_0x2de8dc){if(_0x2fa5c1[_0x498d('0x5c')]['id']){delete _0x2fa5c1['body']['id'];}return db['SmsMessage']['find']({'where':{'id':_0x2fa5c1[_0x498d('0x5d')]['id']}})[_0x498d('0x22')](handleEntityNotFound(_0x2de8dc,null))[_0x498d('0x22')](saveUpdates(_0x2fa5c1[_0x498d('0x5c')],null))[_0x498d('0x22')](respondWithResult(_0x2de8dc,null))[_0x498d('0x56')](handleError(_0x2de8dc,null));};exports[_0x498d('0x3b')]=function(_0x4b0e93,_0xf88828){return db[_0x498d('0x53')][_0x498d('0x5e')]({'where':{'id':_0x4b0e93[_0x498d('0x5d')]['id']}})[_0x498d('0x22')](handleEntityNotFound(_0xf88828,null))['then'](removeEntity(_0xf88828,null))['catch'](handleError(_0xf88828,null));};exports[_0x498d('0x5f')]=function(_0x43426c,_0x5f5d3f){return db['SmsMessage'][_0x498d('0x5f')]()['then'](respondWithResult(_0x5f5d3f,null))[_0x498d('0x56')](handleError(_0x5f5d3f,null));};var interaction_log=require('../../config/logger')(_0x498d('0x60'));exports['accept']=function(_0x3f0d85,_0x45be19,_0x4f668a){var _0x52c7e2={'agent':{},'channel':'sms'};if(_0x3f0d85[_0x498d('0x5c')]['id']){delete _0x3f0d85['body']['id'];}_0x3f0d85[_0x498d('0x5c')]['read']=!![];_0x3f0d85[_0x498d('0x5c')]['readAt']=moment()['format'](_0x498d('0x61'));_0x3f0d85[_0x498d('0x5c')][_0x498d('0x62')]=_0x3f0d85[_0x498d('0x5c')][_0x498d('0x62')]||_0x3f0d85['user']['id'];_0x52c7e2[_0x498d('0x63')]['id']=_0x3f0d85[_0x498d('0x5c')]['UserId'];return db[_0x498d('0x53')][_0x498d('0x5e')]({'where':{'id':_0x3f0d85[_0x498d('0x5d')]['id'],'UserId':null}})[_0x498d('0x22')](handleEntityNotFound(_0x45be19,null))['then'](saveUpdates(_0x3f0d85[_0x498d('0x5c')],null))[_0x498d('0x22')](function(_0x4deea0){if(_0x4deea0){_0x52c7e2['message']=_0x4deea0[_0x498d('0x64')]({'plain':!![]});return db['SmsInteraction']['find']({'where':{'id':_0x4deea0['SmsInteractionId']}});}return null;})[_0x498d('0x22')](handleEntityNotFound(_0x45be19,null))[_0x498d('0x22')](function(_0x4c577d){if(_0x4c577d){return _0x4c577d[_0x498d('0x3a')]({'UserId':_0x3f0d85[_0x498d('0x5c')][_0x498d('0x62')],'read1stAt':_[_0x498d('0x65')](_0x4c577d['read1stAt'])?moment()[_0x498d('0x66')](_0x498d('0x61')):undefined});}return null;})[_0x498d('0x22')](function(_0x461de2){if(_0x461de2){_0x52c7e2['interaction']=_0x461de2[_0x498d('0x64')]({'plain':!![]});interaction_log[_0x498d('0x23')](_0x498d('0x67'),_0x3f0d85[_0x498d('0x68')]['id'],_0x3f0d85[_0x498d('0x68')][_0x498d('0x3d')],_0x3f0d85[_0x498d('0x68')][_0x498d('0x69')],_0x52c7e2[_0x498d('0x6a')]['id'],_0x3f0d85[_0x498d('0x5c')]?JSON['stringify'](_0x3f0d85[_0x498d('0x5c')]):_0x498d('0x6b'));return respondWithRpcPromise(_0x498d('0x6c'),_0x498d('0x6d'),_0x52c7e2);}return null;})[_0x498d('0x22')](function(_0xe17dbe){var _0x410d33='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xe17dbe[_0x498d('0x2b')][_0x498d('0x6e')];return db[_0x498d('0x6f')][_0x498d('0x45')](_0x410d33,{'type':db['Sequelize']['QueryTypes'][_0x498d('0x70')],'raw':!![]})['then'](function(_0x298b9c){return _0x298b9c;});})['then'](function(_0x4a1fae){if(_0x4a1fae){_0x52c7e2[_0x498d('0x2b')][_0x498d('0x71')]=_0x4a1fae[0x0];if(!_0x3f0d85['body']['UserId'])return;return db[_0x498d('0x72')][_0x498d('0x5e')]({'where':{'id':_0x3f0d85[_0x498d('0x5c')][_0x498d('0x62')],'role':_0x498d('0x63')},'attributes':['id','name','fullname',_0x498d('0x73'),_0x498d('0x74')],'raw':!![]});}return null;})['then'](function(_0x883574){if(!_0x883574)return null;_0x52c7e2['message'][_0x498d('0x63')]=_0x883574;return _0x52c7e2;})['then'](function(_0x543479){if(_0x543479){if(_0x3f0d85[_0x498d('0x5c')][_0x498d('0x75')]){_0x52c7e2[_0x498d('0x2b')]['interface']=util['format'](_0x498d('0x76'),_0x3f0d85[_0x498d('0x68')]['name']);_0x52c7e2[_0x498d('0x2b')][_0x498d('0x77')]=_0x52c7e2['channel'];_0x52c7e2[_0x498d('0x2b')][_0x498d('0x78')]=_0x52c7e2['channel'];_0x52c7e2[_0x498d('0x2b')][_0x498d('0x79')]=_0x498d('0x7a');return respondWithRpcPromise(_0x498d('0x7b'),'EventManager',{'event':_0x498d('0x7c'),'message':_0x52c7e2[_0x498d('0x2b')]},client9002)['then'](function(){return _0x52c7e2;});}return _0x52c7e2;}return null;})[_0x498d('0x22')](respondWithResult(_0x45be19,null))[_0x498d('0x56')](handleError(_0x45be19,null));};var interaction_log=require(_0x498d('0x17'))(_0x498d('0x60'));exports['reject']=function(_0x83c7b9,_0xaafe9,_0x3107a4){var _0x1b5907={'agent':{},'channel':_0x498d('0x7d')};if(_0x83c7b9[_0x498d('0x5c')]['id']){delete _0x83c7b9['body']['id'];}_0x83c7b9[_0x498d('0x5c')][_0x498d('0x62')]=_0x83c7b9[_0x498d('0x5c')][_0x498d('0x62')]||_0x83c7b9['user']['id'];_0x1b5907[_0x498d('0x63')]['id']=_0x83c7b9['body'][_0x498d('0x62')];return db[_0x498d('0x53')][_0x498d('0x5e')]({'where':{'id':_0x83c7b9[_0x498d('0x5d')]['id'],'UserId':null}})[_0x498d('0x22')](handleEntityNotFound(_0xaafe9,null))[_0x498d('0x22')](function(_0xcc88c7){if(_0xcc88c7){_0x1b5907[_0x498d('0x2b')]=_0xcc88c7[_0x498d('0x64')]({'plain':!![]});return db[_0x498d('0x7e')]['find']({'where':{'id':_0xcc88c7[_0x498d('0x7f')]}});}return null;})[_0x498d('0x22')](handleEntityNotFound(_0xaafe9,null))[_0x498d('0x22')](function(_0x396eed){if(_0x396eed){_0x1b5907[_0x498d('0x6a')]=_0x396eed[_0x498d('0x64')]({'plain':!![]});interaction_log[_0x498d('0x23')](_0x498d('0x80'),_0x83c7b9[_0x498d('0x68')]['id'],_0x83c7b9[_0x498d('0x68')][_0x498d('0x3d')],_0x83c7b9[_0x498d('0x68')]['role'],_0x1b5907[_0x498d('0x6a')]['id'],_0x83c7b9[_0x498d('0x5c')]?JSON['stringify'](_0x83c7b9[_0x498d('0x5c')]):_0x498d('0x6b'));return respondWithRpcPromise(_0x498d('0x81'),_0x498d('0x82'),_0x1b5907);}return null;})[_0x498d('0x22')](function(_0x50d28e){var _0xda558a=_0x498d('0x83')+_0x50d28e[_0x498d('0x2b')][_0x498d('0x6e')];return db[_0x498d('0x6f')]['query'](_0xda558a,{'type':db[_0x498d('0x84')][_0x498d('0x85')]['SELECT'],'raw':!![]})['then'](function(_0x1910cb){return _0x1910cb;});})[_0x498d('0x22')](function(_0x48816f){if(_0x48816f){_0x1b5907['message'][_0x498d('0x71')]=_0x48816f[0x0];if(!_0x83c7b9['body'][_0x498d('0x62')])return;return db['User'][_0x498d('0x5e')]({'where':{'id':_0x83c7b9['body'][_0x498d('0x62')],'role':_0x498d('0x63')},'attributes':['id',_0x498d('0x3d'),_0x498d('0x86'),_0x498d('0x73'),_0x498d('0x74')],'raw':!![]});}return null;})['then'](function(_0x23c5f1){if(!_0x23c5f1)return null;_0x1b5907[_0x498d('0x2b')][_0x498d('0x63')]=_0x23c5f1;return _0x1b5907;})['then'](function(_0x2e475c){if(_0x2e475c){_0x2e475c[_0x498d('0x2b')][_0x498d('0x87')]=util[_0x498d('0x66')]('SIP/%s',_0x83c7b9[_0x498d('0x68')][_0x498d('0x3d')]);_0x2e475c[_0x498d('0x2b')][_0x498d('0x77')]=_0x1b5907[_0x498d('0x77')];_0x2e475c[_0x498d('0x2b')][_0x498d('0x78')]=_0x1b5907[_0x498d('0x77')];_0x2e475c[_0x498d('0x2b')][_0x498d('0x79')]=_0x498d('0x38');respondWithRpcPromise(_0x498d('0x7b'),_0x498d('0x7b'),{'event':_0x498d('0x88'),'message':_0x2e475c[_0x498d('0x2b')]},client9002);return _0x1b5907;}return null;})[_0x498d('0x22')](respondWithResult(_0xaafe9,null))['catch'](handleError(_0xaafe9,null));};exports['status']=function(_0x50a958,_0x375a90,_0x2cd5b8){if(_0x50a958['body']['id']){delete _0x50a958['body']['id'];}var _0x55e6a7;return db[_0x498d('0x53')]['find']({'where':{'id':_0x50a958[_0x498d('0x5d')]['id']}})[_0x498d('0x22')](handleEntityNotFound(_0x375a90,null))['then'](function(_0x86c257){if(_0x86c257){_0x55e6a7=_0x86c257;return db[_0x498d('0x89')][_0x498d('0x5e')]({'where':{'id':_0x86c257[_0x498d('0x8a')]}});}})['then'](handleEntityNotFound(_0x375a90,null))[_0x498d('0x22')](function(_0x1c4d3a){if(_0x1c4d3a){logger[_0x498d('0x26')](_0x498d('0x27'),'status',_0x498d('0x8b'),_0x1c4d3a[_0x498d('0x52')],util[_0x498d('0x8c')](_0x50a958['body'],{'showHidden':![],'depth':null}));switch(_0x1c4d3a['type']){case _0x498d('0x8d'):if(_0x50a958[_0x498d('0x5c')][_0x498d('0x8e')]&&_0x50a958['body'][_0x498d('0x8e')]===_0x55e6a7['messageId']){return _0x55e6a7['update']({'read':!![]});}else{logger[_0x498d('0x29')](_0x498d('0x8f'),'status',_0x498d('0x8d'),util[_0x498d('0x8c')](_0x50a958[_0x498d('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x498d('0x90'):if(_0x50a958[_0x498d('0x5c')][_0x498d('0x91')]&&_0x50a958[_0x498d('0x5c')]['MessageUUID']===_0x55e6a7['messageId']&&_[_0x498d('0x92')]([_0x498d('0x93'),_0x498d('0x94')],_0x50a958[_0x498d('0x5c')][_0x498d('0x95')])>=0x0){return _0x55e6a7[_0x498d('0x3a')]({'read':!![]});}else{logger[_0x498d('0x29')](_0x498d('0x8f'),_0x498d('0x2f'),_0x498d('0x96'),util['inspect'](_0x50a958['body'],{'showHidden':![],'depth':null}));}break;case _0x498d('0x97'):var _0x4d2698=_0x50a958[_0x498d('0x5c')][_0x498d('0x98')][0x0];if(_0x4d2698[_0x498d('0x2f')][_0x498d('0x99')]==='DELIVERED'){return _0x55e6a7[_0x498d('0x3a')]({'read':!![]});}else{logger[_0x498d('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x498d('0x2f'),_0x498d('0x97'),util[_0x498d('0x8c')](_0x50a958['body'],{'showHidden':![],'depth':null}));}break;}return _0x55e6a7;}})['then'](respondWithResult(_0x375a90,null))[_0x498d('0x56')](handleError(_0x375a90,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 36c4b45..174a651 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 _0xfebe=['save','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners'];(function(_0x49a84b,_0x17c1be){var _0x171650=function(_0x1cc9cf){while(--_0x1cc9cf){_0x49a84b['push'](_0x49a84b['shift']());}};_0x171650(++_0x17c1be);}(_0xfebe,0x1be));var _0xefeb=function(_0x3af384,_0x2b2160){_0x3af384=_0x3af384-0x0;var _0x194aad=_0xfebe[_0x3af384];return _0x194aad;};'use strict';var EventEmitter=require(_0xefeb('0x0'));var SmsMessage=require(_0xefeb('0x1'))['db'][_0xefeb('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xefeb('0x3')](0x0);var events={'afterCreate':_0xefeb('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x374f3d){return function(_0x336c14,_0xf7909f,_0x565681){SmsMessageEvents[_0xefeb('0x5')](_0x374f3d+':'+_0x336c14['id'],_0x336c14);SmsMessageEvents[_0xefeb('0x5')](_0x374f3d,_0x336c14);_0x565681(null);};}for(var e in events){if(events[_0xefeb('0x6')](e)){var event=events[e];SmsMessage[_0xefeb('0x7')](e,emitEvent(event));}}module[_0xefeb('0x8')]=SmsMessageEvents; \ No newline at end of file +var _0x8265=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','update'];(function(_0x46c853,_0x7cb710){var _0x1a14f2=function(_0x4b0b39){while(--_0x4b0b39){_0x46c853['push'](_0x46c853['shift']());}};_0x1a14f2(++_0x7cb710);}(_0x8265,0xf4));var _0x5826=function(_0x2f5379,_0x15f97a){_0x2f5379=_0x2f5379-0x0;var _0x3b2237=_0x8265[_0x2f5379];return _0x3b2237;};'use strict';var EventEmitter=require(_0x5826('0x0'));var SmsMessage=require(_0x5826('0x1'))['db'][_0x5826('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x5826('0x3')](0x0);var events={'afterCreate':_0x5826('0x4'),'afterUpdate':_0x5826('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3194ed){return function(_0x3070ea,_0x59f636,_0x90db7){SmsMessageEvents[_0x5826('0x6')](_0x3194ed+':'+_0x3070ea['id'],_0x3070ea);SmsMessageEvents[_0x5826('0x6')](_0x3194ed,_0x3070ea);_0x90db7(null);};}for(var e in events){if(events[_0x5826('0x7')](e)){var event=events[e];SmsMessage[_0x5826('0x8')](e,emitEvent(event));}}module[_0x5826('0x9')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index c7468ae..76b5d97 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 _0x2b31=['twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','GET','split','POST','session_key','total_sent','internal_order_id','deliveryReport','skebby','inspect','senderString','requestid','read','connectel','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','queued_count','head','data','message_id','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','crypto','apiKey','login','text','timestamp','keys','length','createHash','digest','hex','signature=','/external/get/send.php?','id_sms','csc','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','uuid','UTF-8','clickatell','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','Missing\x20parameters:\x20username,\x20password','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','refid','status','Token\x20not\x20received','finally','lodash','api','moment','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','SmsInteraction','findOne','SmsInteractionId','then','update','createdAt','catch','error','SmsAccount','find','SmsAccountId','type','accountSid','phone','authToken','messages','remote','/api/sms/messages/','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate'];(function(_0x2f0a42,_0x406e8c){var _0x273b18=function(_0x485348){while(--_0x485348){_0x2f0a42['push'](_0x2f0a42['shift']());}};_0x273b18(++_0x406e8c);}(_0x2b31,0x152));var _0x12b3=function(_0xb58634,_0x5d95ae){_0xb58634=_0xb58634-0x0;var _0x4a1f4e=_0x2b31[_0xb58634];return _0x4a1f4e;};'use strict';var _=require(_0x12b3('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x12b3('0x1'));var moment=require(_0x12b3('0x2'));var BPromise=require('bluebird');var rp=require(_0x12b3('0x3'));var fs=require('fs');var path=require(_0x12b3('0x4'));var rimraf=require(_0x12b3('0x5'));var config=require(_0x12b3('0x6'));var attributes=require(_0x12b3('0x7'));module['exports']=function(_0x198139,_0x1553bb){return _0x198139[_0x12b3('0x8')](_0x12b3('0x9'),attributes,{'tableName':_0x12b3('0xa'),'paranoid':![],'indexes':[{'name':_0x12b3('0xb'),'fields':[_0x12b3('0xb')]},{'name':_0x12b3('0xc'),'fields':[_0x12b3('0xd')],'type':_0x12b3('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4e2176,_0xadc9bc,_0x5d5acc){var _0x941bfb=_0x198139[_0x12b3('0xf')];var _0x1ae543=_0x4e2176[_0x12b3('0x10')]({'plain':!![]});if(_0x1ae543[_0x12b3('0x11')][_0x12b3('0x12')]()==='in'||_0x1ae543[_0x12b3('0x11')][_0x12b3('0x12')]()===_0x12b3('0x13')&&!_0x1ae543[_0x12b3('0x14')]&&!_[_0x12b3('0x15')](_0x1ae543[_0x12b3('0x16')])&&!_[_0x12b3('0x15')](_0x1ae543['SmsInteractionId'])){_0x941bfb[_0x12b3('0x17')][_0x12b3('0x18')]({'where':{'id':_0x1ae543[_0x12b3('0x19')]}})[_0x12b3('0x1a')](function(_0xb640af){if(_0xb640af){_0xb640af[_0x12b3('0x1b')]({'lastMsgAt':_0x1ae543[_0x12b3('0x1c')],'lastMsgDirection':_0x1ae543[_0x12b3('0x11')][_0x12b3('0x12')]()});}})[_0x12b3('0x1d')](function(_0x3bc0e6){console[_0x12b3('0x1e')](_0x3bc0e6);});}if(_0x1ae543[_0x12b3('0x11')]===_0x12b3('0x13')&&!_0x1ae543[_0x12b3('0x14')]){var _0x56c885;_0x941bfb[_0x12b3('0x1f')][_0x12b3('0x20')]({'where':{'id':_0x1ae543[_0x12b3('0x21')]},'raw':!![]})[_0x12b3('0x1a')](function(_0x5d4d9c){_0x56c885=_0x5d4d9c;if(_0x56c885&&_0x56c885[_0x12b3('0x22')]){switch(_0x56c885[_0x12b3('0x22')]){case'twilio':var _0x313f98=require('twilio');if(_0x56c885[_0x12b3('0x23')]&&_0x56c885['authToken']&&_0x56c885[_0x12b3('0x24')]){var _0x514954=new _0x313f98(_0x56c885['accountSid'],_0x56c885[_0x12b3('0x25')]);_0x514954[_0x12b3('0x26')]['create']({'body':_0x1ae543['body'],'to':_0x1ae543[_0x12b3('0x24')],'from':_0x56c885[_0x12b3('0x24')],'statusCallback':_0x56c885[_0x12b3('0x27')]+_0x12b3('0x28')+_0x1ae543['id']+_0x12b3('0x29')+_0x56c885[_0x12b3('0x2a')]})[_0x12b3('0x1a')](function(_0x3926bb){if(_0x3926bb['sid']){return _0x4e2176[_0x12b3('0x1b')]({'messageId':_0x3926bb[_0x12b3('0x2b')]});}})[_0x12b3('0x1d')](function(_0x456ffd){logger[_0x12b3('0x1e')](_0x12b3('0x2c'),_0x12b3('0x2d'),_0x12b3('0x2e'),util['inspect'](_0x456ffd,{'showHidden':![],'depth':null}));});}else{logger[_0x12b3('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x12b3('0x2e'),_0x12b3('0x2f'));}break;case'skebby':var _0x1cf44b=_0x12b3('0x30');if(_0x56c885[_0x12b3('0x31')]&&_0x56c885[_0x12b3('0x32')]){var _0x54da35={'recipient':[_0x1ae543['phone']],'message':_0x1ae543['body'],'message_type':_0x56c885[_0x12b3('0x33')]};if(_0x56c885[_0x12b3('0x33')]&&_0x56c885[_0x12b3('0x33')]!=='SI'){_0x54da35[_0x12b3('0x34')]=_0x56c885[_0x12b3('0x24')];}var _0x22a35a={'url':_0x1cf44b+_0x12b3('0x35')+_0x56c885[_0x12b3('0x31')]+'&password='+_0x56c885[_0x12b3('0x32')],'method':_0x12b3('0x36')};rp(_0x22a35a)[_0x12b3('0x1a')](function(_0x1937b0){var _0x4d7dec=_0x1937b0[_0x12b3('0x37')](';');var _0x1b5f08={'user_key':_0x4d7dec[0x0],'session_key':_0x4d7dec[0x1]};_0x22a35a={'url':_0x1cf44b+'sms','method':_0x12b3('0x38'),'headers':{'user_key':_0x1b5f08['user_key'],'Session_key':_0x1b5f08[_0x12b3('0x39')]},'json':!![],'body':_0x54da35};return rp(_0x22a35a);})['then'](function(_0xf11b1a){if(_0xf11b1a[_0x12b3('0x3a')]>=0x1){var _0x3e8feb={'messageId':_0xf11b1a[_0x12b3('0x3b')]};if(_0x56c885['smsMethod']!=='GP'||!_0x56c885[_0x12b3('0x3c')]){_0x3e8feb['read']=!![];}return _0x4e2176['update'](_0x3e8feb);}else{return logger[_0x12b3('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x12b3('0x2d'),_0x12b3('0x3d'),util[_0x12b3('0x3e')](_0xf11b1a,{'showHidden':![],'depth':null}));}})[_0x12b3('0x1d')](function(_0x362356){return logger[_0x12b3('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x12b3('0x2d'),_0x12b3('0x3d'),util[_0x12b3('0x3e')](_0x362356,{'showHidden':![],'depth':null}));});}else{logger[_0x12b3('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x12b3('0x2d'),_0x12b3('0x3d'),'Missing\x20parameters:\x20username,\x20password');}break;case'connectel':if(_0x56c885['authToken']){var _0x2947b4={'recipient':_0x1ae543[_0x12b3('0x24')],'message':_0x1ae543['body'],'sender':_0x56c885[_0x12b3('0x3f')]||_0x56c885[_0x12b3('0x24')],'authorization':_0x56c885['authToken']};var _0xadc9bc={'method':_0x12b3('0x38'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x2947b4,'json':!![]};rp(_0xadc9bc)['then'](function(_0x1bca8a){var _0x21a963={'messageId':_0x1bca8a[_0x12b3('0x40')]};if(!_0x56c885[_0x12b3('0x3c')]){_0x21a963[_0x12b3('0x41')]=!![];}return _0x4e2176['update'](_0x21a963);})[_0x12b3('0x1d')](function(_0x2f623c){logger[_0x12b3('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x12b3('0x42'),util['inspect'](_0x2f623c,{'showHidden':![],'depth':null}));});}else{logger[_0x12b3('0x1e')](_0x12b3('0x2c'),_0x12b3('0x2d'),_0x12b3('0x42'),_0x12b3('0x43'));}break;case _0x12b3('0x44'):if(_0x56c885['username']&&_0x56c885[_0x12b3('0x32')]){var _0x2947b4={'messages':[{'source':_0x12b3('0x45'),'to':_0x1ae543['phone'],'body':_0x1ae543[_0x12b3('0xd')],'from':_0x56c885[_0x12b3('0x3f')]||_0x56c885[_0x12b3('0x24')]}]};var _0x1e472a=util[_0x12b3('0x46')](_0x12b3('0x47'),_0x56c885[_0x12b3('0x31')],_0x56c885[_0x12b3('0x32')]);var _0xadc9bc={'method':'POST','uri':_0x12b3('0x48'),'body':_0x2947b4,'headers':{'Authorization':util[_0x12b3('0x46')](_0x12b3('0x49'),new Buffer(_0x1e472a)[_0x12b3('0x4a')](_0x12b3('0x4b')))},'json':!![]};rp(_0xadc9bc)[_0x12b3('0x1a')](function(_0x180a3b){if(_0x180a3b['http_code']>=0xc8&&_0x180a3b[_0x12b3('0x4c')]<=0xce){if(_0x180a3b['data']&&_0x180a3b['data'][_0x12b3('0x4d')]>0x0){var _0x43c7f0=_[_0x12b3('0x4e')](_0x180a3b[_0x12b3('0x4f')]['messages']);var _0x238432={'messageId':_0x43c7f0[_0x12b3('0x50')]};if(!_0x56c885[_0x12b3('0x3c')]){_0x238432[_0x12b3('0x41')]=!![];}return _0x4e2176[_0x12b3('0x1b')](_0x238432);}else{logger['error'](_0x12b3('0x2c'),_0x12b3('0x2d'),_0x12b3('0x51'),util['inspect'](_0x180a3b,{'showHidden':![],'depth':null}));}}else{logger[_0x12b3('0x1e')](_0x12b3('0x2c'),'afterCreate','clickSend',util['inspect'](_0x180a3b,{'showHidden':![],'depth':null}));}})['catch'](function(_0x1149c4){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x12b3('0x2d'),'clickSend',util[_0x12b3('0x3e')](_0x1149c4,{'showHidden':![],'depth':null}));});}else{logger[_0x12b3('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x12b3('0x2d'),_0x12b3('0x51'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x12b3('0x52'):if(_0x56c885[_0x12b3('0x53')]&&_0x56c885['authToken']){var _0x2947b4={'dst':_0x1ae543[_0x12b3('0x24')],'text':_0x1ae543[_0x12b3('0xd')],'src':_0x56c885[_0x12b3('0x3f')]||_0x56c885[_0x12b3('0x24')],'url':_0x56c885['remote']+'/api/sms/messages/'+_0x1ae543['id']+'/status?token='+_0x56c885[_0x12b3('0x2a')]};var _0x1e472a=util[_0x12b3('0x46')](_0x12b3('0x47'),_0x56c885[_0x12b3('0x53')],_0x56c885[_0x12b3('0x25')]);var _0xadc9bc={'method':_0x12b3('0x38'),'uri':util[_0x12b3('0x46')](_0x12b3('0x54'),_0x56c885['authId']),'body':_0x2947b4,'headers':{'Authorization':util[_0x12b3('0x46')](_0x12b3('0x49'),new Buffer(_0x1e472a)['toString'](_0x12b3('0x4b')))},'json':!![]};rp(_0xadc9bc)['then'](function(_0x285694){var _0x22a171={'messageId':_0x285694[_0x12b3('0x55')][0x0]};return _0x4e2176[_0x12b3('0x1b')](_0x22a171);})['catch'](function(_0x7adb2f){logger['error'](_0x12b3('0x2c'),'afterCreate',_0x12b3('0x52'),util['inspect'](_0x7adb2f,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x12b3('0x2d'),_0x12b3('0x52'),_0x12b3('0x56'));}break;case _0x12b3('0x57'):if(_0x56c885['username']&&_0x56c885[_0x12b3('0x32')]){if(_0x56c885[_0x12b3('0x58')]){var _0xf2fa6c={'method':_0x12b3('0x38'),'uri':_0x56c885['baseUrl']+_0x12b3('0x59'),'body':{'username':_0x56c885['username'],'password':_0x56c885[_0x12b3('0x32')]},'json':!![]};return rp(_0xf2fa6c)['then'](function(_0xc9d1df){var _0x509a35={'method':_0x12b3('0x38'),'uri':_0x56c885[_0x12b3('0x58')]+_0x12b3('0x5a'),'body':{'messages':[{'from':_0x56c885[_0x12b3('0x24')],'destinations':[{'to':_0x1ae543[_0x12b3('0x24')]}],'text':_0x1ae543['body'],'notifyUrl':_0x56c885['remote']+_0x12b3('0x28')+_0x1ae543['id']+_0x12b3('0x29')+_0x56c885[_0x12b3('0x2a')],'notifyContentType':_0x12b3('0x5b'),'callbackData':_0x56c885[_0x12b3('0x24')]+';'+_0x1ae543['body']}]},'headers':{'Authorization':_0x12b3('0x5c')+_0xc9d1df['token']},'json':!![]};return rp(_0x509a35)[_0x12b3('0x1a')](function(_0x2f18ab){if(_0x2f18ab[_0x12b3('0x26')]){var _0x540e59={'messageId':_0x2f18ab[_0x12b3('0x26')][0x0][_0x12b3('0xb')]};if(!_0x56c885[_0x12b3('0x3c')]){_0x540e59[_0x12b3('0x41')]=!![];}return _0x4e2176[_0x12b3('0x1b')](_0x540e59);}else{return logger['error'](_0x12b3('0x2c'),_0x12b3('0x2d'),_0x12b3('0x57'),util['inspect'](_0x2f18ab,{'showHidden':![],'depth':null}));}});})[_0x12b3('0x1d')](function(_0x42b72f){return logger[_0x12b3('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x12b3('0x2d'),_0x12b3('0x57'),util['inspect'](_0x42b72f,{'showHidden':![],'depth':null}));});}else{logger[_0x12b3('0x1e')](_0x12b3('0x2c'),_0x12b3('0x2d'),_0x12b3('0x57'),_0x12b3('0x5d'));}}else{logger[_0x12b3('0x1e')](_0x12b3('0x2c'),'afterCreate','infobip','Missing\x20parameters:\x20username,\x20password');}break;case'csc':var _0x5feb08=require(_0x12b3('0x5e'));if(_0x56c885[_0x12b3('0x5f')]){var _0x4ba17d={};_0x4ba17d[_0x12b3('0x60')]=_0x56c885[_0x12b3('0x31')];_0x4ba17d[_0x12b3('0x24')]=_0x1ae543['phone'];_0x4ba17d[_0x12b3('0x34')]=_0x56c885[_0x12b3('0x24')];_0x4ba17d[_0x12b3('0x61')]=_0x1ae543[_0x12b3('0xd')];_0x4ba17d[_0x12b3('0x62')]=+new Date();var _0x16c7a3='';var _0x151685='';var _0x36ff36=Object[_0x12b3('0x63')](_0x4ba17d);_0x36ff36['sort']();for(var _0x4af061=0x0;_0x4af061<_0x36ff36[_0x12b3('0x64')];_0x4af061++){if(_0x16c7a3!=''){_0x16c7a3+='&';}_0x16c7a3+=_0x36ff36[_0x4af061]+'='+encodeURIComponent(_0x4ba17d[_0x36ff36[_0x4af061]]);_0x151685+=_0x4ba17d[_0x36ff36[_0x4af061]];}_0x151685+=_0x56c885[_0x12b3('0x5f')];_0x151685=_0x5feb08[_0x12b3('0x65')]('md5')[_0x12b3('0x1b')](_0x151685)[_0x12b3('0x66')](_0x12b3('0x67'));if(_0x16c7a3!==''){_0x16c7a3+='&';}_0x16c7a3+=_0x12b3('0x68')+_0x151685;var _0x22a35a={'method':_0x12b3('0x36'),'uri':_0x56c885['baseUrl']+_0x12b3('0x69')+_0x16c7a3,'json':!![]};return rp(_0x22a35a)[_0x12b3('0x1a')](function(_0x29a752){var _0x3b3c32=Object['keys'](_0x29a752);if(_0x29a752[_0x3b3c32[0x0]][_0x12b3('0x1e')]&&parseInt(_0x29a752[_0x3b3c32[0x0]]['error'])===0x0){var _0x5e2180={'messageId':_0x29a752[_0x3b3c32[0x0]][_0x12b3('0x6a')]};if(!_0x56c885[_0x12b3('0x3c')]){_0x5e2180[_0x12b3('0x41')]=!![];}return _0x4e2176[_0x12b3('0x1b')](_0x5e2180);}else{return logger[_0x12b3('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x12b3('0x2d'),_0x12b3('0x6b'),util[_0x12b3('0x3e')](_0x29a752[_0x12b3('0x1e')],{'showHidden':![],'depth':null}));}})[_0x12b3('0x1d')](function(_0x33fdc4){return logger[_0x12b3('0x1e')](_0x12b3('0x2c'),_0x12b3('0x2d'),'csc',util[_0x12b3('0x3e')](_0x33fdc4,{'showHidden':![],'depth':null}));});}else{logger[_0x12b3('0x1e')](_0x12b3('0x2c'),_0x12b3('0x2d'),_0x12b3('0x6b'),_0x12b3('0x6c'));}break;case'clickatell':if(_0x56c885['apiKey']){var _0xe1712f={'method':'POST','uri':_0x12b3('0x6d'),'headers':{'Authorization':_0x56c885[_0x12b3('0x5f')]},'body':{'content':_0x1ae543[_0x12b3('0xd')],'to':[_0x1ae543[_0x12b3('0x24')]],'from':_0x56c885[_0x12b3('0x24')],'binary':![],'clientMessageId':_0x12b3('0x6e'),'charset':_0x12b3('0x6f')},'json':!![]};rp(_0xe1712f)[_0x12b3('0x1a')](function(_0x243e00){if(!_0x243e00[_0x12b3('0x1e')]){var _0x2d0d95={'messageId':_0x243e00['messages'][0x0]['apiMessageId']};if(!_0x56c885[_0x12b3('0x3c')]){_0x2d0d95['read']=!![];}return _0x4e2176['update'](_0x2d0d95);}else{return logger[_0x12b3('0x1e')](_0x12b3('0x2c'),_0x12b3('0x2d'),_0x12b3('0x70'),util[_0x12b3('0x3e')](_0x243e00[_0x12b3('0x1e')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x467eb0){return logger[_0x12b3('0x1e')](_0x12b3('0x2c'),'afterCreate','clickatell',util[_0x12b3('0x3e')](_0x467eb0,{'showHidden':![],'depth':null}));});}else{logger[_0x12b3('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x12b3('0x2d'),_0x12b3('0x70'),'Missing\x20parameters:\x20apiKey');}break;case _0x12b3('0x71'):if(_0x56c885[_0x12b3('0x31')]&&_0x56c885[_0x12b3('0x32')]){var _0x1e472a=util['format'](_0x12b3('0x47'),_0x56c885[_0x12b3('0x31')],_0x56c885[_0x12b3('0x32')]);var _0xadc9bc={'method':_0x12b3('0x38'),'uri':_0x12b3('0x72')+_0x56c885[_0x12b3('0x73')]+_0x12b3('0x74'),'body':{'to':[_0x1ae543['phone']],'text':_0x1ae543[_0x12b3('0xd')],'from':_0x56c885[_0x12b3('0x24')],'applicationId':_0x56c885[_0x12b3('0x75')]},'headers':{'Authorization':util[_0x12b3('0x46')]('Basic\x20%s',new Buffer(_0x1e472a)[_0x12b3('0x4a')]('base64'))},'json':!![]};rp(_0xadc9bc)[_0x12b3('0x1a')](function(_0x26dc19){if(_0x26dc19['id']){var _0x46a997={'messageId':_0x26dc19['id']};return _0x4e2176[_0x12b3('0x1b')](_0x46a997);}else{logger[_0x12b3('0x1e')](_0x12b3('0x2c'),'afterCreate',_0x12b3('0x71'),util[_0x12b3('0x3e')](_0x26dc19,{'showHidden':![],'depth':null}));}})[_0x12b3('0x1d')](function(_0x8c5046){logger[_0x12b3('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x12b3('0x2d'),_0x12b3('0x71'),util[_0x12b3('0x3e')](_0x8c5046,{'showHidden':![],'depth':null}));});}else{logger[_0x12b3('0x1e')](_0x12b3('0x2c'),_0x12b3('0x2d'),_0x12b3('0x71'),_0x12b3('0x76'));}break;case _0x12b3('0x77'):if(_0x56c885['apiKey']){var _0x498b3d={};var _0x22a35a={'method':'POST','uri':_0x12b3('0x78'),'headers':{'Authorization':'Bearer\x20'+_0x56c885['apiKey'],'Content-Type':_0x12b3('0x5b')},'body':{'from':_0x56c885[_0x12b3('0x24')],'to':_0x1ae543[_0x12b3('0x24')],'text':_0x1ae543[_0x12b3('0xd')]},'json':!![]};return rp(_0x22a35a)[_0x12b3('0x1a')](function(_0x32cc59){if(_0x32cc59['code']==0xca){_0x498b3d[_0x12b3('0x79')]=_0x32cc59;var _0x575b38={'method':_0x12b3('0x38'),'uri':_0x12b3('0x7a'),'headers':{'Authorization':_0x12b3('0x7b')+_0x56c885[_0x12b3('0x5f')],'Content-Type':_0x12b3('0x5b')},'body':{'refid':_0x498b3d['message'][_0x12b3('0x7c')]},'json':!![]};return rp(_0x575b38)[_0x12b3('0x1a')](function(_0x4f600e){_0x498b3d[_0x12b3('0x7d')]=_0x4f600e;var _0x274ab2={'messageId':_0x498b3d[_0x12b3('0x79')][_0x12b3('0x7c')],'read':!![]};return _0x4e2176['update'](_0x274ab2);});}else{return logger['error'](_0x12b3('0x2c'),'afterCreate',_0x12b3('0x77'),util[_0x12b3('0x3e')](_0x32cc59,{'showHidden':![],'depth':null}));}})['catch'](function(_0x25ee84){return logger['error'](_0x12b3('0x2c'),_0x12b3('0x2d'),_0x12b3('0x77'),util[_0x12b3('0x3e')](_0x25ee84,{'showHidden':![],'depth':null}));});}else{return logger[_0x12b3('0x1e')](_0x12b3('0x2c'),_0x12b3('0x2d'),_0x12b3('0x77'),_0x12b3('0x7e'));}break;}}})[_0x12b3('0x7f')](function(){_0x5d5acc();});}else{_0x5d5acc();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x2820=['https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','clickatell','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','bandwidth','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','status','refid','intelepeer','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','SmsInteractionId','update','catch','error','SmsAccount','find','SmsAccountId','then','type','twilio','accountSid','authToken','messages','create','phone','remote','/api/sms/messages/','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','https://api.skebby.it/API/v1.0/REST/','username','smsMethod','sender','login?username=','password','GET','split','sms','POST','user_key','session_key','deliveryReport','read','inspect','skebby','Missing\x20parameters:\x20username,\x20password','connectel','requestid','xCALLY\x20Motion','senderString','format','%s:%s','https://rest.clicksend.com/v3/sms/send','base64','http_code','data','queued_count','head','message_id','clickSend','plivo','authId','Basic\x20%s','toString','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','csc','crypto','login','text','keys','sort','length','apiKey','createHash','md5','id_sms','Missing\x20parameters:\x20apiKey'];(function(_0x2fcda2,_0x428a8e){var _0x466965=function(_0x386fa8){while(--_0x386fa8){_0x2fcda2['push'](_0x2fcda2['shift']());}};_0x466965(++_0x428a8e);}(_0x2820,0x8b));var _0x0282=function(_0x5c3b05,_0x436794){_0x5c3b05=_0x5c3b05-0x0;var _0x221f26=_0x2820[_0x5c3b05];return _0x221f26;};'use strict';var _=require('lodash');var util=require(_0x0282('0x0'));var logger=require(_0x0282('0x1'))(_0x0282('0x2'));var moment=require('moment');var BPromise=require(_0x0282('0x3'));var rp=require(_0x0282('0x4'));var fs=require('fs');var path=require(_0x0282('0x5'));var rimraf=require(_0x0282('0x6'));var config=require(_0x0282('0x7'));var attributes=require(_0x0282('0x8'));module[_0x0282('0x9')]=function(_0x3346d0,_0x2acb21){return _0x3346d0[_0x0282('0xa')](_0x0282('0xb'),attributes,{'tableName':_0x0282('0xc'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x0282('0xd')]},{'name':'fti_sms_messages','fields':[_0x0282('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x357e73,_0x4f5c56,_0x316bfd){var _0x252b3a=_0x3346d0[_0x0282('0xf')];var _0x52ceff=_0x357e73[_0x0282('0x10')]({'plain':!![]});if(_0x52ceff[_0x0282('0x11')][_0x0282('0x12')]()==='in'||_0x52ceff[_0x0282('0x11')][_0x0282('0x12')]()===_0x0282('0x13')&&!_0x52ceff[_0x0282('0x14')]&&!_[_0x0282('0x15')](_0x52ceff[_0x0282('0x16')])&&!_[_0x0282('0x15')](_0x52ceff[_0x0282('0x17')])){_0x252b3a['SmsInteraction']['findOne']({'where':{'id':_0x52ceff[_0x0282('0x17')]}})['then'](function(_0xc63aaa){if(_0xc63aaa){_0xc63aaa[_0x0282('0x18')]({'lastMsgAt':_0x52ceff['createdAt'],'lastMsgDirection':_0x52ceff[_0x0282('0x11')][_0x0282('0x12')]()});}})[_0x0282('0x19')](function(_0x54b1a0){console[_0x0282('0x1a')](_0x54b1a0);});}if(_0x52ceff['direction']==='out'&&!_0x52ceff[_0x0282('0x14')]){var _0x50fd01;_0x252b3a[_0x0282('0x1b')][_0x0282('0x1c')]({'where':{'id':_0x52ceff[_0x0282('0x1d')]},'raw':!![]})[_0x0282('0x1e')](function(_0x28c97c){_0x50fd01=_0x28c97c;if(_0x50fd01&&_0x50fd01[_0x0282('0x1f')]){switch(_0x50fd01[_0x0282('0x1f')]){case _0x0282('0x20'):var _0x25b09a=require('twilio');if(_0x50fd01[_0x0282('0x21')]&&_0x50fd01[_0x0282('0x22')]&&_0x50fd01['phone']){var _0x2bb7ce=new _0x25b09a(_0x50fd01[_0x0282('0x21')],_0x50fd01[_0x0282('0x22')]);_0x2bb7ce[_0x0282('0x23')][_0x0282('0x24')]({'body':_0x52ceff[_0x0282('0xe')],'to':_0x52ceff['phone'],'from':_0x50fd01[_0x0282('0x25')],'statusCallback':_0x50fd01[_0x0282('0x26')]+_0x0282('0x27')+_0x52ceff['id']+_0x0282('0x28')+_0x50fd01[_0x0282('0x29')]})[_0x0282('0x1e')](function(_0x16a86b){if(_0x16a86b[_0x0282('0x2a')]){return _0x357e73['update']({'messageId':_0x16a86b[_0x0282('0x2a')]});}})[_0x0282('0x19')](function(_0x22143d){logger[_0x0282('0x1a')](_0x0282('0x2b'),_0x0282('0x2c'),_0x0282('0x20'),util['inspect'](_0x22143d,{'showHidden':![],'depth':null}));});}else{logger[_0x0282('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0282('0x2c'),_0x0282('0x20'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case'skebby':var _0x3f679f=_0x0282('0x2d');if(_0x50fd01[_0x0282('0x2e')]&&_0x50fd01['password']){var _0x89d537={'recipient':[_0x52ceff['phone']],'message':_0x52ceff[_0x0282('0xe')],'message_type':_0x50fd01['smsMethod']};if(_0x50fd01[_0x0282('0x2f')]&&_0x50fd01[_0x0282('0x2f')]!=='SI'){_0x89d537[_0x0282('0x30')]=_0x50fd01[_0x0282('0x25')];}var _0x1998ab={'url':_0x3f679f+_0x0282('0x31')+_0x50fd01[_0x0282('0x2e')]+'&password='+_0x50fd01[_0x0282('0x32')],'method':_0x0282('0x33')};rp(_0x1998ab)[_0x0282('0x1e')](function(_0x4d35de){var _0x358b32=_0x4d35de[_0x0282('0x34')](';');var _0x1cae14={'user_key':_0x358b32[0x0],'session_key':_0x358b32[0x1]};_0x1998ab={'url':_0x3f679f+_0x0282('0x35'),'method':_0x0282('0x36'),'headers':{'user_key':_0x1cae14[_0x0282('0x37')],'Session_key':_0x1cae14[_0x0282('0x38')]},'json':!![],'body':_0x89d537};return rp(_0x1998ab);})[_0x0282('0x1e')](function(_0xbda9ab){if(_0xbda9ab['total_sent']>=0x1){var _0xcabdff={'messageId':_0xbda9ab['internal_order_id']};if(_0x50fd01['smsMethod']!=='GP'||!_0x50fd01[_0x0282('0x39')]){_0xcabdff[_0x0282('0x3a')]=!![];}return _0x357e73[_0x0282('0x18')](_0xcabdff);}else{return logger['error'](_0x0282('0x2b'),_0x0282('0x2c'),'skebby',util[_0x0282('0x3b')](_0xbda9ab,{'showHidden':![],'depth':null}));}})[_0x0282('0x19')](function(_0x3fe448){return logger[_0x0282('0x1a')](_0x0282('0x2b'),_0x0282('0x2c'),'skebby',util[_0x0282('0x3b')](_0x3fe448,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x0282('0x2b'),_0x0282('0x2c'),_0x0282('0x3c'),_0x0282('0x3d'));}break;case _0x0282('0x3e'):if(_0x50fd01['authToken']){var _0x549457={'recipient':_0x52ceff[_0x0282('0x25')],'message':_0x52ceff[_0x0282('0xe')],'sender':_0x50fd01['senderString']||_0x50fd01['phone'],'authorization':_0x50fd01[_0x0282('0x22')]};var _0x4f5c56={'method':_0x0282('0x36'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x549457,'json':!![]};rp(_0x4f5c56)[_0x0282('0x1e')](function(_0x292d81){var _0x3763f8={'messageId':_0x292d81[_0x0282('0x3f')]};if(!_0x50fd01[_0x0282('0x39')]){_0x3763f8['read']=!![];}return _0x357e73['update'](_0x3763f8);})[_0x0282('0x19')](function(_0x1e1220){logger[_0x0282('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0282('0x2c'),_0x0282('0x3e'),util[_0x0282('0x3b')](_0x1e1220,{'showHidden':![],'depth':null}));});}else{logger[_0x0282('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','connectel','Missing\x20parameters:\x20authToken');}break;case'clicksend':if(_0x50fd01[_0x0282('0x2e')]&&_0x50fd01['password']){var _0x549457={'messages':[{'source':_0x0282('0x40'),'to':_0x52ceff[_0x0282('0x25')],'body':_0x52ceff[_0x0282('0xe')],'from':_0x50fd01[_0x0282('0x41')]||_0x50fd01[_0x0282('0x25')]}]};var _0x23cffa=util[_0x0282('0x42')](_0x0282('0x43'),_0x50fd01[_0x0282('0x2e')],_0x50fd01[_0x0282('0x32')]);var _0x4f5c56={'method':_0x0282('0x36'),'uri':_0x0282('0x44'),'body':_0x549457,'headers':{'Authorization':util[_0x0282('0x42')]('Basic\x20%s',new Buffer(_0x23cffa)['toString'](_0x0282('0x45')))},'json':!![]};rp(_0x4f5c56)[_0x0282('0x1e')](function(_0x287e3c){if(_0x287e3c[_0x0282('0x46')]>=0xc8&&_0x287e3c[_0x0282('0x46')]<=0xce){if(_0x287e3c[_0x0282('0x47')]&&_0x287e3c[_0x0282('0x47')][_0x0282('0x48')]>0x0){var _0x36527f=_[_0x0282('0x49')](_0x287e3c['data'][_0x0282('0x23')]);var _0x64d563={'messageId':_0x36527f[_0x0282('0x4a')]};if(!_0x50fd01[_0x0282('0x39')]){_0x64d563['read']=!![];}return _0x357e73[_0x0282('0x18')](_0x64d563);}else{logger[_0x0282('0x1a')](_0x0282('0x2b'),_0x0282('0x2c'),_0x0282('0x4b'),util[_0x0282('0x3b')](_0x287e3c,{'showHidden':![],'depth':null}));}}else{logger['error'](_0x0282('0x2b'),_0x0282('0x2c'),_0x0282('0x4b'),util[_0x0282('0x3b')](_0x287e3c,{'showHidden':![],'depth':null}));}})[_0x0282('0x19')](function(_0x135815){logger[_0x0282('0x1a')](_0x0282('0x2b'),'afterCreate',_0x0282('0x4b'),util[_0x0282('0x3b')](_0x135815,{'showHidden':![],'depth':null}));});}else{logger[_0x0282('0x1a')](_0x0282('0x2b'),'afterCreate',_0x0282('0x4b'),_0x0282('0x3d'));}break;case _0x0282('0x4c'):if(_0x50fd01[_0x0282('0x4d')]&&_0x50fd01[_0x0282('0x22')]){var _0x549457={'dst':_0x52ceff['phone'],'text':_0x52ceff[_0x0282('0xe')],'src':_0x50fd01[_0x0282('0x41')]||_0x50fd01[_0x0282('0x25')],'url':_0x50fd01[_0x0282('0x26')]+_0x0282('0x27')+_0x52ceff['id']+'/status?token='+_0x50fd01[_0x0282('0x29')]};var _0x23cffa=util[_0x0282('0x42')](_0x0282('0x43'),_0x50fd01[_0x0282('0x4d')],_0x50fd01[_0x0282('0x22')]);var _0x4f5c56={'method':_0x0282('0x36'),'uri':util[_0x0282('0x42')]('https://api.plivo.com/v1/Account/%s/Message/',_0x50fd01[_0x0282('0x4d')]),'body':_0x549457,'headers':{'Authorization':util[_0x0282('0x42')](_0x0282('0x4e'),new Buffer(_0x23cffa)[_0x0282('0x4f')](_0x0282('0x45')))},'json':!![]};rp(_0x4f5c56)['then'](function(_0x1a7367){var _0xd4c218={'messageId':_0x1a7367['message_uuid'][0x0]};return _0x357e73[_0x0282('0x18')](_0xd4c218);})['catch'](function(_0x595129){logger[_0x0282('0x1a')](_0x0282('0x2b'),_0x0282('0x2c'),_0x0282('0x4c'),util[_0x0282('0x3b')](_0x595129,{'showHidden':![],'depth':null}));});}else{logger[_0x0282('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x0282('0x4c'),_0x0282('0x50'));}break;case _0x0282('0x51'):if(_0x50fd01['username']&&_0x50fd01[_0x0282('0x32')]){if(_0x50fd01[_0x0282('0x52')]){var _0x2ec81c={'method':_0x0282('0x36'),'uri':_0x50fd01[_0x0282('0x52')]+_0x0282('0x53'),'body':{'username':_0x50fd01['username'],'password':_0x50fd01['password']},'json':!![]};return rp(_0x2ec81c)[_0x0282('0x1e')](function(_0x1797b5){var _0x58c93a={'method':_0x0282('0x36'),'uri':_0x50fd01[_0x0282('0x52')]+_0x0282('0x54'),'body':{'messages':[{'from':_0x50fd01[_0x0282('0x25')],'destinations':[{'to':_0x52ceff[_0x0282('0x25')]}],'text':_0x52ceff[_0x0282('0xe')],'notifyUrl':_0x50fd01['remote']+'/api/sms/messages/'+_0x52ceff['id']+_0x0282('0x28')+_0x50fd01[_0x0282('0x29')],'notifyContentType':_0x0282('0x55'),'callbackData':_0x50fd01['phone']+';'+_0x52ceff[_0x0282('0xe')]}]},'headers':{'Authorization':_0x0282('0x56')+_0x1797b5[_0x0282('0x29')]},'json':!![]};return rp(_0x58c93a)[_0x0282('0x1e')](function(_0x1a9117){if(_0x1a9117['messages']){var _0x293daa={'messageId':_0x1a9117['messages'][0x0][_0x0282('0xd')]};if(!_0x50fd01[_0x0282('0x39')]){_0x293daa['read']=!![];}return _0x357e73['update'](_0x293daa);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0282('0x2c'),_0x0282('0x51'),util['inspect'](_0x1a9117,{'showHidden':![],'depth':null}));}});})[_0x0282('0x19')](function(_0x323ab5){return logger[_0x0282('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x0282('0x51'),util[_0x0282('0x3b')](_0x323ab5,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0282('0x2c'),'infobip','Missing\x20parameters:\x20base_url');}}else{logger[_0x0282('0x1a')](_0x0282('0x2b'),'afterCreate',_0x0282('0x51'),_0x0282('0x3d'));}break;case _0x0282('0x57'):var _0x3a3ea5=require(_0x0282('0x58'));if(_0x50fd01['apiKey']){var _0x179977={};_0x179977[_0x0282('0x59')]=_0x50fd01[_0x0282('0x2e')];_0x179977['phone']=_0x52ceff['phone'];_0x179977['sender']=_0x50fd01['phone'];_0x179977[_0x0282('0x5a')]=_0x52ceff[_0x0282('0xe')];_0x179977['timestamp']=+new Date();var _0x35406d='';var _0x337421='';var _0x16903f=Object[_0x0282('0x5b')](_0x179977);_0x16903f[_0x0282('0x5c')]();for(var _0x10979a=0x0;_0x10979a<_0x16903f[_0x0282('0x5d')];_0x10979a++){if(_0x35406d!=''){_0x35406d+='&';}_0x35406d+=_0x16903f[_0x10979a]+'='+encodeURIComponent(_0x179977[_0x16903f[_0x10979a]]);_0x337421+=_0x179977[_0x16903f[_0x10979a]];}_0x337421+=_0x50fd01[_0x0282('0x5e')];_0x337421=_0x3a3ea5[_0x0282('0x5f')](_0x0282('0x60'))[_0x0282('0x18')](_0x337421)['digest']('hex');if(_0x35406d!==''){_0x35406d+='&';}_0x35406d+='signature='+_0x337421;var _0x1998ab={'method':'GET','uri':_0x50fd01[_0x0282('0x52')]+'/external/get/send.php?'+_0x35406d,'json':!![]};return rp(_0x1998ab)['then'](function(_0x254db8){var _0x52fa8e=Object[_0x0282('0x5b')](_0x254db8);if(_0x254db8[_0x52fa8e[0x0]][_0x0282('0x1a')]&&parseInt(_0x254db8[_0x52fa8e[0x0]]['error'])===0x0){var _0x593d64={'messageId':_0x254db8[_0x52fa8e[0x0]][_0x0282('0x61')]};if(!_0x50fd01[_0x0282('0x39')]){_0x593d64[_0x0282('0x3a')]=!![];}return _0x357e73[_0x0282('0x18')](_0x593d64);}else{return logger[_0x0282('0x1a')](_0x0282('0x2b'),_0x0282('0x2c'),_0x0282('0x57'),util['inspect'](_0x254db8['error'],{'showHidden':![],'depth':null}));}})['catch'](function(_0x1e5c4b){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0282('0x2c'),_0x0282('0x57'),util[_0x0282('0x3b')](_0x1e5c4b,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x0282('0x2b'),_0x0282('0x2c'),'csc',_0x0282('0x62'));}break;case'clickatell':if(_0x50fd01[_0x0282('0x5e')]){var _0x4bba5a={'method':_0x0282('0x36'),'uri':_0x0282('0x63'),'headers':{'Authorization':_0x50fd01[_0x0282('0x5e')]},'body':{'content':_0x52ceff['body'],'to':[_0x52ceff['phone']],'from':_0x50fd01[_0x0282('0x25')],'binary':![],'clientMessageId':_0x0282('0x64'),'charset':_0x0282('0x65')},'json':!![]};rp(_0x4bba5a)[_0x0282('0x1e')](function(_0x428b91){if(!_0x428b91[_0x0282('0x1a')]){var _0x2d6f43={'messageId':_0x428b91[_0x0282('0x23')][0x0][_0x0282('0x66')]};if(!_0x50fd01[_0x0282('0x39')]){_0x2d6f43[_0x0282('0x3a')]=!![];}return _0x357e73[_0x0282('0x18')](_0x2d6f43);}else{return logger[_0x0282('0x1a')](_0x0282('0x2b'),_0x0282('0x2c'),'clickatell',util['inspect'](_0x428b91[_0x0282('0x1a')],{'showHidden':![],'depth':null}));}})[_0x0282('0x19')](function(_0x4e8e98){return logger[_0x0282('0x1a')](_0x0282('0x2b'),_0x0282('0x2c'),_0x0282('0x67'),util['inspect'](_0x4e8e98,{'showHidden':![],'depth':null}));});}else{logger[_0x0282('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0282('0x2c'),'clickatell','Missing\x20parameters:\x20apiKey');}break;case'bandwidth':if(_0x50fd01[_0x0282('0x2e')]&&_0x50fd01[_0x0282('0x32')]){var _0x23cffa=util['format']('%s:%s',_0x50fd01[_0x0282('0x2e')],_0x50fd01[_0x0282('0x32')]);var _0x4f5c56={'method':_0x0282('0x36'),'uri':_0x0282('0x68')+_0x50fd01[_0x0282('0x69')]+_0x0282('0x6a'),'body':{'to':[_0x52ceff[_0x0282('0x25')]],'text':_0x52ceff[_0x0282('0xe')],'from':_0x50fd01['phone'],'applicationId':_0x50fd01[_0x0282('0x6b')]},'headers':{'Authorization':util['format'](_0x0282('0x4e'),new Buffer(_0x23cffa)[_0x0282('0x4f')](_0x0282('0x45')))},'json':!![]};rp(_0x4f5c56)[_0x0282('0x1e')](function(_0x304a30){if(_0x304a30['id']){var _0x11adf1={'messageId':_0x304a30['id']};return _0x357e73['update'](_0x11adf1);}else{logger['error'](_0x0282('0x2b'),_0x0282('0x2c'),_0x0282('0x6c'),util[_0x0282('0x3b')](_0x304a30,{'showHidden':![],'depth':null}));}})[_0x0282('0x19')](function(_0x176ad8){logger[_0x0282('0x1a')](_0x0282('0x2b'),_0x0282('0x2c'),_0x0282('0x6c'),util[_0x0282('0x3b')](_0x176ad8,{'showHidden':![],'depth':null}));});}else{logger[_0x0282('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0282('0x2c'),'bandwidth','Missing\x20parameters:\x20username,\x20password');}break;case'intelepeer':if(_0x50fd01[_0x0282('0x5e')]){var _0x5118d3={};var _0x1998ab={'method':_0x0282('0x36'),'uri':_0x0282('0x6d'),'headers':{'Authorization':_0x0282('0x6e')+_0x50fd01[_0x0282('0x5e')],'Content-Type':_0x0282('0x55')},'body':{'from':_0x50fd01[_0x0282('0x25')],'to':_0x52ceff[_0x0282('0x25')],'text':_0x52ceff['body']},'json':!![]};return rp(_0x1998ab)['then'](function(_0x397fb3){if(_0x397fb3[_0x0282('0x6f')]==0xca){_0x5118d3[_0x0282('0x70')]=_0x397fb3;var _0x334a31={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0x0282('0x6e')+_0x50fd01['apiKey'],'Content-Type':'application/json'},'body':{'refid':_0x5118d3[_0x0282('0x70')]['refid']},'json':!![]};return rp(_0x334a31)[_0x0282('0x1e')](function(_0x456cfa){_0x5118d3[_0x0282('0x71')]=_0x456cfa;var _0x237fb6={'messageId':_0x5118d3[_0x0282('0x70')][_0x0282('0x72')],'read':!![]};return _0x357e73[_0x0282('0x18')](_0x237fb6);});}else{return logger[_0x0282('0x1a')](_0x0282('0x2b'),_0x0282('0x2c'),_0x0282('0x73'),util[_0x0282('0x3b')](_0x397fb3,{'showHidden':![],'depth':null}));}})[_0x0282('0x19')](function(_0x28b873){return logger['error'](_0x0282('0x2b'),_0x0282('0x2c'),_0x0282('0x73'),util[_0x0282('0x3b')](_0x28b873,{'showHidden':![],'depth':null}));});}else{return logger[_0x0282('0x1a')](_0x0282('0x2b'),'afterCreate','intelepeer','Token\x20not\x20received');}break;}}})[_0x0282('0x74')](function(){_0x316bfd();});}else{_0x316bfd();}}},'charset':_0x0282('0x75'),'collate':_0x0282('0x76')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 459326b..f8d4077 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 _0xea34=['request','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register'];(function(_0x5ecff9,_0x473070){var _0x5e1415=function(_0x3c34a1){while(--_0x3c34a1){_0x5ecff9['push'](_0x5ecff9['shift']());}};_0x5e1415(++_0x473070);}(_0xea34,0x1cb));var _0x4ea3=function(_0x19b84f,_0x48765e){_0x19b84f=_0x19b84f-0x0;var _0x18067b=_0xea34[_0x19b84f];return _0x18067b;};'use strict';var _=require(_0x4ea3('0x0'));var util=require(_0x4ea3('0x1'));var moment=require(_0x4ea3('0x2'));var BPromise=require(_0x4ea3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4ea3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4ea3('0x5'));var logger=require(_0x4ea3('0x6'))(_0x4ea3('0x7'));var config=require(_0x4ea3('0x8'));var jayson=require(_0x4ea3('0x9'));var client=jayson[_0x4ea3('0xa')][_0x4ea3('0xb')]({'port':0x232a});config['redis']=_[_0x4ea3('0xc')](config[_0x4ea3('0xd')],{'host':_0x4ea3('0xe'),'port':0x18eb});var socket=require(_0x4ea3('0xf'))(new Redis(config[_0x4ea3('0xd')]));require('./smsMessage.socket')[_0x4ea3('0x10')](socket);function respondWithRpcPromise(_0x8cff3a,_0x55042a,_0x28b862){return new BPromise(function(_0x119686,_0x28330f){return client[_0x4ea3('0x11')](_0x8cff3a,_0x28b862)[_0x4ea3('0x12')](function(_0x4673a3){logger['info'](_0x4ea3('0x13'),_0x55042a,_0x4ea3('0x14'));logger[_0x4ea3('0x15')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x55042a,_0x4ea3('0x14'),JSON['stringify'](_0x4673a3));if(_0x4673a3[_0x4ea3('0x16')]){if(_0x4673a3[_0x4ea3('0x16')][_0x4ea3('0x17')]===0x1f4){logger[_0x4ea3('0x16')]('SmsMessage,\x20%s,\x20%s',_0x55042a,_0x4673a3[_0x4ea3('0x16')]['message']);return _0x28330f(_0x4673a3['error'][_0x4ea3('0x18')]);}logger[_0x4ea3('0x16')](_0x4ea3('0x13'),_0x55042a,_0x4673a3[_0x4ea3('0x16')][_0x4ea3('0x18')]);return _0x119686(_0x4673a3['error'][_0x4ea3('0x18')]);}else{logger[_0x4ea3('0x19')](_0x4ea3('0x13'),_0x55042a,_0x4ea3('0x14'));_0x119686(_0x4673a3[_0x4ea3('0x1a')]['message']);}})[_0x4ea3('0x1b')](function(_0x23c4a4){logger['error'](_0x4ea3('0x13'),_0x55042a,_0x23c4a4);_0x28330f(_0x23c4a4);});});}exports[_0x4ea3('0x1c')]=function(_0xa5ab0e){var _0x1c4c0d=this;return new Promise(function(_0x301a3c,_0x1bb6ee){return db[_0x4ea3('0x1d')][_0x4ea3('0x1e')](_0xa5ab0e[_0x4ea3('0x1f')],{'raw':_0xa5ab0e[_0x4ea3('0x20')]?_0xa5ab0e[_0x4ea3('0x20')][_0x4ea3('0x21')]===undefined?!![]:![]:!![]})[_0x4ea3('0x12')](function(_0x12037c){logger[_0x4ea3('0x19')](_0x4ea3('0x1c'),_0xa5ab0e);logger[_0x4ea3('0x15')](_0x4ea3('0x1c'),_0xa5ab0e,JSON['stringify'](_0x12037c));_0x301a3c(_0x12037c);})[_0x4ea3('0x1b')](function(_0x80c0a3){logger['error'](_0x4ea3('0x1c'),_0x80c0a3[_0x4ea3('0x18')],_0xa5ab0e);_0x1bb6ee(_0x1c4c0d['error'](0x1f4,_0x80c0a3[_0x4ea3('0x18')]));});});}; \ No newline at end of file +var _0xf896=['SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateSmsMessage','SmsMessage','body','options','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','defaults','localhost','socket.io-emitter','redis','./smsMessage.socket','register','request','then'];(function(_0x20f6f3,_0x391d04){var _0x542dc1=function(_0xd0e47c){while(--_0xd0e47c){_0x20f6f3['push'](_0x20f6f3['shift']());}};_0x542dc1(++_0x391d04);}(_0xf896,0x1a7));var _0x6f89=function(_0x367e5b,_0x5721e4){_0x367e5b=_0x367e5b-0x0;var _0x4b909e=_0xf896[_0x367e5b];return _0x4b909e;};'use strict';var _=require(_0x6f89('0x0'));var util=require('util');var moment=require(_0x6f89('0x1'));var BPromise=require(_0x6f89('0x2'));var rs=require(_0x6f89('0x3'));var fs=require('fs');var Redis=require(_0x6f89('0x4'));var db=require(_0x6f89('0x5'))['db'];var utils=require(_0x6f89('0x6'));var logger=require('../../config/logger')(_0x6f89('0x7'));var config=require(_0x6f89('0x8'));var jayson=require(_0x6f89('0x9'));var client=jayson['client'][_0x6f89('0xa')]({'port':0x232a});config['redis']=_[_0x6f89('0xb')](config['redis'],{'host':_0x6f89('0xc'),'port':0x18eb});var socket=require(_0x6f89('0xd'))(new Redis(config[_0x6f89('0xe')]));require(_0x6f89('0xf'))[_0x6f89('0x10')](socket);function respondWithRpcPromise(_0x38a5b7,_0x5181e8,_0x5dce41){return new BPromise(function(_0x1d35df,_0x2c2b79){return client[_0x6f89('0x11')](_0x38a5b7,_0x5dce41)[_0x6f89('0x12')](function(_0x5a1f51){logger['info'](_0x6f89('0x13'),_0x5181e8,_0x6f89('0x14'));logger[_0x6f89('0x15')](_0x6f89('0x16'),_0x5181e8,_0x6f89('0x14'),JSON[_0x6f89('0x17')](_0x5a1f51));if(_0x5a1f51[_0x6f89('0x18')]){if(_0x5a1f51[_0x6f89('0x18')][_0x6f89('0x19')]===0x1f4){logger[_0x6f89('0x18')](_0x6f89('0x13'),_0x5181e8,_0x5a1f51[_0x6f89('0x18')][_0x6f89('0x1a')]);return _0x2c2b79(_0x5a1f51[_0x6f89('0x18')][_0x6f89('0x1a')]);}logger[_0x6f89('0x18')]('SmsMessage,\x20%s,\x20%s',_0x5181e8,_0x5a1f51['error'][_0x6f89('0x1a')]);return _0x1d35df(_0x5a1f51[_0x6f89('0x18')][_0x6f89('0x1a')]);}else{logger[_0x6f89('0x1b')](_0x6f89('0x13'),_0x5181e8,'request\x20sent');_0x1d35df(_0x5a1f51[_0x6f89('0x1c')][_0x6f89('0x1a')]);}})[_0x6f89('0x1d')](function(_0x20e25e){logger[_0x6f89('0x18')](_0x6f89('0x13'),_0x5181e8,_0x20e25e);_0x2c2b79(_0x20e25e);});});}exports[_0x6f89('0x1e')]=function(_0x15b04c){var _0x550e42=this;return new Promise(function(_0x289922,_0x38bd34){return db[_0x6f89('0x1f')]['create'](_0x15b04c[_0x6f89('0x20')],{'raw':_0x15b04c[_0x6f89('0x21')]?_0x15b04c[_0x6f89('0x21')]['raw']===undefined?!![]:![]:!![]})[_0x6f89('0x12')](function(_0x268aea){logger[_0x6f89('0x1b')](_0x6f89('0x1e'),_0x15b04c);logger[_0x6f89('0x15')](_0x6f89('0x1e'),_0x15b04c,JSON['stringify'](_0x268aea));_0x289922(_0x268aea);})[_0x6f89('0x1d')](function(_0x33f5ab){logger['error']('CreateSmsMessage',_0x33f5ab[_0x6f89('0x1a')],_0x15b04c);_0x38bd34(_0x550e42[_0x6f89('0x18')](0x1f4,_0x33f5ab[_0x6f89('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index d5522fa..4d83aa6 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 _0x4077=['register','length','smsMessage:','./smsMessage.events','save','remove','update','emit'];(function(_0x176683,_0x168eb1){var _0x41ab61=function(_0x30b18e){while(--_0x30b18e){_0x176683['push'](_0x176683['shift']());}};_0x41ab61(++_0x168eb1);}(_0x4077,0x11b));var _0x7407=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4077[_0x3dd15e];return _0x231fd0;};'use strict';var SmsMessageEvents=require(_0x7407('0x0'));var events=[_0x7407('0x1'),_0x7407('0x2'),_0x7407('0x3')];function createListener(_0x35fead,_0x9f303e){return function(_0x3c8226){_0x9f303e[_0x7407('0x4')](_0x35fead,_0x3c8226);};}function removeListener(_0x215e4e,_0x35dea5){return function(){SmsMessageEvents['removeListener'](_0x215e4e,_0x35dea5);};}exports[_0x7407('0x5')]=function(_0x1408d1){for(var _0x1ce02e=0x0,_0x2e2183=events[_0x7407('0x6')];_0x1ce02e<_0x2e2183;_0x1ce02e++){var _0x2cfb96=events[_0x1ce02e];var _0x310608=createListener(_0x7407('0x7')+_0x2cfb96,_0x1408d1);SmsMessageEvents['on'](_0x2cfb96,_0x310608);}}; \ No newline at end of file +var _0x966f=['smsMessage:','save','remove','update','emit','removeListener','register','length'];(function(_0x5a0bba,_0x4637dd){var _0x34efe9=function(_0x32b950){while(--_0x32b950){_0x5a0bba['push'](_0x5a0bba['shift']());}};_0x34efe9(++_0x4637dd);}(_0x966f,0xf9));var _0xf966=function(_0x41e2de,_0x74fec7){_0x41e2de=_0x41e2de-0x0;var _0x3717ff=_0x966f[_0x41e2de];return _0x3717ff;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0xf966('0x0'),_0xf966('0x1'),_0xf966('0x2')];function createListener(_0x4d7ee1,_0x13a21d){return function(_0x3bb990){_0x13a21d[_0xf966('0x3')](_0x4d7ee1,_0x3bb990);};}function removeListener(_0x118213,_0x5057df){return function(){SmsMessageEvents[_0xf966('0x4')](_0x118213,_0x5057df);};}exports[_0xf966('0x5')]=function(_0x58b353){for(var _0x240f04=0x0,_0x2bd817=events[_0xf966('0x6')];_0x240f04<_0x2bd817;_0x240f04++){var _0xafe05b=events[_0x240f04];var _0x5487da=createListener(_0xf966('0x7')+_0xafe05b,_0x58b353);SmsMessageEvents['on'](_0xafe05b,_0x5487da);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 1e0c9fb..fb7d157 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 _0x36e9=['../../components/auth/service','../../config/environment','./smsQueue.controller','get','index','/describe','/:id','show','/:id/members','getMembers','/:id/teams','isAuthenticated','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','put','update','delete','removeAgents','exports','util','path','connect-timeout','express','Router'];(function(_0x1694c8,_0x3f04ae){var _0xebb521=function(_0x1bc6b3){while(--_0x1bc6b3){_0x1694c8['push'](_0x1694c8['shift']());}};_0xebb521(++_0x3f04ae);}(_0x36e9,0xa9));var _0x936e=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x36e9[_0x465028];return _0xb783d4;};'use strict';var multer=require('multer');var util=require(_0x936e('0x0'));var path=require(_0x936e('0x1'));var timeout=require(_0x936e('0x2'));var express=require(_0x936e('0x3'));var router=express[_0x936e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x936e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x936e('0x6'));var controller=require(_0x936e('0x7'));router[_0x936e('0x8')]('/',auth['isAuthenticated'](),controller[_0x936e('0x9')]);router[_0x936e('0x8')](_0x936e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x936e('0x8')](_0x936e('0xb'),auth['isAuthenticated'](),controller[_0x936e('0xc')]);router[_0x936e('0x8')](_0x936e('0xd'),auth['isAuthenticated'](),controller[_0x936e('0xe')]);router[_0x936e('0x8')](_0x936e('0xf'),auth[_0x936e('0x10')](),controller[_0x936e('0x11')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x936e('0x12')]);router[_0x936e('0x13')]('/',auth[_0x936e('0x10')](),controller[_0x936e('0x14')]);router[_0x936e('0x13')](_0x936e('0xf'),auth[_0x936e('0x10')](),controller[_0x936e('0x15')]);router['post'](_0x936e('0x16'),auth[_0x936e('0x10')](),controller[_0x936e('0x17')]);router[_0x936e('0x18')]('/:id',auth[_0x936e('0x10')](),controller[_0x936e('0x19')]);router['delete'](_0x936e('0xb'),auth[_0x936e('0x10')](),controller['destroy']);router[_0x936e('0x1a')]('/:id/teams',auth[_0x936e('0x10')](),controller['removeTeams']);router[_0x936e('0x1a')](_0x936e('0x16'),auth['isAuthenticated'](),controller[_0x936e('0x1b')]);module[_0x936e('0x1c')]=router; \ No newline at end of file +var _0xd7b8=['create','addTeams','addAgents','put','update','destroy','delete','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post'];(function(_0x16c9c5,_0x403b16){var _0x378a9c=function(_0x2b3dbc){while(--_0x2b3dbc){_0x16c9c5['push'](_0x16c9c5['shift']());}};_0x378a9c(++_0x403b16);}(_0xd7b8,0x102));var _0x8d7b=function(_0x54f91f,_0x101a1f){_0x54f91f=_0x54f91f-0x0;var _0x24ea71=_0xd7b8[_0x54f91f];return _0x24ea71;};'use strict';var multer=require(_0x8d7b('0x0'));var util=require(_0x8d7b('0x1'));var path=require('path');var timeout=require(_0x8d7b('0x2'));var express=require(_0x8d7b('0x3'));var router=express[_0x8d7b('0x4')]();var fs_extra=require(_0x8d7b('0x5'));var auth=require(_0x8d7b('0x6'));var interaction=require(_0x8d7b('0x7'));var config=require('../../config/environment');var controller=require('./smsQueue.controller');router[_0x8d7b('0x8')]('/',auth[_0x8d7b('0x9')](),controller[_0x8d7b('0xa')]);router[_0x8d7b('0x8')](_0x8d7b('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x8d7b('0x8')](_0x8d7b('0xc'),auth[_0x8d7b('0x9')](),controller[_0x8d7b('0xd')]);router[_0x8d7b('0x8')](_0x8d7b('0xe'),auth[_0x8d7b('0x9')](),controller[_0x8d7b('0xf')]);router[_0x8d7b('0x8')](_0x8d7b('0x10'),auth['isAuthenticated'](),controller[_0x8d7b('0x11')]);router[_0x8d7b('0x8')](_0x8d7b('0x12'),auth[_0x8d7b('0x9')](),controller[_0x8d7b('0x13')]);router[_0x8d7b('0x14')]('/',auth[_0x8d7b('0x9')](),controller[_0x8d7b('0x15')]);router[_0x8d7b('0x14')]('/:id/teams',auth[_0x8d7b('0x9')](),controller[_0x8d7b('0x16')]);router[_0x8d7b('0x14')](_0x8d7b('0x12'),auth['isAuthenticated'](),controller[_0x8d7b('0x17')]);router[_0x8d7b('0x18')](_0x8d7b('0xc'),auth[_0x8d7b('0x9')](),controller[_0x8d7b('0x19')]);router['delete']('/:id',auth[_0x8d7b('0x9')](),controller[_0x8d7b('0x1a')]);router[_0x8d7b('0x1b')](_0x8d7b('0x10'),auth[_0x8d7b('0x9')](),controller[_0x8d7b('0x1c')]);router[_0x8d7b('0x1b')](_0x8d7b('0x12'),auth[_0x8d7b('0x9')](),controller[_0x8d7b('0x1d')]);module[_0x8d7b('0x1e')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 2632e23..3231b50 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 _0x5935=['ENUM','beepall','roundrobin','exports','STRING','name','INTEGER'];(function(_0x2525f1,_0x47034f){var _0x13c1b5=function(_0x2beb2e){while(--_0x2beb2e){_0x2525f1['push'](_0x2525f1['shift']());}};_0x13c1b5(++_0x47034f);}(_0x5935,0xd5));var _0x5593=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x5935[_0x82129b];return _0x2ae5dc;};'use strict';var Sequelize=require('sequelize');module[_0x5593('0x0')]={'name':{'type':Sequelize[_0x5593('0x1')],'unique':_0x5593('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5593('0x1')]},'timeout':{'type':Sequelize[_0x5593('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5593('0x4')]('rrmemory',_0x5593('0x5'),_0x5593('0x6'))}}; \ No newline at end of file +var _0x1179=['beepall','roundrobin','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x196bab,_0x4f5a09){var _0x24d802=function(_0x451764){while(--_0x451764){_0x196bab['push'](_0x196bab['shift']());}};_0x24d802(++_0x4f5a09);}(_0x1179,0xdb));var _0x9117=function(_0x43c363,_0x16c2e1){_0x43c363=_0x43c363-0x0;var _0xf102f2=_0x1179[_0x43c363];return _0xf102f2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9117('0x0')],'unique':_0x9117('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9117('0x0')]},'timeout':{'type':Sequelize[_0x9117('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9117('0x3')](_0x9117('0x4'),_0x9117('0x5'),_0x9117('0x6'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index c455dd5..9846ccd 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 _0xdb28=['userSmsQueue:save','removeTeams','select','field','from','team_has_sms_queues','join','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','TeamId','includes','all','union','value','isEmpty','removeAgents','forEach','addAgents','omit','spread','userSmsQueue:remove','getAgents','bluebird','util','lodash','squel','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','./smsQueue.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','update','then','get','SmsQueues','destroy','error','stack','name','map','SmsQueue','fieldName','type','key','where','include','rows','show','keys','query','filters','intersection','model','attributes','fields','length','includeAll','merge','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','body','params','describe','getMembers','findOne','UserSmsQueue','rawAttributes','hasOwnProperty','nolimit','order','sort','SmsQueueId','filter','findAll','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','pick','ids','Agents','online','voicePause','interface','sequelize','transaction','addTeams','each','emit'];(function(_0x167fba,_0x18eeeb){var _0x99be47=function(_0x3f4516){while(--_0x3f4516){_0x167fba['push'](_0x167fba['shift']());}};_0x99be47(++_0x18eeeb);}(_0xdb28,0x106));var _0x8db2=function(_0x521d2e,_0x2bf0b1){_0x521d2e=_0x521d2e-0x0;var _0xc64968=_0xdb28[_0x521d2e];return _0xc64968;};'use strict';var BPromise=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var _=require(_0x8db2('0x2'));var squel=require(_0x8db2('0x3'));var Redis=require('ioredis');var qs=require(_0x8db2('0x4'));var logger=require(_0x8db2('0x5'))(_0x8db2('0x6'));var config=require(_0x8db2('0x7'));var db=require(_0x8db2('0x8'))['db'];config['redis']=_[_0x8db2('0x9')](config[_0x8db2('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8db2('0xa')]));require(_0x8db2('0xb'))[_0x8db2('0xc')](socket);function respondWithStatusCode(_0x29f698,_0x2f3f2f){_0x2f3f2f=_0x2f3f2f||0xcc;return function(_0x1ff362){if(_0x1ff362){return _0x29f698[_0x8db2('0xd')](_0x2f3f2f);}return _0x29f698['status'](_0x2f3f2f)[_0x8db2('0xe')]();};}function respondWithResult(_0x476216,_0x1f62af){_0x1f62af=_0x1f62af||0xc8;return function(_0x57015f){if(_0x57015f){return _0x476216[_0x8db2('0xf')](_0x1f62af)[_0x8db2('0x10')](_0x57015f);}};}function respondWithFilteredResult(_0x576475,_0x41beda){return function(_0x3b2faa){if(_0x3b2faa){var _0x1349f6=typeof _0x41beda[_0x8db2('0x11')]===_0x8db2('0x12')&&typeof _0x41beda['limit']==='undefined';var _0x15070d=_0x3b2faa[_0x8db2('0x13')];var _0x350d61=_0x1349f6?0x0:_0x41beda[_0x8db2('0x11')];var _0x227355=_0x1349f6?_0x3b2faa[_0x8db2('0x13')]:_0x41beda[_0x8db2('0x11')]+_0x41beda[_0x8db2('0x14')];var _0x131252;if(_0x227355>=_0x15070d){_0x227355=_0x15070d;_0x131252=0xc8;}else{_0x131252=0xce;}_0x576475[_0x8db2('0xf')](_0x131252);return _0x576475['set'](_0x8db2('0x15'),_0x350d61+'-'+_0x227355+'/'+_0x15070d)[_0x8db2('0x10')](_0x3b2faa);}return null;};}function saveUpdates(_0x48101e){return function(_0x2b3f73){if(_0x2b3f73){return _0x2b3f73[_0x8db2('0x16')](_0x48101e)[_0x8db2('0x17')](function(_0x3fddc2){return _0x3fddc2;});}return null;};}function removeEntity(_0x2efd06){return function(_0x46ce14){if(_0x46ce14){return _0x46ce14['destroy']()['then'](function(){var _0x77789=_0x46ce14[_0x8db2('0x18')]({'plain':!![]});var _0x1310d3=_0x8db2('0x19');return db['UserProfileResource'][_0x8db2('0x1a')]({'where':{'type':_0x1310d3,'resourceId':_0x77789['id']}})[_0x8db2('0x17')](function(){return _0x46ce14;});})[_0x8db2('0x17')](function(){_0x2efd06[_0x8db2('0xf')](0xcc)[_0x8db2('0xe')]();});}};}function handleEntityNotFound(_0x597260){return function(_0x124467){if(!_0x124467){_0x597260[_0x8db2('0xd')](0x194);}return _0x124467;};}function handleError(_0x18f69c,_0x125be2){_0x125be2=_0x125be2||0x1f4;return function(_0x2260d8){logger[_0x8db2('0x1b')](_0x2260d8[_0x8db2('0x1c')]);if(_0x2260d8['name']){delete _0x2260d8[_0x8db2('0x1d')];}_0x18f69c['status'](_0x125be2)['send'](_0x2260d8);};}exports['index']=function(_0x4d923c,_0xec8cd2){var _0x29b5cd={};var _0x3be281={'count':0x0,'rows':[]};var _0x2baed0=_[_0x8db2('0x1e')](db[_0x8db2('0x1f')]['rawAttributes'],function(_0x3544ba){return{'name':_0x3544ba[_0x8db2('0x20')],'type':_0x3544ba[_0x8db2('0x21')][_0x8db2('0x22')]};});_0x29b5cd=qs['getOptions'](_0x2baed0,_0x4d923c);var _0x2e0691={'where':_0x29b5cd[_0x8db2('0x23')]};return db[_0x8db2('0x1f')][_0x8db2('0x13')](_0x2e0691)[_0x8db2('0x17')](function(_0x21bae5){_0x3be281[_0x8db2('0x13')]=_0x21bae5;_0x29b5cd[_0x8db2('0x24')]=qs[_0x8db2('0x24')](_0x4d923c['query']);return db[_0x8db2('0x1f')]['findAll'](_0x29b5cd);})['then'](function(_0x302188){_0x3be281[_0x8db2('0x25')]=_0x302188;return _0x3be281;})[_0x8db2('0x17')](respondWithFilteredResult(_0xec8cd2,_0x29b5cd))['catch'](handleError(_0xec8cd2,null));};exports[_0x8db2('0x26')]=function(_0x56b71a,_0x3f7aac){var _0x2b653b={'raw':!![],'where':{'id':_0x56b71a['params']['id']}},_0x14bd12={};_0x14bd12['model']=_[_0x8db2('0x27')](db[_0x8db2('0x1f')]['rawAttributes']);_0x14bd12['query']=_[_0x8db2('0x27')](_0x56b71a[_0x8db2('0x28')]);_0x14bd12[_0x8db2('0x29')]=_[_0x8db2('0x2a')](_0x14bd12[_0x8db2('0x2b')],_0x14bd12[_0x8db2('0x28')]);_0x2b653b[_0x8db2('0x2c')]=_[_0x8db2('0x2a')](_0x14bd12[_0x8db2('0x2b')],qs[_0x8db2('0x2d')](_0x56b71a['query'][_0x8db2('0x2d')]));_0x2b653b[_0x8db2('0x2c')]=_0x2b653b['attributes'][_0x8db2('0x2e')]?_0x2b653b[_0x8db2('0x2c')]:_0x14bd12['model'];if(_0x56b71a['query'][_0x8db2('0x2f')]){_0x2b653b['include']=[{'all':!![]}];}_0x2b653b=_[_0x8db2('0x30')]({},_0x2b653b,_0x56b71a[_0x8db2('0x31')]);return db[_0x8db2('0x1f')][_0x8db2('0x32')](_0x2b653b)['then'](handleEntityNotFound(_0x3f7aac,null))[_0x8db2('0x17')](respondWithResult(_0x3f7aac,null))['catch'](handleError(_0x3f7aac,null));};exports[_0x8db2('0x33')]=function(_0xd550ae,_0x2c8bc9){return db[_0x8db2('0x1f')]['create'](_0xd550ae['body'],{})[_0x8db2('0x17')](function(_0x2c0507){var _0x5dc2b4=_0xd550ae[_0x8db2('0x34')][_0x8db2('0x18')]({'plain':!![]});if(!_0x5dc2b4)throw new Error(_0x8db2('0x35'));if(_0x5dc2b4['role']===_0x8db2('0x34')){var _0x149186=_0x2c0507[_0x8db2('0x18')]({'plain':!![]});var _0x279e74=_0x8db2('0x19');return db[_0x8db2('0x36')][_0x8db2('0x32')]({'where':{'name':_0x279e74,'userProfileId':_0x5dc2b4[_0x8db2('0x37')]},'raw':!![]})[_0x8db2('0x17')](function(_0x63c561){if(_0x63c561&&_0x63c561[_0x8db2('0x38')]===0x0){return db[_0x8db2('0x39')][_0x8db2('0x33')]({'name':_0x149186['name'],'resourceId':_0x149186['id'],'type':_0x63c561[_0x8db2('0x1d')],'sectionId':_0x63c561['id']},{})[_0x8db2('0x17')](function(){return _0x2c0507;});}else{return _0x2c0507;}})['catch'](function(_0x49a7ae){logger[_0x8db2('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x49a7ae);throw _0x49a7ae;});}return _0x2c0507;})[_0x8db2('0x17')](respondWithResult(_0x2c8bc9,0xc9))[_0x8db2('0x3a')](handleError(_0x2c8bc9,null));};exports[_0x8db2('0x16')]=function(_0x307783,_0xb4fe2c){if(_0x307783[_0x8db2('0x3b')]['id']){delete _0x307783[_0x8db2('0x3b')]['id'];}return db['SmsQueue'][_0x8db2('0x32')]({'where':{'id':_0x307783[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0xb4fe2c,null))[_0x8db2('0x17')](saveUpdates(_0x307783['body'],null))[_0x8db2('0x17')](respondWithResult(_0xb4fe2c,null))[_0x8db2('0x3a')](handleError(_0xb4fe2c,null));};exports[_0x8db2('0x1a')]=function(_0x2c47cc,_0x5427af){return db[_0x8db2('0x1f')]['find']({'where':{'id':_0x2c47cc[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x5427af,null))[_0x8db2('0x17')](removeEntity(_0x5427af,null))['catch'](handleError(_0x5427af,null));};exports['describe']=function(_0x1ec3d0,_0x47c556){return db[_0x8db2('0x1f')][_0x8db2('0x3d')]()[_0x8db2('0x17')](respondWithResult(_0x47c556,null))[_0x8db2('0x3a')](handleError(_0x47c556,null));};exports[_0x8db2('0x3e')]=function(_0x40c6e6,_0x4355e2){var _0xab6bdd={'raw':!![],'where':{}},_0x4291e3={},_0x12a1ef;return db[_0x8db2('0x1f')][_0x8db2('0x3f')]({'where':{'id':_0x40c6e6['params']['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x4355e2,null))[_0x8db2('0x17')](function(_0xdbba64){if(_0xdbba64){_0x12a1ef=_0xdbba64[_0x8db2('0x18')]({'plain':!![]});_0x4291e3['model']=_['keys'](db[_0x8db2('0x40')][_0x8db2('0x41')]);_0x4291e3[_0x8db2('0x28')]=_['keys'](_0x40c6e6['query']);_0x4291e3['filters']=_[_0x8db2('0x2a')](_0x4291e3[_0x8db2('0x2b')],_0x4291e3[_0x8db2('0x28')]);_0xab6bdd[_0x8db2('0x2c')]=_[_0x8db2('0x2a')](_0x4291e3[_0x8db2('0x2b')],qs[_0x8db2('0x2d')](_0x40c6e6['query']['fields']));_0xab6bdd[_0x8db2('0x2c')]=_0xab6bdd[_0x8db2('0x2c')][_0x8db2('0x2e')]?_0xab6bdd[_0x8db2('0x2c')]:_0x4291e3[_0x8db2('0x2b')];if(!_0x40c6e6[_0x8db2('0x28')][_0x8db2('0x42')](_0x8db2('0x43'))){_0xab6bdd[_0x8db2('0x14')]=qs[_0x8db2('0x14')](_0x40c6e6[_0x8db2('0x28')][_0x8db2('0x14')]);_0xab6bdd[_0x8db2('0x11')]=qs[_0x8db2('0x11')](_0x40c6e6[_0x8db2('0x28')]['offset']);}_0xab6bdd[_0x8db2('0x44')]=qs[_0x8db2('0x45')](_0x40c6e6['query'][_0x8db2('0x45')]);_0xab6bdd[_0x8db2('0x23')]=qs[_0x8db2('0x29')](_['pick'](_0x40c6e6[_0x8db2('0x28')],_0x4291e3[_0x8db2('0x29')]));_0xab6bdd[_0x8db2('0x23')][_0x8db2('0x46')]=_0xdbba64['id'];if(_0x40c6e6[_0x8db2('0x28')]['filter']){_0xab6bdd[_0x8db2('0x23')]=_[_0x8db2('0x30')](_0xab6bdd[_0x8db2('0x23')],{'$or':_['map'](_0xab6bdd[_0x8db2('0x2c')],function(_0x18cc13){var _0x33dddd={};_0x33dddd[_0x18cc13]={'$like':'%'+_0x40c6e6[_0x8db2('0x28')][_0x8db2('0x47')]+'%'};return _0x33dddd;})});}_0xab6bdd=_[_0x8db2('0x30')]({},_0xab6bdd,_0x40c6e6[_0x8db2('0x31')]);return db['UserSmsQueue'][_0x8db2('0x48')](_0xab6bdd);}})[_0x8db2('0x17')](function(_0x4d3c19){if(_0x4d3c19){return db[_0x8db2('0x49')][_0x8db2('0x4a')]({'where':{'id':_['map'](_0x4d3c19,_0x8db2('0x4b')),'role':_0x8db2('0x4c')},'attributes':['id',_0x8db2('0x1d'),_0x8db2('0x4d'),_0x8db2('0x4e'),_0x8db2('0x4f')]});}})[_0x8db2('0x17')](function(_0x33a600){if(_0x33a600){return{'count':_0x33a600[_0x8db2('0x13')],'rows':_[_0x8db2('0x1e')](_0x33a600[_0x8db2('0x25')],function(_0x447a47){return{'membername':_0x447a47[_0x8db2('0x1d')],'UserId':_0x447a47['id'],'queue_name':_0x12a1ef[_0x8db2('0x1d')],'SmsQueueId':_0x12a1ef['id'],'interface':util[_0x8db2('0x50')](_0x8db2('0x51'),'SIP',_0x447a47[_0x8db2('0x1d')]),'penalty':0x0,'paused':_0x447a47[_0x8db2('0x4d')],'createdAt':_0x447a47[_0x8db2('0x4f')],'updatedAt':_0x447a47[_0x8db2('0x4e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8db2('0x17')](respondWithFilteredResult(_0x4355e2,_0xab6bdd))['catch'](handleError(_0x4355e2,null));};exports[_0x8db2('0x52')]=function(_0x2c3087,_0x3ab670){var _0x1e1c0d={};var _0x2ad70f={};var _0x348da8;var _0x17341d;return db[_0x8db2('0x1f')][_0x8db2('0x3f')]({'where':{'id':_0x2c3087[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x3ab670,null))[_0x8db2('0x17')](function(_0x170a72){if(_0x170a72){_0x348da8=_0x170a72;_0x2ad70f[_0x8db2('0x2b')]=_[_0x8db2('0x27')](db[_0x8db2('0x53')][_0x8db2('0x41')]);_0x2ad70f[_0x8db2('0x28')]=_['keys'](_0x2c3087[_0x8db2('0x28')]);_0x2ad70f['filters']=_[_0x8db2('0x2a')](_0x2ad70f['model'],_0x2ad70f[_0x8db2('0x28')]);_0x1e1c0d[_0x8db2('0x2c')]=_[_0x8db2('0x2a')](_0x2ad70f[_0x8db2('0x2b')],qs[_0x8db2('0x2d')](_0x2c3087['query']['fields']));_0x1e1c0d[_0x8db2('0x2c')]=_0x1e1c0d[_0x8db2('0x2c')][_0x8db2('0x2e')]?_0x1e1c0d[_0x8db2('0x2c')]:_0x2ad70f[_0x8db2('0x2b')];_0x1e1c0d[_0x8db2('0x44')]=qs[_0x8db2('0x45')](_0x2c3087[_0x8db2('0x28')]['sort']);_0x1e1c0d[_0x8db2('0x23')]=qs[_0x8db2('0x29')](_[_0x8db2('0x54')](_0x2c3087[_0x8db2('0x28')],_0x2ad70f[_0x8db2('0x29')]));if(_0x2c3087[_0x8db2('0x28')][_0x8db2('0x47')]){_0x1e1c0d[_0x8db2('0x23')]=_['merge'](_0x1e1c0d['where'],{'$or':_[_0x8db2('0x1e')](_0x1e1c0d[_0x8db2('0x2c')],function(_0x1d2dfc){var _0x27f4cd={};_0x27f4cd[_0x1d2dfc]={'$like':'%'+_0x2c3087[_0x8db2('0x28')]['filter']+'%'};return _0x27f4cd;})});}_0x1e1c0d=_['merge']({},_0x1e1c0d,_0x2c3087[_0x8db2('0x31')]);return _0x348da8[_0x8db2('0x52')](_0x1e1c0d);}})['then'](function(_0xa698bd){if(_0xa698bd){_0x17341d=_0xa698bd[_0x8db2('0x2e')];if(!_0x2c3087[_0x8db2('0x28')]['hasOwnProperty'](_0x8db2('0x43'))){_0x1e1c0d[_0x8db2('0x14')]=qs[_0x8db2('0x14')](_0x2c3087['query'][_0x8db2('0x14')]);_0x1e1c0d[_0x8db2('0x11')]=qs[_0x8db2('0x11')](_0x2c3087[_0x8db2('0x28')][_0x8db2('0x11')]);}return _0x348da8['getTeams'](_0x1e1c0d);}})[_0x8db2('0x17')](function(_0x3023fe){if(_0x3023fe){return _0x3023fe?{'count':_0x17341d,'rows':_0x3023fe}:null;}})[_0x8db2('0x17')](respondWithResult(_0x3ab670,null))['catch'](handleError(_0x3ab670,null));};exports['addTeams']=function(_0x2cdf3c,_0xbe05ca){var _0x487dcb=_0x2cdf3c[_0x8db2('0x3b')][_0x8db2('0x55')];return db[_0x8db2('0x53')][_0x8db2('0x48')]({'where':{'id':_0x487dcb},'attributes':['id'],'include':[{'model':db[_0x8db2('0x49')],'as':_0x8db2('0x56'),'attributes':['id',_0x8db2('0x1d'),_0x8db2('0x57'),_0x8db2('0x58'),_0x8db2('0x59')],'raw':!![]}]})[_0x8db2('0x17')](function(_0x3e1478){if(_0x3e1478){var _0x24a52d=_['flatMap'](_0x3e1478,function(_0x2ba42d){var _0x4f29f1=_0x2ba42d[_0x8db2('0x18')]({'plain':!![]});return _0x4f29f1[_0x8db2('0x56')];});return db['SmsQueue'][_0x8db2('0x32')]({'where':{'id':_0x2cdf3c[_0x8db2('0x3c')]['id']}})['then'](function(_0x2159c4){return db[_0x8db2('0x5a')][_0x8db2('0x5b')](function(_0x25a3ab){return _0x2159c4[_0x8db2('0x5c')](_0x487dcb,{'transaction':_0x25a3ab})[_0x8db2('0x17')](function(){return BPromise[_0x8db2('0x5d')](_0x24a52d,function(_0x3ac0fa){return db[_0x8db2('0x40')]['findOrCreate']({'where':{'UserId':_0x3ac0fa['id'],'SmsQueueId':_0x2cdf3c['params']['id']},'transaction':_0x25a3ab});});})[_0x8db2('0x17')](function(){_0x24a52d['forEach'](function(_0xf8afa5){socket[_0x8db2('0x5e')](_0x8db2('0x5f'),{'UserId':_0xf8afa5['id'],'SmsQueueId':_0x2159c4['id']});});});});});}})['then'](respondWithStatusCode(_0xbe05ca,null))[_0x8db2('0x3a')](handleError(_0xbe05ca,null));};exports[_0x8db2('0x60')]=function(_0x3e37e7,_0x591c5d){return db[_0x8db2('0x53')][_0x8db2('0x48')]({'where':{'id':_0x3e37e7[_0x8db2('0x28')][_0x8db2('0x55')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8db2('0x56'),'attributes':['id'],'raw':!![]}]})[_0x8db2('0x17')](handleEntityNotFound(_0x591c5d,null))[_0x8db2('0x17')](function(_0x1edb1a){var _0xcf1c42=_[_0x8db2('0x1e')](_0x1edb1a,'id');var _0x1aadfb=[];var _0x3682bf=[];var _0x358f48=squel[_0x8db2('0x61')]();_0x358f48[_0x8db2('0x62')]('tq.TeamId')[_0x8db2('0x63')](_0x8db2('0x64'),'tq')[_0x8db2('0x65')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x8db2('0x66'),_0x3e37e7[_0x8db2('0x3c')]['id']);for(var _0x3191c8=0x0;_0x3191c8<_0x1edb1a[_0x8db2('0x2e')];_0x3191c8+=0x1){let _0x2ad024=_0x1edb1a[_0x3191c8];for(var _0x313918=0x0;_0x313918<_0x2ad024[_0x8db2('0x56')][_0x8db2('0x2e')];_0x313918+=0x1){let _0x3b1929=_0x2ad024[_0x8db2('0x56')][_0x313918];var _0x46eb80=_0x358f48['clone']();_0x46eb80[_0x8db2('0x23')](_0x8db2('0x67'),_0x3b1929['id']);_0x3682bf[_0x8db2('0x68')](db[_0x8db2('0x5a')]['query'](_0x46eb80['toString'](),{'type':db[_0x8db2('0x5a')][_0x8db2('0x69')]['SELECT']})[_0x8db2('0x17')](function(_0x121f31){if(_0x121f31[_0x8db2('0x2e')]===0x1){return _0x3b1929['id'];}else{var _0x5f2ece=_['every'](_['map'](_0x121f31,_0x8db2('0x6a')),function(_0x18b4a6){return _[_0x8db2('0x6b')](_0xcf1c42,_0x18b4a6);});if(_0x5f2ece){return _0x3b1929['id'];}}}));}}return BPromise[_0x8db2('0x6c')](_0x3682bf)[_0x8db2('0x17')](function(_0x4e8aac){_0x1aadfb=_(_0x1aadfb)[_0x8db2('0x6d')](_0x4e8aac)['compact']()[_0x8db2('0x6e')]();return db[_0x8db2('0x1f')][_0x8db2('0x32')]({'where':{'id':_0x3e37e7[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](function(_0x5d5380){return db['sequelize'][_0x8db2('0x5b')](function(_0x51afcf){return _0x5d5380[_0x8db2('0x60')](_0x3e37e7[_0x8db2('0x28')][_0x8db2('0x55')],{'transaction':_0x51afcf})[_0x8db2('0x17')](function(){if(!_[_0x8db2('0x6f')](_0x1aadfb)){return _0x5d5380[_0x8db2('0x70')](_0x1aadfb,{'transaction':_0x51afcf});}})['then'](function(){_0x1aadfb[_0x8db2('0x71')](function(_0x222ea2){socket[_0x8db2('0x5e')]('userSmsQueue:remove',{'UserId':_0x222ea2,'SmsQueueId':_0x5d5380['id']});});});});});});})[_0x8db2('0x17')](respondWithStatusCode(_0x591c5d,null))[_0x8db2('0x3a')](handleError(_0x591c5d,null));};exports['addAgents']=function(_0x2d7abf,_0x7cb97d){return db[_0x8db2('0x1f')][_0x8db2('0x32')]({'where':{'id':_0x2d7abf[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x7cb97d,null))[_0x8db2('0x17')](function(_0x19e25b){if(_0x19e25b){return _0x19e25b[_0x8db2('0x72')](_0x2d7abf['body'][_0x8db2('0x55')],_[_0x8db2('0x73')](_0x2d7abf[_0x8db2('0x3b')],[_0x8db2('0x55'),'id'])||{})[_0x8db2('0x74')](function(_0x345ff9){for(var _0x16d1c5=0x0;_0x16d1c5<_0x2d7abf[_0x8db2('0x3b')][_0x8db2('0x55')][_0x8db2('0x2e')];_0x16d1c5+=0x1){socket['emit'](_0x8db2('0x5f'),{'UserId':Number(_0x2d7abf[_0x8db2('0x3b')][_0x8db2('0x55')][_0x16d1c5]),'SmsQueueId':Number(_0x2d7abf[_0x8db2('0x3c')]['id'])});}return _0x345ff9;});}})['then'](respondWithResult(_0x7cb97d,null))[_0x8db2('0x3a')](handleError(_0x7cb97d,null));};exports[_0x8db2('0x70')]=function(_0x46476e,_0x4f653e){return db['SmsQueue'][_0x8db2('0x32')]({'where':{'id':_0x46476e[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x4f653e,null))[_0x8db2('0x17')](function(_0x4f9ce4){if(_0x4f9ce4){return _0x4f9ce4[_0x8db2('0x70')](_0x46476e[_0x8db2('0x28')][_0x8db2('0x55')])[_0x8db2('0x17')](function(){if(_['isArray'](_0x46476e[_0x8db2('0x28')][_0x8db2('0x55')])){for(var _0x3e7b24=0x0;_0x3e7b24<_0x46476e['query']['ids']['length'];_0x3e7b24+=0x1){socket[_0x8db2('0x5e')](_0x8db2('0x75'),{'UserId':Number(_0x46476e[_0x8db2('0x28')][_0x8db2('0x55')][_0x3e7b24]),'SmsQueueId':Number(_0x46476e['params']['id'])});}}else{socket['emit'](_0x8db2('0x75'),{'UserId':Number(_0x46476e[_0x8db2('0x28')][_0x8db2('0x55')]),'SmsQueueId':Number(_0x46476e[_0x8db2('0x3c')]['id'])});}});}})[_0x8db2('0x17')](respondWithStatusCode(_0x4f653e,null))[_0x8db2('0x3a')](handleError(_0x4f653e,null));};exports['getAgents']=function(_0x2942eb,_0x5f32ce){var _0x432780={};var _0x23457b={};var _0x1ef898;var _0x39f2d3;return db[_0x8db2('0x1f')]['findOne']({'where':{'id':_0x2942eb[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x5f32ce,null))['then'](function(_0x28beec){if(_0x28beec){_0x1ef898=_0x28beec;_0x23457b[_0x8db2('0x2b')]=_[_0x8db2('0x27')](db[_0x8db2('0x49')]['rawAttributes']);_0x23457b[_0x8db2('0x28')]=_['keys'](_0x2942eb['query']);_0x23457b[_0x8db2('0x29')]=_[_0x8db2('0x2a')](_0x23457b[_0x8db2('0x2b')],_0x23457b[_0x8db2('0x28')]);_0x432780[_0x8db2('0x2c')]=_[_0x8db2('0x2a')](_0x23457b[_0x8db2('0x2b')],qs['fields'](_0x2942eb[_0x8db2('0x28')]['fields']));_0x432780['attributes']=_0x432780[_0x8db2('0x2c')]['length']?_0x432780['attributes']:_0x23457b[_0x8db2('0x2b')];_0x432780[_0x8db2('0x44')]=qs[_0x8db2('0x45')](_0x2942eb['query'][_0x8db2('0x45')]);_0x432780[_0x8db2('0x23')]=qs[_0x8db2('0x29')](_['pick'](_0x2942eb[_0x8db2('0x28')],_0x23457b[_0x8db2('0x29')]));if(_0x2942eb[_0x8db2('0x28')][_0x8db2('0x47')]){_0x432780[_0x8db2('0x23')]=_[_0x8db2('0x30')](_0x432780[_0x8db2('0x23')],{'$or':_[_0x8db2('0x1e')](_0x432780['attributes'],function(_0xa7b208){var _0x3cb456={};_0x3cb456[_0xa7b208]={'$like':'%'+_0x2942eb[_0x8db2('0x28')][_0x8db2('0x47')]+'%'};return _0x3cb456;})});}_0x432780=_[_0x8db2('0x30')]({},_0x432780,_0x2942eb[_0x8db2('0x31')]);return _0x1ef898[_0x8db2('0x76')](_0x432780);}})[_0x8db2('0x17')](function(_0x3a53e2){if(_0x3a53e2){_0x39f2d3=_0x3a53e2[_0x8db2('0x2e')];if(!_0x2942eb[_0x8db2('0x28')]['hasOwnProperty'](_0x8db2('0x43'))){_0x432780[_0x8db2('0x14')]=qs[_0x8db2('0x14')](_0x2942eb['query'][_0x8db2('0x14')]);_0x432780[_0x8db2('0x11')]=qs[_0x8db2('0x11')](_0x2942eb['query']['offset']);}return _0x1ef898[_0x8db2('0x76')](_0x432780);}})[_0x8db2('0x17')](function(_0x296966){if(_0x296966){return _0x296966?{'count':_0x39f2d3,'rows':_0x296966}:null;}})[_0x8db2('0x17')](respondWithResult(_0x5f32ce,null))[_0x8db2('0x3a')](handleError(_0x5f32ce,null));}; \ No newline at end of file +var _0x7a54=['transaction','addTeams','each','findOrCreate','userSmsQueue:save','removeTeams','Team','select','field','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','QueryTypes','SELECT','every','includes','all','compact','isEmpty','forEach','userSmsQueue:remove','addAgents','omit','emit','removeAgents','isArray','getAgents','bluebird','util','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsQueue.socket','status','end','json','offset','undefined','count','set','Content-Range','update','destroy','then','get','SmsQueues','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','type','key','getOptions','where','SmsQueue','include','rows','catch','show','params','model','query','intersection','fields','attributes','includeAll','merge','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserSmsQueue','length','hasOwnProperty','limit','order','sort','filters','pick','filter','User','UserId','createdAt','format','%s/%s','smsPause','getTeams','keys','nolimit','ids','findAll','Agents','online','voicePause','interface','flatMap','sequelize'];(function(_0x5b574d,_0x387fa0){var _0x13359f=function(_0x107824){while(--_0x107824){_0x5b574d['push'](_0x5b574d['shift']());}};_0x13359f(++_0x387fa0);}(_0x7a54,0x106));var _0x47a5=function(_0x2ddb1a,_0x17601d){_0x2ddb1a=_0x2ddb1a-0x0;var _0x599067=_0x7a54[_0x2ddb1a];return _0x599067;};'use strict';var BPromise=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var _=require(_0x47a5('0x2'));var squel=require('squel');var Redis=require(_0x47a5('0x3'));var qs=require(_0x47a5('0x4'));var logger=require('../../config/logger')(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var db=require(_0x47a5('0x7'))['db'];config[_0x47a5('0x8')]=_[_0x47a5('0x9')](config['redis'],{'host':_0x47a5('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x47a5('0x8')]));require(_0x47a5('0xb'))['register'](socket);function respondWithStatusCode(_0x194fb0,_0x5077f3){_0x5077f3=_0x5077f3||0xcc;return function(_0x5d90b3){if(_0x5d90b3){return _0x194fb0['sendStatus'](_0x5077f3);}return _0x194fb0[_0x47a5('0xc')](_0x5077f3)[_0x47a5('0xd')]();};}function respondWithResult(_0x5e31dd,_0x2eb0dd){_0x2eb0dd=_0x2eb0dd||0xc8;return function(_0x49e844){if(_0x49e844){return _0x5e31dd['status'](_0x2eb0dd)[_0x47a5('0xe')](_0x49e844);}};}function respondWithFilteredResult(_0x69e4d4,_0x2f399b){return function(_0x250fad){if(_0x250fad){var _0xd612dd=typeof _0x2f399b[_0x47a5('0xf')]===_0x47a5('0x10')&&typeof _0x2f399b['limit']===_0x47a5('0x10');var _0x221b54=_0x250fad[_0x47a5('0x11')];var _0x711793=_0xd612dd?0x0:_0x2f399b[_0x47a5('0xf')];var _0x620ee9=_0xd612dd?_0x250fad[_0x47a5('0x11')]:_0x2f399b[_0x47a5('0xf')]+_0x2f399b['limit'];var _0x362359;if(_0x620ee9>=_0x221b54){_0x620ee9=_0x221b54;_0x362359=0xc8;}else{_0x362359=0xce;}_0x69e4d4[_0x47a5('0xc')](_0x362359);return _0x69e4d4[_0x47a5('0x12')](_0x47a5('0x13'),_0x711793+'-'+_0x620ee9+'/'+_0x221b54)[_0x47a5('0xe')](_0x250fad);}return null;};}function saveUpdates(_0x574af6){return function(_0x549de3){if(_0x549de3){return _0x549de3[_0x47a5('0x14')](_0x574af6)['then'](function(_0x5247fd){return _0x5247fd;});}return null;};}function removeEntity(_0x423a81){return function(_0xaf70a6){if(_0xaf70a6){return _0xaf70a6[_0x47a5('0x15')]()[_0x47a5('0x16')](function(){var _0x477b1d=_0xaf70a6[_0x47a5('0x17')]({'plain':!![]});var _0x2763d6=_0x47a5('0x18');return db[_0x47a5('0x19')]['destroy']({'where':{'type':_0x2763d6,'resourceId':_0x477b1d['id']}})[_0x47a5('0x16')](function(){return _0xaf70a6;});})[_0x47a5('0x16')](function(){_0x423a81['status'](0xcc)[_0x47a5('0xd')]();});}};}function handleEntityNotFound(_0x1f03f7){return function(_0x36874d){if(!_0x36874d){_0x1f03f7['sendStatus'](0x194);}return _0x36874d;};}function handleError(_0xb8ae6c,_0x2f142b){_0x2f142b=_0x2f142b||0x1f4;return function(_0x23db32){logger[_0x47a5('0x1a')](_0x23db32['stack']);if(_0x23db32[_0x47a5('0x1b')]){delete _0x23db32[_0x47a5('0x1b')];}_0xb8ae6c['status'](_0x2f142b)[_0x47a5('0x1c')](_0x23db32);};}exports[_0x47a5('0x1d')]=function(_0x4437f1,_0x129ce5){var _0x3abd6a={};var _0x50bf17={'count':0x0,'rows':[]};var _0x53078a=_[_0x47a5('0x1e')](db['SmsQueue'][_0x47a5('0x1f')],function(_0x5b6c4e){return{'name':_0x5b6c4e[_0x47a5('0x20')],'type':_0x5b6c4e[_0x47a5('0x21')][_0x47a5('0x22')]};});_0x3abd6a=qs[_0x47a5('0x23')](_0x53078a,_0x4437f1);var _0x21f296={'where':_0x3abd6a[_0x47a5('0x24')]};return db[_0x47a5('0x25')][_0x47a5('0x11')](_0x21f296)[_0x47a5('0x16')](function(_0x361bfa){_0x50bf17[_0x47a5('0x11')]=_0x361bfa;_0x3abd6a[_0x47a5('0x26')]=qs[_0x47a5('0x26')](_0x4437f1['query']);return db[_0x47a5('0x25')]['findAll'](_0x3abd6a);})[_0x47a5('0x16')](function(_0x9ac908){_0x50bf17[_0x47a5('0x27')]=_0x9ac908;return _0x50bf17;})['then'](respondWithFilteredResult(_0x129ce5,_0x3abd6a))[_0x47a5('0x28')](handleError(_0x129ce5,null));};exports[_0x47a5('0x29')]=function(_0x39b50b,_0x1f1c68){var _0x51cc81={'raw':!![],'where':{'id':_0x39b50b[_0x47a5('0x2a')]['id']}},_0x50d875={};_0x50d875[_0x47a5('0x2b')]=_['keys'](db['SmsQueue'][_0x47a5('0x1f')]);_0x50d875[_0x47a5('0x2c')]=_['keys'](_0x39b50b[_0x47a5('0x2c')]);_0x50d875['filters']=_[_0x47a5('0x2d')](_0x50d875[_0x47a5('0x2b')],_0x50d875['query']);_0x51cc81['attributes']=_[_0x47a5('0x2d')](_0x50d875['model'],qs[_0x47a5('0x2e')](_0x39b50b[_0x47a5('0x2c')][_0x47a5('0x2e')]));_0x51cc81['attributes']=_0x51cc81[_0x47a5('0x2f')]['length']?_0x51cc81['attributes']:_0x50d875[_0x47a5('0x2b')];if(_0x39b50b['query'][_0x47a5('0x30')]){_0x51cc81['include']=[{'all':!![]}];}_0x51cc81=_[_0x47a5('0x31')]({},_0x51cc81,_0x39b50b[_0x47a5('0x32')]);return db[_0x47a5('0x25')][_0x47a5('0x33')](_0x51cc81)[_0x47a5('0x16')](handleEntityNotFound(_0x1f1c68,null))[_0x47a5('0x16')](respondWithResult(_0x1f1c68,null))[_0x47a5('0x28')](handleError(_0x1f1c68,null));};exports[_0x47a5('0x34')]=function(_0x1a0d23,_0x4caed5){return db[_0x47a5('0x25')][_0x47a5('0x34')](_0x1a0d23['body'],{})[_0x47a5('0x16')](function(_0x2bf53d){var _0x1d4348=_0x1a0d23['user'][_0x47a5('0x17')]({'plain':!![]});if(!_0x1d4348)throw new Error(_0x47a5('0x35'));if(_0x1d4348['role']===_0x47a5('0x36')){var _0x19218a=_0x2bf53d['get']({'plain':!![]});var _0x55c5eb='SmsQueues';return db[_0x47a5('0x37')]['find']({'where':{'name':_0x55c5eb,'userProfileId':_0x1d4348[_0x47a5('0x38')]},'raw':!![]})[_0x47a5('0x16')](function(_0x301a85){if(_0x301a85&&_0x301a85[_0x47a5('0x39')]===0x0){return db[_0x47a5('0x19')][_0x47a5('0x34')]({'name':_0x19218a[_0x47a5('0x1b')],'resourceId':_0x19218a['id'],'type':_0x301a85[_0x47a5('0x1b')],'sectionId':_0x301a85['id']},{})[_0x47a5('0x16')](function(){return _0x2bf53d;});}else{return _0x2bf53d;}})[_0x47a5('0x28')](function(_0x280500){logger[_0x47a5('0x1a')](_0x47a5('0x3a'),_0x280500);throw _0x280500;});}return _0x2bf53d;})['then'](respondWithResult(_0x4caed5,0xc9))[_0x47a5('0x28')](handleError(_0x4caed5,null));};exports[_0x47a5('0x14')]=function(_0x331474,_0x23bd8d){if(_0x331474['body']['id']){delete _0x331474[_0x47a5('0x3b')]['id'];}return db['SmsQueue']['find']({'where':{'id':_0x331474['params']['id']}})['then'](handleEntityNotFound(_0x23bd8d,null))[_0x47a5('0x16')](saveUpdates(_0x331474['body'],null))[_0x47a5('0x16')](respondWithResult(_0x23bd8d,null))[_0x47a5('0x28')](handleError(_0x23bd8d,null));};exports[_0x47a5('0x15')]=function(_0x494526,_0x3805fd){return db[_0x47a5('0x25')]['find']({'where':{'id':_0x494526['params']['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x3805fd,null))['then'](removeEntity(_0x3805fd,null))[_0x47a5('0x28')](handleError(_0x3805fd,null));};exports[_0x47a5('0x3c')]=function(_0x188614,_0xd75ca3){return db[_0x47a5('0x25')][_0x47a5('0x3c')]()[_0x47a5('0x16')](respondWithResult(_0xd75ca3,null))[_0x47a5('0x28')](handleError(_0xd75ca3,null));};exports[_0x47a5('0x3d')]=function(_0x162fa0,_0x24ecb1){var _0x3c3ebf={'raw':!![],'where':{}},_0xe28d76={},_0x3574d4;return db[_0x47a5('0x25')][_0x47a5('0x3e')]({'where':{'id':_0x162fa0['params']['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x24ecb1,null))[_0x47a5('0x16')](function(_0x49eab1){if(_0x49eab1){_0x3574d4=_0x49eab1['get']({'plain':!![]});_0xe28d76[_0x47a5('0x2b')]=_['keys'](db[_0x47a5('0x3f')][_0x47a5('0x1f')]);_0xe28d76['query']=_['keys'](_0x162fa0[_0x47a5('0x2c')]);_0xe28d76['filters']=_[_0x47a5('0x2d')](_0xe28d76[_0x47a5('0x2b')],_0xe28d76[_0x47a5('0x2c')]);_0x3c3ebf[_0x47a5('0x2f')]=_[_0x47a5('0x2d')](_0xe28d76[_0x47a5('0x2b')],qs[_0x47a5('0x2e')](_0x162fa0['query']['fields']));_0x3c3ebf[_0x47a5('0x2f')]=_0x3c3ebf[_0x47a5('0x2f')][_0x47a5('0x40')]?_0x3c3ebf[_0x47a5('0x2f')]:_0xe28d76[_0x47a5('0x2b')];if(!_0x162fa0[_0x47a5('0x2c')][_0x47a5('0x41')]('nolimit')){_0x3c3ebf[_0x47a5('0x42')]=qs[_0x47a5('0x42')](_0x162fa0[_0x47a5('0x2c')]['limit']);_0x3c3ebf[_0x47a5('0xf')]=qs['offset'](_0x162fa0[_0x47a5('0x2c')][_0x47a5('0xf')]);}_0x3c3ebf[_0x47a5('0x43')]=qs[_0x47a5('0x44')](_0x162fa0['query'][_0x47a5('0x44')]);_0x3c3ebf[_0x47a5('0x24')]=qs[_0x47a5('0x45')](_[_0x47a5('0x46')](_0x162fa0[_0x47a5('0x2c')],_0xe28d76[_0x47a5('0x45')]));_0x3c3ebf[_0x47a5('0x24')]['SmsQueueId']=_0x49eab1['id'];if(_0x162fa0[_0x47a5('0x2c')][_0x47a5('0x47')]){_0x3c3ebf[_0x47a5('0x24')]=_[_0x47a5('0x31')](_0x3c3ebf[_0x47a5('0x24')],{'$or':_[_0x47a5('0x1e')](_0x3c3ebf['attributes'],function(_0x1ad6a9){var _0x245a15={};_0x245a15[_0x1ad6a9]={'$like':'%'+_0x162fa0[_0x47a5('0x2c')]['filter']+'%'};return _0x245a15;})});}_0x3c3ebf=_[_0x47a5('0x31')]({},_0x3c3ebf,_0x162fa0[_0x47a5('0x32')]);return db[_0x47a5('0x3f')]['findAll'](_0x3c3ebf);}})['then'](function(_0x274e38){if(_0x274e38){return db[_0x47a5('0x48')]['findAndCountAll']({'where':{'id':_['map'](_0x274e38,_0x47a5('0x49')),'role':'agent'},'attributes':['id',_0x47a5('0x1b'),'smsPause','updatedAt',_0x47a5('0x4a')]});}})[_0x47a5('0x16')](function(_0x53eedf){if(_0x53eedf){return{'count':_0x53eedf[_0x47a5('0x11')],'rows':_[_0x47a5('0x1e')](_0x53eedf['rows'],function(_0x5b6127){return{'membername':_0x5b6127[_0x47a5('0x1b')],'UserId':_0x5b6127['id'],'queue_name':_0x3574d4[_0x47a5('0x1b')],'SmsQueueId':_0x3574d4['id'],'interface':util[_0x47a5('0x4b')](_0x47a5('0x4c'),'SIP',_0x5b6127[_0x47a5('0x1b')]),'penalty':0x0,'paused':_0x5b6127[_0x47a5('0x4d')],'createdAt':_0x5b6127[_0x47a5('0x4a')],'updatedAt':_0x5b6127['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x47a5('0x16')](respondWithFilteredResult(_0x24ecb1,_0x3c3ebf))['catch'](handleError(_0x24ecb1,null));};exports[_0x47a5('0x4e')]=function(_0x470da6,_0x943a15){var _0x1c485b={};var _0x3603b7={};var _0x4966af;var _0x144af9;return db['SmsQueue']['findOne']({'where':{'id':_0x470da6['params']['id']}})['then'](handleEntityNotFound(_0x943a15,null))[_0x47a5('0x16')](function(_0x6cd4ea){if(_0x6cd4ea){_0x4966af=_0x6cd4ea;_0x3603b7[_0x47a5('0x2b')]=_['keys'](db['Team'][_0x47a5('0x1f')]);_0x3603b7[_0x47a5('0x2c')]=_[_0x47a5('0x4f')](_0x470da6[_0x47a5('0x2c')]);_0x3603b7[_0x47a5('0x45')]=_['intersection'](_0x3603b7[_0x47a5('0x2b')],_0x3603b7['query']);_0x1c485b[_0x47a5('0x2f')]=_[_0x47a5('0x2d')](_0x3603b7['model'],qs[_0x47a5('0x2e')](_0x470da6[_0x47a5('0x2c')][_0x47a5('0x2e')]));_0x1c485b[_0x47a5('0x2f')]=_0x1c485b[_0x47a5('0x2f')][_0x47a5('0x40')]?_0x1c485b[_0x47a5('0x2f')]:_0x3603b7[_0x47a5('0x2b')];_0x1c485b['order']=qs[_0x47a5('0x44')](_0x470da6[_0x47a5('0x2c')][_0x47a5('0x44')]);_0x1c485b[_0x47a5('0x24')]=qs[_0x47a5('0x45')](_['pick'](_0x470da6[_0x47a5('0x2c')],_0x3603b7[_0x47a5('0x45')]));if(_0x470da6[_0x47a5('0x2c')][_0x47a5('0x47')]){_0x1c485b[_0x47a5('0x24')]=_[_0x47a5('0x31')](_0x1c485b[_0x47a5('0x24')],{'$or':_[_0x47a5('0x1e')](_0x1c485b[_0x47a5('0x2f')],function(_0x44cb90){var _0x1d56f3={};_0x1d56f3[_0x44cb90]={'$like':'%'+_0x470da6[_0x47a5('0x2c')][_0x47a5('0x47')]+'%'};return _0x1d56f3;})});}_0x1c485b=_[_0x47a5('0x31')]({},_0x1c485b,_0x470da6[_0x47a5('0x32')]);return _0x4966af['getTeams'](_0x1c485b);}})[_0x47a5('0x16')](function(_0x284fb8){if(_0x284fb8){_0x144af9=_0x284fb8[_0x47a5('0x40')];if(!_0x470da6['query'][_0x47a5('0x41')](_0x47a5('0x50'))){_0x1c485b[_0x47a5('0x42')]=qs[_0x47a5('0x42')](_0x470da6['query'][_0x47a5('0x42')]);_0x1c485b['offset']=qs[_0x47a5('0xf')](_0x470da6['query'][_0x47a5('0xf')]);}return _0x4966af['getTeams'](_0x1c485b);}})[_0x47a5('0x16')](function(_0x2f27c3){if(_0x2f27c3){return _0x2f27c3?{'count':_0x144af9,'rows':_0x2f27c3}:null;}})[_0x47a5('0x16')](respondWithResult(_0x943a15,null))['catch'](handleError(_0x943a15,null));};exports['addTeams']=function(_0x4b8084,_0x4164a3){var _0x2b1303=_0x4b8084[_0x47a5('0x3b')][_0x47a5('0x51')];return db['Team'][_0x47a5('0x52')]({'where':{'id':_0x2b1303},'attributes':['id'],'include':[{'model':db[_0x47a5('0x48')],'as':_0x47a5('0x53'),'attributes':['id',_0x47a5('0x1b'),_0x47a5('0x54'),_0x47a5('0x55'),_0x47a5('0x56')],'raw':!![]}]})[_0x47a5('0x16')](function(_0x4618a0){if(_0x4618a0){var _0xc69a68=_[_0x47a5('0x57')](_0x4618a0,function(_0x463e5e){var _0x49d3dc=_0x463e5e[_0x47a5('0x17')]({'plain':!![]});return _0x49d3dc['Agents'];});return db[_0x47a5('0x25')][_0x47a5('0x33')]({'where':{'id':_0x4b8084[_0x47a5('0x2a')]['id']}})[_0x47a5('0x16')](function(_0x40e584){return db[_0x47a5('0x58')][_0x47a5('0x59')](function(_0x448981){return _0x40e584[_0x47a5('0x5a')](_0x2b1303,{'transaction':_0x448981})[_0x47a5('0x16')](function(){return BPromise[_0x47a5('0x5b')](_0xc69a68,function(_0x1f07ac){return db[_0x47a5('0x3f')][_0x47a5('0x5c')]({'where':{'UserId':_0x1f07ac['id'],'SmsQueueId':_0x4b8084[_0x47a5('0x2a')]['id']},'transaction':_0x448981});});})['then'](function(){_0xc69a68['forEach'](function(_0x5ccc89){socket['emit'](_0x47a5('0x5d'),{'UserId':_0x5ccc89['id'],'SmsQueueId':_0x40e584['id']});});});});});}})[_0x47a5('0x16')](respondWithStatusCode(_0x4164a3,null))['catch'](handleError(_0x4164a3,null));};exports[_0x47a5('0x5e')]=function(_0x44dda2,_0x1baa5a){return db[_0x47a5('0x5f')][_0x47a5('0x52')]({'where':{'id':_0x44dda2[_0x47a5('0x2c')][_0x47a5('0x51')]},'attributes':['id'],'include':[{'model':db[_0x47a5('0x48')],'as':_0x47a5('0x53'),'attributes':['id'],'raw':!![]}]})[_0x47a5('0x16')](handleEntityNotFound(_0x1baa5a,null))[_0x47a5('0x16')](function(_0x5e5f16){var _0x18fa31=_[_0x47a5('0x1e')](_0x5e5f16,'id');var _0x420671=[];var _0x4f35ff=[];var _0x340846=squel[_0x47a5('0x60')]();_0x340846[_0x47a5('0x61')]('tq.TeamId')[_0x47a5('0x62')]('team_has_sms_queues','tq')['join'](_0x47a5('0x63'),'ut',_0x47a5('0x64'))[_0x47a5('0x24')](_0x47a5('0x65'),_0x44dda2[_0x47a5('0x2a')]['id']);for(var _0xea50f3=0x0;_0xea50f3<_0x5e5f16['length'];_0xea50f3+=0x1){let _0x592322=_0x5e5f16[_0xea50f3];for(var _0x3e0dbd=0x0;_0x3e0dbd<_0x592322['Agents'][_0x47a5('0x40')];_0x3e0dbd+=0x1){let _0x3fffd1=_0x592322[_0x47a5('0x53')][_0x3e0dbd];var _0xb16bdd=_0x340846['clone']();_0xb16bdd[_0x47a5('0x24')]('ut.UserId\x20=\x20?',_0x3fffd1['id']);_0x4f35ff['push'](db[_0x47a5('0x58')][_0x47a5('0x2c')](_0xb16bdd['toString'](),{'type':db[_0x47a5('0x58')][_0x47a5('0x66')][_0x47a5('0x67')]})['then'](function(_0x280372){if(_0x280372['length']===0x1){return _0x3fffd1['id'];}else{var _0x2307da=_[_0x47a5('0x68')](_[_0x47a5('0x1e')](_0x280372,'TeamId'),function(_0x2e0af1){return _[_0x47a5('0x69')](_0x18fa31,_0x2e0af1);});if(_0x2307da){return _0x3fffd1['id'];}}}));}}return BPromise[_0x47a5('0x6a')](_0x4f35ff)['then'](function(_0x3525e7){_0x420671=_(_0x420671)['union'](_0x3525e7)[_0x47a5('0x6b')]()['value']();return db[_0x47a5('0x25')][_0x47a5('0x33')]({'where':{'id':_0x44dda2[_0x47a5('0x2a')]['id']}})[_0x47a5('0x16')](function(_0x51738b){return db[_0x47a5('0x58')][_0x47a5('0x59')](function(_0x23c393){return _0x51738b[_0x47a5('0x5e')](_0x44dda2[_0x47a5('0x2c')]['ids'],{'transaction':_0x23c393})['then'](function(){if(!_[_0x47a5('0x6c')](_0x420671)){return _0x51738b['removeAgents'](_0x420671,{'transaction':_0x23c393});}})[_0x47a5('0x16')](function(){_0x420671[_0x47a5('0x6d')](function(_0x216402){socket['emit'](_0x47a5('0x6e'),{'UserId':_0x216402,'SmsQueueId':_0x51738b['id']});});});});});});})[_0x47a5('0x16')](respondWithStatusCode(_0x1baa5a,null))['catch'](handleError(_0x1baa5a,null));};exports[_0x47a5('0x6f')]=function(_0x8a9dea,_0x19acfa){return db[_0x47a5('0x25')]['find']({'where':{'id':_0x8a9dea['params']['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x19acfa,null))[_0x47a5('0x16')](function(_0x48e7f3){if(_0x48e7f3){return _0x48e7f3[_0x47a5('0x6f')](_0x8a9dea[_0x47a5('0x3b')]['ids'],_[_0x47a5('0x70')](_0x8a9dea[_0x47a5('0x3b')],[_0x47a5('0x51'),'id'])||{})['spread'](function(_0x3f2ad9){for(var _0x59b4a5=0x0;_0x59b4a5<_0x8a9dea[_0x47a5('0x3b')]['ids'][_0x47a5('0x40')];_0x59b4a5+=0x1){socket[_0x47a5('0x71')]('userSmsQueue:save',{'UserId':Number(_0x8a9dea[_0x47a5('0x3b')]['ids'][_0x59b4a5]),'SmsQueueId':Number(_0x8a9dea[_0x47a5('0x2a')]['id'])});}return _0x3f2ad9;});}})[_0x47a5('0x16')](respondWithResult(_0x19acfa,null))[_0x47a5('0x28')](handleError(_0x19acfa,null));};exports[_0x47a5('0x72')]=function(_0x49b76a,_0x3eb5c1){return db['SmsQueue']['find']({'where':{'id':_0x49b76a[_0x47a5('0x2a')]['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x3eb5c1,null))[_0x47a5('0x16')](function(_0x96fb22){if(_0x96fb22){return _0x96fb22[_0x47a5('0x72')](_0x49b76a['query'][_0x47a5('0x51')])[_0x47a5('0x16')](function(){if(_[_0x47a5('0x73')](_0x49b76a[_0x47a5('0x2c')]['ids'])){for(var _0x240db9=0x0;_0x240db9<_0x49b76a['query'][_0x47a5('0x51')][_0x47a5('0x40')];_0x240db9+=0x1){socket[_0x47a5('0x71')](_0x47a5('0x6e'),{'UserId':Number(_0x49b76a[_0x47a5('0x2c')][_0x47a5('0x51')][_0x240db9]),'SmsQueueId':Number(_0x49b76a[_0x47a5('0x2a')]['id'])});}}else{socket[_0x47a5('0x71')](_0x47a5('0x6e'),{'UserId':Number(_0x49b76a['query'][_0x47a5('0x51')]),'SmsQueueId':Number(_0x49b76a[_0x47a5('0x2a')]['id'])});}});}})['then'](respondWithStatusCode(_0x3eb5c1,null))[_0x47a5('0x28')](handleError(_0x3eb5c1,null));};exports[_0x47a5('0x74')]=function(_0x6d6a5,_0x5b85cd){var _0x4bf1f5={};var _0x126bb1={};var _0x3d7371;var _0x47fbb6;return db['SmsQueue'][_0x47a5('0x3e')]({'where':{'id':_0x6d6a5[_0x47a5('0x2a')]['id']}})['then'](handleEntityNotFound(_0x5b85cd,null))[_0x47a5('0x16')](function(_0x269ff6){if(_0x269ff6){_0x3d7371=_0x269ff6;_0x126bb1['model']=_[_0x47a5('0x4f')](db[_0x47a5('0x48')][_0x47a5('0x1f')]);_0x126bb1[_0x47a5('0x2c')]=_[_0x47a5('0x4f')](_0x6d6a5[_0x47a5('0x2c')]);_0x126bb1['filters']=_['intersection'](_0x126bb1['model'],_0x126bb1[_0x47a5('0x2c')]);_0x4bf1f5[_0x47a5('0x2f')]=_['intersection'](_0x126bb1[_0x47a5('0x2b')],qs[_0x47a5('0x2e')](_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0x2e')]));_0x4bf1f5[_0x47a5('0x2f')]=_0x4bf1f5['attributes'][_0x47a5('0x40')]?_0x4bf1f5['attributes']:_0x126bb1['model'];_0x4bf1f5['order']=qs[_0x47a5('0x44')](_0x6d6a5['query'][_0x47a5('0x44')]);_0x4bf1f5[_0x47a5('0x24')]=qs[_0x47a5('0x45')](_['pick'](_0x6d6a5[_0x47a5('0x2c')],_0x126bb1[_0x47a5('0x45')]));if(_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0x47')]){_0x4bf1f5[_0x47a5('0x24')]=_['merge'](_0x4bf1f5[_0x47a5('0x24')],{'$or':_[_0x47a5('0x1e')](_0x4bf1f5['attributes'],function(_0x42ba59){var _0x419870={};_0x419870[_0x42ba59]={'$like':'%'+_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0x47')]+'%'};return _0x419870;})});}_0x4bf1f5=_[_0x47a5('0x31')]({},_0x4bf1f5,_0x6d6a5[_0x47a5('0x32')]);return _0x3d7371['getAgents'](_0x4bf1f5);}})[_0x47a5('0x16')](function(_0x2e418d){if(_0x2e418d){_0x47fbb6=_0x2e418d['length'];if(!_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0x41')](_0x47a5('0x50'))){_0x4bf1f5[_0x47a5('0x42')]=qs['limit'](_0x6d6a5['query']['limit']);_0x4bf1f5['offset']=qs[_0x47a5('0xf')](_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0xf')]);}return _0x3d7371[_0x47a5('0x74')](_0x4bf1f5);}})[_0x47a5('0x16')](function(_0x6bc37b){if(_0x6bc37b){return _0x6bc37b?{'count':_0x47fbb6,'rows':_0x6bc37b}:null;}})[_0x47a5('0x16')](respondWithResult(_0x5b85cd,null))[_0x47a5('0x28')](handleError(_0x5b85cd,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index f7a1207..1794c80 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 _0x06b4=['../../mysqldb','SmsQueue','setMaxListeners','save','remove','hasOwnProperty','exports','events'];(function(_0x4a209a,_0x575ff9){var _0x4b3c20=function(_0x1a50c1){while(--_0x1a50c1){_0x4a209a['push'](_0x4a209a['shift']());}};_0x4b3c20(++_0x575ff9);}(_0x06b4,0x11f));var _0x406b=function(_0x3c8c78,_0x10081b){_0x3c8c78=_0x3c8c78-0x0;var _0x1a938f=_0x06b4[_0x3c8c78];return _0x1a938f;};'use strict';var EventEmitter=require(_0x406b('0x0'));var SmsQueue=require(_0x406b('0x1'))['db'][_0x406b('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x406b('0x3')](0x0);var events={'afterCreate':_0x406b('0x4'),'afterUpdate':'update','afterDestroy':_0x406b('0x5')};function emitEvent(_0x585a50){return function(_0xeb4e63,_0x407382,_0x37ccec){SmsQueueEvents['emit'](_0x585a50+':'+_0xeb4e63['id'],_0xeb4e63);SmsQueueEvents['emit'](_0x585a50,_0xeb4e63);_0x37ccec(null);};}for(var e in events){if(events[_0x406b('0x6')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0x406b('0x7')]=SmsQueueEvents; \ No newline at end of file +var _0x707b=['../../mysqldb','SmsQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x5d267f,_0x5a5900){var _0x526a72=function(_0x3a99cf){while(--_0x3a99cf){_0x5d267f['push'](_0x5d267f['shift']());}};_0x526a72(++_0x5a5900);}(_0x707b,0xfc));var _0xb707=function(_0x17788a,_0x150887){_0x17788a=_0x17788a-0x0;var _0x33f47c=_0x707b[_0x17788a];return _0x33f47c;};'use strict';var EventEmitter=require(_0xb707('0x0'));var SmsQueue=require(_0xb707('0x1'))['db'][_0xb707('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xb707('0x3')](0x0);var events={'afterCreate':_0xb707('0x4'),'afterUpdate':_0xb707('0x5'),'afterDestroy':_0xb707('0x6')};function emitEvent(_0x23b64e){return function(_0x4d3c64,_0x47e908,_0x210299){SmsQueueEvents[_0xb707('0x7')](_0x23b64e+':'+_0x4d3c64['id'],_0x4d3c64);SmsQueueEvents[_0xb707('0x7')](_0x23b64e,_0x4d3c64);_0x210299(null);};}for(var e in events){if(events[_0xb707('0x8')](e)){var event=events[e];SmsQueue[_0xb707('0x9')](e,emitEvent(event));}}module[_0xb707('0xa')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index fc2cbc6..779f908 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 _0x820c=['SmsQueue','sms_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x820c,0xb2));var _0xc820=function(_0x23d6c8,_0x22a8fd){_0x23d6c8=_0x23d6c8-0x0;var _0x5b9a11=_0x820c[_0x23d6c8];return _0x5b9a11;};'use strict';var _=require(_0xc820('0x0'));var util=require('util');var logger=require(_0xc820('0x1'))(_0xc820('0x2'));var moment=require(_0xc820('0x3'));var BPromise=require(_0xc820('0x4'));var rp=require(_0xc820('0x5'));var fs=require('fs');var path=require(_0xc820('0x6'));var rimraf=require(_0xc820('0x7'));var config=require(_0xc820('0x8'));var attributes=require('./smsQueue.attributes');module['exports']=function(_0xca5d96,_0x3863ba){return _0xca5d96['define'](_0xc820('0x9'),attributes,{'tableName':_0xc820('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd716=['SmsQueue','sms_queues','lodash','util','../../config/logger','bluebird','request-promise','rimraf','./smsQueue.attributes','exports','define'];(function(_0xd050c6,_0x58ffb4){var _0x7278a=function(_0x16d03e){while(--_0x16d03e){_0xd050c6['push'](_0xd050c6['shift']());}};_0x7278a(++_0x58ffb4);}(_0xd716,0x70));var _0x6d71=function(_0xa1e7d7,_0x5714bb){_0xa1e7d7=_0xa1e7d7-0x0;var _0x287bee=_0xd716[_0xa1e7d7];return _0x287bee;};'use strict';var _=require(_0x6d71('0x0'));var util=require(_0x6d71('0x1'));var logger=require(_0x6d71('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6d71('0x3'));var rp=require(_0x6d71('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6d71('0x5'));var config=require('../../config/environment');var attributes=require(_0x6d71('0x6'));module[_0x6d71('0x7')]=function(_0x5fae21,_0x2b7d9e){return _0x5fae21[_0x6d71('0x8')](_0x6d71('0x9'),attributes,{'tableName':_0x6d71('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 f734591..422d916 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 _0x5a1e=['SmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','GetSmsQueue','findAll','options','raw','attributes','limit','include','model','map','catch','SmsQueue','find','where','ShowSmsQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./smsQueue.socket','register','request','then','info'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x5a1e,0x165));var _0xe5a1=function(_0x227427,_0x3159c8){_0x227427=_0x227427-0x0;var _0x51d536=_0x5a1e[_0x227427];return _0x51d536;};'use strict';var _=require(_0xe5a1('0x0'));var util=require(_0xe5a1('0x1'));var moment=require(_0xe5a1('0x2'));var BPromise=require(_0xe5a1('0x3'));var rs=require(_0xe5a1('0x4'));var fs=require('fs');var Redis=require(_0xe5a1('0x5'));var db=require(_0xe5a1('0x6'))['db'];var utils=require(_0xe5a1('0x7'));var logger=require(_0xe5a1('0x8'))('rpc');var config=require(_0xe5a1('0x9'));var jayson=require(_0xe5a1('0xa'));var client=jayson[_0xe5a1('0xb')][_0xe5a1('0xc')]({'port':0x232a});config['redis']=_[_0xe5a1('0xd')](config[_0xe5a1('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0xe5a1('0xf'))(new Redis(config[_0xe5a1('0xe')]));require(_0xe5a1('0x10'))[_0xe5a1('0x11')](socket);function respondWithRpcPromise(_0x5d9f74,_0x2725b2,_0x23ddfb){return new BPromise(function(_0x553be0,_0x270538){return client[_0xe5a1('0x12')](_0x5d9f74,_0x23ddfb)[_0xe5a1('0x13')](function(_0x2ca315){logger[_0xe5a1('0x14')](_0xe5a1('0x15'),_0x2725b2,_0xe5a1('0x16'));logger[_0xe5a1('0x17')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x2725b2,'request\x20sent',JSON[_0xe5a1('0x18')](_0x2ca315));if(_0x2ca315[_0xe5a1('0x19')]){if(_0x2ca315[_0xe5a1('0x19')][_0xe5a1('0x1a')]===0x1f4){logger[_0xe5a1('0x19')]('SmsQueue,\x20%s,\x20%s',_0x2725b2,_0x2ca315[_0xe5a1('0x19')][_0xe5a1('0x1b')]);return _0x270538(_0x2ca315[_0xe5a1('0x19')][_0xe5a1('0x1b')]);}logger[_0xe5a1('0x19')](_0xe5a1('0x15'),_0x2725b2,_0x2ca315[_0xe5a1('0x19')][_0xe5a1('0x1b')]);return _0x553be0(_0x2ca315[_0xe5a1('0x19')][_0xe5a1('0x1b')]);}else{logger[_0xe5a1('0x14')](_0xe5a1('0x15'),_0x2725b2,_0xe5a1('0x16'));_0x553be0(_0x2ca315['result'][_0xe5a1('0x1b')]);}})['catch'](function(_0x24f1b4){logger[_0xe5a1('0x19')](_0xe5a1('0x15'),_0x2725b2,_0x24f1b4);_0x270538(_0x24f1b4);});});}exports[_0xe5a1('0x1c')]=function(_0x47436f){var _0x450c11=this;return new Promise(function(_0x364a03,_0x47b2a4){return db['SmsQueue'][_0xe5a1('0x1d')]({'raw':_0x47436f[_0xe5a1('0x1e')]?_0x47436f[_0xe5a1('0x1e')][_0xe5a1('0x1f')]===undefined?!![]:![]:!![],'where':_0x47436f[_0xe5a1('0x1e')]?_0x47436f['options']['where']||null:null,'attributes':_0x47436f[_0xe5a1('0x1e')]?_0x47436f[_0xe5a1('0x1e')][_0xe5a1('0x20')]||null:null,'limit':_0x47436f['options']?_0x47436f[_0xe5a1('0x1e')][_0xe5a1('0x21')]||null:null,'include':_0x47436f['options']?_0x47436f[_0xe5a1('0x1e')]['include']?_['map'](_0x47436f[_0xe5a1('0x1e')][_0xe5a1('0x22')],function(_0x2e0014){return{'model':db[_0x2e0014[_0xe5a1('0x23')]],'as':_0x2e0014['as'],'attributes':_0x2e0014[_0xe5a1('0x20')],'include':_0x2e0014[_0xe5a1('0x22')]?_['map'](_0x2e0014['include'],function(_0x20950e){return{'model':db[_0x20950e['model']],'as':_0x20950e['as'],'attributes':_0x20950e[_0xe5a1('0x20')],'include':_0x20950e[_0xe5a1('0x22')]?_[_0xe5a1('0x24')](_0x20950e['include'],function(_0x181cc5){return{'model':db[_0x181cc5[_0xe5a1('0x23')]],'as':_0x181cc5['as'],'attributes':_0x181cc5['attributes']};}):[]};}):[]};}):[]:[]})[_0xe5a1('0x13')](function(_0x50eef9){logger[_0xe5a1('0x14')]('GetSmsQueue',_0x47436f);logger[_0xe5a1('0x17')](_0xe5a1('0x1c'),_0x47436f,JSON['stringify'](_0x50eef9));_0x364a03(_0x50eef9);})[_0xe5a1('0x25')](function(_0x41544b){logger[_0xe5a1('0x19')](_0xe5a1('0x1c'),_0x41544b['message'],_0x47436f);_0x47b2a4(_0x450c11[_0xe5a1('0x19')](0x1f4,_0x41544b['message']));});});};exports['ShowSmsQueue']=function(_0x529624){var _0x38f733=this;return new Promise(function(_0x4509a7,_0x50ee7b){return db[_0xe5a1('0x26')][_0xe5a1('0x27')]({'raw':_0x529624['options']?_0x529624['options'][_0xe5a1('0x1f')]===undefined?!![]:![]:!![],'where':_0x529624[_0xe5a1('0x1e')]?_0x529624[_0xe5a1('0x1e')][_0xe5a1('0x28')]||null:null,'attributes':_0x529624['options']?_0x529624[_0xe5a1('0x1e')]['attributes']||null:null,'include':_0x529624[_0xe5a1('0x1e')]?_0x529624[_0xe5a1('0x1e')][_0xe5a1('0x22')]?_[_0xe5a1('0x24')](_0x529624['options'][_0xe5a1('0x22')],function(_0x507fbf){return{'model':db[_0x507fbf[_0xe5a1('0x23')]],'as':_0x507fbf['as'],'attributes':_0x507fbf[_0xe5a1('0x20')],'include':_0x507fbf['include']?_['map'](_0x507fbf[_0xe5a1('0x22')],function(_0x2a8bdd){return{'model':db[_0x2a8bdd['model']],'as':_0x2a8bdd['as'],'attributes':_0x2a8bdd[_0xe5a1('0x20')],'include':_0x2a8bdd[_0xe5a1('0x22')]?_['map'](_0x2a8bdd[_0xe5a1('0x22')],function(_0x207f43){return{'model':db[_0x207f43[_0xe5a1('0x23')]],'as':_0x207f43['as'],'attributes':_0x207f43[_0xe5a1('0x20')]};}):[]};}):[]};}):[]:[]})[_0xe5a1('0x13')](function(_0x2e3b02){logger['info']('ShowSmsQueue',_0x529624);logger[_0xe5a1('0x17')](_0xe5a1('0x29'),_0x529624,JSON[_0xe5a1('0x18')](_0x2e3b02));_0x4509a7(_0x2e3b02);})['catch'](function(_0x2f915c){logger[_0xe5a1('0x19')]('ShowSmsQueue',_0x2f915c[_0xe5a1('0x1b')],_0x529624);_0x50ee7b(_0x38f733[_0xe5a1('0x19')](0x1f4,_0x2f915c['message']));});});}; \ No newline at end of file +var _0x188f=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','SmsQueue,\x20%s,\x20%s','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetSmsQueue','findAll','options','raw','where','limit','map','include','attributes','model','ShowSmsQueue','find','then','util','moment','bluebird','randomstring'];(function(_0x5d23f3,_0x5d5549){var _0x1c38b8=function(_0x9c1038){while(--_0x9c1038){_0x5d23f3['push'](_0x5d23f3['shift']());}};_0x1c38b8(++_0x5d5549);}(_0x188f,0x196));var _0xf188=function(_0x3db945,_0x1aee62){_0x3db945=_0x3db945-0x0;var _0x924490=_0x188f[_0x3db945];return _0x924490;};'use strict';var _=require('lodash');var util=require(_0xf188('0x0'));var moment=require(_0xf188('0x1'));var BPromise=require(_0xf188('0x2'));var rs=require(_0xf188('0x3'));var fs=require('fs');var Redis=require(_0xf188('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf188('0x5'));var logger=require(_0xf188('0x6'))(_0xf188('0x7'));var config=require(_0xf188('0x8'));var jayson=require(_0xf188('0x9'));var client=jayson[_0xf188('0xa')]['http']({'port':0x232a});config[_0xf188('0xb')]=_[_0xf188('0xc')](config[_0xf188('0xb')],{'host':_0xf188('0xd'),'port':0x18eb});var socket=require(_0xf188('0xe'))(new Redis(config[_0xf188('0xb')]));require('./smsQueue.socket')[_0xf188('0xf')](socket);function respondWithRpcPromise(_0x156889,_0x49de50,_0x3c7187){return new BPromise(function(_0x583deb,_0x3fd050){return client[_0xf188('0x10')](_0x156889,_0x3c7187)['then'](function(_0xde1f28){logger['info'](_0xf188('0x11'),_0x49de50,'request\x20sent');logger[_0xf188('0x12')](_0xf188('0x13'),_0x49de50,_0xf188('0x14'),JSON[_0xf188('0x15')](_0xde1f28));if(_0xde1f28['error']){if(_0xde1f28[_0xf188('0x16')][_0xf188('0x17')]===0x1f4){logger[_0xf188('0x16')](_0xf188('0x11'),_0x49de50,_0xde1f28[_0xf188('0x16')][_0xf188('0x18')]);return _0x3fd050(_0xde1f28[_0xf188('0x16')][_0xf188('0x18')]);}logger['error'](_0xf188('0x11'),_0x49de50,_0xde1f28['error']['message']);return _0x583deb(_0xde1f28['error'][_0xf188('0x18')]);}else{logger[_0xf188('0x19')]('SmsQueue,\x20%s,\x20%s',_0x49de50,'request\x20sent');_0x583deb(_0xde1f28[_0xf188('0x1a')][_0xf188('0x18')]);}})[_0xf188('0x1b')](function(_0x14b0df){logger[_0xf188('0x16')](_0xf188('0x11'),_0x49de50,_0x14b0df);_0x3fd050(_0x14b0df);});});}exports[_0xf188('0x1c')]=function(_0x40269f){var _0xf63f49=this;return new Promise(function(_0x5937d5,_0x16b5f3){return db['SmsQueue'][_0xf188('0x1d')]({'raw':_0x40269f[_0xf188('0x1e')]?_0x40269f[_0xf188('0x1e')][_0xf188('0x1f')]===undefined?!![]:![]:!![],'where':_0x40269f[_0xf188('0x1e')]?_0x40269f[_0xf188('0x1e')][_0xf188('0x20')]||null:null,'attributes':_0x40269f[_0xf188('0x1e')]?_0x40269f['options']['attributes']||null:null,'limit':_0x40269f[_0xf188('0x1e')]?_0x40269f[_0xf188('0x1e')][_0xf188('0x21')]||null:null,'include':_0x40269f[_0xf188('0x1e')]?_0x40269f[_0xf188('0x1e')]['include']?_[_0xf188('0x22')](_0x40269f[_0xf188('0x1e')][_0xf188('0x23')],function(_0x100eca){return{'model':db[_0x100eca['model']],'as':_0x100eca['as'],'attributes':_0x100eca[_0xf188('0x24')],'include':_0x100eca[_0xf188('0x23')]?_['map'](_0x100eca[_0xf188('0x23')],function(_0x59204b){return{'model':db[_0x59204b['model']],'as':_0x59204b['as'],'attributes':_0x59204b[_0xf188('0x24')],'include':_0x59204b[_0xf188('0x23')]?_['map'](_0x59204b[_0xf188('0x23')],function(_0x48912b){return{'model':db[_0x48912b[_0xf188('0x25')]],'as':_0x48912b['as'],'attributes':_0x48912b[_0xf188('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x587642){logger[_0xf188('0x19')](_0xf188('0x1c'),_0x40269f);logger['debug'](_0xf188('0x1c'),_0x40269f,JSON[_0xf188('0x15')](_0x587642));_0x5937d5(_0x587642);})[_0xf188('0x1b')](function(_0x5096c7){logger['error'](_0xf188('0x1c'),_0x5096c7[_0xf188('0x18')],_0x40269f);_0x16b5f3(_0xf63f49['error'](0x1f4,_0x5096c7[_0xf188('0x18')]));});});};exports[_0xf188('0x26')]=function(_0x4050bd){var _0x4a559a=this;return new Promise(function(_0x25f658,_0x5f292d){return db['SmsQueue'][_0xf188('0x27')]({'raw':_0x4050bd[_0xf188('0x1e')]?_0x4050bd[_0xf188('0x1e')][_0xf188('0x1f')]===undefined?!![]:![]:!![],'where':_0x4050bd[_0xf188('0x1e')]?_0x4050bd['options'][_0xf188('0x20')]||null:null,'attributes':_0x4050bd[_0xf188('0x1e')]?_0x4050bd[_0xf188('0x1e')][_0xf188('0x24')]||null:null,'include':_0x4050bd[_0xf188('0x1e')]?_0x4050bd[_0xf188('0x1e')][_0xf188('0x23')]?_[_0xf188('0x22')](_0x4050bd[_0xf188('0x1e')][_0xf188('0x23')],function(_0x39e157){return{'model':db[_0x39e157[_0xf188('0x25')]],'as':_0x39e157['as'],'attributes':_0x39e157[_0xf188('0x24')],'include':_0x39e157[_0xf188('0x23')]?_['map'](_0x39e157[_0xf188('0x23')],function(_0x2d6ada){return{'model':db[_0x2d6ada['model']],'as':_0x2d6ada['as'],'attributes':_0x2d6ada['attributes'],'include':_0x2d6ada[_0xf188('0x23')]?_[_0xf188('0x22')](_0x2d6ada[_0xf188('0x23')],function(_0x124ad4){return{'model':db[_0x124ad4[_0xf188('0x25')]],'as':_0x124ad4['as'],'attributes':_0x124ad4[_0xf188('0x24')]};}):[]};}):[]};}):[]:[]})[_0xf188('0x28')](function(_0x16be8b){logger[_0xf188('0x19')]('ShowSmsQueue',_0x4050bd);logger[_0xf188('0x12')](_0xf188('0x26'),_0x4050bd,JSON['stringify'](_0x16be8b));_0x25f658(_0x16be8b);})[_0xf188('0x1b')](function(_0x402f12){logger[_0xf188('0x16')]('ShowSmsQueue',_0x402f12[_0xf188('0x18')],_0x4050bd);_0x5f292d(_0x4a559a['error'](0x1f4,_0x402f12[_0xf188('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 61bc17c..eea24aa 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 _0xbd2d=['./smsQueue.events','save','remove','update','emit','removeListener','register','length','smsQueue:'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xbd2d,0x87));var _0xdbd2=function(_0x1c3e68,_0xfd194){_0x1c3e68=_0x1c3e68-0x0;var _0x2f3699=_0xbd2d[_0x1c3e68];return _0x2f3699;};'use strict';var SmsQueueEvents=require(_0xdbd2('0x0'));var events=[_0xdbd2('0x1'),_0xdbd2('0x2'),_0xdbd2('0x3')];function createListener(_0x579667,_0x371733){return function(_0x2e36b3){_0x371733[_0xdbd2('0x4')](_0x579667,_0x2e36b3);};}function removeListener(_0x448517,_0x20077a){return function(){SmsQueueEvents[_0xdbd2('0x5')](_0x448517,_0x20077a);};}exports[_0xdbd2('0x6')]=function(_0x57429d){for(var _0xee3dca=0x0,_0x48827e=events[_0xdbd2('0x7')];_0xee3dca<_0x48827e;_0xee3dca++){var _0x2b0f5d=events[_0xee3dca];var _0x576fec=createListener(_0xdbd2('0x8')+_0x2b0f5d,_0x57429d);SmsQueueEvents['on'](_0x2b0f5d,_0x576fec);}}; \ No newline at end of file +var _0xf44f=['length','save','remove','update','emit','removeListener'];(function(_0x442aea,_0xd03adb){var _0x45a2a5=function(_0x39ab0c){while(--_0x39ab0c){_0x442aea['push'](_0x442aea['shift']());}};_0x45a2a5(++_0xd03adb);}(_0xf44f,0x1a5));var _0xff44=function(_0x39662d,_0x20f4b2){_0x39662d=_0x39662d-0x0;var _0x30ab20=_0xf44f[_0x39662d];return _0x30ab20;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0xff44('0x0'),_0xff44('0x1'),_0xff44('0x2')];function createListener(_0x4d60d9,_0x1c540f){return function(_0x2543da){_0x1c540f[_0xff44('0x3')](_0x4d60d9,_0x2543da);};}function removeListener(_0x293a66,_0x107d2d){return function(){SmsQueueEvents[_0xff44('0x4')](_0x293a66,_0x107d2d);};}exports['register']=function(_0x4e54f0){for(var _0x32d683=0x0,_0x1aebca=events[_0xff44('0x5')];_0x32d683<_0x1aebca;_0x32d683++){var _0x388211=events[_0x32d683];var _0x6c03e0=createListener('smsQueue:'+_0x388211,_0x4e54f0);SmsQueueEvents['on'](_0x388211,_0x6c03e0);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 2fa2579..7e1b7f1 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 _0x850a=['./smsQueueReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x23bf24,_0x2f6d76){var _0x27287f=function(_0x1d3bd9){while(--_0x1d3bd9){_0x23bf24['push'](_0x23bf24['shift']());}};_0x27287f(++_0x2f6d76);}(_0x850a,0x123));var _0xa850=function(_0x4d3187,_0x267c51){_0x4d3187=_0x4d3187-0x0;var _0x107906=_0x850a[_0x4d3187];return _0x107906;};'use strict';var multer=require(_0xa850('0x0'));var util=require(_0xa850('0x1'));var path=require(_0xa850('0x2'));var timeout=require(_0xa850('0x3'));var express=require(_0xa850('0x4'));var router=express['Router']();var fs_extra=require(_0xa850('0x5'));var auth=require(_0xa850('0x6'));var interaction=require(_0xa850('0x7'));var config=require(_0xa850('0x8'));var controller=require(_0xa850('0x9'));router[_0xa850('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa850('0xa')](_0xa850('0xb'),auth[_0xa850('0xc')](),controller[_0xa850('0xd')]);router[_0xa850('0xa')](_0xa850('0xe'),auth[_0xa850('0xc')](),controller[_0xa850('0xf')]);router[_0xa850('0x10')]('/',auth['isAuthenticated'](),controller[_0xa850('0x11')]);router['put'](_0xa850('0xe'),auth[_0xa850('0xc')](),controller['update']);router[_0xa850('0x12')](_0xa850('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0xa850('0x13')]=router; \ No newline at end of file +var _0xb673=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','show','put','/:id','update','exports','multer','util','connect-timeout','express','Router'];(function(_0x57ac3b,_0x32e884){var _0x4204c9=function(_0x54a70e){while(--_0x54a70e){_0x57ac3b['push'](_0x57ac3b['shift']());}};_0x4204c9(++_0x32e884);}(_0xb673,0xa5));var _0x3b67=function(_0x556af7,_0x14af9e){_0x556af7=_0x556af7-0x0;var _0x3537d3=_0xb673[_0x556af7];return _0x3537d3;};'use strict';var multer=require(_0x3b67('0x0'));var util=require(_0x3b67('0x1'));var path=require('path');var timeout=require(_0x3b67('0x2'));var express=require(_0x3b67('0x3'));var router=express[_0x3b67('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3b67('0x5'));var interaction=require(_0x3b67('0x6'));var config=require(_0x3b67('0x7'));var controller=require('./smsQueueReport.controller');router[_0x3b67('0x8')]('/',auth['isAuthenticated'](),controller[_0x3b67('0x9')]);router[_0x3b67('0x8')](_0x3b67('0xa'),auth[_0x3b67('0xb')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x3b67('0xc')]);router['post']('/',auth[_0x3b67('0xb')](),controller['create']);router[_0x3b67('0xd')](_0x3b67('0xe'),auth[_0x3b67('0xb')](),controller[_0x3b67('0xf')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x3b67('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index b46a649..e80fd8a 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 _0xce1a=['STRING','DATE','moment'];(function(_0x401d67,_0xeb1592){var _0x25076b=function(_0x233577){while(--_0x233577){_0x401d67['push'](_0x401d67['shift']());}};_0x25076b(++_0xeb1592);}(_0xce1a,0xbf));var _0xace1=function(_0x261702,_0x1c58f5){_0x261702=_0x261702-0x0;var _0x51e1ea=_0xce1a[_0x261702];return _0x51e1ea;};'use strict';var moment=require(_0xace1('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xace1('0x1')]},'joinAt':{'type':Sequelize[_0xace1('0x2')]},'leaveAt':{'type':Sequelize[_0xace1('0x2')]},'acceptAt':{'type':Sequelize[_0xace1('0x2')]},'exitAt':{'type':Sequelize[_0xace1('0x2')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb1ae=['exports','STRING','DATE','moment','sequelize'];(function(_0x16eb0f,_0x4e129e){var _0x857071=function(_0x3b3409){while(--_0x3b3409){_0x16eb0f['push'](_0x16eb0f['shift']());}};_0x857071(++_0x4e129e);}(_0xb1ae,0x193));var _0xeb1a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb1ae[_0x14add3];return _0x4a174f;};'use strict';var moment=require(_0xeb1a('0x0'));var Sequelize=require(_0xeb1a('0x1'));module[_0xeb1a('0x2')]={'uniqueid':{'type':Sequelize[_0xeb1a('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xeb1a('0x4')]},'acceptAt':{'type':Sequelize[_0xeb1a('0x4')]},'exitAt':{'type':Sequelize[_0xeb1a('0x4')]},'reason':{'type':Sequelize[_0xeb1a('0x3')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 88fdcbd..2bcefaa 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 _0x4ab2=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','apply','reject','destroy','then','end','error','stack','name','send','map','SmsQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','catch','create','body','update','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils'];(function(_0x521020,_0x1b589d){var _0x1f7d41=function(_0x5f52a0){while(--_0x5f52a0){_0x521020['push'](_0x521020['shift']());}};_0x1f7d41(++_0x1b589d);}(_0x4ab2,0x119));var _0x24ab=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x4ab2[_0x4e676e];return _0x336a3c;};'use strict';var emlformat=require(_0x24ab('0x0'));var rimraf=require(_0x24ab('0x1'));var zipdir=require(_0x24ab('0x2'));var jsonpatch=require(_0x24ab('0x3'));var rp=require(_0x24ab('0x4'));var moment=require(_0x24ab('0x5'));var BPromise=require(_0x24ab('0x6'));var Mustache=require(_0x24ab('0x7'));var util=require(_0x24ab('0x8'));var path=require(_0x24ab('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x24ab('0xa'));var fs=require('fs');var fs_extra=require(_0x24ab('0xb'));var _=require(_0x24ab('0xc'));var squel=require(_0x24ab('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x24ab('0xe'));var querystring=require(_0x24ab('0xf'));var Papa=require(_0x24ab('0x10'));var Redis=require(_0x24ab('0x11'));var authService=require(_0x24ab('0x12'));var qs=require(_0x24ab('0x13'));var as=require(_0x24ab('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x24ab('0x15'))('api');var utils=require(_0x24ab('0x16'));var config=require(_0x24ab('0x17'));var licenseUtil=require(_0x24ab('0x18'));var db=require(_0x24ab('0x19'))['db'];function respondWithStatusCode(_0x4bc8e4,_0xc73c75){_0xc73c75=_0xc73c75||0xcc;return function(_0x78f64a){if(_0x78f64a){return _0x4bc8e4[_0x24ab('0x1a')](_0xc73c75);}return _0x4bc8e4[_0x24ab('0x1b')](_0xc73c75)['end']();};}function respondWithResult(_0x26fcfa,_0xb80106){_0xb80106=_0xb80106||0xc8;return function(_0x522a00){if(_0x522a00){return _0x26fcfa[_0x24ab('0x1b')](_0xb80106)['json'](_0x522a00);}};}function respondWithFilteredResult(_0x489435,_0x52d22f){return function(_0x28f8f6){if(_0x28f8f6){var _0x247c5d=typeof _0x52d22f[_0x24ab('0x1c')]==='undefined'&&typeof _0x52d22f[_0x24ab('0x1d')]===_0x24ab('0x1e');var _0x3e4da6=_0x28f8f6[_0x24ab('0x1f')];var _0x5363ae=_0x247c5d?0x0:_0x52d22f['offset'];var _0xdd78ef=_0x247c5d?_0x28f8f6[_0x24ab('0x1f')]:_0x52d22f['offset']+_0x52d22f['limit'];var _0xaa6ae4;if(_0xdd78ef>=_0x3e4da6){_0xdd78ef=_0x3e4da6;_0xaa6ae4=0xc8;}else{_0xaa6ae4=0xce;}_0x489435[_0x24ab('0x1b')](_0xaa6ae4);return _0x489435[_0x24ab('0x20')](_0x24ab('0x21'),_0x5363ae+'-'+_0xdd78ef+'/'+_0x3e4da6)['json'](_0x28f8f6);}return null;};}function patchUpdates(_0xe30e00){return function(_0x1ceab8){try{jsonpatch[_0x24ab('0x22')](_0x1ceab8,_0xe30e00,!![]);}catch(_0x32af92){return BPromise[_0x24ab('0x23')](_0x32af92);}return _0x1ceab8['save']();};}function saveUpdates(_0x1deebf,_0x68bc96){return function(_0xcc446d){if(_0xcc446d){return _0xcc446d['update'](_0x1deebf)['then'](function(_0x33e979){return _0x33e979;});}return null;};}function removeEntity(_0x535584,_0x5d1b60){return function(_0x35ae42){if(_0x35ae42){return _0x35ae42[_0x24ab('0x24')]()[_0x24ab('0x25')](function(){_0x535584[_0x24ab('0x1b')](0xcc)[_0x24ab('0x26')]();});}};}function handleEntityNotFound(_0x13f763,_0x57112f){return function(_0x3a9033){if(!_0x3a9033){_0x13f763['sendStatus'](0x194);}return _0x3a9033;};}function handleError(_0x29d456,_0x40958a){_0x40958a=_0x40958a||0x1f4;return function(_0x50270d){logger[_0x24ab('0x27')](_0x50270d[_0x24ab('0x28')]);if(_0x50270d['name']){delete _0x50270d[_0x24ab('0x29')];}_0x29d456['status'](_0x40958a)[_0x24ab('0x2a')](_0x50270d);};}exports['index']=function(_0x16bb12,_0x30c60d){var _0x204b69={},_0x5df038={},_0x304da6={'count':0x0,'rows':[]};var _0x1b40ad=_[_0x24ab('0x2b')](db[_0x24ab('0x2c')][_0x24ab('0x2d')],function(_0x3b40a9){return{'name':_0x3b40a9[_0x24ab('0x2e')],'type':_0x3b40a9[_0x24ab('0x2f')]['key']};});_0x5df038[_0x24ab('0x30')]=_[_0x24ab('0x2b')](_0x1b40ad,'name');_0x5df038[_0x24ab('0x31')]=_[_0x24ab('0x32')](_0x16bb12[_0x24ab('0x31')]);_0x5df038[_0x24ab('0x33')]=_[_0x24ab('0x34')](_0x5df038[_0x24ab('0x30')],_0x5df038[_0x24ab('0x31')]);_0x204b69[_0x24ab('0x35')]=_[_0x24ab('0x34')](_0x5df038[_0x24ab('0x30')],qs[_0x24ab('0x36')](_0x16bb12['query'][_0x24ab('0x36')]));_0x204b69[_0x24ab('0x35')]=_0x204b69[_0x24ab('0x35')][_0x24ab('0x37')]?_0x204b69['attributes']:_0x5df038[_0x24ab('0x30')];if(!_0x16bb12['query']['hasOwnProperty'](_0x24ab('0x38'))){_0x204b69[_0x24ab('0x1d')]=qs[_0x24ab('0x1d')](_0x16bb12[_0x24ab('0x31')]['limit']);_0x204b69['offset']=qs['offset'](_0x16bb12[_0x24ab('0x31')][_0x24ab('0x1c')]);}_0x204b69['order']=qs[_0x24ab('0x39')](_0x16bb12[_0x24ab('0x31')][_0x24ab('0x39')]);_0x204b69[_0x24ab('0x3a')]=qs[_0x24ab('0x33')](_[_0x24ab('0x3b')](_0x16bb12[_0x24ab('0x31')],_0x5df038[_0x24ab('0x33')]),_0x1b40ad);if(_0x16bb12[_0x24ab('0x31')][_0x24ab('0x3c')]){_0x204b69[_0x24ab('0x3a')]=_[_0x24ab('0x3d')](_0x204b69[_0x24ab('0x3a')],{'$or':_[_0x24ab('0x2b')](_0x1b40ad,function(_0x1966e6){if(_0x1966e6['type']!==_0x24ab('0x3e')){var _0x489e84={};_0x489e84[_0x1966e6['name']]={'$like':'%'+_0x16bb12[_0x24ab('0x31')][_0x24ab('0x3c')]+'%'};return _0x489e84;}})});}_0x204b69=_[_0x24ab('0x3d')]({},_0x204b69,_0x16bb12[_0x24ab('0x3f')]);var _0x8f0934={'where':_0x204b69[_0x24ab('0x3a')]};return db[_0x24ab('0x2c')][_0x24ab('0x1f')](_0x8f0934)[_0x24ab('0x25')](function(_0x170a2b){_0x304da6[_0x24ab('0x1f')]=_0x170a2b;if(_0x16bb12[_0x24ab('0x31')][_0x24ab('0x40')]){_0x204b69[_0x24ab('0x41')]=[{'all':!![]}];}return db['SmsQueueReport'][_0x24ab('0x42')](_0x204b69);})[_0x24ab('0x25')](function(_0xd81cbe){_0x304da6[_0x24ab('0x43')]=_0xd81cbe;return _0x304da6;})[_0x24ab('0x25')](respondWithFilteredResult(_0x30c60d,_0x204b69))['catch'](handleError(_0x30c60d,null));};exports[_0x24ab('0x44')]=function(_0x23892d,_0x2b2393){var _0x15379a={'raw':!![],'where':{'id':_0x23892d['params']['id']}},_0x1e01e8={};_0x1e01e8[_0x24ab('0x30')]=_[_0x24ab('0x32')](db[_0x24ab('0x2c')][_0x24ab('0x2d')]);_0x1e01e8['query']=_['keys'](_0x23892d['query']);_0x1e01e8[_0x24ab('0x33')]=_[_0x24ab('0x34')](_0x1e01e8[_0x24ab('0x30')],_0x1e01e8[_0x24ab('0x31')]);_0x15379a[_0x24ab('0x35')]=_[_0x24ab('0x34')](_0x1e01e8[_0x24ab('0x30')],qs[_0x24ab('0x36')](_0x23892d[_0x24ab('0x31')][_0x24ab('0x36')]));_0x15379a[_0x24ab('0x35')]=_0x15379a['attributes'][_0x24ab('0x37')]?_0x15379a[_0x24ab('0x35')]:_0x1e01e8[_0x24ab('0x30')];if(_0x23892d['query']['includeAll']){_0x15379a[_0x24ab('0x41')]=[{'all':!![]}];}_0x15379a=_['merge']({},_0x15379a,_0x23892d['options']);return db[_0x24ab('0x2c')][_0x24ab('0x45')](_0x15379a)[_0x24ab('0x25')](handleEntityNotFound(_0x2b2393,null))[_0x24ab('0x25')](respondWithResult(_0x2b2393,null))[_0x24ab('0x46')](handleError(_0x2b2393,null));};exports[_0x24ab('0x47')]=function(_0x4a7631,_0x33be5d){return db[_0x24ab('0x2c')]['create'](_0x4a7631[_0x24ab('0x48')],{})['then'](respondWithResult(_0x33be5d,0xc9))['catch'](handleError(_0x33be5d,null));};exports[_0x24ab('0x49')]=function(_0x2c25da,_0x505f13){if(_0x2c25da[_0x24ab('0x48')]['id']){delete _0x2c25da[_0x24ab('0x48')]['id'];}return db['SmsQueueReport'][_0x24ab('0x45')]({'where':{'id':_0x2c25da['params']['id']}})[_0x24ab('0x25')](handleEntityNotFound(_0x505f13,null))['then'](saveUpdates(_0x2c25da['body'],null))[_0x24ab('0x25')](respondWithResult(_0x505f13,null))[_0x24ab('0x46')](handleError(_0x505f13,null));};exports[_0x24ab('0x24')]=function(_0x202816,_0x3124fb){return db[_0x24ab('0x2c')][_0x24ab('0x45')]({'where':{'id':_0x202816[_0x24ab('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3124fb,null))[_0x24ab('0x25')](removeEntity(_0x3124fb,null))[_0x24ab('0x46')](handleError(_0x3124fb,null));};exports[_0x24ab('0x4b')]=function(_0x507b4a,_0xe52ba){return db[_0x24ab('0x2c')][_0x24ab('0x4b')]()[_0x24ab('0x25')](respondWithResult(_0xe52ba,null))[_0x24ab('0x46')](handleError(_0xe52ba,null));}; \ No newline at end of file +var _0x24fa=['attributes','intersection','fields','length','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','count','include','findAll','rows','show','params','includeAll','options','find','catch','create','body','describe','rimraf','fast-json-patch','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','undefined','limit','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','model','query','keys','filters'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x24fa,0x18a));var _0xa24f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x24fa[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa24f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa24f('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa24f('0x2'));var util=require(_0xa24f('0x3'));var path=require(_0xa24f('0x4'));var sox=require(_0xa24f('0x5'));var csv=require(_0xa24f('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa24f('0x7'));var squel=require(_0xa24f('0x8'));var crypto=require(_0xa24f('0x9'));var jsforce=require(_0xa24f('0xa'));var deskjs=require(_0xa24f('0xb'));var toCsv=require('to-csv');var querystring=require(_0xa24f('0xc'));var Papa=require(_0xa24f('0xd'));var Redis=require(_0xa24f('0xe'));var authService=require(_0xa24f('0xf'));var qs=require(_0xa24f('0x10'));var as=require(_0xa24f('0x11'));var hardwareService=require(_0xa24f('0x12'));var logger=require('../../config/logger')(_0xa24f('0x13'));var utils=require(_0xa24f('0x14'));var config=require(_0xa24f('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xa24f('0x16'))['db'];function respondWithStatusCode(_0xddc312,_0x5d004b){_0x5d004b=_0x5d004b||0xcc;return function(_0x1ac1cb){if(_0x1ac1cb){return _0xddc312['sendStatus'](_0x5d004b);}return _0xddc312[_0xa24f('0x17')](_0x5d004b)[_0xa24f('0x18')]();};}function respondWithResult(_0x28f376,_0x133b02){_0x133b02=_0x133b02||0xc8;return function(_0x475b08){if(_0x475b08){return _0x28f376[_0xa24f('0x17')](_0x133b02)['json'](_0x475b08);}};}function respondWithFilteredResult(_0x540f31,_0x5340a6){return function(_0x2a2661){if(_0x2a2661){var _0x4e4305=typeof _0x5340a6['offset']===_0xa24f('0x19')&&typeof _0x5340a6[_0xa24f('0x1a')]==='undefined';var _0x23a305=_0x2a2661['count'];var _0x49b7eb=_0x4e4305?0x0:_0x5340a6['offset'];var _0x2a1523=_0x4e4305?_0x2a2661['count']:_0x5340a6[_0xa24f('0x1b')]+_0x5340a6[_0xa24f('0x1a')];var _0x3e2abc;if(_0x2a1523>=_0x23a305){_0x2a1523=_0x23a305;_0x3e2abc=0xc8;}else{_0x3e2abc=0xce;}_0x540f31[_0xa24f('0x17')](_0x3e2abc);return _0x540f31[_0xa24f('0x1c')](_0xa24f('0x1d'),_0x49b7eb+'-'+_0x2a1523+'/'+_0x23a305)[_0xa24f('0x1e')](_0x2a2661);}return null;};}function patchUpdates(_0x3c46cc){return function(_0x9e38e8){try{jsonpatch[_0xa24f('0x1f')](_0x9e38e8,_0x3c46cc,!![]);}catch(_0x1b886a){return BPromise[_0xa24f('0x20')](_0x1b886a);}return _0x9e38e8[_0xa24f('0x21')]();};}function saveUpdates(_0x1ea274,_0x1b6a26){return function(_0x3c0f80){if(_0x3c0f80){return _0x3c0f80[_0xa24f('0x22')](_0x1ea274)[_0xa24f('0x23')](function(_0x4653c7){return _0x4653c7;});}return null;};}function removeEntity(_0x34c79d,_0x2b263a){return function(_0xd6b556){if(_0xd6b556){return _0xd6b556[_0xa24f('0x24')]()[_0xa24f('0x23')](function(){_0x34c79d[_0xa24f('0x17')](0xcc)[_0xa24f('0x18')]();});}};}function handleEntityNotFound(_0x57fde9,_0x346e4d){return function(_0x3d595d){if(!_0x3d595d){_0x57fde9['sendStatus'](0x194);}return _0x3d595d;};}function handleError(_0x28dd80,_0x280740){_0x280740=_0x280740||0x1f4;return function(_0x502df0){logger[_0xa24f('0x25')](_0x502df0['stack']);if(_0x502df0[_0xa24f('0x26')]){delete _0x502df0['name'];}_0x28dd80[_0xa24f('0x17')](_0x280740)[_0xa24f('0x27')](_0x502df0);};}exports[_0xa24f('0x28')]=function(_0x16a479,_0x4531e0){var _0x53ca5f={},_0x6982b3={},_0x3d7237={'count':0x0,'rows':[]};var _0xdda924=_[_0xa24f('0x29')](db[_0xa24f('0x2a')][_0xa24f('0x2b')],function(_0x15f205){return{'name':_0x15f205[_0xa24f('0x2c')],'type':_0x15f205[_0xa24f('0x2d')]['key']};});_0x6982b3[_0xa24f('0x2e')]=_[_0xa24f('0x29')](_0xdda924,_0xa24f('0x26'));_0x6982b3[_0xa24f('0x2f')]=_[_0xa24f('0x30')](_0x16a479[_0xa24f('0x2f')]);_0x6982b3[_0xa24f('0x31')]=_['intersection'](_0x6982b3[_0xa24f('0x2e')],_0x6982b3[_0xa24f('0x2f')]);_0x53ca5f[_0xa24f('0x32')]=_[_0xa24f('0x33')](_0x6982b3[_0xa24f('0x2e')],qs[_0xa24f('0x34')](_0x16a479[_0xa24f('0x2f')][_0xa24f('0x34')]));_0x53ca5f[_0xa24f('0x32')]=_0x53ca5f[_0xa24f('0x32')][_0xa24f('0x35')]?_0x53ca5f['attributes']:_0x6982b3[_0xa24f('0x2e')];if(!_0x16a479[_0xa24f('0x2f')][_0xa24f('0x36')]('nolimit')){_0x53ca5f['limit']=qs[_0xa24f('0x1a')](_0x16a479['query']['limit']);_0x53ca5f[_0xa24f('0x1b')]=qs[_0xa24f('0x1b')](_0x16a479[_0xa24f('0x2f')][_0xa24f('0x1b')]);}_0x53ca5f[_0xa24f('0x37')]=qs['sort'](_0x16a479[_0xa24f('0x2f')][_0xa24f('0x38')]);_0x53ca5f['where']=qs[_0xa24f('0x31')](_['pick'](_0x16a479[_0xa24f('0x2f')],_0x6982b3[_0xa24f('0x31')]),_0xdda924);if(_0x16a479[_0xa24f('0x2f')][_0xa24f('0x39')]){_0x53ca5f[_0xa24f('0x3a')]=_[_0xa24f('0x3b')](_0x53ca5f['where'],{'$or':_[_0xa24f('0x29')](_0xdda924,function(_0x246e04){if(_0x246e04[_0xa24f('0x2d')]!==_0xa24f('0x3c')){var _0x40876c={};_0x40876c[_0x246e04['name']]={'$like':'%'+_0x16a479['query'][_0xa24f('0x39')]+'%'};return _0x40876c;}})});}_0x53ca5f=_['merge']({},_0x53ca5f,_0x16a479['options']);var _0x4e18b9={'where':_0x53ca5f[_0xa24f('0x3a')]};return db['SmsQueueReport'][_0xa24f('0x3d')](_0x4e18b9)[_0xa24f('0x23')](function(_0x4b1748){_0x3d7237['count']=_0x4b1748;if(_0x16a479[_0xa24f('0x2f')]['includeAll']){_0x53ca5f[_0xa24f('0x3e')]=[{'all':!![]}];}return db[_0xa24f('0x2a')][_0xa24f('0x3f')](_0x53ca5f);})[_0xa24f('0x23')](function(_0xb8a43){_0x3d7237[_0xa24f('0x40')]=_0xb8a43;return _0x3d7237;})[_0xa24f('0x23')](respondWithFilteredResult(_0x4531e0,_0x53ca5f))['catch'](handleError(_0x4531e0,null));};exports[_0xa24f('0x41')]=function(_0x336b07,_0x19027a){var _0x35c968={'raw':!![],'where':{'id':_0x336b07[_0xa24f('0x42')]['id']}},_0x2be5a7={};_0x2be5a7[_0xa24f('0x2e')]=_['keys'](db[_0xa24f('0x2a')][_0xa24f('0x2b')]);_0x2be5a7[_0xa24f('0x2f')]=_[_0xa24f('0x30')](_0x336b07[_0xa24f('0x2f')]);_0x2be5a7[_0xa24f('0x31')]=_['intersection'](_0x2be5a7[_0xa24f('0x2e')],_0x2be5a7[_0xa24f('0x2f')]);_0x35c968[_0xa24f('0x32')]=_[_0xa24f('0x33')](_0x2be5a7[_0xa24f('0x2e')],qs[_0xa24f('0x34')](_0x336b07[_0xa24f('0x2f')]['fields']));_0x35c968['attributes']=_0x35c968[_0xa24f('0x32')]['length']?_0x35c968['attributes']:_0x2be5a7[_0xa24f('0x2e')];if(_0x336b07[_0xa24f('0x2f')][_0xa24f('0x43')]){_0x35c968[_0xa24f('0x3e')]=[{'all':!![]}];}_0x35c968=_[_0xa24f('0x3b')]({},_0x35c968,_0x336b07[_0xa24f('0x44')]);return db[_0xa24f('0x2a')][_0xa24f('0x45')](_0x35c968)['then'](handleEntityNotFound(_0x19027a,null))[_0xa24f('0x23')](respondWithResult(_0x19027a,null))[_0xa24f('0x46')](handleError(_0x19027a,null));};exports['create']=function(_0x2df528,_0x5f44eb){return db[_0xa24f('0x2a')][_0xa24f('0x47')](_0x2df528[_0xa24f('0x48')],{})['then'](respondWithResult(_0x5f44eb,0xc9))['catch'](handleError(_0x5f44eb,null));};exports['update']=function(_0x31902d,_0xcad680){if(_0x31902d[_0xa24f('0x48')]['id']){delete _0x31902d[_0xa24f('0x48')]['id'];}return db[_0xa24f('0x2a')][_0xa24f('0x45')]({'where':{'id':_0x31902d['params']['id']}})[_0xa24f('0x23')](handleEntityNotFound(_0xcad680,null))[_0xa24f('0x23')](saveUpdates(_0x31902d[_0xa24f('0x48')],null))[_0xa24f('0x23')](respondWithResult(_0xcad680,null))[_0xa24f('0x46')](handleError(_0xcad680,null));};exports[_0xa24f('0x24')]=function(_0x2154ff,_0x577db2){return db[_0xa24f('0x2a')]['find']({'where':{'id':_0x2154ff[_0xa24f('0x42')]['id']}})[_0xa24f('0x23')](handleEntityNotFound(_0x577db2,null))[_0xa24f('0x23')](removeEntity(_0x577db2,null))['catch'](handleError(_0x577db2,null));};exports[_0xa24f('0x49')]=function(_0x510163,_0x3d52a6){return db[_0xa24f('0x2a')][_0xa24f('0x49')]()[_0xa24f('0x23')](respondWithResult(_0x3d52a6,null))[_0xa24f('0x46')](handleError(_0x3d52a6,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 6610604..bf7ac04 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 _0x70e0=['util','../../config/logger','bluebird','request-promise','path','rimraf','./smsQueueReport.attributes','report_sms_queue','uniqueid','lodash'];(function(_0x57be65,_0x26e8ae){var _0xdc5c4f=function(_0x4eaad8){while(--_0x4eaad8){_0x57be65['push'](_0x57be65['shift']());}};_0xdc5c4f(++_0x26e8ae);}(_0x70e0,0x17b));var _0x070e=function(_0x1ecd01,_0x2c6510){_0x1ecd01=_0x1ecd01-0x0;var _0x3b932d=_0x70e0[_0x1ecd01];return _0x3b932d;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('SmsQueueReport',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[{'name':_0x070e('0x9'),'fields':[_0x070e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util'];(function(_0x2cb58b,_0x5a879d){var _0xe9dd9c=function(_0x11e835){while(--_0x11e835){_0x2cb58b['push'](_0x2cb58b['shift']());}};_0xe9dd9c(++_0x5a879d);}(_0xe706,0xa3));var _0x6e70=function(_0x3dca5f,_0x3bf609){_0x3dca5f=_0x3dca5f-0x0;var _0x2ad290=_0xe706[_0x3dca5f];return _0x2ad290;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index b21f740..2e74ce9 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 _0x1d30=['options','raw','UpdateSmsQueueReport','update','where','attributes','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateSmsQueueReport','SmsQueueReport','create','body'];(function(_0x344a69,_0x42f6f5){var _0x105dca=function(_0x4208d3){while(--_0x4208d3){_0x344a69['push'](_0x344a69['shift']());}};_0x105dca(++_0x42f6f5);}(_0x1d30,0x186));var _0x01d3=function(_0x214c07,_0x581e29){_0x214c07=_0x214c07-0x0;var _0x529cc6=_0x1d30[_0x214c07];return _0x529cc6;};'use strict';var _=require('lodash');var util=require(_0x01d3('0x0'));var moment=require(_0x01d3('0x1'));var BPromise=require(_0x01d3('0x2'));var rs=require(_0x01d3('0x3'));var fs=require('fs');var Redis=require(_0x01d3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x01d3('0x5'));var logger=require(_0x01d3('0x6'))(_0x01d3('0x7'));var config=require(_0x01d3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x01d3('0x9')][_0x01d3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x44499c,_0x380826,_0x3997ab){return new BPromise(function(_0x3638e9,_0x588a5c){return client[_0x01d3('0xb')](_0x44499c,_0x3997ab)[_0x01d3('0xc')](function(_0xc0190){logger[_0x01d3('0xd')](_0x01d3('0xe'),_0x380826,_0x01d3('0xf'));logger[_0x01d3('0x10')](_0x01d3('0x11'),_0x380826,_0x01d3('0xf'),JSON[_0x01d3('0x12')](_0xc0190));if(_0xc0190[_0x01d3('0x13')]){if(_0xc0190[_0x01d3('0x13')]['code']===0x1f4){logger['error'](_0x01d3('0xe'),_0x380826,_0xc0190['error'][_0x01d3('0x14')]);return _0x588a5c(_0xc0190[_0x01d3('0x13')][_0x01d3('0x14')]);}logger[_0x01d3('0x13')](_0x01d3('0xe'),_0x380826,_0xc0190[_0x01d3('0x13')][_0x01d3('0x14')]);return _0x3638e9(_0xc0190[_0x01d3('0x13')]['message']);}else{logger['info'](_0x01d3('0xe'),_0x380826,_0x01d3('0xf'));_0x3638e9(_0xc0190['result'][_0x01d3('0x14')]);}})[_0x01d3('0x15')](function(_0x42d917){logger[_0x01d3('0x13')](_0x01d3('0xe'),_0x380826,_0x42d917);_0x588a5c(_0x42d917);});});}exports[_0x01d3('0x16')]=function(_0x496382){var _0x47241e=this;return new Promise(function(_0x377ccd,_0xa4fd48){return db[_0x01d3('0x17')][_0x01d3('0x18')](_0x496382[_0x01d3('0x19')],{'raw':_0x496382[_0x01d3('0x1a')]?_0x496382[_0x01d3('0x1a')][_0x01d3('0x1b')]===undefined?!![]:![]:!![]})[_0x01d3('0xc')](function(_0x43ef00){logger['info'](_0x01d3('0x16'),_0x496382);logger['debug'](_0x01d3('0x16'),_0x496382,JSON[_0x01d3('0x12')](_0x43ef00));_0x377ccd(_0x43ef00);})[_0x01d3('0x15')](function(_0x469831){logger[_0x01d3('0x13')](_0x01d3('0x16'),_0x469831[_0x01d3('0x14')],_0x496382);_0xa4fd48(_0x47241e[_0x01d3('0x13')](0x1f4,_0x469831[_0x01d3('0x14')]));});});};exports[_0x01d3('0x1c')]=function(_0x3cc0b3){var _0x4e5ae1=this;return new Promise(function(_0x182706,_0x3548b4){return db['SmsQueueReport'][_0x01d3('0x1d')](_0x3cc0b3['body'],{'raw':_0x3cc0b3['options']?_0x3cc0b3['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3cc0b3[_0x01d3('0x1a')]?_0x3cc0b3[_0x01d3('0x1a')][_0x01d3('0x1e')]||null:null,'attributes':_0x3cc0b3[_0x01d3('0x1a')]?_0x3cc0b3[_0x01d3('0x1a')][_0x01d3('0x1f')]||null:null,'limit':_0x3cc0b3[_0x01d3('0x1a')]?_0x3cc0b3[_0x01d3('0x1a')]['limit']||null:null})[_0x01d3('0xc')](function(_0x2b81d4){logger[_0x01d3('0xd')](_0x01d3('0x1c'),_0x3cc0b3);logger['debug'](_0x01d3('0x1c'),_0x3cc0b3,JSON[_0x01d3('0x12')](_0x2b81d4));_0x182706(_0x2b81d4);})[_0x01d3('0x15')](function(_0x1f4ab3){logger[_0x01d3('0x13')](_0x01d3('0x1c'),_0x1f4ab3[_0x01d3('0x14')],_0x3cc0b3);_0x3548b4(_0x4e5ae1[_0x01d3('0x13')](0x1f4,_0x1f4ab3[_0x01d3('0x14')]));});});}; \ No newline at end of file +var _0x2403=['../../config/logger','../../config/environment','jayson/promise','client','request','then','SmsQueueReport,\x20%s,\x20%s','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','SmsQueueReport','body','options','raw','CreateSmsQueueReport','UpdateSmsQueueReport','update','where','attributes','limit','util','moment','bluebird','ioredis','../../config/utils'];(function(_0x47d6dc,_0xc036cc){var _0x1a1c93=function(_0x18ec96){while(--_0x18ec96){_0x47d6dc['push'](_0x47d6dc['shift']());}};_0x1a1c93(++_0xc036cc);}(_0x2403,0x1cc));var _0x3240=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2403[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x3240('0x0'));var moment=require(_0x3240('0x1'));var BPromise=require(_0x3240('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3240('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3240('0x4'));var logger=require(_0x3240('0x5'))('rpc');var config=require(_0x3240('0x6'));var jayson=require(_0x3240('0x7'));var client=jayson[_0x3240('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48cae6,_0x45eecb,_0x3247e2){return new BPromise(function(_0x425fe6,_0x25e010){return client[_0x3240('0x9')](_0x48cae6,_0x3247e2)[_0x3240('0xa')](function(_0x4f1e76){logger['info'](_0x3240('0xb'),_0x45eecb,'request\x20sent');logger[_0x3240('0xc')](_0x3240('0xd'),_0x45eecb,_0x3240('0xe'),JSON[_0x3240('0xf')](_0x4f1e76));if(_0x4f1e76[_0x3240('0x10')]){if(_0x4f1e76[_0x3240('0x10')]['code']===0x1f4){logger[_0x3240('0x10')](_0x3240('0xb'),_0x45eecb,_0x4f1e76[_0x3240('0x10')][_0x3240('0x11')]);return _0x25e010(_0x4f1e76[_0x3240('0x10')][_0x3240('0x11')]);}logger['error'](_0x3240('0xb'),_0x45eecb,_0x4f1e76[_0x3240('0x10')][_0x3240('0x11')]);return _0x425fe6(_0x4f1e76[_0x3240('0x10')]['message']);}else{logger[_0x3240('0x12')](_0x3240('0xb'),_0x45eecb,_0x3240('0xe'));_0x425fe6(_0x4f1e76[_0x3240('0x13')][_0x3240('0x11')]);}})[_0x3240('0x14')](function(_0x4b968f){logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x45eecb,_0x4b968f);_0x25e010(_0x4b968f);});});}exports['CreateSmsQueueReport']=function(_0x526d28){var _0x34e76f=this;return new Promise(function(_0x1c9ea3,_0x33f4dd){return db[_0x3240('0x15')]['create'](_0x526d28[_0x3240('0x16')],{'raw':_0x526d28[_0x3240('0x17')]?_0x526d28[_0x3240('0x17')][_0x3240('0x18')]===undefined?!![]:![]:!![]})[_0x3240('0xa')](function(_0x26e172){logger[_0x3240('0x12')](_0x3240('0x19'),_0x526d28);logger[_0x3240('0xc')]('CreateSmsQueueReport',_0x526d28,JSON[_0x3240('0xf')](_0x26e172));_0x1c9ea3(_0x26e172);})[_0x3240('0x14')](function(_0x209861){logger[_0x3240('0x10')]('CreateSmsQueueReport',_0x209861['message'],_0x526d28);_0x33f4dd(_0x34e76f['error'](0x1f4,_0x209861['message']));});});};exports[_0x3240('0x1a')]=function(_0x40408f){var _0x136a5f=this;return new Promise(function(_0x218ad6,_0x37b8ec){return db[_0x3240('0x15')][_0x3240('0x1b')](_0x40408f[_0x3240('0x16')],{'raw':_0x40408f['options']?_0x40408f[_0x3240('0x17')][_0x3240('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40408f[_0x3240('0x17')]?_0x40408f[_0x3240('0x17')][_0x3240('0x1c')]||null:null,'attributes':_0x40408f['options']?_0x40408f[_0x3240('0x17')][_0x3240('0x1d')]||null:null,'limit':_0x40408f[_0x3240('0x17')]?_0x40408f[_0x3240('0x17')][_0x3240('0x1e')]||null:null})['then'](function(_0x5285fc){logger[_0x3240('0x12')](_0x3240('0x1a'),_0x40408f);logger[_0x3240('0xc')](_0x3240('0x1a'),_0x40408f,JSON[_0x3240('0xf')](_0x5285fc));_0x218ad6(_0x5285fc);})[_0x3240('0x14')](function(_0x240f47){logger[_0x3240('0x10')](_0x3240('0x1a'),_0x240f47[_0x3240('0x11')],_0x40408f);_0x37b8ec(_0x136a5f[_0x3240('0x10')](0x1f4,_0x240f47[_0x3240('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 0076731..31411e6 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 _0x3e74=['get','isAuthenticated','index','/describe','describe','/:id','show','create','put','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./smsTransferReport.controller'];(function(_0x10d117,_0x57a1cb){var _0x297da1=function(_0xea37bd){while(--_0xea37bd){_0x10d117['push'](_0x10d117['shift']());}};_0x297da1(++_0x57a1cb);}(_0x3e74,0x175));var _0x43e7=function(_0x176ade,_0x5b71dc){_0x176ade=_0x176ade-0x0;var _0x4b433b=_0x3e74[_0x176ade];return _0x4b433b;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router[_0x43e7('0xf')]('/:id',auth[_0x43e7('0x8')](),controller['update']);router[_0x43e7('0x10')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0x11')]);module[_0x43e7('0x12')]=router; \ No newline at end of file +var _0xbfe8=['describe','/:id','show','post','create','put','update','destroy','exports','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./smsTransferReport.controller','get','isAuthenticated','/describe'];(function(_0x2f0057,_0x448b27){var _0x17f2c3=function(_0x12efc3){while(--_0x12efc3){_0x2f0057['push'](_0x2f0057['shift']());}};_0x17f2c3(++_0x448b27);}(_0xbfe8,0x1b9));var _0x8bfe=function(_0x1177d8,_0x21a4d7){_0x1177d8=_0x1177d8-0x0;var _0x20fc95=_0xbfe8[_0x1177d8];return _0x20fc95;};'use strict';var multer=require('multer');var util=require(_0x8bfe('0x0'));var path=require('path');var timeout=require(_0x8bfe('0x1'));var express=require(_0x8bfe('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8bfe('0x3'));var interaction=require(_0x8bfe('0x4'));var config=require('../../config/environment');var controller=require(_0x8bfe('0x5'));router[_0x8bfe('0x6')]('/',auth[_0x8bfe('0x7')](),controller['index']);router[_0x8bfe('0x6')](_0x8bfe('0x8'),auth[_0x8bfe('0x7')](),controller[_0x8bfe('0x9')]);router[_0x8bfe('0x6')](_0x8bfe('0xa'),auth[_0x8bfe('0x7')](),controller[_0x8bfe('0xb')]);router[_0x8bfe('0xc')]('/',auth[_0x8bfe('0x7')](),controller[_0x8bfe('0xd')]);router[_0x8bfe('0xe')](_0x8bfe('0xa'),auth[_0x8bfe('0x7')](),controller[_0x8bfe('0xf')]);router['delete'](_0x8bfe('0xa'),auth['isAuthenticated'](),controller[_0x8bfe('0x10')]);module[_0x8bfe('0x11')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 038271a..f5031e0 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 _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x5b4a06,_0x2734e7){var _0x1cf5e5=function(_0x344e99){while(--_0x344e99){_0x5b4a06['push'](_0x5b4a06['shift']());}};_0x1cf5e5(++_0x2734e7);}(_0x34e8,0x12c));var _0x834e=function(_0x42709f,_0x4655f2){_0x42709f=_0x42709f-0x0;var _0x4fd759=_0x34e8[_0x42709f];return _0x4fd759;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file +var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x41126a,_0xe5b0f9){var _0x165edd=function(_0x83fd8b){while(--_0x83fd8b){_0x41126a['push'](_0x41126a['shift']());}};_0x165edd(++_0xe5b0f9);}(_0xedd9,0xfc));var _0x9edd=function(_0x28d833,_0x116ffd){_0x28d833=_0x28d833-0x0;var _0x39518b=_0xedd9[_0x28d833];return _0x39518b;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 57060e0..67cfbca 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 _0x5337=['describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','SmsTransferReport','fieldName','key','model','query','keys','intersection','fields','attributes','nolimit','order','sort','filters','pick','where','map','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','create','body','find'];(function(_0x34d703,_0xb42f05){var _0x39f780=function(_0x46ef36){while(--_0x46ef36){_0x34d703['push'](_0x34d703['shift']());}};_0x39f780(++_0xb42f05);}(_0x5337,0x1c9));var _0x7533=function(_0x216f98,_0x470c7f){_0x216f98=_0x216f98-0x0;var _0xea6b36=_0x5337[_0x216f98];return _0xea6b36;};'use strict';var emlformat=require(_0x7533('0x0'));var rimraf=require(_0x7533('0x1'));var zipdir=require(_0x7533('0x2'));var jsonpatch=require(_0x7533('0x3'));var rp=require(_0x7533('0x4'));var moment=require(_0x7533('0x5'));var BPromise=require(_0x7533('0x6'));var Mustache=require(_0x7533('0x7'));var util=require(_0x7533('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x7533('0x9'));var ejs=require(_0x7533('0xa'));var fs=require('fs');var fs_extra=require(_0x7533('0xb'));var _=require(_0x7533('0xc'));var squel=require('squel');var crypto=require(_0x7533('0xd'));var jsforce=require(_0x7533('0xe'));var deskjs=require(_0x7533('0xf'));var toCsv=require(_0x7533('0x9'));var querystring=require('querystring');var Papa=require(_0x7533('0x10'));var Redis=require(_0x7533('0x11'));var authService=require(_0x7533('0x12'));var qs=require(_0x7533('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7533('0x14'));var logger=require(_0x7533('0x15'))(_0x7533('0x16'));var utils=require(_0x7533('0x17'));var config=require(_0x7533('0x18'));var licenseUtil=require(_0x7533('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x262853,_0x328a23){_0x328a23=_0x328a23||0xcc;return function(_0x4082c3){if(_0x4082c3){return _0x262853[_0x7533('0x1a')](_0x328a23);}return _0x262853['status'](_0x328a23)[_0x7533('0x1b')]();};}function respondWithResult(_0x459b7a,_0x211f18){_0x211f18=_0x211f18||0xc8;return function(_0x41d711){if(_0x41d711){return _0x459b7a[_0x7533('0x1c')](_0x211f18)[_0x7533('0x1d')](_0x41d711);}};}function respondWithFilteredResult(_0x5868bb,_0x178b54){return function(_0x2dc094){if(_0x2dc094){var _0x444d8b=typeof _0x178b54[_0x7533('0x1e')]===_0x7533('0x1f')&&typeof _0x178b54['limit']===_0x7533('0x1f');var _0x40e011=_0x2dc094[_0x7533('0x20')];var _0x680802=_0x444d8b?0x0:_0x178b54[_0x7533('0x1e')];var _0x653987=_0x444d8b?_0x2dc094['count']:_0x178b54[_0x7533('0x1e')]+_0x178b54[_0x7533('0x21')];var _0x5d59d0;if(_0x653987>=_0x40e011){_0x653987=_0x40e011;_0x5d59d0=0xc8;}else{_0x5d59d0=0xce;}_0x5868bb['status'](_0x5d59d0);return _0x5868bb[_0x7533('0x22')](_0x7533('0x23'),_0x680802+'-'+_0x653987+'/'+_0x40e011)[_0x7533('0x1d')](_0x2dc094);}return null;};}function patchUpdates(_0x1320d0){return function(_0x4f2c09){try{jsonpatch[_0x7533('0x24')](_0x4f2c09,_0x1320d0,!![]);}catch(_0x3f9b31){return BPromise[_0x7533('0x25')](_0x3f9b31);}return _0x4f2c09['save']();};}function saveUpdates(_0x435472,_0x251b4d){return function(_0x6ede62){if(_0x6ede62){return _0x6ede62[_0x7533('0x26')](_0x435472)[_0x7533('0x27')](function(_0x2525d7){return _0x2525d7;});}return null;};}function removeEntity(_0x2be145,_0x295193){return function(_0x200296){if(_0x200296){return _0x200296[_0x7533('0x28')]()[_0x7533('0x27')](function(){_0x2be145[_0x7533('0x1c')](0xcc)[_0x7533('0x1b')]();});}};}function handleEntityNotFound(_0x3de046,_0x405134){return function(_0x5e37a5){if(!_0x5e37a5){_0x3de046['sendStatus'](0x194);}return _0x5e37a5;};}function handleError(_0x34a482,_0x4d0a6a){_0x4d0a6a=_0x4d0a6a||0x1f4;return function(_0x1103e2){logger['error'](_0x1103e2[_0x7533('0x29')]);if(_0x1103e2[_0x7533('0x2a')]){delete _0x1103e2[_0x7533('0x2a')];}_0x34a482[_0x7533('0x1c')](_0x4d0a6a)[_0x7533('0x2b')](_0x1103e2);};}exports['index']=function(_0x3e9a79,_0x274aa7){var _0x20dc90={},_0x3b8aae={},_0x2d608f={'count':0x0,'rows':[]};var _0x2961d3=_['map'](db[_0x7533('0x2c')]['rawAttributes'],function(_0x18305d){return{'name':_0x18305d[_0x7533('0x2d')],'type':_0x18305d['type'][_0x7533('0x2e')]};});_0x3b8aae[_0x7533('0x2f')]=_['map'](_0x2961d3,_0x7533('0x2a'));_0x3b8aae[_0x7533('0x30')]=_[_0x7533('0x31')](_0x3e9a79['query']);_0x3b8aae['filters']=_[_0x7533('0x32')](_0x3b8aae[_0x7533('0x2f')],_0x3b8aae['query']);_0x20dc90['attributes']=_['intersection'](_0x3b8aae[_0x7533('0x2f')],qs[_0x7533('0x33')](_0x3e9a79[_0x7533('0x30')][_0x7533('0x33')]));_0x20dc90[_0x7533('0x34')]=_0x20dc90[_0x7533('0x34')]['length']?_0x20dc90[_0x7533('0x34')]:_0x3b8aae[_0x7533('0x2f')];if(!_0x3e9a79[_0x7533('0x30')]['hasOwnProperty'](_0x7533('0x35'))){_0x20dc90[_0x7533('0x21')]=qs[_0x7533('0x21')](_0x3e9a79[_0x7533('0x30')][_0x7533('0x21')]);_0x20dc90[_0x7533('0x1e')]=qs[_0x7533('0x1e')](_0x3e9a79[_0x7533('0x30')][_0x7533('0x1e')]);}_0x20dc90[_0x7533('0x36')]=qs[_0x7533('0x37')](_0x3e9a79['query']['sort']);_0x20dc90['where']=qs[_0x7533('0x38')](_[_0x7533('0x39')](_0x3e9a79[_0x7533('0x30')],_0x3b8aae[_0x7533('0x38')]),_0x2961d3);if(_0x3e9a79[_0x7533('0x30')]['filter']){_0x20dc90[_0x7533('0x3a')]=_['merge'](_0x20dc90[_0x7533('0x3a')],{'$or':_[_0x7533('0x3b')](_0x2961d3,function(_0x292687){if(_0x292687[_0x7533('0x3c')]!==_0x7533('0x3d')){var _0x2ebf47={};_0x2ebf47[_0x292687[_0x7533('0x2a')]]={'$like':'%'+_0x3e9a79[_0x7533('0x30')][_0x7533('0x3e')]+'%'};return _0x2ebf47;}})});}_0x20dc90=_[_0x7533('0x3f')]({},_0x20dc90,_0x3e9a79[_0x7533('0x40')]);var _0x11aa2a={'where':_0x20dc90[_0x7533('0x3a')]};return db[_0x7533('0x2c')][_0x7533('0x20')](_0x11aa2a)[_0x7533('0x27')](function(_0x800e81){_0x2d608f[_0x7533('0x20')]=_0x800e81;if(_0x3e9a79[_0x7533('0x30')][_0x7533('0x41')]){_0x20dc90[_0x7533('0x42')]=[{'all':!![]}];}return db[_0x7533('0x2c')][_0x7533('0x43')](_0x20dc90);})[_0x7533('0x27')](function(_0x187106){_0x2d608f[_0x7533('0x44')]=_0x187106;return _0x2d608f;})[_0x7533('0x27')](respondWithFilteredResult(_0x274aa7,_0x20dc90))[_0x7533('0x45')](handleError(_0x274aa7,null));};exports[_0x7533('0x46')]=function(_0x21dee1,_0x330919){var _0x34d5d9={'raw':!![],'where':{'id':_0x21dee1['params']['id']}},_0x56b904={};_0x56b904[_0x7533('0x2f')]=_[_0x7533('0x31')](db['SmsTransferReport'][_0x7533('0x47')]);_0x56b904[_0x7533('0x30')]=_[_0x7533('0x31')](_0x21dee1[_0x7533('0x30')]);_0x56b904[_0x7533('0x38')]=_[_0x7533('0x32')](_0x56b904[_0x7533('0x2f')],_0x56b904[_0x7533('0x30')]);_0x34d5d9[_0x7533('0x34')]=_[_0x7533('0x32')](_0x56b904['model'],qs[_0x7533('0x33')](_0x21dee1[_0x7533('0x30')][_0x7533('0x33')]));_0x34d5d9['attributes']=_0x34d5d9[_0x7533('0x34')]['length']?_0x34d5d9['attributes']:_0x56b904[_0x7533('0x2f')];if(_0x21dee1[_0x7533('0x30')][_0x7533('0x41')]){_0x34d5d9[_0x7533('0x42')]=[{'all':!![]}];}_0x34d5d9=_[_0x7533('0x3f')]({},_0x34d5d9,_0x21dee1[_0x7533('0x40')]);return db[_0x7533('0x2c')]['find'](_0x34d5d9)[_0x7533('0x27')](handleEntityNotFound(_0x330919,null))[_0x7533('0x27')](respondWithResult(_0x330919,null))[_0x7533('0x45')](handleError(_0x330919,null));};exports[_0x7533('0x48')]=function(_0xc136fa,_0x3b7d03){return db[_0x7533('0x2c')][_0x7533('0x48')](_0xc136fa[_0x7533('0x49')],{})['then'](respondWithResult(_0x3b7d03,0xc9))['catch'](handleError(_0x3b7d03,null));};exports[_0x7533('0x26')]=function(_0x3b27b0,_0x2711f9){if(_0x3b27b0[_0x7533('0x49')]['id']){delete _0x3b27b0[_0x7533('0x49')]['id'];}return db[_0x7533('0x2c')][_0x7533('0x4a')]({'where':{'id':_0x3b27b0['params']['id']}})['then'](handleEntityNotFound(_0x2711f9,null))[_0x7533('0x27')](saveUpdates(_0x3b27b0[_0x7533('0x49')],null))[_0x7533('0x27')](respondWithResult(_0x2711f9,null))[_0x7533('0x45')](handleError(_0x2711f9,null));};exports[_0x7533('0x28')]=function(_0x1c51bd,_0x10e6d4){return db[_0x7533('0x2c')][_0x7533('0x4a')]({'where':{'id':_0x1c51bd['params']['id']}})[_0x7533('0x27')](handleEntityNotFound(_0x10e6d4,null))['then'](removeEntity(_0x10e6d4,null))[_0x7533('0x45')](handleError(_0x10e6d4,null));};exports[_0x7533('0x4b')]=function(_0x12ba04,_0x2b43ff){return db[_0x7533('0x2c')][_0x7533('0x4b')]()['then'](respondWithResult(_0x2b43ff,null))[_0x7533('0x45')](handleError(_0x2b43ff,null));}; \ No newline at end of file +var _0x8292=['index','map','SmsTransferReport','rawAttributes','fieldName','type','key','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','apply','reject','update','then','destroy','error','name','send'];(function(_0x4236f9,_0x226e50){var _0x425a63=function(_0x5593f9){while(--_0x5593f9){_0x4236f9['push'](_0x4236f9['shift']());}};_0x425a63(++_0x226e50);}(_0x8292,0xb2));var _0x2829=function(_0x1b1516,_0x17a510){_0x1b1516=_0x1b1516-0x0;var _0x14902e=_0x8292[_0x1b1516];return _0x14902e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2829('0x0'));var zipdir=require(_0x2829('0x1'));var jsonpatch=require(_0x2829('0x2'));var rp=require(_0x2829('0x3'));var moment=require(_0x2829('0x4'));var BPromise=require(_0x2829('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2829('0x6'));var sox=require('sox');var csv=require(_0x2829('0x7'));var ejs=require(_0x2829('0x8'));var fs=require('fs');var fs_extra=require(_0x2829('0x9'));var _=require(_0x2829('0xa'));var squel=require('squel');var crypto=require(_0x2829('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x2829('0xc'));var toCsv=require(_0x2829('0x7'));var querystring=require(_0x2829('0xd'));var Papa=require(_0x2829('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2829('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2829('0x10'));var logger=require(_0x2829('0x11'))('api');var utils=require(_0x2829('0x12'));var config=require(_0x2829('0x13'));var licenseUtil=require(_0x2829('0x14'));var db=require(_0x2829('0x15'))['db'];function respondWithStatusCode(_0x430de3,_0x1d6266){_0x1d6266=_0x1d6266||0xcc;return function(_0x15b4bf){if(_0x15b4bf){return _0x430de3[_0x2829('0x16')](_0x1d6266);}return _0x430de3[_0x2829('0x17')](_0x1d6266)[_0x2829('0x18')]();};}function respondWithResult(_0x2da2b4,_0x39e05a){_0x39e05a=_0x39e05a||0xc8;return function(_0x2fb707){if(_0x2fb707){return _0x2da2b4[_0x2829('0x17')](_0x39e05a)['json'](_0x2fb707);}};}function respondWithFilteredResult(_0xa76c75,_0x45ad39){return function(_0x1ca75e){if(_0x1ca75e){var _0x22ae1e=typeof _0x45ad39['offset']===_0x2829('0x19')&&typeof _0x45ad39[_0x2829('0x1a')]==='undefined';var _0x464bd6=_0x1ca75e[_0x2829('0x1b')];var _0x5672c2=_0x22ae1e?0x0:_0x45ad39[_0x2829('0x1c')];var _0x4cb155=_0x22ae1e?_0x1ca75e['count']:_0x45ad39[_0x2829('0x1c')]+_0x45ad39['limit'];var _0x19cd3f;if(_0x4cb155>=_0x464bd6){_0x4cb155=_0x464bd6;_0x19cd3f=0xc8;}else{_0x19cd3f=0xce;}_0xa76c75[_0x2829('0x17')](_0x19cd3f);return _0xa76c75[_0x2829('0x1d')]('Content-Range',_0x5672c2+'-'+_0x4cb155+'/'+_0x464bd6)['json'](_0x1ca75e);}return null;};}function patchUpdates(_0x2e7ef2){return function(_0x50fe6a){try{jsonpatch[_0x2829('0x1e')](_0x50fe6a,_0x2e7ef2,!![]);}catch(_0x2c10e6){return BPromise[_0x2829('0x1f')](_0x2c10e6);}return _0x50fe6a['save']();};}function saveUpdates(_0x444e53,_0x5f3837){return function(_0x4a4c7a){if(_0x4a4c7a){return _0x4a4c7a[_0x2829('0x20')](_0x444e53)[_0x2829('0x21')](function(_0x499bae){return _0x499bae;});}return null;};}function removeEntity(_0x3057ff,_0x273216){return function(_0x396abf){if(_0x396abf){return _0x396abf[_0x2829('0x22')]()['then'](function(){_0x3057ff[_0x2829('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x580ebe,_0x4d5061){return function(_0x3b2b3f){if(!_0x3b2b3f){_0x580ebe[_0x2829('0x16')](0x194);}return _0x3b2b3f;};}function handleError(_0x44e803,_0x25d013){_0x25d013=_0x25d013||0x1f4;return function(_0x481a42){logger[_0x2829('0x23')](_0x481a42['stack']);if(_0x481a42[_0x2829('0x24')]){delete _0x481a42['name'];}_0x44e803[_0x2829('0x17')](_0x25d013)[_0x2829('0x25')](_0x481a42);};}exports[_0x2829('0x26')]=function(_0x2ea883,_0x31e3e6){var _0x5d9d55={},_0x1f1a05={},_0x7dca56={'count':0x0,'rows':[]};var _0x36c1cf=_[_0x2829('0x27')](db[_0x2829('0x28')][_0x2829('0x29')],function(_0x16dbd2){return{'name':_0x16dbd2[_0x2829('0x2a')],'type':_0x16dbd2[_0x2829('0x2b')][_0x2829('0x2c')]};});_0x1f1a05['model']=_['map'](_0x36c1cf,_0x2829('0x24'));_0x1f1a05['query']=_['keys'](_0x2ea883[_0x2829('0x2d')]);_0x1f1a05['filters']=_[_0x2829('0x2e')](_0x1f1a05['model'],_0x1f1a05[_0x2829('0x2d')]);_0x5d9d55[_0x2829('0x2f')]=_[_0x2829('0x2e')](_0x1f1a05[_0x2829('0x30')],qs[_0x2829('0x31')](_0x2ea883[_0x2829('0x2d')][_0x2829('0x31')]));_0x5d9d55['attributes']=_0x5d9d55[_0x2829('0x2f')][_0x2829('0x32')]?_0x5d9d55[_0x2829('0x2f')]:_0x1f1a05[_0x2829('0x30')];if(!_0x2ea883[_0x2829('0x2d')][_0x2829('0x33')](_0x2829('0x34'))){_0x5d9d55[_0x2829('0x1a')]=qs[_0x2829('0x1a')](_0x2ea883['query'][_0x2829('0x1a')]);_0x5d9d55['offset']=qs[_0x2829('0x1c')](_0x2ea883[_0x2829('0x2d')][_0x2829('0x1c')]);}_0x5d9d55[_0x2829('0x35')]=qs['sort'](_0x2ea883[_0x2829('0x2d')]['sort']);_0x5d9d55[_0x2829('0x36')]=qs[_0x2829('0x37')](_[_0x2829('0x38')](_0x2ea883['query'],_0x1f1a05['filters']),_0x36c1cf);if(_0x2ea883[_0x2829('0x2d')][_0x2829('0x39')]){_0x5d9d55[_0x2829('0x36')]=_[_0x2829('0x3a')](_0x5d9d55[_0x2829('0x36')],{'$or':_[_0x2829('0x27')](_0x36c1cf,function(_0x2d6b85){if(_0x2d6b85[_0x2829('0x2b')]!=='VIRTUAL'){var _0x302052={};_0x302052[_0x2d6b85[_0x2829('0x24')]]={'$like':'%'+_0x2ea883[_0x2829('0x2d')][_0x2829('0x39')]+'%'};return _0x302052;}})});}_0x5d9d55=_[_0x2829('0x3a')]({},_0x5d9d55,_0x2ea883[_0x2829('0x3b')]);var _0x4fe01e={'where':_0x5d9d55['where']};return db[_0x2829('0x28')][_0x2829('0x1b')](_0x4fe01e)[_0x2829('0x21')](function(_0x1a73cb){_0x7dca56[_0x2829('0x1b')]=_0x1a73cb;if(_0x2ea883[_0x2829('0x2d')][_0x2829('0x3c')]){_0x5d9d55[_0x2829('0x3d')]=[{'all':!![]}];}return db[_0x2829('0x28')][_0x2829('0x3e')](_0x5d9d55);})[_0x2829('0x21')](function(_0x4592cd){_0x7dca56[_0x2829('0x3f')]=_0x4592cd;return _0x7dca56;})['then'](respondWithFilteredResult(_0x31e3e6,_0x5d9d55))[_0x2829('0x40')](handleError(_0x31e3e6,null));};exports[_0x2829('0x41')]=function(_0x4bd8d7,_0x5e7c0a){var _0x2ca03e={'raw':!![],'where':{'id':_0x4bd8d7[_0x2829('0x42')]['id']}},_0x142536={};_0x142536[_0x2829('0x30')]=_['keys'](db[_0x2829('0x28')][_0x2829('0x29')]);_0x142536['query']=_[_0x2829('0x43')](_0x4bd8d7[_0x2829('0x2d')]);_0x142536[_0x2829('0x37')]=_[_0x2829('0x2e')](_0x142536['model'],_0x142536[_0x2829('0x2d')]);_0x2ca03e[_0x2829('0x2f')]=_[_0x2829('0x2e')](_0x142536[_0x2829('0x30')],qs[_0x2829('0x31')](_0x4bd8d7[_0x2829('0x2d')]['fields']));_0x2ca03e[_0x2829('0x2f')]=_0x2ca03e[_0x2829('0x2f')]['length']?_0x2ca03e['attributes']:_0x142536[_0x2829('0x30')];if(_0x4bd8d7[_0x2829('0x2d')][_0x2829('0x3c')]){_0x2ca03e['include']=[{'all':!![]}];}_0x2ca03e=_[_0x2829('0x3a')]({},_0x2ca03e,_0x4bd8d7[_0x2829('0x3b')]);return db[_0x2829('0x28')][_0x2829('0x44')](_0x2ca03e)[_0x2829('0x21')](handleEntityNotFound(_0x5e7c0a,null))[_0x2829('0x21')](respondWithResult(_0x5e7c0a,null))[_0x2829('0x40')](handleError(_0x5e7c0a,null));};exports[_0x2829('0x45')]=function(_0x4e577a,_0x3c808f){return db['SmsTransferReport'][_0x2829('0x45')](_0x4e577a['body'],{})[_0x2829('0x21')](respondWithResult(_0x3c808f,0xc9))[_0x2829('0x40')](handleError(_0x3c808f,null));};exports['update']=function(_0x49c0a9,_0x2baca3){if(_0x49c0a9[_0x2829('0x46')]['id']){delete _0x49c0a9['body']['id'];}return db[_0x2829('0x28')][_0x2829('0x44')]({'where':{'id':_0x49c0a9[_0x2829('0x42')]['id']}})['then'](handleEntityNotFound(_0x2baca3,null))[_0x2829('0x21')](saveUpdates(_0x49c0a9['body'],null))['then'](respondWithResult(_0x2baca3,null))[_0x2829('0x40')](handleError(_0x2baca3,null));};exports[_0x2829('0x22')]=function(_0xfe40ad,_0x27efe5){return db['SmsTransferReport'][_0x2829('0x44')]({'where':{'id':_0xfe40ad[_0x2829('0x42')]['id']}})[_0x2829('0x21')](handleEntityNotFound(_0x27efe5,null))['then'](removeEntity(_0x27efe5,null))[_0x2829('0x40')](handleError(_0x27efe5,null));};exports[_0x2829('0x47')]=function(_0xb51bed,_0x22de30){return db['SmsTransferReport'][_0x2829('0x47')]()[_0x2829('0x21')](respondWithResult(_0x22de30,null))['catch'](handleError(_0x22de30,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 949fa64..5c8eecb 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 _0x1d5c=['rimraf','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x54855d,_0x243e02){var _0x31e792=function(_0x3e921e){while(--_0x3e921e){_0x54855d['push'](_0x54855d['shift']());}};_0x31e792(++_0x243e02);}(_0x1d5c,0xeb));var _0xc1d5=function(_0x431ae1,_0x385f06){_0x431ae1=_0x431ae1-0x0;var _0x27fcbd=_0x1d5c[_0x431ae1];return _0x27fcbd;};'use strict';var _=require(_0xc1d5('0x0'));var util=require(_0xc1d5('0x1'));var logger=require(_0xc1d5('0x2'))(_0xc1d5('0x3'));var moment=require(_0xc1d5('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc1d5('0x5'));var config=require('../../config/environment');var attributes=require(_0xc1d5('0x6'));module[_0xc1d5('0x7')]=function(_0x4a80ad,_0x2accf0){return _0x4a80ad[_0xc1d5('0x8')](_0xc1d5('0x9'),attributes,{'tableName':_0xc1d5('0xa'),'paranoid':![],'indexes':[{'name':_0xc1d5('0xb'),'fields':[_0xc1d5('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x87df=['bluebird','request-promise','path','rimraf','../../config/environment','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x87df,0x167));var _0xf87d=function(_0xaf29da,_0x117f5a){_0xaf29da=_0xaf29da-0x0;var _0x295c51=_0x87df[_0xaf29da];return _0x295c51;};'use strict';var _=require(_0xf87d('0x0'));var util=require(_0xf87d('0x1'));var logger=require(_0xf87d('0x2'))(_0xf87d('0x3'));var moment=require(_0xf87d('0x4'));var BPromise=require(_0xf87d('0x5'));var rp=require(_0xf87d('0x6'));var fs=require('fs');var path=require(_0xf87d('0x7'));var rimraf=require(_0xf87d('0x8'));var config=require(_0xf87d('0x9'));var attributes=require('./smsTransferReport.attributes');module['exports']=function(_0x38045e,_0x40a15b){return _0x38045e['define'](_0xf87d('0xa'),attributes,{'tableName':_0xf87d('0xb'),'paranoid':![],'indexes':[{'name':_0xf87d('0xc'),'fields':[_0xf87d('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 a56a596..58ede17 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 _0xb2ff=['stringify','error','SmsTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x1afd4a,_0x183043){var _0x460ddf=function(_0x3566fc){while(--_0x3566fc){_0x1afd4a['push'](_0x1afd4a['shift']());}};_0x460ddf(++_0x183043);}(_0xb2ff,0x123));var _0xfb2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb2ff[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfb2f('0x0'));var util=require(_0xfb2f('0x1'));var moment=require('moment');var BPromise=require(_0xfb2f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfb2f('0x3'));var logger=require('../../config/logger')(_0xfb2f('0x4'));var config=require(_0xfb2f('0x5'));var jayson=require(_0xfb2f('0x6'));var client=jayson[_0xfb2f('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a0fd7,_0x28cb13,_0x4ff2df){return new BPromise(function(_0x34c04e,_0x4588d6){return client[_0xfb2f('0x8')](_0x4a0fd7,_0x4ff2df)[_0xfb2f('0x9')](function(_0x5abcdb){logger[_0xfb2f('0xa')]('SmsTransferReport,\x20%s,\x20%s',_0x28cb13,_0xfb2f('0xb'));logger['debug'](_0xfb2f('0xc'),_0x28cb13,_0xfb2f('0xb'),JSON[_0xfb2f('0xd')](_0x5abcdb));if(_0x5abcdb[_0xfb2f('0xe')]){if(_0x5abcdb[_0xfb2f('0xe')]['code']===0x1f4){logger[_0xfb2f('0xe')](_0xfb2f('0xf'),_0x28cb13,_0x5abcdb[_0xfb2f('0xe')][_0xfb2f('0x10')]);return _0x4588d6(_0x5abcdb[_0xfb2f('0xe')][_0xfb2f('0x10')]);}logger[_0xfb2f('0xe')](_0xfb2f('0xf'),_0x28cb13,_0x5abcdb['error'][_0xfb2f('0x10')]);return _0x34c04e(_0x5abcdb[_0xfb2f('0xe')][_0xfb2f('0x10')]);}else{logger[_0xfb2f('0xa')](_0xfb2f('0xf'),_0x28cb13,'request\x20sent');_0x34c04e(_0x5abcdb[_0xfb2f('0x11')][_0xfb2f('0x10')]);}})[_0xfb2f('0x12')](function(_0x240b79){logger[_0xfb2f('0xe')](_0xfb2f('0xf'),_0x28cb13,_0x240b79);_0x4588d6(_0x240b79);});});} \ No newline at end of file +var _0xbdfd=['SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','then','info'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0xbdfd,0x135));var _0xdbdf=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xbdfd[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xdbdf('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xdbdf('0x1'));var rs=require(_0xdbdf('0x2'));var fs=require('fs');var Redis=require(_0xdbdf('0x3'));var db=require(_0xdbdf('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xdbdf('0x5'))(_0xdbdf('0x6'));var config=require('../../config/environment');var jayson=require(_0xdbdf('0x7'));var client=jayson[_0xdbdf('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40096b,_0x116557,_0x121a56){return new BPromise(function(_0x272b5b,_0x39c0c6){return client['request'](_0x40096b,_0x121a56)[_0xdbdf('0x9')](function(_0x2fd118){logger[_0xdbdf('0xa')](_0xdbdf('0xb'),_0x116557,_0xdbdf('0xc'));logger[_0xdbdf('0xd')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x116557,'request\x20sent',JSON[_0xdbdf('0xe')](_0x2fd118));if(_0x2fd118[_0xdbdf('0xf')]){if(_0x2fd118[_0xdbdf('0xf')][_0xdbdf('0x10')]===0x1f4){logger[_0xdbdf('0xf')](_0xdbdf('0xb'),_0x116557,_0x2fd118['error'][_0xdbdf('0x11')]);return _0x39c0c6(_0x2fd118[_0xdbdf('0xf')][_0xdbdf('0x11')]);}logger[_0xdbdf('0xf')](_0xdbdf('0xb'),_0x116557,_0x2fd118[_0xdbdf('0xf')][_0xdbdf('0x11')]);return _0x272b5b(_0x2fd118['error'][_0xdbdf('0x11')]);}else{logger[_0xdbdf('0xa')](_0xdbdf('0xb'),_0x116557,_0xdbdf('0xc'));_0x272b5b(_0x2fd118[_0xdbdf('0x12')]['message']);}})[_0xdbdf('0x13')](function(_0x34c928){logger[_0xdbdf('0xf')](_0xdbdf('0xb'),_0x116557,_0x34c928);_0x39c0c6(_0x34c928);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 169ef80..8f1a784 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 _0xa89b=['path','connect-timeout','Router','../../components/auth/service','../../config/environment','./sound.controller','get','isAuthenticated','show','download','diskStorage','join','root','server/files/sounds/original/','originalname','format','%s-%s%s','basename','extname','now','post','put','delete','/:id'];(function(_0x2cad4d,_0x286c70){var _0x1f0915=function(_0x1f40e6){while(--_0x1f40e6){_0x2cad4d['push'](_0x2cad4d['shift']());}};_0x1f0915(++_0x286c70);}(_0xa89b,0x90));var _0xba89=function(_0x310504,_0x26ad95){_0x310504=_0x310504-0x0;var _0x5b36d0=_0xa89b[_0x310504];return _0x5b36d0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xba89('0x0'));var timeout=require(_0xba89('0x1'));var express=require('express');var router=express[_0xba89('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xba89('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xba89('0x4'));var controller=require(_0xba89('0x5'));router[_0xba89('0x6')]('/',auth[_0xba89('0x7')](),controller['index']);router[_0xba89('0x6')]('/:id',auth[_0xba89('0x7')](),controller[_0xba89('0x8')]);router[_0xba89('0x6')]('/:id/download',auth[_0xba89('0x7')](),controller[_0xba89('0x9')]);var upload=multer({'storage':multer[_0xba89('0xa')]({'destination':function(_0x4a5336,_0x2684c7,_0x4666fa){_0x4666fa(null,path[_0xba89('0xb')](config[_0xba89('0xc')],_0xba89('0xd')));},'filename':function(_0x241e03,_0x59267f,_0x5ae7df){_0x59267f[_0xba89('0xe')]=_0x59267f[_0xba89('0xe')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5ae7df(null,util[_0xba89('0xf')](_0xba89('0x10'),path[_0xba89('0x11')](_0x59267f['originalname'],path[_0xba89('0x12')](_0x59267f[_0xba89('0xe')])),Date[_0xba89('0x13')](),path[_0xba89('0x12')](_0x59267f[_0xba89('0xe')])));}})});router[_0xba89('0x14')]('/',upload['single']('file'),controller['create']);router[_0xba89('0x15')]('/:id',auth[_0xba89('0x7')](),controller['update']);router[_0xba89('0x16')](_0xba89('0x17'),auth['isAuthenticated'](),controller[_0xba89('0x16')]);module['exports']=router; \ No newline at end of file +var _0xc086=['Router','fs-extra','../../components/auth/service','../../config/environment','./sound.controller','get','isAuthenticated','/:id','download','diskStorage','join','root','format','basename','originalname','extname','now','post','single','create','update','delete','multer','path','express'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc086,0x18d));var _0x6c08=function(_0x388460,_0x311393){_0x388460=_0x388460-0x0;var _0x59d1ee=_0xc086[_0x388460];return _0x59d1ee;};'use strict';var multer=require(_0x6c08('0x0'));var util=require('util');var path=require(_0x6c08('0x1'));var timeout=require('connect-timeout');var express=require(_0x6c08('0x2'));var router=express[_0x6c08('0x3')]();var fs_extra=require(_0x6c08('0x4'));var auth=require(_0x6c08('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6c08('0x6'));var controller=require(_0x6c08('0x7'));router[_0x6c08('0x8')]('/',auth[_0x6c08('0x9')](),controller['index']);router['get'](_0x6c08('0xa'),auth[_0x6c08('0x9')](),controller['show']);router[_0x6c08('0x8')]('/:id/download',auth[_0x6c08('0x9')](),controller[_0x6c08('0xb')]);var upload=multer({'storage':multer[_0x6c08('0xc')]({'destination':function(_0x5b2368,_0xc284fc,_0x3b4bc3){_0x3b4bc3(null,path[_0x6c08('0xd')](config[_0x6c08('0xe')],'server/files/sounds/original/'));},'filename':function(_0x5e16fc,_0x25c522,_0x3287b4){_0x25c522['originalname']=_0x25c522['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3287b4(null,util[_0x6c08('0xf')]('%s-%s%s',path[_0x6c08('0x10')](_0x25c522[_0x6c08('0x11')],path[_0x6c08('0x12')](_0x25c522[_0x6c08('0x11')])),Date[_0x6c08('0x13')](),path['extname'](_0x25c522['originalname'])));}})});router[_0x6c08('0x14')]('/',upload[_0x6c08('0x15')]('file'),controller[_0x6c08('0x16')]);router['put'](_0x6c08('0xa'),auth[_0x6c08('0x9')](),controller[_0x6c08('0x17')]);router[_0x6c08('0x18')](_0x6c08('0xa'),auth[_0x6c08('0x9')](),controller[_0x6c08('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index a2bbd7f..7ed0b3d 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 _0x49ba=['BIGINT','sequelize','exports','name','STRING','FLOAT','INTEGER'];(function(_0x18abd2,_0x22d4b3){var _0x1dcad6=function(_0xcc08c4){while(--_0xcc08c4){_0x18abd2['push'](_0x18abd2['shift']());}};_0x1dcad6(++_0x22d4b3);}(_0x49ba,0x112));var _0xa49b=function(_0x5cb07f,_0xcfeaa5){_0x5cb07f=_0x5cb07f-0x0;var _0x4f8f59=_0x49ba[_0x5cb07f];return _0x4f8f59;};'use strict';var Sequelize=require(_0xa49b('0x0'));module[_0xa49b('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xa49b('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0xa49b('0x3')]},'display_name':{'type':Sequelize[_0xa49b('0x3')],'defaultValue':''},'description':{'type':Sequelize[_0xa49b('0x3')]},'original_format':{'type':Sequelize[_0xa49b('0x3')]},'original_duration':{'type':Sequelize[_0xa49b('0x4')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0xa49b('0x5')]},'original_bitRate':{'type':Sequelize[_0xa49b('0x6')]},'original_sampleRate':{'type':Sequelize[_0xa49b('0x5')]},'converted_format':{'type':Sequelize[_0xa49b('0x3')]},'converted_duration':{'type':Sequelize[_0xa49b('0x4')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0xa49b('0x5')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xfc15=['name','FLOAT','BIGINT','INTEGER','sequelize','exports','STRING'];(function(_0x3b78f0,_0x1b51d5){var _0x213ef3=function(_0x304190){while(--_0x304190){_0x3b78f0['push'](_0x3b78f0['shift']());}};_0x213ef3(++_0x1b51d5);}(_0xfc15,0xd6));var _0x5fc1=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0xfc15[_0x1ccdf7];return _0x52a0ae;};'use strict';var Sequelize=require(_0x5fc1('0x0'));module[_0x5fc1('0x1')]={'name':{'type':Sequelize[_0x5fc1('0x2')],'unique':_0x5fc1('0x3'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x5fc1('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x5fc1('0x2')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0x5fc1('0x4')]},'original_sampleCount':{'type':Sequelize[_0x5fc1('0x5')]},'original_channelCount':{'type':Sequelize[_0x5fc1('0x6')]},'original_bitRate':{'type':Sequelize[_0x5fc1('0x5')]},'original_sampleRate':{'type':Sequelize[_0x5fc1('0x6')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0x5fc1('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x5fc1('0x5')]},'converted_channelCount':{'type':Sequelize[_0x5fc1('0x6')]},'converted_bitRate':{'type':Sequelize[_0x5fc1('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x5fc1('0x6')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 5bb4f0f..0517f88 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 _0x424c=['../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','apply','reject','then','destroy','get','UserProfileResource','name','send','index','map','Sound','rawAttributes','fieldName','type','key','model','keys','attributes','query','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','intersection','includeAll','options','download','find','save_name','join','converted_format','Sequelize','ValidationError','Sound\x20not\x20found','server/files/sounds/converted','format','%s.%s','create','basename','file','originalname','extname','filename','substring','wav','root','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','0777','transcode','error','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_sampleCount','converted_channelCount','converted_sampleRate','chmodSync','body','role','userProfileId','user','UserProfileSection','Sounds','autoAssociation','update','description','delete','server/files/sounds/original','original_format','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','desk.js','querystring','papaparse','../../components/auth/service'];(function(_0x12409c,_0x3e858e){var _0x353baf=function(_0x4fa069){while(--_0x4fa069){_0x12409c['push'](_0x12409c['shift']());}};_0x353baf(++_0x3e858e);}(_0x424c,0x15e));var _0xc424=function(_0x44044a,_0x3a0097){_0x44044a=_0x44044a-0x0;var _0x43bb6e=_0x424c[_0x44044a];return _0x43bb6e;};'use strict';var emlformat=require(_0xc424('0x0'));var rimraf=require(_0xc424('0x1'));var zipdir=require(_0xc424('0x2'));var jsonpatch=require(_0xc424('0x3'));var rp=require('request-promise');var moment=require(_0xc424('0x4'));var BPromise=require(_0xc424('0x5'));var Mustache=require(_0xc424('0x6'));var util=require(_0xc424('0x7'));var path=require('path');var sox=require(_0xc424('0x8'));var csv=require(_0xc424('0x9'));var ejs=require(_0xc424('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc424('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc424('0xc'));var toCsv=require('to-csv');var querystring=require(_0xc424('0xd'));var Papa=require(_0xc424('0xe'));var Redis=require('ioredis');var authService=require(_0xc424('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xc424('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc424('0x11'));var utils=require('../../config/utils');var config=require(_0xc424('0x12'));var licenseUtil=require(_0xc424('0x13'));var db=require(_0xc424('0x14'))['db'];function respondWithStatusCode(_0x2ef15f,_0x272493){_0x272493=_0x272493||0xcc;return function(_0x14fdf5){if(_0x14fdf5){return _0x2ef15f[_0xc424('0x15')](_0x272493);}return _0x2ef15f[_0xc424('0x16')](_0x272493)[_0xc424('0x17')]();};}function respondWithResult(_0x40cc70,_0xa800c0){_0xa800c0=_0xa800c0||0xc8;return function(_0x20ab83){if(_0x20ab83){return _0x40cc70['status'](_0xa800c0)[_0xc424('0x18')](_0x20ab83);}};}function respondWithFilteredResult(_0x5b6862,_0x6e2eed){return function(_0x740c54){if(_0x740c54){var _0xfe53ef=typeof _0x6e2eed['offset']===_0xc424('0x19')&&typeof _0x6e2eed[_0xc424('0x1a')]===_0xc424('0x19');var _0x1ad37e=_0x740c54['count'];var _0x210c56=_0xfe53ef?0x0:_0x6e2eed[_0xc424('0x1b')];var _0x4b2bbf=_0xfe53ef?_0x740c54[_0xc424('0x1c')]:_0x6e2eed[_0xc424('0x1b')]+_0x6e2eed['limit'];var _0x4fb4cd;if(_0x4b2bbf>=_0x1ad37e){_0x4b2bbf=_0x1ad37e;_0x4fb4cd=0xc8;}else{_0x4fb4cd=0xce;}_0x5b6862[_0xc424('0x16')](_0x4fb4cd);return _0x5b6862['set']('Content-Range',_0x210c56+'-'+_0x4b2bbf+'/'+_0x1ad37e)[_0xc424('0x18')](_0x740c54);}return null;};}function patchUpdates(_0x368784){return function(_0x55b3ae){try{jsonpatch[_0xc424('0x1d')](_0x55b3ae,_0x368784,!![]);}catch(_0x3850f8){return BPromise[_0xc424('0x1e')](_0x3850f8);}return _0x55b3ae['save']();};}function saveUpdates(_0x1963ab,_0x19ef10){return function(_0x3475c8){if(_0x3475c8){return _0x3475c8['update'](_0x1963ab)[_0xc424('0x1f')](function(_0x5866ee){return _0x5866ee;});}return null;};}function removeEntity(_0x603b9a,_0x46d4ae){return function(_0x997966){if(_0x997966){return _0x997966[_0xc424('0x20')]()[_0xc424('0x1f')](function(){var _0x5eaa02=_0x997966[_0xc424('0x21')]({'plain':!![]});var _0x29c196='Sounds';return db[_0xc424('0x22')][_0xc424('0x20')]({'where':{'type':_0x29c196,'resourceId':_0x5eaa02['id']}})[_0xc424('0x1f')](function(){return _0x997966;});})[_0xc424('0x1f')](function(){_0x603b9a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d51a7,_0x3488fc){return function(_0x20e859){if(!_0x20e859){_0x5d51a7[_0xc424('0x15')](0x194);}return _0x20e859;};}function handleError(_0x335554,_0xddf081){_0xddf081=_0xddf081||0x1f4;return function(_0x10e867){logger['error'](_0x10e867['stack']);if(_0x10e867[_0xc424('0x23')]){delete _0x10e867[_0xc424('0x23')];}_0x335554['status'](_0xddf081)[_0xc424('0x24')](_0x10e867);};}exports[_0xc424('0x25')]=function(_0x37afd5,_0x132e7a){var _0x35a5c2={},_0x59e1fe={},_0x29f7a0={'count':0x0,'rows':[]};var _0x3bedff=_[_0xc424('0x26')](db[_0xc424('0x27')][_0xc424('0x28')],function(_0x1afbfa){return{'name':_0x1afbfa[_0xc424('0x29')],'type':_0x1afbfa[_0xc424('0x2a')][_0xc424('0x2b')]};});_0x59e1fe[_0xc424('0x2c')]=_[_0xc424('0x26')](_0x3bedff,_0xc424('0x23'));_0x59e1fe['query']=_[_0xc424('0x2d')](_0x37afd5['query']);_0x59e1fe['filters']=_['intersection'](_0x59e1fe[_0xc424('0x2c')],_0x59e1fe['query']);_0x35a5c2[_0xc424('0x2e')]=_['intersection'](_0x59e1fe['model'],qs['fields'](_0x37afd5[_0xc424('0x2f')][_0xc424('0x30')]));_0x35a5c2['attributes']=_0x35a5c2[_0xc424('0x2e')][_0xc424('0x31')]?_0x35a5c2[_0xc424('0x2e')]:_0x59e1fe['model'];if(!_0x37afd5[_0xc424('0x2f')]['hasOwnProperty'](_0xc424('0x32'))){_0x35a5c2['limit']=qs[_0xc424('0x1a')](_0x37afd5[_0xc424('0x2f')]['limit']);_0x35a5c2['offset']=qs['offset'](_0x37afd5[_0xc424('0x2f')][_0xc424('0x1b')]);}_0x35a5c2[_0xc424('0x33')]=qs[_0xc424('0x34')](_0x37afd5['query'][_0xc424('0x34')]);_0x35a5c2[_0xc424('0x35')]=qs[_0xc424('0x36')](_[_0xc424('0x37')](_0x37afd5['query'],_0x59e1fe['filters']),_0x3bedff);if(_0x37afd5[_0xc424('0x2f')][_0xc424('0x38')]){_0x35a5c2[_0xc424('0x35')]=_[_0xc424('0x39')](_0x35a5c2[_0xc424('0x35')],{'$or':_[_0xc424('0x26')](_0x3bedff,function(_0x4ac082){if(_0x4ac082[_0xc424('0x2a')]!==_0xc424('0x3a')){var _0x37c99d={};_0x37c99d[_0x4ac082[_0xc424('0x23')]]={'$like':'%'+_0x37afd5['query'][_0xc424('0x38')]+'%'};return _0x37c99d;}})});}_0x35a5c2=_[_0xc424('0x39')]({},_0x35a5c2,_0x37afd5['options']);var _0x249d54={'where':_0x35a5c2[_0xc424('0x35')]};return db[_0xc424('0x27')]['count'](_0x249d54)[_0xc424('0x1f')](function(_0x5f3adf){_0x29f7a0[_0xc424('0x1c')]=_0x5f3adf;if(_0x37afd5[_0xc424('0x2f')]['includeAll']){_0x35a5c2[_0xc424('0x3b')]=[{'all':!![]}];}return db[_0xc424('0x27')][_0xc424('0x3c')](_0x35a5c2);})[_0xc424('0x1f')](function(_0x4abce3){_0x29f7a0[_0xc424('0x3d')]=_0x4abce3;return _0x29f7a0;})['then'](respondWithFilteredResult(_0x132e7a,_0x35a5c2))[_0xc424('0x3e')](handleError(_0x132e7a,null));};exports[_0xc424('0x3f')]=function(_0x35b070,_0x3e6b5c){var _0x3f2f44={'raw':!![],'where':{'id':_0x35b070[_0xc424('0x40')]['id']}},_0x401672={};_0x401672[_0xc424('0x2c')]=_['keys'](db[_0xc424('0x27')]['rawAttributes']);_0x401672['query']=_['keys'](_0x35b070['query']);_0x401672[_0xc424('0x36')]=_[_0xc424('0x41')](_0x401672['model'],_0x401672['query']);_0x3f2f44[_0xc424('0x2e')]=_[_0xc424('0x41')](_0x401672[_0xc424('0x2c')],qs['fields'](_0x35b070[_0xc424('0x2f')][_0xc424('0x30')]));_0x3f2f44[_0xc424('0x2e')]=_0x3f2f44[_0xc424('0x2e')]['length']?_0x3f2f44[_0xc424('0x2e')]:_0x401672[_0xc424('0x2c')];if(_0x35b070[_0xc424('0x2f')][_0xc424('0x42')]){_0x3f2f44['include']=[{'all':!![]}];}_0x3f2f44=_[_0xc424('0x39')]({},_0x3f2f44,_0x35b070[_0xc424('0x43')]);return db[_0xc424('0x27')]['find'](_0x3f2f44)[_0xc424('0x1f')](handleEntityNotFound(_0x3e6b5c,null))['then'](respondWithResult(_0x3e6b5c,null))['catch'](handleError(_0x3e6b5c,null));};exports[_0xc424('0x44')]=function(_0x3f0c16,_0x7de56e,_0x3e398d){return db['Sound'][_0xc424('0x45')]({'where':{'id':_0x3f0c16['params']['id']},'attributes':[_0xc424('0x23'),_0xc424('0x46'),'converted_format'],'raw':!![]})[_0xc424('0x1f')](handleEntityNotFound(_0x7de56e,null))[_0xc424('0x1f')](function(_0x54e7e2){if(_0x54e7e2){if(!fs['existsSync'](path[_0xc424('0x47')](config['root'],'server/files/sounds/converted',_0x54e7e2['save_name']+'.'+_0x54e7e2[_0xc424('0x48')]))){throw new db[(_0xc424('0x49'))][(_0xc424('0x4a'))](_0xc424('0x4b'));}return _0x7de56e[_0xc424('0x44')](path['join'](config['root'],_0xc424('0x4c'),util[_0xc424('0x4d')](_0xc424('0x4e'),_0x54e7e2['save_name'],_0x54e7e2[_0xc424('0x48')])),util['format'](_0xc424('0x4e'),_0x54e7e2[_0xc424('0x23')],_0x54e7e2[_0xc424('0x48')]));}return null;})['catch'](handleError(_0x7de56e,null));};exports[_0xc424('0x4f')]=function(_0xfdcf56,_0x973f5b,_0x1c097d){var _0x34d31c={'name':path[_0xc424('0x50')](_0xfdcf56[_0xc424('0x51')][_0xc424('0x52')],path[_0xc424('0x53')](_0xfdcf56[_0xc424('0x51')][_0xc424('0x52')])),'save_name':path[_0xc424('0x50')](_0xfdcf56['file'][_0xc424('0x54')],path[_0xc424('0x53')](_0xfdcf56['file']['filename'])),'original_format':path[_0xc424('0x53')](_0xfdcf56[_0xc424('0x51')][_0xc424('0x52')])[_0xc424('0x55')](0x1),'converted_format':_0xc424('0x56')};var _0x10ede=path[_0xc424('0x47')](config[_0xc424('0x57')],'server/files/sounds/original',_0xfdcf56[_0xc424('0x51')][_0xc424('0x54')]);var _0x136862=path['join'](config['root'],_0xc424('0x4c'),util['format']('%s.%s',path['basename'](_0xfdcf56['file'][_0xc424('0x54')],path[_0xc424('0x53')](_0xfdcf56[_0xc424('0x51')][_0xc424('0x54')])),_0x34d31c[_0xc424('0x48')]));logger[_0xc424('0x58')](_0xc424('0x59'),_0x10ede);logger['info'](_0xc424('0x5a'),_0x136862);try{fs['chmodSync'](_0x10ede,parseInt(_0xc424('0x5b'),0x8));var _0x194d82=sox[_0xc424('0x5c')](_0x10ede,_0x136862,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x194d82['on'](_0xc424('0x5d'),function(_0x1eeb26){fs['unlinkSync'](_0x10ede);_0x973f5b[_0xc424('0x16')](0x1f4)['send'](_0x1eeb26);});_0x194d82['on'](_0xc424('0x5e'),function(_0x419deb){_0x34d31c[_0xc424('0x5f')]=isNaN(_0x419deb[_0xc424('0x60')])?null:_0x419deb[_0xc424('0x60')]*0x3e8;_0x34d31c[_0xc424('0x61')]=isNaN(_0x419deb[_0xc424('0x62')])?null:_0x419deb[_0xc424('0x62')];_0x34d31c[_0xc424('0x63')]=isNaN(_0x419deb[_0xc424('0x64')])?null:_0x419deb[_0xc424('0x64')];_0x34d31c[_0xc424('0x65')]=isNaN(_0x419deb['bitRate'])?null:_0x419deb[_0xc424('0x66')];_0x34d31c[_0xc424('0x67')]=isNaN(_0x419deb[_0xc424('0x68')])?null:_0x419deb[_0xc424('0x68')];});_0x194d82['on']('dest',function(_0x2067b0){_0x34d31c['converted_duration']=isNaN(_0x2067b0[_0xc424('0x60')])?null:_0x2067b0[_0xc424('0x60')]*0x3e8;_0x34d31c[_0xc424('0x69')]=isNaN(_0x2067b0[_0xc424('0x62')])?null:_0x2067b0[_0xc424('0x62')];_0x34d31c[_0xc424('0x6a')]=isNaN(_0x2067b0[_0xc424('0x64')])?null:_0x2067b0[_0xc424('0x64')];_0x34d31c['converted_bitRate']=isNaN(_0x2067b0[_0xc424('0x66')])?null:_0x2067b0[_0xc424('0x66')];_0x34d31c[_0xc424('0x6b')]=isNaN(_0x2067b0[_0xc424('0x68')])?null:_0x2067b0[_0xc424('0x68')];});_0x194d82['on'](_0xc424('0x17'),function(){fs[_0xc424('0x6c')](_0x136862,parseInt(_0xc424('0x5b'),0x8));return db[_0xc424('0x27')]['create'](_0x34d31c)['then'](function(_0x271fc0){var _0x58a9f6={'role':_0xfdcf56[_0xc424('0x6d')][_0xc424('0x6e')],'userProfileId':_0xfdcf56[_0xc424('0x6d')][_0xc424('0x6f')]};if(!_0x58a9f6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x58a9f6[_0xc424('0x6e')]===_0xc424('0x70')){var _0x335d81=_0x271fc0[_0xc424('0x21')]({'plain':!![]});return db[_0xc424('0x71')]['find']({'where':{'name':_0xc424('0x72'),'userProfileId':_0x58a9f6[_0xc424('0x6f')]},'raw':!![]})[_0xc424('0x1f')](function(_0x1365c4){if(_0x1365c4&&_0x1365c4[_0xc424('0x73')]===0x0){return db['UserProfileResource'][_0xc424('0x4f')]({'name':_0x335d81[_0xc424('0x23')],'resourceId':_0x335d81['id'],'type':_0x1365c4[_0xc424('0x23')],'sectionId':_0x1365c4['id']},{})[_0xc424('0x1f')](function(){return _0x271fc0;});}else{return _0x271fc0;}})[_0xc424('0x3e')](function(_0x4988f9){logger[_0xc424('0x5d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4988f9);throw _0x4988f9;});}return _0x271fc0;})['then'](respondWithResult(_0x973f5b,null))[_0xc424('0x3e')](handleError(_0x973f5b,null));});_0x194d82['start']();}catch(_0x20e062){_0x973f5b[_0xc424('0x16')](0x1f4)[_0xc424('0x24')](_0x20e062);}};exports[_0xc424('0x74')]=function(_0x32c382,_0x4898cc,_0x8089ce){return db[_0xc424('0x27')][_0xc424('0x45')]({'where':{'id':_0x32c382['params']['id']}})['then'](handleEntityNotFound(_0x4898cc,null))[_0xc424('0x1f')](saveUpdates(_[_0xc424('0x37')](_0x32c382['body'],[_0xc424('0x23'),_0xc424('0x75')]),null))['then'](respondWithResult(_0x4898cc,null))[_0xc424('0x3e')](handleError(_0x4898cc,null));};exports[_0xc424('0x76')]=function(_0x59ecae,_0xb31bb4,_0x2da02a){return db[_0xc424('0x27')][_0xc424('0x45')]({'where':{'id':_0x59ecae[_0xc424('0x40')]['id']}})[_0xc424('0x1f')](function(_0x36c733){if(_0x36c733){return _0x36c733['destroy']();}})[_0xc424('0x1f')](function(_0x196489){var _0x38a98a=path['join'](config[_0xc424('0x57')],_0xc424('0x77'),util[_0xc424('0x4d')](_0xc424('0x4e'),_0x196489[_0xc424('0x46')],_0x196489[_0xc424('0x78')]));var _0x22b4a3=path[_0xc424('0x47')](config[_0xc424('0x57')],'server/files/sounds/converted',util[_0xc424('0x4d')](_0xc424('0x4e'),_0x196489[_0xc424('0x46')],_0x196489[_0xc424('0x48')]));fs['unlinkSync'](_0x38a98a);fs[_0xc424('0x79')](_0x22b4a3);return _0x196489;})[_0xc424('0x1f')](function(_0x25d701){if(_0x25d701){return _0xb31bb4[_0xc424('0x16')](0xcc)['end']();}})[_0xc424('0x1f')](handleEntityNotFound(_0xb31bb4,null))[_0xc424('0x3e')](handleError(_0xb31bb4,null));}; \ No newline at end of file +var _0xd32e=['converted_format','existsSync','join','server/files/sounds/converted','Sound\x20not\x20found','download','format','create','file','extname','originalname','basename','filename','wav','server/files/sounds/original','root','%s.%s','info','Sound\x20upload\x20destination:\x20%s','chmodSync','error','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_sampleCount','converted_bitRate','body','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','description','delete','original_format','unlinkSync','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','get','Sounds','UserProfileResource','then','stack','name','send','index','map','Sound','rawAttributes','type','model','query','keys','filters','attributes','fields','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','show','intersection','catch','find','save_name'];(function(_0xe0b81f,_0x1fb734){var _0x290e5e=function(_0x19b8d3){while(--_0x19b8d3){_0xe0b81f['push'](_0xe0b81f['shift']());}};_0x290e5e(++_0x1fb734);}(_0xd32e,0xa0));var _0xed32=function(_0x4bb95a,_0x4720f5){_0x4bb95a=_0x4bb95a-0x0;var _0x531365=_0xd32e[_0x4bb95a];return _0x531365;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xed32('0x0'));var jsonpatch=require(_0xed32('0x1'));var rp=require(_0xed32('0x2'));var moment=require('moment');var BPromise=require(_0xed32('0x3'));var Mustache=require(_0xed32('0x4'));var util=require(_0xed32('0x5'));var path=require(_0xed32('0x6'));var sox=require(_0xed32('0x7'));var csv=require(_0xed32('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xed32('0x9'));var _=require(_0xed32('0xa'));var squel=require(_0xed32('0xb'));var crypto=require(_0xed32('0xc'));var jsforce=require(_0xed32('0xd'));var deskjs=require(_0xed32('0xe'));var toCsv=require(_0xed32('0x8'));var querystring=require(_0xed32('0xf'));var Papa=require(_0xed32('0x10'));var Redis=require(_0xed32('0x11'));var authService=require(_0xed32('0x12'));var qs=require(_0xed32('0x13'));var as=require(_0xed32('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xed32('0x15'))(_0xed32('0x16'));var utils=require(_0xed32('0x17'));var config=require(_0xed32('0x18'));var licenseUtil=require(_0xed32('0x19'));var db=require(_0xed32('0x1a'))['db'];function respondWithStatusCode(_0x435a41,_0x3b5330){_0x3b5330=_0x3b5330||0xcc;return function(_0x48239d){if(_0x48239d){return _0x435a41[_0xed32('0x1b')](_0x3b5330);}return _0x435a41[_0xed32('0x1c')](_0x3b5330)[_0xed32('0x1d')]();};}function respondWithResult(_0x508e12,_0x98c52b){_0x98c52b=_0x98c52b||0xc8;return function(_0x2a2ff1){if(_0x2a2ff1){return _0x508e12['status'](_0x98c52b)[_0xed32('0x1e')](_0x2a2ff1);}};}function respondWithFilteredResult(_0x40e650,_0x5b7d28){return function(_0x55e530){if(_0x55e530){var _0x130665=typeof _0x5b7d28[_0xed32('0x1f')]===_0xed32('0x20')&&typeof _0x5b7d28[_0xed32('0x21')]===_0xed32('0x20');var _0xcbf29e=_0x55e530[_0xed32('0x22')];var _0x491b18=_0x130665?0x0:_0x5b7d28[_0xed32('0x1f')];var _0x5c57be=_0x130665?_0x55e530[_0xed32('0x22')]:_0x5b7d28[_0xed32('0x1f')]+_0x5b7d28[_0xed32('0x21')];var _0x2a07d4;if(_0x5c57be>=_0xcbf29e){_0x5c57be=_0xcbf29e;_0x2a07d4=0xc8;}else{_0x2a07d4=0xce;}_0x40e650[_0xed32('0x1c')](_0x2a07d4);return _0x40e650[_0xed32('0x23')](_0xed32('0x24'),_0x491b18+'-'+_0x5c57be+'/'+_0xcbf29e)['json'](_0x55e530);}return null;};}function patchUpdates(_0x153f5e){return function(_0x2e7085){try{jsonpatch[_0xed32('0x25')](_0x2e7085,_0x153f5e,!![]);}catch(_0x45eb48){return BPromise['reject'](_0x45eb48);}return _0x2e7085[_0xed32('0x26')]();};}function saveUpdates(_0x178237,_0x194b1f){return function(_0x3d655d){if(_0x3d655d){return _0x3d655d[_0xed32('0x27')](_0x178237)['then'](function(_0x10fe06){return _0x10fe06;});}return null;};}function removeEntity(_0x135591,_0x144825){return function(_0x1c896f){if(_0x1c896f){return _0x1c896f[_0xed32('0x28')]()['then'](function(){var _0xa9f31f=_0x1c896f[_0xed32('0x29')]({'plain':!![]});var _0x480fa6=_0xed32('0x2a');return db[_0xed32('0x2b')]['destroy']({'where':{'type':_0x480fa6,'resourceId':_0xa9f31f['id']}})[_0xed32('0x2c')](function(){return _0x1c896f;});})[_0xed32('0x2c')](function(){_0x135591[_0xed32('0x1c')](0xcc)[_0xed32('0x1d')]();});}};}function handleEntityNotFound(_0x4ccd57,_0x525cbf){return function(_0x3704c){if(!_0x3704c){_0x4ccd57[_0xed32('0x1b')](0x194);}return _0x3704c;};}function handleError(_0x59ab82,_0x24b879){_0x24b879=_0x24b879||0x1f4;return function(_0xd69171){logger['error'](_0xd69171[_0xed32('0x2d')]);if(_0xd69171[_0xed32('0x2e')]){delete _0xd69171[_0xed32('0x2e')];}_0x59ab82['status'](_0x24b879)[_0xed32('0x2f')](_0xd69171);};}exports[_0xed32('0x30')]=function(_0xd181e1,_0x2a93a2){var _0x45ee2e={},_0x4574f2={},_0x540a38={'count':0x0,'rows':[]};var _0x659441=_[_0xed32('0x31')](db[_0xed32('0x32')][_0xed32('0x33')],function(_0x3df756){return{'name':_0x3df756['fieldName'],'type':_0x3df756[_0xed32('0x34')]['key']};});_0x4574f2[_0xed32('0x35')]=_[_0xed32('0x31')](_0x659441,_0xed32('0x2e'));_0x4574f2[_0xed32('0x36')]=_[_0xed32('0x37')](_0xd181e1[_0xed32('0x36')]);_0x4574f2[_0xed32('0x38')]=_['intersection'](_0x4574f2['model'],_0x4574f2[_0xed32('0x36')]);_0x45ee2e[_0xed32('0x39')]=_['intersection'](_0x4574f2[_0xed32('0x35')],qs[_0xed32('0x3a')](_0xd181e1['query'][_0xed32('0x3a')]));_0x45ee2e[_0xed32('0x39')]=_0x45ee2e['attributes']['length']?_0x45ee2e[_0xed32('0x39')]:_0x4574f2[_0xed32('0x35')];if(!_0xd181e1[_0xed32('0x36')]['hasOwnProperty'](_0xed32('0x3b'))){_0x45ee2e[_0xed32('0x21')]=qs[_0xed32('0x21')](_0xd181e1['query'][_0xed32('0x21')]);_0x45ee2e['offset']=qs[_0xed32('0x1f')](_0xd181e1[_0xed32('0x36')][_0xed32('0x1f')]);}_0x45ee2e[_0xed32('0x3c')]=qs[_0xed32('0x3d')](_0xd181e1['query'][_0xed32('0x3d')]);_0x45ee2e[_0xed32('0x3e')]=qs['filters'](_[_0xed32('0x3f')](_0xd181e1[_0xed32('0x36')],_0x4574f2[_0xed32('0x38')]),_0x659441);if(_0xd181e1[_0xed32('0x36')][_0xed32('0x40')]){_0x45ee2e[_0xed32('0x3e')]=_[_0xed32('0x41')](_0x45ee2e[_0xed32('0x3e')],{'$or':_[_0xed32('0x31')](_0x659441,function(_0x1d34da){if(_0x1d34da[_0xed32('0x34')]!=='VIRTUAL'){var _0x5159ce={};_0x5159ce[_0x1d34da['name']]={'$like':'%'+_0xd181e1[_0xed32('0x36')]['filter']+'%'};return _0x5159ce;}})});}_0x45ee2e=_[_0xed32('0x41')]({},_0x45ee2e,_0xd181e1[_0xed32('0x42')]);var _0x12dff2={'where':_0x45ee2e[_0xed32('0x3e')]};return db['Sound'][_0xed32('0x22')](_0x12dff2)['then'](function(_0x441026){_0x540a38[_0xed32('0x22')]=_0x441026;if(_0xd181e1['query'][_0xed32('0x43')]){_0x45ee2e[_0xed32('0x44')]=[{'all':!![]}];}return db[_0xed32('0x32')]['findAll'](_0x45ee2e);})['then'](function(_0x40f0eb){_0x540a38['rows']=_0x40f0eb;return _0x540a38;})[_0xed32('0x2c')](respondWithFilteredResult(_0x2a93a2,_0x45ee2e))['catch'](handleError(_0x2a93a2,null));};exports[_0xed32('0x45')]=function(_0xf15000,_0x346073){var _0x2e4ecf={'raw':!![],'where':{'id':_0xf15000['params']['id']}},_0x960fe5={};_0x960fe5[_0xed32('0x35')]=_['keys'](db[_0xed32('0x32')]['rawAttributes']);_0x960fe5[_0xed32('0x36')]=_[_0xed32('0x37')](_0xf15000[_0xed32('0x36')]);_0x960fe5[_0xed32('0x38')]=_[_0xed32('0x46')](_0x960fe5['model'],_0x960fe5[_0xed32('0x36')]);_0x2e4ecf[_0xed32('0x39')]=_[_0xed32('0x46')](_0x960fe5[_0xed32('0x35')],qs[_0xed32('0x3a')](_0xf15000[_0xed32('0x36')][_0xed32('0x3a')]));_0x2e4ecf[_0xed32('0x39')]=_0x2e4ecf['attributes']['length']?_0x2e4ecf[_0xed32('0x39')]:_0x960fe5['model'];if(_0xf15000['query'][_0xed32('0x43')]){_0x2e4ecf[_0xed32('0x44')]=[{'all':!![]}];}_0x2e4ecf=_[_0xed32('0x41')]({},_0x2e4ecf,_0xf15000[_0xed32('0x42')]);return db[_0xed32('0x32')]['find'](_0x2e4ecf)[_0xed32('0x2c')](handleEntityNotFound(_0x346073,null))[_0xed32('0x2c')](respondWithResult(_0x346073,null))[_0xed32('0x47')](handleError(_0x346073,null));};exports['download']=function(_0x239eff,_0x5bbe9f,_0x196837){return db[_0xed32('0x32')][_0xed32('0x48')]({'where':{'id':_0x239eff['params']['id']},'attributes':[_0xed32('0x2e'),_0xed32('0x49'),_0xed32('0x4a')],'raw':!![]})[_0xed32('0x2c')](handleEntityNotFound(_0x5bbe9f,null))[_0xed32('0x2c')](function(_0x356d04){if(_0x356d04){if(!fs[_0xed32('0x4b')](path[_0xed32('0x4c')](config['root'],_0xed32('0x4d'),_0x356d04[_0xed32('0x49')]+'.'+_0x356d04[_0xed32('0x4a')]))){throw new db['Sequelize']['ValidationError'](_0xed32('0x4e'));}return _0x5bbe9f[_0xed32('0x4f')](path[_0xed32('0x4c')](config['root'],'server/files/sounds/converted',util[_0xed32('0x50')]('%s.%s',_0x356d04['save_name'],_0x356d04[_0xed32('0x4a')])),util[_0xed32('0x50')]('%s.%s',_0x356d04['name'],_0x356d04[_0xed32('0x4a')]));}return null;})[_0xed32('0x47')](handleError(_0x5bbe9f,null));};exports[_0xed32('0x51')]=function(_0x3b9bd1,_0x55d316,_0x4974d7){var _0x569ac1={'name':path['basename'](_0x3b9bd1[_0xed32('0x52')]['originalname'],path[_0xed32('0x53')](_0x3b9bd1[_0xed32('0x52')][_0xed32('0x54')])),'save_name':path[_0xed32('0x55')](_0x3b9bd1[_0xed32('0x52')][_0xed32('0x56')],path['extname'](_0x3b9bd1[_0xed32('0x52')][_0xed32('0x56')])),'original_format':path[_0xed32('0x53')](_0x3b9bd1[_0xed32('0x52')][_0xed32('0x54')])['substring'](0x1),'converted_format':_0xed32('0x57')};var _0x597104=path['join'](config['root'],_0xed32('0x58'),_0x3b9bd1[_0xed32('0x52')][_0xed32('0x56')]);var _0x571c94=path[_0xed32('0x4c')](config[_0xed32('0x59')],_0xed32('0x4d'),util[_0xed32('0x50')](_0xed32('0x5a'),path[_0xed32('0x55')](_0x3b9bd1[_0xed32('0x52')][_0xed32('0x56')],path['extname'](_0x3b9bd1['file'][_0xed32('0x56')])),_0x569ac1['converted_format']));logger[_0xed32('0x5b')]('Sound\x20upload\x20filepath:\x20%s',_0x597104);logger['info'](_0xed32('0x5c'),_0x571c94);try{fs[_0xed32('0x5d')](_0x597104,parseInt('0777',0x8));var _0x3715c4=sox['transcode'](_0x597104,_0x571c94,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3715c4['on'](_0xed32('0x5e'),function(_0x4c05a9){fs['unlinkSync'](_0x597104);_0x55d316['status'](0x1f4)['send'](_0x4c05a9);});_0x3715c4['on'](_0xed32('0x5f'),function(_0x81f592){_0x569ac1[_0xed32('0x60')]=isNaN(_0x81f592[_0xed32('0x61')])?null:_0x81f592[_0xed32('0x61')]*0x3e8;_0x569ac1[_0xed32('0x62')]=isNaN(_0x81f592['sampleCount'])?null:_0x81f592[_0xed32('0x63')];_0x569ac1[_0xed32('0x64')]=isNaN(_0x81f592[_0xed32('0x65')])?null:_0x81f592[_0xed32('0x65')];_0x569ac1[_0xed32('0x66')]=isNaN(_0x81f592['bitRate'])?null:_0x81f592[_0xed32('0x67')];_0x569ac1[_0xed32('0x68')]=isNaN(_0x81f592[_0xed32('0x69')])?null:_0x81f592['sampleRate'];});_0x3715c4['on']('dest',function(_0x5ca732){_0x569ac1['converted_duration']=isNaN(_0x5ca732[_0xed32('0x61')])?null:_0x5ca732[_0xed32('0x61')]*0x3e8;_0x569ac1[_0xed32('0x6a')]=isNaN(_0x5ca732[_0xed32('0x63')])?null:_0x5ca732[_0xed32('0x63')];_0x569ac1['converted_channelCount']=isNaN(_0x5ca732[_0xed32('0x65')])?null:_0x5ca732[_0xed32('0x65')];_0x569ac1[_0xed32('0x6b')]=isNaN(_0x5ca732[_0xed32('0x67')])?null:_0x5ca732['bitRate'];_0x569ac1['converted_sampleRate']=isNaN(_0x5ca732[_0xed32('0x69')])?null:_0x5ca732[_0xed32('0x69')];});_0x3715c4['on'](_0xed32('0x1d'),function(){fs['chmodSync'](_0x571c94,parseInt('0777',0x8));return db[_0xed32('0x32')][_0xed32('0x51')](_0x569ac1)['then'](function(_0x44f238){var _0xedb84c={'role':_0x3b9bd1[_0xed32('0x6c')][_0xed32('0x6d')],'userProfileId':_0x3b9bd1[_0xed32('0x6c')][_0xed32('0x6e')]};if(!_0xedb84c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xedb84c[_0xed32('0x6d')]==='user'){var _0xd515ad=_0x44f238[_0xed32('0x29')]({'plain':!![]});return db['UserProfileSection'][_0xed32('0x48')]({'where':{'name':_0xed32('0x2a'),'userProfileId':_0xedb84c['userProfileId']},'raw':!![]})[_0xed32('0x2c')](function(_0x16dbb1){if(_0x16dbb1&&_0x16dbb1['autoAssociation']===0x0){return db[_0xed32('0x2b')][_0xed32('0x51')]({'name':_0xd515ad[_0xed32('0x2e')],'resourceId':_0xd515ad['id'],'type':_0x16dbb1[_0xed32('0x2e')],'sectionId':_0x16dbb1['id']},{})[_0xed32('0x2c')](function(){return _0x44f238;});}else{return _0x44f238;}})[_0xed32('0x47')](function(_0x1861ef){logger[_0xed32('0x5e')](_0xed32('0x6f'),_0x1861ef);throw _0x1861ef;});}return _0x44f238;})[_0xed32('0x2c')](respondWithResult(_0x55d316,null))['catch'](handleError(_0x55d316,null));});_0x3715c4['start']();}catch(_0x2ac4f2){_0x55d316[_0xed32('0x1c')](0x1f4)[_0xed32('0x2f')](_0x2ac4f2);}};exports[_0xed32('0x27')]=function(_0x3f89f8,_0x392b2e,_0x484874){return db['Sound'][_0xed32('0x48')]({'where':{'id':_0x3f89f8[_0xed32('0x70')]['id']}})[_0xed32('0x2c')](handleEntityNotFound(_0x392b2e,null))['then'](saveUpdates(_['pick'](_0x3f89f8['body'],[_0xed32('0x2e'),_0xed32('0x71')]),null))[_0xed32('0x2c')](respondWithResult(_0x392b2e,null))[_0xed32('0x47')](handleError(_0x392b2e,null));};exports[_0xed32('0x72')]=function(_0x4d10a3,_0x1e1c14,_0x5dd942){return db[_0xed32('0x32')]['find']({'where':{'id':_0x4d10a3[_0xed32('0x70')]['id']}})[_0xed32('0x2c')](function(_0x17ee95){if(_0x17ee95){return _0x17ee95[_0xed32('0x28')]();}})[_0xed32('0x2c')](function(_0x1f691a){var _0x3333a0=path[_0xed32('0x4c')](config[_0xed32('0x59')],_0xed32('0x58'),util[_0xed32('0x50')]('%s.%s',_0x1f691a[_0xed32('0x49')],_0x1f691a[_0xed32('0x73')]));var _0x1e1c0c=path[_0xed32('0x4c')](config[_0xed32('0x59')],'server/files/sounds/converted',util[_0xed32('0x50')](_0xed32('0x5a'),_0x1f691a[_0xed32('0x49')],_0x1f691a['converted_format']));fs['unlinkSync'](_0x3333a0);fs[_0xed32('0x74')](_0x1e1c0c);return _0x1f691a;})[_0xed32('0x2c')](function(_0x1c1e9c){if(_0x1c1e9c){return _0x1e1c14['status'](0xcc)[_0xed32('0x1d')]();}})[_0xed32('0x2c')](handleEntityNotFound(_0x1e1c14,null))[_0xed32('0x47')](handleError(_0x1e1c14,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 4cf4921..e084d80 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 _0xb702=['util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./sound.attributes','exports','define','Sound','tools_sounds','lodash'];(function(_0x2f82f0,_0x449b18){var _0xeb0cf3=function(_0x451a3e){while(--_0x451a3e){_0x2f82f0['push'](_0x2f82f0['shift']());}};_0xeb0cf3(++_0x449b18);}(_0xb702,0x12a));var _0x2b70=function(_0x56fe98,_0x43dc16){_0x56fe98=_0x56fe98-0x0;var _0x212f4f=_0xb702[_0x56fe98];return _0x212f4f;};'use strict';var _=require(_0x2b70('0x0'));var util=require(_0x2b70('0x1'));var logger=require(_0x2b70('0x2'))(_0x2b70('0x3'));var moment=require('moment');var BPromise=require(_0x2b70('0x4'));var rp=require(_0x2b70('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2b70('0x6'));var config=require(_0x2b70('0x7'));var attributes=require(_0x2b70('0x8'));module[_0x2b70('0x9')]=function(_0x5c7321,_0x5c46a6){return _0x5c7321[_0x2b70('0xa')](_0x2b70('0xb'),attributes,{'tableName':_0x2b70('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7689=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes','exports','Sound','lodash','util','../../config/logger','api'];(function(_0xe480c6,_0x224bb4){var _0x48290b=function(_0x2bfe9d){while(--_0x2bfe9d){_0xe480c6['push'](_0xe480c6['shift']());}};_0x48290b(++_0x224bb4);}(_0x7689,0xe6));var _0x9768=function(_0x3547d7,_0x31561a){_0x3547d7=_0x3547d7-0x0;var _0x32fb3c=_0x7689[_0x3547d7];return _0x32fb3c;};'use strict';var _=require(_0x9768('0x0'));var util=require(_0x9768('0x1'));var logger=require(_0x9768('0x2'))(_0x9768('0x3'));var moment=require(_0x9768('0x4'));var BPromise=require(_0x9768('0x5'));var rp=require(_0x9768('0x6'));var fs=require('fs');var path=require(_0x9768('0x7'));var rimraf=require(_0x9768('0x8'));var config=require(_0x9768('0x9'));var attributes=require(_0x9768('0xa'));module[_0x9768('0xb')]=function(_0x2d46cc,_0xf48898){return _0x2d46cc['define'](_0x9768('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 7c3e8cf..ceff77b 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 _0xfe66=['find','options','raw','where','attributes','map','include','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Sound,\x20%s,\x20%s','debug','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowSound','Sound'];(function(_0xf13ca6,_0x5735ea){var _0x4a4387=function(_0x103f67){while(--_0x103f67){_0xf13ca6['push'](_0xf13ca6['shift']());}};_0x4a4387(++_0x5735ea);}(_0xfe66,0xda));var _0x6fe6=function(_0x1db831,_0x42b7b5){_0x1db831=_0x1db831-0x0;var _0x39ba56=_0xfe66[_0x1db831];return _0x39ba56;};'use strict';var _=require(_0x6fe6('0x0'));var util=require(_0x6fe6('0x1'));var moment=require(_0x6fe6('0x2'));var BPromise=require(_0x6fe6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6fe6('0x4'));var db=require(_0x6fe6('0x5'))['db'];var utils=require(_0x6fe6('0x6'));var logger=require('../../config/logger')(_0x6fe6('0x7'));var config=require(_0x6fe6('0x8'));var jayson=require(_0x6fe6('0x9'));var client=jayson[_0x6fe6('0xa')][_0x6fe6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b9f4b,_0x1c0a3e,_0x55637f){return new BPromise(function(_0x18d72d,_0x55f065){return client[_0x6fe6('0xc')](_0x3b9f4b,_0x55637f)[_0x6fe6('0xd')](function(_0x1aa85f){logger[_0x6fe6('0xe')](_0x6fe6('0xf'),_0x1c0a3e,'request\x20sent');logger[_0x6fe6('0x10')](_0x6fe6('0x11'),_0x1c0a3e,_0x6fe6('0x12'),JSON[_0x6fe6('0x13')](_0x1aa85f));if(_0x1aa85f[_0x6fe6('0x14')]){if(_0x1aa85f[_0x6fe6('0x14')][_0x6fe6('0x15')]===0x1f4){logger[_0x6fe6('0x14')](_0x6fe6('0xf'),_0x1c0a3e,_0x1aa85f[_0x6fe6('0x14')][_0x6fe6('0x16')]);return _0x55f065(_0x1aa85f['error'][_0x6fe6('0x16')]);}logger[_0x6fe6('0x14')](_0x6fe6('0xf'),_0x1c0a3e,_0x1aa85f[_0x6fe6('0x14')][_0x6fe6('0x16')]);return _0x18d72d(_0x1aa85f[_0x6fe6('0x14')]['message']);}else{logger[_0x6fe6('0xe')](_0x6fe6('0xf'),_0x1c0a3e,_0x6fe6('0x12'));_0x18d72d(_0x1aa85f[_0x6fe6('0x17')]['message']);}})[_0x6fe6('0x18')](function(_0x366632){logger['error']('Sound,\x20%s,\x20%s',_0x1c0a3e,_0x366632);_0x55f065(_0x366632);});});}exports[_0x6fe6('0x19')]=function(_0x377664){var _0x411d6e=this;return new Promise(function(_0x54f52a,_0x2db82b){return db[_0x6fe6('0x1a')][_0x6fe6('0x1b')]({'raw':_0x377664[_0x6fe6('0x1c')]?_0x377664['options'][_0x6fe6('0x1d')]===undefined?!![]:![]:!![],'where':_0x377664['options']?_0x377664['options'][_0x6fe6('0x1e')]||null:null,'attributes':_0x377664[_0x6fe6('0x1c')]?_0x377664[_0x6fe6('0x1c')][_0x6fe6('0x1f')]||null:null,'include':_0x377664[_0x6fe6('0x1c')]?_0x377664[_0x6fe6('0x1c')]['include']?_[_0x6fe6('0x20')](_0x377664['options'][_0x6fe6('0x21')],function(_0x20782e){return{'model':db[_0x20782e[_0x6fe6('0x22')]],'as':_0x20782e['as'],'attributes':_0x20782e['attributes'],'include':_0x20782e['include']?_['map'](_0x20782e[_0x6fe6('0x21')],function(_0x93bf57){return{'model':db[_0x93bf57[_0x6fe6('0x22')]],'as':_0x93bf57['as'],'attributes':_0x93bf57['attributes'],'include':_0x93bf57[_0x6fe6('0x21')]?_[_0x6fe6('0x20')](_0x93bf57[_0x6fe6('0x21')],function(_0x5abeba){return{'model':db[_0x5abeba[_0x6fe6('0x22')]],'as':_0x5abeba['as'],'attributes':_0x5abeba[_0x6fe6('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x6fe6('0xd')](function(_0xe79ffd){logger[_0x6fe6('0xe')]('ShowSound',_0x377664);logger['debug'](_0x6fe6('0x19'),_0x377664,JSON['stringify'](_0xe79ffd));_0x54f52a(_0xe79ffd);})['catch'](function(_0x607e21){logger[_0x6fe6('0x14')]('ShowSound',_0x607e21['message'],_0x377664);_0x2db82b(_0x411d6e['error'](0x1f4,_0x607e21[_0x6fe6('0x16')]));});});}; \ No newline at end of file +var _0x80f2=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Sound,\x20%s,\x20%s','debug','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','ShowSound','Sound','find','options','raw','where','include','map','model','attributes','stringify','lodash','util'];(function(_0x1df79c,_0x5ad8fd){var _0x2f23e4=function(_0x47836f){while(--_0x47836f){_0x1df79c['push'](_0x1df79c['shift']());}};_0x2f23e4(++_0x5ad8fd);}(_0x80f2,0x130));var _0x280f=function(_0x104be8,_0x51a270){_0x104be8=_0x104be8-0x0;var _0x49b8cf=_0x80f2[_0x104be8];return _0x49b8cf;};'use strict';var _=require(_0x280f('0x0'));var util=require(_0x280f('0x1'));var moment=require('moment');var BPromise=require(_0x280f('0x2'));var rs=require(_0x280f('0x3'));var fs=require('fs');var Redis=require(_0x280f('0x4'));var db=require(_0x280f('0x5'))['db'];var utils=require(_0x280f('0x6'));var logger=require(_0x280f('0x7'))(_0x280f('0x8'));var config=require(_0x280f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x280f('0xa')][_0x280f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4dcf13,_0x948146,_0x2f7009){return new BPromise(function(_0x5b7e36,_0x3db190){return client[_0x280f('0xc')](_0x4dcf13,_0x2f7009)[_0x280f('0xd')](function(_0x598ea4){logger[_0x280f('0xe')](_0x280f('0xf'),_0x948146,'request\x20sent');logger[_0x280f('0x10')](_0x280f('0x11'),_0x948146,_0x280f('0x12'),JSON['stringify'](_0x598ea4));if(_0x598ea4[_0x280f('0x13')]){if(_0x598ea4[_0x280f('0x13')][_0x280f('0x14')]===0x1f4){logger[_0x280f('0x13')]('Sound,\x20%s,\x20%s',_0x948146,_0x598ea4[_0x280f('0x13')]['message']);return _0x3db190(_0x598ea4[_0x280f('0x13')][_0x280f('0x15')]);}logger[_0x280f('0x13')](_0x280f('0xf'),_0x948146,_0x598ea4[_0x280f('0x13')]['message']);return _0x5b7e36(_0x598ea4['error'][_0x280f('0x15')]);}else{logger[_0x280f('0xe')]('Sound,\x20%s,\x20%s',_0x948146,'request\x20sent');_0x5b7e36(_0x598ea4['result'][_0x280f('0x15')]);}})[_0x280f('0x16')](function(_0x1fff9d){logger[_0x280f('0x13')]('Sound,\x20%s,\x20%s',_0x948146,_0x1fff9d);_0x3db190(_0x1fff9d);});});}exports[_0x280f('0x17')]=function(_0x528c81){var _0x7ddb0a=this;return new Promise(function(_0x40badf,_0x5af642){return db[_0x280f('0x18')][_0x280f('0x19')]({'raw':_0x528c81[_0x280f('0x1a')]?_0x528c81['options'][_0x280f('0x1b')]===undefined?!![]:![]:!![],'where':_0x528c81[_0x280f('0x1a')]?_0x528c81[_0x280f('0x1a')][_0x280f('0x1c')]||null:null,'attributes':_0x528c81[_0x280f('0x1a')]?_0x528c81[_0x280f('0x1a')]['attributes']||null:null,'include':_0x528c81[_0x280f('0x1a')]?_0x528c81[_0x280f('0x1a')][_0x280f('0x1d')]?_[_0x280f('0x1e')](_0x528c81[_0x280f('0x1a')]['include'],function(_0x1f8dd3){return{'model':db[_0x1f8dd3['model']],'as':_0x1f8dd3['as'],'attributes':_0x1f8dd3['attributes'],'include':_0x1f8dd3[_0x280f('0x1d')]?_[_0x280f('0x1e')](_0x1f8dd3['include'],function(_0xf4d769){return{'model':db[_0xf4d769['model']],'as':_0xf4d769['as'],'attributes':_0xf4d769['attributes'],'include':_0xf4d769[_0x280f('0x1d')]?_[_0x280f('0x1e')](_0xf4d769[_0x280f('0x1d')],function(_0x3a0cf2){return{'model':db[_0x3a0cf2[_0x280f('0x1f')]],'as':_0x3a0cf2['as'],'attributes':_0x3a0cf2[_0x280f('0x20')]};}):[]};}):[]};}):[]:[]})[_0x280f('0xd')](function(_0x3860ba){logger[_0x280f('0xe')]('ShowSound',_0x528c81);logger['debug'](_0x280f('0x17'),_0x528c81,JSON[_0x280f('0x21')](_0x3860ba));_0x40badf(_0x3860ba);})['catch'](function(_0x5a716a){logger[_0x280f('0x13')](_0x280f('0x17'),_0x5a716a[_0x280f('0x15')],_0x528c81);_0x5af642(_0x7ddb0a[_0x280f('0x13')](0x1f4,_0x5a716a['message']));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 8822dce..00995a1 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 _0x2032=['exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete'];(function(_0x469f97,_0x1d2bd0){var _0x557d30=function(_0xe4d2a5){while(--_0xe4d2a5){_0x469f97['push'](_0x469f97['shift']());}};_0x557d30(++_0x1d2bd0);}(_0x2032,0xd9));var _0x2203=function(_0x3a35b4,_0x14486c){_0x3a35b4=_0x3a35b4-0x0;var _0x5109bc=_0x2032[_0x3a35b4];return _0x5109bc;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2203('0xe')]('/:id',auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);router[_0x2203('0x10')]('/:id',auth[_0x2203('0x9')](),controller['destroy']);module[_0x2203('0x11')]=router; \ No newline at end of file +var _0xda3f=['../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','util','path','fs-extra','../../components/interaction/service'];(function(_0x2fba2b,_0x4977bf){var _0x438896=function(_0x3c73ca){while(--_0x3c73ca){_0x2fba2b['push'](_0x2fba2b['shift']());}};_0x438896(++_0x4977bf);}(_0xda3f,0xec));var _0xfda3=function(_0x2e1bf0,_0xbdd79f){_0x2e1bf0=_0x2e1bf0-0x0;var _0x2db958=_0xda3f[_0x2e1bf0];return _0x2db958;};'use strict';var multer=require('multer');var util=require(_0xfda3('0x0'));var path=require(_0xfda3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xfda3('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var controller=require('./squareMessage.controller');router[_0xfda3('0x5')]('/',auth[_0xfda3('0x6')](),controller['index']);router['get'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x8')]);router[_0xfda3('0x9')]('/',auth[_0xfda3('0x6')](),controller[_0xfda3('0xa')]);router[_0xfda3('0xb')](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xc')]);router[_0xfda3('0xd')](_0xfda3('0x7'),auth['isAuthenticated'](),controller[_0xfda3('0xe')]);module[_0xfda3('0xf')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index cb7f913..34ec967 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 _0x819b=['TEXT','medium','ENUM','out','sequelize','exports','STRING'];(function(_0x5b1c50,_0x56e694){var _0x2d379b=function(_0x981b9c){while(--_0x981b9c){_0x5b1c50['push'](_0x5b1c50['shift']());}};_0x2d379b(++_0x56e694);}(_0x819b,0xb3));var _0xb819=function(_0x487e2d,_0x1fe8ba){_0x487e2d=_0x487e2d-0x0;var _0xe4457c=_0x819b[_0x487e2d];return _0xe4457c;};'use strict';var Sequelize=require(_0xb819('0x0'));module[_0xb819('0x1')]={'uniqueid':{'type':Sequelize[_0xb819('0x2')]},'body':{'type':Sequelize[_0xb819('0x3')](_0xb819('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0xb819('0x5')]('in',_0xb819('0x6')),'defaultValue':_0xb819('0x6'),'allowNull':![]},'providerName':{'type':Sequelize[_0xb819('0x2')]},'providerResponse':{'type':Sequelize[_0xb819('0x3')]}}; \ No newline at end of file +var _0x4746=['TEXT','ENUM','out','sequelize','exports','STRING'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x4746,0x93));var _0x6474=function(_0x4c20f8,_0x1255e1){_0x4c20f8=_0x4c20f8-0x0;var _0x1e8a8a=_0x4746[_0x4c20f8];return _0x1e8a8a;};'use strict';var Sequelize=require(_0x6474('0x0'));module[_0x6474('0x1')]={'uniqueid':{'type':Sequelize[_0x6474('0x2')]},'body':{'type':Sequelize[_0x6474('0x3')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x6474('0x4')]('in',_0x6474('0x5')),'defaultValue':_0x6474('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x6474('0x2')]},'providerResponse':{'type':Sequelize[_0x6474('0x3')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 15eafd7..ca2e52a 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 _0xa816=['rawAttributes','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','SquareMessage','fieldName','type','model','query','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params'];(function(_0x184a04,_0x5115a9){var _0x42b3b2=function(_0x1ca07c){while(--_0x1ca07c){_0x184a04['push'](_0x184a04['shift']());}};_0x42b3b2(++_0x5115a9);}(_0xa816,0xd7));var _0x6a81=function(_0xdefbc3,_0x1ea49a){_0xdefbc3=_0xdefbc3-0x0;var _0x367798=_0xa816[_0xdefbc3];return _0x367798;};'use strict';var emlformat=require(_0x6a81('0x0'));var rimraf=require(_0x6a81('0x1'));var zipdir=require(_0x6a81('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6a81('0x3'));var moment=require(_0x6a81('0x4'));var BPromise=require(_0x6a81('0x5'));var Mustache=require(_0x6a81('0x6'));var util=require('util');var path=require(_0x6a81('0x7'));var sox=require(_0x6a81('0x8'));var csv=require('to-csv');var ejs=require(_0x6a81('0x9'));var fs=require('fs');var fs_extra=require(_0x6a81('0xa'));var _=require(_0x6a81('0xb'));var squel=require(_0x6a81('0xc'));var crypto=require(_0x6a81('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6a81('0xe'));var Papa=require(_0x6a81('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6a81('0x10'));var as=require(_0x6a81('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6a81('0x12'));var utils=require(_0x6a81('0x13'));var config=require(_0x6a81('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x6a81('0x15'))['db'];function respondWithStatusCode(_0x1e8a59,_0xe09ec5){_0xe09ec5=_0xe09ec5||0xcc;return function(_0x549eff){if(_0x549eff){return _0x1e8a59['sendStatus'](_0xe09ec5);}return _0x1e8a59[_0x6a81('0x16')](_0xe09ec5)[_0x6a81('0x17')]();};}function respondWithResult(_0x2f7b49,_0x35df34){_0x35df34=_0x35df34||0xc8;return function(_0x256f2c){if(_0x256f2c){return _0x2f7b49[_0x6a81('0x16')](_0x35df34)[_0x6a81('0x18')](_0x256f2c);}};}function respondWithFilteredResult(_0x14b13b,_0x5d8929){return function(_0x161598){if(_0x161598){var _0x2e9b20=typeof _0x5d8929[_0x6a81('0x19')]==='undefined'&&typeof _0x5d8929[_0x6a81('0x1a')]===_0x6a81('0x1b');var _0x7790f6=_0x161598[_0x6a81('0x1c')];var _0x337a5c=_0x2e9b20?0x0:_0x5d8929[_0x6a81('0x19')];var _0xc14652=_0x2e9b20?_0x161598[_0x6a81('0x1c')]:_0x5d8929['offset']+_0x5d8929[_0x6a81('0x1a')];var _0x32bf22;if(_0xc14652>=_0x7790f6){_0xc14652=_0x7790f6;_0x32bf22=0xc8;}else{_0x32bf22=0xce;}_0x14b13b[_0x6a81('0x16')](_0x32bf22);return _0x14b13b[_0x6a81('0x1d')]('Content-Range',_0x337a5c+'-'+_0xc14652+'/'+_0x7790f6)['json'](_0x161598);}return null;};}function patchUpdates(_0x2031d9){return function(_0x4b7f71){try{jsonpatch[_0x6a81('0x1e')](_0x4b7f71,_0x2031d9,!![]);}catch(_0x57fd9a){return BPromise[_0x6a81('0x1f')](_0x57fd9a);}return _0x4b7f71[_0x6a81('0x20')]();};}function saveUpdates(_0x240197,_0x2dae79){return function(_0x558be6){if(_0x558be6){return _0x558be6[_0x6a81('0x21')](_0x240197)[_0x6a81('0x22')](function(_0x49c7d3){return _0x49c7d3;});}return null;};}function removeEntity(_0x3723f6,_0x14c0c2){return function(_0x10c9cc){if(_0x10c9cc){return _0x10c9cc[_0x6a81('0x23')]()[_0x6a81('0x22')](function(){_0x3723f6[_0x6a81('0x16')](0xcc)[_0x6a81('0x17')]();});}};}function handleEntityNotFound(_0xc0f2d,_0x7ca738){return function(_0x29c63f){if(!_0x29c63f){_0xc0f2d[_0x6a81('0x24')](0x194);}return _0x29c63f;};}function handleError(_0x146ca6,_0x4cb012){_0x4cb012=_0x4cb012||0x1f4;return function(_0xffd727){logger[_0x6a81('0x25')](_0xffd727[_0x6a81('0x26')]);if(_0xffd727[_0x6a81('0x27')]){delete _0xffd727['name'];}_0x146ca6[_0x6a81('0x16')](_0x4cb012)[_0x6a81('0x28')](_0xffd727);};}exports['index']=function(_0x141d42,_0x20fb95){var _0x2fa669={},_0x26aa88={},_0x1960eb={'count':0x0,'rows':[]};var _0x236bca=_[_0x6a81('0x29')](db[_0x6a81('0x2a')]['rawAttributes'],function(_0x5dfb72){return{'name':_0x5dfb72[_0x6a81('0x2b')],'type':_0x5dfb72[_0x6a81('0x2c')]['key']};});_0x26aa88[_0x6a81('0x2d')]=_[_0x6a81('0x29')](_0x236bca,_0x6a81('0x27'));_0x26aa88[_0x6a81('0x2e')]=_['keys'](_0x141d42[_0x6a81('0x2e')]);_0x26aa88['filters']=_[_0x6a81('0x2f')](_0x26aa88[_0x6a81('0x2d')],_0x26aa88[_0x6a81('0x2e')]);_0x2fa669[_0x6a81('0x30')]=_[_0x6a81('0x2f')](_0x26aa88[_0x6a81('0x2d')],qs[_0x6a81('0x31')](_0x141d42[_0x6a81('0x2e')][_0x6a81('0x31')]));_0x2fa669[_0x6a81('0x30')]=_0x2fa669[_0x6a81('0x30')][_0x6a81('0x32')]?_0x2fa669[_0x6a81('0x30')]:_0x26aa88[_0x6a81('0x2d')];if(!_0x141d42['query']['hasOwnProperty'](_0x6a81('0x33'))){_0x2fa669[_0x6a81('0x1a')]=qs[_0x6a81('0x1a')](_0x141d42[_0x6a81('0x2e')][_0x6a81('0x1a')]);_0x2fa669[_0x6a81('0x19')]=qs['offset'](_0x141d42[_0x6a81('0x2e')][_0x6a81('0x19')]);}_0x2fa669['order']=qs[_0x6a81('0x34')](_0x141d42['query'][_0x6a81('0x34')]);_0x2fa669[_0x6a81('0x35')]=qs[_0x6a81('0x36')](_[_0x6a81('0x37')](_0x141d42[_0x6a81('0x2e')],_0x26aa88[_0x6a81('0x36')]),_0x236bca);if(_0x141d42[_0x6a81('0x2e')][_0x6a81('0x38')]){_0x2fa669['where']=_[_0x6a81('0x39')](_0x2fa669[_0x6a81('0x35')],{'$or':_[_0x6a81('0x29')](_0x236bca,function(_0x34c38c){if(_0x34c38c[_0x6a81('0x2c')]!==_0x6a81('0x3a')){var _0x35896e={};_0x35896e[_0x34c38c[_0x6a81('0x27')]]={'$like':'%'+_0x141d42[_0x6a81('0x2e')]['filter']+'%'};return _0x35896e;}})});}_0x2fa669=_[_0x6a81('0x39')]({},_0x2fa669,_0x141d42[_0x6a81('0x3b')]);var _0x4bb70e={'where':_0x2fa669['where']};return db[_0x6a81('0x2a')][_0x6a81('0x1c')](_0x4bb70e)[_0x6a81('0x22')](function(_0x1b315a){_0x1960eb['count']=_0x1b315a;if(_0x141d42[_0x6a81('0x2e')][_0x6a81('0x3c')]){_0x2fa669['include']=[{'all':!![]}];}return db[_0x6a81('0x2a')][_0x6a81('0x3d')](_0x2fa669);})[_0x6a81('0x22')](function(_0x328004){_0x1960eb[_0x6a81('0x3e')]=_0x328004;return _0x1960eb;})[_0x6a81('0x22')](respondWithFilteredResult(_0x20fb95,_0x2fa669))['catch'](handleError(_0x20fb95,null));};exports[_0x6a81('0x3f')]=function(_0x30c313,_0x3fdb5f){var _0xf4dad5={'raw':!![],'where':{'id':_0x30c313[_0x6a81('0x40')]['id']}},_0x41bcc1={};_0x41bcc1[_0x6a81('0x2d')]=_['keys'](db[_0x6a81('0x2a')][_0x6a81('0x41')]);_0x41bcc1[_0x6a81('0x2e')]=_['keys'](_0x30c313[_0x6a81('0x2e')]);_0x41bcc1[_0x6a81('0x36')]=_[_0x6a81('0x2f')](_0x41bcc1['model'],_0x41bcc1[_0x6a81('0x2e')]);_0xf4dad5[_0x6a81('0x30')]=_[_0x6a81('0x2f')](_0x41bcc1[_0x6a81('0x2d')],qs[_0x6a81('0x31')](_0x30c313[_0x6a81('0x2e')][_0x6a81('0x31')]));_0xf4dad5['attributes']=_0xf4dad5[_0x6a81('0x30')]['length']?_0xf4dad5['attributes']:_0x41bcc1[_0x6a81('0x2d')];if(_0x30c313[_0x6a81('0x2e')][_0x6a81('0x3c')]){_0xf4dad5['include']=[{'all':!![]}];}_0xf4dad5=_[_0x6a81('0x39')]({},_0xf4dad5,_0x30c313['options']);return db[_0x6a81('0x2a')][_0x6a81('0x42')](_0xf4dad5)['then'](handleEntityNotFound(_0x3fdb5f,null))[_0x6a81('0x22')](respondWithResult(_0x3fdb5f,null))[_0x6a81('0x43')](handleError(_0x3fdb5f,null));};exports[_0x6a81('0x44')]=function(_0x555548,_0x53459c){return db[_0x6a81('0x2a')][_0x6a81('0x44')](_0x555548[_0x6a81('0x45')],{})[_0x6a81('0x22')](respondWithResult(_0x53459c,0xc9))[_0x6a81('0x43')](handleError(_0x53459c,null));};exports[_0x6a81('0x21')]=function(_0x6f655c,_0x1089db){if(_0x6f655c[_0x6a81('0x45')]['id']){delete _0x6f655c['body']['id'];}return db[_0x6a81('0x2a')][_0x6a81('0x42')]({'where':{'id':_0x6f655c[_0x6a81('0x40')]['id']}})[_0x6a81('0x22')](handleEntityNotFound(_0x1089db,null))[_0x6a81('0x22')](saveUpdates(_0x6f655c[_0x6a81('0x45')],null))[_0x6a81('0x22')](respondWithResult(_0x1089db,null))[_0x6a81('0x43')](handleError(_0x1089db,null));};exports[_0x6a81('0x23')]=function(_0x1b09ec,_0x2c265d){return db[_0x6a81('0x2a')][_0x6a81('0x42')]({'where':{'id':_0x1b09ec[_0x6a81('0x40')]['id']}})['then'](handleEntityNotFound(_0x2c265d,null))[_0x6a81('0x22')](removeEntity(_0x2c265d,null))[_0x6a81('0x43')](handleError(_0x2c265d,null));}; \ No newline at end of file +var _0xae0d=['status','json','offset','undefined','limit','count','set','update','then','destroy','error','stack','name','index','map','SquareMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','show','length','includeAll','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','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','../../mysqldb','sendStatus'];(function(_0x508435,_0x376102){var _0x182b58=function(_0x3eb9fb){while(--_0x3eb9fb){_0x508435['push'](_0x508435['shift']());}};_0x182b58(++_0x376102);}(_0xae0d,0x14e));var _0xdae0=function(_0x32c8c2,_0x4b9d13){_0x32c8c2=_0x32c8c2-0x0;var _0x477dd8=_0xae0d[_0x32c8c2];return _0x477dd8;};'use strict';var emlformat=require(_0xdae0('0x0'));var rimraf=require(_0xdae0('0x1'));var zipdir=require(_0xdae0('0x2'));var jsonpatch=require(_0xdae0('0x3'));var rp=require('request-promise');var moment=require(_0xdae0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdae0('0x5'));var util=require(_0xdae0('0x6'));var path=require(_0xdae0('0x7'));var sox=require('sox');var csv=require(_0xdae0('0x8'));var ejs=require(_0xdae0('0x9'));var fs=require('fs');var fs_extra=require(_0xdae0('0xa'));var _=require(_0xdae0('0xb'));var squel=require('squel');var crypto=require(_0xdae0('0xc'));var jsforce=require(_0xdae0('0xd'));var deskjs=require(_0xdae0('0xe'));var toCsv=require(_0xdae0('0x8'));var querystring=require('querystring');var Papa=require(_0xdae0('0xf'));var Redis=require(_0xdae0('0x10'));var authService=require(_0xdae0('0x11'));var qs=require(_0xdae0('0x12'));var as=require(_0xdae0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdae0('0x14'))(_0xdae0('0x15'));var utils=require('../../config/utils');var config=require(_0xdae0('0x16'));var licenseUtil=require(_0xdae0('0x17'));var db=require(_0xdae0('0x18'))['db'];function respondWithStatusCode(_0x2709a4,_0x55a111){_0x55a111=_0x55a111||0xcc;return function(_0x24dacd){if(_0x24dacd){return _0x2709a4[_0xdae0('0x19')](_0x55a111);}return _0x2709a4[_0xdae0('0x1a')](_0x55a111)['end']();};}function respondWithResult(_0x5d862e,_0x31d186){_0x31d186=_0x31d186||0xc8;return function(_0x342812){if(_0x342812){return _0x5d862e[_0xdae0('0x1a')](_0x31d186)[_0xdae0('0x1b')](_0x342812);}};}function respondWithFilteredResult(_0x1643ba,_0x356fd5){return function(_0x4d7bce){if(_0x4d7bce){var _0x42c54c=typeof _0x356fd5[_0xdae0('0x1c')]===_0xdae0('0x1d')&&typeof _0x356fd5[_0xdae0('0x1e')]===_0xdae0('0x1d');var _0x22bccf=_0x4d7bce['count'];var _0x248666=_0x42c54c?0x0:_0x356fd5['offset'];var _0x23dcd4=_0x42c54c?_0x4d7bce[_0xdae0('0x1f')]:_0x356fd5[_0xdae0('0x1c')]+_0x356fd5['limit'];var _0x4729d9;if(_0x23dcd4>=_0x22bccf){_0x23dcd4=_0x22bccf;_0x4729d9=0xc8;}else{_0x4729d9=0xce;}_0x1643ba['status'](_0x4729d9);return _0x1643ba[_0xdae0('0x20')]('Content-Range',_0x248666+'-'+_0x23dcd4+'/'+_0x22bccf)['json'](_0x4d7bce);}return null;};}function patchUpdates(_0x5e669e){return function(_0x4fbdbd){try{jsonpatch['apply'](_0x4fbdbd,_0x5e669e,!![]);}catch(_0x231dc4){return BPromise['reject'](_0x231dc4);}return _0x4fbdbd['save']();};}function saveUpdates(_0x46a063,_0x3191c1){return function(_0x4f8d67){if(_0x4f8d67){return _0x4f8d67[_0xdae0('0x21')](_0x46a063)[_0xdae0('0x22')](function(_0x1d7a55){return _0x1d7a55;});}return null;};}function removeEntity(_0x46863d,_0x4aaf1e){return function(_0x3b990e){if(_0x3b990e){return _0x3b990e[_0xdae0('0x23')]()[_0xdae0('0x22')](function(){_0x46863d[_0xdae0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x163605,_0x154000){return function(_0x5845d8){if(!_0x5845d8){_0x163605['sendStatus'](0x194);}return _0x5845d8;};}function handleError(_0x2a81fd,_0x3f718e){_0x3f718e=_0x3f718e||0x1f4;return function(_0x1ed515){logger[_0xdae0('0x24')](_0x1ed515[_0xdae0('0x25')]);if(_0x1ed515[_0xdae0('0x26')]){delete _0x1ed515[_0xdae0('0x26')];}_0x2a81fd[_0xdae0('0x1a')](_0x3f718e)['send'](_0x1ed515);};}exports[_0xdae0('0x27')]=function(_0xd55123,_0x233b04){var _0xebd483={},_0x49f72b={},_0x34af05={'count':0x0,'rows':[]};var _0x4ade5a=_[_0xdae0('0x28')](db[_0xdae0('0x29')][_0xdae0('0x2a')],function(_0x4fe8ac){return{'name':_0x4fe8ac[_0xdae0('0x2b')],'type':_0x4fe8ac['type'][_0xdae0('0x2c')]};});_0x49f72b[_0xdae0('0x2d')]=_[_0xdae0('0x28')](_0x4ade5a,'name');_0x49f72b[_0xdae0('0x2e')]=_[_0xdae0('0x2f')](_0xd55123['query']);_0x49f72b[_0xdae0('0x30')]=_[_0xdae0('0x31')](_0x49f72b[_0xdae0('0x2d')],_0x49f72b['query']);_0xebd483[_0xdae0('0x32')]=_[_0xdae0('0x31')](_0x49f72b[_0xdae0('0x2d')],qs[_0xdae0('0x33')](_0xd55123[_0xdae0('0x2e')][_0xdae0('0x33')]));_0xebd483[_0xdae0('0x32')]=_0xebd483[_0xdae0('0x32')]['length']?_0xebd483[_0xdae0('0x32')]:_0x49f72b['model'];if(!_0xd55123[_0xdae0('0x2e')][_0xdae0('0x34')](_0xdae0('0x35'))){_0xebd483['limit']=qs['limit'](_0xd55123['query'][_0xdae0('0x1e')]);_0xebd483[_0xdae0('0x1c')]=qs['offset'](_0xd55123[_0xdae0('0x2e')][_0xdae0('0x1c')]);}_0xebd483[_0xdae0('0x36')]=qs['sort'](_0xd55123['query'][_0xdae0('0x37')]);_0xebd483[_0xdae0('0x38')]=qs[_0xdae0('0x30')](_[_0xdae0('0x39')](_0xd55123[_0xdae0('0x2e')],_0x49f72b[_0xdae0('0x30')]),_0x4ade5a);if(_0xd55123['query'][_0xdae0('0x3a')]){_0xebd483[_0xdae0('0x38')]=_[_0xdae0('0x3b')](_0xebd483[_0xdae0('0x38')],{'$or':_[_0xdae0('0x28')](_0x4ade5a,function(_0x4499f8){if(_0x4499f8['type']!=='VIRTUAL'){var _0x2ecf0e={};_0x2ecf0e[_0x4499f8[_0xdae0('0x26')]]={'$like':'%'+_0xd55123[_0xdae0('0x2e')][_0xdae0('0x3a')]+'%'};return _0x2ecf0e;}})});}_0xebd483=_[_0xdae0('0x3b')]({},_0xebd483,_0xd55123[_0xdae0('0x3c')]);var _0x107bfd={'where':_0xebd483[_0xdae0('0x38')]};return db['SquareMessage']['count'](_0x107bfd)[_0xdae0('0x22')](function(_0xdc83f5){_0x34af05[_0xdae0('0x1f')]=_0xdc83f5;if(_0xd55123[_0xdae0('0x2e')]['includeAll']){_0xebd483[_0xdae0('0x3d')]=[{'all':!![]}];}return db[_0xdae0('0x29')][_0xdae0('0x3e')](_0xebd483);})['then'](function(_0x28fcce){_0x34af05[_0xdae0('0x3f')]=_0x28fcce;return _0x34af05;})[_0xdae0('0x22')](respondWithFilteredResult(_0x233b04,_0xebd483))['catch'](handleError(_0x233b04,null));};exports[_0xdae0('0x40')]=function(_0x1bbfba,_0x381de4){var _0x1f56e4={'raw':!![],'where':{'id':_0x1bbfba['params']['id']}},_0xb5542={};_0xb5542[_0xdae0('0x2d')]=_[_0xdae0('0x2f')](db['SquareMessage'][_0xdae0('0x2a')]);_0xb5542[_0xdae0('0x2e')]=_['keys'](_0x1bbfba[_0xdae0('0x2e')]);_0xb5542[_0xdae0('0x30')]=_['intersection'](_0xb5542[_0xdae0('0x2d')],_0xb5542[_0xdae0('0x2e')]);_0x1f56e4['attributes']=_[_0xdae0('0x31')](_0xb5542['model'],qs[_0xdae0('0x33')](_0x1bbfba[_0xdae0('0x2e')][_0xdae0('0x33')]));_0x1f56e4['attributes']=_0x1f56e4['attributes'][_0xdae0('0x41')]?_0x1f56e4[_0xdae0('0x32')]:_0xb5542['model'];if(_0x1bbfba[_0xdae0('0x2e')][_0xdae0('0x42')]){_0x1f56e4[_0xdae0('0x3d')]=[{'all':!![]}];}_0x1f56e4=_[_0xdae0('0x3b')]({},_0x1f56e4,_0x1bbfba[_0xdae0('0x3c')]);return db[_0xdae0('0x29')][_0xdae0('0x43')](_0x1f56e4)[_0xdae0('0x22')](handleEntityNotFound(_0x381de4,null))['then'](respondWithResult(_0x381de4,null))[_0xdae0('0x44')](handleError(_0x381de4,null));};exports[_0xdae0('0x45')]=function(_0xbc5c74,_0x1d7db6){return db[_0xdae0('0x29')]['create'](_0xbc5c74[_0xdae0('0x46')],{})['then'](respondWithResult(_0x1d7db6,0xc9))['catch'](handleError(_0x1d7db6,null));};exports['update']=function(_0x2bc518,_0x4451fd){if(_0x2bc518[_0xdae0('0x46')]['id']){delete _0x2bc518[_0xdae0('0x46')]['id'];}return db[_0xdae0('0x29')][_0xdae0('0x43')]({'where':{'id':_0x2bc518[_0xdae0('0x47')]['id']}})[_0xdae0('0x22')](handleEntityNotFound(_0x4451fd,null))[_0xdae0('0x22')](saveUpdates(_0x2bc518[_0xdae0('0x46')],null))[_0xdae0('0x22')](respondWithResult(_0x4451fd,null))[_0xdae0('0x44')](handleError(_0x4451fd,null));};exports['destroy']=function(_0x42a10a,_0x109dbf){return db[_0xdae0('0x29')][_0xdae0('0x43')]({'where':{'id':_0x42a10a[_0xdae0('0x47')]['id']}})[_0xdae0('0x22')](handleEntityNotFound(_0x109dbf,null))[_0xdae0('0x22')](removeEntity(_0x109dbf,null))[_0xdae0('0x44')](handleError(_0x109dbf,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index c2aec37..dffe3f2 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 _0xdab6=['path','rimraf','./squareMessage.attributes','exports','define','square_messages','util','../../config/logger','api','bluebird','request-promise'];(function(_0x36a306,_0x4690a6){var _0x4e75fc=function(_0xf55360){while(--_0xf55360){_0x36a306['push'](_0x36a306['shift']());}};_0x4e75fc(++_0x4690a6);}(_0xdab6,0x10e));var _0x6dab=function(_0x593910,_0x39412f){_0x593910=_0x593910-0x0;var _0x58fe86=_0xdab6[_0x593910];return _0x58fe86;};'use strict';var _=require('lodash');var util=require(_0x6dab('0x0'));var logger=require(_0x6dab('0x1'))(_0x6dab('0x2'));var moment=require('moment');var BPromise=require(_0x6dab('0x3'));var rp=require(_0x6dab('0x4'));var fs=require('fs');var path=require(_0x6dab('0x5'));var rimraf=require(_0x6dab('0x6'));var config=require('../../config/environment');var attributes=require(_0x6dab('0x7'));module[_0x6dab('0x8')]=function(_0x50299d,_0x2b1210){return _0x50299d[_0x6dab('0x9')]('SquareMessage',attributes,{'tableName':_0x6dab('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd150=['square_messages','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./squareMessage.attributes','exports','SquareMessage'];(function(_0x282f68,_0x239640){var _0x1aba38=function(_0x5955c8){while(--_0x5955c8){_0x282f68['push'](_0x282f68['shift']());}};_0x1aba38(++_0x239640);}(_0xd150,0x8d));var _0x0d15=function(_0x1d23be,_0x1c8c3f){_0x1d23be=_0x1d23be-0x0;var _0x1872a0=_0xd150[_0x1d23be];return _0x1872a0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0d15('0x0'))('api');var moment=require(_0x0d15('0x1'));var BPromise=require(_0x0d15('0x2'));var rp=require(_0x0d15('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0d15('0x4'));var config=require(_0x0d15('0x5'));var attributes=require(_0x0d15('0x6'));module[_0x0d15('0x7')]=function(_0x4e8ca3,_0x359671){return _0x4e8ca3['define'](_0x0d15('0x8'),attributes,{'tableName':_0x0d15('0x9'),'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 5cd221c..24e04bf 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 _0x64d6=['info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','create','options','CreateSquareMessage','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x58cc65,_0x3b72ab){var _0x57358a=function(_0x5b2002){while(--_0x5b2002){_0x58cc65['push'](_0x58cc65['shift']());}};_0x57358a(++_0x3b72ab);}(_0x64d6,0x15d));var _0x664d=function(_0x45344b,_0x5aadba){_0x45344b=_0x45344b-0x0;var _0x4a35a5=_0x64d6[_0x45344b];return _0x4a35a5;};'use strict';var _=require(_0x664d('0x0'));var util=require(_0x664d('0x1'));var moment=require(_0x664d('0x2'));var BPromise=require('bluebird');var rs=require(_0x664d('0x3'));var fs=require('fs');var Redis=require(_0x664d('0x4'));var db=require(_0x664d('0x5'))['db'];var utils=require(_0x664d('0x6'));var logger=require(_0x664d('0x7'))(_0x664d('0x8'));var config=require(_0x664d('0x9'));var jayson=require(_0x664d('0xa'));var client=jayson[_0x664d('0xb')][_0x664d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x875c7,_0x9d1c16,_0x7210f2){return new BPromise(function(_0x4f554f,_0x366a1a){return client[_0x664d('0xd')](_0x875c7,_0x7210f2)[_0x664d('0xe')](function(_0x1c34fb){logger[_0x664d('0xf')](_0x664d('0x10'),_0x9d1c16,_0x664d('0x11'));logger[_0x664d('0x12')](_0x664d('0x13'),_0x9d1c16,_0x664d('0x11'),JSON[_0x664d('0x14')](_0x1c34fb));if(_0x1c34fb[_0x664d('0x15')]){if(_0x1c34fb[_0x664d('0x15')][_0x664d('0x16')]===0x1f4){logger[_0x664d('0x15')](_0x664d('0x10'),_0x9d1c16,_0x1c34fb['error'][_0x664d('0x17')]);return _0x366a1a(_0x1c34fb[_0x664d('0x15')]['message']);}logger[_0x664d('0x15')](_0x664d('0x10'),_0x9d1c16,_0x1c34fb[_0x664d('0x15')]['message']);return _0x4f554f(_0x1c34fb['error'][_0x664d('0x17')]);}else{logger['info'](_0x664d('0x10'),_0x9d1c16,_0x664d('0x11'));_0x4f554f(_0x1c34fb['result'][_0x664d('0x17')]);}})[_0x664d('0x18')](function(_0x3be09b){logger['error']('SquareMessage,\x20%s,\x20%s',_0x9d1c16,_0x3be09b);_0x366a1a(_0x3be09b);});});}exports['CreateSquareMessage']=function(_0x3050ea){var _0x17474d=this;return new Promise(function(_0x5e8f89,_0x4fee14){return db['SquareMessage'][_0x664d('0x19')](_0x3050ea['body'],{'raw':_0x3050ea[_0x664d('0x1a')]?_0x3050ea['options']['raw']===undefined?!![]:![]:!![]})[_0x664d('0xe')](function(_0x3ee806){logger[_0x664d('0xf')](_0x664d('0x1b'),_0x3050ea);logger[_0x664d('0x12')](_0x664d('0x1b'),_0x3050ea,JSON['stringify'](_0x3ee806));_0x5e8f89(_0x3ee806);})[_0x664d('0x18')](function(_0x18a2a7){logger[_0x664d('0x15')](_0x664d('0x1b'),_0x18a2a7[_0x664d('0x17')],_0x3050ea);_0x4fee14(_0x17474d[_0x664d('0x15')](0x1f4,_0x18a2a7[_0x664d('0x17')]));});});}; \ No newline at end of file +var _0xd6d3=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateSquareMessage','create','body','options','raw','then','lodash','bluebird','randomstring'];(function(_0x41e507,_0x694b79){var _0x3bbe37=function(_0x2df851){while(--_0x2df851){_0x41e507['push'](_0x41e507['shift']());}};_0x3bbe37(++_0x694b79);}(_0xd6d3,0x93));var _0x3d6d=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xd6d3[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0x3d6d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3d6d('0x1'));var rs=require(_0x3d6d('0x2'));var fs=require('fs');var Redis=require(_0x3d6d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3d6d('0x4'));var logger=require(_0x3d6d('0x5'))(_0x3d6d('0x6'));var config=require(_0x3d6d('0x7'));var jayson=require(_0x3d6d('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x255a65,_0x1f69e1,_0x43b4f6){return new BPromise(function(_0x2cb498,_0x540661){return client['request'](_0x255a65,_0x43b4f6)['then'](function(_0x3d4365){logger[_0x3d6d('0x9')](_0x3d6d('0xa'),_0x1f69e1,_0x3d6d('0xb'));logger[_0x3d6d('0xc')](_0x3d6d('0xd'),_0x1f69e1,'request\x20sent',JSON[_0x3d6d('0xe')](_0x3d4365));if(_0x3d4365[_0x3d6d('0xf')]){if(_0x3d4365[_0x3d6d('0xf')][_0x3d6d('0x10')]===0x1f4){logger[_0x3d6d('0xf')](_0x3d6d('0xa'),_0x1f69e1,_0x3d4365[_0x3d6d('0xf')][_0x3d6d('0x11')]);return _0x540661(_0x3d4365[_0x3d6d('0xf')][_0x3d6d('0x11')]);}logger[_0x3d6d('0xf')](_0x3d6d('0xa'),_0x1f69e1,_0x3d4365[_0x3d6d('0xf')][_0x3d6d('0x11')]);return _0x2cb498(_0x3d4365['error']['message']);}else{logger['info'](_0x3d6d('0xa'),_0x1f69e1,_0x3d6d('0xb'));_0x2cb498(_0x3d4365['result'][_0x3d6d('0x11')]);}})[_0x3d6d('0x12')](function(_0x765f03){logger[_0x3d6d('0xf')](_0x3d6d('0xa'),_0x1f69e1,_0x765f03);_0x540661(_0x765f03);});});}exports[_0x3d6d('0x13')]=function(_0x47a9ff){var _0x75f468=this;return new Promise(function(_0x53f399,_0x4be27a){return db['SquareMessage'][_0x3d6d('0x14')](_0x47a9ff[_0x3d6d('0x15')],{'raw':_0x47a9ff[_0x3d6d('0x16')]?_0x47a9ff[_0x3d6d('0x16')][_0x3d6d('0x17')]===undefined?!![]:![]:!![]})[_0x3d6d('0x18')](function(_0x23ad74){logger['info'](_0x3d6d('0x13'),_0x47a9ff);logger['debug']('CreateSquareMessage',_0x47a9ff,JSON[_0x3d6d('0xe')](_0x23ad74));_0x53f399(_0x23ad74);})['catch'](function(_0x14e939){logger[_0x3d6d('0xf')](_0x3d6d('0x13'),_0x14e939[_0x3d6d('0x11')],_0x47a9ff);_0x4be27a(_0x75f468[_0x3d6d('0xf')](0x1f4,_0x14e939[_0x3d6d('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 5e92c2c..33547f8 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 _0xe3b6=['show','15s','post','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareOdbc.controller','get','isAuthenticated','index','/:id'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xe3b6,0x119));var _0x6e3b=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xe3b6[_0xb0f7c3];return _0x28ea68;};'use strict';var multer=require(_0x6e3b('0x0'));var util=require(_0x6e3b('0x1'));var path=require('path');var timeout=require(_0x6e3b('0x2'));var express=require(_0x6e3b('0x3'));var router=express[_0x6e3b('0x4')]();var fs_extra=require(_0x6e3b('0x5'));var auth=require(_0x6e3b('0x6'));var interaction=require(_0x6e3b('0x7'));var config=require('../../config/environment');var controller=require(_0x6e3b('0x8'));router[_0x6e3b('0x9')]('/',auth[_0x6e3b('0xa')](),controller[_0x6e3b('0xb')]);router[_0x6e3b('0x9')](_0x6e3b('0xc'),auth[_0x6e3b('0xa')](),controller[_0x6e3b('0xd')]);router[_0x6e3b('0x9')]('/:id/test',auth['isAuthenticated'](),timeout(_0x6e3b('0xe')),controller['test']);router[_0x6e3b('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6e3b('0x10')](_0x6e3b('0xc'),auth['isAuthenticated'](),controller[_0x6e3b('0x11')]);router[_0x6e3b('0x12')](_0x6e3b('0xc'),auth[_0x6e3b('0xa')](),controller[_0x6e3b('0x13')]);module[_0x6e3b('0x14')]=router; \ No newline at end of file +var _0x9c2e=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','index','show','/:id/test','isAuthenticated','15s','test','post','create','update','delete','destroy','multer','util','path'];(function(_0x3eafd8,_0x1dc4f5){var _0x219db7=function(_0x10c912){while(--_0x10c912){_0x3eafd8['push'](_0x3eafd8['shift']());}};_0x219db7(++_0x1dc4f5);}(_0x9c2e,0x19f));var _0xe9c2=function(_0x41d07b,_0x3ac2e2){_0x41d07b=_0x41d07b-0x0;var _0x2a59cb=_0x9c2e[_0x41d07b];return _0x2a59cb;};'use strict';var multer=require(_0xe9c2('0x0'));var util=require(_0xe9c2('0x1'));var path=require(_0xe9c2('0x2'));var timeout=require(_0xe9c2('0x3'));var express=require(_0xe9c2('0x4'));var router=express[_0xe9c2('0x5')]();var fs_extra=require(_0xe9c2('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xe9c2('0x7'));var config=require(_0xe9c2('0x8'));var controller=require(_0xe9c2('0x9'));router[_0xe9c2('0xa')]('/',auth['isAuthenticated'](),controller[_0xe9c2('0xb')]);router[_0xe9c2('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xe9c2('0xc')]);router[_0xe9c2('0xa')](_0xe9c2('0xd'),auth[_0xe9c2('0xe')](),timeout(_0xe9c2('0xf')),controller[_0xe9c2('0x10')]);router[_0xe9c2('0x11')]('/',auth[_0xe9c2('0xe')](),controller[_0xe9c2('0x12')]);router['put']('/:id',auth[_0xe9c2('0xe')](),controller[_0xe9c2('0x13')]);router[_0xe9c2('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xe9c2('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 42cd64b..a3e3ec6 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 _0x025a=['name','sequelize','exports','STRING'];(function(_0x258b4f,_0x209712){var _0x268937=function(_0x14fd38){while(--_0x14fd38){_0x258b4f['push'](_0x258b4f['shift']());}};_0x268937(++_0x209712);}(_0x025a,0x1b1));var _0xa025=function(_0x4605dc,_0x3f7ae5){_0x4605dc=_0x4605dc-0x0;var _0x5d3e81=_0x025a[_0x4605dc];return _0x5d3e81;};'use strict';var Sequelize=require(_0xa025('0x0'));module[_0xa025('0x1')]={'name':{'type':Sequelize[_0xa025('0x2')],'unique':_0xa025('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0xa025('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x337d=['STRING','sequelize','exports','name'];(function(_0x1cd47d,_0x55bc75){var _0x29d52f=function(_0x37737a){while(--_0x37737a){_0x1cd47d['push'](_0x1cd47d['shift']());}};_0x29d52f(++_0x55bc75);}(_0x337d,0x17d));var _0xd337=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x337d[_0x465028];return _0xb783d4;};'use strict';var Sequelize=require(_0xd337('0x0'));module[_0xd337('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xd337('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0xd337('0x3')]},'description':{'type':Sequelize[_0xd337('0x3')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index ab9cb27..76f39c3 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 _0xe819=['key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','get','role','ODBC','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','odbc','closeSync','rimraf','zip-dir','fast-json-patch','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','update','destroy','UserProfileResource','then','end','error','stack','name','send','index','SquareOdbc','rawAttributes','fieldName','type'];(function(_0x2265b0,_0x279abe){var _0xc4900b=function(_0x549d54){while(--_0x549d54){_0x2265b0['push'](_0x2265b0['shift']());}};_0xc4900b(++_0x279abe);}(_0xe819,0x1d7));var _0x9e81=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xe819[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9e81('0x0'));var zipdir=require(_0x9e81('0x1'));var jsonpatch=require(_0x9e81('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9e81('0x3'));var util=require('util');var path=require(_0x9e81('0x4'));var sox=require('sox');var csv=require(_0x9e81('0x5'));var ejs=require(_0x9e81('0x6'));var fs=require('fs');var fs_extra=require(_0x9e81('0x7'));var _=require(_0x9e81('0x8'));var squel=require('squel');var crypto=require(_0x9e81('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x9e81('0xa'));var toCsv=require(_0x9e81('0x5'));var querystring=require(_0x9e81('0xb'));var Papa=require(_0x9e81('0xc'));var Redis=require('ioredis');var authService=require(_0x9e81('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x9e81('0xe'));var hardwareService=require(_0x9e81('0xf'));var logger=require(_0x9e81('0x10'))(_0x9e81('0x11'));var utils=require('../../config/utils');var config=require(_0x9e81('0x12'));var licenseUtil=require(_0x9e81('0x13'));var db=require(_0x9e81('0x14'))['db'];function respondWithStatusCode(_0x112164,_0x5b9f57){_0x5b9f57=_0x5b9f57||0xcc;return function(_0x2f181a){if(_0x2f181a){return _0x112164[_0x9e81('0x15')](_0x5b9f57);}return _0x112164[_0x9e81('0x16')](_0x5b9f57)['end']();};}function respondWithResult(_0x5bbb6a,_0xb88264){_0xb88264=_0xb88264||0xc8;return function(_0x2fe1c7){if(_0x2fe1c7){return _0x5bbb6a[_0x9e81('0x16')](_0xb88264)['json'](_0x2fe1c7);}};}function respondWithFilteredResult(_0x2e2e8e,_0x2c749c){return function(_0x555951){if(_0x555951){var _0x365214=typeof _0x2c749c[_0x9e81('0x17')]===_0x9e81('0x18')&&typeof _0x2c749c[_0x9e81('0x19')]===_0x9e81('0x18');var _0x2cde7b=_0x555951['count'];var _0x3d213a=_0x365214?0x0:_0x2c749c['offset'];var _0x5e9a11=_0x365214?_0x555951[_0x9e81('0x1a')]:_0x2c749c[_0x9e81('0x17')]+_0x2c749c[_0x9e81('0x19')];var _0x486c69;if(_0x5e9a11>=_0x2cde7b){_0x5e9a11=_0x2cde7b;_0x486c69=0xc8;}else{_0x486c69=0xce;}_0x2e2e8e[_0x9e81('0x16')](_0x486c69);return _0x2e2e8e['set'](_0x9e81('0x1b'),_0x3d213a+'-'+_0x5e9a11+'/'+_0x2cde7b)[_0x9e81('0x1c')](_0x555951);}return null;};}function patchUpdates(_0x285c1f){return function(_0x5401f9){try{jsonpatch[_0x9e81('0x1d')](_0x5401f9,_0x285c1f,!![]);}catch(_0x1fb4e3){return BPromise[_0x9e81('0x1e')](_0x1fb4e3);}return _0x5401f9['save']();};}function saveUpdates(_0x1346d0,_0x57cefe){return function(_0x169bfc){if(_0x169bfc){return _0x169bfc[_0x9e81('0x1f')](_0x1346d0)['then'](function(_0x32f041){return _0x32f041;});}return null;};}function removeEntity(_0x323ee0,_0x17a294){return function(_0x3308bf){if(_0x3308bf){return _0x3308bf[_0x9e81('0x20')]()['then'](function(){var _0x4691ca=_0x3308bf['get']({'plain':!![]});var _0x191f44='ODBC';return db[_0x9e81('0x21')][_0x9e81('0x20')]({'where':{'type':_0x191f44,'resourceId':_0x4691ca['id']}})[_0x9e81('0x22')](function(){return _0x3308bf;});})[_0x9e81('0x22')](function(){_0x323ee0[_0x9e81('0x16')](0xcc)[_0x9e81('0x23')]();});}};}function handleEntityNotFound(_0x293606,_0x3954a8){return function(_0x2a5683){if(!_0x2a5683){_0x293606[_0x9e81('0x15')](0x194);}return _0x2a5683;};}function handleError(_0x18fe30,_0x173ee4){_0x173ee4=_0x173ee4||0x1f4;return function(_0x966ea7){logger[_0x9e81('0x24')](_0x966ea7[_0x9e81('0x25')]);if(_0x966ea7[_0x9e81('0x26')]){delete _0x966ea7[_0x9e81('0x26')];}_0x18fe30[_0x9e81('0x16')](_0x173ee4)[_0x9e81('0x27')](_0x966ea7);};}exports[_0x9e81('0x28')]=function(_0x582a2d,_0x5dc8bd){var _0x5d7766={},_0x3c2f63={},_0x11ebd9={'count':0x0,'rows':[]};var _0x3bede8=_['map'](db[_0x9e81('0x29')][_0x9e81('0x2a')],function(_0x317ede){return{'name':_0x317ede[_0x9e81('0x2b')],'type':_0x317ede[_0x9e81('0x2c')][_0x9e81('0x2d')]};});_0x3c2f63[_0x9e81('0x2e')]=_[_0x9e81('0x2f')](_0x3bede8,_0x9e81('0x26'));_0x3c2f63[_0x9e81('0x30')]=_[_0x9e81('0x31')](_0x582a2d[_0x9e81('0x30')]);_0x3c2f63['filters']=_[_0x9e81('0x32')](_0x3c2f63['model'],_0x3c2f63[_0x9e81('0x30')]);_0x5d7766[_0x9e81('0x33')]=_['intersection'](_0x3c2f63['model'],qs[_0x9e81('0x34')](_0x582a2d['query'][_0x9e81('0x34')]));_0x5d7766[_0x9e81('0x33')]=_0x5d7766[_0x9e81('0x33')][_0x9e81('0x35')]?_0x5d7766['attributes']:_0x3c2f63[_0x9e81('0x2e')];if(!_0x582a2d[_0x9e81('0x30')][_0x9e81('0x36')](_0x9e81('0x37'))){_0x5d7766[_0x9e81('0x19')]=qs[_0x9e81('0x19')](_0x582a2d[_0x9e81('0x30')][_0x9e81('0x19')]);_0x5d7766['offset']=qs[_0x9e81('0x17')](_0x582a2d[_0x9e81('0x30')][_0x9e81('0x17')]);}_0x5d7766[_0x9e81('0x38')]=qs[_0x9e81('0x39')](_0x582a2d[_0x9e81('0x30')][_0x9e81('0x39')]);_0x5d7766[_0x9e81('0x3a')]=qs[_0x9e81('0x3b')](_[_0x9e81('0x3c')](_0x582a2d[_0x9e81('0x30')],_0x3c2f63[_0x9e81('0x3b')]),_0x3bede8);if(_0x582a2d['query'][_0x9e81('0x3d')]){_0x5d7766[_0x9e81('0x3a')]=_[_0x9e81('0x3e')](_0x5d7766[_0x9e81('0x3a')],{'$or':_[_0x9e81('0x2f')](_0x3bede8,function(_0x6d086a){if(_0x6d086a['type']!==_0x9e81('0x3f')){var _0x2d332e={};_0x2d332e[_0x6d086a[_0x9e81('0x26')]]={'$like':'%'+_0x582a2d[_0x9e81('0x30')][_0x9e81('0x3d')]+'%'};return _0x2d332e;}})});}_0x5d7766=_[_0x9e81('0x3e')]({},_0x5d7766,_0x582a2d[_0x9e81('0x40')]);var _0x31a72f={'where':_0x5d7766[_0x9e81('0x3a')]};return db[_0x9e81('0x29')][_0x9e81('0x1a')](_0x31a72f)[_0x9e81('0x22')](function(_0x6e7b56){_0x11ebd9['count']=_0x6e7b56;if(_0x582a2d['query']['includeAll']){_0x5d7766[_0x9e81('0x41')]=[{'all':!![]}];}return db['SquareOdbc'][_0x9e81('0x42')](_0x5d7766);})[_0x9e81('0x22')](function(_0x4e904a){_0x11ebd9[_0x9e81('0x43')]=_0x4e904a;return _0x11ebd9;})['then'](respondWithFilteredResult(_0x5dc8bd,_0x5d7766))[_0x9e81('0x44')](handleError(_0x5dc8bd,null));};exports[_0x9e81('0x45')]=function(_0x516e9e,_0x12f9da){var _0xdb5566={'raw':!![],'where':{'id':_0x516e9e[_0x9e81('0x46')]['id']}},_0x12c23e={};_0x12c23e['model']=_[_0x9e81('0x31')](db[_0x9e81('0x29')][_0x9e81('0x2a')]);_0x12c23e[_0x9e81('0x30')]=_[_0x9e81('0x31')](_0x516e9e[_0x9e81('0x30')]);_0x12c23e[_0x9e81('0x3b')]=_['intersection'](_0x12c23e[_0x9e81('0x2e')],_0x12c23e[_0x9e81('0x30')]);_0xdb5566['attributes']=_[_0x9e81('0x32')](_0x12c23e[_0x9e81('0x2e')],qs[_0x9e81('0x34')](_0x516e9e['query'][_0x9e81('0x34')]));_0xdb5566['attributes']=_0xdb5566[_0x9e81('0x33')]['length']?_0xdb5566['attributes']:_0x12c23e[_0x9e81('0x2e')];if(_0x516e9e[_0x9e81('0x30')][_0x9e81('0x47')]){_0xdb5566['include']=[{'all':!![]}];}_0xdb5566=_[_0x9e81('0x3e')]({},_0xdb5566,_0x516e9e[_0x9e81('0x40')]);return db[_0x9e81('0x29')][_0x9e81('0x48')](_0xdb5566)['then'](handleEntityNotFound(_0x12f9da,null))[_0x9e81('0x22')](respondWithResult(_0x12f9da,null))[_0x9e81('0x44')](handleError(_0x12f9da,null));};exports[_0x9e81('0x49')]=function(_0x4b29ed,_0x59bbe9){return db['SquareOdbc'][_0x9e81('0x49')](_0x4b29ed[_0x9e81('0x4a')],{})[_0x9e81('0x22')](function(_0x241576){var _0x2bd6d8=_0x4b29ed[_0x9e81('0x4b')][_0x9e81('0x4c')]({'plain':!![]});if(!_0x2bd6d8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2bd6d8[_0x9e81('0x4d')]==='user'){var _0xddefae=_0x241576[_0x9e81('0x4c')]({'plain':!![]});var _0x24eb90=_0x9e81('0x4e');return db[_0x9e81('0x4f')][_0x9e81('0x48')]({'where':{'name':_0x24eb90,'userProfileId':_0x2bd6d8[_0x9e81('0x50')]},'raw':!![]})[_0x9e81('0x22')](function(_0x185974){if(_0x185974&&_0x185974['autoAssociation']===0x0){return db[_0x9e81('0x21')][_0x9e81('0x49')]({'name':_0xddefae['name'],'resourceId':_0xddefae['id'],'type':_0x185974['name'],'sectionId':_0x185974['id']},{})[_0x9e81('0x22')](function(){return _0x241576;});}else{return _0x241576;}})['catch'](function(_0x536539){logger[_0x9e81('0x24')](_0x9e81('0x51'),_0x536539);throw _0x536539;});}return _0x241576;})[_0x9e81('0x22')](respondWithResult(_0x59bbe9,0xc9))[_0x9e81('0x44')](handleError(_0x59bbe9,null));};exports[_0x9e81('0x1f')]=function(_0x2da7ae,_0xd8f6c4){if(_0x2da7ae[_0x9e81('0x4a')]['id']){delete _0x2da7ae['body']['id'];}return db[_0x9e81('0x29')][_0x9e81('0x48')]({'where':{'id':_0x2da7ae[_0x9e81('0x46')]['id']}})['then'](handleEntityNotFound(_0xd8f6c4,null))['then'](saveUpdates(_0x2da7ae[_0x9e81('0x4a')],null))['then'](respondWithResult(_0xd8f6c4,null))[_0x9e81('0x44')](handleError(_0xd8f6c4,null));};exports[_0x9e81('0x20')]=function(_0x5a7c23,_0x36f226){return db[_0x9e81('0x29')][_0x9e81('0x48')]({'where':{'id':_0x5a7c23[_0x9e81('0x46')]['id']}})[_0x9e81('0x22')](handleEntityNotFound(_0x36f226,null))[_0x9e81('0x22')](removeEntity(_0x36f226,null))[_0x9e81('0x44')](handleError(_0x36f226,null));};exports[_0x9e81('0x52')]=function(_0x441643,_0x45d6e2,_0x2b3568){var _0x41faf2;return db[_0x9e81('0x29')]['find']({'where':{'id':_0x441643[_0x9e81('0x46')]['id']},'attributes':['id',_0x9e81('0x53')]})[_0x9e81('0x22')](handleEntityNotFound(_0x45d6e2,null))[_0x9e81('0x22')](function(_0xde29f8){if(_0xde29f8){var _0x5bdaf9=require(_0x9e81('0x54'))();_0x5bdaf9['openSync'](_0xde29f8['dsn']);_0x5bdaf9[_0x9e81('0x55')]();return _0xde29f8;}})[_0x9e81('0x22')](respondWithResult(_0x45d6e2,null))[_0x9e81('0x44')](handleError(_0x45d6e2,null));}; \ No newline at end of file +var _0x619f=['fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','create','error','body','test','dsn','odbc','openSync','closeSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','count','limit','set','json','apply','save','update','then','destroy','get','ODBC','UserProfileResource','sendStatus','name','send','map','SquareOdbc','rawAttributes'];(function(_0x155f58,_0x4d0489){var _0x51fb9d=function(_0x5d93ae){while(--_0x5d93ae){_0x155f58['push'](_0x155f58['shift']());}};_0x51fb9d(++_0x4d0489);}(_0x619f,0x12f));var _0xf619=function(_0x30faa8,_0xeba979){_0x30faa8=_0x30faa8-0x0;var _0x282076=_0x619f[_0x30faa8];return _0x282076;};'use strict';var emlformat=require(_0xf619('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf619('0x1'));var jsonpatch=require(_0xf619('0x2'));var rp=require(_0xf619('0x3'));var moment=require(_0xf619('0x4'));var BPromise=require(_0xf619('0x5'));var Mustache=require('mustache');var util=require(_0xf619('0x6'));var path=require('path');var sox=require(_0xf619('0x7'));var csv=require(_0xf619('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf619('0x9'));var crypto=require(_0xf619('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xf619('0xb'));var toCsv=require(_0xf619('0x8'));var querystring=require(_0xf619('0xc'));var Papa=require(_0xf619('0xd'));var Redis=require('ioredis');var authService=require(_0xf619('0xe'));var qs=require(_0xf619('0xf'));var as=require(_0xf619('0x10'));var hardwareService=require(_0xf619('0x11'));var logger=require(_0xf619('0x12'))(_0xf619('0x13'));var utils=require(_0xf619('0x14'));var config=require(_0xf619('0x15'));var licenseUtil=require(_0xf619('0x16'));var db=require(_0xf619('0x17'))['db'];function respondWithStatusCode(_0x1dc924,_0x3fdfb2){_0x3fdfb2=_0x3fdfb2||0xcc;return function(_0x540fb8){if(_0x540fb8){return _0x1dc924['sendStatus'](_0x3fdfb2);}return _0x1dc924[_0xf619('0x18')](_0x3fdfb2)['end']();};}function respondWithResult(_0x373779,_0x8b4a40){_0x8b4a40=_0x8b4a40||0xc8;return function(_0x3870d1){if(_0x3870d1){return _0x373779[_0xf619('0x18')](_0x8b4a40)['json'](_0x3870d1);}};}function respondWithFilteredResult(_0x57e04d,_0x144a39){return function(_0x4d2853){if(_0x4d2853){var _0x208a3d=typeof _0x144a39[_0xf619('0x19')]===_0xf619('0x1a')&&typeof _0x144a39['limit']===_0xf619('0x1a');var _0x559734=_0x4d2853[_0xf619('0x1b')];var _0x7a0aa8=_0x208a3d?0x0:_0x144a39[_0xf619('0x19')];var _0x3d835c=_0x208a3d?_0x4d2853[_0xf619('0x1b')]:_0x144a39[_0xf619('0x19')]+_0x144a39[_0xf619('0x1c')];var _0x34927f;if(_0x3d835c>=_0x559734){_0x3d835c=_0x559734;_0x34927f=0xc8;}else{_0x34927f=0xce;}_0x57e04d['status'](_0x34927f);return _0x57e04d[_0xf619('0x1d')]('Content-Range',_0x7a0aa8+'-'+_0x3d835c+'/'+_0x559734)[_0xf619('0x1e')](_0x4d2853);}return null;};}function patchUpdates(_0x291007){return function(_0x2432b5){try{jsonpatch[_0xf619('0x1f')](_0x2432b5,_0x291007,!![]);}catch(_0x18c37d){return BPromise['reject'](_0x18c37d);}return _0x2432b5[_0xf619('0x20')]();};}function saveUpdates(_0x57ffc7,_0x31b779){return function(_0x172436){if(_0x172436){return _0x172436[_0xf619('0x21')](_0x57ffc7)[_0xf619('0x22')](function(_0x152853){return _0x152853;});}return null;};}function removeEntity(_0x3a0a5d,_0x8d57f0){return function(_0x1939ff){if(_0x1939ff){return _0x1939ff[_0xf619('0x23')]()['then'](function(){var _0x4f4022=_0x1939ff[_0xf619('0x24')]({'plain':!![]});var _0x2072de=_0xf619('0x25');return db[_0xf619('0x26')][_0xf619('0x23')]({'where':{'type':_0x2072de,'resourceId':_0x4f4022['id']}})['then'](function(){return _0x1939ff;});})[_0xf619('0x22')](function(){_0x3a0a5d[_0xf619('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x498680,_0x594847){return function(_0x5468fe){if(!_0x5468fe){_0x498680[_0xf619('0x27')](0x194);}return _0x5468fe;};}function handleError(_0x5bf193,_0x21ed40){_0x21ed40=_0x21ed40||0x1f4;return function(_0x6a2320){logger['error'](_0x6a2320['stack']);if(_0x6a2320[_0xf619('0x28')]){delete _0x6a2320[_0xf619('0x28')];}_0x5bf193[_0xf619('0x18')](_0x21ed40)[_0xf619('0x29')](_0x6a2320);};}exports['index']=function(_0x2f85ec,_0x163b34){var _0x13ef1b={},_0x28290e={},_0x3ca5a0={'count':0x0,'rows':[]};var _0x2c4059=_[_0xf619('0x2a')](db[_0xf619('0x2b')][_0xf619('0x2c')],function(_0x73e4f9){return{'name':_0x73e4f9[_0xf619('0x2d')],'type':_0x73e4f9['type'][_0xf619('0x2e')]};});_0x28290e[_0xf619('0x2f')]=_['map'](_0x2c4059,'name');_0x28290e[_0xf619('0x30')]=_[_0xf619('0x31')](_0x2f85ec[_0xf619('0x30')]);_0x28290e[_0xf619('0x32')]=_[_0xf619('0x33')](_0x28290e[_0xf619('0x2f')],_0x28290e[_0xf619('0x30')]);_0x13ef1b['attributes']=_[_0xf619('0x33')](_0x28290e['model'],qs[_0xf619('0x34')](_0x2f85ec[_0xf619('0x30')][_0xf619('0x34')]));_0x13ef1b[_0xf619('0x35')]=_0x13ef1b[_0xf619('0x35')][_0xf619('0x36')]?_0x13ef1b[_0xf619('0x35')]:_0x28290e[_0xf619('0x2f')];if(!_0x2f85ec[_0xf619('0x30')][_0xf619('0x37')](_0xf619('0x38'))){_0x13ef1b[_0xf619('0x1c')]=qs[_0xf619('0x1c')](_0x2f85ec[_0xf619('0x30')][_0xf619('0x1c')]);_0x13ef1b[_0xf619('0x19')]=qs[_0xf619('0x19')](_0x2f85ec[_0xf619('0x30')]['offset']);}_0x13ef1b[_0xf619('0x39')]=qs[_0xf619('0x3a')](_0x2f85ec['query'][_0xf619('0x3a')]);_0x13ef1b[_0xf619('0x3b')]=qs[_0xf619('0x32')](_[_0xf619('0x3c')](_0x2f85ec['query'],_0x28290e[_0xf619('0x32')]),_0x2c4059);if(_0x2f85ec['query'][_0xf619('0x3d')]){_0x13ef1b['where']=_['merge'](_0x13ef1b[_0xf619('0x3b')],{'$or':_[_0xf619('0x2a')](_0x2c4059,function(_0x94f2a4){if(_0x94f2a4[_0xf619('0x3e')]!==_0xf619('0x3f')){var _0x50a363={};_0x50a363[_0x94f2a4['name']]={'$like':'%'+_0x2f85ec['query'][_0xf619('0x3d')]+'%'};return _0x50a363;}})});}_0x13ef1b=_[_0xf619('0x40')]({},_0x13ef1b,_0x2f85ec[_0xf619('0x41')]);var _0x14e4cc={'where':_0x13ef1b['where']};return db[_0xf619('0x2b')][_0xf619('0x1b')](_0x14e4cc)['then'](function(_0x166f18){_0x3ca5a0[_0xf619('0x1b')]=_0x166f18;if(_0x2f85ec[_0xf619('0x30')][_0xf619('0x42')]){_0x13ef1b[_0xf619('0x43')]=[{'all':!![]}];}return db[_0xf619('0x2b')][_0xf619('0x44')](_0x13ef1b);})[_0xf619('0x22')](function(_0x415487){_0x3ca5a0[_0xf619('0x45')]=_0x415487;return _0x3ca5a0;})[_0xf619('0x22')](respondWithFilteredResult(_0x163b34,_0x13ef1b))[_0xf619('0x46')](handleError(_0x163b34,null));};exports[_0xf619('0x47')]=function(_0x3afa89,_0x11f899){var _0x263a6b={'raw':!![],'where':{'id':_0x3afa89[_0xf619('0x48')]['id']}},_0x399557={};_0x399557[_0xf619('0x2f')]=_[_0xf619('0x31')](db['SquareOdbc']['rawAttributes']);_0x399557['query']=_[_0xf619('0x31')](_0x3afa89['query']);_0x399557['filters']=_[_0xf619('0x33')](_0x399557[_0xf619('0x2f')],_0x399557['query']);_0x263a6b[_0xf619('0x35')]=_[_0xf619('0x33')](_0x399557[_0xf619('0x2f')],qs['fields'](_0x3afa89[_0xf619('0x30')][_0xf619('0x34')]));_0x263a6b[_0xf619('0x35')]=_0x263a6b[_0xf619('0x35')][_0xf619('0x36')]?_0x263a6b[_0xf619('0x35')]:_0x399557['model'];if(_0x3afa89[_0xf619('0x30')][_0xf619('0x42')]){_0x263a6b[_0xf619('0x43')]=[{'all':!![]}];}_0x263a6b=_[_0xf619('0x40')]({},_0x263a6b,_0x3afa89['options']);return db[_0xf619('0x2b')][_0xf619('0x49')](_0x263a6b)[_0xf619('0x22')](handleEntityNotFound(_0x11f899,null))[_0xf619('0x22')](respondWithResult(_0x11f899,null))[_0xf619('0x46')](handleError(_0x11f899,null));};exports['create']=function(_0x3b573e,_0x3adcc9){return db[_0xf619('0x2b')]['create'](_0x3b573e['body'],{})[_0xf619('0x22')](function(_0x28274f){var _0x3367cc=_0x3b573e[_0xf619('0x4a')]['get']({'plain':!![]});if(!_0x3367cc)throw new Error(_0xf619('0x4b'));if(_0x3367cc[_0xf619('0x4c')]===_0xf619('0x4a')){var _0xb1fdd9=_0x28274f[_0xf619('0x24')]({'plain':!![]});var _0x1ac0ba=_0xf619('0x25');return db[_0xf619('0x4d')][_0xf619('0x49')]({'where':{'name':_0x1ac0ba,'userProfileId':_0x3367cc[_0xf619('0x4e')]},'raw':!![]})[_0xf619('0x22')](function(_0x3f5ecd){if(_0x3f5ecd&&_0x3f5ecd['autoAssociation']===0x0){return db[_0xf619('0x26')][_0xf619('0x4f')]({'name':_0xb1fdd9[_0xf619('0x28')],'resourceId':_0xb1fdd9['id'],'type':_0x3f5ecd[_0xf619('0x28')],'sectionId':_0x3f5ecd['id']},{})['then'](function(){return _0x28274f;});}else{return _0x28274f;}})['catch'](function(_0xcbcf5b){logger[_0xf619('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xcbcf5b);throw _0xcbcf5b;});}return _0x28274f;})[_0xf619('0x22')](respondWithResult(_0x3adcc9,0xc9))[_0xf619('0x46')](handleError(_0x3adcc9,null));};exports[_0xf619('0x21')]=function(_0x4d3b3c,_0x3ee887){if(_0x4d3b3c[_0xf619('0x51')]['id']){delete _0x4d3b3c[_0xf619('0x51')]['id'];}return db[_0xf619('0x2b')][_0xf619('0x49')]({'where':{'id':_0x4d3b3c[_0xf619('0x48')]['id']}})['then'](handleEntityNotFound(_0x3ee887,null))['then'](saveUpdates(_0x4d3b3c[_0xf619('0x51')],null))[_0xf619('0x22')](respondWithResult(_0x3ee887,null))['catch'](handleError(_0x3ee887,null));};exports['destroy']=function(_0x475c32,_0x2c7e06){return db[_0xf619('0x2b')][_0xf619('0x49')]({'where':{'id':_0x475c32[_0xf619('0x48')]['id']}})[_0xf619('0x22')](handleEntityNotFound(_0x2c7e06,null))[_0xf619('0x22')](removeEntity(_0x2c7e06,null))[_0xf619('0x46')](handleError(_0x2c7e06,null));};exports[_0xf619('0x52')]=function(_0x51605f,_0x28578c,_0x5a951b){var _0x47057e;return db[_0xf619('0x2b')][_0xf619('0x49')]({'where':{'id':_0x51605f['params']['id']},'attributes':['id',_0xf619('0x53')]})['then'](handleEntityNotFound(_0x28578c,null))[_0xf619('0x22')](function(_0x435221){if(_0x435221){var _0x8b27af=require(_0xf619('0x54'))();_0x8b27af[_0xf619('0x55')](_0x435221[_0xf619('0x53')]);_0x8b27af[_0xf619('0x56')]();return _0x435221;}})[_0xf619('0x22')](respondWithResult(_0x28578c,null))[_0xf619('0x46')](handleError(_0x28578c,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index a079b4f..a27ce5e 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 _0xa548=['bluebird','request-promise','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','lodash','util','../../config/logger','api','moment'];(function(_0x5093e9,_0x5154d0){var _0x4c9a22=function(_0x15176d){while(--_0x15176d){_0x5093e9['push'](_0x5093e9['shift']());}};_0x4c9a22(++_0x5154d0);}(_0xa548,0x1c9));var _0x8a54=function(_0x554675,_0x189bad){_0x554675=_0x554675-0x0;var _0x5b9cd8=_0xa548[_0x554675];return _0x5b9cd8;};'use strict';var _=require(_0x8a54('0x0'));var util=require(_0x8a54('0x1'));var logger=require(_0x8a54('0x2'))(_0x8a54('0x3'));var moment=require(_0x8a54('0x4'));var BPromise=require(_0x8a54('0x5'));var rp=require(_0x8a54('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8a54('0x7'));var config=require(_0x8a54('0x8'));var attributes=require(_0x8a54('0x9'));module[_0x8a54('0xa')]=function(_0x2258d6,_0x3bcb29){return _0x2258d6[_0x8a54('0xb')](_0x8a54('0xc'),attributes,{'tableName':_0x8a54('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf023=['define','SquareOdbc','square_odbc','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','exports'];(function(_0x523b20,_0x111ad2){var _0x5beb70=function(_0x19cbee){while(--_0x19cbee){_0x523b20['push'](_0x523b20['shift']());}};_0x5beb70(++_0x111ad2);}(_0xf023,0x153));var _0x3f02=function(_0x41f8b7,_0x180732){_0x41f8b7=_0x41f8b7-0x0;var _0x4aaab6=_0xf023[_0x41f8b7];return _0x4aaab6;};'use strict';var _=require(_0x3f02('0x0'));var util=require(_0x3f02('0x1'));var logger=require('../../config/logger')(_0x3f02('0x2'));var moment=require(_0x3f02('0x3'));var BPromise=require(_0x3f02('0x4'));var rp=require(_0x3f02('0x5'));var fs=require('fs');var path=require(_0x3f02('0x6'));var rimraf=require(_0x3f02('0x7'));var config=require(_0x3f02('0x8'));var attributes=require(_0x3f02('0x9'));module[_0x3f02('0xa')]=function(_0x2056a7,_0x7bc0ba){return _0x2056a7[_0x3f02('0xb')](_0x3f02('0xc'),attributes,{'tableName':_0x3f02('0xd'),'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 fc185d1..4554f64 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 _0x0340=['code','message','catch','ShowSquareOdbc','SquareOdbc','find','options','attributes','include','map','model','then','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','request','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x41699c,_0x317092){var _0xb1e0ad=function(_0x205f83){while(--_0x205f83){_0x41699c['push'](_0x41699c['shift']());}};_0xb1e0ad(++_0x317092);}(_0x0340,0xd7));var _0x0034=function(_0x36068f,_0x5d6833){_0x36068f=_0x36068f-0x0;var _0x5809c2=_0x0340[_0x36068f];return _0x5809c2;};'use strict';var _=require(_0x0034('0x0'));var util=require(_0x0034('0x1'));var moment=require(_0x0034('0x2'));var BPromise=require(_0x0034('0x3'));var rs=require(_0x0034('0x4'));var fs=require('fs');var Redis=require(_0x0034('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0034('0x6'));var logger=require(_0x0034('0x7'))(_0x0034('0x8'));var config=require(_0x0034('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x309fac,_0x1f81dd,_0x3f131d){return new BPromise(function(_0x3c7a5f,_0x5a3131){return client[_0x0034('0xa')](_0x309fac,_0x3f131d)['then'](function(_0x1994de){logger[_0x0034('0xb')](_0x0034('0xc'),_0x1f81dd,_0x0034('0xd'));logger[_0x0034('0xe')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x1f81dd,_0x0034('0xd'),JSON[_0x0034('0xf')](_0x1994de));if(_0x1994de[_0x0034('0x10')]){if(_0x1994de[_0x0034('0x10')][_0x0034('0x11')]===0x1f4){logger[_0x0034('0x10')](_0x0034('0xc'),_0x1f81dd,_0x1994de[_0x0034('0x10')][_0x0034('0x12')]);return _0x5a3131(_0x1994de[_0x0034('0x10')][_0x0034('0x12')]);}logger['error']('SquareOdbc,\x20%s,\x20%s',_0x1f81dd,_0x1994de[_0x0034('0x10')][_0x0034('0x12')]);return _0x3c7a5f(_0x1994de['error'][_0x0034('0x12')]);}else{logger[_0x0034('0xb')](_0x0034('0xc'),_0x1f81dd,_0x0034('0xd'));_0x3c7a5f(_0x1994de['result'][_0x0034('0x12')]);}})[_0x0034('0x13')](function(_0x4f42f1){logger[_0x0034('0x10')](_0x0034('0xc'),_0x1f81dd,_0x4f42f1);_0x5a3131(_0x4f42f1);});});}exports[_0x0034('0x14')]=function(_0x47377c){var _0x351e96=this;return new Promise(function(_0x5da2f3,_0x34dc05){return db[_0x0034('0x15')][_0x0034('0x16')]({'raw':_0x47377c[_0x0034('0x17')]?_0x47377c[_0x0034('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x47377c['options']?_0x47377c[_0x0034('0x17')]['where']||null:null,'attributes':_0x47377c[_0x0034('0x17')]?_0x47377c['options'][_0x0034('0x18')]||null:null,'include':_0x47377c[_0x0034('0x17')]?_0x47377c[_0x0034('0x17')][_0x0034('0x19')]?_[_0x0034('0x1a')](_0x47377c[_0x0034('0x17')][_0x0034('0x19')],function(_0x1158b3){return{'model':db[_0x1158b3[_0x0034('0x1b')]],'as':_0x1158b3['as'],'attributes':_0x1158b3[_0x0034('0x18')],'include':_0x1158b3['include']?_[_0x0034('0x1a')](_0x1158b3[_0x0034('0x19')],function(_0x4d17f3){return{'model':db[_0x4d17f3[_0x0034('0x1b')]],'as':_0x4d17f3['as'],'attributes':_0x4d17f3['attributes'],'include':_0x4d17f3[_0x0034('0x19')]?_[_0x0034('0x1a')](_0x4d17f3['include'],function(_0x286c0e){return{'model':db[_0x286c0e[_0x0034('0x1b')]],'as':_0x286c0e['as'],'attributes':_0x286c0e[_0x0034('0x18')]};}):[]};}):[]};}):[]:[]})[_0x0034('0x1c')](function(_0x34da3c){logger[_0x0034('0xb')]('ShowSquareOdbc',_0x47377c);logger['debug'](_0x0034('0x14'),_0x47377c,JSON['stringify'](_0x34da3c));_0x5da2f3(_0x34da3c);})[_0x0034('0x13')](function(_0xb74742){logger['error']('ShowSquareOdbc',_0xb74742[_0x0034('0x12')],_0x47377c);_0x34dc05(_0x351e96[_0x0034('0x10')](0x1f4,_0xb74742[_0x0034('0x12')]));});});}; \ No newline at end of file +var _0x4437=['error','code','message','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','where','include','map','model','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4437,0x19a));var _0x7443=function(_0x221d4f,_0x30e5fb){_0x221d4f=_0x221d4f-0x0;var _0x5b840d=_0x4437[_0x221d4f];return _0x5b840d;};'use strict';var _=require(_0x7443('0x0'));var util=require(_0x7443('0x1'));var moment=require(_0x7443('0x2'));var BPromise=require(_0x7443('0x3'));var rs=require(_0x7443('0x4'));var fs=require('fs');var Redis=require(_0x7443('0x5'));var db=require(_0x7443('0x6'))['db'];var utils=require(_0x7443('0x7'));var logger=require(_0x7443('0x8'))(_0x7443('0x9'));var config=require(_0x7443('0xa'));var jayson=require(_0x7443('0xb'));var client=jayson[_0x7443('0xc')][_0x7443('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1d67d4,_0x2822db,_0xb7cc79){return new BPromise(function(_0x5beaaa,_0x4ee0d3){return client[_0x7443('0xe')](_0x1d67d4,_0xb7cc79)[_0x7443('0xf')](function(_0x20ca90){logger[_0x7443('0x10')](_0x7443('0x11'),_0x2822db,'request\x20sent');logger[_0x7443('0x12')](_0x7443('0x13'),_0x2822db,_0x7443('0x14'),JSON[_0x7443('0x15')](_0x20ca90));if(_0x20ca90[_0x7443('0x16')]){if(_0x20ca90[_0x7443('0x16')][_0x7443('0x17')]===0x1f4){logger['error']('SquareOdbc,\x20%s,\x20%s',_0x2822db,_0x20ca90[_0x7443('0x16')]['message']);return _0x4ee0d3(_0x20ca90['error']['message']);}logger[_0x7443('0x16')](_0x7443('0x11'),_0x2822db,_0x20ca90[_0x7443('0x16')][_0x7443('0x18')]);return _0x5beaaa(_0x20ca90[_0x7443('0x16')][_0x7443('0x18')]);}else{logger['info'](_0x7443('0x11'),_0x2822db,_0x7443('0x14'));_0x5beaaa(_0x20ca90['result'][_0x7443('0x18')]);}})[_0x7443('0x19')](function(_0x3089c0){logger[_0x7443('0x16')]('SquareOdbc,\x20%s,\x20%s',_0x2822db,_0x3089c0);_0x4ee0d3(_0x3089c0);});});}exports[_0x7443('0x1a')]=function(_0x124bc1){var _0x5f2d45=this;return new Promise(function(_0x39343e,_0x25bf03){return db[_0x7443('0x1b')][_0x7443('0x1c')]({'raw':_0x124bc1[_0x7443('0x1d')]?_0x124bc1[_0x7443('0x1d')][_0x7443('0x1e')]===undefined?!![]:![]:!![],'where':_0x124bc1[_0x7443('0x1d')]?_0x124bc1[_0x7443('0x1d')][_0x7443('0x1f')]||null:null,'attributes':_0x124bc1[_0x7443('0x1d')]?_0x124bc1[_0x7443('0x1d')]['attributes']||null:null,'include':_0x124bc1['options']?_0x124bc1[_0x7443('0x1d')][_0x7443('0x20')]?_[_0x7443('0x21')](_0x124bc1['options'][_0x7443('0x20')],function(_0x435c3e){return{'model':db[_0x435c3e[_0x7443('0x22')]],'as':_0x435c3e['as'],'attributes':_0x435c3e[_0x7443('0x23')],'include':_0x435c3e[_0x7443('0x20')]?_[_0x7443('0x21')](_0x435c3e[_0x7443('0x20')],function(_0x1c9ac9){return{'model':db[_0x1c9ac9['model']],'as':_0x1c9ac9['as'],'attributes':_0x1c9ac9[_0x7443('0x23')],'include':_0x1c9ac9[_0x7443('0x20')]?_[_0x7443('0x21')](_0x1c9ac9[_0x7443('0x20')],function(_0x3fbb28){return{'model':db[_0x3fbb28['model']],'as':_0x3fbb28['as'],'attributes':_0x3fbb28[_0x7443('0x23')]};}):[]};}):[]};}):[]:[]})[_0x7443('0xf')](function(_0x34ff29){logger[_0x7443('0x10')](_0x7443('0x1a'),_0x124bc1);logger[_0x7443('0x12')]('ShowSquareOdbc',_0x124bc1,JSON[_0x7443('0x15')](_0x34ff29));_0x39343e(_0x34ff29);})[_0x7443('0x19')](function(_0x193032){logger[_0x7443('0x16')](_0x7443('0x1a'),_0x193032[_0x7443('0x18')],_0x124bc1);_0x25bf03(_0x5f2d45['error'](0x1f4,_0x193032[_0x7443('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 08fcbc3..6759504 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 _0x5677=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy'];(function(_0x3615af,_0x3c5982){var _0x5d7f66=function(_0x1f8f8e){while(--_0x1f8f8e){_0x3615af['push'](_0x3615af['shift']());}};_0x5d7f66(++_0x3c5982);}(_0x5677,0x135));var _0x7567=function(_0x1d2bbb,_0x202267){_0x1d2bbb=_0x1d2bbb-0x0;var _0x38082b=_0x5677[_0x1d2bbb];return _0x38082b;};'use strict';var multer=require('multer');var util=require(_0x7567('0x0'));var path=require(_0x7567('0x1'));var timeout=require(_0x7567('0x2'));var express=require(_0x7567('0x3'));var router=express[_0x7567('0x4')]();var fs_extra=require(_0x7567('0x5'));var auth=require(_0x7567('0x6'));var interaction=require(_0x7567('0x7'));var config=require(_0x7567('0x8'));var controller=require(_0x7567('0x9'));router[_0x7567('0xa')]('/',auth[_0x7567('0xb')](),controller[_0x7567('0xc')]);router[_0x7567('0xa')]('/:id',auth[_0x7567('0xb')](),controller[_0x7567('0xd')]);router[_0x7567('0xe')]('/',auth[_0x7567('0xb')](),controller[_0x7567('0xf')]);router[_0x7567('0x10')](_0x7567('0x11'),auth[_0x7567('0xb')](),controller[_0x7567('0x12')]);router[_0x7567('0x13')](_0x7567('0x11'),auth['isAuthenticated'](),controller[_0x7567('0x14')]);module[_0x7567('0x15')]=router; \ No newline at end of file +var _0x0f40=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareProject.controller','isAuthenticated','index','/:id','post','create','update','destroy','util','path','connect-timeout'];(function(_0x5ded81,_0x5d770d){var _0x3e99ab=function(_0x178ca6){while(--_0x178ca6){_0x5ded81['push'](_0x5ded81['shift']());}};_0x3e99ab(++_0x5d770d);}(_0x0f40,0x6d));var _0x00f4=function(_0x1ad901,_0x852d9e){_0x1ad901=_0x1ad901-0x0;var _0x3c0249=_0x0f40[_0x1ad901];return _0x3c0249;};'use strict';var multer=require('multer');var util=require(_0x00f4('0x0'));var path=require(_0x00f4('0x1'));var timeout=require(_0x00f4('0x2'));var express=require(_0x00f4('0x3'));var router=express[_0x00f4('0x4')]();var fs_extra=require(_0x00f4('0x5'));var auth=require(_0x00f4('0x6'));var interaction=require(_0x00f4('0x7'));var config=require('../../config/environment');var controller=require(_0x00f4('0x8'));router['get']('/',auth[_0x00f4('0x9')](),controller[_0x00f4('0xa')]);router['get'](_0x00f4('0xb'),auth[_0x00f4('0x9')](),controller['show']);router[_0x00f4('0xc')]('/',auth['isAuthenticated'](),controller[_0x00f4('0xd')]);router['put'](_0x00f4('0xb'),auth['isAuthenticated'](),controller[_0x00f4('0xe')]);router['delete']('/:id',auth[_0x00f4('0x9')](),controller[_0x00f4('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 5bb4196..390043c 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 _0x2884=['long','production','DATE','sequelize','name','STRING','BLOB','getDataValue','preproduction','toString','utf8'];(function(_0x51dfa9,_0x33cb28){var _0xf4a1d2=function(_0x1d41b0){while(--_0x1d41b0){_0x51dfa9['push'](_0x51dfa9['shift']());}};_0xf4a1d2(++_0x33cb28);}(_0x2884,0xea));var _0x4288=function(_0x2edb9f,_0x36fad0){_0x2edb9f=_0x2edb9f-0x0;var _0x4e5979=_0x2884[_0x2edb9f];return _0x4e5979;};'use strict';var Sequelize=require(_0x4288('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x4288('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x4288('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x4288('0x3')]('long'),'get':function(){if(this[_0x4288('0x4')](_0x4288('0x5'))){return this[_0x4288('0x4')](_0x4288('0x5'))[_0x4288('0x6')](_0x4288('0x7'));}}},'production':{'type':Sequelize[_0x4288('0x3')](_0x4288('0x8')),'get':function(){if(this['getDataValue'](_0x4288('0x9'))){return this[_0x4288('0x4')](_0x4288('0x9'))[_0x4288('0x6')](_0x4288('0x7'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0x4288('0xa')]}}; \ No newline at end of file +var _0xcc76=['preproduction','utf8','long','production','toString','DATE','sequelize','exports','STRING','name','BLOB','getDataValue'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xcc76,0x11a));var _0x6cc7=function(_0x140cc5,_0x41d4d6){_0x140cc5=_0x140cc5-0x0;var _0x21d4bd=_0xcc76[_0x140cc5];return _0x21d4bd;};'use strict';var Sequelize=require(_0x6cc7('0x0'));module[_0x6cc7('0x1')]={'name':{'type':Sequelize[_0x6cc7('0x2')],'unique':_0x6cc7('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x6cc7('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x6cc7('0x4')]('long'),'get':function(){if(this[_0x6cc7('0x5')](_0x6cc7('0x6'))){return this[_0x6cc7('0x5')]('preproduction')['toString'](_0x6cc7('0x7'));}}},'production':{'type':Sequelize[_0x6cc7('0x4')](_0x6cc7('0x8')),'get':function(){if(this[_0x6cc7('0x5')](_0x6cc7('0x9'))){return this[_0x6cc7('0x5')](_0x6cc7('0x9'))[_0x6cc7('0xa')](_0x6cc7('0x7'));}}},'savedAt':{'type':Sequelize[_0x6cc7('0xb')]},'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 6d9a163..d944f1e 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 _0x28dc=['options','SquareProject','count','includeAll','include','findAll','rows','catch','params','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','pick','production','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./squareProject.socket','register','status','json','offset','undefined','limit','set','update','then','destroy','get','SquareProjects','publish','agi','stringify','end','error','stack','name','index','map','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x28dc,0x9e));var _0xc28d=function(_0x31efe7,_0x52fe9e){_0x31efe7=_0x31efe7-0x0;var _0x24b6ee=_0x28dc[_0x31efe7];return _0x24b6ee;};'use strict';var _=require(_0xc28d('0x0'));var Redis=require(_0xc28d('0x1'));var qs=require(_0xc28d('0x2'));var logger=require(_0xc28d('0x3'))('api');var config=require(_0xc28d('0x4'));var db=require(_0xc28d('0x5'))['db'];config[_0xc28d('0x6')]=_['defaults'](config[_0xc28d('0x6')],{'host':_0xc28d('0x7'),'port':0x18eb});var socket=require(_0xc28d('0x8'))(new Redis(config[_0xc28d('0x6')]));require(_0xc28d('0x9'))[_0xc28d('0xa')](socket);function respondWithResult(_0x3a77a5,_0xa6d308){_0xa6d308=_0xa6d308||0xc8;return function(_0x20688d){if(_0x20688d){return _0x3a77a5[_0xc28d('0xb')](_0xa6d308)[_0xc28d('0xc')](_0x20688d);}};}function respondWithFilteredResult(_0x2dbe84,_0x45dbb0){return function(_0x2066f9){if(_0x2066f9){var _0x181e81=typeof _0x45dbb0[_0xc28d('0xd')]===_0xc28d('0xe')&&typeof _0x45dbb0[_0xc28d('0xf')]===_0xc28d('0xe');var _0x1d352a=_0x2066f9['count'];var _0x42cd5f=_0x181e81?0x0:_0x45dbb0['offset'];var _0x48d95f=_0x181e81?_0x2066f9['count']:_0x45dbb0[_0xc28d('0xd')]+_0x45dbb0[_0xc28d('0xf')];var _0x359290;if(_0x48d95f>=_0x1d352a){_0x48d95f=_0x1d352a;_0x359290=0xc8;}else{_0x359290=0xce;}_0x2dbe84[_0xc28d('0xb')](_0x359290);return _0x2dbe84[_0xc28d('0x10')]('Content-Range',_0x42cd5f+'-'+_0x48d95f+'/'+_0x1d352a)[_0xc28d('0xc')](_0x2066f9);}return null;};}function saveUpdates(_0x4799c6){return function(_0x12e36f){if(_0x12e36f){return _0x12e36f[_0xc28d('0x11')](_0x4799c6)[_0xc28d('0x12')](function(_0x1890bb){return _0x1890bb;});}return null;};}function removeEntity(_0xdec0c0){return function(_0x378745){if(_0x378745){return _0x378745[_0xc28d('0x13')]()['then'](function(){var _0x33026f=_0x378745[_0xc28d('0x14')]({'plain':!![]});var _0xb91dbb=_0xc28d('0x15');return db['UserProfileResource'][_0xc28d('0x13')]({'where':{'type':_0xb91dbb,'resourceId':_0x33026f['id']}})['then'](function(){return _0x378745;});})[_0xc28d('0x12')](function(){var _0x5e311a=new Redis(config[_0xc28d('0x6')]);_0x5e311a[_0xc28d('0x16')](_0xc28d('0x17'),JSON[_0xc28d('0x18')]({'id':_0x378745['id'],'deleted':!![]}));})['then'](function(){_0xdec0c0['status'](0xcc)[_0xc28d('0x19')]();});}};}function handleEntityNotFound(_0x1860df){return function(_0x2cc013){if(!_0x2cc013){_0x1860df['sendStatus'](0x194);}return _0x2cc013;};}function handleError(_0x2d1e17,_0x145391){_0x145391=_0x145391||0x1f4;return function(_0x4adb79){logger[_0xc28d('0x1a')](_0x4adb79[_0xc28d('0x1b')]);if(_0x4adb79[_0xc28d('0x1c')]){delete _0x4adb79['name'];}_0x2d1e17[_0xc28d('0xb')](_0x145391)['send'](_0x4adb79);};}exports[_0xc28d('0x1d')]=function(_0x4d677f,_0x16fd27){var _0x508042={},_0x23ae9e={},_0x1e0aa7={'count':0x0,'rows':[]};var _0x5a46eb=_[_0xc28d('0x1e')](db['SquareProject'][_0xc28d('0x1f')],function(_0x37c1ad){return{'name':_0x37c1ad['fieldName'],'type':_0x37c1ad[_0xc28d('0x20')][_0xc28d('0x21')]};});_0x23ae9e[_0xc28d('0x22')]=_['map'](_0x5a46eb,_0xc28d('0x1c'));_0x23ae9e[_0xc28d('0x23')]=_[_0xc28d('0x24')](_0x4d677f[_0xc28d('0x23')]);_0x23ae9e['filters']=_[_0xc28d('0x25')](_0x23ae9e[_0xc28d('0x22')],_0x23ae9e[_0xc28d('0x23')]);_0x508042[_0xc28d('0x26')]=_[_0xc28d('0x25')](_0x23ae9e[_0xc28d('0x22')],qs[_0xc28d('0x27')](_0x4d677f[_0xc28d('0x23')][_0xc28d('0x27')]));_0x508042['attributes']=_0x508042[_0xc28d('0x26')][_0xc28d('0x28')]?_0x508042[_0xc28d('0x26')]:_0x23ae9e[_0xc28d('0x22')];if(!_0x4d677f[_0xc28d('0x23')][_0xc28d('0x29')]('nolimit')){_0x508042['limit']=qs[_0xc28d('0xf')](_0x4d677f[_0xc28d('0x23')][_0xc28d('0xf')]);_0x508042[_0xc28d('0xd')]=qs[_0xc28d('0xd')](_0x4d677f[_0xc28d('0x23')]['offset']);}_0x508042[_0xc28d('0x2a')]=qs[_0xc28d('0x2b')](_0x4d677f[_0xc28d('0x23')][_0xc28d('0x2b')]);_0x508042[_0xc28d('0x2c')]=qs[_0xc28d('0x2d')](_['pick'](_0x4d677f[_0xc28d('0x23')],_0x23ae9e['filters']),_0x5a46eb);if(_0x4d677f[_0xc28d('0x23')][_0xc28d('0x2e')]){_0x508042[_0xc28d('0x2c')]=_[_0xc28d('0x2f')](_0x508042[_0xc28d('0x2c')],{'$or':_['map'](_0x5a46eb,function(_0x3c6c80){if(_0x3c6c80[_0xc28d('0x20')]!==_0xc28d('0x30')){var _0x43a826={};_0x43a826[_0x3c6c80[_0xc28d('0x1c')]]={'$like':'%'+_0x4d677f['query'][_0xc28d('0x2e')]+'%'};return _0x43a826;}})});}_0x508042=_[_0xc28d('0x2f')]({},_0x508042,_0x4d677f[_0xc28d('0x31')]);var _0x11d915={'where':_0x508042[_0xc28d('0x2c')]};return db[_0xc28d('0x32')][_0xc28d('0x33')](_0x11d915)['then'](function(_0x552f1){_0x1e0aa7[_0xc28d('0x33')]=_0x552f1;if(_0x4d677f[_0xc28d('0x23')][_0xc28d('0x34')]){_0x508042[_0xc28d('0x35')]=[{'all':!![]}];}return db[_0xc28d('0x32')][_0xc28d('0x36')](_0x508042);})[_0xc28d('0x12')](function(_0x1d2c18){_0x1e0aa7[_0xc28d('0x37')]=_0x1d2c18;return _0x1e0aa7;})['then'](respondWithFilteredResult(_0x16fd27,_0x508042))[_0xc28d('0x38')](handleError(_0x16fd27,null));};exports['show']=function(_0x266a86,_0x227a81){var _0x374b27={'raw':![],'where':{'id':_0x266a86[_0xc28d('0x39')]['id']}},_0x3888f6={};_0x3888f6[_0xc28d('0x22')]=_['keys'](db[_0xc28d('0x32')]['rawAttributes']);_0x3888f6[_0xc28d('0x23')]=_[_0xc28d('0x24')](_0x266a86[_0xc28d('0x23')]);_0x3888f6['filters']=_[_0xc28d('0x25')](_0x3888f6['model'],_0x3888f6[_0xc28d('0x23')]);_0x374b27[_0xc28d('0x26')]=_[_0xc28d('0x25')](_0x3888f6[_0xc28d('0x22')],qs[_0xc28d('0x27')](_0x266a86[_0xc28d('0x23')][_0xc28d('0x27')]));_0x374b27[_0xc28d('0x26')]=_0x374b27[_0xc28d('0x26')]['length']?_0x374b27[_0xc28d('0x26')]:_0x3888f6[_0xc28d('0x22')];if(_0x266a86[_0xc28d('0x23')][_0xc28d('0x34')]){_0x374b27['include']=[{'all':!![]}];}_0x374b27=_[_0xc28d('0x2f')]({},_0x374b27,_0x266a86[_0xc28d('0x31')]);return db[_0xc28d('0x32')][_0xc28d('0x3a')](_0x374b27)[_0xc28d('0x12')](handleEntityNotFound(_0x227a81,null))[_0xc28d('0x12')](respondWithResult(_0x227a81,null))[_0xc28d('0x38')](handleError(_0x227a81,null));};exports['create']=function(_0xd58b27,_0x18485d){return db['SquareProject'][_0xc28d('0x3b')](_0xd58b27[_0xc28d('0x3c')],{})[_0xc28d('0x12')](function(_0x197659){var _0x453334=_0xd58b27[_0xc28d('0x3d')][_0xc28d('0x14')]({'plain':!![]});if(!_0x453334)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x453334[_0xc28d('0x3e')]===_0xc28d('0x3d')){var _0x123baf=_0x197659[_0xc28d('0x14')]({'plain':!![]});var _0x26ccae=_0xc28d('0x15');return db[_0xc28d('0x3f')][_0xc28d('0x3a')]({'where':{'name':_0x26ccae,'userProfileId':_0x453334[_0xc28d('0x40')]},'raw':!![]})[_0xc28d('0x12')](function(_0x47deb1){if(_0x47deb1&&_0x47deb1[_0xc28d('0x41')]===0x0){return db['UserProfileResource'][_0xc28d('0x3b')]({'name':_0x123baf['name'],'resourceId':_0x123baf['id'],'type':_0x47deb1[_0xc28d('0x1c')],'sectionId':_0x47deb1['id']},{})['then'](function(){return _0x197659;});}else{return _0x197659;}})[_0xc28d('0x38')](function(_0x416b4d){logger[_0xc28d('0x1a')](_0xc28d('0x42'),_0x416b4d);throw _0x416b4d;});}return _0x197659;})['then'](respondWithResult(_0x18485d,0xc9))[_0xc28d('0x38')](handleError(_0x18485d,null));};exports[_0xc28d('0x11')]=function(_0xd1a92f,_0xe5c70){if(_0xd1a92f[_0xc28d('0x3c')]['id']){delete _0xd1a92f['body']['id'];}return db[_0xc28d('0x32')][_0xc28d('0x3a')]({'where':{'id':_0xd1a92f['params']['id']}})['then'](handleEntityNotFound(_0xe5c70,null))[_0xc28d('0x12')](saveUpdates(_0xd1a92f[_0xc28d('0x3c')],null))['then'](function(_0x358967){if(!_0x358967)return;var _0x594588=_0x358967[_0xc28d('0x14')]({'plain':!![]});return _0x594588;})[_0xc28d('0x12')](function(_0x1c1898){var _0x5ce142=new Redis(config[_0xc28d('0x6')]);_0x5ce142['publish'](_0xc28d('0x17'),JSON[_0xc28d('0x18')](_[_0xc28d('0x43')](_0x1c1898,['id',_0xc28d('0x1c'),_0xc28d('0x44')])));return _0x1c1898;})[_0xc28d('0x12')](respondWithResult(_0xe5c70,null))[_0xc28d('0x38')](handleError(_0xe5c70,null));};exports[_0xc28d('0x13')]=function(_0x201889,_0x4057ca){return db[_0xc28d('0x32')][_0xc28d('0x3a')]({'where':{'id':_0x201889['params']['id']}})[_0xc28d('0x12')](handleEntityNotFound(_0x4057ca,null))[_0xc28d('0x12')](removeEntity(_0x4057ca,null))[_0xc28d('0x38')](handleError(_0x4057ca,null));}; \ No newline at end of file +var _0xd8f7=['pick','filter','merge','options','includeAll','params','keys','SquareProject','find','create','body','user','role','UserProfileSection','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','get','lodash','ioredis','api','../../config/environment','../../mysqldb','localhost','socket.io-emitter','./squareProject.socket','register','offset','limit','count','status','Content-Range','json','destroy','then','SquareProjects','UserProfileResource','redis','publish','agi','stringify','end','sendStatus','error','stack','name','send','index','rawAttributes','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','where'];(function(_0x3c9262,_0x2f20d6){var _0x5c6c65=function(_0x420482){while(--_0x420482){_0x3c9262['push'](_0x3c9262['shift']());}};_0x5c6c65(++_0x2f20d6);}(_0xd8f7,0x1c4));var _0x7d8f=function(_0x418bb1,_0x5211a4){_0x418bb1=_0x418bb1-0x0;var _0x111b58=_0xd8f7[_0x418bb1];return _0x111b58;};'use strict';var _=require(_0x7d8f('0x0'));var Redis=require(_0x7d8f('0x1'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x7d8f('0x2'));var config=require(_0x7d8f('0x3'));var db=require(_0x7d8f('0x4'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x7d8f('0x5'),'port':0x18eb});var socket=require(_0x7d8f('0x6'))(new Redis(config['redis']));require(_0x7d8f('0x7'))[_0x7d8f('0x8')](socket);function respondWithResult(_0x395ce6,_0x1c61da){_0x1c61da=_0x1c61da||0xc8;return function(_0x176870){if(_0x176870){return _0x395ce6['status'](_0x1c61da)['json'](_0x176870);}};}function respondWithFilteredResult(_0x2f3264,_0x4e176b){return function(_0x4fa221){if(_0x4fa221){var _0x15f661=typeof _0x4e176b[_0x7d8f('0x9')]==='undefined'&&typeof _0x4e176b[_0x7d8f('0xa')]==='undefined';var _0x3d9ef5=_0x4fa221[_0x7d8f('0xb')];var _0x455ae5=_0x15f661?0x0:_0x4e176b['offset'];var _0x30a16b=_0x15f661?_0x4fa221[_0x7d8f('0xb')]:_0x4e176b[_0x7d8f('0x9')]+_0x4e176b[_0x7d8f('0xa')];var _0x542844;if(_0x30a16b>=_0x3d9ef5){_0x30a16b=_0x3d9ef5;_0x542844=0xc8;}else{_0x542844=0xce;}_0x2f3264[_0x7d8f('0xc')](_0x542844);return _0x2f3264['set'](_0x7d8f('0xd'),_0x455ae5+'-'+_0x30a16b+'/'+_0x3d9ef5)[_0x7d8f('0xe')](_0x4fa221);}return null;};}function saveUpdates(_0x5d3c56){return function(_0x167060){if(_0x167060){return _0x167060['update'](_0x5d3c56)['then'](function(_0x411c08){return _0x411c08;});}return null;};}function removeEntity(_0x19f1d6){return function(_0x3fd81e){if(_0x3fd81e){return _0x3fd81e[_0x7d8f('0xf')]()[_0x7d8f('0x10')](function(){var _0x48c91d=_0x3fd81e['get']({'plain':!![]});var _0x31f4ee=_0x7d8f('0x11');return db[_0x7d8f('0x12')][_0x7d8f('0xf')]({'where':{'type':_0x31f4ee,'resourceId':_0x48c91d['id']}})[_0x7d8f('0x10')](function(){return _0x3fd81e;});})[_0x7d8f('0x10')](function(){var _0x1e3be3=new Redis(config[_0x7d8f('0x13')]);_0x1e3be3[_0x7d8f('0x14')](_0x7d8f('0x15'),JSON[_0x7d8f('0x16')]({'id':_0x3fd81e['id'],'deleted':!![]}));})[_0x7d8f('0x10')](function(){_0x19f1d6[_0x7d8f('0xc')](0xcc)[_0x7d8f('0x17')]();});}};}function handleEntityNotFound(_0x51b037){return function(_0x4fed34){if(!_0x4fed34){_0x51b037[_0x7d8f('0x18')](0x194);}return _0x4fed34;};}function handleError(_0x2f4e82,_0x35d6c1){_0x35d6c1=_0x35d6c1||0x1f4;return function(_0x187f50){logger[_0x7d8f('0x19')](_0x187f50[_0x7d8f('0x1a')]);if(_0x187f50[_0x7d8f('0x1b')]){delete _0x187f50[_0x7d8f('0x1b')];}_0x2f4e82[_0x7d8f('0xc')](_0x35d6c1)[_0x7d8f('0x1c')](_0x187f50);};}exports[_0x7d8f('0x1d')]=function(_0x557f4f,_0x3090c9){var _0x57c8b5={},_0x1ea624={},_0x5d7262={'count':0x0,'rows':[]};var _0x4565f5=_['map'](db['SquareProject'][_0x7d8f('0x1e')],function(_0x9b9ea0){return{'name':_0x9b9ea0['fieldName'],'type':_0x9b9ea0[_0x7d8f('0x1f')][_0x7d8f('0x20')]};});_0x1ea624[_0x7d8f('0x21')]=_[_0x7d8f('0x22')](_0x4565f5,_0x7d8f('0x1b'));_0x1ea624['query']=_['keys'](_0x557f4f[_0x7d8f('0x23')]);_0x1ea624[_0x7d8f('0x24')]=_['intersection'](_0x1ea624['model'],_0x1ea624['query']);_0x57c8b5[_0x7d8f('0x25')]=_[_0x7d8f('0x26')](_0x1ea624[_0x7d8f('0x21')],qs[_0x7d8f('0x27')](_0x557f4f['query'][_0x7d8f('0x27')]));_0x57c8b5[_0x7d8f('0x25')]=_0x57c8b5[_0x7d8f('0x25')][_0x7d8f('0x28')]?_0x57c8b5[_0x7d8f('0x25')]:_0x1ea624[_0x7d8f('0x21')];if(!_0x557f4f[_0x7d8f('0x23')][_0x7d8f('0x29')]('nolimit')){_0x57c8b5[_0x7d8f('0xa')]=qs[_0x7d8f('0xa')](_0x557f4f[_0x7d8f('0x23')][_0x7d8f('0xa')]);_0x57c8b5[_0x7d8f('0x9')]=qs[_0x7d8f('0x9')](_0x557f4f[_0x7d8f('0x23')]['offset']);}_0x57c8b5[_0x7d8f('0x2a')]=qs['sort'](_0x557f4f[_0x7d8f('0x23')]['sort']);_0x57c8b5[_0x7d8f('0x2b')]=qs[_0x7d8f('0x24')](_[_0x7d8f('0x2c')](_0x557f4f[_0x7d8f('0x23')],_0x1ea624[_0x7d8f('0x24')]),_0x4565f5);if(_0x557f4f['query'][_0x7d8f('0x2d')]){_0x57c8b5[_0x7d8f('0x2b')]=_[_0x7d8f('0x2e')](_0x57c8b5['where'],{'$or':_[_0x7d8f('0x22')](_0x4565f5,function(_0x4b0e9b){if(_0x4b0e9b[_0x7d8f('0x1f')]!=='VIRTUAL'){var _0x53b74a={};_0x53b74a[_0x4b0e9b['name']]={'$like':'%'+_0x557f4f['query']['filter']+'%'};return _0x53b74a;}})});}_0x57c8b5=_[_0x7d8f('0x2e')]({},_0x57c8b5,_0x557f4f[_0x7d8f('0x2f')]);var _0x1e4b67={'where':_0x57c8b5['where']};return db['SquareProject']['count'](_0x1e4b67)[_0x7d8f('0x10')](function(_0x35e10e){_0x5d7262[_0x7d8f('0xb')]=_0x35e10e;if(_0x557f4f[_0x7d8f('0x23')][_0x7d8f('0x30')]){_0x57c8b5['include']=[{'all':!![]}];}return db['SquareProject']['findAll'](_0x57c8b5);})[_0x7d8f('0x10')](function(_0x3e0ca3){_0x5d7262['rows']=_0x3e0ca3;return _0x5d7262;})['then'](respondWithFilteredResult(_0x3090c9,_0x57c8b5))['catch'](handleError(_0x3090c9,null));};exports['show']=function(_0x36bf58,_0x18c7c8){var _0x45cd62={'raw':![],'where':{'id':_0x36bf58[_0x7d8f('0x31')]['id']}},_0x2f2e11={};_0x2f2e11['model']=_[_0x7d8f('0x32')](db[_0x7d8f('0x33')][_0x7d8f('0x1e')]);_0x2f2e11[_0x7d8f('0x23')]=_[_0x7d8f('0x32')](_0x36bf58['query']);_0x2f2e11[_0x7d8f('0x24')]=_[_0x7d8f('0x26')](_0x2f2e11[_0x7d8f('0x21')],_0x2f2e11[_0x7d8f('0x23')]);_0x45cd62['attributes']=_[_0x7d8f('0x26')](_0x2f2e11[_0x7d8f('0x21')],qs[_0x7d8f('0x27')](_0x36bf58['query']['fields']));_0x45cd62[_0x7d8f('0x25')]=_0x45cd62[_0x7d8f('0x25')]['length']?_0x45cd62[_0x7d8f('0x25')]:_0x2f2e11[_0x7d8f('0x21')];if(_0x36bf58[_0x7d8f('0x23')][_0x7d8f('0x30')]){_0x45cd62['include']=[{'all':!![]}];}_0x45cd62=_['merge']({},_0x45cd62,_0x36bf58['options']);return db[_0x7d8f('0x33')][_0x7d8f('0x34')](_0x45cd62)[_0x7d8f('0x10')](handleEntityNotFound(_0x18c7c8,null))[_0x7d8f('0x10')](respondWithResult(_0x18c7c8,null))['catch'](handleError(_0x18c7c8,null));};exports['create']=function(_0x1fda61,_0x553ddc){return db[_0x7d8f('0x33')][_0x7d8f('0x35')](_0x1fda61[_0x7d8f('0x36')],{})[_0x7d8f('0x10')](function(_0x371c7c){var _0xf941c4=_0x1fda61[_0x7d8f('0x37')]['get']({'plain':!![]});if(!_0xf941c4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xf941c4[_0x7d8f('0x38')]===_0x7d8f('0x37')){var _0x4015f3=_0x371c7c['get']({'plain':!![]});var _0x4efd06=_0x7d8f('0x11');return db[_0x7d8f('0x39')][_0x7d8f('0x34')]({'where':{'name':_0x4efd06,'userProfileId':_0xf941c4['userProfileId']},'raw':!![]})[_0x7d8f('0x10')](function(_0x4ed186){if(_0x4ed186&&_0x4ed186['autoAssociation']===0x0){return db[_0x7d8f('0x12')][_0x7d8f('0x35')]({'name':_0x4015f3[_0x7d8f('0x1b')],'resourceId':_0x4015f3['id'],'type':_0x4ed186[_0x7d8f('0x1b')],'sectionId':_0x4ed186['id']},{})[_0x7d8f('0x10')](function(){return _0x371c7c;});}else{return _0x371c7c;}})[_0x7d8f('0x3a')](function(_0x46507e){logger[_0x7d8f('0x19')](_0x7d8f('0x3b'),_0x46507e);throw _0x46507e;});}return _0x371c7c;})[_0x7d8f('0x10')](respondWithResult(_0x553ddc,0xc9))[_0x7d8f('0x3a')](handleError(_0x553ddc,null));};exports[_0x7d8f('0x3c')]=function(_0x3c89b2,_0x2ab79b){if(_0x3c89b2[_0x7d8f('0x36')]['id']){delete _0x3c89b2[_0x7d8f('0x36')]['id'];}return db[_0x7d8f('0x33')][_0x7d8f('0x34')]({'where':{'id':_0x3c89b2[_0x7d8f('0x31')]['id']}})[_0x7d8f('0x10')](handleEntityNotFound(_0x2ab79b,null))['then'](saveUpdates(_0x3c89b2[_0x7d8f('0x36')],null))[_0x7d8f('0x10')](function(_0x3e91eb){if(!_0x3e91eb)return;var _0x704535=_0x3e91eb[_0x7d8f('0x3d')]({'plain':!![]});return _0x704535;})['then'](function(_0x5d454f){var _0x1e600a=new Redis(config[_0x7d8f('0x13')]);_0x1e600a['publish'](_0x7d8f('0x15'),JSON[_0x7d8f('0x16')](_['pick'](_0x5d454f,['id','name','production'])));return _0x5d454f;})[_0x7d8f('0x10')](respondWithResult(_0x2ab79b,null))[_0x7d8f('0x3a')](handleError(_0x2ab79b,null));};exports[_0x7d8f('0xf')]=function(_0x25dde3,_0x179240){return db[_0x7d8f('0x33')][_0x7d8f('0x34')]({'where':{'id':_0x25dde3[_0x7d8f('0x31')]['id']}})[_0x7d8f('0x10')](handleEntityNotFound(_0x179240,null))[_0x7d8f('0x10')](removeEntity(_0x179240,null))[_0x7d8f('0x3a')](handleError(_0x179240,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index c5f8c8f..5eeb8d7 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 _0x8ede=['remove','emit','hasOwnProperty','hook','exports','events','SquareProject','setMaxListeners','save','update'];(function(_0x87d3ec,_0x387888){var _0x5f3f6f=function(_0x5492ac){while(--_0x5492ac){_0x87d3ec['push'](_0x87d3ec['shift']());}};_0x5f3f6f(++_0x387888);}(_0x8ede,0x9b));var _0xe8ed=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ede[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xe8ed('0x0'));var SquareProject=require('../../mysqldb')['db'][_0xe8ed('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xe8ed('0x2')](0x0);var events={'afterCreate':_0xe8ed('0x3'),'afterUpdate':_0xe8ed('0x4'),'afterDestroy':_0xe8ed('0x5')};function emitEvent(_0x5cc94f){return function(_0x217178,_0x3bdc2a,_0x5bd131){SquareProjectEvents[_0xe8ed('0x6')](_0x5cc94f+':'+_0x217178['id'],_0x217178);SquareProjectEvents['emit'](_0x5cc94f,_0x217178);_0x5bd131(null);};}for(var e in events){if(events[_0xe8ed('0x7')](e)){var event=events[e];SquareProject[_0xe8ed('0x8')](e,emitEvent(event));}}module[_0xe8ed('0x9')]=SquareProjectEvents; \ No newline at end of file +var _0xe745=['emit','hasOwnProperty','hook','events','../../mysqldb','SquareProject','save','update','remove'];(function(_0x26b5ff,_0x92009a){var _0x58603e=function(_0x4454ff){while(--_0x4454ff){_0x26b5ff['push'](_0x26b5ff['shift']());}};_0x58603e(++_0x92009a);}(_0xe745,0x93));var _0x5e74=function(_0x2b7951,_0x3ad12c){_0x2b7951=_0x2b7951-0x0;var _0x208337=_0xe745[_0x2b7951];return _0x208337;};'use strict';var EventEmitter=require(_0x5e74('0x0'));var SquareProject=require(_0x5e74('0x1'))['db'][_0x5e74('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5e74('0x3'),'afterUpdate':_0x5e74('0x4'),'afterDestroy':_0x5e74('0x5')};function emitEvent(_0xacdc11){return function(_0xcdf0e,_0x4eb59e,_0x5cbe2a){SquareProjectEvents[_0x5e74('0x6')](_0xacdc11+':'+_0xcdf0e['id'],_0xcdf0e);SquareProjectEvents[_0x5e74('0x6')](_0xacdc11,_0xcdf0e);_0x5cbe2a(null);};}for(var e in events){if(events[_0x5e74('0x7')](e)){var event=events[e];SquareProject[_0x5e74('0x8')](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 5e2bd95..7a07bdc 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 _0xb549=['./squareProject.attributes','define','SquareProject','square_projects','preproduction','savedAt','format','changed','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x302f36,_0xc9b92d){var _0x2f2916=function(_0x1be760){while(--_0x1be760){_0x302f36['push'](_0x302f36['shift']());}};_0x2f2916(++_0xc9b92d);}(_0xb549,0x118));var _0x9b54=function(_0x22213c,_0x1c9580){_0x22213c=_0x22213c-0x0;var _0x3cab05=_0xb549[_0x22213c];return _0x3cab05;};'use strict';var _=require(_0x9b54('0x0'));var util=require('util');var logger=require(_0x9b54('0x1'))(_0x9b54('0x2'));var moment=require(_0x9b54('0x3'));var BPromise=require(_0x9b54('0x4'));var rp=require(_0x9b54('0x5'));var fs=require('fs');var path=require(_0x9b54('0x6'));var rimraf=require(_0x9b54('0x7'));var config=require(_0x9b54('0x8'));var attributes=require(_0x9b54('0x9'));module['exports']=function(_0x45fb02,_0xe594e2){return _0x45fb02[_0x9b54('0xa')](_0x9b54('0xb'),attributes,{'tableName':_0x9b54('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x163d57,_0x3db8e0,_0x34eab7){if(_0x163d57['changed'](_0x9b54('0xd'))){_0x163d57[_0x9b54('0xe')]=moment()[_0x9b54('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x163d57[_0x9b54('0x10')]('production')){_0x163d57['publishedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x34eab7(null,_0x163d57);}}});}; \ No newline at end of file +var _0xc17c=['request-promise','path','rimraf','../../config/environment','exports','define','SquareProject','square_projects','changed','preproduction','savedAt','YYYY-MM-DD\x20HH:mm:ss','publishedAt','format','lodash','util','../../config/logger','bluebird'];(function(_0x2dc171,_0x1dadb7){var _0x1373b1=function(_0x4935a9){while(--_0x4935a9){_0x2dc171['push'](_0x2dc171['shift']());}};_0x1373b1(++_0x1dadb7);}(_0xc17c,0x8c));var _0xcc17=function(_0x12bebf,_0xc9d433){_0x12bebf=_0x12bebf-0x0;var _0x19e77a=_0xc17c[_0x12bebf];return _0x19e77a;};'use strict';var _=require(_0xcc17('0x0'));var util=require(_0xcc17('0x1'));var logger=require(_0xcc17('0x2'))('api');var moment=require('moment');var BPromise=require(_0xcc17('0x3'));var rp=require(_0xcc17('0x4'));var fs=require('fs');var path=require(_0xcc17('0x5'));var rimraf=require(_0xcc17('0x6'));var config=require(_0xcc17('0x7'));var attributes=require('./squareProject.attributes');module[_0xcc17('0x8')]=function(_0x5cb235,_0x1e1c74){return _0x5cb235[_0xcc17('0x9')](_0xcc17('0xa'),attributes,{'tableName':_0xcc17('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5be3c8,_0xa4d768,_0x4b516e){if(_0x5be3c8[_0xcc17('0xc')](_0xcc17('0xd'))){_0x5be3c8[_0xcc17('0xe')]=moment()['format'](_0xcc17('0xf'));}if(_0x5be3c8[_0xcc17('0xc')]('production')){_0x5be3c8[_0xcc17('0x10')]=moment()[_0xcc17('0x11')](_0xcc17('0xf'));}_0x4b516e(null,_0x5be3c8);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index f13c663..1256b9c 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 _0x649b=['model','attributes','map','then','info','GetSquareProjects','debug','stringify','catch','error','message','ShowSquareProject','SquareProject','find','lodash','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','redis','defaults','socket.io-emitter','options','where','limit','include'];(function(_0x256851,_0x50f1a3){var _0x1db300=function(_0x322d11){while(--_0x322d11){_0x256851['push'](_0x256851['shift']());}};_0x1db300(++_0x50f1a3);}(_0x649b,0x95));var _0xb649=function(_0x439dcb,_0x58337e){_0x439dcb=_0x439dcb-0x0;var _0xb73461=_0x649b[_0x439dcb];return _0xb73461;};'use strict';var _=require(_0xb649('0x0'));var Redis=require(_0xb649('0x1'));var db=require(_0xb649('0x2'))['db'];var logger=require(_0xb649('0x3'))(_0xb649('0x4'));var config=require(_0xb649('0x5'));config[_0xb649('0x6')]=_[_0xb649('0x7')](config[_0xb649('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0xb649('0x8'))(new Redis(config['redis']));require('./squareProject.socket')['register'](socket);exports['GetSquareProjects']=function(_0x4f03c6){var _0x4de1eb=this;return new Promise(function(_0x2b0257,_0x58203e){return db['SquareProject']['findAll']({'raw':_0x4f03c6[_0xb649('0x9')]?_0x4f03c6[_0xb649('0x9')]['raw']===undefined?!![]:![]:!![],'where':_0x4f03c6['options']?_0x4f03c6[_0xb649('0x9')][_0xb649('0xa')]||null:null,'attributes':_0x4f03c6[_0xb649('0x9')]?_0x4f03c6['options']['attributes']||null:null,'limit':_0x4f03c6[_0xb649('0x9')]?_0x4f03c6[_0xb649('0x9')][_0xb649('0xb')]||null:null,'include':_0x4f03c6[_0xb649('0x9')]?_0x4f03c6[_0xb649('0x9')]['include']?_['map'](_0x4f03c6[_0xb649('0x9')][_0xb649('0xc')],function(_0x5f11df){return{'model':db[_0x5f11df[_0xb649('0xd')]],'as':_0x5f11df['as'],'attributes':_0x5f11df[_0xb649('0xe')],'include':_0x5f11df[_0xb649('0xc')]?_[_0xb649('0xf')](_0x5f11df[_0xb649('0xc')],function(_0x312397){return{'model':db[_0x312397['model']],'as':_0x312397['as'],'attributes':_0x312397['attributes'],'include':_0x312397['include']?_['map'](_0x312397[_0xb649('0xc')],function(_0x47f91f){return{'model':db[_0x47f91f[_0xb649('0xd')]],'as':_0x47f91f['as'],'attributes':_0x47f91f[_0xb649('0xe')]};}):[]};}):[]};}):[]:[]})[_0xb649('0x10')](function(_0xc4fd73){logger[_0xb649('0x11')](_0xb649('0x12'),_0x4f03c6);logger[_0xb649('0x13')](_0xb649('0x12'),_0x4f03c6,JSON[_0xb649('0x14')](_0xc4fd73));_0x2b0257(_0xc4fd73);})[_0xb649('0x15')](function(_0x1dc4f3){logger[_0xb649('0x16')](_0xb649('0x12'),_0x1dc4f3[_0xb649('0x17')],_0x4f03c6);_0x58203e(_0x4de1eb[_0xb649('0x16')](0x1f4,_0x1dc4f3['message']));});});};exports[_0xb649('0x18')]=function(_0x1b97e4){var _0x4a8f5e=this;return new Promise(function(_0x5c2c86,_0x410c2e){return db[_0xb649('0x19')][_0xb649('0x1a')]({'raw':_0x1b97e4[_0xb649('0x9')]?_0x1b97e4[_0xb649('0x9')]['raw']===undefined?!![]:![]:!![],'where':_0x1b97e4['options']?_0x1b97e4[_0xb649('0x9')]['where']||null:null,'attributes':_0x1b97e4[_0xb649('0x9')]?_0x1b97e4['options'][_0xb649('0xe')]||null:null,'include':_0x1b97e4[_0xb649('0x9')]?_0x1b97e4[_0xb649('0x9')][_0xb649('0xc')]?_[_0xb649('0xf')](_0x1b97e4[_0xb649('0x9')][_0xb649('0xc')],function(_0x57b388){return{'model':db[_0x57b388[_0xb649('0xd')]],'as':_0x57b388['as'],'attributes':_0x57b388[_0xb649('0xe')],'include':_0x57b388[_0xb649('0xc')]?_[_0xb649('0xf')](_0x57b388[_0xb649('0xc')],function(_0x261c9d){return{'model':db[_0x261c9d[_0xb649('0xd')]],'as':_0x261c9d['as'],'attributes':_0x261c9d[_0xb649('0xe')],'include':_0x261c9d['include']?_['map'](_0x261c9d['include'],function(_0x374d24){return{'model':db[_0x374d24['model']],'as':_0x374d24['as'],'attributes':_0x374d24['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1a4bc4){logger[_0xb649('0x11')](_0xb649('0x18'),_0x1b97e4);logger['debug'](_0xb649('0x18'),_0x1b97e4,JSON[_0xb649('0x14')](_0x1a4bc4));_0x5c2c86(_0x1a4bc4);})[_0xb649('0x15')](function(_0xa8d078){logger[_0xb649('0x16')](_0xb649('0x18'),_0xa8d078['message'],_0x1b97e4);_0x410c2e(_0x4a8f5e[_0xb649('0x16')](0x1f4,_0xa8d078['message']));});});}; \ No newline at end of file +var _0x1583=['where','lodash','../../mysqldb','../../config/logger','rpc','../../config/environment','redis','socket.io-emitter','./squareProject.socket','register','GetSquareProjects','SquareProject','findAll','options','attributes','limit','include','map','model','then','info','debug','stringify','catch','message','error','ShowSquareProject','raw'];(function(_0x52bb1e,_0x47c818){var _0x15d57d=function(_0x551cd3){while(--_0x551cd3){_0x52bb1e['push'](_0x52bb1e['shift']());}};_0x15d57d(++_0x47c818);}(_0x1583,0x119));var _0x3158=function(_0x16daf2,_0x2353a9){_0x16daf2=_0x16daf2-0x0;var _0x48a0f1=_0x1583[_0x16daf2];return _0x48a0f1;};'use strict';var _=require(_0x3158('0x0'));var Redis=require('ioredis');var db=require(_0x3158('0x1'))['db'];var logger=require(_0x3158('0x2'))(_0x3158('0x3'));var config=require(_0x3158('0x4'));config['redis']=_['defaults'](config[_0x3158('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0x3158('0x6'))(new Redis(config[_0x3158('0x5')]));require(_0x3158('0x7'))[_0x3158('0x8')](socket);exports[_0x3158('0x9')]=function(_0x32a383){var _0x1ad66c=this;return new Promise(function(_0x2e07d4,_0x57b0c1){return db[_0x3158('0xa')][_0x3158('0xb')]({'raw':_0x32a383['options']?_0x32a383[_0x3158('0xc')]['raw']===undefined?!![]:![]:!![],'where':_0x32a383[_0x3158('0xc')]?_0x32a383[_0x3158('0xc')]['where']||null:null,'attributes':_0x32a383[_0x3158('0xc')]?_0x32a383['options'][_0x3158('0xd')]||null:null,'limit':_0x32a383[_0x3158('0xc')]?_0x32a383[_0x3158('0xc')][_0x3158('0xe')]||null:null,'include':_0x32a383[_0x3158('0xc')]?_0x32a383[_0x3158('0xc')][_0x3158('0xf')]?_[_0x3158('0x10')](_0x32a383['options'][_0x3158('0xf')],function(_0x9a29a8){return{'model':db[_0x9a29a8['model']],'as':_0x9a29a8['as'],'attributes':_0x9a29a8[_0x3158('0xd')],'include':_0x9a29a8[_0x3158('0xf')]?_[_0x3158('0x10')](_0x9a29a8[_0x3158('0xf')],function(_0x1592f6){return{'model':db[_0x1592f6['model']],'as':_0x1592f6['as'],'attributes':_0x1592f6['attributes'],'include':_0x1592f6[_0x3158('0xf')]?_[_0x3158('0x10')](_0x1592f6['include'],function(_0x189220){return{'model':db[_0x189220[_0x3158('0x11')]],'as':_0x189220['as'],'attributes':_0x189220[_0x3158('0xd')]};}):[]};}):[]};}):[]:[]})[_0x3158('0x12')](function(_0x1a66c6){logger[_0x3158('0x13')]('GetSquareProjects',_0x32a383);logger[_0x3158('0x14')](_0x3158('0x9'),_0x32a383,JSON[_0x3158('0x15')](_0x1a66c6));_0x2e07d4(_0x1a66c6);})[_0x3158('0x16')](function(_0xb99df8){logger['error'](_0x3158('0x9'),_0xb99df8[_0x3158('0x17')],_0x32a383);_0x57b0c1(_0x1ad66c[_0x3158('0x18')](0x1f4,_0xb99df8[_0x3158('0x17')]));});});};exports[_0x3158('0x19')]=function(_0x5be6ca){var _0x19c2ad=this;return new Promise(function(_0x164ea4,_0x544e87){return db[_0x3158('0xa')]['find']({'raw':_0x5be6ca[_0x3158('0xc')]?_0x5be6ca[_0x3158('0xc')][_0x3158('0x1a')]===undefined?!![]:![]:!![],'where':_0x5be6ca[_0x3158('0xc')]?_0x5be6ca['options'][_0x3158('0x1b')]||null:null,'attributes':_0x5be6ca[_0x3158('0xc')]?_0x5be6ca[_0x3158('0xc')][_0x3158('0xd')]||null:null,'include':_0x5be6ca[_0x3158('0xc')]?_0x5be6ca[_0x3158('0xc')][_0x3158('0xf')]?_[_0x3158('0x10')](_0x5be6ca['options'][_0x3158('0xf')],function(_0x11b3db){return{'model':db[_0x11b3db[_0x3158('0x11')]],'as':_0x11b3db['as'],'attributes':_0x11b3db[_0x3158('0xd')],'include':_0x11b3db['include']?_[_0x3158('0x10')](_0x11b3db['include'],function(_0x3d1241){return{'model':db[_0x3d1241[_0x3158('0x11')]],'as':_0x3d1241['as'],'attributes':_0x3d1241['attributes'],'include':_0x3d1241['include']?_[_0x3158('0x10')](_0x3d1241[_0x3158('0xf')],function(_0x16fd14){return{'model':db[_0x16fd14[_0x3158('0x11')]],'as':_0x16fd14['as'],'attributes':_0x16fd14['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2b0ccf){logger['info']('ShowSquareProject',_0x5be6ca);logger[_0x3158('0x14')](_0x3158('0x19'),_0x5be6ca,JSON[_0x3158('0x15')](_0x2b0ccf));_0x164ea4(_0x2b0ccf);})[_0x3158('0x16')](function(_0x284781){logger[_0x3158('0x18')](_0x3158('0x19'),_0x284781['message'],_0x5be6ca);_0x544e87(_0x19c2ad[_0x3158('0x18')](0x1f4,_0x284781[_0x3158('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 8f28273..31c0acb 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 _0x113f=['squareProject:','remove','emit','register','length'];(function(_0x4525e0,_0xf6062d){var _0x567fd4=function(_0x2539d3){while(--_0x2539d3){_0x4525e0['push'](_0x4525e0['shift']());}};_0x567fd4(++_0xf6062d);}(_0x113f,0x79));var _0xf113=function(_0x47335d,_0x2c3f8e){_0x47335d=_0x47335d-0x0;var _0x418629=_0x113f[_0x47335d];return _0x418629;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=['save',_0xf113('0x0'),'update'];function createListener(_0x564d49,_0x359141){return function(_0x409696){_0x359141[_0xf113('0x1')](_0x564d49,_0x409696);};}function removeListener(_0x16833a,_0x482b0e){return function(){SquareProjectEvents['removeListener'](_0x16833a,_0x482b0e);};}exports[_0xf113('0x2')]=function(_0x16cac8){for(var _0x35290b=0x0,_0x543b9f=events[_0xf113('0x3')];_0x35290b<_0x543b9f;_0x35290b++){var _0x313050=events[_0x35290b];var _0x1937bc=createListener(_0xf113('0x4')+_0x313050,_0x16cac8);SquareProjectEvents['on'](_0x313050,_0x1937bc);}}; \ No newline at end of file +var _0x4341=['squareProject:','./squareProject.events','remove','update','emit','register','length'];(function(_0xfc0976,_0x33776f){var _0x23579f=function(_0x4143d9){while(--_0x4143d9){_0xfc0976['push'](_0xfc0976['shift']());}};_0x23579f(++_0x33776f);}(_0x4341,0xa9));var _0x1434=function(_0x2f41dd,_0x5bd3a1){_0x2f41dd=_0x2f41dd-0x0;var _0x3b377d=_0x4341[_0x2f41dd];return _0x3b377d;};'use strict';var SquareProjectEvents=require(_0x1434('0x0'));var events=['save',_0x1434('0x1'),_0x1434('0x2')];function createListener(_0x50e76c,_0x152aee){return function(_0x5c9623){_0x152aee[_0x1434('0x3')](_0x50e76c,_0x5c9623);};}function removeListener(_0x510a61,_0x22ece4){return function(){SquareProjectEvents['removeListener'](_0x510a61,_0x22ece4);};}exports[_0x1434('0x4')]=function(_0x541321){for(var _0x5a21f7=0x0,_0x10a581=events[_0x1434('0x5')];_0x5a21f7<_0x10a581;_0x5a21f7++){var _0x60f32=events[_0x5a21f7];var _0x38e2e7=createListener(_0x1434('0x6')+_0x60f32,_0x541321);SquareProjectEvents['on'](_0x60f32,_0x38e2e7);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index bf6eabb..4fcc3f3 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 _0x7a54=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','index','/:id','isAuthenticated','post','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x2b8475,_0x118959){var _0x557a74=function(_0x35b6fa){while(--_0x35b6fa){_0x2b8475['push'](_0x2b8475['shift']());}};_0x557a74(++_0x118959);}(_0x7a54,0x106));var _0x47a5=function(_0xaba9a2,_0x1198cd){_0xaba9a2=_0xaba9a2-0x0;var _0x457f4f=_0x7a54[_0xaba9a2];return _0x457f4f;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0x9')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x47a5('0xd')]('/',auth[_0x47a5('0xc')](),controller['create']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);module[_0x47a5('0x12')]=router; \ No newline at end of file +var _0x53ec=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./squareRecording.controller','isAuthenticated','get','/:id','show','/:id/download','download','post','create','put'];(function(_0x522cb5,_0x6d9217){var _0xae2366=function(_0x3ab795){while(--_0x3ab795){_0x522cb5['push'](_0x522cb5['shift']());}};_0xae2366(++_0x6d9217);}(_0x53ec,0x192));var _0xc53e=function(_0x51046e,_0x46e77d){_0x51046e=_0x51046e-0x0;var _0x694f90=_0x53ec[_0x51046e];return _0x694f90;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get']('/',auth[_0xc53e('0x9')](),controller['index']);router[_0xc53e('0xa')](_0xc53e('0xb'),auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xa')](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0xe')]);router[_0xc53e('0xf')]('/',auth[_0xc53e('0x9')](),controller[_0xc53e('0x10')]);router[_0xc53e('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xc53e('0x12')]);router['delete']('/:id',auth[_0xc53e('0x9')](),controller[_0xc53e('0x13')]);module[_0xc53e('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index ba7a266..2c61c7e 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 _0x0e85=['STRING','getDataValue','savePath','substring','lastIndexOf','sequelize','exports'];(function(_0x408ce5,_0x2073b0){var _0x1a419a=function(_0x38e918){while(--_0x38e918){_0x408ce5['push'](_0x408ce5['shift']());}};_0x1a419a(++_0x2073b0);}(_0x0e85,0x7c));var _0x50e8=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0x0e85[_0x307d86];return _0x361745;};'use strict';var Sequelize=require(_0x50e8('0x0'));module[_0x50e8('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x50e8('0x2')]},'calleridname':{'type':Sequelize[_0x50e8('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x50e8('0x2')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x50e8('0x2')]},'saveName':{'type':Sequelize[_0x50e8('0x2')]},'filename':{'type':Sequelize[_0x50e8('0x2')]},'savePath':{'type':Sequelize[_0x50e8('0x2')]},'format':{'type':Sequelize['VIRTUAL'],'get':function(){var _0x3ce904='';var _0x108edc=this[_0x50e8('0x3')](_0x50e8('0x4'));if(_0x108edc){_0x3ce904=_0x108edc[_0x50e8('0x5')](_0x108edc[_0x50e8('0x6')]('.'));}return _0x3ce904;}}}; \ No newline at end of file +var _0x1cb9=['STRING','VIRTUAL','getDataValue','substring','sequelize'];(function(_0x4cba43,_0x284c64){var _0x4e8617=function(_0x25e560){while(--_0x25e560){_0x4cba43['push'](_0x4cba43['shift']());}};_0x4e8617(++_0x284c64);}(_0x1cb9,0x14e));var _0x91cb=function(_0x21884b,_0x541a02){_0x21884b=_0x21884b-0x0;var _0x56554d=_0x1cb9[_0x21884b];return _0x56554d;};'use strict';var Sequelize=require(_0x91cb('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x91cb('0x1')]},'callerid':{'type':Sequelize[_0x91cb('0x1')]},'calleridname':{'type':Sequelize[_0x91cb('0x1')]},'context':{'type':Sequelize[_0x91cb('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x91cb('0x1')]},'accountcode':{'type':Sequelize[_0x91cb('0x1')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x91cb('0x1')]},'saveName':{'type':Sequelize[_0x91cb('0x1')]},'filename':{'type':Sequelize[_0x91cb('0x1')]},'savePath':{'type':Sequelize[_0x91cb('0x1')]},'format':{'type':Sequelize[_0x91cb('0x2')],'get':function(){var _0x8f8a3b='';var _0x4c1f56=this[_0x91cb('0x3')]('savePath');if(_0x4c1f56){_0x8f8a3b=_0x4c1f56[_0x91cb('0x4')](_0x4c1f56['lastIndexOf']('.'));}return _0x8f8a3b;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 692db82..aee9bd9 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 _0x552d=['decryptFile','recording','Sequelize','SquareRecording\x20not\x20found','extname','unlink','message','Not\x20found','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','error','name','send','index','map','SquareRecording','rawAttributes','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','type','options','count','includeAll','include','findAll','catch','length','find','create','body','download','../../components/encryptor','uniqueid','params','filename','savePath','format','existsSync'];(function(_0x21b62a,_0x592986){var _0x35e8ce=function(_0x278b73){while(--_0x278b73){_0x21b62a['push'](_0x21b62a['shift']());}};_0x35e8ce(++_0x592986);}(_0x552d,0x123));var _0xd552=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x552d[_0x46698a];return _0x356db0;};'use strict';var emlformat=require(_0xd552('0x0'));var rimraf=require(_0xd552('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd552('0x2'));var rp=require(_0xd552('0x3'));var moment=require('moment');var BPromise=require(_0xd552('0x4'));var Mustache=require(_0xd552('0x5'));var util=require('util');var path=require(_0xd552('0x6'));var sox=require(_0xd552('0x7'));var csv=require(_0xd552('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd552('0x9'));var _=require('lodash');var squel=require(_0xd552('0xa'));var crypto=require('crypto');var jsforce=require(_0xd552('0xb'));var deskjs=require(_0xd552('0xc'));var toCsv=require(_0xd552('0x8'));var querystring=require('querystring');var Papa=require(_0xd552('0xd'));var Redis=require(_0xd552('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd552('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd552('0x10'))(_0xd552('0x11'));var utils=require(_0xd552('0x12'));var config=require(_0xd552('0x13'));var licenseUtil=require(_0xd552('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d27b4,_0x29f4c0){_0x29f4c0=_0x29f4c0||0xcc;return function(_0x1a8967){if(_0x1a8967){return _0x3d27b4[_0xd552('0x15')](_0x29f4c0);}return _0x3d27b4[_0xd552('0x16')](_0x29f4c0)[_0xd552('0x17')]();};}function respondWithResult(_0x582217,_0x4b791f){_0x4b791f=_0x4b791f||0xc8;return function(_0x5827b6){if(_0x5827b6){return _0x582217[_0xd552('0x16')](_0x4b791f)[_0xd552('0x18')](_0x5827b6);}};}function respondWithFilteredResult(_0x2b0687,_0x3509a9){return function(_0x47e7ea){if(_0x47e7ea){var _0x4de1e4=typeof _0x3509a9[_0xd552('0x19')]===_0xd552('0x1a')&&typeof _0x3509a9[_0xd552('0x1b')]==='undefined';var _0x4039c8=_0x47e7ea['count'];var _0x449543=_0x4de1e4?0x0:_0x3509a9['offset'];var _0x5c2206=_0x4de1e4?_0x47e7ea['count']:_0x3509a9[_0xd552('0x19')]+_0x3509a9['limit'];var _0xda7c6f;if(_0x5c2206>=_0x4039c8){_0x5c2206=_0x4039c8;_0xda7c6f=0xc8;}else{_0xda7c6f=0xce;}_0x2b0687[_0xd552('0x16')](_0xda7c6f);return _0x2b0687[_0xd552('0x1c')](_0xd552('0x1d'),_0x449543+'-'+_0x5c2206+'/'+_0x4039c8)[_0xd552('0x18')](_0x47e7ea);}return null;};}function patchUpdates(_0x2d7891){return function(_0x15b149){try{jsonpatch[_0xd552('0x1e')](_0x15b149,_0x2d7891,!![]);}catch(_0x2aed21){return BPromise[_0xd552('0x1f')](_0x2aed21);}return _0x15b149[_0xd552('0x20')]();};}function saveUpdates(_0x39c0ff,_0x4c6d59){return function(_0x2eb89e){if(_0x2eb89e){return _0x2eb89e[_0xd552('0x21')](_0x39c0ff)['then'](function(_0x585ed2){return _0x585ed2;});}return null;};}function removeEntity(_0x42f6e1,_0x14e0d7){return function(_0x54273f){if(_0x54273f){return _0x54273f['destroy']()[_0xd552('0x22')](function(){_0x42f6e1[_0xd552('0x16')](0xcc)[_0xd552('0x17')]();});}};}function handleEntityNotFound(_0x37de17,_0x4dc7b4){return function(_0x1a5bcf){if(!_0x1a5bcf){_0x37de17['sendStatus'](0x194);}return _0x1a5bcf;};}function handleError(_0x15f905,_0x55818d){_0x55818d=_0x55818d||0x1f4;return function(_0x486917){logger[_0xd552('0x23')](_0x486917['stack']);if(_0x486917[_0xd552('0x24')]){delete _0x486917['name'];}_0x15f905[_0xd552('0x16')](_0x55818d)[_0xd552('0x25')](_0x486917);};}exports[_0xd552('0x26')]=function(_0x328d46,_0x5a904c){var _0x361440={},_0x558013={},_0x1a70ef={'count':0x0,'rows':[]};var _0x5b4150=_[_0xd552('0x27')](db[_0xd552('0x28')][_0xd552('0x29')],function(_0x3e0d47){return{'name':_0x3e0d47['fieldName'],'type':_0x3e0d47['type'][_0xd552('0x2a')]};});_0x558013[_0xd552('0x2b')]=_[_0xd552('0x27')](_0x5b4150,_0xd552('0x24'));_0x558013[_0xd552('0x2c')]=_[_0xd552('0x2d')](_0x328d46['query']);_0x558013['filters']=_[_0xd552('0x2e')](_0x558013['model'],_0x558013[_0xd552('0x2c')]);_0x361440['attributes']=_['intersection'](_0x558013[_0xd552('0x2b')],qs[_0xd552('0x2f')](_0x328d46['query'][_0xd552('0x2f')]));_0x361440['attributes']=_0x361440[_0xd552('0x30')]['length']?_0x361440[_0xd552('0x30')]:_0x558013[_0xd552('0x2b')];if(!_0x328d46['query'][_0xd552('0x31')](_0xd552('0x32'))){_0x361440[_0xd552('0x1b')]=qs[_0xd552('0x1b')](_0x328d46[_0xd552('0x2c')][_0xd552('0x1b')]);_0x361440[_0xd552('0x19')]=qs['offset'](_0x328d46[_0xd552('0x2c')][_0xd552('0x19')]);}_0x361440[_0xd552('0x33')]=qs[_0xd552('0x34')](_0x328d46[_0xd552('0x2c')][_0xd552('0x34')]);_0x361440[_0xd552('0x35')]=qs['filters'](_[_0xd552('0x36')](_0x328d46[_0xd552('0x2c')],_0x558013[_0xd552('0x37')]),_0x5b4150);if(_0x328d46[_0xd552('0x2c')][_0xd552('0x38')]){_0x361440[_0xd552('0x35')]=_[_0xd552('0x39')](_0x361440[_0xd552('0x35')],{'$or':_[_0xd552('0x27')](_0x5b4150,function(_0x41db65){if(_0x41db65[_0xd552('0x3a')]!=='VIRTUAL'){var _0x20e5e0={};_0x20e5e0[_0x41db65[_0xd552('0x24')]]={'$like':'%'+_0x328d46[_0xd552('0x2c')]['filter']+'%'};return _0x20e5e0;}})});}_0x361440=_[_0xd552('0x39')]({},_0x361440,_0x328d46[_0xd552('0x3b')]);var _0x22dec0={'where':_0x361440[_0xd552('0x35')]};return db[_0xd552('0x28')][_0xd552('0x3c')](_0x22dec0)['then'](function(_0x3f74dc){_0x1a70ef[_0xd552('0x3c')]=_0x3f74dc;if(_0x328d46[_0xd552('0x2c')][_0xd552('0x3d')]){_0x361440[_0xd552('0x3e')]=[{'all':!![]}];}return db[_0xd552('0x28')][_0xd552('0x3f')](_0x361440);})[_0xd552('0x22')](function(_0x380aba){_0x1a70ef['rows']=_0x380aba;return _0x1a70ef;})[_0xd552('0x22')](respondWithFilteredResult(_0x5a904c,_0x361440))[_0xd552('0x40')](handleError(_0x5a904c,null));};exports['show']=function(_0x429cc2,_0x5cd824){var _0x1414f5={'raw':!![],'where':{'id':_0x429cc2['params']['id']}},_0x12b363={};_0x12b363[_0xd552('0x2b')]=_[_0xd552('0x2d')](db['SquareRecording'][_0xd552('0x29')]);_0x12b363['query']=_['keys'](_0x429cc2['query']);_0x12b363['filters']=_[_0xd552('0x2e')](_0x12b363[_0xd552('0x2b')],_0x12b363[_0xd552('0x2c')]);_0x1414f5['attributes']=_['intersection'](_0x12b363[_0xd552('0x2b')],qs[_0xd552('0x2f')](_0x429cc2[_0xd552('0x2c')][_0xd552('0x2f')]));_0x1414f5[_0xd552('0x30')]=_0x1414f5['attributes'][_0xd552('0x41')]?_0x1414f5[_0xd552('0x30')]:_0x12b363[_0xd552('0x2b')];if(_0x429cc2[_0xd552('0x2c')][_0xd552('0x3d')]){_0x1414f5['include']=[{'all':!![]}];}_0x1414f5=_['merge']({},_0x1414f5,_0x429cc2[_0xd552('0x3b')]);return db['SquareRecording'][_0xd552('0x42')](_0x1414f5)[_0xd552('0x22')](handleEntityNotFound(_0x5cd824,null))[_0xd552('0x22')](respondWithResult(_0x5cd824,null))[_0xd552('0x40')](handleError(_0x5cd824,null));};exports[_0xd552('0x43')]=function(_0x1552ee,_0xc7665a){return db['SquareRecording'][_0xd552('0x43')](_0x1552ee[_0xd552('0x44')],{})[_0xd552('0x22')](respondWithResult(_0xc7665a,0xc9))[_0xd552('0x40')](handleError(_0xc7665a,null));};exports['update']=function(_0x6d45ef,_0x299d26){if(_0x6d45ef['body']['id']){delete _0x6d45ef[_0xd552('0x44')]['id'];}return db['SquareRecording'][_0xd552('0x42')]({'where':{'id':_0x6d45ef['params']['id']}})[_0xd552('0x22')](handleEntityNotFound(_0x299d26,null))[_0xd552('0x22')](saveUpdates(_0x6d45ef[_0xd552('0x44')],null))[_0xd552('0x22')](respondWithResult(_0x299d26,null))[_0xd552('0x40')](handleError(_0x299d26,null));};exports[_0xd552('0x45')]=function(_0x5b0914,_0x11558e,_0x1feefe){var _0x405801=require(_0xd552('0x46'));var _0x28ef28=![];var _0x4b0c61={};if(_0x5b0914[_0xd552('0x2c')]['type']&&_0x5b0914[_0xd552('0x2c')]['type']==='uniqueid'){_0x4b0c61[_0xd552('0x47')]=_0x5b0914[_0xd552('0x48')]['id'];}else{_0x4b0c61['id']=_0x5b0914[_0xd552('0x48')]['id'];}return db[_0xd552('0x28')][_0xd552('0x42')]({'where':_0x4b0c61,'attributes':['id','savePath',_0xd552('0x49')],'raw':!![]})[_0xd552('0x22')](handleEntityNotFound(_0x11558e,null))[_0xd552('0x22')](function(_0x48a007){if(_0x48a007){var _0xba8d9c=_0x48a007[_0xd552('0x4a')];var _0xf61d3b=util[_0xd552('0x4b')]('%s.cypher',_0xba8d9c);if(fs[_0xd552('0x4c')](_0xf61d3b)){_0x28ef28=!![];return _0x405801[_0xd552('0x4d')](_0xf61d3b,_0xba8d9c,config['secrets'][_0xd552('0x4e')])['then'](function(){return _0x48a007;});}return _0x48a007;}})[_0xd552('0x22')](function(_0x4ea566){if(_0x4ea566){var _0xad1c76=_0x4ea566[_0xd552('0x4a')];if(!fs[_0xd552('0x4c')](_0xad1c76)){throw new db[(_0xd552('0x4f'))]['ValidationError'](_0xd552('0x50'));}if(_0x4ea566[_0xd552('0x49')]){return _0x11558e[_0xd552('0x45')](_0xad1c76,_0x4ea566[_0xd552('0x49')]+path[_0xd552('0x51')](_0xad1c76),function(){if(_0x28ef28){fs[_0xd552('0x52')](_0xad1c76);}});}else{return _0x11558e[_0xd552('0x45')](_0xad1c76,function(_0x51ad04){if(_0x28ef28){fs[_0xd552('0x52')](_0xad1c76);}});}}})[_0xd552('0x40')](function(_0x297638){if(_0x297638[_0xd552('0x53')]===_0xd552('0x50')){_0x11558e[_0xd552('0x16')](0x194)[_0xd552('0x25')](_0xd552('0x54'));}else{return handleError(_0x11558e,null);}});};exports[_0xd552('0x55')]=function(_0x5c45a1,_0x330c3d){return db[_0xd552('0x28')]['find']({'where':{'id':_0x5c45a1[_0xd552('0x48')]['id']}})[_0xd552('0x22')](function(_0x501be3){if(_[_0xd552('0x56')](_0x501be3)){throw new ReferenceError(_0xd552('0x57'));}return _0x501be3;})[_0xd552('0x22')](function(_0x516786){var _0x44875b=_0x516786[_0xd552('0x4a')];logger[_0xd552('0x58')](_0xd552('0x59'),_0x44875b);if(!_[_0xd552('0x56')](_0x516786[_0xd552('0x4a')])&&fs[_0xd552('0x4c')](_0x44875b)){logger[_0xd552('0x58')](_0xd552('0x5a')+_0x44875b+_0xd552('0x5b'));fs['unlinkSync'](_0x44875b);}_0x44875b=_0x44875b+'.cypher';if(!_[_0xd552('0x56')](_0x516786[_0xd552('0x4a')])&&fs[_0xd552('0x4c')](_0x44875b)){logger[_0xd552('0x58')](_0xd552('0x5a')+_0x44875b+_0xd552('0x5b'));fs['unlinkSync'](_0x44875b);}return _0x516786;})[_0xd552('0x22')](function(_0x3a79ea){if(!_0x3a79ea)throw new InternalError();return _0x3a79ea[_0xd552('0x55')]();})[_0xd552('0x22')](function(){_0x330c3d[_0xd552('0x16')](0xcc)[_0xd552('0x17')]();})[_0xd552('0x40')](handleError(_0x330c3d,null));}; \ No newline at end of file +var _0x7ea8=['../../components/encryptor','uniqueid','savePath','format','%s.cypher','existsSync','decryptFile','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','filename','download','extname','unlink','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','status','name','send','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','SquareRecording','findAll','rows','catch','intersection','includeAll','include','find','create','body','params'];(function(_0x3634d8,_0xbfa70b){var _0x2c1369=function(_0x27b79a){while(--_0x27b79a){_0x3634d8['push'](_0x3634d8['shift']());}};_0x2c1369(++_0xbfa70b);}(_0x7ea8,0x1b4));var _0x87ea=function(_0xb8d96e,_0x15fb2c){_0xb8d96e=_0xb8d96e-0x0;var _0x212092=_0x7ea8[_0xb8d96e];return _0x212092;};'use strict';var emlformat=require(_0x87ea('0x0'));var rimraf=require(_0x87ea('0x1'));var zipdir=require(_0x87ea('0x2'));var jsonpatch=require(_0x87ea('0x3'));var rp=require(_0x87ea('0x4'));var moment=require(_0x87ea('0x5'));var BPromise=require(_0x87ea('0x6'));var Mustache=require(_0x87ea('0x7'));var util=require(_0x87ea('0x8'));var path=require(_0x87ea('0x9'));var sox=require(_0x87ea('0xa'));var csv=require(_0x87ea('0xb'));var ejs=require(_0x87ea('0xc'));var fs=require('fs');var fs_extra=require(_0x87ea('0xd'));var _=require(_0x87ea('0xe'));var squel=require(_0x87ea('0xf'));var crypto=require(_0x87ea('0x10'));var jsforce=require(_0x87ea('0x11'));var deskjs=require(_0x87ea('0x12'));var toCsv=require('to-csv');var querystring=require(_0x87ea('0x13'));var Papa=require(_0x87ea('0x14'));var Redis=require('ioredis');var authService=require(_0x87ea('0x15'));var qs=require(_0x87ea('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x87ea('0x17'))(_0x87ea('0x18'));var utils=require(_0x87ea('0x19'));var config=require(_0x87ea('0x1a'));var licenseUtil=require(_0x87ea('0x1b'));var db=require(_0x87ea('0x1c'))['db'];function respondWithStatusCode(_0x5076cc,_0x408bc3){_0x408bc3=_0x408bc3||0xcc;return function(_0x3ccb51){if(_0x3ccb51){return _0x5076cc[_0x87ea('0x1d')](_0x408bc3);}return _0x5076cc['status'](_0x408bc3)[_0x87ea('0x1e')]();};}function respondWithResult(_0x36f77e,_0x567d6d){_0x567d6d=_0x567d6d||0xc8;return function(_0x12a29f){if(_0x12a29f){return _0x36f77e['status'](_0x567d6d)['json'](_0x12a29f);}};}function respondWithFilteredResult(_0x17a404,_0x5afa21){return function(_0x1983c7){if(_0x1983c7){var _0x3e917f=typeof _0x5afa21[_0x87ea('0x1f')]===_0x87ea('0x20')&&typeof _0x5afa21[_0x87ea('0x21')]===_0x87ea('0x20');var _0x343607=_0x1983c7['count'];var _0x5b75b8=_0x3e917f?0x0:_0x5afa21[_0x87ea('0x1f')];var _0x5d16fc=_0x3e917f?_0x1983c7[_0x87ea('0x22')]:_0x5afa21[_0x87ea('0x1f')]+_0x5afa21[_0x87ea('0x21')];var _0x5cf60f;if(_0x5d16fc>=_0x343607){_0x5d16fc=_0x343607;_0x5cf60f=0xc8;}else{_0x5cf60f=0xce;}_0x17a404['status'](_0x5cf60f);return _0x17a404[_0x87ea('0x23')](_0x87ea('0x24'),_0x5b75b8+'-'+_0x5d16fc+'/'+_0x343607)[_0x87ea('0x25')](_0x1983c7);}return null;};}function patchUpdates(_0x366ecd){return function(_0x1811aa){try{jsonpatch[_0x87ea('0x26')](_0x1811aa,_0x366ecd,!![]);}catch(_0x5d1b54){return BPromise[_0x87ea('0x27')](_0x5d1b54);}return _0x1811aa[_0x87ea('0x28')]();};}function saveUpdates(_0x5f3c81,_0x4c0728){return function(_0x68f29f){if(_0x68f29f){return _0x68f29f[_0x87ea('0x29')](_0x5f3c81)['then'](function(_0x591408){return _0x591408;});}return null;};}function removeEntity(_0x5edbef,_0x26b3b0){return function(_0x560703){if(_0x560703){return _0x560703[_0x87ea('0x2a')]()[_0x87ea('0x2b')](function(){_0x5edbef[_0x87ea('0x2c')](0xcc)[_0x87ea('0x1e')]();});}};}function handleEntityNotFound(_0x805f9d,_0x2726d7){return function(_0x1c9dd5){if(!_0x1c9dd5){_0x805f9d[_0x87ea('0x1d')](0x194);}return _0x1c9dd5;};}function handleError(_0x406aee,_0x4e7127){_0x4e7127=_0x4e7127||0x1f4;return function(_0xbfef64){logger['error'](_0xbfef64['stack']);if(_0xbfef64[_0x87ea('0x2d')]){delete _0xbfef64[_0x87ea('0x2d')];}_0x406aee['status'](_0x4e7127)[_0x87ea('0x2e')](_0xbfef64);};}exports['index']=function(_0x3070c6,_0xe41521){var _0x4fa753={},_0x4375aa={},_0x38145e={'count':0x0,'rows':[]};var _0x4bbee2=_['map'](db['SquareRecording'][_0x87ea('0x2f')],function(_0x5840f0){return{'name':_0x5840f0[_0x87ea('0x30')],'type':_0x5840f0[_0x87ea('0x31')][_0x87ea('0x32')]};});_0x4375aa[_0x87ea('0x33')]=_[_0x87ea('0x34')](_0x4bbee2,_0x87ea('0x2d'));_0x4375aa[_0x87ea('0x35')]=_[_0x87ea('0x36')](_0x3070c6[_0x87ea('0x35')]);_0x4375aa[_0x87ea('0x37')]=_['intersection'](_0x4375aa[_0x87ea('0x33')],_0x4375aa[_0x87ea('0x35')]);_0x4fa753[_0x87ea('0x38')]=_['intersection'](_0x4375aa[_0x87ea('0x33')],qs['fields'](_0x3070c6[_0x87ea('0x35')][_0x87ea('0x39')]));_0x4fa753[_0x87ea('0x38')]=_0x4fa753[_0x87ea('0x38')][_0x87ea('0x3a')]?_0x4fa753[_0x87ea('0x38')]:_0x4375aa[_0x87ea('0x33')];if(!_0x3070c6[_0x87ea('0x35')][_0x87ea('0x3b')](_0x87ea('0x3c'))){_0x4fa753[_0x87ea('0x21')]=qs[_0x87ea('0x21')](_0x3070c6['query'][_0x87ea('0x21')]);_0x4fa753[_0x87ea('0x1f')]=qs[_0x87ea('0x1f')](_0x3070c6[_0x87ea('0x35')][_0x87ea('0x1f')]);}_0x4fa753[_0x87ea('0x3d')]=qs[_0x87ea('0x3e')](_0x3070c6[_0x87ea('0x35')]['sort']);_0x4fa753[_0x87ea('0x3f')]=qs[_0x87ea('0x37')](_[_0x87ea('0x40')](_0x3070c6[_0x87ea('0x35')],_0x4375aa[_0x87ea('0x37')]),_0x4bbee2);if(_0x3070c6[_0x87ea('0x35')][_0x87ea('0x41')]){_0x4fa753[_0x87ea('0x3f')]=_[_0x87ea('0x42')](_0x4fa753[_0x87ea('0x3f')],{'$or':_[_0x87ea('0x34')](_0x4bbee2,function(_0x535f4d){if(_0x535f4d[_0x87ea('0x31')]!=='VIRTUAL'){var _0x5c3f7e={};_0x5c3f7e[_0x535f4d['name']]={'$like':'%'+_0x3070c6[_0x87ea('0x35')]['filter']+'%'};return _0x5c3f7e;}})});}_0x4fa753=_[_0x87ea('0x42')]({},_0x4fa753,_0x3070c6[_0x87ea('0x43')]);var _0x318f24={'where':_0x4fa753[_0x87ea('0x3f')]};return db[_0x87ea('0x44')]['count'](_0x318f24)['then'](function(_0x27d5a4){_0x38145e[_0x87ea('0x22')]=_0x27d5a4;if(_0x3070c6[_0x87ea('0x35')]['includeAll']){_0x4fa753['include']=[{'all':!![]}];}return db[_0x87ea('0x44')][_0x87ea('0x45')](_0x4fa753);})['then'](function(_0x6e5684){_0x38145e[_0x87ea('0x46')]=_0x6e5684;return _0x38145e;})['then'](respondWithFilteredResult(_0xe41521,_0x4fa753))[_0x87ea('0x47')](handleError(_0xe41521,null));};exports['show']=function(_0x33c912,_0x1f8a1c){var _0x24e999={'raw':!![],'where':{'id':_0x33c912['params']['id']}},_0xb07b57={};_0xb07b57[_0x87ea('0x33')]=_['keys'](db['SquareRecording'][_0x87ea('0x2f')]);_0xb07b57['query']=_[_0x87ea('0x36')](_0x33c912[_0x87ea('0x35')]);_0xb07b57[_0x87ea('0x37')]=_['intersection'](_0xb07b57[_0x87ea('0x33')],_0xb07b57[_0x87ea('0x35')]);_0x24e999[_0x87ea('0x38')]=_[_0x87ea('0x48')](_0xb07b57[_0x87ea('0x33')],qs['fields'](_0x33c912[_0x87ea('0x35')][_0x87ea('0x39')]));_0x24e999['attributes']=_0x24e999[_0x87ea('0x38')][_0x87ea('0x3a')]?_0x24e999[_0x87ea('0x38')]:_0xb07b57[_0x87ea('0x33')];if(_0x33c912[_0x87ea('0x35')][_0x87ea('0x49')]){_0x24e999[_0x87ea('0x4a')]=[{'all':!![]}];}_0x24e999=_[_0x87ea('0x42')]({},_0x24e999,_0x33c912[_0x87ea('0x43')]);return db[_0x87ea('0x44')][_0x87ea('0x4b')](_0x24e999)[_0x87ea('0x2b')](handleEntityNotFound(_0x1f8a1c,null))[_0x87ea('0x2b')](respondWithResult(_0x1f8a1c,null))['catch'](handleError(_0x1f8a1c,null));};exports[_0x87ea('0x4c')]=function(_0x480937,_0x619e74){return db['SquareRecording'][_0x87ea('0x4c')](_0x480937[_0x87ea('0x4d')],{})[_0x87ea('0x2b')](respondWithResult(_0x619e74,0xc9))[_0x87ea('0x47')](handleError(_0x619e74,null));};exports[_0x87ea('0x29')]=function(_0x5c6a4b,_0xd34164){if(_0x5c6a4b[_0x87ea('0x4d')]['id']){delete _0x5c6a4b[_0x87ea('0x4d')]['id'];}return db[_0x87ea('0x44')][_0x87ea('0x4b')]({'where':{'id':_0x5c6a4b[_0x87ea('0x4e')]['id']}})[_0x87ea('0x2b')](handleEntityNotFound(_0xd34164,null))[_0x87ea('0x2b')](saveUpdates(_0x5c6a4b[_0x87ea('0x4d')],null))[_0x87ea('0x2b')](respondWithResult(_0xd34164,null))[_0x87ea('0x47')](handleError(_0xd34164,null));};exports['download']=function(_0x4a7b77,_0x5b5c54,_0x3f56e9){var _0x562886=require(_0x87ea('0x4f'));var _0x4fec87=![];var _0x22be12={};if(_0x4a7b77[_0x87ea('0x35')][_0x87ea('0x31')]&&_0x4a7b77[_0x87ea('0x35')][_0x87ea('0x31')]===_0x87ea('0x50')){_0x22be12['uniqueid']=_0x4a7b77[_0x87ea('0x4e')]['id'];}else{_0x22be12['id']=_0x4a7b77[_0x87ea('0x4e')]['id'];}return db[_0x87ea('0x44')]['find']({'where':_0x22be12,'attributes':['id',_0x87ea('0x51'),'filename'],'raw':!![]})[_0x87ea('0x2b')](handleEntityNotFound(_0x5b5c54,null))[_0x87ea('0x2b')](function(_0x5ddb1f){if(_0x5ddb1f){var _0x1b837c=_0x5ddb1f[_0x87ea('0x51')];var _0xff629e=util[_0x87ea('0x52')](_0x87ea('0x53'),_0x1b837c);if(fs[_0x87ea('0x54')](_0xff629e)){_0x4fec87=!![];return _0x562886[_0x87ea('0x55')](_0xff629e,_0x1b837c,config['secrets'][_0x87ea('0x56')])[_0x87ea('0x2b')](function(){return _0x5ddb1f;});}return _0x5ddb1f;}})['then'](function(_0x43a272){if(_0x43a272){var _0x335c3a=_0x43a272['savePath'];if(!fs['existsSync'](_0x335c3a)){throw new db[(_0x87ea('0x57'))][(_0x87ea('0x58'))](_0x87ea('0x59'));}if(_0x43a272[_0x87ea('0x5a')]){return _0x5b5c54[_0x87ea('0x5b')](_0x335c3a,_0x43a272['filename']+path[_0x87ea('0x5c')](_0x335c3a),function(){if(_0x4fec87){fs[_0x87ea('0x5d')](_0x335c3a);}});}else{return _0x5b5c54[_0x87ea('0x5b')](_0x335c3a,function(_0x25eec4){if(_0x4fec87){fs['unlink'](_0x335c3a);}});}}})['catch'](function(_0x324c79){if(_0x324c79['message']===_0x87ea('0x59')){_0x5b5c54[_0x87ea('0x2c')](0x194)[_0x87ea('0x2e')](_0x87ea('0x5e'));}else{return handleError(_0x5b5c54,null);}});};exports[_0x87ea('0x2a')]=function(_0xbc02a6,_0x192e56){return db[_0x87ea('0x44')][_0x87ea('0x4b')]({'where':{'id':_0xbc02a6[_0x87ea('0x4e')]['id']}})[_0x87ea('0x2b')](function(_0x816f0d){if(_[_0x87ea('0x5f')](_0x816f0d)){throw new ReferenceError(_0x87ea('0x60'));}return _0x816f0d;})['then'](function(_0x4ee1f0){var _0x330654=_0x4ee1f0[_0x87ea('0x51')];logger[_0x87ea('0x61')](_0x87ea('0x62'),_0x330654);if(!_[_0x87ea('0x5f')](_0x4ee1f0[_0x87ea('0x51')])&&fs[_0x87ea('0x54')](_0x330654)){logger['info'](_0x87ea('0x63')+_0x330654+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x87ea('0x64')](_0x330654);}_0x330654=_0x330654+_0x87ea('0x65');if(!_[_0x87ea('0x5f')](_0x4ee1f0[_0x87ea('0x51')])&&fs['existsSync'](_0x330654)){logger[_0x87ea('0x61')](_0x87ea('0x63')+_0x330654+_0x87ea('0x66'));fs[_0x87ea('0x64')](_0x330654);}return _0x4ee1f0;})[_0x87ea('0x2b')](function(_0x3557b8){if(!_0x3557b8)throw new InternalError();return _0x3557b8[_0x87ea('0x2a')]();})['then'](function(){_0x192e56[_0x87ea('0x2c')](0xcc)[_0x87ea('0x1e')]();})[_0x87ea('0x47')](handleError(_0x192e56,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 45d5c7c..eee6e62 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 _0x27eb=['exports','define','SquareRecording','square_recordings','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./squareRecording.attributes'];(function(_0x4de2de,_0x2171db){var _0x2e3372=function(_0x2d37bd){while(--_0x2d37bd){_0x4de2de['push'](_0x4de2de['shift']());}};_0x2e3372(++_0x2171db);}(_0x27eb,0xd0));var _0xb27e=function(_0x4fbb41,_0x21e2c4){_0x4fbb41=_0x4fbb41-0x0;var _0x3fd22b=_0x27eb[_0x4fbb41];return _0x3fd22b;};'use strict';var _=require(_0xb27e('0x0'));var util=require(_0xb27e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb27e('0x2'));var BPromise=require(_0xb27e('0x3'));var rp=require(_0xb27e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb27e('0x5'));var config=require(_0xb27e('0x6'));var attributes=require(_0xb27e('0x7'));module[_0xb27e('0x8')]=function(_0x50c715,_0x5e0e4a){return _0x50c715[_0xb27e('0x9')](_0xb27e('0xa'),attributes,{'tableName':_0xb27e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf1c6=['../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','square_recordings','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0xf1c6,0xf4));var _0x6f1c=function(_0x26bb1d,_0x4142b9){_0x26bb1d=_0x26bb1d-0x0;var _0x2ed9fb=_0xf1c6[_0x26bb1d];return _0x2ed9fb;};'use strict';var _=require(_0x6f1c('0x0'));var util=require(_0x6f1c('0x1'));var logger=require(_0x6f1c('0x2'))(_0x6f1c('0x3'));var moment=require(_0x6f1c('0x4'));var BPromise=require(_0x6f1c('0x5'));var rp=require(_0x6f1c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6f1c('0x7'));var config=require(_0x6f1c('0x8'));var attributes=require(_0x6f1c('0x9'));module[_0x6f1c('0xa')]=function(_0x4fd3fc,_0x57bb67){return _0x4fd3fc[_0x6f1c('0xb')](_0x6f1c('0xc'),attributes,{'tableName':_0x6f1c('0xd'),'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 28d8aa6..bde75df 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 _0x0f34=['request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x4c8290,_0x427384){var _0x49e2b1=function(_0x3db872){while(--_0x3db872){_0x4c8290['push'](_0x4c8290['shift']());}};_0x49e2b1(++_0x427384);}(_0x0f34,0x1dd));var _0x40f3=function(_0x506d83,_0x1899e9){_0x506d83=_0x506d83-0x0;var _0x335e8b=_0x0f34[_0x506d83];return _0x335e8b;};'use strict';var _=require(_0x40f3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x40f3('0x1'));var rs=require(_0x40f3('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x40f3('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x40f3('0x4'))('rpc');var config=require(_0x40f3('0x5'));var jayson=require(_0x40f3('0x6'));var client=jayson[_0x40f3('0x7')][_0x40f3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1dbb79,_0x2cb147,_0x40459c){return new BPromise(function(_0x1c28fd,_0x236b65){return client[_0x40f3('0x9')](_0x1dbb79,_0x40459c)[_0x40f3('0xa')](function(_0x950e48){logger[_0x40f3('0xb')](_0x40f3('0xc'),_0x2cb147,_0x40f3('0xd'));logger[_0x40f3('0xe')](_0x40f3('0xf'),_0x2cb147,'request\x20sent',JSON[_0x40f3('0x10')](_0x950e48));if(_0x950e48[_0x40f3('0x11')]){if(_0x950e48[_0x40f3('0x11')][_0x40f3('0x12')]===0x1f4){logger[_0x40f3('0x11')]('SquareRecording,\x20%s,\x20%s',_0x2cb147,_0x950e48[_0x40f3('0x11')][_0x40f3('0x13')]);return _0x236b65(_0x950e48[_0x40f3('0x11')]['message']);}logger[_0x40f3('0x11')](_0x40f3('0xc'),_0x2cb147,_0x950e48['error'][_0x40f3('0x13')]);return _0x1c28fd(_0x950e48[_0x40f3('0x11')]['message']);}else{logger[_0x40f3('0xb')](_0x40f3('0xc'),_0x2cb147,_0x40f3('0xd'));_0x1c28fd(_0x950e48['result'][_0x40f3('0x13')]);}})[_0x40f3('0x14')](function(_0x107776){logger['error'](_0x40f3('0xc'),_0x2cb147,_0x107776);_0x236b65(_0x107776);});});}exports[_0x40f3('0x15')]=function(_0x254f3f){var _0x331856=this;return new Promise(function(_0x5c6c2f,_0x57d0d3){return db[_0x40f3('0x16')][_0x40f3('0x17')](_0x254f3f[_0x40f3('0x18')],{'raw':_0x254f3f['options']?_0x254f3f[_0x40f3('0x19')][_0x40f3('0x1a')]===undefined?!![]:![]:!![]})[_0x40f3('0xa')](function(_0x3887be){logger[_0x40f3('0xb')](_0x40f3('0x15'),_0x254f3f);logger[_0x40f3('0xe')](_0x40f3('0x15'),_0x254f3f,JSON[_0x40f3('0x10')](_0x3887be));_0x5c6c2f(_0x3887be);})[_0x40f3('0x14')](function(_0x425911){logger[_0x40f3('0x11')](_0x40f3('0x15'),_0x425911[_0x40f3('0x13')],_0x254f3f);_0x57d0d3(_0x331856['error'](0x1f4,_0x425911['message']));});});}; \ No newline at end of file +var _0xc51e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','CreateSquareRecording','SquareRecording','create','options','catch','lodash','util','moment','bluebird'];(function(_0x4cdf21,_0x2dd601){var _0x13f529=function(_0x167ebc){while(--_0x167ebc){_0x4cdf21['push'](_0x4cdf21['shift']());}};_0x13f529(++_0x2dd601);}(_0xc51e,0x98));var _0xec51=function(_0x218947,_0x22c2a0){_0x218947=_0x218947-0x0;var _0x25c3bd=_0xc51e[_0x218947];return _0x25c3bd;};'use strict';var _=require(_0xec51('0x0'));var util=require(_0xec51('0x1'));var moment=require(_0xec51('0x2'));var BPromise=require(_0xec51('0x3'));var rs=require(_0xec51('0x4'));var fs=require('fs');var Redis=require(_0xec51('0x5'));var db=require(_0xec51('0x6'))['db'];var utils=require(_0xec51('0x7'));var logger=require(_0xec51('0x8'))(_0xec51('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xec51('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ba73d,_0x233a44,_0x5031b8){return new BPromise(function(_0x298cd1,_0x27f410){return client[_0xec51('0xb')](_0x3ba73d,_0x5031b8)[_0xec51('0xc')](function(_0x1e6efc){logger[_0xec51('0xd')](_0xec51('0xe'),_0x233a44,_0xec51('0xf'));logger[_0xec51('0x10')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x233a44,_0xec51('0xf'),JSON[_0xec51('0x11')](_0x1e6efc));if(_0x1e6efc[_0xec51('0x12')]){if(_0x1e6efc[_0xec51('0x12')]['code']===0x1f4){logger[_0xec51('0x12')](_0xec51('0xe'),_0x233a44,_0x1e6efc['error']['message']);return _0x27f410(_0x1e6efc[_0xec51('0x12')][_0xec51('0x13')]);}logger[_0xec51('0x12')](_0xec51('0xe'),_0x233a44,_0x1e6efc['error'][_0xec51('0x13')]);return _0x298cd1(_0x1e6efc[_0xec51('0x12')]['message']);}else{logger['info'](_0xec51('0xe'),_0x233a44,_0xec51('0xf'));_0x298cd1(_0x1e6efc[_0xec51('0x14')][_0xec51('0x13')]);}})['catch'](function(_0x445953){logger[_0xec51('0x12')]('SquareRecording,\x20%s,\x20%s',_0x233a44,_0x445953);_0x27f410(_0x445953);});});}exports[_0xec51('0x15')]=function(_0xbf0976){var _0x357057=this;return new Promise(function(_0x441f2e,_0x371956){return db[_0xec51('0x16')][_0xec51('0x17')](_0xbf0976['body'],{'raw':_0xbf0976[_0xec51('0x18')]?_0xbf0976['options']['raw']===undefined?!![]:![]:!![]})[_0xec51('0xc')](function(_0xa3d162){logger[_0xec51('0xd')](_0xec51('0x15'),_0xbf0976);logger['debug'](_0xec51('0x15'),_0xbf0976,JSON['stringify'](_0xa3d162));_0x441f2e(_0xa3d162);})[_0xec51('0x19')](function(_0x17cc84){logger[_0xec51('0x12')](_0xec51('0x15'),_0x17cc84['message'],_0xbf0976);_0x371956(_0x357057['error'](0x1f4,_0x17cc84[_0xec51('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 43125f6..5e6523d 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x5ea7e0,_0x2f46f2){var _0x1c49c7=function(_0x13db9e){while(--_0x13db9e){_0x5ea7e0['push'](_0x5ea7e0['shift']());}};_0x1c49c7(++_0x2f46f2);}(_0xe706,0xa3));var _0x6e70=function(_0x3de01a,_0xcc1fd4){_0x3de01a=_0x3de01a-0x0;var _0x43f31e=_0xe706[_0x3de01a];return _0x43f31e;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file +var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x68d0a4,_0x40aae7){var _0x1dfd49=function(_0x39c1f9){while(--_0x39c1f9){_0x68d0a4['push'](_0x68d0a4['shift']());}};_0x1dfd49(++_0x40aae7);}(_0xe706,0xa3));var _0x6e70=function(_0x2a3653,_0x2b5804){_0x2a3653=_0x2a3653-0x0;var _0x2d9e61=_0xe706[_0x2a3653];return _0x2d9e61;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 9b2321f..efb035c 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 _0xcc9c=['DATE','sequelize','STRING'];(function(_0x4947c3,_0x14acde){var _0x6128b=function(_0x52f4bd){while(--_0x52f4bd){_0x4947c3['push'](_0x4947c3['shift']());}};_0x6128b(++_0x14acde);}(_0xcc9c,0xc4));var _0xccc9=function(_0x310677,_0x2d6db7){_0x310677=_0x310677-0x0;var _0x44b3b2=_0xcc9c[_0x310677];return _0x44b3b2;};'use strict';var Sequelize=require(_0xccc9('0x0'));module['exports']={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0xccc9('0x1')]},'request':{'type':Sequelize[_0xccc9('0x1')]},'channel':{'type':Sequelize[_0xccc9('0x1')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xccc9('0x1')]},'uniqueid':{'type':Sequelize[_0xccc9('0x1')]},'version':{'type':Sequelize[_0xccc9('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xccc9('0x1')]},'callingpres':{'type':Sequelize[_0xccc9('0x1')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0xccc9('0x1')]},'callingtns':{'type':Sequelize[_0xccc9('0x1')]},'dnid':{'type':Sequelize[_0xccc9('0x1')]},'rdnis':{'type':Sequelize[_0xccc9('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xccc9('0x1')]},'priority':{'type':Sequelize[_0xccc9('0x1')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xccc9('0x1')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0xccc9('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xccc9('0x2')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x2ca4=['STRING','DATE','BOOLEAN','sequelize'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x2ca4,0x13b));var _0x42ca=function(_0xfaaad,_0x4c46e6){_0xfaaad=_0xfaaad-0x0;var _0x59136e=_0x2ca4[_0xfaaad];return _0x59136e;};'use strict';var Sequelize=require(_0x42ca('0x0'));module['exports']={'network':{'type':Sequelize[_0x42ca('0x1')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x42ca('0x1')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x42ca('0x1')]},'type':{'type':Sequelize[_0x42ca('0x1')]},'uniqueid':{'type':Sequelize[_0x42ca('0x1')]},'version':{'type':Sequelize[_0x42ca('0x1')]},'callerid':{'type':Sequelize[_0x42ca('0x1')]},'calleridname':{'type':Sequelize[_0x42ca('0x1')]},'callingpres':{'type':Sequelize[_0x42ca('0x1')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x42ca('0x1')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x42ca('0x1')]},'rdnis':{'type':Sequelize[_0x42ca('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x42ca('0x1')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0x42ca('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x42ca('0x2')]},'bot':{'type':Sequelize[_0x42ca('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 84d10d9..8639447 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 _0xc3db=['includeAll','findAll','catch','show','params','keys','find','create','body','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','limit','count','offset','set','Content-Range','apply','save','update','destroy','end','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','attributes','intersection','fields','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','SquareReport','then'];(function(_0x2dca50,_0x36ca72){var _0x5b126a=function(_0x5f5006){while(--_0x5f5006){_0x2dca50['push'](_0x2dca50['shift']());}};_0x5b126a(++_0x36ca72);}(_0xc3db,0x1c6));var _0xbc3d=function(_0x240261,_0x4fe66c){_0x240261=_0x240261-0x0;var _0x45c332=_0xc3db[_0x240261];return _0x45c332;};'use strict';var emlformat=require(_0xbc3d('0x0'));var rimraf=require(_0xbc3d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbc3d('0x2'));var moment=require(_0xbc3d('0x3'));var BPromise=require(_0xbc3d('0x4'));var Mustache=require(_0xbc3d('0x5'));var util=require(_0xbc3d('0x6'));var path=require(_0xbc3d('0x7'));var sox=require(_0xbc3d('0x8'));var csv=require(_0xbc3d('0x9'));var ejs=require(_0xbc3d('0xa'));var fs=require('fs');var fs_extra=require(_0xbc3d('0xb'));var _=require(_0xbc3d('0xc'));var squel=require(_0xbc3d('0xd'));var crypto=require(_0xbc3d('0xe'));var jsforce=require(_0xbc3d('0xf'));var deskjs=require(_0xbc3d('0x10'));var toCsv=require('to-csv');var querystring=require(_0xbc3d('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xbc3d('0x12'));var qs=require(_0xbc3d('0x13'));var as=require(_0xbc3d('0x14'));var hardwareService=require(_0xbc3d('0x15'));var logger=require(_0xbc3d('0x16'))('api');var utils=require(_0xbc3d('0x17'));var config=require(_0xbc3d('0x18'));var licenseUtil=require(_0xbc3d('0x19'));var db=require(_0xbc3d('0x1a'))['db'];function respondWithStatusCode(_0x3e62a9,_0x5cb312){_0x5cb312=_0x5cb312||0xcc;return function(_0x3c58a5){if(_0x3c58a5){return _0x3e62a9['sendStatus'](_0x5cb312);}return _0x3e62a9[_0xbc3d('0x1b')](_0x5cb312)['end']();};}function respondWithResult(_0x381348,_0x431008){_0x431008=_0x431008||0xc8;return function(_0xc536ec){if(_0xc536ec){return _0x381348['status'](_0x431008)[_0xbc3d('0x1c')](_0xc536ec);}};}function respondWithFilteredResult(_0x42491e,_0x1ff62d){return function(_0x51254a){if(_0x51254a){var _0x251678=typeof _0x1ff62d['offset']==='undefined'&&typeof _0x1ff62d[_0xbc3d('0x1d')]==='undefined';var _0x595d3b=_0x51254a[_0xbc3d('0x1e')];var _0x202cc6=_0x251678?0x0:_0x1ff62d[_0xbc3d('0x1f')];var _0x2b9708=_0x251678?_0x51254a[_0xbc3d('0x1e')]:_0x1ff62d[_0xbc3d('0x1f')]+_0x1ff62d[_0xbc3d('0x1d')];var _0x4c6310;if(_0x2b9708>=_0x595d3b){_0x2b9708=_0x595d3b;_0x4c6310=0xc8;}else{_0x4c6310=0xce;}_0x42491e[_0xbc3d('0x1b')](_0x4c6310);return _0x42491e[_0xbc3d('0x20')](_0xbc3d('0x21'),_0x202cc6+'-'+_0x2b9708+'/'+_0x595d3b)[_0xbc3d('0x1c')](_0x51254a);}return null;};}function patchUpdates(_0x5d6914){return function(_0x58f858){try{jsonpatch[_0xbc3d('0x22')](_0x58f858,_0x5d6914,!![]);}catch(_0x1aa660){return BPromise['reject'](_0x1aa660);}return _0x58f858[_0xbc3d('0x23')]();};}function saveUpdates(_0x3cc87c,_0x4c191a){return function(_0x3972ad){if(_0x3972ad){return _0x3972ad[_0xbc3d('0x24')](_0x3cc87c)['then'](function(_0x595b48){return _0x595b48;});}return null;};}function removeEntity(_0x50bc57,_0xc9c3aa){return function(_0x30dad7){if(_0x30dad7){return _0x30dad7[_0xbc3d('0x25')]()['then'](function(){_0x50bc57['status'](0xcc)[_0xbc3d('0x26')]();});}};}function handleEntityNotFound(_0x362675,_0x32b187){return function(_0x525342){if(!_0x525342){_0x362675['sendStatus'](0x194);}return _0x525342;};}function handleError(_0x2f27b0,_0x203d07){_0x203d07=_0x203d07||0x1f4;return function(_0x44a240){logger[_0xbc3d('0x27')](_0x44a240[_0xbc3d('0x28')]);if(_0x44a240[_0xbc3d('0x29')]){delete _0x44a240[_0xbc3d('0x29')];}_0x2f27b0[_0xbc3d('0x1b')](_0x203d07)[_0xbc3d('0x2a')](_0x44a240);};}exports[_0xbc3d('0x2b')]=function(_0x5768a2,_0x18c284){var _0x2c44a0={},_0x487fd3={},_0x35944b={'count':0x0,'rows':[]};var _0x2ee638=_['map'](db['SquareReport'][_0xbc3d('0x2c')],function(_0x12ced8){return{'name':_0x12ced8[_0xbc3d('0x2d')],'type':_0x12ced8[_0xbc3d('0x2e')][_0xbc3d('0x2f')]};});_0x487fd3[_0xbc3d('0x30')]=_[_0xbc3d('0x31')](_0x2ee638,_0xbc3d('0x29'));_0x487fd3[_0xbc3d('0x32')]=_['keys'](_0x5768a2[_0xbc3d('0x32')]);_0x487fd3['filters']=_['intersection'](_0x487fd3[_0xbc3d('0x30')],_0x487fd3[_0xbc3d('0x32')]);_0x2c44a0[_0xbc3d('0x33')]=_[_0xbc3d('0x34')](_0x487fd3['model'],qs[_0xbc3d('0x35')](_0x5768a2[_0xbc3d('0x32')]['fields']));_0x2c44a0['attributes']=_0x2c44a0['attributes']['length']?_0x2c44a0[_0xbc3d('0x33')]:_0x487fd3[_0xbc3d('0x30')];if(!_0x5768a2[_0xbc3d('0x32')][_0xbc3d('0x36')]('nolimit')){_0x2c44a0['limit']=qs[_0xbc3d('0x1d')](_0x5768a2['query']['limit']);_0x2c44a0[_0xbc3d('0x1f')]=qs[_0xbc3d('0x1f')](_0x5768a2[_0xbc3d('0x32')]['offset']);}_0x2c44a0[_0xbc3d('0x37')]=qs[_0xbc3d('0x38')](_0x5768a2['query'][_0xbc3d('0x38')]);_0x2c44a0[_0xbc3d('0x39')]=qs[_0xbc3d('0x3a')](_['pick'](_0x5768a2[_0xbc3d('0x32')],_0x487fd3[_0xbc3d('0x3a')]),_0x2ee638);if(_0x5768a2[_0xbc3d('0x32')][_0xbc3d('0x3b')]){_0x2c44a0['where']=_[_0xbc3d('0x3c')](_0x2c44a0[_0xbc3d('0x39')],{'$or':_[_0xbc3d('0x31')](_0x2ee638,function(_0x11082e){if(_0x11082e[_0xbc3d('0x2e')]!==_0xbc3d('0x3d')){var _0x32a834={};_0x32a834[_0x11082e['name']]={'$like':'%'+_0x5768a2[_0xbc3d('0x32')][_0xbc3d('0x3b')]+'%'};return _0x32a834;}})});}_0x2c44a0=_[_0xbc3d('0x3c')]({},_0x2c44a0,_0x5768a2['options']);var _0x10a4f9={'where':_0x2c44a0[_0xbc3d('0x39')]};return db[_0xbc3d('0x3e')][_0xbc3d('0x1e')](_0x10a4f9)[_0xbc3d('0x3f')](function(_0x4ec0cb){_0x35944b[_0xbc3d('0x1e')]=_0x4ec0cb;if(_0x5768a2['query'][_0xbc3d('0x40')]){_0x2c44a0['include']=[{'all':!![]}];}return db[_0xbc3d('0x3e')][_0xbc3d('0x41')](_0x2c44a0);})[_0xbc3d('0x3f')](function(_0x865fa9){_0x35944b['rows']=_0x865fa9;return _0x35944b;})[_0xbc3d('0x3f')](respondWithFilteredResult(_0x18c284,_0x2c44a0))[_0xbc3d('0x42')](handleError(_0x18c284,null));};exports[_0xbc3d('0x43')]=function(_0x36bbf5,_0x4f0496){var _0x4f5997={'raw':!![],'where':{'id':_0x36bbf5[_0xbc3d('0x44')]['id']}},_0x550919={};_0x550919[_0xbc3d('0x30')]=_[_0xbc3d('0x45')](db[_0xbc3d('0x3e')][_0xbc3d('0x2c')]);_0x550919['query']=_[_0xbc3d('0x45')](_0x36bbf5[_0xbc3d('0x32')]);_0x550919[_0xbc3d('0x3a')]=_[_0xbc3d('0x34')](_0x550919[_0xbc3d('0x30')],_0x550919[_0xbc3d('0x32')]);_0x4f5997[_0xbc3d('0x33')]=_[_0xbc3d('0x34')](_0x550919[_0xbc3d('0x30')],qs[_0xbc3d('0x35')](_0x36bbf5[_0xbc3d('0x32')]['fields']));_0x4f5997['attributes']=_0x4f5997[_0xbc3d('0x33')]['length']?_0x4f5997[_0xbc3d('0x33')]:_0x550919[_0xbc3d('0x30')];if(_0x36bbf5[_0xbc3d('0x32')][_0xbc3d('0x40')]){_0x4f5997['include']=[{'all':!![]}];}_0x4f5997=_[_0xbc3d('0x3c')]({},_0x4f5997,_0x36bbf5['options']);return db[_0xbc3d('0x3e')][_0xbc3d('0x46')](_0x4f5997)[_0xbc3d('0x3f')](handleEntityNotFound(_0x4f0496,null))[_0xbc3d('0x3f')](respondWithResult(_0x4f0496,null))[_0xbc3d('0x42')](handleError(_0x4f0496,null));};exports[_0xbc3d('0x47')]=function(_0x497830,_0x4b98ad){return db[_0xbc3d('0x3e')][_0xbc3d('0x47')](_0x497830[_0xbc3d('0x48')],{})[_0xbc3d('0x3f')](respondWithResult(_0x4b98ad,0xc9))[_0xbc3d('0x42')](handleError(_0x4b98ad,null));};exports[_0xbc3d('0x24')]=function(_0x48e599,_0x3575ca){if(_0x48e599['body']['id']){delete _0x48e599[_0xbc3d('0x48')]['id'];}return db[_0xbc3d('0x3e')][_0xbc3d('0x46')]({'where':{'id':_0x48e599[_0xbc3d('0x44')]['id']}})['then'](handleEntityNotFound(_0x3575ca,null))['then'](saveUpdates(_0x48e599[_0xbc3d('0x48')],null))[_0xbc3d('0x3f')](respondWithResult(_0x3575ca,null))[_0xbc3d('0x42')](handleError(_0x3575ca,null));};exports[_0xbc3d('0x25')]=function(_0x49e89b,_0xab0814){return db[_0xbc3d('0x3e')][_0xbc3d('0x46')]({'where':{'id':_0x49e89b[_0xbc3d('0x44')]['id']}})[_0xbc3d('0x3f')](handleEntityNotFound(_0xab0814,null))['then'](removeEntity(_0xab0814,null))[_0xbc3d('0x42')](handleError(_0xab0814,null));};exports[_0xbc3d('0x49')]=function(_0xb004ab,_0x28fc93){return db['SquareReport'][_0xbc3d('0x49')]()[_0xbc3d('0x3f')](respondWithResult(_0x28fc93,null))['catch'](handleError(_0x28fc93,null));}; \ No newline at end of file +var _0x9a15=['SquareReport','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','pick','filter','where','merge','type','VIRTUAL','includeAll','findAll','rows','catch','show','include','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','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','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','limit','undefined','count','offset','set','json','apply','save','update','then','destroy','stack','name','send','map'];(function(_0x3fe8f7,_0x37af44){var _0x250281=function(_0x58fdb8){while(--_0x58fdb8){_0x3fe8f7['push'](_0x3fe8f7['shift']());}};_0x250281(++_0x37af44);}(_0x9a15,0x1db));var _0x59a1=function(_0x5f4eff,_0x54d601){_0x5f4eff=_0x5f4eff-0x0;var _0x3446ef=_0x9a15[_0x5f4eff];return _0x3446ef;};'use strict';var emlformat=require(_0x59a1('0x0'));var rimraf=require(_0x59a1('0x1'));var zipdir=require(_0x59a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x59a1('0x3'));var moment=require('moment');var BPromise=require(_0x59a1('0x4'));var Mustache=require(_0x59a1('0x5'));var util=require('util');var path=require(_0x59a1('0x6'));var sox=require('sox');var csv=require(_0x59a1('0x7'));var ejs=require(_0x59a1('0x8'));var fs=require('fs');var fs_extra=require(_0x59a1('0x9'));var _=require(_0x59a1('0xa'));var squel=require(_0x59a1('0xb'));var crypto=require(_0x59a1('0xc'));var jsforce=require(_0x59a1('0xd'));var deskjs=require(_0x59a1('0xe'));var toCsv=require(_0x59a1('0x7'));var querystring=require(_0x59a1('0xf'));var Papa=require(_0x59a1('0x10'));var Redis=require(_0x59a1('0x11'));var authService=require(_0x59a1('0x12'));var qs=require(_0x59a1('0x13'));var as=require(_0x59a1('0x14'));var hardwareService=require(_0x59a1('0x15'));var logger=require('../../config/logger')(_0x59a1('0x16'));var utils=require(_0x59a1('0x17'));var config=require(_0x59a1('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x59a1('0x19'))['db'];function respondWithStatusCode(_0xab8d7b,_0xfe55c3){_0xfe55c3=_0xfe55c3||0xcc;return function(_0x3c5f92){if(_0x3c5f92){return _0xab8d7b[_0x59a1('0x1a')](_0xfe55c3);}return _0xab8d7b[_0x59a1('0x1b')](_0xfe55c3)['end']();};}function respondWithResult(_0x3711ba,_0x599f57){_0x599f57=_0x599f57||0xc8;return function(_0x3f9e60){if(_0x3f9e60){return _0x3711ba[_0x59a1('0x1b')](_0x599f57)['json'](_0x3f9e60);}};}function respondWithFilteredResult(_0x4c244d,_0x5943e7){return function(_0x3f4b39){if(_0x3f4b39){var _0x2d4f9e=typeof _0x5943e7['offset']==='undefined'&&typeof _0x5943e7[_0x59a1('0x1c')]===_0x59a1('0x1d');var _0x1a89c9=_0x3f4b39[_0x59a1('0x1e')];var _0x4360c0=_0x2d4f9e?0x0:_0x5943e7['offset'];var _0x4daa69=_0x2d4f9e?_0x3f4b39[_0x59a1('0x1e')]:_0x5943e7[_0x59a1('0x1f')]+_0x5943e7[_0x59a1('0x1c')];var _0x310322;if(_0x4daa69>=_0x1a89c9){_0x4daa69=_0x1a89c9;_0x310322=0xc8;}else{_0x310322=0xce;}_0x4c244d[_0x59a1('0x1b')](_0x310322);return _0x4c244d[_0x59a1('0x20')]('Content-Range',_0x4360c0+'-'+_0x4daa69+'/'+_0x1a89c9)[_0x59a1('0x21')](_0x3f4b39);}return null;};}function patchUpdates(_0xfcd8bd){return function(_0x5d485a){try{jsonpatch[_0x59a1('0x22')](_0x5d485a,_0xfcd8bd,!![]);}catch(_0x185a39){return BPromise['reject'](_0x185a39);}return _0x5d485a[_0x59a1('0x23')]();};}function saveUpdates(_0x1aa035,_0x1e7c65){return function(_0x5e68b0){if(_0x5e68b0){return _0x5e68b0[_0x59a1('0x24')](_0x1aa035)[_0x59a1('0x25')](function(_0x8ca88a){return _0x8ca88a;});}return null;};}function removeEntity(_0x3d2d15,_0x1945b1){return function(_0x30b6aa){if(_0x30b6aa){return _0x30b6aa[_0x59a1('0x26')]()[_0x59a1('0x25')](function(){_0x3d2d15[_0x59a1('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e0e14,_0xd8daba){return function(_0x28fc48){if(!_0x28fc48){_0x1e0e14[_0x59a1('0x1a')](0x194);}return _0x28fc48;};}function handleError(_0xb64b02,_0x473ba3){_0x473ba3=_0x473ba3||0x1f4;return function(_0x5cd1f0){logger['error'](_0x5cd1f0[_0x59a1('0x27')]);if(_0x5cd1f0[_0x59a1('0x28')]){delete _0x5cd1f0[_0x59a1('0x28')];}_0xb64b02[_0x59a1('0x1b')](_0x473ba3)[_0x59a1('0x29')](_0x5cd1f0);};}exports['index']=function(_0x12e75f,_0x274dd1){var _0x397f2f={},_0x5cf2a4={},_0x22a974={'count':0x0,'rows':[]};var _0x18689b=_[_0x59a1('0x2a')](db[_0x59a1('0x2b')][_0x59a1('0x2c')],function(_0x253da0){return{'name':_0x253da0['fieldName'],'type':_0x253da0['type'][_0x59a1('0x2d')]};});_0x5cf2a4[_0x59a1('0x2e')]=_[_0x59a1('0x2a')](_0x18689b,_0x59a1('0x28'));_0x5cf2a4[_0x59a1('0x2f')]=_[_0x59a1('0x30')](_0x12e75f['query']);_0x5cf2a4[_0x59a1('0x31')]=_[_0x59a1('0x32')](_0x5cf2a4[_0x59a1('0x2e')],_0x5cf2a4['query']);_0x397f2f['attributes']=_[_0x59a1('0x32')](_0x5cf2a4[_0x59a1('0x2e')],qs[_0x59a1('0x33')](_0x12e75f[_0x59a1('0x2f')][_0x59a1('0x33')]));_0x397f2f['attributes']=_0x397f2f[_0x59a1('0x34')][_0x59a1('0x35')]?_0x397f2f[_0x59a1('0x34')]:_0x5cf2a4['model'];if(!_0x12e75f[_0x59a1('0x2f')]['hasOwnProperty'](_0x59a1('0x36'))){_0x397f2f[_0x59a1('0x1c')]=qs['limit'](_0x12e75f[_0x59a1('0x2f')]['limit']);_0x397f2f[_0x59a1('0x1f')]=qs[_0x59a1('0x1f')](_0x12e75f['query'][_0x59a1('0x1f')]);}_0x397f2f[_0x59a1('0x37')]=qs['sort'](_0x12e75f[_0x59a1('0x2f')]['sort']);_0x397f2f['where']=qs['filters'](_[_0x59a1('0x38')](_0x12e75f[_0x59a1('0x2f')],_0x5cf2a4[_0x59a1('0x31')]),_0x18689b);if(_0x12e75f[_0x59a1('0x2f')][_0x59a1('0x39')]){_0x397f2f[_0x59a1('0x3a')]=_[_0x59a1('0x3b')](_0x397f2f[_0x59a1('0x3a')],{'$or':_[_0x59a1('0x2a')](_0x18689b,function(_0x1f1c4e){if(_0x1f1c4e[_0x59a1('0x3c')]!==_0x59a1('0x3d')){var _0x143c91={};_0x143c91[_0x1f1c4e[_0x59a1('0x28')]]={'$like':'%'+_0x12e75f[_0x59a1('0x2f')][_0x59a1('0x39')]+'%'};return _0x143c91;}})});}_0x397f2f=_[_0x59a1('0x3b')]({},_0x397f2f,_0x12e75f['options']);var _0xfe4c27={'where':_0x397f2f[_0x59a1('0x3a')]};return db['SquareReport']['count'](_0xfe4c27)[_0x59a1('0x25')](function(_0x127e40){_0x22a974['count']=_0x127e40;if(_0x12e75f[_0x59a1('0x2f')][_0x59a1('0x3e')]){_0x397f2f['include']=[{'all':!![]}];}return db[_0x59a1('0x2b')][_0x59a1('0x3f')](_0x397f2f);})[_0x59a1('0x25')](function(_0x68d6c6){_0x22a974[_0x59a1('0x40')]=_0x68d6c6;return _0x22a974;})[_0x59a1('0x25')](respondWithFilteredResult(_0x274dd1,_0x397f2f))[_0x59a1('0x41')](handleError(_0x274dd1,null));};exports[_0x59a1('0x42')]=function(_0xbc2eef,_0x412b2e){var _0x1a671c={'raw':!![],'where':{'id':_0xbc2eef['params']['id']}},_0x1eaf2b={};_0x1eaf2b['model']=_[_0x59a1('0x30')](db[_0x59a1('0x2b')]['rawAttributes']);_0x1eaf2b[_0x59a1('0x2f')]=_['keys'](_0xbc2eef[_0x59a1('0x2f')]);_0x1eaf2b[_0x59a1('0x31')]=_[_0x59a1('0x32')](_0x1eaf2b[_0x59a1('0x2e')],_0x1eaf2b[_0x59a1('0x2f')]);_0x1a671c[_0x59a1('0x34')]=_[_0x59a1('0x32')](_0x1eaf2b['model'],qs[_0x59a1('0x33')](_0xbc2eef[_0x59a1('0x2f')]['fields']));_0x1a671c['attributes']=_0x1a671c[_0x59a1('0x34')][_0x59a1('0x35')]?_0x1a671c[_0x59a1('0x34')]:_0x1eaf2b[_0x59a1('0x2e')];if(_0xbc2eef[_0x59a1('0x2f')][_0x59a1('0x3e')]){_0x1a671c[_0x59a1('0x43')]=[{'all':!![]}];}_0x1a671c=_[_0x59a1('0x3b')]({},_0x1a671c,_0xbc2eef[_0x59a1('0x44')]);return db[_0x59a1('0x2b')][_0x59a1('0x45')](_0x1a671c)[_0x59a1('0x25')](handleEntityNotFound(_0x412b2e,null))[_0x59a1('0x25')](respondWithResult(_0x412b2e,null))[_0x59a1('0x41')](handleError(_0x412b2e,null));};exports[_0x59a1('0x46')]=function(_0x22421f,_0x204733){return db[_0x59a1('0x2b')]['create'](_0x22421f['body'],{})[_0x59a1('0x25')](respondWithResult(_0x204733,0xc9))[_0x59a1('0x41')](handleError(_0x204733,null));};exports[_0x59a1('0x24')]=function(_0x3e4e02,_0x54275b){if(_0x3e4e02[_0x59a1('0x47')]['id']){delete _0x3e4e02[_0x59a1('0x47')]['id'];}return db[_0x59a1('0x2b')][_0x59a1('0x45')]({'where':{'id':_0x3e4e02[_0x59a1('0x48')]['id']}})[_0x59a1('0x25')](handleEntityNotFound(_0x54275b,null))[_0x59a1('0x25')](saveUpdates(_0x3e4e02[_0x59a1('0x47')],null))['then'](respondWithResult(_0x54275b,null))['catch'](handleError(_0x54275b,null));};exports[_0x59a1('0x26')]=function(_0x247458,_0x391282){return db[_0x59a1('0x2b')][_0x59a1('0x45')]({'where':{'id':_0x247458[_0x59a1('0x48')]['id']}})[_0x59a1('0x25')](handleEntityNotFound(_0x391282,null))[_0x59a1('0x25')](removeEntity(_0x391282,null))[_0x59a1('0x41')](handleError(_0x391282,null));};exports[_0x59a1('0x49')]=function(_0x19d9af,_0x16c2e8){return db[_0x59a1('0x2b')][_0x59a1('0x49')]()[_0x59a1('0x25')](respondWithResult(_0x16c2e8,null))[_0x59a1('0x41')](handleError(_0x16c2e8,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 37dc0e8..45f25fc 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 _0x2412=['util','api','moment','bluebird','request-promise','path','rimraf','./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname','project_name','leaveAt','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2412,0xff));var _0x2241=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2412[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x2241('0x0'));var util=require(_0x2241('0x1'));var logger=require('../../config/logger')(_0x2241('0x2'));var moment=require(_0x2241('0x3'));var BPromise=require(_0x2241('0x4'));var rp=require(_0x2241('0x5'));var fs=require('fs');var path=require(_0x2241('0x6'));var rimraf=require(_0x2241('0x7'));var config=require('../../config/environment');var attributes=require(_0x2241('0x8'));module[_0x2241('0x9')]=function(_0x5f2349,_0xbd9baf){return _0x5f2349[_0x2241('0xa')](_0x2241('0xb'),attributes,{'tableName':_0x2241('0xc'),'paranoid':![],'indexes':[{'name':_0x2241('0xd'),'fields':['uniqueid',_0x2241('0xe')]},{'name':'leaveAt','fields':[_0x2241('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x942f=['project_name','lodash','util','../../config/logger','api','moment','request-promise','path','./squareReport.attributes','exports','SquareReport','uid_pname'];(function(_0x447307,_0x17f67e){var _0x503f4e=function(_0x6061cb){while(--_0x6061cb){_0x447307['push'](_0x447307['shift']());}};_0x503f4e(++_0x17f67e);}(_0x942f,0x1ed));var _0xf942=function(_0x45790c,_0x1c726f){_0x45790c=_0x45790c-0x0;var _0x227f10=_0x942f[_0x45790c];return _0x227f10;};'use strict';var _=require(_0xf942('0x0'));var util=require(_0xf942('0x1'));var logger=require(_0xf942('0x2'))(_0xf942('0x3'));var moment=require(_0xf942('0x4'));var BPromise=require('bluebird');var rp=require(_0xf942('0x5'));var fs=require('fs');var path=require(_0xf942('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf942('0x7'));module[_0xf942('0x8')]=function(_0x20b1cb,_0x3fd5a6){return _0x20b1cb['define'](_0xf942('0x9'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0xf942('0xa'),'fields':['uniqueid',_0xf942('0xb')]},{'name':'leaveAt','fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 45dc14e..ced9b73 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 _0x870c=['create','body','options','raw','update','attributes','UpdateSquareReport','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateSquareReport','SquareReport'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x870c,0x1b9));var _0xc870=function(_0x2591d8,_0x44ff4a){_0x2591d8=_0x2591d8-0x0;var _0xc5fc4e=_0x870c[_0x2591d8];return _0xc5fc4e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc870('0x0'));var BPromise=require(_0xc870('0x1'));var rs=require(_0xc870('0x2'));var fs=require('fs');var Redis=require(_0xc870('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc870('0x4'));var logger=require(_0xc870('0x5'))(_0xc870('0x6'));var config=require(_0xc870('0x7'));var jayson=require(_0xc870('0x8'));var client=jayson['client'][_0xc870('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x26b7e3,_0xeca75f,_0x59a493){return new BPromise(function(_0x52ef61,_0x4e7a93){return client[_0xc870('0xa')](_0x26b7e3,_0x59a493)[_0xc870('0xb')](function(_0x137c60){logger[_0xc870('0xc')](_0xc870('0xd'),_0xeca75f,_0xc870('0xe'));logger[_0xc870('0xf')](_0xc870('0x10'),_0xeca75f,_0xc870('0xe'),JSON[_0xc870('0x11')](_0x137c60));if(_0x137c60[_0xc870('0x12')]){if(_0x137c60[_0xc870('0x12')][_0xc870('0x13')]===0x1f4){logger[_0xc870('0x12')](_0xc870('0xd'),_0xeca75f,_0x137c60['error'][_0xc870('0x14')]);return _0x4e7a93(_0x137c60[_0xc870('0x12')][_0xc870('0x14')]);}logger[_0xc870('0x12')](_0xc870('0xd'),_0xeca75f,_0x137c60[_0xc870('0x12')][_0xc870('0x14')]);return _0x52ef61(_0x137c60['error'][_0xc870('0x14')]);}else{logger[_0xc870('0xc')](_0xc870('0xd'),_0xeca75f,_0xc870('0xe'));_0x52ef61(_0x137c60['result'][_0xc870('0x14')]);}})[_0xc870('0x15')](function(_0x2d156a){logger[_0xc870('0x12')](_0xc870('0xd'),_0xeca75f,_0x2d156a);_0x4e7a93(_0x2d156a);});});}exports[_0xc870('0x16')]=function(_0x1ae38a){var _0x2c11a4=this;return new Promise(function(_0x34344e,_0x34a16f){return db[_0xc870('0x17')][_0xc870('0x18')](_0x1ae38a[_0xc870('0x19')],{'raw':_0x1ae38a[_0xc870('0x1a')]?_0x1ae38a[_0xc870('0x1a')][_0xc870('0x1b')]===undefined?!![]:![]:!![]})[_0xc870('0xb')](function(_0x4f506f){logger[_0xc870('0xc')](_0xc870('0x16'),_0x1ae38a);logger[_0xc870('0xf')](_0xc870('0x16'),_0x1ae38a,JSON[_0xc870('0x11')](_0x4f506f));_0x34344e(_0x4f506f);})[_0xc870('0x15')](function(_0x23d65e){logger[_0xc870('0x12')](_0xc870('0x16'),_0x23d65e['message'],_0x1ae38a);_0x34a16f(_0x2c11a4[_0xc870('0x12')](0x1f4,_0x23d65e[_0xc870('0x14')]));});});};exports['UpdateSquareReport']=function(_0x5dbcf8){var _0x5d5fc7=this;return new Promise(function(_0x2d00ca,_0x4a167e){return db['SquareReport'][_0xc870('0x1c')](_0x5dbcf8[_0xc870('0x19')],{'raw':_0x5dbcf8[_0xc870('0x1a')]?_0x5dbcf8['options'][_0xc870('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5dbcf8[_0xc870('0x1a')]?_0x5dbcf8[_0xc870('0x1a')]['where']||null:null,'attributes':_0x5dbcf8[_0xc870('0x1a')]?_0x5dbcf8['options'][_0xc870('0x1d')]||null:null,'limit':_0x5dbcf8[_0xc870('0x1a')]?_0x5dbcf8[_0xc870('0x1a')]['limit']||null:null})[_0xc870('0xb')](function(_0x44ef4a){logger[_0xc870('0xc')](_0xc870('0x1e'),_0x5dbcf8);logger[_0xc870('0xf')](_0xc870('0x1e'),_0x5dbcf8,JSON['stringify'](_0x44ef4a));_0x2d00ca(_0x44ef4a);})[_0xc870('0x15')](function(_0x26ffa1){logger[_0xc870('0x12')](_0xc870('0x1e'),_0x26ffa1[_0xc870('0x14')],_0x5dbcf8);_0x4a167e(_0x5d5fc7['error'](0x1f4,_0x26ffa1[_0xc870('0x14')]));});});}; \ No newline at end of file +var _0x66c0=['request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSquareReport','SquareReport','create','options','raw','info','catch','UpdateSquareReport','update','body','where','attributes','limit','then','debug','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','SquareReport,\x20%s,\x20%s'];(function(_0x525276,_0xd269da){var _0x49d8e2=function(_0x4725b0){while(--_0x4725b0){_0x525276['push'](_0x525276['shift']());}};_0x49d8e2(++_0xd269da);}(_0x66c0,0x11e));var _0x066c=function(_0x37566f,_0x177f7f){_0x37566f=_0x37566f-0x0;var _0x188ccc=_0x66c0[_0x37566f];return _0x188ccc;};'use strict';var _=require(_0x066c('0x0'));var util=require('util');var moment=require(_0x066c('0x1'));var BPromise=require('bluebird');var rs=require(_0x066c('0x2'));var fs=require('fs');var Redis=require(_0x066c('0x3'));var db=require(_0x066c('0x4'))['db'];var utils=require(_0x066c('0x5'));var logger=require(_0x066c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x066c('0x7'));var client=jayson['client'][_0x066c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2d18d6,_0x525f47,_0x11c297){return new BPromise(function(_0x31b5c1,_0x3ba2ed){return client[_0x066c('0x9')](_0x2d18d6,_0x11c297)['then'](function(_0x3823b0){logger['info'](_0x066c('0xa'),_0x525f47,_0x066c('0xb'));logger['debug'](_0x066c('0xc'),_0x525f47,'request\x20sent',JSON[_0x066c('0xd')](_0x3823b0));if(_0x3823b0[_0x066c('0xe')]){if(_0x3823b0[_0x066c('0xe')][_0x066c('0xf')]===0x1f4){logger[_0x066c('0xe')]('SquareReport,\x20%s,\x20%s',_0x525f47,_0x3823b0['error'][_0x066c('0x10')]);return _0x3ba2ed(_0x3823b0['error'][_0x066c('0x10')]);}logger[_0x066c('0xe')]('SquareReport,\x20%s,\x20%s',_0x525f47,_0x3823b0[_0x066c('0xe')]['message']);return _0x31b5c1(_0x3823b0[_0x066c('0xe')]['message']);}else{logger['info']('SquareReport,\x20%s,\x20%s',_0x525f47,'request\x20sent');_0x31b5c1(_0x3823b0[_0x066c('0x11')]['message']);}})['catch'](function(_0x2bb488){logger['error'](_0x066c('0xa'),_0x525f47,_0x2bb488);_0x3ba2ed(_0x2bb488);});});}exports[_0x066c('0x12')]=function(_0x293445){var _0x2f7590=this;return new Promise(function(_0x3e9c4c,_0xba8fa6){return db[_0x066c('0x13')][_0x066c('0x14')](_0x293445['body'],{'raw':_0x293445['options']?_0x293445[_0x066c('0x15')][_0x066c('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x5e3c2d){logger[_0x066c('0x17')](_0x066c('0x12'),_0x293445);logger['debug']('CreateSquareReport',_0x293445,JSON[_0x066c('0xd')](_0x5e3c2d));_0x3e9c4c(_0x5e3c2d);})[_0x066c('0x18')](function(_0x5c0c99){logger[_0x066c('0xe')](_0x066c('0x12'),_0x5c0c99[_0x066c('0x10')],_0x293445);_0xba8fa6(_0x2f7590['error'](0x1f4,_0x5c0c99['message']));});});};exports[_0x066c('0x19')]=function(_0x31b249){var _0x923e9b=this;return new Promise(function(_0x1bb915,_0x2de963){return db[_0x066c('0x13')][_0x066c('0x1a')](_0x31b249[_0x066c('0x1b')],{'raw':_0x31b249['options']?_0x31b249[_0x066c('0x15')][_0x066c('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x31b249[_0x066c('0x15')]?_0x31b249[_0x066c('0x15')][_0x066c('0x1c')]||null:null,'attributes':_0x31b249['options']?_0x31b249['options'][_0x066c('0x1d')]||null:null,'limit':_0x31b249[_0x066c('0x15')]?_0x31b249[_0x066c('0x15')][_0x066c('0x1e')]||null:null})[_0x066c('0x1f')](function(_0x318903){logger['info'](_0x066c('0x19'),_0x31b249);logger[_0x066c('0x20')](_0x066c('0x19'),_0x31b249,JSON['stringify'](_0x318903));_0x1bb915(_0x318903);})[_0x066c('0x18')](function(_0x18e18c){logger[_0x066c('0xe')](_0x066c('0x19'),_0x18e18c[_0x066c('0x10')],_0x31b249);_0x2de963(_0x923e9b[_0x066c('0xe')](0x1f4,_0x18e18c['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 9db768b..ad774e6 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 _0x9cb4=['update','delete','/:id','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','describe','show','post','put'];(function(_0x4aabbf,_0x59fc6d){var _0x4736e1=function(_0x52de5f){while(--_0x52de5f){_0x4aabbf['push'](_0x4aabbf['shift']());}};_0x4736e1(++_0x59fc6d);}(_0x9cb4,0x190));var _0x49cb=function(_0x49691b,_0x3865f4){_0x49691b=_0x49691b-0x0;var _0x55a2b5=_0x9cb4[_0x49691b];return _0x55a2b5;};'use strict';var multer=require(_0x49cb('0x0'));var util=require(_0x49cb('0x1'));var path=require(_0x49cb('0x2'));var timeout=require(_0x49cb('0x3'));var express=require(_0x49cb('0x4'));var router=express['Router']();var fs_extra=require(_0x49cb('0x5'));var auth=require(_0x49cb('0x6'));var interaction=require(_0x49cb('0x7'));var config=require('../../config/environment');var controller=require('./squareReportDetail.controller');router[_0x49cb('0x8')]('/',auth[_0x49cb('0x9')](),controller['index']);router[_0x49cb('0x8')]('/describe',auth[_0x49cb('0x9')](),controller[_0x49cb('0xa')]);router[_0x49cb('0x8')]('/:id',auth[_0x49cb('0x9')](),controller[_0x49cb('0xb')]);router[_0x49cb('0xc')]('/',auth[_0x49cb('0x9')](),controller['create']);router[_0x49cb('0xd')]('/:id',auth[_0x49cb('0x9')](),controller[_0x49cb('0xe')]);router[_0x49cb('0xf')](_0x49cb('0x10'),auth[_0x49cb('0x9')](),controller[_0x49cb('0x11')]);module['exports']=router; \ No newline at end of file +var _0xc34b=['create','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','isAuthenticated','index','get','/describe','/:id','show','post'];(function(_0x4c6154,_0x25d59d){var _0x4ae906=function(_0x2fd70d){while(--_0x2fd70d){_0x4c6154['push'](_0x4c6154['shift']());}};_0x4ae906(++_0x25d59d);}(_0xc34b,0xb6));var _0xbc34=function(_0x1b9cd5,_0x103dc4){_0x1b9cd5=_0x1b9cd5-0x0;var _0x4c74ca=_0xc34b[_0x1b9cd5];return _0x4c74ca;};'use strict';var multer=require(_0xbc34('0x0'));var util=require(_0xbc34('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbc34('0x2'));var router=express[_0xbc34('0x3')]();var fs_extra=require(_0xbc34('0x4'));var auth=require(_0xbc34('0x5'));var interaction=require(_0xbc34('0x6'));var config=require(_0xbc34('0x7'));var controller=require(_0xbc34('0x8'));router['get']('/',auth[_0xbc34('0x9')](),controller[_0xbc34('0xa')]);router[_0xbc34('0xb')](_0xbc34('0xc'),auth[_0xbc34('0x9')](),controller['describe']);router[_0xbc34('0xb')](_0xbc34('0xd'),auth['isAuthenticated'](),controller[_0xbc34('0xe')]);router[_0xbc34('0xf')]('/',auth[_0xbc34('0x9')](),controller[_0xbc34('0x10')]);router[_0xbc34('0x11')](_0xbc34('0xd'),auth[_0xbc34('0x9')](),controller[_0xbc34('0x12')]);router[_0xbc34('0x13')](_0xbc34('0xd'),auth[_0xbc34('0x9')](),controller[_0xbc34('0x14')]);module[_0xbc34('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 4eb752b..376c9a7 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 _0x0a78=['exports','STRING','TEXT','sequelize'];(function(_0x292427,_0x5dc5d1){var _0x1e5629=function(_0xeb9913){while(--_0xeb9913){_0x292427['push'](_0x292427['shift']());}};_0x1e5629(++_0x5dc5d1);}(_0x0a78,0x1ab));var _0x80a7=function(_0x2183c8,_0x114835){_0x2183c8=_0x2183c8-0x0;var _0x4b9c42=_0x0a78[_0x2183c8];return _0x4b9c42;};'use strict';var Sequelize=require(_0x80a7('0x0'));module[_0x80a7('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0x80a7('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x80a7('0x3')]},'project_name':{'type':Sequelize[_0x80a7('0x2')]},'callerid':{'type':Sequelize[_0x80a7('0x2')]}}; \ No newline at end of file +var _0x7aba=['sequelize','exports','STRING','TEXT'];(function(_0x56fe98,_0x43dc16){var _0x212f4f=function(_0xc3427d){while(--_0xc3427d){_0x56fe98['push'](_0x56fe98['shift']());}};_0x212f4f(++_0x43dc16);}(_0x7aba,0x148));var _0xa7ab=function(_0x120e9f,_0x1fc050){_0x120e9f=_0x120e9f-0x0;var _0x2987c0=_0x7aba[_0x120e9f];return _0x2987c0;};'use strict';var Sequelize=require(_0xa7ab('0x0'));module[_0xa7ab('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0xa7ab('0x2')]},'application':{'type':Sequelize[_0xa7ab('0x2')]},'data':{'type':Sequelize[_0xa7ab('0x3')]},'project_name':{'type':Sequelize[_0xa7ab('0x2')]},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 4883710..600943f 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 _0x185e=['destroy','name','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','merge','filter','count','includeAll','rows','params','intersection','include','options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','status','json','offset','undefined','limit','set','apply','save','update','then'];(function(_0x2024e2,_0x25a093){var _0x29ab6a=function(_0x29ee5d){while(--_0x29ee5d){_0x2024e2['push'](_0x2024e2['shift']());}};_0x29ab6a(++_0x25a093);}(_0x185e,0x1c0));var _0xe185=function(_0x9a9090,_0x1f81f9){_0x9a9090=_0x9a9090-0x0;var _0x4a6653=_0x185e[_0x9a9090];return _0x4a6653;};'use strict';var emlformat=require(_0xe185('0x0'));var rimraf=require(_0xe185('0x1'));var zipdir=require(_0xe185('0x2'));var jsonpatch=require(_0xe185('0x3'));var rp=require(_0xe185('0x4'));var moment=require(_0xe185('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe185('0x6'));var util=require(_0xe185('0x7'));var path=require(_0xe185('0x8'));var sox=require('sox');var csv=require(_0xe185('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe185('0xa'));var _=require(_0xe185('0xb'));var squel=require(_0xe185('0xc'));var crypto=require(_0xe185('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe185('0xe'));var toCsv=require(_0xe185('0x9'));var querystring=require(_0xe185('0xf'));var Papa=require(_0xe185('0x10'));var Redis=require(_0xe185('0x11'));var authService=require(_0xe185('0x12'));var qs=require(_0xe185('0x13'));var as=require(_0xe185('0x14'));var hardwareService=require(_0xe185('0x15'));var logger=require('../../config/logger')(_0xe185('0x16'));var utils=require('../../config/utils');var config=require(_0xe185('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c277a,_0x187f1e){_0x187f1e=_0x187f1e||0xcc;return function(_0x185a8e){if(_0x185a8e){return _0x5c277a[_0xe185('0x18')](_0x187f1e);}return _0x5c277a[_0xe185('0x19')](_0x187f1e)['end']();};}function respondWithResult(_0x394a55,_0x57a569){_0x57a569=_0x57a569||0xc8;return function(_0x2a6a03){if(_0x2a6a03){return _0x394a55[_0xe185('0x19')](_0x57a569)[_0xe185('0x1a')](_0x2a6a03);}};}function respondWithFilteredResult(_0x5d4f98,_0x4fa574){return function(_0x5d682c){if(_0x5d682c){var _0x52470f=typeof _0x4fa574[_0xe185('0x1b')]===_0xe185('0x1c')&&typeof _0x4fa574[_0xe185('0x1d')]===_0xe185('0x1c');var _0x2b0022=_0x5d682c['count'];var _0xbaf898=_0x52470f?0x0:_0x4fa574[_0xe185('0x1b')];var _0x14607d=_0x52470f?_0x5d682c['count']:_0x4fa574['offset']+_0x4fa574[_0xe185('0x1d')];var _0x494179;if(_0x14607d>=_0x2b0022){_0x14607d=_0x2b0022;_0x494179=0xc8;}else{_0x494179=0xce;}_0x5d4f98[_0xe185('0x19')](_0x494179);return _0x5d4f98[_0xe185('0x1e')]('Content-Range',_0xbaf898+'-'+_0x14607d+'/'+_0x2b0022)[_0xe185('0x1a')](_0x5d682c);}return null;};}function patchUpdates(_0x5bb34a){return function(_0xfa0fe8){try{jsonpatch[_0xe185('0x1f')](_0xfa0fe8,_0x5bb34a,!![]);}catch(_0x159972){return BPromise['reject'](_0x159972);}return _0xfa0fe8[_0xe185('0x20')]();};}function saveUpdates(_0x3630af,_0x4dd415){return function(_0x4cda82){if(_0x4cda82){return _0x4cda82[_0xe185('0x21')](_0x3630af)[_0xe185('0x22')](function(_0x26577d){return _0x26577d;});}return null;};}function removeEntity(_0x2cc6ce,_0x4567fe){return function(_0x3f0cab){if(_0x3f0cab){return _0x3f0cab[_0xe185('0x23')]()[_0xe185('0x22')](function(){_0x2cc6ce['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x14d257,_0x47c9ed){return function(_0xe8b1d5){if(!_0xe8b1d5){_0x14d257[_0xe185('0x18')](0x194);}return _0xe8b1d5;};}function handleError(_0x2f5f7b,_0x5f3de4){_0x5f3de4=_0x5f3de4||0x1f4;return function(_0xa2fa3d){logger['error'](_0xa2fa3d['stack']);if(_0xa2fa3d['name']){delete _0xa2fa3d[_0xe185('0x24')];}_0x2f5f7b['status'](_0x5f3de4)['send'](_0xa2fa3d);};}exports[_0xe185('0x25')]=function(_0x2d4362,_0x111268){var _0x2504b0={},_0x7ec43b={},_0x543062={'count':0x0,'rows':[]};var _0x4f14c7=_[_0xe185('0x26')](db[_0xe185('0x27')][_0xe185('0x28')],function(_0x19627c){return{'name':_0x19627c[_0xe185('0x29')],'type':_0x19627c[_0xe185('0x2a')][_0xe185('0x2b')]};});_0x7ec43b[_0xe185('0x2c')]=_[_0xe185('0x26')](_0x4f14c7,_0xe185('0x24'));_0x7ec43b[_0xe185('0x2d')]=_[_0xe185('0x2e')](_0x2d4362[_0xe185('0x2d')]);_0x7ec43b[_0xe185('0x2f')]=_['intersection'](_0x7ec43b[_0xe185('0x2c')],_0x7ec43b['query']);_0x2504b0[_0xe185('0x30')]=_['intersection'](_0x7ec43b['model'],qs[_0xe185('0x31')](_0x2d4362[_0xe185('0x2d')]['fields']));_0x2504b0['attributes']=_0x2504b0[_0xe185('0x30')][_0xe185('0x32')]?_0x2504b0[_0xe185('0x30')]:_0x7ec43b[_0xe185('0x2c')];if(!_0x2d4362[_0xe185('0x2d')][_0xe185('0x33')]('nolimit')){_0x2504b0[_0xe185('0x1d')]=qs[_0xe185('0x1d')](_0x2d4362[_0xe185('0x2d')][_0xe185('0x1d')]);_0x2504b0[_0xe185('0x1b')]=qs[_0xe185('0x1b')](_0x2d4362[_0xe185('0x2d')][_0xe185('0x1b')]);}_0x2504b0[_0xe185('0x34')]=qs['sort'](_0x2d4362[_0xe185('0x2d')][_0xe185('0x35')]);_0x2504b0[_0xe185('0x36')]=qs[_0xe185('0x2f')](_['pick'](_0x2d4362['query'],_0x7ec43b[_0xe185('0x2f')]),_0x4f14c7);if(_0x2d4362[_0xe185('0x2d')]['filter']){_0x2504b0[_0xe185('0x36')]=_[_0xe185('0x37')](_0x2504b0[_0xe185('0x36')],{'$or':_[_0xe185('0x26')](_0x4f14c7,function(_0xb373cf){if(_0xb373cf[_0xe185('0x2a')]!=='VIRTUAL'){var _0x486c05={};_0x486c05[_0xb373cf[_0xe185('0x24')]]={'$like':'%'+_0x2d4362[_0xe185('0x2d')][_0xe185('0x38')]+'%'};return _0x486c05;}})});}_0x2504b0=_[_0xe185('0x37')]({},_0x2504b0,_0x2d4362['options']);var _0x1f6f3d={'where':_0x2504b0[_0xe185('0x36')]};return db[_0xe185('0x27')][_0xe185('0x39')](_0x1f6f3d)['then'](function(_0x4917e1){_0x543062[_0xe185('0x39')]=_0x4917e1;if(_0x2d4362[_0xe185('0x2d')][_0xe185('0x3a')]){_0x2504b0['include']=[{'all':!![]}];}return db[_0xe185('0x27')]['findAll'](_0x2504b0);})[_0xe185('0x22')](function(_0x2d4e89){_0x543062[_0xe185('0x3b')]=_0x2d4e89;return _0x543062;})[_0xe185('0x22')](respondWithFilteredResult(_0x111268,_0x2504b0))['catch'](handleError(_0x111268,null));};exports['show']=function(_0x5365ae,_0xb582d){var _0x371932={'raw':!![],'where':{'id':_0x5365ae[_0xe185('0x3c')]['id']}},_0x2fa0b0={};_0x2fa0b0[_0xe185('0x2c')]=_[_0xe185('0x2e')](db[_0xe185('0x27')][_0xe185('0x28')]);_0x2fa0b0['query']=_['keys'](_0x5365ae[_0xe185('0x2d')]);_0x2fa0b0[_0xe185('0x2f')]=_[_0xe185('0x3d')](_0x2fa0b0['model'],_0x2fa0b0[_0xe185('0x2d')]);_0x371932[_0xe185('0x30')]=_['intersection'](_0x2fa0b0[_0xe185('0x2c')],qs['fields'](_0x5365ae[_0xe185('0x2d')][_0xe185('0x31')]));_0x371932['attributes']=_0x371932['attributes'][_0xe185('0x32')]?_0x371932[_0xe185('0x30')]:_0x2fa0b0[_0xe185('0x2c')];if(_0x5365ae[_0xe185('0x2d')][_0xe185('0x3a')]){_0x371932[_0xe185('0x3e')]=[{'all':!![]}];}_0x371932=_['merge']({},_0x371932,_0x5365ae[_0xe185('0x3f')]);return db['SquareDetailsReport'][_0xe185('0x40')](_0x371932)[_0xe185('0x22')](handleEntityNotFound(_0xb582d,null))['then'](respondWithResult(_0xb582d,null))[_0xe185('0x41')](handleError(_0xb582d,null));};exports[_0xe185('0x42')]=function(_0x38d189,_0x2bde12){return db['SquareDetailsReport']['create'](_0x38d189[_0xe185('0x43')],{})[_0xe185('0x22')](respondWithResult(_0x2bde12,0xc9))['catch'](handleError(_0x2bde12,null));};exports[_0xe185('0x21')]=function(_0x5da6cd,_0x25a3e8){if(_0x5da6cd[_0xe185('0x43')]['id']){delete _0x5da6cd[_0xe185('0x43')]['id'];}return db[_0xe185('0x27')]['find']({'where':{'id':_0x5da6cd[_0xe185('0x3c')]['id']}})[_0xe185('0x22')](handleEntityNotFound(_0x25a3e8,null))[_0xe185('0x22')](saveUpdates(_0x5da6cd[_0xe185('0x43')],null))[_0xe185('0x22')](respondWithResult(_0x25a3e8,null))[_0xe185('0x41')](handleError(_0x25a3e8,null));};exports[_0xe185('0x23')]=function(_0x1493ba,_0xf7454c){return db[_0xe185('0x27')][_0xe185('0x40')]({'where':{'id':_0x1493ba[_0xe185('0x3c')]['id']}})[_0xe185('0x22')](handleEntityNotFound(_0xf7454c,null))[_0xe185('0x22')](removeEntity(_0xf7454c,null))['catch'](handleError(_0xf7454c,null));};exports['describe']=function(_0x360709,_0x526349){return db[_0xe185('0x27')][_0xe185('0x44')]()[_0xe185('0x22')](respondWithResult(_0x526349,null))[_0xe185('0x41')](handleError(_0x526349,null));}; \ No newline at end of file +var _0x8929=['squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','apply','reject','save','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','VIRTUAL','SquareDetailsReport','includeAll','include','show','params','options','find','catch','create','update','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x8929,0x10e));var _0x9892=function(_0x2a8c21,_0x163576){_0x2a8c21=_0x2a8c21-0x0;var _0x5f3061=_0x8929[_0x2a8c21];return _0x5f3061;};'use strict';var emlformat=require(_0x9892('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9892('0x1'));var jsonpatch=require(_0x9892('0x2'));var rp=require(_0x9892('0x3'));var moment=require(_0x9892('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9892('0x5'));var util=require(_0x9892('0x6'));var path=require('path');var sox=require(_0x9892('0x7'));var csv=require(_0x9892('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9892('0x9'));var _=require('lodash');var squel=require(_0x9892('0xa'));var crypto=require('crypto');var jsforce=require(_0x9892('0xb'));var deskjs=require(_0x9892('0xc'));var toCsv=require(_0x9892('0x8'));var querystring=require(_0x9892('0xd'));var Papa=require('papaparse');var Redis=require(_0x9892('0xe'));var authService=require(_0x9892('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9892('0x10'))(_0x9892('0x11'));var utils=require(_0x9892('0x12'));var config=require(_0x9892('0x13'));var licenseUtil=require(_0x9892('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x22011b,_0xcaf5e3){_0xcaf5e3=_0xcaf5e3||0xcc;return function(_0x1c38c0){if(_0x1c38c0){return _0x22011b[_0x9892('0x15')](_0xcaf5e3);}return _0x22011b[_0x9892('0x16')](_0xcaf5e3)[_0x9892('0x17')]();};}function respondWithResult(_0x411b1c,_0xab86ee){_0xab86ee=_0xab86ee||0xc8;return function(_0x479755){if(_0x479755){return _0x411b1c[_0x9892('0x16')](_0xab86ee)[_0x9892('0x18')](_0x479755);}};}function respondWithFilteredResult(_0x21d54f,_0x907632){return function(_0x18f242){if(_0x18f242){var _0x1664a7=typeof _0x907632['offset']==='undefined'&&typeof _0x907632[_0x9892('0x19')]===_0x9892('0x1a');var _0x22d421=_0x18f242[_0x9892('0x1b')];var _0x392b7c=_0x1664a7?0x0:_0x907632[_0x9892('0x1c')];var _0x13d0ee=_0x1664a7?_0x18f242[_0x9892('0x1b')]:_0x907632[_0x9892('0x1c')]+_0x907632[_0x9892('0x19')];var _0x55dec2;if(_0x13d0ee>=_0x22d421){_0x13d0ee=_0x22d421;_0x55dec2=0xc8;}else{_0x55dec2=0xce;}_0x21d54f[_0x9892('0x16')](_0x55dec2);return _0x21d54f['set']('Content-Range',_0x392b7c+'-'+_0x13d0ee+'/'+_0x22d421)[_0x9892('0x18')](_0x18f242);}return null;};}function patchUpdates(_0x1b8035){return function(_0x488ae4){try{jsonpatch[_0x9892('0x1d')](_0x488ae4,_0x1b8035,!![]);}catch(_0x591cd8){return BPromise[_0x9892('0x1e')](_0x591cd8);}return _0x488ae4[_0x9892('0x1f')]();};}function saveUpdates(_0x80a26d,_0x41359a){return function(_0x408ce0){if(_0x408ce0){return _0x408ce0['update'](_0x80a26d)[_0x9892('0x20')](function(_0x5e4b06){return _0x5e4b06;});}return null;};}function removeEntity(_0x5f2baa,_0x375891){return function(_0x6f4b6f){if(_0x6f4b6f){return _0x6f4b6f[_0x9892('0x21')]()[_0x9892('0x20')](function(){_0x5f2baa[_0x9892('0x16')](0xcc)[_0x9892('0x17')]();});}};}function handleEntityNotFound(_0x4cc319,_0x45cac8){return function(_0x3af887){if(!_0x3af887){_0x4cc319[_0x9892('0x15')](0x194);}return _0x3af887;};}function handleError(_0x36f948,_0x5949d5){_0x5949d5=_0x5949d5||0x1f4;return function(_0x25d811){logger[_0x9892('0x22')](_0x25d811[_0x9892('0x23')]);if(_0x25d811[_0x9892('0x24')]){delete _0x25d811[_0x9892('0x24')];}_0x36f948[_0x9892('0x16')](_0x5949d5)[_0x9892('0x25')](_0x25d811);};}exports[_0x9892('0x26')]=function(_0x4633d1,_0x801c3a){var _0x2fa71b={},_0x3478cc={},_0x5078e2={'count':0x0,'rows':[]};var _0x4bef05=_['map'](db['SquareDetailsReport'][_0x9892('0x27')],function(_0x137860){return{'name':_0x137860[_0x9892('0x28')],'type':_0x137860[_0x9892('0x29')][_0x9892('0x2a')]};});_0x3478cc[_0x9892('0x2b')]=_[_0x9892('0x2c')](_0x4bef05,'name');_0x3478cc['query']=_[_0x9892('0x2d')](_0x4633d1[_0x9892('0x2e')]);_0x3478cc[_0x9892('0x2f')]=_[_0x9892('0x30')](_0x3478cc['model'],_0x3478cc['query']);_0x2fa71b[_0x9892('0x31')]=_[_0x9892('0x30')](_0x3478cc[_0x9892('0x2b')],qs[_0x9892('0x32')](_0x4633d1[_0x9892('0x2e')]['fields']));_0x2fa71b[_0x9892('0x31')]=_0x2fa71b['attributes'][_0x9892('0x33')]?_0x2fa71b['attributes']:_0x3478cc[_0x9892('0x2b')];if(!_0x4633d1[_0x9892('0x2e')]['hasOwnProperty'](_0x9892('0x34'))){_0x2fa71b[_0x9892('0x19')]=qs['limit'](_0x4633d1[_0x9892('0x2e')][_0x9892('0x19')]);_0x2fa71b[_0x9892('0x1c')]=qs[_0x9892('0x1c')](_0x4633d1[_0x9892('0x2e')][_0x9892('0x1c')]);}_0x2fa71b[_0x9892('0x35')]=qs[_0x9892('0x36')](_0x4633d1[_0x9892('0x2e')][_0x9892('0x36')]);_0x2fa71b[_0x9892('0x37')]=qs[_0x9892('0x2f')](_['pick'](_0x4633d1['query'],_0x3478cc['filters']),_0x4bef05);if(_0x4633d1[_0x9892('0x2e')]['filter']){_0x2fa71b[_0x9892('0x37')]=_[_0x9892('0x38')](_0x2fa71b[_0x9892('0x37')],{'$or':_[_0x9892('0x2c')](_0x4bef05,function(_0xddd01c){if(_0xddd01c[_0x9892('0x29')]!==_0x9892('0x39')){var _0x24d2d9={};_0x24d2d9[_0xddd01c[_0x9892('0x24')]]={'$like':'%'+_0x4633d1['query']['filter']+'%'};return _0x24d2d9;}})});}_0x2fa71b=_[_0x9892('0x38')]({},_0x2fa71b,_0x4633d1['options']);var _0x2c0c49={'where':_0x2fa71b[_0x9892('0x37')]};return db[_0x9892('0x3a')][_0x9892('0x1b')](_0x2c0c49)['then'](function(_0x53fffa){_0x5078e2['count']=_0x53fffa;if(_0x4633d1[_0x9892('0x2e')][_0x9892('0x3b')]){_0x2fa71b[_0x9892('0x3c')]=[{'all':!![]}];}return db[_0x9892('0x3a')]['findAll'](_0x2fa71b);})[_0x9892('0x20')](function(_0xd447a7){_0x5078e2['rows']=_0xd447a7;return _0x5078e2;})[_0x9892('0x20')](respondWithFilteredResult(_0x801c3a,_0x2fa71b))['catch'](handleError(_0x801c3a,null));};exports[_0x9892('0x3d')]=function(_0x535944,_0x356f56){var _0x392ed5={'raw':!![],'where':{'id':_0x535944[_0x9892('0x3e')]['id']}},_0x2d07f0={};_0x2d07f0[_0x9892('0x2b')]=_[_0x9892('0x2d')](db[_0x9892('0x3a')][_0x9892('0x27')]);_0x2d07f0['query']=_[_0x9892('0x2d')](_0x535944['query']);_0x2d07f0[_0x9892('0x2f')]=_['intersection'](_0x2d07f0['model'],_0x2d07f0[_0x9892('0x2e')]);_0x392ed5[_0x9892('0x31')]=_[_0x9892('0x30')](_0x2d07f0[_0x9892('0x2b')],qs['fields'](_0x535944[_0x9892('0x2e')][_0x9892('0x32')]));_0x392ed5[_0x9892('0x31')]=_0x392ed5['attributes'][_0x9892('0x33')]?_0x392ed5[_0x9892('0x31')]:_0x2d07f0[_0x9892('0x2b')];if(_0x535944[_0x9892('0x2e')][_0x9892('0x3b')]){_0x392ed5[_0x9892('0x3c')]=[{'all':!![]}];}_0x392ed5=_[_0x9892('0x38')]({},_0x392ed5,_0x535944[_0x9892('0x3f')]);return db[_0x9892('0x3a')][_0x9892('0x40')](_0x392ed5)[_0x9892('0x20')](handleEntityNotFound(_0x356f56,null))[_0x9892('0x20')](respondWithResult(_0x356f56,null))[_0x9892('0x41')](handleError(_0x356f56,null));};exports[_0x9892('0x42')]=function(_0x40bbfc,_0x591d4e){return db[_0x9892('0x3a')][_0x9892('0x42')](_0x40bbfc['body'],{})['then'](respondWithResult(_0x591d4e,0xc9))[_0x9892('0x41')](handleError(_0x591d4e,null));};exports[_0x9892('0x43')]=function(_0x1965a2,_0x3a4b8b){if(_0x1965a2[_0x9892('0x44')]['id']){delete _0x1965a2[_0x9892('0x44')]['id'];}return db[_0x9892('0x3a')][_0x9892('0x40')]({'where':{'id':_0x1965a2[_0x9892('0x3e')]['id']}})[_0x9892('0x20')](handleEntityNotFound(_0x3a4b8b,null))['then'](saveUpdates(_0x1965a2[_0x9892('0x44')],null))[_0x9892('0x20')](respondWithResult(_0x3a4b8b,null))[_0x9892('0x41')](handleError(_0x3a4b8b,null));};exports[_0x9892('0x21')]=function(_0x4e5cdb,_0x2094c3){return db['SquareDetailsReport'][_0x9892('0x40')]({'where':{'id':_0x4e5cdb[_0x9892('0x3e')]['id']}})[_0x9892('0x20')](handleEntityNotFound(_0x2094c3,null))['then'](removeEntity(_0x2094c3,null))['catch'](handleError(_0x2094c3,null));};exports['describe']=function(_0x511869,_0x20d474){return db['SquareDetailsReport'][_0x9892('0x45')]()[_0x9892('0x20')](respondWithResult(_0x20d474,null))[_0x9892('0x41')](handleError(_0x20d474,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 11bd39f..1916bd6 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 _0x4811=['../../config/environment','exports','report_square_details','lodash','util','../../config/logger','api','moment','path','rimraf'];(function(_0x1fdd66,_0x1a89cd){var _0x4b2001=function(_0x11e32c){while(--_0x11e32c){_0x1fdd66['push'](_0x1fdd66['shift']());}};_0x4b2001(++_0x1a89cd);}(_0x4811,0xf3));var _0x1481=function(_0x2786ea,_0x16c3c3){_0x2786ea=_0x2786ea-0x0;var _0x5c38e5=_0x4811[_0x2786ea];return _0x5c38e5;};'use strict';var _=require(_0x1481('0x0'));var util=require(_0x1481('0x1'));var logger=require(_0x1481('0x2'))(_0x1481('0x3'));var moment=require(_0x1481('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1481('0x5'));var rimraf=require(_0x1481('0x6'));var config=require(_0x1481('0x7'));var attributes=require('./squareReportDetail.attributes');module[_0x1481('0x8')]=function(_0x53f1c0,_0x126b38){return _0x53f1c0['define']('SquareDetailsReport',attributes,{'tableName':_0x1481('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x95cf=['rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','report_square_details','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x4f1f64,_0x445efa){var _0x3661a5=function(_0x413f50){while(--_0x413f50){_0x4f1f64['push'](_0x4f1f64['shift']());}};_0x3661a5(++_0x445efa);}(_0x95cf,0x14a));var _0xf95c=function(_0x55ae0f,_0x4d17e0){_0x55ae0f=_0x55ae0f-0x0;var _0x2f3a25=_0x95cf[_0x55ae0f];return _0x2f3a25;};'use strict';var _=require(_0xf95c('0x0'));var util=require(_0xf95c('0x1'));var logger=require(_0xf95c('0x2'))('api');var moment=require(_0xf95c('0x3'));var BPromise=require(_0xf95c('0x4'));var rp=require(_0xf95c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf95c('0x6'));var config=require(_0xf95c('0x7'));var attributes=require(_0xf95c('0x8'));module[_0xf95c('0x9')]=function(_0x427a41,_0x53c801){return _0x427a41[_0xf95c('0xa')]('SquareDetailsReport',attributes,{'tableName':_0xf95c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index e9445c4..a56e258 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 _0x1399=['lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','SquareDetailsReport','create','options','raw','info','CreateSquareDetailsReport','debug'];(function(_0x1c96de,_0x170896){var _0x557fd5=function(_0x169eaf){while(--_0x169eaf){_0x1c96de['push'](_0x1c96de['shift']());}};_0x557fd5(++_0x170896);}(_0x1399,0x16c));var _0x9139=function(_0xa388a2,_0x40bde6){_0xa388a2=_0xa388a2-0x0;var _0x7ce7f6=_0x1399[_0xa388a2];return _0x7ce7f6;};'use strict';var _=require(_0x9139('0x0'));var util=require(_0x9139('0x1'));var moment=require('moment');var BPromise=require(_0x9139('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9139('0x3'));var db=require(_0x9139('0x4'))['db'];var utils=require(_0x9139('0x5'));var logger=require(_0x9139('0x6'))(_0x9139('0x7'));var config=require(_0x9139('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9139('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x11d2ed,_0x4d5d1e,_0x51832d){return new BPromise(function(_0x11a03f,_0x59aec5){return client['request'](_0x11d2ed,_0x51832d)[_0x9139('0xa')](function(_0x385e2c){logger['info'](_0x9139('0xb'),_0x4d5d1e,_0x9139('0xc'));logger['debug']('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x4d5d1e,_0x9139('0xc'),JSON[_0x9139('0xd')](_0x385e2c));if(_0x385e2c[_0x9139('0xe')]){if(_0x385e2c[_0x9139('0xe')][_0x9139('0xf')]===0x1f4){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x4d5d1e,_0x385e2c['error'][_0x9139('0x10')]);return _0x59aec5(_0x385e2c['error'][_0x9139('0x10')]);}logger[_0x9139('0xe')](_0x9139('0xb'),_0x4d5d1e,_0x385e2c[_0x9139('0xe')]['message']);return _0x11a03f(_0x385e2c[_0x9139('0xe')]['message']);}else{logger['info']('SquareDetailsReport,\x20%s,\x20%s',_0x4d5d1e,_0x9139('0xc'));_0x11a03f(_0x385e2c[_0x9139('0x11')][_0x9139('0x10')]);}})[_0x9139('0x12')](function(_0x18801b){logger[_0x9139('0xe')]('SquareDetailsReport,\x20%s,\x20%s',_0x4d5d1e,_0x18801b);_0x59aec5(_0x18801b);});});}exports['CreateSquareDetailsReport']=function(_0x13cab8){var _0xe39cbc=this;return new Promise(function(_0x5e0a59,_0x56b316){return db[_0x9139('0x13')][_0x9139('0x14')](_0x13cab8['body'],{'raw':_0x13cab8[_0x9139('0x15')]?_0x13cab8[_0x9139('0x15')][_0x9139('0x16')]===undefined?!![]:![]:!![]})[_0x9139('0xa')](function(_0xd2eb33){logger[_0x9139('0x17')](_0x9139('0x18'),_0x13cab8);logger[_0x9139('0x19')](_0x9139('0x18'),_0x13cab8,JSON[_0x9139('0xd')](_0xd2eb33));_0x5e0a59(_0xd2eb33);})[_0x9139('0x12')](function(_0x269f8a){logger[_0x9139('0xe')](_0x9139('0x18'),_0x269f8a[_0x9139('0x10')],_0x13cab8);_0x56b316(_0xe39cbc[_0x9139('0xe')](0x1f4,_0x269f8a[_0x9139('0x10')]));});});}; \ No newline at end of file +var _0x594d=['then','info','SquareDetailsReport,\x20%s,\x20%s','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','create','options','raw','CreateSquareDetailsReport','stringify','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request'];(function(_0x22f76d,_0x40df07){var _0x49ada8=function(_0x33fd85){while(--_0x33fd85){_0x22f76d['push'](_0x22f76d['shift']());}};_0x49ada8(++_0x40df07);}(_0x594d,0x92));var _0xd594=function(_0x54c5b2,_0x5a8367){_0x54c5b2=_0x54c5b2-0x0;var _0x2fa0ae=_0x594d[_0x54c5b2];return _0x2fa0ae;};'use strict';var _=require(_0xd594('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd594('0x1'));var rs=require(_0xd594('0x2'));var fs=require('fs');var Redis=require(_0xd594('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd594('0x4'));var logger=require(_0xd594('0x5'))(_0xd594('0x6'));var config=require(_0xd594('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd594('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b1c64,_0x446711,_0xeedad0){return new BPromise(function(_0x20325a,_0x20718a){return client[_0xd594('0x9')](_0x3b1c64,_0xeedad0)[_0xd594('0xa')](function(_0xf3043e){logger[_0xd594('0xb')](_0xd594('0xc'),_0x446711,'request\x20sent');logger[_0xd594('0xd')](_0xd594('0xe'),_0x446711,_0xd594('0xf'),JSON['stringify'](_0xf3043e));if(_0xf3043e[_0xd594('0x10')]){if(_0xf3043e[_0xd594('0x10')][_0xd594('0x11')]===0x1f4){logger[_0xd594('0x10')](_0xd594('0xc'),_0x446711,_0xf3043e[_0xd594('0x10')][_0xd594('0x12')]);return _0x20718a(_0xf3043e['error']['message']);}logger[_0xd594('0x10')](_0xd594('0xc'),_0x446711,_0xf3043e['error'][_0xd594('0x12')]);return _0x20325a(_0xf3043e['error'][_0xd594('0x12')]);}else{logger[_0xd594('0xb')](_0xd594('0xc'),_0x446711,'request\x20sent');_0x20325a(_0xf3043e[_0xd594('0x13')]['message']);}})['catch'](function(_0x2a5f17){logger[_0xd594('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x446711,_0x2a5f17);_0x20718a(_0x2a5f17);});});}exports['CreateSquareDetailsReport']=function(_0x232776){var _0x4ea0d5=this;return new Promise(function(_0x54f640,_0x3ae9be){return db['SquareDetailsReport'][_0xd594('0x14')](_0x232776['body'],{'raw':_0x232776[_0xd594('0x15')]?_0x232776['options'][_0xd594('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x3b0fda){logger[_0xd594('0xb')](_0xd594('0x17'),_0x232776);logger[_0xd594('0xd')](_0xd594('0x17'),_0x232776,JSON[_0xd594('0x18')](_0x3b0fda));_0x54f640(_0x3b0fda);})[_0xd594('0x19')](function(_0x2b8495){logger[_0xd594('0x10')](_0xd594('0x17'),_0x2b8495[_0xd594('0x12')],_0x232776);_0x3ae9be(_0x4ea0d5[_0xd594('0x10')](0x1f4,_0x2b8495[_0xd594('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index fab34c3..c3ccc33 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 _0xf461=['exports','express','Router','../../components/auth/service','./system.controller','get','isAuthenticated','/process/:pid/kill','killProcess'];(function(_0x5bafd3,_0x474626){var _0x4aeb83=function(_0x4ab61a){while(--_0x4ab61a){_0x5bafd3['push'](_0x5bafd3['shift']());}};_0x4aeb83(++_0x474626);}(_0xf461,0x1cc));var _0x1f46=function(_0x4d0bce,_0x4e91e5){_0x4d0bce=_0x4d0bce-0x0;var _0x50055b=_0xf461[_0x4d0bce];return _0x50055b;};'use strict';var express=require(_0x1f46('0x0'));var router=express[_0x1f46('0x1')]();var auth=require(_0x1f46('0x2'));var controller=require(_0x1f46('0x3'));router[_0x1f46('0x4')]('/',auth[_0x1f46('0x5')](),controller['index']);router[_0x1f46('0x4')](_0x1f46('0x6'),auth[_0x1f46('0x5')](),controller[_0x1f46('0x7')]);module[_0x1f46('0x8')]=router; \ No newline at end of file +var _0x21fe=['get','isAuthenticated','exports','express','../../components/auth/service','./system.controller'];(function(_0x5b697a,_0x280202){var _0x5de43b=function(_0x2bc32f){while(--_0x2bc32f){_0x5b697a['push'](_0x5b697a['shift']());}};_0x5de43b(++_0x280202);}(_0x21fe,0x1d1));var _0xe21f=function(_0x2cbb72,_0x2e2448){_0x2cbb72=_0x2cbb72-0x0;var _0x296d2a=_0x21fe[_0x2cbb72];return _0x296d2a;};'use strict';var express=require(_0xe21f('0x0'));var router=express['Router']();var auth=require(_0xe21f('0x1'));var controller=require(_0xe21f('0x2'));router[_0xe21f('0x3')]('/',auth[_0xe21f('0x4')](),controller['index']);router[_0xe21f('0x3')]('/process/:pid/kill',auth[_0xe21f('0x4')](),controller['killProcess']);module[_0xe21f('0x5')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 888d32f..a8d6667 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 _0x41ae=['SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','api','util','lodash','inspect','name','index','getAllData','then','status','json','catch','killProcess','components/import/cm','format','pid','split','length','indexOf','params','kill'];(function(_0x71ae3c,_0x404627){var _0x194072=function(_0x13c008){while(--_0x13c008){_0x71ae3c['push'](_0x71ae3c['shift']());}};_0x194072(++_0x404627);}(_0x41ae,0x1ab));var _0xe41a=function(_0x5c1300,_0x3bcd37){_0x5c1300=_0x5c1300-0x0;var _0x325d53=_0x41ae[_0x5c1300];return _0x325d53;};'use strict';var info=require(_0xe41a('0x0'));var exec=require(_0xe41a('0x1'))[_0xe41a('0x2')];var logger=require('../../config/logger')(_0xe41a('0x3'));var util=require(_0xe41a('0x4'));var BPromise=require('bluebird');var _=require(_0xe41a('0x5'));function handleError(_0x5b67f7,_0x235343,_0x20dc71){_0x235343=_0x235343||0x1f4;return function(_0x9da3b3){logger['error']('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x20dc71,_0x235343,util[_0xe41a('0x6')](_0x9da3b3,{'showHidden':![],'depth':null}));delete _0x9da3b3[_0xe41a('0x7')];_0x5b67f7['status'](_0x235343)['send'](_0x9da3b3);};}exports[_0xe41a('0x8')]=function(_0x175b67,_0x1d2be0){return info[_0xe41a('0x9')]()[_0xe41a('0xa')](function(_0x353786){return _0x1d2be0[_0xe41a('0xb')](0xc8)[_0xe41a('0xc')](_0x353786);})[_0xe41a('0xd')](function(_0x340a33){return _0x1d2be0[_0xe41a('0xb')](0x1f4)['json'](_0x340a33);});};exports[_0xe41a('0xe')]=function(_0x48cd4a,_0x1fc15a){var _0x4f42a0=[_0xe41a('0xf')];return new BPromise(function(_0x3f0da2,_0x48285e){return exec(util[_0xe41a('0x10')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x48cd4a['params'][_0xe41a('0x11')]),function(_0x3b6f8c,_0x3beb42,_0x96d885){if(_0x3b6f8c){return _0x48285e(_0x3b6f8c);}return _0x3f0da2(_0x3beb42);});})[_0xe41a('0xa')](function(_0x283e3c){var _0x12152e=![];var _0x4f0016=_0x283e3c[_0xe41a('0x12')](/\n/);for(var _0x4eedc0=0x0,_0x48be0c=_0x4f42a0[_0xe41a('0x13')];_0x4eedc0<_0x48be0c,_0x12152e===![];_0x4eedc0+=0x1){if(_0x283e3c[_0xe41a('0x14')](_0x4f42a0[_0x4eedc0])>=0x0){_0x12152e=!![];}}if(!_0x12152e){throw new Error(util[_0xe41a('0x10')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x48cd4a[_0xe41a('0x15')]['pid']));}process[_0xe41a('0x16')](_0x48cd4a[_0xe41a('0x15')][_0xe41a('0x11')],_0xe41a('0x17'));return _0x1fc15a['status'](0xc8)['json']({'message':util['format'](_0xe41a('0x18'),_0x48cd4a['params'][_0xe41a('0x11')])});})[_0xe41a('0xd')](handleError(_0x1fc15a,null,'killProcess'));}; \ No newline at end of file +var _0xedb5=['kill','params','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','killProcess','child_process','exec','../../config/logger','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','status','getAllData','then','json','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','pid','split','length','Process\x20with\x20pid\x20%s\x20not\x20found!'];(function(_0x1ad7fc,_0x444145){var _0x3bb433=function(_0x1e27ef){while(--_0x1e27ef){_0x1ad7fc['push'](_0x1ad7fc['shift']());}};_0x3bb433(++_0x444145);}(_0xedb5,0x131));var _0x5edb=function(_0x122e2c,_0x49ca1a){_0x122e2c=_0x122e2c-0x0;var _0x652295=_0xedb5[_0x122e2c];return _0x652295;};'use strict';var info=require('systeminformation');var exec=require(_0x5edb('0x0'))[_0x5edb('0x1')];var logger=require(_0x5edb('0x2'))('api');var util=require(_0x5edb('0x3'));var BPromise=require(_0x5edb('0x4'));var _=require(_0x5edb('0x5'));function handleError(_0x474766,_0x539835,_0x183ee0){_0x539835=_0x539835||0x1f4;return function(_0x35355c){logger[_0x5edb('0x6')](_0x5edb('0x7'),_0x183ee0,_0x539835,util['inspect'](_0x35355c,{'showHidden':![],'depth':null}));delete _0x35355c[_0x5edb('0x8')];_0x474766[_0x5edb('0x9')](_0x539835)['send'](_0x35355c);};}exports['index']=function(_0x3704f6,_0x19b945){return info[_0x5edb('0xa')]()[_0x5edb('0xb')](function(_0x3612d6){return _0x19b945[_0x5edb('0x9')](0xc8)['json'](_0x3612d6);})['catch'](function(_0x2e195d){return _0x19b945[_0x5edb('0x9')](0x1f4)[_0x5edb('0xc')](_0x2e195d);});};exports['killProcess']=function(_0x4be9ee,_0x3ca996){var _0x3a0fa7=[_0x5edb('0xd')];return new BPromise(function(_0x2e344c,_0x33db6a){return exec(util[_0x5edb('0xe')](_0x5edb('0xf'),_0x4be9ee['params'][_0x5edb('0x10')]),function(_0x31595d,_0xa036b2,_0x2a4262){if(_0x31595d){return _0x33db6a(_0x31595d);}return _0x2e344c(_0xa036b2);});})[_0x5edb('0xb')](function(_0x1d2dac){var _0x5719b6=![];var _0x4ed3f4=_0x1d2dac[_0x5edb('0x11')](/\n/);for(var _0x6f9d9b=0x0,_0x348a95=_0x3a0fa7[_0x5edb('0x12')];_0x6f9d9b<_0x348a95,_0x5719b6===![];_0x6f9d9b+=0x1){if(_0x1d2dac['indexOf'](_0x3a0fa7[_0x6f9d9b])>=0x0){_0x5719b6=!![];}}if(!_0x5719b6){throw new Error(util['format'](_0x5edb('0x13'),_0x4be9ee['params'][_0x5edb('0x10')]));}process[_0x5edb('0x14')](_0x4be9ee[_0x5edb('0x15')][_0x5edb('0x10')],_0x5edb('0x16'));return _0x3ca996[_0x5edb('0x9')](0xc8)['json']({'message':util[_0x5edb('0xe')](_0x5edb('0x17'),_0x4be9ee[_0x5edb('0x15')][_0x5edb('0x10')])});})['catch'](handleError(_0x3ca996,null,_0x5edb('0x18')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 4a65018..80dd37c 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 _0x2750=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','index','/describe','isAuthenticated','/:id','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x340756,_0xad31ae){var _0x2ef745=function(_0x59ffde){while(--_0x59ffde){_0x340756['push'](_0x340756['shift']());}};_0x2ef745(++_0xad31ae);}(_0x2750,0x13b));var _0x0275=function(_0x3f8f1b,_0x227159){_0x3f8f1b=_0x3f8f1b-0x0;var _0x5e7d0a=_0x2750[_0x3f8f1b];return _0x5e7d0a;};'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 _0x4bc3=['post','put','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','describe','/:id','show'];(function(_0x58b4cf,_0x43b9f9){var _0xb53a20=function(_0x41a7f8){while(--_0x41a7f8){_0x58b4cf['push'](_0x58b4cf['shift']());}};_0xb53a20(++_0x43b9f9);}(_0x4bc3,0x16e));var _0x34bc=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0x4bc3[_0x88cd7b];return _0x56fcc8;};'use strict';var multer=require(_0x34bc('0x0'));var util=require(_0x34bc('0x1'));var path=require('path');var timeout=require(_0x34bc('0x2'));var express=require(_0x34bc('0x3'));var router=express['Router']();var fs_extra=require(_0x34bc('0x4'));var auth=require(_0x34bc('0x5'));var interaction=require(_0x34bc('0x6'));var config=require(_0x34bc('0x7'));var controller=require(_0x34bc('0x8'));router[_0x34bc('0x9')]('/',auth[_0x34bc('0xa')](),controller['index']);router[_0x34bc('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x34bc('0xb')]);router[_0x34bc('0x9')](_0x34bc('0xc'),auth[_0x34bc('0xa')](),controller[_0x34bc('0xd')]);router[_0x34bc('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x34bc('0xf')](_0x34bc('0xc'),auth[_0x34bc('0xa')](),controller['update']);router[_0x34bc('0x10')]('/:id',auth[_0x34bc('0xa')](),controller[_0x34bc('0x11')]);module[_0x34bc('0x12')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 5b2be7a..02e0a7a 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 _0xab75=['exports','STRING','#0091EA','sequelize'];(function(_0x21f457,_0x236b16){var _0x179f47=function(_0xec2a19){while(--_0xec2a19){_0x21f457['push'](_0x21f457['shift']());}};_0x179f47(++_0x236b16);}(_0xab75,0x11f));var _0x5ab7=function(_0x2f8a9b,_0x3faf92){_0x2f8a9b=_0x2f8a9b-0x0;var _0x4f064b=_0xab75[_0x2f8a9b];return _0x4f064b;};'use strict';var Sequelize=require(_0x5ab7('0x0'));module[_0x5ab7('0x1')]={'name':{'type':Sequelize[_0x5ab7('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x5ab7('0x3')},'description':{'type':Sequelize[_0x5ab7('0x2')]}}; \ No newline at end of file +var _0x1e8c=['STRING','name','#0091EA','exports'];(function(_0xd8235c,_0x32cf3d){var _0x3f53bc=function(_0x4b8bd4){while(--_0x4b8bd4){_0xd8235c['push'](_0xd8235c['shift']());}};_0x3f53bc(++_0x32cf3d);}(_0x1e8c,0xd3));var _0xc1e8=function(_0x38c21f,_0x5d27a5){_0x38c21f=_0x38c21f-0x0;var _0x2e1b03=_0x1e8c[_0x38c21f];return _0x2e1b03;};'use strict';var Sequelize=require('sequelize');module[_0xc1e8('0x0')]={'name':{'type':Sequelize[_0xc1e8('0x1')],'unique':_0xc1e8('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xc1e8('0x1')],'defaultValue':_0xc1e8('0x3')},'description':{'type':Sequelize[_0xc1e8('0x1')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index a48f947..88d8548 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 _0xe9d5=['Tags','UserProfileResource','end','sendStatus','stack','name','send','index','Tag','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','rawAttributes','find','create','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','get'];(function(_0x191847,_0x309568){var _0x1e7865=function(_0x3de83e){while(--_0x3de83e){_0x191847['push'](_0x191847['shift']());}};_0x1e7865(++_0x309568);}(_0xe9d5,0x7a));var _0x5e9d=function(_0x4d3941,_0x5b0bc0){_0x4d3941=_0x4d3941-0x0;var _0x5c311b=_0xe9d5[_0x4d3941];return _0x5c311b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5e9d('0x0'));var zipdir=require(_0x5e9d('0x1'));var jsonpatch=require(_0x5e9d('0x2'));var rp=require('request-promise');var moment=require(_0x5e9d('0x3'));var BPromise=require(_0x5e9d('0x4'));var Mustache=require('mustache');var util=require(_0x5e9d('0x5'));var path=require(_0x5e9d('0x6'));var sox=require(_0x5e9d('0x7'));var csv=require(_0x5e9d('0x8'));var ejs=require(_0x5e9d('0x9'));var fs=require('fs');var fs_extra=require(_0x5e9d('0xa'));var _=require(_0x5e9d('0xb'));var squel=require(_0x5e9d('0xc'));var crypto=require(_0x5e9d('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5e9d('0xe'));var as=require(_0x5e9d('0xf'));var hardwareService=require(_0x5e9d('0x10'));var logger=require(_0x5e9d('0x11'))(_0x5e9d('0x12'));var utils=require('../../config/utils');var config=require(_0x5e9d('0x13'));var licenseUtil=require(_0x5e9d('0x14'));var db=require(_0x5e9d('0x15'))['db'];function respondWithStatusCode(_0x2955c8,_0x4ee6d4){_0x4ee6d4=_0x4ee6d4||0xcc;return function(_0x50b524){if(_0x50b524){return _0x2955c8['sendStatus'](_0x4ee6d4);}return _0x2955c8[_0x5e9d('0x16')](_0x4ee6d4)['end']();};}function respondWithResult(_0x350f95,_0x5ae7a3){_0x5ae7a3=_0x5ae7a3||0xc8;return function(_0x410ded){if(_0x410ded){return _0x350f95['status'](_0x5ae7a3)['json'](_0x410ded);}};}function respondWithFilteredResult(_0x1a4301,_0x472373){return function(_0x8e05b4){if(_0x8e05b4){var _0x5bc7c4=typeof _0x472373[_0x5e9d('0x17')]===_0x5e9d('0x18')&&typeof _0x472373[_0x5e9d('0x19')]==='undefined';var _0x118b35=_0x8e05b4[_0x5e9d('0x1a')];var _0xaea705=_0x5bc7c4?0x0:_0x472373[_0x5e9d('0x17')];var _0x1f24c5=_0x5bc7c4?_0x8e05b4[_0x5e9d('0x1a')]:_0x472373[_0x5e9d('0x17')]+_0x472373[_0x5e9d('0x19')];var _0x555349;if(_0x1f24c5>=_0x118b35){_0x1f24c5=_0x118b35;_0x555349=0xc8;}else{_0x555349=0xce;}_0x1a4301[_0x5e9d('0x16')](_0x555349);return _0x1a4301[_0x5e9d('0x1b')](_0x5e9d('0x1c'),_0xaea705+'-'+_0x1f24c5+'/'+_0x118b35)[_0x5e9d('0x1d')](_0x8e05b4);}return null;};}function patchUpdates(_0x1fc101){return function(_0x3c55ac){try{jsonpatch[_0x5e9d('0x1e')](_0x3c55ac,_0x1fc101,!![]);}catch(_0x539eb3){return BPromise['reject'](_0x539eb3);}return _0x3c55ac[_0x5e9d('0x1f')]();};}function saveUpdates(_0x4c0e30,_0x3e01d0){return function(_0x193a47){if(_0x193a47){return _0x193a47[_0x5e9d('0x20')](_0x4c0e30)[_0x5e9d('0x21')](function(_0x1cbc21){return _0x1cbc21;});}return null;};}function removeEntity(_0x1a4ca9,_0x4dc20d){return function(_0x2cd71e){if(_0x2cd71e){return _0x2cd71e[_0x5e9d('0x22')]()[_0x5e9d('0x21')](function(){var _0xbdc633=_0x2cd71e[_0x5e9d('0x23')]({'plain':!![]});var _0x2976e6=_0x5e9d('0x24');return db[_0x5e9d('0x25')]['destroy']({'where':{'type':_0x2976e6,'resourceId':_0xbdc633['id']}})[_0x5e9d('0x21')](function(){return _0x2cd71e;});})[_0x5e9d('0x21')](function(){_0x1a4ca9[_0x5e9d('0x16')](0xcc)[_0x5e9d('0x26')]();});}};}function handleEntityNotFound(_0xb05a37,_0x43e649){return function(_0x2f9635){if(!_0x2f9635){_0xb05a37[_0x5e9d('0x27')](0x194);}return _0x2f9635;};}function handleError(_0x2240d1,_0xf3c646){_0xf3c646=_0xf3c646||0x1f4;return function(_0xe38288){logger['error'](_0xe38288[_0x5e9d('0x28')]);if(_0xe38288['name']){delete _0xe38288[_0x5e9d('0x29')];}_0x2240d1[_0x5e9d('0x16')](_0xf3c646)[_0x5e9d('0x2a')](_0xe38288);};}exports[_0x5e9d('0x2b')]=function(_0x1edcce,_0x3387ac){var _0x4279d4={},_0x5d3fb6={},_0x205c96={'count':0x0,'rows':[]};var _0x24235c=_['map'](db[_0x5e9d('0x2c')]['rawAttributes'],function(_0x3a57bb){return{'name':_0x3a57bb[_0x5e9d('0x2d')],'type':_0x3a57bb[_0x5e9d('0x2e')][_0x5e9d('0x2f')]};});_0x5d3fb6[_0x5e9d('0x30')]=_[_0x5e9d('0x31')](_0x24235c,'name');_0x5d3fb6['query']=_[_0x5e9d('0x32')](_0x1edcce[_0x5e9d('0x33')]);_0x5d3fb6[_0x5e9d('0x34')]=_[_0x5e9d('0x35')](_0x5d3fb6['model'],_0x5d3fb6[_0x5e9d('0x33')]);_0x4279d4['attributes']=_[_0x5e9d('0x35')](_0x5d3fb6[_0x5e9d('0x30')],qs[_0x5e9d('0x36')](_0x1edcce[_0x5e9d('0x33')]['fields']));_0x4279d4[_0x5e9d('0x37')]=_0x4279d4[_0x5e9d('0x37')][_0x5e9d('0x38')]?_0x4279d4[_0x5e9d('0x37')]:_0x5d3fb6[_0x5e9d('0x30')];if(!_0x1edcce[_0x5e9d('0x33')][_0x5e9d('0x39')]('nolimit')){_0x4279d4[_0x5e9d('0x19')]=qs[_0x5e9d('0x19')](_0x1edcce['query'][_0x5e9d('0x19')]);_0x4279d4[_0x5e9d('0x17')]=qs[_0x5e9d('0x17')](_0x1edcce[_0x5e9d('0x33')]['offset']);}_0x4279d4['order']=qs[_0x5e9d('0x3a')](_0x1edcce[_0x5e9d('0x33')][_0x5e9d('0x3a')]);_0x4279d4[_0x5e9d('0x3b')]=qs[_0x5e9d('0x34')](_['pick'](_0x1edcce[_0x5e9d('0x33')],_0x5d3fb6[_0x5e9d('0x34')]),_0x24235c);if(_0x1edcce[_0x5e9d('0x33')][_0x5e9d('0x3c')]){_0x4279d4['where']=_[_0x5e9d('0x3d')](_0x4279d4['where'],{'$or':_[_0x5e9d('0x31')](_0x24235c,function(_0x3a4ed2){if(_0x3a4ed2[_0x5e9d('0x2e')]!==_0x5e9d('0x3e')){var _0x4fea08={};_0x4fea08[_0x3a4ed2[_0x5e9d('0x29')]]={'$like':'%'+_0x1edcce[_0x5e9d('0x33')][_0x5e9d('0x3c')]+'%'};return _0x4fea08;}})});}_0x4279d4=_[_0x5e9d('0x3d')]({},_0x4279d4,_0x1edcce['options']);var _0x315bc2={'where':_0x4279d4[_0x5e9d('0x3b')]};return db[_0x5e9d('0x2c')][_0x5e9d('0x1a')](_0x315bc2)[_0x5e9d('0x21')](function(_0x34c6c8){_0x205c96[_0x5e9d('0x1a')]=_0x34c6c8;if(_0x1edcce[_0x5e9d('0x33')][_0x5e9d('0x3f')]){_0x4279d4[_0x5e9d('0x40')]=[{'all':!![]}];}return db['Tag']['findAll'](_0x4279d4);})['then'](function(_0x2f2604){_0x205c96[_0x5e9d('0x41')]=_0x2f2604;return _0x205c96;})[_0x5e9d('0x21')](respondWithFilteredResult(_0x3387ac,_0x4279d4))[_0x5e9d('0x42')](handleError(_0x3387ac,null));};exports[_0x5e9d('0x43')]=function(_0x5a7aab,_0x36e64a){var _0x1c3198={'raw':!![],'where':{'id':_0x5a7aab[_0x5e9d('0x44')]['id']}},_0x357fe8={};_0x357fe8[_0x5e9d('0x30')]=_[_0x5e9d('0x32')](db['Tag'][_0x5e9d('0x45')]);_0x357fe8[_0x5e9d('0x33')]=_[_0x5e9d('0x32')](_0x5a7aab[_0x5e9d('0x33')]);_0x357fe8[_0x5e9d('0x34')]=_[_0x5e9d('0x35')](_0x357fe8[_0x5e9d('0x30')],_0x357fe8['query']);_0x1c3198[_0x5e9d('0x37')]=_[_0x5e9d('0x35')](_0x357fe8['model'],qs[_0x5e9d('0x36')](_0x5a7aab[_0x5e9d('0x33')][_0x5e9d('0x36')]));_0x1c3198[_0x5e9d('0x37')]=_0x1c3198[_0x5e9d('0x37')][_0x5e9d('0x38')]?_0x1c3198[_0x5e9d('0x37')]:_0x357fe8['model'];if(_0x5a7aab[_0x5e9d('0x33')][_0x5e9d('0x3f')]){_0x1c3198['include']=[{'all':!![]}];}_0x1c3198=_['merge']({},_0x1c3198,_0x5a7aab['options']);return db[_0x5e9d('0x2c')][_0x5e9d('0x46')](_0x1c3198)[_0x5e9d('0x21')](handleEntityNotFound(_0x36e64a,null))[_0x5e9d('0x21')](respondWithResult(_0x36e64a,null))[_0x5e9d('0x42')](handleError(_0x36e64a,null));};exports[_0x5e9d('0x47')]=function(_0x268448,_0x131094){return db[_0x5e9d('0x2c')][_0x5e9d('0x47')](_0x268448['body'],{})[_0x5e9d('0x21')](function(_0x546353){var _0x469d6f=_0x268448['user'][_0x5e9d('0x23')]({'plain':!![]});if(!_0x469d6f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x469d6f[_0x5e9d('0x48')]==='user'){var _0x20cb9e=_0x546353[_0x5e9d('0x23')]({'plain':!![]});var _0x4c3966=_0x5e9d('0x24');return db[_0x5e9d('0x49')][_0x5e9d('0x46')]({'where':{'name':_0x4c3966,'userProfileId':_0x469d6f[_0x5e9d('0x4a')]},'raw':!![]})[_0x5e9d('0x21')](function(_0x4e95d4){if(_0x4e95d4&&_0x4e95d4['autoAssociation']===0x0){return db[_0x5e9d('0x25')][_0x5e9d('0x47')]({'name':_0x20cb9e['name'],'resourceId':_0x20cb9e['id'],'type':_0x4e95d4[_0x5e9d('0x29')],'sectionId':_0x4e95d4['id']},{})[_0x5e9d('0x21')](function(){return _0x546353;});}else{return _0x546353;}})['catch'](function(_0x4ad6e1){logger[_0x5e9d('0x4b')](_0x5e9d('0x4c'),_0x4ad6e1);throw _0x4ad6e1;});}return _0x546353;})[_0x5e9d('0x21')](respondWithResult(_0x131094,0xc9))[_0x5e9d('0x42')](handleError(_0x131094,null));};exports[_0x5e9d('0x20')]=function(_0xf088a3,_0xfdc343){if(_0xf088a3['body']['id']){delete _0xf088a3[_0x5e9d('0x4d')]['id'];}return db['Tag'][_0x5e9d('0x46')]({'where':{'id':_0xf088a3[_0x5e9d('0x44')]['id']}})[_0x5e9d('0x21')](handleEntityNotFound(_0xfdc343,null))[_0x5e9d('0x21')](saveUpdates(_0xf088a3[_0x5e9d('0x4d')],null))[_0x5e9d('0x21')](respondWithResult(_0xfdc343,null))['catch'](handleError(_0xfdc343,null));};exports[_0x5e9d('0x22')]=function(_0xb3698a,_0x4c0b4a){return db['Tag']['find']({'where':{'id':_0xb3698a['params']['id']}})[_0x5e9d('0x21')](handleEntityNotFound(_0x4c0b4a,null))[_0x5e9d('0x21')](removeEntity(_0x4c0b4a,null))[_0x5e9d('0x42')](handleError(_0x4c0b4a,null));};exports[_0x5e9d('0x4e')]=function(_0x1e8759,_0x211ded){return db[_0x5e9d('0x2c')][_0x5e9d('0x4e')]()['then'](respondWithResult(_0x211ded,null))['catch'](handleError(_0x211ded,null));}; \ No newline at end of file +var _0xa90b=['find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','destroy','then','UserProfileResource','error','stack','name','send','index','map','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','Tag','includeAll','findAll','rows','catch','show','params','rawAttributes','include'];(function(_0x4c0b64,_0x4c9a5e){var _0xeab35f=function(_0x2a995c){while(--_0x2a995c){_0x4c0b64['push'](_0x4c0b64['shift']());}};_0xeab35f(++_0x4c9a5e);}(_0xa90b,0x10c));var _0xba90=function(_0x104e21,_0x2ea86f){_0x104e21=_0x104e21-0x0;var _0x605b37=_0xa90b[_0x104e21];return _0x605b37;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xba90('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xba90('0x1'));var rp=require(_0xba90('0x2'));var moment=require(_0xba90('0x3'));var BPromise=require(_0xba90('0x4'));var Mustache=require(_0xba90('0x5'));var util=require(_0xba90('0x6'));var path=require(_0xba90('0x7'));var sox=require(_0xba90('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xba90('0x9'));var _=require(_0xba90('0xa'));var squel=require(_0xba90('0xb'));var crypto=require(_0xba90('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xba90('0xd'));var toCsv=require(_0xba90('0xe'));var querystring=require(_0xba90('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xba90('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xba90('0x11'));var hardwareService=require(_0xba90('0x12'));var logger=require('../../config/logger')(_0xba90('0x13'));var utils=require(_0xba90('0x14'));var config=require(_0xba90('0x15'));var licenseUtil=require(_0xba90('0x16'));var db=require(_0xba90('0x17'))['db'];function respondWithStatusCode(_0x149573,_0x548c42){_0x548c42=_0x548c42||0xcc;return function(_0x47eb69){if(_0x47eb69){return _0x149573[_0xba90('0x18')](_0x548c42);}return _0x149573[_0xba90('0x19')](_0x548c42)[_0xba90('0x1a')]();};}function respondWithResult(_0x4ffc72,_0x217ba8){_0x217ba8=_0x217ba8||0xc8;return function(_0x5d35d5){if(_0x5d35d5){return _0x4ffc72['status'](_0x217ba8)[_0xba90('0x1b')](_0x5d35d5);}};}function respondWithFilteredResult(_0x442add,_0x28da80){return function(_0x2bffe3){if(_0x2bffe3){var _0x4f6754=typeof _0x28da80['offset']===_0xba90('0x1c')&&typeof _0x28da80[_0xba90('0x1d')]===_0xba90('0x1c');var _0x37e747=_0x2bffe3[_0xba90('0x1e')];var _0x854d47=_0x4f6754?0x0:_0x28da80[_0xba90('0x1f')];var _0x5eb78d=_0x4f6754?_0x2bffe3[_0xba90('0x1e')]:_0x28da80['offset']+_0x28da80['limit'];var _0xa47245;if(_0x5eb78d>=_0x37e747){_0x5eb78d=_0x37e747;_0xa47245=0xc8;}else{_0xa47245=0xce;}_0x442add[_0xba90('0x19')](_0xa47245);return _0x442add[_0xba90('0x20')]('Content-Range',_0x854d47+'-'+_0x5eb78d+'/'+_0x37e747)[_0xba90('0x1b')](_0x2bffe3);}return null;};}function patchUpdates(_0xb19345){return function(_0x1f7fa7){try{jsonpatch[_0xba90('0x21')](_0x1f7fa7,_0xb19345,!![]);}catch(_0x5ccab4){return BPromise[_0xba90('0x22')](_0x5ccab4);}return _0x1f7fa7[_0xba90('0x23')]();};}function saveUpdates(_0x4f9767,_0x2b6353){return function(_0x3d09bf){if(_0x3d09bf){return _0x3d09bf[_0xba90('0x24')](_0x4f9767)['then'](function(_0x169ec3){return _0x169ec3;});}return null;};}function removeEntity(_0x4887b9,_0x3ff949){return function(_0x2120e9){if(_0x2120e9){return _0x2120e9[_0xba90('0x25')]()[_0xba90('0x26')](function(){var _0x1a3421=_0x2120e9['get']({'plain':!![]});var _0x498278='Tags';return db[_0xba90('0x27')]['destroy']({'where':{'type':_0x498278,'resourceId':_0x1a3421['id']}})[_0xba90('0x26')](function(){return _0x2120e9;});})[_0xba90('0x26')](function(){_0x4887b9[_0xba90('0x19')](0xcc)[_0xba90('0x1a')]();});}};}function handleEntityNotFound(_0x2b5d81,_0x1d2dfa){return function(_0x101485){if(!_0x101485){_0x2b5d81['sendStatus'](0x194);}return _0x101485;};}function handleError(_0x186791,_0x4de6c7){_0x4de6c7=_0x4de6c7||0x1f4;return function(_0x2603bb){logger[_0xba90('0x28')](_0x2603bb[_0xba90('0x29')]);if(_0x2603bb['name']){delete _0x2603bb[_0xba90('0x2a')];}_0x186791[_0xba90('0x19')](_0x4de6c7)[_0xba90('0x2b')](_0x2603bb);};}exports[_0xba90('0x2c')]=function(_0x15d2cb,_0x2d88eb){var _0x48df8a={},_0x3d6d06={},_0x331d68={'count':0x0,'rows':[]};var _0x182651=_[_0xba90('0x2d')](db['Tag']['rawAttributes'],function(_0x56fa0c){return{'name':_0x56fa0c[_0xba90('0x2e')],'type':_0x56fa0c[_0xba90('0x2f')][_0xba90('0x30')]};});_0x3d6d06['model']=_[_0xba90('0x2d')](_0x182651,_0xba90('0x2a'));_0x3d6d06[_0xba90('0x31')]=_[_0xba90('0x32')](_0x15d2cb['query']);_0x3d6d06[_0xba90('0x33')]=_['intersection'](_0x3d6d06[_0xba90('0x34')],_0x3d6d06[_0xba90('0x31')]);_0x48df8a[_0xba90('0x35')]=_[_0xba90('0x36')](_0x3d6d06[_0xba90('0x34')],qs[_0xba90('0x37')](_0x15d2cb[_0xba90('0x31')][_0xba90('0x37')]));_0x48df8a[_0xba90('0x35')]=_0x48df8a[_0xba90('0x35')][_0xba90('0x38')]?_0x48df8a[_0xba90('0x35')]:_0x3d6d06[_0xba90('0x34')];if(!_0x15d2cb[_0xba90('0x31')][_0xba90('0x39')](_0xba90('0x3a'))){_0x48df8a[_0xba90('0x1d')]=qs[_0xba90('0x1d')](_0x15d2cb[_0xba90('0x31')][_0xba90('0x1d')]);_0x48df8a['offset']=qs[_0xba90('0x1f')](_0x15d2cb[_0xba90('0x31')]['offset']);}_0x48df8a[_0xba90('0x3b')]=qs[_0xba90('0x3c')](_0x15d2cb[_0xba90('0x31')][_0xba90('0x3c')]);_0x48df8a['where']=qs[_0xba90('0x33')](_[_0xba90('0x3d')](_0x15d2cb[_0xba90('0x31')],_0x3d6d06['filters']),_0x182651);if(_0x15d2cb[_0xba90('0x31')][_0xba90('0x3e')]){_0x48df8a['where']=_[_0xba90('0x3f')](_0x48df8a[_0xba90('0x40')],{'$or':_[_0xba90('0x2d')](_0x182651,function(_0x39e561){if(_0x39e561['type']!==_0xba90('0x41')){var _0x170224={};_0x170224[_0x39e561[_0xba90('0x2a')]]={'$like':'%'+_0x15d2cb[_0xba90('0x31')][_0xba90('0x3e')]+'%'};return _0x170224;}})});}_0x48df8a=_[_0xba90('0x3f')]({},_0x48df8a,_0x15d2cb[_0xba90('0x42')]);var _0x2da82e={'where':_0x48df8a[_0xba90('0x40')]};return db[_0xba90('0x43')][_0xba90('0x1e')](_0x2da82e)[_0xba90('0x26')](function(_0x4c0cfd){_0x331d68[_0xba90('0x1e')]=_0x4c0cfd;if(_0x15d2cb[_0xba90('0x31')][_0xba90('0x44')]){_0x48df8a['include']=[{'all':!![]}];}return db[_0xba90('0x43')][_0xba90('0x45')](_0x48df8a);})[_0xba90('0x26')](function(_0x53d2ad){_0x331d68[_0xba90('0x46')]=_0x53d2ad;return _0x331d68;})[_0xba90('0x26')](respondWithFilteredResult(_0x2d88eb,_0x48df8a))[_0xba90('0x47')](handleError(_0x2d88eb,null));};exports[_0xba90('0x48')]=function(_0x482db4,_0x542bc8){var _0x143f41={'raw':!![],'where':{'id':_0x482db4[_0xba90('0x49')]['id']}},_0x58bcc8={};_0x58bcc8[_0xba90('0x34')]=_[_0xba90('0x32')](db[_0xba90('0x43')][_0xba90('0x4a')]);_0x58bcc8[_0xba90('0x31')]=_[_0xba90('0x32')](_0x482db4[_0xba90('0x31')]);_0x58bcc8[_0xba90('0x33')]=_[_0xba90('0x36')](_0x58bcc8[_0xba90('0x34')],_0x58bcc8[_0xba90('0x31')]);_0x143f41['attributes']=_[_0xba90('0x36')](_0x58bcc8[_0xba90('0x34')],qs[_0xba90('0x37')](_0x482db4[_0xba90('0x31')][_0xba90('0x37')]));_0x143f41[_0xba90('0x35')]=_0x143f41['attributes'][_0xba90('0x38')]?_0x143f41[_0xba90('0x35')]:_0x58bcc8['model'];if(_0x482db4[_0xba90('0x31')]['includeAll']){_0x143f41[_0xba90('0x4b')]=[{'all':!![]}];}_0x143f41=_['merge']({},_0x143f41,_0x482db4[_0xba90('0x42')]);return db[_0xba90('0x43')][_0xba90('0x4c')](_0x143f41)[_0xba90('0x26')](handleEntityNotFound(_0x542bc8,null))[_0xba90('0x26')](respondWithResult(_0x542bc8,null))[_0xba90('0x47')](handleError(_0x542bc8,null));};exports['create']=function(_0xe297ad,_0x25c40e){return db[_0xba90('0x43')][_0xba90('0x4d')](_0xe297ad[_0xba90('0x4e')],{})['then'](function(_0x184c69){var _0x4b99e6=_0xe297ad['user'][_0xba90('0x4f')]({'plain':!![]});if(!_0x4b99e6)throw new Error(_0xba90('0x50'));if(_0x4b99e6[_0xba90('0x51')]===_0xba90('0x52')){var _0xc00a18=_0x184c69[_0xba90('0x4f')]({'plain':!![]});var _0x1a83e6='Tags';return db[_0xba90('0x53')][_0xba90('0x4c')]({'where':{'name':_0x1a83e6,'userProfileId':_0x4b99e6[_0xba90('0x54')]},'raw':!![]})[_0xba90('0x26')](function(_0x496cf7){if(_0x496cf7&&_0x496cf7['autoAssociation']===0x0){return db[_0xba90('0x27')][_0xba90('0x4d')]({'name':_0xc00a18[_0xba90('0x2a')],'resourceId':_0xc00a18['id'],'type':_0x496cf7[_0xba90('0x2a')],'sectionId':_0x496cf7['id']},{})['then'](function(){return _0x184c69;});}else{return _0x184c69;}})['catch'](function(_0x2ce80d){logger[_0xba90('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ce80d);throw _0x2ce80d;});}return _0x184c69;})['then'](respondWithResult(_0x25c40e,0xc9))[_0xba90('0x47')](handleError(_0x25c40e,null));};exports[_0xba90('0x24')]=function(_0x4882b3,_0x268665){if(_0x4882b3[_0xba90('0x4e')]['id']){delete _0x4882b3[_0xba90('0x4e')]['id'];}return db[_0xba90('0x43')][_0xba90('0x4c')]({'where':{'id':_0x4882b3[_0xba90('0x49')]['id']}})[_0xba90('0x26')](handleEntityNotFound(_0x268665,null))['then'](saveUpdates(_0x4882b3[_0xba90('0x4e')],null))[_0xba90('0x26')](respondWithResult(_0x268665,null))[_0xba90('0x47')](handleError(_0x268665,null));};exports[_0xba90('0x25')]=function(_0xe8a15c,_0x3623bf){return db[_0xba90('0x43')][_0xba90('0x4c')]({'where':{'id':_0xe8a15c[_0xba90('0x49')]['id']}})[_0xba90('0x26')](handleEntityNotFound(_0x3623bf,null))['then'](removeEntity(_0x3623bf,null))['catch'](handleError(_0x3623bf,null));};exports['describe']=function(_0x55bfe8,_0x50dcc4){return db['Tag'][_0xba90('0x55')]()[_0xba90('0x26')](respondWithResult(_0x50dcc4,null))[_0xba90('0x47')](handleError(_0x50dcc4,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 0bee74b..2a90f63 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 _0xe304=['../../config/environment','./tag.attributes','exports','define','Tag','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x17c927,_0x1f9cb5){var _0x1320ee=function(_0x3a8eb2){while(--_0x3a8eb2){_0x17c927['push'](_0x17c927['shift']());}};_0x1320ee(++_0x1f9cb5);}(_0xe304,0x7a));var _0x4e30=function(_0x368fdb,_0x17cc4b){_0x368fdb=_0x368fdb-0x0;var _0x186ca4=_0xe304[_0x368fdb];return _0x186ca4;};'use strict';var _=require(_0x4e30('0x0'));var util=require(_0x4e30('0x1'));var logger=require(_0x4e30('0x2'))('api');var moment=require(_0x4e30('0x3'));var BPromise=require(_0x4e30('0x4'));var rp=require(_0x4e30('0x5'));var fs=require('fs');var path=require(_0x4e30('0x6'));var rimraf=require(_0x4e30('0x7'));var config=require(_0x4e30('0x8'));var attributes=require(_0x4e30('0x9'));module[_0x4e30('0xa')]=function(_0xf4709d,_0x245a27){return _0xf4709d[_0x4e30('0xb')](_0x4e30('0xc'),attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x820b=['exports','define','Tag','tools_tags','lodash','../../config/logger','moment','bluebird','path','rimraf','./tag.attributes'];(function(_0x1b7b90,_0x6a0e6b){var _0x34a9fd=function(_0x556dc4){while(--_0x556dc4){_0x1b7b90['push'](_0x1b7b90['shift']());}};_0x34a9fd(++_0x6a0e6b);}(_0x820b,0x190));var _0xb820=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x820b[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xb820('0x0'));var util=require('util');var logger=require(_0xb820('0x1'))('api');var moment=require(_0xb820('0x2'));var BPromise=require(_0xb820('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb820('0x4'));var rimraf=require(_0xb820('0x5'));var config=require('../../config/environment');var attributes=require(_0xb820('0x6'));module[_0xb820('0x7')]=function(_0x179f8c,_0x22e0cb){return _0x179f8c[_0xb820('0x8')](_0xb820('0x9'),attributes,{'tableName':_0xb820('0xa'),'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 b2ca09c..e5b4bf3 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 _0xb28a=['catch','util','moment','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Tag,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result'];(function(_0xd4bc9f,_0x4bf9fa){var _0x140f12=function(_0x383ffe){while(--_0x383ffe){_0xd4bc9f['push'](_0xd4bc9f['shift']());}};_0x140f12(++_0x4bf9fa);}(_0xb28a,0x166));var _0xab28=function(_0x9bbbcb,_0x181ae6){_0x9bbbcb=_0x9bbbcb-0x0;var _0x444240=_0xb28a[_0x9bbbcb];return _0x444240;};'use strict';var _=require('lodash');var util=require(_0xab28('0x0'));var moment=require(_0xab28('0x1'));var BPromise=require('bluebird');var rs=require(_0xab28('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xab28('0x3'))(_0xab28('0x4'));var config=require(_0xab28('0x5'));var jayson=require(_0xab28('0x6'));var client=jayson[_0xab28('0x7')][_0xab28('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x450e5b,_0x3b2507,_0x48949b){return new BPromise(function(_0x479267,_0x294e36){return client[_0xab28('0x9')](_0x450e5b,_0x48949b)[_0xab28('0xa')](function(_0x2508ef){logger[_0xab28('0xb')](_0xab28('0xc'),_0x3b2507,'request\x20sent');logger[_0xab28('0xd')]('Tag,\x20%s,\x20%s,\x20%s',_0x3b2507,_0xab28('0xe'),JSON[_0xab28('0xf')](_0x2508ef));if(_0x2508ef[_0xab28('0x10')]){if(_0x2508ef[_0xab28('0x10')][_0xab28('0x11')]===0x1f4){logger[_0xab28('0x10')](_0xab28('0xc'),_0x3b2507,_0x2508ef[_0xab28('0x10')]['message']);return _0x294e36(_0x2508ef[_0xab28('0x10')][_0xab28('0x12')]);}logger[_0xab28('0x10')](_0xab28('0xc'),_0x3b2507,_0x2508ef[_0xab28('0x10')][_0xab28('0x12')]);return _0x479267(_0x2508ef['error']['message']);}else{logger[_0xab28('0xb')](_0xab28('0xc'),_0x3b2507,_0xab28('0xe'));_0x479267(_0x2508ef[_0xab28('0x13')]['message']);}})[_0xab28('0x14')](function(_0x4912fa){logger[_0xab28('0x10')]('Tag,\x20%s,\x20%s',_0x3b2507,_0x4912fa);_0x294e36(_0x4912fa);});});} \ No newline at end of file +var _0x524a=['request\x20sent','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','Tag,\x20%s,\x20%s','debug','Tag,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x524a,0xf5));var _0xa524=function(_0x564c32,_0x1f1890){_0x564c32=_0x564c32-0x0;var _0x1cfde4=_0x524a[_0x564c32];return _0x1cfde4;};'use strict';var _=require(_0xa524('0x0'));var util=require(_0xa524('0x1'));var moment=require(_0xa524('0x2'));var BPromise=require(_0xa524('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa524('0x4'));var db=require(_0xa524('0x5'))['db'];var utils=require(_0xa524('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xa524('0x7'));var jayson=require(_0xa524('0x8'));var client=jayson[_0xa524('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x460738,_0x56bd0e,_0x3a2dd6){return new BPromise(function(_0x11aa98,_0x56849e){return client[_0xa524('0xa')](_0x460738,_0x3a2dd6)[_0xa524('0xb')](function(_0x228ffe){logger[_0xa524('0xc')](_0xa524('0xd'),_0x56bd0e,'request\x20sent');logger[_0xa524('0xe')](_0xa524('0xf'),_0x56bd0e,'request\x20sent',JSON['stringify'](_0x228ffe));if(_0x228ffe[_0xa524('0x10')]){if(_0x228ffe[_0xa524('0x10')][_0xa524('0x11')]===0x1f4){logger['error']('Tag,\x20%s,\x20%s',_0x56bd0e,_0x228ffe[_0xa524('0x10')]['message']);return _0x56849e(_0x228ffe[_0xa524('0x10')]['message']);}logger[_0xa524('0x10')]('Tag,\x20%s,\x20%s',_0x56bd0e,_0x228ffe[_0xa524('0x10')][_0xa524('0x12')]);return _0x11aa98(_0x228ffe['error'][_0xa524('0x12')]);}else{logger[_0xa524('0xc')](_0xa524('0xd'),_0x56bd0e,_0xa524('0x13'));_0x11aa98(_0x228ffe[_0xa524('0x14')][_0xa524('0x12')]);}})[_0xa524('0x15')](function(_0x4fc42f){logger[_0xa524('0x10')](_0xa524('0xd'),_0x56bd0e,_0x4fc42f);_0x56849e(_0x4fc42f);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index f5d423e..97a7340 100644 --- a/server/api/team/index.js +++ b/server/api/team/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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 5b568e8..f39638b 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 _0x0713=['STRING','name'];(function(_0x32a34b,_0x214a6f){var _0x4fef41=function(_0x1f95fa){while(--_0x1f95fa){_0x32a34b['push'](_0x32a34b['shift']());}};_0x4fef41(++_0x214a6f);}(_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 _0x2032=['name','exports','STRING'];(function(_0x38f6fd,_0x24c2c8){var _0x3db9d6=function(_0xa1508d){while(--_0xa1508d){_0x38f6fd['push'](_0x38f6fd['shift']());}};_0x3db9d6(++_0x24c2c8);}(_0x2032,0xd9));var _0x2203=function(_0x5387e1,_0x507f74){_0x5387e1=_0x5387e1-0x0;var _0x45377b=_0x2032[_0x5387e1];return _0x45377b;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index a1ba19a..3eb13d7 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 _0xf649=['path','sox','fs-extra','squel','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','redis','defaults','localhost','./team.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','Team','includeAll','include','findAll','rows','show','params','length','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Teams','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','UserVoiceQueue','Sequelize','QueryTypes','MailQueueId','UserMailQueue','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','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','WhatsappQueueId','UserWhatsappQueue','UserVoicePrefix','VoicePrefixId','getQueues','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','Queue','order','pick','toLowerCase','Queues','addQueues','add','ids','removeQueues','remove','addAgents','isArray','Voice','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','transaction','through','penalty','QueueId','User','findOrCreate','Queue:save','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','TeamVoiceQueue','all','TeamVoicePrefix','spread','removeAgents','emit','Queue:remove','getAgents','eml-format','rimraf','moment','mustache','util'];(function(_0x552252,_0xdb0d75){var _0x16ae8d=function(_0x1cebe2){while(--_0x1cebe2){_0x552252['push'](_0x552252['shift']());}};_0x16ae8d(++_0xdb0d75);}(_0xf649,0x133));var _0x9f64=function(_0xd88aa6,_0x37d167){_0xd88aa6=_0xd88aa6-0x0;var _0x17f85e=_0xf649[_0xd88aa6];return _0x17f85e;};'use strict';var emlformat=require(_0x9f64('0x0'));var rimraf=require(_0x9f64('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9f64('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x9f64('0x3'));var util=require(_0x9f64('0x4'));var path=require(_0x9f64('0x5'));var sox=require(_0x9f64('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9f64('0x7'));var _=require('lodash');var squel=require(_0x9f64('0x8'));var crypto=require('crypto');var jsforce=require(_0x9f64('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x9f64('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9f64('0xb'));var authService=require(_0x9f64('0xc'));var qs=require(_0x9f64('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9f64('0xe'))(_0x9f64('0xf'));var utils=require(_0x9f64('0x10'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x9f64('0x11')]=_[_0x9f64('0x12')](config[_0x9f64('0x11')],{'host':_0x9f64('0x13'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9f64('0x11')]));require(_0x9f64('0x14'))[_0x9f64('0x15')](socket);function respondWithStatusCode(_0xb7b912,_0x37bcea){_0x37bcea=_0x37bcea||0xcc;return function(_0x434a6c){if(_0x434a6c){return _0xb7b912[_0x9f64('0x16')](_0x37bcea);}return _0xb7b912[_0x9f64('0x17')](_0x37bcea)[_0x9f64('0x18')]();};}function respondWithResult(_0x5f2694,_0x22376d){_0x22376d=_0x22376d||0xc8;return function(_0x250087){if(_0x250087){return _0x5f2694[_0x9f64('0x17')](_0x22376d)['json'](_0x250087);}};}function respondWithFilteredResult(_0x2916c3,_0x1b3e8d){return function(_0x2b6633){if(_0x2b6633){var _0x579095=typeof _0x1b3e8d[_0x9f64('0x19')]===_0x9f64('0x1a')&&typeof _0x1b3e8d[_0x9f64('0x1b')]===_0x9f64('0x1a');var _0x192abf=_0x2b6633[_0x9f64('0x1c')];var _0x2902cd=_0x579095?0x0:_0x1b3e8d[_0x9f64('0x19')];var _0x4abe05=_0x579095?_0x2b6633[_0x9f64('0x1c')]:_0x1b3e8d[_0x9f64('0x19')]+_0x1b3e8d[_0x9f64('0x1b')];var _0x1cc954;if(_0x4abe05>=_0x192abf){_0x4abe05=_0x192abf;_0x1cc954=0xc8;}else{_0x1cc954=0xce;}_0x2916c3[_0x9f64('0x17')](_0x1cc954);return _0x2916c3[_0x9f64('0x1d')](_0x9f64('0x1e'),_0x2902cd+'-'+_0x4abe05+'/'+_0x192abf)['json'](_0x2b6633);}return null;};}function patchUpdates(_0x4746ce){return function(_0xdeceb7){try{jsonpatch[_0x9f64('0x1f')](_0xdeceb7,_0x4746ce,!![]);}catch(_0x1185bd){return BPromise[_0x9f64('0x20')](_0x1185bd);}return _0xdeceb7[_0x9f64('0x21')]();};}function saveUpdates(_0x197697,_0x370e6c){return function(_0x576479){if(_0x576479){return _0x576479[_0x9f64('0x22')](_0x197697)[_0x9f64('0x23')](function(_0x2182ea){return _0x2182ea;});}return null;};}function handleEntityNotFound(_0x3ffb38,_0x17df9f){return function(_0x38e9b3){if(!_0x38e9b3){_0x3ffb38[_0x9f64('0x16')](0x194);}return _0x38e9b3;};}function handleError(_0x2546d1,_0x3dd158){_0x3dd158=_0x3dd158||0x1f4;return function(_0x25f701){logger[_0x9f64('0x24')](_0x25f701[_0x9f64('0x25')]);if(_0x25f701['name']){delete _0x25f701[_0x9f64('0x26')];}_0x2546d1[_0x9f64('0x17')](_0x3dd158)[_0x9f64('0x27')](_0x25f701);};}exports[_0x9f64('0x28')]=function(_0x37a088,_0x33acc5){var _0x2afb7a={},_0x18170b={},_0x5ba2dc={'count':0x0,'rows':[]};var _0x57c3ce=_[_0x9f64('0x29')](db['Team'][_0x9f64('0x2a')],function(_0x543142){return{'name':_0x543142[_0x9f64('0x2b')],'type':_0x543142[_0x9f64('0x2c')][_0x9f64('0x2d')]};});_0x18170b['model']=_['map'](_0x57c3ce,_0x9f64('0x26'));_0x18170b[_0x9f64('0x2e')]=_[_0x9f64('0x2f')](_0x37a088[_0x9f64('0x2e')]);_0x18170b[_0x9f64('0x30')]=_['intersection'](_0x18170b[_0x9f64('0x31')],_0x18170b[_0x9f64('0x2e')]);_0x2afb7a['attributes']=_[_0x9f64('0x32')](_0x18170b[_0x9f64('0x31')],qs[_0x9f64('0x33')](_0x37a088[_0x9f64('0x2e')]['fields']));_0x2afb7a[_0x9f64('0x34')]=_0x2afb7a[_0x9f64('0x34')]['length']?_0x2afb7a['attributes']:_0x18170b['model'];if(!_0x37a088[_0x9f64('0x2e')][_0x9f64('0x35')](_0x9f64('0x36'))){_0x2afb7a['limit']=qs[_0x9f64('0x1b')](_0x37a088['query'][_0x9f64('0x1b')]);_0x2afb7a[_0x9f64('0x19')]=qs[_0x9f64('0x19')](_0x37a088[_0x9f64('0x2e')][_0x9f64('0x19')]);}_0x2afb7a['order']=qs['sort'](_0x37a088['query'][_0x9f64('0x37')]);_0x2afb7a[_0x9f64('0x38')]=qs[_0x9f64('0x30')](_['pick'](_0x37a088[_0x9f64('0x2e')],_0x18170b['filters']),_0x57c3ce);if(_0x37a088[_0x9f64('0x2e')][_0x9f64('0x39')]){_0x2afb7a[_0x9f64('0x38')]=_[_0x9f64('0x3a')](_0x2afb7a['where'],{'$or':_[_0x9f64('0x29')](_0x57c3ce,function(_0xdfb1ac){if(_0xdfb1ac[_0x9f64('0x2c')]!==_0x9f64('0x3b')){var _0x3ec21c={};_0x3ec21c[_0xdfb1ac[_0x9f64('0x26')]]={'$like':'%'+_0x37a088[_0x9f64('0x2e')]['filter']+'%'};return _0x3ec21c;}})});}_0x2afb7a=_[_0x9f64('0x3a')]({},_0x2afb7a,_0x37a088[_0x9f64('0x3c')]);var _0x14ff76={'where':_0x2afb7a[_0x9f64('0x38')]};return db[_0x9f64('0x3d')][_0x9f64('0x1c')](_0x14ff76)[_0x9f64('0x23')](function(_0x4eda89){_0x5ba2dc[_0x9f64('0x1c')]=_0x4eda89;if(_0x37a088[_0x9f64('0x2e')][_0x9f64('0x3e')]){_0x2afb7a[_0x9f64('0x3f')]=[{'all':!![]}];}return db['Team'][_0x9f64('0x40')](_0x2afb7a);})[_0x9f64('0x23')](function(_0x2f8331){_0x5ba2dc[_0x9f64('0x41')]=_0x2f8331;return _0x5ba2dc;})[_0x9f64('0x23')](respondWithFilteredResult(_0x33acc5,_0x2afb7a))['catch'](handleError(_0x33acc5,null));};exports[_0x9f64('0x42')]=function(_0x23a369,_0xd2311f){var _0x1fd567={'raw':![],'where':{'id':_0x23a369[_0x9f64('0x43')]['id']}},_0x2cd953={};_0x2cd953[_0x9f64('0x31')]=_[_0x9f64('0x2f')](db[_0x9f64('0x3d')][_0x9f64('0x2a')]);_0x2cd953[_0x9f64('0x2e')]=_[_0x9f64('0x2f')](_0x23a369[_0x9f64('0x2e')]);_0x2cd953[_0x9f64('0x30')]=_[_0x9f64('0x32')](_0x2cd953['model'],_0x2cd953['query']);_0x1fd567[_0x9f64('0x34')]=_['intersection'](_0x2cd953[_0x9f64('0x31')],qs[_0x9f64('0x33')](_0x23a369[_0x9f64('0x2e')][_0x9f64('0x33')]));_0x1fd567[_0x9f64('0x34')]=_0x1fd567[_0x9f64('0x34')][_0x9f64('0x44')]?_0x1fd567[_0x9f64('0x34')]:_0x2cd953[_0x9f64('0x31')];if(_0x23a369['query'][_0x9f64('0x3e')]){_0x1fd567[_0x9f64('0x3f')]=[{'all':!![]}];}_0x1fd567=_['merge']({},_0x1fd567,_0x23a369[_0x9f64('0x3c')]);return db[_0x9f64('0x3d')]['find'](_0x1fd567)['then'](handleEntityNotFound(_0xd2311f,null))[_0x9f64('0x23')](respondWithResult(_0xd2311f,null))['catch'](handleError(_0xd2311f,null));};exports[_0x9f64('0x45')]=function(_0x8ec454,_0x2a774a){return db['Team'][_0x9f64('0x45')](_0x8ec454[_0x9f64('0x46')],{})['then'](function(_0x2f998e){var _0x316e6b=_0x8ec454[_0x9f64('0x47')][_0x9f64('0x48')]({'plain':!![]});if(!_0x316e6b)throw new Error(_0x9f64('0x49'));if(_0x316e6b['role']===_0x9f64('0x47')){var _0x2abeb9=_0x2f998e['get']({'plain':!![]});var _0x5c9193=_0x9f64('0x4a');return db[_0x9f64('0x4b')][_0x9f64('0x4c')]({'where':{'name':_0x5c9193,'userProfileId':_0x316e6b[_0x9f64('0x4d')]},'raw':!![]})[_0x9f64('0x23')](function(_0x4f7cf2){if(_0x4f7cf2&&_0x4f7cf2[_0x9f64('0x4e')]===0x0){return db[_0x9f64('0x4f')][_0x9f64('0x45')]({'name':_0x2abeb9[_0x9f64('0x26')],'resourceId':_0x2abeb9['id'],'type':_0x4f7cf2[_0x9f64('0x26')],'sectionId':_0x4f7cf2['id']},{})[_0x9f64('0x23')](function(){return _0x2f998e;});}else{return _0x2f998e;}})[_0x9f64('0x50')](function(_0x14bb59){logger['error'](_0x9f64('0x51'),_0x14bb59);throw _0x14bb59;});}return _0x2f998e;})[_0x9f64('0x23')](respondWithResult(_0x2a774a,0xc9))[_0x9f64('0x50')](handleError(_0x2a774a,null));};exports[_0x9f64('0x22')]=function(_0x4e14f9,_0x16c144){if(_0x4e14f9[_0x9f64('0x46')]['id']){delete _0x4e14f9[_0x9f64('0x46')]['id'];}return db[_0x9f64('0x3d')][_0x9f64('0x4c')]({'where':{'id':_0x4e14f9['params']['id']}})['then'](handleEntityNotFound(_0x16c144,null))[_0x9f64('0x23')](saveUpdates(_0x4e14f9[_0x9f64('0x46')],null))[_0x9f64('0x23')](respondWithResult(_0x16c144,null))[_0x9f64('0x50')](handleError(_0x16c144,null));};exports[_0x9f64('0x52')]=function(_0x877d93,_0x50152f){var _0x4e413e=_0x877d93[_0x9f64('0x43')]['id'];var _0x314138=[];return db[_0x9f64('0x53')]['transaction'](function(_0x697311){var _0x2b77c9=_0x9f64('0x54')+_0x4e413e;return db[_0x9f64('0x53')][_0x9f64('0x2e')](_0x2b77c9,{'type':db['Sequelize']['QueryTypes'][_0x9f64('0x55')],'raw':!![],'transaction':_0x697311})['then'](function(_0x395244){_0x314138=_[_0x9f64('0x29')](_0x395244,function(_0x1c1e8f){return Number(_0x1c1e8f[_0x9f64('0x56')]);});})['then'](function(){var _0x523dd6=_0x9f64('0x57')+_0x4e413e;return db[_0x9f64('0x53')]['query'](_0x523dd6,{'type':db['Sequelize']['QueryTypes'][_0x9f64('0x55')],'raw':!![],'transaction':_0x697311});})[_0x9f64('0x23')](function(_0x220082){var _0x430675=_[_0x9f64('0x29')](_0x220082,function(_0x2163b4){return Number(_0x2163b4[_0x9f64('0x58')]);});return db[_0x9f64('0x59')][_0x9f64('0x52')]({'where':{'UserId':{'$in':_0x314138},'VoiceQueueId':{'$in':_0x430675}},'transaction':_0x697311});})[_0x9f64('0x23')](function(){var _0x56c43a='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x4e413e;return db['sequelize'][_0x9f64('0x2e')](_0x56c43a,{'type':db[_0x9f64('0x5a')][_0x9f64('0x5b')][_0x9f64('0x55')],'raw':!![],'transaction':_0x697311});})[_0x9f64('0x23')](function(_0x28d628){var _0x235793=_[_0x9f64('0x29')](_0x28d628,function(_0x19c2bd){return Number(_0x19c2bd[_0x9f64('0x5c')]);});return db[_0x9f64('0x5d')][_0x9f64('0x52')]({'where':{'UserId':{'$in':_0x314138},'MailQueueId':{'$in':_0x235793}},'transaction':_0x697311});})[_0x9f64('0x23')](function(){var _0x5a8fb3='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x4e413e;return db[_0x9f64('0x53')][_0x9f64('0x2e')](_0x5a8fb3,{'type':db[_0x9f64('0x5a')][_0x9f64('0x5b')]['SELECT'],'raw':!![],'transaction':_0x697311});})['then'](function(_0x406384){var _0x482ba7=_[_0x9f64('0x29')](_0x406384,function(_0x1338f7){return Number(_0x1338f7[_0x9f64('0x5e')]);});return db[_0x9f64('0x5f')][_0x9f64('0x52')]({'where':{'UserId':{'$in':_0x314138},'SmsQueueId':{'$in':_0x482ba7}},'transaction':_0x697311});})[_0x9f64('0x23')](function(){var _0xd53aac=_0x9f64('0x60')+_0x4e413e;return db['sequelize'][_0x9f64('0x2e')](_0xd53aac,{'type':db[_0x9f64('0x5a')][_0x9f64('0x5b')][_0x9f64('0x55')],'raw':!![],'transaction':_0x697311});})[_0x9f64('0x23')](function(_0x41d050){var _0x4dac73=_[_0x9f64('0x29')](_0x41d050,function(_0x18ce5a){return Number(_0x18ce5a[_0x9f64('0x61')]);});return db[_0x9f64('0x62')][_0x9f64('0x52')]({'where':{'UserId':{'$in':_0x314138},'ChatQueueId':{'$in':_0x4dac73}},'transaction':_0x697311});})[_0x9f64('0x23')](function(){var _0x2d6205=_0x9f64('0x63')+_0x4e413e;return db[_0x9f64('0x53')]['query'](_0x2d6205,{'type':db[_0x9f64('0x5a')][_0x9f64('0x5b')]['SELECT'],'raw':!![],'transaction':_0x697311});})[_0x9f64('0x23')](function(_0x2a30cf){var _0x56a1d0=_[_0x9f64('0x29')](_0x2a30cf,function(_0x1509c5){return Number(_0x1509c5[_0x9f64('0x64')]);});return db[_0x9f64('0x65')][_0x9f64('0x52')]({'where':{'UserId':{'$in':_0x314138},'FaxQueueId':{'$in':_0x56a1d0}},'transaction':_0x697311});})[_0x9f64('0x23')](function(){var _0x5617ea=_0x9f64('0x66')+_0x4e413e;return db['sequelize'][_0x9f64('0x2e')](_0x5617ea,{'type':db[_0x9f64('0x5a')][_0x9f64('0x5b')][_0x9f64('0x55')],'raw':!![],'transaction':_0x697311});})[_0x9f64('0x23')](function(_0x23bb76){var _0x406638=_['map'](_0x23bb76,function(_0x27805d){return Number(_0x27805d[_0x9f64('0x67')]);});return db[_0x9f64('0x68')]['destroy']({'where':{'UserId':{'$in':_0x314138},'OpenchannelQueueId':{'$in':_0x406638}},'transaction':_0x697311});})[_0x9f64('0x23')](function(){var _0x4e95bf='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x4e413e;return db['sequelize'][_0x9f64('0x2e')](_0x4e95bf,{'type':db['Sequelize'][_0x9f64('0x5b')][_0x9f64('0x55')],'raw':!![],'transaction':_0x697311});})[_0x9f64('0x23')](function(_0x74b9b9){var _0x191df2=_['map'](_0x74b9b9,function(_0x50769e){return Number(_0x50769e[_0x9f64('0x69')]);});return db[_0x9f64('0x6a')][_0x9f64('0x52')]({'where':{'UserId':{'$in':_0x314138},'WhatsappQueueId':{'$in':_0x191df2}},'transaction':_0x697311});})[_0x9f64('0x23')](function(){return db['TeamVoicePrefix']['find']({'where':{'TeamId':_0x4e413e}});})[_0x9f64('0x23')](function(_0xa4b145){if(_0xa4b145===null){return;}return db[_0x9f64('0x6b')][_0x9f64('0x52')]({'where':{'UserId':{'$in':_0x314138},'VoicePrefixId':_0xa4b145[_0x9f64('0x6c')]},'transaction':_0x697311});})[_0x9f64('0x23')](function(){return db[_0x9f64('0x3d')][_0x9f64('0x52')]({'where':{'id':_0x4e413e},'cascade':!![],'transaction':_0x697311});})[_0x9f64('0x23')](function(_0x5bab35){if(_0x5bab35===0x0){_0x50152f[_0x9f64('0x16')](0x194);}else{return db[_0x9f64('0x4f')]['destroy']({'where':{'type':_0x9f64('0x4a'),'resourceId':_0x4e413e},'cascade':!![],'transaction':_0x697311})[_0x9f64('0x23')](function(){_0x50152f[_0x9f64('0x17')](0xcc)['end']();});}})['catch'](function(_0x1a8b19){_0x50152f[_0x9f64('0x17')](0x1f4)['send'](_0x1a8b19);});});};exports[_0x9f64('0x6d')]=function(_0x4294a0,_0x1c348a,_0x427ef1){return db[_0x9f64('0x3d')][_0x9f64('0x6e')]({'where':{'id':_0x4294a0[_0x9f64('0x43')]['id']}})[_0x9f64('0x23')](handleEntityNotFound(_0x1c348a,null))[_0x9f64('0x23')](function(_0x9187f8){if(!_0x4294a0[_0x9f64('0x2e')][_0x9f64('0x6f')]||!utils[_0x9f64('0x70')](_0x4294a0[_0x9f64('0x2e')][_0x9f64('0x6f')])){throw new db[(_0x9f64('0x5a'))][(_0x9f64('0x71'))](_0x9f64('0x72'));}var _0x39a359={};var _0x1e8f24={};_0x1e8f24[_0x9f64('0x31')]=_['keys'](db[_[_0x9f64('0x73')](_0x4294a0[_0x9f64('0x2e')][_0x9f64('0x6f')]['toLowerCase']())+_0x9f64('0x74')][_0x9f64('0x2a')]);_0x1e8f24[_0x9f64('0x2e')]=_['keys'](_0x4294a0['query']);_0x1e8f24[_0x9f64('0x30')]=_[_0x9f64('0x32')](_0x1e8f24[_0x9f64('0x31')],_0x1e8f24['query']);_0x39a359['attributes']=_[_0x9f64('0x32')](_0x1e8f24[_0x9f64('0x31')],qs[_0x9f64('0x33')](_0x4294a0[_0x9f64('0x2e')][_0x9f64('0x33')]));_0x39a359[_0x9f64('0x34')]=_0x39a359[_0x9f64('0x34')][_0x9f64('0x44')]?_0x39a359[_0x9f64('0x34')]:_0x1e8f24[_0x9f64('0x31')];_0x39a359['limit']=qs[_0x9f64('0x1b')](_0x4294a0[_0x9f64('0x2e')][_0x9f64('0x1b')]);_0x39a359[_0x9f64('0x19')]=qs[_0x9f64('0x19')](_0x4294a0[_0x9f64('0x2e')][_0x9f64('0x19')]);_0x39a359[_0x9f64('0x75')]=qs['sort'](_0x4294a0[_0x9f64('0x2e')][_0x9f64('0x37')]);_0x39a359[_0x9f64('0x38')]=qs[_0x9f64('0x30')](_[_0x9f64('0x76')](_0x4294a0[_0x9f64('0x2e')],_0x1e8f24[_0x9f64('0x30')]));_0x39a359=_['merge']({},_0x39a359,_0x4294a0[_0x9f64('0x3c')]);return _0x9187f8[_0x9f64('0x48')+_[_0x9f64('0x73')](_0x4294a0['query'][_0x9f64('0x6f')][_0x9f64('0x77')]())+_0x9f64('0x78')](_0x39a359);})[_0x9f64('0x23')](respondWithResult(_0x1c348a,null))[_0x9f64('0x50')](handleError(_0x1c348a,null));};exports[_0x9f64('0x79')]=function(_0x28a2f7,_0x24361b,_0x5590ba){return db['Team'][_0x9f64('0x6e')]({'where':{'id':_0x28a2f7['params']['id']}})[_0x9f64('0x23')](function(_0x3a4ad5){if(_0x3a4ad5){if(!_0x28a2f7[_0x9f64('0x46')][_0x9f64('0x6f')]||!utils[_0x9f64('0x70')](_0x28a2f7[_0x9f64('0x46')]['channel'])){throw new db['Sequelize'][(_0x9f64('0x71'))](_0x9f64('0x72'));}return _0x3a4ad5[_0x9f64('0x7a')+_[_0x9f64('0x73')](_0x28a2f7[_0x9f64('0x46')][_0x9f64('0x6f')][_0x9f64('0x77')]())+_0x9f64('0x78')](_0x28a2f7[_0x9f64('0x46')][_0x9f64('0x7b')]);}return null;})['then'](handleEntityNotFound(_0x24361b,null))['then'](respondWithStatusCode(_0x24361b,null))[_0x9f64('0x50')](handleError(_0x24361b,null));};exports[_0x9f64('0x7c')]=function(_0x452419,_0x148c58,_0x37b367){return db[_0x9f64('0x3d')][_0x9f64('0x6e')]({'where':{'id':_0x452419[_0x9f64('0x43')]['id']}})[_0x9f64('0x23')](function(_0x57a655){if(_0x57a655){if(!_0x452419[_0x9f64('0x2e')]['channel']||!utils[_0x9f64('0x70')](_0x452419[_0x9f64('0x2e')]['channel'])){throw new db['Sequelize']['ValidationError'](_0x9f64('0x72'));}return _0x57a655[_0x9f64('0x7d')+_['capitalize'](_0x452419[_0x9f64('0x2e')]['channel'][_0x9f64('0x77')]())+_0x9f64('0x78')](_0x452419['query'][_0x9f64('0x7b')]);}return null;})[_0x9f64('0x23')](handleEntityNotFound(_0x148c58,null))[_0x9f64('0x23')](respondWithStatusCode(_0x148c58,null))[_0x9f64('0x50')](handleError(_0x148c58,null));};exports[_0x9f64('0x7e')]=function(_0x4a713d,_0xb2b3fc){var _0xf3af8d=_[_0x9f64('0x7f')](_0x4a713d['body'][_0x9f64('0x7b')])?_0x4a713d['body'][_0x9f64('0x7b')]:[_0x4a713d['body']['ids']];var _0x21bc79=_0x4a713d['params']['id'];return db[_0x9f64('0x3d')][_0x9f64('0x4c')]({'where':{'id':_0x21bc79}})[_0x9f64('0x23')](handleEntityNotFound(_0xb2b3fc,null))[_0x9f64('0x23')](function(_0xd2f371){if(_0xd2f371){var _0x217571=[_0x9f64('0x80'),_0x9f64('0x81'),_0x9f64('0x82'),_0x9f64('0x83'),_0x9f64('0x84'),_0x9f64('0x85'),_0x9f64('0x86')];return db[_0x9f64('0x53')][_0x9f64('0x87')](function(_0x40c805){var _0x2cad96=_['map'](_0x217571,function(_0x47517b){var _0x452e29={'attributes':['id',_0x9f64('0x26')]};if(_0x47517b===_0x9f64('0x80')){_0x452e29[_0x9f64('0x88')]={'attributes':[_0x9f64('0x89')]};}return _0xd2f371[_0x9f64('0x48')+_0x47517b+_0x9f64('0x78')](_0x452e29)[_0x9f64('0x23')](function(_0x13ba0b){var _0x1be238=_['map'](_0x13ba0b,function(_0x3041d0){var _0x100309=_[_0x9f64('0x29')](_0xf3af8d,function(_0xa3cdfb){var _0x5f4440={'where':{'UserId':_0xa3cdfb,[_0x47517b+_0x9f64('0x8a')]:_0x3041d0['id']},'transaction':_0x40c805};if(_0x47517b===_0x9f64('0x80')){_0x5f4440[_0x9f64('0x12')]={'penalty':_0x3041d0['TeamVoiceQueue'][_0x9f64('0x89')]};}return db[_0x9f64('0x8b')+_0x47517b+'Queue'][_0x9f64('0x8c')](_0x5f4440)[_0x9f64('0x23')](function(){socket['emit'](_0x9f64('0x47')+_0x47517b+_0x9f64('0x8d'),{'UserId':_0xa3cdfb,[_0x47517b+_0x9f64('0x8a')]:_0x3041d0['id']});if(_0x47517b!==_0x9f64('0x80')){return;}return db[_0x9f64('0x8b')][_0x9f64('0x40')]({'where':{'id':_0xf3af8d,'online':0x1},'attributes':['id',_0x9f64('0x26'),'online',_0x9f64('0x8e'),_0x9f64('0x8f')],'raw':!![]})['then'](function(_0x55da04){var _0x311678=_[_0x9f64('0x29')](_0x55da04,function(_0x65395){return db[_0x9f64('0x90')][_0x9f64('0x91')]({'membername':_0x65395['name'],'UserId':_0x65395['id'],'queue_name':_0x3041d0[_0x9f64('0x26')],'VoiceQueueId':_0x3041d0['id'],'interface':_[_0x9f64('0x92')](_0x65395[_0x9f64('0x8f')])?util[_0x9f64('0x93')]('SIP/%s',_0x65395[_0x9f64('0x26')]):_0x65395[_0x9f64('0x8f')],'paused':_0x65395[_0x9f64('0x8e')]||![],'penalty':_0x3041d0[_0x9f64('0x94')]['penalty']},{'transaction':_0x40c805});});return Promise[_0x9f64('0x95')](_0x311678);});});});return Promise[_0x9f64('0x95')](_0x100309);});return Promise['all'](_0x1be238);})[_0x9f64('0x23')](function(){return db[_0x9f64('0x96')][_0x9f64('0x6e')]({'where':{'teamId':_0x21bc79}})[_0x9f64('0x23')](function(_0xcea6b5){if(_0xcea6b5){var _0x59ac61=_[_0x9f64('0x29')](_0xf3af8d,function(_0x320950){db[_0x9f64('0x6b')][_0x9f64('0x91')]({'UserId':_0x320950,'VoicePrefixId':_0xcea6b5[_0x9f64('0x6c')]});});return Promise['all'](_0x59ac61);}});});});return Promise['all'](_0x2cad96)['then'](function(){return _0xd2f371['addAgents'](_0xf3af8d,{'transaction':_0x40c805})[_0x9f64('0x97')](function(_0x52abc3){return _0x52abc3;});});});}})[_0x9f64('0x23')](respondWithResult(_0xb2b3fc,null))[_0x9f64('0x50')](handleError(_0xb2b3fc,null));};exports['removeAgents']=function(_0xf38578,_0x4efbed){var _0x4131f5=_['isArray'](_0xf38578[_0x9f64('0x2e')][_0x9f64('0x7b')])?_0xf38578[_0x9f64('0x2e')][_0x9f64('0x7b')]:[_0xf38578[_0x9f64('0x2e')]['ids']];var _0x575e30=_0xf38578[_0x9f64('0x43')]['id'];return db[_0x9f64('0x3d')][_0x9f64('0x4c')]({'where':{'id':_0x575e30}})['then'](handleEntityNotFound(_0x4efbed,null))[_0x9f64('0x23')](function(_0x3bb933){if(_0x3bb933){var _0x44ef7b=[_0x9f64('0x80'),_0x9f64('0x81'),_0x9f64('0x82'),_0x9f64('0x83'),_0x9f64('0x84'),'Openchannel',_0x9f64('0x86')];return db[_0x9f64('0x53')][_0x9f64('0x87')](function(_0x580b99){var _0x16e3d4=_['map'](_0x44ef7b,function(_0xb7194){var _0x28bb20={'attributes':['id',_0x9f64('0x26')]};return _0x3bb933[_0x9f64('0x48')+_0xb7194+_0x9f64('0x78')](_0x28bb20)[_0x9f64('0x23')](function(_0x354c04){var _0x34494d=_[_0x9f64('0x29')](_0x354c04,function(_0x3bf318){return _0x3bf318[_0x9f64('0x98')](_0x4131f5,{'transaction':_0x580b99})['then'](function(){var _0x46e592=_[_0x9f64('0x29')](_0x4131f5,function(_0x890177){socket[_0x9f64('0x99')](_0x9f64('0x47')+_0xb7194+_0x9f64('0x9a'),{'UserId':Number(_0x890177),[_0xb7194+'QueueId']:_0x3bf318['id']});if(_0xb7194!==_0x9f64('0x80')){return;}return db[_0x9f64('0x90')][_0x9f64('0x52')]({'where':{'VoiceQueueId':_0x3bf318['id'],'UserId':_0x890177},'transaction':_0x580b99});});return Promise['all'](_0x46e592);});});return Promise[_0x9f64('0x95')](_0x34494d);});});return Promise['all'](_0x16e3d4)[_0x9f64('0x23')](function(){return _0x3bb933['removeAgents'](_0x4131f5,{'transaction':_0x580b99});})[_0x9f64('0x23')](function(){return db[_0x9f64('0x96')][_0x9f64('0x6e')]({'where':{'teamId':_0x575e30}})['then'](function(_0x5897f7){if(_0x5897f7){var _0x5fe629=_[_0x9f64('0x29')](_0x4131f5,function(_0x210fab){db[_0x9f64('0x6b')][_0x9f64('0x52')]({'where':{'UserId':_0x210fab,'VoicePrefixId':_0x5897f7['VoicePrefixId']}});});return Promise[_0x9f64('0x95')](_0x5fe629);}});});});}})[_0x9f64('0x23')](respondWithStatusCode(_0x4efbed,null))[_0x9f64('0x50')](handleError(_0x4efbed,null));};exports[_0x9f64('0x9b')]=function(_0x31245e,_0x37ef6c,_0x4e2422){var _0x3fd759={};var _0x18b6f8={};var _0x164f02;var _0x505153;return db[_0x9f64('0x3d')]['findOne']({'where':{'id':_0x31245e[_0x9f64('0x43')]['id']}})[_0x9f64('0x23')](handleEntityNotFound(_0x37ef6c,null))[_0x9f64('0x23')](function(_0x3d6bf3){if(_0x3d6bf3){_0x164f02=_0x3d6bf3;_0x18b6f8[_0x9f64('0x31')]=_[_0x9f64('0x2f')](db[_0x9f64('0x8b')][_0x9f64('0x2a')]);_0x18b6f8[_0x9f64('0x2e')]=_['keys'](_0x31245e['query']);_0x18b6f8['filters']=_[_0x9f64('0x32')](_0x18b6f8[_0x9f64('0x31')],_0x18b6f8[_0x9f64('0x2e')]);_0x3fd759[_0x9f64('0x34')]=_[_0x9f64('0x32')](_0x18b6f8[_0x9f64('0x31')],qs[_0x9f64('0x33')](_0x31245e['query'][_0x9f64('0x33')]));_0x3fd759[_0x9f64('0x34')]=_0x3fd759['attributes'][_0x9f64('0x44')]?_0x3fd759[_0x9f64('0x34')]:_0x18b6f8[_0x9f64('0x31')];_0x3fd759[_0x9f64('0x75')]=qs[_0x9f64('0x37')](_0x31245e[_0x9f64('0x2e')]['sort']);_0x3fd759[_0x9f64('0x38')]=qs[_0x9f64('0x30')](_['pick'](_0x31245e[_0x9f64('0x2e')],_0x18b6f8[_0x9f64('0x30')]));if(_0x31245e[_0x9f64('0x2e')][_0x9f64('0x39')]){_0x3fd759[_0x9f64('0x38')]=_[_0x9f64('0x3a')](_0x3fd759['where'],{'$or':_[_0x9f64('0x29')](_0x3fd759[_0x9f64('0x34')],function(_0x51e7d6){var _0x4000d4={};_0x4000d4[_0x51e7d6]={'$like':'%'+_0x31245e['query'][_0x9f64('0x39')]+'%'};return _0x4000d4;})});}_0x3fd759=_[_0x9f64('0x3a')]({},_0x3fd759,_0x31245e[_0x9f64('0x3c')]);return _0x164f02[_0x9f64('0x9b')](_0x3fd759);}})['then'](function(_0x379c5a){if(_0x379c5a){_0x505153=_0x379c5a[_0x9f64('0x44')];if(!_0x31245e[_0x9f64('0x2e')][_0x9f64('0x35')]('nolimit')){_0x3fd759['limit']=qs[_0x9f64('0x1b')](_0x31245e['query'][_0x9f64('0x1b')]);_0x3fd759[_0x9f64('0x19')]=qs[_0x9f64('0x19')](_0x31245e['query']['offset']);}return _0x164f02['getAgents'](_0x3fd759);}})['then'](function(_0x5bd07d){if(_0x5bd07d){return _0x5bd07d?{'count':_0x505153,'rows':_0x5bd07d}:null;}})[_0x9f64('0x23')](respondWithResult(_0x37ef6c,null))[_0x9f64('0x50')](handleError(_0x37ef6c,null));}; \ No newline at end of file +var _0x18e1=['sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','Sequelize','VoiceQueueId','UserVoiceQueue','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','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','WhatsappQueueId','UserWhatsappQueue','find','UserVoicePrefix','getQueues','findOne','channel','isValidChannel','capitalize','pick','Queues','addQueues','ValidationError','Unknown\x20channel','add','ids','removeQueues','remove','toLowerCase','Voice','Mail','Sms','Openchannel','through','penalty','QueueId','defaults','User','findOrCreate','emit','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','interface','voicePause','TeamVoiceQueue','all','TeamVoicePrefix','VoicePrefixId','addAgents','removeAgents','isArray','Chat','Fax','Whatsapp','getAgents','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./team.socket','register','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','sendStatus','error','stack','name','send','index','Team','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','catch','create','body','get','user','Teams','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'];(function(_0x504a61,_0x18d443){var _0x421a97=function(_0x57d80f){while(--_0x57d80f){_0x504a61['push'](_0x504a61['shift']());}};_0x421a97(++_0x18d443);}(_0x18e1,0xe6));var _0x118e=function(_0x1ecaa2,_0x184e02){_0x1ecaa2=_0x1ecaa2-0x0;var _0xa24540=_0x18e1[_0x1ecaa2];return _0xa24540;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x118e('0x0'));var zipdir=require(_0x118e('0x1'));var jsonpatch=require(_0x118e('0x2'));var rp=require('request-promise');var moment=require(_0x118e('0x3'));var BPromise=require(_0x118e('0x4'));var Mustache=require('mustache');var util=require(_0x118e('0x5'));var path=require(_0x118e('0x6'));var sox=require(_0x118e('0x7'));var csv=require(_0x118e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x118e('0x9'));var _=require(_0x118e('0xa'));var squel=require(_0x118e('0xb'));var crypto=require(_0x118e('0xc'));var jsforce=require(_0x118e('0xd'));var deskjs=require(_0x118e('0xe'));var toCsv=require(_0x118e('0x8'));var querystring=require(_0x118e('0xf'));var Papa=require(_0x118e('0x10'));var Redis=require(_0x118e('0x11'));var authService=require(_0x118e('0x12'));var qs=require(_0x118e('0x13'));var as=require(_0x118e('0x14'));var hardwareService=require(_0x118e('0x15'));var logger=require(_0x118e('0x16'))(_0x118e('0x17'));var utils=require(_0x118e('0x18'));var config=require(_0x118e('0x19'));var licenseUtil=require(_0x118e('0x1a'));var db=require(_0x118e('0x1b'))['db'];config[_0x118e('0x1c')]=_['defaults'](config['redis'],{'host':_0x118e('0x1d'),'port':0x18eb});var socket=require(_0x118e('0x1e'))(new Redis(config[_0x118e('0x1c')]));require(_0x118e('0x1f'))[_0x118e('0x20')](socket);function respondWithStatusCode(_0x4d9ab6,_0xb36fe3){_0xb36fe3=_0xb36fe3||0xcc;return function(_0x4deaec){if(_0x4deaec){return _0x4d9ab6['sendStatus'](_0xb36fe3);}return _0x4d9ab6[_0x118e('0x21')](_0xb36fe3)[_0x118e('0x22')]();};}function respondWithResult(_0x2426e7,_0x152ba1){_0x152ba1=_0x152ba1||0xc8;return function(_0x54dbd9){if(_0x54dbd9){return _0x2426e7[_0x118e('0x21')](_0x152ba1)[_0x118e('0x23')](_0x54dbd9);}};}function respondWithFilteredResult(_0x1a3c87,_0x6f6631){return function(_0x2be861){if(_0x2be861){var _0x1b01fb=typeof _0x6f6631['offset']===_0x118e('0x24')&&typeof _0x6f6631[_0x118e('0x25')]===_0x118e('0x24');var _0x2a8298=_0x2be861[_0x118e('0x26')];var _0x173d7a=_0x1b01fb?0x0:_0x6f6631['offset'];var _0x552103=_0x1b01fb?_0x2be861['count']:_0x6f6631[_0x118e('0x27')]+_0x6f6631['limit'];var _0xbe4c8d;if(_0x552103>=_0x2a8298){_0x552103=_0x2a8298;_0xbe4c8d=0xc8;}else{_0xbe4c8d=0xce;}_0x1a3c87[_0x118e('0x21')](_0xbe4c8d);return _0x1a3c87[_0x118e('0x28')](_0x118e('0x29'),_0x173d7a+'-'+_0x552103+'/'+_0x2a8298)[_0x118e('0x23')](_0x2be861);}return null;};}function patchUpdates(_0x33780e){return function(_0x132322){try{jsonpatch[_0x118e('0x2a')](_0x132322,_0x33780e,!![]);}catch(_0x1fa1e1){return BPromise['reject'](_0x1fa1e1);}return _0x132322[_0x118e('0x2b')]();};}function saveUpdates(_0x1085be,_0x3fab68){return function(_0x4364ad){if(_0x4364ad){return _0x4364ad[_0x118e('0x2c')](_0x1085be)[_0x118e('0x2d')](function(_0x3a3bba){return _0x3a3bba;});}return null;};}function handleEntityNotFound(_0x5620a2,_0x399612){return function(_0xa4517){if(!_0xa4517){_0x5620a2[_0x118e('0x2e')](0x194);}return _0xa4517;};}function handleError(_0x2754d7,_0x30f535){_0x30f535=_0x30f535||0x1f4;return function(_0x6c94cd){logger[_0x118e('0x2f')](_0x6c94cd[_0x118e('0x30')]);if(_0x6c94cd[_0x118e('0x31')]){delete _0x6c94cd[_0x118e('0x31')];}_0x2754d7[_0x118e('0x21')](_0x30f535)[_0x118e('0x32')](_0x6c94cd);};}exports[_0x118e('0x33')]=function(_0x500ad9,_0xde3fb3){var _0x14d643={},_0x210bc6={},_0x3201e8={'count':0x0,'rows':[]};var _0x44b9ab=_['map'](db[_0x118e('0x34')][_0x118e('0x35')],function(_0x281b91){return{'name':_0x281b91[_0x118e('0x36')],'type':_0x281b91[_0x118e('0x37')]['key']};});_0x210bc6[_0x118e('0x38')]=_[_0x118e('0x39')](_0x44b9ab,_0x118e('0x31'));_0x210bc6['query']=_[_0x118e('0x3a')](_0x500ad9[_0x118e('0x3b')]);_0x210bc6[_0x118e('0x3c')]=_[_0x118e('0x3d')](_0x210bc6[_0x118e('0x38')],_0x210bc6[_0x118e('0x3b')]);_0x14d643[_0x118e('0x3e')]=_[_0x118e('0x3d')](_0x210bc6[_0x118e('0x38')],qs[_0x118e('0x3f')](_0x500ad9[_0x118e('0x3b')][_0x118e('0x3f')]));_0x14d643['attributes']=_0x14d643[_0x118e('0x3e')][_0x118e('0x40')]?_0x14d643[_0x118e('0x3e')]:_0x210bc6[_0x118e('0x38')];if(!_0x500ad9[_0x118e('0x3b')][_0x118e('0x41')](_0x118e('0x42'))){_0x14d643[_0x118e('0x25')]=qs['limit'](_0x500ad9[_0x118e('0x3b')][_0x118e('0x25')]);_0x14d643['offset']=qs[_0x118e('0x27')](_0x500ad9[_0x118e('0x3b')]['offset']);}_0x14d643[_0x118e('0x43')]=qs[_0x118e('0x44')](_0x500ad9['query']['sort']);_0x14d643['where']=qs[_0x118e('0x3c')](_['pick'](_0x500ad9[_0x118e('0x3b')],_0x210bc6[_0x118e('0x3c')]),_0x44b9ab);if(_0x500ad9[_0x118e('0x3b')][_0x118e('0x45')]){_0x14d643[_0x118e('0x46')]=_['merge'](_0x14d643[_0x118e('0x46')],{'$or':_[_0x118e('0x39')](_0x44b9ab,function(_0x47279d){if(_0x47279d[_0x118e('0x37')]!==_0x118e('0x47')){var _0x3c72e9={};_0x3c72e9[_0x47279d[_0x118e('0x31')]]={'$like':'%'+_0x500ad9[_0x118e('0x3b')]['filter']+'%'};return _0x3c72e9;}})});}_0x14d643=_[_0x118e('0x48')]({},_0x14d643,_0x500ad9[_0x118e('0x49')]);var _0x5e7ea3={'where':_0x14d643['where']};return db['Team']['count'](_0x5e7ea3)[_0x118e('0x2d')](function(_0x34a34e){_0x3201e8[_0x118e('0x26')]=_0x34a34e;if(_0x500ad9[_0x118e('0x3b')][_0x118e('0x4a')]){_0x14d643['include']=[{'all':!![]}];}return db[_0x118e('0x34')][_0x118e('0x4b')](_0x14d643);})[_0x118e('0x2d')](function(_0x5dd8db){_0x3201e8[_0x118e('0x4c')]=_0x5dd8db;return _0x3201e8;})[_0x118e('0x2d')](respondWithFilteredResult(_0xde3fb3,_0x14d643))['catch'](handleError(_0xde3fb3,null));};exports[_0x118e('0x4d')]=function(_0x6ac48c,_0x14ca1b){var _0x271364={'raw':![],'where':{'id':_0x6ac48c[_0x118e('0x4e')]['id']}},_0x909055={};_0x909055['model']=_[_0x118e('0x3a')](db[_0x118e('0x34')][_0x118e('0x35')]);_0x909055[_0x118e('0x3b')]=_[_0x118e('0x3a')](_0x6ac48c['query']);_0x909055['filters']=_[_0x118e('0x3d')](_0x909055[_0x118e('0x38')],_0x909055[_0x118e('0x3b')]);_0x271364[_0x118e('0x3e')]=_[_0x118e('0x3d')](_0x909055[_0x118e('0x38')],qs[_0x118e('0x3f')](_0x6ac48c[_0x118e('0x3b')]['fields']));_0x271364['attributes']=_0x271364[_0x118e('0x3e')][_0x118e('0x40')]?_0x271364[_0x118e('0x3e')]:_0x909055[_0x118e('0x38')];if(_0x6ac48c[_0x118e('0x3b')][_0x118e('0x4a')]){_0x271364['include']=[{'all':!![]}];}_0x271364=_[_0x118e('0x48')]({},_0x271364,_0x6ac48c['options']);return db[_0x118e('0x34')]['find'](_0x271364)[_0x118e('0x2d')](handleEntityNotFound(_0x14ca1b,null))[_0x118e('0x2d')](respondWithResult(_0x14ca1b,null))[_0x118e('0x4f')](handleError(_0x14ca1b,null));};exports[_0x118e('0x50')]=function(_0x10394f,_0x12131d){return db[_0x118e('0x34')][_0x118e('0x50')](_0x10394f[_0x118e('0x51')],{})[_0x118e('0x2d')](function(_0xd988ea){var _0x3776de=_0x10394f['user'][_0x118e('0x52')]({'plain':!![]});if(!_0x3776de)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3776de['role']===_0x118e('0x53')){var _0x5278d1=_0xd988ea['get']({'plain':!![]});var _0x2f751b=_0x118e('0x54');return db[_0x118e('0x55')]['find']({'where':{'name':_0x2f751b,'userProfileId':_0x3776de[_0x118e('0x56')]},'raw':!![]})['then'](function(_0x31a36b){if(_0x31a36b&&_0x31a36b['autoAssociation']===0x0){return db[_0x118e('0x57')]['create']({'name':_0x5278d1[_0x118e('0x31')],'resourceId':_0x5278d1['id'],'type':_0x31a36b[_0x118e('0x31')],'sectionId':_0x31a36b['id']},{})[_0x118e('0x2d')](function(){return _0xd988ea;});}else{return _0xd988ea;}})[_0x118e('0x4f')](function(_0x1b589a){logger[_0x118e('0x2f')](_0x118e('0x58'),_0x1b589a);throw _0x1b589a;});}return _0xd988ea;})[_0x118e('0x2d')](respondWithResult(_0x12131d,0xc9))[_0x118e('0x4f')](handleError(_0x12131d,null));};exports['update']=function(_0x568361,_0xff81b4){if(_0x568361['body']['id']){delete _0x568361[_0x118e('0x51')]['id'];}return db[_0x118e('0x34')]['find']({'where':{'id':_0x568361[_0x118e('0x4e')]['id']}})[_0x118e('0x2d')](handleEntityNotFound(_0xff81b4,null))['then'](saveUpdates(_0x568361[_0x118e('0x51')],null))[_0x118e('0x2d')](respondWithResult(_0xff81b4,null))['catch'](handleError(_0xff81b4,null));};exports[_0x118e('0x59')]=function(_0x241449,_0x2c8da4){var _0x1f8a07=_0x241449['params']['id'];var _0x7d4932=[];return db['sequelize'][_0x118e('0x5a')](function(_0x5e1b93){var _0x51488c=_0x118e('0x5b')+_0x1f8a07;return db[_0x118e('0x5c')][_0x118e('0x3b')](_0x51488c,{'type':db['Sequelize'][_0x118e('0x5d')][_0x118e('0x5e')],'raw':!![],'transaction':_0x5e1b93})[_0x118e('0x2d')](function(_0xa1201a){_0x7d4932=_[_0x118e('0x39')](_0xa1201a,function(_0x46c3d5){return Number(_0x46c3d5[_0x118e('0x5f')]);});})['then'](function(){var _0x4e24cc=_0x118e('0x60')+_0x1f8a07;return db[_0x118e('0x5c')][_0x118e('0x3b')](_0x4e24cc,{'type':db[_0x118e('0x61')][_0x118e('0x5d')][_0x118e('0x5e')],'raw':!![],'transaction':_0x5e1b93});})[_0x118e('0x2d')](function(_0x1d0964){var _0xb24dcd=_[_0x118e('0x39')](_0x1d0964,function(_0x43f7e0){return Number(_0x43f7e0[_0x118e('0x62')]);});return db[_0x118e('0x63')][_0x118e('0x59')]({'where':{'UserId':{'$in':_0x7d4932},'VoiceQueueId':{'$in':_0xb24dcd}},'transaction':_0x5e1b93});})[_0x118e('0x2d')](function(){var _0x3433cb='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x1f8a07;return db['sequelize']['query'](_0x3433cb,{'type':db[_0x118e('0x61')]['QueryTypes'][_0x118e('0x5e')],'raw':!![],'transaction':_0x5e1b93});})['then'](function(_0x18dfe6){var _0x1d9ca5=_[_0x118e('0x39')](_0x18dfe6,function(_0x2802c3){return Number(_0x2802c3['MailQueueId']);});return db[_0x118e('0x64')][_0x118e('0x59')]({'where':{'UserId':{'$in':_0x7d4932},'MailQueueId':{'$in':_0x1d9ca5}},'transaction':_0x5e1b93});})[_0x118e('0x2d')](function(){var _0x3ca803=_0x118e('0x65')+_0x1f8a07;return db[_0x118e('0x5c')][_0x118e('0x3b')](_0x3ca803,{'type':db[_0x118e('0x61')]['QueryTypes'][_0x118e('0x5e')],'raw':!![],'transaction':_0x5e1b93});})[_0x118e('0x2d')](function(_0x305a0e){var _0xc18ce8=_[_0x118e('0x39')](_0x305a0e,function(_0x2c456d){return Number(_0x2c456d[_0x118e('0x66')]);});return db[_0x118e('0x67')]['destroy']({'where':{'UserId':{'$in':_0x7d4932},'SmsQueueId':{'$in':_0xc18ce8}},'transaction':_0x5e1b93});})['then'](function(){var _0x4d470a=_0x118e('0x68')+_0x1f8a07;return db[_0x118e('0x5c')][_0x118e('0x3b')](_0x4d470a,{'type':db[_0x118e('0x61')][_0x118e('0x5d')][_0x118e('0x5e')],'raw':!![],'transaction':_0x5e1b93});})['then'](function(_0xfd8795){var _0x2726fe=_['map'](_0xfd8795,function(_0x46ece1){return Number(_0x46ece1[_0x118e('0x69')]);});return db[_0x118e('0x6a')][_0x118e('0x59')]({'where':{'UserId':{'$in':_0x7d4932},'ChatQueueId':{'$in':_0x2726fe}},'transaction':_0x5e1b93});})['then'](function(){var _0x4a835e=_0x118e('0x6b')+_0x1f8a07;return db[_0x118e('0x5c')][_0x118e('0x3b')](_0x4a835e,{'type':db['Sequelize'][_0x118e('0x5d')][_0x118e('0x5e')],'raw':!![],'transaction':_0x5e1b93});})[_0x118e('0x2d')](function(_0x1d9014){var _0x4a50c5=_['map'](_0x1d9014,function(_0x20080e){return Number(_0x20080e[_0x118e('0x6c')]);});return db[_0x118e('0x6d')][_0x118e('0x59')]({'where':{'UserId':{'$in':_0x7d4932},'FaxQueueId':{'$in':_0x4a50c5}},'transaction':_0x5e1b93});})['then'](function(){var _0x348bec=_0x118e('0x6e')+_0x1f8a07;return db[_0x118e('0x5c')][_0x118e('0x3b')](_0x348bec,{'type':db['Sequelize'][_0x118e('0x5d')]['SELECT'],'raw':!![],'transaction':_0x5e1b93});})['then'](function(_0x2dae70){var _0x5c0989=_[_0x118e('0x39')](_0x2dae70,function(_0x3da5e4){return Number(_0x3da5e4[_0x118e('0x6f')]);});return db[_0x118e('0x70')][_0x118e('0x59')]({'where':{'UserId':{'$in':_0x7d4932},'OpenchannelQueueId':{'$in':_0x5c0989}},'transaction':_0x5e1b93});})[_0x118e('0x2d')](function(){var _0x2e84af='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x1f8a07;return db['sequelize'][_0x118e('0x3b')](_0x2e84af,{'type':db[_0x118e('0x61')][_0x118e('0x5d')][_0x118e('0x5e')],'raw':!![],'transaction':_0x5e1b93});})[_0x118e('0x2d')](function(_0x5d7d5c){var _0x163478=_['map'](_0x5d7d5c,function(_0x3d9f5c){return Number(_0x3d9f5c[_0x118e('0x71')]);});return db[_0x118e('0x72')][_0x118e('0x59')]({'where':{'UserId':{'$in':_0x7d4932},'WhatsappQueueId':{'$in':_0x163478}},'transaction':_0x5e1b93});})['then'](function(){return db['TeamVoicePrefix'][_0x118e('0x73')]({'where':{'TeamId':_0x1f8a07}});})['then'](function(_0x27a51b){if(_0x27a51b===null){return;}return db[_0x118e('0x74')][_0x118e('0x59')]({'where':{'UserId':{'$in':_0x7d4932},'VoicePrefixId':_0x27a51b['VoicePrefixId']},'transaction':_0x5e1b93});})[_0x118e('0x2d')](function(){return db[_0x118e('0x34')][_0x118e('0x59')]({'where':{'id':_0x1f8a07},'cascade':!![],'transaction':_0x5e1b93});})[_0x118e('0x2d')](function(_0x113516){if(_0x113516===0x0){_0x2c8da4[_0x118e('0x2e')](0x194);}else{return db[_0x118e('0x57')]['destroy']({'where':{'type':_0x118e('0x54'),'resourceId':_0x1f8a07},'cascade':!![],'transaction':_0x5e1b93})['then'](function(){_0x2c8da4[_0x118e('0x21')](0xcc)[_0x118e('0x22')]();});}})[_0x118e('0x4f')](function(_0x2eef3f){_0x2c8da4[_0x118e('0x21')](0x1f4)[_0x118e('0x32')](_0x2eef3f);});});};exports[_0x118e('0x75')]=function(_0xed04d0,_0x14e236,_0x3f0938){return db[_0x118e('0x34')][_0x118e('0x76')]({'where':{'id':_0xed04d0[_0x118e('0x4e')]['id']}})[_0x118e('0x2d')](handleEntityNotFound(_0x14e236,null))[_0x118e('0x2d')](function(_0x500360){if(!_0xed04d0[_0x118e('0x3b')][_0x118e('0x77')]||!utils[_0x118e('0x78')](_0xed04d0[_0x118e('0x3b')][_0x118e('0x77')])){throw new db[(_0x118e('0x61'))]['ValidationError']('Unknown\x20channel');}var _0x74e92f={};var _0xec7501={};_0xec7501[_0x118e('0x38')]=_['keys'](db[_[_0x118e('0x79')](_0xed04d0[_0x118e('0x3b')]['channel']['toLowerCase']())+'Queue'][_0x118e('0x35')]);_0xec7501[_0x118e('0x3b')]=_[_0x118e('0x3a')](_0xed04d0[_0x118e('0x3b')]);_0xec7501[_0x118e('0x3c')]=_['intersection'](_0xec7501['model'],_0xec7501[_0x118e('0x3b')]);_0x74e92f[_0x118e('0x3e')]=_[_0x118e('0x3d')](_0xec7501[_0x118e('0x38')],qs[_0x118e('0x3f')](_0xed04d0['query']['fields']));_0x74e92f[_0x118e('0x3e')]=_0x74e92f[_0x118e('0x3e')]['length']?_0x74e92f[_0x118e('0x3e')]:_0xec7501[_0x118e('0x38')];_0x74e92f['limit']=qs[_0x118e('0x25')](_0xed04d0['query']['limit']);_0x74e92f['offset']=qs[_0x118e('0x27')](_0xed04d0[_0x118e('0x3b')]['offset']);_0x74e92f[_0x118e('0x43')]=qs[_0x118e('0x44')](_0xed04d0[_0x118e('0x3b')][_0x118e('0x44')]);_0x74e92f[_0x118e('0x46')]=qs['filters'](_[_0x118e('0x7a')](_0xed04d0[_0x118e('0x3b')],_0xec7501[_0x118e('0x3c')]));_0x74e92f=_['merge']({},_0x74e92f,_0xed04d0[_0x118e('0x49')]);return _0x500360['get'+_[_0x118e('0x79')](_0xed04d0[_0x118e('0x3b')][_0x118e('0x77')]['toLowerCase']())+_0x118e('0x7b')](_0x74e92f);})[_0x118e('0x2d')](respondWithResult(_0x14e236,null))[_0x118e('0x4f')](handleError(_0x14e236,null));};exports[_0x118e('0x7c')]=function(_0x3faec5,_0x39b4db,_0x16c310){return db[_0x118e('0x34')]['findOne']({'where':{'id':_0x3faec5['params']['id']}})[_0x118e('0x2d')](function(_0x4a9eaf){if(_0x4a9eaf){if(!_0x3faec5[_0x118e('0x51')][_0x118e('0x77')]||!utils[_0x118e('0x78')](_0x3faec5[_0x118e('0x51')][_0x118e('0x77')])){throw new db[(_0x118e('0x61'))][(_0x118e('0x7d'))](_0x118e('0x7e'));}return _0x4a9eaf[_0x118e('0x7f')+_[_0x118e('0x79')](_0x3faec5[_0x118e('0x51')][_0x118e('0x77')]['toLowerCase']())+_0x118e('0x7b')](_0x3faec5[_0x118e('0x51')][_0x118e('0x80')]);}return null;})[_0x118e('0x2d')](handleEntityNotFound(_0x39b4db,null))['then'](respondWithStatusCode(_0x39b4db,null))[_0x118e('0x4f')](handleError(_0x39b4db,null));};exports[_0x118e('0x81')]=function(_0x286005,_0x476466,_0x4415e6){return db['Team']['findOne']({'where':{'id':_0x286005[_0x118e('0x4e')]['id']}})[_0x118e('0x2d')](function(_0x3a3eb7){if(_0x3a3eb7){if(!_0x286005[_0x118e('0x3b')][_0x118e('0x77')]||!utils['isValidChannel'](_0x286005[_0x118e('0x3b')][_0x118e('0x77')])){throw new db[(_0x118e('0x61'))][(_0x118e('0x7d'))](_0x118e('0x7e'));}return _0x3a3eb7[_0x118e('0x82')+_[_0x118e('0x79')](_0x286005['query'][_0x118e('0x77')][_0x118e('0x83')]())+'Queues'](_0x286005['query'][_0x118e('0x80')]);}return null;})[_0x118e('0x2d')](handleEntityNotFound(_0x476466,null))['then'](respondWithStatusCode(_0x476466,null))[_0x118e('0x4f')](handleError(_0x476466,null));};exports['addAgents']=function(_0x167e66,_0x21f858){var _0xe6cba3=_['isArray'](_0x167e66[_0x118e('0x51')]['ids'])?_0x167e66['body'][_0x118e('0x80')]:[_0x167e66[_0x118e('0x51')][_0x118e('0x80')]];var _0x3c2912=_0x167e66[_0x118e('0x4e')]['id'];return db['Team'][_0x118e('0x73')]({'where':{'id':_0x3c2912}})[_0x118e('0x2d')](handleEntityNotFound(_0x21f858,null))[_0x118e('0x2d')](function(_0x172e73){if(_0x172e73){var _0x16c2cd=[_0x118e('0x84'),'Chat',_0x118e('0x85'),_0x118e('0x86'),'Fax',_0x118e('0x87'),'Whatsapp'];return db[_0x118e('0x5c')][_0x118e('0x5a')](function(_0x4609df){var _0x2e055b=_[_0x118e('0x39')](_0x16c2cd,function(_0x21490f){var _0x26d716={'attributes':['id',_0x118e('0x31')]};if(_0x21490f===_0x118e('0x84')){_0x26d716[_0x118e('0x88')]={'attributes':[_0x118e('0x89')]};}return _0x172e73[_0x118e('0x52')+_0x21490f+_0x118e('0x7b')](_0x26d716)[_0x118e('0x2d')](function(_0x4d0d20){var _0x2ec01e=_['map'](_0x4d0d20,function(_0x2cf4c6){var _0x2a3bda=_[_0x118e('0x39')](_0xe6cba3,function(_0x375bac){var _0x11cbf8={'where':{'UserId':_0x375bac,[_0x21490f+_0x118e('0x8a')]:_0x2cf4c6['id']},'transaction':_0x4609df};if(_0x21490f===_0x118e('0x84')){_0x11cbf8[_0x118e('0x8b')]={'penalty':_0x2cf4c6['TeamVoiceQueue'][_0x118e('0x89')]};}return db[_0x118e('0x8c')+_0x21490f+'Queue'][_0x118e('0x8d')](_0x11cbf8)[_0x118e('0x2d')](function(){socket[_0x118e('0x8e')](_0x118e('0x53')+_0x21490f+'Queue:save',{'UserId':_0x375bac,[_0x21490f+_0x118e('0x8a')]:_0x2cf4c6['id']});if(_0x21490f!=='Voice'){return;}return db[_0x118e('0x8c')][_0x118e('0x4b')]({'where':{'id':_0xe6cba3,'online':0x1},'attributes':['id',_0x118e('0x31'),'online','voicePause','interface'],'raw':!![]})[_0x118e('0x2d')](function(_0x494c61){var _0x38806d=_[_0x118e('0x39')](_0x494c61,function(_0x25f2f2){return db[_0x118e('0x8f')][_0x118e('0x90')]({'membername':_0x25f2f2[_0x118e('0x31')],'UserId':_0x25f2f2['id'],'queue_name':_0x2cf4c6[_0x118e('0x31')],'VoiceQueueId':_0x2cf4c6['id'],'interface':_[_0x118e('0x91')](_0x25f2f2['interface'])?util[_0x118e('0x92')](_0x118e('0x93'),_0x25f2f2[_0x118e('0x31')]):_0x25f2f2[_0x118e('0x94')],'paused':_0x25f2f2[_0x118e('0x95')]||![],'penalty':_0x2cf4c6[_0x118e('0x96')][_0x118e('0x89')]},{'transaction':_0x4609df});});return Promise[_0x118e('0x97')](_0x38806d);});});});return Promise['all'](_0x2a3bda);});return Promise[_0x118e('0x97')](_0x2ec01e);})[_0x118e('0x2d')](function(){return db[_0x118e('0x98')][_0x118e('0x76')]({'where':{'teamId':_0x3c2912}})[_0x118e('0x2d')](function(_0x24ca35){if(_0x24ca35){var _0x29edc1=_[_0x118e('0x39')](_0xe6cba3,function(_0xe3fde3){db[_0x118e('0x74')][_0x118e('0x90')]({'UserId':_0xe3fde3,'VoicePrefixId':_0x24ca35[_0x118e('0x99')]});});return Promise[_0x118e('0x97')](_0x29edc1);}});});});return Promise[_0x118e('0x97')](_0x2e055b)[_0x118e('0x2d')](function(){return _0x172e73[_0x118e('0x9a')](_0xe6cba3,{'transaction':_0x4609df})['spread'](function(_0x263d3b){return _0x263d3b;});});});}})[_0x118e('0x2d')](respondWithResult(_0x21f858,null))[_0x118e('0x4f')](handleError(_0x21f858,null));};exports[_0x118e('0x9b')]=function(_0x2be49a,_0x19f55e){var _0x5b364a=_[_0x118e('0x9c')](_0x2be49a['query'][_0x118e('0x80')])?_0x2be49a[_0x118e('0x3b')][_0x118e('0x80')]:[_0x2be49a['query'][_0x118e('0x80')]];var _0x492a06=_0x2be49a['params']['id'];return db['Team'][_0x118e('0x73')]({'where':{'id':_0x492a06}})[_0x118e('0x2d')](handleEntityNotFound(_0x19f55e,null))[_0x118e('0x2d')](function(_0x4ac11d){if(_0x4ac11d){var _0x3c4276=['Voice',_0x118e('0x9d'),_0x118e('0x85'),_0x118e('0x86'),_0x118e('0x9e'),'Openchannel',_0x118e('0x9f')];return db['sequelize']['transaction'](function(_0x11c4db){var _0x559385=_[_0x118e('0x39')](_0x3c4276,function(_0x2e7b32){var _0x5e27ae={'attributes':['id',_0x118e('0x31')]};return _0x4ac11d[_0x118e('0x52')+_0x2e7b32+_0x118e('0x7b')](_0x5e27ae)['then'](function(_0x477278){var _0x1874e4=_['map'](_0x477278,function(_0x4a9855){return _0x4a9855[_0x118e('0x9b')](_0x5b364a,{'transaction':_0x11c4db})[_0x118e('0x2d')](function(){var _0x23a6a4=_['map'](_0x5b364a,function(_0x370a2b){socket[_0x118e('0x8e')]('user'+_0x2e7b32+'Queue:remove',{'UserId':Number(_0x370a2b),[_0x2e7b32+_0x118e('0x8a')]:_0x4a9855['id']});if(_0x2e7b32!==_0x118e('0x84')){return;}return db[_0x118e('0x8f')]['destroy']({'where':{'VoiceQueueId':_0x4a9855['id'],'UserId':_0x370a2b},'transaction':_0x11c4db});});return Promise[_0x118e('0x97')](_0x23a6a4);});});return Promise['all'](_0x1874e4);});});return Promise['all'](_0x559385)['then'](function(){return _0x4ac11d[_0x118e('0x9b')](_0x5b364a,{'transaction':_0x11c4db});})[_0x118e('0x2d')](function(){return db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0x492a06}})[_0x118e('0x2d')](function(_0x16f7da){if(_0x16f7da){var _0x181ca2=_[_0x118e('0x39')](_0x5b364a,function(_0x14c836){db[_0x118e('0x74')][_0x118e('0x59')]({'where':{'UserId':_0x14c836,'VoicePrefixId':_0x16f7da['VoicePrefixId']}});});return Promise[_0x118e('0x97')](_0x181ca2);}});});});}})[_0x118e('0x2d')](respondWithStatusCode(_0x19f55e,null))[_0x118e('0x4f')](handleError(_0x19f55e,null));};exports[_0x118e('0xa0')]=function(_0x11f451,_0x11756d,_0x2ef5ff){var _0x1f4172={};var _0x42a713={};var _0x2806b6;var _0x407626;return db[_0x118e('0x34')]['findOne']({'where':{'id':_0x11f451['params']['id']}})['then'](handleEntityNotFound(_0x11756d,null))[_0x118e('0x2d')](function(_0x14a586){if(_0x14a586){_0x2806b6=_0x14a586;_0x42a713[_0x118e('0x38')]=_[_0x118e('0x3a')](db[_0x118e('0x8c')][_0x118e('0x35')]);_0x42a713['query']=_[_0x118e('0x3a')](_0x11f451['query']);_0x42a713[_0x118e('0x3c')]=_['intersection'](_0x42a713[_0x118e('0x38')],_0x42a713[_0x118e('0x3b')]);_0x1f4172[_0x118e('0x3e')]=_[_0x118e('0x3d')](_0x42a713['model'],qs[_0x118e('0x3f')](_0x11f451[_0x118e('0x3b')][_0x118e('0x3f')]));_0x1f4172['attributes']=_0x1f4172[_0x118e('0x3e')][_0x118e('0x40')]?_0x1f4172[_0x118e('0x3e')]:_0x42a713[_0x118e('0x38')];_0x1f4172['order']=qs[_0x118e('0x44')](_0x11f451['query'][_0x118e('0x44')]);_0x1f4172[_0x118e('0x46')]=qs[_0x118e('0x3c')](_[_0x118e('0x7a')](_0x11f451[_0x118e('0x3b')],_0x42a713[_0x118e('0x3c')]));if(_0x11f451[_0x118e('0x3b')][_0x118e('0x45')]){_0x1f4172[_0x118e('0x46')]=_[_0x118e('0x48')](_0x1f4172[_0x118e('0x46')],{'$or':_[_0x118e('0x39')](_0x1f4172[_0x118e('0x3e')],function(_0x2ccd9a){var _0x205e08={};_0x205e08[_0x2ccd9a]={'$like':'%'+_0x11f451['query'][_0x118e('0x45')]+'%'};return _0x205e08;})});}_0x1f4172=_[_0x118e('0x48')]({},_0x1f4172,_0x11f451[_0x118e('0x49')]);return _0x2806b6[_0x118e('0xa0')](_0x1f4172);}})[_0x118e('0x2d')](function(_0x4558fa){if(_0x4558fa){_0x407626=_0x4558fa['length'];if(!_0x11f451[_0x118e('0x3b')][_0x118e('0x41')](_0x118e('0x42'))){_0x1f4172[_0x118e('0x25')]=qs[_0x118e('0x25')](_0x11f451[_0x118e('0x3b')]['limit']);_0x1f4172[_0x118e('0x27')]=qs[_0x118e('0x27')](_0x11f451[_0x118e('0x3b')]['offset']);}return _0x2806b6[_0x118e('0xa0')](_0x1f4172);}})['then'](function(_0x4f7f5e){if(_0x4f7f5e){return _0x4f7f5e?{'count':_0x407626,'rows':_0x4f7f5e}:null;}})[_0x118e('0x2d')](respondWithResult(_0x11756d,null))['catch'](handleError(_0x11756d,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 0f3846d..a4dbb78 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 _0xe1e6=['exports','events','../../mysqldb','Team','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x17e762,_0x337cd1){var _0x380f58=function(_0x286c18){while(--_0x286c18){_0x17e762['push'](_0x17e762['shift']());}};_0x380f58(++_0x337cd1);}(_0xe1e6,0x12d));var _0x6e1e=function(_0x5e7c81,_0x190b72){_0x5e7c81=_0x5e7c81-0x0;var _0x415edb=_0xe1e6[_0x5e7c81];return _0x415edb;};'use strict';var EventEmitter=require(_0x6e1e('0x0'));var Team=require(_0x6e1e('0x1'))['db'][_0x6e1e('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x6e1e('0x3')](0x0);var events={'afterCreate':_0x6e1e('0x4'),'afterUpdate':'update','afterDestroy':_0x6e1e('0x5')};function emitEvent(_0xea7672){return function(_0x13c587,_0x9c4a58,_0x25268f){TeamEvents[_0x6e1e('0x6')](_0xea7672+':'+_0x13c587['id'],_0x13c587);TeamEvents[_0x6e1e('0x6')](_0xea7672,_0x13c587);_0x25268f(null);};}for(var e in events){if(events[_0x6e1e('0x7')](e)){var event=events[e];Team[_0x6e1e('0x8')](e,emitEvent(event));}}module[_0x6e1e('0x9')]=TeamEvents; \ No newline at end of file +var _0xd9e3=['hook','events','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x241411,_0x5e38ae){var _0x562761=function(_0x5a5cb3){while(--_0x5a5cb3){_0x241411['push'](_0x241411['shift']());}};_0x562761(++_0x5e38ae);}(_0xd9e3,0x73));var _0x3d9e=function(_0x456816,_0x5e5ee0){_0x456816=_0x456816-0x0;var _0x1be256=_0xd9e3[_0x456816];return _0x1be256;};'use strict';var EventEmitter=require(_0x3d9e('0x0'));var Team=require('../../mysqldb')['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0x3d9e('0x1')](0x0);var events={'afterCreate':_0x3d9e('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x8f18d2){return function(_0x1e8427,_0x4ae736,_0x42e003){TeamEvents[_0x3d9e('0x3')](_0x8f18d2+':'+_0x1e8427['id'],_0x1e8427);TeamEvents[_0x3d9e('0x3')](_0x8f18d2,_0x1e8427);_0x42e003(null);};}for(var e in events){if(events[_0x3d9e('0x4')](e)){var event=events[e];Team[_0x3d9e('0x5')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 508e0b6..0394637 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 _0x711d=['map','setDataValue','channel','define','Team','teams','Chat','Fax','Mail','Openchannel','Sms','Whatsapp','resolve','then','catch','./team.attributes','get','Queues'];(function(_0x5084f8,_0x3aa82){var _0x23d22d=function(_0x5b9a76){while(--_0x5b9a76){_0x5084f8['push'](_0x5084f8['shift']());}};_0x23d22d(++_0x3aa82);}(_0x711d,0xc3));var _0xd711=function(_0x357f0c,_0x693a74){_0x357f0c=_0x357f0c-0x0;var _0x5d77bc=_0x711d[_0x357f0c];return _0x5d77bc;};'use strict';var _=require('lodash');var attributes=require(_0xd711('0x0'));function getQueuesByChannel(_0x1546b4,_0x284b6a){var _0x27deb8=_0xd711('0x1')+_0x284b6a+_0xd711('0x2');return _0x1546b4[_0x27deb8]()['then'](function(_0x3fce0c){return _[_0xd711('0x3')](_0x3fce0c,function(_0x574629){_0x574629[_0xd711('0x4')](_0xd711('0x5'),_0x284b6a);return _0x574629;});})['catch'](function(_0xd278ed){throw _0xd278ed;});}module['exports']=function(_0x5683c0){return _0x5683c0[_0xd711('0x6')](_0xd711('0x7'),attributes,{'tableName':_0xd711('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x357086=this;var _0x2a732c=[_0xd711('0x9'),_0xd711('0xa'),_0xd711('0xb'),_0xd711('0xc'),_0xd711('0xd'),'Voice',_0xd711('0xe')];return Promise[_0xd711('0xf')]()[_0xd711('0x10')](function(){var _0x4b9845=_[_0xd711('0x3')](_0x2a732c,function(_0x33f12a){return getQueuesByChannel(_0x357086,_0x33f12a);});return Promise['all'](_0x4b9845);})[_0xd711('0x11')](function(_0x2c11c0){throw _0x2c11c0;});}}});}; \ No newline at end of file +var _0x329b=['exports','define','Team','teams','Mail','Openchannel','Sms','Voice','resolve','map','lodash','./team.attributes','get','then'];(function(_0x1df7b8,_0x2fe5e5){var _0x29d911=function(_0x340121){while(--_0x340121){_0x1df7b8['push'](_0x1df7b8['shift']());}};_0x29d911(++_0x2fe5e5);}(_0x329b,0x192));var _0xb329=function(_0x237f8b,_0xc5eddb){_0x237f8b=_0x237f8b-0x0;var _0x423f94=_0x329b[_0x237f8b];return _0x423f94;};'use strict';var _=require(_0xb329('0x0'));var attributes=require(_0xb329('0x1'));function getQueuesByChannel(_0x1a2d73,_0x5431b1){var _0x19ed19=_0xb329('0x2')+_0x5431b1+'Queues';return _0x1a2d73[_0x19ed19]()[_0xb329('0x3')](function(_0x34fabe){return _['map'](_0x34fabe,function(_0x3a595f){_0x3a595f['setDataValue']('channel',_0x5431b1);return _0x3a595f;});})['catch'](function(_0x93f68){throw _0x93f68;});}module[_0xb329('0x4')]=function(_0xd8df20){return _0xd8df20[_0xb329('0x5')](_0xb329('0x6'),attributes,{'tableName':_0xb329('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x1031bd=this;var _0x489e1a=['Chat','Fax',_0xb329('0x8'),_0xb329('0x9'),_0xb329('0xa'),_0xb329('0xb'),'Whatsapp'];return Promise[_0xb329('0xc')]()['then'](function(){var _0x318f56=_[_0xb329('0xd')](_0x489e1a,function(_0x3c0941){return getQueuesByChannel(_0x1031bd,_0x3c0941);});return Promise['all'](_0x318f56);})['catch'](function(_0x512eb6){throw _0x512eb6;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index c13edc2..ea606c9 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 _0x52ad=['result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x5045f3,_0x1a0e05){var _0x3a2c65=function(_0x4cf407){while(--_0x4cf407){_0x5045f3['push'](_0x5045f3['shift']());}};_0x3a2c65(++_0x1a0e05);}(_0x52ad,0x115));var _0xd52a=function(_0x361d52,_0x39fc0f){_0x361d52=_0x361d52-0x0;var _0x144477=_0x52ad[_0x361d52];return _0x144477;};'use strict';var _=require(_0xd52a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd52a('0x1'));var fs=require('fs');var Redis=require(_0xd52a('0x2'));var db=require(_0xd52a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xd52a('0x4'))(_0xd52a('0x5'));var config=require(_0xd52a('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xd52a('0x7')][_0xd52a('0x8')]({'port':0x232a});config[_0xd52a('0x9')]=_['defaults'](config['redis'],{'host':_0xd52a('0xa'),'port':0x18eb});var socket=require(_0xd52a('0xb'))(new Redis(config[_0xd52a('0x9')]));require('./team.socket')['register'](socket);function respondWithRpcPromise(_0x43e2ef,_0x1a3cb7,_0x280637){return new BPromise(function(_0xa78ce9,_0x385854){return client[_0xd52a('0xc')](_0x43e2ef,_0x280637)[_0xd52a('0xd')](function(_0x2f9405){logger[_0xd52a('0xe')](_0xd52a('0xf'),_0x1a3cb7,_0xd52a('0x10'));logger[_0xd52a('0x11')](_0xd52a('0x12'),_0x1a3cb7,_0xd52a('0x10'),JSON[_0xd52a('0x13')](_0x2f9405));if(_0x2f9405[_0xd52a('0x14')]){if(_0x2f9405[_0xd52a('0x14')][_0xd52a('0x15')]===0x1f4){logger[_0xd52a('0x14')](_0xd52a('0xf'),_0x1a3cb7,_0x2f9405['error']['message']);return _0x385854(_0x2f9405[_0xd52a('0x14')][_0xd52a('0x16')]);}logger[_0xd52a('0x14')](_0xd52a('0xf'),_0x1a3cb7,_0x2f9405[_0xd52a('0x14')]['message']);return _0xa78ce9(_0x2f9405[_0xd52a('0x14')]['message']);}else{logger[_0xd52a('0xe')]('Team,\x20%s,\x20%s',_0x1a3cb7,_0xd52a('0x10'));_0xa78ce9(_0x2f9405[_0xd52a('0x17')][_0xd52a('0x16')]);}})[_0xd52a('0x18')](function(_0x567afa){logger[_0xd52a('0x14')](_0xd52a('0xf'),_0x1a3cb7,_0x567afa);_0x385854(_0x567afa);});});} \ No newline at end of file +var _0xb45d=['error','code','Team,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','http','redis','defaults','socket.io-emitter','./team.socket','register','request','then','info','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x47b09d,_0x1e364f){var _0x18755b=function(_0x298ca7){while(--_0x298ca7){_0x47b09d['push'](_0x47b09d['shift']());}};_0x18755b(++_0x1e364f);}(_0xb45d,0x1ec));var _0xdb45=function(_0x483ab9,_0x419148){_0x483ab9=_0x483ab9-0x0;var _0x35043b=_0xb45d[_0x483ab9];return _0x35043b;};'use strict';var _=require(_0xdb45('0x0'));var util=require(_0xdb45('0x1'));var moment=require(_0xdb45('0x2'));var BPromise=require(_0xdb45('0x3'));var rs=require(_0xdb45('0x4'));var fs=require('fs');var Redis=require(_0xdb45('0x5'));var db=require(_0xdb45('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdb45('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xdb45('0x8')]({'port':0x232a});config[_0xdb45('0x9')]=_[_0xdb45('0xa')](config[_0xdb45('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xdb45('0xb'))(new Redis(config[_0xdb45('0x9')]));require(_0xdb45('0xc'))[_0xdb45('0xd')](socket);function respondWithRpcPromise(_0x57f35b,_0x1ae8ba,_0x435a16){return new BPromise(function(_0xb431a9,_0x1d2f43){return client[_0xdb45('0xe')](_0x57f35b,_0x435a16)[_0xdb45('0xf')](function(_0x815d43){logger[_0xdb45('0x10')]('Team,\x20%s,\x20%s',_0x1ae8ba,_0xdb45('0x11'));logger[_0xdb45('0x12')](_0xdb45('0x13'),_0x1ae8ba,_0xdb45('0x11'),JSON[_0xdb45('0x14')](_0x815d43));if(_0x815d43['error']){if(_0x815d43[_0xdb45('0x15')][_0xdb45('0x16')]===0x1f4){logger[_0xdb45('0x15')](_0xdb45('0x17'),_0x1ae8ba,_0x815d43[_0xdb45('0x15')]['message']);return _0x1d2f43(_0x815d43['error'][_0xdb45('0x18')]);}logger[_0xdb45('0x15')](_0xdb45('0x17'),_0x1ae8ba,_0x815d43[_0xdb45('0x15')][_0xdb45('0x18')]);return _0xb431a9(_0x815d43[_0xdb45('0x15')]['message']);}else{logger[_0xdb45('0x10')](_0xdb45('0x17'),_0x1ae8ba,_0xdb45('0x11'));_0xb431a9(_0x815d43[_0xdb45('0x19')][_0xdb45('0x18')]);}})[_0xdb45('0x1a')](function(_0x2a5da3){logger[_0xdb45('0x15')](_0xdb45('0x17'),_0x1ae8ba,_0x2a5da3);_0x1d2f43(_0x2a5da3);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 590065b..de00811 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 _0xa098=['emit','removeListener','register','length','./team.events','remove'];(function(_0x42b335,_0x31acac){var _0x60f015=function(_0x3ef326){while(--_0x3ef326){_0x42b335['push'](_0x42b335['shift']());}};_0x60f015(++_0x31acac);}(_0xa098,0x94));var _0x8a09=function(_0x1e8e6e,_0x273e02){_0x1e8e6e=_0x1e8e6e-0x0;var _0x360489=_0xa098[_0x1e8e6e];return _0x360489;};'use strict';var TeamEvents=require(_0x8a09('0x0'));var events=['save',_0x8a09('0x1'),'update'];function createListener(_0x7f3101,_0x25d672){return function(_0x110fa8){_0x25d672[_0x8a09('0x2')](_0x7f3101,_0x110fa8);};}function removeListener(_0x1d1119,_0x40974a){return function(){TeamEvents[_0x8a09('0x3')](_0x1d1119,_0x40974a);};}exports[_0x8a09('0x4')]=function(_0x222610){for(var _0x8b332e=0x0,_0x1401ce=events[_0x8a09('0x5')];_0x8b332e<_0x1401ce;_0x8b332e++){var _0x1573c2=events[_0x8b332e];var _0x70d00c=createListener('team:'+_0x1573c2,_0x222610);TeamEvents['on'](_0x1573c2,_0x70d00c);}}; \ No newline at end of file +var _0x6c38=['save','remove','update','removeListener','length','./team.events'];(function(_0xe7ba9,_0x2ff262){var _0x34e6bd=function(_0x4b52e0){while(--_0x4b52e0){_0xe7ba9['push'](_0xe7ba9['shift']());}};_0x34e6bd(++_0x2ff262);}(_0x6c38,0x8f));var _0x86c3=function(_0x3256c6,_0x3166f8){_0x3256c6=_0x3256c6-0x0;var _0x19ae14=_0x6c38[_0x3256c6];return _0x19ae14;};'use strict';var TeamEvents=require(_0x86c3('0x0'));var events=[_0x86c3('0x1'),_0x86c3('0x2'),_0x86c3('0x3')];function createListener(_0x322e8c,_0x4daf60){return function(_0x437549){_0x4daf60['emit'](_0x322e8c,_0x437549);};}function removeListener(_0x503f44,_0x55bdeb){return function(){TeamEvents[_0x86c3('0x4')](_0x503f44,_0x55bdeb);};}exports['register']=function(_0x26ba7b){for(var _0x5b38ae=0x0,_0x49ff58=events[_0x86c3('0x5')];_0x5b38ae<_0x49ff58;_0x5b38ae++){var _0xbde89c=events[_0x5b38ae];var _0x224109=createListener('team:'+_0xbde89c,_0x26ba7b);TeamEvents['on'](_0xbde89c,_0x224109);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index f19ef96..dfd590e 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 _0x77f4=['sequelize','exports','INTEGER'];(function(_0x4ce452,_0x26a182){var _0x35e624=function(_0x253319){while(--_0x253319){_0x4ce452['push'](_0x4ce452['shift']());}};_0x35e624(++_0x26a182);}(_0x77f4,0x1a1));var _0x477f=function(_0x8b50d3,_0x17630d){_0x8b50d3=_0x8b50d3-0x0;var _0x568709=_0x77f4[_0x8b50d3];return _0x568709;};'use strict';var Sequelize=require(_0x477f('0x0'));module[_0x477f('0x1')]={'TeamId':{'type':Sequelize[_0x477f('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x477f('0x2')]}}; \ No newline at end of file +var _0x6325=['sequelize','exports'];(function(_0x53d026,_0x2384ff){var _0xf1418e=function(_0x294e0b){while(--_0x294e0b){_0x53d026['push'](_0x53d026['shift']());}};_0xf1418e(++_0x2384ff);}(_0x6325,0xe8));var _0x5632=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6325[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x5632('0x0'));module[_0x5632('0x1')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index cc90fad..eaed71c 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 _0x5eb1=['./teamVoicePrefix.attributes','exports','define','team_has_voice_prefixes','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x110c7c,_0x5c7106){var _0x58c09d=function(_0x16a7c0){while(--_0x16a7c0){_0x110c7c['push'](_0x110c7c['shift']());}};_0x58c09d(++_0x5c7106);}(_0x5eb1,0x7c));var _0x15eb=function(_0x382168,_0xe03b6a){_0x382168=_0x382168-0x0;var _0x3ecf7e=_0x5eb1[_0x382168];return _0x3ecf7e;};'use strict';var _=require('lodash');var util=require(_0x15eb('0x0'));var logger=require(_0x15eb('0x1'))(_0x15eb('0x2'));var moment=require(_0x15eb('0x3'));var BPromise=require(_0x15eb('0x4'));var rp=require(_0x15eb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x15eb('0x6'));var config=require(_0x15eb('0x7'));var attributes=require(_0x15eb('0x8'));module[_0x15eb('0x9')]=function(_0x47e341,_0x1be042){return _0x47e341[_0x15eb('0xa')]('TeamVoicePrefix',attributes,{'tableName':_0x15eb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb910=['../../config/environment','./teamVoicePrefix.attributes','exports','TeamVoicePrefix','team_has_voice_prefixes','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0xe6aa41,_0x5e89ce){var _0x5e9d14=function(_0x424a45){while(--_0x424a45){_0xe6aa41['push'](_0xe6aa41['shift']());}};_0x5e9d14(++_0x5e89ce);}(_0xb910,0x12b));var _0x0b91=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0xb910[_0x2f1762];return _0x8ab21;};'use strict';var _=require(_0x0b91('0x0'));var util=require(_0x0b91('0x1'));var logger=require(_0x0b91('0x2'))(_0x0b91('0x3'));var moment=require(_0x0b91('0x4'));var BPromise=require(_0x0b91('0x5'));var rp=require(_0x0b91('0x6'));var fs=require('fs');var path=require(_0x0b91('0x7'));var rimraf=require(_0x0b91('0x8'));var config=require(_0x0b91('0x9'));var attributes=require(_0x0b91('0xa'));module[_0x0b91('0xb')]=function(_0x295749,_0x1800dc){return _0x295749['define'](_0x0b91('0xc'),attributes,{'tableName':_0x0b91('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 1f9c110..b1b31b6 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0xcf22a8,_0x35d51c){var _0x1137eb=function(_0x22bdf6){while(--_0x22bdf6){_0xcf22a8['push'](_0xcf22a8['shift']());}};_0x1137eb(++_0x35d51c);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x3c6928,_0x45e261){var _0x2dd931=function(_0x3960e1){while(--_0x3960e1){_0x3c6928['push'](_0x3c6928['shift']());}};_0x2dd931(++_0x45e261);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2ab3d9,_0x50e716){_0x2ab3d9=_0x2ab3d9-0x0;var _0x210a54=_0xcb91[_0x2ab3d9];return _0x210a54;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index df359b8..6612178 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 _0x18c9=['sequelize','exports','INTEGER'];(function(_0x8ce621,_0x4d35a9){var _0x59f390=function(_0x260c70){while(--_0x260c70){_0x8ce621['push'](_0x8ce621['shift']());}};_0x59f390(++_0x4d35a9);}(_0x18c9,0x1bf));var _0x918c=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0x18c9[_0xc67528];return _0x38e26d;};'use strict';var Sequelize=require(_0x918c('0x0'));module[_0x918c('0x1')]={'penalty':{'type':Sequelize[_0x918c('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xae3c=['sequelize','INTEGER'];(function(_0x54ba26,_0x301c1f){var _0x36ce4e=function(_0x227ccb){while(--_0x227ccb){_0x54ba26['push'](_0x54ba26['shift']());}};_0x36ce4e(++_0x301c1f);}(_0xae3c,0x104));var _0xcae3=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0xae3c[_0x4e6ae6];return _0x23c108;};'use strict';var Sequelize=require(_0xcae3('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xcae3('0x1')],'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 8aa97de..93e422c 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 _0x26bc=['define','team_has_voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./teamVoiceQueue.attributes'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x26bc,0x162));var _0xc26b=function(_0x5df178,_0x2a73a3){_0x5df178=_0x5df178-0x0;var _0x54fa6e=_0x26bc[_0x5df178];return _0x54fa6e;};'use strict';var _=require(_0xc26b('0x0'));var util=require(_0xc26b('0x1'));var logger=require(_0xc26b('0x2'))(_0xc26b('0x3'));var moment=require(_0xc26b('0x4'));var BPromise=require('bluebird');var rp=require(_0xc26b('0x5'));var fs=require('fs');var path=require(_0xc26b('0x6'));var rimraf=require(_0xc26b('0x7'));var config=require('../../config/environment');var attributes=require(_0xc26b('0x8'));module['exports']=function(_0x299ad8,_0x212243){return _0x299ad8[_0xc26b('0x9')]('TeamVoiceQueue',attributes,{'tableName':_0xc26b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd246=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','TeamVoiceQueue','team_has_voice_queues','lodash','util'];(function(_0x5aab24,_0x3c8d4d){var _0x503327=function(_0xcc599){while(--_0xcc599){_0x5aab24['push'](_0x5aab24['shift']());}};_0x503327(++_0x3c8d4d);}(_0xd246,0xf5));var _0x6d24=function(_0x37bf43,_0x5b2339){_0x37bf43=_0x37bf43-0x0;var _0x4101c5=_0xd246[_0x37bf43];return _0x4101c5;};'use strict';var _=require(_0x6d24('0x0'));var util=require(_0x6d24('0x1'));var logger=require(_0x6d24('0x2'))(_0x6d24('0x3'));var moment=require(_0x6d24('0x4'));var BPromise=require(_0x6d24('0x5'));var rp=require(_0x6d24('0x6'));var fs=require('fs');var path=require(_0x6d24('0x7'));var rimraf=require('rimraf');var config=require(_0x6d24('0x8'));var attributes=require('./teamVoiceQueue.attributes');module[_0x6d24('0x9')]=function(_0x536c95,_0xa72e6e){return _0x536c95[_0x6d24('0xa')](_0x6d24('0xb'),attributes,{'tableName':_0x6d24('0xc'),'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 56b21cb..f172dfc 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 _0x8523=['TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','TeamVoiceQueue,\x20%s,\x20%s','debug'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x8523,0x65));var _0x3852=function(_0x260dcc,_0x5751ba){_0x260dcc=_0x260dcc-0x0;var _0x128153=_0x8523[_0x260dcc];return _0x128153;};'use strict';var _=require(_0x3852('0x0'));var util=require('util');var moment=require(_0x3852('0x1'));var BPromise=require(_0x3852('0x2'));var rs=require(_0x3852('0x3'));var fs=require('fs');var Redis=require(_0x3852('0x4'));var db=require(_0x3852('0x5'))['db'];var utils=require(_0x3852('0x6'));var logger=require(_0x3852('0x7'))(_0x3852('0x8'));var config=require(_0x3852('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3852('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5dc976,_0x33f676,_0x496d83){return new BPromise(function(_0x706265,_0x3a8868){return client[_0x3852('0xb')](_0x5dc976,_0x496d83)['then'](function(_0x3909d6){logger['info'](_0x3852('0xc'),_0x33f676,'request\x20sent');logger[_0x3852('0xd')](_0x3852('0xe'),_0x33f676,_0x3852('0xf'),JSON[_0x3852('0x10')](_0x3909d6));if(_0x3909d6[_0x3852('0x11')]){if(_0x3909d6[_0x3852('0x11')][_0x3852('0x12')]===0x1f4){logger[_0x3852('0x11')](_0x3852('0xc'),_0x33f676,_0x3909d6[_0x3852('0x11')][_0x3852('0x13')]);return _0x3a8868(_0x3909d6[_0x3852('0x11')][_0x3852('0x13')]);}logger[_0x3852('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0x33f676,_0x3909d6['error']['message']);return _0x706265(_0x3909d6['error'][_0x3852('0x13')]);}else{logger[_0x3852('0x14')](_0x3852('0xc'),_0x33f676,_0x3852('0xf'));_0x706265(_0x3909d6[_0x3852('0x15')]['message']);}})[_0x3852('0x16')](function(_0x4f9e9e){logger[_0x3852('0x11')](_0x3852('0xc'),_0x33f676,_0x4f9e9e);_0x3a8868(_0x4f9e9e);});});} \ No newline at end of file +var _0x6c96=['TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','TeamVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x363010,_0xf95154){var _0x3c3f56=function(_0xcaf55b){while(--_0xcaf55b){_0x363010['push'](_0x363010['shift']());}};_0x3c3f56(++_0xf95154);}(_0x6c96,0x1c1));var _0x66c9=function(_0x103759,_0x3809f6){_0x103759=_0x103759-0x0;var _0x2e6e8b=_0x6c96[_0x103759];return _0x2e6e8b;};'use strict';var _=require(_0x66c9('0x0'));var util=require('util');var moment=require(_0x66c9('0x1'));var BPromise=require(_0x66c9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x66c9('0x3'));var db=require(_0x66c9('0x4'))['db'];var utils=require(_0x66c9('0x5'));var logger=require(_0x66c9('0x6'))(_0x66c9('0x7'));var config=require(_0x66c9('0x8'));var jayson=require(_0x66c9('0x9'));var client=jayson['client'][_0x66c9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c6baa,_0xb03819,_0x4d7692){return new BPromise(function(_0x55b488,_0xfc41a4){return client[_0x66c9('0xb')](_0x4c6baa,_0x4d7692)[_0x66c9('0xc')](function(_0x2e8ad5){logger['info']('TeamVoiceQueue,\x20%s,\x20%s',_0xb03819,'request\x20sent');logger['debug'](_0x66c9('0xd'),_0xb03819,_0x66c9('0xe'),JSON[_0x66c9('0xf')](_0x2e8ad5));if(_0x2e8ad5['error']){if(_0x2e8ad5[_0x66c9('0x10')][_0x66c9('0x11')]===0x1f4){logger[_0x66c9('0x10')](_0x66c9('0x12'),_0xb03819,_0x2e8ad5['error'][_0x66c9('0x13')]);return _0xfc41a4(_0x2e8ad5['error'][_0x66c9('0x13')]);}logger[_0x66c9('0x10')](_0x66c9('0x12'),_0xb03819,_0x2e8ad5[_0x66c9('0x10')]['message']);return _0x55b488(_0x2e8ad5[_0x66c9('0x10')][_0x66c9('0x13')]);}else{logger['info'](_0x66c9('0x12'),_0xb03819,_0x66c9('0xe'));_0x55b488(_0x2e8ad5[_0x66c9('0x14')][_0x66c9('0x13')]);}})[_0x66c9('0x15')](function(_0x14d989){logger[_0x66c9('0x10')](_0x66c9('0x12'),_0xb03819,_0x14d989);_0xfc41a4(_0x14d989);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 2b9934b..72c36c7 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 _0xe3b3=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe3b3,0x1b3));var _0x3e3b=function(_0x4d87e7,_0x20d19b){_0x4d87e7=_0x4d87e7-0x0;var _0x5b2620=_0xe3b3[_0x4d87e7];return _0x5b2620;};'use strict';var multer=require(_0x3e3b('0x0'));var util=require(_0x3e3b('0x1'));var path=require(_0x3e3b('0x2'));var timeout=require(_0x3e3b('0x3'));var express=require(_0x3e3b('0x4'));var router=express[_0x3e3b('0x5')]();var fs_extra=require(_0x3e3b('0x6'));var auth=require(_0x3e3b('0x7'));var interaction=require(_0x3e3b('0x8'));var config=require(_0x3e3b('0x9'));var controller=require('./template.controller');router[_0x3e3b('0xa')]('/',auth[_0x3e3b('0xb')](),controller[_0x3e3b('0xc')]);router['get'](_0x3e3b('0xd'),auth[_0x3e3b('0xb')](),controller[_0x3e3b('0xe')]);router[_0x3e3b('0xf')]('/',auth[_0x3e3b('0xb')](),controller[_0x3e3b('0x10')]);router[_0x3e3b('0x11')](_0x3e3b('0xd'),auth[_0x3e3b('0xb')](),controller['update']);router[_0x3e3b('0x12')]('/:id',auth[_0x3e3b('0xb')](),controller[_0x3e3b('0x13')]);module[_0x3e3b('0x14')]=router; \ No newline at end of file +var _0xd945=['./template.controller','get','isAuthenticated','index','show','post','create','put','/:id','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4c953b,_0x2f79a3){var _0x5e5a47=function(_0x2fd896){while(--_0x2fd896){_0x4c953b['push'](_0x4c953b['shift']());}};_0x5e5a47(++_0x2f79a3);}(_0xd945,0x84));var _0x5d94=function(_0x8c732d,_0x4ee1ff){_0x8c732d=_0x8c732d-0x0;var _0x42d329=_0xd945[_0x8c732d];return _0x42d329;};'use strict';var multer=require(_0x5d94('0x0'));var util=require(_0x5d94('0x1'));var path=require(_0x5d94('0x2'));var timeout=require('connect-timeout');var express=require(_0x5d94('0x3'));var router=express[_0x5d94('0x4')]();var fs_extra=require(_0x5d94('0x5'));var auth=require(_0x5d94('0x6'));var interaction=require(_0x5d94('0x7'));var config=require('../../config/environment');var controller=require(_0x5d94('0x8'));router[_0x5d94('0x9')]('/',auth[_0x5d94('0xa')](),controller[_0x5d94('0xb')]);router[_0x5d94('0x9')]('/:id',auth[_0x5d94('0xa')](),controller[_0x5d94('0xc')]);router[_0x5d94('0xd')]('/',auth['isAuthenticated'](),controller[_0x5d94('0xe')]);router[_0x5d94('0xf')](_0x5d94('0x10'),auth[_0x5d94('0xa')](),controller['update']);router[_0x5d94('0x11')]('/:id',auth[_0x5d94('0xa')](),controller[_0x5d94('0x12')]);module[_0x5d94('0x13')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 95c2e38..50b1df9 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 _0xebdf=['exports','STRING','sequelize'];(function(_0x161f93,_0x202cf4){var _0x167a86=function(_0x23cdc8){while(--_0x23cdc8){_0x161f93['push'](_0x161f93['shift']());}};_0x167a86(++_0x202cf4);}(_0xebdf,0xb0));var _0xfebd=function(_0x12b683,_0x124186){_0x12b683=_0x12b683-0x0;var _0xfb150b=_0xebdf[_0x12b683];return _0xfb150b;};'use strict';var Sequelize=require(_0xfebd('0x0'));module[_0xfebd('0x1')]={'name':{'type':Sequelize[_0xfebd('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x305e=['sequelize','exports','STRING','TEXT'];(function(_0x36587e,_0x41f945){var _0x2b83a5=function(_0x2f9240){while(--_0x2f9240){_0x36587e['push'](_0x36587e['shift']());}};_0x2b83a5(++_0x41f945);}(_0x305e,0x164));var _0xe305=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x305e[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0xe305('0x0'));module[_0xe305('0x1')]={'name':{'type':Sequelize[_0xe305('0x2')]},'description':{'type':Sequelize[_0xe305('0x2')]},'html':{'type':Sequelize[_0xe305('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 576ad49..11eed07 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 _0x5674=['index','Template','rawAttributes','fieldName','type','map','keys','filters','intersection','model','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','merge','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','request-promise','moment','bluebird','util','path','sox','to-csv','squel','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','set','apply','reject','save','update','then','destroy','get','Templates','end','error','stack','name','send'];(function(_0x13a034,_0x145c70){var _0x2426fc=function(_0x342767){while(--_0x342767){_0x13a034['push'](_0x13a034['shift']());}};_0x2426fc(++_0x145c70);}(_0x5674,0x76));var _0x4567=function(_0x427d03,_0x4356af){_0x427d03=_0x427d03-0x0;var _0x15a668=_0x5674[_0x427d03];return _0x15a668;};'use strict';var emlformat=require(_0x4567('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4567('0x1'));var moment=require(_0x4567('0x2'));var BPromise=require(_0x4567('0x3'));var Mustache=require('mustache');var util=require(_0x4567('0x4'));var path=require(_0x4567('0x5'));var sox=require(_0x4567('0x6'));var csv=require(_0x4567('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4567('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4567('0x7'));var querystring=require('querystring');var Papa=require(_0x4567('0x9'));var Redis=require(_0x4567('0xa'));var authService=require(_0x4567('0xb'));var qs=require(_0x4567('0xc'));var as=require(_0x4567('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4567('0xe'))['db'];function respondWithStatusCode(_0xf7803e,_0x4132db){_0x4132db=_0x4132db||0xcc;return function(_0x2eea5e){if(_0x2eea5e){return _0xf7803e[_0x4567('0xf')](_0x4132db);}return _0xf7803e[_0x4567('0x10')](_0x4132db)['end']();};}function respondWithResult(_0x387877,_0x2ff481){_0x2ff481=_0x2ff481||0xc8;return function(_0x4ba901){if(_0x4ba901){return _0x387877[_0x4567('0x10')](_0x2ff481)[_0x4567('0x11')](_0x4ba901);}};}function respondWithFilteredResult(_0x4d8db0,_0x41733e){return function(_0x4af573){if(_0x4af573){var _0x5bd773=typeof _0x41733e['offset']===_0x4567('0x12')&&typeof _0x41733e[_0x4567('0x13')]===_0x4567('0x12');var _0x139b60=_0x4af573['count'];var _0x590c6e=_0x5bd773?0x0:_0x41733e[_0x4567('0x14')];var _0x1711ae=_0x5bd773?_0x4af573[_0x4567('0x15')]:_0x41733e[_0x4567('0x14')]+_0x41733e[_0x4567('0x13')];var _0xbea086;if(_0x1711ae>=_0x139b60){_0x1711ae=_0x139b60;_0xbea086=0xc8;}else{_0xbea086=0xce;}_0x4d8db0[_0x4567('0x10')](_0xbea086);return _0x4d8db0[_0x4567('0x16')]('Content-Range',_0x590c6e+'-'+_0x1711ae+'/'+_0x139b60)[_0x4567('0x11')](_0x4af573);}return null;};}function patchUpdates(_0x4de4ee){return function(_0x4798a9){try{jsonpatch[_0x4567('0x17')](_0x4798a9,_0x4de4ee,!![]);}catch(_0x3e462b){return BPromise[_0x4567('0x18')](_0x3e462b);}return _0x4798a9[_0x4567('0x19')]();};}function saveUpdates(_0x2845cb,_0x2fd2cd){return function(_0x214fd5){if(_0x214fd5){return _0x214fd5[_0x4567('0x1a')](_0x2845cb)[_0x4567('0x1b')](function(_0x3402cc){return _0x3402cc;});}return null;};}function removeEntity(_0x3cc045,_0x318bc3){return function(_0x5a3ec3){if(_0x5a3ec3){return _0x5a3ec3[_0x4567('0x1c')]()['then'](function(){var _0x5524e7=_0x5a3ec3[_0x4567('0x1d')]({'plain':!![]});var _0x531aea=_0x4567('0x1e');return db['UserProfileResource'][_0x4567('0x1c')]({'where':{'type':_0x531aea,'resourceId':_0x5524e7['id']}})['then'](function(){return _0x5a3ec3;});})['then'](function(){_0x3cc045[_0x4567('0x10')](0xcc)[_0x4567('0x1f')]();});}};}function handleEntityNotFound(_0x56c9b6,_0x126c1a){return function(_0x15ff7b){if(!_0x15ff7b){_0x56c9b6['sendStatus'](0x194);}return _0x15ff7b;};}function handleError(_0x6948,_0x2c9146){_0x2c9146=_0x2c9146||0x1f4;return function(_0x3d9289){logger[_0x4567('0x20')](_0x3d9289[_0x4567('0x21')]);if(_0x3d9289['name']){delete _0x3d9289[_0x4567('0x22')];}_0x6948[_0x4567('0x10')](_0x2c9146)[_0x4567('0x23')](_0x3d9289);};}exports[_0x4567('0x24')]=function(_0x4068e3,_0x5411b6){var _0x32fbbc={},_0x5a0380={},_0x21af6f={'count':0x0,'rows':[]};var _0x417acc=_['map'](db[_0x4567('0x25')][_0x4567('0x26')],function(_0x1ccee3){return{'name':_0x1ccee3[_0x4567('0x27')],'type':_0x1ccee3[_0x4567('0x28')]['key']};});_0x5a0380['model']=_[_0x4567('0x29')](_0x417acc,_0x4567('0x22'));_0x5a0380['query']=_[_0x4567('0x2a')](_0x4068e3['query']);_0x5a0380[_0x4567('0x2b')]=_[_0x4567('0x2c')](_0x5a0380[_0x4567('0x2d')],_0x5a0380['query']);_0x32fbbc[_0x4567('0x2e')]=_[_0x4567('0x2c')](_0x5a0380[_0x4567('0x2d')],qs[_0x4567('0x2f')](_0x4068e3[_0x4567('0x30')][_0x4567('0x2f')]));_0x32fbbc[_0x4567('0x2e')]=_0x32fbbc[_0x4567('0x2e')][_0x4567('0x31')]?_0x32fbbc[_0x4567('0x2e')]:_0x5a0380[_0x4567('0x2d')];if(!_0x4068e3[_0x4567('0x30')][_0x4567('0x32')](_0x4567('0x33'))){_0x32fbbc['limit']=qs['limit'](_0x4068e3[_0x4567('0x30')][_0x4567('0x13')]);_0x32fbbc[_0x4567('0x14')]=qs[_0x4567('0x14')](_0x4068e3[_0x4567('0x30')][_0x4567('0x14')]);}_0x32fbbc[_0x4567('0x34')]=qs[_0x4567('0x35')](_0x4068e3[_0x4567('0x30')][_0x4567('0x35')]);_0x32fbbc[_0x4567('0x36')]=qs[_0x4567('0x2b')](_[_0x4567('0x37')](_0x4068e3[_0x4567('0x30')],_0x5a0380['filters']),_0x417acc);if(_0x4068e3[_0x4567('0x30')][_0x4567('0x38')]){_0x32fbbc[_0x4567('0x36')]=_['merge'](_0x32fbbc['where'],{'$or':_[_0x4567('0x29')](_0x417acc,function(_0x47de55){if(_0x47de55['type']!==_0x4567('0x39')){var _0x5485a9={};_0x5485a9[_0x47de55[_0x4567('0x22')]]={'$like':'%'+_0x4068e3[_0x4567('0x30')][_0x4567('0x38')]+'%'};return _0x5485a9;}})});}_0x32fbbc=_['merge']({},_0x32fbbc,_0x4068e3[_0x4567('0x3a')]);var _0x4c8476={'where':_0x32fbbc['where']};return db[_0x4567('0x25')]['count'](_0x4c8476)[_0x4567('0x1b')](function(_0xef35da){_0x21af6f[_0x4567('0x15')]=_0xef35da;if(_0x4068e3[_0x4567('0x30')][_0x4567('0x3b')]){_0x32fbbc[_0x4567('0x3c')]=[{'all':!![]}];}return db[_0x4567('0x25')][_0x4567('0x3d')](_0x32fbbc);})[_0x4567('0x1b')](function(_0x5a0450){_0x21af6f[_0x4567('0x3e')]=_0x5a0450;return _0x21af6f;})[_0x4567('0x1b')](respondWithFilteredResult(_0x5411b6,_0x32fbbc))[_0x4567('0x3f')](handleError(_0x5411b6,null));};exports[_0x4567('0x40')]=function(_0x2ff057,_0x101264){var _0x5729f1={'raw':!![],'where':{'id':_0x2ff057['params']['id']}},_0x3f6e4b={};_0x3f6e4b[_0x4567('0x2d')]=_[_0x4567('0x2a')](db['Template']['rawAttributes']);_0x3f6e4b[_0x4567('0x30')]=_[_0x4567('0x2a')](_0x2ff057['query']);_0x3f6e4b[_0x4567('0x2b')]=_[_0x4567('0x2c')](_0x3f6e4b[_0x4567('0x2d')],_0x3f6e4b['query']);_0x5729f1[_0x4567('0x2e')]=_['intersection'](_0x3f6e4b[_0x4567('0x2d')],qs[_0x4567('0x2f')](_0x2ff057[_0x4567('0x30')]['fields']));_0x5729f1[_0x4567('0x2e')]=_0x5729f1['attributes']['length']?_0x5729f1[_0x4567('0x2e')]:_0x3f6e4b[_0x4567('0x2d')];if(_0x2ff057[_0x4567('0x30')]['includeAll']){_0x5729f1[_0x4567('0x3c')]=[{'all':!![]}];}_0x5729f1=_[_0x4567('0x41')]({},_0x5729f1,_0x2ff057[_0x4567('0x3a')]);return db[_0x4567('0x25')]['find'](_0x5729f1)['then'](handleEntityNotFound(_0x101264,null))[_0x4567('0x1b')](respondWithResult(_0x101264,null))[_0x4567('0x3f')](handleError(_0x101264,null));};exports['create']=function(_0x38069d,_0x38d4b2){return db[_0x4567('0x25')][_0x4567('0x42')](_0x38069d[_0x4567('0x43')],{})[_0x4567('0x1b')](function(_0xbf01c3){var _0x4427b2=_0x38069d[_0x4567('0x44')]['get']({'plain':!![]});if(!_0x4427b2)throw new Error(_0x4567('0x45'));if(_0x4427b2[_0x4567('0x46')]===_0x4567('0x44')){var _0x46872e=_0xbf01c3[_0x4567('0x1d')]({'plain':!![]});var _0x1b5087=_0x4567('0x1e');return db[_0x4567('0x47')][_0x4567('0x48')]({'where':{'name':_0x1b5087,'userProfileId':_0x4427b2[_0x4567('0x49')]},'raw':!![]})[_0x4567('0x1b')](function(_0xd997d){if(_0xd997d&&_0xd997d['autoAssociation']===0x0){return db[_0x4567('0x4a')][_0x4567('0x42')]({'name':_0x46872e[_0x4567('0x22')],'resourceId':_0x46872e['id'],'type':_0xd997d[_0x4567('0x22')],'sectionId':_0xd997d['id']},{})[_0x4567('0x1b')](function(){return _0xbf01c3;});}else{return _0xbf01c3;}})[_0x4567('0x3f')](function(_0x44cb29){logger[_0x4567('0x20')](_0x4567('0x4b'),_0x44cb29);throw _0x44cb29;});}return _0xbf01c3;})[_0x4567('0x1b')](respondWithResult(_0x38d4b2,0xc9))[_0x4567('0x3f')](handleError(_0x38d4b2,null));};exports[_0x4567('0x1a')]=function(_0x5e1991,_0x3cf2ee){if(_0x5e1991[_0x4567('0x43')]['id']){delete _0x5e1991[_0x4567('0x43')]['id'];}return db['Template']['find']({'where':{'id':_0x5e1991[_0x4567('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3cf2ee,null))[_0x4567('0x1b')](saveUpdates(_0x5e1991[_0x4567('0x43')],null))[_0x4567('0x1b')](respondWithResult(_0x3cf2ee,null))[_0x4567('0x3f')](handleError(_0x3cf2ee,null));};exports['destroy']=function(_0x270929,_0x35ee1a){return db[_0x4567('0x25')][_0x4567('0x48')]({'where':{'id':_0x270929['params']['id']}})[_0x4567('0x1b')](handleEntityNotFound(_0x35ee1a,null))[_0x4567('0x1b')](removeEntity(_0x35ee1a,null))[_0x4567('0x3f')](handleError(_0x35ee1a,null));}; \ No newline at end of file +var _0x8e0c=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','Templates','UserProfileResource','end','stack','index','Template','rawAttributes','fieldName','type','key','model','map','name','query','keys','filters','attributes','intersection','length','hasOwnProperty','order','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','fields','create','body','user','role','UserProfileSection','find','autoAssociation','error','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x4fbb15,_0x21be0c){var _0x436338=function(_0x3b5a05){while(--_0x3b5a05){_0x4fbb15['push'](_0x4fbb15['shift']());}};_0x436338(++_0x21be0c);}(_0x8e0c,0x127));var _0xc8e0=function(_0x4b72d4,_0x1a3cfa){_0x4b72d4=_0x4b72d4-0x0;var _0x2435d2=_0x8e0c[_0x4b72d4];return _0x2435d2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc8e0('0x0'));var rp=require(_0xc8e0('0x1'));var moment=require(_0xc8e0('0x2'));var BPromise=require(_0xc8e0('0x3'));var Mustache=require(_0xc8e0('0x4'));var util=require(_0xc8e0('0x5'));var path=require(_0xc8e0('0x6'));var sox=require(_0xc8e0('0x7'));var csv=require(_0xc8e0('0x8'));var ejs=require(_0xc8e0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc8e0('0xa'));var crypto=require(_0xc8e0('0xb'));var jsforce=require(_0xc8e0('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc8e0('0x8'));var querystring=require('querystring');var Papa=require(_0xc8e0('0xd'));var Redis=require(_0xc8e0('0xe'));var authService=require(_0xc8e0('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xc8e0('0x10'));var hardwareService=require(_0xc8e0('0x11'));var logger=require(_0xc8e0('0x12'))(_0xc8e0('0x13'));var utils=require(_0xc8e0('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xc8e0('0x15'));var db=require(_0xc8e0('0x16'))['db'];function respondWithStatusCode(_0x37ce06,_0x935a61){_0x935a61=_0x935a61||0xcc;return function(_0x1bfc24){if(_0x1bfc24){return _0x37ce06[_0xc8e0('0x17')](_0x935a61);}return _0x37ce06[_0xc8e0('0x18')](_0x935a61)['end']();};}function respondWithResult(_0x1376e0,_0x6314cd){_0x6314cd=_0x6314cd||0xc8;return function(_0x56991d){if(_0x56991d){return _0x1376e0[_0xc8e0('0x18')](_0x6314cd)[_0xc8e0('0x19')](_0x56991d);}};}function respondWithFilteredResult(_0x1a7956,_0x5c1192){return function(_0x1d0eff){if(_0x1d0eff){var _0x6e6f94=typeof _0x5c1192[_0xc8e0('0x1a')]===_0xc8e0('0x1b')&&typeof _0x5c1192[_0xc8e0('0x1c')]===_0xc8e0('0x1b');var _0x268605=_0x1d0eff[_0xc8e0('0x1d')];var _0x189132=_0x6e6f94?0x0:_0x5c1192['offset'];var _0x5b136c=_0x6e6f94?_0x1d0eff[_0xc8e0('0x1d')]:_0x5c1192[_0xc8e0('0x1a')]+_0x5c1192[_0xc8e0('0x1c')];var _0x361fe7;if(_0x5b136c>=_0x268605){_0x5b136c=_0x268605;_0x361fe7=0xc8;}else{_0x361fe7=0xce;}_0x1a7956[_0xc8e0('0x18')](_0x361fe7);return _0x1a7956[_0xc8e0('0x1e')](_0xc8e0('0x1f'),_0x189132+'-'+_0x5b136c+'/'+_0x268605)[_0xc8e0('0x19')](_0x1d0eff);}return null;};}function patchUpdates(_0xcc7f56){return function(_0x472ec8){try{jsonpatch[_0xc8e0('0x20')](_0x472ec8,_0xcc7f56,!![]);}catch(_0x57fe3c){return BPromise['reject'](_0x57fe3c);}return _0x472ec8['save']();};}function saveUpdates(_0x2f658c,_0x10dd18){return function(_0x266635){if(_0x266635){return _0x266635[_0xc8e0('0x21')](_0x2f658c)[_0xc8e0('0x22')](function(_0x4c3622){return _0x4c3622;});}return null;};}function removeEntity(_0x28a52b,_0x2118fa){return function(_0x24006b){if(_0x24006b){return _0x24006b[_0xc8e0('0x23')]()[_0xc8e0('0x22')](function(){var _0x262df0=_0x24006b[_0xc8e0('0x24')]({'plain':!![]});var _0x1da428=_0xc8e0('0x25');return db[_0xc8e0('0x26')]['destroy']({'where':{'type':_0x1da428,'resourceId':_0x262df0['id']}})['then'](function(){return _0x24006b;});})[_0xc8e0('0x22')](function(){_0x28a52b[_0xc8e0('0x18')](0xcc)[_0xc8e0('0x27')]();});}};}function handleEntityNotFound(_0x36ecef,_0x3add86){return function(_0x1b4758){if(!_0x1b4758){_0x36ecef['sendStatus'](0x194);}return _0x1b4758;};}function handleError(_0x21ee23,_0x2748ff){_0x2748ff=_0x2748ff||0x1f4;return function(_0x449b17){logger['error'](_0x449b17[_0xc8e0('0x28')]);if(_0x449b17['name']){delete _0x449b17['name'];}_0x21ee23['status'](_0x2748ff)['send'](_0x449b17);};}exports[_0xc8e0('0x29')]=function(_0x1108bc,_0x49d87d){var _0x5749e6={},_0xd14c97={},_0x3dcb04={'count':0x0,'rows':[]};var _0x4b621f=_['map'](db[_0xc8e0('0x2a')][_0xc8e0('0x2b')],function(_0x4f803f){return{'name':_0x4f803f[_0xc8e0('0x2c')],'type':_0x4f803f[_0xc8e0('0x2d')][_0xc8e0('0x2e')]};});_0xd14c97[_0xc8e0('0x2f')]=_[_0xc8e0('0x30')](_0x4b621f,_0xc8e0('0x31'));_0xd14c97[_0xc8e0('0x32')]=_[_0xc8e0('0x33')](_0x1108bc[_0xc8e0('0x32')]);_0xd14c97[_0xc8e0('0x34')]=_['intersection'](_0xd14c97[_0xc8e0('0x2f')],_0xd14c97[_0xc8e0('0x32')]);_0x5749e6[_0xc8e0('0x35')]=_[_0xc8e0('0x36')](_0xd14c97[_0xc8e0('0x2f')],qs['fields'](_0x1108bc[_0xc8e0('0x32')]['fields']));_0x5749e6['attributes']=_0x5749e6[_0xc8e0('0x35')][_0xc8e0('0x37')]?_0x5749e6[_0xc8e0('0x35')]:_0xd14c97[_0xc8e0('0x2f')];if(!_0x1108bc[_0xc8e0('0x32')][_0xc8e0('0x38')]('nolimit')){_0x5749e6['limit']=qs[_0xc8e0('0x1c')](_0x1108bc[_0xc8e0('0x32')][_0xc8e0('0x1c')]);_0x5749e6[_0xc8e0('0x1a')]=qs[_0xc8e0('0x1a')](_0x1108bc[_0xc8e0('0x32')][_0xc8e0('0x1a')]);}_0x5749e6[_0xc8e0('0x39')]=qs['sort'](_0x1108bc[_0xc8e0('0x32')]['sort']);_0x5749e6[_0xc8e0('0x3a')]=qs[_0xc8e0('0x34')](_['pick'](_0x1108bc[_0xc8e0('0x32')],_0xd14c97[_0xc8e0('0x34')]),_0x4b621f);if(_0x1108bc[_0xc8e0('0x32')][_0xc8e0('0x3b')]){_0x5749e6[_0xc8e0('0x3a')]=_[_0xc8e0('0x3c')](_0x5749e6['where'],{'$or':_[_0xc8e0('0x30')](_0x4b621f,function(_0x3f470e){if(_0x3f470e['type']!=='VIRTUAL'){var _0x45e79f={};_0x45e79f[_0x3f470e[_0xc8e0('0x31')]]={'$like':'%'+_0x1108bc[_0xc8e0('0x32')]['filter']+'%'};return _0x45e79f;}})});}_0x5749e6=_[_0xc8e0('0x3c')]({},_0x5749e6,_0x1108bc[_0xc8e0('0x3d')]);var _0x599bb2={'where':_0x5749e6[_0xc8e0('0x3a')]};return db[_0xc8e0('0x2a')][_0xc8e0('0x1d')](_0x599bb2)[_0xc8e0('0x22')](function(_0x21f4fa){_0x3dcb04[_0xc8e0('0x1d')]=_0x21f4fa;if(_0x1108bc[_0xc8e0('0x32')][_0xc8e0('0x3e')]){_0x5749e6[_0xc8e0('0x3f')]=[{'all':!![]}];}return db['Template'][_0xc8e0('0x40')](_0x5749e6);})[_0xc8e0('0x22')](function(_0x202d88){_0x3dcb04[_0xc8e0('0x41')]=_0x202d88;return _0x3dcb04;})['then'](respondWithFilteredResult(_0x49d87d,_0x5749e6))[_0xc8e0('0x42')](handleError(_0x49d87d,null));};exports[_0xc8e0('0x43')]=function(_0x580e8b,_0x504c3a){var _0x1a98c1={'raw':!![],'where':{'id':_0x580e8b[_0xc8e0('0x44')]['id']}},_0x14e27a={};_0x14e27a[_0xc8e0('0x2f')]=_[_0xc8e0('0x33')](db[_0xc8e0('0x2a')]['rawAttributes']);_0x14e27a[_0xc8e0('0x32')]=_[_0xc8e0('0x33')](_0x580e8b[_0xc8e0('0x32')]);_0x14e27a[_0xc8e0('0x34')]=_[_0xc8e0('0x36')](_0x14e27a[_0xc8e0('0x2f')],_0x14e27a[_0xc8e0('0x32')]);_0x1a98c1[_0xc8e0('0x35')]=_[_0xc8e0('0x36')](_0x14e27a['model'],qs[_0xc8e0('0x45')](_0x580e8b[_0xc8e0('0x32')]['fields']));_0x1a98c1[_0xc8e0('0x35')]=_0x1a98c1[_0xc8e0('0x35')]['length']?_0x1a98c1[_0xc8e0('0x35')]:_0x14e27a['model'];if(_0x580e8b['query'][_0xc8e0('0x3e')]){_0x1a98c1['include']=[{'all':!![]}];}_0x1a98c1=_['merge']({},_0x1a98c1,_0x580e8b[_0xc8e0('0x3d')]);return db['Template']['find'](_0x1a98c1)[_0xc8e0('0x22')](handleEntityNotFound(_0x504c3a,null))['then'](respondWithResult(_0x504c3a,null))['catch'](handleError(_0x504c3a,null));};exports[_0xc8e0('0x46')]=function(_0x5429ff,_0x42f882){return db[_0xc8e0('0x2a')]['create'](_0x5429ff[_0xc8e0('0x47')],{})[_0xc8e0('0x22')](function(_0x21e80a){var _0x3e2201=_0x5429ff[_0xc8e0('0x48')]['get']({'plain':!![]});if(!_0x3e2201)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e2201[_0xc8e0('0x49')]===_0xc8e0('0x48')){var _0x27c7b3=_0x21e80a[_0xc8e0('0x24')]({'plain':!![]});var _0x188eba=_0xc8e0('0x25');return db[_0xc8e0('0x4a')][_0xc8e0('0x4b')]({'where':{'name':_0x188eba,'userProfileId':_0x3e2201['userProfileId']},'raw':!![]})[_0xc8e0('0x22')](function(_0x218ff1){if(_0x218ff1&&_0x218ff1[_0xc8e0('0x4c')]===0x0){return db[_0xc8e0('0x26')]['create']({'name':_0x27c7b3[_0xc8e0('0x31')],'resourceId':_0x27c7b3['id'],'type':_0x218ff1[_0xc8e0('0x31')],'sectionId':_0x218ff1['id']},{})[_0xc8e0('0x22')](function(){return _0x21e80a;});}else{return _0x21e80a;}})[_0xc8e0('0x42')](function(_0x3990e1){logger[_0xc8e0('0x4d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3990e1);throw _0x3990e1;});}return _0x21e80a;})[_0xc8e0('0x22')](respondWithResult(_0x42f882,0xc9))[_0xc8e0('0x42')](handleError(_0x42f882,null));};exports['update']=function(_0x21033d,_0xa2e2a2){if(_0x21033d[_0xc8e0('0x47')]['id']){delete _0x21033d['body']['id'];}return db[_0xc8e0('0x2a')][_0xc8e0('0x4b')]({'where':{'id':_0x21033d[_0xc8e0('0x44')]['id']}})['then'](handleEntityNotFound(_0xa2e2a2,null))[_0xc8e0('0x22')](saveUpdates(_0x21033d[_0xc8e0('0x47')],null))['then'](respondWithResult(_0xa2e2a2,null))['catch'](handleError(_0xa2e2a2,null));};exports[_0xc8e0('0x23')]=function(_0x2acda4,_0x1b29a7){return db[_0xc8e0('0x2a')][_0xc8e0('0x4b')]({'where':{'id':_0x2acda4[_0xc8e0('0x44')]['id']}})[_0xc8e0('0x22')](handleEntityNotFound(_0x1b29a7,null))['then'](removeEntity(_0x1b29a7,null))[_0xc8e0('0x42')](handleError(_0x1b29a7,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index cda05a8..db9542b 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 _0xda0c=['request-promise','rimraf','../../config/environment','exports','Template','tools_templates','lodash','util','../../config/logger','moment','bluebird'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xda0c,0x1b3));var _0xcda0=function(_0x5e9422,_0x310964){_0x5e9422=_0x5e9422-0x0;var _0x5cecd0=_0xda0c[_0x5e9422];return _0x5cecd0;};'use strict';var _=require(_0xcda0('0x0'));var util=require(_0xcda0('0x1'));var logger=require(_0xcda0('0x2'))('api');var moment=require(_0xcda0('0x3'));var BPromise=require(_0xcda0('0x4'));var rp=require(_0xcda0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcda0('0x6'));var config=require(_0xcda0('0x7'));var attributes=require('./template.attributes');module[_0xcda0('0x8')]=function(_0x18100b,_0xd4a6b9){return _0x18100b['define'](_0xcda0('0x9'),attributes,{'tableName':_0xcda0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x474d=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./template.attributes','define','tools_templates','lodash','util'];(function(_0x576710,_0x2766d0){var _0x792aaa=function(_0x533a38){while(--_0x533a38){_0x576710['push'](_0x576710['shift']());}};_0x792aaa(++_0x2766d0);}(_0x474d,0x73));var _0xd474=function(_0x1dca3a,_0x52403b){_0x1dca3a=_0x1dca3a-0x0;var _0x197d3a=_0x474d[_0x1dca3a];return _0x197d3a;};'use strict';var _=require(_0xd474('0x0'));var util=require(_0xd474('0x1'));var logger=require(_0xd474('0x2'))(_0xd474('0x3'));var moment=require(_0xd474('0x4'));var BPromise=require(_0xd474('0x5'));var rp=require(_0xd474('0x6'));var fs=require('fs');var path=require(_0xd474('0x7'));var rimraf=require(_0xd474('0x8'));var config=require(_0xd474('0x9'));var attributes=require(_0xd474('0xa'));module['exports']=function(_0xa119fe,_0x3779e0){return _0xa119fe[_0xd474('0xb')]('Template',attributes,{'tableName':_0xd474('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 58eca5d..42c2322 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 _0x36e1=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','Template','findAll','options','raw','where','attributes','limit','include','map','model','GetTemplate','lodash','util','moment','randomstring','ioredis'];(function(_0x232016,_0x47c778){var _0x148753=function(_0x4201d9){while(--_0x4201d9){_0x232016['push'](_0x232016['shift']());}};_0x148753(++_0x47c778);}(_0x36e1,0x187));var _0x136e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0x36e1[_0x9aada2];return _0x196dff;};'use strict';var _=require(_0x136e('0x0'));var util=require(_0x136e('0x1'));var moment=require(_0x136e('0x2'));var BPromise=require('bluebird');var rs=require(_0x136e('0x3'));var fs=require('fs');var Redis=require(_0x136e('0x4'));var db=require(_0x136e('0x5'))['db'];var utils=require(_0x136e('0x6'));var logger=require(_0x136e('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x136e('0x8'));var client=jayson[_0x136e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x46110e,_0x33de75,_0x3b241f){return new BPromise(function(_0x15ec52,_0x233640){return client[_0x136e('0xa')](_0x46110e,_0x3b241f)[_0x136e('0xb')](function(_0x50e26f){logger[_0x136e('0xc')](_0x136e('0xd'),_0x33de75,'request\x20sent');logger[_0x136e('0xe')](_0x136e('0xf'),_0x33de75,'request\x20sent',JSON[_0x136e('0x10')](_0x50e26f));if(_0x50e26f[_0x136e('0x11')]){if(_0x50e26f[_0x136e('0x11')]['code']===0x1f4){logger[_0x136e('0x11')](_0x136e('0xd'),_0x33de75,_0x50e26f[_0x136e('0x11')][_0x136e('0x12')]);return _0x233640(_0x50e26f[_0x136e('0x11')][_0x136e('0x12')]);}logger[_0x136e('0x11')]('Template,\x20%s,\x20%s',_0x33de75,_0x50e26f[_0x136e('0x11')][_0x136e('0x12')]);return _0x15ec52(_0x50e26f[_0x136e('0x11')]['message']);}else{logger[_0x136e('0xc')](_0x136e('0xd'),_0x33de75,_0x136e('0x13'));_0x15ec52(_0x50e26f[_0x136e('0x14')][_0x136e('0x12')]);}})[_0x136e('0x15')](function(_0x1c0b1f){logger[_0x136e('0x11')](_0x136e('0xd'),_0x33de75,_0x1c0b1f);_0x233640(_0x1c0b1f);});});}exports['GetTemplate']=function(_0x1afa8e){var _0x5d3b40=this;return new Promise(function(_0x4682ca,_0x43fe32){return db[_0x136e('0x16')][_0x136e('0x17')]({'raw':_0x1afa8e[_0x136e('0x18')]?_0x1afa8e[_0x136e('0x18')][_0x136e('0x19')]===undefined?!![]:![]:!![],'where':_0x1afa8e[_0x136e('0x18')]?_0x1afa8e[_0x136e('0x18')][_0x136e('0x1a')]||null:null,'attributes':_0x1afa8e[_0x136e('0x18')]?_0x1afa8e[_0x136e('0x18')][_0x136e('0x1b')]||null:null,'limit':_0x1afa8e['options']?_0x1afa8e[_0x136e('0x18')][_0x136e('0x1c')]||null:null,'include':_0x1afa8e['options']?_0x1afa8e[_0x136e('0x18')][_0x136e('0x1d')]?_[_0x136e('0x1e')](_0x1afa8e[_0x136e('0x18')][_0x136e('0x1d')],function(_0x4f0f0a){return{'model':db[_0x4f0f0a[_0x136e('0x1f')]],'as':_0x4f0f0a['as'],'attributes':_0x4f0f0a['attributes'],'include':_0x4f0f0a['include']?_[_0x136e('0x1e')](_0x4f0f0a[_0x136e('0x1d')],function(_0x487b73){return{'model':db[_0x487b73[_0x136e('0x1f')]],'as':_0x487b73['as'],'attributes':_0x487b73[_0x136e('0x1b')],'include':_0x487b73['include']?_[_0x136e('0x1e')](_0x487b73[_0x136e('0x1d')],function(_0x6f97d3){return{'model':db[_0x6f97d3[_0x136e('0x1f')]],'as':_0x6f97d3['as'],'attributes':_0x6f97d3[_0x136e('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x136e('0xb')](function(_0x519168){logger[_0x136e('0xc')](_0x136e('0x20'),_0x1afa8e);logger[_0x136e('0xe')]('GetTemplate',_0x1afa8e,JSON['stringify'](_0x519168));_0x4682ca(_0x519168);})['catch'](function(_0x1583c5){logger['error']('GetTemplate',_0x1583c5[_0x136e('0x12')],_0x1afa8e);_0x43fe32(_0x5d3b40[_0x136e('0x11')](0x1f4,_0x1583c5[_0x136e('0x12')]));});});}; \ No newline at end of file +var _0x0382=['../../config/environment','jayson/promise','client','http','request','then','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTemplate','Template','findAll','options','attributes','limit','map','include','model','info','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x348c95,_0x1bf9d7){var _0x39b698=function(_0x49b024){while(--_0x49b024){_0x348c95['push'](_0x348c95['shift']());}};_0x39b698(++_0x1bf9d7);}(_0x0382,0x14c));var _0x2038=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0x0382[_0x32b542];return _0x554d54;};'use strict';var _=require(_0x2038('0x0'));var util=require(_0x2038('0x1'));var moment=require(_0x2038('0x2'));var BPromise=require(_0x2038('0x3'));var rs=require(_0x2038('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2038('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2038('0x6'))(_0x2038('0x7'));var config=require(_0x2038('0x8'));var jayson=require(_0x2038('0x9'));var client=jayson[_0x2038('0xa')][_0x2038('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x23b157,_0x346936,_0xd8562){return new BPromise(function(_0x2570ba,_0xed614c){return client[_0x2038('0xc')](_0x23b157,_0xd8562)[_0x2038('0xd')](function(_0x2f73f6){logger['info'](_0x2038('0xe'),_0x346936,_0x2038('0xf'));logger[_0x2038('0x10')](_0x2038('0x11'),_0x346936,_0x2038('0xf'),JSON[_0x2038('0x12')](_0x2f73f6));if(_0x2f73f6['error']){if(_0x2f73f6[_0x2038('0x13')][_0x2038('0x14')]===0x1f4){logger[_0x2038('0x13')](_0x2038('0xe'),_0x346936,_0x2f73f6['error']['message']);return _0xed614c(_0x2f73f6[_0x2038('0x13')][_0x2038('0x15')]);}logger['error'](_0x2038('0xe'),_0x346936,_0x2f73f6[_0x2038('0x13')]['message']);return _0x2570ba(_0x2f73f6[_0x2038('0x13')][_0x2038('0x15')]);}else{logger['info'](_0x2038('0xe'),_0x346936,_0x2038('0xf'));_0x2570ba(_0x2f73f6[_0x2038('0x16')][_0x2038('0x15')]);}})[_0x2038('0x17')](function(_0x295ce9){logger[_0x2038('0x13')](_0x2038('0xe'),_0x346936,_0x295ce9);_0xed614c(_0x295ce9);});});}exports[_0x2038('0x18')]=function(_0xd47622){var _0x5bd7b5=this;return new Promise(function(_0x5695d6,_0x1e5442){return db[_0x2038('0x19')][_0x2038('0x1a')]({'raw':_0xd47622[_0x2038('0x1b')]?_0xd47622[_0x2038('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0xd47622[_0x2038('0x1b')]?_0xd47622[_0x2038('0x1b')]['where']||null:null,'attributes':_0xd47622[_0x2038('0x1b')]?_0xd47622[_0x2038('0x1b')][_0x2038('0x1c')]||null:null,'limit':_0xd47622[_0x2038('0x1b')]?_0xd47622[_0x2038('0x1b')][_0x2038('0x1d')]||null:null,'include':_0xd47622[_0x2038('0x1b')]?_0xd47622['options']['include']?_[_0x2038('0x1e')](_0xd47622[_0x2038('0x1b')][_0x2038('0x1f')],function(_0x4f74f3){return{'model':db[_0x4f74f3['model']],'as':_0x4f74f3['as'],'attributes':_0x4f74f3[_0x2038('0x1c')],'include':_0x4f74f3[_0x2038('0x1f')]?_[_0x2038('0x1e')](_0x4f74f3[_0x2038('0x1f')],function(_0x3e98e3){return{'model':db[_0x3e98e3[_0x2038('0x20')]],'as':_0x3e98e3['as'],'attributes':_0x3e98e3['attributes'],'include':_0x3e98e3['include']?_['map'](_0x3e98e3['include'],function(_0x578041){return{'model':db[_0x578041[_0x2038('0x20')]],'as':_0x578041['as'],'attributes':_0x578041['attributes']};}):[]};}):[]};}):[]:[]})[_0x2038('0xd')](function(_0x37ed21){logger[_0x2038('0x21')](_0x2038('0x18'),_0xd47622);logger['debug'](_0x2038('0x18'),_0xd47622,JSON['stringify'](_0x37ed21));_0x5695d6(_0x37ed21);})['catch'](function(_0x70967a){logger[_0x2038('0x13')]('GetTemplate',_0x70967a['message'],_0xd47622);_0x1e5442(_0x5bd7b5[_0x2038('0x13')](0x1f4,_0x70967a[_0x2038('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 9f2aaa4..0551899 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 _0x4c76=['/:id/all_conditions','addAnyCondition','addAction','put','update','delete','destroy','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','isAuthenticated','get','/:id','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','create','post'];(function(_0x42b769,_0x2aa6fc){var _0x195644=function(_0x15f41c){while(--_0x15f41c){_0x42b769['push'](_0x42b769['shift']());}};_0x195644(++_0x2aa6fc);}(_0x4c76,0x84));var _0x64c7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4c76[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x64c7('0x0'));var path=require('path');var timeout=require(_0x64c7('0x1'));var express=require(_0x64c7('0x2'));var router=express[_0x64c7('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x64c7('0x4'));var interaction=require(_0x64c7('0x5'));var config=require(_0x64c7('0x6'));var controller=require(_0x64c7('0x7'));router['get']('/',auth[_0x64c7('0x8')](),controller['index']);router[_0x64c7('0x9')](_0x64c7('0xa'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/all_conditions',auth[_0x64c7('0x8')](),controller[_0x64c7('0xb')]);router[_0x64c7('0x9')](_0x64c7('0xc'),auth[_0x64c7('0x8')](),controller[_0x64c7('0xd')]);router[_0x64c7('0x9')](_0x64c7('0xe'),auth[_0x64c7('0x8')](),controller[_0x64c7('0xf')]);router['post']('/',auth[_0x64c7('0x8')](),controller[_0x64c7('0x10')]);router[_0x64c7('0x11')](_0x64c7('0x12'),auth[_0x64c7('0x8')](),controller['addAllCondition']);router[_0x64c7('0x11')](_0x64c7('0xc'),auth[_0x64c7('0x8')](),controller[_0x64c7('0x13')]);router[_0x64c7('0x11')](_0x64c7('0xe'),auth['isAuthenticated'](),controller[_0x64c7('0x14')]);router[_0x64c7('0x15')](_0x64c7('0xa'),auth[_0x64c7('0x8')](),controller[_0x64c7('0x16')]);router[_0x64c7('0x17')]('/:id',auth[_0x64c7('0x8')](),controller[_0x64c7('0x18')]);module['exports']=router; \ No newline at end of file +var _0xb35e=['../../components/interaction/service','../../config/environment','./trigger.controller','get','index','/:id','isAuthenticated','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getActions','post','create','addAnyCondition','/:id/actions','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0xd73239,_0x488346){var _0x41cee6=function(_0x4a8bb3){while(--_0x4a8bb3){_0xd73239['push'](_0xd73239['shift']());}};_0x41cee6(++_0x488346);}(_0xb35e,0x96));var _0xeb35=function(_0x48ba3b,_0x45a328){_0x48ba3b=_0x48ba3b-0x0;var _0x21f3cc=_0xb35e[_0x48ba3b];return _0x21f3cc;};'use strict';var multer=require('multer');var util=require(_0xeb35('0x0'));var path=require(_0xeb35('0x1'));var timeout=require(_0xeb35('0x2'));var express=require(_0xeb35('0x3'));var router=express[_0xeb35('0x4')]();var fs_extra=require(_0xeb35('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xeb35('0x6'));var config=require(_0xeb35('0x7'));var controller=require(_0xeb35('0x8'));router[_0xeb35('0x9')]('/',auth['isAuthenticated'](),controller[_0xeb35('0xa')]);router[_0xeb35('0x9')](_0xeb35('0xb'),auth[_0xeb35('0xc')](),controller[_0xeb35('0xd')]);router[_0xeb35('0x9')](_0xeb35('0xe'),auth[_0xeb35('0xc')](),controller[_0xeb35('0xf')]);router[_0xeb35('0x9')](_0xeb35('0x10'),auth[_0xeb35('0xc')](),controller['getAnyConditions']);router['get']('/:id/actions',auth['isAuthenticated'](),controller[_0xeb35('0x11')]);router[_0xeb35('0x12')]('/',auth[_0xeb35('0xc')](),controller[_0xeb35('0x13')]);router[_0xeb35('0x12')](_0xeb35('0xe'),auth[_0xeb35('0xc')](),controller['addAllCondition']);router[_0xeb35('0x12')](_0xeb35('0x10'),auth[_0xeb35('0xc')](),controller[_0xeb35('0x14')]);router['post'](_0xeb35('0x15'),auth[_0xeb35('0xc')](),controller['addAction']);router[_0xeb35('0x16')](_0xeb35('0xb'),auth[_0xeb35('0xc')](),controller[_0xeb35('0x17')]);router[_0xeb35('0x18')](_0xeb35('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xeb35('0x19')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 26967eb..d0b05c1 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 _0xa210=['STRING','exports'];(function(_0x3aa06c,_0x26b335){var _0x291561=function(_0x110a09){while(--_0x110a09){_0x3aa06c['push'](_0x3aa06c['shift']());}};_0x291561(++_0x26b335);}(_0xa210,0xe5));var _0x0a21=function(_0x3f1725,_0x54ca9c){_0x3f1725=_0x3f1725-0x0;var _0x1bfc52=_0xa210[_0x3f1725];return _0x1bfc52;};'use strict';var Sequelize=require('sequelize');module[_0x0a21('0x0')]={'name':{'type':Sequelize[_0x0a21('0x1')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x9c05=['sequelize','exports','STRING','BOOLEAN'];(function(_0x2e04ef,_0x31a596){var _0x5722b0=function(_0x386fbd){while(--_0x386fbd){_0x2e04ef['push'](_0x2e04ef['shift']());}};_0x5722b0(++_0x31a596);}(_0x9c05,0xdc));var _0x59c0=function(_0x4a5013,_0x4a1e37){_0x4a5013=_0x4a5013-0x0;var _0x32b4f4=_0x9c05[_0x4a5013];return _0x32b4f4;};'use strict';var Sequelize=require(_0x59c0('0x0'));module[_0x59c0('0x1')]={'name':{'type':Sequelize[_0x59c0('0x2')]},'channel':{'type':Sequelize[_0x59c0('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x59c0('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index a11486d..22d463a 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 _0xa39e=['findOne','TriggerId','Action','getActions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','Triggers','UserProfileResource','error','stack','name','send','index','map','Trigger','rawAttributes','fieldName','type','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','addAllCondition','Condition','addAnyCondition','getAllConditions','getAnyConditions'];(function(_0x25be38,_0x205a7d){var _0x3bf221=function(_0xa342d4){while(--_0xa342d4){_0x25be38['push'](_0x25be38['shift']());}};_0x3bf221(++_0x205a7d);}(_0xa39e,0x1df));var _0xea39=function(_0x479fca,_0x5466c5){_0x479fca=_0x479fca-0x0;var _0x5f0526=_0xa39e[_0x479fca];return _0x5f0526;};'use strict';var emlformat=require(_0xea39('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xea39('0x1'));var jsonpatch=require(_0xea39('0x2'));var rp=require(_0xea39('0x3'));var moment=require(_0xea39('0x4'));var BPromise=require(_0xea39('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xea39('0x6'));var sox=require(_0xea39('0x7'));var csv=require(_0xea39('0x8'));var ejs=require(_0xea39('0x9'));var fs=require('fs');var fs_extra=require(_0xea39('0xa'));var _=require('lodash');var squel=require(_0xea39('0xb'));var crypto=require(_0xea39('0xc'));var jsforce=require(_0xea39('0xd'));var deskjs=require(_0xea39('0xe'));var toCsv=require(_0xea39('0x8'));var querystring=require('querystring');var Papa=require(_0xea39('0xf'));var Redis=require(_0xea39('0x10'));var authService=require(_0xea39('0x11'));var qs=require(_0xea39('0x12'));var as=require(_0xea39('0x13'));var hardwareService=require(_0xea39('0x14'));var logger=require(_0xea39('0x15'))('api');var utils=require(_0xea39('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xea39('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5e91,_0x272e92){_0x272e92=_0x272e92||0xcc;return function(_0x28ae87){if(_0x28ae87){return _0x1a5e91[_0xea39('0x18')](_0x272e92);}return _0x1a5e91['status'](_0x272e92)[_0xea39('0x19')]();};}function respondWithResult(_0x2629ba,_0xd68d27){_0xd68d27=_0xd68d27||0xc8;return function(_0x231edf){if(_0x231edf){return _0x2629ba[_0xea39('0x1a')](_0xd68d27)[_0xea39('0x1b')](_0x231edf);}};}function respondWithFilteredResult(_0x1403b7,_0x552589){return function(_0x215012){if(_0x215012){var _0x31dad6=typeof _0x552589[_0xea39('0x1c')]===_0xea39('0x1d')&&typeof _0x552589[_0xea39('0x1e')]===_0xea39('0x1d');var _0x50ee9f=_0x215012['count'];var _0x2678b6=_0x31dad6?0x0:_0x552589[_0xea39('0x1c')];var _0x576bed=_0x31dad6?_0x215012[_0xea39('0x1f')]:_0x552589[_0xea39('0x1c')]+_0x552589[_0xea39('0x1e')];var _0x11a157;if(_0x576bed>=_0x50ee9f){_0x576bed=_0x50ee9f;_0x11a157=0xc8;}else{_0x11a157=0xce;}_0x1403b7['status'](_0x11a157);return _0x1403b7[_0xea39('0x20')](_0xea39('0x21'),_0x2678b6+'-'+_0x576bed+'/'+_0x50ee9f)[_0xea39('0x1b')](_0x215012);}return null;};}function patchUpdates(_0x26ba69){return function(_0x5a9fbd){try{jsonpatch[_0xea39('0x22')](_0x5a9fbd,_0x26ba69,!![]);}catch(_0x272724){return BPromise['reject'](_0x272724);}return _0x5a9fbd['save']();};}function saveUpdates(_0x644243,_0xafe620){return function(_0xb1f108){if(_0xb1f108){return _0xb1f108[_0xea39('0x23')](_0x644243)[_0xea39('0x24')](function(_0x2e5958){return _0x2e5958;});}return null;};}function removeEntity(_0xab5ba,_0x380b7e){return function(_0x4a45a7){if(_0x4a45a7){return _0x4a45a7[_0xea39('0x25')]()[_0xea39('0x24')](function(){var _0x53b2e6=_0x4a45a7[_0xea39('0x26')]({'plain':!![]});var _0x5a3e6e=_0xea39('0x27');return db[_0xea39('0x28')][_0xea39('0x25')]({'where':{'type':_0x5a3e6e,'resourceId':_0x53b2e6['id']}})[_0xea39('0x24')](function(){return _0x4a45a7;});})['then'](function(){_0xab5ba[_0xea39('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5104a7,_0x14901e){return function(_0x4e8b7d){if(!_0x4e8b7d){_0x5104a7[_0xea39('0x18')](0x194);}return _0x4e8b7d;};}function handleError(_0x3be435,_0x91b141){_0x91b141=_0x91b141||0x1f4;return function(_0x567a9f){logger[_0xea39('0x29')](_0x567a9f[_0xea39('0x2a')]);if(_0x567a9f[_0xea39('0x2b')]){delete _0x567a9f[_0xea39('0x2b')];}_0x3be435[_0xea39('0x1a')](_0x91b141)[_0xea39('0x2c')](_0x567a9f);};}exports[_0xea39('0x2d')]=function(_0x420d7c,_0x27cfbd){var _0x37bf84={},_0x33f0d9={},_0xb31c9c={'count':0x0,'rows':[]};var _0x525361=_[_0xea39('0x2e')](db[_0xea39('0x2f')][_0xea39('0x30')],function(_0x36b9bd){return{'name':_0x36b9bd[_0xea39('0x31')],'type':_0x36b9bd[_0xea39('0x32')][_0xea39('0x33')]};});_0x33f0d9['model']=_['map'](_0x525361,_0xea39('0x2b'));_0x33f0d9['query']=_[_0xea39('0x34')](_0x420d7c[_0xea39('0x35')]);_0x33f0d9['filters']=_[_0xea39('0x36')](_0x33f0d9[_0xea39('0x37')],_0x33f0d9[_0xea39('0x35')]);_0x37bf84[_0xea39('0x38')]=_[_0xea39('0x36')](_0x33f0d9[_0xea39('0x37')],qs[_0xea39('0x39')](_0x420d7c['query'][_0xea39('0x39')]));_0x37bf84[_0xea39('0x38')]=_0x37bf84[_0xea39('0x38')][_0xea39('0x3a')]?_0x37bf84[_0xea39('0x38')]:_0x33f0d9[_0xea39('0x37')];if(!_0x420d7c[_0xea39('0x35')][_0xea39('0x3b')](_0xea39('0x3c'))){_0x37bf84[_0xea39('0x1e')]=qs[_0xea39('0x1e')](_0x420d7c['query'][_0xea39('0x1e')]);_0x37bf84[_0xea39('0x1c')]=qs['offset'](_0x420d7c[_0xea39('0x35')][_0xea39('0x1c')]);}_0x37bf84[_0xea39('0x3d')]=qs[_0xea39('0x3e')](_0x420d7c[_0xea39('0x35')][_0xea39('0x3e')]);_0x37bf84[_0xea39('0x3f')]=qs[_0xea39('0x40')](_[_0xea39('0x41')](_0x420d7c[_0xea39('0x35')],_0x33f0d9[_0xea39('0x40')]),_0x525361);if(_0x420d7c[_0xea39('0x35')][_0xea39('0x42')]){_0x37bf84[_0xea39('0x3f')]=_[_0xea39('0x43')](_0x37bf84['where'],{'$or':_[_0xea39('0x2e')](_0x525361,function(_0x5a8873){if(_0x5a8873[_0xea39('0x32')]!==_0xea39('0x44')){var _0x1f3af5={};_0x1f3af5[_0x5a8873[_0xea39('0x2b')]]={'$like':'%'+_0x420d7c[_0xea39('0x35')]['filter']+'%'};return _0x1f3af5;}})});}_0x37bf84=_[_0xea39('0x43')]({},_0x37bf84,_0x420d7c[_0xea39('0x45')]);var _0x5b1b2={'where':_0x37bf84[_0xea39('0x3f')]};return db[_0xea39('0x2f')][_0xea39('0x1f')](_0x5b1b2)[_0xea39('0x24')](function(_0x3bb974){_0xb31c9c['count']=_0x3bb974;if(_0x420d7c[_0xea39('0x35')][_0xea39('0x46')]){_0x37bf84[_0xea39('0x47')]=[{'all':!![]}];}return db[_0xea39('0x2f')][_0xea39('0x48')](_0x37bf84);})[_0xea39('0x24')](function(_0x906810){_0xb31c9c[_0xea39('0x49')]=_0x906810;return _0xb31c9c;})[_0xea39('0x24')](respondWithFilteredResult(_0x27cfbd,_0x37bf84))['catch'](handleError(_0x27cfbd,null));};exports[_0xea39('0x4a')]=function(_0x5d0af8,_0x59e90c){var _0x547ae3={'raw':![],'where':{'id':_0x5d0af8[_0xea39('0x4b')]['id']}},_0x38bf78={};_0x38bf78['model']=_[_0xea39('0x34')](db[_0xea39('0x2f')][_0xea39('0x30')]);_0x38bf78[_0xea39('0x35')]=_[_0xea39('0x34')](_0x5d0af8[_0xea39('0x35')]);_0x38bf78[_0xea39('0x40')]=_[_0xea39('0x36')](_0x38bf78[_0xea39('0x37')],_0x38bf78[_0xea39('0x35')]);_0x547ae3[_0xea39('0x38')]=_[_0xea39('0x36')](_0x38bf78[_0xea39('0x37')],qs[_0xea39('0x39')](_0x5d0af8[_0xea39('0x35')]['fields']));_0x547ae3[_0xea39('0x38')]=_0x547ae3['attributes'][_0xea39('0x3a')]?_0x547ae3['attributes']:_0x38bf78[_0xea39('0x37')];if(_0x5d0af8[_0xea39('0x35')][_0xea39('0x46')]){_0x547ae3['include']=[{'all':!![]}];}_0x547ae3=_[_0xea39('0x43')]({},_0x547ae3,_0x5d0af8['options']);return db[_0xea39('0x2f')][_0xea39('0x4c')](_0x547ae3)['then'](handleEntityNotFound(_0x59e90c,null))[_0xea39('0x24')](respondWithResult(_0x59e90c,null))[_0xea39('0x4d')](handleError(_0x59e90c,null));};exports['create']=function(_0x38e3f0,_0x58ac07){return db[_0xea39('0x2f')]['create'](_0x38e3f0[_0xea39('0x4e')],{})[_0xea39('0x24')](function(_0x3acfae){var _0x5cae93=_0x38e3f0[_0xea39('0x4f')]['get']({'plain':!![]});if(!_0x5cae93)throw new Error(_0xea39('0x50'));if(_0x5cae93[_0xea39('0x51')]===_0xea39('0x4f')){var _0x386e61=_0x3acfae[_0xea39('0x26')]({'plain':!![]});var _0x196b17='Triggers';return db[_0xea39('0x52')]['find']({'where':{'name':_0x196b17,'userProfileId':_0x5cae93[_0xea39('0x53')]},'raw':!![]})[_0xea39('0x24')](function(_0x59e6a3){if(_0x59e6a3&&_0x59e6a3[_0xea39('0x54')]===0x0){return db[_0xea39('0x28')][_0xea39('0x55')]({'name':_0x386e61[_0xea39('0x2b')],'resourceId':_0x386e61['id'],'type':_0x59e6a3[_0xea39('0x2b')],'sectionId':_0x59e6a3['id']},{})[_0xea39('0x24')](function(){return _0x3acfae;});}else{return _0x3acfae;}})[_0xea39('0x4d')](function(_0x138044){logger[_0xea39('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x138044);throw _0x138044;});}return _0x3acfae;})[_0xea39('0x24')](respondWithResult(_0x58ac07,0xc9))[_0xea39('0x4d')](handleError(_0x58ac07,null));};exports[_0xea39('0x23')]=function(_0x1aa310,_0x35c272){if(_0x1aa310[_0xea39('0x4e')]['id']){delete _0x1aa310[_0xea39('0x4e')]['id'];}return db['Trigger'][_0xea39('0x4c')]({'where':{'id':_0x1aa310[_0xea39('0x4b')]['id']}})[_0xea39('0x24')](handleEntityNotFound(_0x35c272,null))[_0xea39('0x24')](saveUpdates(_0x1aa310['body'],null))[_0xea39('0x24')](respondWithResult(_0x35c272,null))[_0xea39('0x4d')](handleError(_0x35c272,null));};exports[_0xea39('0x25')]=function(_0x5d277d,_0x3fb93b){return db[_0xea39('0x2f')]['find']({'where':{'id':_0x5d277d[_0xea39('0x4b')]['id']}})[_0xea39('0x24')](handleEntityNotFound(_0x3fb93b,null))[_0xea39('0x24')](removeEntity(_0x3fb93b,null))['catch'](handleError(_0x3fb93b,null));};exports[_0xea39('0x56')]=function(_0x2b5841,_0x3d18a4,_0x3560c4){if(_0x2b5841['body']['id']){delete _0x2b5841[_0xea39('0x4e')]['id'];}return db[_0xea39('0x2f')][_0xea39('0x4c')]({'where':{'id':_0x2b5841['params']['id']}})[_0xea39('0x24')](handleEntityNotFound(_0x3d18a4,null))[_0xea39('0x24')](function(_0x5a02af){if(_0x5a02af){_0x2b5841[_0xea39('0x4e')]['TriggerAllId']=_0x5a02af['id'];return db[_0xea39('0x57')][_0xea39('0x55')](_0x2b5841[_0xea39('0x4e')]);}})[_0xea39('0x24')](respondWithResult(_0x3d18a4,null))[_0xea39('0x4d')](handleError(_0x3d18a4,null));};exports[_0xea39('0x58')]=function(_0x5db225,_0x3a362f,_0xc4aeb1){if(_0x5db225[_0xea39('0x4e')]['id']){delete _0x5db225['body']['id'];}return db[_0xea39('0x2f')]['find']({'where':{'id':_0x5db225[_0xea39('0x4b')]['id']}})[_0xea39('0x24')](handleEntityNotFound(_0x3a362f,null))[_0xea39('0x24')](function(_0x286e5a){if(_0x286e5a){_0x5db225[_0xea39('0x4e')]['TriggerAnyId']=_0x286e5a['id'];return db[_0xea39('0x57')]['create'](_0x5db225[_0xea39('0x4e')]);}})['then'](respondWithResult(_0x3a362f,null))[_0xea39('0x4d')](handleError(_0x3a362f,null));};exports['getAllConditions']=function(_0x5c7b55,_0x3d289f,_0x3a6f53){var _0x5d2c57={};var _0x53d3f2={};var _0x756cb;var _0x7108e;return db[_0xea39('0x2f')]['findOne']({'where':{'id':_0x5c7b55['params']['id']}})['then'](handleEntityNotFound(_0x3d289f,null))[_0xea39('0x24')](function(_0x3a1217){if(_0x3a1217){_0x756cb=_0x3a1217;_0x53d3f2[_0xea39('0x37')]=_[_0xea39('0x34')](db['Condition']['rawAttributes']);_0x53d3f2['query']=_['keys'](_0x5c7b55[_0xea39('0x35')]);_0x53d3f2['filters']=_['intersection'](_0x53d3f2['model'],_0x53d3f2[_0xea39('0x35')]);_0x5d2c57[_0xea39('0x38')]=_[_0xea39('0x36')](_0x53d3f2[_0xea39('0x37')],qs[_0xea39('0x39')](_0x5c7b55[_0xea39('0x35')][_0xea39('0x39')]));_0x5d2c57[_0xea39('0x38')]=_0x5d2c57[_0xea39('0x38')][_0xea39('0x3a')]?_0x5d2c57['attributes']:_0x53d3f2[_0xea39('0x37')];_0x5d2c57['order']=qs[_0xea39('0x3e')](_0x5c7b55[_0xea39('0x35')]['sort']);_0x5d2c57['where']=qs['filters'](_['pick'](_0x5c7b55['query'],_0x53d3f2[_0xea39('0x40')]));if(_0x5c7b55[_0xea39('0x35')][_0xea39('0x42')]){_0x5d2c57[_0xea39('0x3f')]=_['merge'](_0x5d2c57[_0xea39('0x3f')],{'$or':_['map'](_0x5d2c57[_0xea39('0x38')],function(_0x8e4fba){var _0x26113b={};_0x26113b[_0x8e4fba]={'$like':'%'+_0x5c7b55['query'][_0xea39('0x42')]+'%'};return _0x26113b;})});}_0x5d2c57=_[_0xea39('0x43')]({},_0x5d2c57,_0x5c7b55[_0xea39('0x45')]);return _0x756cb[_0xea39('0x59')](_0x5d2c57);}})[_0xea39('0x24')](function(_0x303afa){if(_0x303afa){_0x7108e=_0x303afa['length'];if(!_0x5c7b55[_0xea39('0x35')][_0xea39('0x3b')](_0xea39('0x3c'))){_0x5d2c57[_0xea39('0x1e')]=qs[_0xea39('0x1e')](_0x5c7b55[_0xea39('0x35')]['limit']);_0x5d2c57[_0xea39('0x1c')]=qs[_0xea39('0x1c')](_0x5c7b55[_0xea39('0x35')][_0xea39('0x1c')]);}return _0x756cb['getAllConditions'](_0x5d2c57);}})[_0xea39('0x24')](function(_0x1f2900){if(_0x1f2900){return _0x1f2900?{'count':_0x7108e,'rows':_0x1f2900}:null;}})[_0xea39('0x24')](respondWithResult(_0x3d289f,null))[_0xea39('0x4d')](handleError(_0x3d289f,null));};exports[_0xea39('0x5a')]=function(_0x47399b,_0x5f98ec,_0x32457f){var _0x44b6ee={};var _0x16ee6d={};var _0x2388a4;var _0x5bc100;return db[_0xea39('0x2f')][_0xea39('0x5b')]({'where':{'id':_0x47399b[_0xea39('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5f98ec,null))['then'](function(_0x16427b){if(_0x16427b){_0x2388a4=_0x16427b;_0x16ee6d[_0xea39('0x37')]=_[_0xea39('0x34')](db[_0xea39('0x57')][_0xea39('0x30')]);_0x16ee6d['query']=_[_0xea39('0x34')](_0x47399b[_0xea39('0x35')]);_0x16ee6d[_0xea39('0x40')]=_[_0xea39('0x36')](_0x16ee6d[_0xea39('0x37')],_0x16ee6d[_0xea39('0x35')]);_0x44b6ee[_0xea39('0x38')]=_[_0xea39('0x36')](_0x16ee6d[_0xea39('0x37')],qs[_0xea39('0x39')](_0x47399b['query'][_0xea39('0x39')]));_0x44b6ee[_0xea39('0x38')]=_0x44b6ee['attributes']['length']?_0x44b6ee['attributes']:_0x16ee6d[_0xea39('0x37')];_0x44b6ee['order']=qs['sort'](_0x47399b['query'][_0xea39('0x3e')]);_0x44b6ee['where']=qs[_0xea39('0x40')](_[_0xea39('0x41')](_0x47399b[_0xea39('0x35')],_0x16ee6d[_0xea39('0x40')]));if(_0x47399b[_0xea39('0x35')]['filter']){_0x44b6ee['where']=_[_0xea39('0x43')](_0x44b6ee[_0xea39('0x3f')],{'$or':_['map'](_0x44b6ee[_0xea39('0x38')],function(_0x6cbb5e){var _0x133620={};_0x133620[_0x6cbb5e]={'$like':'%'+_0x47399b[_0xea39('0x35')][_0xea39('0x42')]+'%'};return _0x133620;})});}_0x44b6ee=_[_0xea39('0x43')]({},_0x44b6ee,_0x47399b['options']);return _0x2388a4[_0xea39('0x5a')](_0x44b6ee);}})[_0xea39('0x24')](function(_0x594ea3){if(_0x594ea3){_0x5bc100=_0x594ea3[_0xea39('0x3a')];if(!_0x47399b[_0xea39('0x35')][_0xea39('0x3b')]('nolimit')){_0x44b6ee[_0xea39('0x1e')]=qs['limit'](_0x47399b[_0xea39('0x35')][_0xea39('0x1e')]);_0x44b6ee[_0xea39('0x1c')]=qs[_0xea39('0x1c')](_0x47399b[_0xea39('0x35')][_0xea39('0x1c')]);}return _0x2388a4['getAnyConditions'](_0x44b6ee);}})['then'](function(_0x34771c){if(_0x34771c){return _0x34771c?{'count':_0x5bc100,'rows':_0x34771c}:null;}})[_0xea39('0x24')](respondWithResult(_0x5f98ec,null))[_0xea39('0x4d')](handleError(_0x5f98ec,null));};exports['addAction']=function(_0x214348,_0x57e76a,_0x20d0b7){if(_0x214348[_0xea39('0x4e')]['id']){delete _0x214348[_0xea39('0x4e')]['id'];}return db[_0xea39('0x2f')][_0xea39('0x4c')]({'where':{'id':_0x214348['params']['id']}})[_0xea39('0x24')](handleEntityNotFound(_0x57e76a,null))['then'](function(_0x3a018c){if(_0x3a018c){_0x214348[_0xea39('0x4e')][_0xea39('0x5c')]=_0x3a018c['id'];return db['Action'][_0xea39('0x55')](_0x214348[_0xea39('0x4e')]);}})['then'](respondWithResult(_0x57e76a,null))['catch'](handleError(_0x57e76a,null));};exports['getActions']=function(_0x4cc666,_0x4c8215,_0x5c1fc4){var _0xc8aed7={};var _0x743b63={};var _0x3ff2f0;var _0x479d26;return db[_0xea39('0x2f')][_0xea39('0x5b')]({'where':{'id':_0x4cc666[_0xea39('0x4b')]['id']}})[_0xea39('0x24')](handleEntityNotFound(_0x4c8215,null))['then'](function(_0x27ad81){if(_0x27ad81){_0x3ff2f0=_0x27ad81;_0x743b63[_0xea39('0x37')]=_[_0xea39('0x34')](db[_0xea39('0x5d')][_0xea39('0x30')]);_0x743b63[_0xea39('0x35')]=_[_0xea39('0x34')](_0x4cc666[_0xea39('0x35')]);_0x743b63[_0xea39('0x40')]=_[_0xea39('0x36')](_0x743b63[_0xea39('0x37')],_0x743b63[_0xea39('0x35')]);_0xc8aed7[_0xea39('0x38')]=_['intersection'](_0x743b63['model'],qs[_0xea39('0x39')](_0x4cc666[_0xea39('0x35')][_0xea39('0x39')]));_0xc8aed7['attributes']=_0xc8aed7['attributes'][_0xea39('0x3a')]?_0xc8aed7['attributes']:_0x743b63['model'];_0xc8aed7['order']=qs[_0xea39('0x3e')](_0x4cc666['query'][_0xea39('0x3e')]);_0xc8aed7[_0xea39('0x3f')]=qs[_0xea39('0x40')](_[_0xea39('0x41')](_0x4cc666['query'],_0x743b63[_0xea39('0x40')]));if(_0x4cc666[_0xea39('0x35')]['filter']){_0xc8aed7[_0xea39('0x3f')]=_[_0xea39('0x43')](_0xc8aed7[_0xea39('0x3f')],{'$or':_['map'](_0xc8aed7['attributes'],function(_0x4e439d){var _0x29e8c3={};_0x29e8c3[_0x4e439d]={'$like':'%'+_0x4cc666['query'][_0xea39('0x42')]+'%'};return _0x29e8c3;})});}_0xc8aed7=_[_0xea39('0x43')]({},_0xc8aed7,_0x4cc666[_0xea39('0x45')]);return _0x3ff2f0[_0xea39('0x5e')](_0xc8aed7);}})[_0xea39('0x24')](function(_0x1e1c2d){if(_0x1e1c2d){_0x479d26=_0x1e1c2d[_0xea39('0x3a')];if(!_0x4cc666[_0xea39('0x35')][_0xea39('0x3b')](_0xea39('0x3c'))){_0xc8aed7[_0xea39('0x1e')]=qs[_0xea39('0x1e')](_0x4cc666[_0xea39('0x35')][_0xea39('0x1e')]);_0xc8aed7[_0xea39('0x1c')]=qs[_0xea39('0x1c')](_0x4cc666[_0xea39('0x35')][_0xea39('0x1c')]);}return _0x3ff2f0[_0xea39('0x5e')](_0xc8aed7);}})['then'](function(_0x42ad47){if(_0x42ad47){return _0x42ad47?{'count':_0x479d26,'rows':_0x42ad47}:null;}})[_0xea39('0x24')](respondWithResult(_0x4c8215,null))[_0xea39('0x4d')](handleError(_0x4c8215,null));}; \ No newline at end of file +var _0xc111=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','params','addAllCondition','addAnyCondition','Condition','getAllConditions','findOne','order','getAnyConditions','TriggerId','Action','getActions','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','count','status','Content-Range','apply','update','then','destroy','get','Triggers','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','filter','VIRTUAL','merge','options','Trigger','includeAll','include','rows','catch','show','keys','create','body'];(function(_0x40af29,_0x16b6a9){var _0x1d9783=function(_0x9cd065){while(--_0x9cd065){_0x40af29['push'](_0x40af29['shift']());}};_0x1d9783(++_0x16b6a9);}(_0xc111,0x182));var _0x1c11=function(_0x30e4ff,_0x2d33b5){_0x30e4ff=_0x30e4ff-0x0;var _0xe9c895=_0xc111[_0x30e4ff];return _0xe9c895;};'use strict';var emlformat=require(_0x1c11('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1c11('0x1'));var jsonpatch=require(_0x1c11('0x2'));var rp=require(_0x1c11('0x3'));var moment=require('moment');var BPromise=require(_0x1c11('0x4'));var Mustache=require('mustache');var util=require(_0x1c11('0x5'));var path=require(_0x1c11('0x6'));var sox=require('sox');var csv=require(_0x1c11('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1c11('0x8'));var _=require('lodash');var squel=require(_0x1c11('0x9'));var crypto=require(_0x1c11('0xa'));var jsforce=require(_0x1c11('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1c11('0xc'));var Papa=require(_0x1c11('0xd'));var Redis=require(_0x1c11('0xe'));var authService=require(_0x1c11('0xf'));var qs=require(_0x1c11('0x10'));var as=require(_0x1c11('0x11'));var hardwareService=require(_0x1c11('0x12'));var logger=require(_0x1c11('0x13'))(_0x1c11('0x14'));var utils=require(_0x1c11('0x15'));var config=require(_0x1c11('0x16'));var licenseUtil=require(_0x1c11('0x17'));var db=require(_0x1c11('0x18'))['db'];function respondWithStatusCode(_0x2c5f7a,_0x19180d){_0x19180d=_0x19180d||0xcc;return function(_0x18e15e){if(_0x18e15e){return _0x2c5f7a[_0x1c11('0x19')](_0x19180d);}return _0x2c5f7a['status'](_0x19180d)[_0x1c11('0x1a')]();};}function respondWithResult(_0xdbb2b1,_0x47a1f8){_0x47a1f8=_0x47a1f8||0xc8;return function(_0x6993e7){if(_0x6993e7){return _0xdbb2b1['status'](_0x47a1f8)['json'](_0x6993e7);}};}function respondWithFilteredResult(_0x362835,_0x17c3fd){return function(_0x138682){if(_0x138682){var _0x32859b=typeof _0x17c3fd[_0x1c11('0x1b')]===_0x1c11('0x1c')&&typeof _0x17c3fd['limit']===_0x1c11('0x1c');var _0x155894=_0x138682[_0x1c11('0x1d')];var _0x4d7f31=_0x32859b?0x0:_0x17c3fd[_0x1c11('0x1b')];var _0x1e835d=_0x32859b?_0x138682[_0x1c11('0x1d')]:_0x17c3fd['offset']+_0x17c3fd['limit'];var _0x439514;if(_0x1e835d>=_0x155894){_0x1e835d=_0x155894;_0x439514=0xc8;}else{_0x439514=0xce;}_0x362835[_0x1c11('0x1e')](_0x439514);return _0x362835['set'](_0x1c11('0x1f'),_0x4d7f31+'-'+_0x1e835d+'/'+_0x155894)['json'](_0x138682);}return null;};}function patchUpdates(_0x29af7c){return function(_0x36d8cf){try{jsonpatch[_0x1c11('0x20')](_0x36d8cf,_0x29af7c,!![]);}catch(_0x36d44a){return BPromise['reject'](_0x36d44a);}return _0x36d8cf['save']();};}function saveUpdates(_0x26ddcf,_0x173b4c){return function(_0xf94e40){if(_0xf94e40){return _0xf94e40[_0x1c11('0x21')](_0x26ddcf)[_0x1c11('0x22')](function(_0x35c03c){return _0x35c03c;});}return null;};}function removeEntity(_0x5b42b6,_0xf83037){return function(_0xe82d47){if(_0xe82d47){return _0xe82d47[_0x1c11('0x23')]()[_0x1c11('0x22')](function(){var _0x2756df=_0xe82d47[_0x1c11('0x24')]({'plain':!![]});var _0x1c769b=_0x1c11('0x25');return db[_0x1c11('0x26')][_0x1c11('0x23')]({'where':{'type':_0x1c769b,'resourceId':_0x2756df['id']}})[_0x1c11('0x22')](function(){return _0xe82d47;});})[_0x1c11('0x22')](function(){_0x5b42b6['status'](0xcc)[_0x1c11('0x1a')]();});}};}function handleEntityNotFound(_0x6bf7c7,_0x272fa2){return function(_0x715c59){if(!_0x715c59){_0x6bf7c7[_0x1c11('0x19')](0x194);}return _0x715c59;};}function handleError(_0x1d921c,_0x3d49a5){_0x3d49a5=_0x3d49a5||0x1f4;return function(_0x352dbe){logger[_0x1c11('0x27')](_0x352dbe[_0x1c11('0x28')]);if(_0x352dbe['name']){delete _0x352dbe[_0x1c11('0x29')];}_0x1d921c[_0x1c11('0x1e')](_0x3d49a5)[_0x1c11('0x2a')](_0x352dbe);};}exports['index']=function(_0x52564e,_0x3d409e){var _0x55d371={},_0x586856={},_0x16653a={'count':0x0,'rows':[]};var _0x3e9a16=_[_0x1c11('0x2b')](db['Trigger'][_0x1c11('0x2c')],function(_0xceb1c7){return{'name':_0xceb1c7[_0x1c11('0x2d')],'type':_0xceb1c7[_0x1c11('0x2e')][_0x1c11('0x2f')]};});_0x586856['model']=_[_0x1c11('0x2b')](_0x3e9a16,_0x1c11('0x29'));_0x586856[_0x1c11('0x30')]=_['keys'](_0x52564e[_0x1c11('0x30')]);_0x586856['filters']=_['intersection'](_0x586856[_0x1c11('0x31')],_0x586856[_0x1c11('0x30')]);_0x55d371[_0x1c11('0x32')]=_[_0x1c11('0x33')](_0x586856[_0x1c11('0x31')],qs[_0x1c11('0x34')](_0x52564e[_0x1c11('0x30')]['fields']));_0x55d371[_0x1c11('0x32')]=_0x55d371[_0x1c11('0x32')][_0x1c11('0x35')]?_0x55d371['attributes']:_0x586856[_0x1c11('0x31')];if(!_0x52564e[_0x1c11('0x30')][_0x1c11('0x36')](_0x1c11('0x37'))){_0x55d371['limit']=qs[_0x1c11('0x38')](_0x52564e[_0x1c11('0x30')][_0x1c11('0x38')]);_0x55d371[_0x1c11('0x1b')]=qs[_0x1c11('0x1b')](_0x52564e[_0x1c11('0x30')][_0x1c11('0x1b')]);}_0x55d371['order']=qs[_0x1c11('0x39')](_0x52564e[_0x1c11('0x30')][_0x1c11('0x39')]);_0x55d371[_0x1c11('0x3a')]=qs[_0x1c11('0x3b')](_[_0x1c11('0x3c')](_0x52564e[_0x1c11('0x30')],_0x586856[_0x1c11('0x3b')]),_0x3e9a16);if(_0x52564e[_0x1c11('0x30')][_0x1c11('0x3d')]){_0x55d371['where']=_['merge'](_0x55d371[_0x1c11('0x3a')],{'$or':_[_0x1c11('0x2b')](_0x3e9a16,function(_0x5e3f80){if(_0x5e3f80[_0x1c11('0x2e')]!==_0x1c11('0x3e')){var _0x59b96c={};_0x59b96c[_0x5e3f80[_0x1c11('0x29')]]={'$like':'%'+_0x52564e['query']['filter']+'%'};return _0x59b96c;}})});}_0x55d371=_[_0x1c11('0x3f')]({},_0x55d371,_0x52564e[_0x1c11('0x40')]);var _0x2b0626={'where':_0x55d371[_0x1c11('0x3a')]};return db[_0x1c11('0x41')][_0x1c11('0x1d')](_0x2b0626)[_0x1c11('0x22')](function(_0x346558){_0x16653a[_0x1c11('0x1d')]=_0x346558;if(_0x52564e[_0x1c11('0x30')][_0x1c11('0x42')]){_0x55d371[_0x1c11('0x43')]=[{'all':!![]}];}return db[_0x1c11('0x41')]['findAll'](_0x55d371);})[_0x1c11('0x22')](function(_0x4e5898){_0x16653a[_0x1c11('0x44')]=_0x4e5898;return _0x16653a;})[_0x1c11('0x22')](respondWithFilteredResult(_0x3d409e,_0x55d371))[_0x1c11('0x45')](handleError(_0x3d409e,null));};exports[_0x1c11('0x46')]=function(_0x1c512a,_0x2a6319){var _0x488f35={'raw':![],'where':{'id':_0x1c512a['params']['id']}},_0x5d0bf0={};_0x5d0bf0['model']=_[_0x1c11('0x47')](db[_0x1c11('0x41')][_0x1c11('0x2c')]);_0x5d0bf0[_0x1c11('0x30')]=_[_0x1c11('0x47')](_0x1c512a[_0x1c11('0x30')]);_0x5d0bf0['filters']=_[_0x1c11('0x33')](_0x5d0bf0['model'],_0x5d0bf0[_0x1c11('0x30')]);_0x488f35[_0x1c11('0x32')]=_[_0x1c11('0x33')](_0x5d0bf0[_0x1c11('0x31')],qs[_0x1c11('0x34')](_0x1c512a['query'][_0x1c11('0x34')]));_0x488f35[_0x1c11('0x32')]=_0x488f35[_0x1c11('0x32')]['length']?_0x488f35['attributes']:_0x5d0bf0[_0x1c11('0x31')];if(_0x1c512a[_0x1c11('0x30')]['includeAll']){_0x488f35['include']=[{'all':!![]}];}_0x488f35=_[_0x1c11('0x3f')]({},_0x488f35,_0x1c512a[_0x1c11('0x40')]);return db['Trigger']['find'](_0x488f35)[_0x1c11('0x22')](handleEntityNotFound(_0x2a6319,null))[_0x1c11('0x22')](respondWithResult(_0x2a6319,null))['catch'](handleError(_0x2a6319,null));};exports[_0x1c11('0x48')]=function(_0x4111c3,_0x2f74f5){return db[_0x1c11('0x41')]['create'](_0x4111c3[_0x1c11('0x49')],{})[_0x1c11('0x22')](function(_0x51bda0){var _0x14b186=_0x4111c3[_0x1c11('0x4a')]['get']({'plain':!![]});if(!_0x14b186)throw new Error(_0x1c11('0x4b'));if(_0x14b186[_0x1c11('0x4c')]==='user'){var _0x29bb2c=_0x51bda0[_0x1c11('0x24')]({'plain':!![]});var _0x1726d1=_0x1c11('0x25');return db[_0x1c11('0x4d')][_0x1c11('0x4e')]({'where':{'name':_0x1726d1,'userProfileId':_0x14b186[_0x1c11('0x4f')]},'raw':!![]})[_0x1c11('0x22')](function(_0x574548){if(_0x574548&&_0x574548[_0x1c11('0x50')]===0x0){return db[_0x1c11('0x26')]['create']({'name':_0x29bb2c[_0x1c11('0x29')],'resourceId':_0x29bb2c['id'],'type':_0x574548['name'],'sectionId':_0x574548['id']},{})[_0x1c11('0x22')](function(){return _0x51bda0;});}else{return _0x51bda0;}})[_0x1c11('0x45')](function(_0x27184d){logger[_0x1c11('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x27184d);throw _0x27184d;});}return _0x51bda0;})[_0x1c11('0x22')](respondWithResult(_0x2f74f5,0xc9))[_0x1c11('0x45')](handleError(_0x2f74f5,null));};exports[_0x1c11('0x21')]=function(_0x427c39,_0x267e15){if(_0x427c39[_0x1c11('0x49')]['id']){delete _0x427c39[_0x1c11('0x49')]['id'];}return db['Trigger'][_0x1c11('0x4e')]({'where':{'id':_0x427c39[_0x1c11('0x51')]['id']}})[_0x1c11('0x22')](handleEntityNotFound(_0x267e15,null))[_0x1c11('0x22')](saveUpdates(_0x427c39[_0x1c11('0x49')],null))[_0x1c11('0x22')](respondWithResult(_0x267e15,null))[_0x1c11('0x45')](handleError(_0x267e15,null));};exports[_0x1c11('0x23')]=function(_0x394fb,_0xe1ae8e){return db[_0x1c11('0x41')][_0x1c11('0x4e')]({'where':{'id':_0x394fb[_0x1c11('0x51')]['id']}})[_0x1c11('0x22')](handleEntityNotFound(_0xe1ae8e,null))[_0x1c11('0x22')](removeEntity(_0xe1ae8e,null))['catch'](handleError(_0xe1ae8e,null));};exports[_0x1c11('0x52')]=function(_0x5dd43d,_0x12f63f,_0x2759c6){if(_0x5dd43d[_0x1c11('0x49')]['id']){delete _0x5dd43d[_0x1c11('0x49')]['id'];}return db[_0x1c11('0x41')][_0x1c11('0x4e')]({'where':{'id':_0x5dd43d['params']['id']}})[_0x1c11('0x22')](handleEntityNotFound(_0x12f63f,null))['then'](function(_0xfa82d8){if(_0xfa82d8){_0x5dd43d[_0x1c11('0x49')]['TriggerAllId']=_0xfa82d8['id'];return db['Condition'][_0x1c11('0x48')](_0x5dd43d[_0x1c11('0x49')]);}})[_0x1c11('0x22')](respondWithResult(_0x12f63f,null))[_0x1c11('0x45')](handleError(_0x12f63f,null));};exports[_0x1c11('0x53')]=function(_0x124dad,_0x1da8d3,_0x12976f){if(_0x124dad[_0x1c11('0x49')]['id']){delete _0x124dad[_0x1c11('0x49')]['id'];}return db[_0x1c11('0x41')][_0x1c11('0x4e')]({'where':{'id':_0x124dad['params']['id']}})['then'](handleEntityNotFound(_0x1da8d3,null))[_0x1c11('0x22')](function(_0x4388b7){if(_0x4388b7){_0x124dad[_0x1c11('0x49')]['TriggerAnyId']=_0x4388b7['id'];return db[_0x1c11('0x54')][_0x1c11('0x48')](_0x124dad[_0x1c11('0x49')]);}})[_0x1c11('0x22')](respondWithResult(_0x1da8d3,null))['catch'](handleError(_0x1da8d3,null));};exports[_0x1c11('0x55')]=function(_0x13c60e,_0x3456ab,_0x56532d){var _0x34cce1={};var _0x5cf81a={};var _0x20dd04;var _0x4e1551;return db[_0x1c11('0x41')][_0x1c11('0x56')]({'where':{'id':_0x13c60e[_0x1c11('0x51')]['id']}})[_0x1c11('0x22')](handleEntityNotFound(_0x3456ab,null))[_0x1c11('0x22')](function(_0x2a1f39){if(_0x2a1f39){_0x20dd04=_0x2a1f39;_0x5cf81a[_0x1c11('0x31')]=_[_0x1c11('0x47')](db['Condition'][_0x1c11('0x2c')]);_0x5cf81a['query']=_[_0x1c11('0x47')](_0x13c60e[_0x1c11('0x30')]);_0x5cf81a[_0x1c11('0x3b')]=_[_0x1c11('0x33')](_0x5cf81a[_0x1c11('0x31')],_0x5cf81a[_0x1c11('0x30')]);_0x34cce1[_0x1c11('0x32')]=_[_0x1c11('0x33')](_0x5cf81a[_0x1c11('0x31')],qs[_0x1c11('0x34')](_0x13c60e[_0x1c11('0x30')][_0x1c11('0x34')]));_0x34cce1['attributes']=_0x34cce1['attributes'][_0x1c11('0x35')]?_0x34cce1[_0x1c11('0x32')]:_0x5cf81a[_0x1c11('0x31')];_0x34cce1[_0x1c11('0x57')]=qs[_0x1c11('0x39')](_0x13c60e[_0x1c11('0x30')][_0x1c11('0x39')]);_0x34cce1[_0x1c11('0x3a')]=qs['filters'](_['pick'](_0x13c60e['query'],_0x5cf81a[_0x1c11('0x3b')]));if(_0x13c60e['query'][_0x1c11('0x3d')]){_0x34cce1['where']=_['merge'](_0x34cce1[_0x1c11('0x3a')],{'$or':_[_0x1c11('0x2b')](_0x34cce1[_0x1c11('0x32')],function(_0x446591){var _0xf86568={};_0xf86568[_0x446591]={'$like':'%'+_0x13c60e['query'][_0x1c11('0x3d')]+'%'};return _0xf86568;})});}_0x34cce1=_[_0x1c11('0x3f')]({},_0x34cce1,_0x13c60e['options']);return _0x20dd04[_0x1c11('0x55')](_0x34cce1);}})[_0x1c11('0x22')](function(_0x4be4ae){if(_0x4be4ae){_0x4e1551=_0x4be4ae[_0x1c11('0x35')];if(!_0x13c60e[_0x1c11('0x30')]['hasOwnProperty'](_0x1c11('0x37'))){_0x34cce1['limit']=qs[_0x1c11('0x38')](_0x13c60e[_0x1c11('0x30')]['limit']);_0x34cce1[_0x1c11('0x1b')]=qs[_0x1c11('0x1b')](_0x13c60e['query'][_0x1c11('0x1b')]);}return _0x20dd04['getAllConditions'](_0x34cce1);}})[_0x1c11('0x22')](function(_0x44aaff){if(_0x44aaff){return _0x44aaff?{'count':_0x4e1551,'rows':_0x44aaff}:null;}})[_0x1c11('0x22')](respondWithResult(_0x3456ab,null))['catch'](handleError(_0x3456ab,null));};exports['getAnyConditions']=function(_0x2fbec4,_0x21bd57,_0x107b80){var _0x430754={};var _0x103fed={};var _0x4c377f;var _0x4a0841;return db[_0x1c11('0x41')][_0x1c11('0x56')]({'where':{'id':_0x2fbec4[_0x1c11('0x51')]['id']}})['then'](handleEntityNotFound(_0x21bd57,null))[_0x1c11('0x22')](function(_0x24f641){if(_0x24f641){_0x4c377f=_0x24f641;_0x103fed[_0x1c11('0x31')]=_[_0x1c11('0x47')](db[_0x1c11('0x54')][_0x1c11('0x2c')]);_0x103fed[_0x1c11('0x30')]=_['keys'](_0x2fbec4['query']);_0x103fed[_0x1c11('0x3b')]=_[_0x1c11('0x33')](_0x103fed['model'],_0x103fed[_0x1c11('0x30')]);_0x430754['attributes']=_[_0x1c11('0x33')](_0x103fed[_0x1c11('0x31')],qs[_0x1c11('0x34')](_0x2fbec4[_0x1c11('0x30')][_0x1c11('0x34')]));_0x430754[_0x1c11('0x32')]=_0x430754[_0x1c11('0x32')][_0x1c11('0x35')]?_0x430754['attributes']:_0x103fed[_0x1c11('0x31')];_0x430754[_0x1c11('0x57')]=qs['sort'](_0x2fbec4[_0x1c11('0x30')][_0x1c11('0x39')]);_0x430754[_0x1c11('0x3a')]=qs['filters'](_['pick'](_0x2fbec4[_0x1c11('0x30')],_0x103fed[_0x1c11('0x3b')]));if(_0x2fbec4[_0x1c11('0x30')][_0x1c11('0x3d')]){_0x430754[_0x1c11('0x3a')]=_[_0x1c11('0x3f')](_0x430754[_0x1c11('0x3a')],{'$or':_[_0x1c11('0x2b')](_0x430754[_0x1c11('0x32')],function(_0xccc195){var _0x2eb752={};_0x2eb752[_0xccc195]={'$like':'%'+_0x2fbec4[_0x1c11('0x30')]['filter']+'%'};return _0x2eb752;})});}_0x430754=_[_0x1c11('0x3f')]({},_0x430754,_0x2fbec4[_0x1c11('0x40')]);return _0x4c377f[_0x1c11('0x58')](_0x430754);}})[_0x1c11('0x22')](function(_0x16cc3){if(_0x16cc3){_0x4a0841=_0x16cc3['length'];if(!_0x2fbec4['query'][_0x1c11('0x36')](_0x1c11('0x37'))){_0x430754[_0x1c11('0x38')]=qs[_0x1c11('0x38')](_0x2fbec4[_0x1c11('0x30')][_0x1c11('0x38')]);_0x430754[_0x1c11('0x1b')]=qs['offset'](_0x2fbec4[_0x1c11('0x30')][_0x1c11('0x1b')]);}return _0x4c377f[_0x1c11('0x58')](_0x430754);}})[_0x1c11('0x22')](function(_0x28ccb6){if(_0x28ccb6){return _0x28ccb6?{'count':_0x4a0841,'rows':_0x28ccb6}:null;}})[_0x1c11('0x22')](respondWithResult(_0x21bd57,null))[_0x1c11('0x45')](handleError(_0x21bd57,null));};exports['addAction']=function(_0x156a6f,_0x5f2759,_0x33430f){if(_0x156a6f[_0x1c11('0x49')]['id']){delete _0x156a6f[_0x1c11('0x49')]['id'];}return db[_0x1c11('0x41')][_0x1c11('0x4e')]({'where':{'id':_0x156a6f['params']['id']}})['then'](handleEntityNotFound(_0x5f2759,null))[_0x1c11('0x22')](function(_0x17b285){if(_0x17b285){_0x156a6f[_0x1c11('0x49')][_0x1c11('0x59')]=_0x17b285['id'];return db[_0x1c11('0x5a')]['create'](_0x156a6f['body']);}})[_0x1c11('0x22')](respondWithResult(_0x5f2759,null))[_0x1c11('0x45')](handleError(_0x5f2759,null));};exports[_0x1c11('0x5b')]=function(_0x4e5ef7,_0x4b8ffa,_0x4d7e6b){var _0x350acf={};var _0x5a31e8={};var _0x2a34a1;var _0xb7a7c7;return db[_0x1c11('0x41')]['findOne']({'where':{'id':_0x4e5ef7[_0x1c11('0x51')]['id']}})['then'](handleEntityNotFound(_0x4b8ffa,null))[_0x1c11('0x22')](function(_0xa24cce){if(_0xa24cce){_0x2a34a1=_0xa24cce;_0x5a31e8[_0x1c11('0x31')]=_[_0x1c11('0x47')](db[_0x1c11('0x5a')]['rawAttributes']);_0x5a31e8[_0x1c11('0x30')]=_[_0x1c11('0x47')](_0x4e5ef7[_0x1c11('0x30')]);_0x5a31e8[_0x1c11('0x3b')]=_[_0x1c11('0x33')](_0x5a31e8['model'],_0x5a31e8[_0x1c11('0x30')]);_0x350acf['attributes']=_[_0x1c11('0x33')](_0x5a31e8[_0x1c11('0x31')],qs['fields'](_0x4e5ef7[_0x1c11('0x30')][_0x1c11('0x34')]));_0x350acf[_0x1c11('0x32')]=_0x350acf[_0x1c11('0x32')][_0x1c11('0x35')]?_0x350acf[_0x1c11('0x32')]:_0x5a31e8[_0x1c11('0x31')];_0x350acf[_0x1c11('0x57')]=qs[_0x1c11('0x39')](_0x4e5ef7[_0x1c11('0x30')][_0x1c11('0x39')]);_0x350acf['where']=qs[_0x1c11('0x3b')](_[_0x1c11('0x3c')](_0x4e5ef7[_0x1c11('0x30')],_0x5a31e8[_0x1c11('0x3b')]));if(_0x4e5ef7[_0x1c11('0x30')]['filter']){_0x350acf[_0x1c11('0x3a')]=_[_0x1c11('0x3f')](_0x350acf[_0x1c11('0x3a')],{'$or':_[_0x1c11('0x2b')](_0x350acf[_0x1c11('0x32')],function(_0x24dc6d){var _0x3467e2={};_0x3467e2[_0x24dc6d]={'$like':'%'+_0x4e5ef7['query']['filter']+'%'};return _0x3467e2;})});}_0x350acf=_[_0x1c11('0x3f')]({},_0x350acf,_0x4e5ef7[_0x1c11('0x40')]);return _0x2a34a1[_0x1c11('0x5b')](_0x350acf);}})['then'](function(_0x58d0aa){if(_0x58d0aa){_0xb7a7c7=_0x58d0aa['length'];if(!_0x4e5ef7['query']['hasOwnProperty'](_0x1c11('0x37'))){_0x350acf[_0x1c11('0x38')]=qs['limit'](_0x4e5ef7['query'][_0x1c11('0x38')]);_0x350acf['offset']=qs['offset'](_0x4e5ef7[_0x1c11('0x30')][_0x1c11('0x1b')]);}return _0x2a34a1['getActions'](_0x350acf);}})[_0x1c11('0x22')](function(_0x3fe1f7){if(_0x3fe1f7){return _0x3fe1f7?{'count':_0xb7a7c7,'rows':_0x3fe1f7}:null;}})[_0x1c11('0x22')](respondWithResult(_0x4b8ffa,null))[_0x1c11('0x45')](handleError(_0x4b8ffa,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 93a7b4c..a34068d 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 _0x9a19=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','define'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0x9a19,0x114));var _0x99a1=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0x9a19[_0x3c8e9a];return _0x2d4c57;};'use strict';var _=require(_0x99a1('0x0'));var util=require(_0x99a1('0x1'));var logger=require(_0x99a1('0x2'))('api');var moment=require(_0x99a1('0x3'));var BPromise=require(_0x99a1('0x4'));var rp=require(_0x99a1('0x5'));var fs=require('fs');var path=require(_0x99a1('0x6'));var rimraf=require(_0x99a1('0x7'));var config=require(_0x99a1('0x8'));var attributes=require(_0x99a1('0x9'));module[_0x99a1('0xa')]=function(_0x3eff4a,_0xff0240){return _0x3eff4a[_0x99a1('0xb')]('Trigger',attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x92f0=['../../config/logger','moment','bluebird','rimraf','../../config/environment','./trigger.attributes','exports','Trigger','util'];(function(_0x4c732b,_0x479245){var _0x36f43f=function(_0x43fea2){while(--_0x43fea2){_0x4c732b['push'](_0x4c732b['shift']());}};_0x36f43f(++_0x479245);}(_0x92f0,0x10d));var _0x092f=function(_0x204eb7,_0x4974c3){_0x204eb7=_0x204eb7-0x0;var _0x37e444=_0x92f0[_0x204eb7];return _0x37e444;};'use strict';var _=require('lodash');var util=require(_0x092f('0x0'));var logger=require(_0x092f('0x1'))('api');var moment=require(_0x092f('0x2'));var BPromise=require(_0x092f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x092f('0x4'));var config=require(_0x092f('0x5'));var attributes=require(_0x092f('0x6'));module[_0x092f('0x7')]=function(_0x2996b0,_0x2b6dcb){return _0x2996b0['define'](_0x092f('0x8'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index 942c01a..a9a83f2 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 _0x53b9=['info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTrigger','Trigger','findAll','options','raw','attributes','limit','include','model','map','find','where','ShowTrigger','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x4c8b69,_0x125cc5){var _0x5409f6=function(_0x399efe){while(--_0x399efe){_0x4c8b69['push'](_0x4c8b69['shift']());}};_0x5409f6(++_0x125cc5);}(_0x53b9,0x1b0));var _0x953b=function(_0x13cc8c,_0x5eaa69){_0x13cc8c=_0x13cc8c-0x0;var _0x10361b=_0x53b9[_0x13cc8c];return _0x10361b;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x953b('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x953b('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x953b('0x2'));var logger=require('../../config/logger')(_0x953b('0x3'));var config=require(_0x953b('0x4'));var jayson=require(_0x953b('0x5'));var client=jayson[_0x953b('0x6')][_0x953b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3dbb76,_0x1a50d2,_0x4b1ac4){return new BPromise(function(_0x4dc56e,_0x3c039f){return client[_0x953b('0x8')](_0x3dbb76,_0x4b1ac4)[_0x953b('0x9')](function(_0xb5aec1){logger[_0x953b('0xa')](_0x953b('0xb'),_0x1a50d2,_0x953b('0xc'));logger[_0x953b('0xd')](_0x953b('0xe'),_0x1a50d2,'request\x20sent',JSON[_0x953b('0xf')](_0xb5aec1));if(_0xb5aec1[_0x953b('0x10')]){if(_0xb5aec1[_0x953b('0x10')][_0x953b('0x11')]===0x1f4){logger[_0x953b('0x10')](_0x953b('0xb'),_0x1a50d2,_0xb5aec1[_0x953b('0x10')][_0x953b('0x12')]);return _0x3c039f(_0xb5aec1['error'][_0x953b('0x12')]);}logger[_0x953b('0x10')]('Trigger,\x20%s,\x20%s',_0x1a50d2,_0xb5aec1['error'][_0x953b('0x12')]);return _0x4dc56e(_0xb5aec1[_0x953b('0x10')]['message']);}else{logger[_0x953b('0xa')](_0x953b('0xb'),_0x1a50d2,_0x953b('0xc'));_0x4dc56e(_0xb5aec1[_0x953b('0x13')][_0x953b('0x12')]);}})[_0x953b('0x14')](function(_0x173596){logger['error']('Trigger,\x20%s,\x20%s',_0x1a50d2,_0x173596);_0x3c039f(_0x173596);});});}exports[_0x953b('0x15')]=function(_0x16217e){var _0x3ef30f=this;return new Promise(function(_0x28c192,_0x4c82eb){return db[_0x953b('0x16')][_0x953b('0x17')]({'raw':_0x16217e[_0x953b('0x18')]?_0x16217e[_0x953b('0x18')][_0x953b('0x19')]===undefined?!![]:![]:!![],'where':_0x16217e['options']?_0x16217e[_0x953b('0x18')]['where']||null:null,'attributes':_0x16217e[_0x953b('0x18')]?_0x16217e[_0x953b('0x18')][_0x953b('0x1a')]||null:null,'limit':_0x16217e[_0x953b('0x18')]?_0x16217e['options'][_0x953b('0x1b')]||null:null,'include':_0x16217e[_0x953b('0x18')]?_0x16217e[_0x953b('0x18')][_0x953b('0x1c')]?_['map'](_0x16217e[_0x953b('0x18')][_0x953b('0x1c')],function(_0xb615d9){return{'model':db[_0xb615d9[_0x953b('0x1d')]],'as':_0xb615d9['as'],'attributes':_0xb615d9[_0x953b('0x1a')],'include':_0xb615d9[_0x953b('0x1c')]?_['map'](_0xb615d9['include'],function(_0x17b5c4){return{'model':db[_0x17b5c4[_0x953b('0x1d')]],'as':_0x17b5c4['as'],'attributes':_0x17b5c4[_0x953b('0x1a')],'include':_0x17b5c4[_0x953b('0x1c')]?_[_0x953b('0x1e')](_0x17b5c4[_0x953b('0x1c')],function(_0x12a256){return{'model':db[_0x12a256['model']],'as':_0x12a256['as'],'attributes':_0x12a256['attributes']};}):[]};}):[]};}):[]:[]})[_0x953b('0x9')](function(_0x378f48){logger[_0x953b('0xa')](_0x953b('0x15'),_0x16217e);logger['debug'](_0x953b('0x15'),_0x16217e,JSON[_0x953b('0xf')](_0x378f48));_0x28c192(_0x378f48);})['catch'](function(_0x32d68f){logger['error'](_0x953b('0x15'),_0x32d68f[_0x953b('0x12')],_0x16217e);_0x4c82eb(_0x3ef30f['error'](0x1f4,_0x32d68f['message']));});});};exports['ShowTrigger']=function(_0x9166e7){var _0x4147fc=this;return new Promise(function(_0x4ae4d6,_0x25c07f){return db[_0x953b('0x16')][_0x953b('0x1f')]({'raw':_0x9166e7[_0x953b('0x18')]?_0x9166e7[_0x953b('0x18')][_0x953b('0x19')]===undefined?!![]:![]:!![],'where':_0x9166e7[_0x953b('0x18')]?_0x9166e7[_0x953b('0x18')][_0x953b('0x20')]||null:null,'attributes':_0x9166e7['options']?_0x9166e7[_0x953b('0x18')]['attributes']||null:null,'include':_0x9166e7[_0x953b('0x18')]?_0x9166e7['options']['include']?_[_0x953b('0x1e')](_0x9166e7[_0x953b('0x18')]['include'],function(_0x2206d4){return{'model':db[_0x2206d4[_0x953b('0x1d')]],'as':_0x2206d4['as'],'attributes':_0x2206d4[_0x953b('0x1a')],'include':_0x2206d4[_0x953b('0x1c')]?_[_0x953b('0x1e')](_0x2206d4[_0x953b('0x1c')],function(_0x5233f6){return{'model':db[_0x5233f6[_0x953b('0x1d')]],'as':_0x5233f6['as'],'attributes':_0x5233f6[_0x953b('0x1a')],'include':_0x5233f6['include']?_[_0x953b('0x1e')](_0x5233f6['include'],function(_0x27a6fb){return{'model':db[_0x27a6fb['model']],'as':_0x27a6fb['as'],'attributes':_0x27a6fb['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x9e728e){logger[_0x953b('0xa')](_0x953b('0x21'),_0x9166e7);logger[_0x953b('0xd')](_0x953b('0x21'),_0x9166e7,JSON[_0x953b('0xf')](_0x9e728e));_0x4ae4d6(_0x9e728e);})[_0x953b('0x14')](function(_0x571eb3){logger[_0x953b('0x10')](_0x953b('0x21'),_0x571eb3[_0x953b('0x12')],_0x9166e7);_0x25c07f(_0x4147fc[_0x953b('0x10')](0x1f4,_0x571eb3['message']));});});}; \ No newline at end of file +var _0xf952=['options','raw','where','limit','include','model','attributes','GetTrigger','ShowTrigger','find','map','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Trigger','findAll'];(function(_0xe4388c,_0x2abf8d){var _0x601e34=function(_0x37ed91){while(--_0x37ed91){_0xe4388c['push'](_0xe4388c['shift']());}};_0x601e34(++_0x2abf8d);}(_0xf952,0x158));var _0x2f95=function(_0x1025c2,_0x49e47b){_0x1025c2=_0x1025c2-0x0;var _0x244236=_0xf952[_0x1025c2];return _0x244236;};'use strict';var _=require(_0x2f95('0x0'));var util=require(_0x2f95('0x1'));var moment=require(_0x2f95('0x2'));var BPromise=require(_0x2f95('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2f95('0x4'));var db=require(_0x2f95('0x5'))['db'];var utils=require(_0x2f95('0x6'));var logger=require(_0x2f95('0x7'))(_0x2f95('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2f95('0x9')][_0x2f95('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5793b5,_0x3783bd,_0x17128f){return new BPromise(function(_0x400b32,_0x4b01b1){return client[_0x2f95('0xb')](_0x5793b5,_0x17128f)[_0x2f95('0xc')](function(_0x5d0d36){logger[_0x2f95('0xd')](_0x2f95('0xe'),_0x3783bd,_0x2f95('0xf'));logger[_0x2f95('0x10')](_0x2f95('0x11'),_0x3783bd,'request\x20sent',JSON[_0x2f95('0x12')](_0x5d0d36));if(_0x5d0d36[_0x2f95('0x13')]){if(_0x5d0d36[_0x2f95('0x13')][_0x2f95('0x14')]===0x1f4){logger[_0x2f95('0x13')](_0x2f95('0xe'),_0x3783bd,_0x5d0d36[_0x2f95('0x13')][_0x2f95('0x15')]);return _0x4b01b1(_0x5d0d36[_0x2f95('0x13')][_0x2f95('0x15')]);}logger[_0x2f95('0x13')](_0x2f95('0xe'),_0x3783bd,_0x5d0d36['error']['message']);return _0x400b32(_0x5d0d36[_0x2f95('0x13')][_0x2f95('0x15')]);}else{logger[_0x2f95('0xd')](_0x2f95('0xe'),_0x3783bd,_0x2f95('0xf'));_0x400b32(_0x5d0d36[_0x2f95('0x16')]['message']);}})[_0x2f95('0x17')](function(_0x818b9f){logger[_0x2f95('0x13')](_0x2f95('0xe'),_0x3783bd,_0x818b9f);_0x4b01b1(_0x818b9f);});});}exports['GetTrigger']=function(_0x7f22ed){var _0x58ec49=this;return new Promise(function(_0x166234,_0x2d17e3){return db[_0x2f95('0x18')][_0x2f95('0x19')]({'raw':_0x7f22ed[_0x2f95('0x1a')]?_0x7f22ed[_0x2f95('0x1a')][_0x2f95('0x1b')]===undefined?!![]:![]:!![],'where':_0x7f22ed[_0x2f95('0x1a')]?_0x7f22ed[_0x2f95('0x1a')][_0x2f95('0x1c')]||null:null,'attributes':_0x7f22ed[_0x2f95('0x1a')]?_0x7f22ed[_0x2f95('0x1a')]['attributes']||null:null,'limit':_0x7f22ed['options']?_0x7f22ed[_0x2f95('0x1a')][_0x2f95('0x1d')]||null:null,'include':_0x7f22ed['options']?_0x7f22ed[_0x2f95('0x1a')][_0x2f95('0x1e')]?_['map'](_0x7f22ed[_0x2f95('0x1a')][_0x2f95('0x1e')],function(_0x1cd13a){return{'model':db[_0x1cd13a[_0x2f95('0x1f')]],'as':_0x1cd13a['as'],'attributes':_0x1cd13a['attributes'],'include':_0x1cd13a['include']?_['map'](_0x1cd13a[_0x2f95('0x1e')],function(_0x1c4ef9){return{'model':db[_0x1c4ef9[_0x2f95('0x1f')]],'as':_0x1c4ef9['as'],'attributes':_0x1c4ef9[_0x2f95('0x20')],'include':_0x1c4ef9['include']?_['map'](_0x1c4ef9['include'],function(_0xa8c8a7){return{'model':db[_0xa8c8a7[_0x2f95('0x1f')]],'as':_0xa8c8a7['as'],'attributes':_0xa8c8a7[_0x2f95('0x20')]};}):[]};}):[]};}):[]:[]})[_0x2f95('0xc')](function(_0x4a28f5){logger['info'](_0x2f95('0x21'),_0x7f22ed);logger[_0x2f95('0x10')](_0x2f95('0x21'),_0x7f22ed,JSON[_0x2f95('0x12')](_0x4a28f5));_0x166234(_0x4a28f5);})[_0x2f95('0x17')](function(_0x26ed3f){logger[_0x2f95('0x13')]('GetTrigger',_0x26ed3f[_0x2f95('0x15')],_0x7f22ed);_0x2d17e3(_0x58ec49[_0x2f95('0x13')](0x1f4,_0x26ed3f[_0x2f95('0x15')]));});});};exports[_0x2f95('0x22')]=function(_0x4fdb82){var _0x52214e=this;return new Promise(function(_0x592da3,_0x2ec297){return db[_0x2f95('0x18')][_0x2f95('0x23')]({'raw':_0x4fdb82['options']?_0x4fdb82[_0x2f95('0x1a')][_0x2f95('0x1b')]===undefined?!![]:![]:!![],'where':_0x4fdb82[_0x2f95('0x1a')]?_0x4fdb82[_0x2f95('0x1a')][_0x2f95('0x1c')]||null:null,'attributes':_0x4fdb82[_0x2f95('0x1a')]?_0x4fdb82['options'][_0x2f95('0x20')]||null:null,'include':_0x4fdb82[_0x2f95('0x1a')]?_0x4fdb82[_0x2f95('0x1a')][_0x2f95('0x1e')]?_[_0x2f95('0x24')](_0x4fdb82['options']['include'],function(_0x7ef4d2){return{'model':db[_0x7ef4d2[_0x2f95('0x1f')]],'as':_0x7ef4d2['as'],'attributes':_0x7ef4d2[_0x2f95('0x20')],'include':_0x7ef4d2[_0x2f95('0x1e')]?_[_0x2f95('0x24')](_0x7ef4d2[_0x2f95('0x1e')],function(_0x1b8b03){return{'model':db[_0x1b8b03[_0x2f95('0x1f')]],'as':_0x1b8b03['as'],'attributes':_0x1b8b03[_0x2f95('0x20')],'include':_0x1b8b03['include']?_['map'](_0x1b8b03[_0x2f95('0x1e')],function(_0x11a32b){return{'model':db[_0x11a32b[_0x2f95('0x1f')]],'as':_0x11a32b['as'],'attributes':_0x11a32b['attributes']};}):[]};}):[]};}):[]:[]})[_0x2f95('0xc')](function(_0x1d68b1){logger['info'](_0x2f95('0x22'),_0x4fdb82);logger[_0x2f95('0x10')](_0x2f95('0x22'),_0x4fdb82,JSON['stringify'](_0x1d68b1));_0x592da3(_0x1d68b1);})['catch'](function(_0x4c2211){logger[_0x2f95('0x13')]('ShowTrigger',_0x4c2211[_0x2f95('0x15')],_0x4fdb82);_0x2ec297(_0x52214e[_0x2f95('0x13')](0x1f4,_0x4c2211[_0x2f95('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 24c9159..be13eae 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 _0x7dab=['util','path','connect-timeout','fs-extra','../../components/interaction/service','./trunk.controller','get','isAuthenticated','index','/:id','show','post','/:id/clone','create','update','destroy','exports','multer'];(function(_0x1f31d3,_0x111697){var _0x578c07=function(_0x8e02f){while(--_0x8e02f){_0x1f31d3['push'](_0x1f31d3['shift']());}};_0x578c07(++_0x111697);}(_0x7dab,0xfb));var _0xb7da=function(_0x5cd3b9,_0x2d212f){_0x5cd3b9=_0x5cd3b9-0x0;var _0x4881f2=_0x7dab[_0x5cd3b9];return _0x4881f2;};'use strict';var multer=require(_0xb7da('0x0'));var util=require(_0xb7da('0x1'));var path=require(_0xb7da('0x2'));var timeout=require(_0xb7da('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb7da('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb7da('0x5'));var config=require('../../config/environment');var controller=require(_0xb7da('0x6'));router[_0xb7da('0x7')]('/',auth[_0xb7da('0x8')](),controller[_0xb7da('0x9')]);router['get'](_0xb7da('0xa'),auth[_0xb7da('0x8')](),controller[_0xb7da('0xb')]);router[_0xb7da('0xc')](_0xb7da('0xd'),auth[_0xb7da('0x8')](),controller['clone']);router[_0xb7da('0xc')]('/',auth[_0xb7da('0x8')](),controller[_0xb7da('0xe')]);router['put'](_0xb7da('0xa'),auth[_0xb7da('0x8')](),controller[_0xb7da('0xf')]);router['delete'](_0xb7da('0xa'),auth[_0xb7da('0x8')](),controller[_0xb7da('0x10')]);module[_0xb7da('0x11')]=router; \ No newline at end of file +var _0xca12=['../../components/auth/service','../../config/environment','./trunk.controller','get','index','/:id','show','post','/:id/clone','isAuthenticated','clone','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x3addea,_0x5d0716){var _0x7ab4a2=function(_0x584e07){while(--_0x584e07){_0x3addea['push'](_0x3addea['shift']());}};_0x7ab4a2(++_0x5d0716);}(_0xca12,0xec));var _0x2ca1=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0xca12[_0x411017];return _0x2adeea;};'use strict';var multer=require(_0x2ca1('0x0'));var util=require(_0x2ca1('0x1'));var path=require(_0x2ca1('0x2'));var timeout=require(_0x2ca1('0x3'));var express=require(_0x2ca1('0x4'));var router=express['Router']();var fs_extra=require(_0x2ca1('0x5'));var auth=require(_0x2ca1('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2ca1('0x7'));var controller=require(_0x2ca1('0x8'));router[_0x2ca1('0x9')]('/',auth['isAuthenticated'](),controller[_0x2ca1('0xa')]);router[_0x2ca1('0x9')](_0x2ca1('0xb'),auth['isAuthenticated'](),controller[_0x2ca1('0xc')]);router[_0x2ca1('0xd')](_0x2ca1('0xe'),auth[_0x2ca1('0xf')](),controller[_0x2ca1('0x10')]);router[_0x2ca1('0xd')]('/',auth[_0x2ca1('0xf')](),controller[_0x2ca1('0x11')]);router[_0x2ca1('0x12')](_0x2ca1('0xb'),auth[_0x2ca1('0xf')](),controller[_0x2ca1('0x13')]);router['delete']('/:id',auth[_0x2ca1('0xf')](),controller[_0x2ca1('0x14')]);module[_0x2ca1('0x15')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 3abc3ce..63e0b96 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 _0x496c=['PROHIB','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','auto','yes','nonat','update','outgoing','ENUM','force_rport,comedia','setDataValue','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','originate','uas','pai','certificate','active','passive','dynamic','update,nonat','exports','STRING','name','user','peer','friend','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN'];(function(_0x2ed8f3,_0x4aa12f){var _0x525a55=function(_0x4cfb58){while(--_0x4cfb58){_0x2ed8f3['push'](_0x2ed8f3['shift']());}};_0x525a55(++_0x4aa12f);}(_0x496c,0x1e7));var _0xc496=function(_0x2c2534,_0x22571c){_0x2c2534=_0x2c2534-0x0;var _0x13dcda=_0x496c[_0x2c2534];return _0x13dcda;};'use strict';var Sequelize=require('sequelize');module[_0xc496('0x0')]={'name':{'type':Sequelize[_0xc496('0x1')],'allowNull':![],'unique':_0xc496('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('friend',_0xc496('0x3'),_0xc496('0x4')),'allowNull':![],'defaultValue':_0xc496('0x5')},'context':{'type':Sequelize[_0xc496('0x1')],'allowNull':![],'defaultValue':_0xc496('0x6')},'callingpres':{'type':Sequelize['ENUM'](_0xc496('0x7'),_0xc496('0x8'),_0xc496('0x9'),_0xc496('0xa'),_0xc496('0xb'),_0xc496('0xc'),'PROHIB_FAILED_SCREEN',_0xc496('0xd'))},'deny':{'type':Sequelize[_0xc496('0x1')]},'permit':{'type':Sequelize[_0xc496('0x1')]},'secret':{'type':Sequelize[_0xc496('0x1')]},'md5secret':{'type':Sequelize[_0xc496('0x1')]},'remotesecret':{'type':Sequelize[_0xc496('0x1')]},'transport':{'type':Sequelize[_0xc496('0x1')],'defaultValue':'udp','set':function(_0x386721){this['setDataValue'](_0xc496('0xe'),_0x386721?_0x386721[_0xc496('0xf')](','):null);},'get':function(){return this[_0xc496('0x10')]('transport')?this['getDataValue'](_0xc496('0xe'))[_0xc496('0x11')](','):null;},'comment':_0xc496('0x12')},'dtmfmode':{'type':Sequelize['ENUM']('rfc2833',_0xc496('0x13'),_0xc496('0x14'),'inband',_0xc496('0x15')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM'](_0xc496('0x16'),'no',_0xc496('0x17'),_0xc496('0x18'),_0xc496('0x19')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xc496('0x1a')](_0xc496('0x16'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xc496('0x1')]},'directmediadeny':{'type':Sequelize[_0xc496('0x1')]},'nat':{'type':Sequelize[_0xc496('0x1')],'defaultValue':_0xc496('0x1b'),'set':function(_0x31c2c5){this[_0xc496('0x1c')]('nat',_0x31c2c5?_0x31c2c5[_0xc496('0xf')](','):null);},'get':function(){return this['getDataValue'](_0xc496('0x1d'))?this[_0xc496('0x10')](_0xc496('0x1d'))['split'](','):null;},'comment':_0xc496('0x1e')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xc496('0x1')]},'pickupgroup':{'type':Sequelize[_0xc496('0x1')]},'namedpickupgroup':{'type':Sequelize[_0xc496('0x1')]},'language':{'type':Sequelize[_0xc496('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xc496('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0xc496('0x1f')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc496('0x20'),'set':function(_0x3e12f9){this['setDataValue']('allow',_0x3e12f9?_0x3e12f9[_0xc496('0xf')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xc496('0x10')](_0xc496('0x21'))?this[_0xc496('0x10')](_0xc496('0x21'))[_0xc496('0x11')](';'):null;},'comment':_0xc496('0x22')},'autoframing':{'type':Sequelize[_0xc496('0x1a')](_0xc496('0x16'),'no')},'insecure':{'type':Sequelize[_0xc496('0x1')],'defaultValue':_0xc496('0x23'),'set':function(_0x187d8d){this[_0xc496('0x1c')](_0xc496('0x24'),_0x187d8d?_0x187d8d[_0xc496('0xf')](','):null);},'get':function(){return this[_0xc496('0x10')](_0xc496('0x24'))?this['getDataValue'](_0xc496('0x24'))[_0xc496('0x11')](','):null;},'comment':_0xc496('0x25')},'trustrpid':{'type':Sequelize[_0xc496('0x1a')](_0xc496('0x16'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xc496('0x1a')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xc496('0x1a')](_0xc496('0x16'),'no',_0xc496('0x26'))},'promiscredir':{'type':Sequelize[_0xc496('0x1a')](_0xc496('0x16'),'no')},'useclientcode':{'type':Sequelize[_0xc496('0x1a')](_0xc496('0x16'),'no')},'accountcode':{'type':Sequelize[_0xc496('0x27')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0xc496('0x28')},'amaflags':{'type':Sequelize[_0xc496('0x1')]},'callcounter':{'type':Sequelize['ENUM'](_0xc496('0x16'),'no'),'defaultValue':_0xc496('0x16')},'busylevel':{'type':Sequelize[_0xc496('0x27')](0xb)},'allowoverlap':{'type':Sequelize[_0xc496('0x1a')]('yes','no')},'allowsubscribe':{'type':Sequelize[_0xc496('0x1a')](_0xc496('0x16'),'no')},'allowtransfer':{'type':Sequelize[_0xc496('0x1a')](_0xc496('0x16'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xc496('0x16'),'no')},'subscribecontext':{'type':Sequelize[_0xc496('0x1')]},'template':{'type':Sequelize[_0xc496('0x1')]},'videosupport':{'type':Sequelize[_0xc496('0x1a')](_0xc496('0x16'),'no',_0xc496('0x29')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xc496('0x27')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xc496('0x1a')](_0xc496('0x16'),'no')},'mailbox':{'type':Sequelize[_0xc496('0x1')]},'session_timers':{'type':Sequelize[_0xc496('0x1a')]('accept','refuse',_0xc496('0x2a'))},'session_expires':{'type':Sequelize[_0xc496('0x27')](0xb)},'session_minse':{'type':Sequelize[_0xc496('0x27')](0xb)},'session_refresher':{'type':Sequelize[_0xc496('0x1a')]('uac',_0xc496('0x2b')),'defaultValue':_0xc496('0x2b')},'t38pt_usertpsource':{'type':Sequelize[_0xc496('0x1')]},'regexten':{'type':Sequelize[_0xc496('0x1')]},'fromdomain':{'type':Sequelize[_0xc496('0x1')]},'fromuser':{'type':Sequelize[_0xc496('0x1')]},'port':{'type':Sequelize[_0xc496('0x27')](0x5)},'qualify':{'type':Sequelize[_0xc496('0x1a')](_0xc496('0x16'),'no'),'defaultValue':_0xc496('0x16')},'keepalive':{'type':Sequelize[_0xc496('0x27')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0xc496('0x1')]},'rtptimeout':{'type':Sequelize[_0xc496('0x27')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0xc496('0x1a')](_0xc496('0x16'),'no',_0xc496('0x2c')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xc496('0x1')]},'callbackextension':{'type':Sequelize[_0xc496('0x1')]},'timert1':{'type':Sequelize[_0xc496('0x27')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0xc496('0x27')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0xc496('0x1')]},'contactacl':{'type':Sequelize[_0xc496('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0xc496('0x1')]},'use_q850_reason':{'type':Sequelize[_0xc496('0x1')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0xc496('0x1a')](_0xc496('0x16'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xc496('0x1a')]('yes','no')},'force_avp':{'type':Sequelize[_0xc496('0x1a')]('yes','no')},'icesupport':{'type':Sequelize[_0xc496('0x1a')](_0xc496('0x16'),'no')},'dtlsenable':{'type':Sequelize[_0xc496('0x1a')](_0xc496('0x16'),'no')},'dtlsverify':{'type':Sequelize[_0xc496('0x1a')](_0xc496('0x16'),'no','fingerprint',_0xc496('0x2d'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0xc496('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0xc496('0x1')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0xc496('0x1')]},'dtlscapath':{'type':Sequelize[_0xc496('0x1')]},'dtlssetup':{'type':Sequelize['ENUM'](_0xc496('0x2e'),_0xc496('0x2f'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xc496('0x1')]},'usereqphone':{'type':Sequelize[_0xc496('0x1a')](_0xc496('0x16'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xc496('0x1')]},'recordofffeature':{'type':Sequelize[_0xc496('0x1')]},'call_limit':{'type':Sequelize[_0xc496('0x27')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xc496('0x1a')]('yes','no')},'subscribemwi':{'type':Sequelize[_0xc496('0x1a')](_0xc496('0x16'),'no')},'vmexten':{'type':Sequelize[_0xc496('0x1')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0xc496('0x1')]},'parkinglot':{'type':Sequelize[_0xc496('0x1')]},'description':{'type':Sequelize[_0xc496('0x1')]},'host':{'type':Sequelize[_0xc496('0x1')],'defaultValue':_0xc496('0x30')},'canreinvite':{'type':Sequelize['ENUM']('yes','no',_0xc496('0x17'),'update',_0xc496('0x31')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xc496('0x1')]},'otherFields':{'type':Sequelize[_0xc496('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xc496('0x1')],'defaultValue':'no'}}; \ No newline at end of file +var _0xa882=['nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','accept','refuse','originate','uac','uas','pai','certificate','active','passive','dynamic','update,nonat','sequelize','exports','STRING','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_PASSED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','udp','join','getDataValue','transport','split','rfc2833','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','setDataValue'];(function(_0x3d38ad,_0x236f52){var _0x4a9fe6=function(_0x315ced){while(--_0x315ced){_0x3d38ad['push'](_0x3d38ad['shift']());}};_0x4a9fe6(++_0x236f52);}(_0xa882,0xa9));var _0x2a88=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0xa882[_0xd0b415];return _0x2bdf2c;};'use strict';var Sequelize=require(_0x2a88('0x0'));module[_0x2a88('0x1')]={'name':{'type':Sequelize[_0x2a88('0x2')],'allowNull':![],'unique':_0x2a88('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x2a88('0x4')](_0x2a88('0x5'),_0x2a88('0x6'),_0x2a88('0x7')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x2a88('0x2')],'allowNull':![],'defaultValue':_0x2a88('0x8')},'callingpres':{'type':Sequelize['ENUM']('ALLOWED_NOT_SCREENED',_0x2a88('0x9'),'ALLOWED_FAILED_SCREEN','ALLOWED',_0x2a88('0xa'),'PROHIB_PASSED_SCREEN',_0x2a88('0xb'),'PROHIB')},'deny':{'type':Sequelize[_0x2a88('0x2')]},'permit':{'type':Sequelize[_0x2a88('0x2')]},'secret':{'type':Sequelize[_0x2a88('0x2')]},'md5secret':{'type':Sequelize[_0x2a88('0x2')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x2a88('0xc'),'set':function(_0x395f6b){this['setDataValue']('transport',_0x395f6b?_0x395f6b[_0x2a88('0xd')](','):null);},'get':function(){return this[_0x2a88('0xe')]('transport')?this[_0x2a88('0xe')](_0x2a88('0xf'))[_0x2a88('0x10')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x2a88('0x4')](_0x2a88('0x11'),'info',_0x2a88('0x12'),_0x2a88('0x13'),_0x2a88('0x14')),'defaultValue':_0x2a88('0x11')},'directmedia':{'type':Sequelize[_0x2a88('0x4')](_0x2a88('0x15'),'no',_0x2a88('0x16'),_0x2a88('0x17'),_0x2a88('0x18')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x2a88('0x4')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x2a88('0x2')]},'directmediadeny':{'type':Sequelize[_0x2a88('0x2')]},'nat':{'type':Sequelize[_0x2a88('0x2')],'defaultValue':_0x2a88('0x19'),'set':function(_0x5a0889){this[_0x2a88('0x1a')](_0x2a88('0x1b'),_0x5a0889?_0x5a0889[_0x2a88('0xd')](','):null);},'get':function(){return this[_0x2a88('0xe')](_0x2a88('0x1b'))?this[_0x2a88('0xe')](_0x2a88('0x1b'))[_0x2a88('0x10')](','):null;},'comment':_0x2a88('0x1c')},'callgroup':{'type':Sequelize[_0x2a88('0x2')]},'namedcallgroup':{'type':Sequelize[_0x2a88('0x2')]},'pickupgroup':{'type':Sequelize[_0x2a88('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x2a88('0x2')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x2a88('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x2a88('0x2')],'defaultValue':_0x2a88('0x1d')},'allow':{'type':Sequelize[_0x2a88('0x2')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x518f74){this[_0x2a88('0x1a')](_0x2a88('0x1e'),_0x518f74?_0x518f74['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this['getDataValue']('allow')?this[_0x2a88('0xe')]('allow')[_0x2a88('0x10')](';'):null;},'comment':_0x2a88('0x1f')},'autoframing':{'type':Sequelize['ENUM'](_0x2a88('0x15'),'no')},'insecure':{'type':Sequelize[_0x2a88('0x2')],'defaultValue':_0x2a88('0x20'),'set':function(_0x2948f7){this[_0x2a88('0x1a')](_0x2a88('0x21'),_0x2948f7?_0x2948f7[_0x2a88('0xd')](','):null);},'get':function(){return this[_0x2a88('0xe')]('insecure')?this['getDataValue']('insecure')['split'](','):null;},'comment':_0x2a88('0x22')},'trustrpid':{'type':Sequelize['ENUM'](_0x2a88('0x15'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x2a88('0x4')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x2a88('0x15'),'no',_0x2a88('0x23'))},'promiscredir':{'type':Sequelize[_0x2a88('0x4')]('yes','no')},'useclientcode':{'type':Sequelize[_0x2a88('0x4')](_0x2a88('0x15'),'no')},'accountcode':{'type':Sequelize[_0x2a88('0x24')](0xb)},'setvar':{'type':Sequelize[_0x2a88('0x2')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0x2a88('0x25')},'amaflags':{'type':Sequelize[_0x2a88('0x2')]},'callcounter':{'type':Sequelize[_0x2a88('0x4')](_0x2a88('0x15'),'no'),'defaultValue':_0x2a88('0x15')},'busylevel':{'type':Sequelize[_0x2a88('0x24')](0xb)},'allowoverlap':{'type':Sequelize[_0x2a88('0x4')](_0x2a88('0x15'),'no')},'allowsubscribe':{'type':Sequelize[_0x2a88('0x4')](_0x2a88('0x15'),'no')},'allowtransfer':{'type':Sequelize[_0x2a88('0x4')](_0x2a88('0x15'),'no')},'ignoresdpversion':{'type':Sequelize[_0x2a88('0x4')](_0x2a88('0x15'),'no')},'subscribecontext':{'type':Sequelize[_0x2a88('0x2')]},'template':{'type':Sequelize[_0x2a88('0x2')]},'videosupport':{'type':Sequelize[_0x2a88('0x4')](_0x2a88('0x15'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x2a88('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no')},'mailbox':{'type':Sequelize[_0x2a88('0x2')]},'session_timers':{'type':Sequelize[_0x2a88('0x4')](_0x2a88('0x26'),_0x2a88('0x27'),_0x2a88('0x28'))},'session_expires':{'type':Sequelize[_0x2a88('0x24')](0xb)},'session_minse':{'type':Sequelize[_0x2a88('0x24')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0x2a88('0x29'),_0x2a88('0x2a')),'defaultValue':_0x2a88('0x2a')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0x2a88('0x2')]},'fromdomain':{'type':Sequelize[_0x2a88('0x2')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x2a88('0x24')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0x2a88('0x15'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x2a88('0x24')](0xb)},'defaultip':{'type':Sequelize[_0x2a88('0x2')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x2a88('0x24')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0x2a88('0x4')](_0x2a88('0x15'),'no',_0x2a88('0x2b')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x2a88('0x2')]},'callbackextension':{'type':Sequelize[_0x2a88('0x2')]},'timert1':{'type':Sequelize[_0x2a88('0x24')](0xb)},'timerb':{'type':Sequelize[_0x2a88('0x24')](0xb)},'qualifyfreq':{'type':Sequelize[_0x2a88('0x24')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0x2a88('0x2')]},'use_q850_reason':{'type':Sequelize[_0x2a88('0x2')]},'maxforwards':{'type':Sequelize[_0x2a88('0x24')](0xb)},'encryption':{'type':Sequelize[_0x2a88('0x4')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x2a88('0x4')](_0x2a88('0x15'),'no')},'force_avp':{'type':Sequelize[_0x2a88('0x4')]('yes','no')},'icesupport':{'type':Sequelize[_0x2a88('0x4')](_0x2a88('0x15'),'no')},'dtlsenable':{'type':Sequelize['ENUM']('yes','no')},'dtlsverify':{'type':Sequelize['ENUM']('yes','no','fingerprint',_0x2a88('0x2c'))},'dtlsrekey':{'type':Sequelize[_0x2a88('0x24')](0xb)},'dtlscertfile':{'type':Sequelize[_0x2a88('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x2a88('0x2')]},'dtlscipher':{'type':Sequelize[_0x2a88('0x2')]},'dtlscafile':{'type':Sequelize[_0x2a88('0x2')]},'dtlscapath':{'type':Sequelize[_0x2a88('0x2')]},'dtlssetup':{'type':Sequelize[_0x2a88('0x4')](_0x2a88('0x2d'),_0x2a88('0x2e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x2a88('0x2')]},'usereqphone':{'type':Sequelize[_0x2a88('0x4')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x2a88('0x2')]},'recordofffeature':{'type':Sequelize[_0x2a88('0x2')]},'call_limit':{'type':Sequelize[_0x2a88('0x24')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0x2a88('0x15'),'no')},'subscribemwi':{'type':Sequelize['ENUM']('yes','no')},'vmexten':{'type':Sequelize[_0x2a88('0x2')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0x2a88('0x2')]},'parkinglot':{'type':Sequelize[_0x2a88('0x2')]},'description':{'type':Sequelize[_0x2a88('0x2')]},'host':{'type':Sequelize[_0x2a88('0x2')],'defaultValue':_0x2a88('0x2f')},'canreinvite':{'type':Sequelize[_0x2a88('0x4')](_0x2a88('0x15'),'no',_0x2a88('0x16'),'update',_0x2a88('0x30')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x2a88('0x2')]},'otherFields':{'type':Sequelize[_0x2a88('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x2a88('0x2')],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index 4e025d2..250c8c9 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 _0x6f0d=['server/files/templates/registry.ejs','utf8','render','writeFileSync','registry','Reload','chan_sip.so','user','UserProfileSection','autoAssociation','/etc/asterisk/sip_xcally_trunks.conf','/etc/asterisk/sip_xcally_registers.conf','destroy','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','get','Trunks','UserProfileResource','end','stack','name','send','index','map','Trunk','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','clone','rawAttributes','find','updatedAt','body','omit','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','root','server/files/templates/trunk.ejs','join'];(function(_0x569b9d,_0x534a89){var _0x37f0ce=function(_0x3a161c){while(--_0x3a161c){_0x569b9d['push'](_0x569b9d['shift']());}};_0x37f0ce(++_0x534a89);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x9e4fe7,_0x200073){_0x9e4fe7=_0x9e4fe7-0x0;var _0x205691=_0x6f0d[_0x9e4fe7];return _0x205691;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd6f0('0x0'));var zipdir=require(_0xd6f0('0x1'));var jsonpatch=require(_0xd6f0('0x2'));var rp=require(_0xd6f0('0x3'));var moment=require('moment');var BPromise=require(_0xd6f0('0x4'));var Mustache=require(_0xd6f0('0x5'));var util=require(_0xd6f0('0x6'));var path=require(_0xd6f0('0x7'));var sox=require(_0xd6f0('0x8'));var csv=require('to-csv');var ejs=require(_0xd6f0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd6f0('0xa'));var squel=require(_0xd6f0('0xb'));var crypto=require(_0xd6f0('0xc'));var jsforce=require(_0xd6f0('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd6f0('0xe'));var Papa=require(_0xd6f0('0xf'));var Redis=require(_0xd6f0('0x10'));var authService=require(_0xd6f0('0x11'));var qs=require(_0xd6f0('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd6f0('0x13'));var logger=require(_0xd6f0('0x14'))(_0xd6f0('0x15'));var utils=require(_0xd6f0('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd6f0('0x17'));var db=require(_0xd6f0('0x18'))['db'];var jayson=require(_0xd6f0('0x19'));var client=jayson[_0xd6f0('0x1a')][_0xd6f0('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x409549,_0x2bf5b8,_0x250999,_0x246dad){return new BPromise(function(_0x4ab979,_0x2b3f32){var _0x354846=_0x246dad||client;return _0x354846['request'](_0x409549,_0x250999)[_0xd6f0('0x1c')](function(_0x593abe){logger[_0xd6f0('0x1d')](_0xd6f0('0x1e'),_0x2bf5b8,_0xd6f0('0x1f'));logger[_0xd6f0('0x20')](_0xd6f0('0x21'),_0x2bf5b8,_0xd6f0('0x1f'),JSON[_0xd6f0('0x22')](_0x593abe));if(_0x593abe[_0xd6f0('0x23')]){if(_0x593abe[_0xd6f0('0x23')][_0xd6f0('0x24')]===0x1f4){logger[_0xd6f0('0x23')](_0xd6f0('0x1e'),_0x2bf5b8,_0x593abe[_0xd6f0('0x23')][_0xd6f0('0x25')]);return _0x2b3f32(_0x593abe[_0xd6f0('0x23')][_0xd6f0('0x25')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x2bf5b8,_0x593abe[_0xd6f0('0x23')][_0xd6f0('0x25')]);return _0x4ab979(_0x593abe[_0xd6f0('0x23')]['message']);}else{logger[_0xd6f0('0x1d')](_0xd6f0('0x1e'),_0x2bf5b8,'request\x20sent');_0x4ab979(_0x593abe[_0xd6f0('0x26')]['message']);}})[_0xd6f0('0x27')](function(_0x1c9d90){logger['error'](_0xd6f0('0x1e'),_0x2bf5b8,_0x1c9d90);_0x2b3f32(_0x1c9d90);});});}function respondWithStatusCode(_0x45e99c,_0x5ea2dd){_0x5ea2dd=_0x5ea2dd||0xcc;return function(_0x3dbdc3){if(_0x3dbdc3){return _0x45e99c[_0xd6f0('0x28')](_0x5ea2dd);}return _0x45e99c[_0xd6f0('0x29')](_0x5ea2dd)['end']();};}function respondWithResult(_0x2ca8bb,_0x3dc166){_0x3dc166=_0x3dc166||0xc8;return function(_0x5ecb16){if(_0x5ecb16){return _0x2ca8bb[_0xd6f0('0x29')](_0x3dc166)['json'](_0x5ecb16);}};}function respondWithFilteredResult(_0x2042d5,_0x3fb5c3){return function(_0x1630dc){if(_0x1630dc){var _0x3c1bff=typeof _0x3fb5c3[_0xd6f0('0x2a')]===_0xd6f0('0x2b')&&typeof _0x3fb5c3[_0xd6f0('0x2c')]===_0xd6f0('0x2b');var _0x48975d=_0x1630dc[_0xd6f0('0x2d')];var _0x1982d3=_0x3c1bff?0x0:_0x3fb5c3['offset'];var _0x38a3e9=_0x3c1bff?_0x1630dc[_0xd6f0('0x2d')]:_0x3fb5c3[_0xd6f0('0x2a')]+_0x3fb5c3[_0xd6f0('0x2c')];var _0x1a3967;if(_0x38a3e9>=_0x48975d){_0x38a3e9=_0x48975d;_0x1a3967=0xc8;}else{_0x1a3967=0xce;}_0x2042d5[_0xd6f0('0x29')](_0x1a3967);return _0x2042d5[_0xd6f0('0x2e')](_0xd6f0('0x2f'),_0x1982d3+'-'+_0x38a3e9+'/'+_0x48975d)[_0xd6f0('0x30')](_0x1630dc);}return null;};}function patchUpdates(_0x43f72f){return function(_0x1dff9b){try{jsonpatch[_0xd6f0('0x31')](_0x1dff9b,_0x43f72f,!![]);}catch(_0x348529){return BPromise[_0xd6f0('0x32')](_0x348529);}return _0x1dff9b[_0xd6f0('0x33')]();};}function saveUpdates(_0x2d7c90,_0x31c493){return function(_0x376890){if(_0x376890){return _0x376890[_0xd6f0('0x34')](_0x2d7c90)[_0xd6f0('0x1c')](function(_0x3906ca){return _0x3906ca;});}return null;};}function removeEntity(_0x26ab29,_0x4a8ebe){return function(_0x11124c){if(_0x11124c){return _0x11124c['destroy']()['then'](function(){var _0x43d588=_0x11124c[_0xd6f0('0x35')]({'plain':!![]});var _0x12a6fa=_0xd6f0('0x36');return db[_0xd6f0('0x37')]['destroy']({'where':{'type':_0x12a6fa,'resourceId':_0x43d588['id']}})[_0xd6f0('0x1c')](function(){return _0x11124c;});})['then'](function(){_0x26ab29[_0xd6f0('0x29')](0xcc)[_0xd6f0('0x38')]();});}};}function handleEntityNotFound(_0x42c01a,_0x1eecf0){return function(_0x518751){if(!_0x518751){_0x42c01a['sendStatus'](0x194);}return _0x518751;};}function handleError(_0x47b33d,_0x3b6463){_0x3b6463=_0x3b6463||0x1f4;return function(_0xe2958d){logger['error'](_0xe2958d[_0xd6f0('0x39')]);if(_0xe2958d['name']){delete _0xe2958d[_0xd6f0('0x3a')];}_0x47b33d[_0xd6f0('0x29')](_0x3b6463)[_0xd6f0('0x3b')](_0xe2958d);};}exports[_0xd6f0('0x3c')]=function(_0x451834,_0x3d1280){var _0x6b44fa={},_0x4fd4db={},_0x52203d={'count':0x0,'rows':[]};var _0x162537=_[_0xd6f0('0x3d')](db[_0xd6f0('0x3e')]['rawAttributes'],function(_0x59f905){return{'name':_0x59f905[_0xd6f0('0x3f')],'type':_0x59f905[_0xd6f0('0x40')][_0xd6f0('0x41')]};});_0x4fd4db[_0xd6f0('0x42')]=_[_0xd6f0('0x3d')](_0x162537,_0xd6f0('0x3a'));_0x4fd4db[_0xd6f0('0x43')]=_[_0xd6f0('0x44')](_0x451834['query']);_0x4fd4db[_0xd6f0('0x45')]=_[_0xd6f0('0x46')](_0x4fd4db[_0xd6f0('0x42')],_0x4fd4db[_0xd6f0('0x43')]);_0x6b44fa['attributes']=_[_0xd6f0('0x46')](_0x4fd4db[_0xd6f0('0x42')],qs[_0xd6f0('0x47')](_0x451834[_0xd6f0('0x43')][_0xd6f0('0x47')]));_0x6b44fa['attributes']=_0x6b44fa[_0xd6f0('0x48')][_0xd6f0('0x49')]?_0x6b44fa[_0xd6f0('0x48')]:_0x4fd4db['model'];if(!_0x451834[_0xd6f0('0x43')][_0xd6f0('0x4a')]('nolimit')){_0x6b44fa['limit']=qs[_0xd6f0('0x2c')](_0x451834[_0xd6f0('0x43')][_0xd6f0('0x2c')]);_0x6b44fa['offset']=qs[_0xd6f0('0x2a')](_0x451834[_0xd6f0('0x43')]['offset']);}_0x6b44fa[_0xd6f0('0x4b')]=qs[_0xd6f0('0x4c')](_0x451834[_0xd6f0('0x43')][_0xd6f0('0x4c')]);_0x6b44fa['where']=qs[_0xd6f0('0x45')](_[_0xd6f0('0x4d')](_0x451834[_0xd6f0('0x43')],_0x4fd4db[_0xd6f0('0x45')]),_0x162537);if(_0x451834[_0xd6f0('0x43')][_0xd6f0('0x4e')]){_0x6b44fa[_0xd6f0('0x4f')]=_[_0xd6f0('0x50')](_0x6b44fa['where'],{'$or':_[_0xd6f0('0x3d')](_0x162537,function(_0x3d42ca){if(_0x3d42ca['type']!==_0xd6f0('0x51')){var _0x39ca69={};_0x39ca69[_0x3d42ca[_0xd6f0('0x3a')]]={'$like':'%'+_0x451834[_0xd6f0('0x43')]['filter']+'%'};return _0x39ca69;}})});}_0x6b44fa=_[_0xd6f0('0x50')]({},_0x6b44fa,_0x451834[_0xd6f0('0x52')]);var _0x494542={'where':_0x6b44fa['where']};return db[_0xd6f0('0x3e')]['count'](_0x494542)[_0xd6f0('0x1c')](function(_0x61b354){_0x52203d[_0xd6f0('0x2d')]=_0x61b354;if(_0x451834['query'][_0xd6f0('0x53')]){_0x6b44fa[_0xd6f0('0x54')]=[{'all':!![]}];}return db[_0xd6f0('0x3e')][_0xd6f0('0x55')](_0x6b44fa);})[_0xd6f0('0x1c')](function(_0x4c42ce){_0x52203d[_0xd6f0('0x56')]=_0x4c42ce;return _0x52203d;})['then'](respondWithFilteredResult(_0x3d1280,_0x6b44fa))[_0xd6f0('0x27')](handleError(_0x3d1280,null));};exports[_0xd6f0('0x57')]=function(_0x2eb338,_0x1dc320){var _0x554e37={'raw':![],'where':{'id':_0x2eb338[_0xd6f0('0x58')]['id']}},_0x5ceb6b={};_0x5ceb6b[_0xd6f0('0x42')]=_['keys'](db[_0xd6f0('0x3e')]['rawAttributes']);_0x5ceb6b[_0xd6f0('0x43')]=_[_0xd6f0('0x44')](_0x2eb338[_0xd6f0('0x43')]);_0x5ceb6b[_0xd6f0('0x45')]=_[_0xd6f0('0x46')](_0x5ceb6b['model'],_0x5ceb6b[_0xd6f0('0x43')]);_0x554e37[_0xd6f0('0x48')]=_[_0xd6f0('0x46')](_0x5ceb6b[_0xd6f0('0x42')],qs[_0xd6f0('0x47')](_0x2eb338[_0xd6f0('0x43')][_0xd6f0('0x47')]));_0x554e37[_0xd6f0('0x48')]=_0x554e37['attributes'][_0xd6f0('0x49')]?_0x554e37[_0xd6f0('0x48')]:_0x5ceb6b[_0xd6f0('0x42')];if(_0x2eb338[_0xd6f0('0x43')][_0xd6f0('0x53')]){_0x554e37[_0xd6f0('0x54')]=[{'all':!![]}];}_0x554e37=_[_0xd6f0('0x50')]({},_0x554e37,_0x2eb338[_0xd6f0('0x52')]);return db[_0xd6f0('0x3e')]['find'](_0x554e37)[_0xd6f0('0x1c')](handleEntityNotFound(_0x1dc320,null))['then'](respondWithResult(_0x1dc320,null))['catch'](handleError(_0x1dc320,null));};exports[_0xd6f0('0x59')]=function(_0x55fd25,_0x539ef1){var _0x28c3c4={'where':{'id':_0x55fd25[_0xd6f0('0x58')]['id']}},_0x2d39a2={};_0x2d39a2['model']=_[_0xd6f0('0x44')](db[_0xd6f0('0x3e')][_0xd6f0('0x5a')]);_0x28c3c4['attributes']=_[_0xd6f0('0x46')](_0x2d39a2[_0xd6f0('0x42')],qs['fields'](_0x55fd25[_0xd6f0('0x43')][_0xd6f0('0x47')]));_0x28c3c4['attributes']=_0x28c3c4[_0xd6f0('0x48')][_0xd6f0('0x49')]?_0x28c3c4[_0xd6f0('0x48')]:_0x2d39a2[_0xd6f0('0x42')];if(_0x55fd25[_0xd6f0('0x43')]['includeAll']){_0x28c3c4[_0xd6f0('0x54')]=[{'all':!![]}];}_0x28c3c4=_[_0xd6f0('0x50')]({},_0x28c3c4,_0x55fd25['options']);return db[_0xd6f0('0x3e')][_0xd6f0('0x5b')](_0x28c3c4)[_0xd6f0('0x1c')](handleEntityNotFound(_0x539ef1,null))['then'](function(_0x229f19){if(_0x229f19){var _0x5d75fa=_0x229f19['get']({'plain':!![]});_0x5d75fa=qs['omit'](_0x5d75fa,['id','createdAt',_0xd6f0('0x5c')]);_0x55fd25[_0xd6f0('0x5d')]=_[_0xd6f0('0x5e')](_0x55fd25[_0xd6f0('0x5d')],['id','createdAt',_0xd6f0('0x5c')]);return db['Trunk'][_0xd6f0('0x5f')](_[_0xd6f0('0x50')](_0x5d75fa,_0x55fd25[_0xd6f0('0x5d')]),{'include':_0x55fd25['query'][_0xd6f0('0x53')]?[{'all':!![]}]:undefined})[_0xd6f0('0x1c')](function(_0x269dd7){var _0x705eb=_0x55fd25['user'][_0xd6f0('0x35')]({'plain':!![]});if(!_0x705eb)throw new Error(_0xd6f0('0x60'));if(_0x705eb[_0xd6f0('0x61')]==='user'){var _0x5bc4e7=_0x269dd7[_0xd6f0('0x35')]({'plain':!![]});var _0x1fee47=_0xd6f0('0x36');return db['UserProfileSection'][_0xd6f0('0x5b')]({'where':{'name':_0x1fee47,'userProfileId':_0x705eb[_0xd6f0('0x62')]},'raw':!![]})[_0xd6f0('0x1c')](function(_0x282e9b){if(_0x282e9b&&_0x282e9b['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x5bc4e7['name'],'resourceId':_0x5bc4e7['id'],'type':_0x282e9b[_0xd6f0('0x3a')],'sectionId':_0x282e9b['id']},{})[_0xd6f0('0x1c')](function(){return _0x269dd7;});}else{return _0x269dd7;}})[_0xd6f0('0x27')](function(_0x30cd81){logger[_0xd6f0('0x23')](_0xd6f0('0x63'),_0x30cd81);throw _0x30cd81;});}return _0x269dd7;});}})[_0xd6f0('0x1c')](respondWithResult(_0x539ef1,0xc9))[_0xd6f0('0x27')](handleError(_0x539ef1,null));};exports[_0xd6f0('0x5f')]=function(_0x5ad146,_0x55f96e,_0x1b9728){var _0x5af4f6;return db[_0xd6f0('0x3e')][_0xd6f0('0x5f')](_0x5ad146[_0xd6f0('0x5d')],{'raw':!![]})[_0xd6f0('0x1c')](function(_0x14384f){_0x5af4f6=_0x14384f;return db[_0xd6f0('0x3e')][_0xd6f0('0x55')]({'raw':!![]});})['then'](function(_0x3c8a3e){var _0x318a68=fs[_0xd6f0('0x64')](path['join'](config[_0xd6f0('0x65')],_0xd6f0('0x66')),'utf8');var _0xad50ac=fs[_0xd6f0('0x64')](path[_0xd6f0('0x67')](config[_0xd6f0('0x65')],_0xd6f0('0x68')),_0xd6f0('0x69'));var _0x1c6140=ejs[_0xd6f0('0x6a')](_0x318a68,{'trunks':_0x3c8a3e||[]});fs[_0xd6f0('0x6b')]('/etc/asterisk/sip_xcally_trunks.conf',_0x1c6140);if(_0x5af4f6[_0xd6f0('0x6c')]){var _0x205b6a=ejs[_0xd6f0('0x6a')](_0xad50ac,{'trunks':_0x3c8a3e||[]});fs[_0xd6f0('0x6b')]('/etc/asterisk/sip_xcally_registers.conf',_0x205b6a);}})[_0xd6f0('0x1c')](function(){return respondWithRpcPromise(_0xd6f0('0x6d'),_0xd6f0('0x5f'),{'module':_0xd6f0('0x6e')});})[_0xd6f0('0x1c')](function(){var _0x12e0e5=_0x5ad146[_0xd6f0('0x6f')][_0xd6f0('0x35')]({'plain':!![]});if(!_0x12e0e5)throw new Error(_0xd6f0('0x60'));if(_0x12e0e5[_0xd6f0('0x61')]==='user'){var _0x440d5c=_0x5af4f6[_0xd6f0('0x35')]({'plain':!![]});return db[_0xd6f0('0x70')]['find']({'where':{'name':_0xd6f0('0x36'),'userProfileId':_0x12e0e5[_0xd6f0('0x62')]},'raw':!![]})[_0xd6f0('0x1c')](function(_0x406bc7){if(_0x406bc7&&_0x406bc7[_0xd6f0('0x71')]===0x0){return db[_0xd6f0('0x37')][_0xd6f0('0x5f')]({'name':_0x440d5c[_0xd6f0('0x3a')],'resourceId':_0x440d5c['id'],'type':_0x406bc7[_0xd6f0('0x3a')],'sectionId':_0x406bc7['id']},{})[_0xd6f0('0x1c')](function(){return _0x5af4f6;});}else{return _0x5af4f6;}})[_0xd6f0('0x27')](function(_0x5b3155){logger['error'](_0xd6f0('0x63'),_0x5b3155);throw _0x5b3155;});}return _0x5af4f6;})[_0xd6f0('0x1c')](respondWithResult(_0x55f96e,0xc9))[_0xd6f0('0x27')](handleError(_0x55f96e,null));};exports[_0xd6f0('0x34')]=function(_0x1da442,_0x5a781b,_0x15143a){var _0x2d38e6;return db['Trunk'][_0xd6f0('0x5b')]({'where':{'id':_0x1da442['params']['id']}})[_0xd6f0('0x1c')](handleEntityNotFound(_0x5a781b,null))[_0xd6f0('0x1c')](saveUpdates(_0x1da442[_0xd6f0('0x5d')],null))[_0xd6f0('0x1c')](function(_0x391c2a){if(_0x391c2a){_0x2d38e6=_0x391c2a;return db['Trunk']['findAll']({'raw':!![]});}})[_0xd6f0('0x1c')](function(_0x17b320){if(_0x17b320){var _0x484124=fs[_0xd6f0('0x64')](path['join'](config['root'],_0xd6f0('0x66')),'utf8');var _0x5dc1c7=fs['readFileSync'](path['join'](config[_0xd6f0('0x65')],_0xd6f0('0x68')),_0xd6f0('0x69'));var _0xcfed18=ejs[_0xd6f0('0x6a')](_0x484124,{'trunks':_0x17b320||[]});fs[_0xd6f0('0x6b')](_0xd6f0('0x72'),_0xcfed18);var _0x381f88=ejs[_0xd6f0('0x6a')](_0x5dc1c7,{'trunks':_0x17b320||[]});fs['writeFileSync'](_0xd6f0('0x73'),_0x381f88);return respondWithRpcPromise('Reload','update',{'module':_0xd6f0('0x6e')});}return null;})[_0xd6f0('0x1c')](function(_0x397f2c){if(_0x397f2c){return _0x2d38e6;}})['then'](respondWithResult(_0x5a781b,null))[_0xd6f0('0x27')](handleError(_0x5a781b,null));};exports[_0xd6f0('0x74')]=function(_0xc0585c,_0xf7ade1,_0x41e738){var _0x202e37;return db[_0xd6f0('0x3e')][_0xd6f0('0x5b')]({'where':{'id':_0xc0585c['params']['id']}})[_0xd6f0('0x1c')](handleEntityNotFound(_0xf7ade1,null))[_0xd6f0('0x1c')](removeEntity(_0xf7ade1,null))['then'](function(){return db[_0xd6f0('0x3e')][_0xd6f0('0x55')]({'raw':!![]});})[_0xd6f0('0x1c')](function(_0x175ba6){var _0x403698=fs[_0xd6f0('0x64')](path[_0xd6f0('0x67')](config['root'],_0xd6f0('0x66')),_0xd6f0('0x69'));var _0x5c3659=fs['readFileSync'](path['join'](config['root'],_0xd6f0('0x68')),_0xd6f0('0x69'));var _0x2fdd59=ejs[_0xd6f0('0x6a')](_0x403698,{'trunks':_0x175ba6});var _0x427b95=ejs[_0xd6f0('0x6a')](_0x5c3659,{'trunks':_0x175ba6});fs['writeFileSync'](_0xd6f0('0x72'),_0x2fdd59);fs[_0xd6f0('0x6b')](_0xd6f0('0x73'),_0x427b95);return respondWithRpcPromise(_0xd6f0('0x6d'),'destroy',{'module':_0xd6f0('0x6e')});})['catch'](handleError(_0xf7ade1,null));}; \ No newline at end of file +var _0x9a19=['query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','show','include','find','clone','params','omit','updatedAt','body','createdAt','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8','root','server/files/templates/registry.ejs','/etc/asterisk/sip_xcally_trunks.conf','registry','render','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','role','autoAssociation','findAll','readFileSync','writeFileSync','Reload','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','get','Trunks','UserProfileResource','stack','name','index','map','Trunk','rawAttributes','fieldName','type'];(function(_0x2c22b5,_0x4e38a2){var _0x1728eb=function(_0x1af8ee){while(--_0x1af8ee){_0x2c22b5['push'](_0x2c22b5['shift']());}};_0x1728eb(++_0x4e38a2);}(_0x9a19,0x114));var _0x99a1=function(_0x450689,_0x3b857c){_0x450689=_0x450689-0x0;var _0x46ffb0=_0x9a19[_0x450689];return _0x46ffb0;};'use strict';var emlformat=require(_0x99a1('0x0'));var rimraf=require(_0x99a1('0x1'));var zipdir=require(_0x99a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99a1('0x3'));var moment=require(_0x99a1('0x4'));var BPromise=require(_0x99a1('0x5'));var Mustache=require(_0x99a1('0x6'));var util=require(_0x99a1('0x7'));var path=require(_0x99a1('0x8'));var sox=require(_0x99a1('0x9'));var csv=require(_0x99a1('0xa'));var ejs=require(_0x99a1('0xb'));var fs=require('fs');var fs_extra=require(_0x99a1('0xc'));var _=require(_0x99a1('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99a1('0xe'));var toCsv=require(_0x99a1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x99a1('0xf'));var authService=require(_0x99a1('0x10'));var qs=require(_0x99a1('0x11'));var as=require(_0x99a1('0x12'));var hardwareService=require(_0x99a1('0x13'));var logger=require('../../config/logger')(_0x99a1('0x14'));var utils=require(_0x99a1('0x15'));var config=require(_0x99a1('0x16'));var licenseUtil=require(_0x99a1('0x17'));var db=require(_0x99a1('0x18'))['db'];var jayson=require(_0x99a1('0x19'));var client=jayson[_0x99a1('0x1a')][_0x99a1('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0xf713b9,_0x40c19c,_0x3a865c,_0x47815e){return new BPromise(function(_0xe1a1f,_0x3c9ef4){var _0x39ee55=_0x47815e||client;return _0x39ee55['request'](_0xf713b9,_0x3a865c)[_0x99a1('0x1c')](function(_0x3e45d4){logger[_0x99a1('0x1d')](_0x99a1('0x1e'),_0x40c19c,_0x99a1('0x1f'));logger[_0x99a1('0x20')](_0x99a1('0x21'),_0x40c19c,'request\x20sent',JSON['stringify'](_0x3e45d4));if(_0x3e45d4[_0x99a1('0x22')]){if(_0x3e45d4[_0x99a1('0x22')][_0x99a1('0x23')]===0x1f4){logger[_0x99a1('0x22')](_0x99a1('0x1e'),_0x40c19c,_0x3e45d4[_0x99a1('0x22')][_0x99a1('0x24')]);return _0x3c9ef4(_0x3e45d4[_0x99a1('0x22')][_0x99a1('0x24')]);}logger[_0x99a1('0x22')](_0x99a1('0x1e'),_0x40c19c,_0x3e45d4['error'][_0x99a1('0x24')]);return _0xe1a1f(_0x3e45d4[_0x99a1('0x22')]['message']);}else{logger[_0x99a1('0x1d')]('Trunk,\x20%s,\x20%s',_0x40c19c,_0x99a1('0x1f'));_0xe1a1f(_0x3e45d4[_0x99a1('0x25')][_0x99a1('0x24')]);}})[_0x99a1('0x26')](function(_0x5a88c6){logger[_0x99a1('0x22')](_0x99a1('0x1e'),_0x40c19c,_0x5a88c6);_0x3c9ef4(_0x5a88c6);});});}function respondWithStatusCode(_0x483c17,_0x44df2d){_0x44df2d=_0x44df2d||0xcc;return function(_0x5b5dfa){if(_0x5b5dfa){return _0x483c17[_0x99a1('0x27')](_0x44df2d);}return _0x483c17[_0x99a1('0x28')](_0x44df2d)[_0x99a1('0x29')]();};}function respondWithResult(_0xdaa27d,_0x3c813){_0x3c813=_0x3c813||0xc8;return function(_0x491341){if(_0x491341){return _0xdaa27d['status'](_0x3c813)[_0x99a1('0x2a')](_0x491341);}};}function respondWithFilteredResult(_0x5dabd9,_0x5dc733){return function(_0xafea84){if(_0xafea84){var _0x440879=typeof _0x5dc733[_0x99a1('0x2b')]===_0x99a1('0x2c')&&typeof _0x5dc733[_0x99a1('0x2d')]===_0x99a1('0x2c');var _0x183037=_0xafea84['count'];var _0xf41b0d=_0x440879?0x0:_0x5dc733['offset'];var _0x255197=_0x440879?_0xafea84[_0x99a1('0x2e')]:_0x5dc733[_0x99a1('0x2b')]+_0x5dc733['limit'];var _0x371edf;if(_0x255197>=_0x183037){_0x255197=_0x183037;_0x371edf=0xc8;}else{_0x371edf=0xce;}_0x5dabd9[_0x99a1('0x28')](_0x371edf);return _0x5dabd9['set'](_0x99a1('0x2f'),_0xf41b0d+'-'+_0x255197+'/'+_0x183037)[_0x99a1('0x2a')](_0xafea84);}return null;};}function patchUpdates(_0x36aa34){return function(_0x303d1e){try{jsonpatch[_0x99a1('0x30')](_0x303d1e,_0x36aa34,!![]);}catch(_0x969f6e){return BPromise[_0x99a1('0x31')](_0x969f6e);}return _0x303d1e[_0x99a1('0x32')]();};}function saveUpdates(_0x52da8d,_0x4960e4){return function(_0x3fa342){if(_0x3fa342){return _0x3fa342['update'](_0x52da8d)[_0x99a1('0x1c')](function(_0x400581){return _0x400581;});}return null;};}function removeEntity(_0x5b1a79,_0xa5972b){return function(_0x3503d5){if(_0x3503d5){return _0x3503d5[_0x99a1('0x33')]()[_0x99a1('0x1c')](function(){var _0x13f4db=_0x3503d5[_0x99a1('0x34')]({'plain':!![]});var _0x3081cd=_0x99a1('0x35');return db[_0x99a1('0x36')][_0x99a1('0x33')]({'where':{'type':_0x3081cd,'resourceId':_0x13f4db['id']}})[_0x99a1('0x1c')](function(){return _0x3503d5;});})[_0x99a1('0x1c')](function(){_0x5b1a79[_0x99a1('0x28')](0xcc)[_0x99a1('0x29')]();});}};}function handleEntityNotFound(_0x55005e,_0x53fed5){return function(_0x46e3f2){if(!_0x46e3f2){_0x55005e[_0x99a1('0x27')](0x194);}return _0x46e3f2;};}function handleError(_0x416a36,_0x4131e0){_0x4131e0=_0x4131e0||0x1f4;return function(_0x2690bd){logger[_0x99a1('0x22')](_0x2690bd[_0x99a1('0x37')]);if(_0x2690bd['name']){delete _0x2690bd[_0x99a1('0x38')];}_0x416a36[_0x99a1('0x28')](_0x4131e0)['send'](_0x2690bd);};}exports[_0x99a1('0x39')]=function(_0x2d328c,_0x391afa){var _0x3cd1a0={},_0x430cbc={},_0x399fd4={'count':0x0,'rows':[]};var _0x30e8a9=_[_0x99a1('0x3a')](db[_0x99a1('0x3b')][_0x99a1('0x3c')],function(_0x1da3e7){return{'name':_0x1da3e7[_0x99a1('0x3d')],'type':_0x1da3e7[_0x99a1('0x3e')]['key']};});_0x430cbc['model']=_['map'](_0x30e8a9,_0x99a1('0x38'));_0x430cbc[_0x99a1('0x3f')]=_[_0x99a1('0x40')](_0x2d328c[_0x99a1('0x3f')]);_0x430cbc[_0x99a1('0x41')]=_['intersection'](_0x430cbc[_0x99a1('0x42')],_0x430cbc[_0x99a1('0x3f')]);_0x3cd1a0[_0x99a1('0x43')]=_['intersection'](_0x430cbc['model'],qs[_0x99a1('0x44')](_0x2d328c[_0x99a1('0x3f')][_0x99a1('0x44')]));_0x3cd1a0['attributes']=_0x3cd1a0[_0x99a1('0x43')][_0x99a1('0x45')]?_0x3cd1a0[_0x99a1('0x43')]:_0x430cbc[_0x99a1('0x42')];if(!_0x2d328c[_0x99a1('0x3f')][_0x99a1('0x46')](_0x99a1('0x47'))){_0x3cd1a0[_0x99a1('0x2d')]=qs[_0x99a1('0x2d')](_0x2d328c[_0x99a1('0x3f')]['limit']);_0x3cd1a0[_0x99a1('0x2b')]=qs[_0x99a1('0x2b')](_0x2d328c[_0x99a1('0x3f')]['offset']);}_0x3cd1a0[_0x99a1('0x48')]=qs['sort'](_0x2d328c[_0x99a1('0x3f')][_0x99a1('0x49')]);_0x3cd1a0[_0x99a1('0x4a')]=qs[_0x99a1('0x41')](_[_0x99a1('0x4b')](_0x2d328c[_0x99a1('0x3f')],_0x430cbc['filters']),_0x30e8a9);if(_0x2d328c[_0x99a1('0x3f')]['filter']){_0x3cd1a0[_0x99a1('0x4a')]=_[_0x99a1('0x4c')](_0x3cd1a0[_0x99a1('0x4a')],{'$or':_[_0x99a1('0x3a')](_0x30e8a9,function(_0x3a0b44){if(_0x3a0b44[_0x99a1('0x3e')]!==_0x99a1('0x4d')){var _0x3861b6={};_0x3861b6[_0x3a0b44[_0x99a1('0x38')]]={'$like':'%'+_0x2d328c[_0x99a1('0x3f')][_0x99a1('0x4e')]+'%'};return _0x3861b6;}})});}_0x3cd1a0=_['merge']({},_0x3cd1a0,_0x2d328c[_0x99a1('0x4f')]);var _0x330e3b={'where':_0x3cd1a0['where']};return db[_0x99a1('0x3b')][_0x99a1('0x2e')](_0x330e3b)[_0x99a1('0x1c')](function(_0x2e377b){_0x399fd4[_0x99a1('0x2e')]=_0x2e377b;if(_0x2d328c[_0x99a1('0x3f')][_0x99a1('0x50')]){_0x3cd1a0['include']=[{'all':!![]}];}return db[_0x99a1('0x3b')]['findAll'](_0x3cd1a0);})[_0x99a1('0x1c')](function(_0x269798){_0x399fd4['rows']=_0x269798;return _0x399fd4;})['then'](respondWithFilteredResult(_0x391afa,_0x3cd1a0))[_0x99a1('0x26')](handleError(_0x391afa,null));};exports[_0x99a1('0x51')]=function(_0x462c15,_0x4519fb){var _0xee2b1b={'raw':![],'where':{'id':_0x462c15['params']['id']}},_0x597836={};_0x597836['model']=_[_0x99a1('0x40')](db[_0x99a1('0x3b')][_0x99a1('0x3c')]);_0x597836[_0x99a1('0x3f')]=_[_0x99a1('0x40')](_0x462c15[_0x99a1('0x3f')]);_0x597836[_0x99a1('0x41')]=_['intersection'](_0x597836[_0x99a1('0x42')],_0x597836[_0x99a1('0x3f')]);_0xee2b1b[_0x99a1('0x43')]=_['intersection'](_0x597836[_0x99a1('0x42')],qs['fields'](_0x462c15['query'][_0x99a1('0x44')]));_0xee2b1b[_0x99a1('0x43')]=_0xee2b1b[_0x99a1('0x43')][_0x99a1('0x45')]?_0xee2b1b[_0x99a1('0x43')]:_0x597836[_0x99a1('0x42')];if(_0x462c15[_0x99a1('0x3f')][_0x99a1('0x50')]){_0xee2b1b[_0x99a1('0x52')]=[{'all':!![]}];}_0xee2b1b=_['merge']({},_0xee2b1b,_0x462c15[_0x99a1('0x4f')]);return db['Trunk'][_0x99a1('0x53')](_0xee2b1b)[_0x99a1('0x1c')](handleEntityNotFound(_0x4519fb,null))['then'](respondWithResult(_0x4519fb,null))[_0x99a1('0x26')](handleError(_0x4519fb,null));};exports[_0x99a1('0x54')]=function(_0x469e10,_0x2b2d63){var _0x2800d5={'where':{'id':_0x469e10[_0x99a1('0x55')]['id']}},_0x1bff78={};_0x1bff78[_0x99a1('0x42')]=_[_0x99a1('0x40')](db[_0x99a1('0x3b')][_0x99a1('0x3c')]);_0x2800d5[_0x99a1('0x43')]=_['intersection'](_0x1bff78['model'],qs[_0x99a1('0x44')](_0x469e10[_0x99a1('0x3f')][_0x99a1('0x44')]));_0x2800d5[_0x99a1('0x43')]=_0x2800d5[_0x99a1('0x43')]['length']?_0x2800d5[_0x99a1('0x43')]:_0x1bff78[_0x99a1('0x42')];if(_0x469e10['query'][_0x99a1('0x50')]){_0x2800d5[_0x99a1('0x52')]=[{'all':!![]}];}_0x2800d5=_[_0x99a1('0x4c')]({},_0x2800d5,_0x469e10[_0x99a1('0x4f')]);return db[_0x99a1('0x3b')]['find'](_0x2800d5)[_0x99a1('0x1c')](handleEntityNotFound(_0x2b2d63,null))[_0x99a1('0x1c')](function(_0x1bb1cb){if(_0x1bb1cb){var _0x22811f=_0x1bb1cb[_0x99a1('0x34')]({'plain':!![]});_0x22811f=qs[_0x99a1('0x56')](_0x22811f,['id','createdAt',_0x99a1('0x57')]);_0x469e10[_0x99a1('0x58')]=_['omit'](_0x469e10[_0x99a1('0x58')],['id',_0x99a1('0x59'),_0x99a1('0x57')]);return db[_0x99a1('0x3b')][_0x99a1('0x5a')](_['merge'](_0x22811f,_0x469e10[_0x99a1('0x58')]),{'include':_0x469e10['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x38ce3c){var _0x3f7c16=_0x469e10['user']['get']({'plain':!![]});if(!_0x3f7c16)throw new Error(_0x99a1('0x5b'));if(_0x3f7c16['role']===_0x99a1('0x5c')){var _0x263db3=_0x38ce3c[_0x99a1('0x34')]({'plain':!![]});var _0x180c1e='Trunks';return db[_0x99a1('0x5d')][_0x99a1('0x53')]({'where':{'name':_0x180c1e,'userProfileId':_0x3f7c16[_0x99a1('0x5e')]},'raw':!![]})['then'](function(_0x3a62c6){if(_0x3a62c6&&_0x3a62c6['autoAssociation']===0x0){return db[_0x99a1('0x36')][_0x99a1('0x5a')]({'name':_0x263db3[_0x99a1('0x38')],'resourceId':_0x263db3['id'],'type':_0x3a62c6[_0x99a1('0x38')],'sectionId':_0x3a62c6['id']},{})[_0x99a1('0x1c')](function(){return _0x38ce3c;});}else{return _0x38ce3c;}})['catch'](function(_0x4d37f8){logger['error'](_0x99a1('0x5f'),_0x4d37f8);throw _0x4d37f8;});}return _0x38ce3c;});}})[_0x99a1('0x1c')](respondWithResult(_0x2b2d63,0xc9))['catch'](handleError(_0x2b2d63,null));};exports['create']=function(_0x1fe7af,_0x2f5587,_0x401c8f){var _0x509d4f;return db['Trunk'][_0x99a1('0x5a')](_0x1fe7af['body'],{'raw':!![]})[_0x99a1('0x1c')](function(_0x129690){_0x509d4f=_0x129690;return db[_0x99a1('0x3b')]['findAll']({'raw':!![]});})[_0x99a1('0x1c')](function(_0x28c7d8){var _0x4ac99e=fs['readFileSync'](path[_0x99a1('0x60')](config['root'],_0x99a1('0x61')),_0x99a1('0x62'));var _0x30a0a5=fs['readFileSync'](path[_0x99a1('0x60')](config[_0x99a1('0x63')],_0x99a1('0x64')),_0x99a1('0x62'));var _0x3d0ff6=ejs['render'](_0x4ac99e,{'trunks':_0x28c7d8||[]});fs['writeFileSync'](_0x99a1('0x65'),_0x3d0ff6);if(_0x509d4f[_0x99a1('0x66')]){var _0x1750d5=ejs[_0x99a1('0x67')](_0x30a0a5,{'trunks':_0x28c7d8||[]});fs['writeFileSync'](_0x99a1('0x68'),_0x1750d5);}})['then'](function(){return respondWithRpcPromise('Reload',_0x99a1('0x5a'),{'module':_0x99a1('0x69')});})[_0x99a1('0x1c')](function(){var _0x525969=_0x1fe7af[_0x99a1('0x5c')][_0x99a1('0x34')]({'plain':!![]});if(!_0x525969)throw new Error(_0x99a1('0x5b'));if(_0x525969[_0x99a1('0x6a')]===_0x99a1('0x5c')){var _0x4ae313=_0x509d4f[_0x99a1('0x34')]({'plain':!![]});return db[_0x99a1('0x5d')][_0x99a1('0x53')]({'where':{'name':_0x99a1('0x35'),'userProfileId':_0x525969[_0x99a1('0x5e')]},'raw':!![]})[_0x99a1('0x1c')](function(_0x5e42be){if(_0x5e42be&&_0x5e42be[_0x99a1('0x6b')]===0x0){return db[_0x99a1('0x36')][_0x99a1('0x5a')]({'name':_0x4ae313[_0x99a1('0x38')],'resourceId':_0x4ae313['id'],'type':_0x5e42be[_0x99a1('0x38')],'sectionId':_0x5e42be['id']},{})['then'](function(){return _0x509d4f;});}else{return _0x509d4f;}})[_0x99a1('0x26')](function(_0x68c944){logger[_0x99a1('0x22')](_0x99a1('0x5f'),_0x68c944);throw _0x68c944;});}return _0x509d4f;})[_0x99a1('0x1c')](respondWithResult(_0x2f5587,0xc9))[_0x99a1('0x26')](handleError(_0x2f5587,null));};exports['update']=function(_0xaa953e,_0x33d96b,_0x4a5617){var _0x56716a;return db[_0x99a1('0x3b')][_0x99a1('0x53')]({'where':{'id':_0xaa953e['params']['id']}})[_0x99a1('0x1c')](handleEntityNotFound(_0x33d96b,null))[_0x99a1('0x1c')](saveUpdates(_0xaa953e[_0x99a1('0x58')],null))[_0x99a1('0x1c')](function(_0x43156f){if(_0x43156f){_0x56716a=_0x43156f;return db[_0x99a1('0x3b')][_0x99a1('0x6c')]({'raw':!![]});}})[_0x99a1('0x1c')](function(_0x4260d7){if(_0x4260d7){var _0x3e099c=fs[_0x99a1('0x6d')](path[_0x99a1('0x60')](config[_0x99a1('0x63')],'server/files/templates/trunk.ejs'),_0x99a1('0x62'));var _0x5a9a7d=fs['readFileSync'](path[_0x99a1('0x60')](config[_0x99a1('0x63')],_0x99a1('0x64')),_0x99a1('0x62'));var _0xbbbe26=ejs[_0x99a1('0x67')](_0x3e099c,{'trunks':_0x4260d7||[]});fs[_0x99a1('0x6e')](_0x99a1('0x65'),_0xbbbe26);var _0x361ce6=ejs['render'](_0x5a9a7d,{'trunks':_0x4260d7||[]});fs[_0x99a1('0x6e')](_0x99a1('0x68'),_0x361ce6);return respondWithRpcPromise(_0x99a1('0x6f'),_0x99a1('0x70'),{'module':_0x99a1('0x69')});}return null;})[_0x99a1('0x1c')](function(_0x6dab29){if(_0x6dab29){return _0x56716a;}})[_0x99a1('0x1c')](respondWithResult(_0x33d96b,null))['catch'](handleError(_0x33d96b,null));};exports['destroy']=function(_0x51c289,_0x2dd29b,_0x353f25){var _0x53cdb3;return db[_0x99a1('0x3b')][_0x99a1('0x53')]({'where':{'id':_0x51c289[_0x99a1('0x55')]['id']}})[_0x99a1('0x1c')](handleEntityNotFound(_0x2dd29b,null))['then'](removeEntity(_0x2dd29b,null))[_0x99a1('0x1c')](function(){return db[_0x99a1('0x3b')][_0x99a1('0x6c')]({'raw':!![]});})[_0x99a1('0x1c')](function(_0x4e9fe9){var _0x24aa05=fs['readFileSync'](path['join'](config['root'],_0x99a1('0x61')),'utf8');var _0xb7744c=fs[_0x99a1('0x6d')](path[_0x99a1('0x60')](config[_0x99a1('0x63')],_0x99a1('0x64')),_0x99a1('0x62'));var _0x444e43=ejs['render'](_0x24aa05,{'trunks':_0x4e9fe9});var _0x4fcd65=ejs[_0x99a1('0x67')](_0xb7744c,{'trunks':_0x4e9fe9});fs[_0x99a1('0x6e')](_0x99a1('0x65'),_0x444e43);fs['writeFileSync'](_0x99a1('0x68'),_0x4fcd65);return respondWithRpcPromise(_0x99a1('0x6f'),_0x99a1('0x33'),{'module':'chan_sip.so'});})[_0x99a1('0x26')](handleError(_0x2dd29b,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 88748c0..89b23b7 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 _0x6d5a=['define','Trunk','tools_trunks','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports'];(function(_0x439a5d,_0x3b5d2b){var _0x475d9e=function(_0x1ac905){while(--_0x1ac905){_0x439a5d['push'](_0x439a5d['shift']());}};_0x475d9e(++_0x3b5d2b);}(_0x6d5a,0x93));var _0xa6d5=function(_0x4d952b,_0x52833e){_0x4d952b=_0x4d952b-0x0;var _0x16d71d=_0x6d5a[_0x4d952b];return _0x16d71d;};'use strict';var _=require(_0xa6d5('0x0'));var util=require(_0xa6d5('0x1'));var logger=require(_0xa6d5('0x2'))(_0xa6d5('0x3'));var moment=require(_0xa6d5('0x4'));var BPromise=require(_0xa6d5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa6d5('0x6'));var config=require(_0xa6d5('0x7'));var attributes=require('./trunk.attributes');module[_0xa6d5('0x8')]=function(_0x335010,_0x5e7a3a){return _0x335010[_0xa6d5('0x9')](_0xa6d5('0xa'),attributes,{'tableName':_0xa6d5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf60f=['request-promise','rimraf','./trunk.attributes','exports','define','Trunk','tools_trunks','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x28d628,_0x5134bf){var _0x528997=function(_0x2e1b09){while(--_0x2e1b09){_0x28d628['push'](_0x28d628['shift']());}};_0x528997(++_0x5134bf);}(_0xf60f,0x14c));var _0xff60=function(_0x6fba8f,_0x5c25bc){_0x6fba8f=_0x6fba8f-0x0;var _0x3d1ac9=_0xf60f[_0x6fba8f];return _0x3d1ac9;};'use strict';var _=require(_0xff60('0x0'));var util=require(_0xff60('0x1'));var logger=require(_0xff60('0x2'))(_0xff60('0x3'));var moment=require(_0xff60('0x4'));var BPromise=require(_0xff60('0x5'));var rp=require(_0xff60('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xff60('0x7'));var config=require('../../config/environment');var attributes=require(_0xff60('0x8'));module[_0xff60('0x9')]=function(_0x2db877,_0x5e3653){return _0x2db877[_0xff60('0xa')](_0xff60('0xb'),attributes,{'tableName':_0xff60('0xc'),'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 8b87bf5..976beca 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 _0x832d=['model','then','debug','ShowTrunk','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','info','Trunk,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','limit','include','map'];(function(_0x156c69,_0x72f880){var _0x13060d=function(_0x13c40c){while(--_0x13c40c){_0x156c69['push'](_0x156c69['shift']());}};_0x13060d(++_0x72f880);}(_0x832d,0xf2));var _0xd832=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x832d[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xd832('0x0'));var util=require(_0xd832('0x1'));var moment=require(_0xd832('0x2'));var BPromise=require(_0xd832('0x3'));var rs=require(_0xd832('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd832('0x5'))['db'];var utils=require(_0xd832('0x6'));var logger=require(_0xd832('0x7'))(_0xd832('0x8'));var config=require(_0xd832('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x15ab58,_0x5870b6,_0x7a6a59){return new BPromise(function(_0x1e68b7,_0xa25bd8){return client[_0xd832('0xa')](_0x15ab58,_0x7a6a59)['then'](function(_0xd9f128){logger[_0xd832('0xb')](_0xd832('0xc'),_0x5870b6,_0xd832('0xd'));logger['debug']('Trunk,\x20%s,\x20%s,\x20%s',_0x5870b6,'request\x20sent',JSON[_0xd832('0xe')](_0xd9f128));if(_0xd9f128[_0xd832('0xf')]){if(_0xd9f128[_0xd832('0xf')][_0xd832('0x10')]===0x1f4){logger[_0xd832('0xf')](_0xd832('0xc'),_0x5870b6,_0xd9f128[_0xd832('0xf')]['message']);return _0xa25bd8(_0xd9f128[_0xd832('0xf')][_0xd832('0x11')]);}logger[_0xd832('0xf')](_0xd832('0xc'),_0x5870b6,_0xd9f128['error'][_0xd832('0x11')]);return _0x1e68b7(_0xd9f128[_0xd832('0xf')][_0xd832('0x11')]);}else{logger['info']('Trunk,\x20%s,\x20%s',_0x5870b6,'request\x20sent');_0x1e68b7(_0xd9f128[_0xd832('0x12')][_0xd832('0x11')]);}})[_0xd832('0x13')](function(_0x3496d4){logger[_0xd832('0xf')](_0xd832('0xc'),_0x5870b6,_0x3496d4);_0xa25bd8(_0x3496d4);});});}exports[_0xd832('0x14')]=function(_0x3492cb){var _0x1b354c=this;return new Promise(function(_0x5ac60b,_0x166999){return db[_0xd832('0x15')][_0xd832('0x16')]({'raw':_0x3492cb[_0xd832('0x17')]?_0x3492cb['options'][_0xd832('0x18')]===undefined?!![]:![]:!![],'where':_0x3492cb[_0xd832('0x17')]?_0x3492cb[_0xd832('0x17')][_0xd832('0x19')]||null:null,'attributes':_0x3492cb['options']?_0x3492cb[_0xd832('0x17')][_0xd832('0x1a')]||null:null,'limit':_0x3492cb[_0xd832('0x17')]?_0x3492cb['options'][_0xd832('0x1b')]||null:null,'include':_0x3492cb[_0xd832('0x17')]?_0x3492cb['options'][_0xd832('0x1c')]?_[_0xd832('0x1d')](_0x3492cb['options'][_0xd832('0x1c')],function(_0x1db8e1){return{'model':db[_0x1db8e1[_0xd832('0x1e')]],'as':_0x1db8e1['as'],'attributes':_0x1db8e1[_0xd832('0x1a')],'include':_0x1db8e1[_0xd832('0x1c')]?_['map'](_0x1db8e1['include'],function(_0xe5f2f3){return{'model':db[_0xe5f2f3['model']],'as':_0xe5f2f3['as'],'attributes':_0xe5f2f3[_0xd832('0x1a')],'include':_0xe5f2f3[_0xd832('0x1c')]?_[_0xd832('0x1d')](_0xe5f2f3[_0xd832('0x1c')],function(_0x164208){return{'model':db[_0x164208[_0xd832('0x1e')]],'as':_0x164208['as'],'attributes':_0x164208[_0xd832('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd832('0x1f')](function(_0x186578){logger['info'](_0xd832('0x14'),_0x3492cb);logger[_0xd832('0x20')](_0xd832('0x14'),_0x3492cb,JSON[_0xd832('0xe')](_0x186578));_0x5ac60b(_0x186578);})[_0xd832('0x13')](function(_0x197178){logger[_0xd832('0xf')](_0xd832('0x14'),_0x197178['message'],_0x3492cb);_0x166999(_0x1b354c[_0xd832('0xf')](0x1f4,_0x197178[_0xd832('0x11')]));});});};exports[_0xd832('0x21')]=function(_0x529cf8){var _0x2658f6=this;return new Promise(function(_0x32a875,_0x31fcc1){return db[_0xd832('0x15')]['find']({'raw':_0x529cf8['options']?_0x529cf8[_0xd832('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x529cf8[_0xd832('0x17')]?_0x529cf8[_0xd832('0x17')][_0xd832('0x19')]||null:null,'attributes':_0x529cf8[_0xd832('0x17')]?_0x529cf8[_0xd832('0x17')][_0xd832('0x1a')]||null:null,'include':_0x529cf8['options']?_0x529cf8['options']['include']?_[_0xd832('0x1d')](_0x529cf8[_0xd832('0x17')][_0xd832('0x1c')],function(_0x38e547){return{'model':db[_0x38e547[_0xd832('0x1e')]],'as':_0x38e547['as'],'attributes':_0x38e547['attributes'],'include':_0x38e547['include']?_['map'](_0x38e547[_0xd832('0x1c')],function(_0x472d59){return{'model':db[_0x472d59[_0xd832('0x1e')]],'as':_0x472d59['as'],'attributes':_0x472d59[_0xd832('0x1a')],'include':_0x472d59[_0xd832('0x1c')]?_[_0xd832('0x1d')](_0x472d59['include'],function(_0x2da928){return{'model':db[_0x2da928[_0xd832('0x1e')]],'as':_0x2da928['as'],'attributes':_0x2da928[_0xd832('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd832('0x1f')](function(_0x257469){logger[_0xd832('0xb')](_0xd832('0x21'),_0x529cf8);logger[_0xd832('0x20')](_0xd832('0x21'),_0x529cf8,JSON['stringify'](_0x257469));_0x32a875(_0x257469);})['catch'](function(_0x443e0c){logger['error'](_0xd832('0x21'),_0x443e0c[_0xd832('0x11')],_0x529cf8);_0x31fcc1(_0x2658f6[_0xd832('0xf')](0x1f4,_0x443e0c[_0xd832('0x11')]));});});}; \ No newline at end of file +var _0xe409=['client','http','request','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','include','model','map','ShowTrunk','find','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0xe409,0x1d7));var _0x9e40=function(_0x4d7e44,_0x3e7e86){_0x4d7e44=_0x4d7e44-0x0;var _0x14b74c=_0xe409[_0x4d7e44];return _0x14b74c;};'use strict';var _=require(_0x9e40('0x0'));var util=require(_0x9e40('0x1'));var moment=require(_0x9e40('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9e40('0x3'));var db=require(_0x9e40('0x4'))['db'];var utils=require(_0x9e40('0x5'));var logger=require(_0x9e40('0x6'))(_0x9e40('0x7'));var config=require(_0x9e40('0x8'));var jayson=require(_0x9e40('0x9'));var client=jayson[_0x9e40('0xa')][_0x9e40('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b7a0e,_0x35f8e9,_0x597a27){return new BPromise(function(_0x1aec99,_0x4db7e1){return client[_0x9e40('0xc')](_0x1b7a0e,_0x597a27)[_0x9e40('0xd')](function(_0x356884){logger[_0x9e40('0xe')](_0x9e40('0xf'),_0x35f8e9,'request\x20sent');logger[_0x9e40('0x10')](_0x9e40('0x11'),_0x35f8e9,_0x9e40('0x12'),JSON[_0x9e40('0x13')](_0x356884));if(_0x356884[_0x9e40('0x14')]){if(_0x356884[_0x9e40('0x14')][_0x9e40('0x15')]===0x1f4){logger[_0x9e40('0x14')](_0x9e40('0xf'),_0x35f8e9,_0x356884['error']['message']);return _0x4db7e1(_0x356884[_0x9e40('0x14')]['message']);}logger['error'](_0x9e40('0xf'),_0x35f8e9,_0x356884[_0x9e40('0x14')][_0x9e40('0x16')]);return _0x1aec99(_0x356884[_0x9e40('0x14')][_0x9e40('0x16')]);}else{logger[_0x9e40('0xe')](_0x9e40('0xf'),_0x35f8e9,_0x9e40('0x12'));_0x1aec99(_0x356884[_0x9e40('0x17')][_0x9e40('0x16')]);}})[_0x9e40('0x18')](function(_0x4c4fbf){logger['error'](_0x9e40('0xf'),_0x35f8e9,_0x4c4fbf);_0x4db7e1(_0x4c4fbf);});});}exports[_0x9e40('0x19')]=function(_0x3e886b){var _0x2b08af=this;return new Promise(function(_0x1cd717,_0x54caad){return db[_0x9e40('0x1a')][_0x9e40('0x1b')]({'raw':_0x3e886b[_0x9e40('0x1c')]?_0x3e886b['options'][_0x9e40('0x1d')]===undefined?!![]:![]:!![],'where':_0x3e886b[_0x9e40('0x1c')]?_0x3e886b[_0x9e40('0x1c')][_0x9e40('0x1e')]||null:null,'attributes':_0x3e886b[_0x9e40('0x1c')]?_0x3e886b[_0x9e40('0x1c')][_0x9e40('0x1f')]||null:null,'limit':_0x3e886b['options']?_0x3e886b[_0x9e40('0x1c')]['limit']||null:null,'include':_0x3e886b[_0x9e40('0x1c')]?_0x3e886b[_0x9e40('0x1c')][_0x9e40('0x20')]?_['map'](_0x3e886b[_0x9e40('0x1c')][_0x9e40('0x20')],function(_0x18db00){return{'model':db[_0x18db00[_0x9e40('0x21')]],'as':_0x18db00['as'],'attributes':_0x18db00[_0x9e40('0x1f')],'include':_0x18db00['include']?_[_0x9e40('0x22')](_0x18db00[_0x9e40('0x20')],function(_0x118057){return{'model':db[_0x118057[_0x9e40('0x21')]],'as':_0x118057['as'],'attributes':_0x118057[_0x9e40('0x1f')],'include':_0x118057[_0x9e40('0x20')]?_[_0x9e40('0x22')](_0x118057[_0x9e40('0x20')],function(_0x4c1acc){return{'model':db[_0x4c1acc[_0x9e40('0x21')]],'as':_0x4c1acc['as'],'attributes':_0x4c1acc[_0x9e40('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x116a8f){logger[_0x9e40('0xe')](_0x9e40('0x19'),_0x3e886b);logger[_0x9e40('0x10')](_0x9e40('0x19'),_0x3e886b,JSON[_0x9e40('0x13')](_0x116a8f));_0x1cd717(_0x116a8f);})['catch'](function(_0x188dc0){logger['error']('GetTrunk',_0x188dc0['message'],_0x3e886b);_0x54caad(_0x2b08af['error'](0x1f4,_0x188dc0[_0x9e40('0x16')]));});});};exports[_0x9e40('0x23')]=function(_0xe44f6d){var _0x2b080a=this;return new Promise(function(_0xbd107e,_0x387590){return db[_0x9e40('0x1a')][_0x9e40('0x24')]({'raw':_0xe44f6d[_0x9e40('0x1c')]?_0xe44f6d['options']['raw']===undefined?!![]:![]:!![],'where':_0xe44f6d[_0x9e40('0x1c')]?_0xe44f6d['options']['where']||null:null,'attributes':_0xe44f6d['options']?_0xe44f6d[_0x9e40('0x1c')][_0x9e40('0x1f')]||null:null,'include':_0xe44f6d[_0x9e40('0x1c')]?_0xe44f6d[_0x9e40('0x1c')][_0x9e40('0x20')]?_[_0x9e40('0x22')](_0xe44f6d[_0x9e40('0x1c')][_0x9e40('0x20')],function(_0x50826d){return{'model':db[_0x50826d[_0x9e40('0x21')]],'as':_0x50826d['as'],'attributes':_0x50826d[_0x9e40('0x1f')],'include':_0x50826d[_0x9e40('0x20')]?_[_0x9e40('0x22')](_0x50826d[_0x9e40('0x20')],function(_0x4b2f71){return{'model':db[_0x4b2f71[_0x9e40('0x21')]],'as':_0x4b2f71['as'],'attributes':_0x4b2f71[_0x9e40('0x1f')],'include':_0x4b2f71[_0x9e40('0x20')]?_[_0x9e40('0x22')](_0x4b2f71[_0x9e40('0x20')],function(_0x2e00fa){return{'model':db[_0x2e00fa[_0x9e40('0x21')]],'as':_0x2e00fa['as'],'attributes':_0x2e00fa['attributes']};}):[]};}):[]};}):[]:[]})[_0x9e40('0xd')](function(_0x5a4ce3){logger[_0x9e40('0xe')](_0x9e40('0x23'),_0xe44f6d);logger[_0x9e40('0x10')]('ShowTrunk',_0xe44f6d,JSON[_0x9e40('0x13')](_0x5a4ce3));_0xbd107e(_0x5a4ce3);})[_0x9e40('0x18')](function(_0x4727d0){logger[_0x9e40('0x14')](_0x9e40('0x23'),_0x4727d0[_0x9e40('0x16')],_0xe44f6d);_0x387590(_0x2b080a[_0x9e40('0x14')](0x1f4,_0x4727d0[_0x9e40('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index c981f0e..a2046d7 100644 --- a/server/api/user-setting/index.js +++ b/server/api/user-setting/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe619=['express','../../components/auth/service','./user-setting.controller','/:id','isAuthenticated'];(function(_0x4472a6,_0x49fb38){var _0x3521dd=function(_0xf307cf){while(--_0xf307cf){_0x4472a6['push'](_0x4472a6['shift']());}};_0x3521dd(++_0x49fb38);}(_0xe619,0x1b8));var _0x9e61=function(_0x390d3a,_0x5eaf16){_0x390d3a=_0x390d3a-0x0;var _0x294503=_0xe619[_0x390d3a];return _0x294503;};'use strict';var express=require(_0x9e61('0x0'));var router=express['Router']();var auth=require(_0x9e61('0x1'));var controller=require(_0x9e61('0x2'));router['put'](_0x9e61('0x3'),auth[_0x9e61('0x4')](),controller['update']);module['exports']=router; \ No newline at end of file +var _0x47d3=['../../components/auth/service','./user-setting.controller','put','/:id','isAuthenticated','exports','Router'];(function(_0x3874dd,_0x1d9d9c){var _0x16e8ec=function(_0x13323e){while(--_0x13323e){_0x3874dd['push'](_0x3874dd['shift']());}};_0x16e8ec(++_0x1d9d9c);}(_0x47d3,0x92));var _0x347d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x47d3[_0x20a584];return _0x4b41a8;};'use strict';var express=require('express');var router=express[_0x347d('0x0')]();var auth=require(_0x347d('0x1'));var controller=require(_0x347d('0x2'));router[_0x347d('0x3')](_0x347d('0x4'),auth[_0x347d('0x5')](),controller['update']);module[_0x347d('0x6')]=router; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.attributes.js b/server/api/user-setting/user-setting.attributes.js index 8793893..839ac61 100644 --- a/server/api/user-setting/user-setting.attributes.js +++ b/server/api/user-setting/user-setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f86=['INTEGER','error','info','debug','ENUM','BOOLEAN','TEXT','DATE'];(function(_0x2e753d,_0x1b72fe){var _0x4d19f1=function(_0xe5d9de){while(--_0xe5d9de){_0x2e753d['push'](_0x2e753d['shift']());}};_0x4d19f1(++_0x1b72fe);}(_0x6f86,0x169));var _0x66f8=function(_0x5aaf54,_0x116458){_0x5aaf54=_0x5aaf54-0x0;var _0xfad324=_0x6f86[_0x5aaf54];return _0xfad324;};'use strict';var Sequelize=require('sequelize');const CLIENT_SIDE_LOG_LEVELS=[_0x66f8('0x0'),'warning',_0x66f8('0x1'),_0x66f8('0x2')];module['exports']={'clientSideLoggingLevel':{'type':Sequelize[_0x66f8('0x3')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x66f8('0x0'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x66f8('0x4')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x66f8('0x5')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x66f8('0x6')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x66f8('0x7')],'unique':'UserId'}}; \ No newline at end of file +var _0x96bb=['exports','ENUM','BOOLEAN','TEXT','DATE','INTEGER','UserId','sequelize','error','warning','info','debug'];(function(_0x18fb16,_0x45edbc){var _0x147b0d=function(_0x5b1b00){while(--_0x5b1b00){_0x18fb16['push'](_0x18fb16['shift']());}};_0x147b0d(++_0x45edbc);}(_0x96bb,0x8b));var _0xb96b=function(_0x3fad5a,_0x2d3b02){_0x3fad5a=_0x3fad5a-0x0;var _0x4ca713=_0x96bb[_0x3fad5a];return _0x4ca713;};'use strict';var Sequelize=require(_0xb96b('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xb96b('0x1'),_0xb96b('0x2'),_0xb96b('0x3'),_0xb96b('0x4')];module[_0xb96b('0x5')]={'clientSideLoggingLevel':{'type':Sequelize[_0xb96b('0x6')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xb96b('0x7')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xb96b('0x8')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xb96b('0x9')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xb96b('0xa')],'unique':_0xb96b('0xb')}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index c3a3f6d..fd061ec 100644 --- a/server/api/user-setting/user-setting.controller.js +++ b/server/api/user-setting/user-setting.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xce9b=['body','catch','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','socket.io-emitter','redis','register','defaults','localhost','json','update','then','sendStatus','error','stack','name','status','send','user','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting'];(function(_0x22b39b,_0x2b7d63){var _0x280e1d=function(_0xc74635){while(--_0xc74635){_0x22b39b['push'](_0x22b39b['shift']());}};_0x280e1d(++_0x2b7d63);}(_0xce9b,0xc6));var _0xbce9=function(_0x2c604e,_0x269ef6){_0x2c604e=_0x2c604e-0x0;var _0x439d53=_0xce9b[_0x2c604e];return _0x439d53;};'use strict';var _=require(_0xbce9('0x0'));var Redis=require(_0xbce9('0x1'));var logger=require(_0xbce9('0x2'))(_0xbce9('0x3'));var config=require(_0xbce9('0x4'));var db=require(_0xbce9('0x5'))['db'];var socket=require(_0xbce9('0x6'))(new Redis(config[_0xbce9('0x7')]));require('./user-setting.socket')[_0xbce9('0x8')](socket);config[_0xbce9('0x7')]=_[_0xbce9('0x9')](config[_0xbce9('0x7')],{'host':_0xbce9('0xa'),'port':0x18eb});function respondWithResult(_0x2c336a,_0x10a645){_0x10a645=_0x10a645||0xc8;return function(_0x562634){if(_0x562634){return _0x2c336a['status'](_0x10a645)[_0xbce9('0xb')](_0x562634);}};}function saveUpdates(_0x1d9a99){return function(_0x5a5542){if(_0x5a5542){return _0x5a5542[_0xbce9('0xc')](_0x1d9a99)[_0xbce9('0xd')](function(_0x572128){return _0x572128;});}return null;};}function handleEntityNotFound(_0x5b766a){return function(_0x2073ea){if(!_0x2073ea){_0x5b766a[_0xbce9('0xe')](0x194);}return _0x2073ea;};}function handleError(_0x1b980c,_0x4dc9a9){_0x4dc9a9=_0x4dc9a9||0x1f4;return function(_0x48a272){logger[_0xbce9('0xf')](_0x48a272[_0xbce9('0x10')]);if(_0x48a272[_0xbce9('0x11')]){delete _0x48a272[_0xbce9('0x11')];}_0x1b980c[_0xbce9('0x12')](_0x4dc9a9)[_0xbce9('0x13')](_0x48a272);};}exports[_0xbce9('0xc')]=function(_0x540886,_0xa6903c){if(_0x540886[_0xbce9('0x14')]['role']!==_0xbce9('0x15'))throw new Error(_0xbce9('0x16'));if(isNaN(Number(_0x540886[_0xbce9('0x17')]['id'])))throw new Error(_0xbce9('0x18'));return db[_0xbce9('0x19')]['find']({'where':{'id':_0x540886[_0xbce9('0x17')]['id']}})[_0xbce9('0xd')](handleEntityNotFound(_0xa6903c,null))[_0xbce9('0xd')](saveUpdates(_0x540886[_0xbce9('0x1a')],null))[_0xbce9('0xd')](respondWithResult(_0xa6903c,null))[_0xbce9('0x1b')](handleError(_0xa6903c,null));}; \ No newline at end of file +var _0xa37e=['Invalid\x20user\x20setting\x20id','UserSetting','body','catch','../../config/logger','api','../../config/environment','../../mysqldb','redis','register','defaults','status','json','then','stack','name','send','update','role','Unauthorized','params'];(function(_0x1b83f5,_0x14bd0d){var _0x3e783c=function(_0x1dff4f){while(--_0x1dff4f){_0x1b83f5['push'](_0x1b83f5['shift']());}};_0x3e783c(++_0x14bd0d);}(_0xa37e,0x97));var _0xea37=function(_0x3112cb,_0x13721d){_0x3112cb=_0x3112cb-0x0;var _0x5160c6=_0xa37e[_0x3112cb];return _0x5160c6;};'use strict';var _=require('lodash');var Redis=require('ioredis');var logger=require(_0xea37('0x0'))(_0xea37('0x1'));var config=require(_0xea37('0x2'));var db=require(_0xea37('0x3'))['db'];var socket=require('socket.io-emitter')(new Redis(config[_0xea37('0x4')]));require('./user-setting.socket')[_0xea37('0x5')](socket);config[_0xea37('0x4')]=_[_0xea37('0x6')](config['redis'],{'host':'localhost','port':0x18eb});function respondWithResult(_0x36c489,_0x4a9e08){_0x4a9e08=_0x4a9e08||0xc8;return function(_0x4ae081){if(_0x4ae081){return _0x36c489[_0xea37('0x7')](_0x4a9e08)[_0xea37('0x8')](_0x4ae081);}};}function saveUpdates(_0x7a16c6){return function(_0xf5a9e1){if(_0xf5a9e1){return _0xf5a9e1['update'](_0x7a16c6)[_0xea37('0x9')](function(_0x37ca45){return _0x37ca45;});}return null;};}function handleEntityNotFound(_0x8371a){return function(_0x55d4de){if(!_0x55d4de){_0x8371a['sendStatus'](0x194);}return _0x55d4de;};}function handleError(_0x9a39cd,_0x117ce1){_0x117ce1=_0x117ce1||0x1f4;return function(_0x3cd18b){logger['error'](_0x3cd18b[_0xea37('0xa')]);if(_0x3cd18b[_0xea37('0xb')]){delete _0x3cd18b[_0xea37('0xb')];}_0x9a39cd['status'](_0x117ce1)[_0xea37('0xc')](_0x3cd18b);};}exports[_0xea37('0xd')]=function(_0x5924ff,_0x41e9be){if(_0x5924ff['user'][_0xea37('0xe')]!=='admin')throw new Error(_0xea37('0xf'));if(isNaN(Number(_0x5924ff[_0xea37('0x10')]['id'])))throw new Error(_0xea37('0x11'));return db[_0xea37('0x12')]['find']({'where':{'id':_0x5924ff[_0xea37('0x10')]['id']}})['then'](handleEntityNotFound(_0x41e9be,null))['then'](saveUpdates(_0x5924ff[_0xea37('0x13')],null))['then'](respondWithResult(_0x41e9be,null))[_0xea37('0x14')](handleError(_0x41e9be,null));}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.events.js b/server/api/user-setting/user-setting.events.js index 4efde8d..711641e 100644 --- a/server/api/user-setting/user-setting.events.js +++ b/server/api/user-setting/user-setting.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfa68=['save','update','remove','emit','hasOwnProperty','exports','../../mysqldb','UserSetting','setMaxListeners'];(function(_0x50ccb7,_0x2a6015){var _0x127cc2=function(_0x51074a){while(--_0x51074a){_0x50ccb7['push'](_0x50ccb7['shift']());}};_0x127cc2(++_0x2a6015);}(_0xfa68,0x72));var _0x8fa6=function(_0xbe4326,_0x4e3c59){_0xbe4326=_0xbe4326-0x0;var _0x1d38fb=_0xfa68[_0xbe4326];return _0x1d38fb;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0x8fa6('0x0'))['db'][_0x8fa6('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x8fa6('0x2')](0x0);var events={'afterCreate':_0x8fa6('0x3'),'afterUpdate':_0x8fa6('0x4'),'afterDestroy':_0x8fa6('0x5')};function emitEvent(_0x328ecf){return function(_0x55e73e,_0x230958,_0x5607c1){UserSettingEvents[_0x8fa6('0x6')](_0x328ecf+':'+_0x55e73e['id'],_0x55e73e);UserSettingEvents[_0x8fa6('0x6')](_0x328ecf,_0x55e73e);_0x5607c1(null);};}for(var e in events){if(events[_0x8fa6('0x7')](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module[_0x8fa6('0x8')]=UserSettingEvents; \ No newline at end of file +var _0x580c=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserSetting','setMaxListeners'];(function(_0x2e24d4,_0x3cad21){var _0x4888ee=function(_0x2a5ba6){while(--_0x2a5ba6){_0x2e24d4['push'](_0x2e24d4['shift']());}};_0x4888ee(++_0x3cad21);}(_0x580c,0x151));var _0xc580=function(_0x5b922f,_0xe6759b){_0x5b922f=_0x5b922f-0x0;var _0x5427f2=_0x580c[_0x5b922f];return _0x5427f2;};'use strict';var EventEmitter=require(_0xc580('0x0'));var UserSetting=require(_0xc580('0x1'))['db'][_0xc580('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xc580('0x3')](0x0);var events={'afterCreate':_0xc580('0x4'),'afterUpdate':_0xc580('0x5'),'afterDestroy':_0xc580('0x6')};function emitEvent(_0x4f6210){return function(_0x17e689,_0x230e8f,_0x29f8c8){UserSettingEvents[_0xc580('0x7')](_0x4f6210+':'+_0x17e689['id'],_0x17e689);UserSettingEvents[_0xc580('0x7')](_0x4f6210,_0x17e689);_0x29f8c8(null);};}for(var e in events){if(events[_0xc580('0x8')](e)){var event=events[e];UserSetting[_0xc580('0x9')](e,emitEvent(event));}}module[_0xc580('0xa')]=UserSettingEvents; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.model.js b/server/api/user-setting/user-setting.model.js index 18e582c..6268ce2 100644 --- a/server/api/user-setting/user-setting.model.js +++ b/server/api/user-setting/user-setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8b29=['clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','define'];(function(_0xc36a20,_0x4c3a0d){var _0x10c139=function(_0x4bc692){while(--_0x4bc692){_0xc36a20['push'](_0xc36a20['shift']());}};_0x10c139(++_0x4c3a0d);}(_0x8b29,0xbe));var _0x98b2=function(_0x3c216e,_0x1947f8){_0x3c216e=_0x3c216e-0x0;var _0x51f24f=_0x8b29[_0x3c216e];return _0x51f24f;};'use strict';var attributes=require(_0x98b2('0x0'));module['exports']=function(_0xc35914){return _0xc35914[_0x98b2('0x1')]('UserSetting',attributes,{'tableName':'user_settings','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2363fe){if(!_0x2363fe[_0x98b2('0x2')])_0x2363fe['clientSideLoggingEnabledSince']=null;else if(_0x2363fe[_0x98b2('0x3')]===null)_0x2363fe['clientSideLoggingEnabledSince']=new Date();}}});}; \ No newline at end of file +var _0x574d=['./user-setting.attributes','exports','define','UserSetting','user_settings','clientSideLoggingEnabledSince'];(function(_0x574211,_0x14bec4){var _0x5c14cc=function(_0x21c9fc){while(--_0x21c9fc){_0x574211['push'](_0x574211['shift']());}};_0x5c14cc(++_0x14bec4);}(_0x574d,0xc0));var _0xd574=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x574d[_0x46698a];return _0x356db0;};'use strict';var attributes=require(_0xd574('0x0'));module[_0xd574('0x1')]=function(_0x2ef0b0){return _0x2ef0b0[_0xd574('0x2')](_0xd574('0x3'),attributes,{'tableName':_0xd574('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x46aec5){if(!_0x46aec5['clientSideLoggingEnabled'])_0x46aec5[_0xd574('0x5')]=null;else if(_0x46aec5[_0xd574('0x5')]===null)_0x46aec5[_0xd574('0x5')]=new Date();}}});}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.socket.js b/server/api/user-setting/user-setting.socket.js index 71f50d5..22dedf1 100644 --- a/server/api/user-setting/user-setting.socket.js +++ b/server/api/user-setting/user-setting.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x335e=['length','user-setting:','remove','update','emit','user-setting:update','user-setting:update:user-','UserId','register'];(function(_0x540c22,_0x48acfb){var _0x58c328=function(_0x5cd7de){while(--_0x5cd7de){_0x540c22['push'](_0x540c22['shift']());}};_0x58c328(++_0x48acfb);}(_0x335e,0x6e));var _0xe335=function(_0x3ee06c,_0x9bac47){_0x3ee06c=_0x3ee06c-0x0;var _0x162592=_0x335e[_0x3ee06c];return _0x162592;};'use strict';var UserSettingEvents=require('./user-setting.events');var events=['save',_0xe335('0x0'),_0xe335('0x1')];function createListener(_0x30235a,_0x26b3ea){return function(_0xe01996){_0x26b3ea[_0xe335('0x2')](_0x30235a,_0xe01996);if(_0x30235a===_0xe335('0x3')){_0x26b3ea[_0xe335('0x2')](_0xe335('0x4')+_0xe01996[_0xe335('0x5')],_0xe01996);}};}exports[_0xe335('0x6')]=function(_0x1b2139){for(var _0x18a51f=0x0,_0x10b93c=events[_0xe335('0x7')];_0x18a51f<_0x10b93c;_0x18a51f++){var _0x5ca900=events[_0x18a51f];var _0x459390=createListener(_0xe335('0x8')+_0x5ca900,_0x1b2139);UserSettingEvents['on'](_0x5ca900,_0x459390);}}; \ No newline at end of file +var _0xa677=['register','user-setting:','./user-setting.events','save','remove','user-setting:update','emit','user-setting:update:user-','UserId'];(function(_0x3c7952,_0x4e32b5){var _0x209c01=function(_0x433560){while(--_0x433560){_0x3c7952['push'](_0x3c7952['shift']());}};_0x209c01(++_0x4e32b5);}(_0xa677,0x1f1));var _0x7a67=function(_0x43b06b,_0x1929c7){_0x43b06b=_0x43b06b-0x0;var _0x2c555b=_0xa677[_0x43b06b];return _0x2c555b;};'use strict';var UserSettingEvents=require(_0x7a67('0x0'));var events=[_0x7a67('0x1'),_0x7a67('0x2'),'update'];function createListener(_0x484ef9,_0x4348f1){return function(_0x46534d){_0x4348f1['emit'](_0x484ef9,_0x46534d);if(_0x484ef9===_0x7a67('0x3')){_0x4348f1[_0x7a67('0x4')](_0x7a67('0x5')+_0x46534d[_0x7a67('0x6')],_0x46534d);}};}exports[_0x7a67('0x7')]=function(_0x581061){for(var _0xc7ad9f=0x0,_0x22d3f0=events['length'];_0xc7ad9f<_0x22d3f0;_0xc7ad9f++){var _0x5831a1=events[_0xc7ad9f];var _0x2fafd6=createListener(_0x7a67('0x8')+_0x5831a1,_0x581061);UserSettingEvents['on'](_0x5831a1,_0x2fafd6);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index bc7e7ff..de89869 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 _0x33e7=['getWhatsappInteractions','/:id/teams','/:id/lists','/:id/agents','getVoicePrefixes','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','create','bulkCreate','addQueues','diskStorage','join','root','server/files/images/','format','now','originalname','file','addAvatar','/:id/login','login','/:id/logout','logout','pause','unpause','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','/:id/fax_accounts','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','createApiKey','put','update','/:id/password','removeQueues','delete','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','/:id/sms_interactions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','messengerSoundNotification','multer','path','connect-timeout','express','Router','../../components/auth/service','./user.controller','get','/describe','isAuthenticated','/presence','/:id','show','/:id/avatar','getAvatar','getOpenTabs','/:id/contacts','/:id/queues','getQueues','/:id/queues_rt','/:id/groups','getGroups','/:id/recordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','getFaxInteractions','/:id/whatsapp/interactions'];(function(_0x2f0678,_0x143a85){var _0x49407e=function(_0x5e71fc){while(--_0x5e71fc){_0x2f0678['push'](_0x2f0678['shift']());}};_0x49407e(++_0x143a85);}(_0x33e7,0x185));var _0x733e=function(_0xaa2d60,_0x2d1ecd){_0xaa2d60=_0xaa2d60-0x0;var _0x15f9b0=_0x33e7[_0xaa2d60];return _0x15f9b0;};'use strict';var multer=require(_0x733e('0x0'));var util=require('util');var path=require(_0x733e('0x1'));var timeout=require(_0x733e('0x2'));var express=require(_0x733e('0x3'));var router=express[_0x733e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x733e('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x733e('0x6'));router[_0x733e('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x733e('0x7')](_0x733e('0x8'),auth[_0x733e('0x9')](),controller['describe']);router[_0x733e('0x7')]('/whoami',auth[_0x733e('0x9')](),controller['whoami']);router['get'](_0x733e('0xa'),auth[_0x733e('0x9')](),controller['getPresence']);router[_0x733e('0x7')](_0x733e('0xb'),auth[_0x733e('0x9')](),controller[_0x733e('0xc')]);router[_0x733e('0x7')](_0x733e('0xd'),controller[_0x733e('0xe')]);router[_0x733e('0x7')]('/:id/open_tabs',auth[_0x733e('0x9')](),controller[_0x733e('0xf')]);router[_0x733e('0x7')](_0x733e('0x10'),auth['isAuthenticated'](),controller['getContacts']);router[_0x733e('0x7')](_0x733e('0x11'),auth[_0x733e('0x9')](),controller[_0x733e('0x12')]);router[_0x733e('0x7')](_0x733e('0x13'),auth[_0x733e('0x9')](),controller['getVoiceQueuesRt']);router[_0x733e('0x7')](_0x733e('0x14'),auth['isAuthenticated'](),controller[_0x733e('0x15')]);router[_0x733e('0x7')](_0x733e('0x16'),auth[_0x733e('0x9')](),controller['getRecordings']);router[_0x733e('0x7')](_0x733e('0x17'),auth[_0x733e('0x9')](),controller[_0x733e('0x18')]);router[_0x733e('0x7')](_0x733e('0x19'),auth['isAuthenticated'](),controller[_0x733e('0x1a')]);router[_0x733e('0x7')](_0x733e('0x1b'),auth[_0x733e('0x9')](),controller[_0x733e('0x1c')]);router[_0x733e('0x7')](_0x733e('0x1d'),auth['isAuthenticated'](),controller[_0x733e('0x1e')]);router['get'](_0x733e('0x1f'),auth[_0x733e('0x9')](),controller[_0x733e('0x20')]);router[_0x733e('0x7')]('/:id/fax/interactions',auth['isAuthenticated'](),controller[_0x733e('0x21')]);router['get'](_0x733e('0x22'),auth[_0x733e('0x9')](),controller[_0x733e('0x23')]);router['get'](_0x733e('0x24'),auth[_0x733e('0x9')](),controller['getTeams']);router['get'](_0x733e('0x25'),auth[_0x733e('0x9')](),controller['getLists']);router['get'](_0x733e('0x26'),auth[_0x733e('0x9')](),controller['getAgents']);router[_0x733e('0x7')]('/:id/prefixes',auth[_0x733e('0x9')](),controller[_0x733e('0x27')]);router['get']('/:id/fax_accounts',auth['isAuthenticated'](),controller['getFaxAccounts']);router[_0x733e('0x7')](_0x733e('0x28'),auth['isAuthenticated'](),controller[_0x733e('0x29')]);router[_0x733e('0x7')](_0x733e('0x2a'),auth[_0x733e('0x9')](),controller['getOpenchannelAccounts']);router['get'](_0x733e('0x2b'),auth[_0x733e('0x9')](),controller[_0x733e('0x2c')]);router['get'](_0x733e('0x2d'),auth[_0x733e('0x9')](),controller['getChatWebsites']);router[_0x733e('0x7')]('/:id/whatsapp_accounts',auth[_0x733e('0x9')](),controller['getWhatsappAccounts']);router[_0x733e('0x7')](_0x733e('0x2e'),auth[_0x733e('0x9')](),controller[_0x733e('0x2f')]);router[_0x733e('0x7')](_0x733e('0x30'),auth[_0x733e('0x9')](),controller[_0x733e('0x31')]);router[_0x733e('0x32')](_0x733e('0x10'),auth[_0x733e('0x9')](),controller['addContacts']);router[_0x733e('0x32')]('/',auth[_0x733e('0x9')](),controller[_0x733e('0x33')]);router[_0x733e('0x32')]('/create_many',auth[_0x733e('0x9')](),controller[_0x733e('0x34')]);router[_0x733e('0x32')](_0x733e('0x11'),auth[_0x733e('0x9')](),controller[_0x733e('0x35')]);var upload=multer({'storage':multer[_0x733e('0x36')]({'destination':function(_0x1e68cd,_0x592751,_0x41d9fc){_0x41d9fc(null,path[_0x733e('0x37')](config[_0x733e('0x38')],_0x733e('0x39')));},'filename':function(_0x5dd84c,_0x53591e,_0x5f3a7f){_0x5f3a7f(null,util[_0x733e('0x3a')]('%s-%s',Date[_0x733e('0x3b')](),_0x53591e[_0x733e('0x3c')]));}})});router[_0x733e('0x32')]('/:id/avatar',upload['single'](_0x733e('0x3d')),controller[_0x733e('0x3e')]);router[_0x733e('0x32')](_0x733e('0x3f'),auth[_0x733e('0x9')](),controller[_0x733e('0x40')]);router[_0x733e('0x32')](_0x733e('0x41'),auth[_0x733e('0x9')](),controller[_0x733e('0x42')]);router['post']('/:id/pause',auth[_0x733e('0x9')](),controller[_0x733e('0x43')]);router[_0x733e('0x32')]('/:id/unpause',auth[_0x733e('0x9')](),controller[_0x733e('0x44')]);router[_0x733e('0x32')]('/:id/teams',auth[_0x733e('0x9')](),controller['addTeams']);router['post'](_0x733e('0x45'),auth[_0x733e('0x9')](),controller[_0x733e('0x46')]);router[_0x733e('0x32')](_0x733e('0x47'),auth[_0x733e('0x9')](),controller[_0x733e('0x48')]);router[_0x733e('0x32')](_0x733e('0x49'),auth[_0x733e('0x9')](),controller['addFaxInteractions']);router['post']('/:id/sms_interactions',auth[_0x733e('0x9')](),controller[_0x733e('0x4a')]);router[_0x733e('0x32')](_0x733e('0x4b'),auth[_0x733e('0x9')](),controller[_0x733e('0x4c')]);router[_0x733e('0x32')](_0x733e('0x4d'),auth[_0x733e('0x9')](),controller['addWhatsappInteractions']);router[_0x733e('0x32')](_0x733e('0x4e'),auth[_0x733e('0x9')](),controller[_0x733e('0x4f')]);router[_0x733e('0x32')](_0x733e('0x28'),auth[_0x733e('0x9')](),controller[_0x733e('0x50')]);router[_0x733e('0x32')]('/:id/openchannel_accounts',auth[_0x733e('0x9')](),controller[_0x733e('0x51')]);router['post']('/:id/sms_accounts',auth[_0x733e('0x9')](),controller[_0x733e('0x52')]);router[_0x733e('0x32')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0x733e('0x53')]);router[_0x733e('0x32')]('/:id/whatsapp_accounts',auth[_0x733e('0x9')](),controller['addWhatsappAccounts']);router[_0x733e('0x32')](_0x733e('0x30'),auth[_0x733e('0x9')](),controller[_0x733e('0x54')]);router[_0x733e('0x55')](_0x733e('0xb'),auth[_0x733e('0x9')](),controller[_0x733e('0x56')]);router[_0x733e('0x55')](_0x733e('0x57'),auth[_0x733e('0x9')](),controller['changePassword']);router['delete'](_0x733e('0x11'),auth[_0x733e('0x9')](),controller[_0x733e('0x58')]);router[_0x733e('0x59')](_0x733e('0x24'),auth['isAuthenticated'](),controller['removeTeams']);router['delete'](_0x733e('0xb'),auth[_0x733e('0x9')](),controller[_0x733e('0x5a')]);router[_0x733e('0x59')](_0x733e('0x45'),auth[_0x733e('0x9')](),controller[_0x733e('0x5b')]);router['delete'](_0x733e('0x47'),auth[_0x733e('0x9')](),controller[_0x733e('0x5c')]);router[_0x733e('0x59')]('/:id/fax_interactions',auth['isAuthenticated'](),controller[_0x733e('0x5d')]);router[_0x733e('0x59')](_0x733e('0x5e'),auth[_0x733e('0x9')](),controller[_0x733e('0x5f')]);router[_0x733e('0x59')](_0x733e('0x4b'),auth[_0x733e('0x9')](),controller[_0x733e('0x60')]);router[_0x733e('0x59')](_0x733e('0x4d'),auth[_0x733e('0x9')](),controller[_0x733e('0x61')]);router[_0x733e('0x59')]('/:id/fax_accounts',auth[_0x733e('0x9')](),controller[_0x733e('0x62')]);router[_0x733e('0x59')](_0x733e('0x28'),auth[_0x733e('0x9')](),controller[_0x733e('0x63')]);router[_0x733e('0x59')](_0x733e('0x2a'),auth['isAuthenticated'](),controller[_0x733e('0x64')]);router[_0x733e('0x59')](_0x733e('0x2b'),auth['isAuthenticated'](),controller[_0x733e('0x65')]);router[_0x733e('0x59')](_0x733e('0x2d'),auth['isAuthenticated'](),controller[_0x733e('0x66')]);router[_0x733e('0x59')]('/:id/whatsapp_accounts',auth[_0x733e('0x9')](),controller[_0x733e('0x67')]);router[_0x733e('0x59')](_0x733e('0x30'),auth[_0x733e('0x9')](),controller[_0x733e('0x68')]);router[_0x733e('0x32')]('/:id/messengerSoundNotification',auth['isAuthenticated'](),controller[_0x733e('0x69')]);module['exports']=router; \ No newline at end of file +var _0x4bab=['getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','getFaxInteractions','getWhatsappInteractions','getTeams','/:id/lists','getLists','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getSmsAccounts','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','/create_many','bulkCreate','diskStorage','join','root','server/files/images/','format','%s-%s','now','single','file','addAvatar','/:id/login','login','/:id/logout','pause','unpause','/:id/teams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/openchannel_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts','/:id/chat_websites','addChatWebsites','put','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','removeChatInteractions','removeMailInteractions','/:id/sms_interactions','removeSmsInteractions','removeOpenchannelInteractions','/:id/whatsapp_interactions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeApiKey','messengerSoundNotification','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./user.controller','get','isAuthenticated','/describe','/whoami','whoami','/presence','getPresence','/:id','show','getAvatar','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/recordings','/:id/screen_recordings'];(function(_0x20ee7b,_0x17e3a1){var _0x5a4147=function(_0x5e64f5){while(--_0x5e64f5){_0x20ee7b['push'](_0x20ee7b['shift']());}};_0x5a4147(++_0x17e3a1);}(_0x4bab,0xc8));var _0xb4ba=function(_0x2959ee,_0x142cfd){_0x2959ee=_0x2959ee-0x0;var _0xad5776=_0x4bab[_0x2959ee];return _0xad5776;};'use strict';var multer=require('multer');var util=require(_0xb4ba('0x0'));var path=require(_0xb4ba('0x1'));var timeout=require(_0xb4ba('0x2'));var express=require(_0xb4ba('0x3'));var router=express[_0xb4ba('0x4')]();var fs_extra=require(_0xb4ba('0x5'));var auth=require(_0xb4ba('0x6'));var interaction=require(_0xb4ba('0x7'));var config=require('../../config/environment');var controller=require(_0xb4ba('0x8'));router[_0xb4ba('0x9')]('/',auth[_0xb4ba('0xa')](),controller['index']);router[_0xb4ba('0x9')](_0xb4ba('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xb4ba('0xc'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0xd')]);router[_0xb4ba('0x9')](_0xb4ba('0xe'),auth['isAuthenticated'](),controller[_0xb4ba('0xf')]);router[_0xb4ba('0x9')](_0xb4ba('0x10'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x11')]);router[_0xb4ba('0x9')]('/:id/avatar',controller[_0xb4ba('0x12')]);router[_0xb4ba('0x9')]('/:id/open_tabs',auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x13')]);router[_0xb4ba('0x9')](_0xb4ba('0x14'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x15')]);router[_0xb4ba('0x9')](_0xb4ba('0x16'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x17')]);router['get'](_0xb4ba('0x18'),auth['isAuthenticated'](),controller[_0xb4ba('0x19')]);router[_0xb4ba('0x9')]('/:id/groups',auth['isAuthenticated'](),controller['getGroups']);router[_0xb4ba('0x9')](_0xb4ba('0x1a'),auth[_0xb4ba('0xa')](),controller['getRecordings']);router[_0xb4ba('0x9')](_0xb4ba('0x1b'),auth['isAuthenticated'](),controller[_0xb4ba('0x1c')]);router[_0xb4ba('0x9')](_0xb4ba('0x1d'),auth['isAuthenticated'](),controller[_0xb4ba('0x1e')]);router[_0xb4ba('0x9')](_0xb4ba('0x1f'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x20')]);router[_0xb4ba('0x9')](_0xb4ba('0x21'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x22')]);router[_0xb4ba('0x9')](_0xb4ba('0x23'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x24')]);router['get']('/:id/fax/interactions',auth['isAuthenticated'](),controller[_0xb4ba('0x25')]);router[_0xb4ba('0x9')]('/:id/whatsapp/interactions',auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x26')]);router['get']('/:id/teams',auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x27')]);router['get'](_0xb4ba('0x28'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x29')]);router[_0xb4ba('0x9')]('/:id/agents',auth['isAuthenticated'](),controller[_0xb4ba('0x2a')]);router[_0xb4ba('0x9')](_0xb4ba('0x2b'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x2c')]);router[_0xb4ba('0x9')](_0xb4ba('0x2d'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x2e')]);router['get'](_0xb4ba('0x2f'),auth['isAuthenticated'](),controller[_0xb4ba('0x30')]);router['get'](_0xb4ba('0x31'),auth[_0xb4ba('0xa')](),controller['getOpenchannelAccounts']);router[_0xb4ba('0x9')]('/:id/sms_accounts',auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x32')]);router['get']('/:id/chat_websites',auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x33')]);router[_0xb4ba('0x9')](_0xb4ba('0x34'),auth['isAuthenticated'](),controller[_0xb4ba('0x35')]);router[_0xb4ba('0x9')](_0xb4ba('0x36'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x37')]);router[_0xb4ba('0x9')](_0xb4ba('0x38'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x39')]);router[_0xb4ba('0x3a')](_0xb4ba('0x14'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x3b')]);router[_0xb4ba('0x3a')]('/',auth[_0xb4ba('0xa')](),controller['create']);router[_0xb4ba('0x3a')](_0xb4ba('0x3c'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x3d')]);router[_0xb4ba('0x3a')](_0xb4ba('0x16'),auth['isAuthenticated'](),controller['addQueues']);var upload=multer({'storage':multer[_0xb4ba('0x3e')]({'destination':function(_0x5aa4c8,_0x4c297e,_0x333daf){_0x333daf(null,path[_0xb4ba('0x3f')](config[_0xb4ba('0x40')],_0xb4ba('0x41')));},'filename':function(_0x2e29a8,_0xb907d6,_0x87cc49){_0x87cc49(null,util[_0xb4ba('0x42')](_0xb4ba('0x43'),Date[_0xb4ba('0x44')](),_0xb907d6['originalname']));}})});router[_0xb4ba('0x3a')]('/:id/avatar',upload[_0xb4ba('0x45')](_0xb4ba('0x46')),controller[_0xb4ba('0x47')]);router[_0xb4ba('0x3a')](_0xb4ba('0x48'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x49')]);router[_0xb4ba('0x3a')](_0xb4ba('0x4a'),auth[_0xb4ba('0xa')](),controller['logout']);router[_0xb4ba('0x3a')]('/:id/pause',auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x4b')]);router[_0xb4ba('0x3a')]('/:id/unpause',auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x4c')]);router[_0xb4ba('0x3a')](_0xb4ba('0x4d'),auth[_0xb4ba('0xa')](),controller['addTeams']);router[_0xb4ba('0x3a')](_0xb4ba('0x4e'),auth['isAuthenticated'](),controller[_0xb4ba('0x4f')]);router[_0xb4ba('0x3a')](_0xb4ba('0x50'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x51')]);router[_0xb4ba('0x3a')](_0xb4ba('0x52'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x53')]);router[_0xb4ba('0x3a')]('/:id/sms_interactions',auth[_0xb4ba('0xa')](),controller['addSmsInteractions']);router[_0xb4ba('0x3a')](_0xb4ba('0x54'),auth[_0xb4ba('0xa')](),controller['addOpenchannelInteractions']);router[_0xb4ba('0x3a')]('/:id/whatsapp_interactions',auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x55')]);router[_0xb4ba('0x3a')](_0xb4ba('0x2d'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x56')]);router[_0xb4ba('0x3a')](_0xb4ba('0x2f'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x57')]);router[_0xb4ba('0x3a')](_0xb4ba('0x31'),auth['isAuthenticated'](),controller[_0xb4ba('0x58')]);router['post'](_0xb4ba('0x59'),auth['isAuthenticated'](),controller[_0xb4ba('0x5a')]);router[_0xb4ba('0x3a')](_0xb4ba('0x5b'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x5c')]);router['post']('/:id/whatsapp_accounts',auth[_0xb4ba('0xa')](),controller['addWhatsappAccounts']);router[_0xb4ba('0x3a')]('/:id/api_key',auth[_0xb4ba('0xa')](),controller['createApiKey']);router[_0xb4ba('0x5d')]('/:id',auth[_0xb4ba('0xa')](),controller['update']);router[_0xb4ba('0x5d')](_0xb4ba('0x5e'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x5f')]);router[_0xb4ba('0x60')]('/:id/queues',auth['isAuthenticated'](),controller[_0xb4ba('0x61')]);router[_0xb4ba('0x60')](_0xb4ba('0x4d'),auth['isAuthenticated'](),controller[_0xb4ba('0x62')]);router[_0xb4ba('0x60')](_0xb4ba('0x10'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x63')]);router['delete'](_0xb4ba('0x4e'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x64')]);router[_0xb4ba('0x60')](_0xb4ba('0x50'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x65')]);router[_0xb4ba('0x60')](_0xb4ba('0x52'),auth[_0xb4ba('0xa')](),controller['removeFaxInteractions']);router[_0xb4ba('0x60')](_0xb4ba('0x66'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x67')]);router[_0xb4ba('0x60')]('/:id/openchannel_interactions',auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x68')]);router[_0xb4ba('0x60')](_0xb4ba('0x69'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x6a')]);router[_0xb4ba('0x60')](_0xb4ba('0x2d'),auth['isAuthenticated'](),controller[_0xb4ba('0x6b')]);router[_0xb4ba('0x60')](_0xb4ba('0x2f'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x6c')]);router[_0xb4ba('0x60')]('/:id/openchannel_accounts',auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x6d')]);router[_0xb4ba('0x60')](_0xb4ba('0x59'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x6e')]);router['delete'](_0xb4ba('0x5b'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x6f')]);router[_0xb4ba('0x60')](_0xb4ba('0x34'),auth[_0xb4ba('0xa')](),controller['removeWhatsappAccounts']);router[_0xb4ba('0x60')](_0xb4ba('0x38'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x70')]);router[_0xb4ba('0x3a')]('/:id/messengerSoundNotification',auth['isAuthenticated'](),controller[_0xb4ba('0x71')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 72f76ce..444fe45 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 _0x397f=['ENUM','admin','user','telephone','local','INTEGER','internal','accountcode','callerid','getDataValue','DATE','BOOLEAN','DEFAULT\x20PAUSE','dynamic','friend','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','join','transport','split','info','rfc2833','update','outgoing','yes','nat','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','active','passive','nonat','update,nonat','TEXT','showWebBar','wss','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','encryption','actpass','/etc/pki/tls/certs/motion.crt','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','true','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','moment','util','lodash','exports','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','STRING','fullname','format','\x22%s\x22\x20<%s>','email','toLowerCase'];(function(_0x27b3a4,_0x159e6d){var _0x54b4f0=function(_0x3794a1){while(--_0x3794a1){_0x27b3a4['push'](_0x27b3a4['shift']());}};_0x54b4f0(++_0x159e6d);}(_0x397f,0x1b3));var _0xf397=function(_0x176aaa,_0x467629){_0x176aaa=_0x176aaa-0x0;var _0x377514=_0x397f[_0x176aaa];return _0x377514;};'use strict';var Sequelize=require(_0xf397('0x0'));var moment=require(_0xf397('0x1'));var util=require(_0xf397('0x2'));var _=require(_0xf397('0x3'));module[_0xf397('0x4')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf397('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x28495f){this[_0xf397('0x6')](_0xf397('0x5'),_0x28495f);this[_0xf397('0x6')](_0xf397('0x7'),_0x28495f);},'comment':_0xf397('0x8')},'fullname':{'type':Sequelize[_0xf397('0x9')],'allowNull':![],'set':function(_0x1b1a29){this[_0xf397('0x6')](_0xf397('0xa'),_0x1b1a29);this['setDataValue']('callerid',util[_0xf397('0xb')](_0xf397('0xc'),_0x1b1a29,this['getDataValue']('internal')));}},'alias':{'type':Sequelize[_0xf397('0x9')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf397('0xd'),'validate':{'isEmail':!![]},'set':function(_0x240f3d){if(_0x240f3d){this['setDataValue']('email',_0x240f3d[_0xf397('0xe')]());}}},'role':{'type':Sequelize[_0xf397('0xf')](_0xf397('0x10'),_0xf397('0x11'),'agent',_0xf397('0x12')),'allowNull':![]},'password':{'type':Sequelize[_0xf397('0x9')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xf397('0x9')],'defaultValue':_0xf397('0x13')},'internal':{'type':Sequelize[_0xf397('0x14')](0xb),'allowNull':![],'unique':_0xf397('0x15'),'set':function(_0x24480a){this['setDataValue'](_0xf397('0x15'),_0x24480a);this[_0xf397('0x6')](_0xf397('0x16'),_0x24480a);this['setDataValue'](_0xf397('0x17'),util[_0xf397('0xb')](_0xf397('0xc'),this[_0xf397('0x18')](_0xf397('0xa')),_0x24480a));}},'salt':{'type':Sequelize[_0xf397('0x9')]},'phone':{'type':Sequelize[_0xf397('0x9')]},'mobile':{'type':Sequelize[_0xf397('0x9')]},'address':{'type':Sequelize[_0xf397('0x9')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0xf397('0x9')]},'city':{'type':Sequelize[_0xf397('0x9')]},'country':{'type':Sequelize[_0xf397('0x9')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xf397('0x19')]},'voicePause':{'type':Sequelize[_0xf397('0x1a')],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xf397('0x1a')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xf397('0x1a')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xf397('0x1a')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xf397('0x1a')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xf397('0x9')],'defaultValue':_0xf397('0x1b')},'lastPauseAt':{'type':Sequelize[_0xf397('0x19')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xf397('0x14')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xf397('0x14')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xf397('0x14')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xf397('0x1a')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xf397('0x1a')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xf397('0x14')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xf397('0x14')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xf397('0x1a')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xf397('0x14')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xf397('0x1a')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xf397('0x1a')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xf397('0x9')],'allowNull':!![]},'host':{'type':Sequelize[_0xf397('0x9')],'allowNull':!![],'defaultValue':_0xf397('0x1c')},'ipaddr':{'type':Sequelize[_0xf397('0x9')],'allowNull':!![]},'port':{'type':Sequelize[_0xf397('0x14')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xf397('0x9')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xf397('0x9')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xf397('0x9')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xf397('0xf')](_0xf397('0x1d'),_0xf397('0x11'),_0xf397('0x1e')),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize[_0xf397('0x9')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0xf397('0xf')](_0xf397('0x1f'),_0xf397('0x20'),'ALLOWED_FAILED_SCREEN',_0xf397('0x21'),_0xf397('0x22'),_0xf397('0x23'),_0xf397('0x24'),_0xf397('0x25')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0xf397('0x9')],'allowNull':!![]},'secret':{'type':Sequelize[_0xf397('0x9')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xf397('0x9')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xf397('0x9')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xf397('0x26'),'set':function(_0xd20f89){this['setDataValue']('transport',_0xd20f89?_0xd20f89[_0xf397('0x27')](','):null);},'get':function(){return this[_0xf397('0x18')](_0xf397('0x28'))?this[_0xf397('0x18')]('transport')[_0xf397('0x29')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0xf397('0xf')]('rfc2833',_0xf397('0x2a'),'shortinfo','inband','auto'),'allowNull':!![],'defaultValue':_0xf397('0x2b')},'directmedia':{'type':Sequelize[_0xf397('0xf')]('yes','no','nonat',_0xf397('0x2c'),_0xf397('0x2d')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xf397('0xf')](_0xf397('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xf397('0x9')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x94e524){this[_0xf397('0x6')](_0xf397('0x2f'),_0x94e524?_0x94e524[_0xf397('0x27')](','):null);},'get':function(){return this[_0xf397('0x18')](_0xf397('0x2f'))?this[_0xf397('0x18')](_0xf397('0x2f'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0xf397('0x9')]},'namedpickupgroup':{'type':Sequelize[_0xf397('0x9')]},'language':{'type':Sequelize[_0xf397('0x9')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xf397('0x9')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0xf397('0x9')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x5857b0){this['setDataValue'](_0xf397('0x30'),_0x5857b0?_0x5857b0[_0xf397('0x27')](';'):'ulaw;alaw;gsm');},'get':function(){return this['getDataValue'](_0xf397('0x30'))?this['getDataValue']('allow')['split'](';'):null;},'comment':_0xf397('0x31')},'autoframing':{'type':Sequelize[_0xf397('0xf')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xf397('0x9')],'allowNull':!![],'set':function(_0x3d28ce){this['setDataValue'](_0xf397('0x32'),_0x3d28ce?_0x3d28ce['join'](','):null);},'get':function(){return this[_0xf397('0x18')]('insecure')?this[_0xf397('0x18')](_0xf397('0x32'))[_0xf397('0x29')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM'](_0xf397('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xf397('0xf')](_0xf397('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xf397('0x2e'),'no',_0xf397('0x33')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xf397('0xf')](_0xf397('0x2e'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xf397('0xf')](_0xf397('0x2e'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xf397('0x14')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xf397('0x9')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xf397('0x9')],'allowNull':!![],'defaultValue':_0xf397('0x34')},'amaflags':{'type':Sequelize[_0xf397('0x9')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xf397('0xf')](_0xf397('0x2e'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xf397('0x14')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xf397('0xf')](_0xf397('0x2e'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xf397('0xf')](_0xf397('0x2e'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xf397('0xf')](_0xf397('0x2e'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xf397('0xf')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0xf397('0x9')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xf397('0xf')](_0xf397('0x2e'),'no',_0xf397('0x35')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xf397('0x14')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xf397('0xf')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xf397('0xf')](_0xf397('0x36'),_0xf397('0x37'),_0xf397('0x38')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0xf397('0x39'),_0xf397('0x3a')),'allowNull':!![],'defaultValue':_0xf397('0x3a')},'t38pt_usertpsource':{'type':Sequelize[_0xf397('0x9')],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xf397('0x9')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xf397('0x9')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':_0xf397('0x2e')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xf397('0x9')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xf397('0x9')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xf397('0x14')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xf397('0x14')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0xf397('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xf397('0x9')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0xf397('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xf397('0x14')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xf397('0x9')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xf397('0x9')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xf397('0x9')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xf397('0x9')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xf397('0x14')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xf397('0xf')](_0xf397('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0xf397('0x2e'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xf397('0xf')](_0xf397('0x2e'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xf397('0xf')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xf397('0xf')](_0xf397('0x2e'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0xf397('0x2e'),'no',_0xf397('0x3b'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xf397('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xf397('0x9')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xf397('0x9')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xf397('0x9')],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xf397('0x9')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xf397('0xf')](_0xf397('0x3c'),_0xf397('0x3d'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xf397('0x9')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0xf397('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xf397('0x9')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xf397('0x9')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xf397('0x14')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xf397('0xf')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xf397('0xf')](_0xf397('0x2e'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xf397('0x9')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xf397('0x9')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0xf397('0x2e'),'no',_0xf397('0x3e'),_0xf397('0x2c'),_0xf397('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xf397('0x1a')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xf397('0x9')]},'resetPasswordExpires':{'type':Sequelize[_0xf397('0x19')]},'passwordResetAt':{'type':Sequelize[_0xf397('0x19')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xf397('0x40')]},'showWebBar':{'type':Sequelize[_0xf397('0x14')],'defaultValue':0x0,'set':function(_0x1b6b38){this['setDataValue'](_0xf397('0x41'),_0x1b6b38);var _0x37c448=this['get']({'plain':!![]});switch(_0x1b6b38){case 0x0:case 0x1:var _0x260dc6=_0x37c448[_0xf397('0x28')]?_['isArray'](_0x37c448[_0xf397('0x28')])?_0x37c448[_0xf397('0x28')][_0xf397('0x27')]():_0x37c448['transport']:'udp';if(_0x260dc6===_0xf397('0x42')){_0x260dc6='udp';}this[_0xf397('0x6')](_0xf397('0x28'),_0x260dc6);this[_0xf397('0x6')]('encryption','no');this['setDataValue'](_0xf397('0x43'),null);this['setDataValue'](_0xf397('0x44'),null);this[_0xf397('0x6')](_0xf397('0x45'),null);this['setDataValue'](_0xf397('0x46'),null);this[_0xf397('0x6')](_0xf397('0x47'),null);this[_0xf397('0x6')](_0xf397('0x48'),null);this['setDataValue'](_0xf397('0x49'),null);this[_0xf397('0x6')](_0xf397('0x4a'),null);this[_0xf397('0x6')](_0xf397('0x4b'),'no');break;case 0x2:this[_0xf397('0x6')]('transport',_0xf397('0x42'));this[_0xf397('0x6')](_0xf397('0x4c'),'yes');this[_0xf397('0x6')](_0xf397('0x43'),_0xf397('0x2e'));this[_0xf397('0x6')](_0xf397('0x44'),_0xf397('0x2e'));this[_0xf397('0x6')]('icesupport',_0xf397('0x2e'));this['setDataValue'](_0xf397('0x46'),_0xf397('0x2e'));this['setDataValue'](_0xf397('0x47'),'no');this['setDataValue'](_0xf397('0x48'),_0xf397('0x4d'));this[_0xf397('0x6')](_0xf397('0x49'),_0x37c448[_0xf397('0x49')]||_0xf397('0x4e'));this['setDataValue'](_0xf397('0x4a'),_0x37c448[_0xf397('0x4a')]||'/etc/pki/tls/private/motion.key');this[_0xf397('0x6')](_0xf397('0x4b'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0xf397('0x40')],'set':function(_0x13b632){this[_0xf397('0x6')]('permissions',_0x13b632?_0x13b632['join'](','):[]);},'get':function(){return this[_0xf397('0x18')](_0xf397('0x4f'))?_[_0xf397('0x50')](this[_0xf397('0x18')](_0xf397('0x4f'))[_0xf397('0x29')](','),function(_0x1e3586){return parseInt(_0x1e3586,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0xf397('0x9')]},'phoneBarBusyNumber':{'type':Sequelize[_0xf397('0x9')]},'phoneBarUnconditional':{'type':Sequelize[_0xf397('0x1a')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xf397('0x1a')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xf397('0x1a')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xf397('0x1a')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xf397('0x1a')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xf397('0x1a')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xf397('0x9')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xf397('0x14')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xf397('0xf')](_0xf397('0x2e'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xf397('0x1a')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xf397('0x9')]},'phoneBarEnableJaws':{'type':Sequelize[_0xf397('0x1a')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xf397('0x1a')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xf397('0x51')],'get':function(){return this[_0xf397('0x18')](_0xf397('0x52'))?this[_0xf397('0x18')](_0xf397('0x52')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xf397('0x1a')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xf397('0x1a')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xf397('0x1a')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xf397('0x9')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xf397('0x9')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x4cc403){if(typeof _0x4cc403==='string'){var _0x53c34a=_0x4cc403==='1'?!![]:_0x4cc403==='0'?![]:_0x4cc403===_0xf397('0x53')?!![]:_0x4cc403===_0xf397('0x54')?![]:![];this['setDataValue'](_0xf397('0x55'),_0x53c34a);}else{this[_0xf397('0x6')]('screenrecording',_0x4cc403);}}},'blocked':{'type':Sequelize[_0xf397('0x1a')],'defaultValue':![],'set':function(_0x264867){this[_0xf397('0x6')](_0xf397('0x56'),_0x264867);if(_0x264867===!![]){this[_0xf397('0x6')](_0xf397('0x57'),moment());this[_0xf397('0x6')](_0xf397('0x58'),0x0);}else{this[_0xf397('0x6')](_0xf397('0x57'),null);}}},'blockedAt':{'type':Sequelize[_0xf397('0x19')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xf397('0x14')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xf397('0x1a')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xf397('0x14')](0x5)[_0xf397('0x59')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xf397('0x1a')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xf397('0x1a')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xf397('0x1a')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0xf397('0x1a')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0xf397('0x1a')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xf397('0x1a')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0xf397('0x1a')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0xf397('0x14')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0xf397('0x1a')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0xf397('0x1a')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0xf397('0x1a')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0xf397('0x14')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0xf397('0x1a')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x8d57=['wss','encryption','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','VIRTUAL','phoneBarEnableScreenRecordingByAgent','true','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','lodash','STRING','setDataValue','name','The\x20name\x20of\x20the\x20user','format','\x22%s\x22\x20<%s>','internal','email','toLowerCase','admin','user','telephone','local','INTEGER','callerid','getDataValue','BOOLEAN','DEFAULT\x20PAUSE','DATE','friend','peer','from-sip','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','transport','split','info','shortinfo','inband','auto','rfc2833','yes','nonat','update','outgoing','force_rport,comedia','nat','join','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','passive','actpass','update,nonat','TEXT','showWebBar','get','isArray','udp'];(function(_0x2ff2f5,_0x4c4565){var _0x1b7012=function(_0x5c86e1){while(--_0x5c86e1){_0x2ff2f5['push'](_0x2ff2f5['shift']());}};_0x1b7012(++_0x4c4565);}(_0x8d57,0xcc));var _0x78d5=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x8d57[_0x1e7b16];return _0x37fadc;};'use strict';var Sequelize=require(_0x78d5('0x0'));var moment=require('moment');var util=require('util');var _=require(_0x78d5('0x1'));module['exports']={'name':{'type':Sequelize[_0x78d5('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x4d122d){this[_0x78d5('0x3')](_0x78d5('0x4'),_0x4d122d);this[_0x78d5('0x3')]('defaultuser',_0x4d122d);},'comment':_0x78d5('0x5')},'fullname':{'type':Sequelize[_0x78d5('0x2')],'allowNull':![],'set':function(_0x191b04){this[_0x78d5('0x3')]('fullname',_0x191b04);this['setDataValue']('callerid',util[_0x78d5('0x6')](_0x78d5('0x7'),_0x191b04,this['getDataValue'](_0x78d5('0x8'))));}},'alias':{'type':Sequelize[_0x78d5('0x2')]},'email':{'type':Sequelize[_0x78d5('0x2')],'allowNull':![],'unique':_0x78d5('0x9'),'validate':{'isEmail':!![]},'set':function(_0x5493ec){if(_0x5493ec){this[_0x78d5('0x3')](_0x78d5('0x9'),_0x5493ec[_0x78d5('0xa')]());}}},'role':{'type':Sequelize['ENUM'](_0x78d5('0xb'),_0x78d5('0xc'),'agent',_0x78d5('0xd')),'allowNull':![]},'password':{'type':Sequelize[_0x78d5('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x78d5('0x2')],'defaultValue':_0x78d5('0xe')},'internal':{'type':Sequelize[_0x78d5('0xf')](0xb),'allowNull':![],'unique':_0x78d5('0x8'),'set':function(_0x3666bd){this[_0x78d5('0x3')](_0x78d5('0x8'),_0x3666bd);this['setDataValue']('accountcode',_0x3666bd);this['setDataValue'](_0x78d5('0x10'),util['format'](_0x78d5('0x7'),this[_0x78d5('0x11')]('fullname'),_0x3666bd));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x78d5('0x2')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x78d5('0x2')]},'city':{'type':Sequelize[_0x78d5('0x2')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x78d5('0x2')],'defaultValue':_0x78d5('0x13')},'lastPauseAt':{'type':Sequelize[_0x78d5('0x14')]},'chatCapacity':{'type':Sequelize[_0x78d5('0xf')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x78d5('0xf')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x78d5('0xf')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x78d5('0xf')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x78d5('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x78d5('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x78d5('0xf')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x78d5('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x78d5('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x78d5('0xf')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x78d5('0xf')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0x78d5('0x15'),_0x78d5('0xc'),_0x78d5('0x16')),'allowNull':!![],'defaultValue':_0x78d5('0x15')},'context':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![],'defaultValue':_0x78d5('0x17')},'callingpres':{'type':Sequelize[_0x78d5('0x18')](_0x78d5('0x19'),_0x78d5('0x1a'),_0x78d5('0x1b'),_0x78d5('0x1c'),_0x78d5('0x1d'),_0x78d5('0x1e'),_0x78d5('0x1f'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'secret':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![],'defaultValue':'udp','set':function(_0x2f6652){this['setDataValue'](_0x78d5('0x20'),_0x2f6652?_0x2f6652['join'](','):null);},'get':function(){return this[_0x78d5('0x11')](_0x78d5('0x20'))?this[_0x78d5('0x11')](_0x78d5('0x20'))[_0x78d5('0x21')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM']('rfc2833',_0x78d5('0x22'),_0x78d5('0x23'),_0x78d5('0x24'),_0x78d5('0x25')),'allowNull':!![],'defaultValue':_0x78d5('0x26')},'directmedia':{'type':Sequelize[_0x78d5('0x18')](_0x78d5('0x27'),'no',_0x78d5('0x28'),_0x78d5('0x29'),_0x78d5('0x2a')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x78d5('0x18')](_0x78d5('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'nat':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![],'defaultValue':_0x78d5('0x2b'),'set':function(_0xdbb96f){this[_0x78d5('0x3')](_0x78d5('0x2c'),_0xdbb96f?_0xdbb96f[_0x78d5('0x2d')](','):null);},'get':function(){return this[_0x78d5('0x11')](_0x78d5('0x2c'))?this['getDataValue'](_0x78d5('0x2c'))[_0x78d5('0x21')](','):null;},'comment':_0x78d5('0x2e')},'callgroup':{'type':Sequelize[_0x78d5('0x2')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x78d5('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x78d5('0x2')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x78d5('0x2')]},'disallow':{'type':Sequelize[_0x78d5('0x2')],'allowNull':![],'defaultValue':_0x78d5('0x2f')},'allow':{'type':Sequelize[_0x78d5('0x2')],'allowNull':![],'defaultValue':_0x78d5('0x30'),'set':function(_0x368f28){this[_0x78d5('0x3')](_0x78d5('0x31'),_0x368f28?_0x368f28['join'](';'):_0x78d5('0x30'));},'get':function(){return this[_0x78d5('0x11')](_0x78d5('0x31'))?this[_0x78d5('0x11')]('allow')[_0x78d5('0x21')](';'):null;},'comment':_0x78d5('0x32')},'autoframing':{'type':Sequelize[_0x78d5('0x18')](_0x78d5('0x27'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![],'set':function(_0x21abd8){this[_0x78d5('0x3')]('insecure',_0x21abd8?_0x21abd8[_0x78d5('0x2d')](','):null);},'get':function(){return this[_0x78d5('0x11')](_0x78d5('0x33'))?this[_0x78d5('0x11')]('insecure')[_0x78d5('0x21')](','):null;},'comment':_0x78d5('0x34')},'trustrpid':{'type':Sequelize['ENUM'](_0x78d5('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x78d5('0x18')](_0x78d5('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x78d5('0x18')]('yes','no',_0x78d5('0x35')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x78d5('0x18')](_0x78d5('0x27'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x78d5('0x27'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![],'defaultValue':_0x78d5('0x36')},'amaflags':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x78d5('0x18')](_0x78d5('0x27'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x78d5('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x78d5('0x18')](_0x78d5('0x27'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x78d5('0x18')](_0x78d5('0x27'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x78d5('0x18')](_0x78d5('0x27'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x78d5('0x27'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'template':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x78d5('0x18')]('yes','no',_0x78d5('0x37')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x78d5('0xf')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x78d5('0x18')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x78d5('0x18')]('accept',_0x78d5('0x38'),'originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x78d5('0xf')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x78d5('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x78d5('0x18')](_0x78d5('0x39'),'uas'),'allowNull':!![],'defaultValue':_0x78d5('0x3a')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize[_0x78d5('0x18')](_0x78d5('0x27'),'no'),'allowNull':!![],'defaultValue':_0x78d5('0x27')},'keepalive':{'type':Sequelize[_0x78d5('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x78d5('0xf')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x78d5('0x18')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x78d5('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x78d5('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x78d5('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x78d5('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x78d5('0x18')](_0x78d5('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x78d5('0x18')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x78d5('0x18')](_0x78d5('0x27'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x78d5('0x18')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x78d5('0x18')](_0x78d5('0x27'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x78d5('0x18')]('yes','no',_0x78d5('0x3b'),_0x78d5('0x3c')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x78d5('0xf')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x78d5('0x18')]('active',_0x78d5('0x3d'),_0x78d5('0x3e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x78d5('0x18')](_0x78d5('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x78d5('0xf')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x78d5('0x18')](_0x78d5('0x27'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x78d5('0x18')](_0x78d5('0x27'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x78d5('0x18')](_0x78d5('0x27'),'no',_0x78d5('0x28'),_0x78d5('0x29'),_0x78d5('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x78d5('0x14')]},'passwordResetAt':{'type':Sequelize[_0x78d5('0x14')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x78d5('0x40')]},'showWebBar':{'type':Sequelize[_0x78d5('0xf')],'defaultValue':0x0,'set':function(_0xbcbe98){this[_0x78d5('0x3')](_0x78d5('0x41'),_0xbcbe98);var _0x89ad4=this[_0x78d5('0x42')]({'plain':!![]});switch(_0xbcbe98){case 0x0:case 0x1:var _0x26a21f=_0x89ad4[_0x78d5('0x20')]?_[_0x78d5('0x43')](_0x89ad4[_0x78d5('0x20')])?_0x89ad4[_0x78d5('0x20')][_0x78d5('0x2d')]():_0x89ad4[_0x78d5('0x20')]:_0x78d5('0x44');if(_0x26a21f===_0x78d5('0x45')){_0x26a21f=_0x78d5('0x44');}this[_0x78d5('0x3')](_0x78d5('0x20'),_0x26a21f);this[_0x78d5('0x3')](_0x78d5('0x46'),'no');this['setDataValue'](_0x78d5('0x47'),null);this[_0x78d5('0x3')](_0x78d5('0x48'),null);this[_0x78d5('0x3')](_0x78d5('0x49'),null);this[_0x78d5('0x3')](_0x78d5('0x4a'),null);this['setDataValue'](_0x78d5('0x4b'),null);this[_0x78d5('0x3')](_0x78d5('0x4c'),null);this['setDataValue']('dtlscertfile',null);this['setDataValue'](_0x78d5('0x4d'),null);this['setDataValue']('rtcp_mux','no');break;case 0x2:this[_0x78d5('0x3')](_0x78d5('0x20'),_0x78d5('0x45'));this[_0x78d5('0x3')]('encryption','yes');this['setDataValue'](_0x78d5('0x47'),_0x78d5('0x27'));this['setDataValue'](_0x78d5('0x48'),_0x78d5('0x27'));this[_0x78d5('0x3')](_0x78d5('0x49'),_0x78d5('0x27'));this[_0x78d5('0x3')](_0x78d5('0x4a'),_0x78d5('0x27'));this[_0x78d5('0x3')](_0x78d5('0x4b'),'no');this[_0x78d5('0x3')](_0x78d5('0x4c'),_0x78d5('0x3e'));this[_0x78d5('0x3')]('dtlscertfile',_0x89ad4[_0x78d5('0x4e')]||_0x78d5('0x4f'));this[_0x78d5('0x3')](_0x78d5('0x4d'),_0x89ad4[_0x78d5('0x4d')]||_0x78d5('0x50'));this[_0x78d5('0x3')]('rtcp_mux',_0x78d5('0x27'));break;default:}}},'permissions':{'type':Sequelize[_0x78d5('0x40')],'set':function(_0xb5b320){this[_0x78d5('0x3')](_0x78d5('0x51'),_0xb5b320?_0xb5b320[_0x78d5('0x2d')](','):[]);},'get':function(){return this[_0x78d5('0x11')](_0x78d5('0x51'))?_['map'](this[_0x78d5('0x11')](_0x78d5('0x51'))[_0x78d5('0x21')](','),function(_0x3be3dc){return parseInt(_0x3be3dc,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x78d5('0x2')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x78d5('0xf')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x78d5('0x2')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x78d5('0xf')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0x78d5('0x27'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x78d5('0x2')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x78d5('0x52')],'get':function(){return this[_0x78d5('0x11')](_0x78d5('0x53'))?this[_0x78d5('0x11')](_0x78d5('0x53')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x78d5('0x2')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x421d83){if(typeof _0x421d83==='string'){var _0x26aaa7=_0x421d83==='1'?!![]:_0x421d83==='0'?![]:_0x421d83===_0x78d5('0x54')?!![]:_0x421d83===_0x78d5('0x55')?![]:![];this[_0x78d5('0x3')](_0x78d5('0x56'),_0x26aaa7);}else{this[_0x78d5('0x3')](_0x78d5('0x56'),_0x421d83);}}},'blocked':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![],'set':function(_0x33c0ba){this['setDataValue'](_0x78d5('0x57'),_0x33c0ba);if(_0x33c0ba===!![]){this[_0x78d5('0x3')](_0x78d5('0x58'),moment());this['setDataValue'](_0x78d5('0x59'),0x0);}else{this[_0x78d5('0x3')](_0x78d5('0x58'),null);}}},'blockedAt':{'type':Sequelize[_0x78d5('0x14')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x78d5('0xf')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x78d5('0xf')](0x5)[_0x78d5('0x5a')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x78d5('0xf')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x78d5('0xf')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x78d5('0xf')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x78d5('0xf')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x78d5('0xf')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index faad959..bb59112 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 _0x87a5=['MailAccount','getMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getScheduledCalls','$and','$or','$gt','$lt','$eq','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contained','$any','firstName','CmContact','Contact','dialActive','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','generateApiKey','iat','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','send','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','unknown','queues','flatten','toString','lower','asc','desc','substring','uniqBy','orderBy','offline','voiceStatus','unavailable','busy','SELECT','select','field','InteractionId','ui.createdAt','_interactions','ui.UserId\x20=\x20?','OpenTabs','messengerSoundNotification','enabled','moment','util','lodash','../../components/auth/service','../../components/contacts','../../components/realtime/agents','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../errors/api','APIBadRequestError','APINotFoundError','APIForbiddenrror','handleError','../../mysqldb','socket.io-emitter','redis','register','defaults','localhost','client','sendStatus','status','end','json','undefined','offset','count','Content-Range','request','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','update','then','role','agent','emit','userNotification:recalc:','get','admin','Users','user','Agents','Telephones','telephone','ignore','value','includes','name','UserProfileResource','destroy','stack','fieldName','type','filter','salt','previousPasswords','resetPasswordToken','resetPasswordExpires','md5secret','index','getOptions','User','include','query','userSetting','true','UserSetting','push','findAll','openTabs','rows','chat','sms','dataValues','fax','mail','openchannel','whatsapp','all','params','merge','options','attributes','find','body','describe','addContacts','ids','internal','Setting','securePassword','password','isNil','min_internal','sequelize','QueryTypes','length','from','voicemail','mailbox','email','permissions','101','102','104','105','106','107','109','100','111','115','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','VoiceMail','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','isEmpty','autoAssociation','map','compact','changePassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','oldPassword','Wrong\x20credentials','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','passwordHistoryLimit','validatePasswordPattern','enforcePasswordHistory','validatePasswordHistory','updatePasswordsHistory','addQueues','online','loginInPause','isValidChannel','add','capitalize','Queues','toLowerCase','Queue:save','voice','VoiceQueue','interface','format','SIP/%s','voicePause','penalty','upsert','removeQueues','channel','remove','isArray','QueueId','Queue:remove','UserVoiceQueueRt','userpic','file','filename','getAvatar','join','server/files/images/logos/default_profile.png','download','root','server/files/images/','getOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','WhatsappOpenTabs','WHATSAPP','concat','getContacts','User\x20with\x20id\x20%s\x20not\x20found','hasOwnProperty','includeAll','CmList','List','Tag','Tags','color','tag','getQueues','Unknown\x20channel','keys','rawAttributes','filters','intersection','model','fields','order','sort','pick','where','Queue','Unknown\x20role','limit','getVoiceQueuesRt','nolimit','ChatGroup','getGroups','getRecordings','VoiceRecording','getScreenRecordings','ScreenRecording','UserId','getChatInteractions','ChatInteraction','OpenchannelInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','headers','x-forwarded-for','connection','socket','remoteAddress','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','PAUSE','LOGININPAUSE','isMiddleware','resolve','logout','pause','QueuePause','DEFAULT\x20PAUSE','Channel\x20parameter\x20%s\x20is\x20invalid','mailPause','openchannelPause','smsPause','whatsappPause','pauseType','lastPauseAt','unpause','getTeams','Team','addTeams','Body\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','getAssociatedQueues','flattenDeep','addAgent','getDataValue','Voice','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','removeTeams','getLists','values','You\x20can\x27t\x20delete\x20yourself','CmHopper','addChatInteractions','omit','spread','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','removeSmsInteractions','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','removeWhatsappInteractions','VoicePrefix','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts'];(function(_0x511fc9,_0x253ed8){var _0x4a2115=function(_0x11920f){while(--_0x11920f){_0x511fc9['push'](_0x511fc9['shift']());}};_0x4a2115(++_0x253ed8);}(_0x87a5,0x1dd));var _0x587a=function(_0x53f0db,_0x35c67c){_0x53f0db=_0x53f0db-0x0;var _0xae0a5c=_0x87a5[_0x53f0db];return _0xae0a5c;};'use strict';var moment=require(_0x587a('0x0'));var util=require(_0x587a('0x1'));var path=require('path');var fs=require('fs');var _=require(_0x587a('0x2'));var squel=require('squel');var Redis=require('ioredis');var jayson=require('jayson/promise');var authService=require(_0x587a('0x3'));var contacts=require(_0x587a('0x4'));var qs=require('../../components/parsers/qs');var rta=require(_0x587a('0x5'));var logger=require(_0x587a('0x6'))(_0x587a('0x7'));var utils=require(_0x587a('0x8'));var config=require(_0x587a('0x9'));var licenseUtil=require(_0x587a('0xa'));var APIBadRequestError=require(_0x587a('0xb'))[_0x587a('0xc')];var APINotFoundError=require('../../errors/api')[_0x587a('0xd')];var APIForbiddenError=require(_0x587a('0xb'))[_0x587a('0xe')];var APIHandleError=require(_0x587a('0xb'))[_0x587a('0xf')];var db=require(_0x587a('0x10'))['db'];var socket=require(_0x587a('0x11'))(new Redis(config[_0x587a('0x12')]));require('./user.socket')[_0x587a('0x13')](socket);config[_0x587a('0x12')]=_[_0x587a('0x14')](config[_0x587a('0x12')],{'host':_0x587a('0x15'),'port':0x18eb});var amiClient=jayson[_0x587a('0x16')]['http']({'port':0x232a});var values;function respondWithStatusCode(_0x19321c,_0x2ecc27){_0x2ecc27=_0x2ecc27||0xcc;return function(_0x1c54cb){if(_0x1c54cb){return _0x19321c[_0x587a('0x17')](_0x2ecc27);}return _0x19321c[_0x587a('0x18')](_0x2ecc27)[_0x587a('0x19')]();};}function respondWithResult(_0x28b965,_0x3f93e3){_0x3f93e3=_0x3f93e3||0xc8;return function(_0x572e9a){if(_0x572e9a){return _0x28b965[_0x587a('0x18')](_0x3f93e3)[_0x587a('0x1a')](_0x572e9a);}};}function respondWithFilteredResult(_0x3e96f8,_0x1f7c80){return function(_0x1305ac){if(_0x1305ac){var _0x1578b3=typeof _0x1f7c80['offset']===_0x587a('0x1b')&&typeof _0x1f7c80['limit']==='undefined';var _0x50c191=_0x1305ac['count'];var _0x3ee240=_0x1578b3?0x0:_0x1f7c80[_0x587a('0x1c')];var _0xc9801c=_0x1578b3?_0x1305ac[_0x587a('0x1d')]:_0x1f7c80['offset']+_0x1f7c80['limit'];var _0x3d9e82;if(_0xc9801c>=_0x50c191){_0xc9801c=_0x50c191;_0x3d9e82=0xc8;}else{_0x3d9e82=0xce;}_0x3e96f8[_0x587a('0x18')](_0x3d9e82);return _0x3e96f8['set'](_0x587a('0x1e'),_0x3ee240+'-'+_0xc9801c+'/'+_0x50c191)[_0x587a('0x1a')](_0x1305ac);}return null;};}function respondWithRpcPromise(_0x508e4a,_0x511f2c,_0x5a0b03,_0xee08d8){return new Promise(function(_0x4a1d3a,_0x562713){var _0x1b139f=_0xee08d8||amiClient;return _0x1b139f[_0x587a('0x1f')](_0x508e4a,_0x5a0b03)['then'](function(_0x12fd29){logger[_0x587a('0x20')](_0x587a('0x21'),_0x511f2c,_0x587a('0x22'));logger[_0x587a('0x23')](_0x587a('0x24'),_0x511f2c,_0x587a('0x22'),JSON[_0x587a('0x25')](_0x12fd29));if(_0x12fd29['error']){if(_0x12fd29[_0x587a('0x26')]['code']===0x1f4){logger[_0x587a('0x26')]('User,\x20%s,\x20%s',_0x511f2c,_0x12fd29[_0x587a('0x26')]['message']);return _0x562713(_0x12fd29['error'][_0x587a('0x27')]);}logger['error']('User,\x20%s,\x20%s',_0x511f2c,_0x12fd29[_0x587a('0x26')][_0x587a('0x27')]);return _0x4a1d3a(_0x12fd29[_0x587a('0x26')][_0x587a('0x27')]);}else{logger[_0x587a('0x20')]('User,\x20%s,\x20%s',_0x511f2c,_0x587a('0x22'));_0x4a1d3a(_0x12fd29[_0x587a('0x28')][_0x587a('0x27')]);}})[_0x587a('0x29')](function(_0x53cb2b){logger[_0x587a('0x26')](_0x587a('0x21'),_0x511f2c,_0x53cb2b);_0x562713(_0x53cb2b);});});}function saveUpdates(_0x584b94){return function(_0x5e1200){if(_0x5e1200){return _0x5e1200[_0x587a('0x2a')](_0x584b94)[_0x587a('0x2b')](function(_0x101af7){if(_0x101af7[_0x587a('0x2c')]===_0x587a('0x2d')){socket[_0x587a('0x2e')](_0x587a('0x2f')+_0x101af7['id'],_0x101af7);}return _0x101af7;});}return null;};}function removeEntity(_0x2139c7,_0x2179e5){return function(_0x442148){if(_0x442148){return _0x442148['destroy']({'transaction':_0x2179e5})[_0x587a('0x2b')](function(){var _0x33b868=_0x442148[_0x587a('0x30')]({'plain':!![]});if(_0x33b868['role']===_0x587a('0x31'))return;var _0x4c80ff=[{'name':_0x587a('0x32'),'value':_0x587a('0x33'),'ignore':!![]},{'name':_0x587a('0x34'),'value':_0x587a('0x2d'),'ignore':![]},{'name':_0x587a('0x35'),'value':_0x587a('0x36'),'ignore':![]}];var _0xc65564=_(_0x4c80ff)['filter'](_0x587a('0x37'))['map'](_0x587a('0x38'))[_0x587a('0x38')]();if(_[_0x587a('0x39')](_0xc65564,_0x33b868[_0x587a('0x2c')])){return;}var _0x61b58e=_['find'](_0x4c80ff,[_0x587a('0x38'),_0x33b868[_0x587a('0x2c')]])[_0x587a('0x3a')];return db[_0x587a('0x3b')][_0x587a('0x3c')]({'where':{'type':_0x61b58e,'resourceId':_0x33b868['id']},'transaction':_0x2179e5})['then'](function(){return _0x442148;});})[_0x587a('0x2b')](function(){_0x2139c7[_0x587a('0x18')](0xcc)[_0x587a('0x19')]();});}};}function handleEntityNotFound(_0x778dcf){return function(_0x28cade){if(!_0x28cade){_0x778dcf[_0x587a('0x17')](0x194);}return _0x28cade;};}function handleError(_0x443fb2,_0x53c32c){_0x53c32c=_0x53c32c||0x1f4;return function(_0x45dc94){logger[_0x587a('0x26')](_0x45dc94[_0x587a('0x3d')]);if(_0x45dc94[_0x587a('0x3a')]){delete _0x45dc94[_0x587a('0x3a')];}_0x443fb2[_0x587a('0x18')](_0x53c32c)['send'](_0x45dc94);};}function getUserAttributes(){return _(db['User']['rawAttributes'])['map'](function(_0x539e39){return{'name':_0x539e39[_0x587a('0x3e')],'type':_0x539e39[_0x587a('0x3f')]['key']};})[_0x587a('0x40')](function(_0x3630e5){return!['password',_0x587a('0x41'),_0x587a('0x42'),_0x587a('0x43'),_0x587a('0x44'),_0x587a('0x45')]['includes'](_0x3630e5[_0x587a('0x3a')]);})['value']();}exports[_0x587a('0x46')]=function(_0x5aa739,_0xde63c){var _0x38ca2f={},_0x10d9de={'count':0x0,'rows':[]};var _0x5db841=getUserAttributes();_0x38ca2f=qs[_0x587a('0x47')](_0x5db841,_0x5aa739);var _0x41aea5={'where':_0x38ca2f['where']};return db[_0x587a('0x48')]['count'](_0x41aea5)[_0x587a('0x2b')](function(_0x33f4cd){_0x10d9de[_0x587a('0x1d')]=_0x33f4cd;if(_0x5aa739['query']['includeAll']){_0x38ca2f[_0x587a('0x49')]=[{'all':!![]}];}if(_0x5aa739[_0x587a('0x4a')][_0x587a('0x4b')]===_0x587a('0x4c')){_0x38ca2f['include']=[{'model':db[_0x587a('0x4d')],'as':_0x587a('0x4b')}];}if(!_[_0x587a('0x39')](_0x38ca2f['attributes'],'id')){_0x38ca2f['attributes'][_0x587a('0x4e')]('id');}return db[_0x587a('0x48')][_0x587a('0x4f')](_0x38ca2f);})[_0x587a('0x2b')](function(_0x3e40aa){_0x10d9de['rows']=_0x3e40aa;if(_0x5aa739[_0x587a('0x4a')][_0x587a('0x50')]===_0x587a('0x4c')){var _0x232037=[];for(var _0x54cfab=0x0;_0x54cfab<_0x10d9de[_0x587a('0x51')]['length'];_0x54cfab++){_0x232037[_0x587a('0x4e')](get_open_tabs(_0x587a('0x52'),_0x10d9de[_0x587a('0x51')][_0x54cfab]['dataValues']));_0x232037[_0x587a('0x4e')](get_open_tabs(_0x587a('0x53'),_0x10d9de[_0x587a('0x51')][_0x54cfab][_0x587a('0x54')]));_0x232037[_0x587a('0x4e')](get_open_tabs(_0x587a('0x55'),_0x10d9de[_0x587a('0x51')][_0x54cfab]['dataValues']));_0x232037[_0x587a('0x4e')](get_open_tabs(_0x587a('0x56'),_0x10d9de['rows'][_0x54cfab]['dataValues']));_0x232037[_0x587a('0x4e')](get_open_tabs(_0x587a('0x57'),_0x10d9de[_0x587a('0x51')][_0x54cfab][_0x587a('0x54')]));_0x232037[_0x587a('0x4e')](get_open_tabs(_0x587a('0x58'),_0x10d9de[_0x587a('0x51')][_0x54cfab][_0x587a('0x54')]));}return Promise[_0x587a('0x59')](_0x232037)['then'](function(){return _0x10d9de;});}else{return _0x10d9de;}})['then'](respondWithFilteredResult(_0xde63c,_0x38ca2f))['catch'](handleError(_0xde63c,null));};exports['show']=function(_0x4f9bb7,_0xf8e2c6){var _0x2c6625=getUserAttributes();_0x4f9bb7[_0x587a('0x4a')]['id']=_0x4f9bb7[_0x587a('0x5a')]['id'];var _0x49b0a9=qs[_0x587a('0x47')](_0x2c6625,_0x4f9bb7);if(_0x4f9bb7[_0x587a('0x4a')]['includeAll']){_0x49b0a9[_0x587a('0x49')]=[{'all':!![]}];}if(_0x4f9bb7[_0x587a('0x4a')]['userSetting']===_0x587a('0x4c')){_0x49b0a9['include']=[{'model':db[_0x587a('0x4d')],'as':_0x587a('0x4b')}];}_0x49b0a9=_[_0x587a('0x5b')]({},_0x49b0a9,_0x4f9bb7[_0x587a('0x5c')]);if(!_['includes'](_0x49b0a9[_0x587a('0x5d')],'id')){_0x49b0a9[_0x587a('0x5d')][_0x587a('0x4e')]('id');}return db['User'][_0x587a('0x5e')](_0x49b0a9)['then'](handleEntityNotFound(_0xf8e2c6,null))[_0x587a('0x2b')](function(_0x553954){var _0x12f030=[];values=_0x553954;if(_0x4f9bb7['query'][_0x587a('0x50')]===_0x587a('0x4c')){_0x12f030[_0x587a('0x4e')](get_open_tabs(_0x587a('0x52'),_0x553954[_0x587a('0x54')]));_0x12f030['push'](get_open_tabs('sms',_0x553954[_0x587a('0x54')]));_0x12f030[_0x587a('0x4e')](get_open_tabs(_0x587a('0x57'),_0x553954[_0x587a('0x54')]));_0x12f030['push'](get_open_tabs(_0x587a('0x58'),_0x553954[_0x587a('0x54')]));_0x12f030[_0x587a('0x4e')](get_open_tabs(_0x587a('0x55'),_0x553954['dataValues']));_0x12f030['push'](get_open_tabs('mail',_0x553954[_0x587a('0x54')]));return Promise[_0x587a('0x59')](_0x12f030);}else{return values;}})[_0x587a('0x2b')](function(){return values;})[_0x587a('0x2b')](respondWithResult(_0xf8e2c6,null))[_0x587a('0x29')](handleError(_0xf8e2c6,null));};exports['update']=function(_0x5ca854,_0x43efad){if(_0x5ca854[_0x587a('0x5f')]['id']){delete _0x5ca854['body']['id'];}delete _0x5ca854[_0x587a('0x5f')][_0x587a('0x2c')];return db[_0x587a('0x48')]['find']({'where':{'id':_0x5ca854[_0x587a('0x5a')]['id']}})['then'](handleEntityNotFound(_0x43efad,null))['then'](saveUpdates(_0x5ca854[_0x587a('0x5f')],null))[_0x587a('0x2b')](respondWithResult(_0x43efad,null))[_0x587a('0x29')](handleError(_0x43efad,null));};exports[_0x587a('0x60')]=function(_0x577039,_0x3134c0){return db[_0x587a('0x48')][_0x587a('0x60')]()[_0x587a('0x2b')](respondWithResult(_0x3134c0,null))[_0x587a('0x29')](handleError(_0x3134c0,null));};exports[_0x587a('0x61')]=function(_0x4d5121,_0x4ed993){return db[_0x587a('0x48')][_0x587a('0x5e')]({'where':{'id':_0x4d5121[_0x587a('0x5a')]['id']}})[_0x587a('0x2b')](handleEntityNotFound(_0x4ed993,null))[_0x587a('0x2b')](function(_0x4f2c87){if(_0x4f2c87){return _0x4f2c87[_0x587a('0x61')](_0x4d5121[_0x587a('0x5f')][_0x587a('0x62')],_['omit'](_0x4d5121[_0x587a('0x5f')],[_0x587a('0x62'),'id'])||{});}})[_0x587a('0x2b')](respondWithResult(_0x4ed993,null))[_0x587a('0x29')](handleError(_0x4ed993,null));};function validateUser(_0x4cf206){return new Promise(function(_0xe7ba99,_0x2180e3){if(_0x4cf206[_0x587a('0x63')])return _0xe7ba99(_0x4cf206);return db[_0x587a('0x64')]['findById'](0x1)['then'](function(_0x5a2846){if(_0x5a2846[_0x587a('0x65')])authService['validatePasswordPattern'](_0x4cf206[_0x587a('0x66')]);db['User']['max'](_0x587a('0x63'))[_0x587a('0x2b')](function(_0x1c053c){if(_[_0x587a('0x67')](_0x1c053c)){_0x4cf206['internal']=_0x5a2846[_0x587a('0x68')]||0x1;return;}if(_[_0x587a('0x67')](_0x5a2846[_0x587a('0x68')])||_0x5a2846['min_internal']===_0x1c053c){_0x4cf206['internal']=_0x1c053c+0x1;return;}if(_0x5a2846[_0x587a('0x68')]>_0x1c053c){_0x4cf206[_0x587a('0x63')]=_0x5a2846['min_internal'];return;}return db[_0x587a('0x69')][_0x587a('0x4a')]('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0x587a('0x69')][_0x587a('0x6a')]['SELECT']})[_0x587a('0x2b')](function(_0x5ef9e2){if(_0x5ef9e2&&_0x5ef9e2[_0x587a('0x6b')]){for(var _0x4560fc=0x0,_0x569e04=_0x5ef9e2['length'];_0x4560fc<_0x569e04&&_[_0x587a('0x67')](_0x4cf206['internal']);_0x4560fc++){if(_0x5a2846[_0x587a('0x68')]<=_0x5ef9e2[_0x4560fc][_0x587a('0x6c')]){_0x4cf206['internal']=_0x5ef9e2[_0x4560fc]['from'];}else if(_0x5a2846[_0x587a('0x68')]>_0x5ef9e2[_0x4560fc]['from']&&_0x5a2846['min_internal']<=_0x5ef9e2[_0x4560fc]['to']){_0x4cf206[_0x587a('0x63')]=_0x5a2846[_0x587a('0x68')];}}}if(_['isNil'](_0x4cf206['internal'])){_0x4cf206['internal']=_0x1c053c+0x1;}return _0xe7ba99(_0x4cf206);});});})['catch'](function(_0x33fff4){_0x2180e3(_0x33fff4);});});}function updateUser(_0x5d8888){return new Promise(function(_0x22b839,_0x55440b){try{if(_0x5d8888[_0x587a('0x6d')]){_0x5d8888[_0x587a('0x6e')]=_0x5d8888[_0x587a('0x63')];_0x5d8888['VoiceMail']={'mailbox':_0x5d8888[_0x587a('0x63')],'password':_0x5d8888[_0x587a('0x66')],'fullname':_0x5d8888['fullname'],'email':_0x5d8888[_0x587a('0x6f')]};}if(_0x5d8888['role']===_0x587a('0x2d')){if(!_0x5d8888[_0x587a('0x70')])_0x5d8888[_0x587a('0x70')]=[_0x587a('0x71'),_0x587a('0x72'),'103','113','110',_0x587a('0x73'),_0x587a('0x74'),_0x587a('0x75'),_0x587a('0x76'),'108',_0x587a('0x77'),_0x587a('0x78'),_0x587a('0x79'),'114',_0x587a('0x7a')];}_0x22b839(_0x5d8888);}catch(_0x2b5f3d){_0x55440b(_0x2b5f3d);}});}exports[_0x587a('0x7b')]=function(_0x513849,_0x5a2c12){if(_0x513849[_0x587a('0x33')]['role']===_0x587a('0x2d'))throw new Error(_0x587a('0x7c'));if(_0x513849[_0x587a('0x5f')][_0x587a('0x2c')]===_0x587a('0x33')&&_0x513849[_0x587a('0x33')]['role']!==_0x587a('0x31')){throw new Error(_0x587a('0x7d'));}if(_0x513849[_0x587a('0x5f')][_0x587a('0x2c')]===_0x587a('0x31')&&_0x513849[_0x587a('0x33')][_0x587a('0x2c')]!=='admin'){throw new Error(_0x587a('0x7e'));}return licenseUtil[_0x587a('0x7f')]([_0x513849[_0x587a('0x5f')]])[_0x587a('0x2b')](function(){return validateUser(_0x513849['body']);})['then'](function(_0x43385f){return updateUser(_0x43385f)[_0x587a('0x2b')](function(_0x5a7d57){if(_0x5a7d57[_0x587a('0x2c')]===_0x587a('0x31')){_0x5a7d57[_0x587a('0x80')]=_0x513849[_0x587a('0x33')]['settingsEnabled'];delete _0x5a7d57[_0x587a('0x81')];}return _0x5a7d57;});})[_0x587a('0x2b')](function(_0x59be87){return db['User']['create'](_0x59be87,{'include':[{'model':db[_0x587a('0x82')],'as':'VoiceMail'}]});})[_0x587a('0x2b')](function(_0x2e1a8a){if(_0x513849[_0x587a('0x5f')]['role']===_0x587a('0x33'))return _0x2e1a8a;if(_0x513849['user']['role']!==_0x587a('0x33'))return _0x2e1a8a;return db[_0x587a('0x83')][_0x587a('0x5e')]({'where':{'name':_0x2e1a8a[_0x587a('0x2c')]===_0x587a('0x2d')?_0x587a('0x34'):_0x587a('0x35'),'userProfileId':_0x513849[_0x587a('0x33')][_0x587a('0x81')]},'raw':!![]})[_0x587a('0x2b')](function(_0x2ea9c1){if(!_0x2ea9c1||_0x2ea9c1['autoAssociation']!=0x0)return _0x2e1a8a;return db[_0x587a('0x3b')][_0x587a('0x7b')]({'name':_0x2e1a8a[_0x587a('0x3a')],'resourceId':_0x2e1a8a['id'],'type':_0x2ea9c1[_0x587a('0x3a')],'sectionId':_0x2ea9c1['id']},{})['then'](function(){return _0x2e1a8a;});})[_0x587a('0x29')](function(_0xba87d){logger[_0x587a('0x26')](_0x587a('0x84'),_0xba87d);throw _0xba87d;});})['then'](respondWithResult(_0x5a2c12,0xc9))[_0x587a('0x29')](handleError(_0x5a2c12,null));};exports[_0x587a('0x85')]=function(_0x577154,_0x575b30){var _0x2b4ea6=_0x577154[_0x587a('0x5f')];var _0x38a5db=[];if(_0x577154['user'][_0x587a('0x2c')]===_0x587a('0x2d'))throw new Error('Unauthorized');if(_[_0x587a('0x86')](_0x2b4ea6,[_0x587a('0x2c'),_0x587a('0x33')])&&_0x577154[_0x587a('0x33')][_0x587a('0x2c')]!==_0x587a('0x31')){throw new Error(_0x587a('0x7d'));}if(_[_0x587a('0x86')](_0x2b4ea6,[_0x587a('0x2c'),'admin'])&&_0x577154[_0x587a('0x33')][_0x587a('0x2c')]!==_0x587a('0x31')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0x587a('0x7f')](_0x2b4ea6)[_0x587a('0x2b')](function(){return validateUser(_0x2b4ea6[0x0]);})['then'](function(){for(var _0x566d9f=0x1;_0x566d9f<_0x2b4ea6[_0x587a('0x6b')];_0x566d9f++){var _0x36611e=_0x2b4ea6[_0x566d9f-0x1][_0x587a('0x63')];if(!_0x2b4ea6[_0x566d9f][_0x587a('0x63')])_0x2b4ea6[_0x566d9f][_0x587a('0x63')]=_0x36611e+0x1;_0x38a5db[_0x587a('0x4e')](validateUser(_0x2b4ea6[_0x566d9f]));}return Promise[_0x587a('0x59')](_0x38a5db);})[_0x587a('0x2b')](function(){_0x38a5db=[];for(var _0x53c408=0x0;_0x53c408<_0x2b4ea6['length'];_0x53c408++){_0x38a5db['push'](updateUser(_0x2b4ea6[_0x53c408]));}return Promise[_0x587a('0x59')](_0x38a5db);})[_0x587a('0x2b')](function(){_0x38a5db=_0x2b4ea6['map'](function(_0xf9e698){return db[_0x587a('0x48')][_0x587a('0x7b')](_0xf9e698,{'include':[{'model':db[_0x587a('0x82')],'as':'VoiceMail'}]})['then'](function(_0x578d86){_0xf9e698['id']=_0x578d86['id'];return _0xf9e698;});});return Promise['all'](_0x38a5db);})[_0x587a('0x2b')](function(_0x5aa409){if(_0x577154[_0x587a('0x5f')][_0x587a('0x2c')]==='user')return _0x5aa409;if(_0x577154[_0x587a('0x33')][_0x587a('0x2c')]!==_0x587a('0x33'))return _0x5aa409;var _0xc98c07=_['some'](_0x5aa409,function(_0x1c7964){return _0x1c7964['role']===_0x587a('0x2d')||_0x1c7964['role']===_0x587a('0x36');});if(!_0xc98c07)return _0x5aa409;return db[_0x587a('0x83')]['findAll']({'where':{'name':{'$or':[_0x587a('0x34'),_0x587a('0x35')]},'userProfileId':_0x577154['user'][_0x587a('0x81')]},'raw':!![]})[_0x587a('0x2b')](function(_0x56f5b1){if(_[_0x587a('0x87')](_0x56f5b1)||!_[_0x587a('0x86')](_0x56f5b1,[_0x587a('0x88'),0x0]))return _0x5aa409;_0x38a5db=[];var _0xb88615=_(_0x56f5b1)[_0x587a('0x89')](function(_0x1af35c){if(_0x1af35c[_0x587a('0x88')]===0x1)return;return _0x1af35c[_0x587a('0x3a')]==='Agents'?'agent':'telephone';})[_0x587a('0x8a')]()[_0x587a('0x38')]();for(var _0x5042a5=0x0;_0x5042a5<_0x5aa409[_0x587a('0x6b')];_0x5042a5++){if(!_[_0x587a('0x39')](_0xb88615,_0x5aa409[_0x5042a5]['role']))return;var _0x2ddc28=_0x5aa409[_0x5042a5][_0x587a('0x2c')]===_0x587a('0x2d')?_0x587a('0x34'):_0x587a('0x35');_0x38a5db[_0x587a('0x4e')](db[_0x587a('0x3b')][_0x587a('0x7b')]({'name':_0x5aa409[_0x5042a5][_0x587a('0x3a')],'resourceId':_0x5aa409[_0x5042a5]['id'],'type':_0x2ddc28,'sectionId':_['find'](_0x56f5b1,[_0x587a('0x3a'),_0x2ddc28])['id']},{}));}return Promise[_0x587a('0x59')](_0x38a5db);});})[_0x587a('0x2b')](respondWithResult(_0x575b30,0xc9))[_0x587a('0x29')](handleError(_0x575b30,null));};exports[_0x587a('0x8b')]=function(_0x1877a9,_0x4eb003){if(_0x1877a9[_0x587a('0x5f')]['id']){delete _0x1877a9['body']['id'];}return db['User'][_0x587a('0x5e')]({'where':{'id':_0x1877a9[_0x587a('0x5a')]['id']}})['then'](function(_0x527737){if(!_0x527737)return null;if(_0x527737['id']===_0x1877a9[_0x587a('0x33')]['id']){if(!_0x1877a9[_0x587a('0x5f')]['oldPassword']||!_0x1877a9['body'][_0x587a('0x8c')]){throw new db[(_0x587a('0x8d'))][(_0x587a('0x8e'))](_0x587a('0x8f'));}if(!_0x527737[_0x587a('0x90')](_0x1877a9[_0x587a('0x5f')][_0x587a('0x91')])){throw new db[(_0x587a('0x8d'))][(_0x587a('0x8e'))](_0x587a('0x92'));}if(_0x1877a9[_0x587a('0x5f')][_0x587a('0x91')]===_0x1877a9[_0x587a('0x5f')][_0x587a('0x8c')]){throw new db[(_0x587a('0x8d'))][(_0x587a('0x8e'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x1877a9['user'][_0x587a('0x2c')]==='admin'){if(!_0x1877a9[_0x587a('0x5f')]['newPassword']){throw new db[(_0x587a('0x8d'))][(_0x587a('0x8e'))](_0x587a('0x93'));}}else if(_0x1877a9[_0x587a('0x33')][_0x587a('0x2c')]==='user'){if(!_0x1877a9[_0x587a('0x5f')][_0x587a('0x8c')]){throw new db[(_0x587a('0x8d'))][(_0x587a('0x8e'))](_0x587a('0x93'));}if(_0x527737['role']!==_0x587a('0x2d')){throw new db[(_0x587a('0x8d'))][(_0x587a('0x8e'))](_0x587a('0x7c'));}}else{throw new db[(_0x587a('0x8d'))][(_0x587a('0x8e'))]('Unauthorized');}return _0x527737;})[_0x587a('0x2b')](handleEntityNotFound(_0x4eb003,null))[_0x587a('0x2b')](function(_0x3b2b2f){return db['Setting'][_0x587a('0x94')]({'attributes':['id',_0x587a('0x65'),'enforcePasswordHistory',_0x587a('0x95')]})[_0x587a('0x2b')](function(_0x3eb448){if(_0x3eb448['securePassword'])authService[_0x587a('0x96')](_0x1877a9[_0x587a('0x5f')]['newPassword']);if(!_0x3eb448[_0x587a('0x97')]||!_0x3b2b2f[_0x587a('0x42')])return _0x3b2b2f;authService[_0x587a('0x98')](_0x1877a9['body'][_0x587a('0x8c')],_0x3b2b2f['previousPasswords'],_0x3eb448[_0x587a('0x95')]);return _0x3b2b2f;})['then'](saveUpdates({'password':_0x1877a9[_0x587a('0x5f')]['newPassword'],'passwordResetAt':_0x1877a9[_0x587a('0x33')]['id']==_0x1877a9[_0x587a('0x5a')]['id']?moment():null,'previousPasswords':authService[_0x587a('0x99')](_0x1877a9[_0x587a('0x5f')][_0x587a('0x8c')],_0x3b2b2f[_0x587a('0x42')])},null));})['then'](respondWithResult(_0x4eb003,null))[_0x587a('0x29')](handleError(_0x4eb003,null));};exports[_0x587a('0x9a')]=function(_0x39d51f,_0xfbee66){var _0xc2aa08=_0x39d51f['body']['channel'];return db[_0x587a('0x48')]['find']({'where':{'id':_0x39d51f[_0x587a('0x5a')]['id']},'attributes':['id',_0x587a('0x3a'),_0x587a('0x2c'),_0x587a('0x9b'),_0x587a('0x9c'),'voicePause','interface']})[_0x587a('0x2b')](handleEntityNotFound(_0xfbee66,null))[_0x587a('0x2b')](function(_0x2f25c9){if(_0x2f25c9){if(!utils[_0x587a('0x9d')](_0xc2aa08)){throw new db[(_0x587a('0x8d'))]['ValidationError']('Unknown\x20channel');}return _0x2f25c9[_0x587a('0x9e')+_[_0x587a('0x9f')](_0xc2aa08['toLowerCase']())+_0x587a('0xa0')](_0x39d51f[_0x587a('0x5f')]['ids'],{'penalty':_0x39d51f[_0x587a('0x5f')]['penalty']||0x0})['spread'](function(_0x8a8526){for(var _0x48f251=0x0;_0x48f251<_0x39d51f['body']['ids'][_0x587a('0x6b')];_0x48f251+=0x1){var _0x22d0c8={'UserId':Number(_0x39d51f[_0x587a('0x5a')]['id'])};_0x22d0c8[_['capitalize'](_0xc2aa08['toLowerCase']())+'QueueId']=Number(_0x39d51f[_0x587a('0x5f')][_0x587a('0x62')][_0x48f251]);socket[_0x587a('0x2e')](_0x587a('0x33')+_[_0x587a('0x9f')](_0xc2aa08[_0x587a('0xa1')]())+_0x587a('0xa2'),_0x22d0c8);}return _0x8a8526;})[_0x587a('0x2b')](function(){if(_0xc2aa08===_0x587a('0xa3')){return db[_0x587a('0xa4')][_0x587a('0x4f')]({'where':{'id':_0x39d51f[_0x587a('0x5f')][_0x587a('0x62')]||[]},'raw':!![],'attributes':['id',_0x587a('0x3a')]});}})[_0x587a('0x2b')](function(_0x4ffe76){var _0x215f58=_0x2f25c9[_0x587a('0x30')]({'plain':!![]});var _0x36b86c=[];if(_0xc2aa08===_0x587a('0xa3')&&_0x215f58['role']===_0x587a('0x2d')&&_0x215f58['online']){for(let _0x846bc1=0x0;_0x846bc1<_0x4ffe76[_0x587a('0x6b')];_0x846bc1+=0x1){_0x36b86c[_0x587a('0x4e')]({'membername':_0x215f58['name'],'UserId':_0x215f58['id'],'queue_name':_0x4ffe76[_0x846bc1][_0x587a('0x3a')],'VoiceQueueId':_0x4ffe76[_0x846bc1]['id'],'interface':_['isNil'](_0x215f58[_0x587a('0xa5')])?util[_0x587a('0xa6')](_0x587a('0xa7'),_0x215f58[_0x587a('0x3a')]):_0x215f58['interface'],'paused':_0x215f58[_0x587a('0xa8')]||![],'penalty':_0x39d51f[_0x587a('0x5f')][_0x587a('0xa9')]||0x0});}return Promise[_0x587a('0x59')](_0x36b86c[_0x587a('0x89')](function(_0x516425){return db['UserVoiceQueueRt'][_0x587a('0xaa')](_0x516425);}));}return _0x2f25c9;});}})[_0x587a('0x2b')](respondWithStatusCode(_0xfbee66,null))['catch'](handleError(_0xfbee66,null));};exports[_0x587a('0xab')]=function(_0x4d690b,_0x40d4f3){var _0x359168,_0x3bce22;return db[_0x587a('0x48')][_0x587a('0x5e')]({'where':{'id':_0x4d690b[_0x587a('0x5a')]['id']},'attributes':['id',_0x587a('0x3a'),_0x587a('0x2c')]})['then'](handleEntityNotFound(_0x40d4f3,null))[_0x587a('0x2b')](function(_0x29428a){if(_0x29428a){_0x359168=_0x29428a;if(!_0x4d690b[_0x587a('0x4a')][_0x587a('0xac')]||!utils[_0x587a('0x9d')](_0x4d690b['query'][_0x587a('0xac')])){throw new db[(_0x587a('0x8d'))][(_0x587a('0x8e'))]('Unknown\x20channel');}return _0x29428a[_0x587a('0xad')+_['capitalize'](_0x4d690b[_0x587a('0x4a')][_0x587a('0xac')][_0x587a('0xa1')]())+_0x587a('0xa0')](_0x4d690b[_0x587a('0x4a')]['ids']);}})[_0x587a('0x2b')](function(_0x281ca0){if(_[_0x587a('0xae')](_0x4d690b['query'][_0x587a('0x62')])){for(var _0x4643c1=0x0;_0x4643c1<_0x4d690b[_0x587a('0x4a')][_0x587a('0x62')][_0x587a('0x6b')];_0x4643c1+=0x1){_0x3bce22={'UserId':Number(_0x4d690b['params']['id'])};_0x3bce22[_['capitalize'](_0x4d690b[_0x587a('0x4a')][_0x587a('0xac')][_0x587a('0xa1')]())+_0x587a('0xaf')]=Number(_0x4d690b[_0x587a('0x4a')][_0x587a('0x62')][_0x4643c1]);socket[_0x587a('0x2e')](_0x587a('0x33')+_[_0x587a('0x9f')](_0x4d690b['query']['channel']['toLowerCase']())+_0x587a('0xb0'),_0x3bce22);}}else{_0x3bce22={'UserId':Number(_0x4d690b[_0x587a('0x5a')]['id'])};_0x3bce22[_[_0x587a('0x9f')](_0x4d690b[_0x587a('0x4a')][_0x587a('0xac')][_0x587a('0xa1')]())+_0x587a('0xaf')]=Number(_0x4d690b['query'][_0x587a('0x62')]);socket['emit']('user'+_[_0x587a('0x9f')](_0x4d690b[_0x587a('0x4a')][_0x587a('0xac')][_0x587a('0xa1')]())+'Queue:remove',_0x3bce22);}return _0x281ca0;})['then'](function(){if(_0x4d690b[_0x587a('0x4a')][_0x587a('0xac')]===_0x587a('0xa3')){return db[_0x587a('0xb1')][_0x587a('0x3c')]({'where':{'UserId':_0x4d690b[_0x587a('0x5a')]['id'],'VoiceQueueId':_0x4d690b['query'][_0x587a('0x62')]},'individualHooks':!![]})[_0x587a('0x2b')](function(){return _0x359168;});}return _0x359168;})[_0x587a('0x2b')](respondWithStatusCode(_0x40d4f3,null))[_0x587a('0x29')](handleError(_0x40d4f3,null));};exports['addAvatar']=function(_0x109b85,_0x246e43){_0x109b85[_0x587a('0x5f')][_0x587a('0xb2')]=_0x109b85[_0x587a('0xb3')][_0x587a('0xb4')];return db['User']['find']({'where':{'id':_0x109b85[_0x587a('0x5a')]['id']}})[_0x587a('0x2b')](handleEntityNotFound(_0x246e43,null))['then'](saveUpdates(_0x109b85['body'],null))[_0x587a('0x2b')](respondWithResult(_0x246e43,null))[_0x587a('0x29')](handleError(_0x246e43,null));};exports[_0x587a('0xb5')]=function(_0x294f41,_0x105a4b){var _0x2100c6=path[_0x587a('0xb6')](config['root'],_0x587a('0xb7'));return db[_0x587a('0x48')][_0x587a('0x5e')]({'where':{'id':_0x294f41['params']['id']},'attributes':['id',_0x587a('0xb2')],'raw':!![]})['then'](handleEntityNotFound(_0x105a4b,null))[_0x587a('0x2b')](function(_0x47ecc8){if(_0x47ecc8){if(_[_0x587a('0x67')](_0x47ecc8['userpic'])){return _0x105a4b[_0x587a('0xb8')](_0x2100c6);}else{if(!fs['existsSync'](path['join'](config[_0x587a('0xb9')],_0x587a('0xba'),_0x47ecc8['userpic']))){return _0x105a4b[_0x587a('0xb8')](_0x2100c6);}return _0x105a4b[_0x587a('0xb8')](path[_0x587a('0xb6')](config[_0x587a('0xb9')],_0x587a('0xba'),_0x47ecc8[_0x587a('0xb2')]));}}})[_0x587a('0x29')](handleError(_0x105a4b,null));};exports[_0x587a('0xbb')]=function(_0x447fa4,_0xba9f99){return db[_0x587a('0x48')][_0x587a('0x5e')]({'where':{'id':_0x447fa4[_0x587a('0x5a')]['id']},'attributes':['id']})[_0x587a('0x2b')](handleEntityNotFound(_0xba9f99,null))[_0x587a('0x2b')](function(_0x1a3c22){var _0xde20e2=[];values=_0x1a3c22[_0x587a('0x54')];_0xde20e2['push'](get_open_tabs(_0x587a('0x52'),_0x1a3c22[_0x587a('0x54')]));_0xde20e2[_0x587a('0x4e')](get_open_tabs(_0x587a('0x53'),_0x1a3c22[_0x587a('0x54')]));_0xde20e2[_0x587a('0x4e')](get_open_tabs(_0x587a('0x57'),_0x1a3c22['dataValues']));_0xde20e2[_0x587a('0x4e')](get_open_tabs(_0x587a('0x58'),_0x1a3c22['dataValues']));_0xde20e2[_0x587a('0x4e')](get_open_tabs(_0x587a('0x55'),_0x1a3c22['dataValues']));_0xde20e2[_0x587a('0x4e')](get_open_tabs(_0x587a('0x56'),_0x1a3c22[_0x587a('0x54')]));return Promise[_0x587a('0x59')](_0xde20e2);})[_0x587a('0x2b')](function(_0xb4d7e5){if(_0xb4d7e5){var _0x5e5ddf=_[_0x587a('0x89')](values['ChatOpenTabs'],function(_0x307bc2){return{'channel':_0x587a('0xbc'),'id':_0x307bc2['id'],'createdAt':_0x307bc2[_0x587a('0xbd')]};});var _0x2b6293=_[_0x587a('0x89')](values[_0x587a('0xbe')],function(_0x2a7ce0){return{'channel':_0x587a('0xbf'),'id':_0x2a7ce0['id'],'createdAt':_0x2a7ce0[_0x587a('0xbd')]};});var _0x1a649d=_[_0x587a('0x89')](values[_0x587a('0xc0')],function(_0x379da6){return{'channel':_0x587a('0xc1'),'id':_0x379da6['id'],'createdAt':_0x379da6[_0x587a('0xbd')]};});var _0x2639a3=_['map'](values[_0x587a('0xc2')],function(_0x42955a){return{'channel':_0x587a('0xc3'),'id':_0x42955a['id'],'createdAt':_0x42955a[_0x587a('0xbd')]};});var _0x1d19e2=_[_0x587a('0x89')](values[_0x587a('0xc4')],function(_0x367dcd){return{'channel':'SMS','id':_0x367dcd['id'],'createdAt':_0x367dcd[_0x587a('0xbd')]};});var _0x11247e=_[_0x587a('0x89')](values[_0x587a('0xc5')],function(_0x127417){return{'channel':_0x587a('0xc6'),'id':_0x127417['id'],'createdAt':_0x127417['createdAt']};});var _0x4a8d0d=_[_0x587a('0xc7')](_0x5e5ddf,_0x2b6293,_0x1a649d,_0x2639a3,_0x1d19e2,_0x11247e);var _0x420803={'count':_0x4a8d0d[_0x587a('0x6b')],'rows':_0x4a8d0d};return _0x420803;}else return null;})['then'](respondWithResult(_0xba9f99,null))[_0x587a('0x29')](handleError(_0xba9f99,null));};exports[_0x587a('0xc8')]=function(_0x45cc71,_0x13db48){var _0x364d5f={};return db[_0x587a('0x48')][_0x587a('0x94')]({'where':{'id':_0x45cc71[_0x587a('0x5a')]['id']}})[_0x587a('0x2b')](function(_0x5c7586){if(!_0x5c7586){throw new APINotFoundError(util[_0x587a('0xa6')](_0x587a('0xc9'),_0x45cc71[_0x587a('0x5a')]['id']));}return contacts[_0x587a('0x60')]();})[_0x587a('0x2b')](function(_0x486504){_0x45cc71[_0x587a('0x4a')]['User']=_0x45cc71[_0x587a('0x5a')]['id'];_0x364d5f=qs[_0x587a('0x47')](_0x486504,_0x45cc71);if(_0x45cc71[_0x587a('0x4a')][_0x587a('0xca')](_0x587a('0xcb'))){_0x364d5f[_0x587a('0x49')]=[{'model':db[_0x587a('0xcc')],'as':_0x587a('0xcd'),'required':![]},{'model':db[_0x587a('0xce')],'as':_0x587a('0xcf'),'attributes':['id',_0x587a('0x3a'),_0x587a('0xd0')],'where':_0x45cc71[_0x587a('0x4a')][_0x587a('0xd1')]?{'id':_0x45cc71['query']['tag']}:undefined,'required':_0x45cc71[_0x587a('0x4a')][_0x587a('0xd1')]?!![]:![]}];}return contacts['findAll'](_0x45cc71[_0x587a('0x4a')],_0x45cc71[_0x587a('0x33')],_0x364d5f,_0x486504);})[_0x587a('0x2b')](respondWithFilteredResult(_0x13db48,_0x364d5f))[_0x587a('0x29')](APIHandleError(_0x13db48));};exports[_0x587a('0xd2')]=function(_0x42aad7,_0xed2af7){var _0x146630;var _0x38e02a={};var _0x5b925c;return db[_0x587a('0x48')][_0x587a('0x94')]({'where':{'id':_0x42aad7[_0x587a('0x5a')]['id']},'attributes':['id','name','role']})[_0x587a('0x2b')](handleEntityNotFound(_0xed2af7,null))[_0x587a('0x2b')](function(_0x4bb146){if(!utils[_0x587a('0x9d')](_0x42aad7[_0x587a('0x4a')][_0x587a('0xac')])){throw new db[(_0x587a('0x8d'))]['ValidationError'](_0x587a('0xd3'));}_0x146630=_0x4bb146;var _0x189a80={};_0x189a80['model']=_[_0x587a('0xd4')](db[_['capitalize'](_0x42aad7['query'][_0x587a('0xac')])+'Queue'][_0x587a('0xd5')]);_0x189a80[_0x587a('0x4a')]=_[_0x587a('0xd4')](_0x42aad7['query']);_0x189a80[_0x587a('0xd6')]=_[_0x587a('0xd7')](_0x189a80[_0x587a('0xd8')],_0x189a80[_0x587a('0x4a')]);_0x38e02a[_0x587a('0x5d')]=_['intersection'](_0x189a80[_0x587a('0xd8')],qs[_0x587a('0xd9')](_0x42aad7['query'][_0x587a('0xd9')]));_0x38e02a[_0x587a('0x5d')]=_0x38e02a['attributes']['length']?_0x38e02a['attributes']:_0x189a80[_0x587a('0xd8')];_0x38e02a[_0x587a('0xda')]=qs[_0x587a('0xdb')](_0x42aad7['query'][_0x587a('0xdb')]);_0x38e02a['where']=qs[_0x587a('0xd6')](_[_0x587a('0xdc')](_0x42aad7[_0x587a('0x4a')],_0x189a80['filters']));if(_0x42aad7[_0x587a('0x4a')]['filter']){_0x38e02a[_0x587a('0xdd')]=_[_0x587a('0x5b')](_0x38e02a['where'],{'$or':_[_0x587a('0x89')](_0x38e02a[_0x587a('0x5d')],function(_0x111b1f){var _0x602a87={};_0x602a87[_0x111b1f]={'$like':'%'+_0x42aad7['query'][_0x587a('0x40')]+'%'};return _0x602a87;})});}_0x38e02a=_[_0x587a('0x5b')]({},_0x38e02a,_0x42aad7['options']);switch(_0x146630[_0x587a('0x2c')]){case _0x587a('0x31'):return db[_[_0x587a('0x9f')](_0x42aad7[_0x587a('0x4a')][_0x587a('0xac')])+_0x587a('0xde')]['findAll'](_0x38e02a);case _0x587a('0x33'):case _0x587a('0x2d'):return _0x146630[_0x587a('0x30')+_[_0x587a('0x9f')](_0x42aad7[_0x587a('0x4a')][_0x587a('0xac')])+_0x587a('0xa0')](_0x38e02a);default:throw new db[(_0x587a('0x8d'))][(_0x587a('0x8e'))](_0x587a('0xdf'));}})['then'](function(_0x557253){_0x5b925c=_0x557253[_0x587a('0x6b')];if(!_0x42aad7[_0x587a('0x4a')][_0x587a('0xca')]('nolimit')){_0x38e02a['limit']=qs[_0x587a('0xe0')](_0x42aad7[_0x587a('0x4a')]['limit']);_0x38e02a[_0x587a('0x1c')]=qs['offset'](_0x42aad7[_0x587a('0x4a')][_0x587a('0x1c')]);}switch(_0x146630[_0x587a('0x2c')]){case'admin':return db[_[_0x587a('0x9f')](_0x42aad7[_0x587a('0x4a')][_0x587a('0xac')])+'Queue'][_0x587a('0x4f')](_0x38e02a);case _0x587a('0x33'):case _0x587a('0x2d'):return _0x146630[_0x587a('0x30')+_['capitalize'](_0x42aad7[_0x587a('0x4a')][_0x587a('0xac')])+_0x587a('0xa0')](_0x38e02a);}})[_0x587a('0x2b')](function(_0x99321b){return{'count':_0x5b925c,'rows':_0x99321b};})[_0x587a('0x2b')](respondWithResult(_0xed2af7,null))[_0x587a('0x29')](handleError(_0xed2af7,null));};exports[_0x587a('0xe1')]=function(_0x52f6a3,_0x16db0b){var _0x16e745={};var _0x1892c5={};var _0x489ec8;var _0x22e358;return db[_0x587a('0x48')][_0x587a('0x94')]({'where':{'id':_0x52f6a3[_0x587a('0x5a')]['id']}})[_0x587a('0x2b')](handleEntityNotFound(_0x16db0b,null))['then'](function(_0x392673){if(_0x392673){_0x489ec8=_0x392673;_0x1892c5[_0x587a('0xd8')]=_[_0x587a('0xd4')](db['UserVoiceQueueRt'][_0x587a('0xd5')]);_0x1892c5[_0x587a('0x4a')]=_[_0x587a('0xd4')](_0x52f6a3['query']);_0x1892c5[_0x587a('0xd6')]=_[_0x587a('0xd7')](_0x1892c5['model'],_0x1892c5[_0x587a('0x4a')]);_0x16e745[_0x587a('0x5d')]=_['intersection'](_0x1892c5[_0x587a('0xd8')],qs[_0x587a('0xd9')](_0x52f6a3['query'][_0x587a('0xd9')]));_0x16e745[_0x587a('0x5d')]=_0x16e745['attributes']['length']?_0x16e745[_0x587a('0x5d')]:_0x1892c5[_0x587a('0xd8')];_0x16e745[_0x587a('0xda')]=qs[_0x587a('0xdb')](_0x52f6a3[_0x587a('0x4a')][_0x587a('0xdb')]);_0x16e745['where']=qs[_0x587a('0xd6')](_[_0x587a('0xdc')](_0x52f6a3[_0x587a('0x4a')],_0x1892c5[_0x587a('0xd6')]));if(_0x52f6a3[_0x587a('0x4a')]['filter']){_0x16e745[_0x587a('0xdd')]=_['merge'](_0x16e745['where'],{'$or':_['map'](_0x16e745[_0x587a('0x5d')],function(_0x335143){var _0x271de4={};_0x271de4[_0x335143]={'$like':'%'+_0x52f6a3['query'][_0x587a('0x40')]+'%'};return _0x271de4;})});}_0x16e745=_['merge']({},_0x16e745,_0x52f6a3[_0x587a('0x5c')]);return _0x489ec8[_0x587a('0xe1')](_0x16e745);}})[_0x587a('0x2b')](function(_0x151b7a){if(_0x151b7a){_0x22e358=_0x151b7a[_0x587a('0x6b')];if(!_0x52f6a3[_0x587a('0x4a')][_0x587a('0xca')](_0x587a('0xe2'))){_0x16e745['limit']=qs[_0x587a('0xe0')](_0x52f6a3[_0x587a('0x4a')]['limit']);_0x16e745[_0x587a('0x1c')]=qs[_0x587a('0x1c')](_0x52f6a3[_0x587a('0x4a')]['offset']);}return _0x489ec8[_0x587a('0xe1')](_0x16e745);}})['then'](function(_0x5c3f38){if(_0x5c3f38){return _0x5c3f38?{'count':_0x22e358,'rows':_0x5c3f38}:null;}})[_0x587a('0x2b')](respondWithResult(_0x16db0b,null))[_0x587a('0x29')](handleError(_0x16db0b,null));};exports['getGroups']=function(_0xe7dc3e,_0xf14af2){var _0x5ce9d9={};var _0x36d3a3={};var _0x402bd6;var _0x40f8ba;return db['User'][_0x587a('0x94')]({'where':{'id':_0xe7dc3e[_0x587a('0x5a')]['id']}})[_0x587a('0x2b')](handleEntityNotFound(_0xf14af2,null))['then'](function(_0x2cbfd3){if(_0x2cbfd3){_0x402bd6=_0x2cbfd3;_0x36d3a3[_0x587a('0xd8')]=_[_0x587a('0xd4')](db[_0x587a('0xe3')]['rawAttributes']);_0x36d3a3[_0x587a('0x4a')]=_[_0x587a('0xd4')](_0xe7dc3e[_0x587a('0x4a')]);_0x36d3a3[_0x587a('0xd6')]=_[_0x587a('0xd7')](_0x36d3a3['model'],_0x36d3a3[_0x587a('0x4a')]);_0x5ce9d9[_0x587a('0x5d')]=_[_0x587a('0xd7')](_0x36d3a3[_0x587a('0xd8')],qs['fields'](_0xe7dc3e[_0x587a('0x4a')][_0x587a('0xd9')]));_0x5ce9d9[_0x587a('0x5d')]=_0x5ce9d9[_0x587a('0x5d')][_0x587a('0x6b')]?_0x5ce9d9[_0x587a('0x5d')]:_0x36d3a3[_0x587a('0xd8')];_0x5ce9d9[_0x587a('0xda')]=qs[_0x587a('0xdb')](_0xe7dc3e[_0x587a('0x4a')][_0x587a('0xdb')]);_0x5ce9d9['where']=qs[_0x587a('0xd6')](_['pick'](_0xe7dc3e['query'],_0x36d3a3['filters']));if(_0xe7dc3e[_0x587a('0x4a')][_0x587a('0x40')]){_0x5ce9d9['where']=_[_0x587a('0x5b')](_0x5ce9d9[_0x587a('0xdd')],{'$or':_[_0x587a('0x89')](_0x5ce9d9[_0x587a('0x5d')],function(_0x4048b9){var _0x3aad46={};_0x3aad46[_0x4048b9]={'$like':'%'+_0xe7dc3e[_0x587a('0x4a')][_0x587a('0x40')]+'%'};return _0x3aad46;})});}_0x5ce9d9=_['merge']({},_0x5ce9d9,_0xe7dc3e[_0x587a('0x5c')]);return _0x402bd6[_0x587a('0xe4')](_0x5ce9d9);}})[_0x587a('0x2b')](function(_0x1dc63b){if(_0x1dc63b){_0x40f8ba=_0x1dc63b['length'];if(!_0xe7dc3e[_0x587a('0x4a')][_0x587a('0xca')]('nolimit')){_0x5ce9d9[_0x587a('0xe0')]=qs[_0x587a('0xe0')](_0xe7dc3e[_0x587a('0x4a')]['limit']);_0x5ce9d9[_0x587a('0x1c')]=qs[_0x587a('0x1c')](_0xe7dc3e[_0x587a('0x4a')]['offset']);}return _0x402bd6[_0x587a('0xe4')](_0x5ce9d9);}})['then'](function(_0x3c9f8b){if(_0x3c9f8b){return _0x3c9f8b?{'count':_0x40f8ba,'rows':_0x3c9f8b}:null;}})[_0x587a('0x2b')](respondWithResult(_0xf14af2,null))['catch'](handleError(_0xf14af2,null));};exports[_0x587a('0xe5')]=function(_0x10e5a8,_0x4574a3){var _0x2d90ab={'raw':!![],'where':{}};var _0x54d1ec={};var _0x152278={'count':0x0,'rows':[]};return db[_0x587a('0x48')][_0x587a('0x94')]({'where':{'id':_0x10e5a8[_0x587a('0x5a')]['id']}})[_0x587a('0x2b')](handleEntityNotFound(_0x4574a3,null))[_0x587a('0x2b')](function(_0x155b47){if(_0x155b47){_0x54d1ec['model']=_['keys'](db[_0x587a('0xe6')][_0x587a('0xd5')]);_0x54d1ec[_0x587a('0x4a')]=_[_0x587a('0xd4')](_0x10e5a8['query']);_0x54d1ec[_0x587a('0xd6')]=_[_0x587a('0xd7')](_0x54d1ec[_0x587a('0xd8')],_0x54d1ec[_0x587a('0x4a')]);_0x2d90ab[_0x587a('0x5d')]=_[_0x587a('0xd7')](_0x54d1ec[_0x587a('0xd8')],qs[_0x587a('0xd9')](_0x10e5a8[_0x587a('0x4a')][_0x587a('0xd9')]));_0x2d90ab['attributes']=_0x2d90ab[_0x587a('0x5d')]['length']?_0x2d90ab[_0x587a('0x5d')]:_0x54d1ec[_0x587a('0xd8')];if(!_0x10e5a8[_0x587a('0x4a')]['hasOwnProperty'](_0x587a('0xe2'))){_0x2d90ab[_0x587a('0xe0')]=qs['limit'](_0x10e5a8['query'][_0x587a('0xe0')]);_0x2d90ab[_0x587a('0x1c')]=qs[_0x587a('0x1c')](_0x10e5a8[_0x587a('0x4a')][_0x587a('0x1c')]);}_0x2d90ab[_0x587a('0xda')]=qs['sort'](_0x10e5a8[_0x587a('0x4a')]['sort']);_0x2d90ab[_0x587a('0xdd')]=qs['filters'](_['pick'](_0x10e5a8[_0x587a('0x4a')],_0x54d1ec[_0x587a('0xd6')]));_0x2d90ab[_0x587a('0xdd')]['UserId']=_0x155b47['id'];if(_0x10e5a8[_0x587a('0x4a')]['filter']){_0x2d90ab[_0x587a('0xdd')]=_['merge'](_0x2d90ab['where'],{'$or':_[_0x587a('0x89')](_0x2d90ab['attributes'],function(_0x1a1df3){var _0x12f84e={};_0x12f84e[_0x1a1df3]={'$like':'%'+_0x10e5a8[_0x587a('0x4a')][_0x587a('0x40')]+'%'};return _0x12f84e;})});}_0x2d90ab=_[_0x587a('0x5b')]({},_0x2d90ab,_0x10e5a8[_0x587a('0x5c')]);return db[_0x587a('0xe6')][_0x587a('0x1d')]({'where':_0x2d90ab[_0x587a('0xdd')]})['then'](function(_0x1efa66){_0x152278['count']=_0x1efa66;if(_0x10e5a8[_0x587a('0x4a')][_0x587a('0xcb')]){_0x2d90ab['include']=[{'all':!![]}];}return db['VoiceRecording'][_0x587a('0x4f')](_0x2d90ab);})[_0x587a('0x2b')](function(_0x24fffa){_0x152278[_0x587a('0x51')]=_0x24fffa;return _0x152278;});}})[_0x587a('0x2b')](respondWithFilteredResult(_0x4574a3,_0x2d90ab))[_0x587a('0x29')](handleError(_0x4574a3,null));};exports[_0x587a('0xe7')]=function(_0x1dd61f,_0x3597c2){var _0x36c2c5={'raw':!![],'where':{}};var _0x7079e0={};var _0x272ae0={'count':0x0,'rows':[]};return db['User'][_0x587a('0x94')]({'where':{'id':_0x1dd61f[_0x587a('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3597c2,null))[_0x587a('0x2b')](function(_0x1cc387){if(_0x1cc387){_0x7079e0[_0x587a('0xd8')]=_[_0x587a('0xd4')](db[_0x587a('0xe8')]['rawAttributes']);_0x7079e0[_0x587a('0x4a')]=_[_0x587a('0xd4')](_0x1dd61f[_0x587a('0x4a')]);_0x7079e0[_0x587a('0xd6')]=_[_0x587a('0xd7')](_0x7079e0[_0x587a('0xd8')],_0x7079e0[_0x587a('0x4a')]);_0x36c2c5[_0x587a('0x5d')]=_[_0x587a('0xd7')](_0x7079e0['model'],qs[_0x587a('0xd9')](_0x1dd61f['query']['fields']));_0x36c2c5['attributes']=_0x36c2c5['attributes'][_0x587a('0x6b')]?_0x36c2c5[_0x587a('0x5d')]:_0x7079e0[_0x587a('0xd8')];if(!_0x1dd61f['query']['hasOwnProperty'](_0x587a('0xe2'))){_0x36c2c5[_0x587a('0xe0')]=qs[_0x587a('0xe0')](_0x1dd61f[_0x587a('0x4a')][_0x587a('0xe0')]);_0x36c2c5['offset']=qs['offset'](_0x1dd61f[_0x587a('0x4a')][_0x587a('0x1c')]);}_0x36c2c5[_0x587a('0xda')]=qs['sort'](_0x1dd61f['query'][_0x587a('0xdb')]);_0x36c2c5[_0x587a('0xdd')]=qs[_0x587a('0xd6')](_['pick'](_0x1dd61f[_0x587a('0x4a')],_0x7079e0['filters']));_0x36c2c5[_0x587a('0xdd')][_0x587a('0xe9')]=_0x1cc387['id'];if(_0x1dd61f[_0x587a('0x4a')][_0x587a('0x40')]){_0x36c2c5[_0x587a('0xdd')]=_[_0x587a('0x5b')](_0x36c2c5['where'],{'$or':_[_0x587a('0x89')](_0x36c2c5[_0x587a('0x5d')],function(_0x1ba4e2){var _0xb16139={};_0xb16139[_0x1ba4e2]={'$like':'%'+_0x1dd61f[_0x587a('0x4a')][_0x587a('0x40')]+'%'};return _0xb16139;})});}_0x36c2c5=_['merge']({},_0x36c2c5,_0x1dd61f['options']);return db[_0x587a('0xe8')]['count']({'where':_0x36c2c5['where']})[_0x587a('0x2b')](function(_0xad8930){_0x272ae0['count']=_0xad8930;if(_0x1dd61f['query'][_0x587a('0xcb')]){_0x36c2c5[_0x587a('0x49')]=[{'all':!![]}];}return db['ScreenRecording'][_0x587a('0x4f')](_0x36c2c5);})[_0x587a('0x2b')](function(_0x229cdc){_0x272ae0[_0x587a('0x51')]=_0x229cdc;return _0x272ae0;});}})[_0x587a('0x2b')](respondWithFilteredResult(_0x3597c2,_0x36c2c5))[_0x587a('0x29')](handleError(_0x3597c2,null));};exports[_0x587a('0xea')]=function(_0x278622,_0x32283c){var _0x47d06e={};var _0xcab387={};var _0x757a98;var _0x25752c;return db[_0x587a('0x48')][_0x587a('0x94')]({'where':{'id':_0x278622['params']['id']}})[_0x587a('0x2b')](handleEntityNotFound(_0x32283c,null))[_0x587a('0x2b')](function(_0x4acf6e){if(_0x4acf6e){_0x757a98=_0x4acf6e;_0xcab387[_0x587a('0xd8')]=_[_0x587a('0xd4')](db[_0x587a('0xeb')][_0x587a('0xd5')]);_0xcab387[_0x587a('0x4a')]=_[_0x587a('0xd4')](_0x278622[_0x587a('0x4a')]);_0xcab387[_0x587a('0xd6')]=_[_0x587a('0xd7')](_0xcab387[_0x587a('0xd8')],_0xcab387[_0x587a('0x4a')]);_0x47d06e[_0x587a('0x5d')]=_[_0x587a('0xd7')](_0xcab387['model'],qs[_0x587a('0xd9')](_0x278622[_0x587a('0x4a')][_0x587a('0xd9')]));_0x47d06e['attributes']=_0x47d06e[_0x587a('0x5d')][_0x587a('0x6b')]?_0x47d06e['attributes']:_0xcab387[_0x587a('0xd8')];_0x47d06e['order']=qs['sort'](_0x278622[_0x587a('0x4a')]['sort']);_0x47d06e['where']=qs['filters'](_[_0x587a('0xdc')](_0x278622[_0x587a('0x4a')],_0xcab387[_0x587a('0xd6')]));if(_0x278622['query'][_0x587a('0x40')]){_0x47d06e[_0x587a('0xdd')]=_[_0x587a('0x5b')](_0x47d06e[_0x587a('0xdd')],{'$or':_[_0x587a('0x89')](_0x47d06e[_0x587a('0x5d')],function(_0x5e050e){var _0x22bcdc={};_0x22bcdc[_0x5e050e]={'$like':'%'+_0x278622[_0x587a('0x4a')][_0x587a('0x40')]+'%'};return _0x22bcdc;})});}_0x47d06e=_[_0x587a('0x5b')]({},_0x47d06e,_0x278622[_0x587a('0x5c')]);return _0x757a98['getChatInteractions'](_0x47d06e);}})[_0x587a('0x2b')](function(_0x127539){if(_0x127539){_0x25752c=_0x127539[_0x587a('0x6b')];if(!_0x278622[_0x587a('0x4a')][_0x587a('0xca')](_0x587a('0xe2'))){_0x47d06e[_0x587a('0xe0')]=qs[_0x587a('0xe0')](_0x278622[_0x587a('0x4a')]['limit']);_0x47d06e['offset']=qs[_0x587a('0x1c')](_0x278622[_0x587a('0x4a')][_0x587a('0x1c')]);}return _0x757a98[_0x587a('0xea')](_0x47d06e);}})[_0x587a('0x2b')](function(_0x3ceb6b){if(_0x3ceb6b){return _0x3ceb6b?{'count':_0x25752c,'rows':_0x3ceb6b}:null;}})['then'](respondWithResult(_0x32283c,null))[_0x587a('0x29')](handleError(_0x32283c,null));};exports['getOpenchannelInteractions']=function(_0x4d3371,_0x53cd7f){var _0x12a8eb={};var _0x4a2a48={};var _0x4f3efd;var _0x7ba736;return db[_0x587a('0x48')][_0x587a('0x94')]({'where':{'id':_0x4d3371[_0x587a('0x5a')]['id']}})[_0x587a('0x2b')](handleEntityNotFound(_0x53cd7f,null))['then'](function(_0x14b385){if(_0x14b385){_0x4f3efd=_0x14b385;_0x4a2a48['model']=_[_0x587a('0xd4')](db[_0x587a('0xec')][_0x587a('0xd5')]);_0x4a2a48[_0x587a('0x4a')]=_[_0x587a('0xd4')](_0x4d3371[_0x587a('0x4a')]);_0x4a2a48[_0x587a('0xd6')]=_[_0x587a('0xd7')](_0x4a2a48[_0x587a('0xd8')],_0x4a2a48[_0x587a('0x4a')]);_0x12a8eb['attributes']=_[_0x587a('0xd7')](_0x4a2a48[_0x587a('0xd8')],qs[_0x587a('0xd9')](_0x4d3371[_0x587a('0x4a')][_0x587a('0xd9')]));_0x12a8eb[_0x587a('0x5d')]=_0x12a8eb[_0x587a('0x5d')][_0x587a('0x6b')]?_0x12a8eb[_0x587a('0x5d')]:_0x4a2a48[_0x587a('0xd8')];_0x12a8eb[_0x587a('0xda')]=qs[_0x587a('0xdb')](_0x4d3371[_0x587a('0x4a')][_0x587a('0xdb')]);_0x12a8eb[_0x587a('0xdd')]=qs[_0x587a('0xd6')](_[_0x587a('0xdc')](_0x4d3371['query'],_0x4a2a48[_0x587a('0xd6')]));if(_0x4d3371[_0x587a('0x4a')][_0x587a('0x40')]){_0x12a8eb['where']=_[_0x587a('0x5b')](_0x12a8eb[_0x587a('0xdd')],{'$or':_[_0x587a('0x89')](_0x12a8eb[_0x587a('0x5d')],function(_0x13a76c){var _0x553c64={};_0x553c64[_0x13a76c]={'$like':'%'+_0x4d3371[_0x587a('0x4a')][_0x587a('0x40')]+'%'};return _0x553c64;})});}_0x12a8eb=_[_0x587a('0x5b')]({},_0x12a8eb,_0x4d3371[_0x587a('0x5c')]);return _0x4f3efd[_0x587a('0xed')](_0x12a8eb);}})['then'](function(_0x24fe99){if(_0x24fe99){_0x7ba736=_0x24fe99[_0x587a('0x6b')];if(!_0x4d3371[_0x587a('0x4a')]['hasOwnProperty'](_0x587a('0xe2'))){_0x12a8eb[_0x587a('0xe0')]=qs[_0x587a('0xe0')](_0x4d3371[_0x587a('0x4a')]['limit']);_0x12a8eb[_0x587a('0x1c')]=qs['offset'](_0x4d3371[_0x587a('0x4a')]['offset']);}return _0x4f3efd['getOpenchannelInteractions'](_0x12a8eb);}})['then'](function(_0x2bda0f){if(_0x2bda0f){return _0x2bda0f?{'count':_0x7ba736,'rows':_0x2bda0f}:null;}})['then'](respondWithResult(_0x53cd7f,null))[_0x587a('0x29')](handleError(_0x53cd7f,null));};exports[_0x587a('0xee')]=function(_0x35eac3,_0xc6fd2c){var _0xae044e={'raw':!![],'where':{}};var _0x1c8267={};var _0x3237d1={'count':0x0,'rows':[]};return db['User'][_0x587a('0x94')]({'where':{'id':_0x35eac3['params']['id']}})[_0x587a('0x2b')](handleEntityNotFound(_0xc6fd2c,null))[_0x587a('0x2b')](function(_0x3680a8){if(_0x3680a8){_0x1c8267[_0x587a('0xd8')]=_[_0x587a('0xd4')](db[_0x587a('0xef')][_0x587a('0xd5')]);_0x1c8267[_0x587a('0x4a')]=_[_0x587a('0xd4')](_0x35eac3['query']);_0x1c8267['filters']=_[_0x587a('0xd7')](_0x1c8267[_0x587a('0xd8')],_0x1c8267[_0x587a('0x4a')]);_0xae044e[_0x587a('0x5d')]=_[_0x587a('0xd7')](_0x1c8267[_0x587a('0xd8')],qs[_0x587a('0xd9')](_0x35eac3[_0x587a('0x4a')][_0x587a('0xd9')]));_0xae044e[_0x587a('0x5d')]=_0xae044e['attributes'][_0x587a('0x6b')]?_0xae044e[_0x587a('0x5d')]:_0x1c8267['model'];if(!_0x35eac3['query'][_0x587a('0xca')](_0x587a('0xe2'))){_0xae044e[_0x587a('0xe0')]=qs[_0x587a('0xe0')](_0x35eac3[_0x587a('0x4a')]['limit']);_0xae044e[_0x587a('0x1c')]=qs[_0x587a('0x1c')](_0x35eac3[_0x587a('0x4a')][_0x587a('0x1c')]);}_0xae044e['order']=qs[_0x587a('0xdb')](_0x35eac3[_0x587a('0x4a')][_0x587a('0xdb')]);_0xae044e[_0x587a('0xdd')]=qs[_0x587a('0xd6')](_['pick'](_0x35eac3[_0x587a('0x4a')],_0x1c8267[_0x587a('0xd6')]));_0xae044e[_0x587a('0xdd')]['UserId']=_0x3680a8['id'];if(_0x35eac3['query'][_0x587a('0x40')]){_0xae044e['where']=_[_0x587a('0x5b')](_0xae044e[_0x587a('0xdd')],{'$or':_[_0x587a('0x89')](_0xae044e[_0x587a('0x5d')],function(_0x3b1c32){var _0x1cb662={};_0x1cb662[_0x3b1c32]={'$like':'%'+_0x35eac3[_0x587a('0x4a')][_0x587a('0x40')]+'%'};return _0x1cb662;})});}_0xae044e=_[_0x587a('0x5b')]({},_0xae044e,_0x35eac3[_0x587a('0x5c')]);return db[_0x587a('0xef')][_0x587a('0x1d')]({'where':_0xae044e[_0x587a('0xdd')]})[_0x587a('0x2b')](function(_0x5de6d4){_0x3237d1[_0x587a('0x1d')]=_0x5de6d4;if(_0x35eac3[_0x587a('0x4a')]['includeAll']){_0xae044e['include']=[{'all':!![]}];}return db['MailInteraction'][_0x587a('0x4f')](_0xae044e);})['then'](function(_0x3c2880){_0x3237d1['rows']=_0x3c2880;return _0x3237d1;});}})['then'](respondWithFilteredResult(_0xc6fd2c,_0xae044e))[_0x587a('0x29')](handleError(_0xc6fd2c,null));};exports[_0x587a('0xf0')]=function(_0x530d6a,_0x51eb93){var _0xadabab={};var _0x37c01a={};var _0x1d45a1;var _0x1da918;return db['User'][_0x587a('0x94')]({'where':{'id':_0x530d6a[_0x587a('0x5a')]['id']}})[_0x587a('0x2b')](handleEntityNotFound(_0x51eb93,null))['then'](function(_0xfcba7a){if(_0xfcba7a){_0x1d45a1=_0xfcba7a;_0x37c01a[_0x587a('0xd8')]=_[_0x587a('0xd4')](db[_0x587a('0xf1')][_0x587a('0xd5')]);_0x37c01a[_0x587a('0x4a')]=_[_0x587a('0xd4')](_0x530d6a[_0x587a('0x4a')]);_0x37c01a[_0x587a('0xd6')]=_[_0x587a('0xd7')](_0x37c01a[_0x587a('0xd8')],_0x37c01a['query']);_0xadabab['attributes']=_[_0x587a('0xd7')](_0x37c01a[_0x587a('0xd8')],qs[_0x587a('0xd9')](_0x530d6a[_0x587a('0x4a')][_0x587a('0xd9')]));_0xadabab[_0x587a('0x5d')]=_0xadabab['attributes'][_0x587a('0x6b')]?_0xadabab['attributes']:_0x37c01a[_0x587a('0xd8')];_0xadabab[_0x587a('0xda')]=qs[_0x587a('0xdb')](_0x530d6a[_0x587a('0x4a')]['sort']);_0xadabab[_0x587a('0xdd')]=qs[_0x587a('0xd6')](_['pick'](_0x530d6a[_0x587a('0x4a')],_0x37c01a['filters']));if(_0x530d6a[_0x587a('0x4a')]['filter']){_0xadabab[_0x587a('0xdd')]=_['merge'](_0xadabab[_0x587a('0xdd')],{'$or':_['map'](_0xadabab[_0x587a('0x5d')],function(_0xc10c5e){var _0x3e30e4={};_0x3e30e4[_0xc10c5e]={'$like':'%'+_0x530d6a['query'][_0x587a('0x40')]+'%'};return _0x3e30e4;})});}_0xadabab=_['merge']({},_0xadabab,_0x530d6a['options']);return _0x1d45a1[_0x587a('0xf0')](_0xadabab);}})['then'](function(_0x40da6d){if(_0x40da6d){_0x1da918=_0x40da6d[_0x587a('0x6b')];if(!_0x530d6a['query']['hasOwnProperty']('nolimit')){_0xadabab['limit']=qs['limit'](_0x530d6a[_0x587a('0x4a')][_0x587a('0xe0')]);_0xadabab[_0x587a('0x1c')]=qs[_0x587a('0x1c')](_0x530d6a[_0x587a('0x4a')][_0x587a('0x1c')]);}return _0x1d45a1[_0x587a('0xf0')](_0xadabab);}})['then'](function(_0x5e3e90){if(_0x5e3e90){return _0x5e3e90?{'count':_0x1da918,'rows':_0x5e3e90}:null;}})['then'](respondWithResult(_0x51eb93,null))[_0x587a('0x29')](handleError(_0x51eb93,null));};exports[_0x587a('0xf2')]=function(_0xd7a023,_0x2729a1){var _0x5867ad={};var _0x9bacd6={};var _0x4b42ba;var _0x397a75;return db[_0x587a('0x48')]['findOne']({'where':{'id':_0xd7a023[_0x587a('0x5a')]['id']}})[_0x587a('0x2b')](handleEntityNotFound(_0x2729a1,null))['then'](function(_0x3849ee){if(_0x3849ee){_0x4b42ba=_0x3849ee;_0x9bacd6['model']=_['keys'](db['FaxInteraction'][_0x587a('0xd5')]);_0x9bacd6[_0x587a('0x4a')]=_[_0x587a('0xd4')](_0xd7a023[_0x587a('0x4a')]);_0x9bacd6[_0x587a('0xd6')]=_[_0x587a('0xd7')](_0x9bacd6['model'],_0x9bacd6['query']);_0x5867ad[_0x587a('0x5d')]=_[_0x587a('0xd7')](_0x9bacd6['model'],qs[_0x587a('0xd9')](_0xd7a023[_0x587a('0x4a')][_0x587a('0xd9')]));_0x5867ad[_0x587a('0x5d')]=_0x5867ad['attributes'][_0x587a('0x6b')]?_0x5867ad[_0x587a('0x5d')]:_0x9bacd6['model'];_0x5867ad[_0x587a('0xda')]=qs[_0x587a('0xdb')](_0xd7a023[_0x587a('0x4a')][_0x587a('0xdb')]);_0x5867ad[_0x587a('0xdd')]=qs[_0x587a('0xd6')](_['pick'](_0xd7a023[_0x587a('0x4a')],_0x9bacd6['filters']));if(_0xd7a023[_0x587a('0x4a')][_0x587a('0x40')]){_0x5867ad[_0x587a('0xdd')]=_[_0x587a('0x5b')](_0x5867ad['where'],{'$or':_[_0x587a('0x89')](_0x5867ad[_0x587a('0x5d')],function(_0x41de1c){var _0x329c7f={};_0x329c7f[_0x41de1c]={'$like':'%'+_0xd7a023['query']['filter']+'%'};return _0x329c7f;})});}_0x5867ad=_['merge']({},_0x5867ad,_0xd7a023[_0x587a('0x5c')]);return _0x4b42ba[_0x587a('0xf2')](_0x5867ad);}})[_0x587a('0x2b')](function(_0x33f017){if(_0x33f017){_0x397a75=_0x33f017['length'];if(!_0xd7a023[_0x587a('0x4a')][_0x587a('0xca')](_0x587a('0xe2'))){_0x5867ad[_0x587a('0xe0')]=qs[_0x587a('0xe0')](_0xd7a023['query'][_0x587a('0xe0')]);_0x5867ad[_0x587a('0x1c')]=qs['offset'](_0xd7a023['query'][_0x587a('0x1c')]);}return _0x4b42ba[_0x587a('0xf2')](_0x5867ad);}})[_0x587a('0x2b')](function(_0x5707af){if(_0x5707af){return _0x5707af?{'count':_0x397a75,'rows':_0x5707af}:null;}})['then'](respondWithResult(_0x2729a1,null))['catch'](handleError(_0x2729a1,null));};exports[_0x587a('0xf3')]=function(_0x2c6f62,_0x3065e9){var _0x135dac={};var _0x2197f7={};var _0x221a67;var _0x50e752;return db[_0x587a('0x48')][_0x587a('0x94')]({'where':{'id':_0x2c6f62['params']['id']}})[_0x587a('0x2b')](handleEntityNotFound(_0x3065e9,null))[_0x587a('0x2b')](function(_0x32fcb5){if(_0x32fcb5){_0x221a67=_0x32fcb5;_0x2197f7[_0x587a('0xd8')]=_[_0x587a('0xd4')](db[_0x587a('0xf4')][_0x587a('0xd5')]);_0x2197f7[_0x587a('0x4a')]=_['keys'](_0x2c6f62[_0x587a('0x4a')]);_0x2197f7['filters']=_[_0x587a('0xd7')](_0x2197f7[_0x587a('0xd8')],_0x2197f7[_0x587a('0x4a')]);_0x135dac[_0x587a('0x5d')]=_['intersection'](_0x2197f7['model'],qs[_0x587a('0xd9')](_0x2c6f62[_0x587a('0x4a')][_0x587a('0xd9')]));_0x135dac[_0x587a('0x5d')]=_0x135dac[_0x587a('0x5d')][_0x587a('0x6b')]?_0x135dac[_0x587a('0x5d')]:_0x2197f7['model'];_0x135dac[_0x587a('0xda')]=qs['sort'](_0x2c6f62['query'][_0x587a('0xdb')]);_0x135dac[_0x587a('0xdd')]=qs[_0x587a('0xd6')](_[_0x587a('0xdc')](_0x2c6f62['query'],_0x2197f7[_0x587a('0xd6')]));if(_0x2c6f62[_0x587a('0x4a')][_0x587a('0x40')]){_0x135dac[_0x587a('0xdd')]=_[_0x587a('0x5b')](_0x135dac[_0x587a('0xdd')],{'$or':_[_0x587a('0x89')](_0x135dac['attributes'],function(_0x35d20a){var _0x1c5a7c={};_0x1c5a7c[_0x35d20a]={'$like':'%'+_0x2c6f62[_0x587a('0x4a')][_0x587a('0x40')]+'%'};return _0x1c5a7c;})});}_0x135dac=_['merge']({},_0x135dac,_0x2c6f62['options']);return _0x221a67[_0x587a('0xf3')](_0x135dac);}})['then'](function(_0x5c6223){if(_0x5c6223){_0x50e752=_0x5c6223[_0x587a('0x6b')];if(!_0x2c6f62[_0x587a('0x4a')][_0x587a('0xca')]('nolimit')){_0x135dac[_0x587a('0xe0')]=qs[_0x587a('0xe0')](_0x2c6f62[_0x587a('0x4a')]['limit']);_0x135dac[_0x587a('0x1c')]=qs[_0x587a('0x1c')](_0x2c6f62['query'][_0x587a('0x1c')]);}return _0x221a67['getWhatsappInteractions'](_0x135dac);}})['then'](function(_0x25e323){if(_0x25e323){return _0x25e323?{'count':_0x50e752,'rows':_0x25e323}:null;}})[_0x587a('0x2b')](respondWithResult(_0x3065e9,null))[_0x587a('0x29')](handleError(_0x3065e9,null));};exports[_0x587a('0xf5')]=function(_0x3128e9,_0x4f4fc0,_0x617e14){var _0x5a1919;var _0x5894d2;var _0x18500b;var _0x67d808=!_['isNil'](_0x3128e9['params']['id'])?_0x3128e9[_0x587a('0x5a')]['id']:!_[_0x587a('0x67')](_0x3128e9[_0x587a('0x33')]['id'])?_0x3128e9[_0x587a('0x33')]['id']:null;return db[_0x587a('0x48')][_0x587a('0x5e')]({'where':{'id':_0x67d808,'role':{'$or':[_0x587a('0x31'),_0x587a('0x33'),_0x587a('0x2d')]}},'attributes':['id',_0x587a('0x3a'),_0x587a('0xf6'),_0x587a('0xf7'),_0x587a('0x2c'),_0x587a('0x63'),'loginInPause']})[_0x587a('0x2b')](function(_0x251afe){if(_0x251afe){if(_0x251afe[_0x587a('0x2c')]==='agent'){_0x5a1919=_0x251afe;if(_0x3128e9[_0x587a('0x5f')]['interface']){_0x18500b=util[_0x587a('0xa6')](_0x587a('0xf8'),_0x5a1919[_0x3128e9[_0x587a('0x5f')][_0x587a('0xa5')]]);}else if(_0x3128e9['body'][_0x587a('0xf9')]){_0x18500b=util[_0x587a('0xa6')](_0x587a('0xa7'),_0x3128e9[_0x587a('0x5f')][_0x587a('0xf9')]);}else{_0x18500b=util[_0x587a('0xa6')]('SIP/%s',_0x5a1919[_0x587a('0x3a')]);}socket['to'](util[_0x587a('0xa6')](_0x587a('0xfa'),_0x5a1919['name']))['emit'](_0x587a('0xfb'),{'user':{'id':_0x5a1919['id'],'name':_0x5a1919[_0x587a('0x3a')]},'ip':_0x3128e9[_0x587a('0xfc')][_0x587a('0xfd')]||_0x3128e9[_0x587a('0xfe')]['remoteAddress']||_0x3128e9[_0x587a('0xff')][_0x587a('0x100')]||_0x3128e9[_0x587a('0xfe')][_0x587a('0xff')][_0x587a('0x100')]});return db[_0x587a('0xb1')][_0x587a('0x3c')]({'where':{'membername':_0x5a1919[_0x587a('0x3a')]},'individualHooks':!![]});}}else{throw new db[(_0x587a('0x8d'))][(_0x587a('0x8e'))]('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})[_0x587a('0x2b')](function(){if(_0x5a1919){return _0x5a1919[_0x587a('0x101')]({'raw':!![]});}})[_0x587a('0x2b')](function(_0x1b5f54){if(_0x5a1919){if(_0x1b5f54){_0x5894d2=_0x1b5f54;if(_0x5894d2['length']){var _0x28fb96=_0x5894d2['map'](function(_0x283137){var _0x4c620c={'membername':_0x5a1919['name'],'UserId':_0x5a1919['id'],'queue_name':_0x283137[_0x587a('0x3a')],'VoiceQueueId':_0x283137['id'],'interface':_0x18500b,'paused':_0x5a1919[_0x587a('0x9c')]||![],'penalty':_0x283137[_0x587a('0x102')]||0x0};return db[_0x587a('0xb1')]['upsert'](_0x4c620c);});return Promise[_0x587a('0x59')](_0x28fb96);}}}})[_0x587a('0x2b')](function(){if(_0x5a1919){return db[_0x587a('0x103')][_0x587a('0x4f')]({'where':{'membername':_0x5a1919[_0x587a('0x3a')],'exitAt':null}});}})[_0x587a('0x2b')](function(_0x325dd9){if(_0x5a1919){var _0x119455=[];_0x325dd9[_0x587a('0x104')](function(_0x42852e){_0x119455[_0x587a('0x4e')](_0x42852e[_0x587a('0x2a')]({'exitAt':moment()[_0x587a('0xa6')](_0x587a('0x105'))}));});return Promise[_0x587a('0x59')](_0x119455);}})[_0x587a('0x2b')](function(){if(_0x5a1919){var _0x3aa312=[];var _0x5305c4=[];var _0xd7cda8=utils[_0x587a('0x106')]();var _0x15349c={'membername':_0x5a1919['name'],'interface':_0x18500b,'enterAt':moment()[_0x587a('0xa6')](_0x587a('0x105')),'role':_0x5a1919[_0x587a('0x2c')],'internal':_0x5a1919['internal']};_0xd7cda8[_0x587a('0x104')](function(_0x5a9814){_0x3aa312['push'](_['merge']({'channel':_0x5a9814,'type':_0x587a('0x107'),'data1':_0x3128e9[_0x587a('0x5f')]['device'],'data2':_0x18500b},_0x15349c));if(_0x5a1919['loginInPause']){_0x5305c4[_0x587a('0x4e')](_[_0x587a('0x5b')]({'channel':_0x5a9814,'type':_0x587a('0x108'),'data1':_0x587a('0x109')},_0x15349c));}});return db[_0x587a('0x103')]['bulkCreate'](_0x3aa312[_0x587a('0xc7')](_0x5305c4),{'individualHooks':!![]});}})['then'](function(){if(_0x5a1919){return _0x5a1919[_0x587a('0x2a')]({'online':!![],'lastLoginAt':moment()[_0x587a('0xa6')](_0x587a('0x105')),'voicePause':_0x5a1919[_0x587a('0x9c')]||![],'mailPause':_0x5a1919[_0x587a('0x9c')]||![],'chatPause':_0x5a1919[_0x587a('0x9c')]||![],'faxPause':_0x5a1919[_0x587a('0x9c')]||![],'smsPause':_0x5a1919[_0x587a('0x9c')]||![],'openchannelPause':_0x5a1919[_0x587a('0x9c')]||![],'whatsappPause':_0x5a1919[_0x587a('0x9c')]||![],'pauseType':_0x5a1919[_0x587a('0x9c')]?'LOGININPAUSE':null,'interface':_0x18500b,'lastPauseAt':moment()['format'](_0x587a('0x105'))});}})[_0x587a('0x2b')](function(_0xe4204f){if(_0x3128e9[_0x587a('0x10a')]){return _0x617e14();}else{return Promise[_0x587a('0x10b')](_0xe4204f)[_0x587a('0x2b')](respondWithResult(_0x4f4fc0,null));}})[_0x587a('0x29')](handleError(_0x4f4fc0,null));};exports[_0x587a('0x10c')]=function(_0x32262c,_0x3c99af){var _0x1a3beb;return db[_0x587a('0x48')][_0x587a('0x5e')]({'where':{'id':_0x32262c[_0x587a('0x5a')]['id'],'role':_0x587a('0x2d')},'attributes':['id',_0x587a('0x3a'),_0x587a('0x2c')]})['then'](handleEntityNotFound(_0x3c99af,null))[_0x587a('0x2b')](function(_0x2240ed){if(_0x2240ed){_0x1a3beb=_0x2240ed;return db[_0x587a('0xb1')][_0x587a('0x3c')]({'where':{'membername':_0x1a3beb[_0x587a('0x3a')]},'individualHooks':!![]});}})[_0x587a('0x2b')](function(){return db[_0x587a('0x103')][_0x587a('0x4f')]({'where':{'membername':_0x1a3beb[_0x587a('0x3a')],'exitAt':null}});})[_0x587a('0x2b')](function(_0xfea55f){var _0xe3ed4=[];_0xfea55f['forEach'](function(_0x32f4c6){_0xe3ed4['push'](_0x32f4c6[_0x587a('0x2a')]({'exitAt':moment()[_0x587a('0xa6')](_0x587a('0x105'))}));});return Promise[_0x587a('0x59')](_0xe3ed4);})[_0x587a('0x2b')](function(){return _0x1a3beb[_0x587a('0x2a')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x587a('0x2b')](respondWithResult(_0x3c99af,null))[_0x587a('0x29')](handleError(_0x3c99af,null));};exports[_0x587a('0x10d')]=function(_0x1b76b5,_0x16f49f){var _0x1d7582;return db[_0x587a('0xb1')]['update']({'paused':0x1},{'where':{'UserId':_0x1b76b5[_0x587a('0x5a')]['id']},'individualHooks':!![]})[_0x587a('0x2b')](function(){return db[_0x587a('0x48')][_0x587a('0x5e')]({'where':{'id':_0x1b76b5[_0x587a('0x5a')]['id'],'role':_0x587a('0x2d')},'attributes':['id',_0x587a('0x3a'),'role','internal',_0x587a('0xa5'),_0x587a('0x9b')]});})['then'](handleEntityNotFound(_0x16f49f,null))[_0x587a('0x2b')](function(_0x1a0248){if(_0x1a0248){_0x1d7582=_0x1a0248;return respondWithRpcPromise(_0x587a('0x10e'),_0x587a('0x10d'),{'id':_0x1d7582['id'],'name':_0x1d7582[_0x587a('0x3a')],'pause':!![]});}})[_0x587a('0x2b')](function(){if(_0x1d7582){return db[_0x587a('0x103')][_0x587a('0x4f')]({'where':{'membername':_0x1d7582[_0x587a('0x3a')],'type':_0x587a('0x108'),'exitAt':null}});}})[_0x587a('0x2b')](function(_0x38e9f3){if(_0x38e9f3['length']){var _0x8fbf14=moment()[_0x587a('0xa6')](_0x587a('0x105'));for(var _0x9d344d=0x0,_0x35f72b=_0x38e9f3[_0x587a('0x6b')];_0x9d344d<_0x35f72b;_0x9d344d++){_0x38e9f3[_0x9d344d]['updateAttributes']({'exitAt':_0x8fbf14});}}})[_0x587a('0x2b')](function(){var _0x30cf50=[];var _0x412af7=utils['getChannels']();_0x412af7['forEach'](function(_0x303c31){_0x30cf50[_0x587a('0x4e')]({'channel':_0x303c31,'membername':_0x1d7582[_0x587a('0x3a')],'interface':_[_0x587a('0x67')](_0x1d7582[_0x587a('0xa5')])?util[_0x587a('0xa6')](_0x587a('0xa7'),_0x1d7582[_0x587a('0x3a')]):_0x1d7582[_0x587a('0xa5')],'type':_0x587a('0x108'),'enterAt':moment()[_0x587a('0xa6')](_0x587a('0x105')),'data1':_0x1b76b5[_0x587a('0x5f')][_0x587a('0x3f')]||_0x587a('0x10f'),'role':_0x1d7582[_0x587a('0x2c')],'internal':_0x1d7582['internal']});});return db['MemberReport'][_0x587a('0x85')](_0x30cf50,{'individualHooks':!![]});})[_0x587a('0x2b')](function(){return _0x1d7582['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x1b76b5[_0x587a('0x5f')][_0x587a('0x3f')]||_0x587a('0x10f'),'lastPauseAt':moment()[_0x587a('0xa6')]('YYYY-MM-DD\x20HH:mm:ss')});})['then'](respondWithResult(_0x16f49f,null))[_0x587a('0x29')](handleError(_0x16f49f,null));};exports['unpause']=function(_0x5be0ec,_0xe8b9f7){if(_0x5be0ec[_0x587a('0x5f')][_0x587a('0xac')]&&!utils[_0x587a('0x9d')](_0x5be0ec[_0x587a('0x5f')][_0x587a('0xac')])){throw new APIBadRequestError(util[_0x587a('0xa6')](_0x587a('0x110'),_0x5be0ec['body']['channel']));}return db[_0x587a('0x48')][_0x587a('0x5e')]({'where':{'id':_0x5be0ec[_0x587a('0x5a')]['id']},'attributes':['id',_0x587a('0x3a'),_0x587a('0x2c'),_0x587a('0x63'),'interface',_0x587a('0x9b'),'voicePause',_0x587a('0x111'),'chatPause','faxPause',_0x587a('0x112'),_0x587a('0x113'),_0x587a('0x114'),_0x587a('0x115'),_0x587a('0x116')]})['then'](function(_0x1dd24a){if(!_0x1dd24a){throw new APINotFoundError(util[_0x587a('0xa6')](_0x587a('0xc9'),_0x5be0ec[_0x587a('0x5a')]['id']));}return _0x1dd24a[_0x587a('0x117')](_0x5be0ec[_0x587a('0x5f')][_0x587a('0xac')]);})['then'](respondWithResult(_0xe8b9f7,null))[_0x587a('0x29')](APIHandleError(_0xe8b9f7));};exports[_0x587a('0x118')]=function(_0x146cc1,_0x91a6c3){var _0x242b77={};var _0x25e6c9={};var _0x45729f;var _0x104c61;return db[_0x587a('0x48')][_0x587a('0x94')]({'where':{'id':_0x146cc1[_0x587a('0x5a')]['id']}})[_0x587a('0x2b')](handleEntityNotFound(_0x91a6c3,null))[_0x587a('0x2b')](function(_0x5fb738){if(_0x5fb738){_0x45729f=_0x5fb738;_0x25e6c9[_0x587a('0xd8')]=_['keys'](db[_0x587a('0x119')][_0x587a('0xd5')]);_0x25e6c9[_0x587a('0x4a')]=_[_0x587a('0xd4')](_0x146cc1[_0x587a('0x4a')]);_0x25e6c9[_0x587a('0xd6')]=_[_0x587a('0xd7')](_0x25e6c9[_0x587a('0xd8')],_0x25e6c9['query']);_0x242b77[_0x587a('0x5d')]=_[_0x587a('0xd7')](_0x25e6c9[_0x587a('0xd8')],qs[_0x587a('0xd9')](_0x146cc1[_0x587a('0x4a')][_0x587a('0xd9')]));_0x242b77['attributes']=_0x242b77[_0x587a('0x5d')][_0x587a('0x6b')]?_0x242b77[_0x587a('0x5d')]:_0x25e6c9[_0x587a('0xd8')];_0x242b77[_0x587a('0xda')]=qs[_0x587a('0xdb')](_0x146cc1['query'][_0x587a('0xdb')]);_0x242b77[_0x587a('0xdd')]=qs[_0x587a('0xd6')](_[_0x587a('0xdc')](_0x146cc1[_0x587a('0x4a')],_0x25e6c9[_0x587a('0xd6')]));if(_0x146cc1[_0x587a('0x4a')][_0x587a('0x40')]){_0x242b77[_0x587a('0xdd')]=_[_0x587a('0x5b')](_0x242b77[_0x587a('0xdd')],{'$or':_[_0x587a('0x89')](_0x242b77[_0x587a('0x5d')],function(_0x139693){var _0x30442f={};_0x30442f[_0x139693]={'$like':'%'+_0x146cc1['query'][_0x587a('0x40')]+'%'};return _0x30442f;})});}_0x242b77=_[_0x587a('0x5b')]({},_0x242b77,_0x146cc1['options']);return _0x45729f[_0x587a('0x118')](_0x242b77);}})[_0x587a('0x2b')](function(_0x894516){if(_0x894516){_0x104c61=_0x894516[_0x587a('0x6b')];if(!_0x146cc1['query'][_0x587a('0xca')](_0x587a('0xe2'))){_0x242b77[_0x587a('0xe0')]=qs[_0x587a('0xe0')](_0x146cc1[_0x587a('0x4a')][_0x587a('0xe0')]);_0x242b77[_0x587a('0x1c')]=qs[_0x587a('0x1c')](_0x146cc1[_0x587a('0x4a')][_0x587a('0x1c')]);}return _0x45729f[_0x587a('0x118')](_0x242b77);}})['then'](function(_0x1dea7a){if(_0x1dea7a){return _0x1dea7a?{'count':_0x104c61,'rows':_0x1dea7a}:null;}})[_0x587a('0x2b')](respondWithResult(_0x91a6c3,null))[_0x587a('0x29')](handleError(_0x91a6c3,null));};exports[_0x587a('0x11a')]=function(_0x42ad6f,_0x4cef56){var _0x52bdd5=_0x42ad6f[_0x587a('0x5a')]['id'];var _0xd05478=_0x42ad6f[_0x587a('0x5f')]?_0x42ad6f[_0x587a('0x5f')]['ids']:null;var _0x301d85=[];return Promise[_0x587a('0x10b')]()[_0x587a('0x2b')](function(){if(!_0xd05478)throw new APIBadRequestError(_0x587a('0x11b'));})['then'](function(){return db[_0x587a('0x48')][_0x587a('0x94')]({'where':{'id':_0x52bdd5}});})['then'](function(_0x423e63){if(!_0x423e63)throw new APINotFoundError(util[_0x587a('0xa6')](_0x587a('0xc9'),_0x42ad6f['params']['id']));return db[_0x587a('0x69')][_0x587a('0x11c')](function(_0x1c60c6){return _0x423e63[_0x587a('0x11a')](_0xd05478,{'transaction':_0x1c60c6})['then'](function(){return db['Team']['findAll']({'where':{'id':{'$in':_0xd05478}}});})[_0x587a('0x2b')](function(_0x1fd586){var _0x3fe39f=_[_0x587a('0x89')](_0x1fd586,function(_0x426dcf){return _0x426dcf[_0x587a('0x11d')]();});return Promise[_0x587a('0x59')](_0x3fe39f);})[_0x587a('0x2b')](function(_0x490857){_0x301d85=_[_0x587a('0x11e')](_0x490857);var _0x581850=_[_0x587a('0x89')](_0x301d85,function(_0x44b16f){return _0x44b16f[_0x587a('0x11f')](_0x423e63['id'],{'transaction':_0x1c60c6});});return Promise[_0x587a('0x59')](_0x581850);})[_0x587a('0x2b')](function(){if(!_0x423e63[_0x587a('0x9b')])return;var _0x2ee5b1=_[_0x587a('0x40')](_0x301d85,function(_0x2bd689){return _0x2bd689[_0x587a('0x120')](_0x587a('0xac'))===_0x587a('0x121');});var _0x8c6aa0=_[_0x587a('0x89')](_0x2ee5b1,function(_0x2cb9f3){return db[_0x587a('0xb1')][_0x587a('0xaa')]({'membername':_0x423e63['name'],'UserId':_0x423e63['id'],'queue_name':_0x2cb9f3[_0x587a('0x3a')],'VoiceQueueId':_0x2cb9f3['id'],'interface':_[_0x587a('0x67')](_0x423e63[_0x587a('0xa5')])?util[_0x587a('0xa6')](_0x587a('0xa7'),_0x423e63[_0x587a('0x3a')]):_0x423e63[_0x587a('0xa5')],'paused':_0x423e63['voicePause']||![],'penalty':_0x423e63[_0x587a('0xa9')]},{'transaction':_0x1c60c6});});return Promise[_0x587a('0x59')](_0x8c6aa0);})['then'](function(){return db[_0x587a('0x122')]['findAll']({'where':{'teamId':{'$in':_0xd05478}}});})[_0x587a('0x2b')](function(_0x55ba39){var _0x8784cd=_[_0x587a('0x89')](_0x55ba39,function(_0x17ed18){return db[_0x587a('0x123')][_0x587a('0x7b')]({'UserId':_0x423e63['id'],'VoicePrefixId':_0x17ed18[_0x587a('0x124')]},{'transaction':_0x1c60c6});});return Promise['all'](_0x8784cd);});});})[_0x587a('0x2b')](function(){for(var _0x960d5a=0x0;_0x960d5a<_0x301d85[_0x587a('0x6b')];_0x960d5a++){var _0x59b1f8=_0x301d85[_0x960d5a][_0x587a('0x120')]('channel');var _0x420d00=_0x59b1f8+_0x587a('0xaf');socket['emit'](_0x587a('0x33')+_0x59b1f8+_0x587a('0xa2'),{'UserId':_0x52bdd5,['queueField']:_0x301d85[_0x960d5a]['id']});}})['then'](respondWithStatusCode(_0x4cef56,null))[_0x587a('0x29')](APIHandleError(_0x4cef56));};exports['removeTeams']=function(_0x1e557a,_0x472bf4){var _0x4514f4=_0x1e557a[_0x587a('0x5a')]['id'];var _0x192744=null;if(_0x1e557a[_0x587a('0x4a')][_0x587a('0x62')]){_0x192744=_[_0x587a('0xae')](_0x1e557a['query'][_0x587a('0x62')])?_0x1e557a['query'][_0x587a('0x62')]:[_0x1e557a[_0x587a('0x4a')][_0x587a('0x62')]];}var _0x4b56ea=[];return Promise['resolve']()['then'](function(){if(!_0x192744)throw new APIBadRequestError('Query\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0x587a('0x2b')](function(){return db[_0x587a('0x48')][_0x587a('0x94')]({'where':{'id':_0x4514f4}});})[_0x587a('0x2b')](function(_0x1d4aaf){if(!_0x1d4aaf)throw new APINotFoundError(util[_0x587a('0xa6')](_0x587a('0xc9'),_0x1e557a[_0x587a('0x5a')]['id']));return db[_0x587a('0x69')][_0x587a('0x11c')](function(_0xaf3b40){return _0x1d4aaf[_0x587a('0x125')](_0x192744,{'transaction':_0xaf3b40})[_0x587a('0x2b')](function(){return db[_0x587a('0x119')][_0x587a('0x4f')]({'where':{'id':{'$in':_0x192744}}});})[_0x587a('0x2b')](function(_0x51f34d){var _0x1ee095=_['map'](_0x51f34d,function(_0x58177e){return _0x58177e[_0x587a('0x11d')]();});return Promise[_0x587a('0x59')](_0x1ee095);})[_0x587a('0x2b')](function(_0xb07501){_0x4b56ea=_[_0x587a('0x11e')](_0xb07501);var _0x2f97f4=_[_0x587a('0x89')](_0x4b56ea,function(_0x40464d){return _0x40464d['removeAgent'](_0x1d4aaf['id'],{'transaction':_0xaf3b40});});return Promise[_0x587a('0x59')](_0x2f97f4);})[_0x587a('0x2b')](function(){if(!_0x1d4aaf[_0x587a('0x9b')])return;var _0x420251=_[_0x587a('0x40')](_0x4b56ea,function(_0x361653){return _0x361653['getDataValue']('channel')===_0x587a('0x121');});var _0xbe1657=_[_0x587a('0x89')](_0x420251,function(_0x3cd3f0){return db[_0x587a('0xb1')][_0x587a('0x3c')]({'where':{'VoiceQueueId':_0x3cd3f0['id'],'UserId':_0x1d4aaf['id']},'transaction':_0xaf3b40});});return Promise[_0x587a('0x59')](_0xbe1657);})[_0x587a('0x2b')](function(){return db[_0x587a('0x122')][_0x587a('0x4f')]({'where':{'teamId':{'$in':_0x192744}}});})['then'](function(_0x510199){var _0x5ab5a2=_[_0x587a('0x89')](_0x510199,function(_0x1f081e){return db[_0x587a('0x123')][_0x587a('0x3c')]({'where':{'UserId':_0x1d4aaf['id'],'VoicePrefixId':_0x1f081e[_0x587a('0x124')]}},{'transaction':_0xaf3b40});});return Promise[_0x587a('0x59')](_0x5ab5a2);});});})[_0x587a('0x2b')](function(){for(var _0x286780=0x0;_0x286780<_0x4b56ea['length'];_0x286780++){var _0x584a26=_0x4b56ea[_0x286780][_0x587a('0x120')](_0x587a('0xac'));var _0x250b7e=_0x584a26+_0x587a('0xaf');socket[_0x587a('0x2e')](_0x587a('0x33')+_0x584a26+_0x587a('0xb0'),{'UserId':_0x4514f4,['queueField']:_0x4b56ea[_0x286780]['id']});}})[_0x587a('0x2b')](respondWithStatusCode(_0x472bf4,null))[_0x587a('0x29')](APIHandleError(_0x472bf4));};exports['getLists']=function(_0x247aa9,_0x23ad93){var _0x10dafc={};var _0x9094a9={};var _0x177e58;var _0x33db1a;return db[_0x587a('0x48')][_0x587a('0x94')]({'where':{'id':_0x247aa9[_0x587a('0x5a')]['id']}})[_0x587a('0x2b')](handleEntityNotFound(_0x23ad93,null))[_0x587a('0x2b')](function(_0x450fc0){if(_0x450fc0){_0x177e58=_0x450fc0;_0x9094a9[_0x587a('0xd8')]=_[_0x587a('0xd4')](db[_0x587a('0xcc')][_0x587a('0xd5')]);_0x9094a9[_0x587a('0x4a')]=_[_0x587a('0xd4')](_0x247aa9[_0x587a('0x4a')]);_0x9094a9[_0x587a('0xd6')]=_[_0x587a('0xd7')](_0x9094a9[_0x587a('0xd8')],_0x9094a9[_0x587a('0x4a')]);_0x10dafc[_0x587a('0x5d')]=_[_0x587a('0xd7')](_0x9094a9[_0x587a('0xd8')],qs[_0x587a('0xd9')](_0x247aa9['query'][_0x587a('0xd9')]));_0x10dafc[_0x587a('0x5d')]=_0x10dafc[_0x587a('0x5d')]['length']?_0x10dafc[_0x587a('0x5d')]:_0x9094a9['model'];_0x10dafc['order']=qs[_0x587a('0xdb')](_0x247aa9[_0x587a('0x4a')][_0x587a('0xdb')]);_0x10dafc[_0x587a('0xdd')]=qs[_0x587a('0xd6')](_[_0x587a('0xdc')](_0x247aa9[_0x587a('0x4a')],_0x9094a9['filters']));if(_0x247aa9['query'][_0x587a('0x40')]){_0x10dafc[_0x587a('0xdd')]=_[_0x587a('0x5b')](_0x10dafc[_0x587a('0xdd')],{'$or':_['map'](_0x10dafc[_0x587a('0x5d')],function(_0x6315cc){var _0x4c0bff={};_0x4c0bff[_0x6315cc]={'$like':'%'+_0x247aa9['query'][_0x587a('0x40')]+'%'};return _0x4c0bff;})});}_0x10dafc=_[_0x587a('0x5b')]({},_0x10dafc,_0x247aa9['options']);return _0x177e58[_0x587a('0x126')](_0x10dafc);}})[_0x587a('0x2b')](function(_0x2b0846){if(_0x2b0846){_0x33db1a=_0x2b0846['length'];if(!_0x247aa9[_0x587a('0x4a')][_0x587a('0xca')]('nolimit')){_0x10dafc[_0x587a('0xe0')]=qs[_0x587a('0xe0')](_0x247aa9[_0x587a('0x4a')][_0x587a('0xe0')]);_0x10dafc[_0x587a('0x1c')]=qs['offset'](_0x247aa9[_0x587a('0x4a')][_0x587a('0x1c')]);}return _0x177e58[_0x587a('0x126')](_0x10dafc);}})['then'](function(_0x8f1a2c){if(_0x8f1a2c){return _0x8f1a2c?{'count':_0x33db1a,'rows':_0x8f1a2c}:null;}})[_0x587a('0x2b')](respondWithResult(_0x23ad93,null))['catch'](handleError(_0x23ad93,null));};exports['getAgents']=function(_0x33b230,_0x17da08){var _0x58e201={};var _0x11a052={};var _0x1fc1a3;return db[_0x587a('0x48')][_0x587a('0x94')]({'where':{'id':_0x33b230[_0x587a('0x5a')]['id']}})[_0x587a('0x2b')](handleEntityNotFound(_0x17da08,null))['then'](function(_0x56d65e){if(_0x56d65e){_0x1fc1a3=_0x56d65e;_0x11a052[_0x587a('0xd8')]=_[_0x587a('0xd4')](db[_0x587a('0x48')][_0x587a('0xd5')]);_0x11a052[_0x587a('0x4a')]=_[_0x587a('0xd4')](_0x33b230['query']);_0x11a052[_0x587a('0xd6')]=_['intersection'](_0x11a052[_0x587a('0xd8')],_0x11a052[_0x587a('0x4a')]);_0x58e201[_0x587a('0x5d')]=_[_0x587a('0xd7')](_0x11a052[_0x587a('0xd8')],qs[_0x587a('0xd9')](_0x33b230[_0x587a('0x4a')][_0x587a('0xd9')]));_0x58e201[_0x587a('0x5d')]=_0x58e201[_0x587a('0x5d')][_0x587a('0x6b')]?_0x58e201[_0x587a('0x5d')]:_0x11a052['model'];_0x58e201[_0x587a('0xda')]=qs[_0x587a('0xdb')](_0x33b230[_0x587a('0x4a')]['sort']);_0x58e201[_0x587a('0xdd')]=qs['filters'](_[_0x587a('0xdc')](_0x33b230[_0x587a('0x4a')],_0x11a052['filters']));if(_0x33b230[_0x587a('0x4a')][_0x587a('0x40')]){_0x58e201['where']=_[_0x587a('0x5b')](_0x58e201[_0x587a('0xdd')],{'$or':_['map'](_0x58e201[_0x587a('0x5d')],function(_0x4071eb){var _0x1062ad={};_0x1062ad[_0x4071eb]={'$like':'%'+_0x33b230['query'][_0x587a('0x40')]+'%'};return _0x1062ad;})});}_0x58e201[_0x587a('0xd8')]=db[_0x587a('0x48')];_0x58e201['as']=_0x587a('0x34');_0x58e201=_[_0x587a('0x5b')]({},_0x58e201,_0x33b230[_0x587a('0x5c')]);return _0x1fc1a3[_0x587a('0x101')]({'include':[_0x58e201]});}})[_0x587a('0x2b')](function(_0x13a380){if(_0x13a380){var _0x4f1e86={},_0x5c1d7b=[];for(var _0x5bf2ff=0x0;_0x5bf2ff<_0x13a380[_0x587a('0x6b')];_0x5bf2ff+=0x1){for(var _0x2ea868=0x0,_0x48cda1;_0x2ea868<_0x13a380[_0x5bf2ff][_0x587a('0x34')][_0x587a('0x6b')];_0x2ea868+=0x1){_0x48cda1=_0x13a380[_0x5bf2ff][_0x587a('0x34')][_0x2ea868]['get']({'plain':!![]});_0x4f1e86[_0x48cda1['id']]=_0x48cda1;}}_0x4f1e86=_[_0x587a('0x127')](_0x4f1e86);for(var _0x2bbc1f=qs['offset'](_0x33b230[_0x587a('0x4a')][_0x587a('0x1c')]);_0x2bbc1f<_0x4f1e86[_0x587a('0x6b')]&&_0x5c1d7b[_0x587a('0x6b')]=_0x4ec5f8){_0x243774=_0x4ec5f8;_0x438c79=0xc8;}else{_0x438c79=0xce;}_0x2a83ff[_0xfc80('0x17')](_0x438c79);return _0x2a83ff[_0xfc80('0x1d')]('Content-Range',_0x5b00fc+'-'+_0x243774+'/'+_0x4ec5f8)['json'](_0x44a4ec);}return null;};}function respondWithRpcPromise(_0xab33b1,_0x16dc59,_0x5b687e,_0x2572b2){return new Promise(function(_0x4c4d54,_0x1731d3){var _0x317ba5=_0x2572b2||amiClient;return _0x317ba5[_0xfc80('0x1e')](_0xab33b1,_0x5b687e)['then'](function(_0x59e9d4){logger[_0xfc80('0x1f')]('User,\x20%s,\x20%s',_0x16dc59,'request\x20sent');logger[_0xfc80('0x20')](_0xfc80('0x21'),_0x16dc59,_0xfc80('0x22'),JSON[_0xfc80('0x23')](_0x59e9d4));if(_0x59e9d4['error']){if(_0x59e9d4[_0xfc80('0x24')][_0xfc80('0x25')]===0x1f4){logger['error'](_0xfc80('0x26'),_0x16dc59,_0x59e9d4[_0xfc80('0x24')][_0xfc80('0x27')]);return _0x1731d3(_0x59e9d4[_0xfc80('0x24')][_0xfc80('0x27')]);}logger[_0xfc80('0x24')](_0xfc80('0x26'),_0x16dc59,_0x59e9d4[_0xfc80('0x24')][_0xfc80('0x27')]);return _0x4c4d54(_0x59e9d4[_0xfc80('0x24')]['message']);}else{logger[_0xfc80('0x1f')](_0xfc80('0x26'),_0x16dc59,_0xfc80('0x22'));_0x4c4d54(_0x59e9d4[_0xfc80('0x28')][_0xfc80('0x27')]);}})['catch'](function(_0x4f068d){logger[_0xfc80('0x24')](_0xfc80('0x26'),_0x16dc59,_0x4f068d);_0x1731d3(_0x4f068d);});});}function saveUpdates(_0x47f2a5){return function(_0x20a59a){if(_0x20a59a){return _0x20a59a['update'](_0x47f2a5)[_0xfc80('0x29')](function(_0x3e2395){if(_0x3e2395[_0xfc80('0x2a')]===_0xfc80('0x2b')){socket[_0xfc80('0x2c')](_0xfc80('0x2d')+_0x3e2395['id'],_0x3e2395);}return _0x3e2395;});}return null;};}function removeEntity(_0x15a338,_0x4f8a79){return function(_0x1d35a5){if(_0x1d35a5){return _0x1d35a5[_0xfc80('0x2e')]({'transaction':_0x4f8a79})[_0xfc80('0x29')](function(){var _0x4700fe=_0x1d35a5['get']({'plain':!![]});if(_0x4700fe['role']===_0xfc80('0x2f'))return;var _0x5733d3=[{'name':'Users','value':'user','ignore':!![]},{'name':_0xfc80('0x30'),'value':'agent','ignore':![]},{'name':_0xfc80('0x31'),'value':_0xfc80('0x32'),'ignore':![]}];var _0x233336=_(_0x5733d3)[_0xfc80('0x33')]('ignore')[_0xfc80('0x34')](_0xfc80('0x35'))[_0xfc80('0x35')]();if(_['includes'](_0x233336,_0x4700fe['role'])){return;}var _0x8ec804=_[_0xfc80('0x36')](_0x5733d3,[_0xfc80('0x35'),_0x4700fe[_0xfc80('0x2a')]])[_0xfc80('0x37')];return db[_0xfc80('0x38')][_0xfc80('0x2e')]({'where':{'type':_0x8ec804,'resourceId':_0x4700fe['id']},'transaction':_0x4f8a79})['then'](function(){return _0x1d35a5;});})[_0xfc80('0x29')](function(){_0x15a338[_0xfc80('0x17')](0xcc)[_0xfc80('0x18')]();});}};}function handleEntityNotFound(_0x29a6bf){return function(_0x78c5e2){if(!_0x78c5e2){_0x29a6bf['sendStatus'](0x194);}return _0x78c5e2;};}function handleError(_0x26d0dc,_0x221d5e){_0x221d5e=_0x221d5e||0x1f4;return function(_0x43d925){logger[_0xfc80('0x24')](_0x43d925[_0xfc80('0x39')]);if(_0x43d925[_0xfc80('0x37')]){delete _0x43d925[_0xfc80('0x37')];}_0x26d0dc[_0xfc80('0x17')](_0x221d5e)['send'](_0x43d925);};}function getUserAttributes(){return _(db['User']['rawAttributes'])[_0xfc80('0x34')](function(_0x4c0cf4){return{'name':_0x4c0cf4['fieldName'],'type':_0x4c0cf4['type'][_0xfc80('0x3a')]};})['filter'](function(_0xedc1de){return![_0xfc80('0x3b'),_0xfc80('0x3c'),_0xfc80('0x3d'),'resetPasswordToken',_0xfc80('0x3e'),_0xfc80('0x3f')][_0xfc80('0x40')](_0xedc1de[_0xfc80('0x37')]);})['value']();}exports[_0xfc80('0x41')]=function(_0xca787b,_0x1923cc){var _0x4562d7={},_0x176277={'count':0x0,'rows':[]};var _0x115646=getUserAttributes();_0x4562d7=qs[_0xfc80('0x42')](_0x115646,_0xca787b);var _0x3f2d4e={'where':_0x4562d7['where']};return db['User'][_0xfc80('0x1b')](_0x3f2d4e)[_0xfc80('0x29')](function(_0x330dec){_0x176277[_0xfc80('0x1b')]=_0x330dec;if(_0xca787b[_0xfc80('0x43')][_0xfc80('0x44')]){_0x4562d7['include']=[{'all':!![]}];}if(_0xca787b[_0xfc80('0x43')][_0xfc80('0x45')]===_0xfc80('0x46')){_0x4562d7[_0xfc80('0x47')]=[{'model':db[_0xfc80('0x48')],'as':_0xfc80('0x45')}];}if(!_[_0xfc80('0x40')](_0x4562d7[_0xfc80('0x49')],'id')){_0x4562d7['attributes']['push']('id');}return db[_0xfc80('0x4a')]['findAll'](_0x4562d7);})[_0xfc80('0x29')](function(_0x22c3da){_0x176277['rows']=_0x22c3da;if(_0xca787b[_0xfc80('0x43')][_0xfc80('0x4b')]===_0xfc80('0x46')){var _0x6625d6=[];for(var _0x5eb86a=0x0;_0x5eb86a<_0x176277[_0xfc80('0x4c')][_0xfc80('0x4d')];_0x5eb86a++){_0x6625d6[_0xfc80('0x4e')](get_open_tabs(_0xfc80('0x4f'),_0x176277[_0xfc80('0x4c')][_0x5eb86a]['dataValues']));_0x6625d6[_0xfc80('0x4e')](get_open_tabs('sms',_0x176277[_0xfc80('0x4c')][_0x5eb86a][_0xfc80('0x50')]));_0x6625d6['push'](get_open_tabs(_0xfc80('0x51'),_0x176277[_0xfc80('0x4c')][_0x5eb86a][_0xfc80('0x50')]));_0x6625d6['push'](get_open_tabs(_0xfc80('0x52'),_0x176277['rows'][_0x5eb86a][_0xfc80('0x50')]));_0x6625d6[_0xfc80('0x4e')](get_open_tabs(_0xfc80('0x53'),_0x176277[_0xfc80('0x4c')][_0x5eb86a][_0xfc80('0x50')]));_0x6625d6[_0xfc80('0x4e')](get_open_tabs(_0xfc80('0x54'),_0x176277['rows'][_0x5eb86a][_0xfc80('0x50')]));}return Promise[_0xfc80('0x55')](_0x6625d6)[_0xfc80('0x29')](function(){return _0x176277;});}else{return _0x176277;}})[_0xfc80('0x29')](respondWithFilteredResult(_0x1923cc,_0x4562d7))[_0xfc80('0x56')](handleError(_0x1923cc,null));};exports[_0xfc80('0x57')]=function(_0x26c4fa,_0x587ace){var _0xa8133=getUserAttributes();_0x26c4fa['query']['id']=_0x26c4fa[_0xfc80('0x58')]['id'];var _0x462715=qs[_0xfc80('0x42')](_0xa8133,_0x26c4fa);if(_0x26c4fa[_0xfc80('0x43')][_0xfc80('0x44')]){_0x462715[_0xfc80('0x47')]=[{'all':!![]}];}if(_0x26c4fa['query'][_0xfc80('0x45')]===_0xfc80('0x46')){_0x462715[_0xfc80('0x47')]=[{'model':db['UserSetting'],'as':_0xfc80('0x45')}];}_0x462715=_['merge']({},_0x462715,_0x26c4fa[_0xfc80('0x59')]);if(!_[_0xfc80('0x40')](_0x462715[_0xfc80('0x49')],'id')){_0x462715[_0xfc80('0x49')]['push']('id');}return db[_0xfc80('0x4a')][_0xfc80('0x36')](_0x462715)['then'](handleEntityNotFound(_0x587ace,null))['then'](function(_0x58693a){var _0x3b4bdf=[];values=_0x58693a;if(_0x26c4fa[_0xfc80('0x43')][_0xfc80('0x4b')]===_0xfc80('0x46')){_0x3b4bdf['push'](get_open_tabs(_0xfc80('0x4f'),_0x58693a[_0xfc80('0x50')]));_0x3b4bdf[_0xfc80('0x4e')](get_open_tabs(_0xfc80('0x5a'),_0x58693a[_0xfc80('0x50')]));_0x3b4bdf[_0xfc80('0x4e')](get_open_tabs(_0xfc80('0x53'),_0x58693a[_0xfc80('0x50')]));_0x3b4bdf[_0xfc80('0x4e')](get_open_tabs(_0xfc80('0x54'),_0x58693a['dataValues']));_0x3b4bdf[_0xfc80('0x4e')](get_open_tabs(_0xfc80('0x51'),_0x58693a[_0xfc80('0x50')]));_0x3b4bdf[_0xfc80('0x4e')](get_open_tabs(_0xfc80('0x52'),_0x58693a[_0xfc80('0x50')]));return Promise[_0xfc80('0x55')](_0x3b4bdf);}else{return values;}})[_0xfc80('0x29')](function(){return values;})[_0xfc80('0x29')](respondWithResult(_0x587ace,null))[_0xfc80('0x56')](handleError(_0x587ace,null));};exports[_0xfc80('0x5b')]=function(_0x53551d,_0x3ecb0f){if(_0x53551d['body']['id']){delete _0x53551d[_0xfc80('0x5c')]['id'];}delete _0x53551d['body'][_0xfc80('0x2a')];return db[_0xfc80('0x4a')][_0xfc80('0x36')]({'where':{'id':_0x53551d['params']['id']}})[_0xfc80('0x29')](handleEntityNotFound(_0x3ecb0f,null))[_0xfc80('0x29')](saveUpdates(_0x53551d[_0xfc80('0x5c')],null))['then'](respondWithResult(_0x3ecb0f,null))[_0xfc80('0x56')](handleError(_0x3ecb0f,null));};exports[_0xfc80('0x5d')]=function(_0x48ea0d,_0x387c48){return db[_0xfc80('0x4a')][_0xfc80('0x5d')]()[_0xfc80('0x29')](respondWithResult(_0x387c48,null))[_0xfc80('0x56')](handleError(_0x387c48,null));};exports[_0xfc80('0x5e')]=function(_0x5dfcac,_0x1b689f){return db[_0xfc80('0x4a')]['find']({'where':{'id':_0x5dfcac[_0xfc80('0x58')]['id']}})[_0xfc80('0x29')](handleEntityNotFound(_0x1b689f,null))[_0xfc80('0x29')](function(_0x16ce30){if(_0x16ce30){return _0x16ce30[_0xfc80('0x5e')](_0x5dfcac[_0xfc80('0x5c')]['ids'],_[_0xfc80('0x5f')](_0x5dfcac[_0xfc80('0x5c')],['ids','id'])||{});}})[_0xfc80('0x29')](respondWithResult(_0x1b689f,null))[_0xfc80('0x56')](handleError(_0x1b689f,null));};function validateUser(_0x378033){return new Promise(function(_0x5752b6,_0x471dbe){if(_0x378033['internal'])return _0x5752b6(_0x378033);return db[_0xfc80('0x60')][_0xfc80('0x61')](0x1)[_0xfc80('0x29')](function(_0x39f1a5){if(_0x39f1a5[_0xfc80('0x62')])authService[_0xfc80('0x63')](_0x378033[_0xfc80('0x3b')]);db[_0xfc80('0x4a')]['max']('internal')[_0xfc80('0x29')](function(_0x16527c){if(_['isNil'](_0x16527c)){_0x378033['internal']=_0x39f1a5[_0xfc80('0x64')]||0x1;return;}if(_['isNil'](_0x39f1a5[_0xfc80('0x64')])||_0x39f1a5[_0xfc80('0x64')]===_0x16527c){_0x378033[_0xfc80('0x65')]=_0x16527c+0x1;return;}if(_0x39f1a5[_0xfc80('0x64')]>_0x16527c){_0x378033[_0xfc80('0x65')]=_0x39f1a5[_0xfc80('0x64')];return;}return db[_0xfc80('0x66')]['query'](_0xfc80('0x67'),{'type':db[_0xfc80('0x66')][_0xfc80('0x68')][_0xfc80('0x69')]})[_0xfc80('0x29')](function(_0x5218b6){if(_0x5218b6&&_0x5218b6[_0xfc80('0x4d')]){for(var _0x55f941=0x0,_0x3e6e7a=_0x5218b6[_0xfc80('0x4d')];_0x55f941<_0x3e6e7a&&_[_0xfc80('0x6a')](_0x378033[_0xfc80('0x65')]);_0x55f941++){if(_0x39f1a5[_0xfc80('0x64')]<=_0x5218b6[_0x55f941][_0xfc80('0x6b')]){_0x378033[_0xfc80('0x65')]=_0x5218b6[_0x55f941][_0xfc80('0x6b')];}else if(_0x39f1a5[_0xfc80('0x64')]>_0x5218b6[_0x55f941]['from']&&_0x39f1a5[_0xfc80('0x64')]<=_0x5218b6[_0x55f941]['to']){_0x378033[_0xfc80('0x65')]=_0x39f1a5[_0xfc80('0x64')];}}}if(_[_0xfc80('0x6a')](_0x378033[_0xfc80('0x65')])){_0x378033['internal']=_0x16527c+0x1;}return _0x5752b6(_0x378033);});});})[_0xfc80('0x56')](function(_0x1a771c){_0x471dbe(_0x1a771c);});});}function updateUser(_0x4a6ade){return new Promise(function(_0x32fbb9,_0x3d0dc5){try{if(_0x4a6ade[_0xfc80('0x6c')]){_0x4a6ade[_0xfc80('0x6d')]=_0x4a6ade[_0xfc80('0x65')];_0x4a6ade[_0xfc80('0x6e')]={'mailbox':_0x4a6ade['internal'],'password':_0x4a6ade[_0xfc80('0x3b')],'fullname':_0x4a6ade[_0xfc80('0x6f')],'email':_0x4a6ade[_0xfc80('0x70')]};}if(_0x4a6ade[_0xfc80('0x2a')]===_0xfc80('0x2b')){if(!_0x4a6ade[_0xfc80('0x71')])_0x4a6ade[_0xfc80('0x71')]=[_0xfc80('0x72'),_0xfc80('0x73'),_0xfc80('0x74'),_0xfc80('0x75'),_0xfc80('0x76'),_0xfc80('0x77'),_0xfc80('0x78'),'106',_0xfc80('0x79'),_0xfc80('0x7a'),'109',_0xfc80('0x7b'),_0xfc80('0x7c'),_0xfc80('0x7d'),_0xfc80('0x7e')];}_0x32fbb9(_0x4a6ade);}catch(_0x30e38a){_0x3d0dc5(_0x30e38a);}});}exports[_0xfc80('0x7f')]=function(_0x5eccb6,_0x451cab){if(_0x5eccb6[_0xfc80('0x80')][_0xfc80('0x2a')]===_0xfc80('0x2b'))throw new Error('Unauthorized');if(_0x5eccb6[_0xfc80('0x5c')][_0xfc80('0x2a')]===_0xfc80('0x80')&&_0x5eccb6['user'][_0xfc80('0x2a')]!==_0xfc80('0x2f')){throw new Error(_0xfc80('0x81'));}if(_0x5eccb6['body']['role']==='admin'&&_0x5eccb6[_0xfc80('0x80')][_0xfc80('0x2a')]!==_0xfc80('0x2f')){throw new Error(_0xfc80('0x82'));}return licenseUtil[_0xfc80('0x83')]([_0x5eccb6[_0xfc80('0x5c')]])[_0xfc80('0x29')](function(){return validateUser(_0x5eccb6[_0xfc80('0x5c')]);})['then'](function(_0x1d7420){return updateUser(_0x1d7420)[_0xfc80('0x29')](function(_0x28a214){if(_0x28a214[_0xfc80('0x2a')]===_0xfc80('0x2f')){_0x28a214[_0xfc80('0x84')]=_0x5eccb6['user'][_0xfc80('0x84')];delete _0x28a214['userProfileId'];}return _0x28a214;});})[_0xfc80('0x29')](function(_0x541131){return db['User']['create'](_0x541131,{'include':[{'model':db[_0xfc80('0x6e')],'as':_0xfc80('0x6e')}]});})[_0xfc80('0x29')](function(_0x145803){if(_0x5eccb6[_0xfc80('0x5c')][_0xfc80('0x2a')]===_0xfc80('0x80'))return _0x145803;if(_0x5eccb6[_0xfc80('0x80')][_0xfc80('0x2a')]!==_0xfc80('0x80'))return _0x145803;return db[_0xfc80('0x85')][_0xfc80('0x36')]({'where':{'name':_0x145803[_0xfc80('0x2a')]==='agent'?_0xfc80('0x30'):_0xfc80('0x31'),'userProfileId':_0x5eccb6[_0xfc80('0x80')][_0xfc80('0x86')]},'raw':!![]})[_0xfc80('0x29')](function(_0x4bc290){if(!_0x4bc290||_0x4bc290[_0xfc80('0x87')]!=0x0)return _0x145803;return db['UserProfileResource'][_0xfc80('0x7f')]({'name':_0x145803['name'],'resourceId':_0x145803['id'],'type':_0x4bc290[_0xfc80('0x37')],'sectionId':_0x4bc290['id']},{})[_0xfc80('0x29')](function(){return _0x145803;});})['catch'](function(_0x307272){logger[_0xfc80('0x24')](_0xfc80('0x88'),_0x307272);throw _0x307272;});})[_0xfc80('0x29')](respondWithResult(_0x451cab,0xc9))[_0xfc80('0x56')](handleError(_0x451cab,null));};exports[_0xfc80('0x89')]=function(_0x127817,_0x2be665){var _0xe2df7=_0x127817['body'];var _0x560c14=[];if(_0x127817[_0xfc80('0x80')][_0xfc80('0x2a')]===_0xfc80('0x2b'))throw new Error('Unauthorized');if(_[_0xfc80('0x8a')](_0xe2df7,[_0xfc80('0x2a'),_0xfc80('0x80')])&&_0x127817[_0xfc80('0x80')][_0xfc80('0x2a')]!=='admin'){throw new Error(_0xfc80('0x81'));}if(_[_0xfc80('0x8a')](_0xe2df7,['role',_0xfc80('0x2f')])&&_0x127817[_0xfc80('0x80')][_0xfc80('0x2a')]!==_0xfc80('0x2f')){throw new Error(_0xfc80('0x8b'));}return licenseUtil[_0xfc80('0x83')](_0xe2df7)['then'](function(){return validateUser(_0xe2df7[0x0]);})['then'](function(){for(var _0x213fbf=0x1;_0x213fbf<_0xe2df7[_0xfc80('0x4d')];_0x213fbf++){var _0x26c037=_0xe2df7[_0x213fbf-0x1][_0xfc80('0x65')];if(!_0xe2df7[_0x213fbf][_0xfc80('0x65')])_0xe2df7[_0x213fbf][_0xfc80('0x65')]=_0x26c037+0x1;_0x560c14['push'](validateUser(_0xe2df7[_0x213fbf]));}return Promise[_0xfc80('0x55')](_0x560c14);})[_0xfc80('0x29')](function(){_0x560c14=[];for(var _0x820110=0x0;_0x820110<_0xe2df7[_0xfc80('0x4d')];_0x820110++){_0x560c14[_0xfc80('0x4e')](updateUser(_0xe2df7[_0x820110]));}return Promise[_0xfc80('0x55')](_0x560c14);})[_0xfc80('0x29')](function(){_0x560c14=_0xe2df7[_0xfc80('0x34')](function(_0x3dd7ff){return db[_0xfc80('0x4a')]['create'](_0x3dd7ff,{'include':[{'model':db['VoiceMail'],'as':_0xfc80('0x6e')}]})['then'](function(_0x4d4673){_0x3dd7ff['id']=_0x4d4673['id'];return _0x3dd7ff;});});return Promise[_0xfc80('0x55')](_0x560c14);})['then'](function(_0x344db6){if(_0x127817[_0xfc80('0x5c')]['role']==='user')return _0x344db6;if(_0x127817[_0xfc80('0x80')][_0xfc80('0x2a')]!==_0xfc80('0x80'))return _0x344db6;var _0x7a081a=_[_0xfc80('0x8a')](_0x344db6,function(_0x38ed67){return _0x38ed67[_0xfc80('0x2a')]===_0xfc80('0x2b')||_0x38ed67[_0xfc80('0x2a')]===_0xfc80('0x32');});if(!_0x7a081a)return _0x344db6;return db[_0xfc80('0x85')]['findAll']({'where':{'name':{'$or':[_0xfc80('0x30'),_0xfc80('0x31')]},'userProfileId':_0x127817[_0xfc80('0x80')][_0xfc80('0x86')]},'raw':!![]})[_0xfc80('0x29')](function(_0x4a3049){if(_[_0xfc80('0x8c')](_0x4a3049)||!_[_0xfc80('0x8a')](_0x4a3049,[_0xfc80('0x87'),0x0]))return _0x344db6;_0x560c14=[];var _0x4abc32=_(_0x4a3049)[_0xfc80('0x34')](function(_0x31cab5){if(_0x31cab5[_0xfc80('0x87')]===0x1)return;return _0x31cab5[_0xfc80('0x37')]===_0xfc80('0x30')?'agent':_0xfc80('0x32');})[_0xfc80('0x8d')]()[_0xfc80('0x35')]();for(var _0xf35c6d=0x0;_0xf35c6d<_0x344db6[_0xfc80('0x4d')];_0xf35c6d++){if(!_['includes'](_0x4abc32,_0x344db6[_0xf35c6d][_0xfc80('0x2a')]))return;var _0x2edcc1=_0x344db6[_0xf35c6d][_0xfc80('0x2a')]===_0xfc80('0x2b')?_0xfc80('0x30'):_0xfc80('0x31');_0x560c14['push'](db[_0xfc80('0x38')][_0xfc80('0x7f')]({'name':_0x344db6[_0xf35c6d][_0xfc80('0x37')],'resourceId':_0x344db6[_0xf35c6d]['id'],'type':_0x2edcc1,'sectionId':_['find'](_0x4a3049,['name',_0x2edcc1])['id']},{}));}return Promise[_0xfc80('0x55')](_0x560c14);});})['then'](respondWithResult(_0x2be665,0xc9))['catch'](handleError(_0x2be665,null));};exports[_0xfc80('0x8e')]=function(_0x737d2c,_0x53564d){if(_0x737d2c[_0xfc80('0x5c')]['id']){delete _0x737d2c['body']['id'];}return db[_0xfc80('0x4a')]['find']({'where':{'id':_0x737d2c[_0xfc80('0x58')]['id']}})[_0xfc80('0x29')](function(_0x1f4e81){if(!_0x1f4e81)return null;if(_0x1f4e81['id']===_0x737d2c[_0xfc80('0x80')]['id']){if(!_0x737d2c[_0xfc80('0x5c')][_0xfc80('0x8f')]||!_0x737d2c['body'][_0xfc80('0x90')]){throw new db[(_0xfc80('0x91'))]['ValidationError'](_0xfc80('0x92'));}if(!_0x1f4e81[_0xfc80('0x93')](_0x737d2c[_0xfc80('0x5c')][_0xfc80('0x8f')])){throw new db[(_0xfc80('0x91'))]['ValidationError'](_0xfc80('0x94'));}if(_0x737d2c[_0xfc80('0x5c')]['oldPassword']===_0x737d2c[_0xfc80('0x5c')]['newPassword']){throw new db[(_0xfc80('0x91'))][(_0xfc80('0x95'))](_0xfc80('0x96'));}}else if(_0x737d2c[_0xfc80('0x80')][_0xfc80('0x2a')]===_0xfc80('0x2f')){if(!_0x737d2c['body'][_0xfc80('0x90')]){throw new db[(_0xfc80('0x91'))][(_0xfc80('0x95'))](_0xfc80('0x97'));}}else if(_0x737d2c[_0xfc80('0x80')][_0xfc80('0x2a')]===_0xfc80('0x80')){if(!_0x737d2c[_0xfc80('0x5c')][_0xfc80('0x90')]){throw new db[(_0xfc80('0x91'))][(_0xfc80('0x95'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x1f4e81[_0xfc80('0x2a')]!==_0xfc80('0x2b')){throw new db[(_0xfc80('0x91'))][(_0xfc80('0x95'))]('Unauthorized');}}else{throw new db[(_0xfc80('0x91'))][(_0xfc80('0x95'))]('Unauthorized');}return _0x1f4e81;})['then'](handleEntityNotFound(_0x53564d,null))[_0xfc80('0x29')](function(_0x5dd0a8){return db[_0xfc80('0x60')][_0xfc80('0x98')]({'attributes':['id',_0xfc80('0x62'),_0xfc80('0x99'),'passwordHistoryLimit']})[_0xfc80('0x29')](function(_0x2c63e9){if(_0x2c63e9['securePassword'])authService[_0xfc80('0x63')](_0x737d2c['body'][_0xfc80('0x90')]);if(!_0x2c63e9[_0xfc80('0x99')]||!_0x5dd0a8['previousPasswords'])return _0x5dd0a8;authService['validatePasswordHistory'](_0x737d2c[_0xfc80('0x5c')][_0xfc80('0x90')],_0x5dd0a8[_0xfc80('0x3d')],_0x2c63e9[_0xfc80('0x9a')]);return _0x5dd0a8;})[_0xfc80('0x29')](saveUpdates({'password':_0x737d2c[_0xfc80('0x5c')][_0xfc80('0x90')],'passwordResetAt':_0x737d2c[_0xfc80('0x80')]['id']==_0x737d2c[_0xfc80('0x58')]['id']?moment():null,'previousPasswords':authService[_0xfc80('0x9b')](_0x737d2c[_0xfc80('0x5c')]['newPassword'],_0x5dd0a8[_0xfc80('0x3d')])},null));})[_0xfc80('0x29')](respondWithResult(_0x53564d,null))[_0xfc80('0x56')](handleError(_0x53564d,null));};exports[_0xfc80('0x9c')]=function(_0x1b1d85,_0x502760){var _0x3bf6ee=_0x1b1d85['body'][_0xfc80('0x9d')];return db[_0xfc80('0x4a')][_0xfc80('0x36')]({'where':{'id':_0x1b1d85[_0xfc80('0x58')]['id']},'attributes':['id','name','role','online',_0xfc80('0x9e'),_0xfc80('0x9f'),_0xfc80('0xa0')]})['then'](handleEntityNotFound(_0x502760,null))[_0xfc80('0x29')](function(_0xd0f839){if(_0xd0f839){if(!utils[_0xfc80('0xa1')](_0x3bf6ee)){throw new db[(_0xfc80('0x91'))][(_0xfc80('0x95'))](_0xfc80('0xa2'));}return _0xd0f839[_0xfc80('0xa3')+_[_0xfc80('0xa4')](_0x3bf6ee['toLowerCase']())+_0xfc80('0xa5')](_0x1b1d85[_0xfc80('0x5c')][_0xfc80('0xa6')],{'penalty':_0x1b1d85[_0xfc80('0x5c')][_0xfc80('0xa7')]||0x0})[_0xfc80('0xa8')](function(_0x51757a){for(var _0x3d3791=0x0;_0x3d3791<_0x1b1d85[_0xfc80('0x5c')][_0xfc80('0xa6')][_0xfc80('0x4d')];_0x3d3791+=0x1){var _0x5140db={'UserId':Number(_0x1b1d85[_0xfc80('0x58')]['id'])};_0x5140db[_[_0xfc80('0xa4')](_0x3bf6ee[_0xfc80('0xa9')]())+_0xfc80('0xaa')]=Number(_0x1b1d85['body'][_0xfc80('0xa6')][_0x3d3791]);socket['emit'](_0xfc80('0x80')+_[_0xfc80('0xa4')](_0x3bf6ee[_0xfc80('0xa9')]())+_0xfc80('0xab'),_0x5140db);}return _0x51757a;})[_0xfc80('0x29')](function(){if(_0x3bf6ee===_0xfc80('0xac')){return db['VoiceQueue'][_0xfc80('0xad')]({'where':{'id':_0x1b1d85[_0xfc80('0x5c')][_0xfc80('0xa6')]||[]},'raw':!![],'attributes':['id',_0xfc80('0x37')]});}})[_0xfc80('0x29')](function(_0x20088d){var _0xa5e228=_0xd0f839[_0xfc80('0xae')]({'plain':!![]});var _0x2ee91e=[];if(_0x3bf6ee==='voice'&&_0xa5e228[_0xfc80('0x2a')]===_0xfc80('0x2b')&&_0xa5e228[_0xfc80('0xaf')]){for(let _0x1659be=0x0;_0x1659be<_0x20088d[_0xfc80('0x4d')];_0x1659be+=0x1){_0x2ee91e[_0xfc80('0x4e')]({'membername':_0xa5e228[_0xfc80('0x37')],'UserId':_0xa5e228['id'],'queue_name':_0x20088d[_0x1659be][_0xfc80('0x37')],'VoiceQueueId':_0x20088d[_0x1659be]['id'],'interface':_['isNil'](_0xa5e228['interface'])?util[_0xfc80('0xb0')]('SIP/%s',_0xa5e228[_0xfc80('0x37')]):_0xa5e228[_0xfc80('0xa0')],'paused':_0xa5e228['voicePause']||![],'penalty':_0x1b1d85[_0xfc80('0x5c')][_0xfc80('0xa7')]||0x0});}return Promise[_0xfc80('0x55')](_0x2ee91e[_0xfc80('0x34')](function(_0x28be2b){return db[_0xfc80('0xb1')]['upsert'](_0x28be2b);}));}return _0xd0f839;});}})[_0xfc80('0x29')](respondWithStatusCode(_0x502760,null))[_0xfc80('0x56')](handleError(_0x502760,null));};exports[_0xfc80('0xb2')]=function(_0x189d00,_0x96f91d){var _0x1fe906,_0x10453b;return db[_0xfc80('0x4a')][_0xfc80('0x36')]({'where':{'id':_0x189d00['params']['id']},'attributes':['id',_0xfc80('0x37'),'role']})[_0xfc80('0x29')](handleEntityNotFound(_0x96f91d,null))[_0xfc80('0x29')](function(_0x29b02d){if(_0x29b02d){_0x1fe906=_0x29b02d;if(!_0x189d00[_0xfc80('0x43')][_0xfc80('0x9d')]||!utils[_0xfc80('0xa1')](_0x189d00[_0xfc80('0x43')][_0xfc80('0x9d')])){throw new db[(_0xfc80('0x91'))][(_0xfc80('0x95'))](_0xfc80('0xa2'));}return _0x29b02d[_0xfc80('0xb3')+_['capitalize'](_0x189d00[_0xfc80('0x43')]['channel'][_0xfc80('0xa9')]())+'Queues'](_0x189d00[_0xfc80('0x43')]['ids']);}})['then'](function(_0x1c4d79){if(_[_0xfc80('0xb4')](_0x189d00['query'][_0xfc80('0xa6')])){for(var _0x17af44=0x0;_0x17af44<_0x189d00[_0xfc80('0x43')]['ids'][_0xfc80('0x4d')];_0x17af44+=0x1){_0x10453b={'UserId':Number(_0x189d00['params']['id'])};_0x10453b[_['capitalize'](_0x189d00[_0xfc80('0x43')][_0xfc80('0x9d')]['toLowerCase']())+'QueueId']=Number(_0x189d00[_0xfc80('0x43')][_0xfc80('0xa6')][_0x17af44]);socket[_0xfc80('0x2c')](_0xfc80('0x80')+_[_0xfc80('0xa4')](_0x189d00['query']['channel'][_0xfc80('0xa9')]())+_0xfc80('0xb5'),_0x10453b);}}else{_0x10453b={'UserId':Number(_0x189d00[_0xfc80('0x58')]['id'])};_0x10453b[_[_0xfc80('0xa4')](_0x189d00[_0xfc80('0x43')][_0xfc80('0x9d')][_0xfc80('0xa9')]())+_0xfc80('0xaa')]=Number(_0x189d00[_0xfc80('0x43')][_0xfc80('0xa6')]);socket[_0xfc80('0x2c')]('user'+_[_0xfc80('0xa4')](_0x189d00[_0xfc80('0x43')][_0xfc80('0x9d')][_0xfc80('0xa9')]())+'Queue:remove',_0x10453b);}return _0x1c4d79;})['then'](function(){if(_0x189d00[_0xfc80('0x43')][_0xfc80('0x9d')]===_0xfc80('0xac')){return db[_0xfc80('0xb1')]['destroy']({'where':{'UserId':_0x189d00[_0xfc80('0x58')]['id'],'VoiceQueueId':_0x189d00[_0xfc80('0x43')][_0xfc80('0xa6')]},'individualHooks':!![]})['then'](function(){return _0x1fe906;});}return _0x1fe906;})[_0xfc80('0x29')](respondWithStatusCode(_0x96f91d,null))[_0xfc80('0x56')](handleError(_0x96f91d,null));};exports[_0xfc80('0xb6')]=function(_0x4d822c,_0x26c4e6){_0x4d822c[_0xfc80('0x5c')][_0xfc80('0xb7')]=_0x4d822c[_0xfc80('0xb8')][_0xfc80('0xb9')];return db[_0xfc80('0x4a')]['find']({'where':{'id':_0x4d822c['params']['id']}})[_0xfc80('0x29')](handleEntityNotFound(_0x26c4e6,null))[_0xfc80('0x29')](saveUpdates(_0x4d822c[_0xfc80('0x5c')],null))['then'](respondWithResult(_0x26c4e6,null))[_0xfc80('0x56')](handleError(_0x26c4e6,null));};exports['getAvatar']=function(_0x2683ad,_0x3bb10e){var _0x4b873b=path[_0xfc80('0xba')](config[_0xfc80('0xbb')],_0xfc80('0xbc'));return db[_0xfc80('0x4a')][_0xfc80('0x36')]({'where':{'id':_0x2683ad[_0xfc80('0x58')]['id']},'attributes':['id',_0xfc80('0xb7')],'raw':!![]})['then'](handleEntityNotFound(_0x3bb10e,null))[_0xfc80('0x29')](function(_0x52ce58){if(_0x52ce58){if(_[_0xfc80('0x6a')](_0x52ce58[_0xfc80('0xb7')])){return _0x3bb10e[_0xfc80('0xbd')](_0x4b873b);}else{if(!fs[_0xfc80('0xbe')](path['join'](config['root'],_0xfc80('0xbf'),_0x52ce58['userpic']))){return _0x3bb10e[_0xfc80('0xbd')](_0x4b873b);}return _0x3bb10e[_0xfc80('0xbd')](path['join'](config['root'],'server/files/images/',_0x52ce58[_0xfc80('0xb7')]));}}})[_0xfc80('0x56')](handleError(_0x3bb10e,null));};exports[_0xfc80('0xc0')]=function(_0x272719,_0x3808c2){return db[_0xfc80('0x4a')]['find']({'where':{'id':_0x272719[_0xfc80('0x58')]['id']},'attributes':['id']})[_0xfc80('0x29')](handleEntityNotFound(_0x3808c2,null))[_0xfc80('0x29')](function(_0x49b1d4){var _0x3fc9fa=[];values=_0x49b1d4[_0xfc80('0x50')];_0x3fc9fa[_0xfc80('0x4e')](get_open_tabs(_0xfc80('0x4f'),_0x49b1d4[_0xfc80('0x50')]));_0x3fc9fa[_0xfc80('0x4e')](get_open_tabs('sms',_0x49b1d4[_0xfc80('0x50')]));_0x3fc9fa[_0xfc80('0x4e')](get_open_tabs(_0xfc80('0x53'),_0x49b1d4[_0xfc80('0x50')]));_0x3fc9fa[_0xfc80('0x4e')](get_open_tabs(_0xfc80('0x54'),_0x49b1d4[_0xfc80('0x50')]));_0x3fc9fa[_0xfc80('0x4e')](get_open_tabs('fax',_0x49b1d4[_0xfc80('0x50')]));_0x3fc9fa['push'](get_open_tabs('mail',_0x49b1d4[_0xfc80('0x50')]));return Promise[_0xfc80('0x55')](_0x3fc9fa);})['then'](function(_0x3c7bbb){if(_0x3c7bbb){var _0x391062=_['map'](values[_0xfc80('0xc1')],function(_0x4e5ecf){return{'channel':'CHAT','id':_0x4e5ecf['id'],'createdAt':_0x4e5ecf['createdAt']};});var _0x26e98f=_[_0xfc80('0x34')](values['FaxOpenTabs'],function(_0x4d3ef5){return{'channel':'FAX','id':_0x4d3ef5['id'],'createdAt':_0x4d3ef5[_0xfc80('0xc2')]};});var _0x13f3d1=_[_0xfc80('0x34')](values[_0xfc80('0xc3')],function(_0x242d6e){return{'channel':'OPENCHANNEL','id':_0x242d6e['id'],'createdAt':_0x242d6e[_0xfc80('0xc2')]};});var _0x2b0ec3=_[_0xfc80('0x34')](values[_0xfc80('0xc4')],function(_0x29d3a2){return{'channel':_0xfc80('0xc5'),'id':_0x29d3a2['id'],'createdAt':_0x29d3a2['createdAt']};});var _0x3fe696=_['map'](values[_0xfc80('0xc6')],function(_0x530cb3){return{'channel':_0xfc80('0xc7'),'id':_0x530cb3['id'],'createdAt':_0x530cb3[_0xfc80('0xc2')]};});var _0x510e8c=_[_0xfc80('0x34')](values[_0xfc80('0xc8')],function(_0x33dd60){return{'channel':_0xfc80('0xc9'),'id':_0x33dd60['id'],'createdAt':_0x33dd60[_0xfc80('0xc2')]};});var _0x87d4f2=_['concat'](_0x391062,_0x26e98f,_0x13f3d1,_0x2b0ec3,_0x3fe696,_0x510e8c);var _0x59ffec={'count':_0x87d4f2[_0xfc80('0x4d')],'rows':_0x87d4f2};return _0x59ffec;}else return null;})[_0xfc80('0x29')](respondWithResult(_0x3808c2,null))['catch'](handleError(_0x3808c2,null));};exports[_0xfc80('0xca')]=function(_0x363242,_0x4a7346){var _0x1ec9cb={};return db[_0xfc80('0x4a')]['findOne']({'where':{'id':_0x363242[_0xfc80('0x58')]['id']}})[_0xfc80('0x29')](function(_0x587b27){if(!_0x587b27){throw new APINotFoundError(util[_0xfc80('0xb0')]('User\x20with\x20id\x20%s\x20not\x20found',_0x363242['params']['id']));}return contacts[_0xfc80('0x5d')]();})[_0xfc80('0x29')](function(_0x23de63){_0x363242[_0xfc80('0x43')]['User']=_0x363242['params']['id'];_0x1ec9cb=qs[_0xfc80('0x42')](_0x23de63,_0x363242);if(_0x363242[_0xfc80('0x43')][_0xfc80('0xcb')](_0xfc80('0x44'))){_0x1ec9cb[_0xfc80('0x47')]=[{'model':db[_0xfc80('0xcc')],'as':_0xfc80('0xcd'),'required':![]},{'model':db['Tag'],'as':_0xfc80('0xce'),'attributes':['id','name',_0xfc80('0xcf')],'where':_0x363242[_0xfc80('0x43')][_0xfc80('0xd0')]?{'id':_0x363242[_0xfc80('0x43')][_0xfc80('0xd0')]}:undefined,'required':_0x363242['query']['tag']?!![]:![]}];}return contacts['findAll'](_0x363242[_0xfc80('0x43')],_0x363242[_0xfc80('0x80')],_0x1ec9cb,_0x23de63);})['then'](respondWithFilteredResult(_0x4a7346,_0x1ec9cb))[_0xfc80('0x56')](APIHandleError(_0x4a7346));};exports[_0xfc80('0xd1')]=function(_0x1bc328,_0x323a58){var _0x319e95;var _0x5c88e5={};var _0x3fa65c;return db[_0xfc80('0x4a')][_0xfc80('0x98')]({'where':{'id':_0x1bc328[_0xfc80('0x58')]['id']},'attributes':['id',_0xfc80('0x37'),_0xfc80('0x2a')]})[_0xfc80('0x29')](handleEntityNotFound(_0x323a58,null))['then'](function(_0x2887fc){if(!utils['isValidChannel'](_0x1bc328[_0xfc80('0x43')][_0xfc80('0x9d')])){throw new db[(_0xfc80('0x91'))][(_0xfc80('0x95'))](_0xfc80('0xa2'));}_0x319e95=_0x2887fc;var _0x5d51e8={};_0x5d51e8['model']=_[_0xfc80('0xd2')](db[_[_0xfc80('0xa4')](_0x1bc328[_0xfc80('0x43')][_0xfc80('0x9d')])+_0xfc80('0xd3')]['rawAttributes']);_0x5d51e8[_0xfc80('0x43')]=_[_0xfc80('0xd2')](_0x1bc328[_0xfc80('0x43')]);_0x5d51e8[_0xfc80('0xd4')]=_[_0xfc80('0xd5')](_0x5d51e8[_0xfc80('0xd6')],_0x5d51e8['query']);_0x5c88e5[_0xfc80('0x49')]=_['intersection'](_0x5d51e8['model'],qs[_0xfc80('0xd7')](_0x1bc328[_0xfc80('0x43')]['fields']));_0x5c88e5[_0xfc80('0x49')]=_0x5c88e5['attributes'][_0xfc80('0x4d')]?_0x5c88e5[_0xfc80('0x49')]:_0x5d51e8['model'];_0x5c88e5[_0xfc80('0xd8')]=qs[_0xfc80('0xd9')](_0x1bc328[_0xfc80('0x43')]['sort']);_0x5c88e5[_0xfc80('0xda')]=qs[_0xfc80('0xd4')](_[_0xfc80('0xdb')](_0x1bc328[_0xfc80('0x43')],_0x5d51e8['filters']));if(_0x1bc328['query'][_0xfc80('0x33')]){_0x5c88e5[_0xfc80('0xda')]=_[_0xfc80('0xdc')](_0x5c88e5[_0xfc80('0xda')],{'$or':_['map'](_0x5c88e5['attributes'],function(_0x1c027d){var _0x3da045={};_0x3da045[_0x1c027d]={'$like':'%'+_0x1bc328[_0xfc80('0x43')][_0xfc80('0x33')]+'%'};return _0x3da045;})});}_0x5c88e5=_[_0xfc80('0xdc')]({},_0x5c88e5,_0x1bc328['options']);switch(_0x319e95[_0xfc80('0x2a')]){case'admin':return db[_['capitalize'](_0x1bc328[_0xfc80('0x43')][_0xfc80('0x9d')])+_0xfc80('0xd3')]['findAll'](_0x5c88e5);case _0xfc80('0x80'):case _0xfc80('0x2b'):return _0x319e95[_0xfc80('0xae')+_[_0xfc80('0xa4')](_0x1bc328[_0xfc80('0x43')][_0xfc80('0x9d')])+_0xfc80('0xa5')](_0x5c88e5);default:throw new db[(_0xfc80('0x91'))]['ValidationError']('Unknown\x20role');}})['then'](function(_0x396eb5){_0x3fa65c=_0x396eb5[_0xfc80('0x4d')];if(!_0x1bc328[_0xfc80('0x43')][_0xfc80('0xcb')]('nolimit')){_0x5c88e5[_0xfc80('0x1a')]=qs[_0xfc80('0x1a')](_0x1bc328[_0xfc80('0x43')][_0xfc80('0x1a')]);_0x5c88e5[_0xfc80('0x1c')]=qs[_0xfc80('0x1c')](_0x1bc328[_0xfc80('0x43')][_0xfc80('0x1c')]);}switch(_0x319e95['role']){case _0xfc80('0x2f'):return db[_[_0xfc80('0xa4')](_0x1bc328['query'][_0xfc80('0x9d')])+'Queue']['findAll'](_0x5c88e5);case _0xfc80('0x80'):case _0xfc80('0x2b'):return _0x319e95[_0xfc80('0xae')+_[_0xfc80('0xa4')](_0x1bc328[_0xfc80('0x43')][_0xfc80('0x9d')])+_0xfc80('0xa5')](_0x5c88e5);}})[_0xfc80('0x29')](function(_0x262b79){return{'count':_0x3fa65c,'rows':_0x262b79};})['then'](respondWithResult(_0x323a58,null))[_0xfc80('0x56')](handleError(_0x323a58,null));};exports[_0xfc80('0xdd')]=function(_0x32abb3,_0x3dce00){var _0x5a6f54={};var _0x2773ef={};var _0x59d5db;var _0x225781;return db[_0xfc80('0x4a')][_0xfc80('0x98')]({'where':{'id':_0x32abb3[_0xfc80('0x58')]['id']}})[_0xfc80('0x29')](handleEntityNotFound(_0x3dce00,null))['then'](function(_0x3c281d){if(_0x3c281d){_0x59d5db=_0x3c281d;_0x2773ef[_0xfc80('0xd6')]=_['keys'](db[_0xfc80('0xb1')][_0xfc80('0xde')]);_0x2773ef[_0xfc80('0x43')]=_['keys'](_0x32abb3[_0xfc80('0x43')]);_0x2773ef['filters']=_[_0xfc80('0xd5')](_0x2773ef[_0xfc80('0xd6')],_0x2773ef[_0xfc80('0x43')]);_0x5a6f54[_0xfc80('0x49')]=_['intersection'](_0x2773ef[_0xfc80('0xd6')],qs[_0xfc80('0xd7')](_0x32abb3['query'][_0xfc80('0xd7')]));_0x5a6f54[_0xfc80('0x49')]=_0x5a6f54[_0xfc80('0x49')][_0xfc80('0x4d')]?_0x5a6f54[_0xfc80('0x49')]:_0x2773ef[_0xfc80('0xd6')];_0x5a6f54['order']=qs[_0xfc80('0xd9')](_0x32abb3[_0xfc80('0x43')][_0xfc80('0xd9')]);_0x5a6f54[_0xfc80('0xda')]=qs['filters'](_[_0xfc80('0xdb')](_0x32abb3[_0xfc80('0x43')],_0x2773ef['filters']));if(_0x32abb3[_0xfc80('0x43')][_0xfc80('0x33')]){_0x5a6f54['where']=_['merge'](_0x5a6f54[_0xfc80('0xda')],{'$or':_[_0xfc80('0x34')](_0x5a6f54['attributes'],function(_0x47cc41){var _0x351bc9={};_0x351bc9[_0x47cc41]={'$like':'%'+_0x32abb3[_0xfc80('0x43')]['filter']+'%'};return _0x351bc9;})});}_0x5a6f54=_[_0xfc80('0xdc')]({},_0x5a6f54,_0x32abb3[_0xfc80('0x59')]);return _0x59d5db[_0xfc80('0xdd')](_0x5a6f54);}})[_0xfc80('0x29')](function(_0x41fbdf){if(_0x41fbdf){_0x225781=_0x41fbdf[_0xfc80('0x4d')];if(!_0x32abb3[_0xfc80('0x43')][_0xfc80('0xcb')]('nolimit')){_0x5a6f54['limit']=qs[_0xfc80('0x1a')](_0x32abb3[_0xfc80('0x43')][_0xfc80('0x1a')]);_0x5a6f54[_0xfc80('0x1c')]=qs[_0xfc80('0x1c')](_0x32abb3[_0xfc80('0x43')][_0xfc80('0x1c')]);}return _0x59d5db[_0xfc80('0xdd')](_0x5a6f54);}})[_0xfc80('0x29')](function(_0x38d5f8){if(_0x38d5f8){return _0x38d5f8?{'count':_0x225781,'rows':_0x38d5f8}:null;}})[_0xfc80('0x29')](respondWithResult(_0x3dce00,null))['catch'](handleError(_0x3dce00,null));};exports[_0xfc80('0xdf')]=function(_0x575833,_0x2a0f58){var _0x1757c3={};var _0x5d953b={};var _0x48157e;var _0x34cbac;return db['User']['findOne']({'where':{'id':_0x575833[_0xfc80('0x58')]['id']}})['then'](handleEntityNotFound(_0x2a0f58,null))[_0xfc80('0x29')](function(_0x22ecf1){if(_0x22ecf1){_0x48157e=_0x22ecf1;_0x5d953b['model']=_[_0xfc80('0xd2')](db['ChatGroup'][_0xfc80('0xde')]);_0x5d953b[_0xfc80('0x43')]=_[_0xfc80('0xd2')](_0x575833[_0xfc80('0x43')]);_0x5d953b[_0xfc80('0xd4')]=_[_0xfc80('0xd5')](_0x5d953b[_0xfc80('0xd6')],_0x5d953b[_0xfc80('0x43')]);_0x1757c3[_0xfc80('0x49')]=_[_0xfc80('0xd5')](_0x5d953b[_0xfc80('0xd6')],qs[_0xfc80('0xd7')](_0x575833[_0xfc80('0x43')][_0xfc80('0xd7')]));_0x1757c3[_0xfc80('0x49')]=_0x1757c3['attributes'][_0xfc80('0x4d')]?_0x1757c3[_0xfc80('0x49')]:_0x5d953b[_0xfc80('0xd6')];_0x1757c3[_0xfc80('0xd8')]=qs[_0xfc80('0xd9')](_0x575833[_0xfc80('0x43')][_0xfc80('0xd9')]);_0x1757c3[_0xfc80('0xda')]=qs[_0xfc80('0xd4')](_[_0xfc80('0xdb')](_0x575833[_0xfc80('0x43')],_0x5d953b[_0xfc80('0xd4')]));if(_0x575833[_0xfc80('0x43')]['filter']){_0x1757c3[_0xfc80('0xda')]=_[_0xfc80('0xdc')](_0x1757c3[_0xfc80('0xda')],{'$or':_[_0xfc80('0x34')](_0x1757c3['attributes'],function(_0x541b89){var _0x3e8498={};_0x3e8498[_0x541b89]={'$like':'%'+_0x575833[_0xfc80('0x43')][_0xfc80('0x33')]+'%'};return _0x3e8498;})});}_0x1757c3=_[_0xfc80('0xdc')]({},_0x1757c3,_0x575833[_0xfc80('0x59')]);return _0x48157e[_0xfc80('0xdf')](_0x1757c3);}})[_0xfc80('0x29')](function(_0x25fe97){if(_0x25fe97){_0x34cbac=_0x25fe97['length'];if(!_0x575833[_0xfc80('0x43')][_0xfc80('0xcb')]('nolimit')){_0x1757c3[_0xfc80('0x1a')]=qs['limit'](_0x575833[_0xfc80('0x43')][_0xfc80('0x1a')]);_0x1757c3[_0xfc80('0x1c')]=qs['offset'](_0x575833[_0xfc80('0x43')][_0xfc80('0x1c')]);}return _0x48157e['getGroups'](_0x1757c3);}})[_0xfc80('0x29')](function(_0x33a91e){if(_0x33a91e){return _0x33a91e?{'count':_0x34cbac,'rows':_0x33a91e}:null;}})[_0xfc80('0x29')](respondWithResult(_0x2a0f58,null))['catch'](handleError(_0x2a0f58,null));};exports[_0xfc80('0xe0')]=function(_0x529efb,_0x5727d4){var _0x1cba45={'raw':!![],'where':{}};var _0x148cc9={};var _0x3c327a={'count':0x0,'rows':[]};return db[_0xfc80('0x4a')][_0xfc80('0x98')]({'where':{'id':_0x529efb[_0xfc80('0x58')]['id']}})['then'](handleEntityNotFound(_0x5727d4,null))['then'](function(_0x3016b6){if(_0x3016b6){_0x148cc9[_0xfc80('0xd6')]=_['keys'](db[_0xfc80('0xe1')][_0xfc80('0xde')]);_0x148cc9['query']=_['keys'](_0x529efb['query']);_0x148cc9['filters']=_[_0xfc80('0xd5')](_0x148cc9['model'],_0x148cc9[_0xfc80('0x43')]);_0x1cba45[_0xfc80('0x49')]=_['intersection'](_0x148cc9[_0xfc80('0xd6')],qs[_0xfc80('0xd7')](_0x529efb['query'][_0xfc80('0xd7')]));_0x1cba45[_0xfc80('0x49')]=_0x1cba45[_0xfc80('0x49')][_0xfc80('0x4d')]?_0x1cba45[_0xfc80('0x49')]:_0x148cc9[_0xfc80('0xd6')];if(!_0x529efb['query'][_0xfc80('0xcb')]('nolimit')){_0x1cba45[_0xfc80('0x1a')]=qs[_0xfc80('0x1a')](_0x529efb[_0xfc80('0x43')][_0xfc80('0x1a')]);_0x1cba45['offset']=qs[_0xfc80('0x1c')](_0x529efb[_0xfc80('0x43')]['offset']);}_0x1cba45[_0xfc80('0xd8')]=qs['sort'](_0x529efb[_0xfc80('0x43')][_0xfc80('0xd9')]);_0x1cba45[_0xfc80('0xda')]=qs[_0xfc80('0xd4')](_[_0xfc80('0xdb')](_0x529efb[_0xfc80('0x43')],_0x148cc9[_0xfc80('0xd4')]));_0x1cba45[_0xfc80('0xda')]['UserId']=_0x3016b6['id'];if(_0x529efb[_0xfc80('0x43')][_0xfc80('0x33')]){_0x1cba45[_0xfc80('0xda')]=_[_0xfc80('0xdc')](_0x1cba45[_0xfc80('0xda')],{'$or':_[_0xfc80('0x34')](_0x1cba45[_0xfc80('0x49')],function(_0xf930db){var _0x4e6d6c={};_0x4e6d6c[_0xf930db]={'$like':'%'+_0x529efb[_0xfc80('0x43')]['filter']+'%'};return _0x4e6d6c;})});}_0x1cba45=_[_0xfc80('0xdc')]({},_0x1cba45,_0x529efb[_0xfc80('0x59')]);return db[_0xfc80('0xe1')][_0xfc80('0x1b')]({'where':_0x1cba45[_0xfc80('0xda')]})['then'](function(_0x5c98e0){_0x3c327a[_0xfc80('0x1b')]=_0x5c98e0;if(_0x529efb[_0xfc80('0x43')]['includeAll']){_0x1cba45[_0xfc80('0x47')]=[{'all':!![]}];}return db['VoiceRecording'][_0xfc80('0xad')](_0x1cba45);})['then'](function(_0x48b5c0){_0x3c327a['rows']=_0x48b5c0;return _0x3c327a;});}})[_0xfc80('0x29')](respondWithFilteredResult(_0x5727d4,_0x1cba45))[_0xfc80('0x56')](handleError(_0x5727d4,null));};exports[_0xfc80('0xe2')]=function(_0x31d6d6,_0x1460fa){var _0x3dd384={'raw':!![],'where':{}};var _0x8c0d8f={};var _0x1cdbe4={'count':0x0,'rows':[]};return db['User'][_0xfc80('0x98')]({'where':{'id':_0x31d6d6[_0xfc80('0x58')]['id']}})[_0xfc80('0x29')](handleEntityNotFound(_0x1460fa,null))[_0xfc80('0x29')](function(_0x3a4b89){if(_0x3a4b89){_0x8c0d8f[_0xfc80('0xd6')]=_[_0xfc80('0xd2')](db[_0xfc80('0xe3')][_0xfc80('0xde')]);_0x8c0d8f[_0xfc80('0x43')]=_[_0xfc80('0xd2')](_0x31d6d6['query']);_0x8c0d8f[_0xfc80('0xd4')]=_[_0xfc80('0xd5')](_0x8c0d8f[_0xfc80('0xd6')],_0x8c0d8f[_0xfc80('0x43')]);_0x3dd384[_0xfc80('0x49')]=_[_0xfc80('0xd5')](_0x8c0d8f[_0xfc80('0xd6')],qs[_0xfc80('0xd7')](_0x31d6d6['query']['fields']));_0x3dd384[_0xfc80('0x49')]=_0x3dd384['attributes'][_0xfc80('0x4d')]?_0x3dd384[_0xfc80('0x49')]:_0x8c0d8f[_0xfc80('0xd6')];if(!_0x31d6d6['query'][_0xfc80('0xcb')](_0xfc80('0xe4'))){_0x3dd384[_0xfc80('0x1a')]=qs[_0xfc80('0x1a')](_0x31d6d6[_0xfc80('0x43')][_0xfc80('0x1a')]);_0x3dd384[_0xfc80('0x1c')]=qs[_0xfc80('0x1c')](_0x31d6d6[_0xfc80('0x43')]['offset']);}_0x3dd384[_0xfc80('0xd8')]=qs[_0xfc80('0xd9')](_0x31d6d6[_0xfc80('0x43')][_0xfc80('0xd9')]);_0x3dd384[_0xfc80('0xda')]=qs[_0xfc80('0xd4')](_[_0xfc80('0xdb')](_0x31d6d6['query'],_0x8c0d8f[_0xfc80('0xd4')]));_0x3dd384[_0xfc80('0xda')][_0xfc80('0xe5')]=_0x3a4b89['id'];if(_0x31d6d6[_0xfc80('0x43')]['filter']){_0x3dd384[_0xfc80('0xda')]=_[_0xfc80('0xdc')](_0x3dd384[_0xfc80('0xda')],{'$or':_[_0xfc80('0x34')](_0x3dd384['attributes'],function(_0x2259a5){var _0x71f18={};_0x71f18[_0x2259a5]={'$like':'%'+_0x31d6d6[_0xfc80('0x43')][_0xfc80('0x33')]+'%'};return _0x71f18;})});}_0x3dd384=_['merge']({},_0x3dd384,_0x31d6d6[_0xfc80('0x59')]);return db['ScreenRecording'][_0xfc80('0x1b')]({'where':_0x3dd384[_0xfc80('0xda')]})[_0xfc80('0x29')](function(_0x5f2073){_0x1cdbe4[_0xfc80('0x1b')]=_0x5f2073;if(_0x31d6d6[_0xfc80('0x43')][_0xfc80('0x44')]){_0x3dd384[_0xfc80('0x47')]=[{'all':!![]}];}return db[_0xfc80('0xe3')][_0xfc80('0xad')](_0x3dd384);})['then'](function(_0x1c52e0){_0x1cdbe4[_0xfc80('0x4c')]=_0x1c52e0;return _0x1cdbe4;});}})[_0xfc80('0x29')](respondWithFilteredResult(_0x1460fa,_0x3dd384))['catch'](handleError(_0x1460fa,null));};exports[_0xfc80('0xe6')]=function(_0x2de0da,_0x140828){var _0x2e84cc={};var _0x34bceb={};var _0x5b59fa;var _0xefd370;return db[_0xfc80('0x4a')]['findOne']({'where':{'id':_0x2de0da[_0xfc80('0x58')]['id']}})[_0xfc80('0x29')](handleEntityNotFound(_0x140828,null))[_0xfc80('0x29')](function(_0x1a1aab){if(_0x1a1aab){_0x5b59fa=_0x1a1aab;_0x34bceb[_0xfc80('0xd6')]=_[_0xfc80('0xd2')](db[_0xfc80('0xe7')][_0xfc80('0xde')]);_0x34bceb[_0xfc80('0x43')]=_[_0xfc80('0xd2')](_0x2de0da['query']);_0x34bceb['filters']=_['intersection'](_0x34bceb[_0xfc80('0xd6')],_0x34bceb['query']);_0x2e84cc['attributes']=_[_0xfc80('0xd5')](_0x34bceb[_0xfc80('0xd6')],qs[_0xfc80('0xd7')](_0x2de0da[_0xfc80('0x43')][_0xfc80('0xd7')]));_0x2e84cc[_0xfc80('0x49')]=_0x2e84cc[_0xfc80('0x49')][_0xfc80('0x4d')]?_0x2e84cc[_0xfc80('0x49')]:_0x34bceb[_0xfc80('0xd6')];_0x2e84cc[_0xfc80('0xd8')]=qs[_0xfc80('0xd9')](_0x2de0da[_0xfc80('0x43')][_0xfc80('0xd9')]);_0x2e84cc[_0xfc80('0xda')]=qs[_0xfc80('0xd4')](_['pick'](_0x2de0da[_0xfc80('0x43')],_0x34bceb[_0xfc80('0xd4')]));if(_0x2de0da[_0xfc80('0x43')]['filter']){_0x2e84cc['where']=_[_0xfc80('0xdc')](_0x2e84cc['where'],{'$or':_[_0xfc80('0x34')](_0x2e84cc['attributes'],function(_0x53dd2a){var _0x2a581e={};_0x2a581e[_0x53dd2a]={'$like':'%'+_0x2de0da['query'][_0xfc80('0x33')]+'%'};return _0x2a581e;})});}_0x2e84cc=_[_0xfc80('0xdc')]({},_0x2e84cc,_0x2de0da[_0xfc80('0x59')]);return _0x5b59fa[_0xfc80('0xe6')](_0x2e84cc);}})[_0xfc80('0x29')](function(_0x1be9e8){if(_0x1be9e8){_0xefd370=_0x1be9e8[_0xfc80('0x4d')];if(!_0x2de0da[_0xfc80('0x43')][_0xfc80('0xcb')]('nolimit')){_0x2e84cc[_0xfc80('0x1a')]=qs[_0xfc80('0x1a')](_0x2de0da[_0xfc80('0x43')][_0xfc80('0x1a')]);_0x2e84cc[_0xfc80('0x1c')]=qs['offset'](_0x2de0da[_0xfc80('0x43')][_0xfc80('0x1c')]);}return _0x5b59fa[_0xfc80('0xe6')](_0x2e84cc);}})[_0xfc80('0x29')](function(_0x57a458){if(_0x57a458){return _0x57a458?{'count':_0xefd370,'rows':_0x57a458}:null;}})['then'](respondWithResult(_0x140828,null))[_0xfc80('0x56')](handleError(_0x140828,null));};exports['getOpenchannelInteractions']=function(_0x2bb107,_0x467dbb){var _0x163983={};var _0x24db40={};var _0x3fc9d0;var _0x3b03fc;return db[_0xfc80('0x4a')]['findOne']({'where':{'id':_0x2bb107[_0xfc80('0x58')]['id']}})['then'](handleEntityNotFound(_0x467dbb,null))['then'](function(_0x6a4a1a){if(_0x6a4a1a){_0x3fc9d0=_0x6a4a1a;_0x24db40[_0xfc80('0xd6')]=_['keys'](db[_0xfc80('0xe8')][_0xfc80('0xde')]);_0x24db40[_0xfc80('0x43')]=_[_0xfc80('0xd2')](_0x2bb107[_0xfc80('0x43')]);_0x24db40['filters']=_[_0xfc80('0xd5')](_0x24db40[_0xfc80('0xd6')],_0x24db40[_0xfc80('0x43')]);_0x163983[_0xfc80('0x49')]=_[_0xfc80('0xd5')](_0x24db40['model'],qs[_0xfc80('0xd7')](_0x2bb107[_0xfc80('0x43')]['fields']));_0x163983['attributes']=_0x163983[_0xfc80('0x49')][_0xfc80('0x4d')]?_0x163983[_0xfc80('0x49')]:_0x24db40[_0xfc80('0xd6')];_0x163983[_0xfc80('0xd8')]=qs[_0xfc80('0xd9')](_0x2bb107[_0xfc80('0x43')]['sort']);_0x163983[_0xfc80('0xda')]=qs[_0xfc80('0xd4')](_[_0xfc80('0xdb')](_0x2bb107[_0xfc80('0x43')],_0x24db40[_0xfc80('0xd4')]));if(_0x2bb107[_0xfc80('0x43')]['filter']){_0x163983[_0xfc80('0xda')]=_[_0xfc80('0xdc')](_0x163983[_0xfc80('0xda')],{'$or':_[_0xfc80('0x34')](_0x163983['attributes'],function(_0x36790c){var _0xddc9c5={};_0xddc9c5[_0x36790c]={'$like':'%'+_0x2bb107[_0xfc80('0x43')][_0xfc80('0x33')]+'%'};return _0xddc9c5;})});}_0x163983=_[_0xfc80('0xdc')]({},_0x163983,_0x2bb107['options']);return _0x3fc9d0[_0xfc80('0xe9')](_0x163983);}})['then'](function(_0x206c7c){if(_0x206c7c){_0x3b03fc=_0x206c7c[_0xfc80('0x4d')];if(!_0x2bb107[_0xfc80('0x43')][_0xfc80('0xcb')]('nolimit')){_0x163983[_0xfc80('0x1a')]=qs[_0xfc80('0x1a')](_0x2bb107['query']['limit']);_0x163983['offset']=qs[_0xfc80('0x1c')](_0x2bb107[_0xfc80('0x43')][_0xfc80('0x1c')]);}return _0x3fc9d0[_0xfc80('0xe9')](_0x163983);}})[_0xfc80('0x29')](function(_0x43471e){if(_0x43471e){return _0x43471e?{'count':_0x3b03fc,'rows':_0x43471e}:null;}})[_0xfc80('0x29')](respondWithResult(_0x467dbb,null))[_0xfc80('0x56')](handleError(_0x467dbb,null));};exports[_0xfc80('0xea')]=function(_0xa31f25,_0x3ed196){var _0x155186={'raw':!![],'where':{}};var _0x480756={};var _0x594207={'count':0x0,'rows':[]};return db[_0xfc80('0x4a')]['findOne']({'where':{'id':_0xa31f25[_0xfc80('0x58')]['id']}})['then'](handleEntityNotFound(_0x3ed196,null))['then'](function(_0x1b92ef){if(_0x1b92ef){_0x480756[_0xfc80('0xd6')]=_[_0xfc80('0xd2')](db[_0xfc80('0xeb')]['rawAttributes']);_0x480756['query']=_[_0xfc80('0xd2')](_0xa31f25['query']);_0x480756[_0xfc80('0xd4')]=_[_0xfc80('0xd5')](_0x480756['model'],_0x480756[_0xfc80('0x43')]);_0x155186[_0xfc80('0x49')]=_[_0xfc80('0xd5')](_0x480756[_0xfc80('0xd6')],qs['fields'](_0xa31f25[_0xfc80('0x43')][_0xfc80('0xd7')]));_0x155186[_0xfc80('0x49')]=_0x155186[_0xfc80('0x49')][_0xfc80('0x4d')]?_0x155186[_0xfc80('0x49')]:_0x480756[_0xfc80('0xd6')];if(!_0xa31f25['query'][_0xfc80('0xcb')]('nolimit')){_0x155186[_0xfc80('0x1a')]=qs[_0xfc80('0x1a')](_0xa31f25['query'][_0xfc80('0x1a')]);_0x155186[_0xfc80('0x1c')]=qs[_0xfc80('0x1c')](_0xa31f25[_0xfc80('0x43')][_0xfc80('0x1c')]);}_0x155186[_0xfc80('0xd8')]=qs['sort'](_0xa31f25[_0xfc80('0x43')]['sort']);_0x155186[_0xfc80('0xda')]=qs[_0xfc80('0xd4')](_[_0xfc80('0xdb')](_0xa31f25[_0xfc80('0x43')],_0x480756[_0xfc80('0xd4')]));_0x155186[_0xfc80('0xda')][_0xfc80('0xe5')]=_0x1b92ef['id'];if(_0xa31f25[_0xfc80('0x43')][_0xfc80('0x33')]){_0x155186[_0xfc80('0xda')]=_[_0xfc80('0xdc')](_0x155186['where'],{'$or':_[_0xfc80('0x34')](_0x155186['attributes'],function(_0x1305a1){var _0x542ae7={};_0x542ae7[_0x1305a1]={'$like':'%'+_0xa31f25[_0xfc80('0x43')][_0xfc80('0x33')]+'%'};return _0x542ae7;})});}_0x155186=_[_0xfc80('0xdc')]({},_0x155186,_0xa31f25['options']);return db['MailInteraction'][_0xfc80('0x1b')]({'where':_0x155186[_0xfc80('0xda')]})['then'](function(_0x1814cb){_0x594207[_0xfc80('0x1b')]=_0x1814cb;if(_0xa31f25[_0xfc80('0x43')]['includeAll']){_0x155186['include']=[{'all':!![]}];}return db[_0xfc80('0xeb')]['findAll'](_0x155186);})[_0xfc80('0x29')](function(_0x58b18c){_0x594207[_0xfc80('0x4c')]=_0x58b18c;return _0x594207;});}})['then'](respondWithFilteredResult(_0x3ed196,_0x155186))['catch'](handleError(_0x3ed196,null));};exports['getSmsInteractions']=function(_0x2814ca,_0x262b85){var _0x3eb282={};var _0x3c96fe={};var _0x1903b9;var _0x556911;return db[_0xfc80('0x4a')][_0xfc80('0x98')]({'where':{'id':_0x2814ca[_0xfc80('0x58')]['id']}})[_0xfc80('0x29')](handleEntityNotFound(_0x262b85,null))['then'](function(_0x28af72){if(_0x28af72){_0x1903b9=_0x28af72;_0x3c96fe[_0xfc80('0xd6')]=_[_0xfc80('0xd2')](db['SmsInteraction'][_0xfc80('0xde')]);_0x3c96fe[_0xfc80('0x43')]=_[_0xfc80('0xd2')](_0x2814ca['query']);_0x3c96fe[_0xfc80('0xd4')]=_[_0xfc80('0xd5')](_0x3c96fe[_0xfc80('0xd6')],_0x3c96fe[_0xfc80('0x43')]);_0x3eb282[_0xfc80('0x49')]=_[_0xfc80('0xd5')](_0x3c96fe[_0xfc80('0xd6')],qs[_0xfc80('0xd7')](_0x2814ca[_0xfc80('0x43')][_0xfc80('0xd7')]));_0x3eb282['attributes']=_0x3eb282['attributes'][_0xfc80('0x4d')]?_0x3eb282[_0xfc80('0x49')]:_0x3c96fe[_0xfc80('0xd6')];_0x3eb282[_0xfc80('0xd8')]=qs[_0xfc80('0xd9')](_0x2814ca[_0xfc80('0x43')]['sort']);_0x3eb282[_0xfc80('0xda')]=qs[_0xfc80('0xd4')](_[_0xfc80('0xdb')](_0x2814ca[_0xfc80('0x43')],_0x3c96fe[_0xfc80('0xd4')]));if(_0x2814ca['query'][_0xfc80('0x33')]){_0x3eb282[_0xfc80('0xda')]=_[_0xfc80('0xdc')](_0x3eb282[_0xfc80('0xda')],{'$or':_[_0xfc80('0x34')](_0x3eb282[_0xfc80('0x49')],function(_0x1ea376){var _0x1580c4={};_0x1580c4[_0x1ea376]={'$like':'%'+_0x2814ca['query']['filter']+'%'};return _0x1580c4;})});}_0x3eb282=_['merge']({},_0x3eb282,_0x2814ca['options']);return _0x1903b9[_0xfc80('0xec')](_0x3eb282);}})[_0xfc80('0x29')](function(_0x2f0ef6){if(_0x2f0ef6){_0x556911=_0x2f0ef6[_0xfc80('0x4d')];if(!_0x2814ca[_0xfc80('0x43')]['hasOwnProperty'](_0xfc80('0xe4'))){_0x3eb282[_0xfc80('0x1a')]=qs['limit'](_0x2814ca[_0xfc80('0x43')][_0xfc80('0x1a')]);_0x3eb282['offset']=qs[_0xfc80('0x1c')](_0x2814ca['query'][_0xfc80('0x1c')]);}return _0x1903b9['getSmsInteractions'](_0x3eb282);}})['then'](function(_0x6d483d){if(_0x6d483d){return _0x6d483d?{'count':_0x556911,'rows':_0x6d483d}:null;}})[_0xfc80('0x29')](respondWithResult(_0x262b85,null))[_0xfc80('0x56')](handleError(_0x262b85,null));};exports[_0xfc80('0xed')]=function(_0x33375a,_0x44094c){var _0x5e178b={};var _0x141908={};var _0x4c8895;var _0x4987da;return db[_0xfc80('0x4a')][_0xfc80('0x98')]({'where':{'id':_0x33375a['params']['id']}})[_0xfc80('0x29')](handleEntityNotFound(_0x44094c,null))[_0xfc80('0x29')](function(_0x4b8a52){if(_0x4b8a52){_0x4c8895=_0x4b8a52;_0x141908['model']=_[_0xfc80('0xd2')](db['FaxInteraction'][_0xfc80('0xde')]);_0x141908[_0xfc80('0x43')]=_['keys'](_0x33375a[_0xfc80('0x43')]);_0x141908['filters']=_['intersection'](_0x141908[_0xfc80('0xd6')],_0x141908[_0xfc80('0x43')]);_0x5e178b[_0xfc80('0x49')]=_[_0xfc80('0xd5')](_0x141908[_0xfc80('0xd6')],qs[_0xfc80('0xd7')](_0x33375a[_0xfc80('0x43')]['fields']));_0x5e178b['attributes']=_0x5e178b[_0xfc80('0x49')][_0xfc80('0x4d')]?_0x5e178b['attributes']:_0x141908[_0xfc80('0xd6')];_0x5e178b[_0xfc80('0xd8')]=qs[_0xfc80('0xd9')](_0x33375a[_0xfc80('0x43')][_0xfc80('0xd9')]);_0x5e178b[_0xfc80('0xda')]=qs[_0xfc80('0xd4')](_[_0xfc80('0xdb')](_0x33375a[_0xfc80('0x43')],_0x141908[_0xfc80('0xd4')]));if(_0x33375a['query']['filter']){_0x5e178b[_0xfc80('0xda')]=_['merge'](_0x5e178b[_0xfc80('0xda')],{'$or':_[_0xfc80('0x34')](_0x5e178b[_0xfc80('0x49')],function(_0x566180){var _0x5c8098={};_0x5c8098[_0x566180]={'$like':'%'+_0x33375a[_0xfc80('0x43')][_0xfc80('0x33')]+'%'};return _0x5c8098;})});}_0x5e178b=_[_0xfc80('0xdc')]({},_0x5e178b,_0x33375a['options']);return _0x4c8895[_0xfc80('0xed')](_0x5e178b);}})[_0xfc80('0x29')](function(_0x1a066b){if(_0x1a066b){_0x4987da=_0x1a066b['length'];if(!_0x33375a[_0xfc80('0x43')]['hasOwnProperty']('nolimit')){_0x5e178b[_0xfc80('0x1a')]=qs[_0xfc80('0x1a')](_0x33375a['query'][_0xfc80('0x1a')]);_0x5e178b[_0xfc80('0x1c')]=qs[_0xfc80('0x1c')](_0x33375a[_0xfc80('0x43')][_0xfc80('0x1c')]);}return _0x4c8895['getFaxInteractions'](_0x5e178b);}})[_0xfc80('0x29')](function(_0x1af591){if(_0x1af591){return _0x1af591?{'count':_0x4987da,'rows':_0x1af591}:null;}})[_0xfc80('0x29')](respondWithResult(_0x44094c,null))[_0xfc80('0x56')](handleError(_0x44094c,null));};exports['getWhatsappInteractions']=function(_0x36ac3c,_0x4faa85){var _0x55c739={};var _0x784e1d={};var _0x1b3025;var _0x9397b1;return db[_0xfc80('0x4a')][_0xfc80('0x98')]({'where':{'id':_0x36ac3c['params']['id']}})[_0xfc80('0x29')](handleEntityNotFound(_0x4faa85,null))[_0xfc80('0x29')](function(_0x1d6086){if(_0x1d6086){_0x1b3025=_0x1d6086;_0x784e1d['model']=_[_0xfc80('0xd2')](db[_0xfc80('0xee')][_0xfc80('0xde')]);_0x784e1d['query']=_['keys'](_0x36ac3c[_0xfc80('0x43')]);_0x784e1d[_0xfc80('0xd4')]=_[_0xfc80('0xd5')](_0x784e1d[_0xfc80('0xd6')],_0x784e1d[_0xfc80('0x43')]);_0x55c739[_0xfc80('0x49')]=_[_0xfc80('0xd5')](_0x784e1d['model'],qs[_0xfc80('0xd7')](_0x36ac3c[_0xfc80('0x43')][_0xfc80('0xd7')]));_0x55c739['attributes']=_0x55c739['attributes'][_0xfc80('0x4d')]?_0x55c739[_0xfc80('0x49')]:_0x784e1d[_0xfc80('0xd6')];_0x55c739['order']=qs[_0xfc80('0xd9')](_0x36ac3c[_0xfc80('0x43')][_0xfc80('0xd9')]);_0x55c739[_0xfc80('0xda')]=qs[_0xfc80('0xd4')](_[_0xfc80('0xdb')](_0x36ac3c[_0xfc80('0x43')],_0x784e1d[_0xfc80('0xd4')]));if(_0x36ac3c[_0xfc80('0x43')][_0xfc80('0x33')]){_0x55c739[_0xfc80('0xda')]=_['merge'](_0x55c739[_0xfc80('0xda')],{'$or':_[_0xfc80('0x34')](_0x55c739[_0xfc80('0x49')],function(_0x396f5d){var _0x3d8d71={};_0x3d8d71[_0x396f5d]={'$like':'%'+_0x36ac3c[_0xfc80('0x43')][_0xfc80('0x33')]+'%'};return _0x3d8d71;})});}_0x55c739=_['merge']({},_0x55c739,_0x36ac3c[_0xfc80('0x59')]);return _0x1b3025['getWhatsappInteractions'](_0x55c739);}})[_0xfc80('0x29')](function(_0x40453d){if(_0x40453d){_0x9397b1=_0x40453d[_0xfc80('0x4d')];if(!_0x36ac3c[_0xfc80('0x43')]['hasOwnProperty'](_0xfc80('0xe4'))){_0x55c739[_0xfc80('0x1a')]=qs[_0xfc80('0x1a')](_0x36ac3c[_0xfc80('0x43')][_0xfc80('0x1a')]);_0x55c739[_0xfc80('0x1c')]=qs['offset'](_0x36ac3c[_0xfc80('0x43')]['offset']);}return _0x1b3025['getWhatsappInteractions'](_0x55c739);}})['then'](function(_0x438cac){if(_0x438cac){return _0x438cac?{'count':_0x9397b1,'rows':_0x438cac}:null;}})[_0xfc80('0x29')](respondWithResult(_0x4faa85,null))[_0xfc80('0x56')](handleError(_0x4faa85,null));};exports[_0xfc80('0xef')]=function(_0x17852f,_0x31c171,_0x368734){var _0x334c16;var _0x5df60b;var _0x330616;var _0x414bcd=!_['isNil'](_0x17852f[_0xfc80('0x58')]['id'])?_0x17852f['params']['id']:!_[_0xfc80('0x6a')](_0x17852f[_0xfc80('0x80')]['id'])?_0x17852f[_0xfc80('0x80')]['id']:null;return db[_0xfc80('0x4a')][_0xfc80('0x36')]({'where':{'id':_0x414bcd,'role':{'$or':[_0xfc80('0x2f'),'user',_0xfc80('0x2b')]}},'attributes':['id',_0xfc80('0x37'),'phone',_0xfc80('0xf0'),_0xfc80('0x2a'),'internal',_0xfc80('0x9e')]})[_0xfc80('0x29')](function(_0x2d6a9a){if(_0x2d6a9a){if(_0x2d6a9a[_0xfc80('0x2a')]===_0xfc80('0x2b')){_0x334c16=_0x2d6a9a;if(_0x17852f[_0xfc80('0x5c')]['interface']){_0x330616=util[_0xfc80('0xb0')](_0xfc80('0xf1'),_0x334c16[_0x17852f[_0xfc80('0x5c')][_0xfc80('0xa0')]]);}else if(_0x17852f['body'][_0xfc80('0xf2')]){_0x330616=util[_0xfc80('0xb0')](_0xfc80('0xf3'),_0x17852f[_0xfc80('0x5c')][_0xfc80('0xf2')]);}else{_0x330616=util[_0xfc80('0xb0')](_0xfc80('0xf3'),_0x334c16[_0xfc80('0x37')]);}socket['to'](util['format'](_0xfc80('0xf4'),_0x334c16['name']))[_0xfc80('0x2c')](_0xfc80('0xf5'),{'user':{'id':_0x334c16['id'],'name':_0x334c16[_0xfc80('0x37')]},'ip':_0x17852f[_0xfc80('0xf6')]['x-forwarded-for']||_0x17852f['connection'][_0xfc80('0xf7')]||_0x17852f['socket'][_0xfc80('0xf7')]||_0x17852f[_0xfc80('0xf8')][_0xfc80('0xf9')]['remoteAddress']});return db['UserVoiceQueueRt'][_0xfc80('0x2e')]({'where':{'membername':_0x334c16[_0xfc80('0x37')]},'individualHooks':!![]});}}else{throw new db[(_0xfc80('0x91'))]['ValidationError']('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})[_0xfc80('0x29')](function(){if(_0x334c16){return _0x334c16[_0xfc80('0xfa')]({'raw':!![]});}})[_0xfc80('0x29')](function(_0x3f5ec5){if(_0x334c16){if(_0x3f5ec5){_0x5df60b=_0x3f5ec5;if(_0x5df60b[_0xfc80('0x4d')]){var _0x54dd86=_0x5df60b[_0xfc80('0x34')](function(_0x1484c3){var _0x1dba1f={'membername':_0x334c16[_0xfc80('0x37')],'UserId':_0x334c16['id'],'queue_name':_0x1484c3['name'],'VoiceQueueId':_0x1484c3['id'],'interface':_0x330616,'paused':_0x334c16[_0xfc80('0x9e')]||![],'penalty':_0x1484c3[_0xfc80('0xfb')]||0x0};return db[_0xfc80('0xb1')][_0xfc80('0xfc')](_0x1dba1f);});return Promise['all'](_0x54dd86);}}}})[_0xfc80('0x29')](function(){if(_0x334c16){return db[_0xfc80('0xfd')][_0xfc80('0xad')]({'where':{'membername':_0x334c16['name'],'exitAt':null}});}})[_0xfc80('0x29')](function(_0x20dbe0){if(_0x334c16){var _0x2eea30=[];_0x20dbe0[_0xfc80('0xfe')](function(_0x2f878a){_0x2eea30['push'](_0x2f878a['update']({'exitAt':moment()['format'](_0xfc80('0xff'))}));});return Promise[_0xfc80('0x55')](_0x2eea30);}})['then'](function(){if(_0x334c16){var _0x4f2340=[];var _0x4551f1=[];var _0x2405a0=utils[_0xfc80('0x100')]();var _0x2a8389={'membername':_0x334c16['name'],'interface':_0x330616,'enterAt':moment()[_0xfc80('0xb0')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x334c16[_0xfc80('0x2a')],'internal':_0x334c16[_0xfc80('0x65')]};_0x2405a0[_0xfc80('0xfe')](function(_0x10a845){_0x4f2340['push'](_[_0xfc80('0xdc')]({'channel':_0x10a845,'type':'LOGIN','data1':_0x17852f[_0xfc80('0x5c')][_0xfc80('0x101')],'data2':_0x330616},_0x2a8389));if(_0x334c16['loginInPause']){_0x4551f1[_0xfc80('0x4e')](_['merge']({'channel':_0x10a845,'type':_0xfc80('0x102'),'data1':'LOGININPAUSE'},_0x2a8389));}});return db[_0xfc80('0xfd')][_0xfc80('0x89')](_0x4f2340[_0xfc80('0x103')](_0x4551f1),{'individualHooks':!![]});}})[_0xfc80('0x29')](function(){if(_0x334c16){return _0x334c16['update']({'online':!![],'lastLoginAt':moment()['format'](_0xfc80('0xff')),'voicePause':_0x334c16[_0xfc80('0x9e')]||![],'mailPause':_0x334c16[_0xfc80('0x9e')]||![],'chatPause':_0x334c16[_0xfc80('0x9e')]||![],'faxPause':_0x334c16[_0xfc80('0x9e')]||![],'smsPause':_0x334c16['loginInPause']||![],'openchannelPause':_0x334c16['loginInPause']||![],'whatsappPause':_0x334c16[_0xfc80('0x9e')]||![],'pauseType':_0x334c16[_0xfc80('0x9e')]?_0xfc80('0x104'):null,'interface':_0x330616,'lastPauseAt':moment()[_0xfc80('0xb0')](_0xfc80('0xff'))});}})['then'](function(_0xdf743e){if(_0x17852f[_0xfc80('0x105')]){return _0x368734();}else{return Promise[_0xfc80('0x106')](_0xdf743e)[_0xfc80('0x29')](respondWithResult(_0x31c171,null));}})[_0xfc80('0x56')](handleError(_0x31c171,null));};exports[_0xfc80('0x107')]=function(_0x10a53a,_0x43f529){var _0x1d81dd;return db[_0xfc80('0x4a')]['find']({'where':{'id':_0x10a53a['params']['id'],'role':'agent'},'attributes':['id',_0xfc80('0x37'),'role']})[_0xfc80('0x29')](handleEntityNotFound(_0x43f529,null))[_0xfc80('0x29')](function(_0x31da8d){if(_0x31da8d){_0x1d81dd=_0x31da8d;return db[_0xfc80('0xb1')]['destroy']({'where':{'membername':_0x1d81dd['name']},'individualHooks':!![]});}})[_0xfc80('0x29')](function(){return db[_0xfc80('0xfd')][_0xfc80('0xad')]({'where':{'membername':_0x1d81dd['name'],'exitAt':null}});})[_0xfc80('0x29')](function(_0x5c083d){var _0x6b9c73=[];_0x5c083d['forEach'](function(_0x28b7d5){_0x6b9c73['push'](_0x28b7d5['update']({'exitAt':moment()['format'](_0xfc80('0xff'))}));});return Promise[_0xfc80('0x55')](_0x6b9c73);})[_0xfc80('0x29')](function(){return _0x1d81dd[_0xfc80('0x5b')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xfc80('0x29')](respondWithResult(_0x43f529,null))[_0xfc80('0x56')](handleError(_0x43f529,null));};exports['pause']=function(_0x8eb37e,_0xa35b95){var _0x230846;return db[_0xfc80('0xb1')][_0xfc80('0x5b')]({'paused':0x1},{'where':{'UserId':_0x8eb37e['params']['id']},'individualHooks':!![]})[_0xfc80('0x29')](function(){return db[_0xfc80('0x4a')]['find']({'where':{'id':_0x8eb37e[_0xfc80('0x58')]['id'],'role':'agent'},'attributes':['id',_0xfc80('0x37'),_0xfc80('0x2a'),_0xfc80('0x65'),_0xfc80('0xa0'),_0xfc80('0xaf')]});})[_0xfc80('0x29')](handleEntityNotFound(_0xa35b95,null))[_0xfc80('0x29')](function(_0x160014){if(_0x160014){_0x230846=_0x160014;return respondWithRpcPromise(_0xfc80('0x108'),_0xfc80('0x109'),{'id':_0x230846['id'],'name':_0x230846['name'],'pause':!![]});}})[_0xfc80('0x29')](function(){if(_0x230846){return db['MemberReport'][_0xfc80('0xad')]({'where':{'membername':_0x230846[_0xfc80('0x37')],'type':_0xfc80('0x102'),'exitAt':null}});}})[_0xfc80('0x29')](function(_0x1cbabd){if(_0x1cbabd['length']){var _0x21bb58=moment()[_0xfc80('0xb0')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x3be4a1=0x0,_0x215d09=_0x1cbabd[_0xfc80('0x4d')];_0x3be4a1<_0x215d09;_0x3be4a1++){_0x1cbabd[_0x3be4a1][_0xfc80('0x10a')]({'exitAt':_0x21bb58});}}})[_0xfc80('0x29')](function(){var _0x596d6a=[];var _0x2f5e28=utils[_0xfc80('0x100')]();_0x2f5e28[_0xfc80('0xfe')](function(_0x2d01c8){_0x596d6a['push']({'channel':_0x2d01c8,'membername':_0x230846[_0xfc80('0x37')],'interface':_[_0xfc80('0x6a')](_0x230846[_0xfc80('0xa0')])?util[_0xfc80('0xb0')](_0xfc80('0xf3'),_0x230846['name']):_0x230846[_0xfc80('0xa0')],'type':_0xfc80('0x102'),'enterAt':moment()[_0xfc80('0xb0')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x8eb37e[_0xfc80('0x5c')][_0xfc80('0x10b')]||_0xfc80('0x10c'),'role':_0x230846[_0xfc80('0x2a')],'internal':_0x230846[_0xfc80('0x65')]});});return db[_0xfc80('0xfd')]['bulkCreate'](_0x596d6a,{'individualHooks':!![]});})['then'](function(){return _0x230846[_0xfc80('0x5b')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x8eb37e['body'][_0xfc80('0x10b')]||_0xfc80('0x10c'),'lastPauseAt':moment()[_0xfc80('0xb0')](_0xfc80('0xff'))});})[_0xfc80('0x29')](respondWithResult(_0xa35b95,null))[_0xfc80('0x56')](handleError(_0xa35b95,null));};exports[_0xfc80('0x10d')]=function(_0x5b6439,_0x5b0814){if(_0x5b6439['body'][_0xfc80('0x9d')]&&!utils[_0xfc80('0xa1')](_0x5b6439[_0xfc80('0x5c')]['channel'])){throw new APIBadRequestError(util[_0xfc80('0xb0')](_0xfc80('0x10e'),_0x5b6439['body']['channel']));}return db[_0xfc80('0x4a')][_0xfc80('0x36')]({'where':{'id':_0x5b6439[_0xfc80('0x58')]['id']},'attributes':['id','name','role',_0xfc80('0x65'),_0xfc80('0xa0'),'online','voicePause','mailPause',_0xfc80('0x10f'),_0xfc80('0x110'),_0xfc80('0x111'),_0xfc80('0x112'),_0xfc80('0x113'),'pauseType',_0xfc80('0x114')]})[_0xfc80('0x29')](function(_0x8e4bd4){if(!_0x8e4bd4){throw new APINotFoundError(util[_0xfc80('0xb0')](_0xfc80('0x115'),_0x5b6439[_0xfc80('0x58')]['id']));}return _0x8e4bd4['unpause'](_0x5b6439[_0xfc80('0x5c')][_0xfc80('0x9d')]);})['then'](respondWithResult(_0x5b0814,null))['catch'](APIHandleError(_0x5b0814));};exports['getTeams']=function(_0x179199,_0xad7eaa){var _0x37e5b2={};var _0x5e5607={};var _0x3a7863;var _0x1cb284;return db[_0xfc80('0x4a')]['findOne']({'where':{'id':_0x179199['params']['id']}})[_0xfc80('0x29')](handleEntityNotFound(_0xad7eaa,null))[_0xfc80('0x29')](function(_0x10a93a){if(_0x10a93a){_0x3a7863=_0x10a93a;_0x5e5607[_0xfc80('0xd6')]=_[_0xfc80('0xd2')](db[_0xfc80('0x116')][_0xfc80('0xde')]);_0x5e5607[_0xfc80('0x43')]=_[_0xfc80('0xd2')](_0x179199[_0xfc80('0x43')]);_0x5e5607[_0xfc80('0xd4')]=_[_0xfc80('0xd5')](_0x5e5607['model'],_0x5e5607[_0xfc80('0x43')]);_0x37e5b2[_0xfc80('0x49')]=_['intersection'](_0x5e5607['model'],qs[_0xfc80('0xd7')](_0x179199[_0xfc80('0x43')][_0xfc80('0xd7')]));_0x37e5b2[_0xfc80('0x49')]=_0x37e5b2[_0xfc80('0x49')]['length']?_0x37e5b2[_0xfc80('0x49')]:_0x5e5607[_0xfc80('0xd6')];_0x37e5b2['order']=qs[_0xfc80('0xd9')](_0x179199[_0xfc80('0x43')][_0xfc80('0xd9')]);_0x37e5b2[_0xfc80('0xda')]=qs[_0xfc80('0xd4')](_[_0xfc80('0xdb')](_0x179199[_0xfc80('0x43')],_0x5e5607[_0xfc80('0xd4')]));if(_0x179199[_0xfc80('0x43')]['filter']){_0x37e5b2[_0xfc80('0xda')]=_['merge'](_0x37e5b2['where'],{'$or':_[_0xfc80('0x34')](_0x37e5b2[_0xfc80('0x49')],function(_0x3c090a){var _0x2281ba={};_0x2281ba[_0x3c090a]={'$like':'%'+_0x179199[_0xfc80('0x43')][_0xfc80('0x33')]+'%'};return _0x2281ba;})});}_0x37e5b2=_[_0xfc80('0xdc')]({},_0x37e5b2,_0x179199[_0xfc80('0x59')]);return _0x3a7863['getTeams'](_0x37e5b2);}})[_0xfc80('0x29')](function(_0x586ec4){if(_0x586ec4){_0x1cb284=_0x586ec4[_0xfc80('0x4d')];if(!_0x179199[_0xfc80('0x43')][_0xfc80('0xcb')](_0xfc80('0xe4'))){_0x37e5b2[_0xfc80('0x1a')]=qs['limit'](_0x179199['query'][_0xfc80('0x1a')]);_0x37e5b2[_0xfc80('0x1c')]=qs[_0xfc80('0x1c')](_0x179199[_0xfc80('0x43')][_0xfc80('0x1c')]);}return _0x3a7863['getTeams'](_0x37e5b2);}})[_0xfc80('0x29')](function(_0x3b5edb){if(_0x3b5edb){return _0x3b5edb?{'count':_0x1cb284,'rows':_0x3b5edb}:null;}})[_0xfc80('0x29')](respondWithResult(_0xad7eaa,null))['catch'](handleError(_0xad7eaa,null));};exports[_0xfc80('0x117')]=function(_0x2d1a5f,_0x7f602e){var _0xa1b88f=_0x2d1a5f['params']['id'];var _0x2f884b=_0x2d1a5f['body']?_0x2d1a5f['body']['ids']:null;var _0x135e06=[];return Promise['resolve']()[_0xfc80('0x29')](function(){if(!_0x2f884b)throw new APIBadRequestError(_0xfc80('0x118'));})['then'](function(){return db[_0xfc80('0x4a')][_0xfc80('0x98')]({'where':{'id':_0xa1b88f}});})[_0xfc80('0x29')](function(_0x4e6480){if(!_0x4e6480)throw new APINotFoundError(util[_0xfc80('0xb0')](_0xfc80('0x115'),_0x2d1a5f[_0xfc80('0x58')]['id']));return db['sequelize'][_0xfc80('0x119')](function(_0x1372ed){return _0x4e6480[_0xfc80('0x117')](_0x2f884b,{'transaction':_0x1372ed})['then'](function(){return db[_0xfc80('0x116')][_0xfc80('0xad')]({'where':{'id':{'$in':_0x2f884b}}});})['then'](function(_0x27c551){var _0xd45e6f=_[_0xfc80('0x34')](_0x27c551,function(_0x32c349){return _0x32c349[_0xfc80('0x11a')]();});return Promise[_0xfc80('0x55')](_0xd45e6f);})[_0xfc80('0x29')](function(_0x4938e3){_0x135e06=_['flattenDeep'](_0x4938e3);var _0x5c19d3=_[_0xfc80('0x34')](_0x135e06,function(_0x4e697d){return _0x4e697d[_0xfc80('0x11b')](_0x4e6480['id'],{'transaction':_0x1372ed});});return Promise[_0xfc80('0x55')](_0x5c19d3);})['then'](function(){if(!_0x4e6480[_0xfc80('0xaf')])return;var _0x515d7f=_[_0xfc80('0x33')](_0x135e06,function(_0x43d07e){return _0x43d07e[_0xfc80('0x11c')](_0xfc80('0x9d'))===_0xfc80('0x11d');});var _0x2b272e=_['map'](_0x515d7f,function(_0x56072b){return db[_0xfc80('0xb1')][_0xfc80('0xfc')]({'membername':_0x4e6480[_0xfc80('0x37')],'UserId':_0x4e6480['id'],'queue_name':_0x56072b[_0xfc80('0x37')],'VoiceQueueId':_0x56072b['id'],'interface':_[_0xfc80('0x6a')](_0x4e6480[_0xfc80('0xa0')])?util[_0xfc80('0xb0')](_0xfc80('0xf3'),_0x4e6480[_0xfc80('0x37')]):_0x4e6480['interface'],'paused':_0x4e6480[_0xfc80('0x9f')]||![],'penalty':_0x4e6480[_0xfc80('0xa7')]},{'transaction':_0x1372ed});});return Promise[_0xfc80('0x55')](_0x2b272e);})[_0xfc80('0x29')](function(){return db[_0xfc80('0x11e')]['findAll']({'where':{'teamId':{'$in':_0x2f884b}}});})[_0xfc80('0x29')](function(_0x41dec0){var _0x213df4=_[_0xfc80('0x34')](_0x41dec0,function(_0x4790b4){return db['UserVoicePrefix'][_0xfc80('0x7f')]({'UserId':_0x4e6480['id'],'VoicePrefixId':_0x4790b4[_0xfc80('0x11f')]},{'transaction':_0x1372ed});});return Promise[_0xfc80('0x55')](_0x213df4);});});})[_0xfc80('0x29')](function(){for(var _0x409d31=0x0;_0x409d31<_0x135e06['length'];_0x409d31++){var _0x10c0f5=_0x135e06[_0x409d31][_0xfc80('0x11c')](_0xfc80('0x9d'));var _0x22c3af=_0x10c0f5+'QueueId';socket[_0xfc80('0x2c')]('user'+_0x10c0f5+_0xfc80('0xab'),{'UserId':_0xa1b88f,['queueField']:_0x135e06[_0x409d31]['id']});}})['then'](respondWithStatusCode(_0x7f602e,null))[_0xfc80('0x56')](APIHandleError(_0x7f602e));};exports[_0xfc80('0x120')]=function(_0x3827cc,_0x4a56b7){var _0x9445f6=_0x3827cc['params']['id'];var _0x3c9d90=null;if(_0x3827cc[_0xfc80('0x43')][_0xfc80('0xa6')]){_0x3c9d90=_[_0xfc80('0xb4')](_0x3827cc[_0xfc80('0x43')]['ids'])?_0x3827cc['query'][_0xfc80('0xa6')]:[_0x3827cc[_0xfc80('0x43')][_0xfc80('0xa6')]];}var _0x336072=[];return Promise[_0xfc80('0x106')]()['then'](function(){if(!_0x3c9d90)throw new APIBadRequestError(_0xfc80('0x121'));})[_0xfc80('0x29')](function(){return db[_0xfc80('0x4a')][_0xfc80('0x98')]({'where':{'id':_0x9445f6}});})[_0xfc80('0x29')](function(_0x2eb96c){if(!_0x2eb96c)throw new APINotFoundError(util[_0xfc80('0xb0')](_0xfc80('0x115'),_0x3827cc[_0xfc80('0x58')]['id']));return db['sequelize'][_0xfc80('0x119')](function(_0x337109){return _0x2eb96c[_0xfc80('0x120')](_0x3c9d90,{'transaction':_0x337109})[_0xfc80('0x29')](function(){return db[_0xfc80('0x116')][_0xfc80('0xad')]({'where':{'id':{'$in':_0x3c9d90}}});})[_0xfc80('0x29')](function(_0x2e9636){var _0x14c66f=_['map'](_0x2e9636,function(_0x479f81){return _0x479f81['getAssociatedQueues']();});return Promise['all'](_0x14c66f);})['then'](function(_0x6df053){_0x336072=_[_0xfc80('0x122')](_0x6df053);var _0x51cd2c=_[_0xfc80('0x34')](_0x336072,function(_0x5b4cbd){return _0x5b4cbd['removeAgent'](_0x2eb96c['id'],{'transaction':_0x337109});});return Promise[_0xfc80('0x55')](_0x51cd2c);})[_0xfc80('0x29')](function(){if(!_0x2eb96c[_0xfc80('0xaf')])return;var _0x47ebba=_[_0xfc80('0x33')](_0x336072,function(_0x4f0bcb){return _0x4f0bcb[_0xfc80('0x11c')](_0xfc80('0x9d'))===_0xfc80('0x11d');});var _0x43be43=_[_0xfc80('0x34')](_0x47ebba,function(_0x54d1be){return db['UserVoiceQueueRt'][_0xfc80('0x2e')]({'where':{'VoiceQueueId':_0x54d1be['id'],'UserId':_0x2eb96c['id']},'transaction':_0x337109});});return Promise['all'](_0x43be43);})[_0xfc80('0x29')](function(){return db['TeamVoicePrefix'][_0xfc80('0xad')]({'where':{'teamId':{'$in':_0x3c9d90}}});})[_0xfc80('0x29')](function(_0x33c0e1){var _0x31c6da=_[_0xfc80('0x34')](_0x33c0e1,function(_0x287c24){return db[_0xfc80('0x123')][_0xfc80('0x2e')]({'where':{'UserId':_0x2eb96c['id'],'VoicePrefixId':_0x287c24['VoicePrefixId']}},{'transaction':_0x337109});});return Promise[_0xfc80('0x55')](_0x31c6da);});});})[_0xfc80('0x29')](function(){for(var _0x141a82=0x0;_0x141a82<_0x336072[_0xfc80('0x4d')];_0x141a82++){var _0x491eac=_0x336072[_0x141a82][_0xfc80('0x11c')]('channel');var _0x4514dd=_0x491eac+'QueueId';socket['emit']('user'+_0x491eac+_0xfc80('0xb5'),{'UserId':_0x9445f6,['queueField']:_0x336072[_0x141a82]['id']});}})['then'](respondWithStatusCode(_0x4a56b7,null))[_0xfc80('0x56')](APIHandleError(_0x4a56b7));};exports['getLists']=function(_0x11787c,_0x5a3d15){var _0x4d124b={};var _0x327226={};var _0x2984be;var _0x367fb0;return db['User'][_0xfc80('0x98')]({'where':{'id':_0x11787c['params']['id']}})['then'](handleEntityNotFound(_0x5a3d15,null))[_0xfc80('0x29')](function(_0x485ba4){if(_0x485ba4){_0x2984be=_0x485ba4;_0x327226[_0xfc80('0xd6')]=_[_0xfc80('0xd2')](db[_0xfc80('0xcc')][_0xfc80('0xde')]);_0x327226['query']=_['keys'](_0x11787c['query']);_0x327226[_0xfc80('0xd4')]=_['intersection'](_0x327226[_0xfc80('0xd6')],_0x327226['query']);_0x4d124b['attributes']=_[_0xfc80('0xd5')](_0x327226[_0xfc80('0xd6')],qs[_0xfc80('0xd7')](_0x11787c['query'][_0xfc80('0xd7')]));_0x4d124b['attributes']=_0x4d124b['attributes'][_0xfc80('0x4d')]?_0x4d124b['attributes']:_0x327226[_0xfc80('0xd6')];_0x4d124b[_0xfc80('0xd8')]=qs[_0xfc80('0xd9')](_0x11787c[_0xfc80('0x43')][_0xfc80('0xd9')]);_0x4d124b['where']=qs[_0xfc80('0xd4')](_[_0xfc80('0xdb')](_0x11787c[_0xfc80('0x43')],_0x327226[_0xfc80('0xd4')]));if(_0x11787c[_0xfc80('0x43')][_0xfc80('0x33')]){_0x4d124b[_0xfc80('0xda')]=_[_0xfc80('0xdc')](_0x4d124b[_0xfc80('0xda')],{'$or':_[_0xfc80('0x34')](_0x4d124b[_0xfc80('0x49')],function(_0xa26af0){var _0x52708e={};_0x52708e[_0xa26af0]={'$like':'%'+_0x11787c[_0xfc80('0x43')][_0xfc80('0x33')]+'%'};return _0x52708e;})});}_0x4d124b=_[_0xfc80('0xdc')]({},_0x4d124b,_0x11787c[_0xfc80('0x59')]);return _0x2984be[_0xfc80('0x124')](_0x4d124b);}})[_0xfc80('0x29')](function(_0x5b6e61){if(_0x5b6e61){_0x367fb0=_0x5b6e61['length'];if(!_0x11787c[_0xfc80('0x43')][_0xfc80('0xcb')](_0xfc80('0xe4'))){_0x4d124b[_0xfc80('0x1a')]=qs[_0xfc80('0x1a')](_0x11787c[_0xfc80('0x43')][_0xfc80('0x1a')]);_0x4d124b[_0xfc80('0x1c')]=qs['offset'](_0x11787c['query'][_0xfc80('0x1c')]);}return _0x2984be[_0xfc80('0x124')](_0x4d124b);}})[_0xfc80('0x29')](function(_0x48f98b){if(_0x48f98b){return _0x48f98b?{'count':_0x367fb0,'rows':_0x48f98b}:null;}})[_0xfc80('0x29')](respondWithResult(_0x5a3d15,null))[_0xfc80('0x56')](handleError(_0x5a3d15,null));};exports[_0xfc80('0x125')]=function(_0x251c77,_0x2d79d7){var _0x2226a6={};var _0x57264d={};var _0x3f5ef9;return db[_0xfc80('0x4a')][_0xfc80('0x98')]({'where':{'id':_0x251c77[_0xfc80('0x58')]['id']}})['then'](handleEntityNotFound(_0x2d79d7,null))[_0xfc80('0x29')](function(_0x58c163){if(_0x58c163){_0x3f5ef9=_0x58c163;_0x57264d[_0xfc80('0xd6')]=_['keys'](db[_0xfc80('0x4a')][_0xfc80('0xde')]);_0x57264d[_0xfc80('0x43')]=_[_0xfc80('0xd2')](_0x251c77['query']);_0x57264d[_0xfc80('0xd4')]=_['intersection'](_0x57264d[_0xfc80('0xd6')],_0x57264d['query']);_0x2226a6[_0xfc80('0x49')]=_[_0xfc80('0xd5')](_0x57264d[_0xfc80('0xd6')],qs['fields'](_0x251c77[_0xfc80('0x43')][_0xfc80('0xd7')]));_0x2226a6[_0xfc80('0x49')]=_0x2226a6['attributes'][_0xfc80('0x4d')]?_0x2226a6[_0xfc80('0x49')]:_0x57264d[_0xfc80('0xd6')];_0x2226a6[_0xfc80('0xd8')]=qs[_0xfc80('0xd9')](_0x251c77[_0xfc80('0x43')]['sort']);_0x2226a6[_0xfc80('0xda')]=qs[_0xfc80('0xd4')](_[_0xfc80('0xdb')](_0x251c77['query'],_0x57264d[_0xfc80('0xd4')]));if(_0x251c77['query'][_0xfc80('0x33')]){_0x2226a6[_0xfc80('0xda')]=_[_0xfc80('0xdc')](_0x2226a6['where'],{'$or':_['map'](_0x2226a6['attributes'],function(_0x8ee9d6){var _0x3fe4bb={};_0x3fe4bb[_0x8ee9d6]={'$like':'%'+_0x251c77[_0xfc80('0x43')]['filter']+'%'};return _0x3fe4bb;})});}_0x2226a6['model']=db['User'];_0x2226a6['as']='Agents';_0x2226a6=_[_0xfc80('0xdc')]({},_0x2226a6,_0x251c77[_0xfc80('0x59')]);return _0x3f5ef9[_0xfc80('0xfa')]({'include':[_0x2226a6]});}})['then'](function(_0x416c04){if(_0x416c04){var _0xdf99cb={},_0x503c7e=[];for(var _0x52648a=0x0;_0x52648a<_0x416c04[_0xfc80('0x4d')];_0x52648a+=0x1){for(var _0x55cccc=0x0,_0x43bf2b;_0x55cccc<_0x416c04[_0x52648a][_0xfc80('0x30')][_0xfc80('0x4d')];_0x55cccc+=0x1){_0x43bf2b=_0x416c04[_0x52648a]['Agents'][_0x55cccc][_0xfc80('0xae')]({'plain':!![]});_0xdf99cb[_0x43bf2b['id']]=_0x43bf2b;}}_0xdf99cb=_[_0xfc80('0x126')](_0xdf99cb);for(var _0xb12453=qs[_0xfc80('0x1c')](_0x251c77[_0xfc80('0x43')][_0xfc80('0x1c')]);_0xb12453<_0xdf99cb[_0xfc80('0x4d')]&&_0x503c7e['length']=_0x3d37de['agents']){throw new Error(_0x55c8('0x4f'));}})[_0x55c8('0x15')](function(){if(_0x14080d){return db[_0x55c8('0x26')]['destroy']({'where':{'membername':_0x14080d[_0x55c8('0x32')]},'individualHooks':!![]});}})[_0x55c8('0x15')](function(){if(_0x14080d){return _0x14080d['getVoiceQueues']({'raw':!![]});}})[_0x55c8('0x15')](function(_0x504cbb){if(_0x14080d){if(_0x504cbb){var _0x4adeff=[];_0x1c3a9b=_0x504cbb;if(_0x1c3a9b[_0x55c8('0x2a')]){for(var _0x31b1ea=0x0;_0x31b1ea<_0x1c3a9b[_0x55c8('0x2a')];_0x31b1ea++){_0x4adeff[_0x55c8('0x2f')](db[_0x55c8('0x26')][_0x55c8('0x50')]({'membername':_0x14080d[_0x55c8('0x32')],'UserId':_0x14080d['id'],'queue_name':_0x1c3a9b[_0x31b1ea]['name'],'VoiceQueueId':_0x1c3a9b[_0x31b1ea]['id'],'interface':_0x162315,'paused':_0x14080d[_0x55c8('0x4b')]||![],'penalty':_0x1c3a9b[_0x31b1ea][_0x55c8('0x51')]||0x0}));}return BPromise[_0x55c8('0x47')](_0x4adeff);}}}})[_0x55c8('0x15')](function(){if(_0x14080d){return db[_0x55c8('0x28')][_0x55c8('0xd')]({'where':{'membername':_0x14080d['name'],'exitAt':null}});}})[_0x55c8('0x15')](function(_0x1dd0c9){if(_0x14080d){if(_0x1dd0c9&&_0x1dd0c9[_0x55c8('0x2a')]){var _0x3d2b07=[];_0x1dd0c9['forEach'](function(_0x53a0ee){_0x3d2b07['push'](_0x53a0ee[_0x55c8('0x27')]({'exitAt':moment()['format'](_0x55c8('0x2b'))}));});return BPromise[_0x55c8('0x47')](_0x3d2b07);}}})[_0x55c8('0x15')](function(){if(_0x14080d){var _0x4ba4b4=[];var _0x14a3e1=[];var _0x56e777=utils[_0x55c8('0x2d')]();var _0x1ddb19={'membername':_0x14080d['name'],'interface':_0x162315,'enterAt':moment()[_0x55c8('0x23')](_0x55c8('0x2b')),'role':_0x14080d[_0x55c8('0x20')],'internal':_0x14080d['internal']};_0x56e777[_0x55c8('0x2e')](function(_0x4e9ca4){_0x4ba4b4[_0x55c8('0x2f')](_['merge']({'channel':_0x4e9ca4,'type':_0x55c8('0x52'),'data1':_0x55c8('0x53'),'data2':_0x162315},_0x1ddb19));if(_0x14080d[_0x55c8('0x4b')]){_0x14a3e1[_0x55c8('0x2f')](_[_0x55c8('0x54')]({'channel':_0x4e9ca4,'type':'PAUSE','data1':_0x55c8('0x55')},_0x1ddb19));}});return db['MemberReport'][_0x55c8('0x36')](_0x4ba4b4[_0x55c8('0x56')](_0x14a3e1),{'individualHooks':!![]});}})[_0x55c8('0x15')](function(){if(_0x14080d){return _0x14080d[_0x55c8('0x27')]({'online':!![],'lastLoginAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x14080d[_0x55c8('0x4b')]||![],'mailPause':_0x14080d[_0x55c8('0x4b')]||![],'chatPause':_0x14080d[_0x55c8('0x4b')]||![],'faxPause':_0x14080d[_0x55c8('0x4b')]||![],'smsPause':_0x14080d[_0x55c8('0x4b')]||![],'openchannelPause':_0x14080d[_0x55c8('0x4b')]||![],'pauseType':_0x14080d[_0x55c8('0x4b')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0x55c8('0x23')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x162315});}})[_0x55c8('0x15')](function(_0x2b7332){_0x103757(_0x2b7332);})[_0x55c8('0x1d')](function(_0x5000ad){_0x50d1e7(_0x30da63[_0x55c8('0x19')](0x1f4,_0x5000ad['message']));});});}; \ No newline at end of file +var _0xdb93=['unpause','system','LogoutUser','User','push','all','LoginUser','mobile','phone','loginInPause','count','agent','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','upsert','UserVoiceQueue.penalty','getChannels','LOGIN','callysquare','merge','LOGININPAUSE','concat','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','localhost','socket.io-emitter','./user.socket','findAll','options','attributes','limit','include','map','model','then','info','GetUser','debug','stringify','catch','error','message','ShowUser','find','raw','where','PauseUser','name','role','interface','format','User\x20with\x20id\x20%s\x20not\x20found','params','UserVoiceQueueRt','update','MemberReport','PAUSE','length','YYYY-MM-DD\x20HH:mm:ss','forEach','isNil','body','type','internal','uniqueid','bulkCreate','DEFAULT\x20PAUSE','UnpauseUser','resolve','channel','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','findOne','online','voicePause','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsappPause','pauseType','lastPauseAt'];(function(_0x24f4eb,_0x14bf28){var _0x370498=function(_0x33f1fa){while(--_0x33f1fa){_0x24f4eb['push'](_0x24f4eb['shift']());}};_0x370498(++_0x14bf28);}(_0xdb93,0xcf));var _0x3db9=function(_0xf0d35,_0xce9c1c){_0xf0d35=_0xf0d35-0x0;var _0x5ba3bc=_0xdb93[_0xf0d35];return _0x5ba3bc;};'use strict';var _=require(_0x3db9('0x0'));var util=require(_0x3db9('0x1'));var moment=require(_0x3db9('0x2'));var BPromise=require(_0x3db9('0x3'));var Redis=require('ioredis');var db=require(_0x3db9('0x4'))['db'];var utils=require(_0x3db9('0x5'));var logger=require(_0x3db9('0x6'))(_0x3db9('0x7'));var config=require(_0x3db9('0x8'));config[_0x3db9('0x9')]=_['defaults'](config[_0x3db9('0x9')],{'host':_0x3db9('0xa'),'port':0x18eb});var socket=require(_0x3db9('0xb'))(new Redis(config[_0x3db9('0x9')]));require(_0x3db9('0xc'))['register'](socket);exports['GetUser']=function(_0x18db6f){var _0x821919=this;return new Promise(function(_0x55eeb0,_0x1aec0e){return db['User'][_0x3db9('0xd')]({'raw':_0x18db6f[_0x3db9('0xe')]?_0x18db6f[_0x3db9('0xe')]['raw']===undefined?!![]:![]:!![],'where':_0x18db6f[_0x3db9('0xe')]?_0x18db6f['options']['where']||null:null,'attributes':_0x18db6f[_0x3db9('0xe')]?_0x18db6f[_0x3db9('0xe')][_0x3db9('0xf')]||null:null,'limit':_0x18db6f[_0x3db9('0xe')]?_0x18db6f['options'][_0x3db9('0x10')]||null:null,'include':_0x18db6f[_0x3db9('0xe')]?_0x18db6f[_0x3db9('0xe')][_0x3db9('0x11')]?_[_0x3db9('0x12')](_0x18db6f[_0x3db9('0xe')][_0x3db9('0x11')],function(_0x1cebe2){return{'model':db[_0x1cebe2['model']],'as':_0x1cebe2['as'],'attributes':_0x1cebe2['attributes'],'include':_0x1cebe2[_0x3db9('0x11')]?_[_0x3db9('0x12')](_0x1cebe2[_0x3db9('0x11')],function(_0x5f16bf){return{'model':db[_0x5f16bf[_0x3db9('0x13')]],'as':_0x5f16bf['as'],'attributes':_0x5f16bf[_0x3db9('0xf')],'include':_0x5f16bf[_0x3db9('0x11')]?_['map'](_0x5f16bf['include'],function(_0x30db7a){return{'model':db[_0x30db7a[_0x3db9('0x13')]],'as':_0x30db7a['as'],'attributes':_0x30db7a[_0x3db9('0xf')]};}):[]};}):[]};}):[]:[]})[_0x3db9('0x14')](function(_0x48f323){logger[_0x3db9('0x15')](_0x3db9('0x16'),_0x18db6f);logger[_0x3db9('0x17')](_0x3db9('0x16'),_0x18db6f,JSON[_0x3db9('0x18')](_0x48f323));_0x55eeb0(_0x48f323);})[_0x3db9('0x19')](function(_0x464b27){logger[_0x3db9('0x1a')](_0x3db9('0x16'),_0x464b27['message'],_0x18db6f);_0x1aec0e(_0x821919[_0x3db9('0x1a')](0x1f4,_0x464b27[_0x3db9('0x1b')]));});});};exports[_0x3db9('0x1c')]=function(_0x2d1e56){var _0x2f003a=this;return new Promise(function(_0x404eb7,_0x1da939){return db['User'][_0x3db9('0x1d')]({'raw':_0x2d1e56[_0x3db9('0xe')]?_0x2d1e56[_0x3db9('0xe')][_0x3db9('0x1e')]===undefined?!![]:![]:!![],'where':_0x2d1e56[_0x3db9('0xe')]?_0x2d1e56[_0x3db9('0xe')][_0x3db9('0x1f')]||null:null,'attributes':_0x2d1e56[_0x3db9('0xe')]?_0x2d1e56[_0x3db9('0xe')][_0x3db9('0xf')]||null:null,'include':_0x2d1e56[_0x3db9('0xe')]?_0x2d1e56[_0x3db9('0xe')]['include']?_[_0x3db9('0x12')](_0x2d1e56[_0x3db9('0xe')][_0x3db9('0x11')],function(_0x4f06b9){return{'model':db[_0x4f06b9['model']],'as':_0x4f06b9['as'],'attributes':_0x4f06b9[_0x3db9('0xf')],'include':_0x4f06b9[_0x3db9('0x11')]?_[_0x3db9('0x12')](_0x4f06b9[_0x3db9('0x11')],function(_0x3ed845){return{'model':db[_0x3ed845[_0x3db9('0x13')]],'as':_0x3ed845['as'],'attributes':_0x3ed845[_0x3db9('0xf')],'include':_0x3ed845['include']?_[_0x3db9('0x12')](_0x3ed845[_0x3db9('0x11')],function(_0xe3f4bd){return{'model':db[_0xe3f4bd[_0x3db9('0x13')]],'as':_0xe3f4bd['as'],'attributes':_0xe3f4bd[_0x3db9('0xf')]};}):[]};}):[]};}):[]:[]})[_0x3db9('0x14')](function(_0x36bfc2){logger[_0x3db9('0x15')](_0x3db9('0x1c'),_0x2d1e56);logger[_0x3db9('0x17')](_0x3db9('0x1c'),_0x2d1e56,JSON[_0x3db9('0x18')](_0x36bfc2));_0x404eb7(_0x36bfc2);})[_0x3db9('0x19')](function(_0x4eaed2){logger[_0x3db9('0x1a')](_0x3db9('0x1c'),_0x4eaed2[_0x3db9('0x1b')],_0x2d1e56);_0x1da939(_0x2f003a['error'](0x1f4,_0x4eaed2['message']));});});};exports[_0x3db9('0x20')]=function(_0x2adb37){var _0x25b7c1;return db['User']['find']({'where':_0x2adb37[_0x3db9('0xe')]['where']||{},'attributes':['id',_0x3db9('0x21'),_0x3db9('0x22'),'internal',_0x3db9('0x23')]})[_0x3db9('0x14')](function(_0x57315a){if(!_0x57315a){throw new Error(util[_0x3db9('0x24')](_0x3db9('0x25'),_0x2adb37[_0x3db9('0x26')]['id']));}_0x25b7c1=_0x57315a;return db[_0x3db9('0x27')][_0x3db9('0x28')]({'paused':0x1},{'where':{'UserId':_0x25b7c1['id']},'individualHooks':!![]});})['then'](function(){return db[_0x3db9('0x29')][_0x3db9('0xd')]({'where':{'membername':_0x25b7c1['name'],'type':_0x3db9('0x2a'),'exitAt':null}});})[_0x3db9('0x14')](function(_0x12843e){if(_0x12843e&&_0x12843e[_0x3db9('0x2b')]){var _0x47eab9=moment()['format'](_0x3db9('0x2c'));for(var _0xb35962=0x0,_0x49e6b7=_0x12843e[_0x3db9('0x2b')];_0xb35962<_0x49e6b7;_0xb35962++){_0x12843e[_0xb35962]['updateAttributes']({'exitAt':_0x47eab9});}}})['then'](function(){var _0x33d8cc=[];var _0x1d9d26=utils['getChannels']();_0x1d9d26[_0x3db9('0x2d')](function(_0x537346){_0x33d8cc['push']({'channel':_0x537346,'membername':_0x25b7c1[_0x3db9('0x21')],'interface':_[_0x3db9('0x2e')](_0x25b7c1['interface'])?util[_0x3db9('0x24')]('SIP/%s',_0x25b7c1[_0x3db9('0x21')]):_0x25b7c1[_0x3db9('0x23')],'type':'PAUSE','enterAt':moment()[_0x3db9('0x24')](_0x3db9('0x2c')),'data1':_0x2adb37[_0x3db9('0x2f')][_0x3db9('0x30')]||'DEFAULT\x20PAUSE','role':_0x25b7c1[_0x3db9('0x22')],'internal':_0x25b7c1[_0x3db9('0x31')],'uniqueid':_0x2adb37['body'][_0x3db9('0x32')]||null});});return db[_0x3db9('0x29')][_0x3db9('0x33')](_0x33d8cc,{'individualHooks':!![]});})[_0x3db9('0x14')](function(){return _0x25b7c1[_0x3db9('0x28')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x2adb37[_0x3db9('0x2f')][_0x3db9('0x30')]||_0x3db9('0x34'),'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})[_0x3db9('0x19')](function(_0x3a97f5){throw _0x3a97f5;});};exports[_0x3db9('0x35')]=function(_0x28ab61){return Promise[_0x3db9('0x36')]()[_0x3db9('0x14')](function(){if(_0x28ab61[_0x3db9('0x2f')][_0x3db9('0x37')]&&!utils[_0x3db9('0x38')](_0x28ab61['body'][_0x3db9('0x37')])){throw new Error(util[_0x3db9('0x24')](_0x3db9('0x39'),_0x28ab61['body'][_0x3db9('0x37')]));}return db['User'][_0x3db9('0x3a')]({'where':_0x28ab61[_0x3db9('0xe')][_0x3db9('0x1f')]||{},'attributes':['id',_0x3db9('0x21'),_0x3db9('0x22'),_0x3db9('0x31'),_0x3db9('0x23'),_0x3db9('0x3b'),_0x3db9('0x3c'),_0x3db9('0x3d'),_0x3db9('0x3e'),_0x3db9('0x3f'),_0x3db9('0x40'),_0x3db9('0x41'),_0x3db9('0x42'),_0x3db9('0x43'),_0x3db9('0x44')]});})[_0x3db9('0x14')](function(_0x835e6f){if(!_0x835e6f){throw new Error(util[_0x3db9('0x24')]('User\x20with\x20id\x20%s\x20not\x20found',_0x28ab61[_0x3db9('0x26')]['id']));}return _0x835e6f[_0x3db9('0x45')](_0x28ab61['body'][_0x3db9('0x37')],_0x3db9('0x46'));})[_0x3db9('0x19')](function(_0x43040d){throw _0x43040d;});};exports[_0x3db9('0x47')]=function(_0x49d042){var _0x38dfd0=this;return new Promise(function(_0x449564,_0x543b6d){var _0x26e06e;return db[_0x3db9('0x48')]['findOne']({'where':_0x49d042[_0x3db9('0xe')][_0x3db9('0x1f')]||{},'attributes':['id','name']})[_0x3db9('0x14')](function(_0x1a861e){if(_0x1a861e){_0x26e06e=_0x1a861e;return db[_0x3db9('0x27')]['destroy']({'where':{'membername':_0x26e06e[_0x3db9('0x21')]},'individualHooks':!![]});}})[_0x3db9('0x14')](function(){if(_0x26e06e){return db[_0x3db9('0x29')][_0x3db9('0xd')]({'where':{'membername':_0x26e06e[_0x3db9('0x21')],'exitAt':null}});}})[_0x3db9('0x14')](function(_0x58a9ca){if(_0x26e06e){if(_0x58a9ca&&_0x58a9ca[_0x3db9('0x2b')]){var _0x433d81=[];_0x58a9ca['forEach'](function(_0x332ef3){_0x433d81[_0x3db9('0x49')](_0x332ef3['update']({'exitAt':moment()[_0x3db9('0x24')](_0x3db9('0x2c'))}));});return BPromise[_0x3db9('0x4a')](_0x433d81);}}})['then'](function(){if(_0x26e06e){return _0x26e06e['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0x3a1315){_0x449564(_0x3a1315);})[_0x3db9('0x19')](function(_0x4d73ce){_0x543b6d(_0x38dfd0[_0x3db9('0x1a')](0x1f4,_0x4d73ce[_0x3db9('0x1b')]));});});};exports[_0x3db9('0x4b')]=function(_0x37f925){var _0x567088=this;return new Promise(function(_0x3c944b,_0x44ec67){var _0x4c4cf2;var _0x14d68c;var _0x13c91c;var _0x3c2720;return db['User']['findOne']({'where':_0x37f925['options'][_0x3db9('0x1f')]||{},'attributes':['id',_0x3db9('0x21'),_0x3db9('0x22'),_0x3db9('0x4c'),_0x3db9('0x4d'),'internal',_0x3db9('0x4e'),_0x3db9('0x23')]})[_0x3db9('0x14')](function(_0x1ed0c0){if(_0x1ed0c0){_0x4c4cf2=_0x1ed0c0;_0x3c2720=_0x37f925[_0x3db9('0x2f')]['interface']?_0x37f925[_0x3db9('0x2f')][_0x3db9('0x23')]:util[_0x3db9('0x24')]('SIP/%s',_0x4c4cf2['name']);return db['User'][_0x3db9('0x4f')]({'where':{'role':_0x3db9('0x50'),'online':!![],'id':{'$ne':_0x4c4cf2['id']}}});}})[_0x3db9('0x14')](function(_0x1b425f){if(_0x1b425f){_0x13c91c=_0x1b425f;return require('../../config/license/util')[_0x3db9('0x51')]();}})[_0x3db9('0x14')](function(_0x489a0b){if(_0x489a0b&&_0x489a0b[_0x3db9('0x52')]&&_0x13c91c>=_0x489a0b[_0x3db9('0x52')]){throw new Error(_0x3db9('0x53'));}})[_0x3db9('0x14')](function(){if(_0x4c4cf2){return db[_0x3db9('0x27')]['destroy']({'where':{'membername':_0x4c4cf2[_0x3db9('0x21')]},'individualHooks':!![]});}})[_0x3db9('0x14')](function(){if(_0x4c4cf2){return _0x4c4cf2['getVoiceQueues']({'raw':!![]});}})['then'](function(_0x2f631c){if(_0x4c4cf2){if(_0x2f631c){var _0x70d675=[];_0x14d68c=_0x2f631c;if(_0x14d68c['length']){for(var _0x4c505b=0x0;_0x4c505b<_0x14d68c[_0x3db9('0x2b')];_0x4c505b++){_0x70d675[_0x3db9('0x49')](db[_0x3db9('0x27')][_0x3db9('0x54')]({'membername':_0x4c4cf2[_0x3db9('0x21')],'UserId':_0x4c4cf2['id'],'queue_name':_0x14d68c[_0x4c505b][_0x3db9('0x21')],'VoiceQueueId':_0x14d68c[_0x4c505b]['id'],'interface':_0x3c2720,'paused':_0x4c4cf2[_0x3db9('0x4e')]||![],'penalty':_0x14d68c[_0x4c505b][_0x3db9('0x55')]||0x0}));}return BPromise['all'](_0x70d675);}}}})[_0x3db9('0x14')](function(){if(_0x4c4cf2){return db[_0x3db9('0x29')][_0x3db9('0xd')]({'where':{'membername':_0x4c4cf2[_0x3db9('0x21')],'exitAt':null}});}})[_0x3db9('0x14')](function(_0x1410c2){if(_0x4c4cf2){if(_0x1410c2&&_0x1410c2[_0x3db9('0x2b')]){var _0x3a59a6=[];_0x1410c2[_0x3db9('0x2d')](function(_0x383515){_0x3a59a6['push'](_0x383515[_0x3db9('0x28')]({'exitAt':moment()[_0x3db9('0x24')](_0x3db9('0x2c'))}));});return BPromise['all'](_0x3a59a6);}}})['then'](function(){if(_0x4c4cf2){var _0x5db6ef=[];var _0xc2f61e=[];var _0x2ca18a=utils[_0x3db9('0x56')]();var _0x147775={'membername':_0x4c4cf2[_0x3db9('0x21')],'interface':_0x3c2720,'enterAt':moment()[_0x3db9('0x24')](_0x3db9('0x2c')),'role':_0x4c4cf2['role'],'internal':_0x4c4cf2[_0x3db9('0x31')]};_0x2ca18a[_0x3db9('0x2d')](function(_0x1f493c){_0x5db6ef[_0x3db9('0x49')](_['merge']({'channel':_0x1f493c,'type':_0x3db9('0x57'),'data1':_0x3db9('0x58'),'data2':_0x3c2720},_0x147775));if(_0x4c4cf2[_0x3db9('0x4e')]){_0xc2f61e[_0x3db9('0x49')](_[_0x3db9('0x59')]({'channel':_0x1f493c,'type':_0x3db9('0x2a'),'data1':_0x3db9('0x5a')},_0x147775));}});return db['MemberReport'][_0x3db9('0x33')](_0x5db6ef[_0x3db9('0x5b')](_0xc2f61e),{'individualHooks':!![]});}})[_0x3db9('0x14')](function(){if(_0x4c4cf2){return _0x4c4cf2['update']({'online':!![],'lastLoginAt':moment()[_0x3db9('0x24')](_0x3db9('0x2c')),'voicePause':_0x4c4cf2['loginInPause']||![],'mailPause':_0x4c4cf2[_0x3db9('0x4e')]||![],'chatPause':_0x4c4cf2[_0x3db9('0x4e')]||![],'faxPause':_0x4c4cf2[_0x3db9('0x4e')]||![],'smsPause':_0x4c4cf2[_0x3db9('0x4e')]||![],'openchannelPause':_0x4c4cf2['loginInPause']||![],'pauseType':_0x4c4cf2[_0x3db9('0x4e')]?_0x3db9('0x5a'):null,'lastPauseAt':moment()[_0x3db9('0x24')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x3c2720});}})['then'](function(_0x681cf9){_0x3c944b(_0x681cf9);})[_0x3db9('0x19')](function(_0xadd713){_0x44ec67(_0x567088[_0x3db9('0x1a')](0x1f4,_0xadd713['message']));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index f5bc0d0..46bfe8f 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 _0xf9c5=['remove','update','emit','removeListener','register','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf9c5,0xd2));var _0x5f9c=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0xf9c5[_0x263a74];return _0x2aa86c;};'use strict';var UserEvents=require('./user.events');var events=['save',_0x5f9c('0x0'),_0x5f9c('0x1')];function createListener(_0x3aad45,_0x3978d9){return function(_0x46526c){_0x3978d9[_0x5f9c('0x2')](_0x3aad45,_0x46526c);};}function removeListener(_0x28d2a4,_0xb502e4){return function(){UserEvents[_0x5f9c('0x3')](_0x28d2a4,_0xb502e4);};}exports[_0x5f9c('0x4')]=function(_0x57281c){for(var _0x430c39=0x0,_0x164664=events[_0x5f9c('0x5')];_0x430c39<_0x164664;_0x430c39++){var _0x8fe138=events[_0x430c39];var _0x25320d=createListener('user:'+_0x8fe138,_0x57281c);UserEvents['on'](_0x8fe138,_0x25320d);}}; \ No newline at end of file +var _0x9e1f=['emit','removeListener','length','user:','./user.events','save','remove','update'];(function(_0x155477,_0x466414){var _0xaf1051=function(_0x1ab88f){while(--_0x1ab88f){_0x155477['push'](_0x155477['shift']());}};_0xaf1051(++_0x466414);}(_0x9e1f,0x14c));var _0xf9e1=function(_0x4cde0a,_0x2d1444){_0x4cde0a=_0x4cde0a-0x0;var _0x33a5e3=_0x9e1f[_0x4cde0a];return _0x33a5e3;};'use strict';var UserEvents=require(_0xf9e1('0x0'));var events=[_0xf9e1('0x1'),_0xf9e1('0x2'),_0xf9e1('0x3')];function createListener(_0x42fcfa,_0x3ea72b){return function(_0x2d3036){_0x3ea72b[_0xf9e1('0x4')](_0x42fcfa,_0x2d3036);};}function removeListener(_0x59e202,_0x32085a){return function(){UserEvents[_0xf9e1('0x5')](_0x59e202,_0x32085a);};}exports['register']=function(_0x5e79b5){for(var _0x5d45b5=0x0,_0x510a8f=events[_0xf9e1('0x6')];_0x5d45b5<_0x510a8f;_0x5d45b5++){var _0xb402af=events[_0x5d45b5];var _0x4e381c=createListener(_0xf9e1('0x7')+_0xb402af,_0x5e79b5);UserEvents['on'](_0xb402af,_0x4e381c);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 87f3714..8e69dad 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x5d5e54,_0x3fa968){var _0x11c12a=function(_0x3e4936){while(--_0x3e4936){_0x5d5e54['push'](_0x5d5e54['shift']());}};_0x11c12a(++_0x3fa968);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x122d9f,_0x2c9e5b){_0x122d9f=_0x122d9f-0x0;var _0x41a09e=_0xcb91[_0x122d9f];return _0x41a09e;};'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(_0x483227,_0x4531da){var _0x2f414a=function(_0x31eebd){while(--_0x31eebd){_0x483227['push'](_0x483227['shift']());}};_0x2f414a(++_0x4531da);}(_0xe706,0xa3));var _0x6e70=function(_0x2c1dcd,_0x350452){_0x2c1dcd=_0x2c1dcd-0x0;var _0x158ce5=_0xe706[_0x2c1dcd];return _0x158ce5;};'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 64e0573..b87d291 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 _0xf849=['INTEGER','sequelize','exports'];(function(_0x375c4f,_0x395edd){var _0x49699e=function(_0x3d5648){while(--_0x3d5648){_0x375c4f['push'](_0x375c4f['shift']());}};_0x49699e(++_0x395edd);}(_0xf849,0x193));var _0x9f84=function(_0x1aebfe,_0xb00c5b){_0x1aebfe=_0x1aebfe-0x0;var _0x3f0f9b=_0xf849[_0x1aebfe];return _0x3f0f9b;};'use strict';var Sequelize=require(_0x9f84('0x0'));module[_0x9f84('0x1')]={'penalty':{'type':Sequelize[_0x9f84('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x02d8=['INTEGER','sequelize','exports'];(function(_0x4b4dad,_0x1edae3){var _0x11f09f=function(_0x57c9db){while(--_0x57c9db){_0x4b4dad['push'](_0x4b4dad['shift']());}};_0x11f09f(++_0x1edae3);}(_0x02d8,0x1e4));var _0x802d=function(_0x54300a,_0x5cf0bd){_0x54300a=_0x54300a-0x0;var _0x4f4436=_0x02d8[_0x54300a];return _0x4f4436;};'use strict';var Sequelize=require(_0x802d('0x0'));module[_0x802d('0x1')]={'penalty':{'type':Sequelize[_0x802d('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 5c04ca5..11a00d3 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 _0x1fd0=['request-promise','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1fd0,0xa1));var _0x01fd=function(_0x4a8418,_0x39078a){_0x4a8418=_0x4a8418-0x0;var _0x390174=_0x1fd0[_0x4a8418];return _0x390174;};'use strict';var _=require(_0x01fd('0x0'));var util=require(_0x01fd('0x1'));var logger=require(_0x01fd('0x2'))('api');var moment=require('moment');var BPromise=require(_0x01fd('0x3'));var rp=require(_0x01fd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x01fd('0x5'));var attributes=require(_0x01fd('0x6'));module[_0x01fd('0x7')]=function(_0x464370,_0x5449cf){return _0x464370[_0x01fd('0x8')](_0x01fd('0x9'),attributes,{'tableName':_0x01fd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0711=['rimraf','../../config/environment','exports','define','UserChatQueue','util','../../config/logger','moment','bluebird','path'];(function(_0x5db1ce,_0x57ab66){var _0xb62cbb=function(_0x33b753){while(--_0x33b753){_0x5db1ce['push'](_0x5db1ce['shift']());}};_0xb62cbb(++_0x57ab66);}(_0x0711,0xb9));var _0x1071=function(_0x479352,_0x2d82af){_0x479352=_0x479352-0x0;var _0x4adad5=_0x0711[_0x479352];return _0x4adad5;};'use strict';var _=require('lodash');var util=require(_0x1071('0x0'));var logger=require(_0x1071('0x1'))('api');var moment=require(_0x1071('0x2'));var BPromise=require(_0x1071('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1071('0x4'));var rimraf=require(_0x1071('0x5'));var config=require(_0x1071('0x6'));var attributes=require('./userChatQueue.attributes');module[_0x1071('0x7')]=function(_0x3cae97,_0x3d3a77){return _0x3cae97[_0x1071('0x8')](_0x1071('0x9'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index d9757f2..eb78918 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 _0x64d0=['UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x39b224,_0x448167){var _0x32413d=function(_0x20ef71){while(--_0x20ef71){_0x39b224['push'](_0x39b224['shift']());}};_0x32413d(++_0x448167);}(_0x64d0,0x194));var _0x064d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x64d0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x064d('0x0'));var util=require('util');var moment=require(_0x064d('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x064d('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x064d('0x3'));var logger=require(_0x064d('0x4'))('rpc');var config=require(_0x064d('0x5'));var jayson=require(_0x064d('0x6'));var client=jayson[_0x064d('0x7')][_0x064d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5df53a,_0x3ffb80,_0xa91389){return new BPromise(function(_0x33ce95,_0x4863b0){return client[_0x064d('0x9')](_0x5df53a,_0xa91389)[_0x064d('0xa')](function(_0x1e757b){logger[_0x064d('0xb')](_0x064d('0xc'),_0x3ffb80,_0x064d('0xd'));logger['debug'](_0x064d('0xe'),_0x3ffb80,_0x064d('0xd'),JSON[_0x064d('0xf')](_0x1e757b));if(_0x1e757b[_0x064d('0x10')]){if(_0x1e757b['error'][_0x064d('0x11')]===0x1f4){logger[_0x064d('0x10')](_0x064d('0xc'),_0x3ffb80,_0x1e757b['error']['message']);return _0x4863b0(_0x1e757b[_0x064d('0x10')][_0x064d('0x12')]);}logger[_0x064d('0x10')](_0x064d('0xc'),_0x3ffb80,_0x1e757b[_0x064d('0x10')][_0x064d('0x12')]);return _0x33ce95(_0x1e757b[_0x064d('0x10')][_0x064d('0x12')]);}else{logger[_0x064d('0xb')](_0x064d('0xc'),_0x3ffb80,'request\x20sent');_0x33ce95(_0x1e757b['result'][_0x064d('0x12')]);}})['catch'](function(_0x333fe7){logger[_0x064d('0x10')]('UserChatQueue,\x20%s,\x20%s',_0x3ffb80,_0x333fe7);_0x4863b0(_0x333fe7);});});} \ No newline at end of file +var _0xf893=['info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x5011f6,_0x44401a){var _0x177c13=function(_0x500ef6){while(--_0x500ef6){_0x5011f6['push'](_0x5011f6['shift']());}};_0x177c13(++_0x44401a);}(_0xf893,0xc6));var _0x3f89=function(_0x48dae8,_0x516087){_0x48dae8=_0x48dae8-0x0;var _0x10ef93=_0xf893[_0x48dae8];return _0x10ef93;};'use strict';var _=require(_0x3f89('0x0'));var util=require(_0x3f89('0x1'));var moment=require(_0x3f89('0x2'));var BPromise=require(_0x3f89('0x3'));var rs=require(_0x3f89('0x4'));var fs=require('fs');var Redis=require(_0x3f89('0x5'));var db=require(_0x3f89('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3f89('0x7'))(_0x3f89('0x8'));var config=require(_0x3f89('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3f89('0xa')][_0x3f89('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1e864a,_0x237509,_0x39a1d6){return new BPromise(function(_0x67d781,_0x142f08){return client['request'](_0x1e864a,_0x39a1d6)['then'](function(_0x18b956){logger[_0x3f89('0xc')](_0x3f89('0xd'),_0x237509,_0x3f89('0xe'));logger[_0x3f89('0xf')](_0x3f89('0x10'),_0x237509,_0x3f89('0xe'),JSON[_0x3f89('0x11')](_0x18b956));if(_0x18b956[_0x3f89('0x12')]){if(_0x18b956[_0x3f89('0x12')]['code']===0x1f4){logger[_0x3f89('0x12')](_0x3f89('0xd'),_0x237509,_0x18b956[_0x3f89('0x12')][_0x3f89('0x13')]);return _0x142f08(_0x18b956[_0x3f89('0x12')]['message']);}logger[_0x3f89('0x12')](_0x3f89('0xd'),_0x237509,_0x18b956['error'][_0x3f89('0x13')]);return _0x67d781(_0x18b956[_0x3f89('0x12')][_0x3f89('0x13')]);}else{logger[_0x3f89('0xc')](_0x3f89('0xd'),_0x237509,_0x3f89('0xe'));_0x67d781(_0x18b956['result'][_0x3f89('0x13')]);}})[_0x3f89('0x14')](function(_0x2ad626){logger[_0x3f89('0x12')](_0x3f89('0xd'),_0x237509,_0x2ad626);_0x142f08(_0x2ad626);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 9fa60b8..794fe76 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x57977c,_0x5c289e){var _0x45a4fd=function(_0x22aadf){while(--_0x22aadf){_0x57977c['push'](_0x57977c['shift']());}};_0x45a4fd(++_0x5c289e);}(_0xedd9,0xfc));var _0x9edd=function(_0x38b99d,_0x308db5){_0x38b99d=_0x38b99d-0x0;var _0x2d88ca=_0xedd9[_0x38b99d];return _0x2d88ca;};'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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x483e4a,_0x32aa45){var _0x31fba5=function(_0x345bc9){while(--_0x345bc9){_0x483e4a['push'](_0x483e4a['shift']());}};_0x31fba5(++_0x32aa45);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 96dbe9a..522bea6 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 _0x7e91=['exports','INTEGER','STRING','sequelize'];(function(_0x1cdc9e,_0x2f1456){var _0x42f324=function(_0x3a6df2){while(--_0x3a6df2){_0x1cdc9e['push'](_0x1cdc9e['shift']());}};_0x42f324(++_0x2f1456);}(_0x7e91,0xdb));var _0x17e9=function(_0x9b1d71,_0x18e36b){_0x9b1d71=_0x9b1d71-0x0;var _0x50494b=_0x7e91[_0x9b1d71];return _0x50494b;};'use strict';var Sequelize=require(_0x17e9('0x0'));module[_0x17e9('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x17e9('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x17e9('0x3')]}}; \ No newline at end of file +var _0xb23d=['STRING','sequelize','exports','INTEGER'];(function(_0x16916f,_0x1655ee){var _0x536d2a=function(_0x8cdc62){while(--_0x8cdc62){_0x16916f['push'](_0x16916f['shift']());}};_0x536d2a(++_0x1655ee);}(_0xb23d,0x79));var _0xdb23=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xb23d[_0x2d7f0e];return _0x110b07;};'use strict';var Sequelize=require(_0xdb23('0x0'));module[_0xdb23('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xdb23('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xdb23('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 6383d64..668098f 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 _0x335e=['./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x323df4,_0x54e149){var _0x10f27c=function(_0x209fe0){while(--_0x209fe0){_0x323df4['push'](_0x323df4['shift']());}};_0x10f27c(++_0x54e149);}(_0x335e,0x155));var _0xe335=function(_0x4d8d0f,_0x5476a8){_0x4d8d0f=_0x4d8d0f-0x0;var _0x506ecd=_0x335e[_0x4d8d0f];return _0x506ecd;};'use strict';var _=require(_0xe335('0x0'));var util=require(_0xe335('0x1'));var logger=require(_0xe335('0x2'))(_0xe335('0x3'));var moment=require('moment');var BPromise=require(_0xe335('0x4'));var rp=require(_0xe335('0x5'));var fs=require('fs');var path=require(_0xe335('0x6'));var rimraf=require(_0xe335('0x7'));var config=require(_0xe335('0x8'));var attributes=require(_0xe335('0x9'));module[_0xe335('0xa')]=function(_0x12bcf2,_0x1b77b4){return _0x12bcf2[_0xe335('0xb')](_0xe335('0xc'),attributes,{'tableName':_0xe335('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x339c=['lodash','moment','bluebird','request-promise','./userFaxQueue.attributes','define','UserFaxQueue'];(function(_0x8e9007,_0x3a3608){var _0xefcbe7=function(_0x426364){while(--_0x426364){_0x8e9007['push'](_0x8e9007['shift']());}};_0xefcbe7(++_0x3a3608);}(_0x339c,0xa8));var _0xc339=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x339c[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xc339('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xc339('0x1'));var BPromise=require(_0xc339('0x2'));var rp=require(_0xc339('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc339('0x4'));module['exports']=function(_0x2a755e,_0xeb1de5){return _0x2a755e[_0xc339('0x5')](_0xc339('0x6'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index c45c6f7..0748133 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 _0xc6df=['debug','stringify','error','code','message','info','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','UserFaxQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x1551af,_0x5223c3){var _0xd8eb82=function(_0x4b133a){while(--_0x4b133a){_0x1551af['push'](_0x1551af['shift']());}};_0xd8eb82(++_0x5223c3);}(_0xc6df,0xb1));var _0xfc6d=function(_0xb20f17,_0x5e1389){_0xb20f17=_0xb20f17-0x0;var _0x15e1f3=_0xc6df[_0xb20f17];return _0x15e1f3;};'use strict';var _=require(_0xfc6d('0x0'));var util=require(_0xfc6d('0x1'));var moment=require(_0xfc6d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfc6d('0x3'));var db=require(_0xfc6d('0x4'))['db'];var utils=require(_0xfc6d('0x5'));var logger=require(_0xfc6d('0x6'))(_0xfc6d('0x7'));var config=require(_0xfc6d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xfc6d('0x9')][_0xfc6d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e9240,_0x112c4b,_0x5b819c){return new BPromise(function(_0x165324,_0x5a4d84){return client['request'](_0x5e9240,_0x5b819c)['then'](function(_0xea4bf4){logger['info'](_0xfc6d('0xb'),_0x112c4b,_0xfc6d('0xc'));logger[_0xfc6d('0xd')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x112c4b,_0xfc6d('0xc'),JSON[_0xfc6d('0xe')](_0xea4bf4));if(_0xea4bf4[_0xfc6d('0xf')]){if(_0xea4bf4['error'][_0xfc6d('0x10')]===0x1f4){logger[_0xfc6d('0xf')](_0xfc6d('0xb'),_0x112c4b,_0xea4bf4[_0xfc6d('0xf')]['message']);return _0x5a4d84(_0xea4bf4[_0xfc6d('0xf')][_0xfc6d('0x11')]);}logger[_0xfc6d('0xf')](_0xfc6d('0xb'),_0x112c4b,_0xea4bf4[_0xfc6d('0xf')]['message']);return _0x165324(_0xea4bf4[_0xfc6d('0xf')][_0xfc6d('0x11')]);}else{logger[_0xfc6d('0x12')](_0xfc6d('0xb'),_0x112c4b,_0xfc6d('0xc'));_0x165324(_0xea4bf4['result'][_0xfc6d('0x11')]);}})['catch'](function(_0x2feabd){logger[_0xfc6d('0xf')]('UserFaxQueue,\x20%s,\x20%s',_0x112c4b,_0x2feabd);_0x5a4d84(_0x2feabd);});});} \ No newline at end of file +var _0x9dbf=['ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','UserFaxQueue,\x20%s,\x20%s','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','bluebird'];(function(_0x24cf9e,_0x43de5e){var _0x221d86=function(_0x221e39){while(--_0x221e39){_0x24cf9e['push'](_0x24cf9e['shift']());}};_0x221d86(++_0x43de5e);}(_0x9dbf,0x18c));var _0xf9db=function(_0x28dbf1,_0x32eb60){_0x28dbf1=_0x28dbf1-0x0;var _0x523449=_0x9dbf[_0x28dbf1];return _0x523449;};'use strict';var _=require(_0xf9db('0x0'));var util=require(_0xf9db('0x1'));var moment=require('moment');var BPromise=require(_0xf9db('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf9db('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf9db('0x4'))(_0xf9db('0x5'));var config=require(_0xf9db('0x6'));var jayson=require(_0xf9db('0x7'));var client=jayson[_0xf9db('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x156b07,_0x4ab594,_0x479129){return new BPromise(function(_0x13e29a,_0x4e91fa){return client[_0xf9db('0x9')](_0x156b07,_0x479129)['then'](function(_0x318e25){logger[_0xf9db('0xa')](_0xf9db('0xb'),_0x4ab594,'request\x20sent');logger['debug'](_0xf9db('0xc'),_0x4ab594,_0xf9db('0xd'),JSON[_0xf9db('0xe')](_0x318e25));if(_0x318e25[_0xf9db('0xf')]){if(_0x318e25[_0xf9db('0xf')]['code']===0x1f4){logger['error'](_0xf9db('0xb'),_0x4ab594,_0x318e25[_0xf9db('0xf')][_0xf9db('0x10')]);return _0x4e91fa(_0x318e25[_0xf9db('0xf')]['message']);}logger[_0xf9db('0xf')]('UserFaxQueue,\x20%s,\x20%s',_0x4ab594,_0x318e25['error'][_0xf9db('0x10')]);return _0x13e29a(_0x318e25['error'][_0xf9db('0x10')]);}else{logger['info'](_0xf9db('0xb'),_0x4ab594,_0xf9db('0xd'));_0x13e29a(_0x318e25[_0xf9db('0x11')][_0xf9db('0x10')]);}})[_0xf9db('0x12')](function(_0x5bdbc1){logger[_0xf9db('0xf')](_0xf9db('0xb'),_0x4ab594,_0x5bdbc1);_0x4e91fa(_0x5bdbc1);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 64dc9c9..90a7d33 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x283127,_0x54d4d5){var _0x43da5d=function(_0x10947f){while(--_0x10947f){_0x283127['push'](_0x283127['shift']());}};_0x43da5d(++_0x54d4d5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'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(_0xa2d364,_0x1efedb){var _0x2fa762=function(_0x2cc3ae){while(--_0x2cc3ae){_0xa2d364['push'](_0xa2d364['shift']());}};_0x2fa762(++_0x1efedb);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x33080e,_0x1c600a){_0x33080e=_0x33080e-0x0;var _0x407395=_0xcb91[_0x33080e];return _0x407395;};'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/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 5cf4796..bd0d597 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 _0xa9e3=['exports','INTEGER','sequelize'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xa9e3,0x113));var _0x3a9e=function(_0x219d14,_0x4e08c2){_0x219d14=_0x219d14-0x0;var _0x14f51b=_0xa9e3[_0x219d14];return _0x14f51b;};'use strict';var Sequelize=require(_0x3a9e('0x0'));module[_0x3a9e('0x1')]={'penalty':{'type':Sequelize[_0x3a9e('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6cca=['sequelize','exports'];(function(_0xa7c4a7,_0x1a39a2){var _0x4d5e31=function(_0x594859){while(--_0x594859){_0xa7c4a7['push'](_0xa7c4a7['shift']());}};_0x4d5e31(++_0x1a39a2);}(_0x6cca,0x10e));var _0xa6cc=function(_0x57a3f6,_0x5e7507){_0x57a3f6=_0x57a3f6-0x0;var _0x69ab14=_0x6cca[_0x57a3f6];return _0x69ab14;};'use strict';var Sequelize=require(_0xa6cc('0x0'));module[_0xa6cc('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index daaf051..847a944 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 _0xe15e=['user_has_mail_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','UserMailQueue'];(function(_0x3d3baf,_0x40afae){var _0x14f0a9=function(_0x313f1e){while(--_0x313f1e){_0x3d3baf['push'](_0x3d3baf['shift']());}};_0x14f0a9(++_0x40afae);}(_0xe15e,0x19b));var _0xee15=function(_0x832d83,_0x1f48e0){_0x832d83=_0x832d83-0x0;var _0xe505b6=_0xe15e[_0x832d83];return _0xe505b6;};'use strict';var _=require(_0xee15('0x0'));var util=require(_0xee15('0x1'));var logger=require(_0xee15('0x2'))('api');var moment=require(_0xee15('0x3'));var BPromise=require(_0xee15('0x4'));var rp=require(_0xee15('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xee15('0x6'));var config=require(_0xee15('0x7'));var attributes=require('./userMailQueue.attributes');module['exports']=function(_0x222ced,_0x309825){return _0x222ced['define'](_0xee15('0x8'),attributes,{'tableName':_0xee15('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4ebd=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','lodash','../../config/logger','api'];(function(_0x21ef8f,_0x538a41){var _0x587ee9=function(_0x5881b1){while(--_0x5881b1){_0x21ef8f['push'](_0x21ef8f['shift']());}};_0x587ee9(++_0x538a41);}(_0x4ebd,0x1a1));var _0xd4eb=function(_0x324aa3,_0x366772){_0x324aa3=_0x324aa3-0x0;var _0x201115=_0x4ebd[_0x324aa3];return _0x201115;};'use strict';var _=require(_0xd4eb('0x0'));var util=require('util');var logger=require(_0xd4eb('0x1'))(_0xd4eb('0x2'));var moment=require(_0xd4eb('0x3'));var BPromise=require(_0xd4eb('0x4'));var rp=require(_0xd4eb('0x5'));var fs=require('fs');var path=require(_0xd4eb('0x6'));var rimraf=require(_0xd4eb('0x7'));var config=require(_0xd4eb('0x8'));var attributes=require(_0xd4eb('0x9'));module[_0xd4eb('0xa')]=function(_0x661f04,_0x58a738){return _0x661f04[_0xd4eb('0xb')](_0xd4eb('0xc'),attributes,{'tableName':_0xd4eb('0xd'),'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 6505666..a01d19c 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 _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1d6a77,_0x388740){var _0x340589=function(_0x2cdbb9){while(--_0x2cdbb9){_0x1d6a77['push'](_0x1d6a77['shift']());}};_0x340589(++_0x388740);}(_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']('UserMailQueue,\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 _0x3e74=['rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','UserMailQueue,\x20%s,\x20%s','message','info','catch','lodash','moment','bluebird','randomstring','../../config/utils'];(function(_0x2305e1,_0x11ae74){var _0x5e8522=function(_0x475b5e){while(--_0x475b5e){_0x2305e1['push'](_0x2305e1['shift']());}};_0x5e8522(++_0x11ae74);}(_0x3e74,0x175));var _0x43e7=function(_0xc0f735,_0x3b0a2c){_0xc0f735=_0xc0f735-0x0;var _0x495432=_0x3e74[_0xc0f735];return _0x495432;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('UserMailQueue,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('UserMailQueue,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 221c077..2471539 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 _0x37ab=['path','connect-timeout','../../components/auth/service','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','multer'];(function(_0x114008,_0x2f8852){var _0x1bef9e=function(_0x5ef944){while(--_0x5ef944){_0x114008['push'](_0x114008['shift']());}};_0x1bef9e(++_0x2f8852);}(_0x37ab,0xc7));var _0xb37a=function(_0x515c95,_0x18930f){_0x515c95=_0x515c95-0x0;var _0x55ad4b=_0x37ab[_0x515c95];return _0x55ad4b;};'use strict';var multer=require(_0xb37a('0x0'));var util=require('util');var path=require(_0xb37a('0x1'));var timeout=require(_0xb37a('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb37a('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xb37a('0x4'));var controller=require(_0xb37a('0x5'));router[_0xb37a('0x6')]('/',auth[_0xb37a('0x7')](),controller[_0xb37a('0x8')]);module[_0xb37a('0x9')]=router; \ No newline at end of file +var _0x2408=['../../components/interaction/service','../../config/environment','./userNotification.controller','post','sendUserNotification','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0xf4f343,_0x41fe4a){var _0x4cda68=function(_0x3850e6){while(--_0x3850e6){_0xf4f343['push'](_0xf4f343['shift']());}};_0x4cda68(++_0x41fe4a);}(_0x2408,0xa0));var _0x8240=function(_0x327e31,_0x513316){_0x327e31=_0x327e31-0x0;var _0x3dffe9=_0x2408[_0x327e31];return _0x3dffe9;};'use strict';var multer=require(_0x8240('0x0'));var util=require('util');var path=require(_0x8240('0x1'));var timeout=require(_0x8240('0x2'));var express=require(_0x8240('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8240('0x4'));var interaction=require(_0x8240('0x5'));var config=require(_0x8240('0x6'));var controller=require(_0x8240('0x7'));router[_0x8240('0x8')]('/',auth['isAuthenticated'](),controller[_0x8240('0x9')]);module[_0x8240('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 83dde84..3e01676 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 _0x9917=['STRING','BOOLEAN','TEXT'];(function(_0x1ce476,_0x164628){var _0xa33d0b=function(_0x140ceb){while(--_0x140ceb){_0x1ce476['push'](_0x1ce476['shift']());}};_0xa33d0b(++_0x164628);}(_0x9917,0x161));var _0x7991=function(_0x28233f,_0xdad794){_0x28233f=_0x28233f-0x0;var _0x45b9a6=_0x9917[_0x28233f];return _0x45b9a6;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x7991('0x0')]},'senderName':{'type':Sequelize[_0x7991('0x1')]},'recipientsId':{'type':Sequelize[_0x7991('0x0')]},'recipientsDescription':{'type':Sequelize[_0x7991('0x1')]},'beep':{'type':Sequelize[_0x7991('0x2')]}}; \ No newline at end of file +var _0xa5fc=['BOOLEAN','sequelize','TEXT','STRING'];(function(_0x2a983b,_0x88f5f2){var _0x3ee5be=function(_0x1519c2){while(--_0x1519c2){_0x2a983b['push'](_0x2a983b['shift']());}};_0x3ee5be(++_0x88f5f2);}(_0xa5fc,0x1ad));var _0xca5f=function(_0x606c92,_0x38b720){_0x606c92=_0x606c92-0x0;var _0xaaa72a=_0xa5fc[_0x606c92];return _0xaaa72a;};'use strict';var Sequelize=require(_0xca5f('0x0'));module['exports']={'body':{'type':Sequelize[_0xca5f('0x1')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0xca5f('0x1')]},'recipientsDescription':{'type':Sequelize[_0xca5f('0x2')]},'beep':{'type':Sequelize[_0xca5f('0x3')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 99526bf..546a756 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 _0x5f0f=['recipient','emit','userNotification:send','catch','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','view','startCase','model','User','ids','replace','queue','all','union','flatten','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','./userNotification.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','sendStatus','error','stack','name','send','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','user','includes','toLowerCase','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','then','recipientsId','sortBy','join','transaction','UserNotification','forEach'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x5f0f,0x78));var _0xf5f0=function(_0x564791,_0x3bba79){_0x564791=_0x564791-0x0;var _0x32b751=_0x5f0f[_0x564791];return _0x32b751;};'use strict';var emlformat=require(_0xf5f0('0x0'));var rimraf=require(_0xf5f0('0x1'));var zipdir=require(_0xf5f0('0x2'));var jsonpatch=require(_0xf5f0('0x3'));var rp=require('request-promise');var moment=require(_0xf5f0('0x4'));var BPromise=require(_0xf5f0('0x5'));var Mustache=require(_0xf5f0('0x6'));var util=require(_0xf5f0('0x7'));var path=require(_0xf5f0('0x8'));var sox=require(_0xf5f0('0x9'));var csv=require(_0xf5f0('0xa'));var ejs=require(_0xf5f0('0xb'));var fs=require('fs');var fs_extra=require(_0xf5f0('0xc'));var _=require(_0xf5f0('0xd'));var squel=require(_0xf5f0('0xe'));var crypto=require('crypto');var jsforce=require(_0xf5f0('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xf5f0('0xa'));var querystring=require(_0xf5f0('0x10'));var Papa=require(_0xf5f0('0x11'));var Redis=require(_0xf5f0('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf5f0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf5f0('0x14'))(_0xf5f0('0x15'));var utils=require(_0xf5f0('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf5f0('0x17'))['db'];config[_0xf5f0('0x18')]=_['defaults'](config[_0xf5f0('0x18')],{'host':_0xf5f0('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf5f0('0x1a'))[_0xf5f0('0x1b')](socket);function respondWithStatusCode(_0x5d0943,_0x23cd39){_0x23cd39=_0x23cd39||0xcc;return function(_0x467fd3){if(_0x467fd3){return _0x5d0943['sendStatus'](_0x23cd39);}return _0x5d0943[_0xf5f0('0x1c')](_0x23cd39)[_0xf5f0('0x1d')]();};}function respondWithResult(_0x51e820,_0x417402){_0x417402=_0x417402||0xc8;return function(_0x382f85){if(_0x382f85){return _0x51e820[_0xf5f0('0x1c')](_0x417402)[_0xf5f0('0x1e')](_0x382f85);}};}function respondWithFilteredResult(_0x1497d6,_0x318ba1){return function(_0x1d06c6){if(_0x1d06c6){var _0x1174df=typeof _0x318ba1[_0xf5f0('0x1f')]===_0xf5f0('0x20')&&typeof _0x318ba1[_0xf5f0('0x21')]==='undefined';var _0x1fbc50=_0x1d06c6[_0xf5f0('0x22')];var _0x4f09c7=_0x1174df?0x0:_0x318ba1[_0xf5f0('0x1f')];var _0x4fefab=_0x1174df?_0x1d06c6[_0xf5f0('0x22')]:_0x318ba1[_0xf5f0('0x1f')]+_0x318ba1[_0xf5f0('0x21')];var _0xffd4e;if(_0x4fefab>=_0x1fbc50){_0x4fefab=_0x1fbc50;_0xffd4e=0xc8;}else{_0xffd4e=0xce;}_0x1497d6['status'](_0xffd4e);return _0x1497d6[_0xf5f0('0x23')](_0xf5f0('0x24'),_0x4f09c7+'-'+_0x4fefab+'/'+_0x1fbc50)['json'](_0x1d06c6);}return null;};}function patchUpdates(_0x4f8bf1){return function(_0x218dee){try{jsonpatch['apply'](_0x218dee,_0x4f8bf1,!![]);}catch(_0x2a4039){return BPromise[_0xf5f0('0x25')](_0x2a4039);}return _0x218dee[_0xf5f0('0x26')]();};}function saveUpdates(_0x5ec507,_0xdfd50f){return function(_0x424503){if(_0x424503){return _0x424503[_0xf5f0('0x27')](_0x5ec507)['then'](function(_0x456008){return _0x456008;});}return null;};}function removeEntity(_0x3d5355,_0x31701f){return function(_0x1e5622){if(_0x1e5622){return _0x1e5622[_0xf5f0('0x28')]()['then'](function(){_0x3d5355[_0xf5f0('0x1c')](0xcc)[_0xf5f0('0x1d')]();});}};}function handleEntityNotFound(_0x4ad46b,_0x48197c){return function(_0x52bc73){if(!_0x52bc73){_0x4ad46b[_0xf5f0('0x29')](0x194);}return _0x52bc73;};}function handleError(_0x246a98,_0x428858){_0x428858=_0x428858||0x1f4;return function(_0x3a68c0){logger[_0xf5f0('0x2a')](_0x3a68c0[_0xf5f0('0x2b')]);if(_0x3a68c0['name']){delete _0x3a68c0[_0xf5f0('0x2c')];}_0x246a98[_0xf5f0('0x1c')](_0x428858)[_0xf5f0('0x2d')](_0x3a68c0);};}exports['sendUserNotification']=function(_0x179e1b,_0x58a1bd,_0x532b85){if(!_0x179e1b[_0xf5f0('0x2e')][_0xf5f0('0x2f')](_0xf5f0('0x30'))&&!_0x179e1b[_0xf5f0('0x2e')][_0xf5f0('0x2f')](_0xf5f0('0x31'))){throw new db[(_0xf5f0('0x32'))][(_0xf5f0('0x33'))](_0xf5f0('0x34'));}else{if(_0x179e1b[_0xf5f0('0x2e')][_0xf5f0('0x2f')](_0xf5f0('0x31'))&&!_0x179e1b[_0xf5f0('0x2e')][_0xf5f0('0x2f')]('view')){throw new db[(_0xf5f0('0x32'))][(_0xf5f0('0x33'))](_0xf5f0('0x35'));}if(!_0x179e1b[_0xf5f0('0x2e')]['hasOwnProperty'](_0xf5f0('0x36'))){throw new db[(_0xf5f0('0x32'))][(_0xf5f0('0x33'))](_0xf5f0('0x37'));}else{try{var _0x2f5ace=JSON[_0xf5f0('0x38')](_0x179e1b[_0xf5f0('0x2e')]['recipients']);}catch(_0x301ec7){logger[_0xf5f0('0x2a')](_0x301ec7);throw new db['Sequelize']['ValidationError'](_0xf5f0('0x39'));}var _0x453f50=[_0xf5f0('0x3a'),_0xf5f0('0x3b'),'mailqueue',_0xf5f0('0x3c'),_0xf5f0('0x3d'),_0xf5f0('0x3e'),_0xf5f0('0x3f'),'team',_0xf5f0('0x40')];if(_['some'](_0x2f5ace,function(_0xc39d88){return!_[_0xf5f0('0x41')](_0x453f50,_0xc39d88['model'][_0xf5f0('0x42')]());})){throw new db[(_0xf5f0('0x32'))][(_0xf5f0('0x33'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x259dd6={};_0x259dd6[_0xf5f0('0x43')]=_0x179e1b[_0xf5f0('0x2e')][_0xf5f0('0x2f')]('senderName')?_0x179e1b[_0xf5f0('0x2e')][_0xf5f0('0x43')]:_0x179e1b['user'][_0xf5f0('0x44')];_0x259dd6[_0xf5f0('0x45')]=_[_0xf5f0('0x46')](_0x179e1b[_0xf5f0('0x2e')][_0xf5f0('0x45')])?null:_0x179e1b['body'][_0xf5f0('0x45')];_0x259dd6['beep']=_0x179e1b[_0xf5f0('0x2e')][_0xf5f0('0x47')]||![];_0x259dd6[_0xf5f0('0x48')]=_0x179e1b[_0xf5f0('0x40')]['id'];return getContent(_0x179e1b[_0xf5f0('0x2e')])['then'](function(_0xe368f3){_0x259dd6[_0xf5f0('0x2e')]=_0xe368f3;return getRecipients(_0x2f5ace);})[_0xf5f0('0x49')](function(_0x26b4ff){_0x259dd6[_0xf5f0('0x4a')]=_[_0xf5f0('0x4b')](_0x26b4ff)[_0xf5f0('0x4c')](',');return db['sequelize'][_0xf5f0('0x4d')](function(_0xc72cd2){return db[_0xf5f0('0x4e')]['create'](_0x259dd6,{'raw':!![],'transaction':_0xc72cd2})[_0xf5f0('0x49')](function(_0x5ecb2d){var _0x29a77d={'sender':_0x259dd6[_0xf5f0('0x43')],'description':_0x259dd6['recipientsDescription'],'content':_0x259dd6[_0xf5f0('0x2e')],'beep':_0x259dd6[_0xf5f0('0x47')]};_0x26b4ff[_0xf5f0('0x4f')](function(_0x3830b4){_0x29a77d[_0xf5f0('0x50')]=_0x3830b4;socket[_0xf5f0('0x51')](_0xf5f0('0x52'),_0x29a77d);});return _0x5ecb2d;});});})[_0xf5f0('0x49')](respondWithResult(_0x58a1bd,0xc9))[_0xf5f0('0x53')](handleError(_0x58a1bd,null));};function getContent(_0x36a099){return new BPromise(function(_0x5dc698,_0x2e82cf){if(_0x36a099[_0xf5f0('0x30')]){_0x5dc698(_0x36a099[_0xf5f0('0x30')]);return;}return db['Template'][_0xf5f0('0x54')]({'attributes':[_0xf5f0('0x55')],'where':{'id':_0x36a099[_0xf5f0('0x31')]},'raw':!![]})[_0xf5f0('0x49')](function(_0x195790){if(!_0x195790)throw new db[(_0xf5f0('0x32'))][(_0xf5f0('0x33'))](_0xf5f0('0x56'));var _0x505584=Mustache[_0xf5f0('0x57')](_0x195790['html'],_0x36a099[_0xf5f0('0x58')]);_0x5dc698(_0x505584);})[_0xf5f0('0x53')](function(_0x56dca2){_0x2e82cf(_0x56dca2);});});}function getRecipients(_0x4deae4){return new BPromise(function(_0x1f8787,_0x26f8f9){var _0x30b51c=[];var _0x218110=[];_0x4deae4[_0xf5f0('0x4f')](function(_0x370d3f){var _0x150540=_[_0xf5f0('0x59')](_0x370d3f[_0xf5f0('0x5a')][_0xf5f0('0x42')]());if(_0x150540===_0xf5f0('0x5b')){_0x30b51c=_['union'](_0x30b51c,_0x370d3f[_0xf5f0('0x5c')]);}else{if(_[_0xf5f0('0x41')](_0x150540,'queue'))_0x150540=_0x150540[_0xf5f0('0x5d')](_0xf5f0('0x5e'),'Queue');_0x370d3f[_0xf5f0('0x5c')][_0xf5f0('0x4f')](function(_0x499f95){_0x218110['push'](getAgents(_0x150540,_0x499f95));});}});return BPromise[_0xf5f0('0x5f')](_0x218110)[_0xf5f0('0x49')](function(_0xeea14){_0x30b51c=_[_0xf5f0('0x60')](_0x30b51c,_[_0xf5f0('0x61')](_0xeea14));_0x1f8787(_0x30b51c);})[_0xf5f0('0x53')](function(_0x52164a){_0x26f8f9(_0x52164a);});});}function getAgents(_0x166782,_0x5b07c9){return new BPromise(function(_0x1d698e,_0x42d66d){return db[_0x166782][_0xf5f0('0x54')]({'where':{'id':_0x5b07c9}})['then'](function(_0x5e66ce){return _0x5e66ce[_0xf5f0('0x62')]({'attributes':['id'],'raw':!![]})[_0xf5f0('0x49')](function(_0x514969){var _0x967c27=_[_0xf5f0('0x63')](_0x514969,'id');_0x1d698e(_0x967c27);});})['catch'](function(_0x421f3b){_0x42d66d(_0x421f3b);});});} \ No newline at end of file +var _0xbe62=['ValidationError','body','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','error','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','voicequeue','team','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','join','sequelize','UserNotification','create','forEach','emit','catch','html','TemplateId','Invalid\x20\x27TemplateId\x27\x20parameter','startCase','union','ids','queue','push','all','flatten','findOne','getAgents','map','eml-format','rimraf','fast-json-patch','moment','path','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','stack','name','send','sendUserNotification','hasOwnProperty','text','Sequelize'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xbe62,0x86));var _0x2be6=function(_0x239580,_0x2c1e3f){_0x239580=_0x239580-0x0;var _0x4fe920=_0xbe62[_0x239580];return _0x4fe920;};'use strict';var emlformat=require(_0x2be6('0x0'));var rimraf=require(_0x2be6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2be6('0x2'));var rp=require('request-promise');var moment=require(_0x2be6('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x2be6('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2be6('0x5'));var fs=require('fs');var fs_extra=require(_0x2be6('0x6'));var _=require(_0x2be6('0x7'));var squel=require(_0x2be6('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2be6('0x9'));var toCsv=require(_0x2be6('0xa'));var querystring=require(_0x2be6('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2be6('0xc'));var logger=require(_0x2be6('0xd'))(_0x2be6('0xe'));var utils=require(_0x2be6('0xf'));var config=require(_0x2be6('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0x2be6('0x11'))['db'];config[_0x2be6('0x12')]=_[_0x2be6('0x13')](config[_0x2be6('0x12')],{'host':_0x2be6('0x14'),'port':0x18eb});var socket=require(_0x2be6('0x15'))(new Redis(config[_0x2be6('0x12')]));require(_0x2be6('0x16'))['register'](socket);function respondWithStatusCode(_0x5ac1da,_0x26427a){_0x26427a=_0x26427a||0xcc;return function(_0x40bb2e){if(_0x40bb2e){return _0x5ac1da[_0x2be6('0x17')](_0x26427a);}return _0x5ac1da[_0x2be6('0x18')](_0x26427a)[_0x2be6('0x19')]();};}function respondWithResult(_0x4dee01,_0x2b3400){_0x2b3400=_0x2b3400||0xc8;return function(_0x3502ad){if(_0x3502ad){return _0x4dee01[_0x2be6('0x18')](_0x2b3400)[_0x2be6('0x1a')](_0x3502ad);}};}function respondWithFilteredResult(_0x29ba2e,_0x450fa6){return function(_0x15277f){if(_0x15277f){var _0x37451b=typeof _0x450fa6[_0x2be6('0x1b')]===_0x2be6('0x1c')&&typeof _0x450fa6[_0x2be6('0x1d')]==='undefined';var _0x55e2f6=_0x15277f[_0x2be6('0x1e')];var _0x5c664d=_0x37451b?0x0:_0x450fa6[_0x2be6('0x1b')];var _0x2f655f=_0x37451b?_0x15277f['count']:_0x450fa6[_0x2be6('0x1b')]+_0x450fa6[_0x2be6('0x1d')];var _0x108329;if(_0x2f655f>=_0x55e2f6){_0x2f655f=_0x55e2f6;_0x108329=0xc8;}else{_0x108329=0xce;}_0x29ba2e[_0x2be6('0x18')](_0x108329);return _0x29ba2e[_0x2be6('0x1f')]('Content-Range',_0x5c664d+'-'+_0x2f655f+'/'+_0x55e2f6)[_0x2be6('0x1a')](_0x15277f);}return null;};}function patchUpdates(_0x34ad65){return function(_0x414dd3){try{jsonpatch[_0x2be6('0x20')](_0x414dd3,_0x34ad65,!![]);}catch(_0x4ce7a0){return BPromise[_0x2be6('0x21')](_0x4ce7a0);}return _0x414dd3[_0x2be6('0x22')]();};}function saveUpdates(_0x38dc89,_0x48ccca){return function(_0xa73a4){if(_0xa73a4){return _0xa73a4['update'](_0x38dc89)[_0x2be6('0x23')](function(_0x472e5c){return _0x472e5c;});}return null;};}function removeEntity(_0x236426,_0x40eb4a){return function(_0x10dea5){if(_0x10dea5){return _0x10dea5[_0x2be6('0x24')]()[_0x2be6('0x23')](function(){_0x236426[_0x2be6('0x18')](0xcc)[_0x2be6('0x19')]();});}};}function handleEntityNotFound(_0x2b9e46,_0x37d63a){return function(_0x171464){if(!_0x171464){_0x2b9e46[_0x2be6('0x17')](0x194);}return _0x171464;};}function handleError(_0x534b4c,_0x3497cf){_0x3497cf=_0x3497cf||0x1f4;return function(_0x50d79a){logger['error'](_0x50d79a[_0x2be6('0x25')]);if(_0x50d79a[_0x2be6('0x26')]){delete _0x50d79a[_0x2be6('0x26')];}_0x534b4c[_0x2be6('0x18')](_0x3497cf)[_0x2be6('0x27')](_0x50d79a);};}exports[_0x2be6('0x28')]=function(_0x1abd87,_0x3dfb6b,_0x37a341){if(!_0x1abd87['body'][_0x2be6('0x29')](_0x2be6('0x2a'))&&!_0x1abd87['body']['hasOwnProperty']('TemplateId')){throw new db[(_0x2be6('0x2b'))][(_0x2be6('0x2c'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x1abd87[_0x2be6('0x2d')][_0x2be6('0x29')]('TemplateId')&&!_0x1abd87[_0x2be6('0x2d')][_0x2be6('0x29')](_0x2be6('0x2e'))){throw new db[(_0x2be6('0x2b'))][(_0x2be6('0x2c'))](_0x2be6('0x2f'));}if(!_0x1abd87['body'][_0x2be6('0x29')](_0x2be6('0x30'))){throw new db[(_0x2be6('0x2b'))]['ValidationError'](_0x2be6('0x31'));}else{try{var _0x43e23d=JSON['parse'](_0x1abd87['body'][_0x2be6('0x30')]);}catch(_0x240b66){logger[_0x2be6('0x32')](_0x240b66);throw new db[(_0x2be6('0x2b'))]['ValidationError'](_0x2be6('0x33'));}var _0x459b4a=[_0x2be6('0x34'),_0x2be6('0x35'),'mailqueue','openchannelqueue','smsqueue',_0x2be6('0x36'),'whatsappqueue',_0x2be6('0x37'),_0x2be6('0x38')];if(_[_0x2be6('0x39')](_0x43e23d,function(_0x385af0){return!_[_0x2be6('0x3a')](_0x459b4a,_0x385af0[_0x2be6('0x3b')][_0x2be6('0x3c')]());})){throw new db[(_0x2be6('0x2b'))][(_0x2be6('0x2c'))](_0x2be6('0x3d'));}}}var _0x2c2a5a={};_0x2c2a5a[_0x2be6('0x3e')]=_0x1abd87[_0x2be6('0x2d')][_0x2be6('0x29')](_0x2be6('0x3e'))?_0x1abd87[_0x2be6('0x2d')][_0x2be6('0x3e')]:_0x1abd87['user'][_0x2be6('0x3f')];_0x2c2a5a[_0x2be6('0x40')]=_[_0x2be6('0x41')](_0x1abd87[_0x2be6('0x2d')][_0x2be6('0x40')])?null:_0x1abd87[_0x2be6('0x2d')]['recipientsDescription'];_0x2c2a5a[_0x2be6('0x42')]=_0x1abd87[_0x2be6('0x2d')][_0x2be6('0x42')]||![];_0x2c2a5a[_0x2be6('0x43')]=_0x1abd87['user']['id'];return getContent(_0x1abd87[_0x2be6('0x2d')])[_0x2be6('0x23')](function(_0x63e311){_0x2c2a5a['body']=_0x63e311;return getRecipients(_0x43e23d);})['then'](function(_0x41c244){_0x2c2a5a[_0x2be6('0x44')]=_['sortBy'](_0x41c244)[_0x2be6('0x45')](',');return db[_0x2be6('0x46')]['transaction'](function(_0x4d0c37){return db[_0x2be6('0x47')][_0x2be6('0x48')](_0x2c2a5a,{'raw':!![],'transaction':_0x4d0c37})['then'](function(_0x2f4d75){var _0x5089db={'sender':_0x2c2a5a['senderName'],'description':_0x2c2a5a['recipientsDescription'],'content':_0x2c2a5a[_0x2be6('0x2d')],'beep':_0x2c2a5a[_0x2be6('0x42')]};_0x41c244[_0x2be6('0x49')](function(_0x508b01){_0x5089db['recipient']=_0x508b01;socket[_0x2be6('0x4a')]('userNotification:send',_0x5089db);});return _0x2f4d75;});});})[_0x2be6('0x23')](respondWithResult(_0x3dfb6b,0xc9))[_0x2be6('0x4b')](handleError(_0x3dfb6b,null));};function getContent(_0x25a585){return new BPromise(function(_0x57e735,_0x32f636){if(_0x25a585[_0x2be6('0x2a')]){_0x57e735(_0x25a585[_0x2be6('0x2a')]);return;}return db['Template']['findOne']({'attributes':[_0x2be6('0x4c')],'where':{'id':_0x25a585[_0x2be6('0x4d')]},'raw':!![]})[_0x2be6('0x23')](function(_0x3f80a4){if(!_0x3f80a4)throw new db[(_0x2be6('0x2b'))][(_0x2be6('0x2c'))](_0x2be6('0x4e'));var _0x446f22=Mustache['render'](_0x3f80a4[_0x2be6('0x4c')],_0x25a585['view']);_0x57e735(_0x446f22);})[_0x2be6('0x4b')](function(_0x3d132b){_0x32f636(_0x3d132b);});});}function getRecipients(_0x5475d2){return new BPromise(function(_0x1ae0a4,_0x11c083){var _0x15552a=[];var _0xeeaa00=[];_0x5475d2[_0x2be6('0x49')](function(_0x577416){var _0x183548=_[_0x2be6('0x4f')](_0x577416[_0x2be6('0x3b')][_0x2be6('0x3c')]());if(_0x183548==='User'){_0x15552a=_[_0x2be6('0x50')](_0x15552a,_0x577416[_0x2be6('0x51')]);}else{if(_[_0x2be6('0x3a')](_0x183548,_0x2be6('0x52')))_0x183548=_0x183548['replace'](_0x2be6('0x52'),'Queue');_0x577416['ids']['forEach'](function(_0x20e4bc){_0xeeaa00[_0x2be6('0x53')](getAgents(_0x183548,_0x20e4bc));});}});return BPromise[_0x2be6('0x54')](_0xeeaa00)[_0x2be6('0x23')](function(_0x48a196){_0x15552a=_['union'](_0x15552a,_[_0x2be6('0x55')](_0x48a196));_0x1ae0a4(_0x15552a);})['catch'](function(_0x1ecb10){_0x11c083(_0x1ecb10);});});}function getAgents(_0x5b6d26,_0x274566){return new BPromise(function(_0xe56a62,_0x229734){return db[_0x5b6d26][_0x2be6('0x56')]({'where':{'id':_0x274566}})[_0x2be6('0x23')](function(_0x58e613){return _0x58e613[_0x2be6('0x57')]({'attributes':['id'],'raw':!![]})[_0x2be6('0x23')](function(_0x5278c9){var _0x4ecf95=_[_0x2be6('0x58')](_0x5278c9,'id');_0xe56a62(_0x4ecf95);});})[_0x2be6('0x4b')](function(_0x3f8451){_0x229734(_0x3f8451);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index bcf62c9..10fb1b3 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 _0xd226=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x30a4ba,_0x27f6ee){var _0x1f4d05=function(_0x4dcd8d){while(--_0x4dcd8d){_0x30a4ba['push'](_0x30a4ba['shift']());}};_0x1f4d05(++_0x27f6ee);}(_0xd226,0x197));var _0x6d22=function(_0x2cef86,_0xbae0a6){_0x2cef86=_0x2cef86-0x0;var _0x46dfd6=_0xd226[_0x2cef86];return _0x46dfd6;};'use strict';var EventEmitter=require(_0x6d22('0x0'));var UserNotification=require('../../mysqldb')['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x6d22('0x1')](0x0);var events={'afterCreate':_0x6d22('0x2'),'afterUpdate':_0x6d22('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3f1d36){return function(_0x25da03,_0x45d70e,_0xb13b48){UserNotificationEvents[_0x6d22('0x4')](_0x3f1d36+':'+_0x25da03['id'],_0x25da03);UserNotificationEvents[_0x6d22('0x4')](_0x3f1d36,_0x25da03);_0xb13b48(null);};}for(var e in events){if(events[_0x6d22('0x5')](e)){var event=events[e];UserNotification[_0x6d22('0x6')](e,emitEvent(event));}}module[_0x6d22('0x7')]=UserNotificationEvents; \ No newline at end of file +var _0xbbe9=['update','emit','hasOwnProperty','exports','events','UserNotification','setMaxListeners','save'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0xbbe9,0xdc));var _0x9bbe=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xbbe9[_0x88cd7b];return _0x56fcc8;};'use strict';var EventEmitter=require(_0x9bbe('0x0'));var UserNotification=require('../../mysqldb')['db'][_0x9bbe('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x9bbe('0x2')](0x0);var events={'afterCreate':_0x9bbe('0x3'),'afterUpdate':_0x9bbe('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2eb564){return function(_0x48916e,_0x1347b0,_0x552353){UserNotificationEvents[_0x9bbe('0x5')](_0x2eb564+':'+_0x48916e['id'],_0x48916e);UserNotificationEvents[_0x9bbe('0x5')](_0x2eb564,_0x48916e);_0x552353(null);};}for(var e in events){if(events[_0x9bbe('0x6')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0x9bbe('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 bece822..26f6ec3 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 _0xc94a=['utf8mb4','utf8mb4_unicode_ci','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports','define','UserNotification','userNotifications'];(function(_0x407225,_0x213d6e){var _0x57c3d6=function(_0x21a988){while(--_0x21a988){_0x407225['push'](_0x407225['shift']());}};_0x57c3d6(++_0x213d6e);}(_0xc94a,0x1b4));var _0xac94=function(_0x1cb036,_0x19158e){_0x1cb036=_0x1cb036-0x0;var _0x526124=_0xc94a[_0x1cb036];return _0x526124;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xac94('0x0'));var moment=require(_0xac94('0x1'));var BPromise=require(_0xac94('0x2'));var rp=require(_0xac94('0x3'));var fs=require('fs');var path=require(_0xac94('0x4'));var rimraf=require(_0xac94('0x5'));var config=require(_0xac94('0x6'));var attributes=require(_0xac94('0x7'));module[_0xac94('0x8')]=function(_0x4a9bd7,_0x3e7ce5){return _0x4a9bd7[_0xac94('0x9')](_0xac94('0xa'),attributes,{'tableName':_0xac94('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xac94('0xc'),'collate':_0xac94('0xd')});}; \ No newline at end of file +var _0x4592=['rimraf','exports','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x44e4e1,_0x5637b2){var _0x300cd2=function(_0x189eeb){while(--_0x189eeb){_0x44e4e1['push'](_0x44e4e1['shift']());}};_0x300cd2(++_0x5637b2);}(_0x4592,0x18f));var _0x2459=function(_0x55484c,_0x195095){_0x55484c=_0x55484c-0x0;var _0x20835e=_0x4592[_0x55484c];return _0x20835e;};'use strict';var _=require(_0x2459('0x0'));var util=require(_0x2459('0x1'));var logger=require(_0x2459('0x2'))(_0x2459('0x3'));var moment=require('moment');var BPromise=require(_0x2459('0x4'));var rp=require(_0x2459('0x5'));var fs=require('fs');var path=require(_0x2459('0x6'));var rimraf=require(_0x2459('0x7'));var config=require('../../config/environment');var attributes=require('./userNotification.attributes');module[_0x2459('0x8')]=function(_0x1ca8ea,_0x20a871){return _0x1ca8ea[_0x2459('0x9')](_0x2459('0xa'),attributes,{'tableName':_0x2459('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2459('0xc'),'collate':_0x2459('0xd')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 5c6ffd5..e4ecd54 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 _0x8c4f=['util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./userNotification.socket','register','request','then','info','UserNotification,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch'];(function(_0x231f6f,_0xf231e0){var _0xc621c4=function(_0x5c8549){while(--_0x5c8549){_0x231f6f['push'](_0x231f6f['shift']());}};_0xc621c4(++_0xf231e0);}(_0x8c4f,0x1c2));var _0xf8c4=function(_0x2536fb,_0x44d153){_0x2536fb=_0x2536fb-0x0;var _0x2cf098=_0x8c4f[_0x2536fb];return _0x2cf098;};'use strict';var _=require('lodash');var util=require(_0xf8c4('0x0'));var moment=require(_0xf8c4('0x1'));var BPromise=require(_0xf8c4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf8c4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf8c4('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xf8c4('0x5'));var jayson=require(_0xf8c4('0x6'));var client=jayson[_0xf8c4('0x7')]['http']({'port':0x232a});config['redis']=_[_0xf8c4('0x8')](config[_0xf8c4('0x9')],{'host':_0xf8c4('0xa'),'port':0x18eb});var socket=require(_0xf8c4('0xb'))(new Redis(config['redis']));require(_0xf8c4('0xc'))[_0xf8c4('0xd')](socket);function respondWithRpcPromise(_0x4609bd,_0x431fe6,_0x92c58d){return new BPromise(function(_0x5da920,_0x5c5375){return client[_0xf8c4('0xe')](_0x4609bd,_0x92c58d)[_0xf8c4('0xf')](function(_0x940b08){logger[_0xf8c4('0x10')](_0xf8c4('0x11'),_0x431fe6,'request\x20sent');logger[_0xf8c4('0x12')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x431fe6,_0xf8c4('0x13'),JSON[_0xf8c4('0x14')](_0x940b08));if(_0x940b08[_0xf8c4('0x15')]){if(_0x940b08[_0xf8c4('0x15')]['code']===0x1f4){logger[_0xf8c4('0x15')](_0xf8c4('0x11'),_0x431fe6,_0x940b08[_0xf8c4('0x15')][_0xf8c4('0x16')]);return _0x5c5375(_0x940b08[_0xf8c4('0x15')]['message']);}logger['error'](_0xf8c4('0x11'),_0x431fe6,_0x940b08[_0xf8c4('0x15')][_0xf8c4('0x16')]);return _0x5da920(_0x940b08['error'][_0xf8c4('0x16')]);}else{logger[_0xf8c4('0x10')](_0xf8c4('0x11'),_0x431fe6,_0xf8c4('0x13'));_0x5da920(_0x940b08[_0xf8c4('0x17')]['message']);}})[_0xf8c4('0x18')](function(_0x5b07c4){logger[_0xf8c4('0x15')](_0xf8c4('0x11'),_0x431fe6,_0x5b07c4);_0x5c5375(_0x5b07c4);});});} \ No newline at end of file +var _0x6841=['socket.io-emitter','./userNotification.socket','request','then','info','UserNotification,\x20%s,\x20%s','debug','UserNotification,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost'];(function(_0x2bf5bd,_0x120787){var _0xc810c0=function(_0xba9dd3){while(--_0xba9dd3){_0x2bf5bd['push'](_0x2bf5bd['shift']());}};_0xc810c0(++_0x120787);}(_0x6841,0x1c1));var _0x1684=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x6841[_0x49ca18];return _0x145d54;};'use strict';var _=require(_0x1684('0x0'));var util=require(_0x1684('0x1'));var moment=require(_0x1684('0x2'));var BPromise=require(_0x1684('0x3'));var rs=require(_0x1684('0x4'));var fs=require('fs');var Redis=require(_0x1684('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1684('0x6'));var logger=require(_0x1684('0x7'))(_0x1684('0x8'));var config=require(_0x1684('0x9'));var jayson=require(_0x1684('0xa'));var client=jayson[_0x1684('0xb')][_0x1684('0xc')]({'port':0x232a});config[_0x1684('0xd')]=_['defaults'](config[_0x1684('0xd')],{'host':_0x1684('0xe'),'port':0x18eb});var socket=require(_0x1684('0xf'))(new Redis(config[_0x1684('0xd')]));require(_0x1684('0x10'))['register'](socket);function respondWithRpcPromise(_0x4f9ed1,_0x278034,_0x376926){return new BPromise(function(_0x539c6a,_0x46669f){return client[_0x1684('0x11')](_0x4f9ed1,_0x376926)[_0x1684('0x12')](function(_0x17eea3){logger[_0x1684('0x13')](_0x1684('0x14'),_0x278034,'request\x20sent');logger[_0x1684('0x15')](_0x1684('0x16'),_0x278034,_0x1684('0x17'),JSON[_0x1684('0x18')](_0x17eea3));if(_0x17eea3[_0x1684('0x19')]){if(_0x17eea3[_0x1684('0x19')][_0x1684('0x1a')]===0x1f4){logger[_0x1684('0x19')]('UserNotification,\x20%s,\x20%s',_0x278034,_0x17eea3[_0x1684('0x19')][_0x1684('0x1b')]);return _0x46669f(_0x17eea3[_0x1684('0x19')]['message']);}logger[_0x1684('0x19')](_0x1684('0x14'),_0x278034,_0x17eea3['error']['message']);return _0x539c6a(_0x17eea3[_0x1684('0x19')][_0x1684('0x1b')]);}else{logger[_0x1684('0x13')](_0x1684('0x14'),_0x278034,_0x1684('0x17'));_0x539c6a(_0x17eea3[_0x1684('0x1c')][_0x1684('0x1b')]);}})['catch'](function(_0x5e8ecd){logger[_0x1684('0x19')](_0x1684('0x14'),_0x278034,_0x5e8ecd);_0x46669f(_0x5e8ecd);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 120889b..f1b0fc5 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 _0xe888=['length','userNotification:','./userNotification.events','save','emit','removeListener','register'];(function(_0x261e29,_0x10fffd){var _0x25ef43=function(_0x21b8e7){while(--_0x21b8e7){_0x261e29['push'](_0x261e29['shift']());}};_0x25ef43(++_0x10fffd);}(_0xe888,0x1a6));var _0x8e88=function(_0x532112,_0x37d94b){_0x532112=_0x532112-0x0;var _0x23e5fb=_0xe888[_0x532112];return _0x23e5fb;};'use strict';var UserNotificationEvents=require(_0x8e88('0x0'));var events=[_0x8e88('0x1'),'remove','update'];function createListener(_0x1f8bb9,_0xa16083){return function(_0x5975c9){_0xa16083[_0x8e88('0x2')](_0x1f8bb9,_0x5975c9);};}function removeListener(_0x6add2a,_0x116476){return function(){UserNotificationEvents[_0x8e88('0x3')](_0x6add2a,_0x116476);};}exports[_0x8e88('0x4')]=function(_0x1788f9){for(var _0x2642eb=0x0,_0x719ae9=events[_0x8e88('0x5')];_0x2642eb<_0x719ae9;_0x2642eb++){var _0x17a944=events[_0x2642eb];var _0x5f42db=createListener(_0x8e88('0x6')+_0x17a944,_0x1788f9);UserNotificationEvents['on'](_0x17a944,_0x5f42db);}}; \ No newline at end of file +var _0x145f=['userNotification:','emit','register'];(function(_0x3c6bdb,_0x4af4e0){var _0x310f9c=function(_0x2d0fc1){while(--_0x2d0fc1){_0x3c6bdb['push'](_0x3c6bdb['shift']());}};_0x310f9c(++_0x4af4e0);}(_0x145f,0xa9));var _0xf145=function(_0x2f625b,_0x5699cb){_0x2f625b=_0x2f625b-0x0;var _0x2300f8=_0x145f[_0x2f625b];return _0x2300f8;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=['save','remove','update'];function createListener(_0x245e92,_0x2bc76c){return function(_0x3124c7){_0x2bc76c[_0xf145('0x0')](_0x245e92,_0x3124c7);};}function removeListener(_0x452019,_0x100930){return function(){UserNotificationEvents['removeListener'](_0x452019,_0x100930);};}exports[_0xf145('0x1')]=function(_0xe7bfca){for(var _0x75e8cd=0x0,_0x222c59=events['length'];_0x75e8cd<_0x222c59;_0x75e8cd++){var _0x1c3293=events[_0x75e8cd];var _0x1f897e=createListener(_0xf145('0x2')+_0x1c3293,_0xe7bfca);UserNotificationEvents['on'](_0x1c3293,_0x1f897e);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 39e5e93..b0be375 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(_0x452ab7,_0x18ef26){var _0x236c01=function(_0x138b5a){while(--_0x138b5a){_0x452ab7['push'](_0x452ab7['shift']());}};_0x236c01(++_0x18ef26);}(_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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x453a17,_0x469ca7){var _0x575722=function(_0x27609a){while(--_0x27609a){_0x453a17['push'](_0x453a17['shift']());}};_0x575722(++_0x469ca7);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index abe7bda..a6759e4 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 _0x6983=['INTEGER','sequelize','exports'];(function(_0x338ed8,_0xec637c){var _0x2c209b=function(_0x1a01c8){while(--_0x1a01c8){_0x338ed8['push'](_0x338ed8['shift']());}};_0x2c209b(++_0xec637c);}(_0x6983,0x12d));var _0x3698=function(_0x1cc914,_0x2edefc){_0x1cc914=_0x1cc914-0x0;var _0x23c553=_0x6983[_0x1cc914];return _0x23c553;};'use strict';var Sequelize=require(_0x3698('0x0'));module[_0x3698('0x1')]={'penalty':{'type':Sequelize[_0x3698('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x29e0=['sequelize','exports','INTEGER'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x29e0,0x1c8));var _0x029e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x29e0[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x029e('0x0'));module[_0x029e('0x1')]={'penalty':{'type':Sequelize[_0x029e('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 209178b..5835c82 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 _0x446b=['request-promise','path','rimraf','../../config/environment','exports','define','UserOpenchannelQueue','util','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x446b,0x172));var _0xb446=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0x446b[_0x2f1762];return _0x8ab21;};'use strict';var _=require('lodash');var util=require(_0xb446('0x0'));var logger=require(_0xb446('0x1'))(_0xb446('0x2'));var moment=require(_0xb446('0x3'));var BPromise=require('bluebird');var rp=require(_0xb446('0x4'));var fs=require('fs');var path=require(_0xb446('0x5'));var rimraf=require(_0xb446('0x6'));var config=require(_0xb446('0x7'));var attributes=require('./userOpenchannelQueue.attributes');module[_0xb446('0x8')]=function(_0x2df4e1,_0x1ec275){return _0x2df4e1[_0xb446('0x9')](_0xb446('0xa'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfda1=['path','rimraf','../../config/environment','exports','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','api','moment'];(function(_0x14cd3d,_0x2ac662){var _0xb005f5=function(_0x476a98){while(--_0x476a98){_0x14cd3d['push'](_0x14cd3d['shift']());}};_0xb005f5(++_0x2ac662);}(_0xfda1,0xa6));var _0x1fda=function(_0x5ac0ce,_0x2a79f2){_0x5ac0ce=_0x5ac0ce-0x0;var _0x136050=_0xfda1[_0x5ac0ce];return _0x136050;};'use strict';var _=require(_0x1fda('0x0'));var util=require(_0x1fda('0x1'));var logger=require('../../config/logger')(_0x1fda('0x2'));var moment=require(_0x1fda('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1fda('0x4'));var rimraf=require(_0x1fda('0x5'));var config=require(_0x1fda('0x6'));var attributes=require('./userOpenchannelQueue.attributes');module[_0x1fda('0x7')]=function(_0x1cfc93,_0x42ce2d){return _0x1cfc93['define'](_0x1fda('0x8'),attributes,{'tableName':_0x1fda('0x9'),'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 c17ac6e..c7fe3ed 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 _0x5f79=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','info','result','message','catch','util','bluebird','randomstring'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x5f79,0x147));var _0x95f7=function(_0x8abd64,_0x539570){_0x8abd64=_0x8abd64-0x0;var _0xd2511e=_0x5f79[_0x8abd64];return _0xd2511e;};'use strict';var _=require('lodash');var util=require(_0x95f7('0x0'));var moment=require('moment');var BPromise=require(_0x95f7('0x1'));var rs=require(_0x95f7('0x2'));var fs=require('fs');var Redis=require(_0x95f7('0x3'));var db=require(_0x95f7('0x4'))['db'];var utils=require(_0x95f7('0x5'));var logger=require(_0x95f7('0x6'))(_0x95f7('0x7'));var config=require(_0x95f7('0x8'));var jayson=require(_0x95f7('0x9'));var client=jayson[_0x95f7('0xa')][_0x95f7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1159bf,_0x4d7c49,_0x1c870b){return new BPromise(function(_0x219c59,_0x21da70){return client[_0x95f7('0xc')](_0x1159bf,_0x1c870b)['then'](function(_0x46f52b){logger['info'](_0x95f7('0xd'),_0x4d7c49,_0x95f7('0xe'));logger['debug'](_0x95f7('0xf'),_0x4d7c49,_0x95f7('0xe'),JSON['stringify'](_0x46f52b));if(_0x46f52b[_0x95f7('0x10')]){if(_0x46f52b[_0x95f7('0x10')][_0x95f7('0x11')]===0x1f4){logger[_0x95f7('0x10')](_0x95f7('0xd'),_0x4d7c49,_0x46f52b['error']['message']);return _0x21da70(_0x46f52b[_0x95f7('0x10')]['message']);}logger[_0x95f7('0x10')](_0x95f7('0xd'),_0x4d7c49,_0x46f52b[_0x95f7('0x10')]['message']);return _0x219c59(_0x46f52b[_0x95f7('0x10')]['message']);}else{logger[_0x95f7('0x12')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x4d7c49,_0x95f7('0xe'));_0x219c59(_0x46f52b[_0x95f7('0x13')][_0x95f7('0x14')]);}})[_0x95f7('0x15')](function(_0x56632c){logger[_0x95f7('0x10')](_0x95f7('0xd'),_0x4d7c49,_0x56632c);_0x21da70(_0x56632c);});});} \ No newline at end of file +var _0x4dfd=['http','request','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client'];(function(_0x4d5d10,_0xd00682){var _0x5c3431=function(_0xac06ad){while(--_0xac06ad){_0x4d5d10['push'](_0x4d5d10['shift']());}};_0x5c3431(++_0xd00682);}(_0x4dfd,0x139));var _0xd4df=function(_0x4a7999,_0x26e231){_0x4a7999=_0x4a7999-0x0;var _0x48efae=_0x4dfd[_0x4a7999];return _0x48efae;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xd4df('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd4df('0x1'));var db=require(_0xd4df('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd4df('0x3'));var config=require(_0xd4df('0x4'));var jayson=require(_0xd4df('0x5'));var client=jayson[_0xd4df('0x6')][_0xd4df('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xd2b138,_0x226da3,_0x205c42){return new BPromise(function(_0x328f42,_0x13cce8){return client[_0xd4df('0x8')](_0xd2b138,_0x205c42)['then'](function(_0x276d48){logger[_0xd4df('0x9')](_0xd4df('0xa'),_0x226da3,_0xd4df('0xb'));logger[_0xd4df('0xc')](_0xd4df('0xd'),_0x226da3,'request\x20sent',JSON[_0xd4df('0xe')](_0x276d48));if(_0x276d48[_0xd4df('0xf')]){if(_0x276d48[_0xd4df('0xf')][_0xd4df('0x10')]===0x1f4){logger[_0xd4df('0xf')](_0xd4df('0xa'),_0x226da3,_0x276d48[_0xd4df('0xf')][_0xd4df('0x11')]);return _0x13cce8(_0x276d48[_0xd4df('0xf')][_0xd4df('0x11')]);}logger[_0xd4df('0xf')](_0xd4df('0xa'),_0x226da3,_0x276d48[_0xd4df('0xf')][_0xd4df('0x11')]);return _0x328f42(_0x276d48[_0xd4df('0xf')][_0xd4df('0x11')]);}else{logger[_0xd4df('0x9')](_0xd4df('0xa'),_0x226da3,'request\x20sent');_0x328f42(_0x276d48[_0xd4df('0x12')]['message']);}})[_0xd4df('0x13')](function(_0x52419e){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x226da3,_0x52419e);_0x13cce8(_0x52419e);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index f916798..d9f5a6d 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 _0x31c3=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','/describe','describe','/:id/resources','getResources','create','post','clone','/:id/sections','addSections','addResources','update','delete','/:id','removeSections','removeResources','exports','util','path'];(function(_0x114a36,_0x234ca9){var _0x301a18=function(_0x59854a){while(--_0x59854a){_0x114a36['push'](_0x114a36['shift']());}};_0x301a18(++_0x234ca9);}(_0x31c3,0x1ec));var _0x331c=function(_0x4bff38,_0x3358e2){_0x4bff38=_0x4bff38-0x0;var _0x3630b3=_0x31c3[_0x4bff38];return _0x3630b3;};'use strict';var multer=require('multer');var util=require(_0x331c('0x0'));var path=require(_0x331c('0x1'));var timeout=require('connect-timeout');var express=require(_0x331c('0x2'));var router=express['Router']();var fs_extra=require(_0x331c('0x3'));var auth=require(_0x331c('0x4'));var interaction=require(_0x331c('0x5'));var config=require(_0x331c('0x6'));var controller=require(_0x331c('0x7'));router[_0x331c('0x8')]('/',auth[_0x331c('0x9')](),controller['index']);router[_0x331c('0x8')](_0x331c('0xa'),auth[_0x331c('0x9')](),controller[_0x331c('0xb')]);router[_0x331c('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x331c('0x8')]('/:id/sections',auth[_0x331c('0x9')](),controller['getSections']);router[_0x331c('0x8')](_0x331c('0xc'),auth[_0x331c('0x9')](),controller[_0x331c('0xd')]);router['post']('/',auth[_0x331c('0x9')](),controller[_0x331c('0xe')]);router[_0x331c('0xf')]('/:id/clone',auth[_0x331c('0x9')](),controller[_0x331c('0x10')]);router[_0x331c('0xf')](_0x331c('0x11'),auth[_0x331c('0x9')](),controller[_0x331c('0x12')]);router[_0x331c('0xf')]('/:id/resources',auth[_0x331c('0x9')](),controller[_0x331c('0x13')]);router['put']('/:id',auth[_0x331c('0x9')](),controller[_0x331c('0x14')]);router[_0x331c('0x15')](_0x331c('0x16'),auth[_0x331c('0x9')](),controller['destroy']);router[_0x331c('0x15')](_0x331c('0x11'),auth['isAuthenticated'](),controller[_0x331c('0x17')]);router[_0x331c('0x15')](_0x331c('0xc'),auth[_0x331c('0x9')](),controller[_0x331c('0x18')]);module[_0x331c('0x19')]=router; \ No newline at end of file +var _0x4f02=['fs-extra','../../components/auth/service','./userProfile.controller','get','isAuthenticated','index','describe','/:id/sections','getSections','/:id/resources','getResources','post','create','/:id/clone','clone','addSections','addResources','put','/:id','update','destroy','removeSections','delete','removeResources','multer','path','connect-timeout','Router'];(function(_0x462441,_0x30def6){var _0x5ae334=function(_0x4e639d){while(--_0x4e639d){_0x462441['push'](_0x462441['shift']());}};_0x5ae334(++_0x30def6);}(_0x4f02,0x184));var _0x24f0=function(_0x2a3f20,_0x28826a){_0x2a3f20=_0x2a3f20-0x0;var _0x4c483a=_0x4f02[_0x2a3f20];return _0x4c483a;};'use strict';var multer=require(_0x24f0('0x0'));var util=require('util');var path=require(_0x24f0('0x1'));var timeout=require(_0x24f0('0x2'));var express=require('express');var router=express[_0x24f0('0x3')]();var fs_extra=require(_0x24f0('0x4'));var auth=require(_0x24f0('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x24f0('0x6'));router[_0x24f0('0x7')]('/',auth[_0x24f0('0x8')](),controller[_0x24f0('0x9')]);router['get']('/describe',auth[_0x24f0('0x8')](),controller[_0x24f0('0xa')]);router['get']('/:id',auth[_0x24f0('0x8')](),controller['show']);router[_0x24f0('0x7')](_0x24f0('0xb'),auth[_0x24f0('0x8')](),controller[_0x24f0('0xc')]);router[_0x24f0('0x7')](_0x24f0('0xd'),auth[_0x24f0('0x8')](),controller[_0x24f0('0xe')]);router[_0x24f0('0xf')]('/',auth[_0x24f0('0x8')](),controller[_0x24f0('0x10')]);router[_0x24f0('0xf')](_0x24f0('0x11'),auth[_0x24f0('0x8')](),controller[_0x24f0('0x12')]);router[_0x24f0('0xf')](_0x24f0('0xb'),auth[_0x24f0('0x8')](),controller[_0x24f0('0x13')]);router[_0x24f0('0xf')](_0x24f0('0xd'),auth[_0x24f0('0x8')](),controller[_0x24f0('0x14')]);router[_0x24f0('0x15')](_0x24f0('0x16'),auth[_0x24f0('0x8')](),controller[_0x24f0('0x17')]);router['delete']('/:id',auth[_0x24f0('0x8')](),controller[_0x24f0('0x18')]);router['delete'](_0x24f0('0xb'),auth[_0x24f0('0x8')](),controller[_0x24f0('0x19')]);router[_0x24f0('0x1a')]('/:id/resources',auth[_0x24f0('0x8')](),controller[_0x24f0('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 224bacc..cb381c0 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 _0xed65=['exports','STRING','name','getDataValue','crudPermissions','BOOLEAN','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xed65,0xd1));var _0x5ed6=function(_0x98197,_0xea7356){_0x98197=_0x98197-0x0;var _0x5d9199=_0xed65[_0x98197];return _0x5d9199;};'use strict';var Sequelize=require(_0x5ed6('0x0'));module[_0x5ed6('0x1')]={'name':{'type':Sequelize[_0x5ed6('0x2')],'allowNull':![],'unique':_0x5ed6('0x3')},'crudPermissions':{'type':Sequelize[_0x5ed6('0x2')],'set':function(_0x1c8b23){this['setDataValue']('crudPermissions',_0x1c8b23?_0x1c8b23['join'](''):[]);},'get':function(){return this[_0x5ed6('0x4')](_0x5ed6('0x5'))?this[_0x5ed6('0x4')](_0x5ed6('0x5'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x5ed6('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x5ed6('0x6')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x5ed6('0x6')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x5ed6('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x5ed6('0x6')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x5ed6('0x6')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x5ed6('0x6')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x5ed6('0x6')],'defaultValue':!![]}}; \ No newline at end of file +var _0xb8cd=['BOOLEAN','sequelize','exports','STRING','name','setDataValue','crudPermissions','join','getDataValue','split'];(function(_0x37f2a7,_0x4c881c){var _0x5d6541=function(_0x5ed84a){while(--_0x5ed84a){_0x37f2a7['push'](_0x37f2a7['shift']());}};_0x5d6541(++_0x4c881c);}(_0xb8cd,0x19b));var _0xdb8c=function(_0x7c913e,_0x504057){_0x7c913e=_0x7c913e-0x0;var _0x2e44bb=_0xb8cd[_0x7c913e];return _0x2e44bb;};'use strict';var Sequelize=require(_0xdb8c('0x0'));module[_0xdb8c('0x1')]={'name':{'type':Sequelize[_0xdb8c('0x2')],'allowNull':![],'unique':_0xdb8c('0x3')},'crudPermissions':{'type':Sequelize[_0xdb8c('0x2')],'set':function(_0x4a21a7){this[_0xdb8c('0x4')](_0xdb8c('0x5'),_0x4a21a7?_0x4a21a7[_0xdb8c('0x6')](''):[]);},'get':function(){return this[_0xdb8c('0x7')](_0xdb8c('0x5'))?this[_0xdb8c('0x7')](_0xdb8c('0x5'))[_0xdb8c('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xdb8c('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xdb8c('0x9')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xdb8c('0x9')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xdb8c('0x9')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xdb8c('0x9')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xdb8c('0x9')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xdb8c('0x9')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xdb8c('0x9')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xdb8c('0x9')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index a7bfd04..bb98b51 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 _0x78b9=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','UserProfile','rawAttributes','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','create','body','clone','params','find','omit','createdAt','updatedAt','sequelize','transaction','get','UserProfileSection','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','describe','addSections','push','removeSections','ids','getSections','enabled','includes','subsections','concat','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','Missing\x20section\x20parameter','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0xca78f1,_0x2c90c8){var _0xda435e=function(_0x375d7a){while(--_0x375d7a){_0xca78f1['push'](_0xca78f1['shift']());}};_0xda435e(++_0x2c90c8);}(_0x78b9,0x155));var _0x978b=function(_0x12f8d5,_0x2e32b6){_0x12f8d5=_0x12f8d5-0x0;var _0x4577ed=_0x78b9[_0x12f8d5];return _0x4577ed;};'use strict';var emlformat=require(_0x978b('0x0'));var rimraf=require(_0x978b('0x1'));var zipdir=require(_0x978b('0x2'));var jsonpatch=require(_0x978b('0x3'));var rp=require(_0x978b('0x4'));var moment=require('moment');var BPromise=require(_0x978b('0x5'));var Mustache=require(_0x978b('0x6'));var util=require(_0x978b('0x7'));var path=require(_0x978b('0x8'));var sox=require(_0x978b('0x9'));var csv=require(_0x978b('0xa'));var ejs=require(_0x978b('0xb'));var fs=require('fs');var fs_extra=require(_0x978b('0xc'));var _=require(_0x978b('0xd'));var squel=require(_0x978b('0xe'));var crypto=require(_0x978b('0xf'));var jsforce=require(_0x978b('0x10'));var deskjs=require(_0x978b('0x11'));var toCsv=require('to-csv');var querystring=require(_0x978b('0x12'));var Papa=require(_0x978b('0x13'));var Redis=require(_0x978b('0x14'));var authService=require(_0x978b('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x978b('0x16'));var hardwareService=require(_0x978b('0x17'));var logger=require('../../config/logger')(_0x978b('0x18'));var utils=require(_0x978b('0x19'));var config=require(_0x978b('0x1a'));var licenseUtil=require(_0x978b('0x1b'));var db=require(_0x978b('0x1c'))['db'];config[_0x978b('0x1d')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x978b('0x1e'))(new Redis(config[_0x978b('0x1d')]));require(_0x978b('0x1f'))[_0x978b('0x20')](socket);function respondWithStatusCode(_0x4703cd,_0x2791ba){_0x2791ba=_0x2791ba||0xcc;return function(_0x4df97f){if(_0x4df97f){return _0x4703cd[_0x978b('0x21')](_0x2791ba);}return _0x4703cd[_0x978b('0x22')](_0x2791ba)[_0x978b('0x23')]();};}function respondWithResult(_0x39ce1b,_0x2cf42d){_0x2cf42d=_0x2cf42d||0xc8;return function(_0x146966){if(_0x146966){return _0x39ce1b['status'](_0x2cf42d)[_0x978b('0x24')](_0x146966);}};}function respondWithFilteredResult(_0x578535,_0x15df9a){return function(_0x30f23b){if(_0x30f23b){var _0x4073d2=typeof _0x15df9a['offset']===_0x978b('0x25')&&typeof _0x15df9a[_0x978b('0x26')]===_0x978b('0x25');var _0x1c45a4=_0x30f23b['count'];var _0x1a5487=_0x4073d2?0x0:_0x15df9a[_0x978b('0x27')];var _0x72ef33=_0x4073d2?_0x30f23b[_0x978b('0x28')]:_0x15df9a['offset']+_0x15df9a['limit'];var _0x176c22;if(_0x72ef33>=_0x1c45a4){_0x72ef33=_0x1c45a4;_0x176c22=0xc8;}else{_0x176c22=0xce;}_0x578535[_0x978b('0x22')](_0x176c22);return _0x578535[_0x978b('0x29')](_0x978b('0x2a'),_0x1a5487+'-'+_0x72ef33+'/'+_0x1c45a4)['json'](_0x30f23b);}return null;};}function patchUpdates(_0x4b44ee){return function(_0x1b0047){try{jsonpatch[_0x978b('0x2b')](_0x1b0047,_0x4b44ee,!![]);}catch(_0x1280ef){return BPromise[_0x978b('0x2c')](_0x1280ef);}return _0x1b0047[_0x978b('0x2d')]();};}function saveUpdates(_0x157cb5,_0x7b6e9){return function(_0xebbf8e){if(_0xebbf8e){return _0xebbf8e[_0x978b('0x2e')](_0x157cb5)[_0x978b('0x2f')](function(_0x12401b){return _0x12401b;});}return null;};}function removeEntity(_0x491717,_0x3d5e5c){return function(_0x57cfa1){if(_0x57cfa1){return _0x57cfa1[_0x978b('0x30')]()[_0x978b('0x2f')](function(){_0x491717[_0x978b('0x22')](0xcc)[_0x978b('0x23')]();});}};}function handleEntityNotFound(_0x1ef1de,_0x5baf1d){return function(_0xc512ae){if(!_0xc512ae){_0x1ef1de[_0x978b('0x21')](0x194);}return _0xc512ae;};}function handleError(_0x3f6730,_0x500264){_0x500264=_0x500264||0x1f4;return function(_0x4b3c0c){logger[_0x978b('0x31')](_0x4b3c0c[_0x978b('0x32')]);if(_0x4b3c0c['name']){delete _0x4b3c0c[_0x978b('0x33')];}_0x3f6730[_0x978b('0x22')](_0x500264)[_0x978b('0x34')](_0x4b3c0c);};}exports['index']=function(_0x195dd3,_0x3a2b75){var _0x6764a2={},_0x28bcf4={},_0x1864a0={'count':0x0,'rows':[]};var _0x35ee18=_[_0x978b('0x35')](db[_0x978b('0x36')][_0x978b('0x37')],function(_0x144e82){return{'name':_0x144e82['fieldName'],'type':_0x144e82[_0x978b('0x38')][_0x978b('0x39')]};});_0x28bcf4[_0x978b('0x3a')]=_['map'](_0x35ee18,_0x978b('0x33'));_0x28bcf4['query']=_[_0x978b('0x3b')](_0x195dd3[_0x978b('0x3c')]);_0x28bcf4['filters']=_['intersection'](_0x28bcf4[_0x978b('0x3a')],_0x28bcf4[_0x978b('0x3c')]);_0x6764a2[_0x978b('0x3d')]=_[_0x978b('0x3e')](_0x28bcf4['model'],qs[_0x978b('0x3f')](_0x195dd3[_0x978b('0x3c')][_0x978b('0x3f')]));_0x6764a2[_0x978b('0x3d')]=_0x6764a2[_0x978b('0x3d')][_0x978b('0x40')]?_0x6764a2[_0x978b('0x3d')]:_0x28bcf4['model'];if(!_0x195dd3[_0x978b('0x3c')][_0x978b('0x41')](_0x978b('0x42'))){_0x6764a2['limit']=qs[_0x978b('0x26')](_0x195dd3[_0x978b('0x3c')][_0x978b('0x26')]);_0x6764a2[_0x978b('0x27')]=qs[_0x978b('0x27')](_0x195dd3[_0x978b('0x3c')][_0x978b('0x27')]);}_0x6764a2[_0x978b('0x43')]=qs[_0x978b('0x44')](_0x195dd3[_0x978b('0x3c')][_0x978b('0x44')]);_0x6764a2[_0x978b('0x45')]=qs[_0x978b('0x46')](_[_0x978b('0x47')](_0x195dd3[_0x978b('0x3c')],_0x28bcf4[_0x978b('0x46')]),_0x35ee18);if(_0x195dd3[_0x978b('0x3c')][_0x978b('0x48')]){_0x6764a2[_0x978b('0x45')]=_[_0x978b('0x49')](_0x6764a2[_0x978b('0x45')],{'$or':_[_0x978b('0x35')](_0x35ee18,function(_0x3c6637){if(_0x3c6637[_0x978b('0x38')]!=='VIRTUAL'){var _0x2423e8={};_0x2423e8[_0x3c6637[_0x978b('0x33')]]={'$like':'%'+_0x195dd3[_0x978b('0x3c')][_0x978b('0x48')]+'%'};return _0x2423e8;}})});}_0x6764a2=_[_0x978b('0x49')]({},_0x6764a2,_0x195dd3[_0x978b('0x4a')]);var _0x209e8f={'where':_0x6764a2['where']};return db[_0x978b('0x36')][_0x978b('0x28')](_0x209e8f)[_0x978b('0x2f')](function(_0x3ba7c7){_0x1864a0[_0x978b('0x28')]=_0x3ba7c7;if(_0x195dd3[_0x978b('0x3c')][_0x978b('0x4b')]){_0x6764a2[_0x978b('0x4c')]=[{'all':!![]}];}return db[_0x978b('0x36')][_0x978b('0x4d')](_0x6764a2);})['then'](function(_0x29cbd3){_0x1864a0[_0x978b('0x4e')]=_0x29cbd3;return _0x1864a0;})['then'](respondWithFilteredResult(_0x3a2b75,_0x6764a2))[_0x978b('0x4f')](handleError(_0x3a2b75,null));};exports[_0x978b('0x50')]=function(_0x598624,_0xdd7623){var _0x259257={'raw':![],'where':{'id':_0x598624['params']['id']}},_0x5b82d5={};_0x5b82d5[_0x978b('0x3a')]=_[_0x978b('0x3b')](db[_0x978b('0x36')][_0x978b('0x37')]);_0x5b82d5[_0x978b('0x3c')]=_['keys'](_0x598624[_0x978b('0x3c')]);_0x5b82d5['filters']=_['intersection'](_0x5b82d5[_0x978b('0x3a')],_0x5b82d5[_0x978b('0x3c')]);_0x259257[_0x978b('0x3d')]=_[_0x978b('0x3e')](_0x5b82d5[_0x978b('0x3a')],qs[_0x978b('0x3f')](_0x598624[_0x978b('0x3c')]['fields']));_0x259257['attributes']=_0x259257[_0x978b('0x3d')][_0x978b('0x40')]?_0x259257[_0x978b('0x3d')]:_0x5b82d5['model'];if(_0x598624[_0x978b('0x3c')][_0x978b('0x4b')]){_0x259257['include']=[{'all':!![]}];}_0x259257=_['merge']({},_0x259257,_0x598624[_0x978b('0x4a')]);return db[_0x978b('0x36')]['find'](_0x259257)['then'](handleEntityNotFound(_0xdd7623,null))['then'](respondWithResult(_0xdd7623,null))[_0x978b('0x4f')](handleError(_0xdd7623,null));};exports['create']=function(_0x446932,_0x298097){return db[_0x978b('0x36')][_0x978b('0x51')](_0x446932[_0x978b('0x52')],{})[_0x978b('0x2f')](respondWithResult(_0x298097,0xc9))[_0x978b('0x4f')](handleError(_0x298097,null));};exports[_0x978b('0x53')]=function(_0x55e0b7,_0x4a2399){var _0x431c85={'where':{'id':_0x55e0b7[_0x978b('0x54')]['id']}},_0x8430f2={};_0x8430f2['model']=_[_0x978b('0x3b')](db[_0x978b('0x36')][_0x978b('0x37')]);_0x431c85[_0x978b('0x3d')]=_[_0x978b('0x3e')](_0x8430f2[_0x978b('0x3a')],qs[_0x978b('0x3f')](_0x55e0b7['query']['fields']));_0x431c85['attributes']=_0x431c85[_0x978b('0x3d')][_0x978b('0x40')]?_0x431c85[_0x978b('0x3d')]:_0x8430f2[_0x978b('0x3a')];if(_0x55e0b7[_0x978b('0x3c')][_0x978b('0x4b')]){_0x431c85[_0x978b('0x4c')]=[{'all':!![]}];}_0x431c85=_['merge']({},_0x431c85,_0x55e0b7[_0x978b('0x4a')]);return db[_0x978b('0x36')][_0x978b('0x55')](_0x431c85)['then'](handleEntityNotFound(_0x4a2399,null))[_0x978b('0x2f')](function(_0x1628f1){if(_0x1628f1){var _0x15eaa5=_0x1628f1['get']({'plain':!![]});_0x15eaa5=qs[_0x978b('0x56')](_0x15eaa5,['id',_0x978b('0x57'),'updatedAt','crudPermissions']);_0x55e0b7[_0x978b('0x52')]=_['omit'](_0x55e0b7[_0x978b('0x52')],['id',_0x978b('0x57'),_0x978b('0x58')]);return db[_0x978b('0x59')][_0x978b('0x5a')](function(_0x8af273){return db['UserProfile'][_0x978b('0x51')](_[_0x978b('0x49')](_0x15eaa5,_0x55e0b7[_0x978b('0x52')]),{'include':_0x55e0b7[_0x978b('0x3c')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x8af273})[_0x978b('0x2f')](function(_0x170fc3){var _0x1e4651=_0x170fc3[_0x978b('0x5b')]({'plain':!![]});return db[_0x978b('0x5c')]['findAll']({'where':{'userProfileId':_0x55e0b7[_0x978b('0x54')]['id']},'raw':!![]})[_0x978b('0x2f')](function(_0x32d7d4){if(_0x32d7d4){return BPromise['each'](_0x32d7d4,function(_0x51fd44){return new BPromise(function(_0x462ecb,_0x5b22d6){if(_0x51fd44[_0x978b('0x5d')]===null||_0x51fd44[_0x978b('0x5d')]===0x1)_0x462ecb(null);return db[_0x978b('0x5e')]['findAll']({'where':{'sectionId':_0x51fd44['id']},'raw':!![]})['then'](function(_0x5665b5){var _0x3043d6=_[_0x978b('0x35')](_0x5665b5,function(_0x419902){return qs[_0x978b('0x56')](_0x419902,['id',_0x978b('0x57'),_0x978b('0x58'),_0x978b('0x5f')]);});_0x462ecb(_0x3043d6);})['catch'](function(_0x164766){_0x5b22d6(_0x164766);});})[_0x978b('0x2f')](function(_0xba43d0){var _0x55eff7=qs[_0x978b('0x56')](_0x51fd44,['id',_0x978b('0x57'),_0x978b('0x58')]);_0x55eff7[_0x978b('0x60')]=_0x1e4651['id'];if(_0xba43d0)_0x55eff7[_0x978b('0x61')]=_0xba43d0;return _0x55eff7;})[_0x978b('0x2f')](function(_0x188761){return db['UserProfileSection']['create'](_0x188761,{'include':[{'model':db[_0x978b('0x5e')],'as':'Resources'}],'raw':!![],'transaction':_0x8af273});});})['then'](function(){return _0x1e4651;});}});});});}})[_0x978b('0x2f')](respondWithResult(_0x4a2399,0xc9))[_0x978b('0x4f')](handleError(_0x4a2399,null));};exports[_0x978b('0x2e')]=function(_0x30f909,_0x5cb26e){if(_0x30f909[_0x978b('0x52')]['id']){delete _0x30f909['body']['id'];}return db['UserProfile'][_0x978b('0x55')]({'where':{'id':_0x30f909[_0x978b('0x54')]['id']}})[_0x978b('0x2f')](handleEntityNotFound(_0x5cb26e,null))[_0x978b('0x2f')](saveUpdates(_0x30f909[_0x978b('0x52')],null))[_0x978b('0x2f')](respondWithResult(_0x5cb26e,null))[_0x978b('0x4f')](handleError(_0x5cb26e,null));};exports[_0x978b('0x30')]=function(_0x3f1982,_0x40efe2){return db[_0x978b('0x36')][_0x978b('0x55')]({'where':{'id':_0x3f1982[_0x978b('0x54')]['id']}})['then'](handleEntityNotFound(_0x40efe2,null))[_0x978b('0x2f')](removeEntity(_0x40efe2,null))[_0x978b('0x4f')](handleError(_0x40efe2,null));};exports[_0x978b('0x62')]=function(_0x281d40,_0x5c06e5){return db['UserProfile'][_0x978b('0x62')]()[_0x978b('0x2f')](respondWithResult(_0x5c06e5,null))[_0x978b('0x4f')](handleError(_0x5c06e5,null));};exports[_0x978b('0x63')]=function(_0x4a8fc2,_0x333aed){var _0x5beb64=_0x4a8fc2[_0x978b('0x52')];return db[_0x978b('0x36')]['find']({'where':{'id':_0x4a8fc2[_0x978b('0x54')]['id']}})[_0x978b('0x2f')](handleEntityNotFound(_0x333aed,null))[_0x978b('0x2f')](function(_0x5d6b31){if(_0x5d6b31){return db[_0x978b('0x59')][_0x978b('0x5a')](function(_0xe01f80){return db[_0x978b('0x5c')][_0x978b('0x30')]({'where':{'userProfileId':_0x4a8fc2['params']['id'],'sectionId':_[_0x978b('0x35')](_0x5beb64,function(_0x45d3ce){return _0x45d3ce[_0x978b('0x5f')];})},'transaction':_0xe01f80})[_0x978b('0x2f')](function(){var _0x4ef7d9=_['map'](_0x5beb64,function(_0x4d582f){_0x4d582f[_0x978b('0x60')]=_0x4a8fc2[_0x978b('0x54')]['id'];return _0x4d582f;});var _0x25eee5=[];return BPromise['each'](_0x4ef7d9,function(_0x556cf0){return db[_0x978b('0x5c')]['create'](_0x556cf0,{'include':[{'model':db[_0x978b('0x5e')],'as':_0x978b('0x61')}],'raw':!![],'transaction':_0xe01f80})['then'](function(_0x5d0df0){_0x25eee5[_0x978b('0x64')](_0x5d0df0['get']({'plain':!![]}));});})['then'](function(){return _0x25eee5;});});});}})[_0x978b('0x2f')](function(_0x112dba){return _0x112dba;})['then'](respondWithResult(_0x333aed,null))['catch'](handleError(_0x333aed,null));};exports[_0x978b('0x65')]=function(_0x82ddae,_0x32b29b){var _0x541ee3;return db[_0x978b('0x36')][_0x978b('0x55')]({'where':{'id':_0x82ddae[_0x978b('0x54')]['id']},'attributes':['id','name']})['then'](handleEntityNotFound(_0x32b29b,null))['then'](function(_0x590a74){if(_0x590a74){_0x541ee3=_0x590a74;return db[_0x978b('0x5c')][_0x978b('0x30')]({'where':{'userProfileId':_0x82ddae['params']['id'],'sectionId':_0x82ddae[_0x978b('0x3c')][_0x978b('0x66')]}});}})[_0x978b('0x2f')](function(){return _0x541ee3;})[_0x978b('0x2f')](respondWithStatusCode(_0x32b29b,null))[_0x978b('0x4f')](handleError(_0x32b29b,null));};exports[_0x978b('0x67')]=function(_0x288c2c,_0x54fd60){var _0x5e7d99=[];var _0x47be24=[];return db['UserProfileSection'][_0x978b('0x4d')]({'where':{'userProfileId':_0x288c2c[_0x978b('0x54')]['id']},'raw':!![]})['then'](function(_0x56b6b0){_0x5e7d99=_[_0x978b('0x48')](_0x56b6b0,function(_0x228eb8){return _0x228eb8[_0x978b('0x68')]===0x1||_['includes']([0x3eb,0x709],_0x228eb8['sectionId']);});if(!_['isEmpty'](_0x5e7d99)){return _[_0x978b('0x35')](_0x5e7d99,function(_0x2bfd1e){return _0x2bfd1e[_0x978b('0x5f')];});}else{return;}})[_0x978b('0x2f')](function(_0x16b053){if(_0x16b053)_0x47be24=_0x16b053;if(_[_0x978b('0x69')](_0x47be24,0x64)){var _0xc56816=_[_0x978b('0x55')](_0x5e7d99,{'sectionId':0x64});return hasDefaultDashboard(_0xc56816)[_0x978b('0x2f')](function(_0x4083cc){return _[_0x978b('0x35')](_0x5e7d99,function(_0x4b9435){if(_0x4b9435[_0x978b('0x5f')]===0x64){_0x4b9435[_0x978b('0x6a')]=_0x4083cc;}return _0x4b9435;});});}else{return;}})[_0x978b('0x2f')](function(_0x3264fc){if(_0x3264fc)_0x5e7d99=_0x3264fc;if(_[_0x978b('0x69')](_0x47be24,0x3eb)){var _0x4664d4=_[_0x978b('0x55')](_0x5e7d99,{'sectionId':0x3eb});return getCustomDashboards(_0x4664d4)['then'](function(_0x1efbb9){return _[_0x978b('0x35')](_0x5e7d99,function(_0xe21023){if(_0x4664d4[_0x978b('0x68')]){if(_0xe21023[_0x978b('0x5f')]===0x3eb){_0xe21023[_0x978b('0x6a')]=_0x1efbb9;}}else{if(_0xe21023['sectionId']===0x64){if(!_0xe21023[_0x978b('0x6a')]){_0xe21023['subsections']=[];}_0xe21023[_0x978b('0x6a')]=_0xe21023[_0x978b('0x6a')][_0x978b('0x6b')](_0x1efbb9);}}return _0xe21023;});});}else{return;}})['then'](function(_0x131e58){if(_0x131e58)_0x5e7d99=_0x131e58;if(_['includes'](_0x47be24,0x709)){var _0x492d1f=_['find'](_0x5e7d99,{'sectionId':0x709});return getPlugins(_0x492d1f)[_0x978b('0x2f')](function(_0x18f28f){if(_0x492d1f[_0x978b('0x68')]){return _[_0x978b('0x35')](_0x5e7d99,function(_0x20263b){if(_0x20263b[_0x978b('0x5f')]===0x709){_0x20263b[_0x978b('0x6a')]=_0x18f28f;}return _0x20263b;});}else{var _0x185919={'sectionId':0x76c,'enabled':0x1,'subsections':_0x18f28f};var _0x3966a5=_[_0x978b('0x35')](_0x5e7d99);_0x3966a5[_0x978b('0x64')](_0x185919);return _0x3966a5;}});}else{return;}})[_0x978b('0x2f')](function(_0x2bf9a7){if(_0x2bf9a7)_0x5e7d99=_0x2bf9a7;return _[_0x978b('0x48')](_0x5e7d99,[_0x978b('0x68'),0x1]);})[_0x978b('0x2f')](respondWithResult(_0x54fd60,null))[_0x978b('0x4f')](handleError(_0x54fd60,null));};function hasDefaultDashboard(_0x1f4a12){var _0x3e880a=[0x65];return new BPromise(function(_0x458f71,_0x573e54){try{if(_0x1f4a12[_0x978b('0x5d')]){_0x458f71(_0x3e880a);}else{return db['UserProfileResource'][_0x978b('0x6c')]({'where':{'sectionId':_0x1f4a12['id']},'raw':!![]})[_0x978b('0x2f')](function(_0x248d47){_0x248d47?_0x458f71(_0x3e880a):_0x458f71();});}}catch(_0x282457){_0x573e54(_0x282457);}});}function getCustomDashboards(_0xbb9883){var _0x13b91c=[];return new BPromise(function(_0x2fc03c,_0x3e4ff){try{if(_0xbb9883[_0x978b('0x5d')]){return db[_0x978b('0x6d')]['findAll']({'raw':!![]})['then'](function(_0x10f636){_0x10f636[_0x978b('0x6e')](function(_0xf66c92){_0x13b91c[_0x978b('0x64')](_0xf66c92['id']+0x1869f);});_0x2fc03c(_0x13b91c);});}else{return db[_0x978b('0x5e')][_0x978b('0x4d')]({'where':{'sectionId':_0xbb9883['id']},'raw':!![]})[_0x978b('0x2f')](function(_0x194c5e){_0x194c5e[_0x978b('0x6e')](function(_0x4bc3de){_0x13b91c['push'](_0x4bc3de[_0x978b('0x6f')]+0x1869f);});_0x2fc03c(_0x13b91c);});}}catch(_0x57dbac){_0x3e4ff(_0x57dbac);}});}function getPlugins(_0xcccd5f){var _0x5b5499=[];return new BPromise(function(_0x426049,_0x3dee7f){try{if(_0xcccd5f[_0x978b('0x5d')]){return db[_0x978b('0x70')]['findAll']({'raw':!![]})[_0x978b('0x2f')](function(_0x50b1c1){_0x50b1c1[_0x978b('0x6e')](function(_0x40b2f4){_0x5b5499['push'](_0x40b2f4['id']+0x15b38);});_0x426049(_0x5b5499);});}else{return db[_0x978b('0x5e')][_0x978b('0x4d')]({'where':{'sectionId':_0xcccd5f['id']},'raw':!![]})[_0x978b('0x2f')](function(_0x3324d9){_0x3324d9[_0x978b('0x6e')](function(_0x355db2){_0x5b5499[_0x978b('0x64')](_0x355db2['resourceId']+0x15b38);});_0x426049(_0x5b5499);});}}catch(_0x212256){_0x3dee7f(_0x212256);}});}exports[_0x978b('0x71')]=function(_0x434b69,_0x474adb){return db[_0x978b('0x36')][_0x978b('0x55')]({'where':{'id':_0x434b69[_0x978b('0x54')]['id']}})[_0x978b('0x2f')](handleEntityNotFound(_0x474adb,null))[_0x978b('0x2f')](function(_0x3a0d10){if(_0x3a0d10){return db[_0x978b('0x59')]['transaction'](function(_0xc714d1){return db[_0x978b('0x5c')][_0x978b('0x4d')]({'where':{'userProfileId':_0x434b69[_0x978b('0x54')]['id']},'attributes':['id'],'raw':!![]})[_0x978b('0x2f')](function(_0x28a5cf){if(_0x28a5cf){return db[_0x978b('0x5c')]['destroy']({'where':{'userProfileId':_0x434b69[_0x978b('0x54')]['id'],'id':_[_0x978b('0x35')](_0x28a5cf,function(_0x3c9f51){return _0x3c9f51['id'];})},'transaction':_0xc714d1});}})[_0x978b('0x2f')](function(_0x2e3da9){var _0xe0004f=_[_0x978b('0x35')](_0x434b69[_0x978b('0x52')],function(_0x59986f){_0x59986f[_0x978b('0x60')]=_0x434b69[_0x978b('0x54')]['id'];return _0x59986f;});return db[_0x978b('0x5c')][_0x978b('0x72')](_0xe0004f,{'raw':!![],'transaction':_0xc714d1});})[_0x978b('0x2f')](function(_0x1c2adb){var _0x31c2f6=_['filter'](_[_0x978b('0x35')](_0x1c2adb,function(_0x676bf7){return _0x676bf7[_0x978b('0x5b')]({'plain':!![]});}),{'includeAll':![]});if(_0x31c2f6){return db[_0x978b('0x5c')][_0x978b('0x4d')]({'where':{'userProfileId':_0x434b69[_0x978b('0x54')]['id'],'sectionId':_['map'](_0x31c2f6,function(_0x208b9c){return _0x208b9c[_0x978b('0x5f')];})},'attributes':['id',_0x978b('0x5f')],'raw':!![]})[_0x978b('0x2f')](function(_0x49bc3c){var _0x5078a7=_[_0x978b('0x35')](_0x434b69['body'],function(_0xa0a0bc){_0xa0a0bc['userProfileId']=_0x434b69[_0x978b('0x54')]['id'];return _0xa0a0bc;});return db['UserProfileResource'][_0x978b('0x72')](_0x5078a7,{'raw':!![],'transaction':_0xc714d1});});}})['catch'](handleError(_0x474adb,null));});}})[_0x978b('0x2f')](function(_0x2419fc){var _0x52967d=_[_0x978b('0x35')](_0x2419fc,function(_0xa831cd){return _0xa831cd['get']({'plain':!![]});});})['then'](respondWithResult(_0x474adb,null))[_0x978b('0x4f')](handleError(_0x474adb,null));};exports['removeResources']=function(_0x4f129e,_0x26f1f8,_0x24bb61){return db[_0x978b('0x36')][_0x978b('0x55')]({'where':{'id':_0x4f129e[_0x978b('0x54')]['id']}})[_0x978b('0x2f')](handleEntityNotFound(_0x26f1f8,null))[_0x978b('0x2f')](function(_0x1ee890){if(_0x1ee890){return _0x1ee890[_0x978b('0x73')](_0x4f129e[_0x978b('0x3c')][_0x978b('0x66')]);}})[_0x978b('0x2f')](respondWithStatusCode(_0x26f1f8,null))[_0x978b('0x4f')](handleError(_0x26f1f8,null));};exports[_0x978b('0x74')]=function(_0x334526,_0x417c7b){var _0x21e610={};if(!_0x334526[_0x978b('0x3c')]['section'])throw new Error(_0x978b('0x75'));if(!_0x334526[_0x978b('0x3c')][_0x978b('0x41')](_0x978b('0x42'))){_0x21e610['limit']=qs[_0x978b('0x26')](_0x334526[_0x978b('0x3c')][_0x978b('0x26')]);_0x21e610[_0x978b('0x27')]=qs[_0x978b('0x27')](_0x334526['query'][_0x978b('0x27')]);}return db[_0x978b('0x36')][_0x978b('0x55')]({'where':{'id':_0x334526['params']['id']}})['then'](function(_0x2f5457){if(!_0x2f5457)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x334526[_0x978b('0x54')]['id']);return db[_0x978b('0x36')][_0x978b('0x74')](_0x334526);})[_0x978b('0x2f')](respondWithFilteredResult(_0x417c7b,_0x21e610))[_0x978b('0x4f')](handleError(_0x417c7b,null));}; \ No newline at end of file +var _0xe893=['sendStatus','error','stack','name','send','UserProfile','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','find','catch','create','clone','rawAttributes','get','omit','createdAt','updatedAt','crudPermissions','transaction','body','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','describe','sequelize','push','removeSections','enabled','includes','subsections','concat','findOne','forEach','resourceId','Plugin','addResources','bulkCreate','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','destroy','then'];(function(_0xe1269d,_0x57b7c3){var _0x261ca1=function(_0x13b234){while(--_0x13b234){_0xe1269d['push'](_0xe1269d['shift']());}};_0x261ca1(++_0x57b7c3);}(_0xe893,0x134));var _0x3e89=function(_0xc3e938,_0x11b0bf){_0xc3e938=_0xc3e938-0x0;var _0x5360ca=_0xe893[_0xc3e938];return _0x5360ca;};'use strict';var emlformat=require(_0x3e89('0x0'));var rimraf=require(_0x3e89('0x1'));var zipdir=require(_0x3e89('0x2'));var jsonpatch=require(_0x3e89('0x3'));var rp=require(_0x3e89('0x4'));var moment=require(_0x3e89('0x5'));var BPromise=require(_0x3e89('0x6'));var Mustache=require(_0x3e89('0x7'));var util=require('util');var path=require(_0x3e89('0x8'));var sox=require(_0x3e89('0x9'));var csv=require(_0x3e89('0xa'));var ejs=require(_0x3e89('0xb'));var fs=require('fs');var fs_extra=require(_0x3e89('0xc'));var _=require('lodash');var squel=require(_0x3e89('0xd'));var crypto=require(_0x3e89('0xe'));var jsforce=require(_0x3e89('0xf'));var deskjs=require(_0x3e89('0x10'));var toCsv=require(_0x3e89('0xa'));var querystring=require('querystring');var Papa=require(_0x3e89('0x11'));var Redis=require(_0x3e89('0x12'));var authService=require(_0x3e89('0x13'));var qs=require(_0x3e89('0x14'));var as=require(_0x3e89('0x15'));var hardwareService=require(_0x3e89('0x16'));var logger=require(_0x3e89('0x17'))('api');var utils=require(_0x3e89('0x18'));var config=require(_0x3e89('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x3e89('0x1a'))['db'];config[_0x3e89('0x1b')]=_[_0x3e89('0x1c')](config['redis'],{'host':_0x3e89('0x1d'),'port':0x18eb});var socket=require(_0x3e89('0x1e'))(new Redis(config['redis']));require(_0x3e89('0x1f'))[_0x3e89('0x20')](socket);function respondWithStatusCode(_0x4bc434,_0xabac5d){_0xabac5d=_0xabac5d||0xcc;return function(_0x5d11e0){if(_0x5d11e0){return _0x4bc434['sendStatus'](_0xabac5d);}return _0x4bc434[_0x3e89('0x21')](_0xabac5d)[_0x3e89('0x22')]();};}function respondWithResult(_0xbd48e8,_0x374413){_0x374413=_0x374413||0xc8;return function(_0xf50b96){if(_0xf50b96){return _0xbd48e8['status'](_0x374413)[_0x3e89('0x23')](_0xf50b96);}};}function respondWithFilteredResult(_0x4dbb7b,_0x1b16f4){return function(_0x526fd3){if(_0x526fd3){var _0x16e64c=typeof _0x1b16f4[_0x3e89('0x24')]===_0x3e89('0x25')&&typeof _0x1b16f4[_0x3e89('0x26')]===_0x3e89('0x25');var _0x47feca=_0x526fd3['count'];var _0x3a1eb4=_0x16e64c?0x0:_0x1b16f4[_0x3e89('0x24')];var _0xd5bc8f=_0x16e64c?_0x526fd3['count']:_0x1b16f4['offset']+_0x1b16f4[_0x3e89('0x26')];var _0x58b38a;if(_0xd5bc8f>=_0x47feca){_0xd5bc8f=_0x47feca;_0x58b38a=0xc8;}else{_0x58b38a=0xce;}_0x4dbb7b[_0x3e89('0x21')](_0x58b38a);return _0x4dbb7b[_0x3e89('0x27')](_0x3e89('0x28'),_0x3a1eb4+'-'+_0xd5bc8f+'/'+_0x47feca)['json'](_0x526fd3);}return null;};}function patchUpdates(_0x3bb1de){return function(_0x406c14){try{jsonpatch[_0x3e89('0x29')](_0x406c14,_0x3bb1de,!![]);}catch(_0x511644){return BPromise['reject'](_0x511644);}return _0x406c14[_0x3e89('0x2a')]();};}function saveUpdates(_0x448bd3,_0x48e6ee){return function(_0x8711ed){if(_0x8711ed){return _0x8711ed[_0x3e89('0x2b')](_0x448bd3)['then'](function(_0x394948){return _0x394948;});}return null;};}function removeEntity(_0x370208,_0x314eee){return function(_0x4c476b){if(_0x4c476b){return _0x4c476b[_0x3e89('0x2c')]()[_0x3e89('0x2d')](function(){_0x370208[_0x3e89('0x21')](0xcc)[_0x3e89('0x22')]();});}};}function handleEntityNotFound(_0x441cd4,_0x527478){return function(_0x80c58e){if(!_0x80c58e){_0x441cd4[_0x3e89('0x2e')](0x194);}return _0x80c58e;};}function handleError(_0x560eff,_0x27fe04){_0x27fe04=_0x27fe04||0x1f4;return function(_0x43f344){logger[_0x3e89('0x2f')](_0x43f344[_0x3e89('0x30')]);if(_0x43f344[_0x3e89('0x31')]){delete _0x43f344[_0x3e89('0x31')];}_0x560eff[_0x3e89('0x21')](_0x27fe04)[_0x3e89('0x32')](_0x43f344);};}exports['index']=function(_0x4e8646,_0x44a6ef){var _0x6201e6={},_0x4643fb={},_0x8f7765={'count':0x0,'rows':[]};var _0x44a76b=_['map'](db[_0x3e89('0x33')]['rawAttributes'],function(_0x570555){return{'name':_0x570555[_0x3e89('0x34')],'type':_0x570555[_0x3e89('0x35')][_0x3e89('0x36')]};});_0x4643fb[_0x3e89('0x37')]=_[_0x3e89('0x38')](_0x44a76b,_0x3e89('0x31'));_0x4643fb[_0x3e89('0x39')]=_[_0x3e89('0x3a')](_0x4e8646[_0x3e89('0x39')]);_0x4643fb[_0x3e89('0x3b')]=_[_0x3e89('0x3c')](_0x4643fb['model'],_0x4643fb['query']);_0x6201e6[_0x3e89('0x3d')]=_[_0x3e89('0x3c')](_0x4643fb[_0x3e89('0x37')],qs[_0x3e89('0x3e')](_0x4e8646[_0x3e89('0x39')]['fields']));_0x6201e6[_0x3e89('0x3d')]=_0x6201e6[_0x3e89('0x3d')][_0x3e89('0x3f')]?_0x6201e6[_0x3e89('0x3d')]:_0x4643fb[_0x3e89('0x37')];if(!_0x4e8646[_0x3e89('0x39')][_0x3e89('0x40')](_0x3e89('0x41'))){_0x6201e6[_0x3e89('0x26')]=qs['limit'](_0x4e8646['query']['limit']);_0x6201e6['offset']=qs[_0x3e89('0x24')](_0x4e8646[_0x3e89('0x39')][_0x3e89('0x24')]);}_0x6201e6[_0x3e89('0x42')]=qs[_0x3e89('0x43')](_0x4e8646[_0x3e89('0x39')]['sort']);_0x6201e6['where']=qs[_0x3e89('0x3b')](_[_0x3e89('0x44')](_0x4e8646[_0x3e89('0x39')],_0x4643fb[_0x3e89('0x3b')]),_0x44a76b);if(_0x4e8646['query'][_0x3e89('0x45')]){_0x6201e6[_0x3e89('0x46')]=_[_0x3e89('0x47')](_0x6201e6[_0x3e89('0x46')],{'$or':_[_0x3e89('0x38')](_0x44a76b,function(_0x4938d4){if(_0x4938d4[_0x3e89('0x35')]!==_0x3e89('0x48')){var _0x57ce58={};_0x57ce58[_0x4938d4[_0x3e89('0x31')]]={'$like':'%'+_0x4e8646[_0x3e89('0x39')]['filter']+'%'};return _0x57ce58;}})});}_0x6201e6=_[_0x3e89('0x47')]({},_0x6201e6,_0x4e8646[_0x3e89('0x49')]);var _0x3c6d56={'where':_0x6201e6[_0x3e89('0x46')]};return db[_0x3e89('0x33')][_0x3e89('0x4a')](_0x3c6d56)['then'](function(_0x42e821){_0x8f7765[_0x3e89('0x4a')]=_0x42e821;if(_0x4e8646[_0x3e89('0x39')][_0x3e89('0x4b')]){_0x6201e6[_0x3e89('0x4c')]=[{'all':!![]}];}return db[_0x3e89('0x33')][_0x3e89('0x4d')](_0x6201e6);})[_0x3e89('0x2d')](function(_0x6950d6){_0x8f7765[_0x3e89('0x4e')]=_0x6950d6;return _0x8f7765;})[_0x3e89('0x2d')](respondWithFilteredResult(_0x44a6ef,_0x6201e6))['catch'](handleError(_0x44a6ef,null));};exports[_0x3e89('0x4f')]=function(_0x332752,_0x121753){var _0x59e04a={'raw':![],'where':{'id':_0x332752[_0x3e89('0x50')]['id']}},_0xeeaa12={};_0xeeaa12['model']=_[_0x3e89('0x3a')](db[_0x3e89('0x33')]['rawAttributes']);_0xeeaa12[_0x3e89('0x39')]=_[_0x3e89('0x3a')](_0x332752['query']);_0xeeaa12['filters']=_[_0x3e89('0x3c')](_0xeeaa12[_0x3e89('0x37')],_0xeeaa12[_0x3e89('0x39')]);_0x59e04a[_0x3e89('0x3d')]=_[_0x3e89('0x3c')](_0xeeaa12[_0x3e89('0x37')],qs['fields'](_0x332752[_0x3e89('0x39')][_0x3e89('0x3e')]));_0x59e04a['attributes']=_0x59e04a[_0x3e89('0x3d')]['length']?_0x59e04a['attributes']:_0xeeaa12[_0x3e89('0x37')];if(_0x332752[_0x3e89('0x39')][_0x3e89('0x4b')]){_0x59e04a[_0x3e89('0x4c')]=[{'all':!![]}];}_0x59e04a=_[_0x3e89('0x47')]({},_0x59e04a,_0x332752['options']);return db[_0x3e89('0x33')][_0x3e89('0x51')](_0x59e04a)[_0x3e89('0x2d')](handleEntityNotFound(_0x121753,null))[_0x3e89('0x2d')](respondWithResult(_0x121753,null))[_0x3e89('0x52')](handleError(_0x121753,null));};exports[_0x3e89('0x53')]=function(_0x524043,_0xf0118){return db['UserProfile'][_0x3e89('0x53')](_0x524043['body'],{})[_0x3e89('0x2d')](respondWithResult(_0xf0118,0xc9))[_0x3e89('0x52')](handleError(_0xf0118,null));};exports[_0x3e89('0x54')]=function(_0x3f7326,_0x454607){var _0x38fac7={'where':{'id':_0x3f7326[_0x3e89('0x50')]['id']}},_0x40316f={};_0x40316f[_0x3e89('0x37')]=_[_0x3e89('0x3a')](db[_0x3e89('0x33')][_0x3e89('0x55')]);_0x38fac7['attributes']=_['intersection'](_0x40316f[_0x3e89('0x37')],qs[_0x3e89('0x3e')](_0x3f7326[_0x3e89('0x39')][_0x3e89('0x3e')]));_0x38fac7['attributes']=_0x38fac7[_0x3e89('0x3d')][_0x3e89('0x3f')]?_0x38fac7[_0x3e89('0x3d')]:_0x40316f[_0x3e89('0x37')];if(_0x3f7326[_0x3e89('0x39')][_0x3e89('0x4b')]){_0x38fac7[_0x3e89('0x4c')]=[{'all':!![]}];}_0x38fac7=_[_0x3e89('0x47')]({},_0x38fac7,_0x3f7326[_0x3e89('0x49')]);return db[_0x3e89('0x33')][_0x3e89('0x51')](_0x38fac7)[_0x3e89('0x2d')](handleEntityNotFound(_0x454607,null))[_0x3e89('0x2d')](function(_0x29cb27){if(_0x29cb27){var _0x193013=_0x29cb27[_0x3e89('0x56')]({'plain':!![]});_0x193013=qs[_0x3e89('0x57')](_0x193013,['id',_0x3e89('0x58'),_0x3e89('0x59'),_0x3e89('0x5a')]);_0x3f7326['body']=_[_0x3e89('0x57')](_0x3f7326['body'],['id',_0x3e89('0x58'),_0x3e89('0x59')]);return db['sequelize'][_0x3e89('0x5b')](function(_0x7bb0a){return db[_0x3e89('0x33')][_0x3e89('0x53')](_[_0x3e89('0x47')](_0x193013,_0x3f7326[_0x3e89('0x5c')]),{'include':_0x3f7326['query']['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x7bb0a})[_0x3e89('0x2d')](function(_0x3ee0c2){var _0x35f1d2=_0x3ee0c2[_0x3e89('0x56')]({'plain':!![]});return db[_0x3e89('0x5d')][_0x3e89('0x4d')]({'where':{'userProfileId':_0x3f7326[_0x3e89('0x50')]['id']},'raw':!![]})[_0x3e89('0x2d')](function(_0x11407f){if(_0x11407f){return BPromise[_0x3e89('0x5e')](_0x11407f,function(_0x447482){return new BPromise(function(_0x329b45,_0x50b4d6){if(_0x447482[_0x3e89('0x5f')]===null||_0x447482[_0x3e89('0x5f')]===0x1)_0x329b45(null);return db[_0x3e89('0x60')][_0x3e89('0x4d')]({'where':{'sectionId':_0x447482['id']},'raw':!![]})['then'](function(_0xa8b420){var _0x1ada7c=_[_0x3e89('0x38')](_0xa8b420,function(_0x16d072){return qs[_0x3e89('0x57')](_0x16d072,['id','createdAt',_0x3e89('0x59'),_0x3e89('0x61')]);});_0x329b45(_0x1ada7c);})[_0x3e89('0x52')](function(_0x3fc67e){_0x50b4d6(_0x3fc67e);});})['then'](function(_0x10572e){var _0xb6381=qs[_0x3e89('0x57')](_0x447482,['id',_0x3e89('0x58'),'updatedAt']);_0xb6381[_0x3e89('0x62')]=_0x35f1d2['id'];if(_0x10572e)_0xb6381[_0x3e89('0x63')]=_0x10572e;return _0xb6381;})[_0x3e89('0x2d')](function(_0x47c476){return db['UserProfileSection'][_0x3e89('0x53')](_0x47c476,{'include':[{'model':db[_0x3e89('0x60')],'as':_0x3e89('0x63')}],'raw':!![],'transaction':_0x7bb0a});});})[_0x3e89('0x2d')](function(){return _0x35f1d2;});}});});});}})[_0x3e89('0x2d')](respondWithResult(_0x454607,0xc9))[_0x3e89('0x52')](handleError(_0x454607,null));};exports[_0x3e89('0x2b')]=function(_0x27d2b1,_0x219790){if(_0x27d2b1[_0x3e89('0x5c')]['id']){delete _0x27d2b1[_0x3e89('0x5c')]['id'];}return db[_0x3e89('0x33')][_0x3e89('0x51')]({'where':{'id':_0x27d2b1[_0x3e89('0x50')]['id']}})[_0x3e89('0x2d')](handleEntityNotFound(_0x219790,null))[_0x3e89('0x2d')](saveUpdates(_0x27d2b1[_0x3e89('0x5c')],null))[_0x3e89('0x2d')](respondWithResult(_0x219790,null))[_0x3e89('0x52')](handleError(_0x219790,null));};exports['destroy']=function(_0xf771ac,_0x418a47){return db[_0x3e89('0x33')][_0x3e89('0x51')]({'where':{'id':_0xf771ac[_0x3e89('0x50')]['id']}})[_0x3e89('0x2d')](handleEntityNotFound(_0x418a47,null))[_0x3e89('0x2d')](removeEntity(_0x418a47,null))[_0x3e89('0x52')](handleError(_0x418a47,null));};exports[_0x3e89('0x64')]=function(_0x394d76,_0x4afe69){return db['UserProfile'][_0x3e89('0x64')]()[_0x3e89('0x2d')](respondWithResult(_0x4afe69,null))[_0x3e89('0x52')](handleError(_0x4afe69,null));};exports['addSections']=function(_0xa61ac8,_0x5b76de){var _0x41d747=_0xa61ac8[_0x3e89('0x5c')];return db[_0x3e89('0x33')]['find']({'where':{'id':_0xa61ac8['params']['id']}})['then'](handleEntityNotFound(_0x5b76de,null))[_0x3e89('0x2d')](function(_0x59ff36){if(_0x59ff36){return db[_0x3e89('0x65')]['transaction'](function(_0x53f0a3){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0xa61ac8[_0x3e89('0x50')]['id'],'sectionId':_[_0x3e89('0x38')](_0x41d747,function(_0x480c1f){return _0x480c1f[_0x3e89('0x61')];})},'transaction':_0x53f0a3})[_0x3e89('0x2d')](function(){var _0x455b87=_[_0x3e89('0x38')](_0x41d747,function(_0x1222e0){_0x1222e0[_0x3e89('0x62')]=_0xa61ac8['params']['id'];return _0x1222e0;});var _0x5c29cc=[];return BPromise[_0x3e89('0x5e')](_0x455b87,function(_0x5b9dac){return db[_0x3e89('0x5d')]['create'](_0x5b9dac,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0x53f0a3})['then'](function(_0x398792){_0x5c29cc[_0x3e89('0x66')](_0x398792['get']({'plain':!![]}));});})['then'](function(){return _0x5c29cc;});});});}})[_0x3e89('0x2d')](function(_0x44d0da){return _0x44d0da;})[_0x3e89('0x2d')](respondWithResult(_0x5b76de,null))['catch'](handleError(_0x5b76de,null));};exports[_0x3e89('0x67')]=function(_0x28b2bf,_0x1b7f49){var _0x9fc489;return db[_0x3e89('0x33')]['find']({'where':{'id':_0x28b2bf[_0x3e89('0x50')]['id']},'attributes':['id',_0x3e89('0x31')]})[_0x3e89('0x2d')](handleEntityNotFound(_0x1b7f49,null))[_0x3e89('0x2d')](function(_0x44b113){if(_0x44b113){_0x9fc489=_0x44b113;return db['UserProfileSection'][_0x3e89('0x2c')]({'where':{'userProfileId':_0x28b2bf[_0x3e89('0x50')]['id'],'sectionId':_0x28b2bf[_0x3e89('0x39')]['ids']}});}})[_0x3e89('0x2d')](function(){return _0x9fc489;})[_0x3e89('0x2d')](respondWithStatusCode(_0x1b7f49,null))[_0x3e89('0x52')](handleError(_0x1b7f49,null));};exports['getSections']=function(_0x2b49d3,_0xdbabcb){var _0x32bc02=[];var _0x33f54a=[];return db[_0x3e89('0x5d')][_0x3e89('0x4d')]({'where':{'userProfileId':_0x2b49d3[_0x3e89('0x50')]['id']},'raw':!![]})[_0x3e89('0x2d')](function(_0x1f9974){_0x32bc02=_[_0x3e89('0x45')](_0x1f9974,function(_0x54384c){return _0x54384c[_0x3e89('0x68')]===0x1||_[_0x3e89('0x69')]([0x3eb,0x709],_0x54384c[_0x3e89('0x61')]);});if(!_['isEmpty'](_0x32bc02)){return _['map'](_0x32bc02,function(_0x2f5247){return _0x2f5247['sectionId'];});}else{return;}})[_0x3e89('0x2d')](function(_0xcbe9d6){if(_0xcbe9d6)_0x33f54a=_0xcbe9d6;if(_['includes'](_0x33f54a,0x64)){var _0x399626=_[_0x3e89('0x51')](_0x32bc02,{'sectionId':0x64});return hasDefaultDashboard(_0x399626)[_0x3e89('0x2d')](function(_0x2a6c4a){return _[_0x3e89('0x38')](_0x32bc02,function(_0x436c34){if(_0x436c34[_0x3e89('0x61')]===0x64){_0x436c34[_0x3e89('0x6a')]=_0x2a6c4a;}return _0x436c34;});});}else{return;}})[_0x3e89('0x2d')](function(_0x4b8f39){if(_0x4b8f39)_0x32bc02=_0x4b8f39;if(_[_0x3e89('0x69')](_0x33f54a,0x3eb)){var _0x103e6e=_['find'](_0x32bc02,{'sectionId':0x3eb});return getCustomDashboards(_0x103e6e)[_0x3e89('0x2d')](function(_0x1022ec){return _[_0x3e89('0x38')](_0x32bc02,function(_0x462cf3){if(_0x103e6e[_0x3e89('0x68')]){if(_0x462cf3[_0x3e89('0x61')]===0x3eb){_0x462cf3['subsections']=_0x1022ec;}}else{if(_0x462cf3[_0x3e89('0x61')]===0x64){if(!_0x462cf3[_0x3e89('0x6a')]){_0x462cf3['subsections']=[];}_0x462cf3['subsections']=_0x462cf3[_0x3e89('0x6a')][_0x3e89('0x6b')](_0x1022ec);}}return _0x462cf3;});});}else{return;}})[_0x3e89('0x2d')](function(_0x527232){if(_0x527232)_0x32bc02=_0x527232;if(_[_0x3e89('0x69')](_0x33f54a,0x709)){var _0x597e30=_['find'](_0x32bc02,{'sectionId':0x709});return getPlugins(_0x597e30)[_0x3e89('0x2d')](function(_0x150994){if(_0x597e30[_0x3e89('0x68')]){return _['map'](_0x32bc02,function(_0x2d65a3){if(_0x2d65a3['sectionId']===0x709){_0x2d65a3[_0x3e89('0x6a')]=_0x150994;}return _0x2d65a3;});}else{var _0x4968ee={'sectionId':0x76c,'enabled':0x1,'subsections':_0x150994};var _0x2ccd28=_[_0x3e89('0x38')](_0x32bc02);_0x2ccd28['push'](_0x4968ee);return _0x2ccd28;}});}else{return;}})[_0x3e89('0x2d')](function(_0x4f33d1){if(_0x4f33d1)_0x32bc02=_0x4f33d1;return _['filter'](_0x32bc02,[_0x3e89('0x68'),0x1]);})[_0x3e89('0x2d')](respondWithResult(_0xdbabcb,null))[_0x3e89('0x52')](handleError(_0xdbabcb,null));};function hasDefaultDashboard(_0x658f9f){var _0x1416f8=[0x65];return new BPromise(function(_0x3c29c4,_0xe6c58d){try{if(_0x658f9f['autoAssociation']){_0x3c29c4(_0x1416f8);}else{return db[_0x3e89('0x60')][_0x3e89('0x6c')]({'where':{'sectionId':_0x658f9f['id']},'raw':!![]})[_0x3e89('0x2d')](function(_0x299827){_0x299827?_0x3c29c4(_0x1416f8):_0x3c29c4();});}}catch(_0x373fac){_0xe6c58d(_0x373fac);}});}function getCustomDashboards(_0x2dc496){var _0x1ddcd8=[];return new BPromise(function(_0x2cc7ed,_0x49eae1){try{if(_0x2dc496[_0x3e89('0x5f')]){return db['Dashboard']['findAll']({'raw':!![]})['then'](function(_0x2258a8){_0x2258a8[_0x3e89('0x6d')](function(_0x1d4f51){_0x1ddcd8[_0x3e89('0x66')](_0x1d4f51['id']+0x1869f);});_0x2cc7ed(_0x1ddcd8);});}else{return db[_0x3e89('0x60')][_0x3e89('0x4d')]({'where':{'sectionId':_0x2dc496['id']},'raw':!![]})[_0x3e89('0x2d')](function(_0x2b3118){_0x2b3118[_0x3e89('0x6d')](function(_0x381aab){_0x1ddcd8['push'](_0x381aab[_0x3e89('0x6e')]+0x1869f);});_0x2cc7ed(_0x1ddcd8);});}}catch(_0x11a2a7){_0x49eae1(_0x11a2a7);}});}function getPlugins(_0x5076dc){var _0x199456=[];return new BPromise(function(_0x5def74,_0x3e5056){try{if(_0x5076dc[_0x3e89('0x5f')]){return db[_0x3e89('0x6f')][_0x3e89('0x4d')]({'raw':!![]})[_0x3e89('0x2d')](function(_0x2a7318){_0x2a7318[_0x3e89('0x6d')](function(_0x145e0f){_0x199456[_0x3e89('0x66')](_0x145e0f['id']+0x15b38);});_0x5def74(_0x199456);});}else{return db[_0x3e89('0x60')]['findAll']({'where':{'sectionId':_0x5076dc['id']},'raw':!![]})[_0x3e89('0x2d')](function(_0x4920de){_0x4920de[_0x3e89('0x6d')](function(_0x67743e){_0x199456[_0x3e89('0x66')](_0x67743e[_0x3e89('0x6e')]+0x15b38);});_0x5def74(_0x199456);});}}catch(_0xd0a65f){_0x3e5056(_0xd0a65f);}});}exports[_0x3e89('0x70')]=function(_0xd91e33,_0x2dbe02){return db[_0x3e89('0x33')][_0x3e89('0x51')]({'where':{'id':_0xd91e33[_0x3e89('0x50')]['id']}})[_0x3e89('0x2d')](handleEntityNotFound(_0x2dbe02,null))[_0x3e89('0x2d')](function(_0x1961e2){if(_0x1961e2){return db[_0x3e89('0x65')][_0x3e89('0x5b')](function(_0x251660){return db[_0x3e89('0x5d')][_0x3e89('0x4d')]({'where':{'userProfileId':_0xd91e33[_0x3e89('0x50')]['id']},'attributes':['id'],'raw':!![]})[_0x3e89('0x2d')](function(_0x1b4c56){if(_0x1b4c56){return db[_0x3e89('0x5d')][_0x3e89('0x2c')]({'where':{'userProfileId':_0xd91e33[_0x3e89('0x50')]['id'],'id':_[_0x3e89('0x38')](_0x1b4c56,function(_0x14cf91){return _0x14cf91['id'];})},'transaction':_0x251660});}})[_0x3e89('0x2d')](function(_0x4558b6){var _0x49f41d=_['map'](_0xd91e33[_0x3e89('0x5c')],function(_0x4558c7){_0x4558c7[_0x3e89('0x62')]=_0xd91e33[_0x3e89('0x50')]['id'];return _0x4558c7;});return db['UserProfileSection'][_0x3e89('0x71')](_0x49f41d,{'raw':!![],'transaction':_0x251660});})[_0x3e89('0x2d')](function(_0x52189a){var _0x532ebb=_[_0x3e89('0x45')](_[_0x3e89('0x38')](_0x52189a,function(_0x486f58){return _0x486f58[_0x3e89('0x56')]({'plain':!![]});}),{'includeAll':![]});if(_0x532ebb){return db[_0x3e89('0x5d')]['findAll']({'where':{'userProfileId':_0xd91e33[_0x3e89('0x50')]['id'],'sectionId':_[_0x3e89('0x38')](_0x532ebb,function(_0x38570b){return _0x38570b[_0x3e89('0x61')];})},'attributes':['id',_0x3e89('0x61')],'raw':!![]})[_0x3e89('0x2d')](function(_0x54d61c){var _0x57d9e0=_[_0x3e89('0x38')](_0xd91e33['body'],function(_0x3fb475){_0x3fb475['userProfileId']=_0xd91e33['params']['id'];return _0x3fb475;});return db[_0x3e89('0x60')][_0x3e89('0x71')](_0x57d9e0,{'raw':!![],'transaction':_0x251660});});}})[_0x3e89('0x52')](handleError(_0x2dbe02,null));});}})[_0x3e89('0x2d')](function(_0x5b307b){var _0x3737e6=_[_0x3e89('0x38')](_0x5b307b,function(_0x310d14){return _0x310d14[_0x3e89('0x56')]({'plain':!![]});});})['then'](respondWithResult(_0x2dbe02,null))['catch'](handleError(_0x2dbe02,null));};exports['removeResources']=function(_0x3e00ff,_0xc73613,_0x4063b5){return db[_0x3e89('0x33')]['find']({'where':{'id':_0x3e00ff['params']['id']}})[_0x3e89('0x2d')](handleEntityNotFound(_0xc73613,null))[_0x3e89('0x2d')](function(_0x3032e8){if(_0x3032e8){return _0x3032e8['removeResources'](_0x3e00ff[_0x3e89('0x39')]['ids']);}})[_0x3e89('0x2d')](respondWithStatusCode(_0xc73613,null))[_0x3e89('0x52')](handleError(_0xc73613,null));};exports[_0x3e89('0x72')]=function(_0x36780b,_0xaf59af){var _0x15cd3e={};if(!_0x36780b[_0x3e89('0x39')][_0x3e89('0x73')])throw new Error(_0x3e89('0x74'));if(!_0x36780b[_0x3e89('0x39')]['hasOwnProperty'](_0x3e89('0x41'))){_0x15cd3e[_0x3e89('0x26')]=qs[_0x3e89('0x26')](_0x36780b[_0x3e89('0x39')]['limit']);_0x15cd3e[_0x3e89('0x24')]=qs['offset'](_0x36780b[_0x3e89('0x39')][_0x3e89('0x24')]);}return db['UserProfile'][_0x3e89('0x51')]({'where':{'id':_0x36780b[_0x3e89('0x50')]['id']}})[_0x3e89('0x2d')](function(_0x5b56b8){if(!_0x5b56b8)throw new Error(_0x3e89('0x75')+_0x36780b[_0x3e89('0x50')]['id']);return db[_0x3e89('0x33')]['getResources'](_0x36780b);})[_0x3e89('0x2d')](respondWithFilteredResult(_0xaf59af,_0x15cd3e))[_0x3e89('0x52')](handleError(_0xaf59af,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index c7020ce..bc81065 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 _0xcd05=['exports','events','save','update','remove','hook'];(function(_0x1d56bf,_0x3cb6c0){var _0x53a036=function(_0x42a47f){while(--_0x42a47f){_0x1d56bf['push'](_0x1d56bf['shift']());}};_0x53a036(++_0x3cb6c0);}(_0xcd05,0x163));var _0x5cd0=function(_0x2d2ca2,_0x51873f){_0x2d2ca2=_0x2d2ca2-0x0;var _0x48489d=_0xcd05[_0x2d2ca2];return _0x48489d;};'use strict';var EventEmitter=require(_0x5cd0('0x0'));var UserProfile=require('../../mysqldb')['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5cd0('0x1'),'afterUpdate':_0x5cd0('0x2'),'afterDestroy':_0x5cd0('0x3')};function emitEvent(_0x35dfb3){return function(_0x48e5ac,_0x33b92d,_0x2d88ed){UserProfileEvents['emit'](_0x35dfb3+':'+_0x48e5ac['id'],_0x48e5ac);UserProfileEvents['emit'](_0x35dfb3,_0x48e5ac);_0x2d88ed(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0x5cd0('0x4')](e,emitEvent(event));}}module[_0x5cd0('0x5')]=UserProfileEvents; \ No newline at end of file +var _0xe785=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xe785,0x128));var _0x5e78=function(_0x2b1b85,_0x3ecdb5){_0x2b1b85=_0x2b1b85-0x0;var _0x53cc7a=_0xe785[_0x2b1b85];return _0x53cc7a;};'use strict';var EventEmitter=require(_0x5e78('0x0'));var UserProfile=require(_0x5e78('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x5e78('0x2')](0x0);var events={'afterCreate':_0x5e78('0x3'),'afterUpdate':_0x5e78('0x4'),'afterDestroy':_0x5e78('0x5')};function emitEvent(_0x4d8317){return function(_0x4c0243,_0x55fadd,_0x4565a4){UserProfileEvents[_0x5e78('0x6')](_0x4d8317+':'+_0x4c0243['id'],_0x4c0243);UserProfileEvents[_0x5e78('0x6')](_0x4d8317,_0x4c0243);_0x4565a4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x5e78('0x7')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 32081be..216261a 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 _0xbc4a=['push','UserProfileSection','find','params','all','union','length','ignore','autoAssociation','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','offset','order','sort','pick','where','merge','key','VIRTUAL','foreignKey','forEach','include','default','reportId','custom','CustomReports','count','rows','ids','extraQueryConditions','Tags','color','tag','ThroughTags','true','chat','fax','dataValues','mail','openchannel','whatsapp','lodash','./userProfile.attributes','squel','models','filter','field','findAll','associatedResources','map','value','model','then','catch','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','name','projectName','projects','contacts','CmContact','Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','inboundroutes','internalroutes','outboundroutes','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','agent','Telephones','membername','User','role','VoiceQueues','queue','inbound','QueueCampaigns','VoiceQueue','musiconholds','VoiceMusicOnHold','VoiceChanSpy','voiceprefixes','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','users','agents','telephones','Users','admin','user','zendeskaccounts','SalesforceAccount','deskaccounts','DeskAccount','zohoaccounts','vtigeraccounts','cannedanswers','CannedAnswer','Disposition','customdashboards','intervals','Interval','scheduler','sounds','Sound','tags','Tag','Template','triggers','Trigger','trunks','Variable','plugins','Plugin','extractedreports','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.','ui.createdAt','from','user_has_','_interactions','sequelize','OpenTabs','define','UserProfile','user_profiles','../../components/parsers/qs','query','section','mergeResources','isEmpty'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0xbc4a,0xe8));var _0xabc4=function(_0x4edccc,_0x415103){_0x4edccc=_0x4edccc-0x0;var _0x574a32=_0xbc4a[_0x4edccc];return _0x574a32;};'use strict';var _=require(_0xabc4('0x0'));var attributes=require(_0xabc4('0x1'));var squel=require(_0xabc4('0x2'));module['exports']=function(_0x38abfb){var _0x323fe=_0x38abfb[_0xabc4('0x3')];function _0x2b00be(_0x542458,_0x3c05c5){return new Promise(function(_0x2982f5,_0x238822){if(!_0x3c05c5)return _0x2982f5(null);var _0x3a940e=_0x3c05c5[_0xabc4('0x4')]?{[_0x3c05c5[_0xabc4('0x4')][_0xabc4('0x5')]]:_0x3c05c5[_0xabc4('0x4')]['value']}:undefined;return _0x323fe[_0x542458][_0xabc4('0x6')]({'where':_0x3a940e,'raw':!![]})['then'](function(_0x214e7e){_0x3c05c5[_0xabc4('0x7')]=_[_0xabc4('0x8')](_0x214e7e,'id');_0x2982f5(_0x3c05c5);})['catch'](function(_0x54c618){_0x238822(_0x54c618);});});}function _0x3c64b0(_0x20b002,_0x42e97f){return new Promise(function(_0xa2ae57,_0x1f8d05){var _0x30e910=_0x20b002['filter']?{[_0x20b002[_0xabc4('0x4')][_0xabc4('0x5')]]:_0x20b002[_0xabc4('0x4')][_0xabc4('0x9')]}:undefined;return _0x323fe[_0x20b002[_0xabc4('0xa')]][_0xabc4('0x6')]({'where':_0x30e910,'raw':!![]})[_0xabc4('0xb')](function(_0x13107a){_0x42e97f[_0xabc4('0x7')]=_[_0xabc4('0x8')](_0x13107a,function(_0x39f42b){return _0x39f42b['name'];});_0xa2ae57(_0x42e97f);})[_0xabc4('0xc')](function(_0x39635b){_0x1f8d05(_0x39635b);});});}function _0x54798d(_0x37a754,_0x2debe2,_0x3f9db1){if(!_0x2debe2)return Promise['resolve'](null);return new Promise(function(_0x1186db,_0x32e156){return _0x323fe['UserProfileResource'][_0xabc4('0x6')]({'where':{'sectionId':_0x2debe2['id']},'raw':!![]})[_0xabc4('0xb')](function(_0x357a5a){if(_0x37a754[_0xabc4('0x5')]&&_0x37a754['field']!=='id'){_0x2debe2[_0xabc4('0x7')]=_[_0xabc4('0x8')](_0x357a5a,function(_0x4fe87c){return _0x4fe87c[_0x37a754['field']];});}else{if(_0x3f9db1===_0xabc4('0xd')){_0x2debe2[_0xabc4('0x7')]=_[_0xabc4('0x8')](_0x357a5a,function(_0x39f027){return{'id':_0x39f027[_0xabc4('0xe')],'type':_0x39f027[_0xabc4('0xf')]};});}else{_0x2debe2[_0xabc4('0x7')]=_[_0xabc4('0x8')](_0x357a5a,function(_0x548d64){return _0x548d64[_0xabc4('0xe')];});}}_0x1186db(_0x2debe2);})[_0xabc4('0xc')](function(_0x56f770){_0x32e156(_0x56f770);});});}function _0x427651(_0x5797cb,_0x17254e){var _0x26e068={'parentSections':[]};switch(_0x5797cb[_0xabc4('0x10')]()){case _0xabc4('0x11'):_0x26e068[_0xabc4('0x12')]=_0xabc4('0x13');break;case'odbc':_0x26e068['childModel']=_0xabc4('0x14');break;case _0xabc4('0x15'):_0x26e068[_0xabc4('0x12')]=_0xabc4('0x16');_0x26e068[_0xabc4('0x17')]=[{'name':_0xabc4('0x18'),'field':_0xabc4('0x19'),'foreignKey':_0xabc4('0x1a')}];break;case _0xabc4('0x1b'):_0x26e068[_0xabc4('0x12')]='JscriptyProject';break;case _0xabc4('0x1c'):_0x26e068[_0xabc4('0x12')]=_0xabc4('0x1d');_0x26e068[_0xabc4('0x17')]=[{'name':_0xabc4('0x1e'),'field':'id','foreignKey':_0xabc4('0x1f')}];break;case _0xabc4('0x20'):_0x26e068['childModel']=_0xabc4('0x21');break;case _0xabc4('0x22'):_0x26e068[_0xabc4('0x12')]=_0xabc4('0x23');break;case _0xabc4('0x24'):_0x26e068[_0xabc4('0x12')]='CmCustomField';break;case'chatqueues':_0x26e068['childModel']=_0xabc4('0x25');break;case _0xabc4('0x26'):_0x26e068[_0xabc4('0x12')]=_0xabc4('0x27');break;case _0xabc4('0x28'):_0x26e068[_0xabc4('0x12')]=_0xabc4('0x29');break;case'faxaccounts':_0x26e068[_0xabc4('0x12')]='FaxAccount';break;case _0xabc4('0x2a'):case _0xabc4('0x2b'):case _0xabc4('0x2c'):_0x26e068[_0xabc4('0x12')]='VoiceExtension';break;case _0xabc4('0x2d'):_0x26e068[_0xabc4('0x12')]=_0xabc4('0x2e');break;case _0xabc4('0x2f'):_0x26e068[_0xabc4('0x12')]=_0xabc4('0x30');break;case _0xabc4('0x31'):_0x26e068[_0xabc4('0x12')]=_0xabc4('0x32');_0x26e068[_0xabc4('0x17')]=[{'name':_0xabc4('0x33'),'field':_0xabc4('0x19'),'foreignKey':'membername','model':'User','filter':{'field':'role','value':[_0xabc4('0x34')]}},{'name':_0xabc4('0x35'),'field':'name','foreignKey':_0xabc4('0x36'),'model':_0xabc4('0x37'),'filter':{'field':_0xabc4('0x38'),'value':['telephone']}},{'name':_0xabc4('0x39'),'field':'name','foreignKey':_0xabc4('0x3a'),'model':'VoiceQueue','filter':{'field':'type','value':[_0xabc4('0x3b')]}},{'name':_0xabc4('0x3c'),'field':_0xabc4('0x19'),'foreignKey':_0xabc4('0x3a'),'model':_0xabc4('0x3d'),'filter':{'field':'type','value':['outbound']}}];break;case _0xabc4('0x3e'):_0x26e068[_0xabc4('0x12')]=_0xabc4('0x3f');break;case'chanspies':_0x26e068[_0xabc4('0x12')]=_0xabc4('0x40');break;case _0xabc4('0x41'):_0x26e068[_0xabc4('0x12')]='VoicePrefix';break;case'ivrcampaigns':_0x26e068[_0xabc4('0x12')]=_0xabc4('0x42');break;case _0xabc4('0x43'):_0x26e068['childModel']=_0xabc4('0x44');break;case _0xabc4('0x45'):_0x26e068[_0xabc4('0x12')]=_0xabc4('0x46');break;case _0xabc4('0x47'):_0x26e068[_0xabc4('0x12')]=_0xabc4('0x48');break;case _0xabc4('0x49'):_0x26e068[_0xabc4('0x12')]=_0xabc4('0x4a');break;case _0xabc4('0x4b'):_0x26e068[_0xabc4('0x12')]=_0xabc4('0x4c');break;case'smsqueues':_0x26e068[_0xabc4('0x12')]=_0xabc4('0x4d');break;case _0xabc4('0x4e'):_0x26e068[_0xabc4('0x12')]=_0xabc4('0x4f');break;case _0xabc4('0x50'):_0x26e068['childModel']=_0xabc4('0x51');break;case _0xabc4('0x52'):_0x26e068['childModel']=_0xabc4('0x53');break;case _0xabc4('0x54'):_0x26e068[_0xabc4('0x12')]=_0xabc4('0x55');break;case _0xabc4('0x56'):case'queuecampaigns':_0x26e068[_0xabc4('0x12')]=_0xabc4('0x3d');if(_0x17254e){_0x26e068[_0xabc4('0x17')]=[{'name':_0xabc4('0x39')},{'name':_0xabc4('0x3c')}];}break;case _0xabc4('0x57'):case _0xabc4('0x58'):case _0xabc4('0x59'):_0x26e068[_0xabc4('0x12')]='User';if(_0x17254e){_0x26e068[_0xabc4('0x17')]=[{'name':_0xabc4('0x5a'),'filter':{'field':'role','value':[_0xabc4('0x5b'),_0xabc4('0x5c')]},'ignore':!![]},{'name':'Agents'},{'name':_0xabc4('0x35')}];}break;case _0xabc4('0x5d'):_0x26e068['childModel']='ZendeskAccount';break;case'salesforceaccounts':_0x26e068[_0xabc4('0x12')]=_0xabc4('0x5e');break;case'freshdeskaccounts':_0x26e068['childModel']='FreshdeskAccount';break;case'sugarcrmaccounts':_0x26e068[_0xabc4('0x12')]='SugarcrmAccount';break;case _0xabc4('0x5f'):_0x26e068[_0xabc4('0x12')]=_0xabc4('0x60');break;case _0xabc4('0x61'):_0x26e068['childModel']='ZohoAccount';break;case _0xabc4('0x62'):_0x26e068['childModel']=_0xabc4('0x37');break;case _0xabc4('0x63'):_0x26e068[_0xabc4('0x12')]=_0xabc4('0x64');break;case'dispositions':_0x26e068[_0xabc4('0x12')]=_0xabc4('0x65');break;case _0xabc4('0x66'):_0x26e068['childModel']='Dashboard';break;case _0xabc4('0x67'):_0x26e068[_0xabc4('0x12')]=_0xabc4('0x68');break;case'pauses':_0x26e068[_0xabc4('0x12')]='Pause';break;case _0xabc4('0x69'):_0x26e068[_0xabc4('0x12')]='Schedule';break;case _0xabc4('0x6a'):_0x26e068[_0xabc4('0x12')]=_0xabc4('0x6b');break;case _0xabc4('0x6c'):_0x26e068[_0xabc4('0x12')]=_0xabc4('0x6d');break;case'templates':_0x26e068[_0xabc4('0x12')]=_0xabc4('0x6e');break;case _0xabc4('0x6f'):_0x26e068['childModel']=_0xabc4('0x70');break;case _0xabc4('0x71'):_0x26e068[_0xabc4('0x12')]='Trunk';break;case'variables':_0x26e068[_0xabc4('0x12')]=_0xabc4('0x72');break;case _0xabc4('0x73'):_0x26e068[_0xabc4('0x12')]=_0xabc4('0x74');break;case _0xabc4('0x75'):_0x26e068['childModel']='AnalyticExtractedReport';_0x26e068['parentSections']=[{'name':'Reports','field':'id','foreignKey':'reportId'}];break;case'metrics':_0x26e068[_0xabc4('0x12')]='AnalyticMetric';break;}return _0x26e068;}function _0x1148f8(_0x91f914,_0x219db1){var _0x54244a=_0x91f914[_0xabc4('0x76')](0x0)[_0xabc4('0x77')]()+_0x91f914[_0xabc4('0x78')](0x1);var _0x312b3f={'type':_0x323fe[_0xabc4('0x79')][_0xabc4('0x7a')][_0xabc4('0x7b')],'raw':!![]};return new Promise(function(_0x55dde0,_0x3ffd76){var _0x3b67b5=squel[_0xabc4('0x7c')]()[_0xabc4('0x5')](_0xabc4('0x7d')+_0x54244a+'InteractionId','id')[_0xabc4('0x5')](_0xabc4('0x7e'))[_0xabc4('0x7f')](_0xabc4('0x80')+_0x91f914+_0xabc4('0x81'),'ui')['where']('ui.UserId\x20=\x20?',_0x219db1['id']);return _0x323fe[_0xabc4('0x82')]['query'](_0x3b67b5['toString'](),_0x312b3f)[_0xabc4('0xb')](function(_0x3dc9ba){_0x219db1[_0x54244a+_0xabc4('0x83')]=_0x3dc9ba;_0x55dde0(_0x3dc9ba);})['catch'](function(_0x2d3e74){_0x3ffd76(_0x2d3e74);});});}return _0x38abfb[_0xabc4('0x84')](_0xabc4('0x85'),attributes,{'tableName':_0xabc4('0x86'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x4b17f5){var _0x23c7d6=require(_0xabc4('0x87'));var _0x482fa8={'raw':_0x4b17f5[_0xabc4('0x88')]['raw'],'where':{}};var _0x1cee9e={};var _0x209709={'count':0x0,'rows':[]};var _0x5c56d8=_0x4b17f5['query'][_0xabc4('0x89')];var _0x5cc151=_0x4b17f5[_0xabc4('0x88')][_0xabc4('0x8a')]||![];var _0x7a69cb=_0x427651(_0x5c56d8,_0x5cc151);if(!_0x7a69cb['childModel'])throw new Error('Invalid\x20section\x20\x27'+_0x5c56d8+'\x27');var _0x3e0448=[{'name':_0x5c56d8}];if(!_[_0xabc4('0x8b')](_0x7a69cb[_0xabc4('0x17')]))_0x3e0448=_0x7a69cb[_0xabc4('0x17')];var _0x2b9295=[];for(var _0x224979=0x0;_0x224979<_0x3e0448['length'];_0x224979++){_0x2b9295[_0xabc4('0x8c')](_0x323fe[_0xabc4('0x8d')][_0xabc4('0x8e')]({'where':{'userProfileId':_0x4b17f5[_0xabc4('0x8f')]['id'],'name':_0x3e0448[_0x224979]['name']},'raw':!![]}));}return Promise[_0xabc4('0x90')](_0x2b9295)[_0xabc4('0xb')](function(_0x3a7aa0){var _0x45c00c=_['filter'](_0x3a7aa0,function(_0x27dfbc){return _0x27dfbc?_0x27dfbc:undefined;});var _0x1e597c=_['filter'](_0x3e0448,['ignore',!![]]);var _0x18ee88=_[_0xabc4('0x8b')](_0x45c00c)&&_[_0xabc4('0x8b')](_0x1e597c)?null:_[_0xabc4('0x91')](_0x1e597c,_0x45c00c);if(!_0x18ee88)return null;var _0x38a935=[];for(var _0x56c447=0x0;_0x56c447<_0x18ee88[_0xabc4('0x92')];_0x56c447++){var _0x3527be=_['find'](_0x3e0448,function(_0x2939fc){return _0x18ee88[_0x56c447]?_0x2939fc[_0xabc4('0x19')]===_0x18ee88[_0x56c447][_0xabc4('0x19')]:null;});if(_0x3527be){if(_0x18ee88[_0x56c447][_0xabc4('0x93')]){_0x38a935[_0xabc4('0x8c')](_0x2b00be(_0x7a69cb['childModel'],_0x18ee88[_0x56c447]));}else{if(!_0x18ee88[_0x56c447][_0xabc4('0x94')]){_0x38a935['push'](_0x54798d(_0x3527be,_0x18ee88[_0x56c447],_0x7a69cb[_0xabc4('0x12')]));}else{if(_0x3527be[_0xabc4('0xa')]){_0x38a935[_0xabc4('0x8c')](_0x3c64b0(_0x3527be,_0x18ee88[_0x56c447]));}}}}}return Promise['all'](_0x38a935);})[_0xabc4('0xb')](function(_0xe7d9aa){var _0x19f3ee=_0xe7d9aa;var _0x42c543=null;if(_0x19f3ee){_0x42c543=_0x19f3ee[_0xabc4('0x92')]===0x1?_0x19f3ee[0x0]:null;}if(!_0x42c543&&!_0x19f3ee)return _0x209709;var _0x7bdbe7=_0x323fe[_0x7a69cb[_0xabc4('0x12')]]['rawAttributes'];_0x1cee9e[_0xabc4('0xa')]=_[_0xabc4('0x95')](_0x7bdbe7);_0x1cee9e[_0xabc4('0x88')]=_['keys'](_0x4b17f5['query']);_0x1cee9e[_0xabc4('0x96')]=_[_0xabc4('0x97')](_0x1cee9e['model'],_0x1cee9e[_0xabc4('0x88')]);_0x482fa8[_0xabc4('0x98')]=_[_0xabc4('0x97')](_0x1cee9e[_0xabc4('0xa')],_0x23c7d6[_0xabc4('0x99')](_0x4b17f5[_0xabc4('0x88')]['fields']));_0x482fa8[_0xabc4('0x98')]=_0x482fa8[_0xabc4('0x98')][_0xabc4('0x92')]?_0x482fa8['attributes']:_0x1cee9e[_0xabc4('0xa')];if(!_0x4b17f5[_0xabc4('0x88')][_0xabc4('0x9a')]('nolimit')){_0x482fa8['limit']=_0x23c7d6['limit'](_0x4b17f5[_0xabc4('0x88')][_0xabc4('0x9b')]);_0x482fa8[_0xabc4('0x9c')]=_0x23c7d6[_0xabc4('0x9c')](_0x4b17f5['query'][_0xabc4('0x9c')]);}_0x482fa8[_0xabc4('0x9d')]=_0x23c7d6[_0xabc4('0x9e')](_0x4b17f5['query'][_0xabc4('0x9e')]);_0x482fa8['where']=_0x23c7d6[_0xabc4('0x96')](_[_0xabc4('0x9f')](_0x4b17f5[_0xabc4('0x88')],_0x1cee9e[_0xabc4('0x96')]));if(_0x4b17f5[_0xabc4('0x88')]['filter']){_0x482fa8[_0xabc4('0xa0')]=_[_0xabc4('0xa1')](_0x482fa8['where'],{'$or':_[_0xabc4('0x8')](_0x7bdbe7,function(_0x33e374){if(_0x33e374['type'][_0xabc4('0xa2')]!==_0xabc4('0xa3')){var _0x37db60={};_0x37db60[_0x33e374[_0xabc4('0x5')]]={'$like':'%'+_0x4b17f5[_0xabc4('0x88')]['filter']+'%'};return _0x37db60;}})});}var _0x14df94=[];var _0x3a722f=null;var _0x36b5e2={};if(_0x42c543){_0x3a722f=_[_0xabc4('0x8e')](_0x3e0448,[_0xabc4('0x19'),_0x42c543[_0xabc4('0x19')]]);if(_0x3a722f[_0xabc4('0x5')]){_0x36b5e2={};if(_0x7a69cb['childModel']===_0xabc4('0xd')){_0x36b5e2[_0x3a722f[_0xabc4('0xa4')]]=_['map'](_0x42c543['associatedResources'],'id');}else{_0x36b5e2[_0x3a722f[_0xabc4('0xa4')]]=_0x42c543[_0xabc4('0x7')];}_0x14df94[_0xabc4('0x8c')](_0x36b5e2);}else{_0x482fa8[_0xabc4('0xa0')]['id']=_0x42c543[_0xabc4('0x7')];}}else{for(var _0x28b9d0=0x0;_0x28b9d0<_0x19f3ee[_0xabc4('0x92')];_0x28b9d0++){_0x3a722f=_[_0xabc4('0x8e')](_0x3e0448,[_0xabc4('0x19'),_0x19f3ee[_0x28b9d0]['name']]);if(_0x3a722f[_0xabc4('0x5')]){_0x36b5e2={};_0x36b5e2[_0x3a722f['foreignKey']]=_0x19f3ee[_0x28b9d0][_0xabc4('0x7')];_0x14df94[_0xabc4('0x8c')](_0x36b5e2);}else{if(!_0x482fa8[_0xabc4('0xa0')]['id'])_0x482fa8['where']['id']=[];_0x19f3ee[_0x28b9d0][_0xabc4('0x7')][_0xabc4('0xa5')](function(_0x47a641){_0x482fa8[_0xabc4('0xa0')]['id'][_0xabc4('0x8c')](_0x47a641);});}}}if(!_[_0xabc4('0x8b')](_0x14df94)){_0x482fa8[_0xabc4('0xa0')]=_[_0xabc4('0xa1')](_0x482fa8[_0xabc4('0xa0')],{'$and':{'$or':_0x14df94}});}_0x482fa8=_[_0xabc4('0xa1')]({},_0x482fa8,_0x4b17f5['options']);if(_0x42c543&&!_0x42c543[_0xabc4('0x94')]&&_0x7a69cb[_0xabc4('0x12')]===_0xabc4('0xd')){if(_0x4b17f5[_0xabc4('0x88')]['includeAll']){_0x482fa8[_0xabc4('0xa6')]=[{'all':!![]}];}return _0x323fe[_0x7a69cb[_0xabc4('0x12')]][_0xabc4('0x6')](_0x482fa8)[_0xabc4('0xb')](function(_0x481f64){var _0x2536b1=[];_0x481f64[_0xabc4('0xa5')](function(_0x4e35a4){var _0x5d2e21;switch(_0x4e35a4['reportType']){case _0xabc4('0xa7'):_0x5d2e21=_[_0xabc4('0x8e')](_0x42c543[_0xabc4('0x7')],function(_0x5aa853){return _0x5aa853['id']===_0x4e35a4[_0xabc4('0xa8')]&&_0x5aa853['type']==='DefaultReports';});break;case _0xabc4('0xa9'):_0x5d2e21=_['find'](_0x42c543[_0xabc4('0x7')],function(_0x117391){return _0x117391['id']===_0x4e35a4['reportId']&&_0x117391[_0xabc4('0xf')]===_0xabc4('0xaa');});break;}if(_0x5d2e21)_0x2536b1[_0xabc4('0x8c')](_0x4e35a4);});_0x209709[_0xabc4('0xab')]=_0x2536b1[_0xabc4('0x92')];_0x209709[_0xabc4('0xac')]=_0x2536b1;return _0x209709;});}else{if(!_[_0xabc4('0x8b')](_0x4b17f5[_0xabc4('0x88')]['ids'])){_0x482fa8['where']['id']=_0x482fa8['where']['id']?_['intersection'](_0x482fa8['where']['id'],_0x4b17f5[_0xabc4('0x88')][_0xabc4('0xad')]):_0x4b17f5['query']['ids'];if(_0x4b17f5[_0xabc4('0x88')]['customSorting']){_0x482fa8[_0xabc4('0x9d')]=_0x4b17f5[_0xabc4('0x88')]['customSorting'];}}if(_0x4b17f5[_0xabc4('0x88')][_0xabc4('0xae')]){_0x482fa8[_0xabc4('0xa0')]=_[_0xabc4('0xa1')](_0x482fa8[_0xabc4('0xa0')],{'$and':_0x4b17f5[_0xabc4('0x88')][_0xabc4('0xae')]});}return _0x323fe[_0x7a69cb['childModel']]['count']({'where':_0x482fa8['where']})[_0xabc4('0xb')](function(_0x36a8cb){_0x209709[_0xabc4('0xab')]=_0x36a8cb;if(_0x4b17f5[_0xabc4('0x88')]['includeAll']){if(_0x7a69cb[_0xabc4('0x12')]===_0xabc4('0x1d')){_0x482fa8['include']=[{'model':_0x323fe[_0xabc4('0x6d')],'as':_0xabc4('0xaf'),'attributes':['id',_0xabc4('0x19'),_0xabc4('0xb0')],'required':_0x4b17f5[_0xabc4('0x88')][_0xabc4('0xb1')]?!![]:![]},{'model':_0x323fe['Tag'],'as':_0xabc4('0xb2'),'attributes':['id',_0xabc4('0x19'),_0xabc4('0xb0')],'through':_0x4b17f5[_0xabc4('0x88')]['tag']?{'attributes':[],'where':{'TagId':_0x4b17f5[_0xabc4('0x88')][_0xabc4('0xb1')]||undefined}}:{},'required':_0x4b17f5[_0xabc4('0x88')]['tag']?!![]:![]}];}else{_0x482fa8[_0xabc4('0xa6')]=[{'all':!![]}];}}return _0x323fe[_0x7a69cb[_0xabc4('0x12')]][_0xabc4('0x6')](_0x482fa8);})['then'](function(_0x20ade1){_0x209709[_0xabc4('0xac')]=_0x20ade1;if(_0x5c56d8===_0xabc4('0x33')&&_0x4b17f5[_0xabc4('0x88')]['openTabs']===_0xabc4('0xb3')){var _0x5bdbf0=[];for(var _0x3c95e2=0x0;_0x3c95e2<_0x209709[_0xabc4('0xac')][_0xabc4('0x92')];_0x3c95e2++){_0x5bdbf0[_0xabc4('0x8c')](_0x1148f8(_0xabc4('0xb4'),_0x209709[_0xabc4('0xac')][_0x3c95e2]['dataValues']));_0x5bdbf0['push'](_0x1148f8('sms',_0x209709[_0xabc4('0xac')][_0x3c95e2]['dataValues']));_0x5bdbf0[_0xabc4('0x8c')](_0x1148f8(_0xabc4('0xb5'),_0x209709[_0xabc4('0xac')][_0x3c95e2][_0xabc4('0xb6')]));_0x5bdbf0[_0xabc4('0x8c')](_0x1148f8(_0xabc4('0xb7'),_0x209709[_0xabc4('0xac')][_0x3c95e2][_0xabc4('0xb6')]));_0x5bdbf0[_0xabc4('0x8c')](_0x1148f8(_0xabc4('0xb8'),_0x209709[_0xabc4('0xac')][_0x3c95e2]['dataValues']));_0x5bdbf0[_0xabc4('0x8c')](_0x1148f8(_0xabc4('0xb9'),_0x209709[_0xabc4('0xac')][_0x3c95e2][_0xabc4('0xb6')]));}return Promise['all'](_0x5bdbf0)[_0xabc4('0xb')](function(){return _0x209709;});}return _0x209709;});}});}}});}; \ No newline at end of file +var _0x0dce=['Team','voicequeues','users','agents','telephones','User','Users','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','customdashboards','Dashboard','intervals','Interval','pauses','scheduler','Schedule','sounds','tags','Tag','templates','Template','triggers','Trigger','trunks','Trunk','variables','Variable','plugins','Plugin','extractedreports','Reports','reportId','metrics','charAt','toUpperCase','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','user_has_','ui.UserId\x20=\x20?','sequelize','toString','OpenTabs','UserProfile','user_profiles','../../components/parsers/qs','raw','query','section','isEmpty','push','UserProfileSection','find','params','all','ignore','length','autoAssociation','rawAttributes','model','keys','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','where','filters','pick','merge','key','VIRTUAL','foreignKey','options','includeAll','include','forEach','reportType','default','DefaultReports','custom','rows','ids','customSorting','extraQueryConditions','count','CmContact','Tags','color','tag','openTabs','true','chat','dataValues','sms','fax','openchannel','lodash','squel','exports','models','filter','field','findAll','then','associatedResources','map','value','resolve','AnalyticExtractedReport','type','resourceId','toLowerCase','childModel','SquareProject','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','name','projectName','JscriptyProject','contacts','ListId','companies','globalcustomfields','chatqueues','ChatQueue','chatwebsites','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','contexts','VoiceContext','voicemails','VoiceMail','VoiceRecording','Agents','membername','role','Telephones','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','VoiceMusicOnHold','chanspies','VoiceChanSpy','VoicePrefix','ivrcampaigns','MailQueue','mailaccounts','MailAccount','MailSubstatus','openchannelqueues','OpenchannelQueue','OpenchannelAccount','smsqueues','SmsQueue','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0dce,0x1e3));var _0xe0dc=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x0dce[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xe0dc('0x0'));var attributes=require('./userProfile.attributes');var squel=require(_0xe0dc('0x1'));module[_0xe0dc('0x2')]=function(_0x12c386){var _0x40bb5a=_0x12c386[_0xe0dc('0x3')];function _0x9dfe7b(_0x5c05d4,_0x484109){return new Promise(function(_0x5d485d,_0x257e90){if(!_0x484109)return _0x5d485d(null);var _0x3f4aa1=_0x484109[_0xe0dc('0x4')]?{[_0x484109[_0xe0dc('0x4')][_0xe0dc('0x5')]]:_0x484109[_0xe0dc('0x4')]['value']}:undefined;return _0x40bb5a[_0x5c05d4][_0xe0dc('0x6')]({'where':_0x3f4aa1,'raw':!![]})[_0xe0dc('0x7')](function(_0x108a7f){_0x484109[_0xe0dc('0x8')]=_[_0xe0dc('0x9')](_0x108a7f,'id');_0x5d485d(_0x484109);})['catch'](function(_0x57a65b){_0x257e90(_0x57a65b);});});}function _0xa9e1a4(_0x489789,_0x330eee){return new Promise(function(_0x5eb753,_0xe438b9){var _0x11b28a=_0x489789['filter']?{[_0x489789['filter'][_0xe0dc('0x5')]]:_0x489789['filter'][_0xe0dc('0xa')]}:undefined;return _0x40bb5a[_0x489789['model']]['findAll']({'where':_0x11b28a,'raw':!![]})[_0xe0dc('0x7')](function(_0x576ac4){_0x330eee[_0xe0dc('0x8')]=_[_0xe0dc('0x9')](_0x576ac4,function(_0x4a5515){return _0x4a5515['name'];});_0x5eb753(_0x330eee);})['catch'](function(_0x3536f0){_0xe438b9(_0x3536f0);});});}function _0x1c23af(_0x597e5a,_0x3a622a,_0x5306be){if(!_0x3a622a)return Promise[_0xe0dc('0xb')](null);return new Promise(function(_0x532825,_0x56d044){return _0x40bb5a['UserProfileResource'][_0xe0dc('0x6')]({'where':{'sectionId':_0x3a622a['id']},'raw':!![]})['then'](function(_0x6239ae){if(_0x597e5a[_0xe0dc('0x5')]&&_0x597e5a[_0xe0dc('0x5')]!=='id'){_0x3a622a[_0xe0dc('0x8')]=_[_0xe0dc('0x9')](_0x6239ae,function(_0x3774e8){return _0x3774e8[_0x597e5a[_0xe0dc('0x5')]];});}else{if(_0x5306be===_0xe0dc('0xc')){_0x3a622a['associatedResources']=_['map'](_0x6239ae,function(_0x5ca167){return{'id':_0x5ca167['resourceId'],'type':_0x5ca167[_0xe0dc('0xd')]};});}else{_0x3a622a[_0xe0dc('0x8')]=_[_0xe0dc('0x9')](_0x6239ae,function(_0x168d6){return _0x168d6[_0xe0dc('0xe')];});}}_0x532825(_0x3a622a);})['catch'](function(_0x317243){_0x56d044(_0x317243);});});}function _0x335978(_0x1ad215,_0x419618){var _0x285e20={'parentSections':[]};switch(_0x1ad215[_0xe0dc('0xf')]()){case'squareprojects':_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x11');break;case'odbc':_0x285e20['childModel']=_0xe0dc('0x12');break;case _0xe0dc('0x13'):_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x14');_0x285e20[_0xe0dc('0x15')]=[{'name':_0xe0dc('0x16'),'field':_0xe0dc('0x17'),'foreignKey':_0xe0dc('0x18')}];break;case'projects':_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x19');break;case _0xe0dc('0x1a'):_0x285e20[_0xe0dc('0x10')]='CmContact';_0x285e20[_0xe0dc('0x15')]=[{'name':'Lists','field':'id','foreignKey':_0xe0dc('0x1b')}];break;case'lists':_0x285e20['childModel']='CmList';break;case _0xe0dc('0x1c'):_0x285e20[_0xe0dc('0x10')]='CmCompany';break;case _0xe0dc('0x1d'):_0x285e20[_0xe0dc('0x10')]='CmCustomField';break;case _0xe0dc('0x1e'):_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x1f');break;case _0xe0dc('0x20'):_0x285e20['childModel']='ChatWebsite';break;case'faxqueues':_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x21');break;case _0xe0dc('0x22'):_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x23');break;case _0xe0dc('0x24'):case _0xe0dc('0x25'):case'outboundroutes':_0x285e20[_0xe0dc('0x10')]='VoiceExtension';break;case _0xe0dc('0x26'):_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x27');break;case _0xe0dc('0x28'):_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x29');break;case'voicerecordings':_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x2a');_0x285e20['parentSections']=[{'name':_0xe0dc('0x2b'),'field':_0xe0dc('0x17'),'foreignKey':_0xe0dc('0x2c'),'model':'User','filter':{'field':_0xe0dc('0x2d'),'value':['agent']}},{'name':_0xe0dc('0x2e'),'field':_0xe0dc('0x17'),'foreignKey':_0xe0dc('0x2c'),'model':'User','filter':{'field':_0xe0dc('0x2d'),'value':['telephone']}},{'name':_0xe0dc('0x2f'),'field':_0xe0dc('0x17'),'foreignKey':_0xe0dc('0x30'),'model':_0xe0dc('0x31'),'filter':{'field':'type','value':[_0xe0dc('0x32')]}},{'name':_0xe0dc('0x33'),'field':_0xe0dc('0x17'),'foreignKey':'queue','model':_0xe0dc('0x31'),'filter':{'field':_0xe0dc('0xd'),'value':[_0xe0dc('0x34')]}}];break;case'musiconholds':_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x35');break;case _0xe0dc('0x36'):_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x37');break;case'voiceprefixes':_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x38');break;case _0xe0dc('0x39'):_0x285e20[_0xe0dc('0x10')]='Campaign';break;case'mailqueues':_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x3a');break;case _0xe0dc('0x3b'):_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x3c');break;case'mailsubstatuses':_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x3d');break;case _0xe0dc('0x3e'):_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x3f');break;case'openchannelaccounts':_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x40');break;case _0xe0dc('0x41'):_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x42');break;case'smsaccounts':_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x43');break;case _0xe0dc('0x44'):_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x45');break;case _0xe0dc('0x46'):_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x47');break;case'teams':_0x285e20['childModel']=_0xe0dc('0x48');break;case _0xe0dc('0x49'):case'queuecampaigns':_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x31');if(_0x419618){_0x285e20['parentSections']=[{'name':'VoiceQueues'},{'name':_0xe0dc('0x33')}];}break;case _0xe0dc('0x4a'):case _0xe0dc('0x4b'):case _0xe0dc('0x4c'):_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x4d');if(_0x419618){_0x285e20[_0xe0dc('0x15')]=[{'name':_0xe0dc('0x4e'),'filter':{'field':'role','value':['admin','user']},'ignore':!![]},{'name':_0xe0dc('0x2b')},{'name':_0xe0dc('0x2e')}];}break;case'zendeskaccounts':_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x4f');break;case _0xe0dc('0x50'):_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x51');break;case _0xe0dc('0x52'):_0x285e20[_0xe0dc('0x10')]='FreshdeskAccount';break;case _0xe0dc('0x53'):_0x285e20[_0xe0dc('0x10')]='SugarcrmAccount';break;case'deskaccounts':_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x54');break;case'zohoaccounts':_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x55');break;case _0xe0dc('0x56'):_0x285e20[_0xe0dc('0x10')]='User';break;case _0xe0dc('0x57'):_0x285e20['childModel']=_0xe0dc('0x58');break;case _0xe0dc('0x59'):_0x285e20['childModel']='Disposition';break;case _0xe0dc('0x5a'):_0x285e20['childModel']=_0xe0dc('0x5b');break;case _0xe0dc('0x5c'):_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x5d');break;case _0xe0dc('0x5e'):_0x285e20[_0xe0dc('0x10')]='Pause';break;case _0xe0dc('0x5f'):_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x60');break;case _0xe0dc('0x61'):_0x285e20[_0xe0dc('0x10')]='Sound';break;case _0xe0dc('0x62'):_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x63');break;case _0xe0dc('0x64'):_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x65');break;case _0xe0dc('0x66'):_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x67');break;case _0xe0dc('0x68'):_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x69');break;case _0xe0dc('0x6a'):_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x6b');break;case _0xe0dc('0x6c'):_0x285e20['childModel']=_0xe0dc('0x6d');break;case _0xe0dc('0x6e'):_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0xc');_0x285e20['parentSections']=[{'name':_0xe0dc('0x6f'),'field':'id','foreignKey':_0xe0dc('0x70')}];break;case _0xe0dc('0x71'):_0x285e20['childModel']='AnalyticMetric';break;}return _0x285e20;}function _0xd7682f(_0x3e1ade,_0x2fb2a3){var _0x52ea45=_0x3e1ade[_0xe0dc('0x72')](0x0)[_0xe0dc('0x73')]()+_0x3e1ade['slice'](0x1);var _0x3de8f9={'type':_0x40bb5a['Sequelize'][_0xe0dc('0x74')][_0xe0dc('0x75')],'raw':!![]};return new Promise(function(_0x523fc4,_0x52f0f4){var _0x239cb7=squel[_0xe0dc('0x76')]()['field'](_0xe0dc('0x77')+_0x52ea45+_0xe0dc('0x78'),'id')[_0xe0dc('0x5')](_0xe0dc('0x79'))['from'](_0xe0dc('0x7a')+_0x3e1ade+'_interactions','ui')['where'](_0xe0dc('0x7b'),_0x2fb2a3['id']);return _0x40bb5a[_0xe0dc('0x7c')]['query'](_0x239cb7[_0xe0dc('0x7d')](),_0x3de8f9)[_0xe0dc('0x7')](function(_0x586f2d){_0x2fb2a3[_0x52ea45+_0xe0dc('0x7e')]=_0x586f2d;_0x523fc4(_0x586f2d);})['catch'](function(_0x42c4ab){_0x52f0f4(_0x42c4ab);});});}return _0x12c386['define'](_0xe0dc('0x7f'),attributes,{'tableName':_0xe0dc('0x80'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x59745e){var _0xe6da35=require(_0xe0dc('0x81'));var _0x4102e0={'raw':_0x59745e['query'][_0xe0dc('0x82')],'where':{}};var _0xe8ed70={};var _0x1a7d41={'count':0x0,'rows':[]};var _0x2eb66c=_0x59745e[_0xe0dc('0x83')][_0xe0dc('0x84')];var _0x1c87e2=_0x59745e[_0xe0dc('0x83')]['mergeResources']||![];var _0x2fa6c3=_0x335978(_0x2eb66c,_0x1c87e2);if(!_0x2fa6c3[_0xe0dc('0x10')])throw new Error('Invalid\x20section\x20\x27'+_0x2eb66c+'\x27');var _0x54b5c4=[{'name':_0x2eb66c}];if(!_[_0xe0dc('0x85')](_0x2fa6c3[_0xe0dc('0x15')]))_0x54b5c4=_0x2fa6c3[_0xe0dc('0x15')];var _0x32f985=[];for(var _0x132c5d=0x0;_0x132c5d<_0x54b5c4['length'];_0x132c5d++){_0x32f985[_0xe0dc('0x86')](_0x40bb5a[_0xe0dc('0x87')][_0xe0dc('0x88')]({'where':{'userProfileId':_0x59745e[_0xe0dc('0x89')]['id'],'name':_0x54b5c4[_0x132c5d]['name']},'raw':!![]}));}return Promise[_0xe0dc('0x8a')](_0x32f985)[_0xe0dc('0x7')](function(_0x5de7f0){var _0x5204fe=_[_0xe0dc('0x4')](_0x5de7f0,function(_0x221e4d){return _0x221e4d?_0x221e4d:undefined;});var _0xbc8e2a=_[_0xe0dc('0x4')](_0x54b5c4,[_0xe0dc('0x8b'),!![]]);var _0x402974=_['isEmpty'](_0x5204fe)&&_[_0xe0dc('0x85')](_0xbc8e2a)?null:_['union'](_0xbc8e2a,_0x5204fe);if(!_0x402974)return null;var _0x4d889e=[];for(var _0x326379=0x0;_0x326379<_0x402974[_0xe0dc('0x8c')];_0x326379++){var _0xc9aff6=_[_0xe0dc('0x88')](_0x54b5c4,function(_0x17e131){return _0x402974[_0x326379]?_0x17e131[_0xe0dc('0x17')]===_0x402974[_0x326379][_0xe0dc('0x17')]:null;});if(_0xc9aff6){if(_0x402974[_0x326379][_0xe0dc('0x8b')]){_0x4d889e[_0xe0dc('0x86')](_0x9dfe7b(_0x2fa6c3[_0xe0dc('0x10')],_0x402974[_0x326379]));}else{if(!_0x402974[_0x326379][_0xe0dc('0x8d')]){_0x4d889e[_0xe0dc('0x86')](_0x1c23af(_0xc9aff6,_0x402974[_0x326379],_0x2fa6c3[_0xe0dc('0x10')]));}else{if(_0xc9aff6['model']){_0x4d889e[_0xe0dc('0x86')](_0xa9e1a4(_0xc9aff6,_0x402974[_0x326379]));}}}}}return Promise[_0xe0dc('0x8a')](_0x4d889e);})[_0xe0dc('0x7')](function(_0x595847){var _0x1d8f58=_0x595847;var _0x15e69b=null;if(_0x1d8f58){_0x15e69b=_0x1d8f58[_0xe0dc('0x8c')]===0x1?_0x1d8f58[0x0]:null;}if(!_0x15e69b&&!_0x1d8f58)return _0x1a7d41;var _0x42b3ea=_0x40bb5a[_0x2fa6c3[_0xe0dc('0x10')]][_0xe0dc('0x8e')];_0xe8ed70[_0xe0dc('0x8f')]=_['keys'](_0x42b3ea);_0xe8ed70[_0xe0dc('0x83')]=_[_0xe0dc('0x90')](_0x59745e[_0xe0dc('0x83')]);_0xe8ed70['filters']=_[_0xe0dc('0x91')](_0xe8ed70[_0xe0dc('0x8f')],_0xe8ed70['query']);_0x4102e0[_0xe0dc('0x92')]=_['intersection'](_0xe8ed70['model'],_0xe6da35[_0xe0dc('0x93')](_0x59745e[_0xe0dc('0x83')][_0xe0dc('0x93')]));_0x4102e0[_0xe0dc('0x92')]=_0x4102e0[_0xe0dc('0x92')][_0xe0dc('0x8c')]?_0x4102e0['attributes']:_0xe8ed70[_0xe0dc('0x8f')];if(!_0x59745e[_0xe0dc('0x83')][_0xe0dc('0x94')](_0xe0dc('0x95'))){_0x4102e0[_0xe0dc('0x96')]=_0xe6da35[_0xe0dc('0x96')](_0x59745e[_0xe0dc('0x83')]['limit']);_0x4102e0[_0xe0dc('0x97')]=_0xe6da35['offset'](_0x59745e[_0xe0dc('0x83')][_0xe0dc('0x97')]);}_0x4102e0[_0xe0dc('0x98')]=_0xe6da35['sort'](_0x59745e[_0xe0dc('0x83')][_0xe0dc('0x99')]);_0x4102e0[_0xe0dc('0x9a')]=_0xe6da35[_0xe0dc('0x9b')](_[_0xe0dc('0x9c')](_0x59745e['query'],_0xe8ed70['filters']));if(_0x59745e[_0xe0dc('0x83')][_0xe0dc('0x4')]){_0x4102e0[_0xe0dc('0x9a')]=_[_0xe0dc('0x9d')](_0x4102e0[_0xe0dc('0x9a')],{'$or':_['map'](_0x42b3ea,function(_0xf4bd5c){if(_0xf4bd5c[_0xe0dc('0xd')][_0xe0dc('0x9e')]!==_0xe0dc('0x9f')){var _0x530f5f={};_0x530f5f[_0xf4bd5c[_0xe0dc('0x5')]]={'$like':'%'+_0x59745e[_0xe0dc('0x83')]['filter']+'%'};return _0x530f5f;}})});}var _0x5607c0=[];var _0x4c5f45=null;var _0x2709f9={};if(_0x15e69b){_0x4c5f45=_[_0xe0dc('0x88')](_0x54b5c4,[_0xe0dc('0x17'),_0x15e69b['name']]);if(_0x4c5f45['field']){_0x2709f9={};if(_0x2fa6c3[_0xe0dc('0x10')]===_0xe0dc('0xc')){_0x2709f9[_0x4c5f45[_0xe0dc('0xa0')]]=_[_0xe0dc('0x9')](_0x15e69b[_0xe0dc('0x8')],'id');}else{_0x2709f9[_0x4c5f45[_0xe0dc('0xa0')]]=_0x15e69b['associatedResources'];}_0x5607c0[_0xe0dc('0x86')](_0x2709f9);}else{_0x4102e0[_0xe0dc('0x9a')]['id']=_0x15e69b[_0xe0dc('0x8')];}}else{for(var _0x4e61ff=0x0;_0x4e61ff<_0x1d8f58[_0xe0dc('0x8c')];_0x4e61ff++){_0x4c5f45=_[_0xe0dc('0x88')](_0x54b5c4,[_0xe0dc('0x17'),_0x1d8f58[_0x4e61ff][_0xe0dc('0x17')]]);if(_0x4c5f45['field']){_0x2709f9={};_0x2709f9[_0x4c5f45[_0xe0dc('0xa0')]]=_0x1d8f58[_0x4e61ff][_0xe0dc('0x8')];_0x5607c0[_0xe0dc('0x86')](_0x2709f9);}else{if(!_0x4102e0[_0xe0dc('0x9a')]['id'])_0x4102e0[_0xe0dc('0x9a')]['id']=[];_0x1d8f58[_0x4e61ff][_0xe0dc('0x8')]['forEach'](function(_0x403fa4){_0x4102e0[_0xe0dc('0x9a')]['id'][_0xe0dc('0x86')](_0x403fa4);});}}}if(!_[_0xe0dc('0x85')](_0x5607c0)){_0x4102e0[_0xe0dc('0x9a')]=_[_0xe0dc('0x9d')](_0x4102e0[_0xe0dc('0x9a')],{'$and':{'$or':_0x5607c0}});}_0x4102e0=_[_0xe0dc('0x9d')]({},_0x4102e0,_0x59745e[_0xe0dc('0xa1')]);if(_0x15e69b&&!_0x15e69b['autoAssociation']&&_0x2fa6c3[_0xe0dc('0x10')]==='AnalyticExtractedReport'){if(_0x59745e[_0xe0dc('0x83')][_0xe0dc('0xa2')]){_0x4102e0[_0xe0dc('0xa3')]=[{'all':!![]}];}return _0x40bb5a[_0x2fa6c3[_0xe0dc('0x10')]][_0xe0dc('0x6')](_0x4102e0)[_0xe0dc('0x7')](function(_0x6b81e1){var _0x160d29=[];_0x6b81e1[_0xe0dc('0xa4')](function(_0x4b6ae4){var _0x3b1113;switch(_0x4b6ae4[_0xe0dc('0xa5')]){case _0xe0dc('0xa6'):_0x3b1113=_['find'](_0x15e69b[_0xe0dc('0x8')],function(_0x5f1e33){return _0x5f1e33['id']===_0x4b6ae4['reportId']&&_0x5f1e33[_0xe0dc('0xd')]===_0xe0dc('0xa7');});break;case _0xe0dc('0xa8'):_0x3b1113=_[_0xe0dc('0x88')](_0x15e69b[_0xe0dc('0x8')],function(_0x2dcb15){return _0x2dcb15['id']===_0x4b6ae4[_0xe0dc('0x70')]&&_0x2dcb15[_0xe0dc('0xd')]==='CustomReports';});break;}if(_0x3b1113)_0x160d29[_0xe0dc('0x86')](_0x4b6ae4);});_0x1a7d41['count']=_0x160d29['length'];_0x1a7d41[_0xe0dc('0xa9')]=_0x160d29;return _0x1a7d41;});}else{if(!_[_0xe0dc('0x85')](_0x59745e[_0xe0dc('0x83')]['ids'])){_0x4102e0[_0xe0dc('0x9a')]['id']=_0x4102e0[_0xe0dc('0x9a')]['id']?_['intersection'](_0x4102e0['where']['id'],_0x59745e[_0xe0dc('0x83')][_0xe0dc('0xaa')]):_0x59745e[_0xe0dc('0x83')][_0xe0dc('0xaa')];if(_0x59745e['query'][_0xe0dc('0xab')]){_0x4102e0['order']=_0x59745e[_0xe0dc('0x83')]['customSorting'];}}if(_0x59745e['query'][_0xe0dc('0xac')]){_0x4102e0['where']=_[_0xe0dc('0x9d')](_0x4102e0['where'],{'$and':_0x59745e[_0xe0dc('0x83')][_0xe0dc('0xac')]});}return _0x40bb5a[_0x2fa6c3['childModel']]['count']({'where':_0x4102e0['where']})['then'](function(_0x124a5c){_0x1a7d41[_0xe0dc('0xad')]=_0x124a5c;if(_0x59745e[_0xe0dc('0x83')]['includeAll']){if(_0x2fa6c3[_0xe0dc('0x10')]===_0xe0dc('0xae')){_0x4102e0['include']=[{'model':_0x40bb5a[_0xe0dc('0x63')],'as':_0xe0dc('0xaf'),'attributes':['id',_0xe0dc('0x17'),_0xe0dc('0xb0')],'required':_0x59745e[_0xe0dc('0x83')][_0xe0dc('0xb1')]?!![]:![]},{'model':_0x40bb5a[_0xe0dc('0x63')],'as':'ThroughTags','attributes':['id',_0xe0dc('0x17'),_0xe0dc('0xb0')],'through':_0x59745e[_0xe0dc('0x83')][_0xe0dc('0xb1')]?{'attributes':[],'where':{'TagId':_0x59745e['query']['tag']||undefined}}:{},'required':_0x59745e[_0xe0dc('0x83')][_0xe0dc('0xb1')]?!![]:![]}];}else{_0x4102e0['include']=[{'all':!![]}];}}return _0x40bb5a[_0x2fa6c3[_0xe0dc('0x10')]][_0xe0dc('0x6')](_0x4102e0);})[_0xe0dc('0x7')](function(_0x12410f){_0x1a7d41['rows']=_0x12410f;if(_0x2eb66c===_0xe0dc('0x2b')&&_0x59745e[_0xe0dc('0x83')][_0xe0dc('0xb2')]===_0xe0dc('0xb3')){var _0x8a0e8d=[];for(var _0x1ae677=0x0;_0x1ae677<_0x1a7d41[_0xe0dc('0xa9')]['length'];_0x1ae677++){_0x8a0e8d[_0xe0dc('0x86')](_0xd7682f(_0xe0dc('0xb4'),_0x1a7d41[_0xe0dc('0xa9')][_0x1ae677][_0xe0dc('0xb5')]));_0x8a0e8d['push'](_0xd7682f(_0xe0dc('0xb6'),_0x1a7d41['rows'][_0x1ae677][_0xe0dc('0xb5')]));_0x8a0e8d['push'](_0xd7682f(_0xe0dc('0xb7'),_0x1a7d41['rows'][_0x1ae677]['dataValues']));_0x8a0e8d['push'](_0xd7682f('mail',_0x1a7d41[_0xe0dc('0xa9')][_0x1ae677]['dataValues']));_0x8a0e8d[_0xe0dc('0x86')](_0xd7682f(_0xe0dc('0xb8'),_0x1a7d41[_0xe0dc('0xa9')][_0x1ae677][_0xe0dc('0xb5')]));_0x8a0e8d[_0xe0dc('0x86')](_0xd7682f('whatsapp',_0x1a7d41[_0xe0dc('0xa9')][_0x1ae677]['dataValues']));}return Promise['all'](_0x8a0e8d)['then'](function(){return _0x1a7d41;});}return _0x1a7d41;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 9f42ec5..fb9e564 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 _0xe0dc=['../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','request','then','info','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfile,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x36ae11,_0x4c334e){var _0x470b3d=function(_0x285be0){while(--_0x285be0){_0x36ae11['push'](_0x36ae11['shift']());}};_0x470b3d(++_0x4c334e);}(_0xe0dc,0x190));var _0xce0d=function(_0x47195e,_0x347734){_0x47195e=_0x47195e-0x0;var _0x571abb=_0xe0dc[_0x47195e];return _0x571abb;};'use strict';var _=require(_0xce0d('0x0'));var util=require('util');var moment=require(_0xce0d('0x1'));var BPromise=require(_0xce0d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xce0d('0x3'));var db=require(_0xce0d('0x4'))['db'];var utils=require(_0xce0d('0x5'));var logger=require(_0xce0d('0x6'))('rpc');var config=require(_0xce0d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xce0d('0x8')][_0xce0d('0x9')]({'port':0x232a});config[_0xce0d('0xa')]=_[_0xce0d('0xb')](config[_0xce0d('0xa')],{'host':_0xce0d('0xc'),'port':0x18eb});var socket=require(_0xce0d('0xd'))(new Redis(config[_0xce0d('0xa')]));require(_0xce0d('0xe'))[_0xce0d('0xf')](socket);function respondWithRpcPromise(_0x29b996,_0xada75a,_0xc0e7c5){return new BPromise(function(_0x3edaad,_0x3a4d42){return client[_0xce0d('0x10')](_0x29b996,_0xc0e7c5)[_0xce0d('0x11')](function(_0x431271){logger[_0xce0d('0x12')]('UserProfile,\x20%s,\x20%s',_0xada75a,_0xce0d('0x13'));logger[_0xce0d('0x14')](_0xce0d('0x15'),_0xada75a,_0xce0d('0x13'),JSON[_0xce0d('0x16')](_0x431271));if(_0x431271[_0xce0d('0x17')]){if(_0x431271[_0xce0d('0x17')][_0xce0d('0x18')]===0x1f4){logger[_0xce0d('0x17')](_0xce0d('0x19'),_0xada75a,_0x431271[_0xce0d('0x17')][_0xce0d('0x1a')]);return _0x3a4d42(_0x431271[_0xce0d('0x17')][_0xce0d('0x1a')]);}logger[_0xce0d('0x17')](_0xce0d('0x19'),_0xada75a,_0x431271[_0xce0d('0x17')][_0xce0d('0x1a')]);return _0x3edaad(_0x431271[_0xce0d('0x17')][_0xce0d('0x1a')]);}else{logger[_0xce0d('0x12')](_0xce0d('0x19'),_0xada75a,_0xce0d('0x13'));_0x3edaad(_0x431271[_0xce0d('0x1b')][_0xce0d('0x1a')]);}})[_0xce0d('0x1c')](function(_0x1f4049){logger[_0xce0d('0x17')](_0xce0d('0x19'),_0xada75a,_0x1f4049);_0x3a4d42(_0x1f4049);});});} \ No newline at end of file +var _0xf61e=['info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','register','request','then'];(function(_0x5a9cb4,_0x18ac0c){var _0x480931=function(_0x5d7e69){while(--_0x5d7e69){_0x5a9cb4['push'](_0x5a9cb4['shift']());}};_0x480931(++_0x18ac0c);}(_0xf61e,0x191));var _0xef61=function(_0x384ddd,_0x3aaf88){_0x384ddd=_0x384ddd-0x0;var _0x355ee6=_0xf61e[_0x384ddd];return _0x355ee6;};'use strict';var _=require(_0xef61('0x0'));var util=require(_0xef61('0x1'));var moment=require(_0xef61('0x2'));var BPromise=require(_0xef61('0x3'));var rs=require(_0xef61('0x4'));var fs=require('fs');var Redis=require(_0xef61('0x5'));var db=require(_0xef61('0x6'))['db'];var utils=require(_0xef61('0x7'));var logger=require(_0xef61('0x8'))(_0xef61('0x9'));var config=require(_0xef61('0xa'));var jayson=require(_0xef61('0xb'));var client=jayson['client'][_0xef61('0xc')]({'port':0x232a});config[_0xef61('0xd')]=_['defaults'](config[_0xef61('0xd')],{'host':_0xef61('0xe'),'port':0x18eb});var socket=require(_0xef61('0xf'))(new Redis(config['redis']));require('./userProfile.socket')[_0xef61('0x10')](socket);function respondWithRpcPromise(_0x2e28c7,_0x1ab79d,_0x11181b){return new BPromise(function(_0x2af74c,_0xdcd707){return client[_0xef61('0x11')](_0x2e28c7,_0x11181b)[_0xef61('0x12')](function(_0x237f43){logger[_0xef61('0x13')](_0xef61('0x14'),_0x1ab79d,_0xef61('0x15'));logger[_0xef61('0x16')](_0xef61('0x17'),_0x1ab79d,'request\x20sent',JSON[_0xef61('0x18')](_0x237f43));if(_0x237f43['error']){if(_0x237f43[_0xef61('0x19')][_0xef61('0x1a')]===0x1f4){logger[_0xef61('0x19')](_0xef61('0x14'),_0x1ab79d,_0x237f43['error'][_0xef61('0x1b')]);return _0xdcd707(_0x237f43[_0xef61('0x19')][_0xef61('0x1b')]);}logger[_0xef61('0x19')]('UserProfile,\x20%s,\x20%s',_0x1ab79d,_0x237f43[_0xef61('0x19')][_0xef61('0x1b')]);return _0x2af74c(_0x237f43['error'][_0xef61('0x1b')]);}else{logger[_0xef61('0x13')](_0xef61('0x14'),_0x1ab79d,_0xef61('0x15'));_0x2af74c(_0x237f43[_0xef61('0x1c')][_0xef61('0x1b')]);}})[_0xef61('0x1d')](function(_0x55f887){logger[_0xef61('0x19')](_0xef61('0x14'),_0x1ab79d,_0x55f887);_0xdcd707(_0x55f887);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index fa4cbb2..3899926 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 _0x9d47=['save','remove','update','emit','register','userProfile:','./userProfile.events'];(function(_0x12f6ba,_0x2c0869){var _0x4fc850=function(_0x49b9b4){while(--_0x49b9b4){_0x12f6ba['push'](_0x12f6ba['shift']());}};_0x4fc850(++_0x2c0869);}(_0x9d47,0x6f));var _0x79d4=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x9d47[_0x3ab51d];return _0x29a04e;};'use strict';var UserProfileEvents=require(_0x79d4('0x0'));var events=[_0x79d4('0x1'),_0x79d4('0x2'),_0x79d4('0x3')];function createListener(_0x11959a,_0x52d950){return function(_0x326e75){_0x52d950[_0x79d4('0x4')](_0x11959a,_0x326e75);};}function removeListener(_0x478d0d,_0x3bd1f0){return function(){UserProfileEvents['removeListener'](_0x478d0d,_0x3bd1f0);};}exports[_0x79d4('0x5')]=function(_0x499a81){for(var _0x5f3de5=0x0,_0x2e7293=events['length'];_0x5f3de5<_0x2e7293;_0x5f3de5++){var _0x2058da=events[_0x5f3de5];var _0x393e47=createListener(_0x79d4('0x6')+_0x2058da,_0x499a81);UserProfileEvents['on'](_0x2058da,_0x393e47);}}; \ No newline at end of file +var _0x1fd6=['register','length','userProfile:','save','remove','emit','removeListener'];(function(_0x3939f8,_0x436924){var _0x2ac221=function(_0x37cb33){while(--_0x37cb33){_0x3939f8['push'](_0x3939f8['shift']());}};_0x2ac221(++_0x436924);}(_0x1fd6,0x1c3));var _0x61fd=function(_0x4758b7,_0x313703){_0x4758b7=_0x4758b7-0x0;var _0x1c6af0=_0x1fd6[_0x4758b7];return _0x1c6af0;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0x61fd('0x0'),_0x61fd('0x1'),'update'];function createListener(_0x116676,_0x322bf3){return function(_0xe4ac74){_0x322bf3[_0x61fd('0x2')](_0x116676,_0xe4ac74);};}function removeListener(_0x12e84c,_0x4c9096){return function(){UserProfileEvents[_0x61fd('0x3')](_0x12e84c,_0x4c9096);};}exports[_0x61fd('0x4')]=function(_0x5bcbe3){for(var _0x182ec7=0x0,_0x2d2e31=events[_0x61fd('0x5')];_0x182ec7<_0x2d2e31;_0x182ec7++){var _0x129305=events[_0x182ec7];var _0x32b608=createListener(_0x61fd('0x6')+_0x129305,_0x5bcbe3);UserProfileEvents['on'](_0x129305,_0x32b608);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 7545ad3..aed9076 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 _0x63f8=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfileResource.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create','put','update','delete','destroy','exports','multer'];(function(_0x1263c4,_0x4a8c55){var _0x174b7b=function(_0x544628){while(--_0x544628){_0x1263c4['push'](_0x1263c4['shift']());}};_0x174b7b(++_0x4a8c55);}(_0x63f8,0x1a1));var _0x863f=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x63f8[_0x580576];return _0x3f55a0;};'use strict';var multer=require(_0x863f('0x0'));var util=require(_0x863f('0x1'));var path=require(_0x863f('0x2'));var timeout=require(_0x863f('0x3'));var express=require('express');var router=express[_0x863f('0x4')]();var fs_extra=require(_0x863f('0x5'));var auth=require(_0x863f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x863f('0x7'));var controller=require(_0x863f('0x8'));router['get']('/',auth[_0x863f('0x9')](),controller[_0x863f('0xa')]);router[_0x863f('0xb')](_0x863f('0xc'),auth['isAuthenticated'](),controller[_0x863f('0xd')]);router[_0x863f('0xb')](_0x863f('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x863f('0xf')]('/',auth[_0x863f('0x9')](),controller[_0x863f('0x10')]);router[_0x863f('0x11')](_0x863f('0xe'),auth[_0x863f('0x9')](),controller[_0x863f('0x12')]);router[_0x863f('0x13')](_0x863f('0xe'),auth[_0x863f('0x9')](),controller[_0x863f('0x14')]);module[_0x863f('0x15')]=router; \ No newline at end of file +var _0xe5f7=['get','isAuthenticated','index','/describe','describe','show','post','create','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0x5ef55a,_0x2a03b1){var _0x20ae40=function(_0x46ce81){while(--_0x46ce81){_0x5ef55a['push'](_0x5ef55a['shift']());}};_0x20ae40(++_0x2a03b1);}(_0xe5f7,0xa5));var _0x7e5f=function(_0x55fdfa,_0x1ccfe3){_0x55fdfa=_0x55fdfa-0x0;var _0x1a23f9=_0xe5f7[_0x55fdfa];return _0x1a23f9;};'use strict';var multer=require('multer');var util=require(_0x7e5f('0x0'));var path=require(_0x7e5f('0x1'));var timeout=require(_0x7e5f('0x2'));var express=require(_0x7e5f('0x3'));var router=express['Router']();var fs_extra=require(_0x7e5f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7e5f('0x5'));var config=require('../../config/environment');var controller=require('./userProfileResource.controller');router[_0x7e5f('0x6')]('/',auth[_0x7e5f('0x7')](),controller[_0x7e5f('0x8')]);router[_0x7e5f('0x6')](_0x7e5f('0x9'),auth[_0x7e5f('0x7')](),controller[_0x7e5f('0xa')]);router[_0x7e5f('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x7e5f('0xb')]);router[_0x7e5f('0xc')]('/',auth[_0x7e5f('0x7')](),controller[_0x7e5f('0xd')]);router['put'](_0x7e5f('0xe'),auth['isAuthenticated'](),controller[_0x7e5f('0xf')]);router[_0x7e5f('0x10')](_0x7e5f('0xe'),auth[_0x7e5f('0x7')](),controller[_0x7e5f('0x11')]);module[_0x7e5f('0x12')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index be3cf3a..d45c6f2 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 _0xb336=['exports','STRING','sequelize'];(function(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0xb336,0x16d));var _0x6b33=function(_0x23d4ea,_0x36d4d2){_0x23d4ea=_0x23d4ea-0x0;var _0x737b39=_0xb336[_0x23d4ea];return _0x737b39;};'use strict';var Sequelize=require(_0x6b33('0x0'));module[_0x6b33('0x1')]={'name':{'type':Sequelize[_0x6b33('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0x6b33('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xb827=['INTEGER','sequelize','exports','STRING'];(function(_0x262b32,_0x279676){var _0xcf633b=function(_0xf6e237){while(--_0xf6e237){_0x262b32['push'](_0x262b32['shift']());}};_0xcf633b(++_0x279676);}(_0xb827,0x81));var _0x7b82=function(_0x3b3cee,_0x4a3190){_0x3b3cee=_0x3b3cee-0x0;var _0x5e4cbf=_0xb827[_0x3b3cee];return _0x5e4cbf;};'use strict';var Sequelize=require(_0x7b82('0x0'));module[_0x7b82('0x1')]={'name':{'type':Sequelize[_0x7b82('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x7b82('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 8f29e03..4fff9a3 100644 --- a/server/api/userProfileResource/userProfileResource.controller.js +++ b/server/api/userProfileResource/userProfileResource.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4137=['key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','show','params','includeAll','options','find','catch','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','json','offset','limit','count','set','apply','reject','save','update','destroy','then','end','sendStatus','error','name','send','index','map','UserProfileResource','rawAttributes','type'];(function(_0x20255b,_0x52aa07){var _0x81fe0a=function(_0x161c2d){while(--_0x161c2d){_0x20255b['push'](_0x20255b['shift']());}};_0x81fe0a(++_0x52aa07);}(_0x4137,0xf8));var _0x7413=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x4137[_0x178e48];return _0x440d7e;};'use strict';var emlformat=require(_0x7413('0x0'));var rimraf=require(_0x7413('0x1'));var zipdir=require(_0x7413('0x2'));var jsonpatch=require(_0x7413('0x3'));var rp=require(_0x7413('0x4'));var moment=require(_0x7413('0x5'));var BPromise=require(_0x7413('0x6'));var Mustache=require(_0x7413('0x7'));var util=require(_0x7413('0x8'));var path=require(_0x7413('0x9'));var sox=require(_0x7413('0xa'));var csv=require(_0x7413('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7413('0xc'));var _=require(_0x7413('0xd'));var squel=require(_0x7413('0xe'));var crypto=require(_0x7413('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x7413('0x10'));var toCsv=require(_0x7413('0xb'));var querystring=require('querystring');var Papa=require(_0x7413('0x11'));var Redis=require(_0x7413('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7413('0x13'));var as=require(_0x7413('0x14'));var hardwareService=require(_0x7413('0x15'));var logger=require(_0x7413('0x16'))(_0x7413('0x17'));var utils=require('../../config/utils');var config=require(_0x7413('0x18'));var licenseUtil=require(_0x7413('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18a874,_0xa26ca4){_0xa26ca4=_0xa26ca4||0xcc;return function(_0x13e6bd){if(_0x13e6bd){return _0x18a874['sendStatus'](_0xa26ca4);}return _0x18a874['status'](_0xa26ca4)['end']();};}function respondWithResult(_0x2267f6,_0x336c4c){_0x336c4c=_0x336c4c||0xc8;return function(_0x49f0f6){if(_0x49f0f6){return _0x2267f6[_0x7413('0x1a')](_0x336c4c)[_0x7413('0x1b')](_0x49f0f6);}};}function respondWithFilteredResult(_0x4955d3,_0x38b3d1){return function(_0x50f301){if(_0x50f301){var _0x4b9a5b=typeof _0x38b3d1[_0x7413('0x1c')]==='undefined'&&typeof _0x38b3d1[_0x7413('0x1d')]==='undefined';var _0x2036b6=_0x50f301[_0x7413('0x1e')];var _0x19157f=_0x4b9a5b?0x0:_0x38b3d1[_0x7413('0x1c')];var _0x2a3417=_0x4b9a5b?_0x50f301[_0x7413('0x1e')]:_0x38b3d1['offset']+_0x38b3d1[_0x7413('0x1d')];var _0x17c062;if(_0x2a3417>=_0x2036b6){_0x2a3417=_0x2036b6;_0x17c062=0xc8;}else{_0x17c062=0xce;}_0x4955d3[_0x7413('0x1a')](_0x17c062);return _0x4955d3[_0x7413('0x1f')]('Content-Range',_0x19157f+'-'+_0x2a3417+'/'+_0x2036b6)[_0x7413('0x1b')](_0x50f301);}return null;};}function patchUpdates(_0x12d94d){return function(_0x206afc){try{jsonpatch[_0x7413('0x20')](_0x206afc,_0x12d94d,!![]);}catch(_0x409392){return BPromise[_0x7413('0x21')](_0x409392);}return _0x206afc[_0x7413('0x22')]();};}function saveUpdates(_0x4e18cb,_0x56a06a){return function(_0x5f12a2){if(_0x5f12a2){return _0x5f12a2[_0x7413('0x23')](_0x4e18cb)['then'](function(_0x1585ba){return _0x1585ba;});}return null;};}function removeEntity(_0x372944,_0x3b0c81){return function(_0x2fc0f4){if(_0x2fc0f4){return _0x2fc0f4[_0x7413('0x24')]()[_0x7413('0x25')](function(){_0x372944[_0x7413('0x1a')](0xcc)[_0x7413('0x26')]();});}};}function handleEntityNotFound(_0x1d455b,_0x5a8329){return function(_0x5cb15f){if(!_0x5cb15f){_0x1d455b[_0x7413('0x27')](0x194);}return _0x5cb15f;};}function handleError(_0x48c2dc,_0x46c895){_0x46c895=_0x46c895||0x1f4;return function(_0x71cbb4){logger[_0x7413('0x28')](_0x71cbb4['stack']);if(_0x71cbb4[_0x7413('0x29')]){delete _0x71cbb4[_0x7413('0x29')];}_0x48c2dc[_0x7413('0x1a')](_0x46c895)[_0x7413('0x2a')](_0x71cbb4);};}exports[_0x7413('0x2b')]=function(_0x2e521f,_0x5eb4d9){var _0x24dce7={},_0x4ed662={},_0x1d0bde={'count':0x0,'rows':[]};var _0x23e682=_[_0x7413('0x2c')](db[_0x7413('0x2d')][_0x7413('0x2e')],function(_0x2004ea){return{'name':_0x2004ea['fieldName'],'type':_0x2004ea[_0x7413('0x2f')][_0x7413('0x30')]};});_0x4ed662[_0x7413('0x31')]=_[_0x7413('0x2c')](_0x23e682,_0x7413('0x29'));_0x4ed662[_0x7413('0x32')]=_[_0x7413('0x33')](_0x2e521f['query']);_0x4ed662[_0x7413('0x34')]=_[_0x7413('0x35')](_0x4ed662[_0x7413('0x31')],_0x4ed662[_0x7413('0x32')]);_0x24dce7[_0x7413('0x36')]=_['intersection'](_0x4ed662[_0x7413('0x31')],qs['fields'](_0x2e521f[_0x7413('0x32')][_0x7413('0x37')]));_0x24dce7[_0x7413('0x36')]=_0x24dce7['attributes'][_0x7413('0x38')]?_0x24dce7['attributes']:_0x4ed662[_0x7413('0x31')];if(!_0x2e521f[_0x7413('0x32')]['hasOwnProperty']('nolimit')){_0x24dce7[_0x7413('0x1d')]=qs[_0x7413('0x1d')](_0x2e521f[_0x7413('0x32')]['limit']);_0x24dce7['offset']=qs[_0x7413('0x1c')](_0x2e521f['query']['offset']);}_0x24dce7[_0x7413('0x39')]=qs['sort'](_0x2e521f[_0x7413('0x32')][_0x7413('0x3a')]);_0x24dce7[_0x7413('0x3b')]=qs[_0x7413('0x34')](_[_0x7413('0x3c')](_0x2e521f['query'],_0x4ed662[_0x7413('0x34')]),_0x23e682);if(_0x2e521f[_0x7413('0x32')][_0x7413('0x3d')]){_0x24dce7[_0x7413('0x3b')]=_[_0x7413('0x3e')](_0x24dce7[_0x7413('0x3b')],{'$or':_[_0x7413('0x2c')](_0x23e682,function(_0x385156){if(_0x385156[_0x7413('0x2f')]!==_0x7413('0x3f')){var _0x5c03eb={};_0x5c03eb[_0x385156[_0x7413('0x29')]]={'$like':'%'+_0x2e521f['query'][_0x7413('0x3d')]+'%'};return _0x5c03eb;}})});}_0x24dce7=_['merge']({},_0x24dce7,_0x2e521f['options']);var _0x5b592c={'where':_0x24dce7['where']};return db['UserProfileResource'][_0x7413('0x1e')](_0x5b592c)['then'](function(_0x535e49){_0x1d0bde[_0x7413('0x1e')]=_0x535e49;if(_0x2e521f['query']['includeAll']){_0x24dce7[_0x7413('0x40')]=[{'all':!![]}];}return db[_0x7413('0x2d')][_0x7413('0x41')](_0x24dce7);})[_0x7413('0x25')](function(_0x8049c0){_0x1d0bde['rows']=_0x8049c0;return _0x1d0bde;})[_0x7413('0x25')](respondWithFilteredResult(_0x5eb4d9,_0x24dce7))['catch'](handleError(_0x5eb4d9,null));};exports[_0x7413('0x42')]=function(_0x1d8219,_0xa063d1){var _0xfe0daa={'raw':![],'where':{'id':_0x1d8219[_0x7413('0x43')]['id']}},_0x3f7da2={};_0x3f7da2[_0x7413('0x31')]=_[_0x7413('0x33')](db[_0x7413('0x2d')][_0x7413('0x2e')]);_0x3f7da2[_0x7413('0x32')]=_[_0x7413('0x33')](_0x1d8219[_0x7413('0x32')]);_0x3f7da2['filters']=_[_0x7413('0x35')](_0x3f7da2[_0x7413('0x31')],_0x3f7da2[_0x7413('0x32')]);_0xfe0daa[_0x7413('0x36')]=_[_0x7413('0x35')](_0x3f7da2[_0x7413('0x31')],qs[_0x7413('0x37')](_0x1d8219[_0x7413('0x32')][_0x7413('0x37')]));_0xfe0daa[_0x7413('0x36')]=_0xfe0daa[_0x7413('0x36')]['length']?_0xfe0daa[_0x7413('0x36')]:_0x3f7da2['model'];if(_0x1d8219[_0x7413('0x32')][_0x7413('0x44')]){_0xfe0daa[_0x7413('0x40')]=[{'all':!![]}];}_0xfe0daa=_[_0x7413('0x3e')]({},_0xfe0daa,_0x1d8219[_0x7413('0x45')]);return db[_0x7413('0x2d')][_0x7413('0x46')](_0xfe0daa)[_0x7413('0x25')](handleEntityNotFound(_0xa063d1,null))[_0x7413('0x25')](respondWithResult(_0xa063d1,null))[_0x7413('0x47')](handleError(_0xa063d1,null));};exports['create']=function(_0x513657,_0x3c1f1a){return db['UserProfileResource']['create'](_0x513657[_0x7413('0x48')],{})[_0x7413('0x25')](respondWithResult(_0x3c1f1a,0xc9))['catch'](handleError(_0x3c1f1a,null));};exports[_0x7413('0x23')]=function(_0x586d25,_0x562bae){if(_0x586d25[_0x7413('0x48')]['id']){delete _0x586d25['body']['id'];}return db[_0x7413('0x2d')][_0x7413('0x46')]({'where':{'id':_0x586d25[_0x7413('0x43')]['id']}})[_0x7413('0x25')](handleEntityNotFound(_0x562bae,null))[_0x7413('0x25')](saveUpdates(_0x586d25[_0x7413('0x48')],null))[_0x7413('0x25')](respondWithResult(_0x562bae,null))[_0x7413('0x47')](handleError(_0x562bae,null));};exports[_0x7413('0x24')]=function(_0x2031e3,_0x50a27d){return db[_0x7413('0x2d')]['find']({'where':{'id':_0x2031e3['params']['id']}})['then'](handleEntityNotFound(_0x50a27d,null))[_0x7413('0x25')](removeEntity(_0x50a27d,null))[_0x7413('0x47')](handleError(_0x50a27d,null));};exports[_0x7413('0x49')]=function(_0x1ba4e9,_0x4bc337){return db['UserProfileResource'][_0x7413('0x49')]()['then'](respondWithResult(_0x4bc337,null))[_0x7413('0x47')](handleError(_0x4bc337,null));}; \ No newline at end of file +var _0xe2fe=['find','body','params','describe','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','api','../../mysqldb','sendStatus','status','offset','limit','count','set','Content-Range','json','reject','save','update','then','destroy','end','name','send','index','map','UserProfileResource','rawAttributes','type','key','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show'];(function(_0x4eb30f,_0x2bfad8){var _0xc26a9a=function(_0x3a0418){while(--_0x3a0418){_0x4eb30f['push'](_0x4eb30f['shift']());}};_0xc26a9a(++_0x2bfad8);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xee2f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xee2f('0x1'));var rp=require('request-promise');var moment=require(_0xee2f('0x2'));var BPromise=require(_0xee2f('0x3'));var Mustache=require(_0xee2f('0x4'));var util=require(_0xee2f('0x5'));var path=require(_0xee2f('0x6'));var sox=require('sox');var csv=require(_0xee2f('0x7'));var ejs=require(_0xee2f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee2f('0x9'));var squel=require(_0xee2f('0xa'));var crypto=require('crypto');var jsforce=require(_0xee2f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xee2f('0x7'));var querystring=require(_0xee2f('0xc'));var Papa=require('papaparse');var Redis=require(_0xee2f('0xd'));var authService=require(_0xee2f('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xee2f('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xee2f('0x10'))['db'];function respondWithStatusCode(_0x346dbc,_0xa13e7b){_0xa13e7b=_0xa13e7b||0xcc;return function(_0x100449){if(_0x100449){return _0x346dbc[_0xee2f('0x11')](_0xa13e7b);}return _0x346dbc[_0xee2f('0x12')](_0xa13e7b)['end']();};}function respondWithResult(_0x3861e6,_0x531c3a){_0x531c3a=_0x531c3a||0xc8;return function(_0x36db10){if(_0x36db10){return _0x3861e6[_0xee2f('0x12')](_0x531c3a)['json'](_0x36db10);}};}function respondWithFilteredResult(_0x445ba8,_0x145241){return function(_0x28b614){if(_0x28b614){var _0x1bbf7d=typeof _0x145241[_0xee2f('0x13')]==='undefined'&&typeof _0x145241[_0xee2f('0x14')]==='undefined';var _0x17d288=_0x28b614[_0xee2f('0x15')];var _0x502eb6=_0x1bbf7d?0x0:_0x145241['offset'];var _0x40b5bc=_0x1bbf7d?_0x28b614['count']:_0x145241[_0xee2f('0x13')]+_0x145241[_0xee2f('0x14')];var _0x28549d;if(_0x40b5bc>=_0x17d288){_0x40b5bc=_0x17d288;_0x28549d=0xc8;}else{_0x28549d=0xce;}_0x445ba8['status'](_0x28549d);return _0x445ba8[_0xee2f('0x16')](_0xee2f('0x17'),_0x502eb6+'-'+_0x40b5bc+'/'+_0x17d288)[_0xee2f('0x18')](_0x28b614);}return null;};}function patchUpdates(_0x21fdf4){return function(_0x3d892d){try{jsonpatch['apply'](_0x3d892d,_0x21fdf4,!![]);}catch(_0x5e73ad){return BPromise[_0xee2f('0x19')](_0x5e73ad);}return _0x3d892d[_0xee2f('0x1a')]();};}function saveUpdates(_0x1ea808,_0x203b2f){return function(_0x472e3b){if(_0x472e3b){return _0x472e3b[_0xee2f('0x1b')](_0x1ea808)[_0xee2f('0x1c')](function(_0x4d68d3){return _0x4d68d3;});}return null;};}function removeEntity(_0x250399,_0x2c47c5){return function(_0x15ceda){if(_0x15ceda){return _0x15ceda[_0xee2f('0x1d')]()[_0xee2f('0x1c')](function(){_0x250399[_0xee2f('0x12')](0xcc)[_0xee2f('0x1e')]();});}};}function handleEntityNotFound(_0x13013f,_0x382174){return function(_0x1e394f){if(!_0x1e394f){_0x13013f[_0xee2f('0x11')](0x194);}return _0x1e394f;};}function handleError(_0x168adc,_0x1c8454){_0x1c8454=_0x1c8454||0x1f4;return function(_0x45c4a0){logger['error'](_0x45c4a0['stack']);if(_0x45c4a0['name']){delete _0x45c4a0[_0xee2f('0x1f')];}_0x168adc[_0xee2f('0x12')](_0x1c8454)[_0xee2f('0x20')](_0x45c4a0);};}exports[_0xee2f('0x21')]=function(_0x892a4e,_0x3737fd){var _0x4d8398={},_0x3d3806={},_0x52e1fa={'count':0x0,'rows':[]};var _0x235697=_[_0xee2f('0x22')](db[_0xee2f('0x23')][_0xee2f('0x24')],function(_0x3ddbe3){return{'name':_0x3ddbe3['fieldName'],'type':_0x3ddbe3[_0xee2f('0x25')][_0xee2f('0x26')]};});_0x3d3806['model']=_['map'](_0x235697,_0xee2f('0x1f'));_0x3d3806['query']=_[_0xee2f('0x27')](_0x892a4e[_0xee2f('0x28')]);_0x3d3806['filters']=_[_0xee2f('0x29')](_0x3d3806['model'],_0x3d3806['query']);_0x4d8398['attributes']=_[_0xee2f('0x29')](_0x3d3806[_0xee2f('0x2a')],qs['fields'](_0x892a4e[_0xee2f('0x28')][_0xee2f('0x2b')]));_0x4d8398[_0xee2f('0x2c')]=_0x4d8398[_0xee2f('0x2c')][_0xee2f('0x2d')]?_0x4d8398['attributes']:_0x3d3806[_0xee2f('0x2a')];if(!_0x892a4e['query'][_0xee2f('0x2e')](_0xee2f('0x2f'))){_0x4d8398[_0xee2f('0x14')]=qs['limit'](_0x892a4e[_0xee2f('0x28')]['limit']);_0x4d8398[_0xee2f('0x13')]=qs['offset'](_0x892a4e[_0xee2f('0x28')][_0xee2f('0x13')]);}_0x4d8398[_0xee2f('0x30')]=qs[_0xee2f('0x31')](_0x892a4e[_0xee2f('0x28')][_0xee2f('0x31')]);_0x4d8398[_0xee2f('0x32')]=qs[_0xee2f('0x33')](_[_0xee2f('0x34')](_0x892a4e[_0xee2f('0x28')],_0x3d3806[_0xee2f('0x33')]),_0x235697);if(_0x892a4e['query'][_0xee2f('0x35')]){_0x4d8398['where']=_[_0xee2f('0x36')](_0x4d8398[_0xee2f('0x32')],{'$or':_[_0xee2f('0x22')](_0x235697,function(_0x2cbb89){if(_0x2cbb89[_0xee2f('0x25')]!==_0xee2f('0x37')){var _0x694950={};_0x694950[_0x2cbb89[_0xee2f('0x1f')]]={'$like':'%'+_0x892a4e['query']['filter']+'%'};return _0x694950;}})});}_0x4d8398=_['merge']({},_0x4d8398,_0x892a4e[_0xee2f('0x38')]);var _0x5483ae={'where':_0x4d8398[_0xee2f('0x32')]};return db['UserProfileResource']['count'](_0x5483ae)['then'](function(_0x58e361){_0x52e1fa[_0xee2f('0x15')]=_0x58e361;if(_0x892a4e[_0xee2f('0x28')][_0xee2f('0x39')]){_0x4d8398[_0xee2f('0x3a')]=[{'all':!![]}];}return db['UserProfileResource']['findAll'](_0x4d8398);})[_0xee2f('0x1c')](function(_0x5e12b7){_0x52e1fa['rows']=_0x5e12b7;return _0x52e1fa;})[_0xee2f('0x1c')](respondWithFilteredResult(_0x3737fd,_0x4d8398))[_0xee2f('0x3b')](handleError(_0x3737fd,null));};exports[_0xee2f('0x3c')]=function(_0x54130b,_0x3bc173){var _0x27c447={'raw':![],'where':{'id':_0x54130b['params']['id']}},_0x19bd4d={};_0x19bd4d['model']=_[_0xee2f('0x27')](db[_0xee2f('0x23')][_0xee2f('0x24')]);_0x19bd4d[_0xee2f('0x28')]=_['keys'](_0x54130b[_0xee2f('0x28')]);_0x19bd4d[_0xee2f('0x33')]=_[_0xee2f('0x29')](_0x19bd4d[_0xee2f('0x2a')],_0x19bd4d[_0xee2f('0x28')]);_0x27c447[_0xee2f('0x2c')]=_[_0xee2f('0x29')](_0x19bd4d[_0xee2f('0x2a')],qs[_0xee2f('0x2b')](_0x54130b[_0xee2f('0x28')]['fields']));_0x27c447['attributes']=_0x27c447['attributes']['length']?_0x27c447[_0xee2f('0x2c')]:_0x19bd4d[_0xee2f('0x2a')];if(_0x54130b[_0xee2f('0x28')][_0xee2f('0x39')]){_0x27c447[_0xee2f('0x3a')]=[{'all':!![]}];}_0x27c447=_['merge']({},_0x27c447,_0x54130b[_0xee2f('0x38')]);return db[_0xee2f('0x23')][_0xee2f('0x3d')](_0x27c447)[_0xee2f('0x1c')](handleEntityNotFound(_0x3bc173,null))['then'](respondWithResult(_0x3bc173,null))['catch'](handleError(_0x3bc173,null));};exports['create']=function(_0x1609f0,_0x54cc44){return db['UserProfileResource']['create'](_0x1609f0['body'],{})[_0xee2f('0x1c')](respondWithResult(_0x54cc44,0xc9))[_0xee2f('0x3b')](handleError(_0x54cc44,null));};exports[_0xee2f('0x1b')]=function(_0x584383,_0x22506e){if(_0x584383['body']['id']){delete _0x584383[_0xee2f('0x3e')]['id'];}return db[_0xee2f('0x23')][_0xee2f('0x3d')]({'where':{'id':_0x584383[_0xee2f('0x3f')]['id']}})[_0xee2f('0x1c')](handleEntityNotFound(_0x22506e,null))['then'](saveUpdates(_0x584383['body'],null))[_0xee2f('0x1c')](respondWithResult(_0x22506e,null))['catch'](handleError(_0x22506e,null));};exports[_0xee2f('0x1d')]=function(_0x282e89,_0x1928f8){return db[_0xee2f('0x23')]['find']({'where':{'id':_0x282e89['params']['id']}})[_0xee2f('0x1c')](handleEntityNotFound(_0x1928f8,null))[_0xee2f('0x1c')](removeEntity(_0x1928f8,null))[_0xee2f('0x3b')](handleError(_0x1928f8,null));};exports[_0xee2f('0x40')]=function(_0x3acae6,_0x2a450f){return db[_0xee2f('0x23')][_0xee2f('0x40')]()[_0xee2f('0x1c')](respondWithResult(_0x2a450f,null))[_0xee2f('0x3b')](handleError(_0x2a450f,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 50acd6b..17bf411 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 _0x533a=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','exports','UserProfileResource','compositeIndex','sectionId','lodash','util','../../config/logger'];(function(_0x4e2fa7,_0x26fd4e){var _0x23f7d2=function(_0x46d0ff){while(--_0x46d0ff){_0x4e2fa7['push'](_0x4e2fa7['shift']());}};_0x23f7d2(++_0x26fd4e);}(_0x533a,0x1a1));var _0xa533=function(_0x41a6b1,_0x33302b){_0x41a6b1=_0x41a6b1-0x0;var _0x26a187=_0x533a[_0x41a6b1];return _0x26a187;};'use strict';var _=require(_0xa533('0x0'));var util=require(_0xa533('0x1'));var logger=require(_0xa533('0x2'))(_0xa533('0x3'));var moment=require(_0xa533('0x4'));var BPromise=require(_0xa533('0x5'));var rp=require(_0xa533('0x6'));var fs=require('fs');var path=require(_0xa533('0x7'));var rimraf=require(_0xa533('0x8'));var config=require(_0xa533('0x9'));var attributes=require(_0xa533('0xa'));module[_0xa533('0xb')]=function(_0x4117df,_0x4dea2a){return _0x4117df['define'](_0xa533('0xc'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0xa533('0xd'),'fields':['resourceId',_0xa533('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc79c=['rimraf','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','sectionId','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x416cdc,_0x213b87){var _0x1931ce=function(_0x1dc762){while(--_0x1dc762){_0x416cdc['push'](_0x416cdc['shift']());}};_0x1931ce(++_0x213b87);}(_0xc79c,0x89));var _0xcc79=function(_0x59cda0,_0x23471b){_0x59cda0=_0x59cda0-0x0;var _0xe8f9cf=_0xc79c[_0x59cda0];return _0xe8f9cf;};'use strict';var _=require(_0xcc79('0x0'));var util=require('util');var logger=require(_0xcc79('0x1'))(_0xcc79('0x2'));var moment=require(_0xcc79('0x3'));var BPromise=require(_0xcc79('0x4'));var rp=require(_0xcc79('0x5'));var fs=require('fs');var path=require(_0xcc79('0x6'));var rimraf=require(_0xcc79('0x7'));var config=require(_0xcc79('0x8'));var attributes=require(_0xcc79('0x9'));module[_0xcc79('0xa')]=function(_0x3c4be4,_0x4bd010){return _0x3c4be4[_0xcc79('0xb')](_0xcc79('0xc'),attributes,{'tableName':_0xcc79('0xd'),'paranoid':![],'indexes':[{'name':_0xcc79('0xe'),'fields':['resourceId',_0xcc79('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 0ce3c34..0b8fc96 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 _0xe78e=['debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error','code','UserProfileResource,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info'];(function(_0x24cbb1,_0x3cf470){var _0x5382c1=function(_0x37922b){while(--_0x37922b){_0x24cbb1['push'](_0x24cbb1['shift']());}};_0x5382c1(++_0x3cf470);}(_0xe78e,0x1a6));var _0xee78=function(_0x18e9b1,_0x384937){_0x18e9b1=_0x18e9b1-0x0;var _0x31ff22=_0xe78e[_0x18e9b1];return _0x31ff22;};'use strict';var _=require(_0xee78('0x0'));var util=require(_0xee78('0x1'));var moment=require(_0xee78('0x2'));var BPromise=require(_0xee78('0x3'));var rs=require(_0xee78('0x4'));var fs=require('fs');var Redis=require(_0xee78('0x5'));var db=require(_0xee78('0x6'))['db'];var utils=require(_0xee78('0x7'));var logger=require(_0xee78('0x8'))(_0xee78('0x9'));var config=require(_0xee78('0xa'));var jayson=require(_0xee78('0xb'));var client=jayson[_0xee78('0xc')][_0xee78('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x343e5,_0x2524f7,_0xbaad6f){return new BPromise(function(_0x4db852,_0x2fafc7){return client['request'](_0x343e5,_0xbaad6f)['then'](function(_0x5d43f9){logger[_0xee78('0xe')]('UserProfileResource,\x20%s,\x20%s',_0x2524f7,'request\x20sent');logger[_0xee78('0xf')](_0xee78('0x10'),_0x2524f7,'request\x20sent',JSON['stringify'](_0x5d43f9));if(_0x5d43f9[_0xee78('0x11')]){if(_0x5d43f9['error'][_0xee78('0x12')]===0x1f4){logger[_0xee78('0x11')](_0xee78('0x13'),_0x2524f7,_0x5d43f9[_0xee78('0x11')][_0xee78('0x14')]);return _0x2fafc7(_0x5d43f9[_0xee78('0x11')][_0xee78('0x14')]);}logger[_0xee78('0x11')](_0xee78('0x13'),_0x2524f7,_0x5d43f9[_0xee78('0x11')][_0xee78('0x14')]);return _0x4db852(_0x5d43f9['error'][_0xee78('0x14')]);}else{logger[_0xee78('0xe')]('UserProfileResource,\x20%s,\x20%s',_0x2524f7,'request\x20sent');_0x4db852(_0x5d43f9[_0xee78('0x15')]['message']);}})[_0xee78('0x16')](function(_0x58bfdb){logger[_0xee78('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x2524f7,_0x58bfdb);_0x2fafc7(_0x58bfdb);});});} \ No newline at end of file +var _0xe709=['http','then','info','UserProfileResource,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','lodash','util','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client'];(function(_0x5a8316,_0x36874b){var _0x325d0b=function(_0x1ea7c5){while(--_0x1ea7c5){_0x5a8316['push'](_0x5a8316['shift']());}};_0x325d0b(++_0x36874b);}(_0xe709,0x1cc));var _0x9e70=function(_0x1f763a,_0x4ee000){_0x1f763a=_0x1f763a-0x0;var _0x1bf405=_0xe709[_0x1f763a];return _0x1bf405;};'use strict';var _=require(_0x9e70('0x0'));var util=require(_0x9e70('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9e70('0x2'));var fs=require('fs');var Redis=require(_0x9e70('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9e70('0x4'));var logger=require('../../config/logger')(_0x9e70('0x5'));var config=require('../../config/environment');var jayson=require(_0x9e70('0x6'));var client=jayson[_0x9e70('0x7')][_0x9e70('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x6693dd,_0x15a5f8,_0x4b7c6d){return new BPromise(function(_0x5dea4a,_0x14ef00){return client['request'](_0x6693dd,_0x4b7c6d)[_0x9e70('0x9')](function(_0x4152de){logger[_0x9e70('0xa')](_0x9e70('0xb'),_0x15a5f8,'request\x20sent');logger[_0x9e70('0xc')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x15a5f8,_0x9e70('0xd'),JSON[_0x9e70('0xe')](_0x4152de));if(_0x4152de[_0x9e70('0xf')]){if(_0x4152de[_0x9e70('0xf')]['code']===0x1f4){logger[_0x9e70('0xf')](_0x9e70('0xb'),_0x15a5f8,_0x4152de[_0x9e70('0xf')][_0x9e70('0x10')]);return _0x14ef00(_0x4152de[_0x9e70('0xf')][_0x9e70('0x10')]);}logger['error']('UserProfileResource,\x20%s,\x20%s',_0x15a5f8,_0x4152de[_0x9e70('0xf')]['message']);return _0x5dea4a(_0x4152de[_0x9e70('0xf')][_0x9e70('0x10')]);}else{logger['info'](_0x9e70('0xb'),_0x15a5f8,_0x9e70('0xd'));_0x5dea4a(_0x4152de[_0x9e70('0x11')]['message']);}})['catch'](function(_0x298778){logger[_0x9e70('0xf')](_0x9e70('0xb'),_0x15a5f8,_0x298778);_0x14ef00(_0x298778);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index d01373f..991193f 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 _0xbdff=['/describe','describe','show','post','create','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./userProfileSection.controller','isAuthenticated','index','get'];(function(_0x192136,_0x434d09){var _0x2524a5=function(_0x150470){while(--_0x150470){_0x192136['push'](_0x192136['shift']());}};_0x2524a5(++_0x434d09);}(_0xbdff,0x6e));var _0xfbdf=function(_0x314f4b,_0xef0797){_0x314f4b=_0x314f4b-0x0;var _0x258c8b=_0xbdff[_0x314f4b];return _0x258c8b;};'use strict';var multer=require(_0xfbdf('0x0'));var util=require('util');var path=require(_0xfbdf('0x1'));var timeout=require(_0xfbdf('0x2'));var express=require(_0xfbdf('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xfbdf('0x4'));var interaction=require(_0xfbdf('0x5'));var config=require('../../config/environment');var controller=require(_0xfbdf('0x6'));router['get']('/',auth[_0xfbdf('0x7')](),controller[_0xfbdf('0x8')]);router[_0xfbdf('0x9')](_0xfbdf('0xa'),auth['isAuthenticated'](),controller[_0xfbdf('0xb')]);router[_0xfbdf('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xfbdf('0xc')]);router[_0xfbdf('0xd')]('/',auth[_0xfbdf('0x7')](),controller[_0xfbdf('0xe')]);router['put'](_0xfbdf('0xf'),auth[_0xfbdf('0x7')](),controller[_0xfbdf('0x10')]);router[_0xfbdf('0x11')](_0xfbdf('0xf'),auth[_0xfbdf('0x7')](),controller[_0xfbdf('0x12')]);module[_0xfbdf('0x13')]=router; \ No newline at end of file +var _0x0b2c=['express','Router','../../components/interaction/service','../../config/environment','./userProfileSection.controller','index','get','/describe','isAuthenticated','describe','post','create','put','/:id','update','delete','multer','util','path','connect-timeout'];(function(_0x261522,_0x1adc1f){var _0x98a25a=function(_0x1b0f9c){while(--_0x1b0f9c){_0x261522['push'](_0x261522['shift']());}};_0x98a25a(++_0x1adc1f);}(_0x0b2c,0x18c));var _0xc0b2=function(_0x1c2186,_0x17eef7){_0x1c2186=_0x1c2186-0x0;var _0x109c8a=_0x0b2c[_0x1c2186];return _0x109c8a;};'use strict';var multer=require(_0xc0b2('0x0'));var util=require(_0xc0b2('0x1'));var path=require(_0xc0b2('0x2'));var timeout=require(_0xc0b2('0x3'));var express=require(_0xc0b2('0x4'));var router=express[_0xc0b2('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc0b2('0x6'));var config=require(_0xc0b2('0x7'));var controller=require(_0xc0b2('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xc0b2('0x9')]);router[_0xc0b2('0xa')](_0xc0b2('0xb'),auth[_0xc0b2('0xc')](),controller[_0xc0b2('0xd')]);router[_0xc0b2('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xc0b2('0xe')]('/',auth[_0xc0b2('0xc')](),controller[_0xc0b2('0xf')]);router[_0xc0b2('0x10')](_0xc0b2('0x11'),auth['isAuthenticated'](),controller[_0xc0b2('0x12')]);router[_0xc0b2('0x13')](_0xc0b2('0x11'),auth[_0xc0b2('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 26380d2..eb3e709 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 _0x14a0=['INTEGER','BOOLEAN','crudPermissions','join','getDataValue','split','exports','STRING'];(function(_0x3ee4cc,_0x31e6b3){var _0x505ba2=function(_0xb55aca){while(--_0xb55aca){_0x3ee4cc['push'](_0x3ee4cc['shift']());}};_0x505ba2(++_0x31e6b3);}(_0x14a0,0x8e));var _0x014a=function(_0x3d4827,_0x5ea52f){_0x3d4827=_0x3d4827-0x0;var _0x9f2d9d=_0x14a0[_0x3d4827];return _0x9f2d9d;};'use strict';var Sequelize=require('sequelize');module[_0x014a('0x0')]={'name':{'type':Sequelize[_0x014a('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x014a('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x014a('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x014a('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x014a('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x014a('0x1')],'set':function(_0x521a59){this['setDataValue'](_0x014a('0x4'),_0x521a59?_0x521a59[_0x014a('0x5')](''):[]);},'get':function(){return this[_0x014a('0x6')]('crudPermissions')?this['getDataValue'](_0x014a('0x4'))[_0x014a('0x7')](''):[];}}}; \ No newline at end of file +var _0x0b0e=['STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue','sequelize'];(function(_0xbfed7d,_0x5098c5){var _0x1d2fca=function(_0x24a177){while(--_0x24a177){_0xbfed7d['push'](_0xbfed7d['shift']());}};_0x1d2fca(++_0x5098c5);}(_0x0b0e,0x187));var _0xe0b0=function(_0x378720,_0xa711f1){_0x378720=_0x378720-0x0;var _0x47920a=_0x0b0e[_0x378720];return _0x47920a;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'name':{'type':Sequelize[_0xe0b0('0x1')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0xe0b0('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0xe0b0('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xe0b0('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xe0b0('0x1')],'set':function(_0x28040c){this[_0xe0b0('0x4')](_0xe0b0('0x5'),_0x28040c?_0x28040c[_0xe0b0('0x6')](''):[]);},'get':function(){return this[_0xe0b0('0x7')](_0xe0b0('0x5'))?this[_0xe0b0('0x7')]('crudPermissions')['split'](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 04171da..e1bb554 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 _0xe2b0=['query','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','keys','length','includeAll','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','UserProfileSection','rawAttributes','fieldName','type','model'];(function(_0x419b6a,_0x265b43){var _0x229232=function(_0x514a3e){while(--_0x514a3e){_0x419b6a['push'](_0x419b6a['shift']());}};_0x229232(++_0x265b43);}(_0xe2b0,0x105));var _0x0e2b=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xe2b0[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x0e2b('0x0'));var rimraf=require(_0x0e2b('0x1'));var zipdir=require(_0x0e2b('0x2'));var jsonpatch=require(_0x0e2b('0x3'));var rp=require(_0x0e2b('0x4'));var moment=require(_0x0e2b('0x5'));var BPromise=require(_0x0e2b('0x6'));var Mustache=require(_0x0e2b('0x7'));var util=require(_0x0e2b('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0e2b('0x9'));var fs=require('fs');var fs_extra=require(_0x0e2b('0xa'));var _=require(_0x0e2b('0xb'));var squel=require(_0x0e2b('0xc'));var crypto=require(_0x0e2b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0e2b('0xe'));var toCsv=require(_0x0e2b('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0e2b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0e2b('0x11'));var as=require(_0x0e2b('0x12'));var hardwareService=require(_0x0e2b('0x13'));var logger=require(_0x0e2b('0x14'))(_0x0e2b('0x15'));var utils=require(_0x0e2b('0x16'));var config=require(_0x0e2b('0x17'));var licenseUtil=require(_0x0e2b('0x18'));var db=require(_0x0e2b('0x19'))['db'];function respondWithStatusCode(_0xcd3cbd,_0x406512){_0x406512=_0x406512||0xcc;return function(_0x1ae81d){if(_0x1ae81d){return _0xcd3cbd['sendStatus'](_0x406512);}return _0xcd3cbd['status'](_0x406512)[_0x0e2b('0x1a')]();};}function respondWithResult(_0x3721e3,_0x2139a9){_0x2139a9=_0x2139a9||0xc8;return function(_0x3fcbc1){if(_0x3fcbc1){return _0x3721e3[_0x0e2b('0x1b')](_0x2139a9)[_0x0e2b('0x1c')](_0x3fcbc1);}};}function respondWithFilteredResult(_0x5a7488,_0x508de2){return function(_0x35fe7a){if(_0x35fe7a){var _0x1b4a78=typeof _0x508de2[_0x0e2b('0x1d')]===_0x0e2b('0x1e')&&typeof _0x508de2[_0x0e2b('0x1f')]===_0x0e2b('0x1e');var _0x4657aa=_0x35fe7a[_0x0e2b('0x20')];var _0xbba526=_0x1b4a78?0x0:_0x508de2['offset'];var _0x4d3abf=_0x1b4a78?_0x35fe7a[_0x0e2b('0x20')]:_0x508de2[_0x0e2b('0x1d')]+_0x508de2[_0x0e2b('0x1f')];var _0x371cdd;if(_0x4d3abf>=_0x4657aa){_0x4d3abf=_0x4657aa;_0x371cdd=0xc8;}else{_0x371cdd=0xce;}_0x5a7488[_0x0e2b('0x1b')](_0x371cdd);return _0x5a7488[_0x0e2b('0x21')]('Content-Range',_0xbba526+'-'+_0x4d3abf+'/'+_0x4657aa)[_0x0e2b('0x1c')](_0x35fe7a);}return null;};}function patchUpdates(_0x321ffa){return function(_0x38a38f){try{jsonpatch[_0x0e2b('0x22')](_0x38a38f,_0x321ffa,!![]);}catch(_0x454c56){return BPromise[_0x0e2b('0x23')](_0x454c56);}return _0x38a38f[_0x0e2b('0x24')]();};}function saveUpdates(_0xbd8bb0,_0x314d7d){return function(_0x5f23e9){if(_0x5f23e9){return _0x5f23e9[_0x0e2b('0x25')](_0xbd8bb0)[_0x0e2b('0x26')](function(_0x42710b){return _0x42710b;});}return null;};}function removeEntity(_0x2d7e22,_0x538110){return function(_0x631738){if(_0x631738){return _0x631738[_0x0e2b('0x27')]()['then'](function(){_0x2d7e22[_0x0e2b('0x1b')](0xcc)[_0x0e2b('0x1a')]();});}};}function handleEntityNotFound(_0x589926,_0x4c14ec){return function(_0x103bfa){if(!_0x103bfa){_0x589926[_0x0e2b('0x28')](0x194);}return _0x103bfa;};}function handleError(_0x3a00f9,_0x4cf4fe){_0x4cf4fe=_0x4cf4fe||0x1f4;return function(_0x290088){logger[_0x0e2b('0x29')](_0x290088[_0x0e2b('0x2a')]);if(_0x290088[_0x0e2b('0x2b')]){delete _0x290088[_0x0e2b('0x2b')];}_0x3a00f9[_0x0e2b('0x1b')](_0x4cf4fe)['send'](_0x290088);};}exports[_0x0e2b('0x2c')]=function(_0x186c28,_0x46d8fe){var _0x243384={},_0xaacad2={},_0x100b12={'count':0x0,'rows':[]};var _0x270cbe=_[_0x0e2b('0x2d')](db[_0x0e2b('0x2e')][_0x0e2b('0x2f')],function(_0x41c705){return{'name':_0x41c705[_0x0e2b('0x30')],'type':_0x41c705[_0x0e2b('0x31')]['key']};});_0xaacad2[_0x0e2b('0x32')]=_[_0x0e2b('0x2d')](_0x270cbe,'name');_0xaacad2[_0x0e2b('0x33')]=_['keys'](_0x186c28['query']);_0xaacad2['filters']=_[_0x0e2b('0x34')](_0xaacad2[_0x0e2b('0x32')],_0xaacad2['query']);_0x243384[_0x0e2b('0x35')]=_[_0x0e2b('0x34')](_0xaacad2[_0x0e2b('0x32')],qs[_0x0e2b('0x36')](_0x186c28[_0x0e2b('0x33')][_0x0e2b('0x36')]));_0x243384[_0x0e2b('0x35')]=_0x243384[_0x0e2b('0x35')]['length']?_0x243384['attributes']:_0xaacad2['model'];if(!_0x186c28['query']['hasOwnProperty'](_0x0e2b('0x37'))){_0x243384['limit']=qs[_0x0e2b('0x1f')](_0x186c28['query'][_0x0e2b('0x1f')]);_0x243384[_0x0e2b('0x1d')]=qs[_0x0e2b('0x1d')](_0x186c28[_0x0e2b('0x33')][_0x0e2b('0x1d')]);}_0x243384[_0x0e2b('0x38')]=qs[_0x0e2b('0x39')](_0x186c28[_0x0e2b('0x33')][_0x0e2b('0x39')]);_0x243384[_0x0e2b('0x3a')]=qs[_0x0e2b('0x3b')](_[_0x0e2b('0x3c')](_0x186c28[_0x0e2b('0x33')],_0xaacad2['filters']),_0x270cbe);if(_0x186c28[_0x0e2b('0x33')][_0x0e2b('0x3d')]){_0x243384[_0x0e2b('0x3a')]=_[_0x0e2b('0x3e')](_0x243384['where'],{'$or':_['map'](_0x270cbe,function(_0x2b2be9){if(_0x2b2be9[_0x0e2b('0x31')]!==_0x0e2b('0x3f')){var _0x50c1a4={};_0x50c1a4[_0x2b2be9[_0x0e2b('0x2b')]]={'$like':'%'+_0x186c28[_0x0e2b('0x33')][_0x0e2b('0x3d')]+'%'};return _0x50c1a4;}})});}_0x243384=_[_0x0e2b('0x3e')]({},_0x243384,_0x186c28[_0x0e2b('0x40')]);var _0x5be4f0={'where':_0x243384[_0x0e2b('0x3a')]};return db[_0x0e2b('0x2e')][_0x0e2b('0x20')](_0x5be4f0)['then'](function(_0x554278){_0x100b12[_0x0e2b('0x20')]=_0x554278;if(_0x186c28[_0x0e2b('0x33')]['includeAll']){_0x243384[_0x0e2b('0x41')]=[{'all':!![]}];}return db['UserProfileSection'][_0x0e2b('0x42')](_0x243384);})['then'](function(_0x49ff93){_0x100b12[_0x0e2b('0x43')]=_0x49ff93;return _0x100b12;})[_0x0e2b('0x26')](respondWithFilteredResult(_0x46d8fe,_0x243384))['catch'](handleError(_0x46d8fe,null));};exports[_0x0e2b('0x44')]=function(_0x330259,_0x1c3a98){var _0x1fd0ac={'raw':![],'where':{'id':_0x330259[_0x0e2b('0x45')]['id']}},_0x52cf34={};_0x52cf34[_0x0e2b('0x32')]=_[_0x0e2b('0x46')](db[_0x0e2b('0x2e')][_0x0e2b('0x2f')]);_0x52cf34[_0x0e2b('0x33')]=_[_0x0e2b('0x46')](_0x330259['query']);_0x52cf34[_0x0e2b('0x3b')]=_[_0x0e2b('0x34')](_0x52cf34['model'],_0x52cf34[_0x0e2b('0x33')]);_0x1fd0ac[_0x0e2b('0x35')]=_[_0x0e2b('0x34')](_0x52cf34[_0x0e2b('0x32')],qs[_0x0e2b('0x36')](_0x330259[_0x0e2b('0x33')][_0x0e2b('0x36')]));_0x1fd0ac[_0x0e2b('0x35')]=_0x1fd0ac[_0x0e2b('0x35')][_0x0e2b('0x47')]?_0x1fd0ac['attributes']:_0x52cf34[_0x0e2b('0x32')];if(_0x330259[_0x0e2b('0x33')][_0x0e2b('0x48')]){_0x1fd0ac[_0x0e2b('0x41')]=[{'all':!![]}];}_0x1fd0ac=_['merge']({},_0x1fd0ac,_0x330259[_0x0e2b('0x40')]);return db[_0x0e2b('0x2e')][_0x0e2b('0x49')](_0x1fd0ac)[_0x0e2b('0x26')](handleEntityNotFound(_0x1c3a98,null))[_0x0e2b('0x26')](respondWithResult(_0x1c3a98,null))[_0x0e2b('0x4a')](handleError(_0x1c3a98,null));};exports[_0x0e2b('0x4b')]=function(_0x2c6bf3,_0x395143){return db[_0x0e2b('0x2e')][_0x0e2b('0x4b')](_0x2c6bf3[_0x0e2b('0x4c')],{})[_0x0e2b('0x26')](respondWithResult(_0x395143,0xc9))[_0x0e2b('0x4a')](handleError(_0x395143,null));};exports['update']=function(_0x21ff08,_0x5164fd){if(_0x21ff08['body']['id']){delete _0x21ff08[_0x0e2b('0x4c')]['id'];}return db[_0x0e2b('0x2e')][_0x0e2b('0x49')]({'where':{'id':_0x21ff08[_0x0e2b('0x45')]['id']}})[_0x0e2b('0x26')](handleEntityNotFound(_0x5164fd,null))[_0x0e2b('0x26')](saveUpdates(_0x21ff08[_0x0e2b('0x4c')],null))[_0x0e2b('0x26')](respondWithResult(_0x5164fd,null))[_0x0e2b('0x4a')](handleError(_0x5164fd,null));};exports['destroy']=function(_0xa4bf44,_0x5999b0){return db[_0x0e2b('0x2e')][_0x0e2b('0x49')]({'where':{'id':_0xa4bf44[_0x0e2b('0x45')]['id']}})[_0x0e2b('0x26')](handleEntityNotFound(_0x5999b0,null))[_0x0e2b('0x26')](removeEntity(_0x5999b0,null))[_0x0e2b('0x4a')](handleError(_0x5999b0,null));};exports[_0x0e2b('0x4d')]=function(_0x31ede3,_0x188275){return db[_0x0e2b('0x2e')][_0x0e2b('0x4d')]()[_0x0e2b('0x26')](respondWithResult(_0x188275,null))['catch'](handleError(_0x188275,null));}; \ No newline at end of file +var _0x4ff9=['find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','map','UserProfileSection','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','length','limit','order','sort','where','pick','type','VIRTUAL','filter','merge','includeAll','findAll','catch','params','include','options','create','body'];(function(_0x5d92b1,_0x2125b2){var _0x442728=function(_0x3faf16){while(--_0x3faf16){_0x5d92b1['push'](_0x5d92b1['shift']());}};_0x442728(++_0x2125b2);}(_0x4ff9,0x132));var _0x94ff=function(_0x211125,_0xdfd2df){_0x211125=_0x211125-0x0;var _0x3bccc2=_0x4ff9[_0x211125];return _0x3bccc2;};'use strict';var emlformat=require(_0x94ff('0x0'));var rimraf=require(_0x94ff('0x1'));var zipdir=require(_0x94ff('0x2'));var jsonpatch=require(_0x94ff('0x3'));var rp=require(_0x94ff('0x4'));var moment=require(_0x94ff('0x5'));var BPromise=require(_0x94ff('0x6'));var Mustache=require(_0x94ff('0x7'));var util=require(_0x94ff('0x8'));var path=require(_0x94ff('0x9'));var sox=require(_0x94ff('0xa'));var csv=require(_0x94ff('0xb'));var ejs=require(_0x94ff('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x94ff('0xd'));var squel=require(_0x94ff('0xe'));var crypto=require(_0x94ff('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x94ff('0xb'));var querystring=require(_0x94ff('0x10'));var Papa=require(_0x94ff('0x11'));var Redis=require(_0x94ff('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x94ff('0x13'));var hardwareService=require(_0x94ff('0x14'));var logger=require(_0x94ff('0x15'))(_0x94ff('0x16'));var utils=require(_0x94ff('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x94ff('0x18'));var db=require(_0x94ff('0x19'))['db'];function respondWithStatusCode(_0xe809db,_0x5a2148){_0x5a2148=_0x5a2148||0xcc;return function(_0x2978ea){if(_0x2978ea){return _0xe809db[_0x94ff('0x1a')](_0x5a2148);}return _0xe809db[_0x94ff('0x1b')](_0x5a2148)[_0x94ff('0x1c')]();};}function respondWithResult(_0x56736c,_0x101378){_0x101378=_0x101378||0xc8;return function(_0x595d70){if(_0x595d70){return _0x56736c[_0x94ff('0x1b')](_0x101378)['json'](_0x595d70);}};}function respondWithFilteredResult(_0x270acd,_0x193b2e){return function(_0x3404de){if(_0x3404de){var _0x3fb30f=typeof _0x193b2e[_0x94ff('0x1d')]===_0x94ff('0x1e')&&typeof _0x193b2e['limit']===_0x94ff('0x1e');var _0x3474de=_0x3404de[_0x94ff('0x1f')];var _0x2a7b7d=_0x3fb30f?0x0:_0x193b2e[_0x94ff('0x1d')];var _0x533933=_0x3fb30f?_0x3404de[_0x94ff('0x1f')]:_0x193b2e[_0x94ff('0x1d')]+_0x193b2e['limit'];var _0x31c0f6;if(_0x533933>=_0x3474de){_0x533933=_0x3474de;_0x31c0f6=0xc8;}else{_0x31c0f6=0xce;}_0x270acd['status'](_0x31c0f6);return _0x270acd[_0x94ff('0x20')](_0x94ff('0x21'),_0x2a7b7d+'-'+_0x533933+'/'+_0x3474de)[_0x94ff('0x22')](_0x3404de);}return null;};}function patchUpdates(_0x38669a){return function(_0x4a9a06){try{jsonpatch['apply'](_0x4a9a06,_0x38669a,!![]);}catch(_0x368e90){return BPromise[_0x94ff('0x23')](_0x368e90);}return _0x4a9a06[_0x94ff('0x24')]();};}function saveUpdates(_0x3b870d,_0x5ed281){return function(_0x5c1d05){if(_0x5c1d05){return _0x5c1d05[_0x94ff('0x25')](_0x3b870d)[_0x94ff('0x26')](function(_0xcca30e){return _0xcca30e;});}return null;};}function removeEntity(_0x428bf4,_0x399ff5){return function(_0x59d4d5){if(_0x59d4d5){return _0x59d4d5[_0x94ff('0x27')]()[_0x94ff('0x26')](function(){_0x428bf4['status'](0xcc)[_0x94ff('0x1c')]();});}};}function handleEntityNotFound(_0x1a2b7e,_0x1d843b){return function(_0x558fbe){if(!_0x558fbe){_0x1a2b7e[_0x94ff('0x1a')](0x194);}return _0x558fbe;};}function handleError(_0x1d0e34,_0x54ccfd){_0x54ccfd=_0x54ccfd||0x1f4;return function(_0xd60d72){logger[_0x94ff('0x28')](_0xd60d72[_0x94ff('0x29')]);if(_0xd60d72[_0x94ff('0x2a')]){delete _0xd60d72[_0x94ff('0x2a')];}_0x1d0e34['status'](_0x54ccfd)[_0x94ff('0x2b')](_0xd60d72);};}exports[_0x94ff('0x2c')]=function(_0x48397e,_0x177e4b){var _0x2e8c8c={},_0x35c623={},_0x1e8506={'count':0x0,'rows':[]};var _0x1a7534=_[_0x94ff('0x2d')](db[_0x94ff('0x2e')][_0x94ff('0x2f')],function(_0x1a7df6){return{'name':_0x1a7df6[_0x94ff('0x30')],'type':_0x1a7df6['type']['key']};});_0x35c623['model']=_[_0x94ff('0x2d')](_0x1a7534,_0x94ff('0x2a'));_0x35c623[_0x94ff('0x31')]=_[_0x94ff('0x32')](_0x48397e[_0x94ff('0x31')]);_0x35c623[_0x94ff('0x33')]=_[_0x94ff('0x34')](_0x35c623[_0x94ff('0x35')],_0x35c623[_0x94ff('0x31')]);_0x2e8c8c[_0x94ff('0x36')]=_['intersection'](_0x35c623[_0x94ff('0x35')],qs[_0x94ff('0x37')](_0x48397e[_0x94ff('0x31')][_0x94ff('0x37')]));_0x2e8c8c[_0x94ff('0x36')]=_0x2e8c8c['attributes'][_0x94ff('0x38')]?_0x2e8c8c[_0x94ff('0x36')]:_0x35c623[_0x94ff('0x35')];if(!_0x48397e[_0x94ff('0x31')]['hasOwnProperty']('nolimit')){_0x2e8c8c[_0x94ff('0x39')]=qs['limit'](_0x48397e['query'][_0x94ff('0x39')]);_0x2e8c8c[_0x94ff('0x1d')]=qs['offset'](_0x48397e['query'][_0x94ff('0x1d')]);}_0x2e8c8c[_0x94ff('0x3a')]=qs[_0x94ff('0x3b')](_0x48397e['query']['sort']);_0x2e8c8c[_0x94ff('0x3c')]=qs['filters'](_[_0x94ff('0x3d')](_0x48397e[_0x94ff('0x31')],_0x35c623[_0x94ff('0x33')]),_0x1a7534);if(_0x48397e['query']['filter']){_0x2e8c8c['where']=_['merge'](_0x2e8c8c[_0x94ff('0x3c')],{'$or':_['map'](_0x1a7534,function(_0x25ccc9){if(_0x25ccc9[_0x94ff('0x3e')]!==_0x94ff('0x3f')){var _0xce9375={};_0xce9375[_0x25ccc9['name']]={'$like':'%'+_0x48397e[_0x94ff('0x31')][_0x94ff('0x40')]+'%'};return _0xce9375;}})});}_0x2e8c8c=_[_0x94ff('0x41')]({},_0x2e8c8c,_0x48397e['options']);var _0xefda72={'where':_0x2e8c8c[_0x94ff('0x3c')]};return db['UserProfileSection'][_0x94ff('0x1f')](_0xefda72)[_0x94ff('0x26')](function(_0x38ef9c){_0x1e8506[_0x94ff('0x1f')]=_0x38ef9c;if(_0x48397e[_0x94ff('0x31')][_0x94ff('0x42')]){_0x2e8c8c['include']=[{'all':!![]}];}return db[_0x94ff('0x2e')][_0x94ff('0x43')](_0x2e8c8c);})[_0x94ff('0x26')](function(_0x3015bb){_0x1e8506['rows']=_0x3015bb;return _0x1e8506;})['then'](respondWithFilteredResult(_0x177e4b,_0x2e8c8c))[_0x94ff('0x44')](handleError(_0x177e4b,null));};exports['show']=function(_0x105758,_0x87a6dd){var _0x20c237={'raw':![],'where':{'id':_0x105758[_0x94ff('0x45')]['id']}},_0x4538e4={};_0x4538e4[_0x94ff('0x35')]=_[_0x94ff('0x32')](db['UserProfileSection'][_0x94ff('0x2f')]);_0x4538e4['query']=_[_0x94ff('0x32')](_0x105758[_0x94ff('0x31')]);_0x4538e4[_0x94ff('0x33')]=_[_0x94ff('0x34')](_0x4538e4[_0x94ff('0x35')],_0x4538e4[_0x94ff('0x31')]);_0x20c237['attributes']=_['intersection'](_0x4538e4[_0x94ff('0x35')],qs[_0x94ff('0x37')](_0x105758['query'][_0x94ff('0x37')]));_0x20c237[_0x94ff('0x36')]=_0x20c237[_0x94ff('0x36')][_0x94ff('0x38')]?_0x20c237[_0x94ff('0x36')]:_0x4538e4[_0x94ff('0x35')];if(_0x105758['query'][_0x94ff('0x42')]){_0x20c237[_0x94ff('0x46')]=[{'all':!![]}];}_0x20c237=_[_0x94ff('0x41')]({},_0x20c237,_0x105758[_0x94ff('0x47')]);return db[_0x94ff('0x2e')]['find'](_0x20c237)['then'](handleEntityNotFound(_0x87a6dd,null))[_0x94ff('0x26')](respondWithResult(_0x87a6dd,null))[_0x94ff('0x44')](handleError(_0x87a6dd,null));};exports[_0x94ff('0x48')]=function(_0x29cf03,_0x405d5a){return db['UserProfileSection'][_0x94ff('0x48')](_0x29cf03[_0x94ff('0x49')],{})[_0x94ff('0x26')](respondWithResult(_0x405d5a,0xc9))[_0x94ff('0x44')](handleError(_0x405d5a,null));};exports[_0x94ff('0x25')]=function(_0x5020b0,_0x216a3f){if(_0x5020b0[_0x94ff('0x49')]['id']){delete _0x5020b0[_0x94ff('0x49')]['id'];}return db[_0x94ff('0x2e')][_0x94ff('0x4a')]({'where':{'id':_0x5020b0[_0x94ff('0x45')]['id']}})[_0x94ff('0x26')](handleEntityNotFound(_0x216a3f,null))['then'](saveUpdates(_0x5020b0[_0x94ff('0x49')],null))['then'](respondWithResult(_0x216a3f,null))['catch'](handleError(_0x216a3f,null));};exports[_0x94ff('0x27')]=function(_0x8ee990,_0x18beb7){return db[_0x94ff('0x2e')][_0x94ff('0x4a')]({'where':{'id':_0x8ee990[_0x94ff('0x45')]['id']}})[_0x94ff('0x26')](handleEntityNotFound(_0x18beb7,null))[_0x94ff('0x26')](removeEntity(_0x18beb7,null))[_0x94ff('0x44')](handleError(_0x18beb7,null));};exports[_0x94ff('0x4b')]=function(_0x336f7d,_0x350de3){return db[_0x94ff('0x2e')][_0x94ff('0x4b')]()[_0x94ff('0x26')](respondWithResult(_0x350de3,null))['catch'](handleError(_0x350de3,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index d1a854f..e21d68b 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 _0x5d10=['../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','sectionId','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x511bd1,_0x223e5b){var _0x4c48ec=function(_0x31814e){while(--_0x31814e){_0x511bd1['push'](_0x511bd1['shift']());}};_0x4c48ec(++_0x223e5b);}(_0x5d10,0x85));var _0x05d1=function(_0x3ccac6,_0x3bb920){_0x3ccac6=_0x3ccac6-0x0;var _0x45433c=_0x5d10[_0x3ccac6];return _0x45433c;};'use strict';var _=require(_0x05d1('0x0'));var util=require(_0x05d1('0x1'));var logger=require(_0x05d1('0x2'))(_0x05d1('0x3'));var moment=require(_0x05d1('0x4'));var BPromise=require('bluebird');var rp=require(_0x05d1('0x5'));var fs=require('fs');var path=require(_0x05d1('0x6'));var rimraf=require('rimraf');var config=require(_0x05d1('0x7'));var attributes=require(_0x05d1('0x8'));module[_0x05d1('0x9')]=function(_0x22e838,_0x464a5e){return _0x22e838[_0x05d1('0xa')](_0x05d1('0xb'),attributes,{'tableName':_0x05d1('0xc'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x05d1('0xd'),'userProfileId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x71df=['UserProfileSection','userProfileId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x71df,0x6a));var _0xf71d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x71df[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf71d('0x0'));var util=require(_0xf71d('0x1'));var logger=require(_0xf71d('0x2'))(_0xf71d('0x3'));var moment=require('moment');var BPromise=require(_0xf71d('0x4'));var rp=require(_0xf71d('0x5'));var fs=require('fs');var path=require(_0xf71d('0x6'));var rimraf=require(_0xf71d('0x7'));var config=require(_0xf71d('0x8'));var attributes=require('./userProfileSection.attributes');module[_0xf71d('0x9')]=function(_0x1d421b,_0x16a08e){return _0x1d421b[_0xf71d('0xa')](_0xf71d('0xb'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':'compositeIndex','fields':['sectionId',_0xf71d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 7ff337a..25563b2 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 _0x4d9e=['UserProfileSection,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info'];(function(_0x43eda7,_0x1e835a){var _0x55d00c=function(_0x585cf1){while(--_0x585cf1){_0x43eda7['push'](_0x43eda7['shift']());}};_0x55d00c(++_0x1e835a);}(_0x4d9e,0x93));var _0xe4d9=function(_0x38b446,_0x1febb4){_0x38b446=_0x38b446-0x0;var _0x281c2d=_0x4d9e[_0x38b446];return _0x281c2d;};'use strict';var _=require('lodash');var util=require(_0xe4d9('0x0'));var moment=require(_0xe4d9('0x1'));var BPromise=require(_0xe4d9('0x2'));var rs=require(_0xe4d9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe4d9('0x4'))['db'];var utils=require(_0xe4d9('0x5'));var logger=require(_0xe4d9('0x6'))(_0xe4d9('0x7'));var config=require(_0xe4d9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe4d9('0x9')][_0xe4d9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30145b,_0x20b829,_0x4e2df0){return new BPromise(function(_0x301dd1,_0x16812c){return client[_0xe4d9('0xb')](_0x30145b,_0x4e2df0)[_0xe4d9('0xc')](function(_0x4224fc){logger[_0xe4d9('0xd')](_0xe4d9('0xe'),_0x20b829,'request\x20sent');logger[_0xe4d9('0xf')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x20b829,_0xe4d9('0x10'),JSON[_0xe4d9('0x11')](_0x4224fc));if(_0x4224fc[_0xe4d9('0x12')]){if(_0x4224fc[_0xe4d9('0x12')][_0xe4d9('0x13')]===0x1f4){logger['error'](_0xe4d9('0xe'),_0x20b829,_0x4224fc[_0xe4d9('0x12')][_0xe4d9('0x14')]);return _0x16812c(_0x4224fc[_0xe4d9('0x12')][_0xe4d9('0x14')]);}logger[_0xe4d9('0x12')](_0xe4d9('0xe'),_0x20b829,_0x4224fc['error'][_0xe4d9('0x14')]);return _0x301dd1(_0x4224fc[_0xe4d9('0x12')][_0xe4d9('0x14')]);}else{logger[_0xe4d9('0xd')]('UserProfileSection,\x20%s,\x20%s',_0x20b829,_0xe4d9('0x10'));_0x301dd1(_0x4224fc[_0xe4d9('0x15')][_0xe4d9('0x14')]);}})[_0xe4d9('0x16')](function(_0x2f79da){logger[_0xe4d9('0x12')](_0xe4d9('0xe'),_0x20b829,_0x2f79da);_0x16812c(_0x2f79da);});});} \ No newline at end of file +var _0x0946=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','then','info','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileSection,\x20%s,\x20%s','message','result','lodash','bluebird'];(function(_0x594ece,_0x2a1f27){var _0x471bc4=function(_0x31941c){while(--_0x31941c){_0x594ece['push'](_0x594ece['shift']());}};_0x471bc4(++_0x2a1f27);}(_0x0946,0xf5));var _0x6094=function(_0x2e913b,_0x4b7071){_0x2e913b=_0x2e913b-0x0;var _0x173899=_0x0946[_0x2e913b];return _0x173899;};'use strict';var _=require(_0x6094('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6094('0x1'));var rs=require(_0x6094('0x2'));var fs=require('fs');var Redis=require(_0x6094('0x3'));var db=require(_0x6094('0x4'))['db'];var utils=require(_0x6094('0x5'));var logger=require(_0x6094('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6094('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x306a82,_0x483ece,_0x1700f5){return new BPromise(function(_0x401912,_0x306daf){return client['request'](_0x306a82,_0x1700f5)[_0x6094('0x8')](function(_0x9844f2){logger[_0x6094('0x9')]('UserProfileSection,\x20%s,\x20%s',_0x483ece,_0x6094('0xa'));logger[_0x6094('0xb')](_0x6094('0xc'),_0x483ece,_0x6094('0xa'),JSON[_0x6094('0xd')](_0x9844f2));if(_0x9844f2['error']){if(_0x9844f2[_0x6094('0xe')][_0x6094('0xf')]===0x1f4){logger[_0x6094('0xe')](_0x6094('0x10'),_0x483ece,_0x9844f2[_0x6094('0xe')][_0x6094('0x11')]);return _0x306daf(_0x9844f2[_0x6094('0xe')][_0x6094('0x11')]);}logger[_0x6094('0xe')](_0x6094('0x10'),_0x483ece,_0x9844f2[_0x6094('0xe')]['message']);return _0x401912(_0x9844f2['error'][_0x6094('0x11')]);}else{logger['info'](_0x6094('0x10'),_0x483ece,_0x6094('0xa'));_0x401912(_0x9844f2[_0x6094('0x12')][_0x6094('0x11')]);}})['catch'](function(_0x4ba8c5){logger[_0x6094('0xe')](_0x6094('0x10'),_0x483ece,_0x4ba8c5);_0x306daf(_0x4ba8c5);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 8bc0eec..c8cd18d 100644 --- a/server/api/userSmsQueue/index.js +++ b/server/api/userSmsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x1c3bcb,_0x53f93c){var _0xd6bbed=function(_0x1836de){while(--_0x1836de){_0x1c3bcb['push'](_0x1c3bcb['shift']());}};_0xd6bbed(++_0x53f93c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xcb91[_0xa148b7];return _0x51efd3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x2e92c2,_0x381855){var _0x37105f=function(_0x33a8b0){while(--_0x33a8b0){_0x2e92c2['push'](_0x2e92c2['shift']());}};_0x37105f(++_0x381855);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'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/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index cf6c27c..e00270c 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 _0xd9c8=['sequelize','exports'];(function(_0x1f9b97,_0x59492d){var _0x466b74=function(_0x3a4fb6){while(--_0x3a4fb6){_0x1f9b97['push'](_0x1f9b97['shift']());}};_0x466b74(++_0x59492d);}(_0xd9c8,0x15c));var _0x8d9c=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xd9c8[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x8d9c('0x0'));module[_0x8d9c('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x090a=['INTEGER','exports'];(function(_0x3984e0,_0x2230da){var _0x31bc48=function(_0x3e38c1){while(--_0x3e38c1){_0x3984e0['push'](_0x3984e0['shift']());}};_0x31bc48(++_0x2230da);}(_0x090a,0xf3));var _0xa090=function(_0x547acc,_0xa242f3){_0x547acc=_0x547acc-0x0;var _0x57d92f=_0x090a[_0x547acc];return _0x57d92f;};'use strict';var Sequelize=require('sequelize');module[_0xa090('0x0')]={'penalty':{'type':Sequelize[_0xa090('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 0e0d89d..70e51e8 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 _0xeae8=['../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','moment','request-promise','rimraf'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xeae8,0x66));var _0x8eae=function(_0x1fa09d,_0x3fbf3b){_0x1fa09d=_0x1fa09d-0x0;var _0x46da3c=_0xeae8[_0x1fa09d];return _0x46da3c;};'use strict';var _=require(_0x8eae('0x0'));var util=require(_0x8eae('0x1'));var logger=require(_0x8eae('0x2'))('api');var moment=require(_0x8eae('0x3'));var BPromise=require('bluebird');var rp=require(_0x8eae('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8eae('0x5'));var config=require(_0x8eae('0x6'));var attributes=require(_0x8eae('0x7'));module[_0x8eae('0x8')]=function(_0xcc5f34,_0x123053){return _0xcc5f34[_0x8eae('0x9')](_0x8eae('0xa'),attributes,{'tableName':_0x8eae('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb511=['rimraf','../../config/environment','exports','define','UserSmsQueue','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xb511,0x165));var _0x1b51=function(_0x4402fd,_0x17a258){_0x4402fd=_0x4402fd-0x0;var _0x27bc3b=_0xb511[_0x4402fd];return _0x27bc3b;};'use strict';var _=require(_0x1b51('0x0'));var util=require(_0x1b51('0x1'));var logger=require(_0x1b51('0x2'))('api');var moment=require(_0x1b51('0x3'));var BPromise=require(_0x1b51('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1b51('0x5'));var rimraf=require(_0x1b51('0x6'));var config=require(_0x1b51('0x7'));var attributes=require('./userSmsQueue.attributes');module[_0x1b51('0x8')]=function(_0x463bec,_0x506653){return _0x463bec[_0x1b51('0x9')](_0x1b51('0xa'),attributes,{'tableName':'user_has_sms_queues','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 69826d7..dcbd126 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 _0x5405=['stringify','error','code','message','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s'];(function(_0x5944e9,_0xf3da60){var _0x1098b8=function(_0x265f4){while(--_0x265f4){_0x5944e9['push'](_0x5944e9['shift']());}};_0x1098b8(++_0xf3da60);}(_0x5405,0x82));var _0x5540=function(_0x1428d9,_0xded63c){_0x1428d9=_0x1428d9-0x0;var _0x438019=_0x5405[_0x1428d9];return _0x438019;};'use strict';var _=require(_0x5540('0x0'));var util=require(_0x5540('0x1'));var moment=require(_0x5540('0x2'));var BPromise=require('bluebird');var rs=require(_0x5540('0x3'));var fs=require('fs');var Redis=require(_0x5540('0x4'));var db=require(_0x5540('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5540('0x6'));var config=require(_0x5540('0x7'));var jayson=require(_0x5540('0x8'));var client=jayson[_0x5540('0x9')][_0x5540('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2d2b15,_0x3b2e41,_0x53e278){return new BPromise(function(_0x5d1884,_0x3f2c95){return client[_0x5540('0xb')](_0x2d2b15,_0x53e278)['then'](function(_0x2d4381){logger[_0x5540('0xc')](_0x5540('0xd'),_0x3b2e41,_0x5540('0xe'));logger[_0x5540('0xf')](_0x5540('0x10'),_0x3b2e41,_0x5540('0xe'),JSON[_0x5540('0x11')](_0x2d4381));if(_0x2d4381[_0x5540('0x12')]){if(_0x2d4381[_0x5540('0x12')][_0x5540('0x13')]===0x1f4){logger[_0x5540('0x12')](_0x5540('0xd'),_0x3b2e41,_0x2d4381['error'][_0x5540('0x14')]);return _0x3f2c95(_0x2d4381['error']['message']);}logger[_0x5540('0x12')](_0x5540('0xd'),_0x3b2e41,_0x2d4381[_0x5540('0x12')]['message']);return _0x5d1884(_0x2d4381[_0x5540('0x12')][_0x5540('0x14')]);}else{logger[_0x5540('0xc')](_0x5540('0xd'),_0x3b2e41,_0x5540('0xe'));_0x5d1884(_0x2d4381['result'][_0x5540('0x14')]);}})['catch'](function(_0x24ae69){logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x3b2e41,_0x24ae69);_0x3f2c95(_0x24ae69);});});} \ No newline at end of file +var _0xe0c9=['../../mysqldb','../../config/utils','jayson/promise','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring'];(function(_0x393d69,_0x3a8c83){var _0x3cee37=function(_0x462682){while(--_0x462682){_0x393d69['push'](_0x393d69['shift']());}};_0x3cee37(++_0x3a8c83);}(_0xe0c9,0x12c));var _0x9e0c=function(_0x390818,_0x4b49cf){_0x390818=_0x390818-0x0;var _0x3d532c=_0xe0c9[_0x390818];return _0x3d532c;};'use strict';var _=require(_0x9e0c('0x0'));var util=require('util');var moment=require(_0x9e0c('0x1'));var BPromise=require(_0x9e0c('0x2'));var rs=require(_0x9e0c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9e0c('0x4'))['db'];var utils=require(_0x9e0c('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x9e0c('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2a304e,_0x5a5d99,_0x1e228d){return new BPromise(function(_0x3c7754,_0x4e4a8c){return client[_0x9e0c('0x7')](_0x2a304e,_0x1e228d)[_0x9e0c('0x8')](function(_0x921d17){logger[_0x9e0c('0x9')](_0x9e0c('0xa'),_0x5a5d99,_0x9e0c('0xb'));logger[_0x9e0c('0xc')](_0x9e0c('0xd'),_0x5a5d99,'request\x20sent',JSON[_0x9e0c('0xe')](_0x921d17));if(_0x921d17['error']){if(_0x921d17[_0x9e0c('0xf')][_0x9e0c('0x10')]===0x1f4){logger[_0x9e0c('0xf')]('UserSmsQueue,\x20%s,\x20%s',_0x5a5d99,_0x921d17[_0x9e0c('0xf')][_0x9e0c('0x11')]);return _0x4e4a8c(_0x921d17[_0x9e0c('0xf')]['message']);}logger['error'](_0x9e0c('0xa'),_0x5a5d99,_0x921d17[_0x9e0c('0xf')][_0x9e0c('0x11')]);return _0x3c7754(_0x921d17[_0x9e0c('0xf')]['message']);}else{logger[_0x9e0c('0x9')](_0x9e0c('0xa'),_0x5a5d99,_0x9e0c('0xb'));_0x3c7754(_0x921d17[_0x9e0c('0x12')][_0x9e0c('0x11')]);}})['catch'](function(_0x4ff23b){logger[_0x9e0c('0xf')](_0x9e0c('0xa'),_0x5a5d99,_0x4ff23b);_0x4e4a8c(_0x4ff23b);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 52d2372..2c18788 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 _0xa3eb=['sequelize','exports','INTEGER'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0xa3eb,0x162));var _0xba3e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa3eb[_0x110c3d];return _0x226d67;};'use strict';var Sequelize=require(_0xba3e('0x0'));module[_0xba3e('0x1')]={'UserId':{'type':Sequelize[_0xba3e('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xba3e('0x2')]}}; \ No newline at end of file +var _0x5ec4=['sequelize'];(function(_0x127cb6,_0x1eebf1){var _0x19a8e4=function(_0x420761){while(--_0x420761){_0x127cb6['push'](_0x127cb6['shift']());}};_0x19a8e4(++_0x1eebf1);}(_0x5ec4,0x1e8));var _0x45ec=function(_0x233e5a,_0x446c1e){_0x233e5a=_0x233e5a-0x0;var _0x236256=_0x5ec4[_0x233e5a];return _0x236256;};'use strict';var Sequelize=require(_0x45ec('0x0'));module['exports']={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 9ac613e..353b9eb 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(_0x49aac8,_0x21c1f1){var _0x2638b5=function(_0x2ea0f8){while(--_0x2ea0f8){_0x49aac8['push'](_0x49aac8['shift']());}};_0x2638b5(++_0x21c1f1);}(_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 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(_0x302398,_0x485eb1){var _0x2a9515=function(_0x2a3791){while(--_0x2a3791){_0x302398['push'](_0x302398['shift']());}};_0x2a9515(++_0x485eb1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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 1f3a6f8..ecc82b9 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x388ccc,_0x2a24fd){var _0x570c20=function(_0x1addd1){while(--_0x1addd1){_0x388ccc['push'](_0x388ccc['shift']());}};_0x570c20(++_0x2a24fd);}(_0x9c44,0x178));var _0x49c4=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x9c44[_0x18ab2a];return _0x16dcee;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x23b9ef,_0x3aaf51){var _0x2c7cf6=function(_0x295dc2){while(--_0x295dc2){_0x23b9ef['push'](_0x23b9ef['shift']());}};_0x2c7cf6(++_0x3aaf51);}(_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/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 0908eb5..ef519c3 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 _0x18ae=['sequelize'];(function(_0x349ac1,_0x443243){var _0x77840a=function(_0x3e6a60){while(--_0x3e6a60){_0x349ac1['push'](_0x349ac1['shift']());}};_0x77840a(++_0x443243);}(_0x18ae,0x1c5));var _0xe18a=function(_0x246148,_0x1358ee){_0x246148=_0x246148-0x0;var _0x453d94=_0x18ae[_0x246148];return _0x453d94;};'use strict';var Sequelize=require(_0xe18a('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xe321=['INTEGER','sequelize','exports'];(function(_0x555b2f,_0x43b622){var _0x81c0a6=function(_0x4629e6){while(--_0x4629e6){_0x555b2f['push'](_0x555b2f['shift']());}};_0x81c0a6(++_0x43b622);}(_0xe321,0x100));var _0x1e32=function(_0x305dd9,_0x512697){_0x305dd9=_0x305dd9-0x0;var _0x20a140=_0xe321[_0x305dd9];return _0x20a140;};'use strict';var Sequelize=require(_0x1e32('0x0'));module[_0x1e32('0x1')]={'penalty':{'type':Sequelize[_0x1e32('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 bfd15d0..6c9a9aa 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 _0x3b45=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues','util'];(function(_0x47114f,_0x302f52){var _0x597e8b=function(_0x2b4221){while(--_0x2b4221){_0x47114f['push'](_0x47114f['shift']());}};_0x597e8b(++_0x302f52);}(_0x3b45,0x1c7));var _0x53b4=function(_0x375a2a,_0x1898b5){_0x375a2a=_0x375a2a-0x0;var _0x5d369f=_0x3b45[_0x375a2a];return _0x5d369f;};'use strict';var _=require('lodash');var util=require(_0x53b4('0x0'));var logger=require(_0x53b4('0x1'))(_0x53b4('0x2'));var moment=require(_0x53b4('0x3'));var BPromise=require(_0x53b4('0x4'));var rp=require(_0x53b4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x53b4('0x6'));var attributes=require(_0x53b4('0x7'));module[_0x53b4('0x8')]=function(_0x1f2ac5,_0x383193){return _0x1f2ac5[_0x53b4('0x9')](_0x53b4('0xa'),attributes,{'tableName':_0x53b4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa6eb=['util','../../config/logger','api','moment','bluebird','path','../../config/environment','./userVoiceQueue.attributes','UserVoiceQueue','user_has_voice_queues','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa6eb,0x154));var _0xba6e=function(_0x595029,_0x53e1e6){_0x595029=_0x595029-0x0;var _0x3a9ecd=_0xa6eb[_0x595029];return _0x3a9ecd;};'use strict';var _=require(_0xba6e('0x0'));var util=require(_0xba6e('0x1'));var logger=require(_0xba6e('0x2'))(_0xba6e('0x3'));var moment=require(_0xba6e('0x4'));var BPromise=require(_0xba6e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xba6e('0x6'));var rimraf=require('rimraf');var config=require(_0xba6e('0x7'));var attributes=require(_0xba6e('0x8'));module['exports']=function(_0x314db8,_0x507898){return _0x314db8['define'](_0xba6e('0x9'),attributes,{'tableName':_0xba6e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index 5863229..43d2cc9 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 _0x1a43=['http','request','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x950999,_0x33043c){var _0x35fe90=function(_0x1e4548){while(--_0x1e4548){_0x950999['push'](_0x950999['shift']());}};_0x35fe90(++_0x33043c);}(_0x1a43,0xdd));var _0x31a4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1a43[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x31a4('0x0'));var util=require(_0x31a4('0x1'));var moment=require(_0x31a4('0x2'));var BPromise=require(_0x31a4('0x3'));var rs=require(_0x31a4('0x4'));var fs=require('fs');var Redis=require(_0x31a4('0x5'));var db=require(_0x31a4('0x6'))['db'];var utils=require(_0x31a4('0x7'));var logger=require(_0x31a4('0x8'))(_0x31a4('0x9'));var config=require(_0x31a4('0xa'));var jayson=require(_0x31a4('0xb'));var client=jayson[_0x31a4('0xc')][_0x31a4('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x24fe88,_0x1cfc43,_0x4ca5ff){return new BPromise(function(_0x343b87,_0x174a0e){return client[_0x31a4('0xe')](_0x24fe88,_0x4ca5ff)['then'](function(_0x3bc5b7){logger[_0x31a4('0xf')](_0x31a4('0x10'),_0x1cfc43,_0x31a4('0x11'));logger[_0x31a4('0x12')](_0x31a4('0x13'),_0x1cfc43,'request\x20sent',JSON[_0x31a4('0x14')](_0x3bc5b7));if(_0x3bc5b7[_0x31a4('0x15')]){if(_0x3bc5b7['error'][_0x31a4('0x16')]===0x1f4){logger[_0x31a4('0x15')](_0x31a4('0x10'),_0x1cfc43,_0x3bc5b7[_0x31a4('0x15')][_0x31a4('0x17')]);return _0x174a0e(_0x3bc5b7[_0x31a4('0x15')][_0x31a4('0x17')]);}logger['error'](_0x31a4('0x10'),_0x1cfc43,_0x3bc5b7[_0x31a4('0x15')][_0x31a4('0x17')]);return _0x343b87(_0x3bc5b7[_0x31a4('0x15')][_0x31a4('0x17')]);}else{logger[_0x31a4('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0x1cfc43,'request\x20sent');_0x343b87(_0x3bc5b7[_0x31a4('0x18')]['message']);}})[_0x31a4('0x19')](function(_0x451c4a){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x1cfc43,_0x451c4a);_0x174a0e(_0x451c4a);});});} \ No newline at end of file +var _0xa583=['debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x58d5ac,_0x11c4bc){var _0x37985c=function(_0x419671){while(--_0x419671){_0x58d5ac['push'](_0x58d5ac['shift']());}};_0x37985c(++_0x11c4bc);}(_0xa583,0xbb));var _0x3a58=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xa583[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x3a58('0x0'));var util=require('util');var moment=require(_0x3a58('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3a58('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x3a58('0x3'));var logger=require(_0x3a58('0x4'))('rpc');var config=require(_0x3a58('0x5'));var jayson=require(_0x3a58('0x6'));var client=jayson['client'][_0x3a58('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4c425b,_0x21afb7,_0x34d681){return new BPromise(function(_0x221935,_0x16a739){return client[_0x3a58('0x8')](_0x4c425b,_0x34d681)[_0x3a58('0x9')](function(_0x31c433){logger[_0x3a58('0xa')](_0x3a58('0xb'),_0x21afb7,_0x3a58('0xc'));logger[_0x3a58('0xd')](_0x3a58('0xe'),_0x21afb7,_0x3a58('0xc'),JSON['stringify'](_0x31c433));if(_0x31c433[_0x3a58('0xf')]){if(_0x31c433[_0x3a58('0xf')][_0x3a58('0x10')]===0x1f4){logger['error'](_0x3a58('0xb'),_0x21afb7,_0x31c433[_0x3a58('0xf')][_0x3a58('0x11')]);return _0x16a739(_0x31c433['error'][_0x3a58('0x11')]);}logger[_0x3a58('0xf')](_0x3a58('0xb'),_0x21afb7,_0x31c433[_0x3a58('0xf')]['message']);return _0x221935(_0x31c433[_0x3a58('0xf')][_0x3a58('0x11')]);}else{logger['info'](_0x3a58('0xb'),_0x21afb7,_0x3a58('0xc'));_0x221935(_0x31c433[_0x3a58('0x12')][_0x3a58('0x11')]);}})[_0x3a58('0x13')](function(_0x1d292b){logger[_0x3a58('0xf')](_0x3a58('0xb'),_0x21afb7,_0x1d292b);_0x16a739(_0x1d292b);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index b5a2ca1..bef0f58 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(_0x37bee6,_0xa58df8){var _0x1bfcf9=function(_0x4d0e3e){while(--_0x4d0e3e){_0x37bee6['push'](_0x37bee6['shift']());}};_0x1bfcf9(++_0xa58df8);}(_0x9c44,0x178));var _0x49c4=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x9c44[_0x1035c1];return _0x308d67;};'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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x19e46e,_0x1682a1){var _0x5e9c0c=function(_0x47d27b){while(--_0x47d27b){_0x19e46e['push'](_0x19e46e['shift']());}};_0x5e9c0c(++_0x1682a1);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x352e09,_0x37a7da){_0x352e09=_0x352e09-0x0;var _0x1b7094=_0xcb91[_0x352e09];return _0x1b7094;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index afdcfa9..2326fa5 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 _0x2afe=['STRING','queue_interface','sequelize','INTEGER','Required\x20by\x20Asterisk'];(function(_0x5b013d,_0xc7691c){var _0x2b6eef=function(_0x3143ca){while(--_0x3143ca){_0x5b013d['push'](_0x5b013d['shift']());}};_0x2b6eef(++_0xc7691c);}(_0x2afe,0xbb));var _0xe2af=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x2afe[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xe2af('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe2af('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xe2af('0x2')},'membername':{'type':Sequelize[_0xe2af('0x3')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0xe2af('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xe2af('0x3')],'allowNull':![],'unique':_0xe2af('0x4'),'comment':_0xe2af('0x2')},'VoiceQueueId':{'type':Sequelize[_0xe2af('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0xe2af('0x3')],'allowNull':![],'unique':_0xe2af('0x4'),'comment':_0xe2af('0x2')},'penalty':{'type':Sequelize[_0xe2af('0x1')](0xb),'defaultValue':0x0,'comment':_0xe2af('0x2')},'paused':{'type':Sequelize[_0xe2af('0x1')](0xb),'defaultValue':0x0,'comment':_0xe2af('0x2')}}; \ No newline at end of file +var _0x24e0=['STRING','queue_interface','sequelize','INTEGER','Required\x20by\x20Asterisk'];(function(_0x1392dd,_0x110510){var _0x5be451=function(_0x2e1f70){while(--_0x2e1f70){_0x1392dd['push'](_0x1392dd['shift']());}};_0x5be451(++_0x110510);}(_0x24e0,0xe8));var _0x024e=function(_0x4ee3a1,_0x11a38c){_0x4ee3a1=_0x4ee3a1-0x0;var _0x538821=_0x24e0[_0x4ee3a1];return _0x538821;};'use strict';var Sequelize=require(_0x024e('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x024e('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x024e('0x2')},'membername':{'type':Sequelize[_0x024e('0x3')],'allowNull':![],'comment':_0x024e('0x2')},'UserId':{'type':Sequelize[_0x024e('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x024e('0x4'),'comment':_0x024e('0x2')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0x024e('0x3')],'allowNull':![],'unique':'queue_interface','comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0x024e('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x024e('0x1')](0xb),'defaultValue':0x0,'comment':_0x024e('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index ba28b66..3781ad5 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 _0xec58=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','UserVoiceQueueRt'];(function(_0xf45927,_0x35f36d){var _0x11fd69=function(_0x2e23e9){while(--_0x2e23e9){_0xf45927['push'](_0xf45927['shift']());}};_0x11fd69(++_0x35f36d);}(_0xec58,0x18d));var _0x8ec5=function(_0x3452eb,_0x44035e){_0x3452eb=_0x3452eb-0x0;var _0x4244fd=_0xec58[_0x3452eb];return _0x4244fd;};'use strict';var EventEmitter=require(_0x8ec5('0x0'));var UserVoiceQueueRt=require(_0x8ec5('0x1'))['db'][_0x8ec5('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x8ec5('0x3')](0x0);var events={'afterCreate':_0x8ec5('0x4'),'afterUpdate':_0x8ec5('0x5'),'afterDestroy':_0x8ec5('0x6')};function emitEvent(_0x38a167){return function(_0x593585,_0x146e8e,_0x4b8b21){UserVoiceQueueRtEvents[_0x8ec5('0x7')](_0x38a167+':'+_0x593585['id'],_0x593585);UserVoiceQueueRtEvents[_0x8ec5('0x7')](_0x38a167,_0x593585);_0x4b8b21(null);};}for(var e in events){if(events[_0x8ec5('0x8')](e)){var event=events[e];UserVoiceQueueRt[_0x8ec5('0x9')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xf2e4=['update','emit','hasOwnProperty','hook','events','UserVoiceQueueRt','save'];(function(_0x538460,_0x350ff4){var _0x15e57c=function(_0x1dd909){while(--_0x1dd909){_0x538460['push'](_0x538460['shift']());}};_0x15e57c(++_0x350ff4);}(_0xf2e4,0x13f));var _0x4f2e=function(_0x2f25fe,_0x17cb7a){_0x2f25fe=_0x2f25fe-0x0;var _0x2bd94f=_0xf2e4[_0x2f25fe];return _0x2bd94f;};'use strict';var EventEmitter=require(_0x4f2e('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0x4f2e('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4f2e('0x2'),'afterUpdate':_0x4f2e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x1cb46e){return function(_0x103a91,_0x437e6c,_0x2ba62a){UserVoiceQueueRtEvents[_0x4f2e('0x4')](_0x1cb46e+':'+_0x103a91['id'],_0x103a91);UserVoiceQueueRtEvents[_0x4f2e('0x4')](_0x1cb46e,_0x103a91);_0x2ba62a(null);};}for(var e in events){if(events[_0x4f2e('0x5')](e)){var event=events[e];UserVoiceQueueRt[_0x4f2e('0x6')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index ec2ac52..aa7fe07 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 _0xf804=['define','user_has_voice_queues_rt','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports'];(function(_0xb79122,_0x43edad){var _0x4ba1cd=function(_0x318bf0){while(--_0x318bf0){_0xb79122['push'](_0xb79122['shift']());}};_0x4ba1cd(++_0x43edad);}(_0xf804,0x92));var _0x4f80=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xf804[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x4f80('0x0'));var util=require(_0x4f80('0x1'));var logger=require(_0x4f80('0x2'))('api');var moment=require(_0x4f80('0x3'));var BPromise=require(_0x4f80('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4f80('0x5'));var rimraf=require(_0x4f80('0x6'));var config=require(_0x4f80('0x7'));var attributes=require(_0x4f80('0x8'));module[_0x4f80('0x9')]=function(_0x1016ef,_0x54a5d9){return _0x1016ef[_0x4f80('0xa')]('UserVoiceQueueRt',attributes,{'tableName':_0x4f80('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd20e=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash'];(function(_0x2644f8,_0x40977c){var _0x233fea=function(_0x308f49){while(--_0x308f49){_0x2644f8['push'](_0x2644f8['shift']());}};_0x233fea(++_0x40977c);}(_0xd20e,0x1b9));var _0xed20=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xd20e[_0x50a0c2];return _0x5ebadd;};'use strict';var _=require(_0xed20('0x0'));var util=require(_0xed20('0x1'));var logger=require(_0xed20('0x2'))('api');var moment=require(_0xed20('0x3'));var BPromise=require(_0xed20('0x4'));var rp=require(_0xed20('0x5'));var fs=require('fs');var path=require(_0xed20('0x6'));var rimraf=require(_0xed20('0x7'));var config=require(_0xed20('0x8'));var attributes=require('./userVoiceQueueRt.attributes');module[_0xed20('0x9')]=function(_0x3a5f1f,_0x7c0fb3){return _0x3a5f1f[_0xed20('0xa')](_0xed20('0xb'),attributes,{'tableName':_0xed20('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index 88c11c4..dd4c1c4 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 _0xe7a8=['lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','defaults','localhost','redis','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses'];(function(_0x4d1101,_0x415b12){var _0x4fe135=function(_0x2266c1){while(--_0x2266c1){_0x4d1101['push'](_0x4d1101['shift']());}};_0x4fe135(++_0x415b12);}(_0xe7a8,0xbe));var _0x8e7a=function(_0x492739,_0x4d7d80){_0x492739=_0x492739-0x0;var _0x4b668c=_0xe7a8[_0x492739];return _0x4b668c;};'use strict';var _=require(_0x8e7a('0x0'));var util=require('util');var moment=require(_0x8e7a('0x1'));var BPromise=require(_0x8e7a('0x2'));var rs=require(_0x8e7a('0x3'));var fs=require('fs');var Redis=require(_0x8e7a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8e7a('0x5'));var logger=require(_0x8e7a('0x6'))('rpc');var config=require(_0x8e7a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8e7a('0x8')][_0x8e7a('0x9')]({'port':0x232a});config['redis']=_[_0x8e7a('0xa')](config['redis'],{'host':_0x8e7a('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8e7a('0xc')]));require(_0x8e7a('0xd'))[_0x8e7a('0xe')](socket);function respondWithRpcPromise(_0x42a858,_0x419b90,_0x45fb86){return new BPromise(function(_0x5be751,_0x4dfe2c){return client[_0x8e7a('0xf')](_0x42a858,_0x45fb86)[_0x8e7a('0x10')](function(_0x2b408d){logger[_0x8e7a('0x11')](_0x8e7a('0x12'),_0x419b90,_0x8e7a('0x13'));logger[_0x8e7a('0x14')](_0x8e7a('0x15'),_0x419b90,'request\x20sent',JSON[_0x8e7a('0x16')](_0x2b408d));if(_0x2b408d['error']){if(_0x2b408d['error'][_0x8e7a('0x17')]===0x1f4){logger['error'](_0x8e7a('0x12'),_0x419b90,_0x2b408d['error']['message']);return _0x4dfe2c(_0x2b408d[_0x8e7a('0x18')]['message']);}logger['error'](_0x8e7a('0x12'),_0x419b90,_0x2b408d[_0x8e7a('0x18')][_0x8e7a('0x19')]);return _0x5be751(_0x2b408d[_0x8e7a('0x18')][_0x8e7a('0x19')]);}else{logger[_0x8e7a('0x11')](_0x8e7a('0x12'),_0x419b90,'request\x20sent');_0x5be751(_0x2b408d[_0x8e7a('0x1a')]['message']);}})[_0x8e7a('0x1b')](function(_0x51520e){logger[_0x8e7a('0x18')](_0x8e7a('0x12'),_0x419b90,_0x51520e);_0x4dfe2c(_0x51520e);});});}exports[_0x8e7a('0x1c')]=function(_0x21db36){var _0x1b2fae=this;return new Promise(function(_0x31d85c,_0xce8699){return db[_0x8e7a('0x1d')]['findAll']({'raw':_0x21db36['options']?_0x21db36[_0x8e7a('0x1e')][_0x8e7a('0x1f')]===undefined?!![]:![]:!![],'where':_0x21db36[_0x8e7a('0x1e')]?_0x21db36[_0x8e7a('0x1e')][_0x8e7a('0x20')]||null:null,'attributes':[[db[_0x8e7a('0x21')]['fn'](_0x8e7a('0x22'),db['sequelize']['fn']('IF',db['sequelize'][_0x8e7a('0x23')](_0x8e7a('0x24')))),_0x8e7a('0x25')]]})[_0x8e7a('0x10')](function(_0x3b8656){logger['info'](_0x8e7a('0x1c'),_0x21db36);logger[_0x8e7a('0x14')](_0x8e7a('0x1c'),_0x21db36,JSON[_0x8e7a('0x16')](_0x3b8656));_0x31d85c(_0x3b8656);})['catch'](function(_0x3c32ec){logger['error'](_0x8e7a('0x1c'),_0x3c32ec['message'],_0x21db36);_0xce8699(_0x1b2fae['error'](0x1f4,_0x3c32ec['message']));});});}; \ No newline at end of file +var _0x0b46=['debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueRtPauses','options','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','util','moment','bluebird','ioredis','../../config/logger','../../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'];(function(_0x4c03ef,_0x589748){var _0x556965=function(_0x17d7a2){while(--_0x17d7a2){_0x4c03ef['push'](_0x4c03ef['shift']());}};_0x556965(++_0x589748);}(_0x0b46,0x138));var _0x60b4=function(_0x45521d,_0x169dfe){_0x45521d=_0x45521d-0x0;var _0x24f9ed=_0x0b46[_0x45521d];return _0x24f9ed;};'use strict';var _=require(_0x60b4('0x0'));var util=require(_0x60b4('0x1'));var moment=require(_0x60b4('0x2'));var BPromise=require(_0x60b4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x60b4('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x60b4('0x5'))('rpc');var config=require(_0x60b4('0x6'));var jayson=require(_0x60b4('0x7'));var client=jayson[_0x60b4('0x8')][_0x60b4('0x9')]({'port':0x232a});config[_0x60b4('0xa')]=_[_0x60b4('0xb')](config[_0x60b4('0xa')],{'host':_0x60b4('0xc'),'port':0x18eb});var socket=require(_0x60b4('0xd'))(new Redis(config[_0x60b4('0xa')]));require(_0x60b4('0xe'))[_0x60b4('0xf')](socket);function respondWithRpcPromise(_0x55896a,_0x3bbeac,_0x5c997a){return new BPromise(function(_0x4d4cf9,_0x324eca){return client[_0x60b4('0x10')](_0x55896a,_0x5c997a)[_0x60b4('0x11')](function(_0x39f7db){logger[_0x60b4('0x12')](_0x60b4('0x13'),_0x3bbeac,_0x60b4('0x14'));logger[_0x60b4('0x15')](_0x60b4('0x16'),_0x3bbeac,'request\x20sent',JSON[_0x60b4('0x17')](_0x39f7db));if(_0x39f7db[_0x60b4('0x18')]){if(_0x39f7db[_0x60b4('0x18')][_0x60b4('0x19')]===0x1f4){logger[_0x60b4('0x18')](_0x60b4('0x13'),_0x3bbeac,_0x39f7db[_0x60b4('0x18')][_0x60b4('0x1a')]);return _0x324eca(_0x39f7db[_0x60b4('0x18')]['message']);}logger[_0x60b4('0x18')](_0x60b4('0x13'),_0x3bbeac,_0x39f7db[_0x60b4('0x18')]['message']);return _0x4d4cf9(_0x39f7db[_0x60b4('0x18')][_0x60b4('0x1a')]);}else{logger[_0x60b4('0x12')](_0x60b4('0x13'),_0x3bbeac,_0x60b4('0x14'));_0x4d4cf9(_0x39f7db[_0x60b4('0x1b')][_0x60b4('0x1a')]);}})[_0x60b4('0x1c')](function(_0x56d625){logger['error'](_0x60b4('0x13'),_0x3bbeac,_0x56d625);_0x324eca(_0x56d625);});});}exports[_0x60b4('0x1d')]=function(_0x23d5bb){var _0x4dace7=this;return new Promise(function(_0xf1e278,_0x23b4d6){return db['UserVoiceQueueRt']['findAll']({'raw':_0x23d5bb[_0x60b4('0x1e')]?_0x23d5bb[_0x60b4('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x23d5bb[_0x60b4('0x1e')]?_0x23d5bb[_0x60b4('0x1e')][_0x60b4('0x1f')]||null:null,'attributes':[[db[_0x60b4('0x20')]['fn'](_0x60b4('0x21'),db[_0x60b4('0x20')]['fn']('IF',db[_0x60b4('0x20')][_0x60b4('0x22')](_0x60b4('0x23')))),_0x60b4('0x24')]]})['then'](function(_0x1b4fbb){logger['info'](_0x60b4('0x1d'),_0x23d5bb);logger[_0x60b4('0x15')]('GetVoiceQueueRtPauses',_0x23d5bb,JSON['stringify'](_0x1b4fbb));_0xf1e278(_0x1b4fbb);})[_0x60b4('0x1c')](function(_0x27b083){logger[_0x60b4('0x18')](_0x60b4('0x1d'),_0x27b083[_0x60b4('0x1a')],_0x23d5bb);_0x23b4d6(_0x4dace7[_0x60b4('0x18')](0x1f4,_0x27b083[_0x60b4('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 0a2920d..d38b941 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 _0x6bb4=['removeListener','register','length','./userVoiceQueueRt.events','save','remove','emit'];(function(_0x1311d8,_0x1f592c){var _0x4ad599=function(_0x30a9ca){while(--_0x30a9ca){_0x1311d8['push'](_0x1311d8['shift']());}};_0x4ad599(++_0x1f592c);}(_0x6bb4,0x1a7));var _0x46bb=function(_0x34f610,_0x4158fb){_0x34f610=_0x34f610-0x0;var _0x1467ed=_0x6bb4[_0x34f610];return _0x1467ed;};'use strict';var UserVoiceQueueRtEvents=require(_0x46bb('0x0'));var events=[_0x46bb('0x1'),_0x46bb('0x2'),'update'];function createListener(_0x1205ee,_0xd0784){return function(_0x4eb2a9){_0xd0784[_0x46bb('0x3')](_0x1205ee,_0x4eb2a9);};}function removeListener(_0x100be2,_0x2eefcc){return function(){UserVoiceQueueRtEvents[_0x46bb('0x4')](_0x100be2,_0x2eefcc);};}exports[_0x46bb('0x5')]=function(_0x2ae90f){for(var _0x5dd7d6=0x0,_0x4fa5c4=events[_0x46bb('0x6')];_0x5dd7d6<_0x4fa5c4;_0x5dd7d6++){var _0x4338c9=events[_0x5dd7d6];var _0x57fb08=createListener('userVoiceQueueRt:'+_0x4338c9,_0x2ae90f);UserVoiceQueueRtEvents['on'](_0x4338c9,_0x57fb08);}}; \ No newline at end of file +var _0xb182=['userVoiceQueueRt:','save','remove','update','emit','removeListener','register','length'];(function(_0x908eb6,_0x59199b){var _0x511a09=function(_0x376c8b){while(--_0x376c8b){_0x908eb6['push'](_0x908eb6['shift']());}};_0x511a09(++_0x59199b);}(_0xb182,0x121));var _0x2b18=function(_0x507965,_0x4944f4){_0x507965=_0x507965-0x0;var _0x3608fc=_0xb182[_0x507965];return _0x3608fc;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x2b18('0x0'),_0x2b18('0x1'),_0x2b18('0x2')];function createListener(_0x4bc3a7,_0x4874ee){return function(_0x3b0f5c){_0x4874ee[_0x2b18('0x3')](_0x4bc3a7,_0x3b0f5c);};}function removeListener(_0x36ffa7,_0x4b2145){return function(){UserVoiceQueueRtEvents[_0x2b18('0x4')](_0x36ffa7,_0x4b2145);};}exports[_0x2b18('0x5')]=function(_0x22eae8){for(var _0x31236f=0x0,_0x3444c2=events[_0x2b18('0x6')];_0x31236f<_0x3444c2;_0x31236f++){var _0xcfa0=events[_0x31236f];var _0x5d08d8=createListener(_0x2b18('0x7')+_0xcfa0,_0x22eae8);UserVoiceQueueRtEvents['on'](_0xcfa0,_0x5d08d8);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 38568ab..2a3aaf0 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x5007b4,_0xc01e77){var _0x2c8818=function(_0x47a682){while(--_0x47a682){_0x5007b4['push'](_0x5007b4['shift']());}};_0x2c8818(++_0xc01e77);}(_0xedd9,0xfc));var _0x9edd=function(_0x60125d,_0x2ccfa7){_0x60125d=_0x60125d-0x0;var _0x58a0e4=_0xedd9[_0x60125d];return _0x58a0e4;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0xc06663,_0x3866e2){var _0x11f397=function(_0x75d71c){while(--_0x75d71c){_0xc06663['push'](_0xc06663['shift']());}};_0x11f397(++_0x3866e2);}(_0x70e0,0x17b));var _0x070e=function(_0x3d5987,_0x2f5509){_0x3d5987=_0x3d5987-0x0;var _0x2a6ac6=_0x70e0[_0x3d5987];return _0x2a6ac6;};'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/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index aa0a649..f1be972 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 _0x098a=['exports','sequelize'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x098a,0x10d));var _0xa098=function(_0x57175f,_0x47f2a4){_0x57175f=_0x57175f-0x0;var _0xd1d63e=_0x098a[_0x57175f];return _0xd1d63e;};'use strict';var Sequelize=require(_0xa098('0x0'));module[_0xa098('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xda05=['exports','INTEGER','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xda05,0x179));var _0x5da0=function(_0x373364,_0x198227){_0x373364=_0x373364-0x0;var _0x12d42b=_0xda05[_0x373364];return _0x12d42b;};'use strict';var Sequelize=require(_0x5da0('0x0'));module[_0x5da0('0x1')]={'penalty':{'type':Sequelize[_0x5da0('0x2')],'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 ebf4ea3..faa4bc6 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 _0x54fd=['./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x50dd49,_0x4733aa){var _0x3bfe79=function(_0x1105e3){while(--_0x1105e3){_0x50dd49['push'](_0x50dd49['shift']());}};_0x3bfe79(++_0x4733aa);}(_0x54fd,0xf6));var _0xd54f=function(_0x5a76b6,_0x487546){_0x5a76b6=_0x5a76b6-0x0;var _0x20ab89=_0x54fd[_0x5a76b6];return _0x20ab89;};'use strict';var _=require('lodash');var util=require(_0xd54f('0x0'));var logger=require(_0xd54f('0x1'))(_0xd54f('0x2'));var moment=require(_0xd54f('0x3'));var BPromise=require('bluebird');var rp=require(_0xd54f('0x4'));var fs=require('fs');var path=require(_0xd54f('0x5'));var rimraf=require(_0xd54f('0x6'));var config=require('../../config/environment');var attributes=require(_0xd54f('0x7'));module[_0xd54f('0x8')]=function(_0x13fc83,_0x4f5f12){return _0x13fc83[_0xd54f('0x9')](_0xd54f('0xa'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd611=['util','api','bluebird','../../config/environment','./userWhatsappQueue.attributes','exports','UserWhatsappQueue','user_has_whatsapp_queues','lodash'];(function(_0x5e4a86,_0x409c5b){var _0x2fa725=function(_0x480f98){while(--_0x480f98){_0x5e4a86['push'](_0x5e4a86['shift']());}};_0x2fa725(++_0x409c5b);}(_0xd611,0xf2));var _0x1d61=function(_0x56928f,_0x229473){_0x56928f=_0x56928f-0x0;var _0x159b5d=_0xd611[_0x56928f];return _0x159b5d;};'use strict';var _=require(_0x1d61('0x0'));var util=require(_0x1d61('0x1'));var logger=require('../../config/logger')(_0x1d61('0x2'));var moment=require('moment');var BPromise=require(_0x1d61('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1d61('0x4'));var attributes=require(_0x1d61('0x5'));module[_0x1d61('0x6')]=function(_0xb6fa3a,_0x3a611c){return _0xb6fa3a['define'](_0x1d61('0x7'),attributes,{'tableName':_0x1d61('0x8'),'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 6e74c49..c540c60 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 _0x8337=['jayson/promise','client','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5c4585,_0x3d0eab){var _0x21dede=function(_0x5c3d6a){while(--_0x5c3d6a){_0x5c4585['push'](_0x5c4585['shift']());}};_0x21dede(++_0x3d0eab);}(_0x8337,0xc9));var _0x7833=function(_0x2e616e,_0x2fc45a){_0x2e616e=_0x2e616e-0x0;var _0x2045ee=_0x8337[_0x2e616e];return _0x2045ee;};'use strict';var _=require(_0x7833('0x0'));var util=require(_0x7833('0x1'));var moment=require('moment');var BPromise=require(_0x7833('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7833('0x3'));var db=require(_0x7833('0x4'))['db'];var utils=require(_0x7833('0x5'));var logger=require(_0x7833('0x6'))(_0x7833('0x7'));var config=require(_0x7833('0x8'));var jayson=require(_0x7833('0x9'));var client=jayson[_0x7833('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18b1de,_0x563cf5,_0x4fd5d9){return new BPromise(function(_0x59ee8b,_0x52a1e8){return client[_0x7833('0xb')](_0x18b1de,_0x4fd5d9)[_0x7833('0xc')](function(_0x32b0f9){logger[_0x7833('0xd')](_0x7833('0xe'),_0x563cf5,_0x7833('0xf'));logger[_0x7833('0x10')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x563cf5,'request\x20sent',JSON[_0x7833('0x11')](_0x32b0f9));if(_0x32b0f9[_0x7833('0x12')]){if(_0x32b0f9[_0x7833('0x12')]['code']===0x1f4){logger[_0x7833('0x12')]('UserWhatsappQueue,\x20%s,\x20%s',_0x563cf5,_0x32b0f9['error']['message']);return _0x52a1e8(_0x32b0f9['error'][_0x7833('0x13')]);}logger[_0x7833('0x12')]('UserWhatsappQueue,\x20%s,\x20%s',_0x563cf5,_0x32b0f9[_0x7833('0x12')][_0x7833('0x13')]);return _0x59ee8b(_0x32b0f9['error']['message']);}else{logger[_0x7833('0xd')](_0x7833('0xe'),_0x563cf5,'request\x20sent');_0x59ee8b(_0x32b0f9[_0x7833('0x14')]['message']);}})['catch'](function(_0x5b710e){logger[_0x7833('0x12')](_0x7833('0xe'),_0x563cf5,_0x5b710e);_0x52a1e8(_0x5b710e);});});} \ No newline at end of file +var _0xd671=['error','UserWhatsappQueue,\x20%s,\x20%s','message','info','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xcdc039,_0x4b9153){var _0x50a58d=function(_0x3b2f0e){while(--_0x3b2f0e){_0xcdc039['push'](_0xcdc039['shift']());}};_0x50a58d(++_0x4b9153);}(_0xd671,0x1be));var _0x1d67=function(_0x1aab74,_0x38a57b){_0x1aab74=_0x1aab74-0x0;var _0x396af2=_0xd671[_0x1aab74];return _0x396af2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1d67('0x0'));var BPromise=require(_0x1d67('0x1'));var rs=require(_0x1d67('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1d67('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1d67('0x4'))('rpc');var config=require(_0x1d67('0x5'));var jayson=require(_0x1d67('0x6'));var client=jayson['client'][_0x1d67('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2152c5,_0x2dac72,_0x167a2b){return new BPromise(function(_0x46156c,_0x45156f){return client[_0x1d67('0x8')](_0x2152c5,_0x167a2b)[_0x1d67('0x9')](function(_0x52ca83){logger['info']('UserWhatsappQueue,\x20%s,\x20%s',_0x2dac72,_0x1d67('0xa'));logger[_0x1d67('0xb')](_0x1d67('0xc'),_0x2dac72,_0x1d67('0xa'),JSON[_0x1d67('0xd')](_0x52ca83));if(_0x52ca83[_0x1d67('0xe')]){if(_0x52ca83[_0x1d67('0xe')]['code']===0x1f4){logger[_0x1d67('0xe')](_0x1d67('0xf'),_0x2dac72,_0x52ca83[_0x1d67('0xe')][_0x1d67('0x10')]);return _0x45156f(_0x52ca83[_0x1d67('0xe')][_0x1d67('0x10')]);}logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x2dac72,_0x52ca83[_0x1d67('0xe')][_0x1d67('0x10')]);return _0x46156c(_0x52ca83['error'][_0x1d67('0x10')]);}else{logger[_0x1d67('0x11')]('UserWhatsappQueue,\x20%s,\x20%s',_0x2dac72,'request\x20sent');_0x46156c(_0x52ca83[_0x1d67('0x12')]['message']);}})[_0x1d67('0x13')](function(_0x50a8cf){logger[_0x1d67('0xe')]('UserWhatsappQueue,\x20%s,\x20%s',_0x2dac72,_0x50a8cf);_0x45156f(_0x50a8cf);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 8bcbc03..ca057d1 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 _0x80d9=['index','isAuthenticated','show','post','create','put','/:id','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller'];(function(_0x497a12,_0x61ec4d){var _0x418611=function(_0x58802a){while(--_0x58802a){_0x497a12['push'](_0x497a12['shift']());}};_0x418611(++_0x61ec4d);}(_0x80d9,0x15c));var _0x980d=function(_0x4c4e77,_0x2a19ab){_0x4c4e77=_0x4c4e77-0x0;var _0x789079=_0x80d9[_0x4c4e77];return _0x789079;};'use strict';var multer=require(_0x980d('0x0'));var util=require('util');var path=require(_0x980d('0x1'));var timeout=require(_0x980d('0x2'));var express=require(_0x980d('0x3'));var router=express['Router']();var fs_extra=require(_0x980d('0x4'));var auth=require(_0x980d('0x5'));var interaction=require(_0x980d('0x6'));var config=require(_0x980d('0x7'));var controller=require(_0x980d('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x980d('0x9')]);router['get']('/:id',auth[_0x980d('0xa')](),controller[_0x980d('0xb')]);router[_0x980d('0xc')]('/',auth[_0x980d('0xa')](),controller[_0x980d('0xd')]);router[_0x980d('0xe')](_0x980d('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x980d('0xf'),auth[_0x980d('0xa')](),controller['destroy']);module[_0x980d('0x10')]=router; \ No newline at end of file +var _0xe630=['post','create','put','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x59ec54,_0x512650){var _0x1fe7c9=function(_0xe2093d){while(--_0xe2093d){_0x59ec54['push'](_0x59ec54['shift']());}};_0x1fe7c9(++_0x512650);}(_0xe630,0x149));var _0x0e63=function(_0x4eaccd,_0x1f69cb){_0x4eaccd=_0x4eaccd-0x0;var _0x87556=_0xe630[_0x4eaccd];return _0x87556;};'use strict';var multer=require(_0x0e63('0x0'));var util=require(_0x0e63('0x1'));var path=require('path');var timeout=require(_0x0e63('0x2'));var express=require(_0x0e63('0x3'));var router=express[_0x0e63('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0e63('0x5'));var interaction=require(_0x0e63('0x6'));var config=require(_0x0e63('0x7'));var controller=require('./variable.controller');router[_0x0e63('0x8')]('/',auth[_0x0e63('0x9')](),controller[_0x0e63('0xa')]);router[_0x0e63('0x8')](_0x0e63('0xb'),auth['isAuthenticated'](),controller[_0x0e63('0xc')]);router[_0x0e63('0xd')]('/',auth[_0x0e63('0x9')](),controller[_0x0e63('0xe')]);router[_0x0e63('0xf')](_0x0e63('0xb'),auth[_0x0e63('0x9')](),controller[_0x0e63('0x10')]);router[_0x0e63('0x11')](_0x0e63('0xb'),auth[_0x0e63('0x9')](),controller['destroy']);module[_0x0e63('0x12')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 4bf3ed7..972733a 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 _0xa232=['STRING','name'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xa232,0x141));var _0x2a23=function(_0x100269,_0x2a6cf2){_0x100269=_0x100269-0x0;var _0x4222ac=_0xa232[_0x100269];return _0x4222ac;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x2a23('0x0'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x2a23('0x1')]}}; \ No newline at end of file +var _0x95b2=['sequelize','exports','STRING','name'];(function(_0x3358ba,_0x24c5fc){var _0x296e73=function(_0x843ff3){while(--_0x843ff3){_0x3358ba['push'](_0x3358ba['shift']());}};_0x296e73(++_0x24c5fc);}(_0x95b2,0x144));var _0x295b=function(_0x7e41cf,_0x683202){_0x7e41cf=_0x7e41cf-0x0;var _0x44cefe=_0x95b2[_0x7e41cf];return _0x44cefe;};'use strict';var Sequelize=require(_0x295b('0x0'));module[_0x295b('0x1')]={'name':{'type':Sequelize[_0x295b('0x2')],'unique':_0x295b('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x295b('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 17b1e23..73ef295 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 _0x5e3c=['map','Variable','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','Content-Range','apply','reject','update','then','destroy','get','Variables','UserProfileResource','end','error','stack','name','send'];(function(_0xb87ee4,_0x36605c){var _0x2efaed=function(_0x2174bd){while(--_0x2174bd){_0xb87ee4['push'](_0xb87ee4['shift']());}};_0x2efaed(++_0x36605c);}(_0x5e3c,0x123));var _0xc5e3=function(_0x119f60,_0xa33d21){_0x119f60=_0x119f60-0x0;var _0x1e3bd4=_0x5e3c[_0x119f60];return _0x1e3bd4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc5e3('0x0'));var zipdir=require(_0xc5e3('0x1'));var jsonpatch=require(_0xc5e3('0x2'));var rp=require(_0xc5e3('0x3'));var moment=require(_0xc5e3('0x4'));var BPromise=require(_0xc5e3('0x5'));var Mustache=require(_0xc5e3('0x6'));var util=require(_0xc5e3('0x7'));var path=require(_0xc5e3('0x8'));var sox=require(_0xc5e3('0x9'));var csv=require(_0xc5e3('0xa'));var ejs=require(_0xc5e3('0xb'));var fs=require('fs');var fs_extra=require(_0xc5e3('0xc'));var _=require(_0xc5e3('0xd'));var squel=require(_0xc5e3('0xe'));var crypto=require('crypto');var jsforce=require(_0xc5e3('0xf'));var deskjs=require(_0xc5e3('0x10'));var toCsv=require(_0xc5e3('0xa'));var querystring=require(_0xc5e3('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc5e3('0x12'));var hardwareService=require(_0xc5e3('0x13'));var logger=require(_0xc5e3('0x14'))(_0xc5e3('0x15'));var utils=require(_0xc5e3('0x16'));var config=require(_0xc5e3('0x17'));var licenseUtil=require(_0xc5e3('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x416e7f,_0x4e6977){_0x4e6977=_0x4e6977||0xcc;return function(_0x1a643a){if(_0x1a643a){return _0x416e7f[_0xc5e3('0x19')](_0x4e6977);}return _0x416e7f[_0xc5e3('0x1a')](_0x4e6977)['end']();};}function respondWithResult(_0x1f9c23,_0x463c53){_0x463c53=_0x463c53||0xc8;return function(_0x472499){if(_0x472499){return _0x1f9c23[_0xc5e3('0x1a')](_0x463c53)[_0xc5e3('0x1b')](_0x472499);}};}function respondWithFilteredResult(_0x161a05,_0x363e4e){return function(_0x2c0597){if(_0x2c0597){var _0x389cc9=typeof _0x363e4e[_0xc5e3('0x1c')]==='undefined'&&typeof _0x363e4e['limit']===_0xc5e3('0x1d');var _0x30862d=_0x2c0597[_0xc5e3('0x1e')];var _0x5e4b8d=_0x389cc9?0x0:_0x363e4e['offset'];var _0x6b2075=_0x389cc9?_0x2c0597['count']:_0x363e4e[_0xc5e3('0x1c')]+_0x363e4e['limit'];var _0x17604a;if(_0x6b2075>=_0x30862d){_0x6b2075=_0x30862d;_0x17604a=0xc8;}else{_0x17604a=0xce;}_0x161a05[_0xc5e3('0x1a')](_0x17604a);return _0x161a05['set'](_0xc5e3('0x1f'),_0x5e4b8d+'-'+_0x6b2075+'/'+_0x30862d)[_0xc5e3('0x1b')](_0x2c0597);}return null;};}function patchUpdates(_0x5ef66c){return function(_0x336195){try{jsonpatch[_0xc5e3('0x20')](_0x336195,_0x5ef66c,!![]);}catch(_0xe4c050){return BPromise[_0xc5e3('0x21')](_0xe4c050);}return _0x336195['save']();};}function saveUpdates(_0x2c24c8,_0x500194){return function(_0x468b18){if(_0x468b18){return _0x468b18[_0xc5e3('0x22')](_0x2c24c8)[_0xc5e3('0x23')](function(_0x41091f){return _0x41091f;});}return null;};}function removeEntity(_0x5b7279,_0x1ecbb0){return function(_0x2c23b5){if(_0x2c23b5){return _0x2c23b5[_0xc5e3('0x24')]()['then'](function(){var _0x20b135=_0x2c23b5[_0xc5e3('0x25')]({'plain':!![]});var _0x3f8a27=_0xc5e3('0x26');return db[_0xc5e3('0x27')][_0xc5e3('0x24')]({'where':{'type':_0x3f8a27,'resourceId':_0x20b135['id']}})[_0xc5e3('0x23')](function(){return _0x2c23b5;});})['then'](function(){_0x5b7279['status'](0xcc)[_0xc5e3('0x28')]();});}};}function handleEntityNotFound(_0x5ae652,_0x4926a8){return function(_0x29ae1f){if(!_0x29ae1f){_0x5ae652[_0xc5e3('0x19')](0x194);}return _0x29ae1f;};}function handleError(_0x3d84a5,_0x31d210){_0x31d210=_0x31d210||0x1f4;return function(_0x412383){logger[_0xc5e3('0x29')](_0x412383[_0xc5e3('0x2a')]);if(_0x412383[_0xc5e3('0x2b')]){delete _0x412383[_0xc5e3('0x2b')];}_0x3d84a5['status'](_0x31d210)[_0xc5e3('0x2c')](_0x412383);};}exports['index']=function(_0x19dbad,_0x2e0292){var _0x215b47={},_0x2456f6={},_0x4c8939={'count':0x0,'rows':[]};var _0x2dcb36=_[_0xc5e3('0x2d')](db[_0xc5e3('0x2e')][_0xc5e3('0x2f')],function(_0x4649a4){return{'name':_0x4649a4[_0xc5e3('0x30')],'type':_0x4649a4[_0xc5e3('0x31')][_0xc5e3('0x32')]};});_0x2456f6[_0xc5e3('0x33')]=_[_0xc5e3('0x2d')](_0x2dcb36,'name');_0x2456f6[_0xc5e3('0x34')]=_[_0xc5e3('0x35')](_0x19dbad['query']);_0x2456f6[_0xc5e3('0x36')]=_[_0xc5e3('0x37')](_0x2456f6['model'],_0x2456f6[_0xc5e3('0x34')]);_0x215b47[_0xc5e3('0x38')]=_['intersection'](_0x2456f6[_0xc5e3('0x33')],qs['fields'](_0x19dbad[_0xc5e3('0x34')][_0xc5e3('0x39')]));_0x215b47['attributes']=_0x215b47['attributes'][_0xc5e3('0x3a')]?_0x215b47['attributes']:_0x2456f6[_0xc5e3('0x33')];if(!_0x19dbad[_0xc5e3('0x34')][_0xc5e3('0x3b')](_0xc5e3('0x3c'))){_0x215b47['limit']=qs[_0xc5e3('0x3d')](_0x19dbad['query'][_0xc5e3('0x3d')]);_0x215b47['offset']=qs['offset'](_0x19dbad[_0xc5e3('0x34')][_0xc5e3('0x1c')]);}_0x215b47['order']=qs['sort'](_0x19dbad[_0xc5e3('0x34')][_0xc5e3('0x3e')]);_0x215b47[_0xc5e3('0x3f')]=qs[_0xc5e3('0x36')](_[_0xc5e3('0x40')](_0x19dbad[_0xc5e3('0x34')],_0x2456f6['filters']),_0x2dcb36);if(_0x19dbad[_0xc5e3('0x34')][_0xc5e3('0x41')]){_0x215b47[_0xc5e3('0x3f')]=_[_0xc5e3('0x42')](_0x215b47[_0xc5e3('0x3f')],{'$or':_[_0xc5e3('0x2d')](_0x2dcb36,function(_0x37cb7){if(_0x37cb7[_0xc5e3('0x31')]!==_0xc5e3('0x43')){var _0x50656d={};_0x50656d[_0x37cb7[_0xc5e3('0x2b')]]={'$like':'%'+_0x19dbad[_0xc5e3('0x34')]['filter']+'%'};return _0x50656d;}})});}_0x215b47=_[_0xc5e3('0x42')]({},_0x215b47,_0x19dbad[_0xc5e3('0x44')]);var _0x1d1f92={'where':_0x215b47['where']};return db[_0xc5e3('0x2e')][_0xc5e3('0x1e')](_0x1d1f92)[_0xc5e3('0x23')](function(_0x15ec7e){_0x4c8939[_0xc5e3('0x1e')]=_0x15ec7e;if(_0x19dbad[_0xc5e3('0x34')][_0xc5e3('0x45')]){_0x215b47[_0xc5e3('0x46')]=[{'all':!![]}];}return db[_0xc5e3('0x2e')]['findAll'](_0x215b47);})[_0xc5e3('0x23')](function(_0x2d03b0){_0x4c8939[_0xc5e3('0x47')]=_0x2d03b0;return _0x4c8939;})[_0xc5e3('0x23')](respondWithFilteredResult(_0x2e0292,_0x215b47))['catch'](handleError(_0x2e0292,null));};exports[_0xc5e3('0x48')]=function(_0x18d14a,_0x30afab){var _0x137962={'raw':!![],'where':{'id':_0x18d14a[_0xc5e3('0x49')]['id']}},_0x46dc7c={};_0x46dc7c[_0xc5e3('0x33')]=_[_0xc5e3('0x35')](db['Variable']['rawAttributes']);_0x46dc7c[_0xc5e3('0x34')]=_[_0xc5e3('0x35')](_0x18d14a['query']);_0x46dc7c[_0xc5e3('0x36')]=_['intersection'](_0x46dc7c[_0xc5e3('0x33')],_0x46dc7c[_0xc5e3('0x34')]);_0x137962[_0xc5e3('0x38')]=_[_0xc5e3('0x37')](_0x46dc7c[_0xc5e3('0x33')],qs[_0xc5e3('0x39')](_0x18d14a[_0xc5e3('0x34')][_0xc5e3('0x39')]));_0x137962[_0xc5e3('0x38')]=_0x137962['attributes'][_0xc5e3('0x3a')]?_0x137962[_0xc5e3('0x38')]:_0x46dc7c[_0xc5e3('0x33')];if(_0x18d14a['query']['includeAll']){_0x137962[_0xc5e3('0x46')]=[{'all':!![]}];}_0x137962=_[_0xc5e3('0x42')]({},_0x137962,_0x18d14a[_0xc5e3('0x44')]);return db[_0xc5e3('0x2e')][_0xc5e3('0x4a')](_0x137962)[_0xc5e3('0x23')](handleEntityNotFound(_0x30afab,null))[_0xc5e3('0x23')](respondWithResult(_0x30afab,null))[_0xc5e3('0x4b')](handleError(_0x30afab,null));};exports[_0xc5e3('0x4c')]=function(_0x2a7534,_0x3bad1d){return db[_0xc5e3('0x2e')][_0xc5e3('0x4c')](_0x2a7534[_0xc5e3('0x4d')],{})[_0xc5e3('0x23')](function(_0x1da096){var _0x3f4753=_0x2a7534['user'][_0xc5e3('0x25')]({'plain':!![]});if(!_0x3f4753)throw new Error(_0xc5e3('0x4e'));if(_0x3f4753[_0xc5e3('0x4f')]===_0xc5e3('0x50')){var _0x374d34=_0x1da096[_0xc5e3('0x25')]({'plain':!![]});var _0x3fff7f='Variables';return db[_0xc5e3('0x51')][_0xc5e3('0x4a')]({'where':{'name':_0x3fff7f,'userProfileId':_0x3f4753[_0xc5e3('0x52')]},'raw':!![]})[_0xc5e3('0x23')](function(_0x58e6a0){if(_0x58e6a0&&_0x58e6a0['autoAssociation']===0x0){return db[_0xc5e3('0x27')][_0xc5e3('0x4c')]({'name':_0x374d34['name'],'resourceId':_0x374d34['id'],'type':_0x58e6a0[_0xc5e3('0x2b')],'sectionId':_0x58e6a0['id']},{})[_0xc5e3('0x23')](function(){return _0x1da096;});}else{return _0x1da096;}})[_0xc5e3('0x4b')](function(_0x40a0be){logger['error'](_0xc5e3('0x53'),_0x40a0be);throw _0x40a0be;});}return _0x1da096;})[_0xc5e3('0x23')](respondWithResult(_0x3bad1d,0xc9))[_0xc5e3('0x4b')](handleError(_0x3bad1d,null));};exports[_0xc5e3('0x22')]=function(_0x5a2002,_0x114f58){if(_0x5a2002[_0xc5e3('0x4d')]['id']){delete _0x5a2002[_0xc5e3('0x4d')]['id'];}return db[_0xc5e3('0x2e')]['find']({'where':{'id':_0x5a2002[_0xc5e3('0x49')]['id']}})['then'](handleEntityNotFound(_0x114f58,null))[_0xc5e3('0x23')](saveUpdates(_0x5a2002[_0xc5e3('0x4d')],null))[_0xc5e3('0x23')](respondWithResult(_0x114f58,null))[_0xc5e3('0x4b')](handleError(_0x114f58,null));};exports[_0xc5e3('0x24')]=function(_0x50608b,_0x5b0ccd){return db['Variable'][_0xc5e3('0x4a')]({'where':{'id':_0x50608b['params']['id']}})[_0xc5e3('0x23')](handleEntityNotFound(_0x5b0ccd,null))[_0xc5e3('0x23')](removeEntity(_0x5b0ccd,null))[_0xc5e3('0x4b')](handleError(_0x5b0ccd,null));}; \ No newline at end of file +var _0x9c1c=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','update','then','destroy','get','Variables','UserProfileResource','error','name','send','index','map','Variable','fieldName','key','model','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','options','rows','catch','show','params','keys','rawAttributes','filters','include','find','create','role','user','userProfileId','autoAssociation'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c1c,0xa6));var _0xc9c1=function(_0x45346d,_0xffd56b){_0x45346d=_0x45346d-0x0;var _0x5ce7ca=_0x9c1c[_0x45346d];return _0x5ce7ca;};'use strict';var emlformat=require(_0xc9c1('0x0'));var rimraf=require(_0xc9c1('0x1'));var zipdir=require(_0xc9c1('0x2'));var jsonpatch=require(_0xc9c1('0x3'));var rp=require(_0xc9c1('0x4'));var moment=require('moment');var BPromise=require(_0xc9c1('0x5'));var Mustache=require(_0xc9c1('0x6'));var util=require(_0xc9c1('0x7'));var path=require(_0xc9c1('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(_0xc9c1('0x9'));var squel=require(_0xc9c1('0xa'));var crypto=require('crypto');var jsforce=require(_0xc9c1('0xb'));var deskjs=require(_0xc9c1('0xc'));var toCsv=require(_0xc9c1('0xd'));var querystring=require(_0xc9c1('0xe'));var Papa=require(_0xc9c1('0xf'));var Redis=require(_0xc9c1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc9c1('0x11'));var as=require(_0xc9c1('0x12'));var hardwareService=require(_0xc9c1('0x13'));var logger=require(_0xc9c1('0x14'))('api');var utils=require(_0xc9c1('0x15'));var config=require(_0xc9c1('0x16'));var licenseUtil=require(_0xc9c1('0x17'));var db=require(_0xc9c1('0x18'))['db'];function respondWithStatusCode(_0x55df3b,_0x17cb21){_0x17cb21=_0x17cb21||0xcc;return function(_0xdd0728){if(_0xdd0728){return _0x55df3b[_0xc9c1('0x19')](_0x17cb21);}return _0x55df3b[_0xc9c1('0x1a')](_0x17cb21)[_0xc9c1('0x1b')]();};}function respondWithResult(_0x3f2af1,_0xd7d87e){_0xd7d87e=_0xd7d87e||0xc8;return function(_0x1230b7){if(_0x1230b7){return _0x3f2af1[_0xc9c1('0x1a')](_0xd7d87e)['json'](_0x1230b7);}};}function respondWithFilteredResult(_0x3da33e,_0x3da264){return function(_0x3eb497){if(_0x3eb497){var _0x3981ed=typeof _0x3da264[_0xc9c1('0x1c')]===_0xc9c1('0x1d')&&typeof _0x3da264['limit']===_0xc9c1('0x1d');var _0x2d715b=_0x3eb497[_0xc9c1('0x1e')];var _0x3cc5c6=_0x3981ed?0x0:_0x3da264['offset'];var _0x145a2e=_0x3981ed?_0x3eb497[_0xc9c1('0x1e')]:_0x3da264['offset']+_0x3da264[_0xc9c1('0x1f')];var _0x22c664;if(_0x145a2e>=_0x2d715b){_0x145a2e=_0x2d715b;_0x22c664=0xc8;}else{_0x22c664=0xce;}_0x3da33e[_0xc9c1('0x1a')](_0x22c664);return _0x3da33e[_0xc9c1('0x20')](_0xc9c1('0x21'),_0x3cc5c6+'-'+_0x145a2e+'/'+_0x2d715b)[_0xc9c1('0x22')](_0x3eb497);}return null;};}function patchUpdates(_0x24fcc1){return function(_0x390469){try{jsonpatch[_0xc9c1('0x23')](_0x390469,_0x24fcc1,!![]);}catch(_0x948b8a){return BPromise[_0xc9c1('0x24')](_0x948b8a);}return _0x390469['save']();};}function saveUpdates(_0x42a455,_0x567bbc){return function(_0x496e4a){if(_0x496e4a){return _0x496e4a[_0xc9c1('0x25')](_0x42a455)[_0xc9c1('0x26')](function(_0x348767){return _0x348767;});}return null;};}function removeEntity(_0x105d1d,_0x39b374){return function(_0x35a3d6){if(_0x35a3d6){return _0x35a3d6[_0xc9c1('0x27')]()[_0xc9c1('0x26')](function(){var _0x3f1744=_0x35a3d6[_0xc9c1('0x28')]({'plain':!![]});var _0x46f324=_0xc9c1('0x29');return db[_0xc9c1('0x2a')][_0xc9c1('0x27')]({'where':{'type':_0x46f324,'resourceId':_0x3f1744['id']}})[_0xc9c1('0x26')](function(){return _0x35a3d6;});})[_0xc9c1('0x26')](function(){_0x105d1d[_0xc9c1('0x1a')](0xcc)[_0xc9c1('0x1b')]();});}};}function handleEntityNotFound(_0x4ac9df,_0x19f7a4){return function(_0x3ef67b){if(!_0x3ef67b){_0x4ac9df[_0xc9c1('0x19')](0x194);}return _0x3ef67b;};}function handleError(_0x1061d0,_0x1ea05a){_0x1ea05a=_0x1ea05a||0x1f4;return function(_0x3aba50){logger[_0xc9c1('0x2b')](_0x3aba50['stack']);if(_0x3aba50[_0xc9c1('0x2c')]){delete _0x3aba50[_0xc9c1('0x2c')];}_0x1061d0[_0xc9c1('0x1a')](_0x1ea05a)[_0xc9c1('0x2d')](_0x3aba50);};}exports[_0xc9c1('0x2e')]=function(_0x4722c9,_0x2662b0){var _0x6a0fbd={},_0x355b9f={},_0x5744f8={'count':0x0,'rows':[]};var _0x2fa9fc=_[_0xc9c1('0x2f')](db[_0xc9c1('0x30')]['rawAttributes'],function(_0x603216){return{'name':_0x603216[_0xc9c1('0x31')],'type':_0x603216['type'][_0xc9c1('0x32')]};});_0x355b9f[_0xc9c1('0x33')]=_[_0xc9c1('0x2f')](_0x2fa9fc,_0xc9c1('0x2c'));_0x355b9f[_0xc9c1('0x34')]=_['keys'](_0x4722c9[_0xc9c1('0x34')]);_0x355b9f['filters']=_['intersection'](_0x355b9f[_0xc9c1('0x33')],_0x355b9f[_0xc9c1('0x34')]);_0x6a0fbd['attributes']=_[_0xc9c1('0x35')](_0x355b9f[_0xc9c1('0x33')],qs[_0xc9c1('0x36')](_0x4722c9['query']['fields']));_0x6a0fbd[_0xc9c1('0x37')]=_0x6a0fbd[_0xc9c1('0x37')][_0xc9c1('0x38')]?_0x6a0fbd[_0xc9c1('0x37')]:_0x355b9f['model'];if(!_0x4722c9[_0xc9c1('0x34')][_0xc9c1('0x39')]('nolimit')){_0x6a0fbd[_0xc9c1('0x1f')]=qs[_0xc9c1('0x1f')](_0x4722c9[_0xc9c1('0x34')]['limit']);_0x6a0fbd[_0xc9c1('0x1c')]=qs['offset'](_0x4722c9[_0xc9c1('0x34')][_0xc9c1('0x1c')]);}_0x6a0fbd[_0xc9c1('0x3a')]=qs[_0xc9c1('0x3b')](_0x4722c9['query']['sort']);_0x6a0fbd[_0xc9c1('0x3c')]=qs['filters'](_[_0xc9c1('0x3d')](_0x4722c9[_0xc9c1('0x34')],_0x355b9f['filters']),_0x2fa9fc);if(_0x4722c9['query'][_0xc9c1('0x3e')]){_0x6a0fbd[_0xc9c1('0x3c')]=_[_0xc9c1('0x3f')](_0x6a0fbd['where'],{'$or':_['map'](_0x2fa9fc,function(_0x28ceb1){if(_0x28ceb1[_0xc9c1('0x40')]!=='VIRTUAL'){var _0x2d0c9e={};_0x2d0c9e[_0x28ceb1[_0xc9c1('0x2c')]]={'$like':'%'+_0x4722c9['query'][_0xc9c1('0x3e')]+'%'};return _0x2d0c9e;}})});}_0x6a0fbd=_[_0xc9c1('0x3f')]({},_0x6a0fbd,_0x4722c9[_0xc9c1('0x41')]);var _0x37e088={'where':_0x6a0fbd[_0xc9c1('0x3c')]};return db[_0xc9c1('0x30')][_0xc9c1('0x1e')](_0x37e088)['then'](function(_0x5b1e57){_0x5744f8[_0xc9c1('0x1e')]=_0x5b1e57;if(_0x4722c9['query']['includeAll']){_0x6a0fbd['include']=[{'all':!![]}];}return db[_0xc9c1('0x30')]['findAll'](_0x6a0fbd);})[_0xc9c1('0x26')](function(_0x51c8c9){_0x5744f8[_0xc9c1('0x42')]=_0x51c8c9;return _0x5744f8;})[_0xc9c1('0x26')](respondWithFilteredResult(_0x2662b0,_0x6a0fbd))[_0xc9c1('0x43')](handleError(_0x2662b0,null));};exports[_0xc9c1('0x44')]=function(_0x478418,_0x3482ba){var _0x251f70={'raw':!![],'where':{'id':_0x478418[_0xc9c1('0x45')]['id']}},_0x38f395={};_0x38f395[_0xc9c1('0x33')]=_[_0xc9c1('0x46')](db['Variable'][_0xc9c1('0x47')]);_0x38f395['query']=_[_0xc9c1('0x46')](_0x478418['query']);_0x38f395[_0xc9c1('0x48')]=_[_0xc9c1('0x35')](_0x38f395[_0xc9c1('0x33')],_0x38f395['query']);_0x251f70[_0xc9c1('0x37')]=_['intersection'](_0x38f395[_0xc9c1('0x33')],qs[_0xc9c1('0x36')](_0x478418[_0xc9c1('0x34')][_0xc9c1('0x36')]));_0x251f70[_0xc9c1('0x37')]=_0x251f70[_0xc9c1('0x37')][_0xc9c1('0x38')]?_0x251f70['attributes']:_0x38f395[_0xc9c1('0x33')];if(_0x478418[_0xc9c1('0x34')]['includeAll']){_0x251f70[_0xc9c1('0x49')]=[{'all':!![]}];}_0x251f70=_[_0xc9c1('0x3f')]({},_0x251f70,_0x478418[_0xc9c1('0x41')]);return db[_0xc9c1('0x30')][_0xc9c1('0x4a')](_0x251f70)[_0xc9c1('0x26')](handleEntityNotFound(_0x3482ba,null))[_0xc9c1('0x26')](respondWithResult(_0x3482ba,null))[_0xc9c1('0x43')](handleError(_0x3482ba,null));};exports[_0xc9c1('0x4b')]=function(_0x356e49,_0x5957ff){return db[_0xc9c1('0x30')][_0xc9c1('0x4b')](_0x356e49['body'],{})[_0xc9c1('0x26')](function(_0x2a4800){var _0x16501c=_0x356e49['user'][_0xc9c1('0x28')]({'plain':!![]});if(!_0x16501c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x16501c[_0xc9c1('0x4c')]===_0xc9c1('0x4d')){var _0x266a4c=_0x2a4800[_0xc9c1('0x28')]({'plain':!![]});var _0x2ff67d=_0xc9c1('0x29');return db['UserProfileSection'][_0xc9c1('0x4a')]({'where':{'name':_0x2ff67d,'userProfileId':_0x16501c[_0xc9c1('0x4e')]},'raw':!![]})[_0xc9c1('0x26')](function(_0x4d0d78){if(_0x4d0d78&&_0x4d0d78[_0xc9c1('0x4f')]===0x0){return db[_0xc9c1('0x2a')][_0xc9c1('0x4b')]({'name':_0x266a4c['name'],'resourceId':_0x266a4c['id'],'type':_0x4d0d78['name'],'sectionId':_0x4d0d78['id']},{})['then'](function(){return _0x2a4800;});}else{return _0x2a4800;}})['catch'](function(_0x445340){logger['error'](_0xc9c1('0x50'),_0x445340);throw _0x445340;});}return _0x2a4800;})['then'](respondWithResult(_0x5957ff,0xc9))[_0xc9c1('0x43')](handleError(_0x5957ff,null));};exports[_0xc9c1('0x25')]=function(_0xef1c33,_0x3f922e){if(_0xef1c33[_0xc9c1('0x51')]['id']){delete _0xef1c33['body']['id'];}return db[_0xc9c1('0x30')][_0xc9c1('0x4a')]({'where':{'id':_0xef1c33[_0xc9c1('0x45')]['id']}})[_0xc9c1('0x26')](handleEntityNotFound(_0x3f922e,null))[_0xc9c1('0x26')](saveUpdates(_0xef1c33[_0xc9c1('0x51')],null))[_0xc9c1('0x26')](respondWithResult(_0x3f922e,null))[_0xc9c1('0x43')](handleError(_0x3f922e,null));};exports['destroy']=function(_0x4639e1,_0x5a14f4){return db['Variable'][_0xc9c1('0x4a')]({'where':{'id':_0x4639e1[_0xc9c1('0x45')]['id']}})[_0xc9c1('0x26')](handleEntityNotFound(_0x5a14f4,null))[_0xc9c1('0x26')](removeEntity(_0x5a14f4,null))[_0xc9c1('0x43')](handleError(_0x5a14f4,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 5e20cbe..5857ccc 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 _0xc81a=['bluebird','request-promise','path','rimraf','../../config/environment','./variable.attributes','Variable','lodash','util','../../config/logger','api'];(function(_0x1f7a36,_0xc95a0d){var _0xbac5e=function(_0x36886){while(--_0x36886){_0x1f7a36['push'](_0x1f7a36['shift']());}};_0xbac5e(++_0xc95a0d);}(_0xc81a,0x151));var _0xac81=function(_0x37ad40,_0x5291d7){_0x37ad40=_0x37ad40-0x0;var _0x2c440f=_0xc81a[_0x37ad40];return _0x2c440f;};'use strict';var _=require(_0xac81('0x0'));var util=require(_0xac81('0x1'));var logger=require(_0xac81('0x2'))(_0xac81('0x3'));var moment=require('moment');var BPromise=require(_0xac81('0x4'));var rp=require(_0xac81('0x5'));var fs=require('fs');var path=require(_0xac81('0x6'));var rimraf=require(_0xac81('0x7'));var config=require(_0xac81('0x8'));var attributes=require(_0xac81('0x9'));module['exports']=function(_0x19d322,_0x402815){return _0x19d322['define'](_0xac81('0xa'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd87c=['./variable.attributes','exports','Variable','tools_variables','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3e4ea5,_0x5bebd8){var _0x498d23=function(_0x39045f){while(--_0x39045f){_0x3e4ea5['push'](_0x3e4ea5['shift']());}};_0x498d23(++_0x5bebd8);}(_0xd87c,0xba));var _0xcd87=function(_0x1942e7,_0x1c975c){_0x1942e7=_0x1942e7-0x0;var _0xa6551f=_0xd87c[_0x1942e7];return _0xa6551f;};'use strict';var _=require(_0xcd87('0x0'));var util=require(_0xcd87('0x1'));var logger=require(_0xcd87('0x2'))(_0xcd87('0x3'));var moment=require('moment');var BPromise=require(_0xcd87('0x4'));var rp=require(_0xcd87('0x5'));var fs=require('fs');var path=require(_0xcd87('0x6'));var rimraf=require(_0xcd87('0x7'));var config=require(_0xcd87('0x8'));var attributes=require(_0xcd87('0x9'));module[_0xcd87('0xa')]=function(_0x5ba8c2,_0xae76b7){return _0x5ba8c2['define'](_0xcd87('0xb'),attributes,{'tableName':_0xcd87('0xc'),'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 1510167..2a1de7f 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 _0x4b84=['catch','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','http','then','info','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','Variable,\x20%s,\x20%s','message','ShowVariable','Variable','find','options','raw','where','attributes','include','map','model'];(function(_0x339e2a,_0x117619){var _0x41212f=function(_0x244910){while(--_0x244910){_0x339e2a['push'](_0x339e2a['shift']());}};_0x41212f(++_0x117619);}(_0x4b84,0x1cc));var _0x44b8=function(_0x569fef,_0x49c37a){_0x569fef=_0x569fef-0x0;var _0x11f20b=_0x4b84[_0x569fef];return _0x11f20b;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x44b8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x44b8('0x3'));var logger=require(_0x44b8('0x4'))(_0x44b8('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x44b8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x54274b,_0x327f59,_0x5947f7){return new BPromise(function(_0x3e87c5,_0x5a2353){return client['request'](_0x54274b,_0x5947f7)[_0x44b8('0x7')](function(_0x42319d){logger[_0x44b8('0x8')]('Variable,\x20%s,\x20%s',_0x327f59,_0x44b8('0x9'));logger[_0x44b8('0xa')](_0x44b8('0xb'),_0x327f59,_0x44b8('0x9'),JSON[_0x44b8('0xc')](_0x42319d));if(_0x42319d[_0x44b8('0xd')]){if(_0x42319d[_0x44b8('0xd')]['code']===0x1f4){logger[_0x44b8('0xd')](_0x44b8('0xe'),_0x327f59,_0x42319d['error'][_0x44b8('0xf')]);return _0x5a2353(_0x42319d['error'][_0x44b8('0xf')]);}logger[_0x44b8('0xd')]('Variable,\x20%s,\x20%s',_0x327f59,_0x42319d[_0x44b8('0xd')]['message']);return _0x3e87c5(_0x42319d['error'][_0x44b8('0xf')]);}else{logger[_0x44b8('0x8')](_0x44b8('0xe'),_0x327f59,_0x44b8('0x9'));_0x3e87c5(_0x42319d['result']['message']);}})['catch'](function(_0x3fe9fb){logger['error'](_0x44b8('0xe'),_0x327f59,_0x3fe9fb);_0x5a2353(_0x3fe9fb);});});}exports[_0x44b8('0x10')]=function(_0x55e258){var _0x36743e=this;return new Promise(function(_0xe3de8f,_0x5103f5){return db[_0x44b8('0x11')][_0x44b8('0x12')]({'raw':_0x55e258['options']?_0x55e258[_0x44b8('0x13')][_0x44b8('0x14')]===undefined?!![]:![]:!![],'where':_0x55e258[_0x44b8('0x13')]?_0x55e258[_0x44b8('0x13')][_0x44b8('0x15')]||null:null,'attributes':_0x55e258[_0x44b8('0x13')]?_0x55e258[_0x44b8('0x13')][_0x44b8('0x16')]||null:null,'include':_0x55e258[_0x44b8('0x13')]?_0x55e258[_0x44b8('0x13')][_0x44b8('0x17')]?_[_0x44b8('0x18')](_0x55e258['options'][_0x44b8('0x17')],function(_0x3a8aa4){return{'model':db[_0x3a8aa4[_0x44b8('0x19')]],'as':_0x3a8aa4['as'],'attributes':_0x3a8aa4[_0x44b8('0x16')],'include':_0x3a8aa4[_0x44b8('0x17')]?_['map'](_0x3a8aa4[_0x44b8('0x17')],function(_0x54677c){return{'model':db[_0x54677c[_0x44b8('0x19')]],'as':_0x54677c['as'],'attributes':_0x54677c[_0x44b8('0x16')],'include':_0x54677c[_0x44b8('0x17')]?_[_0x44b8('0x18')](_0x54677c[_0x44b8('0x17')],function(_0x59acbc){return{'model':db[_0x59acbc[_0x44b8('0x19')]],'as':_0x59acbc['as'],'attributes':_0x59acbc['attributes']};}):[]};}):[]};}):[]:[]})[_0x44b8('0x7')](function(_0x350482){logger['info'](_0x44b8('0x10'),_0x55e258);logger[_0x44b8('0xa')](_0x44b8('0x10'),_0x55e258,JSON['stringify'](_0x350482));_0xe3de8f(_0x350482);})[_0x44b8('0x1a')](function(_0x242342){logger['error'](_0x44b8('0x10'),_0x242342['message'],_0x55e258);_0x5103f5(_0x36743e[_0x44b8('0xd')](0x1f4,_0x242342['message']));});});}; \ No newline at end of file +var _0x814b=['model','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowVariable','options','where','include','map','attributes'];(function(_0x188006,_0x451d6f){var _0x1675a7=function(_0x48c37c){while(--_0x48c37c){_0x188006['push'](_0x188006['shift']());}};_0x1675a7(++_0x451d6f);}(_0x814b,0x1a2));var _0xb814=function(_0x470b0a,_0x2889d6){_0x470b0a=_0x470b0a-0x0;var _0x4463f6=_0x814b[_0x470b0a];return _0x4463f6;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Variable,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}exports[_0xb814('0x18')]=function(_0x55ba16){var _0x270598=this;return new Promise(function(_0xfac75b,_0x4c3007){return db['Variable']['find']({'raw':_0x55ba16[_0xb814('0x19')]?_0x55ba16['options']['raw']===undefined?!![]:![]:!![],'where':_0x55ba16[_0xb814('0x19')]?_0x55ba16[_0xb814('0x19')][_0xb814('0x1a')]||null:null,'attributes':_0x55ba16['options']?_0x55ba16[_0xb814('0x19')]['attributes']||null:null,'include':_0x55ba16[_0xb814('0x19')]?_0x55ba16[_0xb814('0x19')][_0xb814('0x1b')]?_[_0xb814('0x1c')](_0x55ba16[_0xb814('0x19')][_0xb814('0x1b')],function(_0x1f5d40){return{'model':db[_0x1f5d40['model']],'as':_0x1f5d40['as'],'attributes':_0x1f5d40[_0xb814('0x1d')],'include':_0x1f5d40['include']?_[_0xb814('0x1c')](_0x1f5d40[_0xb814('0x1b')],function(_0x31c7ec){return{'model':db[_0x31c7ec[_0xb814('0x1e')]],'as':_0x31c7ec['as'],'attributes':_0x31c7ec[_0xb814('0x1d')],'include':_0x31c7ec[_0xb814('0x1b')]?_[_0xb814('0x1c')](_0x31c7ec['include'],function(_0x392222){return{'model':db[_0x392222[_0xb814('0x1e')]],'as':_0x392222['as'],'attributes':_0x392222[_0xb814('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb814('0xd')](function(_0x32ed56){logger[_0xb814('0xe')](_0xb814('0x18'),_0x55ba16);logger[_0xb814('0x11')]('ShowVariable',_0x55ba16,JSON[_0xb814('0x1f')](_0x32ed56));_0xfac75b(_0x32ed56);})[_0xb814('0x17')](function(_0x52ed64){logger[_0xb814('0x13')](_0xb814('0x18'),_0x52ed64[_0xb814('0x15')],_0x55ba16);_0x4c3007(_0x270598['error'](0x1f4,_0x52ed64[_0xb814('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 5ba5ae8..b42fa50 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 _0x6617=['get','index','/fetch','isAuthenticated','canUpdate','fetch','/reset','reset','pull','/restart','restart','/migrations','exports','Router','../../components/auth/service'];(function(_0x199f85,_0x4d7156){var _0x117c93=function(_0x24dd14){while(--_0x24dd14){_0x199f85['push'](_0x199f85['shift']());}};_0x117c93(++_0x4d7156);}(_0x6617,0x139));var _0x7661=function(_0x145b3c,_0x31ea4a){_0x145b3c=_0x145b3c-0x0;var _0x1b6e36=_0x6617[_0x145b3c];return _0x1b6e36;};'use strict';var express=require('express');var router=express[_0x7661('0x0')]();var auth=require(_0x7661('0x1'));var controller=require('./version.controller');router[_0x7661('0x2')]('/',controller[_0x7661('0x3')]);router[_0x7661('0x2')](_0x7661('0x4'),auth[_0x7661('0x5')](),auth[_0x7661('0x6')](),controller[_0x7661('0x7')]);router['get'](_0x7661('0x8'),auth[_0x7661('0x5')](),auth[_0x7661('0x6')](),controller[_0x7661('0x9')]);router[_0x7661('0x2')]('/pull',auth['isAuthenticated'](),auth[_0x7661('0x6')](),controller[_0x7661('0xa')]);router[_0x7661('0x2')](_0x7661('0xb'),auth[_0x7661('0x5')](),controller[_0x7661('0xc')]);router[_0x7661('0x2')](_0x7661('0xd'),controller['migrations']);module[_0x7661('0xe')]=router; \ No newline at end of file +var _0xd132=['index','isAuthenticated','canUpdate','get','/pull','pull','/restart','restart','/migrations','migrations','express','Router','../../components/auth/service'];(function(_0x4fc5df,_0x3acaab){var _0x4a18f5=function(_0x241409){while(--_0x241409){_0x4fc5df['push'](_0x4fc5df['shift']());}};_0x4a18f5(++_0x3acaab);}(_0xd132,0x142));var _0x2d13=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd132[_0x20a584];return _0x4b41a8;};'use strict';var express=require(_0x2d13('0x0'));var router=express[_0x2d13('0x1')]();var auth=require(_0x2d13('0x2'));var controller=require('./version.controller');router['get']('/',controller[_0x2d13('0x3')]);router['get']('/fetch',auth[_0x2d13('0x4')](),auth[_0x2d13('0x5')](),controller['fetch']);router[_0x2d13('0x6')]('/reset',auth[_0x2d13('0x4')](),auth[_0x2d13('0x5')](),controller['reset']);router['get'](_0x2d13('0x7'),auth[_0x2d13('0x4')](),auth[_0x2d13('0x5')](),controller[_0x2d13('0x8')]);router[_0x2d13('0x6')](_0x2d13('0x9'),auth[_0x2d13('0x4')](),controller[_0x2d13('0xa')]);router['get'](_0x2d13('0xb'),controller[_0x2d13('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 1257a91..9fd5050 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 _0x32b5=['git\x20fetch\x20origin\x20master','reset','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','pm2\x20restart\x20motion\x20%s','migrations','join','length','push','sort','sequelize','Migration','getQueryInterface','constructor','server','map','.js','then','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','Database\x20already\x20up-to-date','lodash','pkginfo','compare-versions','child_process','exec','../../mysqldb','../../config/pm2','../../config/logger','update','simple-git','root','index','version','query','latest','fetch','tags','exports','2.0.0','json','status','origin','master','error','info','git\x20fetch'];(function(_0xc9586d,_0x4c70b1){var _0x4ae212=function(_0x2b181a){while(--_0x2b181a){_0xc9586d['push'](_0xc9586d['shift']());}};_0x4ae212(++_0x4c70b1);}(_0x32b5,0x1ba));var _0x532b=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x32b5[_0x1facfa];return _0x9ec701;};'use strict';var Umzug=require('umzug');var path=require('path');var fs=require('fs');var _=require(_0x532b('0x0'));var pkginfo=require(_0x532b('0x1'))(module,'version');var compareVersions=require(_0x532b('0x2'));var exec=require(_0x532b('0x3'))[_0x532b('0x4')];var db=require(_0x532b('0x5'))['db'];var config=require('../../config/environment');var pm2=require(_0x532b('0x6'));var logger=require(_0x532b('0x7'))(_0x532b('0x8'));var git=require(_0x532b('0x9'))(config[_0x532b('0xa')]);exports[_0x532b('0xb')]=function(_0x313953,_0x56a6bf){var _0x39fde8={'current':module['exports'][_0x532b('0xc')],'phonebar':0x2};if(_0x313953[_0x532b('0xd')]&&_0x313953[_0x532b('0xd')][_0x532b('0xe')]){return git[_0x532b('0xf')]()[_0x532b('0x10')](function(_0x1cd58a,_0xfbc68){_0x39fde8[_0x532b('0xe')]=(_0x1cd58a?module[_0x532b('0x11')][_0x532b('0xc')]:_0xfbc68[_0x532b('0xe')])||_0x532b('0x12');return _0x56a6bf['status'](0xc8)[_0x532b('0x13')](_0x39fde8);});}else{return _0x56a6bf[_0x532b('0x14')](0xc8)['json'](_0x39fde8);}};exports['fetch']=function(_0x3a24b9,_0xffe3bd){return git[_0x532b('0xf')]([_0x532b('0x15'),_0x532b('0x16')],function(_0x9336e){if(_0x9336e){logger[_0x532b('0x17')](_0x9336e);return _0xffe3bd[_0x532b('0x14')](0x1f4)[_0x532b('0x13')](_0x9336e);}logger[_0x532b('0x18')](_0x532b('0x19'));return _0xffe3bd[_0x532b('0x14')](0xc8)[_0x532b('0x13')]({'output':_0x532b('0x1a')});});};exports[_0x532b('0x1b')]=function(_0x5cfbd1,_0x4545b5){return git[_0x532b('0x1b')](['--hard','FETCH_HEAD'],function(_0x42c572){if(_0x42c572){logger['error'](_0x42c572);return _0x4545b5[_0x532b('0x14')](0x1f4)[_0x532b('0x13')](_0x42c572);}logger[_0x532b('0x18')](_0x532b('0x1c'));return _0x4545b5[_0x532b('0x14')](0xc8)[_0x532b('0x13')]({'output':_0x532b('0x1d')});});};exports[_0x532b('0x1e')]=function(_0x2bab3d,_0x234ead){exec(_0x532b('0x1f'),function(_0x478d32,_0x151e1b,_0x1f8628){logger[_0x532b('0x18')](_0x151e1b);logger['info'](_0x1f8628);if(_0x478d32){logger[_0x532b('0x17')](_0x478d32);return _0x234ead[_0x532b('0x14')](0x1f4)['json'](_0x478d32);}return _0x234ead[_0x532b('0x14')](0xc8)[_0x532b('0x13')]({'output':_0x151e1b});});};exports[_0x532b('0x20')]=function(_0x3915ce,_0x428bb2){return pm2['restart'](_0x532b('0x21'))['then'](function(_0x13c859){logger[_0x532b('0x18')](_0x532b('0x22'),_0x13c859);return _0x428bb2[_0x532b('0x14')](0xc8)[_0x532b('0x13')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})['catch'](function(_0x35e591){logger[_0x532b('0x17')](_0x35e591);return _0x428bb2[_0x532b('0x14')](0x1f4)[_0x532b('0x13')](_0x35e591);});};exports[_0x532b('0x23')]=function(_0x5dbbf1,_0x516139){var _0x597438=fs['readdirSync'](path[_0x532b('0x24')](config[_0x532b('0xa')],'server',_0x532b('0x23')));var _0x503f92=[];for(var _0x4b48aa=0x0;_0x4b48aa<_0x597438[_0x532b('0x25')];_0x4b48aa++){var _0x1a36a6=_0x597438[_0x4b48aa]['replace']('.js','');if(compareVersions(module[_0x532b('0x11')][_0x532b('0xc')],_0x1a36a6)===-0x1){_0x503f92[_0x532b('0x26')](_0x1a36a6);}}if(_0x503f92[_0x532b('0x25')]){var _0x132b35=_0x503f92[_0x532b('0x27')](compareVersions);var _0x3f3088=new Umzug({'storage':_0x532b('0x28'),'storageOptions':{'model':db['Migration'],'modelName':_0x532b('0x29'),'columnName':_0x532b('0xc')},'migrations':{'params':[db[_0x532b('0x28')][_0x532b('0x2a')](),db[_0x532b('0x28')][_0x532b('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[_0x532b('0xa')],_0x532b('0x2c'),_0x532b('0x23')),'pattern':/\.js$/}});_0x3f3088['up']({'migrations':_[_0x532b('0x2d')](_0x132b35,function(_0x1a9a6b){return _0x1a9a6b+_0x532b('0x2e');})})[_0x532b('0x2f')](function(){return _0x516139['status'](0xc8)['json']({'output':_0x532b('0x30')+module[_0x532b('0x11')]['version']+_0x532b('0x31')+_[_0x532b('0x32')](_0x132b35),'migrations':_[_0x532b('0x24')](_0x132b35)});})['catch'](function(_0x30ac2b){if(_0x30ac2b instanceof db[_0x532b('0x28')]['UniqueConstraintError']){return _0x516139[_0x532b('0x14')](0xc8)['json']({'output':_0x532b('0x33')});}else{return _0x516139['status'](0x1f4)[_0x532b('0x13')](_0x30ac2b);}});}else{return _0x516139[_0x532b('0x14')](0xc8)[_0x532b('0x13')]({'output':_0x532b('0x33')});}}; \ No newline at end of file +var _0x5838=['json','fetch','origin','master','error','info','reset','--hard','git\x20reset\x20--hard\x20FETCH_HEAD','pull','npm\x20install\x20--production','restart','then','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','join','length','replace','push','sort','sequelize','Migration','getQueryInterface','constructor','server','map','.js','\x20to\x20','last','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/logger','update','root','exports','query','tags','latest','2.0.0','status'];(function(_0x48e1ec,_0x35f468){var _0x3b33eb=function(_0x507bf9){while(--_0x507bf9){_0x48e1ec['push'](_0x48e1ec['shift']());}};_0x3b33eb(++_0x35f468);}(_0x5838,0x1af));var _0x8583=function(_0x3dacd6,_0x42f69a){_0x3dacd6=_0x3dacd6-0x0;var _0x1e723f=_0x5838[_0x3dacd6];return _0x1e723f;};'use strict';var Umzug=require(_0x8583('0x0'));var path=require(_0x8583('0x1'));var fs=require('fs');var _=require(_0x8583('0x2'));var pkginfo=require(_0x8583('0x3'))(module,_0x8583('0x4'));var compareVersions=require(_0x8583('0x5'));var exec=require(_0x8583('0x6'))[_0x8583('0x7')];var db=require(_0x8583('0x8'))['db'];var config=require(_0x8583('0x9'));var pm2=require('../../config/pm2');var logger=require(_0x8583('0xa'))(_0x8583('0xb'));var git=require('simple-git')(config[_0x8583('0xc')]);exports['index']=function(_0x338dfd,_0x24e150){var _0x2668c9={'current':module[_0x8583('0xd')][_0x8583('0x4')],'phonebar':0x2};if(_0x338dfd[_0x8583('0xe')]&&_0x338dfd[_0x8583('0xe')]['latest']){return git['fetch']()[_0x8583('0xf')](function(_0x2083c4,_0x4985ea){_0x2668c9[_0x8583('0x10')]=(_0x2083c4?module[_0x8583('0xd')]['version']:_0x4985ea['latest'])||_0x8583('0x11');return _0x24e150[_0x8583('0x12')](0xc8)['json'](_0x2668c9);});}else{return _0x24e150[_0x8583('0x12')](0xc8)[_0x8583('0x13')](_0x2668c9);}};exports[_0x8583('0x14')]=function(_0x1ad93f,_0x3fb0f7){return git[_0x8583('0x14')]([_0x8583('0x15'),_0x8583('0x16')],function(_0x3635b8){if(_0x3635b8){logger[_0x8583('0x17')](_0x3635b8);return _0x3fb0f7[_0x8583('0x12')](0x1f4)['json'](_0x3635b8);}logger[_0x8583('0x18')]('git\x20fetch');return _0x3fb0f7[_0x8583('0x12')](0xc8)[_0x8583('0x13')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0x8583('0x19')]=function(_0x3a9931,_0x2d4da9){return git[_0x8583('0x19')]([_0x8583('0x1a'),'FETCH_HEAD'],function(_0x491420){if(_0x491420){logger['error'](_0x491420);return _0x2d4da9[_0x8583('0x12')](0x1f4)['json'](_0x491420);}logger[_0x8583('0x18')](_0x8583('0x1b'));return _0x2d4da9['status'](0xc8)['json']({'output':'git\x20reset\x20--hard'});});};exports[_0x8583('0x1c')]=function(_0x251c80,_0x17692d){exec(_0x8583('0x1d'),function(_0x25c205,_0x2bdc73,_0x3f054c){logger[_0x8583('0x18')](_0x2bdc73);logger['info'](_0x3f054c);if(_0x25c205){logger[_0x8583('0x17')](_0x25c205);return _0x17692d[_0x8583('0x12')](0x1f4)[_0x8583('0x13')](_0x25c205);}return _0x17692d['status'](0xc8)[_0x8583('0x13')]({'output':_0x2bdc73});});};exports[_0x8583('0x1e')]=function(_0x235e35,_0x2fcb65){return pm2['restart']('motion2')[_0x8583('0x1f')](function(_0x3b0b58){logger['info']('pm2\x20restart\x20motion\x20%s',_0x3b0b58);return _0x2fcb65[_0x8583('0x12')](0xc8)['json']({'output':_0x8583('0x20')});})[_0x8583('0x21')](function(_0x5c9296){logger[_0x8583('0x17')](_0x5c9296);return _0x2fcb65[_0x8583('0x12')](0x1f4)[_0x8583('0x13')](_0x5c9296);});};exports[_0x8583('0x22')]=function(_0x3222fb,_0x432c38){var _0xfc7e99=fs['readdirSync'](path[_0x8583('0x23')](config[_0x8583('0xc')],'server','migrations'));var _0x172213=[];for(var _0xa0abd2=0x0;_0xa0abd2<_0xfc7e99[_0x8583('0x24')];_0xa0abd2++){var _0x1ec986=_0xfc7e99[_0xa0abd2][_0x8583('0x25')]('.js','');if(compareVersions(module[_0x8583('0xd')][_0x8583('0x4')],_0x1ec986)===-0x1){_0x172213[_0x8583('0x26')](_0x1ec986);}}if(_0x172213[_0x8583('0x24')]){var _0x498cec=_0x172213[_0x8583('0x27')](compareVersions);var _0x2fb3de=new Umzug({'storage':_0x8583('0x28'),'storageOptions':{'model':db['Migration'],'modelName':_0x8583('0x29'),'columnName':_0x8583('0x4')},'migrations':{'params':[db['sequelize'][_0x8583('0x2a')](),db[_0x8583('0x28')][_0x8583('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[_0x8583('0x23')](config[_0x8583('0xc')],_0x8583('0x2c'),_0x8583('0x22')),'pattern':/\.js$/}});_0x2fb3de['up']({'migrations':_[_0x8583('0x2d')](_0x498cec,function(_0x157da8){return _0x157da8+_0x8583('0x2e');})})[_0x8583('0x1f')](function(){return _0x432c38[_0x8583('0x12')](0xc8)['json']({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x8583('0xd')][_0x8583('0x4')]+_0x8583('0x2f')+_[_0x8583('0x30')](_0x498cec),'migrations':_[_0x8583('0x23')](_0x498cec)});})[_0x8583('0x21')](function(_0x39e0b9){if(_0x39e0b9 instanceof db[_0x8583('0x28')]['UniqueConstraintError']){return _0x432c38[_0x8583('0x12')](0xc8)[_0x8583('0x13')]({'output':_0x8583('0x31')});}else{return _0x432c38['status'](0x1f4)[_0x8583('0x13')](_0x39e0b9);}});}else{return _0x432c38['status'](0xc8)[_0x8583('0x13')]({'output':_0x8583('0x31')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 2fe8a4f..77dc613 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 _0xa6a9=['post','create','put','update','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','/describe','describe','/:id'];(function(_0x5224ba,_0x3fb4e1){var _0x459bd2=function(_0x61be43){while(--_0x61be43){_0x5224ba['push'](_0x5224ba['shift']());}};_0x459bd2(++_0x3fb4e1);}(_0xa6a9,0x1ea));var _0x9a6a=function(_0x27bca8,_0x191f63){_0x27bca8=_0x27bca8-0x0;var _0x370163=_0xa6a9[_0x27bca8];return _0x370163;};'use strict';var multer=require(_0x9a6a('0x0'));var util=require('util');var path=require(_0x9a6a('0x1'));var timeout=require('connect-timeout');var express=require(_0x9a6a('0x2'));var router=express[_0x9a6a('0x3')]();var fs_extra=require(_0x9a6a('0x4'));var auth=require(_0x9a6a('0x5'));var interaction=require(_0x9a6a('0x6'));var config=require(_0x9a6a('0x7'));var controller=require(_0x9a6a('0x8'));router[_0x9a6a('0x9')]('/',auth[_0x9a6a('0xa')](),controller['index']);router[_0x9a6a('0x9')](_0x9a6a('0xb'),auth['isAuthenticated'](),controller[_0x9a6a('0xc')]);router['get'](_0x9a6a('0xd'),auth[_0x9a6a('0xa')](),controller['show']);router[_0x9a6a('0xe')]('/',auth[_0x9a6a('0xa')](),controller[_0x9a6a('0xf')]);router[_0x9a6a('0x10')](_0x9a6a('0xd'),auth['isAuthenticated'](),controller[_0x9a6a('0x11')]);router['delete'](_0x9a6a('0xd'),auth[_0x9a6a('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x4c2c=['describe','/:id','show','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','/describe'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x4c2c,0xa7));var _0xc4c2=function(_0x13cdd0,_0x3a3ca7){_0x13cdd0=_0x13cdd0-0x0;var _0x2fcc49=_0x4c2c[_0x13cdd0];return _0x2fcc49;};'use strict';var multer=require(_0xc4c2('0x0'));var util=require(_0xc4c2('0x1'));var path=require(_0xc4c2('0x2'));var timeout=require(_0xc4c2('0x3'));var express=require(_0xc4c2('0x4'));var router=express[_0xc4c2('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc4c2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc4c2('0x7'));var controller=require(_0xc4c2('0x8'));router[_0xc4c2('0x9')]('/',auth[_0xc4c2('0xa')](),controller[_0xc4c2('0xb')]);router['get'](_0xc4c2('0xc'),auth[_0xc4c2('0xa')](),controller[_0xc4c2('0xd')]);router[_0xc4c2('0x9')](_0xc4c2('0xe'),auth[_0xc4c2('0xa')](),controller[_0xc4c2('0xf')]);router['post']('/',auth[_0xc4c2('0xa')](),controller[_0xc4c2('0x10')]);router[_0xc4c2('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0xc4c2('0xe'),auth[_0xc4c2('0xa')](),controller[_0xc4c2('0x12')]);module[_0xc4c2('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index b9a5c76..bda83f8 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 _0x7708=['INTEGER','BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0xe1b5f6,_0x210c09){var _0x44636e=function(_0x3a3212){while(--_0x3a3212){_0xe1b5f6['push'](_0xe1b5f6['shift']());}};_0x44636e(++_0x210c09);}(_0x7708,0x188));var _0x8770=function(_0x15cbce,_0xda8402){_0x15cbce=_0x15cbce-0x0;var _0x257f29=_0x7708[_0x15cbce];return _0x257f29;};'use strict';var Sequelize=require(_0x8770('0x0'));module[_0x8770('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x8770('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x8770('0x2')]},'agentcalledAt':{'type':Sequelize[_0x8770('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0x8770('0x3')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0x8770('0x3')]},'holdtime':{'type':Sequelize[_0x8770('0x4')]},'agentcomplete':{'type':Sequelize[_0x8770('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x8770('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x8770('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x8770('0x4')]},'agentacw':{'type':Sequelize[_0x8770('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x8770('0x2')]},'lastevent':{'type':Sequelize[_0x8770('0x2')]},'channel':{'type':Sequelize[_0x8770('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x8770('0x2')]},'connectedlinenum':{'type':Sequelize[_0x8770('0x2')]},'connectedlinename':{'type':Sequelize[_0x8770('0x2')]},'language':{'type':Sequelize[_0x8770('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x8770('0x2')]},'exten':{'type':Sequelize[_0x8770('0x2')]},'priority':{'type':Sequelize[_0x8770('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x8770('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x8770('0x2')]},'destcalleridnum':{'type':Sequelize[_0x8770('0x2')]},'destcalleridname':{'type':Sequelize[_0x8770('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x8770('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x8770('0x2')]},'destlanguage':{'type':Sequelize[_0x8770('0x2')]},'destaccountcode':{'type':Sequelize[_0x8770('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x8770('0x2')]},'destpriority':{'type':Sequelize[_0x8770('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x8770('0x2')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x8770('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x8770('0x2')]},'agententerreason':{'type':Sequelize[_0x8770('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6ac2=['DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','STRING'];(function(_0x292f52,_0x4fcc08){var _0xfdcc8=function(_0x2f85cb){while(--_0x2f85cb){_0x292f52['push'](_0x292f52['shift']());}};_0xfdcc8(++_0x4fcc08);}(_0x6ac2,0x184));var _0x26ac=function(_0xe493d9,_0x333e74){_0xe493d9=_0xe493d9-0x0;var _0x59e028=_0x6ac2[_0xe493d9];return _0x59e028;};'use strict';var Sequelize=require(_0x26ac('0x0'));module['exports']={'type':{'type':Sequelize[_0x26ac('0x1')]},'uniqueid':{'type':Sequelize[_0x26ac('0x1')]},'calleridnum':{'type':Sequelize[_0x26ac('0x1')]},'calleridname':{'type':Sequelize[_0x26ac('0x1')]},'queue':{'type':Sequelize[_0x26ac('0x1')]},'interface':{'type':Sequelize[_0x26ac('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x26ac('0x2')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0x26ac('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x26ac('0x2')]},'agentdumpAt':{'type':Sequelize[_0x26ac('0x2')]},'holdtime':{'type':Sequelize[_0x26ac('0x3')]},'agentcomplete':{'type':Sequelize[_0x26ac('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x26ac('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x26ac('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x26ac('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x26ac('0x1')]},'lastevent':{'type':Sequelize[_0x26ac('0x1')]},'channel':{'type':Sequelize[_0x26ac('0x1')]},'channelstate':{'type':Sequelize[_0x26ac('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x26ac('0x1')]},'connectedlinename':{'type':Sequelize[_0x26ac('0x1')]},'language':{'type':Sequelize[_0x26ac('0x1')]},'accountcode':{'type':Sequelize[_0x26ac('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x26ac('0x1')]},'destchannel':{'type':Sequelize[_0x26ac('0x1')]},'destchannelstate':{'type':Sequelize[_0x26ac('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x26ac('0x1')]},'destcalleridnum':{'type':Sequelize[_0x26ac('0x1')]},'destcalleridname':{'type':Sequelize[_0x26ac('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x26ac('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x26ac('0x1')]},'destaccountcode':{'type':Sequelize[_0x26ac('0x1')]},'destcontext':{'type':Sequelize[_0x26ac('0x1')]},'destexten':{'type':Sequelize[_0x26ac('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x26ac('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x26ac('0x1')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x26ac('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x26ac('0x1')],'comment':_0x26ac('0x5')},'transferexten':{'type':Sequelize[_0x26ac('0x1')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x26ac('0x3')],'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 2622971..82fc912 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(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'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(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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 08dc445..b39a150 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 _0x919e=['VoiceAgentReport','report_agent','destuniqueid','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports'];(function(_0x382606,_0xba33c2){var _0x402a38=function(_0x3a0c49){while(--_0x3a0c49){_0x382606['push'](_0x382606['shift']());}};_0x402a38(++_0xba33c2);}(_0x919e,0x1d7));var _0xe919=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x919e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe919('0x0'));var util=require(_0xe919('0x1'));var logger=require(_0xe919('0x2'))('api');var moment=require(_0xe919('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe919('0x4'));var rimraf=require(_0xe919('0x5'));var config=require(_0xe919('0x6'));var attributes=require(_0xe919('0x7'));module[_0xe919('0x8')]=function(_0x5a27ad,_0x1225a5){return _0x5a27ad['define'](_0xe919('0x9'),attributes,{'tableName':_0xe919('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0xe919('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x304b=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','util'];(function(_0x3c7183,_0x143d94){var _0x244146=function(_0x4d6857){while(--_0x4d6857){_0x3c7183['push'](_0x3c7183['shift']());}};_0x244146(++_0x143d94);}(_0x304b,0xfb));var _0xb304=function(_0x2452e7,_0x14ba7c){_0x2452e7=_0x2452e7-0x0;var _0x6181c3=_0x304b[_0x2452e7];return _0x6181c3;};'use strict';var _=require('lodash');var util=require(_0xb304('0x0'));var logger=require(_0xb304('0x1'))(_0xb304('0x2'));var moment=require(_0xb304('0x3'));var BPromise=require(_0xb304('0x4'));var rp=require(_0xb304('0x5'));var fs=require('fs');var path=require(_0xb304('0x6'));var rimraf=require(_0xb304('0x7'));var config=require('../../config/environment');var attributes=require('./voiceAgentReport.attributes');module[_0xb304('0x8')]=function(_0x301a2e,_0x1eef78){return _0x301a2e[_0xb304('0x9')](_0xb304('0xa'),attributes,{'tableName':_0xb304('0xb'),'paranoid':![],'indexes':[{'fields':[_0xb304('0xc'),_0xb304('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 219d573..470b840 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 _0xdd8b=['request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceAgentReport,\x20%s,\x20%s','message','result','catch','VoiceAgentReport','create','body','options','raw','CreateVoiceAgentReport','update','where','attributes','UpdateVoiceAgentReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info'];(function(_0x1443eb,_0x203408){var _0x2b8810=function(_0x48bc4e){while(--_0x48bc4e){_0x1443eb['push'](_0x1443eb['shift']());}};_0x2b8810(++_0x203408);}(_0xdd8b,0x15e));var _0xbdd8=function(_0x15876a,_0x15383d){_0x15876a=_0x15876a-0x0;var _0xbd900f=_0xdd8b[_0x15876a];return _0xbd900f;};'use strict';var _=require(_0xbdd8('0x0'));var util=require(_0xbdd8('0x1'));var moment=require(_0xbdd8('0x2'));var BPromise=require('bluebird');var rs=require(_0xbdd8('0x3'));var fs=require('fs');var Redis=require(_0xbdd8('0x4'));var db=require(_0xbdd8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbdd8('0x6'))(_0xbdd8('0x7'));var config=require(_0xbdd8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbdd8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a853e,_0x2c2ce,_0x50e300){return new BPromise(function(_0x574253,_0x44ebb9){return client[_0xbdd8('0xa')](_0x4a853e,_0x50e300)[_0xbdd8('0xb')](function(_0xf8073e){logger[_0xbdd8('0xc')]('VoiceAgentReport,\x20%s,\x20%s',_0x2c2ce,_0xbdd8('0xd'));logger[_0xbdd8('0xe')](_0xbdd8('0xf'),_0x2c2ce,'request\x20sent',JSON[_0xbdd8('0x10')](_0xf8073e));if(_0xf8073e[_0xbdd8('0x11')]){if(_0xf8073e[_0xbdd8('0x11')][_0xbdd8('0x12')]===0x1f4){logger[_0xbdd8('0x11')](_0xbdd8('0x13'),_0x2c2ce,_0xf8073e['error'][_0xbdd8('0x14')]);return _0x44ebb9(_0xf8073e[_0xbdd8('0x11')][_0xbdd8('0x14')]);}logger['error'](_0xbdd8('0x13'),_0x2c2ce,_0xf8073e['error'][_0xbdd8('0x14')]);return _0x574253(_0xf8073e[_0xbdd8('0x11')][_0xbdd8('0x14')]);}else{logger[_0xbdd8('0xc')](_0xbdd8('0x13'),_0x2c2ce,_0xbdd8('0xd'));_0x574253(_0xf8073e[_0xbdd8('0x15')]['message']);}})[_0xbdd8('0x16')](function(_0x3bf885){logger[_0xbdd8('0x11')](_0xbdd8('0x13'),_0x2c2ce,_0x3bf885);_0x44ebb9(_0x3bf885);});});}exports['CreateVoiceAgentReport']=function(_0x53c9ac){var _0x1c1f1a=this;return new Promise(function(_0x3315ee,_0x114236){return db[_0xbdd8('0x17')][_0xbdd8('0x18')](_0x53c9ac[_0xbdd8('0x19')],{'raw':_0x53c9ac[_0xbdd8('0x1a')]?_0x53c9ac['options'][_0xbdd8('0x1b')]===undefined?!![]:![]:!![]})[_0xbdd8('0xb')](function(_0x2f62c7){logger['info'](_0xbdd8('0x1c'),_0x53c9ac);logger[_0xbdd8('0xe')](_0xbdd8('0x1c'),_0x53c9ac,JSON['stringify'](_0x2f62c7));_0x3315ee(_0x2f62c7);})[_0xbdd8('0x16')](function(_0x1b2f06){logger['error'](_0xbdd8('0x1c'),_0x1b2f06[_0xbdd8('0x14')],_0x53c9ac);_0x114236(_0x1c1f1a[_0xbdd8('0x11')](0x1f4,_0x1b2f06[_0xbdd8('0x14')]));});});};exports['UpdateVoiceAgentReport']=function(_0x36edeb){var _0x4cd15a=this;return new Promise(function(_0xe72c8e,_0x2a50b2){return db[_0xbdd8('0x17')][_0xbdd8('0x1d')](_0x36edeb[_0xbdd8('0x19')],{'raw':_0x36edeb['options']?_0x36edeb['options'][_0xbdd8('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36edeb[_0xbdd8('0x1a')]?_0x36edeb[_0xbdd8('0x1a')][_0xbdd8('0x1e')]||null:null,'attributes':_0x36edeb[_0xbdd8('0x1a')]?_0x36edeb[_0xbdd8('0x1a')][_0xbdd8('0x1f')]||null:null,'limit':_0x36edeb[_0xbdd8('0x1a')]?_0x36edeb[_0xbdd8('0x1a')]['limit']||null:null})['then'](function(_0x40a5ff){logger[_0xbdd8('0xc')]('UpdateVoiceAgentReport',_0x36edeb);logger[_0xbdd8('0xe')](_0xbdd8('0x20'),_0x36edeb,JSON[_0xbdd8('0x10')](_0x40a5ff));_0xe72c8e(_0x40a5ff);})[_0xbdd8('0x16')](function(_0x436fd1){logger['error'](_0xbdd8('0x20'),_0x436fd1[_0xbdd8('0x14')],_0x36edeb);_0x2a50b2(_0x4cd15a[_0xbdd8('0x11')](0x1f4,_0x436fd1[_0xbdd8('0x14')]));});});}; \ No newline at end of file +var _0x115c=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','update','where','limit','UpdateVoiceAgentReport','util','moment','bluebird'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x115c,0x1ec));var _0xc115=function(_0x4399ca,_0x53d282){_0x4399ca=_0x4399ca-0x0;var _0x1661f6=_0x115c[_0x4399ca];return _0x1661f6;};'use strict';var _=require('lodash');var util=require(_0xc115('0x0'));var moment=require(_0xc115('0x1'));var BPromise=require(_0xc115('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc115('0x3'));var db=require(_0xc115('0x4'))['db'];var utils=require(_0xc115('0x5'));var logger=require('../../config/logger')(_0xc115('0x6'));var config=require(_0xc115('0x7'));var jayson=require(_0xc115('0x8'));var client=jayson[_0xc115('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f73e5,_0x391fd7,_0x39a79b){return new BPromise(function(_0x4f309d,_0x48560a){return client[_0xc115('0xa')](_0x1f73e5,_0x39a79b)[_0xc115('0xb')](function(_0x4159f9){logger['info'](_0xc115('0xc'),_0x391fd7,_0xc115('0xd'));logger[_0xc115('0xe')](_0xc115('0xf'),_0x391fd7,_0xc115('0xd'),JSON[_0xc115('0x10')](_0x4159f9));if(_0x4159f9[_0xc115('0x11')]){if(_0x4159f9['error'][_0xc115('0x12')]===0x1f4){logger[_0xc115('0x11')](_0xc115('0xc'),_0x391fd7,_0x4159f9[_0xc115('0x11')][_0xc115('0x13')]);return _0x48560a(_0x4159f9[_0xc115('0x11')]['message']);}logger[_0xc115('0x11')](_0xc115('0xc'),_0x391fd7,_0x4159f9[_0xc115('0x11')][_0xc115('0x13')]);return _0x4f309d(_0x4159f9['error'][_0xc115('0x13')]);}else{logger[_0xc115('0x14')](_0xc115('0xc'),_0x391fd7,_0xc115('0xd'));_0x4f309d(_0x4159f9[_0xc115('0x15')][_0xc115('0x13')]);}})[_0xc115('0x16')](function(_0x18f11c){logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x391fd7,_0x18f11c);_0x48560a(_0x18f11c);});});}exports[_0xc115('0x17')]=function(_0x459102){var _0x540226=this;return new Promise(function(_0x598f69,_0x34a2b8){return db[_0xc115('0x18')][_0xc115('0x19')](_0x459102[_0xc115('0x1a')],{'raw':_0x459102[_0xc115('0x1b')]?_0x459102[_0xc115('0x1b')][_0xc115('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x510896){logger['info'](_0xc115('0x17'),_0x459102);logger[_0xc115('0xe')]('CreateVoiceAgentReport',_0x459102,JSON['stringify'](_0x510896));_0x598f69(_0x510896);})[_0xc115('0x16')](function(_0x400310){logger[_0xc115('0x11')]('CreateVoiceAgentReport',_0x400310[_0xc115('0x13')],_0x459102);_0x34a2b8(_0x540226[_0xc115('0x11')](0x1f4,_0x400310['message']));});});};exports['UpdateVoiceAgentReport']=function(_0xde4d30){var _0x62a8c3=this;return new Promise(function(_0xaf7d26,_0x4744d7){return db[_0xc115('0x18')][_0xc115('0x1d')](_0xde4d30[_0xc115('0x1a')],{'raw':_0xde4d30['options']?_0xde4d30['options'][_0xc115('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xde4d30[_0xc115('0x1b')]?_0xde4d30[_0xc115('0x1b')][_0xc115('0x1e')]||null:null,'attributes':_0xde4d30[_0xc115('0x1b')]?_0xde4d30[_0xc115('0x1b')]['attributes']||null:null,'limit':_0xde4d30[_0xc115('0x1b')]?_0xde4d30[_0xc115('0x1b')][_0xc115('0x1f')]||null:null})[_0xc115('0xb')](function(_0x478561){logger[_0xc115('0x14')]('UpdateVoiceAgentReport',_0xde4d30);logger[_0xc115('0xe')](_0xc115('0x20'),_0xde4d30,JSON[_0xc115('0x10')](_0x478561));_0xaf7d26(_0x478561);})[_0xc115('0x16')](function(_0x34d640){logger['error'](_0xc115('0x20'),_0x34d640[_0xc115('0x13')],_0xde4d30);_0x4744d7(_0x62a8c3['error'](0x1f4,_0x34d640[_0xc115('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 0b74c34..39af881 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 _0xb138=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','isAuthenticated','index','/describe','describe','/:id','create','put','delete','destroy','exports','multer','util','path'];(function(_0x525fcb,_0x42b731){var _0x48dc94=function(_0x35f753){while(--_0x35f753){_0x525fcb['push'](_0x525fcb['shift']());}};_0x48dc94(++_0x42b731);}(_0xb138,0x1dd));var _0x8b13=function(_0x5ae813,_0x3d1c6a){_0x5ae813=_0x5ae813-0x0;var _0x33c3ab=_0xb138[_0x5ae813];return _0x33c3ab;};'use strict';var multer=require(_0x8b13('0x0'));var util=require(_0x8b13('0x1'));var path=require(_0x8b13('0x2'));var timeout=require(_0x8b13('0x3'));var express=require(_0x8b13('0x4'));var router=express[_0x8b13('0x5')]();var fs_extra=require(_0x8b13('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8b13('0x7'));var config=require(_0x8b13('0x8'));var controller=require(_0x8b13('0x9'));router['get']('/',auth[_0x8b13('0xa')](),controller[_0x8b13('0xb')]);router['get'](_0x8b13('0xc'),auth[_0x8b13('0xa')](),controller[_0x8b13('0xd')]);router['get'](_0x8b13('0xe'),auth[_0x8b13('0xa')](),controller['show']);router['post']('/',auth[_0x8b13('0xa')](),controller[_0x8b13('0xf')]);router[_0x8b13('0x10')](_0x8b13('0xe'),auth[_0x8b13('0xa')](),controller['update']);router[_0x8b13('0x11')](_0x8b13('0xe'),auth[_0x8b13('0xa')](),controller[_0x8b13('0x12')]);module[_0x8b13('0x13')]=router; \ No newline at end of file +var _0xb458=['./voiceCallReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post','put','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xf15036,_0x52e137){var _0x2985dd=function(_0x2d2dca){while(--_0x2d2dca){_0xf15036['push'](_0xf15036['shift']());}};_0x2985dd(++_0x52e137);}(_0xb458,0x103));var _0x8b45=function(_0x3b5383,_0xccef3){_0x3b5383=_0x3b5383-0x0;var _0x3fc014=_0xb458[_0x3b5383];return _0x3fc014;};'use strict';var multer=require(_0x8b45('0x0'));var util=require(_0x8b45('0x1'));var path=require(_0x8b45('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8b45('0x3')]();var fs_extra=require(_0x8b45('0x4'));var auth=require(_0x8b45('0x5'));var interaction=require(_0x8b45('0x6'));var config=require('../../config/environment');var controller=require(_0x8b45('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x8b45('0x8')]);router[_0x8b45('0x9')](_0x8b45('0xa'),auth[_0x8b45('0xb')](),controller[_0x8b45('0xc')]);router['get'](_0x8b45('0xd'),auth[_0x8b45('0xb')](),controller[_0x8b45('0xe')]);router[_0x8b45('0xf')]('/',auth[_0x8b45('0xb')](),controller['create']);router[_0x8b45('0x10')](_0x8b45('0xd'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x8b45('0xb')](),controller[_0x8b45('0x11')]);module[_0x8b45('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 3ed7a47..a305b17 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 _0x489a=['DATE','INTEGER','sequelize','exports','STRING','inbound','internal','outbound','inbound-fax','outbound-fax'];(function(_0x100194,_0x3f0a2c){var _0x3e4536=function(_0x12c0a8){while(--_0x12c0a8){_0x100194['push'](_0x100194['shift']());}};_0x3e4536(++_0x3f0a2c);}(_0x489a,0x1c4));var _0xa489=function(_0x7303c,_0x2d7803){_0x7303c=_0x7303c-0x0;var _0x367cc7=_0x489a[_0x7303c];return _0x367cc7;};'use strict';var Sequelize=require(_0xa489('0x0'));module[_0xa489('0x1')]={'uniqueid':{'type':Sequelize[_0xa489('0x2')]},'type':{'type':Sequelize['ENUM'](_0xa489('0x3'),_0xa489('0x4'),_0xa489('0x5'),_0xa489('0x6'),_0xa489('0x7'),'dialer')},'tag':{'type':Sequelize[_0xa489('0x2')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0xa489('0x2')]},'destinationcontext':{'type':Sequelize[_0xa489('0x2')]},'callerid':{'type':Sequelize[_0xa489('0x2')]},'channel':{'type':Sequelize[_0xa489('0x2')]},'destinationchannel':{'type':Sequelize[_0xa489('0x2')]},'lastapplication':{'type':Sequelize[_0xa489('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0xa489('0x8')]},'systemanswertime':{'type':Sequelize[_0xa489('0x8')]},'answertime':{'type':Sequelize[_0xa489('0x8')]},'endtime':{'type':Sequelize[_0xa489('0x8')]},'duration':{'type':Sequelize[_0xa489('0x9')]},'billableseconds':{'type':Sequelize[_0xa489('0x9')]},'mohtime':{'type':Sequelize[_0xa489('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xa489('0x2')]},'amaflags':{'type':Sequelize[_0xa489('0x2')]},'userfield':{'type':Sequelize[_0xa489('0x2')]},'userDisposition':{'type':Sequelize[_0xa489('0x2')]},'userSecondDisposition':{'type':Sequelize[_0xa489('0x2')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xa489('0x2')]},'prefix':{'type':Sequelize[_0xa489('0x2')]},'routeid':{'type':Sequelize[_0xa489('0x9')]},'sipcallid':{'type':Sequelize[_0xa489('0x2')]}}; \ No newline at end of file +var _0x4892=['exports','ENUM','outbound','inbound-fax','outbound-fax','dialer','STRING','TEXT','DATE','INTEGER','sequelize'];(function(_0x18f7e0,_0x40d5e3){var _0x3ceeae=function(_0x300935){while(--_0x300935){_0x18f7e0['push'](_0x18f7e0['shift']());}};_0x3ceeae(++_0x40d5e3);}(_0x4892,0x1ee));var _0x2489=function(_0x381101,_0x5f2efb){_0x381101=_0x381101-0x0;var _0x10e22e=_0x4892[_0x381101];return _0x10e22e;};'use strict';var Sequelize=require(_0x2489('0x0'));module[_0x2489('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x2489('0x2')]('inbound','internal',_0x2489('0x3'),_0x2489('0x4'),_0x2489('0x5'),_0x2489('0x6'))},'tag':{'type':Sequelize[_0x2489('0x7')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0x2489('0x7')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0x2489('0x7')]},'callerid':{'type':Sequelize[_0x2489('0x7')]},'channel':{'type':Sequelize[_0x2489('0x7')]},'destinationchannel':{'type':Sequelize[_0x2489('0x7')]},'lastapplication':{'type':Sequelize[_0x2489('0x7')]},'lastdata':{'type':Sequelize[_0x2489('0x8')]},'starttime':{'type':Sequelize[_0x2489('0x9')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x2489('0x9')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0x2489('0xa')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x2489('0x7')]},'amaflags':{'type':Sequelize[_0x2489('0x7')]},'userfield':{'type':Sequelize[_0x2489('0x7')]},'userDisposition':{'type':Sequelize[_0x2489('0x7')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x2489('0x7')]},'prefix':{'type':Sequelize[_0x2489('0x7')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0x2489('0x7')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 5e379ee..690b5cb 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 _0x2ef3=['pick','filter','merge','options','VoiceCallReport','then','includeAll','include','fullname','alias','User','findAll','rows','catch','show','params','keys','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0x2ef3,0xba));var _0x32ef=function(_0x5019d9,_0x17a52b){_0x5019d9=_0x5019d9-0x0;var _0x4ebe12=_0x2ef3[_0x5019d9];return _0x4ebe12;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['VoiceCallReport'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'attributes':['id',_0x32ef('0x27'),_0x32ef('0x41'),_0x32ef('0x42')],'model':db[_0x32ef('0x43')],'as':'User'}];}return db['VoiceCallReport'][_0x32ef('0x44')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x2a33dd){_0x3c569d[_0x32ef('0x45')]=_0x2a33dd;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x46')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x47')]=function(_0x5d2f06,_0x4744ba){var _0x4bc5bc={'raw':!![],'where':{'id':_0x5d2f06[_0x32ef('0x48')]['id']}},_0xcb3c08={};_0xcb3c08[_0x32ef('0x2e')]=_[_0x32ef('0x49')](db[_0x32ef('0x3d')][_0x32ef('0x2a')]);_0xcb3c08[_0x32ef('0x2f')]=_[_0x32ef('0x49')](_0x5d2f06[_0x32ef('0x2f')]);_0xcb3c08[_0x32ef('0x30')]=_['intersection'](_0xcb3c08[_0x32ef('0x2e')],_0xcb3c08['query']);_0x4bc5bc[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0xcb3c08[_0x32ef('0x2e')],qs['fields'](_0x5d2f06[_0x32ef('0x2f')][_0x32ef('0x33')]));_0x4bc5bc[_0x32ef('0x31')]=_0x4bc5bc[_0x32ef('0x31')][_0x32ef('0x34')]?_0x4bc5bc[_0x32ef('0x31')]:_0xcb3c08[_0x32ef('0x2e')];if(_0x5d2f06['query']['includeAll']){_0x4bc5bc[_0x32ef('0x40')]=[{'all':!![]}];}_0x4bc5bc=_[_0x32ef('0x3b')]({},_0x4bc5bc,_0x5d2f06[_0x32ef('0x3c')]);return db[_0x32ef('0x3d')][_0x32ef('0x4a')](_0x4bc5bc)[_0x32ef('0x3e')](handleEntityNotFound(_0x4744ba,null))[_0x32ef('0x3e')](respondWithResult(_0x4744ba,null))[_0x32ef('0x46')](handleError(_0x4744ba,null));};exports[_0x32ef('0x4b')]=function(_0x1ebedf,_0x35a294){return db[_0x32ef('0x3d')][_0x32ef('0x4b')](_0x1ebedf['body'],{})[_0x32ef('0x3e')](respondWithResult(_0x35a294,0xc9))[_0x32ef('0x46')](handleError(_0x35a294,null));};exports[_0x32ef('0x4c')]=function(_0xd42609,_0x1cc9f3){return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'id':_0xd42609[_0x32ef('0x48')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x1cc9f3,null))[_0x32ef('0x3e')](removeEntity(_0x1cc9f3,null))[_0x32ef('0x46')](handleError(_0x1cc9f3,null));};exports[_0x32ef('0x4d')]=function(_0x272377,_0x326445){return db[_0x32ef('0x3d')][_0x32ef('0x4d')]()[_0x32ef('0x3e')](respondWithResult(_0x326445,null))[_0x32ef('0x46')](handleError(_0x326445,null));};exports['update']=function(_0x515ac9,_0x179c2f){if(_0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')]){delete _0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')];}return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'uniqueid':_0x515ac9[_0x32ef('0x48')]['id'],'UserId':{'$or':[null,_0x515ac9[_0x32ef('0x50')]['id']]}}})[_0x32ef('0x3e')](handleEntityNotFound(_0x179c2f,null))[_0x32ef('0x3e')](saveUpdates(_0x515ac9['body'],null))[_0x32ef('0x3e')](respondWithResult(_0x179c2f,null))[_0x32ef('0x46')](handleError(_0x179c2f,null));}; \ No newline at end of file +var _0x2032=['../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','alias','User','rows','catch','show','params','keys','rawAttributes','includeAll','include','create','body','find','describe','uniqueid','user','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2032,0xd9));var _0x2203=function(_0x4e024f,_0x5654c6){_0x4e024f=_0x4e024f-0x0;var _0x25acfd=_0x2032[_0x4e024f];return _0x25acfd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'attributes':['id',_0x2203('0x28'),'fullname',_0x2203('0x3f')],'model':db[_0x2203('0x40')],'as':_0x2203('0x40')}];}return db['VoiceCallReport']['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x3739f6){_0x34b8ba[_0x2203('0x41')]=_0x3739f6;return _0x34b8ba;})[_0x2203('0x23')](respondWithFilteredResult(_0x1df508,_0x9c53f))[_0x2203('0x42')](handleError(_0x1df508,null));};exports[_0x2203('0x43')]=function(_0x5cd573,_0x15d3b6){var _0x165a3f={'raw':!![],'where':{'id':_0x5cd573[_0x2203('0x44')]['id']}},_0x3a866c={};_0x3a866c[_0x2203('0x31')]=_[_0x2203('0x45')](db[_0x2203('0x2c')][_0x2203('0x46')]);_0x3a866c[_0x2203('0x30')]=_[_0x2203('0x45')](_0x5cd573['query']);_0x3a866c[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x3a866c[_0x2203('0x31')],_0x3a866c[_0x2203('0x30')]);_0x165a3f['attributes']=_['intersection'](_0x3a866c[_0x2203('0x31')],qs['fields'](_0x5cd573[_0x2203('0x30')][_0x2203('0x34')]));_0x165a3f[_0x2203('0x32')]=_0x165a3f[_0x2203('0x32')]['length']?_0x165a3f[_0x2203('0x32')]:_0x3a866c[_0x2203('0x31')];if(_0x5cd573['query'][_0x2203('0x47')]){_0x165a3f[_0x2203('0x48')]=[{'all':!![]}];}_0x165a3f=_[_0x2203('0x3c')]({},_0x165a3f,_0x5cd573[_0x2203('0x3e')]);return db['VoiceCallReport']['find'](_0x165a3f)[_0x2203('0x23')](handleEntityNotFound(_0x15d3b6,null))['then'](respondWithResult(_0x15d3b6,null))['catch'](handleError(_0x15d3b6,null));};exports[_0x2203('0x49')]=function(_0x33b7b5,_0x1a2665){return db['VoiceCallReport']['create'](_0x33b7b5[_0x2203('0x4a')],{})[_0x2203('0x23')](respondWithResult(_0x1a2665,0xc9))[_0x2203('0x42')](handleError(_0x1a2665,null));};exports[_0x2203('0x24')]=function(_0x225b0e,_0x21fd78){return db['VoiceCallReport'][_0x2203('0x4b')]({'where':{'id':_0x225b0e['params']['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x21fd78,null))[_0x2203('0x23')](removeEntity(_0x21fd78,null))[_0x2203('0x42')](handleError(_0x21fd78,null));};exports[_0x2203('0x4c')]=function(_0x58b9bb,_0x506795){return db[_0x2203('0x2c')][_0x2203('0x4c')]()[_0x2203('0x23')](respondWithResult(_0x506795,null))[_0x2203('0x42')](handleError(_0x506795,null));};exports['update']=function(_0x4de47a,_0x49999a){if(_0x4de47a[_0x2203('0x4a')][_0x2203('0x4d')]){delete _0x4de47a['body'][_0x2203('0x4d')];}return db[_0x2203('0x2c')]['find']({'where':{'uniqueid':_0x4de47a[_0x2203('0x44')]['id'],'UserId':{'$or':[null,_0x4de47a[_0x2203('0x4e')]['id']]}}})[_0x2203('0x23')](handleEntityNotFound(_0x49999a,null))[_0x2203('0x23')](saveUpdates(_0x4de47a['body'],null))[_0x2203('0x23')](respondWithResult(_0x49999a,null))['catch'](handleError(_0x49999a,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index dc3afb6..7586406 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 _0xb812=['request-promise','path','./voiceCallReport.attributes','define','uniqueid','util','../../config/logger','api','moment','bluebird'];(function(_0x187953,_0x2685a2){var _0x68dc08=function(_0x25ad11){while(--_0x25ad11){_0x187953['push'](_0x187953['shift']());}};_0x68dc08(++_0x2685a2);}(_0xb812,0xf5));var _0x2b81=function(_0x993dbb,_0x40eb0c){_0x993dbb=_0x993dbb-0x0;var _0x4eb256=_0xb812[_0x993dbb];return _0x4eb256;};'use strict';var _=require('lodash');var util=require(_0x2b81('0x0'));var logger=require(_0x2b81('0x1'))(_0x2b81('0x2'));var moment=require(_0x2b81('0x3'));var BPromise=require(_0x2b81('0x4'));var rp=require(_0x2b81('0x5'));var fs=require('fs');var path=require(_0x2b81('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2b81('0x7'));module['exports']=function(_0x2a136e,_0x1d5864){return _0x2a136e[_0x2b81('0x8')]('VoiceCallReport',attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0x2b81('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x332a=['report_call','uniqueid','util','api','bluebird','request-promise','path','../../config/environment','./voiceCallReport.attributes','exports','VoiceCallReport'];(function(_0x18afca,_0x4219d9){var _0x11603f=function(_0x21d5d1){while(--_0x21d5d1){_0x18afca['push'](_0x18afca['shift']());}};_0x11603f(++_0x4219d9);}(_0x332a,0x199));var _0xa332=function(_0x2151c7,_0x13f5fb){_0x2151c7=_0x2151c7-0x0;var _0x1154ac=_0x332a[_0x2151c7];return _0x1154ac;};'use strict';var _=require('lodash');var util=require(_0xa332('0x0'));var logger=require('../../config/logger')(_0xa332('0x1'));var moment=require('moment');var BPromise=require(_0xa332('0x2'));var rp=require(_0xa332('0x3'));var fs=require('fs');var path=require(_0xa332('0x4'));var rimraf=require('rimraf');var config=require(_0xa332('0x5'));var attributes=require(_0xa332('0x6'));module[_0xa332('0x7')]=function(_0x5bd4e8,_0x2f6487){return _0x5bd4e8['define'](_0xa332('0x8'),attributes,{'tableName':_0xa332('0x9'),'paranoid':![],'indexes':[{'fields':[_0xa332('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index e82606a..62cd452 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 _0x69b2=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','VoiceCallReport,\x20%s,\x20%s','message','result','catch','GetVoiceCallReport','options','where','attributes','include','map','model','CreateVoiceCallReport','VoiceCallReport','create','body','raw','UpdateVoiceCallReport','update','limit','util','moment','bluebird','randomstring','ioredis'];(function(_0xa31a48,_0xd2b021){var _0x17e75f=function(_0x388f41){while(--_0x388f41){_0xa31a48['push'](_0xa31a48['shift']());}};_0x17e75f(++_0xd2b021);}(_0x69b2,0x151));var _0x269b=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x69b2[_0x3635ce];return _0x97ecd0;};'use strict';var _=require('lodash');var util=require(_0x269b('0x0'));var moment=require(_0x269b('0x1'));var BPromise=require(_0x269b('0x2'));var rs=require(_0x269b('0x3'));var fs=require('fs');var Redis=require(_0x269b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x269b('0x5'));var logger=require(_0x269b('0x6'))(_0x269b('0x7'));var config=require(_0x269b('0x8'));var jayson=require(_0x269b('0x9'));var client=jayson['client'][_0x269b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54bd97,_0x55c827,_0x3041ac){return new BPromise(function(_0x1754c1,_0x118ca3){return client[_0x269b('0xb')](_0x54bd97,_0x3041ac)[_0x269b('0xc')](function(_0xbaf2fa){logger[_0x269b('0xd')]('VoiceCallReport,\x20%s,\x20%s',_0x55c827,_0x269b('0xe'));logger[_0x269b('0xf')](_0x269b('0x10'),_0x55c827,_0x269b('0xe'),JSON[_0x269b('0x11')](_0xbaf2fa));if(_0xbaf2fa['error']){if(_0xbaf2fa[_0x269b('0x12')]['code']===0x1f4){logger[_0x269b('0x12')](_0x269b('0x13'),_0x55c827,_0xbaf2fa[_0x269b('0x12')][_0x269b('0x14')]);return _0x118ca3(_0xbaf2fa[_0x269b('0x12')]['message']);}logger[_0x269b('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x55c827,_0xbaf2fa['error']['message']);return _0x1754c1(_0xbaf2fa[_0x269b('0x12')]['message']);}else{logger['info'](_0x269b('0x13'),_0x55c827,_0x269b('0xe'));_0x1754c1(_0xbaf2fa[_0x269b('0x15')][_0x269b('0x14')]);}})[_0x269b('0x16')](function(_0x5b6a32){logger[_0x269b('0x12')](_0x269b('0x13'),_0x55c827,_0x5b6a32);_0x118ca3(_0x5b6a32);});});}exports[_0x269b('0x17')]=function(_0x4ec186){var _0x437e2f=this;return new Promise(function(_0x4c3969,_0x1b48a7){return db['VoiceCallReport']['findAll']({'raw':_0x4ec186[_0x269b('0x18')]?_0x4ec186[_0x269b('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4ec186[_0x269b('0x18')]?_0x4ec186[_0x269b('0x18')][_0x269b('0x19')]||null:null,'attributes':_0x4ec186[_0x269b('0x18')]?_0x4ec186[_0x269b('0x18')][_0x269b('0x1a')]||null:null,'limit':_0x4ec186['options']?_0x4ec186['options']['limit']||null:null,'include':_0x4ec186[_0x269b('0x18')]?_0x4ec186[_0x269b('0x18')][_0x269b('0x1b')]?_[_0x269b('0x1c')](_0x4ec186[_0x269b('0x18')][_0x269b('0x1b')],function(_0x31d958){return{'model':db[_0x31d958[_0x269b('0x1d')]],'as':_0x31d958['as'],'attributes':_0x31d958[_0x269b('0x1a')],'include':_0x31d958['include']?_[_0x269b('0x1c')](_0x31d958['include'],function(_0x4e8387){return{'model':db[_0x4e8387[_0x269b('0x1d')]],'as':_0x4e8387['as'],'attributes':_0x4e8387[_0x269b('0x1a')],'include':_0x4e8387['include']?_[_0x269b('0x1c')](_0x4e8387['include'],function(_0x135384){return{'model':db[_0x135384[_0x269b('0x1d')]],'as':_0x135384['as'],'attributes':_0x135384['attributes']};}):[]};}):[]};}):[]:[]})[_0x269b('0xc')](function(_0x4e0f25){logger[_0x269b('0xd')](_0x269b('0x17'),_0x4ec186);logger[_0x269b('0xf')](_0x269b('0x17'),_0x4ec186,JSON[_0x269b('0x11')](_0x4e0f25));_0x4c3969(_0x4e0f25);})['catch'](function(_0x54e4bd){logger[_0x269b('0x12')](_0x269b('0x17'),_0x54e4bd[_0x269b('0x14')],_0x4ec186);_0x1b48a7(_0x437e2f[_0x269b('0x12')](0x1f4,_0x54e4bd[_0x269b('0x14')]));});});};exports[_0x269b('0x1e')]=function(_0x1c435f){var _0x4b45d0=this;return new Promise(function(_0x1d672a,_0x1d8b09){return db[_0x269b('0x1f')][_0x269b('0x20')](_0x1c435f[_0x269b('0x21')],{'raw':_0x1c435f[_0x269b('0x18')]?_0x1c435f[_0x269b('0x18')][_0x269b('0x22')]===undefined?!![]:![]:!![]})[_0x269b('0xc')](function(_0x2015d0){logger['info']('CreateVoiceCallReport',_0x1c435f);logger['debug'](_0x269b('0x1e'),_0x1c435f,JSON[_0x269b('0x11')](_0x2015d0));_0x1d672a(_0x2015d0);})[_0x269b('0x16')](function(_0x54dd3e){logger['error'](_0x269b('0x1e'),_0x54dd3e[_0x269b('0x14')],_0x1c435f);_0x1d8b09(_0x4b45d0[_0x269b('0x12')](0x1f4,_0x54dd3e[_0x269b('0x14')]));});});};exports[_0x269b('0x23')]=function(_0x4a5788){var _0x3c62a4=this;return new Promise(function(_0x43d49f,_0xffa1dc){return db['VoiceCallReport'][_0x269b('0x24')](_0x4a5788[_0x269b('0x21')],{'raw':_0x4a5788[_0x269b('0x18')]?_0x4a5788[_0x269b('0x18')][_0x269b('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a5788[_0x269b('0x18')]?_0x4a5788[_0x269b('0x18')][_0x269b('0x19')]||null:null,'attributes':_0x4a5788[_0x269b('0x18')]?_0x4a5788['options'][_0x269b('0x1a')]||null:null,'limit':_0x4a5788[_0x269b('0x18')]?_0x4a5788[_0x269b('0x18')][_0x269b('0x25')]||null:null})[_0x269b('0xc')](function(_0x28a305){logger[_0x269b('0xd')](_0x269b('0x23'),_0x4a5788);logger['debug'](_0x269b('0x23'),_0x4a5788,JSON[_0x269b('0x11')](_0x28a305));_0x43d49f(_0x28a305);})['catch'](function(_0x163b27){logger['error'](_0x269b('0x23'),_0x163b27[_0x269b('0x14')],_0x4a5788);_0xffa1dc(_0x3c62a4['error'](0x1f4,_0x163b27[_0x269b('0x14')]));});});}; \ No newline at end of file +var _0x7269=['model','GetVoiceCallReport','stringify','CreateVoiceCallReport','body','UpdateVoiceCallReport','update','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','catch','VoiceCallReport','findAll','raw','options','where','attributes','limit','include','map'];(function(_0x5c69d4,_0x2dc7f7){var _0x4fe92e=function(_0x4674d3){while(--_0x4674d3){_0x5c69d4['push'](_0x5c69d4['shift']());}};_0x4fe92e(++_0x2dc7f7);}(_0x7269,0x12f));var _0x9726=function(_0x8176cf,_0x33513c){_0x8176cf=_0x8176cf-0x0;var _0x1b4a96=_0x7269[_0x8176cf];return _0x1b4a96;};'use strict';var _=require(_0x9726('0x0'));var util=require(_0x9726('0x1'));var moment=require(_0x9726('0x2'));var BPromise=require(_0x9726('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9726('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9726('0x5'))(_0x9726('0x6'));var config=require(_0x9726('0x7'));var jayson=require(_0x9726('0x8'));var client=jayson[_0x9726('0x9')][_0x9726('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x208c46,_0x37c45b,_0x26a050){return new BPromise(function(_0x139725,_0x872dc1){return client[_0x9726('0xb')](_0x208c46,_0x26a050)[_0x9726('0xc')](function(_0x16eba2){logger['info'](_0x9726('0xd'),_0x37c45b,_0x9726('0xe'));logger[_0x9726('0xf')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x37c45b,_0x9726('0xe'),JSON['stringify'](_0x16eba2));if(_0x16eba2['error']){if(_0x16eba2[_0x9726('0x10')]['code']===0x1f4){logger[_0x9726('0x10')]('VoiceCallReport,\x20%s,\x20%s',_0x37c45b,_0x16eba2[_0x9726('0x10')][_0x9726('0x11')]);return _0x872dc1(_0x16eba2['error'][_0x9726('0x11')]);}logger[_0x9726('0x10')](_0x9726('0xd'),_0x37c45b,_0x16eba2[_0x9726('0x10')][_0x9726('0x11')]);return _0x139725(_0x16eba2[_0x9726('0x10')][_0x9726('0x11')]);}else{logger[_0x9726('0x12')](_0x9726('0xd'),_0x37c45b,_0x9726('0xe'));_0x139725(_0x16eba2[_0x9726('0x13')]['message']);}})[_0x9726('0x14')](function(_0x453599){logger['error'](_0x9726('0xd'),_0x37c45b,_0x453599);_0x872dc1(_0x453599);});});}exports['GetVoiceCallReport']=function(_0xb8dc08){var _0x3333d5=this;return new Promise(function(_0x38acc3,_0xefce2f){return db[_0x9726('0x15')][_0x9726('0x16')]({'raw':_0xb8dc08['options']?_0xb8dc08['options'][_0x9726('0x17')]===undefined?!![]:![]:!![],'where':_0xb8dc08[_0x9726('0x18')]?_0xb8dc08[_0x9726('0x18')][_0x9726('0x19')]||null:null,'attributes':_0xb8dc08[_0x9726('0x18')]?_0xb8dc08[_0x9726('0x18')][_0x9726('0x1a')]||null:null,'limit':_0xb8dc08[_0x9726('0x18')]?_0xb8dc08[_0x9726('0x18')][_0x9726('0x1b')]||null:null,'include':_0xb8dc08[_0x9726('0x18')]?_0xb8dc08[_0x9726('0x18')][_0x9726('0x1c')]?_[_0x9726('0x1d')](_0xb8dc08[_0x9726('0x18')][_0x9726('0x1c')],function(_0x16600e){return{'model':db[_0x16600e['model']],'as':_0x16600e['as'],'attributes':_0x16600e[_0x9726('0x1a')],'include':_0x16600e[_0x9726('0x1c')]?_[_0x9726('0x1d')](_0x16600e[_0x9726('0x1c')],function(_0x44d2d3){return{'model':db[_0x44d2d3[_0x9726('0x1e')]],'as':_0x44d2d3['as'],'attributes':_0x44d2d3['attributes'],'include':_0x44d2d3[_0x9726('0x1c')]?_[_0x9726('0x1d')](_0x44d2d3[_0x9726('0x1c')],function(_0x4c1716){return{'model':db[_0x4c1716['model']],'as':_0x4c1716['as'],'attributes':_0x4c1716[_0x9726('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x9726('0xc')](function(_0x5a9596){logger[_0x9726('0x12')](_0x9726('0x1f'),_0xb8dc08);logger[_0x9726('0xf')]('GetVoiceCallReport',_0xb8dc08,JSON[_0x9726('0x20')](_0x5a9596));_0x38acc3(_0x5a9596);})[_0x9726('0x14')](function(_0xcda9ea){logger[_0x9726('0x10')](_0x9726('0x1f'),_0xcda9ea[_0x9726('0x11')],_0xb8dc08);_0xefce2f(_0x3333d5[_0x9726('0x10')](0x1f4,_0xcda9ea[_0x9726('0x11')]));});});};exports[_0x9726('0x21')]=function(_0x4af457){var _0x183efd=this;return new Promise(function(_0x1393c2,_0x4aa386){return db[_0x9726('0x15')]['create'](_0x4af457[_0x9726('0x22')],{'raw':_0x4af457[_0x9726('0x18')]?_0x4af457['options'][_0x9726('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x164497){logger['info'](_0x9726('0x21'),_0x4af457);logger['debug']('CreateVoiceCallReport',_0x4af457,JSON[_0x9726('0x20')](_0x164497));_0x1393c2(_0x164497);})['catch'](function(_0x1c3d51){logger[_0x9726('0x10')](_0x9726('0x21'),_0x1c3d51[_0x9726('0x11')],_0x4af457);_0x4aa386(_0x183efd[_0x9726('0x10')](0x1f4,_0x1c3d51[_0x9726('0x11')]));});});};exports[_0x9726('0x23')]=function(_0x13eec7){var _0x5589dc=this;return new Promise(function(_0x495e9e,_0x3c534){return db[_0x9726('0x15')][_0x9726('0x24')](_0x13eec7['body'],{'raw':_0x13eec7[_0x9726('0x18')]?_0x13eec7[_0x9726('0x18')][_0x9726('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x13eec7[_0x9726('0x18')]?_0x13eec7['options'][_0x9726('0x19')]||null:null,'attributes':_0x13eec7['options']?_0x13eec7['options'][_0x9726('0x1a')]||null:null,'limit':_0x13eec7[_0x9726('0x18')]?_0x13eec7[_0x9726('0x18')][_0x9726('0x1b')]||null:null})['then'](function(_0x4fc5c7){logger['info'](_0x9726('0x23'),_0x13eec7);logger[_0x9726('0xf')](_0x9726('0x23'),_0x13eec7,JSON[_0x9726('0x20')](_0x4fc5c7));_0x495e9e(_0x4fc5c7);})['catch'](function(_0x19e5fd){logger['error'](_0x9726('0x23'),_0x19e5fd[_0x9726('0x11')],_0x13eec7);_0x3c534(_0x5589dc[_0x9726('0x10')](0x1f4,_0x19e5fd['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 983b32b..ac0a499 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 _0xbeba=['show','post','create','put','update','destroy','exports','multer','express','fs-extra','./voiceChanSpy.controller','isAuthenticated','index','/:id'];(function(_0x42d7ec,_0x402a64){var _0x54399d=function(_0x51c311){while(--_0x51c311){_0x42d7ec['push'](_0x42d7ec['shift']());}};_0x54399d(++_0x402a64);}(_0xbeba,0x173));var _0xabeb=function(_0x251eb2,_0x4a2839){_0x251eb2=_0x251eb2-0x0;var _0xc59a6a=_0xbeba[_0x251eb2];return _0xc59a6a;};'use strict';var multer=require(_0xabeb('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xabeb('0x1'));var router=express['Router']();var fs_extra=require(_0xabeb('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xabeb('0x3'));router['get']('/',auth[_0xabeb('0x4')](),controller[_0xabeb('0x5')]);router['get'](_0xabeb('0x6'),auth[_0xabeb('0x4')](),controller[_0xabeb('0x7')]);router[_0xabeb('0x8')]('/',auth[_0xabeb('0x4')](),controller[_0xabeb('0x9')]);router[_0xabeb('0xa')](_0xabeb('0x6'),auth[_0xabeb('0x4')](),controller[_0xabeb('0xb')]);router['delete']('/:id',auth[_0xabeb('0x4')](),controller[_0xabeb('0xc')]);module[_0xabeb('0xd')]=router; \ No newline at end of file +var _0xbdc2=['isAuthenticated','index','/:id','show','post','create','put','update','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceChanSpy.controller','get'];(function(_0x13bc9b,_0x2313f7){var _0x11fd5e=function(_0x4e20ed){while(--_0x4e20ed){_0x13bc9b['push'](_0x13bc9b['shift']());}};_0x11fd5e(++_0x2313f7);}(_0xbdc2,0x1e4));var _0x2bdc=function(_0x406c07,_0x188e1b){_0x406c07=_0x406c07-0x0;var _0x38722c=_0xbdc2[_0x406c07];return _0x38722c;};'use strict';var multer=require(_0x2bdc('0x0'));var util=require(_0x2bdc('0x1'));var path=require(_0x2bdc('0x2'));var timeout=require(_0x2bdc('0x3'));var express=require(_0x2bdc('0x4'));var router=express['Router']();var fs_extra=require(_0x2bdc('0x5'));var auth=require(_0x2bdc('0x6'));var interaction=require(_0x2bdc('0x7'));var config=require('../../config/environment');var controller=require(_0x2bdc('0x8'));router[_0x2bdc('0x9')]('/',auth[_0x2bdc('0xa')](),controller[_0x2bdc('0xb')]);router[_0x2bdc('0x9')](_0x2bdc('0xc'),auth[_0x2bdc('0xa')](),controller[_0x2bdc('0xd')]);router[_0x2bdc('0xe')]('/',auth['isAuthenticated'](),controller[_0x2bdc('0xf')]);router[_0x2bdc('0x10')](_0x2bdc('0xc'),auth['isAuthenticated'](),controller[_0x2bdc('0x11')]);router['delete'](_0x2bdc('0xc'),auth[_0x2bdc('0xa')](),controller['destroy']);module[_0x2bdc('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index a1094c1..0bbcd13 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 _0x2bf3=['join','getDataValue','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue','options'];(function(_0xe84805,_0x2702d9){var _0x398efd=function(_0x37cfad){while(--_0x37cfad){_0xe84805['push'](_0xe84805['shift']());}};_0x398efd(++_0x2702d9);}(_0x2bf3,0x130));var _0x32bf=function(_0x2ae04f,_0x56a7cc){_0x2ae04f=_0x2ae04f-0x0;var _0x56485f=_0x2bf3[_0x2ae04f];return _0x56485f;};'use strict';var Sequelize=require(_0x32bf('0x0'));module[_0x32bf('0x1')]={'name':{'type':Sequelize[_0x32bf('0x2')]},'prefix':{'type':Sequelize[_0x32bf('0x2')],'unique':_0x32bf('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x32bf('0x2')],'set':function(_0x5e787e){this[_0x32bf('0x4')](_0x32bf('0x5'),_0x5e787e?_0x5e787e[_0x32bf('0x6')](''):[]);},'get':function(){return this[_0x32bf('0x7')]('options')?this[_0x32bf('0x7')](_0x32bf('0x5'))[_0x32bf('0x8')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0x32bf('0x2')]},'record':{'type':Sequelize[_0x32bf('0x9')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x32bf('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1fe7=['name','setDataValue','options','join','getDataValue','split','BOOLEAN','sequelize','STRING'];(function(_0x62ad32,_0x10cdd9){var _0x46d4a3=function(_0x4fa08e){while(--_0x4fa08e){_0x62ad32['push'](_0x62ad32['shift']());}};_0x46d4a3(++_0x10cdd9);}(_0x1fe7,0xb2));var _0x71fe=function(_0x25ce8f,_0x45588c){_0x25ce8f=_0x25ce8f-0x0;var _0x5e03f4=_0x1fe7[_0x25ce8f];return _0x5e03f4;};'use strict';var Sequelize=require(_0x71fe('0x0'));module['exports']={'name':{'type':Sequelize[_0x71fe('0x1')]},'prefix':{'type':Sequelize[_0x71fe('0x1')],'unique':_0x71fe('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x71fe('0x1')],'set':function(_0xcd769){this[_0x71fe('0x3')](_0x71fe('0x4'),_0xcd769?_0xcd769[_0x71fe('0x5')](''):[]);},'get':function(){return this[_0x71fe('0x6')](_0x71fe('0x4'))?this['getDataValue'](_0x71fe('0x4'))[_0x71fe('0x7')](''):[];}},'auth':{'type':Sequelize[_0x71fe('0x8')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x71fe('0x1')]},'description':{'type':Sequelize[_0x71fe('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 4bdd4d1..5c640da 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 _0xffaa=['set','Content-Range','reject','save','then','destroy','get','ChanSpies','UserProfileResource','end','sendStatus','error','stack','send','map','VoiceChanSpy','rawAttributes','fieldName','type','key','model','name','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','fields','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','status','json','offset','undefined','count'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xffaa,0x130));var _0xaffa=function(_0x90747f,_0xf7657e){_0x90747f=_0x90747f-0x0;var _0x135cde=_0xffaa[_0x90747f];return _0x135cde;};'use strict';var emlformat=require(_0xaffa('0x0'));var rimraf=require(_0xaffa('0x1'));var zipdir=require(_0xaffa('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xaffa('0x3'));var BPromise=require(_0xaffa('0x4'));var Mustache=require(_0xaffa('0x5'));var util=require(_0xaffa('0x6'));var path=require(_0xaffa('0x7'));var sox=require(_0xaffa('0x8'));var csv=require(_0xaffa('0x9'));var ejs=require(_0xaffa('0xa'));var fs=require('fs');var fs_extra=require(_0xaffa('0xb'));var _=require(_0xaffa('0xc'));var squel=require('squel');var crypto=require(_0xaffa('0xd'));var jsforce=require(_0xaffa('0xe'));var deskjs=require(_0xaffa('0xf'));var toCsv=require(_0xaffa('0x9'));var querystring=require('querystring');var Papa=require(_0xaffa('0x10'));var Redis=require('ioredis');var authService=require(_0xaffa('0x11'));var qs=require(_0xaffa('0x12'));var as=require(_0xaffa('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaffa('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xaffa('0x15'));var db=require(_0xaffa('0x16'))['db'];function respondWithStatusCode(_0x2ba362,_0x54f27f){_0x54f27f=_0x54f27f||0xcc;return function(_0x3806e9){if(_0x3806e9){return _0x2ba362['sendStatus'](_0x54f27f);}return _0x2ba362[_0xaffa('0x17')](_0x54f27f)['end']();};}function respondWithResult(_0xd8e9c6,_0x8ecc6b){_0x8ecc6b=_0x8ecc6b||0xc8;return function(_0x255025){if(_0x255025){return _0xd8e9c6[_0xaffa('0x17')](_0x8ecc6b)[_0xaffa('0x18')](_0x255025);}};}function respondWithFilteredResult(_0x326bab,_0x11d334){return function(_0x323a2f){if(_0x323a2f){var _0x5cc262=typeof _0x11d334[_0xaffa('0x19')]===_0xaffa('0x1a')&&typeof _0x11d334['limit']===_0xaffa('0x1a');var _0x5974cc=_0x323a2f[_0xaffa('0x1b')];var _0x2d57ab=_0x5cc262?0x0:_0x11d334[_0xaffa('0x19')];var _0x398968=_0x5cc262?_0x323a2f[_0xaffa('0x1b')]:_0x11d334[_0xaffa('0x19')]+_0x11d334['limit'];var _0x34d70f;if(_0x398968>=_0x5974cc){_0x398968=_0x5974cc;_0x34d70f=0xc8;}else{_0x34d70f=0xce;}_0x326bab[_0xaffa('0x17')](_0x34d70f);return _0x326bab[_0xaffa('0x1c')](_0xaffa('0x1d'),_0x2d57ab+'-'+_0x398968+'/'+_0x5974cc)[_0xaffa('0x18')](_0x323a2f);}return null;};}function patchUpdates(_0x16297d){return function(_0x23e60f){try{jsonpatch['apply'](_0x23e60f,_0x16297d,!![]);}catch(_0x520d62){return BPromise[_0xaffa('0x1e')](_0x520d62);}return _0x23e60f[_0xaffa('0x1f')]();};}function saveUpdates(_0x45c856,_0x2f5091){return function(_0x4f8084){if(_0x4f8084){return _0x4f8084['update'](_0x45c856)[_0xaffa('0x20')](function(_0x3f7dee){return _0x3f7dee;});}return null;};}function removeEntity(_0x587e8b,_0x2a5bb8){return function(_0x298e2b){if(_0x298e2b){return _0x298e2b[_0xaffa('0x21')]()[_0xaffa('0x20')](function(){var _0x1d83ce=_0x298e2b[_0xaffa('0x22')]({'plain':!![]});var _0x492b82=_0xaffa('0x23');return db[_0xaffa('0x24')]['destroy']({'where':{'type':_0x492b82,'resourceId':_0x1d83ce['id']}})['then'](function(){return _0x298e2b;});})[_0xaffa('0x20')](function(){_0x587e8b[_0xaffa('0x17')](0xcc)[_0xaffa('0x25')]();});}};}function handleEntityNotFound(_0x28b4e2,_0x247915){return function(_0x411448){if(!_0x411448){_0x28b4e2[_0xaffa('0x26')](0x194);}return _0x411448;};}function handleError(_0x42808b,_0x3872c1){_0x3872c1=_0x3872c1||0x1f4;return function(_0x1b8111){logger[_0xaffa('0x27')](_0x1b8111[_0xaffa('0x28')]);if(_0x1b8111['name']){delete _0x1b8111['name'];}_0x42808b[_0xaffa('0x17')](_0x3872c1)[_0xaffa('0x29')](_0x1b8111);};}exports['index']=function(_0x571540,_0x5c6412){var _0x2c0364={},_0x38a56b={},_0x2c77e6={'count':0x0,'rows':[]};var _0x50ca99=_[_0xaffa('0x2a')](db[_0xaffa('0x2b')][_0xaffa('0x2c')],function(_0x178d76){return{'name':_0x178d76[_0xaffa('0x2d')],'type':_0x178d76[_0xaffa('0x2e')][_0xaffa('0x2f')]};});_0x38a56b[_0xaffa('0x30')]=_[_0xaffa('0x2a')](_0x50ca99,_0xaffa('0x31'));_0x38a56b['query']=_[_0xaffa('0x32')](_0x571540[_0xaffa('0x33')]);_0x38a56b[_0xaffa('0x34')]=_[_0xaffa('0x35')](_0x38a56b[_0xaffa('0x30')],_0x38a56b[_0xaffa('0x33')]);_0x2c0364[_0xaffa('0x36')]=_[_0xaffa('0x35')](_0x38a56b['model'],qs['fields'](_0x571540[_0xaffa('0x33')]['fields']));_0x2c0364['attributes']=_0x2c0364[_0xaffa('0x36')][_0xaffa('0x37')]?_0x2c0364[_0xaffa('0x36')]:_0x38a56b[_0xaffa('0x30')];if(!_0x571540['query'][_0xaffa('0x38')](_0xaffa('0x39'))){_0x2c0364['limit']=qs[_0xaffa('0x3a')](_0x571540[_0xaffa('0x33')]['limit']);_0x2c0364['offset']=qs[_0xaffa('0x19')](_0x571540[_0xaffa('0x33')][_0xaffa('0x19')]);}_0x2c0364[_0xaffa('0x3b')]=qs[_0xaffa('0x3c')](_0x571540['query']['sort']);_0x2c0364[_0xaffa('0x3d')]=qs[_0xaffa('0x34')](_['pick'](_0x571540[_0xaffa('0x33')],_0x38a56b[_0xaffa('0x34')]),_0x50ca99);if(_0x571540[_0xaffa('0x33')][_0xaffa('0x3e')]){_0x2c0364[_0xaffa('0x3d')]=_['merge'](_0x2c0364[_0xaffa('0x3d')],{'$or':_['map'](_0x50ca99,function(_0x37bafe){if(_0x37bafe[_0xaffa('0x2e')]!==_0xaffa('0x3f')){var _0x5e0561={};_0x5e0561[_0x37bafe['name']]={'$like':'%'+_0x571540['query'][_0xaffa('0x3e')]+'%'};return _0x5e0561;}})});}_0x2c0364=_[_0xaffa('0x40')]({},_0x2c0364,_0x571540[_0xaffa('0x41')]);var _0x5bbc63={'where':_0x2c0364[_0xaffa('0x3d')]};return db['VoiceChanSpy'][_0xaffa('0x1b')](_0x5bbc63)['then'](function(_0x4b0aaf){_0x2c77e6[_0xaffa('0x1b')]=_0x4b0aaf;if(_0x571540[_0xaffa('0x33')][_0xaffa('0x42')]){_0x2c0364[_0xaffa('0x43')]=[{'all':!![]}];}return db[_0xaffa('0x2b')][_0xaffa('0x44')](_0x2c0364);})[_0xaffa('0x20')](function(_0x263058){_0x2c77e6[_0xaffa('0x45')]=_0x263058;return _0x2c77e6;})[_0xaffa('0x20')](respondWithFilteredResult(_0x5c6412,_0x2c0364))['catch'](handleError(_0x5c6412,null));};exports[_0xaffa('0x46')]=function(_0x21e1d9,_0x1115bc){var _0x149b59={'raw':![],'where':{'id':_0x21e1d9[_0xaffa('0x47')]['id']}},_0x282f1d={};_0x282f1d[_0xaffa('0x30')]=_[_0xaffa('0x32')](db['VoiceChanSpy'][_0xaffa('0x2c')]);_0x282f1d['query']=_[_0xaffa('0x32')](_0x21e1d9[_0xaffa('0x33')]);_0x282f1d[_0xaffa('0x34')]=_[_0xaffa('0x35')](_0x282f1d['model'],_0x282f1d['query']);_0x149b59[_0xaffa('0x36')]=_['intersection'](_0x282f1d[_0xaffa('0x30')],qs[_0xaffa('0x48')](_0x21e1d9['query'][_0xaffa('0x48')]));_0x149b59[_0xaffa('0x36')]=_0x149b59[_0xaffa('0x36')]['length']?_0x149b59['attributes']:_0x282f1d['model'];if(_0x21e1d9[_0xaffa('0x33')]['includeAll']){_0x149b59[_0xaffa('0x43')]=[{'all':!![]}];}_0x149b59=_[_0xaffa('0x40')]({},_0x149b59,_0x21e1d9[_0xaffa('0x41')]);return db['VoiceChanSpy'][_0xaffa('0x49')](_0x149b59)[_0xaffa('0x20')](handleEntityNotFound(_0x1115bc,null))[_0xaffa('0x20')](respondWithResult(_0x1115bc,null))[_0xaffa('0x4a')](handleError(_0x1115bc,null));};exports[_0xaffa('0x4b')]=function(_0x5e0029,_0x2b0ecc){return db[_0xaffa('0x2b')]['create'](_0x5e0029['body'],{})['then'](function(_0x17c913){var _0x1a52f6=_0x5e0029[_0xaffa('0x4c')][_0xaffa('0x22')]({'plain':!![]});if(!_0x1a52f6)throw new Error(_0xaffa('0x4d'));if(_0x1a52f6['role']===_0xaffa('0x4c')){var _0x3a69cb=_0x17c913[_0xaffa('0x22')]({'plain':!![]});var _0x3b7740=_0xaffa('0x23');return db[_0xaffa('0x4e')]['find']({'where':{'name':_0x3b7740,'userProfileId':_0x1a52f6[_0xaffa('0x4f')]},'raw':!![]})['then'](function(_0x3d99a9){if(_0x3d99a9&&_0x3d99a9[_0xaffa('0x50')]===0x0){return db['UserProfileResource'][_0xaffa('0x4b')]({'name':_0x3a69cb['name'],'resourceId':_0x3a69cb['id'],'type':_0x3d99a9[_0xaffa('0x31')],'sectionId':_0x3d99a9['id']},{})[_0xaffa('0x20')](function(){return _0x17c913;});}else{return _0x17c913;}})[_0xaffa('0x4a')](function(_0x3347ee){logger[_0xaffa('0x27')](_0xaffa('0x51'),_0x3347ee);throw _0x3347ee;});}return _0x17c913;})['then'](respondWithResult(_0x2b0ecc,0xc9))[_0xaffa('0x4a')](handleError(_0x2b0ecc,null));};exports['update']=function(_0x5ae8c8,_0x1b3bc9){if(_0x5ae8c8[_0xaffa('0x52')]['id']){delete _0x5ae8c8[_0xaffa('0x52')]['id'];}return db['VoiceChanSpy'][_0xaffa('0x49')]({'where':{'id':_0x5ae8c8[_0xaffa('0x47')]['id']}})[_0xaffa('0x20')](handleEntityNotFound(_0x1b3bc9,null))[_0xaffa('0x20')](saveUpdates(_0x5ae8c8[_0xaffa('0x52')],null))['then'](respondWithResult(_0x1b3bc9,null))[_0xaffa('0x4a')](handleError(_0x1b3bc9,null));};exports[_0xaffa('0x21')]=function(_0x1822e8,_0x13adef){return db[_0xaffa('0x2b')][_0xaffa('0x49')]({'where':{'id':_0x1822e8[_0xaffa('0x47')]['id']}})[_0xaffa('0x20')](handleEntityNotFound(_0x13adef,null))[_0xaffa('0x20')](removeEntity(_0x13adef,null))[_0xaffa('0x4a')](handleError(_0x13adef,null));}; \ No newline at end of file +var _0xdf0c=['options','includeAll','VoiceChanSpy','rows','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChanSpies','UserProfileSection','autoAssociation','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','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','../../config/license/util','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x5f027c,_0x37ff66){var _0x202e3d=function(_0x5152ed){while(--_0x5152ed){_0x5f027c['push'](_0x5f027c['shift']());}};_0x202e3d(++_0x37ff66);}(_0xdf0c,0x1ab));var _0xcdf0=function(_0x536ae6,_0x48ce92){_0x536ae6=_0x536ae6-0x0;var _0x31cfb0=_0xdf0c[_0x536ae6];return _0x31cfb0;};'use strict';var emlformat=require(_0xcdf0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcdf0('0x1'));var jsonpatch=require(_0xcdf0('0x2'));var rp=require(_0xcdf0('0x3'));var moment=require(_0xcdf0('0x4'));var BPromise=require(_0xcdf0('0x5'));var Mustache=require(_0xcdf0('0x6'));var util=require(_0xcdf0('0x7'));var path=require('path');var sox=require(_0xcdf0('0x8'));var csv=require(_0xcdf0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcdf0('0xa'));var _=require(_0xcdf0('0xb'));var squel=require(_0xcdf0('0xc'));var crypto=require('crypto');var jsforce=require(_0xcdf0('0xd'));var deskjs=require(_0xcdf0('0xe'));var toCsv=require(_0xcdf0('0x9'));var querystring=require(_0xcdf0('0xf'));var Papa=require('papaparse');var Redis=require(_0xcdf0('0x10'));var authService=require(_0xcdf0('0x11'));var qs=require(_0xcdf0('0x12'));var as=require(_0xcdf0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcdf0('0x14'))(_0xcdf0('0x15'));var utils=require(_0xcdf0('0x16'));var config=require(_0xcdf0('0x17'));var licenseUtil=require(_0xcdf0('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12f874,_0x3da121){_0x3da121=_0x3da121||0xcc;return function(_0x3a402a){if(_0x3a402a){return _0x12f874['sendStatus'](_0x3da121);}return _0x12f874[_0xcdf0('0x19')](_0x3da121)['end']();};}function respondWithResult(_0x56ea53,_0x29429b){_0x29429b=_0x29429b||0xc8;return function(_0x2c654c){if(_0x2c654c){return _0x56ea53['status'](_0x29429b)[_0xcdf0('0x1a')](_0x2c654c);}};}function respondWithFilteredResult(_0x325972,_0x25d136){return function(_0x22acb4){if(_0x22acb4){var _0x14df00=typeof _0x25d136[_0xcdf0('0x1b')]===_0xcdf0('0x1c')&&typeof _0x25d136[_0xcdf0('0x1d')]===_0xcdf0('0x1c');var _0x434df2=_0x22acb4[_0xcdf0('0x1e')];var _0x1323df=_0x14df00?0x0:_0x25d136[_0xcdf0('0x1b')];var _0x1c4515=_0x14df00?_0x22acb4['count']:_0x25d136[_0xcdf0('0x1b')]+_0x25d136[_0xcdf0('0x1d')];var _0x5d74fb;if(_0x1c4515>=_0x434df2){_0x1c4515=_0x434df2;_0x5d74fb=0xc8;}else{_0x5d74fb=0xce;}_0x325972[_0xcdf0('0x19')](_0x5d74fb);return _0x325972[_0xcdf0('0x1f')](_0xcdf0('0x20'),_0x1323df+'-'+_0x1c4515+'/'+_0x434df2)[_0xcdf0('0x1a')](_0x22acb4);}return null;};}function patchUpdates(_0xcf6826){return function(_0x32e860){try{jsonpatch[_0xcdf0('0x21')](_0x32e860,_0xcf6826,!![]);}catch(_0x2c4eb8){return BPromise['reject'](_0x2c4eb8);}return _0x32e860[_0xcdf0('0x22')]();};}function saveUpdates(_0x4c57d4,_0x4e08d6){return function(_0x1a3c71){if(_0x1a3c71){return _0x1a3c71[_0xcdf0('0x23')](_0x4c57d4)[_0xcdf0('0x24')](function(_0x517b97){return _0x517b97;});}return null;};}function removeEntity(_0x2359d2,_0x37bb32){return function(_0x446a8f){if(_0x446a8f){return _0x446a8f[_0xcdf0('0x25')]()[_0xcdf0('0x24')](function(){var _0x2eb11a=_0x446a8f[_0xcdf0('0x26')]({'plain':!![]});var _0x18e3f5='ChanSpies';return db[_0xcdf0('0x27')][_0xcdf0('0x25')]({'where':{'type':_0x18e3f5,'resourceId':_0x2eb11a['id']}})[_0xcdf0('0x24')](function(){return _0x446a8f;});})['then'](function(){_0x2359d2[_0xcdf0('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30ec87,_0x2b1214){return function(_0x4f8d1f){if(!_0x4f8d1f){_0x30ec87[_0xcdf0('0x28')](0x194);}return _0x4f8d1f;};}function handleError(_0x549ee3,_0x2f10f7){_0x2f10f7=_0x2f10f7||0x1f4;return function(_0x466432){logger[_0xcdf0('0x29')](_0x466432[_0xcdf0('0x2a')]);if(_0x466432[_0xcdf0('0x2b')]){delete _0x466432[_0xcdf0('0x2b')];}_0x549ee3[_0xcdf0('0x19')](_0x2f10f7)[_0xcdf0('0x2c')](_0x466432);};}exports[_0xcdf0('0x2d')]=function(_0x4f5b10,_0x5abc1c){var _0x215b67={},_0x489add={},_0x4078b0={'count':0x0,'rows':[]};var _0x5bccaa=_[_0xcdf0('0x2e')](db['VoiceChanSpy'][_0xcdf0('0x2f')],function(_0x2d2380){return{'name':_0x2d2380[_0xcdf0('0x30')],'type':_0x2d2380[_0xcdf0('0x31')][_0xcdf0('0x32')]};});_0x489add[_0xcdf0('0x33')]=_[_0xcdf0('0x2e')](_0x5bccaa,'name');_0x489add[_0xcdf0('0x34')]=_[_0xcdf0('0x35')](_0x4f5b10[_0xcdf0('0x34')]);_0x489add[_0xcdf0('0x36')]=_['intersection'](_0x489add['model'],_0x489add['query']);_0x215b67[_0xcdf0('0x37')]=_[_0xcdf0('0x38')](_0x489add[_0xcdf0('0x33')],qs[_0xcdf0('0x39')](_0x4f5b10['query'][_0xcdf0('0x39')]));_0x215b67[_0xcdf0('0x37')]=_0x215b67[_0xcdf0('0x37')][_0xcdf0('0x3a')]?_0x215b67[_0xcdf0('0x37')]:_0x489add[_0xcdf0('0x33')];if(!_0x4f5b10[_0xcdf0('0x34')][_0xcdf0('0x3b')](_0xcdf0('0x3c'))){_0x215b67['limit']=qs[_0xcdf0('0x1d')](_0x4f5b10[_0xcdf0('0x34')][_0xcdf0('0x1d')]);_0x215b67[_0xcdf0('0x1b')]=qs['offset'](_0x4f5b10[_0xcdf0('0x34')][_0xcdf0('0x1b')]);}_0x215b67['order']=qs[_0xcdf0('0x3d')](_0x4f5b10['query'][_0xcdf0('0x3d')]);_0x215b67[_0xcdf0('0x3e')]=qs[_0xcdf0('0x36')](_['pick'](_0x4f5b10['query'],_0x489add['filters']),_0x5bccaa);if(_0x4f5b10['query'][_0xcdf0('0x3f')]){_0x215b67['where']=_[_0xcdf0('0x40')](_0x215b67['where'],{'$or':_[_0xcdf0('0x2e')](_0x5bccaa,function(_0x183461){if(_0x183461[_0xcdf0('0x31')]!=='VIRTUAL'){var _0x528c76={};_0x528c76[_0x183461[_0xcdf0('0x2b')]]={'$like':'%'+_0x4f5b10[_0xcdf0('0x34')][_0xcdf0('0x3f')]+'%'};return _0x528c76;}})});}_0x215b67=_[_0xcdf0('0x40')]({},_0x215b67,_0x4f5b10[_0xcdf0('0x41')]);var _0x1a81ad={'where':_0x215b67[_0xcdf0('0x3e')]};return db['VoiceChanSpy'][_0xcdf0('0x1e')](_0x1a81ad)['then'](function(_0x1d6783){_0x4078b0[_0xcdf0('0x1e')]=_0x1d6783;if(_0x4f5b10[_0xcdf0('0x34')][_0xcdf0('0x42')]){_0x215b67['include']=[{'all':!![]}];}return db[_0xcdf0('0x43')]['findAll'](_0x215b67);})[_0xcdf0('0x24')](function(_0x43a7f){_0x4078b0[_0xcdf0('0x44')]=_0x43a7f;return _0x4078b0;})[_0xcdf0('0x24')](respondWithFilteredResult(_0x5abc1c,_0x215b67))[_0xcdf0('0x45')](handleError(_0x5abc1c,null));};exports[_0xcdf0('0x46')]=function(_0x279df5,_0x30ce09){var _0x1fef81={'raw':![],'where':{'id':_0x279df5[_0xcdf0('0x47')]['id']}},_0x16f1c5={};_0x16f1c5[_0xcdf0('0x33')]=_[_0xcdf0('0x35')](db[_0xcdf0('0x43')][_0xcdf0('0x2f')]);_0x16f1c5['query']=_[_0xcdf0('0x35')](_0x279df5[_0xcdf0('0x34')]);_0x16f1c5['filters']=_[_0xcdf0('0x38')](_0x16f1c5[_0xcdf0('0x33')],_0x16f1c5[_0xcdf0('0x34')]);_0x1fef81['attributes']=_[_0xcdf0('0x38')](_0x16f1c5[_0xcdf0('0x33')],qs[_0xcdf0('0x39')](_0x279df5[_0xcdf0('0x34')]['fields']));_0x1fef81[_0xcdf0('0x37')]=_0x1fef81[_0xcdf0('0x37')][_0xcdf0('0x3a')]?_0x1fef81[_0xcdf0('0x37')]:_0x16f1c5[_0xcdf0('0x33')];if(_0x279df5['query']['includeAll']){_0x1fef81[_0xcdf0('0x48')]=[{'all':!![]}];}_0x1fef81=_[_0xcdf0('0x40')]({},_0x1fef81,_0x279df5[_0xcdf0('0x41')]);return db['VoiceChanSpy'][_0xcdf0('0x49')](_0x1fef81)[_0xcdf0('0x24')](handleEntityNotFound(_0x30ce09,null))[_0xcdf0('0x24')](respondWithResult(_0x30ce09,null))[_0xcdf0('0x45')](handleError(_0x30ce09,null));};exports[_0xcdf0('0x4a')]=function(_0x95f7d1,_0x374b37){return db[_0xcdf0('0x43')][_0xcdf0('0x4a')](_0x95f7d1[_0xcdf0('0x4b')],{})[_0xcdf0('0x24')](function(_0x524851){var _0x13195d=_0x95f7d1[_0xcdf0('0x4c')][_0xcdf0('0x26')]({'plain':!![]});if(!_0x13195d)throw new Error(_0xcdf0('0x4d'));if(_0x13195d[_0xcdf0('0x4e')]===_0xcdf0('0x4c')){var _0x33bc14=_0x524851[_0xcdf0('0x26')]({'plain':!![]});var _0x394f95=_0xcdf0('0x4f');return db[_0xcdf0('0x50')][_0xcdf0('0x49')]({'where':{'name':_0x394f95,'userProfileId':_0x13195d['userProfileId']},'raw':!![]})[_0xcdf0('0x24')](function(_0x2dd30b){if(_0x2dd30b&&_0x2dd30b[_0xcdf0('0x51')]===0x0){return db[_0xcdf0('0x27')][_0xcdf0('0x4a')]({'name':_0x33bc14[_0xcdf0('0x2b')],'resourceId':_0x33bc14['id'],'type':_0x2dd30b['name'],'sectionId':_0x2dd30b['id']},{})[_0xcdf0('0x24')](function(){return _0x524851;});}else{return _0x524851;}})['catch'](function(_0x5784a0){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5784a0);throw _0x5784a0;});}return _0x524851;})[_0xcdf0('0x24')](respondWithResult(_0x374b37,0xc9))['catch'](handleError(_0x374b37,null));};exports[_0xcdf0('0x23')]=function(_0x310c50,_0x3893e5){if(_0x310c50[_0xcdf0('0x4b')]['id']){delete _0x310c50[_0xcdf0('0x4b')]['id'];}return db[_0xcdf0('0x43')][_0xcdf0('0x49')]({'where':{'id':_0x310c50[_0xcdf0('0x47')]['id']}})[_0xcdf0('0x24')](handleEntityNotFound(_0x3893e5,null))[_0xcdf0('0x24')](saveUpdates(_0x310c50['body'],null))[_0xcdf0('0x24')](respondWithResult(_0x3893e5,null))[_0xcdf0('0x45')](handleError(_0x3893e5,null));};exports[_0xcdf0('0x25')]=function(_0x18216f,_0x3b72e9){return db[_0xcdf0('0x43')][_0xcdf0('0x49')]({'where':{'id':_0x18216f[_0xcdf0('0x47')]['id']}})[_0xcdf0('0x24')](handleEntityNotFound(_0x3b72e9,null))['then'](removeEntity(_0x3b72e9,null))[_0xcdf0('0x45')](handleError(_0x3b72e9,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index c00f716..d0902a6 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 _0x135e=['SIP/%s,%s','name','options','join','record','length','concat','User','findAll','then','catch','models','define','VoiceExtension','destroy','bulkCreate','util','bluebird','./voiceChanSpy.attributes','context','format','%s%s','system','push','merge','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy'];(function(_0x317791,_0x2c5a33){var _0x31e0d1=function(_0x47e235){while(--_0x47e235){_0x317791['push'](_0x317791['shift']());}};_0x31e0d1(++_0x2c5a33);}(_0x135e,0x110));var _0xe135=function(_0x1dd882,_0x339d3d){_0x1dd882=_0x1dd882-0x0;var _0x56eb0a=_0x135e[_0x1dd882];return _0x56eb0a;};'use strict';var _=require('lodash');var util=require(_0xe135('0x0'));var BPromise=require(_0xe135('0x1'));var attributes=require(_0xe135('0x2'));var getUserApplications=function(_0x506c2a,_0x5aab0b,_0xa41f46){var _0x567e5a=0x1;var _0x3eae04=[];var _0x4a9986={'context':_0x5aab0b[_0xe135('0x3')]||'from-sip','exten':util[_0xe135('0x4')](_0xe135('0x5'),_0x506c2a['prefix'],_0xa41f46),'type':_0xe135('0x6'),'isApp':![],'ChanSpyId':_0x506c2a['id'],'UserId':_0x5aab0b['id']};_0x3eae04[_0xe135('0x7')](_[_0xe135('0x8')]({'app':'Set','appdata':util[_0xe135('0x4')]('CDR(type)=%s','chanspy'),'priority':_0x567e5a++},_0x4a9986));if(_0x506c2a['record']){_0x3eae04[_0xe135('0x7')](_['merge']({'app':_0xe135('0x9'),'appdata':util['format'](_0xe135('0xa'),_0x506c2a[_0xe135('0xb')]),'priority':_0x567e5a++},_0x4a9986));}if(_0x506c2a[_0xe135('0xc')]){_0x3eae04[_0xe135('0x7')](_[_0xe135('0x8')]({'app':_0xe135('0xd'),'appdata':_0x506c2a[_0xe135('0xe')],'priority':_0x567e5a++},_0x4a9986));}_0x3eae04[_0xe135('0x7')](_['merge']({'app':_0xe135('0xf'),'appdata':util[_0xe135('0x4')](_0xe135('0x10'),_0x5aab0b[_0xe135('0x11')],_0x506c2a[_0xe135('0x12')]?_0x506c2a[_0xe135('0x12')][_0xe135('0x13')](''):''),'priority':_0x567e5a++},_0x4a9986));if(_0x506c2a[_0xe135('0x14')]){_0x3eae04[_0xe135('0x7')](_['merge']({'app':'StopMixMonitor','priority':_0x567e5a++},_0x4a9986));}return _0x3eae04;};var getChanSpyApplications=function(_0x376498,_0x465803){var _0x48667c=[];for(var _0xde6f70=0x0,_0x369c4=0x1;_0xde6f70<_0x465803[_0xe135('0x15')];_0xde6f70++,_0x369c4=0x1){_0x48667c=_0x48667c[_0xe135('0x16')](getUserApplications(_0x376498,_0x465803[_0xde6f70],_0x465803[_0xde6f70]['internal']));if(_0x465803[_0xde6f70]['internal']!=_0x465803[_0xde6f70][_0xe135('0x11')]){_0x48667c=_0x48667c[_0xe135('0x16')](getUserApplications(_0x376498,_0x465803[_0xde6f70],_0x465803[_0xde6f70]['name']));}}return _0x48667c;};var getChanSpyPromise=function(_0x55c213,_0x1edeb6){return new BPromise(function(_0x3b419d,_0x15eaba){return _0x55c213[_0xe135('0x17')][_0xe135('0x18')]({'attributes':['id',_0xe135('0x11'),'internal'],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0xe135('0x19')](function(_0x56dc3f){if(_0x56dc3f){return _0x3b419d(getChanSpyApplications(_0x1edeb6,_0x56dc3f));}return _0x3b419d([]);})[_0xe135('0x1a')](function(_0x460461){_0x15eaba(_0x460461);});});};module['exports']=function(_0x594347,_0x2b071a){var _0x932b67=_0x594347[_0xe135('0x1b')];return _0x594347[_0xe135('0x1c')]('VoiceChanSpy',attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x21a0a3,_0x7c1326,_0x18460c){return getChanSpyPromise(_0x932b67,_0x21a0a3)[_0xe135('0x19')](function(_0x2fb2d4){if(_0x2fb2d4&&_0x2fb2d4[_0xe135('0x15')]){return _0x932b67[_0xe135('0x1d')]['bulkCreate'](_0x2fb2d4);}})[_0xe135('0x19')](function(){_0x18460c();})[_0xe135('0x1a')](function(_0xf265aa){_0x18460c(_0xf265aa);});},'afterUpdate':function(_0x1153f1,_0x3666c3,_0x36a703){return _0x932b67[_0xe135('0x1d')][_0xe135('0x1e')]({'where':{'ChanSpyId':_0x1153f1['id']}})[_0xe135('0x19')](function(){return getChanSpyPromise(_0x932b67,_0x1153f1);})[_0xe135('0x19')](function(_0x45aba6){if(_0x45aba6&&_0x45aba6[_0xe135('0x15')]){return _0x932b67['VoiceExtension'][_0xe135('0x1f')](_0x45aba6);}})[_0xe135('0x19')](function(){_0x36a703();})['catch'](function(_0xfb16b1){_0x36a703(_0xfb16b1);});},'afterDestroy':function(_0x2c2849,_0x130163,_0x2d57c5){return _0x932b67[_0xe135('0x1d')]['destroy']({'where':{'ChanSpyId':_0x2c2849['id']}})[_0xe135('0x19')](function(){_0x2d57c5();})['catch'](function(_0x4404ec){_0x2d57c5(_0x4404ec);});}}});}; \ No newline at end of file +var _0xd5e0=['length','internal','concat','User','findAll','agent','exports','models','define','VoiceChanSpy','then','catch','VoiceExtension','destroy','bulkCreate','lodash','util','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','push','merge','Set','CDR(type)=%s','chanspy','record','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor'];(function(_0x1ef2e3,_0x380ec2){var _0x173e11=function(_0x574cb9){while(--_0x574cb9){_0x1ef2e3['push'](_0x1ef2e3['shift']());}};_0x173e11(++_0x380ec2);}(_0xd5e0,0x127));var _0x0d5e=function(_0x3fe7ac,_0x23f335){_0x3fe7ac=_0x3fe7ac-0x0;var _0x453e35=_0xd5e0[_0x3fe7ac];return _0x453e35;};'use strict';var _=require(_0x0d5e('0x0'));var util=require(_0x0d5e('0x1'));var BPromise=require('bluebird');var attributes=require(_0x0d5e('0x2'));var getUserApplications=function(_0x4873b9,_0x3206ed,_0x24458c){var _0x124320=0x1;var _0x2325b2=[];var _0x55903d={'context':_0x3206ed[_0x0d5e('0x3')]||_0x0d5e('0x4'),'exten':util[_0x0d5e('0x5')](_0x0d5e('0x6'),_0x4873b9[_0x0d5e('0x7')],_0x24458c),'type':_0x0d5e('0x8'),'isApp':![],'ChanSpyId':_0x4873b9['id'],'UserId':_0x3206ed['id']};_0x2325b2[_0x0d5e('0x9')](_[_0x0d5e('0xa')]({'app':_0x0d5e('0xb'),'appdata':util[_0x0d5e('0x5')](_0x0d5e('0xc'),_0x0d5e('0xd')),'priority':_0x124320++},_0x55903d));if(_0x4873b9[_0x0d5e('0xe')]){_0x2325b2['push'](_[_0x0d5e('0xa')]({'app':'MixMonitor','appdata':util[_0x0d5e('0x5')](_0x0d5e('0xf'),_0x4873b9[_0x0d5e('0x10')]),'priority':_0x124320++},_0x55903d));}if(_0x4873b9[_0x0d5e('0x11')]){_0x2325b2[_0x0d5e('0x9')](_['merge']({'app':_0x0d5e('0x12'),'appdata':_0x4873b9['password'],'priority':_0x124320++},_0x55903d));}_0x2325b2['push'](_['merge']({'app':_0x0d5e('0x13'),'appdata':util[_0x0d5e('0x5')](_0x0d5e('0x14'),_0x3206ed[_0x0d5e('0x15')],_0x4873b9[_0x0d5e('0x16')]?_0x4873b9['options'][_0x0d5e('0x17')](''):''),'priority':_0x124320++},_0x55903d));if(_0x4873b9[_0x0d5e('0xe')]){_0x2325b2[_0x0d5e('0x9')](_[_0x0d5e('0xa')]({'app':_0x0d5e('0x18'),'priority':_0x124320++},_0x55903d));}return _0x2325b2;};var getChanSpyApplications=function(_0x23731b,_0x52c630){var _0x9269fb=[];for(var _0x472db1=0x0,_0x111c86=0x1;_0x472db1<_0x52c630[_0x0d5e('0x19')];_0x472db1++,_0x111c86=0x1){_0x9269fb=_0x9269fb['concat'](getUserApplications(_0x23731b,_0x52c630[_0x472db1],_0x52c630[_0x472db1][_0x0d5e('0x1a')]));if(_0x52c630[_0x472db1]['internal']!=_0x52c630[_0x472db1][_0x0d5e('0x15')]){_0x9269fb=_0x9269fb[_0x0d5e('0x1b')](getUserApplications(_0x23731b,_0x52c630[_0x472db1],_0x52c630[_0x472db1][_0x0d5e('0x15')]));}}return _0x9269fb;};var getChanSpyPromise=function(_0x26f58b,_0xf0a20){return new BPromise(function(_0xd1a93a,_0x3ad5da){return _0x26f58b[_0x0d5e('0x1c')][_0x0d5e('0x1d')]({'attributes':['id',_0x0d5e('0x15'),_0x0d5e('0x1a')],'where':{'role':_0x0d5e('0x1e'),'chanspy':!![]},'raw':!![]})['then'](function(_0x7d5221){if(_0x7d5221){return _0xd1a93a(getChanSpyApplications(_0xf0a20,_0x7d5221));}return _0xd1a93a([]);})['catch'](function(_0xfe2063){_0x3ad5da(_0xfe2063);});});};module[_0x0d5e('0x1f')]=function(_0x13ce68,_0xa6142a){var _0x3f2abc=_0x13ce68[_0x0d5e('0x20')];return _0x13ce68[_0x0d5e('0x21')](_0x0d5e('0x22'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x102497,_0x4de713,_0x442505){return getChanSpyPromise(_0x3f2abc,_0x102497)[_0x0d5e('0x23')](function(_0x6572e5){if(_0x6572e5&&_0x6572e5[_0x0d5e('0x19')]){return _0x3f2abc['VoiceExtension']['bulkCreate'](_0x6572e5);}})[_0x0d5e('0x23')](function(){_0x442505();})[_0x0d5e('0x24')](function(_0x326d35){_0x442505(_0x326d35);});},'afterUpdate':function(_0x2d3e45,_0x2368ff,_0x1b854f){return _0x3f2abc[_0x0d5e('0x25')][_0x0d5e('0x26')]({'where':{'ChanSpyId':_0x2d3e45['id']}})[_0x0d5e('0x23')](function(){return getChanSpyPromise(_0x3f2abc,_0x2d3e45);})[_0x0d5e('0x23')](function(_0x5c0330){if(_0x5c0330&&_0x5c0330['length']){return _0x3f2abc[_0x0d5e('0x25')][_0x0d5e('0x27')](_0x5c0330);}})[_0x0d5e('0x23')](function(){_0x1b854f();})['catch'](function(_0x249537){_0x1b854f(_0x249537);});},'afterDestroy':function(_0x2f6407,_0x54b006,_0x1a3926){return _0x3f2abc[_0x0d5e('0x25')][_0x0d5e('0x26')]({'where':{'ChanSpyId':_0x2f6407['id']}})[_0x0d5e('0x23')](function(){_0x1a3926();})[_0x0d5e('0x24')](function(_0x5cfab6){_0x1a3926(_0x5cfab6);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 2c49892..564a394 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 _0xa74f=['result','catch','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','then','info','VoiceChanSpy,\x20%s,\x20%s','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent'];(function(_0x17c483,_0xc69535){var _0x112bdb=function(_0x19adb9){while(--_0x19adb9){_0x17c483['push'](_0x17c483['shift']());}};_0x112bdb(++_0xc69535);}(_0xa74f,0x9a));var _0xfa74=function(_0x541a67,_0x50728d){_0x541a67=_0x541a67-0x0;var _0x45da2a=_0xa74f[_0x541a67];return _0x45da2a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfa74('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfa74('0x1'));var db=require(_0xfa74('0x2'))['db'];var utils=require(_0xfa74('0x3'));var logger=require(_0xfa74('0x4'))('rpc');var config=require(_0xfa74('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfa74('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x9ddbd2,_0x3ac32e,_0x2d9fa9){return new BPromise(function(_0x287921,_0x344e04){return client['request'](_0x9ddbd2,_0x2d9fa9)[_0xfa74('0x7')](function(_0x37d4d8){logger[_0xfa74('0x8')](_0xfa74('0x9'),_0x3ac32e,'request\x20sent');logger[_0xfa74('0xa')](_0xfa74('0xb'),_0x3ac32e,'request\x20sent',JSON[_0xfa74('0xc')](_0x37d4d8));if(_0x37d4d8[_0xfa74('0xd')]){if(_0x37d4d8[_0xfa74('0xd')][_0xfa74('0xe')]===0x1f4){logger['error'](_0xfa74('0x9'),_0x3ac32e,_0x37d4d8[_0xfa74('0xd')][_0xfa74('0xf')]);return _0x344e04(_0x37d4d8[_0xfa74('0xd')]['message']);}logger[_0xfa74('0xd')](_0xfa74('0x9'),_0x3ac32e,_0x37d4d8[_0xfa74('0xd')][_0xfa74('0xf')]);return _0x287921(_0x37d4d8[_0xfa74('0xd')]['message']);}else{logger[_0xfa74('0x8')](_0xfa74('0x9'),_0x3ac32e,_0xfa74('0x10'));_0x287921(_0x37d4d8[_0xfa74('0x11')][_0xfa74('0xf')]);}})[_0xfa74('0x12')](function(_0x3b9e32){logger['error'](_0xfa74('0x9'),_0x3ac32e,_0x3b9e32);_0x344e04(_0x3b9e32);});});} \ No newline at end of file +var _0x0102=['info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','../../config/environment','jayson/promise','client','http','then'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0102,0x186));var _0x2010=function(_0x5b57ac,_0x5bad7e){_0x5b57ac=_0x5b57ac-0x0;var _0x539795=_0x0102[_0x5b57ac];return _0x539795;};'use strict';var _=require('lodash');var util=require(_0x2010('0x0'));var moment=require(_0x2010('0x1'));var BPromise=require(_0x2010('0x2'));var rs=require(_0x2010('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x2010('0x4'));var jayson=require(_0x2010('0x5'));var client=jayson[_0x2010('0x6')][_0x2010('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4eeb67,_0x453fc0,_0x495d98){return new BPromise(function(_0x4728c0,_0x160e41){return client['request'](_0x4eeb67,_0x495d98)[_0x2010('0x8')](function(_0x3c2d98){logger[_0x2010('0x9')](_0x2010('0xa'),_0x453fc0,_0x2010('0xb'));logger[_0x2010('0xc')](_0x2010('0xd'),_0x453fc0,_0x2010('0xb'),JSON[_0x2010('0xe')](_0x3c2d98));if(_0x3c2d98[_0x2010('0xf')]){if(_0x3c2d98[_0x2010('0xf')][_0x2010('0x10')]===0x1f4){logger[_0x2010('0xf')](_0x2010('0xa'),_0x453fc0,_0x3c2d98[_0x2010('0xf')][_0x2010('0x11')]);return _0x160e41(_0x3c2d98['error']['message']);}logger[_0x2010('0xf')](_0x2010('0xa'),_0x453fc0,_0x3c2d98[_0x2010('0xf')][_0x2010('0x11')]);return _0x4728c0(_0x3c2d98[_0x2010('0xf')][_0x2010('0x11')]);}else{logger['info'](_0x2010('0xa'),_0x453fc0,_0x2010('0xb'));_0x4728c0(_0x3c2d98['result'][_0x2010('0x11')]);}})[_0x2010('0x12')](function(_0x410889){logger[_0x2010('0xf')](_0x2010('0xa'),_0x453fc0,_0x410889);_0x160e41(_0x410889);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index e228d85..043316d 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 _0x0f9f=['/:id','update','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','index','show','post','put'];(function(_0x37d317,_0x46dcc1){var _0x2c757f=function(_0xcbee92){while(--_0xcbee92){_0x37d317['push'](_0x37d317['shift']());}};_0x2c757f(++_0x46dcc1);}(_0x0f9f,0x124));var _0xf0f9=function(_0x305551,_0x868339){_0x305551=_0x305551-0x0;var _0x115ce2=_0x0f9f[_0x305551];return _0x115ce2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf0f9('0x0'));var timeout=require(_0xf0f9('0x1'));var express=require(_0xf0f9('0x2'));var router=express[_0xf0f9('0x3')]();var fs_extra=require(_0xf0f9('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf0f9('0x5'));var config=require(_0xf0f9('0x6'));var controller=require(_0xf0f9('0x7'));router[_0xf0f9('0x8')]('/',auth[_0xf0f9('0x9')](),controller[_0xf0f9('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xf0f9('0xb')]);router[_0xf0f9('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf0f9('0xd')](_0xf0f9('0xe'),auth[_0xf0f9('0x9')](),controller[_0xf0f9('0xf')]);router['delete'](_0xf0f9('0xe'),auth[_0xf0f9('0x9')](),controller['destroy']);module[_0xf0f9('0x10')]=router; \ No newline at end of file +var _0x644f=['../../components/interaction/service','./voiceContext.controller','get','isAuthenticated','/:id','post','create','put','update','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x24c405,_0x56d6fb){var _0x383aef=function(_0x20da69){while(--_0x20da69){_0x24c405['push'](_0x24c405['shift']());}};_0x383aef(++_0x56d6fb);}(_0x644f,0x82));var _0xf644=function(_0x4da356,_0x5235e1){_0x4da356=_0x4da356-0x0;var _0x321b07=_0x644f[_0x4da356];return _0x321b07;};'use strict';var multer=require(_0xf644('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf644('0x1'));var express=require(_0xf644('0x2'));var router=express['Router']();var fs_extra=require(_0xf644('0x3'));var auth=require(_0xf644('0x4'));var interaction=require(_0xf644('0x5'));var config=require('../../config/environment');var controller=require(_0xf644('0x6'));router[_0xf644('0x7')]('/',auth[_0xf644('0x8')](),controller['index']);router['get'](_0xf644('0x9'),auth[_0xf644('0x8')](),controller['show']);router[_0xf644('0xa')]('/',auth[_0xf644('0x8')](),controller[_0xf644('0xb')]);router[_0xf644('0xc')](_0xf644('0x9'),auth[_0xf644('0x8')](),controller[_0xf644('0xd')]);router['delete']('/:id',auth[_0xf644('0x8')](),controller['destroy']);module[_0xf644('0xe')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 1d8ada4..59794d0 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 _0x96a2=['exports','name','BOOLEAN','sequelize'];(function(_0x16faec,_0x44220f){var _0x143fc9=function(_0x5b58ba){while(--_0x5b58ba){_0x16faec['push'](_0x16faec['shift']());}};_0x143fc9(++_0x44220f);}(_0x96a2,0x133));var _0x296a=function(_0x530bd0,_0x28326c){_0x530bd0=_0x530bd0-0x0;var _0x290ef7=_0x96a2[_0x530bd0];return _0x290ef7;};'use strict';var Sequelize=require(_0x296a('0x0'));module[_0x296a('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x296a('0x2')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x296a('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9c61=['exports','STRING','name','BOOLEAN','sequelize'];(function(_0x1ee49d,_0x4dd730){var _0x392de7=function(_0x31a99f){while(--_0x31a99f){_0x1ee49d['push'](_0x1ee49d['shift']());}};_0x392de7(++_0x4dd730);}(_0x9c61,0x16c));var _0x19c6=function(_0x2b38a6,_0x4fbc47){_0x2b38a6=_0x2b38a6-0x0;var _0x118544=_0x9c61[_0x2b38a6];return _0x118544;};'use strict';var Sequelize=require(_0x19c6('0x0'));module[_0x19c6('0x1')]={'name':{'type':Sequelize[_0x19c6('0x2')],'unique':_0x19c6('0x3')},'description':{'type':Sequelize[_0x19c6('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x19c6('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 0be0000..ed01b54 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 _0x64b1=['filter','merge','VIRTUAL','options','count','includeAll','include','VoiceContext','findAll','catch','params','keys','find','create','body','readFileSync','join','utf8','render','Reload','chan_sip.so','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Contexts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','server/files/templates/context.ejs','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','root','rimraf','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','end','status','json','offset','undefined','limit','set','apply','save','destroy','UserProfileResource','stack','name','map','rawAttributes','type','model','query','filters','intersection','fields','attributes','length','sort','where','pick'];(function(_0x509d44,_0x18cd65){var _0x38e950=function(_0x289fda){while(--_0x289fda){_0x509d44['push'](_0x509d44['shift']());}};_0x38e950(++_0x18cd65);}(_0x64b1,0x1ab));var _0x164b=function(_0x24c979,_0x4243d7){_0x24c979=_0x24c979-0x0;var _0x4e538e=_0x64b1[_0x24c979];return _0x4e538e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x164b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x164b('0x1'));var moment=require(_0x164b('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x164b('0x3'));var util=require('util');var path=require(_0x164b('0x4'));var sox=require(_0x164b('0x5'));var csv=require('to-csv');var ejs=require(_0x164b('0x6'));var fs=require('fs');var fs_extra=require(_0x164b('0x7'));var _=require(_0x164b('0x8'));var squel=require(_0x164b('0x9'));var crypto=require('crypto');var jsforce=require(_0x164b('0xa'));var deskjs=require(_0x164b('0xb'));var toCsv=require(_0x164b('0xc'));var querystring=require(_0x164b('0xd'));var Papa=require('papaparse');var Redis=require(_0x164b('0xe'));var authService=require(_0x164b('0xf'));var qs=require(_0x164b('0x10'));var as=require(_0x164b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x164b('0x12'))(_0x164b('0x13'));var utils=require(_0x164b('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x164b('0x15'))['db'];var jayson=require(_0x164b('0x16'));var client=jayson[_0x164b('0x17')][_0x164b('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x32ac27,_0x3bbaba,_0x2acc53,_0x231ff0){return new BPromise(function(_0x1f9cfa,_0x1c72cc){var _0x1d1731=_0x231ff0||client;return _0x1d1731[_0x164b('0x19')](_0x32ac27,_0x2acc53)[_0x164b('0x1a')](function(_0x5db5ee){logger[_0x164b('0x1b')](_0x164b('0x1c'),_0x3bbaba,_0x164b('0x1d'));logger[_0x164b('0x1e')](_0x164b('0x1f'),_0x3bbaba,_0x164b('0x1d'),JSON[_0x164b('0x20')](_0x5db5ee));if(_0x5db5ee[_0x164b('0x21')]){if(_0x5db5ee[_0x164b('0x21')][_0x164b('0x22')]===0x1f4){logger[_0x164b('0x21')](_0x164b('0x1c'),_0x3bbaba,_0x5db5ee['error'][_0x164b('0x23')]);return _0x1c72cc(_0x5db5ee['error']['message']);}logger[_0x164b('0x21')](_0x164b('0x1c'),_0x3bbaba,_0x5db5ee[_0x164b('0x21')][_0x164b('0x23')]);return _0x1f9cfa(_0x5db5ee[_0x164b('0x21')][_0x164b('0x23')]);}else{logger[_0x164b('0x1b')](_0x164b('0x1c'),_0x3bbaba,_0x164b('0x1d'));_0x1f9cfa(_0x5db5ee[_0x164b('0x24')]['message']);}})['catch'](function(_0x1908e2){logger[_0x164b('0x21')](_0x164b('0x1c'),_0x3bbaba,_0x1908e2);_0x1c72cc(_0x1908e2);});});}function respondWithStatusCode(_0x28c3e3,_0x3d5c83){_0x3d5c83=_0x3d5c83||0xcc;return function(_0x47e989){if(_0x47e989){return _0x28c3e3['sendStatus'](_0x3d5c83);}return _0x28c3e3['status'](_0x3d5c83)[_0x164b('0x25')]();};}function respondWithResult(_0x568653,_0x36caa5){_0x36caa5=_0x36caa5||0xc8;return function(_0x24afb1){if(_0x24afb1){return _0x568653[_0x164b('0x26')](_0x36caa5)[_0x164b('0x27')](_0x24afb1);}};}function respondWithFilteredResult(_0x26c2f1,_0x36a7a0){return function(_0x430d67){if(_0x430d67){var _0x3fef9f=typeof _0x36a7a0[_0x164b('0x28')]===_0x164b('0x29')&&typeof _0x36a7a0[_0x164b('0x2a')]==='undefined';var _0xe09e2a=_0x430d67['count'];var _0x37b443=_0x3fef9f?0x0:_0x36a7a0['offset'];var _0x564c3f=_0x3fef9f?_0x430d67['count']:_0x36a7a0['offset']+_0x36a7a0[_0x164b('0x2a')];var _0x468d1f;if(_0x564c3f>=_0xe09e2a){_0x564c3f=_0xe09e2a;_0x468d1f=0xc8;}else{_0x468d1f=0xce;}_0x26c2f1[_0x164b('0x26')](_0x468d1f);return _0x26c2f1[_0x164b('0x2b')]('Content-Range',_0x37b443+'-'+_0x564c3f+'/'+_0xe09e2a)[_0x164b('0x27')](_0x430d67);}return null;};}function patchUpdates(_0xaa6a5b){return function(_0x5372b4){try{jsonpatch[_0x164b('0x2c')](_0x5372b4,_0xaa6a5b,!![]);}catch(_0x1ae8cb){return BPromise['reject'](_0x1ae8cb);}return _0x5372b4[_0x164b('0x2d')]();};}function saveUpdates(_0x357841,_0x445c54){return function(_0x45be57){if(_0x45be57){return _0x45be57['update'](_0x357841)[_0x164b('0x1a')](function(_0x3da76a){return _0x3da76a;});}return null;};}function removeEntity(_0x3cdec8,_0x1dc0bf){return function(_0x1bc01f){if(_0x1bc01f){return _0x1bc01f[_0x164b('0x2e')]()[_0x164b('0x1a')](function(){var _0x5ee9fa=_0x1bc01f['get']({'plain':!![]});var _0xaff4dc='Contexts';return db[_0x164b('0x2f')]['destroy']({'where':{'type':_0xaff4dc,'resourceId':_0x5ee9fa['id']}})[_0x164b('0x1a')](function(){return _0x1bc01f;});})[_0x164b('0x1a')](function(){_0x3cdec8[_0x164b('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25d684,_0x569812){return function(_0x4b4566){if(!_0x4b4566){_0x25d684['sendStatus'](0x194);}return _0x4b4566;};}function handleError(_0xd415a3,_0x486523){_0x486523=_0x486523||0x1f4;return function(_0x3c5ed3){logger[_0x164b('0x21')](_0x3c5ed3[_0x164b('0x30')]);if(_0x3c5ed3['name']){delete _0x3c5ed3[_0x164b('0x31')];}_0xd415a3[_0x164b('0x26')](_0x486523)['send'](_0x3c5ed3);};}exports['index']=function(_0x1e51de,_0x4c606a){var _0x1f81e1={},_0x4ecb6f={},_0x33f423={'count':0x0,'rows':[]};var _0x558a0a=_[_0x164b('0x32')](db['VoiceContext'][_0x164b('0x33')],function(_0xe8f1cd){return{'name':_0xe8f1cd['fieldName'],'type':_0xe8f1cd[_0x164b('0x34')]['key']};});_0x4ecb6f[_0x164b('0x35')]=_['map'](_0x558a0a,'name');_0x4ecb6f[_0x164b('0x36')]=_['keys'](_0x1e51de['query']);_0x4ecb6f[_0x164b('0x37')]=_[_0x164b('0x38')](_0x4ecb6f[_0x164b('0x35')],_0x4ecb6f[_0x164b('0x36')]);_0x1f81e1['attributes']=_[_0x164b('0x38')](_0x4ecb6f['model'],qs[_0x164b('0x39')](_0x1e51de[_0x164b('0x36')][_0x164b('0x39')]));_0x1f81e1[_0x164b('0x3a')]=_0x1f81e1['attributes'][_0x164b('0x3b')]?_0x1f81e1[_0x164b('0x3a')]:_0x4ecb6f[_0x164b('0x35')];if(!_0x1e51de[_0x164b('0x36')]['hasOwnProperty']('nolimit')){_0x1f81e1[_0x164b('0x2a')]=qs[_0x164b('0x2a')](_0x1e51de[_0x164b('0x36')]['limit']);_0x1f81e1[_0x164b('0x28')]=qs[_0x164b('0x28')](_0x1e51de['query']['offset']);}_0x1f81e1['order']=qs[_0x164b('0x3c')](_0x1e51de['query'][_0x164b('0x3c')]);_0x1f81e1[_0x164b('0x3d')]=qs[_0x164b('0x37')](_[_0x164b('0x3e')](_0x1e51de['query'],_0x4ecb6f[_0x164b('0x37')]),_0x558a0a);if(_0x1e51de['query'][_0x164b('0x3f')]){_0x1f81e1[_0x164b('0x3d')]=_[_0x164b('0x40')](_0x1f81e1['where'],{'$or':_[_0x164b('0x32')](_0x558a0a,function(_0x2d6c68){if(_0x2d6c68[_0x164b('0x34')]!==_0x164b('0x41')){var _0x24fcb1={};_0x24fcb1[_0x2d6c68[_0x164b('0x31')]]={'$like':'%'+_0x1e51de[_0x164b('0x36')][_0x164b('0x3f')]+'%'};return _0x24fcb1;}})});}_0x1f81e1=_[_0x164b('0x40')]({},_0x1f81e1,_0x1e51de[_0x164b('0x42')]);var _0x5f3861={'where':_0x1f81e1[_0x164b('0x3d')]};return db['VoiceContext'][_0x164b('0x43')](_0x5f3861)[_0x164b('0x1a')](function(_0x31da58){_0x33f423[_0x164b('0x43')]=_0x31da58;if(_0x1e51de[_0x164b('0x36')][_0x164b('0x44')]){_0x1f81e1[_0x164b('0x45')]=[{'all':!![]}];}return db[_0x164b('0x46')][_0x164b('0x47')](_0x1f81e1);})['then'](function(_0x21e43b){_0x33f423['rows']=_0x21e43b;return _0x33f423;})[_0x164b('0x1a')](respondWithFilteredResult(_0x4c606a,_0x1f81e1))[_0x164b('0x48')](handleError(_0x4c606a,null));};exports['show']=function(_0x43bb2e,_0x59cc4f){var _0x28bd5c={'raw':![],'where':{'id':_0x43bb2e[_0x164b('0x49')]['id']}},_0x2edbf3={};_0x2edbf3[_0x164b('0x35')]=_[_0x164b('0x4a')](db['VoiceContext'][_0x164b('0x33')]);_0x2edbf3[_0x164b('0x36')]=_[_0x164b('0x4a')](_0x43bb2e[_0x164b('0x36')]);_0x2edbf3[_0x164b('0x37')]=_['intersection'](_0x2edbf3[_0x164b('0x35')],_0x2edbf3[_0x164b('0x36')]);_0x28bd5c['attributes']=_[_0x164b('0x38')](_0x2edbf3['model'],qs['fields'](_0x43bb2e['query'][_0x164b('0x39')]));_0x28bd5c[_0x164b('0x3a')]=_0x28bd5c[_0x164b('0x3a')][_0x164b('0x3b')]?_0x28bd5c[_0x164b('0x3a')]:_0x2edbf3[_0x164b('0x35')];if(_0x43bb2e[_0x164b('0x36')][_0x164b('0x44')]){_0x28bd5c[_0x164b('0x45')]=[{'all':!![]}];}_0x28bd5c=_['merge']({},_0x28bd5c,_0x43bb2e[_0x164b('0x42')]);return db[_0x164b('0x46')][_0x164b('0x4b')](_0x28bd5c)[_0x164b('0x1a')](handleEntityNotFound(_0x59cc4f,null))[_0x164b('0x1a')](respondWithResult(_0x59cc4f,null))[_0x164b('0x48')](handleError(_0x59cc4f,null));};exports[_0x164b('0x4c')]=function(_0x1198ab,_0x4b7120,_0x4ff7f0){var _0x3da212;return db[_0x164b('0x46')]['create'](_0x1198ab[_0x164b('0x4d')],{'raw':!![]})['then'](function(_0x483169){_0x3da212=_0x483169;return db[_0x164b('0x46')][_0x164b('0x47')]({'raw':!![]});})[_0x164b('0x1a')](function(_0x3afbf0){var _0x36881a=fs[_0x164b('0x4e')](path[_0x164b('0x4f')](config['root'],'server/files/templates/context.ejs'),_0x164b('0x50'));var _0x2e903c=ejs[_0x164b('0x51')](_0x36881a,{'contexts':_0x3afbf0||[]});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x2e903c);})['then'](function(){return respondWithRpcPromise(_0x164b('0x52'),_0x164b('0x4c'),{'module':_0x164b('0x53')});})[_0x164b('0x1a')](function(){var _0x9c8628=_0x1198ab['user'][_0x164b('0x54')]({'plain':!![]});if(!_0x9c8628)throw new Error(_0x164b('0x55'));if(_0x9c8628[_0x164b('0x56')]===_0x164b('0x57')){var _0x5c050f=_0x3da212[_0x164b('0x54')]({'plain':!![]});return db[_0x164b('0x58')][_0x164b('0x4b')]({'where':{'name':_0x164b('0x59'),'userProfileId':_0x9c8628[_0x164b('0x5a')]},'raw':!![]})[_0x164b('0x1a')](function(_0x3b5f0b){if(_0x3b5f0b&&_0x3b5f0b[_0x164b('0x5b')]===0x0){return db[_0x164b('0x2f')]['create']({'name':_0x5c050f[_0x164b('0x31')],'resourceId':_0x5c050f['id'],'type':_0x3b5f0b[_0x164b('0x31')],'sectionId':_0x3b5f0b['id']},{})[_0x164b('0x1a')](function(){return _0x3da212;});}else{return _0x3da212;}})['catch'](function(_0x54e349){logger['error'](_0x164b('0x5c'),_0x54e349);throw _0x54e349;});}return _0x3da212;})['then'](respondWithResult(_0x4b7120,0xc9))[_0x164b('0x48')](handleError(_0x4b7120,null));};exports[_0x164b('0x5d')]=function(_0x2cc1d1,_0x17d428,_0x22b3a5){var _0x208028;return db['VoiceContext'][_0x164b('0x4b')]({'where':{'id':_0x2cc1d1[_0x164b('0x49')]['id']}})[_0x164b('0x1a')](handleEntityNotFound(_0x17d428,null))[_0x164b('0x1a')](saveUpdates(_0x2cc1d1[_0x164b('0x4d')],null))[_0x164b('0x1a')](function(_0x46e244){if(_0x46e244){_0x208028=_0x46e244;return db[_0x164b('0x46')][_0x164b('0x47')]({'raw':!![]});}})[_0x164b('0x1a')](function(_0xe0df00){var _0x251af2=fs[_0x164b('0x4e')](path[_0x164b('0x4f')](config['root'],_0x164b('0x5e')),_0x164b('0x50'));var _0x1b5919=ejs[_0x164b('0x51')](_0x251af2,{'contexts':_0xe0df00||[]});fs[_0x164b('0x5f')](_0x164b('0x60'),_0x1b5919);})[_0x164b('0x1a')](function(){return respondWithRpcPromise('Reload',_0x164b('0x5d'),{'module':_0x164b('0x53')});})[_0x164b('0x1a')](function(){return _0x208028;})[_0x164b('0x1a')](respondWithResult(_0x17d428,null))['catch'](handleError(_0x17d428,null));};exports[_0x164b('0x2e')]=function(_0x4cc187,_0x35ab63,_0x4eebe1){var _0x5c47cd;return db['VoiceContext'][_0x164b('0x4b')]({'where':{'id':_0x4cc187[_0x164b('0x49')]['id']}})[_0x164b('0x1a')](handleEntityNotFound(_0x35ab63,null))[_0x164b('0x1a')](removeEntity(_0x35ab63,null))['then'](function(){return db[_0x164b('0x46')]['findAll']({'raw':!![]});})[_0x164b('0x1a')](function(_0x7afd3d){var _0x22114b=fs[_0x164b('0x4e')](path[_0x164b('0x4f')](config[_0x164b('0x61')],_0x164b('0x5e')),_0x164b('0x50'));var _0x2f68b9=ejs[_0x164b('0x51')](_0x22114b,{'contexts':_0x7afd3d});fs[_0x164b('0x5f')](_0x164b('0x60'),_0x2f68b9);return respondWithRpcPromise('Reload','destroy',{'module':_0x164b('0x53')});})[_0x164b('0x48')](handleError(_0x35ab63,null));}; \ No newline at end of file +var _0xb000=['moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','VoiceContext,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','save','update','get','Contexts','destroy','stack','name','send','index','map','VoiceContext','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','rows','params','length','find','create','body','findAll','readFileSync','join','root','server/files/templates/context.ejs','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Reload','utf8','rimraf','fast-json-patch'];(function(_0x4a45b4,_0x59804f){var _0x1a99c9=function(_0x3aa517){while(--_0x3aa517){_0x4a45b4['push'](_0x4a45b4['shift']());}};_0x1a99c9(++_0x59804f);}(_0xb000,0x1ed));var _0x0b00=function(_0x4d521e,_0x58ba39){_0x4d521e=_0x4d521e-0x0;var _0x3beb42=_0xb000[_0x4d521e];return _0x3beb42;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0b00('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0b00('0x1'));var rp=require('request-promise');var moment=require(_0x0b00('0x2'));var BPromise=require(_0x0b00('0x3'));var Mustache=require(_0x0b00('0x4'));var util=require('util');var path=require(_0x0b00('0x5'));var sox=require(_0x0b00('0x6'));var csv=require(_0x0b00('0x7'));var ejs=require(_0x0b00('0x8'));var fs=require('fs');var fs_extra=require(_0x0b00('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0b00('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x0b00('0x7'));var querystring=require(_0x0b00('0xb'));var Papa=require(_0x0b00('0xc'));var Redis=require('ioredis');var authService=require(_0x0b00('0xd'));var qs=require(_0x0b00('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0b00('0xf'));var logger=require(_0x0b00('0x10'))(_0x0b00('0x11'));var utils=require(_0x0b00('0x12'));var config=require(_0x0b00('0x13'));var licenseUtil=require(_0x0b00('0x14'));var db=require(_0x0b00('0x15'))['db'];var jayson=require(_0x0b00('0x16'));var client=jayson[_0x0b00('0x17')][_0x0b00('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x4018da,_0x41db47,_0x23b690,_0x32c5a0){return new BPromise(function(_0x26629a,_0x186cc8){var _0x47dc71=_0x32c5a0||client;return _0x47dc71['request'](_0x4018da,_0x23b690)[_0x0b00('0x19')](function(_0x24342c){logger[_0x0b00('0x1a')]('VoiceContext,\x20%s,\x20%s',_0x41db47,_0x0b00('0x1b'));logger[_0x0b00('0x1c')](_0x0b00('0x1d'),_0x41db47,_0x0b00('0x1b'),JSON[_0x0b00('0x1e')](_0x24342c));if(_0x24342c['error']){if(_0x24342c[_0x0b00('0x1f')]['code']===0x1f4){logger[_0x0b00('0x1f')](_0x0b00('0x20'),_0x41db47,_0x24342c['error'][_0x0b00('0x21')]);return _0x186cc8(_0x24342c[_0x0b00('0x1f')][_0x0b00('0x21')]);}logger['error']('VoiceContext,\x20%s,\x20%s',_0x41db47,_0x24342c['error'][_0x0b00('0x21')]);return _0x26629a(_0x24342c['error'][_0x0b00('0x21')]);}else{logger[_0x0b00('0x1a')](_0x0b00('0x20'),_0x41db47,_0x0b00('0x1b'));_0x26629a(_0x24342c[_0x0b00('0x22')][_0x0b00('0x21')]);}})[_0x0b00('0x23')](function(_0x5e483f){logger[_0x0b00('0x1f')](_0x0b00('0x20'),_0x41db47,_0x5e483f);_0x186cc8(_0x5e483f);});});}function respondWithStatusCode(_0x5dca68,_0x579d0a){_0x579d0a=_0x579d0a||0xcc;return function(_0x2e805e){if(_0x2e805e){return _0x5dca68[_0x0b00('0x24')](_0x579d0a);}return _0x5dca68[_0x0b00('0x25')](_0x579d0a)[_0x0b00('0x26')]();};}function respondWithResult(_0x1150ed,_0x10af30){_0x10af30=_0x10af30||0xc8;return function(_0x3d68f0){if(_0x3d68f0){return _0x1150ed[_0x0b00('0x25')](_0x10af30)[_0x0b00('0x27')](_0x3d68f0);}};}function respondWithFilteredResult(_0x10944f,_0x1e6963){return function(_0x1c64d5){if(_0x1c64d5){var _0x4cc42a=typeof _0x1e6963['offset']===_0x0b00('0x28')&&typeof _0x1e6963[_0x0b00('0x29')]==='undefined';var _0xb5a3b0=_0x1c64d5[_0x0b00('0x2a')];var _0x1c2d6c=_0x4cc42a?0x0:_0x1e6963[_0x0b00('0x2b')];var _0x259880=_0x4cc42a?_0x1c64d5[_0x0b00('0x2a')]:_0x1e6963[_0x0b00('0x2b')]+_0x1e6963[_0x0b00('0x29')];var _0x1507e5;if(_0x259880>=_0xb5a3b0){_0x259880=_0xb5a3b0;_0x1507e5=0xc8;}else{_0x1507e5=0xce;}_0x10944f[_0x0b00('0x25')](_0x1507e5);return _0x10944f[_0x0b00('0x2c')]('Content-Range',_0x1c2d6c+'-'+_0x259880+'/'+_0xb5a3b0)['json'](_0x1c64d5);}return null;};}function patchUpdates(_0x3a38aa){return function(_0x33148a){try{jsonpatch[_0x0b00('0x2d')](_0x33148a,_0x3a38aa,!![]);}catch(_0x5c613c){return BPromise['reject'](_0x5c613c);}return _0x33148a[_0x0b00('0x2e')]();};}function saveUpdates(_0x4d4d9e,_0x4bb4c9){return function(_0x4eabb1){if(_0x4eabb1){return _0x4eabb1[_0x0b00('0x2f')](_0x4d4d9e)[_0x0b00('0x19')](function(_0x27176c){return _0x27176c;});}return null;};}function removeEntity(_0x306133,_0x387086){return function(_0x1f230d){if(_0x1f230d){return _0x1f230d['destroy']()[_0x0b00('0x19')](function(){var _0x10b6dd=_0x1f230d[_0x0b00('0x30')]({'plain':!![]});var _0x1ae5d5=_0x0b00('0x31');return db['UserProfileResource'][_0x0b00('0x32')]({'where':{'type':_0x1ae5d5,'resourceId':_0x10b6dd['id']}})[_0x0b00('0x19')](function(){return _0x1f230d;});})[_0x0b00('0x19')](function(){_0x306133[_0x0b00('0x25')](0xcc)[_0x0b00('0x26')]();});}};}function handleEntityNotFound(_0x1a6108,_0x1f1a75){return function(_0x2add9a){if(!_0x2add9a){_0x1a6108[_0x0b00('0x24')](0x194);}return _0x2add9a;};}function handleError(_0x3bab20,_0x1b3977){_0x1b3977=_0x1b3977||0x1f4;return function(_0x1d82c2){logger[_0x0b00('0x1f')](_0x1d82c2[_0x0b00('0x33')]);if(_0x1d82c2['name']){delete _0x1d82c2[_0x0b00('0x34')];}_0x3bab20['status'](_0x1b3977)[_0x0b00('0x35')](_0x1d82c2);};}exports[_0x0b00('0x36')]=function(_0x2b91ea,_0x3a8d0f){var _0x34d5d9={},_0x19e76b={},_0x4f9102={'count':0x0,'rows':[]};var _0x51c608=_[_0x0b00('0x37')](db[_0x0b00('0x38')][_0x0b00('0x39')],function(_0xf5d525){return{'name':_0xf5d525[_0x0b00('0x3a')],'type':_0xf5d525[_0x0b00('0x3b')][_0x0b00('0x3c')]};});_0x19e76b[_0x0b00('0x3d')]=_[_0x0b00('0x37')](_0x51c608,_0x0b00('0x34'));_0x19e76b[_0x0b00('0x3e')]=_[_0x0b00('0x3f')](_0x2b91ea[_0x0b00('0x3e')]);_0x19e76b[_0x0b00('0x40')]=_[_0x0b00('0x41')](_0x19e76b['model'],_0x19e76b[_0x0b00('0x3e')]);_0x34d5d9[_0x0b00('0x42')]=_[_0x0b00('0x41')](_0x19e76b['model'],qs[_0x0b00('0x43')](_0x2b91ea[_0x0b00('0x3e')][_0x0b00('0x43')]));_0x34d5d9[_0x0b00('0x42')]=_0x34d5d9[_0x0b00('0x42')]['length']?_0x34d5d9['attributes']:_0x19e76b[_0x0b00('0x3d')];if(!_0x2b91ea[_0x0b00('0x3e')][_0x0b00('0x44')]('nolimit')){_0x34d5d9['limit']=qs[_0x0b00('0x29')](_0x2b91ea[_0x0b00('0x3e')][_0x0b00('0x29')]);_0x34d5d9[_0x0b00('0x2b')]=qs[_0x0b00('0x2b')](_0x2b91ea[_0x0b00('0x3e')]['offset']);}_0x34d5d9[_0x0b00('0x45')]=qs[_0x0b00('0x46')](_0x2b91ea['query'][_0x0b00('0x46')]);_0x34d5d9[_0x0b00('0x47')]=qs[_0x0b00('0x40')](_['pick'](_0x2b91ea[_0x0b00('0x3e')],_0x19e76b[_0x0b00('0x40')]),_0x51c608);if(_0x2b91ea['query'][_0x0b00('0x48')]){_0x34d5d9[_0x0b00('0x47')]=_[_0x0b00('0x49')](_0x34d5d9[_0x0b00('0x47')],{'$or':_[_0x0b00('0x37')](_0x51c608,function(_0x4d8a0e){if(_0x4d8a0e[_0x0b00('0x3b')]!==_0x0b00('0x4a')){var _0x5c7811={};_0x5c7811[_0x4d8a0e[_0x0b00('0x34')]]={'$like':'%'+_0x2b91ea[_0x0b00('0x3e')]['filter']+'%'};return _0x5c7811;}})});}_0x34d5d9=_[_0x0b00('0x49')]({},_0x34d5d9,_0x2b91ea[_0x0b00('0x4b')]);var _0x2676cb={'where':_0x34d5d9[_0x0b00('0x47')]};return db[_0x0b00('0x38')]['count'](_0x2676cb)[_0x0b00('0x19')](function(_0x1f44e9){_0x4f9102[_0x0b00('0x2a')]=_0x1f44e9;if(_0x2b91ea[_0x0b00('0x3e')][_0x0b00('0x4c')]){_0x34d5d9['include']=[{'all':!![]}];}return db[_0x0b00('0x38')]['findAll'](_0x34d5d9);})[_0x0b00('0x19')](function(_0x19e1ca){_0x4f9102[_0x0b00('0x4d')]=_0x19e1ca;return _0x4f9102;})[_0x0b00('0x19')](respondWithFilteredResult(_0x3a8d0f,_0x34d5d9))[_0x0b00('0x23')](handleError(_0x3a8d0f,null));};exports['show']=function(_0xb49c6f,_0x12ee54){var _0x2c9155={'raw':![],'where':{'id':_0xb49c6f[_0x0b00('0x4e')]['id']}},_0xe11c6e={};_0xe11c6e[_0x0b00('0x3d')]=_[_0x0b00('0x3f')](db[_0x0b00('0x38')][_0x0b00('0x39')]);_0xe11c6e[_0x0b00('0x3e')]=_['keys'](_0xb49c6f[_0x0b00('0x3e')]);_0xe11c6e[_0x0b00('0x40')]=_[_0x0b00('0x41')](_0xe11c6e[_0x0b00('0x3d')],_0xe11c6e[_0x0b00('0x3e')]);_0x2c9155[_0x0b00('0x42')]=_[_0x0b00('0x41')](_0xe11c6e['model'],qs[_0x0b00('0x43')](_0xb49c6f[_0x0b00('0x3e')][_0x0b00('0x43')]));_0x2c9155[_0x0b00('0x42')]=_0x2c9155['attributes'][_0x0b00('0x4f')]?_0x2c9155[_0x0b00('0x42')]:_0xe11c6e[_0x0b00('0x3d')];if(_0xb49c6f[_0x0b00('0x3e')][_0x0b00('0x4c')]){_0x2c9155['include']=[{'all':!![]}];}_0x2c9155=_[_0x0b00('0x49')]({},_0x2c9155,_0xb49c6f[_0x0b00('0x4b')]);return db[_0x0b00('0x38')][_0x0b00('0x50')](_0x2c9155)[_0x0b00('0x19')](handleEntityNotFound(_0x12ee54,null))['then'](respondWithResult(_0x12ee54,null))[_0x0b00('0x23')](handleError(_0x12ee54,null));};exports[_0x0b00('0x51')]=function(_0x262b15,_0x5d3150,_0x16c4cc){var _0x431b2d;return db[_0x0b00('0x38')][_0x0b00('0x51')](_0x262b15[_0x0b00('0x52')],{'raw':!![]})[_0x0b00('0x19')](function(_0x8dd9ea){_0x431b2d=_0x8dd9ea;return db['VoiceContext'][_0x0b00('0x53')]({'raw':!![]});})['then'](function(_0x48dd09){var _0x59065b=fs[_0x0b00('0x54')](path[_0x0b00('0x55')](config[_0x0b00('0x56')],_0x0b00('0x57')),'utf8');var _0x168282=ejs[_0x0b00('0x58')](_0x59065b,{'contexts':_0x48dd09||[]});fs[_0x0b00('0x59')](_0x0b00('0x5a'),_0x168282);})[_0x0b00('0x19')](function(){return respondWithRpcPromise('Reload',_0x0b00('0x51'),{'module':_0x0b00('0x5b')});})[_0x0b00('0x19')](function(){var _0x191fa0=_0x262b15[_0x0b00('0x5c')]['get']({'plain':!![]});if(!_0x191fa0)throw new Error(_0x0b00('0x5d'));if(_0x191fa0['role']===_0x0b00('0x5c')){var _0x20c13d=_0x431b2d[_0x0b00('0x30')]({'plain':!![]});return db['UserProfileSection'][_0x0b00('0x50')]({'where':{'name':'Contexts','userProfileId':_0x191fa0['userProfileId']},'raw':!![]})[_0x0b00('0x19')](function(_0x23314c){if(_0x23314c&&_0x23314c[_0x0b00('0x5e')]===0x0){return db[_0x0b00('0x5f')][_0x0b00('0x51')]({'name':_0x20c13d[_0x0b00('0x34')],'resourceId':_0x20c13d['id'],'type':_0x23314c[_0x0b00('0x34')],'sectionId':_0x23314c['id']},{})[_0x0b00('0x19')](function(){return _0x431b2d;});}else{return _0x431b2d;}})[_0x0b00('0x23')](function(_0x264604){logger[_0x0b00('0x1f')](_0x0b00('0x60'),_0x264604);throw _0x264604;});}return _0x431b2d;})[_0x0b00('0x19')](respondWithResult(_0x5d3150,0xc9))[_0x0b00('0x23')](handleError(_0x5d3150,null));};exports[_0x0b00('0x2f')]=function(_0x313296,_0x5e14a9,_0x40ac5d){var _0x55e611;return db[_0x0b00('0x38')][_0x0b00('0x50')]({'where':{'id':_0x313296[_0x0b00('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5e14a9,null))['then'](saveUpdates(_0x313296[_0x0b00('0x52')],null))['then'](function(_0x2a606a){if(_0x2a606a){_0x55e611=_0x2a606a;return db[_0x0b00('0x38')][_0x0b00('0x53')]({'raw':!![]});}})[_0x0b00('0x19')](function(_0x55e661){var _0x48a8b9=fs[_0x0b00('0x54')](path[_0x0b00('0x55')](config[_0x0b00('0x56')],_0x0b00('0x57')),'utf8');var _0x49a05a=ejs[_0x0b00('0x58')](_0x48a8b9,{'contexts':_0x55e661||[]});fs[_0x0b00('0x59')](_0x0b00('0x5a'),_0x49a05a);})[_0x0b00('0x19')](function(){return respondWithRpcPromise(_0x0b00('0x61'),_0x0b00('0x2f'),{'module':_0x0b00('0x5b')});})[_0x0b00('0x19')](function(){return _0x55e611;})[_0x0b00('0x19')](respondWithResult(_0x5e14a9,null))[_0x0b00('0x23')](handleError(_0x5e14a9,null));};exports[_0x0b00('0x32')]=function(_0x41f562,_0x5b8e40,_0x16034f){var _0x3b2391;return db['VoiceContext'][_0x0b00('0x50')]({'where':{'id':_0x41f562[_0x0b00('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5b8e40,null))[_0x0b00('0x19')](removeEntity(_0x5b8e40,null))['then'](function(){return db['VoiceContext'][_0x0b00('0x53')]({'raw':!![]});})['then'](function(_0x44c038){var _0x1eda67=fs[_0x0b00('0x54')](path[_0x0b00('0x55')](config[_0x0b00('0x56')],_0x0b00('0x57')),_0x0b00('0x62'));var _0x247be4=ejs[_0x0b00('0x58')](_0x1eda67,{'contexts':_0x44c038});fs['writeFileSync'](_0x0b00('0x5a'),_0x247be4);return respondWithRpcPromise('Reload',_0x0b00('0x32'),{'module':_0x0b00('0x5b')});})[_0x0b00('0x23')](handleError(_0x5b8e40,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 22844bc..74265dd 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 _0xc19f=['rimraf','../../config/environment','./voiceContext.attributes','exports','voice_contexts','../../config/logger','api','request-promise','path'];(function(_0x3b2f10,_0x34dc5f){var _0x563d79=function(_0x5ab05a){while(--_0x5ab05a){_0x3b2f10['push'](_0x3b2f10['shift']());}};_0x563d79(++_0x34dc5f);}(_0xc19f,0x164));var _0xfc19=function(_0x4684bd,_0x188bb7){_0x4684bd=_0x4684bd-0x0;var _0x4866c7=_0xc19f[_0x4684bd];return _0x4866c7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfc19('0x0'))(_0xfc19('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfc19('0x2'));var fs=require('fs');var path=require(_0xfc19('0x3'));var rimraf=require(_0xfc19('0x4'));var config=require(_0xfc19('0x5'));var attributes=require(_0xfc19('0x6'));module[_0xfc19('0x7')]=function(_0x3ca66e,_0x56332d){return _0x3ca66e['define']('VoiceContext',attributes,{'tableName':_0xfc19('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3289=['api','moment','request-promise','path','../../config/environment','./voiceContext.attributes','define','VoiceContext','voice_contexts','util','../../config/logger'];(function(_0xa73b26,_0x5b7718){var _0x219726=function(_0x5aa615){while(--_0x5aa615){_0xa73b26['push'](_0xa73b26['shift']());}};_0x219726(++_0x5b7718);}(_0x3289,0xcf));var _0x9328=function(_0xe9797d,_0x5eb0a6){_0xe9797d=_0xe9797d-0x0;var _0x17ce4f=_0x3289[_0xe9797d];return _0x17ce4f;};'use strict';var _=require('lodash');var util=require(_0x9328('0x0'));var logger=require(_0x9328('0x1'))(_0x9328('0x2'));var moment=require(_0x9328('0x3'));var BPromise=require('bluebird');var rp=require(_0x9328('0x4'));var fs=require('fs');var path=require(_0x9328('0x5'));var rimraf=require('rimraf');var config=require(_0x9328('0x6'));var attributes=require(_0x9328('0x7'));module['exports']=function(_0x415748,_0x1208fc){return _0x415748[_0x9328('0x8')](_0x9328('0x9'),attributes,{'tableName':_0x9328('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index d1aeab1..8468bde 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 _0xcabe=['http','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client'];(function(_0x222541,_0x19102c){var _0x549ea4=function(_0x3b8d5f){while(--_0x3b8d5f){_0x222541['push'](_0x222541['shift']());}};_0x549ea4(++_0x19102c);}(_0xcabe,0x1ef));var _0xecab=function(_0x13e30b,_0x57c39a){_0x13e30b=_0x13e30b-0x0;var _0x576f07=_0xcabe[_0x13e30b];return _0x576f07;};'use strict';var _=require(_0xecab('0x0'));var util=require('util');var moment=require(_0xecab('0x1'));var BPromise=require(_0xecab('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xecab('0x3'));var db=require(_0xecab('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xecab('0x5'))(_0xecab('0x6'));var config=require(_0xecab('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xecab('0x8')][_0xecab('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x105562,_0xbfa4bf,_0x1ead3d){return new BPromise(function(_0x2bd7c7,_0x88f839){return client[_0xecab('0xa')](_0x105562,_0x1ead3d)[_0xecab('0xb')](function(_0x5f2db6){logger['info'](_0xecab('0xc'),_0xbfa4bf,_0xecab('0xd'));logger['debug'](_0xecab('0xe'),_0xbfa4bf,_0xecab('0xd'),JSON[_0xecab('0xf')](_0x5f2db6));if(_0x5f2db6[_0xecab('0x10')]){if(_0x5f2db6[_0xecab('0x10')][_0xecab('0x11')]===0x1f4){logger['error'](_0xecab('0xc'),_0xbfa4bf,_0x5f2db6[_0xecab('0x10')][_0xecab('0x12')]);return _0x88f839(_0x5f2db6[_0xecab('0x10')][_0xecab('0x12')]);}logger[_0xecab('0x10')]('VoiceContext,\x20%s,\x20%s',_0xbfa4bf,_0x5f2db6[_0xecab('0x10')]['message']);return _0x2bd7c7(_0x5f2db6['error'][_0xecab('0x12')]);}else{logger[_0xecab('0x13')](_0xecab('0xc'),_0xbfa4bf,_0xecab('0xd'));_0x2bd7c7(_0x5f2db6['result'][_0xecab('0x12')]);}})[_0xecab('0x14')](function(_0x260a09){logger[_0xecab('0x10')](_0xecab('0xc'),_0xbfa4bf,_0x260a09);_0x88f839(_0x260a09);});});} \ No newline at end of file +var _0xe0dd=['../../config/utils','../../config/logger','jayson/promise','client','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xe0dd,0x163));var _0xde0d=function(_0x1a8bbc,_0x17a086){_0x1a8bbc=_0x1a8bbc-0x0;var _0x212fc2=_0xe0dd[_0x1a8bbc];return _0x212fc2;};'use strict';var _=require(_0xde0d('0x0'));var util=require(_0xde0d('0x1'));var moment=require('moment');var BPromise=require(_0xde0d('0x2'));var rs=require(_0xde0d('0x3'));var fs=require('fs');var Redis=require(_0xde0d('0x4'));var db=require(_0xde0d('0x5'))['db'];var utils=require(_0xde0d('0x6'));var logger=require(_0xde0d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xde0d('0x8'));var client=jayson[_0xde0d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x323200,_0x3ce23c,_0x33a644){return new BPromise(function(_0x570b78,_0x25f0fe){return client['request'](_0x323200,_0x33a644)[_0xde0d('0xa')](function(_0x5e6588){logger[_0xde0d('0xb')](_0xde0d('0xc'),_0x3ce23c,_0xde0d('0xd'));logger['debug']('VoiceContext,\x20%s,\x20%s,\x20%s',_0x3ce23c,'request\x20sent',JSON[_0xde0d('0xe')](_0x5e6588));if(_0x5e6588[_0xde0d('0xf')]){if(_0x5e6588[_0xde0d('0xf')]['code']===0x1f4){logger[_0xde0d('0xf')](_0xde0d('0xc'),_0x3ce23c,_0x5e6588['error'][_0xde0d('0x10')]);return _0x25f0fe(_0x5e6588[_0xde0d('0xf')][_0xde0d('0x10')]);}logger[_0xde0d('0xf')](_0xde0d('0xc'),_0x3ce23c,_0x5e6588['error'][_0xde0d('0x10')]);return _0x570b78(_0x5e6588['error'][_0xde0d('0x10')]);}else{logger['info'](_0xde0d('0xc'),_0x3ce23c,'request\x20sent');_0x570b78(_0x5e6588[_0xde0d('0x11')][_0xde0d('0x10')]);}})[_0xde0d('0x12')](function(_0x228666){logger[_0xde0d('0xf')](_0xde0d('0xc'),_0x3ce23c,_0x228666);_0x25f0fe(_0x228666);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 4f013e5..48a5d2d 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 _0xa122=['show','create','put','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x588e07,_0x31e982){var _0x271f34=function(_0x5c3a75){while(--_0x5c3a75){_0x588e07['push'](_0x588e07['shift']());}};_0x271f34(++_0x31e982);}(_0xa122,0x17b));var _0x2a12=function(_0x4cab24,_0x541e1b){_0x4cab24=_0x4cab24-0x0;var _0x3b836d=_0xa122[_0x4cab24];return _0x3b836d;};'use strict';var multer=require(_0x2a12('0x0'));var util=require(_0x2a12('0x1'));var path=require(_0x2a12('0x2'));var timeout=require(_0x2a12('0x3'));var express=require(_0x2a12('0x4'));var router=express[_0x2a12('0x5')]();var fs_extra=require(_0x2a12('0x6'));var auth=require(_0x2a12('0x7'));var interaction=require(_0x2a12('0x8'));var config=require(_0x2a12('0x9'));var controller=require(_0x2a12('0xa'));router[_0x2a12('0xb')]('/',auth[_0x2a12('0xc')](),controller[_0x2a12('0xd')]);router[_0x2a12('0xb')](_0x2a12('0xe'),auth[_0x2a12('0xc')](),controller[_0x2a12('0xf')]);router[_0x2a12('0xb')](_0x2a12('0x10'),auth[_0x2a12('0xc')](),controller[_0x2a12('0x11')]);router['post']('/',auth[_0x2a12('0xc')](),controller[_0x2a12('0x12')]);router[_0x2a12('0x13')](_0x2a12('0x10'),auth[_0x2a12('0xc')](),controller['update']);router[_0x2a12('0x14')]('/:id',auth[_0x2a12('0xc')](),controller[_0x2a12('0x15')]);module['exports']=router; \ No newline at end of file +var _0x9034=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','post','create','/:id','update','delete','destroy','exports','multer','path'];(function(_0x22f33b,_0x291308){var _0x2d63e7=function(_0x1007c6){while(--_0x1007c6){_0x22f33b['push'](_0x22f33b['shift']());}};_0x2d63e7(++_0x291308);}(_0x9034,0x178));var _0x4903=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9034[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x4903('0x0'));var util=require('util');var path=require(_0x4903('0x1'));var timeout=require(_0x4903('0x2'));var express=require(_0x4903('0x3'));var router=express[_0x4903('0x4')]();var fs_extra=require(_0x4903('0x5'));var auth=require(_0x4903('0x6'));var interaction=require(_0x4903('0x7'));var config=require('../../config/environment');var controller=require(_0x4903('0x8'));router[_0x4903('0x9')]('/',auth[_0x4903('0xa')](),controller[_0x4903('0xb')]);router[_0x4903('0x9')](_0x4903('0xc'),auth['isAuthenticated'](),controller[_0x4903('0xd')]);router['get']('/:id',auth[_0x4903('0xa')](),controller['show']);router[_0x4903('0xe')]('/',auth[_0x4903('0xa')](),controller[_0x4903('0xf')]);router['put'](_0x4903('0x10'),auth[_0x4903('0xa')](),controller[_0x4903('0x11')]);router[_0x4903('0x12')](_0x4903('0x10'),auth[_0x4903('0xa')](),controller[_0x4903('0x13')]);module[_0x4903('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 1cff543..8e36e31 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 _0xedd9=['DATE','called,connect,complete','exports','STRING','INTEGER'];(function(_0x3f1995,_0x412249){var _0x146c2f=function(_0x286a38){while(--_0x286a38){_0x3f1995['push'](_0x3f1995['shift']());}};_0x146c2f(++_0x412249);}(_0xedd9,0xfc));var _0x9edd=function(_0x2544bb,_0x3df4ea){_0x2544bb=_0x2544bb-0x0;var _0x393aea=_0xedd9[_0x2544bb];return _0x393aea;};'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 +var _0x008c=['INTEGER','DATE','sequelize','exports','STRING'];(function(_0x16c96c,_0x34e82a){var _0x51cc58=function(_0x519d95){while(--_0x519d95){_0x16c96c['push'](_0x16c96c['shift']());}};_0x51cc58(++_0x34e82a);}(_0x008c,0x188));var _0xc008=function(_0x2f2ff5,_0x352b1c){_0x2f2ff5=_0x2f2ff5-0x0;var _0x1df50c=_0x008c[_0x2f2ff5];return _0x1df50c;};'use strict';var Sequelize=require(_0xc008('0x0'));module[_0xc008('0x1')]={'privilege':{'type':Sequelize[_0xc008('0x2')]},'channel':{'type':Sequelize[_0xc008('0x2')]},'channelstate':{'type':Sequelize[_0xc008('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xc008('0x2')]},'calleridname':{'type':Sequelize[_0xc008('0x2')]},'connectedlinenum':{'type':Sequelize[_0xc008('0x2')]},'connectedlinename':{'type':Sequelize[_0xc008('0x2')]},'language':{'type':Sequelize[_0xc008('0x2')]},'accountcode':{'type':Sequelize[_0xc008('0x2')]},'context':{'type':Sequelize[_0xc008('0x2')]},'exten':{'type':Sequelize[_0xc008('0x2')]},'priority':{'type':Sequelize[_0xc008('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xc008('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xc008('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xc008('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xc008('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xc008('0x2')]},'destexten':{'type':Sequelize[_0xc008('0x2')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xc008('0x2')]},'destlinkedid':{'type':Sequelize[_0xc008('0x2')]},'dialstring':{'type':Sequelize[_0xc008('0x2')]},'dialstatus':{'type':Sequelize[_0xc008('0x2')]},'starttime':{'type':Sequelize[_0xc008('0x4')]},'answertime':{'type':Sequelize[_0xc008('0x4')]},'endtime':{'type':Sequelize[_0xc008('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xc008('0x3')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xc008('0x3')]},'billableseconds':{'type':Sequelize[_0xc008('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 723e759..6746b67 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 _0xd214=['mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','reject','save','update','then','destroy','error','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','length','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x43f809,_0x4846fa){var _0x46eff6=function(_0x400841){while(--_0x400841){_0x43f809['push'](_0x43f809['shift']());}};_0x46eff6(++_0x4846fa);}(_0xd214,0x172));var _0x4d21=function(_0x3554de,_0x1c1680){_0x3554de=_0x3554de-0x0;var _0x469d4b=_0xd214[_0x3554de];return _0x469d4b;};'use strict';var emlformat=require(_0x4d21('0x0'));var rimraf=require(_0x4d21('0x1'));var zipdir=require(_0x4d21('0x2'));var jsonpatch=require(_0x4d21('0x3'));var rp=require(_0x4d21('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4d21('0x5'));var util=require(_0x4d21('0x6'));var path=require(_0x4d21('0x7'));var sox=require(_0x4d21('0x8'));var csv=require(_0x4d21('0x9'));var ejs=require(_0x4d21('0xa'));var fs=require('fs');var fs_extra=require(_0x4d21('0xb'));var _=require(_0x4d21('0xc'));var squel=require(_0x4d21('0xd'));var crypto=require(_0x4d21('0xe'));var jsforce=require(_0x4d21('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4d21('0x10'));var Papa=require(_0x4d21('0x11'));var Redis=require('ioredis');var authService=require(_0x4d21('0x12'));var qs=require(_0x4d21('0x13'));var as=require(_0x4d21('0x14'));var hardwareService=require(_0x4d21('0x15'));var logger=require('../../config/logger')(_0x4d21('0x16'));var utils=require(_0x4d21('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4d21('0x18'));var db=require(_0x4d21('0x19'))['db'];function respondWithStatusCode(_0x5120b7,_0xb44f0b){_0xb44f0b=_0xb44f0b||0xcc;return function(_0x32faee){if(_0x32faee){return _0x5120b7[_0x4d21('0x1a')](_0xb44f0b);}return _0x5120b7['status'](_0xb44f0b)[_0x4d21('0x1b')]();};}function respondWithResult(_0x2f1786,_0x55c27b){_0x55c27b=_0x55c27b||0xc8;return function(_0x4f212e){if(_0x4f212e){return _0x2f1786[_0x4d21('0x1c')](_0x55c27b)['json'](_0x4f212e);}};}function respondWithFilteredResult(_0x30eb2c,_0x3bb4b0){return function(_0x3c9e81){if(_0x3c9e81){var _0x274236=typeof _0x3bb4b0['offset']===_0x4d21('0x1d')&&typeof _0x3bb4b0[_0x4d21('0x1e')]==='undefined';var _0x1c1d4a=_0x3c9e81[_0x4d21('0x1f')];var _0x91f38e=_0x274236?0x0:_0x3bb4b0['offset'];var _0x276ce4=_0x274236?_0x3c9e81[_0x4d21('0x1f')]:_0x3bb4b0[_0x4d21('0x20')]+_0x3bb4b0[_0x4d21('0x1e')];var _0x1caa98;if(_0x276ce4>=_0x1c1d4a){_0x276ce4=_0x1c1d4a;_0x1caa98=0xc8;}else{_0x1caa98=0xce;}_0x30eb2c[_0x4d21('0x1c')](_0x1caa98);return _0x30eb2c[_0x4d21('0x21')](_0x4d21('0x22'),_0x91f38e+'-'+_0x276ce4+'/'+_0x1c1d4a)[_0x4d21('0x23')](_0x3c9e81);}return null;};}function patchUpdates(_0x2aa4da){return function(_0x59583f){try{jsonpatch['apply'](_0x59583f,_0x2aa4da,!![]);}catch(_0x1f7388){return BPromise[_0x4d21('0x24')](_0x1f7388);}return _0x59583f[_0x4d21('0x25')]();};}function saveUpdates(_0x529854,_0x285396){return function(_0x595bcc){if(_0x595bcc){return _0x595bcc[_0x4d21('0x26')](_0x529854)[_0x4d21('0x27')](function(_0x3a76bf){return _0x3a76bf;});}return null;};}function removeEntity(_0x2efd59,_0x3185a6){return function(_0x1fa61d){if(_0x1fa61d){return _0x1fa61d[_0x4d21('0x28')]()[_0x4d21('0x27')](function(){_0x2efd59[_0x4d21('0x1c')](0xcc)[_0x4d21('0x1b')]();});}};}function handleEntityNotFound(_0x584f7f,_0x190401){return function(_0x52ea92){if(!_0x52ea92){_0x584f7f[_0x4d21('0x1a')](0x194);}return _0x52ea92;};}function handleError(_0x1cf800,_0x4d812e){_0x4d812e=_0x4d812e||0x1f4;return function(_0x1ea54b){logger[_0x4d21('0x29')](_0x1ea54b['stack']);if(_0x1ea54b['name']){delete _0x1ea54b[_0x4d21('0x2a')];}_0x1cf800[_0x4d21('0x1c')](_0x4d812e)[_0x4d21('0x2b')](_0x1ea54b);};}exports[_0x4d21('0x2c')]=function(_0xb0c504,_0x4e5630){var _0x5d74ec={},_0x5c3fc8={},_0x488d52={'count':0x0,'rows':[]};var _0xbac832=_[_0x4d21('0x2d')](db[_0x4d21('0x2e')][_0x4d21('0x2f')],function(_0x29b45d){return{'name':_0x29b45d[_0x4d21('0x30')],'type':_0x29b45d['type'][_0x4d21('0x31')]};});_0x5c3fc8[_0x4d21('0x32')]=_[_0x4d21('0x2d')](_0xbac832,_0x4d21('0x2a'));_0x5c3fc8[_0x4d21('0x33')]=_[_0x4d21('0x34')](_0xb0c504[_0x4d21('0x33')]);_0x5c3fc8['filters']=_['intersection'](_0x5c3fc8['model'],_0x5c3fc8[_0x4d21('0x33')]);_0x5d74ec[_0x4d21('0x35')]=_[_0x4d21('0x36')](_0x5c3fc8[_0x4d21('0x32')],qs[_0x4d21('0x37')](_0xb0c504['query'][_0x4d21('0x37')]));_0x5d74ec['attributes']=_0x5d74ec[_0x4d21('0x35')][_0x4d21('0x38')]?_0x5d74ec['attributes']:_0x5c3fc8[_0x4d21('0x32')];if(!_0xb0c504[_0x4d21('0x33')]['hasOwnProperty']('nolimit')){_0x5d74ec[_0x4d21('0x1e')]=qs[_0x4d21('0x1e')](_0xb0c504[_0x4d21('0x33')][_0x4d21('0x1e')]);_0x5d74ec[_0x4d21('0x20')]=qs['offset'](_0xb0c504[_0x4d21('0x33')][_0x4d21('0x20')]);}_0x5d74ec[_0x4d21('0x39')]=qs[_0x4d21('0x3a')](_0xb0c504['query'][_0x4d21('0x3a')]);_0x5d74ec[_0x4d21('0x3b')]=qs[_0x4d21('0x3c')](_[_0x4d21('0x3d')](_0xb0c504[_0x4d21('0x33')],_0x5c3fc8[_0x4d21('0x3c')]),_0xbac832);if(_0xb0c504['query'][_0x4d21('0x3e')]){_0x5d74ec[_0x4d21('0x3b')]=_[_0x4d21('0x3f')](_0x5d74ec[_0x4d21('0x3b')],{'$or':_['map'](_0xbac832,function(_0x43af31){if(_0x43af31[_0x4d21('0x40')]!==_0x4d21('0x41')){var _0x1ec37e={};_0x1ec37e[_0x43af31[_0x4d21('0x2a')]]={'$like':'%'+_0xb0c504['query'][_0x4d21('0x3e')]+'%'};return _0x1ec37e;}})});}_0x5d74ec=_[_0x4d21('0x3f')]({},_0x5d74ec,_0xb0c504[_0x4d21('0x42')]);var _0x5881f0={'where':_0x5d74ec[_0x4d21('0x3b')]};return db[_0x4d21('0x2e')][_0x4d21('0x1f')](_0x5881f0)[_0x4d21('0x27')](function(_0x5d1a37){_0x488d52[_0x4d21('0x1f')]=_0x5d1a37;if(_0xb0c504[_0x4d21('0x33')][_0x4d21('0x43')]){_0x5d74ec['include']=[{'all':!![]}];}return db[_0x4d21('0x2e')][_0x4d21('0x44')](_0x5d74ec);})[_0x4d21('0x27')](function(_0x332fa3){_0x488d52[_0x4d21('0x45')]=_0x332fa3;return _0x488d52;})['then'](respondWithFilteredResult(_0x4e5630,_0x5d74ec))[_0x4d21('0x46')](handleError(_0x4e5630,null));};exports['show']=function(_0x2a1f41,_0x29126e){var _0x284e55={'raw':!![],'where':{'id':_0x2a1f41[_0x4d21('0x47')]['id']}},_0x5024ce={};_0x5024ce[_0x4d21('0x32')]=_[_0x4d21('0x34')](db['VoiceDialReport'][_0x4d21('0x2f')]);_0x5024ce[_0x4d21('0x33')]=_['keys'](_0x2a1f41['query']);_0x5024ce[_0x4d21('0x3c')]=_[_0x4d21('0x36')](_0x5024ce[_0x4d21('0x32')],_0x5024ce[_0x4d21('0x33')]);_0x284e55[_0x4d21('0x35')]=_['intersection'](_0x5024ce[_0x4d21('0x32')],qs[_0x4d21('0x37')](_0x2a1f41[_0x4d21('0x33')]['fields']));_0x284e55[_0x4d21('0x35')]=_0x284e55['attributes']['length']?_0x284e55[_0x4d21('0x35')]:_0x5024ce[_0x4d21('0x32')];if(_0x2a1f41[_0x4d21('0x33')][_0x4d21('0x43')]){_0x284e55['include']=[{'all':!![]}];}_0x284e55=_[_0x4d21('0x3f')]({},_0x284e55,_0x2a1f41['options']);return db[_0x4d21('0x2e')][_0x4d21('0x48')](_0x284e55)[_0x4d21('0x27')](handleEntityNotFound(_0x29126e,null))[_0x4d21('0x27')](respondWithResult(_0x29126e,null))[_0x4d21('0x46')](handleError(_0x29126e,null));};exports[_0x4d21('0x49')]=function(_0x1713ed,_0x277de6){return db[_0x4d21('0x2e')][_0x4d21('0x49')](_0x1713ed['body'],{})[_0x4d21('0x27')](respondWithResult(_0x277de6,0xc9))[_0x4d21('0x46')](handleError(_0x277de6,null));};exports['update']=function(_0x23b3fd,_0x85ac65){if(_0x23b3fd[_0x4d21('0x4a')]['id']){delete _0x23b3fd[_0x4d21('0x4a')]['id'];}return db[_0x4d21('0x2e')]['find']({'where':{'id':_0x23b3fd[_0x4d21('0x47')]['id']}})[_0x4d21('0x27')](handleEntityNotFound(_0x85ac65,null))[_0x4d21('0x27')](saveUpdates(_0x23b3fd[_0x4d21('0x4a')],null))[_0x4d21('0x27')](respondWithResult(_0x85ac65,null))['catch'](handleError(_0x85ac65,null));};exports['destroy']=function(_0x4bd1be,_0x4877e8){return db[_0x4d21('0x2e')][_0x4d21('0x48')]({'where':{'id':_0x4bd1be[_0x4d21('0x47')]['id']}})['then'](handleEntityNotFound(_0x4877e8,null))[_0x4d21('0x27')](removeEntity(_0x4877e8,null))[_0x4d21('0x46')](handleError(_0x4877e8,null));};exports['describe']=function(_0x113fcf,_0x176acd){return db[_0x4d21('0x2e')]['describe']()[_0x4d21('0x27')](respondWithResult(_0x176acd,null))[_0x4d21('0x46')](handleError(_0x176acd,null));}; \ No newline at end of file +var _0x7a04=['map','rawAttributes','fieldName','key','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','VoiceDialReport','includeAll','include','findAll','rows','catch','params','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','count','limit','set','Content-Range','apply','save','update','then','sendStatus','error','stack','name','send'];(function(_0x378f5d,_0x9da6a2){var _0x457218=function(_0x2c13a1){while(--_0x2c13a1){_0x378f5d['push'](_0x378f5d['shift']());}};_0x457218(++_0x9da6a2);}(_0x7a04,0x14a));var _0x47a0=function(_0x3e8bf8,_0x4e76d6){_0x3e8bf8=_0x3e8bf8-0x0;var _0x3391ce=_0x7a04[_0x3e8bf8];return _0x3391ce;};'use strict';var emlformat=require(_0x47a0('0x0'));var rimraf=require(_0x47a0('0x1'));var zipdir=require(_0x47a0('0x2'));var jsonpatch=require(_0x47a0('0x3'));var rp=require(_0x47a0('0x4'));var moment=require('moment');var BPromise=require(_0x47a0('0x5'));var Mustache=require(_0x47a0('0x6'));var util=require('util');var path=require(_0x47a0('0x7'));var sox=require(_0x47a0('0x8'));var csv=require(_0x47a0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a0('0xa'));var _=require(_0x47a0('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x47a0('0xc'));var deskjs=require(_0x47a0('0xd'));var toCsv=require(_0x47a0('0x9'));var querystring=require('querystring');var Papa=require(_0x47a0('0xe'));var Redis=require(_0x47a0('0xf'));var authService=require(_0x47a0('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x47a0('0x11'));var hardwareService=require(_0x47a0('0x12'));var logger=require('../../config/logger')(_0x47a0('0x13'));var utils=require('../../config/utils');var config=require(_0x47a0('0x14'));var licenseUtil=require(_0x47a0('0x15'));var db=require(_0x47a0('0x16'))['db'];function respondWithStatusCode(_0x204f63,_0x40730f){_0x40730f=_0x40730f||0xcc;return function(_0x5cb32e){if(_0x5cb32e){return _0x204f63['sendStatus'](_0x40730f);}return _0x204f63['status'](_0x40730f)[_0x47a0('0x17')]();};}function respondWithResult(_0x55f734,_0x5938e7){_0x5938e7=_0x5938e7||0xc8;return function(_0x17ae43){if(_0x17ae43){return _0x55f734[_0x47a0('0x18')](_0x5938e7)[_0x47a0('0x19')](_0x17ae43);}};}function respondWithFilteredResult(_0x49e41e,_0x207fbb){return function(_0x21ee34){if(_0x21ee34){var _0x308066=typeof _0x207fbb[_0x47a0('0x1a')]==='undefined'&&typeof _0x207fbb['limit']==='undefined';var _0x1a57cc=_0x21ee34[_0x47a0('0x1b')];var _0x4a99ec=_0x308066?0x0:_0x207fbb[_0x47a0('0x1a')];var _0x2520f3=_0x308066?_0x21ee34['count']:_0x207fbb[_0x47a0('0x1a')]+_0x207fbb[_0x47a0('0x1c')];var _0x236e90;if(_0x2520f3>=_0x1a57cc){_0x2520f3=_0x1a57cc;_0x236e90=0xc8;}else{_0x236e90=0xce;}_0x49e41e[_0x47a0('0x18')](_0x236e90);return _0x49e41e[_0x47a0('0x1d')](_0x47a0('0x1e'),_0x4a99ec+'-'+_0x2520f3+'/'+_0x1a57cc)[_0x47a0('0x19')](_0x21ee34);}return null;};}function patchUpdates(_0x537d3f){return function(_0x4d6e1b){try{jsonpatch[_0x47a0('0x1f')](_0x4d6e1b,_0x537d3f,!![]);}catch(_0x51957f){return BPromise['reject'](_0x51957f);}return _0x4d6e1b[_0x47a0('0x20')]();};}function saveUpdates(_0x340e3c,_0x3f55f6){return function(_0x22d3f0){if(_0x22d3f0){return _0x22d3f0[_0x47a0('0x21')](_0x340e3c)[_0x47a0('0x22')](function(_0x22d86a){return _0x22d86a;});}return null;};}function removeEntity(_0x3d25e3,_0x1576f9){return function(_0x3ccabf){if(_0x3ccabf){return _0x3ccabf['destroy']()['then'](function(){_0x3d25e3[_0x47a0('0x18')](0xcc)[_0x47a0('0x17')]();});}};}function handleEntityNotFound(_0x262b3c,_0x55a1cc){return function(_0xc2a0a4){if(!_0xc2a0a4){_0x262b3c[_0x47a0('0x23')](0x194);}return _0xc2a0a4;};}function handleError(_0x54ab43,_0x176361){_0x176361=_0x176361||0x1f4;return function(_0x2341c2){logger[_0x47a0('0x24')](_0x2341c2[_0x47a0('0x25')]);if(_0x2341c2[_0x47a0('0x26')]){delete _0x2341c2['name'];}_0x54ab43[_0x47a0('0x18')](_0x176361)[_0x47a0('0x27')](_0x2341c2);};}exports['index']=function(_0x1015bd,_0x1b391f){var _0x37fc89={},_0x365050={},_0x4100a3={'count':0x0,'rows':[]};var _0x2880f1=_[_0x47a0('0x28')](db['VoiceDialReport'][_0x47a0('0x29')],function(_0x42ad2b){return{'name':_0x42ad2b[_0x47a0('0x2a')],'type':_0x42ad2b['type'][_0x47a0('0x2b')]};});_0x365050['model']=_[_0x47a0('0x28')](_0x2880f1,_0x47a0('0x26'));_0x365050['query']=_[_0x47a0('0x2c')](_0x1015bd['query']);_0x365050[_0x47a0('0x2d')]=_[_0x47a0('0x2e')](_0x365050[_0x47a0('0x2f')],_0x365050[_0x47a0('0x30')]);_0x37fc89[_0x47a0('0x31')]=_[_0x47a0('0x2e')](_0x365050[_0x47a0('0x2f')],qs['fields'](_0x1015bd[_0x47a0('0x30')][_0x47a0('0x32')]));_0x37fc89[_0x47a0('0x31')]=_0x37fc89[_0x47a0('0x31')][_0x47a0('0x33')]?_0x37fc89[_0x47a0('0x31')]:_0x365050[_0x47a0('0x2f')];if(!_0x1015bd[_0x47a0('0x30')][_0x47a0('0x34')](_0x47a0('0x35'))){_0x37fc89[_0x47a0('0x1c')]=qs[_0x47a0('0x1c')](_0x1015bd[_0x47a0('0x30')][_0x47a0('0x1c')]);_0x37fc89[_0x47a0('0x1a')]=qs['offset'](_0x1015bd[_0x47a0('0x30')][_0x47a0('0x1a')]);}_0x37fc89[_0x47a0('0x36')]=qs[_0x47a0('0x37')](_0x1015bd[_0x47a0('0x30')][_0x47a0('0x37')]);_0x37fc89['where']=qs[_0x47a0('0x2d')](_[_0x47a0('0x38')](_0x1015bd[_0x47a0('0x30')],_0x365050[_0x47a0('0x2d')]),_0x2880f1);if(_0x1015bd[_0x47a0('0x30')][_0x47a0('0x39')]){_0x37fc89[_0x47a0('0x3a')]=_[_0x47a0('0x3b')](_0x37fc89[_0x47a0('0x3a')],{'$or':_[_0x47a0('0x28')](_0x2880f1,function(_0x79ee80){if(_0x79ee80[_0x47a0('0x3c')]!==_0x47a0('0x3d')){var _0x3b3dd1={};_0x3b3dd1[_0x79ee80[_0x47a0('0x26')]]={'$like':'%'+_0x1015bd[_0x47a0('0x30')]['filter']+'%'};return _0x3b3dd1;}})});}_0x37fc89=_['merge']({},_0x37fc89,_0x1015bd[_0x47a0('0x3e')]);var _0x1eae67={'where':_0x37fc89['where']};return db[_0x47a0('0x3f')][_0x47a0('0x1b')](_0x1eae67)[_0x47a0('0x22')](function(_0x3a89b0){_0x4100a3[_0x47a0('0x1b')]=_0x3a89b0;if(_0x1015bd[_0x47a0('0x30')][_0x47a0('0x40')]){_0x37fc89[_0x47a0('0x41')]=[{'all':!![]}];}return db['VoiceDialReport'][_0x47a0('0x42')](_0x37fc89);})[_0x47a0('0x22')](function(_0x54728e){_0x4100a3[_0x47a0('0x43')]=_0x54728e;return _0x4100a3;})[_0x47a0('0x22')](respondWithFilteredResult(_0x1b391f,_0x37fc89))[_0x47a0('0x44')](handleError(_0x1b391f,null));};exports['show']=function(_0x4a9824,_0x4ac4e2){var _0x1d1431={'raw':!![],'where':{'id':_0x4a9824[_0x47a0('0x45')]['id']}},_0x8553c6={};_0x8553c6[_0x47a0('0x2f')]=_['keys'](db[_0x47a0('0x3f')][_0x47a0('0x29')]);_0x8553c6[_0x47a0('0x30')]=_[_0x47a0('0x2c')](_0x4a9824[_0x47a0('0x30')]);_0x8553c6['filters']=_[_0x47a0('0x2e')](_0x8553c6[_0x47a0('0x2f')],_0x8553c6[_0x47a0('0x30')]);_0x1d1431[_0x47a0('0x31')]=_[_0x47a0('0x2e')](_0x8553c6[_0x47a0('0x2f')],qs['fields'](_0x4a9824[_0x47a0('0x30')][_0x47a0('0x32')]));_0x1d1431['attributes']=_0x1d1431['attributes'][_0x47a0('0x33')]?_0x1d1431['attributes']:_0x8553c6[_0x47a0('0x2f')];if(_0x4a9824[_0x47a0('0x30')][_0x47a0('0x40')]){_0x1d1431[_0x47a0('0x41')]=[{'all':!![]}];}_0x1d1431=_[_0x47a0('0x3b')]({},_0x1d1431,_0x4a9824[_0x47a0('0x3e')]);return db[_0x47a0('0x3f')]['find'](_0x1d1431)[_0x47a0('0x22')](handleEntityNotFound(_0x4ac4e2,null))[_0x47a0('0x22')](respondWithResult(_0x4ac4e2,null))[_0x47a0('0x44')](handleError(_0x4ac4e2,null));};exports[_0x47a0('0x46')]=function(_0x4be4b6,_0x5e2405){return db['VoiceDialReport'][_0x47a0('0x46')](_0x4be4b6[_0x47a0('0x47')],{})['then'](respondWithResult(_0x5e2405,0xc9))['catch'](handleError(_0x5e2405,null));};exports[_0x47a0('0x21')]=function(_0x19ed11,_0x4177ac){if(_0x19ed11[_0x47a0('0x47')]['id']){delete _0x19ed11['body']['id'];}return db['VoiceDialReport'][_0x47a0('0x48')]({'where':{'id':_0x19ed11['params']['id']}})[_0x47a0('0x22')](handleEntityNotFound(_0x4177ac,null))[_0x47a0('0x22')](saveUpdates(_0x19ed11[_0x47a0('0x47')],null))[_0x47a0('0x22')](respondWithResult(_0x4177ac,null))[_0x47a0('0x44')](handleError(_0x4177ac,null));};exports['destroy']=function(_0x3267d4,_0x22d78c){return db['VoiceDialReport'][_0x47a0('0x48')]({'where':{'id':_0x3267d4['params']['id']}})[_0x47a0('0x22')](handleEntityNotFound(_0x22d78c,null))['then'](removeEntity(_0x22d78c,null))[_0x47a0('0x44')](handleError(_0x22d78c,null));};exports[_0x47a0('0x49')]=function(_0x32e230,_0x1c0457){return db['VoiceDialReport']['describe']()[_0x47a0('0x22')](respondWithResult(_0x1c0457,null))[_0x47a0('0x44')](handleError(_0x1c0457,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 1761804..099b6ab 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 _0x30d2=['path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4063a4,_0x19d730){var _0x17908d=function(_0x3ce714){while(--_0x3ce714){_0x4063a4['push'](_0x4063a4['shift']());}};_0x17908d(++_0x19d730);}(_0x30d2,0x190));var _0x230d=function(_0x954b3a,_0x10a7c1){_0x954b3a=_0x954b3a-0x0;var _0x3a313e=_0x30d2[_0x954b3a];return _0x3a313e;};'use strict';var _=require(_0x230d('0x0'));var util=require('util');var logger=require(_0x230d('0x1'))(_0x230d('0x2'));var moment=require(_0x230d('0x3'));var BPromise=require(_0x230d('0x4'));var rp=require(_0x230d('0x5'));var fs=require('fs');var path=require(_0x230d('0x6'));var rimraf=require(_0x230d('0x7'));var config=require(_0x230d('0x8'));var attributes=require(_0x230d('0x9'));module[_0x230d('0xa')]=function(_0x469a0c,_0x3b550c){return _0x469a0c[_0x230d('0xb')](_0x230d('0xc'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0x230d('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xecd0=['define','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x499eaf,_0x560a5a){var _0x2fa121=function(_0x286a7b){while(--_0x286a7b){_0x499eaf['push'](_0x499eaf['shift']());}};_0x2fa121(++_0x560a5a);}(_0xecd0,0x162));var _0x0ecd=function(_0x4d6bfd,_0x8d79ff){_0x4d6bfd=_0x4d6bfd-0x0;var _0x243a46=_0xecd0[_0x4d6bfd];return _0x243a46;};'use strict';var _=require(_0x0ecd('0x0'));var util=require(_0x0ecd('0x1'));var logger=require(_0x0ecd('0x2'))(_0x0ecd('0x3'));var moment=require(_0x0ecd('0x4'));var BPromise=require('bluebird');var rp=require(_0x0ecd('0x5'));var fs=require('fs');var path=require(_0x0ecd('0x6'));var rimraf=require(_0x0ecd('0x7'));var config=require(_0x0ecd('0x8'));var attributes=require('./voiceDialReport.attributes');module[_0x0ecd('0x9')]=function(_0x1cde06,_0xff2f1c){return _0x1cde06[_0x0ecd('0xa')](_0x0ecd('0xb'),attributes,{'tableName':_0x0ecd('0xc'),'paranoid':![],'indexes':[{'fields':[_0x0ecd('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 2445d51..31b243d 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 _0xd343=['limit','UpdateVoiceDialReport','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateVoiceDialReport','VoiceDialReport','create','body','options','then','update','where','attributes'];(function(_0xb67330,_0x19ad6f){var _0x19855d=function(_0x3c93ab){while(--_0x3c93ab){_0xb67330['push'](_0xb67330['shift']());}};_0x19855d(++_0x19ad6f);}(_0xd343,0xf1));var _0x3d34=function(_0x48eb4b,_0x3d0a4a){_0x48eb4b=_0x48eb4b-0x0;var _0x1efb56=_0xd343[_0x48eb4b];return _0x1efb56;};'use strict';var _=require('lodash');var util=require(_0x3d34('0x0'));var moment=require(_0x3d34('0x1'));var BPromise=require(_0x3d34('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3d34('0x3'))['db'];var utils=require(_0x3d34('0x4'));var logger=require(_0x3d34('0x5'))(_0x3d34('0x6'));var config=require(_0x3d34('0x7'));var jayson=require(_0x3d34('0x8'));var client=jayson[_0x3d34('0x9')][_0x3d34('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21ccbc,_0x16b4a5,_0x4d9fdc){return new BPromise(function(_0x34675b,_0x5e6dd0){return client[_0x3d34('0xb')](_0x21ccbc,_0x4d9fdc)['then'](function(_0x3c8d55){logger[_0x3d34('0xc')](_0x3d34('0xd'),_0x16b4a5,_0x3d34('0xe'));logger[_0x3d34('0xf')](_0x3d34('0x10'),_0x16b4a5,_0x3d34('0xe'),JSON[_0x3d34('0x11')](_0x3c8d55));if(_0x3c8d55[_0x3d34('0x12')]){if(_0x3c8d55[_0x3d34('0x12')][_0x3d34('0x13')]===0x1f4){logger[_0x3d34('0x12')](_0x3d34('0xd'),_0x16b4a5,_0x3c8d55[_0x3d34('0x12')][_0x3d34('0x14')]);return _0x5e6dd0(_0x3c8d55['error']['message']);}logger[_0x3d34('0x12')]('VoiceDialReport,\x20%s,\x20%s',_0x16b4a5,_0x3c8d55['error'][_0x3d34('0x14')]);return _0x34675b(_0x3c8d55['error']['message']);}else{logger[_0x3d34('0xc')](_0x3d34('0xd'),_0x16b4a5,'request\x20sent');_0x34675b(_0x3c8d55[_0x3d34('0x15')][_0x3d34('0x14')]);}})['catch'](function(_0x161a42){logger[_0x3d34('0x12')](_0x3d34('0xd'),_0x16b4a5,_0x161a42);_0x5e6dd0(_0x161a42);});});}exports[_0x3d34('0x16')]=function(_0xc99eea){var _0x3e6e75=this;return new Promise(function(_0x4546f8,_0x519fbd){return db[_0x3d34('0x17')][_0x3d34('0x18')](_0xc99eea[_0x3d34('0x19')],{'raw':_0xc99eea['options']?_0xc99eea[_0x3d34('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x3d34('0x1b')](function(_0x3accd7){logger[_0x3d34('0xc')](_0x3d34('0x16'),_0xc99eea);logger['debug'](_0x3d34('0x16'),_0xc99eea,JSON[_0x3d34('0x11')](_0x3accd7));_0x4546f8(_0x3accd7);})['catch'](function(_0x2c1f20){logger[_0x3d34('0x12')](_0x3d34('0x16'),_0x2c1f20[_0x3d34('0x14')],_0xc99eea);_0x519fbd(_0x3e6e75[_0x3d34('0x12')](0x1f4,_0x2c1f20[_0x3d34('0x14')]));});});};exports['UpdateVoiceDialReport']=function(_0x279819){var _0x455714=this;return new Promise(function(_0x27a95a,_0x4d0a4b){return db[_0x3d34('0x17')][_0x3d34('0x1c')](_0x279819['body'],{'raw':_0x279819[_0x3d34('0x1a')]?_0x279819[_0x3d34('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x279819[_0x3d34('0x1a')]?_0x279819[_0x3d34('0x1a')][_0x3d34('0x1d')]||null:null,'attributes':_0x279819['options']?_0x279819['options'][_0x3d34('0x1e')]||null:null,'limit':_0x279819[_0x3d34('0x1a')]?_0x279819[_0x3d34('0x1a')][_0x3d34('0x1f')]||null:null})[_0x3d34('0x1b')](function(_0x5b953e){logger[_0x3d34('0xc')](_0x3d34('0x20'),_0x279819);logger[_0x3d34('0xf')](_0x3d34('0x20'),_0x279819,JSON[_0x3d34('0x11')](_0x5b953e));_0x27a95a(_0x5b953e);})[_0x3d34('0x21')](function(_0x128bb1){logger[_0x3d34('0x12')](_0x3d34('0x20'),_0x128bb1[_0x3d34('0x14')],_0x279819);_0x4d0a4b(_0x455714[_0x3d34('0x12')](0x1f4,_0x128bb1[_0x3d34('0x14')]));});});}; \ No newline at end of file +var _0xa785=['raw','then','VoiceDialReport','attributes','limit','UpdateVoiceDialReport','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','debug','request\x20sent','stringify','error','message','VoiceDialReport,\x20%s,\x20%s','result','catch','CreateVoiceDialReport','create','body','options'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xa785,0x114));var _0x5a78=function(_0x575a38,_0x2e83d7){_0x575a38=_0x575a38-0x0;var _0x5a7bdd=_0xa785[_0x575a38];return _0x5a7bdd;};'use strict';var _=require('lodash');var util=require(_0x5a78('0x0'));var moment=require(_0x5a78('0x1'));var BPromise=require(_0x5a78('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5a78('0x3'));var db=require(_0x5a78('0x4'))['db'];var utils=require(_0x5a78('0x5'));var logger=require(_0x5a78('0x6'))('rpc');var config=require(_0x5a78('0x7'));var jayson=require(_0x5a78('0x8'));var client=jayson[_0x5a78('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4bfe78,_0x3f4d65,_0xfb5198){return new BPromise(function(_0x25c8ec,_0x506e91){return client[_0x5a78('0xa')](_0x4bfe78,_0xfb5198)['then'](function(_0x401a92){logger[_0x5a78('0xb')]('VoiceDialReport,\x20%s,\x20%s',_0x3f4d65,'request\x20sent');logger[_0x5a78('0xc')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x3f4d65,_0x5a78('0xd'),JSON[_0x5a78('0xe')](_0x401a92));if(_0x401a92['error']){if(_0x401a92['error']['code']===0x1f4){logger[_0x5a78('0xf')]('VoiceDialReport,\x20%s,\x20%s',_0x3f4d65,_0x401a92[_0x5a78('0xf')][_0x5a78('0x10')]);return _0x506e91(_0x401a92[_0x5a78('0xf')]['message']);}logger[_0x5a78('0xf')]('VoiceDialReport,\x20%s,\x20%s',_0x3f4d65,_0x401a92[_0x5a78('0xf')][_0x5a78('0x10')]);return _0x25c8ec(_0x401a92[_0x5a78('0xf')][_0x5a78('0x10')]);}else{logger[_0x5a78('0xb')](_0x5a78('0x11'),_0x3f4d65,'request\x20sent');_0x25c8ec(_0x401a92[_0x5a78('0x12')][_0x5a78('0x10')]);}})[_0x5a78('0x13')](function(_0x597779){logger['error'](_0x5a78('0x11'),_0x3f4d65,_0x597779);_0x506e91(_0x597779);});});}exports[_0x5a78('0x14')]=function(_0x49ac85){var _0x2b3e12=this;return new Promise(function(_0x2560bd,_0x36a941){return db['VoiceDialReport'][_0x5a78('0x15')](_0x49ac85[_0x5a78('0x16')],{'raw':_0x49ac85['options']?_0x49ac85[_0x5a78('0x17')][_0x5a78('0x18')]===undefined?!![]:![]:!![]})[_0x5a78('0x19')](function(_0x4e1b65){logger[_0x5a78('0xb')](_0x5a78('0x14'),_0x49ac85);logger[_0x5a78('0xc')](_0x5a78('0x14'),_0x49ac85,JSON[_0x5a78('0xe')](_0x4e1b65));_0x2560bd(_0x4e1b65);})[_0x5a78('0x13')](function(_0x3f25d3){logger[_0x5a78('0xf')]('CreateVoiceDialReport',_0x3f25d3[_0x5a78('0x10')],_0x49ac85);_0x36a941(_0x2b3e12['error'](0x1f4,_0x3f25d3['message']));});});};exports['UpdateVoiceDialReport']=function(_0x3ee3b0){var _0x3148a9=this;return new Promise(function(_0x547587,_0x3f2e87){return db[_0x5a78('0x1a')]['update'](_0x3ee3b0[_0x5a78('0x16')],{'raw':_0x3ee3b0[_0x5a78('0x17')]?_0x3ee3b0[_0x5a78('0x17')][_0x5a78('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ee3b0[_0x5a78('0x17')]?_0x3ee3b0['options']['where']||null:null,'attributes':_0x3ee3b0[_0x5a78('0x17')]?_0x3ee3b0[_0x5a78('0x17')][_0x5a78('0x1b')]||null:null,'limit':_0x3ee3b0['options']?_0x3ee3b0['options'][_0x5a78('0x1c')]||null:null})[_0x5a78('0x19')](function(_0x362edf){logger[_0x5a78('0xb')]('UpdateVoiceDialReport',_0x3ee3b0);logger[_0x5a78('0xc')]('UpdateVoiceDialReport',_0x3ee3b0,JSON[_0x5a78('0xe')](_0x362edf));_0x547587(_0x362edf);})[_0x5a78('0x13')](function(_0x5c741e){logger[_0x5a78('0xf')](_0x5a78('0x1d'),_0x5c741e[_0x5a78('0x10')],_0x3ee3b0);_0x3f2e87(_0x3148a9['error'](0x1f4,_0x5c741e[_0x5a78('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 0b32c67..ffa62bd 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 _0xdb0a=['/:id','update','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','post','addApplications','put'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xdb0a,0x15b));var _0xadb0=function(_0x3745d6,_0xe544ec){_0x3745d6=_0x3745d6-0x0;var _0x4a1541=_0xdb0a[_0x3745d6];return _0x4a1541;};'use strict';var multer=require('multer');var util=require(_0xadb0('0x0'));var path=require('path');var timeout=require(_0xadb0('0x1'));var express=require('express');var router=express[_0xadb0('0x2')]();var fs_extra=require(_0xadb0('0x3'));var auth=require(_0xadb0('0x4'));var interaction=require(_0xadb0('0x5'));var config=require(_0xadb0('0x6'));var controller=require(_0xadb0('0x7'));router[_0xadb0('0x8')]('/',auth[_0xadb0('0x9')](),controller[_0xadb0('0xa')]);router[_0xadb0('0x8')]('/:id',auth[_0xadb0('0x9')](),controller['show']);router[_0xadb0('0xb')]('/',auth[_0xadb0('0x9')](),controller['create']);router[_0xadb0('0xb')]('/:id/applications',auth[_0xadb0('0x9')](),controller[_0xadb0('0xc')]);router[_0xadb0('0xd')](_0xadb0('0xe'),auth[_0xadb0('0x9')](),controller[_0xadb0('0xf')]);router[_0xadb0('0x10')](_0xadb0('0xe'),auth[_0xadb0('0x9')](),controller[_0xadb0('0x11')]);module[_0xadb0('0x12')]=router; \ No newline at end of file +var _0xed7a=['exports','multer','util','Router','../../components/interaction/service','index','get','/:id','isAuthenticated','create','/:id/applications','addApplications','update'];(function(_0x254d47,_0x50ae3b){var _0x377bd0=function(_0x3c31bb){while(--_0x3c31bb){_0x254d47['push'](_0x254d47['shift']());}};_0x377bd0(++_0x50ae3b);}(_0xed7a,0x1e2));var _0xaed7=function(_0xf5a812,_0x108dff){_0xf5a812=_0xf5a812-0x0;var _0x2d048f=_0xed7a[_0xf5a812];return _0x2d048f;};'use strict';var multer=require(_0xaed7('0x0'));var util=require(_0xaed7('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xaed7('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xaed7('0x3'));var config=require('../../config/environment');var controller=require('./voiceExtension.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xaed7('0x4')]);router[_0xaed7('0x5')](_0xaed7('0x6'),auth[_0xaed7('0x7')](),controller['show']);router['post']('/',auth[_0xaed7('0x7')](),controller[_0xaed7('0x8')]);router['post'](_0xaed7('0x9'),auth[_0xaed7('0x7')](),controller[_0xaed7('0xa')]);router['put'](_0xaed7('0x6'),auth[_0xaed7('0x7')](),controller[_0xaed7('0xb')]);router['delete'](_0xaed7('0x6'),auth[_0xaed7('0x7')](),controller['destroy']);module[_0xaed7('0xc')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 7903c9c..39de1d2 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 _0x73c0=['*,*,*,*','BOOLEAN','wav','VIRTUAL','getDataValue','sequelize','STRING','compositeIndex','NoOp','inbound','internal','inbound-fax','outbound-fax','any'];(function(_0x3c5824,_0x5c4969){var _0xa7ff76=function(_0x5627ee){while(--_0x5627ee){_0x3c5824['push'](_0x3c5824['shift']());}};_0xa7ff76(++_0x5c4969);}(_0x73c0,0x10f));var _0x073c=function(_0x323822,_0x17f631){_0x323822=_0x323822-0x0;var _0x24ce46=_0x73c0[_0x323822];return _0x24ce46;};'use strict';var Sequelize=require(_0x073c('0x0'));module['exports']={'context':{'type':Sequelize[_0x073c('0x1')],'allowNull':![],'unique':_0x073c('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0x073c('0x1')],'allowNull':![],'defaultValue':'1','unique':_0x073c('0x2')},'tag':{'type':Sequelize[_0x073c('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x073c('0x1')],'allowNull':![],'defaultValue':_0x073c('0x3')},'appdata':{'type':Sequelize[_0x073c('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x073c('0x4'),'outbound',_0x073c('0x5'),_0x073c('0x6'),_0x073c('0x7'),'system',_0x073c('0x8')),'allowNull':![]},'description':{'type':Sequelize[_0x073c('0x1')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x073c('0x9')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x073c('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0x073c('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0x073c('0xa')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0x073c('0xb')},'answer':{'type':Sequelize[_0x073c('0xa')],'defaultValue':!![]},'name':{'type':Sequelize[_0x073c('0xc')],'get':function(_0x166544){return this[_0x073c('0xd')]('exten');}},'alias':{'type':Sequelize[_0x073c('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x74da=['system','*,*,*,*','BOOLEAN','INTEGER','wav','getDataValue','exten','STRING','compositeIndex','NoOp','ENUM','outbound','internal','outbound-fax'];(function(_0xaa62a,_0x45d113){var _0x47ce4a=function(_0x2391bf){while(--_0x2391bf){_0xaa62a['push'](_0xaa62a['shift']());}};_0x47ce4a(++_0x45d113);}(_0x74da,0x69));var _0xa74d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x74da[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'context':{'type':Sequelize[_0xa74d('0x0')],'allowNull':![],'unique':_0xa74d('0x1'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xa74d('0x0')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0xa74d('0x1')},'tag':{'type':Sequelize[_0xa74d('0x0')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa74d('0x2')},'appdata':{'type':Sequelize[_0xa74d('0x0')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xa74d('0x3')]('inbound',_0xa74d('0x4'),_0xa74d('0x5'),'inbound-fax',_0xa74d('0x6'),_0xa74d('0x7'),'any'),'allowNull':![]},'description':{'type':Sequelize[_0xa74d('0x0')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa74d('0x8')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xa74d('0x0')],'defaultValue':null},'callerID':{'type':Sequelize[_0xa74d('0x0')],'allowNull':!![]},'record':{'type':Sequelize[_0xa74d('0x9')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xa74d('0xa')]},'recordingFormat':{'type':Sequelize[_0xa74d('0x0')],'defaultValue':_0xa74d('0xb')},'answer':{'type':Sequelize[_0xa74d('0x9')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x403778){return this[_0xa74d('0xc')](_0xa74d('0xd'));}},'alias':{'type':Sequelize[_0xa74d('0x0')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 953aab6..b31b222 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 _0x6974=['map','VIRTUAL','VoiceExtension','findAll','show','params','intersection','include','options','catch','body','startsWith','exten','concat','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','inbound','internal','userProfileId','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','isApp','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','send','lodash','ioredis','../../config/logger','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./voiceExtension.socket','register','status','end','offset','undefined','limit','count','set','Content-Range','json','destroy','then','get','InboundRoutes','OutboundRoutes','outbound','InternalRoutes','filter','value','includes','type','find','name','UserProfileResource','sendStatus','error','stack','index','rawAttributes','fieldName','key','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge'];(function(_0x380b08,_0x1df63a){var _0x22f65d=function(_0x507f73){while(--_0x507f73){_0x380b08['push'](_0x380b08['shift']());}};_0x22f65d(++_0x1df63a);}(_0x6974,0x133));var _0x4697=function(_0xdf5143,_0x4eebbc){_0xdf5143=_0xdf5143-0x0;var _0x7bfe83=_0x6974[_0xdf5143];return _0x7bfe83;};'use strict';var _=require(_0x4697('0x0'));var Redis=require(_0x4697('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x4697('0x2'))('api');var config=require(_0x4697('0x3'));var db=require(_0x4697('0x4'))['db'];config['redis']=_[_0x4697('0x5')](config[_0x4697('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x4697('0x7'))(new Redis(config[_0x4697('0x6')]));require(_0x4697('0x8'))[_0x4697('0x9')](socket);function respondWithStatusCode(_0x36981a,_0x2e76f6){_0x2e76f6=_0x2e76f6||0xcc;return function(_0x366262){if(_0x366262){return _0x36981a['sendStatus'](_0x2e76f6);}return _0x36981a[_0x4697('0xa')](_0x2e76f6)[_0x4697('0xb')]();};}function respondWithResult(_0x5a3db8,_0x20e13b){_0x20e13b=_0x20e13b||0xc8;return function(_0x50a4ee){if(_0x50a4ee){return _0x5a3db8[_0x4697('0xa')](_0x20e13b)['json'](_0x50a4ee);}};}function respondWithFilteredResult(_0x33b77d,_0x1a5fd5){return function(_0x43f727){if(_0x43f727){var _0x2a1ccb=typeof _0x1a5fd5[_0x4697('0xc')]===_0x4697('0xd')&&typeof _0x1a5fd5[_0x4697('0xe')]===_0x4697('0xd');var _0x4342e8=_0x43f727[_0x4697('0xf')];var _0x3d03b0=_0x2a1ccb?0x0:_0x1a5fd5[_0x4697('0xc')];var _0x134e0c=_0x2a1ccb?_0x43f727['count']:_0x1a5fd5[_0x4697('0xc')]+_0x1a5fd5[_0x4697('0xe')];var _0x47ce90;if(_0x134e0c>=_0x4342e8){_0x134e0c=_0x4342e8;_0x47ce90=0xc8;}else{_0x47ce90=0xce;}_0x33b77d['status'](_0x47ce90);return _0x33b77d[_0x4697('0x10')](_0x4697('0x11'),_0x3d03b0+'-'+_0x134e0c+'/'+_0x4342e8)[_0x4697('0x12')](_0x43f727);}return null;};}function removeEntity(_0x5b9c4d){return function(_0x3a7556){if(_0x3a7556){return _0x3a7556[_0x4697('0x13')]()[_0x4697('0x14')](function(){var _0x3600d2=_0x3a7556[_0x4697('0x15')]({'plain':!![]});var _0x4216f1=[{'name':_0x4697('0x16'),'value':'inbound','ignore':![]},{'name':_0x4697('0x17'),'value':_0x4697('0x18'),'ignore':![]},{'name':_0x4697('0x19'),'value':'internal','ignore':![]}];var _0x1eea2c=_(_0x4216f1)[_0x4697('0x1a')]('ignore')['map'](_0x4697('0x1b'))[_0x4697('0x1b')]();if(_[_0x4697('0x1c')](_0x1eea2c,_0x3600d2[_0x4697('0x1d')])){return;}var _0x3c1019=_[_0x4697('0x1e')](_0x4216f1,['value',_0x3600d2[_0x4697('0x1d')]])[_0x4697('0x1f')];return db[_0x4697('0x20')]['destroy']({'where':{'type':_0x3c1019,'resourceId':_0x3600d2['id']}})[_0x4697('0x14')](function(){return _0x3a7556;});})[_0x4697('0x14')](function(){_0x5b9c4d[_0x4697('0xa')](0xcc)[_0x4697('0xb')]();});}};}function handleEntityNotFound(_0x43cb0a){return function(_0x5ce5dd){if(!_0x5ce5dd){_0x43cb0a[_0x4697('0x21')](0x194);}return _0x5ce5dd;};}function handleError(_0x4f7594,_0x3c8a4d){_0x3c8a4d=_0x3c8a4d||0x1f4;return function(_0x6837b4){logger[_0x4697('0x22')](_0x6837b4[_0x4697('0x23')]);if(_0x6837b4[_0x4697('0x1f')]){delete _0x6837b4[_0x4697('0x1f')];}_0x4f7594['status'](_0x3c8a4d)['send'](_0x6837b4);};}exports[_0x4697('0x24')]=function(_0x5c1d6a,_0x37e109){var _0x3c3f2d={},_0x47aec6={},_0x3e366b={'count':0x0,'rows':[]};var _0x28c67e=_['map'](db['VoiceExtension'][_0x4697('0x25')],function(_0x5cc846){return{'name':_0x5cc846[_0x4697('0x26')],'type':_0x5cc846['type'][_0x4697('0x27')]};});_0x47aec6[_0x4697('0x28')]=_['map'](_0x28c67e,_0x4697('0x1f'));_0x47aec6[_0x4697('0x29')]=_[_0x4697('0x2a')](_0x5c1d6a[_0x4697('0x29')]);_0x47aec6['filters']=_['intersection'](_0x47aec6[_0x4697('0x28')],_0x47aec6[_0x4697('0x29')]);_0x3c3f2d[_0x4697('0x2b')]=_['intersection'](_0x47aec6[_0x4697('0x28')],qs[_0x4697('0x2c')](_0x5c1d6a[_0x4697('0x29')][_0x4697('0x2c')]));_0x3c3f2d[_0x4697('0x2b')]=_0x3c3f2d[_0x4697('0x2b')][_0x4697('0x2d')]?_0x3c3f2d[_0x4697('0x2b')]:_0x47aec6['model'];if(!_0x5c1d6a[_0x4697('0x29')][_0x4697('0x2e')](_0x4697('0x2f'))){_0x3c3f2d[_0x4697('0xe')]=qs[_0x4697('0xe')](_0x5c1d6a['query'][_0x4697('0xe')]);_0x3c3f2d['offset']=qs['offset'](_0x5c1d6a[_0x4697('0x29')]['offset']);}_0x3c3f2d['order']=qs[_0x4697('0x30')](_0x5c1d6a[_0x4697('0x29')][_0x4697('0x30')]);_0x3c3f2d[_0x4697('0x31')]=qs[_0x4697('0x32')](_[_0x4697('0x33')](_0x5c1d6a['query'],_0x47aec6[_0x4697('0x32')]),_0x28c67e);if(_0x5c1d6a[_0x4697('0x29')][_0x4697('0x1a')]){_0x3c3f2d[_0x4697('0x31')]=_[_0x4697('0x34')](_0x3c3f2d[_0x4697('0x31')],{'$or':_[_0x4697('0x35')](_0x28c67e,function(_0x118f5c){if(_0x118f5c[_0x4697('0x1d')]!==_0x4697('0x36')){var _0x484389={};_0x484389[_0x118f5c[_0x4697('0x1f')]]={'$like':'%'+_0x5c1d6a[_0x4697('0x29')]['filter']+'%'};return _0x484389;}})});}_0x3c3f2d=_['merge']({},_0x3c3f2d,_0x5c1d6a['options']);var _0x5021df={'where':_0x3c3f2d[_0x4697('0x31')]};return db[_0x4697('0x37')][_0x4697('0xf')](_0x5021df)[_0x4697('0x14')](function(_0x5977e){_0x3e366b[_0x4697('0xf')]=_0x5977e;if(_0x5c1d6a['query']['includeAll']){_0x3c3f2d['include']=[{'all':!![]}];}return db[_0x4697('0x37')][_0x4697('0x38')](_0x3c3f2d);})[_0x4697('0x14')](function(_0x570c7d){_0x3e366b['rows']=_0x570c7d;return _0x3e366b;})['then'](respondWithFilteredResult(_0x37e109,_0x3c3f2d))['catch'](handleError(_0x37e109,null));};exports[_0x4697('0x39')]=function(_0x394aae,_0x2b5b0e){var _0x598247={'raw':![],'where':{'id':_0x394aae[_0x4697('0x3a')]['id']}},_0x236e97={};_0x236e97['model']=_[_0x4697('0x2a')](db[_0x4697('0x37')][_0x4697('0x25')]);_0x236e97['query']=_['keys'](_0x394aae['query']);_0x236e97[_0x4697('0x32')]=_[_0x4697('0x3b')](_0x236e97[_0x4697('0x28')],_0x236e97[_0x4697('0x29')]);_0x598247[_0x4697('0x2b')]=_[_0x4697('0x3b')](_0x236e97[_0x4697('0x28')],qs['fields'](_0x394aae[_0x4697('0x29')][_0x4697('0x2c')]));_0x598247['attributes']=_0x598247[_0x4697('0x2b')][_0x4697('0x2d')]?_0x598247[_0x4697('0x2b')]:_0x236e97[_0x4697('0x28')];if(_0x394aae[_0x4697('0x29')]['includeAll']){_0x598247[_0x4697('0x3c')]=[{'all':!![]}];}_0x598247=_[_0x4697('0x34')]({},_0x598247,_0x394aae[_0x4697('0x3d')]);return db[_0x4697('0x37')]['find'](_0x598247)[_0x4697('0x14')](handleEntityNotFound(_0x2b5b0e,null))['then'](respondWithResult(_0x2b5b0e,null))[_0x4697('0x3e')](handleError(_0x2b5b0e,null));};exports[_0x4697('0x13')]=function(_0x1c9480,_0x461681){return db[_0x4697('0x37')]['find']({'where':{'id':_0x1c9480[_0x4697('0x3a')]['id']}})[_0x4697('0x14')](handleEntityNotFound(_0x461681,null))[_0x4697('0x14')](removeEntity(_0x461681,null))[_0x4697('0x3e')](handleError(_0x461681,null));};exports['create']=function(_0x46b44e,_0x274755){if(_0x46b44e[_0x4697('0x3f')][_0x4697('0x1d')]==='outbound'&&!_[_0x4697('0x40')](_0x46b44e[_0x4697('0x3f')][_0x4697('0x41')],'_')){_0x46b44e[_0x4697('0x3f')][_0x4697('0x41')]='_'[_0x4697('0x42')](_0x46b44e[_0x4697('0x3f')][_0x4697('0x41')]);}return db['VoiceExtension'][_0x4697('0x43')](_0x46b44e['body'],{'raw':![]})['then'](function(_0x2bdff2){var _0x1c1c14=_0x46b44e[_0x4697('0x44')][_0x4697('0x15')]({'plain':!![]});if(!_0x1c1c14)throw new Error(_0x4697('0x45'));if(_0x1c1c14['role']===_0x4697('0x44')){var _0x2f4483=_0x2bdff2[_0x4697('0x15')]({'plain':!![]});var _0x3bc332=[{'name':'InboundRoutes','value':_0x4697('0x46')},{'name':_0x4697('0x17'),'value':'outbound'},{'name':'InternalRoutes','value':_0x4697('0x47')}];var _0x1c7ce5=_['find'](_0x3bc332,['value',_0x2f4483['type']])[_0x4697('0x1f')];return db['UserProfileSection'][_0x4697('0x1e')]({'where':{'name':_0x1c7ce5,'userProfileId':_0x1c1c14[_0x4697('0x48')]},'raw':!![]})[_0x4697('0x14')](function(_0x31706c){if(_0x31706c&&_0x31706c['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x2f4483[_0x4697('0x1f')],'resourceId':_0x2f4483['id'],'type':_0x31706c[_0x4697('0x1f')],'sectionId':_0x31706c['id']},{})[_0x4697('0x14')](function(){return _0x2bdff2;});}else{return _0x2bdff2;}})['catch'](function(_0x5ef513){logger[_0x4697('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5ef513);throw _0x5ef513;});}return _0x2bdff2;})[_0x4697('0x14')](respondWithResult(_0x274755,0xc9))[_0x4697('0x3e')](handleError(_0x274755,null));};exports['update']=function(_0x291f5e,_0x40a78d){if(_0x291f5e[_0x4697('0x3f')]['id']){delete _0x291f5e[_0x4697('0x3f')]['id'];}return db[_0x4697('0x37')][_0x4697('0x1e')]({'where':{'id':_0x291f5e[_0x4697('0x3a')]['id']}})[_0x4697('0x14')](handleEntityNotFound(_0x40a78d,null))['then'](function(_0x3495ca){if(_0x3495ca){return db[_0x4697('0x37')][_0x4697('0x49')](_[_0x4697('0x33')](_0x291f5e[_0x4697('0x3f')],[_0x4697('0x41'),_0x4697('0x4a'),_0x4697('0x4b'),_0x4697('0x4c'),_0x4697('0x4d'),_0x4697('0x4e'),_0x4697('0x4f')]),{'where':{'context':_0x3495ca['context'],'exten':_0x3495ca[_0x4697('0x41')]},'individualHooks':!![]})[_0x4697('0x14')](function(_0x3e0de8){return _0x3e0de8;});}return null;})[_0x4697('0x14')](respondWithStatusCode(_0x40a78d,null))[_0x4697('0x3e')](handleError(_0x40a78d,null));};exports['addApplications']=function(_0x455ba8,_0x103fc7){var _0x4c7a4f=_0x455ba8[_0x4697('0x3a')]['id'];var _0x411d3b=_0x455ba8['body'];var _0x4182b4=0xc8;var _0x4273ab=null;return db[_0x4697('0x50')][_0x4697('0x51')]({'isolationLevel':db['sequelize'][_0x4697('0x52')][_0x4697('0x53')][_0x4697('0x54')]},function(_0x5bb85e){return db[_0x4697('0x37')]['findOne']({'where':{'id':_0x4c7a4f},'transaction':_0x5bb85e})[_0x4697('0x14')](function(_0x427ac1){if(_0x427ac1){return db[_0x4697('0x37')]['destroy']({'where':{'VoiceExtensionId':_0x4c7a4f},'transaction':_0x5bb85e})[_0x4697('0x14')](function(){var _0x47b3fb=_[_0x4697('0x35')](_0x411d3b,function(_0x529780){_0x529780['VoiceExtensionId']=_0x4c7a4f;_0x529780[_0x4697('0x55')]=!![];return _0x529780;});return _0x427ac1['createRouting'](_0x47b3fb);})[_0x4697('0x14')](function(_0x2dd84f){return db['VoiceExtension']['bulkCreate'](_0x2dd84f,{'transaction':_0x5bb85e});});}else{_0x4182b4=0x194;_0x4273ab=[];}});})[_0x4697('0x14')](function(){if(_0x4182b4!==0x194){return db[_0x4697('0x37')][_0x4697('0x56')]({'where':{'isApp':!![],'VoiceExtensionId':_0x4c7a4f},'order':_0x4697('0x57')})[_0x4697('0x14')](function(_0x385bc0){_0x4273ab=_0x385bc0;});}})[_0x4697('0x3e')](function(_0x3c1e83){_0x4182b4=0x1f4;logger[_0x4697('0x22')](_0x3c1e83[_0x4697('0x23')]);if(_0x3c1e83[_0x4697('0x1f')]){delete _0x3c1e83[_0x4697('0x1f')];}_0x4273ab=_0x3c1e83;})[_0x4697('0x58')](function(){if(_0x4273ab===null){_0x103fc7[_0x4697('0x21')](_0x4182b4);}else{if(_0x4182b4===0x1f4){_0x103fc7[_0x4697('0xa')](_0x4182b4)[_0x4697('0x59')](_0x4273ab);}else{_0x103fc7[_0x4697('0xa')](_0x4182b4)['json'](_0x4273ab);}}});}; \ No newline at end of file +var _0xa6b5=['UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','recordingFormat','cutdigits','alias','addApplications','sequelize','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','bulkCreate','findAndCountAll','finally','send','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','destroy','then','get','InboundRoutes','inbound','outbound','InternalRoutes','internal','filter','ignore','type','find','value','name','UserProfileResource','error','stack','index','map','VoiceExtension','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','includeAll','findAll','catch','show','params','include','options','startsWith','body','exten','concat','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OutboundRoutes'];(function(_0x2d3ee5,_0x186a57){var _0x526b12=function(_0x18de6b){while(--_0x18de6b){_0x2d3ee5['push'](_0x2d3ee5['shift']());}};_0x526b12(++_0x186a57);}(_0xa6b5,0x127));var _0x5a6b=function(_0x593aa2,_0x598431){_0x593aa2=_0x593aa2-0x0;var _0x2a7c4b=_0xa6b5[_0x593aa2];return _0x2a7c4b;};'use strict';var _=require(_0x5a6b('0x0'));var Redis=require(_0x5a6b('0x1'));var qs=require(_0x5a6b('0x2'));var logger=require('../../config/logger')(_0x5a6b('0x3'));var config=require(_0x5a6b('0x4'));var db=require(_0x5a6b('0x5'))['db'];config[_0x5a6b('0x6')]=_[_0x5a6b('0x7')](config[_0x5a6b('0x6')],{'host':_0x5a6b('0x8'),'port':0x18eb});var socket=require(_0x5a6b('0x9'))(new Redis(config[_0x5a6b('0x6')]));require(_0x5a6b('0xa'))[_0x5a6b('0xb')](socket);function respondWithStatusCode(_0x23a658,_0x4f2707){_0x4f2707=_0x4f2707||0xcc;return function(_0x5ce4b7){if(_0x5ce4b7){return _0x23a658[_0x5a6b('0xc')](_0x4f2707);}return _0x23a658[_0x5a6b('0xd')](_0x4f2707)[_0x5a6b('0xe')]();};}function respondWithResult(_0xbd2bd,_0x505e1c){_0x505e1c=_0x505e1c||0xc8;return function(_0x130200){if(_0x130200){return _0xbd2bd[_0x5a6b('0xd')](_0x505e1c)['json'](_0x130200);}};}function respondWithFilteredResult(_0x28a662,_0x2a225b){return function(_0x3b17c7){if(_0x3b17c7){var _0x3cf0ff=typeof _0x2a225b[_0x5a6b('0xf')]===_0x5a6b('0x10')&&typeof _0x2a225b[_0x5a6b('0x11')]===_0x5a6b('0x10');var _0x1c3e47=_0x3b17c7[_0x5a6b('0x12')];var _0x4330ad=_0x3cf0ff?0x0:_0x2a225b[_0x5a6b('0xf')];var _0xd2cd33=_0x3cf0ff?_0x3b17c7[_0x5a6b('0x12')]:_0x2a225b['offset']+_0x2a225b[_0x5a6b('0x11')];var _0x366755;if(_0xd2cd33>=_0x1c3e47){_0xd2cd33=_0x1c3e47;_0x366755=0xc8;}else{_0x366755=0xce;}_0x28a662[_0x5a6b('0xd')](_0x366755);return _0x28a662[_0x5a6b('0x13')](_0x5a6b('0x14'),_0x4330ad+'-'+_0xd2cd33+'/'+_0x1c3e47)[_0x5a6b('0x15')](_0x3b17c7);}return null;};}function removeEntity(_0x5803d2){return function(_0x3caa32){if(_0x3caa32){return _0x3caa32[_0x5a6b('0x16')]()[_0x5a6b('0x17')](function(){var _0x19e36c=_0x3caa32[_0x5a6b('0x18')]({'plain':!![]});var _0x580c75=[{'name':_0x5a6b('0x19'),'value':_0x5a6b('0x1a'),'ignore':![]},{'name':'OutboundRoutes','value':_0x5a6b('0x1b'),'ignore':![]},{'name':_0x5a6b('0x1c'),'value':_0x5a6b('0x1d'),'ignore':![]}];var _0x5c254f=_(_0x580c75)[_0x5a6b('0x1e')](_0x5a6b('0x1f'))['map']('value')['value']();if(_['includes'](_0x5c254f,_0x19e36c[_0x5a6b('0x20')])){return;}var _0x2bbad2=_[_0x5a6b('0x21')](_0x580c75,[_0x5a6b('0x22'),_0x19e36c[_0x5a6b('0x20')]])[_0x5a6b('0x23')];return db[_0x5a6b('0x24')][_0x5a6b('0x16')]({'where':{'type':_0x2bbad2,'resourceId':_0x19e36c['id']}})[_0x5a6b('0x17')](function(){return _0x3caa32;});})[_0x5a6b('0x17')](function(){_0x5803d2[_0x5a6b('0xd')](0xcc)[_0x5a6b('0xe')]();});}};}function handleEntityNotFound(_0x59ad83){return function(_0x59bf54){if(!_0x59bf54){_0x59ad83[_0x5a6b('0xc')](0x194);}return _0x59bf54;};}function handleError(_0x3bc47e,_0xe4acb5){_0xe4acb5=_0xe4acb5||0x1f4;return function(_0x4a6ac4){logger[_0x5a6b('0x25')](_0x4a6ac4[_0x5a6b('0x26')]);if(_0x4a6ac4[_0x5a6b('0x23')]){delete _0x4a6ac4[_0x5a6b('0x23')];}_0x3bc47e[_0x5a6b('0xd')](_0xe4acb5)['send'](_0x4a6ac4);};}exports[_0x5a6b('0x27')]=function(_0x5754c5,_0x22bc9c){var _0x2f1b96={},_0x275edd={},_0x4c6f65={'count':0x0,'rows':[]};var _0x9280a8=_[_0x5a6b('0x28')](db[_0x5a6b('0x29')][_0x5a6b('0x2a')],function(_0x13a193){return{'name':_0x13a193['fieldName'],'type':_0x13a193[_0x5a6b('0x20')]['key']};});_0x275edd[_0x5a6b('0x2b')]=_['map'](_0x9280a8,_0x5a6b('0x23'));_0x275edd[_0x5a6b('0x2c')]=_[_0x5a6b('0x2d')](_0x5754c5[_0x5a6b('0x2c')]);_0x275edd[_0x5a6b('0x2e')]=_[_0x5a6b('0x2f')](_0x275edd['model'],_0x275edd[_0x5a6b('0x2c')]);_0x2f1b96['attributes']=_[_0x5a6b('0x2f')](_0x275edd[_0x5a6b('0x2b')],qs[_0x5a6b('0x30')](_0x5754c5[_0x5a6b('0x2c')][_0x5a6b('0x30')]));_0x2f1b96[_0x5a6b('0x31')]=_0x2f1b96[_0x5a6b('0x31')][_0x5a6b('0x32')]?_0x2f1b96[_0x5a6b('0x31')]:_0x275edd[_0x5a6b('0x2b')];if(!_0x5754c5[_0x5a6b('0x2c')][_0x5a6b('0x33')](_0x5a6b('0x34'))){_0x2f1b96[_0x5a6b('0x11')]=qs['limit'](_0x5754c5[_0x5a6b('0x2c')]['limit']);_0x2f1b96[_0x5a6b('0xf')]=qs[_0x5a6b('0xf')](_0x5754c5[_0x5a6b('0x2c')][_0x5a6b('0xf')]);}_0x2f1b96[_0x5a6b('0x35')]=qs[_0x5a6b('0x36')](_0x5754c5[_0x5a6b('0x2c')][_0x5a6b('0x36')]);_0x2f1b96[_0x5a6b('0x37')]=qs[_0x5a6b('0x2e')](_[_0x5a6b('0x38')](_0x5754c5['query'],_0x275edd[_0x5a6b('0x2e')]),_0x9280a8);if(_0x5754c5[_0x5a6b('0x2c')][_0x5a6b('0x1e')]){_0x2f1b96['where']=_[_0x5a6b('0x39')](_0x2f1b96[_0x5a6b('0x37')],{'$or':_[_0x5a6b('0x28')](_0x9280a8,function(_0x4b8e2a){if(_0x4b8e2a['type']!==_0x5a6b('0x3a')){var _0x17b411={};_0x17b411[_0x4b8e2a['name']]={'$like':'%'+_0x5754c5['query']['filter']+'%'};return _0x17b411;}})});}_0x2f1b96=_[_0x5a6b('0x39')]({},_0x2f1b96,_0x5754c5['options']);var _0x4bc758={'where':_0x2f1b96[_0x5a6b('0x37')]};return db[_0x5a6b('0x29')][_0x5a6b('0x12')](_0x4bc758)[_0x5a6b('0x17')](function(_0x5b59d4){_0x4c6f65[_0x5a6b('0x12')]=_0x5b59d4;if(_0x5754c5[_0x5a6b('0x2c')][_0x5a6b('0x3b')]){_0x2f1b96['include']=[{'all':!![]}];}return db[_0x5a6b('0x29')][_0x5a6b('0x3c')](_0x2f1b96);})[_0x5a6b('0x17')](function(_0x42368e){_0x4c6f65['rows']=_0x42368e;return _0x4c6f65;})[_0x5a6b('0x17')](respondWithFilteredResult(_0x22bc9c,_0x2f1b96))[_0x5a6b('0x3d')](handleError(_0x22bc9c,null));};exports[_0x5a6b('0x3e')]=function(_0x5c8550,_0x5b990c){var _0x53ae29={'raw':![],'where':{'id':_0x5c8550[_0x5a6b('0x3f')]['id']}},_0x4c5ded={};_0x4c5ded['model']=_[_0x5a6b('0x2d')](db['VoiceExtension'][_0x5a6b('0x2a')]);_0x4c5ded[_0x5a6b('0x2c')]=_[_0x5a6b('0x2d')](_0x5c8550['query']);_0x4c5ded[_0x5a6b('0x2e')]=_[_0x5a6b('0x2f')](_0x4c5ded['model'],_0x4c5ded['query']);_0x53ae29['attributes']=_['intersection'](_0x4c5ded[_0x5a6b('0x2b')],qs[_0x5a6b('0x30')](_0x5c8550['query'][_0x5a6b('0x30')]));_0x53ae29[_0x5a6b('0x31')]=_0x53ae29[_0x5a6b('0x31')][_0x5a6b('0x32')]?_0x53ae29[_0x5a6b('0x31')]:_0x4c5ded['model'];if(_0x5c8550[_0x5a6b('0x2c')][_0x5a6b('0x3b')]){_0x53ae29[_0x5a6b('0x40')]=[{'all':!![]}];}_0x53ae29=_['merge']({},_0x53ae29,_0x5c8550[_0x5a6b('0x41')]);return db[_0x5a6b('0x29')][_0x5a6b('0x21')](_0x53ae29)[_0x5a6b('0x17')](handleEntityNotFound(_0x5b990c,null))['then'](respondWithResult(_0x5b990c,null))['catch'](handleError(_0x5b990c,null));};exports[_0x5a6b('0x16')]=function(_0x149282,_0x125133){return db[_0x5a6b('0x29')][_0x5a6b('0x21')]({'where':{'id':_0x149282[_0x5a6b('0x3f')]['id']}})[_0x5a6b('0x17')](handleEntityNotFound(_0x125133,null))[_0x5a6b('0x17')](removeEntity(_0x125133,null))[_0x5a6b('0x3d')](handleError(_0x125133,null));};exports['create']=function(_0x364770,_0x108edf){if(_0x364770['body'][_0x5a6b('0x20')]==='outbound'&&!_[_0x5a6b('0x42')](_0x364770[_0x5a6b('0x43')][_0x5a6b('0x44')],'_')){_0x364770[_0x5a6b('0x43')]['exten']='_'[_0x5a6b('0x45')](_0x364770[_0x5a6b('0x43')][_0x5a6b('0x44')]);}return db[_0x5a6b('0x29')]['create'](_0x364770[_0x5a6b('0x43')],{'raw':![]})[_0x5a6b('0x17')](function(_0x40a4e0){var _0x24b2d8=_0x364770['user']['get']({'plain':!![]});if(!_0x24b2d8)throw new Error(_0x5a6b('0x46'));if(_0x24b2d8[_0x5a6b('0x47')]==='user'){var _0xb1ec4d=_0x40a4e0['get']({'plain':!![]});var _0x23c9c2=[{'name':_0x5a6b('0x19'),'value':_0x5a6b('0x1a')},{'name':_0x5a6b('0x48'),'value':_0x5a6b('0x1b')},{'name':'InternalRoutes','value':_0x5a6b('0x1d')}];var _0x2e8a19=_['find'](_0x23c9c2,[_0x5a6b('0x22'),_0xb1ec4d[_0x5a6b('0x20')]])[_0x5a6b('0x23')];return db[_0x5a6b('0x49')][_0x5a6b('0x21')]({'where':{'name':_0x2e8a19,'userProfileId':_0x24b2d8['userProfileId']},'raw':!![]})[_0x5a6b('0x17')](function(_0x32cc1f){if(_0x32cc1f&&_0x32cc1f['autoAssociation']===0x0){return db[_0x5a6b('0x24')][_0x5a6b('0x4a')]({'name':_0xb1ec4d['name'],'resourceId':_0xb1ec4d['id'],'type':_0x32cc1f[_0x5a6b('0x23')],'sectionId':_0x32cc1f['id']},{})['then'](function(){return _0x40a4e0;});}else{return _0x40a4e0;}})[_0x5a6b('0x3d')](function(_0x4befa8){logger[_0x5a6b('0x25')](_0x5a6b('0x4b'),_0x4befa8);throw _0x4befa8;});}return _0x40a4e0;})[_0x5a6b('0x17')](respondWithResult(_0x108edf,0xc9))['catch'](handleError(_0x108edf,null));};exports[_0x5a6b('0x4c')]=function(_0x5f1ae0,_0x279a8a){if(_0x5f1ae0[_0x5a6b('0x43')]['id']){delete _0x5f1ae0[_0x5a6b('0x43')]['id'];}return db['VoiceExtension'][_0x5a6b('0x21')]({'where':{'id':_0x5f1ae0[_0x5a6b('0x3f')]['id']}})[_0x5a6b('0x17')](handleEntityNotFound(_0x279a8a,null))[_0x5a6b('0x17')](function(_0x47e3b5){if(_0x47e3b5){return db[_0x5a6b('0x29')][_0x5a6b('0x4c')](_[_0x5a6b('0x38')](_0x5f1ae0[_0x5a6b('0x43')],[_0x5a6b('0x44'),_0x5a6b('0x4d'),'description',_0x5a6b('0x4e'),_0x5a6b('0x4f'),'mandatoryDisposition',_0x5a6b('0x50')]),{'where':{'context':_0x47e3b5[_0x5a6b('0x4d')],'exten':_0x47e3b5[_0x5a6b('0x44')]},'individualHooks':!![]})[_0x5a6b('0x17')](function(_0x508568){return _0x508568;});}return null;})[_0x5a6b('0x17')](respondWithStatusCode(_0x279a8a,null))[_0x5a6b('0x3d')](handleError(_0x279a8a,null));};exports[_0x5a6b('0x51')]=function(_0x146390,_0x792d72){var _0x35a16b=_0x146390['params']['id'];var _0x515e69=_0x146390[_0x5a6b('0x43')];var _0x1af648=0xc8;var _0x2b2556=null;return db[_0x5a6b('0x52')]['transaction']({'isolationLevel':db[_0x5a6b('0x52')]['Transaction'][_0x5a6b('0x53')][_0x5a6b('0x54')]},function(_0x4786b7){return db[_0x5a6b('0x29')][_0x5a6b('0x55')]({'where':{'id':_0x35a16b},'transaction':_0x4786b7})[_0x5a6b('0x17')](function(_0x10f181){if(_0x10f181){return db['VoiceExtension'][_0x5a6b('0x16')]({'where':{'VoiceExtensionId':_0x35a16b},'transaction':_0x4786b7})[_0x5a6b('0x17')](function(){var _0x1925b2=_[_0x5a6b('0x28')](_0x515e69,function(_0x83bc5a){_0x83bc5a[_0x5a6b('0x56')]=_0x35a16b;_0x83bc5a[_0x5a6b('0x57')]=!![];return _0x83bc5a;});return _0x10f181['createRouting'](_0x1925b2);})['then'](function(_0x3e5ea3){return db[_0x5a6b('0x29')][_0x5a6b('0x58')](_0x3e5ea3,{'transaction':_0x4786b7});});}else{_0x1af648=0x194;_0x2b2556=[];}});})[_0x5a6b('0x17')](function(){if(_0x1af648!==0x194){return db[_0x5a6b('0x29')][_0x5a6b('0x59')]({'where':{'isApp':!![],'VoiceExtensionId':_0x35a16b},'order':'cast(priority\x20as\x20unsigned)'})['then'](function(_0x2a5cec){_0x2b2556=_0x2a5cec;});}})['catch'](function(_0x228e87){_0x1af648=0x1f4;logger['error'](_0x228e87[_0x5a6b('0x26')]);if(_0x228e87[_0x5a6b('0x23')]){delete _0x228e87[_0x5a6b('0x23')];}_0x2b2556=_0x228e87;})[_0x5a6b('0x5a')](function(){if(_0x2b2556===null){_0x792d72[_0x5a6b('0xc')](_0x1af648);}else{if(_0x1af648===0x1f4){_0x792d72[_0x5a6b('0xd')](_0x1af648)[_0x5a6b('0x5b')](_0x2b2556);}else{_0x792d72['status'](_0x1af648)[_0x5a6b('0x15')](_0x2b2556);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 53eb3bc..2b10ec6 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 _0xdf29=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','save'];(function(_0x5a1cc9,_0x28f54d){var _0x471761=function(_0xda51c0){while(--_0xda51c0){_0x5a1cc9['push'](_0x5a1cc9['shift']());}};_0x471761(++_0x28f54d);}(_0xdf29,0x1ad));var _0x9df2=function(_0x57d098,_0x34ab6d){_0x57d098=_0x57d098-0x0;var _0x116d64=_0xdf29[_0x57d098];return _0x116d64;};'use strict';var EventEmitter=require(_0x9df2('0x0'));var VoiceExtension=require(_0x9df2('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9df2('0x2'),'afterUpdate':'update','afterDestroy':_0x9df2('0x3')};function emitEvent(_0x45aa30){return function(_0x34c53b,_0x4f6382,_0x1757a2){VoiceExtensionEvents[_0x9df2('0x4')](_0x45aa30+':'+_0x34c53b['id'],_0x34c53b);VoiceExtensionEvents[_0x9df2('0x4')](_0x45aa30,_0x34c53b);_0x1757a2(null);};}for(var e in events){if(events[_0x9df2('0x5')](e)){var event=events[e];VoiceExtension[_0x9df2('0x6')](e,emitEvent(event));}}module[_0x9df2('0x7')]=VoiceExtensionEvents; \ No newline at end of file +var _0x6fdd=['save','update','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x42b8ad,_0x5f0671){var _0x1802fa=function(_0x583e40){while(--_0x583e40){_0x42b8ad['push'](_0x42b8ad['shift']());}};_0x1802fa(++_0x5f0671);}(_0x6fdd,0xe4));var _0xd6fd=function(_0x1af98d,_0x3c608e){_0x1af98d=_0x1af98d-0x0;var _0x3553ea=_0x6fdd[_0x1af98d];return _0x3553ea;};'use strict';var EventEmitter=require(_0xd6fd('0x0'));var VoiceExtension=require(_0xd6fd('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xd6fd('0x2')](0x0);var events={'afterCreate':_0xd6fd('0x3'),'afterUpdate':_0xd6fd('0x4'),'afterDestroy':'remove'};function emitEvent(_0x507082){return function(_0x16055d,_0x4b3d27,_0x5aab79){VoiceExtensionEvents['emit'](_0x507082+':'+_0x16055d['id'],_0x16055d);VoiceExtensionEvents['emit'](_0x507082,_0x16055d);_0x5aab79(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0xd6fd('0x5')](e,emitEvent(event));}}module[_0xd6fd('0x6')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index cb4d282..79e454b 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 _0x54fa=['callerID','NoOp(No\x20number\x20available)','playback','includes','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','appdata','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','priority','concat','catch','define','VoiceExtension','voice_extensions','get','last','lodash','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','context','exten','alias','CDR(routeAlias)=','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','NoOp','No\x20alias\x20set','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','options','url','split','length','name','trunk','param','phone','prefix','SIP','indexOf','replace','U(xcally-mixmonitor-context)','join','Interval','IntervalId','then','*,*,*,*','intervals','interval','map','filter','tag','toLowerCase'];(function(_0x5a6e25,_0x1cf561){var _0x5d87cc=function(_0x38f134){while(--_0x38f134){_0x5a6e25['push'](_0x5a6e25['shift']());}};_0x5d87cc(++_0x1cf561);}(_0x54fa,0xba));var _0xa54f=function(_0x57fc2a,_0x14bbe5){_0x57fc2a=_0x57fc2a-0x0;var _0xa839b=_0x54fa[_0x57fc2a];return _0xa839b;};'use strict';var _=require(_0xa54f('0x0'));var attributes=require(_0xa54f('0x1'));module[_0xa54f('0x2')]=function(_0x440838){var _0x1a2709=_0x440838[_0xa54f('0x3')];function _0x389230(_0x4a5a2c){var _0x4805e2=0x2;var _0x33b015=[{'type':_0x4a5a2c[_0xa54f('0x4')],'app':_0xa54f('0x5'),'appdata':_0xa54f('0x6')+_0x4a5a2c[_0xa54f('0x4')],'context':_0x4a5a2c[_0xa54f('0x7')],'exten':_0x4a5a2c[_0xa54f('0x8')],'priority':_0x4805e2++,'VoiceExtensionId':_0x4a5a2c['id']},{'type':_0x4a5a2c['type'],'app':_0x4a5a2c[_0xa54f('0x9')]?_0xa54f('0x5'):'NoOp','appdata':_0x4a5a2c['alias']?_0xa54f('0xa')+_0x4a5a2c[_0xa54f('0x9')]:'No\x20alias\x20set','context':_0x4a5a2c[_0xa54f('0x7')],'exten':_0x4a5a2c[_0xa54f('0x8')],'priority':_0x4805e2++,'VoiceExtensionId':_0x4a5a2c['id']}];if(_0x4a5a2c['type']===_0xa54f('0xb')){_0x33b015[_0xa54f('0xc')]({'type':'inbound','app':_0xa54f('0x5'),'appdata':_0xa54f('0xd')+_0x4a5a2c['id'],'context':_0x4a5a2c[_0xa54f('0x7')],'exten':_0x4a5a2c[_0xa54f('0x8')],'priority':_0x4805e2++,'VoiceExtensionId':_0x4a5a2c['id']});}_0x33b015['push']({'type':_0x4a5a2c[_0xa54f('0x4')],'app':_0xa54f('0x5'),'appdata':_0xa54f('0xe'),'context':_0x4a5a2c[_0xa54f('0x7')],'exten':_0x4a5a2c[_0xa54f('0x8')],'priority':_0x4805e2++,'VoiceExtensionId':_0x4a5a2c['id']},{'type':_0x4a5a2c[_0xa54f('0x4')],'app':_0xa54f('0x5'),'appdata':_0xa54f('0xf'),'context':_0x4a5a2c['context'],'exten':_0x4a5a2c[_0xa54f('0x8')],'priority':_0x4805e2++,'VoiceExtensionId':_0x4a5a2c['id']},{'type':_0x4a5a2c[_0xa54f('0x4')],'app':_0xa54f('0x5'),'appdata':_0xa54f('0x10'),'context':_0x4a5a2c[_0xa54f('0x7')],'exten':_0x4a5a2c[_0xa54f('0x8')],'priority':_0x4805e2++,'VoiceExtensionId':_0x4a5a2c['id']});return _0x33b015;}function _0x34af29(_0x4b1604){var _0x4548b2=0x2;var _0x2face3=[{'type':_0xa54f('0x11'),'app':_0xa54f('0x5'),'appdata':_0xa54f('0x12'),'context':_0x4b1604[_0xa54f('0x7')],'exten':_0x4b1604[_0xa54f('0x8')],'priority':_0x4548b2++,'VoiceExtensionId':_0x4b1604['id']},{'type':_0xa54f('0x11'),'app':_0x4b1604[_0xa54f('0x9')]?_0xa54f('0x5'):_0xa54f('0x13'),'appdata':_0x4b1604[_0xa54f('0x9')]?_0xa54f('0xa')+_0x4b1604['alias']:_0xa54f('0x14'),'context':_0x4b1604[_0xa54f('0x7')],'exten':_0x4b1604[_0xa54f('0x8')],'priority':_0x4548b2++,'VoiceExtensionId':_0x4b1604['id']},{'type':_0xa54f('0x11'),'app':_0xa54f('0x5'),'appdata':_0xa54f('0x15')+(_0x4b1604[_0xa54f('0x16')]?_0xa54f('0x17')+_0x4b1604[_0xa54f('0x16')]+'}':_0xa54f('0x18')),'context':_0x4b1604[_0xa54f('0x7')],'exten':_0x4b1604[_0xa54f('0x8')],'priority':_0x4548b2++,'VoiceExtensionId':_0x4b1604['id']},{'type':_0xa54f('0x11'),'app':_0xa54f('0x5'),'appdata':_0xa54f('0xd')+_0x4b1604['id'],'context':_0x4b1604[_0xa54f('0x7')],'exten':_0x4b1604[_0xa54f('0x8')],'priority':_0x4548b2++,'VoiceExtensionId':_0x4b1604['id']},{'type':_0xa54f('0x11'),'app':_0xa54f('0x19'),'appdata':_0xa54f('0x1a')+(_0x4548b2+0x2)+_0xa54f('0x1b')+(_0x4548b2+0x1)+')','context':_0x4b1604[_0xa54f('0x7')],'exten':_0x4b1604[_0xa54f('0x8')],'priority':_0x4548b2++,'VoiceExtensionId':_0x4b1604['id']},{'type':_0xa54f('0x11'),'app':_0xa54f('0x5'),'appdata':_0x4b1604[_0xa54f('0x16')]?_0xa54f('0x1c')+_0x4b1604[_0xa54f('0x16')]+'}':_0xa54f('0x1d'),'context':_0x4b1604[_0xa54f('0x7')],'exten':_0x4b1604[_0xa54f('0x8')],'priority':_0x4548b2++,'VoiceExtensionId':_0x4b1604['id']},{'type':_0xa54f('0x11'),'app':_0xa54f('0x5'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x4b1604[_0xa54f('0x7')],'exten':_0x4b1604[_0xa54f('0x8')],'priority':_0x4548b2++,'VoiceExtensionId':_0x4b1604['id']},{'type':_0xa54f('0x11'),'app':_0xa54f('0x5'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x4b1604[_0xa54f('0x7')],'exten':_0x4b1604[_0xa54f('0x8')],'priority':_0x4548b2++,'VoiceExtensionId':_0x4b1604['id']},{'type':'outbound','app':_0xa54f('0x5'),'appdata':_0xa54f('0x10'),'context':_0x4b1604[_0xa54f('0x7')],'exten':_0x4b1604['exten'],'priority':_0x4548b2++,'VoiceExtensionId':_0x4b1604['id']},{'type':_0xa54f('0x11'),'app':_0xa54f('0x5'),'appdata':'outboundrouteid='+_0x4b1604['id'],'context':_0x4b1604[_0xa54f('0x7')],'exten':_0x4b1604['exten'],'priority':_0x4548b2++,'VoiceExtensionId':_0x4b1604['id']}];if(_0x4b1604[_0xa54f('0x1e')]('recordingFormat')&&_0x4b1604[_0xa54f('0x1f')]!==_0xa54f('0x20')){_0x2face3[_0xa54f('0xc')]({'type':_0xa54f('0x11'),'app':_0xa54f('0x5'),'appdata':_0xa54f('0x21'),'context':_0x4b1604[_0xa54f('0x7')],'exten':_0x4b1604[_0xa54f('0x8')],'priority':_0x4548b2++,'VoiceExtensionId':_0x4b1604['id']},{'type':'outbound','app':'Set','appdata':_0xa54f('0x22')+_0x4b1604[_0xa54f('0x1f')]||_0xa54f('0x23'),'context':_0x4b1604[_0xa54f('0x7')],'exten':_0x4b1604[_0xa54f('0x8')],'priority':_0x4548b2++,'VoiceExtensionId':_0x4b1604['id']});}return _0x2face3;}function _0xf873fe(_0x2d1493,_0x1980d4){var _0x462a3d=[{'name':'trunk','param':0x0},{'name':'timeout','param':0x1},{'name':_0xa54f('0x24'),'param':0x2},{'name':_0xa54f('0x25'),'param':0x3}];var _0x51f84b={};var _0x213265=_0x1980d4[_0xa54f('0x26')](',');var _0x2dd6b1=[];for(var _0x4a01c9=0x0;_0x4a01c9<_0x462a3d[_0xa54f('0x27')];_0x4a01c9++){switch(_0x462a3d[_0x4a01c9][_0xa54f('0x28')]){case _0xa54f('0x29'):_0x51f84b[_0xa54f('0x29')]=_0x213265[_0x462a3d[_0x4a01c9][_0xa54f('0x2a')]]['split']('/')[0x1];_0x51f84b[_0xa54f('0x2b')]=_0x213265[_0x462a3d[_0x4a01c9][_0xa54f('0x2a')]][_0xa54f('0x26')]('/')[0x2];_0x51f84b[_0xa54f('0x2c')]=_0x51f84b['phone']?_0x51f84b[_0xa54f('0x2b')][_0xa54f('0x26')]('$')[0x0]:undefined;_0x51f84b[_0xa54f('0x2b')]=_0x2d1493[_0xa54f('0x16')]?(_0x51f84b[_0xa54f('0x2c')]||'')+'${EXTEN:'+_0x2d1493[_0xa54f('0x16')]+'}':(_0x51f84b['prefix']||'')+_0xa54f('0x18');_0x2dd6b1[_0x462a3d[_0x4a01c9][_0xa54f('0x2a')]]=[_0xa54f('0x2d'),_0x51f84b['trunk'],_0x51f84b['phone']]['join']('/');break;case _0xa54f('0x24'):_0x51f84b['options']=_0x213265[_0x462a3d[_0x4a01c9][_0xa54f('0x2a')]];if(_0x2d1493[_0xa54f('0x1f')]!==_0xa54f('0x20')){if(_0x51f84b[_0xa54f('0x24')][_0xa54f('0x2e')]('U(xcally-mixmonitor-context)')<0x0){_0x51f84b[_0xa54f('0x24')]+='U(xcally-mixmonitor-context)';}}else{_0x51f84b[_0xa54f('0x24')]=_0x51f84b[_0xa54f('0x24')][_0xa54f('0x2f')](_0xa54f('0x30'),'');}_0x2dd6b1[_0x462a3d[_0x4a01c9]['param']]=_0x51f84b[_0xa54f('0x24')];break;default:_0x2dd6b1[_0x462a3d[_0x4a01c9][_0xa54f('0x2a')]]=_0x213265[_0x462a3d[_0x4a01c9]['param']];}}return _0x2dd6b1[_0xa54f('0x31')](',');}function _0x573ad1(_0x24d84c,_0x4d8485,_0x59ad45){return new Promise(function(_0x4af86e,_0x470a19){var _0x6d1e7e=[];if(_['isEmpty'](_0x4d8485))return _0x4af86e(_0x6d1e7e);_0x1a2709[_0xa54f('0x32')]['findAll']({'attributes':['id','interval',_0xa54f('0x33')],'raw':!![]})[_0xa54f('0x34')](function(_0x1fea48){for(var _0x1e10a5=0x0,_0xbea0df=0x0;_0x1e10a5<_0x4d8485[_0xa54f('0x27')];_0x1e10a5++,_0xbea0df=0x0){var _0x33e88e=_0x4d8485[_0x1e10a5];var _0x2fcd6c=[];var _0x91c3f6=[];delete _0x33e88e['id'];if(_0x33e88e['interval']!==_0xa54f('0x35')){_0x33e88e[_0xa54f('0x36')]=[_0x33e88e[_0xa54f('0x37')]];}else{_0x33e88e['intervals']=_0x33e88e['IntervalId']?_[_0xa54f('0x38')](_[_0xa54f('0x39')](_0x1fea48,{'IntervalId':_0x33e88e[_0xa54f('0x33')]}),_0xa54f('0x37')):[];}_0x33e88e[_0xa54f('0x7')]=_0x24d84c[_0xa54f('0x7')];_0x33e88e['exten']=_0x24d84c[_0xa54f('0x8')];if(_0x33e88e[_0xa54f('0x4')])_0x33e88e[_0xa54f('0x4')]=_0x33e88e[_0xa54f('0x4')]['toLowerCase']();if(_0x24d84c[_0xa54f('0x4')]===_0xa54f('0x11')){if(_0x33e88e[_0xa54f('0x1e')](_0xa54f('0x3a'))&&_0x33e88e[_0xa54f('0x3a')]&&_0x33e88e[_0xa54f('0x3a')]!=='--'){_0x2fcd6c[_0xa54f('0xc')]({'type':_0x33e88e['type'][_0xa54f('0x3b')](),'app':'Set','appdata':'CDR(tag)='+_0x33e88e[_0xa54f('0x3a')],'context':_0x24d84c[_0xa54f('0x7')],'exten':_0x24d84c[_0xa54f('0x8')],'priority':_0x33e88e[_0xa54f('0x36')]['length']+_0x59ad45+_0xbea0df++,'VoiceExtensionId':_0x24d84c['id']});}_0x2fcd6c[_0xa54f('0xc')]({'type':_0x33e88e['type'][_0xa54f('0x3b')](),'app':_0xa54f('0x19'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x33e88e['callerID']?'Set(CALLERID(all)='+_0x33e88e[_0xa54f('0x3c')]+')':_0xa54f('0x3d')),'context':_0x24d84c[_0xa54f('0x7')],'exten':_0x24d84c['exten'],'priority':_0x33e88e[_0xa54f('0x36')][_0xa54f('0x27')]+_0x59ad45+_0xbea0df++,'VoiceExtensionId':_0x24d84c['id']});}else{if(_0x33e88e[_0xa54f('0x1e')]('answer')){if(['queue',_0xa54f('0x3e')][_0xa54f('0x3f')](_0x33e88e['app'][_0xa54f('0x3b')]())&&_0x33e88e[_0xa54f('0x40')]!=='custom'){if(_0x33e88e['answer']){_0x2fcd6c[_0xa54f('0xc')]({'type':_0x33e88e[_0xa54f('0x4')][_0xa54f('0x3b')](),'app':_0xa54f('0x19'),'appdata':_0xa54f('0x41'),'context':_0x24d84c[_0xa54f('0x7')],'exten':_0x24d84c[_0xa54f('0x8')],'priority':_0x33e88e[_0xa54f('0x36')]['length']+_0x59ad45+_0xbea0df++,'VoiceExtensionId':_0x24d84c['id']});_0x2fcd6c[_0xa54f('0xc')]({'type':_0x33e88e['type']['toLowerCase'](),'app':_0xa54f('0x5'),'appdata':_0xa54f('0x42'),'context':_0x24d84c['context'],'exten':_0x24d84c[_0xa54f('0x8')],'priority':_0x33e88e['intervals']['length']+_0x59ad45+_0xbea0df++,'VoiceExtensionId':_0x24d84c['id']});}else{_0x2fcd6c['push']({'type':_0x33e88e['type'][_0xa54f('0x3b')](),'app':_0xa54f('0x19'),'appdata':_0xa54f('0x43'),'context':_0x24d84c[_0xa54f('0x7')],'exten':_0x24d84c[_0xa54f('0x8')],'priority':_0x33e88e[_0xa54f('0x36')]['length']+_0x59ad45+_0xbea0df++,'VoiceExtensionId':_0x24d84c['id']});_0x2fcd6c[_0xa54f('0xc')]({'type':_0x33e88e['type'][_0xa54f('0x3b')](),'app':_0xa54f('0x5'),'appdata':_0xa54f('0x44'),'context':_0x24d84c[_0xa54f('0x7')],'exten':_0x24d84c[_0xa54f('0x8')],'priority':_0x33e88e[_0xa54f('0x36')][_0xa54f('0x27')]+_0x59ad45+_0xbea0df++,'VoiceExtensionId':_0x24d84c['id']});}}}}for(var _0x24015b=0x0;_0x24015b<_0x33e88e[_0xa54f('0x36')]['length'];_0x24015b++){var _0x386304=_0x59ad45+_0x33e88e[_0xa54f('0x36')][_0xa54f('0x27')];var _0x4e7571=_0x24015b===_0x33e88e[_0xa54f('0x36')]['length']-0x1?_0x59ad45+_0x2fcd6c[_0xa54f('0x27')]+_0x91c3f6[_0xa54f('0x27')]+0x2:_0x59ad45+_0x24015b+0x1;_0x2fcd6c[_0xa54f('0x45')](_0x24015b,0x0,{'type':_0x24d84c[_0xa54f('0x4')],'app':_0xa54f('0x46'),'appdata':_0x33e88e[_0xa54f('0x36')][_0x24015b]+'?'+_0x24d84c[_0xa54f('0x7')]+_0xa54f('0x47')+_0x386304+':'+_0x24d84c[_0xa54f('0x7')]+_0xa54f('0x47')+_0x4e7571,'exten':_0x24d84c[_0xa54f('0x8')],'context':_0x24d84c[_0xa54f('0x7')],'priority':_0x59ad45+_0x24015b,'VoiceExtensionId':_0x24d84c['id']});}if(_0x33e88e[_0xa54f('0x40')]==='outboundDial'){_0x33e88e[_0xa54f('0x48')]=_0xf873fe(_0x24d84c,_0x33e88e[_0xa54f('0x48')]);}if(_0x33e88e[_0xa54f('0x40')]==='agi'){_0x2fcd6c[_0xa54f('0xc')]({'type':_0x33e88e[_0xa54f('0x4')][_0xa54f('0x3b')](),'app':_0xa54f('0x5'),'appdata':_0xa54f('0x49'),'context':_0x24d84c[_0xa54f('0x7')],'exten':_0x24d84c['exten'],'priority':_0x33e88e['intervals'][_0xa54f('0x27')]+_0x59ad45+_0xbea0df++,'VoiceExtensionId':_0x24d84c['id']});}_0x33e88e[_0xa54f('0x4a')]=_0x2fcd6c[_0xa54f('0x27')]?_['last'](_0x2fcd6c)['priority']+0x1:_0x59ad45;_0x6d1e7e=_[_0xa54f('0x4b')](_0x6d1e7e,_0x2fcd6c,[_0x33e88e],_0x91c3f6);_0x59ad45=_['last'](_0x6d1e7e)[_0xa54f('0x4a')]+0x1;}return _0x4af86e(_0x6d1e7e);})[_0xa54f('0x4c')](function(_0x148514){_0x470a19(_0x148514);});});}return _0x440838[_0xa54f('0x4d')](_0xa54f('0x4e'),attributes,{'tableName':_0xa54f('0x4f'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x5ed61b){var _0x4c29e2=this[_0xa54f('0x50')]({'plain':!![]});var _0x7b1518=_0x4c29e2['type']===_0xa54f('0x11')?_0x34af29(_0x4c29e2):_0x389230(_0x4c29e2);return _0x573ad1(_0x4c29e2,_0x5ed61b,_[_0xa54f('0x51')](_0x7b1518)[_0xa54f('0x4a')]+0x1)[_0xa54f('0x34')](function(_0x158a64){var _0x5dc077=_[_0xa54f('0x4b')](_0x7b1518,_0x158a64);_0x5dc077[_0xa54f('0xc')]({'type':_0x4c29e2[_0xa54f('0x4')],'app':'Hangup','exten':_0x4c29e2['exten'],'context':_0x4c29e2[_0xa54f('0x7')],'priority':_[_0xa54f('0x51')](_0x5dc077)['priority']+0x1,'VoiceExtensionId':_0x4c29e2['id']});return _0x5dc077;});}}});}; \ No newline at end of file +var _0xea15=['IntervalId','*,*,*,*','intervals','map','filter','toLowerCase','tag','CDR(tag)=','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','Set(CALLERID(all)=','callerID','answer','queue','playback','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','agi','priority','last','concat','catch','define','VoiceExtension','voice_extensions','get','then','Hangup','lodash','./voiceExtension.attributes','exports','models','type','Set','context','exten','alias','NoOp','inbound','CDR(routeid)=','push','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(routeAlias)=','No\x20alias\x20set','cutdigits','${EXTEN:','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','none','recordingFormat','trunk','timeout','url','split','length','name','param','phone','prefix','join','options','indexOf','U(xcally-mixmonitor-context)','replace','Interval','findAll','interval'];(function(_0x18e987,_0x5d2624){var _0x258534=function(_0x534e88){while(--_0x534e88){_0x18e987['push'](_0x18e987['shift']());}};_0x258534(++_0x5d2624);}(_0xea15,0x1c9));var _0x5ea1=function(_0x2e1675,_0x270807){_0x2e1675=_0x2e1675-0x0;var _0x2735b5=_0xea15[_0x2e1675];return _0x2735b5;};'use strict';var _=require(_0x5ea1('0x0'));var attributes=require(_0x5ea1('0x1'));module[_0x5ea1('0x2')]=function(_0x49215a){var _0xfa23a2=_0x49215a[_0x5ea1('0x3')];function _0x2ae52c(_0xc288d5){var _0x3ad150=0x2;var _0x1d4fff=[{'type':_0xc288d5[_0x5ea1('0x4')],'app':_0x5ea1('0x5'),'appdata':'CDR(type)='+_0xc288d5['type'],'context':_0xc288d5[_0x5ea1('0x6')],'exten':_0xc288d5[_0x5ea1('0x7')],'priority':_0x3ad150++,'VoiceExtensionId':_0xc288d5['id']},{'type':_0xc288d5[_0x5ea1('0x4')],'app':_0xc288d5[_0x5ea1('0x8')]?_0x5ea1('0x5'):_0x5ea1('0x9'),'appdata':_0xc288d5['alias']?'CDR(routeAlias)='+_0xc288d5[_0x5ea1('0x8')]:'No\x20alias\x20set','context':_0xc288d5[_0x5ea1('0x6')],'exten':_0xc288d5[_0x5ea1('0x7')],'priority':_0x3ad150++,'VoiceExtensionId':_0xc288d5['id']}];if(_0xc288d5[_0x5ea1('0x4')]===_0x5ea1('0xa')){_0x1d4fff['push']({'type':'inbound','app':_0x5ea1('0x5'),'appdata':_0x5ea1('0xb')+_0xc288d5['id'],'context':_0xc288d5[_0x5ea1('0x6')],'exten':_0xc288d5[_0x5ea1('0x7')],'priority':_0x3ad150++,'VoiceExtensionId':_0xc288d5['id']});}_0x1d4fff[_0x5ea1('0xc')]({'type':_0xc288d5[_0x5ea1('0x4')],'app':_0x5ea1('0x5'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0xc288d5[_0x5ea1('0x6')],'exten':_0xc288d5[_0x5ea1('0x7')],'priority':_0x3ad150++,'VoiceExtensionId':_0xc288d5['id']},{'type':_0xc288d5[_0x5ea1('0x4')],'app':_0x5ea1('0x5'),'appdata':_0x5ea1('0xd'),'context':_0xc288d5[_0x5ea1('0x6')],'exten':_0xc288d5[_0x5ea1('0x7')],'priority':_0x3ad150++,'VoiceExtensionId':_0xc288d5['id']},{'type':_0xc288d5['type'],'app':'Set','appdata':_0x5ea1('0xe'),'context':_0xc288d5[_0x5ea1('0x6')],'exten':_0xc288d5[_0x5ea1('0x7')],'priority':_0x3ad150++,'VoiceExtensionId':_0xc288d5['id']});return _0x1d4fff;}function _0x175c3e(_0xf9b2c){var _0x416518=0x2;var _0x4afed7=[{'type':_0x5ea1('0xf'),'app':_0x5ea1('0x5'),'appdata':_0x5ea1('0x10'),'context':_0xf9b2c[_0x5ea1('0x6')],'exten':_0xf9b2c['exten'],'priority':_0x416518++,'VoiceExtensionId':_0xf9b2c['id']},{'type':_0x5ea1('0xf'),'app':_0xf9b2c['alias']?_0x5ea1('0x5'):_0x5ea1('0x9'),'appdata':_0xf9b2c['alias']?_0x5ea1('0x11')+_0xf9b2c[_0x5ea1('0x8')]:_0x5ea1('0x12'),'context':_0xf9b2c[_0x5ea1('0x6')],'exten':_0xf9b2c[_0x5ea1('0x7')],'priority':_0x416518++,'VoiceExtensionId':_0xf9b2c['id']},{'type':_0x5ea1('0xf'),'app':'Set','appdata':'CDR(destination)='+(_0xf9b2c[_0x5ea1('0x13')]?_0x5ea1('0x14')+_0xf9b2c[_0x5ea1('0x13')]+'}':_0x5ea1('0x15')),'context':_0xf9b2c[_0x5ea1('0x6')],'exten':_0xf9b2c['exten'],'priority':_0x416518++,'VoiceExtensionId':_0xf9b2c['id']},{'type':_0x5ea1('0xf'),'app':_0x5ea1('0x5'),'appdata':_0x5ea1('0xb')+_0xf9b2c['id'],'context':_0xf9b2c[_0x5ea1('0x6')],'exten':_0xf9b2c['exten'],'priority':_0x416518++,'VoiceExtensionId':_0xf9b2c['id']},{'type':_0x5ea1('0xf'),'app':'ExecIf','appdata':_0x5ea1('0x16')+(_0x416518+0x2)+_0x5ea1('0x17')+(_0x416518+0x1)+')','context':_0xf9b2c['context'],'exten':_0xf9b2c['exten'],'priority':_0x416518++,'VoiceExtensionId':_0xf9b2c['id']},{'type':_0x5ea1('0xf'),'app':'Set','appdata':_0xf9b2c[_0x5ea1('0x13')]?_0x5ea1('0x18')+_0xf9b2c['cutdigits']+'}':_0x5ea1('0x19'),'context':_0xf9b2c['context'],'exten':_0xf9b2c[_0x5ea1('0x7')],'priority':_0x416518++,'VoiceExtensionId':_0xf9b2c['id']},{'type':'outbound','app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0xf9b2c[_0x5ea1('0x6')],'exten':_0xf9b2c[_0x5ea1('0x7')],'priority':_0x416518++,'VoiceExtensionId':_0xf9b2c['id']},{'type':'outbound','app':_0x5ea1('0x5'),'appdata':_0x5ea1('0xd'),'context':_0xf9b2c[_0x5ea1('0x6')],'exten':_0xf9b2c[_0x5ea1('0x7')],'priority':_0x416518++,'VoiceExtensionId':_0xf9b2c['id']},{'type':'outbound','app':_0x5ea1('0x5'),'appdata':'MONITOR_OPTIONS=ab','context':_0xf9b2c['context'],'exten':_0xf9b2c[_0x5ea1('0x7')],'priority':_0x416518++,'VoiceExtensionId':_0xf9b2c['id']},{'type':_0x5ea1('0xf'),'app':_0x5ea1('0x5'),'appdata':_0x5ea1('0x1a')+_0xf9b2c['id'],'context':_0xf9b2c[_0x5ea1('0x6')],'exten':_0xf9b2c[_0x5ea1('0x7')],'priority':_0x416518++,'VoiceExtensionId':_0xf9b2c['id']}];if(_0xf9b2c[_0x5ea1('0x1b')]('recordingFormat')&&_0xf9b2c['recordingFormat']!==_0x5ea1('0x1c')){_0x4afed7['push']({'type':'outbound','app':_0x5ea1('0x5'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0xf9b2c[_0x5ea1('0x6')],'exten':_0xf9b2c[_0x5ea1('0x7')],'priority':_0x416518++,'VoiceExtensionId':_0xf9b2c['id']},{'type':'outbound','app':_0x5ea1('0x5'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0xf9b2c[_0x5ea1('0x1d')]||'wav','context':_0xf9b2c[_0x5ea1('0x6')],'exten':_0xf9b2c[_0x5ea1('0x7')],'priority':_0x416518++,'VoiceExtensionId':_0xf9b2c['id']});}return _0x4afed7;}function _0x570e75(_0x3d4fd7,_0xe7d914){var _0x16b687=[{'name':_0x5ea1('0x1e'),'param':0x0},{'name':_0x5ea1('0x1f'),'param':0x1},{'name':'options','param':0x2},{'name':_0x5ea1('0x20'),'param':0x3}];var _0xf15aa3={};var _0x3d5931=_0xe7d914[_0x5ea1('0x21')](',');var _0x4ea82b=[];for(var _0xec7b4a=0x0;_0xec7b4a<_0x16b687[_0x5ea1('0x22')];_0xec7b4a++){switch(_0x16b687[_0xec7b4a][_0x5ea1('0x23')]){case'trunk':_0xf15aa3[_0x5ea1('0x1e')]=_0x3d5931[_0x16b687[_0xec7b4a][_0x5ea1('0x24')]][_0x5ea1('0x21')]('/')[0x1];_0xf15aa3[_0x5ea1('0x25')]=_0x3d5931[_0x16b687[_0xec7b4a][_0x5ea1('0x24')]][_0x5ea1('0x21')]('/')[0x2];_0xf15aa3['prefix']=_0xf15aa3['phone']?_0xf15aa3[_0x5ea1('0x25')][_0x5ea1('0x21')]('$')[0x0]:undefined;_0xf15aa3[_0x5ea1('0x25')]=_0x3d4fd7['cutdigits']?(_0xf15aa3['prefix']||'')+_0x5ea1('0x14')+_0x3d4fd7[_0x5ea1('0x13')]+'}':(_0xf15aa3[_0x5ea1('0x26')]||'')+_0x5ea1('0x15');_0x4ea82b[_0x16b687[_0xec7b4a][_0x5ea1('0x24')]]=['SIP',_0xf15aa3[_0x5ea1('0x1e')],_0xf15aa3[_0x5ea1('0x25')]][_0x5ea1('0x27')]('/');break;case _0x5ea1('0x28'):_0xf15aa3[_0x5ea1('0x28')]=_0x3d5931[_0x16b687[_0xec7b4a]['param']];if(_0x3d4fd7[_0x5ea1('0x1d')]!==_0x5ea1('0x1c')){if(_0xf15aa3[_0x5ea1('0x28')][_0x5ea1('0x29')](_0x5ea1('0x2a'))<0x0){_0xf15aa3[_0x5ea1('0x28')]+=_0x5ea1('0x2a');}}else{_0xf15aa3[_0x5ea1('0x28')]=_0xf15aa3['options'][_0x5ea1('0x2b')](_0x5ea1('0x2a'),'');}_0x4ea82b[_0x16b687[_0xec7b4a][_0x5ea1('0x24')]]=_0xf15aa3['options'];break;default:_0x4ea82b[_0x16b687[_0xec7b4a][_0x5ea1('0x24')]]=_0x3d5931[_0x16b687[_0xec7b4a][_0x5ea1('0x24')]];}}return _0x4ea82b['join'](',');}function _0x146868(_0x58a5cc,_0x515f91,_0x5827c1){return new Promise(function(_0x34f512,_0x42d634){var _0x514651=[];if(_['isEmpty'](_0x515f91))return _0x34f512(_0x514651);_0xfa23a2[_0x5ea1('0x2c')][_0x5ea1('0x2d')]({'attributes':['id',_0x5ea1('0x2e'),_0x5ea1('0x2f')],'raw':!![]})['then'](function(_0x318dd4){for(var _0x25d7ab=0x0,_0x3c16f5=0x0;_0x25d7ab<_0x515f91[_0x5ea1('0x22')];_0x25d7ab++,_0x3c16f5=0x0){var _0x917a61=_0x515f91[_0x25d7ab];var _0x3e1610=[];var _0x814933=[];delete _0x917a61['id'];if(_0x917a61[_0x5ea1('0x2e')]!==_0x5ea1('0x30')){_0x917a61[_0x5ea1('0x31')]=[_0x917a61[_0x5ea1('0x2e')]];}else{_0x917a61[_0x5ea1('0x31')]=_0x917a61['IntervalId']?_[_0x5ea1('0x32')](_[_0x5ea1('0x33')](_0x318dd4,{'IntervalId':_0x917a61[_0x5ea1('0x2f')]}),_0x5ea1('0x2e')):[];}_0x917a61['context']=_0x58a5cc[_0x5ea1('0x6')];_0x917a61[_0x5ea1('0x7')]=_0x58a5cc['exten'];if(_0x917a61[_0x5ea1('0x4')])_0x917a61[_0x5ea1('0x4')]=_0x917a61[_0x5ea1('0x4')][_0x5ea1('0x34')]();if(_0x58a5cc['type']===_0x5ea1('0xf')){if(_0x917a61[_0x5ea1('0x1b')]('tag')&&_0x917a61[_0x5ea1('0x35')]&&_0x917a61[_0x5ea1('0x35')]!=='--'){_0x3e1610['push']({'type':_0x917a61['type'][_0x5ea1('0x34')](),'app':'Set','appdata':_0x5ea1('0x36')+_0x917a61['tag'],'context':_0x58a5cc[_0x5ea1('0x6')],'exten':_0x58a5cc[_0x5ea1('0x7')],'priority':_0x917a61['intervals'][_0x5ea1('0x22')]+_0x5827c1+_0x3c16f5++,'VoiceExtensionId':_0x58a5cc['id']});}_0x3e1610[_0x5ea1('0xc')]({'type':_0x917a61[_0x5ea1('0x4')][_0x5ea1('0x34')](),'app':_0x5ea1('0x37'),'appdata':_0x5ea1('0x38')+(_0x917a61['callerID']?_0x5ea1('0x39')+_0x917a61[_0x5ea1('0x3a')]+')':'NoOp(No\x20number\x20available)'),'context':_0x58a5cc[_0x5ea1('0x6')],'exten':_0x58a5cc[_0x5ea1('0x7')],'priority':_0x917a61[_0x5ea1('0x31')][_0x5ea1('0x22')]+_0x5827c1+_0x3c16f5++,'VoiceExtensionId':_0x58a5cc['id']});}else{if(_0x917a61['hasOwnProperty'](_0x5ea1('0x3b'))){if([_0x5ea1('0x3c'),_0x5ea1('0x3d')]['includes'](_0x917a61['app'][_0x5ea1('0x34')]())&&_0x917a61[_0x5ea1('0x3e')]!==_0x5ea1('0x3f')){if(_0x917a61[_0x5ea1('0x3b')]){_0x3e1610[_0x5ea1('0xc')]({'type':_0x917a61['type']['toLowerCase'](),'app':_0x5ea1('0x37'),'appdata':_0x5ea1('0x40'),'context':_0x58a5cc['context'],'exten':_0x58a5cc[_0x5ea1('0x7')],'priority':_0x917a61[_0x5ea1('0x31')]['length']+_0x5827c1+_0x3c16f5++,'VoiceExtensionId':_0x58a5cc['id']});_0x3e1610[_0x5ea1('0xc')]({'type':_0x917a61[_0x5ea1('0x4')][_0x5ea1('0x34')](),'app':'Set','appdata':_0x5ea1('0x41'),'context':_0x58a5cc[_0x5ea1('0x6')],'exten':_0x58a5cc[_0x5ea1('0x7')],'priority':_0x917a61[_0x5ea1('0x31')][_0x5ea1('0x22')]+_0x5827c1+_0x3c16f5++,'VoiceExtensionId':_0x58a5cc['id']});}else{_0x3e1610['push']({'type':_0x917a61[_0x5ea1('0x4')][_0x5ea1('0x34')](),'app':_0x5ea1('0x37'),'appdata':_0x5ea1('0x42'),'context':_0x58a5cc[_0x5ea1('0x6')],'exten':_0x58a5cc['exten'],'priority':_0x917a61[_0x5ea1('0x31')][_0x5ea1('0x22')]+_0x5827c1+_0x3c16f5++,'VoiceExtensionId':_0x58a5cc['id']});_0x3e1610[_0x5ea1('0xc')]({'type':_0x917a61['type'][_0x5ea1('0x34')](),'app':'Set','appdata':_0x5ea1('0x43'),'context':_0x58a5cc[_0x5ea1('0x6')],'exten':_0x58a5cc[_0x5ea1('0x7')],'priority':_0x917a61[_0x5ea1('0x31')]['length']+_0x5827c1+_0x3c16f5++,'VoiceExtensionId':_0x58a5cc['id']});}}}}for(var _0x16b3aa=0x0;_0x16b3aa<_0x917a61['intervals'][_0x5ea1('0x22')];_0x16b3aa++){var _0x223e4d=_0x5827c1+_0x917a61[_0x5ea1('0x31')][_0x5ea1('0x22')];var _0x1af856=_0x16b3aa===_0x917a61[_0x5ea1('0x31')][_0x5ea1('0x22')]-0x1?_0x5827c1+_0x3e1610['length']+_0x814933[_0x5ea1('0x22')]+0x2:_0x5827c1+_0x16b3aa+0x1;_0x3e1610[_0x5ea1('0x44')](_0x16b3aa,0x0,{'type':_0x58a5cc[_0x5ea1('0x4')],'app':_0x5ea1('0x45'),'appdata':_0x917a61[_0x5ea1('0x31')][_0x16b3aa]+'?'+_0x58a5cc[_0x5ea1('0x6')]+_0x5ea1('0x46')+_0x223e4d+':'+_0x58a5cc['context']+_0x5ea1('0x46')+_0x1af856,'exten':_0x58a5cc['exten'],'context':_0x58a5cc[_0x5ea1('0x6')],'priority':_0x5827c1+_0x16b3aa,'VoiceExtensionId':_0x58a5cc['id']});}if(_0x917a61[_0x5ea1('0x3e')]===_0x5ea1('0x47')){_0x917a61[_0x5ea1('0x48')]=_0x570e75(_0x58a5cc,_0x917a61['appdata']);}if(_0x917a61[_0x5ea1('0x3e')]===_0x5ea1('0x49')){_0x3e1610[_0x5ea1('0xc')]({'type':_0x917a61[_0x5ea1('0x4')][_0x5ea1('0x34')](),'app':'Set','appdata':'XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','context':_0x58a5cc[_0x5ea1('0x6')],'exten':_0x58a5cc['exten'],'priority':_0x917a61[_0x5ea1('0x31')]['length']+_0x5827c1+_0x3c16f5++,'VoiceExtensionId':_0x58a5cc['id']});}_0x917a61[_0x5ea1('0x4a')]=_0x3e1610[_0x5ea1('0x22')]?_[_0x5ea1('0x4b')](_0x3e1610)[_0x5ea1('0x4a')]+0x1:_0x5827c1;_0x514651=_[_0x5ea1('0x4c')](_0x514651,_0x3e1610,[_0x917a61],_0x814933);_0x5827c1=_['last'](_0x514651)[_0x5ea1('0x4a')]+0x1;}return _0x34f512(_0x514651);})[_0x5ea1('0x4d')](function(_0x464170){_0x42d634(_0x464170);});});}return _0x49215a[_0x5ea1('0x4e')](_0x5ea1('0x4f'),attributes,{'tableName':_0x5ea1('0x50'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x4cfe96){var _0x20ff7c=this[_0x5ea1('0x51')]({'plain':!![]});var _0x17965f=_0x20ff7c['type']===_0x5ea1('0xf')?_0x175c3e(_0x20ff7c):_0x2ae52c(_0x20ff7c);return _0x146868(_0x20ff7c,_0x4cfe96,_[_0x5ea1('0x4b')](_0x17965f)[_0x5ea1('0x4a')]+0x1)[_0x5ea1('0x52')](function(_0x5f5d0d){var _0x25792b=_[_0x5ea1('0x4c')](_0x17965f,_0x5f5d0d);_0x25792b[_0x5ea1('0xc')]({'type':_0x20ff7c[_0x5ea1('0x4')],'app':_0x5ea1('0x53'),'exten':_0x20ff7c[_0x5ea1('0x7')],'context':_0x20ff7c[_0x5ea1('0x6')],'priority':_[_0x5ea1('0x4b')](_0x25792b)['priority']+0x1,'VoiceExtensionId':_0x20ff7c['id']});return _0x25792b;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 6ecc944..cf45714 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 _0x8ca9=['model','attributes','GetVoiceExtension','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','error','code','VoiceExtension,\x20%s,\x20%s','message','result','catch','options','raw','where','limit','include','map'];(function(_0x204568,_0x1e6528){var _0x340ca0=function(_0x165c8e){while(--_0x165c8e){_0x204568['push'](_0x204568['shift']());}};_0x340ca0(++_0x1e6528);}(_0x8ca9,0x9c));var _0x98ca=function(_0x5791f3,_0x5d5453){_0x5791f3=_0x5791f3-0x0;var _0x1564a2=_0x8ca9[_0x5791f3];return _0x1564a2;};'use strict';var _=require(_0x98ca('0x0'));var util=require(_0x98ca('0x1'));var moment=require(_0x98ca('0x2'));var BPromise=require(_0x98ca('0x3'));var rs=require(_0x98ca('0x4'));var fs=require('fs');var Redis=require(_0x98ca('0x5'));var db=require(_0x98ca('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x98ca('0x7'));var config=require('../../config/environment');var jayson=require(_0x98ca('0x8'));var client=jayson['client'][_0x98ca('0x9')]({'port':0x232a});config[_0x98ca('0xa')]=_[_0x98ca('0xb')](config[_0x98ca('0xa')],{'host':_0x98ca('0xc'),'port':0x18eb});var socket=require(_0x98ca('0xd'))(new Redis(config[_0x98ca('0xa')]));require(_0x98ca('0xe'))[_0x98ca('0xf')](socket);function respondWithRpcPromise(_0x404cc1,_0x572858,_0x2074fb){return new BPromise(function(_0x25b06a,_0x1bec99){return client[_0x98ca('0x10')](_0x404cc1,_0x2074fb)[_0x98ca('0x11')](function(_0x276213){logger[_0x98ca('0x12')]('VoiceExtension,\x20%s,\x20%s',_0x572858,_0x98ca('0x13'));logger[_0x98ca('0x14')](_0x98ca('0x15'),_0x572858,_0x98ca('0x13'),JSON['stringify'](_0x276213));if(_0x276213[_0x98ca('0x16')]){if(_0x276213[_0x98ca('0x16')][_0x98ca('0x17')]===0x1f4){logger[_0x98ca('0x16')](_0x98ca('0x18'),_0x572858,_0x276213[_0x98ca('0x16')][_0x98ca('0x19')]);return _0x1bec99(_0x276213['error'][_0x98ca('0x19')]);}logger[_0x98ca('0x16')](_0x98ca('0x18'),_0x572858,_0x276213[_0x98ca('0x16')]['message']);return _0x25b06a(_0x276213[_0x98ca('0x16')][_0x98ca('0x19')]);}else{logger[_0x98ca('0x12')](_0x98ca('0x18'),_0x572858,_0x98ca('0x13'));_0x25b06a(_0x276213[_0x98ca('0x1a')][_0x98ca('0x19')]);}})[_0x98ca('0x1b')](function(_0xddec43){logger[_0x98ca('0x16')](_0x98ca('0x18'),_0x572858,_0xddec43);_0x1bec99(_0xddec43);});});}exports['GetVoiceExtension']=function(_0x626b37){var _0x49298d=this;return new Promise(function(_0x47a3f1,_0x2fe568){return db['VoiceExtension']['findAll']({'raw':_0x626b37[_0x98ca('0x1c')]?_0x626b37[_0x98ca('0x1c')][_0x98ca('0x1d')]===undefined?!![]:![]:!![],'where':_0x626b37['options']?_0x626b37[_0x98ca('0x1c')][_0x98ca('0x1e')]||null:null,'attributes':_0x626b37['options']?_0x626b37[_0x98ca('0x1c')]['attributes']||null:null,'limit':_0x626b37[_0x98ca('0x1c')]?_0x626b37[_0x98ca('0x1c')][_0x98ca('0x1f')]||null:null,'include':_0x626b37[_0x98ca('0x1c')]?_0x626b37[_0x98ca('0x1c')][_0x98ca('0x20')]?_[_0x98ca('0x21')](_0x626b37['options'][_0x98ca('0x20')],function(_0x4fc3c9){return{'model':db[_0x4fc3c9[_0x98ca('0x22')]],'as':_0x4fc3c9['as'],'attributes':_0x4fc3c9[_0x98ca('0x23')],'include':_0x4fc3c9['include']?_[_0x98ca('0x21')](_0x4fc3c9['include'],function(_0x214649){return{'model':db[_0x214649['model']],'as':_0x214649['as'],'attributes':_0x214649['attributes'],'include':_0x214649[_0x98ca('0x20')]?_['map'](_0x214649[_0x98ca('0x20')],function(_0x35b920){return{'model':db[_0x35b920[_0x98ca('0x22')]],'as':_0x35b920['as'],'attributes':_0x35b920[_0x98ca('0x23')]};}):[]};}):[]};}):[]:[]})[_0x98ca('0x11')](function(_0x1e7fcf){logger[_0x98ca('0x12')](_0x98ca('0x24'),_0x626b37);logger[_0x98ca('0x14')]('GetVoiceExtension',_0x626b37,JSON[_0x98ca('0x25')](_0x1e7fcf));_0x47a3f1(_0x1e7fcf);})['catch'](function(_0xb873c5){logger[_0x98ca('0x16')]('GetVoiceExtension',_0xb873c5['message'],_0x626b37);_0x2fe568(_0x49298d[_0x98ca('0x16')](0x1f4,_0xb873c5['message']));});});}; \ No newline at end of file +var _0x714c=['redis','localhost','socket.io-emitter','./voiceExtension.socket','register','request','info','debug','request\x20sent','stringify','error','VoiceExtension,\x20%s,\x20%s','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','limit','include','model','map','then','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http'];(function(_0x49008c,_0x51ea8a){var _0x1ab017=function(_0x2589ec){while(--_0x2589ec){_0x49008c['push'](_0x49008c['shift']());}};_0x1ab017(++_0x51ea8a);}(_0x714c,0x18d));var _0xc714=function(_0x4a3acd,_0x4bf641){_0x4a3acd=_0x4a3acd-0x0;var _0x3efdaa=_0x714c[_0x4a3acd];return _0x3efdaa;};'use strict';var _=require('lodash');var util=require(_0xc714('0x0'));var moment=require(_0xc714('0x1'));var BPromise=require(_0xc714('0x2'));var rs=require(_0xc714('0x3'));var fs=require('fs');var Redis=require(_0xc714('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc714('0x5'));var logger=require(_0xc714('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc714('0x7'));var client=jayson[_0xc714('0x8')][_0xc714('0x9')]({'port':0x232a});config[_0xc714('0xa')]=_['defaults'](config['redis'],{'host':_0xc714('0xb'),'port':0x18eb});var socket=require(_0xc714('0xc'))(new Redis(config[_0xc714('0xa')]));require(_0xc714('0xd'))[_0xc714('0xe')](socket);function respondWithRpcPromise(_0x5b6aa5,_0x226622,_0x34a03f){return new BPromise(function(_0x3438b4,_0x263f56){return client[_0xc714('0xf')](_0x5b6aa5,_0x34a03f)['then'](function(_0xaa2acc){logger[_0xc714('0x10')]('VoiceExtension,\x20%s,\x20%s',_0x226622,'request\x20sent');logger[_0xc714('0x11')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x226622,_0xc714('0x12'),JSON[_0xc714('0x13')](_0xaa2acc));if(_0xaa2acc[_0xc714('0x14')]){if(_0xaa2acc[_0xc714('0x14')]['code']===0x1f4){logger[_0xc714('0x14')](_0xc714('0x15'),_0x226622,_0xaa2acc[_0xc714('0x14')][_0xc714('0x16')]);return _0x263f56(_0xaa2acc[_0xc714('0x14')][_0xc714('0x16')]);}logger[_0xc714('0x14')](_0xc714('0x15'),_0x226622,_0xaa2acc['error']['message']);return _0x3438b4(_0xaa2acc[_0xc714('0x14')][_0xc714('0x16')]);}else{logger[_0xc714('0x10')](_0xc714('0x15'),_0x226622,_0xc714('0x12'));_0x3438b4(_0xaa2acc[_0xc714('0x17')][_0xc714('0x16')]);}})[_0xc714('0x18')](function(_0x50a84a){logger[_0xc714('0x14')](_0xc714('0x15'),_0x226622,_0x50a84a);_0x263f56(_0x50a84a);});});}exports[_0xc714('0x19')]=function(_0x29c3ab){var _0x5bc067=this;return new Promise(function(_0x751c4d,_0xc9787a){return db[_0xc714('0x1a')][_0xc714('0x1b')]({'raw':_0x29c3ab[_0xc714('0x1c')]?_0x29c3ab['options'][_0xc714('0x1d')]===undefined?!![]:![]:!![],'where':_0x29c3ab['options']?_0x29c3ab[_0xc714('0x1c')][_0xc714('0x1e')]||null:null,'attributes':_0x29c3ab[_0xc714('0x1c')]?_0x29c3ab[_0xc714('0x1c')][_0xc714('0x1f')]||null:null,'limit':_0x29c3ab['options']?_0x29c3ab['options'][_0xc714('0x20')]||null:null,'include':_0x29c3ab['options']?_0x29c3ab[_0xc714('0x1c')][_0xc714('0x21')]?_['map'](_0x29c3ab['options'][_0xc714('0x21')],function(_0x306dd0){return{'model':db[_0x306dd0[_0xc714('0x22')]],'as':_0x306dd0['as'],'attributes':_0x306dd0[_0xc714('0x1f')],'include':_0x306dd0[_0xc714('0x21')]?_['map'](_0x306dd0[_0xc714('0x21')],function(_0x431a00){return{'model':db[_0x431a00['model']],'as':_0x431a00['as'],'attributes':_0x431a00[_0xc714('0x1f')],'include':_0x431a00[_0xc714('0x21')]?_[_0xc714('0x23')](_0x431a00['include'],function(_0x4e6b70){return{'model':db[_0x4e6b70[_0xc714('0x22')]],'as':_0x4e6b70['as'],'attributes':_0x4e6b70['attributes']};}):[]};}):[]};}):[]:[]})[_0xc714('0x24')](function(_0x1d51b5){logger['info'](_0xc714('0x19'),_0x29c3ab);logger[_0xc714('0x11')]('GetVoiceExtension',_0x29c3ab,JSON[_0xc714('0x13')](_0x1d51b5));_0x751c4d(_0x1d51b5);})[_0xc714('0x18')](function(_0x4a947c){logger[_0xc714('0x14')](_0xc714('0x19'),_0x4a947c[_0xc714('0x16')],_0x29c3ab);_0xc9787a(_0x5bc067[_0xc714('0x14')](0x1f4,_0x4a947c[_0xc714('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 859cfec..6f284e3 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(_0x4039a7,_0x552f5b){var _0x7dcc65=function(_0x581e5a){while(--_0x581e5a){_0x4039a7['push'](_0x4039a7['shift']());}};_0x7dcc65(++_0x552f5b);}(_0xe14b,0x93));var _0xbe14=function(_0x1baebe,_0x31ae03){_0x1baebe=_0x1baebe-0x0;var _0x202a23=_0xe14b[_0x1baebe];return _0x202a23;};'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 _0x4975=['length','./voiceExtension.events','remove','update','emit','removeListener','register'];(function(_0x59cf90,_0x2a8e36){var _0x2c33f5=function(_0x204b74){while(--_0x204b74){_0x59cf90['push'](_0x59cf90['shift']());}};_0x2c33f5(++_0x2a8e36);}(_0x4975,0x86));var _0x5497=function(_0x35140b,_0x33295c){_0x35140b=_0x35140b-0x0;var _0x12338a=_0x4975[_0x35140b];return _0x12338a;};'use strict';var VoiceExtensionEvents=require(_0x5497('0x0'));var events=['save',_0x5497('0x1'),_0x5497('0x2')];function createListener(_0xfc7927,_0x349f5f){return function(_0x135f6f){_0x349f5f[_0x5497('0x3')](_0xfc7927,_0x135f6f);};}function removeListener(_0x14cecb,_0xeb31af){return function(){VoiceExtensionEvents[_0x5497('0x4')](_0x14cecb,_0xeb31af);};}exports[_0x5497('0x5')]=function(_0x539a27){for(var _0x37e48d=0x0,_0x4f563d=events[_0x5497('0x6')];_0x37e48d<_0x4f563d;_0x37e48d++){var _0x674a2a=events[_0x37e48d];var _0x368e8b=createListener('voiceExtension:'+_0x674a2a,_0x539a27);VoiceExtensionEvents['on'](_0x674a2a,_0x368e8b);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index bafa799..1fa0e6c 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 _0x2542=['put','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','index','/:id','isAuthenticated','show','/:id/messages','getMessages','post'];(function(_0x2c1af4,_0xc5a914){var _0x420214=function(_0x3225de){while(--_0x3225de){_0x2c1af4['push'](_0x2c1af4['shift']());}};_0x420214(++_0xc5a914);}(_0x2542,0x169));var _0x2254=function(_0x4a0393,_0xe6bab7){_0x4a0393=_0x4a0393-0x0;var _0x16b28d=_0x2542[_0x4a0393];return _0x16b28d;};'use strict';var multer=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var path=require(_0x2254('0x2'));var timeout=require(_0x2254('0x3'));var express=require('express');var router=express[_0x2254('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2254('0x5'));var interaction=require(_0x2254('0x6'));var config=require(_0x2254('0x7'));var controller=require(_0x2254('0x8'));router[_0x2254('0x9')]('/',auth['isAuthenticated'](),controller[_0x2254('0xa')]);router[_0x2254('0x9')](_0x2254('0xb'),auth[_0x2254('0xc')](),controller[_0x2254('0xd')]);router[_0x2254('0x9')](_0x2254('0xe'),auth[_0x2254('0xc')](),controller[_0x2254('0xf')]);router[_0x2254('0x10')]('/',auth[_0x2254('0xc')](),controller['create']);router[_0x2254('0x11')](_0x2254('0xb'),auth[_0x2254('0xc')](),controller[_0x2254('0x12')]);router['delete']('/:id',auth[_0x2254('0xc')](),controller[_0x2254('0x13')]);module[_0x2254('0x14')]=router; \ No newline at end of file +var _0xadb5=['delete','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/messages','getMessages','post','create','update'];(function(_0x51c819,_0xd812db){var _0x15c5d2=function(_0x2977f0){while(--_0x2977f0){_0x51c819['push'](_0x51c819['shift']());}};_0x15c5d2(++_0xd812db);}(_0xadb5,0xad));var _0x5adb=function(_0x44a32b,_0x4657aa){_0x44a32b=_0x44a32b-0x0;var _0x24ab81=_0xadb5[_0x44a32b];return _0x24ab81;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./voiceMail.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0xf')]);router['put']('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller['destroy']);module[_0x5adb('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index e5c2f30..d3dc681 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 _0xa329=['\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','trim','ENUM','yes','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname'];(function(_0x2af08e,_0x11964d){var _0x21537c=function(_0xc3acb5){while(--_0xc3acb5){_0x2af08e['push'](_0x2af08e['shift']());}};_0x21537c(++_0x11964d);}(_0xa329,0xc2));var _0x9a32=function(_0x3a30fe,_0x51bfad){_0x3a30fe=_0x3a30fe-0x0;var _0x44cb0b=_0xa329[_0x3a30fe];return _0x44cb0b;};'use strict';var Sequelize=require(_0x9a32('0x0'));module[_0x9a32('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x9a32('0x2')],'defaultValue':_0x9a32('0x3'),'unique':_0x9a32('0x4')},'mailbox':{'type':Sequelize[_0x9a32('0x2')],'defaultValue':'','allowNull':![],'unique':_0x9a32('0x4')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x9a32('0x2')]},'email':{'type':Sequelize[_0x9a32('0x2')],'validate':{'isEmail':!![]},'set':function(_0x40542c){this[_0x9a32('0x5')]('email',typeof _0x40542c==='string'&&_0x40542c[_0x9a32('0x6')]()?_0x40542c['trim']():null);}},'pager':{'type':Sequelize[_0x9a32('0x2')]},'tz':{'type':Sequelize[_0x9a32('0x2')],'defaultValue':'central'},'attach':{'type':Sequelize[_0x9a32('0x7')](_0x9a32('0x8'),'no'),'defaultValue':_0x9a32('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0x9a32('0x7')](_0x9a32('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x9a32('0x2')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x9a32('0x7')](_0x9a32('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x9a32('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x9a32('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x9a32('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x9a32('0x7')](_0x9a32('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x9a32('0x7')](_0x9a32('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0x9a32('0x8'),'no'),'defaultValue':_0x9a32('0x8'),'allowNull':![]},'forcename':{'type':Sequelize[_0x9a32('0x7')](_0x9a32('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x9a32('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x9a32('0x8'),'no'),'defaultValue':_0x9a32('0x8'),'allowNull':![]},'stamp':{'type':_0x9a32('0x9')},'emailsubject':{'type':Sequelize[_0x9a32('0x2')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0x9a32('0xa')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x9a32('0xa')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x9a32('0xb')],'get':function(){return this[_0x9a32('0xc')](_0x9a32('0xd'))+_0x9a32('0xe')+this[_0x9a32('0xc')](_0x9a32('0xf'));}}}; \ No newline at end of file +var _0xea2d=['INTEGER','VIRTUAL','fullname','\x20-\x20','getDataValue','mailbox','sequelize','exports','contest_mailbox','STRING','setDataValue','email','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP'];(function(_0xb65e77,_0x238c3d){var _0x38134b=function(_0x39da21){while(--_0x39da21){_0xb65e77['push'](_0xb65e77['shift']());}};_0x38134b(++_0x238c3d);}(_0xea2d,0x195));var _0xdea2=function(_0x273400,_0x46f576){_0x273400=_0x273400-0x0;var _0x39f3da=_0xea2d[_0x273400];return _0x39f3da;};'use strict';var Sequelize=require(_0xdea2('0x0'));module[_0xdea2('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING'],'defaultValue':'from-voicemail','unique':_0xdea2('0x2')},'mailbox':{'type':Sequelize[_0xdea2('0x3')],'defaultValue':'','allowNull':![],'unique':_0xdea2('0x2')},'password':{'type':Sequelize[_0xdea2('0x3')]},'fullname':{'type':Sequelize[_0xdea2('0x3')]},'email':{'type':Sequelize[_0xdea2('0x3')],'validate':{'isEmail':!![]},'set':function(_0x15638a){this[_0xdea2('0x4')](_0xdea2('0x5'),typeof _0x15638a===_0xdea2('0x6')&&_0x15638a['trim']()?_0x15638a[_0xdea2('0x7')]():null);}},'pager':{'type':Sequelize[_0xdea2('0x3')]},'tz':{'type':Sequelize[_0xdea2('0x3')],'defaultValue':_0xdea2('0x8')},'attach':{'type':Sequelize[_0xdea2('0x9')](_0xdea2('0xa'),'no'),'defaultValue':_0xdea2('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0xdea2('0x9')](_0xdea2('0xa'),'no'),'defaultValue':_0xdea2('0xa'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0xdea2('0x3')]},'review':{'type':Sequelize[_0xdea2('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xdea2('0x9')](_0xdea2('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xdea2('0x9')](_0xdea2('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xdea2('0x9')](_0xdea2('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xdea2('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xdea2('0x9')](_0xdea2('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0xdea2('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xdea2('0x9')](_0xdea2('0xa'),'no'),'defaultValue':_0xdea2('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0xdea2('0x9')](_0xdea2('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0xdea2('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0xdea2('0xa'),'no'),'defaultValue':_0xdea2('0xa'),'allowNull':![]},'stamp':{'type':_0xdea2('0xc')},'emailsubject':{'type':Sequelize[_0xdea2('0x3')]},'emailbody':{'type':Sequelize[_0xdea2('0x3')]},'maxsecs':{'type':Sequelize[_0xdea2('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xdea2('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xdea2('0xe')],'get':function(){return this['getDataValue'](_0xdea2('0xf'))+_0xdea2('0x10')+this[_0xdea2('0x11')](_0xdea2('0x12'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 17044b2..3b17bf1 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 _0x36ee=['set','Content-Range','apply','reject','save','update','then','destroy','get','Voicemails','stack','index','map','VoiceMail','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','rows','catch','show','params','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','VoiceMailMessage','mailbox','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count'];(function(_0x13187a,_0x2fcec4){var _0x65b85f=function(_0x33bf1f){while(--_0x33bf1f){_0x13187a['push'](_0x13187a['shift']());}};_0x65b85f(++_0x2fcec4);}(_0x36ee,0xe8));var _0xe36e=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x36ee[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe36e('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe36e('0x1'));var moment=require(_0xe36e('0x2'));var BPromise=require(_0xe36e('0x3'));var Mustache=require(_0xe36e('0x4'));var util=require(_0xe36e('0x5'));var path=require(_0xe36e('0x6'));var sox=require(_0xe36e('0x7'));var csv=require(_0xe36e('0x8'));var ejs=require(_0xe36e('0x9'));var fs=require('fs');var fs_extra=require(_0xe36e('0xa'));var _=require(_0xe36e('0xb'));var squel=require(_0xe36e('0xc'));var crypto=require('crypto');var jsforce=require(_0xe36e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe36e('0x8'));var querystring=require(_0xe36e('0xe'));var Papa=require(_0xe36e('0xf'));var Redis=require('ioredis');var authService=require(_0xe36e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe36e('0x11'));var hardwareService=require(_0xe36e('0x12'));var logger=require(_0xe36e('0x13'))(_0xe36e('0x14'));var utils=require(_0xe36e('0x15'));var config=require(_0xe36e('0x16'));var licenseUtil=require(_0xe36e('0x17'));var db=require(_0xe36e('0x18'))['db'];function respondWithStatusCode(_0x4fbdb2,_0x32981d){_0x32981d=_0x32981d||0xcc;return function(_0x27841e){if(_0x27841e){return _0x4fbdb2[_0xe36e('0x19')](_0x32981d);}return _0x4fbdb2[_0xe36e('0x1a')](_0x32981d)['end']();};}function respondWithResult(_0x3e264a,_0x521afa){_0x521afa=_0x521afa||0xc8;return function(_0x525155){if(_0x525155){return _0x3e264a[_0xe36e('0x1a')](_0x521afa)[_0xe36e('0x1b')](_0x525155);}};}function respondWithFilteredResult(_0x26fb37,_0x278135){return function(_0xd6828e){if(_0xd6828e){var _0x924cd5=typeof _0x278135[_0xe36e('0x1c')]===_0xe36e('0x1d')&&typeof _0x278135[_0xe36e('0x1e')]===_0xe36e('0x1d');var _0x5792e8=_0xd6828e[_0xe36e('0x1f')];var _0x2184ae=_0x924cd5?0x0:_0x278135['offset'];var _0x21d9a3=_0x924cd5?_0xd6828e['count']:_0x278135[_0xe36e('0x1c')]+_0x278135[_0xe36e('0x1e')];var _0x5e15f5;if(_0x21d9a3>=_0x5792e8){_0x21d9a3=_0x5792e8;_0x5e15f5=0xc8;}else{_0x5e15f5=0xce;}_0x26fb37[_0xe36e('0x1a')](_0x5e15f5);return _0x26fb37[_0xe36e('0x20')](_0xe36e('0x21'),_0x2184ae+'-'+_0x21d9a3+'/'+_0x5792e8)['json'](_0xd6828e);}return null;};}function patchUpdates(_0x21e95e){return function(_0x21bcf9){try{jsonpatch[_0xe36e('0x22')](_0x21bcf9,_0x21e95e,!![]);}catch(_0x3c4017){return BPromise[_0xe36e('0x23')](_0x3c4017);}return _0x21bcf9[_0xe36e('0x24')]();};}function saveUpdates(_0x4f438a,_0xd71137){return function(_0x4f214a){if(_0x4f214a){return _0x4f214a[_0xe36e('0x25')](_0x4f438a)[_0xe36e('0x26')](function(_0x437f3f){return _0x437f3f;});}return null;};}function removeEntity(_0x53e13a,_0x598a7a){return function(_0x4749a8){if(_0x4749a8){return _0x4749a8[_0xe36e('0x27')]()[_0xe36e('0x26')](function(){var _0xb32195=_0x4749a8[_0xe36e('0x28')]({'plain':!![]});var _0x1507f9=_0xe36e('0x29');return db['UserProfileResource'][_0xe36e('0x27')]({'where':{'type':_0x1507f9,'resourceId':_0xb32195['id']}})[_0xe36e('0x26')](function(){return _0x4749a8;});})[_0xe36e('0x26')](function(){_0x53e13a[_0xe36e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d757c,_0x5a3133){return function(_0xf7b02e){if(!_0xf7b02e){_0x2d757c['sendStatus'](0x194);}return _0xf7b02e;};}function handleError(_0x19f001,_0x5884cb){_0x5884cb=_0x5884cb||0x1f4;return function(_0x410504){logger['error'](_0x410504[_0xe36e('0x2a')]);if(_0x410504['name']){delete _0x410504['name'];}_0x19f001['status'](_0x5884cb)['send'](_0x410504);};}exports[_0xe36e('0x2b')]=function(_0x1fc639,_0x4cf185){var _0x4ac819={},_0x1fa1ec={},_0xb8d44e={'count':0x0,'rows':[]};var _0x259e19=_[_0xe36e('0x2c')](db[_0xe36e('0x2d')][_0xe36e('0x2e')],function(_0x57bb9b){return{'name':_0x57bb9b[_0xe36e('0x2f')],'type':_0x57bb9b[_0xe36e('0x30')]['key']};});_0x1fa1ec[_0xe36e('0x31')]=_[_0xe36e('0x2c')](_0x259e19,_0xe36e('0x32'));_0x1fa1ec[_0xe36e('0x33')]=_[_0xe36e('0x34')](_0x1fc639[_0xe36e('0x33')]);_0x1fa1ec[_0xe36e('0x35')]=_[_0xe36e('0x36')](_0x1fa1ec[_0xe36e('0x31')],_0x1fa1ec[_0xe36e('0x33')]);_0x4ac819[_0xe36e('0x37')]=_['intersection'](_0x1fa1ec[_0xe36e('0x31')],qs['fields'](_0x1fc639['query'][_0xe36e('0x38')]));_0x4ac819['attributes']=_0x4ac819[_0xe36e('0x37')][_0xe36e('0x39')]?_0x4ac819[_0xe36e('0x37')]:_0x1fa1ec[_0xe36e('0x31')];if(!_0x1fc639['query']['hasOwnProperty'](_0xe36e('0x3a'))){_0x4ac819[_0xe36e('0x1e')]=qs[_0xe36e('0x1e')](_0x1fc639[_0xe36e('0x33')]['limit']);_0x4ac819[_0xe36e('0x1c')]=qs[_0xe36e('0x1c')](_0x1fc639[_0xe36e('0x33')]['offset']);}_0x4ac819[_0xe36e('0x3b')]=qs[_0xe36e('0x3c')](_0x1fc639['query'][_0xe36e('0x3c')]);_0x4ac819[_0xe36e('0x3d')]=qs[_0xe36e('0x35')](_[_0xe36e('0x3e')](_0x1fc639[_0xe36e('0x33')],_0x1fa1ec[_0xe36e('0x35')]),_0x259e19);if(_0x1fc639[_0xe36e('0x33')][_0xe36e('0x3f')]){_0x4ac819[_0xe36e('0x3d')]=_[_0xe36e('0x40')](_0x4ac819[_0xe36e('0x3d')],{'$or':_[_0xe36e('0x2c')](_0x259e19,function(_0x3c4703){if(_0x3c4703['type']!==_0xe36e('0x41')){var _0x134fb2={};_0x134fb2[_0x3c4703[_0xe36e('0x32')]]={'$like':'%'+_0x1fc639[_0xe36e('0x33')][_0xe36e('0x3f')]+'%'};return _0x134fb2;}})});}_0x4ac819=_['merge']({},_0x4ac819,_0x1fc639['options']);var _0x4094c6={'where':_0x4ac819[_0xe36e('0x3d')]};return db[_0xe36e('0x2d')][_0xe36e('0x1f')](_0x4094c6)[_0xe36e('0x26')](function(_0x34a1ba){_0xb8d44e[_0xe36e('0x1f')]=_0x34a1ba;if(_0x1fc639[_0xe36e('0x33')]['includeAll']){_0x4ac819[_0xe36e('0x42')]=[{'all':!![]}];}return db[_0xe36e('0x2d')]['findAll'](_0x4ac819);})[_0xe36e('0x26')](function(_0x5ef3e4){_0xb8d44e[_0xe36e('0x43')]=_0x5ef3e4;return _0xb8d44e;})[_0xe36e('0x26')](respondWithFilteredResult(_0x4cf185,_0x4ac819))[_0xe36e('0x44')](handleError(_0x4cf185,null));};exports[_0xe36e('0x45')]=function(_0x3b1269,_0x4c5e10){var _0x2ffc34={'raw':!![],'where':{'id':_0x3b1269[_0xe36e('0x46')]['id']}},_0x2961c9={};_0x2961c9[_0xe36e('0x31')]=_[_0xe36e('0x34')](db[_0xe36e('0x2d')]['rawAttributes']);_0x2961c9[_0xe36e('0x33')]=_[_0xe36e('0x34')](_0x3b1269[_0xe36e('0x33')]);_0x2961c9[_0xe36e('0x35')]=_[_0xe36e('0x36')](_0x2961c9['model'],_0x2961c9[_0xe36e('0x33')]);_0x2ffc34[_0xe36e('0x37')]=_[_0xe36e('0x36')](_0x2961c9[_0xe36e('0x31')],qs[_0xe36e('0x38')](_0x3b1269[_0xe36e('0x33')][_0xe36e('0x38')]));_0x2ffc34[_0xe36e('0x37')]=_0x2ffc34[_0xe36e('0x37')]['length']?_0x2ffc34['attributes']:_0x2961c9[_0xe36e('0x31')];if(_0x3b1269['query'][_0xe36e('0x47')]){_0x2ffc34[_0xe36e('0x42')]=[{'all':!![]}];}_0x2ffc34=_[_0xe36e('0x40')]({},_0x2ffc34,_0x3b1269[_0xe36e('0x48')]);return db['VoiceMail'][_0xe36e('0x49')](_0x2ffc34)[_0xe36e('0x26')](handleEntityNotFound(_0x4c5e10,null))['then'](respondWithResult(_0x4c5e10,null))[_0xe36e('0x44')](handleError(_0x4c5e10,null));};exports[_0xe36e('0x4a')]=function(_0x2c26e6,_0x42eae5){return db[_0xe36e('0x2d')][_0xe36e('0x4a')](_0x2c26e6[_0xe36e('0x4b')],{})[_0xe36e('0x26')](function(_0x17555e){var _0x3a99aa=_0x2c26e6[_0xe36e('0x4c')][_0xe36e('0x28')]({'plain':!![]});if(!_0x3a99aa)throw new Error(_0xe36e('0x4d'));if(_0x3a99aa[_0xe36e('0x4e')]===_0xe36e('0x4c')){var _0x5678d3=_0x17555e[_0xe36e('0x28')]({'plain':!![]});var _0x55aadf='Voicemails';return db[_0xe36e('0x4f')][_0xe36e('0x49')]({'where':{'name':_0x55aadf,'userProfileId':_0x3a99aa['userProfileId']},'raw':!![]})[_0xe36e('0x26')](function(_0x3814eb){if(_0x3814eb&&_0x3814eb[_0xe36e('0x50')]===0x0){return db[_0xe36e('0x51')][_0xe36e('0x4a')]({'name':_0x5678d3[_0xe36e('0x32')],'resourceId':_0x5678d3['id'],'type':_0x3814eb[_0xe36e('0x32')],'sectionId':_0x3814eb['id']},{})[_0xe36e('0x26')](function(){return _0x17555e;});}else{return _0x17555e;}})[_0xe36e('0x44')](function(_0x55d190){logger[_0xe36e('0x52')](_0xe36e('0x53'),_0x55d190);throw _0x55d190;});}return _0x17555e;})['then'](respondWithResult(_0x42eae5,0xc9))[_0xe36e('0x44')](handleError(_0x42eae5,null));};exports[_0xe36e('0x25')]=function(_0x3e1040,_0x206f75){if(_0x3e1040[_0xe36e('0x4b')]['id']){delete _0x3e1040['body']['id'];}return db['VoiceMail']['find']({'where':{'id':_0x3e1040['params']['id']}})[_0xe36e('0x26')](handleEntityNotFound(_0x206f75,null))[_0xe36e('0x26')](saveUpdates(_0x3e1040[_0xe36e('0x4b')],null))[_0xe36e('0x26')](respondWithResult(_0x206f75,null))[_0xe36e('0x44')](handleError(_0x206f75,null));};exports[_0xe36e('0x27')]=function(_0x7c3766,_0x17965c){return db[_0xe36e('0x2d')]['find']({'where':{'id':_0x7c3766[_0xe36e('0x46')]['id']}})[_0xe36e('0x26')](handleEntityNotFound(_0x17965c,null))['then'](removeEntity(_0x17965c,null))[_0xe36e('0x44')](handleError(_0x17965c,null));};exports[_0xe36e('0x54')]=function(_0x169369,_0x443154,_0x700b63){return db[_0xe36e('0x2d')][_0xe36e('0x55')]({'where':{'id':_0x169369[_0xe36e('0x46')]['id']}})[_0xe36e('0x26')](handleEntityNotFound(_0x443154,null))[_0xe36e('0x26')](function(_0x56718a){var _0x2cf7fc;var _0x389e91={},_0x6f979f={};_0x6f979f[_0xe36e('0x31')]=_[_0xe36e('0x34')](db[_0xe36e('0x56')][_0xe36e('0x2e')]);_0x6f979f[_0xe36e('0x33')]=_[_0xe36e('0x34')](_0x169369[_0xe36e('0x33')]);_0x6f979f[_0xe36e('0x35')]=_[_0xe36e('0x36')](_0x6f979f[_0xe36e('0x31')],_0x6f979f[_0xe36e('0x33')]);_0x389e91['attributes']=_[_0xe36e('0x36')](_0x6f979f[_0xe36e('0x31')],qs['fields'](_0x169369[_0xe36e('0x33')][_0xe36e('0x38')]));_0x389e91[_0xe36e('0x37')]=_0x389e91[_0xe36e('0x37')][_0xe36e('0x39')]?_0x389e91[_0xe36e('0x37')]:_0x6f979f['model'];if(!_0x169369[_0xe36e('0x33')]['hasOwnProperty'](_0xe36e('0x3a'))){_0x389e91[_0xe36e('0x1e')]=qs[_0xe36e('0x1e')](_0x169369[_0xe36e('0x33')][_0xe36e('0x1e')]);_0x389e91[_0xe36e('0x1c')]=qs[_0xe36e('0x1c')](_0x169369[_0xe36e('0x33')]['offset']);}_0x389e91[_0xe36e('0x3b')]=qs[_0xe36e('0x3c')](_0x169369['query'][_0xe36e('0x3c')]);_0x389e91[_0xe36e('0x3d')]=qs[_0xe36e('0x35')](_[_0xe36e('0x3e')](_0x169369[_0xe36e('0x33')],_0x6f979f[_0xe36e('0x35')]));if(_0x169369[_0xe36e('0x33')]['filter']){_0x389e91[_0xe36e('0x3d')]=_[_0xe36e('0x40')](_0x389e91[_0xe36e('0x3d')],{'$or':_[_0xe36e('0x2c')](_0x389e91[_0xe36e('0x37')],function(_0x43d8c2){var _0xc1daf8={};_0xc1daf8[_0x43d8c2]={'$like':'%'+_0x169369[_0xe36e('0x33')][_0xe36e('0x3f')]+'%'};return _0xc1daf8;})});}_0x389e91[_0xe36e('0x3d')]=_[_0xe36e('0x40')](_0x389e91['where'],{'mailboxuser':_0x56718a[_0xe36e('0x57')]});_0x389e91=_[_0xe36e('0x40')]({},_0x389e91,_0x169369[_0xe36e('0x48')]);return db[_0xe36e('0x56')]['findAndCountAll'](_0x389e91)['then'](respondWithFilteredResult(_0x443154,_0x389e91));})[_0xe36e('0x44')](handleError(_0x443154,null));}; \ No newline at end of file +var _0x7d25=['then','destroy','get','Voicemails','UserProfileResource','error','stack','name','send','index','map','VoiceMail','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','rows','catch','includeAll','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','findOne','VoiceMailMessage','nolimit','findAndCountAll','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','ejs','lodash','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update'];(function(_0x213964,_0x4fb8a3){var _0x5bf88e=function(_0x3916cc){while(--_0x3916cc){_0x213964['push'](_0x213964['shift']());}};_0x5bf88e(++_0x4fb8a3);}(_0x7d25,0x8a));var _0x57d2=function(_0x25d386,_0x108d0d){_0x25d386=_0x25d386-0x0;var _0x857f4a=_0x7d25[_0x25d386];return _0x857f4a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x57d2('0x0'));var zipdir=require(_0x57d2('0x1'));var jsonpatch=require(_0x57d2('0x2'));var rp=require(_0x57d2('0x3'));var moment=require(_0x57d2('0x4'));var BPromise=require(_0x57d2('0x5'));var Mustache=require(_0x57d2('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x57d2('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x57d2('0x8'));var squel=require(_0x57d2('0x9'));var crypto=require(_0x57d2('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x57d2('0xb'));var querystring=require('querystring');var Papa=require(_0x57d2('0xc'));var Redis=require(_0x57d2('0xd'));var authService=require(_0x57d2('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x57d2('0xf'));var hardwareService=require(_0x57d2('0x10'));var logger=require(_0x57d2('0x11'))(_0x57d2('0x12'));var utils=require(_0x57d2('0x13'));var config=require(_0x57d2('0x14'));var licenseUtil=require(_0x57d2('0x15'));var db=require(_0x57d2('0x16'))['db'];function respondWithStatusCode(_0x43d7fb,_0x32c33a){_0x32c33a=_0x32c33a||0xcc;return function(_0x28428b){if(_0x28428b){return _0x43d7fb[_0x57d2('0x17')](_0x32c33a);}return _0x43d7fb[_0x57d2('0x18')](_0x32c33a)[_0x57d2('0x19')]();};}function respondWithResult(_0x1ba57e,_0x4086f3){_0x4086f3=_0x4086f3||0xc8;return function(_0x5382d9){if(_0x5382d9){return _0x1ba57e['status'](_0x4086f3)[_0x57d2('0x1a')](_0x5382d9);}};}function respondWithFilteredResult(_0x148ef3,_0x4ec4b1){return function(_0x8cf637){if(_0x8cf637){var _0x319489=typeof _0x4ec4b1['offset']===_0x57d2('0x1b')&&typeof _0x4ec4b1['limit']===_0x57d2('0x1b');var _0x4b4fe0=_0x8cf637[_0x57d2('0x1c')];var _0x7d4cf1=_0x319489?0x0:_0x4ec4b1[_0x57d2('0x1d')];var _0x4a94e3=_0x319489?_0x8cf637['count']:_0x4ec4b1[_0x57d2('0x1d')]+_0x4ec4b1[_0x57d2('0x1e')];var _0x2662cd;if(_0x4a94e3>=_0x4b4fe0){_0x4a94e3=_0x4b4fe0;_0x2662cd=0xc8;}else{_0x2662cd=0xce;}_0x148ef3[_0x57d2('0x18')](_0x2662cd);return _0x148ef3['set'](_0x57d2('0x1f'),_0x7d4cf1+'-'+_0x4a94e3+'/'+_0x4b4fe0)[_0x57d2('0x1a')](_0x8cf637);}return null;};}function patchUpdates(_0x55191e){return function(_0x5f3fd5){try{jsonpatch[_0x57d2('0x20')](_0x5f3fd5,_0x55191e,!![]);}catch(_0x326d49){return BPromise[_0x57d2('0x21')](_0x326d49);}return _0x5f3fd5[_0x57d2('0x22')]();};}function saveUpdates(_0x386196,_0x803c25){return function(_0x32c7c8){if(_0x32c7c8){return _0x32c7c8[_0x57d2('0x23')](_0x386196)[_0x57d2('0x24')](function(_0x26718e){return _0x26718e;});}return null;};}function removeEntity(_0x46a4d1,_0x456fe1){return function(_0x12ff19){if(_0x12ff19){return _0x12ff19[_0x57d2('0x25')]()['then'](function(){var _0x424ddc=_0x12ff19[_0x57d2('0x26')]({'plain':!![]});var _0x3c7de8=_0x57d2('0x27');return db[_0x57d2('0x28')]['destroy']({'where':{'type':_0x3c7de8,'resourceId':_0x424ddc['id']}})[_0x57d2('0x24')](function(){return _0x12ff19;});})[_0x57d2('0x24')](function(){_0x46a4d1[_0x57d2('0x18')](0xcc)[_0x57d2('0x19')]();});}};}function handleEntityNotFound(_0x18d500,_0x4b3d8e){return function(_0x9bdb11){if(!_0x9bdb11){_0x18d500['sendStatus'](0x194);}return _0x9bdb11;};}function handleError(_0x1ae5ff,_0x15f1ba){_0x15f1ba=_0x15f1ba||0x1f4;return function(_0x277426){logger[_0x57d2('0x29')](_0x277426[_0x57d2('0x2a')]);if(_0x277426[_0x57d2('0x2b')]){delete _0x277426[_0x57d2('0x2b')];}_0x1ae5ff[_0x57d2('0x18')](_0x15f1ba)[_0x57d2('0x2c')](_0x277426);};}exports[_0x57d2('0x2d')]=function(_0x574589,_0x4e9178){var _0x3da926={},_0x26e052={},_0x3e017c={'count':0x0,'rows':[]};var _0x484597=_[_0x57d2('0x2e')](db[_0x57d2('0x2f')][_0x57d2('0x30')],function(_0x290c2d){return{'name':_0x290c2d[_0x57d2('0x31')],'type':_0x290c2d[_0x57d2('0x32')][_0x57d2('0x33')]};});_0x26e052[_0x57d2('0x34')]=_[_0x57d2('0x2e')](_0x484597,'name');_0x26e052[_0x57d2('0x35')]=_[_0x57d2('0x36')](_0x574589['query']);_0x26e052[_0x57d2('0x37')]=_[_0x57d2('0x38')](_0x26e052['model'],_0x26e052[_0x57d2('0x35')]);_0x3da926[_0x57d2('0x39')]=_[_0x57d2('0x38')](_0x26e052[_0x57d2('0x34')],qs[_0x57d2('0x3a')](_0x574589['query']['fields']));_0x3da926['attributes']=_0x3da926['attributes'][_0x57d2('0x3b')]?_0x3da926[_0x57d2('0x39')]:_0x26e052[_0x57d2('0x34')];if(!_0x574589[_0x57d2('0x35')][_0x57d2('0x3c')]('nolimit')){_0x3da926[_0x57d2('0x1e')]=qs['limit'](_0x574589[_0x57d2('0x35')][_0x57d2('0x1e')]);_0x3da926[_0x57d2('0x1d')]=qs['offset'](_0x574589[_0x57d2('0x35')][_0x57d2('0x1d')]);}_0x3da926['order']=qs[_0x57d2('0x3d')](_0x574589[_0x57d2('0x35')][_0x57d2('0x3d')]);_0x3da926[_0x57d2('0x3e')]=qs[_0x57d2('0x37')](_[_0x57d2('0x3f')](_0x574589['query'],_0x26e052[_0x57d2('0x37')]),_0x484597);if(_0x574589['query'][_0x57d2('0x40')]){_0x3da926[_0x57d2('0x3e')]=_[_0x57d2('0x41')](_0x3da926[_0x57d2('0x3e')],{'$or':_[_0x57d2('0x2e')](_0x484597,function(_0x512dbf){if(_0x512dbf[_0x57d2('0x32')]!==_0x57d2('0x42')){var _0x4f6955={};_0x4f6955[_0x512dbf[_0x57d2('0x2b')]]={'$like':'%'+_0x574589[_0x57d2('0x35')][_0x57d2('0x40')]+'%'};return _0x4f6955;}})});}_0x3da926=_['merge']({},_0x3da926,_0x574589[_0x57d2('0x43')]);var _0x2fe0cd={'where':_0x3da926[_0x57d2('0x3e')]};return db[_0x57d2('0x2f')]['count'](_0x2fe0cd)['then'](function(_0x11a2ec){_0x3e017c[_0x57d2('0x1c')]=_0x11a2ec;if(_0x574589[_0x57d2('0x35')]['includeAll']){_0x3da926['include']=[{'all':!![]}];}return db[_0x57d2('0x2f')]['findAll'](_0x3da926);})[_0x57d2('0x24')](function(_0x1bb8ad){_0x3e017c[_0x57d2('0x44')]=_0x1bb8ad;return _0x3e017c;})[_0x57d2('0x24')](respondWithFilteredResult(_0x4e9178,_0x3da926))[_0x57d2('0x45')](handleError(_0x4e9178,null));};exports['show']=function(_0x13216b,_0x1c069a){var _0x53ab43={'raw':!![],'where':{'id':_0x13216b['params']['id']}},_0x775f8c={};_0x775f8c[_0x57d2('0x34')]=_[_0x57d2('0x36')](db[_0x57d2('0x2f')][_0x57d2('0x30')]);_0x775f8c['query']=_['keys'](_0x13216b[_0x57d2('0x35')]);_0x775f8c['filters']=_['intersection'](_0x775f8c[_0x57d2('0x34')],_0x775f8c['query']);_0x53ab43['attributes']=_[_0x57d2('0x38')](_0x775f8c['model'],qs[_0x57d2('0x3a')](_0x13216b['query'][_0x57d2('0x3a')]));_0x53ab43['attributes']=_0x53ab43['attributes'][_0x57d2('0x3b')]?_0x53ab43[_0x57d2('0x39')]:_0x775f8c[_0x57d2('0x34')];if(_0x13216b[_0x57d2('0x35')][_0x57d2('0x46')]){_0x53ab43[_0x57d2('0x47')]=[{'all':!![]}];}_0x53ab43=_['merge']({},_0x53ab43,_0x13216b[_0x57d2('0x43')]);return db[_0x57d2('0x2f')][_0x57d2('0x48')](_0x53ab43)[_0x57d2('0x24')](handleEntityNotFound(_0x1c069a,null))[_0x57d2('0x24')](respondWithResult(_0x1c069a,null))[_0x57d2('0x45')](handleError(_0x1c069a,null));};exports[_0x57d2('0x49')]=function(_0x406375,_0x51f172){return db[_0x57d2('0x2f')][_0x57d2('0x49')](_0x406375['body'],{})[_0x57d2('0x24')](function(_0x5b06f7){var _0x59a6eb=_0x406375[_0x57d2('0x4a')][_0x57d2('0x26')]({'plain':!![]});if(!_0x59a6eb)throw new Error(_0x57d2('0x4b'));if(_0x59a6eb[_0x57d2('0x4c')]==='user'){var _0x265d24=_0x5b06f7[_0x57d2('0x26')]({'plain':!![]});var _0x51b535='Voicemails';return db[_0x57d2('0x4d')][_0x57d2('0x48')]({'where':{'name':_0x51b535,'userProfileId':_0x59a6eb[_0x57d2('0x4e')]},'raw':!![]})[_0x57d2('0x24')](function(_0x3092c8){if(_0x3092c8&&_0x3092c8[_0x57d2('0x4f')]===0x0){return db['UserProfileResource']['create']({'name':_0x265d24['name'],'resourceId':_0x265d24['id'],'type':_0x3092c8[_0x57d2('0x2b')],'sectionId':_0x3092c8['id']},{})['then'](function(){return _0x5b06f7;});}else{return _0x5b06f7;}})[_0x57d2('0x45')](function(_0x2ef710){logger['error'](_0x57d2('0x50'),_0x2ef710);throw _0x2ef710;});}return _0x5b06f7;})[_0x57d2('0x24')](respondWithResult(_0x51f172,0xc9))[_0x57d2('0x45')](handleError(_0x51f172,null));};exports['update']=function(_0x10d4e5,_0x224b7d){if(_0x10d4e5[_0x57d2('0x51')]['id']){delete _0x10d4e5[_0x57d2('0x51')]['id'];}return db[_0x57d2('0x2f')][_0x57d2('0x48')]({'where':{'id':_0x10d4e5[_0x57d2('0x52')]['id']}})[_0x57d2('0x24')](handleEntityNotFound(_0x224b7d,null))[_0x57d2('0x24')](saveUpdates(_0x10d4e5['body'],null))[_0x57d2('0x24')](respondWithResult(_0x224b7d,null))[_0x57d2('0x45')](handleError(_0x224b7d,null));};exports[_0x57d2('0x25')]=function(_0x5e3289,_0x7b334f){return db[_0x57d2('0x2f')][_0x57d2('0x48')]({'where':{'id':_0x5e3289['params']['id']}})['then'](handleEntityNotFound(_0x7b334f,null))['then'](removeEntity(_0x7b334f,null))[_0x57d2('0x45')](handleError(_0x7b334f,null));};exports['getMessages']=function(_0x682542,_0x4cdae5,_0x3111a2){return db['VoiceMail'][_0x57d2('0x53')]({'where':{'id':_0x682542[_0x57d2('0x52')]['id']}})[_0x57d2('0x24')](handleEntityNotFound(_0x4cdae5,null))['then'](function(_0x5985e4){var _0xd5b87e;var _0x2c1710={},_0x3b57fa={};_0x3b57fa[_0x57d2('0x34')]=_[_0x57d2('0x36')](db[_0x57d2('0x54')]['rawAttributes']);_0x3b57fa['query']=_[_0x57d2('0x36')](_0x682542[_0x57d2('0x35')]);_0x3b57fa[_0x57d2('0x37')]=_[_0x57d2('0x38')](_0x3b57fa['model'],_0x3b57fa['query']);_0x2c1710[_0x57d2('0x39')]=_[_0x57d2('0x38')](_0x3b57fa['model'],qs[_0x57d2('0x3a')](_0x682542[_0x57d2('0x35')][_0x57d2('0x3a')]));_0x2c1710[_0x57d2('0x39')]=_0x2c1710['attributes']['length']?_0x2c1710['attributes']:_0x3b57fa['model'];if(!_0x682542[_0x57d2('0x35')][_0x57d2('0x3c')](_0x57d2('0x55'))){_0x2c1710[_0x57d2('0x1e')]=qs[_0x57d2('0x1e')](_0x682542[_0x57d2('0x35')][_0x57d2('0x1e')]);_0x2c1710['offset']=qs[_0x57d2('0x1d')](_0x682542['query'][_0x57d2('0x1d')]);}_0x2c1710['order']=qs[_0x57d2('0x3d')](_0x682542[_0x57d2('0x35')][_0x57d2('0x3d')]);_0x2c1710[_0x57d2('0x3e')]=qs[_0x57d2('0x37')](_[_0x57d2('0x3f')](_0x682542['query'],_0x3b57fa[_0x57d2('0x37')]));if(_0x682542[_0x57d2('0x35')][_0x57d2('0x40')]){_0x2c1710[_0x57d2('0x3e')]=_[_0x57d2('0x41')](_0x2c1710[_0x57d2('0x3e')],{'$or':_[_0x57d2('0x2e')](_0x2c1710[_0x57d2('0x39')],function(_0x10141e){var _0x59c4e4={};_0x59c4e4[_0x10141e]={'$like':'%'+_0x682542[_0x57d2('0x35')]['filter']+'%'};return _0x59c4e4;})});}_0x2c1710['where']=_['merge'](_0x2c1710[_0x57d2('0x3e')],{'mailboxuser':_0x5985e4['mailbox']});_0x2c1710=_[_0x57d2('0x41')]({},_0x2c1710,_0x682542[_0x57d2('0x43')]);return db['VoiceMailMessage'][_0x57d2('0x56')](_0x2c1710)[_0x57d2('0x24')](respondWithFilteredResult(_0x4cdae5,_0x2c1710));})[_0x57d2('0x45')](handleError(_0x4cdae5,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 7d509c1..f1213aa 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 _0xdc27=['path','rimraf','../../config/environment','./voiceMail.attributes','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','lodash','util','api','moment','bluebird','request-promise'];(function(_0x3f7c5e,_0x42622d){var _0x351f50=function(_0x30e2cf){while(--_0x30e2cf){_0x3f7c5e['push'](_0x3f7c5e['shift']());}};_0x351f50(++_0x42622d);}(_0xdc27,0x1bc));var _0x7dc2=function(_0x2aca26,_0xdc73db){_0x2aca26=_0x2aca26-0x0;var _0x591592=_0xdc27[_0x2aca26];return _0x591592;};'use strict';var _=require(_0x7dc2('0x0'));var util=require(_0x7dc2('0x1'));var logger=require('../../config/logger')(_0x7dc2('0x2'));var moment=require(_0x7dc2('0x3'));var BPromise=require(_0x7dc2('0x4'));var rp=require(_0x7dc2('0x5'));var fs=require('fs');var path=require(_0x7dc2('0x6'));var rimraf=require(_0x7dc2('0x7'));var config=require(_0x7dc2('0x8'));var attributes=require(_0x7dc2('0x9'));module['exports']=function(_0x267a7b,_0x3a989a){return _0x267a7b[_0x7dc2('0xa')](_0x7dc2('0xb'),attributes,{'tableName':_0x7dc2('0xc'),'paranoid':![],'indexes':[{'name':_0x7dc2('0xd'),'fields':[_0x7dc2('0xe'),'context']}],'timestamps':!![]});}; \ No newline at end of file +var _0x9aed=['VoiceMail','voice_voicemail','mailbox','context','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./voiceMail.attributes','exports','define'];(function(_0x33bac1,_0x373708){var _0x5672e7=function(_0x51fbd4){while(--_0x51fbd4){_0x33bac1['push'](_0x33bac1['shift']());}};_0x5672e7(++_0x373708);}(_0x9aed,0xfb));var _0xd9ae=function(_0x467b54,_0x38b806){_0x467b54=_0x467b54-0x0;var _0xf6d29c=_0x9aed[_0x467b54];return _0xf6d29c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd9ae('0x0'))(_0xd9ae('0x1'));var moment=require(_0xd9ae('0x2'));var BPromise=require('bluebird');var rp=require(_0xd9ae('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd9ae('0x4'));var config=require(_0xd9ae('0x5'));var attributes=require(_0xd9ae('0x6'));module[_0xd9ae('0x7')]=function(_0x36f1b4,_0x22899d){return _0x36f1b4[_0xd9ae('0x8')](_0xd9ae('0x9'),attributes,{'tableName':_0xd9ae('0xa'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0xd9ae('0xb'),_0xd9ae('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 2bf150b..7394ee7 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 _0x59bd=['http','request','info','VoiceMail,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x19b413,_0x1bd860){var _0x572e2b=function(_0x75aad8){while(--_0x75aad8){_0x19b413['push'](_0x19b413['shift']());}};_0x572e2b(++_0x1bd860);}(_0x59bd,0x185));var _0xd59b=function(_0x5ea9ae,_0x54db23){_0x5ea9ae=_0x5ea9ae-0x0;var _0x1b1914=_0x59bd[_0x5ea9ae];return _0x1b1914;};'use strict';var _=require(_0xd59b('0x0'));var util=require('util');var moment=require(_0xd59b('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd59b('0x2'));var db=require(_0xd59b('0x3'))['db'];var utils=require(_0xd59b('0x4'));var logger=require(_0xd59b('0x5'))(_0xd59b('0x6'));var config=require(_0xd59b('0x7'));var jayson=require(_0xd59b('0x8'));var client=jayson[_0xd59b('0x9')][_0xd59b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b743c,_0x382221,_0x19b347){return new BPromise(function(_0x1f2046,_0x31d1ff){return client[_0xd59b('0xb')](_0x3b743c,_0x19b347)['then'](function(_0x368929){logger[_0xd59b('0xc')](_0xd59b('0xd'),_0x382221,_0xd59b('0xe'));logger['debug']('VoiceMail,\x20%s,\x20%s,\x20%s',_0x382221,_0xd59b('0xe'),JSON[_0xd59b('0xf')](_0x368929));if(_0x368929[_0xd59b('0x10')]){if(_0x368929[_0xd59b('0x10')][_0xd59b('0x11')]===0x1f4){logger[_0xd59b('0x10')]('VoiceMail,\x20%s,\x20%s',_0x382221,_0x368929[_0xd59b('0x10')][_0xd59b('0x12')]);return _0x31d1ff(_0x368929[_0xd59b('0x10')][_0xd59b('0x12')]);}logger[_0xd59b('0x10')](_0xd59b('0xd'),_0x382221,_0x368929[_0xd59b('0x10')][_0xd59b('0x12')]);return _0x1f2046(_0x368929[_0xd59b('0x10')]['message']);}else{logger[_0xd59b('0xc')]('VoiceMail,\x20%s,\x20%s',_0x382221,_0xd59b('0xe'));_0x1f2046(_0x368929[_0xd59b('0x13')][_0xd59b('0x12')]);}})[_0xd59b('0x14')](function(_0x5ea5ad){logger[_0xd59b('0x10')](_0xd59b('0xd'),_0x382221,_0x5ea5ad);_0x31d1ff(_0x5ea5ad);});});} \ No newline at end of file +var _0xf702=['VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','VoiceMail,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2ece5b,_0x1c2a47){var _0x145190=function(_0x2714c2){while(--_0x2714c2){_0x2ece5b['push'](_0x2ece5b['shift']());}};_0x145190(++_0x1c2a47);}(_0xf702,0xee));var _0x2f70=function(_0x3fabf1,_0x3c9e46){_0x3fabf1=_0x3fabf1-0x0;var _0x270ae5=_0xf702[_0x3fabf1];return _0x270ae5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2f70('0x0'));var BPromise=require(_0x2f70('0x1'));var rs=require(_0x2f70('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2f70('0x3'))['db'];var utils=require(_0x2f70('0x4'));var logger=require(_0x2f70('0x5'))(_0x2f70('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2f70('0x7')][_0x2f70('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1cd5ca,_0x1c002c,_0x2418e1){return new BPromise(function(_0x169125,_0x4c4edc){return client[_0x2f70('0x9')](_0x1cd5ca,_0x2418e1)[_0x2f70('0xa')](function(_0x22cec6){logger['info'](_0x2f70('0xb'),_0x1c002c,_0x2f70('0xc'));logger[_0x2f70('0xd')](_0x2f70('0xe'),_0x1c002c,'request\x20sent',JSON[_0x2f70('0xf')](_0x22cec6));if(_0x22cec6[_0x2f70('0x10')]){if(_0x22cec6['error'][_0x2f70('0x11')]===0x1f4){logger[_0x2f70('0x10')](_0x2f70('0xb'),_0x1c002c,_0x22cec6['error']['message']);return _0x4c4edc(_0x22cec6[_0x2f70('0x10')][_0x2f70('0x12')]);}logger[_0x2f70('0x10')](_0x2f70('0xb'),_0x1c002c,_0x22cec6[_0x2f70('0x10')][_0x2f70('0x12')]);return _0x169125(_0x22cec6[_0x2f70('0x10')][_0x2f70('0x12')]);}else{logger['info'](_0x2f70('0xb'),_0x1c002c,_0x2f70('0xc'));_0x169125(_0x22cec6[_0x2f70('0x13')][_0x2f70('0x12')]);}})[_0x2f70('0x14')](function(_0x8648e9){logger['error'](_0x2f70('0xb'),_0x1c002c,_0x8648e9);_0x4c4edc(_0x8648e9);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 6d9dfbb..17bcb55 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 _0x4ec9=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMailMessage.controller','get','isAuthenticated','show','download','post','create','put','update','delete','destroy','exports','multer'];(function(_0x5f2cfd,_0x382549){var _0x40f26f=function(_0x24afcc){while(--_0x24afcc){_0x5f2cfd['push'](_0x5f2cfd['shift']());}};_0x40f26f(++_0x382549);}(_0x4ec9,0x1df));var _0x94ec=function(_0x1ca66c,_0x3e3868){_0x1ca66c=_0x1ca66c-0x0;var _0x5a78ce=_0x4ec9[_0x1ca66c];return _0x5a78ce;};'use strict';var multer=require(_0x94ec('0x0'));var util=require(_0x94ec('0x1'));var path=require(_0x94ec('0x2'));var timeout=require(_0x94ec('0x3'));var express=require('express');var router=express[_0x94ec('0x4')]();var fs_extra=require(_0x94ec('0x5'));var auth=require(_0x94ec('0x6'));var interaction=require(_0x94ec('0x7'));var config=require('../../config/environment');var controller=require(_0x94ec('0x8'));router[_0x94ec('0x9')]('/',auth[_0x94ec('0xa')](),controller['index']);router[_0x94ec('0x9')]('/:id',auth[_0x94ec('0xa')](),controller[_0x94ec('0xb')]);router[_0x94ec('0x9')]('/:id/download',auth['isAuthenticated'](),controller[_0x94ec('0xc')]);router[_0x94ec('0xd')]('/',auth[_0x94ec('0xa')](),controller[_0x94ec('0xe')]);router[_0x94ec('0xf')]('/:id',auth[_0x94ec('0xa')](),controller[_0x94ec('0x10')]);router[_0x94ec('0x11')]('/:id',auth[_0x94ec('0xa')](),controller[_0x94ec('0x12')]);module[_0x94ec('0x13')]=router; \ No newline at end of file +var _0xcc1f=['express','Router','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','show','download','post','create','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x15bad3,_0x1f9b15){var _0x53a2be=function(_0x31052f){while(--_0x31052f){_0x15bad3['push'](_0x15bad3['shift']());}};_0x53a2be(++_0x1f9b15);}(_0xcc1f,0xb1));var _0xfcc1=function(_0x292b87,_0x14a94e){_0x292b87=_0x292b87-0x0;var _0x3f2d5f=_0xcc1f[_0x292b87];return _0x3f2d5f;};'use strict';var multer=require(_0xfcc1('0x0'));var util=require(_0xfcc1('0x1'));var path=require('path');var timeout=require(_0xfcc1('0x2'));var express=require(_0xfcc1('0x3'));var router=express[_0xfcc1('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xfcc1('0x5'));var config=require(_0xfcc1('0x6'));var controller=require(_0xfcc1('0x7'));router[_0xfcc1('0x8')]('/',auth[_0xfcc1('0x9')](),controller['index']);router[_0xfcc1('0x8')]('/:id',auth[_0xfcc1('0x9')](),controller[_0xfcc1('0xa')]);router[_0xfcc1('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0xfcc1('0xb')]);router[_0xfcc1('0xc')]('/',auth[_0xfcc1('0x9')](),controller[_0xfcc1('0xd')]);router[_0xfcc1('0xe')](_0xfcc1('0xf'),auth['isAuthenticated'](),controller[_0xfcc1('0x10')]);router[_0xfcc1('0x11')](_0xfcc1('0xf'),auth[_0xfcc1('0x9')](),controller[_0xfcc1('0x12')]);module[_0xfcc1('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 3779ea3..fd66657 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 _0x68bf=['CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','getDataValue','STRING','BLOB','long','TIMESTAMP','literal'];(function(_0x2f136c,_0x56fe4a){var _0x57cfe1=function(_0x3e73fa){while(--_0x3e73fa){_0x2f136c['push'](_0x2f136c['shift']());}};_0x57cfe1(++_0x56fe4a);}(_0x68bf,0x71));var _0xf68b=function(_0x4e2b71,_0x562ab9){_0x4e2b71=_0x4e2b71-0x0;var _0x19d7c3=_0x68bf[_0x4e2b71];return _0x19d7c3;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5a1468){return this[_0xf68b('0x0')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xf68b('0x1')],'defaultValue':''},'context':{'type':Sequelize[_0xf68b('0x1')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xf68b('0x1')],'defaultValue':''},'callerid':{'type':Sequelize[_0xf68b('0x1')],'defaultValue':''},'origtime':{'type':Sequelize[_0xf68b('0x1')],'defaultValue':''},'duration':{'type':Sequelize[_0xf68b('0x1')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xf68b('0x1')],'defaultValue':''},'recording':{'type':Sequelize[_0xf68b('0x2')](_0xf68b('0x3')),'defaultValue':null},'flag':{'type':Sequelize[_0xf68b('0x1')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xf68b('0x1')],'defaultValue':''},'stamp':{'type':_0xf68b('0x4'),'defaultValue':Sequelize[_0xf68b('0x5')](_0xf68b('0x6'))}}; \ No newline at end of file +var _0x080e=['literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING'];(function(_0x500861,_0x488886){var _0x3919fd=function(_0x2a0323){while(--_0x2a0323){_0x500861['push'](_0x500861['shift']());}};_0x3919fd(++_0x488886);}(_0x080e,0x16a));var _0xe080=function(_0x30e33c,_0x2db57e){_0x30e33c=_0x30e33c-0x0;var _0x1ca401=_0x080e[_0x30e33c];return _0x1ca401;};'use strict';var Sequelize=require(_0xe080('0x0'));module[_0xe080('0x1')]={'name':{'type':Sequelize[_0xe080('0x2')],'get':function(_0x751a0f){return this[_0xe080('0x3')]('id');}},'msgnum':{'type':Sequelize[_0xe080('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xe080('0x5')],'defaultValue':''},'context':{'type':Sequelize[_0xe080('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xe080('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0xe080('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0xe080('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0xe080('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xe080('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xe080('0x5')],'defaultValue':''},'recording':{'type':Sequelize['BLOB']('long'),'defaultValue':null},'flag':{'type':Sequelize[_0xe080('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xe080('0x5')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0xe080('0x6')](_0xe080('0x7'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 5017916..5b5499a 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 _0x123b=['set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','map','VoiceMailMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','findAll','rows','catch','show','params','includeAll','find','create','body','recording','Sequelize','audio/wav','attachment','msg_id','attachment;\x20filename=\x22','.wav\x22','eml-format','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count'];(function(_0x59bb99,_0x3bd8a8){var _0x3dcd4d=function(_0x408999){while(--_0x408999){_0x59bb99['push'](_0x59bb99['shift']());}};_0x3dcd4d(++_0x3bd8a8);}(_0x123b,0x1c3));var _0xb123=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x123b[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require(_0xb123('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb123('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb123('0x2'));var Mustache=require(_0xb123('0x3'));var util=require('util');var path=require(_0xb123('0x4'));var sox=require(_0xb123('0x5'));var csv=require(_0xb123('0x6'));var ejs=require(_0xb123('0x7'));var fs=require('fs');var fs_extra=require(_0xb123('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb123('0x9'));var jsforce=require(_0xb123('0xa'));var deskjs=require(_0xb123('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb123('0xc'));var Redis=require('ioredis');var authService=require(_0xb123('0xd'));var qs=require(_0xb123('0xe'));var as=require(_0xb123('0xf'));var hardwareService=require(_0xb123('0x10'));var logger=require(_0xb123('0x11'))(_0xb123('0x12'));var utils=require(_0xb123('0x13'));var config=require(_0xb123('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xb123('0x15'))['db'];function respondWithStatusCode(_0x16055b,_0x4dead5){_0x4dead5=_0x4dead5||0xcc;return function(_0x274e94){if(_0x274e94){return _0x16055b[_0xb123('0x16')](_0x4dead5);}return _0x16055b['status'](_0x4dead5)['end']();};}function respondWithResult(_0xd79cf3,_0x1ad1b0){_0x1ad1b0=_0x1ad1b0||0xc8;return function(_0x5ad78a){if(_0x5ad78a){return _0xd79cf3[_0xb123('0x17')](_0x1ad1b0)[_0xb123('0x18')](_0x5ad78a);}};}function respondWithFilteredResult(_0xd7f766,_0x3f4f57){return function(_0x3f5ec7){if(_0x3f5ec7){var _0x98057f=typeof _0x3f4f57[_0xb123('0x19')]===_0xb123('0x1a')&&typeof _0x3f4f57[_0xb123('0x1b')]===_0xb123('0x1a');var _0x41c387=_0x3f5ec7[_0xb123('0x1c')];var _0x4941e1=_0x98057f?0x0:_0x3f4f57[_0xb123('0x19')];var _0x46d2d9=_0x98057f?_0x3f5ec7[_0xb123('0x1c')]:_0x3f4f57[_0xb123('0x19')]+_0x3f4f57[_0xb123('0x1b')];var _0x289138;if(_0x46d2d9>=_0x41c387){_0x46d2d9=_0x41c387;_0x289138=0xc8;}else{_0x289138=0xce;}_0xd7f766[_0xb123('0x17')](_0x289138);return _0xd7f766[_0xb123('0x1d')](_0xb123('0x1e'),_0x4941e1+'-'+_0x46d2d9+'/'+_0x41c387)['json'](_0x3f5ec7);}return null;};}function patchUpdates(_0x34c0c0){return function(_0x298982){try{jsonpatch[_0xb123('0x1f')](_0x298982,_0x34c0c0,!![]);}catch(_0x59e192){return BPromise[_0xb123('0x20')](_0x59e192);}return _0x298982[_0xb123('0x21')]();};}function saveUpdates(_0x5370aa,_0x12d210){return function(_0x55ed54){if(_0x55ed54){return _0x55ed54[_0xb123('0x22')](_0x5370aa)[_0xb123('0x23')](function(_0x3ee430){return _0x3ee430;});}return null;};}function removeEntity(_0x12d5a1,_0x445034){return function(_0x56ae7e){if(_0x56ae7e){return _0x56ae7e[_0xb123('0x24')]()['then'](function(){_0x12d5a1['status'](0xcc)[_0xb123('0x25')]();});}};}function handleEntityNotFound(_0x383765,_0x3ca992){return function(_0xeae043){if(!_0xeae043){_0x383765[_0xb123('0x16')](0x194);}return _0xeae043;};}function handleError(_0x37626f,_0x2ccfd4){_0x2ccfd4=_0x2ccfd4||0x1f4;return function(_0x19dd48){logger['error'](_0x19dd48[_0xb123('0x26')]);if(_0x19dd48[_0xb123('0x27')]){delete _0x19dd48[_0xb123('0x27')];}_0x37626f['status'](_0x2ccfd4)[_0xb123('0x28')](_0x19dd48);};}exports['index']=function(_0xac1152,_0x4700fd){var _0x566db6={},_0x56c2ae={},_0x27e5a6={'count':0x0,'rows':[]};var _0x44a915=_[_0xb123('0x29')](db[_0xb123('0x2a')][_0xb123('0x2b')],function(_0x21d1ba){return{'name':_0x21d1ba[_0xb123('0x2c')],'type':_0x21d1ba[_0xb123('0x2d')][_0xb123('0x2e')]};});_0x56c2ae[_0xb123('0x2f')]=_['differenceBy'](_[_0xb123('0x29')](_0x44a915,_0xb123('0x27')),['name']);_0x56c2ae[_0xb123('0x30')]=_[_0xb123('0x31')](_0xac1152[_0xb123('0x30')]);_0x56c2ae[_0xb123('0x32')]=_[_0xb123('0x33')](_0x56c2ae[_0xb123('0x2f')],_0x56c2ae[_0xb123('0x30')]);_0x566db6[_0xb123('0x34')]=_[_0xb123('0x33')](_0x56c2ae[_0xb123('0x2f')],qs[_0xb123('0x35')](_0xac1152[_0xb123('0x30')]['fields']));_0x566db6[_0xb123('0x34')]=_0x566db6['attributes']['length']?_0x566db6[_0xb123('0x34')]:_0x56c2ae['model'];if(!_0xac1152[_0xb123('0x30')][_0xb123('0x36')](_0xb123('0x37'))){_0x566db6['limit']=qs['limit'](_0xac1152['query'][_0xb123('0x1b')]);_0x566db6[_0xb123('0x19')]=qs[_0xb123('0x19')](_0xac1152['query'][_0xb123('0x19')]);}_0x566db6[_0xb123('0x38')]=qs[_0xb123('0x39')](_0xac1152[_0xb123('0x30')][_0xb123('0x39')]);_0x566db6[_0xb123('0x3a')]=qs['filters'](_[_0xb123('0x3b')](_0xac1152[_0xb123('0x30')],_0x56c2ae[_0xb123('0x32')]),_0x44a915);if(_0xac1152[_0xb123('0x30')][_0xb123('0x3c')]){_0x566db6[_0xb123('0x3a')]=_['merge'](_0x566db6[_0xb123('0x3a')],{'$or':_[_0xb123('0x29')](_0x44a915,function(_0x5cf4b9){if(_0x5cf4b9[_0xb123('0x2d')]!==_0xb123('0x3d')){var _0xd5954={};_0xd5954[_0x5cf4b9[_0xb123('0x27')]]={'$like':'%'+_0xac1152[_0xb123('0x30')][_0xb123('0x3c')]+'%'};return _0xd5954;}})});}_0x566db6=_[_0xb123('0x3e')]({},_0x566db6,_0xac1152[_0xb123('0x3f')]);var _0x11914d={'where':_0x566db6[_0xb123('0x3a')]};return db['VoiceMailMessage'][_0xb123('0x1c')](_0x11914d)['then'](function(_0x48d2d7){_0x27e5a6[_0xb123('0x1c')]=_0x48d2d7;if(_0xac1152[_0xb123('0x30')]['includeAll']){_0x566db6['include']=[{'all':!![]}];}return db[_0xb123('0x2a')][_0xb123('0x40')](_0x566db6);})['then'](function(_0x4490ee){_0x27e5a6[_0xb123('0x41')]=_0x4490ee;return _0x27e5a6;})[_0xb123('0x23')](respondWithFilteredResult(_0x4700fd,_0x566db6))[_0xb123('0x42')](handleError(_0x4700fd,null));};exports[_0xb123('0x43')]=function(_0x3fb4b9,_0x1fa8da){var _0x29e019={'raw':!![],'where':{'id':_0x3fb4b9[_0xb123('0x44')]['id']}},_0x4d1536={};_0x4d1536[_0xb123('0x2f')]=_[_0xb123('0x31')](db[_0xb123('0x2a')][_0xb123('0x2b')]);_0x4d1536[_0xb123('0x30')]=_[_0xb123('0x31')](_0x3fb4b9[_0xb123('0x30')]);_0x4d1536['filters']=_[_0xb123('0x33')](_0x4d1536[_0xb123('0x2f')],_0x4d1536[_0xb123('0x30')]);_0x29e019[_0xb123('0x34')]=_['intersection'](_0x4d1536[_0xb123('0x2f')],qs[_0xb123('0x35')](_0x3fb4b9[_0xb123('0x30')][_0xb123('0x35')]));_0x29e019['attributes']=_0x29e019[_0xb123('0x34')]['length']?_0x29e019[_0xb123('0x34')]:_0x4d1536[_0xb123('0x2f')];if(_0x3fb4b9[_0xb123('0x30')][_0xb123('0x45')]){_0x29e019['include']=[{'all':!![]}];}_0x29e019=_['merge']({},_0x29e019,_0x3fb4b9[_0xb123('0x3f')]);return db[_0xb123('0x2a')][_0xb123('0x46')](_0x29e019)[_0xb123('0x23')](handleEntityNotFound(_0x1fa8da,null))[_0xb123('0x23')](respondWithResult(_0x1fa8da,null))[_0xb123('0x42')](handleError(_0x1fa8da,null));};exports[_0xb123('0x47')]=function(_0x4e5186,_0x198fe2){return db[_0xb123('0x2a')][_0xb123('0x47')](_0x4e5186[_0xb123('0x48')],{})[_0xb123('0x23')](respondWithResult(_0x198fe2,0xc9))[_0xb123('0x42')](handleError(_0x198fe2,null));};exports[_0xb123('0x22')]=function(_0x94e9f9,_0x2ab951){if(_0x94e9f9[_0xb123('0x48')]['id']){delete _0x94e9f9[_0xb123('0x48')]['id'];}return db['VoiceMailMessage'][_0xb123('0x46')]({'where':{'id':_0x94e9f9[_0xb123('0x44')]['id']}})[_0xb123('0x23')](handleEntityNotFound(_0x2ab951,null))[_0xb123('0x23')](saveUpdates(_0x94e9f9[_0xb123('0x48')],null))[_0xb123('0x23')](respondWithResult(_0x2ab951,null))[_0xb123('0x42')](handleError(_0x2ab951,null));};exports[_0xb123('0x24')]=function(_0x3e3110,_0x2d8dd3){return db[_0xb123('0x2a')]['find']({'where':{'id':_0x3e3110['params']['id']}})['then'](handleEntityNotFound(_0x2d8dd3,null))[_0xb123('0x23')](removeEntity(_0x2d8dd3,null))[_0xb123('0x42')](handleError(_0x2d8dd3,null));};exports['download']=function(_0x564fb0,_0xa4d8d,_0x74474b){return db['VoiceMailMessage'][_0xb123('0x46')]({'where':{'id':_0x564fb0[_0xb123('0x44')]['id']},'attributes':['id',_0xb123('0x49'),'msg_id']})['then'](handleEntityNotFound(_0xa4d8d,null))[_0xb123('0x23')](function(_0x387fa6){if(_0x387fa6){if(!_0x387fa6[_0xb123('0x49')]){throw new db[(_0xb123('0x4a'))]['ValidationError']('VoiceMailMessage\x20not\x20found');}var _0x3c3036={'Content-Type':_0xb123('0x4b'),'Content-Disposition':_0xb123('0x4c')};if(_0x387fa6[_0xb123('0x4d')]){_0x3c3036['Content-Disposition']=_0xb123('0x4e')+_0x387fa6[_0xb123('0x4d')]+_0xb123('0x4f');}_0xa4d8d[_0xb123('0x1d')](_0x3c3036);return _0xa4d8d['send'](new Buffer(_0x387fa6['recording']));}})[_0xb123('0x42')](handleError(_0xa4d8d,null));}; \ No newline at end of file +var _0x2df9=['find','create','update','body','download','msg_id','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','.wav\x22','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','destroy','then','error','stack','name','send','index','map','VoiceMailMessage','rawAttributes','model','differenceBy','query','keys','filters','intersection','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','fields','include'];(function(_0x4b7535,_0x16bfe7){var _0x4f86a5=function(_0x25c065){while(--_0x25c065){_0x4b7535['push'](_0x4b7535['shift']());}};_0x4f86a5(++_0x16bfe7);}(_0x2df9,0xb0));var _0x92df=function(_0x10bf5e,_0x58cf66){_0x10bf5e=_0x10bf5e-0x0;var _0x14520d=_0x2df9[_0x10bf5e];return _0x14520d;};'use strict';var emlformat=require(_0x92df('0x0'));var rimraf=require(_0x92df('0x1'));var zipdir=require(_0x92df('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x92df('0x3'));var moment=require(_0x92df('0x4'));var BPromise=require(_0x92df('0x5'));var Mustache=require(_0x92df('0x6'));var util=require('util');var path=require('path');var sox=require(_0x92df('0x7'));var csv=require(_0x92df('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x92df('0x9'));var squel=require(_0x92df('0xa'));var crypto=require(_0x92df('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x92df('0xc'));var toCsv=require(_0x92df('0x8'));var querystring=require(_0x92df('0xd'));var Papa=require(_0x92df('0xe'));var Redis=require(_0x92df('0xf'));var authService=require(_0x92df('0x10'));var qs=require(_0x92df('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x92df('0x12'));var logger=require(_0x92df('0x13'))(_0x92df('0x14'));var utils=require(_0x92df('0x15'));var config=require(_0x92df('0x16'));var licenseUtil=require(_0x92df('0x17'));var db=require(_0x92df('0x18'))['db'];function respondWithStatusCode(_0x43feeb,_0x18108b){_0x18108b=_0x18108b||0xcc;return function(_0x196249){if(_0x196249){return _0x43feeb[_0x92df('0x19')](_0x18108b);}return _0x43feeb[_0x92df('0x1a')](_0x18108b)[_0x92df('0x1b')]();};}function respondWithResult(_0x4e0e5f,_0x19bcab){_0x19bcab=_0x19bcab||0xc8;return function(_0x2f2737){if(_0x2f2737){return _0x4e0e5f[_0x92df('0x1a')](_0x19bcab)['json'](_0x2f2737);}};}function respondWithFilteredResult(_0xe207e0,_0x28c584){return function(_0x510efe){if(_0x510efe){var _0x475ddd=typeof _0x28c584[_0x92df('0x1c')]===_0x92df('0x1d')&&typeof _0x28c584[_0x92df('0x1e')]===_0x92df('0x1d');var _0x47d642=_0x510efe[_0x92df('0x1f')];var _0x2f136f=_0x475ddd?0x0:_0x28c584[_0x92df('0x1c')];var _0x4f1155=_0x475ddd?_0x510efe['count']:_0x28c584[_0x92df('0x1c')]+_0x28c584['limit'];var _0x875d45;if(_0x4f1155>=_0x47d642){_0x4f1155=_0x47d642;_0x875d45=0xc8;}else{_0x875d45=0xce;}_0xe207e0[_0x92df('0x1a')](_0x875d45);return _0xe207e0[_0x92df('0x20')](_0x92df('0x21'),_0x2f136f+'-'+_0x4f1155+'/'+_0x47d642)[_0x92df('0x22')](_0x510efe);}return null;};}function patchUpdates(_0x23e76f){return function(_0xbd580){try{jsonpatch[_0x92df('0x23')](_0xbd580,_0x23e76f,!![]);}catch(_0x19306a){return BPromise['reject'](_0x19306a);}return _0xbd580[_0x92df('0x24')]();};}function saveUpdates(_0x35b94c,_0x280186){return function(_0x2efb39){if(_0x2efb39){return _0x2efb39['update'](_0x35b94c)['then'](function(_0x2d790a){return _0x2d790a;});}return null;};}function removeEntity(_0x1a8a00,_0x3bd59d){return function(_0x4fdf23){if(_0x4fdf23){return _0x4fdf23[_0x92df('0x25')]()[_0x92df('0x26')](function(){_0x1a8a00[_0x92df('0x1a')](0xcc)[_0x92df('0x1b')]();});}};}function handleEntityNotFound(_0x6040c7,_0x383431){return function(_0x55222c){if(!_0x55222c){_0x6040c7[_0x92df('0x19')](0x194);}return _0x55222c;};}function handleError(_0xf145a1,_0x364ac8){_0x364ac8=_0x364ac8||0x1f4;return function(_0x163d59){logger[_0x92df('0x27')](_0x163d59[_0x92df('0x28')]);if(_0x163d59[_0x92df('0x29')]){delete _0x163d59[_0x92df('0x29')];}_0xf145a1['status'](_0x364ac8)[_0x92df('0x2a')](_0x163d59);};}exports[_0x92df('0x2b')]=function(_0x57e64f,_0x4d8cec){var _0x5e206a={},_0x270e18={},_0x44ce79={'count':0x0,'rows':[]};var _0x2e76f6=_[_0x92df('0x2c')](db[_0x92df('0x2d')][_0x92df('0x2e')],function(_0x335165){return{'name':_0x335165['fieldName'],'type':_0x335165['type']['key']};});_0x270e18[_0x92df('0x2f')]=_[_0x92df('0x30')](_[_0x92df('0x2c')](_0x2e76f6,_0x92df('0x29')),[_0x92df('0x29')]);_0x270e18[_0x92df('0x31')]=_[_0x92df('0x32')](_0x57e64f[_0x92df('0x31')]);_0x270e18[_0x92df('0x33')]=_[_0x92df('0x34')](_0x270e18['model'],_0x270e18[_0x92df('0x31')]);_0x5e206a[_0x92df('0x35')]=_['intersection'](_0x270e18[_0x92df('0x2f')],qs['fields'](_0x57e64f[_0x92df('0x31')]['fields']));_0x5e206a[_0x92df('0x35')]=_0x5e206a[_0x92df('0x35')][_0x92df('0x36')]?_0x5e206a[_0x92df('0x35')]:_0x270e18[_0x92df('0x2f')];if(!_0x57e64f[_0x92df('0x31')][_0x92df('0x37')]('nolimit')){_0x5e206a['limit']=qs['limit'](_0x57e64f[_0x92df('0x31')][_0x92df('0x1e')]);_0x5e206a[_0x92df('0x1c')]=qs[_0x92df('0x1c')](_0x57e64f[_0x92df('0x31')]['offset']);}_0x5e206a['order']=qs['sort'](_0x57e64f[_0x92df('0x31')][_0x92df('0x38')]);_0x5e206a[_0x92df('0x39')]=qs[_0x92df('0x33')](_[_0x92df('0x3a')](_0x57e64f[_0x92df('0x31')],_0x270e18[_0x92df('0x33')]),_0x2e76f6);if(_0x57e64f[_0x92df('0x31')][_0x92df('0x3b')]){_0x5e206a[_0x92df('0x39')]=_[_0x92df('0x3c')](_0x5e206a[_0x92df('0x39')],{'$or':_['map'](_0x2e76f6,function(_0xd4f8d0){if(_0xd4f8d0['type']!==_0x92df('0x3d')){var _0x4caa61={};_0x4caa61[_0xd4f8d0[_0x92df('0x29')]]={'$like':'%'+_0x57e64f[_0x92df('0x31')]['filter']+'%'};return _0x4caa61;}})});}_0x5e206a=_['merge']({},_0x5e206a,_0x57e64f['options']);var _0x45dd16={'where':_0x5e206a[_0x92df('0x39')]};return db[_0x92df('0x2d')][_0x92df('0x1f')](_0x45dd16)[_0x92df('0x26')](function(_0x17206a){_0x44ce79[_0x92df('0x1f')]=_0x17206a;if(_0x57e64f['query'][_0x92df('0x3e')]){_0x5e206a['include']=[{'all':!![]}];}return db[_0x92df('0x2d')][_0x92df('0x3f')](_0x5e206a);})[_0x92df('0x26')](function(_0x3e85a1){_0x44ce79[_0x92df('0x40')]=_0x3e85a1;return _0x44ce79;})[_0x92df('0x26')](respondWithFilteredResult(_0x4d8cec,_0x5e206a))[_0x92df('0x41')](handleError(_0x4d8cec,null));};exports[_0x92df('0x42')]=function(_0x242c35,_0x358b9e){var _0x4f027d={'raw':!![],'where':{'id':_0x242c35[_0x92df('0x43')]['id']}},_0x2d6a85={};_0x2d6a85[_0x92df('0x2f')]=_[_0x92df('0x32')](db['VoiceMailMessage']['rawAttributes']);_0x2d6a85[_0x92df('0x31')]=_[_0x92df('0x32')](_0x242c35[_0x92df('0x31')]);_0x2d6a85[_0x92df('0x33')]=_[_0x92df('0x34')](_0x2d6a85[_0x92df('0x2f')],_0x2d6a85['query']);_0x4f027d[_0x92df('0x35')]=_[_0x92df('0x34')](_0x2d6a85[_0x92df('0x2f')],qs[_0x92df('0x44')](_0x242c35[_0x92df('0x31')][_0x92df('0x44')]));_0x4f027d['attributes']=_0x4f027d[_0x92df('0x35')]['length']?_0x4f027d[_0x92df('0x35')]:_0x2d6a85[_0x92df('0x2f')];if(_0x242c35['query'][_0x92df('0x3e')]){_0x4f027d[_0x92df('0x45')]=[{'all':!![]}];}_0x4f027d=_['merge']({},_0x4f027d,_0x242c35['options']);return db['VoiceMailMessage'][_0x92df('0x46')](_0x4f027d)[_0x92df('0x26')](handleEntityNotFound(_0x358b9e,null))[_0x92df('0x26')](respondWithResult(_0x358b9e,null))[_0x92df('0x41')](handleError(_0x358b9e,null));};exports[_0x92df('0x47')]=function(_0x2c6981,_0x455c23){return db[_0x92df('0x2d')]['create'](_0x2c6981['body'],{})['then'](respondWithResult(_0x455c23,0xc9))[_0x92df('0x41')](handleError(_0x455c23,null));};exports[_0x92df('0x48')]=function(_0x39c4fb,_0x5453b1){if(_0x39c4fb[_0x92df('0x49')]['id']){delete _0x39c4fb['body']['id'];}return db[_0x92df('0x2d')]['find']({'where':{'id':_0x39c4fb[_0x92df('0x43')]['id']}})['then'](handleEntityNotFound(_0x5453b1,null))[_0x92df('0x26')](saveUpdates(_0x39c4fb['body'],null))[_0x92df('0x26')](respondWithResult(_0x5453b1,null))['catch'](handleError(_0x5453b1,null));};exports[_0x92df('0x25')]=function(_0x12f62b,_0x1a771f){return db[_0x92df('0x2d')][_0x92df('0x46')]({'where':{'id':_0x12f62b[_0x92df('0x43')]['id']}})[_0x92df('0x26')](handleEntityNotFound(_0x1a771f,null))[_0x92df('0x26')](removeEntity(_0x1a771f,null))[_0x92df('0x41')](handleError(_0x1a771f,null));};exports[_0x92df('0x4a')]=function(_0x56e3af,_0xb6c2d3,_0x4b1113){return db['VoiceMailMessage'][_0x92df('0x46')]({'where':{'id':_0x56e3af['params']['id']},'attributes':['id','recording',_0x92df('0x4b')]})['then'](handleEntityNotFound(_0xb6c2d3,null))[_0x92df('0x26')](function(_0x4bb4ea){if(_0x4bb4ea){if(!_0x4bb4ea[_0x92df('0x4c')]){throw new db[(_0x92df('0x4d'))][(_0x92df('0x4e'))](_0x92df('0x4f'));}var _0x37ce10={'Content-Type':_0x92df('0x50'),'Content-Disposition':'attachment'};if(_0x4bb4ea['msg_id']){_0x37ce10['Content-Disposition']='attachment;\x20filename=\x22'+_0x4bb4ea[_0x92df('0x4b')]+_0x92df('0x51');}_0xb6c2d3[_0x92df('0x20')](_0x37ce10);return _0xb6c2d3[_0x92df('0x2a')](new Buffer(_0x4bb4ea[_0x92df('0x4c')]));}})[_0x92df('0x41')](handleError(_0xb6c2d3,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 7ee19db..d1d01df 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 _0x1f03=['VoiceMailMessage','dir','lodash','api','bluebird','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define'];(function(_0x2bdf72,_0x662686){var _0x47ac80=function(_0x402c8f){while(--_0x402c8f){_0x2bdf72['push'](_0x2bdf72['shift']());}};_0x47ac80(++_0x662686);}(_0x1f03,0x16d));var _0x31f0=function(_0x2e0ccd,_0x183d4e){_0x2e0ccd=_0x2e0ccd-0x0;var _0x41cb60=_0x1f03[_0x2e0ccd];return _0x41cb60;};'use strict';var _=require(_0x31f0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x31f0('0x1'));var moment=require('moment');var BPromise=require(_0x31f0('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x31f0('0x3'));var rimraf=require(_0x31f0('0x4'));var config=require(_0x31f0('0x5'));var attributes=require(_0x31f0('0x6'));module[_0x31f0('0x7')]=function(_0x290481,_0x24bc82){return _0x290481[_0x31f0('0x8')](_0x31f0('0x9'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x31f0('0xa'),'fields':[_0x31f0('0xa')]}],'timestamps':![]});}; \ No newline at end of file +var _0x229a=['request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','api'];(function(_0x1661a2,_0x23b437){var _0x15786f=function(_0x269357){while(--_0x269357){_0x1661a2['push'](_0x1661a2['shift']());}};_0x15786f(++_0x23b437);}(_0x229a,0x1a9));var _0xa229=function(_0x2172ef,_0x46b33c){_0x2172ef=_0x2172ef-0x0;var _0x2b877e=_0x229a[_0x2172ef];return _0x2b877e;};'use strict';var _=require(_0xa229('0x0'));var util=require(_0xa229('0x1'));var logger=require(_0xa229('0x2'))(_0xa229('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa229('0x4'));var fs=require('fs');var path=require(_0xa229('0x5'));var rimraf=require(_0xa229('0x6'));var config=require(_0xa229('0x7'));var attributes=require(_0xa229('0x8'));module[_0xa229('0x9')]=function(_0x911c3a,_0x41583a){return _0x911c3a['define'](_0xa229('0xa'),attributes,{'tableName':_0xa229('0xb'),'paranoid':![],'indexes':[{'name':_0xa229('0xc'),'fields':[_0xa229('0xc')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 264cf3b..c9ea47f 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 _0xb11b=['message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xb11b,0x115));var _0xbb11=function(_0x4928af,_0x5f55e6){_0x4928af=_0x4928af-0x0;var _0x32afd8=_0xb11b[_0x4928af];return _0x32afd8;};'use strict';var _=require(_0xbb11('0x0'));var util=require(_0xbb11('0x1'));var moment=require(_0xbb11('0x2'));var BPromise=require(_0xbb11('0x3'));var rs=require(_0xbb11('0x4'));var fs=require('fs');var Redis=require(_0xbb11('0x5'));var db=require(_0xbb11('0x6'))['db'];var utils=require(_0xbb11('0x7'));var logger=require(_0xbb11('0x8'))(_0xbb11('0x9'));var config=require(_0xbb11('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xbb11('0xb')][_0xbb11('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x50d2b,_0x3bb902,_0x4c1809){return new BPromise(function(_0x19fb80,_0x196a59){return client[_0xbb11('0xd')](_0x50d2b,_0x4c1809)[_0xbb11('0xe')](function(_0x287fb4){logger[_0xbb11('0xf')](_0xbb11('0x10'),_0x3bb902,_0xbb11('0x11'));logger[_0xbb11('0x12')](_0xbb11('0x13'),_0x3bb902,_0xbb11('0x11'),JSON[_0xbb11('0x14')](_0x287fb4));if(_0x287fb4[_0xbb11('0x15')]){if(_0x287fb4['error'][_0xbb11('0x16')]===0x1f4){logger[_0xbb11('0x15')](_0xbb11('0x10'),_0x3bb902,_0x287fb4['error'][_0xbb11('0x17')]);return _0x196a59(_0x287fb4[_0xbb11('0x15')][_0xbb11('0x17')]);}logger[_0xbb11('0x15')](_0xbb11('0x10'),_0x3bb902,_0x287fb4[_0xbb11('0x15')][_0xbb11('0x17')]);return _0x19fb80(_0x287fb4['error'][_0xbb11('0x17')]);}else{logger[_0xbb11('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x3bb902,'request\x20sent');_0x19fb80(_0x287fb4[_0xbb11('0x18')][_0xbb11('0x17')]);}})['catch'](function(_0x16da1d){logger[_0xbb11('0x15')]('VoiceMailMessage,\x20%s,\x20%s',_0x3bb902,_0x16da1d);_0x196a59(_0x16da1d);});});} \ No newline at end of file +var _0x55cc=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','VoiceMailMessage,\x20%s,\x20%s','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0x55cc,0x102));var _0xc55c=function(_0x596888,_0x254727){_0x596888=_0x596888-0x0;var _0x231f9b=_0x55cc[_0x596888];return _0x231f9b;};'use strict';var _=require(_0xc55c('0x0'));var util=require(_0xc55c('0x1'));var moment=require(_0xc55c('0x2'));var BPromise=require(_0xc55c('0x3'));var rs=require(_0xc55c('0x4'));var fs=require('fs');var Redis=require(_0xc55c('0x5'));var db=require(_0xc55c('0x6'))['db'];var utils=require(_0xc55c('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xc55c('0x8'));var jayson=require(_0xc55c('0x9'));var client=jayson[_0xc55c('0xa')][_0xc55c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2957aa,_0x1a7243,_0x19cefb){return new BPromise(function(_0x3c38a4,_0x5b5a0a){return client[_0xc55c('0xc')](_0x2957aa,_0x19cefb)['then'](function(_0x50b534){logger[_0xc55c('0xd')](_0xc55c('0xe'),_0x1a7243,'request\x20sent');logger[_0xc55c('0xf')](_0xc55c('0x10'),_0x1a7243,_0xc55c('0x11'),JSON['stringify'](_0x50b534));if(_0x50b534['error']){if(_0x50b534[_0xc55c('0x12')][_0xc55c('0x13')]===0x1f4){logger[_0xc55c('0x12')]('VoiceMailMessage,\x20%s,\x20%s',_0x1a7243,_0x50b534[_0xc55c('0x12')][_0xc55c('0x14')]);return _0x5b5a0a(_0x50b534['error']['message']);}logger['error'](_0xc55c('0xe'),_0x1a7243,_0x50b534['error'][_0xc55c('0x14')]);return _0x3c38a4(_0x50b534['error'][_0xc55c('0x14')]);}else{logger[_0xc55c('0xd')](_0xc55c('0xe'),_0x1a7243,_0xc55c('0x11'));_0x3c38a4(_0x50b534[_0xc55c('0x15')][_0xc55c('0x14')]);}})[_0xc55c('0x16')](function(_0x26a3c0){logger[_0xc55c('0x12')](_0xc55c('0xe'),_0x1a7243,_0x26a3c0);_0x5b5a0a(_0x26a3c0);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 72a7b1b..5789fc3 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 _0xcb07=['create','post','delete','destroy','/:id/sounds/:id2','removeSound','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/sounds','getSounds'];(function(_0x54cb31,_0x2d0722){var _0x3987ba=function(_0x4af13c){while(--_0x4af13c){_0x54cb31['push'](_0x54cb31['shift']());}};_0x3987ba(++_0x2d0722);}(_0xcb07,0x1b7));var _0x7cb0=function(_0x222550,_0x3c0a0c){_0x222550=_0x222550-0x0;var _0x58ac61=_0xcb07[_0x222550];return _0x58ac61;};'use strict';var multer=require(_0x7cb0('0x0'));var util=require(_0x7cb0('0x1'));var path=require(_0x7cb0('0x2'));var timeout=require(_0x7cb0('0x3'));var express=require(_0x7cb0('0x4'));var router=express[_0x7cb0('0x5')]();var fs_extra=require(_0x7cb0('0x6'));var auth=require(_0x7cb0('0x7'));var interaction=require(_0x7cb0('0x8'));var config=require(_0x7cb0('0x9'));var controller=require('./voiceMusicOnHold.controller');router[_0x7cb0('0xa')]('/',auth[_0x7cb0('0xb')](),controller[_0x7cb0('0xc')]);router[_0x7cb0('0xa')](_0x7cb0('0xd'),auth[_0x7cb0('0xb')](),controller[_0x7cb0('0xe')]);router['get'](_0x7cb0('0xf'),auth['isAuthenticated'](),controller[_0x7cb0('0x10')]);router['post']('/',auth[_0x7cb0('0xb')](),controller[_0x7cb0('0x11')]);router[_0x7cb0('0x12')](_0x7cb0('0xf'),auth['isAuthenticated'](),controller['addSound']);router['put'](_0x7cb0('0xd'),auth[_0x7cb0('0xb')](),controller['update']);router[_0x7cb0('0x13')](_0x7cb0('0xd'),auth[_0x7cb0('0xb')](),controller[_0x7cb0('0x14')]);router[_0x7cb0('0x13')](_0x7cb0('0x15'),auth[_0x7cb0('0xb')](),controller[_0x7cb0('0x16')]);module[_0x7cb0('0x17')]=router; \ No newline at end of file +var _0x89cd=['removeSound','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','index','isAuthenticated','show','/:id/sounds','getSounds','post','create','addSound','put','/:id','update','delete','destroy'];(function(_0x2d9934,_0x1d52dd){var _0x356d35=function(_0x21584e){while(--_0x21584e){_0x2d9934['push'](_0x2d9934['shift']());}};_0x356d35(++_0x1d52dd);}(_0x89cd,0x182));var _0xd89c=function(_0x1db76,_0x1e047c){_0x1db76=_0x1db76-0x0;var _0x49f54d=_0x89cd[_0x1db76];return _0x49f54d;};'use strict';var multer=require(_0xd89c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd89c('0x1'));var express=require('express');var router=express[_0xd89c('0x2')]();var fs_extra=require(_0xd89c('0x3'));var auth=require(_0xd89c('0x4'));var interaction=require(_0xd89c('0x5'));var config=require(_0xd89c('0x6'));var controller=require(_0xd89c('0x7'));router[_0xd89c('0x8')]('/',auth['isAuthenticated'](),controller[_0xd89c('0x9')]);router[_0xd89c('0x8')]('/:id',auth[_0xd89c('0xa')](),controller[_0xd89c('0xb')]);router[_0xd89c('0x8')](_0xd89c('0xc'),auth[_0xd89c('0xa')](),controller[_0xd89c('0xd')]);router[_0xd89c('0xe')]('/',auth[_0xd89c('0xa')](),controller[_0xd89c('0xf')]);router[_0xd89c('0xe')](_0xd89c('0xc'),auth[_0xd89c('0xa')](),controller[_0xd89c('0x10')]);router[_0xd89c('0x11')](_0xd89c('0x12'),auth['isAuthenticated'](),controller[_0xd89c('0x13')]);router[_0xd89c('0x14')](_0xd89c('0x12'),auth[_0xd89c('0xa')](),controller[_0xd89c('0x15')]);router[_0xd89c('0x14')]('/:id/sounds/:id2',auth[_0xd89c('0xa')](),controller[_0xd89c('0x16')]);module[_0xd89c('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 85158dc..bec6e37 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 _0xfcea=['BOOLEAN','STRING','name','ENUM','custom','files','mp3nb','quietmp3nb','mp3','alpha','TIMESTAMP'];(function(_0x5eea70,_0x3ae2ef){var _0x4d905d=function(_0x59c1a5){while(--_0x59c1a5){_0x5eea70['push'](_0x5eea70['shift']());}};_0x4d905d(++_0x3ae2ef);}(_0xfcea,0x1b9));var _0xafce=function(_0x4f213a,_0x1315ff){_0x4f213a=_0x4f213a-0x0;var _0x5225a3=_0xfcea[_0x4f213a];return _0x5225a3;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xafce('0x0')],'allowNull':![],'unique':_0xafce('0x1')},'mode':{'type':Sequelize[_0xafce('0x2')](_0xafce('0x3'),_0xafce('0x4'),_0xafce('0x5'),_0xafce('0x6'),'quietmp3',_0xafce('0x7')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0xafce('0x0')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0xafce('0x0')],'allowNull':!![],'defaultValue':_0xafce('0x8')},'format':{'type':Sequelize[_0xafce('0x0')],'allowNull':!![]},'stamp':{'type':_0xafce('0x9')},'defaultEntry':{'type':Sequelize[_0xafce('0xa')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8be6=['alpha','TIMESTAMP','BOOLEAN','sequelize','exports','STRING','name','ENUM','custom','files','mp3nb','quietmp3','mp3'];(function(_0x2f7d18,_0x44bea6){var _0x425175=function(_0x4b6787){while(--_0x4b6787){_0x2f7d18['push'](_0x2f7d18['shift']());}};_0x425175(++_0x44bea6);}(_0x8be6,0x1a3));var _0x68be=function(_0x289828,_0x19d51f){_0x289828=_0x289828-0x0;var _0x2f08b8=_0x8be6[_0x289828];return _0x2f08b8;};'use strict';var Sequelize=require(_0x68be('0x0'));module[_0x68be('0x1')]={'name':{'type':Sequelize[_0x68be('0x2')],'allowNull':![],'unique':_0x68be('0x3')},'mode':{'type':Sequelize[_0x68be('0x4')](_0x68be('0x5'),_0x68be('0x6'),_0x68be('0x7'),'quietmp3nb',_0x68be('0x8'),_0x68be('0x9')),'allowNull':!![],'defaultValue':_0x68be('0x6')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x68be('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x68be('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x68be('0x2')],'allowNull':!![],'defaultValue':_0x68be('0xa')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x68be('0xb')},'defaultEntry':{'type':Sequelize[_0x68be('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 7667c6d..175181a 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 _0x0306=['json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','MusicOnHolds','UserProfileResource','error','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','options','include','findAll','rows','catch','show','includeAll','merge','find','body','create','files','directory','join','root','server/files/moh','mode','mkdirSync','0777','user','role','UserProfileSection','userProfileId','autoAssociation','readdirSync','unlinkSync','Sequelize','ValidationError','message','addSound','sequelize','params','Sound','findOne','save_name','converted_format','server/files/sounds/converted','format','%s.%s','basename','symlinkSync','removeSound','transaction','id2','createdAt','getSounds','filter','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x102545,_0x827393){var _0x232b0e=function(_0x24730d){while(--_0x24730d){_0x102545['push'](_0x102545['shift']());}};_0x232b0e(++_0x827393);}(_0x0306,0x134));var _0x6030=function(_0x2138ba,_0x522666){_0x2138ba=_0x2138ba-0x0;var _0xafb4cf=_0x0306[_0x2138ba];return _0xafb4cf;};'use strict';var emlformat=require(_0x6030('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6030('0x1'));var jsonpatch=require(_0x6030('0x2'));var rp=require(_0x6030('0x3'));var moment=require(_0x6030('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6030('0x5'));var path=require(_0x6030('0x6'));var sox=require(_0x6030('0x7'));var csv=require(_0x6030('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6030('0x9'));var _=require(_0x6030('0xa'));var squel=require(_0x6030('0xb'));var crypto=require(_0x6030('0xc'));var jsforce=require(_0x6030('0xd'));var deskjs=require(_0x6030('0xe'));var toCsv=require(_0x6030('0x8'));var querystring=require(_0x6030('0xf'));var Papa=require(_0x6030('0x10'));var Redis=require(_0x6030('0x11'));var authService=require(_0x6030('0x12'));var qs=require(_0x6030('0x13'));var as=require(_0x6030('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6030('0x15'))('api');var utils=require(_0x6030('0x16'));var config=require(_0x6030('0x17'));var licenseUtil=require(_0x6030('0x18'));var db=require(_0x6030('0x19'))['db'];function respondWithStatusCode(_0x540d1a,_0x2407ab){_0x2407ab=_0x2407ab||0xcc;return function(_0x1d4d3c){if(_0x1d4d3c){return _0x540d1a[_0x6030('0x1a')](_0x2407ab);}return _0x540d1a[_0x6030('0x1b')](_0x2407ab)['end']();};}function respondWithResult(_0x48bf2e,_0x4dd59e){_0x4dd59e=_0x4dd59e||0xc8;return function(_0x2e622e){if(_0x2e622e){return _0x48bf2e[_0x6030('0x1b')](_0x4dd59e)[_0x6030('0x1c')](_0x2e622e);}};}function respondWithFilteredResult(_0xf4935e,_0x18eaaf){return function(_0xa0da1c){if(_0xa0da1c){var _0x35a062=typeof _0x18eaaf[_0x6030('0x1d')]===_0x6030('0x1e')&&typeof _0x18eaaf[_0x6030('0x1f')]==='undefined';var _0x2cc53b=_0xa0da1c[_0x6030('0x20')];var _0x1d74e9=_0x35a062?0x0:_0x18eaaf[_0x6030('0x1d')];var _0x264a02=_0x35a062?_0xa0da1c[_0x6030('0x20')]:_0x18eaaf[_0x6030('0x1d')]+_0x18eaaf[_0x6030('0x1f')];var _0x2afc5a;if(_0x264a02>=_0x2cc53b){_0x264a02=_0x2cc53b;_0x2afc5a=0xc8;}else{_0x2afc5a=0xce;}_0xf4935e[_0x6030('0x1b')](_0x2afc5a);return _0xf4935e[_0x6030('0x21')](_0x6030('0x22'),_0x1d74e9+'-'+_0x264a02+'/'+_0x2cc53b)[_0x6030('0x1c')](_0xa0da1c);}return null;};}function patchUpdates(_0xea23d1){return function(_0x121592){try{jsonpatch[_0x6030('0x23')](_0x121592,_0xea23d1,!![]);}catch(_0x45963c){return BPromise[_0x6030('0x24')](_0x45963c);}return _0x121592['save']();};}function saveUpdates(_0x4e5236,_0x198980){return function(_0x11e260){if(_0x11e260){return _0x11e260[_0x6030('0x25')](_0x4e5236)[_0x6030('0x26')](function(_0x211d45){return _0x211d45;});}return null;};}function removeEntity(_0xf10b42,_0x5b0156){return function(_0x1c1efc){if(_0x1c1efc){return _0x1c1efc[_0x6030('0x27')]()['then'](function(){var _0x1a8c5e=_0x1c1efc[_0x6030('0x28')]({'plain':!![]});var _0xc83ce8=_0x6030('0x29');return db[_0x6030('0x2a')][_0x6030('0x27')]({'where':{'type':_0xc83ce8,'resourceId':_0x1a8c5e['id']}})[_0x6030('0x26')](function(){return _0x1c1efc;});})[_0x6030('0x26')](function(){_0xf10b42[_0x6030('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x563d2e,_0x53d99f){return function(_0xad7220){if(!_0xad7220){_0x563d2e[_0x6030('0x1a')](0x194);}return _0xad7220;};}function handleError(_0x5d9670,_0x1eee5d){_0x1eee5d=_0x1eee5d||0x1f4;return function(_0x3d422e){logger[_0x6030('0x2b')](_0x3d422e[_0x6030('0x2c')]);if(_0x3d422e[_0x6030('0x2d')]){delete _0x3d422e[_0x6030('0x2d')];}_0x5d9670['status'](_0x1eee5d)[_0x6030('0x2e')](_0x3d422e);};}exports[_0x6030('0x2f')]=function(_0x5bf32e,_0x2be1b4){var _0x38c80e={},_0x21df5b={},_0x594343={'count':0x0,'rows':[]};var _0x24efcb=_[_0x6030('0x30')](db[_0x6030('0x31')][_0x6030('0x32')],function(_0x4d0bb1){return{'name':_0x4d0bb1['fieldName'],'type':_0x4d0bb1[_0x6030('0x33')]['key']};});_0x21df5b[_0x6030('0x34')]=_[_0x6030('0x30')](_0x24efcb,_0x6030('0x2d'));_0x21df5b[_0x6030('0x35')]=_[_0x6030('0x36')](_0x5bf32e[_0x6030('0x35')]);_0x21df5b['filters']=_[_0x6030('0x37')](_0x21df5b[_0x6030('0x34')],_0x21df5b[_0x6030('0x35')]);_0x38c80e[_0x6030('0x38')]=_['intersection'](_0x21df5b['model'],qs['fields'](_0x5bf32e[_0x6030('0x35')][_0x6030('0x39')]));_0x38c80e[_0x6030('0x38')]=_0x38c80e[_0x6030('0x38')][_0x6030('0x3a')]?_0x38c80e[_0x6030('0x38')]:_0x21df5b[_0x6030('0x34')];if(!_0x5bf32e[_0x6030('0x35')][_0x6030('0x3b')](_0x6030('0x3c'))){_0x38c80e[_0x6030('0x1f')]=qs['limit'](_0x5bf32e['query'][_0x6030('0x1f')]);_0x38c80e[_0x6030('0x1d')]=qs[_0x6030('0x1d')](_0x5bf32e[_0x6030('0x35')][_0x6030('0x1d')]);}_0x38c80e['order']=qs[_0x6030('0x3d')](_0x5bf32e[_0x6030('0x35')][_0x6030('0x3d')]);delete _0x5bf32e[_0x6030('0x35')][_0x6030('0x3d')];_0x38c80e[_0x6030('0x3e')]=qs[_0x6030('0x3f')](_[_0x6030('0x40')](_0x5bf32e[_0x6030('0x35')],_0x21df5b[_0x6030('0x3f')]),_0x24efcb);if(_0x5bf32e['query']['filter']){_0x38c80e['where']=_['merge'](_0x38c80e[_0x6030('0x3e')],{'$or':_[_0x6030('0x30')](_0x24efcb,function(_0x4250ed){if(_0x4250ed[_0x6030('0x33')]!=='VIRTUAL'){var _0xd21d7a={};_0xd21d7a[_0x4250ed[_0x6030('0x2d')]]={'$like':'%'+_0x5bf32e[_0x6030('0x35')]['filter']+'%'};return _0xd21d7a;}})});}_0x38c80e=_['merge']({},_0x38c80e,_0x5bf32e[_0x6030('0x41')]);var _0x47541d={'where':_0x38c80e[_0x6030('0x3e')]};return db[_0x6030('0x31')][_0x6030('0x20')](_0x47541d)['then'](function(_0x3cabf3){_0x594343[_0x6030('0x20')]=_0x3cabf3;if(_0x5bf32e[_0x6030('0x35')]['includeAll']){_0x38c80e[_0x6030('0x42')]=[{'all':!![]}];}return db[_0x6030('0x31')][_0x6030('0x43')](_0x38c80e);})[_0x6030('0x26')](function(_0x11903a){_0x594343[_0x6030('0x44')]=_0x11903a;return _0x594343;})['then'](respondWithFilteredResult(_0x2be1b4,_0x38c80e))[_0x6030('0x45')](handleError(_0x2be1b4,null));};exports[_0x6030('0x46')]=function(_0x1b3705,_0x41bb19){var _0x25008f={'raw':![],'where':{'id':_0x1b3705['params']['id']}},_0x2112b3={};_0x2112b3[_0x6030('0x34')]=_[_0x6030('0x36')](db[_0x6030('0x31')]['rawAttributes']);_0x2112b3[_0x6030('0x35')]=_[_0x6030('0x36')](_0x1b3705[_0x6030('0x35')]);_0x2112b3[_0x6030('0x3f')]=_[_0x6030('0x37')](_0x2112b3[_0x6030('0x34')],_0x2112b3['query']);_0x25008f[_0x6030('0x38')]=_[_0x6030('0x37')](_0x2112b3[_0x6030('0x34')],qs[_0x6030('0x39')](_0x1b3705[_0x6030('0x35')][_0x6030('0x39')]));_0x25008f[_0x6030('0x38')]=_0x25008f[_0x6030('0x38')]['length']?_0x25008f[_0x6030('0x38')]:_0x2112b3[_0x6030('0x34')];if(_0x1b3705[_0x6030('0x35')][_0x6030('0x47')]){_0x25008f[_0x6030('0x42')]=[{'all':!![]}];}_0x25008f=_[_0x6030('0x48')]({},_0x25008f,_0x1b3705[_0x6030('0x41')]);return db[_0x6030('0x31')][_0x6030('0x49')](_0x25008f)[_0x6030('0x26')](handleEntityNotFound(_0x41bb19,null))['then'](respondWithResult(_0x41bb19,null))[_0x6030('0x45')](handleError(_0x41bb19,null));};exports[_0x6030('0x25')]=function(_0x1b7b58,_0x164147){if(_0x1b7b58[_0x6030('0x4a')]['id']){delete _0x1b7b58[_0x6030('0x4a')]['id'];}return db['VoiceMusicOnHold']['find']({'where':{'id':_0x1b7b58['params']['id']}})['then'](handleEntityNotFound(_0x164147,null))[_0x6030('0x26')](saveUpdates(_0x1b7b58['body'],null))[_0x6030('0x26')](respondWithResult(_0x164147,null))[_0x6030('0x45')](handleError(_0x164147,null));};exports[_0x6030('0x4b')]=function(_0x4cb9a6,_0x4cb8d3,_0x148f6d){return db['sequelize']['transaction'](function(_0x2f62cc){if(_0x4cb9a6[_0x6030('0x4a')]['mode']===_0x6030('0x4c')){_0x4cb9a6[_0x6030('0x4a')][_0x6030('0x4d')]=path[_0x6030('0x4e')](config[_0x6030('0x4f')],_0x6030('0x50'),_0x4cb9a6[_0x6030('0x4a')][_0x6030('0x2d')]);}return db[_0x6030('0x31')][_0x6030('0x4b')](_0x4cb9a6[_0x6030('0x4a')],{'transaction':_0x2f62cc})[_0x6030('0x26')](function(_0x531c2a){if(_0x4cb9a6[_0x6030('0x4a')][_0x6030('0x51')]===_0x6030('0x4c')){fs[_0x6030('0x52')](_0x531c2a[_0x6030('0x4d')],parseInt(_0x6030('0x53'),0x8));}var _0x42f7c7=_0x4cb9a6[_0x6030('0x54')][_0x6030('0x28')]({'plain':!![]});if(!_0x42f7c7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x42f7c7[_0x6030('0x55')]===_0x6030('0x54')){var _0x902964=_0x531c2a[_0x6030('0x28')]({'plain':!![]});return db[_0x6030('0x56')][_0x6030('0x49')]({'where':{'name':'MusicOnHolds','userProfileId':_0x42f7c7[_0x6030('0x57')]},'raw':!![]})['then'](function(_0x231af8){if(_0x231af8&&_0x231af8[_0x6030('0x58')]===0x0){return db[_0x6030('0x2a')][_0x6030('0x4b')]({'name':_0x902964[_0x6030('0x2d')],'resourceId':_0x902964['id'],'type':_0x231af8['name'],'sectionId':_0x231af8['id']},{})[_0x6030('0x26')](function(){return _0x531c2a;});}else{return _0x531c2a;}})[_0x6030('0x45')](function(_0x537844){logger[_0x6030('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x537844);});}return _0x531c2a;});})['then'](respondWithResult(_0x4cb8d3,0xc9))['catch'](handleError(_0x4cb8d3,null));};exports[_0x6030('0x27')]=function(_0x128ced,_0x2d4bd1,_0x35da40){var _0x45da61;return db[_0x6030('0x31')][_0x6030('0x49')]({'where':{'id':_0x128ced['params']['id']}})[_0x6030('0x26')](function(_0x5650a9){if(_0x5650a9){return db['sequelize']['transaction'](function(_0x55f1a7){return _0x5650a9[_0x6030('0x27')]({'transaction':_0x55f1a7,'raw':!![]})[_0x6030('0x26')](function(_0x391270){if(_0x391270[_0x6030('0x4d')]){fs[_0x6030('0x59')](_0x391270[_0x6030('0x4d')])['forEach'](function(_0x355562){fs[_0x6030('0x5a')](path[_0x6030('0x4e')](_0x391270[_0x6030('0x4d')],_0x355562));});fs['rmdirSync'](_0x391270[_0x6030('0x4d')]);}return _0x391270;});})['catch'](function(_0x40a0e2){throw new db[(_0x6030('0x5b'))][(_0x6030('0x5c'))](_0x40a0e2[_0x6030('0x5d')]);});}})[_0x6030('0x26')](handleEntityNotFound(_0x2d4bd1,null))[_0x6030('0x26')](removeEntity(_0x2d4bd1,null))[_0x6030('0x45')](handleError(_0x2d4bd1,null));};exports[_0x6030('0x5e')]=function(_0x5d1976,_0x141a38,_0x3e108f){return db[_0x6030('0x5f')]['transaction'](function(_0x32f73b){var _0x5f57ca;return db[_0x6030('0x31')]['find']({'where':{'id':_0x5d1976[_0x6030('0x60')]['id']}})[_0x6030('0x26')](function(_0x58d204){if(_0x58d204){_0x5f57ca=_0x58d204;return _0x58d204[_0x6030('0x5e')](_0x5d1976['body']['id'],{'transaction':_0x32f73b});}})[_0x6030('0x26')](function(_0x334803){if(_0x334803){return db[_0x6030('0x61')][_0x6030('0x62')]({'where':{'id':_0x5d1976[_0x6030('0x4a')]['id']},'attributes':['id',_0x6030('0x2d'),_0x6030('0x63'),_0x6030('0x64'),'createdAt'],'raw':!![]});}})['then'](function(_0x38a82c){if(_0x38a82c){var _0x3ec9cb=path[_0x6030('0x4e')](config[_0x6030('0x4f')],_0x6030('0x65'),util[_0x6030('0x66')](_0x6030('0x67'),path[_0x6030('0x68')](_0x38a82c[_0x6030('0x63')],path['extname'](_0x38a82c[_0x6030('0x63')])),_0x38a82c[_0x6030('0x64')]));var _0x395dee=path[_0x6030('0x4e')](config[_0x6030('0x4f')],_0x6030('0x50'),_0x5f57ca[_0x6030('0x2d')],util['format'](_0x6030('0x67'),_0x38a82c[_0x6030('0x2d')],_0x38a82c['converted_format']));fs[_0x6030('0x69')](_0x3ec9cb,_0x395dee);return _0x38a82c;}})['catch'](function(_0x18b106){throw new db[(_0x6030('0x5b'))]['ValidationError'](_0x18b106['message']);});})[_0x6030('0x26')](handleEntityNotFound(_0x141a38,null))[_0x6030('0x26')](respondWithResult(_0x141a38,0xc9))[_0x6030('0x45')](handleError(_0x141a38,null));};exports[_0x6030('0x6a')]=function(_0x22ccd6,_0x2e5c69,_0x3d34e2){return db[_0x6030('0x5f')][_0x6030('0x6b')](function(_0x19ced7){var _0x531693;return db['VoiceMusicOnHold'][_0x6030('0x62')]({'where':{'id':_0x22ccd6[_0x6030('0x60')]['id']}})[_0x6030('0x26')](handleEntityNotFound(_0x2e5c69,null))[_0x6030('0x26')](function(_0x197e9b){if(_0x197e9b){_0x531693=_0x197e9b;return _0x197e9b['removeSound'](_0x22ccd6[_0x6030('0x60')][_0x6030('0x6c')]);}})[_0x6030('0x26')](function(_0x1ebbc4){if(_0x1ebbc4){return db[_0x6030('0x61')][_0x6030('0x62')]({'where':{'id':_0x22ccd6['params']['id2']},'attributes':['id',_0x6030('0x2d'),_0x6030('0x63'),_0x6030('0x64'),_0x6030('0x6d')],'raw':!![]});}})[_0x6030('0x26')](function(_0x20dfb5){if(_0x20dfb5){fs[_0x6030('0x5a')](path[_0x6030('0x4e')](_0x531693[_0x6030('0x4d')],util['format'](_0x6030('0x67'),_0x20dfb5[_0x6030('0x2d')],_0x20dfb5[_0x6030('0x64')])));return _0x20dfb5;}})[_0x6030('0x45')](function(_0x50bdba){throw new db['Sequelize'][(_0x6030('0x5c'))](_0x50bdba['message']);});})[_0x6030('0x26')](handleEntityNotFound(_0x2e5c69,null))[_0x6030('0x26')](respondWithStatusCode(_0x2e5c69,0xcc))['catch'](handleError(_0x2e5c69,null));};exports[_0x6030('0x6e')]=function(_0x387ba8,_0x553cbb,_0x4856f9){var _0x2d8629={};var _0x46d3df={};var _0x1da106;var _0x354e33;return db[_0x6030('0x31')][_0x6030('0x62')]({'where':{'id':_0x387ba8[_0x6030('0x60')]['id']}})[_0x6030('0x26')](handleEntityNotFound(_0x553cbb,null))['then'](function(_0x3bf1a7){if(_0x3bf1a7){_0x1da106=_0x3bf1a7;_0x46d3df[_0x6030('0x34')]=_[_0x6030('0x36')](db['Sound'][_0x6030('0x32')]);_0x46d3df[_0x6030('0x35')]=_['keys'](_0x387ba8[_0x6030('0x35')]);_0x46d3df[_0x6030('0x3f')]=_['intersection'](_0x46d3df[_0x6030('0x34')],_0x46d3df[_0x6030('0x35')]);_0x2d8629[_0x6030('0x38')]=_[_0x6030('0x37')](_0x46d3df[_0x6030('0x34')],qs[_0x6030('0x39')](_0x387ba8[_0x6030('0x35')][_0x6030('0x39')]));_0x2d8629[_0x6030('0x38')]=_0x2d8629[_0x6030('0x38')][_0x6030('0x3a')]?_0x2d8629[_0x6030('0x38')]:_0x46d3df['model'];_0x2d8629['order']=qs[_0x6030('0x3d')](_0x387ba8[_0x6030('0x35')]['sort']);_0x2d8629[_0x6030('0x3e')]=qs[_0x6030('0x3f')](_[_0x6030('0x40')](_0x387ba8[_0x6030('0x35')],_0x46d3df[_0x6030('0x3f')]));if(_0x387ba8['query']['filter']){_0x2d8629[_0x6030('0x3e')]=_[_0x6030('0x48')](_0x2d8629['where'],{'$or':_[_0x6030('0x30')](_0x2d8629['attributes'],function(_0x5208d5){var _0x136053={};_0x136053[_0x5208d5]={'$like':'%'+_0x387ba8['query'][_0x6030('0x6f')]+'%'};return _0x136053;})});}_0x2d8629=_[_0x6030('0x48')]({},_0x2d8629,_0x387ba8[_0x6030('0x41')]);return _0x1da106[_0x6030('0x6e')](_0x2d8629);}})[_0x6030('0x26')](function(_0x9dd421){if(_0x9dd421){_0x354e33=_0x9dd421[_0x6030('0x3a')];if(!_0x387ba8[_0x6030('0x35')][_0x6030('0x3b')](_0x6030('0x3c'))){_0x2d8629['limit']=qs[_0x6030('0x1f')](_0x387ba8[_0x6030('0x35')]['limit']);_0x2d8629['offset']=qs['offset'](_0x387ba8[_0x6030('0x35')][_0x6030('0x1d')]);}return _0x1da106['getSounds'](_0x2d8629);}})[_0x6030('0x26')](function(_0x48f3b9){if(_0x48f3b9){return _0x48f3b9?{'count':_0x354e33,'rows':_0x48f3b9}:null;}})[_0x6030('0x26')](respondWithResult(_0x553cbb,null))['catch'](handleError(_0x553cbb,null));}; \ No newline at end of file +var _0x5f69=['bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','destroy','then','get','MusicOnHolds','UserProfileResource','error','name','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','length','catch','body','params','create','sequelize','transaction','mode','directory','join','root','server/files/moh','files','mkdirSync','0777','user','UserProfileSection','userProfileId','autoAssociation','unlinkSync','rmdirSync','Sequelize','message','find','findOne','save_name','converted_format','server/files/sounds/converted','extname','format','%s.%s','symlinkSync','ValidationError','removeSound','id2','createdAt','getSounds','Sound','hasOwnProperty','eml-format','zip-dir','request-promise','moment'];(function(_0x3699a9,_0x2201d1){var _0x443d2a=function(_0x17fb05){while(--_0x17fb05){_0x3699a9['push'](_0x3699a9['shift']());}};_0x443d2a(++_0x2201d1);}(_0x5f69,0x1a0));var _0x95f6=function(_0x5af59e,_0x3771c1){_0x5af59e=_0x5af59e-0x0;var _0x4240df=_0x5f69[_0x5af59e];return _0x4240df;};'use strict';var emlformat=require(_0x95f6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x95f6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x95f6('0x2'));var moment=require(_0x95f6('0x3'));var BPromise=require(_0x95f6('0x4'));var Mustache=require('mustache');var util=require(_0x95f6('0x5'));var path=require('path');var sox=require(_0x95f6('0x6'));var csv=require(_0x95f6('0x7'));var ejs=require(_0x95f6('0x8'));var fs=require('fs');var fs_extra=require(_0x95f6('0x9'));var _=require(_0x95f6('0xa'));var squel=require(_0x95f6('0xb'));var crypto=require('crypto');var jsforce=require(_0x95f6('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x95f6('0x7'));var querystring=require(_0x95f6('0xd'));var Papa=require(_0x95f6('0xe'));var Redis=require(_0x95f6('0xf'));var authService=require(_0x95f6('0x10'));var qs=require(_0x95f6('0x11'));var as=require(_0x95f6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x95f6('0x13'))('api');var utils=require(_0x95f6('0x14'));var config=require(_0x95f6('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d06db,_0x59c1f6){_0x59c1f6=_0x59c1f6||0xcc;return function(_0x5846b7){if(_0x5846b7){return _0x2d06db[_0x95f6('0x16')](_0x59c1f6);}return _0x2d06db[_0x95f6('0x17')](_0x59c1f6)[_0x95f6('0x18')]();};}function respondWithResult(_0x3cd05e,_0x2caa35){_0x2caa35=_0x2caa35||0xc8;return function(_0x15c6f8){if(_0x15c6f8){return _0x3cd05e[_0x95f6('0x17')](_0x2caa35)['json'](_0x15c6f8);}};}function respondWithFilteredResult(_0x13a35e,_0x1f5003){return function(_0x28df51){if(_0x28df51){var _0x288ac2=typeof _0x1f5003[_0x95f6('0x19')]===_0x95f6('0x1a')&&typeof _0x1f5003[_0x95f6('0x1b')]===_0x95f6('0x1a');var _0x37ae2c=_0x28df51[_0x95f6('0x1c')];var _0x321d8a=_0x288ac2?0x0:_0x1f5003['offset'];var _0x1b41a9=_0x288ac2?_0x28df51[_0x95f6('0x1c')]:_0x1f5003[_0x95f6('0x19')]+_0x1f5003[_0x95f6('0x1b')];var _0x3470f3;if(_0x1b41a9>=_0x37ae2c){_0x1b41a9=_0x37ae2c;_0x3470f3=0xc8;}else{_0x3470f3=0xce;}_0x13a35e[_0x95f6('0x17')](_0x3470f3);return _0x13a35e['set'](_0x95f6('0x1d'),_0x321d8a+'-'+_0x1b41a9+'/'+_0x37ae2c)[_0x95f6('0x1e')](_0x28df51);}return null;};}function patchUpdates(_0x5e0e32){return function(_0x9c2bd3){try{jsonpatch[_0x95f6('0x1f')](_0x9c2bd3,_0x5e0e32,!![]);}catch(_0x13eb44){return BPromise[_0x95f6('0x20')](_0x13eb44);}return _0x9c2bd3[_0x95f6('0x21')]();};}function saveUpdates(_0x42a704,_0x33dc09){return function(_0x2f9580){if(_0x2f9580){return _0x2f9580[_0x95f6('0x22')](_0x42a704)['then'](function(_0x289b85){return _0x289b85;});}return null;};}function removeEntity(_0x43145d,_0x2d4276){return function(_0x355b5a){if(_0x355b5a){return _0x355b5a[_0x95f6('0x23')]()[_0x95f6('0x24')](function(){var _0x9dd53a=_0x355b5a[_0x95f6('0x25')]({'plain':!![]});var _0x45f202=_0x95f6('0x26');return db[_0x95f6('0x27')][_0x95f6('0x23')]({'where':{'type':_0x45f202,'resourceId':_0x9dd53a['id']}})[_0x95f6('0x24')](function(){return _0x355b5a;});})['then'](function(){_0x43145d[_0x95f6('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x265831,_0x119b1c){return function(_0x3e6795){if(!_0x3e6795){_0x265831['sendStatus'](0x194);}return _0x3e6795;};}function handleError(_0x15e2e5,_0x1fc1d8){_0x1fc1d8=_0x1fc1d8||0x1f4;return function(_0x46b1d7){logger[_0x95f6('0x28')](_0x46b1d7['stack']);if(_0x46b1d7[_0x95f6('0x29')]){delete _0x46b1d7['name'];}_0x15e2e5[_0x95f6('0x17')](_0x1fc1d8)['send'](_0x46b1d7);};}exports[_0x95f6('0x2a')]=function(_0x36648a,_0x18d9f1){var _0x96ed65={},_0x5dd2d3={},_0x4f2b76={'count':0x0,'rows':[]};var _0x2ee4bc=_[_0x95f6('0x2b')](db[_0x95f6('0x2c')][_0x95f6('0x2d')],function(_0x5e2296){return{'name':_0x5e2296[_0x95f6('0x2e')],'type':_0x5e2296[_0x95f6('0x2f')][_0x95f6('0x30')]};});_0x5dd2d3[_0x95f6('0x31')]=_[_0x95f6('0x2b')](_0x2ee4bc,_0x95f6('0x29'));_0x5dd2d3['query']=_[_0x95f6('0x32')](_0x36648a['query']);_0x5dd2d3[_0x95f6('0x33')]=_[_0x95f6('0x34')](_0x5dd2d3[_0x95f6('0x31')],_0x5dd2d3[_0x95f6('0x35')]);_0x96ed65[_0x95f6('0x36')]=_[_0x95f6('0x34')](_0x5dd2d3[_0x95f6('0x31')],qs[_0x95f6('0x37')](_0x36648a[_0x95f6('0x35')][_0x95f6('0x37')]));_0x96ed65[_0x95f6('0x36')]=_0x96ed65[_0x95f6('0x36')]['length']?_0x96ed65[_0x95f6('0x36')]:_0x5dd2d3['model'];if(!_0x36648a['query']['hasOwnProperty']('nolimit')){_0x96ed65[_0x95f6('0x1b')]=qs[_0x95f6('0x1b')](_0x36648a[_0x95f6('0x35')][_0x95f6('0x1b')]);_0x96ed65[_0x95f6('0x19')]=qs[_0x95f6('0x19')](_0x36648a[_0x95f6('0x35')][_0x95f6('0x19')]);}_0x96ed65[_0x95f6('0x38')]=qs[_0x95f6('0x39')](_0x36648a[_0x95f6('0x35')][_0x95f6('0x39')]);delete _0x36648a['query'][_0x95f6('0x39')];_0x96ed65[_0x95f6('0x3a')]=qs['filters'](_[_0x95f6('0x3b')](_0x36648a['query'],_0x5dd2d3[_0x95f6('0x33')]),_0x2ee4bc);if(_0x36648a['query'][_0x95f6('0x3c')]){_0x96ed65['where']=_[_0x95f6('0x3d')](_0x96ed65[_0x95f6('0x3a')],{'$or':_[_0x95f6('0x2b')](_0x2ee4bc,function(_0x173df9){if(_0x173df9[_0x95f6('0x2f')]!==_0x95f6('0x3e')){var _0x5bf85b={};_0x5bf85b[_0x173df9[_0x95f6('0x29')]]={'$like':'%'+_0x36648a[_0x95f6('0x35')][_0x95f6('0x3c')]+'%'};return _0x5bf85b;}})});}_0x96ed65=_[_0x95f6('0x3d')]({},_0x96ed65,_0x36648a[_0x95f6('0x3f')]);var _0x9d6e1f={'where':_0x96ed65[_0x95f6('0x3a')]};return db[_0x95f6('0x2c')][_0x95f6('0x1c')](_0x9d6e1f)[_0x95f6('0x24')](function(_0xb725d4){_0x4f2b76[_0x95f6('0x1c')]=_0xb725d4;if(_0x36648a[_0x95f6('0x35')][_0x95f6('0x40')]){_0x96ed65['include']=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x95f6('0x41')](_0x96ed65);})[_0x95f6('0x24')](function(_0x14edd2){_0x4f2b76['rows']=_0x14edd2;return _0x4f2b76;})[_0x95f6('0x24')](respondWithFilteredResult(_0x18d9f1,_0x96ed65))['catch'](handleError(_0x18d9f1,null));};exports['show']=function(_0x151193,_0x467986){var _0x5742e9={'raw':![],'where':{'id':_0x151193['params']['id']}},_0x178f23={};_0x178f23[_0x95f6('0x31')]=_[_0x95f6('0x32')](db[_0x95f6('0x2c')][_0x95f6('0x2d')]);_0x178f23[_0x95f6('0x35')]=_['keys'](_0x151193['query']);_0x178f23[_0x95f6('0x33')]=_[_0x95f6('0x34')](_0x178f23[_0x95f6('0x31')],_0x178f23[_0x95f6('0x35')]);_0x5742e9[_0x95f6('0x36')]=_[_0x95f6('0x34')](_0x178f23[_0x95f6('0x31')],qs[_0x95f6('0x37')](_0x151193[_0x95f6('0x35')][_0x95f6('0x37')]));_0x5742e9[_0x95f6('0x36')]=_0x5742e9[_0x95f6('0x36')][_0x95f6('0x42')]?_0x5742e9['attributes']:_0x178f23[_0x95f6('0x31')];if(_0x151193[_0x95f6('0x35')][_0x95f6('0x40')]){_0x5742e9['include']=[{'all':!![]}];}_0x5742e9=_['merge']({},_0x5742e9,_0x151193[_0x95f6('0x3f')]);return db[_0x95f6('0x2c')]['find'](_0x5742e9)['then'](handleEntityNotFound(_0x467986,null))[_0x95f6('0x24')](respondWithResult(_0x467986,null))[_0x95f6('0x43')](handleError(_0x467986,null));};exports[_0x95f6('0x22')]=function(_0x19c85c,_0x3380bb){if(_0x19c85c[_0x95f6('0x44')]['id']){delete _0x19c85c['body']['id'];}return db[_0x95f6('0x2c')]['find']({'where':{'id':_0x19c85c[_0x95f6('0x45')]['id']}})[_0x95f6('0x24')](handleEntityNotFound(_0x3380bb,null))['then'](saveUpdates(_0x19c85c[_0x95f6('0x44')],null))['then'](respondWithResult(_0x3380bb,null))[_0x95f6('0x43')](handleError(_0x3380bb,null));};exports[_0x95f6('0x46')]=function(_0x5e73d0,_0x5dc503,_0x55da60){return db[_0x95f6('0x47')][_0x95f6('0x48')](function(_0x36e877){if(_0x5e73d0['body'][_0x95f6('0x49')]==='files'){_0x5e73d0[_0x95f6('0x44')][_0x95f6('0x4a')]=path[_0x95f6('0x4b')](config[_0x95f6('0x4c')],_0x95f6('0x4d'),_0x5e73d0['body'][_0x95f6('0x29')]);}return db['VoiceMusicOnHold'][_0x95f6('0x46')](_0x5e73d0[_0x95f6('0x44')],{'transaction':_0x36e877})['then'](function(_0x59d881){if(_0x5e73d0['body'][_0x95f6('0x49')]===_0x95f6('0x4e')){fs[_0x95f6('0x4f')](_0x59d881[_0x95f6('0x4a')],parseInt(_0x95f6('0x50'),0x8));}var _0xcacf7f=_0x5e73d0[_0x95f6('0x51')][_0x95f6('0x25')]({'plain':!![]});if(!_0xcacf7f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xcacf7f['role']==='user'){var _0xcd1a3b=_0x59d881[_0x95f6('0x25')]({'plain':!![]});return db[_0x95f6('0x52')]['find']({'where':{'name':_0x95f6('0x26'),'userProfileId':_0xcacf7f[_0x95f6('0x53')]},'raw':!![]})['then'](function(_0x36959c){if(_0x36959c&&_0x36959c[_0x95f6('0x54')]===0x0){return db['UserProfileResource'][_0x95f6('0x46')]({'name':_0xcd1a3b[_0x95f6('0x29')],'resourceId':_0xcd1a3b['id'],'type':_0x36959c[_0x95f6('0x29')],'sectionId':_0x36959c['id']},{})[_0x95f6('0x24')](function(){return _0x59d881;});}else{return _0x59d881;}})['catch'](function(_0x20f4c4){logger[_0x95f6('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x20f4c4);});}return _0x59d881;});})[_0x95f6('0x24')](respondWithResult(_0x5dc503,0xc9))['catch'](handleError(_0x5dc503,null));};exports[_0x95f6('0x23')]=function(_0x18c704,_0x44ee88,_0x4c291c){var _0x1f60a8;return db[_0x95f6('0x2c')]['find']({'where':{'id':_0x18c704[_0x95f6('0x45')]['id']}})[_0x95f6('0x24')](function(_0xb3944c){if(_0xb3944c){return db['sequelize'][_0x95f6('0x48')](function(_0x54d1a7){return _0xb3944c[_0x95f6('0x23')]({'transaction':_0x54d1a7,'raw':!![]})['then'](function(_0x3c4c09){if(_0x3c4c09[_0x95f6('0x4a')]){fs['readdirSync'](_0x3c4c09[_0x95f6('0x4a')])['forEach'](function(_0x12a0d8){fs[_0x95f6('0x55')](path[_0x95f6('0x4b')](_0x3c4c09[_0x95f6('0x4a')],_0x12a0d8));});fs[_0x95f6('0x56')](_0x3c4c09[_0x95f6('0x4a')]);}return _0x3c4c09;});})[_0x95f6('0x43')](function(_0x3c673c){throw new db[(_0x95f6('0x57'))]['ValidationError'](_0x3c673c[_0x95f6('0x58')]);});}})[_0x95f6('0x24')](handleEntityNotFound(_0x44ee88,null))['then'](removeEntity(_0x44ee88,null))[_0x95f6('0x43')](handleError(_0x44ee88,null));};exports['addSound']=function(_0x526df1,_0x3c068f,_0x7dcc48){return db[_0x95f6('0x47')][_0x95f6('0x48')](function(_0x471ca7){var _0x4173c0;return db[_0x95f6('0x2c')][_0x95f6('0x59')]({'where':{'id':_0x526df1[_0x95f6('0x45')]['id']}})[_0x95f6('0x24')](function(_0x2bb1a0){if(_0x2bb1a0){_0x4173c0=_0x2bb1a0;return _0x2bb1a0['addSound'](_0x526df1['body']['id'],{'transaction':_0x471ca7});}})[_0x95f6('0x24')](function(_0x5b49ca){if(_0x5b49ca){return db['Sound'][_0x95f6('0x5a')]({'where':{'id':_0x526df1['body']['id']},'attributes':['id',_0x95f6('0x29'),_0x95f6('0x5b'),_0x95f6('0x5c'),'createdAt'],'raw':!![]});}})['then'](function(_0x248489){if(_0x248489){var _0x1c8793=path[_0x95f6('0x4b')](config[_0x95f6('0x4c')],_0x95f6('0x5d'),util['format']('%s.%s',path['basename'](_0x248489[_0x95f6('0x5b')],path[_0x95f6('0x5e')](_0x248489['save_name'])),_0x248489[_0x95f6('0x5c')]));var _0x2860d3=path[_0x95f6('0x4b')](config[_0x95f6('0x4c')],_0x95f6('0x4d'),_0x4173c0[_0x95f6('0x29')],util[_0x95f6('0x5f')](_0x95f6('0x60'),_0x248489['name'],_0x248489[_0x95f6('0x5c')]));fs[_0x95f6('0x61')](_0x1c8793,_0x2860d3);return _0x248489;}})['catch'](function(_0x66a7b5){throw new db['Sequelize'][(_0x95f6('0x62'))](_0x66a7b5[_0x95f6('0x58')]);});})[_0x95f6('0x24')](handleEntityNotFound(_0x3c068f,null))[_0x95f6('0x24')](respondWithResult(_0x3c068f,0xc9))[_0x95f6('0x43')](handleError(_0x3c068f,null));};exports['removeSound']=function(_0x8de355,_0x427372,_0x4bc984){return db['sequelize'][_0x95f6('0x48')](function(_0x3ffe41){var _0x251831;return db[_0x95f6('0x2c')][_0x95f6('0x5a')]({'where':{'id':_0x8de355[_0x95f6('0x45')]['id']}})[_0x95f6('0x24')](handleEntityNotFound(_0x427372,null))[_0x95f6('0x24')](function(_0x74ce90){if(_0x74ce90){_0x251831=_0x74ce90;return _0x74ce90[_0x95f6('0x63')](_0x8de355[_0x95f6('0x45')][_0x95f6('0x64')]);}})[_0x95f6('0x24')](function(_0x54bce5){if(_0x54bce5){return db['Sound'][_0x95f6('0x5a')]({'where':{'id':_0x8de355[_0x95f6('0x45')]['id2']},'attributes':['id',_0x95f6('0x29'),_0x95f6('0x5b'),_0x95f6('0x5c'),_0x95f6('0x65')],'raw':!![]});}})[_0x95f6('0x24')](function(_0x156a59){if(_0x156a59){fs[_0x95f6('0x55')](path['join'](_0x251831[_0x95f6('0x4a')],util['format'](_0x95f6('0x60'),_0x156a59[_0x95f6('0x29')],_0x156a59[_0x95f6('0x5c')])));return _0x156a59;}})[_0x95f6('0x43')](function(_0x4dc132){throw new db[(_0x95f6('0x57'))]['ValidationError'](_0x4dc132[_0x95f6('0x58')]);});})['then'](handleEntityNotFound(_0x427372,null))[_0x95f6('0x24')](respondWithStatusCode(_0x427372,0xcc))[_0x95f6('0x43')](handleError(_0x427372,null));};exports[_0x95f6('0x66')]=function(_0x2ee688,_0x22ea23,_0x39164e){var _0x45d84a={};var _0x37c890={};var _0x4fcc93;var _0x5b50b3;return db[_0x95f6('0x2c')][_0x95f6('0x5a')]({'where':{'id':_0x2ee688['params']['id']}})[_0x95f6('0x24')](handleEntityNotFound(_0x22ea23,null))[_0x95f6('0x24')](function(_0x42a282){if(_0x42a282){_0x4fcc93=_0x42a282;_0x37c890[_0x95f6('0x31')]=_[_0x95f6('0x32')](db[_0x95f6('0x67')][_0x95f6('0x2d')]);_0x37c890[_0x95f6('0x35')]=_[_0x95f6('0x32')](_0x2ee688['query']);_0x37c890[_0x95f6('0x33')]=_[_0x95f6('0x34')](_0x37c890[_0x95f6('0x31')],_0x37c890[_0x95f6('0x35')]);_0x45d84a[_0x95f6('0x36')]=_['intersection'](_0x37c890['model'],qs[_0x95f6('0x37')](_0x2ee688['query'][_0x95f6('0x37')]));_0x45d84a[_0x95f6('0x36')]=_0x45d84a[_0x95f6('0x36')][_0x95f6('0x42')]?_0x45d84a['attributes']:_0x37c890[_0x95f6('0x31')];_0x45d84a[_0x95f6('0x38')]=qs['sort'](_0x2ee688[_0x95f6('0x35')]['sort']);_0x45d84a['where']=qs[_0x95f6('0x33')](_['pick'](_0x2ee688[_0x95f6('0x35')],_0x37c890[_0x95f6('0x33')]));if(_0x2ee688[_0x95f6('0x35')][_0x95f6('0x3c')]){_0x45d84a['where']=_[_0x95f6('0x3d')](_0x45d84a[_0x95f6('0x3a')],{'$or':_['map'](_0x45d84a[_0x95f6('0x36')],function(_0x122ff6){var _0x1c2eda={};_0x1c2eda[_0x122ff6]={'$like':'%'+_0x2ee688[_0x95f6('0x35')][_0x95f6('0x3c')]+'%'};return _0x1c2eda;})});}_0x45d84a=_['merge']({},_0x45d84a,_0x2ee688[_0x95f6('0x3f')]);return _0x4fcc93[_0x95f6('0x66')](_0x45d84a);}})[_0x95f6('0x24')](function(_0x9652fc){if(_0x9652fc){_0x5b50b3=_0x9652fc[_0x95f6('0x42')];if(!_0x2ee688[_0x95f6('0x35')][_0x95f6('0x68')]('nolimit')){_0x45d84a['limit']=qs[_0x95f6('0x1b')](_0x2ee688[_0x95f6('0x35')][_0x95f6('0x1b')]);_0x45d84a['offset']=qs[_0x95f6('0x19')](_0x2ee688[_0x95f6('0x35')][_0x95f6('0x19')]);}return _0x4fcc93[_0x95f6('0x66')](_0x45d84a);}})[_0x95f6('0x24')](function(_0x4ebecb){if(_0x4ebecb){return _0x4ebecb?{'count':_0x5b50b3,'rows':_0x4ebecb}:null;}})['then'](respondWithResult(_0x22ea23,null))['catch'](handleError(_0x22ea23,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 46af7a4..06ecb71 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 _0x4824=['util','api','moment','bluebird','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','define','VoiceMusicOnHold','voice_musiconhold'];(function(_0x22f85a,_0x195ed5){var _0xaa717=function(_0xe9828e){while(--_0xe9828e){_0x22f85a['push'](_0x22f85a['shift']());}};_0xaa717(++_0x195ed5);}(_0x4824,0x6e));var _0x4482=function(_0x6e21b5,_0x17cbee){_0x6e21b5=_0x6e21b5-0x0;var _0x384e42=_0x4824[_0x6e21b5];return _0x384e42;};'use strict';var _=require('lodash');var util=require(_0x4482('0x0'));var logger=require('../../config/logger')(_0x4482('0x1'));var moment=require(_0x4482('0x2'));var BPromise=require(_0x4482('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4482('0x4'));var rimraf=require(_0x4482('0x5'));var config=require(_0x4482('0x6'));var attributes=require(_0x4482('0x7'));module['exports']=function(_0x4eeed3,_0x3a7f59){return _0x4eeed3[_0x4482('0x8')](_0x4482('0x9'),attributes,{'tableName':_0x4482('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4cd6=['VoiceMusicOnHold','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','define'];(function(_0x4293e1,_0x1733b2){var _0x52a215=function(_0x54f88f){while(--_0x54f88f){_0x4293e1['push'](_0x4293e1['shift']());}};_0x52a215(++_0x1733b2);}(_0x4cd6,0x14b));var _0x64cd=function(_0x359532,_0x5492d9){_0x359532=_0x359532-0x0;var _0x5147b0=_0x4cd6[_0x359532];return _0x5147b0;};'use strict';var _=require(_0x64cd('0x0'));var util=require('util');var logger=require(_0x64cd('0x1'))(_0x64cd('0x2'));var moment=require(_0x64cd('0x3'));var BPromise=require(_0x64cd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x64cd('0x5'));var rimraf=require(_0x64cd('0x6'));var config=require(_0x64cd('0x7'));var attributes=require(_0x64cd('0x8'));module['exports']=function(_0x511cf0,_0x5a9e14){return _0x511cf0[_0x64cd('0x9')](_0x64cd('0xa'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index 1fcd3cb..5e8b18a 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceMusicOnHold,\x20%s,\x20%s','message','catch','util'];(function(_0x5b675e,_0x31da3b){var _0x2b1a33=function(_0x5b50c9){while(--_0x5b50c9){_0x5b675e['push'](_0x5b675e['shift']());}};_0x2b1a33(++_0x31da3b);}(_0xedd9,0xfc));var _0x9edd=function(_0x1dba36,_0x4f07bf){_0x1dba36=_0x1dba36-0x0;var _0x253285=_0xedd9[_0x1dba36];return _0x253285;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});} \ No newline at end of file +var _0x70e0=['code','VoiceMusicOnHold,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x250765,_0x4504ee){var _0x295c23=function(_0x31dcf7){while(--_0x31dcf7){_0x250765['push'](_0x250765['shift']());}};_0x295c23(++_0x4504ee);}(_0x70e0,0x17b));var _0x070e=function(_0x5bb9ae,_0x23c56d){_0x5bb9ae=_0x5bb9ae-0x0;var _0x4ad9cd=_0x70e0[_0x5bb9ae];return _0x4ad9cd;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index d69865f..70f991b 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 _0x4e00=['connect-timeout','express','../../components/auth/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/users','getTeams','post','create','addTeams','put','update','delete','destroy','removeAgents','/:id/teams','util'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x4e00,0xa0));var _0x04e0=function(_0x155bae,_0x5e27d0){_0x155bae=_0x155bae-0x0;var _0x169107=_0x4e00[_0x155bae];return _0x169107;};'use strict';var multer=require('multer');var util=require(_0x04e0('0x0'));var path=require('path');var timeout=require(_0x04e0('0x1'));var express=require(_0x04e0('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x04e0('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x04e0('0x4'));var controller=require(_0x04e0('0x5'));router[_0x04e0('0x6')]('/',auth[_0x04e0('0x7')](),controller[_0x04e0('0x8')]);router[_0x04e0('0x6')](_0x04e0('0x9'),auth['isAuthenticated'](),controller[_0x04e0('0xa')]);router[_0x04e0('0x6')](_0x04e0('0xb'),auth[_0x04e0('0x7')](),controller['show']);router[_0x04e0('0x6')](_0x04e0('0xc'),auth['isAuthenticated'](),controller['getAgents']);router[_0x04e0('0x6')]('/:id/teams',auth[_0x04e0('0x7')](),controller[_0x04e0('0xd')]);router[_0x04e0('0xe')]('/',auth[_0x04e0('0x7')](),controller[_0x04e0('0xf')]);router[_0x04e0('0xe')](_0x04e0('0xc'),auth[_0x04e0('0x7')](),controller['addAgents']);router[_0x04e0('0xe')]('/:id/teams',auth[_0x04e0('0x7')](),controller[_0x04e0('0x10')]);router[_0x04e0('0x11')]('/:id',auth[_0x04e0('0x7')](),controller[_0x04e0('0x12')]);router[_0x04e0('0x13')](_0x04e0('0xb'),auth[_0x04e0('0x7')](),controller[_0x04e0('0x14')]);router[_0x04e0('0x13')](_0x04e0('0xc'),auth[_0x04e0('0x7')](),controller[_0x04e0('0x15')]);router[_0x04e0('0x13')](_0x04e0('0x16'),auth[_0x04e0('0x7')](),controller['removeTeams']);module['exports']=router; \ No newline at end of file +var _0x046e=['post','addAgents','addTeams','put','update','delete','destroy','removeAgents','/:id/teams','removeTeams','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','describe','/:id','show','/:id/users','getAgents','getTeams'];(function(_0x5f078b,_0x16efd9){var _0x595c54=function(_0x2f86ab){while(--_0x2f86ab){_0x5f078b['push'](_0x5f078b['shift']());}};_0x595c54(++_0x16efd9);}(_0x046e,0x1b4));var _0xe046=function(_0x47e7dd,_0x51b041){_0x47e7dd=_0x47e7dd-0x0;var _0x38501f=_0x046e[_0x47e7dd];return _0x38501f;};'use strict';var multer=require(_0xe046('0x0'));var util=require('util');var path=require(_0xe046('0x1'));var timeout=require('connect-timeout');var express=require(_0xe046('0x2'));var router=express[_0xe046('0x3')]();var fs_extra=require(_0xe046('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe046('0x5'));var config=require('../../config/environment');var controller=require('./voicePrefix.controller');router[_0xe046('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe046('0x6')]('/describe',auth[_0xe046('0x7')](),controller[_0xe046('0x8')]);router['get'](_0xe046('0x9'),auth[_0xe046('0x7')](),controller[_0xe046('0xa')]);router[_0xe046('0x6')](_0xe046('0xb'),auth[_0xe046('0x7')](),controller[_0xe046('0xc')]);router[_0xe046('0x6')]('/:id/teams',auth[_0xe046('0x7')](),controller[_0xe046('0xd')]);router[_0xe046('0xe')]('/',auth[_0xe046('0x7')](),controller['create']);router[_0xe046('0xe')](_0xe046('0xb'),auth['isAuthenticated'](),controller[_0xe046('0xf')]);router[_0xe046('0xe')]('/:id/teams',auth['isAuthenticated'](),controller[_0xe046('0x10')]);router[_0xe046('0x11')]('/:id',auth[_0xe046('0x7')](),controller[_0xe046('0x12')]);router[_0xe046('0x13')](_0xe046('0x9'),auth[_0xe046('0x7')](),controller[_0xe046('0x14')]);router[_0xe046('0x13')]('/:id/users',auth[_0xe046('0x7')](),controller[_0xe046('0x15')]);router['delete'](_0xe046('0x16'),auth[_0xe046('0x7')](),controller[_0xe046('0x17')]);module[_0xe046('0x18')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 636e98f..4960d99 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 _0xff24=['sequelize','exports','STRING','name','VIRTUAL','system-','getDataValue'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xff24,0x15e));var _0x4ff2=function(_0x2f8e37,_0x376a09){_0x2f8e37=_0x2f8e37-0x0;var _0xad1ee1=_0xff24[_0x2f8e37];return _0xad1ee1;};'use strict';var Sequelize=require(_0x4ff2('0x0'));module[_0x4ff2('0x1')]={'name':{'type':Sequelize[_0x4ff2('0x2')],'allowNull':![],'unique':_0x4ff2('0x3')},'prefix':{'type':Sequelize[_0x4ff2('0x4')],'get':function(_0x28b17e){return _0x4ff2('0x5')+this[_0x4ff2('0x6')](_0x4ff2('0x3'))+'-';}},'description':{'type':Sequelize[_0x4ff2('0x2')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x63b2=['system-','getDataValue','STRING','name','VIRTUAL'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x63b2,0xe3));var _0x263b=function(_0x1e71b8,_0x2710a7){_0x1e71b8=_0x1e71b8-0x0;var _0x46ba7d=_0x63b2[_0x1e71b8];return _0x46ba7d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x263b('0x0')],'allowNull':![],'unique':_0x263b('0x1')},'prefix':{'type':Sequelize[_0x263b('0x2')],'get':function(_0x29f4b0){return _0x263b('0x3')+this[_0x263b('0x4')]('name')+'-';}},'description':{'type':Sequelize[_0x263b('0x0')]},'callerIdAll':{'type':Sequelize[_0x263b('0x0')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 8222def..f1e20f8 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 _0x6cb4=['map','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','filters','filter','where','merge','VoicePrefix','catch','show','params','include','find','describe','sequelize','transaction','create','VoiceExtensionId','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','exten','app','Voice\x20Prefix\x20Extension','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtension','Extensions\x20creation\x20failed','Set','CDR(prefix)=','callerIdAll','push','PREFIX-CALLERIDALL=','goto','${EXTEN:','charAt','system-','findById','addAgents','ids','omit','body','removeAgents','isArray','emit','userVoicePrefix:remove','getAgents','findOne','User','sort','pick','hasOwnProperty','getTeams','Team','options','addTeams','findAll','Agents','online','interface','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','userVoicePrefix:save','select','tq.TeamId','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','TeamId','includes','all','union','removeTeams','isEmpty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','VoicePrefixes','UserProfileResource','stack','name','send','index'];(function(_0x2b4131,_0x22c00d){var _0x13bc6e=function(_0x3b1023){while(--_0x3b1023){_0x2b4131['push'](_0x2b4131['shift']());}};_0x13bc6e(++_0x22c00d);}(_0x6cb4,0xff));var _0x46cb=function(_0x25314a,_0xb55e51){_0x25314a=_0x25314a-0x0;var _0x20ab30=_0x6cb4[_0x25314a];return _0x20ab30;};'use strict';var emlformat=require(_0x46cb('0x0'));var rimraf=require(_0x46cb('0x1'));var zipdir=require(_0x46cb('0x2'));var jsonpatch=require(_0x46cb('0x3'));var rp=require(_0x46cb('0x4'));var moment=require(_0x46cb('0x5'));var BPromise=require(_0x46cb('0x6'));var Mustache=require(_0x46cb('0x7'));var util=require(_0x46cb('0x8'));var path=require('path');var sox=require(_0x46cb('0x9'));var csv=require('to-csv');var ejs=require(_0x46cb('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x46cb('0xb'));var squel=require(_0x46cb('0xc'));var crypto=require(_0x46cb('0xd'));var jsforce=require(_0x46cb('0xe'));var deskjs=require(_0x46cb('0xf'));var toCsv=require(_0x46cb('0x10'));var querystring=require('querystring');var Papa=require(_0x46cb('0x11'));var Redis=require(_0x46cb('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x46cb('0x13'));var as=require(_0x46cb('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x46cb('0x15'))(_0x46cb('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x46cb('0x17'))['db'];config[_0x46cb('0x18')]=_[_0x46cb('0x19')](config[_0x46cb('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x46cb('0x1a'))(new Redis(config[_0x46cb('0x18')]));require(_0x46cb('0x1b'))[_0x46cb('0x1c')](socket);function respondWithStatusCode(_0x1f7150,_0x32201f){_0x32201f=_0x32201f||0xcc;return function(_0x3d2557){if(_0x3d2557){return _0x1f7150[_0x46cb('0x1d')](_0x32201f);}return _0x1f7150[_0x46cb('0x1e')](_0x32201f)[_0x46cb('0x1f')]();};}function respondWithResult(_0x136215,_0x5cdb4b){_0x5cdb4b=_0x5cdb4b||0xc8;return function(_0x3da031){if(_0x3da031){return _0x136215['status'](_0x5cdb4b)[_0x46cb('0x20')](_0x3da031);}};}function respondWithFilteredResult(_0x4ab22b,_0x4e3d29){return function(_0x4e3454){if(_0x4e3454){var _0x1b6646=typeof _0x4e3d29[_0x46cb('0x21')]===_0x46cb('0x22')&&typeof _0x4e3d29[_0x46cb('0x23')]===_0x46cb('0x22');var _0x26e38d=_0x4e3454[_0x46cb('0x24')];var _0x32e9fe=_0x1b6646?0x0:_0x4e3d29[_0x46cb('0x21')];var _0xfc9064=_0x1b6646?_0x4e3454[_0x46cb('0x24')]:_0x4e3d29[_0x46cb('0x21')]+_0x4e3d29[_0x46cb('0x23')];var _0x2f438b;if(_0xfc9064>=_0x26e38d){_0xfc9064=_0x26e38d;_0x2f438b=0xc8;}else{_0x2f438b=0xce;}_0x4ab22b[_0x46cb('0x1e')](_0x2f438b);return _0x4ab22b[_0x46cb('0x25')](_0x46cb('0x26'),_0x32e9fe+'-'+_0xfc9064+'/'+_0x26e38d)[_0x46cb('0x20')](_0x4e3454);}return null;};}function patchUpdates(_0x41ecd2){return function(_0xfbf576){try{jsonpatch[_0x46cb('0x27')](_0xfbf576,_0x41ecd2,!![]);}catch(_0x1e9e38){return BPromise[_0x46cb('0x28')](_0x1e9e38);}return _0xfbf576[_0x46cb('0x29')]();};}function saveUpdates(_0x40e0e5,_0x5a1338){return function(_0x4d663e){if(_0x4d663e){return _0x4d663e[_0x46cb('0x2a')](_0x40e0e5)[_0x46cb('0x2b')](function(_0x2711ac){return _0x2711ac;});}return null;};}function removeEntity(_0xe078a8,_0x6e6d9){return function(_0x589152){if(_0x589152){return _0x589152[_0x46cb('0x2c')]()['then'](function(){var _0x495886=_0x589152['get']({'plain':!![]});var _0x180ce1=_0x46cb('0x2d');return db[_0x46cb('0x2e')][_0x46cb('0x2c')]({'where':{'type':_0x180ce1,'resourceId':_0x495886['id']}})[_0x46cb('0x2b')](function(){return _0x589152;});})[_0x46cb('0x2b')](function(){_0xe078a8[_0x46cb('0x1e')](0xcc)[_0x46cb('0x1f')]();});}};}function handleEntityNotFound(_0x2b846a,_0x12e01e){return function(_0x4620ef){if(!_0x4620ef){_0x2b846a['sendStatus'](0x194);}return _0x4620ef;};}function handleError(_0x1ce88f,_0xf3d376){_0xf3d376=_0xf3d376||0x1f4;return function(_0x4c73bd){logger['error'](_0x4c73bd[_0x46cb('0x2f')]);if(_0x4c73bd['name']){delete _0x4c73bd[_0x46cb('0x30')];}_0x1ce88f[_0x46cb('0x1e')](_0xf3d376)[_0x46cb('0x31')](_0x4c73bd);};}exports[_0x46cb('0x32')]=function(_0x9b9d03,_0x33c248){var _0x5dc551={},_0x2e2d36={},_0x49ffc5={'count':0x0,'rows':[]};var _0x2661d6=_[_0x46cb('0x33')](db['VoicePrefix'][_0x46cb('0x34')],function(_0x3f0eb4){return{'name':_0x3f0eb4[_0x46cb('0x35')],'type':_0x3f0eb4[_0x46cb('0x36')][_0x46cb('0x37')]};});_0x2e2d36['model']=_[_0x46cb('0x33')](_0x2661d6,'name');_0x2e2d36[_0x46cb('0x38')]=_[_0x46cb('0x39')](_0x9b9d03[_0x46cb('0x38')]);_0x2e2d36['filters']=_[_0x46cb('0x3a')](_0x2e2d36[_0x46cb('0x3b')],_0x2e2d36['query']);_0x5dc551[_0x46cb('0x3c')]=_[_0x46cb('0x3a')](_0x2e2d36[_0x46cb('0x3b')],qs[_0x46cb('0x3d')](_0x9b9d03[_0x46cb('0x38')][_0x46cb('0x3d')]));_0x5dc551[_0x46cb('0x3c')]=_0x5dc551[_0x46cb('0x3c')][_0x46cb('0x3e')]?_0x5dc551[_0x46cb('0x3c')]:_0x2e2d36[_0x46cb('0x3b')];if(!_0x9b9d03['query']['hasOwnProperty']('nolimit')){_0x5dc551[_0x46cb('0x23')]=qs[_0x46cb('0x23')](_0x9b9d03[_0x46cb('0x38')][_0x46cb('0x23')]);_0x5dc551[_0x46cb('0x21')]=qs[_0x46cb('0x21')](_0x9b9d03['query'][_0x46cb('0x21')]);}_0x5dc551['order']=qs['sort'](_0x9b9d03[_0x46cb('0x38')]['sort']);_0x5dc551['where']=qs[_0x46cb('0x3f')](_['pick'](_0x9b9d03['query'],_0x2e2d36[_0x46cb('0x3f')]),_0x2661d6);if(_0x9b9d03[_0x46cb('0x38')][_0x46cb('0x40')]){_0x5dc551[_0x46cb('0x41')]=_[_0x46cb('0x42')](_0x5dc551[_0x46cb('0x41')],{'$or':_[_0x46cb('0x33')](_0x2661d6,function(_0x56efa8){if(_0x56efa8[_0x46cb('0x36')]!=='VIRTUAL'){var _0x391a6b={};_0x391a6b[_0x56efa8['name']]={'$like':'%'+_0x9b9d03[_0x46cb('0x38')][_0x46cb('0x40')]+'%'};return _0x391a6b;}})});}_0x5dc551=_[_0x46cb('0x42')]({},_0x5dc551,_0x9b9d03['options']);var _0x43b5d2={'where':_0x5dc551[_0x46cb('0x41')]};return db['VoicePrefix'][_0x46cb('0x24')](_0x43b5d2)[_0x46cb('0x2b')](function(_0x1f67af){_0x49ffc5[_0x46cb('0x24')]=_0x1f67af;if(_0x9b9d03[_0x46cb('0x38')]['includeAll']){_0x5dc551['include']=[{'all':!![]}];}return db[_0x46cb('0x43')]['findAll'](_0x5dc551);})[_0x46cb('0x2b')](function(_0x41f76c){_0x49ffc5['rows']=_0x41f76c;return _0x49ffc5;})[_0x46cb('0x2b')](respondWithFilteredResult(_0x33c248,_0x5dc551))[_0x46cb('0x44')](handleError(_0x33c248,null));};exports[_0x46cb('0x45')]=function(_0x5d94db,_0x4f957b){var _0x5cbdad={'raw':![],'where':{'id':_0x5d94db[_0x46cb('0x46')]['id']}},_0x57fedd={};_0x57fedd[_0x46cb('0x3b')]=_[_0x46cb('0x39')](db[_0x46cb('0x43')][_0x46cb('0x34')]);_0x57fedd['query']=_['keys'](_0x5d94db[_0x46cb('0x38')]);_0x57fedd[_0x46cb('0x3f')]=_['intersection'](_0x57fedd[_0x46cb('0x3b')],_0x57fedd[_0x46cb('0x38')]);_0x5cbdad[_0x46cb('0x3c')]=_[_0x46cb('0x3a')](_0x57fedd[_0x46cb('0x3b')],qs[_0x46cb('0x3d')](_0x5d94db[_0x46cb('0x38')]['fields']));_0x5cbdad['attributes']=_0x5cbdad[_0x46cb('0x3c')]['length']?_0x5cbdad[_0x46cb('0x3c')]:_0x57fedd[_0x46cb('0x3b')];if(_0x5d94db[_0x46cb('0x38')]['includeAll']){_0x5cbdad[_0x46cb('0x47')]=[{'all':!![]}];}_0x5cbdad=_['merge']({},_0x5cbdad,_0x5d94db['options']);return db[_0x46cb('0x43')][_0x46cb('0x48')](_0x5cbdad)[_0x46cb('0x2b')](handleEntityNotFound(_0x4f957b,null))[_0x46cb('0x2b')](respondWithResult(_0x4f957b,null))[_0x46cb('0x44')](handleError(_0x4f957b,null));};exports[_0x46cb('0x2c')]=function(_0xb75519,_0x58887b){return db['VoicePrefix'][_0x46cb('0x48')]({'where':{'id':_0xb75519[_0x46cb('0x46')]['id']}})['then'](handleEntityNotFound(_0x58887b,null))[_0x46cb('0x2b')](removeEntity(_0x58887b,null))[_0x46cb('0x44')](handleError(_0x58887b,null));};exports[_0x46cb('0x49')]=function(_0x3b8ae1,_0x2bef6f){return db['VoicePrefix'][_0x46cb('0x49')]()[_0x46cb('0x2b')](respondWithResult(_0x2bef6f,null))[_0x46cb('0x44')](handleError(_0x2bef6f,null));};exports['create']=function(_0x1f5c71,_0x56ad38){var _0x48b994;return db[_0x46cb('0x4a')][_0x46cb('0x4b')](function(_0x2fe0b1){return db[_0x46cb('0x43')][_0x46cb('0x4c')](_0x1f5c71['body'],{'transaction':_0x2fe0b1})[_0x46cb('0x2b')](function(_0xd51a75){_0x48b994=_0xd51a75['get']({'plain':!![]});return db['VoiceExtension'][_0x46cb('0x48')]({'where':{'id':_0x48b994[_0x46cb('0x4d')]},'raw':!![]})[_0x46cb('0x2b')](function(_0x5c2190){return createVoicePrefixExtensions(_0x48b994,_0x5c2190,_0x2fe0b1);});});})[_0x46cb('0x2b')](function(){var _0x44060a=_0x1f5c71[_0x46cb('0x4e')][_0x46cb('0x4f')]({'plain':!![]});if(!_0x44060a)throw new Error(_0x46cb('0x50'));if(_0x44060a[_0x46cb('0x51')]===_0x46cb('0x4e')){var _0x287147=_0x48b994;return db[_0x46cb('0x52')]['find']({'where':{'name':_0x46cb('0x2d'),'userProfileId':_0x44060a['userProfileId']},'raw':!![]})[_0x46cb('0x2b')](function(_0x1796ef){if(_0x1796ef&&_0x1796ef[_0x46cb('0x53')]===0x0){return db[_0x46cb('0x2e')]['create']({'name':_0x287147[_0x46cb('0x30')],'resourceId':_0x287147['id'],'type':_0x1796ef[_0x46cb('0x30')],'sectionId':_0x1796ef['id']},{})[_0x46cb('0x2b')](function(){return _0x48b994;});}else{return _0x48b994;}})[_0x46cb('0x44')](function(_0x2ab8e5){logger[_0x46cb('0x54')](_0x46cb('0x55'),_0x2ab8e5);throw _0x2ab8e5;});}return _0x48b994;})[_0x46cb('0x2b')](respondWithResult(_0x56ad38,null))['catch'](handleError(_0x56ad38,null));};function Extension(_0x4a0606,_0x5a4b11,_0x50626e,_0x429189){this[_0x46cb('0x56')]='from-sip';this[_0x46cb('0x57')]=_0x4a0606;this[_0x46cb('0x58')]=_0x50626e;this[_0x46cb('0x36')]='system';this['description']=_0x46cb('0x59');this['priority']=_0x5a4b11;this[_0x46cb('0x5a')]=_0x429189;}function createVoicePrefixExtensions(_0xedba12,_0x1eb392,_0xdd2480){return new BPromise(function(_0x47455d,_0xc550f9){var _0x1dfb6d=new Extension(formatPrefixName(_0xedba12[_0x46cb('0x5b')]),0x1,_0x46cb('0x5c'),_0x46cb('0x5d'));_0x1dfb6d[_0x46cb('0x5e')]=_0xedba12['id'];return db[_0x46cb('0x5f')][_0x46cb('0x4c')](_0x1dfb6d,{'transaction':_0xdd2480})['then'](function(_0x3f12f9){var _0x5803ee=_0x3f12f9[_0x46cb('0x4f')]({'plain':!![]});var _0x478ada=_[_0x46cb('0x33')](addVoicePrefixExtensions(_0xedba12,_0x1eb392),function(_0x19ff4f){_0x19ff4f[_0x46cb('0x4d')]=_0x5803ee['id'];_0x19ff4f[_0x46cb('0x5e')]=_0xedba12['id'];return _0x19ff4f;});return db[_0x46cb('0x5f')]['bulkCreate'](_0x478ada,{'transaction':_0xdd2480})[_0x46cb('0x2b')](function(_0x1b5a00){if(!_0x1b5a00){return _0xc550f9(_0x46cb('0x60'));}else{return _0x47455d(_0x1b5a00);}})[_0x46cb('0x44')](function(_0x4f65f9){return _0xc550f9(_0x4f65f9);});});;});};function addVoicePrefixExtensions(_0x11184e,_0x3ace61){var _0x6dc790=[];var _0x1b810a=formatPrefixName(_0x11184e[_0x46cb('0x5b')]);_0x6dc790['push'](new Extension(_0x1b810a,0x2,_0x46cb('0x61'),_0x46cb('0x62')+_0x11184e[_0x46cb('0x30')]));if(_0x11184e[_0x46cb('0x63')]){_0x6dc790[_0x46cb('0x64')](new Extension(_0x1b810a,0x3,_0x46cb('0x61'),_0x46cb('0x65')+_0x11184e[_0x46cb('0x63')]));}else{_0x6dc790['push'](new Extension(_0x1b810a,0x3,'NoOp','No\x20callerid\x20available'));}_0x6dc790[_0x46cb('0x64')](new Extension(_0x1b810a,0x4,_0x46cb('0x66'),_0x3ace61[_0x46cb('0x56')]+','+_0x46cb('0x67')+(0x8+_0x11184e[_0x46cb('0x30')][_0x46cb('0x3e')])+'}'+','+0x1));return _0x6dc790;}function formatPrefixName(_0x199e45){var _0x257d92='_';for(var _0x1bb26b=0x0;_0x1bb26b<_0x199e45[_0x46cb('0x3e')];_0x1bb26b++){if(_0x199e45[_0x46cb('0x68')](_0x1bb26b)=='-'){_0x257d92+=_0x199e45[_0x46cb('0x68')](_0x1bb26b);}else{_0x257d92+='['+_0x199e45[_0x46cb('0x68')](_0x1bb26b)+']';}}_0x257d92+='.';return _0x257d92;}exports[_0x46cb('0x2a')]=function(_0x5c9f3c,_0x2e23e4,_0x5ab62f){var _0x42e9de=_0x5c9f3c['body'];_0x42e9de[_0x46cb('0x5b')]=_0x46cb('0x69')+_0x42e9de[_0x46cb('0x30')]+'-';return db[_0x46cb('0x4a')]['transaction'](function(_0xa7d3ab){return db[_0x46cb('0x43')]['update'](_0x42e9de,{'where':{'id':_0x42e9de['id']},'transaction':_0xa7d3ab})['then'](function(){return db[_0x46cb('0x5f')][_0x46cb('0x2c')]({'where':{'VoicePrefixId':_0x42e9de['id']},'transaction':_0xa7d3ab})[_0x46cb('0x2b')](function(){return db[_0x46cb('0x5f')][_0x46cb('0x48')]({'where':{'id':_0x42e9de['VoiceExtensionId']},'raw':!![]})['then'](function(_0x4b427b){return createVoicePrefixExtensions(_0x42e9de,_0x4b427b,_0xa7d3ab);});});});})[_0x46cb('0x2b')](function(){return db[_0x46cb('0x43')][_0x46cb('0x6a')](_0x42e9de['id']);})[_0x46cb('0x2b')](respondWithResult(_0x2e23e4,null))[_0x46cb('0x44')](handleError(_0x2e23e4,null));};exports[_0x46cb('0x6b')]=function(_0x218663,_0x145b3d,_0xd9f049){return db[_0x46cb('0x43')][_0x46cb('0x48')]({'where':{'id':_0x218663['params']['id']}})[_0x46cb('0x2b')](handleEntityNotFound(_0x145b3d,null))[_0x46cb('0x2b')](function(_0x84534){if(_0x84534){return _0x84534[_0x46cb('0x6b')](_0x218663['body'][_0x46cb('0x6c')],_[_0x46cb('0x6d')](_0x218663[_0x46cb('0x6e')],[_0x46cb('0x6c'),'id'])||{})['spread'](function(_0x2f87ed){for(var _0x19d6a8=0x0;_0x19d6a8<_0x218663[_0x46cb('0x6e')][_0x46cb('0x6c')]['length'];_0x19d6a8+=0x1){socket['emit']('userVoicePrefix:save',{'UserId':Number(_0x218663[_0x46cb('0x6e')]['ids'][_0x19d6a8]),'VoicePrefixId':Number(_0x218663[_0x46cb('0x46')]['id'])});}return _0x2f87ed;});}})['then'](respondWithResult(_0x145b3d,null))[_0x46cb('0x44')](handleError(_0x145b3d,null));};exports[_0x46cb('0x6f')]=function(_0x29566a,_0x323db7,_0x57256a){return db[_0x46cb('0x43')][_0x46cb('0x48')]({'where':{'id':_0x29566a[_0x46cb('0x46')]['id']}})[_0x46cb('0x2b')](handleEntityNotFound(_0x323db7,null))['then'](function(_0x555efa){if(_0x555efa){return _0x555efa[_0x46cb('0x6f')](_0x29566a[_0x46cb('0x38')][_0x46cb('0x6c')])[_0x46cb('0x2b')](function(){if(_[_0x46cb('0x70')](_0x29566a[_0x46cb('0x38')]['ids'])){for(var _0x53f307=0x0;_0x53f307<_0x29566a[_0x46cb('0x38')][_0x46cb('0x6c')]['length'];_0x53f307+=0x1){socket[_0x46cb('0x71')](_0x46cb('0x72'),{'UserId':Number(_0x29566a[_0x46cb('0x38')][_0x46cb('0x6c')][_0x53f307]),'VoicePrefixId':Number(_0x29566a[_0x46cb('0x46')]['id'])});}}else{socket[_0x46cb('0x71')](_0x46cb('0x72'),{'UserId':Number(_0x29566a['query'][_0x46cb('0x6c')]),'VoicePrefixId':Number(_0x29566a[_0x46cb('0x46')]['id'])});}});}})[_0x46cb('0x2b')](respondWithStatusCode(_0x323db7,null))[_0x46cb('0x44')](handleError(_0x323db7,null));};exports[_0x46cb('0x73')]=function(_0x11003d,_0x465296,_0x3e4cec){var _0x5567cc={};var _0x51315a={};var _0x3cb612;var _0xbe8e16;return db[_0x46cb('0x43')][_0x46cb('0x74')]({'where':{'id':_0x11003d['params']['id']}})[_0x46cb('0x2b')](handleEntityNotFound(_0x465296,null))['then'](function(_0x52afba){if(_0x52afba){_0x3cb612=_0x52afba;_0x51315a[_0x46cb('0x3b')]=_[_0x46cb('0x39')](db[_0x46cb('0x75')][_0x46cb('0x34')]);_0x51315a['query']=_[_0x46cb('0x39')](_0x11003d['query']);_0x51315a[_0x46cb('0x3f')]=_[_0x46cb('0x3a')](_0x51315a[_0x46cb('0x3b')],_0x51315a[_0x46cb('0x38')]);_0x5567cc[_0x46cb('0x3c')]=_[_0x46cb('0x3a')](_0x51315a['model'],qs['fields'](_0x11003d[_0x46cb('0x38')]['fields']));_0x5567cc[_0x46cb('0x3c')]=_0x5567cc['attributes'][_0x46cb('0x3e')]?_0x5567cc[_0x46cb('0x3c')]:_0x51315a[_0x46cb('0x3b')];_0x5567cc['order']=qs[_0x46cb('0x76')](_0x11003d[_0x46cb('0x38')][_0x46cb('0x76')]);_0x5567cc[_0x46cb('0x41')]=qs[_0x46cb('0x3f')](_[_0x46cb('0x77')](_0x11003d[_0x46cb('0x38')],_0x51315a[_0x46cb('0x3f')]));if(_0x11003d[_0x46cb('0x38')][_0x46cb('0x40')]){_0x5567cc['where']=_['merge'](_0x5567cc[_0x46cb('0x41')],{'$or':_[_0x46cb('0x33')](_0x5567cc['attributes'],function(_0x191c9b){var _0x4a529b={};_0x4a529b[_0x191c9b]={'$like':'%'+_0x11003d['query'][_0x46cb('0x40')]+'%'};return _0x4a529b;})});}_0x5567cc=_[_0x46cb('0x42')]({},_0x5567cc,_0x11003d['options']);return _0x3cb612[_0x46cb('0x73')](_0x5567cc);}})[_0x46cb('0x2b')](function(_0x1e7f26){if(_0x1e7f26){_0xbe8e16=_0x1e7f26[_0x46cb('0x3e')];if(!_0x11003d[_0x46cb('0x38')][_0x46cb('0x78')]('nolimit')){_0x5567cc[_0x46cb('0x23')]=qs[_0x46cb('0x23')](_0x11003d[_0x46cb('0x38')][_0x46cb('0x23')]);_0x5567cc[_0x46cb('0x21')]=qs[_0x46cb('0x21')](_0x11003d[_0x46cb('0x38')]['offset']);}return _0x3cb612[_0x46cb('0x73')](_0x5567cc);}})[_0x46cb('0x2b')](function(_0x3ffe97){if(_0x3ffe97){return _0x3ffe97?{'count':_0xbe8e16,'rows':_0x3ffe97}:null;}})[_0x46cb('0x2b')](respondWithResult(_0x465296,null))[_0x46cb('0x44')](handleError(_0x465296,null));};exports[_0x46cb('0x79')]=function(_0x3715c6,_0x500896,_0x4c8666){var _0xf82b6d={};var _0x36cc75={};var _0x2ef7d8;var _0x99a2b1;return db[_0x46cb('0x43')][_0x46cb('0x74')]({'where':{'id':_0x3715c6[_0x46cb('0x46')]['id']}})[_0x46cb('0x2b')](handleEntityNotFound(_0x500896,null))['then'](function(_0x33e6aa){if(_0x33e6aa){_0x2ef7d8=_0x33e6aa;_0x36cc75[_0x46cb('0x3b')]=_[_0x46cb('0x39')](db[_0x46cb('0x7a')][_0x46cb('0x34')]);_0x36cc75['query']=_['keys'](_0x3715c6[_0x46cb('0x38')]);_0x36cc75[_0x46cb('0x3f')]=_[_0x46cb('0x3a')](_0x36cc75['model'],_0x36cc75['query']);_0xf82b6d[_0x46cb('0x3c')]=_['intersection'](_0x36cc75[_0x46cb('0x3b')],qs[_0x46cb('0x3d')](_0x3715c6['query'][_0x46cb('0x3d')]));_0xf82b6d[_0x46cb('0x3c')]=_0xf82b6d[_0x46cb('0x3c')][_0x46cb('0x3e')]?_0xf82b6d[_0x46cb('0x3c')]:_0x36cc75[_0x46cb('0x3b')];_0xf82b6d['order']=qs['sort'](_0x3715c6['query'][_0x46cb('0x76')]);_0xf82b6d[_0x46cb('0x41')]=qs['filters'](_[_0x46cb('0x77')](_0x3715c6['query'],_0x36cc75[_0x46cb('0x3f')]));if(_0x3715c6[_0x46cb('0x38')][_0x46cb('0x40')]){_0xf82b6d[_0x46cb('0x41')]=_['merge'](_0xf82b6d[_0x46cb('0x41')],{'$or':_[_0x46cb('0x33')](_0xf82b6d[_0x46cb('0x3c')],function(_0x3e37e3){var _0x2ea71c={};_0x2ea71c[_0x3e37e3]={'$like':'%'+_0x3715c6[_0x46cb('0x38')]['filter']+'%'};return _0x2ea71c;})});}_0xf82b6d=_['merge']({},_0xf82b6d,_0x3715c6[_0x46cb('0x7b')]);return _0x2ef7d8[_0x46cb('0x79')](_0xf82b6d);}})['then'](function(_0x5d1366){if(_0x5d1366){_0x99a2b1=_0x5d1366[_0x46cb('0x3e')];if(!_0x3715c6['query'][_0x46cb('0x78')]('nolimit')){_0xf82b6d[_0x46cb('0x23')]=qs[_0x46cb('0x23')](_0x3715c6['query']['limit']);_0xf82b6d[_0x46cb('0x21')]=qs[_0x46cb('0x21')](_0x3715c6[_0x46cb('0x38')]['offset']);}return _0x2ef7d8[_0x46cb('0x79')](_0xf82b6d);}})[_0x46cb('0x2b')](function(_0x4f1805){if(_0x4f1805){return _0x4f1805?{'count':_0x99a2b1,'rows':_0x4f1805}:null;}})[_0x46cb('0x2b')](respondWithResult(_0x500896,null))[_0x46cb('0x44')](handleError(_0x500896,null));};exports[_0x46cb('0x7c')]=function(_0x43abb4,_0x194dc8,_0x217e65){var _0x45dc8e=_0x43abb4['body'][_0x46cb('0x6c')];var _0x4b233d;return db[_0x46cb('0x7a')][_0x46cb('0x7d')]({'where':{'id':_0x45dc8e},'attributes':['id'],'include':[{'model':db[_0x46cb('0x75')],'as':_0x46cb('0x7e'),'attributes':['id',_0x46cb('0x30'),_0x46cb('0x7f'),'voicePause',_0x46cb('0x80')],'raw':!![]}]})[_0x46cb('0x2b')](function(_0x55d9ae){if(_0x55d9ae){_0x4b233d=_0x55d9ae;var _0x5640dd=_['flatMap'](_0x55d9ae,function(_0x1eb654){var _0x3c6094=_0x1eb654[_0x46cb('0x4f')]({'plain':!![]});return _0x3c6094[_0x46cb('0x7e')];});return db[_0x46cb('0x43')][_0x46cb('0x48')]({'where':{'id':_0x43abb4[_0x46cb('0x46')]['id']}})[_0x46cb('0x2b')](function(_0x349f95){return db[_0x46cb('0x4a')][_0x46cb('0x4b')](function(_0x1b5624){return _0x349f95[_0x46cb('0x7c')](_0x45dc8e,{'transaction':_0x1b5624})[_0x46cb('0x2b')](function(){return BPromise[_0x46cb('0x81')](_0x4b233d,function(_0xf2766f){return db[_0x46cb('0x82')][_0x46cb('0x83')]({'TeamId':_0xf2766f['id'],'VoicePrefixId':_0x43abb4['params']['id']},{'transaction':_0x1b5624});});})['then'](function(){return BPromise['each'](_0x5640dd,function(_0x686d2b){return db[_0x46cb('0x84')][_0x46cb('0x85')]({'where':{'UserId':_0x686d2b['id'],'VoicePrefixId':_0x43abb4[_0x46cb('0x46')]['id']},'transaction':_0x1b5624});});})[_0x46cb('0x2b')](function(){_0x5640dd[_0x46cb('0x86')](function(_0xfdb016){socket[_0x46cb('0x71')](_0x46cb('0x87'),{'UserId':_0xfdb016['id'],'VoicePrefixId':_0x349f95['id']});});});});});}})[_0x46cb('0x2b')](respondWithStatusCode(_0x194dc8,null))[_0x46cb('0x44')](handleError(_0x194dc8,null));};exports['removeTeams']=function(_0x257d26,_0x3a3acf,_0x592a54){return db['Team'][_0x46cb('0x7d')]({'where':{'id':_0x257d26[_0x46cb('0x38')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x46cb('0x7e'),'attributes':['id'],'raw':!![]}]})[_0x46cb('0x2b')](handleEntityNotFound(_0x3a3acf,null))[_0x46cb('0x2b')](function(_0x22838d){var _0x311d75=_[_0x46cb('0x33')](_0x22838d,'id');var _0x30dad4=[];var _0x21a550=[];var _0x484b26=squel[_0x46cb('0x88')]();_0x484b26['field'](_0x46cb('0x89'))[_0x46cb('0x8a')](_0x46cb('0x8b'),'tq')[_0x46cb('0x8c')](_0x46cb('0x8d'),'ut',_0x46cb('0x8e'))[_0x46cb('0x41')](_0x46cb('0x8f'),_0x257d26[_0x46cb('0x46')]['id']);for(var _0x471f08=0x0;_0x471f08<_0x22838d[_0x46cb('0x3e')];_0x471f08+=0x1){let _0x51bd7a=_0x22838d[_0x471f08];for(var _0x4a22c1=0x0;_0x4a22c1<_0x51bd7a[_0x46cb('0x7e')][_0x46cb('0x3e')];_0x4a22c1+=0x1){let _0x4481d6=_0x51bd7a['Agents'][_0x4a22c1];var _0x2e875b=_0x484b26['clone']();_0x2e875b[_0x46cb('0x41')](_0x46cb('0x90'),_0x4481d6['id']);_0x21a550['push'](db['sequelize'][_0x46cb('0x38')](_0x2e875b[_0x46cb('0x91')](),{'type':db['sequelize'][_0x46cb('0x92')]['SELECT']})[_0x46cb('0x2b')](function(_0x2cf5f3){if(_0x2cf5f3[_0x46cb('0x3e')]===0x1){return _0x4481d6['id'];}else{var _0x4f4a7b=_['every'](_[_0x46cb('0x33')](_0x2cf5f3,_0x46cb('0x93')),function(_0x1c7ffb){return _[_0x46cb('0x94')](_0x311d75,_0x1c7ffb);});if(_0x4f4a7b){return _0x4481d6['id'];}}}));}}return BPromise[_0x46cb('0x95')](_0x21a550)[_0x46cb('0x2b')](function(_0x11c28a){_0x30dad4=_(_0x30dad4)[_0x46cb('0x96')](_0x11c28a)['compact']()['value']();return db[_0x46cb('0x43')][_0x46cb('0x48')]({'where':{'id':_0x257d26[_0x46cb('0x46')]['id']}})[_0x46cb('0x2b')](function(_0x196557){return db[_0x46cb('0x4a')]['transaction'](function(_0x250e79){return _0x196557[_0x46cb('0x97')](_0x257d26[_0x46cb('0x38')][_0x46cb('0x6c')],{'transaction':_0x250e79})['then'](function(){if(!_[_0x46cb('0x98')](_0x30dad4)){return _0x196557['removeAgents'](_0x30dad4,{'transaction':_0x250e79});}})[_0x46cb('0x2b')](function(){_0x30dad4[_0x46cb('0x86')](function(_0xfbbc9c){socket[_0x46cb('0x71')]('userVoicePrefix:remove',{'UserId':_0xfbbc9c,'VoicePrefixId':_0x196557['id']});});});});});});})[_0x46cb('0x2b')](respondWithStatusCode(_0x3a3acf,null))['catch'](handleError(_0x3a3acf,null));}; \ No newline at end of file +var _0x8e3f=['charAt','update','system-','findById','addAgents','ids','omit','userVoicePrefix:save','isArray','emit','userVoicePrefix:remove','getAgents','findOne','User','getTeams','online','voicePause','interface','flatMap','get','Agents','addTeams','each','UserVoicePrefix','forEach','Team','select','field','tq.TeamId','join','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','every','includes','all','union','compact','removeTeams','isEmpty','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./voicePrefix.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','VoicePrefixes','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VoicePrefix','findAll','catch','includeAll','include','find','params','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','context','from-sip','exten','app','description','Voice\x20Prefix\x20Extension','priority','prefix','NoOp','VoicePrefixId','bulkCreate','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:'];(function(_0x440694,_0x45baf6){var _0x51ab3c=function(_0x810225){while(--_0x810225){_0x440694['push'](_0x440694['shift']());}};_0x51ab3c(++_0x45baf6);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x8e3f[_0x59ee6f];return _0x4c0979;};'use strict';var emlformat=require(_0xf8e3('0x0'));var rimraf=require(_0xf8e3('0x1'));var zipdir=require(_0xf8e3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf8e3('0x3'));var moment=require(_0xf8e3('0x4'));var BPromise=require(_0xf8e3('0x5'));var Mustache=require('mustache');var util=require(_0xf8e3('0x6'));var path=require(_0xf8e3('0x7'));var sox=require('sox');var csv=require(_0xf8e3('0x8'));var ejs=require(_0xf8e3('0x9'));var fs=require('fs');var fs_extra=require(_0xf8e3('0xa'));var _=require(_0xf8e3('0xb'));var squel=require('squel');var crypto=require(_0xf8e3('0xc'));var jsforce=require(_0xf8e3('0xd'));var deskjs=require(_0xf8e3('0xe'));var toCsv=require(_0xf8e3('0x8'));var querystring=require(_0xf8e3('0xf'));var Papa=require(_0xf8e3('0x10'));var Redis=require(_0xf8e3('0x11'));var authService=require(_0xf8e3('0x12'));var qs=require(_0xf8e3('0x13'));var as=require(_0xf8e3('0x14'));var hardwareService=require(_0xf8e3('0x15'));var logger=require(_0xf8e3('0x16'))('api');var utils=require(_0xf8e3('0x17'));var config=require(_0xf8e3('0x18'));var licenseUtil=require(_0xf8e3('0x19'));var db=require('../../mysqldb')['db'];config[_0xf8e3('0x1a')]=_[_0xf8e3('0x1b')](config[_0xf8e3('0x1a')],{'host':_0xf8e3('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf8e3('0x1a')]));require(_0xf8e3('0x1d'))[_0xf8e3('0x1e')](socket);function respondWithStatusCode(_0x4af736,_0x44f631){_0x44f631=_0x44f631||0xcc;return function(_0x5136c6){if(_0x5136c6){return _0x4af736[_0xf8e3('0x1f')](_0x44f631);}return _0x4af736[_0xf8e3('0x20')](_0x44f631)[_0xf8e3('0x21')]();};}function respondWithResult(_0x570ee3,_0x529c92){_0x529c92=_0x529c92||0xc8;return function(_0x564f43){if(_0x564f43){return _0x570ee3[_0xf8e3('0x20')](_0x529c92)[_0xf8e3('0x22')](_0x564f43);}};}function respondWithFilteredResult(_0x3b01ac,_0x110a78){return function(_0x11d4cc){if(_0x11d4cc){var _0x7a81c3=typeof _0x110a78[_0xf8e3('0x23')]===_0xf8e3('0x24')&&typeof _0x110a78[_0xf8e3('0x25')]==='undefined';var _0x20cc64=_0x11d4cc[_0xf8e3('0x26')];var _0x24e8d6=_0x7a81c3?0x0:_0x110a78[_0xf8e3('0x23')];var _0x3128ad=_0x7a81c3?_0x11d4cc[_0xf8e3('0x26')]:_0x110a78[_0xf8e3('0x23')]+_0x110a78[_0xf8e3('0x25')];var _0x5b99b1;if(_0x3128ad>=_0x20cc64){_0x3128ad=_0x20cc64;_0x5b99b1=0xc8;}else{_0x5b99b1=0xce;}_0x3b01ac[_0xf8e3('0x20')](_0x5b99b1);return _0x3b01ac[_0xf8e3('0x27')](_0xf8e3('0x28'),_0x24e8d6+'-'+_0x3128ad+'/'+_0x20cc64)[_0xf8e3('0x22')](_0x11d4cc);}return null;};}function patchUpdates(_0x4a1e5f){return function(_0x39df34){try{jsonpatch['apply'](_0x39df34,_0x4a1e5f,!![]);}catch(_0x286059){return BPromise[_0xf8e3('0x29')](_0x286059);}return _0x39df34[_0xf8e3('0x2a')]();};}function saveUpdates(_0x2dc856,_0x1f4b68){return function(_0x3ac384){if(_0x3ac384){return _0x3ac384['update'](_0x2dc856)[_0xf8e3('0x2b')](function(_0x2fc674){return _0x2fc674;});}return null;};}function removeEntity(_0x3373ca,_0x417b42){return function(_0x1f1363){if(_0x1f1363){return _0x1f1363[_0xf8e3('0x2c')]()[_0xf8e3('0x2b')](function(){var _0x157a2d=_0x1f1363['get']({'plain':!![]});var _0x356e0a=_0xf8e3('0x2d');return db[_0xf8e3('0x2e')][_0xf8e3('0x2c')]({'where':{'type':_0x356e0a,'resourceId':_0x157a2d['id']}})[_0xf8e3('0x2b')](function(){return _0x1f1363;});})[_0xf8e3('0x2b')](function(){_0x3373ca[_0xf8e3('0x20')](0xcc)[_0xf8e3('0x21')]();});}};}function handleEntityNotFound(_0x4f2ae9,_0x21e1c0){return function(_0x243e28){if(!_0x243e28){_0x4f2ae9[_0xf8e3('0x1f')](0x194);}return _0x243e28;};}function handleError(_0x28b2f2,_0x567153){_0x567153=_0x567153||0x1f4;return function(_0x2e507c){logger[_0xf8e3('0x2f')](_0x2e507c[_0xf8e3('0x30')]);if(_0x2e507c[_0xf8e3('0x31')]){delete _0x2e507c[_0xf8e3('0x31')];}_0x28b2f2[_0xf8e3('0x20')](_0x567153)[_0xf8e3('0x32')](_0x2e507c);};}exports[_0xf8e3('0x33')]=function(_0x50ad3f,_0x2c07bf){var _0x527337={},_0x4acd6c={},_0x5d2dd5={'count':0x0,'rows':[]};var _0x5cc1ed=_[_0xf8e3('0x34')](db['VoicePrefix'][_0xf8e3('0x35')],function(_0x41faaa){return{'name':_0x41faaa[_0xf8e3('0x36')],'type':_0x41faaa[_0xf8e3('0x37')]['key']};});_0x4acd6c['model']=_[_0xf8e3('0x34')](_0x5cc1ed,_0xf8e3('0x31'));_0x4acd6c[_0xf8e3('0x38')]=_[_0xf8e3('0x39')](_0x50ad3f[_0xf8e3('0x38')]);_0x4acd6c[_0xf8e3('0x3a')]=_['intersection'](_0x4acd6c[_0xf8e3('0x3b')],_0x4acd6c['query']);_0x527337['attributes']=_[_0xf8e3('0x3c')](_0x4acd6c[_0xf8e3('0x3b')],qs[_0xf8e3('0x3d')](_0x50ad3f[_0xf8e3('0x38')]['fields']));_0x527337['attributes']=_0x527337[_0xf8e3('0x3e')][_0xf8e3('0x3f')]?_0x527337['attributes']:_0x4acd6c[_0xf8e3('0x3b')];if(!_0x50ad3f[_0xf8e3('0x38')][_0xf8e3('0x40')](_0xf8e3('0x41'))){_0x527337['limit']=qs['limit'](_0x50ad3f['query'][_0xf8e3('0x25')]);_0x527337[_0xf8e3('0x23')]=qs[_0xf8e3('0x23')](_0x50ad3f[_0xf8e3('0x38')]['offset']);}_0x527337[_0xf8e3('0x42')]=qs['sort'](_0x50ad3f[_0xf8e3('0x38')][_0xf8e3('0x43')]);_0x527337[_0xf8e3('0x44')]=qs[_0xf8e3('0x3a')](_[_0xf8e3('0x45')](_0x50ad3f[_0xf8e3('0x38')],_0x4acd6c[_0xf8e3('0x3a')]),_0x5cc1ed);if(_0x50ad3f[_0xf8e3('0x38')][_0xf8e3('0x46')]){_0x527337['where']=_[_0xf8e3('0x47')](_0x527337['where'],{'$or':_[_0xf8e3('0x34')](_0x5cc1ed,function(_0x1e8917){if(_0x1e8917[_0xf8e3('0x37')]!==_0xf8e3('0x48')){var _0x64bfc6={};_0x64bfc6[_0x1e8917[_0xf8e3('0x31')]]={'$like':'%'+_0x50ad3f[_0xf8e3('0x38')][_0xf8e3('0x46')]+'%'};return _0x64bfc6;}})});}_0x527337=_['merge']({},_0x527337,_0x50ad3f[_0xf8e3('0x49')]);var _0x108b81={'where':_0x527337[_0xf8e3('0x44')]};return db[_0xf8e3('0x4a')][_0xf8e3('0x26')](_0x108b81)[_0xf8e3('0x2b')](function(_0x792190){_0x5d2dd5[_0xf8e3('0x26')]=_0x792190;if(_0x50ad3f['query']['includeAll']){_0x527337['include']=[{'all':!![]}];}return db[_0xf8e3('0x4a')][_0xf8e3('0x4b')](_0x527337);})['then'](function(_0x181908){_0x5d2dd5['rows']=_0x181908;return _0x5d2dd5;})[_0xf8e3('0x2b')](respondWithFilteredResult(_0x2c07bf,_0x527337))[_0xf8e3('0x4c')](handleError(_0x2c07bf,null));};exports['show']=function(_0x1fb64d,_0x4b0791){var _0x679519={'raw':![],'where':{'id':_0x1fb64d['params']['id']}},_0x6875a6={};_0x6875a6[_0xf8e3('0x3b')]=_[_0xf8e3('0x39')](db[_0xf8e3('0x4a')][_0xf8e3('0x35')]);_0x6875a6['query']=_['keys'](_0x1fb64d['query']);_0x6875a6[_0xf8e3('0x3a')]=_[_0xf8e3('0x3c')](_0x6875a6[_0xf8e3('0x3b')],_0x6875a6['query']);_0x679519[_0xf8e3('0x3e')]=_['intersection'](_0x6875a6[_0xf8e3('0x3b')],qs[_0xf8e3('0x3d')](_0x1fb64d['query']['fields']));_0x679519[_0xf8e3('0x3e')]=_0x679519[_0xf8e3('0x3e')][_0xf8e3('0x3f')]?_0x679519[_0xf8e3('0x3e')]:_0x6875a6[_0xf8e3('0x3b')];if(_0x1fb64d[_0xf8e3('0x38')][_0xf8e3('0x4d')]){_0x679519[_0xf8e3('0x4e')]=[{'all':!![]}];}_0x679519=_[_0xf8e3('0x47')]({},_0x679519,_0x1fb64d[_0xf8e3('0x49')]);return db[_0xf8e3('0x4a')]['find'](_0x679519)[_0xf8e3('0x2b')](handleEntityNotFound(_0x4b0791,null))[_0xf8e3('0x2b')](respondWithResult(_0x4b0791,null))[_0xf8e3('0x4c')](handleError(_0x4b0791,null));};exports[_0xf8e3('0x2c')]=function(_0x385a8f,_0x3256e6){return db['VoicePrefix'][_0xf8e3('0x4f')]({'where':{'id':_0x385a8f[_0xf8e3('0x50')]['id']}})[_0xf8e3('0x2b')](handleEntityNotFound(_0x3256e6,null))[_0xf8e3('0x2b')](removeEntity(_0x3256e6,null))[_0xf8e3('0x4c')](handleError(_0x3256e6,null));};exports[_0xf8e3('0x51')]=function(_0x5855f2,_0x260f67){return db[_0xf8e3('0x4a')][_0xf8e3('0x51')]()[_0xf8e3('0x2b')](respondWithResult(_0x260f67,null))[_0xf8e3('0x4c')](handleError(_0x260f67,null));};exports[_0xf8e3('0x52')]=function(_0x5990fc,_0x394e45){var _0x1f425f;return db[_0xf8e3('0x53')][_0xf8e3('0x54')](function(_0x452b00){return db['VoicePrefix'][_0xf8e3('0x52')](_0x5990fc[_0xf8e3('0x55')],{'transaction':_0x452b00})[_0xf8e3('0x2b')](function(_0x53c897){_0x1f425f=_0x53c897['get']({'plain':!![]});return db[_0xf8e3('0x56')][_0xf8e3('0x4f')]({'where':{'id':_0x1f425f[_0xf8e3('0x57')]},'raw':!![]})[_0xf8e3('0x2b')](function(_0x58ad2f){return createVoicePrefixExtensions(_0x1f425f,_0x58ad2f,_0x452b00);});});})[_0xf8e3('0x2b')](function(){var _0x16bddb=_0x5990fc['user']['get']({'plain':!![]});if(!_0x16bddb)throw new Error(_0xf8e3('0x58'));if(_0x16bddb[_0xf8e3('0x59')]===_0xf8e3('0x5a')){var _0x505477=_0x1f425f;return db['UserProfileSection']['find']({'where':{'name':_0xf8e3('0x2d'),'userProfileId':_0x16bddb[_0xf8e3('0x5b')]},'raw':!![]})['then'](function(_0x4937fc){if(_0x4937fc&&_0x4937fc['autoAssociation']===0x0){return db[_0xf8e3('0x2e')][_0xf8e3('0x52')]({'name':_0x505477['name'],'resourceId':_0x505477['id'],'type':_0x4937fc[_0xf8e3('0x31')],'sectionId':_0x4937fc['id']},{})[_0xf8e3('0x2b')](function(){return _0x1f425f;});}else{return _0x1f425f;}})[_0xf8e3('0x4c')](function(_0x560f42){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x560f42);throw _0x560f42;});}return _0x1f425f;})['then'](respondWithResult(_0x394e45,null))[_0xf8e3('0x4c')](handleError(_0x394e45,null));};function Extension(_0x3b120a,_0x3ef144,_0x447efe,_0x442349){this[_0xf8e3('0x5c')]=_0xf8e3('0x5d');this[_0xf8e3('0x5e')]=_0x3b120a;this[_0xf8e3('0x5f')]=_0x447efe;this['type']='system';this[_0xf8e3('0x60')]=_0xf8e3('0x61');this[_0xf8e3('0x62')]=_0x3ef144;this['appdata']=_0x442349;}function createVoicePrefixExtensions(_0x234b06,_0x131c0b,_0x4879c7){return new BPromise(function(_0x48bb3f,_0x256cd5){var _0x4763eb=new Extension(formatPrefixName(_0x234b06[_0xf8e3('0x63')]),0x1,_0xf8e3('0x64'),'Voice\x20Prefix');_0x4763eb['VoicePrefixId']=_0x234b06['id'];return db[_0xf8e3('0x56')][_0xf8e3('0x52')](_0x4763eb,{'transaction':_0x4879c7})[_0xf8e3('0x2b')](function(_0x392d99){var _0x4f1ddb=_0x392d99['get']({'plain':!![]});var _0x324ad5=_[_0xf8e3('0x34')](addVoicePrefixExtensions(_0x234b06,_0x131c0b),function(_0x56a07e){_0x56a07e[_0xf8e3('0x57')]=_0x4f1ddb['id'];_0x56a07e[_0xf8e3('0x65')]=_0x234b06['id'];return _0x56a07e;});return db[_0xf8e3('0x56')][_0xf8e3('0x66')](_0x324ad5,{'transaction':_0x4879c7})['then'](function(_0x11ebb2){if(!_0x11ebb2){return _0x256cd5('Extensions\x20creation\x20failed');}else{return _0x48bb3f(_0x11ebb2);}})[_0xf8e3('0x4c')](function(_0x1cad38){return _0x256cd5(_0x1cad38);});});;});};function addVoicePrefixExtensions(_0x5cbdc6,_0x2ec4f6){var _0x31568b=[];var _0x55418c=formatPrefixName(_0x5cbdc6[_0xf8e3('0x63')]);_0x31568b[_0xf8e3('0x67')](new Extension(_0x55418c,0x2,_0xf8e3('0x68'),_0xf8e3('0x69')+_0x5cbdc6['name']));if(_0x5cbdc6[_0xf8e3('0x6a')]){_0x31568b[_0xf8e3('0x67')](new Extension(_0x55418c,0x3,_0xf8e3('0x68'),_0xf8e3('0x6b')+_0x5cbdc6[_0xf8e3('0x6a')]));}else{_0x31568b[_0xf8e3('0x67')](new Extension(_0x55418c,0x3,_0xf8e3('0x64'),_0xf8e3('0x6c')));}_0x31568b[_0xf8e3('0x67')](new Extension(_0x55418c,0x4,_0xf8e3('0x6d'),_0x2ec4f6[_0xf8e3('0x5c')]+','+_0xf8e3('0x6e')+(0x8+_0x5cbdc6['name']['length'])+'}'+','+0x1));return _0x31568b;}function formatPrefixName(_0x2f6cf4){var _0x32eaab='_';for(var _0x5ccdb2=0x0;_0x5ccdb2<_0x2f6cf4[_0xf8e3('0x3f')];_0x5ccdb2++){if(_0x2f6cf4[_0xf8e3('0x6f')](_0x5ccdb2)=='-'){_0x32eaab+=_0x2f6cf4[_0xf8e3('0x6f')](_0x5ccdb2);}else{_0x32eaab+='['+_0x2f6cf4[_0xf8e3('0x6f')](_0x5ccdb2)+']';}}_0x32eaab+='.';return _0x32eaab;}exports[_0xf8e3('0x70')]=function(_0x5804eb,_0x3e501c,_0x1dcd23){var _0x52e996=_0x5804eb[_0xf8e3('0x55')];_0x52e996['prefix']=_0xf8e3('0x71')+_0x52e996['name']+'-';return db[_0xf8e3('0x53')][_0xf8e3('0x54')](function(_0x45361d){return db[_0xf8e3('0x4a')][_0xf8e3('0x70')](_0x52e996,{'where':{'id':_0x52e996['id']},'transaction':_0x45361d})['then'](function(){return db[_0xf8e3('0x56')][_0xf8e3('0x2c')]({'where':{'VoicePrefixId':_0x52e996['id']},'transaction':_0x45361d})[_0xf8e3('0x2b')](function(){return db[_0xf8e3('0x56')][_0xf8e3('0x4f')]({'where':{'id':_0x52e996[_0xf8e3('0x57')]},'raw':!![]})[_0xf8e3('0x2b')](function(_0x2ccd34){return createVoicePrefixExtensions(_0x52e996,_0x2ccd34,_0x45361d);});});});})[_0xf8e3('0x2b')](function(){return db[_0xf8e3('0x4a')][_0xf8e3('0x72')](_0x52e996['id']);})[_0xf8e3('0x2b')](respondWithResult(_0x3e501c,null))['catch'](handleError(_0x3e501c,null));};exports[_0xf8e3('0x73')]=function(_0x280f06,_0x3dc049,_0x4b69db){return db[_0xf8e3('0x4a')][_0xf8e3('0x4f')]({'where':{'id':_0x280f06[_0xf8e3('0x50')]['id']}})[_0xf8e3('0x2b')](handleEntityNotFound(_0x3dc049,null))[_0xf8e3('0x2b')](function(_0x40174a){if(_0x40174a){return _0x40174a[_0xf8e3('0x73')](_0x280f06[_0xf8e3('0x55')][_0xf8e3('0x74')],_[_0xf8e3('0x75')](_0x280f06[_0xf8e3('0x55')],[_0xf8e3('0x74'),'id'])||{})['spread'](function(_0x118cc6){for(var _0xf7cb3a=0x0;_0xf7cb3a<_0x280f06[_0xf8e3('0x55')][_0xf8e3('0x74')]['length'];_0xf7cb3a+=0x1){socket['emit'](_0xf8e3('0x76'),{'UserId':Number(_0x280f06[_0xf8e3('0x55')]['ids'][_0xf7cb3a]),'VoicePrefixId':Number(_0x280f06['params']['id'])});}return _0x118cc6;});}})[_0xf8e3('0x2b')](respondWithResult(_0x3dc049,null))[_0xf8e3('0x4c')](handleError(_0x3dc049,null));};exports['removeAgents']=function(_0x2a2c6,_0xca5962,_0x16e69a){return db[_0xf8e3('0x4a')][_0xf8e3('0x4f')]({'where':{'id':_0x2a2c6['params']['id']}})[_0xf8e3('0x2b')](handleEntityNotFound(_0xca5962,null))[_0xf8e3('0x2b')](function(_0x54db4e){if(_0x54db4e){return _0x54db4e['removeAgents'](_0x2a2c6[_0xf8e3('0x38')][_0xf8e3('0x74')])[_0xf8e3('0x2b')](function(){if(_[_0xf8e3('0x77')](_0x2a2c6[_0xf8e3('0x38')][_0xf8e3('0x74')])){for(var _0x3823b9=0x0;_0x3823b9<_0x2a2c6[_0xf8e3('0x38')]['ids'][_0xf8e3('0x3f')];_0x3823b9+=0x1){socket[_0xf8e3('0x78')](_0xf8e3('0x79'),{'UserId':Number(_0x2a2c6[_0xf8e3('0x38')][_0xf8e3('0x74')][_0x3823b9]),'VoicePrefixId':Number(_0x2a2c6[_0xf8e3('0x50')]['id'])});}}else{socket['emit'](_0xf8e3('0x79'),{'UserId':Number(_0x2a2c6[_0xf8e3('0x38')][_0xf8e3('0x74')]),'VoicePrefixId':Number(_0x2a2c6['params']['id'])});}});}})['then'](respondWithStatusCode(_0xca5962,null))[_0xf8e3('0x4c')](handleError(_0xca5962,null));};exports[_0xf8e3('0x7a')]=function(_0x25805c,_0xc01ac,_0x4659ed){var _0x5b8840={};var _0x25bf6c={};var _0x1f5a80;var _0x1bfe33;return db[_0xf8e3('0x4a')][_0xf8e3('0x7b')]({'where':{'id':_0x25805c[_0xf8e3('0x50')]['id']}})[_0xf8e3('0x2b')](handleEntityNotFound(_0xc01ac,null))[_0xf8e3('0x2b')](function(_0x40b66c){if(_0x40b66c){_0x1f5a80=_0x40b66c;_0x25bf6c['model']=_[_0xf8e3('0x39')](db[_0xf8e3('0x7c')][_0xf8e3('0x35')]);_0x25bf6c[_0xf8e3('0x38')]=_[_0xf8e3('0x39')](_0x25805c[_0xf8e3('0x38')]);_0x25bf6c[_0xf8e3('0x3a')]=_['intersection'](_0x25bf6c['model'],_0x25bf6c[_0xf8e3('0x38')]);_0x5b8840[_0xf8e3('0x3e')]=_['intersection'](_0x25bf6c[_0xf8e3('0x3b')],qs[_0xf8e3('0x3d')](_0x25805c[_0xf8e3('0x38')][_0xf8e3('0x3d')]));_0x5b8840[_0xf8e3('0x3e')]=_0x5b8840[_0xf8e3('0x3e')][_0xf8e3('0x3f')]?_0x5b8840['attributes']:_0x25bf6c[_0xf8e3('0x3b')];_0x5b8840[_0xf8e3('0x42')]=qs[_0xf8e3('0x43')](_0x25805c[_0xf8e3('0x38')][_0xf8e3('0x43')]);_0x5b8840[_0xf8e3('0x44')]=qs[_0xf8e3('0x3a')](_[_0xf8e3('0x45')](_0x25805c[_0xf8e3('0x38')],_0x25bf6c[_0xf8e3('0x3a')]));if(_0x25805c[_0xf8e3('0x38')]['filter']){_0x5b8840['where']=_[_0xf8e3('0x47')](_0x5b8840['where'],{'$or':_[_0xf8e3('0x34')](_0x5b8840['attributes'],function(_0x1a3843){var _0x1b2249={};_0x1b2249[_0x1a3843]={'$like':'%'+_0x25805c[_0xf8e3('0x38')]['filter']+'%'};return _0x1b2249;})});}_0x5b8840=_[_0xf8e3('0x47')]({},_0x5b8840,_0x25805c[_0xf8e3('0x49')]);return _0x1f5a80[_0xf8e3('0x7a')](_0x5b8840);}})[_0xf8e3('0x2b')](function(_0x3619cd){if(_0x3619cd){_0x1bfe33=_0x3619cd['length'];if(!_0x25805c[_0xf8e3('0x38')]['hasOwnProperty'](_0xf8e3('0x41'))){_0x5b8840[_0xf8e3('0x25')]=qs[_0xf8e3('0x25')](_0x25805c[_0xf8e3('0x38')][_0xf8e3('0x25')]);_0x5b8840[_0xf8e3('0x23')]=qs[_0xf8e3('0x23')](_0x25805c['query'][_0xf8e3('0x23')]);}return _0x1f5a80[_0xf8e3('0x7a')](_0x5b8840);}})[_0xf8e3('0x2b')](function(_0x1a9ba6){if(_0x1a9ba6){return _0x1a9ba6?{'count':_0x1bfe33,'rows':_0x1a9ba6}:null;}})['then'](respondWithResult(_0xc01ac,null))[_0xf8e3('0x4c')](handleError(_0xc01ac,null));};exports[_0xf8e3('0x7d')]=function(_0x3f7c0e,_0x2da8fb,_0x22fa2f){var _0x18fbd2={};var _0x477589={};var _0x1bb12c;var _0x4a5ad8;return db['VoicePrefix'][_0xf8e3('0x7b')]({'where':{'id':_0x3f7c0e[_0xf8e3('0x50')]['id']}})[_0xf8e3('0x2b')](handleEntityNotFound(_0x2da8fb,null))[_0xf8e3('0x2b')](function(_0x131625){if(_0x131625){_0x1bb12c=_0x131625;_0x477589[_0xf8e3('0x3b')]=_[_0xf8e3('0x39')](db['Team'][_0xf8e3('0x35')]);_0x477589['query']=_[_0xf8e3('0x39')](_0x3f7c0e[_0xf8e3('0x38')]);_0x477589[_0xf8e3('0x3a')]=_[_0xf8e3('0x3c')](_0x477589['model'],_0x477589[_0xf8e3('0x38')]);_0x18fbd2['attributes']=_['intersection'](_0x477589[_0xf8e3('0x3b')],qs[_0xf8e3('0x3d')](_0x3f7c0e[_0xf8e3('0x38')][_0xf8e3('0x3d')]));_0x18fbd2['attributes']=_0x18fbd2['attributes'][_0xf8e3('0x3f')]?_0x18fbd2[_0xf8e3('0x3e')]:_0x477589['model'];_0x18fbd2['order']=qs[_0xf8e3('0x43')](_0x3f7c0e[_0xf8e3('0x38')]['sort']);_0x18fbd2[_0xf8e3('0x44')]=qs[_0xf8e3('0x3a')](_[_0xf8e3('0x45')](_0x3f7c0e[_0xf8e3('0x38')],_0x477589[_0xf8e3('0x3a')]));if(_0x3f7c0e[_0xf8e3('0x38')][_0xf8e3('0x46')]){_0x18fbd2['where']=_[_0xf8e3('0x47')](_0x18fbd2[_0xf8e3('0x44')],{'$or':_['map'](_0x18fbd2[_0xf8e3('0x3e')],function(_0x4a8866){var _0x1ca81d={};_0x1ca81d[_0x4a8866]={'$like':'%'+_0x3f7c0e[_0xf8e3('0x38')][_0xf8e3('0x46')]+'%'};return _0x1ca81d;})});}_0x18fbd2=_['merge']({},_0x18fbd2,_0x3f7c0e[_0xf8e3('0x49')]);return _0x1bb12c['getTeams'](_0x18fbd2);}})[_0xf8e3('0x2b')](function(_0x41ca1b){if(_0x41ca1b){_0x4a5ad8=_0x41ca1b[_0xf8e3('0x3f')];if(!_0x3f7c0e[_0xf8e3('0x38')]['hasOwnProperty']('nolimit')){_0x18fbd2[_0xf8e3('0x25')]=qs[_0xf8e3('0x25')](_0x3f7c0e[_0xf8e3('0x38')][_0xf8e3('0x25')]);_0x18fbd2[_0xf8e3('0x23')]=qs[_0xf8e3('0x23')](_0x3f7c0e['query'][_0xf8e3('0x23')]);}return _0x1bb12c[_0xf8e3('0x7d')](_0x18fbd2);}})[_0xf8e3('0x2b')](function(_0x348e59){if(_0x348e59){return _0x348e59?{'count':_0x4a5ad8,'rows':_0x348e59}:null;}})['then'](respondWithResult(_0x2da8fb,null))[_0xf8e3('0x4c')](handleError(_0x2da8fb,null));};exports['addTeams']=function(_0x3b51c7,_0xf88bb2,_0x4b27e3){var _0x108168=_0x3b51c7['body'][_0xf8e3('0x74')];var _0x3fba66;return db['Team'][_0xf8e3('0x4b')]({'where':{'id':_0x108168},'attributes':['id'],'include':[{'model':db[_0xf8e3('0x7c')],'as':'Agents','attributes':['id',_0xf8e3('0x31'),_0xf8e3('0x7e'),_0xf8e3('0x7f'),_0xf8e3('0x80')],'raw':!![]}]})[_0xf8e3('0x2b')](function(_0x3b79e1){if(_0x3b79e1){_0x3fba66=_0x3b79e1;var _0x13f467=_[_0xf8e3('0x81')](_0x3b79e1,function(_0x29c04b){var _0x271ed0=_0x29c04b[_0xf8e3('0x82')]({'plain':!![]});return _0x271ed0[_0xf8e3('0x83')];});return db['VoicePrefix'][_0xf8e3('0x4f')]({'where':{'id':_0x3b51c7[_0xf8e3('0x50')]['id']}})[_0xf8e3('0x2b')](function(_0x48230e){return db[_0xf8e3('0x53')][_0xf8e3('0x54')](function(_0x7e83fd){return _0x48230e[_0xf8e3('0x84')](_0x108168,{'transaction':_0x7e83fd})[_0xf8e3('0x2b')](function(){return BPromise[_0xf8e3('0x85')](_0x3fba66,function(_0x6d4c09){return db['TeamVoicePrefix']['upsert']({'TeamId':_0x6d4c09['id'],'VoicePrefixId':_0x3b51c7[_0xf8e3('0x50')]['id']},{'transaction':_0x7e83fd});});})[_0xf8e3('0x2b')](function(){return BPromise['each'](_0x13f467,function(_0x1a85cf){return db[_0xf8e3('0x86')]['findOrCreate']({'where':{'UserId':_0x1a85cf['id'],'VoicePrefixId':_0x3b51c7[_0xf8e3('0x50')]['id']},'transaction':_0x7e83fd});});})[_0xf8e3('0x2b')](function(){_0x13f467[_0xf8e3('0x87')](function(_0x27d0b6){socket[_0xf8e3('0x78')]('userVoicePrefix:save',{'UserId':_0x27d0b6['id'],'VoicePrefixId':_0x48230e['id']});});});});});}})[_0xf8e3('0x2b')](respondWithStatusCode(_0xf88bb2,null))[_0xf8e3('0x4c')](handleError(_0xf88bb2,null));};exports['removeTeams']=function(_0x4f02bb,_0x237eb6,_0xd9e796){return db[_0xf8e3('0x88')][_0xf8e3('0x4b')]({'where':{'id':_0x4f02bb[_0xf8e3('0x38')][_0xf8e3('0x74')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xf8e3('0x83'),'attributes':['id'],'raw':!![]}]})[_0xf8e3('0x2b')](handleEntityNotFound(_0x237eb6,null))['then'](function(_0x5ae078){var _0x512d8d=_[_0xf8e3('0x34')](_0x5ae078,'id');var _0x186e42=[];var _0x417af2=[];var _0x29f5d0=squel[_0xf8e3('0x89')]();_0x29f5d0[_0xf8e3('0x8a')](_0xf8e3('0x8b'))['from']('team_has_voice_prefixes','tq')[_0xf8e3('0x8c')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xf8e3('0x44')](_0xf8e3('0x8d'),_0x4f02bb['params']['id']);for(var _0x1cff32=0x0;_0x1cff32<_0x5ae078[_0xf8e3('0x3f')];_0x1cff32+=0x1){let _0x876d0c=_0x5ae078[_0x1cff32];for(var _0x2c4060=0x0;_0x2c4060<_0x876d0c[_0xf8e3('0x83')][_0xf8e3('0x3f')];_0x2c4060+=0x1){let _0x1b8e99=_0x876d0c[_0xf8e3('0x83')][_0x2c4060];var _0x107896=_0x29f5d0[_0xf8e3('0x8e')]();_0x107896[_0xf8e3('0x44')](_0xf8e3('0x8f'),_0x1b8e99['id']);_0x417af2[_0xf8e3('0x67')](db[_0xf8e3('0x53')][_0xf8e3('0x38')](_0x107896['toString'](),{'type':db[_0xf8e3('0x53')][_0xf8e3('0x90')]['SELECT']})[_0xf8e3('0x2b')](function(_0x4e8329){if(_0x4e8329['length']===0x1){return _0x1b8e99['id'];}else{var _0x5a66ee=_[_0xf8e3('0x91')](_[_0xf8e3('0x34')](_0x4e8329,'TeamId'),function(_0x207393){return _[_0xf8e3('0x92')](_0x512d8d,_0x207393);});if(_0x5a66ee){return _0x1b8e99['id'];}}}));}}return BPromise[_0xf8e3('0x93')](_0x417af2)['then'](function(_0x3a39a8){_0x186e42=_(_0x186e42)[_0xf8e3('0x94')](_0x3a39a8)[_0xf8e3('0x95')]()['value']();return db[_0xf8e3('0x4a')][_0xf8e3('0x4f')]({'where':{'id':_0x4f02bb[_0xf8e3('0x50')]['id']}})['then'](function(_0x42d800){return db[_0xf8e3('0x53')][_0xf8e3('0x54')](function(_0x13782d){return _0x42d800[_0xf8e3('0x96')](_0x4f02bb[_0xf8e3('0x38')]['ids'],{'transaction':_0x13782d})[_0xf8e3('0x2b')](function(){if(!_[_0xf8e3('0x97')](_0x186e42)){return _0x42d800['removeAgents'](_0x186e42,{'transaction':_0x13782d});}})[_0xf8e3('0x2b')](function(){_0x186e42[_0xf8e3('0x87')](function(_0xcf534f){socket[_0xf8e3('0x78')]('userVoicePrefix:remove',{'UserId':_0xcf534f,'VoicePrefixId':_0x42d800['id']});});});});});});})[_0xf8e3('0x2b')](respondWithStatusCode(_0x237eb6,null))['catch'](handleError(_0x237eb6,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index cdf8480..b1e16b2 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 _0x8a12=['emit','hook','events','../../mysqldb','VoicePrefix','setMaxListeners','update','remove'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8a12,0x172));var _0x28a1=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x8a12[_0x501510];return _0x1e6ee5;};'use strict';var EventEmitter=require(_0x28a1('0x0'));var VoicePrefix=require(_0x28a1('0x1'))['db'][_0x28a1('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x28a1('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x28a1('0x4'),'afterDestroy':_0x28a1('0x5')};function emitEvent(_0x4007ee){return function(_0x1aefd7,_0x4a8067,_0x373244){VoicePrefixEvents[_0x28a1('0x6')](_0x4007ee+':'+_0x1aefd7['id'],_0x1aefd7);VoicePrefixEvents[_0x28a1('0x6')](_0x4007ee,_0x1aefd7);_0x373244(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x28a1('0x7')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file +var _0x0361=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0xd1c39b,_0x16f0c6){var _0x58f5bc=function(_0x412cf3){while(--_0x412cf3){_0xd1c39b['push'](_0xd1c39b['shift']());}};_0x58f5bc(++_0x16f0c6);}(_0x0361,0x190));var _0x1036=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x0361[_0xfae23b];return _0x200640;};'use strict';var EventEmitter=require(_0x1036('0x0'));var VoicePrefix=require(_0x1036('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x1036('0x2')](0x0);var events={'afterCreate':_0x1036('0x3'),'afterUpdate':_0x1036('0x4'),'afterDestroy':_0x1036('0x5')};function emitEvent(_0x357d82){return function(_0x395afb,_0x2bcaa0,_0x116c3f){VoicePrefixEvents[_0x1036('0x6')](_0x357d82+':'+_0x395afb['id'],_0x395afb);VoicePrefixEvents[_0x1036('0x6')](_0x357d82,_0x395afb);_0x116c3f(null);};}for(var e in events){if(events[_0x1036('0x7')](e)){var event=events[e];VoicePrefix[_0x1036('0x8')](e,emitEvent(event));}}module[_0x1036('0x9')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 3fdbd00..8cc4c80 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 _0x6649=['exports','define','VoicePrefix','voice_prefixes','util','../../config/logger','api','moment','bluebird','path','./voicePrefix.attributes'];(function(_0x40bf27,_0x103e47){var _0x3356b2=function(_0x4904e1){while(--_0x4904e1){_0x40bf27['push'](_0x40bf27['shift']());}};_0x3356b2(++_0x103e47);}(_0x6649,0xeb));var _0x9664=function(_0x59a426,_0x453203){_0x59a426=_0x59a426-0x0;var _0x7dd020=_0x6649[_0x59a426];return _0x7dd020;};'use strict';var _=require('lodash');var util=require(_0x9664('0x0'));var logger=require(_0x9664('0x1'))(_0x9664('0x2'));var moment=require(_0x9664('0x3'));var BPromise=require(_0x9664('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9664('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9664('0x6'));module[_0x9664('0x7')]=function(_0x6e0222,_0x202c9c){return _0x6e0222[_0x9664('0x8')](_0x9664('0x9'),attributes,{'tableName':_0x9664('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb21e=['exports','define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','request-promise','../../config/environment'];(function(_0x4de824,_0x29c7c0){var _0x1fd5f7=function(_0xc1aa1e){while(--_0xc1aa1e){_0x4de824['push'](_0x4de824['shift']());}};_0x1fd5f7(++_0x29c7c0);}(_0xb21e,0x109));var _0xeb21=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xb21e[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0xeb21('0x0'));var util=require(_0xeb21('0x1'));var logger=require(_0xeb21('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xeb21('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xeb21('0x4'));var attributes=require('./voicePrefix.attributes');module[_0xeb21('0x5')]=function(_0x7f055b,_0x4ade45){return _0x7f055b[_0xeb21('0x6')](_0xeb21('0x7'),attributes,{'tableName':_0xeb21('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index e6f2507..b5bd57c 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 _0x6132=['message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','localhost','./voicePrefix.socket','register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x395e67,_0x29c929){var _0x2aee8a=function(_0x21100d){while(--_0x21100d){_0x395e67['push'](_0x395e67['shift']());}};_0x2aee8a(++_0x29c929);}(_0x6132,0x13a));var _0x2613=function(_0x194ca3,_0xca0006){_0x194ca3=_0x194ca3-0x0;var _0x3ca3d9=_0x6132[_0x194ca3];return _0x3ca3d9;};'use strict';var _=require(_0x2613('0x0'));var util=require(_0x2613('0x1'));var moment=require(_0x2613('0x2'));var BPromise=require(_0x2613('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2613('0x4'));var db=require(_0x2613('0x5'))['db'];var utils=require(_0x2613('0x6'));var logger=require(_0x2613('0x7'))('rpc');var config=require(_0x2613('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2613('0x9')]({'port':0x232a});config[_0x2613('0xa')]=_[_0x2613('0xb')](config[_0x2613('0xa')],{'host':_0x2613('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2613('0xa')]));require(_0x2613('0xd'))[_0x2613('0xe')](socket);function respondWithRpcPromise(_0x5c9af5,_0xe1a1ff,_0x12c800){return new BPromise(function(_0x6d4439,_0x37fe48){return client[_0x2613('0xf')](_0x5c9af5,_0x12c800)[_0x2613('0x10')](function(_0xcc6236){logger[_0x2613('0x11')](_0x2613('0x12'),_0xe1a1ff,_0x2613('0x13'));logger['debug'](_0x2613('0x14'),_0xe1a1ff,_0x2613('0x13'),JSON[_0x2613('0x15')](_0xcc6236));if(_0xcc6236[_0x2613('0x16')]){if(_0xcc6236['error'][_0x2613('0x17')]===0x1f4){logger[_0x2613('0x16')](_0x2613('0x12'),_0xe1a1ff,_0xcc6236[_0x2613('0x16')]['message']);return _0x37fe48(_0xcc6236[_0x2613('0x16')][_0x2613('0x18')]);}logger[_0x2613('0x16')](_0x2613('0x12'),_0xe1a1ff,_0xcc6236['error'][_0x2613('0x18')]);return _0x6d4439(_0xcc6236[_0x2613('0x16')]['message']);}else{logger[_0x2613('0x11')](_0x2613('0x12'),_0xe1a1ff,_0x2613('0x13'));_0x6d4439(_0xcc6236[_0x2613('0x19')][_0x2613('0x18')]);}})['catch'](function(_0x349c5c){logger[_0x2613('0x16')]('VoicePrefix,\x20%s,\x20%s',_0xe1a1ff,_0x349c5c);_0x37fe48(_0x349c5c);});});} \ No newline at end of file +var _0x65cb=['result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x39d3a2,_0x530277){var _0x5d6754=function(_0x48b53f){while(--_0x48b53f){_0x39d3a2['push'](_0x39d3a2['shift']());}};_0x5d6754(++_0x530277);}(_0x65cb,0xa4));var _0xb65c=function(_0x3bb487,_0x54fb9c){_0x3bb487=_0x3bb487-0x0;var _0x1e9fd9=_0x65cb[_0x3bb487];return _0x1e9fd9;};'use strict';var _=require(_0xb65c('0x0'));var util=require('util');var moment=require(_0xb65c('0x1'));var BPromise=require(_0xb65c('0x2'));var rs=require(_0xb65c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb65c('0x4'))['db'];var utils=require(_0xb65c('0x5'));var logger=require(_0xb65c('0x6'))(_0xb65c('0x7'));var config=require(_0xb65c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb65c('0x9')][_0xb65c('0xa')]({'port':0x232a});config[_0xb65c('0xb')]=_[_0xb65c('0xc')](config[_0xb65c('0xb')],{'host':_0xb65c('0xd'),'port':0x18eb});var socket=require(_0xb65c('0xe'))(new Redis(config[_0xb65c('0xb')]));require('./voicePrefix.socket')[_0xb65c('0xf')](socket);function respondWithRpcPromise(_0x2d9bb1,_0x19e32e,_0xd9b29a){return new BPromise(function(_0x5dec0c,_0x131587){return client['request'](_0x2d9bb1,_0xd9b29a)[_0xb65c('0x10')](function(_0x1697b1){logger[_0xb65c('0x11')](_0xb65c('0x12'),_0x19e32e,_0xb65c('0x13'));logger[_0xb65c('0x14')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x19e32e,_0xb65c('0x13'),JSON[_0xb65c('0x15')](_0x1697b1));if(_0x1697b1[_0xb65c('0x16')]){if(_0x1697b1[_0xb65c('0x16')][_0xb65c('0x17')]===0x1f4){logger[_0xb65c('0x16')](_0xb65c('0x12'),_0x19e32e,_0x1697b1['error'][_0xb65c('0x18')]);return _0x131587(_0x1697b1[_0xb65c('0x16')]['message']);}logger[_0xb65c('0x16')]('VoicePrefix,\x20%s,\x20%s',_0x19e32e,_0x1697b1[_0xb65c('0x16')][_0xb65c('0x18')]);return _0x5dec0c(_0x1697b1[_0xb65c('0x16')][_0xb65c('0x18')]);}else{logger[_0xb65c('0x11')](_0xb65c('0x12'),_0x19e32e,_0xb65c('0x13'));_0x5dec0c(_0x1697b1[_0xb65c('0x19')][_0xb65c('0x18')]);}})[_0xb65c('0x1a')](function(_0x3fa3bc){logger[_0xb65c('0x16')](_0xb65c('0x12'),_0x19e32e,_0x3fa3bc);_0x131587(_0x3fa3bc);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index a53c8db..0b3d15c 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 _0xfdb5=['remove','register','voicePrefix:','./voicePrefix.events','save'];(function(_0x4cfc81,_0x35f8fb){var _0x25df25=function(_0x146616){while(--_0x146616){_0x4cfc81['push'](_0x4cfc81['shift']());}};_0x25df25(++_0x35f8fb);}(_0xfdb5,0x12f));var _0x5fdb=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0xfdb5[_0x4dc7b9];return _0x3ab114;};'use strict';var VoicePrefixEvents=require(_0x5fdb('0x0'));var events=[_0x5fdb('0x1'),_0x5fdb('0x2'),'update'];function createListener(_0x190bc2,_0x3067fa){return function(_0x7da3ba){_0x3067fa['emit'](_0x190bc2,_0x7da3ba);};}function removeListener(_0x55124b,_0x3ff059){return function(){VoicePrefixEvents['removeListener'](_0x55124b,_0x3ff059);};}exports[_0x5fdb('0x3')]=function(_0x4a2149){for(var _0x1b0148=0x0,_0xda053e=events['length'];_0x1b0148<_0xda053e;_0x1b0148++){var _0x542bbc=events[_0x1b0148];var _0x5a556e=createListener(_0x5fdb('0x4')+_0x542bbc,_0x4a2149);VoicePrefixEvents['on'](_0x542bbc,_0x5a556e);}}; \ No newline at end of file +var _0xad8a=['emit','removeListener','register','length','voicePrefix:','./voicePrefix.events','save','remove','update'];(function(_0x365cb1,_0x101d17){var _0x4c5156=function(_0x4ccaa4){while(--_0x4ccaa4){_0x365cb1['push'](_0x365cb1['shift']());}};_0x4c5156(++_0x101d17);}(_0xad8a,0xb0));var _0xaad8=function(_0x48e8f0,_0xdf9933){_0x48e8f0=_0x48e8f0-0x0;var _0x57c2ae=_0xad8a[_0x48e8f0];return _0x57c2ae;};'use strict';var VoicePrefixEvents=require(_0xaad8('0x0'));var events=[_0xaad8('0x1'),_0xaad8('0x2'),_0xaad8('0x3')];function createListener(_0x158aa2,_0x4848a7){return function(_0x201fbe){_0x4848a7[_0xaad8('0x4')](_0x158aa2,_0x201fbe);};}function removeListener(_0x398fde,_0x58f2c5){return function(){VoicePrefixEvents[_0xaad8('0x5')](_0x398fde,_0x58f2c5);};}exports[_0xaad8('0x6')]=function(_0x22c799){for(var _0xeb5d15=0x0,_0x95aef9=events[_0xaad8('0x7')];_0xeb5d15<_0x95aef9;_0xeb5d15++){var _0x28f3a1=events[_0xeb5d15];var _0xf3a6c7=createListener(_0xaad8('0x8')+_0x28f3a1,_0x22c799);VoicePrefixEvents['on'](_0x28f3a1,_0xf3a6c7);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 31358a6..c4b5412 100644 --- a/server/api/voiceQueue/index.js +++ b/server/api/voiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x5ccb4a,_0x4357ad){var _0x48b3a4=function(_0x114050){while(--_0x114050){_0x5ccb4a['push'](_0x5ccb4a['shift']());}};_0x48b3a4(++_0x4357ad);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file +var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x39ea42,_0x3c1f50){var _0x33f5b7=function(_0x5d8e73){while(--_0x5d8e73){_0x39ea42['push'](_0x39ea42['shift']());}};_0x33f5b7(++_0x3c1f50);}(_0xb10b,0x12a));var _0xbb10=function(_0x2a0fc4,_0x2eaf74){_0x2a0fc4=_0x2a0fc4-0x0;var _0x531d00=_0xb10b[_0x2a0fc4];return _0x531d00;};'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 ae53e1b..b153fe1 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 _0xd6d5=['getDataValue','type','dialMethod','preview','booked','includes','setDataValue','INTEGER','yes','once','TEXT','periodic_announce','split','joinempty','join','leavewhenempty','BOOLEAN','wrapuptime','Active/Disactive\x20Campaign','progressive','predictive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','inbound','outbound','default','ENUM','ringall','leastrecent','rrmemory','linear','wrandom','rrordered','strategy'];(function(_0x4921fd,_0x45b894){var _0x5812e5=function(_0x360c7d){while(--_0x360c7d){_0x4921fd['push'](_0x4921fd['shift']());}};_0x5812e5(++_0x45b894);}(_0xd6d5,0x16e));var _0x5d6d=function(_0x44c768,_0x552a5e){_0x44c768=_0x44c768-0x0;var _0x55daf5=_0xd6d5[_0x44c768];return _0x55daf5;};'use strict';var Sequelize=require(_0x5d6d('0x0'));module[_0x5d6d('0x1')]={'name':{'type':Sequelize[_0x5d6d('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x5d6d('0x3'),_0x5d6d('0x4')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x5d6d('0x2')],'defaultValue':_0x5d6d('0x5')},'announce':{'type':Sequelize[_0x5d6d('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x5d6d('0x6')]('rr',_0x5d6d('0x7'),_0x5d6d('0x8'),'fewestcalls','random',_0x5d6d('0x9'),_0x5d6d('0xa'),_0x5d6d('0xb'),_0x5d6d('0xc')),'allowNull':![],'defaultValue':_0x5d6d('0x7'),'set':function(_0x395e8a){this['setDataValue'](_0x5d6d('0xd'),_0x395e8a?_0x395e8a:_0x5d6d('0x9'));},'get':function(){var _0x45f0b3=this[_0x5d6d('0xe')](_0x5d6d('0xf'));var _0x4e004c=this['getDataValue'](_0x5d6d('0x10'));var _0x505a11=this[_0x5d6d('0xe')](_0x5d6d('0xd'));if(_0x45f0b3===_0x5d6d('0x4')){if(_0x4e004c===_0x5d6d('0x11')){return null;}if(_0x4e004c===_0x5d6d('0x12')&&![_0x5d6d('0x9'),'roundrobin'][_0x5d6d('0x13')](_0x505a11)){this[_0x5d6d('0x14')](_0x5d6d('0xd'),'rrmemory');}}return _0x505a11;}},'servicelevel':{'type':Sequelize[_0x5d6d('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x5d6d('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x5d6d('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x5d6d('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x5d6d('0x6')](_0x5d6d('0x16'),'no'),'defaultValue':_0x5d6d('0x16')},'autopause':{'type':Sequelize['ENUM']('yes','no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x5d6d('0x15')](0xb)},'autopausebusy':{'type':Sequelize[_0x5d6d('0x6')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0x5d6d('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x5d6d('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x5d6d('0x6')](_0x5d6d('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x5d6d('0x6')](_0x5d6d('0x16'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x5d6d('0x6')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x5d6d('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x5d6d('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x5d6d('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x5d6d('0x6')](_0x5d6d('0x16'),'no'),'defaultValue':_0x5d6d('0x16')},'announce_holdtime':{'type':Sequelize['ENUM'](_0x5d6d('0x16'),'no',_0x5d6d('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM']('yes','no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0x5d6d('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x5d6d('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x5d6d('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x5d6d('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x5d6d('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x5d6d('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x5d6d('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x5d6d('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x5d6d('0x2')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x5d6d('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x5d6d('0x2')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0x5d6d('0x18')],'set':function(_0xd82095){this[_0x5d6d('0x14')]('periodic_announce',_0xd82095?_0xd82095['join'](','):[]);},'get':function(){return this[_0x5d6d('0xe')](_0x5d6d('0x19'))?this[_0x5d6d('0xe')](_0x5d6d('0x19'))[_0x5d6d('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0x5d6d('0x2')],'defaultValue':'yes','set':function(_0x377dfe){this[_0x5d6d('0x14')](_0x5d6d('0x1b'),_0x377dfe?_0x377dfe[_0x5d6d('0x1c')](','):undefined);},'get':function(){return this['getDataValue'](_0x5d6d('0x1b'))?this[_0x5d6d('0xe')](_0x5d6d('0x1b'))[_0x5d6d('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x5d6d('0x2')],'defaultValue':'no','set':function(_0x43c704){this[_0x5d6d('0x14')](_0x5d6d('0x1d'),_0x43c704?_0x43c704[_0x5d6d('0x1c')](','):undefined);},'get':function(){return this[_0x5d6d('0xe')](_0x5d6d('0x1d'))?this[_0x5d6d('0xe')]('leavewhenempty')[_0x5d6d('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x5d6d('0x6')](_0x5d6d('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x5d6d('0x6')](_0x5d6d('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x5d6d('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x5d6d('0x6')](_0x5d6d('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x5d6d('0x2')]},'description':{'type':Sequelize[_0x5d6d('0x2')]},'acw':{'type':Sequelize[_0x5d6d('0x1e')],'defaultValue':0x0,'set':function(_0x55d671){this[_0x5d6d('0x14')]('acw',_0x55d671);if(_0x55d671){if(this[_0x5d6d('0xe')](_0x5d6d('0x1f'))<0x2){this[_0x5d6d('0x14')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x5d6d('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x5d6d('0x1e')],'defaultValue':0x0,'comment':_0x5d6d('0x20')},'dialMethod':{'type':Sequelize[_0x5d6d('0x6')](_0x5d6d('0x11'),_0x5d6d('0x21'),'power',_0x5d6d('0x22'),_0x5d6d('0x12')),'defaultValue':_0x5d6d('0x21'),'comment':_0x5d6d('0x23')},'dialLimitChannel':{'type':Sequelize[_0x5d6d('0x15')](0x4)[_0x5d6d('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x5d6d('0x25')},'dialLimitQueue':{'type':Sequelize[_0x5d6d('0x15')](0x4)[_0x5d6d('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x5d6d('0x26')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x5d6d('0x24')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x5d6d('0x27')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0x5d6d('0x28'),_0x5d6d('0x29')),'defaultValue':_0x5d6d('0x29'),'comment':_0x5d6d('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x5d6d('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x5d6d('0x2b')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0x5d6d('0x24')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x5d6d('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x5d6d('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x5d6d('0x15')](0x3)[_0x5d6d('0x24')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0x5d6d('0x2')],'defaultValue':_0x5d6d('0x2c'),'comment':_0x5d6d('0x2d')},'dialQueueTimeout':{'type':Sequelize[_0x5d6d('0x15')](0x3)[_0x5d6d('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0x5d6d('0x2')],'comment':_0x5d6d('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5d6d('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5d6d('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x5d6d('0x15')](0x5)[_0x5d6d('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x5d6d('0x15')](0x3)[_0x5d6d('0x24')],'defaultValue':0x3,'comment':_0x5d6d('0x2f')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5d6d('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5d6d('0x30')},'dialGlobalMaxRetry':{'type':Sequelize[_0x5d6d('0x15')](0x3)[_0x5d6d('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x5d6d('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x5d6d('0x2')],'defaultValue':_0x5d6d('0x31')},'dialPrefix':{'type':Sequelize[_0x5d6d('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x5d6d('0x6')]('always','never',_0x5d6d('0x32')),'defaultValue':_0x5d6d('0x33')},'dialAMDActive':{'type':Sequelize[_0x5d6d('0x1e')],'defaultValue':0x0,'comment':_0x5d6d('0x34')},'dialAMDInitialSilence':{'type':Sequelize[_0x5d6d('0x15')](0x9)[_0x5d6d('0x24')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x5d6d('0x15')](0x9)[_0x5d6d('0x24')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x5d6d('0x35')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x5d6d('0x15')](0x9)[_0x5d6d('0x24')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x5d6d('0x36')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x5d6d('0x15')](0x9)[_0x5d6d('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5d6d('0x37')},'dialAMDMinWordLength':{'type':Sequelize[_0x5d6d('0x15')](0x9)[_0x5d6d('0x24')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x5d6d('0x15')](0x9)[_0x5d6d('0x24')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x5d6d('0x15')](0x9)[_0x5d6d('0x24')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x5d6d('0x38')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x5d6d('0x24')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x5d6d('0x39')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x5d6d('0x15')](0x9)[_0x5d6d('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5d6d('0x3a')},'dialRecallMeTimeout':{'type':Sequelize[_0x5d6d('0x15')](0x5)[_0x5d6d('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x5d6d('0x3b')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x5d6d('0x3c')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0x5d6d('0x3d')),'defaultValue':_0x5d6d('0x3e')},'dialQueueProject2':{'type':Sequelize[_0x5d6d('0x2')],'comment':_0x5d6d('0x2e')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x5d6d('0x1e')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x5d6d('0x1e')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x5d6d('0x15')](0x3)[_0x5d6d('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5d6d('0x3f')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x5d6d('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5d6d('0x40')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x5d6d('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5d6d('0x41')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5d6d('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5d6d('0x42')},'dialDropMaxRetry':{'type':Sequelize[_0x5d6d('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x5d6d('0x15')](0x5)[_0x5d6d('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5d6d('0x43')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x5d6d('0x15')](0x3)[_0x5d6d('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5d6d('0x44')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x5d6d('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x5d6d('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5d6d('0x45')},'dialMachineRetryFrequency':{'type':Sequelize[_0x5d6d('0x15')](0x5)[_0x5d6d('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5d6d('0x46')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5d6d('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5d6d('0x47')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5d6d('0x15')],'allowNull':!![],'comment':_0x5d6d('0x48')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x5d6d('0x49'),'set':function(_0x171d55){if(!_0x171d55)this[_0x5d6d('0x14')](_0x5d6d('0x4a'),null);this[_0x5d6d('0x14')](_0x5d6d('0x4b'),_0x171d55);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x5d6d('0x15')](0x3)[_0x5d6d('0x24')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x5d6d('0x15')](0x3)[_0x5d6d('0x24')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x5d6d('0x1e')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize['INTEGER'](0x3)[_0x5d6d('0x24')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x170a=['#AMD\x20Initial\x20Silence','#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)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','inbound','outbound','default','ENUM','ringall','random','rrmemory','wrandom','setDataValue','strategy','getDataValue','dialMethod','preview','booked','roundrobin','includes','INTEGER','yes','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','progressive','power','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)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','Active/Disactive\x20AMD'];(function(_0x5e146f,_0x5c04f9){var _0x44ce4d=function(_0xb4744f){while(--_0xb4744f){_0x5e146f['push'](_0x5e146f['shift']());}};_0x44ce4d(++_0x5c04f9);}(_0x170a,0x190));var _0xa170=function(_0xf144bb,_0x197773){_0xf144bb=_0xf144bb-0x0;var _0x559e85=_0x170a[_0xf144bb];return _0x559e85;};'use strict';var Sequelize=require(_0xa170('0x0'));module[_0xa170('0x1')]={'name':{'type':Sequelize[_0xa170('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0xa170('0x3'),_0xa170('0x4')),'allowNull':![],'defaultValue':_0xa170('0x3')},'musiconhold':{'type':Sequelize[_0xa170('0x2')],'defaultValue':_0xa170('0x5')},'announce':{'type':Sequelize[_0xa170('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0xa170('0x6')]('rr',_0xa170('0x7'),'leastrecent','fewestcalls',_0xa170('0x8'),_0xa170('0x9'),'linear',_0xa170('0xa'),'rrordered'),'allowNull':![],'defaultValue':_0xa170('0x7'),'set':function(_0x216f0c){this[_0xa170('0xb')](_0xa170('0xc'),_0x216f0c?_0x216f0c:_0xa170('0x9'));},'get':function(){var _0x41b90c=this[_0xa170('0xd')]('type');var _0x349ad3=this[_0xa170('0xd')](_0xa170('0xe'));var _0x12e632=this[_0xa170('0xd')](_0xa170('0xc'));if(_0x41b90c===_0xa170('0x4')){if(_0x349ad3===_0xa170('0xf')){return null;}if(_0x349ad3===_0xa170('0x10')&&![_0xa170('0x9'),_0xa170('0x11')][_0xa170('0x12')](_0x12e632)){this[_0xa170('0xb')](_0xa170('0xc'),_0xa170('0x9'));}}return _0x12e632;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xa170('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xa170('0x13')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xa170('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0xa170('0x14'),'no'),'defaultValue':_0xa170('0x14')},'autopause':{'type':Sequelize['ENUM'](_0xa170('0x14'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xa170('0x13')](0xb)},'autopausebusy':{'type':Sequelize[_0xa170('0x6')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xa170('0x6')](_0xa170('0x14'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xa170('0x13')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0xa170('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xa170('0x6')](_0xa170('0x14'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0xa170('0x14'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0xa170('0x14'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xa170('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xa170('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xa170('0x13')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xa170('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xa170('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0xa170('0x14'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xa170('0x6')](_0xa170('0x14'),'no'),'defaultValue':_0xa170('0x14')},'announce_holdtime':{'type':Sequelize['ENUM'](_0xa170('0x14'),'no',_0xa170('0x15')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xa170('0x6')]('yes','no')},'announce_position_limit':{'type':Sequelize[_0xa170('0x13')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xa170('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xa170('0x2')]},'queue_youarenext':{'type':Sequelize[_0xa170('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xa170('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xa170('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xa170('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xa170('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xa170('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xa170('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xa170('0x2')]},'queue_quantity1':{'type':Sequelize[_0xa170('0x2')]},'queue_quantity2':{'type':Sequelize[_0xa170('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0xa170('0x2')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0xa170('0x16')],'set':function(_0x246cc3){this[_0xa170('0xb')](_0xa170('0x17'),_0x246cc3?_0x246cc3[_0xa170('0x18')](','):[]);},'get':function(){return this[_0xa170('0xd')]('periodic_announce')?this[_0xa170('0xd')](_0xa170('0x17'))[_0xa170('0x19')](','):[];}},'joinempty':{'type':Sequelize[_0xa170('0x2')],'defaultValue':'yes','set':function(_0x32c834){this[_0xa170('0xb')](_0xa170('0x1a'),_0x32c834?_0x32c834[_0xa170('0x18')](','):undefined);},'get':function(){return this[_0xa170('0xd')]('joinempty')?this[_0xa170('0xd')](_0xa170('0x1a'))[_0xa170('0x19')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xa170('0x2')],'defaultValue':'no','set':function(_0x58e09e){this[_0xa170('0xb')](_0xa170('0x1b'),_0x58e09e?_0x58e09e[_0xa170('0x18')](','):undefined);},'get':function(){return this['getDataValue']('leavewhenempty')?this['getDataValue'](_0xa170('0x1b'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xa170('0x6')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xa170('0x6')](_0xa170('0x14'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xa170('0x13')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xa170('0x6')](_0xa170('0x14'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xa170('0x2')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0xa170('0x1c')],'defaultValue':0x0,'set':function(_0x402116){this[_0xa170('0xb')](_0xa170('0x1d'),_0x402116);if(_0x402116){if(this['getDataValue'](_0xa170('0x1e'))<0x2){this[_0xa170('0xb')](_0xa170('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xa170('0x1f')},'dialMethod':{'type':Sequelize[_0xa170('0x6')]('preview',_0xa170('0x20'),_0xa170('0x21'),'predictive',_0xa170('0x10')),'defaultValue':_0xa170('0x20'),'comment':_0xa170('0x22')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0xa170('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xa170('0x24')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0xa170('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xa170('0x25')},'dialPowerLevel':{'type':Sequelize[_0xa170('0x26')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0xa170('0x6')](_0xa170('0x27'),'dropRate'),'defaultValue':_0xa170('0x28'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0xa170('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xa170('0x29')},'dialPredictiveInterval':{'type':Sequelize[_0xa170('0x13')](0x3)[_0xa170('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xa170('0x2a')},'dialOriginateCallerIdName':{'type':Sequelize[_0xa170('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xa170('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xa170('0x13')](0x3)[_0xa170('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa170('0x2b')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0xa170('0x2c'),'comment':_0xa170('0x2d')},'dialQueueTimeout':{'type':Sequelize[_0xa170('0x13')](0x3)[_0xa170('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa170('0x2e')},'dialQueueProject':{'type':Sequelize[_0xa170('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xa170('0x13')](0x3)[_0xa170('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa170('0x2f')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xa170('0x13')](0x5)[_0xa170('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa170('0x30')},'dialBusyMaxRetry':{'type':Sequelize[_0xa170('0x13')](0x3)[_0xa170('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xa170('0x13')](0x5)[_0xa170('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa170('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa170('0x23')],'defaultValue':0x3,'comment':_0xa170('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xa170('0x13')](0x5)[_0xa170('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa170('0x33')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa170('0x23')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xa170('0x34')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xa170('0x2')],'defaultValue':_0xa170('0x35')},'dialPrefix':{'type':Sequelize[_0xa170('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xa170('0x6')](_0xa170('0x36'),'never','onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xa170('0x1c')],'defaultValue':0x0,'comment':_0xa170('0x37')},'dialAMDInitialSilence':{'type':Sequelize[_0xa170('0x13')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xa170('0x38')},'dialAMDGreeting':{'type':Sequelize[_0xa170('0x13')](0x9)[_0xa170('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xa170('0x13')](0x9)[_0xa170('0x23')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xa170('0x39')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa170('0x3a')},'dialAMDMinWordLength':{'type':Sequelize[_0xa170('0x13')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xa170('0x3b')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xa170('0x23')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xa170('0x3c')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xa170('0x13')](0x9)[_0xa170('0x23')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xa170('0x3d')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xa170('0x13')](0x5)[_0xa170('0x23')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xa170('0x3e')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xa170('0x13')](0x9)[_0xa170('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0xa170('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0xa170('0x1c')],'defaultValue':0x0,'comment':_0xa170('0x3f')},'dialOrderByScheduledAt':{'type':Sequelize[_0xa170('0x6')](_0xa170('0x40'),_0xa170('0x41')),'defaultValue':_0xa170('0x40')},'dialQueueProject2':{'type':Sequelize[_0xa170('0x2')],'comment':_0xa170('0x42')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xa170('0x1c')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xa170('0x13')](0x3)[_0xa170('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa170('0x43')},'dialCutDigit':{'type':Sequelize[_0xa170('0x13')](0x3)[_0xa170('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa170('0x44')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xa170('0x13')](0x3)[_0xa170('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa170('0x45')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa170('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xa170('0x13')](0x3)[_0xa170('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xa170('0x13')](0x5)[_0xa170('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa170('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xa170('0x13')](0x3)[_0xa170('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xa170('0x13')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa170('0x47')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xa170('0x13')](0x5)[_0xa170('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa170('0x48')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0xa170('0x49')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x17a036){if(!_0x17a036)this[_0xa170('0xb')](_0xa170('0x4a'),null);this[_0xa170('0xb')](_0xa170('0x4b'),_0x17a036);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xa170('0x1c')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0xa170('0x13')](0x3)['UNSIGNED'],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xa170('0x1c')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 1d5ed04..b06f99d 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 _0x1cb9=['VoiceQueues','inbound','filter','ignore','map','value','includes','type','name','UserProfileResource','error','send','index','VoiceQueue','rawAttributes','fieldName','key','getOptions','where','count','include','query','rows','catch','params','keys','filters','intersection','attributes','model','fields','length','includeAll','merge','find','create','body','user','get','role','QueueCampaigns','outbound','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','getHoppers','CmHopper','nolimit','order','sort','pick','VoiceQueueId','findAll','getHopperHistories','findOne','CmHopperHistory','hasOwnProperty','getHopperFinals','CmHopperFinal','options','getHopperBlacks','CmHopperBlack','Team','getTeams','teams','online','voicePause','interface','flatMap','Agents','forEach','penalty','sequelize','transaction','TeamVoiceQueue','upsert','each','UserVoiceQueue','UserVoiceQueueRt','isNil','format','SIP/%s','userVoiceQueue:save','removeTeams','ids','User','select','field','tq.TeamId','team_has_voice_queues','join','user_has_teams','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','TeamId','all','union','isEmpty','removeAgents','addAgents','spread','emit','push','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','ContactId','phone','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','ListId','scheduledAt','cm_hopper_additional_phones','CmHopperId','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','moment','util','lodash','squel','ioredis','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','sendStatus','status','end','json','undefined','limit','offset','Content-Range','update','then','destroy'];(function(_0x1bc013,_0x7771c6){var _0x55df36=function(_0x1c02e0){while(--_0x1c02e0){_0x1bc013['push'](_0x1bc013['shift']());}};_0x55df36(++_0x7771c6);}(_0x1cb9,0x14e));var _0x91cb=function(_0x29b249,_0x2c73b1){_0x29b249=_0x29b249-0x0;var _0x5d5886=_0x1cb9[_0x29b249];return _0x5d5886;};'use strict';var moment=require(_0x91cb('0x0'));var BPromise=require('bluebird');var util=require(_0x91cb('0x1'));var _=require(_0x91cb('0x2'));var squel=require(_0x91cb('0x3'));var Redis=require(_0x91cb('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0x91cb('0x5'))(_0x91cb('0x6'));var config=require('../../config/environment');var db=require(_0x91cb('0x7'))['db'];config[_0x91cb('0x8')]=_[_0x91cb('0x9')](config[_0x91cb('0x8')],{'host':_0x91cb('0xa'),'port':0x18eb});var socket=require(_0x91cb('0xb'))(new Redis(config['redis']));require(_0x91cb('0xc'))['register'](socket);function respondWithStatusCode(_0x2fdfce,_0x4cf9ed){_0x4cf9ed=_0x4cf9ed||0xcc;return function(_0xa43e7a){if(_0xa43e7a){return _0x2fdfce[_0x91cb('0xd')](_0x4cf9ed);}return _0x2fdfce[_0x91cb('0xe')](_0x4cf9ed)[_0x91cb('0xf')]();};}function respondWithResult(_0x429928,_0x23ba9a){_0x23ba9a=_0x23ba9a||0xc8;return function(_0x21a0a5){if(_0x21a0a5){return _0x429928[_0x91cb('0xe')](_0x23ba9a)[_0x91cb('0x10')](_0x21a0a5);}};}function respondWithFilteredResult(_0x8c0097,_0x530d92){return function(_0x3c1f56){if(_0x3c1f56){var _0x366f09=typeof _0x530d92['offset']===_0x91cb('0x11')&&typeof _0x530d92[_0x91cb('0x12')]===_0x91cb('0x11');var _0x2c7d40=_0x3c1f56['count'];var _0x4cc6ef=_0x366f09?0x0:_0x530d92[_0x91cb('0x13')];var _0x3d22b7=_0x366f09?_0x3c1f56['count']:_0x530d92['offset']+_0x530d92[_0x91cb('0x12')];var _0xc3629e;if(_0x3d22b7>=_0x2c7d40){_0x3d22b7=_0x2c7d40;_0xc3629e=0xc8;}else{_0xc3629e=0xce;}_0x8c0097[_0x91cb('0xe')](_0xc3629e);return _0x8c0097['set'](_0x91cb('0x14'),_0x4cc6ef+'-'+_0x3d22b7+'/'+_0x2c7d40)[_0x91cb('0x10')](_0x3c1f56);}return null;};}function saveUpdates(_0x4f1554){return function(_0xc594e3){if(_0xc594e3){return _0xc594e3[_0x91cb('0x15')](_0x4f1554)[_0x91cb('0x16')](function(_0xcd1a78){return _0xcd1a78;});}return null;};}function removeEntity(_0x5cc1c3){return function(_0x3fba4f){if(_0x3fba4f){return _0x3fba4f[_0x91cb('0x17')]()['then'](function(){var _0x123847=_0x3fba4f['get']({'plain':!![]});var _0x55042a=[{'name':_0x91cb('0x18'),'value':_0x91cb('0x19'),'ignore':![]},{'name':'QueueCampaigns','value':'outbound','ignore':![]}];var _0x5b385a=_(_0x55042a)[_0x91cb('0x1a')](_0x91cb('0x1b'))[_0x91cb('0x1c')](_0x91cb('0x1d'))['value']();if(_[_0x91cb('0x1e')](_0x5b385a,_0x123847[_0x91cb('0x1f')])){return;}var _0x1fa837=_['find'](_0x55042a,[_0x91cb('0x1d'),_0x123847[_0x91cb('0x1f')]])[_0x91cb('0x20')];return db[_0x91cb('0x21')][_0x91cb('0x17')]({'where':{'type':_0x1fa837,'resourceId':_0x123847['id']}})[_0x91cb('0x16')](function(){return _0x3fba4f;});})[_0x91cb('0x16')](function(){_0x5cc1c3[_0x91cb('0xe')](0xcc)[_0x91cb('0xf')]();});}};}function handleEntityNotFound(_0x4c8438){return function(_0x59bf3a){if(!_0x59bf3a){_0x4c8438[_0x91cb('0xd')](0x194);}return _0x59bf3a;};}function handleError(_0x554350,_0x1c67d2){_0x1c67d2=_0x1c67d2||0x1f4;return function(_0x34d372){logger[_0x91cb('0x22')](_0x34d372['stack']);if(_0x34d372[_0x91cb('0x20')]){delete _0x34d372['name'];}_0x554350[_0x91cb('0xe')](_0x1c67d2)[_0x91cb('0x23')](_0x34d372);};}exports[_0x91cb('0x24')]=function(_0x2fb473,_0x468908){var _0x504275={};var _0x2f04a3={'count':0x0,'rows':[]};var _0x52670a=_[_0x91cb('0x1c')](db[_0x91cb('0x25')][_0x91cb('0x26')],function(_0x4944bd){return{'name':_0x4944bd[_0x91cb('0x27')],'type':_0x4944bd[_0x91cb('0x1f')][_0x91cb('0x28')]};});_0x504275=qs[_0x91cb('0x29')](_0x52670a,_0x2fb473);var _0xf296bc={'where':_0x504275[_0x91cb('0x2a')]};return db[_0x91cb('0x25')][_0x91cb('0x2b')](_0xf296bc)[_0x91cb('0x16')](function(_0x5e6ed3){_0x2f04a3[_0x91cb('0x2b')]=_0x5e6ed3;_0x504275[_0x91cb('0x2c')]=qs[_0x91cb('0x2c')](_0x2fb473[_0x91cb('0x2d')]);return db[_0x91cb('0x25')]['findAll'](_0x504275);})[_0x91cb('0x16')](function(_0x74b443){_0x2f04a3[_0x91cb('0x2e')]=_0x74b443;return _0x2f04a3;})[_0x91cb('0x16')](respondWithFilteredResult(_0x468908,_0x504275))[_0x91cb('0x2f')](handleError(_0x468908,null));};exports['show']=function(_0x121c37,_0x5927cb){var _0x47fc17={'raw':![],'where':{'id':_0x121c37[_0x91cb('0x30')]['id']}},_0x479968={};_0x479968['model']=_[_0x91cb('0x31')](db['VoiceQueue']['rawAttributes']);_0x479968[_0x91cb('0x2d')]=_[_0x91cb('0x31')](_0x121c37[_0x91cb('0x2d')]);_0x479968[_0x91cb('0x32')]=_[_0x91cb('0x33')](_0x479968['model'],_0x479968[_0x91cb('0x2d')]);_0x47fc17[_0x91cb('0x34')]=_[_0x91cb('0x33')](_0x479968[_0x91cb('0x35')],qs['fields'](_0x121c37['query'][_0x91cb('0x36')]));_0x47fc17[_0x91cb('0x34')]=_0x47fc17['attributes'][_0x91cb('0x37')]?_0x47fc17[_0x91cb('0x34')]:_0x479968['model'];if(_0x121c37[_0x91cb('0x2d')][_0x91cb('0x38')]){_0x47fc17['include']=[{'all':!![]}];}_0x47fc17=_[_0x91cb('0x39')]({},_0x47fc17,_0x121c37['options']);return db[_0x91cb('0x25')][_0x91cb('0x3a')](_0x47fc17)[_0x91cb('0x16')](handleEntityNotFound(_0x5927cb,null))[_0x91cb('0x16')](respondWithResult(_0x5927cb,null))[_0x91cb('0x2f')](handleError(_0x5927cb,null));};exports[_0x91cb('0x3b')]=function(_0x5d0e37,_0xa90111){return db[_0x91cb('0x25')]['create'](_0x5d0e37[_0x91cb('0x3c')],{})['then'](function(_0x2c6102){var _0x2eac87=_0x5d0e37[_0x91cb('0x3d')][_0x91cb('0x3e')]({'plain':!![]});if(!_0x2eac87)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2eac87[_0x91cb('0x3f')]===_0x91cb('0x3d')){var _0x2cf27e=_0x2c6102[_0x91cb('0x3e')]({'plain':!![]});var _0x42a7f3=[{'name':_0x91cb('0x18'),'value':_0x91cb('0x19')},{'name':_0x91cb('0x40'),'value':_0x91cb('0x41')}];var _0x3cc4c1=_['find'](_0x42a7f3,[_0x91cb('0x1d'),_0x2cf27e['type']])[_0x91cb('0x20')];return db['UserProfileSection'][_0x91cb('0x3a')]({'where':{'name':_0x3cc4c1,'userProfileId':_0x2eac87['userProfileId']},'raw':!![]})[_0x91cb('0x16')](function(_0x477131){if(_0x477131&&_0x477131[_0x91cb('0x42')]===0x0){return db[_0x91cb('0x21')]['create']({'name':_0x2cf27e[_0x91cb('0x20')],'resourceId':_0x2cf27e['id'],'type':_0x477131[_0x91cb('0x20')],'sectionId':_0x477131['id']},{})['then'](function(){return _0x2c6102;});}else{return _0x2c6102;}})[_0x91cb('0x2f')](function(_0x2f1749){logger[_0x91cb('0x22')](_0x91cb('0x43'),_0x2f1749);throw _0x2f1749;});}return _0x2c6102;})[_0x91cb('0x16')](respondWithResult(_0xa90111,0xc9))[_0x91cb('0x2f')](handleError(_0xa90111,null));};exports[_0x91cb('0x44')]=function(_0x29d5a1,_0x396b81){var _0x4b26f6={'where':{'id':_0x29d5a1[_0x91cb('0x30')]['id']}},_0x7c22b3={};_0x7c22b3[_0x91cb('0x35')]=_[_0x91cb('0x31')](db[_0x91cb('0x25')][_0x91cb('0x26')]);_0x4b26f6[_0x91cb('0x34')]=_[_0x91cb('0x33')](_0x7c22b3['model'],qs[_0x91cb('0x36')](_0x29d5a1[_0x91cb('0x2d')][_0x91cb('0x36')]));_0x4b26f6[_0x91cb('0x34')]=_0x4b26f6['attributes'][_0x91cb('0x37')]?_0x4b26f6[_0x91cb('0x34')]:_0x7c22b3['model'];if(_0x29d5a1[_0x91cb('0x2d')]['includeAll']){_0x4b26f6[_0x91cb('0x2c')]=[{'all':!![]}];}_0x4b26f6=_['merge']({},_0x4b26f6,_0x29d5a1['options']);return db['VoiceQueue'][_0x91cb('0x3a')](_0x4b26f6)[_0x91cb('0x16')](handleEntityNotFound(_0x396b81,null))[_0x91cb('0x16')](function(_0x2f8384){if(_0x2f8384){var _0x333814=_0x2f8384['get']({'plain':!![]});_0x333814=qs['omit'](_0x333814,['id',_0x91cb('0x45'),_0x91cb('0x46')]);_0x29d5a1[_0x91cb('0x3c')]=_[_0x91cb('0x47')](_0x29d5a1['body'],['id','createdAt','updatedAt']);return db[_0x91cb('0x25')]['create'](_[_0x91cb('0x39')](_0x333814,_0x29d5a1['body']),{'include':_0x29d5a1[_0x91cb('0x2d')][_0x91cb('0x38')]?[{'all':!![]}]:undefined})[_0x91cb('0x16')](function(_0x649976){var _0x1884bc=_0x29d5a1[_0x91cb('0x3d')][_0x91cb('0x3e')]({'plain':!![]});if(!_0x1884bc)throw new Error(_0x91cb('0x48'));if(_0x1884bc[_0x91cb('0x3f')]===_0x91cb('0x3d')){var _0xd8f7c2=_0x649976['get']({'plain':!![]});var _0x1e445a=[{'name':_0x91cb('0x18'),'value':'inbound'},{'name':_0x91cb('0x40'),'value':_0x91cb('0x41')}];var _0x4bab7d=_[_0x91cb('0x3a')](_0x1e445a,[_0x91cb('0x1d'),_0xd8f7c2[_0x91cb('0x1f')]])[_0x91cb('0x20')];return db[_0x91cb('0x49')][_0x91cb('0x3a')]({'where':{'name':_0x4bab7d,'userProfileId':_0x1884bc[_0x91cb('0x4a')]},'raw':!![]})[_0x91cb('0x16')](function(_0x3320bd){if(_0x3320bd&&_0x3320bd[_0x91cb('0x42')]===0x0){return db[_0x91cb('0x21')]['create']({'name':_0xd8f7c2[_0x91cb('0x20')],'resourceId':_0xd8f7c2['id'],'type':_0x3320bd['name'],'sectionId':_0x3320bd['id']},{})[_0x91cb('0x16')](function(){return _0x649976;});}else{return _0x649976;}})['catch'](function(_0x3dfff9){logger[_0x91cb('0x22')](_0x91cb('0x43'),_0x3dfff9);throw _0x3dfff9;});}return _0x649976;});}})['then'](respondWithResult(_0x396b81,0xc9))[_0x91cb('0x2f')](handleError(_0x396b81,null));};exports[_0x91cb('0x15')]=function(_0x48dcf7,_0xef4754){if(_0x48dcf7[_0x91cb('0x3c')]['id']){delete _0x48dcf7[_0x91cb('0x3c')]['id'];}return db[_0x91cb('0x25')]['find']({'where':{'id':_0x48dcf7[_0x91cb('0x30')]['id']}})[_0x91cb('0x16')](handleEntityNotFound(_0xef4754,null))[_0x91cb('0x16')](saveUpdates(_0x48dcf7[_0x91cb('0x3c')],null))['then'](respondWithResult(_0xef4754,null))[_0x91cb('0x2f')](handleError(_0xef4754,null));};exports[_0x91cb('0x17')]=function(_0x5c2c01,_0x492b09){return db[_0x91cb('0x25')]['find']({'where':{'id':_0x5c2c01[_0x91cb('0x30')]['id']}})[_0x91cb('0x16')](handleEntityNotFound(_0x492b09,null))['then'](removeEntity(_0x492b09,null))['catch'](handleError(_0x492b09,null));};exports[_0x91cb('0x4b')]=function(_0x5c468a,_0x1b69ce){var _0x961ebf={'raw':![],'where':{}};var _0x33de58={};var _0x551836={'count':0x0,'rows':[]};return db[_0x91cb('0x25')]['findOne']({'where':{'id':_0x5c468a[_0x91cb('0x30')]['id']}})[_0x91cb('0x16')](handleEntityNotFound(_0x1b69ce,null))[_0x91cb('0x16')](function(_0x2c1911){if(_0x2c1911){_0x33de58['model']=_[_0x91cb('0x31')](db[_0x91cb('0x4c')][_0x91cb('0x26')]);_0x33de58[_0x91cb('0x2d')]=_[_0x91cb('0x31')](_0x5c468a[_0x91cb('0x2d')]);_0x33de58[_0x91cb('0x32')]=_[_0x91cb('0x33')](_0x33de58[_0x91cb('0x35')],_0x33de58[_0x91cb('0x2d')]);_0x961ebf[_0x91cb('0x34')]=_[_0x91cb('0x33')](_0x33de58['model'],qs[_0x91cb('0x36')](_0x5c468a[_0x91cb('0x2d')][_0x91cb('0x36')]));_0x961ebf[_0x91cb('0x34')]=_0x961ebf[_0x91cb('0x34')][_0x91cb('0x37')]?_0x961ebf[_0x91cb('0x34')]:_0x33de58['model'];if(!_0x5c468a[_0x91cb('0x2d')]['hasOwnProperty'](_0x91cb('0x4d'))){_0x961ebf[_0x91cb('0x12')]=qs[_0x91cb('0x12')](_0x5c468a[_0x91cb('0x2d')]['limit']);_0x961ebf[_0x91cb('0x13')]=qs[_0x91cb('0x13')](_0x5c468a[_0x91cb('0x2d')][_0x91cb('0x13')]);}_0x961ebf[_0x91cb('0x4e')]=qs[_0x91cb('0x4f')](_0x5c468a['query'][_0x91cb('0x4f')]);_0x961ebf[_0x91cb('0x2a')]=qs[_0x91cb('0x32')](_[_0x91cb('0x50')](_0x5c468a[_0x91cb('0x2d')],_0x33de58[_0x91cb('0x32')]));_0x961ebf[_0x91cb('0x2a')][_0x91cb('0x51')]=_0x2c1911['id'];if(_0x5c468a[_0x91cb('0x2d')][_0x91cb('0x1a')]){_0x961ebf[_0x91cb('0x2a')]=_[_0x91cb('0x39')](_0x961ebf[_0x91cb('0x2a')],{'$or':_[_0x91cb('0x1c')](_0x961ebf[_0x91cb('0x34')],function(_0x2605c3){var _0x1d9ded={};_0x1d9ded[_0x2605c3]={'$like':'%'+_0x5c468a['query'][_0x91cb('0x1a')]+'%'};return _0x1d9ded;})});}_0x961ebf=_[_0x91cb('0x39')]({},_0x961ebf,_0x5c468a['options']);return db[_0x91cb('0x4c')][_0x91cb('0x2b')]({'where':_0x961ebf[_0x91cb('0x2a')]})['then'](function(_0x45e26b){_0x551836[_0x91cb('0x2b')]=_0x45e26b;if(_0x5c468a['query']['includeAll']){_0x961ebf[_0x91cb('0x2c')]=[{'all':!![]}];}return db['CmHopper'][_0x91cb('0x52')](_0x961ebf);})[_0x91cb('0x16')](function(_0x4e11e3){_0x551836[_0x91cb('0x2e')]=_0x4e11e3;return _0x551836;});}})['then'](respondWithFilteredResult(_0x1b69ce,_0x961ebf))[_0x91cb('0x2f')](handleError(_0x1b69ce,null));};exports[_0x91cb('0x53')]=function(_0x4f827e,_0x5d8a7e){var _0x16a21f={'raw':!![],'where':{}};var _0x43be3e={};var _0x37666a={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x91cb('0x54')]({'where':{'id':_0x4f827e[_0x91cb('0x30')]['id']}})[_0x91cb('0x16')](handleEntityNotFound(_0x5d8a7e,null))[_0x91cb('0x16')](function(_0x570f6b){if(_0x570f6b){_0x43be3e[_0x91cb('0x35')]=_['keys'](db[_0x91cb('0x55')][_0x91cb('0x26')]);_0x43be3e[_0x91cb('0x2d')]=_[_0x91cb('0x31')](_0x4f827e['query']);_0x43be3e['filters']=_[_0x91cb('0x33')](_0x43be3e['model'],_0x43be3e[_0x91cb('0x2d')]);_0x16a21f[_0x91cb('0x34')]=_[_0x91cb('0x33')](_0x43be3e[_0x91cb('0x35')],qs[_0x91cb('0x36')](_0x4f827e[_0x91cb('0x2d')][_0x91cb('0x36')]));_0x16a21f['attributes']=_0x16a21f[_0x91cb('0x34')][_0x91cb('0x37')]?_0x16a21f['attributes']:_0x43be3e[_0x91cb('0x35')];if(!_0x4f827e['query'][_0x91cb('0x56')](_0x91cb('0x4d'))){_0x16a21f[_0x91cb('0x12')]=qs[_0x91cb('0x12')](_0x4f827e[_0x91cb('0x2d')][_0x91cb('0x12')]);_0x16a21f[_0x91cb('0x13')]=qs[_0x91cb('0x13')](_0x4f827e[_0x91cb('0x2d')][_0x91cb('0x13')]);}_0x16a21f[_0x91cb('0x4e')]=qs[_0x91cb('0x4f')](_0x4f827e[_0x91cb('0x2d')][_0x91cb('0x4f')]);_0x16a21f[_0x91cb('0x2a')]=qs[_0x91cb('0x32')](_['pick'](_0x4f827e[_0x91cb('0x2d')],_0x43be3e['filters']));_0x16a21f[_0x91cb('0x2a')][_0x91cb('0x51')]=_0x570f6b['id'];if(_0x4f827e[_0x91cb('0x2d')][_0x91cb('0x1a')]){_0x16a21f[_0x91cb('0x2a')]=_[_0x91cb('0x39')](_0x16a21f[_0x91cb('0x2a')],{'$or':_[_0x91cb('0x1c')](_0x16a21f['attributes'],function(_0xb5c264){var _0xdee7f={};_0xdee7f[_0xb5c264]={'$like':'%'+_0x4f827e['query']['filter']+'%'};return _0xdee7f;})});}_0x16a21f=_[_0x91cb('0x39')]({},_0x16a21f,_0x4f827e['options']);return db['CmHopperHistory'][_0x91cb('0x2b')]({'where':_0x16a21f['where']})[_0x91cb('0x16')](function(_0x498382){_0x37666a[_0x91cb('0x2b')]=_0x498382;if(_0x4f827e[_0x91cb('0x2d')][_0x91cb('0x38')]){_0x16a21f[_0x91cb('0x2c')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x91cb('0x52')](_0x16a21f);})[_0x91cb('0x16')](function(_0x42d07b){_0x37666a[_0x91cb('0x2e')]=_0x42d07b;return _0x37666a;});}})[_0x91cb('0x16')](respondWithFilteredResult(_0x5d8a7e,_0x16a21f))[_0x91cb('0x2f')](handleError(_0x5d8a7e,null));};exports[_0x91cb('0x57')]=function(_0x3cf8c5,_0x21dfd3){var _0x24facc={'raw':!![],'where':{}};var _0xafda63={};var _0x32704d={'count':0x0,'rows':[]};return db[_0x91cb('0x25')][_0x91cb('0x54')]({'where':{'id':_0x3cf8c5[_0x91cb('0x30')]['id']}})[_0x91cb('0x16')](handleEntityNotFound(_0x21dfd3,null))[_0x91cb('0x16')](function(_0x39fce4){if(_0x39fce4){_0xafda63[_0x91cb('0x35')]=_[_0x91cb('0x31')](db[_0x91cb('0x58')][_0x91cb('0x26')]);_0xafda63[_0x91cb('0x2d')]=_[_0x91cb('0x31')](_0x3cf8c5[_0x91cb('0x2d')]);_0xafda63['filters']=_[_0x91cb('0x33')](_0xafda63[_0x91cb('0x35')],_0xafda63[_0x91cb('0x2d')]);_0x24facc[_0x91cb('0x34')]=_[_0x91cb('0x33')](_0xafda63[_0x91cb('0x35')],qs[_0x91cb('0x36')](_0x3cf8c5[_0x91cb('0x2d')][_0x91cb('0x36')]));_0x24facc[_0x91cb('0x34')]=_0x24facc[_0x91cb('0x34')]['length']?_0x24facc[_0x91cb('0x34')]:_0xafda63['model'];if(!_0x3cf8c5['query'][_0x91cb('0x56')](_0x91cb('0x4d'))){_0x24facc[_0x91cb('0x12')]=qs[_0x91cb('0x12')](_0x3cf8c5[_0x91cb('0x2d')][_0x91cb('0x12')]);_0x24facc[_0x91cb('0x13')]=qs[_0x91cb('0x13')](_0x3cf8c5[_0x91cb('0x2d')][_0x91cb('0x13')]);}_0x24facc['order']=qs[_0x91cb('0x4f')](_0x3cf8c5[_0x91cb('0x2d')]['sort']);_0x24facc[_0x91cb('0x2a')]=qs[_0x91cb('0x32')](_['pick'](_0x3cf8c5[_0x91cb('0x2d')],_0xafda63[_0x91cb('0x32')]));_0x24facc[_0x91cb('0x2a')][_0x91cb('0x51')]=_0x39fce4['id'];if(_0x3cf8c5[_0x91cb('0x2d')][_0x91cb('0x1a')]){_0x24facc[_0x91cb('0x2a')]=_[_0x91cb('0x39')](_0x24facc[_0x91cb('0x2a')],{'$or':_[_0x91cb('0x1c')](_0x24facc[_0x91cb('0x34')],function(_0x378cd0){var _0x538a8c={};_0x538a8c[_0x378cd0]={'$like':'%'+_0x3cf8c5['query'][_0x91cb('0x1a')]+'%'};return _0x538a8c;})});}_0x24facc=_[_0x91cb('0x39')]({},_0x24facc,_0x3cf8c5[_0x91cb('0x59')]);return db[_0x91cb('0x58')][_0x91cb('0x2b')]({'where':_0x24facc[_0x91cb('0x2a')]})[_0x91cb('0x16')](function(_0x5ac5cc){_0x32704d[_0x91cb('0x2b')]=_0x5ac5cc;if(_0x3cf8c5['query'][_0x91cb('0x38')]){_0x24facc[_0x91cb('0x2c')]=[{'all':!![]}];}return db[_0x91cb('0x58')][_0x91cb('0x52')](_0x24facc);})[_0x91cb('0x16')](function(_0x4ac4dd){_0x32704d[_0x91cb('0x2e')]=_0x4ac4dd;return _0x32704d;});}})[_0x91cb('0x16')](respondWithFilteredResult(_0x21dfd3,_0x24facc))[_0x91cb('0x2f')](handleError(_0x21dfd3,null));};exports[_0x91cb('0x5a')]=function(_0x3a213e,_0x4e4003){var _0x4003c9={'raw':!![],'where':{}};var _0x9cff8f={};var _0x25a779={'count':0x0,'rows':[]};return db[_0x91cb('0x25')]['findOne']({'where':{'id':_0x3a213e['params']['id']}})['then'](handleEntityNotFound(_0x4e4003,null))[_0x91cb('0x16')](function(_0x182aa5){if(_0x182aa5){_0x9cff8f[_0x91cb('0x35')]=_[_0x91cb('0x31')](db['CmHopperBlack'][_0x91cb('0x26')]);_0x9cff8f[_0x91cb('0x2d')]=_[_0x91cb('0x31')](_0x3a213e[_0x91cb('0x2d')]);_0x9cff8f['filters']=_['intersection'](_0x9cff8f[_0x91cb('0x35')],_0x9cff8f[_0x91cb('0x2d')]);_0x4003c9[_0x91cb('0x34')]=_[_0x91cb('0x33')](_0x9cff8f[_0x91cb('0x35')],qs[_0x91cb('0x36')](_0x3a213e[_0x91cb('0x2d')][_0x91cb('0x36')]));_0x4003c9[_0x91cb('0x34')]=_0x4003c9[_0x91cb('0x34')][_0x91cb('0x37')]?_0x4003c9[_0x91cb('0x34')]:_0x9cff8f[_0x91cb('0x35')];if(!_0x3a213e['query']['hasOwnProperty'](_0x91cb('0x4d'))){_0x4003c9['limit']=qs[_0x91cb('0x12')](_0x3a213e[_0x91cb('0x2d')][_0x91cb('0x12')]);_0x4003c9[_0x91cb('0x13')]=qs[_0x91cb('0x13')](_0x3a213e[_0x91cb('0x2d')][_0x91cb('0x13')]);}_0x4003c9[_0x91cb('0x4e')]=qs['sort'](_0x3a213e[_0x91cb('0x2d')][_0x91cb('0x4f')]);_0x4003c9[_0x91cb('0x2a')]=qs[_0x91cb('0x32')](_[_0x91cb('0x50')](_0x3a213e['query'],_0x9cff8f[_0x91cb('0x32')]));_0x4003c9[_0x91cb('0x2a')][_0x91cb('0x51')]=_0x182aa5['id'];if(_0x3a213e[_0x91cb('0x2d')][_0x91cb('0x1a')]){_0x4003c9['where']=_[_0x91cb('0x39')](_0x4003c9[_0x91cb('0x2a')],{'$or':_[_0x91cb('0x1c')](_0x4003c9[_0x91cb('0x34')],function(_0x440ef4){var _0x2c2ed8={};_0x2c2ed8[_0x440ef4]={'$like':'%'+_0x3a213e[_0x91cb('0x2d')][_0x91cb('0x1a')]+'%'};return _0x2c2ed8;})});}_0x4003c9=_[_0x91cb('0x39')]({},_0x4003c9,_0x3a213e[_0x91cb('0x59')]);return db[_0x91cb('0x5b')][_0x91cb('0x2b')]({'where':_0x4003c9[_0x91cb('0x2a')]})[_0x91cb('0x16')](function(_0x7c84fc){_0x25a779[_0x91cb('0x2b')]=_0x7c84fc;if(_0x3a213e[_0x91cb('0x2d')][_0x91cb('0x38')]){_0x4003c9[_0x91cb('0x2c')]=[{'all':!![]}];}return db[_0x91cb('0x5b')][_0x91cb('0x52')](_0x4003c9);})[_0x91cb('0x16')](function(_0x275c80){_0x25a779[_0x91cb('0x2e')]=_0x275c80;return _0x25a779;});}})[_0x91cb('0x16')](respondWithFilteredResult(_0x4e4003,_0x4003c9))[_0x91cb('0x2f')](handleError(_0x4e4003,null));};exports['getTeams']=function(_0x16cf02,_0x2b8634){var _0x1eb46e={};var _0x261a3a={};var _0x16f334;var _0x5ca377;return db['VoiceQueue']['findOne']({'where':{'id':_0x16cf02['params']['id']}})['then'](handleEntityNotFound(_0x2b8634,null))[_0x91cb('0x16')](function(_0x46a6cc){if(_0x46a6cc){_0x16f334=_0x46a6cc;_0x261a3a[_0x91cb('0x35')]=_[_0x91cb('0x31')](db[_0x91cb('0x5c')][_0x91cb('0x26')]);_0x261a3a[_0x91cb('0x2d')]=_[_0x91cb('0x31')](_0x16cf02[_0x91cb('0x2d')]);_0x261a3a[_0x91cb('0x32')]=_['intersection'](_0x261a3a[_0x91cb('0x35')],_0x261a3a[_0x91cb('0x2d')]);_0x1eb46e['attributes']=_[_0x91cb('0x33')](_0x261a3a[_0x91cb('0x35')],qs[_0x91cb('0x36')](_0x16cf02[_0x91cb('0x2d')][_0x91cb('0x36')]));_0x1eb46e[_0x91cb('0x34')]=_0x1eb46e[_0x91cb('0x34')]['length']?_0x1eb46e[_0x91cb('0x34')]:_0x261a3a[_0x91cb('0x35')];_0x1eb46e[_0x91cb('0x4e')]=qs[_0x91cb('0x4f')](_0x16cf02[_0x91cb('0x2d')][_0x91cb('0x4f')]);_0x1eb46e[_0x91cb('0x2a')]=qs['filters'](_[_0x91cb('0x50')](_0x16cf02['query'],_0x261a3a[_0x91cb('0x32')]));if(_0x16cf02[_0x91cb('0x2d')][_0x91cb('0x1a')]){_0x1eb46e[_0x91cb('0x2a')]=_[_0x91cb('0x39')](_0x1eb46e[_0x91cb('0x2a')],{'$or':_[_0x91cb('0x1c')](_0x1eb46e[_0x91cb('0x34')],function(_0x1c7c10){var _0x570cf0={};_0x570cf0[_0x1c7c10]={'$like':'%'+_0x16cf02[_0x91cb('0x2d')][_0x91cb('0x1a')]+'%'};return _0x570cf0;})});}_0x1eb46e=_[_0x91cb('0x39')]({},_0x1eb46e,_0x16cf02[_0x91cb('0x59')]);return _0x16f334[_0x91cb('0x5d')](_0x1eb46e);}})[_0x91cb('0x16')](function(_0x189a87){if(_0x189a87){_0x5ca377=_0x189a87[_0x91cb('0x37')];if(!_0x16cf02[_0x91cb('0x2d')][_0x91cb('0x56')](_0x91cb('0x4d'))){_0x1eb46e[_0x91cb('0x12')]=qs[_0x91cb('0x12')](_0x16cf02['query'][_0x91cb('0x12')]);_0x1eb46e['offset']=qs[_0x91cb('0x13')](_0x16cf02[_0x91cb('0x2d')][_0x91cb('0x13')]);}return _0x16f334[_0x91cb('0x5d')](_0x1eb46e);}})[_0x91cb('0x16')](function(_0x12da14){if(_0x12da14){return _0x12da14?{'count':_0x5ca377,'rows':_0x12da14}:null;}})[_0x91cb('0x16')](respondWithResult(_0x2b8634,null))[_0x91cb('0x2f')](handleError(_0x2b8634,null));};exports['addTeams']=function(_0x3353bf,_0x5b3658){var _0x3c1703=_0x3353bf[_0x91cb('0x3c')][_0x91cb('0x5e')];var _0x598663=_[_0x91cb('0x1c')](_0x3c1703,'id');return db[_0x91cb('0x5c')][_0x91cb('0x52')]({'where':{'id':_0x598663},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name',_0x91cb('0x5f'),_0x91cb('0x60'),_0x91cb('0x61')],'raw':!![]}]})['then'](function(_0x469e62){if(_0x469e62){var _0x1e9441=_[_0x91cb('0x62')](_0x469e62,function(_0x1bb2de){var _0x129ea0=_0x1bb2de[_0x91cb('0x3e')]({'plain':!![]});_0x129ea0[_0x91cb('0x63')][_0x91cb('0x64')](function(_0x50b8d6){_0x50b8d6[_0x91cb('0x65')]=_[_0x91cb('0x3a')](_0x3c1703,{'id':_0x129ea0['id']})[_0x91cb('0x65')];});return _0x129ea0[_0x91cb('0x63')];});return db['VoiceQueue'][_0x91cb('0x3a')]({'where':{'id':_0x3353bf['params']['id']}})[_0x91cb('0x16')](function(_0x43b620){return db[_0x91cb('0x66')][_0x91cb('0x67')](function(_0x3b0bd5){return _0x43b620['addTeams'](_0x598663,{'transaction':_0x3b0bd5})[_0x91cb('0x16')](function(){return BPromise['each'](_0x3c1703,function(_0x58608e){return db[_0x91cb('0x68')][_0x91cb('0x69')]({'TeamId':_0x58608e['id'],'VoiceQueueId':_0x3353bf[_0x91cb('0x30')]['id'],'penalty':_0x58608e[_0x91cb('0x65')]},{'transaction':_0x3b0bd5});});})[_0x91cb('0x16')](function(){return BPromise[_0x91cb('0x6a')](_0x1e9441,function(_0x20ef3d){return db[_0x91cb('0x6b')]['findOrCreate']({'where':{'UserId':_0x20ef3d['id'],'VoiceQueueId':_0x3353bf[_0x91cb('0x30')]['id']},'defaults':{'penalty':_0x20ef3d[_0x91cb('0x65')]},'transaction':_0x3b0bd5});});})[_0x91cb('0x16')](function(){return BPromise['each'](_['filter'](_0x1e9441,{'online':!![]}),function(_0x530565){return db[_0x91cb('0x6c')][_0x91cb('0x69')]({'membername':_0x530565[_0x91cb('0x20')],'UserId':_0x530565['id'],'queue_name':_0x43b620['name'],'VoiceQueueId':_0x43b620['id'],'interface':_[_0x91cb('0x6d')](_0x530565[_0x91cb('0x61')])?util[_0x91cb('0x6e')](_0x91cb('0x6f'),_0x530565['name']):_0x530565[_0x91cb('0x61')],'paused':_0x530565[_0x91cb('0x60')]||![],'penalty':_0x530565[_0x91cb('0x65')]},{'transaction':_0x3b0bd5});});})[_0x91cb('0x16')](function(){_0x1e9441[_0x91cb('0x64')](function(_0x3c788e){socket['emit'](_0x91cb('0x70'),{'UserId':_0x3c788e['id'],'VoiceQueueId':_0x43b620['id']});});});});});}})[_0x91cb('0x16')](respondWithStatusCode(_0x5b3658,null))[_0x91cb('0x2f')](handleError(_0x5b3658,null));};exports[_0x91cb('0x71')]=function(_0x3782cd,_0x4b290e){return db[_0x91cb('0x5c')][_0x91cb('0x52')]({'where':{'id':_0x3782cd[_0x91cb('0x2d')][_0x91cb('0x72')]},'attributes':['id'],'include':[{'model':db[_0x91cb('0x73')],'as':_0x91cb('0x63'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4b290e,null))[_0x91cb('0x16')](function(_0x2bafae){var _0x27472a=_['map'](_0x2bafae,'id');var _0x59cb69=[];var _0x5d0f96=[];var _0x174325=squel[_0x91cb('0x74')]();_0x174325[_0x91cb('0x75')](_0x91cb('0x76'))['from'](_0x91cb('0x77'),'tq')[_0x91cb('0x78')](_0x91cb('0x79'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x91cb('0x2a')]('VoiceQueueId\x20=\x20?',_0x3782cd[_0x91cb('0x30')]['id']);for(var _0x43b2e7=0x0;_0x43b2e7<_0x2bafae['length'];_0x43b2e7+=0x1){let _0x1b47fe=_0x2bafae[_0x43b2e7];for(var _0x1853de=0x0;_0x1853de<_0x1b47fe[_0x91cb('0x63')][_0x91cb('0x37')];_0x1853de+=0x1){let _0x376426=_0x1b47fe['Agents'][_0x1853de];var _0x22a6e6=_0x174325[_0x91cb('0x44')]();_0x22a6e6[_0x91cb('0x2a')](_0x91cb('0x7a'),_0x376426['id']);_0x5d0f96['push'](db[_0x91cb('0x66')]['query'](_0x22a6e6['toString'](),{'type':db['sequelize'][_0x91cb('0x7b')][_0x91cb('0x7c')]})[_0x91cb('0x16')](function(_0x4972c3){if(_0x4972c3[_0x91cb('0x37')]===0x1){return _0x376426['id'];}else{var _0x53dbb2=_[_0x91cb('0x7d')](_[_0x91cb('0x1c')](_0x4972c3,_0x91cb('0x7e')),function(_0x2a2a71){return _[_0x91cb('0x1e')](_0x27472a,_0x2a2a71);});if(_0x53dbb2){return _0x376426['id'];}}}));}}return BPromise[_0x91cb('0x7f')](_0x5d0f96)['then'](function(_0x5bfd2c){_0x59cb69=_(_0x59cb69)[_0x91cb('0x80')](_0x5bfd2c)['compact']()[_0x91cb('0x1d')]();return db[_0x91cb('0x25')][_0x91cb('0x3a')]({'where':{'id':_0x3782cd[_0x91cb('0x30')]['id']}})[_0x91cb('0x16')](function(_0x51d431){return db[_0x91cb('0x66')][_0x91cb('0x67')](function(_0x18ec67){return _0x51d431['removeTeams'](_0x3782cd[_0x91cb('0x2d')][_0x91cb('0x72')],{'transaction':_0x18ec67})['then'](function(){if(!_[_0x91cb('0x81')](_0x59cb69)){return _0x51d431[_0x91cb('0x82')](_0x59cb69,{'transaction':_0x18ec67})[_0x91cb('0x16')](function(){return db[_0x91cb('0x6c')][_0x91cb('0x17')]({'where':{'VoiceQueueId':_0x3782cd[_0x91cb('0x30')]['id'],'UserId':_0x59cb69},'transaction':_0x18ec67});});}})['then'](function(){_0x59cb69[_0x91cb('0x64')](function(_0x5da781){socket['emit']('userVoiceQueue:remove',{'UserId':_0x5da781,'VoiceQueueId':_0x51d431['id']});});});});});});})[_0x91cb('0x16')](respondWithStatusCode(_0x4b290e,null))['catch'](handleError(_0x4b290e,null));};exports['addAgents']=function(_0x3c0211,_0x3710e9){var _0x395e21,_0x52b9af;return db['VoiceQueue'][_0x91cb('0x3a')]({'where':{'id':_0x3c0211[_0x91cb('0x30')]['id']}})['then'](handleEntityNotFound(_0x3710e9,null))[_0x91cb('0x16')](function(_0x3280a5){if(_0x3280a5){_0x52b9af=_0x3280a5;return _0x3280a5[_0x91cb('0x83')](_0x3c0211[_0x91cb('0x3c')][_0x91cb('0x72')],_['omit'](_0x3c0211['body'],[_0x91cb('0x72'),'id'])||{})[_0x91cb('0x84')](function(_0x547b4d){for(var _0x1aef0b=0x0;_0x1aef0b<_0x3c0211[_0x91cb('0x3c')][_0x91cb('0x72')][_0x91cb('0x37')];_0x1aef0b+=0x1){socket[_0x91cb('0x85')]('userVoiceQueue:save',{'UserId':Number(_0x3c0211[_0x91cb('0x3c')][_0x91cb('0x72')][_0x1aef0b]),'VoiceQueueId':Number(_0x3c0211[_0x91cb('0x30')]['id'])});}return _0x547b4d;});}})['then'](function(_0x4ba088){_0x395e21=_0x4ba088||[];if(_0x52b9af){return db[_0x91cb('0x73')][_0x91cb('0x52')]({'where':{'id':_0x3c0211[_0x91cb('0x3c')][_0x91cb('0x72')]},'attributes':['id',_0x91cb('0x20'),_0x91cb('0x5f'),_0x91cb('0x60'),_0x91cb('0x61')],'raw':!![]});}})['then'](function(_0x33b7a7){if(!_[_0x91cb('0x81')](_0x33b7a7)){var _0x4ac7b9=[];for(var _0x41c3ff=0x0;_0x41c3ff<_0x33b7a7[_0x91cb('0x37')];_0x41c3ff++){if(_0x33b7a7[_0x41c3ff]['online']){_0x4ac7b9[_0x91cb('0x86')](db[_0x91cb('0x6c')][_0x91cb('0x69')]({'membername':_0x33b7a7[_0x41c3ff][_0x91cb('0x20')],'UserId':_0x33b7a7[_0x41c3ff]['id'],'queue_name':_0x52b9af[_0x91cb('0x20')],'VoiceQueueId':_0x52b9af['id'],'interface':_['isNil'](_0x33b7a7[_0x41c3ff][_0x91cb('0x61')])?util[_0x91cb('0x6e')](_0x91cb('0x6f'),_0x33b7a7[_0x41c3ff][_0x91cb('0x20')]):_0x33b7a7[_0x41c3ff]['interface'],'paused':_0x33b7a7[_0x41c3ff][_0x91cb('0x60')]||![],'penalty':_0x3c0211['body'][_0x91cb('0x65')]||0x0}));}}return BPromise[_0x91cb('0x7f')](_0x4ac7b9);}})[_0x91cb('0x16')](function(){return _0x395e21;})[_0x91cb('0x16')](respondWithResult(_0x3710e9,null))[_0x91cb('0x2f')](handleError(_0x3710e9,null));};exports[_0x91cb('0x82')]=function(_0xd572bc,_0x1e7a48){return db[_0x91cb('0x25')]['find']({'where':{'id':_0xd572bc[_0x91cb('0x30')]['id']}})[_0x91cb('0x16')](handleEntityNotFound(_0x1e7a48,null))[_0x91cb('0x16')](function(_0x51ef1c){if(_0x51ef1c){return _0x51ef1c[_0x91cb('0x82')](_0xd572bc['query'][_0x91cb('0x72')])['then'](function(){if(_[_0x91cb('0x87')](_0xd572bc[_0x91cb('0x2d')][_0x91cb('0x72')])){for(var _0x10fe63=0x0;_0x10fe63<_0xd572bc[_0x91cb('0x2d')][_0x91cb('0x72')][_0x91cb('0x37')];_0x10fe63+=0x1){socket['emit'](_0x91cb('0x88'),{'UserId':Number(_0xd572bc[_0x91cb('0x2d')][_0x91cb('0x72')][_0x10fe63]),'VoiceQueueId':Number(_0xd572bc[_0x91cb('0x30')]['id'])});}}else{socket[_0x91cb('0x85')](_0x91cb('0x88'),{'UserId':Number(_0xd572bc[_0x91cb('0x2d')]['ids']),'VoiceQueueId':Number(_0xd572bc[_0x91cb('0x30')]['id'])});}});}})[_0x91cb('0x16')](function(_0x219b5f){return db[_0x91cb('0x6c')][_0x91cb('0x17')]({'where':{'VoiceQueueId':_0xd572bc['params']['id'],'UserId':_0xd572bc['query']['ids']}})[_0x91cb('0x16')](function(){return _0x219b5f;});})[_0x91cb('0x16')](respondWithStatusCode(_0x1e7a48,null))['catch'](handleError(_0x1e7a48,null));};exports['getAgents']=function(_0x471c17,_0x6549a7){var _0x13564d={};var _0x3c1e63={};var _0x1f2d72;var _0x376adc;return db[_0x91cb('0x25')][_0x91cb('0x54')]({'where':{'id':_0x471c17['params']['id']}})[_0x91cb('0x16')](handleEntityNotFound(_0x6549a7,null))[_0x91cb('0x16')](function(_0xf15400){if(_0xf15400){_0x1f2d72=_0xf15400;_0x3c1e63['model']=_[_0x91cb('0x31')](db[_0x91cb('0x73')][_0x91cb('0x26')]);_0x3c1e63[_0x91cb('0x2d')]=_[_0x91cb('0x31')](_0x471c17[_0x91cb('0x2d')]);_0x3c1e63[_0x91cb('0x32')]=_[_0x91cb('0x33')](_0x3c1e63['model'],_0x3c1e63['query']);_0x13564d[_0x91cb('0x34')]=_['intersection'](_0x3c1e63[_0x91cb('0x35')],qs[_0x91cb('0x36')](_0x471c17[_0x91cb('0x2d')][_0x91cb('0x36')]));_0x13564d['attributes']=_0x13564d[_0x91cb('0x34')][_0x91cb('0x37')]?_0x13564d[_0x91cb('0x34')]:_0x3c1e63[_0x91cb('0x35')];_0x13564d[_0x91cb('0x4e')]=qs[_0x91cb('0x4f')](_0x471c17[_0x91cb('0x2d')][_0x91cb('0x4f')]);_0x13564d['where']=qs[_0x91cb('0x32')](_['pick'](_0x471c17[_0x91cb('0x2d')],_0x3c1e63[_0x91cb('0x32')]));if(_0x471c17['query'][_0x91cb('0x1a')]){_0x13564d[_0x91cb('0x2a')]=_[_0x91cb('0x39')](_0x13564d[_0x91cb('0x2a')],{'$or':_['map'](_0x13564d[_0x91cb('0x34')],function(_0x1bef2b){var _0x5a38f7={};_0x5a38f7[_0x1bef2b]={'$like':'%'+_0x471c17[_0x91cb('0x2d')][_0x91cb('0x1a')]+'%'};return _0x5a38f7;})});}_0x13564d=_[_0x91cb('0x39')]({},_0x13564d,_0x471c17[_0x91cb('0x59')]);return _0x1f2d72[_0x91cb('0x89')](_0x13564d);}})[_0x91cb('0x16')](function(_0x2f42ef){if(_0x2f42ef){_0x376adc=_0x2f42ef[_0x91cb('0x37')];if(!_0x471c17[_0x91cb('0x2d')][_0x91cb('0x56')]('nolimit')){_0x13564d[_0x91cb('0x12')]=qs[_0x91cb('0x12')](_0x471c17[_0x91cb('0x2d')][_0x91cb('0x12')]);_0x13564d[_0x91cb('0x13')]=qs[_0x91cb('0x13')](_0x471c17[_0x91cb('0x2d')][_0x91cb('0x13')]);}return _0x1f2d72[_0x91cb('0x89')](_0x13564d);}})[_0x91cb('0x16')](function(_0x31cf76){if(_0x31cf76){return _0x31cf76?{'count':_0x376adc,'rows':_0x31cf76}:null;}})['then'](respondWithResult(_0x6549a7,null))[_0x91cb('0x2f')](handleError(_0x6549a7,null));};exports['getMembers']=function(_0x3a5022,_0x17141e){var _0x3e2c58={};var _0x11c67c={};var _0xf4b4ab;var _0x2fa5e3;return db[_0x91cb('0x25')]['findOne']({'where':{'id':_0x3a5022[_0x91cb('0x30')]['id']}})[_0x91cb('0x16')](handleEntityNotFound(_0x17141e,null))[_0x91cb('0x16')](function(_0x4483fb){if(_0x4483fb){_0xf4b4ab=_0x4483fb;_0x11c67c['model']=_['keys'](db['UserVoiceQueueRt'][_0x91cb('0x26')]);_0x11c67c[_0x91cb('0x2d')]=_['keys'](_0x3a5022['query']);_0x11c67c['filters']=_[_0x91cb('0x33')](_0x11c67c[_0x91cb('0x35')],_0x11c67c['query']);_0x3e2c58['attributes']=_['intersection'](_0x11c67c[_0x91cb('0x35')],qs[_0x91cb('0x36')](_0x3a5022['query'][_0x91cb('0x36')]));_0x3e2c58[_0x91cb('0x34')]=_0x3e2c58['attributes']['length']?_0x3e2c58[_0x91cb('0x34')]:_0x11c67c[_0x91cb('0x35')];_0x3e2c58[_0x91cb('0x4e')]=qs[_0x91cb('0x4f')](_0x3a5022[_0x91cb('0x2d')]['sort']);_0x3e2c58[_0x91cb('0x2a')]=qs[_0x91cb('0x32')](_['pick'](_0x3a5022[_0x91cb('0x2d')],_0x11c67c[_0x91cb('0x32')]));if(_0x3a5022[_0x91cb('0x2d')][_0x91cb('0x1a')]){_0x3e2c58[_0x91cb('0x2a')]=_[_0x91cb('0x39')](_0x3e2c58[_0x91cb('0x2a')],{'$or':_[_0x91cb('0x1c')](_0x3e2c58[_0x91cb('0x34')],function(_0x1ea132){var _0x3b1d97={};_0x3b1d97[_0x1ea132]={'$like':'%'+_0x3a5022[_0x91cb('0x2d')][_0x91cb('0x1a')]+'%'};return _0x3b1d97;})});}_0x3e2c58=_[_0x91cb('0x39')]({},_0x3e2c58,_0x3a5022[_0x91cb('0x59')]);return _0xf4b4ab[_0x91cb('0x8a')](_0x3e2c58);}})[_0x91cb('0x16')](function(_0x5cf6df){if(_0x5cf6df){_0x2fa5e3=_0x5cf6df['length'];if(!_0x3a5022['query'][_0x91cb('0x56')]('nolimit')){_0x3e2c58[_0x91cb('0x12')]=qs[_0x91cb('0x12')](_0x3a5022[_0x91cb('0x2d')][_0x91cb('0x12')]);_0x3e2c58[_0x91cb('0x13')]=qs[_0x91cb('0x13')](_0x3a5022[_0x91cb('0x2d')][_0x91cb('0x13')]);}return _0xf4b4ab['getMembers'](_0x3e2c58);}})['then'](function(_0x5f2de0){return _0x5f2de0?{'count':_0x2fa5e3,'rows':_0x5f2de0}:null;})[_0x91cb('0x16')](respondWithResult(_0x17141e,null))[_0x91cb('0x2f')](handleError(_0x17141e,null));};exports[_0x91cb('0x8b')]=function(_0x2b4e25,_0x4c044d){var _0x54c194={};var _0x3cfdcb={};var _0x1624b3;var _0x1e2acd;return db[_0x91cb('0x25')][_0x91cb('0x54')]({'where':{'id':_0x2b4e25['params']['id']}})[_0x91cb('0x16')](handleEntityNotFound(_0x4c044d,null))['then'](function(_0x1e979e){if(_0x1e979e){_0x1624b3=_0x1e979e;_0x3cfdcb[_0x91cb('0x35')]=_['keys'](db[_0x91cb('0x8c')][_0x91cb('0x26')]);_0x3cfdcb[_0x91cb('0x2d')]=_[_0x91cb('0x31')](_0x2b4e25[_0x91cb('0x2d')]);_0x3cfdcb['filters']=_[_0x91cb('0x33')](_0x3cfdcb[_0x91cb('0x35')],_0x3cfdcb[_0x91cb('0x2d')]);_0x54c194[_0x91cb('0x34')]=_[_0x91cb('0x33')](_0x3cfdcb['model'],qs[_0x91cb('0x36')](_0x2b4e25[_0x91cb('0x2d')][_0x91cb('0x36')]));_0x54c194['attributes']=_0x54c194['attributes'][_0x91cb('0x37')]?_0x54c194['attributes']:_0x3cfdcb[_0x91cb('0x35')];_0x54c194[_0x91cb('0x4e')]=qs[_0x91cb('0x4f')](_0x2b4e25[_0x91cb('0x2d')]['sort']);_0x54c194[_0x91cb('0x2a')]=qs[_0x91cb('0x32')](_['pick'](_0x2b4e25[_0x91cb('0x2d')],_0x3cfdcb[_0x91cb('0x32')]));if(_0x2b4e25[_0x91cb('0x2d')][_0x91cb('0x1a')]){_0x54c194[_0x91cb('0x2a')]=_[_0x91cb('0x39')](_0x54c194['where'],{'$or':_[_0x91cb('0x1c')](_0x54c194['attributes'],function(_0x283743){var _0x44ffde={};_0x44ffde[_0x283743]={'$like':'%'+_0x2b4e25[_0x91cb('0x2d')][_0x91cb('0x1a')]+'%'};return _0x44ffde;})});}_0x54c194=_['merge']({},_0x54c194,_0x2b4e25[_0x91cb('0x59')]);return _0x1624b3[_0x91cb('0x8b')](_0x54c194);}})[_0x91cb('0x16')](function(_0x5e629){if(_0x5e629){_0x1e2acd=_0x5e629[_0x91cb('0x37')];if(!_0x2b4e25[_0x91cb('0x2d')][_0x91cb('0x56')](_0x91cb('0x4d'))){_0x54c194[_0x91cb('0x12')]=qs[_0x91cb('0x12')](_0x2b4e25['query'][_0x91cb('0x12')]);_0x54c194['offset']=qs[_0x91cb('0x13')](_0x2b4e25[_0x91cb('0x2d')][_0x91cb('0x13')]);}return _0x1624b3[_0x91cb('0x8b')](_0x54c194);}})['then'](function(_0x87f382){if(_0x87f382){return _0x87f382?{'count':_0x1e2acd,'rows':_0x87f382}:null;}})[_0x91cb('0x16')](respondWithResult(_0x4c044d,null))[_0x91cb('0x2f')](handleError(_0x4c044d,null));};exports['addLists']=function(_0x330123,_0x23bc13){var _0x175d85=moment()[_0x91cb('0x6e')]('YYYY-MM-DD\x20HH:mm:ss');var _0x97ba8,_0x4bc382;return db[_0x91cb('0x25')]['find']({'where':{'id':_0x330123[_0x91cb('0x30')]['id']}})['then'](handleEntityNotFound(_0x23bc13,null))[_0x91cb('0x16')](function(_0x399012){if(_0x399012){_0x4bc382=_0x399012;return _0x399012[_0x91cb('0x8d')](_0x330123['body']['ids'],_[_0x91cb('0x47')](_0x330123[_0x91cb('0x3c')],[_0x91cb('0x72'),'id'])||{});}return null;})[_0x91cb('0x84')](function(_0x571a6f){var _0x19596b;_0x97ba8=_0x571a6f||[];var _0x5b4849=[];if(_0x571a6f){for(var _0x39a183=0x0;_0x39a183<_0x571a6f[_0x91cb('0x37')];_0x39a183+=0x1){var _0x693690=_0x571a6f[_0x39a183][_0x91cb('0x3e')]({'plain':!![]});_0x4bc382[_0x91cb('0x8e')]=_0x330123[_0x91cb('0x3c')][_0x91cb('0x8e')]?_0x330123[_0x91cb('0x3c')]['dialCheckDuplicateType']:_0x4bc382['dialCheckDuplicateType'];switch(_0x4bc382['dialCheckDuplicateType']){case'always':_0x19596b=squel[_0x91cb('0x8f')]()[_0x91cb('0x90')](_0x91cb('0x91'))[_0x91cb('0x92')](['phone','scheduledAt',_0x91cb('0x93'),'ListId',_0x91cb('0x51'),_0x91cb('0x45'),_0x91cb('0x46')],squel[_0x91cb('0x74')]()[_0x91cb('0x75')](_0x91cb('0x94'),_0x91cb('0x94'))[_0x91cb('0x75')]('\x27'+_0x175d85+'\x27','scheduledAt')[_0x91cb('0x75')]('id',_0x91cb('0x93'))[_0x91cb('0x75')](_0x693690[_0x91cb('0x95')]['toString'](),'ListId')['field'](_0x330123[_0x91cb('0x30')]['id'][_0x91cb('0x96')](),_0x91cb('0x51'))[_0x91cb('0x75')]('\x27'+_0x175d85+'\x27',_0x91cb('0x45'))['field']('\x27'+_0x175d85+'\x27',_0x91cb('0x46'))[_0x91cb('0x97')](_0x91cb('0x98'))[_0x91cb('0x2a')](_0x91cb('0x99'))[_0x91cb('0x2a')](_0x91cb('0x9a'),_0x693690[_0x91cb('0x95')][_0x91cb('0x96')]())[_0x91cb('0x2a')](_0x91cb('0x9b'))[_0x91cb('0x2a')](_0x91cb('0x9c'),squel[_0x91cb('0x74')]()[_0x91cb('0x75')](_0x91cb('0x9d'))[_0x91cb('0x97')](_0x91cb('0x9e'))[_0x91cb('0x2a')](_0x91cb('0x9f'),_0x330123[_0x91cb('0x30')]['id']['toString']()))[_0x91cb('0x2a')](_0x91cb('0x9c'),squel[_0x91cb('0x74')]()[_0x91cb('0x75')](_0x91cb('0xa0'))['from'](_0x91cb('0x91'))[_0x91cb('0x2a')](_0x91cb('0x9f'),_0x330123[_0x91cb('0x30')]['id'][_0x91cb('0x96')]())))['toString']();break;case _0x91cb('0xa1'):_0x19596b=squel[_0x91cb('0x8f')]()['into'](_0x91cb('0x91'))['fromQuery']([_0x91cb('0x94'),'scheduledAt',_0x91cb('0x93'),_0x91cb('0xa2'),_0x91cb('0x51'),'createdAt',_0x91cb('0x46')],squel[_0x91cb('0x74')]()[_0x91cb('0x75')](_0x91cb('0x94'),_0x91cb('0x94'))[_0x91cb('0x75')]('\x27'+_0x175d85+'\x27',_0x91cb('0xa3'))[_0x91cb('0x75')]('id',_0x91cb('0x93'))['field'](_0x693690[_0x91cb('0x95')][_0x91cb('0x96')](),_0x91cb('0xa2'))[_0x91cb('0x75')](_0x330123[_0x91cb('0x30')]['id'][_0x91cb('0x96')](),_0x91cb('0x51'))['field']('\x27'+_0x175d85+'\x27',_0x91cb('0x45'))[_0x91cb('0x75')]('\x27'+_0x175d85+'\x27',_0x91cb('0x46'))[_0x91cb('0x97')](_0x91cb('0x98'))[_0x91cb('0x2a')](_0x91cb('0x99'))['where'](_0x91cb('0x9a'),_0x693690[_0x91cb('0x95')][_0x91cb('0x96')]())[_0x91cb('0x2a')](_0x91cb('0x9b'))[_0x91cb('0x2a')](_0x91cb('0x9c'),squel[_0x91cb('0x74')]()['field']('COALESCE(phone,\x27\x27)')[_0x91cb('0x97')]('cm_hopper')[_0x91cb('0x2a')](_0x91cb('0x9f'),_0x330123[_0x91cb('0x30')]['id'][_0x91cb('0x96')]())))[_0x91cb('0x96')]();break;default:_0x19596b=squel['insert']()[_0x91cb('0x90')](_0x91cb('0x91'))[_0x91cb('0x92')]([_0x91cb('0x94'),_0x91cb('0xa3'),_0x91cb('0x93'),_0x91cb('0xa2'),'VoiceQueueId',_0x91cb('0x45'),_0x91cb('0x46')],squel[_0x91cb('0x74')]()['field'](_0x91cb('0x94'),'phone')['field']('\x27'+_0x175d85+'\x27',_0x91cb('0xa3'))['field']('id',_0x91cb('0x93'))[_0x91cb('0x75')](_0x693690['CmListId'][_0x91cb('0x96')](),_0x91cb('0xa2'))[_0x91cb('0x75')](_0x330123[_0x91cb('0x30')]['id'][_0x91cb('0x96')](),_0x91cb('0x51'))[_0x91cb('0x75')]('\x27'+_0x175d85+'\x27',_0x91cb('0x45'))[_0x91cb('0x75')]('\x27'+_0x175d85+'\x27',_0x91cb('0x46'))[_0x91cb('0x97')](_0x91cb('0x98'))['where'](_0x91cb('0x99'))[_0x91cb('0x2a')](_0x91cb('0x9a'),_0x693690[_0x91cb('0x95')][_0x91cb('0x96')]())['where'](_0x91cb('0x9b')))[_0x91cb('0x96')]();}_0x5b4849['push'](db[_0x91cb('0x66')]['query'](_0x19596b));}return BPromise[_0x91cb('0x7f')](_0x5b4849);}})['then'](function(){var _0x739447=[];var _0x2deed1=squel[_0x91cb('0x8f')]()[_0x91cb('0x90')](_0x91cb('0xa4'))['fromQuery']([_0x91cb('0xa5'),_0x91cb('0x94'),'OrderBy','createdAt',_0x91cb('0x46')],squel[_0x91cb('0x74')]()[_0x91cb('0x75')](_0x91cb('0xa6'))['field'](_0x91cb('0xa7'))[_0x91cb('0x75')](_0x91cb('0xa8'))[_0x91cb('0x75')]('\x27'+_0x175d85+'\x27',_0x91cb('0x45'))[_0x91cb('0x75')]('\x27'+_0x175d85+'\x27',_0x91cb('0x46'))['from'](_0x91cb('0xa9'),'ci')[_0x91cb('0x78')]('cm_hopper','h','h.ContactId=ci.CmContactId')[_0x91cb('0x2a')](_0x91cb('0xaa'),_0x175d85)[_0x91cb('0x2a')](_0x91cb('0xab'),_0x91cb('0xac')))[_0x91cb('0x96')]();_0x739447[_0x91cb('0x86')](db[_0x91cb('0x66')]['query'](_0x2deed1));return BPromise[_0x91cb('0x7f')](_0x739447);})[_0x91cb('0x16')](function(){return _0x97ba8;})[_0x91cb('0x16')](respondWithResult(_0x23bc13,null))[_0x91cb('0x2f')](handleError(_0x23bc13,null));};exports[_0x91cb('0xad')]=function(_0x554923,_0x2fe556){return db[_0x91cb('0x25')]['find']({'where':{'id':_0x554923[_0x91cb('0x30')]['id']}})['then'](handleEntityNotFound(_0x2fe556,null))[_0x91cb('0x16')](function(_0x43958a){if(_0x43958a){return _0x43958a[_0x91cb('0xad')](_0x554923['query'][_0x91cb('0x72')]);}})[_0x91cb('0x16')](function(_0x409a36){if(_0x409a36){return db[_0x91cb('0x4c')][_0x91cb('0x17')]({'where':{'ListId':_0x554923[_0x91cb('0x2d')][_0x91cb('0x72')],'VoiceQueueId':_0x554923[_0x91cb('0x30')]['id']}})[_0x91cb('0x16')](function(){return _0x409a36;});}})[_0x91cb('0x16')](respondWithStatusCode(_0x2fe556,null))['catch'](handleError(_0x2fe556,null));};exports[_0x91cb('0xae')]=function(_0x2d870d,_0x173761){var _0x2cf0d8={};var _0x9d63ff={};var _0x720de;var _0x80f0ba;return db[_0x91cb('0x25')][_0x91cb('0x54')]({'where':{'id':_0x2d870d[_0x91cb('0x30')]['id']}})['then'](handleEntityNotFound(_0x173761,null))[_0x91cb('0x16')](function(_0x800860){if(_0x800860){_0x720de=_0x800860;_0x9d63ff[_0x91cb('0x35')]=_[_0x91cb('0x31')](db[_0x91cb('0x8c')][_0x91cb('0x26')]);_0x9d63ff['query']=_['keys'](_0x2d870d[_0x91cb('0x2d')]);_0x9d63ff[_0x91cb('0x32')]=_[_0x91cb('0x33')](_0x9d63ff['model'],_0x9d63ff[_0x91cb('0x2d')]);_0x2cf0d8[_0x91cb('0x34')]=_[_0x91cb('0x33')](_0x9d63ff[_0x91cb('0x35')],qs[_0x91cb('0x36')](_0x2d870d[_0x91cb('0x2d')][_0x91cb('0x36')]));_0x2cf0d8[_0x91cb('0x34')]=_0x2cf0d8[_0x91cb('0x34')][_0x91cb('0x37')]?_0x2cf0d8[_0x91cb('0x34')]:_0x9d63ff[_0x91cb('0x35')];_0x2cf0d8[_0x91cb('0x4e')]=qs[_0x91cb('0x4f')](_0x2d870d[_0x91cb('0x2d')][_0x91cb('0x4f')]);_0x2cf0d8[_0x91cb('0x2a')]=qs[_0x91cb('0x32')](_[_0x91cb('0x50')](_0x2d870d['query'],_0x9d63ff[_0x91cb('0x32')]));if(_0x2d870d[_0x91cb('0x2d')][_0x91cb('0x1a')]){_0x2cf0d8['where']=_['merge'](_0x2cf0d8['where'],{'$or':_[_0x91cb('0x1c')](_0x2cf0d8[_0x91cb('0x34')],function(_0x4370f6){var _0x5bc712={};_0x5bc712[_0x4370f6]={'$like':'%'+_0x2d870d['query'][_0x91cb('0x1a')]+'%'};return _0x5bc712;})});}_0x2cf0d8=_[_0x91cb('0x39')]({},_0x2cf0d8,_0x2d870d[_0x91cb('0x59')]);return _0x720de[_0x91cb('0xae')](_0x2cf0d8);}})[_0x91cb('0x16')](function(_0x182f2c){if(_0x182f2c){_0x80f0ba=_0x182f2c[_0x91cb('0x37')];if(!_0x2d870d[_0x91cb('0x2d')][_0x91cb('0x56')](_0x91cb('0x4d'))){_0x2cf0d8['limit']=qs['limit'](_0x2d870d[_0x91cb('0x2d')]['limit']);_0x2cf0d8[_0x91cb('0x13')]=qs['offset'](_0x2d870d['query'][_0x91cb('0x13')]);}return _0x720de['getBlackLists'](_0x2cf0d8);}})[_0x91cb('0x16')](function(_0x2ac9df){if(_0x2ac9df){return _0x2ac9df?{'count':_0x80f0ba,'rows':_0x2ac9df}:null;}})['then'](respondWithResult(_0x173761,null))[_0x91cb('0x2f')](handleError(_0x173761,null));};exports[_0x91cb('0xaf')]=function(_0x331381,_0x52ce8c){var _0x534968;return db[_0x91cb('0x25')][_0x91cb('0x3a')]({'where':{'id':_0x331381['params']['id']}})['then'](handleEntityNotFound(_0x52ce8c,null))['then'](function(_0x397397){if(_0x397397){return _0x397397[_0x91cb('0xaf')](_0x331381[_0x91cb('0x3c')][_0x91cb('0x72')],_['omit'](_0x331381[_0x91cb('0x3c')],[_0x91cb('0x72'),'id'])||{});}return null;})[_0x91cb('0x84')](function(_0x2a0c3c){var _0x30ef98;_0x534968=_0x2a0c3c||[];var _0x27d0ab=[];if(_0x2a0c3c){for(var _0x547db7=0x0;_0x547db7<_0x2a0c3c['length'];_0x547db7+=0x1){var _0x38d608=_0x2a0c3c[_0x547db7][_0x91cb('0x3e')]({'plain':!![]});_0x30ef98=squel[_0x91cb('0x8f')]()[_0x91cb('0x90')](_0x91cb('0xb0'))[_0x91cb('0x92')](['phone',_0x91cb('0x93'),_0x91cb('0xa2'),_0x91cb('0x51'),'createdAt',_0x91cb('0x46')],squel['select']()[_0x91cb('0x75')](_0x91cb('0x94'),'phone')[_0x91cb('0x75')]('id','ContactId')[_0x91cb('0x75')](_0x38d608[_0x91cb('0x95')][_0x91cb('0x96')](),_0x91cb('0xa2'))['field'](_0x331381[_0x91cb('0x30')]['id']['toString'](),_0x91cb('0x51'))['field']('NOW()',_0x91cb('0x45'))[_0x91cb('0x75')](_0x91cb('0xb1'),_0x91cb('0x46'))[_0x91cb('0x97')]('cm_contacts')['where'](_0x91cb('0x99'))['where'](_0x91cb('0x9a'),_0x38d608['CmListId'][_0x91cb('0x96')]())[_0x91cb('0x2a')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x27d0ab[_0x91cb('0x86')](db['sequelize'][_0x91cb('0x2d')](_0x30ef98));}return BPromise['all'](_0x27d0ab);}})['then'](function(){return _0x534968;})[_0x91cb('0x16')](respondWithResult(_0x52ce8c,null))[_0x91cb('0x2f')](handleError(_0x52ce8c,null));};exports[_0x91cb('0xb2')]=function(_0x4ef95b,_0x2f0269){return db[_0x91cb('0x25')][_0x91cb('0x3a')]({'where':{'id':_0x4ef95b[_0x91cb('0x30')]['id']}})[_0x91cb('0x16')](handleEntityNotFound(_0x2f0269,null))['then'](function(_0x5e1b97){if(_0x5e1b97){return _0x5e1b97[_0x91cb('0xb2')](_0x4ef95b['query'][_0x91cb('0x72')]);}})[_0x91cb('0x16')](function(_0xcb3114){if(_0xcb3114){return db[_0x91cb('0x5b')][_0x91cb('0x17')]({'where':{'ListId':_0x4ef95b['query'][_0x91cb('0x72')],'VoiceQueueId':_0x4ef95b['params']['id']}})[_0x91cb('0x16')](function(){return _0xcb3114;});}})['then'](respondWithStatusCode(_0x2f0269,null))[_0x91cb('0x2f')](handleError(_0x2f0269,null));}; \ No newline at end of file +var _0x3e74=['phone\x20NOT\x20IN\x20(?)','cm_hopper','onlyIfOpen','insert','into','fromQuery','phone\x20IS\x20NOT\x20NULL','COALESCE(phone,\x27\x27)','ListId\x20=\x20?','cm_hopper_additional_phones','CmHopperId','OrderBy','ci.item','ci.OrderBy+1','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','PHONE','removeLists','getBlackLists','addBlackLists','NOW()','removeBlackLists','moment','util','lodash','squel','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueue.socket','register','end','json','offset','undefined','count','limit','Content-Range','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','filter','map','value','includes','type','UserProfileResource','sendStatus','stack','name','status','send','index','VoiceQueue','rawAttributes','fieldName','key','getOptions','where','include','query','findAll','catch','show','intersection','model','attributes','fields','length','includeAll','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','error','clone','params','keys','omit','updatedAt','createdAt','outbound','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','findOne','CmHopper','hasOwnProperty','nolimit','sort','filters','pick','VoiceQueueId','options','rows','CmHopperHistory','getHopperFinals','CmHopperFinal','order','getHopperBlacks','CmHopperBlack','getTeams','Team','teams','online','interface','flatMap','Agents','forEach','penalty','sequelize','transaction','addTeams','each','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','voicePause','emit','userVoiceQueue:save','removeTeams','ids','User','select','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.UserId\x20=\x20?','push','QueryTypes','every','all','union','compact','isEmpty','userVoiceQueue:remove','addAgents','removeAgents','getAgents','getMembers','getLists','CmList','addLists','spread','dialCheckDuplicateType','always','phone','scheduledAt','field','ContactId','CmListId','toString','ListId','cm_contacts','deletedAt\x20IS\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?'];(function(_0xa7bcf9,_0x39c50e){var _0x3ce383=function(_0x41e0a7){while(--_0x41e0a7){_0xa7bcf9['push'](_0xa7bcf9['shift']());}};_0x3ce383(++_0x39c50e);}(_0x3e74,0x175));var _0x43e7=function(_0x14653d,_0x1a47b6){_0x14653d=_0x14653d-0x0;var _0x463ed2=_0x3e74[_0x14653d];return _0x463ed2;};'use strict';var moment=require(_0x43e7('0x0'));var BPromise=require('bluebird');var util=require(_0x43e7('0x1'));var _=require(_0x43e7('0x2'));var squel=require(_0x43e7('0x3'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x43e7('0x4'))('api');var config=require(_0x43e7('0x5'));var db=require(_0x43e7('0x6'))['db'];config[_0x43e7('0x7')]=_[_0x43e7('0x8')](config[_0x43e7('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x43e7('0x9'))(new Redis(config[_0x43e7('0x7')]));require(_0x43e7('0xa'))[_0x43e7('0xb')](socket);function respondWithStatusCode(_0x21f491,_0x516b4d){_0x516b4d=_0x516b4d||0xcc;return function(_0x212c6c){if(_0x212c6c){return _0x21f491['sendStatus'](_0x516b4d);}return _0x21f491['status'](_0x516b4d)[_0x43e7('0xc')]();};}function respondWithResult(_0x4139c9,_0x5c34f4){_0x5c34f4=_0x5c34f4||0xc8;return function(_0x2803d9){if(_0x2803d9){return _0x4139c9['status'](_0x5c34f4)[_0x43e7('0xd')](_0x2803d9);}};}function respondWithFilteredResult(_0x37302c,_0x4ebc8e){return function(_0x3eb206){if(_0x3eb206){var _0xc960ea=typeof _0x4ebc8e[_0x43e7('0xe')]===_0x43e7('0xf')&&typeof _0x4ebc8e['limit']==='undefined';var _0x2fcb36=_0x3eb206[_0x43e7('0x10')];var _0x44b0bd=_0xc960ea?0x0:_0x4ebc8e['offset'];var _0x5e641c=_0xc960ea?_0x3eb206[_0x43e7('0x10')]:_0x4ebc8e[_0x43e7('0xe')]+_0x4ebc8e[_0x43e7('0x11')];var _0x328445;if(_0x5e641c>=_0x2fcb36){_0x5e641c=_0x2fcb36;_0x328445=0xc8;}else{_0x328445=0xce;}_0x37302c['status'](_0x328445);return _0x37302c['set'](_0x43e7('0x12'),_0x44b0bd+'-'+_0x5e641c+'/'+_0x2fcb36)[_0x43e7('0xd')](_0x3eb206);}return null;};}function saveUpdates(_0x273a32){return function(_0x5d346f){if(_0x5d346f){return _0x5d346f['update'](_0x273a32)[_0x43e7('0x13')](function(_0x1ca758){return _0x1ca758;});}return null;};}function removeEntity(_0x9037d3){return function(_0x140657){if(_0x140657){return _0x140657[_0x43e7('0x14')]()[_0x43e7('0x13')](function(){var _0x619236=_0x140657[_0x43e7('0x15')]({'plain':!![]});var _0x2377a3=[{'name':_0x43e7('0x16'),'value':_0x43e7('0x17'),'ignore':![]},{'name':_0x43e7('0x18'),'value':'outbound','ignore':![]}];var _0xef1a5a=_(_0x2377a3)[_0x43e7('0x19')]('ignore')[_0x43e7('0x1a')](_0x43e7('0x1b'))[_0x43e7('0x1b')]();if(_[_0x43e7('0x1c')](_0xef1a5a,_0x619236[_0x43e7('0x1d')])){return;}var _0x2f4cb4=_['find'](_0x2377a3,[_0x43e7('0x1b'),_0x619236['type']])['name'];return db[_0x43e7('0x1e')][_0x43e7('0x14')]({'where':{'type':_0x2f4cb4,'resourceId':_0x619236['id']}})['then'](function(){return _0x140657;});})[_0x43e7('0x13')](function(){_0x9037d3['status'](0xcc)[_0x43e7('0xc')]();});}};}function handleEntityNotFound(_0x5c5e67){return function(_0x1af208){if(!_0x1af208){_0x5c5e67[_0x43e7('0x1f')](0x194);}return _0x1af208;};}function handleError(_0x20888b,_0x405f85){_0x405f85=_0x405f85||0x1f4;return function(_0x51f4d7){logger['error'](_0x51f4d7[_0x43e7('0x20')]);if(_0x51f4d7['name']){delete _0x51f4d7[_0x43e7('0x21')];}_0x20888b[_0x43e7('0x22')](_0x405f85)[_0x43e7('0x23')](_0x51f4d7);};}exports[_0x43e7('0x24')]=function(_0x5087d7,_0x33a1a5){var _0x4690a6={};var _0x45b675={'count':0x0,'rows':[]};var _0x50f9f5=_[_0x43e7('0x1a')](db[_0x43e7('0x25')][_0x43e7('0x26')],function(_0x31b2a6){return{'name':_0x31b2a6[_0x43e7('0x27')],'type':_0x31b2a6[_0x43e7('0x1d')][_0x43e7('0x28')]};});_0x4690a6=qs[_0x43e7('0x29')](_0x50f9f5,_0x5087d7);var _0x2bde44={'where':_0x4690a6[_0x43e7('0x2a')]};return db['VoiceQueue'][_0x43e7('0x10')](_0x2bde44)[_0x43e7('0x13')](function(_0x3b8f78){_0x45b675[_0x43e7('0x10')]=_0x3b8f78;_0x4690a6[_0x43e7('0x2b')]=qs['include'](_0x5087d7[_0x43e7('0x2c')]);return db[_0x43e7('0x25')][_0x43e7('0x2d')](_0x4690a6);})[_0x43e7('0x13')](function(_0x4c61b9){_0x45b675['rows']=_0x4c61b9;return _0x45b675;})['then'](respondWithFilteredResult(_0x33a1a5,_0x4690a6))[_0x43e7('0x2e')](handleError(_0x33a1a5,null));};exports[_0x43e7('0x2f')]=function(_0x117c07,_0x234fe6){var _0x108313={'raw':![],'where':{'id':_0x117c07['params']['id']}},_0xde7ed={};_0xde7ed['model']=_['keys'](db['VoiceQueue']['rawAttributes']);_0xde7ed['query']=_['keys'](_0x117c07[_0x43e7('0x2c')]);_0xde7ed['filters']=_[_0x43e7('0x30')](_0xde7ed[_0x43e7('0x31')],_0xde7ed[_0x43e7('0x2c')]);_0x108313[_0x43e7('0x32')]=_[_0x43e7('0x30')](_0xde7ed[_0x43e7('0x31')],qs[_0x43e7('0x33')](_0x117c07['query']['fields']));_0x108313['attributes']=_0x108313[_0x43e7('0x32')][_0x43e7('0x34')]?_0x108313[_0x43e7('0x32')]:_0xde7ed[_0x43e7('0x31')];if(_0x117c07[_0x43e7('0x2c')][_0x43e7('0x35')]){_0x108313[_0x43e7('0x2b')]=[{'all':!![]}];}_0x108313=_[_0x43e7('0x36')]({},_0x108313,_0x117c07['options']);return db[_0x43e7('0x25')][_0x43e7('0x37')](_0x108313)['then'](handleEntityNotFound(_0x234fe6,null))[_0x43e7('0x13')](respondWithResult(_0x234fe6,null))['catch'](handleError(_0x234fe6,null));};exports[_0x43e7('0x38')]=function(_0x2ad008,_0x1c6f45){return db[_0x43e7('0x25')][_0x43e7('0x38')](_0x2ad008[_0x43e7('0x39')],{})['then'](function(_0x574a93){var _0x30dfa9=_0x2ad008[_0x43e7('0x3a')][_0x43e7('0x15')]({'plain':!![]});if(!_0x30dfa9)throw new Error(_0x43e7('0x3b'));if(_0x30dfa9[_0x43e7('0x3c')]==='user'){var _0x32a451=_0x574a93[_0x43e7('0x15')]({'plain':!![]});var _0x575439=[{'name':_0x43e7('0x16'),'value':'inbound'},{'name':_0x43e7('0x18'),'value':'outbound'}];var _0x3d81ae=_[_0x43e7('0x37')](_0x575439,[_0x43e7('0x1b'),_0x32a451[_0x43e7('0x1d')]])['name'];return db['UserProfileSection'][_0x43e7('0x37')]({'where':{'name':_0x3d81ae,'userProfileId':_0x30dfa9[_0x43e7('0x3d')]},'raw':!![]})[_0x43e7('0x13')](function(_0x36b770){if(_0x36b770&&_0x36b770['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x32a451[_0x43e7('0x21')],'resourceId':_0x32a451['id'],'type':_0x36b770['name'],'sectionId':_0x36b770['id']},{})[_0x43e7('0x13')](function(){return _0x574a93;});}else{return _0x574a93;}})['catch'](function(_0x5b28db){logger[_0x43e7('0x3e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b28db);throw _0x5b28db;});}return _0x574a93;})[_0x43e7('0x13')](respondWithResult(_0x1c6f45,0xc9))[_0x43e7('0x2e')](handleError(_0x1c6f45,null));};exports[_0x43e7('0x3f')]=function(_0x99b9e1,_0x4fc5e8){var _0x91f1e4={'where':{'id':_0x99b9e1[_0x43e7('0x40')]['id']}},_0x2b9046={};_0x2b9046[_0x43e7('0x31')]=_[_0x43e7('0x41')](db[_0x43e7('0x25')]['rawAttributes']);_0x91f1e4['attributes']=_[_0x43e7('0x30')](_0x2b9046[_0x43e7('0x31')],qs[_0x43e7('0x33')](_0x99b9e1['query']['fields']));_0x91f1e4['attributes']=_0x91f1e4[_0x43e7('0x32')][_0x43e7('0x34')]?_0x91f1e4['attributes']:_0x2b9046[_0x43e7('0x31')];if(_0x99b9e1[_0x43e7('0x2c')][_0x43e7('0x35')]){_0x91f1e4['include']=[{'all':!![]}];}_0x91f1e4=_['merge']({},_0x91f1e4,_0x99b9e1['options']);return db['VoiceQueue'][_0x43e7('0x37')](_0x91f1e4)[_0x43e7('0x13')](handleEntityNotFound(_0x4fc5e8,null))['then'](function(_0x23e7cb){if(_0x23e7cb){var _0x82d32f=_0x23e7cb[_0x43e7('0x15')]({'plain':!![]});_0x82d32f=qs[_0x43e7('0x42')](_0x82d32f,['id','createdAt',_0x43e7('0x43')]);_0x99b9e1['body']=_['omit'](_0x99b9e1[_0x43e7('0x39')],['id',_0x43e7('0x44'),_0x43e7('0x43')]);return db[_0x43e7('0x25')][_0x43e7('0x38')](_[_0x43e7('0x36')](_0x82d32f,_0x99b9e1[_0x43e7('0x39')]),{'include':_0x99b9e1[_0x43e7('0x2c')][_0x43e7('0x35')]?[{'all':!![]}]:undefined})[_0x43e7('0x13')](function(_0x58dfd0){var _0x119d34=_0x99b9e1[_0x43e7('0x3a')]['get']({'plain':!![]});if(!_0x119d34)throw new Error(_0x43e7('0x3b'));if(_0x119d34['role']===_0x43e7('0x3a')){var _0x520857=_0x58dfd0[_0x43e7('0x15')]({'plain':!![]});var _0x1f561f=[{'name':_0x43e7('0x16'),'value':'inbound'},{'name':'QueueCampaigns','value':_0x43e7('0x45')}];var _0x2ab7ee=_[_0x43e7('0x37')](_0x1f561f,[_0x43e7('0x1b'),_0x520857[_0x43e7('0x1d')]])[_0x43e7('0x21')];return db[_0x43e7('0x46')][_0x43e7('0x37')]({'where':{'name':_0x2ab7ee,'userProfileId':_0x119d34[_0x43e7('0x3d')]},'raw':!![]})[_0x43e7('0x13')](function(_0x312306){if(_0x312306&&_0x312306['autoAssociation']===0x0){return db[_0x43e7('0x1e')][_0x43e7('0x38')]({'name':_0x520857['name'],'resourceId':_0x520857['id'],'type':_0x312306[_0x43e7('0x21')],'sectionId':_0x312306['id']},{})[_0x43e7('0x13')](function(){return _0x58dfd0;});}else{return _0x58dfd0;}})[_0x43e7('0x2e')](function(_0x558d54){logger['error'](_0x43e7('0x47'),_0x558d54);throw _0x558d54;});}return _0x58dfd0;});}})[_0x43e7('0x13')](respondWithResult(_0x4fc5e8,0xc9))['catch'](handleError(_0x4fc5e8,null));};exports[_0x43e7('0x48')]=function(_0x54506d,_0x49a6ce){if(_0x54506d[_0x43e7('0x39')]['id']){delete _0x54506d[_0x43e7('0x39')]['id'];}return db[_0x43e7('0x25')][_0x43e7('0x37')]({'where':{'id':_0x54506d[_0x43e7('0x40')]['id']}})['then'](handleEntityNotFound(_0x49a6ce,null))[_0x43e7('0x13')](saveUpdates(_0x54506d[_0x43e7('0x39')],null))['then'](respondWithResult(_0x49a6ce,null))[_0x43e7('0x2e')](handleError(_0x49a6ce,null));};exports[_0x43e7('0x14')]=function(_0x296a0d,_0x5bb536){return db['VoiceQueue']['find']({'where':{'id':_0x296a0d[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x5bb536,null))[_0x43e7('0x13')](removeEntity(_0x5bb536,null))[_0x43e7('0x2e')](handleError(_0x5bb536,null));};exports['getHoppers']=function(_0x5a50fc,_0x1b27da){var _0x8b50bb={'raw':![],'where':{}};var _0x140438={};var _0x5dd349={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x43e7('0x49')]({'where':{'id':_0x5a50fc[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x1b27da,null))[_0x43e7('0x13')](function(_0x3369b8){if(_0x3369b8){_0x140438[_0x43e7('0x31')]=_[_0x43e7('0x41')](db[_0x43e7('0x4a')][_0x43e7('0x26')]);_0x140438[_0x43e7('0x2c')]=_[_0x43e7('0x41')](_0x5a50fc['query']);_0x140438['filters']=_[_0x43e7('0x30')](_0x140438['model'],_0x140438['query']);_0x8b50bb['attributes']=_[_0x43e7('0x30')](_0x140438[_0x43e7('0x31')],qs['fields'](_0x5a50fc[_0x43e7('0x2c')][_0x43e7('0x33')]));_0x8b50bb[_0x43e7('0x32')]=_0x8b50bb['attributes'][_0x43e7('0x34')]?_0x8b50bb[_0x43e7('0x32')]:_0x140438[_0x43e7('0x31')];if(!_0x5a50fc[_0x43e7('0x2c')][_0x43e7('0x4b')](_0x43e7('0x4c'))){_0x8b50bb[_0x43e7('0x11')]=qs['limit'](_0x5a50fc[_0x43e7('0x2c')][_0x43e7('0x11')]);_0x8b50bb[_0x43e7('0xe')]=qs['offset'](_0x5a50fc['query'][_0x43e7('0xe')]);}_0x8b50bb['order']=qs['sort'](_0x5a50fc[_0x43e7('0x2c')][_0x43e7('0x4d')]);_0x8b50bb['where']=qs[_0x43e7('0x4e')](_[_0x43e7('0x4f')](_0x5a50fc[_0x43e7('0x2c')],_0x140438[_0x43e7('0x4e')]));_0x8b50bb[_0x43e7('0x2a')][_0x43e7('0x50')]=_0x3369b8['id'];if(_0x5a50fc[_0x43e7('0x2c')]['filter']){_0x8b50bb[_0x43e7('0x2a')]=_[_0x43e7('0x36')](_0x8b50bb['where'],{'$or':_[_0x43e7('0x1a')](_0x8b50bb['attributes'],function(_0x26ee52){var _0x248936={};_0x248936[_0x26ee52]={'$like':'%'+_0x5a50fc[_0x43e7('0x2c')][_0x43e7('0x19')]+'%'};return _0x248936;})});}_0x8b50bb=_['merge']({},_0x8b50bb,_0x5a50fc[_0x43e7('0x51')]);return db[_0x43e7('0x4a')][_0x43e7('0x10')]({'where':_0x8b50bb['where']})[_0x43e7('0x13')](function(_0x38fa5b){_0x5dd349[_0x43e7('0x10')]=_0x38fa5b;if(_0x5a50fc[_0x43e7('0x2c')][_0x43e7('0x35')]){_0x8b50bb['include']=[{'all':!![]}];}return db[_0x43e7('0x4a')][_0x43e7('0x2d')](_0x8b50bb);})[_0x43e7('0x13')](function(_0x2499ef){_0x5dd349[_0x43e7('0x52')]=_0x2499ef;return _0x5dd349;});}})[_0x43e7('0x13')](respondWithFilteredResult(_0x1b27da,_0x8b50bb))[_0x43e7('0x2e')](handleError(_0x1b27da,null));};exports['getHopperHistories']=function(_0x499ee9,_0x405faa){var _0x536477={'raw':!![],'where':{}};var _0x550036={};var _0x5b98bf={'count':0x0,'rows':[]};return db[_0x43e7('0x25')][_0x43e7('0x49')]({'where':{'id':_0x499ee9[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x405faa,null))[_0x43e7('0x13')](function(_0x1ae0c8){if(_0x1ae0c8){_0x550036['model']=_[_0x43e7('0x41')](db[_0x43e7('0x53')][_0x43e7('0x26')]);_0x550036['query']=_[_0x43e7('0x41')](_0x499ee9[_0x43e7('0x2c')]);_0x550036[_0x43e7('0x4e')]=_[_0x43e7('0x30')](_0x550036[_0x43e7('0x31')],_0x550036[_0x43e7('0x2c')]);_0x536477[_0x43e7('0x32')]=_[_0x43e7('0x30')](_0x550036['model'],qs['fields'](_0x499ee9['query'][_0x43e7('0x33')]));_0x536477[_0x43e7('0x32')]=_0x536477['attributes'][_0x43e7('0x34')]?_0x536477[_0x43e7('0x32')]:_0x550036[_0x43e7('0x31')];if(!_0x499ee9[_0x43e7('0x2c')]['hasOwnProperty']('nolimit')){_0x536477['limit']=qs[_0x43e7('0x11')](_0x499ee9[_0x43e7('0x2c')]['limit']);_0x536477['offset']=qs[_0x43e7('0xe')](_0x499ee9[_0x43e7('0x2c')][_0x43e7('0xe')]);}_0x536477['order']=qs[_0x43e7('0x4d')](_0x499ee9[_0x43e7('0x2c')][_0x43e7('0x4d')]);_0x536477[_0x43e7('0x2a')]=qs['filters'](_[_0x43e7('0x4f')](_0x499ee9['query'],_0x550036[_0x43e7('0x4e')]));_0x536477[_0x43e7('0x2a')][_0x43e7('0x50')]=_0x1ae0c8['id'];if(_0x499ee9[_0x43e7('0x2c')][_0x43e7('0x19')]){_0x536477[_0x43e7('0x2a')]=_[_0x43e7('0x36')](_0x536477['where'],{'$or':_[_0x43e7('0x1a')](_0x536477[_0x43e7('0x32')],function(_0x1aea4e){var _0x6fb694={};_0x6fb694[_0x1aea4e]={'$like':'%'+_0x499ee9['query']['filter']+'%'};return _0x6fb694;})});}_0x536477=_['merge']({},_0x536477,_0x499ee9[_0x43e7('0x51')]);return db['CmHopperHistory'][_0x43e7('0x10')]({'where':_0x536477[_0x43e7('0x2a')]})[_0x43e7('0x13')](function(_0x7387f6){_0x5b98bf[_0x43e7('0x10')]=_0x7387f6;if(_0x499ee9[_0x43e7('0x2c')][_0x43e7('0x35')]){_0x536477[_0x43e7('0x2b')]=[{'all':!![]}];}return db[_0x43e7('0x53')][_0x43e7('0x2d')](_0x536477);})[_0x43e7('0x13')](function(_0x5b3565){_0x5b98bf[_0x43e7('0x52')]=_0x5b3565;return _0x5b98bf;});}})[_0x43e7('0x13')](respondWithFilteredResult(_0x405faa,_0x536477))[_0x43e7('0x2e')](handleError(_0x405faa,null));};exports[_0x43e7('0x54')]=function(_0x206e54,_0x4ea4a9){var _0x5e04ec={'raw':!![],'where':{}};var _0x162a27={};var _0x3e3c82={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x43e7('0x49')]({'where':{'id':_0x206e54[_0x43e7('0x40')]['id']}})['then'](handleEntityNotFound(_0x4ea4a9,null))['then'](function(_0x1e869a){if(_0x1e869a){_0x162a27[_0x43e7('0x31')]=_[_0x43e7('0x41')](db[_0x43e7('0x55')][_0x43e7('0x26')]);_0x162a27['query']=_['keys'](_0x206e54[_0x43e7('0x2c')]);_0x162a27[_0x43e7('0x4e')]=_[_0x43e7('0x30')](_0x162a27[_0x43e7('0x31')],_0x162a27['query']);_0x5e04ec[_0x43e7('0x32')]=_[_0x43e7('0x30')](_0x162a27[_0x43e7('0x31')],qs[_0x43e7('0x33')](_0x206e54['query'][_0x43e7('0x33')]));_0x5e04ec[_0x43e7('0x32')]=_0x5e04ec[_0x43e7('0x32')][_0x43e7('0x34')]?_0x5e04ec[_0x43e7('0x32')]:_0x162a27['model'];if(!_0x206e54[_0x43e7('0x2c')][_0x43e7('0x4b')]('nolimit')){_0x5e04ec[_0x43e7('0x11')]=qs[_0x43e7('0x11')](_0x206e54[_0x43e7('0x2c')][_0x43e7('0x11')]);_0x5e04ec['offset']=qs[_0x43e7('0xe')](_0x206e54['query'][_0x43e7('0xe')]);}_0x5e04ec[_0x43e7('0x56')]=qs[_0x43e7('0x4d')](_0x206e54[_0x43e7('0x2c')][_0x43e7('0x4d')]);_0x5e04ec[_0x43e7('0x2a')]=qs[_0x43e7('0x4e')](_[_0x43e7('0x4f')](_0x206e54[_0x43e7('0x2c')],_0x162a27['filters']));_0x5e04ec[_0x43e7('0x2a')][_0x43e7('0x50')]=_0x1e869a['id'];if(_0x206e54[_0x43e7('0x2c')][_0x43e7('0x19')]){_0x5e04ec['where']=_['merge'](_0x5e04ec[_0x43e7('0x2a')],{'$or':_[_0x43e7('0x1a')](_0x5e04ec[_0x43e7('0x32')],function(_0x4d30f7){var _0x12e7a8={};_0x12e7a8[_0x4d30f7]={'$like':'%'+_0x206e54['query']['filter']+'%'};return _0x12e7a8;})});}_0x5e04ec=_['merge']({},_0x5e04ec,_0x206e54[_0x43e7('0x51')]);return db['CmHopperFinal'][_0x43e7('0x10')]({'where':_0x5e04ec[_0x43e7('0x2a')]})[_0x43e7('0x13')](function(_0x2fea54){_0x3e3c82[_0x43e7('0x10')]=_0x2fea54;if(_0x206e54['query']['includeAll']){_0x5e04ec[_0x43e7('0x2b')]=[{'all':!![]}];}return db[_0x43e7('0x55')]['findAll'](_0x5e04ec);})[_0x43e7('0x13')](function(_0x10fd28){_0x3e3c82[_0x43e7('0x52')]=_0x10fd28;return _0x3e3c82;});}})[_0x43e7('0x13')](respondWithFilteredResult(_0x4ea4a9,_0x5e04ec))[_0x43e7('0x2e')](handleError(_0x4ea4a9,null));};exports[_0x43e7('0x57')]=function(_0x399253,_0x32e698){var _0x39ce5e={'raw':!![],'where':{}};var _0x284617={};var _0x610819={'count':0x0,'rows':[]};return db[_0x43e7('0x25')][_0x43e7('0x49')]({'where':{'id':_0x399253[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x32e698,null))[_0x43e7('0x13')](function(_0x3286b1){if(_0x3286b1){_0x284617[_0x43e7('0x31')]=_[_0x43e7('0x41')](db[_0x43e7('0x58')][_0x43e7('0x26')]);_0x284617[_0x43e7('0x2c')]=_['keys'](_0x399253[_0x43e7('0x2c')]);_0x284617[_0x43e7('0x4e')]=_[_0x43e7('0x30')](_0x284617[_0x43e7('0x31')],_0x284617['query']);_0x39ce5e[_0x43e7('0x32')]=_['intersection'](_0x284617[_0x43e7('0x31')],qs[_0x43e7('0x33')](_0x399253[_0x43e7('0x2c')][_0x43e7('0x33')]));_0x39ce5e[_0x43e7('0x32')]=_0x39ce5e[_0x43e7('0x32')]['length']?_0x39ce5e[_0x43e7('0x32')]:_0x284617[_0x43e7('0x31')];if(!_0x399253[_0x43e7('0x2c')][_0x43e7('0x4b')](_0x43e7('0x4c'))){_0x39ce5e['limit']=qs['limit'](_0x399253[_0x43e7('0x2c')]['limit']);_0x39ce5e[_0x43e7('0xe')]=qs[_0x43e7('0xe')](_0x399253[_0x43e7('0x2c')][_0x43e7('0xe')]);}_0x39ce5e['order']=qs['sort'](_0x399253['query'][_0x43e7('0x4d')]);_0x39ce5e['where']=qs['filters'](_['pick'](_0x399253[_0x43e7('0x2c')],_0x284617[_0x43e7('0x4e')]));_0x39ce5e['where'][_0x43e7('0x50')]=_0x3286b1['id'];if(_0x399253['query'][_0x43e7('0x19')]){_0x39ce5e[_0x43e7('0x2a')]=_[_0x43e7('0x36')](_0x39ce5e[_0x43e7('0x2a')],{'$or':_[_0x43e7('0x1a')](_0x39ce5e['attributes'],function(_0x1f4162){var _0x449cb4={};_0x449cb4[_0x1f4162]={'$like':'%'+_0x399253[_0x43e7('0x2c')]['filter']+'%'};return _0x449cb4;})});}_0x39ce5e=_['merge']({},_0x39ce5e,_0x399253[_0x43e7('0x51')]);return db[_0x43e7('0x58')][_0x43e7('0x10')]({'where':_0x39ce5e[_0x43e7('0x2a')]})['then'](function(_0x385cc1){_0x610819[_0x43e7('0x10')]=_0x385cc1;if(_0x399253[_0x43e7('0x2c')]['includeAll']){_0x39ce5e[_0x43e7('0x2b')]=[{'all':!![]}];}return db[_0x43e7('0x58')][_0x43e7('0x2d')](_0x39ce5e);})[_0x43e7('0x13')](function(_0x541ce8){_0x610819[_0x43e7('0x52')]=_0x541ce8;return _0x610819;});}})['then'](respondWithFilteredResult(_0x32e698,_0x39ce5e))[_0x43e7('0x2e')](handleError(_0x32e698,null));};exports[_0x43e7('0x59')]=function(_0x47f29f,_0x4e5484){var _0xc62dc9={};var _0x1480c6={};var _0x21d001;var _0x4600e5;return db[_0x43e7('0x25')][_0x43e7('0x49')]({'where':{'id':_0x47f29f[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x4e5484,null))[_0x43e7('0x13')](function(_0xfc577b){if(_0xfc577b){_0x21d001=_0xfc577b;_0x1480c6[_0x43e7('0x31')]=_['keys'](db[_0x43e7('0x5a')]['rawAttributes']);_0x1480c6[_0x43e7('0x2c')]=_[_0x43e7('0x41')](_0x47f29f[_0x43e7('0x2c')]);_0x1480c6['filters']=_[_0x43e7('0x30')](_0x1480c6[_0x43e7('0x31')],_0x1480c6[_0x43e7('0x2c')]);_0xc62dc9[_0x43e7('0x32')]=_['intersection'](_0x1480c6[_0x43e7('0x31')],qs[_0x43e7('0x33')](_0x47f29f['query']['fields']));_0xc62dc9['attributes']=_0xc62dc9[_0x43e7('0x32')][_0x43e7('0x34')]?_0xc62dc9[_0x43e7('0x32')]:_0x1480c6[_0x43e7('0x31')];_0xc62dc9[_0x43e7('0x56')]=qs[_0x43e7('0x4d')](_0x47f29f[_0x43e7('0x2c')][_0x43e7('0x4d')]);_0xc62dc9['where']=qs[_0x43e7('0x4e')](_[_0x43e7('0x4f')](_0x47f29f[_0x43e7('0x2c')],_0x1480c6[_0x43e7('0x4e')]));if(_0x47f29f['query']['filter']){_0xc62dc9[_0x43e7('0x2a')]=_[_0x43e7('0x36')](_0xc62dc9[_0x43e7('0x2a')],{'$or':_[_0x43e7('0x1a')](_0xc62dc9['attributes'],function(_0x2f529b){var _0x427cec={};_0x427cec[_0x2f529b]={'$like':'%'+_0x47f29f[_0x43e7('0x2c')][_0x43e7('0x19')]+'%'};return _0x427cec;})});}_0xc62dc9=_[_0x43e7('0x36')]({},_0xc62dc9,_0x47f29f[_0x43e7('0x51')]);return _0x21d001['getTeams'](_0xc62dc9);}})[_0x43e7('0x13')](function(_0x52c974){if(_0x52c974){_0x4600e5=_0x52c974['length'];if(!_0x47f29f[_0x43e7('0x2c')][_0x43e7('0x4b')]('nolimit')){_0xc62dc9['limit']=qs[_0x43e7('0x11')](_0x47f29f[_0x43e7('0x2c')]['limit']);_0xc62dc9[_0x43e7('0xe')]=qs[_0x43e7('0xe')](_0x47f29f[_0x43e7('0x2c')][_0x43e7('0xe')]);}return _0x21d001['getTeams'](_0xc62dc9);}})['then'](function(_0x2a084b){if(_0x2a084b){return _0x2a084b?{'count':_0x4600e5,'rows':_0x2a084b}:null;}})[_0x43e7('0x13')](respondWithResult(_0x4e5484,null))[_0x43e7('0x2e')](handleError(_0x4e5484,null));};exports['addTeams']=function(_0x49de67,_0x298239){var _0xf682ec=_0x49de67[_0x43e7('0x39')][_0x43e7('0x5b')];var _0x1e247f=_[_0x43e7('0x1a')](_0xf682ec,'id');return db[_0x43e7('0x5a')][_0x43e7('0x2d')]({'where':{'id':_0x1e247f},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name',_0x43e7('0x5c'),'voicePause',_0x43e7('0x5d')],'raw':!![]}]})[_0x43e7('0x13')](function(_0x44fee0){if(_0x44fee0){var _0x41d130=_[_0x43e7('0x5e')](_0x44fee0,function(_0x5e87d6){var _0x21039a=_0x5e87d6[_0x43e7('0x15')]({'plain':!![]});_0x21039a[_0x43e7('0x5f')][_0x43e7('0x60')](function(_0x59f68a){_0x59f68a[_0x43e7('0x61')]=_[_0x43e7('0x37')](_0xf682ec,{'id':_0x21039a['id']})[_0x43e7('0x61')];});return _0x21039a[_0x43e7('0x5f')];});return db[_0x43e7('0x25')][_0x43e7('0x37')]({'where':{'id':_0x49de67[_0x43e7('0x40')]['id']}})['then'](function(_0xc9356c){return db[_0x43e7('0x62')][_0x43e7('0x63')](function(_0x3637d9){return _0xc9356c[_0x43e7('0x64')](_0x1e247f,{'transaction':_0x3637d9})['then'](function(){return BPromise[_0x43e7('0x65')](_0xf682ec,function(_0x25ddf8){return db['TeamVoiceQueue'][_0x43e7('0x66')]({'TeamId':_0x25ddf8['id'],'VoiceQueueId':_0x49de67[_0x43e7('0x40')]['id'],'penalty':_0x25ddf8['penalty']},{'transaction':_0x3637d9});});})[_0x43e7('0x13')](function(){return BPromise[_0x43e7('0x65')](_0x41d130,function(_0x110154){return db[_0x43e7('0x67')][_0x43e7('0x68')]({'where':{'UserId':_0x110154['id'],'VoiceQueueId':_0x49de67['params']['id']},'defaults':{'penalty':_0x110154[_0x43e7('0x61')]},'transaction':_0x3637d9});});})[_0x43e7('0x13')](function(){return BPromise[_0x43e7('0x65')](_['filter'](_0x41d130,{'online':!![]}),function(_0x32b788){return db[_0x43e7('0x69')]['upsert']({'membername':_0x32b788[_0x43e7('0x21')],'UserId':_0x32b788['id'],'queue_name':_0xc9356c[_0x43e7('0x21')],'VoiceQueueId':_0xc9356c['id'],'interface':_[_0x43e7('0x6a')](_0x32b788[_0x43e7('0x5d')])?util[_0x43e7('0x6b')](_0x43e7('0x6c'),_0x32b788['name']):_0x32b788[_0x43e7('0x5d')],'paused':_0x32b788[_0x43e7('0x6d')]||![],'penalty':_0x32b788[_0x43e7('0x61')]},{'transaction':_0x3637d9});});})['then'](function(){_0x41d130[_0x43e7('0x60')](function(_0x21901c){socket[_0x43e7('0x6e')](_0x43e7('0x6f'),{'UserId':_0x21901c['id'],'VoiceQueueId':_0xc9356c['id']});});});});});}})[_0x43e7('0x13')](respondWithStatusCode(_0x298239,null))[_0x43e7('0x2e')](handleError(_0x298239,null));};exports[_0x43e7('0x70')]=function(_0x1896b3,_0x4345a5){return db['Team'][_0x43e7('0x2d')]({'where':{'id':_0x1896b3[_0x43e7('0x2c')][_0x43e7('0x71')]},'attributes':['id'],'include':[{'model':db[_0x43e7('0x72')],'as':_0x43e7('0x5f'),'attributes':['id'],'raw':!![]}]})[_0x43e7('0x13')](handleEntityNotFound(_0x4345a5,null))[_0x43e7('0x13')](function(_0x3e8631){var _0x51e17c=_[_0x43e7('0x1a')](_0x3e8631,'id');var _0x6246c4=[];var _0xd0dca2=[];var _0xa721ba=squel[_0x43e7('0x73')]();_0xa721ba['field'](_0x43e7('0x74'))[_0x43e7('0x75')](_0x43e7('0x76'),'tq')[_0x43e7('0x77')](_0x43e7('0x78'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x43e7('0x2a')]('VoiceQueueId\x20=\x20?',_0x1896b3[_0x43e7('0x40')]['id']);for(var _0x339826=0x0;_0x339826<_0x3e8631[_0x43e7('0x34')];_0x339826+=0x1){let _0xc28ac6=_0x3e8631[_0x339826];for(var _0x4b0abd=0x0;_0x4b0abd<_0xc28ac6[_0x43e7('0x5f')][_0x43e7('0x34')];_0x4b0abd+=0x1){let _0x41d636=_0xc28ac6[_0x43e7('0x5f')][_0x4b0abd];var _0x19bdf7=_0xa721ba[_0x43e7('0x3f')]();_0x19bdf7[_0x43e7('0x2a')](_0x43e7('0x79'),_0x41d636['id']);_0xd0dca2[_0x43e7('0x7a')](db[_0x43e7('0x62')][_0x43e7('0x2c')](_0x19bdf7['toString'](),{'type':db['sequelize'][_0x43e7('0x7b')]['SELECT']})['then'](function(_0x4a0d5d){if(_0x4a0d5d[_0x43e7('0x34')]===0x1){return _0x41d636['id'];}else{var _0x5eae45=_[_0x43e7('0x7c')](_['map'](_0x4a0d5d,'TeamId'),function(_0x55f1df){return _[_0x43e7('0x1c')](_0x51e17c,_0x55f1df);});if(_0x5eae45){return _0x41d636['id'];}}}));}}return BPromise[_0x43e7('0x7d')](_0xd0dca2)[_0x43e7('0x13')](function(_0xd6ebb0){_0x6246c4=_(_0x6246c4)[_0x43e7('0x7e')](_0xd6ebb0)[_0x43e7('0x7f')]()[_0x43e7('0x1b')]();return db[_0x43e7('0x25')][_0x43e7('0x37')]({'where':{'id':_0x1896b3[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](function(_0x2a1218){return db[_0x43e7('0x62')][_0x43e7('0x63')](function(_0xe14e67){return _0x2a1218[_0x43e7('0x70')](_0x1896b3[_0x43e7('0x2c')][_0x43e7('0x71')],{'transaction':_0xe14e67})[_0x43e7('0x13')](function(){if(!_[_0x43e7('0x80')](_0x6246c4)){return _0x2a1218['removeAgents'](_0x6246c4,{'transaction':_0xe14e67})[_0x43e7('0x13')](function(){return db[_0x43e7('0x69')]['destroy']({'where':{'VoiceQueueId':_0x1896b3[_0x43e7('0x40')]['id'],'UserId':_0x6246c4},'transaction':_0xe14e67});});}})[_0x43e7('0x13')](function(){_0x6246c4[_0x43e7('0x60')](function(_0x32b33c){socket['emit'](_0x43e7('0x81'),{'UserId':_0x32b33c,'VoiceQueueId':_0x2a1218['id']});});});});});});})[_0x43e7('0x13')](respondWithStatusCode(_0x4345a5,null))['catch'](handleError(_0x4345a5,null));};exports[_0x43e7('0x82')]=function(_0x1a520e,_0xb4cf23){var _0x559145,_0x22b824;return db[_0x43e7('0x25')][_0x43e7('0x37')]({'where':{'id':_0x1a520e[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0xb4cf23,null))['then'](function(_0x33b63b){if(_0x33b63b){_0x22b824=_0x33b63b;return _0x33b63b[_0x43e7('0x82')](_0x1a520e['body'][_0x43e7('0x71')],_['omit'](_0x1a520e['body'],['ids','id'])||{})['spread'](function(_0x255113){for(var _0x451fb5=0x0;_0x451fb5<_0x1a520e[_0x43e7('0x39')][_0x43e7('0x71')]['length'];_0x451fb5+=0x1){socket['emit'](_0x43e7('0x6f'),{'UserId':Number(_0x1a520e['body'][_0x43e7('0x71')][_0x451fb5]),'VoiceQueueId':Number(_0x1a520e['params']['id'])});}return _0x255113;});}})[_0x43e7('0x13')](function(_0x4cf7e9){_0x559145=_0x4cf7e9||[];if(_0x22b824){return db['User']['findAll']({'where':{'id':_0x1a520e['body'][_0x43e7('0x71')]},'attributes':['id',_0x43e7('0x21'),_0x43e7('0x5c'),'voicePause',_0x43e7('0x5d')],'raw':!![]});}})[_0x43e7('0x13')](function(_0x517289){if(!_['isEmpty'](_0x517289)){var _0x25fd39=[];for(var _0xb2aca0=0x0;_0xb2aca0<_0x517289[_0x43e7('0x34')];_0xb2aca0++){if(_0x517289[_0xb2aca0][_0x43e7('0x5c')]){_0x25fd39['push'](db[_0x43e7('0x69')]['upsert']({'membername':_0x517289[_0xb2aca0][_0x43e7('0x21')],'UserId':_0x517289[_0xb2aca0]['id'],'queue_name':_0x22b824[_0x43e7('0x21')],'VoiceQueueId':_0x22b824['id'],'interface':_[_0x43e7('0x6a')](_0x517289[_0xb2aca0][_0x43e7('0x5d')])?util[_0x43e7('0x6b')](_0x43e7('0x6c'),_0x517289[_0xb2aca0][_0x43e7('0x21')]):_0x517289[_0xb2aca0]['interface'],'paused':_0x517289[_0xb2aca0][_0x43e7('0x6d')]||![],'penalty':_0x1a520e[_0x43e7('0x39')]['penalty']||0x0}));}}return BPromise[_0x43e7('0x7d')](_0x25fd39);}})[_0x43e7('0x13')](function(){return _0x559145;})[_0x43e7('0x13')](respondWithResult(_0xb4cf23,null))[_0x43e7('0x2e')](handleError(_0xb4cf23,null));};exports[_0x43e7('0x83')]=function(_0x4fd17e,_0x3fd573){return db['VoiceQueue'][_0x43e7('0x37')]({'where':{'id':_0x4fd17e['params']['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x3fd573,null))[_0x43e7('0x13')](function(_0x4446cb){if(_0x4446cb){return _0x4446cb[_0x43e7('0x83')](_0x4fd17e[_0x43e7('0x2c')]['ids'])[_0x43e7('0x13')](function(){if(_['isArray'](_0x4fd17e[_0x43e7('0x2c')][_0x43e7('0x71')])){for(var _0x34d476=0x0;_0x34d476<_0x4fd17e['query'][_0x43e7('0x71')][_0x43e7('0x34')];_0x34d476+=0x1){socket[_0x43e7('0x6e')](_0x43e7('0x81'),{'UserId':Number(_0x4fd17e[_0x43e7('0x2c')]['ids'][_0x34d476]),'VoiceQueueId':Number(_0x4fd17e[_0x43e7('0x40')]['id'])});}}else{socket['emit'](_0x43e7('0x81'),{'UserId':Number(_0x4fd17e[_0x43e7('0x2c')][_0x43e7('0x71')]),'VoiceQueueId':Number(_0x4fd17e[_0x43e7('0x40')]['id'])});}});}})[_0x43e7('0x13')](function(_0x34ed9e){return db[_0x43e7('0x69')]['destroy']({'where':{'VoiceQueueId':_0x4fd17e[_0x43e7('0x40')]['id'],'UserId':_0x4fd17e['query'][_0x43e7('0x71')]}})[_0x43e7('0x13')](function(){return _0x34ed9e;});})[_0x43e7('0x13')](respondWithStatusCode(_0x3fd573,null))[_0x43e7('0x2e')](handleError(_0x3fd573,null));};exports[_0x43e7('0x84')]=function(_0xf9178f,_0x3bb7ab){var _0x2be8c7={};var _0x2bb14d={};var _0x57f7ea;var _0x240478;return db['VoiceQueue'][_0x43e7('0x49')]({'where':{'id':_0xf9178f[_0x43e7('0x40')]['id']}})['then'](handleEntityNotFound(_0x3bb7ab,null))[_0x43e7('0x13')](function(_0x381e47){if(_0x381e47){_0x57f7ea=_0x381e47;_0x2bb14d['model']=_[_0x43e7('0x41')](db[_0x43e7('0x72')][_0x43e7('0x26')]);_0x2bb14d[_0x43e7('0x2c')]=_[_0x43e7('0x41')](_0xf9178f[_0x43e7('0x2c')]);_0x2bb14d[_0x43e7('0x4e')]=_[_0x43e7('0x30')](_0x2bb14d['model'],_0x2bb14d[_0x43e7('0x2c')]);_0x2be8c7[_0x43e7('0x32')]=_[_0x43e7('0x30')](_0x2bb14d['model'],qs[_0x43e7('0x33')](_0xf9178f[_0x43e7('0x2c')]['fields']));_0x2be8c7[_0x43e7('0x32')]=_0x2be8c7[_0x43e7('0x32')]['length']?_0x2be8c7[_0x43e7('0x32')]:_0x2bb14d[_0x43e7('0x31')];_0x2be8c7[_0x43e7('0x56')]=qs['sort'](_0xf9178f[_0x43e7('0x2c')][_0x43e7('0x4d')]);_0x2be8c7['where']=qs[_0x43e7('0x4e')](_[_0x43e7('0x4f')](_0xf9178f[_0x43e7('0x2c')],_0x2bb14d[_0x43e7('0x4e')]));if(_0xf9178f['query']['filter']){_0x2be8c7[_0x43e7('0x2a')]=_[_0x43e7('0x36')](_0x2be8c7[_0x43e7('0x2a')],{'$or':_[_0x43e7('0x1a')](_0x2be8c7['attributes'],function(_0x1e6245){var _0x36860d={};_0x36860d[_0x1e6245]={'$like':'%'+_0xf9178f[_0x43e7('0x2c')][_0x43e7('0x19')]+'%'};return _0x36860d;})});}_0x2be8c7=_['merge']({},_0x2be8c7,_0xf9178f[_0x43e7('0x51')]);return _0x57f7ea[_0x43e7('0x84')](_0x2be8c7);}})[_0x43e7('0x13')](function(_0x3ff5d6){if(_0x3ff5d6){_0x240478=_0x3ff5d6[_0x43e7('0x34')];if(!_0xf9178f['query']['hasOwnProperty']('nolimit')){_0x2be8c7[_0x43e7('0x11')]=qs[_0x43e7('0x11')](_0xf9178f[_0x43e7('0x2c')]['limit']);_0x2be8c7[_0x43e7('0xe')]=qs['offset'](_0xf9178f[_0x43e7('0x2c')][_0x43e7('0xe')]);}return _0x57f7ea[_0x43e7('0x84')](_0x2be8c7);}})[_0x43e7('0x13')](function(_0x249a8d){if(_0x249a8d){return _0x249a8d?{'count':_0x240478,'rows':_0x249a8d}:null;}})[_0x43e7('0x13')](respondWithResult(_0x3bb7ab,null))['catch'](handleError(_0x3bb7ab,null));};exports[_0x43e7('0x85')]=function(_0x202421,_0x12e4a3){var _0x16ca0e={};var _0x2f467b={};var _0x7f43b5;var _0x4637f6;return db[_0x43e7('0x25')][_0x43e7('0x49')]({'where':{'id':_0x202421[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x12e4a3,null))[_0x43e7('0x13')](function(_0x24e9a7){if(_0x24e9a7){_0x7f43b5=_0x24e9a7;_0x2f467b['model']=_[_0x43e7('0x41')](db[_0x43e7('0x69')]['rawAttributes']);_0x2f467b[_0x43e7('0x2c')]=_[_0x43e7('0x41')](_0x202421['query']);_0x2f467b[_0x43e7('0x4e')]=_[_0x43e7('0x30')](_0x2f467b[_0x43e7('0x31')],_0x2f467b['query']);_0x16ca0e['attributes']=_[_0x43e7('0x30')](_0x2f467b[_0x43e7('0x31')],qs[_0x43e7('0x33')](_0x202421[_0x43e7('0x2c')][_0x43e7('0x33')]));_0x16ca0e[_0x43e7('0x32')]=_0x16ca0e[_0x43e7('0x32')][_0x43e7('0x34')]?_0x16ca0e['attributes']:_0x2f467b[_0x43e7('0x31')];_0x16ca0e[_0x43e7('0x56')]=qs[_0x43e7('0x4d')](_0x202421[_0x43e7('0x2c')][_0x43e7('0x4d')]);_0x16ca0e[_0x43e7('0x2a')]=qs[_0x43e7('0x4e')](_[_0x43e7('0x4f')](_0x202421[_0x43e7('0x2c')],_0x2f467b[_0x43e7('0x4e')]));if(_0x202421[_0x43e7('0x2c')][_0x43e7('0x19')]){_0x16ca0e['where']=_[_0x43e7('0x36')](_0x16ca0e[_0x43e7('0x2a')],{'$or':_[_0x43e7('0x1a')](_0x16ca0e[_0x43e7('0x32')],function(_0x49f43c){var _0xad02f6={};_0xad02f6[_0x49f43c]={'$like':'%'+_0x202421['query'][_0x43e7('0x19')]+'%'};return _0xad02f6;})});}_0x16ca0e=_['merge']({},_0x16ca0e,_0x202421[_0x43e7('0x51')]);return _0x7f43b5[_0x43e7('0x85')](_0x16ca0e);}})[_0x43e7('0x13')](function(_0x4a500c){if(_0x4a500c){_0x4637f6=_0x4a500c[_0x43e7('0x34')];if(!_0x202421[_0x43e7('0x2c')]['hasOwnProperty'](_0x43e7('0x4c'))){_0x16ca0e['limit']=qs[_0x43e7('0x11')](_0x202421[_0x43e7('0x2c')][_0x43e7('0x11')]);_0x16ca0e[_0x43e7('0xe')]=qs['offset'](_0x202421[_0x43e7('0x2c')][_0x43e7('0xe')]);}return _0x7f43b5[_0x43e7('0x85')](_0x16ca0e);}})['then'](function(_0x12c4f9){return _0x12c4f9?{'count':_0x4637f6,'rows':_0x12c4f9}:null;})[_0x43e7('0x13')](respondWithResult(_0x12e4a3,null))[_0x43e7('0x2e')](handleError(_0x12e4a3,null));};exports[_0x43e7('0x86')]=function(_0x77c2f,_0x1e4a25){var _0x5790b5={};var _0x3f057e={};var _0x505287;var _0x221938;return db[_0x43e7('0x25')]['findOne']({'where':{'id':_0x77c2f[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x1e4a25,null))['then'](function(_0x46aa47){if(_0x46aa47){_0x505287=_0x46aa47;_0x3f057e[_0x43e7('0x31')]=_[_0x43e7('0x41')](db[_0x43e7('0x87')]['rawAttributes']);_0x3f057e['query']=_[_0x43e7('0x41')](_0x77c2f[_0x43e7('0x2c')]);_0x3f057e[_0x43e7('0x4e')]=_[_0x43e7('0x30')](_0x3f057e[_0x43e7('0x31')],_0x3f057e[_0x43e7('0x2c')]);_0x5790b5[_0x43e7('0x32')]=_[_0x43e7('0x30')](_0x3f057e['model'],qs[_0x43e7('0x33')](_0x77c2f[_0x43e7('0x2c')]['fields']));_0x5790b5[_0x43e7('0x32')]=_0x5790b5[_0x43e7('0x32')][_0x43e7('0x34')]?_0x5790b5[_0x43e7('0x32')]:_0x3f057e[_0x43e7('0x31')];_0x5790b5[_0x43e7('0x56')]=qs[_0x43e7('0x4d')](_0x77c2f['query'][_0x43e7('0x4d')]);_0x5790b5['where']=qs[_0x43e7('0x4e')](_[_0x43e7('0x4f')](_0x77c2f['query'],_0x3f057e[_0x43e7('0x4e')]));if(_0x77c2f['query'][_0x43e7('0x19')]){_0x5790b5[_0x43e7('0x2a')]=_[_0x43e7('0x36')](_0x5790b5['where'],{'$or':_['map'](_0x5790b5[_0x43e7('0x32')],function(_0xcfecd2){var _0x4cd879={};_0x4cd879[_0xcfecd2]={'$like':'%'+_0x77c2f[_0x43e7('0x2c')][_0x43e7('0x19')]+'%'};return _0x4cd879;})});}_0x5790b5=_[_0x43e7('0x36')]({},_0x5790b5,_0x77c2f['options']);return _0x505287[_0x43e7('0x86')](_0x5790b5);}})[_0x43e7('0x13')](function(_0xb2eb62){if(_0xb2eb62){_0x221938=_0xb2eb62['length'];if(!_0x77c2f[_0x43e7('0x2c')][_0x43e7('0x4b')](_0x43e7('0x4c'))){_0x5790b5[_0x43e7('0x11')]=qs[_0x43e7('0x11')](_0x77c2f[_0x43e7('0x2c')]['limit']);_0x5790b5[_0x43e7('0xe')]=qs[_0x43e7('0xe')](_0x77c2f[_0x43e7('0x2c')][_0x43e7('0xe')]);}return _0x505287[_0x43e7('0x86')](_0x5790b5);}})[_0x43e7('0x13')](function(_0x34ab5a){if(_0x34ab5a){return _0x34ab5a?{'count':_0x221938,'rows':_0x34ab5a}:null;}})[_0x43e7('0x13')](respondWithResult(_0x1e4a25,null))[_0x43e7('0x2e')](handleError(_0x1e4a25,null));};exports[_0x43e7('0x88')]=function(_0x13133c,_0x288d6a){var _0x47ef9d=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x56598f,_0x280668;return db[_0x43e7('0x25')][_0x43e7('0x37')]({'where':{'id':_0x13133c[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x288d6a,null))[_0x43e7('0x13')](function(_0x51dc07){if(_0x51dc07){_0x280668=_0x51dc07;return _0x51dc07['addLists'](_0x13133c[_0x43e7('0x39')][_0x43e7('0x71')],_['omit'](_0x13133c['body'],[_0x43e7('0x71'),'id'])||{});}return null;})[_0x43e7('0x89')](function(_0x58a783){var _0x3d6659;_0x56598f=_0x58a783||[];var _0x57bcab=[];if(_0x58a783){for(var _0x5f4023=0x0;_0x5f4023<_0x58a783[_0x43e7('0x34')];_0x5f4023+=0x1){var _0x2be66d=_0x58a783[_0x5f4023]['get']({'plain':!![]});_0x280668['dialCheckDuplicateType']=_0x13133c[_0x43e7('0x39')][_0x43e7('0x8a')]?_0x13133c[_0x43e7('0x39')][_0x43e7('0x8a')]:_0x280668['dialCheckDuplicateType'];switch(_0x280668[_0x43e7('0x8a')]){case _0x43e7('0x8b'):_0x3d6659=squel['insert']()['into']('cm_hopper')['fromQuery']([_0x43e7('0x8c'),_0x43e7('0x8d'),'ContactId','ListId',_0x43e7('0x50'),_0x43e7('0x44'),_0x43e7('0x43')],squel[_0x43e7('0x73')]()[_0x43e7('0x8e')]('phone',_0x43e7('0x8c'))[_0x43e7('0x8e')]('\x27'+_0x47ef9d+'\x27',_0x43e7('0x8d'))[_0x43e7('0x8e')]('id',_0x43e7('0x8f'))['field'](_0x2be66d[_0x43e7('0x90')][_0x43e7('0x91')](),_0x43e7('0x92'))[_0x43e7('0x8e')](_0x13133c['params']['id'][_0x43e7('0x91')](),_0x43e7('0x50'))[_0x43e7('0x8e')]('\x27'+_0x47ef9d+'\x27',_0x43e7('0x44'))[_0x43e7('0x8e')]('\x27'+_0x47ef9d+'\x27',_0x43e7('0x43'))['from'](_0x43e7('0x93'))[_0x43e7('0x2a')](_0x43e7('0x94'))[_0x43e7('0x2a')]('ListId\x20=\x20?',_0x2be66d[_0x43e7('0x90')]['toString']())[_0x43e7('0x2a')]('phone\x20IS\x20NOT\x20NULL')[_0x43e7('0x2a')]('phone\x20NOT\x20IN\x20(?)',squel[_0x43e7('0x73')]()['field'](_0x43e7('0x95'))[_0x43e7('0x75')](_0x43e7('0x96'))[_0x43e7('0x2a')](_0x43e7('0x97'),_0x13133c[_0x43e7('0x40')]['id'][_0x43e7('0x91')]()))[_0x43e7('0x2a')](_0x43e7('0x98'),squel[_0x43e7('0x73')]()['field']('COALESCE(phone,\x27\x27)')['from'](_0x43e7('0x99'))['where']('VoiceQueueId\x20=\x20?',_0x13133c[_0x43e7('0x40')]['id'][_0x43e7('0x91')]())))[_0x43e7('0x91')]();break;case _0x43e7('0x9a'):_0x3d6659=squel[_0x43e7('0x9b')]()[_0x43e7('0x9c')](_0x43e7('0x99'))[_0x43e7('0x9d')]([_0x43e7('0x8c'),_0x43e7('0x8d'),_0x43e7('0x8f'),'ListId',_0x43e7('0x50'),_0x43e7('0x44'),_0x43e7('0x43')],squel['select']()[_0x43e7('0x8e')](_0x43e7('0x8c'),_0x43e7('0x8c'))['field']('\x27'+_0x47ef9d+'\x27',_0x43e7('0x8d'))[_0x43e7('0x8e')]('id',_0x43e7('0x8f'))[_0x43e7('0x8e')](_0x2be66d[_0x43e7('0x90')][_0x43e7('0x91')](),_0x43e7('0x92'))['field'](_0x13133c['params']['id'][_0x43e7('0x91')](),_0x43e7('0x50'))[_0x43e7('0x8e')]('\x27'+_0x47ef9d+'\x27','createdAt')['field']('\x27'+_0x47ef9d+'\x27',_0x43e7('0x43'))['from'](_0x43e7('0x93'))['where'](_0x43e7('0x94'))[_0x43e7('0x2a')]('ListId\x20=\x20?',_0x2be66d[_0x43e7('0x90')][_0x43e7('0x91')]())[_0x43e7('0x2a')](_0x43e7('0x9e'))['where'](_0x43e7('0x98'),squel[_0x43e7('0x73')]()[_0x43e7('0x8e')](_0x43e7('0x9f'))['from']('cm_hopper')[_0x43e7('0x2a')]('VoiceQueueId\x20=\x20?',_0x13133c['params']['id'][_0x43e7('0x91')]())))[_0x43e7('0x91')]();break;default:_0x3d6659=squel[_0x43e7('0x9b')]()[_0x43e7('0x9c')]('cm_hopper')[_0x43e7('0x9d')]([_0x43e7('0x8c'),_0x43e7('0x8d'),_0x43e7('0x8f'),_0x43e7('0x92'),_0x43e7('0x50'),'createdAt','updatedAt'],squel[_0x43e7('0x73')]()[_0x43e7('0x8e')](_0x43e7('0x8c'),_0x43e7('0x8c'))[_0x43e7('0x8e')]('\x27'+_0x47ef9d+'\x27',_0x43e7('0x8d'))['field']('id',_0x43e7('0x8f'))[_0x43e7('0x8e')](_0x2be66d[_0x43e7('0x90')][_0x43e7('0x91')](),'ListId')[_0x43e7('0x8e')](_0x13133c['params']['id'][_0x43e7('0x91')](),_0x43e7('0x50'))['field']('\x27'+_0x47ef9d+'\x27',_0x43e7('0x44'))['field']('\x27'+_0x47ef9d+'\x27',_0x43e7('0x43'))[_0x43e7('0x75')]('cm_contacts')[_0x43e7('0x2a')](_0x43e7('0x94'))[_0x43e7('0x2a')](_0x43e7('0xa0'),_0x2be66d[_0x43e7('0x90')][_0x43e7('0x91')]())[_0x43e7('0x2a')](_0x43e7('0x9e')))[_0x43e7('0x91')]();}_0x57bcab['push'](db['sequelize'][_0x43e7('0x2c')](_0x3d6659));}return BPromise[_0x43e7('0x7d')](_0x57bcab);}})[_0x43e7('0x13')](function(){var _0x3ac223=[];var _0x486780=squel[_0x43e7('0x9b')]()[_0x43e7('0x9c')](_0x43e7('0xa1'))[_0x43e7('0x9d')]([_0x43e7('0xa2'),_0x43e7('0x8c'),_0x43e7('0xa3'),'createdAt',_0x43e7('0x43')],squel['select']()['field']('h.id')[_0x43e7('0x8e')](_0x43e7('0xa4'))[_0x43e7('0x8e')](_0x43e7('0xa5'))[_0x43e7('0x8e')]('\x27'+_0x47ef9d+'\x27','createdAt')['field']('\x27'+_0x47ef9d+'\x27',_0x43e7('0x43'))['from'](_0x43e7('0xa6'),'ci')['join'](_0x43e7('0x99'),'h',_0x43e7('0xa7'))[_0x43e7('0x2a')](_0x43e7('0xa8'),_0x47ef9d)['where']('ci.ItemClass=?',_0x43e7('0xa9')))[_0x43e7('0x91')]();_0x3ac223['push'](db['sequelize'][_0x43e7('0x2c')](_0x486780));return BPromise[_0x43e7('0x7d')](_0x3ac223);})[_0x43e7('0x13')](function(){return _0x56598f;})[_0x43e7('0x13')](respondWithResult(_0x288d6a,null))[_0x43e7('0x2e')](handleError(_0x288d6a,null));};exports[_0x43e7('0xaa')]=function(_0x71807e,_0x314259){return db[_0x43e7('0x25')][_0x43e7('0x37')]({'where':{'id':_0x71807e['params']['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x314259,null))[_0x43e7('0x13')](function(_0x2613fc){if(_0x2613fc){return _0x2613fc[_0x43e7('0xaa')](_0x71807e['query'][_0x43e7('0x71')]);}})['then'](function(_0x17b298){if(_0x17b298){return db[_0x43e7('0x4a')][_0x43e7('0x14')]({'where':{'ListId':_0x71807e[_0x43e7('0x2c')]['ids'],'VoiceQueueId':_0x71807e['params']['id']}})[_0x43e7('0x13')](function(){return _0x17b298;});}})['then'](respondWithStatusCode(_0x314259,null))[_0x43e7('0x2e')](handleError(_0x314259,null));};exports[_0x43e7('0xab')]=function(_0x44c536,_0x3a9550){var _0x5dcd3f={};var _0x2e7f00={};var _0x2627e2;var _0x591517;return db['VoiceQueue'][_0x43e7('0x49')]({'where':{'id':_0x44c536[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x3a9550,null))[_0x43e7('0x13')](function(_0x5e042f){if(_0x5e042f){_0x2627e2=_0x5e042f;_0x2e7f00['model']=_[_0x43e7('0x41')](db[_0x43e7('0x87')][_0x43e7('0x26')]);_0x2e7f00[_0x43e7('0x2c')]=_[_0x43e7('0x41')](_0x44c536[_0x43e7('0x2c')]);_0x2e7f00[_0x43e7('0x4e')]=_['intersection'](_0x2e7f00[_0x43e7('0x31')],_0x2e7f00[_0x43e7('0x2c')]);_0x5dcd3f[_0x43e7('0x32')]=_[_0x43e7('0x30')](_0x2e7f00[_0x43e7('0x31')],qs[_0x43e7('0x33')](_0x44c536[_0x43e7('0x2c')][_0x43e7('0x33')]));_0x5dcd3f[_0x43e7('0x32')]=_0x5dcd3f[_0x43e7('0x32')][_0x43e7('0x34')]?_0x5dcd3f[_0x43e7('0x32')]:_0x2e7f00[_0x43e7('0x31')];_0x5dcd3f[_0x43e7('0x56')]=qs[_0x43e7('0x4d')](_0x44c536[_0x43e7('0x2c')][_0x43e7('0x4d')]);_0x5dcd3f['where']=qs[_0x43e7('0x4e')](_[_0x43e7('0x4f')](_0x44c536[_0x43e7('0x2c')],_0x2e7f00[_0x43e7('0x4e')]));if(_0x44c536[_0x43e7('0x2c')]['filter']){_0x5dcd3f[_0x43e7('0x2a')]=_[_0x43e7('0x36')](_0x5dcd3f[_0x43e7('0x2a')],{'$or':_[_0x43e7('0x1a')](_0x5dcd3f[_0x43e7('0x32')],function(_0x5278fd){var _0x84b4f4={};_0x84b4f4[_0x5278fd]={'$like':'%'+_0x44c536['query']['filter']+'%'};return _0x84b4f4;})});}_0x5dcd3f=_['merge']({},_0x5dcd3f,_0x44c536[_0x43e7('0x51')]);return _0x2627e2[_0x43e7('0xab')](_0x5dcd3f);}})[_0x43e7('0x13')](function(_0x4ee587){if(_0x4ee587){_0x591517=_0x4ee587[_0x43e7('0x34')];if(!_0x44c536[_0x43e7('0x2c')]['hasOwnProperty'](_0x43e7('0x4c'))){_0x5dcd3f[_0x43e7('0x11')]=qs['limit'](_0x44c536[_0x43e7('0x2c')][_0x43e7('0x11')]);_0x5dcd3f[_0x43e7('0xe')]=qs[_0x43e7('0xe')](_0x44c536[_0x43e7('0x2c')]['offset']);}return _0x2627e2[_0x43e7('0xab')](_0x5dcd3f);}})[_0x43e7('0x13')](function(_0x3b641e){if(_0x3b641e){return _0x3b641e?{'count':_0x591517,'rows':_0x3b641e}:null;}})[_0x43e7('0x13')](respondWithResult(_0x3a9550,null))[_0x43e7('0x2e')](handleError(_0x3a9550,null));};exports['addBlackLists']=function(_0x5b046d,_0x4a0427){var _0xc3460c;return db[_0x43e7('0x25')][_0x43e7('0x37')]({'where':{'id':_0x5b046d[_0x43e7('0x40')]['id']}})['then'](handleEntityNotFound(_0x4a0427,null))[_0x43e7('0x13')](function(_0x19c1d2){if(_0x19c1d2){return _0x19c1d2[_0x43e7('0xac')](_0x5b046d['body'][_0x43e7('0x71')],_['omit'](_0x5b046d[_0x43e7('0x39')],[_0x43e7('0x71'),'id'])||{});}return null;})[_0x43e7('0x89')](function(_0x40cc83){var _0x148d72;_0xc3460c=_0x40cc83||[];var _0x1ceb94=[];if(_0x40cc83){for(var _0x19c29b=0x0;_0x19c29b<_0x40cc83[_0x43e7('0x34')];_0x19c29b+=0x1){var _0x38a8db=_0x40cc83[_0x19c29b]['get']({'plain':!![]});_0x148d72=squel[_0x43e7('0x9b')]()[_0x43e7('0x9c')]('cm_hopper_black')['fromQuery']([_0x43e7('0x8c'),_0x43e7('0x8f'),_0x43e7('0x92'),_0x43e7('0x50'),_0x43e7('0x44'),_0x43e7('0x43')],squel[_0x43e7('0x73')]()[_0x43e7('0x8e')](_0x43e7('0x8c'),_0x43e7('0x8c'))[_0x43e7('0x8e')]('id','ContactId')[_0x43e7('0x8e')](_0x38a8db['CmListId'][_0x43e7('0x91')](),_0x43e7('0x92'))[_0x43e7('0x8e')](_0x5b046d[_0x43e7('0x40')]['id']['toString'](),_0x43e7('0x50'))[_0x43e7('0x8e')]('NOW()',_0x43e7('0x44'))[_0x43e7('0x8e')](_0x43e7('0xad'),_0x43e7('0x43'))[_0x43e7('0x75')](_0x43e7('0x93'))[_0x43e7('0x2a')]('deletedAt\x20IS\x20NULL')[_0x43e7('0x2a')](_0x43e7('0xa0'),_0x38a8db[_0x43e7('0x90')][_0x43e7('0x91')]())[_0x43e7('0x2a')](_0x43e7('0x9e')))[_0x43e7('0x91')]();_0x1ceb94[_0x43e7('0x7a')](db[_0x43e7('0x62')]['query'](_0x148d72));}return BPromise[_0x43e7('0x7d')](_0x1ceb94);}})['then'](function(){return _0xc3460c;})[_0x43e7('0x13')](respondWithResult(_0x4a0427,null))[_0x43e7('0x2e')](handleError(_0x4a0427,null));};exports[_0x43e7('0xae')]=function(_0x1dc579,_0x6d9fb){return db[_0x43e7('0x25')][_0x43e7('0x37')]({'where':{'id':_0x1dc579['params']['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x6d9fb,null))['then'](function(_0x59ca95){if(_0x59ca95){return _0x59ca95[_0x43e7('0xae')](_0x1dc579['query']['ids']);}})[_0x43e7('0x13')](function(_0x759eb5){if(_0x759eb5){return db[_0x43e7('0x58')][_0x43e7('0x14')]({'where':{'ListId':_0x1dc579['query'][_0x43e7('0x71')],'VoiceQueueId':_0x1dc579['params']['id']}})[_0x43e7('0x13')](function(){return _0x759eb5;});}})[_0x43e7('0x13')](respondWithStatusCode(_0x6d9fb,null))[_0x43e7('0x2e')](handleError(_0x6d9fb,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index ea7d4a7..77249de 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 _0xb00e=['events','../../mysqldb','save','remove','emit','hasOwnProperty','hook'];(function(_0x37e2a6,_0x1529c0){var _0x586479=function(_0x290ee7){while(--_0x290ee7){_0x37e2a6['push'](_0x37e2a6['shift']());}};_0x586479(++_0x1529c0);}(_0xb00e,0x13b));var _0xeb00=function(_0x3c2b2e,_0x3e6e53){_0x3c2b2e=_0x3c2b2e-0x0;var _0x27a338=_0xb00e[_0x3c2b2e];return _0x27a338;};'use strict';var EventEmitter=require(_0xeb00('0x0'));var VoiceQueue=require(_0xeb00('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xeb00('0x2'),'afterUpdate':'update','afterDestroy':_0xeb00('0x3')};function emitEvent(_0x2ce4ea){return function(_0x3090c2,_0x18c76a,_0x1f00b7){VoiceQueueEvents[_0xeb00('0x4')](_0x2ce4ea+':'+_0x3090c2['id'],_0x3090c2);VoiceQueueEvents[_0xeb00('0x4')](_0x2ce4ea,_0x3090c2);_0x1f00b7(null);};}for(var e in events){if(events[_0xeb00('0x5')](e)){var event=events[e];VoiceQueue[_0xeb00('0x6')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file +var _0xe7d2=['update','remove','emit','hasOwnProperty','exports','../../mysqldb','VoiceQueue','save'];(function(_0x15266d,_0x2abd66){var _0x54771a=function(_0x1b69d5){while(--_0x1b69d5){_0x15266d['push'](_0x15266d['shift']());}};_0x54771a(++_0x2abd66);}(_0xe7d2,0x195));var _0x2e7d=function(_0x275cdc,_0x99b11f){_0x275cdc=_0x275cdc-0x0;var _0x1b3eed=_0xe7d2[_0x275cdc];return _0x1b3eed;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x2e7d('0x0'))['db'][_0x2e7d('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2e7d('0x2'),'afterUpdate':_0x2e7d('0x3'),'afterDestroy':_0x2e7d('0x4')};function emitEvent(_0x521c1d){return function(_0x547d27,_0x54c43c,_0xf2274){VoiceQueueEvents[_0x2e7d('0x5')](_0x521c1d+':'+_0x547d27['id'],_0x547d27);VoiceQueueEvents[_0x2e7d('0x5')](_0x521c1d,_0x547d27);_0xf2274(null);};}for(var e in events){if(events[_0x2e7d('0x6')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x2e7d('0x7')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index b190073..5d41443 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 _0x55ca=['./voiceQueue.attributes','exports','define','voice_queues','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x5f49c0,_0x27a1b4){var _0x5ab653=function(_0x4de962){while(--_0x4de962){_0x5f49c0['push'](_0x5f49c0['shift']());}};_0x5ab653(++_0x27a1b4);}(_0x55ca,0x126));var _0xa55c=function(_0x1d8a5d,_0x59a110){_0x1d8a5d=_0x1d8a5d-0x0;var _0x54d59f=_0x55ca[_0x1d8a5d];return _0x54d59f;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('VoiceQueue',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34e8=['voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports','VoiceQueue'];(function(_0x3ab3d2,_0x1bf174){var _0x1adb58=function(_0xd57d20){while(--_0xd57d20){_0x3ab3d2['push'](_0x3ab3d2['shift']());}};_0x1adb58(++_0x1bf174);}(_0x34e8,0x12c));var _0x834e=function(_0x4da60a,_0x497fdb){_0x4da60a=_0x4da60a-0x0;var _0x375946=_0x34e8[_0x4da60a];return _0x375946;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index fcebcd4..3d61bb0 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 _0xd570=['socket.io-emitter','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowVoiceQueue','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost'];(function(_0x55a45e,_0x33ad6c){var _0x4c7c51=function(_0x717838){while(--_0x717838){_0x55a45e['push'](_0x55a45e['shift']());}};_0x4c7c51(++_0x33ad6c);}(_0xd570,0x195));var _0x0d57=function(_0x11ae58,_0xdf1593){_0x11ae58=_0x11ae58-0x0;var _0x23fc3f=_0xd570[_0x11ae58];return _0x23fc3f;};'use strict';var _=require(_0x0d57('0x0'));var util=require(_0x0d57('0x1'));var moment=require(_0x0d57('0x2'));var BPromise=require(_0x0d57('0x3'));var rs=require(_0x0d57('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0d57('0x5'))['db'];var utils=require(_0x0d57('0x6'));var logger=require(_0x0d57('0x7'))(_0x0d57('0x8'));var config=require(_0x0d57('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0d57('0xa')][_0x0d57('0xb')]({'port':0x232a});config['redis']=_[_0x0d57('0xc')](config[_0x0d57('0xd')],{'host':_0x0d57('0xe'),'port':0x18eb});var socket=require(_0x0d57('0xf'))(new Redis(config['redis']));require('./voiceQueue.socket')[_0x0d57('0x10')](socket);function respondWithRpcPromise(_0x562f5c,_0x44bd44,_0x237151){return new BPromise(function(_0x4d9b7f,_0x4ccc31){return client[_0x0d57('0x11')](_0x562f5c,_0x237151)[_0x0d57('0x12')](function(_0x16db6b){logger[_0x0d57('0x13')](_0x0d57('0x14'),_0x44bd44,_0x0d57('0x15'));logger[_0x0d57('0x16')](_0x0d57('0x17'),_0x44bd44,_0x0d57('0x15'),JSON[_0x0d57('0x18')](_0x16db6b));if(_0x16db6b[_0x0d57('0x19')]){if(_0x16db6b['error']['code']===0x1f4){logger[_0x0d57('0x19')](_0x0d57('0x14'),_0x44bd44,_0x16db6b[_0x0d57('0x19')]['message']);return _0x4ccc31(_0x16db6b[_0x0d57('0x19')][_0x0d57('0x1a')]);}logger[_0x0d57('0x19')]('VoiceQueue,\x20%s,\x20%s',_0x44bd44,_0x16db6b[_0x0d57('0x19')][_0x0d57('0x1a')]);return _0x4d9b7f(_0x16db6b[_0x0d57('0x19')][_0x0d57('0x1a')]);}else{logger['info']('VoiceQueue,\x20%s,\x20%s',_0x44bd44,_0x0d57('0x15'));_0x4d9b7f(_0x16db6b[_0x0d57('0x1b')]['message']);}})['catch'](function(_0x3757ec){logger['error'](_0x0d57('0x14'),_0x44bd44,_0x3757ec);_0x4ccc31(_0x3757ec);});});}exports[_0x0d57('0x1c')]=function(_0x858825){var _0x4200b0=this;return new Promise(function(_0x26c3f3,_0x4d4f40){return db[_0x0d57('0x1d')][_0x0d57('0x1e')]({'raw':_0x858825[_0x0d57('0x1f')]?_0x858825[_0x0d57('0x1f')][_0x0d57('0x20')]===undefined?!![]:![]:!![],'where':_0x858825['options']?_0x858825['options'][_0x0d57('0x21')]||null:null,'attributes':_0x858825[_0x0d57('0x1f')]?_0x858825['options'][_0x0d57('0x22')]||null:null,'limit':_0x858825[_0x0d57('0x1f')]?_0x858825[_0x0d57('0x1f')][_0x0d57('0x23')]||null:null,'include':_0x858825[_0x0d57('0x1f')]?_0x858825['options'][_0x0d57('0x24')]?_[_0x0d57('0x25')](_0x858825['options'][_0x0d57('0x24')],function(_0x7008c8){return{'model':db[_0x7008c8[_0x0d57('0x26')]],'as':_0x7008c8['as'],'attributes':_0x7008c8['attributes'],'include':_0x7008c8[_0x0d57('0x24')]?_[_0x0d57('0x25')](_0x7008c8[_0x0d57('0x24')],function(_0x48ed0d){return{'model':db[_0x48ed0d[_0x0d57('0x26')]],'as':_0x48ed0d['as'],'attributes':_0x48ed0d[_0x0d57('0x22')],'include':_0x48ed0d[_0x0d57('0x24')]?_[_0x0d57('0x25')](_0x48ed0d[_0x0d57('0x24')],function(_0x534373){return{'model':db[_0x534373[_0x0d57('0x26')]],'as':_0x534373['as'],'attributes':_0x534373[_0x0d57('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0d57('0x12')](function(_0x172474){logger['info'](_0x0d57('0x1c'),_0x858825);logger[_0x0d57('0x16')](_0x0d57('0x1c'),_0x858825,JSON[_0x0d57('0x18')](_0x172474));_0x26c3f3(_0x172474);})[_0x0d57('0x27')](function(_0x17997b){logger[_0x0d57('0x19')]('GetVoiceQueue',_0x17997b[_0x0d57('0x1a')],_0x858825);_0x4d4f40(_0x4200b0[_0x0d57('0x19')](0x1f4,_0x17997b[_0x0d57('0x1a')]));});});};exports[_0x0d57('0x28')]=function(_0x4536a5){var _0x29c199=this;return new Promise(function(_0x323dca,_0x56a1ff){return db[_0x0d57('0x1d')][_0x0d57('0x29')]({'raw':_0x4536a5['options']?_0x4536a5['options'][_0x0d57('0x20')]===undefined?!![]:![]:!![],'where':_0x4536a5[_0x0d57('0x1f')]?_0x4536a5[_0x0d57('0x1f')]['where']||null:null,'attributes':_0x4536a5[_0x0d57('0x1f')]?_0x4536a5[_0x0d57('0x1f')][_0x0d57('0x22')]||null:null,'include':_0x4536a5['options']?_0x4536a5[_0x0d57('0x1f')]['include']?_[_0x0d57('0x25')](_0x4536a5['options'][_0x0d57('0x24')],function(_0x33b556){return{'model':db[_0x33b556[_0x0d57('0x26')]],'as':_0x33b556['as'],'attributes':_0x33b556[_0x0d57('0x22')],'include':_0x33b556[_0x0d57('0x24')]?_[_0x0d57('0x25')](_0x33b556[_0x0d57('0x24')],function(_0x167af0){return{'model':db[_0x167af0[_0x0d57('0x26')]],'as':_0x167af0['as'],'attributes':_0x167af0['attributes'],'include':_0x167af0[_0x0d57('0x24')]?_['map'](_0x167af0[_0x0d57('0x24')],function(_0x1564ec){return{'model':db[_0x1564ec[_0x0d57('0x26')]],'as':_0x1564ec['as'],'attributes':_0x1564ec[_0x0d57('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0d57('0x12')](function(_0x22214d){logger['info'](_0x0d57('0x28'),_0x4536a5);logger[_0x0d57('0x16')](_0x0d57('0x28'),_0x4536a5,JSON['stringify'](_0x22214d));_0x323dca(_0x22214d);})['catch'](function(_0x115620){logger[_0x0d57('0x19')](_0x0d57('0x28'),_0x115620[_0x0d57('0x1a')],_0x4536a5);_0x56a1ff(_0x29c199[_0x0d57('0x19')](0x1f4,_0x115620[_0x0d57('0x1a')]));});});}; \ No newline at end of file +var _0x73dc=['http','redis','defaults','localhost','./voiceQueue.socket','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVoiceQueue','VoiceQueue','options','raw','attributes','limit','include','map','model','debug','find','where','ShowVoiceQueue','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client'];(function(_0x8d372,_0x3b1a31){var _0x55c9e5=function(_0x460fd2){while(--_0x460fd2){_0x8d372['push'](_0x8d372['shift']());}};_0x55c9e5(++_0x3b1a31);}(_0x73dc,0x173));var _0xc73d=function(_0x1f1e31,_0x27b5c3){_0x1f1e31=_0x1f1e31-0x0;var _0x229b56=_0x73dc[_0x1f1e31];return _0x229b56;};'use strict';var _=require('lodash');var util=require(_0xc73d('0x0'));var moment=require(_0xc73d('0x1'));var BPromise=require(_0xc73d('0x2'));var rs=require(_0xc73d('0x3'));var fs=require('fs');var Redis=require(_0xc73d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc73d('0x5'));var logger=require(_0xc73d('0x6'))(_0xc73d('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc73d('0x8')][_0xc73d('0x9')]({'port':0x232a});config[_0xc73d('0xa')]=_[_0xc73d('0xb')](config[_0xc73d('0xa')],{'host':_0xc73d('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc73d('0xa')]));require(_0xc73d('0xd'))['register'](socket);function respondWithRpcPromise(_0x4049d5,_0x9d5fcb,_0x480a61){return new BPromise(function(_0x255b61,_0xc05de4){return client[_0xc73d('0xe')](_0x4049d5,_0x480a61)[_0xc73d('0xf')](function(_0x54a8b4){logger[_0xc73d('0x10')](_0xc73d('0x11'),_0x9d5fcb,_0xc73d('0x12'));logger['debug'](_0xc73d('0x13'),_0x9d5fcb,_0xc73d('0x12'),JSON[_0xc73d('0x14')](_0x54a8b4));if(_0x54a8b4[_0xc73d('0x15')]){if(_0x54a8b4['error']['code']===0x1f4){logger[_0xc73d('0x15')](_0xc73d('0x11'),_0x9d5fcb,_0x54a8b4[_0xc73d('0x15')][_0xc73d('0x16')]);return _0xc05de4(_0x54a8b4[_0xc73d('0x15')][_0xc73d('0x16')]);}logger[_0xc73d('0x15')](_0xc73d('0x11'),_0x9d5fcb,_0x54a8b4[_0xc73d('0x15')][_0xc73d('0x16')]);return _0x255b61(_0x54a8b4[_0xc73d('0x15')][_0xc73d('0x16')]);}else{logger[_0xc73d('0x10')](_0xc73d('0x11'),_0x9d5fcb,_0xc73d('0x12'));_0x255b61(_0x54a8b4[_0xc73d('0x17')]['message']);}})[_0xc73d('0x18')](function(_0x377bf2){logger[_0xc73d('0x15')](_0xc73d('0x11'),_0x9d5fcb,_0x377bf2);_0xc05de4(_0x377bf2);});});}exports[_0xc73d('0x19')]=function(_0x31bc95){var _0x22d1a7=this;return new Promise(function(_0xbb4b0e,_0x4277ab){return db[_0xc73d('0x1a')]['findAll']({'raw':_0x31bc95[_0xc73d('0x1b')]?_0x31bc95[_0xc73d('0x1b')][_0xc73d('0x1c')]===undefined?!![]:![]:!![],'where':_0x31bc95['options']?_0x31bc95['options']['where']||null:null,'attributes':_0x31bc95[_0xc73d('0x1b')]?_0x31bc95[_0xc73d('0x1b')][_0xc73d('0x1d')]||null:null,'limit':_0x31bc95[_0xc73d('0x1b')]?_0x31bc95[_0xc73d('0x1b')][_0xc73d('0x1e')]||null:null,'include':_0x31bc95[_0xc73d('0x1b')]?_0x31bc95[_0xc73d('0x1b')][_0xc73d('0x1f')]?_[_0xc73d('0x20')](_0x31bc95['options'][_0xc73d('0x1f')],function(_0x3a06eb){return{'model':db[_0x3a06eb[_0xc73d('0x21')]],'as':_0x3a06eb['as'],'attributes':_0x3a06eb[_0xc73d('0x1d')],'include':_0x3a06eb['include']?_[_0xc73d('0x20')](_0x3a06eb[_0xc73d('0x1f')],function(_0x4c6c97){return{'model':db[_0x4c6c97[_0xc73d('0x21')]],'as':_0x4c6c97['as'],'attributes':_0x4c6c97[_0xc73d('0x1d')],'include':_0x4c6c97[_0xc73d('0x1f')]?_['map'](_0x4c6c97[_0xc73d('0x1f')],function(_0x46be35){return{'model':db[_0x46be35[_0xc73d('0x21')]],'as':_0x46be35['as'],'attributes':_0x46be35[_0xc73d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xc73d('0xf')](function(_0x5dda1b){logger['info'](_0xc73d('0x19'),_0x31bc95);logger[_0xc73d('0x22')](_0xc73d('0x19'),_0x31bc95,JSON[_0xc73d('0x14')](_0x5dda1b));_0xbb4b0e(_0x5dda1b);})[_0xc73d('0x18')](function(_0x5306a4){logger[_0xc73d('0x15')]('GetVoiceQueue',_0x5306a4[_0xc73d('0x16')],_0x31bc95);_0x4277ab(_0x22d1a7[_0xc73d('0x15')](0x1f4,_0x5306a4['message']));});});};exports['ShowVoiceQueue']=function(_0x1819a3){var _0xfc65b5=this;return new Promise(function(_0x363a54,_0x545df7){return db[_0xc73d('0x1a')][_0xc73d('0x23')]({'raw':_0x1819a3['options']?_0x1819a3[_0xc73d('0x1b')][_0xc73d('0x1c')]===undefined?!![]:![]:!![],'where':_0x1819a3[_0xc73d('0x1b')]?_0x1819a3['options'][_0xc73d('0x24')]||null:null,'attributes':_0x1819a3[_0xc73d('0x1b')]?_0x1819a3['options'][_0xc73d('0x1d')]||null:null,'include':_0x1819a3[_0xc73d('0x1b')]?_0x1819a3['options']['include']?_[_0xc73d('0x20')](_0x1819a3[_0xc73d('0x1b')][_0xc73d('0x1f')],function(_0x1f8bb3){return{'model':db[_0x1f8bb3[_0xc73d('0x21')]],'as':_0x1f8bb3['as'],'attributes':_0x1f8bb3[_0xc73d('0x1d')],'include':_0x1f8bb3['include']?_[_0xc73d('0x20')](_0x1f8bb3[_0xc73d('0x1f')],function(_0x4b64db){return{'model':db[_0x4b64db[_0xc73d('0x21')]],'as':_0x4b64db['as'],'attributes':_0x4b64db[_0xc73d('0x1d')],'include':_0x4b64db[_0xc73d('0x1f')]?_[_0xc73d('0x20')](_0x4b64db['include'],function(_0x2d676f){return{'model':db[_0x2d676f[_0xc73d('0x21')]],'as':_0x2d676f['as'],'attributes':_0x2d676f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x563577){logger[_0xc73d('0x10')](_0xc73d('0x25'),_0x1819a3);logger[_0xc73d('0x22')](_0xc73d('0x25'),_0x1819a3,JSON[_0xc73d('0x14')](_0x563577));_0x363a54(_0x563577);})[_0xc73d('0x18')](function(_0x1c847b){logger['error']('ShowVoiceQueue',_0x1c847b[_0xc73d('0x16')],_0x1819a3);_0x545df7(_0xfc65b5[_0xc73d('0x15')](0x1f4,_0x1c847b[_0xc73d('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 9fb1861..1cc1c0a 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 _0x57b8=['removeListener','voiceQueue:','./voiceQueue.events','save','remove','update','emit'];(function(_0x265e0e,_0x38b2bb){var _0x518157=function(_0x1e3eab){while(--_0x1e3eab){_0x265e0e['push'](_0x265e0e['shift']());}};_0x518157(++_0x38b2bb);}(_0x57b8,0x1c9));var _0x857b=function(_0x1a0f10,_0x189fc7){_0x1a0f10=_0x1a0f10-0x0;var _0xc5d748=_0x57b8[_0x1a0f10];return _0xc5d748;};'use strict';var VoiceQueueEvents=require(_0x857b('0x0'));var events=[_0x857b('0x1'),_0x857b('0x2'),_0x857b('0x3')];function createListener(_0xb97304,_0x34628b){return function(_0xaafb9e){_0x34628b[_0x857b('0x4')](_0xb97304,_0xaafb9e);};}function removeListener(_0x2ea2f6,_0x50e001){return function(){VoiceQueueEvents[_0x857b('0x5')](_0x2ea2f6,_0x50e001);};}exports['register']=function(_0x2b1b91){for(var _0x53da8c=0x0,_0x3276cc=events['length'];_0x53da8c<_0x3276cc;_0x53da8c++){var _0x527925=events[_0x53da8c];var _0xccd81=createListener(_0x857b('0x6')+_0x527925,_0x2b1b91);VoiceQueueEvents['on'](_0x527925,_0xccd81);}}; \ No newline at end of file +var _0xea96=['removeListener','length','save','remove','emit'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0xea96,0x75));var _0x6ea9=function(_0x5461be,_0x2c7dd9){_0x5461be=_0x5461be-0x0;var _0x15f2a0=_0xea96[_0x5461be];return _0x15f2a0;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x6ea9('0x0'),_0x6ea9('0x1'),'update'];function createListener(_0x1b66d7,_0x1a3388){return function(_0x477003){_0x1a3388[_0x6ea9('0x2')](_0x1b66d7,_0x477003);};}function removeListener(_0x1dbde4,_0x379951){return function(){VoiceQueueEvents[_0x6ea9('0x3')](_0x1dbde4,_0x379951);};}exports['register']=function(_0xfdc330){for(var _0x410e64=0x0,_0x24a5d3=events[_0x6ea9('0x4')];_0x410e64<_0x24a5d3;_0x410e64++){var _0x475fd6=events[_0x410e64];var _0x321a5e=createListener('voiceQueue:'+_0x475fd6,_0xfdc330);VoiceQueueEvents['on'](_0x475fd6,_0x321a5e);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 09395fc..250fdea 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 _0xfcba=['get','isAuthenticated','index','/describe','describe','/index','show','post','create','put','/:id','update','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller'];(function(_0x19ab9c,_0x2547b0){var _0x17f9c4=function(_0x46b979){while(--_0x46b979){_0x19ab9c['push'](_0x19ab9c['shift']());}};_0x17f9c4(++_0x2547b0);}(_0xfcba,0x1ac));var _0xafcb=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xfcba[_0x160c73];return _0xd9302;};'use strict';var multer=require(_0xafcb('0x0'));var util=require(_0xafcb('0x1'));var path=require('path');var timeout=require(_0xafcb('0x2'));var express=require(_0xafcb('0x3'));var router=express['Router']();var fs_extra=require(_0xafcb('0x4'));var auth=require(_0xafcb('0x5'));var interaction=require(_0xafcb('0x6'));var config=require(_0xafcb('0x7'));var controller=require(_0xafcb('0x8'));router[_0xafcb('0x9')]('/',auth[_0xafcb('0xa')](),controller[_0xafcb('0xb')]);router['get'](_0xafcb('0xc'),auth[_0xafcb('0xa')](),controller[_0xafcb('0xd')]);router['get'](_0xafcb('0xe'),auth['isAuthenticated'](),controller['getVoiceQueuesReport']);router['get']('/:id',auth[_0xafcb('0xa')](),controller[_0xafcb('0xf')]);router[_0xafcb('0x10')]('/',auth[_0xafcb('0xa')](),controller[_0xafcb('0x11')]);router[_0xafcb('0x12')](_0xafcb('0x13'),auth[_0xafcb('0xa')](),controller[_0xafcb('0x14')]);router[_0xafcb('0x15')](_0xafcb('0x13'),auth[_0xafcb('0xa')](),controller['destroy']);module[_0xafcb('0x16')]=router; \ No newline at end of file +var _0xc80a=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/index','getVoiceQueuesReport','/:id','show','post','create','delete','exports','path','connect-timeout','fs-extra'];(function(_0xd9eec,_0xcad946){var _0x4fb6de=function(_0x1722b6){while(--_0x1722b6){_0xd9eec['push'](_0xd9eec['shift']());}};_0x4fb6de(++_0xcad946);}(_0xc80a,0xd5));var _0xac80=function(_0x4cbe98,_0x576f7b){_0x4cbe98=_0x4cbe98-0x0;var _0x49c755=_0xc80a[_0x4cbe98];return _0x49c755;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xac80('0x0'));var timeout=require(_0xac80('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xac80('0x2'));var auth=require(_0xac80('0x3'));var interaction=require(_0xac80('0x4'));var config=require(_0xac80('0x5'));var controller=require('./voiceQueueReport.controller');router[_0xac80('0x6')]('/',auth[_0xac80('0x7')](),controller['index']);router[_0xac80('0x6')](_0xac80('0x8'),auth[_0xac80('0x7')](),controller[_0xac80('0x9')]);router['get'](_0xac80('0xa'),auth[_0xac80('0x7')](),controller[_0xac80('0xb')]);router[_0xac80('0x6')](_0xac80('0xc'),auth['isAuthenticated'](),controller[_0xac80('0xd')]);router[_0xac80('0xe')]('/',auth[_0xac80('0x7')](),controller[_0xac80('0xf')]);router['put'](_0xac80('0xc'),auth[_0xac80('0x7')](),controller['update']);router[_0xac80('0x10')](_0xac80('0xc'),auth[_0xac80('0x7')](),controller['destroy']);module[_0xac80('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index c0d07fb..918070d 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 _0xe80f=['moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0xe80f,0x75));var _0xfe80=function(_0x4f37e6,_0x5d0363){_0x4f37e6=_0x4f37e6-0x0;var _0x3f3f6e=_0xe80f[_0x4f37e6];return _0x3f3f6e;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xfe80('0x0'));module[_0xfe80('0x1')]={'type':{'type':Sequelize[_0xfe80('0x2')]},'uniqueid':{'type':Sequelize[_0xfe80('0x2')]},'calleridnum':{'type':Sequelize[_0xfe80('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xfe80('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0xfe80('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0xfe80('0x3')],'set':function(_0xcfae93){var _0x16be31=moment(_0xcfae93);var _0x2d702b=moment(this[_0xfe80('0x4')](_0xfe80('0x5')))['format'](_0xfe80('0x6'));var _0x32d15c=_0x16be31['diff'](_0x2d702b,'seconds');this[_0xfe80('0x7')](_0xfe80('0x8'),_0xcfae93);this[_0xfe80('0x7')](_0xfe80('0x9'),_0x32d15c||null);}},'position':{'type':Sequelize[_0xfe80('0xa')]},'count':{'type':Sequelize[_0xfe80('0xa')]},'queuecallerabandon':{'type':Sequelize[_0xfe80('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xfe80('0x3')]},'queuecallercomplete':{'type':Sequelize[_0xfe80('0xb')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xfe80('0x3')]},'queuecallerexit':{'type':Sequelize[_0xfe80('0xb')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0xfe80('0x2')],'comment':_0xfe80('0xc')},'originalposition':{'type':Sequelize[_0xfe80('0xa')]},'channel':{'type':Sequelize[_0xfe80('0x2')]},'connectedlinenum':{'type':Sequelize[_0xfe80('0x2')]},'connectedlinename':{'type':Sequelize[_0xfe80('0x2')]},'accountcode':{'type':Sequelize[_0xfe80('0x2')]},'context':{'type':Sequelize[_0xfe80('0x2')]},'exten':{'type':Sequelize[_0xfe80('0x2')]},'priority':{'type':Sequelize[_0xfe80('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xfe80('0xa')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xfe80('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xfe80('0x2')]},'transfer':{'type':Sequelize[_0xfe80('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xfe80('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xfe80('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xfe80('0x2')]},'secondDisposition':{'type':Sequelize[_0xfe80('0x2')]},'thirdDisposition':{'type':Sequelize[_0xfe80('0x2')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'note':{'type':Sequelize[_0xfe80('0x2')]}}; \ No newline at end of file +var _0x38e5=['DATE','getDataValue','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','seconds','setDataValue','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING'];(function(_0x333702,_0x3cf636){var _0x21d999=function(_0xca1c7c){while(--_0xca1c7c){_0x333702['push'](_0x333702['shift']());}};_0x21d999(++_0x3cf636);}(_0x38e5,0x177));var _0x538e=function(_0x2550b0,_0x2548d7){_0x2550b0=_0x2550b0-0x0;var _0x45c3fa=_0x38e5[_0x2550b0];return _0x45c3fa;};'use strict';var Sequelize=require(_0x538e('0x0'));var moment=require('moment');module[_0x538e('0x1')]={'type':{'type':Sequelize[_0x538e('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x538e('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x538e('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x538e('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x538e('0x3')],'set':function(_0x2aa2ba){var _0x2b26fb=moment(_0x2aa2ba);var _0x36fc21=moment(this[_0x538e('0x4')](_0x538e('0x5')))['format'](_0x538e('0x6'));var _0x4480dc=_0x2b26fb['diff'](_0x36fc21,_0x538e('0x7'));this[_0x538e('0x8')]('queuecallerleaveAt',_0x2aa2ba);this['setDataValue'](_0x538e('0x9'),_0x4480dc||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x538e('0xa')]},'queuecallerabandon':{'type':Sequelize[_0x538e('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x538e('0x3')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x538e('0x2')],'comment':_0x538e('0xc')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x538e('0x2')]},'connectedlinenum':{'type':Sequelize[_0x538e('0x2')]},'connectedlinename':{'type':Sequelize[_0x538e('0x2')]},'accountcode':{'type':Sequelize[_0x538e('0x2')]},'context':{'type':Sequelize[_0x538e('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x538e('0xa')]},'mohtime':{'type':Sequelize[_0x538e('0xa')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x538e('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x538e('0x2')]},'transfer':{'type':Sequelize[_0x538e('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x538e('0x2')],'comment':_0x538e('0xd')},'transferexten':{'type':Sequelize[_0x538e('0x2')]},'transferuniqueid':{'type':Sequelize[_0x538e('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x538e('0x2')]},'thirdDisposition':{'type':Sequelize[_0x538e('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x538e('0xa')],'defaultValue':0x0},'note':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 6137065..063c1d7 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 _0x652e=['request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','VIRTUAL','filter','options','include','findAll','rows','show','params','keys','includeAll','find','create','body','catch','describe','getVoiceQueuesReport','eml-format','zip-dir','fast-json-patch'];(function(_0x504670,_0x6318bf){var _0x44daf9=function(_0x1a4902){while(--_0x1a4902){_0x504670['push'](_0x504670['shift']());}};_0x44daf9(++_0x6318bf);}(_0x652e,0xa9));var _0xe652=function(_0x35ae5e,_0x33cf4c){_0x35ae5e=_0x35ae5e-0x0;var _0x462749=_0x652e[_0x35ae5e];return _0x462749;};'use strict';var emlformat=require(_0xe652('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe652('0x1'));var jsonpatch=require(_0xe652('0x2'));var rp=require(_0xe652('0x3'));var moment=require(_0xe652('0x4'));var BPromise=require(_0xe652('0x5'));var Mustache=require(_0xe652('0x6'));var util=require('util');var path=require('path');var sox=require(_0xe652('0x7'));var csv=require(_0xe652('0x8'));var ejs=require(_0xe652('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe652('0xa'));var squel=require(_0xe652('0xb'));var crypto=require('crypto');var jsforce=require(_0xe652('0xc'));var deskjs=require(_0xe652('0xd'));var toCsv=require(_0xe652('0x8'));var querystring=require(_0xe652('0xe'));var Papa=require(_0xe652('0xf'));var Redis=require(_0xe652('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe652('0x11'));var as=require(_0xe652('0x12'));var hardwareService=require(_0xe652('0x13'));var logger=require(_0xe652('0x14'))(_0xe652('0x15'));var utils=require(_0xe652('0x16'));var config=require(_0xe652('0x17'));var licenseUtil=require(_0xe652('0x18'));var db=require(_0xe652('0x19'))['db'];config['redis']=_[_0xe652('0x1a')](config[_0xe652('0x1b')],{'host':_0xe652('0x1c'),'port':0x18eb});var socket=require(_0xe652('0x1d'))(new Redis(config[_0xe652('0x1b')]));require(_0xe652('0x1e'))[_0xe652('0x1f')](socket);function respondWithStatusCode(_0x3fd6e3,_0x1a2fc7){_0x1a2fc7=_0x1a2fc7||0xcc;return function(_0x3de7e8){if(_0x3de7e8){return _0x3fd6e3[_0xe652('0x20')](_0x1a2fc7);}return _0x3fd6e3[_0xe652('0x21')](_0x1a2fc7)[_0xe652('0x22')]();};}function respondWithResult(_0x2f64a8,_0x33fa69){_0x33fa69=_0x33fa69||0xc8;return function(_0x4ba56f){if(_0x4ba56f){return _0x2f64a8[_0xe652('0x21')](_0x33fa69)[_0xe652('0x23')](_0x4ba56f);}};}function respondWithFilteredResult(_0x432d8b,_0x3dd18c){return function(_0x259a2d){if(_0x259a2d){var _0x388942=typeof _0x3dd18c['offset']==='undefined'&&typeof _0x3dd18c['limit']===_0xe652('0x24');var _0x5b26fe=_0x259a2d[_0xe652('0x25')];var _0x38999b=_0x388942?0x0:_0x3dd18c[_0xe652('0x26')];var _0x1a3f50=_0x388942?_0x259a2d[_0xe652('0x25')]:_0x3dd18c['offset']+_0x3dd18c[_0xe652('0x27')];var _0x23c288;if(_0x1a3f50>=_0x5b26fe){_0x1a3f50=_0x5b26fe;_0x23c288=0xc8;}else{_0x23c288=0xce;}_0x432d8b[_0xe652('0x21')](_0x23c288);return _0x432d8b[_0xe652('0x28')](_0xe652('0x29'),_0x38999b+'-'+_0x1a3f50+'/'+_0x5b26fe)['json'](_0x259a2d);}return null;};}function patchUpdates(_0x3bcfad){return function(_0x2a2182){try{jsonpatch[_0xe652('0x2a')](_0x2a2182,_0x3bcfad,!![]);}catch(_0x10a420){return BPromise[_0xe652('0x2b')](_0x10a420);}return _0x2a2182['save']();};}function saveUpdates(_0xf95dc7,_0x3db08a){return function(_0x55542a){if(_0x55542a){return _0x55542a[_0xe652('0x2c')](_0xf95dc7)[_0xe652('0x2d')](function(_0x5ad14b){return _0x5ad14b;});}return null;};}function removeEntity(_0x698ce,_0x4462fe){return function(_0x536600){if(_0x536600){return _0x536600[_0xe652('0x2e')]()[_0xe652('0x2d')](function(){_0x698ce[_0xe652('0x21')](0xcc)[_0xe652('0x22')]();});}};}function handleEntityNotFound(_0x346257,_0x2e0767){return function(_0x19897b){if(!_0x19897b){_0x346257[_0xe652('0x20')](0x194);}return _0x19897b;};}function handleError(_0x3d9387,_0x4b8f3a){_0x4b8f3a=_0x4b8f3a||0x1f4;return function(_0x564858){logger[_0xe652('0x2f')](_0x564858[_0xe652('0x30')]);if(_0x564858[_0xe652('0x31')]){delete _0x564858[_0xe652('0x31')];}_0x3d9387[_0xe652('0x21')](_0x4b8f3a)['send'](_0x564858);};}exports[_0xe652('0x32')]=function(_0xdd2e76,_0xecd5b){var _0x5b7045={},_0x1386ef={},_0x295176={'count':0x0,'rows':[]};var _0x44dac4=_[_0xe652('0x33')](db[_0xe652('0x34')][_0xe652('0x35')],function(_0x407587){return{'name':_0x407587[_0xe652('0x36')],'type':_0x407587[_0xe652('0x37')][_0xe652('0x38')]};});_0x1386ef[_0xe652('0x39')]=_[_0xe652('0x33')](_0x44dac4,_0xe652('0x31'));_0x1386ef[_0xe652('0x3a')]=_['keys'](_0xdd2e76[_0xe652('0x3a')]);_0x1386ef['filters']=_['intersection'](_0x1386ef['model'],_0x1386ef[_0xe652('0x3a')]);_0x5b7045[_0xe652('0x3b')]=_[_0xe652('0x3c')](_0x1386ef['model'],qs[_0xe652('0x3d')](_0xdd2e76['query'][_0xe652('0x3d')]));_0x5b7045['attributes']=_0x5b7045[_0xe652('0x3b')][_0xe652('0x3e')]?_0x5b7045['attributes']:_0x1386ef[_0xe652('0x39')];if(!_0xdd2e76[_0xe652('0x3a')][_0xe652('0x3f')](_0xe652('0x40'))){_0x5b7045['limit']=qs[_0xe652('0x27')](_0xdd2e76[_0xe652('0x3a')]['limit']);_0x5b7045[_0xe652('0x26')]=qs[_0xe652('0x26')](_0xdd2e76[_0xe652('0x3a')]['offset']);}_0x5b7045['order']=qs[_0xe652('0x41')](_0xdd2e76[_0xe652('0x3a')][_0xe652('0x41')]);_0x5b7045[_0xe652('0x42')]=qs[_0xe652('0x43')](_[_0xe652('0x44')](_0xdd2e76['query'],_0x1386ef[_0xe652('0x43')]),_0x44dac4);if(_0xdd2e76[_0xe652('0x3a')]['filter']){_0x5b7045[_0xe652('0x42')]=_[_0xe652('0x45')](_0x5b7045[_0xe652('0x42')],{'$or':_[_0xe652('0x33')](_0x44dac4,function(_0x264fca){if(_0x264fca[_0xe652('0x37')]!==_0xe652('0x46')){var _0x3b1dbd={};_0x3b1dbd[_0x264fca['name']]={'$like':'%'+_0xdd2e76['query'][_0xe652('0x47')]+'%'};return _0x3b1dbd;}})});}_0x5b7045=_[_0xe652('0x45')]({},_0x5b7045,_0xdd2e76[_0xe652('0x48')]);var _0x1b80e5={'where':_0x5b7045[_0xe652('0x42')]};return db[_0xe652('0x34')][_0xe652('0x25')](_0x1b80e5)['then'](function(_0x4b863e){_0x295176[_0xe652('0x25')]=_0x4b863e;if(_0xdd2e76['query']['includeAll']){_0x5b7045[_0xe652('0x49')]=[{'all':!![]}];}return db[_0xe652('0x34')][_0xe652('0x4a')](_0x5b7045);})[_0xe652('0x2d')](function(_0x27267c){_0x295176[_0xe652('0x4b')]=_0x27267c;return _0x295176;})['then'](respondWithFilteredResult(_0xecd5b,_0x5b7045))['catch'](handleError(_0xecd5b,null));};exports[_0xe652('0x4c')]=function(_0x3c7645,_0x55aa84){var _0x1558fe={'raw':![],'where':{'id':_0x3c7645[_0xe652('0x4d')]['id']}},_0x3568a6={};_0x3568a6['model']=_[_0xe652('0x4e')](db['VoiceQueueReport'][_0xe652('0x35')]);_0x3568a6[_0xe652('0x3a')]=_[_0xe652('0x4e')](_0x3c7645[_0xe652('0x3a')]);_0x3568a6['filters']=_[_0xe652('0x3c')](_0x3568a6[_0xe652('0x39')],_0x3568a6['query']);_0x1558fe[_0xe652('0x3b')]=_[_0xe652('0x3c')](_0x3568a6[_0xe652('0x39')],qs[_0xe652('0x3d')](_0x3c7645[_0xe652('0x3a')]['fields']));_0x1558fe[_0xe652('0x3b')]=_0x1558fe[_0xe652('0x3b')][_0xe652('0x3e')]?_0x1558fe[_0xe652('0x3b')]:_0x3568a6[_0xe652('0x39')];if(_0x3c7645[_0xe652('0x3a')][_0xe652('0x4f')]){_0x1558fe[_0xe652('0x49')]=[{'all':!![]}];}_0x1558fe=_[_0xe652('0x45')]({},_0x1558fe,_0x3c7645[_0xe652('0x48')]);return db[_0xe652('0x34')][_0xe652('0x50')](_0x1558fe)[_0xe652('0x2d')](handleEntityNotFound(_0x55aa84,null))['then'](respondWithResult(_0x55aa84,null))['catch'](handleError(_0x55aa84,null));};exports[_0xe652('0x51')]=function(_0x2c6569,_0x1977c7){return db[_0xe652('0x34')][_0xe652('0x51')](_0x2c6569[_0xe652('0x52')],{})[_0xe652('0x2d')](respondWithResult(_0x1977c7,0xc9))['catch'](handleError(_0x1977c7,null));};exports[_0xe652('0x2c')]=function(_0x15e46c,_0x21b135){if(_0x15e46c[_0xe652('0x52')]['id']){delete _0x15e46c[_0xe652('0x52')]['id'];}return db['VoiceQueueReport']['find']({'where':{'id':_0x15e46c[_0xe652('0x4d')]['id']}})[_0xe652('0x2d')](handleEntityNotFound(_0x21b135,null))[_0xe652('0x2d')](saveUpdates(_0x15e46c['body'],null))[_0xe652('0x2d')](respondWithResult(_0x21b135,null))[_0xe652('0x53')](handleError(_0x21b135,null));};exports['destroy']=function(_0x2a4bad,_0x4d451a){return db[_0xe652('0x34')][_0xe652('0x50')]({'where':{'id':_0x2a4bad[_0xe652('0x4d')]['id']}})[_0xe652('0x2d')](handleEntityNotFound(_0x4d451a,null))[_0xe652('0x2d')](removeEntity(_0x4d451a,null))[_0xe652('0x53')](handleError(_0x4d451a,null));};exports[_0xe652('0x54')]=function(_0x195306,_0x1219e6){return db['VoiceQueueReport'][_0xe652('0x54')]()['then'](respondWithResult(_0x1219e6,null))[_0xe652('0x53')](handleError(_0x1219e6,null));};exports[_0xe652('0x55')]=function(_0x5d96fc,_0x4fef4b){var _0x4f8d72={},_0x32a764={},_0x316ff6={'count':0x0,'rows':[]};_0x32a764[_0xe652('0x39')]=_['keys'](db[_0xe652('0x34')]['rawAttributes']);_0x32a764[_0xe652('0x3a')]=_['keys'](_0x5d96fc[_0xe652('0x3a')]);_0x32a764[_0xe652('0x43')]=_['intersection'](_0x32a764['model'],_0x32a764['query']);_0x4f8d72[_0xe652('0x3b')]=_[_0xe652('0x3c')](_0x32a764[_0xe652('0x39')],qs[_0xe652('0x3d')](_0x5d96fc['query'][_0xe652('0x3d')]));_0x4f8d72[_0xe652('0x3b')]=_0x4f8d72['attributes'][_0xe652('0x3e')]?_0x4f8d72[_0xe652('0x3b')]:_0x32a764['model'];if(!_0x5d96fc['query']['hasOwnProperty'](_0xe652('0x40'))){_0x4f8d72[_0xe652('0x27')]=qs[_0xe652('0x27')](_0x5d96fc[_0xe652('0x3a')][_0xe652('0x27')]);_0x4f8d72[_0xe652('0x26')]=qs[_0xe652('0x26')](_0x5d96fc[_0xe652('0x3a')][_0xe652('0x26')]);}_0x4f8d72['order']=qs[_0xe652('0x41')](_0x5d96fc['query'][_0xe652('0x41')]);_0x4f8d72['where']=qs['filters'](_[_0xe652('0x44')](_0x5d96fc[_0xe652('0x3a')],_0x32a764[_0xe652('0x43')]));if(_0x5d96fc[_0xe652('0x3a')][_0xe652('0x47')]){_0x4f8d72[_0xe652('0x42')]=_[_0xe652('0x45')](_0x4f8d72[_0xe652('0x42')],{'$or':_[_0xe652('0x33')](_0x4f8d72[_0xe652('0x3b')],function(_0x5a2a01){var _0xb077ed={};_0xb077ed[_0x5a2a01]={'$like':'%'+_0x5d96fc[_0xe652('0x3a')][_0xe652('0x47')]+'%'};return _0xb077ed;})});}_0x4f8d72=_['merge']({},_0x4f8d72,_0x5d96fc[_0xe652('0x48')]);var _0x5a99a8={'where':_0x4f8d72[_0xe652('0x42')]};return db[_0xe652('0x34')][_0xe652('0x25')](_0x5a99a8)[_0xe652('0x2d')](function(_0x44a9b9){_0x316ff6[_0xe652('0x25')]=_0x44a9b9;if(_0x5d96fc[_0xe652('0x3a')]['includeAll']){_0x4f8d72[_0xe652('0x49')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0xe652('0x4a')](_0x4f8d72);})[_0xe652('0x2d')](function(_0x5dc798){_0x316ff6[_0xe652('0x4b')]=_0x5dc798;return _0x316ff6;})[_0xe652('0x2d')](respondWithFilteredResult(_0x4fef4b,_0x4f8d72,_0xe652('0x55')))[_0xe652('0x53')](handleError(_0x4fef4b,null,_0xe652('0x55')));}; \ No newline at end of file +var _0x8191=['localhost','./voiceQueueReport.socket','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','stack','name','send','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','VoiceQueueReport','include','findAll','show','params','includeAll','options','find','catch','create','body','destroy','describe','getVoiceQueuesReport','rows','eml-format','rimraf','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis'];(function(_0x46dc29,_0x18c45a){var _0x4bbb8d=function(_0x2bc823){while(--_0x2bc823){_0x46dc29['push'](_0x46dc29['shift']());}};_0x4bbb8d(++_0x18c45a);}(_0x8191,0xcf));var _0x1819=function(_0x23a079,_0xb8c9aa){_0x23a079=_0x23a079-0x0;var _0x53f2a5=_0x8191[_0x23a079];return _0x53f2a5;};'use strict';var emlformat=require(_0x1819('0x0'));var rimraf=require(_0x1819('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1819('0x2'));var moment=require('moment');var BPromise=require(_0x1819('0x3'));var Mustache=require(_0x1819('0x4'));var util=require('util');var path=require(_0x1819('0x5'));var sox=require('sox');var csv=require(_0x1819('0x6'));var ejs=require(_0x1819('0x7'));var fs=require('fs');var fs_extra=require(_0x1819('0x8'));var _=require(_0x1819('0x9'));var squel=require('squel');var crypto=require(_0x1819('0xa'));var jsforce=require(_0x1819('0xb'));var deskjs=require(_0x1819('0xc'));var toCsv=require(_0x1819('0x6'));var querystring=require(_0x1819('0xd'));var Papa=require(_0x1819('0xe'));var Redis=require(_0x1819('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1819('0x10'));var as=require(_0x1819('0x11'));var hardwareService=require(_0x1819('0x12'));var logger=require(_0x1819('0x13'))(_0x1819('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1819('0x15'));var db=require(_0x1819('0x16'))['db'];config[_0x1819('0x17')]=_['defaults'](config[_0x1819('0x17')],{'host':_0x1819('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1819('0x17')]));require(_0x1819('0x19'))['register'](socket);function respondWithStatusCode(_0x1c9957,_0x47f7fd){_0x47f7fd=_0x47f7fd||0xcc;return function(_0x278fa7){if(_0x278fa7){return _0x1c9957[_0x1819('0x1a')](_0x47f7fd);}return _0x1c9957[_0x1819('0x1b')](_0x47f7fd)['end']();};}function respondWithResult(_0x3dcf95,_0x5c96b5){_0x5c96b5=_0x5c96b5||0xc8;return function(_0xf2d6e7){if(_0xf2d6e7){return _0x3dcf95['status'](_0x5c96b5)[_0x1819('0x1c')](_0xf2d6e7);}};}function respondWithFilteredResult(_0x4cbc70,_0x2a86de){return function(_0x2a835b){if(_0x2a835b){var _0x1830be=typeof _0x2a86de[_0x1819('0x1d')]==='undefined'&&typeof _0x2a86de['limit']===_0x1819('0x1e');var _0x1c0288=_0x2a835b['count'];var _0x2d4ac8=_0x1830be?0x0:_0x2a86de[_0x1819('0x1d')];var _0x263b41=_0x1830be?_0x2a835b[_0x1819('0x1f')]:_0x2a86de[_0x1819('0x1d')]+_0x2a86de[_0x1819('0x20')];var _0x18d2fd;if(_0x263b41>=_0x1c0288){_0x263b41=_0x1c0288;_0x18d2fd=0xc8;}else{_0x18d2fd=0xce;}_0x4cbc70['status'](_0x18d2fd);return _0x4cbc70[_0x1819('0x21')](_0x1819('0x22'),_0x2d4ac8+'-'+_0x263b41+'/'+_0x1c0288)['json'](_0x2a835b);}return null;};}function patchUpdates(_0x3659a7){return function(_0x3227a8){try{jsonpatch[_0x1819('0x23')](_0x3227a8,_0x3659a7,!![]);}catch(_0x111719){return BPromise['reject'](_0x111719);}return _0x3227a8['save']();};}function saveUpdates(_0x2de419,_0x2a7c59){return function(_0x421634){if(_0x421634){return _0x421634[_0x1819('0x24')](_0x2de419)[_0x1819('0x25')](function(_0x237f57){return _0x237f57;});}return null;};}function removeEntity(_0x1dc8db,_0x331f0c){return function(_0x4d6dc4){if(_0x4d6dc4){return _0x4d6dc4['destroy']()['then'](function(){_0x1dc8db[_0x1819('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x81db80,_0x477589){return function(_0x14832c){if(!_0x14832c){_0x81db80['sendStatus'](0x194);}return _0x14832c;};}function handleError(_0x2be4d4,_0x278c6b){_0x278c6b=_0x278c6b||0x1f4;return function(_0x222b71){logger['error'](_0x222b71[_0x1819('0x26')]);if(_0x222b71[_0x1819('0x27')]){delete _0x222b71[_0x1819('0x27')];}_0x2be4d4['status'](_0x278c6b)[_0x1819('0x28')](_0x222b71);};}exports['index']=function(_0x396bed,_0x5c99e2){var _0x50f783={},_0x19362a={},_0x1267cf={'count':0x0,'rows':[]};var _0x1150e1=_['map'](db['VoiceQueueReport'][_0x1819('0x29')],function(_0x5e6ba6){return{'name':_0x5e6ba6[_0x1819('0x2a')],'type':_0x5e6ba6[_0x1819('0x2b')][_0x1819('0x2c')]};});_0x19362a[_0x1819('0x2d')]=_[_0x1819('0x2e')](_0x1150e1,_0x1819('0x27'));_0x19362a['query']=_[_0x1819('0x2f')](_0x396bed[_0x1819('0x30')]);_0x19362a[_0x1819('0x31')]=_[_0x1819('0x32')](_0x19362a[_0x1819('0x2d')],_0x19362a['query']);_0x50f783[_0x1819('0x33')]=_[_0x1819('0x32')](_0x19362a[_0x1819('0x2d')],qs['fields'](_0x396bed['query'][_0x1819('0x34')]));_0x50f783[_0x1819('0x33')]=_0x50f783[_0x1819('0x33')][_0x1819('0x35')]?_0x50f783[_0x1819('0x33')]:_0x19362a[_0x1819('0x2d')];if(!_0x396bed['query'][_0x1819('0x36')](_0x1819('0x37'))){_0x50f783['limit']=qs[_0x1819('0x20')](_0x396bed[_0x1819('0x30')][_0x1819('0x20')]);_0x50f783[_0x1819('0x1d')]=qs[_0x1819('0x1d')](_0x396bed['query'][_0x1819('0x1d')]);}_0x50f783['order']=qs[_0x1819('0x38')](_0x396bed[_0x1819('0x30')][_0x1819('0x38')]);_0x50f783[_0x1819('0x39')]=qs[_0x1819('0x31')](_[_0x1819('0x3a')](_0x396bed[_0x1819('0x30')],_0x19362a['filters']),_0x1150e1);if(_0x396bed['query'][_0x1819('0x3b')]){_0x50f783['where']=_[_0x1819('0x3c')](_0x50f783['where'],{'$or':_[_0x1819('0x2e')](_0x1150e1,function(_0x54f326){if(_0x54f326[_0x1819('0x2b')]!==_0x1819('0x3d')){var _0x58677f={};_0x58677f[_0x54f326['name']]={'$like':'%'+_0x396bed[_0x1819('0x30')][_0x1819('0x3b')]+'%'};return _0x58677f;}})});}_0x50f783=_['merge']({},_0x50f783,_0x396bed['options']);var _0xb6e1d7={'where':_0x50f783['where']};return db[_0x1819('0x3e')][_0x1819('0x1f')](_0xb6e1d7)[_0x1819('0x25')](function(_0xab9f30){_0x1267cf[_0x1819('0x1f')]=_0xab9f30;if(_0x396bed['query']['includeAll']){_0x50f783[_0x1819('0x3f')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x1819('0x40')](_0x50f783);})[_0x1819('0x25')](function(_0x149c9c){_0x1267cf['rows']=_0x149c9c;return _0x1267cf;})[_0x1819('0x25')](respondWithFilteredResult(_0x5c99e2,_0x50f783))['catch'](handleError(_0x5c99e2,null));};exports[_0x1819('0x41')]=function(_0x160d84,_0x2c0380){var _0x2a2f15={'raw':![],'where':{'id':_0x160d84[_0x1819('0x42')]['id']}},_0x5c0594={};_0x5c0594[_0x1819('0x2d')]=_[_0x1819('0x2f')](db['VoiceQueueReport'][_0x1819('0x29')]);_0x5c0594[_0x1819('0x30')]=_['keys'](_0x160d84[_0x1819('0x30')]);_0x5c0594['filters']=_['intersection'](_0x5c0594[_0x1819('0x2d')],_0x5c0594[_0x1819('0x30')]);_0x2a2f15[_0x1819('0x33')]=_['intersection'](_0x5c0594[_0x1819('0x2d')],qs['fields'](_0x160d84[_0x1819('0x30')][_0x1819('0x34')]));_0x2a2f15[_0x1819('0x33')]=_0x2a2f15[_0x1819('0x33')]['length']?_0x2a2f15[_0x1819('0x33')]:_0x5c0594['model'];if(_0x160d84[_0x1819('0x30')][_0x1819('0x43')]){_0x2a2f15[_0x1819('0x3f')]=[{'all':!![]}];}_0x2a2f15=_[_0x1819('0x3c')]({},_0x2a2f15,_0x160d84[_0x1819('0x44')]);return db[_0x1819('0x3e')][_0x1819('0x45')](_0x2a2f15)[_0x1819('0x25')](handleEntityNotFound(_0x2c0380,null))[_0x1819('0x25')](respondWithResult(_0x2c0380,null))[_0x1819('0x46')](handleError(_0x2c0380,null));};exports[_0x1819('0x47')]=function(_0x4b7f85,_0x315802){return db['VoiceQueueReport'][_0x1819('0x47')](_0x4b7f85[_0x1819('0x48')],{})[_0x1819('0x25')](respondWithResult(_0x315802,0xc9))[_0x1819('0x46')](handleError(_0x315802,null));};exports['update']=function(_0x5888d8,_0x5991ef){if(_0x5888d8[_0x1819('0x48')]['id']){delete _0x5888d8[_0x1819('0x48')]['id'];}return db[_0x1819('0x3e')][_0x1819('0x45')]({'where':{'id':_0x5888d8['params']['id']}})[_0x1819('0x25')](handleEntityNotFound(_0x5991ef,null))[_0x1819('0x25')](saveUpdates(_0x5888d8[_0x1819('0x48')],null))[_0x1819('0x25')](respondWithResult(_0x5991ef,null))[_0x1819('0x46')](handleError(_0x5991ef,null));};exports[_0x1819('0x49')]=function(_0x3e9609,_0x36a5be){return db[_0x1819('0x3e')][_0x1819('0x45')]({'where':{'id':_0x3e9609[_0x1819('0x42')]['id']}})[_0x1819('0x25')](handleEntityNotFound(_0x36a5be,null))['then'](removeEntity(_0x36a5be,null))[_0x1819('0x46')](handleError(_0x36a5be,null));};exports['describe']=function(_0xe7fe19,_0xd18a45){return db[_0x1819('0x3e')][_0x1819('0x4a')]()[_0x1819('0x25')](respondWithResult(_0xd18a45,null))[_0x1819('0x46')](handleError(_0xd18a45,null));};exports[_0x1819('0x4b')]=function(_0x2649f0,_0x2898be){var _0x366ed0={},_0x22aa4f={},_0x3cbdd3={'count':0x0,'rows':[]};_0x22aa4f[_0x1819('0x2d')]=_[_0x1819('0x2f')](db[_0x1819('0x3e')]['rawAttributes']);_0x22aa4f[_0x1819('0x30')]=_[_0x1819('0x2f')](_0x2649f0[_0x1819('0x30')]);_0x22aa4f[_0x1819('0x31')]=_[_0x1819('0x32')](_0x22aa4f[_0x1819('0x2d')],_0x22aa4f[_0x1819('0x30')]);_0x366ed0['attributes']=_[_0x1819('0x32')](_0x22aa4f[_0x1819('0x2d')],qs[_0x1819('0x34')](_0x2649f0[_0x1819('0x30')]['fields']));_0x366ed0[_0x1819('0x33')]=_0x366ed0[_0x1819('0x33')][_0x1819('0x35')]?_0x366ed0[_0x1819('0x33')]:_0x22aa4f[_0x1819('0x2d')];if(!_0x2649f0[_0x1819('0x30')]['hasOwnProperty'](_0x1819('0x37'))){_0x366ed0[_0x1819('0x20')]=qs['limit'](_0x2649f0['query'][_0x1819('0x20')]);_0x366ed0[_0x1819('0x1d')]=qs[_0x1819('0x1d')](_0x2649f0['query'][_0x1819('0x1d')]);}_0x366ed0['order']=qs['sort'](_0x2649f0[_0x1819('0x30')][_0x1819('0x38')]);_0x366ed0[_0x1819('0x39')]=qs[_0x1819('0x31')](_['pick'](_0x2649f0[_0x1819('0x30')],_0x22aa4f[_0x1819('0x31')]));if(_0x2649f0[_0x1819('0x30')][_0x1819('0x3b')]){_0x366ed0[_0x1819('0x39')]=_[_0x1819('0x3c')](_0x366ed0[_0x1819('0x39')],{'$or':_[_0x1819('0x2e')](_0x366ed0[_0x1819('0x33')],function(_0x2c6994){var _0x1c9eed={};_0x1c9eed[_0x2c6994]={'$like':'%'+_0x2649f0[_0x1819('0x30')][_0x1819('0x3b')]+'%'};return _0x1c9eed;})});}_0x366ed0=_[_0x1819('0x3c')]({},_0x366ed0,_0x2649f0['options']);var _0x2abdb9={'where':_0x366ed0['where']};return db[_0x1819('0x3e')][_0x1819('0x1f')](_0x2abdb9)[_0x1819('0x25')](function(_0x2ebbeb){_0x3cbdd3[_0x1819('0x1f')]=_0x2ebbeb;if(_0x2649f0[_0x1819('0x30')]['includeAll']){_0x366ed0[_0x1819('0x3f')]=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x366ed0);})['then'](function(_0x502b61){_0x3cbdd3[_0x1819('0x4c')]=_0x502b61;return _0x3cbdd3;})[_0x1819('0x25')](respondWithFilteredResult(_0x2898be,_0x366ed0,_0x1819('0x4b')))['catch'](handleError(_0x2898be,null,_0x1819('0x4b')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 9a15eb8..7f3eb3b 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 _0xc3dc=['emit','hasOwnProperty','exports','events','VoiceQueueReport','save','update','remove'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xc3dc,0x143));var _0xcc3d=function(_0x4291dd,_0x95d82){_0x4291dd=_0x4291dd-0x0;var _0x152462=_0xc3dc[_0x4291dd];return _0x152462;};'use strict';var EventEmitter=require(_0xcc3d('0x0'));var VoiceQueueReport=require('../../mysqldb')['db'][_0xcc3d('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcc3d('0x2'),'afterUpdate':_0xcc3d('0x3'),'afterDestroy':_0xcc3d('0x4')};function emitEvent(_0x4dae6c){return function(_0x4a749,_0x59b552,_0x17ee87){VoiceQueueReportEvents[_0xcc3d('0x5')](_0x4dae6c+':'+_0x4a749['id'],_0x4a749);VoiceQueueReportEvents[_0xcc3d('0x5')](_0x4dae6c,_0x4a749);_0x17ee87(null);};}for(var e in events){if(events[_0xcc3d('0x6')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0xcc3d('0x7')]=VoiceQueueReportEvents; \ No newline at end of file +var _0xeeae=['VoiceQueueReport','setMaxListeners','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x24eac2,_0x3a17d3){var _0x366c0f=function(_0x4b0f33){while(--_0x4b0f33){_0x24eac2['push'](_0x24eac2['shift']());}};_0x366c0f(++_0x3a17d3);}(_0xeeae,0xf1));var _0xeeea=function(_0x3994a8,_0x2a4600){_0x3994a8=_0x3994a8-0x0;var _0x5790ba=_0xeeae[_0x3994a8];return _0x5790ba;};'use strict';var EventEmitter=require(_0xeeea('0x0'));var VoiceQueueReport=require(_0xeeea('0x1'))['db'][_0xeeea('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xeeea('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xeeea('0x4'),'afterDestroy':_0xeeea('0x5')};function emitEvent(_0x4e0eb9){return function(_0x28bb,_0x24d8d8,_0x3d669a){VoiceQueueReportEvents[_0xeeea('0x6')](_0x4e0eb9+':'+_0x28bb['id'],_0x28bb);VoiceQueueReportEvents['emit'](_0x4e0eb9,_0x28bb);_0x3d669a(null);};}for(var e in events){if(events[_0xeeea('0x7')](e)){var event=events[e];VoiceQueueReport[_0xeeea('0x8')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index c276902..ed55e96 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 _0x24c1=['define','VoiceQueueReport','report_queue','uniqueid','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports'];(function(_0x4c2c23,_0x3d8d28){var _0x5c992e=function(_0x5cfed7){while(--_0x5cfed7){_0x4c2c23['push'](_0x4c2c23['shift']());}};_0x5c992e(++_0x3d8d28);}(_0x24c1,0xba));var _0x124c=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x24c1[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x124c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x124c('0x1'));var moment=require(_0x124c('0x2'));var BPromise=require(_0x124c('0x3'));var rp=require(_0x124c('0x4'));var fs=require('fs');var path=require(_0x124c('0x5'));var rimraf=require(_0x124c('0x6'));var config=require(_0x124c('0x7'));var attributes=require(_0x124c('0x8'));module[_0x124c('0x9')]=function(_0x1e331c,_0x4e9442){return _0x1e331c[_0x124c('0xa')](_0x124c('0xb'),attributes,{'tableName':_0x124c('0xc'),'paranoid':![],'indexes':[{'fields':[_0x124c('0xd')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file +var _0xf32b=['VoiceQueueReport','uniqueid','calleridnum','lodash','util','api','bluebird','request-promise','../../config/environment','exports','define'];(function(_0x2ade97,_0x27cf01){var _0x5b3bac=function(_0x33ea52){while(--_0x33ea52){_0x2ade97['push'](_0x2ade97['shift']());}};_0x5b3bac(++_0x27cf01);}(_0xf32b,0x7c));var _0xbf32=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xf32b[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0xbf32('0x0'));var util=require(_0xbf32('0x1'));var logger=require('../../config/logger')(_0xbf32('0x2'));var moment=require('moment');var BPromise=require(_0xbf32('0x3'));var rp=require(_0xbf32('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbf32('0x5'));var attributes=require('./voiceQueueReport.attributes');module[_0xbf32('0x6')]=function(_0x229471,_0x4190b3){return _0x229471[_0xbf32('0x7')](_0xbf32('0x8'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0xbf32('0x9')]},{'fields':[_0xbf32('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index f8056d3..c15acb9 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 _0xfa53=['register','request','then','info','request\x20sent','error','code','VoiceQueueReport,\x20%s,\x20%s','message','result','catch','GetVoiceQueueReport','findAll','options','raw','where','attributes','limit','include','map','model','debug','stringify','CreateVoiceQueueReport','VoiceQueueReport','body','UpdateVoiceQueueReport','util','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket'];(function(_0x1cb3cf,_0x5816b1){var _0x2b6485=function(_0x494fc2){while(--_0x494fc2){_0x1cb3cf['push'](_0x1cb3cf['shift']());}};_0x2b6485(++_0x5816b1);}(_0xfa53,0x1ab));var _0x3fa5=function(_0x1ba7c8,_0x83898a){_0x1ba7c8=_0x1ba7c8-0x0;var _0x36ecef=_0xfa53[_0x1ba7c8];return _0x36ecef;};'use strict';var _=require('lodash');var util=require(_0x3fa5('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3fa5('0x1'));var fs=require('fs');var Redis=require(_0x3fa5('0x2'));var db=require(_0x3fa5('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3fa5('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3fa5('0x5'));var client=jayson[_0x3fa5('0x6')][_0x3fa5('0x7')]({'port':0x232a});config[_0x3fa5('0x8')]=_[_0x3fa5('0x9')](config[_0x3fa5('0x8')],{'host':_0x3fa5('0xa'),'port':0x18eb});var socket=require(_0x3fa5('0xb'))(new Redis(config[_0x3fa5('0x8')]));require(_0x3fa5('0xc'))[_0x3fa5('0xd')](socket);function respondWithRpcPromise(_0x1dac4f,_0x573c14,_0x439dd2){return new BPromise(function(_0x2d9825,_0x2fb21a){return client[_0x3fa5('0xe')](_0x1dac4f,_0x439dd2)[_0x3fa5('0xf')](function(_0x4fb30a){logger[_0x3fa5('0x10')]('VoiceQueueReport,\x20%s,\x20%s',_0x573c14,_0x3fa5('0x11'));logger['debug']('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x573c14,_0x3fa5('0x11'),JSON['stringify'](_0x4fb30a));if(_0x4fb30a['error']){if(_0x4fb30a[_0x3fa5('0x12')][_0x3fa5('0x13')]===0x1f4){logger[_0x3fa5('0x12')](_0x3fa5('0x14'),_0x573c14,_0x4fb30a[_0x3fa5('0x12')][_0x3fa5('0x15')]);return _0x2fb21a(_0x4fb30a[_0x3fa5('0x12')][_0x3fa5('0x15')]);}logger[_0x3fa5('0x12')](_0x3fa5('0x14'),_0x573c14,_0x4fb30a['error']['message']);return _0x2d9825(_0x4fb30a['error'][_0x3fa5('0x15')]);}else{logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x573c14,'request\x20sent');_0x2d9825(_0x4fb30a[_0x3fa5('0x16')][_0x3fa5('0x15')]);}})[_0x3fa5('0x17')](function(_0x63f2a7){logger[_0x3fa5('0x12')](_0x3fa5('0x14'),_0x573c14,_0x63f2a7);_0x2fb21a(_0x63f2a7);});});}exports[_0x3fa5('0x18')]=function(_0x2ae8d0){var _0x641aae=this;return new Promise(function(_0x1c9757,_0x197919){return db['VoiceQueueReport'][_0x3fa5('0x19')]({'raw':_0x2ae8d0[_0x3fa5('0x1a')]?_0x2ae8d0[_0x3fa5('0x1a')][_0x3fa5('0x1b')]===undefined?!![]:![]:!![],'where':_0x2ae8d0[_0x3fa5('0x1a')]?_0x2ae8d0[_0x3fa5('0x1a')][_0x3fa5('0x1c')]||null:null,'attributes':_0x2ae8d0['options']?_0x2ae8d0[_0x3fa5('0x1a')][_0x3fa5('0x1d')]||null:null,'limit':_0x2ae8d0[_0x3fa5('0x1a')]?_0x2ae8d0[_0x3fa5('0x1a')][_0x3fa5('0x1e')]||null:null,'include':_0x2ae8d0['options']?_0x2ae8d0[_0x3fa5('0x1a')][_0x3fa5('0x1f')]?_[_0x3fa5('0x20')](_0x2ae8d0[_0x3fa5('0x1a')]['include'],function(_0x4fd1ca){return{'model':db[_0x4fd1ca['model']],'as':_0x4fd1ca['as'],'attributes':_0x4fd1ca[_0x3fa5('0x1d')],'include':_0x4fd1ca['include']?_['map'](_0x4fd1ca[_0x3fa5('0x1f')],function(_0x55a773){return{'model':db[_0x55a773['model']],'as':_0x55a773['as'],'attributes':_0x55a773['attributes'],'include':_0x55a773[_0x3fa5('0x1f')]?_[_0x3fa5('0x20')](_0x55a773[_0x3fa5('0x1f')],function(_0x4dfe3d){return{'model':db[_0x4dfe3d[_0x3fa5('0x21')]],'as':_0x4dfe3d['as'],'attributes':_0x4dfe3d[_0x3fa5('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3fa5('0xf')](function(_0x245910){logger[_0x3fa5('0x10')](_0x3fa5('0x18'),_0x2ae8d0);logger[_0x3fa5('0x22')](_0x3fa5('0x18'),_0x2ae8d0,JSON[_0x3fa5('0x23')](_0x245910));_0x1c9757(_0x245910);})[_0x3fa5('0x17')](function(_0x2c406d){logger['error']('GetVoiceQueueReport',_0x2c406d[_0x3fa5('0x15')],_0x2ae8d0);_0x197919(_0x641aae['error'](0x1f4,_0x2c406d['message']));});});};exports[_0x3fa5('0x24')]=function(_0x1b35f5){var _0x33ea92=this;return new Promise(function(_0x3a51c6,_0x2e6f17){return db[_0x3fa5('0x25')]['create'](_0x1b35f5[_0x3fa5('0x26')],{'raw':_0x1b35f5[_0x3fa5('0x1a')]?_0x1b35f5[_0x3fa5('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x3fa5('0xf')](function(_0x20d081){logger[_0x3fa5('0x10')](_0x3fa5('0x24'),_0x1b35f5);logger[_0x3fa5('0x22')]('CreateVoiceQueueReport',_0x1b35f5,JSON[_0x3fa5('0x23')](_0x20d081));_0x3a51c6(_0x20d081);})[_0x3fa5('0x17')](function(_0x52d2c0){logger['error']('CreateVoiceQueueReport',_0x52d2c0[_0x3fa5('0x15')],_0x1b35f5);_0x2e6f17(_0x33ea92[_0x3fa5('0x12')](0x1f4,_0x52d2c0[_0x3fa5('0x15')]));});});};exports[_0x3fa5('0x27')]=function(_0x227a60){var _0x5ef5a2=this;return new Promise(function(_0x144bf8,_0x2e8a41){return db[_0x3fa5('0x25')]['update'](_0x227a60[_0x3fa5('0x26')],{'raw':_0x227a60[_0x3fa5('0x1a')]?_0x227a60['options'][_0x3fa5('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x227a60[_0x3fa5('0x1a')]?_0x227a60[_0x3fa5('0x1a')][_0x3fa5('0x1c')]||null:null,'attributes':_0x227a60[_0x3fa5('0x1a')]?_0x227a60['options'][_0x3fa5('0x1d')]||null:null,'limit':_0x227a60[_0x3fa5('0x1a')]?_0x227a60[_0x3fa5('0x1a')][_0x3fa5('0x1e')]||null:null})['then'](function(_0x316f73){logger[_0x3fa5('0x10')](_0x3fa5('0x27'),_0x227a60);logger[_0x3fa5('0x22')](_0x3fa5('0x27'),_0x227a60,JSON[_0x3fa5('0x23')](_0x316f73));_0x144bf8(_0x316f73);})[_0x3fa5('0x17')](function(_0x41dcc4){logger['error'](_0x3fa5('0x27'),_0x41dcc4[_0x3fa5('0x15')],_0x227a60);_0x2e8a41(_0x5ef5a2[_0x3fa5('0x12')](0x1f4,_0x41dcc4[_0x3fa5('0x15')]));});});}; \ No newline at end of file +var _0x5ea5=['http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','then','info','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceQueueReport,\x20%s,\x20%s','result','GetVoiceQueueReport','VoiceQueueReport','findAll','options','where','limit','include','map','model','attributes','catch','CreateVoiceQueueReport','create','body','raw','UpdateVoiceQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x10bae6,_0x41d85f){var _0x251123=function(_0x548886){while(--_0x548886){_0x10bae6['push'](_0x10bae6['shift']());}};_0x251123(++_0x41d85f);}(_0x5ea5,0xaf));var _0x55ea=function(_0x5dcb2f,_0x402ca3){_0x5dcb2f=_0x5dcb2f-0x0;var _0x2cf625=_0x5ea5[_0x5dcb2f];return _0x2cf625;};'use strict';var _=require(_0x55ea('0x0'));var util=require(_0x55ea('0x1'));var moment=require(_0x55ea('0x2'));var BPromise=require(_0x55ea('0x3'));var rs=require(_0x55ea('0x4'));var fs=require('fs');var Redis=require(_0x55ea('0x5'));var db=require(_0x55ea('0x6'))['db'];var utils=require(_0x55ea('0x7'));var logger=require(_0x55ea('0x8'))(_0x55ea('0x9'));var config=require(_0x55ea('0xa'));var jayson=require(_0x55ea('0xb'));var client=jayson[_0x55ea('0xc')][_0x55ea('0xd')]({'port':0x232a});config[_0x55ea('0xe')]=_[_0x55ea('0xf')](config[_0x55ea('0xe')],{'host':_0x55ea('0x10'),'port':0x18eb});var socket=require(_0x55ea('0x11'))(new Redis(config[_0x55ea('0xe')]));require(_0x55ea('0x12'))[_0x55ea('0x13')](socket);function respondWithRpcPromise(_0x53f347,_0x231794,_0x422b1f){return new BPromise(function(_0x1256cf,_0x3d0bf9){return client['request'](_0x53f347,_0x422b1f)[_0x55ea('0x14')](function(_0x3124d9){logger[_0x55ea('0x15')]('VoiceQueueReport,\x20%s,\x20%s',_0x231794,_0x55ea('0x16'));logger[_0x55ea('0x17')](_0x55ea('0x18'),_0x231794,_0x55ea('0x16'),JSON[_0x55ea('0x19')](_0x3124d9));if(_0x3124d9[_0x55ea('0x1a')]){if(_0x3124d9['error'][_0x55ea('0x1b')]===0x1f4){logger[_0x55ea('0x1a')]('VoiceQueueReport,\x20%s,\x20%s',_0x231794,_0x3124d9[_0x55ea('0x1a')][_0x55ea('0x1c')]);return _0x3d0bf9(_0x3124d9['error']['message']);}logger[_0x55ea('0x1a')](_0x55ea('0x1d'),_0x231794,_0x3124d9[_0x55ea('0x1a')][_0x55ea('0x1c')]);return _0x1256cf(_0x3124d9['error']['message']);}else{logger[_0x55ea('0x15')](_0x55ea('0x1d'),_0x231794,_0x55ea('0x16'));_0x1256cf(_0x3124d9[_0x55ea('0x1e')][_0x55ea('0x1c')]);}})['catch'](function(_0xd7e99f){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x231794,_0xd7e99f);_0x3d0bf9(_0xd7e99f);});});}exports[_0x55ea('0x1f')]=function(_0x5b7378){var _0x1ef1b6=this;return new Promise(function(_0x599f1d,_0x2d17a9){return db[_0x55ea('0x20')][_0x55ea('0x21')]({'raw':_0x5b7378[_0x55ea('0x22')]?_0x5b7378[_0x55ea('0x22')]['raw']===undefined?!![]:![]:!![],'where':_0x5b7378['options']?_0x5b7378[_0x55ea('0x22')][_0x55ea('0x23')]||null:null,'attributes':_0x5b7378['options']?_0x5b7378[_0x55ea('0x22')]['attributes']||null:null,'limit':_0x5b7378[_0x55ea('0x22')]?_0x5b7378[_0x55ea('0x22')][_0x55ea('0x24')]||null:null,'include':_0x5b7378[_0x55ea('0x22')]?_0x5b7378[_0x55ea('0x22')][_0x55ea('0x25')]?_[_0x55ea('0x26')](_0x5b7378[_0x55ea('0x22')]['include'],function(_0x22a09f){return{'model':db[_0x22a09f[_0x55ea('0x27')]],'as':_0x22a09f['as'],'attributes':_0x22a09f[_0x55ea('0x28')],'include':_0x22a09f[_0x55ea('0x25')]?_[_0x55ea('0x26')](_0x22a09f[_0x55ea('0x25')],function(_0x9d0f4){return{'model':db[_0x9d0f4[_0x55ea('0x27')]],'as':_0x9d0f4['as'],'attributes':_0x9d0f4[_0x55ea('0x28')],'include':_0x9d0f4['include']?_[_0x55ea('0x26')](_0x9d0f4['include'],function(_0x18415d){return{'model':db[_0x18415d[_0x55ea('0x27')]],'as':_0x18415d['as'],'attributes':_0x18415d['attributes']};}):[]};}):[]};}):[]:[]})[_0x55ea('0x14')](function(_0x101a16){logger[_0x55ea('0x15')]('GetVoiceQueueReport',_0x5b7378);logger[_0x55ea('0x17')](_0x55ea('0x1f'),_0x5b7378,JSON[_0x55ea('0x19')](_0x101a16));_0x599f1d(_0x101a16);})[_0x55ea('0x29')](function(_0x1d2f72){logger[_0x55ea('0x1a')](_0x55ea('0x1f'),_0x1d2f72[_0x55ea('0x1c')],_0x5b7378);_0x2d17a9(_0x1ef1b6[_0x55ea('0x1a')](0x1f4,_0x1d2f72[_0x55ea('0x1c')]));});});};exports[_0x55ea('0x2a')]=function(_0x2a8ad3){var _0xd12893=this;return new Promise(function(_0x4b1d85,_0x56a082){return db[_0x55ea('0x20')][_0x55ea('0x2b')](_0x2a8ad3[_0x55ea('0x2c')],{'raw':_0x2a8ad3['options']?_0x2a8ad3['options'][_0x55ea('0x2d')]===undefined?!![]:![]:!![]})['then'](function(_0x7c7a1f){logger[_0x55ea('0x15')]('CreateVoiceQueueReport',_0x2a8ad3);logger[_0x55ea('0x17')](_0x55ea('0x2a'),_0x2a8ad3,JSON[_0x55ea('0x19')](_0x7c7a1f));_0x4b1d85(_0x7c7a1f);})['catch'](function(_0x18c780){logger[_0x55ea('0x1a')](_0x55ea('0x2a'),_0x18c780[_0x55ea('0x1c')],_0x2a8ad3);_0x56a082(_0xd12893[_0x55ea('0x1a')](0x1f4,_0x18c780[_0x55ea('0x1c')]));});});};exports[_0x55ea('0x2e')]=function(_0x55139c){var _0x2e228f=this;return new Promise(function(_0x4bfa0a,_0x3c2038){return db['VoiceQueueReport']['update'](_0x55139c[_0x55ea('0x2c')],{'raw':_0x55139c[_0x55ea('0x22')]?_0x55139c[_0x55ea('0x22')][_0x55ea('0x2d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55139c[_0x55ea('0x22')]?_0x55139c[_0x55ea('0x22')][_0x55ea('0x23')]||null:null,'attributes':_0x55139c[_0x55ea('0x22')]?_0x55139c['options'][_0x55ea('0x28')]||null:null,'limit':_0x55139c[_0x55ea('0x22')]?_0x55139c[_0x55ea('0x22')][_0x55ea('0x24')]||null:null})[_0x55ea('0x14')](function(_0x51b95e){logger[_0x55ea('0x15')](_0x55ea('0x2e'),_0x55139c);logger[_0x55ea('0x17')](_0x55ea('0x2e'),_0x55139c,JSON[_0x55ea('0x19')](_0x51b95e));_0x4bfa0a(_0x51b95e);})[_0x55ea('0x29')](function(_0x4a7f5f){logger[_0x55ea('0x1a')](_0x55ea('0x2e'),_0x4a7f5f['message'],_0x55139c);_0x3c2038(_0x2e228f['error'](0x1f4,_0x4a7f5f[_0x55ea('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index e72ce31..25a95dd 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 _0x12af=['emit','register','length','voiceQueueReport:','./voiceQueueReport.events','save','remove','update'];(function(_0xbc346f,_0x3db5c0){var _0x9f9260=function(_0x37e6b9){while(--_0x37e6b9){_0xbc346f['push'](_0xbc346f['shift']());}};_0x9f9260(++_0x3db5c0);}(_0x12af,0x84));var _0xf12a=function(_0x5d082a,_0x4aa33f){_0x5d082a=_0x5d082a-0x0;var _0xebd7f4=_0x12af[_0x5d082a];return _0xebd7f4;};'use strict';var VoiceQueueReportEvents=require(_0xf12a('0x0'));var events=[_0xf12a('0x1'),_0xf12a('0x2'),_0xf12a('0x3')];function createListener(_0x2ae1c5,_0x2e57f0){return function(_0x17dde3){_0x2e57f0[_0xf12a('0x4')](_0x2ae1c5,_0x17dde3);};}function removeListener(_0x3acec1,_0x5d80c8){return function(){VoiceQueueReportEvents['removeListener'](_0x3acec1,_0x5d80c8);};}exports[_0xf12a('0x5')]=function(_0x52084a){for(var _0xdf6545=0x0,_0x263f07=events[_0xf12a('0x6')];_0xdf6545<_0x263f07;_0xdf6545++){var _0xf0b70f=events[_0xdf6545];var _0x5424b1=createListener(_0xf12a('0x7')+_0xf0b70f,_0x52084a);VoiceQueueReportEvents['on'](_0xf0b70f,_0x5424b1);}}; \ No newline at end of file +var _0x56e7=['emit','removeListener','length','save','remove'];(function(_0x59f3ab,_0x258e30){var _0x42a631=function(_0x3304ca){while(--_0x3304ca){_0x59f3ab['push'](_0x59f3ab['shift']());}};_0x42a631(++_0x258e30);}(_0x56e7,0x7b));var _0x756e=function(_0x4c6e29,_0x1cbe74){_0x4c6e29=_0x4c6e29-0x0;var _0x4bc9d9=_0x56e7[_0x4c6e29];return _0x4bc9d9;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x756e('0x0'),_0x756e('0x1'),'update'];function createListener(_0x2eadee,_0x3efe5c){return function(_0x46a672){_0x3efe5c[_0x756e('0x2')](_0x2eadee,_0x46a672);};}function removeListener(_0x11ce5f,_0x38546a){return function(){VoiceQueueReportEvents[_0x756e('0x3')](_0x11ce5f,_0x38546a);};}exports['register']=function(_0x3b3b8f){for(var _0x404189=0x0,_0x26519d=events[_0x756e('0x4')];_0x404189<_0x26519d;_0x404189++){var _0x5c8589=events[_0x404189];var _0x1c6a22=createListener('voiceQueueReport:'+_0x5c8589,_0x3b3b8f);VoiceQueueReportEvents['on'](_0x5c8589,_0x1c6a22);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 48132b7..c5683cc 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 _0xb2be=['destroy','exports','multer','path','connect-timeout','fs-extra','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','show','create','put','/:id','delete'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xb2be,0xb2));var _0xeb2b=function(_0xda501a,_0x159d6a){_0xda501a=_0xda501a-0x0;var _0x44be3a=_0xb2be[_0xda501a];return _0x44be3a;};'use strict';var multer=require(_0xeb2b('0x0'));var util=require('util');var path=require(_0xeb2b('0x1'));var timeout=require(_0xeb2b('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xeb2b('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xeb2b('0x4'));var controller=require(_0xeb2b('0x5'));router[_0xeb2b('0x6')]('/',auth[_0xeb2b('0x7')](),controller[_0xeb2b('0x8')]);router[_0xeb2b('0x6')]('/:id',auth[_0xeb2b('0x7')](),controller[_0xeb2b('0x9')]);router['post']('/',auth[_0xeb2b('0x7')](),controller[_0xeb2b('0xa')]);router[_0xeb2b('0xb')](_0xeb2b('0xc'),auth[_0xeb2b('0x7')](),controller['update']);router[_0xeb2b('0xd')](_0xeb2b('0xc'),auth[_0xeb2b('0x7')](),controller[_0xeb2b('0xe')]);module[_0xeb2b('0xf')]=router; \ No newline at end of file +var _0xa31e=['create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./voiceQueuesLog.controller','get','isAuthenticated','index','show','post'];(function(_0x406e90,_0x82f8d8){var _0x3d66ff=function(_0x55c1ca){while(--_0x55c1ca){_0x406e90['push'](_0x406e90['shift']());}};_0x3d66ff(++_0x82f8d8);}(_0xa31e,0x11f));var _0xea31=function(_0xaff1bd,_0x5380c4){_0xaff1bd=_0xaff1bd-0x0;var _0x52ad89=_0xa31e[_0xaff1bd];return _0x52ad89;};'use strict';var multer=require(_0xea31('0x0'));var util=require(_0xea31('0x1'));var path=require(_0xea31('0x2'));var timeout=require(_0xea31('0x3'));var express=require(_0xea31('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xea31('0x5'));var interaction=require(_0xea31('0x6'));var config=require('../../config/environment');var controller=require(_0xea31('0x7'));router[_0xea31('0x8')]('/',auth[_0xea31('0x9')](),controller[_0xea31('0xa')]);router[_0xea31('0x8')]('/:id',auth[_0xea31('0x9')](),controller[_0xea31('0xb')]);router[_0xea31('0xc')]('/',auth[_0xea31('0x9')](),controller[_0xea31('0xd')]);router[_0xea31('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xea31('0xf')]);router[_0xea31('0x10')](_0xea31('0x11'),auth[_0xea31('0x9')](),controller[_0xea31('0x12')]);module[_0xea31('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index f4b64df..fcd2ff6 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 _0x03f6=['sequelize','moment','STRING','DATE','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x03f6,0x162));var _0x603f=function(_0x2a95f2,_0x133fe8){_0x2a95f2=_0x2a95f2-0x0;var _0x33416a=_0x03f6[_0x2a95f2];return _0x33416a;};'use strict';var Sequelize=require(_0x603f('0x0'));var moment=require(_0x603f('0x1'));module['exports']={'time':{'type':Sequelize[_0x603f('0x2')]},'callid':{'type':Sequelize[_0x603f('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x603f('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x603f('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x603f('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x603f('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x603f('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x603f('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x603f('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x603f('0x3')],'allowNull':![],'defaultValue':Sequelize[_0x603f('0x4')](_0x603f('0x5'))}}; \ No newline at end of file +var _0x0eaf=['moment','STRING','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize'];(function(_0x3675d0,_0xb4df80){var _0xf72c35=function(_0x288e75){while(--_0x288e75){_0x3675d0['push'](_0x3675d0['shift']());}};_0xf72c35(++_0xb4df80);}(_0x0eaf,0x162));var _0xf0ea=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x0eaf[_0x46e363];return _0x3fb059;};'use strict';var Sequelize=require(_0xf0ea('0x0'));var moment=require(_0xf0ea('0x1'));module['exports']={'time':{'type':Sequelize[_0xf0ea('0x2')]},'callid':{'type':Sequelize[_0xf0ea('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xf0ea('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xf0ea('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xf0ea('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xf0ea('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xf0ea('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xf0ea('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xf0ea('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xf0ea('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xf0ea('0x3')](_0xf0ea('0x4'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 39053eb..3bfb35d 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 _0x6d6f=['crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','map','VoiceQueuesLog','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','options','includeAll','include','findAll','rows','show','params','catch','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','lodash','squel'];(function(_0x1481ad,_0x2d3888){var _0x5ef3cb=function(_0x1992ef){while(--_0x1992ef){_0x1481ad['push'](_0x1481ad['shift']());}};_0x5ef3cb(++_0x2d3888);}(_0x6d6f,0x1e6));var _0xf6d6=function(_0x2ee790,_0x5a8661){_0x2ee790=_0x2ee790-0x0;var _0x5a54a5=_0x6d6f[_0x2ee790];return _0x5a54a5;};'use strict';var emlformat=require(_0xf6d6('0x0'));var rimraf=require(_0xf6d6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf6d6('0x2'));var rp=require(_0xf6d6('0x3'));var moment=require('moment');var BPromise=require(_0xf6d6('0x4'));var Mustache=require(_0xf6d6('0x5'));var util=require('util');var path=require(_0xf6d6('0x6'));var sox=require('sox');var csv=require(_0xf6d6('0x7'));var ejs=require(_0xf6d6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf6d6('0x9'));var squel=require(_0xf6d6('0xa'));var crypto=require(_0xf6d6('0xb'));var jsforce=require(_0xf6d6('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf6d6('0x7'));var querystring=require(_0xf6d6('0xd'));var Papa=require(_0xf6d6('0xe'));var Redis=require(_0xf6d6('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf6d6('0x10'));var hardwareService=require(_0xf6d6('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xf6d6('0x12'));var config=require(_0xf6d6('0x13'));var licenseUtil=require(_0xf6d6('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b1e6c,_0x486d03){_0x486d03=_0x486d03||0xcc;return function(_0x437e69){if(_0x437e69){return _0x4b1e6c[_0xf6d6('0x15')](_0x486d03);}return _0x4b1e6c[_0xf6d6('0x16')](_0x486d03)[_0xf6d6('0x17')]();};}function respondWithResult(_0x45aa60,_0x6c9801){_0x6c9801=_0x6c9801||0xc8;return function(_0x44e021){if(_0x44e021){return _0x45aa60[_0xf6d6('0x16')](_0x6c9801)[_0xf6d6('0x18')](_0x44e021);}};}function respondWithFilteredResult(_0x596b7a,_0xd1ea56){return function(_0xa9d0d){if(_0xa9d0d){var _0x5ab8e2=typeof _0xd1ea56[_0xf6d6('0x19')]===_0xf6d6('0x1a')&&typeof _0xd1ea56[_0xf6d6('0x1b')]==='undefined';var _0x50610b=_0xa9d0d[_0xf6d6('0x1c')];var _0x4cbb15=_0x5ab8e2?0x0:_0xd1ea56[_0xf6d6('0x19')];var _0x5c68f7=_0x5ab8e2?_0xa9d0d[_0xf6d6('0x1c')]:_0xd1ea56[_0xf6d6('0x19')]+_0xd1ea56[_0xf6d6('0x1b')];var _0x5cf23f;if(_0x5c68f7>=_0x50610b){_0x5c68f7=_0x50610b;_0x5cf23f=0xc8;}else{_0x5cf23f=0xce;}_0x596b7a[_0xf6d6('0x16')](_0x5cf23f);return _0x596b7a[_0xf6d6('0x1d')](_0xf6d6('0x1e'),_0x4cbb15+'-'+_0x5c68f7+'/'+_0x50610b)['json'](_0xa9d0d);}return null;};}function patchUpdates(_0x36decf){return function(_0x38cd68){try{jsonpatch[_0xf6d6('0x1f')](_0x38cd68,_0x36decf,!![]);}catch(_0xa3deec){return BPromise[_0xf6d6('0x20')](_0xa3deec);}return _0x38cd68[_0xf6d6('0x21')]();};}function saveUpdates(_0x37d538,_0x142e89){return function(_0x3fad3){if(_0x3fad3){return _0x3fad3[_0xf6d6('0x22')](_0x37d538)['then'](function(_0x5785da){return _0x5785da;});}return null;};}function removeEntity(_0x48a3ea,_0x5f4b8e){return function(_0x49db23){if(_0x49db23){return _0x49db23[_0xf6d6('0x23')]()[_0xf6d6('0x24')](function(){_0x48a3ea['status'](0xcc)[_0xf6d6('0x17')]();});}};}function handleEntityNotFound(_0x5a19d3,_0x3db7cf){return function(_0xa811b7){if(!_0xa811b7){_0x5a19d3['sendStatus'](0x194);}return _0xa811b7;};}function handleError(_0x3e427b,_0x5903f4){_0x5903f4=_0x5903f4||0x1f4;return function(_0x58755e){logger['error'](_0x58755e[_0xf6d6('0x25')]);if(_0x58755e[_0xf6d6('0x26')]){delete _0x58755e['name'];}_0x3e427b['status'](_0x5903f4)[_0xf6d6('0x27')](_0x58755e);};}exports[_0xf6d6('0x28')]=function(_0x123ba4,_0x40ff97){var _0x49222d={},_0x1705eb={},_0x48e670={'count':0x0,'rows':[]};var _0x540258=_[_0xf6d6('0x29')](db[_0xf6d6('0x2a')][_0xf6d6('0x2b')],function(_0x88f6b6){return{'name':_0x88f6b6['fieldName'],'type':_0x88f6b6[_0xf6d6('0x2c')][_0xf6d6('0x2d')]};});_0x1705eb[_0xf6d6('0x2e')]=_[_0xf6d6('0x29')](_0x540258,_0xf6d6('0x26'));_0x1705eb['query']=_[_0xf6d6('0x2f')](_0x123ba4[_0xf6d6('0x30')]);_0x1705eb[_0xf6d6('0x31')]=_[_0xf6d6('0x32')](_0x1705eb[_0xf6d6('0x2e')],_0x1705eb[_0xf6d6('0x30')]);_0x49222d[_0xf6d6('0x33')]=_[_0xf6d6('0x32')](_0x1705eb[_0xf6d6('0x2e')],qs[_0xf6d6('0x34')](_0x123ba4[_0xf6d6('0x30')][_0xf6d6('0x34')]));_0x49222d[_0xf6d6('0x33')]=_0x49222d[_0xf6d6('0x33')][_0xf6d6('0x35')]?_0x49222d['attributes']:_0x1705eb[_0xf6d6('0x2e')];if(!_0x123ba4[_0xf6d6('0x30')]['hasOwnProperty'](_0xf6d6('0x36'))){_0x49222d['limit']=qs[_0xf6d6('0x1b')](_0x123ba4[_0xf6d6('0x30')][_0xf6d6('0x1b')]);_0x49222d['offset']=qs[_0xf6d6('0x19')](_0x123ba4['query'][_0xf6d6('0x19')]);}_0x49222d[_0xf6d6('0x37')]=qs[_0xf6d6('0x38')](_0x123ba4[_0xf6d6('0x30')][_0xf6d6('0x38')]);_0x49222d[_0xf6d6('0x39')]=qs[_0xf6d6('0x31')](_[_0xf6d6('0x3a')](_0x123ba4[_0xf6d6('0x30')],_0x1705eb[_0xf6d6('0x31')]),_0x540258);if(_0x123ba4[_0xf6d6('0x30')][_0xf6d6('0x3b')]){_0x49222d[_0xf6d6('0x39')]=_['merge'](_0x49222d['where'],{'$or':_[_0xf6d6('0x29')](_0x540258,function(_0x570bfd){if(_0x570bfd[_0xf6d6('0x2c')]!=='VIRTUAL'){var _0x268e8a={};_0x268e8a[_0x570bfd[_0xf6d6('0x26')]]={'$like':'%'+_0x123ba4[_0xf6d6('0x30')][_0xf6d6('0x3b')]+'%'};return _0x268e8a;}})});}_0x49222d=_['merge']({},_0x49222d,_0x123ba4[_0xf6d6('0x3c')]);var _0x1c8cce={'where':_0x49222d[_0xf6d6('0x39')]};return db[_0xf6d6('0x2a')]['count'](_0x1c8cce)['then'](function(_0xe3c175){_0x48e670['count']=_0xe3c175;if(_0x123ba4[_0xf6d6('0x30')][_0xf6d6('0x3d')]){_0x49222d[_0xf6d6('0x3e')]=[{'all':!![]}];}return db[_0xf6d6('0x2a')][_0xf6d6('0x3f')](_0x49222d);})[_0xf6d6('0x24')](function(_0x48287e){_0x48e670[_0xf6d6('0x40')]=_0x48287e;return _0x48e670;})[_0xf6d6('0x24')](respondWithFilteredResult(_0x40ff97,_0x49222d))['catch'](handleError(_0x40ff97,null));};exports[_0xf6d6('0x41')]=function(_0x4fa933,_0x1373fd){var _0x279e44={'raw':!![],'where':{'id':_0x4fa933[_0xf6d6('0x42')]['id']}},_0x2e4d40={};_0x2e4d40[_0xf6d6('0x2e')]=_[_0xf6d6('0x2f')](db['VoiceQueuesLog'][_0xf6d6('0x2b')]);_0x2e4d40[_0xf6d6('0x30')]=_[_0xf6d6('0x2f')](_0x4fa933[_0xf6d6('0x30')]);_0x2e4d40[_0xf6d6('0x31')]=_['intersection'](_0x2e4d40[_0xf6d6('0x2e')],_0x2e4d40[_0xf6d6('0x30')]);_0x279e44['attributes']=_[_0xf6d6('0x32')](_0x2e4d40['model'],qs[_0xf6d6('0x34')](_0x4fa933[_0xf6d6('0x30')]['fields']));_0x279e44[_0xf6d6('0x33')]=_0x279e44['attributes'][_0xf6d6('0x35')]?_0x279e44[_0xf6d6('0x33')]:_0x2e4d40['model'];if(_0x4fa933['query'][_0xf6d6('0x3d')]){_0x279e44[_0xf6d6('0x3e')]=[{'all':!![]}];}_0x279e44=_['merge']({},_0x279e44,_0x4fa933['options']);return db[_0xf6d6('0x2a')]['find'](_0x279e44)['then'](handleEntityNotFound(_0x1373fd,null))['then'](respondWithResult(_0x1373fd,null))[_0xf6d6('0x43')](handleError(_0x1373fd,null));};exports[_0xf6d6('0x44')]=function(_0x29003a,_0x1b7c00){return db[_0xf6d6('0x2a')]['create'](_0x29003a[_0xf6d6('0x45')],{})[_0xf6d6('0x24')](respondWithResult(_0x1b7c00,0xc9))[_0xf6d6('0x43')](handleError(_0x1b7c00,null));};exports['update']=function(_0x476dcd,_0x591226){if(_0x476dcd['body']['id']){delete _0x476dcd[_0xf6d6('0x45')]['id'];}return db['VoiceQueuesLog']['find']({'where':{'id':_0x476dcd['params']['id']}})[_0xf6d6('0x24')](handleEntityNotFound(_0x591226,null))[_0xf6d6('0x24')](saveUpdates(_0x476dcd['body'],null))['then'](respondWithResult(_0x591226,null))[_0xf6d6('0x43')](handleError(_0x591226,null));};exports['destroy']=function(_0x342d37,_0x1a488b){return db[_0xf6d6('0x2a')][_0xf6d6('0x46')]({'where':{'id':_0x342d37[_0xf6d6('0x42')]['id']}})[_0xf6d6('0x24')](handleEntityNotFound(_0x1a488b,null))['then'](removeEntity(_0x1a488b,null))[_0xf6d6('0x43')](handleError(_0x1a488b,null));}; \ No newline at end of file +var _0xe897=['end','sendStatus','stack','name','send','index','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','map','options','VoiceQueuesLog','includeAll','findAll','rows','show','params','include','find','catch','create','body','eml-format','fast-json-patch','request-promise','moment','bluebird','sox','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','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then'];(function(_0xcc6f57,_0x140c81){var _0x1a9702=function(_0x2e8f27){while(--_0x2e8f27){_0xcc6f57['push'](_0xcc6f57['shift']());}};_0x1a9702(++_0x140c81);}(_0xe897,0x14a));var _0x7e89=function(_0x5c20e0,_0x1972d7){_0x5c20e0=_0x5c20e0-0x0;var _0x5e4074=_0xe897[_0x5c20e0];return _0x5e4074;};'use strict';var emlformat=require(_0x7e89('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7e89('0x1'));var rp=require(_0x7e89('0x2'));var moment=require(_0x7e89('0x3'));var BPromise=require(_0x7e89('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x7e89('0x5'));var csv=require(_0x7e89('0x6'));var ejs=require(_0x7e89('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7e89('0x8'));var squel=require(_0x7e89('0x9'));var crypto=require(_0x7e89('0xa'));var jsforce=require(_0x7e89('0xb'));var deskjs=require(_0x7e89('0xc'));var toCsv=require(_0x7e89('0x6'));var querystring=require('querystring');var Papa=require(_0x7e89('0xd'));var Redis=require(_0x7e89('0xe'));var authService=require(_0x7e89('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x7e89('0x10'));var hardwareService=require(_0x7e89('0x11'));var logger=require(_0x7e89('0x12'))(_0x7e89('0x13'));var utils=require(_0x7e89('0x14'));var config=require(_0x7e89('0x15'));var licenseUtil=require(_0x7e89('0x16'));var db=require(_0x7e89('0x17'))['db'];function respondWithStatusCode(_0x39386a,_0x30542f){_0x30542f=_0x30542f||0xcc;return function(_0x5b8d17){if(_0x5b8d17){return _0x39386a['sendStatus'](_0x30542f);}return _0x39386a[_0x7e89('0x18')](_0x30542f)['end']();};}function respondWithResult(_0x4ac69a,_0x3740fc){_0x3740fc=_0x3740fc||0xc8;return function(_0x427fd3){if(_0x427fd3){return _0x4ac69a['status'](_0x3740fc)[_0x7e89('0x19')](_0x427fd3);}};}function respondWithFilteredResult(_0x29ada7,_0x292268){return function(_0x48eb96){if(_0x48eb96){var _0x31db73=typeof _0x292268[_0x7e89('0x1a')]===_0x7e89('0x1b')&&typeof _0x292268['limit']===_0x7e89('0x1b');var _0x593da7=_0x48eb96[_0x7e89('0x1c')];var _0x4118ea=_0x31db73?0x0:_0x292268[_0x7e89('0x1a')];var _0x498188=_0x31db73?_0x48eb96['count']:_0x292268[_0x7e89('0x1a')]+_0x292268[_0x7e89('0x1d')];var _0x153224;if(_0x498188>=_0x593da7){_0x498188=_0x593da7;_0x153224=0xc8;}else{_0x153224=0xce;}_0x29ada7['status'](_0x153224);return _0x29ada7['set'](_0x7e89('0x1e'),_0x4118ea+'-'+_0x498188+'/'+_0x593da7)[_0x7e89('0x19')](_0x48eb96);}return null;};}function patchUpdates(_0x39bcdb){return function(_0x49c2d6){try{jsonpatch[_0x7e89('0x1f')](_0x49c2d6,_0x39bcdb,!![]);}catch(_0x44b419){return BPromise[_0x7e89('0x20')](_0x44b419);}return _0x49c2d6['save']();};}function saveUpdates(_0x16a4ae,_0x1b999f){return function(_0x6081){if(_0x6081){return _0x6081[_0x7e89('0x21')](_0x16a4ae)[_0x7e89('0x22')](function(_0x37f767){return _0x37f767;});}return null;};}function removeEntity(_0x5943b7,_0x244f56){return function(_0x34c3b2){if(_0x34c3b2){return _0x34c3b2['destroy']()[_0x7e89('0x22')](function(){_0x5943b7[_0x7e89('0x18')](0xcc)[_0x7e89('0x23')]();});}};}function handleEntityNotFound(_0x4fb385,_0xdb6988){return function(_0x4f7fcd){if(!_0x4f7fcd){_0x4fb385[_0x7e89('0x24')](0x194);}return _0x4f7fcd;};}function handleError(_0x291e48,_0x4bd59d){_0x4bd59d=_0x4bd59d||0x1f4;return function(_0x11b19e){logger['error'](_0x11b19e[_0x7e89('0x25')]);if(_0x11b19e[_0x7e89('0x26')]){delete _0x11b19e[_0x7e89('0x26')];}_0x291e48[_0x7e89('0x18')](_0x4bd59d)[_0x7e89('0x27')](_0x11b19e);};}exports[_0x7e89('0x28')]=function(_0x2af136,_0x131fee){var _0x11f609={},_0x3df9f2={},_0x3bf58c={'count':0x0,'rows':[]};var _0x3f32b7=_['map'](db['VoiceQueuesLog'][_0x7e89('0x29')],function(_0x182f67){return{'name':_0x182f67['fieldName'],'type':_0x182f67[_0x7e89('0x2a')][_0x7e89('0x2b')]};});_0x3df9f2[_0x7e89('0x2c')]=_['map'](_0x3f32b7,'name');_0x3df9f2[_0x7e89('0x2d')]=_[_0x7e89('0x2e')](_0x2af136[_0x7e89('0x2d')]);_0x3df9f2[_0x7e89('0x2f')]=_[_0x7e89('0x30')](_0x3df9f2[_0x7e89('0x2c')],_0x3df9f2[_0x7e89('0x2d')]);_0x11f609[_0x7e89('0x31')]=_['intersection'](_0x3df9f2[_0x7e89('0x2c')],qs[_0x7e89('0x32')](_0x2af136[_0x7e89('0x2d')]['fields']));_0x11f609[_0x7e89('0x31')]=_0x11f609[_0x7e89('0x31')][_0x7e89('0x33')]?_0x11f609[_0x7e89('0x31')]:_0x3df9f2['model'];if(!_0x2af136[_0x7e89('0x2d')][_0x7e89('0x34')](_0x7e89('0x35'))){_0x11f609[_0x7e89('0x1d')]=qs[_0x7e89('0x1d')](_0x2af136[_0x7e89('0x2d')][_0x7e89('0x1d')]);_0x11f609[_0x7e89('0x1a')]=qs[_0x7e89('0x1a')](_0x2af136[_0x7e89('0x2d')][_0x7e89('0x1a')]);}_0x11f609[_0x7e89('0x36')]=qs[_0x7e89('0x37')](_0x2af136[_0x7e89('0x2d')][_0x7e89('0x37')]);_0x11f609['where']=qs[_0x7e89('0x2f')](_[_0x7e89('0x38')](_0x2af136[_0x7e89('0x2d')],_0x3df9f2['filters']),_0x3f32b7);if(_0x2af136[_0x7e89('0x2d')][_0x7e89('0x39')]){_0x11f609['where']=_[_0x7e89('0x3a')](_0x11f609[_0x7e89('0x3b')],{'$or':_[_0x7e89('0x3c')](_0x3f32b7,function(_0x173dbe){if(_0x173dbe[_0x7e89('0x2a')]!=='VIRTUAL'){var _0x222eff={};_0x222eff[_0x173dbe[_0x7e89('0x26')]]={'$like':'%'+_0x2af136['query'][_0x7e89('0x39')]+'%'};return _0x222eff;}})});}_0x11f609=_[_0x7e89('0x3a')]({},_0x11f609,_0x2af136[_0x7e89('0x3d')]);var _0x27bf30={'where':_0x11f609[_0x7e89('0x3b')]};return db[_0x7e89('0x3e')][_0x7e89('0x1c')](_0x27bf30)['then'](function(_0x309f88){_0x3bf58c[_0x7e89('0x1c')]=_0x309f88;if(_0x2af136['query'][_0x7e89('0x3f')]){_0x11f609['include']=[{'all':!![]}];}return db[_0x7e89('0x3e')][_0x7e89('0x40')](_0x11f609);})[_0x7e89('0x22')](function(_0x5c3f74){_0x3bf58c[_0x7e89('0x41')]=_0x5c3f74;return _0x3bf58c;})['then'](respondWithFilteredResult(_0x131fee,_0x11f609))['catch'](handleError(_0x131fee,null));};exports[_0x7e89('0x42')]=function(_0xba4d30,_0x22d164){var _0x19ba51={'raw':!![],'where':{'id':_0xba4d30[_0x7e89('0x43')]['id']}},_0x2b2552={};_0x2b2552[_0x7e89('0x2c')]=_[_0x7e89('0x2e')](db[_0x7e89('0x3e')][_0x7e89('0x29')]);_0x2b2552[_0x7e89('0x2d')]=_[_0x7e89('0x2e')](_0xba4d30[_0x7e89('0x2d')]);_0x2b2552[_0x7e89('0x2f')]=_[_0x7e89('0x30')](_0x2b2552[_0x7e89('0x2c')],_0x2b2552[_0x7e89('0x2d')]);_0x19ba51[_0x7e89('0x31')]=_[_0x7e89('0x30')](_0x2b2552[_0x7e89('0x2c')],qs[_0x7e89('0x32')](_0xba4d30[_0x7e89('0x2d')]['fields']));_0x19ba51[_0x7e89('0x31')]=_0x19ba51[_0x7e89('0x31')]['length']?_0x19ba51[_0x7e89('0x31')]:_0x2b2552[_0x7e89('0x2c')];if(_0xba4d30[_0x7e89('0x2d')][_0x7e89('0x3f')]){_0x19ba51[_0x7e89('0x44')]=[{'all':!![]}];}_0x19ba51=_[_0x7e89('0x3a')]({},_0x19ba51,_0xba4d30[_0x7e89('0x3d')]);return db[_0x7e89('0x3e')][_0x7e89('0x45')](_0x19ba51)[_0x7e89('0x22')](handleEntityNotFound(_0x22d164,null))[_0x7e89('0x22')](respondWithResult(_0x22d164,null))[_0x7e89('0x46')](handleError(_0x22d164,null));};exports['create']=function(_0x7d9b40,_0x16f7cd){return db[_0x7e89('0x3e')][_0x7e89('0x47')](_0x7d9b40[_0x7e89('0x48')],{})[_0x7e89('0x22')](respondWithResult(_0x16f7cd,0xc9))[_0x7e89('0x46')](handleError(_0x16f7cd,null));};exports[_0x7e89('0x21')]=function(_0x2bf4f6,_0x3feef3){if(_0x2bf4f6[_0x7e89('0x48')]['id']){delete _0x2bf4f6[_0x7e89('0x48')]['id'];}return db['VoiceQueuesLog'][_0x7e89('0x45')]({'where':{'id':_0x2bf4f6[_0x7e89('0x43')]['id']}})[_0x7e89('0x22')](handleEntityNotFound(_0x3feef3,null))[_0x7e89('0x22')](saveUpdates(_0x2bf4f6[_0x7e89('0x48')],null))['then'](respondWithResult(_0x3feef3,null))[_0x7e89('0x46')](handleError(_0x3feef3,null));};exports['destroy']=function(_0x3ac0ac,_0x51b9ef){return db[_0x7e89('0x3e')][_0x7e89('0x45')]({'where':{'id':_0x3ac0ac[_0x7e89('0x43')]['id']}})['then'](handleEntityNotFound(_0x51b9ef,null))[_0x7e89('0x22')](removeEntity(_0x51b9ef,null))[_0x7e89('0x46')](handleError(_0x51b9ef,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 76a0e78..7381a5a 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 _0x4e0a=['define','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./voiceQueuesLog.attributes','exports'];(function(_0x1c6293,_0x32b767){var _0x547efa=function(_0x1557ca){while(--_0x1557ca){_0x1c6293['push'](_0x1c6293['shift']());}};_0x547efa(++_0x32b767);}(_0x4e0a,0x127));var _0xa4e0=function(_0x5418ad,_0x40742f){_0x5418ad=_0x5418ad-0x0;var _0x2cae56=_0x4e0a[_0x5418ad];return _0x2cae56;};'use strict';var _=require(_0xa4e0('0x0'));var util=require(_0xa4e0('0x1'));var logger=require(_0xa4e0('0x2'))(_0xa4e0('0x3'));var moment=require(_0xa4e0('0x4'));var BPromise=require(_0xa4e0('0x5'));var rp=require(_0xa4e0('0x6'));var fs=require('fs');var path=require(_0xa4e0('0x7'));var rimraf=require('rimraf');var config=require(_0xa4e0('0x8'));var attributes=require(_0xa4e0('0x9'));module[_0xa4e0('0xa')]=function(_0xb1d155,_0x3b9e71){return _0xb1d155[_0xa4e0('0xb')](_0xa4e0('0xc'),attributes,{'tableName':_0xa4e0('0xd'),'paranoid':![],'indexes':[{'name':_0xa4e0('0xe'),'fields':[_0xa4e0('0xf'),_0xa4e0('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7ad3=['event','dtm','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceQueuesLog.attributes','define','VoiceQueuesLog','voice_queues_log','event_dtm'];(function(_0x4abe86,_0x21d158){var _0x13edeb=function(_0x5285ae){while(--_0x5285ae){_0x4abe86['push'](_0x4abe86['shift']());}};_0x13edeb(++_0x21d158);}(_0x7ad3,0xc2));var _0x37ad=function(_0xf16b1,_0x33c637){_0xf16b1=_0xf16b1-0x0;var _0x26f94d=_0x7ad3[_0xf16b1];return _0x26f94d;};'use strict';var _=require(_0x37ad('0x0'));var util=require(_0x37ad('0x1'));var logger=require(_0x37ad('0x2'))(_0x37ad('0x3'));var moment=require(_0x37ad('0x4'));var BPromise=require(_0x37ad('0x5'));var rp=require(_0x37ad('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x37ad('0x7'));var config=require(_0x37ad('0x8'));var attributes=require(_0x37ad('0x9'));module['exports']=function(_0x55be30,_0x34f0f7){return _0x55be30[_0x37ad('0xa')](_0x37ad('0xb'),attributes,{'tableName':_0x37ad('0xc'),'paranoid':![],'indexes':[{'name':_0x37ad('0xd'),'fields':[_0x37ad('0xe'),_0x37ad('0xf')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 52d2274..d515a5a 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 _0xa376=['moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','error','VoiceQueuesLog,\x20%s,\x20%s','message','result','catch'];(function(_0x4fa489,_0x4cba6b){var _0x41d2ce=function(_0x364060){while(--_0x364060){_0x4fa489['push'](_0x4fa489['shift']());}};_0x41d2ce(++_0x4cba6b);}(_0xa376,0x88));var _0x6a37=function(_0x2ed5cb,_0x1e84af){_0x2ed5cb=_0x2ed5cb-0x0;var _0x20d9df=_0xa376[_0x2ed5cb];return _0x20d9df;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6a37('0x0'));var BPromise=require('bluebird');var rs=require(_0x6a37('0x1'));var fs=require('fs');var Redis=require(_0x6a37('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6a37('0x3'))(_0x6a37('0x4'));var config=require(_0x6a37('0x5'));var jayson=require(_0x6a37('0x6'));var client=jayson[_0x6a37('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x247887,_0x155f90,_0x3d66c8){return new BPromise(function(_0x1ec441,_0xac3aa2){return client[_0x6a37('0x8')](_0x247887,_0x3d66c8)[_0x6a37('0x9')](function(_0x488b87){logger[_0x6a37('0xa')]('VoiceQueuesLog,\x20%s,\x20%s',_0x155f90,'request\x20sent');logger[_0x6a37('0xb')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x155f90,'request\x20sent',JSON['stringify'](_0x488b87));if(_0x488b87['error']){if(_0x488b87[_0x6a37('0xc')]['code']===0x1f4){logger[_0x6a37('0xc')](_0x6a37('0xd'),_0x155f90,_0x488b87[_0x6a37('0xc')][_0x6a37('0xe')]);return _0xac3aa2(_0x488b87[_0x6a37('0xc')]['message']);}logger[_0x6a37('0xc')]('VoiceQueuesLog,\x20%s,\x20%s',_0x155f90,_0x488b87[_0x6a37('0xc')]['message']);return _0x1ec441(_0x488b87[_0x6a37('0xc')]['message']);}else{logger[_0x6a37('0xa')](_0x6a37('0xd'),_0x155f90,'request\x20sent');_0x1ec441(_0x488b87[_0x6a37('0xf')][_0x6a37('0xe')]);}})[_0x6a37('0x10')](function(_0x2f8e0a){logger[_0x6a37('0xc')](_0x6a37('0xd'),_0x155f90,_0x2f8e0a);_0xac3aa2(_0x2f8e0a);});});} \ No newline at end of file +var _0xbf82=['ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','randomstring'];(function(_0x887ccf,_0x3cb4d3){var _0x5b9bd4=function(_0xff5b){while(--_0xff5b){_0x887ccf['push'](_0x887ccf['shift']());}};_0x5b9bd4(++_0x3cb4d3);}(_0xbf82,0x1cb));var _0x2bf8=function(_0x35406f,_0x5b190b){_0x35406f=_0x35406f-0x0;var _0x756488=_0xbf82[_0x35406f];return _0x756488;};'use strict';var _=require(_0x2bf8('0x0'));var util=require('util');var moment=require(_0x2bf8('0x1'));var BPromise=require('bluebird');var rs=require(_0x2bf8('0x2'));var fs=require('fs');var Redis=require(_0x2bf8('0x3'));var db=require(_0x2bf8('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2bf8('0x5'));var config=require(_0x2bf8('0x6'));var jayson=require(_0x2bf8('0x7'));var client=jayson[_0x2bf8('0x8')][_0x2bf8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5a3818,_0x586bd5,_0x1c57e9){return new BPromise(function(_0x5c1944,_0x130e6d){return client[_0x2bf8('0xa')](_0x5a3818,_0x1c57e9)[_0x2bf8('0xb')](function(_0x596d31){logger[_0x2bf8('0xc')](_0x2bf8('0xd'),_0x586bd5,_0x2bf8('0xe'));logger[_0x2bf8('0xf')](_0x2bf8('0x10'),_0x586bd5,_0x2bf8('0xe'),JSON[_0x2bf8('0x11')](_0x596d31));if(_0x596d31[_0x2bf8('0x12')]){if(_0x596d31[_0x2bf8('0x12')][_0x2bf8('0x13')]===0x1f4){logger[_0x2bf8('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x586bd5,_0x596d31[_0x2bf8('0x12')]['message']);return _0x130e6d(_0x596d31[_0x2bf8('0x12')]['message']);}logger['error'](_0x2bf8('0xd'),_0x586bd5,_0x596d31[_0x2bf8('0x12')][_0x2bf8('0x14')]);return _0x5c1944(_0x596d31[_0x2bf8('0x12')][_0x2bf8('0x14')]);}else{logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x586bd5,_0x2bf8('0xe'));_0x5c1944(_0x596d31[_0x2bf8('0x15')][_0x2bf8('0x14')]);}})['catch'](function(_0x15c040){logger[_0x2bf8('0x12')](_0x2bf8('0xd'),_0x586bd5,_0x15c040);_0x130e6d(_0x15c040);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index ca5e0aa..c194a09 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 _0xbeb8=['index','get','describe','/:id','show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','put','update','destroy','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','isAuthenticated'];(function(_0x89a001,_0x3a9a8c){var _0x5f3ec2=function(_0x3e849b){while(--_0x3e849b){_0x89a001['push'](_0x89a001['shift']());}};_0x5f3ec2(++_0x3a9a8c);}(_0xbeb8,0xc7));var _0x8beb=function(_0x24c2d7,_0x4413db){_0x24c2d7=_0x24c2d7-0x0;var _0x30cc34=_0xbeb8[_0x24c2d7];return _0x30cc34;};'use strict';var multer=require(_0x8beb('0x0'));var util=require(_0x8beb('0x1'));var path=require('path');var timeout=require(_0x8beb('0x2'));var express=require(_0x8beb('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8beb('0x4'));var interaction=require(_0x8beb('0x5'));var config=require(_0x8beb('0x6'));var controller=require(_0x8beb('0x7'));router['get']('/',auth[_0x8beb('0x8')](),controller[_0x8beb('0x9')]);router[_0x8beb('0xa')]('/describe',auth[_0x8beb('0x8')](),controller[_0x8beb('0xb')]);router[_0x8beb('0xa')](_0x8beb('0xc'),auth[_0x8beb('0x8')](),controller[_0x8beb('0xd')]);router['get'](_0x8beb('0xe'),auth[_0x8beb('0x8')](),controller[_0x8beb('0xf')]);router[_0x8beb('0xa')](_0x8beb('0x10'),controller[_0x8beb('0x11')]);router[_0x8beb('0xa')](_0x8beb('0x12'),auth[_0x8beb('0x8')](),controller[_0x8beb('0x13')]);router[_0x8beb('0x14')]('/',auth['isAuthenticated'](),controller[_0x8beb('0x15')]);router[_0x8beb('0x14')](_0x8beb('0x12'),auth[_0x8beb('0x8')](),controller[_0x8beb('0x16')]);router[_0x8beb('0x17')]('/:id',auth[_0x8beb('0x8')](),controller[_0x8beb('0x18')]);router['delete'](_0x8beb('0xc'),auth[_0x8beb('0x8')](),controller[_0x8beb('0x19')]);module['exports']=router; \ No newline at end of file +var _0x0c3d=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','runTranscribe','put','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x428eb2,_0x20f989){var _0x20fc49=function(_0x6b45ea){while(--_0x6b45ea){_0x428eb2['push'](_0x428eb2['shift']());}};_0x20fc49(++_0x20f989);}(_0x0c3d,0x169));var _0xd0c3=function(_0x321df4,_0x3efec5){_0x321df4=_0x321df4-0x0;var _0x50d06c=_0x0c3d[_0x321df4];return _0x50d06c;};'use strict';var multer=require('multer');var util=require(_0xd0c3('0x0'));var path=require(_0xd0c3('0x1'));var timeout=require(_0xd0c3('0x2'));var express=require(_0xd0c3('0x3'));var router=express[_0xd0c3('0x4')]();var fs_extra=require(_0xd0c3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd0c3('0x6'));var config=require(_0xd0c3('0x7'));var controller=require(_0xd0c3('0x8'));router[_0xd0c3('0x9')]('/',auth[_0xd0c3('0xa')](),controller[_0xd0c3('0xb')]);router[_0xd0c3('0x9')](_0xd0c3('0xc'),auth[_0xd0c3('0xa')](),controller['describe']);router[_0xd0c3('0x9')](_0xd0c3('0xd'),auth[_0xd0c3('0xa')](),controller[_0xd0c3('0xe')]);router[_0xd0c3('0x9')]('/:id/download',auth[_0xd0c3('0xa')](),controller['download']);router[_0xd0c3('0x9')](_0xd0c3('0xf'),controller[_0xd0c3('0x10')]);router[_0xd0c3('0x9')](_0xd0c3('0x11'),auth['isAuthenticated'](),controller[_0xd0c3('0x12')]);router[_0xd0c3('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd0c3('0x13')](_0xd0c3('0x11'),auth[_0xd0c3('0xa')](),controller[_0xd0c3('0x14')]);router[_0xd0c3('0x15')](_0xd0c3('0xd'),auth[_0xd0c3('0xa')](),controller[_0xd0c3('0x16')]);router[_0xd0c3('0x17')](_0xd0c3('0xd'),auth[_0xd0c3('0xa')](),controller[_0xd0c3('0x18')]);module[_0xd0c3('0x19')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index c00951f..fe286ea 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(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'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(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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 127137b..ea1073d 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 _0xb96e=['transcribeName','TranscriptionJobName','TranscriptionJobStatus','runTranscribe','findOne','Setting','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','data1','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','fileText','/server/files/transcribes/transcribe_','.txt','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','aws-sdk','uuid/v4','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','limit','undefined','count','set','reject','update','then','error','stack','name','send','index','map','VoiceRecording','rawAttributes','fieldName','type','model','differenceBy','keys','filters','intersection','attributes','fields','length','query','hasOwnProperty','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','show','includeAll','find','create','body','catch','params','describe','download','../../components/encryptor','uniqueid','value','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','unlink','message','Not\x20found','downloads','sequelize','token','$and','push','extname','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','destroy','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','bucket','location','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJob'];(function(_0x2c526d,_0x284ef7){var _0x1a6e7c=function(_0x34df61){while(--_0x34df61){_0x2c526d['push'](_0x2c526d['shift']());}};_0x1a6e7c(++_0x284ef7);}(_0xb96e,0x1e2));var _0xeb96=function(_0xd6a568,_0x4d39e9){_0xd6a568=_0xd6a568-0x0;var _0x56e5ab=_0xb96e[_0xd6a568];return _0x56e5ab;};'use strict';var emlformat=require(_0xeb96('0x0'));var rimraf=require(_0xeb96('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xeb96('0x2'));var rp=require(_0xeb96('0x3'));var moment=require('moment');var BPromise=require(_0xeb96('0x4'));var Mustache=require(_0xeb96('0x5'));var util=require('util');var path=require(_0xeb96('0x6'));var sox=require(_0xeb96('0x7'));var csv=require(_0xeb96('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xeb96('0x9'));var _=require(_0xeb96('0xa'));var squel=require(_0xeb96('0xb'));var crypto=require(_0xeb96('0xc'));var jsforce=require(_0xeb96('0xd'));var deskjs=require(_0xeb96('0xe'));var toCsv=require(_0xeb96('0x8'));var querystring=require(_0xeb96('0xf'));var Papa=require(_0xeb96('0x10'));var AWS=require(_0xeb96('0x11'));var uuidv4=require(_0xeb96('0x12'));var Redis=require('ioredis');var authService=require(_0xeb96('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xeb96('0x14'));var hardwareService=require(_0xeb96('0x15'));var logger=require(_0xeb96('0x16'))('api');var utils=require(_0xeb96('0x17'));var config=require(_0xeb96('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ae5a8,_0x5b14ab){_0x5b14ab=_0x5b14ab||0xcc;return function(_0x26b356){if(_0x26b356){return _0x4ae5a8[_0xeb96('0x19')](_0x5b14ab);}return _0x4ae5a8['status'](_0x5b14ab)[_0xeb96('0x1a')]();};}function respondWithResult(_0x536749,_0x48a91c){_0x48a91c=_0x48a91c||0xc8;return function(_0x400ef9){if(_0x400ef9){return _0x536749[_0xeb96('0x1b')](_0x48a91c)[_0xeb96('0x1c')](_0x400ef9);}};}function respondWithFilteredResult(_0x5e0c90,_0x259d33){return function(_0x2817e5){if(_0x2817e5){var _0x3896dc=typeof _0x259d33[_0xeb96('0x1d')]==='undefined'&&typeof _0x259d33[_0xeb96('0x1e')]===_0xeb96('0x1f');var _0x15630b=_0x2817e5['count'];var _0x5d3652=_0x3896dc?0x0:_0x259d33[_0xeb96('0x1d')];var _0x2b3342=_0x3896dc?_0x2817e5[_0xeb96('0x20')]:_0x259d33[_0xeb96('0x1d')]+_0x259d33[_0xeb96('0x1e')];var _0x578d15;if(_0x2b3342>=_0x15630b){_0x2b3342=_0x15630b;_0x578d15=0xc8;}else{_0x578d15=0xce;}_0x5e0c90[_0xeb96('0x1b')](_0x578d15);return _0x5e0c90[_0xeb96('0x21')]('Content-Range',_0x5d3652+'-'+_0x2b3342+'/'+_0x15630b)[_0xeb96('0x1c')](_0x2817e5);}return null;};}function patchUpdates(_0x1a8135){return function(_0x47f4c8){try{jsonpatch['apply'](_0x47f4c8,_0x1a8135,!![]);}catch(_0x19adc5){return BPromise[_0xeb96('0x22')](_0x19adc5);}return _0x47f4c8['save']();};}function saveUpdates(_0x24ca22,_0x18aa7c){return function(_0x3af4a5){if(_0x3af4a5){return _0x3af4a5[_0xeb96('0x23')](_0x24ca22)[_0xeb96('0x24')](function(_0x6e506){return _0x6e506;});}return null;};}function removeEntity(_0x5b79bc,_0xda25a){return function(_0x22f80c){if(_0x22f80c){return _0x22f80c['destroy']()[_0xeb96('0x24')](function(){_0x5b79bc[_0xeb96('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23b03d,_0x1b3a51){return function(_0x5df216){if(!_0x5df216){_0x23b03d[_0xeb96('0x19')](0x194);}return _0x5df216;};}function handleError(_0x2444f6,_0x26094c){_0x26094c=_0x26094c||0x1f4;return function(_0x506323){logger[_0xeb96('0x25')](_0x506323[_0xeb96('0x26')]);if(_0x506323[_0xeb96('0x27')]){delete _0x506323[_0xeb96('0x27')];}_0x2444f6[_0xeb96('0x1b')](_0x26094c)[_0xeb96('0x28')](_0x506323);};}exports[_0xeb96('0x29')]=function(_0x2d33f4,_0x14dad3){var _0x40475d={},_0x2b6e48={},_0x73ad15={'count':0x0,'rows':[]};var _0xb9b38=_[_0xeb96('0x2a')](db[_0xeb96('0x2b')][_0xeb96('0x2c')],function(_0x24ad75){return{'name':_0x24ad75[_0xeb96('0x2d')],'type':_0x24ad75[_0xeb96('0x2e')]['key']};});_0x2b6e48[_0xeb96('0x2f')]=_[_0xeb96('0x30')](_[_0xeb96('0x2a')](_0xb9b38,_0xeb96('0x27')),['format']);_0x2b6e48['query']=_[_0xeb96('0x31')](_0x2d33f4['query']);_0x2b6e48[_0xeb96('0x32')]=_[_0xeb96('0x33')](_0x2b6e48[_0xeb96('0x2f')],_0x2b6e48['query']);_0x40475d[_0xeb96('0x34')]=_[_0xeb96('0x33')](_0x2b6e48[_0xeb96('0x2f')],qs[_0xeb96('0x35')](_0x2d33f4['query'][_0xeb96('0x35')]));_0x40475d[_0xeb96('0x34')]=_0x40475d[_0xeb96('0x34')][_0xeb96('0x36')]?_0x40475d[_0xeb96('0x34')]:_0x2b6e48[_0xeb96('0x2f')];if(!_0x2d33f4[_0xeb96('0x37')][_0xeb96('0x38')]('nolimit')){_0x40475d[_0xeb96('0x1e')]=qs[_0xeb96('0x1e')](_0x2d33f4[_0xeb96('0x37')]['limit']);_0x40475d[_0xeb96('0x1d')]=qs['offset'](_0x2d33f4['query'][_0xeb96('0x1d')]);}_0x40475d['order']=qs['sort'](_0x2d33f4[_0xeb96('0x37')]['sort']);_0x40475d[_0xeb96('0x39')]=qs[_0xeb96('0x32')](_[_0xeb96('0x3a')](_0x2d33f4['query'],_0x2b6e48['filters']),_0xb9b38);if(_0x2d33f4['query'][_0xeb96('0x3b')]){_0x40475d[_0xeb96('0x39')]=_['merge'](_0x40475d[_0xeb96('0x39')],{'$or':_['map'](_0xb9b38,function(_0x462247){if(_0x462247[_0xeb96('0x2e')]!==_0xeb96('0x3c')){var _0x105112={};_0x105112[_0x462247['name']]={'$like':'%'+_0x2d33f4[_0xeb96('0x37')]['filter']+'%'};return _0x105112;}})});}_0x40475d=_[_0xeb96('0x3d')]({},_0x40475d,_0x2d33f4[_0xeb96('0x3e')]);var _0x36144a={'where':_0x40475d[_0xeb96('0x39')]};return db[_0xeb96('0x2b')][_0xeb96('0x20')](_0x36144a)[_0xeb96('0x24')](function(_0x3d54b9){_0x73ad15[_0xeb96('0x20')]=_0x3d54b9;if(_0x2d33f4['query']['includeAll']){_0x40475d[_0xeb96('0x3f')]=[{'all':!![]}];}return db['VoiceRecording'][_0xeb96('0x40')](_0x40475d);})[_0xeb96('0x24')](function(_0x4b61d1){_0x73ad15[_0xeb96('0x41')]=_0x4b61d1;return _0x73ad15;})[_0xeb96('0x24')](respondWithFilteredResult(_0x14dad3,_0x40475d))['catch'](handleError(_0x14dad3,null));};exports[_0xeb96('0x42')]=function(_0x492c20,_0x403fad){var _0x4f3518={'raw':![],'where':{'id':_0x492c20['params']['id']}},_0x23a5cf={};_0x23a5cf[_0xeb96('0x2f')]=_['keys'](db[_0xeb96('0x2b')][_0xeb96('0x2c')]);_0x23a5cf['query']=_['keys'](_0x492c20[_0xeb96('0x37')]);_0x23a5cf['filters']=_[_0xeb96('0x33')](_0x23a5cf[_0xeb96('0x2f')],_0x23a5cf['query']);_0x4f3518[_0xeb96('0x34')]=_[_0xeb96('0x33')](_0x23a5cf[_0xeb96('0x2f')],qs[_0xeb96('0x35')](_0x492c20[_0xeb96('0x37')][_0xeb96('0x35')]));_0x4f3518['attributes']=_0x4f3518[_0xeb96('0x34')][_0xeb96('0x36')]?_0x4f3518[_0xeb96('0x34')]:_0x23a5cf[_0xeb96('0x2f')];if(_0x492c20[_0xeb96('0x37')][_0xeb96('0x43')]){_0x4f3518[_0xeb96('0x3f')]=[{'all':!![]}];}_0x4f3518=_[_0xeb96('0x3d')]({},_0x4f3518,_0x492c20['options']);return db[_0xeb96('0x2b')][_0xeb96('0x44')](_0x4f3518)[_0xeb96('0x24')](handleEntityNotFound(_0x403fad,null))[_0xeb96('0x24')](respondWithResult(_0x403fad,null))['catch'](handleError(_0x403fad,null));};exports[_0xeb96('0x45')]=function(_0xfd466c,_0x1723ff){return db[_0xeb96('0x2b')][_0xeb96('0x45')](_0xfd466c[_0xeb96('0x46')],{})[_0xeb96('0x24')](respondWithResult(_0x1723ff,0xc9))[_0xeb96('0x47')](handleError(_0x1723ff,null));};exports[_0xeb96('0x23')]=function(_0x23b3e2,_0x47791b){if(_0x23b3e2[_0xeb96('0x46')]['id']){delete _0x23b3e2['body']['id'];}return db[_0xeb96('0x2b')][_0xeb96('0x44')]({'where':{'id':_0x23b3e2[_0xeb96('0x48')]['id']}})[_0xeb96('0x24')](handleEntityNotFound(_0x47791b,null))[_0xeb96('0x24')](saveUpdates(_0x23b3e2[_0xeb96('0x46')],null))[_0xeb96('0x24')](respondWithResult(_0x47791b,null))[_0xeb96('0x47')](handleError(_0x47791b,null));};exports[_0xeb96('0x49')]=function(_0x4e7816,_0x39c081){return db['VoiceRecording'][_0xeb96('0x49')]()['then'](respondWithResult(_0x39c081,null))[_0xeb96('0x47')](handleError(_0x39c081,null));};exports[_0xeb96('0x4a')]=function(_0x33246d,_0xc78835,_0x40d0d3){var _0x218e1c=require(_0xeb96('0x4b'));var _0x40486c=![];var _0x3cdd1c={};if(_0x33246d[_0xeb96('0x37')]['type']&&_0x33246d[_0xeb96('0x37')][_0xeb96('0x2e')]===_0xeb96('0x4c')){_0x3cdd1c[_0xeb96('0x4c')]=_0x33246d[_0xeb96('0x48')]['id'];}else{_0x3cdd1c['id']=_0x33246d[_0xeb96('0x48')]['id'];}return db[_0xeb96('0x2b')][_0xeb96('0x44')]({'where':_0x3cdd1c,'attributes':['id',_0xeb96('0x4d')],'raw':!![]})[_0xeb96('0x24')](handleEntityNotFound(_0xc78835,null))['then'](function(_0x502763){if(_0x502763){var _0xb958f5=_0x502763[_0xeb96('0x4d')];var _0x540394=util[_0xeb96('0x4e')](_0xeb96('0x4f'),_0xb958f5);if(fs[_0xeb96('0x50')](_0x540394)){_0x40486c=!![];return _0x218e1c[_0xeb96('0x51')](_0x540394,_0xb958f5,config[_0xeb96('0x52')][_0xeb96('0x53')])['then'](function(){return _0x502763;});}return _0x502763;}})[_0xeb96('0x24')](function(_0x24fd6f){if(_0x24fd6f){var _0x581791=_0x24fd6f[_0xeb96('0x4d')];if(!fs[_0xeb96('0x50')](_0x581791)){throw new db[(_0xeb96('0x54'))][(_0xeb96('0x55'))](_0xeb96('0x56'));}if(_0x24fd6f[_0xeb96('0x57')]){return _0xc78835[_0xeb96('0x4a')](_0x581791,_0x24fd6f['filename']+path['extname'](_0x581791),function(){if(_0x40486c){fs[_0xeb96('0x58')](_0x581791);}});}else{return _0xc78835['download'](_0x581791,function(_0x70fef9){if(_0x40486c){fs[_0xeb96('0x58')](_0x581791);}});}}})[_0xeb96('0x47')](function(_0x12e5e4){if(_0x12e5e4[_0xeb96('0x59')]==='VoiceRecording\x20not\x20found'){_0xc78835['status'](0x194)[_0xeb96('0x28')](_0xeb96('0x5a'));}else{return handleError(_0xc78835,null);}});};exports[_0xeb96('0x5b')]=function(_0x267e05,_0x5cec6a,_0x8dc4a6){var _0x265551=require(_0xeb96('0x4b'));var _0x85fcac=![];var _0x581cf1={'$and':[db[_0xeb96('0x5c')]['where'](db[_0xeb96('0x5c')]['fn']('MD5',db[_0xeb96('0x5c')]['col'](_0xeb96('0x4c'))),_0x267e05[_0xeb96('0x37')][_0xeb96('0x5d')])]};if(_0x267e05['query'][_0xeb96('0x2e')]&&_0x267e05[_0xeb96('0x37')][_0xeb96('0x2e')]==='uniqueid'){_0x581cf1[_0xeb96('0x5e')][_0xeb96('0x5f')]({'uniqueid':_0x267e05[_0xeb96('0x48')]['id']});}else{_0x581cf1['$and'][_0xeb96('0x5f')]({'id':_0x267e05[_0xeb96('0x48')]['id']});}return db[_0xeb96('0x2b')][_0xeb96('0x44')]({'where':_0x581cf1,'attributes':['id',_0xeb96('0x4d')],'raw':!![]})['then'](handleEntityNotFound(_0x5cec6a,null))['then'](function(_0x3fec5c){if(_0x3fec5c){var _0x3190e4=util[_0xeb96('0x4e')](_0xeb96('0x4f'),_0x3fec5c[_0xeb96('0x4d')]);if(fs[_0xeb96('0x50')](_0x3190e4)){_0x85fcac=!![];return _0x265551[_0xeb96('0x51')](_0x3190e4,_0x3fec5c[_0xeb96('0x4d')],config[_0xeb96('0x52')][_0xeb96('0x53')])[_0xeb96('0x24')](function(){return _0x3fec5c;});}return _0x3fec5c;}})[_0xeb96('0x24')](function(_0x25841d){if(_0x25841d){if(!fs[_0xeb96('0x50')](_0x25841d[_0xeb96('0x4d')])){throw new db[(_0xeb96('0x54'))]['ValidationError'](_0xeb96('0x56'));}if(_0x25841d[_0xeb96('0x57')]){return _0x5cec6a[_0xeb96('0x4a')](_0x25841d[_0xeb96('0x4d')],_0x25841d[_0xeb96('0x57')]+path[_0xeb96('0x60')](_0x25841d[_0xeb96('0x4d')]),function(){if(_0x85fcac){fs[_0xeb96('0x58')](_0x25841d['value']);}});}else{return _0x5cec6a['download'](_0x25841d[_0xeb96('0x4d')],function(_0x4d4f5e){if(_0x85fcac){fs[_0xeb96('0x58')](_0x25841d[_0xeb96('0x4d')]);}});}}})[_0xeb96('0x47')](handleError(_0x5cec6a,null));};exports['destroy']=function(_0x582728,_0x5840d2){return db[_0xeb96('0x2b')][_0xeb96('0x44')]({'where':{'id':_0x582728[_0xeb96('0x48')]['id']}})['then'](function(_0x5230ec){if(_[_0xeb96('0x61')](_0x5230ec)){throw new ReferenceError('Entity\x20not\x20found');}return _0x5230ec;})[_0xeb96('0x24')](function(_0x2d5ec8){var _0x5acd46=_0x2d5ec8[_0xeb96('0x4d')];logger[_0xeb96('0x62')](_0xeb96('0x63'),_0x5acd46);if(!_['isNil'](_0x2d5ec8[_0xeb96('0x4d')])&&fs[_0xeb96('0x50')](_0x5acd46)){logger['info'](_0xeb96('0x64')+_0x5acd46+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xeb96('0x65')](_0x5acd46);}_0x5acd46=_0x5acd46+_0xeb96('0x66');if(!_[_0xeb96('0x61')](_0x2d5ec8[_0xeb96('0x4d')])&&fs[_0xeb96('0x50')](_0x5acd46)){logger[_0xeb96('0x62')](_0xeb96('0x64')+_0x5acd46+_0xeb96('0x67'));fs[_0xeb96('0x65')](_0x5acd46);}return _0x2d5ec8;})[_0xeb96('0x24')](function(_0x169f64){if(!_0x169f64)throw new InternalError();return _0x169f64[_0xeb96('0x68')]();})[_0xeb96('0x24')](function(){_0x5840d2[_0xeb96('0x1b')](0xcc)[_0xeb96('0x1a')]();})[_0xeb96('0x47')](handleError(_0x5840d2,null));};function getBucketslist(_0x17871c,_0x39bf6a,_0x4f5938){return new Promise(function(_0x2e9ec9,_0x1a5770){var _0xb19ce4=new AWS['S3']({'accessKeyId':_0x39bf6a,'secretAccessKey':_0x17871c,'region':_0x4f5938});_0xb19ce4[_0xeb96('0x69')]({},function(_0xbecacc,_0x22d6ef){if(_0xbecacc){return _0x1a5770(_0xbecacc);}else{return _0x2e9ec9(_0x22d6ef);}});});}function createBucket(_0x367ebb,_0x3eb821,_0x25884c,_0x108823){return new Promise(function(_0xea1292,_0x22ac31){var _0x42461b=new AWS['S3']({'accessKeyId':_0x3eb821,'secretAccessKey':_0x367ebb,'region':_0x25884c});_0x42461b[_0xeb96('0x6a')]({'Bucket':_0x108823},function(_0x5cb827,_0x4eb556){if(_0x5cb827){return _0x22ac31(_0x5cb827);}else{return _0xea1292(_0x4eb556);}});});}function uploadFile(_0x2f6a26,_0x47dad4,_0x361f92,_0x576f42,_0xd9c73c,_0x5363d4){return new Promise(function(_0x4f3db3,_0x106749){var _0x2b6f5b=new AWS['S3']({'accessKeyId':_0x47dad4,'secretAccessKey':_0x2f6a26,'region':_0x361f92});_0x2b6f5b[_0xeb96('0x6b')]({'Bucket':_0x576f42,'Key':_0xd9c73c,'Body':_0x5363d4},function(_0x5bff40,_0x5ab3ea){if(_0x5bff40){return _0x106749(_0x5bff40);}else{return _0x4f3db3(_0x5ab3ea);}});});}function startTranscribe(_0x309be0,_0x3fac54,_0xcb84e3,_0x502613,_0x3cd70f,_0x1f0ab9){return new Promise(function(_0x4888b4,_0x1fff42){var _0x1a322f=new AWS[(_0xeb96('0x6c'))]({'accessKeyId':_0x3fac54,'secretAccessKey':_0x309be0,'region':_0xcb84e3});_0x1a322f[_0xeb96('0x6d')]({'TranscriptionJobName':_0x502613,'LanguageCode':_0x3cd70f,'Media':{'MediaFileUri':_0x1f0ab9}},function(_0xf09ee5,_0x14ee39){if(_0xf09ee5){return _0x1fff42(_0xf09ee5);}else{return _0x4888b4(_0x14ee39);}});});}function transcribe(_0x507f13,_0x484760,_0x358754,_0x3dbaf3,_0xd1d0e3,_0xdb4d87,_0x7eda7b){return new Promise(function(_0x511e26,_0x297962){var _0x1d8f49={};logger[_0xeb96('0x62')](util['format']('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x507f13,_0xd1d0e3));return uploadFile(_0x484760,_0x358754,_0x3dbaf3,_0xd1d0e3,path[_0xeb96('0x6e')](_0xdb4d87),fs[_0xeb96('0x6f')](_0xdb4d87))[_0xeb96('0x24')](function(_0x288dd4){logger[_0xeb96('0x62')](util[_0xeb96('0x4e')](_0xeb96('0x70'),_0x507f13,_0xd1d0e3,_0x288dd4['Location']));_0x1d8f49[_0xeb96('0x71')]=_0x288dd4['Bucket'];_0x1d8f49[_0xeb96('0x72')]=_0x288dd4[_0xeb96('0x73')];logger[_0xeb96('0x62')](util[_0xeb96('0x4e')](_0xeb96('0x74'),_0x507f13));return startTranscribe(_0x484760,_0x358754,_0x3dbaf3,uuidv4(),_0x7eda7b,_0x288dd4[_0xeb96('0x73')]);})[_0xeb96('0x24')](function(_0x1b8b51){logger[_0xeb96('0x62')](util['format']('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x507f13,_0x1b8b51[_0xeb96('0x75')]['TranscriptionJobName']));_0x1d8f49[_0xeb96('0x76')]=_0x1b8b51[_0xeb96('0x75')][_0xeb96('0x77')];_0x1d8f49['transcribeStatus']=_0x1b8b51['TranscriptionJob'][_0xeb96('0x78')];return _0x511e26(_0x1d8f49);})[_0xeb96('0x47')](function(_0x468418){return _0x297962(_0x468418);});});}exports[_0xeb96('0x79')]=function(_0x4ede4c,_0x43c136,_0x4aec51){var _0x46e4d1;var _0x19d3be;var _0x3b43a6;var _0x52458f=require(_0xeb96('0x4b'));return db[_0xeb96('0x2b')][_0xeb96('0x7a')]({'where':{'id':_0x4ede4c['params']['id']}})[_0xeb96('0x24')](function(_0x1edcdb){if(_0x1edcdb){var _0x56bdfc=util['format'](_0xeb96('0x4f'),_0x1edcdb[_0xeb96('0x4d')]);if(fs[_0xeb96('0x50')](_0x56bdfc)){cypher=!![];return _0x52458f['decryptFile'](_0x56bdfc,_0x1edcdb['value'],config[_0xeb96('0x52')][_0xeb96('0x53')])['then'](function(){return _0x1edcdb;});}return _0x1edcdb;}})[_0xeb96('0x24')](function(_0x16328c){if(!_0x16328c){throw new db['Sequelize'][(_0xeb96('0x55'))]('Voice\x20Recording\x20not\x20found');}_0x19d3be=_0x16328c;return db[_0xeb96('0x7b')][_0xeb96('0x7a')]({'where':{'id':0x1}});})[_0xeb96('0x24')](handleEntityNotFound(_0x43c136,null))['then'](function(_0x3eeff7){if(_0x3eeff7){_0x46e4d1=_0x3eeff7;if(!_0x46e4d1[_0xeb96('0x7c')]||!_0x46e4d1[_0xeb96('0x7d')]||!_0x46e4d1[_0xeb96('0x7e')]||!_0x46e4d1[_0xeb96('0x7f')]||!_0x46e4d1[_0xeb96('0x71')]){throw new db[(_0xeb96('0x54'))][(_0xeb96('0x55'))](_0xeb96('0x80'));}if(_0x4ede4c[_0xeb96('0x46')][_0xeb96('0x81')]&&(!_0x46e4d1[_0xeb96('0x82')]||!_0x46e4d1[_0xeb96('0x83')]||!_0x46e4d1['sentimentRegion']||!_0x46e4d1[_0xeb96('0x7f')]||!_0x46e4d1[_0xeb96('0x71')])){throw new db[(_0xeb96('0x54'))][(_0xeb96('0x55'))](_0xeb96('0x84'));}return db[_0xeb96('0x85')][_0xeb96('0x7a')]({'where':{'id':_0x46e4d1[_0xeb96('0x7d')]}});}})['then'](function(_0x284926){if(!_0x284926){throw new db[(_0xeb96('0x54'))][(_0xeb96('0x55'))](_0xeb96('0x86'));}if(!_0x284926['data1']||!_0x284926[_0xeb96('0x87')]){throw new db['Sequelize']['ValidationError'](_0xeb96('0x88'));}_0x3b43a6=_0x284926;return getBucketslist(_0x3b43a6[_0xeb96('0x89')],_0x3b43a6[_0xeb96('0x87')],_0x46e4d1[_0xeb96('0x7e')]);})[_0xeb96('0x24')](function(_0x163e5d){if(_0x163e5d&&_0x163e5d[_0xeb96('0x8a')]){var _0x14218a=_[_0xeb96('0x44')](_0x163e5d[_0xeb96('0x8a')],function(_0x136357){return _0x136357[_0xeb96('0x8b')]===_0x46e4d1[_0xeb96('0x71')];});if(!_0x14218a){logger[_0xeb96('0x62')](util[_0xeb96('0x4e')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x4ede4c[_0xeb96('0x48')]['id'],_0x46e4d1['bucket']));return createBucket(_0x3b43a6[_0xeb96('0x89')],_0x3b43a6[_0xeb96('0x87')],_0x46e4d1[_0xeb96('0x7e')],_0x46e4d1[_0xeb96('0x71')]);}logger[_0xeb96('0x62')](util[_0xeb96('0x4e')](_0xeb96('0x8c'),_0x4ede4c[_0xeb96('0x48')]['id'],_0x46e4d1['bucket']));return;}})[_0xeb96('0x24')](function(_0x193456){if(_0x19d3be['transcribeStatus']===_0xeb96('0x8d')){return transcribe(_0x4ede4c[_0xeb96('0x48')]['id'],_0x3b43a6['data1'],_0x3b43a6[_0xeb96('0x87')],_0x46e4d1[_0xeb96('0x7e')],_0x46e4d1[_0xeb96('0x71')],_0x19d3be[_0xeb96('0x4d')],_0x46e4d1[_0xeb96('0x7f')]);}else{logger[_0xeb96('0x62')](util['format'](_0xeb96('0x8e'),_0x4ede4c['params']['id']));return{'transcribeStatus':_0xeb96('0x8f')};}})[_0xeb96('0x24')](function(_0x22ccaf){if(_0x22ccaf){_0x22ccaf[_0xeb96('0x90')]=_0x4ede4c['body'][_0xeb96('0x81')];return _0x19d3be[_0xeb96('0x91')](_0x22ccaf);}})[_0xeb96('0x24')](respondWithResult(_0x43c136,null))[_0xeb96('0x47')](handleError(_0x43c136,null));};function writeFile(_0x255d4f,_0x467774){return new Promise(function(_0x5aa3c7,_0x415b13){fs[_0xeb96('0x92')](_0x467774,_0x255d4f,function(_0x79809a,_0x4c58b2){if(_0x79809a){return _0x415b13(_0x79809a);}else{return _0x5aa3c7(_0x4c58b2);}});});}exports['downloadTranscribe']=function(_0xc5abbc,_0x2831b2,_0x511cad){return db[_0xeb96('0x2b')][_0xeb96('0x7a')]({'where':{'id':_0xc5abbc['params']['id']}})['then'](handleEntityNotFound(_0x2831b2))[_0xeb96('0x24')](function(_0x1f7b8e){if(_0x1f7b8e&&_0x1f7b8e[_0xeb96('0x93')]){var _0x259058=_0x1f7b8e['fileText'];var _0x1c3bf0=config['root']+_0xeb96('0x94')+_0x1f7b8e['id']+_0xeb96('0x95');if(fs['existsSync'](_0x1c3bf0)){return _0x1c3bf0;}return writeFile(_0x259058,_0x1c3bf0)['then'](function(){return _0x1c3bf0;});}else{throw new db[(_0xeb96('0x54'))][(_0xeb96('0x55'))]('Transcript\x20not\x20available');}})[_0xeb96('0x24')](function(_0x9720d8){return _0x2831b2[_0xeb96('0x4a')](_0x9720d8);})[_0xeb96('0x47')](handleError(_0x2831b2));}; \ No newline at end of file +var _0x75f3=['runSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','rimraf','zip-dir','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','name','send','map','type','key','model','differenceBy','format','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','VoiceRecording','include','rows','catch','show','params','rawAttributes','includeAll','merge','options','create','body','describe','uniqueid','find','value','%s.cypher','recording','existsSync','Sequelize','VoiceRecording\x20not\x20found','filename','download','extname','unlink','message','../../components/encryptor','sequelize','MD5','col','$and','push','decryptFile','secrets','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','upload','TranscribeService','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','Location','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJobName','transcribeName','TranscriptionJob','transcribeStatus','TranscriptionJobStatus','runTranscribe','Voice\x20Recording\x20not\x20found','Setting','findOne','transcribeAccountId','transcribeRegion','language','ValidationError','Transcribe\x20not\x20configured','sentiment','sentimentRegion','bucket','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','IN_PROGRESS','tempSentiment'];(function(_0xead5f0,_0x30581c){var _0x73c2a6=function(_0x27f32d){while(--_0x27f32d){_0xead5f0['push'](_0xead5f0['shift']());}};_0x73c2a6(++_0x30581c);}(_0x75f3,0x139));var _0x375f=function(_0x5a55bc,_0x395e40){_0x5a55bc=_0x5a55bc-0x0;var _0x100906=_0x75f3[_0x5a55bc];return _0x100906;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x375f('0x0'));var zipdir=require(_0x375f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x375f('0x2'));var BPromise=require(_0x375f('0x3'));var Mustache=require('mustache');var util=require(_0x375f('0x4'));var path=require(_0x375f('0x5'));var sox=require(_0x375f('0x6'));var csv=require('to-csv');var ejs=require(_0x375f('0x7'));var fs=require('fs');var fs_extra=require(_0x375f('0x8'));var _=require(_0x375f('0x9'));var squel=require(_0x375f('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x375f('0xb'));var toCsv=require(_0x375f('0xc'));var querystring=require(_0x375f('0xd'));var Papa=require(_0x375f('0xe'));var AWS=require('aws-sdk');var uuidv4=require('uuid/v4');var Redis=require(_0x375f('0xf'));var authService=require(_0x375f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x375f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x375f('0x12'))(_0x375f('0x13'));var utils=require('../../config/utils');var config=require(_0x375f('0x14'));var licenseUtil=require(_0x375f('0x15'));var db=require(_0x375f('0x16'))['db'];function respondWithStatusCode(_0x1bca50,_0x5a3eb1){_0x5a3eb1=_0x5a3eb1||0xcc;return function(_0x3c2ca3){if(_0x3c2ca3){return _0x1bca50[_0x375f('0x17')](_0x5a3eb1);}return _0x1bca50[_0x375f('0x18')](_0x5a3eb1)[_0x375f('0x19')]();};}function respondWithResult(_0x2c6445,_0x4479){_0x4479=_0x4479||0xc8;return function(_0x44cd4b){if(_0x44cd4b){return _0x2c6445['status'](_0x4479)[_0x375f('0x1a')](_0x44cd4b);}};}function respondWithFilteredResult(_0x362bf0,_0xac5520){return function(_0x3f0c8e){if(_0x3f0c8e){var _0x4dc375=typeof _0xac5520[_0x375f('0x1b')]===_0x375f('0x1c')&&typeof _0xac5520[_0x375f('0x1d')]===_0x375f('0x1c');var _0x3f542d=_0x3f0c8e[_0x375f('0x1e')];var _0x21440e=_0x4dc375?0x0:_0xac5520['offset'];var _0x4a9460=_0x4dc375?_0x3f0c8e[_0x375f('0x1e')]:_0xac5520['offset']+_0xac5520[_0x375f('0x1d')];var _0x43b680;if(_0x4a9460>=_0x3f542d){_0x4a9460=_0x3f542d;_0x43b680=0xc8;}else{_0x43b680=0xce;}_0x362bf0[_0x375f('0x18')](_0x43b680);return _0x362bf0[_0x375f('0x1f')]('Content-Range',_0x21440e+'-'+_0x4a9460+'/'+_0x3f542d)[_0x375f('0x1a')](_0x3f0c8e);}return null;};}function patchUpdates(_0x2cb196){return function(_0x473fa5){try{jsonpatch[_0x375f('0x20')](_0x473fa5,_0x2cb196,!![]);}catch(_0x5a047c){return BPromise[_0x375f('0x21')](_0x5a047c);}return _0x473fa5[_0x375f('0x22')]();};}function saveUpdates(_0x5d41d2,_0x14d72f){return function(_0x40e1d0){if(_0x40e1d0){return _0x40e1d0[_0x375f('0x23')](_0x5d41d2)[_0x375f('0x24')](function(_0x285697){return _0x285697;});}return null;};}function removeEntity(_0x1b3d9e,_0x46a38e){return function(_0x2e742e){if(_0x2e742e){return _0x2e742e[_0x375f('0x25')]()[_0x375f('0x24')](function(){_0x1b3d9e[_0x375f('0x18')](0xcc)[_0x375f('0x19')]();});}};}function handleEntityNotFound(_0x52edcc,_0x136ec7){return function(_0x4d7811){if(!_0x4d7811){_0x52edcc[_0x375f('0x17')](0x194);}return _0x4d7811;};}function handleError(_0x5b56ad,_0x173d30){_0x173d30=_0x173d30||0x1f4;return function(_0x42a50c){logger[_0x375f('0x26')](_0x42a50c['stack']);if(_0x42a50c[_0x375f('0x27')]){delete _0x42a50c[_0x375f('0x27')];}_0x5b56ad[_0x375f('0x18')](_0x173d30)[_0x375f('0x28')](_0x42a50c);};}exports['index']=function(_0x50a850,_0x195fe8){var _0x2f650e={},_0x2c7526={},_0x29bac9={'count':0x0,'rows':[]};var _0xbf39ac=_[_0x375f('0x29')](db['VoiceRecording']['rawAttributes'],function(_0xbf2762){return{'name':_0xbf2762['fieldName'],'type':_0xbf2762[_0x375f('0x2a')][_0x375f('0x2b')]};});_0x2c7526[_0x375f('0x2c')]=_[_0x375f('0x2d')](_['map'](_0xbf39ac,_0x375f('0x27')),[_0x375f('0x2e')]);_0x2c7526['query']=_[_0x375f('0x2f')](_0x50a850['query']);_0x2c7526[_0x375f('0x30')]=_['intersection'](_0x2c7526['model'],_0x2c7526[_0x375f('0x31')]);_0x2f650e[_0x375f('0x32')]=_[_0x375f('0x33')](_0x2c7526[_0x375f('0x2c')],qs[_0x375f('0x34')](_0x50a850[_0x375f('0x31')][_0x375f('0x34')]));_0x2f650e['attributes']=_0x2f650e[_0x375f('0x32')][_0x375f('0x35')]?_0x2f650e[_0x375f('0x32')]:_0x2c7526['model'];if(!_0x50a850[_0x375f('0x31')][_0x375f('0x36')](_0x375f('0x37'))){_0x2f650e[_0x375f('0x1d')]=qs[_0x375f('0x1d')](_0x50a850[_0x375f('0x31')][_0x375f('0x1d')]);_0x2f650e['offset']=qs[_0x375f('0x1b')](_0x50a850[_0x375f('0x31')][_0x375f('0x1b')]);}_0x2f650e[_0x375f('0x38')]=qs[_0x375f('0x39')](_0x50a850['query'][_0x375f('0x39')]);_0x2f650e[_0x375f('0x3a')]=qs[_0x375f('0x30')](_[_0x375f('0x3b')](_0x50a850[_0x375f('0x31')],_0x2c7526[_0x375f('0x30')]),_0xbf39ac);if(_0x50a850['query'][_0x375f('0x3c')]){_0x2f650e['where']=_['merge'](_0x2f650e[_0x375f('0x3a')],{'$or':_[_0x375f('0x29')](_0xbf39ac,function(_0x1a6369){if(_0x1a6369[_0x375f('0x2a')]!==_0x375f('0x3d')){var _0x2314e2={};_0x2314e2[_0x1a6369[_0x375f('0x27')]]={'$like':'%'+_0x50a850[_0x375f('0x31')][_0x375f('0x3c')]+'%'};return _0x2314e2;}})});}_0x2f650e=_['merge']({},_0x2f650e,_0x50a850['options']);var _0x1804d5={'where':_0x2f650e[_0x375f('0x3a')]};return db[_0x375f('0x3e')][_0x375f('0x1e')](_0x1804d5)[_0x375f('0x24')](function(_0x1d6944){_0x29bac9[_0x375f('0x1e')]=_0x1d6944;if(_0x50a850[_0x375f('0x31')]['includeAll']){_0x2f650e[_0x375f('0x3f')]=[{'all':!![]}];}return db[_0x375f('0x3e')]['findAll'](_0x2f650e);})['then'](function(_0x1ad061){_0x29bac9[_0x375f('0x40')]=_0x1ad061;return _0x29bac9;})['then'](respondWithFilteredResult(_0x195fe8,_0x2f650e))[_0x375f('0x41')](handleError(_0x195fe8,null));};exports[_0x375f('0x42')]=function(_0xcefe4a,_0x4b0771){var _0x3261f7={'raw':![],'where':{'id':_0xcefe4a[_0x375f('0x43')]['id']}},_0x3d0873={};_0x3d0873[_0x375f('0x2c')]=_[_0x375f('0x2f')](db[_0x375f('0x3e')][_0x375f('0x44')]);_0x3d0873[_0x375f('0x31')]=_[_0x375f('0x2f')](_0xcefe4a['query']);_0x3d0873[_0x375f('0x30')]=_[_0x375f('0x33')](_0x3d0873[_0x375f('0x2c')],_0x3d0873[_0x375f('0x31')]);_0x3261f7[_0x375f('0x32')]=_['intersection'](_0x3d0873['model'],qs[_0x375f('0x34')](_0xcefe4a[_0x375f('0x31')]['fields']));_0x3261f7[_0x375f('0x32')]=_0x3261f7['attributes'][_0x375f('0x35')]?_0x3261f7[_0x375f('0x32')]:_0x3d0873[_0x375f('0x2c')];if(_0xcefe4a[_0x375f('0x31')][_0x375f('0x45')]){_0x3261f7[_0x375f('0x3f')]=[{'all':!![]}];}_0x3261f7=_[_0x375f('0x46')]({},_0x3261f7,_0xcefe4a[_0x375f('0x47')]);return db['VoiceRecording']['find'](_0x3261f7)['then'](handleEntityNotFound(_0x4b0771,null))['then'](respondWithResult(_0x4b0771,null))['catch'](handleError(_0x4b0771,null));};exports[_0x375f('0x48')]=function(_0x42f153,_0x20dade){return db[_0x375f('0x3e')][_0x375f('0x48')](_0x42f153['body'],{})[_0x375f('0x24')](respondWithResult(_0x20dade,0xc9))[_0x375f('0x41')](handleError(_0x20dade,null));};exports['update']=function(_0x5e9d04,_0x45a4c4){if(_0x5e9d04[_0x375f('0x49')]['id']){delete _0x5e9d04['body']['id'];}return db[_0x375f('0x3e')]['find']({'where':{'id':_0x5e9d04[_0x375f('0x43')]['id']}})['then'](handleEntityNotFound(_0x45a4c4,null))[_0x375f('0x24')](saveUpdates(_0x5e9d04[_0x375f('0x49')],null))[_0x375f('0x24')](respondWithResult(_0x45a4c4,null))[_0x375f('0x41')](handleError(_0x45a4c4,null));};exports[_0x375f('0x4a')]=function(_0x1c9dfd,_0x43ef3a){return db[_0x375f('0x3e')]['describe']()['then'](respondWithResult(_0x43ef3a,null))['catch'](handleError(_0x43ef3a,null));};exports['download']=function(_0x1bbf45,_0x57db1c,_0x4f4046){var _0x551134=require('../../components/encryptor');var _0x3576e4=![];var _0x41eff5={};if(_0x1bbf45[_0x375f('0x31')]['type']&&_0x1bbf45[_0x375f('0x31')][_0x375f('0x2a')]==='uniqueid'){_0x41eff5[_0x375f('0x4b')]=_0x1bbf45[_0x375f('0x43')]['id'];}else{_0x41eff5['id']=_0x1bbf45[_0x375f('0x43')]['id'];}return db[_0x375f('0x3e')][_0x375f('0x4c')]({'where':_0x41eff5,'attributes':['id','value'],'raw':!![]})[_0x375f('0x24')](handleEntityNotFound(_0x57db1c,null))[_0x375f('0x24')](function(_0x305700){if(_0x305700){var _0x169104=_0x305700[_0x375f('0x4d')];var _0x5bc015=util[_0x375f('0x2e')](_0x375f('0x4e'),_0x169104);if(fs['existsSync'](_0x5bc015)){_0x3576e4=!![];return _0x551134['decryptFile'](_0x5bc015,_0x169104,config['secrets'][_0x375f('0x4f')])['then'](function(){return _0x305700;});}return _0x305700;}})['then'](function(_0x49f3ad){if(_0x49f3ad){var _0x1660b5=_0x49f3ad[_0x375f('0x4d')];if(!fs[_0x375f('0x50')](_0x1660b5)){throw new db[(_0x375f('0x51'))]['ValidationError'](_0x375f('0x52'));}if(_0x49f3ad[_0x375f('0x53')]){return _0x57db1c[_0x375f('0x54')](_0x1660b5,_0x49f3ad['filename']+path[_0x375f('0x55')](_0x1660b5),function(){if(_0x3576e4){fs[_0x375f('0x56')](_0x1660b5);}});}else{return _0x57db1c[_0x375f('0x54')](_0x1660b5,function(_0x239992){if(_0x3576e4){fs[_0x375f('0x56')](_0x1660b5);}});}}})[_0x375f('0x41')](function(_0x573d02){if(_0x573d02[_0x375f('0x57')]===_0x375f('0x52')){_0x57db1c[_0x375f('0x18')](0x194)[_0x375f('0x28')]('Not\x20found');}else{return handleError(_0x57db1c,null);}});};exports['downloads']=function(_0xb221d2,_0x31e43c,_0x5ea021){var _0x53dc91=require(_0x375f('0x58'));var _0x478077=![];var _0x76c2c8={'$and':[db['sequelize'][_0x375f('0x3a')](db[_0x375f('0x59')]['fn'](_0x375f('0x5a'),db['sequelize'][_0x375f('0x5b')]('uniqueid')),_0xb221d2[_0x375f('0x31')]['token'])]};if(_0xb221d2[_0x375f('0x31')][_0x375f('0x2a')]&&_0xb221d2['query'][_0x375f('0x2a')]===_0x375f('0x4b')){_0x76c2c8[_0x375f('0x5c')][_0x375f('0x5d')]({'uniqueid':_0xb221d2[_0x375f('0x43')]['id']});}else{_0x76c2c8[_0x375f('0x5c')][_0x375f('0x5d')]({'id':_0xb221d2[_0x375f('0x43')]['id']});}return db[_0x375f('0x3e')][_0x375f('0x4c')]({'where':_0x76c2c8,'attributes':['id',_0x375f('0x4d')],'raw':!![]})[_0x375f('0x24')](handleEntityNotFound(_0x31e43c,null))[_0x375f('0x24')](function(_0x12c5e6){if(_0x12c5e6){var _0x13c014=util[_0x375f('0x2e')]('%s.cypher',_0x12c5e6['value']);if(fs['existsSync'](_0x13c014)){_0x478077=!![];return _0x53dc91[_0x375f('0x5e')](_0x13c014,_0x12c5e6[_0x375f('0x4d')],config[_0x375f('0x5f')][_0x375f('0x4f')])[_0x375f('0x24')](function(){return _0x12c5e6;});}return _0x12c5e6;}})['then'](function(_0xd5154){if(_0xd5154){if(!fs[_0x375f('0x50')](_0xd5154[_0x375f('0x4d')])){throw new db[(_0x375f('0x51'))]['ValidationError'](_0x375f('0x52'));}if(_0xd5154[_0x375f('0x53')]){return _0x31e43c[_0x375f('0x54')](_0xd5154['value'],_0xd5154[_0x375f('0x53')]+path[_0x375f('0x55')](_0xd5154[_0x375f('0x4d')]),function(){if(_0x478077){fs['unlink'](_0xd5154[_0x375f('0x4d')]);}});}else{return _0x31e43c[_0x375f('0x54')](_0xd5154[_0x375f('0x4d')],function(_0x51bb69){if(_0x478077){fs[_0x375f('0x56')](_0xd5154[_0x375f('0x4d')]);}});}}})[_0x375f('0x41')](handleError(_0x31e43c,null));};exports[_0x375f('0x25')]=function(_0x57f2ac,_0x184102){return db[_0x375f('0x3e')]['find']({'where':{'id':_0x57f2ac[_0x375f('0x43')]['id']}})[_0x375f('0x24')](function(_0x4c54b7){if(_[_0x375f('0x60')](_0x4c54b7)){throw new ReferenceError(_0x375f('0x61'));}return _0x4c54b7;})[_0x375f('0x24')](function(_0x4fa3b8){var _0x5667ce=_0x4fa3b8[_0x375f('0x4d')];logger[_0x375f('0x62')]('cancellazione\x20fisica\x20documento\x20%s',_0x5667ce);if(!_[_0x375f('0x60')](_0x4fa3b8['value'])&&fs['existsSync'](_0x5667ce)){logger[_0x375f('0x62')](_0x375f('0x63')+_0x5667ce+_0x375f('0x64'));fs[_0x375f('0x65')](_0x5667ce);}_0x5667ce=_0x5667ce+_0x375f('0x66');if(!_[_0x375f('0x60')](_0x4fa3b8[_0x375f('0x4d')])&&fs['existsSync'](_0x5667ce)){logger['info']('File:\x20\x22'+_0x5667ce+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x375f('0x65')](_0x5667ce);}return _0x4fa3b8;})[_0x375f('0x24')](function(_0x5c9df1){if(!_0x5c9df1)throw new InternalError();return _0x5c9df1[_0x375f('0x25')]();})[_0x375f('0x24')](function(){_0x184102['status'](0xcc)[_0x375f('0x19')]();})[_0x375f('0x41')](handleError(_0x184102,null));};function getBucketslist(_0x1407e0,_0xb84f88,_0x25528){return new Promise(function(_0x4e95e6,_0x4c4c22){var _0x2acf6f=new AWS['S3']({'accessKeyId':_0xb84f88,'secretAccessKey':_0x1407e0,'region':_0x25528});_0x2acf6f['listBuckets']({},function(_0x5262c8,_0x574148){if(_0x5262c8){return _0x4c4c22(_0x5262c8);}else{return _0x4e95e6(_0x574148);}});});}function createBucket(_0x520cfa,_0x5968e3,_0x1e2ebb,_0x3acec0){return new Promise(function(_0x24524e,_0x3162b1){var _0x50137=new AWS['S3']({'accessKeyId':_0x5968e3,'secretAccessKey':_0x520cfa,'region':_0x1e2ebb});_0x50137['createBucket']({'Bucket':_0x3acec0},function(_0x3eb83f,_0x20a351){if(_0x3eb83f){return _0x3162b1(_0x3eb83f);}else{return _0x24524e(_0x20a351);}});});}function uploadFile(_0x1e55bf,_0x576e1a,_0x50c4b7,_0x345abf,_0x5a243a,_0x204f06){return new Promise(function(_0x4002db,_0x17d91f){var _0x517dc7=new AWS['S3']({'accessKeyId':_0x576e1a,'secretAccessKey':_0x1e55bf,'region':_0x50c4b7});_0x517dc7[_0x375f('0x67')]({'Bucket':_0x345abf,'Key':_0x5a243a,'Body':_0x204f06},function(_0x24e5f1,_0x4ed315){if(_0x24e5f1){return _0x17d91f(_0x24e5f1);}else{return _0x4002db(_0x4ed315);}});});}function startTranscribe(_0x1b3124,_0x15ff91,_0x8271b8,_0x19ef8a,_0x2e3399,_0x1ca39f){return new Promise(function(_0x543099,_0x1fd92e){var _0x3e5130=new AWS[(_0x375f('0x68'))]({'accessKeyId':_0x15ff91,'secretAccessKey':_0x1b3124,'region':_0x8271b8});_0x3e5130['startTranscriptionJob']({'TranscriptionJobName':_0x19ef8a,'LanguageCode':_0x2e3399,'Media':{'MediaFileUri':_0x1ca39f}},function(_0x2e5976,_0x1e99e1){if(_0x2e5976){return _0x1fd92e(_0x2e5976);}else{return _0x543099(_0x1e99e1);}});});}function transcribe(_0x360ea6,_0x2153e2,_0x5e8b36,_0x19d2f1,_0xa5d7b5,_0x58835e,_0x444cd9){return new Promise(function(_0x5985a7,_0x16151a){var _0x458caa={};logger[_0x375f('0x62')](util[_0x375f('0x2e')](_0x375f('0x69'),_0x360ea6,_0xa5d7b5));return uploadFile(_0x2153e2,_0x5e8b36,_0x19d2f1,_0xa5d7b5,path[_0x375f('0x6a')](_0x58835e),fs[_0x375f('0x6b')](_0x58835e))[_0x375f('0x24')](function(_0x1561f9){logger[_0x375f('0x62')](util[_0x375f('0x2e')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x360ea6,_0xa5d7b5,_0x1561f9[_0x375f('0x6c')]));_0x458caa['bucket']=_0x1561f9[_0x375f('0x6d')];_0x458caa[_0x375f('0x6e')]=_0x1561f9[_0x375f('0x6c')];logger[_0x375f('0x62')](util[_0x375f('0x2e')](_0x375f('0x6f'),_0x360ea6));return startTranscribe(_0x2153e2,_0x5e8b36,_0x19d2f1,uuidv4(),_0x444cd9,_0x1561f9[_0x375f('0x6c')]);})[_0x375f('0x24')](function(_0x56f3ea){logger['info'](util[_0x375f('0x2e')](_0x375f('0x70'),_0x360ea6,_0x56f3ea['TranscriptionJob'][_0x375f('0x71')]));_0x458caa[_0x375f('0x72')]=_0x56f3ea[_0x375f('0x73')][_0x375f('0x71')];_0x458caa[_0x375f('0x74')]=_0x56f3ea[_0x375f('0x73')][_0x375f('0x75')];return _0x5985a7(_0x458caa);})['catch'](function(_0x54e538){return _0x16151a(_0x54e538);});});}exports[_0x375f('0x76')]=function(_0x4076a2,_0x55f947,_0x1d6b6b){var _0x2a6953;var _0x2cdf93;var _0x1f749e;var _0x693f2d=require('../../components/encryptor');return db['VoiceRecording']['findOne']({'where':{'id':_0x4076a2[_0x375f('0x43')]['id']}})[_0x375f('0x24')](function(_0x169baa){if(_0x169baa){var _0x22af3b=util['format'](_0x375f('0x4e'),_0x169baa[_0x375f('0x4d')]);if(fs[_0x375f('0x50')](_0x22af3b)){cypher=!![];return _0x693f2d[_0x375f('0x5e')](_0x22af3b,_0x169baa[_0x375f('0x4d')],config['secrets'][_0x375f('0x4f')])[_0x375f('0x24')](function(){return _0x169baa;});}return _0x169baa;}})[_0x375f('0x24')](function(_0x273b90){if(!_0x273b90){throw new db[(_0x375f('0x51'))]['ValidationError'](_0x375f('0x77'));}_0x2cdf93=_0x273b90;return db[_0x375f('0x78')][_0x375f('0x79')]({'where':{'id':0x1}});})[_0x375f('0x24')](handleEntityNotFound(_0x55f947,null))['then'](function(_0x5bf255){if(_0x5bf255){_0x2a6953=_0x5bf255;if(!_0x2a6953['transcribe']||!_0x2a6953[_0x375f('0x7a')]||!_0x2a6953[_0x375f('0x7b')]||!_0x2a6953[_0x375f('0x7c')]||!_0x2a6953['bucket']){throw new db[(_0x375f('0x51'))][(_0x375f('0x7d'))](_0x375f('0x7e'));}if(_0x4076a2[_0x375f('0x49')]['runSentiment']&&(!_0x2a6953[_0x375f('0x7f')]||!_0x2a6953['sentimentAccountId']||!_0x2a6953[_0x375f('0x80')]||!_0x2a6953['language']||!_0x2a6953[_0x375f('0x81')])){throw new db[(_0x375f('0x51'))][(_0x375f('0x7d'))](_0x375f('0x82'));}return db[_0x375f('0x83')]['findOne']({'where':{'id':_0x2a6953['transcribeAccountId']}});}})[_0x375f('0x24')](function(_0x3c002c){if(!_0x3c002c){throw new db['Sequelize'][(_0x375f('0x7d'))](_0x375f('0x84'));}if(!_0x3c002c[_0x375f('0x85')]||!_0x3c002c[_0x375f('0x86')]){throw new db['Sequelize'][(_0x375f('0x7d'))](_0x375f('0x87'));}_0x1f749e=_0x3c002c;return getBucketslist(_0x1f749e['data1'],_0x1f749e[_0x375f('0x86')],_0x2a6953[_0x375f('0x7b')]);})[_0x375f('0x24')](function(_0x2a827d){if(_0x2a827d&&_0x2a827d[_0x375f('0x88')]){var _0x5efdf3=_[_0x375f('0x4c')](_0x2a827d[_0x375f('0x88')],function(_0x32c1e3){return _0x32c1e3[_0x375f('0x89')]===_0x2a6953[_0x375f('0x81')];});if(!_0x5efdf3){logger[_0x375f('0x62')](util[_0x375f('0x2e')](_0x375f('0x8a'),_0x4076a2[_0x375f('0x43')]['id'],_0x2a6953[_0x375f('0x81')]));return createBucket(_0x1f749e[_0x375f('0x85')],_0x1f749e['data2'],_0x2a6953[_0x375f('0x7b')],_0x2a6953['bucket']);}logger[_0x375f('0x62')](util[_0x375f('0x2e')](_0x375f('0x8b'),_0x4076a2[_0x375f('0x43')]['id'],_0x2a6953[_0x375f('0x81')]));return;}})[_0x375f('0x24')](function(_0x1f6e2b){if(_0x2cdf93[_0x375f('0x74')]===_0x375f('0x8c')){return transcribe(_0x4076a2[_0x375f('0x43')]['id'],_0x1f749e[_0x375f('0x85')],_0x1f749e['data2'],_0x2a6953['transcribeRegion'],_0x2a6953[_0x375f('0x81')],_0x2cdf93[_0x375f('0x4d')],_0x2a6953[_0x375f('0x7c')]);}else{logger[_0x375f('0x62')](util[_0x375f('0x2e')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x4076a2[_0x375f('0x43')]['id']));return{'transcribeStatus':_0x375f('0x8d')};}})[_0x375f('0x24')](function(_0x229918){if(_0x229918){_0x229918[_0x375f('0x8e')]=_0x4076a2[_0x375f('0x49')][_0x375f('0x8f')];return _0x2cdf93[_0x375f('0x90')](_0x229918);}})[_0x375f('0x24')](respondWithResult(_0x55f947,null))['catch'](handleError(_0x55f947,null));};function writeFile(_0x329579,_0x1a5c47){return new Promise(function(_0x2f5015,_0x28ff1d){fs[_0x375f('0x91')](_0x1a5c47,_0x329579,function(_0x266f32,_0x2c18e4){if(_0x266f32){return _0x28ff1d(_0x266f32);}else{return _0x2f5015(_0x2c18e4);}});});}exports[_0x375f('0x92')]=function(_0x913dd8,_0x147602,_0x230cfd){return db[_0x375f('0x3e')]['findOne']({'where':{'id':_0x913dd8[_0x375f('0x43')]['id']}})['then'](handleEntityNotFound(_0x147602))[_0x375f('0x24')](function(_0x3372e9){if(_0x3372e9&&_0x3372e9[_0x375f('0x93')]){var _0x3151cc=_0x3372e9[_0x375f('0x93')];var _0xdd0526=config[_0x375f('0x94')]+_0x375f('0x95')+_0x3372e9['id']+_0x375f('0x96');if(fs[_0x375f('0x50')](_0xdd0526)){return _0xdd0526;}return writeFile(_0x3151cc,_0xdd0526)[_0x375f('0x24')](function(){return _0xdd0526;});}else{throw new db[(_0x375f('0x51'))]['ValidationError'](_0x375f('0x97'));}})['then'](function(_0x1d7fdb){return _0x147602[_0x375f('0x54')](_0x1d7fdb);})[_0x375f('0x41')](handleError(_0x147602));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 8ab79ac..4805524 100644 --- a/server/api/voiceRecording/voiceRecording.model.js +++ b/server/api/voiceRecording/voiceRecording.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8d97=['VoiceRecording','voice_recordings','uniqueid','transcribeStatus','exports','define'];(function(_0x3e143a,_0x558381){var _0x1e0a0e=function(_0x19115d){while(--_0x19115d){_0x3e143a['push'](_0x3e143a['shift']());}};_0x1e0a0e(++_0x558381);}(_0x8d97,0x82));var _0x78d9=function(_0x207bfa,_0x214a03){_0x207bfa=_0x207bfa-0x0;var _0x3383c4=_0x8d97[_0x207bfa];return _0x3383c4;};'use strict';var attributes=require('./voiceRecording.attributes');module[_0x78d9('0x0')]=function(_0x288fbe,_0x54c125){return _0x288fbe[_0x78d9('0x1')](_0x78d9('0x2'),attributes,{'tableName':_0x78d9('0x3'),'paranoid':![],'indexes':[{'name':_0x78d9('0x4'),'fields':[_0x78d9('0x4')]},{'name':'transcribeStatus','fields':[_0x78d9('0x5')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8eeb=['uniqueid','transcribeStatus','./voiceRecording.attributes','VoiceRecording','voice_recordings'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x8eeb,0x183));var _0xb8ee=function(_0x45ac8d,_0x39a7dc){_0x45ac8d=_0x45ac8d-0x0;var _0x46642a=_0x8eeb[_0x45ac8d];return _0x46642a;};'use strict';var attributes=require(_0xb8ee('0x0'));module['exports']=function(_0x464dec,_0x2b3ac1){return _0x464dec['define'](_0xb8ee('0x1'),attributes,{'tableName':_0xb8ee('0x2'),'paranoid':![],'indexes':[{'name':_0xb8ee('0x3'),'fields':[_0xb8ee('0x3')]},{'name':_0xb8ee('0x4'),'fields':['transcribeStatus']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 964e31f..4b2f1da 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 _0x6d11=['message','catch','VoiceRecording','update','options','where','attributes','limit','UpdateVoiceRecording','CreateVoiceRecording','../../components/encryptor','findOne','callRecordingEncryption','create','body','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','VoiceRecording,\x20%s,\x20%s','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x4d9100,_0x5d39ff){var _0x4ffd43=function(_0x517532){while(--_0x517532){_0x4d9100['push'](_0x4d9100['shift']());}};_0x4ffd43(++_0x5d39ff);}(_0x6d11,0xbf));var _0x16d1=function(_0x2042d6,_0x5904b8){_0x2042d6=_0x2042d6-0x0;var _0x988cb0=_0x6d11[_0x2042d6];return _0x988cb0;};'use strict';var _=require(_0x16d1('0x0'));var util=require(_0x16d1('0x1'));var moment=require(_0x16d1('0x2'));var BPromise=require('bluebird');var rs=require(_0x16d1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x16d1('0x4'))['db'];var utils=require(_0x16d1('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x16d1('0x6'));var jayson=require(_0x16d1('0x7'));var client=jayson[_0x16d1('0x8')][_0x16d1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1009dc,_0x150217,_0x19390d){return new BPromise(function(_0x5d0e3f,_0x58a7a2){return client['request'](_0x1009dc,_0x19390d)[_0x16d1('0xa')](function(_0xcfbb15){logger[_0x16d1('0xb')](_0x16d1('0xc'),_0x150217,'request\x20sent');logger[_0x16d1('0xd')](_0x16d1('0xe'),_0x150217,_0x16d1('0xf'),JSON[_0x16d1('0x10')](_0xcfbb15));if(_0xcfbb15[_0x16d1('0x11')]){if(_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x12')]===0x1f4){logger[_0x16d1('0x11')]('VoiceRecording,\x20%s,\x20%s',_0x150217,_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);return _0x58a7a2(_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);}logger[_0x16d1('0x11')]('VoiceRecording,\x20%s,\x20%s',_0x150217,_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);return _0x5d0e3f(_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);}else{logger[_0x16d1('0xb')](_0x16d1('0xc'),_0x150217,_0x16d1('0xf'));_0x5d0e3f(_0xcfbb15['result'][_0x16d1('0x13')]);}})[_0x16d1('0x14')](function(_0x555b2d){logger['error'](_0x16d1('0xc'),_0x150217,_0x555b2d);_0x58a7a2(_0x555b2d);});});}exports['UpdateVoiceRecording']=function(_0x46a25e){var _0x4aeff0=this;return new Promise(function(_0x1da1b8,_0x4fe22d){return db[_0x16d1('0x15')][_0x16d1('0x16')](_0x46a25e['body'],{'raw':_0x46a25e['options']?_0x46a25e['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46a25e[_0x16d1('0x17')]?_0x46a25e['options'][_0x16d1('0x18')]||null:null,'attributes':_0x46a25e[_0x16d1('0x17')]?_0x46a25e[_0x16d1('0x17')][_0x16d1('0x19')]||null:null,'limit':_0x46a25e['options']?_0x46a25e[_0x16d1('0x17')][_0x16d1('0x1a')]||null:null})[_0x16d1('0xa')](function(_0x585ce5){logger[_0x16d1('0xb')](_0x16d1('0x1b'),_0x46a25e);logger[_0x16d1('0xd')](_0x16d1('0x1b'),_0x46a25e,JSON[_0x16d1('0x10')](_0x585ce5));_0x1da1b8(_0x585ce5);})[_0x16d1('0x14')](function(_0x32f362){logger[_0x16d1('0x11')](_0x16d1('0x1b'),_0x32f362[_0x16d1('0x13')],_0x46a25e);_0x4fe22d(_0x4aeff0[_0x16d1('0x11')](0x1f4,_0x32f362[_0x16d1('0x13')]));});});};exports[_0x16d1('0x1c')]=function(_0x262f89){var _0x346b69=this;return new Promise(function(_0x2b8403,_0x491f65){var _0x25ae4e=require(_0x16d1('0x1d'));var _0x4257f1;return db['Setting'][_0x16d1('0x1e')]({'attributes':['id',_0x16d1('0x1f')],'where':{'id':0x1},'raw':!![]})[_0x16d1('0xa')](function(_0x22e5b3){_0x4257f1=_0x22e5b3;return db[_0x16d1('0x15')][_0x16d1('0x20')](_0x262f89[_0x16d1('0x21')]);})['then'](function(_0x3dd104){if(_0x4257f1[_0x16d1('0x1f')]&&fs[_0x16d1('0x22')](_0x3dd104[_0x16d1('0x23')])){var _0x55c021=util['format'](_0x16d1('0x24'),_0x3dd104[_0x16d1('0x23')]);return _0x25ae4e[_0x16d1('0x25')](_0x3dd104[_0x16d1('0x23')],_0x55c021,config[_0x16d1('0x26')][_0x16d1('0x27')])[_0x16d1('0xa')](function(){fs[_0x16d1('0x28')](_0x3dd104[_0x16d1('0x23')]);logger[_0x16d1('0xb')](_0x16d1('0x29'));return _0x3dd104;});}return _0x3dd104;})[_0x16d1('0xa')](function(_0x188cf4){logger[_0x16d1('0xb')]('CreateVoiceRecording',_0x262f89);logger[_0x16d1('0xd')]('CreateVoiceRecording',_0x262f89,JSON[_0x16d1('0x10')](_0x188cf4));_0x2b8403(_0x188cf4);})[_0x16d1('0x14')](function(_0x2b9126){logger[_0x16d1('0x11')](_0x16d1('0x1c'),_0x2b9126[_0x16d1('0x13')],_0x262f89);_0x491f65(_0x346b69['error'](0x1f4,_0x2b9126['message']));});});}; \ No newline at end of file +var _0x9f0e=['format','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','options','raw','where','limit','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','body','existsSync','value'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x9f0e,0x116));var _0xe9f0=function(_0x443ad5,_0x3e213a){_0x443ad5=_0x443ad5-0x0;var _0x4fba27=_0x9f0e[_0x443ad5];return _0x4fba27;};'use strict';var _=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var moment=require(_0xe9f0('0x2'));var BPromise=require(_0xe9f0('0x3'));var rs=require(_0xe9f0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe9f0('0x5'));var logger=require(_0xe9f0('0x6'))(_0xe9f0('0x7'));var config=require(_0xe9f0('0x8'));var jayson=require(_0xe9f0('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3a17b3,_0x167198,_0xe64a79){return new BPromise(function(_0x4be6a6,_0xf4a256){return client[_0xe9f0('0xa')](_0x3a17b3,_0xe64a79)[_0xe9f0('0xb')](function(_0x3386a8){logger[_0xe9f0('0xc')](_0xe9f0('0xd'),_0x167198,_0xe9f0('0xe'));logger[_0xe9f0('0xf')](_0xe9f0('0x10'),_0x167198,'request\x20sent',JSON[_0xe9f0('0x11')](_0x3386a8));if(_0x3386a8[_0xe9f0('0x12')]){if(_0x3386a8[_0xe9f0('0x12')]['code']===0x1f4){logger[_0xe9f0('0x12')]('VoiceRecording,\x20%s,\x20%s',_0x167198,_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);return _0xf4a256(_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);}logger['error'](_0xe9f0('0xd'),_0x167198,_0x3386a8['error'][_0xe9f0('0x13')]);return _0x4be6a6(_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);}else{logger['info'](_0xe9f0('0xd'),_0x167198,_0xe9f0('0xe'));_0x4be6a6(_0x3386a8[_0xe9f0('0x14')]['message']);}})[_0xe9f0('0x15')](function(_0x1e16e0){logger[_0xe9f0('0x12')](_0xe9f0('0xd'),_0x167198,_0x1e16e0);_0xf4a256(_0x1e16e0);});});}exports[_0xe9f0('0x16')]=function(_0x2ab12b){var _0x3da237=this;return new Promise(function(_0x59bf5a,_0x15a33b){return db[_0xe9f0('0x17')][_0xe9f0('0x18')](_0x2ab12b['body'],{'raw':_0x2ab12b[_0xe9f0('0x19')]?_0x2ab12b[_0xe9f0('0x19')][_0xe9f0('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ab12b[_0xe9f0('0x19')]?_0x2ab12b['options'][_0xe9f0('0x1b')]||null:null,'attributes':_0x2ab12b[_0xe9f0('0x19')]?_0x2ab12b['options']['attributes']||null:null,'limit':_0x2ab12b['options']?_0x2ab12b[_0xe9f0('0x19')][_0xe9f0('0x1c')]||null:null})[_0xe9f0('0xb')](function(_0x316cdf){logger[_0xe9f0('0xc')]('UpdateVoiceRecording',_0x2ab12b);logger[_0xe9f0('0xf')](_0xe9f0('0x16'),_0x2ab12b,JSON[_0xe9f0('0x11')](_0x316cdf));_0x59bf5a(_0x316cdf);})[_0xe9f0('0x15')](function(_0x3ca991){logger[_0xe9f0('0x12')](_0xe9f0('0x16'),_0x3ca991[_0xe9f0('0x13')],_0x2ab12b);_0x15a33b(_0x3da237[_0xe9f0('0x12')](0x1f4,_0x3ca991[_0xe9f0('0x13')]));});});};exports['CreateVoiceRecording']=function(_0x371095){var _0x27541f=this;return new Promise(function(_0x2ddfba,_0x1a8478){var _0x4cf1b1=require(_0xe9f0('0x1d'));var _0x2613fd;return db[_0xe9f0('0x1e')][_0xe9f0('0x1f')]({'attributes':['id',_0xe9f0('0x20')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x130f96){_0x2613fd=_0x130f96;return db[_0xe9f0('0x17')][_0xe9f0('0x21')](_0x371095[_0xe9f0('0x22')]);})[_0xe9f0('0xb')](function(_0xd19788){if(_0x2613fd[_0xe9f0('0x20')]&&fs[_0xe9f0('0x23')](_0xd19788[_0xe9f0('0x24')])){var _0x3dbe49=util[_0xe9f0('0x25')](_0xe9f0('0x26'),_0xd19788[_0xe9f0('0x24')]);return _0x4cf1b1[_0xe9f0('0x27')](_0xd19788[_0xe9f0('0x24')],_0x3dbe49,config[_0xe9f0('0x28')][_0xe9f0('0x29')])[_0xe9f0('0xb')](function(){fs[_0xe9f0('0x2a')](_0xd19788[_0xe9f0('0x24')]);logger[_0xe9f0('0xc')](_0xe9f0('0x2b'));return _0xd19788;});}return _0xd19788;})[_0xe9f0('0xb')](function(_0x3611c0){logger['info']('CreateVoiceRecording',_0x371095);logger['debug'](_0xe9f0('0x2c'),_0x371095,JSON['stringify'](_0x3611c0));_0x2ddfba(_0x3611c0);})[_0xe9f0('0x15')](function(_0xc5fa13){logger['error'](_0xe9f0('0x2c'),_0xc5fa13['message'],_0x371095);_0x1a8478(_0x27541f['error'](0x1f4,_0xc5fa13['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index ac50d21..0845131 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 _0x77b6=['destroy','exports','multer','util','path','Router','../../components/auth/service','../../config/environment','./voiceTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete'];(function(_0x252a6c,_0x539c6f){var _0x5750bc=function(_0x266770){while(--_0x266770){_0x252a6c['push'](_0x252a6c['shift']());}};_0x5750bc(++_0x539c6f);}(_0x77b6,0x17c));var _0x677b=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x77b6[_0x3635ce];return _0x97ecd0;};'use strict';var multer=require(_0x677b('0x0'));var util=require(_0x677b('0x1'));var path=require(_0x677b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x677b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x677b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x677b('0x5'));var controller=require(_0x677b('0x6'));router[_0x677b('0x7')]('/',auth['isAuthenticated'](),controller[_0x677b('0x8')]);router[_0x677b('0x7')](_0x677b('0x9'),auth[_0x677b('0xa')](),controller[_0x677b('0xb')]);router[_0x677b('0x7')](_0x677b('0xc'),auth[_0x677b('0xa')](),controller[_0x677b('0xd')]);router[_0x677b('0xe')]('/',auth[_0x677b('0xa')](),controller[_0x677b('0xf')]);router[_0x677b('0x10')](_0x677b('0xc'),auth[_0x677b('0xa')](),controller[_0x677b('0x11')]);router[_0x677b('0x12')]('/:id',auth[_0x677b('0xa')](),controller[_0x677b('0x13')]);module[_0x677b('0x14')]=router; \ No newline at end of file +var _0x22e2=['./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe','create','put','/:id','update','destroy','multer','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x4fbde2,_0x364951){var _0x2bce29=function(_0x3a97c9){while(--_0x3a97c9){_0x4fbde2['push'](_0x4fbde2['shift']());}};_0x2bce29(++_0x364951);}(_0x22e2,0x6b));var _0x222e=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x22e2[_0x13b8f3];return _0x1a6d06;};'use strict';var multer=require(_0x222e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x222e('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x222e('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x222e('0x3'));var config=require(_0x222e('0x4'));var controller=require(_0x222e('0x5'));router[_0x222e('0x6')]('/',auth[_0x222e('0x7')](),controller[_0x222e('0x8')]);router[_0x222e('0x6')](_0x222e('0x9'),auth['isAuthenticated'](),controller[_0x222e('0xa')]);router[_0x222e('0x6')]('/:id',auth[_0x222e('0x7')](),controller['show']);router['post']('/',auth[_0x222e('0x7')](),controller[_0x222e('0xb')]);router[_0x222e('0xc')](_0x222e('0xd'),auth[_0x222e('0x7')](),controller[_0x222e('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x222e('0xf')]);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 bc413b1..a02d840 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 _0x91b2=['blind','STRING','sequelize','moment','exports','ENUM'];(function(_0x169401,_0x5b10f6){var _0xd85e3a=function(_0x95a045){while(--_0x95a045){_0x169401['push'](_0x169401['shift']());}};_0xd85e3a(++_0x5b10f6);}(_0x91b2,0x17c));var _0x291b=function(_0x1e4f2d,_0x22e2bb){_0x1e4f2d=_0x1e4f2d-0x0;var _0xd05ce5=_0x91b2[_0x1e4f2d];return _0xd05ce5;};'use strict';var Sequelize=require(_0x291b('0x0'));var moment=require(_0x291b('0x1'));module[_0x291b('0x2')]={'type':{'type':Sequelize[_0x291b('0x3')](_0x291b('0x4'),'attended')},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0x291b('0x5')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0x291b('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x291b('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0x291b('0x5')]},'transfereraccountcode':{'type':Sequelize[_0x291b('0x5')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x291b('0x5')]},'transfererlinkedid':{'type':Sequelize[_0x291b('0x5')]},'transfereechannel':{'type':Sequelize[_0x291b('0x5')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x291b('0x5')]},'transfereeexten':{'type':Sequelize[_0x291b('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x291b('0x5')]},'isexternal':{'type':Sequelize['ENUM']('Yes','No')},'context':{'type':Sequelize[_0x291b('0x5')]},'extension':{'type':Sequelize[_0x291b('0x5')]}}; \ No newline at end of file +var _0x3071=['STRING','moment','exports','ENUM','attended'];(function(_0x2bfb31,_0xdd9aae){var _0x2b00ce=function(_0x3ddbfa){while(--_0x3ddbfa){_0x2bfb31['push'](_0x2bfb31['shift']());}};_0x2b00ce(++_0xdd9aae);}(_0x3071,0x1c8));var _0x1307=function(_0x3a78a0,_0x44985f){_0x3a78a0=_0x3a78a0-0x0;var _0x48e917=_0x3071[_0x3a78a0];return _0x48e917;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x1307('0x0'));module[_0x1307('0x1')]={'type':{'type':Sequelize[_0x1307('0x2')]('blind',_0x1307('0x3'))},'result':{'type':Sequelize[_0x1307('0x4')]},'transfererchannel':{'type':Sequelize[_0x1307('0x4')]},'transferercalleridnum':{'type':Sequelize[_0x1307('0x4')]},'transferercalleridname':{'type':Sequelize[_0x1307('0x4')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x1307('0x4')]},'transfereraccountcode':{'type':Sequelize[_0x1307('0x4')]},'transferercontext':{'type':Sequelize[_0x1307('0x4')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x1307('0x4')]},'transfereechannel':{'type':Sequelize[_0x1307('0x4')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0x1307('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0x1307('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0x1307('0x4')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x1307('0x4')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize['ENUM']('Yes','No')},'context':{'type':Sequelize[_0x1307('0x4')]},'extension':{'type':Sequelize[_0x1307('0x4')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 35f9e0f..3129880 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 _0xbfa2=['offset','undefined','count','set','Content-Range','reject','update','then','destroy','error','stack','name','index','VoiceTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','pick','filter','merge','map','type','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json'];(function(_0x267a2d,_0x204cb8){var _0x3f660a=function(_0xa7a70c){while(--_0xa7a70c){_0x267a2d['push'](_0x267a2d['shift']());}};_0x3f660a(++_0x204cb8);}(_0xbfa2,0x1a1));var _0x2bfa=function(_0x29f887,_0x521f0f){_0x29f887=_0x29f887-0x0;var _0x220aed=_0xbfa2[_0x29f887];return _0x220aed;};'use strict';var emlformat=require(_0x2bfa('0x0'));var rimraf=require(_0x2bfa('0x1'));var zipdir=require(_0x2bfa('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2bfa('0x3'));var Mustache=require(_0x2bfa('0x4'));var util=require(_0x2bfa('0x5'));var path=require(_0x2bfa('0x6'));var sox=require(_0x2bfa('0x7'));var csv=require(_0x2bfa('0x8'));var ejs=require(_0x2bfa('0x9'));var fs=require('fs');var fs_extra=require(_0x2bfa('0xa'));var _=require(_0x2bfa('0xb'));var squel=require(_0x2bfa('0xc'));var crypto=require(_0x2bfa('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2bfa('0xe'));var toCsv=require(_0x2bfa('0x8'));var querystring=require('querystring');var Papa=require(_0x2bfa('0xf'));var Redis=require('ioredis');var authService=require(_0x2bfa('0x10'));var qs=require(_0x2bfa('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2bfa('0x12'))(_0x2bfa('0x13'));var utils=require(_0x2bfa('0x14'));var config=require(_0x2bfa('0x15'));var licenseUtil=require(_0x2bfa('0x16'));var db=require(_0x2bfa('0x17'))['db'];function respondWithStatusCode(_0x377e34,_0x1fad4a){_0x1fad4a=_0x1fad4a||0xcc;return function(_0x5124a3){if(_0x5124a3){return _0x377e34['sendStatus'](_0x1fad4a);}return _0x377e34[_0x2bfa('0x18')](_0x1fad4a)[_0x2bfa('0x19')]();};}function respondWithResult(_0x5b9b8b,_0x1cd9bd){_0x1cd9bd=_0x1cd9bd||0xc8;return function(_0x39efd7){if(_0x39efd7){return _0x5b9b8b['status'](_0x1cd9bd)[_0x2bfa('0x1a')](_0x39efd7);}};}function respondWithFilteredResult(_0x5f0445,_0x28ab93){return function(_0x20fef5){if(_0x20fef5){var _0x5d2644=typeof _0x28ab93[_0x2bfa('0x1b')]===_0x2bfa('0x1c')&&typeof _0x28ab93['limit']===_0x2bfa('0x1c');var _0x14a3ed=_0x20fef5[_0x2bfa('0x1d')];var _0x4d3785=_0x5d2644?0x0:_0x28ab93[_0x2bfa('0x1b')];var _0x2536e1=_0x5d2644?_0x20fef5[_0x2bfa('0x1d')]:_0x28ab93['offset']+_0x28ab93['limit'];var _0x5306fb;if(_0x2536e1>=_0x14a3ed){_0x2536e1=_0x14a3ed;_0x5306fb=0xc8;}else{_0x5306fb=0xce;}_0x5f0445['status'](_0x5306fb);return _0x5f0445[_0x2bfa('0x1e')](_0x2bfa('0x1f'),_0x4d3785+'-'+_0x2536e1+'/'+_0x14a3ed)[_0x2bfa('0x1a')](_0x20fef5);}return null;};}function patchUpdates(_0x158e64){return function(_0x118590){try{jsonpatch['apply'](_0x118590,_0x158e64,!![]);}catch(_0x54edf1){return BPromise[_0x2bfa('0x20')](_0x54edf1);}return _0x118590['save']();};}function saveUpdates(_0x14bd23,_0x47bc27){return function(_0x1d29ed){if(_0x1d29ed){return _0x1d29ed[_0x2bfa('0x21')](_0x14bd23)[_0x2bfa('0x22')](function(_0x3f5236){return _0x3f5236;});}return null;};}function removeEntity(_0x1e894f,_0xe50db4){return function(_0x1a3b72){if(_0x1a3b72){return _0x1a3b72[_0x2bfa('0x23')]()[_0x2bfa('0x22')](function(){_0x1e894f[_0x2bfa('0x18')](0xcc)[_0x2bfa('0x19')]();});}};}function handleEntityNotFound(_0xa3d1d2,_0x36bb35){return function(_0x585092){if(!_0x585092){_0xa3d1d2['sendStatus'](0x194);}return _0x585092;};}function handleError(_0x24c963,_0x266699){_0x266699=_0x266699||0x1f4;return function(_0x25f683){logger[_0x2bfa('0x24')](_0x25f683[_0x2bfa('0x25')]);if(_0x25f683[_0x2bfa('0x26')]){delete _0x25f683[_0x2bfa('0x26')];}_0x24c963['status'](_0x266699)['send'](_0x25f683);};}exports[_0x2bfa('0x27')]=function(_0x5bf626,_0x3cce68){var _0x465daa={},_0x4da69b={},_0x1eb257={'count':0x0,'rows':[]};var _0xe8924e=_['map'](db[_0x2bfa('0x28')][_0x2bfa('0x29')],function(_0x4d1ccb){return{'name':_0x4d1ccb[_0x2bfa('0x2a')],'type':_0x4d1ccb['type'][_0x2bfa('0x2b')]};});_0x4da69b[_0x2bfa('0x2c')]=_['map'](_0xe8924e,_0x2bfa('0x26'));_0x4da69b[_0x2bfa('0x2d')]=_[_0x2bfa('0x2e')](_0x5bf626[_0x2bfa('0x2d')]);_0x4da69b[_0x2bfa('0x2f')]=_[_0x2bfa('0x30')](_0x4da69b[_0x2bfa('0x2c')],_0x4da69b['query']);_0x465daa[_0x2bfa('0x31')]=_[_0x2bfa('0x30')](_0x4da69b[_0x2bfa('0x2c')],qs[_0x2bfa('0x32')](_0x5bf626[_0x2bfa('0x2d')]['fields']));_0x465daa['attributes']=_0x465daa['attributes'][_0x2bfa('0x33')]?_0x465daa[_0x2bfa('0x31')]:_0x4da69b[_0x2bfa('0x2c')];if(!_0x5bf626[_0x2bfa('0x2d')][_0x2bfa('0x34')](_0x2bfa('0x35'))){_0x465daa[_0x2bfa('0x36')]=qs[_0x2bfa('0x36')](_0x5bf626[_0x2bfa('0x2d')][_0x2bfa('0x36')]);_0x465daa[_0x2bfa('0x1b')]=qs[_0x2bfa('0x1b')](_0x5bf626[_0x2bfa('0x2d')]['offset']);}_0x465daa[_0x2bfa('0x37')]=qs['sort'](_0x5bf626[_0x2bfa('0x2d')]['sort']);_0x465daa[_0x2bfa('0x38')]=qs[_0x2bfa('0x2f')](_[_0x2bfa('0x39')](_0x5bf626[_0x2bfa('0x2d')],_0x4da69b[_0x2bfa('0x2f')]),_0xe8924e);if(_0x5bf626['query'][_0x2bfa('0x3a')]){_0x465daa['where']=_[_0x2bfa('0x3b')](_0x465daa['where'],{'$or':_[_0x2bfa('0x3c')](_0xe8924e,function(_0x3dbe12){if(_0x3dbe12[_0x2bfa('0x3d')]!==_0x2bfa('0x3e')){var _0x361781={};_0x361781[_0x3dbe12[_0x2bfa('0x26')]]={'$like':'%'+_0x5bf626['query'][_0x2bfa('0x3a')]+'%'};return _0x361781;}})});}_0x465daa=_[_0x2bfa('0x3b')]({},_0x465daa,_0x5bf626[_0x2bfa('0x3f')]);var _0x4d1f25={'where':_0x465daa[_0x2bfa('0x38')]};return db['VoiceTransferReport'][_0x2bfa('0x1d')](_0x4d1f25)[_0x2bfa('0x22')](function(_0x111077){_0x1eb257['count']=_0x111077;if(_0x5bf626['query']['includeAll']){_0x465daa['include']=[{'all':!![]}];}return db[_0x2bfa('0x28')][_0x2bfa('0x40')](_0x465daa);})[_0x2bfa('0x22')](function(_0x31f589){_0x1eb257[_0x2bfa('0x41')]=_0x31f589;return _0x1eb257;})['then'](respondWithFilteredResult(_0x3cce68,_0x465daa))[_0x2bfa('0x42')](handleError(_0x3cce68,null));};exports[_0x2bfa('0x43')]=function(_0x51fea9,_0x2f9ace){var _0x158d44={'raw':!![],'where':{'id':_0x51fea9[_0x2bfa('0x44')]['id']}},_0x382af6={};_0x382af6[_0x2bfa('0x2c')]=_['keys'](db['VoiceTransferReport']['rawAttributes']);_0x382af6['query']=_[_0x2bfa('0x2e')](_0x51fea9[_0x2bfa('0x2d')]);_0x382af6['filters']=_[_0x2bfa('0x30')](_0x382af6[_0x2bfa('0x2c')],_0x382af6[_0x2bfa('0x2d')]);_0x158d44[_0x2bfa('0x31')]=_[_0x2bfa('0x30')](_0x382af6[_0x2bfa('0x2c')],qs[_0x2bfa('0x32')](_0x51fea9[_0x2bfa('0x2d')][_0x2bfa('0x32')]));_0x158d44[_0x2bfa('0x31')]=_0x158d44[_0x2bfa('0x31')][_0x2bfa('0x33')]?_0x158d44[_0x2bfa('0x31')]:_0x382af6[_0x2bfa('0x2c')];if(_0x51fea9[_0x2bfa('0x2d')][_0x2bfa('0x45')]){_0x158d44['include']=[{'all':!![]}];}_0x158d44=_[_0x2bfa('0x3b')]({},_0x158d44,_0x51fea9[_0x2bfa('0x3f')]);return db[_0x2bfa('0x28')][_0x2bfa('0x46')](_0x158d44)[_0x2bfa('0x22')](handleEntityNotFound(_0x2f9ace,null))[_0x2bfa('0x22')](respondWithResult(_0x2f9ace,null))['catch'](handleError(_0x2f9ace,null));};exports[_0x2bfa('0x47')]=function(_0x102450,_0x261858){return db['VoiceTransferReport']['create'](_0x102450[_0x2bfa('0x48')],{})['then'](respondWithResult(_0x261858,0xc9))['catch'](handleError(_0x261858,null));};exports[_0x2bfa('0x21')]=function(_0x7c221b,_0xc31a85){if(_0x7c221b[_0x2bfa('0x48')]['id']){delete _0x7c221b[_0x2bfa('0x48')]['id'];}return db[_0x2bfa('0x28')]['find']({'where':{'id':_0x7c221b['params']['id']}})[_0x2bfa('0x22')](handleEntityNotFound(_0xc31a85,null))[_0x2bfa('0x22')](saveUpdates(_0x7c221b[_0x2bfa('0x48')],null))[_0x2bfa('0x22')](respondWithResult(_0xc31a85,null))[_0x2bfa('0x42')](handleError(_0xc31a85,null));};exports[_0x2bfa('0x23')]=function(_0x1859a6,_0x72d5d3){return db['VoiceTransferReport'][_0x2bfa('0x46')]({'where':{'id':_0x1859a6[_0x2bfa('0x44')]['id']}})[_0x2bfa('0x22')](handleEntityNotFound(_0x72d5d3,null))[_0x2bfa('0x22')](removeEntity(_0x72d5d3,null))[_0x2bfa('0x42')](handleError(_0x72d5d3,null));};exports[_0x2bfa('0x49')]=function(_0x381176,_0x1f2289){return db['VoiceTransferReport'][_0x2bfa('0x49')]()[_0x2bfa('0x22')](respondWithResult(_0x1f2289,null))[_0x2bfa('0x42')](handleError(_0x1f2289,null));}; \ No newline at end of file +var _0xcf9f=['papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','destroy','then','error','stack','name','send','index','map','fieldName','type','key','keys','query','filters','model','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','rawAttributes','intersection','attributes','fields','VoiceTransferReport','catch','create','body','find','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xcf9f,0x16c));var _0xfcf9=function(_0x1418a5,_0x19c106){_0x1418a5=_0x1418a5-0x0;var _0x22c849=_0xcf9f[_0x1418a5];return _0x22c849;};'use strict';var emlformat=require(_0xfcf9('0x0'));var rimraf=require(_0xfcf9('0x1'));var zipdir=require(_0xfcf9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfcf9('0x3'));var moment=require(_0xfcf9('0x4'));var BPromise=require(_0xfcf9('0x5'));var Mustache=require(_0xfcf9('0x6'));var util=require(_0xfcf9('0x7'));var path=require(_0xfcf9('0x8'));var sox=require(_0xfcf9('0x9'));var csv=require(_0xfcf9('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfcf9('0xb'));var _=require(_0xfcf9('0xc'));var squel=require('squel');var crypto=require(_0xfcf9('0xd'));var jsforce=require(_0xfcf9('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xfcf9('0xa'));var querystring=require(_0xfcf9('0xf'));var Papa=require(_0xfcf9('0x10'));var Redis=require('ioredis');var authService=require(_0xfcf9('0x11'));var qs=require(_0xfcf9('0x12'));var as=require(_0xfcf9('0x13'));var hardwareService=require(_0xfcf9('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xfcf9('0x15'));var config=require(_0xfcf9('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xfcf9('0x17'))['db'];function respondWithStatusCode(_0xe951e7,_0x10102e){_0x10102e=_0x10102e||0xcc;return function(_0x715b73){if(_0x715b73){return _0xe951e7[_0xfcf9('0x18')](_0x10102e);}return _0xe951e7[_0xfcf9('0x19')](_0x10102e)['end']();};}function respondWithResult(_0x1a6fe4,_0xdea654){_0xdea654=_0xdea654||0xc8;return function(_0x2eb6e0){if(_0x2eb6e0){return _0x1a6fe4[_0xfcf9('0x19')](_0xdea654)['json'](_0x2eb6e0);}};}function respondWithFilteredResult(_0x3b8d59,_0x3eece3){return function(_0x2ffab3){if(_0x2ffab3){var _0x71c1fd=typeof _0x3eece3[_0xfcf9('0x1a')]===_0xfcf9('0x1b')&&typeof _0x3eece3['limit']==='undefined';var _0x60597b=_0x2ffab3[_0xfcf9('0x1c')];var _0x916043=_0x71c1fd?0x0:_0x3eece3[_0xfcf9('0x1a')];var _0x95340d=_0x71c1fd?_0x2ffab3['count']:_0x3eece3['offset']+_0x3eece3[_0xfcf9('0x1d')];var _0x5c163c;if(_0x95340d>=_0x60597b){_0x95340d=_0x60597b;_0x5c163c=0xc8;}else{_0x5c163c=0xce;}_0x3b8d59[_0xfcf9('0x19')](_0x5c163c);return _0x3b8d59[_0xfcf9('0x1e')](_0xfcf9('0x1f'),_0x916043+'-'+_0x95340d+'/'+_0x60597b)[_0xfcf9('0x20')](_0x2ffab3);}return null;};}function patchUpdates(_0x5d60b7){return function(_0x53e079){try{jsonpatch[_0xfcf9('0x21')](_0x53e079,_0x5d60b7,!![]);}catch(_0x4ed4af){return BPromise['reject'](_0x4ed4af);}return _0x53e079[_0xfcf9('0x22')]();};}function saveUpdates(_0x35b84b,_0x4acdff){return function(_0x5d98d5){if(_0x5d98d5){return _0x5d98d5[_0xfcf9('0x23')](_0x35b84b)['then'](function(_0x25265f){return _0x25265f;});}return null;};}function removeEntity(_0x118233,_0x45614a){return function(_0x406014){if(_0x406014){return _0x406014[_0xfcf9('0x24')]()[_0xfcf9('0x25')](function(){_0x118233[_0xfcf9('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x402113,_0x177e82){return function(_0x37494b){if(!_0x37494b){_0x402113[_0xfcf9('0x18')](0x194);}return _0x37494b;};}function handleError(_0x54adde,_0x229f35){_0x229f35=_0x229f35||0x1f4;return function(_0x35cd64){logger[_0xfcf9('0x26')](_0x35cd64[_0xfcf9('0x27')]);if(_0x35cd64[_0xfcf9('0x28')]){delete _0x35cd64[_0xfcf9('0x28')];}_0x54adde[_0xfcf9('0x19')](_0x229f35)[_0xfcf9('0x29')](_0x35cd64);};}exports[_0xfcf9('0x2a')]=function(_0xb4abd1,_0x3e3ae3){var _0x3b9088={},_0x2e9bbd={},_0x3b176e={'count':0x0,'rows':[]};var _0x44f3d1=_[_0xfcf9('0x2b')](db['VoiceTransferReport']['rawAttributes'],function(_0x764077){return{'name':_0x764077[_0xfcf9('0x2c')],'type':_0x764077[_0xfcf9('0x2d')][_0xfcf9('0x2e')]};});_0x2e9bbd['model']=_[_0xfcf9('0x2b')](_0x44f3d1,_0xfcf9('0x28'));_0x2e9bbd['query']=_[_0xfcf9('0x2f')](_0xb4abd1[_0xfcf9('0x30')]);_0x2e9bbd[_0xfcf9('0x31')]=_['intersection'](_0x2e9bbd['model'],_0x2e9bbd[_0xfcf9('0x30')]);_0x3b9088['attributes']=_['intersection'](_0x2e9bbd[_0xfcf9('0x32')],qs['fields'](_0xb4abd1[_0xfcf9('0x30')]['fields']));_0x3b9088['attributes']=_0x3b9088['attributes'][_0xfcf9('0x33')]?_0x3b9088['attributes']:_0x2e9bbd[_0xfcf9('0x32')];if(!_0xb4abd1[_0xfcf9('0x30')][_0xfcf9('0x34')]('nolimit')){_0x3b9088['limit']=qs[_0xfcf9('0x1d')](_0xb4abd1[_0xfcf9('0x30')]['limit']);_0x3b9088['offset']=qs[_0xfcf9('0x1a')](_0xb4abd1[_0xfcf9('0x30')][_0xfcf9('0x1a')]);}_0x3b9088[_0xfcf9('0x35')]=qs['sort'](_0xb4abd1[_0xfcf9('0x30')][_0xfcf9('0x36')]);_0x3b9088[_0xfcf9('0x37')]=qs[_0xfcf9('0x31')](_[_0xfcf9('0x38')](_0xb4abd1[_0xfcf9('0x30')],_0x2e9bbd[_0xfcf9('0x31')]),_0x44f3d1);if(_0xb4abd1[_0xfcf9('0x30')][_0xfcf9('0x39')]){_0x3b9088[_0xfcf9('0x37')]=_[_0xfcf9('0x3a')](_0x3b9088['where'],{'$or':_['map'](_0x44f3d1,function(_0x2d063a){if(_0x2d063a['type']!==_0xfcf9('0x3b')){var _0x323d8c={};_0x323d8c[_0x2d063a[_0xfcf9('0x28')]]={'$like':'%'+_0xb4abd1[_0xfcf9('0x30')][_0xfcf9('0x39')]+'%'};return _0x323d8c;}})});}_0x3b9088=_[_0xfcf9('0x3a')]({},_0x3b9088,_0xb4abd1['options']);var _0x44e1ab={'where':_0x3b9088[_0xfcf9('0x37')]};return db['VoiceTransferReport'][_0xfcf9('0x1c')](_0x44e1ab)[_0xfcf9('0x25')](function(_0x199208){_0x3b176e[_0xfcf9('0x1c')]=_0x199208;if(_0xb4abd1[_0xfcf9('0x30')][_0xfcf9('0x3c')]){_0x3b9088[_0xfcf9('0x3d')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0xfcf9('0x3e')](_0x3b9088);})[_0xfcf9('0x25')](function(_0x802770){_0x3b176e[_0xfcf9('0x3f')]=_0x802770;return _0x3b176e;})[_0xfcf9('0x25')](respondWithFilteredResult(_0x3e3ae3,_0x3b9088))['catch'](handleError(_0x3e3ae3,null));};exports[_0xfcf9('0x40')]=function(_0x1a537d,_0x57f79e){var _0x3db653={'raw':!![],'where':{'id':_0x1a537d['params']['id']}},_0x21c82c={};_0x21c82c['model']=_[_0xfcf9('0x2f')](db['VoiceTransferReport'][_0xfcf9('0x41')]);_0x21c82c[_0xfcf9('0x30')]=_[_0xfcf9('0x2f')](_0x1a537d[_0xfcf9('0x30')]);_0x21c82c[_0xfcf9('0x31')]=_[_0xfcf9('0x42')](_0x21c82c['model'],_0x21c82c[_0xfcf9('0x30')]);_0x3db653[_0xfcf9('0x43')]=_[_0xfcf9('0x42')](_0x21c82c['model'],qs[_0xfcf9('0x44')](_0x1a537d['query'][_0xfcf9('0x44')]));_0x3db653[_0xfcf9('0x43')]=_0x3db653['attributes'][_0xfcf9('0x33')]?_0x3db653[_0xfcf9('0x43')]:_0x21c82c[_0xfcf9('0x32')];if(_0x1a537d[_0xfcf9('0x30')][_0xfcf9('0x3c')]){_0x3db653[_0xfcf9('0x3d')]=[{'all':!![]}];}_0x3db653=_[_0xfcf9('0x3a')]({},_0x3db653,_0x1a537d['options']);return db[_0xfcf9('0x45')]['find'](_0x3db653)[_0xfcf9('0x25')](handleEntityNotFound(_0x57f79e,null))[_0xfcf9('0x25')](respondWithResult(_0x57f79e,null))[_0xfcf9('0x46')](handleError(_0x57f79e,null));};exports[_0xfcf9('0x47')]=function(_0x23c226,_0x34fc5e){return db[_0xfcf9('0x45')][_0xfcf9('0x47')](_0x23c226[_0xfcf9('0x48')],{})[_0xfcf9('0x25')](respondWithResult(_0x34fc5e,0xc9))[_0xfcf9('0x46')](handleError(_0x34fc5e,null));};exports[_0xfcf9('0x23')]=function(_0x26eec4,_0x2ab9eb){if(_0x26eec4[_0xfcf9('0x48')]['id']){delete _0x26eec4[_0xfcf9('0x48')]['id'];}return db[_0xfcf9('0x45')][_0xfcf9('0x49')]({'where':{'id':_0x26eec4[_0xfcf9('0x4a')]['id']}})[_0xfcf9('0x25')](handleEntityNotFound(_0x2ab9eb,null))[_0xfcf9('0x25')](saveUpdates(_0x26eec4[_0xfcf9('0x48')],null))[_0xfcf9('0x25')](respondWithResult(_0x2ab9eb,null))[_0xfcf9('0x46')](handleError(_0x2ab9eb,null));};exports[_0xfcf9('0x24')]=function(_0x239d97,_0x36c24b){return db[_0xfcf9('0x45')][_0xfcf9('0x49')]({'where':{'id':_0x239d97['params']['id']}})[_0xfcf9('0x25')](handleEntityNotFound(_0x36c24b,null))[_0xfcf9('0x25')](removeEntity(_0x36c24b,null))[_0xfcf9('0x46')](handleError(_0x36c24b,null));};exports[_0xfcf9('0x4b')]=function(_0x4c4786,_0x3a9ab4){return db[_0xfcf9('0x45')][_0xfcf9('0x4b')]()[_0xfcf9('0x25')](respondWithResult(_0x3a9ab4,null))['catch'](handleError(_0x3a9ab4,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 0126a14..2fd73d9 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 _0xa972=['VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xa972,0x1a6));var _0x2a97=function(_0x1ce649,_0x58115a){_0x1ce649=_0x1ce649-0x0;var _0xd83351=_0xa972[_0x1ce649];return _0xd83351;};'use strict';var _=require(_0x2a97('0x0'));var util=require(_0x2a97('0x1'));var logger=require(_0x2a97('0x2'))(_0x2a97('0x3'));var moment=require(_0x2a97('0x4'));var BPromise=require('bluebird');var rp=require(_0x2a97('0x5'));var fs=require('fs');var path=require(_0x2a97('0x6'));var rimraf=require(_0x2a97('0x7'));var config=require(_0x2a97('0x8'));var attributes=require(_0x2a97('0x9'));module[_0x2a97('0xa')]=function(_0x5e927d,_0x13b769){return _0x5e927d[_0x2a97('0xb')](_0x2a97('0xc'),attributes,{'tableName':_0x2a97('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xde1a=['../../config/logger','moment','request-promise','rimraf','./voiceTransferReport.attributes','define','VoiceTransferReport','report_call_transfer','util'];(function(_0x39ce42,_0x433108){var _0x350573=function(_0x4ecc4a){while(--_0x4ecc4a){_0x39ce42['push'](_0x39ce42['shift']());}};_0x350573(++_0x433108);}(_0xde1a,0x7d));var _0xade1=function(_0x428a14,_0x510f26){_0x428a14=_0x428a14-0x0;var _0x73b385=_0xde1a[_0x428a14];return _0x73b385;};'use strict';var _=require('lodash');var util=require(_0xade1('0x0'));var logger=require(_0xade1('0x1'))('api');var moment=require(_0xade1('0x2'));var BPromise=require('bluebird');var rp=require(_0xade1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xade1('0x4'));var config=require('../../config/environment');var attributes=require(_0xade1('0x5'));module['exports']=function(_0xbefc0d,_0x537e99){return _0xbefc0d[_0xade1('0x6')](_0xade1('0x7'),attributes,{'tableName':_0xade1('0x8'),'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 6145257..aa5f92a 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 _0x82a1=['request','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','options','raw','then','CreateVoiceTransferReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise'];(function(_0x4477a8,_0x301586){var _0x236935=function(_0x2acfb8){while(--_0x2acfb8){_0x4477a8['push'](_0x4477a8['shift']());}};_0x236935(++_0x301586);}(_0x82a1,0x1c6));var _0x182a=function(_0x2d65ea,_0x359335){_0x2d65ea=_0x2d65ea-0x0;var _0x584532=_0x82a1[_0x2d65ea];return _0x584532;};'use strict';var _=require('lodash');var util=require(_0x182a('0x0'));var moment=require(_0x182a('0x1'));var BPromise=require(_0x182a('0x2'));var rs=require(_0x182a('0x3'));var fs=require('fs');var Redis=require(_0x182a('0x4'));var db=require(_0x182a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x182a('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x182a('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x539882,_0x2cac23,_0x4b7767){return new BPromise(function(_0x5ea1e2,_0x55975b){return client[_0x182a('0x8')](_0x539882,_0x4b7767)['then'](function(_0x42ca6f){logger[_0x182a('0x9')](_0x182a('0xa'),_0x2cac23,_0x182a('0xb'));logger[_0x182a('0xc')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x2cac23,_0x182a('0xb'),JSON[_0x182a('0xd')](_0x42ca6f));if(_0x42ca6f[_0x182a('0xe')]){if(_0x42ca6f[_0x182a('0xe')]['code']===0x1f4){logger['error'](_0x182a('0xa'),_0x2cac23,_0x42ca6f[_0x182a('0xe')]['message']);return _0x55975b(_0x42ca6f['error'][_0x182a('0xf')]);}logger[_0x182a('0xe')](_0x182a('0xa'),_0x2cac23,_0x42ca6f[_0x182a('0xe')][_0x182a('0xf')]);return _0x5ea1e2(_0x42ca6f[_0x182a('0xe')]['message']);}else{logger[_0x182a('0x9')](_0x182a('0xa'),_0x2cac23,_0x182a('0xb'));_0x5ea1e2(_0x42ca6f[_0x182a('0x10')][_0x182a('0xf')]);}})[_0x182a('0x11')](function(_0x3c3460){logger['error'](_0x182a('0xa'),_0x2cac23,_0x3c3460);_0x55975b(_0x3c3460);});});}exports['CreateVoiceTransferReport']=function(_0x5ddd00){var _0x234527=this;return new Promise(function(_0x267fb3,_0xd03173){return db['VoiceTransferReport']['create'](_0x5ddd00['body'],{'raw':_0x5ddd00['options']?_0x5ddd00[_0x182a('0x12')][_0x182a('0x13')]===undefined?!![]:![]:!![]})[_0x182a('0x14')](function(_0x1ed5ab){logger[_0x182a('0x9')]('CreateVoiceTransferReport',_0x5ddd00);logger['debug'](_0x182a('0x15'),_0x5ddd00,JSON[_0x182a('0xd')](_0x1ed5ab));_0x267fb3(_0x1ed5ab);})['catch'](function(_0x451bcd){logger['error'](_0x182a('0x15'),_0x451bcd[_0x182a('0xf')],_0x5ddd00);_0xd03173(_0x234527[_0x182a('0xe')](0x1f4,_0x451bcd[_0x182a('0xf')]));});});}; \ No newline at end of file +var _0x86af=['../../config/logger','jayson/promise','client','http','request','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','CreateVoiceTransferReport','VoiceTransferReport','body','options','lodash','moment','randomstring','ioredis'];(function(_0x163e8c,_0x563bda){var _0x295821=function(_0x1be529){while(--_0x1be529){_0x163e8c['push'](_0x163e8c['shift']());}};_0x295821(++_0x563bda);}(_0x86af,0x80));var _0xf86a=function(_0x57d953,_0x312449){_0x57d953=_0x57d953-0x0;var _0x11924a=_0x86af[_0x57d953];return _0x11924a;};'use strict';var _=require(_0xf86a('0x0'));var util=require('util');var moment=require(_0xf86a('0x1'));var BPromise=require('bluebird');var rs=require(_0xf86a('0x2'));var fs=require('fs');var Redis=require(_0xf86a('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf86a('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf86a('0x5'));var client=jayson[_0xf86a('0x6')][_0xf86a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x7b3800,_0xa016fb,_0x2da30e){return new BPromise(function(_0x24f55b,_0x51251e){return client[_0xf86a('0x8')](_0x7b3800,_0x2da30e)[_0xf86a('0x9')](function(_0x28949e){logger['info'](_0xf86a('0xa'),_0xa016fb,_0xf86a('0xb'));logger['debug']('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0xa016fb,'request\x20sent',JSON[_0xf86a('0xc')](_0x28949e));if(_0x28949e[_0xf86a('0xd')]){if(_0x28949e[_0xf86a('0xd')][_0xf86a('0xe')]===0x1f4){logger[_0xf86a('0xd')](_0xf86a('0xa'),_0xa016fb,_0x28949e[_0xf86a('0xd')][_0xf86a('0xf')]);return _0x51251e(_0x28949e[_0xf86a('0xd')][_0xf86a('0xf')]);}logger[_0xf86a('0xd')](_0xf86a('0xa'),_0xa016fb,_0x28949e[_0xf86a('0xd')][_0xf86a('0xf')]);return _0x24f55b(_0x28949e[_0xf86a('0xd')][_0xf86a('0xf')]);}else{logger[_0xf86a('0x10')](_0xf86a('0xa'),_0xa016fb,'request\x20sent');_0x24f55b(_0x28949e['result'][_0xf86a('0xf')]);}})[_0xf86a('0x11')](function(_0x7191dc){logger[_0xf86a('0xd')](_0xf86a('0xa'),_0xa016fb,_0x7191dc);_0x51251e(_0x7191dc);});});}exports[_0xf86a('0x12')]=function(_0x21ad6b){var _0x518ff6=this;return new Promise(function(_0x1019d1,_0x38cddb){return db[_0xf86a('0x13')]['create'](_0x21ad6b[_0xf86a('0x14')],{'raw':_0x21ad6b[_0xf86a('0x15')]?_0x21ad6b[_0xf86a('0x15')]['raw']===undefined?!![]:![]:!![]})[_0xf86a('0x9')](function(_0x29ac8a){logger[_0xf86a('0x10')]('CreateVoiceTransferReport',_0x21ad6b);logger['debug'](_0xf86a('0x12'),_0x21ad6b,JSON[_0xf86a('0xc')](_0x29ac8a));_0x1019d1(_0x29ac8a);})[_0xf86a('0x11')](function(_0x186972){logger[_0xf86a('0xd')](_0xf86a('0x12'),_0x186972[_0xf86a('0xf')],_0x21ad6b);_0x38cddb(_0x518ff6['error'](0x1f4,_0x186972[_0xf86a('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 941f968..8d46622 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 _0xf109=['/transfer','transfer','express','Router','../../components/auth/service','isAuthenticated','isWebrtcLicence','originate','post','/hangup','hangup','/answer','answer','/hold','/unhold','/calls','calls'];(function(_0x4c065a,_0x540016){var _0x28dda6=function(_0x4bff71){while(--_0x4bff71){_0x4c065a['push'](_0x4c065a['shift']());}};_0x28dda6(++_0x540016);}(_0xf109,0xce));var _0x9f10=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0xf109[_0x616290];return _0x453879;};'use strict';var express=require(_0x9f10('0x0'));var router=express[_0x9f10('0x1')]();var auth=require(_0x9f10('0x2'));var controller=require('./webbar.controller');router['post']('/originate',auth[_0x9f10('0x3')](),auth[_0x9f10('0x4')](),controller[_0x9f10('0x5')]);router[_0x9f10('0x6')](_0x9f10('0x7'),auth[_0x9f10('0x3')](),auth[_0x9f10('0x4')](),controller[_0x9f10('0x8')]);router[_0x9f10('0x6')](_0x9f10('0x9'),auth[_0x9f10('0x3')](),auth['isWebrtcLicence'](),controller[_0x9f10('0xa')]);router[_0x9f10('0x6')](_0x9f10('0xb'),auth[_0x9f10('0x3')](),auth[_0x9f10('0x4')](),controller['hold']);router[_0x9f10('0x6')](_0x9f10('0xc'),auth[_0x9f10('0x3')](),auth['isWebrtcLicence'](),controller['unhold']);router[_0x9f10('0x6')](_0x9f10('0xd'),auth[_0x9f10('0x3')](),auth['isWebrtcLicence'](),controller[_0x9f10('0xe')]);router[_0x9f10('0x6')](_0x9f10('0xf'),auth['isAuthenticated'](),auth[_0x9f10('0x4')](),controller[_0x9f10('0x10')]);module['exports']=router; \ No newline at end of file +var _0xcb91=['/unhold','unhold','/calls','transfer','exports','../../components/auth/service','./webbar.controller','post','/originate','isWebrtcLicence','originate','/hangup','isAuthenticated','hangup','hold'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x95411e,_0x38b4c3){_0x95411e=_0x95411e-0x0;var _0x2c8718=_0xcb91[_0x95411e];return _0x2c8718;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x1cb9('0x0'));var controller=require(_0x1cb9('0x1'));router[_0x1cb9('0x2')](_0x1cb9('0x3'),auth['isAuthenticated'](),auth[_0x1cb9('0x4')](),controller[_0x1cb9('0x5')]);router['post'](_0x1cb9('0x6'),auth[_0x1cb9('0x7')](),auth['isWebrtcLicence'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x2')]('/answer',auth[_0x1cb9('0x7')](),auth[_0x1cb9('0x4')](),controller['answer']);router[_0x1cb9('0x2')]('/hold',auth['isAuthenticated'](),auth[_0x1cb9('0x4')](),controller[_0x1cb9('0x9')]);router[_0x1cb9('0x2')](_0x1cb9('0xa'),auth[_0x1cb9('0x7')](),auth['isWebrtcLicence'](),controller[_0x1cb9('0xb')]);router[_0x1cb9('0x2')](_0x1cb9('0xc'),auth[_0x1cb9('0x7')](),auth[_0x1cb9('0x4')](),controller['calls']);router['post']('/transfer',auth[_0x1cb9('0x7')](),auth[_0x1cb9('0x4')](),controller[_0x1cb9('0xd')]);module[_0x1cb9('0xe')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index acf546f..876fdc0 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 _0xb903=['answer\x20fired:','webbar:answer','answer\x20executed!','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','calls','conference','conference\x20fired:','webbar:conference','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','defaults','socket.io-emitter','redis','validate','number','userId\x20is\x20required','string','sessionId\x20is\x20required','stringify','emit','log','handleError:','error','name','status','send','NotFound','then','code','message','result','catch','User','findOne','agent','VoiceChannels','all','filter','rows','UserId','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','json','userId','callerId','info','format','user:%s','webbar:originate','hangup','hangup\x20fired:','length','sessionId','entityFound:','webbar:hangup','hangup\x20executed!','answer'];(function(_0x26c03b,_0x208848){var _0x17f6fc=function(_0x958c38){while(--_0x958c38){_0x26c03b['push'](_0x26c03b['shift']());}};_0x17f6fc(++_0x208848);}(_0xb903,0x185));var _0x3b90=function(_0xd38e9c,_0x96c284){_0xd38e9c=_0xd38e9c-0x0;var _0x3d27c6=_0xb903[_0xd38e9c];return _0x3d27c6;};'use strict';var path=require(_0x3b90('0x0'));var fs=require('fs');var _=require(_0x3b90('0x1'));var db=require(_0x3b90('0x2'))['db'];var config=require(_0x3b90('0x3'));var util=require('util');var BPromise=require(_0x3b90('0x4'));var jayson=require(_0x3b90('0x5'));var amiClient=jayson[_0x3b90('0x6')][_0x3b90('0x7')]({'port':0x232a});var logger=require(_0x3b90('0x8'))(_0x3b90('0x9'));var Redis=require(_0x3b90('0xa'));config['redis']=_[_0x3b90('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x3b90('0xc'))(new Redis(config[_0x3b90('0xd')]));var Schema=require(_0x3b90('0xe'));var originateValidation=new Schema({'userId':{'type':_0x3b90('0xf'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':'string','required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':'string'},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],_0x3b90('0x10')]},'sessionId':{'type':_0x3b90('0x11'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0x3b90('0x10')]},'sessionId':{'type':_0x3b90('0x11'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0x3b90('0x10')]},'sessionId':{'type':_0x3b90('0x11'),'required':[!![],_0x3b90('0x12')]},'transferNumber':{'type':'string','required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0x3b90('0xf'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x3b90('0xf'),'required':[!![],_0x3b90('0x10')]},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0x3b90('0x10')]}});var conferenceValidation=new Schema({'userId':{'type':_0x3b90('0xf'),'required':[!![],_0x3b90('0x10')]}});function emit(_0x1af265,_0x1efe01,_0x529421){logger['info'](_0x1af265,_0x1efe01,JSON[_0x3b90('0x13')](_0x529421));io['to'](_0x1af265)[_0x3b90('0x14')](_0x1efe01,_0x529421);}function handleError(_0x4e9120){return function(_0x269488){console[_0x3b90('0x15')](_0x3b90('0x16'),_0x269488,_0x269488 instanceof RangeError);logger[_0x3b90('0x17')](_0x269488['stack']);if(_0x269488 instanceof RangeError){if(_0x269488[_0x3b90('0x18')]){delete _0x269488['name'];}_0x4e9120[_0x3b90('0x19')](0x194)[_0x3b90('0x1a')](_0x269488);}else{if(_0x269488['name']){delete _0x269488[_0x3b90('0x18')];}_0x4e9120[_0x3b90('0x19')](0x1f4)[_0x3b90('0x1a')](_0x269488);}};}function checkError(){return function(_0x3ce411){if(!_0x3ce411){throw new RangeError(_0x3b90('0x1b'));}return _0x3ce411;};}function respondWithRpcPromise(_0x43deca,_0x3bc7d5){return new BPromise(function(_0x2f4270,_0xa98414){var _0x3e5bb8=amiClient;return _0x3e5bb8['request'](_0x43deca,_0x3bc7d5)[_0x3b90('0x1c')](function(_0x36b93e){if(_0x36b93e[_0x3b90('0x17')]){if(_0x36b93e[_0x3b90('0x17')][_0x3b90('0x1d')]===0x1f4){return _0xa98414(_0x36b93e[_0x3b90('0x17')]['message']);}return _0x2f4270(_0x36b93e['error'][_0x3b90('0x1e')]);}else{_0x2f4270(_0x36b93e[_0x3b90('0x1f')]);}})[_0x3b90('0x20')](function(_0x2ffa1a){_0xa98414(_0x2ffa1a);});});}function getAgent(_0x583523){return db[_0x3b90('0x21')][_0x3b90('0x22')]({'where':{'id':_0x583523,'role':_0x3b90('0x23')}})['then'](checkError());}function getAgentCheckSession(_0x14752c,_0x138d79){return new BPromise(function(_0x17ec7f,_0x33c07a){var _0x153d7c=respondWithRpcPromise(_0x3b90('0x24'));var _0x4b4d33=getAgent(_0x14752c);Promise[_0x3b90('0x25')]([_0x153d7c,_0x4b4d33])['then'](function(_0xaf453c){var _0x9891e4=_0xaf453c[0x0];var _0x1a193e=_0xaf453c[0x1];var _0x38eed0=_[_0x3b90('0x26')](_0x9891e4[_0x3b90('0x27')],function(_0x290283){return _0x290283[_0x3b90('0x28')]==_0x1a193e['id']&&_0x290283['sessionId']==_0x138d79;});if(_0x38eed0['length']==0x1){_0x17ec7f(_0x1a193e);}else{_0x33c07a(new RangeError(_0x3b90('0x29')+_0x138d79+_0x3b90('0x2a')));}});});}exports[_0x3b90('0x2b')]=function(_0x1c2e84,_0x522ede){logger['info'](_0x3b90('0x2c'),_0x1c2e84[_0x3b90('0x2d')]);var _0x24d5c9=originateValidation['validate'](_0x1c2e84[_0x3b90('0x2d')]);if(_0x24d5c9['length']>0x0){return _0x522ede['status'](0x190)[_0x3b90('0x2e')](_0x24d5c9);}var _0x3fbc03=_0x1c2e84['body'][_0x3b90('0x2f')];var _0x3d9605=_0x1c2e84[_0x3b90('0x2d')]['callNumber'];var _0x47cd8f=_0x1c2e84[_0x3b90('0x2d')][_0x3b90('0x30')];var _0x64a5e=_0x1c2e84[_0x3b90('0x2d')]['callbackUrl'];return getAgent(_0x3fbc03)['then'](function(_0x25ff34){logger[_0x3b90('0x31')]('entityFound:',_0x25ff34['name']);emit(util[_0x3b90('0x32')](_0x3b90('0x33'),_0x25ff34[_0x3b90('0x18')]),_0x3b90('0x34'),{'callNumber':_0x3d9605,'callerId':_0x47cd8f,'callbackUrl':_0x64a5e});return _0x522ede['status'](0xc8)[_0x3b90('0x2e')]({'error':![],'message':'originate\x20executed!'});})[_0x3b90('0x20')](handleError(_0x522ede));};exports[_0x3b90('0x35')]=function(_0x2355bf,_0x20abf8){logger[_0x3b90('0x31')](_0x3b90('0x36'),_0x2355bf[_0x3b90('0x2d')]);var _0x534bea=hangupValidation[_0x3b90('0xe')](_0x2355bf[_0x3b90('0x2d')]);if(_0x534bea[_0x3b90('0x37')]>0x0){return _0x20abf8[_0x3b90('0x19')](0x190)[_0x3b90('0x2e')](_0x534bea);}var _0x390952=_0x2355bf[_0x3b90('0x2d')][_0x3b90('0x2f')];var _0x356e14=_0x2355bf['body'][_0x3b90('0x38')];return getAgent(_0x390952)[_0x3b90('0x1c')](function(_0x40ce3a){logger[_0x3b90('0x31')](_0x3b90('0x39'),_0x40ce3a[_0x3b90('0x18')]);emit(util[_0x3b90('0x32')](_0x3b90('0x33'),_0x40ce3a[_0x3b90('0x18')]),_0x3b90('0x3a'),{'sessionId':_0x356e14});return _0x20abf8[_0x3b90('0x19')](0xc8)[_0x3b90('0x2e')]({'error':![],'message':_0x3b90('0x3b')});})[_0x3b90('0x20')](handleError(_0x20abf8));};exports[_0x3b90('0x3c')]=function(_0x3d2680,_0x3a27cf){logger[_0x3b90('0x31')](_0x3b90('0x3d'),_0x3d2680[_0x3b90('0x2d')]);var _0x11698a=answerValidation['validate'](_0x3d2680[_0x3b90('0x2d')]);if(_0x11698a[_0x3b90('0x37')]>0x0){return _0x3a27cf[_0x3b90('0x19')](0x190)[_0x3b90('0x2e')](_0x11698a);}var _0x5a48a9=_0x3d2680[_0x3b90('0x2d')]['userId'];var _0x564907=_0x3d2680[_0x3b90('0x2d')][_0x3b90('0x38')];return getAgent(_0x5a48a9)['then'](function(_0x1412b3){logger[_0x3b90('0x31')](_0x3b90('0x39'),_0x1412b3[_0x3b90('0x18')]);emit(util[_0x3b90('0x32')](_0x3b90('0x33'),_0x1412b3[_0x3b90('0x18')]),_0x3b90('0x3e'),{'sessionId':_0x564907});return _0x3a27cf[_0x3b90('0x19')](0xc8)['json']({'error':![],'message':_0x3b90('0x3f')});})[_0x3b90('0x20')](handleError(_0x3a27cf));};exports['hold']=function(_0x1e9a21,_0x12e061){logger[_0x3b90('0x31')](_0x3b90('0x40'),_0x1e9a21[_0x3b90('0x2d')]);var _0x4908ea=holdValidation['validate'](_0x1e9a21[_0x3b90('0x2d')]);if(_0x4908ea['length']>0x0){return _0x12e061[_0x3b90('0x19')](0x190)[_0x3b90('0x2e')](_0x4908ea);}var _0x330002=_0x1e9a21[_0x3b90('0x2d')][_0x3b90('0x2f')];var _0x4b1634=_0x1e9a21['body'][_0x3b90('0x38')];return getAgent(_0x330002)[_0x3b90('0x1c')](function(_0x9e2ee5){logger['info'](_0x3b90('0x39'),_0x9e2ee5[_0x3b90('0x18')]);emit(util[_0x3b90('0x32')](_0x3b90('0x33'),_0x9e2ee5[_0x3b90('0x18')]),_0x3b90('0x41'),{'sessionId':_0x4b1634});return _0x12e061[_0x3b90('0x19')](0xc8)[_0x3b90('0x2e')]({'error':![],'message':_0x3b90('0x42')});})['catch'](handleError(_0x12e061));};exports[_0x3b90('0x43')]=function(_0x407784,_0x2b5b6f){logger['info'](_0x3b90('0x44'),_0x407784['body']);var _0x288fbb=unholdValidation[_0x3b90('0xe')](_0x407784[_0x3b90('0x2d')]);if(_0x288fbb['length']>0x0){return _0x2b5b6f[_0x3b90('0x19')](0x190)[_0x3b90('0x2e')](_0x288fbb);}var _0x5334b5=_0x407784['body'][_0x3b90('0x2f')];var _0x24337e=_0x407784[_0x3b90('0x2d')][_0x3b90('0x38')];return getAgent(_0x5334b5)['then'](function(_0x5ee7e2){logger[_0x3b90('0x31')](_0x3b90('0x39'),_0x5ee7e2[_0x3b90('0x18')]);emit(util[_0x3b90('0x32')](_0x3b90('0x33'),_0x5ee7e2[_0x3b90('0x18')]),_0x3b90('0x45'),{'sessionId':_0x24337e});return _0x2b5b6f[_0x3b90('0x19')](0xc8)[_0x3b90('0x2e')]({'error':![],'message':'unhold\x20executed!'});})[_0x3b90('0x20')](handleError(_0x2b5b6f));};exports[_0x3b90('0x46')]=function(_0x54243d,_0x1d211a){logger[_0x3b90('0x31')]('calls\x20fired:',_0x1d211a[_0x3b90('0x2d')]);var _0x16c30f=callsValidation[_0x3b90('0xe')](_0x54243d[_0x3b90('0x2d')]);if(_0x16c30f[_0x3b90('0x37')]>0x0){return _0x1d211a[_0x3b90('0x19')](0x190)[_0x3b90('0x2e')](_0x16c30f);}var _0x47c9d1=_0x54243d[_0x3b90('0x2d')][_0x3b90('0x2f')];var _0x32a179=respondWithRpcPromise(_0x3b90('0x24'));var _0x110411=getAgent(_0x47c9d1);return Promise[_0x3b90('0x25')]([_0x32a179,_0x110411])[_0x3b90('0x1c')](function(_0x34acd6){var _0x28ec05=_0x34acd6[0x0];var _0x3febfc=_0x34acd6[0x1];var _0x1b6662=_[_0x3b90('0x26')](_0x28ec05[_0x3b90('0x27')],function(_0x15f741){return _0x15f741[_0x3b90('0x28')]==_0x3febfc['id'];});return _0x1d211a['status'](0xc8)[_0x3b90('0x2e')]({'count':_0x1b6662['length'],'rows':_0x1b6662});})[_0x3b90('0x20')](handleError(_0x1d211a));};exports[_0x3b90('0x47')]=function(_0x25bdb2,_0x1bce2a){logger[_0x3b90('0x31')](_0x3b90('0x48'),_0x25bdb2['body']);var _0x35af6e=conferenceValidation[_0x3b90('0xe')](_0x25bdb2[_0x3b90('0x2d')]);if(_0x35af6e[_0x3b90('0x37')]>0x0){return _0x1bce2a[_0x3b90('0x19')](0x190)[_0x3b90('0x2e')](_0x35af6e);}var _0x5c7605=_0x25bdb2[_0x3b90('0x2d')][_0x3b90('0x2f')];return getAgent(_0x5c7605)[_0x3b90('0x1c')](function(_0x536da7){logger[_0x3b90('0x31')](_0x3b90('0x39'),_0x536da7[_0x3b90('0x18')]);emit(util[_0x3b90('0x32')](_0x3b90('0x33'),_0x536da7[_0x3b90('0x18')]),_0x3b90('0x49'));return _0x1bce2a[_0x3b90('0x19')](0xc8)[_0x3b90('0x2e')]({'error':![],'message':'conference\x20executed!'});})[_0x3b90('0x20')](handleError(_0x1bce2a));};exports['transfer']=function(_0x53d2d3,_0x3c29e0){logger[_0x3b90('0x31')]('transfer\x20fired:',_0x53d2d3[_0x3b90('0x2d')]);var _0x1a2592=transferValidation[_0x3b90('0xe')](_0x53d2d3[_0x3b90('0x2d')]);if(_0x1a2592[_0x3b90('0x37')]>0x0){return _0x3c29e0[_0x3b90('0x19')](0x190)[_0x3b90('0x2e')](_0x1a2592);}var _0x5441c4=_0x53d2d3['body'][_0x3b90('0x2f')];var _0x5e5efa=_0x53d2d3[_0x3b90('0x2d')]['sessionId'];var _0x1a6d33=_0x53d2d3['body']['transferNumber'];return getAgent(_0x5441c4)['then'](function(_0x2378ac){logger[_0x3b90('0x31')](_0x3b90('0x39'),_0x2378ac[_0x3b90('0x18')]);emit(util[_0x3b90('0x32')](_0x3b90('0x33'),_0x2378ac[_0x3b90('0x18')]),'webbar:transfer',{'sessionId':_0x5e5efa,'transferNumber':_0x1a6d33});return _0x3c29e0['status'](0xc8)['json']({'error':![],'message':_0x3b90('0x4a')});})[_0x3b90('0x20')](handleError(_0x3c29e0));}; \ No newline at end of file +var _0x76dc=['agent','VoiceChannels','all','rows','UserId','sessionId','sessionId\x20','originate','info','body','length','json','userId','callerId','format','user:%s','webbar:originate','originate\x20executed!','hangup','entityFound:','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','calls','filter','conference\x20fired:','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','bluebird','jayson/promise','http','ioredis','redis','defaults','socket.io-emitter','validate','string','callNumber\x20is\x20required','userId\x20is\x20required','number','sessionId\x20is\x20required','transferNumber\x20is\x20required','emit','log','handleError:','stack','name','status','send','NotFound','request','then','error','code','message','catch','User','findOne'];(function(_0x829d5d,_0x520c80){var _0x13df56=function(_0x1acdb4){while(--_0x1acdb4){_0x829d5d['push'](_0x829d5d['shift']());}};_0x13df56(++_0x520c80);}(_0x76dc,0x1f2));var _0xc76d=function(_0x4b150e,_0x192d6d){_0x4b150e=_0x4b150e-0x0;var _0x17d1ae=_0x76dc[_0x4b150e];return _0x17d1ae;};'use strict';var path=require(_0xc76d('0x0'));var fs=require('fs');var _=require(_0xc76d('0x1'));var db=require(_0xc76d('0x2'))['db'];var config=require(_0xc76d('0x3'));var util=require('util');var BPromise=require(_0xc76d('0x4'));var jayson=require(_0xc76d('0x5'));var amiClient=jayson['client'][_0xc76d('0x6')]({'port':0x232a});var logger=require('../../config/logger')('webbarapi');var Redis=require(_0xc76d('0x7'));config[_0xc76d('0x8')]=_[_0xc76d('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xc76d('0xa'))(new Redis(config[_0xc76d('0x8')]));var Schema=require(_0xc76d('0xb'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0xc76d('0xc'),'required':[!![],_0xc76d('0xd')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0xc76d('0xc')}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],_0xc76d('0xe')]},'sessionId':{'type':_0xc76d('0xc'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xc76d('0xf'),'required':[!![],_0xc76d('0xe')]},'sessionId':{'type':_0xc76d('0xc'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xc76d('0xf'),'required':[!![],_0xc76d('0xe')]},'sessionId':{'type':_0xc76d('0xc'),'required':[!![],_0xc76d('0x10')]},'transferNumber':{'type':_0xc76d('0xc'),'required':[!![],_0xc76d('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0xc76d('0xf'),'required':[!![],_0xc76d('0xe')]},'sessionId':{'type':_0xc76d('0xc'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xc76d('0xe')]},'sessionId':{'type':_0xc76d('0xc'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0xc76d('0xe')]}});var conferenceValidation=new Schema({'userId':{'type':_0xc76d('0xf'),'required':[!![],_0xc76d('0xe')]}});function emit(_0x6f94e,_0x5c680c,_0x32e0a8){logger['info'](_0x6f94e,_0x5c680c,JSON['stringify'](_0x32e0a8));io['to'](_0x6f94e)[_0xc76d('0x12')](_0x5c680c,_0x32e0a8);}function handleError(_0x31b032){return function(_0x339623){console[_0xc76d('0x13')](_0xc76d('0x14'),_0x339623,_0x339623 instanceof RangeError);logger['error'](_0x339623[_0xc76d('0x15')]);if(_0x339623 instanceof RangeError){if(_0x339623[_0xc76d('0x16')]){delete _0x339623[_0xc76d('0x16')];}_0x31b032[_0xc76d('0x17')](0x194)[_0xc76d('0x18')](_0x339623);}else{if(_0x339623['name']){delete _0x339623[_0xc76d('0x16')];}_0x31b032[_0xc76d('0x17')](0x1f4)['send'](_0x339623);}};}function checkError(){return function(_0x455371){if(!_0x455371){throw new RangeError(_0xc76d('0x19'));}return _0x455371;};}function respondWithRpcPromise(_0x191e97,_0xb89876){return new BPromise(function(_0x18f546,_0x3d357b){var _0x42b89c=amiClient;return _0x42b89c[_0xc76d('0x1a')](_0x191e97,_0xb89876)[_0xc76d('0x1b')](function(_0x20e09c){if(_0x20e09c[_0xc76d('0x1c')]){if(_0x20e09c['error'][_0xc76d('0x1d')]===0x1f4){return _0x3d357b(_0x20e09c[_0xc76d('0x1c')]['message']);}return _0x18f546(_0x20e09c[_0xc76d('0x1c')][_0xc76d('0x1e')]);}else{_0x18f546(_0x20e09c['result']);}})[_0xc76d('0x1f')](function(_0x476aee){_0x3d357b(_0x476aee);});});}function getAgent(_0x2cd06e){return db[_0xc76d('0x20')][_0xc76d('0x21')]({'where':{'id':_0x2cd06e,'role':_0xc76d('0x22')}})[_0xc76d('0x1b')](checkError());}function getAgentCheckSession(_0x59ebd1,_0x59dabf){return new BPromise(function(_0x285430,_0x287ae4){var _0x5069ea=respondWithRpcPromise(_0xc76d('0x23'));var _0x52a79a=getAgent(_0x59ebd1);Promise[_0xc76d('0x24')]([_0x5069ea,_0x52a79a])['then'](function(_0x2039f4){var _0x5cf2e4=_0x2039f4[0x0];var _0x13b468=_0x2039f4[0x1];var _0x18a7fa=_['filter'](_0x5cf2e4[_0xc76d('0x25')],function(_0x1c68f3){return _0x1c68f3[_0xc76d('0x26')]==_0x13b468['id']&&_0x1c68f3[_0xc76d('0x27')]==_0x59dabf;});if(_0x18a7fa['length']==0x1){_0x285430(_0x13b468);}else{_0x287ae4(new RangeError(_0xc76d('0x28')+_0x59dabf+'\x20not\x20found!'));}});});}exports[_0xc76d('0x29')]=function(_0x5e9233,_0x30769f){logger[_0xc76d('0x2a')]('originate\x20fired:',_0x5e9233['body']);var _0x5eca19=originateValidation['validate'](_0x5e9233[_0xc76d('0x2b')]);if(_0x5eca19[_0xc76d('0x2c')]>0x0){return _0x30769f[_0xc76d('0x17')](0x190)[_0xc76d('0x2d')](_0x5eca19);}var _0x1b2ed1=_0x5e9233['body'][_0xc76d('0x2e')];var _0x55e825=_0x5e9233[_0xc76d('0x2b')]['callNumber'];var _0x1bef44=_0x5e9233[_0xc76d('0x2b')][_0xc76d('0x2f')];var _0x20fe33=_0x5e9233[_0xc76d('0x2b')]['callbackUrl'];return getAgent(_0x1b2ed1)[_0xc76d('0x1b')](function(_0x371306){logger[_0xc76d('0x2a')]('entityFound:',_0x371306[_0xc76d('0x16')]);emit(util[_0xc76d('0x30')](_0xc76d('0x31'),_0x371306['name']),_0xc76d('0x32'),{'callNumber':_0x55e825,'callerId':_0x1bef44,'callbackUrl':_0x20fe33});return _0x30769f[_0xc76d('0x17')](0xc8)[_0xc76d('0x2d')]({'error':![],'message':_0xc76d('0x33')});})[_0xc76d('0x1f')](handleError(_0x30769f));};exports[_0xc76d('0x34')]=function(_0x579d93,_0x518945){logger[_0xc76d('0x2a')]('hangup\x20fired:',_0x579d93[_0xc76d('0x2b')]);var _0x359f38=hangupValidation[_0xc76d('0xb')](_0x579d93[_0xc76d('0x2b')]);if(_0x359f38['length']>0x0){return _0x518945['status'](0x190)[_0xc76d('0x2d')](_0x359f38);}var _0x20a456=_0x579d93[_0xc76d('0x2b')][_0xc76d('0x2e')];var _0x410029=_0x579d93['body'][_0xc76d('0x27')];return getAgent(_0x20a456)[_0xc76d('0x1b')](function(_0x321989){logger[_0xc76d('0x2a')](_0xc76d('0x35'),_0x321989[_0xc76d('0x16')]);emit(util[_0xc76d('0x30')](_0xc76d('0x31'),_0x321989[_0xc76d('0x16')]),_0xc76d('0x36'),{'sessionId':_0x410029});return _0x518945['status'](0xc8)['json']({'error':![],'message':_0xc76d('0x37')});})[_0xc76d('0x1f')](handleError(_0x518945));};exports[_0xc76d('0x38')]=function(_0x27bdff,_0x4ae994){logger['info'](_0xc76d('0x39'),_0x27bdff[_0xc76d('0x2b')]);var _0x3e471e=answerValidation[_0xc76d('0xb')](_0x27bdff[_0xc76d('0x2b')]);if(_0x3e471e[_0xc76d('0x2c')]>0x0){return _0x4ae994[_0xc76d('0x17')](0x190)[_0xc76d('0x2d')](_0x3e471e);}var _0x50e922=_0x27bdff[_0xc76d('0x2b')][_0xc76d('0x2e')];var _0x1bf8a0=_0x27bdff[_0xc76d('0x2b')]['sessionId'];return getAgent(_0x50e922)['then'](function(_0x4bf591){logger['info']('entityFound:',_0x4bf591['name']);emit(util['format'](_0xc76d('0x31'),_0x4bf591[_0xc76d('0x16')]),_0xc76d('0x3a'),{'sessionId':_0x1bf8a0});return _0x4ae994[_0xc76d('0x17')](0xc8)[_0xc76d('0x2d')]({'error':![],'message':_0xc76d('0x3b')});})[_0xc76d('0x1f')](handleError(_0x4ae994));};exports[_0xc76d('0x3c')]=function(_0x555f14,_0x462214){logger[_0xc76d('0x2a')](_0xc76d('0x3d'),_0x555f14[_0xc76d('0x2b')]);var _0xb9cca2=holdValidation[_0xc76d('0xb')](_0x555f14[_0xc76d('0x2b')]);if(_0xb9cca2[_0xc76d('0x2c')]>0x0){return _0x462214[_0xc76d('0x17')](0x190)['json'](_0xb9cca2);}var _0x5b41d3=_0x555f14[_0xc76d('0x2b')][_0xc76d('0x2e')];var _0x2fa905=_0x555f14[_0xc76d('0x2b')][_0xc76d('0x27')];return getAgent(_0x5b41d3)['then'](function(_0x25fc9d){logger[_0xc76d('0x2a')]('entityFound:',_0x25fc9d['name']);emit(util[_0xc76d('0x30')](_0xc76d('0x31'),_0x25fc9d['name']),_0xc76d('0x3e'),{'sessionId':_0x2fa905});return _0x462214[_0xc76d('0x17')](0xc8)[_0xc76d('0x2d')]({'error':![],'message':_0xc76d('0x3f')});})[_0xc76d('0x1f')](handleError(_0x462214));};exports[_0xc76d('0x40')]=function(_0x25a549,_0x10b1b0){logger[_0xc76d('0x2a')](_0xc76d('0x41'),_0x25a549['body']);var _0x4efd83=unholdValidation[_0xc76d('0xb')](_0x25a549[_0xc76d('0x2b')]);if(_0x4efd83['length']>0x0){return _0x10b1b0[_0xc76d('0x17')](0x190)[_0xc76d('0x2d')](_0x4efd83);}var _0x506b03=_0x25a549[_0xc76d('0x2b')]['userId'];var _0xe90d83=_0x25a549[_0xc76d('0x2b')][_0xc76d('0x27')];return getAgent(_0x506b03)[_0xc76d('0x1b')](function(_0x14ef42){logger['info']('entityFound:',_0x14ef42['name']);emit(util[_0xc76d('0x30')](_0xc76d('0x31'),_0x14ef42[_0xc76d('0x16')]),_0xc76d('0x42'),{'sessionId':_0xe90d83});return _0x10b1b0[_0xc76d('0x17')](0xc8)[_0xc76d('0x2d')]({'error':![],'message':'unhold\x20executed!'});})[_0xc76d('0x1f')](handleError(_0x10b1b0));};exports[_0xc76d('0x43')]=function(_0x5e66d9,_0x1a49d5){logger[_0xc76d('0x2a')]('calls\x20fired:',_0x1a49d5[_0xc76d('0x2b')]);var _0x463cbe=callsValidation[_0xc76d('0xb')](_0x5e66d9[_0xc76d('0x2b')]);if(_0x463cbe[_0xc76d('0x2c')]>0x0){return _0x1a49d5[_0xc76d('0x17')](0x190)['json'](_0x463cbe);}var _0x91b25b=_0x5e66d9[_0xc76d('0x2b')]['userId'];var _0x5f3973=respondWithRpcPromise(_0xc76d('0x23'));var _0x5ddcc6=getAgent(_0x91b25b);return Promise[_0xc76d('0x24')]([_0x5f3973,_0x5ddcc6])[_0xc76d('0x1b')](function(_0x12b287){var _0xfe2be1=_0x12b287[0x0];var _0x254128=_0x12b287[0x1];var _0x4746a5=_[_0xc76d('0x44')](_0xfe2be1[_0xc76d('0x25')],function(_0x3ada89){return _0x3ada89[_0xc76d('0x26')]==_0x254128['id'];});return _0x1a49d5[_0xc76d('0x17')](0xc8)[_0xc76d('0x2d')]({'count':_0x4746a5[_0xc76d('0x2c')],'rows':_0x4746a5});})[_0xc76d('0x1f')](handleError(_0x1a49d5));};exports['conference']=function(_0x3054e0,_0xa0aa45){logger[_0xc76d('0x2a')](_0xc76d('0x45'),_0x3054e0[_0xc76d('0x2b')]);var _0x5ce99d=conferenceValidation[_0xc76d('0xb')](_0x3054e0[_0xc76d('0x2b')]);if(_0x5ce99d['length']>0x0){return _0xa0aa45['status'](0x190)['json'](_0x5ce99d);}var _0x382db6=_0x3054e0[_0xc76d('0x2b')][_0xc76d('0x2e')];return getAgent(_0x382db6)[_0xc76d('0x1b')](function(_0x2ba812){logger[_0xc76d('0x2a')](_0xc76d('0x35'),_0x2ba812[_0xc76d('0x16')]);emit(util['format'](_0xc76d('0x31'),_0x2ba812['name']),'webbar:conference');return _0xa0aa45[_0xc76d('0x17')](0xc8)[_0xc76d('0x2d')]({'error':![],'message':_0xc76d('0x46')});})['catch'](handleError(_0xa0aa45));};exports[_0xc76d('0x47')]=function(_0x57068d,_0x48ccf7){logger['info'](_0xc76d('0x48'),_0x57068d[_0xc76d('0x2b')]);var _0x513623=transferValidation[_0xc76d('0xb')](_0x57068d[_0xc76d('0x2b')]);if(_0x513623[_0xc76d('0x2c')]>0x0){return _0x48ccf7[_0xc76d('0x17')](0x190)[_0xc76d('0x2d')](_0x513623);}var _0xa81af6=_0x57068d[_0xc76d('0x2b')]['userId'];var _0x5035fd=_0x57068d['body'][_0xc76d('0x27')];var _0x2e742f=_0x57068d[_0xc76d('0x2b')][_0xc76d('0x49')];return getAgent(_0xa81af6)[_0xc76d('0x1b')](function(_0x49f876){logger[_0xc76d('0x2a')](_0xc76d('0x35'),_0x49f876[_0xc76d('0x16')]);emit(util[_0xc76d('0x30')](_0xc76d('0x31'),_0x49f876[_0xc76d('0x16')]),_0xc76d('0x4a'),{'sessionId':_0x5035fd,'transferNumber':_0x2e742f});return _0x48ccf7[_0xc76d('0x17')](0xc8)['json']({'error':![],'message':_0xc76d('0x4b')});})['catch'](handleError(_0x48ccf7));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 30c6212..59442a0 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 _0x2fd3=['removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','post','addDisposition','addAnswer','addAgents','addApplications','/:id/notify','notify','/:id/send','put','update','delete','destroy','removeDispositions'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x2fd3,0x189));var _0x32fd=function(_0x1cf1a6,_0x5985ce){_0x1cf1a6=_0x1cf1a6-0x0;var _0x590ade=_0x2fd3[_0x1cf1a6];return _0x590ade;};'use strict';var multer=require(_0x32fd('0x0'));var util=require(_0x32fd('0x1'));var path=require(_0x32fd('0x2'));var timeout=require(_0x32fd('0x3'));var express=require(_0x32fd('0x4'));var router=express[_0x32fd('0x5')]();var fs_extra=require(_0x32fd('0x6'));var auth=require(_0x32fd('0x7'));var interaction=require(_0x32fd('0x8'));var config=require(_0x32fd('0x9'));var controller=require(_0x32fd('0xa'));router[_0x32fd('0xb')]('/',auth[_0x32fd('0xc')](),controller[_0x32fd('0xd')]);router[_0x32fd('0xb')](_0x32fd('0xe'),auth[_0x32fd('0xc')](),controller[_0x32fd('0xf')]);router[_0x32fd('0xb')](_0x32fd('0x10'),auth[_0x32fd('0xc')](),controller['show']);router['get'](_0x32fd('0x11'),auth[_0x32fd('0xc')](),controller['getDispositions']);router[_0x32fd('0xb')](_0x32fd('0x12'),auth[_0x32fd('0xc')](),controller[_0x32fd('0x13')]);router[_0x32fd('0xb')](_0x32fd('0x14'),auth[_0x32fd('0xc')](),controller[_0x32fd('0x15')]);router[_0x32fd('0xb')](_0x32fd('0x16'),auth[_0x32fd('0xc')](),controller['getApplications']);router[_0x32fd('0x17')]('/',auth[_0x32fd('0xc')](),controller['create']);router['post']('/:id/dispositions',auth[_0x32fd('0xc')](),controller[_0x32fd('0x18')]);router[_0x32fd('0x17')](_0x32fd('0x12'),auth[_0x32fd('0xc')](),controller[_0x32fd('0x19')]);router['post'](_0x32fd('0x14'),auth[_0x32fd('0xc')](),controller[_0x32fd('0x1a')]);router[_0x32fd('0x17')](_0x32fd('0x16'),auth[_0x32fd('0xc')](),controller[_0x32fd('0x1b')]);router[_0x32fd('0x17')](_0x32fd('0x1c'),controller[_0x32fd('0x1d')]);router[_0x32fd('0x17')](_0x32fd('0x1e'),auth[_0x32fd('0xc')](),controller['send']);router[_0x32fd('0x1f')](_0x32fd('0x10'),auth[_0x32fd('0xc')](),controller[_0x32fd('0x20')]);router[_0x32fd('0x21')](_0x32fd('0x10'),auth[_0x32fd('0xc')](),controller[_0x32fd('0x22')]);router['delete'](_0x32fd('0x11'),auth[_0x32fd('0xc')](),controller[_0x32fd('0x23')]);router[_0x32fd('0x21')](_0x32fd('0x12'),auth[_0x32fd('0xc')](),controller[_0x32fd('0x24')]);router[_0x32fd('0x21')](_0x32fd('0x14'),auth[_0x32fd('0xc')](),controller[_0x32fd('0x25')]);module[_0x32fd('0x26')]=router; \ No newline at end of file +var _0xc18e=['notify','/:id/send','send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappAccount.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','post','/:id/dispositions','addDisposition','addAnswer','addAgents','addApplications','/:id/notify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc18e,0x17d));var _0xec18=function(_0x5cbd7b,_0x207439){_0x5cbd7b=_0x5cbd7b-0x0;var _0x3fdfb8=_0xc18e[_0x5cbd7b];return _0x3fdfb8;};'use strict';var multer=require(_0xec18('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xec18('0x1'));var express=require(_0xec18('0x2'));var router=express['Router']();var fs_extra=require(_0xec18('0x3'));var auth=require(_0xec18('0x4'));var interaction=require(_0xec18('0x5'));var config=require('../../config/environment');var controller=require(_0xec18('0x6'));router[_0xec18('0x7')]('/',auth[_0xec18('0x8')](),controller[_0xec18('0x9')]);router['get'](_0xec18('0xa'),auth[_0xec18('0x8')](),controller['describe']);router[_0xec18('0x7')](_0xec18('0xb'),auth[_0xec18('0x8')](),controller[_0xec18('0xc')]);router['get']('/:id/dispositions',auth[_0xec18('0x8')](),controller['getDispositions']);router[_0xec18('0x7')](_0xec18('0xd'),auth[_0xec18('0x8')](),controller[_0xec18('0xe')]);router[_0xec18('0x7')](_0xec18('0xf'),auth[_0xec18('0x8')](),controller[_0xec18('0x10')]);router['get'](_0xec18('0x11'),auth[_0xec18('0x8')](),controller[_0xec18('0x12')]);router['post']('/',auth[_0xec18('0x8')](),controller['create']);router[_0xec18('0x13')](_0xec18('0x14'),auth['isAuthenticated'](),controller[_0xec18('0x15')]);router[_0xec18('0x13')]('/:id/canned_answers',auth[_0xec18('0x8')](),controller[_0xec18('0x16')]);router['post'](_0xec18('0xf'),auth[_0xec18('0x8')](),controller[_0xec18('0x17')]);router[_0xec18('0x13')]('/:id/applications',auth[_0xec18('0x8')](),controller[_0xec18('0x18')]);router['post'](_0xec18('0x19'),controller[_0xec18('0x1a')]);router['post'](_0xec18('0x1b'),auth[_0xec18('0x8')](),controller[_0xec18('0x1c')]);router[_0xec18('0x1d')](_0xec18('0xb'),auth[_0xec18('0x8')](),controller[_0xec18('0x1e')]);router[_0xec18('0x1f')](_0xec18('0xb'),auth[_0xec18('0x8')](),controller[_0xec18('0x20')]);router[_0xec18('0x1f')]('/:id/dispositions',auth[_0xec18('0x8')](),controller[_0xec18('0x21')]);router[_0xec18('0x1f')](_0xec18('0xd'),auth[_0xec18('0x8')](),controller[_0xec18('0x22')]);router[_0xec18('0x1f')](_0xec18('0xf'),auth[_0xec18('0x8')](),controller[_0xec18('0x23')]);module[_0xec18('0x24')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 8b55d7c..c6a20e7 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 _0x7e0c=['mandatoryDisposition','sequelize','randomstring','STRING','name','generate','ENUM','twilio','sinch','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId'];(function(_0x358493,_0x2d3bcf){var _0x2431c0=function(_0x59b951){while(--_0x59b951){_0x358493['push'](_0x358493['shift']());}};_0x2431c0(++_0x2d3bcf);}(_0x7e0c,0x111));var _0xc7e0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7e0c[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xc7e0('0x0'));var rs=require(_0xc7e0('0x1'));module['exports']={'name':{'type':Sequelize[_0xc7e0('0x2')],'unique':_0xc7e0('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xc7e0('0x2')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xc7e0('0x2')],'defaultValue':function(){return rs[_0xc7e0('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xc7e0('0x5')](_0xc7e0('0x6'),_0xc7e0('0x7'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xc7e0('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xc7e0('0x8');}},'notificationSound':{'type':Sequelize[_0xc7e0('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc7e0('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xc7e0('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xc7e0('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc7e0('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc7e0('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc7e0('0xa')],'comment':_0xc7e0('0xb')},'mandatoryDisposition':{'type':Sequelize[_0xc7e0('0x9')],'defaultValue':![],'comment':_0xc7e0('0xc'),'set':function(_0x5b1a1e){if(!_0x5b1a1e){this[_0xc7e0('0xd')](_0xc7e0('0xe'),null);}this['setDataValue'](_0xc7e0('0xf'),_0x5b1a1e);}},'description':{'type':Sequelize[_0xc7e0('0x2')]}}; \ No newline at end of file +var _0x84dc=['sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','randomstring','STRING','generate','ENUM'];(function(_0x4be563,_0x371f7d){var _0xa7d890=function(_0xe80d67){while(--_0xe80d67){_0x4be563['push'](_0x4be563['shift']());}};_0xa7d890(++_0x371f7d);}(_0x84dc,0x182));var _0xc84d=function(_0x970939,_0x4691e9){_0x970939=_0x970939-0x0;var _0xc783b1=_0x84dc[_0x970939];return _0xc783b1;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xc84d('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xc84d('0x1')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xc84d('0x2')]();}},'phone':{'type':Sequelize[_0xc84d('0x1')]},'type':{'type':Sequelize[_0xc84d('0x3')]('twilio',_0xc84d('0x4'))},'accountSid':{'type':Sequelize[_0xc84d('0x1')]},'baseUrl':{'type':Sequelize[_0xc84d('0x1')]},'authToken':{'type':Sequelize[_0xc84d('0x1')]},'notificationTemplate':{'type':Sequelize[_0xc84d('0x5')],'defaultValue':function(){return _0xc84d('0x6');}},'notificationSound':{'type':Sequelize[_0xc84d('0x7')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xc84d('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc84d('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xc84d('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xc84d('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc84d('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc84d('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc84d('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xc84d('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xc84d('0x7')],'defaultValue':![],'comment':_0xc84d('0xa'),'set':function(_0x3473bb){if(!_0x3473bb){this[_0xc84d('0xb')](_0xc84d('0xc'),null);}this[_0xc84d('0xb')]('mandatoryDisposition',_0x3473bb);}},'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 bebafd1..8a4e848 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 _0x4797=['fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','show','params','Pause','keys','intersection','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','Disposition','findOne','order','WhatsappAccountId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addAgents','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','User','getAgents','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','priority','finally','getApplications','whatsapp','Applications','account','sinch','statuses','state','read','WhatsappMessage','timestamp','message_id','applications','orderBy','asc','CmContact','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','mobile','from','From','replace','whatsapp:','Body','MessageSid','notifications','messageId','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','Sequelize','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','list','omit','WhatsappInteraction','interaction','created','push','close','unmanaged','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','WhatsappQueue','queue','Start','startRouting','receiveMessage','info','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','text/xml','to\x20is\x20mandatory','List','Messages','dataValues','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','jayson/promise','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','get','WhatsappAccounts','UserProfileResource','stack','name','send','index','mandatoryDispositionPause','WhatsappAccount','rawAttributes','fieldName','type','key','map','query','filters','model','attributes'];(function(_0x771d51,_0x4eb806){var _0x55b809=function(_0xa4dd79){while(--_0xa4dd79){_0x771d51['push'](_0x771d51['shift']());}};_0x55b809(++_0x4eb806);}(_0x4797,0x143));var _0x7479=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4797[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x7479('0x0'));var rimraf=require(_0x7479('0x1'));var zipdir=require(_0x7479('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7479('0x3'));var BPromise=require(_0x7479('0x4'));var Mustache=require(_0x7479('0x5'));var util=require('util');var path=require(_0x7479('0x6'));var sox=require(_0x7479('0x7'));var csv=require(_0x7479('0x8'));var ejs=require(_0x7479('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7479('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7479('0xb'));var deskjs=require(_0x7479('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7479('0xd'));var Redis=require(_0x7479('0xe'));var authService=require(_0x7479('0xf'));var qs=require(_0x7479('0x10'));var as=require(_0x7479('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7479('0x12'))(_0x7479('0x13'));var utils=require('../../config/utils');var config=require(_0x7479('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x7479('0x15'))['db'];config[_0x7479('0x16')]=_[_0x7479('0x17')](config['redis'],{'host':_0x7479('0x18'),'port':0x18eb});var socket=require(_0x7479('0x19'))(new Redis(config[_0x7479('0x16')]));require(_0x7479('0x1a'))['register'](socket);var jayson=require(_0x7479('0x1b'));var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x46d50c,_0x118a32,_0x5cf666,_0x2edef4){return new BPromise(function(_0x176cb6,_0x30a5f2){var _0x5ee4f9=_0x2edef4||client;return _0x5ee4f9[_0x7479('0x1c')](_0x46d50c,_0x5cf666)[_0x7479('0x1d')](function(_0x51ca8c){logger['info'](_0x7479('0x1e'),_0x118a32,_0x7479('0x1f'));logger[_0x7479('0x20')](_0x7479('0x21'),_0x118a32,_0x7479('0x1f'),JSON['stringify'](_0x51ca8c));if(_0x51ca8c[_0x7479('0x22')]){if(_0x51ca8c['error'][_0x7479('0x23')]===0x1f4){logger[_0x7479('0x22')](_0x7479('0x1e'),_0x118a32,_0x51ca8c['error']['message']);return _0x30a5f2(_0x51ca8c[_0x7479('0x22')][_0x7479('0x24')]);}logger[_0x7479('0x22')]('WhatsappAccount,\x20%s,\x20%s',_0x118a32,_0x51ca8c[_0x7479('0x22')][_0x7479('0x24')]);return _0x176cb6(_0x51ca8c[_0x7479('0x22')]['message']);}else{logger['info'](_0x7479('0x1e'),_0x118a32,'request\x20sent');_0x176cb6(_0x51ca8c['result'][_0x7479('0x24')]);}})[_0x7479('0x25')](function(_0x589305){logger[_0x7479('0x22')]('WhatsappAccount,\x20%s,\x20%s',_0x118a32,_0x589305);_0x30a5f2(_0x589305);});});}function respondWithStatusCode(_0xfa9c5b,_0x3a6cc9){_0x3a6cc9=_0x3a6cc9||0xcc;return function(_0x1a12ea){if(_0x1a12ea){return _0xfa9c5b[_0x7479('0x26')](_0x3a6cc9);}return _0xfa9c5b[_0x7479('0x27')](_0x3a6cc9)[_0x7479('0x28')]();};}function respondWithResult(_0xa3f65b,_0x3c9eab){_0x3c9eab=_0x3c9eab||0xc8;return function(_0x12a514){if(_0x12a514){return _0xa3f65b[_0x7479('0x27')](_0x3c9eab)['json'](_0x12a514);}};}function respondWithFilteredResult(_0x20a78f,_0x2618b8){return function(_0x5b073c){if(_0x5b073c){var _0x1fae91=typeof _0x2618b8['offset']===_0x7479('0x29')&&typeof _0x2618b8['limit']===_0x7479('0x29');var _0x58f7e0=_0x5b073c[_0x7479('0x2a')];var _0x2e97b0=_0x1fae91?0x0:_0x2618b8[_0x7479('0x2b')];var _0xaf6cec=_0x1fae91?_0x5b073c[_0x7479('0x2a')]:_0x2618b8[_0x7479('0x2b')]+_0x2618b8[_0x7479('0x2c')];var _0x3770dc;if(_0xaf6cec>=_0x58f7e0){_0xaf6cec=_0x58f7e0;_0x3770dc=0xc8;}else{_0x3770dc=0xce;}_0x20a78f[_0x7479('0x27')](_0x3770dc);return _0x20a78f[_0x7479('0x2d')](_0x7479('0x2e'),_0x2e97b0+'-'+_0xaf6cec+'/'+_0x58f7e0)[_0x7479('0x2f')](_0x5b073c);}return null;};}function patchUpdates(_0x7c39b5){return function(_0x58e47a){try{jsonpatch[_0x7479('0x30')](_0x58e47a,_0x7c39b5,!![]);}catch(_0x186423){return BPromise[_0x7479('0x31')](_0x186423);}return _0x58e47a[_0x7479('0x32')]();};}function saveUpdates(_0x156a61,_0x29593c){return function(_0xa135ad){if(_0xa135ad){return _0xa135ad[_0x7479('0x33')](_0x156a61)[_0x7479('0x1d')](function(_0x495e07){return _0x495e07;});}return null;};}function removeEntity(_0x33a84e,_0x2c3611){return function(_0xc4aa3d){if(_0xc4aa3d){return _0xc4aa3d[_0x7479('0x34')]()['then'](function(){var _0x36b91c=_0xc4aa3d[_0x7479('0x35')]({'plain':!![]});var _0x54bf0e=_0x7479('0x36');return db[_0x7479('0x37')][_0x7479('0x34')]({'where':{'type':_0x54bf0e,'resourceId':_0x36b91c['id']}})[_0x7479('0x1d')](function(){return _0xc4aa3d;});})[_0x7479('0x1d')](function(){_0x33a84e[_0x7479('0x27')](0xcc)[_0x7479('0x28')]();});}};}function handleEntityNotFound(_0x273c92,_0x1060a9){return function(_0x4df0a1){if(!_0x4df0a1){_0x273c92['sendStatus'](0x194);}return _0x4df0a1;};}function handleError(_0x484148,_0x2d4ea4){_0x2d4ea4=_0x2d4ea4||0x1f4;return function(_0x2923b3){logger[_0x7479('0x22')](_0x2923b3[_0x7479('0x38')]);if(_0x2923b3[_0x7479('0x39')]){delete _0x2923b3[_0x7479('0x39')];}_0x484148[_0x7479('0x27')](_0x2d4ea4)[_0x7479('0x3a')](_0x2923b3);};}exports[_0x7479('0x3b')]=function(_0x197ed7,_0x11f733){var _0xe3eab7={'include':[{'model':db['Pause'],'as':_0x7479('0x3c')}]},_0x3afe97={},_0x1021b1={'count':0x0,'rows':[]};var _0x4e75d9=_['map'](db[_0x7479('0x3d')][_0x7479('0x3e')],function(_0x27d374){return{'name':_0x27d374[_0x7479('0x3f')],'type':_0x27d374[_0x7479('0x40')][_0x7479('0x41')]};});_0x3afe97['model']=_[_0x7479('0x42')](_0x4e75d9,_0x7479('0x39'));_0x3afe97[_0x7479('0x43')]=_['keys'](_0x197ed7[_0x7479('0x43')]);_0x3afe97[_0x7479('0x44')]=_['intersection'](_0x3afe97[_0x7479('0x45')],_0x3afe97[_0x7479('0x43')]);_0xe3eab7[_0x7479('0x46')]=_['intersection'](_0x3afe97[_0x7479('0x45')],qs[_0x7479('0x47')](_0x197ed7[_0x7479('0x43')][_0x7479('0x47')]));_0xe3eab7['attributes']=_0xe3eab7['attributes'][_0x7479('0x48')]?_0xe3eab7[_0x7479('0x46')]:_0x3afe97[_0x7479('0x45')];if(!_0x197ed7[_0x7479('0x43')][_0x7479('0x49')](_0x7479('0x4a'))){_0xe3eab7[_0x7479('0x2c')]=qs[_0x7479('0x2c')](_0x197ed7[_0x7479('0x43')]['limit']);_0xe3eab7[_0x7479('0x2b')]=qs[_0x7479('0x2b')](_0x197ed7['query']['offset']);}_0xe3eab7['order']=qs[_0x7479('0x4b')](_0x197ed7[_0x7479('0x43')][_0x7479('0x4b')]);_0xe3eab7[_0x7479('0x4c')]=qs[_0x7479('0x44')](_[_0x7479('0x4d')](_0x197ed7[_0x7479('0x43')],_0x3afe97[_0x7479('0x44')]),_0x4e75d9);if(_0x197ed7[_0x7479('0x43')][_0x7479('0x4e')]){_0xe3eab7['where']=_[_0x7479('0x4f')](_0xe3eab7[_0x7479('0x4c')],{'$or':_[_0x7479('0x42')](_0x4e75d9,function(_0x175340){if(_0x175340[_0x7479('0x40')]!==_0x7479('0x50')){var _0x4fd272={};_0x4fd272[_0x175340[_0x7479('0x39')]]={'$like':'%'+_0x197ed7['query'][_0x7479('0x4e')]+'%'};return _0x4fd272;}})});}_0xe3eab7=_[_0x7479('0x4f')]({},_0xe3eab7,_0x197ed7[_0x7479('0x51')]);var _0x50e34e={'where':_0xe3eab7[_0x7479('0x4c')]};return db[_0x7479('0x3d')][_0x7479('0x2a')](_0x50e34e)[_0x7479('0x1d')](function(_0x3192ec){_0x1021b1[_0x7479('0x2a')]=_0x3192ec;if(_0x197ed7[_0x7479('0x43')]['includeAll']){_0xe3eab7['include']=[{'all':!![]}];}return db[_0x7479('0x3d')][_0x7479('0x52')](_0xe3eab7);})[_0x7479('0x1d')](function(_0xb81da){_0x1021b1[_0x7479('0x53')]=_0xb81da;return _0x1021b1;})[_0x7479('0x1d')](respondWithFilteredResult(_0x11f733,_0xe3eab7))['catch'](handleError(_0x11f733,null));};exports[_0x7479('0x54')]=function(_0x2bf0a1,_0x4a1019){var _0x559874={'raw':![],'where':{'id':_0x2bf0a1[_0x7479('0x55')]['id']},'include':[{'model':db[_0x7479('0x56')],'as':_0x7479('0x3c')}]},_0x1a5e53={};_0x1a5e53[_0x7479('0x45')]=_['keys'](db[_0x7479('0x3d')][_0x7479('0x3e')]);_0x1a5e53[_0x7479('0x43')]=_[_0x7479('0x57')](_0x2bf0a1[_0x7479('0x43')]);_0x1a5e53['filters']=_['intersection'](_0x1a5e53[_0x7479('0x45')],_0x1a5e53['query']);_0x559874[_0x7479('0x46')]=_[_0x7479('0x58')](_0x1a5e53[_0x7479('0x45')],qs['fields'](_0x2bf0a1['query']['fields']));_0x559874[_0x7479('0x46')]=_0x559874[_0x7479('0x46')][_0x7479('0x48')]?_0x559874[_0x7479('0x46')]:_0x1a5e53[_0x7479('0x45')];if(_0x2bf0a1[_0x7479('0x43')][_0x7479('0x59')]){_0x559874[_0x7479('0x5a')]=[{'all':!![]}];}_0x559874=_[_0x7479('0x4f')]({},_0x559874,_0x2bf0a1[_0x7479('0x51')]);return db[_0x7479('0x3d')][_0x7479('0x5b')](_0x559874)[_0x7479('0x1d')](handleEntityNotFound(_0x4a1019,null))[_0x7479('0x1d')](respondWithResult(_0x4a1019,null))[_0x7479('0x25')](handleError(_0x4a1019,null));};exports[_0x7479('0x5c')]=function(_0x344fd6,_0x4cfd14){return db[_0x7479('0x3d')][_0x7479('0x5c')](_0x344fd6[_0x7479('0x5d')],{})[_0x7479('0x1d')](function(_0x2ceec9){var _0x488780=_0x344fd6[_0x7479('0x5e')][_0x7479('0x35')]({'plain':!![]});if(!_0x488780)throw new Error(_0x7479('0x5f'));if(_0x488780[_0x7479('0x60')]===_0x7479('0x5e')){var _0x1c9c30=_0x2ceec9[_0x7479('0x35')]({'plain':!![]});var _0x4a1afe=_0x7479('0x36');return db[_0x7479('0x61')][_0x7479('0x5b')]({'where':{'name':_0x4a1afe,'userProfileId':_0x488780['userProfileId']},'raw':!![]})[_0x7479('0x1d')](function(_0x260d9f){if(_0x260d9f&&_0x260d9f[_0x7479('0x62')]===0x0){return db[_0x7479('0x37')][_0x7479('0x5c')]({'name':_0x1c9c30[_0x7479('0x39')],'resourceId':_0x1c9c30['id'],'type':_0x260d9f['name'],'sectionId':_0x260d9f['id']},{})[_0x7479('0x1d')](function(){return _0x2ceec9;});}else{return _0x2ceec9;}})[_0x7479('0x25')](function(_0x44725b){logger['error'](_0x7479('0x63'),_0x44725b);throw _0x44725b;});}return _0x2ceec9;})['then'](respondWithResult(_0x4cfd14,0xc9))[_0x7479('0x25')](handleError(_0x4cfd14,null));};exports[_0x7479('0x33')]=function(_0x4cdcb9,_0x84d928){if(_0x4cdcb9[_0x7479('0x5d')]['id']){delete _0x4cdcb9[_0x7479('0x5d')]['id'];}return db[_0x7479('0x3d')][_0x7479('0x5b')]({'where':{'id':_0x4cdcb9[_0x7479('0x55')]['id']},'include':[{'model':db[_0x7479('0x56')],'as':_0x7479('0x3c')}]})[_0x7479('0x1d')](handleEntityNotFound(_0x84d928,null))[_0x7479('0x1d')](saveUpdates(_0x4cdcb9[_0x7479('0x5d')],null))[_0x7479('0x1d')](respondWithResult(_0x84d928,null))[_0x7479('0x25')](handleError(_0x84d928,null));};exports[_0x7479('0x34')]=function(_0x3f7dcf,_0x34d9cd){return db['WhatsappAccount']['find']({'where':{'id':_0x3f7dcf['params']['id']}})[_0x7479('0x1d')](handleEntityNotFound(_0x34d9cd,null))[_0x7479('0x1d')](removeEntity(_0x34d9cd,null))[_0x7479('0x25')](handleError(_0x34d9cd,null));};exports[_0x7479('0x64')]=function(_0x1501e1,_0x17a2ed){return db[_0x7479('0x3d')]['describe']()[_0x7479('0x1d')](respondWithResult(_0x17a2ed,null))[_0x7479('0x25')](handleError(_0x17a2ed,null));};exports['addDisposition']=function(_0x526e63,_0x59dd5a,_0x54a2bb){if(_0x526e63[_0x7479('0x5d')]['id']){delete _0x526e63['body']['id'];}return db[_0x7479('0x3d')][_0x7479('0x5b')]({'where':{'id':_0x526e63[_0x7479('0x55')]['id']}})['then'](handleEntityNotFound(_0x59dd5a,null))[_0x7479('0x1d')](function(_0x5006fa){if(_0x5006fa){_0x526e63['body']['WhatsappAccountId']=_0x5006fa['id'];return db[_0x7479('0x65')][_0x7479('0x5c')](_0x526e63[_0x7479('0x5d')]);}})[_0x7479('0x1d')](respondWithResult(_0x59dd5a,null))[_0x7479('0x25')](handleError(_0x59dd5a,null));};exports['getDispositions']=function(_0x3485bc,_0x553e2d,_0x574522){var _0x97885e={'raw':![],'where':{}};var _0x1c690b={};var _0x9415a={'count':0x0,'rows':[]};return db[_0x7479('0x3d')][_0x7479('0x66')]({'where':{'id':_0x3485bc['params']['id']}})['then'](handleEntityNotFound(_0x553e2d,null))[_0x7479('0x1d')](function(_0x57d160){if(_0x57d160){_0x1c690b['model']=_['keys'](db[_0x7479('0x65')]['rawAttributes']);_0x1c690b[_0x7479('0x43')]=_[_0x7479('0x57')](_0x3485bc['query']);_0x1c690b[_0x7479('0x44')]=_[_0x7479('0x58')](_0x1c690b[_0x7479('0x45')],_0x1c690b['query']);_0x97885e[_0x7479('0x46')]=_[_0x7479('0x58')](_0x1c690b[_0x7479('0x45')],qs['fields'](_0x3485bc[_0x7479('0x43')][_0x7479('0x47')]));_0x97885e['attributes']=_0x97885e['attributes']['length']?_0x97885e[_0x7479('0x46')]:_0x1c690b['model'];if(!_0x3485bc[_0x7479('0x43')][_0x7479('0x49')](_0x7479('0x4a'))){_0x97885e[_0x7479('0x2c')]=qs[_0x7479('0x2c')](_0x3485bc[_0x7479('0x43')][_0x7479('0x2c')]);_0x97885e[_0x7479('0x2b')]=qs[_0x7479('0x2b')](_0x3485bc[_0x7479('0x43')][_0x7479('0x2b')]);}_0x97885e[_0x7479('0x67')]=qs[_0x7479('0x4b')](_0x3485bc[_0x7479('0x43')][_0x7479('0x4b')]);_0x97885e[_0x7479('0x4c')]=qs[_0x7479('0x44')](_['pick'](_0x3485bc['query'],_0x1c690b[_0x7479('0x44')]));_0x97885e[_0x7479('0x4c')][_0x7479('0x68')]=_0x57d160['id'];if(_0x3485bc[_0x7479('0x43')][_0x7479('0x4e')]){_0x97885e['where']=_[_0x7479('0x4f')](_0x97885e[_0x7479('0x4c')],{'$or':_['map'](_0x97885e[_0x7479('0x46')],function(_0x23c137){var _0x55c2e0={};_0x55c2e0[_0x23c137]={'$like':'%'+_0x3485bc['query']['filter']+'%'};return _0x55c2e0;})});}_0x97885e=_['merge']({},_0x97885e,_0x3485bc[_0x7479('0x51')]);return db[_0x7479('0x65')][_0x7479('0x2a')]({'where':_0x97885e[_0x7479('0x4c')]})[_0x7479('0x1d')](function(_0x74ca26){_0x9415a[_0x7479('0x2a')]=_0x74ca26;if(_0x3485bc[_0x7479('0x43')][_0x7479('0x59')]){_0x97885e['include']=[{'all':!![]}];}return db[_0x7479('0x65')][_0x7479('0x52')](_0x97885e);})[_0x7479('0x1d')](function(_0x5a02d2){_0x9415a[_0x7479('0x53')]=_0x5a02d2;return _0x9415a;});}})[_0x7479('0x1d')](respondWithFilteredResult(_0x553e2d,_0x97885e))['catch'](handleError(_0x553e2d,null));};exports['removeDispositions']=function(_0x5beb71,_0x2d4a4c,_0x4e808c){return db[_0x7479('0x3d')][_0x7479('0x5b')]({'where':{'id':_0x5beb71[_0x7479('0x55')]['id']}})[_0x7479('0x1d')](handleEntityNotFound(_0x2d4a4c,null))[_0x7479('0x1d')](function(_0x2bef31){if(_0x2bef31){return _0x2bef31[_0x7479('0x69')](_0x5beb71[_0x7479('0x43')][_0x7479('0x6a')]);}})[_0x7479('0x1d')](respondWithStatusCode(_0x2d4a4c,null))[_0x7479('0x25')](handleError(_0x2d4a4c,null));};exports[_0x7479('0x6b')]=function(_0x2d2e08,_0x36b4cf,_0xad80a1){if(_0x2d2e08[_0x7479('0x5d')]['id']){delete _0x2d2e08[_0x7479('0x5d')]['id'];}return db[_0x7479('0x3d')][_0x7479('0x5b')]({'where':{'id':_0x2d2e08[_0x7479('0x55')]['id']}})['then'](handleEntityNotFound(_0x36b4cf,null))[_0x7479('0x1d')](function(_0x325fe2){if(_0x325fe2){_0x2d2e08[_0x7479('0x5d')][_0x7479('0x68')]=_0x325fe2['id'];return db[_0x7479('0x6c')][_0x7479('0x5c')](_0x2d2e08[_0x7479('0x5d')]);}})[_0x7479('0x1d')](respondWithResult(_0x36b4cf,null))[_0x7479('0x25')](handleError(_0x36b4cf,null));};exports[_0x7479('0x6d')]=function(_0x3bd7fd,_0x45ed89,_0x57de3a){var _0x5daea3={'raw':![],'where':{}};var _0x2f3560={};var _0x32dde1={'count':0x0,'rows':[]};return db[_0x7479('0x3d')]['findOne']({'where':{'id':_0x3bd7fd[_0x7479('0x55')]['id']}})[_0x7479('0x1d')](handleEntityNotFound(_0x45ed89,null))['then'](function(_0x5bcf71){if(_0x5bcf71){_0x2f3560[_0x7479('0x45')]=_[_0x7479('0x57')](db[_0x7479('0x6c')][_0x7479('0x3e')]);_0x2f3560[_0x7479('0x43')]=_[_0x7479('0x57')](_0x3bd7fd[_0x7479('0x43')]);_0x2f3560[_0x7479('0x44')]=_['intersection'](_0x2f3560[_0x7479('0x45')],_0x2f3560['query']);_0x5daea3[_0x7479('0x46')]=_[_0x7479('0x58')](_0x2f3560[_0x7479('0x45')],qs[_0x7479('0x47')](_0x3bd7fd['query'][_0x7479('0x47')]));_0x5daea3[_0x7479('0x46')]=_0x5daea3[_0x7479('0x46')][_0x7479('0x48')]?_0x5daea3[_0x7479('0x46')]:_0x2f3560['model'];if(!_0x3bd7fd[_0x7479('0x43')][_0x7479('0x49')]('nolimit')){_0x5daea3[_0x7479('0x2c')]=qs[_0x7479('0x2c')](_0x3bd7fd[_0x7479('0x43')][_0x7479('0x2c')]);_0x5daea3[_0x7479('0x2b')]=qs[_0x7479('0x2b')](_0x3bd7fd['query'][_0x7479('0x2b')]);}_0x5daea3[_0x7479('0x67')]=qs[_0x7479('0x4b')](_0x3bd7fd[_0x7479('0x43')][_0x7479('0x4b')]);_0x5daea3[_0x7479('0x4c')]=qs[_0x7479('0x44')](_[_0x7479('0x4d')](_0x3bd7fd[_0x7479('0x43')],_0x2f3560[_0x7479('0x44')]));_0x5daea3['where'][_0x7479('0x68')]=_0x5bcf71['id'];if(_0x3bd7fd['query'][_0x7479('0x4e')]){_0x5daea3['where']=_[_0x7479('0x4f')](_0x5daea3[_0x7479('0x4c')],{'$or':_[_0x7479('0x42')](_0x5daea3[_0x7479('0x46')],function(_0x4f839e){var _0x593195={};_0x593195[_0x4f839e]={'$like':'%'+_0x3bd7fd[_0x7479('0x43')][_0x7479('0x4e')]+'%'};return _0x593195;})});}_0x5daea3=_[_0x7479('0x4f')]({},_0x5daea3,_0x3bd7fd[_0x7479('0x51')]);return db[_0x7479('0x6c')][_0x7479('0x2a')]({'where':_0x5daea3[_0x7479('0x4c')]})['then'](function(_0x274d3d){_0x32dde1[_0x7479('0x2a')]=_0x274d3d;if(_0x3bd7fd[_0x7479('0x43')]['includeAll']){_0x5daea3[_0x7479('0x5a')]=[{'all':!![]}];}return db[_0x7479('0x6c')][_0x7479('0x52')](_0x5daea3);})[_0x7479('0x1d')](function(_0x2bfd35){_0x32dde1[_0x7479('0x53')]=_0x2bfd35;return _0x32dde1;});}})[_0x7479('0x1d')](respondWithFilteredResult(_0x45ed89,_0x5daea3))[_0x7479('0x25')](handleError(_0x45ed89,null));};exports['removeAnswers']=function(_0x292232,_0x143dc9,_0x3057b9){return db[_0x7479('0x3d')][_0x7479('0x5b')]({'where':{'id':_0x292232['params']['id']}})[_0x7479('0x1d')](handleEntityNotFound(_0x143dc9,null))[_0x7479('0x1d')](function(_0x1e2b6f){if(_0x1e2b6f){return _0x1e2b6f[_0x7479('0x6e')](_0x292232[_0x7479('0x43')]['ids']);}})[_0x7479('0x1d')](respondWithStatusCode(_0x143dc9,null))[_0x7479('0x25')](handleError(_0x143dc9,null));};exports[_0x7479('0x6f')]=function(_0x2146e2,_0x31dbfd,_0x1fe6e7){return db[_0x7479('0x3d')][_0x7479('0x5b')]({'where':{'id':_0x2146e2[_0x7479('0x55')]['id']}})[_0x7479('0x1d')](handleEntityNotFound(_0x31dbfd,null))[_0x7479('0x1d')](function(_0x376892){if(_0x376892){return _0x376892['addAgents'](_0x2146e2[_0x7479('0x5d')][_0x7479('0x6a')],_['omit'](_0x2146e2[_0x7479('0x5d')],[_0x7479('0x6a'),'id'])||{})[_0x7479('0x70')](function(_0x459dd2){for(var _0x1e3ef6=0x0;_0x1e3ef6<_0x2146e2['body'][_0x7479('0x6a')][_0x7479('0x48')];_0x1e3ef6+=0x1){socket[_0x7479('0x71')](_0x7479('0x72'),{'UserId':Number(_0x2146e2['body'][_0x7479('0x6a')][_0x1e3ef6]),'WhatsappAccountId':Number(_0x2146e2[_0x7479('0x55')]['id'])});}return _0x459dd2;});}})[_0x7479('0x1d')](respondWithResult(_0x31dbfd,null))[_0x7479('0x25')](handleError(_0x31dbfd,null));};exports[_0x7479('0x73')]=function(_0x4e0f68,_0x2ea3b5,_0x1a077f){return db[_0x7479('0x3d')][_0x7479('0x5b')]({'where':{'id':_0x4e0f68[_0x7479('0x55')]['id']}})['then'](handleEntityNotFound(_0x2ea3b5,null))[_0x7479('0x1d')](function(_0x5a1bef){if(_0x5a1bef){return _0x5a1bef[_0x7479('0x73')](_0x4e0f68[_0x7479('0x43')][_0x7479('0x6a')])[_0x7479('0x1d')](function(){if(_[_0x7479('0x74')](_0x4e0f68['query']['ids'])){for(var _0x406576=0x0;_0x406576<_0x4e0f68[_0x7479('0x43')][_0x7479('0x6a')]['length'];_0x406576+=0x1){socket['emit'](_0x7479('0x75'),{'UserId':Number(_0x4e0f68[_0x7479('0x43')][_0x7479('0x6a')][_0x406576]),'WhatsappAccountId':Number(_0x4e0f68['params']['id'])});}}else{socket[_0x7479('0x71')]('userWhatsappAccount:remove',{'UserId':Number(_0x4e0f68['query'][_0x7479('0x6a')]),'WhatsappAccountId':Number(_0x4e0f68[_0x7479('0x55')]['id'])});}});}})[_0x7479('0x1d')](respondWithStatusCode(_0x2ea3b5,null))[_0x7479('0x25')](handleError(_0x2ea3b5,null));};exports['getAgents']=function(_0x2fd4aa,_0x3224fd,_0x3c3f38){var _0x3a7b8c={};var _0x3d8c56={};var _0x4442d2;var _0x1021cd;return db[_0x7479('0x3d')][_0x7479('0x66')]({'where':{'id':_0x2fd4aa['params']['id']}})[_0x7479('0x1d')](handleEntityNotFound(_0x3224fd,null))[_0x7479('0x1d')](function(_0x22e815){if(_0x22e815){_0x4442d2=_0x22e815;_0x3d8c56[_0x7479('0x45')]=_[_0x7479('0x57')](db[_0x7479('0x76')][_0x7479('0x3e')]);_0x3d8c56['query']=_[_0x7479('0x57')](_0x2fd4aa[_0x7479('0x43')]);_0x3d8c56[_0x7479('0x44')]=_[_0x7479('0x58')](_0x3d8c56['model'],_0x3d8c56[_0x7479('0x43')]);_0x3a7b8c[_0x7479('0x46')]=_[_0x7479('0x58')](_0x3d8c56[_0x7479('0x45')],qs[_0x7479('0x47')](_0x2fd4aa[_0x7479('0x43')]['fields']));_0x3a7b8c['attributes']=_0x3a7b8c['attributes'][_0x7479('0x48')]?_0x3a7b8c[_0x7479('0x46')]:_0x3d8c56[_0x7479('0x45')];_0x3a7b8c[_0x7479('0x67')]=qs[_0x7479('0x4b')](_0x2fd4aa[_0x7479('0x43')][_0x7479('0x4b')]);_0x3a7b8c[_0x7479('0x4c')]=qs[_0x7479('0x44')](_[_0x7479('0x4d')](_0x2fd4aa[_0x7479('0x43')],_0x3d8c56['filters']));if(_0x2fd4aa['query'][_0x7479('0x4e')]){_0x3a7b8c[_0x7479('0x4c')]=_[_0x7479('0x4f')](_0x3a7b8c[_0x7479('0x4c')],{'$or':_[_0x7479('0x42')](_0x3a7b8c['attributes'],function(_0x4e7bcd){var _0x123dc3={};_0x123dc3[_0x4e7bcd]={'$like':'%'+_0x2fd4aa[_0x7479('0x43')]['filter']+'%'};return _0x123dc3;})});}_0x3a7b8c=_[_0x7479('0x4f')]({},_0x3a7b8c,_0x2fd4aa[_0x7479('0x51')]);return _0x4442d2[_0x7479('0x77')](_0x3a7b8c);}})[_0x7479('0x1d')](function(_0x1a8c9d){if(_0x1a8c9d){_0x1021cd=_0x1a8c9d['length'];if(!_0x2fd4aa['query']['hasOwnProperty'](_0x7479('0x4a'))){_0x3a7b8c[_0x7479('0x2c')]=qs[_0x7479('0x2c')](_0x2fd4aa[_0x7479('0x43')][_0x7479('0x2c')]);_0x3a7b8c[_0x7479('0x2b')]=qs[_0x7479('0x2b')](_0x2fd4aa[_0x7479('0x43')][_0x7479('0x2b')]);}return _0x4442d2[_0x7479('0x77')](_0x3a7b8c);}})[_0x7479('0x1d')](function(_0x27a23a){if(_0x27a23a){return _0x27a23a?{'count':_0x1021cd,'rows':_0x27a23a}:null;}})['then'](respondWithResult(_0x3224fd,null))[_0x7479('0x25')](handleError(_0x3224fd,null));};exports[_0x7479('0x78')]=function(_0x21c1bb,_0x4f20c4){var _0x1e2fdb=_0x21c1bb[_0x7479('0x55')]['id'];var _0x5ab32b=_0x21c1bb['body'];var _0x2a1f18=0xc8;var _0x15d39d=null;return db[_0x7479('0x79')]['transaction']({'isolationLevel':db[_0x7479('0x79')][_0x7479('0x7a')][_0x7479('0x7b')][_0x7479('0x7c')]},function(_0x4c4f50){return db[_0x7479('0x3d')][_0x7479('0x66')]({'where':{'id':_0x1e2fdb},'transaction':_0x4c4f50})[_0x7479('0x1d')](function(_0x4b1215){if(_0x4b1215){return db[_0x7479('0x7d')][_0x7479('0x34')]({'where':{'WhatsappAccountId':_0x1e2fdb},'transaction':_0x4c4f50})['then'](function(){var _0x2906f0=_[_0x7479('0x42')](_0x5ab32b,function(_0x1464bb){_0x1464bb[_0x7479('0x68')]=_0x1e2fdb;return _0x1464bb;});return db[_0x7479('0x7d')][_0x7479('0x7e')](_0x2906f0,{'transaction':_0x4c4f50});});}else{_0x2a1f18=0x194;_0x15d39d=[];}});})['then'](function(){if(_0x2a1f18!==0x194){return db[_0x7479('0x7d')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x1e2fdb},'order':_0x7479('0x7f')})[_0x7479('0x1d')](function(_0x134c7b){_0x15d39d=_0x134c7b;});}})[_0x7479('0x25')](function(_0x532f99){_0x2a1f18=0x1f4;logger[_0x7479('0x22')](_0x532f99[_0x7479('0x38')]);if(_0x532f99[_0x7479('0x39')]){delete _0x532f99['name'];}_0x15d39d=_0x532f99;})[_0x7479('0x80')](function(){if(_0x15d39d===null){_0x4f20c4[_0x7479('0x26')](_0x2a1f18);}else{if(_0x2a1f18===0x1f4){_0x4f20c4[_0x7479('0x27')](_0x2a1f18)[_0x7479('0x3a')](_0x15d39d);}else{_0x4f20c4[_0x7479('0x27')](_0x2a1f18)[_0x7479('0x2f')](_0x15d39d);}}});};exports[_0x7479('0x81')]=function(_0xe3e7d1,_0x5179b5,_0x259f69){var _0x48370e={};var _0x3cf9f5={};var _0x1c6984;var _0x539598;return db[_0x7479('0x3d')][_0x7479('0x66')]({'where':{'id':_0xe3e7d1[_0x7479('0x55')]['id']}})['then'](handleEntityNotFound(_0x5179b5,null))['then'](function(_0x293281){if(_0x293281){_0x1c6984=_0x293281;_0x3cf9f5[_0x7479('0x45')]=_[_0x7479('0x57')](db[_0x7479('0x7d')]['rawAttributes']);_0x3cf9f5[_0x7479('0x43')]=_['keys'](_0xe3e7d1[_0x7479('0x43')]);_0x3cf9f5['filters']=_[_0x7479('0x58')](_0x3cf9f5[_0x7479('0x45')],_0x3cf9f5['query']);_0x48370e[_0x7479('0x46')]=_[_0x7479('0x58')](_0x3cf9f5[_0x7479('0x45')],qs[_0x7479('0x47')](_0xe3e7d1[_0x7479('0x43')]['fields']));_0x48370e[_0x7479('0x46')]=_0x48370e['attributes'][_0x7479('0x48')]?_0x48370e[_0x7479('0x46')]:_0x3cf9f5['model'];_0x48370e[_0x7479('0x67')]=qs[_0x7479('0x4b')](_0xe3e7d1[_0x7479('0x43')][_0x7479('0x4b')]);_0x48370e[_0x7479('0x4c')]=qs['filters'](_[_0x7479('0x4d')](_0xe3e7d1['query'],_0x3cf9f5[_0x7479('0x44')]));if(_0xe3e7d1[_0x7479('0x43')][_0x7479('0x4e')]){_0x48370e[_0x7479('0x4c')]=_[_0x7479('0x4f')](_0x48370e[_0x7479('0x4c')],{'$or':_['map'](_0x48370e['attributes'],function(_0xf4b77c){var _0x4bf212={};_0x4bf212[_0xf4b77c]={'$like':'%'+_0xe3e7d1[_0x7479('0x43')][_0x7479('0x4e')]+'%'};return _0x4bf212;})});}_0x48370e=_[_0x7479('0x4f')]({},_0x48370e,_0xe3e7d1[_0x7479('0x51')]);return _0x1c6984[_0x7479('0x81')](_0x48370e);}})[_0x7479('0x1d')](function(_0x4ad6fb){if(_0x4ad6fb){_0x539598=_0x4ad6fb[_0x7479('0x48')];if(!_0xe3e7d1[_0x7479('0x43')]['hasOwnProperty'](_0x7479('0x4a'))){_0x48370e[_0x7479('0x2c')]=qs[_0x7479('0x2c')](_0xe3e7d1['query'][_0x7479('0x2c')]);_0x48370e[_0x7479('0x2b')]=qs[_0x7479('0x2b')](_0xe3e7d1[_0x7479('0x43')]['offset']);}return _0x1c6984[_0x7479('0x81')](_0x48370e);}})['then'](function(_0x5437fe){if(_0x5437fe){return _0x5437fe?{'count':_0x539598,'rows':_0x5437fe}:null;}})['then'](respondWithResult(_0x5179b5,null))[_0x7479('0x25')](handleError(_0x5179b5,null));};exports['notify']=function(_0x85d938,_0x2d920b,_0x21e618){var _0xb81a70={'channel':_0x7479('0x82')};var _0x57d777=[];var _0x5e410b=[];var _0x19cca3={};return db['WhatsappAccount'][_0x7479('0x5b')]({'where':{'id':_0x85d938[_0x7479('0x55')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x7479('0x83')}]})[_0x7479('0x1d')](handleEntityNotFound(_0x2d920b,null))[_0x7479('0x1d')](function(_0x65f88c){_0xb81a70[_0x7479('0x84')]=_0x65f88c;if(_0xb81a70[_0x7479('0x84')]&&_0xb81a70[_0x7479('0x84')][_0x7479('0x40')]===_0x7479('0x85')&&_0x85d938[_0x7479('0x5d')][_0x7479('0x86')]){if(_0x85d938[_0x7479('0x5d')]['statuses'][_0x7479('0x48')]===0x0)return;if(_0x85d938[_0x7479('0x5d')][_0x7479('0x86')][0x0][_0x7479('0x87')]!==_0x7479('0x88'))return;return db[_0x7479('0x89')][_0x7479('0x33')]({'read':!![],'readAt':_0x85d938['body']['statuses'][0x0][_0x7479('0x8a')]},{'where':{'messageId':_0x85d938[_0x7479('0x5d')][_0x7479('0x86')][0x0][_0x7479('0x8b')]},'individualHooks':!![]})['then'](function(_0x27c089){return _0x2d920b[_0x7479('0x27')](0xc8)['json'](_0x27c089);});}_0xb81a70[_0x7479('0x8c')]=_[_0x7479('0x8d')](_0x65f88c[_0x7479('0x83')],[_0x7479('0x7f')],[_0x7479('0x8e')]);if(_0xb81a70[_0x7479('0x84')][_0x7479('0x83')]){delete _0xb81a70['account']['Applications'];}return db[_0x7479('0x8f')][_0x7479('0x64')]()['then'](function(_0x77d376){if(!_0x77d376){throw new db['Sequelize'][(_0x7479('0x90'))](_0x7479('0x91'));}_0x57d777=_['difference'](_[_0x7479('0x57')](_0x77d376),[_0x7479('0x92'),_0x7479('0x93')]);_0x5e410b=_[_0x7479('0x94')](_[_0x7479('0x57')](_0x77d376),[_0x7479('0x92'),_0x7479('0x93'),_0x7479('0x95'),_0x7479('0x96')]);_0xb81a70['body']={'mapKey':_0x7479('0x97')};if(_0xb81a70[_0x7479('0x84')]&&_0xb81a70[_0x7479('0x84')][_0x7479('0x40')]==='twilio'){_0xb81a70[_0x7479('0x5d')][_0x7479('0x98')]=_0x85d938[_0x7479('0x5d')][_0x7479('0x99')][_0x7479('0x9a')](_0x7479('0x9b'),'');_0xb81a70['body']['body']=_0x85d938['body'][_0x7479('0x9c')];_0xb81a70[_0x7479('0x5d')]['messageId']=_0x85d938[_0x7479('0x5d')][_0x7479('0x9d')];}if(_0xb81a70[_0x7479('0x84')]&&_0xb81a70[_0x7479('0x84')]['type']==='sinch'){_0xb81a70[_0x7479('0x5d')][_0x7479('0x98')]=_0x85d938['body'][_0x7479('0x9e')][0x0]['from'];_0xb81a70['body']['body']=_0x85d938[_0x7479('0x5d')][_0x7479('0x9e')][0x0][_0x7479('0x24')][_0x7479('0x5d')];_0xb81a70[_0x7479('0x5d')][_0x7479('0x9f')]=_0x85d938[_0x7479('0x5d')][_0x7479('0x9e')][0x0][_0x7479('0x8b')];}if(_0xb81a70[_0x7479('0x5d')]['id']){delete _0xb81a70[_0x7479('0x5d')]['id'];}if(_['isNil'](_0xb81a70[_0x7479('0x5d')]['from'])){throw new db['Sequelize'][(_0x7479('0x90'))](_0x7479('0xa0'));}if(_[_0x7479('0xa1')](_0xb81a70[_0x7479('0x5d')][_0x7479('0x5d')])||_0xb81a70[_0x7479('0x5d')][_0x7479('0x5d')]===''){throw new db['Sequelize'][(_0x7479('0x90'))](_0x7479('0xa2'));}if(_[_0x7479('0xa1')](_0xb81a70[_0x7479('0x5d')][_0x7479('0xa3')])){throw new db[(_0x7479('0xa4'))][(_0x7479('0x90'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5e410b);}if(!_['includes'](_0x5e410b,_0xb81a70[_0x7479('0x5d')][_0x7479('0xa3')])){throw new db['Sequelize'][(_0x7479('0x90'))](_0x7479('0xa5')+_0x5e410b);}_0x19cca3[_0xb81a70[_0x7479('0x5d')][_0x7479('0xa3')]]=_0xb81a70[_0x7479('0x5d')][_0x7479('0x98')];return db['CmList'][_0x7479('0x5b')]({'where':{'id':_0xb81a70[_0x7479('0x84')][_0x7479('0x96')]},'include':[{'model':db['CmContact'],'as':_0x7479('0xa6'),'where':_0x19cca3,'limit':0x1,'order':[[_0x7479('0x93'),_0x7479('0xa7')]]}]});})[_0x7479('0x1d')](handleEntityNotFound(_0x2d920b,null))[_0x7479('0x1d')](function(_0x15dbb3){if(_0x15dbb3){_0xb81a70[_0x7479('0xa8')]=_[_0x7479('0xa9')](_0x15dbb3,[_0x7479('0xa6')]);if(_0x15dbb3['Contacts'][_0x7479('0x48')]){return _0x15dbb3[_0x7479('0xa6')][0x0];}var _0x18a4aa=_[_0x7479('0x17')](_0xb81a70[_0x7479('0x5d')],{'firstName':_0xb81a70[_0x7479('0x5d')]['from'],'ListId':_0x15dbb3['id']});_0x18a4aa[_0xb81a70[_0x7479('0x5d')][_0x7479('0xa3')]]=_0xb81a70[_0x7479('0x5d')][_0x7479('0x98')];return db[_0x7479('0x8f')][_0x7479('0x5c')](_0x18a4aa,{'fields':_0x57d777,'raw':!![]});}})[_0x7479('0x1d')](handleEntityNotFound(_0x2d920b,null))['then'](function(_0x387893){if(_0x387893){_0xb81a70['contact']=_0x387893;var _0x500d44={'ContactId':_0x387893['id'],'phone':_0xb81a70[_0x7479('0x5d')]['from'],'WhatsappAccountId':_0x85d938[_0x7479('0x55')]['id']};var _0x2699ac={'ContactId':_0x387893['id'],'WhatsappAccountId':_0x85d938[_0x7479('0x55')]['id'],'closed':![]};return db[_0x7479('0xaa')][_0x7479('0x5b')]({'where':_0x2699ac})[_0x7479('0x1d')](function(_0x435934){if(_0x435934){return[_0x435934,![]];}return db[_0x7479('0xaa')][_0x7479('0x5c')](_0x500d44)[_0x7479('0x1d')](function(_0x3ffecb){return[_0x3ffecb,!![]];});});}})[_0x7479('0x70')](function(_0x34c6f6,_0xeffdb2){_0xb81a70['interaction']=_0x34c6f6[_0x7479('0x35')]({'plain':!![]});_0xb81a70[_0x7479('0xab')][_0x7479('0xac')]=![];if(_0xeffdb2){if(_0xb81a70[_0x7479('0x84')]['autoclose']){_0xb81a70[_0x7479('0x8c')][_0x7479('0xad')]({'id':0x0,'priority':_0xb81a70['applications'][_0x7479('0x48')]+0x1,'app':_0x7479('0xae'),'appdata':_0x7479('0xaf'),'interval':'*,*,*,*'});}_0xb81a70['interaction'][_0x7479('0xac')]=!![];}return db[_0x7479('0x89')][_0x7479('0x5c')]({'phone':_0xb81a70[_0x7479('0x5d')][_0x7479('0x98')],'messageId':_0xb81a70['body']['messageId'],'body':_0xb81a70[_0x7479('0x5d')][_0x7479('0x5d')],'WhatsappAccountId':_0x85d938[_0x7479('0x55')]['id'],'WhatsappInteractionId':_0x34c6f6['id'],'direction':'in','ContactId':_0x34c6f6[_0x7479('0xb0')],'AttachmentId':_0xb81a70[_0x7479('0x5d')][_0x7479('0xb1')]});})[_0x7479('0x1d')](function(_0x8f7780){_0xb81a70['message']=_0x8f7780;if(!_0xb81a70[_0x7479('0xab')][_0x7479('0xb2')])return;return db[_0x7479('0x76')][_0x7479('0x5b')]({'attributes':['id',_0x7479('0x39')],'where':{'id':_0xb81a70[_0x7479('0xab')]['UserId']}});})[_0x7479('0x1d')](function(_0x36dc60){if(_0x36dc60){_0xb81a70[_0x7479('0x8c')][_0x7479('0xb3')]({'id':0x0,'priority':0x0,'app':_0x7479('0xb4'),'appdata':_0x36dc60[_0x7479('0x39')]+','+(_0xb81a70[_0x7479('0x84')][_0x7479('0xb5')]||0xa),'interval':_0x7479('0xb6')});}if(!_0xb81a70[_0x7479('0xab')]['queueId'])return;return db[_0x7479('0xb7')][_0x7479('0x5b')]({'attributes':['id',_0x7479('0x39')],'where':{'id':_0xb81a70[_0x7479('0xab')]['queueId']}});})[_0x7479('0x1d')](function(_0x1c93ea){if(_0x1c93ea){_0xb81a70[_0x7479('0x8c')][_0x7479('0xb3')]({'id':0x0,'priority':0x1,'app':_0x7479('0xb8'),'appdata':_0x1c93ea[_0x7479('0x39')]+','+(_0xb81a70[_0x7479('0x84')]['waitForTheAssignedQueue']||0x12c),'interval':_0x7479('0xb6')});}return respondWithRpcPromise(_0x7479('0xb9'),_0x7479('0xba'),_0xb81a70);})[_0x7479('0x1d')](function(_0x589d0f){if(_0x589d0f){var _0xe484b0=0xc8;var _0x565a39=_0x7479('0xbb');logger[_0x7479('0xbc')](_0x7479('0x21'),_0x565a39,_0xe484b0,_0x7479('0xbd'));logger[_0x7479('0x20')](_0x7479('0xbe'),_0x565a39,_0xe484b0,'entity\x20found',JSON['stringify'](_0x589d0f));if(_0xb81a70[_0x7479('0x84')][_0x7479('0x40')]===_0x7479('0xbf')){return _0x2d920b['status'](_0xe484b0)[_0x7479('0x2d')]('Content-Type',_0x7479('0xc0'))[_0x7479('0x3a')]('\x0a');}else{return _0x2d920b[_0x7479('0x27')](_0xe484b0)[_0x7479('0x2f')](_0x589d0f);}}});})[_0x7479('0x25')](handleError(_0x2d920b,null));};exports[_0x7479('0x3a')]=function(_0x20fed9,_0x2db3f3,_0x353da3){var _0x34f9db,_0x49e1b1,_0x201b8c;if(_[_0x7479('0xa1')](_0x20fed9[_0x7479('0x5d')][_0x7479('0x5d')])||_0x20fed9[_0x7479('0x5d')][_0x7479('0x5d')]===''){throw new db['Sequelize'][(_0x7479('0x90'))](_0x7479('0xa2'));}if(_[_0x7479('0xa1')](_0x20fed9[_0x7479('0x5d')]['to'])){throw new db[(_0x7479('0xa4'))][(_0x7479('0x90'))](_0x7479('0xc1'));}_0x34f9db=_0x20fed9[_0x7479('0x5d')]['to'];return db[_0x7479('0x3d')][_0x7479('0x5b')]({'where':{'id':_0x20fed9[_0x7479('0x55')]['id']},'include':[{'model':db['CmList'],'as':_0x7479('0xc2'),'include':[{'model':db[_0x7479('0x8f')],'as':_0x7479('0xa6'),'where':{'mobile':_0x34f9db},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x7479('0x1d')](handleEntityNotFound(_0x2db3f3,null))['then'](function(_0xd5931){if(_0xd5931&&_0xd5931['List']){_0x49e1b1=_0xd5931['get']({'plain':!![]});if(_0x49e1b1[_0x7479('0xc2')]&&_0x49e1b1[_0x7479('0xc2')][_0x7479('0xa6')][_0x7479('0x48')]){return _0x49e1b1[_0x7479('0xc2')][_0x7479('0xa6')][0x0];}return db['CmContact'][_0x7479('0x5c')](_[_0x7479('0x17')](_0x20fed9['body'],{'firstName':_0x34f9db,'mobile':_0x34f9db,'phone':_0x34f9db,'ListId':_0x49e1b1['ListId']}));}})[_0x7479('0x1d')](handleEntityNotFound(_0x2db3f3,null))['then'](function(_0x515673){if(_0x515673){_0x201b8c=_0x515673;return db[_0x7479('0xaa')]['find']({'where':{'ContactId':_0x201b8c['id'],'closed':![],'WhatsappAccountId':_0x49e1b1['id']}})[_0x7479('0x1d')](function(_0x3914df){if(_0x3914df){return[_0x3914df,![]];}return db[_0x7479('0xaa')][_0x7479('0x5c')]({'UserId':_0x20fed9[_0x7479('0x5e')]['id'],'ContactId':_0x201b8c['id'],'WhatsappAccountId':_0x49e1b1['id'],'phone':_0x34f9db,'firstMsgDirection':'out','Messages':[_[_0x7479('0x4f')](_0x20fed9['body'],{'read':![],'body':_0x20fed9[_0x7479('0x5d')][_0x7479('0x5d')],'phone':_0x34f9db,'WhatsappAccountId':_0x49e1b1['id'],'UserId':_0x20fed9[_0x7479('0x5e')]['id'],'ContactId':_0x201b8c['id']})]},{'include':[{'model':db[_0x7479('0x89')],'as':'Messages'}]})[_0x7479('0x1d')](function(_0x18d207){return[_0x18d207,!![]];});});}})[_0x7479('0x70')](function(_0x43f5c9,_0x5a6ee3){if(_0x5a6ee3){return _0x43f5c9;}return db[_0x7479('0x89')][_0x7479('0x5c')](_[_0x7479('0x4f')](_0x20fed9[_0x7479('0x5d')],{'read':![],'body':_0x20fed9[_0x7479('0x5d')][_0x7479('0x5d')],'phone':_0x34f9db,'WhatsappAccountId':_0x49e1b1['id'],'WhatsappInteractionId':_0x43f5c9['id'],'UserId':_0x20fed9[_0x7479('0x5e')]['id'],'ContactId':_0x201b8c['id']}))[_0x7479('0x1d')](function(_0x4fd649){_0x43f5c9['dataValues'][_0x7479('0xc3')]=[];_0x43f5c9[_0x7479('0xc4')][_0x7479('0xc3')][_0x7479('0xad')](_0x4fd649['dataValues']);return _0x43f5c9;});})[_0x7479('0x1d')](respondWithResult(_0x2db3f3,null))[_0x7479('0x25')](handleError(_0x2db3f3,null));}; \ No newline at end of file +var _0x6bea=['map','WhatsappAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','filters','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','hasOwnProperty','sort','removeDispositions','ids','CannedAnswer','findOne','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','transaction','Transaction','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','finally','getApplications','whatsapp','account','sinch','statuses','read','WhatsappMessage','timestamp','Applications','priority','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','ListId','mobile','twilio','From','replace','whatsapp:','Body','MessageSid','from','notifications','messageId','message_id','isNil','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','DESC','list','Contacts','contact','WhatsappInteraction','interaction','autoclose','applications','unmanaged','*,*,*,*','created','UserId','unshift','agent','waitForTheAssignedAgent','queueId','WhatsappQueue','queue','waitForTheAssignedQueue','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','CmList','List','dataValues','Messages','push','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','client','http','then','info','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','get','WhatsappAccounts','destroy','end','stack','name','send','index','Pause','mandatoryDispositionPause'];(function(_0x5a0df0,_0x31aae9){var _0x2213d6=function(_0x2bba43){while(--_0x2bba43){_0x5a0df0['push'](_0x5a0df0['shift']());}};_0x2213d6(++_0x31aae9);}(_0x6bea,0x85));var _0xa6be=function(_0xa0f903,_0x4402b1){_0xa0f903=_0xa0f903-0x0;var _0x36ebd1=_0x6bea[_0xa0f903];return _0x36ebd1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa6be('0x0'));var zipdir=require(_0xa6be('0x1'));var jsonpatch=require(_0xa6be('0x2'));var rp=require(_0xa6be('0x3'));var moment=require(_0xa6be('0x4'));var BPromise=require(_0xa6be('0x5'));var Mustache=require(_0xa6be('0x6'));var util=require(_0xa6be('0x7'));var path=require(_0xa6be('0x8'));var sox=require('sox');var csv=require(_0xa6be('0x9'));var ejs=require(_0xa6be('0xa'));var fs=require('fs');var fs_extra=require(_0xa6be('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa6be('0xc'));var toCsv=require(_0xa6be('0x9'));var querystring=require(_0xa6be('0xd'));var Papa=require(_0xa6be('0xe'));var Redis=require(_0xa6be('0xf'));var authService=require(_0xa6be('0x10'));var qs=require(_0xa6be('0x11'));var as=require(_0xa6be('0x12'));var hardwareService=require(_0xa6be('0x13'));var logger=require(_0xa6be('0x14'))('api');var utils=require(_0xa6be('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa6be('0x16'))['db'];config['redis']=_[_0xa6be('0x17')](config[_0xa6be('0x18')],{'host':_0xa6be('0x19'),'port':0x18eb});var socket=require(_0xa6be('0x1a'))(new Redis(config[_0xa6be('0x18')]));require(_0xa6be('0x1b'))[_0xa6be('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0xa6be('0x1d')][_0xa6be('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x5b3896,_0x21b314,_0x1f8c5b,_0x332f00){return new BPromise(function(_0x37e813,_0x48ee96){var _0xfdb50d=_0x332f00||client;return _0xfdb50d['request'](_0x5b3896,_0x1f8c5b)[_0xa6be('0x1f')](function(_0x10a7b6){logger[_0xa6be('0x20')]('WhatsappAccount,\x20%s,\x20%s',_0x21b314,_0xa6be('0x21'));logger[_0xa6be('0x22')](_0xa6be('0x23'),_0x21b314,_0xa6be('0x21'),JSON[_0xa6be('0x24')](_0x10a7b6));if(_0x10a7b6[_0xa6be('0x25')]){if(_0x10a7b6['error'][_0xa6be('0x26')]===0x1f4){logger['error'](_0xa6be('0x27'),_0x21b314,_0x10a7b6[_0xa6be('0x25')]['message']);return _0x48ee96(_0x10a7b6[_0xa6be('0x25')][_0xa6be('0x28')]);}logger[_0xa6be('0x25')](_0xa6be('0x27'),_0x21b314,_0x10a7b6['error']['message']);return _0x37e813(_0x10a7b6['error'][_0xa6be('0x28')]);}else{logger[_0xa6be('0x20')](_0xa6be('0x27'),_0x21b314,_0xa6be('0x21'));_0x37e813(_0x10a7b6['result'][_0xa6be('0x28')]);}})['catch'](function(_0x5de3c1){logger['error'](_0xa6be('0x27'),_0x21b314,_0x5de3c1);_0x48ee96(_0x5de3c1);});});}function respondWithStatusCode(_0x2936c8,_0x43ae30){_0x43ae30=_0x43ae30||0xcc;return function(_0x4dca0c){if(_0x4dca0c){return _0x2936c8[_0xa6be('0x29')](_0x43ae30);}return _0x2936c8['status'](_0x43ae30)['end']();};}function respondWithResult(_0xc0cf5f,_0x4c729b){_0x4c729b=_0x4c729b||0xc8;return function(_0x90c6ad){if(_0x90c6ad){return _0xc0cf5f[_0xa6be('0x2a')](_0x4c729b)[_0xa6be('0x2b')](_0x90c6ad);}};}function respondWithFilteredResult(_0x341592,_0x80ea58){return function(_0xd88815){if(_0xd88815){var _0x567eb3=typeof _0x80ea58[_0xa6be('0x2c')]===_0xa6be('0x2d')&&typeof _0x80ea58[_0xa6be('0x2e')]===_0xa6be('0x2d');var _0x1e187f=_0xd88815[_0xa6be('0x2f')];var _0x2ba4a0=_0x567eb3?0x0:_0x80ea58[_0xa6be('0x2c')];var _0x25575b=_0x567eb3?_0xd88815[_0xa6be('0x2f')]:_0x80ea58[_0xa6be('0x2c')]+_0x80ea58['limit'];var _0x59e2a9;if(_0x25575b>=_0x1e187f){_0x25575b=_0x1e187f;_0x59e2a9=0xc8;}else{_0x59e2a9=0xce;}_0x341592['status'](_0x59e2a9);return _0x341592[_0xa6be('0x30')](_0xa6be('0x31'),_0x2ba4a0+'-'+_0x25575b+'/'+_0x1e187f)[_0xa6be('0x2b')](_0xd88815);}return null;};}function patchUpdates(_0x2f9b44){return function(_0x15fde2){try{jsonpatch[_0xa6be('0x32')](_0x15fde2,_0x2f9b44,!![]);}catch(_0x190449){return BPromise['reject'](_0x190449);}return _0x15fde2[_0xa6be('0x33')]();};}function saveUpdates(_0x5023a1,_0x1291c4){return function(_0x4ae577){if(_0x4ae577){return _0x4ae577[_0xa6be('0x34')](_0x5023a1)[_0xa6be('0x1f')](function(_0x209581){return _0x209581;});}return null;};}function removeEntity(_0xee8d79,_0x2eb77a){return function(_0x1c75f6){if(_0x1c75f6){return _0x1c75f6['destroy']()['then'](function(){var _0x2f0d22=_0x1c75f6[_0xa6be('0x35')]({'plain':!![]});var _0x47e4e8=_0xa6be('0x36');return db['UserProfileResource'][_0xa6be('0x37')]({'where':{'type':_0x47e4e8,'resourceId':_0x2f0d22['id']}})[_0xa6be('0x1f')](function(){return _0x1c75f6;});})['then'](function(){_0xee8d79['status'](0xcc)[_0xa6be('0x38')]();});}};}function handleEntityNotFound(_0x269b33,_0x6c5628){return function(_0x5c0548){if(!_0x5c0548){_0x269b33[_0xa6be('0x29')](0x194);}return _0x5c0548;};}function handleError(_0xde9e5d,_0x4df7e7){_0x4df7e7=_0x4df7e7||0x1f4;return function(_0x228c58){logger[_0xa6be('0x25')](_0x228c58[_0xa6be('0x39')]);if(_0x228c58[_0xa6be('0x3a')]){delete _0x228c58['name'];}_0xde9e5d[_0xa6be('0x2a')](_0x4df7e7)[_0xa6be('0x3b')](_0x228c58);};}exports[_0xa6be('0x3c')]=function(_0x3de933,_0xb0c4d8){var _0x51cfb6={'include':[{'model':db[_0xa6be('0x3d')],'as':_0xa6be('0x3e')}]},_0x4c5496={},_0x11536c={'count':0x0,'rows':[]};var _0x593257=_[_0xa6be('0x3f')](db[_0xa6be('0x40')][_0xa6be('0x41')],function(_0x1c353a){return{'name':_0x1c353a[_0xa6be('0x42')],'type':_0x1c353a[_0xa6be('0x43')][_0xa6be('0x44')]};});_0x4c5496[_0xa6be('0x45')]=_[_0xa6be('0x3f')](_0x593257,_0xa6be('0x3a'));_0x4c5496[_0xa6be('0x46')]=_[_0xa6be('0x47')](_0x3de933[_0xa6be('0x46')]);_0x4c5496['filters']=_[_0xa6be('0x48')](_0x4c5496[_0xa6be('0x45')],_0x4c5496[_0xa6be('0x46')]);_0x51cfb6[_0xa6be('0x49')]=_[_0xa6be('0x48')](_0x4c5496[_0xa6be('0x45')],qs[_0xa6be('0x4a')](_0x3de933[_0xa6be('0x46')]['fields']));_0x51cfb6[_0xa6be('0x49')]=_0x51cfb6['attributes'][_0xa6be('0x4b')]?_0x51cfb6[_0xa6be('0x49')]:_0x4c5496['model'];if(!_0x3de933[_0xa6be('0x46')]['hasOwnProperty'](_0xa6be('0x4c'))){_0x51cfb6[_0xa6be('0x2e')]=qs[_0xa6be('0x2e')](_0x3de933[_0xa6be('0x46')][_0xa6be('0x2e')]);_0x51cfb6['offset']=qs[_0xa6be('0x2c')](_0x3de933[_0xa6be('0x46')][_0xa6be('0x2c')]);}_0x51cfb6[_0xa6be('0x4d')]=qs['sort'](_0x3de933['query']['sort']);_0x51cfb6['where']=qs[_0xa6be('0x4e')](_[_0xa6be('0x4f')](_0x3de933['query'],_0x4c5496[_0xa6be('0x4e')]),_0x593257);if(_0x3de933[_0xa6be('0x46')]['filter']){_0x51cfb6[_0xa6be('0x50')]=_[_0xa6be('0x51')](_0x51cfb6[_0xa6be('0x50')],{'$or':_[_0xa6be('0x3f')](_0x593257,function(_0x4da24a){if(_0x4da24a['type']!==_0xa6be('0x52')){var _0x5ea515={};_0x5ea515[_0x4da24a[_0xa6be('0x3a')]]={'$like':'%'+_0x3de933['query'][_0xa6be('0x53')]+'%'};return _0x5ea515;}})});}_0x51cfb6=_['merge']({},_0x51cfb6,_0x3de933[_0xa6be('0x54')]);var _0x441687={'where':_0x51cfb6[_0xa6be('0x50')]};return db['WhatsappAccount'][_0xa6be('0x2f')](_0x441687)[_0xa6be('0x1f')](function(_0x2aa167){_0x11536c[_0xa6be('0x2f')]=_0x2aa167;if(_0x3de933['query'][_0xa6be('0x55')]){_0x51cfb6[_0xa6be('0x56')]=[{'all':!![]}];}return db['WhatsappAccount'][_0xa6be('0x57')](_0x51cfb6);})[_0xa6be('0x1f')](function(_0x46c35f){_0x11536c[_0xa6be('0x58')]=_0x46c35f;return _0x11536c;})['then'](respondWithFilteredResult(_0xb0c4d8,_0x51cfb6))[_0xa6be('0x59')](handleError(_0xb0c4d8,null));};exports['show']=function(_0x34228e,_0x1458a6){var _0x30737b={'raw':![],'where':{'id':_0x34228e[_0xa6be('0x5a')]['id']},'include':[{'model':db[_0xa6be('0x3d')],'as':_0xa6be('0x3e')}]},_0x4bf1c4={};_0x4bf1c4[_0xa6be('0x45')]=_['keys'](db[_0xa6be('0x40')][_0xa6be('0x41')]);_0x4bf1c4['query']=_[_0xa6be('0x47')](_0x34228e[_0xa6be('0x46')]);_0x4bf1c4['filters']=_['intersection'](_0x4bf1c4['model'],_0x4bf1c4[_0xa6be('0x46')]);_0x30737b[_0xa6be('0x49')]=_[_0xa6be('0x48')](_0x4bf1c4[_0xa6be('0x45')],qs[_0xa6be('0x4a')](_0x34228e['query'][_0xa6be('0x4a')]));_0x30737b[_0xa6be('0x49')]=_0x30737b[_0xa6be('0x49')][_0xa6be('0x4b')]?_0x30737b[_0xa6be('0x49')]:_0x4bf1c4[_0xa6be('0x45')];if(_0x34228e[_0xa6be('0x46')][_0xa6be('0x55')]){_0x30737b['include']=[{'all':!![]}];}_0x30737b=_[_0xa6be('0x51')]({},_0x30737b,_0x34228e['options']);return db[_0xa6be('0x40')][_0xa6be('0x5b')](_0x30737b)['then'](handleEntityNotFound(_0x1458a6,null))[_0xa6be('0x1f')](respondWithResult(_0x1458a6,null))[_0xa6be('0x59')](handleError(_0x1458a6,null));};exports[_0xa6be('0x5c')]=function(_0x74e947,_0x3c03b8){return db[_0xa6be('0x40')][_0xa6be('0x5c')](_0x74e947[_0xa6be('0x5d')],{})[_0xa6be('0x1f')](function(_0x30d74e){var _0x19bff4=_0x74e947[_0xa6be('0x5e')][_0xa6be('0x35')]({'plain':!![]});if(!_0x19bff4)throw new Error(_0xa6be('0x5f'));if(_0x19bff4[_0xa6be('0x60')]===_0xa6be('0x5e')){var _0x3d3623=_0x30d74e[_0xa6be('0x35')]({'plain':!![]});var _0x209596='WhatsappAccounts';return db[_0xa6be('0x61')][_0xa6be('0x5b')]({'where':{'name':_0x209596,'userProfileId':_0x19bff4['userProfileId']},'raw':!![]})[_0xa6be('0x1f')](function(_0x2659d2){if(_0x2659d2&&_0x2659d2[_0xa6be('0x62')]===0x0){return db[_0xa6be('0x63')]['create']({'name':_0x3d3623[_0xa6be('0x3a')],'resourceId':_0x3d3623['id'],'type':_0x2659d2['name'],'sectionId':_0x2659d2['id']},{})[_0xa6be('0x1f')](function(){return _0x30d74e;});}else{return _0x30d74e;}})[_0xa6be('0x59')](function(_0x5b84da){logger[_0xa6be('0x25')](_0xa6be('0x64'),_0x5b84da);throw _0x5b84da;});}return _0x30d74e;})['then'](respondWithResult(_0x3c03b8,0xc9))[_0xa6be('0x59')](handleError(_0x3c03b8,null));};exports[_0xa6be('0x34')]=function(_0x1ec733,_0x300233){if(_0x1ec733[_0xa6be('0x5d')]['id']){delete _0x1ec733[_0xa6be('0x5d')]['id'];}return db[_0xa6be('0x40')][_0xa6be('0x5b')]({'where':{'id':_0x1ec733[_0xa6be('0x5a')]['id']},'include':[{'model':db[_0xa6be('0x3d')],'as':_0xa6be('0x3e')}]})[_0xa6be('0x1f')](handleEntityNotFound(_0x300233,null))[_0xa6be('0x1f')](saveUpdates(_0x1ec733[_0xa6be('0x5d')],null))['then'](respondWithResult(_0x300233,null))[_0xa6be('0x59')](handleError(_0x300233,null));};exports[_0xa6be('0x37')]=function(_0x3e6046,_0x374114){return db[_0xa6be('0x40')][_0xa6be('0x5b')]({'where':{'id':_0x3e6046[_0xa6be('0x5a')]['id']}})[_0xa6be('0x1f')](handleEntityNotFound(_0x374114,null))[_0xa6be('0x1f')](removeEntity(_0x374114,null))[_0xa6be('0x59')](handleError(_0x374114,null));};exports['describe']=function(_0x491665,_0x3ca173){return db[_0xa6be('0x40')][_0xa6be('0x65')]()['then'](respondWithResult(_0x3ca173,null))[_0xa6be('0x59')](handleError(_0x3ca173,null));};exports[_0xa6be('0x66')]=function(_0x483b8d,_0x4a244e,_0x593760){if(_0x483b8d[_0xa6be('0x5d')]['id']){delete _0x483b8d[_0xa6be('0x5d')]['id'];}return db[_0xa6be('0x40')][_0xa6be('0x5b')]({'where':{'id':_0x483b8d[_0xa6be('0x5a')]['id']}})[_0xa6be('0x1f')](handleEntityNotFound(_0x4a244e,null))[_0xa6be('0x1f')](function(_0x4abdc6){if(_0x4abdc6){_0x483b8d['body'][_0xa6be('0x67')]=_0x4abdc6['id'];return db[_0xa6be('0x68')][_0xa6be('0x5c')](_0x483b8d['body']);}})['then'](respondWithResult(_0x4a244e,null))[_0xa6be('0x59')](handleError(_0x4a244e,null));};exports[_0xa6be('0x69')]=function(_0x590663,_0x12f44a,_0x39d0df){var _0x39b3b8={'raw':![],'where':{}};var _0x30ebd9={};var _0x49e20a={'count':0x0,'rows':[]};return db[_0xa6be('0x40')]['findOne']({'where':{'id':_0x590663[_0xa6be('0x5a')]['id']}})[_0xa6be('0x1f')](handleEntityNotFound(_0x12f44a,null))[_0xa6be('0x1f')](function(_0x131481){if(_0x131481){_0x30ebd9['model']=_['keys'](db[_0xa6be('0x68')][_0xa6be('0x41')]);_0x30ebd9[_0xa6be('0x46')]=_[_0xa6be('0x47')](_0x590663['query']);_0x30ebd9[_0xa6be('0x4e')]=_['intersection'](_0x30ebd9['model'],_0x30ebd9[_0xa6be('0x46')]);_0x39b3b8[_0xa6be('0x49')]=_['intersection'](_0x30ebd9[_0xa6be('0x45')],qs['fields'](_0x590663[_0xa6be('0x46')][_0xa6be('0x4a')]));_0x39b3b8[_0xa6be('0x49')]=_0x39b3b8[_0xa6be('0x49')][_0xa6be('0x4b')]?_0x39b3b8[_0xa6be('0x49')]:_0x30ebd9[_0xa6be('0x45')];if(!_0x590663[_0xa6be('0x46')][_0xa6be('0x6a')]('nolimit')){_0x39b3b8['limit']=qs[_0xa6be('0x2e')](_0x590663[_0xa6be('0x46')][_0xa6be('0x2e')]);_0x39b3b8['offset']=qs[_0xa6be('0x2c')](_0x590663['query'][_0xa6be('0x2c')]);}_0x39b3b8['order']=qs[_0xa6be('0x6b')](_0x590663['query'][_0xa6be('0x6b')]);_0x39b3b8['where']=qs['filters'](_[_0xa6be('0x4f')](_0x590663[_0xa6be('0x46')],_0x30ebd9[_0xa6be('0x4e')]));_0x39b3b8[_0xa6be('0x50')]['WhatsappAccountId']=_0x131481['id'];if(_0x590663[_0xa6be('0x46')][_0xa6be('0x53')]){_0x39b3b8[_0xa6be('0x50')]=_[_0xa6be('0x51')](_0x39b3b8['where'],{'$or':_[_0xa6be('0x3f')](_0x39b3b8[_0xa6be('0x49')],function(_0x52d626){var _0x5c8edc={};_0x5c8edc[_0x52d626]={'$like':'%'+_0x590663[_0xa6be('0x46')]['filter']+'%'};return _0x5c8edc;})});}_0x39b3b8=_[_0xa6be('0x51')]({},_0x39b3b8,_0x590663[_0xa6be('0x54')]);return db[_0xa6be('0x68')]['count']({'where':_0x39b3b8[_0xa6be('0x50')]})[_0xa6be('0x1f')](function(_0x2686c7){_0x49e20a[_0xa6be('0x2f')]=_0x2686c7;if(_0x590663[_0xa6be('0x46')][_0xa6be('0x55')]){_0x39b3b8[_0xa6be('0x56')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x39b3b8);})['then'](function(_0x170272){_0x49e20a[_0xa6be('0x58')]=_0x170272;return _0x49e20a;});}})[_0xa6be('0x1f')](respondWithFilteredResult(_0x12f44a,_0x39b3b8))[_0xa6be('0x59')](handleError(_0x12f44a,null));};exports['removeDispositions']=function(_0x317fda,_0x43026b,_0x25fefe){return db[_0xa6be('0x40')]['find']({'where':{'id':_0x317fda[_0xa6be('0x5a')]['id']}})[_0xa6be('0x1f')](handleEntityNotFound(_0x43026b,null))['then'](function(_0x278719){if(_0x278719){return _0x278719[_0xa6be('0x6c')](_0x317fda[_0xa6be('0x46')][_0xa6be('0x6d')]);}})['then'](respondWithStatusCode(_0x43026b,null))[_0xa6be('0x59')](handleError(_0x43026b,null));};exports['addAnswer']=function(_0x506363,_0x269387,_0xe0eb60){if(_0x506363[_0xa6be('0x5d')]['id']){delete _0x506363[_0xa6be('0x5d')]['id'];}return db[_0xa6be('0x40')][_0xa6be('0x5b')]({'where':{'id':_0x506363[_0xa6be('0x5a')]['id']}})[_0xa6be('0x1f')](handleEntityNotFound(_0x269387,null))['then'](function(_0x378ed9){if(_0x378ed9){_0x506363[_0xa6be('0x5d')][_0xa6be('0x67')]=_0x378ed9['id'];return db[_0xa6be('0x6e')][_0xa6be('0x5c')](_0x506363['body']);}})['then'](respondWithResult(_0x269387,null))['catch'](handleError(_0x269387,null));};exports['getAnswers']=function(_0x2effb2,_0x5a5f28,_0x333a21){var _0x406767={'raw':![],'where':{}};var _0xc7e9c3={};var _0x59b3d6={'count':0x0,'rows':[]};return db[_0xa6be('0x40')][_0xa6be('0x6f')]({'where':{'id':_0x2effb2['params']['id']}})['then'](handleEntityNotFound(_0x5a5f28,null))[_0xa6be('0x1f')](function(_0x34f1b2){if(_0x34f1b2){_0xc7e9c3[_0xa6be('0x45')]=_[_0xa6be('0x47')](db[_0xa6be('0x6e')][_0xa6be('0x41')]);_0xc7e9c3[_0xa6be('0x46')]=_['keys'](_0x2effb2[_0xa6be('0x46')]);_0xc7e9c3[_0xa6be('0x4e')]=_[_0xa6be('0x48')](_0xc7e9c3['model'],_0xc7e9c3[_0xa6be('0x46')]);_0x406767[_0xa6be('0x49')]=_[_0xa6be('0x48')](_0xc7e9c3[_0xa6be('0x45')],qs[_0xa6be('0x4a')](_0x2effb2[_0xa6be('0x46')]['fields']));_0x406767['attributes']=_0x406767[_0xa6be('0x49')][_0xa6be('0x4b')]?_0x406767[_0xa6be('0x49')]:_0xc7e9c3['model'];if(!_0x2effb2[_0xa6be('0x46')][_0xa6be('0x6a')](_0xa6be('0x4c'))){_0x406767[_0xa6be('0x2e')]=qs[_0xa6be('0x2e')](_0x2effb2[_0xa6be('0x46')][_0xa6be('0x2e')]);_0x406767[_0xa6be('0x2c')]=qs[_0xa6be('0x2c')](_0x2effb2[_0xa6be('0x46')][_0xa6be('0x2c')]);}_0x406767[_0xa6be('0x4d')]=qs['sort'](_0x2effb2[_0xa6be('0x46')]['sort']);_0x406767['where']=qs['filters'](_[_0xa6be('0x4f')](_0x2effb2[_0xa6be('0x46')],_0xc7e9c3[_0xa6be('0x4e')]));_0x406767[_0xa6be('0x50')][_0xa6be('0x67')]=_0x34f1b2['id'];if(_0x2effb2[_0xa6be('0x46')]['filter']){_0x406767['where']=_[_0xa6be('0x51')](_0x406767[_0xa6be('0x50')],{'$or':_['map'](_0x406767['attributes'],function(_0x485e6c){var _0x2f42c1={};_0x2f42c1[_0x485e6c]={'$like':'%'+_0x2effb2[_0xa6be('0x46')]['filter']+'%'};return _0x2f42c1;})});}_0x406767=_[_0xa6be('0x51')]({},_0x406767,_0x2effb2['options']);return db[_0xa6be('0x6e')][_0xa6be('0x2f')]({'where':_0x406767[_0xa6be('0x50')]})[_0xa6be('0x1f')](function(_0x27d34c){_0x59b3d6['count']=_0x27d34c;if(_0x2effb2[_0xa6be('0x46')][_0xa6be('0x55')]){_0x406767[_0xa6be('0x56')]=[{'all':!![]}];}return db[_0xa6be('0x6e')][_0xa6be('0x57')](_0x406767);})[_0xa6be('0x1f')](function(_0x177884){_0x59b3d6['rows']=_0x177884;return _0x59b3d6;});}})['then'](respondWithFilteredResult(_0x5a5f28,_0x406767))[_0xa6be('0x59')](handleError(_0x5a5f28,null));};exports['removeAnswers']=function(_0x2129dd,_0x1d1342,_0x5e0c93){return db['WhatsappAccount'][_0xa6be('0x5b')]({'where':{'id':_0x2129dd[_0xa6be('0x5a')]['id']}})[_0xa6be('0x1f')](handleEntityNotFound(_0x1d1342,null))[_0xa6be('0x1f')](function(_0xc682c8){if(_0xc682c8){return _0xc682c8['removeAnswers'](_0x2129dd[_0xa6be('0x46')][_0xa6be('0x6d')]);}})['then'](respondWithStatusCode(_0x1d1342,null))[_0xa6be('0x59')](handleError(_0x1d1342,null));};exports['addAgents']=function(_0x32fcac,_0x4b7135,_0x2244e1){return db[_0xa6be('0x40')][_0xa6be('0x5b')]({'where':{'id':_0x32fcac[_0xa6be('0x5a')]['id']}})[_0xa6be('0x1f')](handleEntityNotFound(_0x4b7135,null))[_0xa6be('0x1f')](function(_0x17494b){if(_0x17494b){return _0x17494b[_0xa6be('0x70')](_0x32fcac[_0xa6be('0x5d')][_0xa6be('0x6d')],_[_0xa6be('0x71')](_0x32fcac['body'],[_0xa6be('0x6d'),'id'])||{})[_0xa6be('0x72')](function(_0x547b87){for(var _0x5142d5=0x0;_0x5142d5<_0x32fcac['body'][_0xa6be('0x6d')]['length'];_0x5142d5+=0x1){socket[_0xa6be('0x73')](_0xa6be('0x74'),{'UserId':Number(_0x32fcac['body']['ids'][_0x5142d5]),'WhatsappAccountId':Number(_0x32fcac['params']['id'])});}return _0x547b87;});}})['then'](respondWithResult(_0x4b7135,null))['catch'](handleError(_0x4b7135,null));};exports[_0xa6be('0x75')]=function(_0x1c2629,_0xbaeca6,_0x58ab7b){return db[_0xa6be('0x40')][_0xa6be('0x5b')]({'where':{'id':_0x1c2629[_0xa6be('0x5a')]['id']}})[_0xa6be('0x1f')](handleEntityNotFound(_0xbaeca6,null))[_0xa6be('0x1f')](function(_0x3770ab){if(_0x3770ab){return _0x3770ab[_0xa6be('0x75')](_0x1c2629[_0xa6be('0x46')][_0xa6be('0x6d')])[_0xa6be('0x1f')](function(){if(_[_0xa6be('0x76')](_0x1c2629[_0xa6be('0x46')][_0xa6be('0x6d')])){for(var _0x2b634a=0x0;_0x2b634a<_0x1c2629[_0xa6be('0x46')][_0xa6be('0x6d')][_0xa6be('0x4b')];_0x2b634a+=0x1){socket[_0xa6be('0x73')](_0xa6be('0x77'),{'UserId':Number(_0x1c2629[_0xa6be('0x46')][_0xa6be('0x6d')][_0x2b634a]),'WhatsappAccountId':Number(_0x1c2629[_0xa6be('0x5a')]['id'])});}}else{socket[_0xa6be('0x73')]('userWhatsappAccount:remove',{'UserId':Number(_0x1c2629[_0xa6be('0x46')]['ids']),'WhatsappAccountId':Number(_0x1c2629[_0xa6be('0x5a')]['id'])});}});}})[_0xa6be('0x1f')](respondWithStatusCode(_0xbaeca6,null))[_0xa6be('0x59')](handleError(_0xbaeca6,null));};exports[_0xa6be('0x78')]=function(_0x41a018,_0x2c2828,_0x45bd3e){var _0x33871b={};var _0x2075d0={};var _0x1f7f00;var _0x15edaf;return db[_0xa6be('0x40')]['findOne']({'where':{'id':_0x41a018[_0xa6be('0x5a')]['id']}})[_0xa6be('0x1f')](handleEntityNotFound(_0x2c2828,null))[_0xa6be('0x1f')](function(_0x4a89a5){if(_0x4a89a5){_0x1f7f00=_0x4a89a5;_0x2075d0[_0xa6be('0x45')]=_[_0xa6be('0x47')](db[_0xa6be('0x79')][_0xa6be('0x41')]);_0x2075d0[_0xa6be('0x46')]=_[_0xa6be('0x47')](_0x41a018[_0xa6be('0x46')]);_0x2075d0[_0xa6be('0x4e')]=_['intersection'](_0x2075d0[_0xa6be('0x45')],_0x2075d0[_0xa6be('0x46')]);_0x33871b['attributes']=_[_0xa6be('0x48')](_0x2075d0[_0xa6be('0x45')],qs[_0xa6be('0x4a')](_0x41a018['query']['fields']));_0x33871b[_0xa6be('0x49')]=_0x33871b['attributes'][_0xa6be('0x4b')]?_0x33871b[_0xa6be('0x49')]:_0x2075d0[_0xa6be('0x45')];_0x33871b['order']=qs[_0xa6be('0x6b')](_0x41a018['query']['sort']);_0x33871b[_0xa6be('0x50')]=qs[_0xa6be('0x4e')](_[_0xa6be('0x4f')](_0x41a018[_0xa6be('0x46')],_0x2075d0[_0xa6be('0x4e')]));if(_0x41a018[_0xa6be('0x46')][_0xa6be('0x53')]){_0x33871b[_0xa6be('0x50')]=_[_0xa6be('0x51')](_0x33871b['where'],{'$or':_['map'](_0x33871b[_0xa6be('0x49')],function(_0x58c579){var _0x577f37={};_0x577f37[_0x58c579]={'$like':'%'+_0x41a018[_0xa6be('0x46')][_0xa6be('0x53')]+'%'};return _0x577f37;})});}_0x33871b=_[_0xa6be('0x51')]({},_0x33871b,_0x41a018[_0xa6be('0x54')]);return _0x1f7f00['getAgents'](_0x33871b);}})[_0xa6be('0x1f')](function(_0x349fcf){if(_0x349fcf){_0x15edaf=_0x349fcf[_0xa6be('0x4b')];if(!_0x41a018[_0xa6be('0x46')]['hasOwnProperty'](_0xa6be('0x4c'))){_0x33871b['limit']=qs[_0xa6be('0x2e')](_0x41a018[_0xa6be('0x46')]['limit']);_0x33871b[_0xa6be('0x2c')]=qs[_0xa6be('0x2c')](_0x41a018['query'][_0xa6be('0x2c')]);}return _0x1f7f00[_0xa6be('0x78')](_0x33871b);}})['then'](function(_0x4d98ba){if(_0x4d98ba){return _0x4d98ba?{'count':_0x15edaf,'rows':_0x4d98ba}:null;}})['then'](respondWithResult(_0x2c2828,null))[_0xa6be('0x59')](handleError(_0x2c2828,null));};exports[_0xa6be('0x7a')]=function(_0x42ea95,_0x58b127){var _0x2af365=_0x42ea95['params']['id'];var _0x315c3b=_0x42ea95[_0xa6be('0x5d')];var _0x2da743=0xc8;var _0xb49efb=null;return db['sequelize'][_0xa6be('0x7b')]({'isolationLevel':db['sequelize'][_0xa6be('0x7c')]['ISOLATION_LEVELS'][_0xa6be('0x7d')]},function(_0x1449e7){return db[_0xa6be('0x40')][_0xa6be('0x6f')]({'where':{'id':_0x2af365},'transaction':_0x1449e7})[_0xa6be('0x1f')](function(_0x4866cb){if(_0x4866cb){return db['WhatsappApplication'][_0xa6be('0x37')]({'where':{'WhatsappAccountId':_0x2af365},'transaction':_0x1449e7})[_0xa6be('0x1f')](function(){var _0x31d5bd=_['map'](_0x315c3b,function(_0x260266){_0x260266[_0xa6be('0x67')]=_0x2af365;return _0x260266;});return db[_0xa6be('0x7e')][_0xa6be('0x7f')](_0x31d5bd,{'transaction':_0x1449e7});});}else{_0x2da743=0x194;_0xb49efb=[];}});})[_0xa6be('0x1f')](function(){if(_0x2da743!==0x194){return db[_0xa6be('0x7e')][_0xa6be('0x80')]({'where':{'WhatsappAccountId':_0x2af365},'order':'priority'})['then'](function(_0x2e0cb0){_0xb49efb=_0x2e0cb0;});}})[_0xa6be('0x59')](function(_0x566b52){_0x2da743=0x1f4;logger[_0xa6be('0x25')](_0x566b52[_0xa6be('0x39')]);if(_0x566b52['name']){delete _0x566b52[_0xa6be('0x3a')];}_0xb49efb=_0x566b52;})[_0xa6be('0x81')](function(){if(_0xb49efb===null){_0x58b127['sendStatus'](_0x2da743);}else{if(_0x2da743===0x1f4){_0x58b127[_0xa6be('0x2a')](_0x2da743)[_0xa6be('0x3b')](_0xb49efb);}else{_0x58b127[_0xa6be('0x2a')](_0x2da743)[_0xa6be('0x2b')](_0xb49efb);}}});};exports[_0xa6be('0x82')]=function(_0x5208c2,_0x516bcf,_0x51a035){var _0xc7ade6={};var _0x5f266e={};var _0x5dbe21;var _0x13a46b;return db[_0xa6be('0x40')][_0xa6be('0x6f')]({'where':{'id':_0x5208c2[_0xa6be('0x5a')]['id']}})['then'](handleEntityNotFound(_0x516bcf,null))['then'](function(_0x232774){if(_0x232774){_0x5dbe21=_0x232774;_0x5f266e[_0xa6be('0x45')]=_[_0xa6be('0x47')](db[_0xa6be('0x7e')][_0xa6be('0x41')]);_0x5f266e[_0xa6be('0x46')]=_[_0xa6be('0x47')](_0x5208c2['query']);_0x5f266e[_0xa6be('0x4e')]=_[_0xa6be('0x48')](_0x5f266e[_0xa6be('0x45')],_0x5f266e[_0xa6be('0x46')]);_0xc7ade6['attributes']=_['intersection'](_0x5f266e[_0xa6be('0x45')],qs[_0xa6be('0x4a')](_0x5208c2[_0xa6be('0x46')][_0xa6be('0x4a')]));_0xc7ade6[_0xa6be('0x49')]=_0xc7ade6[_0xa6be('0x49')]['length']?_0xc7ade6[_0xa6be('0x49')]:_0x5f266e['model'];_0xc7ade6[_0xa6be('0x4d')]=qs[_0xa6be('0x6b')](_0x5208c2[_0xa6be('0x46')][_0xa6be('0x6b')]);_0xc7ade6[_0xa6be('0x50')]=qs[_0xa6be('0x4e')](_[_0xa6be('0x4f')](_0x5208c2[_0xa6be('0x46')],_0x5f266e[_0xa6be('0x4e')]));if(_0x5208c2[_0xa6be('0x46')][_0xa6be('0x53')]){_0xc7ade6[_0xa6be('0x50')]=_[_0xa6be('0x51')](_0xc7ade6[_0xa6be('0x50')],{'$or':_[_0xa6be('0x3f')](_0xc7ade6[_0xa6be('0x49')],function(_0x5c50d8){var _0x1fc5a8={};_0x1fc5a8[_0x5c50d8]={'$like':'%'+_0x5208c2[_0xa6be('0x46')]['filter']+'%'};return _0x1fc5a8;})});}_0xc7ade6=_[_0xa6be('0x51')]({},_0xc7ade6,_0x5208c2[_0xa6be('0x54')]);return _0x5dbe21[_0xa6be('0x82')](_0xc7ade6);}})[_0xa6be('0x1f')](function(_0x2aafd9){if(_0x2aafd9){_0x13a46b=_0x2aafd9[_0xa6be('0x4b')];if(!_0x5208c2[_0xa6be('0x46')]['hasOwnProperty'](_0xa6be('0x4c'))){_0xc7ade6[_0xa6be('0x2e')]=qs[_0xa6be('0x2e')](_0x5208c2[_0xa6be('0x46')][_0xa6be('0x2e')]);_0xc7ade6[_0xa6be('0x2c')]=qs[_0xa6be('0x2c')](_0x5208c2['query'][_0xa6be('0x2c')]);}return _0x5dbe21[_0xa6be('0x82')](_0xc7ade6);}})['then'](function(_0x69666f){if(_0x69666f){return _0x69666f?{'count':_0x13a46b,'rows':_0x69666f}:null;}})[_0xa6be('0x1f')](respondWithResult(_0x516bcf,null))['catch'](handleError(_0x516bcf,null));};exports['notify']=function(_0x3ec4e3,_0x2d8705,_0x372ed5){var _0x15efe5={'channel':_0xa6be('0x83')};var _0x375f3f=[];var _0x163bfb=[];var _0x4b85e8={};return db[_0xa6be('0x40')][_0xa6be('0x5b')]({'where':{'id':_0x3ec4e3['params']['id']},'include':[{'model':db[_0xa6be('0x7e')],'as':'Applications'}]})[_0xa6be('0x1f')](handleEntityNotFound(_0x2d8705,null))[_0xa6be('0x1f')](function(_0x1f19a6){_0x15efe5['account']=_0x1f19a6;if(_0x15efe5[_0xa6be('0x84')]&&_0x15efe5['account'][_0xa6be('0x43')]===_0xa6be('0x85')&&_0x3ec4e3[_0xa6be('0x5d')][_0xa6be('0x86')]){if(_0x3ec4e3[_0xa6be('0x5d')][_0xa6be('0x86')]['length']===0x0)return;if(_0x3ec4e3[_0xa6be('0x5d')][_0xa6be('0x86')][0x0]['state']!==_0xa6be('0x87'))return;return db[_0xa6be('0x88')][_0xa6be('0x34')]({'read':!![],'readAt':_0x3ec4e3['body'][_0xa6be('0x86')][0x0][_0xa6be('0x89')]},{'where':{'messageId':_0x3ec4e3['body']['statuses'][0x0]['message_id']},'individualHooks':!![]})['then'](function(_0x4bb415){return _0x2d8705[_0xa6be('0x2a')](0xc8)[_0xa6be('0x2b')](_0x4bb415);});}_0x15efe5['applications']=_['orderBy'](_0x1f19a6[_0xa6be('0x8a')],[_0xa6be('0x8b')],['asc']);if(_0x15efe5[_0xa6be('0x84')][_0xa6be('0x8a')]){delete _0x15efe5[_0xa6be('0x84')]['Applications'];}return db[_0xa6be('0x8c')][_0xa6be('0x65')]()[_0xa6be('0x1f')](function(_0x5c10d3){if(!_0x5c10d3){throw new db[(_0xa6be('0x8d'))][(_0xa6be('0x8e'))](_0xa6be('0x8f'));}_0x375f3f=_['difference'](_[_0xa6be('0x47')](_0x5c10d3),[_0xa6be('0x90'),_0xa6be('0x91')]);_0x163bfb=_[_0xa6be('0x92')](_[_0xa6be('0x47')](_0x5c10d3),[_0xa6be('0x90'),_0xa6be('0x91'),'CompanyId',_0xa6be('0x93')]);_0x15efe5['body']={'mapKey':_0xa6be('0x94')};if(_0x15efe5['account']&&_0x15efe5[_0xa6be('0x84')]['type']===_0xa6be('0x95')){_0x15efe5[_0xa6be('0x5d')]['from']=_0x3ec4e3[_0xa6be('0x5d')][_0xa6be('0x96')][_0xa6be('0x97')](_0xa6be('0x98'),'');_0x15efe5[_0xa6be('0x5d')][_0xa6be('0x5d')]=_0x3ec4e3[_0xa6be('0x5d')][_0xa6be('0x99')];_0x15efe5[_0xa6be('0x5d')]['messageId']=_0x3ec4e3[_0xa6be('0x5d')][_0xa6be('0x9a')];}if(_0x15efe5['account']&&_0x15efe5[_0xa6be('0x84')][_0xa6be('0x43')]===_0xa6be('0x85')){_0x15efe5[_0xa6be('0x5d')][_0xa6be('0x9b')]=_0x3ec4e3[_0xa6be('0x5d')][_0xa6be('0x9c')][0x0][_0xa6be('0x9b')];_0x15efe5[_0xa6be('0x5d')][_0xa6be('0x5d')]=_0x3ec4e3[_0xa6be('0x5d')][_0xa6be('0x9c')][0x0]['message'][_0xa6be('0x5d')];_0x15efe5[_0xa6be('0x5d')][_0xa6be('0x9d')]=_0x3ec4e3[_0xa6be('0x5d')][_0xa6be('0x9c')][0x0][_0xa6be('0x9e')];}if(_0x15efe5[_0xa6be('0x5d')]['id']){delete _0x15efe5[_0xa6be('0x5d')]['id'];}if(_[_0xa6be('0x9f')](_0x15efe5['body'][_0xa6be('0x9b')])){throw new db[(_0xa6be('0x8d'))][(_0xa6be('0x8e'))](_0xa6be('0xa0'));}if(_[_0xa6be('0x9f')](_0x15efe5[_0xa6be('0x5d')][_0xa6be('0x5d')])||_0x15efe5['body'][_0xa6be('0x5d')]===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xa6be('0x9f')](_0x15efe5[_0xa6be('0x5d')][_0xa6be('0xa1')])){throw new db['Sequelize'][(_0xa6be('0x8e'))](_0xa6be('0xa2')+_0x163bfb);}if(!_[_0xa6be('0xa3')](_0x163bfb,_0x15efe5[_0xa6be('0x5d')][_0xa6be('0xa1')])){throw new db[(_0xa6be('0x8d'))]['ValidationError'](_0xa6be('0xa4')+_0x163bfb);}_0x4b85e8[_0x15efe5[_0xa6be('0x5d')]['mapKey']]=_0x15efe5[_0xa6be('0x5d')]['from'];return db['CmList'][_0xa6be('0x5b')]({'where':{'id':_0x15efe5[_0xa6be('0x84')][_0xa6be('0x93')]},'include':[{'model':db[_0xa6be('0x8c')],'as':'Contacts','where':_0x4b85e8,'limit':0x1,'order':[[_0xa6be('0x91'),_0xa6be('0xa5')]]}]});})['then'](handleEntityNotFound(_0x2d8705,null))[_0xa6be('0x1f')](function(_0x4846ee){if(_0x4846ee){_0x15efe5[_0xa6be('0xa6')]=_[_0xa6be('0x71')](_0x4846ee,['Contacts']);if(_0x4846ee[_0xa6be('0xa7')]['length']){return _0x4846ee['Contacts'][0x0];}var _0x115791=_[_0xa6be('0x17')](_0x15efe5['body'],{'firstName':_0x15efe5[_0xa6be('0x5d')]['from'],'ListId':_0x4846ee['id']});_0x115791[_0x15efe5[_0xa6be('0x5d')][_0xa6be('0xa1')]]=_0x15efe5[_0xa6be('0x5d')][_0xa6be('0x9b')];return db['CmContact'][_0xa6be('0x5c')](_0x115791,{'fields':_0x375f3f,'raw':!![]});}})[_0xa6be('0x1f')](handleEntityNotFound(_0x2d8705,null))[_0xa6be('0x1f')](function(_0x3ace7a){if(_0x3ace7a){_0x15efe5[_0xa6be('0xa8')]=_0x3ace7a;var _0x1f6fe5={'ContactId':_0x3ace7a['id'],'phone':_0x15efe5[_0xa6be('0x5d')]['from'],'WhatsappAccountId':_0x3ec4e3['params']['id']};var _0x1d9796={'ContactId':_0x3ace7a['id'],'WhatsappAccountId':_0x3ec4e3[_0xa6be('0x5a')]['id'],'closed':![]};return db[_0xa6be('0xa9')][_0xa6be('0x5b')]({'where':_0x1d9796})['then'](function(_0x8d4403){if(_0x8d4403){return[_0x8d4403,![]];}return db[_0xa6be('0xa9')][_0xa6be('0x5c')](_0x1f6fe5)[_0xa6be('0x1f')](function(_0x478eee){return[_0x478eee,!![]];});});}})[_0xa6be('0x72')](function(_0x1b3cb2,_0x4f6942){_0x15efe5[_0xa6be('0xaa')]=_0x1b3cb2['get']({'plain':!![]});_0x15efe5['interaction']['created']=![];if(_0x4f6942){if(_0x15efe5[_0xa6be('0x84')][_0xa6be('0xab')]){_0x15efe5['applications']['push']({'id':0x0,'priority':_0x15efe5[_0xa6be('0xac')][_0xa6be('0x4b')]+0x1,'app':'close','appdata':_0xa6be('0xad'),'interval':_0xa6be('0xae')});}_0x15efe5[_0xa6be('0xaa')][_0xa6be('0xaf')]=!![];}return db[_0xa6be('0x88')]['create']({'phone':_0x15efe5['body'][_0xa6be('0x9b')],'messageId':_0x15efe5[_0xa6be('0x5d')]['messageId'],'body':_0x15efe5[_0xa6be('0x5d')][_0xa6be('0x5d')],'WhatsappAccountId':_0x3ec4e3['params']['id'],'WhatsappInteractionId':_0x1b3cb2['id'],'direction':'in','ContactId':_0x1b3cb2['ContactId'],'AttachmentId':_0x15efe5['body']['AttachmentId']});})[_0xa6be('0x1f')](function(_0x423469){_0x15efe5[_0xa6be('0x28')]=_0x423469;if(!_0x15efe5[_0xa6be('0xaa')][_0xa6be('0xb0')])return;return db[_0xa6be('0x79')][_0xa6be('0x5b')]({'attributes':['id',_0xa6be('0x3a')],'where':{'id':_0x15efe5[_0xa6be('0xaa')]['UserId']}});})[_0xa6be('0x1f')](function(_0x34aad4){if(_0x34aad4){_0x15efe5['applications'][_0xa6be('0xb1')]({'id':0x0,'priority':0x0,'app':_0xa6be('0xb2'),'appdata':_0x34aad4[_0xa6be('0x3a')]+','+(_0x15efe5[_0xa6be('0x84')][_0xa6be('0xb3')]||0xa),'interval':'*,*,*,*'});}if(!_0x15efe5[_0xa6be('0xaa')][_0xa6be('0xb4')])return;return db[_0xa6be('0xb5')]['find']({'attributes':['id',_0xa6be('0x3a')],'where':{'id':_0x15efe5[_0xa6be('0xaa')][_0xa6be('0xb4')]}});})['then'](function(_0x495250){if(_0x495250){_0x15efe5['applications'][_0xa6be('0xb1')]({'id':0x0,'priority':0x1,'app':_0xa6be('0xb6'),'appdata':_0x495250['name']+','+(_0x15efe5[_0xa6be('0x84')][_0xa6be('0xb7')]||0x12c),'interval':_0xa6be('0xae')});}return respondWithRpcPromise('Start',_0xa6be('0xb8'),_0x15efe5);})['then'](function(_0x5c1f08){if(_0x5c1f08){var _0x57a4e5=0xc8;var _0x326994=_0xa6be('0xb9');logger[_0xa6be('0x20')](_0xa6be('0x23'),_0x326994,_0x57a4e5,'entity\x20found');logger[_0xa6be('0x22')](_0xa6be('0xba'),_0x326994,_0x57a4e5,'entity\x20found',JSON[_0xa6be('0x24')](_0x5c1f08));if(_0x15efe5['account']['type']===_0xa6be('0x95')){return _0x2d8705['status'](_0x57a4e5)['set'](_0xa6be('0xbb'),_0xa6be('0xbc'))[_0xa6be('0x3b')]('\x0a');}else{return _0x2d8705[_0xa6be('0x2a')](_0x57a4e5)['json'](_0x5c1f08);}}});})[_0xa6be('0x59')](handleError(_0x2d8705,null));};exports[_0xa6be('0x3b')]=function(_0x52283b,_0x57181d,_0x483ffa){var _0x37e6b9,_0x169d5f,_0x2a4d81;if(_[_0xa6be('0x9f')](_0x52283b[_0xa6be('0x5d')][_0xa6be('0x5d')])||_0x52283b[_0xa6be('0x5d')]['body']===''){throw new db[(_0xa6be('0x8d'))][(_0xa6be('0x8e'))](_0xa6be('0xbd'));}if(_[_0xa6be('0x9f')](_0x52283b[_0xa6be('0x5d')]['to'])){throw new db[(_0xa6be('0x8d'))][(_0xa6be('0x8e'))](_0xa6be('0xbe'));}_0x37e6b9=_0x52283b[_0xa6be('0x5d')]['to'];return db['WhatsappAccount'][_0xa6be('0x5b')]({'where':{'id':_0x52283b[_0xa6be('0x5a')]['id']},'include':[{'model':db[_0xa6be('0xbf')],'as':'List','include':[{'model':db[_0xa6be('0x8c')],'as':_0xa6be('0xa7'),'where':{'mobile':_0x37e6b9},'limit':0x1,'order':[[_0xa6be('0x91'),'DESC']]}]}]})[_0xa6be('0x1f')](handleEntityNotFound(_0x57181d,null))[_0xa6be('0x1f')](function(_0x5727b4){if(_0x5727b4&&_0x5727b4[_0xa6be('0xc0')]){_0x169d5f=_0x5727b4['get']({'plain':!![]});if(_0x169d5f[_0xa6be('0xc0')]&&_0x169d5f['List'][_0xa6be('0xa7')][_0xa6be('0x4b')]){return _0x169d5f[_0xa6be('0xc0')][_0xa6be('0xa7')][0x0];}return db[_0xa6be('0x8c')][_0xa6be('0x5c')](_[_0xa6be('0x17')](_0x52283b[_0xa6be('0x5d')],{'firstName':_0x37e6b9,'mobile':_0x37e6b9,'phone':_0x37e6b9,'ListId':_0x169d5f[_0xa6be('0x93')]}));}})['then'](handleEntityNotFound(_0x57181d,null))[_0xa6be('0x1f')](function(_0x1ecec4){if(_0x1ecec4){_0x2a4d81=_0x1ecec4;return db[_0xa6be('0xa9')][_0xa6be('0x5b')]({'where':{'ContactId':_0x2a4d81['id'],'closed':![],'WhatsappAccountId':_0x169d5f['id']}})['then'](function(_0x2a2ed9){if(_0x2a2ed9){return[_0x2a2ed9,![]];}return db['WhatsappInteraction'][_0xa6be('0x5c')]({'UserId':_0x52283b[_0xa6be('0x5e')]['id'],'ContactId':_0x2a4d81['id'],'WhatsappAccountId':_0x169d5f['id'],'phone':_0x37e6b9,'firstMsgDirection':'out','Messages':[_[_0xa6be('0x51')](_0x52283b['body'],{'read':![],'body':_0x52283b[_0xa6be('0x5d')][_0xa6be('0x5d')],'phone':_0x37e6b9,'WhatsappAccountId':_0x169d5f['id'],'UserId':_0x52283b[_0xa6be('0x5e')]['id'],'ContactId':_0x2a4d81['id']})]},{'include':[{'model':db[_0xa6be('0x88')],'as':'Messages'}]})[_0xa6be('0x1f')](function(_0x543bfe){return[_0x543bfe,!![]];});});}})[_0xa6be('0x72')](function(_0x48a37b,_0x3e0a11){if(_0x3e0a11){return _0x48a37b;}return db[_0xa6be('0x88')][_0xa6be('0x5c')](_['merge'](_0x52283b[_0xa6be('0x5d')],{'read':![],'body':_0x52283b['body'][_0xa6be('0x5d')],'phone':_0x37e6b9,'WhatsappAccountId':_0x169d5f['id'],'WhatsappInteractionId':_0x48a37b['id'],'UserId':_0x52283b[_0xa6be('0x5e')]['id'],'ContactId':_0x2a4d81['id']}))[_0xa6be('0x1f')](function(_0x1a05d9){_0x48a37b[_0xa6be('0xc1')][_0xa6be('0xc2')]=[];_0x48a37b[_0xa6be('0xc1')][_0xa6be('0xc2')][_0xa6be('0xc3')](_0x1a05d9['dataValues']);return _0x48a37b;});})[_0xa6be('0x1f')](respondWithResult(_0x57181d,null))[_0xa6be('0x59')](handleError(_0x57181d,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 040bf25..65ffbd4 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 _0x8b9c=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappAccount','save'];(function(_0x3ccdf8,_0x584ceb){var _0x243dab=function(_0x1a90d1){while(--_0x1a90d1){_0x3ccdf8['push'](_0x3ccdf8['shift']());}};_0x243dab(++_0x584ceb);}(_0x8b9c,0x15a));var _0xc8b9=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x8b9c[_0x432682];return _0x463d05;};'use strict';var EventEmitter=require(_0xc8b9('0x0'));var WhatsappAccount=require(_0xc8b9('0x1'))['db'][_0xc8b9('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc8b9('0x3'),'afterUpdate':_0xc8b9('0x4'),'afterDestroy':_0xc8b9('0x5')};function emitEvent(_0x2b058e){return function(_0x24f833,_0x5e9dc9,_0x255e83){WhatsappAccountEvents[_0xc8b9('0x6')](_0x2b058e+':'+_0x24f833['id'],_0x24f833);WhatsappAccountEvents[_0xc8b9('0x6')](_0x2b058e,_0x24f833);_0x255e83(null);};}for(var e in events){if(events[_0xc8b9('0x7')](e)){var event=events[e];WhatsappAccount[_0xc8b9('0x8')](e,emitEvent(event));}}module[_0xc8b9('0x9')]=WhatsappAccountEvents; \ No newline at end of file +var _0x98d6=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','WhatsappAccount'];(function(_0x41e7d0,_0x5b933e){var _0x309df5=function(_0x37fb5d){while(--_0x37fb5d){_0x41e7d0['push'](_0x41e7d0['shift']());}};_0x309df5(++_0x5b933e);}(_0x98d6,0xf2));var _0x698d=function(_0x6ac0e6,_0x3ea3f4){_0x6ac0e6=_0x6ac0e6-0x0;var _0x3c39a1=_0x98d6[_0x6ac0e6];return _0x3c39a1;};'use strict';var EventEmitter=require(_0x698d('0x0'));var WhatsappAccount=require(_0x698d('0x1'))['db'][_0x698d('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x698d('0x3')};function emitEvent(_0x420170){return function(_0x4943c9,_0x1b85eb,_0x4cbca0){WhatsappAccountEvents[_0x698d('0x4')](_0x420170+':'+_0x4943c9['id'],_0x4943c9);WhatsappAccountEvents[_0x698d('0x4')](_0x420170,_0x4943c9);_0x4cbca0(null);};}for(var e in events){if(events[_0x698d('0x5')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0x698d('0x6')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 2c92e0d..a28a55d 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 _0xd70c=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','WhatsappAccount','lodash','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd70c,0xf5));var _0xcd70=function(_0x27d600,_0x5eabab){_0x27d600=_0x27d600-0x0;var _0x1014b4=_0xd70c[_0x27d600];return _0x1014b4;};'use strict';var _=require(_0xcd70('0x0'));var util=require(_0xcd70('0x1'));var logger=require(_0xcd70('0x2'))(_0xcd70('0x3'));var moment=require(_0xcd70('0x4'));var BPromise=require(_0xcd70('0x5'));var rp=require(_0xcd70('0x6'));var fs=require('fs');var path=require(_0xcd70('0x7'));var rimraf=require(_0xcd70('0x8'));var config=require(_0xcd70('0x9'));var attributes=require('./whatsappAccount.attributes');module[_0xcd70('0xa')]=function(_0x54946c,_0x4a5766){return _0x54946c[_0xcd70('0xb')](_0xcd70('0xc'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4db2=['util','api','moment','bluebird','request-promise','../../config/environment','exports','define','lodash'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x4db2,0x1b8));var _0x24db=function(_0x32f26d,_0x2c0b5d){_0x32f26d=_0x32f26d-0x0;var _0x5d9ddc=_0x4db2[_0x32f26d];return _0x5d9ddc;};'use strict';var _=require(_0x24db('0x0'));var util=require(_0x24db('0x1'));var logger=require('../../config/logger')(_0x24db('0x2'));var moment=require(_0x24db('0x3'));var BPromise=require(_0x24db('0x4'));var rp=require(_0x24db('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x24db('0x6'));var attributes=require('./whatsappAccount.attributes');module[_0x24db('0x7')]=function(_0x50bc8a,_0x265a00){return _0x50bc8a[_0x24db('0x8')]('WhatsappAccount',attributes,{'tableName':'whatsapp_accounts','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 63f3a68..e6136a6 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 _0xf6fd=['request','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','ShowWhatsappAccount','WhatsappAccount','find','options','where','attributes','include','map','model','then','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter'];(function(_0x62e8e7,_0x24e07f){var _0x3aa032=function(_0x1bf634){while(--_0x1bf634){_0x62e8e7['push'](_0x62e8e7['shift']());}};_0x3aa032(++_0x24e07f);}(_0xf6fd,0x12d));var _0xdf6f=function(_0x2175d3,_0x4a4824){_0x2175d3=_0x2175d3-0x0;var _0x360fe1=_0xf6fd[_0x2175d3];return _0x360fe1;};'use strict';var _=require(_0xdf6f('0x0'));var util=require('util');var moment=require(_0xdf6f('0x1'));var BPromise=require(_0xdf6f('0x2'));var rs=require(_0xdf6f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdf6f('0x4'))['db'];var utils=require(_0xdf6f('0x5'));var logger=require('../../config/logger')(_0xdf6f('0x6'));var config=require(_0xdf6f('0x7'));var jayson=require(_0xdf6f('0x8'));var client=jayson[_0xdf6f('0x9')][_0xdf6f('0xa')]({'port':0x232a});config[_0xdf6f('0xb')]=_['defaults'](config['redis'],{'host':_0xdf6f('0xc'),'port':0x18eb});var socket=require(_0xdf6f('0xd'))(new Redis(config['redis']));require('./whatsappAccount.socket')['register'](socket);function respondWithRpcPromise(_0x44ace4,_0x43e79a,_0x227fbb){return new BPromise(function(_0x4c9384,_0x25f4af){return client[_0xdf6f('0xe')](_0x44ace4,_0x227fbb)['then'](function(_0x4ec1b0){logger['info'](_0xdf6f('0xf'),_0x43e79a,_0xdf6f('0x10'));logger[_0xdf6f('0x11')](_0xdf6f('0x12'),_0x43e79a,_0xdf6f('0x10'),JSON[_0xdf6f('0x13')](_0x4ec1b0));if(_0x4ec1b0[_0xdf6f('0x14')]){if(_0x4ec1b0[_0xdf6f('0x14')][_0xdf6f('0x15')]===0x1f4){logger['error'](_0xdf6f('0xf'),_0x43e79a,_0x4ec1b0['error'][_0xdf6f('0x16')]);return _0x25f4af(_0x4ec1b0['error'][_0xdf6f('0x16')]);}logger[_0xdf6f('0x14')](_0xdf6f('0xf'),_0x43e79a,_0x4ec1b0['error'][_0xdf6f('0x16')]);return _0x4c9384(_0x4ec1b0[_0xdf6f('0x14')][_0xdf6f('0x16')]);}else{logger[_0xdf6f('0x17')](_0xdf6f('0xf'),_0x43e79a,_0xdf6f('0x10'));_0x4c9384(_0x4ec1b0['result'][_0xdf6f('0x16')]);}})[_0xdf6f('0x18')](function(_0x2ff75f){logger[_0xdf6f('0x14')](_0xdf6f('0xf'),_0x43e79a,_0x2ff75f);_0x25f4af(_0x2ff75f);});});}exports[_0xdf6f('0x19')]=function(_0x38a630){var _0x470891=this;return new Promise(function(_0xe3cba5,_0x474400){return db[_0xdf6f('0x1a')][_0xdf6f('0x1b')]({'raw':_0x38a630['options']?_0x38a630['options']['raw']===undefined?!![]:![]:!![],'where':_0x38a630[_0xdf6f('0x1c')]?_0x38a630['options'][_0xdf6f('0x1d')]||null:null,'attributes':_0x38a630[_0xdf6f('0x1c')]?_0x38a630[_0xdf6f('0x1c')][_0xdf6f('0x1e')]||null:null,'include':_0x38a630['options']?_0x38a630[_0xdf6f('0x1c')][_0xdf6f('0x1f')]?_[_0xdf6f('0x20')](_0x38a630[_0xdf6f('0x1c')]['include'],function(_0x2a28b6){return{'model':db[_0x2a28b6[_0xdf6f('0x21')]],'as':_0x2a28b6['as'],'attributes':_0x2a28b6['attributes'],'include':_0x2a28b6['include']?_['map'](_0x2a28b6[_0xdf6f('0x1f')],function(_0x236fa9){return{'model':db[_0x236fa9[_0xdf6f('0x21')]],'as':_0x236fa9['as'],'attributes':_0x236fa9[_0xdf6f('0x1e')],'include':_0x236fa9['include']?_[_0xdf6f('0x20')](_0x236fa9[_0xdf6f('0x1f')],function(_0x3b78c6){return{'model':db[_0x3b78c6[_0xdf6f('0x21')]],'as':_0x3b78c6['as'],'attributes':_0x3b78c6[_0xdf6f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xdf6f('0x22')](function(_0x58c57a){logger[_0xdf6f('0x17')](_0xdf6f('0x19'),_0x38a630);logger[_0xdf6f('0x11')]('ShowWhatsappAccount',_0x38a630,JSON[_0xdf6f('0x13')](_0x58c57a));_0xe3cba5(_0x58c57a);})['catch'](function(_0x3433e7){logger[_0xdf6f('0x14')](_0xdf6f('0x19'),_0x3433e7[_0xdf6f('0x16')],_0x38a630);_0x474400(_0x470891[_0xdf6f('0x14')](0x1f4,_0x3433e7[_0xdf6f('0x16')]));});});}; \ No newline at end of file +var _0xa1e4=['include','map','model','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','ShowWhatsappAccount','WhatsappAccount','where','options','attributes'];(function(_0x19b744,_0x4e7f0f){var _0x54fcf1=function(_0xb2c3ee){while(--_0xb2c3ee){_0x19b744['push'](_0x19b744['shift']());}};_0x54fcf1(++_0x4e7f0f);}(_0xa1e4,0xcf));var _0x4a1e=function(_0x418f0b,_0xe47fcf){_0x418f0b=_0x418f0b-0x0;var _0x4c0491=_0xa1e4[_0x418f0b];return _0x4c0491;};'use strict';var _=require(_0x4a1e('0x0'));var util=require(_0x4a1e('0x1'));var moment=require(_0x4a1e('0x2'));var BPromise=require(_0x4a1e('0x3'));var rs=require(_0x4a1e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4a1e('0x5'));var logger=require(_0x4a1e('0x6'))('rpc');var config=require(_0x4a1e('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4a1e('0x8')]({'port':0x232a});config[_0x4a1e('0x9')]=_[_0x4a1e('0xa')](config[_0x4a1e('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x4a1e('0xb'))(new Redis(config['redis']));require(_0x4a1e('0xc'))[_0x4a1e('0xd')](socket);function respondWithRpcPromise(_0x3539ed,_0xd54415,_0x9b061d){return new BPromise(function(_0x11071b,_0x114861){return client[_0x4a1e('0xe')](_0x3539ed,_0x9b061d)[_0x4a1e('0xf')](function(_0x5ca05e){logger[_0x4a1e('0x10')](_0x4a1e('0x11'),_0xd54415,'request\x20sent');logger[_0x4a1e('0x12')](_0x4a1e('0x13'),_0xd54415,'request\x20sent',JSON[_0x4a1e('0x14')](_0x5ca05e));if(_0x5ca05e['error']){if(_0x5ca05e[_0x4a1e('0x15')][_0x4a1e('0x16')]===0x1f4){logger[_0x4a1e('0x15')](_0x4a1e('0x11'),_0xd54415,_0x5ca05e[_0x4a1e('0x15')][_0x4a1e('0x17')]);return _0x114861(_0x5ca05e[_0x4a1e('0x15')][_0x4a1e('0x17')]);}logger[_0x4a1e('0x15')](_0x4a1e('0x11'),_0xd54415,_0x5ca05e[_0x4a1e('0x15')]['message']);return _0x11071b(_0x5ca05e['error']['message']);}else{logger['info'](_0x4a1e('0x11'),_0xd54415,_0x4a1e('0x18'));_0x11071b(_0x5ca05e['result'][_0x4a1e('0x17')]);}})[_0x4a1e('0x19')](function(_0x591b2b){logger[_0x4a1e('0x15')](_0x4a1e('0x11'),_0xd54415,_0x591b2b);_0x114861(_0x591b2b);});});}exports[_0x4a1e('0x1a')]=function(_0x2e518b){var _0x267a80=this;return new Promise(function(_0x309011,_0x31b351){return db[_0x4a1e('0x1b')]['find']({'raw':_0x2e518b['options']?_0x2e518b['options']['raw']===undefined?!![]:![]:!![],'where':_0x2e518b['options']?_0x2e518b['options'][_0x4a1e('0x1c')]||null:null,'attributes':_0x2e518b[_0x4a1e('0x1d')]?_0x2e518b[_0x4a1e('0x1d')][_0x4a1e('0x1e')]||null:null,'include':_0x2e518b[_0x4a1e('0x1d')]?_0x2e518b[_0x4a1e('0x1d')][_0x4a1e('0x1f')]?_[_0x4a1e('0x20')](_0x2e518b[_0x4a1e('0x1d')][_0x4a1e('0x1f')],function(_0x327114){return{'model':db[_0x327114['model']],'as':_0x327114['as'],'attributes':_0x327114[_0x4a1e('0x1e')],'include':_0x327114[_0x4a1e('0x1f')]?_['map'](_0x327114['include'],function(_0x1dc3f6){return{'model':db[_0x1dc3f6[_0x4a1e('0x21')]],'as':_0x1dc3f6['as'],'attributes':_0x1dc3f6[_0x4a1e('0x1e')],'include':_0x1dc3f6[_0x4a1e('0x1f')]?_[_0x4a1e('0x20')](_0x1dc3f6['include'],function(_0x8f4c73){return{'model':db[_0x8f4c73[_0x4a1e('0x21')]],'as':_0x8f4c73['as'],'attributes':_0x8f4c73[_0x4a1e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4a1e('0xf')](function(_0x2f680f){logger[_0x4a1e('0x10')](_0x4a1e('0x1a'),_0x2e518b);logger['debug'](_0x4a1e('0x1a'),_0x2e518b,JSON[_0x4a1e('0x14')](_0x2f680f));_0x309011(_0x2f680f);})[_0x4a1e('0x19')](function(_0x84c84e){logger[_0x4a1e('0x15')](_0x4a1e('0x1a'),_0x84c84e[_0x4a1e('0x17')],_0x2e518b);_0x31b351(_0x267a80[_0x4a1e('0x15')](0x1f4,_0x84c84e[_0x4a1e('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 3b5cbd3..3554523 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 _0x5241=['./whatsappAccount.events','remove','update','emit','removeListener','length'];(function(_0x538fb4,_0x300d78){var _0x57204c=function(_0x513900){while(--_0x513900){_0x538fb4['push'](_0x538fb4['shift']());}};_0x57204c(++_0x300d78);}(_0x5241,0x9c));var _0x1524=function(_0x41e0c0,_0x4ac5fc){_0x41e0c0=_0x41e0c0-0x0;var _0x5837a2=_0x5241[_0x41e0c0];return _0x5837a2;};'use strict';var WhatsappAccountEvents=require(_0x1524('0x0'));var events=['save',_0x1524('0x1'),_0x1524('0x2')];function createListener(_0x428268,_0x15c07a){return function(_0x5c3069){_0x15c07a[_0x1524('0x3')](_0x428268,_0x5c3069);};}function removeListener(_0x4e9a81,_0x254f12){return function(){WhatsappAccountEvents[_0x1524('0x4')](_0x4e9a81,_0x254f12);};}exports['register']=function(_0x5e55b7){for(var _0x4e18b0=0x0,_0x55b488=events[_0x1524('0x5')];_0x4e18b0<_0x55b488;_0x4e18b0++){var _0x5b6763=events[_0x4e18b0];var _0x5a913c=createListener('whatsappAccount:'+_0x5b6763,_0x5e55b7);WhatsappAccountEvents['on'](_0x5b6763,_0x5a913c);}}; \ No newline at end of file +var _0xcd6a=['register','length','whatsappAccount:','save','remove','update'];(function(_0xb6b285,_0x596e01){var _0x11393c=function(_0x506469){while(--_0x506469){_0xb6b285['push'](_0xb6b285['shift']());}};_0x11393c(++_0x596e01);}(_0xcd6a,0x1b3));var _0xacd6=function(_0x91af23,_0x363f57){_0x91af23=_0x91af23-0x0;var _0x9ced06=_0xcd6a[_0x91af23];return _0x9ced06;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0xacd6('0x0'),_0xacd6('0x1'),_0xacd6('0x2')];function createListener(_0x343cd8,_0x377b14){return function(_0x1f6f96){_0x377b14['emit'](_0x343cd8,_0x1f6f96);};}function removeListener(_0x5225fc,_0x776b4){return function(){WhatsappAccountEvents['removeListener'](_0x5225fc,_0x776b4);};}exports[_0xacd6('0x3')]=function(_0x3c4c1e){for(var _0x2d22e6=0x0,_0xbbf453=events[_0xacd6('0x4')];_0x2d22e6<_0xbbf453;_0x2d22e6++){var _0xc170a6=events[_0x2d22e6];var _0x4e3baf=createListener(_0xacd6('0x5')+_0xc170a6,_0x3c4c1e);WhatsappAccountEvents['on'](_0xc170a6,_0x4e3baf);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 80cf366..e88eec8 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 _0x43f7=['post','create','put','/:id','update','delete','destroy','multer','path','connect-timeout','express','./whatsappApplication.controller','get','index','isAuthenticated','show'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x43f7,0x127));var _0x743f=function(_0x4d14ad,_0x4d25d8){_0x4d14ad=_0x4d14ad-0x0;var _0x1219c7=_0x43f7[_0x4d14ad];return _0x1219c7;};'use strict';var multer=require(_0x743f('0x0'));var util=require('util');var path=require(_0x743f('0x1'));var timeout=require(_0x743f('0x2'));var express=require(_0x743f('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x743f('0x4'));router[_0x743f('0x5')]('/',auth['isAuthenticated'](),controller[_0x743f('0x6')]);router['get']('/:id',auth[_0x743f('0x7')](),controller[_0x743f('0x8')]);router[_0x743f('0x9')]('/',auth['isAuthenticated'](),controller[_0x743f('0xa')]);router[_0x743f('0xb')](_0x743f('0xc'),auth[_0x743f('0x7')](),controller[_0x743f('0xd')]);router[_0x743f('0xe')]('/:id',auth[_0x743f('0x7')](),controller[_0x743f('0xf')]);module['exports']=router; \ No newline at end of file +var _0xb56a=['express','../../components/auth/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer','util','path'];(function(_0x2c1841,_0x505204){var _0x28d148=function(_0x5be79f){while(--_0x5be79f){_0x2c1841['push'](_0x2c1841['shift']());}};_0x28d148(++_0x505204);}(_0xb56a,0xfc));var _0xab56=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xb56a[_0x565ed7];return _0x183ad7;};'use strict';var multer=require(_0xab56('0x0'));var util=require(_0xab56('0x1'));var path=require(_0xab56('0x2'));var timeout=require('connect-timeout');var express=require(_0xab56('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xab56('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xab56('0x5'));var controller=require(_0xab56('0x6'));router[_0xab56('0x7')]('/',auth[_0xab56('0x8')](),controller[_0xab56('0x9')]);router[_0xab56('0x7')](_0xab56('0xa'),auth[_0xab56('0x8')](),controller[_0xab56('0xb')]);router[_0xab56('0xc')]('/',auth[_0xab56('0x8')](),controller['create']);router[_0xab56('0xd')](_0xab56('0xa'),auth[_0xab56('0x8')](),controller[_0xab56('0xe')]);router[_0xab56('0xf')](_0xab56('0xa'),auth[_0xab56('0x8')](),controller['destroy']);module[_0xab56('0x10')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 2daba77..b140847 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 _0xd8f0=['INTEGER','STRING','noop','TEXT','*,*,*,*','exports'];(function(_0x1264f2,_0xc22f3b){var _0x466ba8=function(_0x38fd53){while(--_0x38fd53){_0x1264f2['push'](_0x1264f2['shift']());}};_0x466ba8(++_0xc22f3b);}(_0xd8f0,0xb9));var _0x0d8f=function(_0x3ba79c,_0x1547d2){_0x3ba79c=_0x3ba79c-0x0;var _0xd2d1a4=_0xd8f0[_0x3ba79c];return _0xd2d1a4;};'use strict';var Sequelize=require('sequelize');module[_0x0d8f('0x0')]={'priority':{'type':Sequelize[_0x0d8f('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x0d8f('0x2')],'allowNull':![],'defaultValue':_0x0d8f('0x3')},'appdata':{'type':Sequelize[_0x0d8f('0x4')]()},'description':{'type':Sequelize[_0x0d8f('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x0d8f('0x5')}}; \ No newline at end of file +var _0x7dea=['INTEGER','STRING','noop','sequelize','exports'];(function(_0x17a871,_0x4a74dc){var _0x4b75fa=function(_0x330eef){while(--_0x330eef){_0x17a871['push'](_0x17a871['shift']());}};_0x4b75fa(++_0x4a74dc);}(_0x7dea,0x16b));var _0xa7de=function(_0x5cd577,_0x52484f){_0x5cd577=_0x5cd577-0x0;var _0x4803cb=_0x7dea[_0x5cd577];return _0x4803cb;};'use strict';var Sequelize=require(_0xa7de('0x0'));module[_0xa7de('0x1')]={'priority':{'type':Sequelize[_0xa7de('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xa7de('0x3')],'allowNull':![],'defaultValue':_0xa7de('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 67ea09b..844fc3c 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 _0xfa4d=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','options','WhatsappApplication','findAll','rows','show','keys','length','includeAll','include','merge','find','create','body','catch','params','eml-format','rimraf','fast-json-patch','mustache','util','path','sox','to-csv'];(function(_0x1dae94,_0x239003){var _0x36ce2d=function(_0x295f18){while(--_0x295f18){_0x1dae94['push'](_0x1dae94['shift']());}};_0x36ce2d(++_0x239003);}(_0xfa4d,0x90));var _0xdfa4=function(_0x32aec0,_0x43628c){_0x32aec0=_0x32aec0-0x0;var _0x55d698=_0xfa4d[_0x32aec0];return _0x55d698;};'use strict';var emlformat=require(_0xdfa4('0x0'));var rimraf=require(_0xdfa4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdfa4('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdfa4('0x3'));var util=require(_0xdfa4('0x4'));var path=require(_0xdfa4('0x5'));var sox=require(_0xdfa4('0x6'));var csv=require(_0xdfa4('0x7'));var ejs=require(_0xdfa4('0x8'));var fs=require('fs');var fs_extra=require(_0xdfa4('0x9'));var _=require(_0xdfa4('0xa'));var squel=require(_0xdfa4('0xb'));var crypto=require(_0xdfa4('0xc'));var jsforce=require(_0xdfa4('0xd'));var deskjs=require(_0xdfa4('0xe'));var toCsv=require(_0xdfa4('0x7'));var querystring=require(_0xdfa4('0xf'));var Papa=require(_0xdfa4('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdfa4('0x11'));var as=require(_0xdfa4('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdfa4('0x13'))('api');var utils=require(_0xdfa4('0x14'));var config=require(_0xdfa4('0x15'));var licenseUtil=require(_0xdfa4('0x16'));var db=require(_0xdfa4('0x17'))['db'];function respondWithStatusCode(_0x1f45d6,_0x2c56ff){_0x2c56ff=_0x2c56ff||0xcc;return function(_0x2896af){if(_0x2896af){return _0x1f45d6[_0xdfa4('0x18')](_0x2c56ff);}return _0x1f45d6[_0xdfa4('0x19')](_0x2c56ff)[_0xdfa4('0x1a')]();};}function respondWithResult(_0x3889eb,_0x101063){_0x101063=_0x101063||0xc8;return function(_0x239bde){if(_0x239bde){return _0x3889eb['status'](_0x101063)[_0xdfa4('0x1b')](_0x239bde);}};}function respondWithFilteredResult(_0x5d604b,_0x1e0140){return function(_0x566c09){if(_0x566c09){var _0x1284de=typeof _0x1e0140[_0xdfa4('0x1c')]==='undefined'&&typeof _0x1e0140[_0xdfa4('0x1d')]===_0xdfa4('0x1e');var _0x2d7fe6=_0x566c09[_0xdfa4('0x1f')];var _0xed6924=_0x1284de?0x0:_0x1e0140['offset'];var _0x5c2765=_0x1284de?_0x566c09[_0xdfa4('0x1f')]:_0x1e0140[_0xdfa4('0x1c')]+_0x1e0140[_0xdfa4('0x1d')];var _0x5d4412;if(_0x5c2765>=_0x2d7fe6){_0x5c2765=_0x2d7fe6;_0x5d4412=0xc8;}else{_0x5d4412=0xce;}_0x5d604b['status'](_0x5d4412);return _0x5d604b[_0xdfa4('0x20')]('Content-Range',_0xed6924+'-'+_0x5c2765+'/'+_0x2d7fe6)[_0xdfa4('0x1b')](_0x566c09);}return null;};}function patchUpdates(_0x36dd54){return function(_0x25701a){try{jsonpatch[_0xdfa4('0x21')](_0x25701a,_0x36dd54,!![]);}catch(_0x34fd7a){return BPromise[_0xdfa4('0x22')](_0x34fd7a);}return _0x25701a[_0xdfa4('0x23')]();};}function saveUpdates(_0x29d1e3,_0x486c77){return function(_0x359ba2){if(_0x359ba2){return _0x359ba2[_0xdfa4('0x24')](_0x29d1e3)['then'](function(_0x3024b6){return _0x3024b6;});}return null;};}function removeEntity(_0x405d50,_0x5ab8f6){return function(_0x3c77bf){if(_0x3c77bf){return _0x3c77bf[_0xdfa4('0x25')]()[_0xdfa4('0x26')](function(){_0x405d50['status'](0xcc)[_0xdfa4('0x1a')]();});}};}function handleEntityNotFound(_0x37f2d5,_0x41a6e9){return function(_0x524150){if(!_0x524150){_0x37f2d5[_0xdfa4('0x18')](0x194);}return _0x524150;};}function handleError(_0x1748ac,_0x4b2c8d){_0x4b2c8d=_0x4b2c8d||0x1f4;return function(_0x4fb820){logger[_0xdfa4('0x27')](_0x4fb820[_0xdfa4('0x28')]);if(_0x4fb820[_0xdfa4('0x29')]){delete _0x4fb820[_0xdfa4('0x29')];}_0x1748ac[_0xdfa4('0x19')](_0x4b2c8d)[_0xdfa4('0x2a')](_0x4fb820);};}exports[_0xdfa4('0x2b')]=function(_0x155a39,_0x195ed2){var _0xa5adc9={},_0x11b9db={},_0x2dc6c2={'count':0x0,'rows':[]};var _0xb2d02c=_[_0xdfa4('0x2c')](db['WhatsappApplication'][_0xdfa4('0x2d')],function(_0x400796){return{'name':_0x400796[_0xdfa4('0x2e')],'type':_0x400796[_0xdfa4('0x2f')][_0xdfa4('0x30')]};});_0x11b9db[_0xdfa4('0x31')]=_[_0xdfa4('0x2c')](_0xb2d02c,_0xdfa4('0x29'));_0x11b9db['query']=_['keys'](_0x155a39[_0xdfa4('0x32')]);_0x11b9db[_0xdfa4('0x33')]=_[_0xdfa4('0x34')](_0x11b9db[_0xdfa4('0x31')],_0x11b9db[_0xdfa4('0x32')]);_0xa5adc9[_0xdfa4('0x35')]=_[_0xdfa4('0x34')](_0x11b9db[_0xdfa4('0x31')],qs[_0xdfa4('0x36')](_0x155a39[_0xdfa4('0x32')][_0xdfa4('0x36')]));_0xa5adc9['attributes']=_0xa5adc9[_0xdfa4('0x35')]['length']?_0xa5adc9[_0xdfa4('0x35')]:_0x11b9db[_0xdfa4('0x31')];if(!_0x155a39[_0xdfa4('0x32')]['hasOwnProperty'](_0xdfa4('0x37'))){_0xa5adc9['limit']=qs[_0xdfa4('0x1d')](_0x155a39[_0xdfa4('0x32')]['limit']);_0xa5adc9[_0xdfa4('0x1c')]=qs[_0xdfa4('0x1c')](_0x155a39[_0xdfa4('0x32')][_0xdfa4('0x1c')]);}_0xa5adc9[_0xdfa4('0x38')]=qs['sort'](_0x155a39[_0xdfa4('0x32')][_0xdfa4('0x39')]);_0xa5adc9['where']=qs['filters'](_[_0xdfa4('0x3a')](_0x155a39[_0xdfa4('0x32')],_0x11b9db[_0xdfa4('0x33')]),_0xb2d02c);if(_0x155a39[_0xdfa4('0x32')][_0xdfa4('0x3b')]){_0xa5adc9[_0xdfa4('0x3c')]=_['merge'](_0xa5adc9['where'],{'$or':_['map'](_0xb2d02c,function(_0x4f8f13){if(_0x4f8f13['type']!=='VIRTUAL'){var _0x46078d={};_0x46078d[_0x4f8f13[_0xdfa4('0x29')]]={'$like':'%'+_0x155a39['query'][_0xdfa4('0x3b')]+'%'};return _0x46078d;}})});}_0xa5adc9=_['merge']({},_0xa5adc9,_0x155a39[_0xdfa4('0x3d')]);var _0x4f7c07={'where':_0xa5adc9['where']};return db[_0xdfa4('0x3e')][_0xdfa4('0x1f')](_0x4f7c07)[_0xdfa4('0x26')](function(_0x262a0a){_0x2dc6c2[_0xdfa4('0x1f')]=_0x262a0a;if(_0x155a39[_0xdfa4('0x32')]['includeAll']){_0xa5adc9['include']=[{'all':!![]}];}return db[_0xdfa4('0x3e')][_0xdfa4('0x3f')](_0xa5adc9);})[_0xdfa4('0x26')](function(_0x525a62){_0x2dc6c2[_0xdfa4('0x40')]=_0x525a62;return _0x2dc6c2;})[_0xdfa4('0x26')](respondWithFilteredResult(_0x195ed2,_0xa5adc9))['catch'](handleError(_0x195ed2,null));};exports[_0xdfa4('0x41')]=function(_0x1063e7,_0x47e9a0){var _0x4449d8={'raw':!![],'where':{'id':_0x1063e7['params']['id']}},_0x3ec03a={};_0x3ec03a[_0xdfa4('0x31')]=_['keys'](db[_0xdfa4('0x3e')][_0xdfa4('0x2d')]);_0x3ec03a['query']=_[_0xdfa4('0x42')](_0x1063e7['query']);_0x3ec03a[_0xdfa4('0x33')]=_['intersection'](_0x3ec03a['model'],_0x3ec03a[_0xdfa4('0x32')]);_0x4449d8['attributes']=_[_0xdfa4('0x34')](_0x3ec03a['model'],qs[_0xdfa4('0x36')](_0x1063e7[_0xdfa4('0x32')][_0xdfa4('0x36')]));_0x4449d8[_0xdfa4('0x35')]=_0x4449d8['attributes'][_0xdfa4('0x43')]?_0x4449d8[_0xdfa4('0x35')]:_0x3ec03a[_0xdfa4('0x31')];if(_0x1063e7[_0xdfa4('0x32')][_0xdfa4('0x44')]){_0x4449d8[_0xdfa4('0x45')]=[{'all':!![]}];}_0x4449d8=_[_0xdfa4('0x46')]({},_0x4449d8,_0x1063e7[_0xdfa4('0x3d')]);return db['WhatsappApplication'][_0xdfa4('0x47')](_0x4449d8)['then'](handleEntityNotFound(_0x47e9a0,null))[_0xdfa4('0x26')](respondWithResult(_0x47e9a0,null))['catch'](handleError(_0x47e9a0,null));};exports[_0xdfa4('0x48')]=function(_0x430ace,_0x36f048){return db[_0xdfa4('0x3e')][_0xdfa4('0x48')](_0x430ace[_0xdfa4('0x49')],{})[_0xdfa4('0x26')](respondWithResult(_0x36f048,0xc9))[_0xdfa4('0x4a')](handleError(_0x36f048,null));};exports[_0xdfa4('0x24')]=function(_0x1be5ca,_0xd06b1c){if(_0x1be5ca[_0xdfa4('0x49')]['id']){delete _0x1be5ca['body']['id'];}return db[_0xdfa4('0x3e')][_0xdfa4('0x47')]({'where':{'id':_0x1be5ca[_0xdfa4('0x4b')]['id']}})[_0xdfa4('0x26')](handleEntityNotFound(_0xd06b1c,null))[_0xdfa4('0x26')](saveUpdates(_0x1be5ca[_0xdfa4('0x49')],null))[_0xdfa4('0x26')](respondWithResult(_0xd06b1c,null))[_0xdfa4('0x4a')](handleError(_0xd06b1c,null));};exports[_0xdfa4('0x25')]=function(_0x2f8761,_0x325777){return db[_0xdfa4('0x3e')][_0xdfa4('0x47')]({'where':{'id':_0x2f8761[_0xdfa4('0x4b')]['id']}})['then'](handleEntityNotFound(_0x325777,null))[_0xdfa4('0x26')](removeEntity(_0x325777,null))[_0xdfa4('0x4a')](handleError(_0x325777,null));}; \ No newline at end of file +var _0xb7de=['end','undefined','limit','count','offset','set','Content-Range','json','reject','save','then','destroy','error','stack','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x1a137b,_0x39260d){var _0x2a433e=function(_0x25db91){while(--_0x25db91){_0x1a137b['push'](_0x1a137b['shift']());}};_0x2a433e(++_0x39260d);}(_0xb7de,0xc7));var _0xeb7d=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xb7de[_0x55e08b];return _0xd1a7ff;};'use strict';var emlformat=require(_0xeb7d('0x0'));var rimraf=require(_0xeb7d('0x1'));var zipdir=require(_0xeb7d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xeb7d('0x3'));var moment=require(_0xeb7d('0x4'));var BPromise=require(_0xeb7d('0x5'));var Mustache=require(_0xeb7d('0x6'));var util=require(_0xeb7d('0x7'));var path=require('path');var sox=require(_0xeb7d('0x8'));var csv=require(_0xeb7d('0x9'));var ejs=require(_0xeb7d('0xa'));var fs=require('fs');var fs_extra=require(_0xeb7d('0xb'));var _=require(_0xeb7d('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xeb7d('0xd'));var deskjs=require(_0xeb7d('0xe'));var toCsv=require(_0xeb7d('0x9'));var querystring=require(_0xeb7d('0xf'));var Papa=require('papaparse');var Redis=require(_0xeb7d('0x10'));var authService=require(_0xeb7d('0x11'));var qs=require(_0xeb7d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xeb7d('0x13'))('api');var utils=require(_0xeb7d('0x14'));var config=require(_0xeb7d('0x15'));var licenseUtil=require(_0xeb7d('0x16'));var db=require(_0xeb7d('0x17'))['db'];function respondWithStatusCode(_0x4583fa,_0x57eb05){_0x57eb05=_0x57eb05||0xcc;return function(_0x598828){if(_0x598828){return _0x4583fa[_0xeb7d('0x18')](_0x57eb05);}return _0x4583fa[_0xeb7d('0x19')](_0x57eb05)[_0xeb7d('0x1a')]();};}function respondWithResult(_0x1dafff,_0xb418){_0xb418=_0xb418||0xc8;return function(_0x5f29b0){if(_0x5f29b0){return _0x1dafff[_0xeb7d('0x19')](_0xb418)['json'](_0x5f29b0);}};}function respondWithFilteredResult(_0x284575,_0x45131f){return function(_0x35186c){if(_0x35186c){var _0x56dce2=typeof _0x45131f['offset']===_0xeb7d('0x1b')&&typeof _0x45131f[_0xeb7d('0x1c')]==='undefined';var _0x501111=_0x35186c[_0xeb7d('0x1d')];var _0x298c8d=_0x56dce2?0x0:_0x45131f['offset'];var _0x1bfa8a=_0x56dce2?_0x35186c[_0xeb7d('0x1d')]:_0x45131f[_0xeb7d('0x1e')]+_0x45131f[_0xeb7d('0x1c')];var _0x215a75;if(_0x1bfa8a>=_0x501111){_0x1bfa8a=_0x501111;_0x215a75=0xc8;}else{_0x215a75=0xce;}_0x284575[_0xeb7d('0x19')](_0x215a75);return _0x284575[_0xeb7d('0x1f')](_0xeb7d('0x20'),_0x298c8d+'-'+_0x1bfa8a+'/'+_0x501111)[_0xeb7d('0x21')](_0x35186c);}return null;};}function patchUpdates(_0x52324c){return function(_0x1507f5){try{jsonpatch['apply'](_0x1507f5,_0x52324c,!![]);}catch(_0xf2807d){return BPromise[_0xeb7d('0x22')](_0xf2807d);}return _0x1507f5[_0xeb7d('0x23')]();};}function saveUpdates(_0x5beab9,_0x19ad4f){return function(_0x1b68e8){if(_0x1b68e8){return _0x1b68e8['update'](_0x5beab9)[_0xeb7d('0x24')](function(_0x374f35){return _0x374f35;});}return null;};}function removeEntity(_0x431dc0,_0x3666db){return function(_0x3c58ba){if(_0x3c58ba){return _0x3c58ba[_0xeb7d('0x25')]()[_0xeb7d('0x24')](function(){_0x431dc0['status'](0xcc)[_0xeb7d('0x1a')]();});}};}function handleEntityNotFound(_0x392ba1,_0x1331ca){return function(_0x10f02c){if(!_0x10f02c){_0x392ba1[_0xeb7d('0x18')](0x194);}return _0x10f02c;};}function handleError(_0x3bf975,_0x1a2374){_0x1a2374=_0x1a2374||0x1f4;return function(_0x529986){logger[_0xeb7d('0x26')](_0x529986[_0xeb7d('0x27')]);if(_0x529986[_0xeb7d('0x28')]){delete _0x529986[_0xeb7d('0x28')];}_0x3bf975[_0xeb7d('0x19')](_0x1a2374)[_0xeb7d('0x29')](_0x529986);};}exports[_0xeb7d('0x2a')]=function(_0x310f25,_0x26592c){var _0x4c19c2={},_0x3387ab={},_0x3fcff4={'count':0x0,'rows':[]};var _0x9abd4b=_[_0xeb7d('0x2b')](db[_0xeb7d('0x2c')][_0xeb7d('0x2d')],function(_0x26118c){return{'name':_0x26118c[_0xeb7d('0x2e')],'type':_0x26118c[_0xeb7d('0x2f')][_0xeb7d('0x30')]};});_0x3387ab[_0xeb7d('0x31')]=_[_0xeb7d('0x2b')](_0x9abd4b,_0xeb7d('0x28'));_0x3387ab[_0xeb7d('0x32')]=_[_0xeb7d('0x33')](_0x310f25[_0xeb7d('0x32')]);_0x3387ab[_0xeb7d('0x34')]=_[_0xeb7d('0x35')](_0x3387ab[_0xeb7d('0x31')],_0x3387ab[_0xeb7d('0x32')]);_0x4c19c2[_0xeb7d('0x36')]=_[_0xeb7d('0x35')](_0x3387ab[_0xeb7d('0x31')],qs[_0xeb7d('0x37')](_0x310f25[_0xeb7d('0x32')][_0xeb7d('0x37')]));_0x4c19c2[_0xeb7d('0x36')]=_0x4c19c2[_0xeb7d('0x36')][_0xeb7d('0x38')]?_0x4c19c2[_0xeb7d('0x36')]:_0x3387ab[_0xeb7d('0x31')];if(!_0x310f25['query'][_0xeb7d('0x39')](_0xeb7d('0x3a'))){_0x4c19c2[_0xeb7d('0x1c')]=qs[_0xeb7d('0x1c')](_0x310f25[_0xeb7d('0x32')]['limit']);_0x4c19c2[_0xeb7d('0x1e')]=qs[_0xeb7d('0x1e')](_0x310f25['query'][_0xeb7d('0x1e')]);}_0x4c19c2[_0xeb7d('0x3b')]=qs[_0xeb7d('0x3c')](_0x310f25[_0xeb7d('0x32')][_0xeb7d('0x3c')]);_0x4c19c2[_0xeb7d('0x3d')]=qs[_0xeb7d('0x34')](_['pick'](_0x310f25[_0xeb7d('0x32')],_0x3387ab['filters']),_0x9abd4b);if(_0x310f25[_0xeb7d('0x32')][_0xeb7d('0x3e')]){_0x4c19c2[_0xeb7d('0x3d')]=_[_0xeb7d('0x3f')](_0x4c19c2[_0xeb7d('0x3d')],{'$or':_[_0xeb7d('0x2b')](_0x9abd4b,function(_0x398527){if(_0x398527[_0xeb7d('0x2f')]!==_0xeb7d('0x40')){var _0x3db105={};_0x3db105[_0x398527[_0xeb7d('0x28')]]={'$like':'%'+_0x310f25[_0xeb7d('0x32')][_0xeb7d('0x3e')]+'%'};return _0x3db105;}})});}_0x4c19c2=_[_0xeb7d('0x3f')]({},_0x4c19c2,_0x310f25[_0xeb7d('0x41')]);var _0x5ed81c={'where':_0x4c19c2['where']};return db[_0xeb7d('0x2c')][_0xeb7d('0x1d')](_0x5ed81c)[_0xeb7d('0x24')](function(_0x1589f6){_0x3fcff4[_0xeb7d('0x1d')]=_0x1589f6;if(_0x310f25[_0xeb7d('0x32')]['includeAll']){_0x4c19c2[_0xeb7d('0x42')]=[{'all':!![]}];}return db['WhatsappApplication'][_0xeb7d('0x43')](_0x4c19c2);})[_0xeb7d('0x24')](function(_0x2b6f97){_0x3fcff4[_0xeb7d('0x44')]=_0x2b6f97;return _0x3fcff4;})[_0xeb7d('0x24')](respondWithFilteredResult(_0x26592c,_0x4c19c2))['catch'](handleError(_0x26592c,null));};exports[_0xeb7d('0x45')]=function(_0x512c95,_0x5ba7ca){var _0x46babd={'raw':!![],'where':{'id':_0x512c95[_0xeb7d('0x46')]['id']}},_0x3152ba={};_0x3152ba[_0xeb7d('0x31')]=_[_0xeb7d('0x33')](db[_0xeb7d('0x2c')]['rawAttributes']);_0x3152ba[_0xeb7d('0x32')]=_[_0xeb7d('0x33')](_0x512c95['query']);_0x3152ba[_0xeb7d('0x34')]=_['intersection'](_0x3152ba[_0xeb7d('0x31')],_0x3152ba[_0xeb7d('0x32')]);_0x46babd['attributes']=_[_0xeb7d('0x35')](_0x3152ba[_0xeb7d('0x31')],qs[_0xeb7d('0x37')](_0x512c95['query'][_0xeb7d('0x37')]));_0x46babd[_0xeb7d('0x36')]=_0x46babd['attributes'][_0xeb7d('0x38')]?_0x46babd[_0xeb7d('0x36')]:_0x3152ba[_0xeb7d('0x31')];if(_0x512c95[_0xeb7d('0x32')]['includeAll']){_0x46babd[_0xeb7d('0x42')]=[{'all':!![]}];}_0x46babd=_[_0xeb7d('0x3f')]({},_0x46babd,_0x512c95[_0xeb7d('0x41')]);return db[_0xeb7d('0x2c')][_0xeb7d('0x47')](_0x46babd)['then'](handleEntityNotFound(_0x5ba7ca,null))[_0xeb7d('0x24')](respondWithResult(_0x5ba7ca,null))[_0xeb7d('0x48')](handleError(_0x5ba7ca,null));};exports['create']=function(_0x50433c,_0x490652){return db[_0xeb7d('0x2c')][_0xeb7d('0x49')](_0x50433c['body'],{})[_0xeb7d('0x24')](respondWithResult(_0x490652,0xc9))[_0xeb7d('0x48')](handleError(_0x490652,null));};exports['update']=function(_0x396df0,_0x4f6188){if(_0x396df0['body']['id']){delete _0x396df0[_0xeb7d('0x4a')]['id'];}return db[_0xeb7d('0x2c')][_0xeb7d('0x47')]({'where':{'id':_0x396df0[_0xeb7d('0x46')]['id']}})[_0xeb7d('0x24')](handleEntityNotFound(_0x4f6188,null))[_0xeb7d('0x24')](saveUpdates(_0x396df0[_0xeb7d('0x4a')],null))['then'](respondWithResult(_0x4f6188,null))[_0xeb7d('0x48')](handleError(_0x4f6188,null));};exports['destroy']=function(_0x249ee5,_0x30e777){return db[_0xeb7d('0x2c')][_0xeb7d('0x47')]({'where':{'id':_0x249ee5[_0xeb7d('0x46')]['id']}})['then'](handleEntityNotFound(_0x30e777,null))['then'](removeEntity(_0x30e777,null))[_0xeb7d('0x48')](handleError(_0x30e777,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 7de773d..5411c8a 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 _0xb7fc=['api','moment','bluebird','rimraf','../../config/environment','./whatsappApplication.attributes','exports','WhatsappApplication','whatsapp_applications','utf8mb4','lodash'];(function(_0x272d90,_0x5e70ff){var _0x2bf4a2=function(_0x544da6){while(--_0x544da6){_0x272d90['push'](_0x272d90['shift']());}};_0x2bf4a2(++_0x5e70ff);}(_0xb7fc,0x1e3));var _0xcb7f=function(_0x53c33c,_0x27223d){_0x53c33c=_0x53c33c-0x0;var _0x277750=_0xb7fc[_0x53c33c];return _0x277750;};'use strict';var _=require(_0xcb7f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xcb7f('0x1'));var moment=require(_0xcb7f('0x2'));var BPromise=require(_0xcb7f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcb7f('0x4'));var config=require(_0xcb7f('0x5'));var attributes=require(_0xcb7f('0x6'));module[_0xcb7f('0x7')]=function(_0x321b70,_0x4001ef){return _0x321b70['define'](_0xcb7f('0x8'),attributes,{'tableName':_0xcb7f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcb7f('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xe132=['whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','define','WhatsappApplication'];(function(_0x265a87,_0x4e1c17){var _0x29f0b0=function(_0x491da){while(--_0x491da){_0x265a87['push'](_0x265a87['shift']());}};_0x29f0b0(++_0x4e1c17);}(_0xe132,0x162));var _0x2e13=function(_0xda657f,_0x479eef){_0xda657f=_0xda657f-0x0;var _0xf35c65=_0xe132[_0xda657f];return _0xf35c65;};'use strict';var _=require(_0x2e13('0x0'));var util=require('util');var logger=require(_0x2e13('0x1'))(_0x2e13('0x2'));var moment=require(_0x2e13('0x3'));var BPromise=require(_0x2e13('0x4'));var rp=require(_0x2e13('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2e13('0x6'));var config=require(_0x2e13('0x7'));var attributes=require('./whatsappApplication.attributes');module['exports']=function(_0x260dc1,_0x2f9d00){return _0x260dc1[_0x2e13('0x8')](_0x2e13('0x9'),attributes,{'tableName':_0x2e13('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2e13('0xb'),'collate':_0x2e13('0xc')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index a32e865..1077e2f 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 _0xb458=['WhatsappApplication,\x20%s,\x20%s,\x20%s','code','error','message','request\x20sent','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','debug'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xb458,0x103));var _0x8b45=function(_0x4eb863,_0x4dfda9){_0x4eb863=_0x4eb863-0x0;var _0x456061=_0xb458[_0x4eb863];return _0x456061;};'use strict';var _=require(_0x8b45('0x0'));var util=require(_0x8b45('0x1'));var moment=require(_0x8b45('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8b45('0x3'));var db=require(_0x8b45('0x4'))['db'];var utils=require(_0x8b45('0x5'));var logger=require(_0x8b45('0x6'))('rpc');var config=require(_0x8b45('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8b45('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x12bd05,_0x2daa9a,_0x3a8ccb){return new BPromise(function(_0x32342f,_0x4d1718){return client[_0x8b45('0x9')](_0x12bd05,_0x3a8ccb)[_0x8b45('0xa')](function(_0x33f30e){logger[_0x8b45('0xb')](_0x8b45('0xc'),_0x2daa9a,'request\x20sent');logger[_0x8b45('0xd')](_0x8b45('0xe'),_0x2daa9a,'request\x20sent',JSON['stringify'](_0x33f30e));if(_0x33f30e['error']){if(_0x33f30e['error'][_0x8b45('0xf')]===0x1f4){logger[_0x8b45('0x10')](_0x8b45('0xc'),_0x2daa9a,_0x33f30e['error'][_0x8b45('0x11')]);return _0x4d1718(_0x33f30e[_0x8b45('0x10')][_0x8b45('0x11')]);}logger[_0x8b45('0x10')](_0x8b45('0xc'),_0x2daa9a,_0x33f30e[_0x8b45('0x10')]['message']);return _0x32342f(_0x33f30e['error'][_0x8b45('0x11')]);}else{logger[_0x8b45('0xb')](_0x8b45('0xc'),_0x2daa9a,_0x8b45('0x12'));_0x32342f(_0x33f30e[_0x8b45('0x13')][_0x8b45('0x11')]);}})[_0x8b45('0x14')](function(_0x147d6b){logger[_0x8b45('0x10')](_0x8b45('0xc'),_0x2daa9a,_0x147d6b);_0x4d1718(_0x147d6b);});});} \ No newline at end of file +var _0xda55=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash'];(function(_0xf136bc,_0x4cb677){var _0x447aa6=function(_0x5c6f9b){while(--_0x5c6f9b){_0xf136bc['push'](_0xf136bc['shift']());}};_0x447aa6(++_0x4cb677);}(_0xda55,0x6d));var _0x5da5=function(_0x4d72aa,_0x5752e3){_0x4d72aa=_0x4d72aa-0x0;var _0x22c759=_0xda55[_0x4d72aa];return _0x22c759;};'use strict';var _=require(_0x5da5('0x0'));var util=require(_0x5da5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5da5('0x2'));var fs=require('fs');var Redis=require(_0x5da5('0x3'));var db=require(_0x5da5('0x4'))['db'];var utils=require(_0x5da5('0x5'));var logger=require(_0x5da5('0x6'))('rpc');var config=require(_0x5da5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5da5('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2fd877,_0x267469,_0x71b187){return new BPromise(function(_0x46290d,_0x3debdf){return client[_0x5da5('0x9')](_0x2fd877,_0x71b187)[_0x5da5('0xa')](function(_0x302795){logger['info'](_0x5da5('0xb'),_0x267469,_0x5da5('0xc'));logger[_0x5da5('0xd')](_0x5da5('0xe'),_0x267469,_0x5da5('0xc'),JSON[_0x5da5('0xf')](_0x302795));if(_0x302795[_0x5da5('0x10')]){if(_0x302795['error'][_0x5da5('0x11')]===0x1f4){logger[_0x5da5('0x10')]('WhatsappApplication,\x20%s,\x20%s',_0x267469,_0x302795[_0x5da5('0x10')][_0x5da5('0x12')]);return _0x3debdf(_0x302795[_0x5da5('0x10')][_0x5da5('0x12')]);}logger[_0x5da5('0x10')](_0x5da5('0xb'),_0x267469,_0x302795['error']['message']);return _0x46290d(_0x302795['error'][_0x5da5('0x12')]);}else{logger[_0x5da5('0x13')](_0x5da5('0xb'),_0x267469,_0x5da5('0xc'));_0x46290d(_0x302795[_0x5da5('0x14')][_0x5da5('0x12')]);}})[_0x5da5('0x15')](function(_0x4a952a){logger[_0x5da5('0x10')](_0x5da5('0xb'),_0x267469,_0x4a952a);_0x3debdf(_0x4a952a);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 3b40a81..bdc0152 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 _0x7a54=['create','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','/:id','whatsappinteraction:update','whatsappinteraction:destroy','destroy','delete','removeTags','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','index','/describe','isAuthenticated','/:id/messages','getMessages','download','post'];(function(_0x4f9779,_0x52808a){var _0x13f3cc=function(_0x5d0136){while(--_0x5d0136){_0x4f9779['push'](_0x4f9779['shift']());}};_0x13f3cc(++_0x52808a);}(_0x7a54,0x106));var _0x47a5=function(_0x20ffa3,_0x4b614e){_0x20ffa3=_0x20ffa3-0x0;var _0x52a0b4=_0x7a54[_0x20ffa3];return _0x52a0b4;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['describe']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/download',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x10')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0x12')]);router[_0x47a5('0x10')](_0x47a5('0x13'),auth[_0x47a5('0xc')](),interaction[_0x47a5('0x14')](_0x47a5('0x15'),_0x47a5('0x16')),controller[_0x47a5('0x17')]);router['put'](_0x47a5('0x18'),auth[_0x47a5('0xc')](),interaction[_0x47a5('0x14')](_0x47a5('0x15'),_0x47a5('0x19')),controller['update']);router['delete'](_0x47a5('0x18'),auth['isAuthenticated'](),interaction['tracked'](_0x47a5('0x15'),_0x47a5('0x1a')),controller[_0x47a5('0x1b')]);router[_0x47a5('0x1c')](_0x47a5('0x13'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x1d')]);module[_0x47a5('0x1e')]=router; \ No newline at end of file +var _0x4317=['./whatsappInteraction.controller','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','whatsappinteraction:addtags','addTags','put','update','delete','whatsappinteraction:destroy','destroy','removeTags','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2fb0a7,_0x3cb9aa){var _0x502664=function(_0x3ae7fc){while(--_0x3ae7fc){_0x2fb0a7['push'](_0x2fb0a7['shift']());}};_0x502664(++_0x3cb9aa);}(_0x4317,0x7c));var _0x7431=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x4317[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require('multer');var util=require(_0x7431('0x0'));var path=require(_0x7431('0x1'));var timeout=require(_0x7431('0x2'));var express=require('express');var router=express[_0x7431('0x3')]();var fs_extra=require(_0x7431('0x4'));var auth=require(_0x7431('0x5'));var interaction=require(_0x7431('0x6'));var config=require(_0x7431('0x7'));var controller=require(_0x7431('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x7431('0x9')]);router[_0x7431('0xa')](_0x7431('0xb'),auth[_0x7431('0xc')](),controller[_0x7431('0xd')]);router[_0x7431('0xa')](_0x7431('0xe'),auth[_0x7431('0xc')](),controller[_0x7431('0xf')]);router[_0x7431('0xa')](_0x7431('0x10'),auth[_0x7431('0xc')](),controller[_0x7431('0x11')]);router[_0x7431('0xa')](_0x7431('0x12'),auth[_0x7431('0xc')](),controller[_0x7431('0x13')]);router[_0x7431('0x14')]('/',auth[_0x7431('0xc')](),controller[_0x7431('0x15')]);router[_0x7431('0x14')](_0x7431('0x10'),auth[_0x7431('0xc')](),controller[_0x7431('0x16')]);router['post'](_0x7431('0x17'),auth[_0x7431('0xc')](),interaction[_0x7431('0x18')]('whatsapp',_0x7431('0x19')),controller[_0x7431('0x1a')]);router[_0x7431('0x1b')]('/:id',auth[_0x7431('0xc')](),interaction['tracked']('whatsapp','whatsappinteraction:update'),controller[_0x7431('0x1c')]);router[_0x7431('0x1d')](_0x7431('0xe'),auth[_0x7431('0xc')](),interaction['tracked']('whatsapp',_0x7431('0x1e')),controller[_0x7431('0x1f')]);router[_0x7431('0x1d')](_0x7431('0x17'),auth[_0x7431('0xc')](),controller[_0x7431('0x20')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 2755f8e..aba7006 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 _0xe1c4=['STRING','out','DATE','ENUM','BOOLEAN','INTEGER','sequelize','moment','exports'];(function(_0x487496,_0x249683){var _0x539dc8=function(_0x2c38e1){while(--_0x2c38e1){_0x487496['push'](_0x487496['shift']());}};_0x539dc8(++_0x249683);}(_0xe1c4,0x1ec));var _0x4e1c=function(_0x307dd9,_0x51218d){_0x307dd9=_0x307dd9-0x0;var _0x40988a=_0xe1c4[_0x307dd9];return _0x40988a;};'use strict';var Sequelize=require(_0x4e1c('0x0'));var moment=require(_0x4e1c('0x1'));module[_0x4e1c('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x4e1c('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x4e1c('0x3')]},'note':{'type':Sequelize[_0x4e1c('0x3')]},'phone':{'type':Sequelize[_0x4e1c('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x4e1c('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x4e1c('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x4e1c('0x6')]('in',_0x4e1c('0x4')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x4e1c('0x7')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x4e1c('0x8')]}}; \ No newline at end of file +var _0x7d14=['DATE','STRING','ENUM','out','sequelize','moment','BOOLEAN'];(function(_0x4ec445,_0x1a61bd){var _0x20e5e=function(_0x5e389e){while(--_0x5e389e){_0x4ec445['push'](_0x4ec445['shift']());}};_0x20e5e(++_0x1a61bd);}(_0x7d14,0x6d));var _0x47d1=function(_0x211616,_0x27ec1f){_0x211616=_0x211616-0x0;var _0x1e3fae=_0x7d14[_0x211616];return _0x1e3fae;};'use strict';var Sequelize=require(_0x47d1('0x0'));var moment=require(_0x47d1('0x1'));module['exports']={'closed':{'type':Sequelize[_0x47d1('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x47d1('0x3')]},'disposition':{'type':Sequelize[_0x47d1('0x4')]},'secondDisposition':{'type':Sequelize[_0x47d1('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x47d1('0x4')]},'phone':{'type':Sequelize[_0x47d1('0x4')]},'read1stAt':{'type':Sequelize[_0x47d1('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x47d1('0x5')]('in',_0x47d1('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x47d1('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index c345000..db7562c 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 _0x1713=['find','create','body','params','describe','addMessage','ids','omit','length','nolimit','order','sort','where','WhatsappInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','merge','WhatsappMessage','rows','addTags','setTags','spread','Tag','emit','whatsappInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','format','push','User','fullname','CmContact','Contact','firstName','lastName','Attachment','Messages','secret','read','Account','Owner','mkdirSync','createdAt','closed','closedAt','disposition','basename','existsSync','pipe','createWriteStream','direction','out','System','renderFile','downloadInteraction.ejs','transcript-','.pdf','Whatsapp','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','../../components/interaction/service','../../components/export/pdf','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','status','end','offset','undefined','limit','count','set','Content-Range','update','then','sendStatus','stack','name','send','index','map','WhatsappInteraction','rawAttributes','fieldName','getOptions','findAll','query','user','catch','show','model','keys','filters','intersection','attributes','fields','include','options'];(function(_0x1f71d8,_0x278518){var _0x10b045=function(_0x57aea4){while(--_0x57aea4){_0x1f71d8['push'](_0x1f71d8['shift']());}};_0x10b045(++_0x278518);}(_0x1713,0xc0));var _0x3171=function(_0x55be97,_0x296587){_0x55be97=_0x55be97-0x0;var _0x462aac=_0x1713[_0x55be97];return _0x462aac;};'use strict';var rimraf=require(_0x3171('0x0'));var zipdir=require(_0x3171('0x1'));var moment=require(_0x3171('0x2'));var BPromise=require(_0x3171('0x3'));var util=require(_0x3171('0x4'));var path=require(_0x3171('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0x3171('0x6'));var qs=require('../../components/parsers/qs');var pdf=require(_0x3171('0x7'));var logger=require(_0x3171('0x8'))('api');var config=require(_0x3171('0x9'));var db=require('../../mysqldb')['db'];config[_0x3171('0xa')]=_[_0x3171('0xb')](config[_0x3171('0xa')],{'host':_0x3171('0xc'),'port':0x18eb});var socket=require(_0x3171('0xd'))(new Redis(config[_0x3171('0xa')]));require('./whatsappInteraction.socket')[_0x3171('0xe')](socket);function respondWithStatusCode(_0x28f260,_0x339abd){_0x339abd=_0x339abd||0xcc;return function(_0x217252){if(_0x217252){return _0x28f260['sendStatus'](_0x339abd);}return _0x28f260[_0x3171('0xf')](_0x339abd)[_0x3171('0x10')]();};}function respondWithResult(_0x44865e,_0x2afe0f){_0x2afe0f=_0x2afe0f||0xc8;return function(_0x2d57e1){if(_0x2d57e1){return _0x44865e[_0x3171('0xf')](_0x2afe0f)['json'](_0x2d57e1);}};}function respondWithFilteredResult(_0x173713,_0x158727){return function(_0x22efd3){if(_0x22efd3){var _0x1aa725=typeof _0x158727[_0x3171('0x11')]===_0x3171('0x12')&&typeof _0x158727[_0x3171('0x13')]===_0x3171('0x12');var _0x56e91c=_0x22efd3[_0x3171('0x14')];var _0x3353fa=_0x1aa725?0x0:_0x158727[_0x3171('0x11')];var _0x4215cb=_0x1aa725?_0x22efd3['count']:_0x158727['offset']+_0x158727['limit'];var _0x41085e;if(_0x4215cb>=_0x56e91c){_0x4215cb=_0x56e91c;_0x41085e=0xc8;}else{_0x41085e=0xce;}_0x173713[_0x3171('0xf')](_0x41085e);return _0x173713[_0x3171('0x15')](_0x3171('0x16'),_0x3353fa+'-'+_0x4215cb+'/'+_0x56e91c)['json'](_0x22efd3);}return null;};}function saveUpdates(_0x51c217){return function(_0xe93057){if(_0xe93057){return _0xe93057[_0x3171('0x17')](_0x51c217)[_0x3171('0x18')](function(_0x509529){return _0x509529;});}return null;};}function removeEntity(_0x35ada0){return function(_0x54fbb4){if(_0x54fbb4){return _0x54fbb4['destroy']()[_0x3171('0x18')](function(){_0x35ada0['status'](0xcc)[_0x3171('0x10')]();});}};}function handleEntityNotFound(_0x284abd){return function(_0xf99ede){if(!_0xf99ede){_0x284abd[_0x3171('0x19')](0x194);}return _0xf99ede;};}function handleError(_0x37ee2d,_0x253d83){_0x253d83=_0x253d83||0x1f4;return function(_0x31ab72){logger['error'](_0x31ab72[_0x3171('0x1a')]);if(_0x31ab72[_0x3171('0x1b')]){delete _0x31ab72[_0x3171('0x1b')];}_0x37ee2d[_0x3171('0xf')](_0x253d83)[_0x3171('0x1c')](_0x31ab72);};}exports[_0x3171('0x1d')]=function(_0x3da58a,_0x45d2d1){var _0x48adba={};var _0x2d8b58=_[_0x3171('0x1e')](db[_0x3171('0x1f')][_0x3171('0x20')],function(_0x4c759a){return{'name':_0x4c759a[_0x3171('0x21')],'type':_0x4c759a['type']['key']};});_0x48adba=qs[_0x3171('0x22')](_0x2d8b58,_0x3da58a);return interaction[_0x3171('0x23')]('whatsapp',_0x3da58a[_0x3171('0x24')],_0x3da58a[_0x3171('0x25')],_0x48adba,_0x2d8b58)['then'](respondWithFilteredResult(_0x45d2d1,_0x48adba))[_0x3171('0x26')](handleError(_0x45d2d1,null));};exports[_0x3171('0x27')]=function(_0x369648,_0x363e1f){var _0x33c63e={'raw':![],'where':{'id':_0x369648['params']['id']}},_0x1c3d5d={};_0x1c3d5d[_0x3171('0x28')]=_[_0x3171('0x29')](db[_0x3171('0x1f')][_0x3171('0x20')]);_0x1c3d5d['query']=_[_0x3171('0x29')](_0x369648[_0x3171('0x24')]);_0x1c3d5d[_0x3171('0x2a')]=_[_0x3171('0x2b')](_0x1c3d5d[_0x3171('0x28')],_0x1c3d5d[_0x3171('0x24')]);_0x33c63e[_0x3171('0x2c')]=_[_0x3171('0x2b')](_0x1c3d5d[_0x3171('0x28')],qs[_0x3171('0x2d')](_0x369648[_0x3171('0x24')][_0x3171('0x2d')]));_0x33c63e[_0x3171('0x2c')]=_0x33c63e[_0x3171('0x2c')]['length']?_0x33c63e[_0x3171('0x2c')]:_0x1c3d5d[_0x3171('0x28')];if(_0x369648[_0x3171('0x24')]['includeAll']){_0x33c63e[_0x3171('0x2e')]=[{'all':!![]}];}_0x33c63e=_['merge']({},_0x33c63e,_0x369648[_0x3171('0x2f')]);return db[_0x3171('0x1f')][_0x3171('0x30')](_0x33c63e)[_0x3171('0x18')](handleEntityNotFound(_0x363e1f,null))[_0x3171('0x18')](respondWithResult(_0x363e1f,null))['catch'](handleError(_0x363e1f,null));};exports['create']=function(_0x52477e,_0x47fe75){return db[_0x3171('0x1f')][_0x3171('0x31')](_0x52477e[_0x3171('0x32')],{})['then'](respondWithResult(_0x47fe75,0xc9))['catch'](handleError(_0x47fe75,null));};exports[_0x3171('0x17')]=function(_0x1a4a09,_0x152cf0){if(_0x1a4a09[_0x3171('0x32')]['id']){delete _0x1a4a09[_0x3171('0x32')]['id'];}return db[_0x3171('0x1f')][_0x3171('0x30')]({'where':{'id':_0x1a4a09[_0x3171('0x33')]['id']}})[_0x3171('0x18')](handleEntityNotFound(_0x152cf0,null))[_0x3171('0x18')](saveUpdates(_0x1a4a09[_0x3171('0x32')],null))[_0x3171('0x18')](respondWithResult(_0x152cf0,null))[_0x3171('0x26')](handleError(_0x152cf0,null));};exports['destroy']=function(_0x12d73d,_0x51d1ac){return db[_0x3171('0x1f')][_0x3171('0x30')]({'where':{'id':_0x12d73d[_0x3171('0x33')]['id']}})[_0x3171('0x18')](handleEntityNotFound(_0x51d1ac,null))['then'](removeEntity(_0x51d1ac,null))[_0x3171('0x26')](handleError(_0x51d1ac,null));};exports[_0x3171('0x34')]=function(_0x59406f,_0x3166f6){return db['WhatsappInteraction'][_0x3171('0x34')]()[_0x3171('0x18')](respondWithResult(_0x3166f6,null))[_0x3171('0x26')](handleError(_0x3166f6,null));};exports[_0x3171('0x35')]=function(_0x38b016,_0x2ea226){return db['WhatsappMessage'][_0x3171('0x30')]({'where':{'id':_0x38b016[_0x3171('0x33')]['id']}})['then'](handleEntityNotFound(_0x2ea226,null))[_0x3171('0x18')](function(_0x10ba1d){if(_0x10ba1d){return _0x10ba1d[_0x3171('0x35')](_0x38b016[_0x3171('0x32')][_0x3171('0x36')],_[_0x3171('0x37')](_0x38b016['body'],['ids','id'])||{});}})[_0x3171('0x18')](respondWithResult(_0x2ea226,null))['catch'](handleError(_0x2ea226,null));};exports['getMessages']=function(_0x3966e3,_0x4d7cee){var _0x5b59e5={'raw':![],'where':{}};var _0x5ee4f0={};var _0x4033a9={'count':0x0,'rows':[]};return db[_0x3171('0x1f')]['findOne']({'where':{'id':_0x3966e3[_0x3171('0x33')]['id']}})[_0x3171('0x18')](handleEntityNotFound(_0x4d7cee,null))[_0x3171('0x18')](function(_0x4e32ca){if(_0x4e32ca){_0x5ee4f0[_0x3171('0x28')]=_[_0x3171('0x29')](db['WhatsappMessage'][_0x3171('0x20')]);_0x5ee4f0[_0x3171('0x24')]=_[_0x3171('0x29')](_0x3966e3[_0x3171('0x24')]);_0x5ee4f0['filters']=_[_0x3171('0x2b')](_0x5ee4f0[_0x3171('0x28')],_0x5ee4f0[_0x3171('0x24')]);_0x5b59e5['attributes']=_[_0x3171('0x2b')](_0x5ee4f0[_0x3171('0x28')],qs[_0x3171('0x2d')](_0x3966e3[_0x3171('0x24')]['fields']));_0x5b59e5[_0x3171('0x2c')]=_0x5b59e5['attributes'][_0x3171('0x38')]?_0x5b59e5[_0x3171('0x2c')]:_0x5ee4f0[_0x3171('0x28')];if(!_0x3966e3[_0x3171('0x24')]['hasOwnProperty'](_0x3171('0x39'))){_0x5b59e5[_0x3171('0x13')]=qs[_0x3171('0x13')](_0x3966e3[_0x3171('0x24')][_0x3171('0x13')]);_0x5b59e5[_0x3171('0x11')]=qs[_0x3171('0x11')](_0x3966e3[_0x3171('0x24')][_0x3171('0x11')]);}_0x5b59e5[_0x3171('0x3a')]=qs[_0x3171('0x3b')](_0x3966e3[_0x3171('0x24')][_0x3171('0x3b')]);_0x5b59e5['where']=qs['filters'](_['pick'](_0x3966e3[_0x3171('0x24')],_0x5ee4f0[_0x3171('0x2a')]));_0x5b59e5[_0x3171('0x3c')][_0x3171('0x3d')]=_0x4e32ca['id'];if(_0x3966e3['query']['filter']){_0x5b59e5[_0x3171('0x3c')]=_['merge'](_0x5b59e5['where'],{'$or':_['map'](_0x5b59e5[_0x3171('0x2c')],function(_0x2d5ef4){var _0x3b48a3={};_0x3b48a3[_0x2d5ef4]={'$like':'%'+_0x3966e3[_0x3171('0x24')][_0x3171('0x3e')]+'%'};return _0x3b48a3;})});}if(_0x3966e3[_0x3171('0x24')][_0x3171('0x3f')]){var _0x5cffb3=_0x3966e3['query'][_0x3171('0x3f')][_0x3171('0x40')](',');var _0x80b2f9={};_0x80b2f9[_0x5cffb3[0x0]]={'$gte':moment(_0x5cffb3[0x1])['format'](_0x3171('0x41'))};_0x5b59e5[_0x3171('0x3c')]=_[_0x3171('0x42')](_0x5b59e5[_0x3171('0x3c')],_0x80b2f9);}_0x5b59e5=_[_0x3171('0x42')]({},_0x5b59e5,_0x3966e3[_0x3171('0x2f')]);return db[_0x3171('0x43')][_0x3171('0x14')]({'where':_0x5b59e5[_0x3171('0x3c')]})[_0x3171('0x18')](function(_0x2bf1fa){_0x4033a9[_0x3171('0x14')]=_0x2bf1fa;if(_0x3966e3[_0x3171('0x24')]['includeAll']){_0x5b59e5[_0x3171('0x2e')]=[{'all':!![]}];}return db[_0x3171('0x43')][_0x3171('0x23')](_0x5b59e5);})[_0x3171('0x18')](function(_0x12e8ee){_0x4033a9[_0x3171('0x44')]=_0x12e8ee;return _0x4033a9;});}})[_0x3171('0x18')](respondWithFilteredResult(_0x4d7cee,_0x5b59e5))['catch'](handleError(_0x4d7cee,null));};exports[_0x3171('0x45')]=function(_0x1e98d3,_0x369c70){return db[_0x3171('0x1f')][_0x3171('0x30')]({'where':{'id':_0x1e98d3['params']['id']}})[_0x3171('0x18')](handleEntityNotFound(_0x369c70,null))[_0x3171('0x18')](function(_0x4b709d){if(_0x4b709d){return _0x4b709d[_0x3171('0x46')](_0x1e98d3[_0x3171('0x32')][_0x3171('0x36')],_[_0x3171('0x37')](_0x1e98d3['body'],[_0x3171('0x36'),'id'])||{})[_0x3171('0x47')](function(){return db[_0x3171('0x48')][_0x3171('0x23')]({'attributes':['id',_0x3171('0x1b'),'color'],'where':{'id':_0x1e98d3['body'][_0x3171('0x36')]}});})[_0x3171('0x18')](function(_0x1ab573){socket[_0x3171('0x49')](_0x3171('0x4a'),{'id':Number(_0x1e98d3['params']['id']),'tags':_0x1ab573||[]});return{'id':Number(_0x1e98d3['params']['id']),'tags':_0x1ab573||[]};});}})[_0x3171('0x18')](respondWithResult(_0x369c70,null))[_0x3171('0x26')](handleError(_0x369c70,null));};exports[_0x3171('0x4b')]=function(_0x3fc2cb,_0x3a30f3){return db[_0x3171('0x1f')][_0x3171('0x30')]({'where':{'id':_0x3fc2cb[_0x3171('0x33')]['id']}})[_0x3171('0x18')](handleEntityNotFound(_0x3a30f3,null))[_0x3171('0x18')](function(_0x2a22){if(_0x2a22){return _0x2a22[_0x3171('0x4b')](_0x3fc2cb['query'][_0x3171('0x36')]);}})[_0x3171('0x18')](respondWithStatusCode(_0x3a30f3,null))[_0x3171('0x26')](handleError(_0x3a30f3,null));};exports[_0x3171('0x4c')]=function(_0x14918b,_0x2d0115){var _0x3bbc94=moment()[_0x3171('0x4d')]()[_0x3171('0x4e')]();var _0x31c74f=path[_0x3171('0x4f')](config[_0x3171('0x50')],_0x3171('0x51'),_0x3171('0x52'),_0x3171('0x53'));var _0x5e4528=path[_0x3171('0x4f')](config[_0x3171('0x50')],_0x3171('0x51'),_0x3171('0x52'),_0x3171('0x54'));var _0x14df71=path[_0x3171('0x4f')](_0x31c74f,_0x3bbc94);var _0x56ac2e=util[_0x3171('0x55')]('transcript-%d-%s.zip',_0x14918b[_0x3171('0x33')]['id'],_0x3bbc94);var _0x12e570=path['join'](_0x31c74f,_0x56ac2e);var _0x2cf706=[];_0x2cf706[_0x3171('0x56')]({'model':db[_0x3171('0x57')],'as':_0x3171('0x57'),'attributes':['id',_0x3171('0x58')],'raw':!![]});_0x2cf706[_0x3171('0x56')]({'model':db[_0x3171('0x59')],'as':_0x3171('0x5a'),'attributes':['id',_0x3171('0x5b'),_0x3171('0x5c')],'raw':!![]});if(_0x14918b[_0x3171('0x24')][_0x3171('0x54')]){_0x2cf706['push']({'model':db['Attachment'],'as':_0x3171('0x5d'),'raw':!![]});}var _0x1beffd=[{'model':db[_0x3171('0x43')],'as':_0x3171('0x5e'),'attributes':['id',_0x3171('0x32'),'createdAt','direction',_0x3171('0x5f'),_0x3171('0x60')],'include':_0x2cf706}];_0x1beffd[_0x3171('0x56')]({'model':db['WhatsappAccount'],'as':_0x3171('0x61'),'attributes':['id',_0x3171('0x1b')]});_0x1beffd[_0x3171('0x56')]({'model':db[_0x3171('0x57')],'as':_0x3171('0x62'),'attributes':['id',_0x3171('0x58')]});return db[_0x3171('0x1f')][_0x3171('0x30')]({'where':{'id':_0x14918b[_0x3171('0x33')]['id']},'include':_0x1beffd})['then'](handleEntityNotFound(_0x2d0115,null))[_0x3171('0x18')](function(_0x3edf73){if(_0x3edf73){var _0x4f7c10=_0x3edf73['get']({'plain':!![]});fs[_0x3171('0x63')](_0x14df71);var _0x416866={'channel':'Whatsapp','account':_0x4f7c10[_0x3171('0x61')][_0x3171('0x1b')],'agent':_0x4f7c10[_0x3171('0x62')]?_0x4f7c10[_0x3171('0x62')][_0x3171('0x58')]:'N.A.','createdAt':moment(_0x4f7c10[_0x3171('0x64')])[_0x3171('0x55')](_0x3171('0x41'))['toString'](),'closedAt':_0x4f7c10[_0x3171('0x65')]?moment(_0x4f7c10[_0x3171('0x66')])[_0x3171('0x55')](_0x3171('0x41'))[_0x3171('0x4e')]():'','disposition':_0x4f7c10[_0x3171('0x67')],'messages':_(_0x4f7c10[_0x3171('0x5e')])[_0x3171('0x3e')]({'secret':![]})['map'](function(_0x5fb139){if(_0x5fb139[_0x3171('0x5d')]){var _0x32ed80=path[_0x3171('0x4f')](_0x5e4528,_0x5fb139[_0x3171('0x5d')][_0x3171('0x68')]);if(fs[_0x3171('0x69')](_0x32ed80)){fs['createReadStream'](_0x32ed80)[_0x3171('0x6a')](fs[_0x3171('0x6b')](path[_0x3171('0x4f')](_0x14df71,_0x5fb139[_0x3171('0x5d')][_0x3171('0x68')])));}}return{'date':moment(_0x5fb139['createdAt'])[_0x3171('0x55')](_0x3171('0x41'))[_0x3171('0x4e')](),'sender':_0x5fb139[_0x3171('0x6c')]===_0x3171('0x6d')?_0x5fb139[_0x3171('0x57')]?_0x5fb139[_0x3171('0x57')][_0x3171('0x58')]:_0x3171('0x6e'):_0x5fb139[_0x3171('0x5a')]['firstName']+(_0x5fb139[_0x3171('0x5a')][_0x3171('0x5c')]?'\x20'+_0x5fb139[_0x3171('0x5a')][_0x3171('0x5c')]:''),'body':_0x5fb139['Attachment']?_0x5fb139[_0x3171('0x5d')][_0x3171('0x68')]:_0x5fb139['body'],'direction':_0x5fb139[_0x3171('0x6c')]===_0x3171('0x6d')?'A':'C','secret':_0x5fb139[_0x3171('0x5f')],'read':_0x5fb139['read'],'attachment':_0x5fb139[_0x3171('0x5d')]};})['value']()};return ejs[_0x3171('0x6f')](path[_0x3171('0x4f')](config[_0x3171('0x50')],'server','views',_0x3171('0x70')),{'interaction':_0x416866})[_0x3171('0x18')](function(_0x1b92a2){var _0x468890=path[_0x3171('0x4f')](_0x14df71,_0x3171('0x71')+_0x4f7c10['id']+'-'+_0x3bbc94+_0x3171('0x72'));var _0x4cecfe={'path':_0x468890,'channel':_0x3171('0x73'),'interactionId':_0x4f7c10['id']};return pdf[_0x3171('0x74')](_0x1b92a2,_0x4cecfe);})[_0x3171('0x18')](function(){return new BPromise(function(_0x406d17,_0xa7b7b0){zipdir(_0x14df71,{'saveTo':_0x12e570},function(_0x1500b2,_0x544f2f){if(_0x1500b2)return _0xa7b7b0(_0x1500b2);return _0x406d17(_0x544f2f);});})[_0x3171('0x18')](function(){return new BPromise(function(_0x15117a,_0x1b72c8){rimraf(_0x14df71,function(_0x1d35ed){if(_0x1d35ed)_0x1b72c8(_0x1d35ed);return _0x15117a();});});})['then'](function(){return _0x2d0115['download'](_0x12e570,_0x56ac2e,function(_0x1a439a){if(_0x1a439a){console[_0x3171('0x75')](_0x3171('0x76'),_0x1a439a);}else{fs[_0x3171('0x77')](_0x12e570);}});});});}else{return _0x2d0115[_0x3171('0x19')](0xc8);}})[_0x3171('0x26')](handleError(_0x2d0115,null));}; \ No newline at end of file +var _0xa33b=['transcript-','Whatsapp','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','ejs','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','error','stack','name','send','map','WhatsappInteraction','rawAttributes','fieldName','type','key','findAll','whatsapp','catch','keys','query','filters','intersection','model','attributes','fields','length','includeAll','include','merge','create','body','params','find','describe','WhatsappMessage','addMessage','ids','omit','getMessages','findOne','hasOwnProperty','nolimit','order','sort','where','WhatsappInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','options','rows','addTags','spread','Tag','color','whatsappInteractionTags:save','removeTags','unix','toString','root','server','tmp','join','files','attachments','push','User','Contact','lastName','createdAt','direction','secret','WhatsappAccount','Account','Owner','fullname','get','N.A.','closed','disposition','Attachment','existsSync','createReadStream','createWriteStream','out','System','firstName','basename','read','value','renderFile','views','downloadInteraction.ejs'];(function(_0x2e5f98,_0x5c9cb1){var _0x17ad74=function(_0x3520e8){while(--_0x3520e8){_0x2e5f98['push'](_0x2e5f98['shift']());}};_0x17ad74(++_0x5c9cb1);}(_0xa33b,0x83));var _0xba33=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xa33b[_0x565c49];return _0x20ca34;};'use strict';var rimraf=require(_0xba33('0x0'));var zipdir=require(_0xba33('0x1'));var moment=require(_0xba33('0x2'));var BPromise=require(_0xba33('0x3'));var util=require(_0xba33('0x4'));var path=require(_0xba33('0x5'));var ejs=require(_0xba33('0x6'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xba33('0x7'));var interaction=require('../../components/interaction/service');var qs=require(_0xba33('0x8'));var pdf=require('../../components/export/pdf');var logger=require(_0xba33('0x9'))(_0xba33('0xa'));var config=require(_0xba33('0xb'));var db=require(_0xba33('0xc'))['db'];config[_0xba33('0xd')]=_[_0xba33('0xe')](config[_0xba33('0xd')],{'host':_0xba33('0xf'),'port':0x18eb});var socket=require(_0xba33('0x10'))(new Redis(config[_0xba33('0xd')]));require(_0xba33('0x11'))[_0xba33('0x12')](socket);function respondWithStatusCode(_0x57aea5,_0x58d6bc){_0x58d6bc=_0x58d6bc||0xcc;return function(_0x4afcaa){if(_0x4afcaa){return _0x57aea5[_0xba33('0x13')](_0x58d6bc);}return _0x57aea5['status'](_0x58d6bc)[_0xba33('0x14')]();};}function respondWithResult(_0x30cf8d,_0x3c938a){_0x3c938a=_0x3c938a||0xc8;return function(_0x4853c2){if(_0x4853c2){return _0x30cf8d[_0xba33('0x15')](_0x3c938a)[_0xba33('0x16')](_0x4853c2);}};}function respondWithFilteredResult(_0x370c06,_0x27a2ff){return function(_0x35d3aa){if(_0x35d3aa){var _0x3b5196=typeof _0x27a2ff[_0xba33('0x17')]===_0xba33('0x18')&&typeof _0x27a2ff[_0xba33('0x19')]===_0xba33('0x18');var _0x168a66=_0x35d3aa['count'];var _0x5205c9=_0x3b5196?0x0:_0x27a2ff[_0xba33('0x17')];var _0x16f1e5=_0x3b5196?_0x35d3aa[_0xba33('0x1a')]:_0x27a2ff[_0xba33('0x17')]+_0x27a2ff['limit'];var _0x2b7a29;if(_0x16f1e5>=_0x168a66){_0x16f1e5=_0x168a66;_0x2b7a29=0xc8;}else{_0x2b7a29=0xce;}_0x370c06['status'](_0x2b7a29);return _0x370c06[_0xba33('0x1b')](_0xba33('0x1c'),_0x5205c9+'-'+_0x16f1e5+'/'+_0x168a66)[_0xba33('0x16')](_0x35d3aa);}return null;};}function saveUpdates(_0x2c5780){return function(_0x4fe26f){if(_0x4fe26f){return _0x4fe26f[_0xba33('0x1d')](_0x2c5780)[_0xba33('0x1e')](function(_0x9cc69f){return _0x9cc69f;});}return null;};}function removeEntity(_0x2e5cdd){return function(_0x3cbbf2){if(_0x3cbbf2){return _0x3cbbf2[_0xba33('0x1f')]()[_0xba33('0x1e')](function(){_0x2e5cdd['status'](0xcc)[_0xba33('0x14')]();});}};}function handleEntityNotFound(_0x3161f0){return function(_0x120808){if(!_0x120808){_0x3161f0[_0xba33('0x13')](0x194);}return _0x120808;};}function handleError(_0x345e25,_0x75ccb){_0x75ccb=_0x75ccb||0x1f4;return function(_0x1341c7){logger[_0xba33('0x20')](_0x1341c7[_0xba33('0x21')]);if(_0x1341c7[_0xba33('0x22')]){delete _0x1341c7[_0xba33('0x22')];}_0x345e25[_0xba33('0x15')](_0x75ccb)[_0xba33('0x23')](_0x1341c7);};}exports['index']=function(_0x4324ff,_0x2c6960){var _0x1f0c38={};var _0x362def=_[_0xba33('0x24')](db[_0xba33('0x25')][_0xba33('0x26')],function(_0x4f074b){return{'name':_0x4f074b[_0xba33('0x27')],'type':_0x4f074b[_0xba33('0x28')][_0xba33('0x29')]};});_0x1f0c38=qs['getOptions'](_0x362def,_0x4324ff);return interaction[_0xba33('0x2a')](_0xba33('0x2b'),_0x4324ff['query'],_0x4324ff['user'],_0x1f0c38,_0x362def)[_0xba33('0x1e')](respondWithFilteredResult(_0x2c6960,_0x1f0c38))[_0xba33('0x2c')](handleError(_0x2c6960,null));};exports['show']=function(_0x143185,_0x407c29){var _0x3f9cbe={'raw':![],'where':{'id':_0x143185['params']['id']}},_0xf6c654={};_0xf6c654['model']=_[_0xba33('0x2d')](db[_0xba33('0x25')]['rawAttributes']);_0xf6c654[_0xba33('0x2e')]=_[_0xba33('0x2d')](_0x143185['query']);_0xf6c654[_0xba33('0x2f')]=_[_0xba33('0x30')](_0xf6c654[_0xba33('0x31')],_0xf6c654[_0xba33('0x2e')]);_0x3f9cbe[_0xba33('0x32')]=_[_0xba33('0x30')](_0xf6c654[_0xba33('0x31')],qs[_0xba33('0x33')](_0x143185[_0xba33('0x2e')][_0xba33('0x33')]));_0x3f9cbe[_0xba33('0x32')]=_0x3f9cbe[_0xba33('0x32')][_0xba33('0x34')]?_0x3f9cbe['attributes']:_0xf6c654['model'];if(_0x143185[_0xba33('0x2e')][_0xba33('0x35')]){_0x3f9cbe[_0xba33('0x36')]=[{'all':!![]}];}_0x3f9cbe=_[_0xba33('0x37')]({},_0x3f9cbe,_0x143185['options']);return db[_0xba33('0x25')]['find'](_0x3f9cbe)[_0xba33('0x1e')](handleEntityNotFound(_0x407c29,null))[_0xba33('0x1e')](respondWithResult(_0x407c29,null))[_0xba33('0x2c')](handleError(_0x407c29,null));};exports[_0xba33('0x38')]=function(_0x48148d,_0x34d5eb){return db[_0xba33('0x25')][_0xba33('0x38')](_0x48148d[_0xba33('0x39')],{})[_0xba33('0x1e')](respondWithResult(_0x34d5eb,0xc9))[_0xba33('0x2c')](handleError(_0x34d5eb,null));};exports['update']=function(_0x533396,_0x35c755){if(_0x533396['body']['id']){delete _0x533396['body']['id'];}return db[_0xba33('0x25')]['find']({'where':{'id':_0x533396[_0xba33('0x3a')]['id']}})[_0xba33('0x1e')](handleEntityNotFound(_0x35c755,null))[_0xba33('0x1e')](saveUpdates(_0x533396[_0xba33('0x39')],null))[_0xba33('0x1e')](respondWithResult(_0x35c755,null))[_0xba33('0x2c')](handleError(_0x35c755,null));};exports[_0xba33('0x1f')]=function(_0x436d08,_0x289026){return db[_0xba33('0x25')][_0xba33('0x3b')]({'where':{'id':_0x436d08['params']['id']}})['then'](handleEntityNotFound(_0x289026,null))[_0xba33('0x1e')](removeEntity(_0x289026,null))[_0xba33('0x2c')](handleError(_0x289026,null));};exports[_0xba33('0x3c')]=function(_0x2cdccf,_0x5b3f68){return db[_0xba33('0x25')][_0xba33('0x3c')]()[_0xba33('0x1e')](respondWithResult(_0x5b3f68,null))[_0xba33('0x2c')](handleError(_0x5b3f68,null));};exports['addMessage']=function(_0x167519,_0x1bf885){return db[_0xba33('0x3d')]['find']({'where':{'id':_0x167519[_0xba33('0x3a')]['id']}})['then'](handleEntityNotFound(_0x1bf885,null))[_0xba33('0x1e')](function(_0x4e3eff){if(_0x4e3eff){return _0x4e3eff[_0xba33('0x3e')](_0x167519[_0xba33('0x39')][_0xba33('0x3f')],_[_0xba33('0x40')](_0x167519[_0xba33('0x39')],[_0xba33('0x3f'),'id'])||{});}})['then'](respondWithResult(_0x1bf885,null))[_0xba33('0x2c')](handleError(_0x1bf885,null));};exports[_0xba33('0x41')]=function(_0x55321a,_0x16b387){var _0x4a24eb={'raw':![],'where':{}};var _0xf45131={};var _0xbd0ca={'count':0x0,'rows':[]};return db[_0xba33('0x25')][_0xba33('0x42')]({'where':{'id':_0x55321a['params']['id']}})[_0xba33('0x1e')](handleEntityNotFound(_0x16b387,null))[_0xba33('0x1e')](function(_0x4e3449){if(_0x4e3449){_0xf45131[_0xba33('0x31')]=_[_0xba33('0x2d')](db['WhatsappMessage'][_0xba33('0x26')]);_0xf45131[_0xba33('0x2e')]=_[_0xba33('0x2d')](_0x55321a['query']);_0xf45131['filters']=_[_0xba33('0x30')](_0xf45131[_0xba33('0x31')],_0xf45131['query']);_0x4a24eb[_0xba33('0x32')]=_['intersection'](_0xf45131['model'],qs[_0xba33('0x33')](_0x55321a[_0xba33('0x2e')]['fields']));_0x4a24eb[_0xba33('0x32')]=_0x4a24eb[_0xba33('0x32')][_0xba33('0x34')]?_0x4a24eb['attributes']:_0xf45131[_0xba33('0x31')];if(!_0x55321a[_0xba33('0x2e')][_0xba33('0x43')](_0xba33('0x44'))){_0x4a24eb[_0xba33('0x19')]=qs['limit'](_0x55321a[_0xba33('0x2e')][_0xba33('0x19')]);_0x4a24eb[_0xba33('0x17')]=qs['offset'](_0x55321a[_0xba33('0x2e')]['offset']);}_0x4a24eb[_0xba33('0x45')]=qs[_0xba33('0x46')](_0x55321a[_0xba33('0x2e')][_0xba33('0x46')]);_0x4a24eb[_0xba33('0x47')]=qs[_0xba33('0x2f')](_['pick'](_0x55321a['query'],_0xf45131[_0xba33('0x2f')]));_0x4a24eb['where'][_0xba33('0x48')]=_0x4e3449['id'];if(_0x55321a[_0xba33('0x2e')][_0xba33('0x49')]){_0x4a24eb['where']=_[_0xba33('0x37')](_0x4a24eb[_0xba33('0x47')],{'$or':_['map'](_0x4a24eb[_0xba33('0x32')],function(_0x448867){var _0x245772={};_0x245772[_0x448867]={'$like':'%'+_0x55321a[_0xba33('0x2e')]['filter']+'%'};return _0x245772;})});}if(_0x55321a[_0xba33('0x2e')][_0xba33('0x4a')]){var _0x1d63c1=_0x55321a['query']['$gte']['split'](',');var _0x8d0a6d={};_0x8d0a6d[_0x1d63c1[0x0]]={'$gte':moment(_0x1d63c1[0x1])[_0xba33('0x4b')](_0xba33('0x4c'))};_0x4a24eb[_0xba33('0x47')]=_['merge'](_0x4a24eb[_0xba33('0x47')],_0x8d0a6d);}_0x4a24eb=_[_0xba33('0x37')]({},_0x4a24eb,_0x55321a[_0xba33('0x4d')]);return db[_0xba33('0x3d')][_0xba33('0x1a')]({'where':_0x4a24eb[_0xba33('0x47')]})['then'](function(_0x3995e1){_0xbd0ca['count']=_0x3995e1;if(_0x55321a[_0xba33('0x2e')]['includeAll']){_0x4a24eb[_0xba33('0x36')]=[{'all':!![]}];}return db['WhatsappMessage'][_0xba33('0x2a')](_0x4a24eb);})['then'](function(_0x40725d){_0xbd0ca[_0xba33('0x4e')]=_0x40725d;return _0xbd0ca;});}})[_0xba33('0x1e')](respondWithFilteredResult(_0x16b387,_0x4a24eb))[_0xba33('0x2c')](handleError(_0x16b387,null));};exports[_0xba33('0x4f')]=function(_0x51fd24,_0x1ea4f1){return db[_0xba33('0x25')][_0xba33('0x3b')]({'where':{'id':_0x51fd24[_0xba33('0x3a')]['id']}})[_0xba33('0x1e')](handleEntityNotFound(_0x1ea4f1,null))[_0xba33('0x1e')](function(_0x50ea23){if(_0x50ea23){return _0x50ea23['setTags'](_0x51fd24[_0xba33('0x39')][_0xba33('0x3f')],_[_0xba33('0x40')](_0x51fd24[_0xba33('0x39')],[_0xba33('0x3f'),'id'])||{})[_0xba33('0x50')](function(){return db[_0xba33('0x51')][_0xba33('0x2a')]({'attributes':['id',_0xba33('0x22'),_0xba33('0x52')],'where':{'id':_0x51fd24[_0xba33('0x39')][_0xba33('0x3f')]}});})[_0xba33('0x1e')](function(_0x272cca){socket['emit'](_0xba33('0x53'),{'id':Number(_0x51fd24[_0xba33('0x3a')]['id']),'tags':_0x272cca||[]});return{'id':Number(_0x51fd24['params']['id']),'tags':_0x272cca||[]};});}})[_0xba33('0x1e')](respondWithResult(_0x1ea4f1,null))[_0xba33('0x2c')](handleError(_0x1ea4f1,null));};exports['removeTags']=function(_0x5715a5,_0x3d32ba){return db[_0xba33('0x25')]['find']({'where':{'id':_0x5715a5[_0xba33('0x3a')]['id']}})[_0xba33('0x1e')](handleEntityNotFound(_0x3d32ba,null))['then'](function(_0xfe16a9){if(_0xfe16a9){return _0xfe16a9[_0xba33('0x54')](_0x5715a5[_0xba33('0x2e')][_0xba33('0x3f')]);}})[_0xba33('0x1e')](respondWithStatusCode(_0x3d32ba,null))[_0xba33('0x2c')](handleError(_0x3d32ba,null));};exports['download']=function(_0x18b54a,_0x3fd579){var _0x2697fd=moment()[_0xba33('0x55')]()[_0xba33('0x56')]();var _0xe435a4=path['join'](config[_0xba33('0x57')],_0xba33('0x58'),'files',_0xba33('0x59'));var _0x32af03=path[_0xba33('0x5a')](config[_0xba33('0x57')],_0xba33('0x58'),_0xba33('0x5b'),_0xba33('0x5c'));var _0x9f285=path[_0xba33('0x5a')](_0xe435a4,_0x2697fd);var _0x369cb3=util[_0xba33('0x4b')]('transcript-%d-%s.zip',_0x18b54a[_0xba33('0x3a')]['id'],_0x2697fd);var _0x44adcf=path[_0xba33('0x5a')](_0xe435a4,_0x369cb3);var _0x5d2d9f=[];_0x5d2d9f[_0xba33('0x5d')]({'model':db[_0xba33('0x5e')],'as':_0xba33('0x5e'),'attributes':['id','fullname'],'raw':!![]});_0x5d2d9f['push']({'model':db['CmContact'],'as':_0xba33('0x5f'),'attributes':['id','firstName',_0xba33('0x60')],'raw':!![]});if(_0x18b54a[_0xba33('0x2e')][_0xba33('0x5c')]){_0x5d2d9f[_0xba33('0x5d')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x2f86dd=[{'model':db[_0xba33('0x3d')],'as':'Messages','attributes':['id',_0xba33('0x39'),_0xba33('0x61'),_0xba33('0x62'),_0xba33('0x63'),'read'],'include':_0x5d2d9f}];_0x2f86dd['push']({'model':db[_0xba33('0x64')],'as':_0xba33('0x65'),'attributes':['id',_0xba33('0x22')]});_0x2f86dd[_0xba33('0x5d')]({'model':db[_0xba33('0x5e')],'as':_0xba33('0x66'),'attributes':['id',_0xba33('0x67')]});return db['WhatsappInteraction'][_0xba33('0x3b')]({'where':{'id':_0x18b54a[_0xba33('0x3a')]['id']},'include':_0x2f86dd})[_0xba33('0x1e')](handleEntityNotFound(_0x3fd579,null))[_0xba33('0x1e')](function(_0x1254c8){if(_0x1254c8){var _0xa96287=_0x1254c8[_0xba33('0x68')]({'plain':!![]});fs['mkdirSync'](_0x9f285);var _0xb8efc1={'channel':'Whatsapp','account':_0xa96287[_0xba33('0x65')][_0xba33('0x22')],'agent':_0xa96287[_0xba33('0x66')]?_0xa96287['Owner'][_0xba33('0x67')]:_0xba33('0x69'),'createdAt':moment(_0xa96287[_0xba33('0x61')])[_0xba33('0x4b')](_0xba33('0x4c'))[_0xba33('0x56')](),'closedAt':_0xa96287[_0xba33('0x6a')]?moment(_0xa96287['closedAt'])['format'](_0xba33('0x4c'))['toString']():'','disposition':_0xa96287[_0xba33('0x6b')],'messages':_(_0xa96287['Messages'])[_0xba33('0x49')]({'secret':![]})[_0xba33('0x24')](function(_0x3e60c6){if(_0x3e60c6[_0xba33('0x6c')]){var _0x4f0931=path['join'](_0x32af03,_0x3e60c6[_0xba33('0x6c')]['basename']);if(fs[_0xba33('0x6d')](_0x4f0931)){fs[_0xba33('0x6e')](_0x4f0931)['pipe'](fs[_0xba33('0x6f')](path[_0xba33('0x5a')](_0x9f285,_0x3e60c6[_0xba33('0x6c')]['basename'])));}}return{'date':moment(_0x3e60c6['createdAt'])[_0xba33('0x4b')](_0xba33('0x4c'))[_0xba33('0x56')](),'sender':_0x3e60c6[_0xba33('0x62')]===_0xba33('0x70')?_0x3e60c6['User']?_0x3e60c6[_0xba33('0x5e')][_0xba33('0x67')]:_0xba33('0x71'):_0x3e60c6[_0xba33('0x5f')][_0xba33('0x72')]+(_0x3e60c6['Contact'][_0xba33('0x60')]?'\x20'+_0x3e60c6[_0xba33('0x5f')][_0xba33('0x60')]:''),'body':_0x3e60c6[_0xba33('0x6c')]?_0x3e60c6[_0xba33('0x6c')][_0xba33('0x73')]:_0x3e60c6[_0xba33('0x39')],'direction':_0x3e60c6[_0xba33('0x62')]===_0xba33('0x70')?'A':'C','secret':_0x3e60c6[_0xba33('0x63')],'read':_0x3e60c6[_0xba33('0x74')],'attachment':_0x3e60c6[_0xba33('0x6c')]};})[_0xba33('0x75')]()};return ejs[_0xba33('0x76')](path[_0xba33('0x5a')](config[_0xba33('0x57')],_0xba33('0x58'),_0xba33('0x77'),_0xba33('0x78')),{'interaction':_0xb8efc1})[_0xba33('0x1e')](function(_0x3129e4){var _0x3c4cb5=path[_0xba33('0x5a')](_0x9f285,_0xba33('0x79')+_0xa96287['id']+'-'+_0x2697fd+'.pdf');var _0x213a90={'path':_0x3c4cb5,'channel':_0xba33('0x7a'),'interactionId':_0xa96287['id']};return pdf[_0xba33('0x7b')](_0x3129e4,_0x213a90);})[_0xba33('0x1e')](function(){return new BPromise(function(_0x3da591,_0x564ca1){zipdir(_0x9f285,{'saveTo':_0x44adcf},function(_0xda98a6,_0x28cd1e){if(_0xda98a6)return _0x564ca1(_0xda98a6);return _0x3da591(_0x28cd1e);});})['then'](function(){return new BPromise(function(_0x49c8f4,_0x170f09){rimraf(_0x9f285,function(_0x143f89){if(_0x143f89)_0x170f09(_0x143f89);return _0x49c8f4();});});})['then'](function(){return _0x3fd579['download'](_0x44adcf,_0x369cb3,function(_0x7c5276){if(_0x7c5276){console['log'](_0xba33('0x7c'),_0x7c5276);}else{fs[_0xba33('0x7d')](_0x44adcf);}});});});}else{return _0x3fd579[_0xba33('0x13')](0xc8);}})[_0xba33('0x2c')](handleError(_0x3fd579,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 4347a53..79b932f 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 _0xc3fe=['events','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','save','remove','getUsers','then','Users','findAll','unreadMessages','length','emit','catch','hasOwnProperty','exports'];(function(_0x419a72,_0x38eca0){var _0x5e52a7=function(_0x39e116){while(--_0x39e116){_0x419a72['push'](_0x419a72['shift']());}};_0x5e52a7(++_0x38eca0);}(_0xc3fe,0xff));var _0xec3f=function(_0x215e65,_0x183f97){_0x215e65=_0x215e65-0x0;var _0xa85842=_0xc3fe[_0x215e65];return _0xa85842;};'use strict';var EventEmitter=require(_0xec3f('0x0'));var WhatsappInteraction=require(_0xec3f('0x1'))['db'][_0xec3f('0x2')];var WhatsappMessage=require('../../mysqldb')['db'][_0xec3f('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xec3f('0x4')](0x0);var events={'afterCreate':_0xec3f('0x5'),'afterUpdate':'update','afterDestroy':_0xec3f('0x6')};function emitEvent(_0xda4641){return function(_0x22e55b,_0x5807a9,_0x4fb9aa){_0x22e55b[_0xec3f('0x7')]({'attributes':['id'],'raw':!![]})[_0xec3f('0x8')](function(_0x526183){_0x22e55b['setDataValue'](_0xec3f('0x9'),_0x526183['map'](function(_0x32207e){return{'id':_0x32207e['id']};}));return WhatsappMessage[_0xec3f('0xa')]({'where':{'WhatsappInteractionId':_0x22e55b['id'],'direction':'in','read':![]},'raw':!![]});})[_0xec3f('0x8')](function(_0x163eb8){_0x22e55b['setDataValue'](_0xec3f('0xb'),_0x163eb8[_0xec3f('0xc')]);WhatsappInteractionEvents[_0xec3f('0xd')](_0xda4641+':'+_0x22e55b['id'],_0x22e55b);WhatsappInteractionEvents[_0xec3f('0xd')](_0xda4641,_0x22e55b);_0x4fb9aa(null);})[_0xec3f('0xe')](_0x4fb9aa(null));};}for(var e in events){if(events[_0xec3f('0xf')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0xec3f('0x10')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x1c8a=['map','findAll','length','emit','exports','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','save','remove','getUsers','then','setDataValue','Users'];(function(_0x536149,_0x1c05e7){var _0x2c01fb=function(_0x10d9e6){while(--_0x10d9e6){_0x536149['push'](_0x536149['shift']());}};_0x2c01fb(++_0x1c05e7);}(_0x1c8a,0x140));var _0xa1c8=function(_0x553808,_0x2ce312){_0x553808=_0x553808-0x0;var _0x17f5cd=_0x1c8a[_0x553808];return _0x17f5cd;};'use strict';var EventEmitter=require(_0xa1c8('0x0'));var WhatsappInteraction=require(_0xa1c8('0x1'))['db'][_0xa1c8('0x2')];var WhatsappMessage=require(_0xa1c8('0x1'))['db'][_0xa1c8('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa1c8('0x4'),'afterUpdate':'update','afterDestroy':_0xa1c8('0x5')};function emitEvent(_0x1cdee0){return function(_0x4668e8,_0x559330,_0x331282){_0x4668e8[_0xa1c8('0x6')]({'attributes':['id'],'raw':!![]})[_0xa1c8('0x7')](function(_0x57d2d4){_0x4668e8[_0xa1c8('0x8')](_0xa1c8('0x9'),_0x57d2d4[_0xa1c8('0xa')](function(_0x4a5d71){return{'id':_0x4a5d71['id']};}));return WhatsappMessage[_0xa1c8('0xb')]({'where':{'WhatsappInteractionId':_0x4668e8['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa1c8('0x7')](function(_0x6e2ad7){_0x4668e8['setDataValue']('unreadMessages',_0x6e2ad7[_0xa1c8('0xc')]);WhatsappInteractionEvents['emit'](_0x1cdee0+':'+_0x4668e8['id'],_0x4668e8);WhatsappInteractionEvents[_0xa1c8('0xd')](_0x1cdee0,_0x4668e8);_0x331282(null);})['catch'](_0x331282(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0xa1c8('0xe')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 1921de5..507c68f 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 _0xf25e=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','define','WhatsappInteraction','changed','closed','closedAt','format'];(function(_0x55c004,_0x150eec){var _0x54d172=function(_0x45395e){while(--_0x45395e){_0x55c004['push'](_0x55c004['shift']());}};_0x54d172(++_0x150eec);}(_0xf25e,0x190));var _0xef25=function(_0x4f9cb5,_0x19f945){_0x4f9cb5=_0x4f9cb5-0x0;var _0x3d85bf=_0xf25e[_0x4f9cb5];return _0x3d85bf;};'use strict';var _=require('lodash');var util=require(_0xef25('0x0'));var logger=require(_0xef25('0x1'))(_0xef25('0x2'));var moment=require(_0xef25('0x3'));var BPromise=require(_0xef25('0x4'));var rp=require(_0xef25('0x5'));var fs=require('fs');var path=require(_0xef25('0x6'));var rimraf=require(_0xef25('0x7'));var config=require(_0xef25('0x8'));var attributes=require(_0xef25('0x9'));module['exports']=function(_0x702050,_0x207f40){return _0x702050[_0xef25('0xa')](_0xef25('0xb'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x40f0ae,_0x44c93a,_0x8740e5){if(_0x40f0ae[_0xef25('0xc')](_0xef25('0xd'))){_0x40f0ae[_0xef25('0xe')]=moment()[_0xef25('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x8740e5(null,_0x40f0ae);}}});}; \ No newline at end of file +var _0xae1b=['util','api','moment','bluebird','request-promise','path','rimraf','./whatsappInteraction.attributes','exports','WhatsappInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x22704a,_0x48adf9){var _0x3c6406=function(_0x31e2c4){while(--_0x31e2c4){_0x22704a['push'](_0x22704a['shift']());}};_0x3c6406(++_0x48adf9);}(_0xae1b,0x96));var _0xbae1=function(_0x31a38b,_0x2c9b1c){_0x31a38b=_0x31a38b-0x0;var _0x5968bb=_0xae1b[_0x31a38b];return _0x5968bb;};'use strict';var _=require('lodash');var util=require(_0xbae1('0x0'));var logger=require('../../config/logger')(_0xbae1('0x1'));var moment=require(_0xbae1('0x2'));var BPromise=require(_0xbae1('0x3'));var rp=require(_0xbae1('0x4'));var fs=require('fs');var path=require(_0xbae1('0x5'));var rimraf=require(_0xbae1('0x6'));var config=require('../../config/environment');var attributes=require(_0xbae1('0x7'));module[_0xbae1('0x8')]=function(_0x5b8d9d,_0x447cd9){return _0x5b8d9d['define'](_0xbae1('0x9'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3f0ff5,_0x340ff9,_0x5d81d3){if(_0x3f0ff5[_0xbae1('0xa')](_0xbae1('0xb'))){_0x3f0ff5[_0xbae1('0xc')]=moment()[_0xbae1('0xd')](_0xbae1('0xe'));}_0x5d81d3(null,_0x3f0ff5);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index ea990d9..081758e 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 _0xd998=['where','then','UpdateWhatsappInteraction','debug','AddTagsToWhatsappInteraction','find','addTags','omit','ids','spread','AddTags','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','WhatsappInteraction','update','body','options','raw'];(function(_0x21a32a,_0x40494a){var _0x3b85cd=function(_0x168ecb){while(--_0x168ecb){_0x21a32a['push'](_0x21a32a['shift']());}};_0x3b85cd(++_0x40494a);}(_0xd998,0x131));var _0x8d99=function(_0x11dd75,_0x340f1c){_0x11dd75=_0x11dd75-0x0;var _0x21bd9b=_0xd998[_0x11dd75];return _0x21bd9b;};'use strict';var _=require('lodash');var util=require(_0x8d99('0x0'));var moment=require(_0x8d99('0x1'));var BPromise=require('bluebird');var rs=require(_0x8d99('0x2'));var fs=require('fs');var Redis=require(_0x8d99('0x3'));var db=require(_0x8d99('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8d99('0x5'))(_0x8d99('0x6'));var config=require(_0x8d99('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8d99('0x8')][_0x8d99('0x9')]({'port':0x232a});config[_0x8d99('0xa')]=_[_0x8d99('0xb')](config[_0x8d99('0xa')],{'host':_0x8d99('0xc'),'port':0x18eb});var socket=require(_0x8d99('0xd'))(new Redis(config[_0x8d99('0xa')]));require(_0x8d99('0xe'))[_0x8d99('0xf')](socket);function respondWithRpcPromise(_0x1ef53b,_0x723a19,_0x48d4b1){return new BPromise(function(_0x5bd959,_0x5b4d47){return client[_0x8d99('0x10')](_0x1ef53b,_0x48d4b1)['then'](function(_0x3287a3){logger[_0x8d99('0x11')](_0x8d99('0x12'),_0x723a19,_0x8d99('0x13'));logger['debug'](_0x8d99('0x14'),_0x723a19,'request\x20sent',JSON[_0x8d99('0x15')](_0x3287a3));if(_0x3287a3[_0x8d99('0x16')]){if(_0x3287a3[_0x8d99('0x16')][_0x8d99('0x17')]===0x1f4){logger[_0x8d99('0x16')](_0x8d99('0x12'),_0x723a19,_0x3287a3[_0x8d99('0x16')][_0x8d99('0x18')]);return _0x5b4d47(_0x3287a3[_0x8d99('0x16')][_0x8d99('0x18')]);}logger[_0x8d99('0x16')](_0x8d99('0x12'),_0x723a19,_0x3287a3[_0x8d99('0x16')]['message']);return _0x5bd959(_0x3287a3['error']['message']);}else{logger[_0x8d99('0x11')](_0x8d99('0x12'),_0x723a19,_0x8d99('0x13'));_0x5bd959(_0x3287a3['result'][_0x8d99('0x18')]);}})[_0x8d99('0x19')](function(_0xf0afcf){logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x723a19,_0xf0afcf);_0x5b4d47(_0xf0afcf);});});}exports['UpdateWhatsappInteraction']=function(_0x439486){var _0x3eef0d=this;return new Promise(function(_0x381d8f,_0x3ee66f){return db[_0x8d99('0x1a')][_0x8d99('0x1b')](_0x439486[_0x8d99('0x1c')],{'raw':_0x439486[_0x8d99('0x1d')]?_0x439486[_0x8d99('0x1d')][_0x8d99('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x439486['options']?_0x439486['options'][_0x8d99('0x1f')]||null:null,'attributes':_0x439486[_0x8d99('0x1d')]?_0x439486[_0x8d99('0x1d')]['attributes']||null:null,'limit':_0x439486['options']?_0x439486[_0x8d99('0x1d')]['limit']||null:null})[_0x8d99('0x20')](function(_0x238e57){logger[_0x8d99('0x11')](_0x8d99('0x21'),_0x439486);logger[_0x8d99('0x22')](_0x8d99('0x21'),_0x439486,JSON[_0x8d99('0x15')](_0x238e57));_0x381d8f(_0x238e57);})[_0x8d99('0x19')](function(_0x1b8c02){logger[_0x8d99('0x16')]('UpdateWhatsappInteraction',_0x1b8c02[_0x8d99('0x18')],_0x439486);_0x3ee66f(_0x3eef0d['error'](0x1f4,_0x1b8c02[_0x8d99('0x18')]));});});};exports[_0x8d99('0x23')]=function(_0x2cec1f){return new Promise(function(_0x31882a,_0x44f45a){return db['WhatsappInteraction'][_0x8d99('0x24')]({'where':_0x2cec1f[_0x8d99('0x1d')]?_0x2cec1f[_0x8d99('0x1d')][_0x8d99('0x1f')]||null:null})['then'](function(_0x3da49f){if(_0x3da49f){return _0x3da49f[_0x8d99('0x25')](_0x2cec1f[_0x8d99('0x1c')]['ids'],_[_0x8d99('0x26')](_0x2cec1f[_0x8d99('0x1c')],[_0x8d99('0x27'),'id'])||{});}})[_0x8d99('0x28')](function(_0x2064db){logger['info']('AddTags',_0x2cec1f);logger['debug'](_0x8d99('0x29'),_0x2cec1f,JSON[_0x8d99('0x15')](_0x2064db));_0x31882a(_0x2064db);})[_0x8d99('0x19')](function(_0xb8ebb3){logger[_0x8d99('0x16')]('AddTags',_0xb8ebb3[_0x8d99('0x18')],_0x2cec1f);_0x44f45a(_this['error'](0x1f4,_0xb8ebb3[_0x8d99('0x18')]));});});}; \ No newline at end of file +var _0x7f49=['redis','defaults','localhost','socket.io-emitter','request','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UpdateWhatsappInteraction','update','body','options','where','attributes','limit','then','find','addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2b2341,_0x492d7e){var _0x163e45=function(_0x4dd247){while(--_0x4dd247){_0x2b2341['push'](_0x2b2341['shift']());}};_0x163e45(++_0x492d7e);}(_0x7f49,0x94));var _0x97f4=function(_0x520d52,_0x2c25d4){_0x520d52=_0x520d52-0x0;var _0x19e694=_0x7f49[_0x520d52];return _0x19e694;};'use strict';var _=require('lodash');var util=require(_0x97f4('0x0'));var moment=require(_0x97f4('0x1'));var BPromise=require(_0x97f4('0x2'));var rs=require(_0x97f4('0x3'));var fs=require('fs');var Redis=require(_0x97f4('0x4'));var db=require(_0x97f4('0x5'))['db'];var utils=require(_0x97f4('0x6'));var logger=require(_0x97f4('0x7'))(_0x97f4('0x8'));var config=require(_0x97f4('0x9'));var jayson=require(_0x97f4('0xa'));var client=jayson['client'][_0x97f4('0xb')]({'port':0x232a});config[_0x97f4('0xc')]=_[_0x97f4('0xd')](config['redis'],{'host':_0x97f4('0xe'),'port':0x18eb});var socket=require(_0x97f4('0xf'))(new Redis(config[_0x97f4('0xc')]));require('./whatsappInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x5b570f,_0x594124,_0x340d27){return new BPromise(function(_0x5908a2,_0x1afe56){return client[_0x97f4('0x10')](_0x5b570f,_0x340d27)['then'](function(_0x3a7357){logger[_0x97f4('0x11')](_0x97f4('0x12'),_0x594124,_0x97f4('0x13'));logger[_0x97f4('0x14')](_0x97f4('0x15'),_0x594124,_0x97f4('0x13'),JSON[_0x97f4('0x16')](_0x3a7357));if(_0x3a7357[_0x97f4('0x17')]){if(_0x3a7357[_0x97f4('0x17')][_0x97f4('0x18')]===0x1f4){logger[_0x97f4('0x17')]('WhatsappInteraction,\x20%s,\x20%s',_0x594124,_0x3a7357['error']['message']);return _0x1afe56(_0x3a7357['error'][_0x97f4('0x19')]);}logger[_0x97f4('0x17')](_0x97f4('0x12'),_0x594124,_0x3a7357[_0x97f4('0x17')][_0x97f4('0x19')]);return _0x5908a2(_0x3a7357[_0x97f4('0x17')][_0x97f4('0x19')]);}else{logger['info']('WhatsappInteraction,\x20%s,\x20%s',_0x594124,_0x97f4('0x13'));_0x5908a2(_0x3a7357['result'][_0x97f4('0x19')]);}})['catch'](function(_0x29718a){logger[_0x97f4('0x17')]('WhatsappInteraction,\x20%s,\x20%s',_0x594124,_0x29718a);_0x1afe56(_0x29718a);});});}exports[_0x97f4('0x1a')]=function(_0x596a3f){var _0x4d92e9=this;return new Promise(function(_0x40f8ab,_0x5539d5){return db['WhatsappInteraction'][_0x97f4('0x1b')](_0x596a3f[_0x97f4('0x1c')],{'raw':_0x596a3f[_0x97f4('0x1d')]?_0x596a3f['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x596a3f[_0x97f4('0x1d')]?_0x596a3f['options'][_0x97f4('0x1e')]||null:null,'attributes':_0x596a3f[_0x97f4('0x1d')]?_0x596a3f[_0x97f4('0x1d')][_0x97f4('0x1f')]||null:null,'limit':_0x596a3f[_0x97f4('0x1d')]?_0x596a3f['options'][_0x97f4('0x20')]||null:null})[_0x97f4('0x21')](function(_0x50d5f7){logger[_0x97f4('0x11')]('UpdateWhatsappInteraction',_0x596a3f);logger[_0x97f4('0x14')](_0x97f4('0x1a'),_0x596a3f,JSON['stringify'](_0x50d5f7));_0x40f8ab(_0x50d5f7);})['catch'](function(_0x368d3c){logger[_0x97f4('0x17')]('UpdateWhatsappInteraction',_0x368d3c[_0x97f4('0x19')],_0x596a3f);_0x5539d5(_0x4d92e9[_0x97f4('0x17')](0x1f4,_0x368d3c['message']));});});};exports['AddTagsToWhatsappInteraction']=function(_0xcfb2b1){return new Promise(function(_0x40e3a8,_0xf2a6c2){return db['WhatsappInteraction'][_0x97f4('0x22')]({'where':_0xcfb2b1[_0x97f4('0x1d')]?_0xcfb2b1[_0x97f4('0x1d')][_0x97f4('0x1e')]||null:null})['then'](function(_0x44040d){if(_0x44040d){return _0x44040d[_0x97f4('0x23')](_0xcfb2b1[_0x97f4('0x1c')][_0x97f4('0x24')],_[_0x97f4('0x25')](_0xcfb2b1[_0x97f4('0x1c')],[_0x97f4('0x24'),'id'])||{});}})[_0x97f4('0x26')](function(_0x5ebc1b){logger[_0x97f4('0x11')](_0x97f4('0x27'),_0xcfb2b1);logger['debug'](_0x97f4('0x27'),_0xcfb2b1,JSON[_0x97f4('0x16')](_0x5ebc1b));_0x40e3a8(_0x5ebc1b);})['catch'](function(_0x58244e){logger[_0x97f4('0x17')](_0x97f4('0x27'),_0x58244e[_0x97f4('0x19')],_0xcfb2b1);_0xf2a6c2(_this[_0x97f4('0x17')](0x1f4,_0x58244e[_0x97f4('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index f67821a..a879397 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 _0x5102=['whatsappInteraction:','./whatsappInteraction.events','removeListener','register','length'];(function(_0x476b00,_0x250877){var _0x44ec8e=function(_0xec6b23){while(--_0xec6b23){_0x476b00['push'](_0x476b00['shift']());}};_0x44ec8e(++_0x250877);}(_0x5102,0xd8));var _0x2510=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x5102[_0x1d1779];return _0x2377e9;};'use strict';var WhatsappInteractionEvents=require(_0x2510('0x0'));var events=['save','remove','update'];function createListener(_0x528171,_0x5ca8c1){return function(_0x520335){_0x5ca8c1['emit'](_0x528171,_0x520335);};}function removeListener(_0x494243,_0x2e6e94){return function(){WhatsappInteractionEvents[_0x2510('0x1')](_0x494243,_0x2e6e94);};}exports[_0x2510('0x2')]=function(_0x43fb87){for(var _0x299f0=0x0,_0x410bc9=events[_0x2510('0x3')];_0x299f0<_0x410bc9;_0x299f0++){var _0x39c6c2=events[_0x299f0];var _0x44c583=createListener(_0x2510('0x4')+_0x39c6c2,_0x43fb87);WhatsappInteractionEvents['on'](_0x39c6c2,_0x44c583);}}; \ No newline at end of file +var _0x7d90=['register','length','whatsappInteraction:','./whatsappInteraction.events','emit'];(function(_0x5c811c,_0x313b25){var _0x5df3af=function(_0x3460de){while(--_0x3460de){_0x5c811c['push'](_0x5c811c['shift']());}};_0x5df3af(++_0x313b25);}(_0x7d90,0x13e));var _0x07d9=function(_0x4ef28d,_0x4e1cfb){_0x4ef28d=_0x4ef28d-0x0;var _0x498b67=_0x7d90[_0x4ef28d];return _0x498b67;};'use strict';var WhatsappInteractionEvents=require(_0x07d9('0x0'));var events=['save','remove','update'];function createListener(_0x28adc8,_0x4df263){return function(_0x1d517b){_0x4df263[_0x07d9('0x1')](_0x28adc8,_0x1d517b);};}function removeListener(_0x18e10e,_0x469b80){return function(){WhatsappInteractionEvents['removeListener'](_0x18e10e,_0x469b80);};}exports[_0x07d9('0x2')]=function(_0x735ef1){for(var _0x27a83c=0x0,_0x5ee9a3=events[_0x07d9('0x3')];_0x27a83c<_0x5ee9a3;_0x27a83c++){var _0x5938d6=events[_0x27a83c];var _0x21fbdc=createListener(_0x07d9('0x4')+_0x5938d6,_0x735ef1);WhatsappInteractionEvents['on'](_0x5938d6,_0x21fbdc);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index c70e7d1..5f9047c 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 _0x2e37=['/:id/reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','isAuthenticated','index','whatsapp','whatsappmessage:create','create','post','status','put','/:id','update','accept'];(function(_0x4342a4,_0x5c38d7){var _0x48fce6=function(_0x1fa337){while(--_0x1fa337){_0x4342a4['push'](_0x4342a4['shift']());}};_0x48fce6(++_0x5c38d7);}(_0x2e37,0x86));var _0x72e3=function(_0x5192de,_0x4e91cd){_0x5192de=_0x5192de-0x0;var _0x4e287e=_0x2e37[_0x5192de];return _0x4e287e;};'use strict';var multer=require(_0x72e3('0x0'));var util=require(_0x72e3('0x1'));var path=require(_0x72e3('0x2'));var timeout=require(_0x72e3('0x3'));var express=require(_0x72e3('0x4'));var router=express[_0x72e3('0x5')]();var fs_extra=require(_0x72e3('0x6'));var auth=require(_0x72e3('0x7'));var interaction=require(_0x72e3('0x8'));var config=require(_0x72e3('0x9'));var controller=require(_0x72e3('0xa'));router['get']('/',auth[_0x72e3('0xb')](),controller[_0x72e3('0xc')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0x72e3('0xb')](),controller['show']);router['post']('/',auth[_0x72e3('0xb')](),interaction['tracked'](_0x72e3('0xd'),_0x72e3('0xe')),controller[_0x72e3('0xf')]);router[_0x72e3('0x10')]('/:id/status',controller[_0x72e3('0x11')]);router[_0x72e3('0x12')](_0x72e3('0x13'),auth[_0x72e3('0xb')](),controller[_0x72e3('0x14')]);router[_0x72e3('0x12')]('/:id/accept',auth[_0x72e3('0xb')](),controller[_0x72e3('0x15')]);router['put'](_0x72e3('0x16'),auth[_0x72e3('0xb')](),controller['reject']);router[_0x72e3('0x17')](_0x72e3('0x13'),auth[_0x72e3('0xb')](),controller[_0x72e3('0x18')]);module[_0x72e3('0x19')]=router; \ No newline at end of file +var _0x0cdb=['tracked','whatsapp','whatsappmessage:create','create','/:id/status','put','/:id','update','/:id/accept','accept','/:id/reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','show','post'];(function(_0x19b351,_0x547358){var _0x104803=function(_0x412161){while(--_0x412161){_0x19b351['push'](_0x19b351['shift']());}};_0x104803(++_0x547358);}(_0x0cdb,0xbc));var _0xb0cd=function(_0x5adfa9,_0x4b835d){_0x5adfa9=_0x5adfa9-0x0;var _0x458f41=_0x0cdb[_0x5adfa9];return _0x458f41;};'use strict';var multer=require(_0xb0cd('0x0'));var util=require(_0xb0cd('0x1'));var path=require(_0xb0cd('0x2'));var timeout=require(_0xb0cd('0x3'));var express=require(_0xb0cd('0x4'));var router=express[_0xb0cd('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb0cd('0x6'));var interaction=require(_0xb0cd('0x7'));var config=require(_0xb0cd('0x8'));var controller=require('./whatsappMessage.controller');router['get']('/',auth[_0xb0cd('0x9')](),controller[_0xb0cd('0xa')]);router[_0xb0cd('0xb')]('/describe',auth[_0xb0cd('0x9')](),controller[_0xb0cd('0xc')]);router[_0xb0cd('0xb')]('/:id',auth[_0xb0cd('0x9')](),controller[_0xb0cd('0xd')]);router[_0xb0cd('0xe')]('/',auth[_0xb0cd('0x9')](),interaction[_0xb0cd('0xf')](_0xb0cd('0x10'),_0xb0cd('0x11')),controller[_0xb0cd('0x12')]);router['post'](_0xb0cd('0x13'),controller['status']);router[_0xb0cd('0x14')](_0xb0cd('0x15'),auth[_0xb0cd('0x9')](),controller[_0xb0cd('0x16')]);router[_0xb0cd('0x14')](_0xb0cd('0x17'),auth[_0xb0cd('0x9')](),controller[_0xb0cd('0x18')]);router[_0xb0cd('0x14')](_0xb0cd('0x19'),auth[_0xb0cd('0x9')](),controller['reject']);router[_0xb0cd('0x1a')]('/:id',auth[_0xb0cd('0x9')](),controller[_0xb0cd('0x1b')]);module[_0xb0cd('0x1c')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 19d2e5c..da9c67e 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 _0x4c22=['STRING','DATE','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x3c8366,_0x46df4c){var _0xae08f1=function(_0x5da3ef){while(--_0x5da3ef){_0x3c8366['push'](_0x3c8366['shift']());}};_0xae08f1(++_0x46df4c);}(_0x4c22,0x168));var _0x24c2=function(_0x15835b,_0x3e52a5){_0x15835b=_0x15835b-0x0;var _0x3e3dc1=_0x4c22[_0x15835b];return _0x3e3dc1;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT'](_0x24c2('0x0')),'allowNull':![]},'read':{'type':Sequelize[_0x24c2('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0x24c2('0x2')]('in',_0x24c2('0x3')),'defaultValue':_0x24c2('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0x24c2('0x4')](0xbe)},'phone':{'type':Sequelize[_0x24c2('0x4')]},'readAt':{'type':Sequelize[_0x24c2('0x5')]},'secret':{'type':Sequelize[_0x24c2('0x1')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x24c2('0x4')]},'providerResponse':{'type':Sequelize[_0x24c2('0x6')]}}; \ No newline at end of file +var _0x92e0=['ENUM','out','STRING','DATE','sequelize','TEXT','medium','BOOLEAN'];(function(_0x3cc05d,_0x4b8f88){var _0x28b736=function(_0x369b0e){while(--_0x369b0e){_0x3cc05d['push'](_0x3cc05d['shift']());}};_0x28b736(++_0x4b8f88);}(_0x92e0,0x154));var _0x092e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x92e0[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x092e('0x0'));module['exports']={'body':{'type':Sequelize[_0x092e('0x1')](_0x092e('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x092e('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x092e('0x4')]('in',_0x092e('0x5')),'defaultValue':_0x092e('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x092e('0x6')](0xbe)},'phone':{'type':Sequelize[_0x092e('0x6')]},'readAt':{'type':Sequelize[_0x092e('0x7')]},'secret':{'type':Sequelize[_0x092e('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 86a25ce..929a145 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 _0xc3d1=['body','find','params','describe','accept','whatsapp','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','info','user','interaction','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','User','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','whatsapp-interactions','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','QueryTypes','SELECT','internal','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','type','MessageSid','messageId','MessageStatus','read','twilio','eml-format','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','request','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','status','end','offset','undefined','count','limit','json','apply','reject','save','update','then','destroy','sendStatus','stack','name','WhatsappMessage','rawAttributes','fieldName','key','map','query','keys','filters','model','attributes','intersection','fields','length','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','create'];(function(_0x115dc4,_0x4f359d){var _0x1b3e22=function(_0x410a5e){while(--_0x410a5e){_0x115dc4['push'](_0x115dc4['shift']());}};_0x1b3e22(++_0x4f359d);}(_0xc3d1,0x1c4));var _0x1c3d=function(_0x4eec9b,_0x4aea09){_0x4eec9b=_0x4eec9b-0x0;var _0x2e3849=_0xc3d1[_0x4eec9b];return _0x2e3849;};'use strict';var emlformat=require(_0x1c3d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1c3d('0x1'));var BPromise=require(_0x1c3d('0x2'));var Mustache=require(_0x1c3d('0x3'));var util=require(_0x1c3d('0x4'));var path=require(_0x1c3d('0x5'));var sox=require('sox');var csv=require(_0x1c3d('0x6'));var ejs=require(_0x1c3d('0x7'));var fs=require('fs');var fs_extra=require(_0x1c3d('0x8'));var _=require(_0x1c3d('0x9'));var squel=require('squel');var crypto=require(_0x1c3d('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x1c3d('0xb'));var toCsv=require(_0x1c3d('0x6'));var querystring=require(_0x1c3d('0xc'));var Papa=require(_0x1c3d('0xd'));var Redis=require('ioredis');var authService=require(_0x1c3d('0xe'));var qs=require(_0x1c3d('0xf'));var as=require(_0x1c3d('0x10'));var hardwareService=require(_0x1c3d('0x11'));var logger=require(_0x1c3d('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x1c3d('0x13'));var licenseUtil=require(_0x1c3d('0x14'));var db=require('../../mysqldb')['db'];config[_0x1c3d('0x15')]=_['defaults'](config[_0x1c3d('0x15')],{'host':_0x1c3d('0x16'),'port':0x18eb});var socket=require(_0x1c3d('0x17'))(new Redis(config[_0x1c3d('0x15')]));require(_0x1c3d('0x18'))[_0x1c3d('0x19')](socket);var jayson=require(_0x1c3d('0x1a'));var client=jayson[_0x1c3d('0x1b')][_0x1c3d('0x1c')]({'port':0x232c});var client9002=jayson[_0x1c3d('0x1b')][_0x1c3d('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x1b30b3,_0x3947d4,_0x2ed9ec,_0x34b855){return new BPromise(function(_0x3bad43,_0x1c0095){var _0x3343ce=_0x34b855||client;return _0x3343ce[_0x1c3d('0x1d')](_0x1b30b3,_0x2ed9ec)['then'](function(_0x5e753a){logger['info'](_0x1c3d('0x1e'),_0x3947d4,_0x1c3d('0x1f'));logger[_0x1c3d('0x20')](_0x1c3d('0x21'),_0x3947d4,_0x1c3d('0x1f'),JSON[_0x1c3d('0x22')](_0x5e753a));if(_0x5e753a['error']){if(_0x5e753a[_0x1c3d('0x23')]['code']===0x1f4){logger[_0x1c3d('0x23')](_0x1c3d('0x1e'),_0x3947d4,_0x5e753a['error'][_0x1c3d('0x24')]);return _0x1c0095(_0x5e753a['error'][_0x1c3d('0x24')]);}logger[_0x1c3d('0x23')](_0x1c3d('0x1e'),_0x3947d4,_0x5e753a['error'][_0x1c3d('0x24')]);return _0x3bad43(_0x5e753a['error']['message']);}else{logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x3947d4,'request\x20sent');_0x3bad43(_0x5e753a['result'][_0x1c3d('0x24')]);}})[_0x1c3d('0x25')](function(_0x4bc157){logger[_0x1c3d('0x23')](_0x1c3d('0x1e'),_0x3947d4,_0x4bc157);_0x1c0095(_0x4bc157);});});}function respondWithStatusCode(_0x2b4905,_0x9f2364){_0x9f2364=_0x9f2364||0xcc;return function(_0x1aee24){if(_0x1aee24){return _0x2b4905['sendStatus'](_0x9f2364);}return _0x2b4905[_0x1c3d('0x26')](_0x9f2364)[_0x1c3d('0x27')]();};}function respondWithResult(_0x4b3211,_0x31552d){_0x31552d=_0x31552d||0xc8;return function(_0x1aef35){if(_0x1aef35){return _0x4b3211['status'](_0x31552d)['json'](_0x1aef35);}};}function respondWithFilteredResult(_0x431164,_0x289537){return function(_0xad1b20){if(_0xad1b20){var _0x52a8f9=typeof _0x289537[_0x1c3d('0x28')]===_0x1c3d('0x29')&&typeof _0x289537['limit']===_0x1c3d('0x29');var _0x4ced38=_0xad1b20[_0x1c3d('0x2a')];var _0x3447c2=_0x52a8f9?0x0:_0x289537[_0x1c3d('0x28')];var _0xec87b2=_0x52a8f9?_0xad1b20[_0x1c3d('0x2a')]:_0x289537['offset']+_0x289537[_0x1c3d('0x2b')];var _0xf533ff;if(_0xec87b2>=_0x4ced38){_0xec87b2=_0x4ced38;_0xf533ff=0xc8;}else{_0xf533ff=0xce;}_0x431164['status'](_0xf533ff);return _0x431164['set']('Content-Range',_0x3447c2+'-'+_0xec87b2+'/'+_0x4ced38)[_0x1c3d('0x2c')](_0xad1b20);}return null;};}function patchUpdates(_0x2adb25){return function(_0x39d879){try{jsonpatch[_0x1c3d('0x2d')](_0x39d879,_0x2adb25,!![]);}catch(_0x2b51d1){return BPromise[_0x1c3d('0x2e')](_0x2b51d1);}return _0x39d879[_0x1c3d('0x2f')]();};}function saveUpdates(_0x1b86c8,_0x592575){return function(_0x38d12e){if(_0x38d12e){return _0x38d12e[_0x1c3d('0x30')](_0x1b86c8)[_0x1c3d('0x31')](function(_0x54c4e4){return _0x54c4e4;});}return null;};}function removeEntity(_0x5bae2a,_0x37a052){return function(_0x19a43c){if(_0x19a43c){return _0x19a43c[_0x1c3d('0x32')]()[_0x1c3d('0x31')](function(){_0x5bae2a[_0x1c3d('0x26')](0xcc)[_0x1c3d('0x27')]();});}};}function handleEntityNotFound(_0x11bab9,_0x36780d){return function(_0x5ae96d){if(!_0x5ae96d){_0x11bab9[_0x1c3d('0x33')](0x194);}return _0x5ae96d;};}function handleError(_0x27a369,_0x449b71){_0x449b71=_0x449b71||0x1f4;return function(_0x55069e){logger['error'](_0x55069e[_0x1c3d('0x34')]);if(_0x55069e[_0x1c3d('0x35')]){delete _0x55069e['name'];}_0x27a369['status'](_0x449b71)['send'](_0x55069e);};}exports['index']=function(_0x473117,_0x1d3c71){var _0x2b7de1={},_0x4fc21b={},_0x1fb3bd={'count':0x0,'rows':[]};var _0x3be77c=_['map'](db[_0x1c3d('0x36')][_0x1c3d('0x37')],function(_0x4ac907){return{'name':_0x4ac907[_0x1c3d('0x38')],'type':_0x4ac907['type'][_0x1c3d('0x39')]};});_0x4fc21b['model']=_[_0x1c3d('0x3a')](_0x3be77c,'name');_0x4fc21b[_0x1c3d('0x3b')]=_[_0x1c3d('0x3c')](_0x473117[_0x1c3d('0x3b')]);_0x4fc21b[_0x1c3d('0x3d')]=_['intersection'](_0x4fc21b[_0x1c3d('0x3e')],_0x4fc21b[_0x1c3d('0x3b')]);_0x2b7de1[_0x1c3d('0x3f')]=_[_0x1c3d('0x40')](_0x4fc21b[_0x1c3d('0x3e')],qs[_0x1c3d('0x41')](_0x473117[_0x1c3d('0x3b')][_0x1c3d('0x41')]));_0x2b7de1['attributes']=_0x2b7de1['attributes'][_0x1c3d('0x42')]?_0x2b7de1[_0x1c3d('0x3f')]:_0x4fc21b['model'];if(!_0x473117[_0x1c3d('0x3b')]['hasOwnProperty']('nolimit')){_0x2b7de1[_0x1c3d('0x2b')]=qs[_0x1c3d('0x2b')](_0x473117[_0x1c3d('0x3b')][_0x1c3d('0x2b')]);_0x2b7de1['offset']=qs[_0x1c3d('0x28')](_0x473117['query'][_0x1c3d('0x28')]);}_0x2b7de1[_0x1c3d('0x43')]=qs['sort'](_0x473117[_0x1c3d('0x3b')][_0x1c3d('0x44')]);_0x2b7de1[_0x1c3d('0x45')]=qs[_0x1c3d('0x3d')](_[_0x1c3d('0x46')](_0x473117['query'],_0x4fc21b[_0x1c3d('0x3d')]),_0x3be77c);if(_0x473117[_0x1c3d('0x3b')][_0x1c3d('0x47')]){_0x2b7de1['where']=_[_0x1c3d('0x48')](_0x2b7de1['where'],{'$or':_[_0x1c3d('0x3a')](_0x3be77c,function(_0x14b3f2){if(_0x14b3f2['type']!=='VIRTUAL'){var _0x14b8db={};_0x14b8db[_0x14b3f2['name']]={'$like':'%'+_0x473117['query']['filter']+'%'};return _0x14b8db;}})});}_0x2b7de1=_['merge']({},_0x2b7de1,_0x473117[_0x1c3d('0x49')]);var _0x1d5762={'where':_0x2b7de1['where']};return db['WhatsappMessage']['count'](_0x1d5762)[_0x1c3d('0x31')](function(_0x176363){_0x1fb3bd['count']=_0x176363;if(_0x473117['query'][_0x1c3d('0x4a')]){_0x2b7de1[_0x1c3d('0x4b')]=[{'all':!![]}];}return db[_0x1c3d('0x36')][_0x1c3d('0x4c')](_0x2b7de1);})[_0x1c3d('0x31')](function(_0x1bb53d){_0x1fb3bd[_0x1c3d('0x4d')]=_0x1bb53d;return _0x1fb3bd;})[_0x1c3d('0x31')](respondWithFilteredResult(_0x1d3c71,_0x2b7de1))[_0x1c3d('0x25')](handleError(_0x1d3c71,null));};exports[_0x1c3d('0x4e')]=function(_0xbc050c,_0x32e373){var _0xb83fe4={'raw':!![],'where':{'id':_0xbc050c['params']['id']}},_0x49ca16={};_0x49ca16[_0x1c3d('0x3e')]=_[_0x1c3d('0x3c')](db[_0x1c3d('0x36')][_0x1c3d('0x37')]);_0x49ca16['query']=_['keys'](_0xbc050c[_0x1c3d('0x3b')]);_0x49ca16[_0x1c3d('0x3d')]=_[_0x1c3d('0x40')](_0x49ca16[_0x1c3d('0x3e')],_0x49ca16[_0x1c3d('0x3b')]);_0xb83fe4['attributes']=_[_0x1c3d('0x40')](_0x49ca16[_0x1c3d('0x3e')],qs[_0x1c3d('0x41')](_0xbc050c['query'][_0x1c3d('0x41')]));_0xb83fe4[_0x1c3d('0x3f')]=_0xb83fe4[_0x1c3d('0x3f')][_0x1c3d('0x42')]?_0xb83fe4['attributes']:_0x49ca16[_0x1c3d('0x3e')];if(_0xbc050c[_0x1c3d('0x3b')][_0x1c3d('0x4a')]){_0xb83fe4['include']=[{'all':!![]}];}_0xb83fe4=_[_0x1c3d('0x48')]({},_0xb83fe4,_0xbc050c[_0x1c3d('0x49')]);return db[_0x1c3d('0x36')]['find'](_0xb83fe4)[_0x1c3d('0x31')](handleEntityNotFound(_0x32e373,null))[_0x1c3d('0x31')](respondWithResult(_0x32e373,null))['catch'](handleError(_0x32e373,null));};exports['create']=function(_0x11b25f,_0x553ee8){return db[_0x1c3d('0x36')][_0x1c3d('0x4f')](_0x11b25f['body'],{})[_0x1c3d('0x31')](respondWithResult(_0x553ee8,0xc9))[_0x1c3d('0x25')](handleError(_0x553ee8,null));};exports[_0x1c3d('0x30')]=function(_0x5ce6dd,_0x138e18){if(_0x5ce6dd[_0x1c3d('0x50')]['id']){delete _0x5ce6dd[_0x1c3d('0x50')]['id'];}return db[_0x1c3d('0x36')][_0x1c3d('0x51')]({'where':{'id':_0x5ce6dd['params']['id']}})[_0x1c3d('0x31')](handleEntityNotFound(_0x138e18,null))[_0x1c3d('0x31')](saveUpdates(_0x5ce6dd[_0x1c3d('0x50')],null))['then'](respondWithResult(_0x138e18,null))['catch'](handleError(_0x138e18,null));};exports[_0x1c3d('0x32')]=function(_0x4e919e,_0x38d2b8){return db[_0x1c3d('0x36')][_0x1c3d('0x51')]({'where':{'id':_0x4e919e[_0x1c3d('0x52')]['id']}})[_0x1c3d('0x31')](handleEntityNotFound(_0x38d2b8,null))[_0x1c3d('0x31')](removeEntity(_0x38d2b8,null))[_0x1c3d('0x25')](handleError(_0x38d2b8,null));};exports['describe']=function(_0x372189,_0x2bd9ce){return db[_0x1c3d('0x36')][_0x1c3d('0x53')]()[_0x1c3d('0x31')](respondWithResult(_0x2bd9ce,null))[_0x1c3d('0x25')](handleError(_0x2bd9ce,null));};var interaction_log=require(_0x1c3d('0x12'))('whatsapp-interactions');exports[_0x1c3d('0x54')]=function(_0x59da47,_0x26fbc9,_0x491153){var _0x575f35={'agent':{},'channel':_0x1c3d('0x55')};if(_0x59da47[_0x1c3d('0x50')]['id']){delete _0x59da47['body']['id'];}_0x59da47[_0x1c3d('0x50')]['read']=!![];_0x59da47['body']['readAt']=moment()[_0x1c3d('0x56')](_0x1c3d('0x57'));_0x59da47[_0x1c3d('0x50')][_0x1c3d('0x58')]=_0x59da47[_0x1c3d('0x50')]['UserId']||_0x59da47['user']['id'];_0x575f35[_0x1c3d('0x59')]['id']=_0x59da47[_0x1c3d('0x50')][_0x1c3d('0x58')];return db[_0x1c3d('0x36')]['find']({'where':{'id':_0x59da47[_0x1c3d('0x52')]['id'],'UserId':null}})[_0x1c3d('0x31')](handleEntityNotFound(_0x26fbc9,null))[_0x1c3d('0x31')](saveUpdates(_0x59da47[_0x1c3d('0x50')],null))[_0x1c3d('0x31')](function(_0x5e069e){if(_0x5e069e){_0x575f35[_0x1c3d('0x24')]=_0x5e069e[_0x1c3d('0x5a')]({'plain':!![]});return db[_0x1c3d('0x5b')][_0x1c3d('0x51')]({'where':{'id':_0x5e069e[_0x1c3d('0x5c')]}});}return null;})[_0x1c3d('0x31')](handleEntityNotFound(_0x26fbc9,null))[_0x1c3d('0x31')](function(_0x3ed8e3){if(_0x3ed8e3){return _0x3ed8e3[_0x1c3d('0x30')]({'UserId':_0x59da47['body']['UserId'],'read1stAt':_[_0x1c3d('0x5d')](_0x3ed8e3[_0x1c3d('0x5e')])?moment()[_0x1c3d('0x56')](_0x1c3d('0x57')):undefined});}return null;})[_0x1c3d('0x31')](function(_0x5c7ee3){if(_0x5c7ee3){_0x575f35['interaction']=_0x5c7ee3[_0x1c3d('0x5a')]({'plain':!![]});interaction_log[_0x1c3d('0x5f')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x59da47[_0x1c3d('0x60')]['id'],_0x59da47[_0x1c3d('0x60')]['name'],_0x59da47[_0x1c3d('0x60')]['role'],_0x575f35[_0x1c3d('0x61')]['id'],_0x59da47[_0x1c3d('0x50')]?JSON[_0x1c3d('0x22')](_0x59da47['body']):_0x1c3d('0x62'));return respondWithRpcPromise(_0x1c3d('0x63'),'acceptMessage',_0x575f35);}return null;})[_0x1c3d('0x31')](function(_0x3759c0){var _0x3037ec=_0x1c3d('0x64')+_0x3759c0[_0x1c3d('0x24')][_0x1c3d('0x65')];return db[_0x1c3d('0x66')]['query'](_0x3037ec,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x1c3d('0x31')](function(_0x5216b6){return _0x5216b6;});})['then'](function(_0x54e01f){if(_0x54e01f){_0x575f35['message'][_0x1c3d('0x67')]=_0x54e01f[0x0];if(!_0x59da47[_0x1c3d('0x50')][_0x1c3d('0x58')])return;return db[_0x1c3d('0x68')][_0x1c3d('0x51')]({'where':{'id':_0x59da47[_0x1c3d('0x50')]['UserId'],'role':_0x1c3d('0x59')},'attributes':['id',_0x1c3d('0x35'),_0x1c3d('0x69'),_0x1c3d('0x6a'),'internal'],'raw':!![]});}return null;})[_0x1c3d('0x31')](function(_0x641b3d){if(!_0x641b3d)return null;_0x575f35[_0x1c3d('0x24')]['agent']=_0x641b3d;return _0x575f35;})[_0x1c3d('0x31')](function(_0x29ea85){if(_0x29ea85){if(_0x59da47[_0x1c3d('0x50')][_0x1c3d('0x6b')]){_0x575f35[_0x1c3d('0x24')][_0x1c3d('0x6c')]=util[_0x1c3d('0x56')](_0x1c3d('0x6d'),_0x59da47[_0x1c3d('0x60')][_0x1c3d('0x35')]);_0x575f35[_0x1c3d('0x24')][_0x1c3d('0x6e')]=_0x575f35[_0x1c3d('0x6e')];_0x575f35[_0x1c3d('0x24')][_0x1c3d('0x6f')]=_0x575f35[_0x1c3d('0x6e')];_0x575f35['message'][_0x1c3d('0x70')]=_0x1c3d('0x54');return respondWithRpcPromise(_0x1c3d('0x71'),'EventManager',{'event':'acceptmessage','message':_0x575f35[_0x1c3d('0x24')]},client9002)[_0x1c3d('0x31')](function(){return _0x575f35;});}return _0x575f35;}return null;})[_0x1c3d('0x31')](respondWithResult(_0x26fbc9,null))[_0x1c3d('0x25')](handleError(_0x26fbc9,null));};var interaction_log=require('../../config/logger')(_0x1c3d('0x72'));exports[_0x1c3d('0x2e')]=function(_0x328320,_0xb46805,_0x4df818){var _0x1f9aff={'agent':{},'channel':_0x1c3d('0x55')};if(_0x328320['body']['id']){delete _0x328320[_0x1c3d('0x50')]['id'];}_0x328320[_0x1c3d('0x50')]['UserId']=_0x328320[_0x1c3d('0x50')][_0x1c3d('0x58')]||_0x328320[_0x1c3d('0x60')]['id'];_0x1f9aff[_0x1c3d('0x59')]['id']=_0x328320['body'][_0x1c3d('0x58')];return db[_0x1c3d('0x36')][_0x1c3d('0x51')]({'where':{'id':_0x328320[_0x1c3d('0x52')]['id'],'UserId':null}})[_0x1c3d('0x31')](handleEntityNotFound(_0xb46805,null))[_0x1c3d('0x31')](function(_0x52f34a){if(_0x52f34a){_0x1f9aff[_0x1c3d('0x24')]=_0x52f34a[_0x1c3d('0x5a')]({'plain':!![]});return db[_0x1c3d('0x5b')][_0x1c3d('0x51')]({'where':{'id':_0x52f34a[_0x1c3d('0x5c')]}});}return null;})['then'](handleEntityNotFound(_0xb46805,null))[_0x1c3d('0x31')](function(_0x3ea42a){if(_0x3ea42a){_0x1f9aff[_0x1c3d('0x61')]=_0x3ea42a['get']({'plain':!![]});interaction_log[_0x1c3d('0x5f')](_0x1c3d('0x73'),_0x328320['user']['id'],_0x328320['user'][_0x1c3d('0x35')],_0x328320[_0x1c3d('0x60')]['role'],_0x1f9aff[_0x1c3d('0x61')]['id'],_0x328320[_0x1c3d('0x50')]?JSON[_0x1c3d('0x22')](_0x328320[_0x1c3d('0x50')]):_0x1c3d('0x62'));return respondWithRpcPromise(_0x1c3d('0x74'),_0x1c3d('0x75'),_0x1f9aff);}return null;})['then'](function(_0x264c10){var _0x5de1bc=_0x1c3d('0x64')+_0x264c10[_0x1c3d('0x24')][_0x1c3d('0x65')];return db['sequelize'][_0x1c3d('0x3b')](_0x5de1bc,{'type':db[_0x1c3d('0x76')][_0x1c3d('0x77')][_0x1c3d('0x78')],'raw':!![]})[_0x1c3d('0x31')](function(_0x4f45d5){return _0x4f45d5;});})[_0x1c3d('0x31')](function(_0x48d28c){if(_0x48d28c){_0x1f9aff['message'][_0x1c3d('0x67')]=_0x48d28c[0x0];if(!_0x328320['body'][_0x1c3d('0x58')])return;return db[_0x1c3d('0x68')][_0x1c3d('0x51')]({'where':{'id':_0x328320[_0x1c3d('0x50')][_0x1c3d('0x58')],'role':'agent'},'attributes':['id',_0x1c3d('0x35'),_0x1c3d('0x69'),'email',_0x1c3d('0x79')],'raw':!![]});}return null;})[_0x1c3d('0x31')](function(_0x729924){if(!_0x729924)return null;_0x1f9aff[_0x1c3d('0x24')][_0x1c3d('0x59')]=_0x729924;return _0x1f9aff;})[_0x1c3d('0x31')](function(_0x3542b8){if(_0x3542b8){_0x3542b8[_0x1c3d('0x24')][_0x1c3d('0x6c')]=util[_0x1c3d('0x56')](_0x1c3d('0x6d'),_0x328320[_0x1c3d('0x60')][_0x1c3d('0x35')]);_0x3542b8[_0x1c3d('0x24')][_0x1c3d('0x6e')]=_0x1f9aff[_0x1c3d('0x6e')];_0x3542b8[_0x1c3d('0x24')][_0x1c3d('0x6f')]=_0x1f9aff[_0x1c3d('0x6e')];_0x3542b8[_0x1c3d('0x24')][_0x1c3d('0x70')]='reject';respondWithRpcPromise(_0x1c3d('0x71'),_0x1c3d('0x71'),{'event':'rejectmessage','message':_0x3542b8[_0x1c3d('0x24')]},client9002);return _0x1f9aff;}return null;})[_0x1c3d('0x31')](respondWithResult(_0xb46805,null))[_0x1c3d('0x25')](handleError(_0xb46805,null));};exports[_0x1c3d('0x26')]=function(_0x3f04de,_0x47656b,_0x565a02){if(_0x3f04de['body']['id']){delete _0x3f04de['body']['id'];}var _0xe08752;return db[_0x1c3d('0x36')]['find']({'where':{'id':_0x3f04de[_0x1c3d('0x52')]['id']}})[_0x1c3d('0x31')](handleEntityNotFound(_0x47656b,null))[_0x1c3d('0x31')](function(_0x3bfcf2){if(_0x3bfcf2){_0xe08752=_0x3bfcf2;return db[_0x1c3d('0x7a')]['find']({'where':{'id':_0x3bfcf2[_0x1c3d('0x7b')]}});}})[_0x1c3d('0x31')](handleEntityNotFound(_0x47656b,null))[_0x1c3d('0x31')](function(_0xe49436){if(_0xe49436){logger[_0x1c3d('0x20')](_0x1c3d('0x7c'),'status',_0x1c3d('0x7d'),_0xe49436['type'],util[_0x1c3d('0x7e')](_0x3f04de[_0x1c3d('0x50')],{'showHidden':![],'depth':null}));switch(_0xe49436[_0x1c3d('0x7f')]){case'twilio':if(_0x3f04de[_0x1c3d('0x50')][_0x1c3d('0x80')]&&_0x3f04de['body'][_0x1c3d('0x80')]===_0xe08752[_0x1c3d('0x81')]&&_0x3f04de['body'][_0x1c3d('0x82')]&&_0x3f04de[_0x1c3d('0x50')][_0x1c3d('0x82')]===_0x1c3d('0x83')){return _0xe08752[_0x1c3d('0x30')]({'read':!![]});}else{logger[_0x1c3d('0x23')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x1c3d('0x26'),_0x1c3d('0x84'),util[_0x1c3d('0x7e')](_0x3f04de[_0x1c3d('0x50')],{'showHidden':![],'depth':null}));}break;}return _0xe08752;}})[_0x1c3d('0x31')](respondWithResult(_0x47656b,null))[_0x1c3d('0x25')](handleError(_0x47656b,null));}; \ No newline at end of file +var _0x25bf=['reject','RejectMessage','SELECT','interface','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','MessageStatus','read','WhatsappAccount,\x20%s,\x20%s,\x20%s','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','to-csv','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappMessage.socket','jayson/promise','http','client','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','save','update','destroy','stack','map','WhatsappMessage','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','attributes','length','nolimit','order','sort','filters','pick','filter','merge','where','options','includeAll','include','findAll','rows','show','params','fields','find','body','describe','../../config/logger','accept','whatsapp','readAt','format','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','whatsapp-interactions'];(function(_0x3817a9,_0x29e215){var _0x443f30=function(_0x13940b){while(--_0x13940b){_0x3817a9['push'](_0x3817a9['shift']());}};_0x443f30(++_0x29e215);}(_0x25bf,0x91));var _0xf25b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x25bf[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf25b('0x0'));var zipdir=require(_0xf25b('0x1'));var jsonpatch=require(_0xf25b('0x2'));var rp=require('request-promise');var moment=require(_0xf25b('0x3'));var BPromise=require(_0xf25b('0x4'));var Mustache=require('mustache');var util=require(_0xf25b('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xf25b('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf25b('0x7'));var squel=require('squel');var crypto=require(_0xf25b('0x8'));var jsforce=require(_0xf25b('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xf25b('0x6'));var querystring=require(_0xf25b('0xa'));var Papa=require(_0xf25b('0xb'));var Redis=require(_0xf25b('0xc'));var authService=require(_0xf25b('0xd'));var qs=require(_0xf25b('0xe'));var as=require(_0xf25b('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf25b('0x10'))['db'];config[_0xf25b('0x11')]=_['defaults'](config[_0xf25b('0x11')],{'host':_0xf25b('0x12'),'port':0x18eb});var socket=require(_0xf25b('0x13'))(new Redis(config[_0xf25b('0x11')]));require(_0xf25b('0x14'))['register'](socket);var jayson=require(_0xf25b('0x15'));var client=jayson['client'][_0xf25b('0x16')]({'port':0x232c});var client9002=jayson[_0xf25b('0x17')][_0xf25b('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x3b5ff1,_0x3b6e19,_0x4f5f50,_0x339465){return new BPromise(function(_0x2385ea,_0x3cae0a){var _0x276889=_0x339465||client;return _0x276889['request'](_0x3b5ff1,_0x4f5f50)[_0xf25b('0x18')](function(_0x5cc2ba){logger[_0xf25b('0x19')](_0xf25b('0x1a'),_0x3b6e19,_0xf25b('0x1b'));logger[_0xf25b('0x1c')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x3b6e19,_0xf25b('0x1b'),JSON[_0xf25b('0x1d')](_0x5cc2ba));if(_0x5cc2ba[_0xf25b('0x1e')]){if(_0x5cc2ba['error'][_0xf25b('0x1f')]===0x1f4){logger[_0xf25b('0x1e')](_0xf25b('0x1a'),_0x3b6e19,_0x5cc2ba[_0xf25b('0x1e')][_0xf25b('0x20')]);return _0x3cae0a(_0x5cc2ba[_0xf25b('0x1e')][_0xf25b('0x20')]);}logger[_0xf25b('0x1e')]('WhatsappMessage,\x20%s,\x20%s',_0x3b6e19,_0x5cc2ba[_0xf25b('0x1e')]['message']);return _0x2385ea(_0x5cc2ba[_0xf25b('0x1e')][_0xf25b('0x20')]);}else{logger['info'](_0xf25b('0x1a'),_0x3b6e19,_0xf25b('0x1b'));_0x2385ea(_0x5cc2ba[_0xf25b('0x21')][_0xf25b('0x20')]);}})[_0xf25b('0x22')](function(_0x2d73b6){logger[_0xf25b('0x1e')](_0xf25b('0x1a'),_0x3b6e19,_0x2d73b6);_0x3cae0a(_0x2d73b6);});});}function respondWithStatusCode(_0x1a6f46,_0xd4a55a){_0xd4a55a=_0xd4a55a||0xcc;return function(_0x45cc2a){if(_0x45cc2a){return _0x1a6f46[_0xf25b('0x23')](_0xd4a55a);}return _0x1a6f46[_0xf25b('0x24')](_0xd4a55a)[_0xf25b('0x25')]();};}function respondWithResult(_0x545231,_0x2d4d0c){_0x2d4d0c=_0x2d4d0c||0xc8;return function(_0x3f780d){if(_0x3f780d){return _0x545231[_0xf25b('0x24')](_0x2d4d0c)[_0xf25b('0x26')](_0x3f780d);}};}function respondWithFilteredResult(_0x5d1155,_0x5633e6){return function(_0x4236d4){if(_0x4236d4){var _0x33d2a6=typeof _0x5633e6[_0xf25b('0x27')]===_0xf25b('0x28')&&typeof _0x5633e6[_0xf25b('0x29')]===_0xf25b('0x28');var _0x108246=_0x4236d4[_0xf25b('0x2a')];var _0x25bbb5=_0x33d2a6?0x0:_0x5633e6[_0xf25b('0x27')];var _0x181f62=_0x33d2a6?_0x4236d4[_0xf25b('0x2a')]:_0x5633e6['offset']+_0x5633e6[_0xf25b('0x29')];var _0x9519cc;if(_0x181f62>=_0x108246){_0x181f62=_0x108246;_0x9519cc=0xc8;}else{_0x9519cc=0xce;}_0x5d1155[_0xf25b('0x24')](_0x9519cc);return _0x5d1155['set'](_0xf25b('0x2b'),_0x25bbb5+'-'+_0x181f62+'/'+_0x108246)[_0xf25b('0x26')](_0x4236d4);}return null;};}function patchUpdates(_0x18a003){return function(_0x5299fc){try{jsonpatch['apply'](_0x5299fc,_0x18a003,!![]);}catch(_0x3f7e19){return BPromise['reject'](_0x3f7e19);}return _0x5299fc[_0xf25b('0x2c')]();};}function saveUpdates(_0x198cdd,_0x5dfc4e){return function(_0x36c031){if(_0x36c031){return _0x36c031[_0xf25b('0x2d')](_0x198cdd)[_0xf25b('0x18')](function(_0x55b056){return _0x55b056;});}return null;};}function removeEntity(_0x5537da,_0x1ad584){return function(_0x5401d0){if(_0x5401d0){return _0x5401d0[_0xf25b('0x2e')]()[_0xf25b('0x18')](function(){_0x5537da['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cbe97,_0x3a7497){return function(_0xde6e9b){if(!_0xde6e9b){_0x5cbe97['sendStatus'](0x194);}return _0xde6e9b;};}function handleError(_0x529fc4,_0x2d1149){_0x2d1149=_0x2d1149||0x1f4;return function(_0xb1e6ce){logger[_0xf25b('0x1e')](_0xb1e6ce[_0xf25b('0x2f')]);if(_0xb1e6ce['name']){delete _0xb1e6ce['name'];}_0x529fc4['status'](_0x2d1149)['send'](_0xb1e6ce);};}exports['index']=function(_0x3d1852,_0x284917){var _0x10befa={},_0x13fffc={},_0x1282a6={'count':0x0,'rows':[]};var _0x2da9c9=_[_0xf25b('0x30')](db[_0xf25b('0x31')][_0xf25b('0x32')],function(_0x5b2847){return{'name':_0x5b2847[_0xf25b('0x33')],'type':_0x5b2847[_0xf25b('0x34')][_0xf25b('0x35')]};});_0x13fffc[_0xf25b('0x36')]=_[_0xf25b('0x30')](_0x2da9c9,_0xf25b('0x37'));_0x13fffc[_0xf25b('0x38')]=_[_0xf25b('0x39')](_0x3d1852['query']);_0x13fffc['filters']=_[_0xf25b('0x3a')](_0x13fffc[_0xf25b('0x36')],_0x13fffc[_0xf25b('0x38')]);_0x10befa[_0xf25b('0x3b')]=_[_0xf25b('0x3a')](_0x13fffc[_0xf25b('0x36')],qs['fields'](_0x3d1852[_0xf25b('0x38')]['fields']));_0x10befa[_0xf25b('0x3b')]=_0x10befa[_0xf25b('0x3b')][_0xf25b('0x3c')]?_0x10befa[_0xf25b('0x3b')]:_0x13fffc[_0xf25b('0x36')];if(!_0x3d1852['query']['hasOwnProperty'](_0xf25b('0x3d'))){_0x10befa[_0xf25b('0x29')]=qs[_0xf25b('0x29')](_0x3d1852['query']['limit']);_0x10befa['offset']=qs['offset'](_0x3d1852[_0xf25b('0x38')][_0xf25b('0x27')]);}_0x10befa[_0xf25b('0x3e')]=qs[_0xf25b('0x3f')](_0x3d1852[_0xf25b('0x38')][_0xf25b('0x3f')]);_0x10befa['where']=qs[_0xf25b('0x40')](_[_0xf25b('0x41')](_0x3d1852['query'],_0x13fffc[_0xf25b('0x40')]),_0x2da9c9);if(_0x3d1852[_0xf25b('0x38')][_0xf25b('0x42')]){_0x10befa['where']=_[_0xf25b('0x43')](_0x10befa[_0xf25b('0x44')],{'$or':_['map'](_0x2da9c9,function(_0x119f4c){if(_0x119f4c[_0xf25b('0x34')]!=='VIRTUAL'){var _0x286990={};_0x286990[_0x119f4c[_0xf25b('0x37')]]={'$like':'%'+_0x3d1852['query'][_0xf25b('0x42')]+'%'};return _0x286990;}})});}_0x10befa=_[_0xf25b('0x43')]({},_0x10befa,_0x3d1852[_0xf25b('0x45')]);var _0x1c25cf={'where':_0x10befa[_0xf25b('0x44')]};return db[_0xf25b('0x31')][_0xf25b('0x2a')](_0x1c25cf)['then'](function(_0x4d8887){_0x1282a6['count']=_0x4d8887;if(_0x3d1852[_0xf25b('0x38')][_0xf25b('0x46')]){_0x10befa[_0xf25b('0x47')]=[{'all':!![]}];}return db[_0xf25b('0x31')][_0xf25b('0x48')](_0x10befa);})[_0xf25b('0x18')](function(_0x25a584){_0x1282a6[_0xf25b('0x49')]=_0x25a584;return _0x1282a6;})['then'](respondWithFilteredResult(_0x284917,_0x10befa))[_0xf25b('0x22')](handleError(_0x284917,null));};exports[_0xf25b('0x4a')]=function(_0x3a9d0c,_0x31aa5a){var _0x305bfe={'raw':!![],'where':{'id':_0x3a9d0c[_0xf25b('0x4b')]['id']}},_0x208c94={};_0x208c94[_0xf25b('0x36')]=_[_0xf25b('0x39')](db[_0xf25b('0x31')]['rawAttributes']);_0x208c94['query']=_[_0xf25b('0x39')](_0x3a9d0c[_0xf25b('0x38')]);_0x208c94[_0xf25b('0x40')]=_[_0xf25b('0x3a')](_0x208c94['model'],_0x208c94[_0xf25b('0x38')]);_0x305bfe[_0xf25b('0x3b')]=_[_0xf25b('0x3a')](_0x208c94[_0xf25b('0x36')],qs[_0xf25b('0x4c')](_0x3a9d0c[_0xf25b('0x38')][_0xf25b('0x4c')]));_0x305bfe[_0xf25b('0x3b')]=_0x305bfe[_0xf25b('0x3b')]['length']?_0x305bfe['attributes']:_0x208c94[_0xf25b('0x36')];if(_0x3a9d0c[_0xf25b('0x38')]['includeAll']){_0x305bfe['include']=[{'all':!![]}];}_0x305bfe=_[_0xf25b('0x43')]({},_0x305bfe,_0x3a9d0c[_0xf25b('0x45')]);return db[_0xf25b('0x31')][_0xf25b('0x4d')](_0x305bfe)[_0xf25b('0x18')](handleEntityNotFound(_0x31aa5a,null))['then'](respondWithResult(_0x31aa5a,null))[_0xf25b('0x22')](handleError(_0x31aa5a,null));};exports['create']=function(_0x4a1833,_0x18e5ce){return db[_0xf25b('0x31')]['create'](_0x4a1833[_0xf25b('0x4e')],{})[_0xf25b('0x18')](respondWithResult(_0x18e5ce,0xc9))['catch'](handleError(_0x18e5ce,null));};exports['update']=function(_0x5d8355,_0x31f5ad){if(_0x5d8355['body']['id']){delete _0x5d8355[_0xf25b('0x4e')]['id'];}return db[_0xf25b('0x31')][_0xf25b('0x4d')]({'where':{'id':_0x5d8355['params']['id']}})[_0xf25b('0x18')](handleEntityNotFound(_0x31f5ad,null))['then'](saveUpdates(_0x5d8355[_0xf25b('0x4e')],null))[_0xf25b('0x18')](respondWithResult(_0x31f5ad,null))[_0xf25b('0x22')](handleError(_0x31f5ad,null));};exports['destroy']=function(_0x40332a,_0x40d829){return db[_0xf25b('0x31')][_0xf25b('0x4d')]({'where':{'id':_0x40332a[_0xf25b('0x4b')]['id']}})[_0xf25b('0x18')](handleEntityNotFound(_0x40d829,null))['then'](removeEntity(_0x40d829,null))[_0xf25b('0x22')](handleError(_0x40d829,null));};exports[_0xf25b('0x4f')]=function(_0x5db884,_0x59e22e){return db[_0xf25b('0x31')][_0xf25b('0x4f')]()[_0xf25b('0x18')](respondWithResult(_0x59e22e,null))[_0xf25b('0x22')](handleError(_0x59e22e,null));};var interaction_log=require(_0xf25b('0x50'))('whatsapp-interactions');exports[_0xf25b('0x51')]=function(_0x38e085,_0x2df5dd,_0x1c7ce6){var _0x4da744={'agent':{},'channel':_0xf25b('0x52')};if(_0x38e085[_0xf25b('0x4e')]['id']){delete _0x38e085[_0xf25b('0x4e')]['id'];}_0x38e085[_0xf25b('0x4e')]['read']=!![];_0x38e085[_0xf25b('0x4e')][_0xf25b('0x53')]=moment()[_0xf25b('0x54')]('YYYY-MM-DD\x20HH:mm:ss');_0x38e085[_0xf25b('0x4e')][_0xf25b('0x55')]=_0x38e085['body'][_0xf25b('0x55')]||_0x38e085[_0xf25b('0x56')]['id'];_0x4da744[_0xf25b('0x57')]['id']=_0x38e085[_0xf25b('0x4e')][_0xf25b('0x55')];return db[_0xf25b('0x31')][_0xf25b('0x4d')]({'where':{'id':_0x38e085['params']['id'],'UserId':null}})[_0xf25b('0x18')](handleEntityNotFound(_0x2df5dd,null))[_0xf25b('0x18')](saveUpdates(_0x38e085[_0xf25b('0x4e')],null))[_0xf25b('0x18')](function(_0x9d47cc){if(_0x9d47cc){_0x4da744[_0xf25b('0x20')]=_0x9d47cc[_0xf25b('0x58')]({'plain':!![]});return db[_0xf25b('0x59')][_0xf25b('0x4d')]({'where':{'id':_0x9d47cc[_0xf25b('0x5a')]}});}return null;})[_0xf25b('0x18')](handleEntityNotFound(_0x2df5dd,null))[_0xf25b('0x18')](function(_0x4660f7){if(_0x4660f7){return _0x4660f7['update']({'UserId':_0x38e085[_0xf25b('0x4e')][_0xf25b('0x55')],'read1stAt':_['isNil'](_0x4660f7[_0xf25b('0x5b')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xf25b('0x18')](function(_0x1b5745){if(_0x1b5745){_0x4da744[_0xf25b('0x5c')]=_0x1b5745[_0xf25b('0x58')]({'plain':!![]});interaction_log['info'](_0xf25b('0x5d'),_0x38e085[_0xf25b('0x56')]['id'],_0x38e085['user'][_0xf25b('0x37')],_0x38e085[_0xf25b('0x56')][_0xf25b('0x5e')],_0x4da744[_0xf25b('0x5c')]['id'],_0x38e085[_0xf25b('0x4e')]?JSON[_0xf25b('0x1d')](_0x38e085[_0xf25b('0x4e')]):_0xf25b('0x5f'));return respondWithRpcPromise(_0xf25b('0x60'),_0xf25b('0x61'),_0x4da744);}return null;})[_0xf25b('0x18')](function(_0x29c011){var _0xa2c69a=_0xf25b('0x62')+_0x29c011['message'][_0xf25b('0x63')];return db[_0xf25b('0x64')][_0xf25b('0x38')](_0xa2c69a,{'type':db[_0xf25b('0x65')][_0xf25b('0x66')]['SELECT'],'raw':!![]})['then'](function(_0x53ee18){return _0x53ee18;});})['then'](function(_0x32a011){if(_0x32a011){_0x4da744[_0xf25b('0x20')][_0xf25b('0x67')]=_0x32a011[0x0];if(!_0x38e085['body'][_0xf25b('0x55')])return;return db[_0xf25b('0x68')][_0xf25b('0x4d')]({'where':{'id':_0x38e085[_0xf25b('0x4e')][_0xf25b('0x55')],'role':'agent'},'attributes':['id',_0xf25b('0x37'),'fullname',_0xf25b('0x69'),_0xf25b('0x6a')],'raw':!![]});}return null;})[_0xf25b('0x18')](function(_0x53c9af){if(!_0x53c9af)return null;_0x4da744[_0xf25b('0x20')][_0xf25b('0x57')]=_0x53c9af;return _0x4da744;})[_0xf25b('0x18')](function(_0x438865){if(_0x438865){if(_0x38e085[_0xf25b('0x4e')][_0xf25b('0x6b')]){_0x4da744[_0xf25b('0x20')]['interface']=util[_0xf25b('0x54')](_0xf25b('0x6c'),_0x38e085[_0xf25b('0x56')][_0xf25b('0x37')]);_0x4da744[_0xf25b('0x20')][_0xf25b('0x6d')]=_0x4da744[_0xf25b('0x6d')];_0x4da744['message'][_0xf25b('0x6e')]=_0x4da744[_0xf25b('0x6d')];_0x4da744[_0xf25b('0x20')][_0xf25b('0x6f')]=_0xf25b('0x51');return respondWithRpcPromise('EventManager',_0xf25b('0x70'),{'event':_0xf25b('0x71'),'message':_0x4da744['message']},client9002)['then'](function(){return _0x4da744;});}return _0x4da744;}return null;})[_0xf25b('0x18')](respondWithResult(_0x2df5dd,null))[_0xf25b('0x22')](handleError(_0x2df5dd,null));};var interaction_log=require(_0xf25b('0x50'))(_0xf25b('0x72'));exports[_0xf25b('0x73')]=function(_0x139325,_0x2bfee9,_0x30a529){var _0x16bde2={'agent':{},'channel':_0xf25b('0x52')};if(_0x139325[_0xf25b('0x4e')]['id']){delete _0x139325[_0xf25b('0x4e')]['id'];}_0x139325['body'][_0xf25b('0x55')]=_0x139325[_0xf25b('0x4e')]['UserId']||_0x139325[_0xf25b('0x56')]['id'];_0x16bde2['agent']['id']=_0x139325[_0xf25b('0x4e')]['UserId'];return db[_0xf25b('0x31')]['find']({'where':{'id':_0x139325[_0xf25b('0x4b')]['id'],'UserId':null}})[_0xf25b('0x18')](handleEntityNotFound(_0x2bfee9,null))['then'](function(_0x2d6329){if(_0x2d6329){_0x16bde2[_0xf25b('0x20')]=_0x2d6329[_0xf25b('0x58')]({'plain':!![]});return db[_0xf25b('0x59')]['find']({'where':{'id':_0x2d6329[_0xf25b('0x5a')]}});}return null;})['then'](handleEntityNotFound(_0x2bfee9,null))['then'](function(_0xeb5b35){if(_0xeb5b35){_0x16bde2[_0xf25b('0x5c')]=_0xeb5b35[_0xf25b('0x58')]({'plain':!![]});interaction_log[_0xf25b('0x19')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x139325[_0xf25b('0x56')]['id'],_0x139325['user'][_0xf25b('0x37')],_0x139325[_0xf25b('0x56')]['role'],_0x16bde2[_0xf25b('0x5c')]['id'],_0x139325[_0xf25b('0x4e')]?JSON['stringify'](_0x139325[_0xf25b('0x4e')]):'null');return respondWithRpcPromise(_0xf25b('0x74'),'rejectMessage',_0x16bde2);}return null;})[_0xf25b('0x18')](function(_0x1495f7){var _0x5b37c9=_0xf25b('0x62')+_0x1495f7[_0xf25b('0x20')][_0xf25b('0x63')];return db[_0xf25b('0x64')][_0xf25b('0x38')](_0x5b37c9,{'type':db['Sequelize'][_0xf25b('0x66')][_0xf25b('0x75')],'raw':!![]})[_0xf25b('0x18')](function(_0x26714f){return _0x26714f;});})[_0xf25b('0x18')](function(_0x286d9b){if(_0x286d9b){_0x16bde2[_0xf25b('0x20')][_0xf25b('0x67')]=_0x286d9b[0x0];if(!_0x139325[_0xf25b('0x4e')]['UserId'])return;return db[_0xf25b('0x68')][_0xf25b('0x4d')]({'where':{'id':_0x139325['body']['UserId'],'role':_0xf25b('0x57')},'attributes':['id',_0xf25b('0x37'),'fullname','email',_0xf25b('0x6a')],'raw':!![]});}return null;})[_0xf25b('0x18')](function(_0x1350fa){if(!_0x1350fa)return null;_0x16bde2[_0xf25b('0x20')][_0xf25b('0x57')]=_0x1350fa;return _0x16bde2;})['then'](function(_0x2d09bb){if(_0x2d09bb){_0x2d09bb[_0xf25b('0x20')][_0xf25b('0x76')]=util[_0xf25b('0x54')](_0xf25b('0x6c'),_0x139325['user'][_0xf25b('0x37')]);_0x2d09bb['message'][_0xf25b('0x6d')]=_0x16bde2[_0xf25b('0x6d')];_0x2d09bb[_0xf25b('0x20')][_0xf25b('0x6e')]=_0x16bde2[_0xf25b('0x6d')];_0x2d09bb[_0xf25b('0x20')][_0xf25b('0x6f')]='reject';respondWithRpcPromise(_0xf25b('0x70'),'EventManager',{'event':_0xf25b('0x77'),'message':_0x2d09bb['message']},client9002);return _0x16bde2;}return null;})[_0xf25b('0x18')](respondWithResult(_0x2bfee9,null))['catch'](handleError(_0x2bfee9,null));};exports[_0xf25b('0x24')]=function(_0x2e44dc,_0x4c86f2,_0x3e0344){if(_0x2e44dc[_0xf25b('0x4e')]['id']){delete _0x2e44dc[_0xf25b('0x4e')]['id'];}var _0x5731b6;return db[_0xf25b('0x31')][_0xf25b('0x4d')]({'where':{'id':_0x2e44dc['params']['id']}})[_0xf25b('0x18')](handleEntityNotFound(_0x4c86f2,null))[_0xf25b('0x18')](function(_0x50fd5f){if(_0x50fd5f){_0x5731b6=_0x50fd5f;return db[_0xf25b('0x78')][_0xf25b('0x4d')]({'where':{'id':_0x50fd5f[_0xf25b('0x79')]}});}})[_0xf25b('0x18')](handleEntityNotFound(_0x4c86f2,null))['then'](function(_0x1c58e6){if(_0x1c58e6){logger[_0xf25b('0x1c')](_0xf25b('0x7a'),'status',_0xf25b('0x7b'),_0x1c58e6[_0xf25b('0x34')],util[_0xf25b('0x7c')](_0x2e44dc[_0xf25b('0x4e')],{'showHidden':![],'depth':null}));switch(_0x1c58e6[_0xf25b('0x34')]){case _0xf25b('0x7d'):if(_0x2e44dc[_0xf25b('0x4e')][_0xf25b('0x7e')]&&_0x2e44dc[_0xf25b('0x4e')][_0xf25b('0x7e')]===_0x5731b6['messageId']&&_0x2e44dc[_0xf25b('0x4e')]['MessageStatus']&&_0x2e44dc[_0xf25b('0x4e')][_0xf25b('0x7f')]===_0xf25b('0x80')){return _0x5731b6[_0xf25b('0x2d')]({'read':!![]});}else{logger[_0xf25b('0x1e')](_0xf25b('0x81'),'status',_0xf25b('0x7d'),util[_0xf25b('0x7c')](_0x2e44dc['body'],{'showHidden':![],'depth':null}));}break;}return _0x5731b6;}})[_0xf25b('0x18')](respondWithResult(_0x4c86f2,null))[_0xf25b('0x22')](handleError(_0x4c86f2,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 5984906..8010713 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 _0x8b29=['setMaxListeners','remove','emit','hasOwnProperty','hook','exports','events','WhatsappMessage'];(function(_0x5adf61,_0x39b37d){var _0x49b867=function(_0x2970e1){while(--_0x2970e1){_0x5adf61['push'](_0x5adf61['shift']());}};_0x49b867(++_0x39b37d);}(_0x8b29,0xbe));var _0x98b2=function(_0x474a96,_0x5c9ac3){_0x474a96=_0x474a96-0x0;var _0x56e3b5=_0x8b29[_0x474a96];return _0x56e3b5;};'use strict';var EventEmitter=require(_0x98b2('0x0'));var WhatsappMessage=require('../../mysqldb')['db'][_0x98b2('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x98b2('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x98b2('0x3')};function emitEvent(_0x20afa9){return function(_0x5bf7df,_0x209616,_0x5da9ce){WhatsappMessageEvents[_0x98b2('0x4')](_0x20afa9+':'+_0x5bf7df['id'],_0x5bf7df);WhatsappMessageEvents[_0x98b2('0x4')](_0x20afa9,_0x5bf7df);_0x5da9ce(null);};}for(var e in events){if(events[_0x98b2('0x5')](e)){var event=events[e];WhatsappMessage[_0x98b2('0x6')](e,emitEvent(event));}}module[_0x98b2('0x7')]=WhatsappMessageEvents; \ No newline at end of file +var _0x9c00=['emit','hook','exports','events','../../mysqldb','save','update'];(function(_0x470366,_0x51f083){var _0x4987dd=function(_0x4ec213){while(--_0x4ec213){_0x470366['push'](_0x470366['shift']());}};_0x4987dd(++_0x51f083);}(_0x9c00,0x1a0));var _0x09c0=function(_0x5c956b,_0xa87d11){_0x5c956b=_0x5c956b-0x0;var _0xaff46a=_0x9c00[_0x5c956b];return _0xaff46a;};'use strict';var EventEmitter=require(_0x09c0('0x0'));var WhatsappMessage=require(_0x09c0('0x1'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x09c0('0x2'),'afterUpdate':_0x09c0('0x3'),'afterDestroy':'remove'};function emitEvent(_0x220c0c){return function(_0x2c702c,_0x2ed715,_0x2fd03e){WhatsappMessageEvents[_0x09c0('0x4')](_0x220c0c+':'+_0x2c702c['id'],_0x2c702c);WhatsappMessageEvents['emit'](_0x220c0c,_0x2c702c);_0x2fd03e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage[_0x09c0('0x5')](e,emitEvent(event));}}module[_0x09c0('0x6')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 28a845c..e58af6e 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 _0xc6ab=['direction','out','WhatsappInteraction','findOne','then','update','catch','error','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','phone','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','POST','Bearer\x20','statuses','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','define','WhatsappMessage','whatsapp_messages','fti_whatsapp_messages','body','models','get','toLowerCase'];(function(_0x332290,_0x2498e7){var _0x299612=function(_0x106e53){while(--_0x106e53){_0x332290['push'](_0x332290['shift']());}};_0x299612(++_0x2498e7);}(_0xc6ab,0x96));var _0xbc6a=function(_0x44e05b,_0xa2f66d){_0x44e05b=_0x44e05b-0x0;var _0x51a62a=_0xc6ab[_0x44e05b];return _0x51a62a;};'use strict';var _=require(_0xbc6a('0x0'));var util=require(_0xbc6a('0x1'));var logger=require(_0xbc6a('0x2'))(_0xbc6a('0x3'));var moment=require(_0xbc6a('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fetch=require(_0xbc6a('0x5'));var fs=require('fs');var path=require(_0xbc6a('0x6'));var rimraf=require(_0xbc6a('0x7'));var config=require(_0xbc6a('0x8'));var attributes=require(_0xbc6a('0x9'));module['exports']=function(_0x45ed96,_0x263f4b){return _0x45ed96[_0xbc6a('0xa')](_0xbc6a('0xb'),attributes,{'tableName':_0xbc6a('0xc'),'paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0xbc6a('0xd'),'fields':[_0xbc6a('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4d22b2,_0x446338,_0x18b608){var _0x5407ec=_0x45ed96[_0xbc6a('0xf')];var _0xe1c7bd=_0x4d22b2[_0xbc6a('0x10')]({'plain':!![]});if(_0xe1c7bd['direction'][_0xbc6a('0x11')]()==='in'||_0xe1c7bd[_0xbc6a('0x12')][_0xbc6a('0x11')]()===_0xbc6a('0x13')&&!_0xe1c7bd['secret']&&!_['isNil'](_0xe1c7bd['UserId'])){_0x5407ec[_0xbc6a('0x14')][_0xbc6a('0x15')]({'where':{'id':_0xe1c7bd['WhatsappInteractionId']}})[_0xbc6a('0x16')](function(_0x517377){if(_0x517377){_0x517377[_0xbc6a('0x17')]({'lastMsgAt':_0xe1c7bd['createdAt'],'lastMsgDirection':_0xe1c7bd[_0xbc6a('0x12')][_0xbc6a('0x11')]()});}})[_0xbc6a('0x18')](function(_0x3de8f5){console[_0xbc6a('0x19')](_0x3de8f5);});}if(_0xe1c7bd[_0xbc6a('0x12')]===_0xbc6a('0x13')&&!_0xe1c7bd['secret']){var _0x5df571;_0x5407ec[_0xbc6a('0x1a')][_0xbc6a('0x1b')]({'where':{'id':_0xe1c7bd[_0xbc6a('0x1c')]},'raw':!![]})[_0xbc6a('0x16')](function(_0x2d22cf){_0x5df571=_0x2d22cf;if(_0x5df571&&_0x5df571[_0xbc6a('0x1d')]){switch(_0x5df571[_0xbc6a('0x1d')]){case _0xbc6a('0x1e'):var _0x4c23e7=require(_0xbc6a('0x1e'));if(_0x5df571[_0xbc6a('0x1f')]&&_0x5df571[_0xbc6a('0x20')]&&_0x5df571[_0xbc6a('0x21')]){var _0x5c8ff2=new _0x4c23e7(_0x5df571[_0xbc6a('0x1f')],_0x5df571['authToken']);_0x5c8ff2['messages'][_0xbc6a('0x22')]({'body':_0xe1c7bd['body'],'to':_0xbc6a('0x23')+_0xe1c7bd['phone'],'from':_0xbc6a('0x23')+_0x5df571['phone'],'statusCallback':_0x5df571[_0xbc6a('0x24')]+_0xbc6a('0x25')+_0xe1c7bd['id']+_0xbc6a('0x26')+_0x5df571[_0xbc6a('0x27')]})[_0xbc6a('0x16')](function(_0x19efd0){if(_0x19efd0[_0xbc6a('0x28')]){return _0x4d22b2[_0xbc6a('0x17')]({'messageId':_0x19efd0[_0xbc6a('0x28')]});}})[_0xbc6a('0x18')](function(_0x4c7722){logger[_0xbc6a('0x19')](_0xbc6a('0x29'),_0xbc6a('0x2a'),_0xbc6a('0x1e'),util[_0xbc6a('0x2b')](_0x4c7722,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xbc6a('0x29'),_0xbc6a('0x2a'),_0xbc6a('0x1e'),_0xbc6a('0x2c'));}break;case _0xbc6a('0x2d'):var _0x431117=_0x5df571[_0xbc6a('0x1f')];var _0x17e452=_0x5df571[_0xbc6a('0x20')];var _0x5745cd=_0x5df571[_0xbc6a('0x2e')]+'/whatsapp/v1/'+_0x431117+'/messages/';var _0x5701a8={'to':[_0xe1c7bd['phone']],'message':{'type':'text','text':_0xe1c7bd['body']}};var _0x4b230a={'method':_0xbc6a('0x2f'),'uri':_0x5745cd,'headers':{'Authorization':_0xbc6a('0x30')+_0x17e452,'Content-Type':'application/json'},'body':_0x5701a8,'json':!![]};rp(_0x4b230a)[_0xbc6a('0x16')](function(_0x2e8a55){if(_0x2e8a55[_0xbc6a('0x31')][0x0][_0xbc6a('0x32')]){return _0x4d22b2[_0xbc6a('0x17')]({'messageId':_0x2e8a55[_0xbc6a('0x31')][0x0][_0xbc6a('0x32')]});}})[_0xbc6a('0x18')](function(_0xe6accf){logger[_0xbc6a('0x33')](_0xbc6a('0x34'),_0xe6accf);});break;}}})[_0xbc6a('0x35')](function(){_0x18b608();});}else{_0x18b608();}}},'charset':_0xbc6a('0x36'),'collate':_0xbc6a('0x37')});}; \ No newline at end of file +var _0xa404=['/messages/','text','Bearer\x20','application/json','statuses','message_id','WhatsappMessage,\x20%s','finally','utf8mb4','lodash','util','../../config/logger','moment','node-fetch','path','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','fti_whatsapp_messages','body','FULLTEXT','get','direction','toLowerCase','secret','UserId','WhatsappInteraction','WhatsappInteractionId','update','catch','out','WhatsappAccountId','type','twilio','accountSid','phone','authToken','messages','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','then','sid','error','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','sinch','baseUrl','/whatsapp/v1/'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa404,0x159));var _0x4a40=function(_0x4e0e24,_0x5bddc3){_0x4e0e24=_0x4e0e24-0x0;var _0x4847a4=_0xa404[_0x4e0e24];return _0x4847a4;};'use strict';var _=require(_0x4a40('0x0'));var util=require(_0x4a40('0x1'));var logger=require(_0x4a40('0x2'))('api');var moment=require(_0x4a40('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fetch=require(_0x4a40('0x4'));var fs=require('fs');var path=require(_0x4a40('0x5'));var rimraf=require('rimraf');var config=require(_0x4a40('0x6'));var attributes=require(_0x4a40('0x7'));module[_0x4a40('0x8')]=function(_0x44fcae,_0x1be9d0){return _0x44fcae[_0x4a40('0x9')](_0x4a40('0xa'),attributes,{'tableName':_0x4a40('0xb'),'paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0x4a40('0xc'),'fields':[_0x4a40('0xd')],'type':_0x4a40('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xe0d330,_0x499080,_0x1a61bc){var _0x32181b=_0x44fcae['models'];var _0x29f2d9=_0xe0d330[_0x4a40('0xf')]({'plain':!![]});if(_0x29f2d9[_0x4a40('0x10')][_0x4a40('0x11')]()==='in'||_0x29f2d9[_0x4a40('0x10')][_0x4a40('0x11')]()==='out'&&!_0x29f2d9[_0x4a40('0x12')]&&!_['isNil'](_0x29f2d9[_0x4a40('0x13')])){_0x32181b[_0x4a40('0x14')]['findOne']({'where':{'id':_0x29f2d9[_0x4a40('0x15')]}})['then'](function(_0x11ffec){if(_0x11ffec){_0x11ffec[_0x4a40('0x16')]({'lastMsgAt':_0x29f2d9['createdAt'],'lastMsgDirection':_0x29f2d9['direction'][_0x4a40('0x11')]()});}})[_0x4a40('0x17')](function(_0x1cd9ce){console['error'](_0x1cd9ce);});}if(_0x29f2d9[_0x4a40('0x10')]===_0x4a40('0x18')&&!_0x29f2d9[_0x4a40('0x12')]){var _0x2c20a5;_0x32181b['WhatsappAccount']['find']({'where':{'id':_0x29f2d9[_0x4a40('0x19')]},'raw':!![]})['then'](function(_0x257f77){_0x2c20a5=_0x257f77;if(_0x2c20a5&&_0x2c20a5['type']){switch(_0x2c20a5[_0x4a40('0x1a')]){case _0x4a40('0x1b'):var _0x8e811c=require(_0x4a40('0x1b'));if(_0x2c20a5[_0x4a40('0x1c')]&&_0x2c20a5['authToken']&&_0x2c20a5[_0x4a40('0x1d')]){var _0x49866c=new _0x8e811c(_0x2c20a5[_0x4a40('0x1c')],_0x2c20a5[_0x4a40('0x1e')]);_0x49866c[_0x4a40('0x1f')][_0x4a40('0x20')]({'body':_0x29f2d9[_0x4a40('0xd')],'to':_0x4a40('0x21')+_0x29f2d9[_0x4a40('0x1d')],'from':'whatsapp:'+_0x2c20a5[_0x4a40('0x1d')],'statusCallback':_0x2c20a5[_0x4a40('0x22')]+_0x4a40('0x23')+_0x29f2d9['id']+_0x4a40('0x24')+_0x2c20a5[_0x4a40('0x25')]})[_0x4a40('0x26')](function(_0x3edcf7){if(_0x3edcf7[_0x4a40('0x27')]){return _0xe0d330[_0x4a40('0x16')]({'messageId':_0x3edcf7[_0x4a40('0x27')]});}})[_0x4a40('0x17')](function(_0x2fe056){logger[_0x4a40('0x28')](_0x4a40('0x29'),_0x4a40('0x2a'),_0x4a40('0x1b'),util[_0x4a40('0x2b')](_0x2fe056,{'showHidden':![],'depth':null}));});}else{logger[_0x4a40('0x28')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x4a40('0x2a'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x4a40('0x2c'):var _0x31fbe7=_0x2c20a5[_0x4a40('0x1c')];var _0x24de73=_0x2c20a5[_0x4a40('0x1e')];var _0x5d9005=_0x2c20a5[_0x4a40('0x2d')]+_0x4a40('0x2e')+_0x31fbe7+_0x4a40('0x2f');var _0x1fef7e={'to':[_0x29f2d9[_0x4a40('0x1d')]],'message':{'type':_0x4a40('0x30'),'text':_0x29f2d9[_0x4a40('0xd')]}};var _0x33896c={'method':'POST','uri':_0x5d9005,'headers':{'Authorization':_0x4a40('0x31')+_0x24de73,'Content-Type':_0x4a40('0x32')},'body':_0x1fef7e,'json':!![]};rp(_0x33896c)['then'](function(_0x17cef3){if(_0x17cef3[_0x4a40('0x33')][0x0][_0x4a40('0x34')]){return _0xe0d330[_0x4a40('0x16')]({'messageId':_0x17cef3[_0x4a40('0x33')][0x0][_0x4a40('0x34')]});}})[_0x4a40('0x17')](function(_0x5ee268){logger['err'](_0x4a40('0x35'),_0x5ee268);});break;}}})[_0x4a40('0x36')](function(){_0x1a61bc();});}else{_0x1a61bc();}}},'charset':_0x4a40('0x37'),'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 4cb0424..8a33fd0 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 _0x8874=['rpc','jayson/promise','client','http','redis','defaults','./whatsappMessage.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','message','WhatsappMessage,\x20%s,\x20%s','result','catch','CreateWhatsappMessage','WhatsappMessage','body','options','raw','lodash','moment','randomstring','../../mysqldb','../../config/logger'];(function(_0x369d1d,_0x3bc0a2){var _0xbbd32c=function(_0x1e67c6){while(--_0x1e67c6){_0x369d1d['push'](_0x369d1d['shift']());}};_0xbbd32c(++_0x3bc0a2);}(_0x8874,0xcd));var _0x4887=function(_0x49334e,_0xe80fd9){_0x49334e=_0x49334e-0x0;var _0x2abec0=_0x8874[_0x49334e];return _0x2abec0;};'use strict';var _=require(_0x4887('0x0'));var util=require('util');var moment=require(_0x4887('0x1'));var BPromise=require('bluebird');var rs=require(_0x4887('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4887('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x4887('0x4'))(_0x4887('0x5'));var config=require('../../config/environment');var jayson=require(_0x4887('0x6'));var client=jayson[_0x4887('0x7')][_0x4887('0x8')]({'port':0x232a});config[_0x4887('0x9')]=_[_0x4887('0xa')](config[_0x4887('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4887('0xb'))[_0x4887('0xc')](socket);function respondWithRpcPromise(_0x41c34b,_0x1055e3,_0x20a106){return new BPromise(function(_0x9c9781,_0x4bdc4b){return client[_0x4887('0xd')](_0x41c34b,_0x20a106)[_0x4887('0xe')](function(_0xd4c6dd){logger[_0x4887('0xf')]('WhatsappMessage,\x20%s,\x20%s',_0x1055e3,_0x4887('0x10'));logger[_0x4887('0x11')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x1055e3,_0x4887('0x10'),JSON[_0x4887('0x12')](_0xd4c6dd));if(_0xd4c6dd[_0x4887('0x13')]){if(_0xd4c6dd[_0x4887('0x13')][_0x4887('0x14')]===0x1f4){logger[_0x4887('0x13')]('WhatsappMessage,\x20%s,\x20%s',_0x1055e3,_0xd4c6dd[_0x4887('0x13')]['message']);return _0x4bdc4b(_0xd4c6dd[_0x4887('0x13')][_0x4887('0x15')]);}logger[_0x4887('0x13')](_0x4887('0x16'),_0x1055e3,_0xd4c6dd['error']['message']);return _0x9c9781(_0xd4c6dd[_0x4887('0x13')][_0x4887('0x15')]);}else{logger[_0x4887('0xf')](_0x4887('0x16'),_0x1055e3,_0x4887('0x10'));_0x9c9781(_0xd4c6dd[_0x4887('0x17')][_0x4887('0x15')]);}})[_0x4887('0x18')](function(_0x3db5cc){logger[_0x4887('0x13')](_0x4887('0x16'),_0x1055e3,_0x3db5cc);_0x4bdc4b(_0x3db5cc);});});}exports[_0x4887('0x19')]=function(_0x5b0814){var _0x33b78d=this;return new Promise(function(_0x143b99,_0x241be){return db[_0x4887('0x1a')]['create'](_0x5b0814[_0x4887('0x1b')],{'raw':_0x5b0814[_0x4887('0x1c')]?_0x5b0814[_0x4887('0x1c')][_0x4887('0x1d')]===undefined?!![]:![]:!![]})[_0x4887('0xe')](function(_0x5c1bda){logger[_0x4887('0xf')](_0x4887('0x19'),_0x5b0814);logger['debug'](_0x4887('0x19'),_0x5b0814,JSON[_0x4887('0x12')](_0x5c1bda));_0x143b99(_0x5c1bda);})[_0x4887('0x18')](function(_0x1a4cd3){logger['error'](_0x4887('0x19'),_0x1a4cd3['message'],_0x5b0814);_0x241be(_0x33b78d[_0x4887('0x13')](0x1f4,_0x1a4cd3[_0x4887('0x15')]));});});}; \ No newline at end of file +var _0xa9bc=['../../config/environment','jayson/promise','client','http','redis','defaults','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','code','error','message','catch','WhatsappMessage','create','body','raw','CreateWhatsappMessage','debug','stringify','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x444e1f,_0x48bb7d){var _0x2de7c9=function(_0x463e7e){while(--_0x463e7e){_0x444e1f['push'](_0x444e1f['shift']());}};_0x2de7c9(++_0x48bb7d);}(_0xa9bc,0xcb));var _0xca9b=function(_0x42e0f3,_0x1bbc1a){_0x42e0f3=_0x42e0f3-0x0;var _0x4e2aa4=_0xa9bc[_0x42e0f3];return _0x4e2aa4;};'use strict';var _=require('lodash');var util=require(_0xca9b('0x0'));var moment=require(_0xca9b('0x1'));var BPromise=require('bluebird');var rs=require(_0xca9b('0x2'));var fs=require('fs');var Redis=require(_0xca9b('0x3'));var db=require(_0xca9b('0x4'))['db'];var utils=require(_0xca9b('0x5'));var logger=require('../../config/logger')(_0xca9b('0x6'));var config=require(_0xca9b('0x7'));var jayson=require(_0xca9b('0x8'));var client=jayson[_0xca9b('0x9')][_0xca9b('0xa')]({'port':0x232a});config[_0xca9b('0xb')]=_[_0xca9b('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappMessage.socket')['register'](socket);function respondWithRpcPromise(_0x1052f5,_0x2117a8,_0x490939){return new BPromise(function(_0x4da9d2,_0x36f453){return client[_0xca9b('0xd')](_0x1052f5,_0x490939)[_0xca9b('0xe')](function(_0xafd779){logger[_0xca9b('0xf')](_0xca9b('0x10'),_0x2117a8,_0xca9b('0x11'));logger['debug'](_0xca9b('0x12'),_0x2117a8,_0xca9b('0x11'),JSON['stringify'](_0xafd779));if(_0xafd779['error']){if(_0xafd779['error'][_0xca9b('0x13')]===0x1f4){logger[_0xca9b('0x14')]('WhatsappMessage,\x20%s,\x20%s',_0x2117a8,_0xafd779['error'][_0xca9b('0x15')]);return _0x36f453(_0xafd779[_0xca9b('0x14')]['message']);}logger[_0xca9b('0x14')](_0xca9b('0x10'),_0x2117a8,_0xafd779[_0xca9b('0x14')][_0xca9b('0x15')]);return _0x4da9d2(_0xafd779['error'][_0xca9b('0x15')]);}else{logger[_0xca9b('0xf')](_0xca9b('0x10'),_0x2117a8,'request\x20sent');_0x4da9d2(_0xafd779['result'][_0xca9b('0x15')]);}})[_0xca9b('0x16')](function(_0x3c90e3){logger[_0xca9b('0x14')](_0xca9b('0x10'),_0x2117a8,_0x3c90e3);_0x36f453(_0x3c90e3);});});}exports['CreateWhatsappMessage']=function(_0x112081){var _0x39ba44=this;return new Promise(function(_0x542fa6,_0x30598b){return db[_0xca9b('0x17')][_0xca9b('0x18')](_0x112081[_0xca9b('0x19')],{'raw':_0x112081['options']?_0x112081['options'][_0xca9b('0x1a')]===undefined?!![]:![]:!![]})[_0xca9b('0xe')](function(_0x427277){logger[_0xca9b('0xf')](_0xca9b('0x1b'),_0x112081);logger[_0xca9b('0x1c')](_0xca9b('0x1b'),_0x112081,JSON[_0xca9b('0x1d')](_0x427277));_0x542fa6(_0x427277);})[_0xca9b('0x16')](function(_0x56c2eb){logger['error']('CreateWhatsappMessage',_0x56c2eb['message'],_0x112081);_0x30598b(_0x39ba44['error'](0x1f4,_0x56c2eb[_0xca9b('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index fe918f7..8ad6490 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 _0xd88a=['remove','update','emit','register','length','./whatsappMessage.events','save'];(function(_0x1161d5,_0x1364ec){var _0x5885ac=function(_0x5e2df0){while(--_0x5e2df0){_0x1161d5['push'](_0x1161d5['shift']());}};_0x5885ac(++_0x1364ec);}(_0xd88a,0x6e));var _0xad88=function(_0x260073,_0xbe6af9){_0x260073=_0x260073-0x0;var _0x4ff033=_0xd88a[_0x260073];return _0x4ff033;};'use strict';var WhatsappMessageEvents=require(_0xad88('0x0'));var events=[_0xad88('0x1'),_0xad88('0x2'),_0xad88('0x3')];function createListener(_0x347e53,_0x49f02b){return function(_0x40cea4){_0x49f02b[_0xad88('0x4')](_0x347e53,_0x40cea4);};}function removeListener(_0x5fe266,_0x2bee71){return function(){WhatsappMessageEvents['removeListener'](_0x5fe266,_0x2bee71);};}exports[_0xad88('0x5')]=function(_0x3e5b66){for(var _0x11922d=0x0,_0x307391=events[_0xad88('0x6')];_0x11922d<_0x307391;_0x11922d++){var _0x49beb5=events[_0x11922d];var _0x53b20d=createListener('whatsappMessage:'+_0x49beb5,_0x3e5b66);WhatsappMessageEvents['on'](_0x49beb5,_0x53b20d);}}; \ No newline at end of file +var _0x7210=['removeListener','register','length','whatsappMessage:','./whatsappMessage.events','save','remove','update','emit'];(function(_0x136816,_0x47d424){var _0x3c6038=function(_0x182b9a){while(--_0x182b9a){_0x136816['push'](_0x136816['shift']());}};_0x3c6038(++_0x47d424);}(_0x7210,0x11b));var _0x0721=function(_0x5277df,_0x4f836e){_0x5277df=_0x5277df-0x0;var _0x34249e=_0x7210[_0x5277df];return _0x34249e;};'use strict';var WhatsappMessageEvents=require(_0x0721('0x0'));var events=[_0x0721('0x1'),_0x0721('0x2'),_0x0721('0x3')];function createListener(_0xbf1307,_0x49bab2){return function(_0x220ebf){_0x49bab2[_0x0721('0x4')](_0xbf1307,_0x220ebf);};}function removeListener(_0x3153b4,_0x1aadf2){return function(){WhatsappMessageEvents[_0x0721('0x5')](_0x3153b4,_0x1aadf2);};}exports[_0x0721('0x6')]=function(_0x107828){for(var _0xad5504=0x0,_0x244741=events[_0x0721('0x7')];_0xad5504<_0x244741;_0xad5504++){var _0x381d1a=events[_0xad5504];var _0x1c0503=createListener(_0x0721('0x8')+_0x381d1a,_0x107828);WhatsappMessageEvents['on'](_0x381d1a,_0x1c0503);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 684d47b..976a712 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 _0x592f=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getTeams','/:id/users','getAgents','post','/:id/teams','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','util','path','connect-timeout'];(function(_0x3a49db,_0x5bd00c){var _0xc2bc7c=function(_0x350e45){while(--_0x350e45){_0x3a49db['push'](_0x3a49db['shift']());}};_0xc2bc7c(++_0x5bd00c);}(_0x592f,0x71));var _0xf592=function(_0x8e5d51,_0xf4bd47){_0x8e5d51=_0x8e5d51-0x0;var _0x552df4=_0x592f[_0x8e5d51];return _0x552df4;};'use strict';var multer=require('multer');var util=require(_0xf592('0x0'));var path=require(_0xf592('0x1'));var timeout=require(_0xf592('0x2'));var express=require(_0xf592('0x3'));var router=express[_0xf592('0x4')]();var fs_extra=require(_0xf592('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf592('0x6'));var config=require(_0xf592('0x7'));var controller=require(_0xf592('0x8'));router[_0xf592('0x9')]('/',auth[_0xf592('0xa')](),controller[_0xf592('0xb')]);router[_0xf592('0x9')](_0xf592('0xc'),auth['isAuthenticated'](),controller[_0xf592('0xd')]);router['get'](_0xf592('0xe'),auth[_0xf592('0xa')](),controller[_0xf592('0xf')]);router[_0xf592('0x9')](_0xf592('0x10'),auth['isAuthenticated'](),controller['getMembers']);router[_0xf592('0x9')]('/:id/teams',auth[_0xf592('0xa')](),controller[_0xf592('0x11')]);router[_0xf592('0x9')](_0xf592('0x12'),auth[_0xf592('0xa')](),controller[_0xf592('0x13')]);router['post']('/',auth[_0xf592('0xa')](),controller['create']);router[_0xf592('0x14')](_0xf592('0x15'),auth[_0xf592('0xa')](),controller[_0xf592('0x16')]);router[_0xf592('0x14')](_0xf592('0x12'),auth[_0xf592('0xa')](),controller['addAgents']);router['put']('/:id',auth[_0xf592('0xa')](),controller[_0xf592('0x17')]);router[_0xf592('0x18')](_0xf592('0xe'),auth[_0xf592('0xa')](),controller[_0xf592('0x19')]);router[_0xf592('0x18')](_0xf592('0x15'),auth[_0xf592('0xa')](),controller[_0xf592('0x1a')]);router[_0xf592('0x18')]('/:id/users',auth['isAuthenticated'](),controller[_0xf592('0x1b')]);module[_0xf592('0x1c')]=router; \ No newline at end of file +var _0xd12d=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./whatsappQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','/:id/users','post','addTeams','delete','destroy','/:id/teams','removeAgents','multer','util','path'];(function(_0x487095,_0x1b9abd){var _0x1add4b=function(_0x37d822){while(--_0x37d822){_0x487095['push'](_0x487095['shift']());}};_0x1add4b(++_0x1b9abd);}(_0xd12d,0xa5));var _0xdd12=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xd12d[_0x209941];return _0x1e8729;};'use strict';var multer=require(_0xdd12('0x0'));var util=require(_0xdd12('0x1'));var path=require(_0xdd12('0x2'));var timeout=require(_0xdd12('0x3'));var express=require(_0xdd12('0x4'));var router=express[_0xdd12('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xdd12('0x6'));var interaction=require(_0xdd12('0x7'));var config=require('../../config/environment');var controller=require(_0xdd12('0x8'));router[_0xdd12('0x9')]('/',auth['isAuthenticated'](),controller[_0xdd12('0xa')]);router[_0xdd12('0x9')](_0xdd12('0xb'),auth[_0xdd12('0xc')](),controller[_0xdd12('0xd')]);router[_0xdd12('0x9')](_0xdd12('0xe'),auth[_0xdd12('0xc')](),controller[_0xdd12('0xf')]);router[_0xdd12('0x9')](_0xdd12('0x10'),auth[_0xdd12('0xc')](),controller['getMembers']);router[_0xdd12('0x9')]('/:id/teams',auth[_0xdd12('0xc')](),controller['getTeams']);router[_0xdd12('0x9')](_0xdd12('0x11'),auth[_0xdd12('0xc')](),controller['getAgents']);router[_0xdd12('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0xdd12('0x12')]('/:id/teams',auth[_0xdd12('0xc')](),controller[_0xdd12('0x13')]);router[_0xdd12('0x12')](_0xdd12('0x11'),auth[_0xdd12('0xc')](),controller['addAgents']);router['put'](_0xdd12('0xe'),auth[_0xdd12('0xc')](),controller['update']);router[_0xdd12('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xdd12('0x15')]);router[_0xdd12('0x14')](_0xdd12('0x16'),auth[_0xdd12('0xc')](),controller['removeTeams']);router['delete']('/:id/users',auth[_0xdd12('0xc')](),controller[_0xdd12('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index dd29959..d20e1b1 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 _0x98b8=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x389511,_0x3d74a2){var _0x35b58f=function(_0x1ce58f){while(--_0x1ce58f){_0x389511['push'](_0x389511['shift']());}};_0x35b58f(++_0x3d74a2);}(_0x98b8,0x93));var _0x898b=function(_0x2583a0,_0x4989c6){_0x2583a0=_0x2583a0-0x0;var _0x2932bf=_0x98b8[_0x2583a0];return _0x2932bf;};'use strict';var Sequelize=require(_0x898b('0x0'));module[_0x898b('0x1')]={'name':{'type':Sequelize[_0x898b('0x2')],'unique':_0x898b('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x898b('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x898b('0x5')](_0x898b('0x6'),_0x898b('0x7'),_0x898b('0x8'))},'description':{'type':Sequelize[_0x898b('0x2')]}}; \ No newline at end of file +var _0xc68d=['exports','STRING','ENUM','rrmemory','beepall','roundrobin'];(function(_0x2b0236,_0x3df5c5){var _0x253418=function(_0x276405){while(--_0x276405){_0x2b0236['push'](_0x2b0236['shift']());}};_0x253418(++_0x3df5c5);}(_0xc68d,0x17a));var _0xdc68=function(_0x53990b,_0x369927){_0x53990b=_0x53990b-0x0;var _0x5196cf=_0xc68d[_0x53990b];return _0x5196cf;};'use strict';var Sequelize=require('sequelize');module[_0xdc68('0x0')]={'name':{'type':Sequelize[_0xdc68('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xdc68('0x2')](_0xdc68('0x3'),_0xdc68('0x4'),_0xdc68('0x5'))},'description':{'type':Sequelize[_0xdc68('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 94d7f59..d0e0cb7 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 _0x2c73=['map','rawAttributes','fieldName','type','key','getOptions','WhatsappQueue','include','query','findAll','rows','catch','show','params','model','keys','attributes','fields','length','includeAll','merge','options','create','body','user','get','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserWhatsappQueue','filters','intersection','hasOwnProperty','nolimit','order','sort','pick','where','WhatsappQueueId','filter','agent','updatedAt','createdAt','format','%s/%s','SIP','Team','getTeams','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','transaction','each','forEach','userWhatsappQueue:save','removeTeams','select','tq.TeamId','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','emit','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','bluebird','lodash','squel','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','register','sendStatus','end','json','limit','count','offset','status','set','Content-Range','destroy','then','WhatsappQueues','UserProfileResource','error','name','send','index'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0x2c73,0x14e));var _0x32c7=function(_0x39834d,_0x4fa4c8){_0x39834d=_0x39834d-0x0;var _0x336d1c=_0x2c73[_0x39834d];return _0x336d1c;};'use strict';var BPromise=require(_0x32c7('0x0'));var util=require('util');var _=require(_0x32c7('0x1'));var squel=require(_0x32c7('0x2'));var Redis=require('ioredis');var qs=require(_0x32c7('0x3'));var logger=require(_0x32c7('0x4'))(_0x32c7('0x5'));var config=require(_0x32c7('0x6'));var db=require(_0x32c7('0x7'))['db'];config[_0x32c7('0x8')]=_[_0x32c7('0x9')](config[_0x32c7('0x8')],{'host':_0x32c7('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x32c7('0x8')]));require('./whatsappQueue.socket')[_0x32c7('0xb')](socket);function respondWithStatusCode(_0x526c87,_0x53a2ad){_0x53a2ad=_0x53a2ad||0xcc;return function(_0x4f347e){if(_0x4f347e){return _0x526c87[_0x32c7('0xc')](_0x53a2ad);}return _0x526c87['status'](_0x53a2ad)[_0x32c7('0xd')]();};}function respondWithResult(_0x29c67e,_0x59ae21){_0x59ae21=_0x59ae21||0xc8;return function(_0x5ad829){if(_0x5ad829){return _0x29c67e['status'](_0x59ae21)[_0x32c7('0xe')](_0x5ad829);}};}function respondWithFilteredResult(_0x126474,_0x161283){return function(_0x402b0a){if(_0x402b0a){var _0x19eb87=typeof _0x161283['offset']==='undefined'&&typeof _0x161283[_0x32c7('0xf')]==='undefined';var _0x2579d1=_0x402b0a[_0x32c7('0x10')];var _0x4e328e=_0x19eb87?0x0:_0x161283[_0x32c7('0x11')];var _0x29c5ef=_0x19eb87?_0x402b0a[_0x32c7('0x10')]:_0x161283[_0x32c7('0x11')]+_0x161283[_0x32c7('0xf')];var _0x11a245;if(_0x29c5ef>=_0x2579d1){_0x29c5ef=_0x2579d1;_0x11a245=0xc8;}else{_0x11a245=0xce;}_0x126474[_0x32c7('0x12')](_0x11a245);return _0x126474[_0x32c7('0x13')](_0x32c7('0x14'),_0x4e328e+'-'+_0x29c5ef+'/'+_0x2579d1)[_0x32c7('0xe')](_0x402b0a);}return null;};}function saveUpdates(_0x35e029){return function(_0x58a2a5){if(_0x58a2a5){return _0x58a2a5['update'](_0x35e029)['then'](function(_0x10b5cd){return _0x10b5cd;});}return null;};}function removeEntity(_0x551901){return function(_0x3d17be){if(_0x3d17be){return _0x3d17be[_0x32c7('0x15')]()[_0x32c7('0x16')](function(){var _0x244766=_0x3d17be['get']({'plain':!![]});var _0x563ba2=_0x32c7('0x17');return db[_0x32c7('0x18')]['destroy']({'where':{'type':_0x563ba2,'resourceId':_0x244766['id']}})[_0x32c7('0x16')](function(){return _0x3d17be;});})[_0x32c7('0x16')](function(){_0x551901[_0x32c7('0x12')](0xcc)[_0x32c7('0xd')]();});}};}function handleEntityNotFound(_0x2c3af0){return function(_0x4f7b47){if(!_0x4f7b47){_0x2c3af0['sendStatus'](0x194);}return _0x4f7b47;};}function handleError(_0x130ace,_0x51b782){_0x51b782=_0x51b782||0x1f4;return function(_0x5a21c3){logger[_0x32c7('0x19')](_0x5a21c3['stack']);if(_0x5a21c3[_0x32c7('0x1a')]){delete _0x5a21c3['name'];}_0x130ace[_0x32c7('0x12')](_0x51b782)[_0x32c7('0x1b')](_0x5a21c3);};}exports[_0x32c7('0x1c')]=function(_0x50e86d,_0x3a5dc0){var _0x40b64d={};var _0xd3233d={'count':0x0,'rows':[]};var _0x400f91=_[_0x32c7('0x1d')](db['WhatsappQueue'][_0x32c7('0x1e')],function(_0x2f2779){return{'name':_0x2f2779[_0x32c7('0x1f')],'type':_0x2f2779[_0x32c7('0x20')][_0x32c7('0x21')]};});_0x40b64d=qs[_0x32c7('0x22')](_0x400f91,_0x50e86d);var _0x287973={'where':_0x40b64d['where']};return db[_0x32c7('0x23')]['count'](_0x287973)[_0x32c7('0x16')](function(_0xcd5321){_0xd3233d['count']=_0xcd5321;_0x40b64d['include']=qs[_0x32c7('0x24')](_0x50e86d[_0x32c7('0x25')]);return db[_0x32c7('0x23')][_0x32c7('0x26')](_0x40b64d);})['then'](function(_0x5db20f){_0xd3233d[_0x32c7('0x27')]=_0x5db20f;return _0xd3233d;})[_0x32c7('0x16')](respondWithFilteredResult(_0x3a5dc0,_0x40b64d))[_0x32c7('0x28')](handleError(_0x3a5dc0,null));};exports[_0x32c7('0x29')]=function(_0x2bfa1e,_0x21258d){var _0x146705={'raw':!![],'where':{'id':_0x2bfa1e[_0x32c7('0x2a')]['id']}},_0x34b214={};_0x34b214[_0x32c7('0x2b')]=_['keys'](db['WhatsappQueue']['rawAttributes']);_0x34b214[_0x32c7('0x25')]=_[_0x32c7('0x2c')](_0x2bfa1e[_0x32c7('0x25')]);_0x34b214['filters']=_['intersection'](_0x34b214[_0x32c7('0x2b')],_0x34b214[_0x32c7('0x25')]);_0x146705[_0x32c7('0x2d')]=_['intersection'](_0x34b214[_0x32c7('0x2b')],qs[_0x32c7('0x2e')](_0x2bfa1e['query']['fields']));_0x146705[_0x32c7('0x2d')]=_0x146705[_0x32c7('0x2d')][_0x32c7('0x2f')]?_0x146705[_0x32c7('0x2d')]:_0x34b214['model'];if(_0x2bfa1e[_0x32c7('0x25')][_0x32c7('0x30')]){_0x146705[_0x32c7('0x24')]=[{'all':!![]}];}_0x146705=_[_0x32c7('0x31')]({},_0x146705,_0x2bfa1e[_0x32c7('0x32')]);return db[_0x32c7('0x23')]['find'](_0x146705)['then'](handleEntityNotFound(_0x21258d,null))[_0x32c7('0x16')](respondWithResult(_0x21258d,null))[_0x32c7('0x28')](handleError(_0x21258d,null));};exports['create']=function(_0x1de15a,_0x3c44c9){return db[_0x32c7('0x23')][_0x32c7('0x33')](_0x1de15a[_0x32c7('0x34')],{})['then'](function(_0x538e5c){var _0xee3c97=_0x1de15a[_0x32c7('0x35')][_0x32c7('0x36')]({'plain':!![]});if(!_0xee3c97)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xee3c97['role']===_0x32c7('0x35')){var _0x5ac331=_0x538e5c[_0x32c7('0x36')]({'plain':!![]});var _0x950773='WhatsappQueues';return db[_0x32c7('0x37')][_0x32c7('0x38')]({'where':{'name':_0x950773,'userProfileId':_0xee3c97[_0x32c7('0x39')]},'raw':!![]})[_0x32c7('0x16')](function(_0x291b65){if(_0x291b65&&_0x291b65[_0x32c7('0x3a')]===0x0){return db[_0x32c7('0x18')][_0x32c7('0x33')]({'name':_0x5ac331[_0x32c7('0x1a')],'resourceId':_0x5ac331['id'],'type':_0x291b65[_0x32c7('0x1a')],'sectionId':_0x291b65['id']},{})['then'](function(){return _0x538e5c;});}else{return _0x538e5c;}})['catch'](function(_0x141f50){logger[_0x32c7('0x19')](_0x32c7('0x3b'),_0x141f50);throw _0x141f50;});}return _0x538e5c;})['then'](respondWithResult(_0x3c44c9,0xc9))[_0x32c7('0x28')](handleError(_0x3c44c9,null));};exports['update']=function(_0xe075f7,_0x64b919){if(_0xe075f7[_0x32c7('0x34')]['id']){delete _0xe075f7['body']['id'];}return db[_0x32c7('0x23')][_0x32c7('0x38')]({'where':{'id':_0xe075f7['params']['id']}})[_0x32c7('0x16')](handleEntityNotFound(_0x64b919,null))[_0x32c7('0x16')](saveUpdates(_0xe075f7[_0x32c7('0x34')],null))[_0x32c7('0x16')](respondWithResult(_0x64b919,null))[_0x32c7('0x28')](handleError(_0x64b919,null));};exports[_0x32c7('0x15')]=function(_0x39b392,_0x26210a){return db['WhatsappQueue'][_0x32c7('0x38')]({'where':{'id':_0x39b392[_0x32c7('0x2a')]['id']}})['then'](handleEntityNotFound(_0x26210a,null))[_0x32c7('0x16')](removeEntity(_0x26210a,null))[_0x32c7('0x28')](handleError(_0x26210a,null));};exports[_0x32c7('0x3c')]=function(_0x1c111f,_0x1976cc){return db['WhatsappQueue'][_0x32c7('0x3c')]()[_0x32c7('0x16')](respondWithResult(_0x1976cc,null))[_0x32c7('0x28')](handleError(_0x1976cc,null));};exports[_0x32c7('0x3d')]=function(_0x25c3fe,_0xc48d2e){var _0x5c6eed={'raw':!![],'where':{}},_0x684768={},_0x4c1502;return db[_0x32c7('0x23')][_0x32c7('0x3e')]({'where':{'id':_0x25c3fe[_0x32c7('0x2a')]['id']}})[_0x32c7('0x16')](handleEntityNotFound(_0xc48d2e,null))[_0x32c7('0x16')](function(_0x4917c0){if(_0x4917c0){_0x4c1502=_0x4917c0[_0x32c7('0x36')]({'plain':!![]});_0x684768['model']=_[_0x32c7('0x2c')](db[_0x32c7('0x3f')][_0x32c7('0x1e')]);_0x684768[_0x32c7('0x25')]=_[_0x32c7('0x2c')](_0x25c3fe[_0x32c7('0x25')]);_0x684768[_0x32c7('0x40')]=_[_0x32c7('0x41')](_0x684768[_0x32c7('0x2b')],_0x684768[_0x32c7('0x25')]);_0x5c6eed[_0x32c7('0x2d')]=_[_0x32c7('0x41')](_0x684768[_0x32c7('0x2b')],qs[_0x32c7('0x2e')](_0x25c3fe[_0x32c7('0x25')][_0x32c7('0x2e')]));_0x5c6eed['attributes']=_0x5c6eed[_0x32c7('0x2d')]['length']?_0x5c6eed['attributes']:_0x684768['model'];if(!_0x25c3fe[_0x32c7('0x25')][_0x32c7('0x42')](_0x32c7('0x43'))){_0x5c6eed[_0x32c7('0xf')]=qs[_0x32c7('0xf')](_0x25c3fe['query']['limit']);_0x5c6eed[_0x32c7('0x11')]=qs['offset'](_0x25c3fe['query'][_0x32c7('0x11')]);}_0x5c6eed[_0x32c7('0x44')]=qs[_0x32c7('0x45')](_0x25c3fe[_0x32c7('0x25')][_0x32c7('0x45')]);_0x5c6eed['where']=qs[_0x32c7('0x40')](_[_0x32c7('0x46')](_0x25c3fe['query'],_0x684768[_0x32c7('0x40')]));_0x5c6eed[_0x32c7('0x47')][_0x32c7('0x48')]=_0x4917c0['id'];if(_0x25c3fe[_0x32c7('0x25')][_0x32c7('0x49')]){_0x5c6eed[_0x32c7('0x47')]=_[_0x32c7('0x31')](_0x5c6eed['where'],{'$or':_['map'](_0x5c6eed[_0x32c7('0x2d')],function(_0x3c8aae){var _0x19c618={};_0x19c618[_0x3c8aae]={'$like':'%'+_0x25c3fe[_0x32c7('0x25')][_0x32c7('0x49')]+'%'};return _0x19c618;})});}_0x5c6eed=_[_0x32c7('0x31')]({},_0x5c6eed,_0x25c3fe['options']);return db[_0x32c7('0x3f')][_0x32c7('0x26')](_0x5c6eed);}})[_0x32c7('0x16')](function(_0x27140a){if(_0x27140a){return db['User']['findAndCountAll']({'where':{'id':_[_0x32c7('0x1d')](_0x27140a,'UserId'),'role':_0x32c7('0x4a')},'attributes':['id','name','whatsappPause',_0x32c7('0x4b'),_0x32c7('0x4c')]});}})['then'](function(_0x1d34ee){if(_0x1d34ee){return{'count':_0x1d34ee[_0x32c7('0x10')],'rows':_[_0x32c7('0x1d')](_0x1d34ee[_0x32c7('0x27')],function(_0xead796){return{'membername':_0xead796['name'],'UserId':_0xead796['id'],'queue_name':_0x4c1502[_0x32c7('0x1a')],'WhatsappQueueId':_0x4c1502['id'],'interface':util[_0x32c7('0x4d')](_0x32c7('0x4e'),_0x32c7('0x4f'),_0xead796[_0x32c7('0x1a')]),'penalty':0x0,'paused':_0xead796['whatsappPause'],'createdAt':_0xead796[_0x32c7('0x4c')],'updatedAt':_0xead796[_0x32c7('0x4b')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0xc48d2e,_0x5c6eed))[_0x32c7('0x28')](handleError(_0xc48d2e,null));};exports['getTeams']=function(_0x47de9e,_0x1c0065){var _0x5a21ba={};var _0x4a384f={};var _0x33eae9;var _0x1ded8f;return db[_0x32c7('0x23')][_0x32c7('0x3e')]({'where':{'id':_0x47de9e[_0x32c7('0x2a')]['id']}})['then'](handleEntityNotFound(_0x1c0065,null))[_0x32c7('0x16')](function(_0x11de42){if(_0x11de42){_0x33eae9=_0x11de42;_0x4a384f[_0x32c7('0x2b')]=_[_0x32c7('0x2c')](db[_0x32c7('0x50')][_0x32c7('0x1e')]);_0x4a384f[_0x32c7('0x25')]=_[_0x32c7('0x2c')](_0x47de9e[_0x32c7('0x25')]);_0x4a384f[_0x32c7('0x40')]=_[_0x32c7('0x41')](_0x4a384f[_0x32c7('0x2b')],_0x4a384f[_0x32c7('0x25')]);_0x5a21ba[_0x32c7('0x2d')]=_['intersection'](_0x4a384f[_0x32c7('0x2b')],qs['fields'](_0x47de9e[_0x32c7('0x25')]['fields']));_0x5a21ba[_0x32c7('0x2d')]=_0x5a21ba[_0x32c7('0x2d')][_0x32c7('0x2f')]?_0x5a21ba[_0x32c7('0x2d')]:_0x4a384f['model'];_0x5a21ba['order']=qs[_0x32c7('0x45')](_0x47de9e['query'][_0x32c7('0x45')]);_0x5a21ba['where']=qs['filters'](_[_0x32c7('0x46')](_0x47de9e[_0x32c7('0x25')],_0x4a384f[_0x32c7('0x40')]));if(_0x47de9e['query'][_0x32c7('0x49')]){_0x5a21ba[_0x32c7('0x47')]=_[_0x32c7('0x31')](_0x5a21ba[_0x32c7('0x47')],{'$or':_[_0x32c7('0x1d')](_0x5a21ba[_0x32c7('0x2d')],function(_0x5cb308){var _0x47fcdf={};_0x47fcdf[_0x5cb308]={'$like':'%'+_0x47de9e['query'][_0x32c7('0x49')]+'%'};return _0x47fcdf;})});}_0x5a21ba=_[_0x32c7('0x31')]({},_0x5a21ba,_0x47de9e[_0x32c7('0x32')]);return _0x33eae9[_0x32c7('0x51')](_0x5a21ba);}})[_0x32c7('0x16')](function(_0x2669d3){if(_0x2669d3){_0x1ded8f=_0x2669d3[_0x32c7('0x2f')];if(!_0x47de9e['query'][_0x32c7('0x42')](_0x32c7('0x43'))){_0x5a21ba['limit']=qs['limit'](_0x47de9e['query']['limit']);_0x5a21ba['offset']=qs[_0x32c7('0x11')](_0x47de9e[_0x32c7('0x25')][_0x32c7('0x11')]);}return _0x33eae9[_0x32c7('0x51')](_0x5a21ba);}})[_0x32c7('0x16')](function(_0x2b04fe){if(_0x2b04fe){return _0x2b04fe?{'count':_0x1ded8f,'rows':_0x2b04fe}:null;}})[_0x32c7('0x16')](respondWithResult(_0x1c0065,null))[_0x32c7('0x28')](handleError(_0x1c0065,null));};exports[_0x32c7('0x52')]=function(_0x183d14,_0x2050a3){var _0x36a023=_0x183d14['body'][_0x32c7('0x53')];return db[_0x32c7('0x50')][_0x32c7('0x26')]({'where':{'id':_0x36a023},'attributes':['id'],'include':[{'model':db[_0x32c7('0x54')],'as':_0x32c7('0x55'),'attributes':['id',_0x32c7('0x1a'),_0x32c7('0x56'),_0x32c7('0x57'),_0x32c7('0x58')],'raw':!![]}]})[_0x32c7('0x16')](function(_0x1f2c79){if(_0x1f2c79){var _0x2bc3ca=_[_0x32c7('0x59')](_0x1f2c79,function(_0x10a25c){var _0x376346=_0x10a25c[_0x32c7('0x36')]({'plain':!![]});return _0x376346[_0x32c7('0x55')];});return db[_0x32c7('0x23')][_0x32c7('0x38')]({'where':{'id':_0x183d14[_0x32c7('0x2a')]['id']}})[_0x32c7('0x16')](function(_0x41e3ae){return db['sequelize'][_0x32c7('0x5a')](function(_0x5e83e9){return _0x41e3ae[_0x32c7('0x52')](_0x36a023,{'transaction':_0x5e83e9})['then'](function(){return BPromise[_0x32c7('0x5b')](_0x2bc3ca,function(_0x4e854e){return db[_0x32c7('0x3f')]['findOrCreate']({'where':{'UserId':_0x4e854e['id'],'WhatsappQueueId':_0x183d14[_0x32c7('0x2a')]['id']},'transaction':_0x5e83e9});});})[_0x32c7('0x16')](function(){_0x2bc3ca[_0x32c7('0x5c')](function(_0x30c627){socket['emit'](_0x32c7('0x5d'),{'UserId':_0x30c627['id'],'WhatsappQueueId':_0x41e3ae['id']});});});});});}})[_0x32c7('0x16')](respondWithStatusCode(_0x2050a3,null))['catch'](handleError(_0x2050a3,null));};exports[_0x32c7('0x5e')]=function(_0x45124f,_0x26718d){return db[_0x32c7('0x50')][_0x32c7('0x26')]({'where':{'id':_0x45124f['query'][_0x32c7('0x53')]},'attributes':['id'],'include':[{'model':db[_0x32c7('0x54')],'as':_0x32c7('0x55'),'attributes':['id'],'raw':!![]}]})[_0x32c7('0x16')](handleEntityNotFound(_0x26718d,null))['then'](function(_0x5788d0){var _0x3c2b17=_[_0x32c7('0x1d')](_0x5788d0,'id');var _0x1b3430=[];var _0x2cf273=[];var _0x923661=squel[_0x32c7('0x5f')]();_0x923661['field'](_0x32c7('0x60'))['from']('team_has_whatsapp_queues','tq')['join'](_0x32c7('0x61'),'ut',_0x32c7('0x62'))['where'](_0x32c7('0x63'),_0x45124f[_0x32c7('0x2a')]['id']);for(var _0x452ba4=0x0;_0x452ba4<_0x5788d0[_0x32c7('0x2f')];_0x452ba4+=0x1){let _0x3804c1=_0x5788d0[_0x452ba4];for(var _0x35032f=0x0;_0x35032f<_0x3804c1[_0x32c7('0x55')][_0x32c7('0x2f')];_0x35032f+=0x1){let _0x371f0b=_0x3804c1[_0x32c7('0x55')][_0x35032f];var _0x563570=_0x923661[_0x32c7('0x64')]();_0x563570[_0x32c7('0x47')](_0x32c7('0x65'),_0x371f0b['id']);_0x2cf273[_0x32c7('0x66')](db[_0x32c7('0x67')][_0x32c7('0x25')](_0x563570['toString'](),{'type':db[_0x32c7('0x67')][_0x32c7('0x68')][_0x32c7('0x69')]})[_0x32c7('0x16')](function(_0x58287f){if(_0x58287f['length']===0x1){return _0x371f0b['id'];}else{var _0x476d2f=_[_0x32c7('0x6a')](_[_0x32c7('0x1d')](_0x58287f,_0x32c7('0x6b')),function(_0x301b02){return _[_0x32c7('0x6c')](_0x3c2b17,_0x301b02);});if(_0x476d2f){return _0x371f0b['id'];}}}));}}return BPromise[_0x32c7('0x6d')](_0x2cf273)[_0x32c7('0x16')](function(_0x5f5435){_0x1b3430=_(_0x1b3430)['union'](_0x5f5435)[_0x32c7('0x6e')]()[_0x32c7('0x6f')]();return db[_0x32c7('0x23')]['find']({'where':{'id':_0x45124f[_0x32c7('0x2a')]['id']}})[_0x32c7('0x16')](function(_0x1cd994){return db['sequelize']['transaction'](function(_0x18d8b4){return _0x1cd994[_0x32c7('0x5e')](_0x45124f[_0x32c7('0x25')][_0x32c7('0x53')],{'transaction':_0x18d8b4})[_0x32c7('0x16')](function(){if(!_[_0x32c7('0x70')](_0x1b3430)){return _0x1cd994[_0x32c7('0x71')](_0x1b3430,{'transaction':_0x18d8b4});}})[_0x32c7('0x16')](function(){_0x1b3430[_0x32c7('0x5c')](function(_0x56c0da){socket[_0x32c7('0x72')](_0x32c7('0x73'),{'UserId':_0x56c0da,'WhatsappQueueId':_0x1cd994['id']});});});});});});})[_0x32c7('0x16')](respondWithStatusCode(_0x26718d,null))['catch'](handleError(_0x26718d,null));};exports[_0x32c7('0x74')]=function(_0xeaaacc,_0x82009){return db[_0x32c7('0x23')]['find']({'where':{'id':_0xeaaacc[_0x32c7('0x2a')]['id']}})['then'](handleEntityNotFound(_0x82009,null))[_0x32c7('0x16')](function(_0x3c38f7){if(_0x3c38f7){return _0x3c38f7[_0x32c7('0x74')](_0xeaaacc[_0x32c7('0x34')][_0x32c7('0x53')],_[_0x32c7('0x75')](_0xeaaacc[_0x32c7('0x34')],[_0x32c7('0x53'),'id'])||{})[_0x32c7('0x76')](function(_0x51f623){for(var _0x4b298b=0x0;_0x4b298b<_0xeaaacc[_0x32c7('0x34')]['ids'][_0x32c7('0x2f')];_0x4b298b+=0x1){socket[_0x32c7('0x72')](_0x32c7('0x5d'),{'UserId':Number(_0xeaaacc['body'][_0x32c7('0x53')][_0x4b298b]),'WhatsappQueueId':Number(_0xeaaacc[_0x32c7('0x2a')]['id'])});}return _0x51f623;});}})[_0x32c7('0x16')](respondWithResult(_0x82009,null))[_0x32c7('0x28')](handleError(_0x82009,null));};exports[_0x32c7('0x71')]=function(_0x13514e,_0x597d2d){return db[_0x32c7('0x23')][_0x32c7('0x38')]({'where':{'id':_0x13514e['params']['id']}})[_0x32c7('0x16')](handleEntityNotFound(_0x597d2d,null))[_0x32c7('0x16')](function(_0x4c5b9f){if(_0x4c5b9f){return _0x4c5b9f[_0x32c7('0x71')](_0x13514e['query'][_0x32c7('0x53')])[_0x32c7('0x16')](function(){if(_[_0x32c7('0x77')](_0x13514e[_0x32c7('0x25')][_0x32c7('0x53')])){for(var _0x4b1a23=0x0;_0x4b1a23<_0x13514e[_0x32c7('0x25')][_0x32c7('0x53')][_0x32c7('0x2f')];_0x4b1a23+=0x1){socket['emit'](_0x32c7('0x73'),{'UserId':Number(_0x13514e[_0x32c7('0x25')][_0x32c7('0x53')][_0x4b1a23]),'WhatsappQueueId':Number(_0x13514e['params']['id'])});}}else{socket[_0x32c7('0x72')](_0x32c7('0x73'),{'UserId':Number(_0x13514e[_0x32c7('0x25')][_0x32c7('0x53')]),'WhatsappQueueId':Number(_0x13514e[_0x32c7('0x2a')]['id'])});}});}})[_0x32c7('0x16')](respondWithStatusCode(_0x597d2d,null))[_0x32c7('0x28')](handleError(_0x597d2d,null));};exports[_0x32c7('0x78')]=function(_0x599932,_0x432136){var _0x2cfde1={};var _0x5e9973={};var _0x493e1e;var _0x53c48a;return db[_0x32c7('0x23')][_0x32c7('0x3e')]({'where':{'id':_0x599932[_0x32c7('0x2a')]['id']}})[_0x32c7('0x16')](handleEntityNotFound(_0x432136,null))[_0x32c7('0x16')](function(_0x7d47bc){if(_0x7d47bc){_0x493e1e=_0x7d47bc;_0x5e9973[_0x32c7('0x2b')]=_[_0x32c7('0x2c')](db[_0x32c7('0x54')][_0x32c7('0x1e')]);_0x5e9973[_0x32c7('0x25')]=_[_0x32c7('0x2c')](_0x599932[_0x32c7('0x25')]);_0x5e9973['filters']=_['intersection'](_0x5e9973[_0x32c7('0x2b')],_0x5e9973['query']);_0x2cfde1[_0x32c7('0x2d')]=_[_0x32c7('0x41')](_0x5e9973[_0x32c7('0x2b')],qs[_0x32c7('0x2e')](_0x599932[_0x32c7('0x25')][_0x32c7('0x2e')]));_0x2cfde1['attributes']=_0x2cfde1[_0x32c7('0x2d')]['length']?_0x2cfde1[_0x32c7('0x2d')]:_0x5e9973[_0x32c7('0x2b')];_0x2cfde1['order']=qs[_0x32c7('0x45')](_0x599932[_0x32c7('0x25')][_0x32c7('0x45')]);_0x2cfde1[_0x32c7('0x47')]=qs[_0x32c7('0x40')](_[_0x32c7('0x46')](_0x599932[_0x32c7('0x25')],_0x5e9973[_0x32c7('0x40')]));if(_0x599932[_0x32c7('0x25')][_0x32c7('0x49')]){_0x2cfde1[_0x32c7('0x47')]=_[_0x32c7('0x31')](_0x2cfde1['where'],{'$or':_[_0x32c7('0x1d')](_0x2cfde1[_0x32c7('0x2d')],function(_0xa6cd8e){var _0x534944={};_0x534944[_0xa6cd8e]={'$like':'%'+_0x599932[_0x32c7('0x25')]['filter']+'%'};return _0x534944;})});}_0x2cfde1=_['merge']({},_0x2cfde1,_0x599932['options']);return _0x493e1e[_0x32c7('0x78')](_0x2cfde1);}})[_0x32c7('0x16')](function(_0x1ff172){if(_0x1ff172){_0x53c48a=_0x1ff172[_0x32c7('0x2f')];if(!_0x599932[_0x32c7('0x25')]['hasOwnProperty'](_0x32c7('0x43'))){_0x2cfde1[_0x32c7('0xf')]=qs[_0x32c7('0xf')](_0x599932[_0x32c7('0x25')][_0x32c7('0xf')]);_0x2cfde1[_0x32c7('0x11')]=qs[_0x32c7('0x11')](_0x599932[_0x32c7('0x25')][_0x32c7('0x11')]);}return _0x493e1e[_0x32c7('0x78')](_0x2cfde1);}})[_0x32c7('0x16')](function(_0x399fcd){if(_0x399fcd){return _0x399fcd?{'count':_0x53c48a,'rows':_0x399fcd}:null;}})[_0x32c7('0x16')](respondWithResult(_0x432136,null))[_0x32c7('0x28')](handleError(_0x432136,null));}; \ No newline at end of file +var _0x85ac=['getAgents','bluebird','util','lodash','squel','ioredis','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','update','then','destroy','get','error','stack','name','send','map','WhatsappQueue','rawAttributes','fieldName','type','key','include','query','findAll','rows','show','params','model','keys','attributes','intersection','fields','length','includeAll','merge','options','find','catch','create','body','role','user','WhatsappQueues','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','describe','getMembers','findOne','UserWhatsappQueue','hasOwnProperty','nolimit','order','sort','where','filters','pick','WhatsappQueueId','filter','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','SIP','Team','getTeams','addTeams','ids','online','interface','flatMap','sequelize','transaction','each','findOrCreate','emit','removeTeams','Agents','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','push','toString','QueryTypes','every','TeamId','includes','all','union','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','isArray'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x85ac,0x17b));var _0xc85a=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0x85ac[_0x411add];return _0x238242;};'use strict';var BPromise=require(_0xc85a('0x0'));var util=require(_0xc85a('0x1'));var _=require(_0xc85a('0x2'));var squel=require(_0xc85a('0x3'));var Redis=require(_0xc85a('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0xc85a('0x5'))('api');var config=require(_0xc85a('0x6'));var db=require(_0xc85a('0x7'))['db'];config[_0xc85a('0x8')]=_[_0xc85a('0x9')](config[_0xc85a('0x8')],{'host':_0xc85a('0xa'),'port':0x18eb});var socket=require(_0xc85a('0xb'))(new Redis(config[_0xc85a('0x8')]));require(_0xc85a('0xc'))[_0xc85a('0xd')](socket);function respondWithStatusCode(_0x4dc753,_0x45b5cf){_0x45b5cf=_0x45b5cf||0xcc;return function(_0x40abfd){if(_0x40abfd){return _0x4dc753[_0xc85a('0xe')](_0x45b5cf);}return _0x4dc753[_0xc85a('0xf')](_0x45b5cf)[_0xc85a('0x10')]();};}function respondWithResult(_0x592bea,_0x5adf75){_0x5adf75=_0x5adf75||0xc8;return function(_0x2eee85){if(_0x2eee85){return _0x592bea[_0xc85a('0xf')](_0x5adf75)[_0xc85a('0x11')](_0x2eee85);}};}function respondWithFilteredResult(_0x30479a,_0x5d38b4){return function(_0x11dbfe){if(_0x11dbfe){var _0x5b7f83=typeof _0x5d38b4['offset']===_0xc85a('0x12')&&typeof _0x5d38b4['limit']==='undefined';var _0x3ce9c0=_0x11dbfe[_0xc85a('0x13')];var _0x2707e2=_0x5b7f83?0x0:_0x5d38b4[_0xc85a('0x14')];var _0x32c19d=_0x5b7f83?_0x11dbfe['count']:_0x5d38b4[_0xc85a('0x14')]+_0x5d38b4[_0xc85a('0x15')];var _0x2ba782;if(_0x32c19d>=_0x3ce9c0){_0x32c19d=_0x3ce9c0;_0x2ba782=0xc8;}else{_0x2ba782=0xce;}_0x30479a[_0xc85a('0xf')](_0x2ba782);return _0x30479a[_0xc85a('0x16')](_0xc85a('0x17'),_0x2707e2+'-'+_0x32c19d+'/'+_0x3ce9c0)[_0xc85a('0x11')](_0x11dbfe);}return null;};}function saveUpdates(_0x420ee2){return function(_0x5020b6){if(_0x5020b6){return _0x5020b6[_0xc85a('0x18')](_0x420ee2)[_0xc85a('0x19')](function(_0x8e007d){return _0x8e007d;});}return null;};}function removeEntity(_0x8ac10b){return function(_0x5f0977){if(_0x5f0977){return _0x5f0977[_0xc85a('0x1a')]()[_0xc85a('0x19')](function(){var _0x2d946e=_0x5f0977[_0xc85a('0x1b')]({'plain':!![]});var _0xd4a04b='WhatsappQueues';return db['UserProfileResource']['destroy']({'where':{'type':_0xd4a04b,'resourceId':_0x2d946e['id']}})[_0xc85a('0x19')](function(){return _0x5f0977;});})['then'](function(){_0x8ac10b[_0xc85a('0xf')](0xcc)[_0xc85a('0x10')]();});}};}function handleEntityNotFound(_0x47af39){return function(_0x2f70dc){if(!_0x2f70dc){_0x47af39['sendStatus'](0x194);}return _0x2f70dc;};}function handleError(_0x25008a,_0x4c362a){_0x4c362a=_0x4c362a||0x1f4;return function(_0xc567de){logger[_0xc85a('0x1c')](_0xc567de[_0xc85a('0x1d')]);if(_0xc567de[_0xc85a('0x1e')]){delete _0xc567de['name'];}_0x25008a[_0xc85a('0xf')](_0x4c362a)[_0xc85a('0x1f')](_0xc567de);};}exports['index']=function(_0xd394ba,_0x42050c){var _0x1d1b79={};var _0x52dd66={'count':0x0,'rows':[]};var _0x1a396f=_[_0xc85a('0x20')](db[_0xc85a('0x21')][_0xc85a('0x22')],function(_0x5ae303){return{'name':_0x5ae303[_0xc85a('0x23')],'type':_0x5ae303[_0xc85a('0x24')][_0xc85a('0x25')]};});_0x1d1b79=qs['getOptions'](_0x1a396f,_0xd394ba);var _0x51525a={'where':_0x1d1b79['where']};return db[_0xc85a('0x21')][_0xc85a('0x13')](_0x51525a)[_0xc85a('0x19')](function(_0x469529){_0x52dd66[_0xc85a('0x13')]=_0x469529;_0x1d1b79[_0xc85a('0x26')]=qs[_0xc85a('0x26')](_0xd394ba[_0xc85a('0x27')]);return db[_0xc85a('0x21')][_0xc85a('0x28')](_0x1d1b79);})[_0xc85a('0x19')](function(_0x736f7a){_0x52dd66[_0xc85a('0x29')]=_0x736f7a;return _0x52dd66;})[_0xc85a('0x19')](respondWithFilteredResult(_0x42050c,_0x1d1b79))['catch'](handleError(_0x42050c,null));};exports[_0xc85a('0x2a')]=function(_0x437d6a,_0x1c4566){var _0x5610b9={'raw':!![],'where':{'id':_0x437d6a[_0xc85a('0x2b')]['id']}},_0x1ed734={};_0x1ed734[_0xc85a('0x2c')]=_['keys'](db[_0xc85a('0x21')][_0xc85a('0x22')]);_0x1ed734['query']=_[_0xc85a('0x2d')](_0x437d6a[_0xc85a('0x27')]);_0x1ed734['filters']=_['intersection'](_0x1ed734[_0xc85a('0x2c')],_0x1ed734['query']);_0x5610b9[_0xc85a('0x2e')]=_[_0xc85a('0x2f')](_0x1ed734[_0xc85a('0x2c')],qs[_0xc85a('0x30')](_0x437d6a['query'][_0xc85a('0x30')]));_0x5610b9[_0xc85a('0x2e')]=_0x5610b9[_0xc85a('0x2e')][_0xc85a('0x31')]?_0x5610b9[_0xc85a('0x2e')]:_0x1ed734['model'];if(_0x437d6a[_0xc85a('0x27')][_0xc85a('0x32')]){_0x5610b9[_0xc85a('0x26')]=[{'all':!![]}];}_0x5610b9=_[_0xc85a('0x33')]({},_0x5610b9,_0x437d6a[_0xc85a('0x34')]);return db[_0xc85a('0x21')][_0xc85a('0x35')](_0x5610b9)[_0xc85a('0x19')](handleEntityNotFound(_0x1c4566,null))[_0xc85a('0x19')](respondWithResult(_0x1c4566,null))[_0xc85a('0x36')](handleError(_0x1c4566,null));};exports[_0xc85a('0x37')]=function(_0x28943a,_0x5ce135){return db['WhatsappQueue']['create'](_0x28943a[_0xc85a('0x38')],{})['then'](function(_0x3318cf){var _0x4a434e=_0x28943a['user'][_0xc85a('0x1b')]({'plain':!![]});if(!_0x4a434e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4a434e[_0xc85a('0x39')]===_0xc85a('0x3a')){var _0x3bd295=_0x3318cf[_0xc85a('0x1b')]({'plain':!![]});var _0x478aa8=_0xc85a('0x3b');return db[_0xc85a('0x3c')][_0xc85a('0x35')]({'where':{'name':_0x478aa8,'userProfileId':_0x4a434e[_0xc85a('0x3d')]},'raw':!![]})['then'](function(_0x5ad108){if(_0x5ad108&&_0x5ad108[_0xc85a('0x3e')]===0x0){return db[_0xc85a('0x3f')]['create']({'name':_0x3bd295[_0xc85a('0x1e')],'resourceId':_0x3bd295['id'],'type':_0x5ad108[_0xc85a('0x1e')],'sectionId':_0x5ad108['id']},{})[_0xc85a('0x19')](function(){return _0x3318cf;});}else{return _0x3318cf;}})[_0xc85a('0x36')](function(_0x395723){logger[_0xc85a('0x1c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x395723);throw _0x395723;});}return _0x3318cf;})['then'](respondWithResult(_0x5ce135,0xc9))[_0xc85a('0x36')](handleError(_0x5ce135,null));};exports[_0xc85a('0x18')]=function(_0x410855,_0x99408f){if(_0x410855[_0xc85a('0x38')]['id']){delete _0x410855[_0xc85a('0x38')]['id'];}return db[_0xc85a('0x21')][_0xc85a('0x35')]({'where':{'id':_0x410855['params']['id']}})[_0xc85a('0x19')](handleEntityNotFound(_0x99408f,null))[_0xc85a('0x19')](saveUpdates(_0x410855[_0xc85a('0x38')],null))['then'](respondWithResult(_0x99408f,null))[_0xc85a('0x36')](handleError(_0x99408f,null));};exports[_0xc85a('0x1a')]=function(_0x5c5987,_0xc521ef){return db[_0xc85a('0x21')][_0xc85a('0x35')]({'where':{'id':_0x5c5987['params']['id']}})[_0xc85a('0x19')](handleEntityNotFound(_0xc521ef,null))['then'](removeEntity(_0xc521ef,null))[_0xc85a('0x36')](handleError(_0xc521ef,null));};exports[_0xc85a('0x40')]=function(_0x416d1a,_0x3349b3){return db[_0xc85a('0x21')][_0xc85a('0x40')]()[_0xc85a('0x19')](respondWithResult(_0x3349b3,null))['catch'](handleError(_0x3349b3,null));};exports[_0xc85a('0x41')]=function(_0x5351c3,_0x2c0d50){var _0x2c6843={'raw':!![],'where':{}},_0x816a7c={},_0x28fe31;return db[_0xc85a('0x21')][_0xc85a('0x42')]({'where':{'id':_0x5351c3['params']['id']}})['then'](handleEntityNotFound(_0x2c0d50,null))[_0xc85a('0x19')](function(_0x4f7730){if(_0x4f7730){_0x28fe31=_0x4f7730[_0xc85a('0x1b')]({'plain':!![]});_0x816a7c['model']=_[_0xc85a('0x2d')](db[_0xc85a('0x43')][_0xc85a('0x22')]);_0x816a7c[_0xc85a('0x27')]=_[_0xc85a('0x2d')](_0x5351c3[_0xc85a('0x27')]);_0x816a7c['filters']=_['intersection'](_0x816a7c[_0xc85a('0x2c')],_0x816a7c[_0xc85a('0x27')]);_0x2c6843[_0xc85a('0x2e')]=_['intersection'](_0x816a7c[_0xc85a('0x2c')],qs[_0xc85a('0x30')](_0x5351c3[_0xc85a('0x27')]['fields']));_0x2c6843['attributes']=_0x2c6843[_0xc85a('0x2e')][_0xc85a('0x31')]?_0x2c6843[_0xc85a('0x2e')]:_0x816a7c[_0xc85a('0x2c')];if(!_0x5351c3[_0xc85a('0x27')][_0xc85a('0x44')](_0xc85a('0x45'))){_0x2c6843[_0xc85a('0x15')]=qs['limit'](_0x5351c3[_0xc85a('0x27')]['limit']);_0x2c6843[_0xc85a('0x14')]=qs[_0xc85a('0x14')](_0x5351c3[_0xc85a('0x27')]['offset']);}_0x2c6843[_0xc85a('0x46')]=qs['sort'](_0x5351c3[_0xc85a('0x27')][_0xc85a('0x47')]);_0x2c6843[_0xc85a('0x48')]=qs[_0xc85a('0x49')](_[_0xc85a('0x4a')](_0x5351c3[_0xc85a('0x27')],_0x816a7c[_0xc85a('0x49')]));_0x2c6843['where'][_0xc85a('0x4b')]=_0x4f7730['id'];if(_0x5351c3[_0xc85a('0x27')][_0xc85a('0x4c')]){_0x2c6843[_0xc85a('0x48')]=_[_0xc85a('0x33')](_0x2c6843['where'],{'$or':_[_0xc85a('0x20')](_0x2c6843[_0xc85a('0x2e')],function(_0x3532a7){var _0x5cefa3={};_0x5cefa3[_0x3532a7]={'$like':'%'+_0x5351c3[_0xc85a('0x27')][_0xc85a('0x4c')]+'%'};return _0x5cefa3;})});}_0x2c6843=_['merge']({},_0x2c6843,_0x5351c3[_0xc85a('0x34')]);return db[_0xc85a('0x43')][_0xc85a('0x28')](_0x2c6843);}})[_0xc85a('0x19')](function(_0x293ff0){if(_0x293ff0){return db[_0xc85a('0x4d')][_0xc85a('0x4e')]({'where':{'id':_[_0xc85a('0x20')](_0x293ff0,_0xc85a('0x4f')),'role':_0xc85a('0x50')},'attributes':['id',_0xc85a('0x1e'),'whatsappPause',_0xc85a('0x51'),_0xc85a('0x52')]});}})[_0xc85a('0x19')](function(_0xd89301){if(_0xd89301){return{'count':_0xd89301['count'],'rows':_[_0xc85a('0x20')](_0xd89301[_0xc85a('0x29')],function(_0x367ca8){return{'membername':_0x367ca8[_0xc85a('0x1e')],'UserId':_0x367ca8['id'],'queue_name':_0x28fe31[_0xc85a('0x1e')],'WhatsappQueueId':_0x28fe31['id'],'interface':util[_0xc85a('0x53')](_0xc85a('0x54'),_0xc85a('0x55'),_0x367ca8['name']),'penalty':0x0,'paused':_0x367ca8['whatsappPause'],'createdAt':_0x367ca8[_0xc85a('0x52')],'updatedAt':_0x367ca8[_0xc85a('0x51')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc85a('0x19')](respondWithFilteredResult(_0x2c0d50,_0x2c6843))[_0xc85a('0x36')](handleError(_0x2c0d50,null));};exports['getTeams']=function(_0x115ba3,_0x241d5e){var _0x2ec90d={};var _0x243288={};var _0x4ba3f1;var _0xee926b;return db['WhatsappQueue'][_0xc85a('0x42')]({'where':{'id':_0x115ba3['params']['id']}})[_0xc85a('0x19')](handleEntityNotFound(_0x241d5e,null))[_0xc85a('0x19')](function(_0x1f58cf){if(_0x1f58cf){_0x4ba3f1=_0x1f58cf;_0x243288[_0xc85a('0x2c')]=_[_0xc85a('0x2d')](db[_0xc85a('0x56')]['rawAttributes']);_0x243288[_0xc85a('0x27')]=_['keys'](_0x115ba3[_0xc85a('0x27')]);_0x243288[_0xc85a('0x49')]=_['intersection'](_0x243288[_0xc85a('0x2c')],_0x243288[_0xc85a('0x27')]);_0x2ec90d['attributes']=_[_0xc85a('0x2f')](_0x243288['model'],qs[_0xc85a('0x30')](_0x115ba3[_0xc85a('0x27')][_0xc85a('0x30')]));_0x2ec90d['attributes']=_0x2ec90d[_0xc85a('0x2e')][_0xc85a('0x31')]?_0x2ec90d[_0xc85a('0x2e')]:_0x243288[_0xc85a('0x2c')];_0x2ec90d['order']=qs[_0xc85a('0x47')](_0x115ba3['query'][_0xc85a('0x47')]);_0x2ec90d['where']=qs['filters'](_[_0xc85a('0x4a')](_0x115ba3[_0xc85a('0x27')],_0x243288['filters']));if(_0x115ba3[_0xc85a('0x27')][_0xc85a('0x4c')]){_0x2ec90d['where']=_[_0xc85a('0x33')](_0x2ec90d[_0xc85a('0x48')],{'$or':_[_0xc85a('0x20')](_0x2ec90d['attributes'],function(_0x301aaa){var _0x3b04f0={};_0x3b04f0[_0x301aaa]={'$like':'%'+_0x115ba3[_0xc85a('0x27')][_0xc85a('0x4c')]+'%'};return _0x3b04f0;})});}_0x2ec90d=_['merge']({},_0x2ec90d,_0x115ba3[_0xc85a('0x34')]);return _0x4ba3f1['getTeams'](_0x2ec90d);}})[_0xc85a('0x19')](function(_0x269ff9){if(_0x269ff9){_0xee926b=_0x269ff9['length'];if(!_0x115ba3[_0xc85a('0x27')][_0xc85a('0x44')]('nolimit')){_0x2ec90d[_0xc85a('0x15')]=qs[_0xc85a('0x15')](_0x115ba3[_0xc85a('0x27')]['limit']);_0x2ec90d['offset']=qs[_0xc85a('0x14')](_0x115ba3[_0xc85a('0x27')]['offset']);}return _0x4ba3f1[_0xc85a('0x57')](_0x2ec90d);}})[_0xc85a('0x19')](function(_0x31a52e){if(_0x31a52e){return _0x31a52e?{'count':_0xee926b,'rows':_0x31a52e}:null;}})[_0xc85a('0x19')](respondWithResult(_0x241d5e,null))[_0xc85a('0x36')](handleError(_0x241d5e,null));};exports[_0xc85a('0x58')]=function(_0x75899c,_0x2d3f70){var _0x256ac9=_0x75899c[_0xc85a('0x38')][_0xc85a('0x59')];return db['Team'][_0xc85a('0x28')]({'where':{'id':_0x256ac9},'attributes':['id'],'include':[{'model':db[_0xc85a('0x4d')],'as':'Agents','attributes':['id',_0xc85a('0x1e'),_0xc85a('0x5a'),'voicePause',_0xc85a('0x5b')],'raw':!![]}]})[_0xc85a('0x19')](function(_0x45a58c){if(_0x45a58c){var _0xf8af2c=_[_0xc85a('0x5c')](_0x45a58c,function(_0x3894fd){var _0x25442c=_0x3894fd[_0xc85a('0x1b')]({'plain':!![]});return _0x25442c['Agents'];});return db[_0xc85a('0x21')][_0xc85a('0x35')]({'where':{'id':_0x75899c[_0xc85a('0x2b')]['id']}})[_0xc85a('0x19')](function(_0x10d4a4){return db[_0xc85a('0x5d')][_0xc85a('0x5e')](function(_0x144db8){return _0x10d4a4[_0xc85a('0x58')](_0x256ac9,{'transaction':_0x144db8})[_0xc85a('0x19')](function(){return BPromise[_0xc85a('0x5f')](_0xf8af2c,function(_0x2f2d0e){return db[_0xc85a('0x43')][_0xc85a('0x60')]({'where':{'UserId':_0x2f2d0e['id'],'WhatsappQueueId':_0x75899c[_0xc85a('0x2b')]['id']},'transaction':_0x144db8});});})[_0xc85a('0x19')](function(){_0xf8af2c['forEach'](function(_0x2254ab){socket[_0xc85a('0x61')]('userWhatsappQueue:save',{'UserId':_0x2254ab['id'],'WhatsappQueueId':_0x10d4a4['id']});});});});});}})[_0xc85a('0x19')](respondWithStatusCode(_0x2d3f70,null))['catch'](handleError(_0x2d3f70,null));};exports[_0xc85a('0x62')]=function(_0x27d71b,_0x366394){return db[_0xc85a('0x56')][_0xc85a('0x28')]({'where':{'id':_0x27d71b[_0xc85a('0x27')][_0xc85a('0x59')]},'attributes':['id'],'include':[{'model':db[_0xc85a('0x4d')],'as':_0xc85a('0x63'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x366394,null))['then'](function(_0x5d1c3c){var _0x28e740=_[_0xc85a('0x20')](_0x5d1c3c,'id');var _0x3dbd77=[];var _0xfb801e=[];var _0xe14fca=squel[_0xc85a('0x64')]();_0xe14fca[_0xc85a('0x65')](_0xc85a('0x66'))[_0xc85a('0x67')](_0xc85a('0x68'),'tq')[_0xc85a('0x69')](_0xc85a('0x6a'),'ut',_0xc85a('0x6b'))['where'](_0xc85a('0x6c'),_0x27d71b[_0xc85a('0x2b')]['id']);for(var _0x171419=0x0;_0x171419<_0x5d1c3c[_0xc85a('0x31')];_0x171419+=0x1){let _0x9af1cf=_0x5d1c3c[_0x171419];for(var _0x25ceaa=0x0;_0x25ceaa<_0x9af1cf[_0xc85a('0x63')]['length'];_0x25ceaa+=0x1){let _0x45812b=_0x9af1cf[_0xc85a('0x63')][_0x25ceaa];var _0x38a164=_0xe14fca[_0xc85a('0x6d')]();_0x38a164[_0xc85a('0x48')]('ut.UserId\x20=\x20?',_0x45812b['id']);_0xfb801e[_0xc85a('0x6e')](db[_0xc85a('0x5d')]['query'](_0x38a164[_0xc85a('0x6f')](),{'type':db[_0xc85a('0x5d')][_0xc85a('0x70')]['SELECT']})[_0xc85a('0x19')](function(_0x30deea){if(_0x30deea[_0xc85a('0x31')]===0x1){return _0x45812b['id'];}else{var _0x40385d=_[_0xc85a('0x71')](_[_0xc85a('0x20')](_0x30deea,_0xc85a('0x72')),function(_0x3dfec6){return _[_0xc85a('0x73')](_0x28e740,_0x3dfec6);});if(_0x40385d){return _0x45812b['id'];}}}));}}return BPromise[_0xc85a('0x74')](_0xfb801e)[_0xc85a('0x19')](function(_0x30c920){_0x3dbd77=_(_0x3dbd77)[_0xc85a('0x75')](_0x30c920)['compact']()['value']();return db[_0xc85a('0x21')][_0xc85a('0x35')]({'where':{'id':_0x27d71b[_0xc85a('0x2b')]['id']}})[_0xc85a('0x19')](function(_0x35b4da){return db['sequelize'][_0xc85a('0x5e')](function(_0x1a0e1b){return _0x35b4da[_0xc85a('0x62')](_0x27d71b['query'][_0xc85a('0x59')],{'transaction':_0x1a0e1b})[_0xc85a('0x19')](function(){if(!_[_0xc85a('0x76')](_0x3dbd77)){return _0x35b4da[_0xc85a('0x77')](_0x3dbd77,{'transaction':_0x1a0e1b});}})[_0xc85a('0x19')](function(){_0x3dbd77['forEach'](function(_0x2299fa){socket['emit'](_0xc85a('0x78'),{'UserId':_0x2299fa,'WhatsappQueueId':_0x35b4da['id']});});});});});});})[_0xc85a('0x19')](respondWithStatusCode(_0x366394,null))[_0xc85a('0x36')](handleError(_0x366394,null));};exports[_0xc85a('0x79')]=function(_0x4ca062,_0x4f71f2){return db[_0xc85a('0x21')][_0xc85a('0x35')]({'where':{'id':_0x4ca062[_0xc85a('0x2b')]['id']}})[_0xc85a('0x19')](handleEntityNotFound(_0x4f71f2,null))[_0xc85a('0x19')](function(_0x1d6bc7){if(_0x1d6bc7){return _0x1d6bc7[_0xc85a('0x79')](_0x4ca062[_0xc85a('0x38')]['ids'],_[_0xc85a('0x7a')](_0x4ca062[_0xc85a('0x38')],[_0xc85a('0x59'),'id'])||{})[_0xc85a('0x7b')](function(_0x1fe446){for(var _0x13dfd0=0x0;_0x13dfd0<_0x4ca062['body']['ids'][_0xc85a('0x31')];_0x13dfd0+=0x1){socket['emit']('userWhatsappQueue:save',{'UserId':Number(_0x4ca062[_0xc85a('0x38')]['ids'][_0x13dfd0]),'WhatsappQueueId':Number(_0x4ca062[_0xc85a('0x2b')]['id'])});}return _0x1fe446;});}})[_0xc85a('0x19')](respondWithResult(_0x4f71f2,null))[_0xc85a('0x36')](handleError(_0x4f71f2,null));};exports[_0xc85a('0x77')]=function(_0x484ebf,_0x4faf4a){return db[_0xc85a('0x21')][_0xc85a('0x35')]({'where':{'id':_0x484ebf[_0xc85a('0x2b')]['id']}})[_0xc85a('0x19')](handleEntityNotFound(_0x4faf4a,null))['then'](function(_0x39766f){if(_0x39766f){return _0x39766f['removeAgents'](_0x484ebf[_0xc85a('0x27')]['ids'])['then'](function(){if(_[_0xc85a('0x7c')](_0x484ebf[_0xc85a('0x27')][_0xc85a('0x59')])){for(var _0x217b68=0x0;_0x217b68<_0x484ebf['query'][_0xc85a('0x59')][_0xc85a('0x31')];_0x217b68+=0x1){socket[_0xc85a('0x61')]('userWhatsappQueue:remove',{'UserId':Number(_0x484ebf[_0xc85a('0x27')][_0xc85a('0x59')][_0x217b68]),'WhatsappQueueId':Number(_0x484ebf[_0xc85a('0x2b')]['id'])});}}else{socket['emit'](_0xc85a('0x78'),{'UserId':Number(_0x484ebf[_0xc85a('0x27')]['ids']),'WhatsappQueueId':Number(_0x484ebf['params']['id'])});}});}})[_0xc85a('0x19')](respondWithStatusCode(_0x4faf4a,null))[_0xc85a('0x36')](handleError(_0x4faf4a,null));};exports[_0xc85a('0x7d')]=function(_0x2e5c28,_0x2a4c96){var _0x28ef07={};var _0x2266b7={};var _0x4cd20e;var _0x2c8b9a;return db[_0xc85a('0x21')][_0xc85a('0x42')]({'where':{'id':_0x2e5c28[_0xc85a('0x2b')]['id']}})[_0xc85a('0x19')](handleEntityNotFound(_0x2a4c96,null))[_0xc85a('0x19')](function(_0x3e3edc){if(_0x3e3edc){_0x4cd20e=_0x3e3edc;_0x2266b7[_0xc85a('0x2c')]=_[_0xc85a('0x2d')](db[_0xc85a('0x4d')][_0xc85a('0x22')]);_0x2266b7[_0xc85a('0x27')]=_[_0xc85a('0x2d')](_0x2e5c28['query']);_0x2266b7[_0xc85a('0x49')]=_[_0xc85a('0x2f')](_0x2266b7[_0xc85a('0x2c')],_0x2266b7['query']);_0x28ef07[_0xc85a('0x2e')]=_['intersection'](_0x2266b7[_0xc85a('0x2c')],qs[_0xc85a('0x30')](_0x2e5c28['query'][_0xc85a('0x30')]));_0x28ef07['attributes']=_0x28ef07[_0xc85a('0x2e')][_0xc85a('0x31')]?_0x28ef07[_0xc85a('0x2e')]:_0x2266b7[_0xc85a('0x2c')];_0x28ef07['order']=qs[_0xc85a('0x47')](_0x2e5c28[_0xc85a('0x27')]['sort']);_0x28ef07['where']=qs[_0xc85a('0x49')](_[_0xc85a('0x4a')](_0x2e5c28['query'],_0x2266b7[_0xc85a('0x49')]));if(_0x2e5c28['query'][_0xc85a('0x4c')]){_0x28ef07[_0xc85a('0x48')]=_['merge'](_0x28ef07['where'],{'$or':_['map'](_0x28ef07[_0xc85a('0x2e')],function(_0x661e50){var _0xb8a3b3={};_0xb8a3b3[_0x661e50]={'$like':'%'+_0x2e5c28[_0xc85a('0x27')][_0xc85a('0x4c')]+'%'};return _0xb8a3b3;})});}_0x28ef07=_['merge']({},_0x28ef07,_0x2e5c28[_0xc85a('0x34')]);return _0x4cd20e['getAgents'](_0x28ef07);}})[_0xc85a('0x19')](function(_0x50e160){if(_0x50e160){_0x2c8b9a=_0x50e160[_0xc85a('0x31')];if(!_0x2e5c28[_0xc85a('0x27')][_0xc85a('0x44')]('nolimit')){_0x28ef07[_0xc85a('0x15')]=qs[_0xc85a('0x15')](_0x2e5c28[_0xc85a('0x27')][_0xc85a('0x15')]);_0x28ef07[_0xc85a('0x14')]=qs[_0xc85a('0x14')](_0x2e5c28[_0xc85a('0x27')][_0xc85a('0x14')]);}return _0x4cd20e[_0xc85a('0x7d')](_0x28ef07);}})[_0xc85a('0x19')](function(_0x12d9f3){if(_0x12d9f3){return _0x12d9f3?{'count':_0x2c8b9a,'rows':_0x12d9f3}:null;}})[_0xc85a('0x19')](respondWithResult(_0x2a4c96,null))[_0xc85a('0x36')](handleError(_0x2a4c96,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index e9fec0d..4c8baad 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 _0x8985=['WhatsappQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x5f2b47,_0x19e1e7){var _0x2fcf51=function(_0x40f976){while(--_0x40f976){_0x5f2b47['push'](_0x5f2b47['shift']());}};_0x2fcf51(++_0x19e1e7);}(_0x8985,0xd0));var _0x5898=function(_0x5048d6,_0x141ac4){_0x5048d6=_0x5048d6-0x0;var _0x342b3a=_0x8985[_0x5048d6];return _0x342b3a;};'use strict';var EventEmitter=require(_0x5898('0x0'));var WhatsappQueue=require(_0x5898('0x1'))['db'][_0x5898('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x5898('0x3')](0x0);var events={'afterCreate':_0x5898('0x4'),'afterUpdate':_0x5898('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1e2baa){return function(_0x198e4c,_0x211147,_0x312e0f){WhatsappQueueEvents[_0x5898('0x6')](_0x1e2baa+':'+_0x198e4c['id'],_0x198e4c);WhatsappQueueEvents[_0x5898('0x6')](_0x1e2baa,_0x198e4c);_0x312e0f(null);};}for(var e in events){if(events[_0x5898('0x7')](e)){var event=events[e];WhatsappQueue[_0x5898('0x8')](e,emitEvent(event));}}module[_0x5898('0x9')]=WhatsappQueueEvents; \ No newline at end of file +var _0x75e7=['save','emit','hasOwnProperty','exports','events','../../mysqldb','WhatsappQueue','setMaxListeners'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x75e7,0x8c));var _0x775e=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0x75e7[_0x266618];return _0x54dbf5;};'use strict';var EventEmitter=require(_0x775e('0x0'));var WhatsappQueue=require(_0x775e('0x1'))['db'][_0x775e('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x775e('0x3')](0x0);var events={'afterCreate':_0x775e('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x379153){return function(_0x946218,_0x2edf50,_0x4dc751){WhatsappQueueEvents[_0x775e('0x5')](_0x379153+':'+_0x946218['id'],_0x946218);WhatsappQueueEvents[_0x775e('0x5')](_0x379153,_0x946218);_0x4dc751(null);};}for(var e in events){if(events[_0x775e('0x6')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0x775e('0x7')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index a21c986..003bc76 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 _0x83ab=['rimraf','../../config/environment','./whatsappQueue.attributes','define','WhatsappQueue','whatsapp_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4132d1,_0x41fbbd){var _0x27d9cb=function(_0x121a69){while(--_0x121a69){_0x4132d1['push'](_0x4132d1['shift']());}};_0x27d9cb(++_0x41fbbd);}(_0x83ab,0x1d4));var _0xb83a=function(_0x3c5f8d,_0x39891f){_0x3c5f8d=_0x3c5f8d-0x0;var _0x3b7beb=_0x83ab[_0x3c5f8d];return _0x3b7beb;};'use strict';var _=require(_0xb83a('0x0'));var util=require(_0xb83a('0x1'));var logger=require(_0xb83a('0x2'))(_0xb83a('0x3'));var moment=require(_0xb83a('0x4'));var BPromise=require(_0xb83a('0x5'));var rp=require(_0xb83a('0x6'));var fs=require('fs');var path=require(_0xb83a('0x7'));var rimraf=require(_0xb83a('0x8'));var config=require(_0xb83a('0x9'));var attributes=require(_0xb83a('0xa'));module['exports']=function(_0x40bcdc,_0x20449e){return _0x40bcdc[_0xb83a('0xb')](_0xb83a('0xc'),attributes,{'tableName':_0xb83a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8fd7=['../../config/environment','./whatsappQueue.attributes','WhatsappQueue','whatsapp_queues','util','../../config/logger','api','moment','path','rimraf'];(function(_0x4eff15,_0x3b0788){var _0x42d69f=function(_0x7625bb){while(--_0x7625bb){_0x4eff15['push'](_0x4eff15['shift']());}};_0x42d69f(++_0x3b0788);}(_0x8fd7,0x1bc));var _0x78fd=function(_0x37a539,_0x134810){_0x37a539=_0x37a539-0x0;var _0x5067b1=_0x8fd7[_0x37a539];return _0x5067b1;};'use strict';var _=require('lodash');var util=require(_0x78fd('0x0'));var logger=require(_0x78fd('0x1'))(_0x78fd('0x2'));var moment=require(_0x78fd('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x78fd('0x4'));var rimraf=require(_0x78fd('0x5'));var config=require(_0x78fd('0x6'));var attributes=require(_0x78fd('0x7'));module['exports']=function(_0x16fba6,_0x2b1a33){return _0x16fba6['define'](_0x78fd('0x8'),attributes,{'tableName':_0x78fd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index af96e56..69ab108 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 _0xa511=['GetWhatsappQueue','WhatsappQueue','options','raw','where','attributes','limit','include','model','map','then','debug','stringify','ShowWhatsappQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','info','request\x20sent','WhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','WhatsappQueue,\x20%s,\x20%s','message','result','catch'];(function(_0x1880c7,_0x529cb0){var _0x4e86dd=function(_0x307877){while(--_0x307877){_0x1880c7['push'](_0x1880c7['shift']());}};_0x4e86dd(++_0x529cb0);}(_0xa511,0x1ef));var _0x1a51=function(_0x508170,_0x771099){_0x508170=_0x508170-0x0;var _0x592c4d=_0xa511[_0x508170];return _0x592c4d;};'use strict';var _=require(_0x1a51('0x0'));var util=require(_0x1a51('0x1'));var moment=require(_0x1a51('0x2'));var BPromise=require(_0x1a51('0x3'));var rs=require(_0x1a51('0x4'));var fs=require('fs');var Redis=require(_0x1a51('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1a51('0x6'));var logger=require(_0x1a51('0x7'))('rpc');var config=require(_0x1a51('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1a51('0x9')]({'port':0x232a});config[_0x1a51('0xa')]=_[_0x1a51('0xb')](config[_0x1a51('0xa')],{'host':_0x1a51('0xc'),'port':0x18eb});var socket=require(_0x1a51('0xd'))(new Redis(config[_0x1a51('0xa')]));require(_0x1a51('0xe'))[_0x1a51('0xf')](socket);function respondWithRpcPromise(_0x579d24,_0x4667c9,_0x54031f){return new BPromise(function(_0x1363b2,_0x3114a0){return client['request'](_0x579d24,_0x54031f)['then'](function(_0x5f4f5b){logger[_0x1a51('0x10')]('WhatsappQueue,\x20%s,\x20%s',_0x4667c9,_0x1a51('0x11'));logger['debug'](_0x1a51('0x12'),_0x4667c9,_0x1a51('0x11'),JSON['stringify'](_0x5f4f5b));if(_0x5f4f5b[_0x1a51('0x13')]){if(_0x5f4f5b[_0x1a51('0x13')][_0x1a51('0x14')]===0x1f4){logger[_0x1a51('0x13')](_0x1a51('0x15'),_0x4667c9,_0x5f4f5b[_0x1a51('0x13')]['message']);return _0x3114a0(_0x5f4f5b[_0x1a51('0x13')][_0x1a51('0x16')]);}logger[_0x1a51('0x13')](_0x1a51('0x15'),_0x4667c9,_0x5f4f5b[_0x1a51('0x13')][_0x1a51('0x16')]);return _0x1363b2(_0x5f4f5b[_0x1a51('0x13')][_0x1a51('0x16')]);}else{logger['info'](_0x1a51('0x15'),_0x4667c9,_0x1a51('0x11'));_0x1363b2(_0x5f4f5b[_0x1a51('0x17')][_0x1a51('0x16')]);}})[_0x1a51('0x18')](function(_0x2e7ef6){logger[_0x1a51('0x13')]('WhatsappQueue,\x20%s,\x20%s',_0x4667c9,_0x2e7ef6);_0x3114a0(_0x2e7ef6);});});}exports[_0x1a51('0x19')]=function(_0x2081f2){var _0x59e586=this;return new Promise(function(_0x3daaa5,_0x45b93b){return db[_0x1a51('0x1a')]['findAll']({'raw':_0x2081f2[_0x1a51('0x1b')]?_0x2081f2[_0x1a51('0x1b')][_0x1a51('0x1c')]===undefined?!![]:![]:!![],'where':_0x2081f2[_0x1a51('0x1b')]?_0x2081f2[_0x1a51('0x1b')][_0x1a51('0x1d')]||null:null,'attributes':_0x2081f2[_0x1a51('0x1b')]?_0x2081f2[_0x1a51('0x1b')][_0x1a51('0x1e')]||null:null,'limit':_0x2081f2[_0x1a51('0x1b')]?_0x2081f2[_0x1a51('0x1b')][_0x1a51('0x1f')]||null:null,'include':_0x2081f2[_0x1a51('0x1b')]?_0x2081f2[_0x1a51('0x1b')][_0x1a51('0x20')]?_['map'](_0x2081f2[_0x1a51('0x1b')][_0x1a51('0x20')],function(_0xe85d88){return{'model':db[_0xe85d88[_0x1a51('0x21')]],'as':_0xe85d88['as'],'attributes':_0xe85d88[_0x1a51('0x1e')],'include':_0xe85d88['include']?_['map'](_0xe85d88[_0x1a51('0x20')],function(_0x2185a5){return{'model':db[_0x2185a5[_0x1a51('0x21')]],'as':_0x2185a5['as'],'attributes':_0x2185a5['attributes'],'include':_0x2185a5['include']?_[_0x1a51('0x22')](_0x2185a5[_0x1a51('0x20')],function(_0x2b8cc4){return{'model':db[_0x2b8cc4['model']],'as':_0x2b8cc4['as'],'attributes':_0x2b8cc4['attributes']};}):[]};}):[]};}):[]:[]})[_0x1a51('0x23')](function(_0x401bff){logger[_0x1a51('0x10')](_0x1a51('0x19'),_0x2081f2);logger[_0x1a51('0x24')](_0x1a51('0x19'),_0x2081f2,JSON[_0x1a51('0x25')](_0x401bff));_0x3daaa5(_0x401bff);})[_0x1a51('0x18')](function(_0x1c6f07){logger[_0x1a51('0x13')](_0x1a51('0x19'),_0x1c6f07[_0x1a51('0x16')],_0x2081f2);_0x45b93b(_0x59e586[_0x1a51('0x13')](0x1f4,_0x1c6f07[_0x1a51('0x16')]));});});};exports[_0x1a51('0x26')]=function(_0x59053d){var _0x313cae=this;return new Promise(function(_0xf8be09,_0x3d9d8c){return db[_0x1a51('0x1a')][_0x1a51('0x27')]({'raw':_0x59053d[_0x1a51('0x1b')]?_0x59053d[_0x1a51('0x1b')][_0x1a51('0x1c')]===undefined?!![]:![]:!![],'where':_0x59053d[_0x1a51('0x1b')]?_0x59053d[_0x1a51('0x1b')][_0x1a51('0x1d')]||null:null,'attributes':_0x59053d['options']?_0x59053d['options'][_0x1a51('0x1e')]||null:null,'include':_0x59053d[_0x1a51('0x1b')]?_0x59053d[_0x1a51('0x1b')][_0x1a51('0x20')]?_[_0x1a51('0x22')](_0x59053d[_0x1a51('0x1b')][_0x1a51('0x20')],function(_0x140342){return{'model':db[_0x140342[_0x1a51('0x21')]],'as':_0x140342['as'],'attributes':_0x140342['attributes'],'include':_0x140342[_0x1a51('0x20')]?_['map'](_0x140342[_0x1a51('0x20')],function(_0xb6a538){return{'model':db[_0xb6a538[_0x1a51('0x21')]],'as':_0xb6a538['as'],'attributes':_0xb6a538[_0x1a51('0x1e')],'include':_0xb6a538[_0x1a51('0x20')]?_[_0x1a51('0x22')](_0xb6a538[_0x1a51('0x20')],function(_0x3d415){return{'model':db[_0x3d415['model']],'as':_0x3d415['as'],'attributes':_0x3d415[_0x1a51('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1a51('0x23')](function(_0x22bb7f){logger[_0x1a51('0x10')](_0x1a51('0x26'),_0x59053d);logger[_0x1a51('0x24')]('ShowWhatsappQueue',_0x59053d,JSON[_0x1a51('0x25')](_0x22bb7f));_0xf8be09(_0x22bb7f);})['catch'](function(_0x1b7577){logger[_0x1a51('0x13')](_0x1a51('0x26'),_0x1b7577[_0x1a51('0x16')],_0x59053d);_0x3d9d8c(_0x313cae[_0x1a51('0x13')](0x1f4,_0x1b7577[_0x1a51('0x16')]));});});}; \ No newline at end of file +var _0xdd11=['map','model','catch','ShowWhatsappQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','attributes','limit','include'];(function(_0x3c97e3,_0x321677){var _0x9bb0ed=function(_0x3a0cb6){while(--_0x3a0cb6){_0x3c97e3['push'](_0x3c97e3['shift']());}};_0x9bb0ed(++_0x321677);}(_0xdd11,0x165));var _0x1dd1=function(_0x1cd577,_0x180f2a){_0x1cd577=_0x1cd577-0x0;var _0x790837=_0xdd11[_0x1cd577];return _0x790837;};'use strict';var _=require(_0x1dd1('0x0'));var util=require(_0x1dd1('0x1'));var moment=require(_0x1dd1('0x2'));var BPromise=require(_0x1dd1('0x3'));var rs=require(_0x1dd1('0x4'));var fs=require('fs');var Redis=require(_0x1dd1('0x5'));var db=require(_0x1dd1('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1dd1('0x7'))(_0x1dd1('0x8'));var config=require(_0x1dd1('0x9'));var jayson=require(_0x1dd1('0xa'));var client=jayson[_0x1dd1('0xb')][_0x1dd1('0xc')]({'port':0x232a});config[_0x1dd1('0xd')]=_[_0x1dd1('0xe')](config[_0x1dd1('0xd')],{'host':_0x1dd1('0xf'),'port':0x18eb});var socket=require(_0x1dd1('0x10'))(new Redis(config[_0x1dd1('0xd')]));require(_0x1dd1('0x11'))[_0x1dd1('0x12')](socket);function respondWithRpcPromise(_0x197981,_0x1dbefc,_0x3a0d98){return new BPromise(function(_0x26c02e,_0x3e8917){return client['request'](_0x197981,_0x3a0d98)[_0x1dd1('0x13')](function(_0x595ae1){logger[_0x1dd1('0x14')](_0x1dd1('0x15'),_0x1dbefc,_0x1dd1('0x16'));logger[_0x1dd1('0x17')](_0x1dd1('0x18'),_0x1dbefc,'request\x20sent',JSON[_0x1dd1('0x19')](_0x595ae1));if(_0x595ae1[_0x1dd1('0x1a')]){if(_0x595ae1[_0x1dd1('0x1a')][_0x1dd1('0x1b')]===0x1f4){logger[_0x1dd1('0x1a')](_0x1dd1('0x15'),_0x1dbefc,_0x595ae1[_0x1dd1('0x1a')][_0x1dd1('0x1c')]);return _0x3e8917(_0x595ae1[_0x1dd1('0x1a')]['message']);}logger['error'](_0x1dd1('0x15'),_0x1dbefc,_0x595ae1[_0x1dd1('0x1a')]['message']);return _0x26c02e(_0x595ae1['error'][_0x1dd1('0x1c')]);}else{logger['info'](_0x1dd1('0x15'),_0x1dbefc,_0x1dd1('0x16'));_0x26c02e(_0x595ae1[_0x1dd1('0x1d')][_0x1dd1('0x1c')]);}})['catch'](function(_0x44ccfb){logger[_0x1dd1('0x1a')]('WhatsappQueue,\x20%s,\x20%s',_0x1dbefc,_0x44ccfb);_0x3e8917(_0x44ccfb);});});}exports[_0x1dd1('0x1e')]=function(_0x48687e){var _0x38548a=this;return new Promise(function(_0x65a184,_0x1b3005){return db[_0x1dd1('0x1f')][_0x1dd1('0x20')]({'raw':_0x48687e[_0x1dd1('0x21')]?_0x48687e[_0x1dd1('0x21')][_0x1dd1('0x22')]===undefined?!![]:![]:!![],'where':_0x48687e['options']?_0x48687e[_0x1dd1('0x21')][_0x1dd1('0x23')]||null:null,'attributes':_0x48687e['options']?_0x48687e[_0x1dd1('0x21')][_0x1dd1('0x24')]||null:null,'limit':_0x48687e['options']?_0x48687e[_0x1dd1('0x21')][_0x1dd1('0x25')]||null:null,'include':_0x48687e[_0x1dd1('0x21')]?_0x48687e['options'][_0x1dd1('0x26')]?_[_0x1dd1('0x27')](_0x48687e[_0x1dd1('0x21')][_0x1dd1('0x26')],function(_0x2babbd){return{'model':db[_0x2babbd['model']],'as':_0x2babbd['as'],'attributes':_0x2babbd[_0x1dd1('0x24')],'include':_0x2babbd[_0x1dd1('0x26')]?_[_0x1dd1('0x27')](_0x2babbd[_0x1dd1('0x26')],function(_0x576c16){return{'model':db[_0x576c16[_0x1dd1('0x28')]],'as':_0x576c16['as'],'attributes':_0x576c16[_0x1dd1('0x24')],'include':_0x576c16['include']?_['map'](_0x576c16['include'],function(_0x4707fe){return{'model':db[_0x4707fe[_0x1dd1('0x28')]],'as':_0x4707fe['as'],'attributes':_0x4707fe[_0x1dd1('0x24')]};}):[]};}):[]};}):[]:[]})[_0x1dd1('0x13')](function(_0x54ddda){logger['info'](_0x1dd1('0x1e'),_0x48687e);logger[_0x1dd1('0x17')]('GetWhatsappQueue',_0x48687e,JSON['stringify'](_0x54ddda));_0x65a184(_0x54ddda);})[_0x1dd1('0x29')](function(_0xf6b8f2){logger[_0x1dd1('0x1a')](_0x1dd1('0x1e'),_0xf6b8f2[_0x1dd1('0x1c')],_0x48687e);_0x1b3005(_0x38548a['error'](0x1f4,_0xf6b8f2[_0x1dd1('0x1c')]));});});};exports[_0x1dd1('0x2a')]=function(_0x233f17){var _0x55160a=this;return new Promise(function(_0x1a4057,_0xa49937){return db[_0x1dd1('0x1f')][_0x1dd1('0x2b')]({'raw':_0x233f17[_0x1dd1('0x21')]?_0x233f17[_0x1dd1('0x21')][_0x1dd1('0x22')]===undefined?!![]:![]:!![],'where':_0x233f17[_0x1dd1('0x21')]?_0x233f17[_0x1dd1('0x21')]['where']||null:null,'attributes':_0x233f17[_0x1dd1('0x21')]?_0x233f17[_0x1dd1('0x21')][_0x1dd1('0x24')]||null:null,'include':_0x233f17[_0x1dd1('0x21')]?_0x233f17[_0x1dd1('0x21')][_0x1dd1('0x26')]?_[_0x1dd1('0x27')](_0x233f17[_0x1dd1('0x21')]['include'],function(_0x1a8fb5){return{'model':db[_0x1a8fb5[_0x1dd1('0x28')]],'as':_0x1a8fb5['as'],'attributes':_0x1a8fb5[_0x1dd1('0x24')],'include':_0x1a8fb5[_0x1dd1('0x26')]?_[_0x1dd1('0x27')](_0x1a8fb5[_0x1dd1('0x26')],function(_0x4e0fa5){return{'model':db[_0x4e0fa5['model']],'as':_0x4e0fa5['as'],'attributes':_0x4e0fa5[_0x1dd1('0x24')],'include':_0x4e0fa5['include']?_[_0x1dd1('0x27')](_0x4e0fa5[_0x1dd1('0x26')],function(_0x497217){return{'model':db[_0x497217[_0x1dd1('0x28')]],'as':_0x497217['as'],'attributes':_0x497217[_0x1dd1('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x345f23){logger[_0x1dd1('0x14')](_0x1dd1('0x2a'),_0x233f17);logger[_0x1dd1('0x17')](_0x1dd1('0x2a'),_0x233f17,JSON['stringify'](_0x345f23));_0x1a4057(_0x345f23);})['catch'](function(_0x42ae95){logger[_0x1dd1('0x1a')](_0x1dd1('0x2a'),_0x42ae95['message'],_0x233f17);_0xa49937(_0x55160a[_0x1dd1('0x1a')](0x1f4,_0x42ae95[_0x1dd1('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 6a0e15b..07527cf 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 _0x1134=['whatsappQueue:','./whatsappQueue.events','remove','update','emit','removeListener','register','length'];(function(_0x54c37c,_0x1dbc2c){var _0x35f57a=function(_0x57a34e){while(--_0x57a34e){_0x54c37c['push'](_0x54c37c['shift']());}};_0x35f57a(++_0x1dbc2c);}(_0x1134,0x1b1));var _0x4113=function(_0x695543,_0x58f803){_0x695543=_0x695543-0x0;var _0x28e66e=_0x1134[_0x695543];return _0x28e66e;};'use strict';var WhatsappQueueEvents=require(_0x4113('0x0'));var events=['save',_0x4113('0x1'),_0x4113('0x2')];function createListener(_0x1bd529,_0x457a2e){return function(_0x366dc8){_0x457a2e[_0x4113('0x3')](_0x1bd529,_0x366dc8);};}function removeListener(_0x5655bb,_0x507ee1){return function(){WhatsappQueueEvents[_0x4113('0x4')](_0x5655bb,_0x507ee1);};}exports[_0x4113('0x5')]=function(_0x564ff6){for(var _0x5b991f=0x0,_0x2a68ea=events[_0x4113('0x6')];_0x5b991f<_0x2a68ea;_0x5b991f++){var _0x1adc48=events[_0x5b991f];var _0x44bea6=createListener(_0x4113('0x7')+_0x1adc48,_0x564ff6);WhatsappQueueEvents['on'](_0x1adc48,_0x44bea6);}}; \ No newline at end of file +var _0x278c=['length','whatsappQueue:','./whatsappQueue.events','save','remove','emit','removeListener','register'];(function(_0x389fb1,_0x431673){var _0x3d3520=function(_0x2dcab7){while(--_0x2dcab7){_0x389fb1['push'](_0x389fb1['shift']());}};_0x3d3520(++_0x431673);}(_0x278c,0xb2));var _0xc278=function(_0x57a50d,_0x2871f8){_0x57a50d=_0x57a50d-0x0;var _0x1b25b3=_0x278c[_0x57a50d];return _0x1b25b3;};'use strict';var WhatsappQueueEvents=require(_0xc278('0x0'));var events=[_0xc278('0x1'),_0xc278('0x2'),'update'];function createListener(_0x35c8da,_0x19c77f){return function(_0xc95563){_0x19c77f[_0xc278('0x3')](_0x35c8da,_0xc95563);};}function removeListener(_0x4b0f40,_0x574a4a){return function(){WhatsappQueueEvents[_0xc278('0x4')](_0x4b0f40,_0x574a4a);};}exports[_0xc278('0x5')]=function(_0x574f54){for(var _0x2f4634=0x0,_0x2a5704=events[_0xc278('0x6')];_0x2f4634<_0x2a5704;_0x2f4634++){var _0x46e3a8=events[_0x2f4634];var _0x497785=createListener(_0xc278('0x7')+_0x46e3a8,_0x574f54);WhatsappQueueEvents['on'](_0x46e3a8,_0x497785);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index de8b90e..4374d44 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 _0xefae=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueueReport.controller','get','index','isAuthenticated','describe','/:id','show','post','put','update','delete','destroy','exports'];(function(_0x1fcd0e,_0x1bbf1a){var _0x5a6465=function(_0x362eeb){while(--_0x362eeb){_0x1fcd0e['push'](_0x1fcd0e['shift']());}};_0x5a6465(++_0x1bbf1a);}(_0xefae,0x1ce));var _0xeefa=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xefae[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xeefa('0x0'));var util=require(_0xeefa('0x1'));var path=require('path');var timeout=require(_0xeefa('0x2'));var express=require(_0xeefa('0x3'));var router=express[_0xeefa('0x4')]();var fs_extra=require(_0xeefa('0x5'));var auth=require(_0xeefa('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xeefa('0x7'));var controller=require(_0xeefa('0x8'));router[_0xeefa('0x9')]('/',auth['isAuthenticated'](),controller[_0xeefa('0xa')]);router[_0xeefa('0x9')]('/describe',auth[_0xeefa('0xb')](),controller[_0xeefa('0xc')]);router[_0xeefa('0x9')](_0xeefa('0xd'),auth['isAuthenticated'](),controller[_0xeefa('0xe')]);router[_0xeefa('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xeefa('0x10')]('/:id',auth[_0xeefa('0xb')](),controller[_0xeefa('0x11')]);router[_0xeefa('0x12')](_0xeefa('0xd'),auth[_0xeefa('0xb')](),controller[_0xeefa('0x13')]);module[_0xeefa('0x14')]=router; \ No newline at end of file +var _0x8b3f=['index','/describe','describe','/:id','show','create','delete','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x8b3f,0xac));var _0xf8b3=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x8b3f[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0xf8b3('0x0'));var util=require('util');var path=require(_0xf8b3('0x1'));var timeout=require(_0xf8b3('0x2'));var express=require(_0xf8b3('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf8b3('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf8b3('0x5'));var controller=require('./whatsappQueueReport.controller');router[_0xf8b3('0x6')]('/',auth[_0xf8b3('0x7')](),controller[_0xf8b3('0x8')]);router['get'](_0xf8b3('0x9'),auth['isAuthenticated'](),controller[_0xf8b3('0xa')]);router[_0xf8b3('0x6')](_0xf8b3('0xb'),auth['isAuthenticated'](),controller[_0xf8b3('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf8b3('0xd')]);router['put'](_0xf8b3('0xb'),auth[_0xf8b3('0x7')](),controller['update']);router[_0xf8b3('0xe')](_0xf8b3('0xb'),auth[_0xf8b3('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index e6a7942..5edab22 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(_0x3ceda1,_0x3fddda){var _0x352ef8=function(_0x26df20){while(--_0x26df20){_0x3ceda1['push'](_0x3ceda1['shift']());}};_0x352ef8(++_0x3fddda);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'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 _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x2a5d4b,_0x45e559){var _0x35dcbe=function(_0x5a778d){while(--_0x5a778d){_0x2a5d4b['push'](_0x2a5d4b['shift']());}};_0x35dcbe(++_0x45e559);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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 diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 38cbfa8..a9e2f4b 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 _0x13f6=['catch','params','rawAttributes','intersection','create','body','find','describe','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','name','send','map','WhatsappQueueReport','fieldName','type','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x13f6,0x124));var _0x613f=function(_0x450eb1,_0x38e972){_0x450eb1=_0x450eb1-0x0;var _0x58f6ea=_0x13f6[_0x450eb1];return _0x58f6ea;};'use strict';var emlformat=require(_0x613f('0x0'));var rimraf=require(_0x613f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x613f('0x2'));var moment=require(_0x613f('0x3'));var BPromise=require(_0x613f('0x4'));var Mustache=require('mustache');var util=require(_0x613f('0x5'));var path=require(_0x613f('0x6'));var sox=require(_0x613f('0x7'));var csv=require('to-csv');var ejs=require(_0x613f('0x8'));var fs=require('fs');var fs_extra=require(_0x613f('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x613f('0xa'));var toCsv=require(_0x613f('0xb'));var querystring=require(_0x613f('0xc'));var Papa=require(_0x613f('0xd'));var Redis=require('ioredis');var authService=require(_0x613f('0xe'));var qs=require(_0x613f('0xf'));var as=require(_0x613f('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x613f('0x11'))(_0x613f('0x12'));var utils=require(_0x613f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x613f('0x14'));var db=require(_0x613f('0x15'))['db'];function respondWithStatusCode(_0x542230,_0x4c2a85){_0x4c2a85=_0x4c2a85||0xcc;return function(_0x517f57){if(_0x517f57){return _0x542230[_0x613f('0x16')](_0x4c2a85);}return _0x542230[_0x613f('0x17')](_0x4c2a85)[_0x613f('0x18')]();};}function respondWithResult(_0x375db1,_0x329fcf){_0x329fcf=_0x329fcf||0xc8;return function(_0x4a6fc){if(_0x4a6fc){return _0x375db1[_0x613f('0x17')](_0x329fcf)[_0x613f('0x19')](_0x4a6fc);}};}function respondWithFilteredResult(_0x2eee4d,_0x1d68fd){return function(_0x548218){if(_0x548218){var _0x3c9edf=typeof _0x1d68fd['offset']==='undefined'&&typeof _0x1d68fd[_0x613f('0x1a')]===_0x613f('0x1b');var _0x544eca=_0x548218[_0x613f('0x1c')];var _0x4f9dae=_0x3c9edf?0x0:_0x1d68fd[_0x613f('0x1d')];var _0x1e5a11=_0x3c9edf?_0x548218[_0x613f('0x1c')]:_0x1d68fd[_0x613f('0x1d')]+_0x1d68fd[_0x613f('0x1a')];var _0x1ba35f;if(_0x1e5a11>=_0x544eca){_0x1e5a11=_0x544eca;_0x1ba35f=0xc8;}else{_0x1ba35f=0xce;}_0x2eee4d['status'](_0x1ba35f);return _0x2eee4d['set'](_0x613f('0x1e'),_0x4f9dae+'-'+_0x1e5a11+'/'+_0x544eca)['json'](_0x548218);}return null;};}function patchUpdates(_0x48493c){return function(_0x3c9b58){try{jsonpatch[_0x613f('0x1f')](_0x3c9b58,_0x48493c,!![]);}catch(_0x4f5a5a){return BPromise[_0x613f('0x20')](_0x4f5a5a);}return _0x3c9b58[_0x613f('0x21')]();};}function saveUpdates(_0x2aa14b,_0x48b28a){return function(_0x5401c2){if(_0x5401c2){return _0x5401c2[_0x613f('0x22')](_0x2aa14b)[_0x613f('0x23')](function(_0x2acfcf){return _0x2acfcf;});}return null;};}function removeEntity(_0x51f376,_0x41104e){return function(_0x33e0c6){if(_0x33e0c6){return _0x33e0c6[_0x613f('0x24')]()[_0x613f('0x23')](function(){_0x51f376[_0x613f('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30fb15,_0x204185){return function(_0x51bba1){if(!_0x51bba1){_0x30fb15[_0x613f('0x16')](0x194);}return _0x51bba1;};}function handleError(_0x5d4ff6,_0x32e747){_0x32e747=_0x32e747||0x1f4;return function(_0x4a878d){logger['error'](_0x4a878d['stack']);if(_0x4a878d[_0x613f('0x25')]){delete _0x4a878d['name'];}_0x5d4ff6[_0x613f('0x17')](_0x32e747)[_0x613f('0x26')](_0x4a878d);};}exports['index']=function(_0x121241,_0x2551c1){var _0x4c8aa1={},_0x4cff5d={},_0x4f892d={'count':0x0,'rows':[]};var _0x24be7c=_[_0x613f('0x27')](db[_0x613f('0x28')]['rawAttributes'],function(_0x23eda8){return{'name':_0x23eda8[_0x613f('0x29')],'type':_0x23eda8[_0x613f('0x2a')][_0x613f('0x2b')]};});_0x4cff5d['model']=_[_0x613f('0x27')](_0x24be7c,_0x613f('0x25'));_0x4cff5d[_0x613f('0x2c')]=_[_0x613f('0x2d')](_0x121241[_0x613f('0x2c')]);_0x4cff5d[_0x613f('0x2e')]=_['intersection'](_0x4cff5d[_0x613f('0x2f')],_0x4cff5d[_0x613f('0x2c')]);_0x4c8aa1[_0x613f('0x30')]=_['intersection'](_0x4cff5d[_0x613f('0x2f')],qs['fields'](_0x121241[_0x613f('0x2c')][_0x613f('0x31')]));_0x4c8aa1[_0x613f('0x30')]=_0x4c8aa1[_0x613f('0x30')][_0x613f('0x32')]?_0x4c8aa1[_0x613f('0x30')]:_0x4cff5d['model'];if(!_0x121241[_0x613f('0x2c')][_0x613f('0x33')](_0x613f('0x34'))){_0x4c8aa1[_0x613f('0x1a')]=qs[_0x613f('0x1a')](_0x121241['query']['limit']);_0x4c8aa1['offset']=qs[_0x613f('0x1d')](_0x121241[_0x613f('0x2c')][_0x613f('0x1d')]);}_0x4c8aa1[_0x613f('0x35')]=qs['sort'](_0x121241[_0x613f('0x2c')][_0x613f('0x36')]);_0x4c8aa1['where']=qs[_0x613f('0x2e')](_['pick'](_0x121241[_0x613f('0x2c')],_0x4cff5d['filters']),_0x24be7c);if(_0x121241[_0x613f('0x2c')]['filter']){_0x4c8aa1[_0x613f('0x37')]=_[_0x613f('0x38')](_0x4c8aa1[_0x613f('0x37')],{'$or':_['map'](_0x24be7c,function(_0x36eaa0){if(_0x36eaa0[_0x613f('0x2a')]!==_0x613f('0x39')){var _0x2fb3a6={};_0x2fb3a6[_0x36eaa0[_0x613f('0x25')]]={'$like':'%'+_0x121241[_0x613f('0x2c')][_0x613f('0x3a')]+'%'};return _0x2fb3a6;}})});}_0x4c8aa1=_[_0x613f('0x38')]({},_0x4c8aa1,_0x121241[_0x613f('0x3b')]);var _0x3313c1={'where':_0x4c8aa1['where']};return db[_0x613f('0x28')][_0x613f('0x1c')](_0x3313c1)[_0x613f('0x23')](function(_0x1e5af0){_0x4f892d[_0x613f('0x1c')]=_0x1e5af0;if(_0x121241[_0x613f('0x2c')][_0x613f('0x3c')]){_0x4c8aa1['include']=[{'all':!![]}];}return db[_0x613f('0x28')][_0x613f('0x3d')](_0x4c8aa1);})[_0x613f('0x23')](function(_0x3d2d7b){_0x4f892d[_0x613f('0x3e')]=_0x3d2d7b;return _0x4f892d;})[_0x613f('0x23')](respondWithFilteredResult(_0x2551c1,_0x4c8aa1))[_0x613f('0x3f')](handleError(_0x2551c1,null));};exports['show']=function(_0x343a59,_0x18f427){var _0x3bb605={'raw':!![],'where':{'id':_0x343a59[_0x613f('0x40')]['id']}},_0x2f584e={};_0x2f584e[_0x613f('0x2f')]=_[_0x613f('0x2d')](db[_0x613f('0x28')][_0x613f('0x41')]);_0x2f584e[_0x613f('0x2c')]=_[_0x613f('0x2d')](_0x343a59[_0x613f('0x2c')]);_0x2f584e[_0x613f('0x2e')]=_['intersection'](_0x2f584e[_0x613f('0x2f')],_0x2f584e[_0x613f('0x2c')]);_0x3bb605[_0x613f('0x30')]=_[_0x613f('0x42')](_0x2f584e['model'],qs[_0x613f('0x31')](_0x343a59[_0x613f('0x2c')][_0x613f('0x31')]));_0x3bb605[_0x613f('0x30')]=_0x3bb605[_0x613f('0x30')][_0x613f('0x32')]?_0x3bb605[_0x613f('0x30')]:_0x2f584e[_0x613f('0x2f')];if(_0x343a59[_0x613f('0x2c')][_0x613f('0x3c')]){_0x3bb605['include']=[{'all':!![]}];}_0x3bb605=_['merge']({},_0x3bb605,_0x343a59[_0x613f('0x3b')]);return db[_0x613f('0x28')]['find'](_0x3bb605)[_0x613f('0x23')](handleEntityNotFound(_0x18f427,null))[_0x613f('0x23')](respondWithResult(_0x18f427,null))[_0x613f('0x3f')](handleError(_0x18f427,null));};exports[_0x613f('0x43')]=function(_0x39b8b2,_0x1c0b07){return db[_0x613f('0x28')][_0x613f('0x43')](_0x39b8b2[_0x613f('0x44')],{})[_0x613f('0x23')](respondWithResult(_0x1c0b07,0xc9))[_0x613f('0x3f')](handleError(_0x1c0b07,null));};exports[_0x613f('0x22')]=function(_0x174e22,_0x17f8e5){if(_0x174e22[_0x613f('0x44')]['id']){delete _0x174e22[_0x613f('0x44')]['id'];}return db[_0x613f('0x28')][_0x613f('0x45')]({'where':{'id':_0x174e22['params']['id']}})['then'](handleEntityNotFound(_0x17f8e5,null))[_0x613f('0x23')](saveUpdates(_0x174e22[_0x613f('0x44')],null))['then'](respondWithResult(_0x17f8e5,null))['catch'](handleError(_0x17f8e5,null));};exports[_0x613f('0x24')]=function(_0x51729a,_0x513bf1){return db[_0x613f('0x28')][_0x613f('0x45')]({'where':{'id':_0x51729a[_0x613f('0x40')]['id']}})['then'](handleEntityNotFound(_0x513bf1,null))[_0x613f('0x23')](removeEntity(_0x513bf1,null))[_0x613f('0x3f')](handleError(_0x513bf1,null));};exports['describe']=function(_0x55e878,_0x1c0c8e){return db[_0x613f('0x28')][_0x613f('0x46')]()[_0x613f('0x23')](respondWithResult(_0x1c0c8e,null))[_0x613f('0x3f')](handleError(_0x1c0c8e,null));}; \ No newline at end of file +var _0x1c9a=['eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','WhatsappQueueReport','rawAttributes','fieldName','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','describe'];(function(_0x421446,_0x19af26){var _0x40e2a6=function(_0x254616){while(--_0x254616){_0x421446['push'](_0x421446['shift']());}};_0x40e2a6(++_0x19af26);}(_0x1c9a,0x98));var _0xa1c9=function(_0xdef90f,_0x9d4c48){_0xdef90f=_0xdef90f-0x0;var _0x3d4e1f=_0x1c9a[_0xdef90f];return _0x3d4e1f;};'use strict';var emlformat=require(_0xa1c9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa1c9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa1c9('0x2'));var moment=require(_0xa1c9('0x3'));var BPromise=require(_0xa1c9('0x4'));var Mustache=require('mustache');var util=require(_0xa1c9('0x5'));var path=require(_0xa1c9('0x6'));var sox=require(_0xa1c9('0x7'));var csv=require(_0xa1c9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa1c9('0x9'));var _=require('lodash');var squel=require(_0xa1c9('0xa'));var crypto=require(_0xa1c9('0xb'));var jsforce=require(_0xa1c9('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa1c9('0x8'));var querystring=require(_0xa1c9('0xd'));var Papa=require(_0xa1c9('0xe'));var Redis=require(_0xa1c9('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa1c9('0x10'));var as=require(_0xa1c9('0x11'));var hardwareService=require(_0xa1c9('0x12'));var logger=require(_0xa1c9('0x13'))(_0xa1c9('0x14'));var utils=require(_0xa1c9('0x15'));var config=require(_0xa1c9('0x16'));var licenseUtil=require(_0xa1c9('0x17'));var db=require(_0xa1c9('0x18'))['db'];function respondWithStatusCode(_0x17ee28,_0x57e2a8){_0x57e2a8=_0x57e2a8||0xcc;return function(_0x341233){if(_0x341233){return _0x17ee28[_0xa1c9('0x19')](_0x57e2a8);}return _0x17ee28[_0xa1c9('0x1a')](_0x57e2a8)[_0xa1c9('0x1b')]();};}function respondWithResult(_0x13f4e9,_0x4c70dd){_0x4c70dd=_0x4c70dd||0xc8;return function(_0x335dda){if(_0x335dda){return _0x13f4e9[_0xa1c9('0x1a')](_0x4c70dd)[_0xa1c9('0x1c')](_0x335dda);}};}function respondWithFilteredResult(_0xd9bca1,_0x2d825c){return function(_0x1bbc94){if(_0x1bbc94){var _0x44ab5b=typeof _0x2d825c[_0xa1c9('0x1d')]===_0xa1c9('0x1e')&&typeof _0x2d825c[_0xa1c9('0x1f')]==='undefined';var _0x11ca10=_0x1bbc94[_0xa1c9('0x20')];var _0x224ae4=_0x44ab5b?0x0:_0x2d825c['offset'];var _0x2fb81e=_0x44ab5b?_0x1bbc94['count']:_0x2d825c[_0xa1c9('0x1d')]+_0x2d825c[_0xa1c9('0x1f')];var _0x204d54;if(_0x2fb81e>=_0x11ca10){_0x2fb81e=_0x11ca10;_0x204d54=0xc8;}else{_0x204d54=0xce;}_0xd9bca1['status'](_0x204d54);return _0xd9bca1[_0xa1c9('0x21')](_0xa1c9('0x22'),_0x224ae4+'-'+_0x2fb81e+'/'+_0x11ca10)[_0xa1c9('0x1c')](_0x1bbc94);}return null;};}function patchUpdates(_0x4edf37){return function(_0x41e6d2){try{jsonpatch[_0xa1c9('0x23')](_0x41e6d2,_0x4edf37,!![]);}catch(_0x4c6dbb){return BPromise[_0xa1c9('0x24')](_0x4c6dbb);}return _0x41e6d2[_0xa1c9('0x25')]();};}function saveUpdates(_0x9f201f,_0x4d05d0){return function(_0x29f1b1){if(_0x29f1b1){return _0x29f1b1[_0xa1c9('0x26')](_0x9f201f)[_0xa1c9('0x27')](function(_0x23a461){return _0x23a461;});}return null;};}function removeEntity(_0x24a5da,_0x4a0a0c){return function(_0x50b16b){if(_0x50b16b){return _0x50b16b[_0xa1c9('0x28')]()['then'](function(){_0x24a5da[_0xa1c9('0x1a')](0xcc)[_0xa1c9('0x1b')]();});}};}function handleEntityNotFound(_0x1c6f37,_0x3059eb){return function(_0x339ed1){if(!_0x339ed1){_0x1c6f37['sendStatus'](0x194);}return _0x339ed1;};}function handleError(_0x1925e7,_0x3ca2a8){_0x3ca2a8=_0x3ca2a8||0x1f4;return function(_0x20cbe1){logger['error'](_0x20cbe1[_0xa1c9('0x29')]);if(_0x20cbe1[_0xa1c9('0x2a')]){delete _0x20cbe1[_0xa1c9('0x2a')];}_0x1925e7['status'](_0x3ca2a8)[_0xa1c9('0x2b')](_0x20cbe1);};}exports[_0xa1c9('0x2c')]=function(_0x594137,_0x38936f){var _0x48ce34={},_0xdf6d0c={},_0x2404c3={'count':0x0,'rows':[]};var _0x88ba11=_[_0xa1c9('0x2d')](db[_0xa1c9('0x2e')][_0xa1c9('0x2f')],function(_0x42fcb2){return{'name':_0x42fcb2[_0xa1c9('0x30')],'type':_0x42fcb2['type']['key']};});_0xdf6d0c[_0xa1c9('0x31')]=_[_0xa1c9('0x2d')](_0x88ba11,_0xa1c9('0x2a'));_0xdf6d0c[_0xa1c9('0x32')]=_[_0xa1c9('0x33')](_0x594137['query']);_0xdf6d0c['filters']=_['intersection'](_0xdf6d0c[_0xa1c9('0x31')],_0xdf6d0c[_0xa1c9('0x32')]);_0x48ce34[_0xa1c9('0x34')]=_[_0xa1c9('0x35')](_0xdf6d0c[_0xa1c9('0x31')],qs[_0xa1c9('0x36')](_0x594137[_0xa1c9('0x32')]['fields']));_0x48ce34[_0xa1c9('0x34')]=_0x48ce34['attributes'][_0xa1c9('0x37')]?_0x48ce34['attributes']:_0xdf6d0c[_0xa1c9('0x31')];if(!_0x594137[_0xa1c9('0x32')][_0xa1c9('0x38')]('nolimit')){_0x48ce34[_0xa1c9('0x1f')]=qs[_0xa1c9('0x1f')](_0x594137[_0xa1c9('0x32')][_0xa1c9('0x1f')]);_0x48ce34['offset']=qs['offset'](_0x594137[_0xa1c9('0x32')][_0xa1c9('0x1d')]);}_0x48ce34[_0xa1c9('0x39')]=qs[_0xa1c9('0x3a')](_0x594137[_0xa1c9('0x32')][_0xa1c9('0x3a')]);_0x48ce34[_0xa1c9('0x3b')]=qs[_0xa1c9('0x3c')](_[_0xa1c9('0x3d')](_0x594137[_0xa1c9('0x32')],_0xdf6d0c['filters']),_0x88ba11);if(_0x594137[_0xa1c9('0x32')][_0xa1c9('0x3e')]){_0x48ce34[_0xa1c9('0x3b')]=_[_0xa1c9('0x3f')](_0x48ce34[_0xa1c9('0x3b')],{'$or':_[_0xa1c9('0x2d')](_0x88ba11,function(_0x5011a3){if(_0x5011a3[_0xa1c9('0x40')]!==_0xa1c9('0x41')){var _0x29d871={};_0x29d871[_0x5011a3['name']]={'$like':'%'+_0x594137[_0xa1c9('0x32')][_0xa1c9('0x3e')]+'%'};return _0x29d871;}})});}_0x48ce34=_['merge']({},_0x48ce34,_0x594137[_0xa1c9('0x42')]);var _0x25502f={'where':_0x48ce34['where']};return db['WhatsappQueueReport'][_0xa1c9('0x20')](_0x25502f)[_0xa1c9('0x27')](function(_0x34a6b8){_0x2404c3[_0xa1c9('0x20')]=_0x34a6b8;if(_0x594137[_0xa1c9('0x32')][_0xa1c9('0x43')]){_0x48ce34[_0xa1c9('0x44')]=[{'all':!![]}];}return db[_0xa1c9('0x2e')][_0xa1c9('0x45')](_0x48ce34);})[_0xa1c9('0x27')](function(_0x5ac71f){_0x2404c3['rows']=_0x5ac71f;return _0x2404c3;})[_0xa1c9('0x27')](respondWithFilteredResult(_0x38936f,_0x48ce34))[_0xa1c9('0x46')](handleError(_0x38936f,null));};exports['show']=function(_0x30ce3b,_0x102a33){var _0x43de42={'raw':!![],'where':{'id':_0x30ce3b[_0xa1c9('0x47')]['id']}},_0x36c846={};_0x36c846[_0xa1c9('0x31')]=_[_0xa1c9('0x33')](db[_0xa1c9('0x2e')][_0xa1c9('0x2f')]);_0x36c846[_0xa1c9('0x32')]=_[_0xa1c9('0x33')](_0x30ce3b['query']);_0x36c846[_0xa1c9('0x3c')]=_['intersection'](_0x36c846[_0xa1c9('0x31')],_0x36c846['query']);_0x43de42[_0xa1c9('0x34')]=_['intersection'](_0x36c846[_0xa1c9('0x31')],qs[_0xa1c9('0x36')](_0x30ce3b['query'][_0xa1c9('0x36')]));_0x43de42[_0xa1c9('0x34')]=_0x43de42['attributes'][_0xa1c9('0x37')]?_0x43de42[_0xa1c9('0x34')]:_0x36c846[_0xa1c9('0x31')];if(_0x30ce3b[_0xa1c9('0x32')][_0xa1c9('0x43')]){_0x43de42[_0xa1c9('0x44')]=[{'all':!![]}];}_0x43de42=_['merge']({},_0x43de42,_0x30ce3b[_0xa1c9('0x42')]);return db[_0xa1c9('0x2e')][_0xa1c9('0x48')](_0x43de42)[_0xa1c9('0x27')](handleEntityNotFound(_0x102a33,null))[_0xa1c9('0x27')](respondWithResult(_0x102a33,null))['catch'](handleError(_0x102a33,null));};exports['create']=function(_0x4cf00a,_0x15329c){return db[_0xa1c9('0x2e')][_0xa1c9('0x49')](_0x4cf00a['body'],{})[_0xa1c9('0x27')](respondWithResult(_0x15329c,0xc9))[_0xa1c9('0x46')](handleError(_0x15329c,null));};exports['update']=function(_0x43ee79,_0x4bdf5d){if(_0x43ee79['body']['id']){delete _0x43ee79[_0xa1c9('0x4a')]['id'];}return db[_0xa1c9('0x2e')][_0xa1c9('0x48')]({'where':{'id':_0x43ee79[_0xa1c9('0x47')]['id']}})[_0xa1c9('0x27')](handleEntityNotFound(_0x4bdf5d,null))[_0xa1c9('0x27')](saveUpdates(_0x43ee79[_0xa1c9('0x4a')],null))[_0xa1c9('0x27')](respondWithResult(_0x4bdf5d,null))[_0xa1c9('0x46')](handleError(_0x4bdf5d,null));};exports[_0xa1c9('0x28')]=function(_0x2b2065,_0x1bed85){return db[_0xa1c9('0x2e')][_0xa1c9('0x48')]({'where':{'id':_0x2b2065[_0xa1c9('0x47')]['id']}})[_0xa1c9('0x27')](handleEntityNotFound(_0x1bed85,null))[_0xa1c9('0x27')](removeEntity(_0x1bed85,null))[_0xa1c9('0x46')](handleError(_0x1bed85,null));};exports[_0xa1c9('0x4b')]=function(_0x4a968e,_0x55dc05){return db[_0xa1c9('0x2e')][_0xa1c9('0x4b')]()[_0xa1c9('0x27')](respondWithResult(_0x55dc05,null))[_0xa1c9('0x46')](handleError(_0x55dc05,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index a200ed7..dc07f65 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 _0x4721=['../../config/environment','./whatsappQueueReport.attributes','exports','define','uniqueid','lodash','util','../../config/logger','api','request-promise'];(function(_0x57486e,_0x32283b){var _0x5f110b=function(_0xa18fc3){while(--_0xa18fc3){_0x57486e['push'](_0x57486e['shift']());}};_0x5f110b(++_0x32283b);}(_0x4721,0x127));var _0x1472=function(_0x4347ec,_0x41c4b8){_0x4347ec=_0x4347ec-0x0;var _0x4c8314=_0x4721[_0x4347ec];return _0x4c8314;};'use strict';var _=require(_0x1472('0x0'));var util=require(_0x1472('0x1'));var logger=require(_0x1472('0x2'))(_0x1472('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1472('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1472('0x5'));var attributes=require(_0x1472('0x6'));module[_0x1472('0x7')]=function(_0x23d946,_0x59ac46){return _0x23d946[_0x1472('0x8')]('WhatsappQueueReport',attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x1472('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x544f=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','WhatsappQueueReport','report_whatsapp_queue','uniqueid'];(function(_0x525d18,_0x28770d){var _0x2cb12e=function(_0x31ebea){while(--_0x31ebea){_0x525d18['push'](_0x525d18['shift']());}};_0x2cb12e(++_0x28770d);}(_0x544f,0x198));var _0xf544=function(_0x271060,_0x3f86b1){_0x271060=_0x271060-0x0;var _0x40540b=_0x544f[_0x271060];return _0x40540b;};'use strict';var _=require('lodash');var util=require(_0xf544('0x0'));var logger=require(_0xf544('0x1'))(_0xf544('0x2'));var moment=require(_0xf544('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf544('0x4'));var rimraf=require(_0xf544('0x5'));var config=require(_0xf544('0x6'));var attributes=require(_0xf544('0x7'));module[_0xf544('0x8')]=function(_0x2c81cc,_0xc43285){return _0x2c81cc['define'](_0xf544('0x9'),attributes,{'tableName':_0xf544('0xa'),'paranoid':![],'indexes':[{'name':_0xf544('0xb'),'fields':[_0xf544('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 806a4a9..042152d 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 _0x75fe=['attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateWhatsappQueueReport','body','options','raw','UpdateWhatsappQueueReport','WhatsappQueueReport','update','where'];(function(_0x463e3d,_0x277ae9){var _0x102117=function(_0xbe0beb){while(--_0xbe0beb){_0x463e3d['push'](_0x463e3d['shift']());}};_0x102117(++_0x277ae9);}(_0x75fe,0x1e2));var _0xe75f=function(_0x452a82,_0x2dc6d0){_0x452a82=_0x452a82-0x0;var _0x41f39d=_0x75fe[_0x452a82];return _0x41f39d;};'use strict';var _=require(_0xe75f('0x0'));var util=require('util');var moment=require(_0xe75f('0x1'));var BPromise=require(_0xe75f('0x2'));var rs=require(_0xe75f('0x3'));var fs=require('fs');var Redis=require(_0xe75f('0x4'));var db=require(_0xe75f('0x5'))['db'];var utils=require(_0xe75f('0x6'));var logger=require(_0xe75f('0x7'))(_0xe75f('0x8'));var config=require(_0xe75f('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe75f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e1ead,_0x1d2629,_0x329ec5){return new BPromise(function(_0x6f67ea,_0x53c403){return client[_0xe75f('0xb')](_0x4e1ead,_0x329ec5)['then'](function(_0x263c06){logger[_0xe75f('0xc')](_0xe75f('0xd'),_0x1d2629,_0xe75f('0xe'));logger[_0xe75f('0xf')](_0xe75f('0x10'),_0x1d2629,_0xe75f('0xe'),JSON[_0xe75f('0x11')](_0x263c06));if(_0x263c06[_0xe75f('0x12')]){if(_0x263c06[_0xe75f('0x12')][_0xe75f('0x13')]===0x1f4){logger[_0xe75f('0x12')](_0xe75f('0xd'),_0x1d2629,_0x263c06[_0xe75f('0x12')]['message']);return _0x53c403(_0x263c06[_0xe75f('0x12')][_0xe75f('0x14')]);}logger[_0xe75f('0x12')](_0xe75f('0xd'),_0x1d2629,_0x263c06['error']['message']);return _0x6f67ea(_0x263c06[_0xe75f('0x12')][_0xe75f('0x14')]);}else{logger[_0xe75f('0xc')](_0xe75f('0xd'),_0x1d2629,_0xe75f('0xe'));_0x6f67ea(_0x263c06['result']['message']);}})[_0xe75f('0x15')](function(_0x4471e9){logger[_0xe75f('0x12')](_0xe75f('0xd'),_0x1d2629,_0x4471e9);_0x53c403(_0x4471e9);});});}exports[_0xe75f('0x16')]=function(_0x5e3cf6){var _0x3f8ba4=this;return new Promise(function(_0x507e85,_0x2f4eb8){return db['WhatsappQueueReport']['create'](_0x5e3cf6[_0xe75f('0x17')],{'raw':_0x5e3cf6[_0xe75f('0x18')]?_0x5e3cf6[_0xe75f('0x18')][_0xe75f('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x43bdae){logger[_0xe75f('0xc')](_0xe75f('0x16'),_0x5e3cf6);logger[_0xe75f('0xf')](_0xe75f('0x16'),_0x5e3cf6,JSON['stringify'](_0x43bdae));_0x507e85(_0x43bdae);})[_0xe75f('0x15')](function(_0x7858e2){logger[_0xe75f('0x12')]('CreateWhatsappQueueReport',_0x7858e2[_0xe75f('0x14')],_0x5e3cf6);_0x2f4eb8(_0x3f8ba4[_0xe75f('0x12')](0x1f4,_0x7858e2[_0xe75f('0x14')]));});});};exports[_0xe75f('0x1a')]=function(_0x477b6d){var _0x26abf2=this;return new Promise(function(_0x1137c3,_0x552e7c){return db[_0xe75f('0x1b')][_0xe75f('0x1c')](_0x477b6d[_0xe75f('0x17')],{'raw':_0x477b6d['options']?_0x477b6d[_0xe75f('0x18')][_0xe75f('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x477b6d[_0xe75f('0x18')]?_0x477b6d[_0xe75f('0x18')][_0xe75f('0x1d')]||null:null,'attributes':_0x477b6d['options']?_0x477b6d[_0xe75f('0x18')][_0xe75f('0x1e')]||null:null,'limit':_0x477b6d[_0xe75f('0x18')]?_0x477b6d[_0xe75f('0x18')][_0xe75f('0x1f')]||null:null})['then'](function(_0x5cbf26){logger['info']('UpdateWhatsappQueueReport',_0x477b6d);logger[_0xe75f('0xf')](_0xe75f('0x1a'),_0x477b6d,JSON[_0xe75f('0x11')](_0x5cbf26));_0x1137c3(_0x5cbf26);})[_0xe75f('0x15')](function(_0x19d2c1){logger[_0xe75f('0x12')](_0xe75f('0x1a'),_0x19d2c1['message'],_0x477b6d);_0x552e7c(_0x26abf2[_0xe75f('0x12')](0x1f4,_0x19d2c1['message']));});});}; \ No newline at end of file +var _0x75cd=['catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','then','UpdateWhatsappQueueReport','where','attributes','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x418ba6,_0x4c26fe){var _0x4b5a49=function(_0x3394d0){while(--_0x3394d0){_0x418ba6['push'](_0x418ba6['shift']());}};_0x4b5a49(++_0x4c26fe);}(_0x75cd,0x83));var _0xd75c=function(_0x352784,_0x12c933){_0x352784=_0x352784-0x0;var _0xada026=_0x75cd[_0x352784];return _0xada026;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd75c('0x0'));var BPromise=require(_0xd75c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd75c('0x2'));var db=require(_0xd75c('0x3'))['db'];var utils=require(_0xd75c('0x4'));var logger=require(_0xd75c('0x5'))(_0xd75c('0x6'));var config=require('../../config/environment');var jayson=require(_0xd75c('0x7'));var client=jayson['client'][_0xd75c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x102d3b,_0x194444,_0x258d74){return new BPromise(function(_0x1f7f42,_0x1df1fb){return client['request'](_0x102d3b,_0x258d74)['then'](function(_0x229fef){logger['info'](_0xd75c('0x9'),_0x194444,_0xd75c('0xa'));logger[_0xd75c('0xb')](_0xd75c('0xc'),_0x194444,_0xd75c('0xa'),JSON[_0xd75c('0xd')](_0x229fef));if(_0x229fef['error']){if(_0x229fef[_0xd75c('0xe')][_0xd75c('0xf')]===0x1f4){logger[_0xd75c('0xe')](_0xd75c('0x9'),_0x194444,_0x229fef[_0xd75c('0xe')][_0xd75c('0x10')]);return _0x1df1fb(_0x229fef['error'][_0xd75c('0x10')]);}logger[_0xd75c('0xe')](_0xd75c('0x9'),_0x194444,_0x229fef[_0xd75c('0xe')]['message']);return _0x1f7f42(_0x229fef[_0xd75c('0xe')][_0xd75c('0x10')]);}else{logger[_0xd75c('0x11')](_0xd75c('0x9'),_0x194444,'request\x20sent');_0x1f7f42(_0x229fef[_0xd75c('0x12')][_0xd75c('0x10')]);}})[_0xd75c('0x13')](function(_0x35ee71){logger[_0xd75c('0xe')]('WhatsappQueueReport,\x20%s,\x20%s',_0x194444,_0x35ee71);_0x1df1fb(_0x35ee71);});});}exports[_0xd75c('0x14')]=function(_0x3bee62){var _0x27b9ca=this;return new Promise(function(_0x581452,_0x1db808){return db[_0xd75c('0x15')][_0xd75c('0x16')](_0x3bee62[_0xd75c('0x17')],{'raw':_0x3bee62[_0xd75c('0x18')]?_0x3bee62[_0xd75c('0x18')][_0xd75c('0x19')]===undefined?!![]:![]:!![]})[_0xd75c('0x1a')](function(_0xaca1b3){logger[_0xd75c('0x11')](_0xd75c('0x14'),_0x3bee62);logger[_0xd75c('0xb')](_0xd75c('0x14'),_0x3bee62,JSON[_0xd75c('0xd')](_0xaca1b3));_0x581452(_0xaca1b3);})['catch'](function(_0x2e9782){logger['error']('CreateWhatsappQueueReport',_0x2e9782['message'],_0x3bee62);_0x1db808(_0x27b9ca['error'](0x1f4,_0x2e9782['message']));});});};exports[_0xd75c('0x1b')]=function(_0x44f3b1){var _0x362d5b=this;return new Promise(function(_0x16e963,_0xaa9fde){return db[_0xd75c('0x15')]['update'](_0x44f3b1[_0xd75c('0x17')],{'raw':_0x44f3b1[_0xd75c('0x18')]?_0x44f3b1['options'][_0xd75c('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x44f3b1[_0xd75c('0x18')]?_0x44f3b1[_0xd75c('0x18')][_0xd75c('0x1c')]||null:null,'attributes':_0x44f3b1[_0xd75c('0x18')]?_0x44f3b1[_0xd75c('0x18')][_0xd75c('0x1d')]||null:null,'limit':_0x44f3b1[_0xd75c('0x18')]?_0x44f3b1['options']['limit']||null:null})[_0xd75c('0x1a')](function(_0x3b8247){logger['info'](_0xd75c('0x1b'),_0x44f3b1);logger['debug'](_0xd75c('0x1b'),_0x44f3b1,JSON[_0xd75c('0xd')](_0x3b8247));_0x16e963(_0x3b8247);})[_0xd75c('0x13')](function(_0x11b485){logger[_0xd75c('0xe')]('UpdateWhatsappQueueReport',_0x11b485[_0xd75c('0x10')],_0x44f3b1);_0xaa9fde(_0x362d5b[_0xd75c('0xe')](0x1f4,_0x11b485['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 9aa3010..8e81508 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 _0x3c44=['index','get','/describe','show','post','create','put','/:id','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./whatsappTransferReport.controller','isAuthenticated'];(function(_0x31c170,_0x1d5457){var _0x2b8145=function(_0x1217eb){while(--_0x1217eb){_0x31c170['push'](_0x31c170['shift']());}};_0x2b8145(++_0x1d5457);}(_0x3c44,0x10e));var _0x43c4=function(_0x5b94e5,_0x3ba92e){_0x5b94e5=_0x5b94e5-0x0;var _0x34828d=_0x3c44[_0x5b94e5];return _0x34828d;};'use strict';var multer=require(_0x43c4('0x0'));var util=require(_0x43c4('0x1'));var path=require(_0x43c4('0x2'));var timeout=require(_0x43c4('0x3'));var express=require(_0x43c4('0x4'));var router=express[_0x43c4('0x5')]();var fs_extra=require(_0x43c4('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x43c4('0x7'));var controller=require(_0x43c4('0x8'));router['get']('/',auth[_0x43c4('0x9')](),controller[_0x43c4('0xa')]);router[_0x43c4('0xb')](_0x43c4('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x43c4('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x43c4('0xd')]);router[_0x43c4('0xe')]('/',auth[_0x43c4('0x9')](),controller[_0x43c4('0xf')]);router[_0x43c4('0x10')](_0x43c4('0x11'),auth[_0x43c4('0x9')](),controller['update']);router[_0x43c4('0x12')]('/:id',auth[_0x43c4('0x9')](),controller[_0x43c4('0x13')]);module['exports']=router; \ No newline at end of file +var _0x491c=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','isAuthenticated','index','/describe','/:id','show','post','create','update','delete','destroy','multer','connect-timeout'];(function(_0x4da0d5,_0x321a2f){var _0x462021=function(_0x14ffdf){while(--_0x14ffdf){_0x4da0d5['push'](_0x4da0d5['shift']());}};_0x462021(++_0x321a2f);}(_0x491c,0x19c));var _0xc491=function(_0x2b0997,_0x2bcb81){_0x2b0997=_0x2b0997-0x0;var _0x4af610=_0x491c[_0x2b0997];return _0x4af610;};'use strict';var multer=require(_0xc491('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc491('0x1'));var express=require(_0xc491('0x2'));var router=express[_0xc491('0x3')]();var fs_extra=require(_0xc491('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc491('0x5'));var config=require(_0xc491('0x6'));var controller=require(_0xc491('0x7'));router['get']('/',auth[_0xc491('0x8')](),controller[_0xc491('0x9')]);router['get'](_0xc491('0xa'),auth[_0xc491('0x8')](),controller['describe']);router['get'](_0xc491('0xb'),auth[_0xc491('0x8')](),controller[_0xc491('0xc')]);router[_0xc491('0xd')]('/',auth[_0xc491('0x8')](),controller[_0xc491('0xe')]);router['put'](_0xc491('0xb'),auth[_0xc491('0x8')](),controller[_0xc491('0xf')]);router[_0xc491('0x10')](_0xc491('0xb'),auth[_0xc491('0x8')](),controller[_0xc491('0x11')]);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 b07a96b..76f67ee 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 _0xc664=['account','agent','queue','DATE','sequelize','exports','ENUM'];(function(_0x3cf8ea,_0x5bca8a){var _0x44812a=function(_0x1d4a10){while(--_0x1d4a10){_0x3cf8ea['push'](_0x3cf8ea['shift']());}};_0x44812a(++_0x5bca8a);}(_0xc664,0x90));var _0x4c66=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc664[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x4c66('0x0'));module[_0x4c66('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x4c66('0x2')](_0x4c66('0x3'),_0x4c66('0x4'),_0x4c66('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x4c66('0x6')]}}; \ No newline at end of file +var _0xb240=['STRING','ENUM','account','agent','queue','DATE','sequelize','exports'];(function(_0x309b09,_0xe4c181){var _0x7b38d7=function(_0x3c2277){while(--_0x3c2277){_0x309b09['push'](_0x309b09['shift']());}};_0x7b38d7(++_0xe4c181);}(_0xb240,0x7e));var _0x0b24=function(_0x25f199,_0x4098ad){_0x25f199=_0x25f199-0x0;var _0x29aeda=_0xb240[_0x25f199];return _0x29aeda;};'use strict';var Sequelize=require(_0x0b24('0x0'));module[_0x0b24('0x1')]={'uniqueid':{'type':Sequelize[_0x0b24('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x0b24('0x3')](_0x0b24('0x4'),_0x0b24('0x5'),_0x0b24('0x6')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x0b24('0x7')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 3c867ac..60572af 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 _0xd946=['includeAll','catch','create','body','find','describe','eml-format','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','sendStatus','error','name','send','index','map','WhatsappTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','show','params'];(function(_0x2706e8,_0x334799){var _0xdfc8f=function(_0x3a205d){while(--_0x3a205d){_0x2706e8['push'](_0x2706e8['shift']());}};_0xdfc8f(++_0x334799);}(_0xd946,0x98));var _0x6d94=function(_0x5de32e,_0x4dd2ba){_0x5de32e=_0x5de32e-0x0;var _0x3a4076=_0xd946[_0x5de32e];return _0x3a4076;};'use strict';var emlformat=require(_0x6d94('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6d94('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6d94('0x2'));var BPromise=require(_0x6d94('0x3'));var Mustache=require(_0x6d94('0x4'));var util=require(_0x6d94('0x5'));var path=require(_0x6d94('0x6'));var sox=require('sox');var csv=require(_0x6d94('0x7'));var ejs=require(_0x6d94('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x6d94('0x9'));var jsforce=require(_0x6d94('0xa'));var deskjs=require(_0x6d94('0xb'));var toCsv=require(_0x6d94('0x7'));var querystring=require('querystring');var Papa=require(_0x6d94('0xc'));var Redis=require(_0x6d94('0xd'));var authService=require(_0x6d94('0xe'));var qs=require(_0x6d94('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6d94('0x10'));var logger=require(_0x6d94('0x11'))(_0x6d94('0x12'));var utils=require(_0x6d94('0x13'));var config=require(_0x6d94('0x14'));var licenseUtil=require(_0x6d94('0x15'));var db=require(_0x6d94('0x16'))['db'];function respondWithStatusCode(_0xa7b75d,_0x24201f){_0x24201f=_0x24201f||0xcc;return function(_0x11b48c){if(_0x11b48c){return _0xa7b75d['sendStatus'](_0x24201f);}return _0xa7b75d[_0x6d94('0x17')](_0x24201f)[_0x6d94('0x18')]();};}function respondWithResult(_0x521932,_0x10a800){_0x10a800=_0x10a800||0xc8;return function(_0x1d703f){if(_0x1d703f){return _0x521932[_0x6d94('0x17')](_0x10a800)[_0x6d94('0x19')](_0x1d703f);}};}function respondWithFilteredResult(_0x1acb80,_0xe33ef7){return function(_0x64b519){if(_0x64b519){var _0xb647f3=typeof _0xe33ef7[_0x6d94('0x1a')]===_0x6d94('0x1b')&&typeof _0xe33ef7[_0x6d94('0x1c')]===_0x6d94('0x1b');var _0x4ec921=_0x64b519[_0x6d94('0x1d')];var _0x5f1f0e=_0xb647f3?0x0:_0xe33ef7[_0x6d94('0x1a')];var _0x462fce=_0xb647f3?_0x64b519[_0x6d94('0x1d')]:_0xe33ef7['offset']+_0xe33ef7['limit'];var _0x2f8c08;if(_0x462fce>=_0x4ec921){_0x462fce=_0x4ec921;_0x2f8c08=0xc8;}else{_0x2f8c08=0xce;}_0x1acb80['status'](_0x2f8c08);return _0x1acb80[_0x6d94('0x1e')](_0x6d94('0x1f'),_0x5f1f0e+'-'+_0x462fce+'/'+_0x4ec921)[_0x6d94('0x19')](_0x64b519);}return null;};}function patchUpdates(_0x763dd2){return function(_0x547521){try{jsonpatch['apply'](_0x547521,_0x763dd2,!![]);}catch(_0x2308fb){return BPromise[_0x6d94('0x20')](_0x2308fb);}return _0x547521[_0x6d94('0x21')]();};}function saveUpdates(_0x9c3ff8,_0x2edd5c){return function(_0x31885f){if(_0x31885f){return _0x31885f['update'](_0x9c3ff8)[_0x6d94('0x22')](function(_0x1471b0){return _0x1471b0;});}return null;};}function removeEntity(_0x154030,_0xf224d6){return function(_0x1c55d8){if(_0x1c55d8){return _0x1c55d8[_0x6d94('0x23')]()['then'](function(){_0x154030['status'](0xcc)[_0x6d94('0x18')]();});}};}function handleEntityNotFound(_0x19c61a,_0x3a5289){return function(_0x17d037){if(!_0x17d037){_0x19c61a[_0x6d94('0x24')](0x194);}return _0x17d037;};}function handleError(_0x49321b,_0x17f559){_0x17f559=_0x17f559||0x1f4;return function(_0x339778){logger[_0x6d94('0x25')](_0x339778['stack']);if(_0x339778[_0x6d94('0x26')]){delete _0x339778[_0x6d94('0x26')];}_0x49321b[_0x6d94('0x17')](_0x17f559)[_0x6d94('0x27')](_0x339778);};}exports[_0x6d94('0x28')]=function(_0x316f71,_0x429cd9){var _0x5b8780={},_0x406aa3={},_0x29207a={'count':0x0,'rows':[]};var _0x152891=_[_0x6d94('0x29')](db[_0x6d94('0x2a')][_0x6d94('0x2b')],function(_0x40182a){return{'name':_0x40182a[_0x6d94('0x2c')],'type':_0x40182a[_0x6d94('0x2d')]['key']};});_0x406aa3[_0x6d94('0x2e')]=_[_0x6d94('0x29')](_0x152891,'name');_0x406aa3[_0x6d94('0x2f')]=_[_0x6d94('0x30')](_0x316f71['query']);_0x406aa3[_0x6d94('0x31')]=_['intersection'](_0x406aa3['model'],_0x406aa3[_0x6d94('0x2f')]);_0x5b8780[_0x6d94('0x32')]=_[_0x6d94('0x33')](_0x406aa3[_0x6d94('0x2e')],qs[_0x6d94('0x34')](_0x316f71[_0x6d94('0x2f')]['fields']));_0x5b8780['attributes']=_0x5b8780['attributes'][_0x6d94('0x35')]?_0x5b8780['attributes']:_0x406aa3[_0x6d94('0x2e')];if(!_0x316f71[_0x6d94('0x2f')][_0x6d94('0x36')](_0x6d94('0x37'))){_0x5b8780[_0x6d94('0x1c')]=qs[_0x6d94('0x1c')](_0x316f71[_0x6d94('0x2f')][_0x6d94('0x1c')]);_0x5b8780[_0x6d94('0x1a')]=qs[_0x6d94('0x1a')](_0x316f71['query'][_0x6d94('0x1a')]);}_0x5b8780[_0x6d94('0x38')]=qs[_0x6d94('0x39')](_0x316f71[_0x6d94('0x2f')][_0x6d94('0x39')]);_0x5b8780[_0x6d94('0x3a')]=qs[_0x6d94('0x31')](_[_0x6d94('0x3b')](_0x316f71[_0x6d94('0x2f')],_0x406aa3['filters']),_0x152891);if(_0x316f71[_0x6d94('0x2f')][_0x6d94('0x3c')]){_0x5b8780['where']=_[_0x6d94('0x3d')](_0x5b8780[_0x6d94('0x3a')],{'$or':_[_0x6d94('0x29')](_0x152891,function(_0xe7e9d){if(_0xe7e9d[_0x6d94('0x2d')]!=='VIRTUAL'){var _0x4c22ff={};_0x4c22ff[_0xe7e9d['name']]={'$like':'%'+_0x316f71[_0x6d94('0x2f')]['filter']+'%'};return _0x4c22ff;}})});}_0x5b8780=_[_0x6d94('0x3d')]({},_0x5b8780,_0x316f71[_0x6d94('0x3e')]);var _0x62eeb7={'where':_0x5b8780['where']};return db[_0x6d94('0x2a')][_0x6d94('0x1d')](_0x62eeb7)[_0x6d94('0x22')](function(_0x3aba98){_0x29207a[_0x6d94('0x1d')]=_0x3aba98;if(_0x316f71[_0x6d94('0x2f')]['includeAll']){_0x5b8780[_0x6d94('0x3f')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0x6d94('0x40')](_0x5b8780);})[_0x6d94('0x22')](function(_0x4d4d88){_0x29207a['rows']=_0x4d4d88;return _0x29207a;})[_0x6d94('0x22')](respondWithFilteredResult(_0x429cd9,_0x5b8780))['catch'](handleError(_0x429cd9,null));};exports[_0x6d94('0x41')]=function(_0x2478c5,_0x12fd7b){var _0x13dbd8={'raw':!![],'where':{'id':_0x2478c5[_0x6d94('0x42')]['id']}},_0x1886a7={};_0x1886a7[_0x6d94('0x2e')]=_[_0x6d94('0x30')](db[_0x6d94('0x2a')][_0x6d94('0x2b')]);_0x1886a7[_0x6d94('0x2f')]=_['keys'](_0x2478c5['query']);_0x1886a7[_0x6d94('0x31')]=_[_0x6d94('0x33')](_0x1886a7[_0x6d94('0x2e')],_0x1886a7[_0x6d94('0x2f')]);_0x13dbd8[_0x6d94('0x32')]=_[_0x6d94('0x33')](_0x1886a7[_0x6d94('0x2e')],qs[_0x6d94('0x34')](_0x2478c5[_0x6d94('0x2f')][_0x6d94('0x34')]));_0x13dbd8[_0x6d94('0x32')]=_0x13dbd8['attributes'][_0x6d94('0x35')]?_0x13dbd8[_0x6d94('0x32')]:_0x1886a7[_0x6d94('0x2e')];if(_0x2478c5[_0x6d94('0x2f')][_0x6d94('0x43')]){_0x13dbd8[_0x6d94('0x3f')]=[{'all':!![]}];}_0x13dbd8=_[_0x6d94('0x3d')]({},_0x13dbd8,_0x2478c5['options']);return db[_0x6d94('0x2a')]['find'](_0x13dbd8)[_0x6d94('0x22')](handleEntityNotFound(_0x12fd7b,null))[_0x6d94('0x22')](respondWithResult(_0x12fd7b,null))[_0x6d94('0x44')](handleError(_0x12fd7b,null));};exports[_0x6d94('0x45')]=function(_0x177b7f,_0x759a8c){return db[_0x6d94('0x2a')][_0x6d94('0x45')](_0x177b7f[_0x6d94('0x46')],{})[_0x6d94('0x22')](respondWithResult(_0x759a8c,0xc9))['catch'](handleError(_0x759a8c,null));};exports['update']=function(_0x462eaa,_0x169b98){if(_0x462eaa[_0x6d94('0x46')]['id']){delete _0x462eaa[_0x6d94('0x46')]['id'];}return db[_0x6d94('0x2a')][_0x6d94('0x47')]({'where':{'id':_0x462eaa['params']['id']}})['then'](handleEntityNotFound(_0x169b98,null))[_0x6d94('0x22')](saveUpdates(_0x462eaa[_0x6d94('0x46')],null))[_0x6d94('0x22')](respondWithResult(_0x169b98,null))[_0x6d94('0x44')](handleError(_0x169b98,null));};exports[_0x6d94('0x23')]=function(_0x3dac10,_0x4c442b){return db[_0x6d94('0x2a')][_0x6d94('0x47')]({'where':{'id':_0x3dac10[_0x6d94('0x42')]['id']}})['then'](handleEntityNotFound(_0x4c442b,null))[_0x6d94('0x22')](removeEntity(_0x4c442b,null))[_0x6d94('0x44')](handleError(_0x4c442b,null));};exports[_0x6d94('0x48')]=function(_0x2b121e,_0x1b2717){return db['WhatsappTransferReport'][_0x6d94('0x48')]()[_0x6d94('0x22')](respondWithResult(_0x1b2717,null))[_0x6d94('0x44')](handleError(_0x1b2717,null));}; \ No newline at end of file +var _0xce62=['desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','name','send','WhatsappTransferReport','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce'];(function(_0xa7b03c,_0xbd313){var _0x4faafb=function(_0x32ded1){while(--_0x32ded1){_0xa7b03c['push'](_0xa7b03c['shift']());}};_0x4faafb(++_0xbd313);}(_0xce62,0x83));var _0x2ce6=function(_0x3e0b93,_0x540d89){_0x3e0b93=_0x3e0b93-0x0;var _0x21532a=_0xce62[_0x3e0b93];return _0x21532a;};'use strict';var emlformat=require(_0x2ce6('0x0'));var rimraf=require(_0x2ce6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2ce6('0x2'));var rp=require(_0x2ce6('0x3'));var moment=require(_0x2ce6('0x4'));var BPromise=require(_0x2ce6('0x5'));var Mustache=require(_0x2ce6('0x6'));var util=require(_0x2ce6('0x7'));var path=require('path');var sox=require(_0x2ce6('0x8'));var csv=require(_0x2ce6('0x9'));var ejs=require(_0x2ce6('0xa'));var fs=require('fs');var fs_extra=require(_0x2ce6('0xb'));var _=require(_0x2ce6('0xc'));var squel=require(_0x2ce6('0xd'));var crypto=require('crypto');var jsforce=require(_0x2ce6('0xe'));var deskjs=require(_0x2ce6('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2ce6('0x10'));var Papa=require(_0x2ce6('0x11'));var Redis=require(_0x2ce6('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x2ce6('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2ce6('0x14'))('api');var utils=require(_0x2ce6('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2ce6('0x16'));var db=require(_0x2ce6('0x17'))['db'];function respondWithStatusCode(_0x225f16,_0x2479b2){_0x2479b2=_0x2479b2||0xcc;return function(_0xc50d0d){if(_0xc50d0d){return _0x225f16[_0x2ce6('0x18')](_0x2479b2);}return _0x225f16[_0x2ce6('0x19')](_0x2479b2)[_0x2ce6('0x1a')]();};}function respondWithResult(_0x5d6d69,_0x4517c4){_0x4517c4=_0x4517c4||0xc8;return function(_0x5b06c1){if(_0x5b06c1){return _0x5d6d69[_0x2ce6('0x19')](_0x4517c4)[_0x2ce6('0x1b')](_0x5b06c1);}};}function respondWithFilteredResult(_0x157e52,_0x5dec62){return function(_0x312a6e){if(_0x312a6e){var _0x109981=typeof _0x5dec62[_0x2ce6('0x1c')]===_0x2ce6('0x1d')&&typeof _0x5dec62[_0x2ce6('0x1e')]===_0x2ce6('0x1d');var _0x23a707=_0x312a6e[_0x2ce6('0x1f')];var _0x353894=_0x109981?0x0:_0x5dec62[_0x2ce6('0x1c')];var _0x4f9ceb=_0x109981?_0x312a6e[_0x2ce6('0x1f')]:_0x5dec62[_0x2ce6('0x1c')]+_0x5dec62[_0x2ce6('0x1e')];var _0x54e172;if(_0x4f9ceb>=_0x23a707){_0x4f9ceb=_0x23a707;_0x54e172=0xc8;}else{_0x54e172=0xce;}_0x157e52[_0x2ce6('0x19')](_0x54e172);return _0x157e52[_0x2ce6('0x20')](_0x2ce6('0x21'),_0x353894+'-'+_0x4f9ceb+'/'+_0x23a707)[_0x2ce6('0x1b')](_0x312a6e);}return null;};}function patchUpdates(_0x3b55c0){return function(_0x593672){try{jsonpatch[_0x2ce6('0x22')](_0x593672,_0x3b55c0,!![]);}catch(_0x4947d7){return BPromise['reject'](_0x4947d7);}return _0x593672[_0x2ce6('0x23')]();};}function saveUpdates(_0x2b80bd,_0x30a221){return function(_0x4f84b2){if(_0x4f84b2){return _0x4f84b2[_0x2ce6('0x24')](_0x2b80bd)[_0x2ce6('0x25')](function(_0x1e11b1){return _0x1e11b1;});}return null;};}function removeEntity(_0x437864,_0x5a4656){return function(_0x37536a){if(_0x37536a){return _0x37536a[_0x2ce6('0x26')]()[_0x2ce6('0x25')](function(){_0x437864[_0x2ce6('0x19')](0xcc)[_0x2ce6('0x1a')]();});}};}function handleEntityNotFound(_0x366ada,_0x14c642){return function(_0x52d520){if(!_0x52d520){_0x366ada['sendStatus'](0x194);}return _0x52d520;};}function handleError(_0x4eb918,_0x22bf7b){_0x22bf7b=_0x22bf7b||0x1f4;return function(_0x2df836){logger['error'](_0x2df836['stack']);if(_0x2df836[_0x2ce6('0x27')]){delete _0x2df836[_0x2ce6('0x27')];}_0x4eb918[_0x2ce6('0x19')](_0x22bf7b)[_0x2ce6('0x28')](_0x2df836);};}exports['index']=function(_0x481cd2,_0x909ada){var _0xa78201={},_0x2fd596={},_0x55308c={'count':0x0,'rows':[]};var _0x541a2d=_['map'](db[_0x2ce6('0x29')]['rawAttributes'],function(_0x17047f){return{'name':_0x17047f[_0x2ce6('0x2a')],'type':_0x17047f[_0x2ce6('0x2b')][_0x2ce6('0x2c')]};});_0x2fd596[_0x2ce6('0x2d')]=_['map'](_0x541a2d,_0x2ce6('0x27'));_0x2fd596[_0x2ce6('0x2e')]=_[_0x2ce6('0x2f')](_0x481cd2[_0x2ce6('0x2e')]);_0x2fd596['filters']=_[_0x2ce6('0x30')](_0x2fd596[_0x2ce6('0x2d')],_0x2fd596[_0x2ce6('0x2e')]);_0xa78201['attributes']=_[_0x2ce6('0x30')](_0x2fd596[_0x2ce6('0x2d')],qs[_0x2ce6('0x31')](_0x481cd2[_0x2ce6('0x2e')][_0x2ce6('0x31')]));_0xa78201[_0x2ce6('0x32')]=_0xa78201['attributes'][_0x2ce6('0x33')]?_0xa78201['attributes']:_0x2fd596['model'];if(!_0x481cd2['query'][_0x2ce6('0x34')](_0x2ce6('0x35'))){_0xa78201[_0x2ce6('0x1e')]=qs[_0x2ce6('0x1e')](_0x481cd2[_0x2ce6('0x2e')][_0x2ce6('0x1e')]);_0xa78201[_0x2ce6('0x1c')]=qs[_0x2ce6('0x1c')](_0x481cd2[_0x2ce6('0x2e')][_0x2ce6('0x1c')]);}_0xa78201[_0x2ce6('0x36')]=qs[_0x2ce6('0x37')](_0x481cd2[_0x2ce6('0x2e')][_0x2ce6('0x37')]);_0xa78201[_0x2ce6('0x38')]=qs[_0x2ce6('0x39')](_['pick'](_0x481cd2[_0x2ce6('0x2e')],_0x2fd596[_0x2ce6('0x39')]),_0x541a2d);if(_0x481cd2[_0x2ce6('0x2e')][_0x2ce6('0x3a')]){_0xa78201['where']=_[_0x2ce6('0x3b')](_0xa78201['where'],{'$or':_[_0x2ce6('0x3c')](_0x541a2d,function(_0x409a36){if(_0x409a36[_0x2ce6('0x2b')]!==_0x2ce6('0x3d')){var _0x15c1a5={};_0x15c1a5[_0x409a36[_0x2ce6('0x27')]]={'$like':'%'+_0x481cd2[_0x2ce6('0x2e')]['filter']+'%'};return _0x15c1a5;}})});}_0xa78201=_['merge']({},_0xa78201,_0x481cd2[_0x2ce6('0x3e')]);var _0x10f398={'where':_0xa78201['where']};return db['WhatsappTransferReport'][_0x2ce6('0x1f')](_0x10f398)[_0x2ce6('0x25')](function(_0x5b74e4){_0x55308c[_0x2ce6('0x1f')]=_0x5b74e4;if(_0x481cd2['query'][_0x2ce6('0x3f')]){_0xa78201[_0x2ce6('0x40')]=[{'all':!![]}];}return db[_0x2ce6('0x29')][_0x2ce6('0x41')](_0xa78201);})[_0x2ce6('0x25')](function(_0x369bca){_0x55308c[_0x2ce6('0x42')]=_0x369bca;return _0x55308c;})[_0x2ce6('0x25')](respondWithFilteredResult(_0x909ada,_0xa78201))[_0x2ce6('0x43')](handleError(_0x909ada,null));};exports['show']=function(_0x5d9cf2,_0x757ff9){var _0x41fe90={'raw':!![],'where':{'id':_0x5d9cf2['params']['id']}},_0x471f91={};_0x471f91[_0x2ce6('0x2d')]=_['keys'](db[_0x2ce6('0x29')]['rawAttributes']);_0x471f91[_0x2ce6('0x2e')]=_[_0x2ce6('0x2f')](_0x5d9cf2[_0x2ce6('0x2e')]);_0x471f91[_0x2ce6('0x39')]=_[_0x2ce6('0x30')](_0x471f91['model'],_0x471f91['query']);_0x41fe90[_0x2ce6('0x32')]=_[_0x2ce6('0x30')](_0x471f91[_0x2ce6('0x2d')],qs[_0x2ce6('0x31')](_0x5d9cf2[_0x2ce6('0x2e')][_0x2ce6('0x31')]));_0x41fe90[_0x2ce6('0x32')]=_0x41fe90['attributes'][_0x2ce6('0x33')]?_0x41fe90[_0x2ce6('0x32')]:_0x471f91[_0x2ce6('0x2d')];if(_0x5d9cf2[_0x2ce6('0x2e')]['includeAll']){_0x41fe90[_0x2ce6('0x40')]=[{'all':!![]}];}_0x41fe90=_[_0x2ce6('0x3b')]({},_0x41fe90,_0x5d9cf2[_0x2ce6('0x3e')]);return db[_0x2ce6('0x29')][_0x2ce6('0x44')](_0x41fe90)[_0x2ce6('0x25')](handleEntityNotFound(_0x757ff9,null))[_0x2ce6('0x25')](respondWithResult(_0x757ff9,null))['catch'](handleError(_0x757ff9,null));};exports[_0x2ce6('0x45')]=function(_0x26df8c,_0x5b8826){return db[_0x2ce6('0x29')][_0x2ce6('0x45')](_0x26df8c[_0x2ce6('0x46')],{})[_0x2ce6('0x25')](respondWithResult(_0x5b8826,0xc9))[_0x2ce6('0x43')](handleError(_0x5b8826,null));};exports[_0x2ce6('0x24')]=function(_0x2df960,_0x77449e){if(_0x2df960['body']['id']){delete _0x2df960[_0x2ce6('0x46')]['id'];}return db[_0x2ce6('0x29')][_0x2ce6('0x44')]({'where':{'id':_0x2df960['params']['id']}})[_0x2ce6('0x25')](handleEntityNotFound(_0x77449e,null))[_0x2ce6('0x25')](saveUpdates(_0x2df960[_0x2ce6('0x46')],null))[_0x2ce6('0x25')](respondWithResult(_0x77449e,null))[_0x2ce6('0x43')](handleError(_0x77449e,null));};exports['destroy']=function(_0x5151c2,_0x28efa9){return db[_0x2ce6('0x29')][_0x2ce6('0x44')]({'where':{'id':_0x5151c2[_0x2ce6('0x47')]['id']}})[_0x2ce6('0x25')](handleEntityNotFound(_0x28efa9,null))[_0x2ce6('0x25')](removeEntity(_0x28efa9,null))['catch'](handleError(_0x28efa9,null));};exports[_0x2ce6('0x48')]=function(_0x35f40a,_0x540488){return db[_0x2ce6('0x29')][_0x2ce6('0x48')]()[_0x2ce6('0x25')](respondWithResult(_0x540488,null))[_0x2ce6('0x43')](handleError(_0x540488,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 3127016..727b5c4 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 _0xaed1=['WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','define'];(function(_0x3fb150,_0x5e32ed){var _0x56f4a8=function(_0x57924c){while(--_0x57924c){_0x3fb150['push'](_0x3fb150['shift']());}};_0x56f4a8(++_0x5e32ed);}(_0xaed1,0x158));var _0x1aed=function(_0x7ce8a5,_0xa18e08){_0x7ce8a5=_0x7ce8a5-0x0;var _0x42d2f5=_0xaed1[_0x7ce8a5];return _0x42d2f5;};'use strict';var _=require(_0x1aed('0x0'));var util=require('util');var logger=require(_0x1aed('0x1'))(_0x1aed('0x2'));var moment=require(_0x1aed('0x3'));var BPromise=require(_0x1aed('0x4'));var rp=require(_0x1aed('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1aed('0x6'));var attributes=require('./whatsappTransferReport.attributes');module['exports']=function(_0x11c14a,_0x5d439b){return _0x11c14a[_0x1aed('0x7')](_0x1aed('0x8'),attributes,{'tableName':_0x1aed('0x9'),'paranoid':![],'indexes':[{'name':_0x1aed('0xa'),'fields':[_0x1aed('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb07c=['define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','util','../../config/logger','api','request-promise','path','../../config/environment','./whatsappTransferReport.attributes'];(function(_0x63ad57,_0x4f865c){var _0x108db3=function(_0x15876c){while(--_0x15876c){_0x63ad57['push'](_0x63ad57['shift']());}};_0x108db3(++_0x4f865c);}(_0xb07c,0x1d2));var _0xcb07=function(_0x214680,_0x45bb74){_0x214680=_0x214680-0x0;var _0x507da9=_0xb07c[_0x214680];return _0x507da9;};'use strict';var _=require('lodash');var util=require(_0xcb07('0x0'));var logger=require(_0xcb07('0x1'))(_0xcb07('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcb07('0x3'));var fs=require('fs');var path=require(_0xcb07('0x4'));var rimraf=require('rimraf');var config=require(_0xcb07('0x5'));var attributes=require(_0xcb07('0x6'));module['exports']=function(_0x41fc92,_0x3398b9){return _0x41fc92[_0xcb07('0x7')](_0xcb07('0x8'),attributes,{'tableName':_0xcb07('0x9'),'paranoid':![],'indexes':[{'name':_0xcb07('0xa'),'fields':[_0xcb07('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index e7fbc2b..4bf90d1 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 _0xda66=['jayson/promise','client','http','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../config/utils','../../config/environment'];(function(_0x38da07,_0x2cb1fd){var _0x2fbc23=function(_0x145458){while(--_0x145458){_0x38da07['push'](_0x38da07['shift']());}};_0x2fbc23(++_0x2cb1fd);}(_0xda66,0x176));var _0x6da6=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xda66[_0x32d457];return _0x338386;};'use strict';var _=require(_0x6da6('0x0'));var util=require(_0x6da6('0x1'));var moment=require(_0x6da6('0x2'));var BPromise=require('bluebird');var rs=require(_0x6da6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6da6('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x6da6('0x5'));var jayson=require(_0x6da6('0x6'));var client=jayson[_0x6da6('0x7')][_0x6da6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x300b52,_0x16008d,_0x48a957){return new BPromise(function(_0x878b2,_0x3bad1a){return client['request'](_0x300b52,_0x48a957)[_0x6da6('0x9')](function(_0x2c5514){logger[_0x6da6('0xa')](_0x6da6('0xb'),_0x16008d,_0x6da6('0xc'));logger['debug'](_0x6da6('0xd'),_0x16008d,_0x6da6('0xc'),JSON[_0x6da6('0xe')](_0x2c5514));if(_0x2c5514[_0x6da6('0xf')]){if(_0x2c5514[_0x6da6('0xf')][_0x6da6('0x10')]===0x1f4){logger[_0x6da6('0xf')](_0x6da6('0xb'),_0x16008d,_0x2c5514[_0x6da6('0xf')][_0x6da6('0x11')]);return _0x3bad1a(_0x2c5514['error']['message']);}logger[_0x6da6('0xf')](_0x6da6('0xb'),_0x16008d,_0x2c5514[_0x6da6('0xf')][_0x6da6('0x11')]);return _0x878b2(_0x2c5514[_0x6da6('0xf')]['message']);}else{logger[_0x6da6('0xa')]('WhatsappTransferReport,\x20%s,\x20%s',_0x16008d,_0x6da6('0xc'));_0x878b2(_0x2c5514[_0x6da6('0x12')][_0x6da6('0x11')]);}})[_0x6da6('0x13')](function(_0x521f52){logger[_0x6da6('0xf')]('WhatsappTransferReport,\x20%s,\x20%s',_0x16008d,_0x521f52);_0x3bad1a(_0x521f52);});});} \ No newline at end of file +var _0x2be3=['request','then','WhatsappTransferReport,\x20%s,\x20%s','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http'];(function(_0x331fbf,_0x3ae8ff){var _0x44c7b7=function(_0x50ecbd){while(--_0x50ecbd){_0x331fbf['push'](_0x331fbf['shift']());}};_0x44c7b7(++_0x3ae8ff);}(_0x2be3,0x1da));var _0x32be=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x2be3[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x32be('0x0'));var util=require(_0x32be('0x1'));var moment=require(_0x32be('0x2'));var BPromise=require(_0x32be('0x3'));var rs=require(_0x32be('0x4'));var fs=require('fs');var Redis=require(_0x32be('0x5'));var db=require(_0x32be('0x6'))['db'];var utils=require(_0x32be('0x7'));var logger=require('../../config/logger')(_0x32be('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x32be('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x914270,_0x1aea50,_0x1c0ec2){return new BPromise(function(_0x54d97,_0x5770be){return client[_0x32be('0xa')](_0x914270,_0x1c0ec2)[_0x32be('0xb')](function(_0x13d2a3){logger['info'](_0x32be('0xc'),_0x1aea50,'request\x20sent');logger[_0x32be('0xd')](_0x32be('0xe'),_0x1aea50,'request\x20sent',JSON[_0x32be('0xf')](_0x13d2a3));if(_0x13d2a3[_0x32be('0x10')]){if(_0x13d2a3[_0x32be('0x10')][_0x32be('0x11')]===0x1f4){logger[_0x32be('0x10')](_0x32be('0xc'),_0x1aea50,_0x13d2a3[_0x32be('0x10')][_0x32be('0x12')]);return _0x5770be(_0x13d2a3[_0x32be('0x10')][_0x32be('0x12')]);}logger[_0x32be('0x10')](_0x32be('0xc'),_0x1aea50,_0x13d2a3[_0x32be('0x10')][_0x32be('0x12')]);return _0x54d97(_0x13d2a3[_0x32be('0x10')][_0x32be('0x12')]);}else{logger[_0x32be('0x13')](_0x32be('0xc'),_0x1aea50,_0x32be('0x14'));_0x54d97(_0x13d2a3[_0x32be('0x15')][_0x32be('0x12')]);}})['catch'](function(_0x13ca6c){logger[_0x32be('0x10')]('WhatsappTransferReport,\x20%s,\x20%s',_0x1aea50,_0x13ca6c);_0x5770be(_0x13ca6c);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index cfd0b55..e84a9dc 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb458=['\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','online','Offline\x20apps:','status','log','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/seedDB','./config/environment','./config/logger','app','./config/pm2','./config/schedule','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','then','default','listen','info','start','filter','exitCode','number','length'];(function(_0x57c8a8,_0x3704e6){var _0x119d58=function(_0x21463b){while(--_0x21463b){_0x57c8a8['push'](_0x57c8a8['shift']());}};_0x119d58(++_0x3704e6);}(_0xb458,0x103));var _0x8b45=function(_0x10e74e,_0x1603ae){_0x10e74e=_0x10e74e-0x0;var _0x2198c1=_0xb458[_0x10e74e];return _0x2198c1;};'use strict';var _=require(_0x8b45('0x0'));var db=require(_0x8b45('0x1'))['db'];var seedDb=require(_0x8b45('0x2'));var checkLicense=require('./config/license');var rpc=require('./rpc');var config=require(_0x8b45('0x3'));var logger=require(_0x8b45('0x4'))(_0x8b45('0x5'));var pm2=require(_0x8b45('0x6'));var pm2Config=require('./config/pm2/config');var schedule=require(_0x8b45('0x7'));var chat=require('./config/schedule/chat');var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x8b45('0x8'));var provider=require(_0x8b45('0x9'));function main(){return db[_0x8b45('0xa')][_0x8b45('0xb')]()[_0x8b45('0xc')](function(){if(config['seedDB']){return seedDb[_0x8b45('0xd')]();}})[_0x8b45('0xc')](function(){return checkLicense[_0x8b45('0xd')]();})[_0x8b45('0xc')](function(){return rpc[_0x8b45('0xe')]();})['then'](function(_0x2a4c83){logger[_0x8b45('0xf')](_0x2a4c83);return chat['start']();})['then'](function(){return whatsapp['start']();})['then'](function(){return schedule[_0x8b45('0x10')]();})[_0x8b45('0xc')](function(){return transcribe[_0x8b45('0x10')]();})['then'](function(){return provider[_0x8b45('0x10')]();})[_0x8b45('0xc')](function(_0x42bb72){logger[_0x8b45('0xf')](_0x42bb72);return pm2[_0x8b45('0x10')](pm2Config);})[_0x8b45('0xc')](function(_0x5f0b20){var _0x5a14c1=_0x5f0b20[_0x8b45('0x11')](function(_0x23f1dd){return typeof _0x23f1dd[_0x8b45('0x12')]===_0x8b45('0x13')&&_0x23f1dd[_0x8b45('0x12')]>=0x0;});if(_0x5a14c1[_0x8b45('0x14')]>0x0){throw new Error(_0x5a14c1[_0x8b45('0x14')]+_0x8b45('0x15')+_[_0x8b45('0x16')](_0x5a14c1,function(_0x391d1e){return'\x22'+_0x391d1e[_0x8b45('0x17')][_0x8b45('0x18')]+'\x22';}));}logger[_0x8b45('0xf')](_0x8b45('0x19'),_[_0x8b45('0x16')](_[_0x8b45('0x11')](_0x5f0b20,{'status':_0x8b45('0x1a')}),_0x8b45('0x18'))['join']());logger[_0x8b45('0xf')](_0x8b45('0x1b'),_[_0x8b45('0x16')](_[_0x8b45('0x11')](_0x5f0b20,function(_0x3e1438){return _0x3e1438[_0x8b45('0x1c')]!==_0x8b45('0x1a');}),_0x8b45('0x18'))['join']()||'None');console[_0x8b45('0x1d')]('App\x20Ready!');})[_0x8b45('0x1e')](function(_0x3ddb50){console[_0x8b45('0x1d')](_0x8b45('0x1f'),_0x3ddb50);logger[_0x8b45('0x20')](_0x8b45('0x21'),_0x3ddb50);process[_0x8b45('0x22')](0x1);});}main(); \ No newline at end of file +var _0xf5a7=['name','Online\x20apps:','online','Offline\x20apps:','status','log','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/transcribe','./config/schedule/cloud-provider','sync','then','seedDB','default','info','start','filter','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env'];(function(_0x244985,_0x33e109){var _0x360400=function(_0x4a1182){while(--_0x4a1182){_0x244985['push'](_0x244985['shift']());}};_0x360400(++_0x33e109);}(_0xf5a7,0x133));var _0x7f5a=function(_0x3c19f7,_0x206c1f){_0x3c19f7=_0x3c19f7-0x0;var _0x3df9da=_0xf5a7[_0x3c19f7];return _0x3df9da;};'use strict';var _=require(_0x7f5a('0x0'));var db=require(_0x7f5a('0x1'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0x7f5a('0x2'));var rpc=require(_0x7f5a('0x3'));var config=require(_0x7f5a('0x4'));var logger=require(_0x7f5a('0x5'))(_0x7f5a('0x6'));var pm2=require(_0x7f5a('0x7'));var pm2Config=require(_0x7f5a('0x8'));var schedule=require(_0x7f5a('0x9'));var chat=require(_0x7f5a('0xa'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x7f5a('0xb'));var provider=require(_0x7f5a('0xc'));function main(){return db['sequelize'][_0x7f5a('0xd')]()[_0x7f5a('0xe')](function(){if(config[_0x7f5a('0xf')]){return seedDb['default']();}})['then'](function(){return checkLicense[_0x7f5a('0x10')]();})[_0x7f5a('0xe')](function(){return rpc['listen']();})['then'](function(_0x438daa){logger[_0x7f5a('0x11')](_0x438daa);return chat['start']();})['then'](function(){return whatsapp[_0x7f5a('0x12')]();})[_0x7f5a('0xe')](function(){return schedule[_0x7f5a('0x12')]();})[_0x7f5a('0xe')](function(){return transcribe[_0x7f5a('0x12')]();})[_0x7f5a('0xe')](function(){return provider['start']();})[_0x7f5a('0xe')](function(_0x405223){logger[_0x7f5a('0x11')](_0x405223);return pm2[_0x7f5a('0x12')](pm2Config);})[_0x7f5a('0xe')](function(_0x2a25ab){var _0x117772=_0x2a25ab[_0x7f5a('0x13')](function(_0x4ce5c2){return typeof _0x4ce5c2[_0x7f5a('0x14')]===_0x7f5a('0x15')&&_0x4ce5c2['exitCode']>=0x0;});if(_0x117772[_0x7f5a('0x16')]>0x0){throw new Error(_0x117772[_0x7f5a('0x16')]+_0x7f5a('0x17')+_[_0x7f5a('0x18')](_0x117772,function(_0x568857){return'\x22'+_0x568857[_0x7f5a('0x19')][_0x7f5a('0x1a')]+'\x22';}));}logger[_0x7f5a('0x11')](_0x7f5a('0x1b'),_['map'](_[_0x7f5a('0x13')](_0x2a25ab,{'status':_0x7f5a('0x1c')}),'name')['join']());logger[_0x7f5a('0x11')](_0x7f5a('0x1d'),_[_0x7f5a('0x18')](_[_0x7f5a('0x13')](_0x2a25ab,function(_0x208a6e){return _0x208a6e[_0x7f5a('0x1e')]!==_0x7f5a('0x1c');}),_0x7f5a('0x1a'))['join']()||'None');console[_0x7f5a('0x1f')]('App\x20Ready!');})[_0x7f5a('0x20')](function(_0x5ae49e){console[_0x7f5a('0x1f')](_0x7f5a('0x21'),_0x5ae49e);logger[_0x7f5a('0x22')](_0x7f5a('0x23'),_0x5ae49e);process[_0x7f5a('0x24')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 69d6e57..627f941 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 _0x2ff9=['ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswerDelay','faxAutoanswerDelay','whatsappAutoanswer','isChatInteractionAuthorized','isAuthenticated','user','ChatInteraction','closed','then','query','status','disposition','json','unmanaged','Unmanaged.','Forbidden.','use','startsWith','Basic','User','find','pass','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','apikey','getUuid','sub','Setting','allowedLoginAttempts','blockDuration','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','minutes','User\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isWebrtcLicence','webrtc','catch','setTokenCookie','cookie','motion.token','redirect','/dashboards/general','send','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','encryptString','join','promisify','secret','session','options','verify','randomBytes','toString','hex','floor','now','../../mysqldb','../../config/license/hardware','../../config/license/util','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','name','email','userpic','permissions','md5secret','voicePause','chatPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','passwordResetAt','alias','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments'];(function(_0x35416c,_0x27c2ef){var _0x73b172=function(_0x50c418){while(--_0x50c418){_0x35416c['push'](_0x35416c['shift']());}};_0x73b172(++_0x27c2ef);}(_0x2ff9,0x166));var _0x92ff=function(_0x511107,_0x5bab82){_0x511107=_0x511107-0x0;var _0x579a34=_0x2ff9[_0x511107];return _0x579a34;};'use strict';var db=require(_0x92ff('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0x92ff('0x1'));var licenseUtil=require(_0x92ff('0x2'));var encryptor=require('../encryptor');var _=require(_0x92ff('0x3'));var jwt=require(_0x92ff('0x4'));var expressJwt=require(_0x92ff('0x5'));var compose=require(_0x92ff('0x6'));var basicAuth=require(_0x92ff('0x7'));var crypto=require(_0x92ff('0x8'));var BPromise=require(_0x92ff('0x9'));var util=require(_0x92ff('0xa'));var moment=require(_0x92ff('0xb'));var validateJwt=expressJwt({'secret':config[_0x92ff('0xc')]['session']});var userAttributes=['id','role','fullname',_0x92ff('0xd'),'internal',_0x92ff('0xe'),_0x92ff('0xf'),_0x92ff('0x10'),_0x92ff('0x11'),_0x92ff('0x12'),_0x92ff('0x13'),'mailPause',_0x92ff('0x14'),_0x92ff('0x15'),_0x92ff('0x16'),_0x92ff('0x17'),_0x92ff('0x18'),_0x92ff('0x19'),_0x92ff('0x1a'),_0x92ff('0x1b'),'allowmessenger',_0x92ff('0x1c'),_0x92ff('0x1d'),'phoneBarAutoAnswer',_0x92ff('0x1e'),'phoneBarDnd',_0x92ff('0x1f'),_0x92ff('0x20'),_0x92ff('0x21'),'phoneBarExpires','phoneBarPrefixRequired',_0x92ff('0x22'),_0x92ff('0x23'),_0x92ff('0x24'),_0x92ff('0x25'),_0x92ff('0x26'),'privacyEnabled',_0x92ff('0x27'),_0x92ff('0x28'),_0x92ff('0x29'),_0x92ff('0x2a'),_0x92ff('0x2b'),_0x92ff('0x2c'),_0x92ff('0x2d'),'chatAutoanswer',_0x92ff('0x2e'),_0x92ff('0x2f'),_0x92ff('0x30'),_0x92ff('0x31'),_0x92ff('0x32'),'openchannelAutoanswer',_0x92ff('0x33'),'faxAutoanswer',_0x92ff('0x34'),_0x92ff('0x35'),'whatsappAutoanswerDelay','messengerSoundNotification'];exports[_0x92ff('0x36')]=function(){return this[_0x92ff('0x37')](!![])['use'](function(_0x11cbb6,_0x686071,_0x35a2ea){if(_0x11cbb6[_0x92ff('0x38')]){_0x35a2ea();}else{return db[_0x92ff('0x39')]['findOne']({'where':{'id':_0x11cbb6['params']['id']},'attributes':['id',_0x92ff('0x3a'),'disposition'],'raw':!![]})[_0x92ff('0x3b')](function(_0x3d2aa9){if(_0x3d2aa9&&_0x3d2aa9[_0x92ff('0x3a')]&&!_0x11cbb6[_0x92ff('0x3c')]['forceDownload']){return _0x686071[_0x92ff('0x3d')](_0x3d2aa9[_0x92ff('0x3e')]==='unmanaged'?0x195:0x193)[_0x92ff('0x3f')]({'message':_0x3d2aa9[_0x92ff('0x3e')]===_0x92ff('0x40')?_0x92ff('0x41'):_0x92ff('0x42')});}else{_0x35a2ea();}})['catch'](function(_0x124710){_0x35a2ea(_0x124710);});}});};exports[_0x92ff('0x37')]=function isAuthenticated(_0x2bedb2){return compose()[_0x92ff('0x43')](function(_0x38c6ea,_0x3b7497,_0x31ed83){var _0x2775bb;if(_0x38c6ea['headers']['authorization']){if(_[_0x92ff('0x44')](_0x38c6ea['headers']['authorization'],_0x92ff('0x45'))){var _0x43be2e=basicAuth(_0x38c6ea);db[_0x92ff('0x46')][_0x92ff('0x47')]({'where':{'name':_0x43be2e['name']}})['then'](function(_0x3b39e0){if(!_0x3b39e0||!_0x3b39e0['authenticate'](_0x43be2e[_0x92ff('0x48')])){return _0x3b7497['status'](0x191)[_0x92ff('0x3f')]({'message':_0x92ff('0x49')});}_0x38c6ea['user']={'id':_0x3b39e0['id']};_0x31ed83();})['catch'](function(_0x863c70){_0x31ed83(_0x863c70);});}else if(_[_0x92ff('0x44')](_0x38c6ea['headers']['authorization'],_0x92ff('0x4a'))){validateJwt(_0x38c6ea,_0x3b7497,_0x31ed83);}else{if(_0x2bedb2){_0x31ed83();}else{return _0x3b7497[_0x92ff('0x3d')](0x193)[_0x92ff('0x3f')]({'message':_0x92ff('0x4b')});}}}else if(_0x38c6ea[_0x92ff('0x3c')][_0x92ff('0x4c')]){try{var _0x50fe95={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x92ff('0x4d')]()};verifyJwt(_0x38c6ea['query'][_0x92ff('0x4c')],_0x50fe95)[_0x92ff('0x3b')](function(_0x51a8c2){return db[_0x92ff('0x46')][_0x92ff('0x47')]({'where':{'id':_0x51a8c2[_0x92ff('0x4e')]}})[_0x92ff('0x3b')](function(_0x377db2){_0x2775bb=_0x377db2;return db[_0x92ff('0x4f')]['findOne']({'where':{'id':0x1},'attributes':[_0x92ff('0x50'),_0x92ff('0x51')],'raw':!![]});})[_0x92ff('0x3b')](function(_0x192d89){if(!_0x2775bb||!_['isEqual'](_0x2775bb[_0x92ff('0x52')],_0x51a8c2[_0x92ff('0x53')])){return _0x3b7497['status'](0x191)['json']({'message':_0x92ff('0x54')});}if(_0x2775bb[_0x92ff('0x55')]){return _0x3b7497[_0x92ff('0x3d')](0x191)[_0x92ff('0x3f')]({'message':_0x92ff('0x56')});}if(_0x2775bb[_0x92ff('0x57')]){if(_0x192d89[_0x92ff('0x51')]>0x0){if(moment(_0x2775bb[_0x92ff('0x58')])[_0x92ff('0x59')](_0x192d89[_0x92ff('0x51')],_0x92ff('0x5a'))>moment()){return _0x3b7497[_0x92ff('0x3d')](0x191)[_0x92ff('0x3f')]({'message':_0x92ff('0x56')});}}else{return _0x3b7497[_0x92ff('0x3d')](0x191)['json']({'message':_0x92ff('0x56')});}}_0x38c6ea[_0x92ff('0x38')]={'id':_0x2775bb['id']};_0x31ed83();});})['catch'](function(){return _0x3b7497['status'](0x191)[_0x92ff('0x3f')]({'message':_0x92ff('0x56')});});}catch(_0x16e747){_0x31ed83(_0x16e747);}}else if(_0x2bedb2){_0x31ed83();}else{return _0x3b7497['status'](0x193)[_0x92ff('0x3f')]({'message':_0x92ff('0x4b')});}})['use'](function(_0x3e5953,_0x4efbd8,_0x13bca0){if(_0x3e5953[_0x92ff('0x38')]){db[_0x92ff('0x46')][_0x92ff('0x47')]({'where':{'id':_0x3e5953['user']['id']},'attributes':userAttributes})['then'](function(_0x516510){if(!_0x516510){return _0x4efbd8[_0x92ff('0x3d')](0x194)[_0x92ff('0x3f')]({'message':_0x92ff('0x5b')});}_0x3e5953[_0x92ff('0x38')]=_0x516510;_0x13bca0();})['catch'](function(_0x52f71d){_0x13bca0(_0x52f71d);});}else if(_0x2bedb2){_0x13bca0();}else{return _0x4efbd8[_0x92ff('0x3d')](0x194)[_0x92ff('0x3f')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0x92ff('0x5c')]=function canUpdate(){return compose()['use'](function(_0x38e927,_0x5dc8ec,_0x57d919){return licenseUtil[_0x92ff('0x5d')]()[_0x92ff('0x3b')](function(_0x5d63af){if(_0x5d63af[_0x92ff('0x5e')]){_0x57d919();}else{return _0x5dc8ec[_0x92ff('0x3d')](0x193)[_0x92ff('0x3f')]({'message':_0x92ff('0x5f')});}})['catch'](function(_0x5b2289){_0x57d919(_0x5b2289);});});};exports[_0x92ff('0x60')]=function isWebrtcLicence(){return compose()[_0x92ff('0x43')](function(_0x4ab930,_0x318649,_0x5c1285){return licenseUtil[_0x92ff('0x5d')]()[_0x92ff('0x3b')](function(_0x12bd3f){if(_0x12bd3f[_0x92ff('0x61')]){_0x5c1285();}else{return _0x318649[_0x92ff('0x3d')](0x193)[_0x92ff('0x3f')]({'message':_0x92ff('0x5f')});}})[_0x92ff('0x62')](function(_0x1c9ebe){_0x5c1285(_0x1c9ebe);});});};exports['isMiddleware']=function(_0x5ebad5,_0x29bb6e,_0xbcf12f){_0x5ebad5['isMiddleware']=!![];return _0xbcf12f();};exports['signToken']=function signToken(_0x4c898f){return signJwt(_0x4c898f);};exports[_0x92ff('0x63')]=function(_0x1b1228,_0x22edbd){if(!_0x1b1228[_0x92ff('0x38')]){return _0x22edbd[_0x92ff('0x3d')](0x194)[_0x92ff('0x3f')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x16a2e6={'payload':{'id':_0x1b1228[_0x92ff('0x38')]['id'],'role':_0x1b1228[_0x92ff('0x38')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x16a2e6)[_0x92ff('0x3b')](function(_0x40ef0f){_0x22edbd[_0x92ff('0x64')](_0x92ff('0x65'),_0x40ef0f);_0x22edbd[_0x92ff('0x66')](_0x92ff('0x67'));})['catch'](function(_0x2fa915){return _0x22edbd[_0x92ff('0x3d')](0x1f4)[_0x92ff('0x68')](_0x2fa915);});};exports['retrieveApiKey']=function(_0x8a6ee6){if(_[_0x92ff('0x69')](_0x8a6ee6['apiKeyNonce'])||_[_0x92ff('0x69')](_0x8a6ee6[_0x92ff('0x6a')])){return null;}else{return createJwt(_0x8a6ee6);}};exports[_0x92ff('0x6b')]=function(_0x4de9c5){_0x4de9c5[_0x92ff('0x52')]=generateNonce();_0x4de9c5['apiKeyIat']=generateIssuedAt();return createJwt(_0x4de9c5);};exports[_0x92ff('0x6c')]=function(_0x4b6348,_0x304598){var _0x3001a8=_0x4b6348['query']['apikey'];if(_0x3001a8){var _0x241584={'nonce':_0x304598[_0x92ff('0x52')],'iat':_0x304598[_0x92ff('0x6a')],'audience':hardwareConf[_0x92ff('0x4d')](),'issuer':hardwareConf[_0x92ff('0x4d')]()};return verifyJwt(_0x3001a8,_0x241584)[_0x92ff('0x3b')](function(){return generateApiKey(_0x304598);});}else{throw{'message':_0x92ff('0x6d')};}};exports[_0x92ff('0x6e')]=function(_0x3c8b2c){var _0x4fa6c8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x4fa6c8[_0x92ff('0x6f')](_0x3c8b2c))throw new db[(_0x92ff('0x70'))][(_0x92ff('0x71'))](_0x92ff('0x72'));return;};exports['validatePasswordHistory']=function(_0x4059b9,_0x5bb256,_0x5ba4cd){var _0x35469d=encryptor[_0x92ff('0x73')](_0x5bb256)[_0x92ff('0x74')](',');for(var _0x4c7780=0x0;_0x4c7780<_0x5ba4cd;_0x4c7780++){if(!_0x35469d[_0x4c7780])break;if(_0x4059b9[_0x92ff('0x75')]()===_0x35469d[_0x4c7780]['toLowerCase']()){var _0x12906b=util[_0x92ff('0x76')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x5ba4cd);if(_0x5ba4cd===0x1){_0x12906b=_0x92ff('0x77');}throw new db['Sequelize'][(_0x92ff('0x71'))](_0x12906b);}}return;};exports[_0x92ff('0x78')]=function(_0x21f14f,_0x460def){var _0x23328c=_0x460def?encryptor['decryptString'](_0x460def)[_0x92ff('0x74')](','):[];if(_0x23328c[_0x92ff('0x79')]===0x5){_0x23328c['splice'](-0x1,0x1);}_0x23328c['unshift'](_0x21f14f);return encryptor[_0x92ff('0x7a')](_0x23328c[_0x92ff('0x7b')](','));};function signJwt(_0x37d06c){var _0x2884b3=BPromise[_0x92ff('0x7c')](jwt['sign'],{'context':jwt});var _0x570ffa=_0x37d06c[_0x92ff('0x7d')]||config[_0x92ff('0xc')][_0x92ff('0x7e')];return new BPromise(function(_0x4fce1c,_0x2b9e0b){_0x2884b3(_0x37d06c['payload'],_0x570ffa,_0x37d06c[_0x92ff('0x7f')])[_0x92ff('0x3b')](function(_0x265217){_0x4fce1c(_0x265217);})[_0x92ff('0x62')](function(_0x1f105b){_0x2b9e0b(_0x1f105b);});});}function verifyJwt(_0x48365b,_0xc3eeac,_0x514dce){var _0x580192=BPromise[_0x92ff('0x7c')](jwt[_0x92ff('0x80')],{'context':jwt});var _0x533646=_0x514dce||config[_0x92ff('0xc')]['session'];return new BPromise(function(_0x1b793f,_0x3ee4aa){_0x580192(_0x48365b,_0x533646,_0xc3eeac)[_0x92ff('0x3b')](function(_0xf07c46){_0x1b793f(_0xf07c46);})['catch'](function(_0x214988){_0x3ee4aa(_0x214988);});});}function generateNonce(){return crypto[_0x92ff('0x81')](0x10)[_0x92ff('0x82')](_0x92ff('0x83'));}function generateIssuedAt(){return Math[_0x92ff('0x84')](Date[_0x92ff('0x85')]()/0x3e8)['toString']();}function createJwt(_0x5382bd){var _0x19229d={'payload':{'iat':_0x5382bd['apiKeyIat'],'nonce':_0x5382bd[_0x92ff('0x52')]},'options':{'algorithm':'HS512','subject':_0x5382bd['id'][_0x92ff('0x82')](),'issuer':hardwareConf[_0x92ff('0x4d')](),'audience':hardwareConf[_0x92ff('0x4d')]()}};return signJwt(_0x19229d)[_0x92ff('0x3b')](function(_0x1b8c81){return{'iat':_0x5382bd[_0x92ff('0x6a')],'nonce':_0x5382bd[_0x92ff('0x52')],'token':_0x1b8c81};});} \ No newline at end of file +var _0x3c01=['User','find','json','Wrong\x20credentials.','catch','Bearer','status','Unknown\x20authorization\x20format','apikey','sub','Setting','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blockedAt','add','minutes','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','Forbidden','isWebrtcLicence','getLicense','isMiddleware','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','redirect','send','isNil','apiKeyIat','regenerateApiKey','getUuid','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','splice','unshift','join','promisify','sign','secret','options','verify','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/license/util','../encryptor','lodash','express-jwt','composable-middleware','crypto','util','secrets','session','role','fullname','name','internal','userpic','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','crudPermissions','allowmessenger','passwordResetAt','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','privacyEnabled','settingsEnabled','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','user','ChatInteraction','findOne','params','closed','disposition','then','query','forceDownload','unmanaged','Unmanaged.','Forbidden.','use','authorization','headers'];(function(_0xd41ece,_0x241cdb){var _0x5e2da2=function(_0x1ecd01){while(--_0x1ecd01){_0xd41ece['push'](_0xd41ece['shift']());}};_0x5e2da2(++_0x241cdb);}(_0x3c01,0xc3));var _0x13c0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3c01[_0x14add3];return _0x4a174f;};'use strict';var db=require(_0x13c0('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0x13c0('0x1'));var encryptor=require(_0x13c0('0x2'));var _=require(_0x13c0('0x3'));var jwt=require('jsonwebtoken');var expressJwt=require(_0x13c0('0x4'));var compose=require(_0x13c0('0x5'));var basicAuth=require('basic-auth');var crypto=require(_0x13c0('0x6'));var BPromise=require('bluebird');var util=require(_0x13c0('0x7'));var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0x13c0('0x8')][_0x13c0('0x9')]});var userAttributes=['id',_0x13c0('0xa'),_0x13c0('0xb'),_0x13c0('0xc'),_0x13c0('0xd'),'email',_0x13c0('0xe'),'permissions','md5secret',_0x13c0('0xf'),_0x13c0('0x10'),_0x13c0('0x11'),_0x13c0('0x12'),_0x13c0('0x13'),_0x13c0('0x14'),_0x13c0('0x15'),_0x13c0('0x16'),_0x13c0('0x17'),'lastPauseAt',_0x13c0('0x18'),_0x13c0('0x19'),_0x13c0('0x1a'),'alias',_0x13c0('0x1b'),_0x13c0('0x1c'),'phoneBarDnd',_0x13c0('0x1d'),'phoneBarEnableDtmfTone',_0x13c0('0x1e'),_0x13c0('0x1f'),_0x13c0('0x20'),_0x13c0('0x21'),_0x13c0('0x22'),'hotdesk','interface','userProfileId',_0x13c0('0x23'),_0x13c0('0x24'),'wssPort',_0x13c0('0x25'),_0x13c0('0x26'),_0x13c0('0x27'),_0x13c0('0x28'),_0x13c0('0x29'),_0x13c0('0x2a'),'chatAutoanswerDelay',_0x13c0('0x2b'),_0x13c0('0x2c'),_0x13c0('0x2d'),_0x13c0('0x2e'),'openchannelAutoanswer','openchannelAutoanswerDelay',_0x13c0('0x2f'),_0x13c0('0x30'),'whatsappAutoanswer',_0x13c0('0x31'),'messengerSoundNotification'];exports[_0x13c0('0x32')]=function(){return this[_0x13c0('0x33')](!![])['use'](function(_0x271f92,_0x4c62fe,_0xa43e42){if(_0x271f92[_0x13c0('0x34')]){_0xa43e42();}else{return db[_0x13c0('0x35')][_0x13c0('0x36')]({'where':{'id':_0x271f92[_0x13c0('0x37')]['id']},'attributes':['id',_0x13c0('0x38'),_0x13c0('0x39')],'raw':!![]})[_0x13c0('0x3a')](function(_0x15e4a3){if(_0x15e4a3&&_0x15e4a3[_0x13c0('0x38')]&&!_0x271f92[_0x13c0('0x3b')][_0x13c0('0x3c')]){return _0x4c62fe['status'](_0x15e4a3[_0x13c0('0x39')]===_0x13c0('0x3d')?0x195:0x193)['json']({'message':_0x15e4a3['disposition']===_0x13c0('0x3d')?_0x13c0('0x3e'):_0x13c0('0x3f')});}else{_0xa43e42();}})['catch'](function(_0x19a9aa){_0xa43e42(_0x19a9aa);});}});};exports[_0x13c0('0x33')]=function isAuthenticated(_0x1c6efd){return compose()[_0x13c0('0x40')](function(_0x74fff4,_0x3dfe37,_0x119ad2){var _0x32f4fd;if(_0x74fff4['headers'][_0x13c0('0x41')]){if(_['startsWith'](_0x74fff4[_0x13c0('0x42')][_0x13c0('0x41')],'Basic')){var _0x3fce88=basicAuth(_0x74fff4);db[_0x13c0('0x43')][_0x13c0('0x44')]({'where':{'name':_0x3fce88[_0x13c0('0xc')]}})['then'](function(_0x1a3692){if(!_0x1a3692||!_0x1a3692['authenticate'](_0x3fce88['pass'])){return _0x3dfe37['status'](0x191)[_0x13c0('0x45')]({'message':_0x13c0('0x46')});}_0x74fff4['user']={'id':_0x1a3692['id']};_0x119ad2();})[_0x13c0('0x47')](function(_0x5ad24c){_0x119ad2(_0x5ad24c);});}else if(_['startsWith'](_0x74fff4['headers'][_0x13c0('0x41')],_0x13c0('0x48'))){validateJwt(_0x74fff4,_0x3dfe37,_0x119ad2);}else{if(_0x1c6efd){_0x119ad2();}else{return _0x3dfe37[_0x13c0('0x49')](0x193)[_0x13c0('0x45')]({'message':_0x13c0('0x4a')});}}}else if(_0x74fff4['query'][_0x13c0('0x4b')]){try{var _0x19e77c={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x74fff4[_0x13c0('0x3b')]['apikey'],_0x19e77c)[_0x13c0('0x3a')](function(_0x19d106){return db[_0x13c0('0x43')]['find']({'where':{'id':_0x19d106[_0x13c0('0x4c')]}})[_0x13c0('0x3a')](function(_0x356753){_0x32f4fd=_0x356753;return db[_0x13c0('0x4d')][_0x13c0('0x36')]({'where':{'id':0x1},'attributes':[_0x13c0('0x4e'),_0x13c0('0x4f')],'raw':!![]});})[_0x13c0('0x3a')](function(_0x2bfd71){if(!_0x32f4fd||!_[_0x13c0('0x50')](_0x32f4fd[_0x13c0('0x51')],_0x19d106[_0x13c0('0x52')])){return _0x3dfe37[_0x13c0('0x49')](0x191)['json']({'message':_0x13c0('0x53')});}if(_0x32f4fd[_0x13c0('0x54')]){return _0x3dfe37[_0x13c0('0x49')](0x191)[_0x13c0('0x45')]({'message':_0x13c0('0x55')});}if(_0x32f4fd['blocked']){if(_0x2bfd71[_0x13c0('0x4f')]>0x0){if(moment(_0x32f4fd[_0x13c0('0x56')])[_0x13c0('0x57')](_0x2bfd71[_0x13c0('0x4f')],_0x13c0('0x58'))>moment()){return _0x3dfe37[_0x13c0('0x49')](0x191)[_0x13c0('0x45')]({'message':_0x13c0('0x55')});}}else{return _0x3dfe37[_0x13c0('0x49')](0x191)['json']({'message':_0x13c0('0x55')});}}_0x74fff4[_0x13c0('0x34')]={'id':_0x32f4fd['id']};_0x119ad2();});})[_0x13c0('0x47')](function(){return _0x3dfe37[_0x13c0('0x49')](0x191)[_0x13c0('0x45')]({'message':_0x13c0('0x55')});});}catch(_0x36847c){_0x119ad2(_0x36847c);}}else if(_0x1c6efd){_0x119ad2();}else{return _0x3dfe37[_0x13c0('0x49')](0x193)['json']({'message':_0x13c0('0x4a')});}})[_0x13c0('0x40')](function(_0x58c36b,_0x3ca621,_0x3fc344){if(_0x58c36b['user']){db[_0x13c0('0x43')][_0x13c0('0x44')]({'where':{'id':_0x58c36b['user']['id']},'attributes':userAttributes})[_0x13c0('0x3a')](function(_0x15b747){if(!_0x15b747){return _0x3ca621[_0x13c0('0x49')](0x194)[_0x13c0('0x45')]({'message':_0x13c0('0x59')});}_0x58c36b['user']=_0x15b747;_0x3fc344();})[_0x13c0('0x47')](function(_0xe9a66c){_0x3fc344(_0xe9a66c);});}else if(_0x1c6efd){_0x3fc344();}else{return _0x3ca621['status'](0x194)[_0x13c0('0x45')]({'message':_0x13c0('0x5a')});}});};exports[_0x13c0('0x5b')]=function canUpdate(){return compose()[_0x13c0('0x40')](function(_0x8dc662,_0x2e009e,_0x3ecac9){return licenseUtil['getLicense']()['then'](function(_0x3a0ac3){if(_0x3a0ac3['update']){_0x3ecac9();}else{return _0x2e009e[_0x13c0('0x49')](0x193)[_0x13c0('0x45')]({'message':_0x13c0('0x5c')});}})[_0x13c0('0x47')](function(_0x1196eb){_0x3ecac9(_0x1196eb);});});};exports[_0x13c0('0x5d')]=function isWebrtcLicence(){return compose()[_0x13c0('0x40')](function(_0x49edaa,_0x3ee8d1,_0x4a9f71){return licenseUtil[_0x13c0('0x5e')]()[_0x13c0('0x3a')](function(_0x590ea6){if(_0x590ea6['webrtc']){_0x4a9f71();}else{return _0x3ee8d1['status'](0x193)[_0x13c0('0x45')]({'message':_0x13c0('0x5c')});}})[_0x13c0('0x47')](function(_0x43114f){_0x4a9f71(_0x43114f);});});};exports['isMiddleware']=function(_0x219cc0,_0x2fed15,_0x4dcb9a){_0x219cc0[_0x13c0('0x5f')]=!![];return _0x4dcb9a();};exports[_0x13c0('0x60')]=function signToken(_0x54f2c3){return signJwt(_0x54f2c3);};exports['setTokenCookie']=function(_0x1c18f0,_0x112465){if(!_0x1c18f0[_0x13c0('0x34')]){return _0x112465[_0x13c0('0x49')](0x194)[_0x13c0('0x45')]({'message':_0x13c0('0x61')});}var _0x3ea6cf={'payload':{'id':_0x1c18f0[_0x13c0('0x34')]['id'],'role':_0x1c18f0[_0x13c0('0x34')][_0x13c0('0xa')]},'options':{'expiresIn':0x15180}};return signJwt(_0x3ea6cf)[_0x13c0('0x3a')](function(_0x521e66){_0x112465['cookie'](_0x13c0('0x62'),_0x521e66);_0x112465[_0x13c0('0x63')]('/dashboards/general');})[_0x13c0('0x47')](function(_0x3c56c6){return _0x112465['status'](0x1f4)[_0x13c0('0x64')](_0x3c56c6);});};exports['retrieveApiKey']=function(_0x4c4371){if(_[_0x13c0('0x65')](_0x4c4371[_0x13c0('0x51')])||_['isNil'](_0x4c4371['apiKeyIat'])){return null;}else{return createJwt(_0x4c4371);}};exports['generateApiKey']=function(_0x301b71){_0x301b71['apiKeyNonce']=generateNonce();_0x301b71[_0x13c0('0x66')]=generateIssuedAt();return createJwt(_0x301b71);};exports[_0x13c0('0x67')]=function(_0x1b7bea,_0x362924){var _0x2f0e43=_0x1b7bea['query'][_0x13c0('0x4b')];if(_0x2f0e43){var _0x114491={'nonce':_0x362924[_0x13c0('0x51')],'iat':_0x362924[_0x13c0('0x66')],'audience':hardwareConf[_0x13c0('0x68')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x2f0e43,_0x114491)[_0x13c0('0x3a')](function(){return generateApiKey(_0x362924);});}else{throw{'message':_0x13c0('0x69')};}};exports['validatePasswordPattern']=function(_0x3b24f7){var _0x2bb5e0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x2bb5e0[_0x13c0('0x6a')](_0x3b24f7))throw new db[(_0x13c0('0x6b'))][(_0x13c0('0x6c'))](_0x13c0('0x6d'));return;};exports[_0x13c0('0x6e')]=function(_0x3be502,_0xaf107,_0x189c3a){var _0x3befd6=encryptor[_0x13c0('0x6f')](_0xaf107)[_0x13c0('0x70')](',');for(var _0x56510d=0x0;_0x56510d<_0x189c3a;_0x56510d++){if(!_0x3befd6[_0x56510d])break;if(_0x3be502[_0x13c0('0x71')]()===_0x3befd6[_0x56510d][_0x13c0('0x71')]()){var _0x429516=util[_0x13c0('0x72')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x189c3a);if(_0x189c3a===0x1){_0x429516=_0x13c0('0x73');}throw new db['Sequelize']['ValidationError'](_0x429516);}}return;};exports[_0x13c0('0x74')]=function(_0x2a279a,_0x38566){var _0xf97d6f=_0x38566?encryptor[_0x13c0('0x6f')](_0x38566)['split'](','):[];if(_0xf97d6f['length']===0x5){_0xf97d6f[_0x13c0('0x75')](-0x1,0x1);}_0xf97d6f[_0x13c0('0x76')](_0x2a279a);return encryptor['encryptString'](_0xf97d6f[_0x13c0('0x77')](','));};function signJwt(_0x12ff22){var _0x43a994=BPromise[_0x13c0('0x78')](jwt[_0x13c0('0x79')],{'context':jwt});var _0x5516d9=_0x12ff22[_0x13c0('0x7a')]||config['secrets'][_0x13c0('0x9')];return new BPromise(function(_0x101503,_0x5ea00d){_0x43a994(_0x12ff22['payload'],_0x5516d9,_0x12ff22[_0x13c0('0x7b')])['then'](function(_0x4494da){_0x101503(_0x4494da);})['catch'](function(_0x434182){_0x5ea00d(_0x434182);});});}function verifyJwt(_0xf3f837,_0x462b7b,_0x2d3158){var _0x28cf4a=BPromise[_0x13c0('0x78')](jwt[_0x13c0('0x7c')],{'context':jwt});var _0x4099dc=_0x2d3158||config['secrets'][_0x13c0('0x9')];return new BPromise(function(_0x5360c4,_0x2a4ff3){_0x28cf4a(_0xf3f837,_0x4099dc,_0x462b7b)[_0x13c0('0x3a')](function(_0x1fd9c8){_0x5360c4(_0x1fd9c8);})[_0x13c0('0x47')](function(_0x3cb936){_0x2a4ff3(_0x3cb936);});});}function generateNonce(){return crypto[_0x13c0('0x7d')](0x10)[_0x13c0('0x7e')](_0x13c0('0x7f'));}function generateIssuedAt(){return Math[_0x13c0('0x80')](Date[_0x13c0('0x81')]()/0x3e8)['toString']();}function createJwt(_0x214557){var _0x40492e={'payload':{'iat':_0x214557[_0x13c0('0x66')],'nonce':_0x214557[_0x13c0('0x51')]},'options':{'algorithm':_0x13c0('0x82'),'subject':_0x214557['id'][_0x13c0('0x7e')](),'issuer':hardwareConf[_0x13c0('0x68')](),'audience':hardwareConf[_0x13c0('0x68')]()}};return signJwt(_0x40492e)[_0x13c0('0x3a')](function(_0x20285d){return{'iat':_0x214557[_0x13c0('0x66')],'nonce':_0x214557[_0x13c0('0x51')],'token':_0x20285d};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index 65e0b5c..192c2fb 100644 --- a/server/components/contacts/index.js +++ b/server/components/contacts/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xad54=['describe','keys','startsWith','cf_','map','CmCustomField','slice','fieldType','type','lodash','./sql-utils','../../mysqldb','findAll','resolve','getContactsSubquery','then','search','parseQueryParameters','where','default','fields','filter','tags','user','skip','checkListsRestrictions','ids','tag','count','User','buildContactsQuery','catch'];(function(_0x2353fe,_0x4b0bca){var _0x4d43f6=function(_0x5d0bd9){while(--_0x5d0bd9){_0x2353fe['push'](_0x2353fe['shift']());}};_0x4d43f6(++_0x4b0bca);}(_0xad54,0x129));var _0x4ad5=function(_0x32ab72,_0x47dd1b){_0x32ab72=_0x32ab72-0x0;var _0x83eea5=_0xad54[_0x32ab72];return _0x83eea5;};'use strict';var _=require(_0x4ad5('0x0'));var sqlUtils=require(_0x4ad5('0x1'));var db=require(_0x4ad5('0x2'))['db'];exports[_0x4ad5('0x3')]=function(_0x1d9515,_0x24eb4e,_0x43c618,_0x4bf98f){var _0x404ba0={'count':0x0,'rows':[]};var _0x4b059e=sqlUtils['skipContactsQuery'](_0x24eb4e,_0x1d9515);if(_0x4b059e){return Promise[_0x4ad5('0x4')](_0x404ba0);}var _0xe041f5=sqlUtils[_0x4ad5('0x5')]();var _0x25bfed={};var _0x19fa6d=![];var _0x5c154f=![];return Promise[_0x4ad5('0x4')]()[_0x4ad5('0x6')](function(){if(_0x1d9515[_0x4ad5('0x7')]){return sqlUtils['parseAdvancedSearchFilter'](_0x1d9515[_0x4ad5('0x7')],_0x4bf98f);}else{return sqlUtils[_0x4ad5('0x8')](_0x1d9515,_0x4bf98f);}})[_0x4ad5('0x6')](function(_0x1c81d2){_0xe041f5[_0x4ad5('0x9')](_0x1c81d2[_0x4ad5('0xa')]);_0xe041f5[_0x4ad5('0x9')](_0x1c81d2[_0x4ad5('0xb')]);_0xe041f5[_0x4ad5('0x9')](_0x1c81d2[_0x4ad5('0xc')]);_0xe041f5['where'](_0x1c81d2['user']['clause']);_0x25bfed=_0x1c81d2[_0x4ad5('0xd')];_0x5c154f=_0x1c81d2[_0x4ad5('0xe')][_0x4ad5('0xf')];return sqlUtils[_0x4ad5('0x10')](_0x24eb4e,_0x1d9515,_0x5c154f);})['then'](function(_0x4a45a5){_0xe041f5[_0x4ad5('0x9')](_0x4a45a5);var _0x14b3b4=_0x1d9515[_0x4ad5('0x7')]?_0x25bfed[_0x4ad5('0x11')]:_0x1d9515[_0x4ad5('0x12')];_0x19fa6d=_0x14b3b4?!![]:![];return sqlUtils['countFilteredContacts'](_0xe041f5,_0x14b3b4);})[_0x4ad5('0x6')](function(_0x1ba679){_0x404ba0[_0x4ad5('0x13')]=_0x1ba679;if(_0x404ba0[_0x4ad5('0x13')]===0x0){return;}if(_0x1d9515[_0x4ad5('0x14')]){_0x5c154f=!![];}return sqlUtils[_0x4ad5('0x15')](_0xe041f5,_0x1d9515['fields'],_0x43c618,_0x19fa6d,_0x25bfed['clause'],_0x5c154f);})[_0x4ad5('0x6')](function(_0x39ecb0){if(!_0x39ecb0){return[];}return sqlUtils['getFilteredContacts'](_0x39ecb0,_0x1d9515,_0x43c618);})['then'](function(_0x1dea56){_0x404ba0['rows']=_0x1dea56;return _0x404ba0;})[_0x4ad5('0x16')](function(_0x20a735){throw _0x20a735;});};exports[_0x4ad5('0x17')]=function(){var _0x43a43b={};var _0xf7112a=[];return db['CmContact']['describe']()[_0x4ad5('0x6')](function(_0x484e6e){_0x43a43b=_0x484e6e;var _0x59e84d=Object[_0x4ad5('0x18')](_0x43a43b)[_0x4ad5('0xc')](function(_0x2f535a){return _[_0x4ad5('0x19')](_0x2f535a,_0x4ad5('0x1a'))?_0x2f535a:undefined;});var _0xe8352e=_0x59e84d[_0x4ad5('0x1b')](function(_0xdf364c){return db[_0x4ad5('0x1c')]['findOne']({'where':{'id':_0xdf364c[_0x4ad5('0x1d')](0x3)},'raw':!![]});});return Promise['all'](_0xe8352e);})[_0x4ad5('0x6')](function(_0x137911){for(var _0xfb9543=0x0;_0xfb9543<_0x137911['length'];_0xfb9543++){if(_0x137911[_0xfb9543]){var _0x497885='cf_'+_0x137911[_0xfb9543]['id'];_0x43a43b[_0x497885][_0x4ad5('0x1e')]=_0x137911[_0xfb9543][_0x4ad5('0x1f')];}}_0xf7112a=_[_0x4ad5('0x1b')](Object[_0x4ad5('0x18')](_0x43a43b),function(_0x3322d){return{'name':_0x3322d,'type':_0x43a43b[_0x3322d][_0x4ad5('0x1f')]};});return _0xf7112a;})[_0x4ad5('0x16')](function(_0xd07982){throw _0xd07982;});}; \ No newline at end of file +var _0xa305=['countFilteredContacts','count','User','buildContactsQuery','fields','getFilteredContacts','describe','keys','cf_','CmCustomField','slice','all','length','fieldType','type','catch','./sql-utils','../../mysqldb','findAll','resolve','getContactsSubquery','then','search','parseQueryParameters','where','filter','user','clause','tags','skip','checkListsRestrictions','ids','tag'];(function(_0xbaa6ac,_0x5caae1){var _0x586879=function(_0x23c5fe){while(--_0x23c5fe){_0xbaa6ac['push'](_0xbaa6ac['shift']());}};_0x586879(++_0x5caae1);}(_0xa305,0x139));var _0x5a30=function(_0x141a9f,_0x583251){_0x141a9f=_0x141a9f-0x0;var _0x111641=_0xa305[_0x141a9f];return _0x111641;};'use strict';var _=require('lodash');var sqlUtils=require(_0x5a30('0x0'));var db=require(_0x5a30('0x1'))['db'];exports[_0x5a30('0x2')]=function(_0x349189,_0x91a3d5,_0x4b8ee8,_0x19085f){var _0x28a844={'count':0x0,'rows':[]};var _0xdef9cd=sqlUtils['skipContactsQuery'](_0x91a3d5,_0x349189);if(_0xdef9cd){return Promise[_0x5a30('0x3')](_0x28a844);}var _0xcdb7e2=sqlUtils[_0x5a30('0x4')]();var _0x62ebb2={};var _0x6cd36f=![];var _0x4f05c4=![];return Promise['resolve']()[_0x5a30('0x5')](function(){if(_0x349189[_0x5a30('0x6')]){return sqlUtils['parseAdvancedSearchFilter'](_0x349189[_0x5a30('0x6')],_0x19085f);}else{return sqlUtils[_0x5a30('0x7')](_0x349189,_0x19085f);}})[_0x5a30('0x5')](function(_0x5b42a4){_0xcdb7e2['where'](_0x5b42a4['default']);_0xcdb7e2[_0x5a30('0x8')](_0x5b42a4['fields']);_0xcdb7e2['where'](_0x5b42a4[_0x5a30('0x9')]);_0xcdb7e2['where'](_0x5b42a4[_0x5a30('0xa')][_0x5a30('0xb')]);_0x62ebb2=_0x5b42a4[_0x5a30('0xc')];_0x4f05c4=_0x5b42a4[_0x5a30('0xa')][_0x5a30('0xd')];return sqlUtils[_0x5a30('0xe')](_0x91a3d5,_0x349189,_0x4f05c4);})[_0x5a30('0x5')](function(_0xe33553){_0xcdb7e2[_0x5a30('0x8')](_0xe33553);var _0x182ead=_0x349189[_0x5a30('0x6')]?_0x62ebb2[_0x5a30('0xf')]:_0x349189[_0x5a30('0x10')];_0x6cd36f=_0x182ead?!![]:![];return sqlUtils[_0x5a30('0x11')](_0xcdb7e2,_0x182ead);})[_0x5a30('0x5')](function(_0x568b71){_0x28a844['count']=_0x568b71;if(_0x28a844[_0x5a30('0x12')]===0x0){return;}if(_0x349189[_0x5a30('0x13')]){_0x4f05c4=!![];}return sqlUtils[_0x5a30('0x14')](_0xcdb7e2,_0x349189[_0x5a30('0x15')],_0x4b8ee8,_0x6cd36f,_0x62ebb2[_0x5a30('0xb')],_0x4f05c4);})[_0x5a30('0x5')](function(_0x2c31d6){if(!_0x2c31d6){return[];}return sqlUtils[_0x5a30('0x16')](_0x2c31d6,_0x349189,_0x4b8ee8);})[_0x5a30('0x5')](function(_0x46f7d6){_0x28a844['rows']=_0x46f7d6;return _0x28a844;})['catch'](function(_0x2c7711){throw _0x2c7711;});};exports[_0x5a30('0x17')]=function(){var _0x1e2a29={};var _0x47ff07=[];return db['CmContact'][_0x5a30('0x17')]()[_0x5a30('0x5')](function(_0x271968){_0x1e2a29=_0x271968;var _0x21973d=Object[_0x5a30('0x18')](_0x1e2a29)[_0x5a30('0x9')](function(_0x3340c6){return _['startsWith'](_0x3340c6,_0x5a30('0x19'))?_0x3340c6:undefined;});var _0x324a91=_0x21973d['map'](function(_0x4d7c5c){return db[_0x5a30('0x1a')]['findOne']({'where':{'id':_0x4d7c5c[_0x5a30('0x1b')](0x3)},'raw':!![]});});return Promise[_0x5a30('0x1c')](_0x324a91);})[_0x5a30('0x5')](function(_0x5b9995){for(var _0x2715f6=0x0;_0x2715f6<_0x5b9995[_0x5a30('0x1d')];_0x2715f6++){if(_0x5b9995[_0x2715f6]){var _0x460ac7=_0x5a30('0x19')+_0x5b9995[_0x2715f6]['id'];_0x1e2a29[_0x460ac7][_0x5a30('0x1e')]=_0x5b9995[_0x2715f6][_0x5a30('0x1f')];}}_0x47ff07=_['map'](Object[_0x5a30('0x18')](_0x1e2a29),function(_0xd8f9e7){return{'name':_0xd8f9e7,'type':_0x1e2a29[_0xd8f9e7][_0x5a30('0x1f')]};});return _0x47ff07;})[_0x5a30('0x20')](function(_0x4a55b4){throw _0x4a55b4;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index de229ca..fc1c419 100644 --- a/server/components/contacts/sql-utils.js +++ b/server/components/contacts/sql-utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7335=['getSelectedTags','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','conditions','find','name','datetime','castTo','default','text','value','end','Tag','map','tags','clause','and','ids','User','user','uc.UserId\x20=\x20?','skip','keys','some','compact','Contact','push','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','fields','tag','filter','search','agent','getLists','c.ListId\x20IN\x20?','attributes','group','limit','offset','subqry.id','having','order','DESC','subqry.','findAll','color','Sequelize','QueryTypes','SELECT','CmContact','sequelize','query','toString','Tags','c.id','isEmpty','t.id\x20IN\x20?','COUNT(*)','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','role','true','select','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','subqry','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','lastName','phone','mobile','fax','email','ListId','createdAt','deletedAt','TagIds','includes','forEach','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr'];(function(_0x2aa803,_0x18cb98){var _0x1c3ea=function(_0x8317c){while(--_0x8317c){_0x2aa803['push'](_0x2aa803['shift']());}};_0x1c3ea(++_0x18cb98);}(_0x7335,0x18e));var _0x5733=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0x7335[_0x307d86];return _0x361745;};'use strict';var _=require(_0x5733('0x0'));var squel=require(_0x5733('0x1'));var as=require(_0x5733('0x2'));var qs=require(_0x5733('0x3'));var utils=require('../interaction/utils');var db=require('../../mysqldb')['db'];function skipContactsQuery(_0x2e16c4,_0xd44386){var _0x2626da=![];if(_0x2e16c4[_0x5733('0x4')]==='agent'&&!_0xd44386['search']&&!_0xd44386['ListId']&&_0xd44386['autocomplete']!==_0x5733('0x5')){_0x2626da=!![];}return _0x2626da;}function getContactsSubquery(){return squel[_0x5733('0x6')]()[_0x5733('0x7')](_0x5733('0x8'),'c')[_0x5733('0x9')](_0x5733('0xa'));}function applyJoinClauses(_0x416ecc,_0x225a55){var _0x2802c3=_0x225a55?'c':_0x5733('0xb');_0x416ecc['left_join'](_0x5733('0xc'),'uc',_0x5733('0xd')+_0x2802c3+_0x5733('0xe'))[_0x5733('0xf')](_0x5733('0x10'),'ct',_0x5733('0x11')+_0x2802c3+'.id')['left_join'](_0x5733('0x12'),'t',_0x5733('0x13'));return _0x416ecc;}function addFieldsToQuery(_0x56b692,_0x20e2d1,_0x5957af,_0x23df91,_0x270244){var _0x3f9205=_0x270244?'c':_0x5733('0xb');if(!_0x20e2d1){_0x20e2d1=['id','firstName',_0x5733('0x14'),_0x5733('0x15'),_0x5733('0x16'),_0x5733('0x17'),_0x5733('0x18'),_0x5733('0x19'),'CompanyId',_0x5733('0x1a'),'updatedAt',_0x5733('0x1b'),_0x5733('0x1c')];}else if(!_0x20e2d1[_0x5733('0x1d')]('id')){_0x20e2d1['push']('id');}var _0x4b63f0=_0x5957af&&_0x270244||!_0x5957af&&!_0x270244;if(_0x23df91){_0x4b63f0=_0x23df91&&_0x270244||!_0x23df91&&!_0x270244;}_0x20e2d1[_0x5733('0x1e')](function(_0x4fa6b5){if(_0x4fa6b5===_0x5733('0x1c')){if(_0x4b63f0){_0x56b692[_0x5733('0x1f')](_0x5733('0x20'),_0x4fa6b5);}else if(_0x5957af||_0x23df91){_0x56b692[_0x5733('0x1f')](_0x3f9205+'.'+_0x4fa6b5);}}else{_0x56b692[_0x5733('0x1f')](_0x3f9205+'.'+_0x4fa6b5);}});return _0x56b692;}function getSqlClauses(){var _0x1dfb72={'default':squel['expr'](),'fields':squel[_0x5733('0x21')](),'filter':squel[_0x5733('0x21')](),'tags':{'clause':squel['expr'](),'ids':null},'user':{'clause':squel[_0x5733('0x21')](),'skip':![]}};return _0x1dfb72;}function parseTagParameter(_0x174758){var _0x410cab=squel[_0x5733('0x21')]();if(_0x174758){var _0x4d800f=utils[_0x5733('0x22')](_0x174758);_0x4d800f[_0x5733('0x1e')](function(_0x18eb1b){_0x410cab['or']('CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x18eb1b+',%');});}return _0x410cab;}function parseSearchFilter(_0x36f9ff){var _0x1ace62=squel['expr']();if(_0x36f9ff){var _0x2756d5=_0x36f9ff[_0x5733('0x23')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x2756d5[_0x5733('0x24')]('\x20')[_0x5733('0x25')]>0x1){_0x1ace62['or'](_0x5733('0x26'),qs[_0x5733('0x27')](_0x2756d5,!![]),null);}else{if(qs[_0x5733('0x28')](_0x2756d5)){_0x1ace62['or'](_0x5733('0x29'),_0x2756d5+'%');_0x1ace62['or'](_0x5733('0x2a'),_0x2756d5+'%');_0x1ace62['or'](_0x5733('0x2b'),_0x2756d5+'%');_0x1ace62['or'](_0x5733('0x2c'),_0x2756d5+'%');}else if(qs['isEmail'](_0x2756d5)){_0x1ace62['or'](_0x5733('0x2d'),_0x2756d5+'%');}else{_0x1ace62['or'](_0x5733('0x2e'),'%'+_0x2756d5+'%');_0x1ace62['or'](_0x5733('0x2f'),'%'+_0x2756d5+'%');_0x1ace62['or']('c.email\x20LIKE\x20?','%'+_0x2756d5+'%');}}}return _0x1ace62;}function parseAdvancedSearchFilter(_0x37fbb6,_0x5522bc){var _0x2bfab5=getSqlClauses();var _0x10f669=as[_0x5733('0x30')](_0x37fbb6);var _0x418fc9=_0x10f669['sqlOperator'];for(var _0x1e8fa9=0x0;_0x1e8fa9<_0x10f669[_0x5733('0x31')]['length'];_0x1e8fa9++){var _0x4435f2=_0x10f669[_0x5733('0x31')][_0x1e8fa9];var _0x12030f='c';var _0x2683b2=_[_0x5733('0x32')](_0x5522bc,[_0x5733('0x33'),_0x4435f2['field']]);if(_0x2683b2){if(_0x4435f2['field']==='dateOfBirth'||_0x2683b2['fieldType']===_0x5733('0x34')){_0x4435f2[_0x5733('0x35')]='DATE';}var _0x1e7d87=as['buildExpression'](_0x12030f,_0x2683b2['type'],_0x4435f2);_0x2bfab5[_0x5733('0x36')][_0x418fc9](_0x1e7d87[_0x5733('0x37')],_0x1e7d87[_0x5733('0x38')]['start'],_0x1e7d87['value'][_0x5733('0x39')]);}else{if(_0x4435f2['field']===_0x5733('0x3a')){var _0x1dbf0b=_0x4435f2[_0x5733('0x38')][_0x5733('0x24')](',')[_0x5733('0x3b')](function(_0x3d61a1){return Number(_0x3d61a1);});var _0x4a1484=parseTagParameter(_0x1dbf0b);_0x2bfab5[_0x5733('0x3c')][_0x5733('0x3d')][_0x5733('0x3e')](_0x4a1484);_0x2bfab5[_0x5733('0x3c')][_0x5733('0x3f')]=_0x1dbf0b;}else if(_0x4435f2[_0x5733('0x1f')]===_0x5733('0x40')){_0x2bfab5[_0x5733('0x41')][_0x5733('0x3d')][_0x5733('0x3e')](_0x5733('0x42'),_0x4435f2[_0x5733('0x38')]);_0x2bfab5[_0x5733('0x41')][_0x5733('0x43')]=!![];}}}return _0x2bfab5;}function parseModelFields(_0x1e5ba9,_0x80e509){var _0x5c3c64=squel['expr']();var _0x45ab39=_(_0x1e5ba9)[_0x5733('0x44')]()['map'](function(_0x552ca1){return _[_0x5733('0x45')](_0x80e509,[_0x5733('0x33'),_0x552ca1])?_0x552ca1:undefined;})[_0x5733('0x46')]()[_0x5733('0x38')]();if(_0x1e5ba9[_0x5733('0x47')]){_0x45ab39[_0x5733('0x48')]('Contact');}if(_0x1e5ba9['User']){_0x45ab39[_0x5733('0x48')]('User');}if(_0x45ab39[_0x5733('0x25')]>0x0){_0x45ab39[_0x5733('0x1e')](function(_0x16c6bd){if(_0x16c6bd===_0x5733('0x19')){_0x5c3c64[_0x5733('0x3e')]('c.ListId\x20IN\x20?',[]['concat'](_0x1e5ba9[_0x16c6bd]));}else if(_0x16c6bd==='Contact'){var _0x5bbe71='%'+_0x1e5ba9[_0x16c6bd]+'%';_0x5c3c64[_0x5733('0x3e')](_0x5733('0x49'),_0x5bbe71);}else if(_0x16c6bd===_0x5733('0x40')){_0x5c3c64[_0x5733('0x3e')](_0x5733('0x42'),_0x1e5ba9[_0x16c6bd]);}else{_0x5c3c64['and']('c.'+_0x16c6bd+_0x5733('0x4a'),_0x1e5ba9[_0x16c6bd]);}});}return _0x5c3c64;}function parseQueryParameters(_0x3816b4,_0x46225c){var _0xc8ff0f=getSqlClauses();return Promise[_0x5733('0x4b')]()[_0x5733('0x4c')](function(){return parseModelFields(_0x3816b4,_0x46225c);})['then'](function(_0x535637){_0xc8ff0f[_0x5733('0x4d')]['and'](_0x535637);return parseTagParameter(_0x3816b4[_0x5733('0x4e')]);})['then'](function(_0x1865d7){_0xc8ff0f[_0x5733('0x3c')][_0x5733('0x3d')][_0x5733('0x3e')](_0x1865d7);return parseSearchFilter(_0x3816b4[_0x5733('0x4f')]);})['then'](function(_0x521a26){_0xc8ff0f[_0x5733('0x4f')]=_0x521a26;return _0xc8ff0f;});}function checkListsRestrictions(_0x3b61ba,_0x2a5617,_0x30b96f){var _0x505a82=squel[_0x5733('0x21')]();return Promise[_0x5733('0x4b')]()['then'](function(){if(_0x2a5617[_0x5733('0x50')]&&_0x3b61ba[_0x5733('0x4')]===_0x5733('0x51')&&!_0x30b96f){return _0x3b61ba[_0x5733('0x52')]({'attributes':['id'],'raw':!![]});}})[_0x5733('0x4c')](function(_0x5a5b2d){if(_0x5a5b2d){if(_0x5a5b2d[_0x5733('0x25')]===0x0){_0x505a82[_0x5733('0x3e')]('c.ListId\x20IS\x20NULL');}else{_0x505a82[_0x5733('0x3e')](_0x5733('0x53'),_[_0x5733('0x3b')](_0x5a5b2d,'id'));}}})[_0x5733('0x4c')](function(){return _0x505a82;});}function buildContactsQuery(_0x4ae466,_0x26eb70,_0x165b81,_0x33df15,_0x4b32b0,_0x118070){if(_0x26eb70){_0x26eb70=_0x165b81[_0x5733('0x54')];}_0x4ae466=addFieldsToQuery(_0x4ae466,_0x26eb70,_0x33df15,_0x118070,!![]);var _0xccdfdd=squel['select']();_0xccdfdd=addFieldsToQuery(_0xccdfdd,_0x26eb70,_0x33df15,_0x118070,![]);if(_0x33df15||_0x118070){_0x4ae466=applyJoinClauses(_0x4ae466,!![]);_0x4ae466[_0x5733('0x55')]('c.id');if(_0x165b81['limit']){_0xccdfdd[_0x5733('0x56')](_0x165b81[_0x5733('0x56')]);}if(_0x165b81[_0x5733('0x57')]){_0xccdfdd[_0x5733('0x57')](_0x165b81[_0x5733('0x57')]);}}else{_0xccdfdd=applyJoinClauses(_0xccdfdd,![]);_0xccdfdd[_0x5733('0x55')](_0x5733('0x58'));if(_0x165b81['limit']){_0x4ae466['limit'](_0x165b81[_0x5733('0x56')]);}if(_0x165b81['offset']){_0x4ae466[_0x5733('0x57')](_0x165b81[_0x5733('0x57')]);}}_0xccdfdd[_0x5733('0x59')](_0x4b32b0);if(_0x165b81['order']){_0x165b81['order']['forEach'](function(_0x2929e7){_0x4ae466[_0x5733('0x5a')]('c.'+_0x2929e7[0x0],_0x2929e7[0x1]===_0x5733('0x5b')?![]:!![]);_0xccdfdd[_0x5733('0x5a')](_0x5733('0x5c')+_0x2929e7[0x0],_0x2929e7[0x1]===_0x5733('0x5b')?![]:!![]);});}_0xccdfdd[_0x5733('0x7')](_0x4ae466,_0x5733('0xb'));return _0xccdfdd;}function getFilteredContacts(_0xa71881){var _0x394313=[];return db[_0x5733('0x3a')][_0x5733('0x5d')]({'attributes':['id',_0x5733('0x33'),_0x5733('0x5e')],'raw':!![]})[_0x5733('0x4c')](function(_0x21038f){_0x394313=_['keyBy'](_0x21038f,'id');var _0x3511c4={'type':db[_0x5733('0x5f')][_0x5733('0x60')][_0x5733('0x61')],'model':db[_0x5733('0x62')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x5733('0x63')][_0x5733('0x64')](_0xa71881[_0x5733('0x65')](),_0x3511c4);})[_0x5733('0x4c')](function(_0x169f3f){_0x169f3f['forEach'](function(_0x437fb2){if(_0x437fb2['TagIds']){_0x437fb2['Tags']=[];_0x437fb2['TagIds'][_0x5733('0x24')](',')['forEach'](function(_0xc523ea){_0x437fb2[_0x5733('0x66')][_0x5733('0x48')](_0x394313[_0xc523ea]);});}delete _0x437fb2[_0x5733('0x1c')];});return _0x169f3f;});}function countFilteredContacts(_0x1fb8d1,_0x56e0f4){var _0x265082=_0x1fb8d1['clone']();_0x265082['field']('COUNT(*)');_0x265082=applyJoinClauses(_0x265082,!![]);_0x1fb8d1[_0x5733('0x55')](_0x5733('0x67'));var _0x532626=utils['getSelectedTags'](_0x56e0f4);if(!_[_0x5733('0x68')](_0x532626)){_0x265082['where'](_0x5733('0x69'),_0x532626);}var _0x213bdf={'type':db[_0x5733('0x5f')][_0x5733('0x60')][_0x5733('0x61')],'raw':!![]};return db[_0x5733('0x63')][_0x5733('0x64')](_0x265082[_0x5733('0x65')](),_0x213bdf)[_0x5733('0x4c')](function(_0x1294c0){return _0x1294c0[0x0][_0x5733('0x6a')];});}module[_0x5733('0x6b')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0xb5d3=['DESC','subqry.','findAll','color','keyBy','Sequelize','QueryTypes','SELECT','sequelize','query','Tags','clone','COUNT(*)','c.id','isEmpty','toString','exports','squel','../parsers/qs','../../mysqldb','agent','search','ListId','select','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','subqry','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','cm_contact_has_tags','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','firstName','lastName','mobile','fax','createdAt','updatedAt','deletedAt','TagIds','includes','push','forEach','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','sqlOperator','conditions','find','name','dateOfBirth','fieldType','datetime','DATE','text','value','Tag','map','tags','clause','and','user','uc.UserId\x20=\x20?','skip','some','compact','Contact','User','c.ListId\x20IN\x20?','concat','\x20=\x20?','resolve','then','fields','tag','filter','getLists','attributes','group','limit','offset','subqry.id','having','order'];(function(_0x35ce58,_0x2c51ac){var _0x2a0b40=function(_0x426abb){while(--_0x426abb){_0x35ce58['push'](_0x35ce58['shift']());}};_0x2a0b40(++_0x2c51ac);}(_0xb5d3,0x146));var _0x3b5d=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0xb5d3[_0x4dc7b9];return _0x3ab114;};'use strict';var _=require('lodash');var squel=require(_0x3b5d('0x0'));var as=require('../parsers/advancedSearch');var qs=require(_0x3b5d('0x1'));var utils=require('../interaction/utils');var db=require(_0x3b5d('0x2'))['db'];function skipContactsQuery(_0x51734d,_0x292140){var _0x50dbcc=![];if(_0x51734d['role']===_0x3b5d('0x3')&&!_0x292140[_0x3b5d('0x4')]&&!_0x292140[_0x3b5d('0x5')]&&_0x292140['autocomplete']!=='true'){_0x50dbcc=!![];}return _0x50dbcc;}function getContactsSubquery(){return squel[_0x3b5d('0x6')]()[_0x3b5d('0x7')](_0x3b5d('0x8'),'c')[_0x3b5d('0x9')](_0x3b5d('0xa'));}function applyJoinClauses(_0x561e1b,_0x1bbad3){var _0x214333=_0x1bbad3?'c':_0x3b5d('0xb');_0x561e1b[_0x3b5d('0xc')](_0x3b5d('0xd'),'uc',_0x3b5d('0xe')+_0x214333+_0x3b5d('0xf'))[_0x3b5d('0xc')](_0x3b5d('0x10'),'ct',_0x3b5d('0x11')+_0x214333+_0x3b5d('0xf'))[_0x3b5d('0xc')](_0x3b5d('0x12'),'t',_0x3b5d('0x13'));return _0x561e1b;}function addFieldsToQuery(_0x15a789,_0x520117,_0x3398d4,_0x4d9875,_0x24d206){var _0x3d6ecb=_0x24d206?'c':_0x3b5d('0xb');if(!_0x520117){_0x520117=['id',_0x3b5d('0x14'),_0x3b5d('0x15'),'phone',_0x3b5d('0x16'),_0x3b5d('0x17'),'email',_0x3b5d('0x5'),'CompanyId',_0x3b5d('0x18'),_0x3b5d('0x19'),_0x3b5d('0x1a'),_0x3b5d('0x1b')];}else if(!_0x520117[_0x3b5d('0x1c')]('id')){_0x520117[_0x3b5d('0x1d')]('id');}var _0x4c1a9b=_0x3398d4&&_0x24d206||!_0x3398d4&&!_0x24d206;if(_0x4d9875){_0x4c1a9b=_0x4d9875&&_0x24d206||!_0x4d9875&&!_0x24d206;}_0x520117[_0x3b5d('0x1e')](function(_0x1316e0){if(_0x1316e0===_0x3b5d('0x1b')){if(_0x4c1a9b){_0x15a789[_0x3b5d('0x1f')](_0x3b5d('0x20'),_0x1316e0);}else if(_0x3398d4||_0x4d9875){_0x15a789[_0x3b5d('0x1f')](_0x3d6ecb+'.'+_0x1316e0);}}else{_0x15a789[_0x3b5d('0x1f')](_0x3d6ecb+'.'+_0x1316e0);}});return _0x15a789;}function getSqlClauses(){var _0x5bd121={'default':squel[_0x3b5d('0x21')](),'fields':squel[_0x3b5d('0x21')](),'filter':squel[_0x3b5d('0x21')](),'tags':{'clause':squel['expr'](),'ids':null},'user':{'clause':squel[_0x3b5d('0x21')](),'skip':![]}};return _0x5bd121;}function parseTagParameter(_0x2ba91b){var _0x3e4f47=squel[_0x3b5d('0x21')]();if(_0x2ba91b){var _0x4fdafd=utils[_0x3b5d('0x22')](_0x2ba91b);_0x4fdafd[_0x3b5d('0x1e')](function(_0x5c7fcf){_0x3e4f47['or'](_0x3b5d('0x23'),'%,'+_0x5c7fcf+',%');});}return _0x3e4f47;}function parseSearchFilter(_0x40dca2){var _0x497127=squel[_0x3b5d('0x21')]();if(_0x40dca2){var _0x1cc179=_0x40dca2[_0x3b5d('0x24')]('\x5c','\x5c\x5c')[_0x3b5d('0x24')](/'/g,'\x27\x27');if(_0x1cc179[_0x3b5d('0x25')]('\x20')[_0x3b5d('0x26')]>0x1){_0x497127['or'](_0x3b5d('0x27'),qs['getFullTextValue'](_0x1cc179,!![]),null);}else{if(qs[_0x3b5d('0x28')](_0x1cc179)){_0x497127['or'](_0x3b5d('0x29'),_0x1cc179+'%');_0x497127['or'](_0x3b5d('0x2a'),_0x1cc179+'%');_0x497127['or']('c.mobile\x20LIKE\x20?',_0x1cc179+'%');_0x497127['or'](_0x3b5d('0x2b'),_0x1cc179+'%');}else if(qs[_0x3b5d('0x2c')](_0x1cc179)){_0x497127['or']('c.email\x20LIKE\x20?',_0x1cc179+'%');}else{_0x497127['or'](_0x3b5d('0x2d'),'%'+_0x1cc179+'%');_0x497127['or'](_0x3b5d('0x2e'),'%'+_0x1cc179+'%');_0x497127['or'](_0x3b5d('0x2f'),'%'+_0x1cc179+'%');}}}return _0x497127;}function parseAdvancedSearchFilter(_0x3e576c,_0x42aafd){var _0x568266=getSqlClauses();var _0x559ef6=as['parseSearch'](_0x3e576c);var _0x4f4e6f=_0x559ef6[_0x3b5d('0x30')];for(var _0x70be7c=0x0;_0x70be7c<_0x559ef6[_0x3b5d('0x31')][_0x3b5d('0x26')];_0x70be7c++){var _0x4c28bf=_0x559ef6[_0x3b5d('0x31')][_0x70be7c];var _0x4b315a='c';var _0x43a513=_[_0x3b5d('0x32')](_0x42aafd,[_0x3b5d('0x33'),_0x4c28bf[_0x3b5d('0x1f')]]);if(_0x43a513){if(_0x4c28bf[_0x3b5d('0x1f')]===_0x3b5d('0x34')||_0x43a513[_0x3b5d('0x35')]===_0x3b5d('0x36')){_0x4c28bf['castTo']=_0x3b5d('0x37');}var _0x40a62d=as['buildExpression'](_0x4b315a,_0x43a513['type'],_0x4c28bf);_0x568266['default'][_0x4f4e6f](_0x40a62d[_0x3b5d('0x38')],_0x40a62d[_0x3b5d('0x39')]['start'],_0x40a62d[_0x3b5d('0x39')]['end']);}else{if(_0x4c28bf[_0x3b5d('0x1f')]===_0x3b5d('0x3a')){var _0x36e81b=_0x4c28bf[_0x3b5d('0x39')]['split'](',')[_0x3b5d('0x3b')](function(_0x55ecce){return Number(_0x55ecce);});var _0x49c40f=parseTagParameter(_0x36e81b);_0x568266[_0x3b5d('0x3c')][_0x3b5d('0x3d')][_0x3b5d('0x3e')](_0x49c40f);_0x568266[_0x3b5d('0x3c')]['ids']=_0x36e81b;}else if(_0x4c28bf[_0x3b5d('0x1f')]==='User'){_0x568266[_0x3b5d('0x3f')][_0x3b5d('0x3d')][_0x3b5d('0x3e')](_0x3b5d('0x40'),_0x4c28bf[_0x3b5d('0x39')]);_0x568266[_0x3b5d('0x3f')][_0x3b5d('0x41')]=!![];}}}return _0x568266;}function parseModelFields(_0x755a63,_0x1d24e7){var _0x29eebe=squel[_0x3b5d('0x21')]();var _0x112bc9=_(_0x755a63)['keys']()[_0x3b5d('0x3b')](function(_0x4ed650){return _[_0x3b5d('0x42')](_0x1d24e7,[_0x3b5d('0x33'),_0x4ed650])?_0x4ed650:undefined;})[_0x3b5d('0x43')]()['value']();if(_0x755a63[_0x3b5d('0x44')]){_0x112bc9[_0x3b5d('0x1d')](_0x3b5d('0x44'));}if(_0x755a63[_0x3b5d('0x45')]){_0x112bc9['push'](_0x3b5d('0x45'));}if(_0x112bc9['length']>0x0){_0x112bc9[_0x3b5d('0x1e')](function(_0x5cf346){if(_0x5cf346===_0x3b5d('0x5')){_0x29eebe['and'](_0x3b5d('0x46'),[][_0x3b5d('0x47')](_0x755a63[_0x5cf346]));}else if(_0x5cf346===_0x3b5d('0x44')){var _0x47eee2='%'+_0x755a63[_0x5cf346]+'%';_0x29eebe['and']('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x47eee2);}else if(_0x5cf346===_0x3b5d('0x45')){_0x29eebe[_0x3b5d('0x3e')](_0x3b5d('0x40'),_0x755a63[_0x5cf346]);}else{_0x29eebe[_0x3b5d('0x3e')]('c.'+_0x5cf346+_0x3b5d('0x48'),_0x755a63[_0x5cf346]);}});}return _0x29eebe;}function parseQueryParameters(_0x388814,_0x1ff7c7){var _0x435a93=getSqlClauses();return Promise[_0x3b5d('0x49')]()[_0x3b5d('0x4a')](function(){return parseModelFields(_0x388814,_0x1ff7c7);})['then'](function(_0x46a36f){_0x435a93[_0x3b5d('0x4b')][_0x3b5d('0x3e')](_0x46a36f);return parseTagParameter(_0x388814[_0x3b5d('0x4c')]);})[_0x3b5d('0x4a')](function(_0x39378){_0x435a93['tags'][_0x3b5d('0x3d')][_0x3b5d('0x3e')](_0x39378);return parseSearchFilter(_0x388814[_0x3b5d('0x4d')]);})['then'](function(_0x799e56){_0x435a93[_0x3b5d('0x4d')]=_0x799e56;return _0x435a93;});}function checkListsRestrictions(_0x262095,_0x2691d1,_0x4b3ed9){var _0x4249e6=squel[_0x3b5d('0x21')]();return Promise[_0x3b5d('0x49')]()[_0x3b5d('0x4a')](function(){if(_0x2691d1['search']&&_0x262095['role']===_0x3b5d('0x3')&&!_0x4b3ed9){return _0x262095[_0x3b5d('0x4e')]({'attributes':['id'],'raw':!![]});}})[_0x3b5d('0x4a')](function(_0x51ed0f){if(_0x51ed0f){if(_0x51ed0f[_0x3b5d('0x26')]===0x0){_0x4249e6[_0x3b5d('0x3e')]('c.ListId\x20IS\x20NULL');}else{_0x4249e6[_0x3b5d('0x3e')](_0x3b5d('0x46'),_[_0x3b5d('0x3b')](_0x51ed0f,'id'));}}})[_0x3b5d('0x4a')](function(){return _0x4249e6;});}function buildContactsQuery(_0x3364bd,_0x2fbf29,_0x748ca1,_0x2c5c2a,_0x255d85,_0x35961a){if(_0x2fbf29){_0x2fbf29=_0x748ca1[_0x3b5d('0x4f')];}_0x3364bd=addFieldsToQuery(_0x3364bd,_0x2fbf29,_0x2c5c2a,_0x35961a,!![]);var _0x13d6c6=squel[_0x3b5d('0x6')]();_0x13d6c6=addFieldsToQuery(_0x13d6c6,_0x2fbf29,_0x2c5c2a,_0x35961a,![]);if(_0x2c5c2a||_0x35961a){_0x3364bd=applyJoinClauses(_0x3364bd,!![]);_0x3364bd[_0x3b5d('0x50')]('c.id');if(_0x748ca1[_0x3b5d('0x51')]){_0x13d6c6['limit'](_0x748ca1[_0x3b5d('0x51')]);}if(_0x748ca1[_0x3b5d('0x52')]){_0x13d6c6[_0x3b5d('0x52')](_0x748ca1[_0x3b5d('0x52')]);}}else{_0x13d6c6=applyJoinClauses(_0x13d6c6,![]);_0x13d6c6[_0x3b5d('0x50')](_0x3b5d('0x53'));if(_0x748ca1[_0x3b5d('0x51')]){_0x3364bd[_0x3b5d('0x51')](_0x748ca1['limit']);}if(_0x748ca1[_0x3b5d('0x52')]){_0x3364bd['offset'](_0x748ca1[_0x3b5d('0x52')]);}}_0x13d6c6[_0x3b5d('0x54')](_0x255d85);if(_0x748ca1['order']){_0x748ca1[_0x3b5d('0x55')][_0x3b5d('0x1e')](function(_0x2f7da5){_0x3364bd['order']('c.'+_0x2f7da5[0x0],_0x2f7da5[0x1]===_0x3b5d('0x56')?![]:!![]);_0x13d6c6['order'](_0x3b5d('0x57')+_0x2f7da5[0x0],_0x2f7da5[0x1]===_0x3b5d('0x56')?![]:!![]);});}_0x13d6c6[_0x3b5d('0x7')](_0x3364bd,_0x3b5d('0xb'));return _0x13d6c6;}function getFilteredContacts(_0x1ceea5){var _0x1a8951=[];return db[_0x3b5d('0x3a')][_0x3b5d('0x58')]({'attributes':['id',_0x3b5d('0x33'),_0x3b5d('0x59')],'raw':!![]})[_0x3b5d('0x4a')](function(_0x547aca){_0x1a8951=_[_0x3b5d('0x5a')](_0x547aca,'id');var _0x48c82b={'type':db[_0x3b5d('0x5b')][_0x3b5d('0x5c')][_0x3b5d('0x5d')],'model':db['CmContact'],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x3b5d('0x5e')][_0x3b5d('0x5f')](_0x1ceea5['toString'](),_0x48c82b);})[_0x3b5d('0x4a')](function(_0x43b1d4){_0x43b1d4[_0x3b5d('0x1e')](function(_0x5066e4){if(_0x5066e4[_0x3b5d('0x1b')]){_0x5066e4[_0x3b5d('0x60')]=[];_0x5066e4[_0x3b5d('0x1b')][_0x3b5d('0x25')](',')[_0x3b5d('0x1e')](function(_0x34b263){_0x5066e4['Tags'][_0x3b5d('0x1d')](_0x1a8951[_0x34b263]);});}delete _0x5066e4[_0x3b5d('0x1b')];});return _0x43b1d4;});}function countFilteredContacts(_0x208fc1,_0x17f0c0){var _0xb28905=_0x208fc1[_0x3b5d('0x61')]();_0xb28905[_0x3b5d('0x1f')](_0x3b5d('0x62'));_0xb28905=applyJoinClauses(_0xb28905,!![]);_0x208fc1[_0x3b5d('0x50')](_0x3b5d('0x63'));var _0x14a872=utils[_0x3b5d('0x22')](_0x17f0c0);if(!_[_0x3b5d('0x64')](_0x14a872)){_0xb28905[_0x3b5d('0x9')]('t.id\x20IN\x20?',_0x14a872);}var _0x29a36f={'type':db[_0x3b5d('0x5b')]['QueryTypes'][_0x3b5d('0x5d')],'raw':!![]};return db['sequelize'][_0x3b5d('0x5f')](_0xb28905[_0x3b5d('0x65')](),_0x29a36f)['then'](function(_0xa0e583){return _0xa0e583[0x0][_0x3b5d('0x62')];});}module[_0x3b5d('0x66')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 8391ea0..0034ada 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 _0x3ddd=['createReadStream','createDecipher','data','encryptString','createCipher','base64','decryptString','secret','utf8','bluebird','lodash','../../config/environment','../../config/logger','app','secrets','aes-256-ctr','aes192','encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','hasOwnProperty','encryptFile','createWriteStream','update','binary','write','end','final','close','unlink'];(function(_0x4afac5,_0x1ab4ed){var _0x2404b3=function(_0x5c700b){while(--_0x5c700b){_0x4afac5['push'](_0x4afac5['shift']());}};_0x2404b3(++_0x1ab4ed);}(_0x3ddd,0xb3));var _0xd3dd=function(_0x5751c6,_0x322b15){_0x5751c6=_0x5751c6-0x0;var _0x502864=_0x3ddd[_0x5751c6];return _0x502864;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0xd3dd('0x0'));var _=require(_0xd3dd('0x1'));var config=require(_0xd3dd('0x2'));var logger=require(_0xd3dd('0x3'))(_0xd3dd('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xd3dd('0x5')]['session'],'algorithm':_0xd3dd('0x6')};const fileOptions={'algorithm':_0xd3dd('0x7')};if(config['encrypt']&&config[_0xd3dd('0x8')][_0xd3dd('0x9')]){var isSupported=isAlgorithmSupported(config[_0xd3dd('0x8')]['algorithm']);if(isSupported){fileOptions[_0xd3dd('0x9')]=config[_0xd3dd('0x8')][_0xd3dd('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xd3dd('0xa')](',\x20');logger['error'](config[_0xd3dd('0x8')][_0xd3dd('0x9')],_0xd3dd('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x58d911){return AES_SUPPORTED_RX[_0xd3dd('0xc')](_0x58d911);}function getSupportedCiphers(){return crypto[_0xd3dd('0xd')]()[_0xd3dd('0xe')](isASupportedCipher);}function isAlgorithmSupported(_0x4f52da){return getSupportedCiphers()['indexOf'](_0x4f52da)>-0x1;}function combineOptions(_0x160230){var _0x32b93a={};for(var _0x598187 in fileOptions){if(fileOptions[_0xd3dd('0xf')](_0x598187)){_0x32b93a[_0x598187]=fileOptions[_0x598187];}}if(_0x160230){for(var _0x2754b4 in _0x160230){if(_0x160230['hasOwnProperty'](_0x2754b4)){_0x32b93a[_0x2754b4]=_0x160230[_0x2754b4];}}}return _0x32b93a;}exports[_0xd3dd('0x10')]=function(_0x2505ac,_0x506e03,_0x2182c7,_0x39f348){return new BPromise(function(_0x45cf53,_0x4fe128){_0x39f348=combineOptions(_0x39f348);var _0x25c6ac=new Buffer(_0x2182c7);var _0x1b716a=fs['createReadStream'](_0x2505ac);var _0x381b4d=fs[_0xd3dd('0x11')](_0x506e03);var _0x2d90b3=crypto['createCipher'](_0x39f348[_0xd3dd('0x9')],_0x25c6ac);_0x1b716a['on']('data',function(_0x5f133f){var _0x376ea0=new Buffer(_0x2d90b3[_0xd3dd('0x12')](_0x5f133f),_0xd3dd('0x13'));_0x381b4d[_0xd3dd('0x14')](_0x376ea0);});_0x1b716a['on'](_0xd3dd('0x15'),function(){try{var _0x3274f2=new Buffer(_0x2d90b3[_0xd3dd('0x16')](_0xd3dd('0x13')),'binary');_0x381b4d[_0xd3dd('0x14')](_0x3274f2);_0x381b4d[_0xd3dd('0x15')]();_0x381b4d['on'](_0xd3dd('0x17'),function(){return _0x45cf53(_0x506e03);});}catch(_0x529f88){fs[_0xd3dd('0x18')](_0x506e03);return _0x4fe128(_0x529f88);}});});};exports['decryptFile']=function(_0x68b2e,_0x1d2021,_0x46048a,_0x55140b){return new BPromise(function(_0x3b35ab,_0x4a761a){_0x55140b=combineOptions(_0x55140b);var _0x23bf53=new Buffer(_0x46048a);var _0x2d1779=fs[_0xd3dd('0x19')](_0x68b2e);var _0x4e9f47=fs['createWriteStream'](_0x1d2021);var _0x2d1887=crypto[_0xd3dd('0x1a')](_0x55140b[_0xd3dd('0x9')],_0x23bf53);_0x2d1779['on'](_0xd3dd('0x1b'),function(_0x44531d){var _0x3fd5c7=new Buffer(_0x2d1887['update'](_0x44531d),'binary');_0x4e9f47[_0xd3dd('0x14')](_0x3fd5c7);});_0x2d1779['on'](_0xd3dd('0x15'),function(){try{var _0x1c138f=new Buffer(_0x2d1887[_0xd3dd('0x16')](_0xd3dd('0x13')),_0xd3dd('0x13'));_0x4e9f47[_0xd3dd('0x14')](_0x1c138f);_0x4e9f47[_0xd3dd('0x15')]();_0x4e9f47['on']('close',function(){return _0x3b35ab(_0x1d2021);});}catch(_0x1ff97a){fs['unlink'](_0x1d2021);return _0x4a761a(_0x1ff97a);}});});};exports[_0xd3dd('0x1c')]=function(_0x174620,_0x5191b7,_0x1a7fe4){var _0xce1e5f=_0x1a7fe4||stringOptions[_0xd3dd('0x9')];var _0x2cd6da=_0x5191b7||stringOptions['secret'];var _0x2182f3=crypto[_0xd3dd('0x1d')](_0xce1e5f,_0x2cd6da);var _0x2a9d0f=_0x2182f3[_0xd3dd('0x12')](_0x174620,'utf8',_0xd3dd('0x1e'));_0x2a9d0f+=_0x2182f3[_0xd3dd('0x16')]('base64');return _0x2a9d0f;};exports[_0xd3dd('0x1f')]=function(_0x3d2e5b,_0x46a7bd,_0x1679cb){var _0x59ec2e=_0x1679cb||stringOptions['algorithm'];var _0x5ca611=_0x46a7bd||stringOptions[_0xd3dd('0x20')];var _0x21bf47=crypto[_0xd3dd('0x1a')](_0x59ec2e,_0x5ca611);var _0x319947=_0x21bf47[_0xd3dd('0x12')](_0x3d2e5b,_0xd3dd('0x1e'),_0xd3dd('0x21'));_0x319947+=_0x21bf47[_0xd3dd('0x16')](_0xd3dd('0x21'));return _0x319947;}; \ No newline at end of file +var _0x38c7=['close','createReadStream','createWriteStream','createDecipher','unlink','encryptString','secret','base64','decryptString','utf8','crypto','bluebird','lodash','../../config/environment','../../config/logger','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createCipher','update','binary','end','final','write'];(function(_0x29166b,_0x3c0f7a){var _0x3d1ff2=function(_0x3611cd){while(--_0x3611cd){_0x29166b['push'](_0x29166b['shift']());}};_0x3d1ff2(++_0x3c0f7a);}(_0x38c7,0x122));var _0x738c=function(_0x3e7139,_0x37bab7){_0x3e7139=_0x3e7139-0x0;var _0x1004e3=_0x38c7[_0x3e7139];return _0x1004e3;};'use strict';var crypto=require(_0x738c('0x0'));var fs=require('fs');var BPromise=require(_0x738c('0x1'));var _=require(_0x738c('0x2'));var config=require(_0x738c('0x3'));var logger=require(_0x738c('0x4'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x738c('0x5')][_0x738c('0x6')],'algorithm':_0x738c('0x7')};const fileOptions={'algorithm':_0x738c('0x8')};if(config[_0x738c('0x9')]&&config[_0x738c('0x9')][_0x738c('0xa')]){var isSupported=isAlgorithmSupported(config['encrypt']['algorithm']);if(isSupported){fileOptions['algorithm']=config['encrypt']['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0x738c('0xb')](config[_0x738c('0x9')][_0x738c('0xa')],_0x738c('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x2c8834){return AES_SUPPORTED_RX[_0x738c('0xd')](_0x2c8834);}function getSupportedCiphers(){return crypto[_0x738c('0xe')]()[_0x738c('0xf')](isASupportedCipher);}function isAlgorithmSupported(_0x6430d3){return getSupportedCiphers()[_0x738c('0x10')](_0x6430d3)>-0x1;}function combineOptions(_0x57c884){var _0x2de2ce={};for(var _0x4164b5 in fileOptions){if(fileOptions[_0x738c('0x11')](_0x4164b5)){_0x2de2ce[_0x4164b5]=fileOptions[_0x4164b5];}}if(_0x57c884){for(var _0x2e1f5c in _0x57c884){if(_0x57c884[_0x738c('0x11')](_0x2e1f5c)){_0x2de2ce[_0x2e1f5c]=_0x57c884[_0x2e1f5c];}}}return _0x2de2ce;}exports[_0x738c('0x12')]=function(_0x47fbba,_0x1243aa,_0x3fe9e6,_0x4676cb){return new BPromise(function(_0x314ec6,_0x7f0034){_0x4676cb=combineOptions(_0x4676cb);var _0x857816=new Buffer(_0x3fe9e6);var _0x24881b=fs['createReadStream'](_0x47fbba);var _0xaab29d=fs['createWriteStream'](_0x1243aa);var _0x275c4b=crypto[_0x738c('0x13')](_0x4676cb['algorithm'],_0x857816);_0x24881b['on']('data',function(_0xf3ae93){var _0x109c66=new Buffer(_0x275c4b[_0x738c('0x14')](_0xf3ae93),_0x738c('0x15'));_0xaab29d['write'](_0x109c66);});_0x24881b['on'](_0x738c('0x16'),function(){try{var _0x2ee9cd=new Buffer(_0x275c4b[_0x738c('0x17')](_0x738c('0x15')),_0x738c('0x15'));_0xaab29d[_0x738c('0x18')](_0x2ee9cd);_0xaab29d['end']();_0xaab29d['on'](_0x738c('0x19'),function(){return _0x314ec6(_0x1243aa);});}catch(_0x6df9d1){fs['unlink'](_0x1243aa);return _0x7f0034(_0x6df9d1);}});});};exports['decryptFile']=function(_0x221442,_0x3552af,_0x3493a9,_0x515863){return new BPromise(function(_0x13891a,_0x221d60){_0x515863=combineOptions(_0x515863);var _0x168ca0=new Buffer(_0x3493a9);var _0x548621=fs[_0x738c('0x1a')](_0x221442);var _0x472b7a=fs[_0x738c('0x1b')](_0x3552af);var _0x4bc3b6=crypto[_0x738c('0x1c')](_0x515863['algorithm'],_0x168ca0);_0x548621['on']('data',function(_0x22f07b){var _0x44433c=new Buffer(_0x4bc3b6[_0x738c('0x14')](_0x22f07b),'binary');_0x472b7a['write'](_0x44433c);});_0x548621['on'](_0x738c('0x16'),function(){try{var _0xf1f5b2=new Buffer(_0x4bc3b6[_0x738c('0x17')](_0x738c('0x15')),_0x738c('0x15'));_0x472b7a[_0x738c('0x18')](_0xf1f5b2);_0x472b7a[_0x738c('0x16')]();_0x472b7a['on'](_0x738c('0x19'),function(){return _0x13891a(_0x3552af);});}catch(_0x3ff995){fs[_0x738c('0x1d')](_0x3552af);return _0x221d60(_0x3ff995);}});});};exports[_0x738c('0x1e')]=function(_0x570109,_0x424dd4,_0x538750){var _0x267916=_0x538750||stringOptions['algorithm'];var _0x48b32c=_0x424dd4||stringOptions[_0x738c('0x1f')];var _0x3f263a=crypto[_0x738c('0x13')](_0x267916,_0x48b32c);var _0x2ac64e=_0x3f263a[_0x738c('0x14')](_0x570109,'utf8',_0x738c('0x20'));_0x2ac64e+=_0x3f263a['final']('base64');return _0x2ac64e;};exports[_0x738c('0x21')]=function(_0x47cb2a,_0x159fec,_0x25cec9){var _0x342e60=_0x25cec9||stringOptions[_0x738c('0xa')];var _0x1828cd=_0x159fec||stringOptions[_0x738c('0x1f')];var _0xdf7ced=crypto[_0x738c('0x1c')](_0x342e60,_0x1828cd);var _0x2ad6ac=_0xdf7ced[_0x738c('0x14')](_0x47cb2a,'base64',_0x738c('0x22'));_0x2ad6ac+=_0xdf7ced[_0x738c('0x17')]('utf8');return _0x2ad6ac;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 3a504d6..0eb777a 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 _0x086a=['argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','length','range','isInteger','forEach','push','QueryTypes','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','existsSync','join','%s%d.%s','csv','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','%s.%s','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','exit','util','path','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics'];(function(_0x1ba553,_0x337ae8){var _0x522c4a=function(_0x39f80f){while(--_0x39f80f){_0x1ba553['push'](_0x1ba553['shift']());}};_0x522c4a(++_0x337ae8);}(_0x086a,0x154));var _0xa086=function(_0x183a0e,_0x2fc52d){_0x183a0e=_0x183a0e-0x0;var _0x150981=_0x086a[_0x183a0e];return _0x150981;};'use strict';var util=require(_0xa086('0x0'));var path=require(_0xa086('0x1'));var _=require('lodash');var csv=require(_0xa086('0x2'));var fs=require('fs');var BPromise=require(_0xa086('0x3'));var zipdir=require(_0xa086('0x4'));var rimraf=require(_0xa086('0x5'));var db=require(_0xa086('0x6'))['db'];var dbH=require(_0xa086('0x6'))[_0xa086('0x7')];var logger=require(_0xa086('0x8'))(_0xa086('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xa086('0xa')][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x1fb3df,_0x25b1e8){var _0x5085f1={'status':_0x1fb3df};var _0x2f5f4e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x25b1e8){_0x5085f1[_0xa086('0xb')]=_0x25b1e8;}return db['AnalyticExtractedReport'][_0xa086('0xc')](_0x5085f1,_0x2f5f4e);}function main(){var _0x213983=0x1388;var _0x31735a;logger[_0xa086('0xd')](util[_0xa086('0xe')](_0xa086('0xf'),EXTRACTED_REPORT_ID,_0xa086('0x10')));return db[_0xa086('0x11')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xa086('0x12'),_0xa086('0x13')]})[_0xa086('0x14')](function(_0xae4d3a){if(_0xae4d3a){_0x31735a=_0xae4d3a;_0x213983=_0x31735a[_0xa086('0x13')]||0x1388;}})['then'](function(){return dbH[_0xa086('0x15')][_0xa086('0x16')](util['format'](_0xa086('0x17'),QUERY),{'type':dbH[_0xa086('0x15')]['QueryTypes'][_0xa086('0x18')]});})['then'](function(_0x554735){if(!_0x554735[0x0][_0xa086('0x19')]){return analyticExtractedReport(_0xa086('0x1a'));}var _0x490b91=[];var _0x53aa15=0x0;if(_0x31735a['split']){if(_0x554735&&_0x554735[_0xa086('0x1b')]){var _0x5da3b0=_[_0xa086('0x1c')](_0x554735[0x0]['num']/_0x213983);var _0x18092d=Number[_0xa086('0x1d')](_0x554735[0x0][_0xa086('0x19')]/_0x213983)?_0x554735[0x0][_0xa086('0x19')]%_0x213983:0x0;_0x5da3b0[_0xa086('0x1e')](function(_0x95f263){if(_0x95f263>0x0){_0x53aa15+=_0x213983;}_0x490b91[_0xa086('0x1f')](dbH[_0xa086('0x15')]['query'](util[_0xa086('0xe')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x213983,_0x53aa15),{'type':dbH['sequelize'][_0xa086('0x20')]['SELECT']}));});if(_0x18092d>0x0){_0x53aa15+=_0x213983;_0x490b91['push'](dbH[_0xa086('0x15')][_0xa086('0x16')](util[_0xa086('0xe')](_0xa086('0x21'),QUERY,_0x18092d,_0x53aa15),{'type':dbH['sequelize'][_0xa086('0x20')][_0xa086('0x18')]}));}}}else{_0x490b91[_0xa086('0x1f')](dbH[_0xa086('0x15')][_0xa086('0x16')](QUERY,{'type':dbH[_0xa086('0x15')][_0xa086('0x20')]['SELECT']}));}var _0x9f42fd=path[_0xa086('0x22')](PATH);var _0x1631f4=path[_0xa086('0x23')](PATH,_0xa086('0x24'));var _0x20ab35=_0x31735a[_0xa086('0x12')]&&_0x490b91[_0xa086('0x1b')]>0x1;var _0x199f4f=[];if(!fs[_0xa086('0x25')](path[_0xa086('0x26')](_0x9f42fd,_0x1631f4))&&_0x20ab35){fs['mkdirSync'](path[_0xa086('0x26')](_0x9f42fd,_0x1631f4));}return BPromise['each'](_0x490b91,function(_0x2f9fd2){_0x199f4f['push'](_0x2f9fd2);})[_0xa086('0x14')](function(){for(var _0x443336=0x0;_0x443336<_0x199f4f[_0xa086('0x1b')];_0x443336+=0x1){var _0x5ef8f7;var _0x2c1027=_0x199f4f[_0x443336];if(_0x20ab35){_0x5ef8f7=path['join'](_0x9f42fd,_0x1631f4,util[_0xa086('0xe')](_0xa086('0x27'),_0x1631f4,_0x443336,_0xa086('0x28')));}else{_0x5ef8f7=path[_0xa086('0x26')](_0x9f42fd,util['format']('%s.%s',_0x1631f4,_0xa086('0x28')));}fs['writeFileSync'](_0x5ef8f7,csv(_0x2c1027));}})[_0xa086('0x14')](function(){if(_0x20ab35){return new Promise(function(_0x1cc853){zipdir(path[_0xa086('0x26')](_0x9f42fd,_0x1631f4),{'saveTo':path[_0xa086('0x26')](_0x9f42fd,util['format']('%s.%s',_0x1631f4,_0xa086('0x29')))},function(_0x24c430,_0xfd953){rimraf(path[_0xa086('0x26')](_0x9f42fd,_0x1631f4),function(){});_0x1cc853(_0xa086('0x2a'));});});}})[_0xa086('0x14')](function(){logger[_0xa086('0xd')](util[_0xa086('0xe')](_0xa086('0x2b'),EXTRACTED_REPORT_ID,_0xa086('0x10')));return analyticExtractedReport(_0xa086('0x2c'),_0x20ab35?util[_0xa086('0xe')](_0xa086('0x2d'),_0x1631f4,_0x20ab35?_0xa086('0x29'):'csv'):null);});})[_0xa086('0x2e')](function(_0x3be822){logger['info'](util[_0xa086('0xe')](_0xa086('0x2f'),EXTRACTED_REPORT_ID,_0xa086('0x10')),util['inspect'](_0x3be822,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xa086('0x30'));})['finally'](function(){process[_0xa086('0x31')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x3c5d=['Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../config/logger','argv','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','find','splitSizeCsv','then','query','sequelize','SELECT','num','Empty','split','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','existsSync','mkdirSync','join','each','csv','%s.%s','writeFileSync','zip','CSV','Completed','catch'];(function(_0x114b7c,_0xc4b93b){var _0x47185f=function(_0x5b4cfa){while(--_0x5b4cfa){_0x114b7c['push'](_0x114b7c['shift']());}};_0x47185f(++_0xc4b93b);}(_0x3c5d,0x1ac));var _0xd3c5=function(_0x5d076a,_0x3c2cf4){_0x5d076a=_0x5d076a-0x0;var _0x42e67e=_0x3c5d[_0x5d076a];return _0x42e67e;};'use strict';var util=require(_0xd3c5('0x0'));var path=require(_0xd3c5('0x1'));var _=require(_0xd3c5('0x2'));var csv=require(_0xd3c5('0x3'));var fs=require('fs');var BPromise=require(_0xd3c5('0x4'));var zipdir=require(_0xd3c5('0x5'));var rimraf=require(_0xd3c5('0x6'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0xd3c5('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xd3c5('0x8')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xd3c5('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x77ad2c,_0x8f7b37){var _0x16d1c9={'status':_0x77ad2c};var _0x10dabc={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x8f7b37){_0x16d1c9['savename']=_0x8f7b37;}return db['AnalyticExtractedReport'][_0xd3c5('0x9')](_0x16d1c9,_0x10dabc);}function main(){var _0x2d2bc6=0x1388;var _0x1f3880;logger[_0xd3c5('0xa')](util[_0xd3c5('0xb')](_0xd3c5('0xc'),EXTRACTED_REPORT_ID,'CSV'));return db['Setting'][_0xd3c5('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xd3c5('0xe')]})[_0xd3c5('0xf')](function(_0x239979){if(_0x239979){_0x1f3880=_0x239979;_0x2d2bc6=_0x1f3880[_0xd3c5('0xe')]||0x1388;}})[_0xd3c5('0xf')](function(){return dbH['sequelize'][_0xd3c5('0x10')](util[_0xd3c5('0xb')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xd3c5('0x11')]['QueryTypes'][_0xd3c5('0x12')]});})[_0xd3c5('0xf')](function(_0x1bfbb5){if(!_0x1bfbb5[0x0][_0xd3c5('0x13')]){return analyticExtractedReport(_0xd3c5('0x14'));}var _0xeb7180=[];var _0x11ef72=0x0;if(_0x1f3880[_0xd3c5('0x15')]){if(_0x1bfbb5&&_0x1bfbb5[_0xd3c5('0x16')]){var _0x17502b=_[_0xd3c5('0x17')](_0x1bfbb5[0x0]['num']/_0x2d2bc6);var _0x4336f1=Number[_0xd3c5('0x18')](_0x1bfbb5[0x0]['num']/_0x2d2bc6)?_0x1bfbb5[0x0][_0xd3c5('0x13')]%_0x2d2bc6:0x0;_0x17502b[_0xd3c5('0x19')](function(_0xf232fe){if(_0xf232fe>0x0){_0x11ef72+=_0x2d2bc6;}_0xeb7180[_0xd3c5('0x1a')](dbH[_0xd3c5('0x11')]['query'](util[_0xd3c5('0xb')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x2d2bc6,_0x11ef72),{'type':dbH[_0xd3c5('0x11')]['QueryTypes']['SELECT']}));});if(_0x4336f1>0x0){_0x11ef72+=_0x2d2bc6;_0xeb7180['push'](dbH[_0xd3c5('0x11')][_0xd3c5('0x10')](util[_0xd3c5('0xb')](_0xd3c5('0x1b'),QUERY,_0x4336f1,_0x11ef72),{'type':dbH['sequelize'][_0xd3c5('0x1c')]['SELECT']}));}}}else{_0xeb7180[_0xd3c5('0x1a')](dbH[_0xd3c5('0x11')][_0xd3c5('0x10')](QUERY,{'type':dbH[_0xd3c5('0x11')][_0xd3c5('0x1c')]['SELECT']}));}var _0x5e9551=path[_0xd3c5('0x1d')](PATH);var _0x5bab42=path[_0xd3c5('0x1e')](PATH,'.csv');var _0x44534a=_0x1f3880[_0xd3c5('0x15')]&&_0xeb7180[_0xd3c5('0x16')]>0x1;var _0x55d250=[];if(!fs[_0xd3c5('0x1f')](path['join'](_0x5e9551,_0x5bab42))&&_0x44534a){fs[_0xd3c5('0x20')](path[_0xd3c5('0x21')](_0x5e9551,_0x5bab42));}return BPromise[_0xd3c5('0x22')](_0xeb7180,function(_0x154aa6){_0x55d250[_0xd3c5('0x1a')](_0x154aa6);})[_0xd3c5('0xf')](function(){for(var _0x359ad9=0x0;_0x359ad9<_0x55d250[_0xd3c5('0x16')];_0x359ad9+=0x1){var _0x3ac166;var _0x42291f=_0x55d250[_0x359ad9];if(_0x44534a){_0x3ac166=path[_0xd3c5('0x21')](_0x5e9551,_0x5bab42,util['format']('%s%d.%s',_0x5bab42,_0x359ad9,_0xd3c5('0x23')));}else{_0x3ac166=path['join'](_0x5e9551,util[_0xd3c5('0xb')](_0xd3c5('0x24'),_0x5bab42,_0xd3c5('0x23')));}fs[_0xd3c5('0x25')](_0x3ac166,csv(_0x42291f));}})[_0xd3c5('0xf')](function(){if(_0x44534a){return new Promise(function(_0x34a3b4){zipdir(path[_0xd3c5('0x21')](_0x5e9551,_0x5bab42),{'saveTo':path[_0xd3c5('0x21')](_0x5e9551,util[_0xd3c5('0xb')](_0xd3c5('0x24'),_0x5bab42,_0xd3c5('0x26')))},function(_0x29cc50,_0x21b4f5){rimraf(path['join'](_0x5e9551,_0x5bab42),function(){});_0x34a3b4('zip\x20finished');});});}})['then'](function(){logger[_0xd3c5('0xa')](util[_0xd3c5('0xb')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xd3c5('0x27')));return analyticExtractedReport(_0xd3c5('0x28'),_0x44534a?util['format'](_0xd3c5('0x24'),_0x5bab42,_0x44534a?_0xd3c5('0x26'):_0xd3c5('0x23')):null);});})[_0xd3c5('0x29')](function(_0x123d9f){logger[_0xd3c5('0xa')](util[_0xd3c5('0xb')](_0xd3c5('0x2a'),EXTRACTED_REPORT_ID,_0xd3c5('0x27')),util[_0xd3c5('0x2b')](_0x123d9f,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xd3c5('0x2c'));})[_0xd3c5('0x2d')](function(){process[_0xd3c5('0x2e')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 2b28512..8790344 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 _0xd753=['Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','pageBreak','before','margin','toString','\x20/\x20','footer','Arial','black','right','num','Empty','splitSizePdf','then','split','range','isInteger','query','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','SELECT','QueryTypes','dirname','basename','.pdf','join','mkdirSync','each','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','AnalyticExtractedReport','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','exit','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','lodash','util','path','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','map','value','fill','length','body','push','concat','chunk','keys','forEach','format'];(function(_0x3f1076,_0x23b6c1){var _0x21d34f=function(_0x3af4f4){while(--_0x3af4f4){_0x3f1076['push'](_0x3f1076['shift']());}};_0x21d34f(++_0x23b6c1);}(_0xd753,0x14b));var _0x3d75=function(_0x1bcec9,_0x32ca1b){_0x1bcec9=_0x1bcec9-0x0;var _0x33c1b7=_0xd753[_0x1bcec9];return _0x33c1b7;};'use strict';var _=require(_0x3d75('0x0'));var fs=require('fs');var util=require(_0x3d75('0x1'));var path=require(_0x3d75('0x2'));var moment=require('moment');var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require('pdfmake/src/printer');var zipdir=require('zip-dir');var rimraf=require('rimraf');var JSDOM=require(_0x3d75('0x3'))[_0x3d75('0x4')];var window=new JSDOM('')[_0x3d75('0x5')];var BPromise=require(_0x3d75('0x6'));var db=require(_0x3d75('0x7'))['db'];var dbH=require(_0x3d75('0x7'))[_0x3d75('0x8')];var logger=require(_0x3d75('0x9'))(_0x3d75('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x3d75('0xb')][0x2]);var QUERY=process[_0x3d75('0xb')][0x3];var PATH=process[_0x3d75('0xb')][0x4];var NAME=process['argv'][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x1e02c5,_0x21dc97){var _0x281df6={'status':_0x1e02c5};var _0x55a218={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x21dc97){_0x281df6[_0x3d75('0xc')]=_0x21dc97;}return db['AnalyticExtractedReport'][_0x3d75('0xd')](_0x281df6,_0x55a218);}function getHeaders(_0x24fd78){return _['map'](_0x24fd78,function(_0x31ce7d){return{'text':_0x31ce7d,'style':'tableHeader'};});}function getRows(_0x329279,_0x53bd7f){return _[_0x3d75('0xe')](_0x53bd7f,function(_0x315e3f){return _(_0x315e3f)['pick'](_0x329279)[_0x3d75('0xe')](function(_0x4b4223){return _0x4b4223?_['toString'](_0x4b4223):'';})[_0x3d75('0xf')]();});}function createTable(_0x30c5a0,_0x1b698b){var _0x21342a={'widths':_[_0x3d75('0x10')](Array(_0x30c5a0[_0x3d75('0x11')]),0x91),'heights':function(_0x4981c5){return _0x4981c5===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x380615=getHeaders(_0x30c5a0);_0x21342a[_0x3d75('0x12')][_0x3d75('0x13')](_0x380615);var _0x213151=getRows(_0x30c5a0,_0x1b698b);_0x21342a[_0x3d75('0x12')]=_0x21342a['body'][_0x3d75('0x14')](_0x213151);return _0x21342a;}function createTables(_0x467b7f){var _0x24d704=[];var _0x20817d=_[_0x3d75('0x15')](Object[_0x3d75('0x16')](_0x467b7f[0x0]),0x5);_0x20817d[_0x3d75('0x17')](function(_0x431d88){_0x24d704['push'](createTable(_0x431d88,_0x467b7f));});return _0x24d704;}function getPDFDocDefinition(_0x2ce0a8){var _0x16a5d4=util[_0x3d75('0x18')](_0x3d75('0x19'),NAME,EXTRACTED_REPORT[_0x3d75('0x1a')],moment(EXTRACTED_REPORT[_0x3d75('0x1b')])[_0x3d75('0x18')](FORMAT),moment(EXTRACTED_REPORT[_0x3d75('0x1c')])[_0x3d75('0x18')](FORMAT));var _0x5f40b6=[];for(var _0x333c86=0x0;_0x333c86<_0x2ce0a8[_0x3d75('0x11')];_0x333c86++){var _0x1b3dd1=[];if(_0x333c86===0x0){_0x1b3dd1[_0x3d75('0x13')]({'text':_0x16a5d4,'style':_0x3d75('0x1d')});}var _0x316577={'table':_0x2ce0a8[_0x333c86]};if(_0x333c86>0x0){_0x316577[_0x3d75('0x1e')]=_0x3d75('0x1f');_0x316577[_0x3d75('0x20')]=[0x0,0x46,0x0,0x0];}_0x1b3dd1[_0x3d75('0x13')](_0x316577);_0x5f40b6[_0x3d75('0x13')](_0x1b3dd1);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x5f40b6,'footer':function(_0xa20889,_0x363013){return{'text':_0xa20889[_0x3d75('0x21')]()+_0x3d75('0x22')+_0x363013,'style':_0x3d75('0x23')};},'defaultStyle':{'font':_0x3d75('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x3d75('0x25')},'footer':{'alignment':_0x3d75('0x26'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x34bf84){var _0x1b5110=0x1388;var _0x38efee;if(!_0x34bf84[0x0][_0x3d75('0x27')]){return analyticExtractedReport(_0x3d75('0x28'));}return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x3d75('0x29')]})[_0x3d75('0x2a')](function(_0x449fc7){if(_0x449fc7){_0x38efee=_0x449fc7;_0x1b5110=_0x38efee[_0x3d75('0x29')]||0x3e8;}})[_0x3d75('0x2a')](function(){var _0x36cd80=[];var _0x32cbf3=0x0;if(_0x38efee[_0x3d75('0x2b')]){if(_0x34bf84&&_0x34bf84[_0x3d75('0x11')]){var _0x552248=_[_0x3d75('0x2c')](_0x34bf84[0x0][_0x3d75('0x27')]/_0x1b5110);var _0x20f7fe=Number[_0x3d75('0x2d')](_0x34bf84[0x0][_0x3d75('0x27')]/_0x1b5110)?_0x34bf84[0x0]['num']%_0x1b5110:0x0;_0x552248[_0x3d75('0x17')](function(_0x49d4a5){if(_0x49d4a5>0x0){_0x32cbf3+=_0x1b5110;}_0x36cd80[_0x3d75('0x13')](dbH['sequelize'][_0x3d75('0x2e')](util['format'](_0x3d75('0x2f'),QUERY,_0x1b5110,_0x32cbf3),{'type':dbH[_0x3d75('0x30')]['QueryTypes'][_0x3d75('0x31')]}));});if(_0x20f7fe>0x0){_0x32cbf3+=_0x1b5110;_0x36cd80[_0x3d75('0x13')](dbH[_0x3d75('0x30')]['query'](util[_0x3d75('0x18')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x20f7fe,_0x32cbf3),{'type':dbH[_0x3d75('0x30')]['QueryTypes'][_0x3d75('0x31')]}));}}}else{_0x36cd80[_0x3d75('0x13')](dbH['sequelize'][_0x3d75('0x2e')](QUERY,{'type':dbH[_0x3d75('0x30')][_0x3d75('0x32')][_0x3d75('0x31')]}));}var _0x58157a=path[_0x3d75('0x33')](PATH);var _0x22bc55=path[_0x3d75('0x34')](PATH,_0x3d75('0x35'));var _0x331517=_0x38efee[_0x3d75('0x2b')]&&_0x36cd80['length']>0x1;var _0x5c3e93=[];if(!fs['existsSync'](path[_0x3d75('0x36')](_0x58157a,_0x22bc55))&&_0x331517){fs[_0x3d75('0x37')](path[_0x3d75('0x36')](_0x58157a,_0x22bc55));}return BPromise[_0x3d75('0x38')](_0x36cd80,function(_0x3ad5bc){_0x5c3e93[_0x3d75('0x13')](_0x3ad5bc);})['then'](function(){var _0x103334=[];for(var _0x44cd9d=0x0;_0x44cd9d<_0x5c3e93[_0x3d75('0x11')];_0x44cd9d+=0x1){var _0x4a672e=_0x5c3e93[_0x44cd9d];var _0x1804bd=createTables(_['flatten'](_0x4a672e));var _0x29b350;var _0x2934d8=getPDFDocDefinition(_0x1804bd);var _0x664b13=getPDFPrinter();var _0x546f34=_0x664b13[_0x3d75('0x39')](_0x2934d8);if(_0x331517){_0x29b350=path['join'](_0x58157a,_0x22bc55,util[_0x3d75('0x18')](_0x3d75('0x3a'),_0x22bc55,_0x44cd9d,_0x3d75('0x3b')));}else{_0x29b350=path[_0x3d75('0x36')](_0x58157a,util[_0x3d75('0x18')](_0x3d75('0x3c'),_0x22bc55,_0x3d75('0x3b')));}_0x103334[_0x3d75('0x13')](writePDFDocument(_0x546f34,_0x29b350));}return Promise[_0x3d75('0x3d')](_0x103334);})[_0x3d75('0x2a')](function(){if(_0x331517){return new Promise(function(_0x3a0a7b){zipdir(path['join'](_0x58157a,_0x22bc55),{'saveTo':path[_0x3d75('0x36')](_0x58157a,util[_0x3d75('0x18')](_0x3d75('0x3c'),_0x22bc55,_0x3d75('0x3e')))},function(){rimraf(path['join'](_0x58157a,_0x22bc55),function(){});_0x3a0a7b(_0x3d75('0x3f'));});});}})['then'](function(){if(!_0x331517)return;rimraf(path['join'](_0x58157a,_0x22bc55),function(){});})['then'](function(){logger[_0x3d75('0x40')](util[_0x3d75('0x18')](_0x3d75('0x41'),EXTRACTED_REPORT_ID,_0x3d75('0x42')));return analyticExtractedReport(_0x3d75('0x43'),_0x331517?util[_0x3d75('0x18')](_0x3d75('0x3c'),_0x22bc55,_0x331517?_0x3d75('0x3e'):'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0x3d75('0x18')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x3d75('0x42')));return db[_0x3d75('0x44')][_0x3d75('0x45')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x3d75('0x2a')](function(_0x25e7ec){EXTRACTED_REPORT=_0x25e7ec;return dbH[_0x3d75('0x30')][_0x3d75('0x2e')](util['format'](_0x3d75('0x46'),QUERY),{'type':dbH[_0x3d75('0x30')][_0x3d75('0x32')][_0x3d75('0x31')]});})[_0x3d75('0x2a')](extractReport)[_0x3d75('0x47')](function(_0x53d2f2){logger[_0x3d75('0x40')](util[_0x3d75('0x18')](_0x3d75('0x48'),EXTRACTED_REPORT_ID,'PDF'),util['inspect'](_0x53d2f2,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process[_0x3d75('0x49')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x25a12d=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0x3d75('0x4a'),'italics':__dirname+_0x3d75('0x4b'),'bolditalics':__dirname+_0x3d75('0x4c')}});return _0x25a12d;}function getPDFDocDefinitionFromHTML(_0x14afba,_0x3f918c){var _0x55ee92=util['format'](_0x3d75('0x4d'),_0x3f918c[_0x3d75('0x4e')],_0x3f918c[_0x3d75('0x4f')]);var _0x3bf8f3=moment()[_0x3d75('0x18')](_0x3d75('0x50'))[_0x3d75('0x21')]();var _0x2387f2=htmlToPdfmake(_0x14afba,{'window':window,'tableAutoSize':!![]});return{'content':[_0x2387f2],'defaultStyle':{'font':_0x3d75('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x3d75('0x51'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0x3d75('0x52'),'style':_0x3d75('0x1d')}];},'footer':function(_0xdc8f2d,_0x3b32c8){return[{'text':util[_0x3d75('0x18')](_0x3d75('0x53'),_0x55ee92,_0xdc8f2d,_0x3b32c8,_0x3bf8f3),'style':_0x3d75('0x23')}];}};}function writePDFDocument(_0x108a8b,_0x4a1a2f){return new Promise(function(_0x1f3634,_0x4fcc24){var _0x3204ba=_0x108a8b[_0x3d75('0x54')](fs[_0x3d75('0x55')](_0x4a1a2f));_0x3204ba['on'](_0x3d75('0x56'),function(){_0x1f3634(_0x3d75('0x56'));});_0x3204ba['on'](_0x3d75('0x57'),function(_0x61bb5f){_0x4fcc24(_0x61bb5f);});_0x108a8b[_0x3d75('0x58')]();});}exports['createPdfFromHTML']=function(_0x108cb9,_0x4e711b){var _0x5ce35e=getPDFPrinter();var _0xb695d=getPDFDocDefinitionFromHTML(_0x108cb9,_0x4e711b);var _0x2c12af=_0x5ce35e[_0x3d75('0x39')](_0xb695d);return writePDFDocument(_0x2c12af,_0x4e711b['path'])['catch'](function(_0x11d446){throw _0x11d446;});}; \ No newline at end of file +var _0x4308=['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','catch','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-italic.ttf','interactionId','YYYY-MM-DD','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','finish','error','end','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','analytics','argv','AnalyticExtractedReport','update','tableHeader','pick','map','toString','fill','length','push','concat','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','before','margin','landscape','footer','Arial','num','Setting','find','split','splitSizePdf','then','range','isInteger','sequelize','query','QueryTypes','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.pdf'];(function(_0x1944af,_0xad10c8){var _0x350b4f=function(_0x70dc62){while(--_0x70dc62){_0x1944af['push'](_0x1944af['shift']());}};_0x350b4f(++_0xad10c8);}(_0x4308,0x1c7));var _0x8430=function(_0x3344d5,_0x3936a4){_0x3344d5=_0x3344d5-0x0;var _0xff1fcb=_0x4308[_0x3344d5];return _0xff1fcb;};'use strict';var _=require(_0x8430('0x0'));var fs=require('fs');var util=require(_0x8430('0x1'));var path=require(_0x8430('0x2'));var moment=require(_0x8430('0x3'));var htmlToPdfmake=require(_0x8430('0x4'));var PdfPrinter=require(_0x8430('0x5'));var zipdir=require(_0x8430('0x6'));var rimraf=require(_0x8430('0x7'));var JSDOM=require(_0x8430('0x8'))[_0x8430('0x9')];var window=new JSDOM('')[_0x8430('0xa')];var BPromise=require(_0x8430('0xb'));var db=require(_0x8430('0xc'))['db'];var dbH=require('../../mysqldb')[_0x8430('0xd')];var logger=require('../../config/logger')(_0x8430('0xe'));var EXTRACTED_REPORT_ID=Number(process[_0x8430('0xf')][0x2]);var QUERY=process[_0x8430('0xf')][0x3];var PATH=process[_0x8430('0xf')][0x4];var NAME=process[_0x8430('0xf')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x3ad658,_0x582772){var _0x7f6aed={'status':_0x3ad658};var _0x125248={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x582772){_0x7f6aed['savename']=_0x582772;}return db[_0x8430('0x10')][_0x8430('0x11')](_0x7f6aed,_0x125248);}function getHeaders(_0x4398a2){return _['map'](_0x4398a2,function(_0x4f06f5){return{'text':_0x4f06f5,'style':_0x8430('0x12')};});}function getRows(_0x55cb5d,_0x4b2a3f){return _['map'](_0x4b2a3f,function(_0xf7ffd6){return _(_0xf7ffd6)[_0x8430('0x13')](_0x55cb5d)[_0x8430('0x14')](function(_0x448131){return _0x448131?_[_0x8430('0x15')](_0x448131):'';})['value']();});}function createTable(_0x145d13,_0x3c5f5c){var _0x9892af={'widths':_[_0x8430('0x16')](Array(_0x145d13[_0x8430('0x17')]),0x91),'heights':function(_0x5d3f01){return _0x5d3f01===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x551ebe=getHeaders(_0x145d13);_0x9892af['body'][_0x8430('0x18')](_0x551ebe);var _0x595712=getRows(_0x145d13,_0x3c5f5c);_0x9892af['body']=_0x9892af['body'][_0x8430('0x19')](_0x595712);return _0x9892af;}function createTables(_0xa54578){var _0x2f1cfe=[];var _0x59a766=_['chunk'](Object[_0x8430('0x1a')](_0xa54578[0x0]),0x5);_0x59a766[_0x8430('0x1b')](function(_0x500c65){_0x2f1cfe['push'](createTable(_0x500c65,_0xa54578));});return _0x2f1cfe;}function getPDFDocDefinition(_0x363dbe){var _0x2957a3=util[_0x8430('0x1c')](_0x8430('0x1d'),NAME,EXTRACTED_REPORT[_0x8430('0x1e')],moment(EXTRACTED_REPORT[_0x8430('0x1f')])[_0x8430('0x1c')](FORMAT),moment(EXTRACTED_REPORT[_0x8430('0x20')])['format'](FORMAT));var _0x5bb47b=[];for(var _0x3f8589=0x0;_0x3f8589<_0x363dbe[_0x8430('0x17')];_0x3f8589++){var _0x264947=[];if(_0x3f8589===0x0){_0x264947[_0x8430('0x18')]({'text':_0x2957a3,'style':_0x8430('0x21')});}var _0x280a77={'table':_0x363dbe[_0x3f8589]};if(_0x3f8589>0x0){_0x280a77['pageBreak']=_0x8430('0x22');_0x280a77[_0x8430('0x23')]=[0x0,0x46,0x0,0x0];}_0x264947[_0x8430('0x18')](_0x280a77);_0x5bb47b['push'](_0x264947);}return{'pageSize':'A4','pageOrientation':_0x8430('0x24'),'content':_0x5bb47b,'footer':function(_0x317045,_0xe60fb5){return{'text':_0x317045[_0x8430('0x15')]()+'\x20/\x20'+_0xe60fb5,'style':_0x8430('0x25')};},'defaultStyle':{'font':_0x8430('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x20a459){var _0x280316=0x1388;var _0x398427;if(!_0x20a459[0x0][_0x8430('0x27')]){return analyticExtractedReport('Empty');}return db[_0x8430('0x28')][_0x8430('0x29')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x8430('0x2a'),_0x8430('0x2b')]})[_0x8430('0x2c')](function(_0x20bd95){if(_0x20bd95){_0x398427=_0x20bd95;_0x280316=_0x398427['splitSizePdf']||0x3e8;}})[_0x8430('0x2c')](function(){var _0x3b2976=[];var _0x1f86c4=0x0;if(_0x398427['split']){if(_0x20a459&&_0x20a459[_0x8430('0x17')]){var _0x31878a=_[_0x8430('0x2d')](_0x20a459[0x0][_0x8430('0x27')]/_0x280316);var _0x4c7b45=Number[_0x8430('0x2e')](_0x20a459[0x0]['num']/_0x280316)?_0x20a459[0x0][_0x8430('0x27')]%_0x280316:0x0;_0x31878a[_0x8430('0x1b')](function(_0x54ea04){if(_0x54ea04>0x0){_0x1f86c4+=_0x280316;}_0x3b2976[_0x8430('0x18')](dbH[_0x8430('0x2f')][_0x8430('0x30')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x280316,_0x1f86c4),{'type':dbH['sequelize'][_0x8430('0x31')][_0x8430('0x32')]}));});if(_0x4c7b45>0x0){_0x1f86c4+=_0x280316;_0x3b2976['push'](dbH['sequelize'][_0x8430('0x30')](util[_0x8430('0x1c')](_0x8430('0x33'),QUERY,_0x4c7b45,_0x1f86c4),{'type':dbH[_0x8430('0x2f')]['QueryTypes'][_0x8430('0x32')]}));}}}else{_0x3b2976[_0x8430('0x18')](dbH[_0x8430('0x2f')]['query'](QUERY,{'type':dbH[_0x8430('0x2f')][_0x8430('0x31')][_0x8430('0x32')]}));}var _0x5f4ae4=path[_0x8430('0x34')](PATH);var _0x29ffaf=path[_0x8430('0x35')](PATH,_0x8430('0x36'));var _0x123566=_0x398427[_0x8430('0x2a')]&&_0x3b2976['length']>0x1;var _0x31fb85=[];if(!fs['existsSync'](path[_0x8430('0x37')](_0x5f4ae4,_0x29ffaf))&&_0x123566){fs[_0x8430('0x38')](path[_0x8430('0x37')](_0x5f4ae4,_0x29ffaf));}return BPromise['each'](_0x3b2976,function(_0x392b6c){_0x31fb85[_0x8430('0x18')](_0x392b6c);})[_0x8430('0x2c')](function(){var _0x22de28=[];for(var _0x13308d=0x0;_0x13308d<_0x31fb85[_0x8430('0x17')];_0x13308d+=0x1){var _0x9d0d3d=_0x31fb85[_0x13308d];var _0x34eef2=createTables(_[_0x8430('0x39')](_0x9d0d3d));var _0x2aa54c;var _0x4cf4bf=getPDFDocDefinition(_0x34eef2);var _0xdb9387=getPDFPrinter();var _0x125533=_0xdb9387[_0x8430('0x3a')](_0x4cf4bf);if(_0x123566){_0x2aa54c=path[_0x8430('0x37')](_0x5f4ae4,_0x29ffaf,util['format'](_0x8430('0x3b'),_0x29ffaf,_0x13308d,_0x8430('0x3c')));}else{_0x2aa54c=path['join'](_0x5f4ae4,util[_0x8430('0x1c')]('%s.%s',_0x29ffaf,_0x8430('0x3c')));}_0x22de28[_0x8430('0x18')](writePDFDocument(_0x125533,_0x2aa54c));}return Promise[_0x8430('0x3d')](_0x22de28);})[_0x8430('0x2c')](function(){if(_0x123566){return new Promise(function(_0x58cd66){zipdir(path[_0x8430('0x37')](_0x5f4ae4,_0x29ffaf),{'saveTo':path[_0x8430('0x37')](_0x5f4ae4,util[_0x8430('0x1c')](_0x8430('0x3e'),_0x29ffaf,_0x8430('0x3f')))},function(){rimraf(path[_0x8430('0x37')](_0x5f4ae4,_0x29ffaf),function(){});_0x58cd66(_0x8430('0x40'));});});}})[_0x8430('0x2c')](function(){if(!_0x123566)return;rimraf(path['join'](_0x5f4ae4,_0x29ffaf),function(){});})[_0x8430('0x2c')](function(){logger[_0x8430('0x41')](util[_0x8430('0x1c')](_0x8430('0x42'),EXTRACTED_REPORT_ID,_0x8430('0x43')));return analyticExtractedReport(_0x8430('0x44'),_0x123566?util[_0x8430('0x1c')](_0x8430('0x3e'),_0x29ffaf,_0x123566?_0x8430('0x3f'):_0x8430('0x3c')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0x8430('0x1c')](_0x8430('0x45'),EXTRACTED_REPORT_ID,_0x8430('0x43')));return db[_0x8430('0x10')][_0x8430('0x46')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x116b4e){EXTRACTED_REPORT=_0x116b4e;return dbH[_0x8430('0x2f')][_0x8430('0x30')](util['format'](_0x8430('0x47'),QUERY),{'type':dbH[_0x8430('0x2f')][_0x8430('0x31')][_0x8430('0x32')]});})['then'](extractReport)[_0x8430('0x48')](function(_0x593f76){logger[_0x8430('0x41')](util[_0x8430('0x1c')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x8430('0x43')),util['inspect'](_0x593f76,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x8430('0x49'));})[_0x8430('0x4a')](function(){process[_0x8430('0x4b')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x19f401=new PdfPrinter({'Arial':{'normal':__dirname+_0x8430('0x4c'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0x8430('0x4d'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x19f401;}function getPDFDocDefinitionFromHTML(_0x249d19,_0x2c1ac7){var _0x9fd6a=util[_0x8430('0x1c')]('%s\x20#%d',_0x2c1ac7['channel'],_0x2c1ac7[_0x8430('0x4e')]);var _0x37dd3d=moment()[_0x8430('0x1c')](_0x8430('0x4f'))[_0x8430('0x15')]();var _0x41bafb=htmlToPdfmake(_0x249d19,{'window':window,'tableAutoSize':!![]});return{'content':[_0x41bafb],'defaultStyle':{'font':_0x8430('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x8430('0x50'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x8430('0x50')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0x8430('0x21')}];},'footer':function(_0x5d1265,_0x1a047d){return[{'text':util[_0x8430('0x1c')](_0x8430('0x51'),_0x9fd6a,_0x5d1265,_0x1a047d,_0x37dd3d),'style':_0x8430('0x25')}];}};}function writePDFDocument(_0x2186eb,_0x5d822f){return new Promise(function(_0x3a113d,_0x253dce){var _0x5e848d=_0x2186eb['pipe'](fs['createWriteStream'](_0x5d822f));_0x5e848d['on'](_0x8430('0x52'),function(){_0x3a113d(_0x8430('0x52'));});_0x5e848d['on'](_0x8430('0x53'),function(_0x8755b6){_0x253dce(_0x8755b6);});_0x2186eb[_0x8430('0x54')]();});}exports['createPdfFromHTML']=function(_0x4b7be6,_0x42c8e7){var _0x1acced=getPDFPrinter();var _0x5dafe0=getPDFDocDefinitionFromHTML(_0x4b7be6,_0x42c8e7);var _0x2951cb=_0x1acced[_0x8430('0x3a')](_0x5dafe0);return writePDFDocument(_0x2951cb,_0x42c8e7[_0x8430('0x2')])[_0x8430('0x48')](function(_0x2a99a7){throw _0x2a99a7;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 303e16e..8c9bbf2 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 _0x3181=['SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','length','existsSync','mkdirSync','join','%s.%s','xlsx','writeFileSync','binary','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','exit','lodash','bluebird','rimraf','../../mysqldb','dbH','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','find','split','then','splitSizeXlsx','query'];(function(_0x30c7c5,_0x168208){var _0x29e24e=function(_0x427d3e){while(--_0x427d3e){_0x30c7c5['push'](_0x30c7c5['shift']());}};_0x29e24e(++_0x168208);}(_0x3181,0x7f));var _0x1318=function(_0x4caade,_0x549ce1){_0x4caade=_0x4caade-0x0;var _0x2041ff=_0x3181[_0x4caade];return _0x2041ff;};'use strict';var util=require('util');var path=require('path');var _=require(_0x1318('0x0'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x1318('0x1'));var zipdir=require('zip-dir');var rimraf=require(_0x1318('0x2'));var db=require(_0x1318('0x3'))['db'];var dbH=require(_0x1318('0x3'))[_0x1318('0x4')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x1318('0x5')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x1318('0x5')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x4d0f99,_0x53a30d){var _0x5f45de={'status':_0x4d0f99};var _0x23a5bf={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x53a30d){_0x5f45de[_0x1318('0x6')]=_0x53a30d;}return db[_0x1318('0x7')][_0x1318('0x8')](_0x5f45de,_0x23a5bf);}function main(){var _0x29e550=0x1388;var _0x12bd03;logger[_0x1318('0x9')](util[_0x1318('0xa')](_0x1318('0xb'),EXTRACTED_REPORT_ID,'XLSX'));return db['Setting'][_0x1318('0xc')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x1318('0xd'),'splitSizeXlsx']})[_0x1318('0xe')](function(_0x51e463){if(_0x51e463){_0x12bd03=_0x51e463;_0x29e550=_0x12bd03[_0x1318('0xf')]||0x1388;}})[_0x1318('0xe')](function(){return dbH['sequelize'][_0x1318('0x10')](util[_0x1318('0xa')](_0x1318('0x11'),QUERY),{'type':dbH[_0x1318('0x12')][_0x1318('0x13')][_0x1318('0x14')]});})[_0x1318('0xe')](function(_0x5138a9){if(!_0x5138a9[0x0][_0x1318('0x15')]){return analyticExtractedReport('Empty');}var _0xfb182d=[];var _0x4399e5=0x0;if(_0x12bd03[_0x1318('0xd')]){if(_0x5138a9&&_0x5138a9['length']){var _0x45a5ca=_[_0x1318('0x16')](_0x5138a9[0x0][_0x1318('0x15')]/_0x29e550);var _0x5023c3=Number[_0x1318('0x17')](_0x5138a9[0x0][_0x1318('0x15')]/_0x29e550)?_0x5138a9[0x0][_0x1318('0x15')]%_0x29e550:0x0;_0x45a5ca[_0x1318('0x18')](function(_0x3f7074){if(_0x3f7074>0x0){_0x4399e5+=_0x29e550;}_0xfb182d[_0x1318('0x19')](dbH['sequelize'][_0x1318('0x10')](util[_0x1318('0xa')](_0x1318('0x1a'),QUERY,_0x29e550,_0x4399e5),{'type':dbH['sequelize']['QueryTypes'][_0x1318('0x14')]}));});if(_0x5023c3>0x0){_0x4399e5+=_0x29e550;_0xfb182d['push'](dbH[_0x1318('0x12')][_0x1318('0x10')](util[_0x1318('0xa')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x5023c3,_0x4399e5),{'type':dbH[_0x1318('0x12')]['QueryTypes'][_0x1318('0x14')]}));}}}else{_0xfb182d[_0x1318('0x19')](dbH[_0x1318('0x12')]['query'](QUERY,{'type':dbH[_0x1318('0x12')]['QueryTypes']['SELECT']}));}var _0x530d7b=path[_0x1318('0x1b')](PATH);var _0x256933=path[_0x1318('0x1c')](PATH,_0x1318('0x1d'));var _0xfb6494=_0x12bd03[_0x1318('0xd')]&&_0xfb182d[_0x1318('0x1e')]>0x1;var _0x5865f9=[];if(!fs[_0x1318('0x1f')](path['join'](_0x530d7b,_0x256933))&&_0xfb6494){fs[_0x1318('0x20')](path[_0x1318('0x21')](_0x530d7b,_0x256933));}return BPromise['each'](_0xfb182d,function(_0x45ff04){_0x5865f9['push'](_0x45ff04);})[_0x1318('0xe')](function(){for(var _0x588ed1=0x0;_0x588ed1<_0x5865f9[_0x1318('0x1e')];_0x588ed1+=0x1){var _0x35637b;var _0x4ce7a1=_0x5865f9[_0x588ed1];if(_0xfb6494){_0x35637b=path[_0x1318('0x21')](_0x530d7b,_0x256933,util['format']('%s%d.%s',_0x256933,_0x588ed1,'xlsx'));}else{_0x35637b=path[_0x1318('0x21')](_0x530d7b,util[_0x1318('0xa')](_0x1318('0x22'),_0x256933,_0x1318('0x23')));}fs[_0x1318('0x24')](_0x35637b,json2xls(_0x4ce7a1),_0x1318('0x25'));}})['then'](function(){if(_0xfb6494){return new Promise(function(_0x448a38){zipdir(path['join'](_0x530d7b,_0x256933),{'saveTo':path[_0x1318('0x21')](_0x530d7b,util[_0x1318('0xa')](_0x1318('0x22'),_0x256933,_0x1318('0x26')))},function(_0x27be64,_0x16fd35){rimraf(path[_0x1318('0x21')](_0x530d7b,_0x256933),function(){});_0x448a38(_0x1318('0x27'));});});}})[_0x1318('0xe')](function(){logger[_0x1318('0x9')](util[_0x1318('0xa')](_0x1318('0x28'),EXTRACTED_REPORT_ID,_0x1318('0x29')));return analyticExtractedReport(_0x1318('0x2a'),_0xfb6494?util['format'](_0x1318('0x22'),_0x256933,_0xfb6494?'zip':'xlsx'):null);});})[_0x1318('0x2b')](function(_0x58aa5d){logger['info'](util[_0x1318('0xa')](_0x1318('0x2c'),EXTRACTED_REPORT_ID,_0x1318('0x29')),util[_0x1318('0x2d')](_0x58aa5d,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x1318('0x2e')](function(){process[_0x1318('0x2f')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xf485=['%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','.xlsx','length','existsSync','join','each','%s%d.%s','xlsx','%s.%s','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','XLSX','inspect','Failed','finally','exit','util','path','lodash','json2xls','bluebird','zip-dir','../../mysqldb','../../config/logger','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeXlsx','then','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','forEach','push','sequelize','query'];(function(_0x4e591,_0xa82efc){var _0x28d148=function(_0x400af9){while(--_0x400af9){_0x4e591['push'](_0x4e591['shift']());}};_0x28d148(++_0xa82efc);}(_0xf485,0xd1));var _0x5f48=function(_0xa9134c,_0x6e1e0a){_0xa9134c=_0xa9134c-0x0;var _0x3e168b=_0xf485[_0xa9134c];return _0x3e168b;};'use strict';var util=require(_0x5f48('0x0'));var path=require(_0x5f48('0x1'));var _=require(_0x5f48('0x2'));var fs=require('fs');var json2xls=require(_0x5f48('0x3'));var BPromise=require(_0x5f48('0x4'));var zipdir=require(_0x5f48('0x5'));var rimraf=require('rimraf');var db=require(_0x5f48('0x6'))['db'];var dbH=require(_0x5f48('0x6'))['dbH'];var logger=require(_0x5f48('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x5f48('0x8')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x5f48('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x126cb7,_0x3c6f45){var _0x5866e5={'status':_0x126cb7};var _0x3fb7e5={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3c6f45){_0x5866e5[_0x5f48('0x9')]=_0x3c6f45;}return db[_0x5f48('0xa')]['update'](_0x5866e5,_0x3fb7e5);}function main(){var _0x24aead=0x1388;var _0x2b51a2;logger[_0x5f48('0xb')](util[_0x5f48('0xc')](_0x5f48('0xd'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0x5f48('0xe')][_0x5f48('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x5f48('0x10'),_0x5f48('0x11')]})[_0x5f48('0x12')](function(_0x32681b){if(_0x32681b){_0x2b51a2=_0x32681b;_0x24aead=_0x2b51a2[_0x5f48('0x11')]||0x1388;}})['then'](function(){return dbH['sequelize']['query'](util[_0x5f48('0xc')](_0x5f48('0x13'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0x5f48('0x14')]});})['then'](function(_0x2c7bdf){if(!_0x2c7bdf[0x0]['num']){return analyticExtractedReport('Empty');}var _0x561b8e=[];var _0x576fc5=0x0;if(_0x2b51a2[_0x5f48('0x10')]){if(_0x2c7bdf&&_0x2c7bdf['length']){var _0x24ce1b=_['range'](_0x2c7bdf[0x0][_0x5f48('0x15')]/_0x24aead);var _0x24beb3=Number['isInteger'](_0x2c7bdf[0x0][_0x5f48('0x15')]/_0x24aead)?_0x2c7bdf[0x0][_0x5f48('0x15')]%_0x24aead:0x0;_0x24ce1b[_0x5f48('0x16')](function(_0x5763af){if(_0x5763af>0x0){_0x576fc5+=_0x24aead;}_0x561b8e[_0x5f48('0x17')](dbH[_0x5f48('0x18')][_0x5f48('0x19')](util[_0x5f48('0xc')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x24aead,_0x576fc5),{'type':dbH[_0x5f48('0x18')]['QueryTypes'][_0x5f48('0x14')]}));});if(_0x24beb3>0x0){_0x576fc5+=_0x24aead;_0x561b8e[_0x5f48('0x17')](dbH[_0x5f48('0x18')]['query'](util[_0x5f48('0xc')](_0x5f48('0x1a'),QUERY,_0x24beb3,_0x576fc5),{'type':dbH['sequelize']['QueryTypes'][_0x5f48('0x14')]}));}}}else{_0x561b8e[_0x5f48('0x17')](dbH[_0x5f48('0x18')][_0x5f48('0x19')](QUERY,{'type':dbH['sequelize'][_0x5f48('0x1b')][_0x5f48('0x14')]}));}var _0x53cb99=path[_0x5f48('0x1c')](PATH);var _0x384dcd=path[_0x5f48('0x1d')](PATH,_0x5f48('0x1e'));var _0x2dd1ec=_0x2b51a2['split']&&_0x561b8e[_0x5f48('0x1f')]>0x1;var _0x26e782=[];if(!fs[_0x5f48('0x20')](path['join'](_0x53cb99,_0x384dcd))&&_0x2dd1ec){fs['mkdirSync'](path[_0x5f48('0x21')](_0x53cb99,_0x384dcd));}return BPromise[_0x5f48('0x22')](_0x561b8e,function(_0x1132fb){_0x26e782[_0x5f48('0x17')](_0x1132fb);})[_0x5f48('0x12')](function(){for(var _0x54981b=0x0;_0x54981b<_0x26e782[_0x5f48('0x1f')];_0x54981b+=0x1){var _0x348f3d;var _0x2f4a73=_0x26e782[_0x54981b];if(_0x2dd1ec){_0x348f3d=path[_0x5f48('0x21')](_0x53cb99,_0x384dcd,util[_0x5f48('0xc')](_0x5f48('0x23'),_0x384dcd,_0x54981b,_0x5f48('0x24')));}else{_0x348f3d=path[_0x5f48('0x21')](_0x53cb99,util[_0x5f48('0xc')](_0x5f48('0x25'),_0x384dcd,_0x5f48('0x24')));}fs['writeFileSync'](_0x348f3d,json2xls(_0x2f4a73),'binary');}})[_0x5f48('0x12')](function(){if(_0x2dd1ec){return new Promise(function(_0x17f6a5){zipdir(path[_0x5f48('0x21')](_0x53cb99,_0x384dcd),{'saveTo':path[_0x5f48('0x21')](_0x53cb99,util[_0x5f48('0xc')](_0x5f48('0x25'),_0x384dcd,'zip'))},function(_0x2b5cd6,_0x44b284){rimraf(path[_0x5f48('0x21')](_0x53cb99,_0x384dcd),function(){});_0x17f6a5('zip\x20finished');});});}})[_0x5f48('0x12')](function(){logger[_0x5f48('0xb')](util[_0x5f48('0xc')](_0x5f48('0x26'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0x5f48('0x27'),_0x2dd1ec?util[_0x5f48('0xc')](_0x5f48('0x25'),_0x384dcd,_0x2dd1ec?'zip':_0x5f48('0x24')):null);});})[_0x5f48('0x28')](function(_0x33c41b){logger[_0x5f48('0xb')](util[_0x5f48('0xc')](_0x5f48('0x29'),EXTRACTED_REPORT_ID,_0x5f48('0x2a')),util[_0x5f48('0x2b')](_0x33c41b,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x5f48('0x2c'));})[_0x5f48('0x2d')](function(){process[_0x5f48('0x2e')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 1a4a42f..24a4681 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 _0x3e8f=['$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','sortBy','catch','error','rewrite','lodash','util','models','Interval','findAll','then','VoiceExtension','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','queue','hasOwnProperty','priority','extensions','push','type','Set','CDR(type)=%s','context','VoiceExtensionId','CDR(routeid)=','outbound','extension','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','updatedAt','interval','*,*,*,*','intervals','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','answer','indexOf','app','toLowerCase','appType','custom'];(function(_0x156a0d,_0x3946ce){var _0x98a9ba=function(_0x46c1b2){while(--_0x46c1b2){_0x156a0d['push'](_0x156a0d['shift']());}};_0x98a9ba(++_0x3946ce);}(_0x3e8f,0x1c0));var _0xf3e8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3e8f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf3e8('0x0'));var util=require(_0xf3e8('0x1'));function rewrite(_0xb32d3b,_0x5746b5){var _0x36bede=this;return _0xb32d3b[_0xf3e8('0x2')][_0xf3e8('0x3')][_0xf3e8('0x4')]({'raw':!![]})[_0xf3e8('0x5')](function(_0x9c29d0){_0x36bede['intervals']=_0x9c29d0;return _0xb32d3b['models'][_0xf3e8('0x6')]['findAll']({'where':{'IntervalId':_0x5746b5[_0xf3e8('0x7')]},'raw':!![]});})[_0xf3e8('0x5')](function(_0x492237){return _0xb32d3b[_0xf3e8('0x2')]['VoiceExtension'][_0xf3e8('0x4')]({'where':{'exten':{'$in':_[_0xf3e8('0x8')](_[_0xf3e8('0x9')](_0x492237,_0xf3e8('0xa')))}},'order':[{'raw':_0xf3e8('0xb')}],'raw':!![]});})[_0xf3e8('0x5')](function(_0x2908f0){var _0xfadbca=_[_0xf3e8('0xc')](_0x2908f0,{'priority':'1'});var _0x596909=_[_0xf3e8('0xc')](_0x2908f0,{'isApp':0x1});var _0x5b5fcc=_['groupBy'](_0x596909,_0xf3e8('0xa'));var _0x31cccf=[_0xf3e8('0xd'),'playback'];var _0x3fc8ad=[];var _0x23ddeb=[];for(var _0x35d68b in _0x5b5fcc){if(_0x5b5fcc[_0xf3e8('0xe')](_0x35d68b)){_0x36bede[_0xf3e8('0xf')]=0x2;_0x36bede[_0xf3e8('0x10')]=[];_0x36bede['extension']=_['find'](_0xfadbca,{'exten':_0x5b5fcc[_0x35d68b][0x0]['exten']});_0x36bede[_0xf3e8('0x10')][_0xf3e8('0x11')]({'type':_0x5b5fcc[_0x35d68b][0x0][_0xf3e8('0x12')],'app':_0xf3e8('0x13'),'appdata':util['format'](_0xf3e8('0x14'),_0x5b5fcc[_0x35d68b][0x0]['type']),'context':_0x5b5fcc[_0x35d68b][0x0][_0xf3e8('0x15')],'exten':_0x5b5fcc[_0x35d68b][0x0][_0xf3e8('0xa')],'priority':_0x36bede[_0xf3e8('0xf')]++,'VoiceExtensionId':_0x5b5fcc[_0x35d68b][0x0][_0xf3e8('0x16')]});if(_0x5b5fcc[_0x35d68b][0x0]['type']==='inbound'){_0x36bede[_0xf3e8('0x10')][_0xf3e8('0x11')]({'type':_0x5b5fcc[_0x35d68b][0x0][_0xf3e8('0x12')],'app':_0xf3e8('0x13'),'appdata':_0xf3e8('0x17')+_0x5b5fcc[_0x35d68b][0x0][_0xf3e8('0x16')],'context':_0x5b5fcc[_0x35d68b][0x0][_0xf3e8('0x15')],'exten':_0x5b5fcc[_0x35d68b][0x0]['exten'],'priority':_0x36bede['priority']++,'VoiceExtensionId':_0x5b5fcc[_0x35d68b][0x0][_0xf3e8('0x16')]});}else if(_0x5b5fcc[_0x35d68b][0x0][_0xf3e8('0x12')]===_0xf3e8('0x18')){if(_0x36bede[_0xf3e8('0x19')]){_0x36bede[_0xf3e8('0x10')][_0xf3e8('0x11')]({'type':_0x5b5fcc[_0x35d68b][0x0][_0xf3e8('0x12')],'app':_0xf3e8('0x13'),'appdata':'CDR(destination)='+(_0x36bede['extension'][_0xf3e8('0x1a')]?_0xf3e8('0x1b')+_0x36bede[_0xf3e8('0x19')][_0xf3e8('0x1a')]+'}':_0xf3e8('0x1c')),'context':_0x5b5fcc[_0x35d68b][0x0][_0xf3e8('0x15')],'exten':_0x5b5fcc[_0x35d68b][0x0][_0xf3e8('0xa')],'priority':_0x36bede['priority']++,'VoiceExtensionId':_0x5b5fcc[_0x35d68b][0x0][_0xf3e8('0x16')]});}_0x36bede['extensions'][_0xf3e8('0x11')]({'type':_0x5b5fcc[_0x35d68b][0x0][_0xf3e8('0x12')],'app':'Set','appdata':_0xf3e8('0x17')+_0x5b5fcc[_0x35d68b][0x0][_0xf3e8('0x16')],'context':_0x5b5fcc[_0x35d68b][0x0]['context'],'exten':_0x5b5fcc[_0x35d68b][0x0][_0xf3e8('0xa')],'priority':_0x36bede[_0xf3e8('0xf')]++,'VoiceExtensionId':_0x5b5fcc[_0x35d68b][0x0][_0xf3e8('0x16')]});var _0x3bcef7=_0x36bede[_0xf3e8('0xf')]++;_0x36bede['extensions']['push']({'type':_0x5b5fcc[_0x35d68b][0x0][_0xf3e8('0x12')],'app':_0xf3e8('0x1d'),'appdata':_0xf3e8('0x1e')+(_0x3bcef7+0x2)+_0xf3e8('0x1f')+(_0x3bcef7+0x1)+')','context':_0x5b5fcc[_0x35d68b][0x0][_0xf3e8('0x15')],'exten':_0x5b5fcc[_0x35d68b][0x0][_0xf3e8('0xa')],'priority':_0x3bcef7,'VoiceExtensionId':_0x5b5fcc[_0x35d68b][0x0][_0xf3e8('0x16')]});if(_0x36bede[_0xf3e8('0x19')]){_0x36bede[_0xf3e8('0x10')][_0xf3e8('0x11')]({'type':_0x5b5fcc[_0x35d68b][0x0]['type'],'app':_0xf3e8('0x13'),'appdata':_0x36bede[_0xf3e8('0x19')][_0xf3e8('0x1a')]?'CDR(prefix)=${EXTEN:0:'+_0x36bede[_0xf3e8('0x19')][_0xf3e8('0x1a')]+'}':_0xf3e8('0x20'),'context':_0x5b5fcc[_0x35d68b][0x0][_0xf3e8('0x15')],'exten':_0x5b5fcc[_0x35d68b][0x0][_0xf3e8('0xa')],'priority':_0x36bede[_0xf3e8('0xf')]++,'VoiceExtensionId':_0x5b5fcc[_0x35d68b][0x0][_0xf3e8('0x16')]});}_0x36bede[_0xf3e8('0x10')][_0xf3e8('0x11')]({'type':_0x5b5fcc[_0x35d68b][0x0][_0xf3e8('0x12')],'app':_0xf3e8('0x13'),'appdata':_0xf3e8('0x21')+_0x5b5fcc[_0x35d68b][0x0][_0xf3e8('0x16')],'context':_0x5b5fcc[_0x35d68b][0x0][_0xf3e8('0x15')],'exten':_0x5b5fcc[_0x35d68b][0x0][_0xf3e8('0xa')],'priority':_0x36bede[_0xf3e8('0xf')]++,'VoiceExtensionId':_0x5b5fcc[_0x35d68b][0x0]['VoiceExtensionId']});if(_0x36bede[_0xf3e8('0x19')]&&_0x36bede[_0xf3e8('0x19')][_0xf3e8('0xe')](_0xf3e8('0x22'))&&_0x36bede['extension'][_0xf3e8('0x22')]!==_0xf3e8('0x23')){_0x36bede[_0xf3e8('0x10')][_0xf3e8('0x11')]({'type':_0x5b5fcc[_0x35d68b][0x0][_0xf3e8('0x12')],'app':_0xf3e8('0x13'),'appdata':_0xf3e8('0x24'),'context':_0x5b5fcc[_0x35d68b][0x0][_0xf3e8('0x15')],'exten':_0x5b5fcc[_0x35d68b][0x0][_0xf3e8('0xa')],'priority':_0x36bede[_0xf3e8('0xf')]++,'VoiceExtensionId':_0x5b5fcc[_0x35d68b][0x0]['VoiceExtensionId']});_0x36bede[_0xf3e8('0x10')][_0xf3e8('0x11')]({'type':_0x5b5fcc[_0x35d68b][0x0][_0xf3e8('0x12')],'app':_0xf3e8('0x13'),'appdata':_0xf3e8('0x25')+_0x36bede['extension'][_0xf3e8('0x22')]||_0xf3e8('0x26'),'context':_0x5b5fcc[_0x35d68b][0x0][_0xf3e8('0x15')],'exten':_0x5b5fcc[_0x35d68b][0x0][_0xf3e8('0xa')],'priority':_0x36bede[_0xf3e8('0xf')]++,'VoiceExtensionId':_0x5b5fcc[_0x35d68b][0x0][_0xf3e8('0x16')]});}}_0x36bede[_0xf3e8('0x10')][_0xf3e8('0x11')]({'type':_0x5b5fcc[_0x35d68b][0x0][_0xf3e8('0x12')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x5b5fcc[_0x35d68b][0x0][_0xf3e8('0x15')],'exten':_0x5b5fcc[_0x35d68b][0x0]['exten'],'priority':_0x36bede[_0xf3e8('0xf')]++,'VoiceExtensionId':_0x5b5fcc[_0x35d68b][0x0][_0xf3e8('0x16')]});_0x36bede['extensions'][_0xf3e8('0x11')]({'type':_0x5b5fcc[_0x35d68b][0x0][_0xf3e8('0x12')],'app':'Set','appdata':_0xf3e8('0x27'),'context':_0x5b5fcc[_0x35d68b][0x0][_0xf3e8('0x15')],'exten':_0x5b5fcc[_0x35d68b][0x0][_0xf3e8('0xa')],'priority':_0x36bede[_0xf3e8('0xf')]++,'VoiceExtensionId':_0x5b5fcc[_0x35d68b][0x0][_0xf3e8('0x16')]});_0x36bede[_0xf3e8('0x10')]['push']({'type':_0x5b5fcc[_0x35d68b][0x0]['type'],'app':'Set','appdata':_0xf3e8('0x28'),'context':_0x5b5fcc[_0x35d68b][0x0]['context'],'exten':_0x5b5fcc[_0x35d68b][0x0]['exten'],'priority':_0x36bede[_0xf3e8('0xf')]++,'VoiceExtensionId':_0x5b5fcc[_0x35d68b][0x0]['VoiceExtensionId']});for(var _0xd72cc1=0x0,_0x770f4b=0x0;_0xd72cc1<_0x5b5fcc[_0x35d68b][_0xf3e8('0x29')];_0xd72cc1+=0x1,_0x770f4b=0x0){var _0x3bed6f=_0x5b5fcc[_0x35d68b][_0xd72cc1];if(_0x3bed6f[_0xf3e8('0x12')]){_0x3bed6f[_0xf3e8('0x12')]=_0x3bed6f[_0xf3e8('0x12')]['toLowerCase']();}var _0x238f29=[];var _0x39cf67=[];delete _0x3bed6f['id'];delete _0x3bed6f['createdAt'];delete _0x3bed6f[_0xf3e8('0x2a')];var _0x47c396=_0x3bed6f[_0xf3e8('0x2b')]!==_0xf3e8('0x2c')?[_0x3bed6f[_0xf3e8('0x2b')]]:_0x3bed6f[_0xf3e8('0x7')]?_[_0xf3e8('0x9')](_[_0xf3e8('0xc')](_0x36bede[_0xf3e8('0x2d')],{'IntervalId':_0x3bed6f['IntervalId']}),_0xf3e8('0x2b')):[];if(_0x3bed6f[_0xf3e8('0xe')]('tag')){if(_0x3bed6f[_0xf3e8('0x2e')]&&_0x3bed6f[_0xf3e8('0x2e')]!=='--'){_0x238f29[_0xf3e8('0x11')]({'type':_0x3bed6f[_0xf3e8('0x12')],'app':_0xf3e8('0x13'),'appdata':_0xf3e8('0x2f')+_0x3bed6f[_0xf3e8('0x2e')],'context':_0x3bed6f['context'],'exten':_0x3bed6f['exten'],'priority':_0x47c396[_0xf3e8('0x29')]+_0x36bede[_0xf3e8('0xf')]+_0x770f4b++,'VoiceExtensionId':_0x3bed6f['VoiceExtensionId']});}}if(_0x3bed6f[_0xf3e8('0x12')]==='outbound'&&_0x3bed6f[_0xf3e8('0xe')](_0xf3e8('0x30'))){if(_0x3bed6f['callerID']){_0x238f29[_0xf3e8('0x11')]({'type':_0x3bed6f[_0xf3e8('0x12')],'app':'ExecIf','appdata':_0xf3e8('0x31')+_0x3bed6f[_0xf3e8('0x30')]+')','context':_0x3bed6f[_0xf3e8('0x15')],'exten':_0x3bed6f['exten'],'priority':_0x47c396[_0xf3e8('0x29')]+_0x36bede['priority']+_0x770f4b++,'VoiceExtensionId':_0x3bed6f[_0xf3e8('0x16')]});}else{_0x238f29[_0xf3e8('0x11')]({'type':_0x3bed6f['type'],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x3bed6f[_0xf3e8('0x15')],'exten':_0x3bed6f['exten'],'priority':_0x47c396['length']+_0x36bede[_0xf3e8('0xf')]+_0x770f4b++,'VoiceExtensionId':_0x3bed6f[_0xf3e8('0x16')]});}}if(_0x3bed6f[_0xf3e8('0xe')](_0xf3e8('0x32'))){if(_0x31cccf[_0xf3e8('0x33')](_0x3bed6f[_0xf3e8('0x34')][_0xf3e8('0x35')]())>=0x0&&_0x3bed6f[_0xf3e8('0x36')]!==_0xf3e8('0x37')){if(_0x3bed6f[_0xf3e8('0x32')]){_0x238f29[_0xf3e8('0x11')]({'type':_0x3bed6f[_0xf3e8('0x12')],'app':_0xf3e8('0x1d'),'appdata':_0xf3e8('0x38'),'context':_0x3bed6f[_0xf3e8('0x15')],'exten':_0x3bed6f[_0xf3e8('0xa')],'priority':_0x47c396[_0xf3e8('0x29')]+_0x36bede['priority']+_0x770f4b++,'VoiceExtensionId':_0x3bed6f['VoiceExtensionId']});_0x238f29[_0xf3e8('0x11')]({'type':_0x3bed6f[_0xf3e8('0x12')],'app':_0xf3e8('0x13'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x3bed6f['context'],'exten':_0x3bed6f[_0xf3e8('0xa')],'priority':_0x47c396[_0xf3e8('0x29')]+_0x36bede[_0xf3e8('0xf')]+_0x770f4b++,'VoiceExtensionId':_0x3bed6f[_0xf3e8('0x16')]});}else{_0x238f29[_0xf3e8('0x11')]({'type':_0x3bed6f[_0xf3e8('0x12')],'app':'ExecIf','appdata':_0xf3e8('0x39'),'context':_0x3bed6f[_0xf3e8('0x15')],'exten':_0x3bed6f[_0xf3e8('0xa')],'priority':_0x47c396[_0xf3e8('0x29')]+_0x36bede[_0xf3e8('0xf')]+_0x770f4b++,'VoiceExtensionId':_0x3bed6f['VoiceExtensionId']});_0x238f29[_0xf3e8('0x11')]({'type':_0x3bed6f['type'],'app':_0xf3e8('0x13'),'appdata':_0xf3e8('0x3a'),'context':_0x3bed6f[_0xf3e8('0x15')],'exten':_0x3bed6f[_0xf3e8('0xa')],'priority':_0x47c396[_0xf3e8('0x29')]+_0x36bede[_0xf3e8('0xf')]+_0x770f4b++,'VoiceExtensionId':_0x3bed6f[_0xf3e8('0x16')]});}}}for(var _0x41d7b8=0x0;_0x41d7b8<_0x47c396['length'];_0x41d7b8+=0x1){var _0x391227=_0x36bede['priority']+_0x47c396[_0xf3e8('0x29')];var _0x26f80f=_0x41d7b8===_0x47c396['length']-0x1?_0x36bede[_0xf3e8('0xf')]+_0x238f29['length']+_0x39cf67['length']+0x2:_0x36bede[_0xf3e8('0xf')]+_0x41d7b8+0x1;_0x238f29[_0xf3e8('0x3b')](_0x41d7b8,0x0,{'type':_0x3bed6f[_0xf3e8('0x12')],'app':_0xf3e8('0x3c'),'appdata':_0x47c396[_0x41d7b8]+'?'+_0x3bed6f['context']+_0xf3e8('0x3d')+_0x391227+':'+_0x3bed6f['context']+_0xf3e8('0x3d')+_0x26f80f,'exten':_0x3bed6f[_0xf3e8('0xa')],'context':_0x3bed6f[_0xf3e8('0x15')],'priority':_0x36bede[_0xf3e8('0xf')]+_0x41d7b8,'VoiceExtensionId':_0x5b5fcc[_0x35d68b][0x0][_0xf3e8('0x16')]});}_0x3bed6f[_0xf3e8('0xf')]=_0x238f29[_0xf3e8('0x29')]?_[_0xf3e8('0x3e')](_0x238f29)['priority']+0x1:_0x36bede[_0xf3e8('0xf')];_0x36bede[_0xf3e8('0xf')]=(_0x39cf67[_0xf3e8('0x29')]?_[_0xf3e8('0x3e')](_0x39cf67)[_0xf3e8('0xf')]:_0x3bed6f['priority'])+0x1;_0x36bede[_0xf3e8('0x10')]=_[_0xf3e8('0x3f')](_0x36bede['extensions'],_0x238f29,[_0x3bed6f],_0x39cf67);}_0x36bede[_0xf3e8('0x10')]['push']({'type':_0x5b5fcc[_0x35d68b][0x0][_0xf3e8('0x12')],'app':_0xf3e8('0x40'),'exten':_0x5b5fcc[_0x35d68b][0x0][_0xf3e8('0xa')],'context':_0x5b5fcc[_0x35d68b][0x0][_0xf3e8('0x15')],'priority':_0x36bede[_0xf3e8('0xf')],'VoiceExtensionId':_0x5b5fcc[_0x35d68b][0x0]['VoiceExtensionId']});_0x3fc8ad['push'](_0x5b5fcc[_0x35d68b][0x0][_0xf3e8('0x16')]);_0x23ddeb=_[_0xf3e8('0x3f')](_0x23ddeb,_0x36bede[_0xf3e8('0x10')]);}}return _0xb32d3b[_0xf3e8('0x41')](function(_0x3a836d){return _0xb32d3b[_0xf3e8('0x2')]['VoiceExtension'][_0xf3e8('0x42')]({'where':{'VoiceExtensionId':{'$in':_0x3fc8ad}},'transaction':_0x3a836d})[_0xf3e8('0x5')](function(_0x2d9902){return _0xb32d3b[_0xf3e8('0x2')]['VoiceExtension'][_0xf3e8('0x43')](_[_0xf3e8('0x44')](_0x23ddeb,_0xf3e8('0xf')),{'transaction':_0x3a836d});});});})[_0xf3e8('0x45')](function(_0x4111f2){console[_0xf3e8('0x46')](_0x4111f2);});}exports[_0xf3e8('0x47')]=rewrite; \ No newline at end of file +var _0xc9cf=['push','Set','format','CDR(type)=%s','type','context','priority','VoiceExtensionId','inbound','CDR(routeid)=','CDR(destination)=','${EXTEN:','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','cutdigits','CDR(prefix)=noprefix','recordingFormat','none','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','*,*,*,*','interval','intervals','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','destroy','bulkCreate','sortBy','catch','lodash','util','findAll','then','models','VoiceExtension','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','extensions','extension'];(function(_0x55db7e,_0x33cb14){var _0x4744f9=function(_0x565137){while(--_0x565137){_0x55db7e['push'](_0x55db7e['shift']());}};_0x4744f9(++_0x33cb14);}(_0xc9cf,0x106));var _0xfc9c=function(_0x4a8072,_0x435bab){_0x4a8072=_0x4a8072-0x0;var _0x11a4fe=_0xc9cf[_0x4a8072];return _0x11a4fe;};'use strict';var _=require(_0xfc9c('0x0'));var util=require(_0xfc9c('0x1'));function rewrite(_0x170715,_0x459efb){var _0x45a166=this;return _0x170715['models']['Interval'][_0xfc9c('0x2')]({'raw':!![]})[_0xfc9c('0x3')](function(_0x510b63){_0x45a166['intervals']=_0x510b63;return _0x170715[_0xfc9c('0x4')][_0xfc9c('0x5')][_0xfc9c('0x2')]({'where':{'IntervalId':_0x459efb[_0xfc9c('0x6')]},'raw':!![]});})['then'](function(_0x271634){return _0x170715[_0xfc9c('0x4')]['VoiceExtension'][_0xfc9c('0x2')]({'where':{'exten':{'$in':_[_0xfc9c('0x7')](_[_0xfc9c('0x8')](_0x271634,_0xfc9c('0x9')))}},'order':[{'raw':_0xfc9c('0xa')}],'raw':!![]});})['then'](function(_0x58557b){var _0x72fb61=_[_0xfc9c('0xb')](_0x58557b,{'priority':'1'});var _0x3da82c=_[_0xfc9c('0xb')](_0x58557b,{'isApp':0x1});var _0x4c15a8=_[_0xfc9c('0xc')](_0x3da82c,_0xfc9c('0x9'));var _0x1b581e=[_0xfc9c('0xd'),_0xfc9c('0xe')];var _0x3b03cd=[];var _0x1682b3=[];for(var _0x5198f2 in _0x4c15a8){if(_0x4c15a8[_0xfc9c('0xf')](_0x5198f2)){_0x45a166['priority']=0x2;_0x45a166[_0xfc9c('0x10')]=[];_0x45a166[_0xfc9c('0x11')]=_['find'](_0x72fb61,{'exten':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x9')]});_0x45a166[_0xfc9c('0x10')][_0xfc9c('0x12')]({'type':_0x4c15a8[_0x5198f2][0x0]['type'],'app':_0xfc9c('0x13'),'appdata':util[_0xfc9c('0x14')](_0xfc9c('0x15'),_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x16')]),'context':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x17')],'exten':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x9')],'priority':_0x45a166[_0xfc9c('0x18')]++,'VoiceExtensionId':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x19')]});if(_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x16')]===_0xfc9c('0x1a')){_0x45a166['extensions']['push']({'type':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x16')],'app':_0xfc9c('0x13'),'appdata':_0xfc9c('0x1b')+_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x19')],'context':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x17')],'exten':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x9')],'priority':_0x45a166['priority']++,'VoiceExtensionId':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x19')]});}else if(_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x16')]==='outbound'){if(_0x45a166['extension']){_0x45a166['extensions'][_0xfc9c('0x12')]({'type':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x16')],'app':_0xfc9c('0x13'),'appdata':_0xfc9c('0x1c')+(_0x45a166[_0xfc9c('0x11')]['cutdigits']?_0xfc9c('0x1d')+_0x45a166[_0xfc9c('0x11')]['cutdigits']+'}':'${EXTEN}'),'context':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x17')],'exten':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x9')],'priority':_0x45a166['priority']++,'VoiceExtensionId':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x19')]});}_0x45a166[_0xfc9c('0x10')][_0xfc9c('0x12')]({'type':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x16')],'app':_0xfc9c('0x13'),'appdata':_0xfc9c('0x1b')+_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x19')],'context':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x17')],'exten':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x9')],'priority':_0x45a166[_0xfc9c('0x18')]++,'VoiceExtensionId':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x19')]});var _0x3b1d86=_0x45a166[_0xfc9c('0x18')]++;_0x45a166['extensions'][_0xfc9c('0x12')]({'type':_0x4c15a8[_0x5198f2][0x0]['type'],'app':_0xfc9c('0x1e'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x3b1d86+0x2)+_0xfc9c('0x1f')+(_0x3b1d86+0x1)+')','context':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x17')],'exten':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x9')],'priority':_0x3b1d86,'VoiceExtensionId':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x19')]});if(_0x45a166[_0xfc9c('0x11')]){_0x45a166[_0xfc9c('0x10')][_0xfc9c('0x12')]({'type':_0x4c15a8[_0x5198f2][0x0]['type'],'app':_0xfc9c('0x13'),'appdata':_0x45a166[_0xfc9c('0x11')]['cutdigits']?_0xfc9c('0x20')+_0x45a166[_0xfc9c('0x11')][_0xfc9c('0x21')]+'}':_0xfc9c('0x22'),'context':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x17')],'exten':_0x4c15a8[_0x5198f2][0x0]['exten'],'priority':_0x45a166[_0xfc9c('0x18')]++,'VoiceExtensionId':_0x4c15a8[_0x5198f2][0x0]['VoiceExtensionId']});}_0x45a166[_0xfc9c('0x10')][_0xfc9c('0x12')]({'type':_0x4c15a8[_0x5198f2][0x0]['type'],'app':'Set','appdata':'outboundrouteid='+_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x19')],'context':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x17')],'exten':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x9')],'priority':_0x45a166['priority']++,'VoiceExtensionId':_0x4c15a8[_0x5198f2][0x0]['VoiceExtensionId']});if(_0x45a166[_0xfc9c('0x11')]&&_0x45a166[_0xfc9c('0x11')][_0xfc9c('0xf')]('recordingFormat')&&_0x45a166[_0xfc9c('0x11')][_0xfc9c('0x23')]!==_0xfc9c('0x24')){_0x45a166[_0xfc9c('0x10')][_0xfc9c('0x12')]({'type':_0x4c15a8[_0x5198f2][0x0]['type'],'app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x4c15a8[_0x5198f2][0x0]['context'],'exten':_0x4c15a8[_0x5198f2][0x0]['exten'],'priority':_0x45a166[_0xfc9c('0x18')]++,'VoiceExtensionId':_0x4c15a8[_0x5198f2][0x0]['VoiceExtensionId']});_0x45a166[_0xfc9c('0x10')]['push']({'type':_0x4c15a8[_0x5198f2][0x0]['type'],'app':'Set','appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x45a166[_0xfc9c('0x11')]['recordingFormat']||_0xfc9c('0x25'),'context':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x17')],'exten':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x9')],'priority':_0x45a166[_0xfc9c('0x18')]++,'VoiceExtensionId':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x19')]});}}_0x45a166[_0xfc9c('0x10')][_0xfc9c('0x12')]({'type':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x16')],'app':'Set','appdata':_0xfc9c('0x26'),'context':_0x4c15a8[_0x5198f2][0x0]['context'],'exten':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x9')],'priority':_0x45a166['priority']++,'VoiceExtensionId':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x19')]});_0x45a166[_0xfc9c('0x10')]['push']({'type':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x16')],'app':'Set','appdata':_0xfc9c('0x27'),'context':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x17')],'exten':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x9')],'priority':_0x45a166[_0xfc9c('0x18')]++,'VoiceExtensionId':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x19')]});_0x45a166[_0xfc9c('0x10')][_0xfc9c('0x12')]({'type':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x16')],'app':_0xfc9c('0x13'),'appdata':_0xfc9c('0x28'),'context':_0x4c15a8[_0x5198f2][0x0]['context'],'exten':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x9')],'priority':_0x45a166[_0xfc9c('0x18')]++,'VoiceExtensionId':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x19')]});for(var _0x45a3af=0x0,_0x15e8b6=0x0;_0x45a3af<_0x4c15a8[_0x5198f2][_0xfc9c('0x29')];_0x45a3af+=0x1,_0x15e8b6=0x0){var _0x413597=_0x4c15a8[_0x5198f2][_0x45a3af];if(_0x413597[_0xfc9c('0x16')]){_0x413597[_0xfc9c('0x16')]=_0x413597['type'][_0xfc9c('0x2a')]();}var _0x5bdc3b=[];var _0x21734d=[];delete _0x413597['id'];delete _0x413597[_0xfc9c('0x2b')];delete _0x413597[_0xfc9c('0x2c')];var _0x54cee6=_0x413597['interval']!==_0xfc9c('0x2d')?[_0x413597[_0xfc9c('0x2e')]]:_0x413597[_0xfc9c('0x6')]?_[_0xfc9c('0x8')](_['filter'](_0x45a166[_0xfc9c('0x2f')],{'IntervalId':_0x413597[_0xfc9c('0x6')]}),'interval'):[];if(_0x413597['hasOwnProperty'](_0xfc9c('0x30'))){if(_0x413597[_0xfc9c('0x30')]&&_0x413597['tag']!=='--'){_0x5bdc3b[_0xfc9c('0x12')]({'type':_0x413597[_0xfc9c('0x16')],'app':_0xfc9c('0x13'),'appdata':_0xfc9c('0x31')+_0x413597[_0xfc9c('0x30')],'context':_0x413597[_0xfc9c('0x17')],'exten':_0x413597['exten'],'priority':_0x54cee6['length']+_0x45a166['priority']+_0x15e8b6++,'VoiceExtensionId':_0x413597[_0xfc9c('0x19')]});}}if(_0x413597[_0xfc9c('0x16')]==='outbound'&&_0x413597['hasOwnProperty']('callerID')){if(_0x413597['callerID']){_0x5bdc3b[_0xfc9c('0x12')]({'type':_0x413597['type'],'app':'ExecIf','appdata':_0xfc9c('0x32')+_0x413597[_0xfc9c('0x33')]+')','context':_0x413597[_0xfc9c('0x17')],'exten':_0x413597[_0xfc9c('0x9')],'priority':_0x54cee6['length']+_0x45a166[_0xfc9c('0x18')]+_0x15e8b6++,'VoiceExtensionId':_0x413597[_0xfc9c('0x19')]});}else{_0x5bdc3b['push']({'type':_0x413597[_0xfc9c('0x16')],'app':_0xfc9c('0x1e'),'appdata':_0xfc9c('0x34'),'context':_0x413597[_0xfc9c('0x17')],'exten':_0x413597[_0xfc9c('0x9')],'priority':_0x54cee6['length']+_0x45a166[_0xfc9c('0x18')]+_0x15e8b6++,'VoiceExtensionId':_0x413597['VoiceExtensionId']});}}if(_0x413597['hasOwnProperty'](_0xfc9c('0x35'))){if(_0x1b581e['indexOf'](_0x413597['app']['toLowerCase']())>=0x0&&_0x413597[_0xfc9c('0x36')]!==_0xfc9c('0x37')){if(_0x413597[_0xfc9c('0x35')]){_0x5bdc3b[_0xfc9c('0x12')]({'type':_0x413597['type'],'app':'ExecIf','appdata':_0xfc9c('0x38'),'context':_0x413597[_0xfc9c('0x17')],'exten':_0x413597[_0xfc9c('0x9')],'priority':_0x54cee6[_0xfc9c('0x29')]+_0x45a166[_0xfc9c('0x18')]+_0x15e8b6++,'VoiceExtensionId':_0x413597[_0xfc9c('0x19')]});_0x5bdc3b[_0xfc9c('0x12')]({'type':_0x413597[_0xfc9c('0x16')],'app':_0xfc9c('0x13'),'appdata':_0xfc9c('0x39'),'context':_0x413597[_0xfc9c('0x17')],'exten':_0x413597['exten'],'priority':_0x54cee6['length']+_0x45a166['priority']+_0x15e8b6++,'VoiceExtensionId':_0x413597[_0xfc9c('0x19')]});}else{_0x5bdc3b[_0xfc9c('0x12')]({'type':_0x413597[_0xfc9c('0x16')],'app':_0xfc9c('0x1e'),'appdata':_0xfc9c('0x3a'),'context':_0x413597[_0xfc9c('0x17')],'exten':_0x413597['exten'],'priority':_0x54cee6[_0xfc9c('0x29')]+_0x45a166[_0xfc9c('0x18')]+_0x15e8b6++,'VoiceExtensionId':_0x413597[_0xfc9c('0x19')]});_0x5bdc3b[_0xfc9c('0x12')]({'type':_0x413597[_0xfc9c('0x16')],'app':'Set','appdata':_0xfc9c('0x3b'),'context':_0x413597[_0xfc9c('0x17')],'exten':_0x413597[_0xfc9c('0x9')],'priority':_0x54cee6[_0xfc9c('0x29')]+_0x45a166[_0xfc9c('0x18')]+_0x15e8b6++,'VoiceExtensionId':_0x413597[_0xfc9c('0x19')]});}}}for(var _0x18e410=0x0;_0x18e410<_0x54cee6[_0xfc9c('0x29')];_0x18e410+=0x1){var _0x453c95=_0x45a166['priority']+_0x54cee6[_0xfc9c('0x29')];var _0x39af90=_0x18e410===_0x54cee6['length']-0x1?_0x45a166['priority']+_0x5bdc3b['length']+_0x21734d['length']+0x2:_0x45a166[_0xfc9c('0x18')]+_0x18e410+0x1;_0x5bdc3b[_0xfc9c('0x3c')](_0x18e410,0x0,{'type':_0x413597[_0xfc9c('0x16')],'app':_0xfc9c('0x3d'),'appdata':_0x54cee6[_0x18e410]+'?'+_0x413597[_0xfc9c('0x17')]+_0xfc9c('0x3e')+_0x453c95+':'+_0x413597[_0xfc9c('0x17')]+_0xfc9c('0x3e')+_0x39af90,'exten':_0x413597['exten'],'context':_0x413597[_0xfc9c('0x17')],'priority':_0x45a166[_0xfc9c('0x18')]+_0x18e410,'VoiceExtensionId':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x19')]});}_0x413597[_0xfc9c('0x18')]=_0x5bdc3b[_0xfc9c('0x29')]?_['last'](_0x5bdc3b)['priority']+0x1:_0x45a166[_0xfc9c('0x18')];_0x45a166[_0xfc9c('0x18')]=(_0x21734d[_0xfc9c('0x29')]?_[_0xfc9c('0x3f')](_0x21734d)[_0xfc9c('0x18')]:_0x413597['priority'])+0x1;_0x45a166[_0xfc9c('0x10')]=_[_0xfc9c('0x40')](_0x45a166[_0xfc9c('0x10')],_0x5bdc3b,[_0x413597],_0x21734d);}_0x45a166[_0xfc9c('0x10')]['push']({'type':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x16')],'app':_0xfc9c('0x41'),'exten':_0x4c15a8[_0x5198f2][0x0]['exten'],'context':_0x4c15a8[_0x5198f2][0x0]['context'],'priority':_0x45a166['priority'],'VoiceExtensionId':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x19')]});_0x3b03cd[_0xfc9c('0x12')](_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x19')]);_0x1682b3=_[_0xfc9c('0x40')](_0x1682b3,_0x45a166[_0xfc9c('0x10')]);}}return _0x170715['transaction'](function(_0x4973d6){return _0x170715[_0xfc9c('0x4')][_0xfc9c('0x5')][_0xfc9c('0x42')]({'where':{'VoiceExtensionId':{'$in':_0x3b03cd}},'transaction':_0x4973d6})[_0xfc9c('0x3')](function(_0x45d28e){return _0x170715[_0xfc9c('0x4')][_0xfc9c('0x5')][_0xfc9c('0x43')](_[_0xfc9c('0x44')](_0x1682b3,_0xfc9c('0x18')),{'transaction':_0x4973d6});});});})[_0xfc9c('0x45')](function(_0x1375e4){console['error'](_0x1375e4);});}exports['rewrite']=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 93ef806..c9215e6 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 _0x4c49=['Duplicate\x20Contact','create','then','push','catch','Error\x20while\x20creating\x20contact:\x20','message','stringify','cmContact','checkHopper','inspect','insert','into','scheduledAt','ContactId','ListId','createdAt','updatedAt','select','field','NOW()','toString','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','from','cm_hopper','fromQuery','id\x20IN\x20?','calleridnum','cm_hopper_final','\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper_black','str','VoiceQueue','outbound','dialCheckDuplicateType','CmList','get','always','sequelize','VoiceQueueId','onlyIfOpen','query','all','findAll','Campaign','Lists','CampaignId','BlackLists','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','emit','resume','resolve','contact:csv_','exit','SIGINT','info','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','bluebird','util','lodash','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','register','argv','null','undefined','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','hasOwnProperty','data','firstName\x20not\x20specified!','phone','birthDate','YYYY-MM-DD','email','email\x20format\x20is\x20not\x20valid!','CompanyId','duplicate'];(function(_0x30fbd1,_0x36e6a9){var _0x47b808=function(_0x42bcd9){while(--_0x42bcd9){_0x30fbd1['push'](_0x30fbd1['shift']());}};_0x47b808(++_0x36e6a9);}(_0x4c49,0xad));var _0x94c4=function(_0x1d0b48,_0x1d0a46){_0x1d0b48=_0x1d0b48-0x0;var _0x157c73=_0x4c49[_0x1d0b48];return _0x157c73;};'use strict';var BPromise=require(_0x94c4('0x0'));var util=require(_0x94c4('0x1'));var _=require(_0x94c4('0x2'));var fs=require('fs');var squel=require(_0x94c4('0x3'));var Papa=require('papaparse');var Redis=require(_0x94c4('0x4'));var db=require(_0x94c4('0x5'))['db'];var config=require(_0x94c4('0x6'));var logger=require(_0x94c4('0x7'))(_0x94c4('0x8'));config[_0x94c4('0x9')]=_[_0x94c4('0xa')](config[_0x94c4('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x94c4('0x9')]));require('../../../api/cmContact/cmContact.socket')[_0x94c4('0xb')](socket);try{if(!process[_0x94c4('0xc')][0x2]||process[_0x94c4('0xc')][0x2]==='undefined'||process[_0x94c4('0xc')][0x2]===_0x94c4('0xd')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0x94c4('0xc')][0x2];if(!process[_0x94c4('0xc')][0x3]||process['argv'][0x3]===_0x94c4('0xe')||process[_0x94c4('0xc')][0x3]===_0x94c4('0xd')||!process[_0x94c4('0xc')][0x4]||process['argv'][0x4]===_0x94c4('0xe')||process[_0x94c4('0xc')][0x4]==='null'){throw new Error(_0x94c4('0xf'));}var FIELDS=_['zipObject'](process[_0x94c4('0xc')][0x3][_0x94c4('0x10')](','),process[_0x94c4('0xc')][0x4][_0x94c4('0x10')](','));if(!process[_0x94c4('0xc')][0x5]||process[_0x94c4('0xc')][0x5]===_0x94c4('0xe')||process[_0x94c4('0xc')][0x5]==='null'){throw new Error(_0x94c4('0x11'));}var LISTID=process[_0x94c4('0xc')][0x5];var COMPANYID=process[_0x94c4('0xc')][0x6]&&process[_0x94c4('0xc')][0x6]!==_0x94c4('0xe')&&process[_0x94c4('0xc')][0x6]!=='null'?process[_0x94c4('0xc')][0x6]:null;var DUPLICATES=process[_0x94c4('0xc')][0x7]&&process[_0x94c4('0xc')][0x7]!=='undefined'&&process['argv'][0x7]!==_0x94c4('0xd')?process[_0x94c4('0xc')][0x7]:null;if(!process[_0x94c4('0xc')][0x8]||process[_0x94c4('0xc')][0x8]===_0x94c4('0xe')||process['argv'][0x8]===_0x94c4('0xd')){throw new Error(_0x94c4('0x12'));}var SOCKET_TIMESTAMP=process[_0x94c4('0xc')][0x8];}catch(_0x5f0c12){logger[_0x94c4('0x13')](_0x5f0c12);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(_0x1f1e6d,_0x590bfa,_0x18fbf1,_0x44fc6f){var _0x5b81df={'message':_0x590bfa};_0x5b81df[_0x1f1e6d]=!![];if(_0x18fbf1){_0x5b81df[_0x94c4('0x14')]=_0x18fbf1;}if(_0x44fc6f){_0x5b81df['index']=_0x44fc6f;}return _0x5b81df;}function isEmail(_0x43c3b1){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))*$/[_0x94c4('0x15')](_0x43c3b1);}function checkRow(_0x1e3daa,_0x105c34,_0x210ab2){return new BPromise(function(_0x4dbf74,_0x143482){if(_[_0x94c4('0x16')](_0x1e3daa)){return _0x143482(handleCheckRowError('error',_0x94c4('0x17'),null,_0x210ab2));}if(_0x1e3daa['errors']&&_0x1e3daa[_0x94c4('0x18')][_0x94c4('0x19')]){var _0x4ca811=_[_0x94c4('0x1a')](_0x1e3daa[_0x94c4('0x18')],'message')['join'](';');return _0x143482(handleCheckRowError(_0x94c4('0x13'),_0x4ca811,null,_0x210ab2));}var _0x3c5454={};for(var _0x51137a in FIELDS){if(FIELDS[_0x94c4('0x1b')](_0x51137a)&&FIELDS[_0x51137a]){_0x3c5454[_0x51137a]=_0x1e3daa[_0x94c4('0x1c')][0x0][FIELDS[_0x51137a]]||_0x1e3daa['data'][0x0]['\ufeff'+FIELDS[_0x51137a]];}}if(!_0x3c5454['firstName']){return _0x143482(handleCheckRowError('error',_0x94c4('0x1d'),null,_0x210ab2));}if(!_0x3c5454[_0x94c4('0x1e')]){return _0x143482(handleCheckRowError(_0x94c4('0x13'),'phone\x20not\x20specified!',null,_0x210ab2));}if(_0x3c5454[_0x94c4('0x1f')]){var _0x53b05b=moment(_0x3c5454[_0x94c4('0x1f')],_0x94c4('0x20'));if(!_0x53b05b['isValid']()){return _0x143482(handleCheckRowError(_0x94c4('0x13'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x210ab2));}}if(_0x3c5454[_0x94c4('0x21')]){if(!isEmail(_0x3c5454['email'])){return _0x143482(handleCheckRowError(_0x94c4('0x13'),_0x94c4('0x22'),null,_0x210ab2));}}_0x3c5454['ListId']=LISTID;_0x3c5454[_0x94c4('0x23')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x94c4('0x19')]&&_0x105c34){var _0x4db6f5={};for(var _0xd4abce=0x0,_0x47431e=DUPLICATES[_0x94c4('0x19')];_0xd4abce<_0x47431e;_0xd4abce+=0x1){_0x4db6f5[DUPLICATES[_0xd4abce]]=_0x3c5454[DUPLICATES[_0xd4abce]];}var _0x2823c9=_['find'](_0x105c34,_0x4db6f5);if(_0x2823c9){return _0x143482(handleCheckRowError(_0x94c4('0x24'),_0x94c4('0x25'),_0x2823c9,_0x210ab2));}}return db['CmContact'][_0x94c4('0x26')](_0x3c5454,{'raw':!![],'hooks':![],'fields':_['keys'](_0x3c5454)})[_0x94c4('0x27')](function(_0x1bab2a){if(DUPLICATES&&DUPLICATES['length']&&_0x105c34){_0x105c34[_0x94c4('0x28')](_['pick'](_0x3c5454,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x1bab2a['id'];return _0x4dbf74();})[_0x94c4('0x29')](function(_0x38ca63){return _0x143482(handleCheckRowError('error',_0x94c4('0x2a')+(_0x38ca63[_0x94c4('0x2b')]||JSON[_0x94c4('0x2c')](_0x38ca63)),null,_0x210ab2));});});}function checkHopper(){function _0x61de39(){return function(_0x1554d4){logger[_0x94c4('0x13')](_0x94c4('0x2d'),_0x94c4('0x2e'),util[_0x94c4('0x2f')](_0x1554d4,{'showHidden':![],'depth':null}));};}var _0x282188=function(_0x41382c,_0x2438e6){var _0x3f9a8f=squel[_0x94c4('0x30')]()[_0x94c4('0x31')]('cm_hopper')['fromQuery']([_0x94c4('0x1e'),_0x94c4('0x32'),_0x94c4('0x33'),_0x94c4('0x34'),_0x2438e6,_0x94c4('0x35'),_0x94c4('0x36')],squel[_0x94c4('0x37')]()['field'](_0x94c4('0x1e'),_0x94c4('0x1e'))[_0x94c4('0x38')](_0x94c4('0x39'),'scheduledAt')[_0x94c4('0x38')]('id','ContactId')[_0x94c4('0x38')](LISTID[_0x94c4('0x3a')](),'ListId')['field'](_0x41382c['id'][_0x94c4('0x3a')](),_0x2438e6)[_0x94c4('0x38')]('NOW()','createdAt')[_0x94c4('0x38')](_0x94c4('0x39'),_0x94c4('0x36'))['from'](_0x94c4('0x3b'))[_0x94c4('0x3c')](_0x94c4('0x3d'))[_0x94c4('0x3c')](_0x94c4('0x3e'),LISTID[_0x94c4('0x3a')]())[_0x94c4('0x3c')]('phone\x20IS\x20NOT\x20NULL')[_0x94c4('0x3c')](_0x94c4('0x3f'),squel['select']()[_0x94c4('0x38')](_0x94c4('0x1e'))[_0x94c4('0x40')]('cm_hopper')[_0x94c4('0x3c')](_0x2438e6+'\x20=\x20?',_0x41382c['id'][_0x94c4('0x3a')]())))[_0x94c4('0x3a')]();return _0x3f9a8f;};var _0x839f61=function(_0xbf8e82,_0x26d7ea){var _0x41806a=squel['insert']()[_0x94c4('0x31')](_0x94c4('0x41'))[_0x94c4('0x42')]([_0x94c4('0x1e'),_0x94c4('0x32'),_0x94c4('0x33'),_0x94c4('0x34'),_0x26d7ea,_0x94c4('0x35'),_0x94c4('0x36')],squel[_0x94c4('0x37')]()[_0x94c4('0x38')](_0x94c4('0x1e'),_0x94c4('0x1e'))[_0x94c4('0x38')](_0x94c4('0x39'),_0x94c4('0x32'))[_0x94c4('0x38')]('id','ContactId')[_0x94c4('0x38')](LISTID[_0x94c4('0x3a')](),_0x94c4('0x34'))[_0x94c4('0x38')](_0xbf8e82['id'][_0x94c4('0x3a')](),_0x26d7ea)[_0x94c4('0x38')](_0x94c4('0x39'),_0x94c4('0x35'))[_0x94c4('0x38')](_0x94c4('0x39'),_0x94c4('0x36'))['from'](_0x94c4('0x3b'))['where'](_0x94c4('0x3d'))[_0x94c4('0x3c')]('ListId\x20=\x20?',LISTID[_0x94c4('0x3a')]())[_0x94c4('0x3c')](_0x94c4('0x43'),squel['str'](hopperContacts))[_0x94c4('0x3c')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x94c4('0x37')]()[_0x94c4('0x38')](_0x94c4('0x44'))[_0x94c4('0x40')](_0x94c4('0x45'))[_0x94c4('0x3c')](_0x26d7ea+_0x94c4('0x46'),_0xbf8e82['id'][_0x94c4('0x3a')]()))[_0x94c4('0x3c')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x94c4('0x38')](_0x94c4('0x1e'))[_0x94c4('0x40')]('cm_hopper')[_0x94c4('0x3c')](_0x26d7ea+'\x20=\x20?',_0xbf8e82['id'][_0x94c4('0x3a')]())))[_0x94c4('0x3a')]();return _0x41806a;};function _0x199f69(_0x103f65,_0x56001b){var _0x33b9bf=squel['insert']()[_0x94c4('0x31')](_0x94c4('0x41'))[_0x94c4('0x42')]([_0x94c4('0x1e'),_0x94c4('0x32'),_0x94c4('0x33'),_0x94c4('0x34'),_0x56001b,_0x94c4('0x35'),_0x94c4('0x36')],squel[_0x94c4('0x37')]()['field'](_0x94c4('0x1e'),_0x94c4('0x1e'))[_0x94c4('0x38')](_0x94c4('0x39'),_0x94c4('0x32'))[_0x94c4('0x38')]('id',_0x94c4('0x33'))[_0x94c4('0x38')](LISTID[_0x94c4('0x3a')](),_0x94c4('0x34'))[_0x94c4('0x38')](_0x103f65['id']['toString'](),_0x56001b)['field'](_0x94c4('0x39'),'createdAt')[_0x94c4('0x38')](_0x94c4('0x39'),'updatedAt')['from'](_0x94c4('0x3b'))['where'](_0x94c4('0x3d'))[_0x94c4('0x3c')](_0x94c4('0x3e'),LISTID[_0x94c4('0x3a')]())[_0x94c4('0x3c')](_0x94c4('0x43'),squel['str'](hopperContacts))['where'](_0x94c4('0x47')))[_0x94c4('0x3a')]();return _0x33b9bf;}function _0x4719e2(_0x435d25,_0x39780a){var _0x184ab2=squel['insert']()['into'](_0x94c4('0x48'))['fromQuery']([_0x94c4('0x1e'),_0x94c4('0x33'),_0x94c4('0x34'),_0x39780a,_0x94c4('0x35'),_0x94c4('0x36')],squel[_0x94c4('0x37')]()[_0x94c4('0x38')]('phone',_0x94c4('0x1e'))[_0x94c4('0x38')]('id',_0x94c4('0x33'))[_0x94c4('0x38')](LISTID['toString'](),_0x94c4('0x34'))[_0x94c4('0x38')](_0x435d25['id'][_0x94c4('0x3a')](),_0x39780a)[_0x94c4('0x38')](_0x94c4('0x39'),'createdAt')['field'](_0x94c4('0x39'),'updatedAt')[_0x94c4('0x40')](_0x94c4('0x3b'))['where'](_0x94c4('0x3d'))[_0x94c4('0x3c')](_0x94c4('0x3e'),LISTID[_0x94c4('0x3a')]())[_0x94c4('0x3c')]('id\x20IN\x20?',squel[_0x94c4('0x49')](hopperContacts))[_0x94c4('0x3c')](_0x94c4('0x47')))[_0x94c4('0x3a')]();return _0x184ab2;}return db[_0x94c4('0x4a')]['findAll']({'where':{'type':_0x94c4('0x4b')},'attributes':['id',_0x94c4('0x4c')],'include':[{'model':db[_0x94c4('0x4d')],'as':'Lists','where':{'id':LISTID}}]})[_0x94c4('0x27')](function(_0x1cdf13){var _0x56011a=[];if(_0x1cdf13){var _0x5e388a;for(var _0x109b32=0x0,_0x5bff73;_0x109b32<_0x1cdf13['length'];_0x109b32+=0x1){_0x5bff73=_0x1cdf13[_0x109b32][_0x94c4('0x4e')]({'plain':!![]});switch(_0x5bff73['dialCheckDuplicateType']){case _0x94c4('0x4f'):_0x56011a['push'](db[_0x94c4('0x50')]['query'](_0x839f61(_0x5bff73,_0x94c4('0x51')))[_0x94c4('0x27')](function(){})[_0x94c4('0x29')](_0x61de39()));break;case _0x94c4('0x52'):_0x56011a['push'](db[_0x94c4('0x50')][_0x94c4('0x53')](_0x282188(_0x5bff73,'VoiceQueueId'))['then'](function(){})[_0x94c4('0x29')](_0x61de39()));break;default:_0x56011a[_0x94c4('0x28')](db['sequelize'][_0x94c4('0x53')](_0x199f69(_0x5bff73,_0x94c4('0x51')))[_0x94c4('0x27')](function(){})[_0x94c4('0x29')](_0x61de39()));}}}return _0x56011a;})[_0x94c4('0x54')]()['then'](function(){return db[_0x94c4('0x4a')][_0x94c4('0x55')]({'where':{'type':_0x94c4('0x4b')},'attributes':['id'],'include':[{'model':db[_0x94c4('0x4d')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x94c4('0x27')](function(_0x18cdb7){var _0x98397a=[];if(_0x18cdb7){var _0xfb937a;for(var _0x10c92d=0x0,_0x22fe7a;_0x10c92d<_0x18cdb7[_0x94c4('0x19')];_0x10c92d+=0x1){_0x22fe7a=_0x18cdb7[_0x10c92d]['get']({'plain':!![]});_0x98397a[_0x94c4('0x28')](db[_0x94c4('0x50')][_0x94c4('0x53')](_0x4719e2(_0x22fe7a,'VoiceQueueId'))[_0x94c4('0x27')](function(){})[_0x94c4('0x29')](_0x61de39()));}}return _0x98397a;})['all']();})[_0x94c4('0x27')](function(){return db[_0x94c4('0x56')]['findAll']({'attributes':['id',_0x94c4('0x4c')],'include':[{'model':db['CmList'],'as':_0x94c4('0x57'),'where':{'id':LISTID}}]})['then'](function(_0x444a4b){var _0x46f61e=[];if(_0x444a4b){for(var _0x139687=0x0,_0x30b457;_0x139687<_0x444a4b[_0x94c4('0x19')];_0x139687+=0x1){_0x30b457=_0x444a4b[_0x139687][_0x94c4('0x4e')]({'plain':!![]});switch(_0x30b457[_0x94c4('0x4c')]){case _0x94c4('0x4f'):_0x46f61e[_0x94c4('0x28')](db['sequelize']['query'](_0x839f61(_0x30b457,_0x94c4('0x58')))[_0x94c4('0x27')](function(){})['catch'](_0x61de39()));break;case _0x94c4('0x52'):_0x46f61e[_0x94c4('0x28')](db['sequelize']['query'](_0x282188(_0x30b457,_0x94c4('0x58')))[_0x94c4('0x27')](function(){})[_0x94c4('0x29')](_0x61de39()));break;default:_0x46f61e[_0x94c4('0x28')](db[_0x94c4('0x50')]['query'](_0x199f69(_0x30b457,_0x94c4('0x58')))[_0x94c4('0x27')](function(){})[_0x94c4('0x29')](_0x61de39()));}}}return _0x46f61e;})['all']();})[_0x94c4('0x27')](function(){return db[_0x94c4('0x56')]['findAll']({'attributes':['id'],'include':[{'model':db[_0x94c4('0x4d')],'as':_0x94c4('0x59'),'where':{'id':LISTID}}]})['then'](function(_0x4586c8){var _0x2e6c0c=[];if(_0x4586c8){for(var _0x4d95c6=0x0,_0x526409;_0x4d95c6<_0x4586c8[_0x94c4('0x19')];_0x4d95c6+=0x1){_0x526409=_0x4586c8[_0x4d95c6]['get']({'plain':!![]});_0x2e6c0c[_0x94c4('0x28')](db[_0x94c4('0x50')][_0x94c4('0x53')](_0x4719e2(_0x526409,_0x94c4('0x58')))[_0x94c4('0x27')](function(){})[_0x94c4('0x29')](_0x61de39()));}}return _0x2e6c0c;})[_0x94c4('0x54')]();})['catch'](function(_0x19653a){logger['error'](_0x94c4('0x5a'),_0x94c4('0x5b'),_0x19653a[_0x94c4('0x2b')]);});}var processPromises=function(_0x1dbbde){return BPromise[_0x94c4('0x54')](promises)['then'](function(_0xb290fe){})[_0x94c4('0x29')](function(_0x42bc62){logger['error'](_0x94c4('0x5c'),JSON[_0x94c4('0x2c')](_0x42bc62));})['finally'](function(){socket[_0x94c4('0x5d')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x1dbbde){return _0x1dbbde[_0x94c4('0x5e')]();}});};var endCsv=function(){return BPromise[_0x94c4('0x5f')]()[_0x94c4('0x27')](function(){if(hopperContacts){return checkHopper();}})[_0x94c4('0x27')](function(){socket[_0x94c4('0x5d')](_0x94c4('0x60')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x51fb7e){logger[_0x94c4('0x13')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x94c4('0x2c')](_0x51fb7e));}finally{process[_0x94c4('0x61')](0x0);}});};process['on'](_0x94c4('0x62'),function(){logger[_0x94c4('0x63')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x94c4('0x5f')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x94c4('0x10')](',');return db['CmContact'][_0x94c4('0x55')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x94c4('0x27')](function(_0x5b0414){var _0x17dffe=fs[_0x94c4('0x64')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x94c4('0x65')](_0x17dffe,{'header':!![],'skipEmptyLines':!![],'step':function(_0x3b54ab,_0x2eac67){total+=0x1;var _0x51a7da=total;promises[_0x94c4('0x28')](checkRow(_0x3b54ab,_0x5b0414,_0x51a7da)[_0x94c4('0x27')](function(){success+=0x1;})[_0x94c4('0x29')](function(_0x4bea1e){if(_0x4bea1e[_0x94c4('0x13')]){errors+=0x1;delete _0x4bea1e[_0x94c4('0x13')];}else if(_0x4bea1e[_0x94c4('0x24')]){duplicates+=0x1;delete _0x4bea1e[_0x94c4('0x24')];}rows[_0x94c4('0x28')](_0x4bea1e);}));if(total%0xc8===0x0){_0x2eac67[_0x94c4('0x66')]();return processPromises(_0x2eac67);}},'complete':function(){return processPromises()['then'](function(){logger[_0x94c4('0x63')](_0x94c4('0x67'));endCsv();});},'error':function(_0x3dab7f,_0x3232a2){logger[_0x94c4('0x63')](_0x94c4('0x68'),JSON['stringify'](_0x3dab7f));endCsv();}});})[_0x94c4('0x29')](function(_0x1c1db0){logger[_0x94c4('0x13')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x94c4('0x2c')](_0x1c1db0));});}main(); \ No newline at end of file +var _0xa07a=['calleridnum','cm_hopper_final','\x20=\x20?','id\x20IN\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper_black','VoiceQueue','findAll','outbound','CmList','get','dialCheckDuplicateType','always','sequelize','VoiceQueueId','query','all','BlackLists','Campaign','Lists','CampaignId','onlyIfOpen','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','createReadStream','parse','duplicate','pause','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','papaparse','../../../mysqldb','../../../config/environment','redis','defaults','localhost','socket.io-emitter','argv','Missing\x20filepath\x20parameter!','undefined','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','contact','index','test','isNil','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email\x20format\x20is\x20not\x20valid!','find','Duplicate\x20Contact','CmContact','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','checkHopper','insert','into','fromQuery','scheduledAt','ContactId','ListId','updatedAt','select','field','NOW()','toString','createdAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','cm_hopper','str'];(function(_0x4028d3,_0x1c7484){var _0x30337e=function(_0x161214){while(--_0x161214){_0x4028d3['push'](_0x4028d3['shift']());}};_0x30337e(++_0x1c7484);}(_0xa07a,0x103));var _0xaa07=function(_0x558734,_0xf91751){_0x558734=_0x558734-0x0;var _0x3d7732=_0xa07a[_0x558734];return _0x3d7732;};'use strict';var BPromise=require(_0xaa07('0x0'));var util=require(_0xaa07('0x1'));var _=require('lodash');var fs=require('fs');var squel=require('squel');var Papa=require(_0xaa07('0x2'));var Redis=require('ioredis');var db=require(_0xaa07('0x3'))['db'];var config=require(_0xaa07('0x4'));var logger=require('../../../config/logger')('api');config[_0xaa07('0x5')]=_[_0xaa07('0x6')](config[_0xaa07('0x5')],{'host':_0xaa07('0x7'),'port':0x18eb});var socket=require(_0xaa07('0x8'))(new Redis(config[_0xaa07('0x5')]));require('../../../api/cmContact/cmContact.socket')['register'](socket);try{if(!process[_0xaa07('0x9')][0x2]||process['argv'][0x2]==='undefined'||process[_0xaa07('0x9')][0x2]==='null'){throw new Error(_0xaa07('0xa'));}var FILEPATH=process['argv'][0x2];if(!process[_0xaa07('0x9')][0x3]||process['argv'][0x3]===_0xaa07('0xb')||process[_0xaa07('0x9')][0x3]===_0xaa07('0xc')||!process[_0xaa07('0x9')][0x4]||process[_0xaa07('0x9')][0x4]===_0xaa07('0xb')||process[_0xaa07('0x9')][0x4]===_0xaa07('0xc')){throw new Error(_0xaa07('0xd'));}var FIELDS=_[_0xaa07('0xe')](process[_0xaa07('0x9')][0x3]['split'](','),process[_0xaa07('0x9')][0x4][_0xaa07('0xf')](','));if(!process[_0xaa07('0x9')][0x5]||process[_0xaa07('0x9')][0x5]===_0xaa07('0xb')||process[_0xaa07('0x9')][0x5]==='null'){throw new Error(_0xaa07('0x10'));}var LISTID=process[_0xaa07('0x9')][0x5];var COMPANYID=process[_0xaa07('0x9')][0x6]&&process[_0xaa07('0x9')][0x6]!==_0xaa07('0xb')&&process[_0xaa07('0x9')][0x6]!==_0xaa07('0xc')?process[_0xaa07('0x9')][0x6]:null;var DUPLICATES=process[_0xaa07('0x9')][0x7]&&process['argv'][0x7]!=='undefined'&&process[_0xaa07('0x9')][0x7]!==_0xaa07('0xc')?process['argv'][0x7]:null;if(!process[_0xaa07('0x9')][0x8]||process[_0xaa07('0x9')][0x8]===_0xaa07('0xb')||process[_0xaa07('0x9')][0x8]===_0xaa07('0xc')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0xaa07('0x9')][0x8];}catch(_0x56b976){logger['error'](_0x56b976);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(_0x3efc2b,_0x276395,_0x359e74,_0x3eefd4){var _0x4f9614={'message':_0x276395};_0x4f9614[_0x3efc2b]=!![];if(_0x359e74){_0x4f9614[_0xaa07('0x11')]=_0x359e74;}if(_0x3eefd4){_0x4f9614[_0xaa07('0x12')]=_0x3eefd4;}return _0x4f9614;}function isEmail(_0x599633){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))*$/[_0xaa07('0x13')](_0x599633);}function checkRow(_0x48138f,_0x3d8081,_0xe9e724){return new BPromise(function(_0x542ac8,_0x4f67fb){if(_[_0xaa07('0x14')](_0x48138f)){return _0x4f67fb(handleCheckRowError(_0xaa07('0x15'),_0xaa07('0x16'),null,_0xe9e724));}if(_0x48138f['errors']&&_0x48138f[_0xaa07('0x17')][_0xaa07('0x18')]){var _0x21a271=_[_0xaa07('0x19')](_0x48138f[_0xaa07('0x17')],_0xaa07('0x1a'))[_0xaa07('0x1b')](';');return _0x4f67fb(handleCheckRowError('error',_0x21a271,null,_0xe9e724));}var _0x44ec2a={};for(var _0x261421 in FIELDS){if(FIELDS[_0xaa07('0x1c')](_0x261421)&&FIELDS[_0x261421]){_0x44ec2a[_0x261421]=_0x48138f[_0xaa07('0x1d')][0x0][FIELDS[_0x261421]]||_0x48138f[_0xaa07('0x1d')][0x0]['\ufeff'+FIELDS[_0x261421]];}}if(!_0x44ec2a['firstName']){return _0x4f67fb(handleCheckRowError(_0xaa07('0x15'),_0xaa07('0x1e'),null,_0xe9e724));}if(!_0x44ec2a[_0xaa07('0x1f')]){return _0x4f67fb(handleCheckRowError(_0xaa07('0x15'),_0xaa07('0x20'),null,_0xe9e724));}if(_0x44ec2a[_0xaa07('0x21')]){var _0x27c63a=moment(_0x44ec2a[_0xaa07('0x21')],'YYYY-MM-DD');if(!_0x27c63a[_0xaa07('0x22')]()){return _0x4f67fb(handleCheckRowError(_0xaa07('0x15'),_0xaa07('0x23'),null,_0xe9e724));}}if(_0x44ec2a['email']){if(!isEmail(_0x44ec2a['email'])){return _0x4f67fb(handleCheckRowError(_0xaa07('0x15'),_0xaa07('0x24'),null,_0xe9e724));}}_0x44ec2a['ListId']=LISTID;_0x44ec2a['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xaa07('0x18')]&&_0x3d8081){var _0x41f357={};for(var _0x1c6c45=0x0,_0x599b75=DUPLICATES[_0xaa07('0x18')];_0x1c6c45<_0x599b75;_0x1c6c45+=0x1){_0x41f357[DUPLICATES[_0x1c6c45]]=_0x44ec2a[DUPLICATES[_0x1c6c45]];}var _0x1d8b84=_[_0xaa07('0x25')](_0x3d8081,_0x41f357);if(_0x1d8b84){return _0x4f67fb(handleCheckRowError('duplicate',_0xaa07('0x26'),_0x1d8b84,_0xe9e724));}}return db[_0xaa07('0x27')]['create'](_0x44ec2a,{'raw':!![],'hooks':![],'fields':_[_0xaa07('0x28')](_0x44ec2a)})[_0xaa07('0x29')](function(_0x5bd3df){if(DUPLICATES&&DUPLICATES[_0xaa07('0x18')]&&_0x3d8081){_0x3d8081[_0xaa07('0x2a')](_[_0xaa07('0x2b')](_0x44ec2a,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x5bd3df['id'];return _0x542ac8();})[_0xaa07('0x2c')](function(_0x1367c3){return _0x4f67fb(handleCheckRowError(_0xaa07('0x15'),_0xaa07('0x2d')+(_0x1367c3[_0xaa07('0x1a')]||JSON[_0xaa07('0x2e')](_0x1367c3)),null,_0xe9e724));});});}function checkHopper(){function _0x2fc500(){return function(_0x4de720){logger[_0xaa07('0x15')]('cmContact',_0xaa07('0x2f'),util['inspect'](_0x4de720,{'showHidden':![],'depth':null}));};}var _0x503c21=function(_0x560c56,_0x487954){var _0x453b92=squel[_0xaa07('0x30')]()[_0xaa07('0x31')]('cm_hopper')[_0xaa07('0x32')]([_0xaa07('0x1f'),_0xaa07('0x33'),_0xaa07('0x34'),_0xaa07('0x35'),_0x487954,'createdAt',_0xaa07('0x36')],squel[_0xaa07('0x37')]()[_0xaa07('0x38')](_0xaa07('0x1f'),_0xaa07('0x1f'))[_0xaa07('0x38')](_0xaa07('0x39'),_0xaa07('0x33'))['field']('id','ContactId')[_0xaa07('0x38')](LISTID['toString'](),_0xaa07('0x35'))[_0xaa07('0x38')](_0x560c56['id'][_0xaa07('0x3a')](),_0x487954)[_0xaa07('0x38')]('NOW()',_0xaa07('0x3b'))[_0xaa07('0x38')](_0xaa07('0x39'),'updatedAt')[_0xaa07('0x3c')](_0xaa07('0x3d'))[_0xaa07('0x3e')](_0xaa07('0x3f'))[_0xaa07('0x3e')](_0xaa07('0x40'),LISTID['toString']())['where']('phone\x20IS\x20NOT\x20NULL')['where'](_0xaa07('0x41'),squel[_0xaa07('0x37')]()['field'](_0xaa07('0x1f'))[_0xaa07('0x3c')](_0xaa07('0x42'))[_0xaa07('0x3e')](_0x487954+'\x20=\x20?',_0x560c56['id']['toString']())))[_0xaa07('0x3a')]();return _0x453b92;};var _0x413ea8=function(_0x161004,_0x341a76){var _0x11e35d=squel[_0xaa07('0x30')]()['into'](_0xaa07('0x42'))['fromQuery'](['phone',_0xaa07('0x33'),_0xaa07('0x34'),_0xaa07('0x35'),_0x341a76,_0xaa07('0x3b'),_0xaa07('0x36')],squel[_0xaa07('0x37')]()['field'](_0xaa07('0x1f'),'phone')[_0xaa07('0x38')](_0xaa07('0x39'),_0xaa07('0x33'))[_0xaa07('0x38')]('id','ContactId')[_0xaa07('0x38')](LISTID[_0xaa07('0x3a')](),'ListId')[_0xaa07('0x38')](_0x161004['id'][_0xaa07('0x3a')](),_0x341a76)['field'](_0xaa07('0x39'),_0xaa07('0x3b'))[_0xaa07('0x38')]('NOW()',_0xaa07('0x36'))[_0xaa07('0x3c')](_0xaa07('0x3d'))[_0xaa07('0x3e')](_0xaa07('0x3f'))['where'](_0xaa07('0x40'),LISTID['toString']())['where']('id\x20IN\x20?',squel[_0xaa07('0x43')](hopperContacts))[_0xaa07('0x3e')]('phone\x20IS\x20NOT\x20NULL')[_0xaa07('0x3e')](_0xaa07('0x41'),squel[_0xaa07('0x37')]()[_0xaa07('0x38')](_0xaa07('0x44'))[_0xaa07('0x3c')](_0xaa07('0x45'))['where'](_0x341a76+_0xaa07('0x46'),_0x161004['id'][_0xaa07('0x3a')]()))['where'](_0xaa07('0x41'),squel['select']()[_0xaa07('0x38')]('phone')[_0xaa07('0x3c')](_0xaa07('0x42'))['where'](_0x341a76+'\x20=\x20?',_0x161004['id']['toString']())))[_0xaa07('0x3a')]();return _0x11e35d;};function _0x101a1f(_0x27918b,_0x43af75){var _0x15e98a=squel[_0xaa07('0x30')]()[_0xaa07('0x31')](_0xaa07('0x42'))[_0xaa07('0x32')]([_0xaa07('0x1f'),'scheduledAt',_0xaa07('0x34'),_0xaa07('0x35'),_0x43af75,_0xaa07('0x3b'),_0xaa07('0x36')],squel[_0xaa07('0x37')]()[_0xaa07('0x38')](_0xaa07('0x1f'),_0xaa07('0x1f'))['field'](_0xaa07('0x39'),_0xaa07('0x33'))[_0xaa07('0x38')]('id','ContactId')[_0xaa07('0x38')](LISTID['toString'](),_0xaa07('0x35'))[_0xaa07('0x38')](_0x27918b['id'][_0xaa07('0x3a')](),_0x43af75)[_0xaa07('0x38')](_0xaa07('0x39'),'createdAt')[_0xaa07('0x38')](_0xaa07('0x39'),_0xaa07('0x36'))[_0xaa07('0x3c')](_0xaa07('0x3d'))[_0xaa07('0x3e')](_0xaa07('0x3f'))['where'](_0xaa07('0x40'),LISTID[_0xaa07('0x3a')]())[_0xaa07('0x3e')](_0xaa07('0x47'),squel[_0xaa07('0x43')](hopperContacts))['where'](_0xaa07('0x48')))[_0xaa07('0x3a')]();return _0x15e98a;}function _0x4dae6e(_0x250927,_0x3dc5c7){var _0x38eadb=squel[_0xaa07('0x30')]()[_0xaa07('0x31')](_0xaa07('0x49'))[_0xaa07('0x32')]([_0xaa07('0x1f'),'ContactId',_0xaa07('0x35'),_0x3dc5c7,_0xaa07('0x3b'),_0xaa07('0x36')],squel[_0xaa07('0x37')]()[_0xaa07('0x38')](_0xaa07('0x1f'),_0xaa07('0x1f'))[_0xaa07('0x38')]('id',_0xaa07('0x34'))[_0xaa07('0x38')](LISTID['toString'](),_0xaa07('0x35'))[_0xaa07('0x38')](_0x250927['id'][_0xaa07('0x3a')](),_0x3dc5c7)['field']('NOW()','createdAt')['field']('NOW()',_0xaa07('0x36'))[_0xaa07('0x3c')](_0xaa07('0x3d'))[_0xaa07('0x3e')](_0xaa07('0x3f'))[_0xaa07('0x3e')](_0xaa07('0x40'),LISTID[_0xaa07('0x3a')]())[_0xaa07('0x3e')](_0xaa07('0x47'),squel[_0xaa07('0x43')](hopperContacts))[_0xaa07('0x3e')](_0xaa07('0x48')))['toString']();return _0x38eadb;}return db[_0xaa07('0x4a')][_0xaa07('0x4b')]({'where':{'type':_0xaa07('0x4c')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0xaa07('0x4d')],'as':'Lists','where':{'id':LISTID}}]})[_0xaa07('0x29')](function(_0xaaffb5){var _0x30439e=[];if(_0xaaffb5){var _0xee4124;for(var _0x33eb78=0x0,_0x19e602;_0x33eb78<_0xaaffb5[_0xaa07('0x18')];_0x33eb78+=0x1){_0x19e602=_0xaaffb5[_0x33eb78][_0xaa07('0x4e')]({'plain':!![]});switch(_0x19e602[_0xaa07('0x4f')]){case _0xaa07('0x50'):_0x30439e[_0xaa07('0x2a')](db[_0xaa07('0x51')]['query'](_0x413ea8(_0x19e602,_0xaa07('0x52')))[_0xaa07('0x29')](function(){})[_0xaa07('0x2c')](_0x2fc500()));break;case'onlyIfOpen':_0x30439e[_0xaa07('0x2a')](db[_0xaa07('0x51')]['query'](_0x503c21(_0x19e602,'VoiceQueueId'))[_0xaa07('0x29')](function(){})[_0xaa07('0x2c')](_0x2fc500()));break;default:_0x30439e[_0xaa07('0x2a')](db['sequelize'][_0xaa07('0x53')](_0x101a1f(_0x19e602,'VoiceQueueId'))[_0xaa07('0x29')](function(){})['catch'](_0x2fc500()));}}}return _0x30439e;})[_0xaa07('0x54')]()['then'](function(){return db[_0xaa07('0x4a')]['findAll']({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0xaa07('0x4d')],'as':_0xaa07('0x55'),'where':{'id':LISTID}}]})[_0xaa07('0x29')](function(_0x99865b){var _0xb2c72c=[];if(_0x99865b){var _0x7482a1;for(var _0x286089=0x0,_0x572b72;_0x286089<_0x99865b[_0xaa07('0x18')];_0x286089+=0x1){_0x572b72=_0x99865b[_0x286089][_0xaa07('0x4e')]({'plain':!![]});_0xb2c72c[_0xaa07('0x2a')](db['sequelize'][_0xaa07('0x53')](_0x4dae6e(_0x572b72,_0xaa07('0x52')))[_0xaa07('0x29')](function(){})[_0xaa07('0x2c')](_0x2fc500()));}}return _0xb2c72c;})[_0xaa07('0x54')]();})[_0xaa07('0x29')](function(){return db[_0xaa07('0x56')][_0xaa07('0x4b')]({'attributes':['id',_0xaa07('0x4f')],'include':[{'model':db['CmList'],'as':_0xaa07('0x57'),'where':{'id':LISTID}}]})[_0xaa07('0x29')](function(_0x5c2971){var _0x176640=[];if(_0x5c2971){for(var _0x41fba1=0x0,_0x32aaba;_0x41fba1<_0x5c2971[_0xaa07('0x18')];_0x41fba1+=0x1){_0x32aaba=_0x5c2971[_0x41fba1][_0xaa07('0x4e')]({'plain':!![]});switch(_0x32aaba[_0xaa07('0x4f')]){case _0xaa07('0x50'):_0x176640[_0xaa07('0x2a')](db[_0xaa07('0x51')]['query'](_0x413ea8(_0x32aaba,_0xaa07('0x58')))[_0xaa07('0x29')](function(){})[_0xaa07('0x2c')](_0x2fc500()));break;case _0xaa07('0x59'):_0x176640[_0xaa07('0x2a')](db[_0xaa07('0x51')][_0xaa07('0x53')](_0x503c21(_0x32aaba,_0xaa07('0x58')))['then'](function(){})['catch'](_0x2fc500()));break;default:_0x176640['push'](db['sequelize']['query'](_0x101a1f(_0x32aaba,_0xaa07('0x58')))[_0xaa07('0x29')](function(){})[_0xaa07('0x2c')](_0x2fc500()));}}}return _0x176640;})[_0xaa07('0x54')]();})[_0xaa07('0x29')](function(){return db['Campaign'][_0xaa07('0x4b')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0xaa07('0x55'),'where':{'id':LISTID}}]})['then'](function(_0x260d01){var _0x4d6067=[];if(_0x260d01){for(var _0x609eeb=0x0,_0x18acf5;_0x609eeb<_0x260d01[_0xaa07('0x18')];_0x609eeb+=0x1){_0x18acf5=_0x260d01[_0x609eeb][_0xaa07('0x4e')]({'plain':!![]});_0x4d6067[_0xaa07('0x2a')](db['sequelize'][_0xaa07('0x53')](_0x4dae6e(_0x18acf5,_0xaa07('0x58')))[_0xaa07('0x29')](function(){})[_0xaa07('0x2c')](_0x2fc500()));}}return _0x4d6067;})[_0xaa07('0x54')]();})[_0xaa07('0x2c')](function(_0x2b2de4){logger[_0xaa07('0x15')](_0xaa07('0x5a'),_0xaa07('0x5b'),_0x2b2de4[_0xaa07('0x1a')]);});}var processPromises=function(_0x406849){return BPromise[_0xaa07('0x54')](promises)[_0xaa07('0x29')](function(_0x806ac7){})[_0xaa07('0x2c')](function(_0x1669cc){logger[_0xaa07('0x15')](_0xaa07('0x5c'),JSON[_0xaa07('0x2e')](_0x1669cc));})[_0xaa07('0x5d')](function(){socket[_0xaa07('0x5e')](_0xaa07('0x5f')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x406849){return _0x406849[_0xaa07('0x60')]();}});};var endCsv=function(){return BPromise[_0xaa07('0x61')]()[_0xaa07('0x29')](function(){if(hopperContacts){return checkHopper();}})[_0xaa07('0x29')](function(){socket[_0xaa07('0x5e')](_0xaa07('0x5f')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xaa07('0x62')](FILEPATH);}catch(_0x357085){logger[_0xaa07('0x15')](_0xaa07('0x63'),JSON[_0xaa07('0x2e')](_0x357085));}finally{process[_0xaa07('0x64')](0x0);}});};process['on'](_0xaa07('0x65'),function(){logger[_0xaa07('0x66')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0xaa07('0x61')]()[_0xaa07('0x29')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xaa07('0xf')](',');return db[_0xaa07('0x27')][_0xaa07('0x4b')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xaa07('0x29')](function(_0x4ebf9f){var _0x25658d=fs[_0xaa07('0x67')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xaa07('0x68')](_0x25658d,{'header':!![],'skipEmptyLines':!![],'step':function(_0x524659,_0x41c38a){total+=0x1;var _0x458cd9=total;promises[_0xaa07('0x2a')](checkRow(_0x524659,_0x4ebf9f,_0x458cd9)[_0xaa07('0x29')](function(){success+=0x1;})['catch'](function(_0xb47bcb){if(_0xb47bcb[_0xaa07('0x15')]){errors+=0x1;delete _0xb47bcb[_0xaa07('0x15')];}else if(_0xb47bcb[_0xaa07('0x69')]){duplicates+=0x1;delete _0xb47bcb[_0xaa07('0x69')];}rows[_0xaa07('0x2a')](_0xb47bcb);}));if(total%0xc8===0x0){_0x41c38a[_0xaa07('0x6a')]();return processPromises(_0x41c38a);}},'complete':function(){return processPromises()['then'](function(){logger[_0xaa07('0x66')](_0xaa07('0x6b'));endCsv();});},'error':function(_0x536bd6,_0x458be7){logger[_0xaa07('0x66')]('CSV\x20parse\x20error',JSON[_0xaa07('0x2e')](_0x536bd6));endCsv();}});})[_0xaa07('0x2c')](function(_0x385dae){logger[_0xaa07('0x15')](_0xaa07('0x6c'),JSON[_0xaa07('0x2e')](_0x385dae));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 4fb4734..7b8dc22 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 _0x7721=['cm_hopper.id','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId','scheduledAt',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','message','exit','sequelize','query','spread','catch','error','campaigns.id','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','timezones','dialTimezone','utcOffset','set','main','stringify','send','start','binding','clone','socket_timestamp','root','.csv','includes','ContactItemType','name','_description','header','writeFileSync','parse','createReadStream','data','rows','errors','find','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','agent\x20not\x20exists','email','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified','itemTypeId','description','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','SystemError','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','dialTimezone,utcOffset','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','contactId','contactTypeId','orderBy','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','finish','affectedRows','unlink','argv','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','map','SIGINT','lodash','papaparse','util','bluebird','moment','ioredis','../../../config/environment','../../../config/environment/shared','import','defaults','redis','localhost','YYYY-MM-DD\x20HH:mm:ss','format','test','select','field','phone','from','join','where','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','then','length','push','all','AdditionalPhones','split','isNil','filter','findOne','CmContactHasItem','update','updated','create','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','cm_contacts.phone','cm_contacts.ListId','cm_hopper_black','.CmListId','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','recallme','ListId\x20=\x20?','\x20=\x20'];(function(_0x37aed4,_0x254b7d){var _0x1ec4f3=function(_0x2fcefc){while(--_0x2fcefc){_0x37aed4['push'](_0x37aed4['shift']());}};_0x1ec4f3(++_0x254b7d);}(_0x7721,0x12f));var _0x1772=function(_0x145233,_0x574579){_0x145233=_0x145233-0x0;var _0x56df5d=_0x7721[_0x145233];return _0x56df5d;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x1772('0x0'));var Papa=require(_0x1772('0x1'));var util=require(_0x1772('0x2'));var BPromise=require(_0x1772('0x3'));var moment=require(_0x1772('0x4'));var squel=require('squel');var Redis=require(_0x1772('0x5'));var db=require('../../../mysqldb')['db'];var config=require(_0x1772('0x6'));var shared=require(_0x1772('0x7'));var logger=require('../../../config/logger')(_0x1772('0x8'));config['redis']=_[_0x1772('0x9')](config[_0x1772('0xa')],{'host':_0x1772('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1772('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()['format'](_0x1772('0xc'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x1772('0xd')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x123c0d){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))*$/[_0x1772('0xe')](_0x123c0d);}function selectNotIn(_0x5d12c5,_0x34eacd,_0xdeefa9,_0x403f5b,_0x1a6a09){return squel[_0x1772('0xf')]()[_0x1772('0x10')](_0x1772('0x11'))[_0x1772('0x12')](_0x403f5b)[_0x1772('0x13')](_0x34eacd,null,_0x34eacd+'.id\x20=\x20'+_0x403f5b+'.'+_0xdeefa9)[_0x1772('0x14')](_0x403f5b+'.'+_0xdeefa9+'\x20=\x20'+_0x5d12c5+'.'+_0xdeefa9)[_0x1772('0x14')](_0x34eacd+_0x1772('0x15')+_0x1a6a09['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x59d712,_0x282b98){promisesAdditionalPhones=[];return db[_0x1772('0x16')][_0x1772('0x17')]({'raw':!![],'attributes':['id','AdditionalPhones'],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x1772('0x18')](function(_0x506721){if(_0x506721!==null){var _0x322a10=[];for(var _0x1e118d=0x0;_0x1e118d<_0x506721[_0x1772('0x19')];_0x1e118d++){var _0x4620c6=_0x506721[_0x1e118d];_0x322a10[_0x1772('0x1a')](insertAdditionalPhones(_0x4620c6));}}Promise[_0x1772('0x1b')](_0x322a10)[_0x1772('0x18')](function(){_0x59d712({'val':0x1});});});});}function insertAdditionalPhones(_0x4c3ca2){return new Promise(function(_0x322fd2,_0x20114a){var _0x59a829=_0x4c3ca2[_0x1772('0x1c')];var _0x1b5f17=_0x59a829[_0x1772('0x1d')](';');var _0x116b1b=[];orderBy=0x0;for(var _0x43ffb0=0x0;_0x43ffb0<_0x1b5f17[_0x1772('0x19')];_0x43ffb0++){_0x116b1b[_0x1772('0x1a')](splitAdditionalPhone(_0x4c3ca2['id'],_0x1b5f17[_0x43ffb0]));}Promise[_0x1772('0x1b')](_0x116b1b)[_0x1772('0x18')](function(){_0x322fd2({'val':_0x1b5f17[_0x1772('0x19')]});});});}function splitAdditionalPhone(_0x2cbf7b,_0xc3e098){return new Promise(function(_0x3a578a,_0x1ee345){var _0x281a42=_0xc3e098['split'](':');var _0x3223a0=_0x281a42[0x0];var _0x3b2064=_0x281a42[0x1];if(!_[_0x1772('0x1e')](_0x3b2064)){var _0xb2c7aa=_0x3b2064['split']('|');var _0x251c5b=[];for(var _0xf44112=0x0;_0xf44112<_0xb2c7aa['length'];_0xf44112++){if(_0xb2c7aa[_0xf44112]!==''){var _0x3ed41d=_[_0x1772('0x1f')](promisesAdditionalPhones,{'contactId':_0x2cbf7b,'phone':_0xb2c7aa[_0xf44112]});if(_0x3ed41d['length']==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x2cbf7b,'contactTypeId':_0x3223a0,'phone':_0xb2c7aa[_0xf44112],'orderBy':orderBy});}}}_0x3a578a({'ok':0x1});}else _0x3a578a({'res':0x0});});}function createAdditionalPhone(_0x38113e,_0x5f1dc9,_0x4899d3,_0xb1831a){var _0x54d4f6='';var _0x30cb2a='';var _0x1f081f=_0x4899d3['split']('§');_0x54d4f6=_0x1f081f[0x0];if(_0x1f081f[_0x1772('0x19')]==0x2)_0x30cb2a=_0x1f081f[0x1];return new Promise(function(_0x3452fd,_0x2fbbdb){return db['CmContactHasItem'][_0x1772('0x20')]({'where':{'CmContactId':_0x38113e,'item':_0x54d4f6}})['then'](function(_0xfc6e23){if(_0xfc6e23){return db[_0x1772('0x21')][_0x1772('0x22')]({'ItemTypeId':_0x5f1dc9,'description':_0x30cb2a,'OrderBy':_0xb1831a},{'where':{'CmContactId':_0x38113e,'item':_0x54d4f6}})[_0x1772('0x18')](function(_0x2efd56){_0x3452fd({'res':_0x1772('0x23')});});}else{return db[_0x1772('0x21')][_0x1772('0x24')]({'CmContactId':_0x38113e,'item':_0x54d4f6,'description':_0x30cb2a,'ItemTypeId':_0x5f1dc9,'OrderBy':_0xb1831a,'ItemClass':'PHONE'})[_0x1772('0x18')](function(_0x3f9803){_0x3452fd({'res':'inserted'});});}});});}function insertCmHopper(_0x38ca86,_0x303ec7,_0x592e9a,_0x5ce0f2,_0x2758db){var _0x261467=['cm_contacts.phone',_0x1772('0x25'),_0x1772('0x26'),'cm_contacts.ListId',_0x303ec7+'.'+_0x5ce0f2,_0x1772('0x27'),_0x1772('0x28'),_0x1772('0x29'),_0x1772('0x2a'),'\x22'+_0x2758db+'\x22'];return squel[_0x1772('0x2b')]()[_0x1772('0x2c')](_0x1772('0x2d'))[_0x1772('0x2e')]([_0x1772('0x11'),_0x1772('0x2f'),_0x1772('0x30'),_0x1772('0x31'),_0x5ce0f2,_0x1772('0x32'),_0x1772('0x33'),_0x1772('0x34'),_0x1772('0x35'),'recallme'],squel[_0x1772('0xf')]()[_0x1772('0x36')](_0x261467)[_0x1772('0x12')](_0x303ec7)[_0x1772('0x13')](_0x1772('0x37'),null,_0x1772('0x38')+_0x303ec7+'.CmListId')[_0x1772('0x13')](_0x592e9a,null,_0x592e9a+_0x1772('0x39')+_0x303ec7+'.'+_0x5ce0f2)[_0x1772('0x14')](_0x303ec7+_0x1772('0x3a'),_0x38ca86)[_0x1772('0x14')](_0x1772('0x3b'),NOW)[_0x1772('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x303ec7,_0x592e9a,_0x5ce0f2,_0x1772('0x2d'),[_0x1772('0x3c'),_0x1772('0x3d')]))['where'](_0x1772('0x3e'),selectNotIn(_0x303ec7,_0x592e9a,_0x5ce0f2,'cm_hopper',['\x22always\x22'])))[_0x1772('0x3f')]();}function insertCmHopperBlack(_0xc9f0e9,_0xb90c09,_0x378f2a,_0x1581c7){var _0x301cbf=[_0x1772('0x40'),_0x1772('0x26'),_0x1772('0x41'),_0xb90c09+'.'+_0x1581c7,_0x1772('0x27'),'cm_contacts.updatedAt'];return squel['insert']()['into'](_0x1772('0x42'))[_0x1772('0x2e')](['phone',_0x1772('0x30'),'ListId',_0x1581c7,'createdAt',_0x1772('0x33')],squel['select']()['fields'](_0x301cbf)['from'](_0xb90c09)[_0x1772('0x13')](_0x1772('0x37'),null,'cm_contacts.ListId\x20=\x20'+_0xb90c09+_0x1772('0x43'))[_0x1772('0x13')](_0x378f2a,null,_0x378f2a+_0x1772('0x39')+_0xb90c09+'.'+_0x1581c7)[_0x1772('0x14')](_0xb90c09+_0x1772('0x3a'),_0xc9f0e9)[_0x1772('0x14')](_0x1772('0x3b'),NOW)[_0x1772('0x14')](_0x1772('0x3e'),squel[_0x1772('0xf')]()[_0x1772('0x10')](_0x1772('0x11'))[_0x1772('0x12')](_0x1772('0x42'))['where']('ListId\x20=\x20?',_0xc9f0e9)['where'](_0x1581c7+'\x20=\x20'+_0xb90c09+'.'+_0x1581c7)))[_0x1772('0x3f')]();}function insertTzCmHopper(_0x3a7b35,_0x2ca6cb,_0x3f64e7,_0x47dcc6,_0x2276a0,_0x36b4fd){var _0x23b8a3=['cm_contacts.phone',_0x1772('0x44')+_0x36b4fd+_0x1772('0x45'),_0x1772('0x26'),'cm_contacts.ListId',_0x2ca6cb+'.'+_0x47dcc6,_0x1772('0x27'),_0x1772('0x28'),'cm_contacts.priority',_0x1772('0x2a'),'\x22'+_0x2276a0+'\x22'];var _0x5c37d6=squel[_0x1772('0x2b')]()[_0x1772('0x2c')](_0x1772('0x2d'))[_0x1772('0x2e')]([_0x1772('0x11'),_0x1772('0x2f'),_0x1772('0x30'),_0x1772('0x31'),_0x47dcc6,_0x1772('0x32'),_0x1772('0x33'),_0x1772('0x34'),_0x1772('0x35'),_0x1772('0x46')],squel[_0x1772('0xf')]()['fields'](_0x23b8a3)[_0x1772('0x12')](_0x2ca6cb)[_0x1772('0x13')](_0x1772('0x37'),null,'cm_contacts.ListId\x20=\x20'+_0x2ca6cb+_0x1772('0x43'))['join'](_0x3f64e7,null,_0x3f64e7+_0x1772('0x39')+_0x2ca6cb+'.'+_0x47dcc6)[_0x1772('0x13')](_0x36b4fd,null,_0x36b4fd+_0x1772('0x39')+_0x2ca6cb+'.'+_0x47dcc6)[_0x1772('0x14')](_0x2ca6cb+_0x1772('0x3a'),_0x3a7b35)[_0x1772('0x14')](_0x1772('0x3b'),NOW)['where'](_0x1772('0x3e'),selectNotIn(_0x2ca6cb,_0x3f64e7,_0x47dcc6,_0x1772('0x2d'),['\x22always\x22',_0x1772('0x3d')]))[_0x1772('0x14')](_0x1772('0x3e'),selectNotIn(_0x2ca6cb,_0x3f64e7,_0x47dcc6,_0x1772('0x2d'),['\x22always\x22'])))[_0x1772('0x3f')]();return _0x5c37d6;}function insertTzCmHopperBlack(_0x183a64,_0x42b46e,_0x3e4970,_0x466dca){var _0x5ecf77=[_0x1772('0x40'),_0x1772('0x26'),'cm_contacts.ListId',_0x42b46e+'.'+_0x466dca,_0x1772('0x27'),'cm_contacts.updatedAt'];return squel[_0x1772('0x2b')]()['into'](_0x1772('0x42'))['fromQuery']([_0x1772('0x11'),'ContactId',_0x1772('0x31'),_0x466dca,'createdAt',_0x1772('0x33')],squel['select']()[_0x1772('0x36')](_0x5ecf77)[_0x1772('0x12')](_0x42b46e)['join'](_0x1772('0x37'),null,_0x1772('0x38')+_0x42b46e+_0x1772('0x43'))[_0x1772('0x13')](_0x3e4970,null,_0x3e4970+_0x1772('0x39')+_0x42b46e+'.'+_0x466dca)[_0x1772('0x14')](_0x42b46e+_0x1772('0x3a'),_0x183a64)[_0x1772('0x14')](_0x1772('0x3b'),NOW)[_0x1772('0x14')](_0x1772('0x3e'),squel[_0x1772('0xf')]()[_0x1772('0x10')](_0x1772('0x11'))[_0x1772('0x12')]('cm_hopper_black')[_0x1772('0x14')](_0x1772('0x47'),_0x183a64)['where'](_0x466dca+_0x1772('0x48')+_0x42b46e+'.'+_0x466dca)))[_0x1772('0x3f')]();}function insertCmHopperAdditionalPhones(_0x5c8ff1){var _0x339dcc=[_0x1772('0x49'),'cm_contact_has_items.item',_0x1772('0x4a'),_0x1772('0x4b'),'cm_contact_has_items.updatedAt'];return squel['insert']()['into'](_0x1772('0x4c'))[_0x1772('0x2e')]([_0x1772('0x4d'),_0x1772('0x11'),_0x1772('0x4e'),'createdAt',_0x1772('0x33')],squel[_0x1772('0xf')]()[_0x1772('0x36')](_0x339dcc)[_0x1772('0x12')](_0x1772('0x2d'))[_0x1772('0x13')](_0x1772('0x37'),null,_0x1772('0x4f'))[_0x1772('0x13')](_0x1772('0x50'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')['where'](_0x1772('0x51'),_0x5c8ff1)[_0x1772('0x14')](_0x1772('0x3b'),NOW))[_0x1772('0x3f')]();}function insertCmContact(_0x17035b,_0x389ebc,_0x5a278c,_0x52f0c2){var _0x11aba0=_[_0x1772('0x52')](_[_0x1772('0x53')](_0x52f0c2),[_0x1772('0x31'),_0x1772('0x54'),_0x1772('0x32'),_0x1772('0x33'),_0x1772('0x55')]);return squel[_0x1772('0x2b')]()[_0x1772('0x2c')](_0x1772('0x37'))[_0x1772('0x2e')](_0x11aba0,squel[_0x1772('0xf')]()[_0x1772('0x36')](_0x11aba0)['from'](_0x389ebc)[_0x1772('0x14')]('('+_0x5a278c['join'](',')+_0x1772('0x56'),squel['select']()[_0x1772('0x36')](_0x5a278c)[_0x1772('0x12')]('cm_contacts')['where'](_0x1772('0x47'),_0x17035b)[_0x1772('0x14')](_0x1772('0x57')))[_0x1772('0x14')](_0x1772('0x58'),squel[_0x1772('0xf')]()['field'](_0x1772('0x59'),_0x1772('0x5a'))[_0x1772('0x12')](_0x389ebc)[_0x1772('0x5b')](_0x5a278c[_0x1772('0x13')](','))))[_0x1772('0x3f')]();}function handleStop(){logger[_0x1772('0x5c')](_0x1772('0x5d'));stopped=!![];}function handleUncaughtException(_0x16611a){logger['error'](_0x16611a[_0x1772('0x5e')]);process[_0x1772('0x5f')](0x1);}function handleError(_0x389289,_0x222a23){stats['errors'][_0x1772('0x1a')]({'name':_0x222a23['code'],'message':_0x222a23[_0x1772('0x5e')],'row':_0x389289});}function handleQuery(_0x501a86){logger[_0x1772('0x5c')](_0x501a86);return db[_0x1772('0x60')][_0x1772('0x61')](_0x501a86)[_0x1772('0x62')](function(_0x350374){results[_0x1772('0x1a')](_0x350374);})[_0x1772('0x63')](function(_0x4bd549){logger[_0x1772('0x64')](_0x4bd549['message']);});}function updateTzCampaigns(_0xbd0ef){return new Promise(function(_0x3eaee4,_0x5c369c){var _0x322169=squel[_0x1772('0xf')]()['fields']([_0x1772('0x65'),_0x1772('0x66')])[_0x1772('0x12')](_0x1772('0x67'))[_0x1772('0x13')](_0x1772('0x68'),null,_0x1772('0x69'))['where'](_0x1772('0x6a')+_0xbd0ef);db[_0x1772('0x60')][_0x1772('0x61')](_0x322169[_0x1772('0x3f')]())[_0x1772('0x62')](function(_0x58cfc8){var _0x37b1ae=[];for(var _0xd8d479=0x0;_0xd8d479<_0x58cfc8['length'];_0xd8d479++){_0x37b1ae[_0x1772('0x1a')](getTimezoneData(_0x58cfc8[_0xd8d479],tmp_campaigns));}BPromise[_0x1772('0x1b')](_0x37b1ae)['then'](function(){_0x3eaee4({'val':0x1});});})[_0x1772('0x63')](function(_0x3acc51){logger['error'](_0x3acc51['message']);_0x3eaee4({'val':0x0});});});}function updateTzVoiceQueues(_0x18267d){return new Promise(function(_0x5aa34a,_0x24c24f){var _0x301d0e=squel[_0x1772('0xf')]()[_0x1772('0x36')]([_0x1772('0x6b'),_0x1772('0x6c')])[_0x1772('0x12')](_0x1772('0x6d'))[_0x1772('0x13')]('voice_queues_has_cm_lists',null,_0x1772('0x6e'))[_0x1772('0x14')](_0x1772('0x6f')+_0x18267d);db[_0x1772('0x60')]['query'](_0x301d0e['toString']())[_0x1772('0x62')](function(_0x2633b1){var _0x2e3b48=[];for(var _0x825164=0x0;_0x825164<_0x2633b1[_0x1772('0x19')];_0x825164++){_0x2e3b48['push'](getTimezoneData(_0x2633b1[_0x825164],tmp_voice_queues));}BPromise[_0x1772('0x1b')](_0x2e3b48)[_0x1772('0x18')](function(){_0x5aa34a({'val':0x1});});})[_0x1772('0x63')](function(_0x1770c8){logger['error'](_0x1770c8[_0x1772('0x5e')]);_0x5aa34a({'val':0x0});});});}function getTimezoneData(_0x438ed4,_0x17da53){return new Promise(function(_0x5cd485,_0x2e13ac){var _0x594ec9=shared[_0x1772('0x70')];var _0x1f93c7=_0x594ec9[_0x438ed4[_0x1772('0x71')]];if(_[_0x1772('0x1e')](_0x1f93c7)){_0x5cd485({'ret':0x1});}else{var _0x4e99ef=_0x1f93c7[_0x1772('0x72')];var _0x155cdd=squel[_0x1772('0x2b')]()['into'](_0x17da53)[_0x1772('0x73')]('id',_0x438ed4['id'])[_0x1772('0x73')]('offset',_0x4e99ef)[_0x1772('0x73')](_0x1772('0x71'),_0x438ed4[_0x1772('0x71')])[_0x1772('0x3f')]();return db[_0x1772('0x60')]['query'](_0x155cdd)['spread'](function(_0x5a0daa){_0x5cd485({'ret':0x1});})['catch'](function(_0x2e7ea8){logger['error'](_0x2e7ea8[_0x1772('0x5e')]);_0x2e13ac({'ret':0x1});});}});}function handleTZQuery(_0x1c72b3){logger[_0x1772('0x5c')](_0x1c72b3);return db[_0x1772('0x60')]['query'](_0x1c72b3)[_0x1772('0x62')](function(_0x12f06f){})[_0x1772('0x63')](function(_0x598153){logger['error'](_0x598153[_0x1772('0x5e')]);});}function main(_0x397226,_0x3b1fa8,_0x560877,_0x269cb2){logger[_0x1772('0x5c')](_0x1772('0x74'),_0x397226,JSON[_0x1772('0x75')](_0x3b1fa8));process[_0x1772('0x76')](_0x1772('0x77'));var _0x2b484b=_0x3b1fa8[_0x1772('0x78')];var _0x3ce646=_[_0x1772('0x79')](_0x2b484b);var _0x8c6f9f=_0x3b1fa8[_0x1772('0x7a')];var _0x9825ab=path[_0x1772('0x13')](config[_0x1772('0x7b')],'server/files/tmp',_0x8c6f9f+_0x1772('0x7c'));hasTZ=_[_0x1772('0x53')](_0x2b484b)[_0x1772('0x7d')]('dialTimezone');var _0x25332c=_[_0x1772('0x53')](_0x2b484b)['join']();logger[_0x1772('0x5c')]('header',_0x25332c);db[_0x1772('0x7e')][_0x1772('0x17')]({'raw':!![],'attributes':['id',_0x1772('0x7f')]})[_0x1772('0x18')](function(_0x8fcffb){for(var _0x182ebf=0x0;_0x182ebf<_0x8fcffb[_0x1772('0x19')];_0x182ebf++){if(_0x8fcffb[_0x182ebf][_0x1772('0x7f')]in _0x2b484b){contactItemTypes[_0x1772('0x1a')](_0x8fcffb[_0x182ebf]);delete _0x3ce646[_0x8fcffb[_0x182ebf]['name']];hasAdditionalPhones=!![];}for(var _0xb25a38 in _0x2b484b){if(_0x8fcffb[_0x182ebf][_0x1772('0x7f')]+_0x1772('0x80')===_0xb25a38){phoneDescriptions[_0x1772('0x1a')]({'itemTypeId':_0x8fcffb[_0x182ebf]['id'],'description':_0xb25a38});delete _0x3ce646[_0xb25a38];}}}if(hasAdditionalPhones)_0x3ce646[_0x1772('0x1c')]='';var _0x189554=_[_0x1772('0x53')](_0x3ce646)['join']();logger[_0x1772('0x5c')](_0x1772('0x81'),_0x189554);fs[_0x1772('0x82')](_0x9825ab,_0x189554+'\x0a');Papa[_0x1772('0x83')](fs[_0x1772('0x84')](_0x397226),{'header':!![],'skipEmptyLines':!![],'step':function(_0x4efe39,_0x5e6eb2){try{for(var _0x4b5d05=0x0,_0x2db92b=[];_0x4b5d05<_0x4efe39[_0x1772('0x85')][_0x1772('0x19')];_0x4b5d05++){stats[_0x1772('0x86')]+=0x1;if(_0x4efe39['errors'][_0x4b5d05]){handleError(_0x4efe39[_0x1772('0x85')][_0x4b5d05],_0x4efe39[_0x1772('0x87')][_0x4b5d05]);}else{var _0x13e3e1=[];var _0x4001cd=[];var _0x64cb69={};for(var _0x1b5603 in _0x2b484b){let _0x2e852e=contactItemTypes[_0x1772('0x88')](_0x18ec40=>_0x18ec40[_0x1772('0x7f')]===_0x1b5603);let _0x14c395=contactItemTypes[_0x1772('0x88')](_0x4c5b99=>_0x4c5b99[_0x1772('0x7f')]+_0x1772('0x80')===_0x1b5603);if(_[_0x1772('0x1e')](_0x2e852e)&&_[_0x1772('0x1e')](_0x14c395)){if(_0x2b484b[_0x1772('0x89')](_0x1b5603)){if(_0x4efe39[_0x1772('0x85')][_0x4b5d05][_0x2b484b[_0x1b5603]]){var _0x8ac8ea=_[_0x1772('0x8a')](_0x4efe39[_0x1772('0x85')][_0x4b5d05][_0x2b484b[_0x1b5603]][_0x1772('0x8b')](/"/g,'\x27'));switch(_0x1b5603){case'scheduledat':var _0x139b82=moment(_0x8ac8ea,_0x1772('0xc'),!![]);if(_0x139b82[_0x1772('0x8c')]()){_0x2db92b[_0x1772('0x1a')]('\x22'+_0x8ac8ea+'\x22');}else{_0x13e3e1[_0x1772('0x1a')](_0x1772('0x8d'));}break;case _0x1772('0x34'):var _0x576731=parseInt(_0x8ac8ea);_0x8ac8ea=_[_0x1772('0x8e')](_0x576731)||_0x576731<0x0||_0x576731>0x4?_0x269cb2?0x3:0x2:_0x576731;_0x2db92b[_0x1772('0x1a')]('\x22'+_0x8ac8ea+'\x22');break;case _0x1772('0x35'):var _0x36d3f8=parseInt(_0x8ac8ea);if(_[_0x1772('0x8f')](_0x36d3f8)&&_[_0x1772('0x7d')](_0x560877,_0x36d3f8)){_0x2db92b[_0x1772('0x1a')]('\x22'+_0x36d3f8+'\x22');}else{_0x13e3e1[_0x1772('0x1a')](_0x1772('0x90'));}break;case _0x1772('0x91'):if(isEmail(_0x8ac8ea)){_0x2db92b[_0x1772('0x1a')]('\x22'+_0x8ac8ea+'\x22');}else{_0x13e3e1[_0x1772('0x1a')]('email\x20wrong\x20format');}break;case _0x1772('0x92'):var _0x5c010d=moment(_0x8ac8ea,_0x1772('0x93'),!![]);if(_0x5c010d['isValid']()){_0x2db92b[_0x1772('0x1a')]('\x22'+_0x8ac8ea+'\x22');}else{_0x13e3e1['push'](_0x1772('0x94'));}break;case _0x1772('0x71'):var _0x24e040=shared[_0x1772('0x70')];var _0x4d9d64=_0x24e040[_0x8ac8ea];if(!_[_0x1772('0x1e')](_0x4d9d64)){var _0x277610=_0x4d9d64['utcOffset'];_0x2db92b[_0x1772('0x1a')]('\x22'+_0x8ac8ea+'\x22');_0x2db92b[_0x1772('0x1a')]('\x22'+_0x277610+'\x22');}break;default:_0x2db92b[_0x1772('0x1a')]('\x22'+_0x8ac8ea+'\x22');}}else{switch(_0x1b5603){case'firstName':case _0x1772('0x11'):_0x13e3e1['push'](_0x1b5603+_0x1772('0x95'));break;default:_0x2db92b[_0x1772('0x1a')]('\x22\x22');}}}}else{var _0x50dc8e='';if(!_['isNil'](_0x2e852e)){if(!_0x64cb69['hasOwnProperty'](_0x2e852e['id'])){if(!_[_0x1772('0x1e')](_0x4efe39[_0x1772('0x85')][_0x4b5d05][_0x2b484b[_0x1b5603]])){var _0x8ac8ea=_[_0x1772('0x8a')](_0x4efe39[_0x1772('0x85')][_0x4b5d05][_0x2b484b[_0x1b5603]][_0x1772('0x8b')](/"/g,'\x27'));var _0x4af9bd=phoneDescriptions['find'](_0x140df0=>_0x140df0[_0x1772('0x96')]===_0x2e852e['id']);if(!_[_0x1772('0x1e')](_0x4af9bd)){var _0x936331=_[_0x1772('0x8a')](_0x4efe39['data'][_0x4b5d05][_0x2b484b[_0x4af9bd[_0x1772('0x97')]]][_0x1772('0x8b')](/"/g,'\x27'));if(!_[_0x1772('0x1e')](_0x936331))_0x8ac8ea=_0x8ac8ea+'§'+_0x936331;}if(_0x50dc8e=='')_0x50dc8e=_0x8ac8ea;else _0x50dc8e+='|'+_0x8ac8ea;}_0x4001cd['push'](_0x2e852e['id']+':'+_0x50dc8e);_0x64cb69[_0x2e852e['id']]=0x1;}}}}if(hasAdditionalPhones){_0x2db92b['push']('\x22'+_0x4001cd[_0x1772('0x13')](';')+'\x22');}if(_0x13e3e1[_0x1772('0x19')]){handleError(_0x4efe39[_0x1772('0x85')][_0x4b5d05],{'code':_0x1772('0x98'),'message':_0x13e3e1[_0x1772('0x13')]()});}else{fs[_0x1772('0x99')](_0x9825ab,_0x2db92b[_0x1772('0x13')]()+'\x0a');}_0x2db92b=[];}if(!(stats['rows']%0xc8)){socket[_0x1772('0x9a')](_0x1772('0x9b')+_0x8c6f9f,stats);stats[_0x1772('0x87')]=[];}}if(stopped){logger['info'](_0x1772('0x9c'));_0x5e6eb2['abort']();}}catch(_0x2a358f){handleError(_0x4efe39[_0x1772('0x85')][_0x4b5d05],{'code':_0x1772('0x9d'),'message':_0x2a358f[_0x1772('0x5e')]});logger['error']('step',_0x2a358f['message']);}},'complete':function(){try{var _0x42f928=[];var _0x567e32=[];var _0x378981=_0x1772('0x37');if(_0x3b1fa8['duplicates']&&_0x3b1fa8[_0x1772('0x9e')]['length']){_0x378981=_0x1772('0x9f')+_0x8c6f9f;_0x42f928[_0x1772('0x1a')](_0x1772('0xa0')+_0x378981+_0x1772('0xa1'));}tmp_campaigns=_0x1772('0xa2')+_0x8c6f9f;tmp_voice_queues=_0x1772('0xa3')+_0x8c6f9f;_0x567e32[_0x1772('0x1a')](_0x1772('0xa0')+tmp_campaigns+_0x1772('0xa4'));_0x567e32['push'](_0x1772('0xa0')+tmp_voice_queues+_0x1772('0xa4'));BPromise[_0x1772('0xa5')](_0x567e32,handleTZQuery)[_0x1772('0x18')](function(_0x5a592f){updateTzCampaigns(_0x3b1fa8['ListId'])[_0x1772('0x18')](function(_0xfe1b72){updateTzVoiceQueues(_0x3b1fa8['ListId'])[_0x1772('0x18')](function(_0x238985){if(hasTZ)_0x189554=_0x189554[_0x1772('0x8b')](_0x1772('0x71'),_0x1772('0xa6'));var _0x56a542=util['format'](_0x1772('0xa7'),_0x9825ab,_0x378981,_0x189554,_0x3b1fa8[_0x1772('0x31')],_0x3b1fa8['CompanyId']||null,NOW,NOW);if(_[_0x1772('0x1e')](_0x2b484b[_0x1772('0x2f')])){_0x56a542+=_0x1772('0xa8');}_0x42f928[_0x1772('0x1a')](_0x56a542);if(_0x3b1fa8[_0x1772('0x9e')]&&_0x3b1fa8['duplicates']['length']){_0x42f928[_0x1772('0x1a')](insertCmContact(_0x3b1fa8[_0x1772('0x31')],_0x378981,_0x3b1fa8[_0x1772('0x9e')],_0x2b484b));_0x42f928[_0x1772('0x1a')](_0x1772('0xa9')+_0x378981+';');}BPromise[_0x1772('0xa5')](_0x42f928,handleQuery)['then'](function(_0x1ba94e){BPromise[_0x1772('0x1b')]([handleAdditionalPhones()])[_0x1772('0x18')](function(){_0x42f928=[];for(var _0xf48ffb=0x0;_0xf48ffb\x20\x20');}var _0x45b605=path['join'](config[_0x1772('0x7b')],_0x1772('0xb5'),process[_0x1772('0xb4')][0x2]);if(!fs[_0x1772('0xb6')](_0x45b605)){throw new Error(_0x1772('0xb7'));}var _0x241f1b={};try{_0x241f1b=JSON[_0x1772('0x83')](process[_0x1772('0xb4')][0x3]);if(!_0x241f1b[_0x1772('0x78')]){throw new Error(_0x1772('0xb8'));}if(!_0x241f1b['binding'][_0x1772('0x11')]){throw new Error('phone\x20is\x20mandatory');}if(!_0x241f1b[_0x1772('0x78')]['firstName']){throw new Error('firstName\x20is\x20mandatory');}var _0x3cb7db=0x0;if(_0x241f1b['binding'][_0x1772('0x35')]){_0x3cb7db=0x1;}if(!_0x241f1b[_0x1772('0x31')]){throw new Error(_0x1772('0xb9'));}}catch(_0x324fde){throw new Error('body\x20id\x20mandatory');}var _0x5c9cd6=[];try{_0x5c9cd6=_[_0x1772('0xba')](JSON[_0x1772('0x83')](process[_0x1772('0xb4')][0x4]),'id');}catch(_0x3c7be4){logger['info']('No\x20agent\x20available');}main(_0x45b605,_0x241f1b,_0x5c9cd6,_0x3cb7db);}validate();process['on'](_0x1772('0xbb'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file +var _0xcda7=['agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','description','SystemRow','appendFileSync','emit','SystemError','duplicates','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','dialTimezone,utcOffset','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','DROP\x20TABLE\x20','contactTypeId','VoiceQueueId','CampaignId','voice_queues_has_cm_blacklists','campaigns_has_cm_blacklists','each','finish','affectedRows','contact:import:','unlink','complete','argv','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','format','YYYY-MM-DD\x20HH:mm:ss','test','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','findAll','AdditionalPhones','then','length','push','split','all','isNil','filter','CmContactHasItem','findOne','update','create','PHONE','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','priority','UserId','recallme','select','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.createdAt\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','insert','.CmListId\x20=\x20?','cm_hopper_black','ListId\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','updatedAt','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','concat','scheduledAt',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','exit','errors','code','sequelize','query','spread','catch','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','timezones','dialTimezone','utcOffset','set','offset','main','stringify','send','binding','clone','root','server/files/tmp','keys','includes','header','ContactItemType','name','_description','writeFileSync','parse','createReadStream','data','rows','find','hasOwnProperty','trim','replace','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber'];(function(_0x12a600,_0x4aa209){var _0x236c37=function(_0x54f71b){while(--_0x54f71b){_0x12a600['push'](_0x12a600['shift']());}};_0x236c37(++_0x4aa209);}(_0xcda7,0x199));var _0x7cda=function(_0x5cf17d,_0x16d5dd){_0x5cf17d=_0x5cf17d-0x0;var _0x53efb0=_0xcda7[_0x5cf17d];return _0x53efb0;};'use strict';var fs=require('fs');var path=require(_0x7cda('0x0'));var _=require(_0x7cda('0x1'));var Papa=require(_0x7cda('0x2'));var util=require(_0x7cda('0x3'));var BPromise=require(_0x7cda('0x4'));var moment=require(_0x7cda('0x5'));var squel=require(_0x7cda('0x6'));var Redis=require('ioredis');var db=require('../../../mysqldb')['db'];var config=require(_0x7cda('0x7'));var shared=require('../../../config/environment/shared');var logger=require(_0x7cda('0x8'))(_0x7cda('0x9'));config[_0x7cda('0xa')]=_[_0x7cda('0xb')](config[_0x7cda('0xa')],{'host':_0x7cda('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7cda('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x7cda('0xd')]('YYYY-MM-DD\x20HH:mm:ss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x7cda('0xd')](_0x7cda('0xe'));function isEmail(_0x50830a){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))*$/[_0x7cda('0xf')](_0x50830a);}function selectNotIn(_0x5b2951,_0x3e3450,_0x5220cb,_0x3fa39d,_0x4beb45){return squel['select']()[_0x7cda('0x10')](_0x7cda('0x11'))[_0x7cda('0x12')](_0x3fa39d)[_0x7cda('0x13')](_0x3e3450,null,_0x3e3450+_0x7cda('0x14')+_0x3fa39d+'.'+_0x5220cb)[_0x7cda('0x15')](_0x3fa39d+'.'+_0x5220cb+_0x7cda('0x16')+_0x5b2951+'.'+_0x5220cb)[_0x7cda('0x15')](_0x3e3450+_0x7cda('0x17')+_0x4beb45[_0x7cda('0x13')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x63c618,_0x9b570d){promisesAdditionalPhones=[];return db['CmContact'][_0x7cda('0x18')]({'raw':!![],'attributes':['id',_0x7cda('0x19')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x7cda('0x1a')](function(_0xb188b7){if(_0xb188b7!==null){var _0x234645=[];for(var _0x33b34d=0x0;_0x33b34d<_0xb188b7[_0x7cda('0x1b')];_0x33b34d++){var _0x4d41ef=_0xb188b7[_0x33b34d];_0x234645[_0x7cda('0x1c')](insertAdditionalPhones(_0x4d41ef));}}Promise['all'](_0x234645)['then'](function(){_0x63c618({'val':0x1});});});});}function insertAdditionalPhones(_0x36bf3b){return new Promise(function(_0x1914eb,_0x22f67d){var _0x374724=_0x36bf3b[_0x7cda('0x19')];var _0x557154=_0x374724[_0x7cda('0x1d')](';');var _0x370467=[];orderBy=0x0;for(var _0x4f1c98=0x0;_0x4f1c98<_0x557154[_0x7cda('0x1b')];_0x4f1c98++){_0x370467[_0x7cda('0x1c')](splitAdditionalPhone(_0x36bf3b['id'],_0x557154[_0x4f1c98]));}Promise[_0x7cda('0x1e')](_0x370467)[_0x7cda('0x1a')](function(){_0x1914eb({'val':_0x557154[_0x7cda('0x1b')]});});});}function splitAdditionalPhone(_0x1418be,_0x107000){return new Promise(function(_0x418600,_0x10d811){var _0x57556e=_0x107000[_0x7cda('0x1d')](':');var _0xd91f6c=_0x57556e[0x0];var _0x2e638d=_0x57556e[0x1];if(!_[_0x7cda('0x1f')](_0x2e638d)){var _0x129422=_0x2e638d[_0x7cda('0x1d')]('|');var _0x486107=[];for(var _0x43f12c=0x0;_0x43f12c<_0x129422['length'];_0x43f12c++){if(_0x129422[_0x43f12c]!==''){var _0x51390b=_[_0x7cda('0x20')](promisesAdditionalPhones,{'contactId':_0x1418be,'phone':_0x129422[_0x43f12c]});if(_0x51390b[_0x7cda('0x1b')]==0x0){orderBy++;promisesAdditionalPhones[_0x7cda('0x1c')]({'contactId':_0x1418be,'contactTypeId':_0xd91f6c,'phone':_0x129422[_0x43f12c],'orderBy':orderBy});}}}_0x418600({'ok':0x1});}else _0x418600({'res':0x0});});}function createAdditionalPhone(_0x1e28e1,_0x1ae91e,_0x36b45e,_0x4dc96a){var _0x5be44e='';var _0x4a1238='';var _0x342f80=_0x36b45e[_0x7cda('0x1d')]('§');_0x5be44e=_0x342f80[0x0];if(_0x342f80[_0x7cda('0x1b')]==0x2)_0x4a1238=_0x342f80[0x1];return new Promise(function(_0x20fd07,_0x229d94){return db[_0x7cda('0x21')][_0x7cda('0x22')]({'where':{'CmContactId':_0x1e28e1,'item':_0x5be44e}})[_0x7cda('0x1a')](function(_0x27ccc0){if(_0x27ccc0){return db[_0x7cda('0x21')][_0x7cda('0x23')]({'ItemTypeId':_0x1ae91e,'description':_0x4a1238,'OrderBy':_0x4dc96a},{'where':{'CmContactId':_0x1e28e1,'item':_0x5be44e}})[_0x7cda('0x1a')](function(_0x5d1cc9){_0x20fd07({'res':'updated'});});}else{return db[_0x7cda('0x21')][_0x7cda('0x24')]({'CmContactId':_0x1e28e1,'item':_0x5be44e,'description':_0x4a1238,'ItemTypeId':_0x1ae91e,'OrderBy':_0x4dc96a,'ItemClass':_0x7cda('0x25')})[_0x7cda('0x1a')](function(_0x156564){_0x20fd07({'res':_0x7cda('0x26')});});}});});}function insertCmHopper(_0x2546b8,_0x43b0f2,_0x247878,_0x16ccff,_0x522471){var _0x4c7fad=[_0x7cda('0x27'),_0x7cda('0x28'),_0x7cda('0x29'),_0x7cda('0x2a'),_0x43b0f2+'.'+_0x16ccff,_0x7cda('0x2b'),_0x7cda('0x2c'),_0x7cda('0x2d'),_0x7cda('0x2e'),'\x22'+_0x522471+'\x22'];return squel['insert']()[_0x7cda('0x2f')](_0x7cda('0x30'))[_0x7cda('0x31')]([_0x7cda('0x11'),_0x7cda('0x32'),_0x7cda('0x33'),_0x7cda('0x34'),_0x16ccff,_0x7cda('0x35'),'updatedAt',_0x7cda('0x36'),_0x7cda('0x37'),_0x7cda('0x38')],squel[_0x7cda('0x39')]()[_0x7cda('0x3a')](_0x4c7fad)[_0x7cda('0x12')](_0x43b0f2)[_0x7cda('0x13')](_0x7cda('0x3b'),null,_0x7cda('0x3c')+_0x43b0f2+_0x7cda('0x3d'))[_0x7cda('0x13')](_0x247878,null,_0x247878+_0x7cda('0x14')+_0x43b0f2+'.'+_0x16ccff)['where'](_0x43b0f2+'.CmListId\x20=\x20?',_0x2546b8)[_0x7cda('0x15')](_0x7cda('0x3e'),NOW)[_0x7cda('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x43b0f2,_0x247878,_0x16ccff,'cm_hopper',[_0x7cda('0x3f'),_0x7cda('0x40')]))['where'](_0x7cda('0x41'),selectNotIn(_0x43b0f2,_0x247878,_0x16ccff,_0x7cda('0x30'),[_0x7cda('0x3f')])))[_0x7cda('0x42')]();}function insertCmHopperBlack(_0x4f482f,_0x1ba558,_0x43bcc7,_0x51a65c){var _0x5c51bb=[_0x7cda('0x27'),'cm_contacts.id',_0x7cda('0x2a'),_0x1ba558+'.'+_0x51a65c,'cm_contacts.createdAt','cm_contacts.updatedAt'];return squel[_0x7cda('0x43')]()[_0x7cda('0x2f')]('cm_hopper_black')[_0x7cda('0x31')]([_0x7cda('0x11'),_0x7cda('0x33'),_0x7cda('0x34'),_0x51a65c,_0x7cda('0x35'),'updatedAt'],squel['select']()['fields'](_0x5c51bb)[_0x7cda('0x12')](_0x1ba558)[_0x7cda('0x13')](_0x7cda('0x3b'),null,_0x7cda('0x3c')+_0x1ba558+_0x7cda('0x3d'))['join'](_0x43bcc7,null,_0x43bcc7+'.id\x20=\x20'+_0x1ba558+'.'+_0x51a65c)[_0x7cda('0x15')](_0x1ba558+_0x7cda('0x44'),_0x4f482f)[_0x7cda('0x15')](_0x7cda('0x3e'),NOW)[_0x7cda('0x15')](_0x7cda('0x41'),squel[_0x7cda('0x39')]()[_0x7cda('0x10')](_0x7cda('0x11'))[_0x7cda('0x12')](_0x7cda('0x45'))[_0x7cda('0x15')](_0x7cda('0x46'),_0x4f482f)[_0x7cda('0x15')](_0x51a65c+_0x7cda('0x16')+_0x1ba558+'.'+_0x51a65c)))[_0x7cda('0x42')]();}function insertTzCmHopper(_0x5d762d,_0x249a3b,_0xcfb2e6,_0x58310c,_0x5061a7,_0x4e74c9){var _0x1205aa=[_0x7cda('0x27'),_0x7cda('0x47')+_0x4e74c9+_0x7cda('0x48'),_0x7cda('0x29'),_0x7cda('0x2a'),_0x249a3b+'.'+_0x58310c,'cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority',_0x7cda('0x2e'),'\x22'+_0x5061a7+'\x22'];var _0x566132=squel['insert']()['into'](_0x7cda('0x30'))['fromQuery']([_0x7cda('0x11'),'scheduledat',_0x7cda('0x33'),_0x7cda('0x34'),_0x58310c,_0x7cda('0x35'),_0x7cda('0x49'),_0x7cda('0x36'),_0x7cda('0x37'),_0x7cda('0x38')],squel[_0x7cda('0x39')]()[_0x7cda('0x3a')](_0x1205aa)[_0x7cda('0x12')](_0x249a3b)[_0x7cda('0x13')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x249a3b+_0x7cda('0x3d'))['join'](_0xcfb2e6,null,_0xcfb2e6+_0x7cda('0x14')+_0x249a3b+'.'+_0x58310c)[_0x7cda('0x13')](_0x4e74c9,null,_0x4e74c9+_0x7cda('0x14')+_0x249a3b+'.'+_0x58310c)[_0x7cda('0x15')](_0x249a3b+'.CmListId\x20=\x20?',_0x5d762d)[_0x7cda('0x15')](_0x7cda('0x3e'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x249a3b,_0xcfb2e6,_0x58310c,'cm_hopper',[_0x7cda('0x3f'),_0x7cda('0x40')]))['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x249a3b,_0xcfb2e6,_0x58310c,_0x7cda('0x30'),[_0x7cda('0x3f')])))['toString']();return _0x566132;}function insertTzCmHopperBlack(_0x3fac04,_0x2eb80e,_0x1b62ba,_0x23e030){var _0x56ccbe=[_0x7cda('0x27'),_0x7cda('0x29'),'cm_contacts.ListId',_0x2eb80e+'.'+_0x23e030,'cm_contacts.createdAt',_0x7cda('0x2c')];return squel[_0x7cda('0x43')]()[_0x7cda('0x2f')](_0x7cda('0x45'))['fromQuery']([_0x7cda('0x11'),_0x7cda('0x33'),_0x7cda('0x34'),_0x23e030,_0x7cda('0x35'),_0x7cda('0x49')],squel[_0x7cda('0x39')]()[_0x7cda('0x3a')](_0x56ccbe)[_0x7cda('0x12')](_0x2eb80e)['join'](_0x7cda('0x3b'),null,_0x7cda('0x3c')+_0x2eb80e+_0x7cda('0x3d'))['join'](_0x1b62ba,null,_0x1b62ba+_0x7cda('0x14')+_0x2eb80e+'.'+_0x23e030)['where'](_0x2eb80e+_0x7cda('0x44'),_0x3fac04)['where'](_0x7cda('0x3e'),NOW)[_0x7cda('0x15')](_0x7cda('0x41'),squel['select']()[_0x7cda('0x10')](_0x7cda('0x11'))[_0x7cda('0x12')]('cm_hopper_black')[_0x7cda('0x15')](_0x7cda('0x46'),_0x3fac04)[_0x7cda('0x15')](_0x23e030+_0x7cda('0x16')+_0x2eb80e+'.'+_0x23e030)))[_0x7cda('0x42')]();}function insertCmHopperAdditionalPhones(_0x4cda20){var _0x318017=['cm_hopper.id',_0x7cda('0x4a'),_0x7cda('0x4b'),_0x7cda('0x4c'),_0x7cda('0x4d')];return squel[_0x7cda('0x43')]()['into'](_0x7cda('0x4e'))[_0x7cda('0x31')]([_0x7cda('0x4f'),_0x7cda('0x11'),_0x7cda('0x50'),_0x7cda('0x35'),_0x7cda('0x49')],squel['select']()['fields'](_0x318017)[_0x7cda('0x12')](_0x7cda('0x30'))['join']('cm_contacts',null,_0x7cda('0x51'))['join']('cm_contact_has_items',null,_0x7cda('0x52'))['where']('cm_hopper.ListId\x20=\x20?',_0x4cda20)['where'](_0x7cda('0x3e'),NOW))[_0x7cda('0x42')]();}function insertCmContact(_0x5eae5a,_0x3e0d94,_0xa06064,_0xead4de){var _0x224c65=_[_0x7cda('0x53')](_['keys'](_0xead4de),[_0x7cda('0x34'),'CompanyId',_0x7cda('0x35'),_0x7cda('0x49'),_0x7cda('0x54')]);return squel['insert']()[_0x7cda('0x2f')](_0x7cda('0x3b'))['fromQuery'](_0x224c65,squel[_0x7cda('0x39')]()[_0x7cda('0x3a')](_0x224c65)[_0x7cda('0x12')](_0x3e0d94)[_0x7cda('0x15')]('('+_0xa06064[_0x7cda('0x13')](',')+_0x7cda('0x55'),squel['select']()[_0x7cda('0x3a')](_0xa06064)[_0x7cda('0x12')](_0x7cda('0x3b'))['where'](_0x7cda('0x46'),_0x5eae5a)[_0x7cda('0x15')](_0x7cda('0x56')))[_0x7cda('0x15')](_0x7cda('0x57'),squel['select']()[_0x7cda('0x10')](_0x7cda('0x58'),_0x7cda('0x59'))[_0x7cda('0x12')](_0x3e0d94)[_0x7cda('0x5a')](_0xa06064[_0x7cda('0x13')](','))))['toString']();}function handleStop(){logger[_0x7cda('0x5b')](_0x7cda('0x5c'));stopped=!![];}function handleUncaughtException(_0x398285){logger[_0x7cda('0x5d')](_0x398285[_0x7cda('0x5e')]);process[_0x7cda('0x5f')](0x1);}function handleError(_0x4c6b8a,_0x435e97){stats[_0x7cda('0x60')][_0x7cda('0x1c')]({'name':_0x435e97[_0x7cda('0x61')],'message':_0x435e97['message'],'row':_0x4c6b8a});}function handleQuery(_0x477cc1){logger[_0x7cda('0x5b')](_0x477cc1);return db[_0x7cda('0x62')][_0x7cda('0x63')](_0x477cc1)[_0x7cda('0x64')](function(_0x4a923b){results[_0x7cda('0x1c')](_0x4a923b);})[_0x7cda('0x65')](function(_0x26bdd8){logger[_0x7cda('0x5d')](_0x26bdd8[_0x7cda('0x5e')]);});}function updateTzCampaigns(_0x2b40d1){return new Promise(function(_0x1123f4,_0x12b44c){var _0x5dc482=squel[_0x7cda('0x39')]()['fields'](['campaigns.id',_0x7cda('0x66')])[_0x7cda('0x12')](_0x7cda('0x67'))[_0x7cda('0x13')](_0x7cda('0x68'),null,_0x7cda('0x69'))[_0x7cda('0x15')](_0x7cda('0x6a')+_0x2b40d1);db['sequelize'][_0x7cda('0x63')](_0x5dc482[_0x7cda('0x42')]())[_0x7cda('0x64')](function(_0x493ea9){var _0x15e9e9=[];for(var _0x61020f=0x0;_0x61020f<_0x493ea9[_0x7cda('0x1b')];_0x61020f++){_0x15e9e9[_0x7cda('0x1c')](getTimezoneData(_0x493ea9[_0x61020f],tmp_campaigns));}BPromise[_0x7cda('0x1e')](_0x15e9e9)[_0x7cda('0x1a')](function(){_0x1123f4({'val':0x1});});})[_0x7cda('0x65')](function(_0x162448){logger[_0x7cda('0x5d')](_0x162448[_0x7cda('0x5e')]);_0x1123f4({'val':0x0});});});}function updateTzVoiceQueues(_0x1b2854){return new Promise(function(_0x3e3640,_0x2c1e72){var _0x104063=squel[_0x7cda('0x39')]()['fields'](['voice_queues.id',_0x7cda('0x6b')])[_0x7cda('0x12')](_0x7cda('0x6c'))['join'](_0x7cda('0x6d'),null,'voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId')['where']('voice_queues_has_cm_lists.CmListId='+_0x1b2854);db[_0x7cda('0x62')][_0x7cda('0x63')](_0x104063['toString']())[_0x7cda('0x64')](function(_0x450b99){var _0x2c87bf=[];for(var _0x11fddc=0x0;_0x11fddc<_0x450b99[_0x7cda('0x1b')];_0x11fddc++){_0x2c87bf[_0x7cda('0x1c')](getTimezoneData(_0x450b99[_0x11fddc],tmp_voice_queues));}BPromise['all'](_0x2c87bf)[_0x7cda('0x1a')](function(){_0x3e3640({'val':0x1});});})['catch'](function(_0x74b824){logger[_0x7cda('0x5d')](_0x74b824[_0x7cda('0x5e')]);_0x3e3640({'val':0x0});});});}function getTimezoneData(_0x300530,_0x26ccfb){return new Promise(function(_0x2abe9c,_0x38b923){var _0x5b78cf=shared[_0x7cda('0x6e')];var _0x43270a=_0x5b78cf[_0x300530[_0x7cda('0x6f')]];if(_[_0x7cda('0x1f')](_0x43270a)){_0x2abe9c({'ret':0x1});}else{var _0x3c190b=_0x43270a[_0x7cda('0x70')];var _0x33253b=squel[_0x7cda('0x43')]()['into'](_0x26ccfb)[_0x7cda('0x71')]('id',_0x300530['id'])[_0x7cda('0x71')](_0x7cda('0x72'),_0x3c190b)[_0x7cda('0x71')](_0x7cda('0x6f'),_0x300530[_0x7cda('0x6f')])[_0x7cda('0x42')]();return db[_0x7cda('0x62')][_0x7cda('0x63')](_0x33253b)[_0x7cda('0x64')](function(_0xa1c4b5){_0x2abe9c({'ret':0x1});})[_0x7cda('0x65')](function(_0x41d76d){logger[_0x7cda('0x5d')](_0x41d76d[_0x7cda('0x5e')]);_0x38b923({'ret':0x1});});}});}function handleTZQuery(_0x37b485){logger[_0x7cda('0x5b')](_0x37b485);return db[_0x7cda('0x62')]['query'](_0x37b485)[_0x7cda('0x64')](function(_0x286b14){})[_0x7cda('0x65')](function(_0x468421){logger[_0x7cda('0x5d')](_0x468421[_0x7cda('0x5e')]);});}function main(_0x1a14f8,_0x16cb19,_0x5170b5,_0x563b3f){logger[_0x7cda('0x5b')](_0x7cda('0x73'),_0x1a14f8,JSON[_0x7cda('0x74')](_0x16cb19));process[_0x7cda('0x75')]('start');var _0x2b1c10=_0x16cb19[_0x7cda('0x76')];var _0x32a498=_[_0x7cda('0x77')](_0x2b1c10);var _0x4e1e39=_0x16cb19['socket_timestamp'];var _0x23b496=path[_0x7cda('0x13')](config[_0x7cda('0x78')],_0x7cda('0x79'),_0x4e1e39+'.csv');hasTZ=_[_0x7cda('0x7a')](_0x2b1c10)[_0x7cda('0x7b')]('dialTimezone');var _0x414827=_[_0x7cda('0x7a')](_0x2b1c10)['join']();logger['info'](_0x7cda('0x7c'),_0x414827);db[_0x7cda('0x7d')][_0x7cda('0x18')]({'raw':!![],'attributes':['id',_0x7cda('0x7e')]})[_0x7cda('0x1a')](function(_0x51ad86){for(var _0x592858=0x0;_0x592858<_0x51ad86[_0x7cda('0x1b')];_0x592858++){if(_0x51ad86[_0x592858]['name']in _0x2b1c10){contactItemTypes[_0x7cda('0x1c')](_0x51ad86[_0x592858]);delete _0x32a498[_0x51ad86[_0x592858]['name']];hasAdditionalPhones=!![];}for(var _0x21479c in _0x2b1c10){if(_0x51ad86[_0x592858][_0x7cda('0x7e')]+_0x7cda('0x7f')===_0x21479c){phoneDescriptions[_0x7cda('0x1c')]({'itemTypeId':_0x51ad86[_0x592858]['id'],'description':_0x21479c});delete _0x32a498[_0x21479c];}}}if(hasAdditionalPhones)_0x32a498['AdditionalPhones']='';var _0x1e78ff=_[_0x7cda('0x7a')](_0x32a498)[_0x7cda('0x13')]();logger[_0x7cda('0x5b')](_0x7cda('0x7c'),_0x1e78ff);fs[_0x7cda('0x80')](_0x23b496,_0x1e78ff+'\x0a');Papa[_0x7cda('0x81')](fs[_0x7cda('0x82')](_0x1a14f8),{'header':!![],'skipEmptyLines':!![],'step':function(_0x98849,_0x57f159){try{for(var _0x5a13ae=0x0,_0x108aa1=[];_0x5a13ae<_0x98849[_0x7cda('0x83')][_0x7cda('0x1b')];_0x5a13ae++){stats[_0x7cda('0x84')]+=0x1;if(_0x98849[_0x7cda('0x60')][_0x5a13ae]){handleError(_0x98849[_0x7cda('0x83')][_0x5a13ae],_0x98849[_0x7cda('0x60')][_0x5a13ae]);}else{var _0x501732=[];var _0x13cc09=[];var _0x462ae8={};for(var _0x1dcf04 in _0x2b1c10){let _0x39b156=contactItemTypes[_0x7cda('0x85')](_0x311512=>_0x311512[_0x7cda('0x7e')]===_0x1dcf04);let _0x21636b=contactItemTypes[_0x7cda('0x85')](_0x4e99f5=>_0x4e99f5['name']+_0x7cda('0x7f')===_0x1dcf04);if(_['isNil'](_0x39b156)&&_[_0x7cda('0x1f')](_0x21636b)){if(_0x2b1c10[_0x7cda('0x86')](_0x1dcf04)){if(_0x98849[_0x7cda('0x83')][_0x5a13ae][_0x2b1c10[_0x1dcf04]]){var _0x5acfbb=_[_0x7cda('0x87')](_0x98849['data'][_0x5a13ae][_0x2b1c10[_0x1dcf04]][_0x7cda('0x88')](/"/g,'\x27'));switch(_0x1dcf04){case'scheduledat':var _0x4c22c6=moment(_0x5acfbb,_0x7cda('0xe'),!![]);if(_0x4c22c6['isValid']()){_0x108aa1[_0x7cda('0x1c')]('\x22'+_0x5acfbb+'\x22');}else{_0x501732[_0x7cda('0x1c')](_0x7cda('0x89'));}break;case _0x7cda('0x36'):var _0x48f4e2=parseInt(_0x5acfbb);_0x5acfbb=_[_0x7cda('0x8a')](_0x48f4e2)||_0x48f4e2<0x0||_0x48f4e2>0x4?_0x563b3f?0x3:0x2:_0x48f4e2;_0x108aa1[_0x7cda('0x1c')]('\x22'+_0x5acfbb+'\x22');break;case _0x7cda('0x37'):var _0x41c013=parseInt(_0x5acfbb);if(_[_0x7cda('0x8b')](_0x41c013)&&_[_0x7cda('0x7b')](_0x5170b5,_0x41c013)){_0x108aa1[_0x7cda('0x1c')]('\x22'+_0x41c013+'\x22');}else{_0x501732['push'](_0x7cda('0x8c'));}break;case'email':if(isEmail(_0x5acfbb)){_0x108aa1[_0x7cda('0x1c')]('\x22'+_0x5acfbb+'\x22');}else{_0x501732['push'](_0x7cda('0x8d'));}break;case _0x7cda('0x8e'):var _0x56545c=moment(_0x5acfbb,_0x7cda('0x8f'),!![]);if(_0x56545c['isValid']()){_0x108aa1['push']('\x22'+_0x5acfbb+'\x22');}else{_0x501732[_0x7cda('0x1c')](_0x7cda('0x90'));}break;case _0x7cda('0x6f'):var _0x44779b=shared[_0x7cda('0x6e')];var _0x208d8f=_0x44779b[_0x5acfbb];if(!_[_0x7cda('0x1f')](_0x208d8f)){var _0x3d73bf=_0x208d8f[_0x7cda('0x70')];_0x108aa1[_0x7cda('0x1c')]('\x22'+_0x5acfbb+'\x22');_0x108aa1[_0x7cda('0x1c')]('\x22'+_0x3d73bf+'\x22');}break;default:_0x108aa1[_0x7cda('0x1c')]('\x22'+_0x5acfbb+'\x22');}}else{switch(_0x1dcf04){case _0x7cda('0x91'):case _0x7cda('0x11'):_0x501732[_0x7cda('0x1c')](_0x1dcf04+_0x7cda('0x92'));break;default:_0x108aa1[_0x7cda('0x1c')]('\x22\x22');}}}}else{var _0x5a582a='';if(!_[_0x7cda('0x1f')](_0x39b156)){if(!_0x462ae8['hasOwnProperty'](_0x39b156['id'])){if(!_[_0x7cda('0x1f')](_0x98849[_0x7cda('0x83')][_0x5a13ae][_0x2b1c10[_0x1dcf04]])){var _0x5acfbb=_['trim'](_0x98849[_0x7cda('0x83')][_0x5a13ae][_0x2b1c10[_0x1dcf04]][_0x7cda('0x88')](/"/g,'\x27'));var _0x35b1f2=phoneDescriptions[_0x7cda('0x85')](_0x40ee33=>_0x40ee33['itemTypeId']===_0x39b156['id']);if(!_[_0x7cda('0x1f')](_0x35b1f2)){var _0x2dd8cf=_[_0x7cda('0x87')](_0x98849[_0x7cda('0x83')][_0x5a13ae][_0x2b1c10[_0x35b1f2[_0x7cda('0x93')]]]['replace'](/"/g,'\x27'));if(!_[_0x7cda('0x1f')](_0x2dd8cf))_0x5acfbb=_0x5acfbb+'§'+_0x2dd8cf;}if(_0x5a582a=='')_0x5a582a=_0x5acfbb;else _0x5a582a+='|'+_0x5acfbb;}_0x13cc09['push'](_0x39b156['id']+':'+_0x5a582a);_0x462ae8[_0x39b156['id']]=0x1;}}}}if(hasAdditionalPhones){_0x108aa1[_0x7cda('0x1c')]('\x22'+_0x13cc09[_0x7cda('0x13')](';')+'\x22');}if(_0x501732[_0x7cda('0x1b')]){handleError(_0x98849['data'][_0x5a13ae],{'code':_0x7cda('0x94'),'message':_0x501732[_0x7cda('0x13')]()});}else{fs[_0x7cda('0x95')](_0x23b496,_0x108aa1[_0x7cda('0x13')]()+'\x0a');}_0x108aa1=[];}if(!(stats['rows']%0xc8)){socket[_0x7cda('0x96')]('contact:import:'+_0x4e1e39,stats);stats[_0x7cda('0x60')]=[];}}if(stopped){logger[_0x7cda('0x5b')]('Abort\x20parser');_0x57f159['abort']();}}catch(_0x146417){handleError(_0x98849[_0x7cda('0x83')][_0x5a13ae],{'code':_0x7cda('0x97'),'message':_0x146417['message']});logger['error']('step',_0x146417[_0x7cda('0x5e')]);}},'complete':function(){try{var _0x4a841d=[];var _0x3d3ab5=[];var _0x12a6f4=_0x7cda('0x3b');if(_0x16cb19[_0x7cda('0x98')]&&_0x16cb19[_0x7cda('0x98')][_0x7cda('0x1b')]){_0x12a6f4='cm_contacts_'+_0x4e1e39;_0x4a841d[_0x7cda('0x1c')](_0x7cda('0x99')+_0x12a6f4+_0x7cda('0x9a'));}tmp_campaigns=_0x7cda('0x9b')+_0x4e1e39;tmp_voice_queues=_0x7cda('0x9c')+_0x4e1e39;_0x3d3ab5['push'](_0x7cda('0x99')+tmp_campaigns+_0x7cda('0x9d'));_0x3d3ab5[_0x7cda('0x1c')](_0x7cda('0x99')+tmp_voice_queues+_0x7cda('0x9d'));BPromise['each'](_0x3d3ab5,handleTZQuery)[_0x7cda('0x1a')](function(_0x4e3ba4){updateTzCampaigns(_0x16cb19[_0x7cda('0x34')])[_0x7cda('0x1a')](function(_0x5a5e61){updateTzVoiceQueues(_0x16cb19[_0x7cda('0x34')])['then'](function(_0x9a0828){if(hasTZ)_0x1e78ff=_0x1e78ff[_0x7cda('0x88')](_0x7cda('0x6f'),_0x7cda('0x9e'));var _0x1d9f7c=util['format'](_0x7cda('0x9f'),_0x23b496,_0x12a6f4,_0x1e78ff,_0x16cb19[_0x7cda('0x34')],_0x16cb19['CompanyId']||null,NOW,NOW);if(_[_0x7cda('0x1f')](_0x2b1c10[_0x7cda('0x32')])){_0x1d9f7c+=',\x20scheduledAt\x20=\x20NOW()';}_0x4a841d[_0x7cda('0x1c')](_0x1d9f7c);if(_0x16cb19[_0x7cda('0x98')]&&_0x16cb19[_0x7cda('0x98')][_0x7cda('0x1b')]){_0x4a841d[_0x7cda('0x1c')](insertCmContact(_0x16cb19[_0x7cda('0x34')],_0x12a6f4,_0x16cb19[_0x7cda('0x98')],_0x2b1c10));_0x4a841d[_0x7cda('0x1c')](_0x7cda('0xa0')+_0x12a6f4+';');}BPromise['each'](_0x4a841d,handleQuery)['then'](function(_0x4beae4){BPromise[_0x7cda('0x1e')]([handleAdditionalPhones()])[_0x7cda('0x1a')](function(){_0x4a841d=[];for(var _0x181915=0x0;_0x181915\x20\x20');}var _0x4b8f2a=path[_0x7cda('0x13')](config[_0x7cda('0x78')],'server/files/tmp',process[_0x7cda('0xac')][0x2]);if(!fs[_0x7cda('0xad')](_0x4b8f2a)){throw new Error(_0x7cda('0xae'));}var _0x369599={};try{_0x369599=JSON[_0x7cda('0x81')](process[_0x7cda('0xac')][0x3]);if(!_0x369599[_0x7cda('0x76')]){throw new Error(_0x7cda('0xaf'));}if(!_0x369599[_0x7cda('0x76')]['phone']){throw new Error(_0x7cda('0xb0'));}if(!_0x369599['binding'][_0x7cda('0x91')]){throw new Error(_0x7cda('0xb1'));}var _0x286a32=0x0;if(_0x369599['binding']['UserId']){_0x286a32=0x1;}if(!_0x369599[_0x7cda('0x34')]){throw new Error(_0x7cda('0xb2'));}}catch(_0x34b98b){throw new Error('body\x20id\x20mandatory');}var _0x30b1c0=[];try{_0x30b1c0=_[_0x7cda('0xb3')](JSON[_0x7cda('0x81')](process[_0x7cda('0xac')][0x4]),'id');}catch(_0x5a6ba9){logger[_0x7cda('0x5b')](_0x7cda('0xb4'));}main(_0x4b8f2a,_0x369599,_0x30b1c0,_0x286a32);}validate();process['on'](_0x7cda('0xb5'),handleStop);process['on'](_0x7cda('0xb6'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/import/cm/csvUpdates.js b/server/components/import/cm/csvUpdates.js index 658729c..cc39d63 100644 --- a/server/components/import/cm/csvUpdates.js +++ b/server/components/import/cm/csvUpdates.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f9b=['.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','select\x20*\x20from\x20','spread','length','isNil','push','then','catch','error','message','AdditionalPhones','split','filter','CmContactHasItem','findOne','update','create','inserted','CmContact','CmHopper','phone','cm_contacts.phone','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','fromQuery','scheduledat','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','\x22onlyIfOpen\x22','toString','into','cm_hopper_black','ContactId','ListId\x20=\x20?','\x20=\x20?','cm_hopper.id','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','exit','errors','code','sequelize','main','stringify','send','start','clone','.csv','name','_description','writeFileSync','parse','createReadStream','data','rows','find','YYYY-MM-DD\x20HH:mm:ss','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','isValid','\x20not\x20specified','hasOwnProperty','trim','itemTypeId','description','replace','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','step','CREATE\x20TABLE\x20','CIS\x20len','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','each','all','contactId','orderBy','DROP\x20TABLE\x20','finish','affectedRows','unlink','argv','root','binding','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','papaparse','bluebird','moment','../../../config/environment','../../../config/logger','import','defaults','redis','localhost','socket.io-emitter','cm_contacts_temp_','format','select','field','from','join'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x3f9b,0x11e));var _0xb3f9=function(_0x14be32,_0x308543){_0x14be32=_0x14be32-0x0;var _0x4b9924=_0x3f9b[_0x14be32];return _0x4b9924;};'use strict';var fs=require('fs');var path=require('path');var _=require('lodash');var Papa=require(_0xb3f9('0x0'));var util=require('util');var BPromise=require(_0xb3f9('0x1'));var moment=require(_0xb3f9('0x2'));var squel=require('squel');var Redis=require('ioredis');var db=require('../../../mysqldb')['db'];var config=require(_0xb3f9('0x3'));var logger=require(_0xb3f9('0x4'))(_0xb3f9('0x5'));config['redis']=_[_0xb3f9('0x6')](config[_0xb3f9('0x7')],{'host':_0xb3f9('0x8'),'port':0x18eb});var socket=require(_0xb3f9('0x9'))(new Redis(config[_0xb3f9('0x7')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var tempTableName=_0xb3f9('0xa')+moment()[_0xb3f9('0xb')]('YYYYMMDDHHmmss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x2fba79){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'](_0x2fba79);}function selectNotIn(_0x488a7b,_0x877c5e,_0x234824,_0x22981c,_0x18d43f){return squel[_0xb3f9('0xc')]()[_0xb3f9('0xd')]('phone')[_0xb3f9('0xe')](_0x22981c)[_0xb3f9('0xf')](_0x877c5e,null,_0x877c5e+_0xb3f9('0x10')+_0x22981c+'.'+_0x234824)[_0xb3f9('0x11')](_0x22981c+'.'+_0x234824+_0xb3f9('0x12')+_0x488a7b+'.'+_0x234824)[_0xb3f9('0x11')](_0x877c5e+_0xb3f9('0x13')+_0x18d43f[_0xb3f9('0xf')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x590d44,_0x329aa3){promisesAdditionalPhones=[];promisesContact=[];return db['sequelize']['query'](_0xb3f9('0x14')+tempTableName)[_0xb3f9('0x15')](function(_0x171378){if(_0x171378!==null){var _0xc998cf=[];for(var _0x455479=0x0;_0x455479<_0x171378[_0xb3f9('0x16')];_0x455479++){var _0xeba6be=_0x171378[_0x455479];if(!_[_0xb3f9('0x17')](_0xeba6be['phone'])){if(!_[_0xb3f9('0x17')](_0xeba6be['AdditionalPhones']))_0xc998cf['push'](insertAdditionalPhones(_0xeba6be));promisesContact[_0xb3f9('0x18')]({'contact':_0xeba6be});}}}Promise['all'](_0xc998cf)[_0xb3f9('0x19')](function(){_0x590d44({'val':0x1});});})[_0xb3f9('0x1a')](function(_0x4415c3){logger[_0xb3f9('0x1b')](_0x4415c3[_0xb3f9('0x1c')]);});});}function insertAdditionalPhones(_0x23dc0f){return new Promise(function(_0x4b7da0,_0x51b607){var _0x4cfb17=_0x23dc0f[_0xb3f9('0x1d')];if(_[_0xb3f9('0x17')](_0x4cfb17))_0x51b607({'val':0x0});else{var _0x2b65cf=_0x4cfb17['split'](';');var _0x53f664=[];orderBy=0x0;for(var _0x3446ea=0x0;_0x3446ea<_0x2b65cf[_0xb3f9('0x16')];_0x3446ea++){_0x53f664[_0xb3f9('0x18')](splitAdditionalPhone(_0x23dc0f['id'],_0x2b65cf[_0x3446ea]));}Promise['all'](_0x53f664)[_0xb3f9('0x19')](function(){_0x4b7da0({'val':_0x2b65cf['length']});});}});}function splitAdditionalPhone(_0x20e804,_0x1e0ab3){return new Promise(function(_0x1d3683,_0x539f7a){var _0x4a20ea=_0x1e0ab3[_0xb3f9('0x1e')](':');var _0x378271=_0x4a20ea[0x0];var _0x4d70e6=_0x4a20ea[0x1];if(_0x4d70e6!==''){var _0x1cc41c=_0x4d70e6[_0xb3f9('0x1e')]('|');var _0x581510=[];for(var _0x317e48=0x0;_0x317e48<_0x1cc41c[_0xb3f9('0x16')];_0x317e48++){if(_0x1cc41c[_0x317e48]!==''){var _0x138f3d=_[_0xb3f9('0x1f')](promisesAdditionalPhones,{'contactId':_0x20e804,'phone':_0x1cc41c[_0x317e48]});if(_0x138f3d[_0xb3f9('0x16')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x20e804,'contactTypeId':_0x378271,'phone':_0x1cc41c[_0x317e48],'orderBy':orderBy});}}}_0x1d3683({'ok':0x1});}else _0x1d3683({'res':0x0});});}function createAdditionalPhone(_0x73d0a3,_0x35912b,_0x2939f8,_0x1d94e0){var _0x3d8c58='';var _0x1b952f='';var _0xd634f7=_0x2939f8[_0xb3f9('0x1e')]('§');_0x3d8c58=_0xd634f7[0x0];if(_0xd634f7[_0xb3f9('0x16')]==0x2)_0x1b952f=_0xd634f7[0x1];return new Promise(function(_0x392087,_0x2752c5){return db[_0xb3f9('0x20')][_0xb3f9('0x21')]({'where':{'CmContactId':_0x73d0a3,'item':_0x3d8c58}})['then'](function(_0x5d7762){if(_0x5d7762){return db['CmContactHasItem'][_0xb3f9('0x22')]({'ItemTypeId':_0x35912b,'description':_0x1b952f,'OrderBy':_0x1d94e0},{'where':{'CmContactId':_0x73d0a3,'item':_0x3d8c58}})['then'](function(_0x47b88a){_0x392087({'res':'updated'});});}else{return db[_0xb3f9('0x20')][_0xb3f9('0x23')]({'CmContactId':_0x73d0a3,'item':_0x3d8c58,'ItemTypeId':_0x35912b,'description':_0x1b952f,'OrderBy':_0x1d94e0,'ItemClass':'PHONE'})[_0xb3f9('0x19')](function(_0x19919a){_0x392087({'res':_0xb3f9('0x24')});});}});});}function updateContact(_0x5e112b){return new Promise(function(_0x504a17,_0x45c766){var _0x4ec2e8=_0x5e112b['id'];delete _0x5e112b['id'];return db[_0xb3f9('0x25')][_0xb3f9('0x22')](_0x5e112b,{'where':{'id':_0x4ec2e8}})[_0xb3f9('0x19')](function(_0x546796){updatedRows+=0x1;return db[_0xb3f9('0x26')][_0xb3f9('0x22')]({'phone':_0x5e112b[_0xb3f9('0x27')]},{'where':{'ContactId':_0x4ec2e8}})['then'](function(_0x162773){_0x504a17({'ret':'OK'});});});});}function insertCmHopper(_0x21364b,_0x5c45e9,_0x21f16a,_0x55f365,_0x4ecbf3){var _0x273bef=[_0xb3f9('0x28'),'cm_contacts.scheduledat','cm_contacts.id',_0xb3f9('0x29'),_0x5c45e9+'.'+_0x55f365,'cm_contacts.createdAt',_0xb3f9('0x2a'),_0xb3f9('0x2b'),_0xb3f9('0x2c'),'\x22'+_0x4ecbf3+'\x22'];return squel[_0xb3f9('0x2d')]()['into']('cm_hopper')[_0xb3f9('0x2e')](['phone',_0xb3f9('0x2f'),'ContactId',_0xb3f9('0x30'),_0x55f365,_0xb3f9('0x31'),_0xb3f9('0x32'),_0xb3f9('0x33'),_0xb3f9('0x34'),_0xb3f9('0x35')],squel[_0xb3f9('0xc')]()[_0xb3f9('0x36')](_0x273bef)[_0xb3f9('0xe')](_0x5c45e9)['join'](_0xb3f9('0x37'),null,_0xb3f9('0x38')+_0x5c45e9+_0xb3f9('0x39'))[_0xb3f9('0xf')](_0x21f16a,null,_0x21f16a+_0xb3f9('0x10')+_0x5c45e9+'.'+_0x55f365)[_0xb3f9('0x11')](_0x5c45e9+_0xb3f9('0x3a'),_0x21364b)['where'](_0xb3f9('0x3b'),NOW)[_0xb3f9('0x11')](_0xb3f9('0x3c'),selectNotIn(_0x5c45e9,_0x21f16a,_0x55f365,_0xb3f9('0x3d'),[_0xb3f9('0x3e'),_0xb3f9('0x3f')]))[_0xb3f9('0x11')](_0xb3f9('0x3c'),selectNotIn(_0x5c45e9,_0x21f16a,_0x55f365,'cm_hopper',[_0xb3f9('0x3e')])))[_0xb3f9('0x40')]();}function insertCmHopperBlack(_0x2a4522,_0x5e8457,_0x2db6cb,_0x25d4e7){var _0x1673a3=[_0xb3f9('0x28'),'cm_contacts.id',_0xb3f9('0x29'),_0x5e8457+'.'+_0x25d4e7,'cm_contacts.createdAt',_0xb3f9('0x2a')];return squel[_0xb3f9('0x2d')]()[_0xb3f9('0x41')](_0xb3f9('0x42'))[_0xb3f9('0x2e')]([_0xb3f9('0x27'),_0xb3f9('0x43'),_0xb3f9('0x30'),_0x25d4e7,_0xb3f9('0x31'),'updatedAt'],squel['select']()[_0xb3f9('0x36')](_0x1673a3)[_0xb3f9('0xe')](_0x5e8457)['join'](_0xb3f9('0x37'),null,_0xb3f9('0x38')+_0x5e8457+_0xb3f9('0x39'))['join'](_0x2db6cb,null,_0x2db6cb+_0xb3f9('0x10')+_0x5e8457+'.'+_0x25d4e7)['where'](_0x5e8457+_0xb3f9('0x3a'),_0x2a4522)['where'](_0xb3f9('0x3b'),NOW)[_0xb3f9('0x11')](_0xb3f9('0x3c'),squel[_0xb3f9('0xc')]()[_0xb3f9('0xd')](_0xb3f9('0x27'))['from'](_0xb3f9('0x42'))[_0xb3f9('0x11')](_0xb3f9('0x44'),_0x2a4522)[_0xb3f9('0x11')](_0x25d4e7+_0xb3f9('0x45'),_0x5e8457+'.'+_0x25d4e7)))[_0xb3f9('0x40')]();}function insertCmHopperAdditionalPhones(_0x183b48){var _0x16709b=[_0xb3f9('0x46'),'cm_contact_has_items.item',_0xb3f9('0x47'),_0xb3f9('0x48'),_0xb3f9('0x49')];return squel['insert']()[_0xb3f9('0x41')]('cm_hopper_additional_phones')[_0xb3f9('0x2e')]([_0xb3f9('0x4a'),_0xb3f9('0x27'),_0xb3f9('0x4b'),'createdAt',_0xb3f9('0x32')],squel[_0xb3f9('0xc')]()[_0xb3f9('0x36')](_0x16709b)[_0xb3f9('0xe')](_0xb3f9('0x3d'))['join'](_0xb3f9('0x37'),null,_0xb3f9('0x4c'))[_0xb3f9('0xf')](_0xb3f9('0x4d'),null,_0xb3f9('0x4e'))[_0xb3f9('0x11')](_0xb3f9('0x4f'),_0x183b48)['where'](_0xb3f9('0x3b'),NOW))[_0xb3f9('0x40')]();}function insertCmContact(_0x136362,_0x46f6f0,_0x20070f,_0x4e35b6){var _0x2469f5=_[_0xb3f9('0x50')](_[_0xb3f9('0x51')](_0x4e35b6),[_0xb3f9('0x30'),'CompanyId',_0xb3f9('0x31'),_0xb3f9('0x32')]);return squel[_0xb3f9('0x2d')]()['into'](_0xb3f9('0x37'))[_0xb3f9('0x2e')](_0x2469f5,squel[_0xb3f9('0xc')]()[_0xb3f9('0x36')](_0x2469f5)[_0xb3f9('0xe')](_0x46f6f0)[_0xb3f9('0x11')]('('+_0x20070f[_0xb3f9('0xf')](',')+_0xb3f9('0x52'),squel[_0xb3f9('0xc')]()[_0xb3f9('0x36')](_0x20070f)[_0xb3f9('0xe')](_0xb3f9('0x37'))[_0xb3f9('0x11')](_0xb3f9('0x44'),_0x136362))['where'](_0xb3f9('0x53'),squel[_0xb3f9('0xc')]()[_0xb3f9('0xd')](_0xb3f9('0x54'),_0xb3f9('0x55'))[_0xb3f9('0xe')](_0x46f6f0)[_0xb3f9('0x56')](_0x20070f['join'](','))))[_0xb3f9('0x40')]();}function handleStop(){logger[_0xb3f9('0x57')](_0xb3f9('0x58'));stopped=!![];}function handleUncaughtException(_0x1dd3f3){logger[_0xb3f9('0x1b')](_0x1dd3f3['message']);process[_0xb3f9('0x59')](0x1);}function handleError(_0x5a0e65,_0x16729e){stats[_0xb3f9('0x5a')][_0xb3f9('0x18')]({'name':_0x16729e[_0xb3f9('0x5b')],'message':_0x16729e[_0xb3f9('0x1c')],'row':_0x5a0e65});}function handleQuery(_0x43f449){logger['info'](_0x43f449);return db[_0xb3f9('0x5c')]['query'](_0x43f449)[_0xb3f9('0x15')](function(_0x3e3775){results[_0xb3f9('0x18')](_0x3e3775);})[_0xb3f9('0x1a')](function(_0x3d195e){logger[_0xb3f9('0x1b')](_0x3d195e[_0xb3f9('0x1c')]);});}function main(_0x4c7335,_0x9fc313,_0x20f128,_0xebc167){logger['info'](_0xb3f9('0x5d'),_0x4c7335,JSON[_0xb3f9('0x5e')](_0x9fc313));process[_0xb3f9('0x5f')](_0xb3f9('0x60'));var _0xf3eda2=_0x9fc313['binding'];var _0x555693=_[_0xb3f9('0x61')](_0xf3eda2);var _0x4b36f9=_0x9fc313['socket_timestamp'];var _0xf2a3a3=path['join'](config['root'],'server/files/tmp',_0x4b36f9+_0xb3f9('0x62'));logger['info']('body',_0x9fc313);db['ContactItemType']['findAll']({'raw':!![],'attributes':['id','name']})[_0xb3f9('0x19')](function(_0x54f2de){for(var _0x6a3823=0x0;_0x6a3823<_0x54f2de[_0xb3f9('0x16')];_0x6a3823++){if(_0x54f2de[_0x6a3823]['name']in _0xf3eda2){contactItemTypes[_0xb3f9('0x18')](_0x54f2de[_0x6a3823]);delete _0x555693[_0x54f2de[_0x6a3823]['name']];hasAdditionalPhones=!![];}for(var _0x21d039 in _0xf3eda2){if(_0x54f2de[_0x6a3823][_0xb3f9('0x63')]+_0xb3f9('0x64')===_0x21d039){phoneDescriptions[_0xb3f9('0x18')]({'itemTypeId':_0x54f2de[_0x6a3823]['id'],'description':_0x21d039});delete _0x555693[_0x21d039];}}}if(hasAdditionalPhones)_0x555693[_0xb3f9('0x1d')]='';var _0x5eb0a3=_[_0xb3f9('0x51')](_0x555693)['join']();logger[_0xb3f9('0x57')]('header',_0x5eb0a3);fs[_0xb3f9('0x65')](_0xf2a3a3,_0x5eb0a3+'\x0a');Papa[_0xb3f9('0x66')](fs[_0xb3f9('0x67')](_0x4c7335),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3d01e6,_0x4c0ac8){try{for(var _0x440c6e=0x0,_0x334e72=[];_0x440c6e<_0x3d01e6[_0xb3f9('0x68')][_0xb3f9('0x16')];_0x440c6e++){stats[_0xb3f9('0x69')]+=0x1;if(_0x3d01e6['errors'][_0x440c6e]){handleError(_0x3d01e6[_0xb3f9('0x68')][_0x440c6e],_0x3d01e6['errors'][_0x440c6e]);}else{var _0x14c39c=[];var _0x484379=[];var _0x162a09={};for(var _0x22c9b8 in _0xf3eda2){let _0x13c5ca=contactItemTypes[_0xb3f9('0x6a')](_0x14cd80=>_0x14cd80[_0xb3f9('0x63')]===_0x22c9b8);let _0x42fd1e=contactItemTypes[_0xb3f9('0x6a')](_0x4a2183=>_0x4a2183[_0xb3f9('0x63')]+_0xb3f9('0x64')===_0x22c9b8);if(_['isNil'](_0x13c5ca)&&_['isNil'](_0x42fd1e)){if(_0xf3eda2['hasOwnProperty'](_0x22c9b8)){if(_0x3d01e6[_0xb3f9('0x68')][_0x440c6e][_0xf3eda2[_0x22c9b8]]){var _0x6f3d0c=_['trim'](_0x3d01e6[_0xb3f9('0x68')][_0x440c6e][_0xf3eda2[_0x22c9b8]]['replace'](/"/g,'\x27'));switch(_0x22c9b8){case'scheduledat':var _0x4d5024=moment(_0x6f3d0c,_0xb3f9('0x6b'),!![]);if(_0x4d5024['isValid']()){_0x334e72[_0xb3f9('0x18')]('\x22'+_0x6f3d0c+'\x22');}else{_0x14c39c[_0xb3f9('0x18')](_0xb3f9('0x6c'));}break;case _0xb3f9('0x33'):var _0x2faabe=parseInt(_0x6f3d0c);_0x6f3d0c=_[_0xb3f9('0x6d')](_0x2faabe)||_0x2faabe<0x0||_0x2faabe>0x4?_0xebc167?0x3:0x2:_0x2faabe;_0x334e72[_0xb3f9('0x18')]('\x22'+_0x6f3d0c+'\x22');break;case _0xb3f9('0x34'):var _0x4e57fc=parseInt(_0x6f3d0c);if(_[_0xb3f9('0x6e')](_0x4e57fc)&&_[_0xb3f9('0x6f')](_0x20f128,_0x4e57fc)){_0x334e72['push']('\x22'+_0x4e57fc+'\x22');}else{_0x14c39c[_0xb3f9('0x18')](_0xb3f9('0x70'));}break;case _0xb3f9('0x71'):if(isEmail(_0x6f3d0c)){_0x334e72[_0xb3f9('0x18')]('\x22'+_0x6f3d0c+'\x22');}else{_0x14c39c['push'](_0xb3f9('0x72'));}break;case _0xb3f9('0x73'):var _0x4083a3=moment(_0x6f3d0c,_0xb3f9('0x74'),!![]);if(_0x4083a3[_0xb3f9('0x75')]()){_0x334e72[_0xb3f9('0x18')]('\x22'+_0x6f3d0c+'\x22');}else{_0x14c39c[_0xb3f9('0x18')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x334e72[_0xb3f9('0x18')]('\x22'+_0x6f3d0c+'\x22');}}else{switch(_0x22c9b8){case'firstName':case'phone':_0x14c39c[_0xb3f9('0x18')](_0x22c9b8+_0xb3f9('0x76'));break;default:_0x334e72[_0xb3f9('0x18')]('\x22\x22');}}}}else{var _0x4281ec='';if(!_[_0xb3f9('0x17')](_0x13c5ca)){if(!_0x162a09[_0xb3f9('0x77')](_0x13c5ca['id'])){for(var _0x26df38=0x0;_0x26df38<_0xf3eda2[_0x22c9b8]['length'];_0x26df38++){var _0x6f3d0c=_[_0xb3f9('0x78')](_0x3d01e6[_0xb3f9('0x68')][_0x440c6e][_0xf3eda2[_0x22c9b8][_0x26df38]]['replace'](/"/g,'\x27'));var _0x55cd44=phoneDescriptions[_0xb3f9('0x6a')](_0x160492=>_0x160492[_0xb3f9('0x79')]===_0x13c5ca['id']);if(!_['isNil'](_0x55cd44)){var _0x32fd02=_[_0xb3f9('0x78')](_0x3d01e6[_0xb3f9('0x68')][_0x440c6e][_0xf3eda2[_0x55cd44[_0xb3f9('0x7a')]][0x0]][_0xb3f9('0x7b')](/"/g,'\x27'));if(!_[_0xb3f9('0x17')](_0x32fd02))_0x6f3d0c=_0x6f3d0c+'§'+_0x32fd02;}if(_0x4281ec=='')_0x4281ec=_0x6f3d0c;else _0x4281ec+='|'+_0x6f3d0c;}_0x484379['push'](_0x13c5ca['id']+':'+_0x4281ec);_0x162a09[_0x13c5ca['id']]=0x1;}}}}if(hasAdditionalPhones){_0x334e72[_0xb3f9('0x18')]('\x22'+_0x484379[_0xb3f9('0xf')](';')+'\x22');}if(_0x14c39c[_0xb3f9('0x16')]){handleError(_0x3d01e6[_0xb3f9('0x68')][_0x440c6e],{'code':_0xb3f9('0x7c'),'message':_0x14c39c[_0xb3f9('0xf')]()});}else{fs[_0xb3f9('0x7d')](_0xf2a3a3,_0x334e72[_0xb3f9('0xf')]()+'\x0a');}_0x334e72=[];}if(!(stats[_0xb3f9('0x69')]%0xc8)){socket[_0xb3f9('0x7e')](_0xb3f9('0x7f')+_0x4b36f9,stats);stats['errors']=[];}}if(stopped){logger['info'](_0xb3f9('0x80'));_0x4c0ac8[_0xb3f9('0x81')]();}}catch(_0x13ffee){handleError(_0x3d01e6['data'][_0x440c6e],{'code':'SystemError','message':_0x13ffee['message']});logger[_0xb3f9('0x1b')](_0xb3f9('0x82'),_0x13ffee['message']);}},'complete':function(){try{var _0x145285=[];var _0x51277c=tempTableName;_0x145285[_0xb3f9('0x18')](_0xb3f9('0x83')+_0x51277c+'\x20LIKE\x20cm_contacts;');logger[_0xb3f9('0x57')](_0xb3f9('0x84'),contactItemTypes[_0xb3f9('0x16')]);var _0x13539a=util['format'](_0xb3f9('0x85'),_0xf2a3a3,_0x51277c,_0x5eb0a3,_0x9fc313[_0xb3f9('0x30')],_0x9fc313['CompanyId']||null,NOW,NOW);if(_[_0xb3f9('0x17')](_0xf3eda2[_0xb3f9('0x2f')])){_0x13539a+=',\x20scheduledAt\x20=\x20NOW()';}_0x145285[_0xb3f9('0x18')](_0x13539a);BPromise[_0xb3f9('0x86')](_0x145285,handleQuery)['then'](function(_0x5a81bd){BPromise[_0xb3f9('0x87')]([handleAdditionalPhones()])[_0xb3f9('0x19')](function(){_0x145285=[];for(var _0x59e30c=0x0;_0x59e30c\x20\x20');}var _0x3752ce=path[_0xb3f9('0xf')](config[_0xb3f9('0x8f')],'server/files/tmp',process[_0xb3f9('0x8e')][0x2]);if(!fs['existsSync'](_0x3752ce)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x3ff615={};try{_0x3ff615=JSON['parse'](process[_0xb3f9('0x8e')][0x3]);if(!_0x3ff615[_0xb3f9('0x90')]){throw new Error(_0xb3f9('0x91'));}var _0x1738b7=0x0;if(_0x3ff615['binding'][_0xb3f9('0x34')]){_0x1738b7=0x1;}if(!_0x3ff615[_0xb3f9('0x30')]){throw new Error(_0xb3f9('0x92'));}}catch(_0x13441c){throw new Error('body\x20id\x20mandatory');}var _0x10342d=[];try{_0x10342d=_[_0xb3f9('0x93')](JSON[_0xb3f9('0x66')](process[_0xb3f9('0x8e')][0x4]),'id');}catch(_0x44f39f){logger[_0xb3f9('0x57')](_0xb3f9('0x94'));}main(_0x3752ce,_0x3ff615,_0x10342d,_0x1738b7);}validate();process['on'](_0xb3f9('0x95'),handleStop);process['on'](_0xb3f9('0x96'),handleUncaughtException); \ No newline at end of file +var _0x199d=['complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','squel','../../../mysqldb','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','format','test','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','sequelize','query','select\x20*\x20from\x20','length','AdditionalPhones','push','all','then','catch','message','split','CmContactHasItem','update','create','PHONE','inserted','CmContact','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.UserId','into','cm_hopper','fromQuery','ListId','createdAt','updatedAt','priority','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_hopper_black','ListId\x20=\x20?','\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.updatedAt','insert','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','min_id','group','info','Received\x20SIGINT','error','exit','errors','code','stringify','send','binding','socket_timestamp','root','server/files/tmp','.csv','findAll','name','header','writeFileSync','parse','createReadStream','data','rows','isNil','hasOwnProperty','isValid','isNaN','UserId','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','itemTypeId','trim','description','replace','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','SystemError','step','\x20LIKE\x20cm_contacts;','CIS\x20len','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','scheduledat',',\x20scheduledAt\x20=\x20NOW()','contact','orderBy','each','affectedRows','unlink'];(function(_0x20fadb,_0x11f5b2){var _0x1f4708=function(_0x8ea21e){while(--_0x8ea21e){_0x20fadb['push'](_0x20fadb['shift']());}};_0x1f4708(++_0x11f5b2);}(_0x199d,0x13d));var _0xd199=function(_0x4ac60a,_0x503a99){_0x4ac60a=_0x4ac60a-0x0;var _0x4b22e8=_0x199d[_0x4ac60a];return _0x4b22e8;};'use strict';var fs=require('fs');var path=require(_0xd199('0x0'));var _=require(_0xd199('0x1'));var Papa=require(_0xd199('0x2'));var util=require(_0xd199('0x3'));var BPromise=require(_0xd199('0x4'));var moment=require('moment');var squel=require(_0xd199('0x5'));var Redis=require('ioredis');var db=require(_0xd199('0x6'))['db'];var config=require(_0xd199('0x7'));var logger=require(_0xd199('0x8'))('import');config[_0xd199('0x9')]=_[_0xd199('0xa')](config['redis'],{'host':_0xd199('0xb'),'port':0x18eb});var socket=require(_0xd199('0xc'))(new Redis(config[_0xd199('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()['format'](_0xd199('0xd'));var tempTableName=_0xd199('0xe')+moment()[_0xd199('0xf')]('YYYYMMDDHHmmss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x44b187){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))*$/[_0xd199('0x10')](_0x44b187);}function selectNotIn(_0x49c25e,_0x32c5bc,_0x58a748,_0x438a3f,_0x98e9af){return squel[_0xd199('0x11')]()[_0xd199('0x12')](_0xd199('0x13'))[_0xd199('0x14')](_0x438a3f)[_0xd199('0x15')](_0x32c5bc,null,_0x32c5bc+_0xd199('0x16')+_0x438a3f+'.'+_0x58a748)[_0xd199('0x17')](_0x438a3f+'.'+_0x58a748+_0xd199('0x18')+_0x49c25e+'.'+_0x58a748)[_0xd199('0x17')](_0x32c5bc+'.dialCheckDuplicateType\x20IN\x20('+_0x98e9af[_0xd199('0x15')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x5e6160,_0x3568b7){promisesAdditionalPhones=[];promisesContact=[];return db[_0xd199('0x19')][_0xd199('0x1a')](_0xd199('0x1b')+tempTableName)['spread'](function(_0x1e8132){if(_0x1e8132!==null){var _0xe48c1b=[];for(var _0x1251a6=0x0;_0x1251a6<_0x1e8132[_0xd199('0x1c')];_0x1251a6++){var _0x4354d1=_0x1e8132[_0x1251a6];if(!_['isNil'](_0x4354d1[_0xd199('0x13')])){if(!_['isNil'](_0x4354d1[_0xd199('0x1d')]))_0xe48c1b[_0xd199('0x1e')](insertAdditionalPhones(_0x4354d1));promisesContact[_0xd199('0x1e')]({'contact':_0x4354d1});}}}Promise[_0xd199('0x1f')](_0xe48c1b)[_0xd199('0x20')](function(){_0x5e6160({'val':0x1});});})[_0xd199('0x21')](function(_0x2c7fa6){logger['error'](_0x2c7fa6[_0xd199('0x22')]);});});}function insertAdditionalPhones(_0x132733){return new Promise(function(_0xce732f,_0x1a4570){var _0x487ace=_0x132733[_0xd199('0x1d')];if(_['isNil'](_0x487ace))_0x1a4570({'val':0x0});else{var _0x558744=_0x487ace[_0xd199('0x23')](';');var _0x19e6b1=[];orderBy=0x0;for(var _0x102912=0x0;_0x102912<_0x558744['length'];_0x102912++){_0x19e6b1['push'](splitAdditionalPhone(_0x132733['id'],_0x558744[_0x102912]));}Promise[_0xd199('0x1f')](_0x19e6b1)[_0xd199('0x20')](function(){_0xce732f({'val':_0x558744['length']});});}});}function splitAdditionalPhone(_0x3297d6,_0x429a37){return new Promise(function(_0x2d5beb,_0x11a57f){var _0x360753=_0x429a37[_0xd199('0x23')](':');var _0xdb19ca=_0x360753[0x0];var _0x3f5b4c=_0x360753[0x1];if(_0x3f5b4c!==''){var _0x59408c=_0x3f5b4c['split']('|');var _0x5a29cd=[];for(var _0x2dd652=0x0;_0x2dd652<_0x59408c[_0xd199('0x1c')];_0x2dd652++){if(_0x59408c[_0x2dd652]!==''){var _0x9df93b=_['filter'](promisesAdditionalPhones,{'contactId':_0x3297d6,'phone':_0x59408c[_0x2dd652]});if(_0x9df93b['length']==0x0){orderBy++;promisesAdditionalPhones[_0xd199('0x1e')]({'contactId':_0x3297d6,'contactTypeId':_0xdb19ca,'phone':_0x59408c[_0x2dd652],'orderBy':orderBy});}}}_0x2d5beb({'ok':0x1});}else _0x2d5beb({'res':0x0});});}function createAdditionalPhone(_0x46c586,_0x2a3bb4,_0x263390,_0x232b5d){var _0x18f61d='';var _0x3c1269='';var _0x1bcbe1=_0x263390[_0xd199('0x23')]('§');_0x18f61d=_0x1bcbe1[0x0];if(_0x1bcbe1[_0xd199('0x1c')]==0x2)_0x3c1269=_0x1bcbe1[0x1];return new Promise(function(_0x564110,_0x1caa61){return db['CmContactHasItem']['findOne']({'where':{'CmContactId':_0x46c586,'item':_0x18f61d}})[_0xd199('0x20')](function(_0x444380){if(_0x444380){return db[_0xd199('0x24')][_0xd199('0x25')]({'ItemTypeId':_0x2a3bb4,'description':_0x3c1269,'OrderBy':_0x232b5d},{'where':{'CmContactId':_0x46c586,'item':_0x18f61d}})[_0xd199('0x20')](function(_0x364343){_0x564110({'res':'updated'});});}else{return db[_0xd199('0x24')][_0xd199('0x26')]({'CmContactId':_0x46c586,'item':_0x18f61d,'ItemTypeId':_0x2a3bb4,'description':_0x3c1269,'OrderBy':_0x232b5d,'ItemClass':_0xd199('0x27')})[_0xd199('0x20')](function(_0x50ab5b){_0x564110({'res':_0xd199('0x28')});});}});});}function updateContact(_0x13aabd){return new Promise(function(_0x5a9bf4,_0x4df41d){var _0x584af8=_0x13aabd['id'];delete _0x13aabd['id'];return db[_0xd199('0x29')][_0xd199('0x25')](_0x13aabd,{'where':{'id':_0x584af8}})[_0xd199('0x20')](function(_0x542ad9){updatedRows+=0x1;return db['CmHopper'][_0xd199('0x25')]({'phone':_0x13aabd['phone']},{'where':{'ContactId':_0x584af8}})[_0xd199('0x20')](function(_0x31f34d){_0x5a9bf4({'ret':'OK'});});});});}function insertCmHopper(_0x3abae,_0x3a5032,_0x52dac9,_0x2ea308,_0x38a98a){var _0x17c945=[_0xd199('0x2a'),_0xd199('0x2b'),_0xd199('0x2c'),_0xd199('0x2d'),_0x3a5032+'.'+_0x2ea308,_0xd199('0x2e'),'cm_contacts.updatedAt','cm_contacts.priority',_0xd199('0x2f'),'\x22'+_0x38a98a+'\x22'];return squel['insert']()[_0xd199('0x30')](_0xd199('0x31'))[_0xd199('0x32')]([_0xd199('0x13'),'scheduledat','ContactId',_0xd199('0x33'),_0x2ea308,_0xd199('0x34'),_0xd199('0x35'),_0xd199('0x36'),'UserId',_0xd199('0x37')],squel[_0xd199('0x11')]()[_0xd199('0x38')](_0x17c945)[_0xd199('0x14')](_0x3a5032)[_0xd199('0x15')](_0xd199('0x39'),null,_0xd199('0x3a')+_0x3a5032+_0xd199('0x3b'))[_0xd199('0x15')](_0x52dac9,null,_0x52dac9+'.id\x20=\x20'+_0x3a5032+'.'+_0x2ea308)['where'](_0x3a5032+_0xd199('0x3c'),_0x3abae)[_0xd199('0x17')](_0xd199('0x3d'),NOW)[_0xd199('0x17')](_0xd199('0x3e'),selectNotIn(_0x3a5032,_0x52dac9,_0x2ea308,_0xd199('0x31'),[_0xd199('0x3f'),_0xd199('0x40')]))[_0xd199('0x17')](_0xd199('0x3e'),selectNotIn(_0x3a5032,_0x52dac9,_0x2ea308,_0xd199('0x31'),[_0xd199('0x3f')])))[_0xd199('0x41')]();}function insertCmHopperBlack(_0x56208a,_0x97eeae,_0x54dcd4,_0x14874d){var _0x2dbd25=[_0xd199('0x2a'),_0xd199('0x2c'),_0xd199('0x2d'),_0x97eeae+'.'+_0x14874d,_0xd199('0x2e'),'cm_contacts.updatedAt'];return squel['insert']()[_0xd199('0x30')](_0xd199('0x42'))[_0xd199('0x32')]([_0xd199('0x13'),'ContactId',_0xd199('0x33'),_0x14874d,_0xd199('0x34'),_0xd199('0x35')],squel[_0xd199('0x11')]()[_0xd199('0x38')](_0x2dbd25)[_0xd199('0x14')](_0x97eeae)[_0xd199('0x15')]('cm_contacts',null,_0xd199('0x3a')+_0x97eeae+'.CmListId')['join'](_0x54dcd4,null,_0x54dcd4+_0xd199('0x16')+_0x97eeae+'.'+_0x14874d)[_0xd199('0x17')](_0x97eeae+_0xd199('0x3c'),_0x56208a)[_0xd199('0x17')](_0xd199('0x3d'),NOW)['where'](_0xd199('0x3e'),squel[_0xd199('0x11')]()['field'](_0xd199('0x13'))[_0xd199('0x14')]('cm_hopper_black')[_0xd199('0x17')](_0xd199('0x43'),_0x56208a)[_0xd199('0x17')](_0x14874d+_0xd199('0x44'),_0x97eeae+'.'+_0x14874d)))[_0xd199('0x41')]();}function insertCmHopperAdditionalPhones(_0x1f81b4){var _0xcc9ca1=[_0xd199('0x45'),_0xd199('0x46'),_0xd199('0x47'),'cm_contact_has_items.createdAt',_0xd199('0x48')];return squel[_0xd199('0x49')]()[_0xd199('0x30')]('cm_hopper_additional_phones')[_0xd199('0x32')](['CmHopperId',_0xd199('0x13'),_0xd199('0x4a'),'createdAt',_0xd199('0x35')],squel[_0xd199('0x11')]()[_0xd199('0x38')](_0xcc9ca1)['from'](_0xd199('0x31'))[_0xd199('0x15')](_0xd199('0x39'),null,_0xd199('0x4b'))[_0xd199('0x15')](_0xd199('0x4c'),null,_0xd199('0x4d'))[_0xd199('0x17')](_0xd199('0x4e'),_0x1f81b4)[_0xd199('0x17')](_0xd199('0x3d'),NOW))[_0xd199('0x41')]();}function insertCmContact(_0xc8a5d0,_0x465916,_0xeb7da3,_0x21ceeb){var _0x40ddde=_[_0xd199('0x4f')](_[_0xd199('0x50')](_0x21ceeb),[_0xd199('0x33'),_0xd199('0x51'),'createdAt',_0xd199('0x35')]);return squel[_0xd199('0x49')]()[_0xd199('0x30')]('cm_contacts')[_0xd199('0x32')](_0x40ddde,squel['select']()['fields'](_0x40ddde)[_0xd199('0x14')](_0x465916)[_0xd199('0x17')]('('+_0xeb7da3[_0xd199('0x15')](',')+_0xd199('0x52'),squel[_0xd199('0x11')]()[_0xd199('0x38')](_0xeb7da3)[_0xd199('0x14')]('cm_contacts')[_0xd199('0x17')](_0xd199('0x43'),_0xc8a5d0))[_0xd199('0x17')](_0xd199('0x53'),squel[_0xd199('0x11')]()[_0xd199('0x12')]('MIN(id)',_0xd199('0x54'))[_0xd199('0x14')](_0x465916)[_0xd199('0x55')](_0xeb7da3[_0xd199('0x15')](','))))['toString']();}function handleStop(){logger[_0xd199('0x56')](_0xd199('0x57'));stopped=!![];}function handleUncaughtException(_0xa0d838){logger[_0xd199('0x58')](_0xa0d838[_0xd199('0x22')]);process[_0xd199('0x59')](0x1);}function handleError(_0x38e6e7,_0xcaf641){stats[_0xd199('0x5a')][_0xd199('0x1e')]({'name':_0xcaf641[_0xd199('0x5b')],'message':_0xcaf641[_0xd199('0x22')],'row':_0x38e6e7});}function handleQuery(_0x12ae3a){logger[_0xd199('0x56')](_0x12ae3a);return db['sequelize'][_0xd199('0x1a')](_0x12ae3a)['spread'](function(_0x3dd8d4){results[_0xd199('0x1e')](_0x3dd8d4);})[_0xd199('0x21')](function(_0x3e291e){logger[_0xd199('0x58')](_0x3e291e[_0xd199('0x22')]);});}function main(_0x172a68,_0x593f52,_0x599152,_0x1198c8){logger[_0xd199('0x56')]('main',_0x172a68,JSON[_0xd199('0x5c')](_0x593f52));process[_0xd199('0x5d')]('start');var _0x563e68=_0x593f52[_0xd199('0x5e')];var _0x5379ef=_['clone'](_0x563e68);var _0x65317a=_0x593f52[_0xd199('0x5f')];var _0x19dbdb=path[_0xd199('0x15')](config[_0xd199('0x60')],_0xd199('0x61'),_0x65317a+_0xd199('0x62'));logger[_0xd199('0x56')]('body',_0x593f52);db['ContactItemType'][_0xd199('0x63')]({'raw':!![],'attributes':['id','name']})[_0xd199('0x20')](function(_0x4481f0){for(var _0x17d43c=0x0;_0x17d43c<_0x4481f0[_0xd199('0x1c')];_0x17d43c++){if(_0x4481f0[_0x17d43c][_0xd199('0x64')]in _0x563e68){contactItemTypes['push'](_0x4481f0[_0x17d43c]);delete _0x5379ef[_0x4481f0[_0x17d43c][_0xd199('0x64')]];hasAdditionalPhones=!![];}for(var _0x10c518 in _0x563e68){if(_0x4481f0[_0x17d43c][_0xd199('0x64')]+'_description'===_0x10c518){phoneDescriptions[_0xd199('0x1e')]({'itemTypeId':_0x4481f0[_0x17d43c]['id'],'description':_0x10c518});delete _0x5379ef[_0x10c518];}}}if(hasAdditionalPhones)_0x5379ef[_0xd199('0x1d')]='';var _0x120305=_[_0xd199('0x50')](_0x5379ef)['join']();logger['info'](_0xd199('0x65'),_0x120305);fs[_0xd199('0x66')](_0x19dbdb,_0x120305+'\x0a');Papa[_0xd199('0x67')](fs[_0xd199('0x68')](_0x172a68),{'header':!![],'skipEmptyLines':!![],'step':function(_0x40c228,_0x2b2459){try{for(var _0x45ff63=0x0,_0xa865f9=[];_0x45ff63<_0x40c228[_0xd199('0x69')][_0xd199('0x1c')];_0x45ff63++){stats[_0xd199('0x6a')]+=0x1;if(_0x40c228[_0xd199('0x5a')][_0x45ff63]){handleError(_0x40c228[_0xd199('0x69')][_0x45ff63],_0x40c228[_0xd199('0x5a')][_0x45ff63]);}else{var _0x47d716=[];var _0x25257b=[];var _0x569792={};for(var _0x15a83c in _0x563e68){let _0x58c09c=contactItemTypes['find'](_0x2ad791=>_0x2ad791['name']===_0x15a83c);let _0x12cb71=contactItemTypes['find'](_0x7d8a18=>_0x7d8a18[_0xd199('0x64')]+'_description'===_0x15a83c);if(_[_0xd199('0x6b')](_0x58c09c)&&_[_0xd199('0x6b')](_0x12cb71)){if(_0x563e68[_0xd199('0x6c')](_0x15a83c)){if(_0x40c228[_0xd199('0x69')][_0x45ff63][_0x563e68[_0x15a83c]]){var _0x30c6c4=_['trim'](_0x40c228[_0xd199('0x69')][_0x45ff63][_0x563e68[_0x15a83c]]['replace'](/"/g,'\x27'));switch(_0x15a83c){case'scheduledat':var _0x4cf1e6=moment(_0x30c6c4,_0xd199('0xd'),!![]);if(_0x4cf1e6[_0xd199('0x6d')]()){_0xa865f9[_0xd199('0x1e')]('\x22'+_0x30c6c4+'\x22');}else{_0x47d716['push']('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xd199('0x36'):var _0x44db8f=parseInt(_0x30c6c4);_0x30c6c4=_[_0xd199('0x6e')](_0x44db8f)||_0x44db8f<0x0||_0x44db8f>0x4?_0x1198c8?0x3:0x2:_0x44db8f;_0xa865f9[_0xd199('0x1e')]('\x22'+_0x30c6c4+'\x22');break;case _0xd199('0x6f'):var _0x1105c0=parseInt(_0x30c6c4);if(_[_0xd199('0x70')](_0x1105c0)&&_[_0xd199('0x71')](_0x599152,_0x1105c0)){_0xa865f9[_0xd199('0x1e')]('\x22'+_0x1105c0+'\x22');}else{_0x47d716[_0xd199('0x1e')](_0xd199('0x72'));}break;case _0xd199('0x73'):if(isEmail(_0x30c6c4)){_0xa865f9[_0xd199('0x1e')]('\x22'+_0x30c6c4+'\x22');}else{_0x47d716[_0xd199('0x1e')](_0xd199('0x74'));}break;case _0xd199('0x75'):var _0x1952fd=moment(_0x30c6c4,'YYYY-MM-DD',!![]);if(_0x1952fd[_0xd199('0x6d')]()){_0xa865f9[_0xd199('0x1e')]('\x22'+_0x30c6c4+'\x22');}else{_0x47d716[_0xd199('0x1e')](_0xd199('0x76'));}break;default:_0xa865f9[_0xd199('0x1e')]('\x22'+_0x30c6c4+'\x22');}}else{switch(_0x15a83c){case _0xd199('0x77'):case'phone':_0x47d716[_0xd199('0x1e')](_0x15a83c+_0xd199('0x78'));break;default:_0xa865f9[_0xd199('0x1e')]('\x22\x22');}}}}else{var _0x164793='';if(!_['isNil'](_0x58c09c)){if(!_0x569792[_0xd199('0x6c')](_0x58c09c['id'])){for(var _0x1211d7=0x0;_0x1211d7<_0x563e68[_0x15a83c][_0xd199('0x1c')];_0x1211d7++){var _0x30c6c4=_['trim'](_0x40c228[_0xd199('0x69')][_0x45ff63][_0x563e68[_0x15a83c][_0x1211d7]]['replace'](/"/g,'\x27'));var _0x1214dc=phoneDescriptions['find'](_0x328cfb=>_0x328cfb[_0xd199('0x79')]===_0x58c09c['id']);if(!_[_0xd199('0x6b')](_0x1214dc)){var _0x54a4ef=_[_0xd199('0x7a')](_0x40c228[_0xd199('0x69')][_0x45ff63][_0x563e68[_0x1214dc[_0xd199('0x7b')]][0x0]][_0xd199('0x7c')](/"/g,'\x27'));if(!_[_0xd199('0x6b')](_0x54a4ef))_0x30c6c4=_0x30c6c4+'§'+_0x54a4ef;}if(_0x164793=='')_0x164793=_0x30c6c4;else _0x164793+='|'+_0x30c6c4;}_0x25257b[_0xd199('0x1e')](_0x58c09c['id']+':'+_0x164793);_0x569792[_0x58c09c['id']]=0x1;}}}}if(hasAdditionalPhones){_0xa865f9['push']('\x22'+_0x25257b[_0xd199('0x15')](';')+'\x22');}if(_0x47d716[_0xd199('0x1c')]){handleError(_0x40c228[_0xd199('0x69')][_0x45ff63],{'code':_0xd199('0x7d'),'message':_0x47d716[_0xd199('0x15')]()});}else{fs[_0xd199('0x7e')](_0x19dbdb,_0xa865f9['join']()+'\x0a');}_0xa865f9=[];}if(!(stats['rows']%0xc8)){socket[_0xd199('0x7f')](_0xd199('0x80')+_0x65317a,stats);stats[_0xd199('0x5a')]=[];}}if(stopped){logger['info'](_0xd199('0x81'));_0x2b2459['abort']();}}catch(_0x512f00){handleError(_0x40c228[_0xd199('0x69')][_0x45ff63],{'code':_0xd199('0x82'),'message':_0x512f00[_0xd199('0x22')]});logger[_0xd199('0x58')](_0xd199('0x83'),_0x512f00[_0xd199('0x22')]);}},'complete':function(){try{var _0x2d9624=[];var _0x45a92d=tempTableName;_0x2d9624[_0xd199('0x1e')]('CREATE\x20TABLE\x20'+_0x45a92d+_0xd199('0x84'));logger['info'](_0xd199('0x85'),contactItemTypes[_0xd199('0x1c')]);var _0x29388c=util[_0xd199('0xf')](_0xd199('0x86'),_0x19dbdb,_0x45a92d,_0x120305,_0x593f52['ListId'],_0x593f52['CompanyId']||null,NOW,NOW);if(_[_0xd199('0x6b')](_0x563e68[_0xd199('0x87')])){_0x29388c+=_0xd199('0x88');}_0x2d9624['push'](_0x29388c);BPromise['each'](_0x2d9624,handleQuery)['then'](function(_0x16f184){BPromise[_0xd199('0x1f')]([handleAdditionalPhones()])[_0xd199('0x20')](function(){_0x2d9624=[];for(var _0xd23b5a=0x0;_0xd23b5a\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.id','i.createdAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.ContactId','i.MailAccountId','i.UserId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','limit','offset','groupBy','Setting','findOne','enableEmailPreview','all','clone','COUNT(*)'];(function(_0x193b99,_0x117516){var _0x48e92e=function(_0xd5c81d){while(--_0xd5c81d){_0x193b99['push'](_0x193b99['shift']());}};_0x48e92e(++_0x117516);}(_0x98e0,0x146));var _0x098e=function(_0x16823b,_0x544695){_0x16823b=_0x16823b-0x0;var _0xc8ead7=_0x98e0[_0x16823b];return _0xc8ead7;};'use strict';var _=require('lodash');var squel=require('squel');var as=require(_0x098e('0x0'));var qs=require('../parsers/qs');var updateInteraction=require(_0x098e('0x1'))['updateInteraction'];var utils=require('./utils');var db=require(_0x098e('0x2'))['db'];function skipInteractionsQuery(_0x58c0fe,_0x45b66f,_0xce967d){var _0x52f4c0=![];var _0xa8841b=utils[_0x098e('0x3')](_0x58c0fe);if(_0x45b66f[_0x098e('0x4')]===_0x098e('0x5')&&!_0xce967d[_0x098e('0x6')]&&!_0xce967d[_0xa8841b]){_0x52f4c0=!![];}return _0x52f4c0;}function getTagsQuery(){return squel['select']()[_0x098e('0x7')]('id')[_0x098e('0x7')](_0x098e('0x8'))[_0x098e('0x7')](_0x098e('0x9'))[_0x098e('0xa')](_0x098e('0xb'));}function getUsersQuery(_0x3c0c77,_0xf5fa2d){var _0x7938fc=utils[_0x098e('0xc')](_0x3c0c77);var _0xc345d7='user_has_'+_0x3c0c77+_0x098e('0xd');var _0x166fd2=squel['select']()[_0x098e('0x7')](_0x098e('0xe'))['field'](_0x098e('0xf'))[_0x098e('0x7')](_0x098e('0x10')+_0x7938fc)['from'](_0xc345d7,'ui')['left_join'](_0x098e('0x11'),'u',_0x098e('0x12'));if(_0xf5fa2d[_0x098e('0x13')]>0x0){_0x166fd2[_0x098e('0x14')]('ui.'+_0x7938fc+_0x098e('0x15'),_[_0x098e('0x16')](_0xf5fa2d,'id'));}return _0x166fd2;}function getInteractionsQuery(_0xbe5c19){var _0x11d3b8=utils[_0x098e('0x17')](_0xbe5c19);var _0x908a9=utils[_0x098e('0x3')](_0xbe5c19);var _0x409692=utils[_0x098e('0xc')](_0xbe5c19);return squel[_0x098e('0x18')]()[_0x098e('0xa')](_0x11d3b8[_0x098e('0x19')],'i')[_0x098e('0x1a')](_0x098e('0x1b'),'c',_0x098e('0x1c'))[_0x098e('0x1a')]('users','o',_0x098e('0x1d'))['left_join'](_0x11d3b8[_0x098e('0x1e')],'a',_0x098e('0x1f')+_0x908a9)[_0x098e('0x1a')](_0x11d3b8[_0x098e('0x20')],'me',_0x098e('0x21')+_0x409692+_0x098e('0x22'))['left_join'](_0x11d3b8[_0x098e('0x23')],'it',_0x098e('0x24')+_0x409692+_0x098e('0x22'))[_0x098e('0x1a')]('tools_tags','t',_0x098e('0x25'));}function getSqlClauses(){var _0x3eb8c0={'body':squel['expr'](),'contact':squel[_0x098e('0x26')](),'default':squel[_0x098e('0x26')](),'fields':squel[_0x098e('0x26')](),'filter':squel[_0x098e('0x26')](),'read':squel[_0x098e('0x26')](),'tags':{'clause':squel['expr'](),'ids':null},'user':squel[_0x098e('0x26')]()};return _0x3eb8c0;}function parseTagParameter(_0x388e6c){var _0x39e1bc=squel['expr']();if(_0x388e6c){var _0x4055c4=utils[_0x098e('0x27')](_0x388e6c);_0x4055c4['forEach'](function(_0x479c9b){_0x39e1bc['or'](_0x098e('0x28'),'%,'+_0x479c9b+',%');});}return _0x39e1bc;}function parseReadParameter(_0x2a77d5){var _0x2d817b='';if(_0x2a77d5){_0x2d817b='unreadMessages\x20{OPERATOR}\x200';if(_0x2a77d5==='1'){_0x2d817b=_0x2d817b[_0x098e('0x29')]('{OPERATOR}','=');}else{_0x2d817b=_0x2d817b[_0x098e('0x29')](_0x098e('0x2a'),'>');}}return _0x2d817b;}function parseSearchFilter(_0x1ca56a,_0x53535e){var _0x276f11=squel[_0x098e('0x26')]();if(_0x53535e){var _0x23eaa1=_0x53535e[_0x098e('0x29')]('\x5c','\x5c\x5c')[_0x098e('0x29')](/'/g,'\x27\x27');if(qs[_0x098e('0x2b')](_0x23eaa1)){_0x276f11['or'](_0x098e('0x2c'),_0x23eaa1+'%');if([_0x098e('0x2d'),_0x098e('0x2e')]['includes'](_0x1ca56a)){_0x276f11['or'](_0x098e('0x2f'),_0x23eaa1+'%');}else if(_0x1ca56a==='fax'){_0x276f11['or'](_0x098e('0x30'),_0x23eaa1+'%');}else if(_0x1ca56a===_0x098e('0x31')){_0x276f11['or'](_0x098e('0x32'),_0x23eaa1+'%');}}else if(_0x1ca56a===_0x098e('0x33')&&qs['isEmail'](_0x23eaa1)){_0x276f11['or'](_0x098e('0x34'),_0x23eaa1+'%');}else{if(_0x1ca56a===_0x098e('0x33')){_0x276f11['or'](_0x098e('0x35'),qs[_0x098e('0x36')](_0x23eaa1,!![]))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x098e('0x36')](_0x23eaa1));}else if(_0x1ca56a!==_0x098e('0x37')){_0x276f11['or'](_0x098e('0x38'),qs[_0x098e('0x36')](_0x23eaa1));}_0x276f11['or'](_0x098e('0x39'),qs[_0x098e('0x36')](_0x23eaa1,!![]),null);}}return _0x276f11;}function parseAdvancedSearchFilter(_0xba2e7,_0x4276d4){var _0x4b12f3=getSqlClauses();var _0x19b547=as[_0x098e('0x3a')](_0xba2e7);var _0x15fa22=_0x19b547[_0x098e('0x3b')];for(var _0x40e817=0x0;_0x40e817<_0x19b547['conditions'][_0x098e('0x13')];_0x40e817++){var _0x289c63=_0x19b547[_0x098e('0x3c')][_0x40e817];var _0x286f53='i';var _0x2f2575=_[_0x098e('0x3d')](_0x4276d4,[_0x098e('0x8'),_0x289c63[_0x098e('0x7')]]);if(_0x2f2575){var _0x1fdaba=as[_0x098e('0x3e')](_0x286f53,_0x2f2575[_0x098e('0x3f')],_0x289c63);_0x4b12f3[_0x098e('0x40')][_0x15fa22](_0x1fdaba['text'],_0x1fdaba[_0x098e('0x41')]['start'],_0x1fdaba[_0x098e('0x41')][_0x098e('0x42')]);}else{switch(_0x289c63[_0x098e('0x7')]){case _0x098e('0x43'):var _0x23d434=parseReadParameter(_0x289c63[_0x098e('0x41')]);_0x4b12f3[_0x098e('0x44')]['and'](_0x23d434);break;case _0x098e('0x45'):if(_0x289c63['operator']===_0x098e('0x46')){if(_0x289c63[_0x098e('0x41')][_0x098e('0x47')]('\x20')[_0x098e('0x13')]>0x1){_0x4b12f3['contact'][_0x15fa22]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x289c63[_0x098e('0x41')],!![]),null);}else{var _0x1544a6='%'+_0x289c63[_0x098e('0x41')]+'%';_0x4b12f3[_0x098e('0x48')][_0x15fa22](_0x098e('0x49'),_0x1544a6,_0x1544a6,_0x1544a6);}}else{_0x2f2575=_[_0x098e('0x3d')](_0x4276d4,[_0x098e('0x8'),_0x098e('0x4a')]);_0x289c63[_0x098e('0x7')]=_0x098e('0x4a');_0x1fdaba=as[_0x098e('0x3e')](_0x286f53,_0x2f2575['type'],_0x289c63);_0x4b12f3[_0x098e('0x48')][_0x15fa22](_0x1fdaba[_0x098e('0x4b')],_0x1fdaba[_0x098e('0x41')][_0x098e('0x4c')],_0x1fdaba[_0x098e('0x41')]['end']);}break;case _0x098e('0x4d'):var _0x4d2296=_0x289c63[_0x098e('0x41')]['split'](',')[_0x098e('0x16')](function(_0x2fc29c){return Number(_0x2fc29c);});var _0x4ee3ae=parseTagParameter(_0x4d2296);_0x4b12f3[_0x098e('0x4e')][_0x098e('0x4f')][_0x098e('0x50')](_0x4ee3ae);_0x4b12f3[_0x098e('0x4e')][_0x098e('0x51')]=_0x4d2296;break;case _0x098e('0x52'):if(_0x289c63['operator']===_0x098e('0x46')){_0x4b12f3[_0x098e('0x53')][_0x15fa22]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x289c63[_0x098e('0x41')]+'%',null);}else{_0x2f2575=_['find'](_0x4276d4,[_0x098e('0x8'),_0x098e('0x54')]);_0x289c63[_0x098e('0x7')]=_0x098e('0x54');_0x1fdaba=as['buildExpression'](_0x286f53,_0x2f2575['type'],_0x289c63);_0x4b12f3['user'][_0x15fa22](_0x1fdaba[_0x098e('0x4b')],_0x1fdaba['value']['start'],_0x1fdaba[_0x098e('0x41')][_0x098e('0x42')]);}break;case _0x098e('0x55'):case _0x098e('0x56'):_0x1fdaba=as[_0x098e('0x3e')]('me',null,_0x289c63);_0x4b12f3[_0x098e('0x55')][_0x15fa22](_0x1fdaba[_0x098e('0x4b')],_0x1fdaba[_0x098e('0x41')][_0x098e('0x4c')],_0x1fdaba['value'][_0x098e('0x42')]);break;}}}return _0x4b12f3;}function parseModelFields(_0x5f2c33,_0x42c520,_0x5a7ab3){var _0x44265f=utils[_0x098e('0x3')](_0x5f2c33);var _0x219e50=squel[_0x098e('0x26')]();var _0x3f2e84=_(_0x42c520)['keys']()[_0x098e('0x16')](function(_0x6d3199){return _['some'](_0x5a7ab3,[_0x098e('0x8'),_0x6d3199])?_0x6d3199:undefined;})[_0x098e('0x57')]()[_0x098e('0x41')]();if(_0x3f2e84[_0x098e('0x13')]>0x0){_0x3f2e84[_0x098e('0x58')](function(_0x19755c){if(_0x19755c===_0x44265f){_0x219e50[_0x098e('0x50')]('i.'+_0x44265f+_0x098e('0x15'),[][_0x098e('0x59')](_0x42c520[_0x19755c]));}else if(_0x19755c==='createdAt'){var _0x3bb786=JSON[_0x098e('0x5a')](_0x42c520[_0x19755c])[_0x098e('0x5b')];var _0x1eb2c2=JSON[_0x098e('0x5a')](_0x42c520[_0x19755c])['$lte'];_0x219e50['and'](_0x098e('0x5c'),_0x3bb786,_0x1eb2c2);}else{if(_0x42c520[_0x19755c]===_0x098e('0x5d')){_0x219e50[_0x098e('0x50')]('i.'+_0x19755c+_0x098e('0x5e'));}else{_0x219e50[_0x098e('0x50')]('i.'+_0x19755c+_0x098e('0x5f'),_0x42c520[_0x19755c]);}}});}return _0x219e50;}function parseQueryParameters(_0x3be8fe,_0x235ab4,_0x41d14c){var _0x5945b6=getSqlClauses();return Promise['resolve']()[_0x098e('0x60')](function(){return parseModelFields(_0x3be8fe,_0x235ab4,_0x41d14c);})['then'](function(_0x4074d9){_0x5945b6['fields'][_0x098e('0x50')](_0x4074d9);return parseReadParameter(_0x235ab4[_0x098e('0x44')]);})[_0x098e('0x60')](function(_0x3aecee){_0x5945b6[_0x098e('0x44')][_0x098e('0x50')](_0x3aecee);return parseTagParameter(_0x235ab4['tag']);})[_0x098e('0x60')](function(_0x49eb2b){_0x5945b6[_0x098e('0x4e')][_0x098e('0x4f')][_0x098e('0x50')](_0x49eb2b);return parseSearchFilter(_0x3be8fe,_0x235ab4['filter']);})[_0x098e('0x60')](function(_0x530962){_0x5945b6['filter']=_0x530962;return _0x5945b6;});}function checkAccountsRestrictions(_0x3e7a12,_0x45140c,_0x597515){var _0x54a9d1=utils[_0x098e('0x3')](_0x3e7a12);var _0x1640a1=_0x098e('0x61')+_['capitalize'](_0x3e7a12)+(_0x3e7a12===_0x098e('0x62')?_0x098e('0x63'):'Accounts');var _0x400106=squel[_0x098e('0x26')]();return Promise['resolve']()[_0x098e('0x60')](function(){if(_0x597515[_0x098e('0x6')]&&_0x45140c[_0x098e('0x4')]==='agent'){return _0x45140c[_0x1640a1]({'attributes':['id'],'raw':!![]});}})[_0x098e('0x60')](function(_0x29fda7){if(_0x29fda7){if(_0x29fda7[_0x098e('0x13')]===0x0){_0x400106[_0x098e('0x50')]('i.'+_0x54a9d1+_0x098e('0x5e'));}else{_0x400106[_0x098e('0x50')]('i.'+_0x54a9d1+_0x098e('0x15'),_[_0x098e('0x16')](_0x29fda7,'id'));}}else if(!_0x597515[_0x54a9d1]){_0x400106[_0x098e('0x50')]('i.'+_0x54a9d1+_0x098e('0x64'));}})[_0x098e('0x60')](function(){return _0x400106;});}function getClosedOrderClause(_0x5eaf95,_0x4b9947){var _0x5ceb27='';var _0x23e902=[_0x098e('0x65'),_0x098e('0x66'),_0x098e('0x67')];if(_0x5eaf95===_0x098e('0x33')){_0x23e902[_0x098e('0x68')](_0x098e('0x69'));}if(_0x4b9947[_0x098e('0x6a')]==='0'&&_0x5eaf95==='mail'){_0x5ceb27='i.substatus';}else{if(_0x4b9947[_0x098e('0x6a')]==='1'){_0x23e902[_0x098e('0x6b')]();}_0x5ceb27=_0x098e('0x6c')+_0x23e902['join'](',\x20')+')';}return _0x5ceb27;}function getFilteredInteractions(_0x22bfb0,_0x909895,_0x2f4f23,_0x2b64c3){var _0x13e61b=utils['getInteractionFK'](_0x22bfb0);var _0x12dea3=_[_0x098e('0x6d')](_0x22bfb0)+'Interaction';var _0x20f60c=[];var _0x94c3fb=getTagsQuery();var _0xfd0543={'type':db[_0x098e('0x6e')][_0x098e('0x6f')][_0x098e('0x70')],'raw':!![]};var _0x5ddee8=[];var _0x15b5c7=[];return db[_0x098e('0x71')][_0x098e('0x72')](_0x94c3fb[_0x098e('0x73')](),_0xfd0543)[_0x098e('0x60')](function(_0x216774){_0x20f60c=_[_0x098e('0x74')](_0x216774,'id');_0xfd0543=_['merge'](_0xfd0543,{'model':db[_0x12dea3],'mapToModel':!![],'nest':!![]});if(_0x2f4f23['fields']){_0x2b64c3[_0x098e('0x75')][_0x098e('0x58')](function(_0x4039f8){_0x909895[_0x098e('0x7')]('i.'+_0x4039f8);});}else{_0x909895[_0x098e('0x7')](_0x098e('0x76'),_0x098e('0x43'));_0x909895[_0x098e('0x7')](_0x098e('0x77'),_0x098e('0x78'));_0x909895['field'](_0x098e('0x79'),_0x098e('0x7a'));if(_0x22bfb0===_0x098e('0x33')){_0x909895[_0x098e('0x7')](_0x098e('0x7b'),_0x098e('0x7c'));_0x909895[_0x098e('0x7')](_0x098e('0x7d'),_0x098e('0x7e'));_0x909895[_0x098e('0x7')](_0x098e('0x7f'));_0x909895[_0x098e('0x7')](_0x098e('0x80'));_0x909895[_0x098e('0x7')]('i.updatedAt');_0x909895['field']('i.closed');_0x909895[_0x098e('0x7')]('i.closedAt');_0x909895['field'](_0x098e('0x81'));_0x909895[_0x098e('0x7')](_0x098e('0x82'));_0x909895['field'](_0x098e('0x83'));_0x909895[_0x098e('0x7')](_0x098e('0x84'));_0x909895[_0x098e('0x7')](_0x098e('0x67'));_0x909895[_0x098e('0x7')](_0x098e('0x66'));_0x909895[_0x098e('0x7')](_0x098e('0x65'));_0x909895['field']('i.substatus');_0x909895[_0x098e('0x7')]('i.to');_0x909895[_0x098e('0x7')](_0x098e('0x85'));_0x909895[_0x098e('0x7')](_0x098e('0x86'));_0x909895[_0x098e('0x7')](_0x098e('0x87'));}else if(_0x22bfb0===_0x098e('0x31')){_0x909895[_0x098e('0x7')](_0x098e('0x88'),_0x098e('0x7e'));}else{_0x909895['field']('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',_0x098e('0x7e'));}if(_0x22bfb0!=='mail'){_0x909895['field'](_0x098e('0x89'));}_0x909895[_0x098e('0x7')]('c.firstName',_0x098e('0x8a'));_0x909895[_0x098e('0x7')](_0x098e('0x8b'),_0x098e('0x8c'));_0x909895[_0x098e('0x7')](_0x098e('0x8d'),_0x098e('0x8e'));_0x909895[_0x098e('0x7')](_0x098e('0x8f'),_0x098e('0x90'));_0x909895['field']('c.mobile',_0x098e('0x91'));_0x909895[_0x098e('0x7')](_0x098e('0x92'),_0x098e('0x93'));_0x909895[_0x098e('0x7')](_0x098e('0x94'),_0x098e('0x95'));_0x909895[_0x098e('0x7')](_0x098e('0x96'),'Owner.internal');_0x909895[_0x098e('0x7')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x2b64c3['limit']){_0x909895[_0x098e('0x97')](_0x2b64c3[_0x098e('0x97')]);}if(_0x2b64c3[_0x098e('0x98')]){_0x909895[_0x098e('0x98')](_0x2b64c3[_0x098e('0x98')]);}return db[_0x098e('0x71')][_0x098e('0x72')](_0x909895[_0x098e('0x73')](),_0xfd0543);})[_0x098e('0x60')](function(_0x34f190){_0x5ddee8=_0x34f190;var _0x58e3b7=getUsersQuery(_0x22bfb0,_0x5ddee8);return db['sequelize'][_0x098e('0x72')](_0x58e3b7[_0x098e('0x73')](),_0xfd0543);})['then'](function(_0x143120){_0x15b5c7=_[_0x098e('0x99')](_0x143120,_0x13e61b);if(_0x22bfb0===_0x098e('0x33')){return db[_0x098e('0x9a')][_0x098e('0x9b')]({'attributes':[_0x098e('0x9c')],'raw':!![]});}})[_0x098e('0x60')](function(_0x2b21d3){var _0x2dd266=_0x2b21d3?_0x2b21d3['enableEmailPreview']:undefined;var _0x50d69d=_0x5ddee8['map'](function(_0x3c6fe2){return updateInteraction(_0x3c6fe2,_0x20f60c,_0x15b5c7,_0x2dd266);});return Promise[_0x098e('0x9d')](_0x50d69d);});}function countFilteredInteractions(_0x2ca4c8,_0x30ebf4){var _0x5375de=_0x2ca4c8[_0x098e('0x9e')]();_0x5375de[_0x098e('0x7')](_0x098e('0x9f'));_0x5375de[_0x098e('0x7')](_0x098e('0x76'),'unreadMessages');var _0x3c7186=utils['getSelectedTags'](_0x30ebf4);if(!_['isEmpty'](_0x3c7186)){_0x5375de[_0x098e('0x14')](_0x098e('0xa0'),_0x3c7186);}var _0x4c4ffe={'type':db[_0x098e('0x6e')]['QueryTypes']['SELECT'],'raw':!![]};return db[_0x098e('0x71')][_0x098e('0x72')](_0x5375de['toString'](),_0x4c4ffe);}module[_0x098e('0xa1')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0x42c1=['MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','fax','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','parseSearch','sqlOperator','conditions','name','buildExpression','text','value','start','unreadMessages','Contact','operator','$substring','split','contact','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','end','tags','clause','and','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','type','body','plainBody','keys','some','compact','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','resolve','then','fields','read','tag','filter','chat','Websites','Accounts','agent','\x20IS\x20NOT\x20NULL','i.disposition','unshift','i.substatus','closed','shift','CONCAT_WS(\x27\x27,\x20','join','capitalize','Interaction','Sequelize','QueryTypes','SELECT','sequelize','toString','keyBy','merge','attributes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','a.email','Account.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.closed','i.lastMsgAt','i.subject','i.secondDisposition','i.thirdDisposition','i.to','i.MailAccountId','i.UserId','openchannel','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','query','Setting','findOne','enableEmailPreview','all','clone','exports','squel','../parsers/advancedSearch','../parsers/qs','updateInteraction','./utils','../../mysqldb','getAccountFK','role','search','select','field','from','tools_tags','getInteractionFK','user_has_','u.id','u.fullname','ui.','left_join','users','length','where','\x20IN\x20?','map','getInteractionsTables','interactions','cm_contacts','o.id\x20=\x20i.UserId','accounts','a.id\x20=\x20i.','messages','me.','it.','\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','{OPERATOR}','i.id\x20LIKE\x20?','sms','whatsapp','includes','i.phone\x20LIKE\x20?','i.fax\x20LIKE\x20?','i.from\x20LIKE\x20?','mail','isEmail','c.email\x20LIKE\x20?'];(function(_0x472bc0,_0x2918f1){var _0x19e4b2=function(_0x1e304f){while(--_0x1e304f){_0x472bc0['push'](_0x472bc0['shift']());}};_0x19e4b2(++_0x2918f1);}(_0x42c1,0x1bc));var _0x142c=function(_0x48dfb8,_0x2a7d76){_0x48dfb8=_0x48dfb8-0x0;var _0xe1547b=_0x42c1[_0x48dfb8];return _0xe1547b;};'use strict';var _=require('lodash');var squel=require(_0x142c('0x0'));var as=require(_0x142c('0x1'));var qs=require(_0x142c('0x2'));var updateInteraction=require('./update-interaction')[_0x142c('0x3')];var utils=require(_0x142c('0x4'));var db=require(_0x142c('0x5'))['db'];function skipInteractionsQuery(_0x3dd5ba,_0x275e69,_0x2a2d47){var _0x382cec=![];var _0x3053a1=utils[_0x142c('0x6')](_0x3dd5ba);if(_0x275e69[_0x142c('0x7')]==='agent'&&!_0x2a2d47[_0x142c('0x8')]&&!_0x2a2d47[_0x3053a1]){_0x382cec=!![];}return _0x382cec;}function getTagsQuery(){return squel[_0x142c('0x9')]()[_0x142c('0xa')]('id')[_0x142c('0xa')]('name')['field']('color')[_0x142c('0xb')](_0x142c('0xc'));}function getUsersQuery(_0x20fee3,_0xf6c50f){var _0x270dfa=utils[_0x142c('0xd')](_0x20fee3);var _0x1ab590=_0x142c('0xe')+_0x20fee3+'_interactions';var _0x33fb22=squel['select']()[_0x142c('0xa')](_0x142c('0xf'))[_0x142c('0xa')](_0x142c('0x10'))[_0x142c('0xa')](_0x142c('0x11')+_0x270dfa)[_0x142c('0xb')](_0x1ab590,'ui')[_0x142c('0x12')](_0x142c('0x13'),'u','u.id\x20=\x20ui.UserId');if(_0xf6c50f[_0x142c('0x14')]>0x0){_0x33fb22[_0x142c('0x15')](_0x142c('0x11')+_0x270dfa+_0x142c('0x16'),_[_0x142c('0x17')](_0xf6c50f,'id'));}return _0x33fb22;}function getInteractionsQuery(_0x4ef47e){var _0x3ea5b1=utils[_0x142c('0x18')](_0x4ef47e);var _0x3a2728=utils['getAccountFK'](_0x4ef47e);var _0x40c8b5=utils[_0x142c('0xd')](_0x4ef47e);return squel[_0x142c('0x9')]()[_0x142c('0xb')](_0x3ea5b1[_0x142c('0x19')],'i')[_0x142c('0x12')](_0x142c('0x1a'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x142c('0x12')]('users','o',_0x142c('0x1b'))[_0x142c('0x12')](_0x3ea5b1[_0x142c('0x1c')],'a',_0x142c('0x1d')+_0x3a2728)[_0x142c('0x12')](_0x3ea5b1[_0x142c('0x1e')],'me',_0x142c('0x1f')+_0x40c8b5+'\x20=\x20i.id')[_0x142c('0x12')](_0x3ea5b1['interactionsTags'],'it',_0x142c('0x20')+_0x40c8b5+_0x142c('0x21'))['left_join'](_0x142c('0xc'),'t',_0x142c('0x22'));}function getSqlClauses(){var _0xd8ae2b={'body':squel['expr'](),'contact':squel[_0x142c('0x23')](),'default':squel[_0x142c('0x23')](),'fields':squel[_0x142c('0x23')](),'filter':squel['expr'](),'read':squel['expr'](),'tags':{'clause':squel['expr'](),'ids':null},'user':squel[_0x142c('0x23')]()};return _0xd8ae2b;}function parseTagParameter(_0x1f1c3b){var _0x1b6679=squel[_0x142c('0x23')]();if(_0x1f1c3b){var _0x1c4a52=utils[_0x142c('0x24')](_0x1f1c3b);_0x1c4a52[_0x142c('0x25')](function(_0x15bf27){_0x1b6679['or'](_0x142c('0x26'),'%,'+_0x15bf27+',%');});}return _0x1b6679;}function parseReadParameter(_0x25b3b5){var _0x27f90e='';if(_0x25b3b5){_0x27f90e='unreadMessages\x20{OPERATOR}\x200';if(_0x25b3b5==='1'){_0x27f90e=_0x27f90e[_0x142c('0x27')](_0x142c('0x28'),'=');}else{_0x27f90e=_0x27f90e[_0x142c('0x27')](_0x142c('0x28'),'>');}}return _0x27f90e;}function parseSearchFilter(_0x3695df,_0x4c6510){var _0x38c90c=squel[_0x142c('0x23')]();if(_0x4c6510){var _0x28eb58=_0x4c6510[_0x142c('0x27')]('\x5c','\x5c\x5c')[_0x142c('0x27')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x28eb58)){_0x38c90c['or'](_0x142c('0x29'),_0x28eb58+'%');if([_0x142c('0x2a'),_0x142c('0x2b')][_0x142c('0x2c')](_0x3695df)){_0x38c90c['or'](_0x142c('0x2d'),_0x28eb58+'%');}else if(_0x3695df==='fax'){_0x38c90c['or'](_0x142c('0x2e'),_0x28eb58+'%');}else if(_0x3695df==='openchannel'){_0x38c90c['or'](_0x142c('0x2f'),_0x28eb58+'%');}}else if(_0x3695df===_0x142c('0x30')&&qs[_0x142c('0x31')](_0x28eb58)){_0x38c90c['or'](_0x142c('0x32'),_0x28eb58+'%');}else{if(_0x3695df==='mail'){_0x38c90c['or'](_0x142c('0x33'),qs[_0x142c('0x34')](_0x28eb58,!![]))['or'](_0x142c('0x35'),qs['getFullTextValue'](_0x28eb58));}else if(_0x3695df!==_0x142c('0x36')){_0x38c90c['or'](_0x142c('0x37'),qs[_0x142c('0x34')](_0x28eb58));}_0x38c90c['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x142c('0x34')](_0x28eb58,!![]),null);}}return _0x38c90c;}function parseAdvancedSearchFilter(_0x39725a,_0x50f871){var _0x192ada=getSqlClauses();var _0x311f00=as[_0x142c('0x38')](_0x39725a);var _0x2de65e=_0x311f00[_0x142c('0x39')];for(var _0x327021=0x0;_0x327021<_0x311f00[_0x142c('0x3a')][_0x142c('0x14')];_0x327021++){var _0xfe520e=_0x311f00[_0x142c('0x3a')][_0x327021];var _0x2e52a4='i';var _0xbf6add=_['find'](_0x50f871,[_0x142c('0x3b'),_0xfe520e['field']]);if(_0xbf6add){var _0x10ccce=as[_0x142c('0x3c')](_0x2e52a4,_0xbf6add['type'],_0xfe520e);_0x192ada['default'][_0x2de65e](_0x10ccce[_0x142c('0x3d')],_0x10ccce[_0x142c('0x3e')][_0x142c('0x3f')],_0x10ccce[_0x142c('0x3e')]['end']);}else{switch(_0xfe520e['field']){case _0x142c('0x40'):var _0x5bbaca=parseReadParameter(_0xfe520e[_0x142c('0x3e')]);_0x192ada['read']['and'](_0x5bbaca);break;case _0x142c('0x41'):if(_0xfe520e[_0x142c('0x42')]===_0x142c('0x43')){if(_0xfe520e['value'][_0x142c('0x44')]('\x20')['length']>0x1){_0x192ada[_0x142c('0x45')][_0x2de65e]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x142c('0x34')](_0xfe520e[_0x142c('0x3e')],!![]),null);}else{var _0x10376a='%'+_0xfe520e['value']+'%';_0x192ada[_0x142c('0x45')][_0x2de65e](_0x142c('0x46'),_0x10376a,_0x10376a,_0x10376a);}}else{_0xbf6add=_[_0x142c('0x47')](_0x50f871,[_0x142c('0x3b'),_0x142c('0x48')]);_0xfe520e[_0x142c('0xa')]='ContactId';_0x10ccce=as[_0x142c('0x3c')](_0x2e52a4,_0xbf6add['type'],_0xfe520e);_0x192ada[_0x142c('0x45')][_0x2de65e](_0x10ccce[_0x142c('0x3d')],_0x10ccce[_0x142c('0x3e')][_0x142c('0x3f')],_0x10ccce[_0x142c('0x3e')][_0x142c('0x49')]);}break;case'Tag':var _0xccc9b4=_0xfe520e[_0x142c('0x3e')][_0x142c('0x44')](',')[_0x142c('0x17')](function(_0xc2e446){return Number(_0xc2e446);});var _0x526607=parseTagParameter(_0xccc9b4);_0x192ada[_0x142c('0x4a')][_0x142c('0x4b')][_0x142c('0x4c')](_0x526607);_0x192ada['tags']['ids']=_0xccc9b4;break;case _0x142c('0x4d'):if(_0xfe520e[_0x142c('0x42')]===_0x142c('0x43')){_0x192ada['user'][_0x2de65e](_0x142c('0x4e'),'%'+_0xfe520e[_0x142c('0x3e')]+'%',null);}else{_0xbf6add=_['find'](_0x50f871,[_0x142c('0x3b'),'UserId']);_0xfe520e[_0x142c('0xa')]=_0x142c('0x4f');_0x10ccce=as[_0x142c('0x3c')](_0x2e52a4,_0xbf6add[_0x142c('0x50')],_0xfe520e);_0x192ada['user'][_0x2de65e](_0x10ccce[_0x142c('0x3d')],_0x10ccce[_0x142c('0x3e')]['start'],_0x10ccce[_0x142c('0x3e')][_0x142c('0x49')]);}break;case _0x142c('0x51'):case _0x142c('0x52'):_0x10ccce=as[_0x142c('0x3c')]('me',null,_0xfe520e);_0x192ada['body'][_0x2de65e](_0x10ccce[_0x142c('0x3d')],_0x10ccce[_0x142c('0x3e')][_0x142c('0x3f')],_0x10ccce[_0x142c('0x3e')][_0x142c('0x49')]);break;}}}return _0x192ada;}function parseModelFields(_0x4db21d,_0x47ab0e,_0x287e82){var _0x6ce1fa=utils['getAccountFK'](_0x4db21d);var _0x862226=squel[_0x142c('0x23')]();var _0x18f04b=_(_0x47ab0e)[_0x142c('0x53')]()[_0x142c('0x17')](function(_0x188bd5){return _[_0x142c('0x54')](_0x287e82,['name',_0x188bd5])?_0x188bd5:undefined;})[_0x142c('0x55')]()[_0x142c('0x3e')]();if(_0x18f04b[_0x142c('0x14')]>0x0){_0x18f04b[_0x142c('0x25')](function(_0x4f05c3){if(_0x4f05c3===_0x6ce1fa){_0x862226['and']('i.'+_0x6ce1fa+_0x142c('0x16'),[][_0x142c('0x56')](_0x47ab0e[_0x4f05c3]));}else if(_0x4f05c3===_0x142c('0x57')){var _0x19bef4=JSON[_0x142c('0x58')](_0x47ab0e[_0x4f05c3])['$gte'];var _0x299580=JSON['parse'](_0x47ab0e[_0x4f05c3])[_0x142c('0x59')];_0x862226[_0x142c('0x4c')](_0x142c('0x5a'),_0x19bef4,_0x299580);}else{if(_0x47ab0e[_0x4f05c3]==='null'){_0x862226[_0x142c('0x4c')]('i.'+_0x4f05c3+_0x142c('0x5b'));}else{_0x862226[_0x142c('0x4c')]('i.'+_0x4f05c3+_0x142c('0x5c'),_0x47ab0e[_0x4f05c3]);}}});}return _0x862226;}function parseQueryParameters(_0x446eb2,_0x20e116,_0x3fc900){var _0x1dbd13=getSqlClauses();return Promise[_0x142c('0x5d')]()[_0x142c('0x5e')](function(){return parseModelFields(_0x446eb2,_0x20e116,_0x3fc900);})[_0x142c('0x5e')](function(_0x4fd614){_0x1dbd13[_0x142c('0x5f')]['and'](_0x4fd614);return parseReadParameter(_0x20e116['read']);})[_0x142c('0x5e')](function(_0x200fd5){_0x1dbd13[_0x142c('0x60')][_0x142c('0x4c')](_0x200fd5);return parseTagParameter(_0x20e116[_0x142c('0x61')]);})[_0x142c('0x5e')](function(_0x8cdca6){_0x1dbd13['tags'][_0x142c('0x4b')]['and'](_0x8cdca6);return parseSearchFilter(_0x446eb2,_0x20e116[_0x142c('0x62')]);})[_0x142c('0x5e')](function(_0x48f849){_0x1dbd13[_0x142c('0x62')]=_0x48f849;return _0x1dbd13;});}function checkAccountsRestrictions(_0x5c67d9,_0x16425d,_0x549209){var _0x206498=utils['getAccountFK'](_0x5c67d9);var _0x46634d='get'+_['capitalize'](_0x5c67d9)+(_0x5c67d9===_0x142c('0x63')?_0x142c('0x64'):_0x142c('0x65'));var _0x4fa5a6=squel['expr']();return Promise['resolve']()['then'](function(){if(_0x549209['search']&&_0x16425d[_0x142c('0x7')]===_0x142c('0x66')){return _0x16425d[_0x46634d]({'attributes':['id'],'raw':!![]});}})[_0x142c('0x5e')](function(_0x45df6b){if(_0x45df6b){if(_0x45df6b['length']===0x0){_0x4fa5a6[_0x142c('0x4c')]('i.'+_0x206498+'\x20IS\x20NULL');}else{_0x4fa5a6[_0x142c('0x4c')]('i.'+_0x206498+_0x142c('0x16'),_[_0x142c('0x17')](_0x45df6b,'id'));}}else if(!_0x549209[_0x206498]){_0x4fa5a6[_0x142c('0x4c')]('i.'+_0x206498+_0x142c('0x67'));}})[_0x142c('0x5e')](function(){return _0x4fa5a6;});}function getClosedOrderClause(_0x1b86f9,_0x18396c){var _0x4d470c='';var _0x84e18d=['i.thirdDisposition','i.secondDisposition',_0x142c('0x68')];if(_0x1b86f9==='mail'){_0x84e18d[_0x142c('0x69')](_0x142c('0x6a'));}if(_0x18396c[_0x142c('0x6b')]==='0'&&_0x1b86f9===_0x142c('0x30')){_0x4d470c=_0x142c('0x6a');}else{if(_0x18396c[_0x142c('0x6b')]==='1'){_0x84e18d[_0x142c('0x6c')]();}_0x4d470c=_0x142c('0x6d')+_0x84e18d[_0x142c('0x6e')](',\x20')+')';}return _0x4d470c;}function getFilteredInteractions(_0x370fda,_0x30f067,_0xc1483b,_0x1744e4){var _0x196eeb=utils[_0x142c('0xd')](_0x370fda);var _0x3877b9=_[_0x142c('0x6f')](_0x370fda)+_0x142c('0x70');var _0x18ed5d=[];var _0x148271=getTagsQuery();var _0x5471da={'type':db[_0x142c('0x71')][_0x142c('0x72')][_0x142c('0x73')],'raw':!![]};var _0x25bdf0=[];var _0x16aa00=[];return db[_0x142c('0x74')]['query'](_0x148271[_0x142c('0x75')](),_0x5471da)[_0x142c('0x5e')](function(_0x341689){_0x18ed5d=_[_0x142c('0x76')](_0x341689,'id');_0x5471da=_[_0x142c('0x77')](_0x5471da,{'model':db[_0x3877b9],'mapToModel':!![],'nest':!![]});if(_0xc1483b[_0x142c('0x5f')]){_0x1744e4[_0x142c('0x78')][_0x142c('0x25')](function(_0x49b9fb){_0x30f067[_0x142c('0xa')]('i.'+_0x49b9fb);});}else{_0x30f067[_0x142c('0xa')](_0x142c('0x79'),_0x142c('0x40'));_0x30f067[_0x142c('0xa')](_0x142c('0x7a'),_0x142c('0x7b'));_0x30f067['field'](_0x142c('0x7c'),'Account.mandatoryDisposition');if(_0x370fda===_0x142c('0x30')){_0x30f067[_0x142c('0xa')](_0x142c('0x7d'),_0x142c('0x7e'));_0x30f067[_0x142c('0xa')](_0x142c('0x7f'),_0x142c('0x80'));_0x30f067[_0x142c('0xa')]('i.id');_0x30f067[_0x142c('0xa')]('i.createdAt');_0x30f067[_0x142c('0xa')]('i.updatedAt');_0x30f067[_0x142c('0xa')](_0x142c('0x81'));_0x30f067[_0x142c('0xa')]('i.closedAt');_0x30f067['field']('i.attach');_0x30f067[_0x142c('0xa')](_0x142c('0x82'));_0x30f067['field']('i.lastMsgDirection');_0x30f067[_0x142c('0xa')](_0x142c('0x83'));_0x30f067['field']('i.disposition');_0x30f067['field'](_0x142c('0x84'));_0x30f067['field'](_0x142c('0x85'));_0x30f067['field']('i.substatus');_0x30f067[_0x142c('0xa')](_0x142c('0x86'));_0x30f067[_0x142c('0xa')]('i.ContactId');_0x30f067['field'](_0x142c('0x87'));_0x30f067[_0x142c('0xa')](_0x142c('0x88'));}else if(_0x370fda===_0x142c('0x89')){_0x30f067[_0x142c('0xa')](_0x142c('0x8a'),'contactName');}else{_0x30f067[_0x142c('0xa')](_0x142c('0x8b'),_0x142c('0x80'));}if(_0x370fda!==_0x142c('0x30')){_0x30f067[_0x142c('0xa')](_0x142c('0x8c'));}_0x30f067[_0x142c('0xa')](_0x142c('0x8d'),_0x142c('0x8e'));_0x30f067[_0x142c('0xa')](_0x142c('0x8f'),'Contact.lastName');_0x30f067[_0x142c('0xa')](_0x142c('0x90'),_0x142c('0x91'));_0x30f067[_0x142c('0xa')](_0x142c('0x92'),_0x142c('0x93'));_0x30f067[_0x142c('0xa')](_0x142c('0x94'),_0x142c('0x95'));_0x30f067[_0x142c('0xa')](_0x142c('0x96'),_0x142c('0x97'));_0x30f067[_0x142c('0xa')]('o.fullname',_0x142c('0x98'));_0x30f067['field']('o.internal',_0x142c('0x99'));_0x30f067['field'](_0x142c('0x9a'),_0x142c('0x9b'));}if(_0x1744e4[_0x142c('0x9c')]){_0x30f067[_0x142c('0x9c')](_0x1744e4['limit']);}if(_0x1744e4['offset']){_0x30f067[_0x142c('0x9d')](_0x1744e4['offset']);}return db['sequelize'][_0x142c('0x9e')](_0x30f067[_0x142c('0x75')](),_0x5471da);})['then'](function(_0x2d5e19){_0x25bdf0=_0x2d5e19;var _0x1390e7=getUsersQuery(_0x370fda,_0x25bdf0);return db[_0x142c('0x74')][_0x142c('0x9e')](_0x1390e7[_0x142c('0x75')](),_0x5471da);})[_0x142c('0x5e')](function(_0x4db3f4){_0x16aa00=_['groupBy'](_0x4db3f4,_0x196eeb);if(_0x370fda===_0x142c('0x30')){return db[_0x142c('0x9f')][_0x142c('0xa0')]({'attributes':[_0x142c('0xa1')],'raw':!![]});}})[_0x142c('0x5e')](function(_0x396ced){var _0x5a98e4=_0x396ced?_0x396ced[_0x142c('0xa1')]:undefined;var _0x2e67ed=_0x25bdf0[_0x142c('0x17')](function(_0x55987d){return updateInteraction(_0x55987d,_0x18ed5d,_0x16aa00,_0x5a98e4);});return Promise[_0x142c('0xa2')](_0x2e67ed);});}function countFilteredInteractions(_0x5e97f1,_0x4697e8){var _0x11b1c3=_0x5e97f1[_0x142c('0xa3')]();_0x11b1c3['field']('COUNT(*)');_0x11b1c3[_0x142c('0xa')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x142c('0x40'));var _0x31d749=utils[_0x142c('0x24')](_0x4697e8);if(!_['isEmpty'](_0x31d749)){_0x11b1c3['where']('t.id\x20IN\x20?',_0x31d749);}var _0x1ded54={'type':db[_0x142c('0x71')][_0x142c('0x72')][_0x142c('0x73')],'raw':!![]};return db['sequelize']['query'](_0x11b1c3['toString'](),_0x1ded54);}module[_0x142c('0xa4')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file diff --git a/server/components/interaction/update-interaction.js b/server/components/interaction/update-interaction.js index d225bb0..2232045 100644 --- a/server/components/interaction/update-interaction.js +++ b/server/components/interaction/update-interaction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9a7=['catch','lodash','../../mysqldb','map','forEach','waiting','talking','answered','abandoned','total','disposition','unmanaged','UserId','MailMessage','out','plainBody','-id','lastMsgText','trimStart','updateInteraction','then','Users','TagIds','Tags'];(function(_0x308982,_0x1ee045){var _0x3fb834=function(_0x5d5095){while(--_0x5d5095){_0x308982['push'](_0x308982['shift']());}};_0x3fb834(++_0x1ee045);}(_0xa9a7,0x151));var _0x7a9a=function(_0x34a284,_0x207084){_0x34a284=_0x34a284-0x0;var _0x2ec13b=_0xa9a7[_0x34a284];return _0x2ec13b;};'use strict';var _=require(_0x7a9a('0x0'));var db=require(_0x7a9a('0x1'))['db'];function getInteractionUsers(_0x510b36,_0x38d2e3){return new Promise(function(_0x3eea80,_0x3d453f){try{var _0x3feb8c=[];if(_0x38d2e3[_0x510b36]){_0x3feb8c=_0x38d2e3[_0x510b36][_0x7a9a('0x2')](function(_0x51803d){return{'id':_0x51803d['id'],'fullname':_0x51803d['fullname']};});}return _0x3eea80(_0x3feb8c);}catch(_0x3fedd1){_0x3d453f(_0x3fedd1);}});}function getInteractionTags(_0x1a943d,_0x15ce95){var _0x4b72f7=[];if(_0x1a943d){_0x1a943d['split'](',')[_0x7a9a('0x3')](function(_0x4f6a39){_0x4b72f7['push'](_0x15ce95[_0x4f6a39]);});}return _0x4b72f7;}function updateWaitingCounter(_0x9b637b){if(_0x9b637b[_0x7a9a('0x4')]){_0x9b637b[_0x7a9a('0x4')]-=0x1;}}function updateInteractionCounters(_0x3f6d61){_0x3f6d61['waiting']=0x0;_0x3f6d61[_0x7a9a('0x5')]=0x0;_0x3f6d61[_0x7a9a('0x6')]=0x0;_0x3f6d61['unmanaged']=0x0;_0x3f6d61[_0x7a9a('0x7')]=0x0;_0x3f6d61[_0x7a9a('0x8')]=0x0;if(_0x3f6d61['closed']){if(_0x3f6d61[_0x7a9a('0x9')]==='abandoned'){_0x3f6d61[_0x7a9a('0x7')]+=0x1;updateWaitingCounter(_0x3f6d61);}if(_0x3f6d61['UserId']){_0x3f6d61[_0x7a9a('0x6')]+=0x1;if(_0x3f6d61[_0x7a9a('0x5')]){_0x3f6d61['talking']-=0x1;}}else{if(_0x3f6d61['disposition']){_0x3f6d61[_0x7a9a('0xa')]+=0x1;updateWaitingCounter(_0x3f6d61);}}}else{if(!_0x3f6d61[_0x7a9a('0xb')]){_0x3f6d61[_0x7a9a('0x4')]+=0x1;}if(_0x3f6d61[_0x7a9a('0xb')]){_0x3f6d61[_0x7a9a('0x5')]+=0x1;updateWaitingCounter(_0x3f6d61);}}_0x3f6d61['total']+=0x1;return _0x3f6d61;}function getLastMessageText(_0xd9e143){return db[_0x7a9a('0xc')]['findOne']({'where':{'$and':[{'MailInteractionId':_0xd9e143['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x7a9a('0xd')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x7a9a('0xe')],'order':_0x7a9a('0xf'),'raw':!![]})['then'](function(_0x132a98){if(_0x132a98&&_0x132a98['plainBody']){_0xd9e143[_0x7a9a('0x10')]=_[_0x7a9a('0x11')](_0x132a98[_0x7a9a('0xe')]);}return _0xd9e143;})['catch'](function(_0x1f677e){throw _0x1f677e;});}exports[_0x7a9a('0x12')]=function(_0x3b737b,_0x1923da,_0x332d50,_0x33e063){return new Promise(function(_0x5272bf,_0xd9ff63){return getInteractionUsers(_0x3b737b['id'],_0x332d50)[_0x7a9a('0x13')](function(_0x5ab2f1){_0x3b737b[_0x7a9a('0x14')]=_0x5ab2f1;return getInteractionTags(_0x3b737b[_0x7a9a('0x15')],_0x1923da);})[_0x7a9a('0x13')](function(_0x3ea41d){_0x3b737b[_0x7a9a('0x16')]=_0x3ea41d;delete _0x3b737b['TagIds'];return updateInteractionCounters(_0x3b737b);})[_0x7a9a('0x13')](function(_0x54ec3b){if(_0x33e063){return getLastMessageText(_0x54ec3b);}else{return _0x54ec3b;}})[_0x7a9a('0x13')](function(_0x498ced){_0x5272bf(_0x498ced);})[_0x7a9a('0x17')](function(_0xea1c32){_0xd9ff63(_0xea1c32);});});}; \ No newline at end of file +var _0x3a72=['abandoned','disposition','unmanaged','UserId','plainBody','trimStart','catch','updateInteraction','then','Users','TagIds','Tags','lodash','../../mysqldb','map','fullname','split','forEach','waiting','talking','answered','total'];(function(_0x16d644,_0x46545e){var _0xf808cc=function(_0x4024ef){while(--_0x4024ef){_0x16d644['push'](_0x16d644['shift']());}};_0xf808cc(++_0x46545e);}(_0x3a72,0x140));var _0x23a7=function(_0x2e759c,_0x53617e){_0x2e759c=_0x2e759c-0x0;var _0x7d6016=_0x3a72[_0x2e759c];return _0x7d6016;};'use strict';var _=require(_0x23a7('0x0'));var db=require(_0x23a7('0x1'))['db'];function getInteractionUsers(_0x3dd8d0,_0x1519d8){return new Promise(function(_0x1d5c77,_0x4cb3f3){try{var _0x3699c0=[];if(_0x1519d8[_0x3dd8d0]){_0x3699c0=_0x1519d8[_0x3dd8d0][_0x23a7('0x2')](function(_0x983654){return{'id':_0x983654['id'],'fullname':_0x983654[_0x23a7('0x3')]};});}return _0x1d5c77(_0x3699c0);}catch(_0x556896){_0x4cb3f3(_0x556896);}});}function getInteractionTags(_0x3f87ef,_0x3eeeb3){var _0x2da7ac=[];if(_0x3f87ef){_0x3f87ef[_0x23a7('0x4')](',')[_0x23a7('0x5')](function(_0x240004){_0x2da7ac['push'](_0x3eeeb3[_0x240004]);});}return _0x2da7ac;}function updateWaitingCounter(_0x277737){if(_0x277737[_0x23a7('0x6')]){_0x277737[_0x23a7('0x6')]-=0x1;}}function updateInteractionCounters(_0x338341){_0x338341[_0x23a7('0x6')]=0x0;_0x338341[_0x23a7('0x7')]=0x0;_0x338341[_0x23a7('0x8')]=0x0;_0x338341['unmanaged']=0x0;_0x338341['abandoned']=0x0;_0x338341[_0x23a7('0x9')]=0x0;if(_0x338341['closed']){if(_0x338341['disposition']==='abandoned'){_0x338341[_0x23a7('0xa')]+=0x1;updateWaitingCounter(_0x338341);}if(_0x338341['UserId']){_0x338341[_0x23a7('0x8')]+=0x1;if(_0x338341[_0x23a7('0x7')]){_0x338341['talking']-=0x1;}}else{if(_0x338341[_0x23a7('0xb')]){_0x338341[_0x23a7('0xc')]+=0x1;updateWaitingCounter(_0x338341);}}}else{if(!_0x338341['UserId']){_0x338341[_0x23a7('0x6')]+=0x1;}if(_0x338341[_0x23a7('0xd')]){_0x338341[_0x23a7('0x7')]+=0x1;updateWaitingCounter(_0x338341);}}_0x338341[_0x23a7('0x9')]+=0x1;return _0x338341;}function getLastMessageText(_0x253abb){return db['MailMessage']['findOne']({'where':{'$and':[{'MailInteractionId':_0x253abb['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x23a7('0xe')],'order':'-id','raw':!![]})['then'](function(_0xb32d79){if(_0xb32d79&&_0xb32d79['plainBody']){_0x253abb['lastMsgText']=_[_0x23a7('0xf')](_0xb32d79[_0x23a7('0xe')]);}return _0x253abb;})[_0x23a7('0x10')](function(_0x5e8151){throw _0x5e8151;});}exports[_0x23a7('0x11')]=function(_0x2749b8,_0x5bf000,_0x59724b,_0x5adc01){return new Promise(function(_0x12e271,_0x5e1ed9){return getInteractionUsers(_0x2749b8['id'],_0x59724b)[_0x23a7('0x12')](function(_0x452828){_0x2749b8[_0x23a7('0x13')]=_0x452828;return getInteractionTags(_0x2749b8[_0x23a7('0x14')],_0x5bf000);})[_0x23a7('0x12')](function(_0x489ae0){_0x2749b8[_0x23a7('0x15')]=_0x489ae0;delete _0x2749b8[_0x23a7('0x14')];return updateInteractionCounters(_0x2749b8);})[_0x23a7('0x12')](function(_0x3fd223){if(_0x5adc01){return getLastMessageText(_0x3fd223);}else{return _0x3fd223;}})[_0x23a7('0x12')](function(_0x1d6a8f){_0x12e271(_0x1d6a8f);})[_0x23a7('0x10')](function(_0x445c4e){_0x5e1ed9(_0x445c4e);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index 7fa8baf..aecb09c 100644 --- a/server/components/interaction/utils.js +++ b/server/components/interaction/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd198=['error','exports','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Website','InteractionId','upperFirst','accounts','_interactions','_interaction_has_tags','_messages','user_has_','isArray','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','null','Interaction','findOne','then','update','info','catch'];(function(_0x3dee94,_0x52751d){var _0x3c1cb2=function(_0x6d8275){while(--_0x6d8275){_0x3dee94['push'](_0x3dee94['shift']());}};_0x3c1cb2(++_0x52751d);}(_0xd198,0xa2));var _0x8d19=function(_0x5e2afa,_0x17b749){_0x5e2afa=_0x5e2afa-0x0;var _0x2a86af=_0xd198[_0x5e2afa];return _0x2a86af;};'use strict';var _=require(_0x8d19('0x0'));var db=require(_0x8d19('0x1'))['db'];var loggers={'openchannel':require(_0x8d19('0x2'))(_0x8d19('0x3')),'mail':require(_0x8d19('0x2'))(_0x8d19('0x4')),'fax':require(_0x8d19('0x2'))('fax-interactions'),'sms':require('../../config/logger')(_0x8d19('0x5')),'chat':require(_0x8d19('0x2'))(_0x8d19('0x6')),'whatsapp':require(_0x8d19('0x2'))(_0x8d19('0x7'))};function getAccountFK(_0x2cb3ec){return _[_0x8d19('0x8')](_0x2cb3ec)+(_0x2cb3ec===_0x8d19('0x9')?_0x8d19('0xa'):'Account')+'Id';}function getInteractionFK(_0x10f200){return _[_0x8d19('0x8')](_0x10f200)+_0x8d19('0xb');}function getInteractionId(_0x449100,_0x50ce34,_0x5f55b4){if(_0x449100&&_0x449100[_[_0x8d19('0xc')](_0x5f55b4)+'InteractionId']){return _0x449100[_[_0x8d19('0xc')](_0x5f55b4)+'InteractionId'];}else if(_0x449100&&_0x449100['id']){return _0x449100['id'];}else if(_0x50ce34&&_0x50ce34['id']){return _0x50ce34['id'];}else{return'unknown';}}function getInteractionsTables(_0x373977){return{'accounts':_0x373977+'_'+(_0x373977===_0x8d19('0x9')?'websites':_0x8d19('0xd')),'interactions':_0x373977+_0x8d19('0xe'),'interactionsTags':_0x373977+_0x8d19('0xf'),'messages':_0x373977+_0x8d19('0x10'),'userInteractions':_0x8d19('0x11')+_0x373977+_0x8d19('0xe')};}function getSelectedTags(_0x505a8b){var _0x5e22e1=[];if(_0x505a8b){_0x5e22e1=Array[_0x8d19('0x12')](_0x505a8b)?_0x505a8b:[_0x505a8b];}return _0x5e22e1;}function log(_0xc7e39b,_0x275895,_0x23d84e,_0x3fefd2,_0x353bcf,_0xf687e8){loggers[_0x353bcf['toLowerCase']()][_0xc7e39b](_0x8d19('0x13'),_0xf687e8[_0x8d19('0x14')](),_0x275895?_0x275895['id']:null,_0x275895?_0x275895[_0x8d19('0x15')]:null,_0x275895?_0x275895[_0x8d19('0x16')]:null,getInteractionId(_0x23d84e,_0x3fefd2,_0x353bcf),_0x23d84e?JSON['stringify'](_0x23d84e):_0x8d19('0x17'));}function updateUser(_0x127e6b,_0x2b75e9,_0x4597fe,_0x4a89de,_0x461377){db[_['upperFirst'](_0x4a89de)+_0x8d19('0x18')][_0x8d19('0x19')]({'where':{'id':getInteractionId(_0x2b75e9,_0x4597fe,_0x4a89de)}})[_0x8d19('0x1a')](function(_0x4e9a06){if(_0x4e9a06){return _0x4e9a06[_0x8d19('0x1b')]({'UserId':_0x127e6b?_0x127e6b['id']:null});}})[_0x8d19('0x1a')](function(_0x1fb575){if(_0x1fb575){log(_0x8d19('0x1c'),_0x127e6b,_0x2b75e9,_0x4597fe,_0x4a89de,_0x461377);}})[_0x8d19('0x1d')](function(){log(_0x8d19('0x1e'),_0x127e6b,_0x2b75e9,_0x4597fe,_0x4a89de,_0x461377);});}module[_0x8d19('0x1f')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0xe81c=['whatsapp-interactions','capitalize','chat','Website','Account','InteractionId','upperFirst','unknown','websites','accounts','_interactions','_interaction_has_tags','_messages','user_has_','isArray','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','Interaction','findOne','then','info','catch','error','exports','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions'];(function(_0x4dbf18,_0x3a4db9){var _0x24e5df=function(_0x4a243d){while(--_0x4a243d){_0x4dbf18['push'](_0x4dbf18['shift']());}};_0x24e5df(++_0x3a4db9);}(_0xe81c,0x64));var _0xce81=function(_0x2f8a7c,_0x3f65fd){_0x2f8a7c=_0x2f8a7c-0x0;var _0x257e01=_0xe81c[_0x2f8a7c];return _0x257e01;};'use strict';var _=require(_0xce81('0x0'));var db=require(_0xce81('0x1'))['db'];var loggers={'openchannel':require(_0xce81('0x2'))(_0xce81('0x3')),'mail':require(_0xce81('0x2'))(_0xce81('0x4')),'fax':require('../../config/logger')(_0xce81('0x5')),'sms':require(_0xce81('0x2'))(_0xce81('0x6')),'chat':require('../../config/logger')(_0xce81('0x7')),'whatsapp':require(_0xce81('0x2'))(_0xce81('0x8'))};function getAccountFK(_0x1e5f63){return _[_0xce81('0x9')](_0x1e5f63)+(_0x1e5f63===_0xce81('0xa')?_0xce81('0xb'):_0xce81('0xc'))+'Id';}function getInteractionFK(_0x6098d1){return _[_0xce81('0x9')](_0x6098d1)+_0xce81('0xd');}function getInteractionId(_0x36c5c4,_0x7a3a8e,_0x26961e){if(_0x36c5c4&&_0x36c5c4[_[_0xce81('0xe')](_0x26961e)+'InteractionId']){return _0x36c5c4[_[_0xce81('0xe')](_0x26961e)+_0xce81('0xd')];}else if(_0x36c5c4&&_0x36c5c4['id']){return _0x36c5c4['id'];}else if(_0x7a3a8e&&_0x7a3a8e['id']){return _0x7a3a8e['id'];}else{return _0xce81('0xf');}}function getInteractionsTables(_0x563aff){return{'accounts':_0x563aff+'_'+(_0x563aff===_0xce81('0xa')?_0xce81('0x10'):_0xce81('0x11')),'interactions':_0x563aff+_0xce81('0x12'),'interactionsTags':_0x563aff+_0xce81('0x13'),'messages':_0x563aff+_0xce81('0x14'),'userInteractions':_0xce81('0x15')+_0x563aff+_0xce81('0x12')};}function getSelectedTags(_0x26fa0e){var _0x58bd3e=[];if(_0x26fa0e){_0x58bd3e=Array[_0xce81('0x16')](_0x26fa0e)?_0x26fa0e:[_0x26fa0e];}return _0x58bd3e;}function log(_0x7b98fc,_0x357ef1,_0x56e36e,_0x4ba2f6,_0x3da5c5,_0x502979){loggers[_0x3da5c5['toLowerCase']()][_0x7b98fc](_0xce81('0x17'),_0x502979[_0xce81('0x18')](),_0x357ef1?_0x357ef1['id']:null,_0x357ef1?_0x357ef1[_0xce81('0x19')]:null,_0x357ef1?_0x357ef1[_0xce81('0x1a')]:null,getInteractionId(_0x56e36e,_0x4ba2f6,_0x3da5c5),_0x56e36e?JSON[_0xce81('0x1b')](_0x56e36e):_0xce81('0x1c'));}function updateUser(_0x206065,_0x5c74e5,_0x29675a,_0x48a4ca,_0x192ef7){db[_[_0xce81('0xe')](_0x48a4ca)+_0xce81('0x1d')][_0xce81('0x1e')]({'where':{'id':getInteractionId(_0x5c74e5,_0x29675a,_0x48a4ca)}})[_0xce81('0x1f')](function(_0x3ee79a){if(_0x3ee79a){return _0x3ee79a['update']({'UserId':_0x206065?_0x206065['id']:null});}})[_0xce81('0x1f')](function(_0x4a7607){if(_0x4a7607){log(_0xce81('0x20'),_0x206065,_0x5c74e5,_0x29675a,_0x48a4ca,_0x192ef7);}})[_0xce81('0x21')](function(){log(_0xce81('0x22'),_0x206065,_0x5c74e5,_0x29675a,_0x48a4ca,_0x192ef7);});}module[_0xce81('0x23')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index fcc7c7b..2396600 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 _0xfb1e=['license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','base64','final','utf8','parse','hasOwnProperty','License','findOne','then','status','User','user','isUserLimit','util','composable-middleware','../../mysqldb','data1'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xfb1e,0x15c));var _0xefb1=function(_0x485ea7,_0x4cb7d7){_0x485ea7=_0x485ea7-0x0;var _0x18136f=_0xfb1e[_0x485ea7];return _0x18136f;};'use strict';var crypto=require('crypto');var util=require(_0xefb1('0x0'));var compose=require(_0xefb1('0x1'));var db=require(_0xefb1('0x2'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x3d51ff,_0x3447c9){if(_0x3d51ff&&_0x3447c9){if(_0x3447c9[_0xefb1('0x3')]&&_0x3447c9[_0xefb1('0x4')]){var _0x1846c6=_0x3447c9[_0xefb1('0x3')];var _0x3997f0=_0x3447c9[_0xefb1('0x4')];var _0x403ea3=_0x1846c6['split']('-')[0x4];var _0x221a08=_0x1846c6[_0xefb1('0x5')]('-')[0x0];var _0x247090=crypto[_0xefb1('0x6')](_0xefb1('0x7'),util[_0xefb1('0x8')](_0xefb1('0x9'),_0x403ea3,_0x1846c6,_0x221a08));var _0x3b170d=_0x247090['update'](_0x3997f0,_0xefb1('0xa'),'utf8');_0x3b170d+=_0x247090[_0xefb1('0xb')](_0xefb1('0xc'));var _0x300345=JSON[_0xefb1('0xd')](_0x3b170d);return _0x300345[_0xefb1('0xe')](_0x3d51ff)?_0x300345[_0x3d51ff]:null;}}return null;}function isLimit(_0x3039fd,_0x4cb947,_0x87d58a,_0x24db5c){var _0x5f39f4=_0x4cb947;return compose()['use'](function(_0x1cb9c9,_0x2b8c42,_0x3f5aee){return db[_0xefb1('0xf')][_0xefb1('0x10')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x1f2954){var _0x4b95b0=getValueFromLicense(_0x3039fd,_0x1f2954);return _0x4b95b0?_0x4b95b0:_0x5f39f4;})[_0xefb1('0x11')](function(_0x1e91f5){_0x5f39f4=_0x1e91f5;return _0x87d58a['count'](_0x24db5c);})[_0xefb1('0x11')](function(_0x215abf){if(_0x215abf>=_0x5f39f4){return _0x2b8c42[_0xefb1('0x12')](0x193)['json']({'message':util['format']('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x3039fd)});}_0x3f5aee();})['catch'](function(_0x2c0c0b){_0x3f5aee(_0x2c0c0b);});});}function isUserLimit(){return isLimit('users',0x1,db[_0xefb1('0x13')],{'where':{'$or':[{'role':'admin'},{'role':_0xefb1('0x14')}]}});}exports[_0xefb1('0x15')]=isUserLimit; \ No newline at end of file +var _0xede3=['final','parse','hasOwnProperty','use','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','User','admin','user','isUserLimit','util','composable-middleware','../../mysqldb','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64'];(function(_0x5dc9b0,_0x1f01db){var _0xe22637=function(_0x18eb84){while(--_0x18eb84){_0x5dc9b0['push'](_0x5dc9b0['shift']());}};_0xe22637(++_0x1f01db);}(_0xede3,0x1e3));var _0x3ede=function(_0x29f9f1,_0x2d497b){_0x29f9f1=_0x29f9f1-0x0;var _0x4930fb=_0xede3[_0x29f9f1];return _0x4930fb;};'use strict';var crypto=require('crypto');var util=require(_0x3ede('0x0'));var compose=require(_0x3ede('0x1'));var db=require(_0x3ede('0x2'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x3f0b7e,_0x437b9b){if(_0x3f0b7e&&_0x437b9b){if(_0x437b9b['data1']&&_0x437b9b['license']){var _0x59f7cd=_0x437b9b['data1'];var _0x12d846=_0x437b9b[_0x3ede('0x3')];var _0x1eaace=_0x59f7cd[_0x3ede('0x4')]('-')[0x4];var _0x2a55af=_0x59f7cd[_0x3ede('0x4')]('-')[0x0];var _0x297c8c=crypto[_0x3ede('0x5')](_0x3ede('0x6'),util[_0x3ede('0x7')](_0x3ede('0x8'),_0x1eaace,_0x59f7cd,_0x2a55af));var _0x312c40=_0x297c8c[_0x3ede('0x9')](_0x12d846,_0x3ede('0xa'),'utf8');_0x312c40+=_0x297c8c[_0x3ede('0xb')]('utf8');var _0x15aeb6=JSON[_0x3ede('0xc')](_0x312c40);return _0x15aeb6[_0x3ede('0xd')](_0x3f0b7e)?_0x15aeb6[_0x3f0b7e]:null;}}return null;}function isLimit(_0x37090c,_0x4c0d25,_0x5d2790,_0x4d6480){var _0x52fa3e=_0x4c0d25;return compose()[_0x3ede('0xe')](function(_0x3bbc41,_0x3d520b,_0x5d9841){return db['License'][_0x3ede('0xf')]({'where':{'id':0x1},'raw':!![]})[_0x3ede('0x10')](function(_0x490459){var _0x17eb36=getValueFromLicense(_0x37090c,_0x490459);return _0x17eb36?_0x17eb36:_0x52fa3e;})[_0x3ede('0x10')](function(_0x41e75e){_0x52fa3e=_0x41e75e;return _0x5d2790[_0x3ede('0x11')](_0x4d6480);})[_0x3ede('0x10')](function(_0x1713e3){if(_0x1713e3>=_0x52fa3e){return _0x3d520b[_0x3ede('0x12')](0x193)[_0x3ede('0x13')]({'message':util[_0x3ede('0x7')](_0x3ede('0x14'),_0x37090c)});}_0x5d9841();})[_0x3ede('0x15')](function(_0x2458ff){_0x5d9841(_0x2458ff);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x3ede('0x16')],{'where':{'$or':[{'role':_0x3ede('0x17')},{'role':_0x3ede('0x18')}]}});}exports[_0x3ede('0x19')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 0f30f17..1593b5c 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 _0xce71=['buildExpression','DATE','operator','$between','value','includes','$gt','add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','$ne','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$startsWith','$endsWith','LIKE\x20?','$lt','>\x20?','$lte','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','$notIn','start','$substring','shift','pop','utcOffset','hours','minutes','seconds','lodash','moment','startsWith','[$or]','and','replace','[$and]','split','length','slice','forEach','match','filter','indexOf','map','push'];(function(_0x17c161,_0x13b163){var _0xfe8291=function(_0x5506ed){while(--_0x5506ed){_0x17c161['push'](_0x17c161['shift']());}};_0xfe8291(++_0x13b163);}(_0xce71,0x9e));var _0x1ce7=function(_0x29f2fe,_0x1cb29e){_0x29f2fe=_0x29f2fe-0x0;var _0x1e6171=_0xce71[_0x29f2fe];return _0x1e6171;};'use strict';var _=require(_0x1ce7('0x0'));var moment=require(_0x1ce7('0x1'));exports['parseSearch']=function(_0x1480a8){var _0x3dfdf9={'conditions':[]};_0x3dfdf9['sqlOperator']=_[_0x1ce7('0x2')](_0x1480a8,_0x1ce7('0x3'))?'or':_0x1ce7('0x4');var _0x5b5e17=_0x1480a8[_0x1ce7('0x5')](_0x1ce7('0x6'),'')[_0x1ce7('0x5')](_0x1ce7('0x3'),'')[_0x1ce7('0x7')]('||');for(var _0x66064a=0x0;_0x66064a<_0x5b5e17[_0x1ce7('0x8')];_0x66064a++){var _0x430102=_0x5b5e17[_0x66064a][_0x1ce7('0x7')](':=');var _0x1e3aae=_0x430102[0x0];var _0x3dbed0=_0x430102[_0x1ce7('0x9')](0x1);_0x3dbed0[_0x1ce7('0xa')](function(_0x3f0c12){var _0x21f525=_0x3f0c12[_0x1ce7('0x7')]('[')['shift']();var _0x3af55f=_0x3f0c12[_0x1ce7('0xb')](/\[(.*?)\]/g);_0x3af55f[_0x1ce7('0xa')](function(_0x2379ac){var _0x57dddd=_0x2379ac['split']('[')[_0x1ce7('0xc')](function(_0x5dbfc1){return _0x5dbfc1[_0x1ce7('0xd')](']')>-0x1;})[_0x1ce7('0xe')](function(_0x502d24){return _0x502d24['split'](']')[0x0];})[0x0];_0x3dfdf9['conditions'][_0x1ce7('0xf')]({'field':_0x1e3aae,'operator':_0x21f525,'value':_0x57dddd});});});}return _0x3dfdf9;};exports[_0x1ce7('0x10')]=function(_0x470f0a,_0x38a1e7,_0x1f50b5){var _0x3b1b91={};if(_0x38a1e7===_0x1ce7('0x11')){if(_0x1f50b5['operator']==='$eq'){_0x1f50b5[_0x1ce7('0x12')]=_0x1ce7('0x13');_0x1f50b5[_0x1ce7('0x14')]+=','+_0x1f50b5[_0x1ce7('0x14')];}else if(_[_0x1ce7('0x15')]([_0x1ce7('0x16'),'$lte'],_0x1f50b5[_0x1ce7('0x12')])){_0x1f50b5[_0x1ce7('0x14')]=moment(_0x1f50b5[_0x1ce7('0x14')])[_0x1ce7('0x17')](0x1,_0x1ce7('0x18'))[_0x1ce7('0x19')](_0x1ce7('0x1a'));}}if(_0x1f50b5[_0x1ce7('0x1b')]){_0x38a1e7=_0x1f50b5['castTo'];_0x3b1b91[_0x1ce7('0x1c')]=_0x1ce7('0x1d')+_0x470f0a+'.'+_0x1f50b5[_0x1ce7('0x1e')]+'\x20AS\x20'+_0x1f50b5['castTo']+')\x20'+parseOperator(_0x1f50b5[_0x1ce7('0x12')]);}else{_0x3b1b91[_0x1ce7('0x1c')]=_0x470f0a+'.'+_0x1f50b5[_0x1ce7('0x1e')]+'\x20'+parseOperator(_0x1f50b5[_0x1ce7('0x12')]);}if(_[_0x1ce7('0x15')]([_0x1ce7('0x1f'),'$notIn'],_0x1f50b5[_0x1ce7('0x12')]))_0x3b1b91['text']='('+_0x3b1b91[_0x1ce7('0x1c')]+_0x1ce7('0x20')+_0x470f0a+'.'+_0x1f50b5[_0x1ce7('0x1e')]+_0x1ce7('0x21');_0x3b1b91[_0x1ce7('0x14')]=parseValue(_0x38a1e7,_0x1f50b5[_0x1ce7('0x12')],_0x1f50b5[_0x1ce7('0x14')]);return _0x3b1b91;};function parseOperator(_0x1f3be2){var _0x57c8a0;switch(_0x1f3be2){case _0x1ce7('0x22'):_0x57c8a0=_0x1ce7('0x23');break;case'$notIn':_0x57c8a0=_0x1ce7('0x24');break;case'$eq':_0x57c8a0=_0x1ce7('0x25');break;case _0x1ce7('0x1f'):_0x57c8a0=_0x1ce7('0x26');break;case'$substring':case _0x1ce7('0x27'):case _0x1ce7('0x28'):_0x57c8a0=_0x1ce7('0x29');break;case _0x1ce7('0x2a'):_0x57c8a0='<\x20?';break;case _0x1ce7('0x16'):_0x57c8a0=_0x1ce7('0x2b');break;case _0x1ce7('0x2c'):_0x57c8a0=_0x1ce7('0x2d');break;case _0x1ce7('0x2e'):_0x57c8a0=_0x1ce7('0x2f');break;case _0x1ce7('0x13'):_0x57c8a0=_0x1ce7('0x30');break;}return _0x57c8a0;}function parseValue(_0x232fa4,_0x26489d,_0x29739f){var _0x537b86={'start':undefined,'end':undefined};switch(_0x26489d){case _0x1ce7('0x22'):case _0x1ce7('0x31'):_0x537b86[_0x1ce7('0x32')]=_0x29739f[_0x1ce7('0x7')](',');break;case _0x1ce7('0x33'):_0x537b86['start']='%'+_0x29739f+'%';break;case _0x1ce7('0x27'):_0x537b86[_0x1ce7('0x32')]=_0x29739f+'%';break;case'$endsWith':_0x537b86[_0x1ce7('0x32')]='%'+_0x29739f;break;case _0x1ce7('0x13'):var _0x2df69d=_0x29739f['split'](',');var _0x29739f=_0x2df69d[_0x1ce7('0x34')]();var _0x14d002=_0x2df69d[_0x1ce7('0x35')]();if(_0x232fa4===_0x1ce7('0x11')){_0x29739f=moment(_0x29739f)[_0x1ce7('0x36')](0x0,!![])['format']();_0x14d002=moment(_0x14d002)['utcOffset'](0x0,!![])[_0x1ce7('0x17')](0x17,_0x1ce7('0x37'))['add'](0x3b,_0x1ce7('0x38'))[_0x1ce7('0x17')](0x3b,_0x1ce7('0x39'))[_0x1ce7('0x19')]();}_0x537b86={'start':_0x29739f,'end':_0x14d002};break;default:_0x537b86[_0x1ce7('0x32')]=_0x29739f;break;}return _0x537b86;} \ No newline at end of file +var _0x6730=['field','\x20AS\x20','text','\x20IS\x20NULL)','IN\x20?','$notIn','NOT\x20IN\x20?','$ne','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','<=\x20?','$gte','BETWEEN\x20?\x20AND\x20?','start','shift','pop','DATE','utcOffset','hours','add','moment','parseSearch','sqlOperator','startsWith','and','replace','[$or]','split','length','slice','forEach','match','filter','indexOf','push','buildExpression','operator','$eq','$between','value','includes','$gt','$lte','days','format','YYYY-MM-DD','castTo','CAST('];(function(_0x3a069c,_0x24a39a){var _0x314dd4=function(_0x45434f){while(--_0x45434f){_0x3a069c['push'](_0x3a069c['shift']());}};_0x314dd4(++_0x24a39a);}(_0x6730,0x122));var _0x0673=function(_0x35b2a1,_0x4cdca8){_0x35b2a1=_0x35b2a1-0x0;var _0x6023da=_0x6730[_0x35b2a1];return _0x6023da;};'use strict';var _=require('lodash');var moment=require(_0x0673('0x0'));exports[_0x0673('0x1')]=function(_0x376199){var _0x33ef23={'conditions':[]};_0x33ef23[_0x0673('0x2')]=_[_0x0673('0x3')](_0x376199,'[$or]')?'or':_0x0673('0x4');var _0x3df1e8=_0x376199[_0x0673('0x5')]('[$and]','')['replace'](_0x0673('0x6'),'')[_0x0673('0x7')]('||');for(var _0x36bf9c=0x0;_0x36bf9c<_0x3df1e8[_0x0673('0x8')];_0x36bf9c++){var _0x1d72a9=_0x3df1e8[_0x36bf9c]['split'](':=');var _0x30937=_0x1d72a9[0x0];var _0x5f5423=_0x1d72a9[_0x0673('0x9')](0x1);_0x5f5423[_0x0673('0xa')](function(_0x19bed5){var _0x1547ed=_0x19bed5[_0x0673('0x7')]('[')['shift']();var _0x588b37=_0x19bed5[_0x0673('0xb')](/\[(.*?)\]/g);_0x588b37[_0x0673('0xa')](function(_0x3e3611){var _0x254a5b=_0x3e3611['split']('[')[_0x0673('0xc')](function(_0x46436c){return _0x46436c[_0x0673('0xd')](']')>-0x1;})['map'](function(_0x2d7a18){return _0x2d7a18[_0x0673('0x7')](']')[0x0];})[0x0];_0x33ef23['conditions'][_0x0673('0xe')]({'field':_0x30937,'operator':_0x1547ed,'value':_0x254a5b});});});}return _0x33ef23;};exports[_0x0673('0xf')]=function(_0xc1467a,_0x49ec8c,_0x252cc8){var _0x57fed1={};if(_0x49ec8c==='DATE'){if(_0x252cc8[_0x0673('0x10')]===_0x0673('0x11')){_0x252cc8['operator']=_0x0673('0x12');_0x252cc8['value']+=','+_0x252cc8[_0x0673('0x13')];}else if(_[_0x0673('0x14')]([_0x0673('0x15'),_0x0673('0x16')],_0x252cc8['operator'])){_0x252cc8[_0x0673('0x13')]=moment(_0x252cc8[_0x0673('0x13')])['add'](0x1,_0x0673('0x17'))[_0x0673('0x18')](_0x0673('0x19'));}}if(_0x252cc8['castTo']){_0x49ec8c=_0x252cc8[_0x0673('0x1a')];_0x57fed1['text']=_0x0673('0x1b')+_0xc1467a+'.'+_0x252cc8[_0x0673('0x1c')]+_0x0673('0x1d')+_0x252cc8[_0x0673('0x1a')]+')\x20'+parseOperator(_0x252cc8[_0x0673('0x10')]);}else{_0x57fed1[_0x0673('0x1e')]=_0xc1467a+'.'+_0x252cc8[_0x0673('0x1c')]+'\x20'+parseOperator(_0x252cc8['operator']);}if(_[_0x0673('0x14')](['$ne','$notIn'],_0x252cc8[_0x0673('0x10')]))_0x57fed1[_0x0673('0x1e')]='('+_0x57fed1[_0x0673('0x1e')]+'\x20OR\x20'+_0xc1467a+'.'+_0x252cc8['field']+_0x0673('0x1f');_0x57fed1[_0x0673('0x13')]=parseValue(_0x49ec8c,_0x252cc8[_0x0673('0x10')],_0x252cc8[_0x0673('0x13')]);return _0x57fed1;};function parseOperator(_0x22b792){var _0x41941b;switch(_0x22b792){case'$in':_0x41941b=_0x0673('0x20');break;case _0x0673('0x21'):_0x41941b=_0x0673('0x22');break;case'$eq':_0x41941b='=\x20?';break;case _0x0673('0x23'):_0x41941b=_0x0673('0x24');break;case _0x0673('0x25'):case _0x0673('0x26'):case _0x0673('0x27'):_0x41941b=_0x0673('0x28');break;case _0x0673('0x29'):_0x41941b=_0x0673('0x2a');break;case _0x0673('0x15'):_0x41941b='>\x20?';break;case'$lte':_0x41941b=_0x0673('0x2b');break;case _0x0673('0x2c'):_0x41941b='>=\x20?';break;case _0x0673('0x12'):_0x41941b=_0x0673('0x2d');break;}return _0x41941b;}function parseValue(_0x261b20,_0x54e6e8,_0x1abbdc){var _0x357bf7={'start':undefined,'end':undefined};switch(_0x54e6e8){case'$in':case _0x0673('0x21'):_0x357bf7[_0x0673('0x2e')]=_0x1abbdc[_0x0673('0x7')](',');break;case _0x0673('0x25'):_0x357bf7[_0x0673('0x2e')]='%'+_0x1abbdc+'%';break;case'$startsWith':_0x357bf7[_0x0673('0x2e')]=_0x1abbdc+'%';break;case _0x0673('0x27'):_0x357bf7['start']='%'+_0x1abbdc;break;case _0x0673('0x12'):var _0x2d3ba2=_0x1abbdc[_0x0673('0x7')](',');var _0x1abbdc=_0x2d3ba2[_0x0673('0x2f')]();var _0x517c30=_0x2d3ba2[_0x0673('0x30')]();if(_0x261b20===_0x0673('0x31')){_0x1abbdc=moment(_0x1abbdc)['utcOffset'](0x0,!![])['format']();_0x517c30=moment(_0x517c30)[_0x0673('0x32')](0x0,!![])['add'](0x17,_0x0673('0x33'))[_0x0673('0x34')](0x3b,'minutes')['add'](0x3b,'seconds')['format']();}_0x357bf7={'start':_0x1abbdc,'end':_0x517c30};break;default:_0x357bf7['start']=_0x1abbdc;break;}return _0x357bf7;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 2e5e070..33efa59 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 _0x1176=['omit','isEmpty','length','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','{EXPR}','replace','push','join','getOptions','query','$id','model','keys','intersection','attributes','nolimit','offset','pick','filter','object','columns','value','where','lower','merge','include','includeAll','lodash','sequelize','moment','../../mysqldb','parse','alias','fields','raw','split','filters','forOwn','find','type','DATE','isPlainObject','$gte','YYYY-MM-DD','utc','format','$lte','subtract','name','uniqueid','isArray','limit','sort','map','indexOf','priority','col','substr','DESC','cast','unsigned','ASC'];(function(_0x136554,_0x17068a){var _0x54e52a=function(_0x465eec){while(--_0x465eec){_0x136554['push'](_0x136554['shift']());}};_0x54e52a(++_0x17068a);}(_0x1176,0xa3));var _0x6117=function(_0x2af8b5,_0x355183){_0x2af8b5=_0x2af8b5-0x0;var _0x396fd9=_0x1176[_0x2af8b5];return _0x396fd9;};'use strict';var _=require(_0x6117('0x0'));var sequelize=require(_0x6117('0x1'));var moment=require(_0x6117('0x2'));var db=require(_0x6117('0x3'))['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0xe4c81d){var _0x5d4d6d=['ne'];try{var _0x1e8640=JSON['parse'](_0xe4c81d);var _0x55ccc1=Object['keys'](_0x1e8640)[0x0];return _0x5d4d6d['includes'](_0x55ccc1);}catch(_0x47e012){return![];}}function getOperatorValue(_0x476bf0){var _0x215b9f=JSON['parse'](_0x476bf0);var _0x176ca7=Object['keys'](_0x215b9f)[0x0];var _0x4d61a0=_0x215b9f[_0x176ca7];return{['$'+_0x176ca7]:_0x4d61a0};}function parseIncludeModel(_0x13d7a8){var _0x400318=JSON[_0x6117('0x4')](_0x13d7a8);return{'model':db[_0x400318['model']],'as':_0x400318[_0x6117('0x5')],'attributes':_0x400318[_0x6117('0x6')],'raw':_0x400318[_0x6117('0x7')]};}exports[_0x6117('0x6')]=function(_0x18f7f2){var _0x1f1cc6=null;if(_0x18f7f2){_0x1f1cc6=_0x18f7f2[_0x6117('0x8')](',');}return _0x1f1cc6;};exports[_0x6117('0x9')]=function(_0x2ceb8b,_0x213581){var _0x5a0709={};if(!_['isEmpty'](_0x2ceb8b)){_[_0x6117('0xa')](_0x2ceb8b,function(_0x49f3bb,_0x51d3cd){try{if(_0x213581){var _0x9898f5=_[_0x6117('0xb')](_0x213581,{'name':_0x51d3cd})||{};if(hasSequelizeOperator(_0x49f3bb)){_0x5a0709[_0x51d3cd]=getOperatorValue(_0x49f3bb);}else if(_0x9898f5[_0x6117('0xc')]===_0x6117('0xd')&&_[_0x6117('0xe')](_0x49f3bb)){var _0x17f688=JSON['parse'](_0x49f3bb);var _0x2192ab={'$gte':moment(moment(_0x17f688[_0x6117('0xf')])['format'](_0x6117('0x10')))[_0x6117('0x11')]()[_0x6117('0x12')](),'$lte':moment(moment(_0x17f688[_0x6117('0x13')])[_0x6117('0x12')]('YYYY-MM-DD'))[_0x6117('0x11')]()[_0x6117('0x14')](0x1,'s')[_0x6117('0x12')]()};_0x5a0709[_0x51d3cd]=_0x2192ab;}else if(_0x9898f5[_0x6117('0x15')]===_0x6117('0x16')){_0x5a0709[_0x51d3cd]=_0x49f3bb;}else{_0x5a0709[_0x51d3cd]=_[_0x6117('0x17')](_0x49f3bb)?_0x49f3bb:JSON[_0x6117('0x4')](_0x49f3bb);}}else{_0x5a0709[_0x51d3cd]=_['isArray'](_0x49f3bb)?_0x49f3bb:JSON[_0x6117('0x4')](_0x49f3bb);}}catch(_0x267974){_0x5a0709[_0x51d3cd]=_0x49f3bb['split'](',');}});}return _0x5a0709;};exports[_0x6117('0x18')]=function(_0x55820a){_0x55820a=parseInt(_0x55820a,0xa);if(!_0x55820a||_0x55820a<0x0){_0x55820a=LIMIT_VALUE;}return _0x55820a;};exports['offset']=function(_0x116e1b){_0x116e1b=parseInt(_0x116e1b,0xa);if(!_0x116e1b||_0x116e1b<0x0){_0x116e1b=0x0;}return _0x116e1b;};exports[_0x6117('0x19')]=function(_0x53e61c){var _0x5b6f82,_0x5babd0=null;if(_0x53e61c){_0x5b6f82=_0x53e61c[_0x6117('0x8')](',');_0x5babd0=_[_0x6117('0x1a')](_0x5b6f82,function(_0x3169c6){if(_0x3169c6[_0x6117('0x1b')]('-')===0x0){return[_0x3169c6===_0x6117('0x1c')?sequelize['cast'](sequelize[_0x6117('0x1d')](_0x6117('0x1c')),'unsigned'):_0x3169c6[_0x6117('0x1e')](0x1),_0x6117('0x1f')];}else{return[_0x3169c6===_0x6117('0x1c')?sequelize[_0x6117('0x20')](sequelize[_0x6117('0x1d')](_0x6117('0x1c')),_0x6117('0x21')):_0x3169c6,_0x6117('0x22')];}});}return _0x5babd0;};exports[_0x6117('0x23')]=function(_0x5649ba,_0x31e2de){if(_[_0x6117('0x24')](_0x5649ba)){return _0x5649ba;}if(_['isArray'](_0x5649ba)){for(var _0x55b800=0x0;_0x55b800<_0x5649ba[_0x6117('0x25')];_0x55b800+=0x1){_0x5649ba[_0x55b800]=this['omit'](_0x5649ba[_0x55b800],_0x31e2de);}return _0x5649ba;}if(!_['isObject'](_0x5649ba)){return _0x5649ba;}if(_['isString'](_0x31e2de)){_0x31e2de=[_0x31e2de];}if(!_['isArray'](_0x31e2de)){return _0x5649ba;}for(var _0xad7c5c=0x0;_0xad7c5c<_0x31e2de[_0x6117('0x25')];_0xad7c5c+=0x1){_[_0x6117('0x26')](_0x5649ba,_0x31e2de[_0xad7c5c]);}for(var _0x139554 in _0x5649ba){if(_0x5649ba[_0x6117('0x27')](_0x139554)){_0x5649ba[_0x139554]=this[_0x6117('0x23')](_0x5649ba[_0x139554],_0x31e2de);}}return _0x5649ba;};exports[_0x6117('0x28')]=function(_0x3695ee){return _0x3695ee[_0x6117('0x29')](RegExp(_0x6117('0x2a')))?!![]:![];};exports['isEmail']=function(_0x49312d){return _0x49312d[_0x6117('0x29')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x3b5e59,_0x52ce1e){var _0x13af86=[];var _0x465f66=/[ `!@#$%^&*()_\-?~]/;var _0x31abb2=_0x52ce1e?'\x22{EXPR}\x22':_0x6117('0x2b');_0x3b5e59['split'](/[ ,]+/)['forEach'](function(_0x9ca10d){_0x9ca10d=_0x9ca10d[_0x6117('0x2c')](/([^:]")"+/g,'$1');_0x9ca10d='+'+_0x9ca10d+'*';var _0x4a4146=_0x9ca10d[_0x6117('0x29')](_0x465f66);if(_0x4a4146){_0x9ca10d='\x22'+_0x9ca10d+'\x22';}_0x13af86[_0x6117('0x2d')](_0x9ca10d);});_0x31abb2=_0x31abb2[_0x6117('0x2c')](_0x6117('0x2b'),_0x13af86[_0x6117('0x2e')]('\x20'));return _0x31abb2;};exports[_0x6117('0x2f')]=function(_0x1c556a,_0xb8f620,_0x2747b4){var _0x48ecb9={},_0x353830={};if(_0xb8f620[_0x6117('0x30')][_0x6117('0x31')]){_0xb8f620['query']['id']=_0xb8f620[_0x6117('0x30')][_0x6117('0x31')];delete _0xb8f620[_0x6117('0x30')]['$id'];}_0x48ecb9[_0x6117('0x32')]=_[_0x6117('0x1a')](_0x1c556a,_0x6117('0x15'));_0x48ecb9['query']=_[_0x6117('0x33')](_0xb8f620['query']);_0x48ecb9[_0x6117('0x9')]=_[_0x6117('0x34')](_0x48ecb9['model'],_0x48ecb9[_0x6117('0x30')]);_0x353830[_0x6117('0x35')]=_[_0x6117('0x34')](_0x48ecb9['model'],this[_0x6117('0x6')](_0xb8f620['query'][_0x6117('0x6')]));_0x353830[_0x6117('0x35')]=_0x353830[_0x6117('0x35')][_0x6117('0x25')]?_0x353830['attributes']:_0x48ecb9['model'];if(!_0xb8f620[_0x6117('0x30')]['hasOwnProperty'](_0x6117('0x36'))){_0x353830['limit']=this[_0x6117('0x18')](_0xb8f620[_0x6117('0x30')][_0x6117('0x18')]);_0x353830[_0x6117('0x37')]=this[_0x6117('0x37')](_0xb8f620[_0x6117('0x30')][_0x6117('0x37')]);}_0x353830['order']=this[_0x6117('0x19')](_0xb8f620[_0x6117('0x30')][_0x6117('0x19')]);_0x353830['where']=this[_0x6117('0x9')](_[_0x6117('0x38')](_0xb8f620[_0x6117('0x30')],_0x48ecb9[_0x6117('0x9')]),_0x1c556a);if(_0xb8f620[_0x6117('0x30')][_0x6117('0x39')]){var _0x265b8f=_0x1c556a;var _0x1208e1=_0xb8f620[_0x6117('0x30')][_0x6117('0x39')];if(typeof _0x1208e1===_0x6117('0x3a')){_0x265b8f=_[_0x6117('0x39')](_0x1c556a,function(_0x508d6d){return _['includes'](_0x1208e1[_0x6117('0x3b')],_0x508d6d[_0x6117('0x15')]);});_0x1208e1=_0x1208e1[_0x6117('0x3c')];}_0x353830[_0x6117('0x3d')]=_['merge'](_0x353830[_0x6117('0x3d')],{'$or':_[_0x6117('0x1a')](_0x265b8f,function(_0x4743cf){if(_0x4743cf[_0x6117('0xc')]!=='VIRTUAL'){if(_0x2747b4){return sequelize[_0x6117('0x3d')](sequelize['fn'](_0x6117('0x3e'),sequelize['col'](_0x4743cf['name'])),{'$like':sequelize['fn'](_0x6117('0x3e'),'%'+_0xb8f620[_0x6117('0x30')][_0x6117('0x39')]+'%')});}else{var _0x57c469={};_0x57c469[_0x4743cf[_0x6117('0x15')]]={'$like':'%'+_0xb8f620[_0x6117('0x30')][_0x6117('0x39')]+'%'};return _0x57c469;}}})});}_0x353830=_[_0x6117('0x3f')]({},_0x353830,_0xb8f620['options']);return _0x353830;};exports[_0x6117('0x40')]=function(_0x1175b5){var _0x3d977b=[];if(_0x1175b5[_0x6117('0x41')]){_0x3d977b['push']({'all':!![]});}else if(_0x1175b5[_0x6117('0x40')]){if(Array[_0x6117('0x17')](_0x1175b5[_0x6117('0x40')])){_0x3d977b=Object['keys'](_0x1175b5['include'])[_0x6117('0x1a')](function(_0x554510){return parseIncludeModel(_0x1175b5['include'][_0x554510]);});}else{var _0x3896de=parseIncludeModel(_0x1175b5[_0x6117('0x40')]);_0x3d977b['push'](_0x3896de);}}return _0x3d977b;}; \ No newline at end of file +var _0x2467=['getOptions','query','$id','intersection','attributes','order','where','filter','includes','columns','value','merge','map','lower','options','include','lodash','moment','parse','keys','model','fields','raw','split','filters','find','type','isPlainObject','$gte','utc','format','subtract','name','isArray','limit','offset','sort','indexOf','priority','cast','col','unsigned','substr','ASC','omit','isEmpty','length','isObject','isString','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','getFullTextValue','\x22{EXPR}\x22','{EXPR}','replace','push','join'];(function(_0x51f6f5,_0x431c1e){var _0x4e2624=function(_0x3866a7){while(--_0x3866a7){_0x51f6f5['push'](_0x51f6f5['shift']());}};_0x4e2624(++_0x431c1e);}(_0x2467,0xfc));var _0x7246=function(_0x1ab498,_0x376389){_0x1ab498=_0x1ab498-0x0;var _0x30520b=_0x2467[_0x1ab498];return _0x30520b;};'use strict';var _=require(_0x7246('0x0'));var sequelize=require('sequelize');var moment=require(_0x7246('0x1'));var db=require('../../mysqldb')['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x199a4d){var _0x360599=['ne'];try{var _0x59b95e=JSON[_0x7246('0x2')](_0x199a4d);var _0x285847=Object[_0x7246('0x3')](_0x59b95e)[0x0];return _0x360599['includes'](_0x285847);}catch(_0x104568){return![];}}function getOperatorValue(_0x499f18){var _0x4d70a2=JSON[_0x7246('0x2')](_0x499f18);var _0xa56f31=Object[_0x7246('0x3')](_0x4d70a2)[0x0];var _0xbf003c=_0x4d70a2[_0xa56f31];return{['$'+_0xa56f31]:_0xbf003c};}function parseIncludeModel(_0x596a38){var _0x39c13e=JSON[_0x7246('0x2')](_0x596a38);return{'model':db[_0x39c13e[_0x7246('0x4')]],'as':_0x39c13e['alias'],'attributes':_0x39c13e[_0x7246('0x5')],'raw':_0x39c13e[_0x7246('0x6')]};}exports[_0x7246('0x5')]=function(_0x4dd0f8){var _0x5fff1c=null;if(_0x4dd0f8){_0x5fff1c=_0x4dd0f8[_0x7246('0x7')](',');}return _0x5fff1c;};exports[_0x7246('0x8')]=function(_0x80f61,_0x1a40bc){var _0x4386bc={};if(!_['isEmpty'](_0x80f61)){_['forOwn'](_0x80f61,function(_0x33f9d6,_0x446bce){try{if(_0x1a40bc){var _0x3252f0=_[_0x7246('0x9')](_0x1a40bc,{'name':_0x446bce})||{};if(hasSequelizeOperator(_0x33f9d6)){_0x4386bc[_0x446bce]=getOperatorValue(_0x33f9d6);}else if(_0x3252f0[_0x7246('0xa')]==='DATE'&&_[_0x7246('0xb')](_0x33f9d6)){var _0x2a5858=JSON[_0x7246('0x2')](_0x33f9d6);var _0x1e1a74={'$gte':moment(moment(_0x2a5858[_0x7246('0xc')])['format']('YYYY-MM-DD'))[_0x7246('0xd')]()['format'](),'$lte':moment(moment(_0x2a5858['$lte'])[_0x7246('0xe')]('YYYY-MM-DD'))[_0x7246('0xd')]()[_0x7246('0xf')](0x1,'s')[_0x7246('0xe')]()};_0x4386bc[_0x446bce]=_0x1e1a74;}else if(_0x3252f0[_0x7246('0x10')]==='uniqueid'){_0x4386bc[_0x446bce]=_0x33f9d6;}else{_0x4386bc[_0x446bce]=_[_0x7246('0x11')](_0x33f9d6)?_0x33f9d6:JSON[_0x7246('0x2')](_0x33f9d6);}}else{_0x4386bc[_0x446bce]=_[_0x7246('0x11')](_0x33f9d6)?_0x33f9d6:JSON[_0x7246('0x2')](_0x33f9d6);}}catch(_0x562bf6){_0x4386bc[_0x446bce]=_0x33f9d6[_0x7246('0x7')](',');}});}return _0x4386bc;};exports[_0x7246('0x12')]=function(_0x190ac1){_0x190ac1=parseInt(_0x190ac1,0xa);if(!_0x190ac1||_0x190ac1<0x0){_0x190ac1=LIMIT_VALUE;}return _0x190ac1;};exports[_0x7246('0x13')]=function(_0x595977){_0x595977=parseInt(_0x595977,0xa);if(!_0x595977||_0x595977<0x0){_0x595977=0x0;}return _0x595977;};exports[_0x7246('0x14')]=function(_0x1a5c9d){var _0x4b6795,_0x2e107a=null;if(_0x1a5c9d){_0x4b6795=_0x1a5c9d[_0x7246('0x7')](',');_0x2e107a=_['map'](_0x4b6795,function(_0x34665b){if(_0x34665b[_0x7246('0x15')]('-')===0x0){return[_0x34665b===_0x7246('0x16')?sequelize[_0x7246('0x17')](sequelize[_0x7246('0x18')](_0x7246('0x16')),_0x7246('0x19')):_0x34665b[_0x7246('0x1a')](0x1),'DESC'];}else{return[_0x34665b===_0x7246('0x16')?sequelize[_0x7246('0x17')](sequelize[_0x7246('0x18')](_0x7246('0x16')),_0x7246('0x19')):_0x34665b,_0x7246('0x1b')];}});}return _0x2e107a;};exports[_0x7246('0x1c')]=function(_0x11c327,_0x154dce){if(_[_0x7246('0x1d')](_0x11c327)){return _0x11c327;}if(_[_0x7246('0x11')](_0x11c327)){for(var _0x1f23fd=0x0;_0x1f23fd<_0x11c327[_0x7246('0x1e')];_0x1f23fd+=0x1){_0x11c327[_0x1f23fd]=this['omit'](_0x11c327[_0x1f23fd],_0x154dce);}return _0x11c327;}if(!_[_0x7246('0x1f')](_0x11c327)){return _0x11c327;}if(_[_0x7246('0x20')](_0x154dce)){_0x154dce=[_0x154dce];}if(!_[_0x7246('0x11')](_0x154dce)){return _0x11c327;}for(var _0x34e917=0x0;_0x34e917<_0x154dce[_0x7246('0x1e')];_0x34e917+=0x1){_['unset'](_0x11c327,_0x154dce[_0x34e917]);}for(var _0x4820e3 in _0x11c327){if(_0x11c327[_0x7246('0x21')](_0x4820e3)){_0x11c327[_0x4820e3]=this[_0x7246('0x1c')](_0x11c327[_0x4820e3],_0x154dce);}}return _0x11c327;};exports[_0x7246('0x22')]=function(_0x14c15e){return _0x14c15e[_0x7246('0x23')](RegExp(_0x7246('0x24')))?!![]:![];};exports['isEmail']=function(_0x198feb){return _0x198feb[_0x7246('0x23')](/^\S+@\S+$/)?!![]:![];};exports[_0x7246('0x25')]=function(_0x968a2a,_0x25e5bb){var _0x27f1f6=[];var _0x4a6fd2=/[ `!@#$%^&*()_\-?~]/;var _0x40b1ab=_0x25e5bb?_0x7246('0x26'):_0x7246('0x27');_0x968a2a['split'](/[ ,]+/)['forEach'](function(_0x8e2b07){_0x8e2b07=_0x8e2b07[_0x7246('0x28')](/([^:]")"+/g,'$1');_0x8e2b07='+'+_0x8e2b07+'*';var _0x23e5c6=_0x8e2b07['match'](_0x4a6fd2);if(_0x23e5c6){_0x8e2b07='\x22'+_0x8e2b07+'\x22';}_0x27f1f6[_0x7246('0x29')](_0x8e2b07);});_0x40b1ab=_0x40b1ab[_0x7246('0x28')](_0x7246('0x27'),_0x27f1f6[_0x7246('0x2a')]('\x20'));return _0x40b1ab;};exports[_0x7246('0x2b')]=function(_0x163c2c,_0x12d7bf,_0x1fd769){var _0x496570={},_0x2ec8d0={};if(_0x12d7bf['query']['$id']){_0x12d7bf[_0x7246('0x2c')]['id']=_0x12d7bf[_0x7246('0x2c')][_0x7246('0x2d')];delete _0x12d7bf[_0x7246('0x2c')]['$id'];}_0x496570[_0x7246('0x4')]=_['map'](_0x163c2c,_0x7246('0x10'));_0x496570['query']=_[_0x7246('0x3')](_0x12d7bf['query']);_0x496570[_0x7246('0x8')]=_[_0x7246('0x2e')](_0x496570[_0x7246('0x4')],_0x496570[_0x7246('0x2c')]);_0x2ec8d0['attributes']=_[_0x7246('0x2e')](_0x496570['model'],this[_0x7246('0x5')](_0x12d7bf['query'][_0x7246('0x5')]));_0x2ec8d0[_0x7246('0x2f')]=_0x2ec8d0[_0x7246('0x2f')][_0x7246('0x1e')]?_0x2ec8d0[_0x7246('0x2f')]:_0x496570[_0x7246('0x4')];if(!_0x12d7bf[_0x7246('0x2c')][_0x7246('0x21')]('nolimit')){_0x2ec8d0[_0x7246('0x12')]=this['limit'](_0x12d7bf[_0x7246('0x2c')][_0x7246('0x12')]);_0x2ec8d0[_0x7246('0x13')]=this[_0x7246('0x13')](_0x12d7bf['query'][_0x7246('0x13')]);}_0x2ec8d0[_0x7246('0x30')]=this['sort'](_0x12d7bf['query'][_0x7246('0x14')]);_0x2ec8d0[_0x7246('0x31')]=this[_0x7246('0x8')](_['pick'](_0x12d7bf['query'],_0x496570['filters']),_0x163c2c);if(_0x12d7bf[_0x7246('0x2c')][_0x7246('0x32')]){var _0x2c4785=_0x163c2c;var _0x818001=_0x12d7bf['query']['filter'];if(typeof _0x818001==='object'){_0x2c4785=_[_0x7246('0x32')](_0x163c2c,function(_0x4b557f){return _[_0x7246('0x33')](_0x818001[_0x7246('0x34')],_0x4b557f[_0x7246('0x10')]);});_0x818001=_0x818001[_0x7246('0x35')];}_0x2ec8d0['where']=_[_0x7246('0x36')](_0x2ec8d0[_0x7246('0x31')],{'$or':_[_0x7246('0x37')](_0x2c4785,function(_0x5d7804){if(_0x5d7804[_0x7246('0xa')]!=='VIRTUAL'){if(_0x1fd769){return sequelize['where'](sequelize['fn'](_0x7246('0x38'),sequelize[_0x7246('0x18')](_0x5d7804[_0x7246('0x10')])),{'$like':sequelize['fn'](_0x7246('0x38'),'%'+_0x12d7bf[_0x7246('0x2c')][_0x7246('0x32')]+'%')});}else{var _0x5be66b={};_0x5be66b[_0x5d7804[_0x7246('0x10')]]={'$like':'%'+_0x12d7bf[_0x7246('0x2c')]['filter']+'%'};return _0x5be66b;}}})});}_0x2ec8d0=_['merge']({},_0x2ec8d0,_0x12d7bf[_0x7246('0x39')]);return _0x2ec8d0;};exports[_0x7246('0x3a')]=function(_0x4f17e6){var _0x3c2fda=[];if(_0x4f17e6['includeAll']){_0x3c2fda[_0x7246('0x29')]({'all':!![]});}else if(_0x4f17e6[_0x7246('0x3a')]){if(Array[_0x7246('0x11')](_0x4f17e6[_0x7246('0x3a')])){_0x3c2fda=Object[_0x7246('0x3')](_0x4f17e6[_0x7246('0x3a')])[_0x7246('0x37')](function(_0x409add){return parseIncludeModel(_0x4f17e6[_0x7246('0x3a')][_0x409add]);});}else{var _0xc1fcac=parseIncludeModel(_0x4f17e6[_0x7246('0x3a')]);_0x3c2fda[_0x7246('0x29')](_0xc1fcac);}}return _0x3c2fda;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index 43a2ccc..07d615e 100644 --- a/server/components/realtime/agents.js +++ b/server/components/realtime/agents.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4819=['queue','destconnectedlinenum','omit','pick','filterAgentAttributes','role','whatsappStatusTime','chatCapacity','mailCurrentCapacity','phoneBarEnableAutomaticScreenRecording','onhold','routealias','getRealtimeAgentsQueryFields','jayson/promise','../../mysqldb','client','http','chatPause','mailPause','voicePause','whatsappPause','every','filter','length','unknown','unavailable','ringing','isNil','voiceStatus','idle','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','Agents','then','error','result','request','merge','catch','getRealtimeAgents','pause','*pause','busy','isArray','startCase','Queue','findOne','getAgents','all','flatten','map','value','getAgentIdsByQueues','includes','getAgentIdsByStatus','User','findAll','name','fullname','openchannelPause','smsPause','pauseType','globalStatus','split','fields','startsWith','ASC','fullname,internal','internal','indexOf','validateSortParameter','DESC','toLowerCase','userpic','online','lastLoginAt','lastPauseAt','faxPause','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','voiceStatusTime'];(function(_0x49e220,_0x66061a){var _0xe72b28=function(_0x472faf){while(--_0x472faf){_0x49e220['push'](_0x49e220['shift']());}};_0xe72b28(++_0x66061a);}(_0x4819,0xcd));var _0x9481=function(_0x3b45d7,_0xbc2848){_0x3b45d7=_0x3b45d7-0x0;var _0x4690e8=_0x4819[_0x3b45d7];return _0x4690e8;};'use strict';var _=require('lodash');var jayson=require(_0x9481('0x0'));var db=require(_0x9481('0x1'))['db'];var amiClient=jayson[_0x9481('0x2')][_0x9481('0x3')]({'port':0x232a});var routingClient=jayson[_0x9481('0x2')][_0x9481('0x3')]({'port':0x232c});function isAgentPaused(_0x40a703,_0x14dc10){var _0xc39edf=[_0x40a703[_0x9481('0x4')],_0x40a703['faxPause'],_0x40a703[_0x9481('0x5')],_0x40a703['openchannelPause'],_0x40a703['smsPause'],_0x40a703[_0x9481('0x6')],_0x40a703[_0x9481('0x7')]];if(!_0x14dc10)return _[_0x9481('0x8')](_0xc39edf);var _0x3278ff=_[_0x9481('0x9')](_0xc39edf);return _0x3278ff['length']>0x0&&_0x3278ff[_0x9481('0xa')]<_0xc39edf['length']?!![]:![];}function isIdle(_0x2fabf1){return _0x2fabf1==='idle'||_0x2fabf1===_0x9481('0xb')||_0x2fabf1===_0x9481('0xc')||_0x2fabf1===_0x9481('0xd')||_[_0x9481('0xe')](_0x2fabf1);}function isAgentIdle(_0xe84f77){if(_0xe84f77[_0x9481('0xf')]!==_0x9481('0x10')&&_0xe84f77[_0x9481('0x6')]){_0xe84f77[_0x9481('0xf')]='pause';return![];}return _['every']([_0xe84f77[_0x9481('0x11')],_0xe84f77[_0x9481('0x12')],_0xe84f77[_0x9481('0x13')],_0xe84f77[_0x9481('0x14')],_0xe84f77[_0x9481('0x15')],_0xe84f77[_0x9481('0xf')],_0xe84f77[_0x9481('0x16')]],isIdle);}function getRealtimeAgents(){return amiClient['request'](_0x9481('0x17'),{})[_0x9481('0x18')](function(_0x5b1fe6){if(_0x5b1fe6[_0x9481('0x19')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');}var _0x34108d=_0x5b1fe6[_0x9481('0x1a')];return routingClient[_0x9481('0x1b')](_0x9481('0x17'),{})['then'](function(_0x5eda66){if(_0x5eda66[_0x9481('0x19')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x4d0da7=_0x5eda66[_0x9481('0x1a')];return _[_0x9481('0x1c')]({},_0x34108d,_0x4d0da7);});})[_0x9481('0x1d')](function(_0x41051d){throw _0x41051d;});}exports[_0x9481('0x1e')]=getRealtimeAgents;function getAgentStatus(_0x3dc33f){var _0x55a1bd=_0x9481('0xb');if(isAgentPaused(_0x3dc33f))_0x55a1bd=_0x9481('0x1f');else if(isAgentPaused(_0x3dc33f,!![]))_0x55a1bd=_0x9481('0x20');else if(isAgentIdle(_0x3dc33f))_0x55a1bd=_0x9481('0x10');else _0x55a1bd=_0x9481('0x21');return _0x55a1bd;}exports['getAgentStatus']=getAgentStatus;function getAgentIdsByQueues(_0x215dd7,_0x294908){var _0x572599=_[_0x9481('0x22')](_0x215dd7)?_0x215dd7:[_0x215dd7];var _0xd1cd1a=_[_0x9481('0x23')](_0x294908)+_0x9481('0x24');var _0x2dc02e=_['map'](_0x572599,function(_0x91e3d9){return db[_0xd1cd1a][_0x9481('0x25')]({'where':{'id':_0x91e3d9}})['then'](function(_0x5eb4f5){if(!_0x5eb4f5)return[];return _0x5eb4f5[_0x9481('0x26')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x9481('0x27')](_0x2dc02e)['then'](function(_0x1e6f28){var _0x20ff9a=_(_0x1e6f28)[_0x9481('0x28')]()[_0x9481('0x29')]('id')['uniq']()[_0x9481('0x2a')]();return _0x20ff9a;});}exports[_0x9481('0x2b')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x3c2585,_0x587706,_0x1791b2){try{if(_0x587706['length']>0x0){_0x3c2585=_0x3c2585[_0x9481('0x9')](function(_0xe153ab){return _0x587706[_0x9481('0x2c')](_0xe153ab['id']);});}var _0x13ef93=_0x3c2585[_0x9481('0x9')](function(_0x53560d){var _0x2aa9ff=_0x9481('0x21');if(isAgentIdle(_0x53560d)){_0x2aa9ff=_0x9481('0x10');}return _0x2aa9ff===_0x1791b2;});return _['map'](_0x13ef93,'id');}catch(_0x56752e){throw _0x56752e;}}exports[_0x9481('0x2d')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x427c25,_0x42df68,_0x2b33f8){return Promise['resolve']()['then'](function(){if(_0x42df68['length']>0x0){_0x427c25=_0x427c25[_0x9481('0x9')](function(_0x5d6c65){return _0x42df68[_0x9481('0x2c')](_0x5d6c65['id']);});}return _0x427c25;})['then'](function(){return db[_0x9481('0x2e')][_0x9481('0x2f')]({'attributes':['id',_0x9481('0x30'),_0x9481('0x31'),_0x9481('0x4'),'faxPause',_0x9481('0x5'),_0x9481('0x32'),_0x9481('0x33'),'voicePause',_0x9481('0x7'),_0x9481('0x34')],'where':{'id':{'$in':_[_0x9481('0x29')](_0x427c25,'id')}},'raw':!![]});})[_0x9481('0x18')](function(_0xdc87e6){return _0xdc87e6[_0x9481('0x29')](function(_0x5d7299){var _0x41c6a2=_['find'](_0x427c25,['id',_0x5d7299['id']]);var _0x203ef9=filterAgentAttributes(_0x41c6a2);_[_0x9481('0x1c')](_0x5d7299,_0x203ef9);_0x5d7299[_0x9481('0x35')]=getAgentStatus(_0x5d7299);return _0x5d7299;});})[_0x9481('0x18')](function(_0x2ebcbd){var _0x2face9=sortAgentsByStatus(_0x2ebcbd,_0x2b33f8);return _['map'](_0x2face9,'id');})[_0x9481('0x1d')](function(_0x15e27f){throw _0x15e27f;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x5e00ad){var _0x31ea6a={'fields':[],'order':null};var _0x5ab28f=_0x5e00ad[_0x9481('0x36')](',');_0x31ea6a[_0x9481('0x37')]=_[_0x9481('0x9')](_0x5ab28f,function(_0x2a1bcf){if(!_0x2a1bcf['includes'](_0x9481('0x35'))){return!![];}_0x31ea6a['order']=_[_0x9481('0x38')](_0x2a1bcf,'-')?'DESC':_0x9481('0x39');return![];});return _0x31ea6a;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x315fb9){if(!_0x315fb9){_0x315fb9=_0x9481('0x3a');}if(_0x315fb9[_0x9481('0x2c')](_0x9481('0x31'))&&!_0x315fb9[_0x9481('0x2c')](_0x9481('0x3b'))){var _0xb6ff1=_0x315fb9['substring'](0x0,_0x315fb9[_0x9481('0x3c')](_0x9481('0x31')));_0x315fb9+=','+_0xb6ff1+_0x9481('0x3b');}return _0x315fb9;}exports[_0x9481('0x3d')]=validateSortParameter;function sortAgentsByStatus(_0x3f1b6f,_0x344e2d){var _0x2e4241=_0x3f1b6f['sort'](function(_0xf7b2e1,_0x1872ff){if(_0xf7b2e1['globalStatus']===_0x1872ff[_0x9481('0x35')]){if(_0xf7b2e1[_0x9481('0x35')]===_0x9481('0x1f')){if(_0x344e2d===_0x9481('0x3e')){return(_0xf7b2e1[_0x9481('0x34')]||'')<(_0x1872ff['pauseType']||'')||_0xf7b2e1[_0x9481('0x31')]['toLowerCase']()>_0x1872ff[_0x9481('0x31')][_0x9481('0x3f')]()?0x1:-0x1;}else{return(_0xf7b2e1['pauseType']||'')<(_0x1872ff['pauseType']||'')||_0xf7b2e1[_0x9481('0x31')][_0x9481('0x3f')]()>_0x1872ff[_0x9481('0x31')]['toLowerCase']()?-0x1:0x1;}}else{if(_0x344e2d===_0x9481('0x3e')){return _0xf7b2e1[_0x9481('0x31')]['toLowerCase']()<_0x1872ff['fullname'][_0x9481('0x3f')]()?0x1:-0x1;}else{return _0xf7b2e1['fullname'][_0x9481('0x3f')]()<_0x1872ff[_0x9481('0x31')][_0x9481('0x3f')]()?-0x1:0x1;}}}else{if(_0x344e2d===_0x9481('0x3e')){return _0xf7b2e1[_0x9481('0x35')]<_0x1872ff['globalStatus']?0x1:-0x1;}else{return _0xf7b2e1[_0x9481('0x35')]<_0x1872ff[_0x9481('0x35')]?-0x1:0x1;}}});return _0x2e4241;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x1c98fa){var _0x35d740=[_0x9481('0x40'),_0x9481('0x41'),_0x9481('0x42'),_0x9481('0x43'),_0x9481('0x34'),_0x9481('0x43'),_0x9481('0x3b'),'address',_0x9481('0x4'),'openchannelPause','mailPause',_0x9481('0x33'),'whatsappPause',_0x9481('0x44'),_0x9481('0x6'),'chatCapacity',_0x9481('0x45'),_0x9481('0x46'),_0x9481('0x47'),_0x9481('0x48'),_0x9481('0x49'),_0x9481('0x4a'),'openchannelCurrentCapacity','mailCurrentCapacity',_0x9481('0x4b'),_0x9481('0x4c'),_0x9481('0x4d'),_0x9481('0x11'),_0x9481('0x14'),_0x9481('0x13'),_0x9481('0x15'),_0x9481('0x16'),'faxStatus',_0x9481('0xf'),_0x9481('0x4e'),_0x9481('0x4f'),_0x9481('0x50'),_0x9481('0x51'),'whatsappStatusTime','faxStatusTime',_0x9481('0x52'),_0x9481('0x53'),_0x9481('0x54'),'screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias'];var _0x538507=['chatPause','openchannelPause',_0x9481('0x5'),_0x9481('0x33'),'whatsappPause',_0x9481('0x44'),'voicePause',_0x9481('0x41')];var _0x229b69=_(_0x1c98fa)[_0x9481('0x55')](_0x538507)[_0x9481('0x56')](_0x35d740)[_0x9481('0x2a')]();return _0x229b69;}exports[_0x9481('0x57')]=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0x9481('0x30'),'fullname',_0x9481('0x58'),_0x9481('0x3b'),'online',_0x9481('0x35'),_0x9481('0x40'),_0x9481('0x42'),_0x9481('0x34'),_0x9481('0x43'),'faxPause',_0x9481('0x4'),_0x9481('0x5'),_0x9481('0x32'),_0x9481('0x33'),_0x9481('0x6'),_0x9481('0x7'),_0x9481('0x11'),_0x9481('0x12'),_0x9481('0x13'),'openchannelStatus','smsStatus','voiceStatus',_0x9481('0x16'),_0x9481('0x4e'),'faxStatusTime',_0x9481('0x50'),_0x9481('0x4f'),_0x9481('0x51'),_0x9481('0x52'),_0x9481('0x59'),_0x9481('0x5a'),'faxCapacity','mailCapacity',_0x9481('0x45'),_0x9481('0x47'),_0x9481('0x48'),_0x9481('0x4a'),_0x9481('0x4d'),_0x9481('0x5b'),'openchannelCurrentCapacity','smsCurrentCapacity',_0x9481('0x4c'),'phoneBarEnableScreenRecordingByAgent',_0x9481('0x5c'),'destconnectedlinenum',_0x9481('0x5d'),_0x9481('0x53'),_0x9481('0x5e'),'screenrecording'];}exports[_0x9481('0x5f')]=getRealtimeAgentsQueryFields; \ No newline at end of file +var _0x7fbe=['chatPause','faxPause','mailPause','openchannelPause','smsPause','voicePause','every','filter','length','idle','unknown','unavailable','ringing','isNil','voiceStatus','pause','chatStatus','faxStatus','openchannelStatus','smsStatus','whatsappStatus','request','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','*pause','getAgentStatus','isArray','map','getAgents','flatten','uniq','value','includes','busy','getAgentIdsByStatus','resolve','User','findAll','name','fullname','whatsappPause','pauseType','find','globalStatus','catch','getSortedAgentsIdsByStatus','split','fields','order','DESC','ASC','getUpdatedSortOptions','internal','substring','indexOf','validateSortParameter','sort','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','whatsappCurrentCapacity','chatStatusTime','mailStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','pick','filterAgentAttributes','role','mailStatus','openchannelStatusTime','smsStatusTime','chatCapacity','smsCurrentCapacity','onhold','routealias','../../mysqldb','client','http'];(function(_0x14ed4e,_0x3dcf54){var _0x5c3d8a=function(_0x284a91){while(--_0x284a91){_0x14ed4e['push'](_0x14ed4e['shift']());}};_0x5c3d8a(++_0x3dcf54);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x6b5f2e,_0x98ce11){_0x6b5f2e=_0x6b5f2e-0x0;var _0x572297=_0x7fbe[_0x6b5f2e];return _0x572297;};'use strict';var _=require('lodash');var jayson=require('jayson/promise');var db=require(_0xe7fb('0x0'))['db'];var amiClient=jayson[_0xe7fb('0x1')][_0xe7fb('0x2')]({'port':0x232a});var routingClient=jayson[_0xe7fb('0x1')][_0xe7fb('0x2')]({'port':0x232c});function isAgentPaused(_0x47625b,_0x11d2c4){var _0x4524ff=[_0x47625b[_0xe7fb('0x3')],_0x47625b[_0xe7fb('0x4')],_0x47625b[_0xe7fb('0x5')],_0x47625b[_0xe7fb('0x6')],_0x47625b[_0xe7fb('0x7')],_0x47625b[_0xe7fb('0x8')],_0x47625b['whatsappPause']];if(!_0x11d2c4)return _[_0xe7fb('0x9')](_0x4524ff);var _0x228f6b=_[_0xe7fb('0xa')](_0x4524ff);return _0x228f6b[_0xe7fb('0xb')]>0x0&&_0x228f6b['length']<_0x4524ff['length']?!![]:![];}function isIdle(_0x29edb2){return _0x29edb2===_0xe7fb('0xc')||_0x29edb2===_0xe7fb('0xd')||_0x29edb2===_0xe7fb('0xe')||_0x29edb2===_0xe7fb('0xf')||_[_0xe7fb('0x10')](_0x29edb2);}function isAgentIdle(_0x3e934b){if(_0x3e934b[_0xe7fb('0x11')]!==_0xe7fb('0xc')&&_0x3e934b[_0xe7fb('0x8')]){_0x3e934b[_0xe7fb('0x11')]=_0xe7fb('0x12');return![];}return _[_0xe7fb('0x9')]([_0x3e934b[_0xe7fb('0x13')],_0x3e934b[_0xe7fb('0x14')],_0x3e934b['mailStatus'],_0x3e934b[_0xe7fb('0x15')],_0x3e934b[_0xe7fb('0x16')],_0x3e934b['voiceStatus'],_0x3e934b[_0xe7fb('0x17')]],isIdle);}function getRealtimeAgents(){return amiClient[_0xe7fb('0x18')]('Agents',{})[_0xe7fb('0x19')](function(_0x559129){if(_0x559129[_0xe7fb('0x1a')]){throw new Error(_0xe7fb('0x1b'));}var _0x12603d=_0x559129[_0xe7fb('0x1c')];return routingClient['request'](_0xe7fb('0x1d'),{})['then'](function(_0x293a47){if(_0x293a47['error']){throw new Error(_0xe7fb('0x1e'));}var _0x4708f7=_0x293a47[_0xe7fb('0x1c')];return _[_0xe7fb('0x1f')]({},_0x12603d,_0x4708f7);});})['catch'](function(_0x44466e){throw _0x44466e;});}exports['getRealtimeAgents']=getRealtimeAgents;function getAgentStatus(_0x11cae0){var _0x51f01f=_0xe7fb('0xd');if(isAgentPaused(_0x11cae0))_0x51f01f='pause';else if(isAgentPaused(_0x11cae0,!![]))_0x51f01f=_0xe7fb('0x20');else if(isAgentIdle(_0x11cae0))_0x51f01f=_0xe7fb('0xc');else _0x51f01f='busy';return _0x51f01f;}exports[_0xe7fb('0x21')]=getAgentStatus;function getAgentIdsByQueues(_0x4742bd,_0x3ae8f1){var _0x4dcb4b=_[_0xe7fb('0x22')](_0x4742bd)?_0x4742bd:[_0x4742bd];var _0x469ead=_['startCase'](_0x3ae8f1)+'Queue';var _0x52f08b=_[_0xe7fb('0x23')](_0x4dcb4b,function(_0x53c43a){return db[_0x469ead]['findOne']({'where':{'id':_0x53c43a}})[_0xe7fb('0x19')](function(_0x32e8b2){if(!_0x32e8b2)return[];return _0x32e8b2[_0xe7fb('0x24')]({'attributes':['id'],'raw':!![]});});});return Promise['all'](_0x52f08b)[_0xe7fb('0x19')](function(_0x2b69c4){var _0x390f32=_(_0x2b69c4)[_0xe7fb('0x25')]()[_0xe7fb('0x23')]('id')[_0xe7fb('0x26')]()[_0xe7fb('0x27')]();return _0x390f32;});}exports['getAgentIdsByQueues']=getAgentIdsByQueues;function getAgentIdsByStatus(_0x5df9f2,_0x1086e6,_0x3bdee9){try{if(_0x1086e6[_0xe7fb('0xb')]>0x0){_0x5df9f2=_0x5df9f2['filter'](function(_0xb1f2f4){return _0x1086e6[_0xe7fb('0x28')](_0xb1f2f4['id']);});}var _0xd3fffe=_0x5df9f2[_0xe7fb('0xa')](function(_0x219554){var _0x1256d4=_0xe7fb('0x29');if(isAgentIdle(_0x219554)){_0x1256d4=_0xe7fb('0xc');}return _0x1256d4===_0x3bdee9;});return _['map'](_0xd3fffe,'id');}catch(_0x3d1fb5){throw _0x3d1fb5;}}exports[_0xe7fb('0x2a')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x29d1ca,_0x547a04,_0x517d70){return Promise[_0xe7fb('0x2b')]()['then'](function(){if(_0x547a04[_0xe7fb('0xb')]>0x0){_0x29d1ca=_0x29d1ca[_0xe7fb('0xa')](function(_0xe49053){return _0x547a04[_0xe7fb('0x28')](_0xe49053['id']);});}return _0x29d1ca;})['then'](function(){return db[_0xe7fb('0x2c')][_0xe7fb('0x2d')]({'attributes':['id',_0xe7fb('0x2e'),_0xe7fb('0x2f'),_0xe7fb('0x3'),'faxPause',_0xe7fb('0x5'),_0xe7fb('0x6'),_0xe7fb('0x7'),_0xe7fb('0x8'),_0xe7fb('0x30'),_0xe7fb('0x31')],'where':{'id':{'$in':_[_0xe7fb('0x23')](_0x29d1ca,'id')}},'raw':!![]});})[_0xe7fb('0x19')](function(_0x389903){return _0x389903['map'](function(_0x44d8cf){var _0x29ef52=_[_0xe7fb('0x32')](_0x29d1ca,['id',_0x44d8cf['id']]);var _0x56e17b=filterAgentAttributes(_0x29ef52);_[_0xe7fb('0x1f')](_0x44d8cf,_0x56e17b);_0x44d8cf[_0xe7fb('0x33')]=getAgentStatus(_0x44d8cf);return _0x44d8cf;});})[_0xe7fb('0x19')](function(_0x1530b1){var _0x402ca3=sortAgentsByStatus(_0x1530b1,_0x517d70);return _[_0xe7fb('0x23')](_0x402ca3,'id');})[_0xe7fb('0x34')](function(_0xc4e271){throw _0xc4e271;});}exports[_0xe7fb('0x35')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0xebfe1d){var _0x29c34a={'fields':[],'order':null};var _0x3c4f4b=_0xebfe1d[_0xe7fb('0x36')](',');_0x29c34a[_0xe7fb('0x37')]=_[_0xe7fb('0xa')](_0x3c4f4b,function(_0x41e2d1){if(!_0x41e2d1[_0xe7fb('0x28')](_0xe7fb('0x33'))){return!![];}_0x29c34a[_0xe7fb('0x38')]=_['startsWith'](_0x41e2d1,'-')?_0xe7fb('0x39'):_0xe7fb('0x3a');return![];});return _0x29c34a;}exports[_0xe7fb('0x3b')]=getUpdatedSortOptions;function validateSortParameter(_0x444f98){if(!_0x444f98){_0x444f98='fullname,internal';}if(_0x444f98[_0xe7fb('0x28')](_0xe7fb('0x2f'))&&!_0x444f98[_0xe7fb('0x28')](_0xe7fb('0x3c'))){var _0x49fe9d=_0x444f98[_0xe7fb('0x3d')](0x0,_0x444f98[_0xe7fb('0x3e')](_0xe7fb('0x2f')));_0x444f98+=','+_0x49fe9d+_0xe7fb('0x3c');}return _0x444f98;}exports[_0xe7fb('0x3f')]=validateSortParameter;function sortAgentsByStatus(_0xb729fc,_0x5c4243){var _0x4362c2=_0xb729fc[_0xe7fb('0x40')](function(_0x3a96cd,_0x4b263d){if(_0x3a96cd[_0xe7fb('0x33')]===_0x4b263d[_0xe7fb('0x33')]){if(_0x3a96cd['globalStatus']==='pause'){if(_0x5c4243==='DESC'){return(_0x3a96cd['pauseType']||'')<(_0x4b263d['pauseType']||'')||_0x3a96cd[_0xe7fb('0x2f')][_0xe7fb('0x41')]()>_0x4b263d[_0xe7fb('0x2f')]['toLowerCase']()?0x1:-0x1;}else{return(_0x3a96cd[_0xe7fb('0x31')]||'')<(_0x4b263d['pauseType']||'')||_0x3a96cd[_0xe7fb('0x2f')][_0xe7fb('0x41')]()>_0x4b263d['fullname'][_0xe7fb('0x41')]()?-0x1:0x1;}}else{if(_0x5c4243===_0xe7fb('0x39')){return _0x3a96cd[_0xe7fb('0x2f')][_0xe7fb('0x41')]()<_0x4b263d['fullname'][_0xe7fb('0x41')]()?0x1:-0x1;}else{return _0x3a96cd[_0xe7fb('0x2f')][_0xe7fb('0x41')]()<_0x4b263d['fullname'][_0xe7fb('0x41')]()?-0x1:0x1;}}}else{if(_0x5c4243===_0xe7fb('0x39')){return _0x3a96cd[_0xe7fb('0x33')]<_0x4b263d[_0xe7fb('0x33')]?0x1:-0x1;}else{return _0x3a96cd[_0xe7fb('0x33')]<_0x4b263d['globalStatus']?-0x1:0x1;}}});return _0x4362c2;}exports[_0xe7fb('0x42')]=sortAgentsByStatus;function filterAgentAttributes(_0x4df4aa){var _0x2c72dd=[_0xe7fb('0x43'),_0xe7fb('0x44'),_0xe7fb('0x45'),_0xe7fb('0x46'),'pauseType',_0xe7fb('0x46'),'internal','address',_0xe7fb('0x3'),_0xe7fb('0x6'),_0xe7fb('0x5'),'smsPause',_0xe7fb('0x30'),_0xe7fb('0x4'),'voicePause','chatCapacity',_0xe7fb('0x47'),_0xe7fb('0x48'),_0xe7fb('0x49'),_0xe7fb('0x4a'),_0xe7fb('0x4b'),_0xe7fb('0x4c'),_0xe7fb('0x4d'),_0xe7fb('0x4e'),'smsCurrentCapacity',_0xe7fb('0x4f'),'faxCurrentCapacity',_0xe7fb('0x13'),_0xe7fb('0x15'),'mailStatus',_0xe7fb('0x16'),'whatsappStatus',_0xe7fb('0x14'),'voiceStatus',_0xe7fb('0x50'),'openchannelStatusTime',_0xe7fb('0x51'),'smsStatusTime',_0xe7fb('0x52'),_0xe7fb('0x53'),_0xe7fb('0x54'),_0xe7fb('0x55'),_0xe7fb('0x56'),_0xe7fb('0x57'),_0xe7fb('0x58'),'phoneBarEnableAutomaticScreenRecording','routealias'];var _0x20aa55=['chatPause','openchannelPause','mailPause','smsPause','whatsappPause',_0xe7fb('0x4'),_0xe7fb('0x8'),_0xe7fb('0x44')];var _0x1d2359=_(_0x4df4aa)['omit'](_0x20aa55)[_0xe7fb('0x59')](_0x2c72dd)[_0xe7fb('0x27')]();return _0x1d2359;}exports[_0xe7fb('0x5a')]=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id','name','fullname',_0xe7fb('0x5b'),_0xe7fb('0x3c'),_0xe7fb('0x44'),'globalStatus',_0xe7fb('0x43'),_0xe7fb('0x45'),_0xe7fb('0x31'),_0xe7fb('0x46'),'faxPause','chatPause',_0xe7fb('0x5'),_0xe7fb('0x6'),_0xe7fb('0x7'),_0xe7fb('0x8'),_0xe7fb('0x30'),'chatStatus',_0xe7fb('0x14'),_0xe7fb('0x5c'),_0xe7fb('0x15'),'smsStatus','voiceStatus',_0xe7fb('0x17'),_0xe7fb('0x50'),_0xe7fb('0x53'),_0xe7fb('0x51'),_0xe7fb('0x5d'),_0xe7fb('0x5e'),'voiceStatusTime',_0xe7fb('0x52'),_0xe7fb('0x5f'),_0xe7fb('0x4b'),_0xe7fb('0x48'),_0xe7fb('0x47'),_0xe7fb('0x49'),'whatsappCapacity',_0xe7fb('0x4c'),'faxCurrentCapacity',_0xe7fb('0x4e'),_0xe7fb('0x4d'),_0xe7fb('0x60'),_0xe7fb('0x4f'),'phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording',_0xe7fb('0x56'),_0xe7fb('0x61'),_0xe7fb('0x55'),_0xe7fb('0x62'),_0xe7fb('0x57')];}exports['getRealtimeAgentsQueryFields']=getRealtimeAgentsQueryFields; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index 5858834..4204df9 100644 --- a/server/components/realtime/queues.js +++ b/server/components/realtime/queues.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4c6c=['inUse','loggedInDb','ringing','unknown','originated','statusMessage','Trunk','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','request','startCase','Queues','then','error','getRealtimeQueues','concat','outbound','map','get','talking','pTalking','merge','pick','jayson/promise','util','client','http','available','loggedIn','paused','waiting','busy'];(function(_0x583e98,_0x5534f5){var _0x84cc30=function(_0x4201ed){while(--_0x4201ed){_0x583e98['push'](_0x583e98['shift']());}};_0x84cc30(++_0x5534f5);}(_0x4c6c,0x183));var _0xc4c6=function(_0xca08ea,_0x249e45){_0xca08ea=_0xca08ea-0x0;var _0x81e04e=_0x4c6c[_0xca08ea];return _0x81e04e;};'use strict';var _=require('lodash');var jayson=require(_0xc4c6('0x0'));var util=require(_0xc4c6('0x1'));var amiClient=jayson[_0xc4c6('0x2')][_0xc4c6('0x3')]({'port':0x232a});var routingClient=jayson['client'][_0xc4c6('0x3')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0xc4c6('0x4'),_0xc4c6('0x5'),_0xc4c6('0x6'),_0xc4c6('0x7')];var VOICE_QUEUE_ATTRIBUTES=[_0xc4c6('0x8'),_0xc4c6('0x9'),'invalid',_0xc4c6('0xa'),'notInUse','onHold',_0xc4c6('0xb'),'ringInUse','talking','unavailable',_0xc4c6('0xc')];var OUTBOUND_QUEUE_ATTRIBUTES=['pTalking',_0xc4c6('0xd'),'message',_0xc4c6('0xe'),'dialActive','dialMethod',_0xc4c6('0xf'),'startPredictive',_0xc4c6('0x10'),_0xc4c6('0x11'),_0xc4c6('0x12'),_0xc4c6('0x13'),_0xc4c6('0x14'),_0xc4c6('0x15'),'dialPredictiveIntervalMaxThreshold',_0xc4c6('0x16'),_0xc4c6('0x17'),'predictiveIntervalTotalCalls',_0xc4c6('0x18'),_0xc4c6('0x19'),_0xc4c6('0x1a'),_0xc4c6('0x1b'),_0xc4c6('0x1c')];function getRealtimeQueues(_0x3130ff,_0x1addee){var _0x545558=_0x1addee===_0xc4c6('0x1d')?amiClient:routingClient;return _0x545558[_0xc4c6('0x1e')](_[_0xc4c6('0x1f')](_0x1addee)+_0xc4c6('0x20'),_0x3130ff)[_0xc4c6('0x21')](function(_0x1ac892){if(_0x1ac892[_0xc4c6('0x22')])throw new Error(util['format']('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x1addee));return _0x1ac892['result'];})['catch'](function(_0x649aeb){throw _0x649aeb;});}exports[_0xc4c6('0x23')]=getRealtimeQueues;function initializeQueues(_0xf1c0e5,_0x174474,_0x1f5ac9,_0x5030d2){var _0x521b6a=DEFAULT_QUEUE_ATTRIBUTES;if(_0x1f5ac9===_0xc4c6('0x1d')){if(_0x5030d2==='inbound'){_0x521b6a=_0x521b6a[_0xc4c6('0x24')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x5030d2===_0xc4c6('0x25')){_0x521b6a=_0x521b6a[_0xc4c6('0x24')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0xf1c0e5[_0xc4c6('0x26')](function(_0x3a45c4){var _0x13efdb=_0x3a45c4[_0xc4c6('0x27')]({'plain':!![]});_0x13efdb[_0xc4c6('0x6')]=0x0;_0x13efdb['loggedInDb']=0x0;_0x13efdb[_0xc4c6('0x5')]=0x0;_0x13efdb[_0xc4c6('0x4')]=0x0;_0x13efdb['waiting']=0x0;if(_0x1f5ac9===_0xc4c6('0x1d')){_0x13efdb[_0xc4c6('0x28')]=0x0;_0x13efdb[_0xc4c6('0x8')]=0x0;if(_0x5030d2==='outbound'){_0x13efdb[_0xc4c6('0x29')]=0x0;_0x13efdb[_0xc4c6('0xd')]=0x0;}}var _0x110935=_['find'](_0x174474,['id',_0x13efdb['id']]);if(_0x110935){_[_0xc4c6('0x2a')](_0x13efdb,_[_0xc4c6('0x2b')](_0x110935,_0x521b6a));}return _0x13efdb;});}exports['initializeQueues']=initializeQueues; \ No newline at end of file +var _0xf034=['map','paused','loggedInDb','loggedIn','available','busy','merge','pick','initializeQueues','lodash','util','waiting','inUse','invalid','onHold','ringing','ringInUse','talking','unavailable','unknown','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','request','startCase','Queues','then','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','catch','getRealtimeQueues','inbound','concat','outbound'];(function(_0x18e626,_0x162d89){var _0x4aa088=function(_0x17f2a7){while(--_0x17f2a7){_0x18e626['push'](_0x18e626['shift']());}};_0x4aa088(++_0x162d89);}(_0xf034,0xea));var _0x4f03=function(_0x3aab06,_0x5d93e8){_0x3aab06=_0x3aab06-0x0;var _0x5727af=_0xf034[_0x3aab06];return _0x5727af;};'use strict';var _=require(_0x4f03('0x0'));var jayson=require('jayson/promise');var util=require(_0x4f03('0x1'));var amiClient=jayson['client']['http']({'port':0x232a});var routingClient=jayson['client']['http']({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=['available','loggedIn','paused',_0x4f03('0x2')];var VOICE_QUEUE_ATTRIBUTES=['busy',_0x4f03('0x3'),_0x4f03('0x4'),'loggedInDb','notInUse',_0x4f03('0x5'),_0x4f03('0x6'),_0x4f03('0x7'),_0x4f03('0x8'),_0x4f03('0x9'),_0x4f03('0xa')];var OUTBOUND_QUEUE_ATTRIBUTES=['pTalking','originated','message','statusMessage','dialActive','dialMethod',_0x4f03('0xb'),_0x4f03('0xc'),_0x4f03('0xd'),_0x4f03('0xe'),_0x4f03('0xf'),_0x4f03('0x10'),_0x4f03('0x11'),_0x4f03('0x12'),_0x4f03('0x13'),'dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls',_0x4f03('0x14'),'predictiveIntervalDroppedCallsTimeout',_0x4f03('0x15'),_0x4f03('0x16'),_0x4f03('0x17')];function getRealtimeQueues(_0x4b98cb,_0x2ce71f){var _0x327577=_0x2ce71f==='voice'?amiClient:routingClient;return _0x327577[_0x4f03('0x18')](_[_0x4f03('0x19')](_0x2ce71f)+_0x4f03('0x1a'),_0x4b98cb)[_0x4f03('0x1b')](function(_0x26c10d){if(_0x26c10d[_0x4f03('0x1c')])throw new Error(util[_0x4f03('0x1d')](_0x4f03('0x1e'),_0x2ce71f));return _0x26c10d['result'];})[_0x4f03('0x1f')](function(_0x20f2fa){throw _0x20f2fa;});}exports[_0x4f03('0x20')]=getRealtimeQueues;function initializeQueues(_0x473d00,_0x2a903a,_0x1cd185,_0x137215){var _0x35205a=DEFAULT_QUEUE_ATTRIBUTES;if(_0x1cd185==='voice'){if(_0x137215===_0x4f03('0x21')){_0x35205a=_0x35205a[_0x4f03('0x22')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x137215===_0x4f03('0x23')){_0x35205a=_0x35205a[_0x4f03('0x22')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x473d00[_0x4f03('0x24')](function(_0x1c6b1b){var _0x2a151a=_0x1c6b1b['get']({'plain':!![]});_0x2a151a[_0x4f03('0x25')]=0x0;_0x2a151a[_0x4f03('0x26')]=0x0;_0x2a151a[_0x4f03('0x27')]=0x0;_0x2a151a[_0x4f03('0x28')]=0x0;_0x2a151a[_0x4f03('0x2')]=0x0;if(_0x1cd185==='voice'){_0x2a151a[_0x4f03('0x8')]=0x0;_0x2a151a[_0x4f03('0x29')]=0x0;if(_0x137215==='outbound'){_0x2a151a['pTalking']=0x0;_0x2a151a['originated']=0x0;}}var _0xeb44de=_['find'](_0x2a903a,['id',_0x2a151a['id']]);if(_0xeb44de){_[_0x4f03('0x2a')](_0x2a151a,_[_0x4f03('0x2b')](_0xeb44de,_0x35205a));}return _0x2a151a;});}exports[_0x4f03('0x2c')]=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index df3567d..1551aad 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x5e7514,_0x30c2e1){var _0x12f472=function(_0x33ddb6){while(--_0x33ddb6){_0x5e7514['push'](_0x5e7514['shift']());}};_0x12f472(++_0x30c2e1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file +var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x58b301,_0x45e991){var _0x2171b3=function(_0x30b475){while(--_0x30b475){_0x58b301['push'](_0x58b301['shift']());}};_0x2171b3(++_0x45e991);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 1902da5..5fc3023 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 _0x75dc=['map','join','createHash','md5','update','digest','hex','getUuid','platform','licenseToken','test','dmidecode\x20--string\x20system-uuid','replace','hostname','macAddress','ipAddress','substring','lodash','crypto','bimedia-machine-uuid','../environment','networkInterfaces','orderBy','keys','length','family','IPv4','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface'];(function(_0x5a9059,_0x4ac5ad){var _0x4f616a=function(_0x33d110){while(--_0x33d110){_0x5a9059['push'](_0x5a9059['shift']());}};_0x4f616a(++_0x4ac5ad);}(_0x75dc,0x15b));var _0xc75d=function(_0xee7f65,_0x4ff021){_0xee7f65=_0xee7f65-0x0;var _0x5449bc=_0x75dc[_0xee7f65];return _0x5449bc;};'use strict';var _=require(_0xc75d('0x0'));var os=require('os');var crypto=require(_0xc75d('0x1'));var machine=require(_0xc75d('0x2'));var exec=require('child_process')['execSync'];var config=require(_0xc75d('0x3'));function getInterfaces(){var _0x45f2ec=[];var _0x26c29d=os[_0xc75d('0x4')]();var _0x46eb7a=_[_0xc75d('0x5')](_[_0xc75d('0x6')](_0x26c29d));for(var _0x268054=0x0;_0x268054<_0x46eb7a[_0xc75d('0x7')];_0x268054++){var _0x71862=_0x26c29d[_0x46eb7a[_0x268054]]['filter'](function(_0x180551){return _0x180551[_0xc75d('0x8')]===_0xc75d('0x9')&&_0x180551['internal']===![];});_0x45f2ec=_0x45f2ec['concat'](_0x71862);}return _0x45f2ec;}function getFirstInterface(){var _0x2f21a1=_[_0xc75d('0xa')](getInterfaces());return{'macAddress':_0x2f21a1&&_0x2f21a1[_0xc75d('0xb')]?_0x2f21a1['mac']:_0xc75d('0xc'),'ipAddress':_0x2f21a1&&_0x2f21a1['address']?_0x2f21a1[_0xc75d('0xd')]:_0xc75d('0xe')};}exports[_0xc75d('0xf')]=getFirstInterface;function getCPUhash(){var _0x1e56ac=_[_0xc75d('0x5')](os['cpus']()[_0xc75d('0x10')](function(_0x597b9c){return _0x597b9c['model'];}))[_0xc75d('0x11')](':');return crypto[_0xc75d('0x12')](_0xc75d('0x13'))[_0xc75d('0x14')](_0x1e56ac)[_0xc75d('0x15')](_0xc75d('0x16'));}exports[_0xc75d('0x17')]=function(){var _0x793974=os[_0xc75d('0x18')]();var _0x565637=/[0-9a-f-]{36}/;if(config[_0xc75d('0x19')]&&_0x565637[_0xc75d('0x1a')](config['licenseToken'])){return config['licenseToken'];}else if(_0x793974==='win32'){return exec(_0xc75d('0x1b'),{'encoding':'utf8'})[_0xc75d('0x1c')]('\x0d\x0a','');}else{var _0x3b331d=getFirstInterface();var _0x19459c=getCPUhash();var _0x31604f=_0x19459c+'|'+os[_0xc75d('0x1d')]()+'|'+_0x3b331d[_0xc75d('0x1e')]+'|'+_0x3b331d[_0xc75d('0x1f')];var _0x3a7df9=crypto[_0xc75d('0x12')](_0xc75d('0x13'))['update'](_0x31604f)[_0xc75d('0x15')](_0xc75d('0x16'));return _0x3a7df9[_0xc75d('0x20')](0x0,0x8)+'-'+_0x3a7df9['substring'](0x8,0xc)+'-'+_0x3a7df9[_0xc75d('0x20')](0xc,0x10)+'-'+_0x3a7df9[_0xc75d('0x20')](0x10,0x14)+'-'+_0x3a7df9['substring'](0x14);}}; \ No newline at end of file +var _0x6a86=['md5','update','hex','getUuid','licenseToken','test','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress','createHash','substring','lodash','crypto','bimedia-machine-uuid','execSync','../environment','networkInterfaces','keys','length','filter','IPv4','internal','head','mac','00:00:00:00:00:00','127.0.0.1','getFirstInterface','map','join'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x6a86,0xae));var _0x66a8=function(_0x4b8f56,_0x44bef0){_0x4b8f56=_0x4b8f56-0x0;var _0x4a4a44=_0x6a86[_0x4b8f56];return _0x4a4a44;};'use strict';var _=require(_0x66a8('0x0'));var os=require('os');var crypto=require(_0x66a8('0x1'));var machine=require(_0x66a8('0x2'));var exec=require('child_process')[_0x66a8('0x3')];var config=require(_0x66a8('0x4'));function getInterfaces(){var _0x3bf23f=[];var _0xea88ea=os[_0x66a8('0x5')]();var _0x12ed9d=_['orderBy'](_[_0x66a8('0x6')](_0xea88ea));for(var _0xe2ae29=0x0;_0xe2ae29<_0x12ed9d[_0x66a8('0x7')];_0xe2ae29++){var _0x3ce442=_0xea88ea[_0x12ed9d[_0xe2ae29]][_0x66a8('0x8')](function(_0x53245a){return _0x53245a['family']===_0x66a8('0x9')&&_0x53245a[_0x66a8('0xa')]===![];});_0x3bf23f=_0x3bf23f['concat'](_0x3ce442);}return _0x3bf23f;}function getFirstInterface(){var _0x4423b5=_[_0x66a8('0xb')](getInterfaces());return{'macAddress':_0x4423b5&&_0x4423b5[_0x66a8('0xc')]?_0x4423b5[_0x66a8('0xc')]:_0x66a8('0xd'),'ipAddress':_0x4423b5&&_0x4423b5['address']?_0x4423b5['address']:_0x66a8('0xe')};}exports[_0x66a8('0xf')]=getFirstInterface;function getCPUhash(){var _0x53917f=_['orderBy'](os['cpus']()[_0x66a8('0x10')](function(_0x5b0bbd){return _0x5b0bbd['model'];}))[_0x66a8('0x11')](':');return crypto['createHash'](_0x66a8('0x12'))[_0x66a8('0x13')](_0x53917f)['digest'](_0x66a8('0x14'));}exports[_0x66a8('0x15')]=function(){var _0x43571f=os['platform']();var _0x8afbf0=/[0-9a-f-]{36}/;if(config[_0x66a8('0x16')]&&_0x8afbf0[_0x66a8('0x17')](config['licenseToken'])){return config['licenseToken'];}else if(_0x43571f==='win32'){return exec(_0x66a8('0x18'),{'encoding':_0x66a8('0x19')})[_0x66a8('0x1a')]('\x0d\x0a','');}else{var _0x369751=getFirstInterface();var _0x38590d=getCPUhash();var _0x538a3e=_0x38590d+'|'+os[_0x66a8('0x1b')]()+'|'+_0x369751[_0x66a8('0x1c')]+'|'+_0x369751[_0x66a8('0x1d')];var _0xa60ff=crypto[_0x66a8('0x1e')](_0x66a8('0x12'))['update'](_0x538a3e)['digest']('hex');return _0xa60ff[_0x66a8('0x1f')](0x0,0x8)+'-'+_0xa60ff['substring'](0x8,0xc)+'-'+_0xa60ff[_0x66a8('0x1f')](0xc,0x10)+'-'+_0xa60ff[_0x66a8('0x1f')](0x10,0x14)+'-'+_0xa60ff[_0x66a8('0x1f')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index f6d4ae0..0902b75 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 _0xb096=['findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','error','default','request-promise','bluebird','version','../../mysqldb','license','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','get','data1','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','catch','message','finally','getUuid','License'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0xb096,0x1d8));var _0x6b09=function(_0x56c38d,_0x458403){_0x56c38d=_0x56c38d-0x0;var _0x20bf9d=_0xb096[_0x56c38d];return _0x20bf9d;};'use strict';var util=require('util');var moment=require('moment');var rp=require(_0x6b09('0x0'));var BPromise=require(_0x6b09('0x1'));var pkginfo=require('pkginfo')(module,_0x6b09('0x2'));var db=require(_0x6b09('0x3'))['db'];var encryptor=require('../../components/encryptor');var hardware=require('./hardware');var logger=require('../logger')(_0x6b09('0x4'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x4ab3c9){return new BPromise(function(_0x4622a3,_0x451064){var _0xd2050a=util[_0x6b09('0x5')](_0x6b09('0x6'),HOST,_0x4ab3c9,module[_0x6b09('0x7')]['version']);if(oldToken){_0xd2050a=util[_0x6b09('0x5')](_0x6b09('0x8'),HOST,_0x4ab3c9,module[_0x6b09('0x7')][_0x6b09('0x2')],oldToken);}var _0xe88ccc={'uri':_0xd2050a,'method':_0x6b09('0x9'),'timeout':0xea60,'json':!![]};return rp(_0xe88ccc)[_0x6b09('0xa')](function(_0x1588df){_0x4622a3(_0x1588df);})['catch'](function(_0xa7d416){_0x451064(_0xa7d416);});});}function manageLicense(_0x24cdc0,_0x48597c){var _0x5789e3=_0x48597c[_0x6b09('0xb')]({'plain':!![]});if(!isOldTokenSent&&_0x5789e3[_0x6b09('0xc')]!==_0x24cdc0&&!_0x5789e3[_0x6b09('0xd')]){oldToken=_0x5789e3[_0x6b09('0xc')];}httpRequest(_0x24cdc0)['then'](function(_0x25335b){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x25335b['active']){isOldTokenSent=![];if(!_0x5789e3['license']&&_0x5789e3[_0x6b09('0x4')]!=_0x25335b[_0x6b09('0x4')]||_0x5789e3['license']&&_0x5789e3[_0x6b09('0xd')]){logger[_0x6b09('0xe')](_0x6b09('0xf'));}if(_0x5789e3['license']&&!_0x5789e3['data2']&&_0x5789e3[_0x6b09('0x4')]!=_0x25335b[_0x6b09('0x4')]){logger['info'](_0x6b09('0x10'));}if(_0x5789e3['license']&&!_0x5789e3[_0x6b09('0xd')]&&_0x5789e3['license']==_0x25335b[_0x6b09('0x4')]){return _0x48597c;}return _0x48597c[_0x6b09('0x11')]({'data1':_0x24cdc0,'data2':null,'license':_0x25335b[_0x6b09('0x4')]});}else{if(_0x25335b[_0x6b09('0x4')]||_0x5789e3[_0x6b09('0x4')]){if(!_0x5789e3[_0x6b09('0xd')]){if(_0x5789e3[_0x6b09('0xc')]==_0x24cdc0){GRAY_PERIOD_REASON='Disabled';logger['info'](_0x6b09('0x12'));}else{GRAY_PERIOD_REASON=_0x6b09('0x13');logger[_0x6b09('0xe')](_0x6b09('0x14'),_0x5789e3[_0x6b09('0xc')],_0x24cdc0);}logger['info']('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x6b09('0x15')](),moment()[_0x6b09('0x5')](_0x6b09('0x16')));return _0x48597c['update']({'data2':encryptor['encryptString'](moment()['format'](_0x6b09('0x16')))});}else{if(moment()[_0x6b09('0x17')](encryptor[_0x6b09('0x18')](_0x5789e3['data2']),_0x6b09('0x19'))>DAYS){logger[_0x6b09('0xe')](_0x6b09('0x1a'),moment()[_0x6b09('0x5')](_0x6b09('0x16')));isOldTokenSent=![];return _0x48597c[_0x6b09('0x11')]({'data1':_0x24cdc0,'data2':null,'license':null});}}}else{if(_0x5789e3[_0x6b09('0xc')]!=_0x24cdc0){logger[_0x6b09('0xe')](_0x6b09('0x14'),_0x5789e3[_0x6b09('0xc')],_0x24cdc0);return _0x48597c['update']({'data1':_0x24cdc0,'data2':null,'license':null});}}}return _0x48597c;})[_0x6b09('0xa')](function(_0x553d5b){_0x48597c=_0x553d5b;})[_0x6b09('0x1b')](function(_0x2f6e1b){logger['error'](_0x2f6e1b[_0x6b09('0x1c')]);})[_0x6b09('0x1d')](function(){setTimeout(function(){manageLicense(hardware[_0x6b09('0x1e')](),_0x48597c);},TIME);});}function defaultLicense(){var _0xc6d8e9=hardware[_0x6b09('0x1e')]();if(_0xc6d8e9){return db[_0x6b09('0x1f')][_0x6b09('0x20')]({'where':{'id':0x1},'defaults':{'data1':_0xc6d8e9}})['spread'](function(_0x10c53d,_0x52d0b0){logger[_0x6b09('0xe')](_0x6b09('0x21'),_0xc6d8e9);manageLicense(_0xc6d8e9,_0x10c53d);})['catch'](function(_0x4bdce2){logger[_0x6b09('0x22')](_0x4bdce2[_0x6b09('0x1c')]);});}}exports[_0x6b09('0x23')]=defaultLicense; \ No newline at end of file +var _0xe424=['finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','util','request-promise','bluebird','version','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','exports','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','data1','data2','active','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','update','encryptString','decryptString','days','DEMO\x20START\x20AT\x20%s','error','message'];(function(_0x190ca7,_0x2bc244){var _0x37fbb2=function(_0xf00d6a){while(--_0xf00d6a){_0x190ca7['push'](_0x190ca7['shift']());}};_0x37fbb2(++_0x2bc244);}(_0xe424,0xa6));var _0x4e42=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xe424[_0x40ac5e];return _0x2839d6;};'use strict';var util=require(_0x4e42('0x0'));var moment=require('moment');var rp=require(_0x4e42('0x1'));var BPromise=require(_0x4e42('0x2'));var pkginfo=require('pkginfo')(module,_0x4e42('0x3'));var db=require('../../mysqldb')['db'];var encryptor=require(_0x4e42('0x4'));var hardware=require(_0x4e42('0x5'));var logger=require(_0x4e42('0x6'))(_0x4e42('0x7'));var HOST=_0x4e42('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x483b7d){return new BPromise(function(_0x32b130,_0x46aad8){var _0x5054a9=util['format'](_0x4e42('0x9'),HOST,_0x483b7d,module[_0x4e42('0xa')][_0x4e42('0x3')]);if(oldToken){_0x5054a9=util[_0x4e42('0xb')](_0x4e42('0xc'),HOST,_0x483b7d,module[_0x4e42('0xa')][_0x4e42('0x3')],oldToken);}var _0x40f544={'uri':_0x5054a9,'method':_0x4e42('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x40f544)[_0x4e42('0xe')](function(_0x3c2996){_0x32b130(_0x3c2996);})[_0x4e42('0xf')](function(_0x46f901){_0x46aad8(_0x46f901);});});}function manageLicense(_0x51de54,_0x45d5e8){var _0x1aa858=_0x45d5e8['get']({'plain':!![]});if(!isOldTokenSent&&_0x1aa858[_0x4e42('0x10')]!==_0x51de54&&!_0x1aa858[_0x4e42('0x11')]){oldToken=_0x1aa858['data1'];}httpRequest(_0x51de54)[_0x4e42('0xe')](function(_0x52d32d){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x52d32d[_0x4e42('0x12')]){isOldTokenSent=![];if(!_0x1aa858['license']&&_0x1aa858[_0x4e42('0x7')]!=_0x52d32d[_0x4e42('0x7')]||_0x1aa858[_0x4e42('0x7')]&&_0x1aa858[_0x4e42('0x11')]){logger['info'](_0x4e42('0x13'));}if(_0x1aa858['license']&&!_0x1aa858[_0x4e42('0x11')]&&_0x1aa858['license']!=_0x52d32d[_0x4e42('0x7')]){logger[_0x4e42('0x14')](_0x4e42('0x15'));}if(_0x1aa858[_0x4e42('0x7')]&&!_0x1aa858[_0x4e42('0x11')]&&_0x1aa858['license']==_0x52d32d[_0x4e42('0x7')]){return _0x45d5e8;}return _0x45d5e8['update']({'data1':_0x51de54,'data2':null,'license':_0x52d32d['license']});}else{if(_0x52d32d['license']||_0x1aa858[_0x4e42('0x7')]){if(!_0x1aa858[_0x4e42('0x11')]){if(_0x1aa858[_0x4e42('0x10')]==_0x51de54){GRAY_PERIOD_REASON=_0x4e42('0x16');logger[_0x4e42('0x14')](_0x4e42('0x17'));}else{GRAY_PERIOD_REASON=_0x4e42('0x18');logger[_0x4e42('0x14')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x1aa858[_0x4e42('0x10')],_0x51de54);}logger[_0x4e42('0x14')](_0x4e42('0x19'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x4e42('0xb')](_0x4e42('0x1a')));return _0x45d5e8[_0x4e42('0x1b')]({'data2':encryptor[_0x4e42('0x1c')](moment()[_0x4e42('0xb')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()['diff'](encryptor[_0x4e42('0x1d')](_0x1aa858['data2']),_0x4e42('0x1e'))>DAYS){logger[_0x4e42('0x14')](_0x4e42('0x1f'),moment()[_0x4e42('0xb')](_0x4e42('0x1a')));isOldTokenSent=![];return _0x45d5e8[_0x4e42('0x1b')]({'data1':_0x51de54,'data2':null,'license':null});}}}else{if(_0x1aa858['data1']!=_0x51de54){logger[_0x4e42('0x14')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x1aa858[_0x4e42('0x10')],_0x51de54);return _0x45d5e8['update']({'data1':_0x51de54,'data2':null,'license':null});}}}return _0x45d5e8;})[_0x4e42('0xe')](function(_0x12b866){_0x45d5e8=_0x12b866;})[_0x4e42('0xf')](function(_0x4e12c7){logger[_0x4e42('0x20')](_0x4e12c7[_0x4e42('0x21')]);})[_0x4e42('0x22')](function(){setTimeout(function(){manageLicense(hardware[_0x4e42('0x23')](),_0x45d5e8);},TIME);});}function defaultLicense(){var _0x56a505=hardware['getUuid']();if(_0x56a505){return db[_0x4e42('0x24')][_0x4e42('0x25')]({'where':{'id':0x1},'defaults':{'data1':_0x56a505}})[_0x4e42('0x26')](function(_0x226087,_0x510edd){logger[_0x4e42('0x14')](_0x4e42('0x27'),_0x56a505);manageLicense(_0x56a505,_0x226087);})[_0x4e42('0xf')](function(_0x577e37){logger[_0x4e42('0x20')](_0x577e37['message']);});}}exports['default']=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index d691d57..c88d9c6 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 _0xe1c4=['defaults','then','catch','uuid','data1','isEmpty','data2','split','decryptString','%s:%s:%s','parse','demo','gray','deadline','add','days','format','grayReason','machineUuid','disabled','message','sequelize','role','count','admin','user','users','telephones','forEach','pick','telephone','exports','util','lodash','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','Breaking\x20license','getUuid'];(function(_0x135f4d,_0x1e2108){var _0x371de5=function(_0x2fed1d){while(--_0x2fed1d){_0x135f4d['push'](_0x135f4d['shift']());}};_0x371de5(++_0x1e2108);}(_0xe1c4,0xc8));var _0x4e1c=function(_0x575195,_0x408116){_0x575195=_0x575195-0x0;var _0x594e25=_0xe1c4[_0x575195];return _0x594e25;};'use strict';var util=require(_0x4e1c('0x0'));var _=require(_0x4e1c('0x1'));var moment=require('moment');var BPromise=require(_0x4e1c('0x2'));var hardware=require(_0x4e1c('0x3'));var encryptor=require(_0x4e1c('0x4'));var db=require(_0x4e1c('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x4e1c('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x4e1c('0x7'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x4e1c('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x4e1c('0x8'),'machineUuid':hardware[_0x4e1c('0x9')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x126e14){return new BPromise(function(_0x3565b9,_0x2fdede){return db['License']['find'](_[_0x4e1c('0xa')](_0x126e14,{'raw':!![],'where':{'id':0x1}}))[_0x4e1c('0xb')](function(_0x55a372){return checkLicense(_0x55a372,null);})[_0x4e1c('0xb')](function(_0xe84059){_0x3565b9(_0xe84059);return;})[_0x4e1c('0xc')](function(_0x1789dd){_0x2fdede(_0x1789dd);});});}function checkLicense(_0x304ab2,_0xa76b6d){if(!_0x304ab2){demoLicense[_0x4e1c('0xd')]=_0x304ab2[_0x4e1c('0xe')];return demoLicense;}try{var _0x58bb45=_0xa76b6d||_0x304ab2['license'];if(_[_0x4e1c('0xf')](_0x58bb45)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x2d8970=_0x304ab2[_0x4e1c('0xe')];var _0x29fcca=_0x304ab2[_0x4e1c('0x10')];var _0x597c3d=_0x2d8970[_0x4e1c('0x11')]('-')[0x4];var _0x36280c=_0x2d8970['split']('-')[0x0];var _0x2b35dc=encryptor[_0x4e1c('0x12')](_0x58bb45,util['format'](_0x4e1c('0x13'),_0x597c3d,_0x2d8970,_0x36280c));var _0x3dfcfe=JSON[_0x4e1c('0x14')](_0x2b35dc);_0x3dfcfe[_0x4e1c('0x15')]=![];_0x3dfcfe[_0x4e1c('0xd')]=_0x2d8970;_0x3dfcfe['machineUuid']=hardware['getUuid']();if(_0x29fcca){var _0x39dce6=encryptor[_0x4e1c('0x12')](_0x29fcca);_0x3dfcfe[_0x4e1c('0x16')]=_0x39dce6;_0x3dfcfe[_0x4e1c('0x17')]=moment(_0x39dce6)[_0x4e1c('0x18')](0x7,_0x4e1c('0x19'))[_0x4e1c('0x1a')]();_0x3dfcfe[_0x4e1c('0x1b')]=_0x3dfcfe[_0x4e1c('0xd')]!=_0x3dfcfe[_0x4e1c('0x1c')]?'changed':_0x4e1c('0x1d');}return _0x3dfcfe;}catch(_0x51b74c){breakingLicense[_0x4e1c('0xd')]=_0x304ab2['data1'];breakingLicense[_0x4e1c('0x1e')]=_0x51b74c['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x18042d,_0x2e3813){getLicense()[_0x4e1c('0xb')](function(_0x46a1f0){return db['User']['findAll']({'attributes':['role',[db[_0x4e1c('0x1f')]['fn']('COUNT',db[_0x4e1c('0x1f')]['col'](_0x4e1c('0x20'))),_0x4e1c('0x21')]],'group':_0x4e1c('0x20'),'where':{'role':{'$or':[_0x4e1c('0x22'),_0x4e1c('0x23'),'telephone']}},'raw':!![]})['then'](function(_0x2c3918){var _0x389ca3={'user':_0x46a1f0[_0x4e1c('0x24')]||0x0,'telephone':_0x46a1f0[_0x4e1c('0x25')]||0x0};_0x2c3918[_0x4e1c('0x26')](function(_0x2b960c){var _0x573421=_0x2b960c[_0x4e1c('0x20')]===_0x4e1c('0x22')?'user':_0x2b960c[_0x4e1c('0x20')];_0x389ca3[_0x573421]-=_0x2b960c['count'];if(_0x389ca3[_0x573421]<0x0)_0x389ca3[_0x573421]=0x0;});_0x18042d(_0x389ca3);return;});})[_0x4e1c('0xc')](function(_0x41b865){_0x2e3813(_0x41b865);});});}function checkUserLimits(_0x4a4852){return new BPromise(function(_0x4f569b,_0x4f9606){getLimits()['then'](function(_0x48fc57){var _0x2266ff=_[_0x4e1c('0x27')](_['countBy'](_0x4a4852,'role'),[_0x4e1c('0x22'),_0x4e1c('0x23'),_0x4e1c('0x28')]);var _0x2674f4=(_0x2266ff[_0x4e1c('0x22')]||0x0)+(_0x2266ff['user']||0x0);var _0x10bf0f=_0x2266ff[_0x4e1c('0x28')]||0x0;if(_0x2674f4>_0x48fc57[_0x4e1c('0x23')])return _0x4f9606('License\x20limit\x20reached\x20for\x20users');if(_0x10bf0f>_0x48fc57[_0x4e1c('0x28')])return _0x4f9606('License\x20limit\x20reached\x20for\x20telephones');return _0x4f569b();})[_0x4e1c('0xc')](function(_0x3ac0eb){_0x4f9606(_0x3ac0eb);});});}module[_0x4e1c('0x29')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xd0b9=['parse','demo','machineUuid','gray','deadline','changed','disabled','message','findAll','role','sequelize','COUNT','col','count','user','users','forEach','admin','catch','countBy','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','util','lodash','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','find','defaults','then','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s'];(function(_0x1f203a,_0x114752){var _0x11c80f=function(_0x45c1b4){while(--_0x45c1b4){_0x1f203a['push'](_0x1f203a['shift']());}};_0x11c80f(++_0x114752);}(_0xd0b9,0x1be));var _0x9d0b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd0b9[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x9d0b('0x0'));var _=require(_0x9d0b('0x1'));var moment=require('moment');var BPromise=require(_0x9d0b('0x2'));var hardware=require(_0x9d0b('0x3'));var encryptor=require(_0x9d0b('0x4'));var db=require(_0x9d0b('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x9d0b('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x9d0b('0x7'),'machineUuid':hardware[_0x9d0b('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x9d0b('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x9d0b('0x9'),'machineUuid':hardware[_0x9d0b('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x56c030){return new BPromise(function(_0x10b38a,_0x4a0094){return db[_0x9d0b('0xa')][_0x9d0b('0xb')](_[_0x9d0b('0xc')](_0x56c030,{'raw':!![],'where':{'id':0x1}}))[_0x9d0b('0xd')](function(_0x5e2418){return checkLicense(_0x5e2418,null);})[_0x9d0b('0xd')](function(_0x4885a8){_0x10b38a(_0x4885a8);return;})['catch'](function(_0x5e32ba){_0x4a0094(_0x5e32ba);});});}function checkLicense(_0x3a67d2,_0x24c13b){if(!_0x3a67d2){demoLicense[_0x9d0b('0xe')]=_0x3a67d2[_0x9d0b('0xf')];return demoLicense;}try{var _0x33188b=_0x24c13b||_0x3a67d2[_0x9d0b('0x10')];if(_[_0x9d0b('0x11')](_0x33188b)){throw new Error(_0x9d0b('0x12'));}var _0x2d7afd=_0x3a67d2[_0x9d0b('0xf')];var _0x3b4967=_0x3a67d2[_0x9d0b('0x13')];var _0x96d6ce=_0x2d7afd[_0x9d0b('0x14')]('-')[0x4];var _0x32eba3=_0x2d7afd[_0x9d0b('0x14')]('-')[0x0];var _0xd59bb=encryptor[_0x9d0b('0x15')](_0x33188b,util[_0x9d0b('0x16')](_0x9d0b('0x17'),_0x96d6ce,_0x2d7afd,_0x32eba3));var _0x3bb37d=JSON[_0x9d0b('0x18')](_0xd59bb);_0x3bb37d[_0x9d0b('0x19')]=![];_0x3bb37d[_0x9d0b('0xe')]=_0x2d7afd;_0x3bb37d[_0x9d0b('0x1a')]=hardware[_0x9d0b('0x8')]();if(_0x3b4967){var _0x149865=encryptor[_0x9d0b('0x15')](_0x3b4967);_0x3bb37d[_0x9d0b('0x1b')]=_0x149865;_0x3bb37d[_0x9d0b('0x1c')]=moment(_0x149865)['add'](0x7,'days')['format']();_0x3bb37d['grayReason']=_0x3bb37d['uuid']!=_0x3bb37d[_0x9d0b('0x1a')]?_0x9d0b('0x1d'):_0x9d0b('0x1e');}return _0x3bb37d;}catch(_0x5eb577){breakingLicense[_0x9d0b('0xe')]=_0x3a67d2[_0x9d0b('0xf')];breakingLicense[_0x9d0b('0x1f')]=_0x5eb577[_0x9d0b('0x1f')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x2ffa13,_0x1378aa){getLicense()[_0x9d0b('0xd')](function(_0x231354){return db['User'][_0x9d0b('0x20')]({'attributes':[_0x9d0b('0x21'),[db[_0x9d0b('0x22')]['fn'](_0x9d0b('0x23'),db[_0x9d0b('0x22')][_0x9d0b('0x24')]('role')),_0x9d0b('0x25')]],'group':_0x9d0b('0x21'),'where':{'role':{'$or':['admin',_0x9d0b('0x26'),'telephone']}},'raw':!![]})[_0x9d0b('0xd')](function(_0x1a5dcf){var _0x5ec1cc={'user':_0x231354[_0x9d0b('0x27')]||0x0,'telephone':_0x231354['telephones']||0x0};_0x1a5dcf[_0x9d0b('0x28')](function(_0x5c8fef){var _0x458aab=_0x5c8fef[_0x9d0b('0x21')]===_0x9d0b('0x29')?'user':_0x5c8fef[_0x9d0b('0x21')];_0x5ec1cc[_0x458aab]-=_0x5c8fef['count'];if(_0x5ec1cc[_0x458aab]<0x0)_0x5ec1cc[_0x458aab]=0x0;});_0x2ffa13(_0x5ec1cc);return;});})[_0x9d0b('0x2a')](function(_0x47d803){_0x1378aa(_0x47d803);});});}function checkUserLimits(_0x27dc7f){return new BPromise(function(_0x394c60,_0xb9f76e){getLimits()[_0x9d0b('0xd')](function(_0x328de2){var _0x43dc0e=_['pick'](_[_0x9d0b('0x2b')](_0x27dc7f,'role'),[_0x9d0b('0x29'),_0x9d0b('0x26'),_0x9d0b('0x2c')]);var _0x5aef0d=(_0x43dc0e['admin']||0x0)+(_0x43dc0e['user']||0x0);var _0x94fe3e=_0x43dc0e[_0x9d0b('0x2c')]||0x0;if(_0x5aef0d>_0x328de2[_0x9d0b('0x26')])return _0xb9f76e(_0x9d0b('0x2d'));if(_0x94fe3e>_0x328de2[_0x9d0b('0x2c')])return _0xb9f76e(_0x9d0b('0x2e'));return _0x394c60();})[_0x9d0b('0x2a')](function(_0x45d216){_0xb9f76e(_0x45d216);});});}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 24180de..ea2baa8 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 _0xf7b4=['app-id','secret','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf7b4,0x152));var _0x4f7b=function(_0x5b0539,_0x20b938){_0x5b0539=_0x5b0539-0x0;var _0x32246b=_0xf7b4[_0x5b0539];return _0x32246b;};'use strict';module[_0x4f7b('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x4f7b('0x1'),'GOOGLE_SECRET':_0x4f7b('0x2'),'DEBUG':''}; \ No newline at end of file +var _0x4888=['http://localhost:9000','myappanuglar-secret','app-id','secret'];(function(_0x3dacb8,_0x48eab5){var _0x16d5a0=function(_0x1397bf){while(--_0x1397bf){_0x3dacb8['push'](_0x3dacb8['shift']());}};_0x16d5a0(++_0x48eab5);}(_0x4888,0x198));var _0x8488=function(_0x408b34,_0xb7d872){_0x408b34=_0x408b34-0x0;var _0x1182aa=_0x4888[_0x408b34];return _0x1182aa;};'use strict';module['exports']={'DOMAIN':_0x8488('0x0'),'SESSION_SECRET':_0x8488('0x1'),'GOOGLE_ID':_0x8488('0x2'),'GOOGLE_SECRET':_0x8488('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 34ccc63..ef4011c 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x02c0=['fileLogger','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x02c0,0x1e8));var _0x002c=function(_0x48d32e,_0x29ebb4){_0x48d32e=_0x48d32e-0x0;var _0x57787a=_0x02c0[_0x48d32e];return _0x57787a;};'use strict';var fileLogger=require('../utils/loggers')[_0x002c('0x0')];module[_0x002c('0x1')]=fileLogger; \ No newline at end of file +var _0x5dd5=['exports','../utils/loggers','fileLogger'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x5dd5,0xb5));var _0x55dd=function(_0x2a3f4e,_0x2f10a2){_0x2a3f4e=_0x2a3f4e-0x0;var _0x1bc8f5=_0x5dd5[_0x2a3f4e];return _0x1bc8f5;};'use strict';var fileLogger=require(_0x55dd('0x0'))[_0x55dd('0x1')];module[_0x55dd('0x2')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 4d7381a..85d56bc 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 _0xcd38=['path','resolve','join','root','../../services/express/index.js','ami','../../services/ami/index.js','agi','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports'];(function(_0x147d5d,_0x9a8ffb){var _0x536792=function(_0x14706e){while(--_0x14706e){_0x147d5d['push'](_0x147d5d['shift']());}};_0x536792(++_0x9a8ffb);}(_0xcd38,0xff));var _0x8cd3=function(_0x18b73d,_0x310f91){_0x18b73d=_0x18b73d-0x0;var _0x24b2ec=_0xcd38[_0x18b73d];return _0x24b2ec;};'use strict';var path=require(_0x8cd3('0x0'));var cfg=require('../../config/environment');var env={'NODE_PATH':path[_0x8cd3('0x1')](path[_0x8cd3('0x2')](cfg[_0x8cd3('0x3')],'legacy-libs'))};var pm2config={'apps':[{'name':'express','script':path[_0x8cd3('0x2')](__dirname,_0x8cd3('0x4')),'env':env},{'name':_0x8cd3('0x5'),'script':path['join'](__dirname,_0x8cd3('0x6')),'env':env},{'name':_0x8cd3('0x7'),'script':path[_0x8cd3('0x2')](__dirname,'../../services/agi/index.js'),'env':env},{'name':_0x8cd3('0x8'),'script':path[_0x8cd3('0x2')](__dirname,_0x8cd3('0x9')),'env':env},{'name':_0x8cd3('0xa'),'script':path[_0x8cd3('0x2')](__dirname,_0x8cd3('0xb')),'env':env},{'name':_0x8cd3('0xc'),'script':path[_0x8cd3('0x2')](__dirname,_0x8cd3('0xd')),'env':env}]};module[_0x8cd3('0xe')]=pm2config; \ No newline at end of file +var _0xabb9=['agi','email','../../services/email/index.js','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','resolve','join','root','legacy-libs','express','../../services/express/index.js','ami','../../services/ami/index.js'];(function(_0x5238d2,_0x494a90){var _0x5b61f2=function(_0x40fd10){while(--_0x40fd10){_0x5238d2['push'](_0x5238d2['shift']());}};_0x5b61f2(++_0x494a90);}(_0xabb9,0xca));var _0x9abb=function(_0x31575c,_0x15baba){_0x31575c=_0x31575c-0x0;var _0x461dee=_0xabb9[_0x31575c];return _0x461dee;};'use strict';var path=require('path');var cfg=require('../../config/environment');var env={'NODE_PATH':path[_0x9abb('0x0')](path[_0x9abb('0x1')](cfg[_0x9abb('0x2')],_0x9abb('0x3')))};var pm2config={'apps':[{'name':_0x9abb('0x4'),'script':path[_0x9abb('0x1')](__dirname,_0x9abb('0x5')),'env':env},{'name':_0x9abb('0x6'),'script':path[_0x9abb('0x1')](__dirname,_0x9abb('0x7')),'env':env},{'name':_0x9abb('0x8'),'script':path[_0x9abb('0x1')](__dirname,'../../services/agi/index.js'),'env':env},{'name':_0x9abb('0x9'),'script':path[_0x9abb('0x1')](__dirname,_0x9abb('0xa')),'env':env},{'name':'routing','script':path['join'](__dirname,_0x9abb('0xb')),'env':env},{'name':_0x9abb('0xc'),'script':path['join'](__dirname,_0x9abb('0xd')),'env':env}]};module[_0x9abb('0xe')]=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index cde2d48..767fb19 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 _0x6715=['disconnect','list','describe','delete','dump','saved','pm2','bluebird','./config','connect','then','start','stop','restart'];(function(_0x335271,_0x5025f2){var _0xa9fff8=function(_0x28d0bd){while(--_0x28d0bd){_0x335271['push'](_0x335271['shift']());}};_0xa9fff8(++_0x5025f2);}(_0x6715,0x19c));var _0x5671=function(_0x3be5f1,_0x2004b4){_0x3be5f1=_0x3be5f1-0x0;var _0x10b489=_0x6715[_0x3be5f1];return _0x10b489;};'use strict';var pm2=require(_0x5671('0x0'));var BPromise=require(_0x5671('0x1'));var config=require(_0x5671('0x2'));function connect(){return new BPromise(function(_0x2497b9,_0x242364){return pm2[_0x5671('0x3')](function(_0x1a706b){if(_0x1a706b){return _0x242364(_0x1a706b);}return _0x2497b9('connected');});});};exports['start']=function(_0x46a7b0){return connect()[_0x5671('0x4')](function(){return new BPromise(function(_0x2bdcb2,_0x68754b){return pm2[_0x5671('0x5')](_0x46a7b0,function(_0x1bce18,_0xb12b44){if(_0x1bce18){return _0x68754b(_0x1bce18);}pm2['disconnect']();return _0x2bdcb2(_0xb12b44);});});});};exports[_0x5671('0x6')]=function(_0x549b37){return connect()[_0x5671('0x4')](function(){return new BPromise(function(_0x7c5c09,_0x313994){return pm2[_0x5671('0x6')](_0x549b37,function(_0x4373aa,_0x1708cb){if(_0x4373aa){return _0x313994(_0x4373aa);}pm2['disconnect']();return _0x7c5c09(_0x1708cb);});});});};exports['restart']=function(_0x39e4e1){return connect()[_0x5671('0x4')](function(){return new BPromise(function(_0x19fcd5,_0x122232){return pm2[_0x5671('0x7')](_0x39e4e1,function(_0x554957,_0x1840d4){if(_0x554957){return _0x122232(_0x554957);}pm2[_0x5671('0x8')]();return _0x19fcd5(_0x1840d4);});});});};exports['list']=function(){return connect()['then'](function(){return new BPromise(function(_0x14ed92,_0x3b964e){return pm2[_0x5671('0x9')](function(_0xbfb467,_0x16655b){if(_0xbfb467){return _0x3b964e(_0xbfb467);}pm2[_0x5671('0x8')]();return _0x14ed92(_0x16655b);});});});};exports[_0x5671('0xa')]=function(_0x14fcd6){return connect()[_0x5671('0x4')](function(){return new BPromise(function(_0x3158e3,_0x47ffd3){return pm2[_0x5671('0xa')](_0x14fcd6,function(_0x2a8e33,_0x5dff07){if(_0x2a8e33){return _0x47ffd3(_0x2a8e33);}pm2[_0x5671('0x8')]();return _0x3158e3(_0x5dff07);});});});};exports[_0x5671('0xb')]=function(_0x14c1fb){return connect()[_0x5671('0x4')](function(){return new BPromise(function(_0x52b2c8,_0x634a67){return pm2[_0x5671('0xb')](_0x14c1fb,function(_0x595200,_0x4e70f9){if(_0x595200){return _0x634a67(_0x595200);}pm2[_0x5671('0x8')]();return _0x52b2c8(_0x4e70f9);});});});};exports[_0x5671('0xc')]=function(){return connect()[_0x5671('0x4')](function(){return new BPromise(function(_0x512b84,_0x68ee6d){return pm2[_0x5671('0xc')](function(_0x578dca){if(_0x578dca){return _0x68ee6d(_0x578dca);}return _0x512b84(_0x5671('0xd'));});});});}; \ No newline at end of file +var _0xa4e7=['describe','delete','dump','saved','pm2','bluebird','./config','connect','connected','then','start','disconnect','stop','restart','list'];(function(_0x1a4b13,_0xb01d9b){var _0x5003b0=function(_0x5ec792){while(--_0x5ec792){_0x1a4b13['push'](_0x1a4b13['shift']());}};_0x5003b0(++_0xb01d9b);}(_0xa4e7,0x1d5));var _0x7a4e=function(_0x6bee5,_0x324237){_0x6bee5=_0x6bee5-0x0;var _0x458cda=_0xa4e7[_0x6bee5];return _0x458cda;};'use strict';var pm2=require(_0x7a4e('0x0'));var BPromise=require(_0x7a4e('0x1'));var config=require(_0x7a4e('0x2'));function connect(){return new BPromise(function(_0x173abd,_0x5f5295){return pm2[_0x7a4e('0x3')](function(_0x2e55ac){if(_0x2e55ac){return _0x5f5295(_0x2e55ac);}return _0x173abd(_0x7a4e('0x4'));});});};exports['start']=function(_0x363f26){return connect()[_0x7a4e('0x5')](function(){return new BPromise(function(_0x3543d9,_0x749a45){return pm2[_0x7a4e('0x6')](_0x363f26,function(_0xf38a0a,_0x3a6c0f){if(_0xf38a0a){return _0x749a45(_0xf38a0a);}pm2[_0x7a4e('0x7')]();return _0x3543d9(_0x3a6c0f);});});});};exports[_0x7a4e('0x8')]=function(_0x1df0c5){return connect()[_0x7a4e('0x5')](function(){return new BPromise(function(_0x5bc377,_0x4314ca){return pm2[_0x7a4e('0x8')](_0x1df0c5,function(_0x2d445b,_0x2e6ded){if(_0x2d445b){return _0x4314ca(_0x2d445b);}pm2[_0x7a4e('0x7')]();return _0x5bc377(_0x2e6ded);});});});};exports[_0x7a4e('0x9')]=function(_0x18cff7){return connect()[_0x7a4e('0x5')](function(){return new BPromise(function(_0x18569c,_0x1f635f){return pm2[_0x7a4e('0x9')](_0x18cff7,function(_0x144ec2,_0x3a8677){if(_0x144ec2){return _0x1f635f(_0x144ec2);}pm2[_0x7a4e('0x7')]();return _0x18569c(_0x3a8677);});});});};exports[_0x7a4e('0xa')]=function(){return connect()['then'](function(){return new BPromise(function(_0x117fa8,_0x170ea8){return pm2[_0x7a4e('0xa')](function(_0x32b024,_0x3b4067){if(_0x32b024){return _0x170ea8(_0x32b024);}pm2[_0x7a4e('0x7')]();return _0x117fa8(_0x3b4067);});});});};exports['describe']=function(_0x4ada8d){return connect()['then'](function(){return new BPromise(function(_0x4d894c,_0x170e1f){return pm2[_0x7a4e('0xb')](_0x4ada8d,function(_0x10ab59,_0x315343){if(_0x10ab59){return _0x170e1f(_0x10ab59);}pm2[_0x7a4e('0x7')]();return _0x4d894c(_0x315343);});});});};exports[_0x7a4e('0xc')]=function(_0x547a3b){return connect()[_0x7a4e('0x5')](function(){return new BPromise(function(_0x30d5dc,_0x3f6fbb){return pm2[_0x7a4e('0xc')](_0x547a3b,function(_0x221d7d,_0x536cd2){if(_0x221d7d){return _0x3f6fbb(_0x221d7d);}pm2['disconnect']();return _0x30d5dc(_0x536cd2);});});});};exports[_0x7a4e('0xd')]=function(){return connect()[_0x7a4e('0x5')](function(){return new BPromise(function(_0x4357ea,_0xd24c47){return pm2[_0x7a4e('0xd')](function(_0x14d037){if(_0x14d037){return _0xd24c47(_0x14d037);}return _0x4357ea(_0x7a4e('0xe'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 7e379f4..4a788b8 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 _0xd506=['timeout','YYYY-MM-DD\x20HH:mm:ss','length','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','socket.io-emitter','Setting','find','chatTimeout','then','ChatInteraction','subtract','info','[CHAT]\x20Interactions\x20to\x20close:','join','update'];(function(_0x458dd7,_0xe5602b){var _0x2a12f3=function(_0x547dee){while(--_0x547dee){_0x458dd7['push'](_0x458dd7['shift']());}};_0x2a12f3(++_0xe5602b);}(_0xd506,0x64));var _0x6d50=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xd506[_0x34bf97];return _0x292719;};'use strict';var _=require(_0x6d50('0x0'));var moment=require(_0x6d50('0x1'));var Redis=require('ioredis');var util=require(_0x6d50('0x2'));var config=require(_0x6d50('0x3'));var db=require(_0x6d50('0x4'))['db'];var logger=require(_0x6d50('0x5'))(_0x6d50('0x6'));config[_0x6d50('0x7')]=_[_0x6d50('0x8')](config[_0x6d50('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x6d50('0x9'))(new Redis(config[_0x6d50('0x7')]));function closeInteractions(){var _0x3b8b9b=0x0;var _0x370012=[];return db[_0x6d50('0xa')][_0x6d50('0xb')]({'raw':!![],'attributes':['id',_0x6d50('0xc')],'where':{'id':0x1}})[_0x6d50('0xd')](function(_0x2540dd){_0x3b8b9b=_0x2540dd[_0x6d50('0xc')];if(_0x3b8b9b){return db[_0x6d50('0xe')]['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x6d50('0xf')](_0x2540dd['chatTimeout'],'minutes')}}});}else{return[];}})['then'](function(_0x182916){if(_0x182916&&_0x182916['length']){_0x370012=_['map'](_0x182916||[],'id');logger[_0x6d50('0x10')](_0x6d50('0x11'),_0x370012[_0x6d50('0x12')]());return db[_0x6d50('0xe')][_0x6d50('0x13')]({'closeReason':'system','disposition':_0x6d50('0x14'),'closed':!![],'closedAt':moment()['format'](_0x6d50('0x15'))},{'where':{'id':_0x370012}});}})[_0x6d50('0xd')](function(){if(_0x370012&&_0x370012[_0x6d50('0x16')]){logger[_0x6d50('0x10')](_0x6d50('0x17'),_0x370012[_0x6d50('0x12')]());for(var _0x4f0043=0x0;_0x4f0043<_0x370012[_0x6d50('0x16')];_0x4f0043++){io[_0x6d50('0x18')]('chatInteraction:update',{'id':_0x370012[_0x4f0043],'closed':!![]});}}})[_0x6d50('0x19')](function(_0x1d645e){logger[_0x6d50('0x1a')](_0x6d50('0x1b'),_0x1d645e?util[_0x6d50('0x1c')](_0x1d645e,{'showHidden':![],'depth':null}):'');});}exports[_0x6d50('0x1d')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xb0f3=['join','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','chatInteraction:update','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../mysqldb','../logger','redis','socket.io-emitter','Setting','chatTimeout','then','ChatInteraction','subtract','length','map','info'];(function(_0x1b68ba,_0x23687a){var _0xf49b11=function(_0x5732c6){while(--_0x5732c6){_0x1b68ba['push'](_0x1b68ba['shift']());}};_0xf49b11(++_0x23687a);}(_0xb0f3,0x8c));var _0x3b0f=function(_0x50a3e1,_0x43d894){_0x50a3e1=_0x50a3e1-0x0;var _0x3f5a7f=_0xb0f3[_0x50a3e1];return _0x3f5a7f;};'use strict';var _=require(_0x3b0f('0x0'));var moment=require(_0x3b0f('0x1'));var Redis=require(_0x3b0f('0x2'));var util=require(_0x3b0f('0x3'));var config=require('../../config/environment');var db=require(_0x3b0f('0x4'))['db'];var logger=require(_0x3b0f('0x5'))('schedule');config[_0x3b0f('0x6')]=_['defaults'](config[_0x3b0f('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x3b0f('0x7'))(new Redis(config[_0x3b0f('0x6')]));function closeInteractions(){var _0x2d0f6b=0x0;var _0x739d05=[];return db[_0x3b0f('0x8')]['find']({'raw':!![],'attributes':['id',_0x3b0f('0x9')],'where':{'id':0x1}})[_0x3b0f('0xa')](function(_0x17c542){_0x2d0f6b=_0x17c542['chatTimeout'];if(_0x2d0f6b){return db[_0x3b0f('0xb')]['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x3b0f('0xc')](_0x17c542['chatTimeout'],'minutes')}}});}else{return[];}})[_0x3b0f('0xa')](function(_0x43efb2){if(_0x43efb2&&_0x43efb2[_0x3b0f('0xd')]){_0x739d05=_[_0x3b0f('0xe')](_0x43efb2||[],'id');logger[_0x3b0f('0xf')]('[CHAT]\x20Interactions\x20to\x20close:',_0x739d05[_0x3b0f('0x10')]());return db[_0x3b0f('0xb')][_0x3b0f('0x11')]({'closeReason':_0x3b0f('0x12'),'disposition':_0x3b0f('0x13'),'closed':!![],'closedAt':moment()['format'](_0x3b0f('0x14'))},{'where':{'id':_0x739d05}});}})[_0x3b0f('0xa')](function(){if(_0x739d05&&_0x739d05['length']){logger[_0x3b0f('0xf')](_0x3b0f('0x15'),_0x739d05[_0x3b0f('0x10')]());for(var _0x16ab27=0x0;_0x16ab27<_0x739d05['length'];_0x16ab27++){io['emit'](_0x3b0f('0x16'),{'id':_0x739d05[_0x16ab27],'closed':!![]});}}})['catch'](function(_0x4e09cd){logger['error'](_0x3b0f('0x17'),_0x4e09cd?util[_0x3b0f('0x18')](_0x4e09cd,{'showHidden':![],'depth':null}):'');});}exports[_0x3b0f('0x19')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/cloud-provider.js b/server/config/schedule/cloud-provider.js index b8b7b2b..4ec7b82 100644 --- a/server/config/schedule/cloud-provider.js +++ b/server/config/schedule/cloud-provider.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd269=['startAllRefreshIntervals'];(function(_0x3b534c,_0x2c614f){var _0x449ef9=function(_0x285279){while(--_0x285279){_0x3b534c['push'](_0x3b534c['shift']());}};_0x449ef9(++_0x2c614f);}(_0xd269,0x151));var _0x9d26=function(_0x597d1c,_0x2ff990){_0x597d1c=_0x597d1c-0x0;var _0x4393fe=_0xd269[_0x597d1c];return _0x4393fe;};'use strict';function start(){var _0x8c7090=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x8c7090[_0x9d26('0x0')]();}module['exports']={'intervals':{},'start':start}; \ No newline at end of file +var _0x721f=['../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals','exports'];(function(_0x3c5426,_0x36b0f7){var _0x706015=function(_0x4d1d90){while(--_0x4d1d90){_0x3c5426['push'](_0x3c5426['shift']());}};_0x706015(++_0x36b0f7);}(_0x721f,0x180));var _0xf721=function(_0x1036b6,_0x5e3511){_0x1036b6=_0x1036b6-0x0;var _0x373faf=_0x721f[_0x1036b6];return _0x373faf;};'use strict';function start(){var _0x23f080=require(_0xf721('0x0'));return _0x23f080[_0xf721('0x1')]();}module[_0xf721('0x2')]={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 6505902..f2fa551 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 _0xba0b=['length','index','my\x20id','resolve','run\x20job','cron','isBetween','startAt','endAt','add','add\x20cron','stop\x20cron','active','update','update\x20cron','deleteJob','run','moment','cron-job-manager','jayson/promise','bluebird','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','info','email','MailAccount','getSmtpOptions','format','\x22%s\x22\x20<%s>','name','Smtp','user','bcc','subtractNumber','subtractUnit','join','savename','basename','extname','zip','existsSync','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','status','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','SendMail','then','error','email\x20sent','catch','error\x20mail','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','exec\x20custom\x20report\x20id:%s','CustomReportId','no\x20report\x20id','Schedule','findAll','MailServerOut','CloudProvider','keys','jobs','toString','keyBy','difference','exists','stop','toRun'];(function(_0x340da8,_0x5e2348){var _0x585b1f=function(_0x45c170){while(--_0x45c170){_0x340da8['push'](_0x340da8['shift']());}};_0x585b1f(++_0x5e2348);}(_0xba0b,0x110));var _0xbba0=function(_0x49fa06,_0x5e9eb2){_0x49fa06=_0x49fa06-0x0;var _0x1a1cbf=_0xba0b[_0x49fa06];return _0x1a1cbf;};'use strict';var fs=require('fs');var util=require('util');var path=require('path');var _=require('lodash');var moment=require(_0xbba0('0x0'));var CronJobManager=require(_0xbba0('0x1'));var jayson=require(_0xbba0('0x2'));var BPromise=require(_0xbba0('0x3'));var logger=require('../logger')(_0xbba0('0x4'));var db=require(_0xbba0('0x5'))['db'];var analyticCustomReportController=require(_0xbba0('0x6'));var analyticDefaultReportController=require(_0xbba0('0x7'));var client=jayson[_0xbba0('0x8')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x749166,_0x75fb2b){return function(){logger[_0xbba0('0x9')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x749166[_0xbba0('0xa')]);var _0x1852f3=!![];var _0x30fe8a=_0x749166[_0xbba0('0xb')][_0xbba0('0xc')]();var _0x3feb35={'account':_0x30fe8a,'message':{'from':util[_0xbba0('0xd')](_0xbba0('0xe'),_0x749166[_0xbba0('0xb')][_0xbba0('0xf')],_0x749166['MailAccount'][_0xbba0('0xa')]||_0x749166[_0xbba0('0xb')][_0xbba0('0x10')][_0xbba0('0x11')]),'to':_0x749166[_0xbba0('0xa')],'cc':_0x749166['cc'],'bcc':_0x749166[_0xbba0('0x12')],'subject':util[_0xbba0('0xd')]('Report\x20%s\x20last\x20%s\x20%s',_0x75fb2b[_0xbba0('0xf')],_0x749166[_0xbba0('0x13')],_0x749166[_0xbba0('0x14')])}};var _0x1adde6=path[_0xbba0('0x15')](__dirname,'../../files/reports');var _0x5011bf=_0x75fb2b[_0xbba0('0x16')];var _0x5be445=util[_0xbba0('0xd')]('%s.%s',path[_0xbba0('0x17')](_0x75fb2b[_0xbba0('0x16')],path[_0xbba0('0x18')](_0x75fb2b[_0xbba0('0x16')])),_0xbba0('0x19'));var _0x2ba244=path[_0xbba0('0x15')](_0x1adde6,_0x5011bf);var _0x14b147=path[_0xbba0('0x15')](_0x1adde6,_0x5be445);if(fs[_0xbba0('0x1a')](_0x2ba244)){_0x75fb2b['status']=_0xbba0('0x1b');_0x3feb35[_0xbba0('0x1c')][_0xbba0('0x1d')]=[{'filename':_0x5011bf,'path':_0x2ba244}];_0x3feb35['message'][_0xbba0('0x1e')]=util[_0xbba0('0xd')](_0xbba0('0x1f'),JSON[_0xbba0('0x20')](_0x75fb2b,null,0x2));}else if(fs['existsSync'](_0x14b147)){_0x75fb2b[_0xbba0('0x21')]=_0xbba0('0x1b');_0x3feb35['message'][_0xbba0('0x1d')]=[{'filename':_0x5be445,'path':_0x14b147}];}else{_0x3feb35[_0xbba0('0x1c')][_0xbba0('0x1e')]=_0xbba0('0x22');if(!_0x749166[_0xbba0('0x23')]){_0x1852f3=![];logger[_0xbba0('0x9')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x1852f3){return client['request'](_0xbba0('0x24'),_0x3feb35)[_0xbba0('0x25')](function(_0x20b1d1){if(_0x20b1d1[_0xbba0('0x26')]){return logger['error']('error\x20mail',JSON[_0xbba0('0x20')](_0x20b1d1));}return logger['info'](_0xbba0('0x27'));})[_0xbba0('0x28')](function(_0x4b637e){return logger['error'](_0xbba0('0x29'),JSON[_0xbba0('0x20')](_0x4b637e));});}};}function handleError(){return function(_0x29d874){return logger[_0xbba0('0x26')](JSON[_0xbba0('0x20')](_0x29d874));};}function handleResult(_0x2f605c){return function(_0x3007c4){logger[_0xbba0('0x9')](_0xbba0('0x2a'),JSON['stringify'](_0x3007c4));if(_0x2f605c[_0xbba0('0xb')]&&_0x2f605c[_0xbba0('0xb')][_0xbba0('0x10')]&&!_[_0xbba0('0x2b')](_0x2f605c[_0xbba0('0xa')])){setTimeout(handleSendEmail(_0x2f605c,_0x3007c4),0x3c*0x3e8);}};}function handleJob(_0x1ee017){return function(){try{if(_[_0xbba0('0x2b')](_0x1ee017['subtractNumber'])){return logger[_0xbba0('0x9')](_0xbba0('0x2c'));}if(_[_0xbba0('0x2b')](_0x1ee017[_0xbba0('0x14')])){return logger[_0xbba0('0x9')](_0xbba0('0x2d'));}var _0x507fb0={'startDate':moment()[_0xbba0('0x2e')](_0x1ee017[_0xbba0('0x13')],_0x1ee017[_0xbba0('0x14')])[_0xbba0('0xd')](_0xbba0('0x2f')),'endDate':moment()[_0xbba0('0xd')](_0xbba0('0x2f')),'type':_0xbba0('0x30'),'output':_0x1ee017[_0xbba0('0x31')],'name':_0x1ee017['name']};if(!_['isNil'](_0x1ee017[_0xbba0('0x32')])){logger[_0xbba0('0x9')](_0xbba0('0x33'),_0x1ee017[_0xbba0('0x32')]);return analyticDefaultReportController[_0xbba0('0x34')]({'id':_0x1ee017[_0xbba0('0x32')]},_0x507fb0)[_0xbba0('0x25')](handleResult(_0x1ee017))[_0xbba0('0x28')](handleError());}if(!_[_0xbba0('0x2b')](_0x1ee017['CustomReportId'])){logger['info'](_0xbba0('0x35'),_0x1ee017[_0xbba0('0x36')]);return analyticCustomReportController[_0xbba0('0x34')]({'id':_0x1ee017['CustomReportId']},_0x507fb0)['then'](handleResult(_0x1ee017))[_0xbba0('0x28')](handleError());}}catch(_0x2538e7){logger[_0xbba0('0x26')](JSON[_0xbba0('0x20')](_0x2538e7));}return logger[_0xbba0('0x9')](_0xbba0('0x37'));};}function getJobs(_0x488756){var _0x682f9c={};if(_0x488756){_0x682f9c['id']=_0x488756;}return db[_0xbba0('0x38')][_0xbba0('0x39')]({'where':_0x682f9c,'include':[{'model':db[_0xbba0('0xb')],'attributes':['id',_0xbba0('0xf'),'email'],'include':[{'model':db[_0xbba0('0x3a')],'as':_0xbba0('0x10'),'include':[{'model':db['CloudProvider'],'as':_0xbba0('0x3b')}]}]}]})['then'](function(_0x3fb97c){var _0x522548=_[_0xbba0('0x3c')](manager[_0xbba0('0x3d')]);var _0x538a52=_['map'](_0x3fb97c,function(_0x10c8a0){return _0x10c8a0['id'][_0xbba0('0x3e')]();});var _0x19cfe7=_[_0xbba0('0x3f')](_0x3fb97c,function(_0x4a7da7){return _0x4a7da7['id'][_0xbba0('0x3e')]();});var _0x28332b=_0x488756?_0x538a52:_[_0xbba0('0x40')](_0x538a52,_0x522548);var _0x4873c3=_['intersection'](_0x538a52,_0x522548);var _0x385be4=_['difference'](_0x522548,_0x538a52);var _0x2cf3a4;var _0x1465eb;for(_0x2cf3a4=0x0;_0x2cf3a4<_0x385be4['length']&&!_0x488756;_0x2cf3a4+=0x1){_0x1465eb=_0x385be4[_0x2cf3a4]['toString']();if(manager[_0xbba0('0x41')](_0x1465eb)){manager[_0xbba0('0x42')](_0x1465eb);manager['deleteJob'](_0x1465eb);logger[_0xbba0('0x9')]('delete\x20cron',_0x1465eb);}}logger['info'](_0xbba0('0x43'),JSON[_0xbba0('0x20')](_0x28332b));for(_0x2cf3a4=0x0;_0x2cf3a4<_0x28332b[_0xbba0('0x44')];_0x2cf3a4+=0x1){_0x1465eb=_0x28332b[_0x2cf3a4][_0xbba0('0x3e')]();logger[_0xbba0('0x9')](_0xbba0('0x45'),_0x1465eb);if(_0x488756){logger[_0xbba0('0x9')](_0xbba0('0x46'),_0x488756);logger[_0xbba0('0x9')](JSON[_0xbba0('0x20')](_0x19cfe7[_0x1465eb]));BPromise[_0xbba0('0x47')]()[_0xbba0('0x25')](handleJob(_0x19cfe7[_0x1465eb]));logger[_0xbba0('0x9')](_0xbba0('0x48'),_0x19cfe7[_0x1465eb][_0xbba0('0xf')],_0x19cfe7[_0x1465eb][_0xbba0('0x49')]);}else if(_0x19cfe7[_0x1465eb]['cron']&&_0x19cfe7[_0x1465eb]['active']&&moment()[_0xbba0('0x4a')](_0x19cfe7[_0x1465eb][_0xbba0('0x4b')],_0x19cfe7[_0x1465eb][_0xbba0('0x4c')])){manager[_0xbba0('0x4d')](_0x1465eb,_0x19cfe7[_0x1465eb]['cron'],handleJob(_0x19cfe7[_0x1465eb]));manager['start'](_0x1465eb);logger['info'](_0xbba0('0x4e'),_0x19cfe7[_0x1465eb][_0xbba0('0xf')],_0x19cfe7[_0x1465eb][_0xbba0('0x49')]);}else if(manager[_0xbba0('0x41')](_0x1465eb)){manager[_0xbba0('0x42')](_0x1465eb);manager['deleteJob'](_0x1465eb);logger[_0xbba0('0x9')](_0xbba0('0x4f'),_0x19cfe7[_0x1465eb]['name'],_0x19cfe7[_0x1465eb][_0xbba0('0x49')]);}}for(_0x2cf3a4=0x0,_0x1465eb;_0x2cf3a4<_0x4873c3[_0xbba0('0x44')]&&!_0x488756;_0x2cf3a4+=0x1){_0x1465eb=_0x4873c3[_0x2cf3a4]['toString']();if(manager['exists'](_0x1465eb)){if(_0x19cfe7[_0x1465eb]['cron']&&_0x19cfe7[_0x1465eb][_0xbba0('0x50')]&&moment()['isBetween'](_0x19cfe7[_0x1465eb]['startAt'],_0x19cfe7[_0x1465eb][_0xbba0('0x4c')])){manager[_0xbba0('0x51')](_0x1465eb,_0x19cfe7[_0x1465eb][_0xbba0('0x49')],handleJob(_0x19cfe7[_0x1465eb]));logger[_0xbba0('0x9')](_0xbba0('0x52'),_0x19cfe7[_0x1465eb][_0xbba0('0xf')],_0x19cfe7[_0x1465eb][_0xbba0('0x49')]);}else{manager[_0xbba0('0x42')](_0x1465eb);manager[_0xbba0('0x53')](_0x1465eb);logger['info'](_0xbba0('0x4f'),_0x19cfe7[_0x1465eb][_0xbba0('0xf')],_0x19cfe7[_0x1465eb][_0xbba0('0x49')]);}}}})[_0xbba0('0x28')](function(_0x2f2efb){logger[_0xbba0('0x26')](JSON[_0xbba0('0x20')](_0x2f2efb));});}exports[_0xbba0('0x54')]=function(_0x34bd42){return getJobs(_0x34bd42);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x4a4d=['savename','%s.%s','basename','extname','zip','join','Sent','attachments','message','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','existsSync','text','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','info','empty\x20file,\x20email\x20not\x20sent','then','error','error\x20mail','data','isNil','subtractUnit','YYYY-MM-DD\x20HH:mm:ss','output','exec\x20defaul\x20report\x20id:%s','CustomReportId','runReport','catch','Schedule','findAll','MailServerOut','CloudProvider','keys','jobs','map','keyBy','toString','difference','intersection','length','exists','deleteJob','delete\x20cron','toRun','index','my\x20id','cron','active','isBetween','startAt','endAt','add','start','add\x20cron','stop\x20cron','update','update\x20cron','stop','run','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','format','name','Smtp','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','../../files/reports'];(function(_0x162167,_0x52203f){var _0x13fda6=function(_0x47848e){while(--_0x47848e){_0x162167['push'](_0x162167['shift']());}};_0x13fda6(++_0x52203f);}(_0x4a4d,0x90));var _0xd4a4=function(_0x3b7db2,_0x5edd58){_0x3b7db2=_0x3b7db2-0x0;var _0x3a819e=_0x4a4d[_0x3b7db2];return _0x3a819e;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0xd4a4('0x0'));var _=require(_0xd4a4('0x1'));var moment=require(_0xd4a4('0x2'));var CronJobManager=require(_0xd4a4('0x3'));var jayson=require(_0xd4a4('0x4'));var BPromise=require(_0xd4a4('0x5'));var logger=require(_0xd4a4('0x6'))(_0xd4a4('0x7'));var db=require(_0xd4a4('0x8'))['db'];var analyticCustomReportController=require(_0xd4a4('0x9'));var analyticDefaultReportController=require(_0xd4a4('0xa'));var client=jayson[_0xd4a4('0xb')][_0xd4a4('0xc')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x400297,_0x566434){return function(){logger['info'](_0xd4a4('0xd'),_0x400297[_0xd4a4('0xe')]);var _0x15ce60=!![];var _0x509b99=_0x400297[_0xd4a4('0xf')][_0xd4a4('0x10')]();var _0x316790={'account':_0x509b99,'message':{'from':util[_0xd4a4('0x11')]('\x22%s\x22\x20<%s>',_0x400297[_0xd4a4('0xf')][_0xd4a4('0x12')],_0x400297[_0xd4a4('0xf')][_0xd4a4('0xe')]||_0x400297[_0xd4a4('0xf')][_0xd4a4('0x13')]['user']),'to':_0x400297['email'],'cc':_0x400297['cc'],'bcc':_0x400297[_0xd4a4('0x14')],'subject':util[_0xd4a4('0x11')](_0xd4a4('0x15'),_0x566434[_0xd4a4('0x12')],_0x400297[_0xd4a4('0x16')],_0x400297['subtractUnit'])}};var _0x2b11c8=path['join'](__dirname,_0xd4a4('0x17'));var _0x31134b=_0x566434[_0xd4a4('0x18')];var _0x29f4c3=util['format'](_0xd4a4('0x19'),path[_0xd4a4('0x1a')](_0x566434[_0xd4a4('0x18')],path[_0xd4a4('0x1b')](_0x566434[_0xd4a4('0x18')])),_0xd4a4('0x1c'));var _0x4ebb37=path[_0xd4a4('0x1d')](_0x2b11c8,_0x31134b);var _0x19249f=path['join'](_0x2b11c8,_0x29f4c3);if(fs['existsSync'](_0x4ebb37)){_0x566434['status']=_0xd4a4('0x1e');_0x316790['message'][_0xd4a4('0x1f')]=[{'filename':_0x31134b,'path':_0x4ebb37}];_0x316790[_0xd4a4('0x20')]['text']=util[_0xd4a4('0x11')](_0xd4a4('0x21'),JSON[_0xd4a4('0x22')](_0x566434,null,0x2));}else if(fs[_0xd4a4('0x23')](_0x19249f)){_0x566434['status']=_0xd4a4('0x1e');_0x316790[_0xd4a4('0x20')][_0xd4a4('0x1f')]=[{'filename':_0x29f4c3,'path':_0x19249f}];}else{_0x316790['message'][_0xd4a4('0x24')]=_0xd4a4('0x25');if(!_0x400297[_0xd4a4('0x26')]){_0x15ce60=![];logger[_0xd4a4('0x27')](_0xd4a4('0x28'));}}if(_0x15ce60){return client['request']('SendMail',_0x316790)[_0xd4a4('0x29')](function(_0x21d1d4){if(_0x21d1d4[_0xd4a4('0x2a')]){return logger[_0xd4a4('0x2a')](_0xd4a4('0x2b'),JSON[_0xd4a4('0x22')](_0x21d1d4));}return logger['info']('email\x20sent');})['catch'](function(_0x5bb5dd){return logger[_0xd4a4('0x2a')]('error\x20mail',JSON[_0xd4a4('0x22')](_0x5bb5dd));});}};}function handleError(){return function(_0x46176b){return logger['error'](JSON[_0xd4a4('0x22')](_0x46176b));};}function handleResult(_0x46870b){return function(_0x23d8b8){logger[_0xd4a4('0x27')](_0xd4a4('0x2c'),JSON[_0xd4a4('0x22')](_0x23d8b8));if(_0x46870b[_0xd4a4('0xf')]&&_0x46870b[_0xd4a4('0xf')][_0xd4a4('0x13')]&&!_['isNil'](_0x46870b[_0xd4a4('0xe')])){setTimeout(handleSendEmail(_0x46870b,_0x23d8b8),0x3c*0x3e8);}};}function handleJob(_0x52c769){return function(){try{if(_[_0xd4a4('0x2d')](_0x52c769['subtractNumber'])){return logger[_0xd4a4('0x27')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xd4a4('0x2d')](_0x52c769[_0xd4a4('0x2e')])){return logger[_0xd4a4('0x27')]('subtractUnit\x20null\x20or\x20undefined');}var _0x1788fb={'startDate':moment()['subtract'](_0x52c769['subtractNumber'],_0x52c769[_0xd4a4('0x2e')])['format'](_0xd4a4('0x2f')),'endDate':moment()['format'](_0xd4a4('0x2f')),'type':'scheduled','output':_0x52c769[_0xd4a4('0x30')],'name':_0x52c769['name']};if(!_['isNil'](_0x52c769['DefaultReportId'])){logger[_0xd4a4('0x27')](_0xd4a4('0x31'),_0x52c769['DefaultReportId']);return analyticDefaultReportController['runReport']({'id':_0x52c769['DefaultReportId']},_0x1788fb)['then'](handleResult(_0x52c769))['catch'](handleError());}if(!_[_0xd4a4('0x2d')](_0x52c769[_0xd4a4('0x32')])){logger['info']('exec\x20custom\x20report\x20id:%s',_0x52c769[_0xd4a4('0x32')]);return analyticCustomReportController[_0xd4a4('0x33')]({'id':_0x52c769['CustomReportId']},_0x1788fb)[_0xd4a4('0x29')](handleResult(_0x52c769))[_0xd4a4('0x34')](handleError());}}catch(_0x4a4505){logger[_0xd4a4('0x2a')](JSON[_0xd4a4('0x22')](_0x4a4505));}return logger[_0xd4a4('0x27')]('no\x20report\x20id');};}function getJobs(_0x267648){var _0x3faaa8={};if(_0x267648){_0x3faaa8['id']=_0x267648;}return db[_0xd4a4('0x35')][_0xd4a4('0x36')]({'where':_0x3faaa8,'include':[{'model':db[_0xd4a4('0xf')],'attributes':['id','name','email'],'include':[{'model':db[_0xd4a4('0x37')],'as':_0xd4a4('0x13'),'include':[{'model':db['CloudProvider'],'as':_0xd4a4('0x38')}]}]}]})[_0xd4a4('0x29')](function(_0x4903cf){var _0xeede2d=_[_0xd4a4('0x39')](manager[_0xd4a4('0x3a')]);var _0xbd745e=_[_0xd4a4('0x3b')](_0x4903cf,function(_0x1d3610){return _0x1d3610['id']['toString']();});var _0x472e51=_[_0xd4a4('0x3c')](_0x4903cf,function(_0x38934f){return _0x38934f['id'][_0xd4a4('0x3d')]();});var _0x405e8f=_0x267648?_0xbd745e:_[_0xd4a4('0x3e')](_0xbd745e,_0xeede2d);var _0x349316=_[_0xd4a4('0x3f')](_0xbd745e,_0xeede2d);var _0x304ca4=_[_0xd4a4('0x3e')](_0xeede2d,_0xbd745e);var _0x1ee1e2;var _0x337da3;for(_0x1ee1e2=0x0;_0x1ee1e2<_0x304ca4[_0xd4a4('0x40')]&&!_0x267648;_0x1ee1e2+=0x1){_0x337da3=_0x304ca4[_0x1ee1e2][_0xd4a4('0x3d')]();if(manager[_0xd4a4('0x41')](_0x337da3)){manager['stop'](_0x337da3);manager[_0xd4a4('0x42')](_0x337da3);logger['info'](_0xd4a4('0x43'),_0x337da3);}}logger[_0xd4a4('0x27')](_0xd4a4('0x44'),JSON[_0xd4a4('0x22')](_0x405e8f));for(_0x1ee1e2=0x0;_0x1ee1e2<_0x405e8f[_0xd4a4('0x40')];_0x1ee1e2+=0x1){_0x337da3=_0x405e8f[_0x1ee1e2][_0xd4a4('0x3d')]();logger[_0xd4a4('0x27')](_0xd4a4('0x45'),_0x337da3);if(_0x267648){logger[_0xd4a4('0x27')](_0xd4a4('0x46'),_0x267648);logger['info'](JSON['stringify'](_0x472e51[_0x337da3]));BPromise['resolve']()[_0xd4a4('0x29')](handleJob(_0x472e51[_0x337da3]));logger[_0xd4a4('0x27')]('run\x20job',_0x472e51[_0x337da3][_0xd4a4('0x12')],_0x472e51[_0x337da3]['cron']);}else if(_0x472e51[_0x337da3][_0xd4a4('0x47')]&&_0x472e51[_0x337da3][_0xd4a4('0x48')]&&moment()[_0xd4a4('0x49')](_0x472e51[_0x337da3][_0xd4a4('0x4a')],_0x472e51[_0x337da3][_0xd4a4('0x4b')])){manager[_0xd4a4('0x4c')](_0x337da3,_0x472e51[_0x337da3][_0xd4a4('0x47')],handleJob(_0x472e51[_0x337da3]));manager[_0xd4a4('0x4d')](_0x337da3);logger[_0xd4a4('0x27')](_0xd4a4('0x4e'),_0x472e51[_0x337da3][_0xd4a4('0x12')],_0x472e51[_0x337da3][_0xd4a4('0x47')]);}else if(manager[_0xd4a4('0x41')](_0x337da3)){manager['stop'](_0x337da3);manager[_0xd4a4('0x42')](_0x337da3);logger[_0xd4a4('0x27')](_0xd4a4('0x4f'),_0x472e51[_0x337da3]['name'],_0x472e51[_0x337da3][_0xd4a4('0x47')]);}}for(_0x1ee1e2=0x0,_0x337da3;_0x1ee1e2<_0x349316[_0xd4a4('0x40')]&&!_0x267648;_0x1ee1e2+=0x1){_0x337da3=_0x349316[_0x1ee1e2][_0xd4a4('0x3d')]();if(manager[_0xd4a4('0x41')](_0x337da3)){if(_0x472e51[_0x337da3][_0xd4a4('0x47')]&&_0x472e51[_0x337da3][_0xd4a4('0x48')]&&moment()[_0xd4a4('0x49')](_0x472e51[_0x337da3][_0xd4a4('0x4a')],_0x472e51[_0x337da3]['endAt'])){manager[_0xd4a4('0x50')](_0x337da3,_0x472e51[_0x337da3][_0xd4a4('0x47')],handleJob(_0x472e51[_0x337da3]));logger['info'](_0xd4a4('0x51'),_0x472e51[_0x337da3]['name'],_0x472e51[_0x337da3][_0xd4a4('0x47')]);}else{manager[_0xd4a4('0x52')](_0x337da3);manager[_0xd4a4('0x42')](_0x337da3);logger[_0xd4a4('0x27')](_0xd4a4('0x4f'),_0x472e51[_0x337da3][_0xd4a4('0x12')],_0x472e51[_0x337da3][_0xd4a4('0x47')]);}}}})[_0xd4a4('0x34')](function(_0x12e8e2){logger['error'](JSON[_0xd4a4('0x22')](_0x12e8e2));});}exports[_0xd4a4('0x53')]=function(_0x28b4a4){return getJobs(_0x28b4a4);};exports[_0xd4a4('0x4d')]=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 ff326f0..19f2b1c 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 _0x5706=['[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Positive','SentimentScore','Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','all','catch','inspect','start','lodash','aws-sdk','request-promise','bluebird','../../config/logger','transcribe','TranscribeService','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','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured'];(function(_0x59db01,_0x3761f0){var _0x112e17=function(_0xc8bb82){while(--_0xc8bb82){_0x59db01['push'](_0x59db01['shift']());}};_0x112e17(++_0x3761f0);}(_0x5706,0xb0));var _0x6570=function(_0x47beda,_0xf71fef){_0x47beda=_0x47beda-0x0;var _0x3a744f=_0x5706[_0x47beda];return _0x3a744f;};var _=require(_0x6570('0x0'));var AWS=require(_0x6570('0x1'));var rp=require(_0x6570('0x2'));var util=require('util');var BPromise=require(_0x6570('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x6570('0x4'))(_0x6570('0x5'));function getTranscriptionJob(_0x95a926,_0x26e23c,_0x41adac,_0x14d076){return new Promise(function(_0x3ae2f1,_0x3eb22a){var _0x140ee2=new AWS[(_0x6570('0x6'))]({'accessKeyId':_0x26e23c,'secretAccessKey':_0x95a926,'region':_0x41adac});_0x140ee2['getTranscriptionJob']({'TranscriptionJobName':_0x14d076},function(_0x594eef,_0x2310ad){if(_0x594eef){return _0x3eb22a(_0x594eef);}else{return _0x3ae2f1(_0x2310ad);}});});}function sentiment(_0x39ed59,_0x28e7a4,_0x312455,_0x2dde4e,_0x3cb988){return new Promise(function(_0x4aaf60,_0x4b4581){var _0x5b71be=new AWS[(_0x6570('0x7'))]({'accessKeyId':_0x28e7a4,'secretAccessKey':_0x39ed59,'region':_0x312455});_0x5b71be[_0x6570('0x8')]({'Text':_0x2dde4e,'LanguageCode':_0x3cb988[_0x6570('0x9')](0x0,0x2)},function(_0x3c768f,_0x435809){if(_0x3c768f){return _0x4b4581(_0x3c768f);}else{return _0x4aaf60(_0x435809);}});});}function checkTranscribeJob(_0x2d0d0f,_0xc903eb,_0x3098d5){var _0x90499d;return new BPromise(function(_0x4a6fb8,_0xdc293b){logger[_0x6570('0xa')](util[_0x6570('0xb')](_0x6570('0xc'),_0x2d0d0f['id'],_0x2d0d0f[_0x6570('0xd')]));return getTranscriptionJob(_0x3098d5[_0x6570('0xe')],_0x3098d5[_0x6570('0xf')],_0xc903eb[_0x6570('0x10')],_0x2d0d0f[_0x6570('0xd')])[_0x6570('0x11')](function(_0x1861c4){logger[_0x6570('0xa')](util['format'](_0x6570('0x12'),_0x2d0d0f['id'],_0x2d0d0f['transcribeName'],_0x1861c4[_0x6570('0x13')][_0x6570('0x14')]));if(!_0x2d0d0f[_0x6570('0x15')]){switch(_0x1861c4[_0x6570('0x13')][_0x6570('0x14')]){case _0x6570('0x16'):var _0x26af5b={'transcribeStatus':_0x1861c4[_0x6570('0x13')][_0x6570('0x14')],'fileUri':_0x1861c4['TranscriptionJob'][_0x6570('0x17')][_0x6570('0x18')]};logger[_0x6570('0xa')](util[_0x6570('0xb')]('[RECORDING:%d]\x20Get\x20transcript',_0x2d0d0f['id']));return rp({'uri':_0x1861c4[_0x6570('0x13')][_0x6570('0x17')][_0x6570('0x18')],'json':!![]})[_0x6570('0x11')](function(_0x59c604){logger['info'](util['format'](_0x6570('0x19'),_0x2d0d0f['id']));if(_0x59c604&&_0x59c604['results']&&_0x59c604[_0x6570('0x1a')][_0x6570('0x1b')]&&_0x59c604[_0x6570('0x1a')]['transcripts']['length']){_0x26af5b[_0x6570('0x15')]='';for(var _0x5778e1=0x0;_0x5778e1<_0x59c604[_0x6570('0x1a')]['transcripts'][_0x6570('0x1c')];_0x5778e1++){_0x26af5b[_0x6570('0x15')]+=_0x59c604['results']['transcripts'][_0x5778e1][_0x6570('0x1d')]+'';}}return _0x2d0d0f[_0x6570('0x1e')](_0x26af5b);})['then'](function(){logger[_0x6570('0xa')](util[_0x6570('0xb')](_0x6570('0x1f'),_0x2d0d0f['id']));if(!_0x2d0d0f[_0x6570('0x20')]){throw new db[(_0x6570('0x21'))][(_0x6570('0x22'))](_0x6570('0x23'));}if(!_0xc903eb[_0x6570('0x24')]||!_0xc903eb[_0x6570('0x25')]||!_0xc903eb['sentimentRegion']||!_0xc903eb[_0x6570('0x26')]||!_0xc903eb[_0x6570('0x27')]){throw new db[(_0x6570('0x21'))][(_0x6570('0x22'))](_0x6570('0x28'));}if(!_0x26af5b[_0x6570('0x15')]){throw new Error(_0x6570('0x29'));}if(_0xc903eb['sentimentAccountId']===_0x3098d5['id']){return _0x3098d5;}else{return db[_0x6570('0x2a')][_0x6570('0x2b')]({'where':{'id':_settings[_0x6570('0x25')]}});}})['then'](function(_0x4ffc70){if(!_0x4ffc70){throw new db['Sequelize'][(_0x6570('0x22'))](_0x6570('0x2c'));}if(!_0x4ffc70[_0x6570('0xe')]||!_0x4ffc70[_0x6570('0xf')]){throw new db[(_0x6570('0x21'))][(_0x6570('0x22'))](_0x6570('0x2d'));}_0x90499d=_0x4ffc70;logger[_0x6570('0xa')](util[_0x6570('0xb')](_0x6570('0x2e'),_0x2d0d0f['id']));return sentiment(_0x90499d[_0x6570('0xe')],_0x90499d[_0x6570('0xf')],_0xc903eb['sentimentRegion'],_0x26af5b[_0x6570('0x15')],_0xc903eb[_0x6570('0x26')]);})[_0x6570('0x11')](function(_0x14fdb0){logger[_0x6570('0xa')](util['format']('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x2d0d0f['id']));return _0x2d0d0f[_0x6570('0x1e')]({'sentiment':_0x14fdb0['Sentiment'],'sPositive':_0x14fdb0['SentimentScore'][_0x6570('0x2f')],'sNegative':_0x14fdb0[_0x6570('0x30')][_0x6570('0x31')],'sMixed':_0x14fdb0[_0x6570('0x30')][_0x6570('0x32')],'sNeutral':_0x14fdb0[_0x6570('0x30')][_0x6570('0x33')]});})[_0x6570('0x11')](function(){logger[_0x6570('0xa')](util[_0x6570('0xb')](_0x6570('0x1f'),_0x2d0d0f['id']));_0x4a6fb8();});case _0x6570('0x34'):return _0x2d0d0f[_0x6570('0x1e')]({'transcribeStatus':_0x6570('0x34'),'failureReason':_0x1861c4[_0x6570('0x13')][_0x6570('0x35')]})[_0x6570('0x11')](function(){logger['info'](util['format'](_0x6570('0x1f'),_0x2d0d0f['id']));_0x4a6fb8();});default:logger['info'](util[_0x6570('0xb')](_0x6570('0x36'),_0x2d0d0f['id']));break;}}else{return BPromise[_0x6570('0x37')]()[_0x6570('0x11')](function(){if(!_0x2d0d0f[_0x6570('0x20')]){throw new db[(_0x6570('0x21'))][(_0x6570('0x22'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0xc903eb[_0x6570('0x24')]||!_0xc903eb[_0x6570('0x25')]||!_0xc903eb['sentimentRegion']||!_0xc903eb[_0x6570('0x26')]||!_0xc903eb[_0x6570('0x27')]){throw new db['Sequelize'][(_0x6570('0x22'))](_0x6570('0x28'));}if(!_0x2d0d0f['fileText']){throw new Error(_0x6570('0x29'));}if(_0xc903eb[_0x6570('0x25')]===_0x3098d5['id']){return _0x3098d5;}else{return db['CloudProvider'][_0x6570('0x2b')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x6570('0x11')](function(_0x1936f5){if(!_0x1936f5){throw new db['Sequelize']['ValidationError'](_0x6570('0x2c'));}if(!_0x1936f5[_0x6570('0xe')]||!_0x1936f5[_0x6570('0xf')]){throw new db[(_0x6570('0x21'))][(_0x6570('0x22'))](_0x6570('0x2d'));}_0x90499d=_0x1936f5;logger['info'](util[_0x6570('0xb')](_0x6570('0x2e'),_0x2d0d0f['id']));return sentiment(_0x90499d[_0x6570('0xe')],_0x90499d[_0x6570('0xf')],_0xc903eb['sentimentRegion'],_0x2d0d0f[_0x6570('0x15')],_0xc903eb[_0x6570('0x26')]);})['then'](function(_0x3597a8){logger[_0x6570('0xa')](util['format'](_0x6570('0x38'),_0x2d0d0f['id']));return _0x2d0d0f['update']({'sentiment':_0x3597a8[_0x6570('0x39')],'sPositive':_0x3597a8[_0x6570('0x30')][_0x6570('0x2f')],'sNegative':_0x3597a8[_0x6570('0x30')][_0x6570('0x31')],'sMixed':_0x3597a8['SentimentScore']['Mixed'],'sNeutral':_0x3597a8[_0x6570('0x30')]['Neutral'],'transcribeStatus':_0x6570('0x16')});})[_0x6570('0x11')](function(){logger['info'](util[_0x6570('0xb')](_0x6570('0x1f'),_0x2d0d0f['id']));_0x4a6fb8();});}})['catch'](function(_0x333ac9){if(_0x333ac9){if(!_0x333ac9[_0x6570('0x3a')]||_0x333ac9[_0x6570('0x3a')]!==_0x6570('0x3b')){logger[_0x6570('0x3c')](util[_0x6570('0xb')](_0x6570('0x3d'),_0x2d0d0f['id']),util['inspect'](_0x333ac9,{'showHidden':![],'depth':null}));}}_0x4a6fb8();});});}function checkTranscribe(){var _0x30ec4e;var _0x26b247;var _0x50cb76;return db['VoiceRecording'][_0x6570('0x3e')]({'where':{'transcribeStatus':_0x6570('0x3f')}})[_0x6570('0x11')](function(_0x5c8c68){if(!_0x5c8c68||!_0x5c8c68['length']){throw new db[(_0x6570('0x21'))]['ValidationError'](_0x6570('0x40'));}_0x30ec4e=_0x5c8c68;return db[_0x6570('0x41')][_0x6570('0x2b')]({'where':{'id':0x1}});})[_0x6570('0x11')](function(_0x444f6d){if(!_0x444f6d){throw new db['Sequelize'][(_0x6570('0x22'))]('Settings\x20not\x20available');}_0x26b247=_0x444f6d;if(!_0x26b247[_0x6570('0x5')]||!_0x26b247[_0x6570('0x42')]||!_0x26b247[_0x6570('0x10')]||!_0x26b247['language']||!_0x26b247[_0x6570('0x27')]){throw new db['Sequelize'][(_0x6570('0x22'))](_0x6570('0x43'));}return db[_0x6570('0x2a')][_0x6570('0x2b')]({'where':{'id':_0x26b247[_0x6570('0x42')]}});})[_0x6570('0x11')](function(_0x3b58db){if(!_0x3b58db){throw new db['Sequelize'][(_0x6570('0x22'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x3b58db[_0x6570('0xe')]||!_0x3b58db[_0x6570('0xf')]){throw new db[(_0x6570('0x21'))][(_0x6570('0x22'))](_0x6570('0x2d'));}_0x50cb76=_0x3b58db;var _0x4c91e8=[];_0x30ec4e[_0x6570('0x44')](function(_0x4c33f0){_0x4c91e8[_0x6570('0x45')](checkTranscribeJob(_0x4c33f0,_0x26b247,_0x50cb76));});return BPromise[_0x6570('0x46')](_0x4c91e8);})[_0x6570('0x47')](function(_0x10e8ce){if(_0x10e8ce){if(!_0x10e8ce[_0x6570('0x3a')]||_0x10e8ce['name']!==_0x6570('0x3b')){logger[_0x6570('0x3c')](util[_0x6570('0x48')](_0x10e8ce,{'showHidden':![],'depth':null}));}}});}exports[_0x6570('0x49')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x22a4=['util','bluebird','../../mysqldb','../../config/logger','transcribe','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]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','fileText','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','sentiment','sentimentAccountId','bucket','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','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Sentiment\x20Analysis\x20not\x20requested','sentimentRegion','language','Transcript\x20not\x20available','Neutral','COMPLETED','catch','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','Transcribe\x20not\x20configured','transcribeAccountId','forEach','push','all','name','lodash','aws-sdk','request-promise'];(function(_0x216a28,_0x4f021e){var _0x4f4901=function(_0x285775){while(--_0x285775){_0x216a28['push'](_0x216a28['shift']());}};_0x4f4901(++_0x4f021e);}(_0x22a4,0x1cb));var _0x422a=function(_0x130ef2,_0x3cc896){_0x130ef2=_0x130ef2-0x0;var _0x1e7442=_0x22a4[_0x130ef2];return _0x1e7442;};var _=require(_0x422a('0x0'));var AWS=require(_0x422a('0x1'));var rp=require(_0x422a('0x2'));var util=require(_0x422a('0x3'));var BPromise=require(_0x422a('0x4'));var db=require(_0x422a('0x5'))['db'];var logger=require(_0x422a('0x6'))(_0x422a('0x7'));function getTranscriptionJob(_0x5457aa,_0x32dc33,_0x10cc65,_0x1d5d59){return new Promise(function(_0x33e51c,_0x28deaa){var _0x5e8fe2=new AWS[(_0x422a('0x8'))]({'accessKeyId':_0x32dc33,'secretAccessKey':_0x5457aa,'region':_0x10cc65});_0x5e8fe2[_0x422a('0x9')]({'TranscriptionJobName':_0x1d5d59},function(_0x23b1b0,_0x392224){if(_0x23b1b0){return _0x28deaa(_0x23b1b0);}else{return _0x33e51c(_0x392224);}});});}function sentiment(_0x3f785b,_0x3ad391,_0x317466,_0x29caa4,_0x4b76b7){return new Promise(function(_0x4fef05,_0x336959){var _0x2eed9c=new AWS[(_0x422a('0xa'))]({'accessKeyId':_0x3ad391,'secretAccessKey':_0x3f785b,'region':_0x317466});_0x2eed9c[_0x422a('0xb')]({'Text':_0x29caa4,'LanguageCode':_0x4b76b7[_0x422a('0xc')](0x0,0x2)},function(_0x1aa133,_0x48c0a2){if(_0x1aa133){return _0x336959(_0x1aa133);}else{return _0x4fef05(_0x48c0a2);}});});}function checkTranscribeJob(_0x489953,_0xebe70d,_0x4dbed1){var _0x5a0c59;return new BPromise(function(_0x5a1200,_0x30f24c){logger[_0x422a('0xd')](util[_0x422a('0xe')](_0x422a('0xf'),_0x489953['id'],_0x489953[_0x422a('0x10')]));return getTranscriptionJob(_0x4dbed1[_0x422a('0x11')],_0x4dbed1[_0x422a('0x12')],_0xebe70d[_0x422a('0x13')],_0x489953[_0x422a('0x10')])[_0x422a('0x14')](function(_0x30b6e9){logger[_0x422a('0xd')](util[_0x422a('0xe')](_0x422a('0x15'),_0x489953['id'],_0x489953[_0x422a('0x10')],_0x30b6e9[_0x422a('0x16')][_0x422a('0x17')]));if(!_0x489953['fileText']){switch(_0x30b6e9[_0x422a('0x16')][_0x422a('0x17')]){case'COMPLETED':var _0x26bce9={'transcribeStatus':_0x30b6e9['TranscriptionJob']['TranscriptionJobStatus'],'fileUri':_0x30b6e9[_0x422a('0x16')][_0x422a('0x18')][_0x422a('0x19')]};logger[_0x422a('0xd')](util[_0x422a('0xe')](_0x422a('0x1a'),_0x489953['id']));return rp({'uri':_0x30b6e9[_0x422a('0x16')][_0x422a('0x18')]['TranscriptFileUri'],'json':!![]})[_0x422a('0x14')](function(_0x3284ed){logger[_0x422a('0xd')](util[_0x422a('0xe')](_0x422a('0x1b'),_0x489953['id']));if(_0x3284ed&&_0x3284ed['results']&&_0x3284ed[_0x422a('0x1c')][_0x422a('0x1d')]&&_0x3284ed[_0x422a('0x1c')]['transcripts'][_0x422a('0x1e')]){_0x26bce9[_0x422a('0x1f')]='';for(var _0x1fd126=0x0;_0x1fd126<_0x3284ed[_0x422a('0x1c')][_0x422a('0x1d')][_0x422a('0x1e')];_0x1fd126++){_0x26bce9[_0x422a('0x1f')]+=_0x3284ed[_0x422a('0x1c')]['transcripts'][_0x1fd126][_0x422a('0x20')]+'';}}return _0x489953[_0x422a('0x21')](_0x26bce9);})['then'](function(){logger[_0x422a('0xd')](util['format'](_0x422a('0x22'),_0x489953['id']));if(!_0x489953[_0x422a('0x23')]){throw new db[(_0x422a('0x24'))][(_0x422a('0x25'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0xebe70d[_0x422a('0x26')]||!_0xebe70d[_0x422a('0x27')]||!_0xebe70d['sentimentRegion']||!_0xebe70d['language']||!_0xebe70d[_0x422a('0x28')]){throw new db[(_0x422a('0x24'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x26bce9['fileText']){throw new Error('Transcript\x20not\x20available');}if(_0xebe70d['sentimentAccountId']===_0x4dbed1['id']){return _0x4dbed1;}else{return db[_0x422a('0x29')][_0x422a('0x2a')]({'where':{'id':_settings[_0x422a('0x27')]}});}})[_0x422a('0x14')](function(_0x30a1e3){if(!_0x30a1e3){throw new db['Sequelize'][(_0x422a('0x25'))](_0x422a('0x2b'));}if(!_0x30a1e3[_0x422a('0x11')]||!_0x30a1e3[_0x422a('0x12')]){throw new db[(_0x422a('0x24'))][(_0x422a('0x25'))](_0x422a('0x2c'));}_0x5a0c59=_0x30a1e3;logger['info'](util[_0x422a('0xe')](_0x422a('0x2d'),_0x489953['id']));return sentiment(_0x5a0c59[_0x422a('0x11')],_0x5a0c59[_0x422a('0x12')],_0xebe70d['sentimentRegion'],_0x26bce9[_0x422a('0x1f')],_0xebe70d['language']);})[_0x422a('0x14')](function(_0x100e45){logger['info'](util[_0x422a('0xe')](_0x422a('0x2e'),_0x489953['id']));return _0x489953['update']({'sentiment':_0x100e45[_0x422a('0x2f')],'sPositive':_0x100e45[_0x422a('0x30')][_0x422a('0x31')],'sNegative':_0x100e45[_0x422a('0x30')][_0x422a('0x32')],'sMixed':_0x100e45[_0x422a('0x30')][_0x422a('0x33')],'sNeutral':_0x100e45[_0x422a('0x30')]['Neutral']});})['then'](function(){logger[_0x422a('0xd')](util[_0x422a('0xe')](_0x422a('0x22'),_0x489953['id']));_0x5a1200();});case'FAILED':return _0x489953[_0x422a('0x21')]({'transcribeStatus':_0x422a('0x34'),'failureReason':_0x30b6e9['TranscriptionJob']['FailureReason']})[_0x422a('0x14')](function(){logger['info'](util[_0x422a('0xe')](_0x422a('0x22'),_0x489953['id']));_0x5a1200();});default:logger[_0x422a('0xd')](util['format'](_0x422a('0x35'),_0x489953['id']));break;}}else{return BPromise[_0x422a('0x36')]()[_0x422a('0x14')](function(){if(!_0x489953['tempSentiment']){throw new db['Sequelize'][(_0x422a('0x25'))](_0x422a('0x37'));}if(!_0xebe70d[_0x422a('0x26')]||!_0xebe70d['sentimentAccountId']||!_0xebe70d[_0x422a('0x38')]||!_0xebe70d[_0x422a('0x39')]||!_0xebe70d[_0x422a('0x28')]){throw new db[(_0x422a('0x24'))][(_0x422a('0x25'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x489953[_0x422a('0x1f')]){throw new Error(_0x422a('0x3a'));}if(_0xebe70d[_0x422a('0x27')]===_0x4dbed1['id']){return _0x4dbed1;}else{return db[_0x422a('0x29')][_0x422a('0x2a')]({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x2b700d){if(!_0x2b700d){throw new db['Sequelize'][(_0x422a('0x25'))](_0x422a('0x2b'));}if(!_0x2b700d[_0x422a('0x11')]||!_0x2b700d[_0x422a('0x12')]){throw new db[(_0x422a('0x24'))][(_0x422a('0x25'))](_0x422a('0x2c'));}_0x5a0c59=_0x2b700d;logger['info'](util[_0x422a('0xe')](_0x422a('0x2d'),_0x489953['id']));return sentiment(_0x5a0c59[_0x422a('0x11')],_0x5a0c59[_0x422a('0x12')],_0xebe70d[_0x422a('0x38')],_0x489953[_0x422a('0x1f')],_0xebe70d[_0x422a('0x39')]);})['then'](function(_0x4127a5){logger[_0x422a('0xd')](util['format'](_0x422a('0x2e'),_0x489953['id']));return _0x489953[_0x422a('0x21')]({'sentiment':_0x4127a5[_0x422a('0x2f')],'sPositive':_0x4127a5[_0x422a('0x30')][_0x422a('0x31')],'sNegative':_0x4127a5[_0x422a('0x30')][_0x422a('0x32')],'sMixed':_0x4127a5['SentimentScore'][_0x422a('0x33')],'sNeutral':_0x4127a5[_0x422a('0x30')][_0x422a('0x3b')],'transcribeStatus':_0x422a('0x3c')});})[_0x422a('0x14')](function(){logger[_0x422a('0xd')](util[_0x422a('0xe')](_0x422a('0x22'),_0x489953['id']));_0x5a1200();});}})[_0x422a('0x3d')](function(_0x1a187b){if(_0x1a187b){if(!_0x1a187b['name']||_0x1a187b['name']!==_0x422a('0x3e')){logger[_0x422a('0x3f')](util['format'](_0x422a('0x40'),_0x489953['id']),util[_0x422a('0x41')](_0x1a187b,{'showHidden':![],'depth':null}));}}_0x5a1200();});});}function checkTranscribe(){var _0x41dd0a;var _0xf4ddc5;var _0x706497;return db[_0x422a('0x42')][_0x422a('0x43')]({'where':{'transcribeStatus':_0x422a('0x44')}})[_0x422a('0x14')](function(_0x3846bd){if(!_0x3846bd||!_0x3846bd['length']){throw new db['Sequelize'][(_0x422a('0x25'))](_0x422a('0x45'));}_0x41dd0a=_0x3846bd;return db['Setting'][_0x422a('0x2a')]({'where':{'id':0x1}});})[_0x422a('0x14')](function(_0x20b4d3){if(!_0x20b4d3){throw new db[(_0x422a('0x24'))][(_0x422a('0x25'))](_0x422a('0x46'));}_0xf4ddc5=_0x20b4d3;if(!_0xf4ddc5[_0x422a('0x7')]||!_0xf4ddc5['transcribeAccountId']||!_0xf4ddc5[_0x422a('0x13')]||!_0xf4ddc5[_0x422a('0x39')]||!_0xf4ddc5[_0x422a('0x28')]){throw new db[(_0x422a('0x24'))][(_0x422a('0x25'))](_0x422a('0x47'));}return db['CloudProvider']['findOne']({'where':{'id':_0xf4ddc5[_0x422a('0x48')]}});})[_0x422a('0x14')](function(_0x1ff3ad){if(!_0x1ff3ad){throw new db[(_0x422a('0x24'))][(_0x422a('0x25'))](_0x422a('0x2b'));}if(!_0x1ff3ad[_0x422a('0x11')]||!_0x1ff3ad[_0x422a('0x12')]){throw new db[(_0x422a('0x24'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x706497=_0x1ff3ad;var _0x58780a=[];_0x41dd0a[_0x422a('0x49')](function(_0x23372f){_0x58780a[_0x422a('0x4a')](checkTranscribeJob(_0x23372f,_0xf4ddc5,_0x706497));});return BPromise[_0x422a('0x4b')](_0x58780a);})['catch'](function(_0x3c04e6){if(_0x3c04e6){if(!_0x3c04e6[_0x422a('0x4c')]||_0x3c04e6[_0x422a('0x4c')]!==_0x422a('0x3e')){logger[_0x422a('0x3f')](util[_0x422a('0x41')](_0x3c04e6,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index a41f471..0e064df 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 _0xa3d1=['localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','length','map','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','timeout','format','YYYY-MM-DD\x20HH:mm:ss','then','info','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','moment','ioredis','../../mysqldb','../logger','schedule','redis','defaults'];(function(_0x565189,_0x4a9767){var _0x345145=function(_0x5bc42a){while(--_0x5bc42a){_0x565189['push'](_0x565189['shift']());}};_0x345145(++_0x4a9767);}(_0xa3d1,0xcb));var _0x1a3d=function(_0x346379,_0xd5f749){_0x346379=_0x346379-0x0;var _0x9c1bb6=_0xa3d1[_0x346379];return _0x9c1bb6;};'use strict';var _=require('lodash');var moment=require(_0x1a3d('0x0'));var Redis=require(_0x1a3d('0x1'));var util=require('util');var config=require('../../config/environment');var db=require(_0x1a3d('0x2'))['db'];var logger=require(_0x1a3d('0x3'))(_0x1a3d('0x4'));config[_0x1a3d('0x5')]=_[_0x1a3d('0x6')](config[_0x1a3d('0x5')],{'host':_0x1a3d('0x7'),'port':0x18eb});var io=require(_0x1a3d('0x8'))(new Redis(config[_0x1a3d('0x5')]));function closeInteractions(){var _0x54782a=[];return db[_0x1a3d('0x9')][_0x1a3d('0xa')]({'raw':!![],'attributes':['id',_0x1a3d('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x1a3d('0xc')](0x18,_0x1a3d('0xd'))}}})['then'](function(_0x1548cf){if(_0x1548cf&&_0x1548cf[_0x1a3d('0xe')]){_0x54782a=_[_0x1a3d('0xf')](_0x1548cf||[],'id');logger['info'](_0x1a3d('0x10'),_0x54782a[_0x1a3d('0x11')]());return db['WhatsappInteraction'][_0x1a3d('0x12')]({'closeReason':'system','disposition':_0x1a3d('0x13'),'closed':!![],'closedAt':moment()[_0x1a3d('0x14')](_0x1a3d('0x15'))},{'where':{'id':_0x54782a}});}})[_0x1a3d('0x16')](function(){if(_0x54782a&&_0x54782a[_0x1a3d('0xe')]){logger[_0x1a3d('0x17')](_0x1a3d('0x18'),_0x54782a[_0x1a3d('0x11')]());for(var _0x54a2c4=0x0;_0x54a2c4<_0x54782a[_0x1a3d('0xe')];_0x54a2c4++){io[_0x1a3d('0x19')](_0x1a3d('0x1a'),{'id':_0x54782a[_0x54a2c4],'closed':!![]});}}})[_0x1a3d('0x1b')](function(_0x4e826a){logger['error'](_0x1a3d('0x1c'),_0x4e826a?util[_0x1a3d('0x1d')](_0x4e826a,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xa10f=['catch','error','inspect','start','lodash','moment','ioredis','../logger','schedule','redis','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','length','info','[WHATSAPP]\x20Interactions\x20to\x20close:','update','system','format','then','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update'];(function(_0x325532,_0x2ec103){var _0x172655=function(_0x5d7fb4){while(--_0x5d7fb4){_0x325532['push'](_0x325532['shift']());}};_0x172655(++_0x2ec103);}(_0xa10f,0x6c));var _0xfa10=function(_0x1688c6,_0x5e50d1){_0x1688c6=_0x1688c6-0x0;var _0x594d2b=_0xa10f[_0x1688c6];return _0x594d2b;};'use strict';var _=require(_0xfa10('0x0'));var moment=require(_0xfa10('0x1'));var Redis=require(_0xfa10('0x2'));var util=require('util');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require(_0xfa10('0x3'))(_0xfa10('0x4'));config[_0xfa10('0x5')]=_['defaults'](config[_0xfa10('0x5')],{'host':_0xfa10('0x6'),'port':0x18eb});var io=require(_0xfa10('0x7'))(new Redis(config['redis']));function closeInteractions(){var _0x472944=[];return db[_0xfa10('0x8')][_0xfa10('0x9')]({'raw':!![],'attributes':['id',_0xfa10('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xfa10('0xb')](0x18,'hours')}}})['then'](function(_0x13231c){if(_0x13231c&&_0x13231c[_0xfa10('0xc')]){_0x472944=_['map'](_0x13231c||[],'id');logger[_0xfa10('0xd')](_0xfa10('0xe'),_0x472944['join']());return db[_0xfa10('0x8')][_0xfa10('0xf')]({'closeReason':_0xfa10('0x10'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0xfa10('0x11')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x472944}});}})[_0xfa10('0x12')](function(){if(_0x472944&&_0x472944[_0xfa10('0xc')]){logger[_0xfa10('0xd')](_0xfa10('0x13'),_0x472944['join']());for(var _0x228440=0x0;_0x228440<_0x472944[_0xfa10('0xc')];_0x228440++){io[_0xfa10('0x14')](_0xfa10('0x15'),{'id':_0x472944[_0x228440],'closed':!![]});}}})[_0xfa10('0x16')](function(_0xc377be){logger[_0xfa10('0x17')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0xc377be?util[_0xfa10('0x18')](_0xc377be,{'showHidden':![],'depth':null}):'');});}exports[_0xfa10('0x19')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index a04cf2a..c408e38 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e6=['finished\x20populating','contacts1','CmHopper','hopper1','hopper2','catch','util','../mysqldb','Innocenzo','Biondo','now','push','innocenzo.biondo','@xcally.com','CmContact','destroy','then','bulkCreate','log'];(function(_0x1728c7,_0x48b9e6){var _0x38996d=function(_0x3bcc4e){while(--_0x3bcc4e){_0x1728c7['push'](_0x1728c7['shift']());}};_0x38996d(++_0x48b9e6);}(_0xa9e6,0x16f));var _0x6a9e=function(_0x122cc9,_0x57c44a){_0x122cc9=_0x122cc9-0x0;var _0x489043=_0xa9e6[_0x122cc9];return _0x489043;};'use strict';var util=require(_0x6a9e('0x0'));var db=require(_0x6a9e('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0x6a9e('0x2')+i,'lastName':_0x6a9e('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x6a9e('0x4')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x6a9e('0x5')]({'id':i,'firstName':_0x6a9e('0x2')+i,'lastName':_0x6a9e('0x3')+i,'phone':0xf879fb460+i,'email':_0x6a9e('0x6')+i+_0x6a9e('0x7')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x6a9e('0x5')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date['now']()});}db[_0x6a9e('0x8')][_0x6a9e('0x9')]({'where':{}})[_0x6a9e('0xa')](function(){return db[_0x6a9e('0x8')][_0x6a9e('0xb')](contacts);})[_0x6a9e('0xa')](function(){console[_0x6a9e('0xc')](_0x6a9e('0xd'),_0x6a9e('0xe'));return db[_0x6a9e('0xf')][_0x6a9e('0x9')]({'where':{}});})[_0x6a9e('0xa')](function(){return db[_0x6a9e('0xf')][_0x6a9e('0xb')](hopper);})['then'](function(){console[_0x6a9e('0xc')](_0x6a9e('0xd'),_0x6a9e('0x10'));return db['CmContact'][_0x6a9e('0xb')](contacts2);})[_0x6a9e('0xa')](function(){console[_0x6a9e('0xc')](_0x6a9e('0xd'),'contacts2');return db[_0x6a9e('0xf')][_0x6a9e('0xb')](hopper2);})[_0x6a9e('0xa')](function(){console[_0x6a9e('0xc')](_0x6a9e('0xd'),_0x6a9e('0x11'));})[_0x6a9e('0x12')](function(_0x37bf4d){console[_0x6a9e('0xc')](_0x37bf4d);}); \ No newline at end of file +var _0x875c=['contacts1','CmHopper','bulkCreate','hopper1','contacts2','hopper2','catch','util','Innocenzo','innocenzo.biondo','@xcally.com','push','now','Biondo','CmContact','destroy','then','log','finished\x20populating'];(function(_0x1d47ab,_0x22343e){var _0x5ab5cc=function(_0x12b13f){while(--_0x12b13f){_0x1d47ab['push'](_0x1d47ab['shift']());}};_0x5ab5cc(++_0x22343e);}(_0x875c,0xd8));var _0xc875=function(_0x35eae1,_0x10be75){_0x35eae1=_0x35eae1-0x0;var _0x225e5c=_0x875c[_0x35eae1];return _0x225e5c;};'use strict';var util=require(_0xc875('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0xc875('0x1')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xc875('0x2')+i+_0xc875('0x3')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xc875('0x4')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xc875('0x5')](),'updatedAt':Date[_0xc875('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xc875('0x6')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0xc875('0x3')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xc875('0x4')]({'id':i,'active':![],'scheduledat':Date[_0xc875('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xc875('0x5')](),'updatedAt':Date[_0xc875('0x5')]()});}db[_0xc875('0x7')][_0xc875('0x8')]({'where':{}})[_0xc875('0x9')](function(){return db['CmContact']['bulkCreate'](contacts);})[_0xc875('0x9')](function(){console[_0xc875('0xa')](_0xc875('0xb'),_0xc875('0xc'));return db[_0xc875('0xd')][_0xc875('0x8')]({'where':{}});})[_0xc875('0x9')](function(){return db[_0xc875('0xd')][_0xc875('0xe')](hopper);})[_0xc875('0x9')](function(){console[_0xc875('0xa')](_0xc875('0xb'),_0xc875('0xf'));return db['CmContact']['bulkCreate'](contacts2);})['then'](function(){console['log']('finished\x20populating',_0xc875('0x10'));return db[_0xc875('0xd')][_0xc875('0xe')](hopper2);})[_0xc875('0x9')](function(){console[_0xc875('0xa')](_0xc875('0xb'),_0xc875('0x11'));})[_0xc875('0x12')](function(_0x164fa4){console[_0xc875('0xa')](_0x164fa4);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 06d4f37..8d8f612 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1791=['agent','format','password','udp','wss','all','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','User','bulkCreate','catch','log','../mysqldb','push','%s%s'];(function(_0x4e505d,_0x25b48f){var _0x102d4f=function(_0x2dc2e0){while(--_0x2dc2e0){_0x4e505d['push'](_0x4e505d['shift']());}};_0x102d4f(++_0x25b48f);}(_0x1791,0xad));var _0x1179=function(_0x57aad4,_0x108f28){_0x57aad4=_0x57aad4-0x0;var _0x26b886=_0x1791[_0x57aad4];return _0x26b886;};'use strict';var util=require('util');var db=require(_0x1179('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x1179('0x1')]({'name':util['format'](_0x1179('0x2'),_0x1179('0x3'),i),'fullname':util[_0x1179('0x4')](_0x1179('0x2'),_0x1179('0x3'),i),'email':util['format']('%s%s@xcally.com',_0x1179('0x3'),i),'role':'agent','password':_0x1179('0x5'),'internal':0xfa0+i,'type':'friend','transport':[_0x1179('0x6'),'ws',_0x1179('0x7')],'disallow':[_0x1179('0x8')],'allow':['ulaw'],'defaultuser':util['format'](_0x1179('0x2'),'agent',i),'encryption':'yes','avpf':_0x1179('0x9'),'force_avp':_0x1179('0x9'),'icesupport':_0x1179('0x9'),'dtlsenable':_0x1179('0x9'),'dtlsverify':'no','dtlscertfile':_0x1179('0xa'),'dtlsprivatekey':_0x1179('0xb'),'dtlssetup':'actpass','callerid':util['format']('\x22%s\x22\x20<%s>',util[_0x1179('0x4')]('%s%s',_0x1179('0x3'),i),0xfa0+i)});}db[_0x1179('0xc')][_0x1179('0xd')](users)['then'](function(){console['log']('add\x20user');})[_0x1179('0xe')](function(_0x580e52){console[_0x1179('0xf')](_0x580e52);}); \ No newline at end of file +var _0x377f=['util','push','format','%s%s','agent','%s%s@xcally.com','password','udp','wss','all','yes','/etc/pki/tls/certs/motion.crt','actpass','\x22%s\x22\x20<%s>','User','then','log','add\x20user','catch'];(function(_0xa63ea3,_0x4367ff){var _0x2aa5ff=function(_0x30dc84){while(--_0x30dc84){_0xa63ea3['push'](_0xa63ea3['shift']());}};_0x2aa5ff(++_0x4367ff);}(_0x377f,0x143));var _0xf377=function(_0x535246,_0xb9ab72){_0x535246=_0x535246-0x0;var _0x43d339=_0x377f[_0x535246];return _0x43d339;};'use strict';var util=require(_0xf377('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xf377('0x1')]({'name':util[_0xf377('0x2')](_0xf377('0x3'),'agent',i),'fullname':util['format'](_0xf377('0x3'),_0xf377('0x4'),i),'email':util[_0xf377('0x2')](_0xf377('0x5'),'agent',i),'role':_0xf377('0x4'),'password':_0xf377('0x6'),'internal':0xfa0+i,'type':'friend','transport':[_0xf377('0x7'),'ws',_0xf377('0x8')],'disallow':[_0xf377('0x9')],'allow':['ulaw'],'defaultuser':util['format']('%s%s',_0xf377('0x4'),i),'encryption':_0xf377('0xa'),'avpf':_0xf377('0xa'),'force_avp':'yes','icesupport':_0xf377('0xa'),'dtlsenable':_0xf377('0xa'),'dtlsverify':'no','dtlscertfile':_0xf377('0xb'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0xf377('0xc'),'callerid':util['format'](_0xf377('0xd'),util[_0xf377('0x2')](_0xf377('0x3'),_0xf377('0x4'),i),0xfa0+i)});}db[_0xf377('0xe')]['bulkCreate'](users)[_0xf377('0xf')](function(){console[_0xf377('0x10')](_0xf377('0x11'));})[_0xf377('0x12')](function(_0x53f253){console[_0xf377('0x10')](_0x53f253);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 2b702d6..b4b6bb0 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x14c5=['role','agent','telephone','type','ivr','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','Trunks','UserProfileResource','resourceId','map','where','Campaign','format','%s:queue:%s','user:%s','handshake','userProfileId','query','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteractions','admin','hasOwnProperty','include','push','VoiceQueue','ChatQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','voice:inbound','FaxQueue','WhatsappQueues','IvrCampaigns','voice:outbound','getVoiceQueues','getChatQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','length','chat','openchannel','whatsapp','telephone:%s','campaign:%s:%s','leave','emit','removeMailInteractions','FaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','removeWhatsappInteractions','catch','log','join','setMaxListeners','address','request','connection','remoteAddress','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','./environment','name','Agents','User'];(function(_0x1fe8be,_0x5e7860){var _0x1449bb=function(_0x17b23e){while(--_0x17b23e){_0x1fe8be['push'](_0x1fe8be['shift']());}};_0x1449bb(++_0x5e7860);}(_0x14c5,0x1de));var _0x514c=function(_0x69ad20,_0x49e707){_0x69ad20=_0x69ad20-0x0;var _0x500b1b=_0x14c5[_0x69ad20];return _0x500b1b;};'use strict';var _=require(_0x514c('0x0'));var util=require(_0x514c('0x1'));var BPromise=require(_0x514c('0x2'));var db=require('../mysqldb')['db'];var config=require(_0x514c('0x3'));var queryQueues={'attributes':['id',_0x514c('0x4')],'include':[{'as':_0x514c('0x5'),'model':db[_0x514c('0x6')],'attributes':['id',_0x514c('0x4'),_0x514c('0x7')],'raw':!![],'where':{'role':_0x514c('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x514c('0x4')],'where':{'role':_0x514c('0x9')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0x514c('0x4')],'where':{'role':_0x514c('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x514c('0x4'),_0x514c('0xa')],'where':{'type':_0x514c('0xb')}};function getAssociatedResources(_0xfe0593,_0x3a5b1d,_0x11895f){return db['UserProfileSection'][_0x514c('0xc')]({'where':{'name':_0xfe0593,'userProfileId':_0x3a5b1d},'raw':!![]})[_0x514c('0xd')](function(_0x1a84e5){if(_0x1a84e5){if(_0x1a84e5[_0x514c('0xe')]){switch(_0xfe0593){case _0x514c('0xf'):case _0x514c('0x10'):case _0x514c('0x11'):case _0x514c('0x12'):case _0x514c('0x13'):case _0x514c('0x14'):case'WhatsappQueues':return db[_0x11895f][_0x514c('0x15')](queryQueues);case'Telephones':return db[_0x11895f][_0x514c('0x15')](queryTelephones);case _0x514c('0x16'):return db[_0x11895f][_0x514c('0x15')](queryTrunks);case'IvrCampaigns':return db[_0x11895f][_0x514c('0x15')](queryCampaigns);}}else{return db[_0x514c('0x17')][_0x514c('0x15')]({'attributes':[_0x514c('0x18')],'where':{'sectionId':_0x1a84e5['id']},'raw':!![]})['then'](function(_0x306b5b){if(_0x306b5b){var _0x28d9ff={'where':{'id':_[_0x514c('0x19')](_0x306b5b,_0x514c('0x18'))},'raw':!![]};switch(_0x11895f){case _0x514c('0x6'):_0x28d9ff[_0x514c('0x1a')][_0x514c('0x7')]='telephone';break;case _0x514c('0x1b'):_0x28d9ff[_0x514c('0x1a')][_0x514c('0xa')]='ivr';break;}return db[_0x11895f][_0x514c('0x15')](_0x28d9ff);}else{return[];}});}}else{return[];}})[_0x514c('0xd')](function(_0x560703){return _0x560703;});}function joinOrLeaveQueues(_0x52ba4f,_0x281622,_0x461d55,_0x2848d8){_0x52ba4f[_0x281622](util[_0x514c('0x1c')](_0x514c('0x1d'),_0x461d55,_0x2848d8[_0x514c('0x4')]));if(_0x2848d8[_0x514c('0x5')]){for(var _0x554cd0=0x0;_0x554cd0<_0x2848d8[_0x514c('0x5')]['length'];_0x554cd0+=0x1){_0x52ba4f[_0x281622](util['format'](_0x514c('0x1e'),_0x2848d8['Agents'][_0x554cd0][_0x514c('0x4')]));}}}function joinOrLeave(_0x1a7a55,_0x2f3863,_0x1be1fe){var _0x39f5d4;if(_0x1a7a55[_0x514c('0x1f')]['query']['id']){db[_0x514c('0x6')]['find']({'attributes':['id',_0x514c('0x4'),_0x514c('0x7'),_0x514c('0x20')],'where':{'id':_0x1a7a55[_0x514c('0x1f')][_0x514c('0x21')]['id']},'include':[{'model':db[_0x514c('0x22')],'as':_0x514c('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x514c('0x24')],'as':_0x514c('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x514c('0x26')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x514c('0x27')],'as':_0x514c('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x514c('0x29')],'as':_0x514c('0x2a'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0x514c('0x2b'),'attributes':['id'],'raw':!![]}]})[_0x514c('0xd')](function(_0x2e2bec){if(_0x2e2bec){_0x39f5d4=_0x2e2bec;_0x1a7a55[_0x2f3863](util[_0x514c('0x1c')](_0x514c('0x1e'),_0x2e2bec['name']));var _0x22994a=[];switch(_0x2e2bec[_0x514c('0x7')]){case _0x514c('0x2c'):_0x1a7a55[_0x2f3863]('voice:inbound');_0x1a7a55[_0x2f3863]('voice:outbound');if(queryQueues[_0x514c('0x2d')](_0x514c('0x2e'))){delete queryQueues[_0x514c('0x2e')];}_0x22994a[_0x514c('0x2f')](db[_0x514c('0x30')]['findAll'](queryQueues));_0x22994a[_0x514c('0x2f')](db[_0x514c('0x31')]['findAll'](queryQueues));_0x22994a['push'](db['FaxQueue'][_0x514c('0x15')](queryQueues));_0x22994a[_0x514c('0x2f')](db[_0x514c('0x32')][_0x514c('0x15')](queryQueues));_0x22994a[_0x514c('0x2f')](db[_0x514c('0x33')]['findAll'](queryQueues));_0x22994a[_0x514c('0x2f')](db[_0x514c('0x34')][_0x514c('0x15')](queryQueues));_0x22994a[_0x514c('0x2f')](db[_0x514c('0x35')][_0x514c('0x15')](queryQueues));_0x22994a['push'](db[_0x514c('0x6')][_0x514c('0x15')](queryTelephones));_0x22994a['push'](db[_0x514c('0x36')]['findAll'](queryTrunks));_0x22994a[_0x514c('0x2f')](db[_0x514c('0x1b')][_0x514c('0x15')](queryCampaigns));_0x22994a[_0x514c('0x2f')](db[_0x514c('0x6')][_0x514c('0x15')](queryAgents));break;case _0x514c('0x37'):_0x1a7a55[_0x2f3863](_0x514c('0x38'));_0x1a7a55[_0x2f3863]('voice:outbound');_0x22994a['push'](getAssociatedResources(_0x514c('0xf'),_0x2e2bec[_0x514c('0x20')],_0x514c('0x30')));_0x22994a['push'](getAssociatedResources('ChatQueues',_0x2e2bec[_0x514c('0x20')],_0x514c('0x31')));_0x22994a['push'](getAssociatedResources(_0x514c('0x11'),_0x2e2bec[_0x514c('0x20')],_0x514c('0x39')));_0x22994a[_0x514c('0x2f')](getAssociatedResources(_0x514c('0x12'),_0x2e2bec['userProfileId'],'SmsQueue'));_0x22994a['push'](getAssociatedResources(_0x514c('0x13'),_0x2e2bec[_0x514c('0x20')],_0x514c('0x33')));_0x22994a[_0x514c('0x2f')](getAssociatedResources(_0x514c('0x14'),_0x2e2bec[_0x514c('0x20')],'OpenchannelQueue'));_0x22994a[_0x514c('0x2f')](getAssociatedResources(_0x514c('0x3a'),_0x2e2bec['userProfileId'],'WhatsappQueue'));_0x22994a[_0x514c('0x2f')](getAssociatedResources('Telephones',_0x2e2bec[_0x514c('0x20')],_0x514c('0x6')));_0x22994a[_0x514c('0x2f')](getAssociatedResources(_0x514c('0x16'),_0x2e2bec['userProfileId'],_0x514c('0x36')));_0x22994a[_0x514c('0x2f')](getAssociatedResources(_0x514c('0x3b'),_0x2e2bec[_0x514c('0x20')],_0x514c('0x1b')));_0x22994a[_0x514c('0x2f')](db['User'][_0x514c('0x15')](queryAgents));break;case _0x514c('0x8'):_0x1a7a55[_0x2f3863](_0x514c('0x38'));_0x1a7a55[_0x2f3863](_0x514c('0x3c'));_0x22994a[_0x514c('0x2f')](_0x2e2bec[_0x514c('0x3d')]({'attributes':['id','name']}));_0x22994a[_0x514c('0x2f')](_0x2e2bec[_0x514c('0x3e')]({'attributes':['id','name']}));_0x22994a[_0x514c('0x2f')](_0x2e2bec['getFaxQueues']({'attributes':['id','name']}));_0x22994a['push'](_0x2e2bec[_0x514c('0x3f')]({'attributes':['id','name']}));_0x22994a['push'](_0x2e2bec[_0x514c('0x40')]({'attributes':['id',_0x514c('0x4')]}));_0x22994a[_0x514c('0x2f')](_0x2e2bec[_0x514c('0x41')]({'attributes':['id',_0x514c('0x4')]}));_0x22994a[_0x514c('0x2f')](_0x2e2bec[_0x514c('0x42')]({'attributes':['id','name']}));break;}return BPromise[_0x514c('0x43')](_0x22994a);}})[_0x514c('0xd')](function(_0x3971a3){if(_0x3971a3&&_0x3971a3[_0x514c('0x44')]){for(var _0x5c688c=0x0;_0x5c688c<_0x3971a3[_0x514c('0x44')];_0x5c688c+=0x1){for(var _0x39fe9b=0x0;_0x39fe9b<_0x3971a3[_0x5c688c][_0x514c('0x44')];_0x39fe9b+=0x1){switch(_0x5c688c){case 0x0:joinOrLeaveQueues(_0x1a7a55,_0x2f3863,'voice',_0x3971a3[_0x5c688c][_0x39fe9b]);break;case 0x1:joinOrLeaveQueues(_0x1a7a55,_0x2f3863,_0x514c('0x45'),_0x3971a3[_0x5c688c][_0x39fe9b]);break;case 0x2:joinOrLeaveQueues(_0x1a7a55,_0x2f3863,'fax',_0x3971a3[_0x5c688c][_0x39fe9b]);break;case 0x3:joinOrLeaveQueues(_0x1a7a55,_0x2f3863,'sms',_0x3971a3[_0x5c688c][_0x39fe9b]);break;case 0x4:joinOrLeaveQueues(_0x1a7a55,_0x2f3863,'mail',_0x3971a3[_0x5c688c][_0x39fe9b]);break;case 0x5:joinOrLeaveQueues(_0x1a7a55,_0x2f3863,_0x514c('0x46'),_0x3971a3[_0x5c688c][_0x39fe9b]);break;case 0x6:joinOrLeaveQueues(_0x1a7a55,_0x2f3863,_0x514c('0x47'),_0x3971a3[_0x5c688c][_0x39fe9b]);break;case 0x7:if(_0x39f5d4[_0x514c('0x7')]!==_0x514c('0x8'))_0x1a7a55[_0x2f3863](util[_0x514c('0x1c')](_0x514c('0x48'),_0x3971a3[_0x5c688c][_0x39fe9b][_0x514c('0x4')]));break;case 0x8:if(_0x39f5d4[_0x514c('0x7')]!==_0x514c('0x8'))_0x1a7a55[_0x2f3863](util[_0x514c('0x1c')]('trunk:%s',_0x3971a3[_0x5c688c][_0x39fe9b][_0x514c('0x4')]));break;case 0x9:if(_0x39f5d4[_0x514c('0x7')]!=='agent')_0x1a7a55[_0x2f3863](util['format'](_0x514c('0x49'),_0x3971a3[_0x5c688c][_0x39fe9b][_0x514c('0xa')],_0x3971a3[_0x5c688c][_0x39fe9b][_0x514c('0x4')]));break;case 0xa:_0x1a7a55[_0x2f3863](util[_0x514c('0x1c')](_0x514c('0x1e'),_0x3971a3[_0x5c688c][_0x39fe9b][_0x514c('0x4')]));break;}}}}})[_0x514c('0xd')](function(){if(_0x2f3863===_0x514c('0x4a')){var _0x466c80=_[_0x514c('0x19')](_0x39f5d4['ChatInteractions'],'id');return _0x39f5d4['removeChatInteractions'](_0x466c80)['then'](function(){for(var _0x17ee89=0x0;_0x17ee89<_0x466c80[_0x514c('0x44')];_0x17ee89+=0x1){_0x1be1fe[_0x514c('0x4b')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x466c80[_0x17ee89]),'UserId':Number(_0x39f5d4['id'])});}});}})['then'](function(){if(_0x2f3863===_0x514c('0x4a')){var _0x53bc47=_['map'](_0x39f5d4[_0x514c('0x25')],'id');return _0x39f5d4[_0x514c('0x4c')](_0x53bc47)[_0x514c('0xd')](function(){for(var _0xd162b2=0x0;_0xd162b2<_0x53bc47[_0x514c('0x44')];_0xd162b2+=0x1){_0x1be1fe['emit']('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x53bc47[_0xd162b2]),'UserId':Number(_0x39f5d4['id'])});}});}})[_0x514c('0xd')](function(){if(_0x2f3863===_0x514c('0x4a')){var _0x59c3d7=_[_0x514c('0x19')](_0x39f5d4[_0x514c('0x4d')],'id');return _0x39f5d4[_0x514c('0x4e')](_0x59c3d7)[_0x514c('0xd')](function(){for(var _0x379532=0x0;_0x379532<_0x59c3d7[_0x514c('0x44')];_0x379532+=0x1){_0x1be1fe[_0x514c('0x4b')](_0x514c('0x4f'),{'FaxInteractionId':Number(_0x59c3d7[_0x379532]),'UserId':Number(_0x39f5d4['id'])});}});}})[_0x514c('0xd')](function(){if(_0x2f3863===_0x514c('0x4a')){var _0x47eb09=_[_0x514c('0x19')](_0x39f5d4[_0x514c('0x28')],'id');return _0x39f5d4[_0x514c('0x50')](_0x47eb09)[_0x514c('0xd')](function(){for(var _0x1e83b6=0x0;_0x1e83b6<_0x47eb09[_0x514c('0x44')];_0x1e83b6+=0x1){_0x1be1fe['emit'](_0x514c('0x51'),{'SmsInteractionId':Number(_0x47eb09[_0x1e83b6]),'UserId':Number(_0x39f5d4['id'])});}});}})[_0x514c('0xd')](function(){if(_0x2f3863===_0x514c('0x4a')){var _0x1b758e=_[_0x514c('0x19')](_0x39f5d4[_0x514c('0x2a')],'id');return _0x39f5d4[_0x514c('0x52')](_0x1b758e)[_0x514c('0xd')](function(){for(var _0x40b1ff=0x0;_0x40b1ff<_0x1b758e[_0x514c('0x44')];_0x40b1ff+=0x1){_0x1be1fe['emit']('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x1b758e[_0x40b1ff]),'UserId':Number(_0x39f5d4['id'])});}});}})['then'](function(){if(_0x2f3863===_0x514c('0x4a')){var _0x351fe2=_['map'](_0x39f5d4[_0x514c('0x2b')],'id');return _0x39f5d4[_0x514c('0x53')](_0x351fe2)[_0x514c('0xd')](function(){for(var _0x455134=0x0;_0x455134<_0x351fe2[_0x514c('0x44')];_0x455134+=0x1){_0x1be1fe[_0x514c('0x4b')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x351fe2[_0x455134]),'UserId':Number(_0x39f5d4['id'])});}});}})[_0x514c('0x54')](function(_0xe1ec7b){_0x1a7a55[_0x514c('0x55')](_0xe1ec7b);});}}function onDisconnect(_0x882ac7,_0x3a8853){joinOrLeave(_0x882ac7,_0x514c('0x4a'),_0x3a8853);}function onConnect(_0x2b19be){joinOrLeave(_0x2b19be,_0x514c('0x56'));}exports['default']=function(_0x3ff5a9){_0x3ff5a9['on']('connection',function(_0xf5875){_0xf5875[_0x514c('0x57')](0x0);_0xf5875[_0x514c('0x58')]=_0xf5875[_0x514c('0x59')][_0x514c('0x5a')][_0x514c('0x5b')]+':'+_0xf5875[_0x514c('0x59')][_0x514c('0x5a')]['remotePort'];_0xf5875['connectedAt']=new Date();_0xf5875['log']=function(_0x408da4){console[_0x514c('0x55')](_0x514c('0x5c')+_0xf5875[_0x514c('0x5d')][_0x514c('0x4')]+'['+_0xf5875[_0x514c('0x58')]+']',_0x408da4);};_0xf5875['on'](_0x514c('0x5e'),function(){onDisconnect(_0xf5875,_0x3ff5a9);_0xf5875['log'](_0x514c('0x5f'));});onConnect(_0xf5875);_0xf5875[_0x514c('0x55')](_0x514c('0x60'));});}; \ No newline at end of file +var _0x3d3d=['format','%s:queue:%s','length','user:%s','handshake','query','find','userProfileId','ChatInteraction','MailInteraction','MailInteractions','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','Campaign','user','Trunks','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','then','voice','chat','fax','sms','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','ChatInteractions','emit','user_has_chat_interactions:remove','user_has_mail_interactions:remove','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','user_has_whatsapp_interactions:remove','catch','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','connectedAt','log','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','util','bluebird','./environment','name','Agents','User','role','agent','telephone','type','ivr','UserProfileSection','findOne','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','findAll','IvrCampaigns','map','resourceId'];(function(_0x496ca4,_0x7cc3fa){var _0x5e1e22=function(_0x5f03a1){while(--_0x5f03a1){_0x496ca4['push'](_0x496ca4['shift']());}};_0x5e1e22(++_0x7cc3fa);}(_0x3d3d,0xab));var _0xd3d3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3d3d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xd3d3('0x0'));var BPromise=require(_0xd3d3('0x1'));var db=require('../mysqldb')['db'];var config=require(_0xd3d3('0x2'));var queryQueues={'attributes':['id',_0xd3d3('0x3')],'include':[{'as':_0xd3d3('0x4'),'model':db[_0xd3d3('0x5')],'attributes':['id',_0xd3d3('0x3'),_0xd3d3('0x6')],'raw':!![],'where':{'role':_0xd3d3('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xd3d3('0x3')],'where':{'role':_0xd3d3('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0xd3d3('0x3')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0xd3d3('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xd3d3('0x3'),_0xd3d3('0x9')],'where':{'type':_0xd3d3('0xa')}};function getAssociatedResources(_0x578050,_0x368895,_0x412054){return db[_0xd3d3('0xb')][_0xd3d3('0xc')]({'where':{'name':_0x578050,'userProfileId':_0x368895},'raw':!![]})['then'](function(_0x2c523f){if(_0x2c523f){if(_0x2c523f[_0xd3d3('0xd')]){switch(_0x578050){case _0xd3d3('0xe'):case _0xd3d3('0xf'):case _0xd3d3('0x10'):case _0xd3d3('0x11'):case'MailQueues':case _0xd3d3('0x12'):case'WhatsappQueues':return db[_0x412054]['findAll'](queryQueues);case'Telephones':return db[_0x412054][_0xd3d3('0x13')](queryTelephones);case'Trunks':return db[_0x412054]['findAll'](queryTrunks);case _0xd3d3('0x14'):return db[_0x412054][_0xd3d3('0x13')](queryCampaigns);}}else{return db['UserProfileResource'][_0xd3d3('0x13')]({'attributes':['resourceId'],'where':{'sectionId':_0x2c523f['id']},'raw':!![]})['then'](function(_0x364bb3){if(_0x364bb3){var _0x531cb3={'where':{'id':_[_0xd3d3('0x15')](_0x364bb3,_0xd3d3('0x16'))},'raw':!![]};switch(_0x412054){case _0xd3d3('0x5'):_0x531cb3['where'][_0xd3d3('0x6')]=_0xd3d3('0x8');break;case'Campaign':_0x531cb3['where'][_0xd3d3('0x9')]=_0xd3d3('0xa');break;}return db[_0x412054][_0xd3d3('0x13')](_0x531cb3);}else{return[];}});}}else{return[];}})['then'](function(_0x2ff74e){return _0x2ff74e;});}function joinOrLeaveQueues(_0x37fc96,_0x32d518,_0x5273ca,_0x53d62c){_0x37fc96[_0x32d518](util[_0xd3d3('0x17')](_0xd3d3('0x18'),_0x5273ca,_0x53d62c['name']));if(_0x53d62c[_0xd3d3('0x4')]){for(var _0x53ac55=0x0;_0x53ac55<_0x53d62c['Agents'][_0xd3d3('0x19')];_0x53ac55+=0x1){_0x37fc96[_0x32d518](util[_0xd3d3('0x17')](_0xd3d3('0x1a'),_0x53d62c[_0xd3d3('0x4')][_0x53ac55]['name']));}}}function joinOrLeave(_0x258207,_0x65b986,_0x133e41){var _0x358ecc;if(_0x258207[_0xd3d3('0x1b')][_0xd3d3('0x1c')]['id']){db[_0xd3d3('0x5')][_0xd3d3('0x1d')]({'attributes':['id',_0xd3d3('0x3'),_0xd3d3('0x6'),_0xd3d3('0x1e')],'where':{'id':_0x258207[_0xd3d3('0x1b')]['query']['id']},'include':[{'model':db[_0xd3d3('0x1f')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xd3d3('0x20')],'as':_0xd3d3('0x21'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0xd3d3('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0xd3d3('0x23')],'as':_0xd3d3('0x24'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0xd3d3('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0xd3d3('0x26')],'as':_0xd3d3('0x27'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x47688a){if(_0x47688a){_0x358ecc=_0x47688a;_0x258207[_0x65b986](util[_0xd3d3('0x17')](_0xd3d3('0x1a'),_0x47688a[_0xd3d3('0x3')]));var _0xd5ad91=[];switch(_0x47688a[_0xd3d3('0x6')]){case _0xd3d3('0x28'):_0x258207[_0x65b986](_0xd3d3('0x29'));_0x258207[_0x65b986](_0xd3d3('0x2a'));if(queryQueues[_0xd3d3('0x2b')](_0xd3d3('0x2c'))){delete queryQueues[_0xd3d3('0x2c')];}_0xd5ad91[_0xd3d3('0x2d')](db[_0xd3d3('0x2e')]['findAll'](queryQueues));_0xd5ad91['push'](db[_0xd3d3('0x2f')][_0xd3d3('0x13')](queryQueues));_0xd5ad91['push'](db[_0xd3d3('0x30')][_0xd3d3('0x13')](queryQueues));_0xd5ad91[_0xd3d3('0x2d')](db[_0xd3d3('0x31')][_0xd3d3('0x13')](queryQueues));_0xd5ad91['push'](db[_0xd3d3('0x32')]['findAll'](queryQueues));_0xd5ad91['push'](db[_0xd3d3('0x33')]['findAll'](queryQueues));_0xd5ad91[_0xd3d3('0x2d')](db['WhatsappQueue'][_0xd3d3('0x13')](queryQueues));_0xd5ad91[_0xd3d3('0x2d')](db[_0xd3d3('0x5')][_0xd3d3('0x13')](queryTelephones));_0xd5ad91[_0xd3d3('0x2d')](db['Trunk'][_0xd3d3('0x13')](queryTrunks));_0xd5ad91[_0xd3d3('0x2d')](db[_0xd3d3('0x34')][_0xd3d3('0x13')](queryCampaigns));_0xd5ad91[_0xd3d3('0x2d')](db[_0xd3d3('0x5')][_0xd3d3('0x13')](queryAgents));break;case _0xd3d3('0x35'):_0x258207[_0x65b986](_0xd3d3('0x29'));_0x258207[_0x65b986]('voice:outbound');_0xd5ad91[_0xd3d3('0x2d')](getAssociatedResources(_0xd3d3('0xe'),_0x47688a[_0xd3d3('0x1e')],_0xd3d3('0x2e')));_0xd5ad91[_0xd3d3('0x2d')](getAssociatedResources('ChatQueues',_0x47688a['userProfileId'],_0xd3d3('0x2f')));_0xd5ad91[_0xd3d3('0x2d')](getAssociatedResources('FaxQueues',_0x47688a[_0xd3d3('0x1e')],_0xd3d3('0x30')));_0xd5ad91[_0xd3d3('0x2d')](getAssociatedResources(_0xd3d3('0x11'),_0x47688a[_0xd3d3('0x1e')],_0xd3d3('0x31')));_0xd5ad91[_0xd3d3('0x2d')](getAssociatedResources('MailQueues',_0x47688a[_0xd3d3('0x1e')],_0xd3d3('0x32')));_0xd5ad91[_0xd3d3('0x2d')](getAssociatedResources(_0xd3d3('0x12'),_0x47688a[_0xd3d3('0x1e')],'OpenchannelQueue'));_0xd5ad91['push'](getAssociatedResources('WhatsappQueues',_0x47688a['userProfileId'],'WhatsappQueue'));_0xd5ad91['push'](getAssociatedResources('Telephones',_0x47688a['userProfileId'],_0xd3d3('0x5')));_0xd5ad91[_0xd3d3('0x2d')](getAssociatedResources(_0xd3d3('0x36'),_0x47688a[_0xd3d3('0x1e')],'Trunk'));_0xd5ad91['push'](getAssociatedResources('IvrCampaigns',_0x47688a[_0xd3d3('0x1e')],'Campaign'));_0xd5ad91[_0xd3d3('0x2d')](db[_0xd3d3('0x5')][_0xd3d3('0x13')](queryAgents));break;case _0xd3d3('0x7'):_0x258207[_0x65b986](_0xd3d3('0x29'));_0x258207[_0x65b986]('voice:outbound');_0xd5ad91[_0xd3d3('0x2d')](_0x47688a['getVoiceQueues']({'attributes':['id',_0xd3d3('0x3')]}));_0xd5ad91['push'](_0x47688a[_0xd3d3('0x37')]({'attributes':['id','name']}));_0xd5ad91[_0xd3d3('0x2d')](_0x47688a[_0xd3d3('0x38')]({'attributes':['id','name']}));_0xd5ad91['push'](_0x47688a[_0xd3d3('0x39')]({'attributes':['id','name']}));_0xd5ad91[_0xd3d3('0x2d')](_0x47688a[_0xd3d3('0x3a')]({'attributes':['id',_0xd3d3('0x3')]}));_0xd5ad91[_0xd3d3('0x2d')](_0x47688a[_0xd3d3('0x3b')]({'attributes':['id','name']}));_0xd5ad91[_0xd3d3('0x2d')](_0x47688a[_0xd3d3('0x3c')]({'attributes':['id','name']}));break;}return BPromise['all'](_0xd5ad91);}})[_0xd3d3('0x3d')](function(_0xe5f0b2){if(_0xe5f0b2&&_0xe5f0b2[_0xd3d3('0x19')]){for(var _0xf78070=0x0;_0xf78070<_0xe5f0b2[_0xd3d3('0x19')];_0xf78070+=0x1){for(var _0x3938e3=0x0;_0x3938e3<_0xe5f0b2[_0xf78070]['length'];_0x3938e3+=0x1){switch(_0xf78070){case 0x0:joinOrLeaveQueues(_0x258207,_0x65b986,_0xd3d3('0x3e'),_0xe5f0b2[_0xf78070][_0x3938e3]);break;case 0x1:joinOrLeaveQueues(_0x258207,_0x65b986,_0xd3d3('0x3f'),_0xe5f0b2[_0xf78070][_0x3938e3]);break;case 0x2:joinOrLeaveQueues(_0x258207,_0x65b986,_0xd3d3('0x40'),_0xe5f0b2[_0xf78070][_0x3938e3]);break;case 0x3:joinOrLeaveQueues(_0x258207,_0x65b986,_0xd3d3('0x41'),_0xe5f0b2[_0xf78070][_0x3938e3]);break;case 0x4:joinOrLeaveQueues(_0x258207,_0x65b986,'mail',_0xe5f0b2[_0xf78070][_0x3938e3]);break;case 0x5:joinOrLeaveQueues(_0x258207,_0x65b986,_0xd3d3('0x42'),_0xe5f0b2[_0xf78070][_0x3938e3]);break;case 0x6:joinOrLeaveQueues(_0x258207,_0x65b986,_0xd3d3('0x43'),_0xe5f0b2[_0xf78070][_0x3938e3]);break;case 0x7:if(_0x358ecc[_0xd3d3('0x6')]!==_0xd3d3('0x7'))_0x258207[_0x65b986](util[_0xd3d3('0x17')](_0xd3d3('0x44'),_0xe5f0b2[_0xf78070][_0x3938e3][_0xd3d3('0x3')]));break;case 0x8:if(_0x358ecc[_0xd3d3('0x6')]!==_0xd3d3('0x7'))_0x258207[_0x65b986](util[_0xd3d3('0x17')](_0xd3d3('0x45'),_0xe5f0b2[_0xf78070][_0x3938e3][_0xd3d3('0x3')]));break;case 0x9:if(_0x358ecc['role']!==_0xd3d3('0x7'))_0x258207[_0x65b986](util['format'](_0xd3d3('0x46'),_0xe5f0b2[_0xf78070][_0x3938e3][_0xd3d3('0x9')],_0xe5f0b2[_0xf78070][_0x3938e3][_0xd3d3('0x3')]));break;case 0xa:_0x258207[_0x65b986](util[_0xd3d3('0x17')]('user:%s',_0xe5f0b2[_0xf78070][_0x3938e3][_0xd3d3('0x3')]));break;}}}}})[_0xd3d3('0x3d')](function(){if(_0x65b986===_0xd3d3('0x47')){var _0x3ba97c=_[_0xd3d3('0x15')](_0x358ecc[_0xd3d3('0x48')],'id');return _0x358ecc['removeChatInteractions'](_0x3ba97c)[_0xd3d3('0x3d')](function(){for(var _0x2f1033=0x0;_0x2f1033<_0x3ba97c[_0xd3d3('0x19')];_0x2f1033+=0x1){_0x133e41[_0xd3d3('0x49')](_0xd3d3('0x4a'),{'ChatInteractionId':Number(_0x3ba97c[_0x2f1033]),'UserId':Number(_0x358ecc['id'])});}});}})[_0xd3d3('0x3d')](function(){if(_0x65b986===_0xd3d3('0x47')){var _0x182751=_[_0xd3d3('0x15')](_0x358ecc['MailInteractions'],'id');return _0x358ecc['removeMailInteractions'](_0x182751)['then'](function(){for(var _0x252023=0x0;_0x252023<_0x182751[_0xd3d3('0x19')];_0x252023+=0x1){_0x133e41[_0xd3d3('0x49')](_0xd3d3('0x4b'),{'MailInteractionId':Number(_0x182751[_0x252023]),'UserId':Number(_0x358ecc['id'])});}});}})[_0xd3d3('0x3d')](function(){if(_0x65b986==='leave'){var _0x1c5977=_[_0xd3d3('0x15')](_0x358ecc[_0xd3d3('0x22')],'id');return _0x358ecc['removeFaxInteractions'](_0x1c5977)[_0xd3d3('0x3d')](function(){for(var _0x48e0d5=0x0;_0x48e0d5<_0x1c5977[_0xd3d3('0x19')];_0x48e0d5+=0x1){_0x133e41['emit'](_0xd3d3('0x4c'),{'FaxInteractionId':Number(_0x1c5977[_0x48e0d5]),'UserId':Number(_0x358ecc['id'])});}});}})[_0xd3d3('0x3d')](function(){if(_0x65b986===_0xd3d3('0x47')){var _0x367d5e=_[_0xd3d3('0x15')](_0x358ecc['SmsInteractions'],'id');return _0x358ecc[_0xd3d3('0x4d')](_0x367d5e)['then'](function(){for(var _0x2c3a37=0x0;_0x2c3a37<_0x367d5e[_0xd3d3('0x19')];_0x2c3a37+=0x1){_0x133e41['emit'](_0xd3d3('0x4e'),{'SmsInteractionId':Number(_0x367d5e[_0x2c3a37]),'UserId':Number(_0x358ecc['id'])});}});}})[_0xd3d3('0x3d')](function(){if(_0x65b986===_0xd3d3('0x47')){var _0xfb1ca7=_['map'](_0x358ecc[_0xd3d3('0x25')],'id');return _0x358ecc[_0xd3d3('0x4f')](_0xfb1ca7)[_0xd3d3('0x3d')](function(){for(var _0x4e9941=0x0;_0x4e9941<_0xfb1ca7[_0xd3d3('0x19')];_0x4e9941+=0x1){_0x133e41[_0xd3d3('0x49')](_0xd3d3('0x50'),{'OpenchannelInteractionId':Number(_0xfb1ca7[_0x4e9941]),'UserId':Number(_0x358ecc['id'])});}});}})[_0xd3d3('0x3d')](function(){if(_0x65b986===_0xd3d3('0x47')){var _0x24d4e4=_[_0xd3d3('0x15')](_0x358ecc['WhatsappInteractions'],'id');return _0x358ecc['removeWhatsappInteractions'](_0x24d4e4)[_0xd3d3('0x3d')](function(){for(var _0x2a67ca=0x0;_0x2a67ca<_0x24d4e4[_0xd3d3('0x19')];_0x2a67ca+=0x1){_0x133e41['emit'](_0xd3d3('0x51'),{'WhatsappInteractionId':Number(_0x24d4e4[_0x2a67ca]),'UserId':Number(_0x358ecc['id'])});}});}})[_0xd3d3('0x52')](function(_0x185857){_0x258207['log'](_0x185857);});}}function onDisconnect(_0x31e000,_0x4b5d13){joinOrLeave(_0x31e000,_0xd3d3('0x47'),_0x4b5d13);}function onConnect(_0x57d754){joinOrLeave(_0x57d754,'join');}exports[_0xd3d3('0x53')]=function(_0x3b07be){_0x3b07be['on'](_0xd3d3('0x54'),function(_0x2d7e9b){_0x2d7e9b[_0xd3d3('0x55')](0x0);_0x2d7e9b[_0xd3d3('0x56')]=_0x2d7e9b[_0xd3d3('0x57')][_0xd3d3('0x54')][_0xd3d3('0x58')]+':'+_0x2d7e9b[_0xd3d3('0x57')][_0xd3d3('0x54')][_0xd3d3('0x59')];_0x2d7e9b[_0xd3d3('0x5a')]=new Date();_0x2d7e9b[_0xd3d3('0x5b')]=function(_0x12c2c4){console[_0xd3d3('0x5b')](_0xd3d3('0x5c')+_0x2d7e9b[_0xd3d3('0x5d')][_0xd3d3('0x3')]+'['+_0x2d7e9b[_0xd3d3('0x56')]+']',_0x12c2c4);};_0x2d7e9b['on'](_0xd3d3('0x5e'),function(){onDisconnect(_0x2d7e9b,_0x3b07be);_0x2d7e9b[_0xd3d3('0x5b')](_0xd3d3('0x5f'));});onConnect(_0x2d7e9b);_0x2d7e9b[_0xd3d3('0x5b')](_0xd3d3('0x60'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 3c37307..adbad1a 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 _0x335b=['SIP/%s','channel','incomingmessage','outgoingmessage','motionChannel','offlineMessage','contact','name','AfterCreate','closed','changed','substatus','interface','agent','AfterUpdate','User','find','fullname','email','default','length','hasOwnProperty','model','hook','toLowerCase','condition','util','../../mysqldb','jayson/promise','../logger','triggers','client','http','ChatInteraction','afterCreate','newinteraction','Chat','afterUpdate','closedinteraction','ChatMessage','newmessage','Sms','SmsInteraction','SmsMessage','Whatsapp','WhatsappMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','EventManager','then','info','Trigger,\x20%s','error','catch','get','event','direction','resolve','ContactId','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','Sequelize','QueryTypes','SELECT','UserId','undefined','format'];(function(_0x2298f0,_0x3bbf4f){var _0x39b136=function(_0xc2cd6e){while(--_0xc2cd6e){_0x2298f0['push'](_0x2298f0['shift']());}};_0x39b136(++_0x3bbf4f);}(_0x335b,0x1dc));var _0xb335=function(_0x518d21,_0x15f774){_0x518d21=_0x518d21-0x0;var _0x5b880f=_0x335b[_0x518d21];return _0x5b880f;};'use strict';var util=require(_0xb335('0x0'));var db=require(_0xb335('0x1'))['db'];var jayson=require(_0xb335('0x2'));var logger=require(_0xb335('0x3'))(_0xb335('0x4'));var client=jayson[_0xb335('0x5')][_0xb335('0x6')]({'port':0x232a});var triggers=[{'channel':'Chat','model':_0xb335('0x7'),'event':_0xb335('0x8'),'condition':_0xb335('0x9'),'callback':afterCreate},{'channel':_0xb335('0xa'),'model':'ChatInteraction','event':_0xb335('0xb'),'condition':_0xb335('0xc'),'callback':afterUpdate},{'channel':'Chat','model':_0xb335('0xd'),'event':_0xb335('0x8'),'condition':_0xb335('0xe'),'callback':afterCreateMessage},{'channel':_0xb335('0xa'),'model':'ChatOfflineMessage','event':_0xb335('0x8'),'condition':'newmessage','callback':afterCreateOfflineMessage},{'channel':_0xb335('0xf'),'model':_0xb335('0x10'),'event':'afterCreate','condition':_0xb335('0x9'),'callback':afterCreate},{'channel':'Sms','model':_0xb335('0x10'),'event':_0xb335('0xb'),'condition':_0xb335('0xc'),'callback':afterUpdate},{'channel':_0xb335('0xf'),'model':_0xb335('0x11'),'event':_0xb335('0x8'),'condition':_0xb335('0xe'),'callback':afterCreateMessage},{'channel':'Whatsapp','model':'WhatsappInteraction','event':_0xb335('0x8'),'condition':_0xb335('0x9'),'callback':afterCreate},{'channel':'Whatsapp','model':'WhatsappInteraction','event':_0xb335('0xb'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xb335('0x12'),'model':_0xb335('0x13'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0xb335('0x14'),'model':_0xb335('0x15'),'event':_0xb335('0x8'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xb335('0x14'),'model':_0xb335('0x15'),'event':_0xb335('0xb'),'condition':_0xb335('0xc'),'callback':afterUpdate},{'channel':_0xb335('0x14'),'model':_0xb335('0x16'),'event':_0xb335('0x8'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xb335('0x17'),'model':_0xb335('0x18'),'event':'afterCreate','condition':_0xb335('0x9'),'callback':afterCreate},{'channel':'Mail','model':_0xb335('0x18'),'event':_0xb335('0xb'),'condition':_0xb335('0xc'),'callback':afterUpdate},{'channel':_0xb335('0x17'),'model':_0xb335('0x19'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0xb335('0x1a'),'model':'OpenchannelInteraction','event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0xb335('0x1a'),'model':_0xb335('0x1b'),'event':_0xb335('0xb'),'condition':_0xb335('0xc'),'callback':afterUpdate},{'channel':_0xb335('0x1a'),'model':_0xb335('0x1c'),'event':'afterCreate','condition':_0xb335('0xe'),'callback':afterCreateMessage}];function request(_0x3b0df2){return client['request'](_0xb335('0x1d'),_0x3b0df2)[_0xb335('0x1e')](function(_0x3c57b5){logger[_0xb335('0x1f')](_0xb335('0x20'),_0xb335('0x1d'),_0x3c57b5);if(_0x3c57b5[_0xb335('0x21')]){if(_0x3c57b5[_0xb335('0x21')]['code']===0x1f4){logger['error'](_0xb335('0x20'),_0xb335('0x1d'),_0x3c57b5['error']);}}})[_0xb335('0x22')](function(_0x8a8e7b){logger[_0xb335('0x21')](_0xb335('0x20'),_0xb335('0x1d'),_0x8a8e7b);});}function afterCreateMessage(_0x5867f6){return function(_0x4d64f0){_0x4d64f0=_0x4d64f0[_0xb335('0x23')]({'plain':!![]});_0x4d64f0['channel']=_0x5867f6;_0x4d64f0['motionChannel']=_0x5867f6;_0x4d64f0[_0xb335('0x24')]=_0x4d64f0[_0xb335('0x25')];Promise[_0xb335('0x26')]()[_0xb335('0x1e')](function(){if(typeof _0x4d64f0[_0xb335('0x27')]==='undefined')return null;var _0xe99237=_0xb335('0x28')+_0x4d64f0[_0xb335('0x27')];return db[_0xb335('0x29')][_0xb335('0x2a')](_0xe99237,{'type':db[_0xb335('0x2b')][_0xb335('0x2c')][_0xb335('0x2d')],'raw':!![]});})[_0xb335('0x1e')](function(_0x412bee){if(_0x412bee){_0x4d64f0['contact']=_0x412bee[0x0];}if(typeof _0x4d64f0[_0xb335('0x2e')]===_0xb335('0x2f'))return;return getAgent(_0x4d64f0[_0xb335('0x2e')]);})[_0xb335('0x1e')](function(_0x2dac40){if(_0x2dac40){_0x4d64f0['interface']=util[_0xb335('0x30')](_0xb335('0x31'),_0x2dac40['name']);_0x4d64f0['agent']=_0x2dac40;_0x4d64f0[_0xb335('0x32')]=_0x5867f6;return request({'event':_0xb335('0x33'),'message':_0x4d64f0});}else{return request({'event':_0xb335('0x34'),'message':_0x4d64f0});}})[_0xb335('0x22')](function(_0xe004bb){logger['error'](_0xb335('0x20'),'AfterCreateMessage',_0xe004bb);});};}function afterCreateOfflineMessage(_0x232c91){return function(_0x156370){_0x156370=_0x156370['get']({'plain':!![]});_0x156370['channel']=_0x232c91;_0x156370[_0xb335('0x35')]=_0x232c91;_0x156370[_0xb335('0x24')]=_0xb335('0x36');return request({'event':_0x156370['event'],'message':_0x156370});};}function afterCreate(_0x567fc2,_0x1742cc){return function(_0x37a3ca){_0x37a3ca=_0x37a3ca[_0xb335('0x23')]({'plain':!![]});_0x37a3ca[_0xb335('0x32')]=_0x567fc2;_0x37a3ca[_0xb335('0x35')]=_0x567fc2;_0x37a3ca[_0xb335('0x24')]='opened';Promise['resolve']()[_0xb335('0x1e')](function(){var _0x4a050e=_0xb335('0x28')+_0x37a3ca[_0xb335('0x27')];return db[_0xb335('0x29')]['query'](_0x4a050e,{'type':db[_0xb335('0x2b')][_0xb335('0x2c')][_0xb335('0x2d')],'raw':!![]});})[_0xb335('0x1e')](function(_0x24563b){if(_0x24563b){_0x37a3ca[_0xb335('0x37')]=_0x24563b[0x0];}if(typeof _0x37a3ca[_0xb335('0x2e')]===_0xb335('0x2f'))return;return getAgent(_0x37a3ca[_0xb335('0x2e')]);})['then'](function(_0x81b44d){if(_0x81b44d){_0x37a3ca['interface']=util['format'](_0xb335('0x31'),_0x81b44d[_0xb335('0x38')]);_0x37a3ca['agent']=_0x81b44d;}return request({'event':_0x1742cc,'message':_0x37a3ca});})['catch'](function(_0x27cb1d){logger[_0xb335('0x21')]('Trigger,\x20%s',_0xb335('0x39'),_0x27cb1d);});};}function afterUpdate(_0x7081b8){return function(_0x92b631){var _0x15ff9c=_0x92b631['changed'](_0xb335('0x3a'))&&_0x92b631['closed'];var _0xb2f259=_0x92b631[_0xb335('0x3b')](_0xb335('0x3c'));if(_0x15ff9c||_0xb2f259){var _0x56319a=_0x15ff9c?_0xb335('0xc'):'substatus';var _0x5d53b2=_0x92b631[_0xb335('0x23')]({'plain':!![]});_0x5d53b2[_0xb335('0x32')]=_0x7081b8;_0x5d53b2[_0xb335('0x35')]=_0x7081b8;_0x5d53b2[_0xb335('0x24')]=_0x15ff9c?_0xb335('0x3a'):_0xb335('0x3c');var _0x4d6f1f=_0xb335('0x28')+_0x5d53b2[_0xb335('0x27')];return db[_0xb335('0x29')][_0xb335('0x2a')](_0x4d6f1f,{'type':db[_0xb335('0x2b')]['QueryTypes'][_0xb335('0x2d')],'raw':!![]})[_0xb335('0x1e')](function(_0xf5884e){if(_0xf5884e){_0x5d53b2[_0xb335('0x37')]=_0xf5884e[0x0];}if(typeof _0x5d53b2[_0xb335('0x2e')]===_0xb335('0x2f'))return;return getAgent(_0x5d53b2[_0xb335('0x2e')]);})[_0xb335('0x1e')](function(_0x56cd3c){if(_0x56cd3c){_0x5d53b2[_0xb335('0x3d')]=util[_0xb335('0x30')]('SIP/%s',_0x56cd3c[_0xb335('0x38')]);_0x5d53b2[_0xb335('0x3e')]=_0x56cd3c;}return request({'event':_0x56319a,'message':_0x5d53b2});})['catch'](function(_0x1c431e){logger[_0xb335('0x21')](_0xb335('0x20'),_0xb335('0x3f'),_0x1c431e);});}};}function getAgent(_0xff89ea){return db[_0xb335('0x40')][_0xb335('0x41')]({'where':{'id':_0xff89ea},'attributes':['id','name',_0xb335('0x42'),_0xb335('0x43'),'internal'],'raw':!![]})[_0xb335('0x1e')](function(_0xf69c2b){return _0xf69c2b;});}exports[_0xb335('0x44')]=function(){for(var _0x1572cc=0x0;_0x1572cc=_0x249cf9[_0x8743('0x12')]){throw Error(_0x8743('0x13'));}_0x30b874(_0x5e8fdc);})[_0x8743('0x14')](function(_0x4a761a){_0x41c71d(_0x4a761a);});});}; \ No newline at end of file +var _0x1205=['voice','mail','chat','fax','sms','whatsapp','openchannel','getChannels','isValidChannel','clearBlockUser','blockedAt','getLicense','role','agent','count','then','agents','catch','bluebird','../mysqldb','./license/util'];(function(_0x4146bf,_0x25c865){var _0x5d189a=function(_0x179884){while(--_0x179884){_0x4146bf['push'](_0x4146bf['shift']());}};_0x5d189a(++_0x25c865);}(_0x1205,0xe4));var _0x5120=function(_0x45e477,_0x1a24cf){_0x45e477=_0x45e477-0x0;var _0x163248=_0x1205[_0x45e477];return _0x163248;};'use strict';var _=require('lodash');var BPromise=require(_0x5120('0x0'));var db=require(_0x5120('0x1'))['db'];var util=require(_0x5120('0x2'));var channels=[_0x5120('0x3'),_0x5120('0x4'),_0x5120('0x5'),_0x5120('0x6'),_0x5120('0x7'),_0x5120('0x8'),_0x5120('0x9')];exports[_0x5120('0xa')]=function(){return channels;};exports[_0x5120('0xb')]=function(_0x2fdb4d){_0x2fdb4d=_0x2fdb4d['toLowerCase']();return _['includes'](channels,_0x2fdb4d);};exports[_0x5120('0xc')]=function(_0x108cd6,_0x53cea9,_0x4e3277,_0x1952c2){var _0x25a12f={'loginAttempts':_0x53cea9,'blocked':_0x4e3277};if(!_['isUndefined'](_0x1952c2)){_0x25a12f[_0x5120('0xd')]=_0x1952c2;}return _0x108cd6['updateAttributes'](_0x25a12f);};exports[_0x5120('0xe')]=function(_0x2e032d){return new BPromise(function(_0x135fca,_0x7fe809){var _0x17da30=0x0;if(_0x2e032d[_0x5120('0xf')]!==_0x5120('0x10')){_0x135fca(_0x2e032d);}db['User'][_0x5120('0x11')]({'where':{'role':_0x5120('0x10'),'online':!![],'id':{'$ne':_0x2e032d['id']}}})['then'](function(_0x2aff92){_0x17da30=_0x2aff92;return util[_0x5120('0xe')]();})[_0x5120('0x12')](function(_0x2c4257){if(_0x2c4257&&_0x2c4257[_0x5120('0x13')]&&_0x17da30>=_0x2c4257['agents']){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x135fca(_0x2e032d);})[_0x5120('0x14')](function(_0x59d20d){_0x7fe809(_0x59d20d);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index cdd7e65..b952354 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0aed=['exports','api','message','Internal\x20Server\x20Error','name','inherits','Bad\x20Request','Forbidden','Entity\x20not\x20found','Not\x20Found','Message\x20sent\x20outside\x20a\x20valid\x20interval','Out\x20Of\x20Interval','code','details','Resource\x20Conflict','Conflict','stack','statusMessage','status','send'];(function(_0x16cb03,_0x43ea58){var _0x10944e=function(_0x27ebaa){while(--_0x27ebaa){_0x16cb03['push'](_0x16cb03['shift']());}};_0x10944e(++_0x43ea58);}(_0x0aed,0xb5));var _0xd0ae=function(_0x12aba8,_0x40a036){_0x12aba8=_0x12aba8-0x0;var _0x2aac66=_0x0aed[_0x12aba8];return _0x2aac66;};'use strict';var util=require('util');var logger=require('../config/logger')(_0xd0ae('0x0'));var APIError=function(_0x5230c6,_0x2ceaf2){this[_0xd0ae('0x1')]=_0x5230c6||_0xd0ae('0x2');this[_0xd0ae('0x3')]=_0x2ceaf2||'Error';util[_0xd0ae('0x4')](APIError,Error);};var APIBadRequestError=function(_0x6010c5){this[_0xd0ae('0x1')]=_0x6010c5||'Bad\x20Request';this[_0xd0ae('0x3')]=_0xd0ae('0x5');util[_0xd0ae('0x4')](APIBadRequestError,APIError);};var APIForbiddenError=function(_0x82a66c){this[_0xd0ae('0x1')]=_0x82a66c||_0xd0ae('0x6');this[_0xd0ae('0x3')]=_0xd0ae('0x6');util[_0xd0ae('0x4')](APIForbiddenError,APIError);};var APINotFoundError=function(_0x317025){this[_0xd0ae('0x1')]=_0x317025||_0xd0ae('0x7');this['name']=_0xd0ae('0x8');util[_0xd0ae('0x4')](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x2a1d76){this[_0xd0ae('0x1')]=_0x2a1d76||_0xd0ae('0x9');this[_0xd0ae('0x3')]=_0xd0ae('0xa');this[_0xd0ae('0xb')]=0x193;this[_0xd0ae('0xc')]={'type':'OutOfInterval'};util['inherits'](APIOutOfIntervalError,APIError);};var APIConflictError=function(_0x1c20a7){this[_0xd0ae('0x1')]=_0x1c20a7||_0xd0ae('0xd');this[_0xd0ae('0x3')]=_0xd0ae('0xe');util[_0xd0ae('0x4')](APIBadRequestError,APIError);};function getStatusCode(_0x3cfd1b){switch(_0x3cfd1b){case _0xd0ae('0x5'):return 0x190;case _0xd0ae('0x6'),_0xd0ae('0xa'):return 0x193;case _0xd0ae('0x8'):return 0x194;case'Conflict':return 0x199;default:return 0x1f4;}}function getCustomStatusMessage(_0x4e1547){if(_0x4e1547===_0xd0ae('0xa'))return _0x4e1547;return null;}function handleError(_0x11f453){return function(_0x5a7a49){logger['error'](_0x5a7a49[_0xd0ae('0xf')]);var _0x4da576=getStatusCode(_0x5a7a49[_0xd0ae('0x3')]);var _0x573e33=getCustomStatusMessage(_0x5a7a49['name']);if(_0x5a7a49[_0xd0ae('0x3')]){delete _0x5a7a49['name'];}if(_0x573e33){_0x11f453[_0xd0ae('0x10')]=_0x573e33;}return _0x11f453[_0xd0ae('0x11')](_0x4da576)[_0xd0ae('0x12')](_0x5a7a49);};}module[_0xd0ae('0x13')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIForbiddenError':APIForbiddenError,'APINotFoundError':APINotFoundError,'APIOutOfIntervalError':APIOutOfIntervalError,'APIConflict':APIConflictError,'handleError':handleError}; \ No newline at end of file +var _0xdc2e=['message','Internal\x20Server\x20Error','name','Error','inherits','Bad\x20Request','Entity\x20not\x20found','Not\x20Found','Message\x20sent\x20outside\x20a\x20valid\x20interval','Out\x20Of\x20Interval','code','details','OutOfInterval','Resource\x20Conflict','Conflict','Forbidden','error','statusMessage','status','send','exports','util','../config/logger','api'];(function(_0x35ef6b,_0x202c42){var _0x3ad145=function(_0x3092de){while(--_0x3092de){_0x35ef6b['push'](_0x35ef6b['shift']());}};_0x3ad145(++_0x202c42);}(_0xdc2e,0x17d));var _0xedc2=function(_0x25682f,_0x15397d){_0x25682f=_0x25682f-0x0;var _0x31d484=_0xdc2e[_0x25682f];return _0x31d484;};'use strict';var util=require(_0xedc2('0x0'));var logger=require(_0xedc2('0x1'))(_0xedc2('0x2'));var APIError=function(_0x25b570,_0x1e7472){this[_0xedc2('0x3')]=_0x25b570||_0xedc2('0x4');this[_0xedc2('0x5')]=_0x1e7472||_0xedc2('0x6');util[_0xedc2('0x7')](APIError,Error);};var APIBadRequestError=function(_0x5bbfb0){this[_0xedc2('0x3')]=_0x5bbfb0||_0xedc2('0x8');this[_0xedc2('0x5')]='Bad\x20Request';util[_0xedc2('0x7')](APIBadRequestError,APIError);};var APIForbiddenError=function(_0x1d7b4b){this['message']=_0x1d7b4b||'Forbidden';this[_0xedc2('0x5')]='Forbidden';util['inherits'](APIForbiddenError,APIError);};var APINotFoundError=function(_0x1bd620){this[_0xedc2('0x3')]=_0x1bd620||_0xedc2('0x9');this[_0xedc2('0x5')]=_0xedc2('0xa');util[_0xedc2('0x7')](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x591127){this[_0xedc2('0x3')]=_0x591127||_0xedc2('0xb');this['name']=_0xedc2('0xc');this[_0xedc2('0xd')]=0x193;this[_0xedc2('0xe')]={'type':_0xedc2('0xf')};util[_0xedc2('0x7')](APIOutOfIntervalError,APIError);};var APIConflictError=function(_0xa64e1b){this[_0xedc2('0x3')]=_0xa64e1b||_0xedc2('0x10');this['name']=_0xedc2('0x11');util[_0xedc2('0x7')](APIBadRequestError,APIError);};function getStatusCode(_0x1b9cc1){switch(_0x1b9cc1){case _0xedc2('0x8'):return 0x190;case _0xedc2('0x12'),'Out\x20Of\x20Interval':return 0x193;case'Not\x20Found':return 0x194;case _0xedc2('0x11'):return 0x199;default:return 0x1f4;}}function getCustomStatusMessage(_0x2be93d){if(_0x2be93d===_0xedc2('0xc'))return _0x2be93d;return null;}function handleError(_0x36fb5e){return function(_0x5f391b){logger[_0xedc2('0x13')](_0x5f391b['stack']);var _0x12d931=getStatusCode(_0x5f391b[_0xedc2('0x5')]);var _0x5cd16e=getCustomStatusMessage(_0x5f391b[_0xedc2('0x5')]);if(_0x5f391b[_0xedc2('0x5')]){delete _0x5f391b[_0xedc2('0x5')];}if(_0x5cd16e){_0x36fb5e[_0xedc2('0x14')]=_0x5cd16e;}return _0x36fb5e[_0xedc2('0x15')](_0x12d931)[_0xedc2('0x16')](_0x5f391b);};}module[_0xedc2('0x17')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIForbiddenError':APIForbiddenError,'APINotFoundError':APINotFoundError,'APIOutOfIntervalError':APIOutOfIntervalError,'APIConflict':APIConflictError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index e08063d..fc05ef1 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9f95=['404','status','send','exports'];(function(_0x544ded,_0x2cd874){var _0x598372=function(_0x3b0cda){while(--_0x3b0cda){_0x544ded['push'](_0x544ded['shift']());}};_0x598372(++_0x2cd874);}(_0x9f95,0x97));var _0x59f9=function(_0x26bfb0,_0x5b0ffc){_0x26bfb0=_0x26bfb0-0x0;var _0x4454b3=_0x9f95[_0x26bfb0];return _0x4454b3;};'use strict';module[_0x59f9('0x0')][0x194]=function pageNotFound(_0x57f2b6,_0xbd0ecc){var _0x359d2e=_0x59f9('0x1');var _0xb1398a=0x194;var _0x30c446={'status':_0xb1398a};_0xbd0ecc[_0x59f9('0x2')](_0x30c446[_0x59f9('0x2')]);_0xbd0ecc['render'](_0x359d2e,{},function(_0x19411b,_0x4f811a){if(_0x19411b){return _0xbd0ecc[_0x59f9('0x2')](_0x30c446['status'])['json'](_0x30c446);}_0xbd0ecc[_0x59f9('0x3')](_0x4f811a);});}; \ No newline at end of file +var _0x9b50=['status','render','send','exports'];(function(_0x456c9d,_0x4c649a){var _0x20d174=function(_0x4372df){while(--_0x4372df){_0x456c9d['push'](_0x456c9d['shift']());}};_0x20d174(++_0x4c649a);}(_0x9b50,0x11b));var _0x09b5=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9b50[_0x5b644e];return _0x49c6bf;};'use strict';module[_0x09b5('0x0')][0x194]=function pageNotFound(_0x7ad0b9,_0x4dda50){var _0x26e4c9='404';var _0x3744c1=0x194;var _0x15caa4={'status':_0x3744c1};_0x4dda50[_0x09b5('0x1')](_0x15caa4[_0x09b5('0x1')]);_0x4dda50[_0x09b5('0x2')](_0x26e4c9,{},function(_0x2c028b,_0x2483f9){if(_0x2c028b){return _0x4dda50[_0x09b5('0x1')](_0x15caa4['status'])['json'](_0x15caa4);}_0x4dda50[_0x09b5('0x3')](_0x2483f9);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 85a4375..cac3941 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x82cf=['WhatsappQueue','WhatsappQueues','user_has_chat_websites','FaxAccount','FaxAccounts','user_has_fax_accounts','MailAccount','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SpiedAgents','ChanSpyId','Applications','Sounds','moh_has_sounds','Members','HopperHistories','VoiceQueueId','HopperBlacks','belongsTo','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','Lists','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','VoiceMailMessage','mailboxuser','mailbox','QueueCalls','uniqueid','VoiceCallReport','ContactId','MailAccountId','restrict','CloudProviderId','Imap','Smtp','Disposition','Dispositions','CannedAnswer','Answers','Messages','Interactions','List','TemplateId','mandatoryDispositionPause','team_has_mail_queues','MailInteractionId','Account','mail_interaction_has_tags','Tags','ThroughTags','Users','user_has_mail_interactions','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessage','ChatOfflineMessageId','TagId','ListId','Contact','DashboardItem','Items','FaxAccountId','FaxMessage','FaxInteractionId','Owner','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','user_has_sms_accounts','SmsInteractionId','sms_interaction_has_tags','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ProactiveActions','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','CompanyId','JscriptySessions','Company','cm_user_has_contacts','cm_contact_has_tags','CmHopperAdditionalPhone','Agent','All','OneAll','Any','OneAny','AutomationAnyId','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','Schedule','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','ItemTypeId','CmHopperId','AllConditions','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Actions','TriggerId','Fields','MetricId','AccountId','Subjects','SalesforceField','DescriptionId','SubjectId','Description','Field','VariableId','Configurations','Descriptions','FieldId','Subject','DeskField','int_desk_configuration_has_tags','ZohoField','ZendeskAccount','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerConfiguration','VtigerField','ServicenowAccount','ServicenowConfiguration','Dynamics365Configuration','FreshsalesField','ToId','SessionId','SmsQueueReport','ProjectId','JscriptyAnswerReport','OpenchannelQueues','team_has_whatsapp_queues','TeamVoicePrefix','CampaignId','SquareProject','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromAccount','FromUserId','FromAgent','ToAgent','ToMailQueueId','ToQueue','ToAccount','FromChatWebsiteId','ToUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','ToSmsQueueId','ToSmsAccountId','CmCustomField','CustomFields','HopperHistory','userProfileId','UserProfileSection','UserProfileSections','sectionId','WhatsappAccountId','user_has_whatsapp_accounts','WhatsappInteractionId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','user','sequelize','lodash','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','utf8','sequelizeHistory','mysql','utf8mb4','name','database','username','options','User','import','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.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','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','MailMessage','MailApplication','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','../api/dashboardItem/dashboardItem.model','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','../api/faxMessage/faxMessage.model','FaxQueue','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsApplication','../api/smsApplication/smsApplication.model','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','CmContact','../api/cmContact/cmContact.model','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','../api/reportAgentPreview/reportAgentPreview.model','Action','../api/action/action.model','Automation','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','Pause','../api/pause/pause.model','Cdr','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','../api/integration/integration.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','Integration','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','../api/smsTransferReport/smsTransferReport.model','CmList','VoicePrefix','../api/voicePrefix/voicePrefix.model','../api/userProfile/userProfile.model','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','CloudProvider','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','UserVoicePrefix','UserSetting','../api/user-setting/user-setting.model','../api/mailInteractionHasTag/mailInteractionHasTag.model','cascade','UserId','hasOne','userSetting','hasMany','Recordings','UserVoiceQueueRt','VoiceExtension','Extensions','HopperFinals','ReportAgentPreview','OpenchannelInteraction','OpenchannelInteractions','SmsInteractions','MailInteractions','UserNotification','UserNotifications','SenderId','CmHopper','Hoppers','SET\x20NULL','UserProfile','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_lists','Team','user_has_teams','ChatInteractions','user_has_chat_interactions','FaxInteractions','user_has_fax_interactions','SmsInteraction','user_has_sms_interactions','user_has_openchannel_interactions','WhatsappInteractions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','MailQueues','ChatQueue','ChatQueues','UserChatQueue','FaxQueues','UserFaxQueue','SmsQueues'];(function(_0x575b35,_0x12a844){var _0x5989e9=function(_0x4dd1b8){while(--_0x4dd1b8){_0x575b35['push'](_0x575b35['shift']());}};_0x5989e9(++_0x12a844);}(_0x82cf,0xc8));var _0xf82c=function(_0xcf4569,_0x1ce755){_0xcf4569=_0xcf4569-0x0;var _0x7fef=_0x82cf[_0xcf4569];return _0x7fef;};'use strict';var config=require('../config/environment');var Sequelize=require(_0xf82c('0x0'));var _=require(_0xf82c('0x1'));var jstz=require('jstz');var timezone=jstz['determine']();config[_0xf82c('0x0')]=_[_0xf82c('0x2')](config['sequelize'],{'database':_0xf82c('0x3'),'username':_0xf82c('0x4'),'password':_0xf82c('0x5'),'options':{'host':_0xf82c('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xf82c('0x7'),'collate':'utf8_general_ci'}}});config[_0xf82c('0x8')]=_['defaultsDeep'](config[_0xf82c('0x8')],{'database':_0xf82c('0x3'),'username':_0xf82c('0x4'),'password':_0xf82c('0x5'),'options':{'host':_0xf82c('0x6'),'port':0xcea,'dialect':_0xf82c('0x9'),'dialectOptions':{'charset':_0xf82c('0xa')},'logging':![],'timezone':timezone[_0xf82c('0xb')](),'define':{'charset':_0xf82c('0x7'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xf82c('0x0')][_0xf82c('0xc')],config[_0xf82c('0x0')]['username'],config[_0xf82c('0x0')]['password'],config[_0xf82c('0x0')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xf82c('0x8')][_0xf82c('0xc')],config[_0xf82c('0x8')][_0xf82c('0xd')],config[_0xf82c('0x8')]['password'],config[_0xf82c('0x8')][_0xf82c('0xe')])};db[_0xf82c('0xf')]=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0x11'));db['VoiceChanSpy']=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0x12'));db[_0xf82c('0x13')]=db['sequelize']['import'](_0xf82c('0x14'));db['VoiceExtension']=db[_0xf82c('0x0')][_0xf82c('0x10')]('../api/voiceExtension/voiceExtension.model');db[_0xf82c('0x15')]=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0x16'));db[_0xf82c('0x17')]=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0x18'));db[_0xf82c('0x19')]=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0x1a'));db[_0xf82c('0x1b')]=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0x1c'));db[_0xf82c('0x1d')]=db[_0xf82c('0x0')]['import'](_0xf82c('0x1e'));db['VoiceMailMessage']=db['sequelize'][_0xf82c('0x10')](_0xf82c('0x1f'));db['VoiceCallReport']=db['sequelize'][_0xf82c('0x10')](_0xf82c('0x20'));db['VoiceDialReport']=db[_0xf82c('0x0')]['import'](_0xf82c('0x21'));db['VoiceAgentReport']=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0x22'));db[_0xf82c('0x23')]=db['sequelize']['import'](_0xf82c('0x24'));db['MemberReport']=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0x25'));db[_0xf82c('0x26')]=db[_0xf82c('0x0')]['import'](_0xf82c('0x27'));db['VoiceTransferReport']=db[_0xf82c('0x0')][_0xf82c('0x10')]('../api/voiceTransferReport/voiceTransferReport.model');db['UserVoiceQueueRt']=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0x28'));db[_0xf82c('0x29')]=db[_0xf82c('0x0')]['import']('../api/userVoiceQueue/userVoiceQueue.model');db['UserChatQueue']=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0x2a'));db[_0xf82c('0x2b')]=db[_0xf82c('0x0')]['import'](_0xf82c('0x2c'));db['UserFaxQueue']=db['sequelize'][_0xf82c('0x10')]('../api/userFaxQueue/userFaxQueue.model');db[_0xf82c('0x2d')]=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0x2e'));db[_0xf82c('0x2f')]=db['sequelize'][_0xf82c('0x10')](_0xf82c('0x30'));db[_0xf82c('0x31')]=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0x32'));db[_0xf82c('0x33')]=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0x34'));db[_0xf82c('0x35')]=db['sequelize'][_0xf82c('0x10')](_0xf82c('0x36'));db['MailAccount']=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0x37'));db[_0xf82c('0x38')]=db[_0xf82c('0x0')][_0xf82c('0x10')]('../api/mailQueue/mailQueue.model');db[_0xf82c('0x39')]=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0x3a'));db[_0xf82c('0x3b')]=db['sequelize'][_0xf82c('0x10')]('../api/mailInteraction/mailInteraction.model');db[_0xf82c('0x3c')]=db['sequelize']['import']('../api/mailMessage/mailMessage.model');db[_0xf82c('0x3d')]=db[_0xf82c('0x0')][_0xf82c('0x10')]('../api/mailApplication/mailApplication.model');db[_0xf82c('0x3e')]=db['sequelize']['import'](_0xf82c('0x3f'));db[_0xf82c('0x40')]=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0x41'));db['DashboardItem']=db[_0xf82c('0x0')]['import'](_0xf82c('0x42'));db['FaxAccount']=db[_0xf82c('0x0')]['import'](_0xf82c('0x43'));db[_0xf82c('0x44')]=db['sequelize'][_0xf82c('0x10')](_0xf82c('0x45'));db[_0xf82c('0x46')]=db['sequelize'][_0xf82c('0x10')](_0xf82c('0x47'));db['FaxMessage']=db[_0xf82c('0x0')]['import'](_0xf82c('0x48'));db[_0xf82c('0x49')]=db[_0xf82c('0x0')][_0xf82c('0x10')]('../api/faxQueue/faxQueue.model');db[_0xf82c('0x4a')]=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0x4b'));db[_0xf82c('0x4c')]=db[_0xf82c('0x0')][_0xf82c('0x10')]('../api/smsAccount/smsAccount.model');db[_0xf82c('0x4d')]=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0x4e'));db['SmsInteraction']=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0x4f'));db[_0xf82c('0x50')]=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0x51'));db[_0xf82c('0x52')]=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0x53'));db[_0xf82c('0x54')]=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0x55'));db[_0xf82c('0x56')]=db[_0xf82c('0x0')][_0xf82c('0x10')]('../api/openchannelApplication/openchannelApplication.model');db['OpenchannelInteraction']=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0x57'));db[_0xf82c('0x58')]=db['sequelize'][_0xf82c('0x10')](_0xf82c('0x59'));db[_0xf82c('0x5a')]=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0x5b'));db[_0xf82c('0x5c')]=db['sequelize'][_0xf82c('0x10')](_0xf82c('0x5d'));db[_0xf82c('0x5e')]=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0x5f'));db[_0xf82c('0x60')]=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0x61'));db[_0xf82c('0x62')]=db[_0xf82c('0x0')]['import'](_0xf82c('0x63'));db[_0xf82c('0x64')]=db['sequelize'][_0xf82c('0x10')](_0xf82c('0x65'));db['ChatOfflineMessage']=db[_0xf82c('0x0')][_0xf82c('0x10')]('../api/chatOfflineMessage/chatOfflineMessage.model');db['ChatQueue']=db[_0xf82c('0x0')]['import'](_0xf82c('0x66'));db[_0xf82c('0x67')]=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0x68'));db[_0xf82c('0x69')]=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0x6a'));db[_0xf82c('0x6b')]=db[_0xf82c('0x0')][_0xf82c('0x10')]('../api/cmCompany/cmCompany.model');db[_0xf82c('0x6c')]=db[_0xf82c('0x0')]['import'](_0xf82c('0x6d'));db['CmHopper']=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0x6e'));db[_0xf82c('0x6f')]=db['sequelize'][_0xf82c('0x10')](_0xf82c('0x70'));db[_0xf82c('0x71')]=db['sequelize']['import'](_0xf82c('0x72'));db[_0xf82c('0x73')]=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0x74'));db['ReportAgentPreview']=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0x75'));db['CmCustomField']=db[_0xf82c('0x0')][_0xf82c('0x10')]('../api/cmCustomField/cmCustomField.model');db[_0xf82c('0x76')]=db['sequelize']['import'](_0xf82c('0x77'));db[_0xf82c('0x78')]=db[_0xf82c('0x0')]['import']('../api/automation/automation.model');db['CannedAnswer']=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0x79'));db['Disposition']=db[_0xf82c('0x0')]['import'](_0xf82c('0x7a'));db[_0xf82c('0x7b')]=db['sequelize'][_0xf82c('0x10')](_0xf82c('0x7c'));db[_0xf82c('0x7d')]=db[_0xf82c('0x0')]['import']('../api/interval/interval.model');db[_0xf82c('0x7e')]=db['sequelize'][_0xf82c('0x10')](_0xf82c('0x7f'));db[_0xf82c('0x80')]=db['sequelize']['import']('../api/cdr/cdr.model');db[_0xf82c('0x81')]=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0x82'));db['Schedule']=db[_0xf82c('0x0')]['import'](_0xf82c('0x83'));db[_0xf82c('0x84')]=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0x85'));db[_0xf82c('0x86')]=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0x87'));db[_0xf82c('0x88')]=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0x89'));db[_0xf82c('0x8a')]=db['sequelize']['import'](_0xf82c('0x8b'));db['CmHopperAdditionalPhone']=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0x8c'));db[_0xf82c('0x8d')]=db[_0xf82c('0x0')]['import'](_0xf82c('0x8e'));db[_0xf82c('0x8f')]=db[_0xf82c('0x0')]['import'](_0xf82c('0x90'));db[_0xf82c('0x91')]=db['sequelize']['import'](_0xf82c('0x92'));db['Integration']=db[_0xf82c('0x0')]['import'](_0xf82c('0x93'));db['IntegrationReport']=db[_0xf82c('0x0')][_0xf82c('0x10')]('../api/integrationReport/integrationReport.model');db[_0xf82c('0x94')]=db['sequelize'][_0xf82c('0x10')](_0xf82c('0x95'));db[_0xf82c('0x96')]=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0x97'));db['AnalyticExtractedReport']=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0x98'));db[_0xf82c('0x99')]=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0x9a'));db[_0xf82c('0x9b')]=db[_0xf82c('0x0')]['import'](_0xf82c('0x9c'));db[_0xf82c('0x9d')]=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0x9e'));db[_0xf82c('0x9f')]=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0xa0'));db[_0xf82c('0xa1')]=db['sequelize'][_0xf82c('0x10')](_0xf82c('0xa2'));db['SalesforceField']=db[_0xf82c('0x0')][_0xf82c('0x10')]('../api/intSalesforceField/intSalesforceField.model');db[_0xf82c('0xa3')]=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0xa4'));db[_0xf82c('0xa5')]=db['sequelize'][_0xf82c('0x10')](_0xf82c('0xa6'));db[_0xf82c('0xa7')]=db[_0xf82c('0x0')]['import'](_0xf82c('0xa8'));db[_0xf82c('0xa9')]=db['sequelize'][_0xf82c('0x10')]('../api/intDeskAccount/intDeskAccount.model');db[_0xf82c('0xaa')]=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0xab'));db['DeskField']=db[_0xf82c('0x0')][_0xf82c('0x10')]('../api/intDeskField/intDeskField.model');db[_0xf82c('0xac')]=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0xad'));db[_0xf82c('0xae')]=db['sequelize'][_0xf82c('0x10')](_0xf82c('0xaf'));db['ZohoField']=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0xb0'));db['ZendeskAccount']=db['sequelize'][_0xf82c('0x10')](_0xf82c('0xb1'));db[_0xf82c('0xb2')]=db[_0xf82c('0x0')][_0xf82c('0x10')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0xf82c('0xb3')]=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0xb4'));db[_0xf82c('0xb5')]=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0xb6'));db[_0xf82c('0xb7')]=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0xb8'));db[_0xf82c('0xb9')]=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0xba'));db[_0xf82c('0xbb')]=db['sequelize']['import']('../api/intVtigerAccount/intVtigerAccount.model');db['VtigerConfiguration']=db[_0xf82c('0x0')]['import']('../api/intVtigerConfiguration/intVtigerConfiguration.model');db['VtigerField']=db[_0xf82c('0x0')][_0xf82c('0x10')]('../api/intVtigerField/intVtigerField.model');db['ServicenowAccount']=db[_0xf82c('0x0')]['import'](_0xf82c('0xbc'));db['ServicenowConfiguration']=db['sequelize'][_0xf82c('0x10')](_0xf82c('0xbd'));db[_0xf82c('0xbe')]=db[_0xf82c('0x0')]['import'](_0xf82c('0xbf'));db[_0xf82c('0xc0')]=db['sequelize'][_0xf82c('0x10')](_0xf82c('0xc1'));db['Dynamics365Configuration']=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0xc2'));db[_0xf82c('0xc3')]=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0xc4'));db['FreshsalesAccount']=db['sequelize'][_0xf82c('0x10')](_0xf82c('0xc5'));db[_0xf82c('0xc6')]=db['sequelize'][_0xf82c('0x10')](_0xf82c('0xc7'));db['FreshsalesField']=db[_0xf82c('0x0')][_0xf82c('0x10')]('../api/intFreshsalesField/intFreshsalesField.model');db[_0xf82c('0xc8')]=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0x93'));db[_0xf82c('0xc9')]=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0xca'));db[_0xf82c('0xcb')]=db['sequelize']['import'](_0xf82c('0xcc'));db[_0xf82c('0xcd')]=db['sequelize'][_0xf82c('0x10')](_0xf82c('0xce'));db['JscriptyAnswerReport']=db[_0xf82c('0x0')][_0xf82c('0x10')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0xf82c('0xcf')]=db['sequelize'][_0xf82c('0x10')](_0xf82c('0xd0'));db[_0xf82c('0xd1')]=db['sequelize']['import']('../api/jscriptySessionReport/jscriptySessionReport.model');db['SmsQueueReport']=db['sequelize']['import'](_0xf82c('0xd2'));db[_0xf82c('0xd3')]=db['sequelize']['import']('../api/squareReport/squareReport.model');db['SquareDetailsReport']=db['sequelize'][_0xf82c('0x10')]('../api/squareReportDetail/squareReportDetail.model');db[_0xf82c('0xd4')]=db[_0xf82c('0x0')]['import'](_0xf82c('0xd5'));db[_0xf82c('0xd6')]=db['sequelize'][_0xf82c('0x10')](_0xf82c('0xd7'));db[_0xf82c('0xd8')]=db['sequelize'][_0xf82c('0x10')]('../api/squareOdbc/squareOdbc.model');db['SquareProject']=db['sequelize'][_0xf82c('0x10')](_0xf82c('0xd9'));db[_0xf82c('0xda')]=db['sequelize']['import'](_0xf82c('0xdb'));db[_0xf82c('0xdc')]=db[_0xf82c('0x0')][_0xf82c('0x10')]('../api/squareMessage/squareMessage.model');db['Team']=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0xdd'));db[_0xf82c('0xde')]=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0xdf'));db[_0xf82c('0xe0')]=db['sequelize'][_0xf82c('0x10')](_0xf82c('0xe1'));db['Migration']=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0xe2'));db[_0xf82c('0xe3')]=db[_0xf82c('0x0')]['import'](_0xf82c('0xe4'));db[_0xf82c('0xe5')]=db[_0xf82c('0x0')]['import']('../api/plugin/plugin.model');db[_0xf82c('0xe6')]=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0xe7'));db[_0xf82c('0xe8')]=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0xe9'));db[_0xf82c('0xea')]=db[_0xf82c('0x0')][_0xf82c('0x10')]('../api/faxTransferReport/faxTransferReport.model');db[_0xf82c('0xeb')]=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0xec'));db['SmsTransferReport']=db['sequelize']['import'](_0xf82c('0xed'));db[_0xf82c('0xee')]=db[_0xf82c('0x0')]['import']('../api/cmList/cmList.model');db[_0xf82c('0xef')]=db['sequelize'][_0xf82c('0x10')](_0xf82c('0xf0'));db['UserProfile']=db[_0xf82c('0x0')]['import'](_0xf82c('0xf1'));db['UserProfileSection']=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0xf2'));db[_0xf82c('0xf3')]=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0xf4'));db['UserNotification']=db[_0xf82c('0x0')]['import']('../api/userNotification/userNotification.model');db[_0xf82c('0xf5')]=db[_0xf82c('0x0')]['import'](_0xf82c('0xf6'));db[_0xf82c('0xf7')]=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0xf8'));db[_0xf82c('0xf9')]=db['sequelize'][_0xf82c('0x10')](_0xf82c('0xfa'));db[_0xf82c('0xfb')]=db['sequelize'][_0xf82c('0x10')](_0xf82c('0xfc'));db[_0xf82c('0xfd')]=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0xfe'));db[_0xf82c('0xff')]=db['sequelize'][_0xf82c('0x10')](_0xf82c('0x100'));db['WhatsappQueue']=db[_0xf82c('0x0')][_0xf82c('0x10')]('../api/whatsappQueue/whatsappQueue.model');db[_0xf82c('0x101')]=db[_0xf82c('0x0')][_0xf82c('0x10')]('../api/cloudProvider/cloudProvider.model');db[_0xf82c('0x102')]=db['sequelize']['import'](_0xf82c('0x103'));db['TeamVoicePrefix']=db[_0xf82c('0x0')][_0xf82c('0x10')]('../api/teamVoicePrefix/teamVoicePrefix.model');db[_0xf82c('0x104')]=db['sequelize'][_0xf82c('0x10')]('../api/userVoicePrefix/userVoicePrefix.model');db[_0xf82c('0x105')]=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0x106'));db['MailInteractionHasTag']=db[_0xf82c('0x0')][_0xf82c('0x10')](_0xf82c('0x107'));db[_0xf82c('0xf')]['hasOne'](db['VoiceMail'],{'as':_0xf82c('0x1d'),'onDelete':_0xf82c('0x108'),'foreignKey':_0xf82c('0x109')});db[_0xf82c('0xf')][_0xf82c('0x10a')](db[_0xf82c('0x105')],{'as':_0xf82c('0x10b'),'onDelete':'cascade','foreignKey':_0xf82c('0x109')});db[_0xf82c('0xf')][_0xf82c('0x10c')](db[_0xf82c('0x19')],{'as':_0xf82c('0x10d'),'foreignKey':_0xf82c('0x109')});db['User'][_0xf82c('0x10c')](db[_0xf82c('0x10e')],{'as':'VoiceQueuesRt','foreignKey':_0xf82c('0x109')});db[_0xf82c('0xf')][_0xf82c('0x10c')](db[_0xf82c('0x10f')],{'as':_0xf82c('0x110'),'onDelete':_0xf82c('0x108'),'hooks':!![]});db[_0xf82c('0xf')][_0xf82c('0x10c')](db[_0xf82c('0x71')],{'as':_0xf82c('0x111'),'foreignKey':'UserId'});db[_0xf82c('0xf')]['hasMany'](db[_0xf82c('0x73')],{'as':'HopperHistory','foreignKey':'UserId'});db['User'][_0xf82c('0x10c')](db[_0xf82c('0x112')],{'as':_0xf82c('0x112'),'foreignKey':_0xf82c('0x109')});db[_0xf82c('0xf')][_0xf82c('0x10c')](db[_0xf82c('0x113')],{'as':_0xf82c('0x114'),'foreignKey':_0xf82c('0x109')});db[_0xf82c('0xf')]['hasMany'](db[_0xf82c('0x62')],{'as':'ChatInteractions','foreignKey':_0xf82c('0x109')});db[_0xf82c('0xf')]['hasMany'](db['SmsInteraction'],{'as':_0xf82c('0x115'),'foreignKey':_0xf82c('0x109')});db['User'][_0xf82c('0x10c')](db[_0xf82c('0x46')],{'as':'FaxInteractions','foreignKey':'UserId'});db['User'][_0xf82c('0x10c')](db['MailInteraction'],{'as':_0xf82c('0x116'),'foreignKey':_0xf82c('0x109')});db[_0xf82c('0xf')][_0xf82c('0x10c')](db[_0xf82c('0xf9')],{'as':'WhatsappInteractions','foreignKey':_0xf82c('0x109')});db[_0xf82c('0xf')][_0xf82c('0x10c')](db[_0xf82c('0x117')],{'as':_0xf82c('0x118'),'foreignKey':_0xf82c('0x119')});db[_0xf82c('0xf')][_0xf82c('0x10c')](db[_0xf82c('0x11a')],{'as':_0xf82c('0x11b'),'foreignKey':_0xf82c('0x109'),'onDelete':_0xf82c('0x11c')});db['User']['belongsTo'](db[_0xf82c('0x11d')],{'as':_0xf82c('0x11d'),'foreignKey':'userProfileId'});db[_0xf82c('0xf')][_0xf82c('0x11e')](db['ChatGroup'],{'as':_0xf82c('0x11f'),'through':_0xf82c('0x120')});db[_0xf82c('0xf')]['belongsToMany'](db[_0xf82c('0x6c')],{'as':_0xf82c('0x121'),'through':'cm_user_has_contacts'});db[_0xf82c('0xf')][_0xf82c('0x11e')](db['CmList'],{'as':'Lists','through':_0xf82c('0x122')});db[_0xf82c('0xf')][_0xf82c('0x11e')](db[_0xf82c('0x123')],{'through':_0xf82c('0x124')});db['User'][_0xf82c('0x11e')](db['MailInteraction'],{'as':_0xf82c('0x116'),'through':'user_has_mail_interactions'});db[_0xf82c('0xf')][_0xf82c('0x11e')](db[_0xf82c('0x62')],{'as':_0xf82c('0x125'),'through':_0xf82c('0x126')});db[_0xf82c('0xf')]['belongsToMany'](db[_0xf82c('0x46')],{'as':_0xf82c('0x127'),'through':_0xf82c('0x128')});db[_0xf82c('0xf')][_0xf82c('0x11e')](db[_0xf82c('0x129')],{'as':'SmsInteractions','through':_0xf82c('0x12a')});db[_0xf82c('0xf')][_0xf82c('0x11e')](db['OpenchannelInteraction'],{'as':_0xf82c('0x114'),'through':_0xf82c('0x12b')});db[_0xf82c('0xf')][_0xf82c('0x11e')](db[_0xf82c('0xf9')],{'as':_0xf82c('0x12c'),'through':_0xf82c('0x12d')});db[_0xf82c('0xf')]['belongsToMany'](db[_0xf82c('0x17')],{'as':_0xf82c('0x12e'),'through':_0xf82c('0x29'),'required':![]});db[_0xf82c('0xf')][_0xf82c('0x11e')](db[_0xf82c('0xef')],{'as':_0xf82c('0x12f'),'through':'UserVoicePrefix','required':![]});db[_0xf82c('0xf')]['belongsToMany'](db[_0xf82c('0x38')],{'as':_0xf82c('0x130'),'through':_0xf82c('0x2b'),'required':![]});db[_0xf82c('0xf')][_0xf82c('0x11e')](db[_0xf82c('0x131')],{'as':_0xf82c('0x132'),'through':_0xf82c('0x133'),'required':![],'hooks':!![]});db[_0xf82c('0xf')][_0xf82c('0x11e')](db[_0xf82c('0x49')],{'as':_0xf82c('0x134'),'through':_0xf82c('0x135'),'required':![]});db[_0xf82c('0xf')][_0xf82c('0x11e')](db[_0xf82c('0x52')],{'as':_0xf82c('0x136'),'through':_0xf82c('0x2d'),'required':![]});db['User'][_0xf82c('0x11e')](db[_0xf82c('0x5a')],{'as':'OpenchannelQueues','through':_0xf82c('0x2f'),'required':![]});db['User']['belongsToMany'](db[_0xf82c('0x137')],{'as':_0xf82c('0x138'),'through':_0xf82c('0x31'),'required':![]});db[_0xf82c('0xf')][_0xf82c('0x11e')](db[_0xf82c('0xee')],{'through':_0xf82c('0x122')});db['User']['belongsToMany'](db[_0xf82c('0x5c')],{'as':'ChatWebsites','through':_0xf82c('0x139')});db[_0xf82c('0xf')][_0xf82c('0x11e')](db[_0xf82c('0x13a')],{'as':_0xf82c('0x13b'),'through':_0xf82c('0x13c')});db[_0xf82c('0xf')]['belongsToMany'](db[_0xf82c('0x13d')],{'as':'MailAccounts','through':_0xf82c('0x13e')});db['User']['belongsToMany'](db[_0xf82c('0x54')],{'as':_0xf82c('0x13f'),'through':_0xf82c('0x140')});db[_0xf82c('0xf')][_0xf82c('0x11e')](db['SmsAccount'],{'as':'SmsAccounts','through':'user_has_sms_accounts'});db['User'][_0xf82c('0x11e')](db[_0xf82c('0xf5')],{'as':'WhatsappAccounts','through':'user_has_whatsapp_accounts'});db['VoiceChanSpy'][_0xf82c('0x10c')](db[_0xf82c('0x10f')],{'as':_0xf82c('0x141'),'onDelete':_0xf82c('0x108'),'foreignKey':_0xf82c('0x142')});db[_0xf82c('0x13')][_0xf82c('0x10c')](db[_0xf82c('0x10f')],{'onDelete':'cascade'});db['VoiceExtension'][_0xf82c('0x10c')](db[_0xf82c('0x10f')],{'as':_0xf82c('0x143'),'onDelete':'cascade'});db[_0xf82c('0x15')]['belongsToMany'](db[_0xf82c('0x84')],{'as':_0xf82c('0x144'),'through':_0xf82c('0x145')});db[_0xf82c('0x17')][_0xf82c('0x10c')](db['UserVoiceQueueRt'],{'as':_0xf82c('0x146'),'foreignKey':'VoiceQueueId'});db[_0xf82c('0x17')][_0xf82c('0x10c')](db['CmHopper'],{'as':_0xf82c('0x11b'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0xf82c('0x10c')](db[_0xf82c('0x71')],{'as':_0xf82c('0x111'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0xf82c('0x10c')](db['CmHopperHistory'],{'as':_0xf82c('0x147'),'foreignKey':_0xf82c('0x148')});db[_0xf82c('0x17')][_0xf82c('0x10c')](db[_0xf82c('0x112')],{'as':_0xf82c('0x112'),'foreignKey':'VoiceQueueId'});db[_0xf82c('0x17')][_0xf82c('0x10c')](db[_0xf82c('0x6f')],{'as':_0xf82c('0x149'),'foreignKey':'VoiceQueueId'});db[_0xf82c('0x17')][_0xf82c('0x10c')](db[_0xf82c('0xd1')],{'as':'JscriptySessions','foreignKey':_0xf82c('0x148')});db[_0xf82c('0x17')][_0xf82c('0x14a')](db[_0xf82c('0x26')],{'as':_0xf82c('0x26'),'foreignKey':_0xf82c('0x14b')});db[_0xf82c('0x17')][_0xf82c('0x14a')](db['Trunk'],{'as':_0xf82c('0x14c'),'foreignKey':_0xf82c('0x14d')});db['VoiceQueue'][_0xf82c('0x14a')](db[_0xf82c('0x7d')],{'as':_0xf82c('0x7d'),'foreignKey':_0xf82c('0x14e')});db['VoiceQueue']['belongsTo'](db[_0xf82c('0x7e')],{'as':'mandatoryDispositionPause','foreignKey':_0xf82c('0x14f')});db[_0xf82c('0x17')][_0xf82c('0x11e')](db[_0xf82c('0xee')],{'as':_0xf82c('0x150'),'through':_0xf82c('0x151')});db[_0xf82c('0x17')][_0xf82c('0x11e')](db['User'],{'as':_0xf82c('0x152'),'through':'UserVoiceQueue'});db[_0xf82c('0x17')][_0xf82c('0x11e')](db['Team'],{'as':_0xf82c('0x153'),'through':_0xf82c('0x102')});db[_0xf82c('0x17')][_0xf82c('0x11e')](db['CmList'],{'as':_0xf82c('0x154'),'through':_0xf82c('0x155')});db[_0xf82c('0x19')]['belongsTo'](db[_0xf82c('0xf')],{'as':'User','foreignKey':'UserId'});db[_0xf82c('0x1b')][_0xf82c('0x14a')](db['User'],{'as':'User','foreignKey':_0xf82c('0x109')});db['VoiceMail'][_0xf82c('0x10c')](db[_0xf82c('0x156')],{'as':'Messages','onDelete':_0xf82c('0x108'),'foreignKey':_0xf82c('0x157'),'sourceKey':'mailbox'});db[_0xf82c('0x156')][_0xf82c('0x14a')](db['VoiceMail'],{'foreignKey':'mailboxuser','targetKey':_0xf82c('0x158')});db['VoiceCallReport'][_0xf82c('0x10c')](db[_0xf82c('0x23')],{'as':_0xf82c('0x159'),'foreignKey':_0xf82c('0x15a'),'constraints':![]});db[_0xf82c('0x15b')][_0xf82c('0x10c')](db['VoiceAgentReport'],{'as':'AgentReports','foreignKey':_0xf82c('0x15a'),'constraints':![]});db['VoiceCallReport'][_0xf82c('0x14a')](db['User'],{'as':_0xf82c('0xf'),'foreignKey':_0xf82c('0x109')});db[_0xf82c('0x15b')][_0xf82c('0x14a')](db[_0xf82c('0x6c')],{'as':'Contact','foreignKey':_0xf82c('0x15c')});db[_0xf82c('0x33')]['belongsTo'](db[_0xf82c('0x13d')],{'as':'MailAccount','foreignKey':_0xf82c('0x15d')});db[_0xf82c('0x33')][_0xf82c('0x14a')](db['CloudProvider'],{'as':_0xf82c('0x101'),'foreignKey':'CloudProviderId','onDelete':_0xf82c('0x15e')});db['MailServerOut']['belongsTo'](db[_0xf82c('0x13d')],{'as':_0xf82c('0x13d'),'foreignKey':_0xf82c('0x15d')});db[_0xf82c('0x35')]['belongsTo'](db[_0xf82c('0x101')],{'as':_0xf82c('0x101'),'foreignKey':_0xf82c('0x15f'),'onDelete':'restrict'});db[_0xf82c('0x13d')]['hasOne'](db[_0xf82c('0x33')],{'as':_0xf82c('0x160'),'onDelete':_0xf82c('0x108')});db[_0xf82c('0x13d')]['hasOne'](db[_0xf82c('0x35')],{'as':_0xf82c('0x161'),'onDelete':_0xf82c('0x108')});db[_0xf82c('0x13d')]['hasMany'](db[_0xf82c('0x162')],{'as':_0xf82c('0x163'),'foreignKey':_0xf82c('0x15d'),'onDelete':_0xf82c('0x108')});db[_0xf82c('0x13d')][_0xf82c('0x10c')](db[_0xf82c('0x164')],{'as':_0xf82c('0x165'),'foreignKey':_0xf82c('0x15d')});db['MailAccount'][_0xf82c('0x10c')](db[_0xf82c('0x3c')],{'as':_0xf82c('0x166'),'foreignKey':_0xf82c('0x15d')});db[_0xf82c('0x13d')][_0xf82c('0x10c')](db['MailInteraction'],{'as':_0xf82c('0x167')});db[_0xf82c('0x13d')][_0xf82c('0x10c')](db[_0xf82c('0x3d')],{'as':_0xf82c('0x143'),'foreignKey':_0xf82c('0x15d'),'onDelete':'cascade'});db['MailAccount'][_0xf82c('0x14a')](db['CmList'],{'as':_0xf82c('0x168'),'foreignKey':'ListId'});db[_0xf82c('0x13d')][_0xf82c('0x14a')](db['Template'],{'as':_0xf82c('0x8d'),'foreignKey':_0xf82c('0x169')});db[_0xf82c('0x13d')][_0xf82c('0x14a')](db[_0xf82c('0x7e')],{'as':_0xf82c('0x16a'),'foreignKey':_0xf82c('0x14f')});db[_0xf82c('0x13d')][_0xf82c('0x11e')](db[_0xf82c('0xf')],{'as':_0xf82c('0x152'),'through':'user_has_mail_accounts'});db[_0xf82c('0x38')][_0xf82c('0x11e')](db['User'],{'as':'Agents','through':_0xf82c('0x2b')});db[_0xf82c('0x38')]['belongsToMany'](db[_0xf82c('0x123')],{'through':_0xf82c('0x16b'),'as':_0xf82c('0x153')});db[_0xf82c('0x3b')][_0xf82c('0x10c')](db[_0xf82c('0x3c')],{'as':_0xf82c('0x166'),'onDelete':_0xf82c('0x108'),'foreignKey':_0xf82c('0x16c')});db['MailInteraction'][_0xf82c('0x14a')](db['MailAccount'],{'as':_0xf82c('0x16d'),'foreignKey':_0xf82c('0x15d')});db[_0xf82c('0x3b')]['belongsTo'](db[_0xf82c('0x6c')],{'as':'Contact','foreignKey':_0xf82c('0x15c')});db['MailInteraction'][_0xf82c('0x14a')](db[_0xf82c('0xf')],{'as':'Owner','foreignKey':_0xf82c('0x109')});db[_0xf82c('0x3b')][_0xf82c('0x11e')](db[_0xf82c('0x86')],{'through':_0xf82c('0x16e'),'as':_0xf82c('0x16f')});db[_0xf82c('0x3b')][_0xf82c('0x11e')](db[_0xf82c('0x86')],{'through':_0xf82c('0x16e'),'as':_0xf82c('0x170')});db[_0xf82c('0x3b')][_0xf82c('0x11e')](db[_0xf82c('0xf')],{'as':_0xf82c('0x171'),'through':_0xf82c('0x172'),'foreignKey':_0xf82c('0x16c')});db[_0xf82c('0x3c')][_0xf82c('0x10c')](db[_0xf82c('0xe3')],{'as':_0xf82c('0x173'),'onDelete':_0xf82c('0x108')});db['MailMessage'][_0xf82c('0x14a')](db[_0xf82c('0xf')],{'as':_0xf82c('0xf')});db[_0xf82c('0x3c')][_0xf82c('0x14a')](db[_0xf82c('0x6c')],{'onDelete':_0xf82c('0x108'),'as':'Contact'});db['MailMessage']['belongsTo'](db['MailInteraction'],{'as':_0xf82c('0x174'),'foreignKey':'MailInteractionId'});db[_0xf82c('0x3c')][_0xf82c('0x14a')](db[_0xf82c('0x13d')],{'as':'Account','foreignKey':_0xf82c('0x15d')});db['MailMessage'][_0xf82c('0x14a')](db[_0xf82c('0x5c')],{'as':'ChatWebsite','foreignKey':_0xf82c('0x175')});db[_0xf82c('0x3c')][_0xf82c('0x14a')](db[_0xf82c('0x176')],{'as':_0xf82c('0x176'),'foreignKey':_0xf82c('0x177')});db[_0xf82c('0x3d')][_0xf82c('0x14a')](db['User'],{'onDelete':'restrict'});db[_0xf82c('0x3d')][_0xf82c('0x14a')](db['MailQueue'],{'onDelete':'restrict'});db[_0xf82c('0x3d')]['belongsTo'](db[_0xf82c('0x13d')],{'onDelete':'restrict'});db[_0xf82c('0x3d')][_0xf82c('0x14a')](db[_0xf82c('0x7d')],{'onDelete':'restrict','foreignKey':_0xf82c('0x14e')});db['MailApplication'][_0xf82c('0x14a')](db['Tag'],{'onDelete':_0xf82c('0x15e'),'foreignKey':_0xf82c('0x178')});db[_0xf82c('0x3e')]['belongsTo'](db[_0xf82c('0x13d')],{});db['MailQueueReport'][_0xf82c('0x14a')](db[_0xf82c('0xee')],{'as':_0xf82c('0x168'),'foreignKey':_0xf82c('0x179')});db[_0xf82c('0x3e')][_0xf82c('0x14a')](db[_0xf82c('0x6c')],{'as':_0xf82c('0x17a'),'foreignKey':_0xf82c('0x15c')});db[_0xf82c('0x3e')]['belongsTo'](db[_0xf82c('0x3b')],{});db['MailQueueReport'][_0xf82c('0x14a')](db['MailMessage'],{});db['MailQueueReport']['belongsTo'](db[_0xf82c('0xf')],{});db[_0xf82c('0x3e')][_0xf82c('0x14a')](db['MailQueue'],{});db[_0xf82c('0x40')]['hasMany'](db[_0xf82c('0x17b')],{'as':_0xf82c('0x17c'),'onDelete':_0xf82c('0x108')});db[_0xf82c('0x13a')][_0xf82c('0x10c')](db['Disposition'],{'as':_0xf82c('0x163'),'foreignKey':_0xf82c('0x17d'),'onDelete':_0xf82c('0x108')});db[_0xf82c('0x13a')][_0xf82c('0x10c')](db[_0xf82c('0x164')],{'as':'Answers','foreignKey':_0xf82c('0x17d')});db[_0xf82c('0x13a')]['hasMany'](db['FaxInteraction'],{'as':'Interactions'});db['FaxAccount']['hasMany'](db[_0xf82c('0x44')],{'as':'Applications','foreignKey':_0xf82c('0x17d'),'onDelete':'cascade'});db[_0xf82c('0x13a')][_0xf82c('0x10c')](db['VoiceExtension'],{'as':'Exntensions','onDelete':_0xf82c('0x108')});db[_0xf82c('0x13a')][_0xf82c('0x10c')](db[_0xf82c('0x17e')],{'as':'Messages'});db[_0xf82c('0x13a')][_0xf82c('0x14a')](db[_0xf82c('0x26')],{'as':_0xf82c('0x26')});db['FaxAccount'][_0xf82c('0x14a')](db[_0xf82c('0xee')],{'as':_0xf82c('0x168'),'foreignKey':_0xf82c('0x179')});db[_0xf82c('0x13a')][_0xf82c('0x14a')](db['Pause'],{'as':_0xf82c('0x16a'),'foreignKey':_0xf82c('0x14f')});db[_0xf82c('0x13a')]['belongsToMany'](db[_0xf82c('0xf')],{'as':_0xf82c('0x152'),'through':_0xf82c('0x13c')});db[_0xf82c('0x44')][_0xf82c('0x14a')](db[_0xf82c('0xf')],{'onDelete':_0xf82c('0x15e')});db[_0xf82c('0x44')]['belongsTo'](db[_0xf82c('0x49')],{'onDelete':_0xf82c('0x15e')});db[_0xf82c('0x44')][_0xf82c('0x14a')](db[_0xf82c('0x13a')],{'onDelete':'restrict'});db[_0xf82c('0x44')][_0xf82c('0x14a')](db['Tag'],{'onDelete':'restrict','foreignKey':'TagId'});db[_0xf82c('0x46')]['hasMany'](db[_0xf82c('0x17e')],{'as':_0xf82c('0x166'),'onDelete':_0xf82c('0x108'),'foreignKey':_0xf82c('0x17f')});db['FaxInteraction'][_0xf82c('0x14a')](db[_0xf82c('0x13a')],{'as':_0xf82c('0x16d'),'foreignKey':_0xf82c('0x17d')});db[_0xf82c('0x46')][_0xf82c('0x14a')](db[_0xf82c('0x6c')],{'as':_0xf82c('0x17a'),'foreignKey':_0xf82c('0x15c')});db[_0xf82c('0x46')][_0xf82c('0x14a')](db[_0xf82c('0xf')],{'as':_0xf82c('0x180'),'foreignKey':_0xf82c('0x109')});db['FaxInteraction'][_0xf82c('0x11e')](db[_0xf82c('0x86')],{'through':_0xf82c('0x181'),'as':_0xf82c('0x16f')});db[_0xf82c('0x46')][_0xf82c('0x11e')](db['Tag'],{'through':_0xf82c('0x181'),'as':_0xf82c('0x170')});db['FaxInteraction'][_0xf82c('0x11e')](db[_0xf82c('0xf')],{'as':_0xf82c('0x171'),'through':_0xf82c('0x128'),'foreignKey':_0xf82c('0x17f')});db[_0xf82c('0x17e')][_0xf82c('0x14a')](db[_0xf82c('0xf')],{'onDelete':'cascade','as':'User'});db[_0xf82c('0x17e')][_0xf82c('0x14a')](db['FaxInteraction'],{'as':_0xf82c('0x174'),'foreignKey':_0xf82c('0x17f')});db[_0xf82c('0x17e')][_0xf82c('0x14a')](db['CmContact'],{'onDelete':_0xf82c('0x108'),'as':_0xf82c('0x17a')});db[_0xf82c('0x17e')][_0xf82c('0x14a')](db['Attachment'],{'as':_0xf82c('0xe3'),'foreignKey':_0xf82c('0x182')});db['FaxMessage']['belongsTo'](db[_0xf82c('0x13a')],{'as':_0xf82c('0x16d'),'foreignKey':_0xf82c('0x17d')});db[_0xf82c('0x49')][_0xf82c('0x11e')](db[_0xf82c('0xf')],{'as':_0xf82c('0x152'),'through':_0xf82c('0x135')});db[_0xf82c('0x49')][_0xf82c('0x11e')](db['Team'],{'through':_0xf82c('0x183'),'as':_0xf82c('0x153')});db[_0xf82c('0x4a')][_0xf82c('0x14a')](db[_0xf82c('0x13a')],{});db['FaxQueueReport'][_0xf82c('0x14a')](db['CmList'],{'as':_0xf82c('0x168'),'foreignKey':_0xf82c('0x179')});db[_0xf82c('0x4a')][_0xf82c('0x14a')](db[_0xf82c('0x6c')],{'as':_0xf82c('0x17a'),'foreignKey':_0xf82c('0x15c')});db[_0xf82c('0x4a')][_0xf82c('0x14a')](db[_0xf82c('0x46')],{});db[_0xf82c('0x4a')]['belongsTo'](db[_0xf82c('0x17e')],{});db['FaxQueueReport'][_0xf82c('0x14a')](db[_0xf82c('0xf')],{});db[_0xf82c('0x4a')][_0xf82c('0x14a')](db[_0xf82c('0x49')],{});db[_0xf82c('0x4c')][_0xf82c('0x10c')](db[_0xf82c('0x162')],{'as':_0xf82c('0x163'),'foreignKey':_0xf82c('0x184'),'onDelete':'cascade'});db[_0xf82c('0x4c')]['hasMany'](db[_0xf82c('0x164')],{'as':'Answers','foreignKey':'SmsAccountId'});db[_0xf82c('0x4c')][_0xf82c('0x10c')](db[_0xf82c('0x50')],{'as':'Messages','foreignKey':_0xf82c('0x184')});db[_0xf82c('0x4c')][_0xf82c('0x10c')](db['SmsInteraction'],{'as':_0xf82c('0x167')});db[_0xf82c('0x4c')][_0xf82c('0x10c')](db[_0xf82c('0x4d')],{'as':'Applications','foreignKey':_0xf82c('0x184'),'onDelete':_0xf82c('0x108')});db[_0xf82c('0x4c')][_0xf82c('0x14a')](db['CmList'],{'as':_0xf82c('0x168'),'foreignKey':_0xf82c('0x179')});db[_0xf82c('0x4c')]['belongsTo'](db[_0xf82c('0x7e')],{'as':_0xf82c('0x16a'),'foreignKey':_0xf82c('0x14f')});db[_0xf82c('0x4c')][_0xf82c('0x11e')](db[_0xf82c('0xf')],{'as':_0xf82c('0x152'),'through':_0xf82c('0x185')});db['SmsApplication']['belongsTo'](db[_0xf82c('0xf')],{'onDelete':_0xf82c('0x15e')});db[_0xf82c('0x4d')][_0xf82c('0x14a')](db[_0xf82c('0x52')],{'onDelete':_0xf82c('0x15e')});db['SmsApplication'][_0xf82c('0x14a')](db[_0xf82c('0x4c')],{'onDelete':_0xf82c('0x15e')});db[_0xf82c('0x4d')][_0xf82c('0x14a')](db[_0xf82c('0x7d')],{'onDelete':_0xf82c('0x15e'),'foreignKey':_0xf82c('0x14e')});db[_0xf82c('0x4d')]['belongsTo'](db[_0xf82c('0x86')],{'onDelete':_0xf82c('0x15e'),'foreignKey':'TagId'});db['SmsInteraction'][_0xf82c('0x10c')](db[_0xf82c('0x50')],{'as':_0xf82c('0x166'),'onDelete':_0xf82c('0x108'),'foreignKey':_0xf82c('0x186')});db['SmsInteraction'][_0xf82c('0x14a')](db[_0xf82c('0x4c')],{'as':_0xf82c('0x16d'),'foreignKey':_0xf82c('0x184')});db[_0xf82c('0x129')][_0xf82c('0x14a')](db['CmContact'],{'as':_0xf82c('0x17a'),'foreignKey':_0xf82c('0x15c')});db[_0xf82c('0x129')][_0xf82c('0x14a')](db[_0xf82c('0xf')],{'as':'Owner','foreignKey':'UserId'});db[_0xf82c('0x129')][_0xf82c('0x11e')](db[_0xf82c('0x86')],{'through':_0xf82c('0x187'),'as':'Tags'});db[_0xf82c('0x129')]['belongsToMany'](db[_0xf82c('0x86')],{'through':'sms_interaction_has_tags','as':_0xf82c('0x170')});db[_0xf82c('0x129')][_0xf82c('0x11e')](db[_0xf82c('0xf')],{'as':_0xf82c('0x171'),'through':_0xf82c('0x12a'),'foreignKey':_0xf82c('0x186')});db[_0xf82c('0x50')]['belongsTo'](db['User'],{'as':_0xf82c('0xf')});db[_0xf82c('0x50')][_0xf82c('0x14a')](db[_0xf82c('0x6c')],{'onDelete':_0xf82c('0x108'),'as':_0xf82c('0x17a')});db['SmsMessage'][_0xf82c('0x14a')](db['SmsInteraction'],{'onDelete':_0xf82c('0x108'),'as':_0xf82c('0x174'),'foreignKey':_0xf82c('0x186')});db['SmsMessage'][_0xf82c('0x14a')](db[_0xf82c('0x4c')],{'as':_0xf82c('0x16d'),'foreignKey':'SmsAccountId'});db['SmsQueue'][_0xf82c('0x11e')](db[_0xf82c('0xf')],{'as':'Agents','through':'UserSmsQueue','foreignKey':'SmsQueueId'});db['SmsQueue'][_0xf82c('0x11e')](db[_0xf82c('0x123')],{'through':_0xf82c('0x188'),'as':_0xf82c('0x153')});db['OpenchannelAccount'][_0xf82c('0x10c')](db[_0xf82c('0x162')],{'as':_0xf82c('0x163'),'foreignKey':_0xf82c('0x189'),'onDelete':_0xf82c('0x108')});db[_0xf82c('0x54')]['hasMany'](db['CannedAnswer'],{'as':_0xf82c('0x165'),'foreignKey':'OpenchannelAccountId'});db[_0xf82c('0x54')][_0xf82c('0x10c')](db['OpenchannelInteraction'],{'as':_0xf82c('0x167'),'foreignKey':_0xf82c('0x189')});db[_0xf82c('0x54')][_0xf82c('0x10c')](db[_0xf82c('0x58')],{'as':'Messages','foreignKey':'OpenchannelAccountId'});db[_0xf82c('0x54')][_0xf82c('0x10c')](db['OpenchannelApplication'],{'as':_0xf82c('0x143'),'foreignKey':_0xf82c('0x189'),'onDelete':'cascade'});db['OpenchannelAccount']['belongsTo'](db['CmList'],{'as':_0xf82c('0x168'),'foreignKey':_0xf82c('0x179')});db[_0xf82c('0x54')]['belongsTo'](db[_0xf82c('0x7e')],{'as':'mandatoryDispositionPause','foreignKey':_0xf82c('0x14f')});db[_0xf82c('0x54')][_0xf82c('0x11e')](db['User'],{'as':_0xf82c('0x152'),'through':_0xf82c('0x140')});db[_0xf82c('0x56')]['belongsTo'](db[_0xf82c('0xf')],{'onDelete':_0xf82c('0x15e')});db[_0xf82c('0x56')]['belongsTo'](db[_0xf82c('0x5a')],{'onDelete':_0xf82c('0x15e'),'foreignKey':_0xf82c('0x18a')});db['OpenchannelApplication'][_0xf82c('0x14a')](db['OpenchannelAccount'],{'onDelete':_0xf82c('0x15e'),'foreignKey':_0xf82c('0x189')});db[_0xf82c('0x56')][_0xf82c('0x14a')](db[_0xf82c('0x7d')],{'onDelete':_0xf82c('0x15e'),'foreignKey':_0xf82c('0x14e')});db[_0xf82c('0x56')][_0xf82c('0x14a')](db[_0xf82c('0x86')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0xf82c('0x113')][_0xf82c('0x10c')](db[_0xf82c('0x58')],{'as':_0xf82c('0x166'),'onDelete':_0xf82c('0x108'),'foreignKey':_0xf82c('0x18b')});db[_0xf82c('0x113')][_0xf82c('0x14a')](db[_0xf82c('0x54')],{'as':'Account','foreignKey':_0xf82c('0x189')});db[_0xf82c('0x113')][_0xf82c('0x14a')](db[_0xf82c('0x6c')],{'as':_0xf82c('0x17a'),'foreignKey':_0xf82c('0x15c')});db[_0xf82c('0x113')][_0xf82c('0x14a')](db[_0xf82c('0xf')],{'as':_0xf82c('0x180'),'foreignKey':'UserId'});db[_0xf82c('0x113')]['belongsToMany'](db['Tag'],{'through':_0xf82c('0x18c'),'as':_0xf82c('0x16f')});db[_0xf82c('0x113')][_0xf82c('0x11e')](db[_0xf82c('0x86')],{'through':_0xf82c('0x18c'),'as':_0xf82c('0x170')});db[_0xf82c('0x113')]['belongsToMany'](db[_0xf82c('0xf')],{'as':_0xf82c('0x171'),'through':_0xf82c('0x12b'),'foreignKey':_0xf82c('0x18b')});db[_0xf82c('0x58')][_0xf82c('0x14a')](db[_0xf82c('0xf')],{'onDelete':_0xf82c('0x108'),'as':_0xf82c('0xf')});db['OpenchannelMessage'][_0xf82c('0x14a')](db['CmContact'],{'onDelete':_0xf82c('0x108'),'as':_0xf82c('0x17a')});db[_0xf82c('0x58')][_0xf82c('0x14a')](db[_0xf82c('0x113')],{'onDelete':_0xf82c('0x108'),'as':_0xf82c('0x174'),'foreignKey':'OpenchannelInteractionId'});db[_0xf82c('0x58')][_0xf82c('0x14a')](db[_0xf82c('0xe3')],{'as':_0xf82c('0xe3'),'foreignKey':'AttachmentId'});db[_0xf82c('0x58')][_0xf82c('0x14a')](db['OpenchannelAccount'],{'as':'Account','foreignKey':_0xf82c('0x189')});db['OpenchannelQueue'][_0xf82c('0x11e')](db[_0xf82c('0xf')],{'as':'Agents','through':_0xf82c('0x2f'),'foreignKey':_0xf82c('0x18a')});db[_0xf82c('0x5a')][_0xf82c('0x11e')](db[_0xf82c('0x123')],{'through':_0xf82c('0x18d'),'as':_0xf82c('0x153')});db[_0xf82c('0x5c')][_0xf82c('0x10c')](db[_0xf82c('0x162')],{'as':_0xf82c('0x163'),'foreignKey':_0xf82c('0x175'),'onDelete':_0xf82c('0x108')});db[_0xf82c('0x5c')][_0xf82c('0x10c')](db[_0xf82c('0x164')],{'as':_0xf82c('0x165'),'foreignKey':_0xf82c('0x175')});db['ChatWebsite']['hasMany'](db[_0xf82c('0x69')],{'as':_0xf82c('0x18e')});db['ChatWebsite'][_0xf82c('0x10c')](db[_0xf82c('0x62')],{'as':_0xf82c('0x167')});db[_0xf82c('0x5c')][_0xf82c('0x10c')](db[_0xf82c('0x60')],{'as':_0xf82c('0x143'),'foreignKey':_0xf82c('0x175'),'onDelete':_0xf82c('0x108')});db[_0xf82c('0x5c')][_0xf82c('0x10c')](db[_0xf82c('0x64')],{'as':_0xf82c('0x166')});db[_0xf82c('0x5c')]['belongsTo'](db[_0xf82c('0xee')],{'as':_0xf82c('0x168'),'foreignKey':_0xf82c('0x179')});db['ChatWebsite'][_0xf82c('0x14a')](db['Interval'],{'as':_0xf82c('0x7d'),'foreignKey':_0xf82c('0x14e')});db['ChatWebsite'][_0xf82c('0x14a')](db['MailAccount'],{'as':_0xf82c('0x13d'),'foreignKey':_0xf82c('0x15d')});db[_0xf82c('0x5c')][_0xf82c('0x14a')](db[_0xf82c('0x7e')],{'as':_0xf82c('0x16a'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xf82c('0x5c')][_0xf82c('0x11e')](db[_0xf82c('0xf')],{'as':_0xf82c('0x152'),'through':_0xf82c('0x139')});db[_0xf82c('0x5e')][_0xf82c('0x14a')](db[_0xf82c('0x54')],{});db[_0xf82c('0x5e')][_0xf82c('0x14a')](db['CmList'],{'as':_0xf82c('0x168'),'foreignKey':_0xf82c('0x179')});db['OpenchannelQueueReport']['belongsTo'](db['CmContact'],{'as':_0xf82c('0x17a'),'foreignKey':_0xf82c('0x15c')});db[_0xf82c('0x5e')][_0xf82c('0x14a')](db[_0xf82c('0x113')],{});db[_0xf82c('0x5e')][_0xf82c('0x14a')](db[_0xf82c('0x58')],{});db['OpenchannelQueueReport'][_0xf82c('0x14a')](db[_0xf82c('0xf')],{});db[_0xf82c('0x5e')][_0xf82c('0x14a')](db[_0xf82c('0x5a')],{});db['ChatApplication'][_0xf82c('0x14a')](db[_0xf82c('0xf')],{'as':'Agent','foreignKey':_0xf82c('0x109'),'onDelete':_0xf82c('0x15e')});db[_0xf82c('0x60')]['belongsTo'](db[_0xf82c('0x131')],{'as':_0xf82c('0x18f'),'foreignKey':_0xf82c('0x190'),'onDelete':_0xf82c('0x15e')});db[_0xf82c('0x60')][_0xf82c('0x14a')](db[_0xf82c('0x5c')],{'as':_0xf82c('0x191'),'foreignKey':'ChatWebsiteId','onDelete':_0xf82c('0x15e')});db[_0xf82c('0x60')]['belongsTo'](db[_0xf82c('0x86')],{'onDelete':'restrict','foreignKey':_0xf82c('0x178')});db['ChatInteraction'][_0xf82c('0x10c')](db['ChatMessage'],{'as':_0xf82c('0x166'),'onDelete':_0xf82c('0x108'),'foreignKey':_0xf82c('0x192')});db['ChatInteraction'][_0xf82c('0x14a')](db['ChatWebsite'],{'as':'Account','foreignKey':_0xf82c('0x175')});db[_0xf82c('0x62')][_0xf82c('0x14a')](db['CmContact'],{'as':_0xf82c('0x17a'),'foreignKey':_0xf82c('0x15c')});db[_0xf82c('0x62')][_0xf82c('0x14a')](db[_0xf82c('0xf')],{'as':_0xf82c('0x180'),'foreignKey':_0xf82c('0x109')});db[_0xf82c('0x62')][_0xf82c('0x11e')](db['Tag'],{'through':'chat_interaction_has_tags','as':_0xf82c('0x16f')});db[_0xf82c('0x62')]['belongsToMany'](db[_0xf82c('0x86')],{'through':_0xf82c('0x193'),'as':_0xf82c('0x170')});db['ChatInteraction'][_0xf82c('0x11e')](db[_0xf82c('0xf')],{'as':'Users','through':'user_has_chat_interactions','foreignKey':'ChatInteractionId'});db[_0xf82c('0x64')][_0xf82c('0x14a')](db[_0xf82c('0xf')],{'onDelete':_0xf82c('0x108'),'as':'User'});db[_0xf82c('0x64')]['belongsTo'](db[_0xf82c('0x6c')],{'onDelete':_0xf82c('0x108'),'as':_0xf82c('0x17a'),'foreignKey':_0xf82c('0x15c')});db[_0xf82c('0x64')][_0xf82c('0x14a')](db[_0xf82c('0x62')],{'onDelete':_0xf82c('0x108'),'as':_0xf82c('0x174'),'foreignKey':_0xf82c('0x192')});db['ChatMessage'][_0xf82c('0x14a')](db[_0xf82c('0xe3')],{'as':_0xf82c('0xe3'),'foreignKey':_0xf82c('0x182')});db[_0xf82c('0x64')]['belongsTo'](db[_0xf82c('0x5c')],{'as':_0xf82c('0x16d'),'foreignKey':_0xf82c('0x175')});db[_0xf82c('0x176')][_0xf82c('0x10c')](db[_0xf82c('0xe3')],{'as':_0xf82c('0x173'),'foreignKey':_0xf82c('0x177'),'onDelete':_0xf82c('0x108'),'hooks':!![]});db[_0xf82c('0x176')]['belongsTo'](db['CmContact'],{'onDelete':_0xf82c('0x108'),'as':_0xf82c('0x17a'),'foreignKey':'ContactId'});db[_0xf82c('0x176')][_0xf82c('0x14a')](db[_0xf82c('0x5c')],{'as':'Account','foreignKey':_0xf82c('0x175')});db['ChatQueue'][_0xf82c('0x11e')](db[_0xf82c('0xf')],{'as':_0xf82c('0x152'),'through':_0xf82c('0x133'),'hooks':!![]});db[_0xf82c('0x131')]['belongsToMany'](db['Team'],{'through':_0xf82c('0x194'),'as':'Teams'});db[_0xf82c('0x67')][_0xf82c('0x10c')](db[_0xf82c('0xcd')],{'as':_0xf82c('0x166'),'foreignKey':_0xf82c('0x195'),'onDelete':_0xf82c('0x108')});db[_0xf82c('0x67')][_0xf82c('0x11e')](db[_0xf82c('0xf')],{'as':_0xf82c('0x146'),'through':_0xf82c('0x120')});db[_0xf82c('0x69')]['belongsTo'](db[_0xf82c('0x5c')],{'as':'Website','foreignKey':_0xf82c('0x175')});db[_0xf82c('0x6b')][_0xf82c('0x10c')](db['CmContact'],{'as':_0xf82c('0x121'),'foreignKey':_0xf82c('0x196')});db[_0xf82c('0x6c')]['hasMany'](db[_0xf82c('0x8a')],{'as':'Phones','foreignKey':'CmContactId'});db[_0xf82c('0x6c')][_0xf82c('0x10c')](db[_0xf82c('0x11a')],{'as':_0xf82c('0x11b'),'foreignKey':_0xf82c('0x15c')});db['CmContact'][_0xf82c('0x10c')](db[_0xf82c('0x71')],{'as':_0xf82c('0x111'),'foreignKey':_0xf82c('0x15c')});db[_0xf82c('0x6c')][_0xf82c('0x10c')](db[_0xf82c('0x73')],{'as':_0xf82c('0x147'),'foreignKey':'ContactId'});db['CmContact'][_0xf82c('0x10c')](db[_0xf82c('0x112')],{'as':'ReportAgentPreview','foreignKey':_0xf82c('0x15c')});db[_0xf82c('0x6c')]['hasMany'](db['JscriptySessionReport'],{'as':_0xf82c('0x197'),'foreignKey':_0xf82c('0x15c')});db[_0xf82c('0x6c')][_0xf82c('0x10c')](db[_0xf82c('0x113')],{'as':_0xf82c('0x114'),'foreignKey':'ContactId','onDelete':_0xf82c('0x15e')});db[_0xf82c('0x6c')][_0xf82c('0x10c')](db[_0xf82c('0x62')],{'as':_0xf82c('0x125'),'foreignKey':'ContactId','onDelete':_0xf82c('0x15e')});db[_0xf82c('0x6c')][_0xf82c('0x10c')](db[_0xf82c('0x129')],{'as':'SmsInteractions','foreignKey':_0xf82c('0x15c'),'onDelete':_0xf82c('0x15e')});db[_0xf82c('0x6c')][_0xf82c('0x10c')](db[_0xf82c('0x46')],{'as':'FaxInteractions','foreignKey':_0xf82c('0x15c'),'onDelete':_0xf82c('0x15e')});db['CmContact'][_0xf82c('0x10c')](db[_0xf82c('0x3b')],{'as':_0xf82c('0x116'),'foreignKey':_0xf82c('0x15c'),'onDelete':_0xf82c('0x15e')});db[_0xf82c('0x6c')]['belongsTo'](db[_0xf82c('0x6b')],{'as':_0xf82c('0x198'),'foreignKey':'CompanyId'});db[_0xf82c('0x6c')][_0xf82c('0x14a')](db[_0xf82c('0xee')],{'as':'List','foreignKey':_0xf82c('0x179'),'onDelete':_0xf82c('0x108')});db[_0xf82c('0x6c')][_0xf82c('0x11e')](db[_0xf82c('0xf')],{'as':'Users','through':_0xf82c('0x199')});db[_0xf82c('0x6c')][_0xf82c('0x11e')](db['Tag'],{'as':'Tags','through':_0xf82c('0x19a')});db['CmContact'][_0xf82c('0x11e')](db[_0xf82c('0x86')],{'through':'cm_contact_has_tags','as':_0xf82c('0x170')});db[_0xf82c('0x11a')][_0xf82c('0x10c')](db[_0xf82c('0x19b')],{'as':'AdditionalPhones','foreignKey':'CmHopperId'});db[_0xf82c('0x11a')][_0xf82c('0x14a')](db['CmContact'],{'as':_0xf82c('0x17a'),'foreignKey':'ContactId','onDelete':_0xf82c('0x108')});db[_0xf82c('0x11a')]['belongsTo'](db[_0xf82c('0xee')],{'as':_0xf82c('0x168'),'foreignKey':'ListId','onDelete':_0xf82c('0x108')});db['CmHopper'][_0xf82c('0x14a')](db['User'],{'as':_0xf82c('0x19c'),'foreignKey':_0xf82c('0x109')});db[_0xf82c('0x11a')][_0xf82c('0x14a')](db['VoiceQueue'],{'as':_0xf82c('0x18f'),'foreignKey':'VoiceQueueId','onDelete':_0xf82c('0x108')});db['CmHopper']['belongsTo'](db[_0xf82c('0xe0')],{'as':_0xf82c('0xe0'),'foreignKey':'CampaignId','onDelete':_0xf82c('0x108')});db[_0xf82c('0x11a')][_0xf82c('0x14a')](db[_0xf82c('0xf')],{'as':_0xf82c('0x180'),'foreignKey':'OwnerId'});db['CmHopperBlack']['belongsTo'](db['CmContact'],{'as':_0xf82c('0x17a'),'foreignKey':_0xf82c('0x15c'),'onDelete':_0xf82c('0x108')});db[_0xf82c('0x6f')][_0xf82c('0x14a')](db[_0xf82c('0xee')],{'as':_0xf82c('0x168'),'foreignKey':_0xf82c('0x179'),'onDelete':_0xf82c('0x108')});db[_0xf82c('0x6f')][_0xf82c('0x14a')](db[_0xf82c('0x17')],{'as':_0xf82c('0x18f'),'foreignKey':'VoiceQueueId','onDelete':_0xf82c('0x108')});db[_0xf82c('0x6f')][_0xf82c('0x14a')](db['Campaign'],{'as':_0xf82c('0xe0'),'foreignKey':'CampaignId','onDelete':_0xf82c('0x108')});db[_0xf82c('0x78')][_0xf82c('0x10c')](db[_0xf82c('0x7b')],{'as':{'plural':_0xf82c('0x19d'),'singular':_0xf82c('0x19e')},'foreignKey':'AutomationAllId','onDelete':_0xf82c('0x108'),'hooks':!![]});db[_0xf82c('0x78')]['hasMany'](db[_0xf82c('0x7b')],{'as':{'plural':_0xf82c('0x19f'),'singular':_0xf82c('0x1a0')},'foreignKey':_0xf82c('0x1a1'),'onDelete':_0xf82c('0x108'),'hooks':!![]});db['Automation'][_0xf82c('0x10c')](db[_0xf82c('0x76')],{'as':'Actions','foreignKey':_0xf82c('0x1a2'),'onDelete':_0xf82c('0x108'),'hooks':!![]});db[_0xf82c('0x162')][_0xf82c('0x10c')](db[_0xf82c('0x162')],{'as':'Dispositions','foreignKey':_0xf82c('0x1a3'),'onDelete':_0xf82c('0x108')});db[_0xf82c('0x7d')]['hasMany'](db[_0xf82c('0x7d')],{'as':_0xf82c('0x1a4'),'foreignKey':'IntervalId','onDelete':_0xf82c('0x108'),'hooks':!![],'required':![]});db[_0xf82c('0x7d')][_0xf82c('0x10c')](db['VoiceExtension'],{'as':_0xf82c('0x110'),'foreignKey':_0xf82c('0x14e'),'onDelete':'restrict'});db[_0xf82c('0x7d')]['hasMany'](db[_0xf82c('0x3d')],{'as':_0xf82c('0x1a5'),'foreignKey':_0xf82c('0x14e')});db[_0xf82c('0x7d')][_0xf82c('0x10c')](db[_0xf82c('0x60')],{'as':_0xf82c('0x1a6'),'foreignKey':_0xf82c('0x14e')});db['Interval'][_0xf82c('0x10c')](db['FaxApplication'],{'as':_0xf82c('0x1a7'),'foreignKey':_0xf82c('0x14e')});db[_0xf82c('0x7d')]['hasMany'](db[_0xf82c('0x4d')],{'as':'SmsApplications','foreignKey':_0xf82c('0x14e')});db[_0xf82c('0x1a8')]['belongsTo'](db[_0xf82c('0x13d')],{});db[_0xf82c('0x1a8')]['belongsTo'](db[_0xf82c('0x96')],{'foreignKey':_0xf82c('0x1a9')});db[_0xf82c('0x1a8')]['belongsTo'](db[_0xf82c('0x94')],{'foreignKey':_0xf82c('0x1aa')});db[_0xf82c('0x84')][_0xf82c('0x11e')](db[_0xf82c('0x15')],{'as':_0xf82c('0x1ab'),'through':'moh_has_sounds','onDelete':_0xf82c('0x15e')});db[_0xf82c('0x86')][_0xf82c('0x11e')](db[_0xf82c('0x6c')],{'through':_0xf82c('0x19a')});db['Tag'][_0xf82c('0x11e')](db[_0xf82c('0x62')],{'through':_0xf82c('0x193')});db[_0xf82c('0x86')][_0xf82c('0x11e')](db[_0xf82c('0x3b')],{'through':'mail_interaction_has_tags'});db[_0xf82c('0x86')][_0xf82c('0x11e')](db['SmsInteraction'],{'through':_0xf82c('0x187')});db[_0xf82c('0x86')][_0xf82c('0x11e')](db[_0xf82c('0x46')],{'through':_0xf82c('0x181')});db['Tag'][_0xf82c('0x11e')](db[_0xf82c('0x113')],{'through':'openchannel_interaction_has_tags'});db['Tag'][_0xf82c('0x11e')](db['WhatsappInteraction'],{'through':_0xf82c('0x1ac')});db[_0xf82c('0x8a')]['belongsTo'](db['ContactItemType'],{'as':'ItemType','foreignKey':_0xf82c('0x1ad')});db[_0xf82c('0x19b')][_0xf82c('0x14a')](db['CmHopper'],{'as':'Hopper','foreignKey':_0xf82c('0x1ae')});db[_0xf82c('0x8a')]['belongsTo'](db[_0xf82c('0x6c')],{'as':_0xf82c('0x17a'),'foreignKey':'CmContactId'});db[_0xf82c('0x8f')][_0xf82c('0x10c')](db[_0xf82c('0x7b')],{'as':{'plural':_0xf82c('0x1af'),'singular':'AllCondition'},'foreignKey':_0xf82c('0x1b0'),'onDelete':'cascade','hooks':!![]});db['Trigger'][_0xf82c('0x10c')](db[_0xf82c('0x7b')],{'as':{'plural':_0xf82c('0x1b1'),'singular':_0xf82c('0x1b2')},'foreignKey':_0xf82c('0x1b3'),'onDelete':_0xf82c('0x108'),'hooks':!![]});db['Trigger'][_0xf82c('0x10c')](db[_0xf82c('0x76')],{'as':_0xf82c('0x1b4'),'foreignKey':_0xf82c('0x1b5'),'onDelete':_0xf82c('0x108'),'hooks':!![]});db[_0xf82c('0x94')][_0xf82c('0x10c')](db['AnalyticFieldReport'],{'as':_0xf82c('0x1b6'),'onDelete':_0xf82c('0x108'),'foreignKey':_0xf82c('0x1aa'),'hooks':!![]});db[_0xf82c('0x96')]['hasMany'](db[_0xf82c('0x9b')],{'as':_0xf82c('0x1b6'),'onDelete':_0xf82c('0x108'),'foreignKey':'DefaultReportId'});db[_0xf82c('0x99')][_0xf82c('0x10c')](db[_0xf82c('0x9b')],{'as':_0xf82c('0x1b6'),'onDelete':_0xf82c('0x108'),'foreignKey':_0xf82c('0x1b7')});db[_0xf82c('0x9b')][_0xf82c('0x14a')](db[_0xf82c('0x99')],{'foreignKey':'MetricId'});db[_0xf82c('0x9f')][_0xf82c('0x10c')](db[_0xf82c('0xa1')],{'as':'Configurations','onDelete':_0xf82c('0x108'),'foreignKey':_0xf82c('0x1b8')});db[_0xf82c('0xa1')][_0xf82c('0x10c')](db['SalesforceField'],{'as':_0xf82c('0x1b9'),'onDelete':_0xf82c('0x108'),'foreignKey':'SubjectId'});db[_0xf82c('0xa1')][_0xf82c('0x10c')](db[_0xf82c('0x1ba')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0xf82c('0x1bb')});db[_0xf82c('0xa1')][_0xf82c('0x10c')](db['SalesforceField'],{'as':_0xf82c('0x1b6'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0xf82c('0xa1')]['belongsTo'](db[_0xf82c('0x9f')],{'as':_0xf82c('0x16d'),'foreignKey':_0xf82c('0x1b8')});db[_0xf82c('0x1ba')][_0xf82c('0x10c')](db[_0xf82c('0x1ba')],{'as':'Subject','foreignKey':_0xf82c('0x1bc')});db[_0xf82c('0x1ba')][_0xf82c('0x10c')](db[_0xf82c('0x1ba')],{'as':_0xf82c('0x1bd'),'foreignKey':_0xf82c('0x1bb')});db['SalesforceField'][_0xf82c('0x10c')](db[_0xf82c('0x1ba')],{'as':_0xf82c('0x1be'),'foreignKey':'FieldId'});db[_0xf82c('0x1ba')][_0xf82c('0x14a')](db[_0xf82c('0x91')],{'as':'Variable','foreignKey':_0xf82c('0x1bf')});db[_0xf82c('0xa3')]['hasMany'](db[_0xf82c('0xa5')],{'as':_0xf82c('0x1c0'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0xf82c('0xa5')]['hasMany'](db[_0xf82c('0xa7')],{'as':_0xf82c('0x1b9'),'onDelete':'cascade','foreignKey':_0xf82c('0x1bc')});db[_0xf82c('0xa5')][_0xf82c('0x10c')](db['SugarcrmField'],{'as':_0xf82c('0x1c1'),'onDelete':_0xf82c('0x108'),'foreignKey':'DescriptionId'});db[_0xf82c('0xa5')][_0xf82c('0x10c')](db[_0xf82c('0xa7')],{'as':'Fields','onDelete':'cascade','foreignKey':_0xf82c('0x1c2')});db[_0xf82c('0xa5')][_0xf82c('0x14a')](db['SugarcrmAccount'],{'as':_0xf82c('0x16d'),'foreignKey':'AccountId'});db[_0xf82c('0xa7')]['hasMany'](db['SugarcrmField'],{'as':_0xf82c('0x1c3'),'foreignKey':'SubjectId'});db[_0xf82c('0xa7')][_0xf82c('0x10c')](db['SugarcrmField'],{'as':_0xf82c('0x1bd'),'foreignKey':'DescriptionId'});db[_0xf82c('0xa7')]['hasMany'](db[_0xf82c('0xa7')],{'as':_0xf82c('0x1be'),'foreignKey':_0xf82c('0x1c2')});db['SugarcrmField'][_0xf82c('0x14a')](db[_0xf82c('0x91')],{'as':_0xf82c('0x91'),'foreignKey':'VariableId'});db['DeskAccount']['hasMany'](db[_0xf82c('0xaa')],{'as':_0xf82c('0x1c0'),'onDelete':_0xf82c('0x108'),'foreignKey':_0xf82c('0x1b8')});db[_0xf82c('0xaa')][_0xf82c('0x10c')](db[_0xf82c('0x1c4')],{'as':'Subjects','onDelete':_0xf82c('0x108'),'foreignKey':_0xf82c('0x1bc')});db[_0xf82c('0xaa')][_0xf82c('0x10c')](db[_0xf82c('0x1c4')],{'as':_0xf82c('0x1c1'),'onDelete':_0xf82c('0x108'),'foreignKey':'DescriptionId'});db['DeskConfiguration'][_0xf82c('0x10c')](db[_0xf82c('0x1c4')],{'as':_0xf82c('0x1b6'),'onDelete':_0xf82c('0x108'),'foreignKey':_0xf82c('0x1c2')});db[_0xf82c('0xaa')][_0xf82c('0x14a')](db[_0xf82c('0xa9')],{'as':_0xf82c('0x16d'),'foreignKey':_0xf82c('0x1b8')});db[_0xf82c('0xaa')][_0xf82c('0x11e')](db[_0xf82c('0x86')],{'through':_0xf82c('0x1c5')});db[_0xf82c('0x1c4')]['hasMany'](db[_0xf82c('0x1c4')],{'as':_0xf82c('0x1c3'),'foreignKey':_0xf82c('0x1bc')});db[_0xf82c('0x1c4')][_0xf82c('0x10c')](db[_0xf82c('0x1c4')],{'as':'Description','foreignKey':_0xf82c('0x1bb')});db[_0xf82c('0x1c4')][_0xf82c('0x10c')](db[_0xf82c('0x1c4')],{'as':_0xf82c('0x1be'),'foreignKey':'FieldId'});db['DeskField'][_0xf82c('0x14a')](db['Variable'],{'as':_0xf82c('0x91'),'foreignKey':_0xf82c('0x1bf')});db[_0xf82c('0xac')]['hasMany'](db[_0xf82c('0xae')],{'as':_0xf82c('0x1c0'),'onDelete':_0xf82c('0x108'),'foreignKey':'AccountId'});db[_0xf82c('0xae')][_0xf82c('0x10c')](db[_0xf82c('0x1c6')],{'as':_0xf82c('0x1b9'),'onDelete':_0xf82c('0x108'),'foreignKey':_0xf82c('0x1bc')});db[_0xf82c('0xae')][_0xf82c('0x10c')](db[_0xf82c('0x1c6')],{'as':_0xf82c('0x1c1'),'onDelete':_0xf82c('0x108'),'foreignKey':_0xf82c('0x1bb')});db[_0xf82c('0xae')][_0xf82c('0x10c')](db['ZohoField'],{'as':_0xf82c('0x1b6'),'onDelete':_0xf82c('0x108'),'foreignKey':'FieldId'});db['ZohoConfiguration']['belongsTo'](db['ZohoAccount'],{'as':_0xf82c('0x16d'),'foreignKey':'AccountId'});db['ZohoField'][_0xf82c('0x10c')](db[_0xf82c('0x1c6')],{'as':_0xf82c('0x1c3'),'foreignKey':_0xf82c('0x1bc')});db['ZohoField'][_0xf82c('0x10c')](db[_0xf82c('0x1c6')],{'as':_0xf82c('0x1bd'),'foreignKey':_0xf82c('0x1bb')});db[_0xf82c('0x1c6')][_0xf82c('0x10c')](db[_0xf82c('0x1c6')],{'as':_0xf82c('0x1be'),'foreignKey':_0xf82c('0x1c2')});db[_0xf82c('0x1c6')][_0xf82c('0x14a')](db[_0xf82c('0x91')],{'as':'Variable','foreignKey':_0xf82c('0x1bf')});db[_0xf82c('0x1c7')]['hasMany'](db['ZendeskConfiguration'],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db['ZendeskConfiguration'][_0xf82c('0x10c')](db[_0xf82c('0xb3')],{'as':_0xf82c('0x1b9'),'foreignKey':_0xf82c('0x1bc')});db[_0xf82c('0xb2')][_0xf82c('0x10c')](db[_0xf82c('0xb3')],{'as':_0xf82c('0x1c1'),'foreignKey':_0xf82c('0x1bb')});db[_0xf82c('0xb2')][_0xf82c('0x10c')](db[_0xf82c('0xb3')],{'as':'Fields','foreignKey':_0xf82c('0x1c2')});db['ZendeskConfiguration']['belongsTo'](db[_0xf82c('0x1c7')],{'as':_0xf82c('0x16d'),'foreignKey':'AccountId'});db[_0xf82c('0xb2')][_0xf82c('0x11e')](db[_0xf82c('0x86')],{'through':_0xf82c('0x1c8')});db[_0xf82c('0xb3')]['hasMany'](db[_0xf82c('0xb3')],{'as':'Subject','foreignKey':_0xf82c('0x1bc')});db[_0xf82c('0xb3')][_0xf82c('0x10c')](db[_0xf82c('0xb3')],{'as':_0xf82c('0x1bd'),'foreignKey':_0xf82c('0x1bb')});db[_0xf82c('0xb3')]['hasMany'](db['ZendeskField'],{'as':'Field','foreignKey':_0xf82c('0x1c2')});db[_0xf82c('0xb3')]['belongsTo'](db[_0xf82c('0x91')],{'as':_0xf82c('0x91'),'foreignKey':'VariableId'});db[_0xf82c('0xb5')]['hasMany'](db['FreshdeskConfiguration'],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xf82c('0x1b8')});db[_0xf82c('0xb7')]['hasMany'](db[_0xf82c('0xb9')],{'as':_0xf82c('0x1b9'),'onDelete':_0xf82c('0x108'),'foreignKey':_0xf82c('0x1bc')});db[_0xf82c('0xb7')][_0xf82c('0x10c')](db[_0xf82c('0xb9')],{'as':_0xf82c('0x1c1'),'onDelete':_0xf82c('0x108'),'foreignKey':'DescriptionId'});db[_0xf82c('0xb7')]['hasMany'](db['FreshdeskField'],{'as':'Fields','onDelete':_0xf82c('0x108'),'foreignKey':'FieldId'});db[_0xf82c('0xb7')]['belongsTo'](db['FreshdeskAccount'],{'as':_0xf82c('0x16d'),'foreignKey':_0xf82c('0x1b8')});db[_0xf82c('0xb7')][_0xf82c('0x11e')](db['Tag'],{'through':_0xf82c('0x1c9')});db[_0xf82c('0xb9')][_0xf82c('0x10c')](db['FreshdeskField'],{'as':_0xf82c('0x1c3'),'foreignKey':'SubjectId'});db[_0xf82c('0xb9')][_0xf82c('0x10c')](db['FreshdeskField'],{'as':_0xf82c('0x1bd'),'foreignKey':'DescriptionId'});db[_0xf82c('0xb9')][_0xf82c('0x10c')](db[_0xf82c('0xb9')],{'as':_0xf82c('0x1be'),'foreignKey':'FieldId'});db[_0xf82c('0xb9')][_0xf82c('0x14a')](db[_0xf82c('0x91')],{'as':'Variable','foreignKey':'VariableId'});db[_0xf82c('0xbb')][_0xf82c('0x10c')](db['VtigerConfiguration'],{'as':_0xf82c('0x1c0'),'onDelete':'cascade','foreignKey':_0xf82c('0x1b8')});db[_0xf82c('0x1ca')][_0xf82c('0x10c')](db[_0xf82c('0x1cb')],{'as':_0xf82c('0x1b9'),'foreignKey':_0xf82c('0x1bc')});db[_0xf82c('0x1ca')][_0xf82c('0x10c')](db[_0xf82c('0x1cb')],{'as':_0xf82c('0x1c1'),'foreignKey':_0xf82c('0x1bb')});db[_0xf82c('0x1ca')][_0xf82c('0x10c')](db[_0xf82c('0x1cb')],{'as':_0xf82c('0x1b6'),'foreignKey':_0xf82c('0x1c2')});db[_0xf82c('0x1ca')][_0xf82c('0x14a')](db[_0xf82c('0xbb')],{'as':_0xf82c('0x16d'),'foreignKey':_0xf82c('0x1b8')});db[_0xf82c('0x1cb')][_0xf82c('0x10c')](db[_0xf82c('0x1cb')],{'as':_0xf82c('0x1c3'),'foreignKey':_0xf82c('0x1bc')});db[_0xf82c('0x1cb')][_0xf82c('0x10c')](db[_0xf82c('0x1cb')],{'as':_0xf82c('0x1bd'),'foreignKey':_0xf82c('0x1bb')});db['VtigerField'][_0xf82c('0x10c')](db[_0xf82c('0x1cb')],{'as':_0xf82c('0x1be'),'foreignKey':_0xf82c('0x1c2')});db[_0xf82c('0x1cb')][_0xf82c('0x14a')](db[_0xf82c('0x91')],{'as':'Variable','foreignKey':_0xf82c('0x1bf')});db[_0xf82c('0x1cc')][_0xf82c('0x10c')](db[_0xf82c('0x1cd')],{'as':'Configurations','onDelete':_0xf82c('0x108'),'foreignKey':_0xf82c('0x1b8')});db['ServicenowConfiguration'][_0xf82c('0x10c')](db[_0xf82c('0xbe')],{'as':_0xf82c('0x1b9'),'foreignKey':_0xf82c('0x1bc')});db[_0xf82c('0x1cd')][_0xf82c('0x10c')](db['ServicenowField'],{'as':_0xf82c('0x1c1'),'foreignKey':'DescriptionId'});db[_0xf82c('0x1cd')][_0xf82c('0x10c')](db[_0xf82c('0xbe')],{'as':_0xf82c('0x1b6'),'foreignKey':_0xf82c('0x1c2')});db[_0xf82c('0x1cd')][_0xf82c('0x14a')](db[_0xf82c('0x1cc')],{'as':_0xf82c('0x16d'),'foreignKey':'AccountId'});db[_0xf82c('0xbe')]['hasMany'](db[_0xf82c('0xbe')],{'as':'Subject','foreignKey':'SubjectId'});db['ServicenowField'][_0xf82c('0x10c')](db[_0xf82c('0xbe')],{'as':'Description','foreignKey':_0xf82c('0x1bb')});db['ServicenowField'][_0xf82c('0x10c')](db[_0xf82c('0xbe')],{'as':_0xf82c('0x1be'),'foreignKey':_0xf82c('0x1c2')});db[_0xf82c('0xbe')]['belongsTo'](db[_0xf82c('0x91')],{'as':'Variable','foreignKey':'VariableId'});db['Dynamics365Account'][_0xf82c('0x10c')](db['Dynamics365Configuration'],{'as':_0xf82c('0x1c0'),'onDelete':'cascade','foreignKey':_0xf82c('0x1b8')});db[_0xf82c('0xc0')][_0xf82c('0x14a')](db['CloudProvider'],{'as':_0xf82c('0x101'),'foreignKey':'CloudProviderId'});db['Dynamics365Configuration']['hasMany'](db['Dynamics365Field'],{'as':_0xf82c('0x1b9'),'onDelete':'cascade','foreignKey':_0xf82c('0x1bc')});db[_0xf82c('0x1ce')]['hasMany'](db[_0xf82c('0xc3')],{'as':_0xf82c('0x1c1'),'onDelete':_0xf82c('0x108'),'foreignKey':_0xf82c('0x1bb')});db['Dynamics365Configuration'][_0xf82c('0x10c')](db['Dynamics365Field'],{'as':_0xf82c('0x1b6'),'onDelete':_0xf82c('0x108'),'foreignKey':_0xf82c('0x1c2')});db['Dynamics365Configuration'][_0xf82c('0x14a')](db['Dynamics365Account'],{'as':_0xf82c('0x16d'),'foreignKey':_0xf82c('0x1b8')});db[_0xf82c('0xc3')][_0xf82c('0x10c')](db[_0xf82c('0xc3')],{'as':_0xf82c('0x1c3'),'foreignKey':'SubjectId'});db[_0xf82c('0xc3')][_0xf82c('0x10c')](db['Dynamics365Field'],{'as':_0xf82c('0x1bd'),'foreignKey':'DescriptionId'});db[_0xf82c('0xc3')][_0xf82c('0x10c')](db['Dynamics365Field'],{'as':_0xf82c('0x1be'),'foreignKey':_0xf82c('0x1c2')});db[_0xf82c('0xc3')][_0xf82c('0x14a')](db[_0xf82c('0x91')],{'as':_0xf82c('0x91'),'foreignKey':_0xf82c('0x1bf')});db['FreshsalesAccount'][_0xf82c('0x10c')](db['FreshsalesConfiguration'],{'as':'Configurations','onDelete':_0xf82c('0x108'),'foreignKey':'AccountId'});db[_0xf82c('0xc6')]['hasMany'](db[_0xf82c('0x1cf')],{'as':_0xf82c('0x1b9'),'foreignKey':_0xf82c('0x1bc')});db[_0xf82c('0xc6')][_0xf82c('0x10c')](db[_0xf82c('0x1cf')],{'as':_0xf82c('0x1c1'),'foreignKey':_0xf82c('0x1bb')});db[_0xf82c('0xc6')]['hasMany'](db[_0xf82c('0x1cf')],{'as':_0xf82c('0x1b6'),'foreignKey':_0xf82c('0x1c2')});db[_0xf82c('0xc6')][_0xf82c('0x14a')](db['FreshsalesAccount'],{'as':_0xf82c('0x16d'),'foreignKey':_0xf82c('0x1b8')});db['FreshsalesField']['hasMany'](db[_0xf82c('0x1cf')],{'as':_0xf82c('0x1c3'),'foreignKey':_0xf82c('0x1bc')});db[_0xf82c('0x1cf')]['hasMany'](db[_0xf82c('0x1cf')],{'as':'Description','foreignKey':_0xf82c('0x1bb')});db[_0xf82c('0x1cf')][_0xf82c('0x10c')](db[_0xf82c('0x1cf')],{'as':_0xf82c('0x1be'),'foreignKey':'FieldId'});db[_0xf82c('0x1cf')][_0xf82c('0x14a')](db[_0xf82c('0x91')],{'as':_0xf82c('0x91'),'foreignKey':_0xf82c('0x1bf')});db[_0xf82c('0xcb')]['belongsTo'](db[_0xf82c('0x5c')],{});db['ChatQueueReport'][_0xf82c('0x14a')](db[_0xf82c('0xee')],{'as':_0xf82c('0x168'),'foreignKey':'ListId'});db[_0xf82c('0xcb')][_0xf82c('0x14a')](db[_0xf82c('0x6c')],{'as':_0xf82c('0x17a'),'foreignKey':_0xf82c('0x15c')});db[_0xf82c('0xcb')][_0xf82c('0x14a')](db[_0xf82c('0x62')],{});db[_0xf82c('0xcb')]['belongsTo'](db[_0xf82c('0x64')],{});db[_0xf82c('0xcb')][_0xf82c('0x14a')](db['User'],{});db[_0xf82c('0xcb')][_0xf82c('0x14a')](db[_0xf82c('0x131')],{});db[_0xf82c('0xcd')][_0xf82c('0x14a')](db[_0xf82c('0xf')],{'onDelete':_0xf82c('0x108'),'foreignKey':'FromId'});db[_0xf82c('0xcd')][_0xf82c('0x14a')](db[_0xf82c('0xf')],{'onDelete':'cascade','foreignKey':_0xf82c('0x1d0')});db['JscriptySessionReport'][_0xf82c('0x10c')](db[_0xf82c('0xcf')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0xf82c('0xd1')]['hasMany'](db['JscriptyAnswerReport'],{'foreignKey':_0xf82c('0x1d1'),'onDelete':'cascade'});db['SmsQueueReport']['belongsTo'](db[_0xf82c('0x4c')],{});db[_0xf82c('0x1d2')]['belongsTo'](db['CmList'],{'as':_0xf82c('0x168'),'foreignKey':'ListId'});db[_0xf82c('0x1d2')][_0xf82c('0x14a')](db[_0xf82c('0x6c')],{'as':_0xf82c('0x17a'),'foreignKey':_0xf82c('0x15c')});db[_0xf82c('0x1d2')][_0xf82c('0x14a')](db[_0xf82c('0x129')],{});db[_0xf82c('0x1d2')][_0xf82c('0x14a')](db[_0xf82c('0x50')],{});db[_0xf82c('0x1d2')]['belongsTo'](db[_0xf82c('0xf')],{});db[_0xf82c('0x1d2')][_0xf82c('0x14a')](db[_0xf82c('0x52')],{});db['JscriptyProject'][_0xf82c('0x10c')](db['JscriptySessionReport'],{'foreignKey':_0xf82c('0x1d3')});db[_0xf82c('0xd4')][_0xf82c('0x10c')](db[_0xf82c('0xcf')],{'foreignKey':_0xf82c('0x1d3')});db[_0xf82c('0xd4')][_0xf82c('0x10c')](db[_0xf82c('0x1d4')],{'foreignKey':_0xf82c('0x1d3')});db['Team'][_0xf82c('0x11e')](db[_0xf82c('0xf')],{'as':'Agents','through':_0xf82c('0x124')});db[_0xf82c('0x123')][_0xf82c('0x11e')](db[_0xf82c('0x17')],{'through':_0xf82c('0x102'),'as':'VoiceQueues'});db['Team'][_0xf82c('0x11e')](db['MailQueue'],{'through':'team_has_mail_queues','as':_0xf82c('0x130')});db[_0xf82c('0x123')][_0xf82c('0x11e')](db[_0xf82c('0x131')],{'through':_0xf82c('0x194'),'as':'ChatQueues'});db['Team']['belongsToMany'](db[_0xf82c('0x49')],{'through':_0xf82c('0x183'),'as':'FaxQueues'});db[_0xf82c('0x123')]['belongsToMany'](db[_0xf82c('0x52')],{'through':_0xf82c('0x188'),'as':'SmsQueues'});db['Team']['belongsToMany'](db[_0xf82c('0x5a')],{'through':_0xf82c('0x18d'),'as':_0xf82c('0x1d5')});db[_0xf82c('0x123')][_0xf82c('0x11e')](db[_0xf82c('0x137')],{'through':_0xf82c('0x1d6'),'as':_0xf82c('0x138')});db['Team'][_0xf82c('0x11e')](db[_0xf82c('0xef')],{'through':_0xf82c('0x1d7'),'as':'VoicePrefixes'});db['Campaign'][_0xf82c('0x10c')](db[_0xf82c('0x11a')],{'as':_0xf82c('0x11b'),'foreignKey':'CampaignId'});db[_0xf82c('0xe0')][_0xf82c('0x10c')](db['CmHopperFinal'],{'as':_0xf82c('0x111'),'foreignKey':_0xf82c('0x1d8')});db[_0xf82c('0xe0')][_0xf82c('0x10c')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0xf82c('0x1d8')});db[_0xf82c('0xe0')][_0xf82c('0x10c')](db[_0xf82c('0x6f')],{'as':'HopperBlacks','foreignKey':_0xf82c('0x1d8')});db[_0xf82c('0xe0')]['belongsTo'](db[_0xf82c('0x26')],{'as':'Trunk','foreignKey':_0xf82c('0x14b')});db[_0xf82c('0xe0')][_0xf82c('0x14a')](db[_0xf82c('0x26')],{'as':'TrunkBackup','foreignKey':_0xf82c('0x14d')});db[_0xf82c('0xe0')][_0xf82c('0x14a')](db[_0xf82c('0x7d')],{'as':_0xf82c('0x7d'),'foreignKey':_0xf82c('0x14e')});db[_0xf82c('0xe0')][_0xf82c('0x14a')](db[_0xf82c('0x1d9')],{'as':'SquareProject','foreignKey':_0xf82c('0x1da')});db[_0xf82c('0xe0')]['belongsToMany'](db[_0xf82c('0xee')],{'as':_0xf82c('0x150'),'through':_0xf82c('0x1db')});db[_0xf82c('0xe0')][_0xf82c('0x11e')](db['CmList'],{'as':_0xf82c('0x154'),'through':_0xf82c('0x1dc')});db['Attachment'][_0xf82c('0x14a')](db[_0xf82c('0x176')],{'as':_0xf82c('0x176'),'foreignKey':_0xf82c('0x177')});db[_0xf82c('0xe6')][_0xf82c('0x14a')](db[_0xf82c('0x3c')],{});db[_0xf82c('0xe6')][_0xf82c('0x14a')](db[_0xf82c('0x3b')],{});db[_0xf82c('0xe6')][_0xf82c('0x14a')](db['MailAccount'],{'foreignKey':'FromMailAccountId','as':_0xf82c('0x1dd')});db['MailTransferReport'][_0xf82c('0x14a')](db[_0xf82c('0xf')],{'foreignKey':_0xf82c('0x1de'),'as':_0xf82c('0x1df')});db[_0xf82c('0xe6')][_0xf82c('0x14a')](db[_0xf82c('0xf')],{'foreignKey':'ToUserId','as':_0xf82c('0x1e0')});db[_0xf82c('0xe6')]['belongsTo'](db['MailQueue'],{'foreignKey':_0xf82c('0x1e1'),'as':_0xf82c('0x1e2')});db[_0xf82c('0xe6')][_0xf82c('0x14a')](db['MailAccount'],{'foreignKey':'ToMailAccountId','as':_0xf82c('0x1e3')});db[_0xf82c('0xe8')][_0xf82c('0x14a')](db[_0xf82c('0x64')],{});db['ChatTransferReport'][_0xf82c('0x14a')](db[_0xf82c('0x62')],{});db['ChatTransferReport'][_0xf82c('0x14a')](db['ChatWebsite'],{'foreignKey':_0xf82c('0x1e4'),'as':'FromAccount'});db['ChatTransferReport'][_0xf82c('0x14a')](db[_0xf82c('0xf')],{'foreignKey':_0xf82c('0x1de'),'as':_0xf82c('0x1df')});db[_0xf82c('0xe8')]['belongsTo'](db[_0xf82c('0xf')],{'foreignKey':_0xf82c('0x1e5'),'as':_0xf82c('0x1e0')});db['ChatTransferReport'][_0xf82c('0x14a')](db[_0xf82c('0x131')],{'foreignKey':_0xf82c('0x1e6'),'as':'ToQueue'});db[_0xf82c('0xe8')][_0xf82c('0x14a')](db[_0xf82c('0x5c')],{'foreignKey':_0xf82c('0x1e7'),'as':'ToAccount'});db[_0xf82c('0xea')][_0xf82c('0x14a')](db[_0xf82c('0x17e')],{});db['FaxTransferReport'][_0xf82c('0x14a')](db[_0xf82c('0x46')],{});db[_0xf82c('0xea')][_0xf82c('0x14a')](db[_0xf82c('0x13a')],{'foreignKey':_0xf82c('0x1e8'),'as':_0xf82c('0x1dd')});db[_0xf82c('0xea')][_0xf82c('0x14a')](db[_0xf82c('0xf')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0xf82c('0xea')][_0xf82c('0x14a')](db[_0xf82c('0xf')],{'foreignKey':'ToUserId','as':_0xf82c('0x1e0')});db[_0xf82c('0xea')][_0xf82c('0x14a')](db['FaxQueue'],{'foreignKey':_0xf82c('0x1e9'),'as':_0xf82c('0x1e2')});db[_0xf82c('0xea')][_0xf82c('0x14a')](db['FaxAccount'],{'foreignKey':_0xf82c('0x1ea'),'as':_0xf82c('0x1e3')});db[_0xf82c('0xeb')][_0xf82c('0x14a')](db['OpenchannelMessage'],{});db[_0xf82c('0xeb')]['belongsTo'](db[_0xf82c('0x113')],{});db[_0xf82c('0xeb')][_0xf82c('0x14a')](db[_0xf82c('0x54')],{'foreignKey':_0xf82c('0x1eb'),'as':_0xf82c('0x1dd')});db[_0xf82c('0xeb')]['belongsTo'](db[_0xf82c('0xf')],{'foreignKey':_0xf82c('0x1de'),'as':'FromAgent'});db['OpenchannelTransferReport'][_0xf82c('0x14a')](db[_0xf82c('0xf')],{'foreignKey':_0xf82c('0x1e5'),'as':_0xf82c('0x1e0')});db['OpenchannelTransferReport'][_0xf82c('0x14a')](db['OpenchannelQueue'],{'foreignKey':_0xf82c('0x1ec'),'as':_0xf82c('0x1e2')});db['OpenchannelTransferReport'][_0xf82c('0x14a')](db['OpenchannelAccount'],{'foreignKey':_0xf82c('0x1ed'),'as':_0xf82c('0x1e3')});db['SmsTransferReport'][_0xf82c('0x14a')](db[_0xf82c('0x50')],{});db['SmsTransferReport'][_0xf82c('0x14a')](db[_0xf82c('0x129')],{});db[_0xf82c('0x1ee')][_0xf82c('0x14a')](db['SmsAccount'],{'foreignKey':'FromSmsAccountId','as':_0xf82c('0x1dd')});db['SmsTransferReport']['belongsTo'](db[_0xf82c('0xf')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0xf82c('0x1ee')]['belongsTo'](db[_0xf82c('0xf')],{'foreignKey':_0xf82c('0x1e5'),'as':_0xf82c('0x1e0')});db[_0xf82c('0x1ee')][_0xf82c('0x14a')](db['SmsQueue'],{'foreignKey':_0xf82c('0x1ef'),'as':'ToQueue'});db[_0xf82c('0x1ee')][_0xf82c('0x14a')](db[_0xf82c('0x4c')],{'foreignKey':_0xf82c('0x1f0'),'as':'ToAccount'});db[_0xf82c('0xee')][_0xf82c('0x10c')](db[_0xf82c('0x162')],{'as':_0xf82c('0x163'),'foreignKey':_0xf82c('0x179'),'onDelete':_0xf82c('0x108')});db['CmList'][_0xf82c('0x10c')](db[_0xf82c('0x1f1')],{'as':_0xf82c('0x1f2'),'foreignKey':_0xf82c('0x179')});db['CmList']['hasMany'](db['CmContact'],{'as':_0xf82c('0x121'),'onDelete':_0xf82c('0x108'),'foreignKey':_0xf82c('0x179')});db['CmList']['hasMany'](db[_0xf82c('0x71')],{'as':_0xf82c('0x111'),'foreignKey':_0xf82c('0x179')});db['CmList'][_0xf82c('0x10c')](db['CmHopperHistory'],{'as':_0xf82c('0x1f3'),'foreignKey':'ListId'});db['CmList'][_0xf82c('0x10c')](db[_0xf82c('0x112')],{'as':_0xf82c('0x112'),'foreignKey':_0xf82c('0x179')});db[_0xf82c('0xee')][_0xf82c('0x11e')](db['VoiceQueue'],{'as':'Queues','through':_0xf82c('0x151')});db[_0xf82c('0xee')]['belongsToMany'](db[_0xf82c('0xf')],{'as':_0xf82c('0x152'),'through':_0xf82c('0x122')});db[_0xf82c('0xef')]['hasMany'](db['VoiceExtension'],{'as':'Extensions','onDelete':_0xf82c('0x108')});db['VoicePrefix'][_0xf82c('0x11e')](db['User'],{'as':_0xf82c('0x152'),'through':_0xf82c('0x104')});db['VoicePrefix']['belongsToMany'](db['Team'],{'through':_0xf82c('0x1d7'),'as':'Teams'});db[_0xf82c('0x11d')][_0xf82c('0x10c')](db['User'],{'as':_0xf82c('0x171'),'foreignKey':_0xf82c('0x1f4')});db['UserProfile'][_0xf82c('0x10c')](db[_0xf82c('0x1f5')],{'as':_0xf82c('0x1f6'),'foreignKey':'userProfileId','onDelete':'cascade'});db[_0xf82c('0x1f5')]['hasMany'](db['UserProfileResource'],{'as':'Resources','foreignKey':_0xf82c('0x1f7'),'onDelete':_0xf82c('0x108')});db['WhatsappAccount'][_0xf82c('0x10c')](db[_0xf82c('0x162')],{'as':'Dispositions','foreignKey':'WhatsappAccountId','onDelete':'cascade'});db[_0xf82c('0xf5')][_0xf82c('0x10c')](db[_0xf82c('0x164')],{'as':_0xf82c('0x165'),'foreignKey':_0xf82c('0x1f8')});db[_0xf82c('0xf5')][_0xf82c('0x10c')](db[_0xf82c('0xfb')],{'as':_0xf82c('0x166'),'foreignKey':'WhatsappAccountId'});db[_0xf82c('0xf5')][_0xf82c('0x10c')](db[_0xf82c('0xf9')],{'as':_0xf82c('0x167')});db[_0xf82c('0xf5')][_0xf82c('0x10c')](db[_0xf82c('0xf7')],{'as':_0xf82c('0x143'),'foreignKey':_0xf82c('0x1f8'),'onDelete':_0xf82c('0x108')});db[_0xf82c('0xf5')][_0xf82c('0x14a')](db['CmList'],{'as':_0xf82c('0x168'),'foreignKey':_0xf82c('0x179')});db[_0xf82c('0xf5')]['belongsTo'](db[_0xf82c('0x7e')],{'as':'mandatoryDispositionPause','foreignKey':_0xf82c('0x14f')});db['WhatsappAccount'][_0xf82c('0x11e')](db[_0xf82c('0xf')],{'as':_0xf82c('0x152'),'through':_0xf82c('0x1f9')});db[_0xf82c('0xf7')][_0xf82c('0x14a')](db['User'],{'onDelete':'restrict'});db[_0xf82c('0xf7')][_0xf82c('0x14a')](db[_0xf82c('0x137')],{'onDelete':_0xf82c('0x15e')});db[_0xf82c('0xf7')][_0xf82c('0x14a')](db['WhatsappAccount'],{'onDelete':_0xf82c('0x15e')});db[_0xf82c('0xf7')][_0xf82c('0x14a')](db[_0xf82c('0x7d')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0xf82c('0xf7')][_0xf82c('0x14a')](db[_0xf82c('0x86')],{'onDelete':'restrict','foreignKey':_0xf82c('0x178')});db['WhatsappInteraction'][_0xf82c('0x10c')](db[_0xf82c('0xfb')],{'as':_0xf82c('0x166'),'onDelete':'cascade','foreignKey':'WhatsappInteractionId'});db['WhatsappInteraction'][_0xf82c('0x14a')](db[_0xf82c('0xf5')],{'as':_0xf82c('0x16d'),'foreignKey':_0xf82c('0x1f8')});db[_0xf82c('0xf9')][_0xf82c('0x14a')](db[_0xf82c('0x6c')],{'as':_0xf82c('0x17a'),'foreignKey':_0xf82c('0x15c')});db[_0xf82c('0xf9')][_0xf82c('0x14a')](db[_0xf82c('0xf')],{'as':_0xf82c('0x180'),'foreignKey':_0xf82c('0x109')});db['WhatsappInteraction'][_0xf82c('0x11e')](db[_0xf82c('0x86')],{'through':_0xf82c('0x1ac'),'as':'Tags'});db['WhatsappInteraction'][_0xf82c('0x11e')](db[_0xf82c('0x86')],{'through':_0xf82c('0x1ac'),'as':_0xf82c('0x170')});db[_0xf82c('0xf9')][_0xf82c('0x11e')](db[_0xf82c('0xf')],{'as':_0xf82c('0x171'),'through':_0xf82c('0x12d'),'foreignKey':_0xf82c('0x1fa')});db[_0xf82c('0xfb')][_0xf82c('0x14a')](db[_0xf82c('0xf')],{'as':_0xf82c('0xf')});db[_0xf82c('0xfb')][_0xf82c('0x14a')](db[_0xf82c('0x6c')],{'onDelete':_0xf82c('0x108'),'as':_0xf82c('0x17a')});db[_0xf82c('0xfb')][_0xf82c('0x14a')](db[_0xf82c('0xf9')],{'onDelete':_0xf82c('0x108'),'as':_0xf82c('0x174'),'foreignKey':_0xf82c('0x1fa')});db[_0xf82c('0xfb')][_0xf82c('0x14a')](db[_0xf82c('0xf5')],{'as':_0xf82c('0x16d'),'foreignKey':'WhatsappAccountId'});db[_0xf82c('0xfd')][_0xf82c('0x14a')](db[_0xf82c('0xf5')],{});db[_0xf82c('0xfd')]['belongsTo'](db[_0xf82c('0xee')],{'as':_0xf82c('0x168'),'foreignKey':'ListId'});db[_0xf82c('0xfd')]['belongsTo'](db[_0xf82c('0x6c')],{'as':_0xf82c('0x17a'),'foreignKey':'ContactId'});db[_0xf82c('0xfd')][_0xf82c('0x14a')](db['WhatsappInteraction'],{});db['WhatsappQueueReport']['belongsTo'](db[_0xf82c('0x137')],{});db[_0xf82c('0xfd')]['belongsTo'](db[_0xf82c('0xfb')],{});db[_0xf82c('0xfd')]['belongsTo'](db[_0xf82c('0xf')],{});db[_0xf82c('0xff')][_0xf82c('0x14a')](db[_0xf82c('0xfb')],{});db['WhatsappTransferReport']['belongsTo'](db[_0xf82c('0xf9')],{});db[_0xf82c('0xff')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':'FromWhatsappAccountId','as':_0xf82c('0x1dd')});db[_0xf82c('0xff')][_0xf82c('0x14a')](db[_0xf82c('0xf5')],{'foreignKey':_0xf82c('0x1fb'),'as':_0xf82c('0x1e3')});db['WhatsappTransferReport'][_0xf82c('0x14a')](db[_0xf82c('0x137')],{'foreignKey':_0xf82c('0x1fc'),'as':'ToQueue'});db[_0xf82c('0xff')][_0xf82c('0x14a')](db[_0xf82c('0xf')],{'foreignKey':_0xf82c('0x1de'),'as':_0xf82c('0x1df')});db[_0xf82c('0xff')][_0xf82c('0x14a')](db[_0xf82c('0xf')],{'foreignKey':_0xf82c('0x1e5'),'as':_0xf82c('0x1e0')});db[_0xf82c('0x137')]['belongsToMany'](db[_0xf82c('0xf')],{'as':_0xf82c('0x152'),'through':_0xf82c('0x31'),'foreignKey':_0xf82c('0x1fd')});db[_0xf82c('0x137')]['belongsToMany'](db[_0xf82c('0x123')],{'through':'team_has_whatsapp_queues','as':'Teams'});db['UserSetting'][_0xf82c('0x14a')](db[_0xf82c('0xf')],{'as':_0xf82c('0x1fe'),'foreignKey':_0xf82c('0x109'),'onDelete':_0xf82c('0x108'),'hooks':!![]});db[_0xf82c('0x101')][_0xf82c('0x10a')](db['Dynamics365Account'],{'as':_0xf82c('0xc0'),'onDelete':_0xf82c('0x15e')});db[_0xf82c('0x101')][_0xf82c('0x10a')](db['MailServerIn'],{'as':_0xf82c('0x160'),'onDelete':_0xf82c('0x15e')});db[_0xf82c('0x101')][_0xf82c('0x10a')](db[_0xf82c('0x35')],{'as':'Smtp','onDelete':_0xf82c('0x15e')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x38e7=['VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','VoiceMail','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatApplication','../api/chatApplication/chatApplication.model','../api/chatInteraction/chatInteraction.model','../api/chatOfflineMessage/chatOfflineMessage.model','../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','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','Disposition','../api/disposition/disposition.model','Condition','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskAccount/intFreshdeskAccount.model','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','ServicenowAccount','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Account/intDynamics365Account.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','VoicePrefix','UserProfile','../api/userProfile/userProfile.model','../api/userProfileSection/userProfileSection.model','UserProfileResource','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','MailInteractionHasTag','../api/mailInteractionHasTag/mailInteractionHasTag.model','hasOne','cascade','userSetting','UserId','hasMany','Recordings','UserVoiceQueueRt','VoiceQueuesRt','Extensions','HopperHistory','OpenchannelInteractions','ChatInteraction','ChatInteractions','SmsInteraction','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotification','Hoppers','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','CmList','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_fax_interactions','SmsInteractions','user_has_sms_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','MailQueue','MailQueues','ChatQueue','ChatQueues','FaxQueue','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','ChatWebsite','user_has_chat_websites','user_has_fax_accounts','OpenchannelAccount','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SpiedAgents','Applications','Sounds','moh_has_sounds','VoiceQueueId','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','TeamVoiceQueue','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','VoiceCallReport','QueueCalls','AgentReports','Contact','ContactId','MailAccountId','CloudProviderId','restrict','MailServerOut','Imap','Dispositions','Answers','Interactions','ListId','Template','TemplateId','user_has_mail_accounts','Agents','team_has_mail_queues','Teams','MailInteractionId','Account','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessage','IntervalId','TagId','Items','FaxAccountId','List','fax_interaction_has_tags','FaxInteractionId','team_has_fax_queues','SmsAccountId','SmsApplication','sms_interaction_has_tags','SmsInteractionId','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelMessage','OpenchannelInteractionId','openchannel_interaction_has_tags','AttachmentId','OpenchannelQueueId','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','ChatMessage','OpenchannelQueueReport','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatOfflineMessageId','ChatInternalMessage','ChatGroupId','Members','CompanyId','CmContactHasItem','CmContactId','HopperFinals','HopperHistories','Company','cm_user_has_contacts','cm_contact_has_tags','AdditionalPhones','CmHopperId','CampaignId','OwnerId','All','OneAll','AutomationAllId','OneAny','AutomationAnyId','ParentId','MailApplications','ChatApplications','FaxApplications','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Actions','TriggerId','Fields','MetricId','Configurations','SalesforceField','Subjects','SubjectId','DescriptionId','FieldId','AccountId','Description','VariableId','SugarcrmConfiguration','Descriptions','Subject','Field','DeskConfiguration','int_desk_configuration_has_tags','FreshdeskAccount','FreshdeskConfiguration','FreshdeskField','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowConfiguration','Dynamics365Account','Dynamics365Configuration','Dynamics365Field','FreshsalesConfiguration','FromId','ToId','SessionId','JscriptyProject','ProjectId','team_has_chat_queues','team_has_whatsapp_queues','TrunkBackupId','SquareProject','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToAccount','ChatTransferReport','FromChatWebsiteId','FromUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','FromOpenchannelAccountId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','UserProfileSection','UserProfileSections','Resources','WhatsappAccountId','WhatsappInteractionId','FromWhatsappAccountId','ToQueueId','user','Smtp','exports','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xcall','xC@LL1234','name','utf8','utf8_general_ci','sequelizeHistory','127.0.0.1','mysql','database','username','password','options','User','../api/user/user.model','VoiceChanSpy','import','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model'];(function(_0x270c45,_0x2d8fa1){var _0x3cefdc=function(_0x543205){while(--_0x543205){_0x270c45['push'](_0x270c45['shift']());}};_0x3cefdc(++_0x2d8fa1);}(_0x38e7,0x1eb));var _0x738e=function(_0x189c9e,_0x1c3b55){_0x189c9e=_0x189c9e-0x0;var _0x3f38ca=_0x38e7[_0x189c9e];return _0x3f38ca;};'use strict';var config=require(_0x738e('0x0'));var Sequelize=require(_0x738e('0x1'));var _=require(_0x738e('0x2'));var jstz=require(_0x738e('0x3'));var timezone=jstz[_0x738e('0x4')]();config[_0x738e('0x1')]=_[_0x738e('0x5')](config[_0x738e('0x1')],{'database':_0x738e('0x6'),'username':_0x738e('0x7'),'password':_0x738e('0x8'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x738e('0x9')](),'define':{'charset':_0x738e('0xa'),'collate':_0x738e('0xb')}}});config[_0x738e('0xc')]=_[_0x738e('0x5')](config[_0x738e('0xc')],{'database':_0x738e('0x6'),'username':_0x738e('0x7'),'password':_0x738e('0x8'),'options':{'host':_0x738e('0xd'),'port':0xcea,'dialect':_0x738e('0xe'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x738e('0xa'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x738e('0x1')][_0x738e('0xf')],config['sequelize'][_0x738e('0x10')],config['sequelize'][_0x738e('0x11')],config[_0x738e('0x1')][_0x738e('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x738e('0xc')][_0x738e('0xf')],config[_0x738e('0xc')]['username'],config[_0x738e('0xc')][_0x738e('0x11')],config[_0x738e('0xc')][_0x738e('0x12')])};db[_0x738e('0x13')]=db[_0x738e('0x1')]['import'](_0x738e('0x14'));db[_0x738e('0x15')]=db['sequelize'][_0x738e('0x16')]('../api/voiceChanSpy/voiceChanSpy.model');db[_0x738e('0x17')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x18'));db[_0x738e('0x19')]=db[_0x738e('0x1')][_0x738e('0x16')]('../api/voiceExtension/voiceExtension.model');db[_0x738e('0x1a')]=db['sequelize'][_0x738e('0x16')](_0x738e('0x1b'));db[_0x738e('0x1c')]=db['sequelize'][_0x738e('0x16')](_0x738e('0x1d'));db[_0x738e('0x1e')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x1f'));db[_0x738e('0x20')]=db[_0x738e('0x1')][_0x738e('0x16')]('../api/screenRecording/screenRecording.model');db[_0x738e('0x21')]=db[_0x738e('0x1')][_0x738e('0x16')]('../api/voiceMail/voiceMail.model');db[_0x738e('0x22')]=db[_0x738e('0x1')]['import'](_0x738e('0x23'));db['VoiceCallReport']=db['sequelize'][_0x738e('0x16')](_0x738e('0x24'));db[_0x738e('0x25')]=db[_0x738e('0x1')]['import'](_0x738e('0x26'));db[_0x738e('0x27')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x28'));db[_0x738e('0x29')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x2a'));db[_0x738e('0x2b')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x2c'));db[_0x738e('0x2d')]=db[_0x738e('0x1')]['import'](_0x738e('0x2e'));db[_0x738e('0x2f')]=db[_0x738e('0x1')][_0x738e('0x16')]('../api/voiceTransferReport/voiceTransferReport.model');db['UserVoiceQueueRt']=db[_0x738e('0x1')][_0x738e('0x16')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0x738e('0x30')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x31'));db[_0x738e('0x32')]=db[_0x738e('0x1')][_0x738e('0x16')]('../api/userChatQueue/userChatQueue.model');db[_0x738e('0x33')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x34'));db[_0x738e('0x35')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x36'));db[_0x738e('0x37')]=db[_0x738e('0x1')]['import'](_0x738e('0x38'));db[_0x738e('0x39')]=db[_0x738e('0x1')]['import']('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0x738e('0x3a')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x3b'));db[_0x738e('0x3c')]=db[_0x738e('0x1')][_0x738e('0x16')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x738e('0x1')]['import'](_0x738e('0x3d'));db[_0x738e('0x3e')]=db['sequelize'][_0x738e('0x16')](_0x738e('0x3f'));db['MailQueue']=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x40'));db[_0x738e('0x41')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x42'));db[_0x738e('0x43')]=db['sequelize'][_0x738e('0x16')](_0x738e('0x44'));db[_0x738e('0x45')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x46'));db[_0x738e('0x47')]=db['sequelize']['import']('../api/mailApplication/mailApplication.model');db[_0x738e('0x48')]=db['sequelize']['import'](_0x738e('0x49'));db[_0x738e('0x4a')]=db['sequelize']['import'](_0x738e('0x4b'));db[_0x738e('0x4c')]=db['sequelize'][_0x738e('0x16')]('../api/dashboardItem/dashboardItem.model');db[_0x738e('0x4d')]=db[_0x738e('0x1')]['import'](_0x738e('0x4e'));db[_0x738e('0x4f')]=db[_0x738e('0x1')]['import'](_0x738e('0x50'));db[_0x738e('0x51')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x52'));db[_0x738e('0x53')]=db['sequelize'][_0x738e('0x16')]('../api/faxMessage/faxMessage.model');db['FaxQueue']=db['sequelize'][_0x738e('0x16')](_0x738e('0x54'));db[_0x738e('0x55')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x56'));db[_0x738e('0x57')]=db['sequelize'][_0x738e('0x16')]('../api/smsAccount/smsAccount.model');db['SmsApplication']=db['sequelize'][_0x738e('0x16')]('../api/smsApplication/smsApplication.model');db['SmsInteraction']=db[_0x738e('0x1')]['import']('../api/smsInteraction/smsInteraction.model');db[_0x738e('0x58')]=db[_0x738e('0x1')]['import'](_0x738e('0x59'));db[_0x738e('0x5a')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x5b'));db['OpenchannelAccount']=db[_0x738e('0x1')]['import'](_0x738e('0x5c'));db[_0x738e('0x5d')]=db['sequelize'][_0x738e('0x16')]('../api/openchannelApplication/openchannelApplication.model');db[_0x738e('0x5e')]=db['sequelize'][_0x738e('0x16')](_0x738e('0x5f'));db['OpenchannelMessage']=db['sequelize'][_0x738e('0x16')](_0x738e('0x60'));db[_0x738e('0x61')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x62'));db['ChatWebsite']=db[_0x738e('0x1')][_0x738e('0x16')]('../api/chatWebsite/chatWebsite.model');db['OpenchannelQueueReport']=db['sequelize']['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x738e('0x63')]=db['sequelize'][_0x738e('0x16')](_0x738e('0x64'));db['ChatInteraction']=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x65'));db['ChatMessage']=db[_0x738e('0x1')]['import']('../api/chatMessage/chatMessage.model');db['ChatOfflineMessage']=db[_0x738e('0x1')]['import'](_0x738e('0x66'));db['ChatQueue']=db['sequelize'][_0x738e('0x16')](_0x738e('0x67'));db[_0x738e('0x68')]=db[_0x738e('0x1')]['import']('../api/chatGroup/chatGroup.model');db['ChatProactiveAction']=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x69'));db[_0x738e('0x6a')]=db[_0x738e('0x1')]['import'](_0x738e('0x6b'));db[_0x738e('0x6c')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x6d'));db[_0x738e('0x6e')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x6f'));db[_0x738e('0x70')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x71'));db[_0x738e('0x72')]=db[_0x738e('0x1')][_0x738e('0x16')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0x738e('0x73')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x74'));db[_0x738e('0x75')]=db[_0x738e('0x1')]['import'](_0x738e('0x76'));db[_0x738e('0x77')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x78'));db[_0x738e('0x79')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x7a'));db[_0x738e('0x7b')]=db[_0x738e('0x1')]['import'](_0x738e('0x7c'));db[_0x738e('0x7d')]=db[_0x738e('0x1')][_0x738e('0x16')]('../api/cannedAnswer/cannedAnswer.model');db[_0x738e('0x7e')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x7f'));db[_0x738e('0x80')]=db[_0x738e('0x1')]['import']('../api/condition/condition.model');db[_0x738e('0x81')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x82'));db[_0x738e('0x83')]=db[_0x738e('0x1')]['import'](_0x738e('0x84'));db[_0x738e('0x85')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x86'));db[_0x738e('0x87')]=db[_0x738e('0x1')]['import'](_0x738e('0x88'));db[_0x738e('0x89')]=db[_0x738e('0x1')]['import'](_0x738e('0x8a'));db[_0x738e('0x8b')]=db[_0x738e('0x1')][_0x738e('0x16')]('../api/sound/sound.model');db[_0x738e('0x8c')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x8d'));db[_0x738e('0x8e')]=db['sequelize']['import'](_0x738e('0x8f'));db['CmContactHasItem']=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x90'));db[_0x738e('0x91')]=db['sequelize'][_0x738e('0x16')](_0x738e('0x92'));db['Template']=db[_0x738e('0x1')][_0x738e('0x16')]('../api/template/template.model');db[_0x738e('0x93')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x94'));db[_0x738e('0x95')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x96'));db[_0x738e('0x97')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x98'));db[_0x738e('0x99')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x9a'));db[_0x738e('0x9b')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x9c'));db[_0x738e('0x9d')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x9e'));db[_0x738e('0x9f')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xa0'));db[_0x738e('0xa1')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xa2'));db[_0x738e('0xa3')]=db['sequelize'][_0x738e('0x16')](_0x738e('0xa4'));db[_0x738e('0xa5')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xa6'));db[_0x738e('0xa7')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xa8'));db[_0x738e('0xa9')]=db[_0x738e('0x1')]['import'](_0x738e('0xaa'));db['SalesforceField']=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xab'));db[_0x738e('0xac')]=db['sequelize']['import'](_0x738e('0xad'));db['SugarcrmConfiguration']=db['sequelize'][_0x738e('0x16')](_0x738e('0xae'));db[_0x738e('0xaf')]=db['sequelize'][_0x738e('0x16')](_0x738e('0xb0'));db[_0x738e('0xb1')]=db['sequelize'][_0x738e('0x16')]('../api/intDeskAccount/intDeskAccount.model');db['DeskConfiguration']=db['sequelize']['import'](_0x738e('0xb2'));db[_0x738e('0xb3')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xb4'));db[_0x738e('0xb5')]=db[_0x738e('0x1')]['import'](_0x738e('0xb6'));db[_0x738e('0xb7')]=db[_0x738e('0x1')]['import'](_0x738e('0xb8'));db[_0x738e('0xb9')]=db[_0x738e('0x1')][_0x738e('0x16')]('../api/intZohoField/intZohoField.model');db[_0x738e('0xba')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xbb'));db[_0x738e('0xbc')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xbd'));db[_0x738e('0xbe')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xbf'));db['FreshdeskAccount']=db[_0x738e('0x1')]['import'](_0x738e('0xc0'));db['FreshdeskConfiguration']=db[_0x738e('0x1')][_0x738e('0x16')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db['FreshdeskField']=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xc1'));db['VtigerAccount']=db['sequelize'][_0x738e('0x16')](_0x738e('0xc2'));db[_0x738e('0xc3')]=db[_0x738e('0x1')]['import'](_0x738e('0xc4'));db[_0x738e('0xc5')]=db[_0x738e('0x1')][_0x738e('0x16')]('../api/intVtigerField/intVtigerField.model');db[_0x738e('0xc6')]=db[_0x738e('0x1')][_0x738e('0x16')]('../api/intServicenowAccount/intServicenowAccount.model');db['ServicenowConfiguration']=db[_0x738e('0x1')]['import'](_0x738e('0xc7'));db[_0x738e('0xc8')]=db['sequelize']['import'](_0x738e('0xc9'));db['Dynamics365Account']=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xca'));db['Dynamics365Configuration']=db[_0x738e('0x1')]['import']('../api/intDynamics365Configuration/intDynamics365Configuration.model');db['Dynamics365Field']=db[_0x738e('0x1')]['import']('../api/intDynamics365Field/intDynamics365Field.model');db[_0x738e('0xcb')]=db[_0x738e('0x1')]['import'](_0x738e('0xcc'));db['FreshsalesConfiguration']=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xcd'));db[_0x738e('0xce')]=db[_0x738e('0x1')]['import'](_0x738e('0xcf'));db[_0x738e('0x97')]=db[_0x738e('0x1')]['import'](_0x738e('0x98'));db[_0x738e('0xd0')]=db[_0x738e('0x1')]['import'](_0x738e('0xd1'));db[_0x738e('0xd2')]=db['sequelize']['import'](_0x738e('0xd3'));db['ChatInternalMessage']=db[_0x738e('0x1')][_0x738e('0x16')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x738e('0xd4')]=db[_0x738e('0x1')][_0x738e('0x16')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0x738e('0xd5')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xd6'));db[_0x738e('0xd7')]=db['sequelize'][_0x738e('0x16')](_0x738e('0xd8'));db[_0x738e('0xd9')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xda'));db[_0x738e('0xdb')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xdc'));db[_0x738e('0xdd')]=db[_0x738e('0x1')]['import']('../api/squareReportDetail/squareReportDetail.model');db['JscriptyProject']=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xde'));db[_0x738e('0xdf')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xe0'));db[_0x738e('0xe1')]=db[_0x738e('0x1')][_0x738e('0x16')]('../api/squareOdbc/squareOdbc.model');db['SquareProject']=db['sequelize']['import']('../api/squareProject/squareProject.model');db['SquareRecording']=db['sequelize'][_0x738e('0x16')]('../api/squareRecording/squareRecording.model');db[_0x738e('0xe2')]=db['sequelize']['import'](_0x738e('0xe3'));db[_0x738e('0xe4')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xe5'));db[_0x738e('0xe6')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xe7'));db[_0x738e('0xe8')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xe9'));db[_0x738e('0xea')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xeb'));db[_0x738e('0xec')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xed'));db[_0x738e('0xee')]=db[_0x738e('0x1')][_0x738e('0x16')]('../api/plugin/plugin.model');db[_0x738e('0xef')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xf0'));db['ChatTransferReport']=db['sequelize'][_0x738e('0x16')]('../api/chatTransferReport/chatTransferReport.model');db[_0x738e('0xf1')]=db[_0x738e('0x1')]['import'](_0x738e('0xf2'));db[_0x738e('0xf3')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xf4'));db[_0x738e('0xf5')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xf6'));db['CmList']=db[_0x738e('0x1')][_0x738e('0x16')]('../api/cmList/cmList.model');db[_0x738e('0xf7')]=db[_0x738e('0x1')]['import']('../api/voicePrefix/voicePrefix.model');db[_0x738e('0xf8')]=db[_0x738e('0x1')]['import'](_0x738e('0xf9'));db['UserProfileSection']=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xfa'));db[_0x738e('0xfb')]=db[_0x738e('0x1')]['import']('../api/userProfileResource/userProfileResource.model');db['UserNotification']=db[_0x738e('0x1')]['import']('../api/userNotification/userNotification.model');db[_0x738e('0xfc')]=db['sequelize']['import'](_0x738e('0xfd'));db[_0x738e('0xfe')]=db['sequelize'][_0x738e('0x16')](_0x738e('0xff'));db[_0x738e('0x100')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x101'));db[_0x738e('0x102')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x103'));db[_0x738e('0x104')]=db[_0x738e('0x1')]['import']('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0x738e('0x105')]=db['sequelize']['import'](_0x738e('0x106'));db[_0x738e('0x107')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x108'));db[_0x738e('0x109')]=db[_0x738e('0x1')]['import'](_0x738e('0x10a'));db['TeamVoiceQueue']=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x10b'));db[_0x738e('0x10c')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x10d'));db[_0x738e('0x10e')]=db['sequelize'][_0x738e('0x16')](_0x738e('0x10f'));db[_0x738e('0x110')]=db[_0x738e('0x1')][_0x738e('0x16')]('../api/user-setting/user-setting.model');db[_0x738e('0x111')]=db['sequelize'][_0x738e('0x16')](_0x738e('0x112'));db[_0x738e('0x13')][_0x738e('0x113')](db[_0x738e('0x21')],{'as':_0x738e('0x21'),'onDelete':_0x738e('0x114'),'foreignKey':'UserId'});db['User'][_0x738e('0x113')](db['UserSetting'],{'as':_0x738e('0x115'),'onDelete':_0x738e('0x114'),'foreignKey':_0x738e('0x116')});db[_0x738e('0x13')][_0x738e('0x117')](db['VoiceRecording'],{'as':_0x738e('0x118'),'foreignKey':_0x738e('0x116')});db[_0x738e('0x13')]['hasMany'](db[_0x738e('0x119')],{'as':_0x738e('0x11a'),'foreignKey':_0x738e('0x116')});db[_0x738e('0x13')][_0x738e('0x117')](db['VoiceExtension'],{'as':_0x738e('0x11b'),'onDelete':_0x738e('0x114'),'hooks':!![]});db['User'][_0x738e('0x117')](db[_0x738e('0x72')],{'as':'HopperFinals','foreignKey':_0x738e('0x116')});db[_0x738e('0x13')][_0x738e('0x117')](db[_0x738e('0x73')],{'as':_0x738e('0x11c'),'foreignKey':'UserId'});db[_0x738e('0x13')][_0x738e('0x117')](db['ReportAgentPreview'],{'as':_0x738e('0x75'),'foreignKey':_0x738e('0x116')});db[_0x738e('0x13')][_0x738e('0x117')](db['OpenchannelInteraction'],{'as':_0x738e('0x11d'),'foreignKey':_0x738e('0x116')});db['User']['hasMany'](db[_0x738e('0x11e')],{'as':_0x738e('0x11f'),'foreignKey':_0x738e('0x116')});db[_0x738e('0x13')][_0x738e('0x117')](db[_0x738e('0x120')],{'as':'SmsInteractions','foreignKey':_0x738e('0x116')});db[_0x738e('0x13')]['hasMany'](db['FaxInteraction'],{'as':_0x738e('0x121'),'foreignKey':_0x738e('0x116')});db[_0x738e('0x13')][_0x738e('0x117')](db[_0x738e('0x43')],{'as':_0x738e('0x122'),'foreignKey':_0x738e('0x116')});db[_0x738e('0x13')]['hasMany'](db[_0x738e('0x100')],{'as':_0x738e('0x123'),'foreignKey':_0x738e('0x116')});db['User'][_0x738e('0x117')](db[_0x738e('0x124')],{'as':'UserNotifications','foreignKey':'SenderId'});db[_0x738e('0x13')]['hasMany'](db[_0x738e('0x6e')],{'as':_0x738e('0x125'),'foreignKey':_0x738e('0x116'),'onDelete':'SET\x20NULL'});db[_0x738e('0x13')][_0x738e('0x126')](db[_0x738e('0xf8')],{'as':_0x738e('0xf8'),'foreignKey':_0x738e('0x127')});db[_0x738e('0x13')][_0x738e('0x128')](db[_0x738e('0x68')],{'as':_0x738e('0x129'),'through':_0x738e('0x12a')});db[_0x738e('0x13')][_0x738e('0x128')](db[_0x738e('0x6c')],{'as':_0x738e('0x12b'),'through':'cm_user_has_contacts'});db['User']['belongsToMany'](db[_0x738e('0x12c')],{'as':_0x738e('0x12d'),'through':_0x738e('0x12e')});db[_0x738e('0x13')]['belongsToMany'](db['Team'],{'through':_0x738e('0x12f')});db[_0x738e('0x13')][_0x738e('0x128')](db[_0x738e('0x43')],{'as':'MailInteractions','through':_0x738e('0x130')});db[_0x738e('0x13')][_0x738e('0x128')](db['ChatInteraction'],{'as':'ChatInteractions','through':'user_has_chat_interactions'});db[_0x738e('0x13')]['belongsToMany'](db[_0x738e('0x51')],{'as':_0x738e('0x121'),'through':_0x738e('0x131')});db[_0x738e('0x13')]['belongsToMany'](db['SmsInteraction'],{'as':_0x738e('0x132'),'through':_0x738e('0x133')});db[_0x738e('0x13')][_0x738e('0x128')](db['OpenchannelInteraction'],{'as':_0x738e('0x11d'),'through':'user_has_openchannel_interactions'});db[_0x738e('0x13')][_0x738e('0x128')](db[_0x738e('0x100')],{'as':_0x738e('0x123'),'through':_0x738e('0x134')});db[_0x738e('0x13')][_0x738e('0x128')](db[_0x738e('0x1c')],{'as':_0x738e('0x135'),'through':'UserVoiceQueue','required':![]});db['User'][_0x738e('0x128')](db[_0x738e('0xf7')],{'as':_0x738e('0x136'),'through':_0x738e('0x10e'),'required':![]});db[_0x738e('0x13')][_0x738e('0x128')](db[_0x738e('0x137')],{'as':_0x738e('0x138'),'through':_0x738e('0x33'),'required':![]});db[_0x738e('0x13')][_0x738e('0x128')](db[_0x738e('0x139')],{'as':_0x738e('0x13a'),'through':'UserChatQueue','required':![],'hooks':!![]});db[_0x738e('0x13')][_0x738e('0x128')](db[_0x738e('0x13b')],{'as':_0x738e('0x13c'),'through':'UserFaxQueue','required':![]});db[_0x738e('0x13')]['belongsToMany'](db[_0x738e('0x5a')],{'as':_0x738e('0x13d'),'through':_0x738e('0x37'),'required':![]});db['User'][_0x738e('0x128')](db['OpenchannelQueue'],{'as':_0x738e('0x13e'),'through':_0x738e('0x39'),'required':![]});db[_0x738e('0x13')][_0x738e('0x128')](db['WhatsappQueue'],{'as':_0x738e('0x13f'),'through':_0x738e('0x3a'),'required':![]});db['User'][_0x738e('0x128')](db[_0x738e('0x12c')],{'through':_0x738e('0x12e')});db[_0x738e('0x13')][_0x738e('0x128')](db[_0x738e('0x140')],{'as':'ChatWebsites','through':_0x738e('0x141')});db['User']['belongsToMany'](db[_0x738e('0x4d')],{'as':'FaxAccounts','through':_0x738e('0x142')});db[_0x738e('0x13')][_0x738e('0x128')](db[_0x738e('0x3e')],{'as':'MailAccounts','through':'user_has_mail_accounts'});db[_0x738e('0x13')][_0x738e('0x128')](db[_0x738e('0x143')],{'as':_0x738e('0x144'),'through':_0x738e('0x145')});db[_0x738e('0x13')][_0x738e('0x128')](db[_0x738e('0x57')],{'as':_0x738e('0x146'),'through':_0x738e('0x147')});db['User']['belongsToMany'](db[_0x738e('0xfc')],{'as':_0x738e('0x148'),'through':_0x738e('0x149')});db[_0x738e('0x15')][_0x738e('0x117')](db[_0x738e('0x19')],{'as':_0x738e('0x14a'),'onDelete':_0x738e('0x114'),'foreignKey':'ChanSpyId'});db[_0x738e('0x17')][_0x738e('0x117')](db['VoiceExtension'],{'onDelete':_0x738e('0x114')});db[_0x738e('0x19')]['hasMany'](db[_0x738e('0x19')],{'as':_0x738e('0x14b'),'onDelete':_0x738e('0x114')});db[_0x738e('0x1a')]['belongsToMany'](db['Sound'],{'as':_0x738e('0x14c'),'through':_0x738e('0x14d')});db['VoiceQueue']['hasMany'](db[_0x738e('0x119')],{'as':'Members','foreignKey':'VoiceQueueId'});db[_0x738e('0x1c')][_0x738e('0x117')](db['CmHopper'],{'as':_0x738e('0x125'),'foreignKey':'VoiceQueueId'});db[_0x738e('0x1c')][_0x738e('0x117')](db[_0x738e('0x72')],{'as':'HopperFinals','foreignKey':'VoiceQueueId'});db[_0x738e('0x1c')]['hasMany'](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0x738e('0x14e')});db[_0x738e('0x1c')][_0x738e('0x117')](db['ReportAgentPreview'],{'as':_0x738e('0x75'),'foreignKey':_0x738e('0x14e')});db[_0x738e('0x1c')]['hasMany'](db[_0x738e('0x70')],{'as':_0x738e('0x14f'),'foreignKey':'VoiceQueueId'});db[_0x738e('0x1c')][_0x738e('0x117')](db[_0x738e('0xd7')],{'as':_0x738e('0x150'),'foreignKey':_0x738e('0x14e')});db['VoiceQueue'][_0x738e('0x126')](db[_0x738e('0x2d')],{'as':'Trunk','foreignKey':_0x738e('0x151')});db[_0x738e('0x1c')][_0x738e('0x126')](db['Trunk'],{'as':_0x738e('0x152'),'foreignKey':'TrunkBackupId'});db[_0x738e('0x1c')][_0x738e('0x126')](db[_0x738e('0x81')],{'as':_0x738e('0x81'),'foreignKey':'IntervalId'});db[_0x738e('0x1c')]['belongsTo'](db[_0x738e('0x83')],{'as':_0x738e('0x153'),'foreignKey':_0x738e('0x154')});db['VoiceQueue']['belongsToMany'](db[_0x738e('0x12c')],{'as':_0x738e('0x12d'),'through':_0x738e('0x155')});db['VoiceQueue'][_0x738e('0x128')](db['User'],{'as':'Agents','through':'UserVoiceQueue'});db[_0x738e('0x1c')][_0x738e('0x128')](db[_0x738e('0xe4')],{'as':'Teams','through':_0x738e('0x156')});db[_0x738e('0x1c')][_0x738e('0x128')](db['CmList'],{'as':_0x738e('0x157'),'through':_0x738e('0x158')});db[_0x738e('0x1e')][_0x738e('0x126')](db[_0x738e('0x13')],{'as':_0x738e('0x13'),'foreignKey':'UserId'});db[_0x738e('0x20')][_0x738e('0x126')](db[_0x738e('0x13')],{'as':_0x738e('0x13'),'foreignKey':'UserId'});db[_0x738e('0x21')]['hasMany'](db[_0x738e('0x22')],{'as':_0x738e('0x159'),'onDelete':_0x738e('0x114'),'foreignKey':_0x738e('0x15a'),'sourceKey':'mailbox'});db[_0x738e('0x22')][_0x738e('0x126')](db[_0x738e('0x21')],{'foreignKey':_0x738e('0x15a'),'targetKey':_0x738e('0x15b')});db[_0x738e('0x15c')][_0x738e('0x117')](db['VoiceQueueReport'],{'as':_0x738e('0x15d'),'foreignKey':'uniqueid','constraints':![]});db[_0x738e('0x15c')]['hasMany'](db[_0x738e('0x27')],{'as':_0x738e('0x15e'),'foreignKey':'uniqueid','constraints':![]});db[_0x738e('0x15c')]['belongsTo'](db[_0x738e('0x13')],{'as':'User','foreignKey':_0x738e('0x116')});db[_0x738e('0x15c')][_0x738e('0x126')](db[_0x738e('0x6c')],{'as':_0x738e('0x15f'),'foreignKey':_0x738e('0x160')});db['MailServerIn']['belongsTo'](db[_0x738e('0x3e')],{'as':_0x738e('0x3e'),'foreignKey':_0x738e('0x161')});db['MailServerIn'][_0x738e('0x126')](db[_0x738e('0x109')],{'as':_0x738e('0x109'),'foreignKey':_0x738e('0x162'),'onDelete':_0x738e('0x163')});db[_0x738e('0x164')][_0x738e('0x126')](db[_0x738e('0x3e')],{'as':'MailAccount','foreignKey':_0x738e('0x161')});db[_0x738e('0x164')][_0x738e('0x126')](db[_0x738e('0x109')],{'as':_0x738e('0x109'),'foreignKey':_0x738e('0x162'),'onDelete':_0x738e('0x163')});db[_0x738e('0x3e')][_0x738e('0x113')](db[_0x738e('0x3c')],{'as':_0x738e('0x165'),'onDelete':'cascade'});db[_0x738e('0x3e')][_0x738e('0x113')](db[_0x738e('0x164')],{'as':'Smtp','onDelete':'cascade'});db[_0x738e('0x3e')][_0x738e('0x117')](db['Disposition'],{'as':_0x738e('0x166'),'foreignKey':_0x738e('0x161'),'onDelete':_0x738e('0x114')});db[_0x738e('0x3e')][_0x738e('0x117')](db[_0x738e('0x7d')],{'as':_0x738e('0x167'),'foreignKey':_0x738e('0x161')});db[_0x738e('0x3e')][_0x738e('0x117')](db[_0x738e('0x45')],{'as':_0x738e('0x159'),'foreignKey':_0x738e('0x161')});db['MailAccount'][_0x738e('0x117')](db['MailInteraction'],{'as':_0x738e('0x168')});db[_0x738e('0x3e')][_0x738e('0x117')](db[_0x738e('0x47')],{'as':_0x738e('0x14b'),'foreignKey':_0x738e('0x161'),'onDelete':_0x738e('0x114')});db[_0x738e('0x3e')][_0x738e('0x126')](db[_0x738e('0x12c')],{'as':'List','foreignKey':_0x738e('0x169')});db[_0x738e('0x3e')][_0x738e('0x126')](db[_0x738e('0x16a')],{'as':'Template','foreignKey':_0x738e('0x16b')});db['MailAccount'][_0x738e('0x126')](db['Pause'],{'as':_0x738e('0x153'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x738e('0x3e')][_0x738e('0x128')](db['User'],{'as':'Agents','through':_0x738e('0x16c')});db['MailQueue'][_0x738e('0x128')](db[_0x738e('0x13')],{'as':_0x738e('0x16d'),'through':_0x738e('0x33')});db[_0x738e('0x137')][_0x738e('0x128')](db[_0x738e('0xe4')],{'through':_0x738e('0x16e'),'as':_0x738e('0x16f')});db['MailInteraction'][_0x738e('0x117')](db['MailMessage'],{'as':_0x738e('0x159'),'onDelete':_0x738e('0x114'),'foreignKey':_0x738e('0x170')});db[_0x738e('0x43')][_0x738e('0x126')](db[_0x738e('0x3e')],{'as':_0x738e('0x171'),'foreignKey':_0x738e('0x161')});db[_0x738e('0x43')][_0x738e('0x126')](db[_0x738e('0x6c')],{'as':_0x738e('0x15f'),'foreignKey':'ContactId'});db[_0x738e('0x43')][_0x738e('0x126')](db[_0x738e('0x13')],{'as':_0x738e('0x172'),'foreignKey':_0x738e('0x116')});db[_0x738e('0x43')]['belongsToMany'](db['Tag'],{'through':_0x738e('0x173'),'as':_0x738e('0x174')});db[_0x738e('0x43')][_0x738e('0x128')](db[_0x738e('0x8c')],{'through':_0x738e('0x173'),'as':_0x738e('0x175')});db[_0x738e('0x43')]['belongsToMany'](db['User'],{'as':_0x738e('0x176'),'through':_0x738e('0x130'),'foreignKey':_0x738e('0x170')});db['MailMessage']['hasMany'](db[_0x738e('0xec')],{'as':_0x738e('0x177'),'onDelete':_0x738e('0x114')});db[_0x738e('0x45')]['belongsTo'](db['User'],{'as':_0x738e('0x13')});db[_0x738e('0x45')][_0x738e('0x126')](db['CmContact'],{'onDelete':_0x738e('0x114'),'as':_0x738e('0x15f')});db[_0x738e('0x45')]['belongsTo'](db[_0x738e('0x43')],{'as':_0x738e('0x178'),'foreignKey':_0x738e('0x170')});db[_0x738e('0x45')][_0x738e('0x126')](db[_0x738e('0x3e')],{'as':_0x738e('0x171'),'foreignKey':'MailAccountId'});db['MailMessage'][_0x738e('0x126')](db[_0x738e('0x140')],{'as':'ChatWebsite','foreignKey':_0x738e('0x179')});db[_0x738e('0x45')][_0x738e('0x126')](db['ChatOfflineMessage'],{'as':_0x738e('0x17a'),'foreignKey':'ChatOfflineMessageId'});db['MailApplication'][_0x738e('0x126')](db[_0x738e('0x13')],{'onDelete':_0x738e('0x163')});db['MailApplication'][_0x738e('0x126')](db[_0x738e('0x137')],{'onDelete':'restrict'});db[_0x738e('0x47')][_0x738e('0x126')](db[_0x738e('0x3e')],{'onDelete':_0x738e('0x163')});db[_0x738e('0x47')][_0x738e('0x126')](db['Interval'],{'onDelete':_0x738e('0x163'),'foreignKey':_0x738e('0x17b')});db[_0x738e('0x47')][_0x738e('0x126')](db[_0x738e('0x8c')],{'onDelete':'restrict','foreignKey':_0x738e('0x17c')});db[_0x738e('0x48')][_0x738e('0x126')](db['MailAccount'],{});db['MailQueueReport'][_0x738e('0x126')](db[_0x738e('0x12c')],{'as':'List','foreignKey':_0x738e('0x169')});db[_0x738e('0x48')][_0x738e('0x126')](db[_0x738e('0x6c')],{'as':'Contact','foreignKey':_0x738e('0x160')});db[_0x738e('0x48')]['belongsTo'](db[_0x738e('0x43')],{});db[_0x738e('0x48')][_0x738e('0x126')](db[_0x738e('0x45')],{});db[_0x738e('0x48')][_0x738e('0x126')](db[_0x738e('0x13')],{});db[_0x738e('0x48')][_0x738e('0x126')](db[_0x738e('0x137')],{});db[_0x738e('0x4a')]['hasMany'](db[_0x738e('0x4c')],{'as':_0x738e('0x17d'),'onDelete':'cascade'});db[_0x738e('0x4d')][_0x738e('0x117')](db['Disposition'],{'as':_0x738e('0x166'),'foreignKey':_0x738e('0x17e'),'onDelete':_0x738e('0x114')});db[_0x738e('0x4d')]['hasMany'](db[_0x738e('0x7d')],{'as':'Answers','foreignKey':_0x738e('0x17e')});db[_0x738e('0x4d')]['hasMany'](db[_0x738e('0x51')],{'as':'Interactions'});db[_0x738e('0x4d')][_0x738e('0x117')](db[_0x738e('0x4f')],{'as':'Applications','foreignKey':_0x738e('0x17e'),'onDelete':_0x738e('0x114')});db[_0x738e('0x4d')][_0x738e('0x117')](db[_0x738e('0x19')],{'as':'Exntensions','onDelete':'cascade'});db[_0x738e('0x4d')][_0x738e('0x117')](db[_0x738e('0x53')],{'as':_0x738e('0x159')});db[_0x738e('0x4d')]['belongsTo'](db[_0x738e('0x2d')],{'as':_0x738e('0x2d')});db['FaxAccount'][_0x738e('0x126')](db['CmList'],{'as':_0x738e('0x17f'),'foreignKey':_0x738e('0x169')});db['FaxAccount'][_0x738e('0x126')](db[_0x738e('0x83')],{'as':'mandatoryDispositionPause','foreignKey':_0x738e('0x154')});db[_0x738e('0x4d')][_0x738e('0x128')](db['User'],{'as':_0x738e('0x16d'),'through':_0x738e('0x142')});db[_0x738e('0x4f')]['belongsTo'](db['User'],{'onDelete':_0x738e('0x163')});db[_0x738e('0x4f')][_0x738e('0x126')](db[_0x738e('0x13b')],{'onDelete':_0x738e('0x163')});db[_0x738e('0x4f')]['belongsTo'](db['FaxAccount'],{'onDelete':'restrict'});db['FaxApplication'][_0x738e('0x126')](db[_0x738e('0x8c')],{'onDelete':_0x738e('0x163'),'foreignKey':_0x738e('0x17c')});db[_0x738e('0x51')]['hasMany'](db[_0x738e('0x53')],{'as':_0x738e('0x159'),'onDelete':_0x738e('0x114'),'foreignKey':'FaxInteractionId'});db[_0x738e('0x51')][_0x738e('0x126')](db[_0x738e('0x4d')],{'as':_0x738e('0x171'),'foreignKey':_0x738e('0x17e')});db['FaxInteraction'][_0x738e('0x126')](db[_0x738e('0x6c')],{'as':_0x738e('0x15f'),'foreignKey':_0x738e('0x160')});db[_0x738e('0x51')][_0x738e('0x126')](db[_0x738e('0x13')],{'as':_0x738e('0x172'),'foreignKey':'UserId'});db['FaxInteraction'][_0x738e('0x128')](db[_0x738e('0x8c')],{'through':_0x738e('0x180'),'as':_0x738e('0x174')});db[_0x738e('0x51')][_0x738e('0x128')](db[_0x738e('0x8c')],{'through':'fax_interaction_has_tags','as':_0x738e('0x175')});db[_0x738e('0x51')]['belongsToMany'](db[_0x738e('0x13')],{'as':_0x738e('0x176'),'through':'user_has_fax_interactions','foreignKey':_0x738e('0x181')});db[_0x738e('0x53')][_0x738e('0x126')](db['User'],{'onDelete':_0x738e('0x114'),'as':_0x738e('0x13')});db[_0x738e('0x53')][_0x738e('0x126')](db[_0x738e('0x51')],{'as':_0x738e('0x178'),'foreignKey':_0x738e('0x181')});db[_0x738e('0x53')][_0x738e('0x126')](db[_0x738e('0x6c')],{'onDelete':_0x738e('0x114'),'as':'Contact'});db[_0x738e('0x53')][_0x738e('0x126')](db['Attachment'],{'as':_0x738e('0xec'),'foreignKey':'AttachmentId'});db['FaxMessage']['belongsTo'](db[_0x738e('0x4d')],{'as':_0x738e('0x171'),'foreignKey':'FaxAccountId'});db[_0x738e('0x13b')][_0x738e('0x128')](db[_0x738e('0x13')],{'as':_0x738e('0x16d'),'through':_0x738e('0x35')});db[_0x738e('0x13b')][_0x738e('0x128')](db[_0x738e('0xe4')],{'through':_0x738e('0x182'),'as':_0x738e('0x16f')});db[_0x738e('0x55')]['belongsTo'](db['FaxAccount'],{});db[_0x738e('0x55')][_0x738e('0x126')](db[_0x738e('0x12c')],{'as':_0x738e('0x17f'),'foreignKey':_0x738e('0x169')});db[_0x738e('0x55')][_0x738e('0x126')](db[_0x738e('0x6c')],{'as':_0x738e('0x15f'),'foreignKey':_0x738e('0x160')});db[_0x738e('0x55')][_0x738e('0x126')](db[_0x738e('0x51')],{});db[_0x738e('0x55')][_0x738e('0x126')](db[_0x738e('0x53')],{});db[_0x738e('0x55')][_0x738e('0x126')](db['User'],{});db[_0x738e('0x55')][_0x738e('0x126')](db[_0x738e('0x13b')],{});db[_0x738e('0x57')][_0x738e('0x117')](db[_0x738e('0x7e')],{'as':_0x738e('0x166'),'foreignKey':'SmsAccountId','onDelete':_0x738e('0x114')});db[_0x738e('0x57')][_0x738e('0x117')](db['CannedAnswer'],{'as':_0x738e('0x167'),'foreignKey':_0x738e('0x183')});db[_0x738e('0x57')][_0x738e('0x117')](db[_0x738e('0x58')],{'as':_0x738e('0x159'),'foreignKey':_0x738e('0x183')});db[_0x738e('0x57')][_0x738e('0x117')](db[_0x738e('0x120')],{'as':_0x738e('0x168')});db['SmsAccount']['hasMany'](db['SmsApplication'],{'as':'Applications','foreignKey':_0x738e('0x183'),'onDelete':_0x738e('0x114')});db[_0x738e('0x57')][_0x738e('0x126')](db[_0x738e('0x12c')],{'as':_0x738e('0x17f'),'foreignKey':_0x738e('0x169')});db[_0x738e('0x57')]['belongsTo'](db['Pause'],{'as':_0x738e('0x153'),'foreignKey':_0x738e('0x154')});db[_0x738e('0x57')][_0x738e('0x128')](db[_0x738e('0x13')],{'as':_0x738e('0x16d'),'through':_0x738e('0x147')});db[_0x738e('0x184')]['belongsTo'](db[_0x738e('0x13')],{'onDelete':_0x738e('0x163')});db[_0x738e('0x184')][_0x738e('0x126')](db[_0x738e('0x5a')],{'onDelete':_0x738e('0x163')});db['SmsApplication'][_0x738e('0x126')](db[_0x738e('0x57')],{'onDelete':_0x738e('0x163')});db[_0x738e('0x184')]['belongsTo'](db['Interval'],{'onDelete':_0x738e('0x163'),'foreignKey':_0x738e('0x17b')});db['SmsApplication']['belongsTo'](db[_0x738e('0x8c')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0x738e('0x120')][_0x738e('0x117')](db[_0x738e('0x58')],{'as':_0x738e('0x159'),'onDelete':_0x738e('0x114'),'foreignKey':'SmsInteractionId'});db['SmsInteraction'][_0x738e('0x126')](db[_0x738e('0x57')],{'as':_0x738e('0x171'),'foreignKey':_0x738e('0x183')});db['SmsInteraction']['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':_0x738e('0x160')});db[_0x738e('0x120')]['belongsTo'](db[_0x738e('0x13')],{'as':_0x738e('0x172'),'foreignKey':_0x738e('0x116')});db[_0x738e('0x120')][_0x738e('0x128')](db[_0x738e('0x8c')],{'through':_0x738e('0x185'),'as':'Tags'});db[_0x738e('0x120')][_0x738e('0x128')](db[_0x738e('0x8c')],{'through':'sms_interaction_has_tags','as':_0x738e('0x175')});db[_0x738e('0x120')][_0x738e('0x128')](db[_0x738e('0x13')],{'as':_0x738e('0x176'),'through':_0x738e('0x133'),'foreignKey':_0x738e('0x186')});db[_0x738e('0x58')][_0x738e('0x126')](db[_0x738e('0x13')],{'as':_0x738e('0x13')});db[_0x738e('0x58')][_0x738e('0x126')](db[_0x738e('0x6c')],{'onDelete':'cascade','as':_0x738e('0x15f')});db[_0x738e('0x58')][_0x738e('0x126')](db['SmsInteraction'],{'onDelete':'cascade','as':_0x738e('0x178'),'foreignKey':_0x738e('0x186')});db['SmsMessage']['belongsTo'](db['SmsAccount'],{'as':_0x738e('0x171'),'foreignKey':_0x738e('0x183')});db[_0x738e('0x5a')][_0x738e('0x128')](db['User'],{'as':_0x738e('0x16d'),'through':'UserSmsQueue','foreignKey':_0x738e('0x187')});db[_0x738e('0x5a')][_0x738e('0x128')](db[_0x738e('0xe4')],{'through':_0x738e('0x188'),'as':'Teams'});db[_0x738e('0x143')][_0x738e('0x117')](db[_0x738e('0x7e')],{'as':_0x738e('0x166'),'foreignKey':_0x738e('0x189'),'onDelete':_0x738e('0x114')});db['OpenchannelAccount']['hasMany'](db[_0x738e('0x7d')],{'as':_0x738e('0x167'),'foreignKey':_0x738e('0x189')});db[_0x738e('0x143')]['hasMany'](db[_0x738e('0x5e')],{'as':_0x738e('0x168'),'foreignKey':_0x738e('0x189')});db[_0x738e('0x143')][_0x738e('0x117')](db[_0x738e('0x18a')],{'as':'Messages','foreignKey':_0x738e('0x189')});db[_0x738e('0x143')]['hasMany'](db['OpenchannelApplication'],{'as':_0x738e('0x14b'),'foreignKey':'OpenchannelAccountId','onDelete':_0x738e('0x114')});db[_0x738e('0x143')][_0x738e('0x126')](db[_0x738e('0x12c')],{'as':'List','foreignKey':_0x738e('0x169')});db['OpenchannelAccount'][_0x738e('0x126')](db[_0x738e('0x83')],{'as':_0x738e('0x153'),'foreignKey':_0x738e('0x154')});db['OpenchannelAccount'][_0x738e('0x128')](db['User'],{'as':'Agents','through':'user_has_openchannel_accounts'});db[_0x738e('0x5d')][_0x738e('0x126')](db[_0x738e('0x13')],{'onDelete':'restrict'});db[_0x738e('0x5d')][_0x738e('0x126')](db[_0x738e('0x61')],{'onDelete':'restrict','foreignKey':'OpenchannelQueueId'});db[_0x738e('0x5d')]['belongsTo'](db[_0x738e('0x143')],{'onDelete':_0x738e('0x163'),'foreignKey':_0x738e('0x189')});db[_0x738e('0x5d')][_0x738e('0x126')](db['Interval'],{'onDelete':_0x738e('0x163'),'foreignKey':'IntervalId'});db[_0x738e('0x5d')][_0x738e('0x126')](db[_0x738e('0x8c')],{'onDelete':_0x738e('0x163'),'foreignKey':_0x738e('0x17c')});db['OpenchannelInteraction'][_0x738e('0x117')](db['OpenchannelMessage'],{'as':_0x738e('0x159'),'onDelete':'cascade','foreignKey':_0x738e('0x18b')});db[_0x738e('0x5e')][_0x738e('0x126')](db[_0x738e('0x143')],{'as':'Account','foreignKey':'OpenchannelAccountId'});db['OpenchannelInteraction'][_0x738e('0x126')](db[_0x738e('0x6c')],{'as':_0x738e('0x15f'),'foreignKey':'ContactId'});db['OpenchannelInteraction'][_0x738e('0x126')](db[_0x738e('0x13')],{'as':_0x738e('0x172'),'foreignKey':_0x738e('0x116')});db['OpenchannelInteraction'][_0x738e('0x128')](db[_0x738e('0x8c')],{'through':_0x738e('0x18c'),'as':'Tags'});db['OpenchannelInteraction'][_0x738e('0x128')](db[_0x738e('0x8c')],{'through':_0x738e('0x18c'),'as':_0x738e('0x175')});db[_0x738e('0x5e')][_0x738e('0x128')](db[_0x738e('0x13')],{'as':_0x738e('0x176'),'through':'user_has_openchannel_interactions','foreignKey':_0x738e('0x18b')});db['OpenchannelMessage'][_0x738e('0x126')](db['User'],{'onDelete':_0x738e('0x114'),'as':'User'});db[_0x738e('0x18a')][_0x738e('0x126')](db['CmContact'],{'onDelete':'cascade','as':_0x738e('0x15f')});db['OpenchannelMessage'][_0x738e('0x126')](db[_0x738e('0x5e')],{'onDelete':_0x738e('0x114'),'as':'Interaction','foreignKey':_0x738e('0x18b')});db['OpenchannelMessage'][_0x738e('0x126')](db[_0x738e('0xec')],{'as':_0x738e('0xec'),'foreignKey':_0x738e('0x18d')});db[_0x738e('0x18a')][_0x738e('0x126')](db[_0x738e('0x143')],{'as':'Account','foreignKey':'OpenchannelAccountId'});db['OpenchannelQueue'][_0x738e('0x128')](db[_0x738e('0x13')],{'as':_0x738e('0x16d'),'through':_0x738e('0x39'),'foreignKey':_0x738e('0x18e')});db[_0x738e('0x61')][_0x738e('0x128')](db[_0x738e('0xe4')],{'through':_0x738e('0x18f'),'as':_0x738e('0x16f')});db[_0x738e('0x140')]['hasMany'](db[_0x738e('0x7e')],{'as':_0x738e('0x166'),'foreignKey':'ChatWebsiteId','onDelete':'cascade'});db[_0x738e('0x140')]['hasMany'](db[_0x738e('0x7d')],{'as':_0x738e('0x167'),'foreignKey':'ChatWebsiteId'});db['ChatWebsite'][_0x738e('0x117')](db[_0x738e('0x190')],{'as':_0x738e('0x191')});db[_0x738e('0x140')][_0x738e('0x117')](db[_0x738e('0x11e')],{'as':'Interactions'});db[_0x738e('0x140')][_0x738e('0x117')](db[_0x738e('0x63')],{'as':_0x738e('0x14b'),'foreignKey':_0x738e('0x179'),'onDelete':'cascade'});db[_0x738e('0x140')]['hasMany'](db[_0x738e('0x192')],{'as':_0x738e('0x159')});db[_0x738e('0x140')][_0x738e('0x126')](db[_0x738e('0x12c')],{'as':_0x738e('0x17f'),'foreignKey':_0x738e('0x169')});db[_0x738e('0x140')][_0x738e('0x126')](db['Interval'],{'as':_0x738e('0x81'),'foreignKey':_0x738e('0x17b')});db['ChatWebsite']['belongsTo'](db[_0x738e('0x3e')],{'as':'MailAccount','foreignKey':_0x738e('0x161')});db[_0x738e('0x140')]['belongsTo'](db[_0x738e('0x83')],{'as':_0x738e('0x153'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x738e('0x140')][_0x738e('0x128')](db['User'],{'as':'Agents','through':'user_has_chat_websites'});db['OpenchannelQueueReport'][_0x738e('0x126')](db[_0x738e('0x143')],{});db['OpenchannelQueueReport'][_0x738e('0x126')](db['CmList'],{'as':_0x738e('0x17f'),'foreignKey':_0x738e('0x169')});db[_0x738e('0x193')]['belongsTo'](db[_0x738e('0x6c')],{'as':_0x738e('0x15f'),'foreignKey':_0x738e('0x160')});db['OpenchannelQueueReport']['belongsTo'](db[_0x738e('0x5e')],{});db[_0x738e('0x193')][_0x738e('0x126')](db[_0x738e('0x18a')],{});db[_0x738e('0x193')]['belongsTo'](db[_0x738e('0x13')],{});db[_0x738e('0x193')]['belongsTo'](db[_0x738e('0x61')],{});db['ChatApplication'][_0x738e('0x126')](db[_0x738e('0x13')],{'as':_0x738e('0x194'),'foreignKey':_0x738e('0x116'),'onDelete':'restrict'});db[_0x738e('0x63')][_0x738e('0x126')](db['ChatQueue'],{'as':_0x738e('0x195'),'foreignKey':_0x738e('0x196'),'onDelete':_0x738e('0x163')});db[_0x738e('0x63')][_0x738e('0x126')](db[_0x738e('0x140')],{'as':_0x738e('0x197'),'foreignKey':_0x738e('0x179'),'onDelete':_0x738e('0x163')});db[_0x738e('0x63')][_0x738e('0x126')](db['Tag'],{'onDelete':_0x738e('0x163'),'foreignKey':_0x738e('0x17c')});db[_0x738e('0x11e')][_0x738e('0x117')](db['ChatMessage'],{'as':_0x738e('0x159'),'onDelete':'cascade','foreignKey':_0x738e('0x198')});db[_0x738e('0x11e')][_0x738e('0x126')](db[_0x738e('0x140')],{'as':_0x738e('0x171'),'foreignKey':_0x738e('0x179')});db[_0x738e('0x11e')]['belongsTo'](db[_0x738e('0x6c')],{'as':_0x738e('0x15f'),'foreignKey':_0x738e('0x160')});db[_0x738e('0x11e')]['belongsTo'](db[_0x738e('0x13')],{'as':'Owner','foreignKey':_0x738e('0x116')});db[_0x738e('0x11e')][_0x738e('0x128')](db[_0x738e('0x8c')],{'through':_0x738e('0x199'),'as':_0x738e('0x174')});db[_0x738e('0x11e')][_0x738e('0x128')](db['Tag'],{'through':_0x738e('0x199'),'as':_0x738e('0x175')});db[_0x738e('0x11e')][_0x738e('0x128')](db[_0x738e('0x13')],{'as':_0x738e('0x176'),'through':_0x738e('0x19a'),'foreignKey':_0x738e('0x198')});db[_0x738e('0x192')][_0x738e('0x126')](db['User'],{'onDelete':_0x738e('0x114'),'as':_0x738e('0x13')});db[_0x738e('0x192')][_0x738e('0x126')](db[_0x738e('0x6c')],{'onDelete':_0x738e('0x114'),'as':'Contact','foreignKey':_0x738e('0x160')});db['ChatMessage'][_0x738e('0x126')](db[_0x738e('0x11e')],{'onDelete':_0x738e('0x114'),'as':'Interaction','foreignKey':_0x738e('0x198')});db[_0x738e('0x192')]['belongsTo'](db[_0x738e('0xec')],{'as':_0x738e('0xec'),'foreignKey':_0x738e('0x18d')});db['ChatMessage'][_0x738e('0x126')](db[_0x738e('0x140')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x738e('0x17a')][_0x738e('0x117')](db[_0x738e('0xec')],{'as':_0x738e('0x177'),'foreignKey':_0x738e('0x19b'),'onDelete':_0x738e('0x114'),'hooks':!![]});db['ChatOfflineMessage'][_0x738e('0x126')](db[_0x738e('0x6c')],{'onDelete':_0x738e('0x114'),'as':_0x738e('0x15f'),'foreignKey':_0x738e('0x160')});db[_0x738e('0x17a')][_0x738e('0x126')](db[_0x738e('0x140')],{'as':_0x738e('0x171'),'foreignKey':'ChatWebsiteId'});db[_0x738e('0x139')][_0x738e('0x128')](db['User'],{'as':_0x738e('0x16d'),'through':_0x738e('0x32'),'hooks':!![]});db[_0x738e('0x139')][_0x738e('0x128')](db['Team'],{'through':'team_has_chat_queues','as':_0x738e('0x16f')});db[_0x738e('0x68')][_0x738e('0x117')](db[_0x738e('0x19c')],{'as':_0x738e('0x159'),'foreignKey':_0x738e('0x19d'),'onDelete':_0x738e('0x114')});db[_0x738e('0x68')][_0x738e('0x128')](db[_0x738e('0x13')],{'as':_0x738e('0x19e'),'through':'chat_group_has_users'});db[_0x738e('0x190')][_0x738e('0x126')](db['ChatWebsite'],{'as':_0x738e('0x197'),'foreignKey':_0x738e('0x179')});db[_0x738e('0x6a')][_0x738e('0x117')](db['CmContact'],{'as':_0x738e('0x12b'),'foreignKey':_0x738e('0x19f')});db[_0x738e('0x6c')][_0x738e('0x117')](db[_0x738e('0x1a0')],{'as':'Phones','foreignKey':_0x738e('0x1a1')});db[_0x738e('0x6c')][_0x738e('0x117')](db[_0x738e('0x6e')],{'as':_0x738e('0x125'),'foreignKey':_0x738e('0x160')});db[_0x738e('0x6c')]['hasMany'](db[_0x738e('0x72')],{'as':_0x738e('0x1a2'),'foreignKey':_0x738e('0x160')});db[_0x738e('0x6c')]['hasMany'](db[_0x738e('0x73')],{'as':_0x738e('0x1a3'),'foreignKey':_0x738e('0x160')});db['CmContact'][_0x738e('0x117')](db['ReportAgentPreview'],{'as':_0x738e('0x75'),'foreignKey':_0x738e('0x160')});db['CmContact'][_0x738e('0x117')](db[_0x738e('0xd7')],{'as':_0x738e('0x150'),'foreignKey':_0x738e('0x160')});db[_0x738e('0x6c')]['hasMany'](db[_0x738e('0x5e')],{'as':_0x738e('0x11d'),'foreignKey':_0x738e('0x160'),'onDelete':'restrict'});db['CmContact']['hasMany'](db[_0x738e('0x11e')],{'as':_0x738e('0x11f'),'foreignKey':'ContactId','onDelete':_0x738e('0x163')});db[_0x738e('0x6c')][_0x738e('0x117')](db[_0x738e('0x120')],{'as':_0x738e('0x132'),'foreignKey':_0x738e('0x160'),'onDelete':_0x738e('0x163')});db['CmContact'][_0x738e('0x117')](db[_0x738e('0x51')],{'as':_0x738e('0x121'),'foreignKey':_0x738e('0x160'),'onDelete':_0x738e('0x163')});db[_0x738e('0x6c')]['hasMany'](db[_0x738e('0x43')],{'as':'MailInteractions','foreignKey':_0x738e('0x160'),'onDelete':'restrict'});db[_0x738e('0x6c')][_0x738e('0x126')](db[_0x738e('0x6a')],{'as':_0x738e('0x1a4'),'foreignKey':'CompanyId'});db['CmContact'][_0x738e('0x126')](db[_0x738e('0x12c')],{'as':_0x738e('0x17f'),'foreignKey':_0x738e('0x169'),'onDelete':_0x738e('0x114')});db['CmContact'][_0x738e('0x128')](db[_0x738e('0x13')],{'as':'Users','through':_0x738e('0x1a5')});db[_0x738e('0x6c')][_0x738e('0x128')](db[_0x738e('0x8c')],{'as':'Tags','through':_0x738e('0x1a6')});db[_0x738e('0x6c')][_0x738e('0x128')](db[_0x738e('0x8c')],{'through':_0x738e('0x1a6'),'as':_0x738e('0x175')});db['CmHopper'][_0x738e('0x117')](db[_0x738e('0x91')],{'as':_0x738e('0x1a7'),'foreignKey':_0x738e('0x1a8')});db[_0x738e('0x6e')][_0x738e('0x126')](db['CmContact'],{'as':_0x738e('0x15f'),'foreignKey':_0x738e('0x160'),'onDelete':_0x738e('0x114')});db[_0x738e('0x6e')][_0x738e('0x126')](db[_0x738e('0x12c')],{'as':'List','foreignKey':'ListId','onDelete':_0x738e('0x114')});db[_0x738e('0x6e')][_0x738e('0x126')](db[_0x738e('0x13')],{'as':'Agent','foreignKey':'UserId'});db[_0x738e('0x6e')][_0x738e('0x126')](db[_0x738e('0x1c')],{'as':_0x738e('0x195'),'foreignKey':_0x738e('0x14e'),'onDelete':_0x738e('0x114')});db[_0x738e('0x6e')][_0x738e('0x126')](db[_0x738e('0xe8')],{'as':_0x738e('0xe8'),'foreignKey':_0x738e('0x1a9'),'onDelete':_0x738e('0x114')});db[_0x738e('0x6e')][_0x738e('0x126')](db[_0x738e('0x13')],{'as':_0x738e('0x172'),'foreignKey':_0x738e('0x1aa')});db['CmHopperBlack']['belongsTo'](db[_0x738e('0x6c')],{'as':_0x738e('0x15f'),'foreignKey':_0x738e('0x160'),'onDelete':'cascade'});db[_0x738e('0x70')][_0x738e('0x126')](db['CmList'],{'as':_0x738e('0x17f'),'foreignKey':_0x738e('0x169'),'onDelete':_0x738e('0x114')});db[_0x738e('0x70')][_0x738e('0x126')](db['VoiceQueue'],{'as':_0x738e('0x195'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x738e('0x70')][_0x738e('0x126')](db[_0x738e('0xe8')],{'as':_0x738e('0xe8'),'foreignKey':_0x738e('0x1a9'),'onDelete':_0x738e('0x114')});db['Automation']['hasMany'](db[_0x738e('0x80')],{'as':{'plural':_0x738e('0x1ab'),'singular':_0x738e('0x1ac')},'foreignKey':_0x738e('0x1ad'),'onDelete':'cascade','hooks':!![]});db[_0x738e('0x7b')]['hasMany'](db[_0x738e('0x80')],{'as':{'plural':'Any','singular':_0x738e('0x1ae')},'foreignKey':_0x738e('0x1af'),'onDelete':_0x738e('0x114'),'hooks':!![]});db[_0x738e('0x7b')]['hasMany'](db['Action'],{'as':'Actions','foreignKey':'AutomationId','onDelete':_0x738e('0x114'),'hooks':!![]});db['Disposition'][_0x738e('0x117')](db[_0x738e('0x7e')],{'as':_0x738e('0x166'),'foreignKey':_0x738e('0x1b0'),'onDelete':_0x738e('0x114')});db[_0x738e('0x81')][_0x738e('0x117')](db['Interval'],{'as':'Intervals','foreignKey':_0x738e('0x17b'),'onDelete':_0x738e('0x114'),'hooks':!![],'required':![]});db['Interval'][_0x738e('0x117')](db[_0x738e('0x19')],{'as':_0x738e('0x11b'),'foreignKey':_0x738e('0x17b'),'onDelete':_0x738e('0x163')});db['Interval'][_0x738e('0x117')](db['MailApplication'],{'as':_0x738e('0x1b1'),'foreignKey':'IntervalId'});db[_0x738e('0x81')]['hasMany'](db['ChatApplication'],{'as':_0x738e('0x1b2'),'foreignKey':'IntervalId'});db[_0x738e('0x81')][_0x738e('0x117')](db[_0x738e('0x4f')],{'as':_0x738e('0x1b3'),'foreignKey':_0x738e('0x17b')});db[_0x738e('0x81')][_0x738e('0x117')](db[_0x738e('0x184')],{'as':'SmsApplications','foreignKey':_0x738e('0x17b')});db[_0x738e('0x89')][_0x738e('0x126')](db[_0x738e('0x3e')],{});db[_0x738e('0x89')][_0x738e('0x126')](db[_0x738e('0x9d')],{'foreignKey':_0x738e('0x1b4')});db[_0x738e('0x89')]['belongsTo'](db[_0x738e('0x9b')],{'foreignKey':_0x738e('0x1b5')});db[_0x738e('0x8b')][_0x738e('0x128')](db[_0x738e('0x1a')],{'as':_0x738e('0x1b6'),'through':_0x738e('0x14d'),'onDelete':_0x738e('0x163')});db['Tag']['belongsToMany'](db[_0x738e('0x6c')],{'through':'cm_contact_has_tags'});db['Tag'][_0x738e('0x128')](db[_0x738e('0x11e')],{'through':_0x738e('0x199')});db[_0x738e('0x8c')][_0x738e('0x128')](db[_0x738e('0x43')],{'through':_0x738e('0x173')});db[_0x738e('0x8c')]['belongsToMany'](db['SmsInteraction'],{'through':_0x738e('0x185')});db[_0x738e('0x8c')][_0x738e('0x128')](db[_0x738e('0x51')],{'through':_0x738e('0x180')});db[_0x738e('0x8c')][_0x738e('0x128')](db['OpenchannelInteraction'],{'through':'openchannel_interaction_has_tags'});db[_0x738e('0x8c')]['belongsToMany'](db[_0x738e('0x100')],{'through':_0x738e('0x1b7')});db[_0x738e('0x1a0')][_0x738e('0x126')](db['ContactItemType'],{'as':_0x738e('0x1b8'),'foreignKey':_0x738e('0x1b9')});db[_0x738e('0x91')][_0x738e('0x126')](db['CmHopper'],{'as':_0x738e('0x1ba'),'foreignKey':_0x738e('0x1a8')});db[_0x738e('0x1a0')][_0x738e('0x126')](db[_0x738e('0x6c')],{'as':'Contact','foreignKey':_0x738e('0x1a1')});db[_0x738e('0x93')]['hasMany'](db[_0x738e('0x80')],{'as':{'plural':_0x738e('0x1bb'),'singular':_0x738e('0x1bc')},'foreignKey':_0x738e('0x1bd'),'onDelete':_0x738e('0x114'),'hooks':!![]});db[_0x738e('0x93')]['hasMany'](db[_0x738e('0x80')],{'as':{'plural':_0x738e('0x1be'),'singular':_0x738e('0x1bf')},'foreignKey':_0x738e('0x1c0'),'onDelete':_0x738e('0x114'),'hooks':!![]});db[_0x738e('0x93')][_0x738e('0x117')](db['Action'],{'as':_0x738e('0x1c1'),'foreignKey':_0x738e('0x1c2'),'onDelete':_0x738e('0x114'),'hooks':!![]});db[_0x738e('0x9b')]['hasMany'](db[_0x738e('0xa3')],{'as':'Fields','onDelete':_0x738e('0x114'),'foreignKey':_0x738e('0x1b5'),'hooks':!![]});db[_0x738e('0x9d')]['hasMany'](db[_0x738e('0xa3')],{'as':_0x738e('0x1c3'),'onDelete':'cascade','foreignKey':_0x738e('0x1b4')});db[_0x738e('0xa1')][_0x738e('0x117')](db[_0x738e('0xa3')],{'as':_0x738e('0x1c3'),'onDelete':_0x738e('0x114'),'foreignKey':'MetricId'});db['AnalyticFieldReport'][_0x738e('0x126')](db[_0x738e('0xa1')],{'foreignKey':_0x738e('0x1c4')});db[_0x738e('0xa7')][_0x738e('0x117')](db[_0x738e('0xa9')],{'as':_0x738e('0x1c5'),'onDelete':_0x738e('0x114'),'foreignKey':'AccountId'});db[_0x738e('0xa9')][_0x738e('0x117')](db[_0x738e('0x1c6')],{'as':_0x738e('0x1c7'),'onDelete':_0x738e('0x114'),'foreignKey':_0x738e('0x1c8')});db['SalesforceConfiguration'][_0x738e('0x117')](db[_0x738e('0x1c6')],{'as':'Descriptions','onDelete':_0x738e('0x114'),'foreignKey':_0x738e('0x1c9')});db['SalesforceConfiguration'][_0x738e('0x117')](db['SalesforceField'],{'as':_0x738e('0x1c3'),'onDelete':_0x738e('0x114'),'foreignKey':_0x738e('0x1ca')});db[_0x738e('0xa9')][_0x738e('0x126')](db['SalesforceAccount'],{'as':_0x738e('0x171'),'foreignKey':_0x738e('0x1cb')});db[_0x738e('0x1c6')]['hasMany'](db[_0x738e('0x1c6')],{'as':'Subject','foreignKey':'SubjectId'});db['SalesforceField'][_0x738e('0x117')](db[_0x738e('0x1c6')],{'as':_0x738e('0x1cc'),'foreignKey':'DescriptionId'});db['SalesforceField'][_0x738e('0x117')](db[_0x738e('0x1c6')],{'as':'Field','foreignKey':_0x738e('0x1ca')});db[_0x738e('0x1c6')]['belongsTo'](db[_0x738e('0x95')],{'as':_0x738e('0x95'),'foreignKey':_0x738e('0x1cd')});db['SugarcrmAccount'][_0x738e('0x117')](db[_0x738e('0x1ce')],{'as':_0x738e('0x1c5'),'onDelete':_0x738e('0x114'),'foreignKey':_0x738e('0x1cb')});db[_0x738e('0x1ce')][_0x738e('0x117')](db[_0x738e('0xaf')],{'as':'Subjects','onDelete':_0x738e('0x114'),'foreignKey':_0x738e('0x1c8')});db[_0x738e('0x1ce')][_0x738e('0x117')](db[_0x738e('0xaf')],{'as':_0x738e('0x1cf'),'onDelete':'cascade','foreignKey':_0x738e('0x1c9')});db[_0x738e('0x1ce')][_0x738e('0x117')](db[_0x738e('0xaf')],{'as':_0x738e('0x1c3'),'onDelete':_0x738e('0x114'),'foreignKey':'FieldId'});db[_0x738e('0x1ce')][_0x738e('0x126')](db[_0x738e('0xac')],{'as':_0x738e('0x171'),'foreignKey':_0x738e('0x1cb')});db[_0x738e('0xaf')][_0x738e('0x117')](db[_0x738e('0xaf')],{'as':_0x738e('0x1d0'),'foreignKey':'SubjectId'});db[_0x738e('0xaf')][_0x738e('0x117')](db[_0x738e('0xaf')],{'as':_0x738e('0x1cc'),'foreignKey':_0x738e('0x1c9')});db[_0x738e('0xaf')][_0x738e('0x117')](db[_0x738e('0xaf')],{'as':_0x738e('0x1d1'),'foreignKey':_0x738e('0x1ca')});db[_0x738e('0xaf')]['belongsTo'](db[_0x738e('0x95')],{'as':'Variable','foreignKey':_0x738e('0x1cd')});db['DeskAccount'][_0x738e('0x117')](db[_0x738e('0x1d2')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x738e('0x1cb')});db[_0x738e('0x1d2')]['hasMany'](db[_0x738e('0xb3')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0x738e('0x1c8')});db[_0x738e('0x1d2')][_0x738e('0x117')](db[_0x738e('0xb3')],{'as':_0x738e('0x1cf'),'onDelete':_0x738e('0x114'),'foreignKey':_0x738e('0x1c9')});db['DeskConfiguration'][_0x738e('0x117')](db[_0x738e('0xb3')],{'as':'Fields','onDelete':_0x738e('0x114'),'foreignKey':_0x738e('0x1ca')});db[_0x738e('0x1d2')][_0x738e('0x126')](db[_0x738e('0xb1')],{'as':_0x738e('0x171'),'foreignKey':'AccountId'});db['DeskConfiguration'][_0x738e('0x128')](db[_0x738e('0x8c')],{'through':_0x738e('0x1d3')});db['DeskField'][_0x738e('0x117')](db[_0x738e('0xb3')],{'as':_0x738e('0x1d0'),'foreignKey':_0x738e('0x1c8')});db[_0x738e('0xb3')][_0x738e('0x117')](db[_0x738e('0xb3')],{'as':_0x738e('0x1cc'),'foreignKey':_0x738e('0x1c9')});db['DeskField'][_0x738e('0x117')](db[_0x738e('0xb3')],{'as':_0x738e('0x1d1'),'foreignKey':'FieldId'});db[_0x738e('0xb3')][_0x738e('0x126')](db[_0x738e('0x95')],{'as':_0x738e('0x95'),'foreignKey':_0x738e('0x1cd')});db[_0x738e('0xb5')]['hasMany'](db[_0x738e('0xb7')],{'as':_0x738e('0x1c5'),'onDelete':'cascade','foreignKey':_0x738e('0x1cb')});db[_0x738e('0xb7')][_0x738e('0x117')](db[_0x738e('0xb9')],{'as':_0x738e('0x1c7'),'onDelete':'cascade','foreignKey':'SubjectId'});db['ZohoConfiguration'][_0x738e('0x117')](db[_0x738e('0xb9')],{'as':_0x738e('0x1cf'),'onDelete':_0x738e('0x114'),'foreignKey':_0x738e('0x1c9')});db[_0x738e('0xb7')][_0x738e('0x117')](db['ZohoField'],{'as':'Fields','onDelete':_0x738e('0x114'),'foreignKey':_0x738e('0x1ca')});db[_0x738e('0xb7')][_0x738e('0x126')](db['ZohoAccount'],{'as':_0x738e('0x171'),'foreignKey':'AccountId'});db[_0x738e('0xb9')]['hasMany'](db[_0x738e('0xb9')],{'as':_0x738e('0x1d0'),'foreignKey':_0x738e('0x1c8')});db['ZohoField'][_0x738e('0x117')](db[_0x738e('0xb9')],{'as':'Description','foreignKey':_0x738e('0x1c9')});db[_0x738e('0xb9')][_0x738e('0x117')](db['ZohoField'],{'as':'Field','foreignKey':_0x738e('0x1ca')});db['ZohoField'][_0x738e('0x126')](db[_0x738e('0x95')],{'as':_0x738e('0x95'),'foreignKey':_0x738e('0x1cd')});db[_0x738e('0xba')][_0x738e('0x117')](db[_0x738e('0xbc')],{'as':_0x738e('0x1c5'),'onDelete':_0x738e('0x114'),'foreignKey':_0x738e('0x1cb')});db[_0x738e('0xbc')][_0x738e('0x117')](db[_0x738e('0xbe')],{'as':'Subjects','foreignKey':_0x738e('0x1c8')});db[_0x738e('0xbc')][_0x738e('0x117')](db[_0x738e('0xbe')],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0x738e('0xbc')]['hasMany'](db[_0x738e('0xbe')],{'as':_0x738e('0x1c3'),'foreignKey':_0x738e('0x1ca')});db[_0x738e('0xbc')][_0x738e('0x126')](db[_0x738e('0xba')],{'as':_0x738e('0x171'),'foreignKey':_0x738e('0x1cb')});db[_0x738e('0xbc')][_0x738e('0x128')](db[_0x738e('0x8c')],{'through':'int_zendesk_configuration_has_tags'});db[_0x738e('0xbe')][_0x738e('0x117')](db['ZendeskField'],{'as':'Subject','foreignKey':_0x738e('0x1c8')});db[_0x738e('0xbe')][_0x738e('0x117')](db[_0x738e('0xbe')],{'as':_0x738e('0x1cc'),'foreignKey':'DescriptionId'});db[_0x738e('0xbe')][_0x738e('0x117')](db[_0x738e('0xbe')],{'as':'Field','foreignKey':'FieldId'});db[_0x738e('0xbe')]['belongsTo'](db[_0x738e('0x95')],{'as':_0x738e('0x95'),'foreignKey':_0x738e('0x1cd')});db[_0x738e('0x1d4')]['hasMany'](db[_0x738e('0x1d5')],{'as':_0x738e('0x1c5'),'onDelete':_0x738e('0x114'),'foreignKey':_0x738e('0x1cb')});db[_0x738e('0x1d5')]['hasMany'](db['FreshdeskField'],{'as':_0x738e('0x1c7'),'onDelete':'cascade','foreignKey':_0x738e('0x1c8')});db[_0x738e('0x1d5')][_0x738e('0x117')](db[_0x738e('0x1d6')],{'as':_0x738e('0x1cf'),'onDelete':_0x738e('0x114'),'foreignKey':_0x738e('0x1c9')});db[_0x738e('0x1d5')][_0x738e('0x117')](db['FreshdeskField'],{'as':_0x738e('0x1c3'),'onDelete':_0x738e('0x114'),'foreignKey':'FieldId'});db[_0x738e('0x1d5')][_0x738e('0x126')](db[_0x738e('0x1d4')],{'as':_0x738e('0x171'),'foreignKey':_0x738e('0x1cb')});db['FreshdeskConfiguration'][_0x738e('0x128')](db[_0x738e('0x8c')],{'through':_0x738e('0x1d7')});db[_0x738e('0x1d6')][_0x738e('0x117')](db[_0x738e('0x1d6')],{'as':'Subject','foreignKey':_0x738e('0x1c8')});db[_0x738e('0x1d6')][_0x738e('0x117')](db[_0x738e('0x1d6')],{'as':_0x738e('0x1cc'),'foreignKey':'DescriptionId'});db[_0x738e('0x1d6')]['hasMany'](db[_0x738e('0x1d6')],{'as':_0x738e('0x1d1'),'foreignKey':_0x738e('0x1ca')});db[_0x738e('0x1d6')][_0x738e('0x126')](db[_0x738e('0x95')],{'as':_0x738e('0x95'),'foreignKey':'VariableId'});db['VtigerAccount']['hasMany'](db[_0x738e('0xc3')],{'as':'Configurations','onDelete':_0x738e('0x114'),'foreignKey':_0x738e('0x1cb')});db[_0x738e('0xc3')][_0x738e('0x117')](db[_0x738e('0xc5')],{'as':_0x738e('0x1c7'),'foreignKey':_0x738e('0x1c8')});db[_0x738e('0xc3')][_0x738e('0x117')](db[_0x738e('0xc5')],{'as':_0x738e('0x1cf'),'foreignKey':_0x738e('0x1c9')});db[_0x738e('0xc3')][_0x738e('0x117')](db[_0x738e('0xc5')],{'as':_0x738e('0x1c3'),'foreignKey':_0x738e('0x1ca')});db[_0x738e('0xc3')]['belongsTo'](db[_0x738e('0x1d8')],{'as':_0x738e('0x171'),'foreignKey':_0x738e('0x1cb')});db['VtigerField'][_0x738e('0x117')](db['VtigerField'],{'as':_0x738e('0x1d0'),'foreignKey':'SubjectId'});db['VtigerField'][_0x738e('0x117')](db[_0x738e('0xc5')],{'as':_0x738e('0x1cc'),'foreignKey':'DescriptionId'});db[_0x738e('0xc5')][_0x738e('0x117')](db['VtigerField'],{'as':_0x738e('0x1d1'),'foreignKey':_0x738e('0x1ca')});db[_0x738e('0xc5')][_0x738e('0x126')](db[_0x738e('0x95')],{'as':_0x738e('0x95'),'foreignKey':_0x738e('0x1cd')});db[_0x738e('0xc6')][_0x738e('0x117')](db[_0x738e('0x1d9')],{'as':'Configurations','onDelete':_0x738e('0x114'),'foreignKey':_0x738e('0x1cb')});db[_0x738e('0x1d9')][_0x738e('0x117')](db[_0x738e('0xc8')],{'as':'Subjects','foreignKey':_0x738e('0x1c8')});db[_0x738e('0x1d9')][_0x738e('0x117')](db[_0x738e('0xc8')],{'as':_0x738e('0x1cf'),'foreignKey':_0x738e('0x1c9')});db[_0x738e('0x1d9')][_0x738e('0x117')](db[_0x738e('0xc8')],{'as':_0x738e('0x1c3'),'foreignKey':_0x738e('0x1ca')});db['ServicenowConfiguration'][_0x738e('0x126')](db[_0x738e('0xc6')],{'as':_0x738e('0x171'),'foreignKey':'AccountId'});db[_0x738e('0xc8')][_0x738e('0x117')](db[_0x738e('0xc8')],{'as':'Subject','foreignKey':_0x738e('0x1c8')});db[_0x738e('0xc8')][_0x738e('0x117')](db[_0x738e('0xc8')],{'as':_0x738e('0x1cc'),'foreignKey':_0x738e('0x1c9')});db[_0x738e('0xc8')]['hasMany'](db[_0x738e('0xc8')],{'as':'Field','foreignKey':_0x738e('0x1ca')});db['ServicenowField']['belongsTo'](db[_0x738e('0x95')],{'as':_0x738e('0x95'),'foreignKey':_0x738e('0x1cd')});db[_0x738e('0x1da')]['hasMany'](db['Dynamics365Configuration'],{'as':_0x738e('0x1c5'),'onDelete':_0x738e('0x114'),'foreignKey':_0x738e('0x1cb')});db[_0x738e('0x1da')][_0x738e('0x126')](db['CloudProvider'],{'as':_0x738e('0x109'),'foreignKey':_0x738e('0x162')});db[_0x738e('0x1db')]['hasMany'](db['Dynamics365Field'],{'as':_0x738e('0x1c7'),'onDelete':_0x738e('0x114'),'foreignKey':'SubjectId'});db[_0x738e('0x1db')][_0x738e('0x117')](db['Dynamics365Field'],{'as':_0x738e('0x1cf'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x738e('0x1db')][_0x738e('0x117')](db[_0x738e('0x1dc')],{'as':'Fields','onDelete':_0x738e('0x114'),'foreignKey':_0x738e('0x1ca')});db[_0x738e('0x1db')][_0x738e('0x126')](db['Dynamics365Account'],{'as':_0x738e('0x171'),'foreignKey':'AccountId'});db[_0x738e('0x1dc')][_0x738e('0x117')](db['Dynamics365Field'],{'as':_0x738e('0x1d0'),'foreignKey':'SubjectId'});db[_0x738e('0x1dc')]['hasMany'](db[_0x738e('0x1dc')],{'as':'Description','foreignKey':_0x738e('0x1c9')});db['Dynamics365Field']['hasMany'](db['Dynamics365Field'],{'as':_0x738e('0x1d1'),'foreignKey':_0x738e('0x1ca')});db[_0x738e('0x1dc')][_0x738e('0x126')](db[_0x738e('0x95')],{'as':_0x738e('0x95'),'foreignKey':_0x738e('0x1cd')});db[_0x738e('0xcb')][_0x738e('0x117')](db[_0x738e('0x1dd')],{'as':_0x738e('0x1c5'),'onDelete':_0x738e('0x114'),'foreignKey':_0x738e('0x1cb')});db['FreshsalesConfiguration'][_0x738e('0x117')](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0x738e('0x1c8')});db['FreshsalesConfiguration']['hasMany'](db['FreshsalesField'],{'as':_0x738e('0x1cf'),'foreignKey':_0x738e('0x1c9')});db['FreshsalesConfiguration'][_0x738e('0x117')](db['FreshsalesField'],{'as':_0x738e('0x1c3'),'foreignKey':_0x738e('0x1ca')});db[_0x738e('0x1dd')][_0x738e('0x126')](db[_0x738e('0xcb')],{'as':_0x738e('0x171'),'foreignKey':_0x738e('0x1cb')});db[_0x738e('0xce')][_0x738e('0x117')](db[_0x738e('0xce')],{'as':_0x738e('0x1d0'),'foreignKey':'SubjectId'});db[_0x738e('0xce')][_0x738e('0x117')](db[_0x738e('0xce')],{'as':_0x738e('0x1cc'),'foreignKey':_0x738e('0x1c9')});db['FreshsalesField'][_0x738e('0x117')](db['FreshsalesField'],{'as':_0x738e('0x1d1'),'foreignKey':'FieldId'});db[_0x738e('0xce')][_0x738e('0x126')](db[_0x738e('0x95')],{'as':_0x738e('0x95'),'foreignKey':_0x738e('0x1cd')});db['ChatQueueReport'][_0x738e('0x126')](db[_0x738e('0x140')],{});db[_0x738e('0xd2')][_0x738e('0x126')](db[_0x738e('0x12c')],{'as':'List','foreignKey':_0x738e('0x169')});db['ChatQueueReport'][_0x738e('0x126')](db['CmContact'],{'as':'Contact','foreignKey':_0x738e('0x160')});db[_0x738e('0xd2')][_0x738e('0x126')](db['ChatInteraction'],{});db[_0x738e('0xd2')][_0x738e('0x126')](db[_0x738e('0x192')],{});db[_0x738e('0xd2')][_0x738e('0x126')](db[_0x738e('0x13')],{});db['ChatQueueReport'][_0x738e('0x126')](db[_0x738e('0x139')],{});db['ChatInternalMessage'][_0x738e('0x126')](db[_0x738e('0x13')],{'onDelete':_0x738e('0x114'),'foreignKey':_0x738e('0x1de')});db['ChatInternalMessage']['belongsTo'](db[_0x738e('0x13')],{'onDelete':_0x738e('0x114'),'foreignKey':_0x738e('0x1df')});db[_0x738e('0xd7')][_0x738e('0x117')](db[_0x738e('0xd5')],{'foreignKey':'SessionId','onDelete':_0x738e('0x114')});db[_0x738e('0xd7')][_0x738e('0x117')](db[_0x738e('0xd4')],{'foreignKey':_0x738e('0x1e0'),'onDelete':_0x738e('0x114')});db[_0x738e('0xd9')][_0x738e('0x126')](db[_0x738e('0x57')],{});db[_0x738e('0xd9')][_0x738e('0x126')](db['CmList'],{'as':_0x738e('0x17f'),'foreignKey':_0x738e('0x169')});db[_0x738e('0xd9')]['belongsTo'](db[_0x738e('0x6c')],{'as':_0x738e('0x15f'),'foreignKey':_0x738e('0x160')});db['SmsQueueReport'][_0x738e('0x126')](db[_0x738e('0x120')],{});db[_0x738e('0xd9')][_0x738e('0x126')](db[_0x738e('0x58')],{});db[_0x738e('0xd9')][_0x738e('0x126')](db['User'],{});db['SmsQueueReport'][_0x738e('0x126')](db[_0x738e('0x5a')],{});db[_0x738e('0x1e1')]['hasMany'](db['JscriptySessionReport'],{'foreignKey':_0x738e('0x1e2')});db[_0x738e('0x1e1')][_0x738e('0x117')](db[_0x738e('0xd5')],{'foreignKey':_0x738e('0x1e2')});db['JscriptyProject'][_0x738e('0x117')](db[_0x738e('0xd4')],{'foreignKey':'ProjectId'});db[_0x738e('0xe4')][_0x738e('0x128')](db[_0x738e('0x13')],{'as':'Agents','through':_0x738e('0x12f')});db[_0x738e('0xe4')][_0x738e('0x128')](db[_0x738e('0x1c')],{'through':_0x738e('0x156'),'as':_0x738e('0x135')});db[_0x738e('0xe4')][_0x738e('0x128')](db[_0x738e('0x137')],{'through':_0x738e('0x16e'),'as':_0x738e('0x138')});db[_0x738e('0xe4')][_0x738e('0x128')](db[_0x738e('0x139')],{'through':_0x738e('0x1e3'),'as':_0x738e('0x13a')});db[_0x738e('0xe4')][_0x738e('0x128')](db[_0x738e('0x13b')],{'through':_0x738e('0x182'),'as':_0x738e('0x13c')});db[_0x738e('0xe4')][_0x738e('0x128')](db[_0x738e('0x5a')],{'through':'team_has_sms_queues','as':_0x738e('0x13d')});db[_0x738e('0xe4')][_0x738e('0x128')](db['OpenchannelQueue'],{'through':_0x738e('0x18f'),'as':_0x738e('0x13e')});db['Team'][_0x738e('0x128')](db['WhatsappQueue'],{'through':_0x738e('0x1e4'),'as':_0x738e('0x13f')});db[_0x738e('0xe4')][_0x738e('0x128')](db['VoicePrefix'],{'through':'TeamVoicePrefix','as':_0x738e('0x136')});db[_0x738e('0xe8')][_0x738e('0x117')](db['CmHopper'],{'as':_0x738e('0x125'),'foreignKey':'CampaignId'});db[_0x738e('0xe8')][_0x738e('0x117')](db['CmHopperFinal'],{'as':_0x738e('0x1a2'),'foreignKey':_0x738e('0x1a9')});db[_0x738e('0xe8')]['hasMany'](db[_0x738e('0x73')],{'as':_0x738e('0x1a3'),'foreignKey':_0x738e('0x1a9')});db['Campaign'][_0x738e('0x117')](db[_0x738e('0x70')],{'as':_0x738e('0x14f'),'foreignKey':_0x738e('0x1a9')});db[_0x738e('0xe8')]['belongsTo'](db[_0x738e('0x2d')],{'as':'Trunk','foreignKey':_0x738e('0x151')});db[_0x738e('0xe8')][_0x738e('0x126')](db[_0x738e('0x2d')],{'as':_0x738e('0x152'),'foreignKey':_0x738e('0x1e5')});db[_0x738e('0xe8')]['belongsTo'](db[_0x738e('0x81')],{'as':_0x738e('0x81'),'foreignKey':_0x738e('0x17b')});db[_0x738e('0xe8')][_0x738e('0x126')](db[_0x738e('0x1e6')],{'as':_0x738e('0x1e6'),'foreignKey':_0x738e('0x1e7')});db['Campaign'][_0x738e('0x128')](db[_0x738e('0x12c')],{'as':_0x738e('0x12d'),'through':_0x738e('0x1e8')});db[_0x738e('0xe8')][_0x738e('0x128')](db[_0x738e('0x12c')],{'as':_0x738e('0x157'),'through':_0x738e('0x1e9')});db[_0x738e('0xec')][_0x738e('0x126')](db[_0x738e('0x17a')],{'as':_0x738e('0x17a'),'foreignKey':_0x738e('0x19b')});db[_0x738e('0xef')][_0x738e('0x126')](db['MailMessage'],{});db[_0x738e('0xef')][_0x738e('0x126')](db['MailInteraction'],{});db[_0x738e('0xef')][_0x738e('0x126')](db[_0x738e('0x3e')],{'foreignKey':_0x738e('0x1ea'),'as':_0x738e('0x1eb')});db[_0x738e('0xef')][_0x738e('0x126')](db[_0x738e('0x13')],{'foreignKey':'FromUserId','as':_0x738e('0x1ec')});db[_0x738e('0xef')][_0x738e('0x126')](db[_0x738e('0x13')],{'foreignKey':_0x738e('0x1ed'),'as':_0x738e('0x1ee')});db[_0x738e('0xef')][_0x738e('0x126')](db[_0x738e('0x137')],{'foreignKey':_0x738e('0x1ef'),'as':_0x738e('0x1f0')});db[_0x738e('0xef')][_0x738e('0x126')](db[_0x738e('0x3e')],{'foreignKey':'ToMailAccountId','as':_0x738e('0x1f1')});db[_0x738e('0x1f2')][_0x738e('0x126')](db[_0x738e('0x192')],{});db[_0x738e('0x1f2')][_0x738e('0x126')](db[_0x738e('0x11e')],{});db[_0x738e('0x1f2')]['belongsTo'](db[_0x738e('0x140')],{'foreignKey':_0x738e('0x1f3'),'as':_0x738e('0x1eb')});db[_0x738e('0x1f2')][_0x738e('0x126')](db['User'],{'foreignKey':_0x738e('0x1f4'),'as':_0x738e('0x1ec')});db['ChatTransferReport'][_0x738e('0x126')](db[_0x738e('0x13')],{'foreignKey':'ToUserId','as':_0x738e('0x1ee')});db[_0x738e('0x1f2')][_0x738e('0x126')](db[_0x738e('0x139')],{'foreignKey':_0x738e('0x1f5'),'as':_0x738e('0x1f0')});db['ChatTransferReport'][_0x738e('0x126')](db[_0x738e('0x140')],{'foreignKey':_0x738e('0x1f6'),'as':_0x738e('0x1f1')});db[_0x738e('0xf1')][_0x738e('0x126')](db[_0x738e('0x53')],{});db[_0x738e('0xf1')]['belongsTo'](db[_0x738e('0x51')],{});db[_0x738e('0xf1')][_0x738e('0x126')](db[_0x738e('0x4d')],{'foreignKey':_0x738e('0x1f7'),'as':'FromAccount'});db[_0x738e('0xf1')][_0x738e('0x126')](db[_0x738e('0x13')],{'foreignKey':_0x738e('0x1f4'),'as':'FromAgent'});db[_0x738e('0xf1')][_0x738e('0x126')](db[_0x738e('0x13')],{'foreignKey':_0x738e('0x1ed'),'as':_0x738e('0x1ee')});db[_0x738e('0xf1')]['belongsTo'](db[_0x738e('0x13b')],{'foreignKey':_0x738e('0x1f8'),'as':_0x738e('0x1f0')});db[_0x738e('0xf1')][_0x738e('0x126')](db[_0x738e('0x4d')],{'foreignKey':'ToFaxAccountId','as':_0x738e('0x1f1')});db['OpenchannelTransferReport']['belongsTo'](db[_0x738e('0x18a')],{});db['OpenchannelTransferReport'][_0x738e('0x126')](db[_0x738e('0x5e')],{});db[_0x738e('0xf3')][_0x738e('0x126')](db[_0x738e('0x143')],{'foreignKey':_0x738e('0x1f9'),'as':'FromAccount'});db['OpenchannelTransferReport'][_0x738e('0x126')](db[_0x738e('0x13')],{'foreignKey':'FromUserId','as':_0x738e('0x1ec')});db['OpenchannelTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x738e('0x1ed'),'as':'ToAgent'});db['OpenchannelTransferReport'][_0x738e('0x126')](db[_0x738e('0x61')],{'foreignKey':'ToOpenchannelQueueId','as':_0x738e('0x1f0')});db['OpenchannelTransferReport'][_0x738e('0x126')](db[_0x738e('0x143')],{'foreignKey':_0x738e('0x1fa'),'as':'ToAccount'});db[_0x738e('0xf5')][_0x738e('0x126')](db[_0x738e('0x58')],{});db[_0x738e('0xf5')][_0x738e('0x126')](db[_0x738e('0x120')],{});db[_0x738e('0xf5')][_0x738e('0x126')](db[_0x738e('0x57')],{'foreignKey':_0x738e('0x1fb'),'as':_0x738e('0x1eb')});db[_0x738e('0xf5')][_0x738e('0x126')](db[_0x738e('0x13')],{'foreignKey':_0x738e('0x1f4'),'as':_0x738e('0x1ec')});db['SmsTransferReport'][_0x738e('0x126')](db['User'],{'foreignKey':_0x738e('0x1ed'),'as':_0x738e('0x1ee')});db['SmsTransferReport'][_0x738e('0x126')](db[_0x738e('0x5a')],{'foreignKey':_0x738e('0x1fc'),'as':_0x738e('0x1f0')});db['SmsTransferReport']['belongsTo'](db['SmsAccount'],{'foreignKey':_0x738e('0x1fd'),'as':_0x738e('0x1f1')});db[_0x738e('0x12c')][_0x738e('0x117')](db[_0x738e('0x7e')],{'as':'Dispositions','foreignKey':_0x738e('0x169'),'onDelete':_0x738e('0x114')});db[_0x738e('0x12c')][_0x738e('0x117')](db[_0x738e('0x77')],{'as':_0x738e('0x1fe'),'foreignKey':_0x738e('0x169')});db['CmList']['hasMany'](db[_0x738e('0x6c')],{'as':_0x738e('0x12b'),'onDelete':_0x738e('0x114'),'foreignKey':_0x738e('0x169')});db['CmList'][_0x738e('0x117')](db[_0x738e('0x72')],{'as':'HopperFinals','foreignKey':'ListId'});db[_0x738e('0x12c')][_0x738e('0x117')](db['CmHopperHistory'],{'as':_0x738e('0x11c'),'foreignKey':'ListId'});db['CmList'][_0x738e('0x117')](db[_0x738e('0x75')],{'as':_0x738e('0x75'),'foreignKey':_0x738e('0x169')});db['CmList'][_0x738e('0x128')](db[_0x738e('0x1c')],{'as':'Queues','through':'voice_queues_has_cm_lists'});db[_0x738e('0x12c')][_0x738e('0x128')](db[_0x738e('0x13')],{'as':_0x738e('0x16d'),'through':_0x738e('0x12e')});db['VoicePrefix'][_0x738e('0x117')](db['VoiceExtension'],{'as':_0x738e('0x11b'),'onDelete':_0x738e('0x114')});db[_0x738e('0xf7')][_0x738e('0x128')](db[_0x738e('0x13')],{'as':_0x738e('0x16d'),'through':'UserVoicePrefix'});db['VoicePrefix'][_0x738e('0x128')](db[_0x738e('0xe4')],{'through':_0x738e('0x10c'),'as':_0x738e('0x16f')});db[_0x738e('0xf8')]['hasMany'](db[_0x738e('0x13')],{'as':_0x738e('0x176'),'foreignKey':_0x738e('0x127')});db['UserProfile'][_0x738e('0x117')](db[_0x738e('0x1ff')],{'as':_0x738e('0x200'),'foreignKey':_0x738e('0x127'),'onDelete':_0x738e('0x114')});db['UserProfileSection'][_0x738e('0x117')](db[_0x738e('0xfb')],{'as':_0x738e('0x201'),'foreignKey':'sectionId','onDelete':_0x738e('0x114')});db['WhatsappAccount'][_0x738e('0x117')](db['Disposition'],{'as':_0x738e('0x166'),'foreignKey':_0x738e('0x202'),'onDelete':'cascade'});db[_0x738e('0xfc')][_0x738e('0x117')](db[_0x738e('0x7d')],{'as':_0x738e('0x167'),'foreignKey':_0x738e('0x202')});db['WhatsappAccount']['hasMany'](db[_0x738e('0x102')],{'as':_0x738e('0x159'),'foreignKey':'WhatsappAccountId'});db[_0x738e('0xfc')][_0x738e('0x117')](db['WhatsappInteraction'],{'as':_0x738e('0x168')});db[_0x738e('0xfc')]['hasMany'](db[_0x738e('0xfe')],{'as':_0x738e('0x14b'),'foreignKey':_0x738e('0x202'),'onDelete':_0x738e('0x114')});db[_0x738e('0xfc')][_0x738e('0x126')](db['CmList'],{'as':_0x738e('0x17f'),'foreignKey':_0x738e('0x169')});db[_0x738e('0xfc')][_0x738e('0x126')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x738e('0x154')});db['WhatsappAccount']['belongsToMany'](db['User'],{'as':_0x738e('0x16d'),'through':'user_has_whatsapp_accounts'});db[_0x738e('0xfe')][_0x738e('0x126')](db['User'],{'onDelete':'restrict'});db[_0x738e('0xfe')][_0x738e('0x126')](db[_0x738e('0x107')],{'onDelete':_0x738e('0x163')});db[_0x738e('0xfe')][_0x738e('0x126')](db[_0x738e('0xfc')],{'onDelete':'restrict'});db['WhatsappApplication'][_0x738e('0x126')](db['Interval'],{'onDelete':_0x738e('0x163'),'foreignKey':_0x738e('0x17b')});db[_0x738e('0xfe')][_0x738e('0x126')](db[_0x738e('0x8c')],{'onDelete':'restrict','foreignKey':'TagId'});db['WhatsappInteraction'][_0x738e('0x117')](db[_0x738e('0x102')],{'as':_0x738e('0x159'),'onDelete':'cascade','foreignKey':'WhatsappInteractionId'});db['WhatsappInteraction'][_0x738e('0x126')](db[_0x738e('0xfc')],{'as':_0x738e('0x171'),'foreignKey':_0x738e('0x202')});db['WhatsappInteraction'][_0x738e('0x126')](db[_0x738e('0x6c')],{'as':_0x738e('0x15f'),'foreignKey':'ContactId'});db[_0x738e('0x100')][_0x738e('0x126')](db['User'],{'as':_0x738e('0x172'),'foreignKey':_0x738e('0x116')});db[_0x738e('0x100')][_0x738e('0x128')](db['Tag'],{'through':_0x738e('0x1b7'),'as':'Tags'});db[_0x738e('0x100')]['belongsToMany'](db[_0x738e('0x8c')],{'through':_0x738e('0x1b7'),'as':_0x738e('0x175')});db[_0x738e('0x100')][_0x738e('0x128')](db[_0x738e('0x13')],{'as':_0x738e('0x176'),'through':_0x738e('0x134'),'foreignKey':_0x738e('0x203')});db[_0x738e('0x102')][_0x738e('0x126')](db[_0x738e('0x13')],{'as':_0x738e('0x13')});db['WhatsappMessage'][_0x738e('0x126')](db[_0x738e('0x6c')],{'onDelete':'cascade','as':_0x738e('0x15f')});db[_0x738e('0x102')]['belongsTo'](db[_0x738e('0x100')],{'onDelete':_0x738e('0x114'),'as':_0x738e('0x178'),'foreignKey':_0x738e('0x203')});db[_0x738e('0x102')][_0x738e('0x126')](db[_0x738e('0xfc')],{'as':_0x738e('0x171'),'foreignKey':'WhatsappAccountId'});db[_0x738e('0x104')][_0x738e('0x126')](db['WhatsappAccount'],{});db[_0x738e('0x104')][_0x738e('0x126')](db[_0x738e('0x12c')],{'as':_0x738e('0x17f'),'foreignKey':_0x738e('0x169')});db[_0x738e('0x104')][_0x738e('0x126')](db[_0x738e('0x6c')],{'as':'Contact','foreignKey':_0x738e('0x160')});db['WhatsappQueueReport'][_0x738e('0x126')](db[_0x738e('0x100')],{});db['WhatsappQueueReport'][_0x738e('0x126')](db['WhatsappQueue'],{});db[_0x738e('0x104')][_0x738e('0x126')](db['WhatsappMessage'],{});db[_0x738e('0x104')][_0x738e('0x126')](db[_0x738e('0x13')],{});db[_0x738e('0x105')]['belongsTo'](db[_0x738e('0x102')],{});db[_0x738e('0x105')][_0x738e('0x126')](db['WhatsappInteraction'],{});db['WhatsappTransferReport'][_0x738e('0x126')](db['WhatsappAccount'],{'foreignKey':_0x738e('0x204'),'as':_0x738e('0x1eb')});db[_0x738e('0x105')][_0x738e('0x126')](db[_0x738e('0xfc')],{'foreignKey':'ToWhatsappAccountId','as':_0x738e('0x1f1')});db[_0x738e('0x105')]['belongsTo'](db['WhatsappQueue'],{'foreignKey':_0x738e('0x205'),'as':_0x738e('0x1f0')});db['WhatsappTransferReport'][_0x738e('0x126')](db['User'],{'foreignKey':_0x738e('0x1f4'),'as':'FromAgent'});db[_0x738e('0x105')][_0x738e('0x126')](db[_0x738e('0x13')],{'foreignKey':_0x738e('0x1ed'),'as':_0x738e('0x1ee')});db[_0x738e('0x107')]['belongsToMany'](db['User'],{'as':_0x738e('0x16d'),'through':_0x738e('0x3a'),'foreignKey':'WhatsappQueueId'});db[_0x738e('0x107')][_0x738e('0x128')](db[_0x738e('0xe4')],{'through':'team_has_whatsapp_queues','as':_0x738e('0x16f')});db['UserSetting'][_0x738e('0x126')](db['User'],{'as':_0x738e('0x206'),'foreignKey':_0x738e('0x116'),'onDelete':_0x738e('0x114'),'hooks':!![]});db['CloudProvider'][_0x738e('0x113')](db[_0x738e('0x1da')],{'as':_0x738e('0x1da'),'onDelete':_0x738e('0x163')});db[_0x738e('0x109')][_0x738e('0x113')](db[_0x738e('0x3c')],{'as':_0x738e('0x165'),'onDelete':_0x738e('0x163')});db['CloudProvider'][_0x738e('0x113')](db[_0x738e('0x164')],{'as':_0x738e('0x207'),'onDelete':_0x738e('0x163')});module[_0x738e('0x208')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 796aa7d..51778a0 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x49c1=['/index.html','express','./config/environment','./utils/client-side-logger','setupLoggers','default','/api/users','./api/user','use','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','./api/screenRecording','/api/voice/mails','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','./api/mailServerOut','/api/mail/accounts','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','./api/chatOfflineMessage','/api/chat/groups','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmHopperHistory','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','./api/cannedAnswer','./api/disposition','/api/conditions','/api/intervals','./api/interval','/api/pauses','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','./api/tag','/api/cm_contact_has_items','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','./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/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intZohoAccount','/api/integrations/zoho/configurations','/api/integrations/zoho/fields','/api/integrations/zendesk/accounts','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','./api/intFreshsalesField','./api/network','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/answers/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','/api/jscripty/projects','./api/jscriptyProject','/api/settings','/api/square/odbc','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','/api/migrations','./api/migration','./api/attachment','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','/api/fax/reports/transfer','./api/faxTransferReport','./api/openchannelTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','/api/whatsapp/interactions','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/mail_interaction_has_tags','./api/mailInteractionHasTag','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','./api/webbar','/api/logs','/apidoc','static','join','root','/www','/demo','/snippet','3.5.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath'];(function(_0x3d2b63,_0xab5463){var _0x1eaa6a=function(_0x4fe0a6){while(--_0x4fe0a6){_0x3d2b63['push'](_0x3d2b63['shift']());}};_0x1eaa6a(++_0xab5463);}(_0x49c1,0x10f));var _0x149c=function(_0x3e1394,_0x2d0222){_0x3e1394=_0x3e1394-0x0;var _0xb1fda8=_0x49c1[_0x3e1394];return _0xb1fda8;};'use strict';var path=require('path');var express=require(_0x149c('0x0'));var errors=require('./errors');var config=require(_0x149c('0x1'));var setupLoggers=require(_0x149c('0x2'))[_0x149c('0x3')];var clientSideLogs=require('./api/client-side-logs');exports[_0x149c('0x4')]=function(_0x4e5861){return setupLoggers(_0x4e5861)['then'](function(){_0x4e5861['use'](_0x149c('0x5'),require(_0x149c('0x6')));_0x4e5861[_0x149c('0x7')](_0x149c('0x8'),require(_0x149c('0x9')));_0x4e5861['use'](_0x149c('0xa'),require('./api/voiceContext'));_0x4e5861[_0x149c('0x7')](_0x149c('0xb'),require(_0x149c('0xc')));_0x4e5861[_0x149c('0x7')](_0x149c('0xd'),require('./api/voiceMusicOnHold'));_0x4e5861[_0x149c('0x7')](_0x149c('0xe'),require(_0x149c('0xf')));_0x4e5861[_0x149c('0x7')](_0x149c('0x10'),require(_0x149c('0x11')));_0x4e5861[_0x149c('0x7')]('/api/screen/recordings',require(_0x149c('0x12')));_0x4e5861[_0x149c('0x7')](_0x149c('0x13'),require('./api/voiceMail'));_0x4e5861[_0x149c('0x7')](_0x149c('0x14'),require(_0x149c('0x15')));_0x4e5861[_0x149c('0x7')](_0x149c('0x16'),require(_0x149c('0x17')));_0x4e5861[_0x149c('0x7')]('/api/voice/dials/reports',require(_0x149c('0x18')));_0x4e5861['use'](_0x149c('0x19'),require(_0x149c('0x1a')));_0x4e5861[_0x149c('0x7')](_0x149c('0x1b'),require('./api/voiceQueueReport'));_0x4e5861['use'](_0x149c('0x1c'),require(_0x149c('0x1d')));_0x4e5861[_0x149c('0x7')](_0x149c('0x1e'),require(_0x149c('0x1f')));_0x4e5861['use'](_0x149c('0x20'),require(_0x149c('0x21')));_0x4e5861[_0x149c('0x7')]('/api/mail/out_servers',require(_0x149c('0x22')));_0x4e5861[_0x149c('0x7')](_0x149c('0x23'),require('./api/mailAccount'));_0x4e5861[_0x149c('0x7')](_0x149c('0x24'),require(_0x149c('0x25')));_0x4e5861[_0x149c('0x7')](_0x149c('0x26'),require('./api/mailSubstatus'));_0x4e5861[_0x149c('0x7')]('/api/mail/interactions',require(_0x149c('0x27')));_0x4e5861[_0x149c('0x7')](_0x149c('0x28'),require(_0x149c('0x29')));_0x4e5861['use'](_0x149c('0x2a'),require(_0x149c('0x2b')));_0x4e5861[_0x149c('0x7')](_0x149c('0x2c'),require(_0x149c('0x2d')));_0x4e5861[_0x149c('0x7')]('/api/dashboards',require('./api/dashboard'));_0x4e5861[_0x149c('0x7')](_0x149c('0x2e'),require(_0x149c('0x2f')));_0x4e5861[_0x149c('0x7')](_0x149c('0x30'),require(_0x149c('0x31')));_0x4e5861[_0x149c('0x7')](_0x149c('0x32'),require('./api/faxApplication'));_0x4e5861[_0x149c('0x7')](_0x149c('0x33'),require(_0x149c('0x34')));_0x4e5861[_0x149c('0x7')](_0x149c('0x35'),require(_0x149c('0x36')));_0x4e5861[_0x149c('0x7')]('/api/fax/queues',require(_0x149c('0x37')));_0x4e5861['use']('/api/fax/reports/queue',require(_0x149c('0x38')));_0x4e5861[_0x149c('0x7')](_0x149c('0x39'),require(_0x149c('0x3a')));_0x4e5861[_0x149c('0x7')](_0x149c('0x3b'),require(_0x149c('0x3c')));_0x4e5861[_0x149c('0x7')]('/api/sms/interactions',require('./api/smsInteraction'));_0x4e5861[_0x149c('0x7')](_0x149c('0x3d'),require(_0x149c('0x3e')));_0x4e5861[_0x149c('0x7')](_0x149c('0x3f'),require(_0x149c('0x40')));_0x4e5861[_0x149c('0x7')](_0x149c('0x41'),require(_0x149c('0x42')));_0x4e5861['use']('/api/openchannel/applications',require(_0x149c('0x43')));_0x4e5861[_0x149c('0x7')](_0x149c('0x44'),require(_0x149c('0x45')));_0x4e5861[_0x149c('0x7')](_0x149c('0x46'),require('./api/openchannelMessage'));_0x4e5861[_0x149c('0x7')](_0x149c('0x47'),require(_0x149c('0x48')));_0x4e5861[_0x149c('0x7')](_0x149c('0x49'),require(_0x149c('0x4a')));_0x4e5861[_0x149c('0x7')](_0x149c('0x4b'),require('./api/openchannelQueueReport'));_0x4e5861[_0x149c('0x7')](_0x149c('0x4c'),require(_0x149c('0x4d')));_0x4e5861[_0x149c('0x7')](_0x149c('0x4e'),require(_0x149c('0x4f')));_0x4e5861[_0x149c('0x7')](_0x149c('0x50'),require(_0x149c('0x51')));_0x4e5861[_0x149c('0x7')]('/api/chat/offline_messages',require(_0x149c('0x52')));_0x4e5861['use']('/api/chat/queues',require('./api/chatQueue'));_0x4e5861['use'](_0x149c('0x53'),require('./api/chatGroup'));_0x4e5861[_0x149c('0x7')](_0x149c('0x54'),require(_0x149c('0x55')));_0x4e5861['use']('/api/cm/companies',require('./api/cmCompany'));_0x4e5861[_0x149c('0x7')](_0x149c('0x56'),require(_0x149c('0x57')));_0x4e5861['use'](_0x149c('0x58'),require(_0x149c('0x59')));_0x4e5861[_0x149c('0x7')](_0x149c('0x5a'),require(_0x149c('0x5b')));_0x4e5861[_0x149c('0x7')](_0x149c('0x5c'),require('./api/cmHopperFinal'));_0x4e5861[_0x149c('0x7')](_0x149c('0x5d'),require(_0x149c('0x5e')));_0x4e5861[_0x149c('0x7')]('/api/cm/custom_fields',require(_0x149c('0x5f')));_0x4e5861[_0x149c('0x7')](_0x149c('0x60'),require(_0x149c('0x61')));_0x4e5861[_0x149c('0x7')](_0x149c('0x62'),require(_0x149c('0x63')));_0x4e5861[_0x149c('0x7')]('/api/canned_answers',require(_0x149c('0x64')));_0x4e5861['use']('/api/dispositions',require(_0x149c('0x65')));_0x4e5861['use'](_0x149c('0x66'),require('./api/condition'));_0x4e5861['use'](_0x149c('0x67'),require(_0x149c('0x68')));_0x4e5861[_0x149c('0x7')](_0x149c('0x69'),require('./api/pause'));_0x4e5861['use']('/api/cdr',require(_0x149c('0x6a')));_0x4e5861[_0x149c('0x7')](_0x149c('0x6b'),require(_0x149c('0x6c')));_0x4e5861[_0x149c('0x7')](_0x149c('0x6d'),require(_0x149c('0x6e')));_0x4e5861['use'](_0x149c('0x6f'),require(_0x149c('0x70')));_0x4e5861[_0x149c('0x7')]('/api/tags',require(_0x149c('0x71')));_0x4e5861[_0x149c('0x7')]('/api/contact_item_types',require('./api/contactItemType'));_0x4e5861[_0x149c('0x7')](_0x149c('0x72'),require('./api/cmContactHasItem'));_0x4e5861[_0x149c('0x7')](_0x149c('0x73'),require(_0x149c('0x74')));_0x4e5861[_0x149c('0x7')]('/api/templates',require(_0x149c('0x75')));_0x4e5861[_0x149c('0x7')](_0x149c('0x76'),require(_0x149c('0x77')));_0x4e5861[_0x149c('0x7')](_0x149c('0x78'),require(_0x149c('0x79')));_0x4e5861[_0x149c('0x7')](_0x149c('0x7a'),require(_0x149c('0x7b')));_0x4e5861['use']('/api/integrations/reports',require(_0x149c('0x7c')));_0x4e5861[_0x149c('0x7')](_0x149c('0x7d'),require(_0x149c('0x7e')));_0x4e5861['use']('/api/analytics/default_reports',require(_0x149c('0x7f')));_0x4e5861[_0x149c('0x7')](_0x149c('0x80'),require(_0x149c('0x81')));_0x4e5861[_0x149c('0x7')](_0x149c('0x82'),require(_0x149c('0x83')));_0x4e5861['use'](_0x149c('0x84'),require(_0x149c('0x85')));_0x4e5861[_0x149c('0x7')](_0x149c('0x86'),require(_0x149c('0x87')));_0x4e5861[_0x149c('0x7')](_0x149c('0x88'),require(_0x149c('0x89')));_0x4e5861['use'](_0x149c('0x8a'),require('./api/intSalesforceConfiguration'));_0x4e5861[_0x149c('0x7')](_0x149c('0x8b'),require(_0x149c('0x8c')));_0x4e5861['use'](_0x149c('0x8d'),require(_0x149c('0x8e')));_0x4e5861['use'](_0x149c('0x8f'),require(_0x149c('0x90')));_0x4e5861[_0x149c('0x7')]('/api/integrations/sugarcrm/fields',require('./api/intSugarcrmField'));_0x4e5861['use'](_0x149c('0x91'),require(_0x149c('0x92')));_0x4e5861[_0x149c('0x7')](_0x149c('0x93'),require(_0x149c('0x94')));_0x4e5861[_0x149c('0x7')](_0x149c('0x95'),require('./api/intDeskField'));_0x4e5861[_0x149c('0x7')]('/api/integrations/zoho/accounts',require(_0x149c('0x96')));_0x4e5861[_0x149c('0x7')](_0x149c('0x97'),require('./api/intZohoConfiguration'));_0x4e5861[_0x149c('0x7')](_0x149c('0x98'),require('./api/intZohoField'));_0x4e5861[_0x149c('0x7')](_0x149c('0x99'),require('./api/intZendeskAccount'));_0x4e5861['use']('/api/integrations/zendesk/configurations',require('./api/intZendeskConfiguration'));_0x4e5861['use']('/api/integrations/zendesk/fields',require(_0x149c('0x9a')));_0x4e5861[_0x149c('0x7')](_0x149c('0x9b'),require(_0x149c('0x9c')));_0x4e5861[_0x149c('0x7')]('/api/integrations/freshdesk/configurations',require(_0x149c('0x9d')));_0x4e5861[_0x149c('0x7')](_0x149c('0x9e'),require(_0x149c('0x9f')));_0x4e5861['use'](_0x149c('0xa0'),require(_0x149c('0xa1')));_0x4e5861[_0x149c('0x7')](_0x149c('0xa2'),require(_0x149c('0xa3')));_0x4e5861[_0x149c('0x7')](_0x149c('0xa4'),require('./api/intVtigerField'));_0x4e5861[_0x149c('0x7')]('/api/integrations/servicenow/accounts',require(_0x149c('0xa5')));_0x4e5861['use'](_0x149c('0xa6'),require(_0x149c('0xa7')));_0x4e5861[_0x149c('0x7')]('/api/integrations/servicenow/fields',require(_0x149c('0xa8')));_0x4e5861['use'](_0x149c('0xa9'),require(_0x149c('0xaa')));_0x4e5861[_0x149c('0x7')](_0x149c('0xab'),require(_0x149c('0xac')));_0x4e5861[_0x149c('0x7')]('/api/integrations/dynamics365/fields',require(_0x149c('0xad')));_0x4e5861['use'](_0x149c('0xae'),require('./api/intFreshsalesAccount'));_0x4e5861[_0x149c('0x7')](_0x149c('0xaf'),require(_0x149c('0xb0')));_0x4e5861[_0x149c('0x7')]('/api/integrations/freshsales/fields',require(_0x149c('0xb1')));_0x4e5861[_0x149c('0x7')]('/api/networks',require(_0x149c('0xb2')));_0x4e5861[_0x149c('0x7')]('/api/chat/reports/queue',require(_0x149c('0xb3')));_0x4e5861[_0x149c('0x7')](_0x149c('0xb4'),require('./api/chatInternalMessage'));_0x4e5861[_0x149c('0x7')](_0x149c('0xb5'),require('./api/jscriptyAnswerReport'));_0x4e5861[_0x149c('0x7')]('/api/jscripty/questions/reports',require(_0x149c('0xb6')));_0x4e5861[_0x149c('0x7')](_0x149c('0xb7'),require(_0x149c('0xb8')));_0x4e5861[_0x149c('0x7')]('/api/sms/reports/queue',require(_0x149c('0xb9')));_0x4e5861[_0x149c('0x7')](_0x149c('0xba'),require(_0x149c('0xbb')));_0x4e5861['use'](_0x149c('0xbc'),require('./api/squareReportDetail'));_0x4e5861[_0x149c('0x7')](_0x149c('0xbd'),require(_0x149c('0xbe')));_0x4e5861[_0x149c('0x7')](_0x149c('0xbf'),require('./api/setting'));_0x4e5861['use'](_0x149c('0xc0'),require('./api/squareOdbc'));_0x4e5861['use']('/api/square/projects',require('./api/squareProject'));_0x4e5861['use'](_0x149c('0xc1'),require(_0x149c('0xc2')));_0x4e5861['use'](_0x149c('0xc3'),require(_0x149c('0xc4')));_0x4e5861[_0x149c('0x7')](_0x149c('0xc5'),require(_0x149c('0xc6')));_0x4e5861[_0x149c('0x7')](_0x149c('0xc7'),require('./api/license'));_0x4e5861[_0x149c('0x7')]('/api/campaigns',require('./api/campaign'));_0x4e5861[_0x149c('0x7')](_0x149c('0xc8'),require(_0x149c('0xc9')));_0x4e5861[_0x149c('0x7')]('/api/attachments',require(_0x149c('0xca')));_0x4e5861[_0x149c('0x7')]('/api/plugins',require(_0x149c('0xcb')));_0x4e5861['use'](_0x149c('0xcc'),require(_0x149c('0xcd')));_0x4e5861[_0x149c('0x7')](_0x149c('0xce'),require('./api/chatTransferReport'));_0x4e5861[_0x149c('0x7')](_0x149c('0xcf'),require(_0x149c('0xd0')));_0x4e5861[_0x149c('0x7')]('/api/openchannel/reports/transfer',require(_0x149c('0xd1')));_0x4e5861['use']('/api/sms/reports/transfer',require('./api/smsTransferReport'));_0x4e5861[_0x149c('0x7')](_0x149c('0xd2'),require(_0x149c('0xd3')));_0x4e5861['use'](_0x149c('0xd4'),require('./api/voicePrefix'));_0x4e5861[_0x149c('0x7')](_0x149c('0xd5'),require(_0x149c('0xd6')));_0x4e5861[_0x149c('0x7')](_0x149c('0xd7'),require(_0x149c('0xd8')));_0x4e5861[_0x149c('0x7')]('/api/userProfile/resources',require(_0x149c('0xd9')));_0x4e5861[_0x149c('0x7')](_0x149c('0xda'),require(_0x149c('0xdb')));_0x4e5861[_0x149c('0x7')](_0x149c('0xdc'),require(_0x149c('0xdd')));_0x4e5861['use'](_0x149c('0xde'),require('./api/whatsappApplication'));_0x4e5861[_0x149c('0x7')](_0x149c('0xdf'),require('./api/whatsappInteraction'));_0x4e5861[_0x149c('0x7')]('/api/whatsapp/messages',require('./api/whatsappMessage'));_0x4e5861['use']('/api/whatsapp/reports/queue',require(_0x149c('0xe0')));_0x4e5861[_0x149c('0x7')](_0x149c('0xe1'),require(_0x149c('0xe2')));_0x4e5861[_0x149c('0x7')](_0x149c('0xe3'),require(_0x149c('0xe4')));_0x4e5861['use'](_0x149c('0xe5'),require(_0x149c('0xe6')));_0x4e5861[_0x149c('0x7')](_0x149c('0xe7'),require(_0x149c('0xe8')));_0x4e5861[_0x149c('0x7')](_0x149c('0xe9'),require(_0x149c('0xea')));_0x4e5861[_0x149c('0x7')](_0x149c('0xeb'),require(_0x149c('0xec')));_0x4e5861[_0x149c('0x7')]('/api/auth/local',require(_0x149c('0xed')));_0x4e5861['use'](_0x149c('0xee'),require(_0x149c('0xef')));_0x4e5861['use'](_0x149c('0xf0'),require(_0x149c('0xf1')));_0x4e5861[_0x149c('0x7')](_0x149c('0xf2'),require(_0x149c('0xf3')));_0x4e5861[_0x149c('0x7')](_0x149c('0xf4'),require('./api/rpc'));_0x4e5861['use'](_0x149c('0xf5'),require(_0x149c('0xf6')));_0x4e5861[_0x149c('0x7')](_0x149c('0xf7'),require(_0x149c('0xf8')));_0x4e5861[_0x149c('0x7')](_0x149c('0xf9'),require(_0x149c('0xfa')));_0x4e5861[_0x149c('0x7')]('/api/webbar',require(_0x149c('0xfb')));_0x4e5861['use'](_0x149c('0xfc'),clientSideLogs);_0x4e5861[_0x149c('0x7')](_0x149c('0xfd'),express[_0x149c('0xfe')](path[_0x149c('0xff')](config[_0x149c('0x100')],_0x149c('0xfd'))));_0x4e5861[_0x149c('0x7')]('/www',express['static'](path['join'](config[_0x149c('0x100')],_0x149c('0x101'))));_0x4e5861[_0x149c('0x7')](_0x149c('0x102'),express[_0x149c('0xfe')](path['join'](config[_0x149c('0x100')],'/demo')));_0x4e5861[_0x149c('0x7')](_0x149c('0x103'),express[_0x149c('0xfe')](path[_0x149c('0xff')](config[_0x149c('0x100')],'snippet',_0x149c('0x104'))));_0x4e5861[_0x149c('0x7')](_0x149c('0x105'),express[_0x149c('0xfe')](path[_0x149c('0xff')](config[_0x149c('0x100')],_0x149c('0x106'))));_0x4e5861[_0x149c('0x107')](_0x149c('0x108'))['get'](errors[0x194]);_0x4e5861['route']('/*')[_0x149c('0x109')](function(_0x3bac29,_0x2b6ddf){_0x2b6ddf[_0x149c('0x10a')](path[_0x149c('0x10b')](_0x4e5861[_0x149c('0x109')](_0x149c('0x10c'))+_0x149c('0x10d')));});return _0x4e5861;});}; \ No newline at end of file +var _0xe320=['/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/jscriptyProject','/api/settings','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','./api/voicePrefix','./api/userProfile','./api/userProfileSection','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/realtime','./api/realtime','./api/user-setting','/api/mail_interaction_has_tags','./api/mailInteractionHasTag','/api/auth/local','./api/authLocal','./api/authGoogle','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','/api/logs','/apidoc','static','join','root','/www','/demo','/snippet','snippet','3.9.0','/plugins','route','get','sendFile','/index.html','path','express','./errors','./config/environment','setupLoggers','./api/client-side-logs','default','use','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','./api/voiceCallReport','/api/voice/dials/reports','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','./api/memberReport','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','/api/fax/accounts','./api/faxAccount','./api/faxApplication','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','./api/chatInteraction','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','./api/disposition','/api/conditions','/api/intervals','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','/api/tags','./api/tag','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','./api/template','./api/trigger','/api/variables','./api/variable','./api/integrationReport','/api/analytics/custom_reports','/api/analytics/default_reports','/api/analytics/extracted_reports','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','./api/intSalesforceField','./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/intDeskConfiguration','/api/integrations/desk/fields','/api/integrations/zoho/configurations','/api/integrations/zoho/fields','./api/intZohoField','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','./api/intFreshdeskConfiguration','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','/api/chat/reports/queue','./api/chatQueueReport'];(function(_0x4d6e3f,_0x48e790){var _0x2f7002=function(_0x28fdaa){while(--_0x28fdaa){_0x4d6e3f['push'](_0x4d6e3f['shift']());}};_0x2f7002(++_0x48e790);}(_0xe320,0x174));var _0x0e32=function(_0xfb760d,_0x522b2a){_0xfb760d=_0xfb760d-0x0;var _0x3ece90=_0xe320[_0xfb760d];return _0x3ece90;};'use strict';var path=require(_0x0e32('0x0'));var express=require(_0x0e32('0x1'));var errors=require(_0x0e32('0x2'));var config=require(_0x0e32('0x3'));var setupLoggers=require('./utils/client-side-logger')[_0x0e32('0x4')];var clientSideLogs=require(_0x0e32('0x5'));exports[_0x0e32('0x6')]=function(_0x49c099){return setupLoggers(_0x49c099)['then'](function(){_0x49c099[_0x0e32('0x7')](_0x0e32('0x8'),require(_0x0e32('0x9')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xa'),require(_0x0e32('0xb')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xc'),require('./api/voiceContext'));_0x49c099['use'](_0x0e32('0xd'),require(_0x0e32('0xe')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xf'),require(_0x0e32('0x10')));_0x49c099[_0x0e32('0x7')]('/api/voice/queues',require('./api/voiceQueue'));_0x49c099[_0x0e32('0x7')](_0x0e32('0x11'),require(_0x0e32('0x12')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x13'),require(_0x0e32('0x14')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x15'),require(_0x0e32('0x16')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x17'),require(_0x0e32('0x18')));_0x49c099[_0x0e32('0x7')]('/api/voice/calls/reports',require(_0x0e32('0x19')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x1a'),require('./api/voiceDialReport'));_0x49c099['use'](_0x0e32('0x1b'),require(_0x0e32('0x1c')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x1d'),require(_0x0e32('0x1e')));_0x49c099[_0x0e32('0x7')]('/api/members/reports',require(_0x0e32('0x1f')));_0x49c099[_0x0e32('0x7')]('/api/trunks',require(_0x0e32('0x20')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x21'),require(_0x0e32('0x22')));_0x49c099['use'](_0x0e32('0x23'),require(_0x0e32('0x24')));_0x49c099['use'](_0x0e32('0x25'),require(_0x0e32('0x26')));_0x49c099[_0x0e32('0x7')]('/api/mail/queues',require(_0x0e32('0x27')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x28'),require(_0x0e32('0x29')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x2a'),require(_0x0e32('0x2b')));_0x49c099['use'](_0x0e32('0x2c'),require(_0x0e32('0x2d')));_0x49c099['use']('/api/mail/applications',require(_0x0e32('0x2e')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x2f'),require(_0x0e32('0x30')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x31'),require('./api/dashboard'));_0x49c099[_0x0e32('0x7')](_0x0e32('0x32'),require('./api/dashboardItem'));_0x49c099[_0x0e32('0x7')](_0x0e32('0x33'),require(_0x0e32('0x34')));_0x49c099[_0x0e32('0x7')]('/api/fax/applications',require(_0x0e32('0x35')));_0x49c099[_0x0e32('0x7')]('/api/fax/interactions',require('./api/faxInteraction'));_0x49c099['use'](_0x0e32('0x36'),require(_0x0e32('0x37')));_0x49c099['use'](_0x0e32('0x38'),require(_0x0e32('0x39')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x3a'),require('./api/faxQueueReport'));_0x49c099[_0x0e32('0x7')](_0x0e32('0x3b'),require(_0x0e32('0x3c')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x3d'),require(_0x0e32('0x3e')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x3f'),require(_0x0e32('0x40')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x41'),require('./api/smsMessage'));_0x49c099[_0x0e32('0x7')](_0x0e32('0x42'),require(_0x0e32('0x43')));_0x49c099['use'](_0x0e32('0x44'),require(_0x0e32('0x45')));_0x49c099['use'](_0x0e32('0x46'),require(_0x0e32('0x47')));_0x49c099['use'](_0x0e32('0x48'),require(_0x0e32('0x49')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x4a'),require(_0x0e32('0x4b')));_0x49c099['use'](_0x0e32('0x4c'),require(_0x0e32('0x4d')));_0x49c099['use']('/api/chat/websites',require(_0x0e32('0x4e')));_0x49c099['use'](_0x0e32('0x4f'),require(_0x0e32('0x50')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x51'),require(_0x0e32('0x52')));_0x49c099[_0x0e32('0x7')]('/api/chat/interactions',require(_0x0e32('0x53')));_0x49c099[_0x0e32('0x7')]('/api/chat/messages',require(_0x0e32('0x54')));_0x49c099['use'](_0x0e32('0x55'),require(_0x0e32('0x56')));_0x49c099[_0x0e32('0x7')]('/api/chat/queues',require(_0x0e32('0x57')));_0x49c099[_0x0e32('0x7')]('/api/chat/groups',require(_0x0e32('0x58')));_0x49c099['use'](_0x0e32('0x59'),require(_0x0e32('0x5a')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x5b'),require(_0x0e32('0x5c')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x5d'),require(_0x0e32('0x5e')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x5f'),require(_0x0e32('0x60')));_0x49c099['use'](_0x0e32('0x61'),require(_0x0e32('0x62')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x63'),require('./api/cmHopperFinal'));_0x49c099[_0x0e32('0x7')](_0x0e32('0x64'),require(_0x0e32('0x65')));_0x49c099['use'](_0x0e32('0x66'),require(_0x0e32('0x67')));_0x49c099[_0x0e32('0x7')]('/api/actions',require(_0x0e32('0x68')));_0x49c099['use'](_0x0e32('0x69'),require(_0x0e32('0x6a')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x6b'),require(_0x0e32('0x6c')));_0x49c099['use']('/api/dispositions',require(_0x0e32('0x6d')));_0x49c099['use'](_0x0e32('0x6e'),require('./api/condition'));_0x49c099[_0x0e32('0x7')](_0x0e32('0x6f'),require('./api/interval'));_0x49c099[_0x0e32('0x7')]('/api/pauses',require(_0x0e32('0x70')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x71'),require(_0x0e32('0x72')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x73'),require('./api/voiceQueuesLog'));_0x49c099[_0x0e32('0x7')](_0x0e32('0x74'),require(_0x0e32('0x75')));_0x49c099['use']('/api/sounds',require(_0x0e32('0x76')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x77'),require(_0x0e32('0x78')));_0x49c099['use']('/api/contact_item_types',require(_0x0e32('0x79')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x7a'),require(_0x0e32('0x7b')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x7c'),require(_0x0e32('0x7d')));_0x49c099['use']('/api/templates',require(_0x0e32('0x7e')));_0x49c099[_0x0e32('0x7')]('/api/triggers',require(_0x0e32('0x7f')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x80'),require(_0x0e32('0x81')));_0x49c099[_0x0e32('0x7')]('/api/integrations',require('./api/integration'));_0x49c099[_0x0e32('0x7')]('/api/integrations/reports',require(_0x0e32('0x82')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x83'),require('./api/analyticCustomReport'));_0x49c099[_0x0e32('0x7')](_0x0e32('0x84'),require('./api/analyticDefaultReport'));_0x49c099['use'](_0x0e32('0x85'),require('./api/analyticExtractedReport'));_0x49c099[_0x0e32('0x7')](_0x0e32('0x86'),require(_0x0e32('0x87')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x88'),require(_0x0e32('0x89')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x8a'),require('./api/analyticTreeReport'));_0x49c099[_0x0e32('0x7')](_0x0e32('0x8b'),require(_0x0e32('0x8c')));_0x49c099['use'](_0x0e32('0x8d'),require('./api/intSalesforceConfiguration'));_0x49c099['use'](_0x0e32('0x8e'),require(_0x0e32('0x8f')));_0x49c099[_0x0e32('0x7')]('/api/integrations/sugarcrm/accounts',require(_0x0e32('0x90')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x91'),require(_0x0e32('0x92')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x93'),require(_0x0e32('0x94')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x95'),require(_0x0e32('0x96')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x97'),require(_0x0e32('0x98')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x99'),require('./api/intDeskField'));_0x49c099[_0x0e32('0x7')]('/api/integrations/zoho/accounts',require('./api/intZohoAccount'));_0x49c099['use'](_0x0e32('0x9a'),require('./api/intZohoConfiguration'));_0x49c099['use'](_0x0e32('0x9b'),require(_0x0e32('0x9c')));_0x49c099['use']('/api/integrations/zendesk/accounts',require('./api/intZendeskAccount'));_0x49c099['use']('/api/integrations/zendesk/configurations',require('./api/intZendeskConfiguration'));_0x49c099['use']('/api/integrations/zendesk/fields',require(_0x0e32('0x9d')));_0x49c099['use'](_0x0e32('0x9e'),require(_0x0e32('0x9f')));_0x49c099[_0x0e32('0x7')]('/api/integrations/freshdesk/configurations',require(_0x0e32('0xa0')));_0x49c099[_0x0e32('0x7')]('/api/integrations/freshdesk/fields',require('./api/intFreshdeskField'));_0x49c099[_0x0e32('0x7')](_0x0e32('0xa1'),require(_0x0e32('0xa2')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xa3'),require(_0x0e32('0xa4')));_0x49c099[_0x0e32('0x7')]('/api/integrations/vtiger/fields',require(_0x0e32('0xa5')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xa6'),require(_0x0e32('0xa7')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xa8'),require('./api/intServicenowConfiguration'));_0x49c099['use'](_0x0e32('0xa9'),require('./api/intServicenowField'));_0x49c099[_0x0e32('0x7')](_0x0e32('0xaa'),require(_0x0e32('0xab')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xac'),require(_0x0e32('0xad')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xae'),require(_0x0e32('0xaf')));_0x49c099['use']('/api/integrations/freshsales/accounts',require(_0x0e32('0xb0')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xb1'),require(_0x0e32('0xb2')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xb3'),require(_0x0e32('0xb4')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xb5'),require('./api/network'));_0x49c099[_0x0e32('0x7')](_0x0e32('0xb6'),require(_0x0e32('0xb7')));_0x49c099['use']('/api/chat/internal/messages',require('./api/chatInternalMessage'));_0x49c099[_0x0e32('0x7')](_0x0e32('0xb8'),require(_0x0e32('0xb9')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xba'),require('./api/jscriptyQuestionReport'));_0x49c099[_0x0e32('0x7')](_0x0e32('0xbb'),require(_0x0e32('0xbc')));_0x49c099['use'](_0x0e32('0xbd'),require(_0x0e32('0xbe')));_0x49c099['use'](_0x0e32('0xbf'),require(_0x0e32('0xc0')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xc1'),require('./api/squareReportDetail'));_0x49c099[_0x0e32('0x7')]('/api/jscripty/projects',require(_0x0e32('0xc2')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xc3'),require('./api/setting'));_0x49c099[_0x0e32('0x7')](_0x0e32('0xc4'),require(_0x0e32('0xc5')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xc6'),require(_0x0e32('0xc7')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xc8'),require(_0x0e32('0xc9')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xca'),require(_0x0e32('0xcb')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xcc'),require(_0x0e32('0xcd')));_0x49c099['use'](_0x0e32('0xce'),require(_0x0e32('0xcf')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xd0'),require(_0x0e32('0xd1')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xd2'),require(_0x0e32('0xd3')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xd4'),require(_0x0e32('0xd5')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xd6'),require(_0x0e32('0xd7')));_0x49c099[_0x0e32('0x7')]('/api/mail/reports/transfer',require(_0x0e32('0xd8')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xd9'),require(_0x0e32('0xda')));_0x49c099[_0x0e32('0x7')]('/api/fax/reports/transfer',require(_0x0e32('0xdb')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xdc'),require(_0x0e32('0xdd')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xde'),require(_0x0e32('0xdf')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xe0'),require('./api/cmList'));_0x49c099[_0x0e32('0x7')](_0x0e32('0xe1'),require(_0x0e32('0xe2')));_0x49c099[_0x0e32('0x7')]('/api/userProfiles',require(_0x0e32('0xe3')));_0x49c099[_0x0e32('0x7')]('/api/userProfile/sections',require(_0x0e32('0xe4')));_0x49c099[_0x0e32('0x7')]('/api/userProfile/resources',require('./api/userProfileResource'));_0x49c099[_0x0e32('0x7')]('/api/userNotifications',require('./api/userNotification'));_0x49c099[_0x0e32('0x7')](_0x0e32('0xe5'),require(_0x0e32('0xe6')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xe7'),require(_0x0e32('0xe8')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xe9'),require(_0x0e32('0xea')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xeb'),require(_0x0e32('0xec')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xed'),require(_0x0e32('0xee')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xef'),require(_0x0e32('0xf0')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xf1'),require(_0x0e32('0xf2')));_0x49c099[_0x0e32('0x7')]('/api/cloudProviders',require('./api/cloudProvider'));_0x49c099[_0x0e32('0x7')](_0x0e32('0xf3'),require(_0x0e32('0xf4')));_0x49c099[_0x0e32('0x7')]('/api/user-settings',require(_0x0e32('0xf5')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xf6'),require(_0x0e32('0xf7')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xf8'),require(_0x0e32('0xf9')));_0x49c099[_0x0e32('0x7')]('/api/auth/google',require(_0x0e32('0xfa')));_0x49c099[_0x0e32('0x7')]('/api/auth/activedirectory',require(_0x0e32('0xfb')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xfc'),require(_0x0e32('0xfd')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xfe'),require(_0x0e32('0xff')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x100'),require(_0x0e32('0x101')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x102'),require(_0x0e32('0x103')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x104'),require(_0x0e32('0x105')));_0x49c099['use'](_0x0e32('0x106'),require('./api/webbar'));_0x49c099[_0x0e32('0x7')](_0x0e32('0x107'),clientSideLogs);_0x49c099['use'](_0x0e32('0x108'),express[_0x0e32('0x109')](path[_0x0e32('0x10a')](config[_0x0e32('0x10b')],_0x0e32('0x108'))));_0x49c099[_0x0e32('0x7')](_0x0e32('0x10c'),express[_0x0e32('0x109')](path[_0x0e32('0x10a')](config[_0x0e32('0x10b')],_0x0e32('0x10c'))));_0x49c099[_0x0e32('0x7')]('/demo',express[_0x0e32('0x109')](path[_0x0e32('0x10a')](config[_0x0e32('0x10b')],_0x0e32('0x10d'))));_0x49c099['use'](_0x0e32('0x10e'),express[_0x0e32('0x109')](path[_0x0e32('0x10a')](config[_0x0e32('0x10b')],_0x0e32('0x10f'),_0x0e32('0x110'))));_0x49c099[_0x0e32('0x7')](_0x0e32('0x111'),express[_0x0e32('0x109')](path[_0x0e32('0x10a')](config[_0x0e32('0x10b')],'/server/files/plugins')));_0x49c099[_0x0e32('0x112')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0x0e32('0x113')](errors[0x194]);_0x49c099[_0x0e32('0x112')]('/*')[_0x0e32('0x113')](function(_0x3cfd0b,_0x45015a){_0x45015a[_0x0e32('0x114')](path['resolve'](_0x49c099['get']('appPath')+_0x0e32('0x115')));});return _0x49c099;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index d2c66e1..5ec9785 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf939=['../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/pause/pause.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','log','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','../config/environment','listen','merge'];(function(_0x89cb3a,_0x385fd1){var _0x407cf1=function(_0x61fa77){while(--_0x61fa77){_0x89cb3a['push'](_0x89cb3a['shift']());}};_0x407cf1(++_0x385fd1);}(_0xf939,0x1b8));var _0x9f93=function(_0xdc3cb,_0x3379f4){_0xdc3cb=_0xdc3cb-0x0;var _0x166007=_0xf939[_0xdc3cb];return _0x166007;};'use strict';var jayson=require(_0x9f93('0x0'));var _=require('lodash');var config=require(_0x9f93('0x1'));exports[_0x9f93('0x2')]=function(){return new Promise(function(_0x1d4f12,_0x57f66c){var _0x54a669={};_0x54a669=_[_0x9f93('0x3')](_0x54a669,require(_0x9f93('0x4')));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require(_0x9f93('0x5')));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require('../api/voiceQueue/voiceQueue.rpc'));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require(_0x9f93('0x6')));_0x54a669=_['merge'](_0x54a669,require(_0x9f93('0x7')));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require(_0x9f93('0x8')));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require(_0x9f93('0x9')));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require(_0x9f93('0xa')));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require('../api/memberReport/memberReport.rpc'));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require(_0x9f93('0xb')));_0x54a669=_['merge'](_0x54a669,require(_0x9f93('0xc')));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require(_0x9f93('0xd')));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require(_0x9f93('0xe')));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require(_0x9f93('0xf')));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require('../api/mailQueue/mailQueue.rpc'));_0x54a669=_['merge'](_0x54a669,require('../api/mailInteraction/mailInteraction.rpc'));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require('../api/mailMessage/mailMessage.rpc'));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require(_0x9f93('0x10')));_0x54a669=_['merge'](_0x54a669,require(_0x9f93('0x11')));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require('../api/faxAccount/faxAccount.rpc'));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require(_0x9f93('0x12')));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require(_0x9f93('0x13')));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require('../api/faxMessage/faxMessage.rpc'));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require('../api/faxQueue/faxQueue.rpc'));_0x54a669=_['merge'](_0x54a669,require(_0x9f93('0x14')));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require(_0x9f93('0x15')));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require(_0x9f93('0x16')));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require(_0x9f93('0x17')));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require(_0x9f93('0x18')));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require(_0x9f93('0x19')));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require(_0x9f93('0x1a')));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require(_0x9f93('0x1b')));_0x54a669=_['merge'](_0x54a669,require(_0x9f93('0x1c')));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require(_0x9f93('0x1d')));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require(_0x9f93('0x1e')));_0x54a669=_['merge'](_0x54a669,require('../api/chatQueue/chatQueue.rpc'));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require(_0x9f93('0x1f')));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require(_0x9f93('0x20')));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require(_0x9f93('0x21')));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require(_0x9f93('0x22')));_0x54a669=_['merge'](_0x54a669,require(_0x9f93('0x23')));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require('../api/interval/interval.rpc'));_0x54a669=_['merge'](_0x54a669,require(_0x9f93('0x24')));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require('../api/sound/sound.rpc'));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require(_0x9f93('0x25')));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require(_0x9f93('0x26')));_0x54a669=_['merge'](_0x54a669,require(_0x9f93('0x27')));_0x54a669=_['merge'](_0x54a669,require(_0x9f93('0x28')));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require(_0x9f93('0x29')));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require(_0x9f93('0x2a')));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require(_0x9f93('0x2b')));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require(_0x9f93('0x2c')));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require(_0x9f93('0x2d')));_0x54a669=_['merge'](_0x54a669,require(_0x9f93('0x2e')));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require(_0x9f93('0x2f')));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require(_0x9f93('0x30')));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x54a669=_['merge'](_0x54a669,require(_0x9f93('0x31')));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require(_0x9f93('0x32')));_0x54a669=_['merge'](_0x54a669,require(_0x9f93('0x33')));_0x54a669=_['merge'](_0x54a669,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x54a669=_['merge'](_0x54a669,require(_0x9f93('0x34')));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require(_0x9f93('0x35')));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require('../api/squareProject/squareProject.rpc'));_0x54a669=_['merge'](_0x54a669,require(_0x9f93('0x36')));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require(_0x9f93('0x37')));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require(_0x9f93('0x38')));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require(_0x9f93('0x39')));_0x54a669=_['merge'](_0x54a669,require(_0x9f93('0x3a')));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require(_0x9f93('0x3b')));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require(_0x9f93('0x3c')));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require(_0x9f93('0x3d')));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require(_0x9f93('0x3e')));_0x54a669=_[_0x9f93('0x3')](_0x54a669,require(_0x9f93('0x3f')));var _0x4c6948=jayson[_0x9f93('0x40')](_0x54a669)[_0x9f93('0x41')]();var _0x2e6ec8=config[_0x9f93('0x42')]['port']||config[_0x9f93('0x43')]+0x1;var _0x454826=config[_0x9f93('0x42')]['ip']||_0x9f93('0x44');_0x4c6948['on'](_0x9f93('0x45'),function(_0x3350a4){return _0x57f66c(_0x3350a4);});_0x4c6948[_0x9f93('0x2')](_0x2e6ec8,_0x454826,function(){console[_0x9f93('0x46')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x454826,_0x2e6ec8);require(_0x9f93('0x47'))[_0x9f93('0x48')]();return _0x1d4f12(_0x9f93('0x49')+_0x454826+':'+_0x2e6ec8);});});}; \ No newline at end of file +var _0xdc97=['../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','http','rpc','port','localhost','error','listen','../config/triggers','default','jayson/promise','lodash','../config/environment','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/mailAccount/mailAccount.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'];(function(_0xea089d,_0x26a88d){var _0x3950e6=function(_0x156b6e){while(--_0x156b6e){_0xea089d['push'](_0xea089d['shift']());}};_0x3950e6(++_0x26a88d);}(_0xdc97,0x13b));var _0x7dc9=function(_0x22c59f,_0x320bb1){_0x22c59f=_0x22c59f-0x0;var _0x1e56a3=_0xdc97[_0x22c59f];return _0x1e56a3;};'use strict';var jayson=require(_0x7dc9('0x0'));var _=require(_0x7dc9('0x1'));var config=require(_0x7dc9('0x2'));exports['listen']=function(){return new Promise(function(_0x2913e6,_0x4f5c88){var _0x228e39={};_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require('../api/user/user.rpc'));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x4')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x5')));_0x228e39=_['merge'](_0x228e39,require(_0x7dc9('0x6')));_0x228e39=_['merge'](_0x228e39,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x7')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x8')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x9')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0xa')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0xb')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x228e39=_['merge'](_0x228e39,require('../api/mailServerIn/mailServerIn.rpc'));_0x228e39=_['merge'](_0x228e39,require(_0x7dc9('0xc')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require('../api/mailQueue/mailQueue.rpc'));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0xd')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0xe')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0xf')));_0x228e39=_['merge'](_0x228e39,require(_0x7dc9('0x10')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x11')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x12')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x13')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x14')));_0x228e39=_['merge'](_0x228e39,require(_0x7dc9('0x15')));_0x228e39=_['merge'](_0x228e39,require(_0x7dc9('0x16')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require('../api/smsAccount/smsAccount.rpc'));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x17')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x18')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x19')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x1a')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x1b')));_0x228e39=_['merge'](_0x228e39,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x1c')));_0x228e39=_['merge'](_0x228e39,require(_0x7dc9('0x1d')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require('../api/chatInteraction/chatInteraction.rpc'));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x1e')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require('../api/chatQueue/chatQueue.rpc'));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x1f')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require('../api/cmHopper/cmHopper.rpc'));_0x228e39=_['merge'](_0x228e39,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x20')));_0x228e39=_['merge'](_0x228e39,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x21')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x22')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x23')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x24')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x25')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x26')));_0x228e39=_['merge'](_0x228e39,require('../api/variable/variable.rpc'));_0x228e39=_['merge'](_0x228e39,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x228e39=_['merge'](_0x228e39,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x228e39=_['merge'](_0x228e39,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x27')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x28')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x29')));_0x228e39=_['merge'](_0x228e39,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x228e39=_['merge'](_0x228e39,require(_0x7dc9('0x2a')));_0x228e39=_['merge'](_0x228e39,require(_0x7dc9('0x2b')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x2c')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x2d')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x2e')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require('../api/squareReport/squareReport.rpc'));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x2f')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x30')));_0x228e39=_['merge'](_0x228e39,require(_0x7dc9('0x31')));_0x228e39=_['merge'](_0x228e39,require(_0x7dc9('0x32')));_0x228e39=_['merge'](_0x228e39,require('../api/squareMessage/squareMessage.rpc'));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x33')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x34')));_0x228e39=_['merge'](_0x228e39,require(_0x7dc9('0x35')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x36')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x37')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x38')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x39')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x3a')));var _0x3a8d80=jayson['server'](_0x228e39)[_0x7dc9('0x3b')]();var _0x7cdd8d=config[_0x7dc9('0x3c')][_0x7dc9('0x3d')]||config['port']+0x1;var _0x3492e6=config[_0x7dc9('0x3c')]['ip']||_0x7dc9('0x3e');_0x3a8d80['on'](_0x7dc9('0x3f'),function(_0x295853){return _0x4f5c88(_0x295853);});_0x3a8d80[_0x7dc9('0x40')](_0x7cdd8d,_0x3492e6,function(){console['log']('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x3492e6,_0x7cdd8d);require(_0x7dc9('0x41'))[_0x7dc9('0x42')]();return _0x2913e6('RPC\x20listening\x20on\x20'+_0x3492e6+':'+_0x7cdd8d);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index bfe63d9..f6c5244 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 _0xb408=['destroy','command','write','inherits','sendRequest','prototype','answer','ANSWER','beep','noop','NO\x20MESSAGE','format','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','replace','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setPriority','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','agi','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','EventEmitter','./reply','call','setEncoding','utf8','setTimeout','headers','ready','line','toLowerCase','hangup','emit','520-Invalid','search','520\x20End\x20of\x20proper','result=','indexOf','substr','split','substring','length','match','error','E_AGI_SOCKET_ERROR','close','timeout','E_AGI_SOCKET_TIMEOUT'];(function(_0x20ad31,_0xfcd7e1){var _0x44635c=function(_0x10e7b6){while(--_0x10e7b6){_0x20ad31['push'](_0x20ad31['shift']());}};_0x44635c(++_0xfcd7e1);}(_0xb408,0x15f));var _0x8b40=function(_0x246426,_0x505c21){_0x246426=_0x246426-0x0;var _0x320fcf=_0xb408[_0x246426];return _0x320fcf;};'use strict';var util=require(_0x8b40('0x0'));var _=require(_0x8b40('0x1'));var EventEmitter=require('events')[_0x8b40('0x2')];var AGIReply=require(_0x8b40('0x3'));var AGIError=require('./error');function AGIChannel(_0x2e5aa5){var _0xa31766=this,_0x4a82ec=new AGIReply(),_0x5df71a=![],_0x5316ec={};EventEmitter[_0x8b40('0x4')](_0xa31766);_0x2e5aa5[_0x8b40('0x5')](_0x8b40('0x6'));_0x2e5aa5[_0x8b40('0x7')](0x8*0x3c*0x3c*0x3e8);_0x4a82ec[_0x8b40('0x5')](_0x8b40('0x6'));_0x4a82ec['on'](_0x8b40('0x8'),function(_0x19fc9b){for(var _0x2f8377 in _0x19fc9b){_0xa31766[_0x2f8377]=_0x19fc9b[_0x2f8377];}_0xa31766['emit'](_0x8b40('0x9'));});_0x4a82ec['on'](_0x8b40('0xa'),function(_0x265473){if(_0x265473[_0x8b40('0xb')]()==_0x8b40('0xc')){_0xa31766[_0x8b40('0xd')]('hangup');return;}if(_0x265473['substring'](0x0,0xb)==_0x8b40('0xe')){_0x5df71a=!![];}if(_0x5df71a){_0x5316ec['rx']+=_0x265473+'\x0a';if(_0x265473[_0x8b40('0xf')](_0x8b40('0x10'))!=-0x1){_0x5df71a=![];}}else{_0x5316ec['rx']=_0x265473;}if(_0x5df71a){return;}if(typeof _0x5316ec['cb']=='function'){var _0x28853f=_0x5316ec['rx']['substring'](0x0,0x3),_0x631969=null,_0x1bfc56=null;_0x28853f=parseInt(_0x28853f);if(isNaN(_0x28853f)){_0x5316ec['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x28853f!=0xc8){_0x5316ec['cb'](null,{'code':_0x28853f,'result':-0x1,'extra':'KO'});return;}_0x631969=_0x5316ec['rx']['substring'](0x4)['replace'](_0x8b40('0x11'),'');if(_0x631969[_0x8b40('0x12')]('\x20')!=-0x1){_0x631969=_0x631969[_0x8b40('0x13')](0x0,_0x631969[_0x8b40('0x12')]('\x20'));}if(_['startsWith'](_0x631969,'-1')){_0x631969=parseInt(_0x631969);}_0x1bfc56=_0x5316ec['rx'][_0x8b40('0x14')]('\x20');if(_0x1bfc56['length']==0x3){_0x1bfc56=_0x1bfc56[0x2][_0x8b40('0x15')](0x1,_0x1bfc56[0x2]['length']-0x1);}else if(_0x1bfc56[_0x8b40('0x16')]>0x3){var _0x3da440=/\((.+)\)/;var _0x329ea6=_0x5316ec['rx'][_0x8b40('0x17')](_0x3da440);if(_0x329ea6){_0x1bfc56=_0x329ea6[0x1];}else{_0x1bfc56=null;}}else{_0x1bfc56=null;}_0x5316ec['cb'](null,{'code':_0x28853f,'result':_0x631969,'extra':_0x1bfc56});}});_0x2e5aa5['on'](_0x8b40('0x18'),function(_0x39201a){_0xa31766[_0x8b40('0xd')]('error',new AGIError(_0x8b40('0x19'),_0x39201a['code']));});_0x2e5aa5['on'](_0x8b40('0x1a'),function(){_0xa31766[_0x8b40('0xd')](_0x8b40('0x1a'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x2e5aa5['on']('timeout',function(){_0xa31766['emit'](_0x8b40('0x1b'),new AGIError(_0x8b40('0x1c')));_0x2e5aa5[_0x8b40('0x1d')]();});_0x2e5aa5['pipe'](_0x4a82ec);this[_0x8b40('0x1e')]=function(_0x4f2446,_0x772ffc){var _0x4f2446=_0x4f2446||'',_0x772ffc=typeof _0x772ffc=='function'?_0x772ffc:new Function();_0x5316ec={'tx':_0x4f2446,'rx':'','cb':_0x772ffc};_0x2e5aa5[_0x8b40('0x1f')](_0x4f2446+'\x0a');},this['close']=function(){_0x2e5aa5['destroy']();};}util[_0x8b40('0x20')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x8b40('0x21')]=function(_0x319880){return this[_0x8b40('0x1e')]['sync'](this,_0x319880);};AGIChannel[_0x8b40('0x22')][_0x8b40('0x23')]=function(){return this['sendRequest'](_0x8b40('0x24'));};AGIChannel[_0x8b40('0x22')]['getData']=function(_0x4fc8b0,_0x5d4cb5,_0x13ef7f){_0x4fc8b0=_0x4fc8b0===undefined?_0x8b40('0x25'):_0x4fc8b0;_0x5d4cb5=_0x5d4cb5===undefined?'5':_0x5d4cb5;_0x13ef7f=_0x13ef7f===undefined?'1':_0x13ef7f;return this[_0x8b40('0x21')](util['format']('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x4fc8b0,_0x5d4cb5*0x3e8,_0x13ef7f));};AGIChannel[_0x8b40('0x22')][_0x8b40('0x26')]=function(_0x437207){_0x437207=_0x437207||_0x8b40('0x27');return this[_0x8b40('0x21')](util[_0x8b40('0x28')](_0x8b40('0x29'),_0x437207));};AGIChannel['prototype'][_0x8b40('0x2a')]=function(_0x27cb7b,_0x17d136){if(_[_0x8b40('0x2b')](_0x17d136)){return this[_0x8b40('0x21')](util['format'](_0x8b40('0x2c'),_0x27cb7b,_0x17d136[_0x8b40('0x2d')](',')));}return this[_0x8b40('0x21')](util[_0x8b40('0x28')](_0x8b40('0x2c'),_0x27cb7b,_0x17d136));};AGIChannel[_0x8b40('0x22')][_0x8b40('0x2e')]=function(_0x16beef){return this[_0x8b40('0x21')](util[_0x8b40('0x28')](_0x8b40('0x2f'),_0x16beef));};AGIChannel[_0x8b40('0x22')][_0x8b40('0x30')]=function(_0x4f8ae3){return this[_0x8b40('0x21')](util[_0x8b40('0x28')](_0x8b40('0x31'),_0x4f8ae3));};AGIChannel[_0x8b40('0x22')]['setPriority']=function(_0x481371){return this['sendRequest'](util['format'](_0x8b40('0x32'),_0x481371));};AGIChannel[_0x8b40('0x22')][_0x8b40('0xc')]=function(){return this[_0x8b40('0x21')]('HANGUP');};AGIChannel[_0x8b40('0x22')][_0x8b40('0x33')]=function(_0x2b8a72,_0x1c8281){var _0x12048b=_[_0x8b40('0x34')](_0x1c8281)||_[_0x8b40('0x35')](_0x1c8281)?_0x1c8281[_0x8b40('0x36')]():_0x1c8281;return this[_0x8b40('0x21')](util['format'](_0x8b40('0x37'),_0x2b8a72,_0x12048b?_0x12048b[_0x8b40('0x36')]()[_0x8b40('0x38')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x8b40('0x22')]['sayNumber']=function(_0x59f040,_0x3a3bcf){return this['sendRequest'](util[_0x8b40('0x28')](_0x8b40('0x39'),_0x59f040,_0x3a3bcf));};AGIChannel[_0x8b40('0x22')][_0x8b40('0x3a')]=function(_0x17b0f2,_0x54b886){return this[_0x8b40('0x21')](util['format']('SAY\x20DIGITS\x20%s\x20%s',_0x17b0f2,_0x54b886));};AGIChannel[_0x8b40('0x22')][_0x8b40('0x3b')]=function(_0x293d5d,_0x5457b4){return this[_0x8b40('0x21')](util[_0x8b40('0x28')](_0x8b40('0x3c'),_0x293d5d,_0x5457b4));};AGIChannel[_0x8b40('0x22')][_0x8b40('0x3d')]=function(_0x3dd2a5,_0x3447ae,_0x26b948){_0x3447ae=_0x3447ae||this[_0x8b40('0x3e')];_0x26b948=_0x26b948||0x1;this[_0x8b40('0x2e')](_0x3dd2a5);this[_0x8b40('0x30')](_0x3447ae);this[_0x8b40('0x3f')](_0x26b948);return this[_0x8b40('0x26')](util[_0x8b40('0x28')](_0x8b40('0x40'),_0x3dd2a5,_0x3447ae,_0x26b948));};AGIChannel[_0x8b40('0x22')][_0x8b40('0x41')]=function(_0x239479){return this[_0x8b40('0x21')](util[_0x8b40('0x28')]('GET\x20VARIABLE\x20\x22%s\x22',_0x239479));};AGIChannel[_0x8b40('0x22')][_0x8b40('0x42')]=function(_0x4af278,_0xc0ccad,_0x6ce772,_0x2157ae,_0x1db451,_0x4a6dbd){_0xc0ccad=_0xc0ccad||'wav';_0x6ce772=_0x6ce772||'';_0x2157ae=_0x2157ae===undefined?-0x1:_0x2157ae==='-1'?-0x1:_0x2157ae*0x3e8;_0x1db451=_0x1db451===undefined?'':'s='+_0x1db451;_0x4a6dbd=_0x4a6dbd?_0x8b40('0x43'):'';return this[_0x8b40('0x21')](util[_0x8b40('0x28')](_0x8b40('0x44'),_0x4af278,_0xc0ccad,_0x6ce772,_0x2157ae,_0x4a6dbd,_0x1db451));};AGIChannel[_0x8b40('0x22')][_0x8b40('0x45')]=function(_0x503763,_0x17974e){_0x17974e=_0x17974e||'';return this[_0x8b40('0x21')](util[_0x8b40('0x28')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x503763,_0x17974e));};AGIChannel['prototype'][_0x8b40('0x46')]=function(_0x36debc){return this[_0x8b40('0x2a')]('AGI',_0x36debc);};AGIChannel[_0x8b40('0x22')][_0x8b40('0x47')]=function(_0x13c381){return this['exec'](_0x8b40('0x48'),_0x13c381);};AGIChannel[_0x8b40('0x22')][_0x8b40('0x18')]=function(_0x17733e,_0x55980e){this[_0x8b40('0x26')](util['format'](_0x8b40('0x49'),_0x17733e['id'],_0x17733e[_0x8b40('0x4a')],_0x55980e));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x8b40('0x4b')]=AGIChannel; \ No newline at end of file +var _0x71ab=['SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','extension','setExtension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','exec','AGI','wait','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','lodash','EventEmitter','./error','call','setEncoding','utf8','setTimeout','headers','emit','ready','line','toLowerCase','hangup','substring','search','function','no\x20code','substr','indexOf','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','command','write','destroy','inherits','sendRequest','sync','prototype','answer','ANSWER','getData','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','join','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isNumber','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','sayNumber'];(function(_0x41dba8,_0x3d3f6e){var _0x2c5641=function(_0x46638c){while(--_0x46638c){_0x41dba8['push'](_0x41dba8['shift']());}};_0x2c5641(++_0x3d3f6e);}(_0x71ab,0x64));var _0xb71a=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x71ab[_0xa464c9];return _0x3d73c4;};'use strict';var util=require('util');var _=require(_0xb71a('0x0'));var EventEmitter=require('events')[_0xb71a('0x1')];var AGIReply=require('./reply');var AGIError=require(_0xb71a('0x2'));function AGIChannel(_0x3f0529){var _0x20fd9c=this,_0x4094b2=new AGIReply(),_0x37ce74=![],_0x3c6438={};EventEmitter[_0xb71a('0x3')](_0x20fd9c);_0x3f0529[_0xb71a('0x4')](_0xb71a('0x5'));_0x3f0529[_0xb71a('0x6')](0x8*0x3c*0x3c*0x3e8);_0x4094b2[_0xb71a('0x4')](_0xb71a('0x5'));_0x4094b2['on'](_0xb71a('0x7'),function(_0x471ab6){for(var _0x18c7a6 in _0x471ab6){_0x20fd9c[_0x18c7a6]=_0x471ab6[_0x18c7a6];}_0x20fd9c[_0xb71a('0x8')](_0xb71a('0x9'));});_0x4094b2['on'](_0xb71a('0xa'),function(_0x517eed){if(_0x517eed[_0xb71a('0xb')]()=='hangup'){_0x20fd9c[_0xb71a('0x8')](_0xb71a('0xc'));return;}if(_0x517eed[_0xb71a('0xd')](0x0,0xb)=='520-Invalid'){_0x37ce74=!![];}if(_0x37ce74){_0x3c6438['rx']+=_0x517eed+'\x0a';if(_0x517eed[_0xb71a('0xe')]('520\x20End\x20of\x20proper')!=-0x1){_0x37ce74=![];}}else{_0x3c6438['rx']=_0x517eed;}if(_0x37ce74){return;}if(typeof _0x3c6438['cb']==_0xb71a('0xf')){var _0x50030d=_0x3c6438['rx'][_0xb71a('0xd')](0x0,0x3),_0x50b43b=null,_0x3346a5=null;_0x50030d=parseInt(_0x50030d);if(isNaN(_0x50030d)){_0x3c6438['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xb71a('0x10')});return;}if(_0x50030d!=0xc8){_0x3c6438['cb'](null,{'code':_0x50030d,'result':-0x1,'extra':'KO'});return;}_0x50b43b=_0x3c6438['rx'][_0xb71a('0xd')](0x4)['replace']('result=','');if(_0x50b43b['indexOf']('\x20')!=-0x1){_0x50b43b=_0x50b43b[_0xb71a('0x11')](0x0,_0x50b43b[_0xb71a('0x12')]('\x20'));}if(_[_0xb71a('0x13')](_0x50b43b,'-1')){_0x50b43b=parseInt(_0x50b43b);}_0x3346a5=_0x3c6438['rx'][_0xb71a('0x14')]('\x20');if(_0x3346a5[_0xb71a('0x15')]==0x3){_0x3346a5=_0x3346a5[0x2][_0xb71a('0xd')](0x1,_0x3346a5[0x2][_0xb71a('0x15')]-0x1);}else if(_0x3346a5[_0xb71a('0x15')]>0x3){var _0x7710a8=/\((.+)\)/;var _0x5588cf=_0x3c6438['rx'][_0xb71a('0x16')](_0x7710a8);if(_0x5588cf){_0x3346a5=_0x5588cf[0x1];}else{_0x3346a5=null;}}else{_0x3346a5=null;}_0x3c6438['cb'](null,{'code':_0x50030d,'result':_0x50b43b,'extra':_0x3346a5});}});_0x3f0529['on'](_0xb71a('0x17'),function(_0x374c8c){_0x20fd9c[_0xb71a('0x8')](_0xb71a('0x17'),new AGIError(_0xb71a('0x18'),_0x374c8c[_0xb71a('0x19')]));});_0x3f0529['on'](_0xb71a('0x1a'),function(){_0x20fd9c[_0xb71a('0x8')](_0xb71a('0x1a'),new AGIError(_0xb71a('0x1b')));});_0x3f0529['on']('timeout',function(){_0x20fd9c['emit'](_0xb71a('0x1c'),new AGIError(_0xb71a('0x1d')));_0x3f0529['destroy']();});_0x3f0529['pipe'](_0x4094b2);this[_0xb71a('0x1e')]=function(_0x4fe4fb,_0x76d6dc){var _0x4fe4fb=_0x4fe4fb||'',_0x76d6dc=typeof _0x76d6dc==_0xb71a('0xf')?_0x76d6dc:new Function();_0x3c6438={'tx':_0x4fe4fb,'rx':'','cb':_0x76d6dc};_0x3f0529[_0xb71a('0x1f')](_0x4fe4fb+'\x0a');},this[_0xb71a('0x1a')]=function(){_0x3f0529[_0xb71a('0x20')]();};}util[_0xb71a('0x21')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0xb71a('0x22')]=function(_0x2c15bc){return this[_0xb71a('0x1e')][_0xb71a('0x23')](this,_0x2c15bc);};AGIChannel[_0xb71a('0x24')][_0xb71a('0x25')]=function(){return this[_0xb71a('0x22')](_0xb71a('0x26'));};AGIChannel[_0xb71a('0x24')][_0xb71a('0x27')]=function(_0x45b849,_0x17f8b2,_0x160f0f){_0x45b849=_0x45b849===undefined?'beep':_0x45b849;_0x17f8b2=_0x17f8b2===undefined?'5':_0x17f8b2;_0x160f0f=_0x160f0f===undefined?'1':_0x160f0f;return this[_0xb71a('0x22')](util[_0xb71a('0x28')](_0xb71a('0x29'),_0x45b849,_0x17f8b2*0x3e8,_0x160f0f));};AGIChannel[_0xb71a('0x24')][_0xb71a('0x2a')]=function(_0x38178c){_0x38178c=_0x38178c||_0xb71a('0x2b');return this[_0xb71a('0x22')](util[_0xb71a('0x28')](_0xb71a('0x2c'),_0x38178c));};AGIChannel[_0xb71a('0x24')]['exec']=function(_0x56f5a4,_0x3112d3){if(_['isArray'](_0x3112d3)){return this[_0xb71a('0x22')](util[_0xb71a('0x28')]('EXEC\x20%s\x20%s',_0x56f5a4,_0x3112d3[_0xb71a('0x2d')](',')));}return this[_0xb71a('0x22')](util[_0xb71a('0x28')](_0xb71a('0x2e'),_0x56f5a4,_0x3112d3));};AGIChannel[_0xb71a('0x24')][_0xb71a('0x2f')]=function(_0x5dd779){return this[_0xb71a('0x22')](util[_0xb71a('0x28')](_0xb71a('0x30'),_0x5dd779));};AGIChannel[_0xb71a('0x24')]['setExtension']=function(_0x2ea22a){return this[_0xb71a('0x22')](util[_0xb71a('0x28')](_0xb71a('0x31'),_0x2ea22a));};AGIChannel[_0xb71a('0x24')][_0xb71a('0x32')]=function(_0x2962a0){return this[_0xb71a('0x22')](util[_0xb71a('0x28')](_0xb71a('0x33'),_0x2962a0));};AGIChannel['prototype']['hangup']=function(){return this[_0xb71a('0x22')](_0xb71a('0x34'));};AGIChannel[_0xb71a('0x24')][_0xb71a('0x35')]=function(_0xb5d842,_0x247540){var _0x394b4f=_['isBoolean'](_0x247540)||_[_0xb71a('0x36')](_0x247540)?_0x247540['toString']():_0x247540;return this[_0xb71a('0x22')](util[_0xb71a('0x28')](_0xb71a('0x37'),_0xb5d842,_0x394b4f?_0x394b4f[_0xb71a('0x38')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xb71a('0x24')][_0xb71a('0x39')]=function(_0x4694fd,_0x1fa15c){return this[_0xb71a('0x22')](util[_0xb71a('0x28')](_0xb71a('0x3a'),_0x4694fd,_0x1fa15c));};AGIChannel[_0xb71a('0x24')][_0xb71a('0x3b')]=function(_0x59c61a,_0x24a3af){return this['sendRequest'](util[_0xb71a('0x28')](_0xb71a('0x3c'),_0x59c61a,_0x24a3af));};AGIChannel[_0xb71a('0x24')][_0xb71a('0x3d')]=function(_0xce7b8a,_0x18872b){return this['sendRequest'](util['format']('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0xce7b8a,_0x18872b));};AGIChannel[_0xb71a('0x24')]['continueAt']=function(_0x2db5c9,_0x23f542,_0x155502){_0x23f542=_0x23f542||this[_0xb71a('0x3e')];_0x155502=_0x155502||0x1;this[_0xb71a('0x2f')](_0x2db5c9);this[_0xb71a('0x3f')](_0x23f542);this['setPriority'](_0x155502);return this[_0xb71a('0x2a')](util[_0xb71a('0x28')](_0xb71a('0x40'),_0x2db5c9,_0x23f542,_0x155502));};AGIChannel[_0xb71a('0x24')][_0xb71a('0x41')]=function(_0x2f08d2){return this['sendRequest'](util[_0xb71a('0x28')](_0xb71a('0x42'),_0x2f08d2));};AGIChannel[_0xb71a('0x24')][_0xb71a('0x43')]=function(_0x3cb177,_0x8f97ff,_0x1d1c38,_0x48baae,_0x48db05,_0x2442f5){_0x8f97ff=_0x8f97ff||_0xb71a('0x44');_0x1d1c38=_0x1d1c38||'';_0x48baae=_0x48baae===undefined?-0x1:_0x48baae==='-1'?-0x1:_0x48baae*0x3e8;_0x48db05=_0x48db05===undefined?'':'s='+_0x48db05;_0x2442f5=_0x2442f5?_0xb71a('0x45'):'';return this[_0xb71a('0x22')](util['format'](_0xb71a('0x46'),_0x3cb177,_0x8f97ff,_0x1d1c38,_0x48baae,_0x2442f5,_0x48db05));};AGIChannel['prototype'][_0xb71a('0x47')]=function(_0x1d8793,_0x58e039){_0x58e039=_0x58e039||'';return this[_0xb71a('0x22')](util[_0xb71a('0x28')](_0xb71a('0x48'),_0x1d8793,_0x58e039));};AGIChannel[_0xb71a('0x24')]['agi']=function(_0x188896){return this[_0xb71a('0x49')](_0xb71a('0x4a'),_0x188896);};AGIChannel['prototype'][_0xb71a('0x4b')]=function(_0x1cd434){return this[_0xb71a('0x49')]('WAIT',_0x1cd434);};AGIChannel[_0xb71a('0x24')][_0xb71a('0x17')]=function(_0x2f6f6e,_0x1f29b7){this[_0xb71a('0x2a')](util['format'](_0xb71a('0x4c'),_0x2f6f6e['id'],_0x2f6f6e[_0xb71a('0x4d')],_0x1f29b7));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xb71a('0x4e')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 00a4e10..6762c06 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 _0xb177=['exports','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','push','format','message','name'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0xb177,0xa9));var _0x7b17=function(_0x370673,_0x462b14){_0x370673=_0x370673-0x0;var _0x177441=_0xb177[_0x370673];return _0x177441;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0x7b17('0x0'),'E_AGI_SERVER_ERROR':_0x7b17('0x1'),'E_AGI_SERVER_CLOSE':_0x7b17('0x2'),'E_AGI_SERVER_MAXCONNECTION':_0x7b17('0x3'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0x7b17('0x4'),'E_AGI_SOCKET_CLOSE':_0x7b17('0x5'),'E_AGI_SOCKET_TIMEOUT':_0x7b17('0x6'),'E_AGI_COMMAND_EMPTY':_0x7b17('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x7b17('0x8')};function AGIError(_0x309737){var _0x309737=_0x309737||null,_0x48ed08=_0x48ed08||[],_0x11a1a9=0x1,_0xb58342='';if(!error[_0x309737]){_0x309737='E_AGI_UNDEFINED';}_0x48ed08[_0x7b17('0x9')](error[_0x309737]);while(arguments[_0x11a1a9]){_0x48ed08[_0x7b17('0x9')](arguments[_0x11a1a9]);_0x11a1a9++;}_0xb58342=util[_0x7b17('0xa')]['apply'](util,_0x48ed08);this[_0x7b17('0xb')]=_0xb58342;this[_0x7b17('0xc')]=_0x309737;}module[_0x7b17('0xd')]=AGIError; \ No newline at end of file +var _0x50a1=['E_AGI_UNDEFINED','push','format','message','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x50a1,0x1ee));var _0x150a=function(_0x3d2ab5,_0x1a3553){_0x3d2ab5=_0x3d2ab5-0x0;var _0x421623=_0x50a1[_0x3d2ab5];return _0x421623;};'use strict';var util=require(_0x150a('0x0'));var error={'E_AGI_UNDEFINED':_0x150a('0x1'),'E_AGI_ARGUMENT_PORT':_0x150a('0x2'),'E_AGI_SERVER_ERROR':_0x150a('0x3'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x150a('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x150a('0x5'),'E_AGI_SOCKET_ERROR':_0x150a('0x6'),'E_AGI_SOCKET_CLOSE':_0x150a('0x7'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0x150a('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x150a('0x9')};function AGIError(_0x45ecf8){var _0x45ecf8=_0x45ecf8||null,_0x411b76=_0x411b76||[],_0x7ec2e0=0x1,_0x57e9b5='';if(!error[_0x45ecf8]){_0x45ecf8=_0x150a('0xa');}_0x411b76[_0x150a('0xb')](error[_0x45ecf8]);while(arguments[_0x7ec2e0]){_0x411b76['push'](arguments[_0x7ec2e0]);_0x7ec2e0++;}_0x57e9b5=util[_0x150a('0xc')]['apply'](util,_0x411b76);this[_0x150a('0xd')]=_0x57e9b5;this['name']=_0x45ecf8;}module['exports']=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index cd223c8..c6d5d54 100644 --- a/server/services/agi/events.js +++ b/server/services/agi/events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b9a=['subscribe','agi','emit','error','E_AGI_SERVER_ERROR','parse','projectUpdate','exports','lodash','events','EventEmitter','ioredis','./error','defaults'];(function(_0x41059a,_0x4df43f){var _0x574108=function(_0x41880a){while(--_0x41880a){_0x41059a['push'](_0x41059a['shift']());}};_0x574108(++_0x4df43f);}(_0x0b9a,0x104));var _0xa0b9=function(_0x4fd75d,_0x167b74){_0x4fd75d=_0x4fd75d-0x0;var _0x575327=_0x0b9a[_0x4fd75d];return _0x575327;};'use strict';var _=require(_0xa0b9('0x0'));var EventEmitter=require(_0xa0b9('0x1'))[_0xa0b9('0x2')];var Redis=require(_0xa0b9('0x3'));var AGIError=require(_0xa0b9('0x4'));var config=require('../../config/environment');config['redis']=_[_0xa0b9('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config['redis']);sub[_0xa0b9('0x6')](_0xa0b9('0x7'),function(_0x2f6f24){if(_0x2f6f24)return eventEmitter[_0xa0b9('0x8')](_0xa0b9('0x9'),new AGIError(_0xa0b9('0xa'),_0x2f6f24));});sub['on']('message',function(_0x5e3222,_0x56305e){if(_0x5e3222!=='agi')return;try{var _0x523ab2=JSON[_0xa0b9('0xb')](_0x56305e);eventEmitter['emit'](_0xa0b9('0xc'),_0x523ab2);}catch(_0x274ff9){eventEmitter[_0xa0b9('0x8')]('error',new AGIError(_0xa0b9('0xa'),_0x274ff9));}});module[_0xa0b9('0xd')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0x3d9c=['error','E_AGI_SERVER_ERROR','agi','parse','projectUpdate','exports','lodash','EventEmitter','redis','defaults','localhost','subscribe','emit'];(function(_0x3a3758,_0x4dd8cf){var _0x1a9234=function(_0x3dda22){while(--_0x3dda22){_0x3a3758['push'](_0x3a3758['shift']());}};_0x1a9234(++_0x4dd8cf);}(_0x3d9c,0x7b));var _0xc3d9=function(_0x5c7fff,_0x4a16de){_0x5c7fff=_0x5c7fff-0x0;var _0x5db709=_0x3d9c[_0x5c7fff];return _0x5db709;};'use strict';var _=require(_0xc3d9('0x0'));var EventEmitter=require('events')[_0xc3d9('0x1')];var Redis=require('ioredis');var AGIError=require('./error');var config=require('../../config/environment');config[_0xc3d9('0x2')]=_[_0xc3d9('0x3')](config[_0xc3d9('0x2')],{'host':_0xc3d9('0x4'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xc3d9('0x2')]);sub[_0xc3d9('0x5')]('agi',function(_0x366ced){if(_0x366ced)return eventEmitter[_0xc3d9('0x6')](_0xc3d9('0x7'),new AGIError(_0xc3d9('0x8'),_0x366ced));});sub['on']('message',function(_0x2967e4,_0x518131){if(_0x2967e4!==_0xc3d9('0x9'))return;try{var _0x3811c9=JSON[_0xc3d9('0xa')](_0x518131);eventEmitter[_0xc3d9('0x6')](_0xc3d9('0xb'),_0x3811c9);}catch(_0x27443f){eventEmitter[_0xc3d9('0x6')](_0xc3d9('0x7'),new AGIError(_0xc3d9('0x8'),_0x27443f));}});module[_0xc3d9('0xc')]={'EventEmitter':eventEmitter}; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index d8cc9b6..c723fd0 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 _0xadea=['default','invalid','vswitch','traverseBFS','max\x20retry\x20reach','condition\x20not\x20found','exports','../../../config/logger','agi','menu','getdigits','getsecretdigits','numberOfEdges','prototype','addVertex','vertices','edges','addEdge','push','size','relations','getVertex','no\x20vertex\x20found','info','stop\x20traverse','length','split','agicommand','target'];(function(_0x21033c,_0x497a20){var _0x256656=function(_0x4e3e18){while(--_0x4e3e18){_0x21033c['push'](_0x21033c['shift']());}};_0x256656(++_0x497a20);}(_0xadea,0x163));var _0xaade=function(_0x4a7843,_0x24f6d1){_0x4a7843=_0x4a7843-0x0;var _0x2c57fe=_0xadea[_0x4a7843];return _0x2c57fe;};'use strict';var _=require('lodash');var logger=require(_0xaade('0x0'))(_0xaade('0x1'));var verticesWithRetry=[_0xaade('0x2'),_0xaade('0x3'),_0xaade('0x4')];var Graph=function(){this['vertices']={};this['edges']={};this[_0xaade('0x5')]=0x0;};Graph[_0xaade('0x6')][_0xaade('0x7')]=function(_0x2b5071){this[_0xaade('0x8')][_0x2b5071['id']]=_0x2b5071;this[_0xaade('0x9')][_0x2b5071['id']]=[];};Graph[_0xaade('0x6')][_0xaade('0xa')]=function(_0x4cf9c9,_0x56244d,_0x3c47ee){this['edges'][_0x4cf9c9][_0xaade('0xb')]({'target':_0x56244d,'condition':_0x3c47ee});this[_0xaade('0x5')]+=0x1;};Graph[_0xaade('0x6')][_0xaade('0xc')]=function(){return _['size'](this['vertices']);};Graph[_0xaade('0x6')][_0xaade('0xd')]=function(){return this[_0xaade('0x5')];};Graph['prototype'][_0xaade('0xe')]=function(_0x473c9b){return this[_0xaade('0x8')][_0x473c9b];};Graph[_0xaade('0x6')]['traverseBFS']=function(_0x1d4415,_0x2a38de){if(!this[_0xaade('0x8')][_0x1d4415]){return logger['info'](_0xaade('0xf'));}var _0xb264d7=_0x2a38de(this['vertices'][_0x1d4415]);if(!_0xb264d7){return logger[_0xaade('0x10')](_0xaade('0x11'));}if(this['edges'][_0x1d4415][_0xaade('0x12')]===0x0){return logger[_0xaade('0x10')]('no\x20edge/s\x20available');}for(var _0x106cac=0x0,_0x101ebc=[],_0x3a33b9=![];_0x106cac\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','then','catch','hasOwnProperty','indexOf','agi_','substring','debug','stringify','timeout','hangup','production','handleUnpublished','initialize','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','finally'];(function(_0x4aff79,_0x3d75b3){var _0x1c22b6=function(_0x23823d){while(--_0x23823d){_0x4aff79['push'](_0x4aff79['shift']());}};_0x1c22b6(++_0x3d75b3);}(_0x05ba,0xa5));var _0xa05b=function(_0x2125f0,_0x2f23b9){_0x2125f0=_0x2125f0-0x0;var _0x12d6eb=_0x05ba[_0x2125f0];return _0x12d6eb;};'use strict';var _=require('lodash');var syncho=require('syncho');var util=require(_0xa05b('0x0'));var config=require(_0xa05b('0x1'));var logger=require(_0xa05b('0x2'))(_0xa05b('0x3'));var utilLicense=require('../../config/license/util');var rpc=require(_0xa05b('0x4'));var Project=require('./project');var AGIEmitter=require(_0xa05b('0x5'))[_0xa05b('0x6')];var projects=[];config[_0xa05b('0x3')]=_[_0xa05b('0x7')](config[_0xa05b('0x3')],{'ip':_0xa05b('0x8'),'port':0x11dd});AGIEmitter['on'](_0xa05b('0x9'),projectUpdateHandler);function connectionHandler(_0x358167){process[_0xa05b('0xa')](function(){syncho(function(){try{setChannelVariables(_0x358167);agiHandler(_0x358167);}catch(_0x2e91a7){logger[_0xa05b('0xb')](_0x2e91a7[_0xa05b('0xc')]);}});});}function projectUpdateHandler(_0x2c42d5){try{var _0x3bdd51=_[_0xa05b('0xd')](projects,['id',_0x2c42d5['id']]);if(_0x3bdd51>-0x1){if(_0x2c42d5['deleted']===!![]){projects[_0xa05b('0xe')](_0x3bdd51,0x1);}else{projects[_0x3bdd51]=_0x2c42d5;}}else{projects[_0xa05b('0xf')](_0x2c42d5);}}catch(_0xf9843){logger[_0xa05b('0xb')](_0xf9843[_0xa05b('0xc')]);}}function listeningHandler(){console['log'](_0xa05b('0x10'),config['agi'][_0xa05b('0x11')]);logger[_0xa05b('0x12')](util['format']('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0xa05b('0x3')]['ip'],config[_0xa05b('0x3')]['port']));}function errorHandler(_0x51773c){if(_0x51773c&&_0x51773c[_0xa05b('0x13')]&&_0x51773c['message']){logger['error'](util[_0xa05b('0x14')](_0xa05b('0x15'),_0x51773c['name'],_0x51773c['message']));}else{logger[_0xa05b('0xb')](util[_0xa05b('0x14')]('[ERROR]\x20%s',_0x51773c[_0xa05b('0xc')]));}}function closeHandler(){logger[_0xa05b('0x12')](util[_0xa05b('0x14')](_0xa05b('0x16'),this[_0xa05b('0x17')],this[_0xa05b('0x18')],this[_0xa05b('0x19')],this[_0xa05b('0x1a')],this[_0xa05b('0x1b')]));try{createSquareReport(this);}catch(_0x2c459d){logger[_0xa05b('0xb')](_0x2c459d[_0xa05b('0xc')]);}}function timeoutHandler(){logger[_0xa05b('0x12')](util[_0xa05b('0x14')](_0xa05b('0x1c'),this[_0xa05b('0x17')],this['calleridname'],this[_0xa05b('0x19')],this[_0xa05b('0x1a')],this[_0xa05b('0x1b')]));}function hangupHandler(){logger[_0xa05b('0x12')](util['format']('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xa05b('0x17')],this['calleridname'],this[_0xa05b('0x19')],this['dnid'],this[_0xa05b('0x1b')]));this[_0xa05b('0x1d')]=!![];}function createSquareReport(_0x47ecee,_0xbab1b0){rpc['createSquareReport'](_0x47ecee)[_0xa05b('0x1e')](function(_0x1f353a){if(_0xbab1b0){_0xbab1b0(null,_0x1f353a);}})[_0xa05b('0x1f')](function(_0x1f6830){if(_0xbab1b0){_0xbab1b0(null,_0x1f6830);}});}function setChannelVariables(_0x1203a1){for(var _0x1cdb80 in _0x1203a1){if(_0x1203a1[_0xa05b('0x20')](_0x1cdb80)){if(_0x1cdb80[_0xa05b('0x21')](_0xa05b('0x22'))===0x0){_0x1203a1[_0x1cdb80[_0xa05b('0x23')](0x4)]=_0x1203a1[_0x1cdb80];delete _0x1203a1[_0x1cdb80];}}}}function agiHandler(_0x34d8ab){logger[_0xa05b('0x24')]('variables',JSON[_0xa05b('0x25')](_0x34d8ab,null,0x2));logger[_0xa05b('0x12')](util[_0xa05b('0x14')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x34d8ab['arg_1'],_0x34d8ab['calleridname'],_0x34d8ab[_0xa05b('0x19')],_0x34d8ab[_0xa05b('0x1a')],_0x34d8ab[_0xa05b('0x1b')]));_0x34d8ab['on']('error',errorHandler);_0x34d8ab['on']('close',closeHandler);_0x34d8ab['on'](_0xa05b('0x26'),timeoutHandler);_0x34d8ab['evtHangup']=![];_0x34d8ab['on'](_0xa05b('0x27'),hangupHandler);var _0x4ed63c=_['find'](projects,[_0xa05b('0x13'),_0x34d8ab[_0xa05b('0x17')]]);if(!_0x4ed63c)return Project['handleNotFound'](_0x34d8ab);if(!_0x4ed63c[_0xa05b('0x28')])return Project[_0xa05b('0x29')](_0x34d8ab);return Project[_0xa05b('0x2a')](_0x4ed63c,_0x34d8ab);}function main(){var _0x3c2ada;return utilLicense[_0xa05b('0x2b')]()[_0xa05b('0x1e')](function(_0x24ca17){if(!_0x24ca17)return;if(_0x24ca17[_0xa05b('0x2c')]){if(_0x24ca17[_0xa05b('0x2d')]&&_0x24ca17[_0xa05b('0x2d')]>0x0){logger[_0xa05b('0x12')](util['format'](_0xa05b('0x2e'),_0x24ca17['callysquare']));_0x3c2ada=_0x24ca17[_0xa05b('0x2d')];}else{logger[_0xa05b('0x12')](_0xa05b('0x2f'));}}else{logger[_0xa05b('0x12')](_0xa05b('0x30'));_0x3c2ada=-0x1;}})[_0xa05b('0x1e')](function(){return Project[_0xa05b('0x31')]();})[_0xa05b('0x1e')](function(_0x1d06d9){projects=_0x1d06d9;return;})[_0xa05b('0x1f')](function(_0x3c2576){logger[_0xa05b('0xb')]('[LICENSE]',_0x3c2576[_0xa05b('0xc')]);})[_0xa05b('0x32')](function(){var _0x193377=require(_0xa05b('0x33'))(config[_0xa05b('0x3')][_0xa05b('0x11')],config[_0xa05b('0x3')]['ip'],_0x3c2ada);_0x193377['on'](_0xa05b('0xb'),errorHandler);_0x193377['on'](_0xa05b('0x34'),listeningHandler);_0x193377['on'](_0xa05b('0x35'),connectionHandler);_0x193377['on']('close',closeHandler);});}main(); \ No newline at end of file +var _0x234e=['finally','listening','connection','close','util','agi','../../config/license/util','./rpc','./project','./events','EventEmitter','defaults','127.0.0.1','projectUpdate','nextTick','error','stack','findIndex','deleted','splice','push','log','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','port','message','[%s]\x20%s','name','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','dnid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','then','indexOf','substring','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','timeout','handleNotFound','production','initialize','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','catch','[LICENSE]'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x234e,0x76));var _0xe234=function(_0x5d0ba7,_0x1790c0){_0x5d0ba7=_0x5d0ba7-0x0;var _0x3548e7=_0x234e[_0x5d0ba7];return _0x3548e7;};'use strict';var _=require('lodash');var syncho=require('syncho');var util=require(_0xe234('0x0'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0xe234('0x1'));var utilLicense=require(_0xe234('0x2'));var rpc=require(_0xe234('0x3'));var Project=require(_0xe234('0x4'));var AGIEmitter=require(_0xe234('0x5'))[_0xe234('0x6')];var projects=[];config[_0xe234('0x1')]=_[_0xe234('0x7')](config[_0xe234('0x1')],{'ip':_0xe234('0x8'),'port':0x11dd});AGIEmitter['on'](_0xe234('0x9'),projectUpdateHandler);function connectionHandler(_0x4251d5){process[_0xe234('0xa')](function(){syncho(function(){try{setChannelVariables(_0x4251d5);agiHandler(_0x4251d5);}catch(_0x53dedc){logger[_0xe234('0xb')](_0x53dedc[_0xe234('0xc')]);}});});}function projectUpdateHandler(_0x1dfee8){try{var _0x1071df=_[_0xe234('0xd')](projects,['id',_0x1dfee8['id']]);if(_0x1071df>-0x1){if(_0x1dfee8[_0xe234('0xe')]===!![]){projects[_0xe234('0xf')](_0x1071df,0x1);}else{projects[_0x1071df]=_0x1dfee8;}}else{projects[_0xe234('0x10')](_0x1dfee8);}}catch(_0x192463){logger[_0xe234('0xb')](_0x192463[_0xe234('0xc')]);}}function listeningHandler(){console[_0xe234('0x11')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0xe234('0x1')]['port']);logger[_0xe234('0x12')](util[_0xe234('0x13')](_0xe234('0x14'),config[_0xe234('0x1')]['ip'],config['agi'][_0xe234('0x15')]));}function errorHandler(_0x53a472){if(_0x53a472&&_0x53a472['name']&&_0x53a472[_0xe234('0x16')]){logger[_0xe234('0xb')](util['format'](_0xe234('0x17'),_0x53a472[_0xe234('0x18')],_0x53a472['message']));}else{logger['error'](util[_0xe234('0x13')](_0xe234('0x19'),_0x53a472[_0xe234('0xc')]));}}function closeHandler(){logger[_0xe234('0x12')](util[_0xe234('0x13')](_0xe234('0x1a'),this[_0xe234('0x1b')],this[_0xe234('0x1c')],this['callerid'],this[_0xe234('0x1d')],this['uniqueid']));try{createSquareReport(this);}catch(_0x36096d){logger[_0xe234('0xb')](_0x36096d[_0xe234('0xc')]);}}function timeoutHandler(){logger[_0xe234('0x12')](util[_0xe234('0x13')](_0xe234('0x1e'),this[_0xe234('0x1b')],this[_0xe234('0x1c')],this[_0xe234('0x1f')],this[_0xe234('0x1d')],this[_0xe234('0x20')]));}function hangupHandler(){logger[_0xe234('0x12')](util[_0xe234('0x13')](_0xe234('0x21'),this[_0xe234('0x1b')],this[_0xe234('0x1c')],this[_0xe234('0x1f')],this[_0xe234('0x1d')],this[_0xe234('0x20')]));this[_0xe234('0x22')]=!![];}function createSquareReport(_0x553cb4,_0x23b495){rpc[_0xe234('0x23')](_0x553cb4)[_0xe234('0x24')](function(_0x5d2961){if(_0x23b495){_0x23b495(null,_0x5d2961);}})['catch'](function(_0x6ef881){if(_0x23b495){_0x23b495(null,_0x6ef881);}});}function setChannelVariables(_0x317be5){for(var _0x22054e in _0x317be5){if(_0x317be5['hasOwnProperty'](_0x22054e)){if(_0x22054e[_0xe234('0x25')]('agi_')===0x0){_0x317be5[_0x22054e[_0xe234('0x26')](0x4)]=_0x317be5[_0x22054e];delete _0x317be5[_0x22054e];}}}}function agiHandler(_0x555778){logger[_0xe234('0x27')](_0xe234('0x28'),JSON[_0xe234('0x29')](_0x555778,null,0x2));logger[_0xe234('0x12')](util[_0xe234('0x13')](_0xe234('0x2a'),_0x555778[_0xe234('0x1b')],_0x555778['calleridname'],_0x555778['callerid'],_0x555778[_0xe234('0x1d')],_0x555778['uniqueid']));_0x555778['on'](_0xe234('0xb'),errorHandler);_0x555778['on']('close',closeHandler);_0x555778['on'](_0xe234('0x2b'),timeoutHandler);_0x555778[_0xe234('0x22')]=![];_0x555778['on']('hangup',hangupHandler);var _0x1f0409=_['find'](projects,[_0xe234('0x18'),_0x555778[_0xe234('0x1b')]]);if(!_0x1f0409)return Project[_0xe234('0x2c')](_0x555778);if(!_0x1f0409[_0xe234('0x2d')])return Project['handleUnpublished'](_0x555778);return Project[_0xe234('0x2e')](_0x1f0409,_0x555778);}function main(){var _0x27489f;return utilLicense['getLicense']()[_0xe234('0x24')](function(_0x1768d0){if(!_0x1768d0)return;if(_0x1768d0['voice']){if(_0x1768d0[_0xe234('0x2f')]&&_0x1768d0[_0xe234('0x2f')]>0x0){logger['info'](util[_0xe234('0x13')](_0xe234('0x30'),_0x1768d0[_0xe234('0x2f')]));_0x27489f=_0x1768d0[_0xe234('0x2f')];}else{logger[_0xe234('0x12')](_0xe234('0x31'));}}else{logger[_0xe234('0x12')](_0xe234('0x32'));_0x27489f=-0x1;}})['then'](function(){return Project['getAll']();})[_0xe234('0x24')](function(_0x4c67c8){projects=_0x4c67c8;return;})[_0xe234('0x33')](function(_0x29dee6){logger[_0xe234('0xb')](_0xe234('0x34'),_0x29dee6[_0xe234('0xc')]);})[_0xe234('0x35')](function(){var _0x2dd4f2=require('./server')(config[_0xe234('0x1')][_0xe234('0x15')],config[_0xe234('0x1')]['ip'],_0x27489f);_0x2dd4f2['on'](_0xe234('0xb'),errorHandler);_0x2dd4f2['on'](_0xe234('0x36'),listeningHandler);_0x2dd4f2['on'](_0xe234('0x37'),connectionHandler);_0x2dd4f2['on'](_0xe234('0x38'),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 594c3af..b24bb65 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 _0x8d8c=['error','message','result','catch','bluebird','jayson/promise','client','http','request','then'];(function(_0x120205,_0x2d5783){var _0x55a643=function(_0x5d047d){while(--_0x5d047d){_0x120205['push'](_0x120205['shift']());}};_0x55a643(++_0x2d5783);}(_0x8d8c,0x108));var _0xc8d8=function(_0x1d0d23,_0x43e210){_0x1d0d23=_0x1d0d23-0x0;var _0x2d295b=_0x8d8c[_0x1d0d23];return _0x2d295b;};'use strict';var BPromise=require(_0xc8d8('0x0'));var jayson=require(_0xc8d8('0x1'));var client=jayson[_0xc8d8('0x2')][_0xc8d8('0x3')]({'port':0x232b});function request(_0x466245,_0x3585c7){return new BPromise(function(_0x4817a8,_0x594f67){return client[_0xc8d8('0x4')](_0x466245,_0x3585c7)[_0xc8d8('0x5')](function(_0x3ada0d){if(_0x3ada0d[_0xc8d8('0x6')]){return _0x594f67(_0x3ada0d[_0xc8d8('0x6')][_0xc8d8('0x7')]);}else{return _0x4817a8(_0x3ada0d[_0xc8d8('0x8')]);}})[_0xc8d8('0x9')](function(_0xd4f393){return _0x594f67(_0xd4f393);});});}exports['sendMailMessage']=function(_0x9c81f9,_0x5650c5){return request('SendMail',{'account':_0x9c81f9,'message':_0x5650c5});}; \ No newline at end of file +var _0x3232=['error','message','result','sendMailMessage','SendMail','bluebird','jayson/promise','client','request','then'];(function(_0x45e667,_0x584cac){var _0x202af6=function(_0x157723){while(--_0x157723){_0x45e667['push'](_0x45e667['shift']());}};_0x202af6(++_0x584cac);}(_0x3232,0x7d));var _0x2323=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x3232[_0x4baae2];return _0x1a2285;};'use strict';var BPromise=require(_0x2323('0x0'));var jayson=require(_0x2323('0x1'));var client=jayson[_0x2323('0x2')]['http']({'port':0x232b});function request(_0x279c9e,_0x17179a){return new BPromise(function(_0x55474a,_0x1735c9){return client[_0x2323('0x3')](_0x279c9e,_0x17179a)[_0x2323('0x4')](function(_0x35a137){if(_0x35a137[_0x2323('0x5')]){return _0x1735c9(_0x35a137[_0x2323('0x5')][_0x2323('0x6')]);}else{return _0x55474a(_0x35a137[_0x2323('0x7')]);}})['catch'](function(_0x5762ff){return _0x1735c9(_0x5762ff);});});}exports[_0x2323('0x8')]=function(_0x277284,_0x518fa4){return request(_0x2323('0x9'),{'account':_0x277284,'message':_0x518fa4});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index 925e2b1..ac5929b 100644 --- a/server/services/agi/project.js +++ b/server/services/agi/project.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc36a=['toString','stack','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','agicommand\x20not\x20found','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','uniqueid','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','extension','continueAt','close','Project\x20%s\x20not\x20found','lodash','moment','xml2json','util','../../config/logger','agi','./graph','getSquareProjects','catch','error','agicommand','hasOwnProperty','retry','addVertex','mxCell','length','source','target','addEdge','value','inspect','production','start','root','stringify','joinAt','info','format','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','traverseBFS','clear','debug','vertex','gotoc\x20block\x20stop\x20traverse\x20BFS','context','priority','response','code','isUndefined','result'];(function(_0x1e9bf3,_0x4e14f5){var _0x4864c1=function(_0x546718){while(--_0x546718){_0x1e9bf3['push'](_0x1e9bf3['shift']());}};_0x4864c1(++_0x4e14f5);}(_0xc36a,0xee));var _0xac36=function(_0x17583f,_0x46de13){_0x17583f=_0x17583f-0x0;var _0x4c26ec=_0xc36a[_0x17583f];return _0x4c26ec;};'use strict';var _=require(_0xac36('0x0'));var moment=require(_0xac36('0x1'));var parser=require(_0xac36('0x2'));var util=require(_0xac36('0x3'));var logger=require(_0xac36('0x4'))(_0xac36('0x5'));var rpc=require('./rpc');var mailRpc=require('./mailRpc');var Graph=require(_0xac36('0x6'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0xac36('0x7')]()[_0xac36('0x8')](function(_0x585600){logger[_0xac36('0x9')]('Unable\x20to\x20download\x20CallySquare\x20projects',_0x585600['stack']);return[];});}function addVertex(_0xada3ee,_0x1d7a41,_0x20097c){_0x1d7a41[_0xac36('0xa')]=_0x20097c;if(_0x1d7a41[_0xac36('0xb')]('retry')){_0x1d7a41['maxRetry']=parseInt(_0x1d7a41[_0xac36('0xc')],0xa);}_0xada3ee[_0xac36('0xd')](_['omit'](_0x1d7a41,_0xac36('0xe')));}function initGraph(_0x5f96dc,_0x2dfd72){var _0x104605=new Graph();for(var _0x18ad9f in _0x5f96dc){if(_0x5f96dc['hasOwnProperty'](_0x18ad9f)){if(_['isArray'](_0x5f96dc[_0x18ad9f])){for(var _0x4c2a90=0x0;_0x4c2a90<_0x5f96dc[_0x18ad9f]['length'];_0x4c2a90+=0x1){addVertex(_0x104605,_0x5f96dc[_0x18ad9f][_0x4c2a90],_0x18ad9f);}}else{addVertex(_0x104605,_0x5f96dc[_0x18ad9f],_0x18ad9f);}}}for(var _0x2b4839=0x0;_0x2b4839<_0x2dfd72[_0xac36('0xf')];_0x2b4839+=0x1){if(_0x2dfd72[_0x2b4839][_0xac36('0x10')]&&_0x2dfd72[_0x2b4839][_0xac36('0x11')]){_0x104605[_0xac36('0x12')](_0x2dfd72[_0x2b4839][_0xac36('0x10')],_0x2dfd72[_0x2b4839][_0xac36('0x11')],_0x2dfd72[_0x2b4839][_0xac36('0x13')]);}}return _0x104605;}function getRoot(_0x208246){return parser['toJson'](_0x208246,{'object':!![]})['mxGraphModel']['root'];}function inspect(_0x4151c6){return util[_0xac36('0x14')](_0x4151c6,{'showHidden':![],'depth':null});}function initialize(_0x5be900,_0x24f5f1){var _0x221ca0=getRoot(_0x5be900[_0xac36('0x15')]);if(!_0x221ca0||!_0x221ca0[_0xac36('0x16')])return;var _0x1acf28,_0x3188ac,_0x2e08b5;logger['debug'](_0xac36('0x17'),JSON[_0xac36('0x18')](_0x221ca0,null,0x2));_0x24f5f1[_0xac36('0x19')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x1acf28=initGraph(_['omit'](_0x221ca0,_0xac36('0xe')),_0x221ca0[_0xac36('0xe')]);_0x3188ac=new Vertices(_0x24f5f1,rpc,mailRpc);logger[_0xac36('0x1a')](util[_0xac36('0x1b')](_0xac36('0x1c'),_0x24f5f1[_0xac36('0x1d')],_0x24f5f1[_0xac36('0x1e')],_0x24f5f1['callerid'],_0x24f5f1['dnid'],_0x24f5f1['uniqueid']));_0x1acf28[_0xac36('0x1f')](_0x221ca0[_0xac36('0x16')]['id'],function(_0xf171fe){try{_0xf171fe=_0x3188ac[_0xac36('0x20')](_0xf171fe);logger[_0xac36('0x21')](_0xac36('0x22'),JSON[_0xac36('0x18')](_0xf171fe,null,0x2));if(_0xf171fe[_0xac36('0xa')]==='gotoc'){logger[_0xac36('0x1a')](_0xac36('0x23'));_0x24f5f1[_0xac36('0x24')]=_0xf171fe[_0xac36('0x24')]||_0x24f5f1[_0xac36('0x24')];_0x24f5f1['extension']=_0xf171fe['extension'];_0x24f5f1[_0xac36('0x25')]=_0xf171fe[_0xac36('0x25')]?_0xf171fe[_0xac36('0x25')]-0x1:0x1;return null;}else if(_0xf171fe&&_0x3188ac[_0xf171fe[_0xac36('0xa')]]){_0x2e08b5=_0x3188ac[_0xf171fe[_0xac36('0xa')]](_0xf171fe);logger[_0xac36('0x1a')](_0xac36('0x26'),JSON[_0xac36('0x18')](_0x2e08b5,null,0x2));if(_0x2e08b5&&_0x2e08b5[_0xac36('0x27')]===AGI_CODE_SUCCESS&&_0x2e08b5['result']!==AGI_RESULT_ERROR&&!_0x24f5f1['evtHangup']){logger[_0xac36('0x21')](_0xac36('0x26'),inspect(_0x2e08b5));return _[_0xac36('0x28')](_0x2e08b5[_0xac36('0x29')])?null:_0x2e08b5[_0xac36('0x29')][_0xac36('0x2a')]();}else{logger[_0xac36('0x9')]('response',inspect(_0x2e08b5));return null;}}else{logger[_0xac36('0x9')]('agicommand\x20not\x20found');return null;}}catch(_0x13a326){logger[_0xac36('0x9')](_0x13a326[_0xac36('0x2b')]);return null;}});if(_0x221ca0[_0xac36('0x2c')]){logger[_0xac36('0x1a')](util[_0xac36('0x1b')](_0xac36('0x2d'),_0x24f5f1[_0xac36('0x1d')],_0x24f5f1[_0xac36('0x1e')],_0x24f5f1[_0xac36('0x2e')],_0x24f5f1['dnid'],_0x24f5f1['uniqueid']));_0x1acf28[_0xac36('0x1f')](_0x221ca0[_0xac36('0x2c')]['id'],function(_0x45a007){try{_0x45a007=_0x3188ac['clear'](_0x45a007);logger[_0xac36('0x21')](_0xac36('0x22'),JSON['stringify'](_0x45a007,null,0x2));if(_0x45a007&&_0x3188ac[_0x45a007[_0xac36('0xa')]]){_0x2e08b5=_0x3188ac[_0x45a007[_0xac36('0xa')]](_0x45a007);if(_0x2e08b5){logger[_0xac36('0x21')]('response',inspect(_0x2e08b5));return _[_0xac36('0x28')](_0x2e08b5['result'])?null:_0x2e08b5[_0xac36('0x29')][_0xac36('0x2a')]();}else{logger[_0xac36('0x9')](_0xac36('0x26'),inspect(_0x2e08b5));return null;}}else{logger[_0xac36('0x9')](_0xac36('0x2f'));return null;}}catch(_0x5ede1f){logger[_0xac36('0x9')](_0x5ede1f[_0xac36('0x2b')]);return null;}});}logger[_0xac36('0x1a')](util[_0xac36('0x1b')](_0xac36('0x30'),_0x24f5f1[_0xac36('0x1d')],_0x24f5f1[_0xac36('0x1e')],_0x24f5f1['callerid'],_0x24f5f1[_0xac36('0x31')],_0x24f5f1[_0xac36('0x32')]));logger[_0xac36('0x1a')](util['format'](_0xac36('0x33'),_0x24f5f1[_0xac36('0x24')],_0x24f5f1[_0xac36('0x34')],parseInt(_0x24f5f1[_0xac36('0x25')],0xa)+0x1));_0x24f5f1[_0xac36('0x35')](_0x24f5f1['context'],_0x24f5f1[_0xac36('0x34')],parseInt(_0x24f5f1[_0xac36('0x25')],0xa)+0x1);_0x24f5f1[_0xac36('0x36')]();}function handleNotFound(_0x2777f7){logger[_0xac36('0x9')](util[_0xac36('0x1b')](_0xac36('0x37'),_0x2777f7['arg_1']));_0x2777f7['continueAt'](_0x2777f7[_0xac36('0x24')],_0x2777f7[_0xac36('0x34')],parseInt(_0x2777f7[_0xac36('0x25')],0xa)+0x1);_0x2777f7['close']();}function handleUnpublished(_0x136946){logger['error'](util[_0xac36('0x1b')]('Project\x20%s\x20not\x20published',_0x136946[_0xac36('0x1d')]));_0x136946[_0xac36('0x35')](_0x136946[_0xac36('0x24')],_0x136946[_0xac36('0x34')],parseInt(_0x136946[_0xac36('0x25')],0xa)+0x1);_0x136946[_0xac36('0x36')]();}module['exports']={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0x174c=['evtHangup','isUndefined','toString','agicommand\x20not\x20found','finally','format','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','stringify','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20published','exports','moment','xml2json','util','./rpc','./mailRpc','./graph','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','hasOwnProperty','retry','maxRetry','addVertex','mxCell','isArray','length','source','target','addEdge','toJson','inspect','production','start','debug','root','joinAt','YYYY-MM-DD\x20HH:mm:ss','omit','arg_1','calleridname','callerid','dnid','clear','vertex','agicommand','gotoc','info','context','extension','priority','response','code','result'];(function(_0x11805c,_0x5bbf28){var _0x4140ab=function(_0x5d1d5a){while(--_0x5d1d5a){_0x11805c['push'](_0x11805c['shift']());}};_0x4140ab(++_0x5bbf28);}(_0x174c,0xff));var _0xc174=function(_0x5a51c1,_0x394c67){_0x5a51c1=_0x5a51c1-0x0;var _0x38f5fb=_0x174c[_0x5a51c1];return _0x38f5fb;};'use strict';var _=require('lodash');var moment=require(_0xc174('0x0'));var parser=require(_0xc174('0x1'));var util=require(_0xc174('0x2'));var logger=require('../../config/logger')('agi');var rpc=require(_0xc174('0x3'));var mailRpc=require(_0xc174('0x4'));var Graph=require(_0xc174('0x5'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0xc174('0x6')]()[_0xc174('0x7')](function(_0x18f9dc){logger[_0xc174('0x8')](_0xc174('0x9'),_0x18f9dc[_0xc174('0xa')]);return[];});}function addVertex(_0x5b9455,_0x1971f3,_0x56d2a7){_0x1971f3['agicommand']=_0x56d2a7;if(_0x1971f3[_0xc174('0xb')](_0xc174('0xc'))){_0x1971f3[_0xc174('0xd')]=parseInt(_0x1971f3[_0xc174('0xc')],0xa);}_0x5b9455[_0xc174('0xe')](_['omit'](_0x1971f3,_0xc174('0xf')));}function initGraph(_0x20f527,_0x204643){var _0x4a1db2=new Graph();for(var _0x34698f in _0x20f527){if(_0x20f527[_0xc174('0xb')](_0x34698f)){if(_[_0xc174('0x10')](_0x20f527[_0x34698f])){for(var _0x5512e0=0x0;_0x5512e0<_0x20f527[_0x34698f][_0xc174('0x11')];_0x5512e0+=0x1){addVertex(_0x4a1db2,_0x20f527[_0x34698f][_0x5512e0],_0x34698f);}}else{addVertex(_0x4a1db2,_0x20f527[_0x34698f],_0x34698f);}}}for(var _0x257097=0x0;_0x257097<_0x204643[_0xc174('0x11')];_0x257097+=0x1){if(_0x204643[_0x257097][_0xc174('0x12')]&&_0x204643[_0x257097][_0xc174('0x13')]){_0x4a1db2[_0xc174('0x14')](_0x204643[_0x257097][_0xc174('0x12')],_0x204643[_0x257097][_0xc174('0x13')],_0x204643[_0x257097]['value']);}}return _0x4a1db2;}function getRoot(_0x50ea32){return parser[_0xc174('0x15')](_0x50ea32,{'object':!![]})['mxGraphModel']['root'];}function inspect(_0x2f2dee){return util[_0xc174('0x16')](_0x2f2dee,{'showHidden':![],'depth':null});}function initialize(_0x4753a7,_0x14a2b2){var _0x55b763=getRoot(_0x4753a7[_0xc174('0x17')]);if(!_0x55b763||!_0x55b763[_0xc174('0x18')])return;var _0x330dda,_0x39dcc8,_0x4a59ee;logger[_0xc174('0x19')](_0xc174('0x1a'),JSON['stringify'](_0x55b763,null,0x2));_0x14a2b2[_0xc174('0x1b')]=moment()['format'](_0xc174('0x1c'));_0x330dda=initGraph(_[_0xc174('0x1d')](_0x55b763,_0xc174('0xf')),_0x55b763['mxCell']);_0x39dcc8=new Vertices(_0x14a2b2,rpc,mailRpc);logger['info'](util['format']('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x14a2b2[_0xc174('0x1e')],_0x14a2b2[_0xc174('0x1f')],_0x14a2b2[_0xc174('0x20')],_0x14a2b2[_0xc174('0x21')],_0x14a2b2['uniqueid']));_0x330dda['traverseBFS'](_0x55b763['start']['id'],function(_0x1f0a6e){try{_0x1f0a6e=_0x39dcc8[_0xc174('0x22')](_0x1f0a6e);logger[_0xc174('0x19')](_0xc174('0x23'),JSON['stringify'](_0x1f0a6e,null,0x2));if(_0x1f0a6e[_0xc174('0x24')]===_0xc174('0x25')){logger[_0xc174('0x26')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x14a2b2['context']=_0x1f0a6e[_0xc174('0x27')]||_0x14a2b2[_0xc174('0x27')];_0x14a2b2[_0xc174('0x28')]=_0x1f0a6e[_0xc174('0x28')];_0x14a2b2[_0xc174('0x29')]=_0x1f0a6e[_0xc174('0x29')]?_0x1f0a6e[_0xc174('0x29')]-0x1:0x1;return null;}else if(_0x1f0a6e&&_0x39dcc8[_0x1f0a6e[_0xc174('0x24')]]){_0x4a59ee=_0x39dcc8[_0x1f0a6e['agicommand']](_0x1f0a6e);logger['info'](_0xc174('0x2a'),JSON['stringify'](_0x4a59ee,null,0x2));if(_0x4a59ee&&_0x4a59ee[_0xc174('0x2b')]===AGI_CODE_SUCCESS&&_0x4a59ee[_0xc174('0x2c')]!==AGI_RESULT_ERROR&&!_0x14a2b2[_0xc174('0x2d')]){logger[_0xc174('0x19')](_0xc174('0x2a'),inspect(_0x4a59ee));return _[_0xc174('0x2e')](_0x4a59ee[_0xc174('0x2c')])?null:_0x4a59ee[_0xc174('0x2c')][_0xc174('0x2f')]();}else{logger[_0xc174('0x8')]('response',inspect(_0x4a59ee));return null;}}else{logger['error'](_0xc174('0x30'));return null;}}catch(_0x4b20a3){logger['error'](_0x4b20a3[_0xc174('0xa')]);return null;}});if(_0x55b763[_0xc174('0x31')]){logger[_0xc174('0x26')](util[_0xc174('0x32')](_0xc174('0x33'),_0x14a2b2[_0xc174('0x1e')],_0x14a2b2[_0xc174('0x1f')],_0x14a2b2['callerid'],_0x14a2b2[_0xc174('0x21')],_0x14a2b2[_0xc174('0x34')]));_0x330dda['traverseBFS'](_0x55b763['finally']['id'],function(_0x5a1ecd){try{_0x5a1ecd=_0x39dcc8['clear'](_0x5a1ecd);logger[_0xc174('0x19')](_0xc174('0x23'),JSON[_0xc174('0x35')](_0x5a1ecd,null,0x2));if(_0x5a1ecd&&_0x39dcc8[_0x5a1ecd['agicommand']]){_0x4a59ee=_0x39dcc8[_0x5a1ecd[_0xc174('0x24')]](_0x5a1ecd);if(_0x4a59ee){logger[_0xc174('0x19')](_0xc174('0x2a'),inspect(_0x4a59ee));return _['isUndefined'](_0x4a59ee[_0xc174('0x2c')])?null:_0x4a59ee[_0xc174('0x2c')][_0xc174('0x2f')]();}else{logger[_0xc174('0x8')]('response',inspect(_0x4a59ee));return null;}}else{logger['error'](_0xc174('0x30'));return null;}}catch(_0xc7612b){logger['error'](_0xc7612b[_0xc174('0xa')]);return null;}});}logger[_0xc174('0x26')](util['format'](_0xc174('0x36'),_0x14a2b2['arg_1'],_0x14a2b2['calleridname'],_0x14a2b2[_0xc174('0x20')],_0x14a2b2[_0xc174('0x21')],_0x14a2b2[_0xc174('0x34')]));logger[_0xc174('0x26')](util[_0xc174('0x32')](_0xc174('0x37'),_0x14a2b2['context'],_0x14a2b2['extension'],parseInt(_0x14a2b2[_0xc174('0x29')],0xa)+0x1));_0x14a2b2['continueAt'](_0x14a2b2[_0xc174('0x27')],_0x14a2b2[_0xc174('0x28')],parseInt(_0x14a2b2['priority'],0xa)+0x1);_0x14a2b2['close']();}function handleNotFound(_0x5b240e){logger[_0xc174('0x8')](util[_0xc174('0x32')]('Project\x20%s\x20not\x20found',_0x5b240e['arg_1']));_0x5b240e[_0xc174('0x38')](_0x5b240e['context'],_0x5b240e['extension'],parseInt(_0x5b240e['priority'],0xa)+0x1);_0x5b240e[_0xc174('0x39')]();}function handleUnpublished(_0x4b962a){logger[_0xc174('0x8')](util['format'](_0xc174('0x3a'),_0x4b962a[_0xc174('0x1e')]));_0x4b962a[_0xc174('0x38')](_0x4b962a['context'],_0x4b962a[_0xc174('0x28')],parseInt(_0x4b962a[_0xc174('0x29')],0xa)+0x1);_0x4b962a['close']();}module[_0xc174('0x3b')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 181cb88..3b4ecbb 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 _0x1771=['exports','util','stream','Transform','_localBuffer','_inBody','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','split','slice','trim','emit','headers','line'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1771,0x166));var _0x1177=function(_0x22af5d,_0x4d0214){_0x22af5d=_0x22af5d-0x0;var _0x45891b=_0x1771[_0x22af5d];return _0x45891b;};'use strict';var util=require(_0x1177('0x0'));var Transform=require(_0x1177('0x1'))[_0x1177('0x2')];function AGIReply(_0x2fa134){Transform['call'](this,_0x2fa134);this[_0x1177('0x3')]='';this[_0x1177('0x4')]=![];}util['inherits'](AGIReply,Transform);AGIReply['prototype']['_transform']=function(_0x34b034,_0x295db2,_0x5629fe){var _0x16f20a='\x0a',_0x5d32c1=['\x0a\x0a',_0x1177('0x5')],_0x3113ce=-0x1,_0x3b350c=-0x1,_0x5a5e7f='',_0x215df7=0x0,_0x1acb03='',_0x2312c5='';this[_0x1177('0x3')]+=_0x34b034[_0x1177('0x6')]();_0x1acb03=this[_0x1177('0x3')];if(!this[_0x1177('0x4')]){_0x215df7=0x0;while(_0x5d32c1[_0x215df7]){while((_0x3b350c=_0x1acb03[_0x1177('0x7')](_0x5d32c1[_0x215df7]))!=-0x1){_0x5a5e7f=_0x5d32c1[_0x215df7];_0x2312c5=_0x1acb03[_0x1177('0x8')](0x0,_0x3b350c);_0x1acb03=_0x1acb03[_0x1177('0x8')](_0x3b350c+_0x5a5e7f[_0x1177('0x9')]);var _0x19fa6d=_0x2312c5[_0x1177('0xa')](_0x16f20a),_0x407371=0x0,_0x30ff92={},_0xac5ca7='',_0x2c5fc5='',_0x3fc090=-0x1;while(_0x19fa6d[_0x407371]){_0x3fc090=_0x19fa6d[_0x407371][_0x1177('0x7')](':');if(_0x3fc090!=-0x1){_0xac5ca7=_0x19fa6d[_0x407371]['slice'](0x0,_0x3fc090)['trim']();_0x2c5fc5=_0x19fa6d[_0x407371][_0x1177('0xb')](_0x3fc090+0x1)[_0x1177('0xc')]();if(_0xac5ca7[_0x1177('0x9')]>0x0){_0x30ff92[_0xac5ca7]=_0x2c5fc5;}}else{}_0x407371++;}this[_0x1177('0xd')](_0x1177('0xe'),_0x30ff92);this[_0x1177('0x4')]=!![];}_0x215df7++;}this[_0x1177('0x3')]=_0x1acb03;}else{while((_0x3113ce=_0x1acb03[_0x1177('0x7')](_0x16f20a))!=-0x1){_0x2312c5=_0x1acb03[_0x1177('0x8')](0x0,_0x3113ce);this[_0x1177('0xd')](_0x1177('0xf'),_0x2312c5);_0x1acb03=_0x1acb03[_0x1177('0x8')](_0x3113ce+_0x16f20a[_0x1177('0x9')]);}this[_0x1177('0x3')]=_0x1acb03;}_0x5629fe();};module[_0x1177('0x10')]=AGIReply; \ No newline at end of file +var _0x3176=['call','_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','indexOf','substring','split','trim','slice','length','emit','line','exports','util','stream','Transform'];(function(_0x118a4d,_0x1f8781){var _0x330686=function(_0x90a629){while(--_0x90a629){_0x118a4d['push'](_0x118a4d['shift']());}};_0x330686(++_0x1f8781);}(_0x3176,0x1d8));var _0x6317=function(_0x55403d,_0x2bf6fa){_0x55403d=_0x55403d-0x0;var _0x291e5a=_0x3176[_0x55403d];return _0x291e5a;};'use strict';var util=require(_0x6317('0x0'));var Transform=require(_0x6317('0x1'))[_0x6317('0x2')];function AGIReply(_0x131b0a){Transform[_0x6317('0x3')](this,_0x131b0a);this[_0x6317('0x4')]='';this[_0x6317('0x5')]=![];}util[_0x6317('0x6')](AGIReply,Transform);AGIReply[_0x6317('0x7')][_0x6317('0x8')]=function(_0x14cc52,_0x3540e8,_0x46f4c9){var _0x354521='\x0a',_0x1c95dc=['\x0a\x0a',_0x6317('0x9')],_0x2275a4=-0x1,_0x4afa7d=-0x1,_0x25c09c='',_0x2fa3c3=0x0,_0x416adc='',_0x540287='';this['_localBuffer']+=_0x14cc52['toString']();_0x416adc=this[_0x6317('0x4')];if(!this[_0x6317('0x5')]){_0x2fa3c3=0x0;while(_0x1c95dc[_0x2fa3c3]){while((_0x4afa7d=_0x416adc[_0x6317('0xa')](_0x1c95dc[_0x2fa3c3]))!=-0x1){_0x25c09c=_0x1c95dc[_0x2fa3c3];_0x540287=_0x416adc[_0x6317('0xb')](0x0,_0x4afa7d);_0x416adc=_0x416adc[_0x6317('0xb')](_0x4afa7d+_0x25c09c['length']);var _0x40a4a6=_0x540287[_0x6317('0xc')](_0x354521),_0x468be5=0x0,_0x4eaffc={},_0x359566='',_0x3f64fb='',_0x4aa69f=-0x1;while(_0x40a4a6[_0x468be5]){_0x4aa69f=_0x40a4a6[_0x468be5][_0x6317('0xa')](':');if(_0x4aa69f!=-0x1){_0x359566=_0x40a4a6[_0x468be5]['slice'](0x0,_0x4aa69f)[_0x6317('0xd')]();_0x3f64fb=_0x40a4a6[_0x468be5][_0x6317('0xe')](_0x4aa69f+0x1)[_0x6317('0xd')]();if(_0x359566[_0x6317('0xf')]>0x0){_0x4eaffc[_0x359566]=_0x3f64fb;}}else{}_0x468be5++;}this[_0x6317('0x10')]('headers',_0x4eaffc);this['_inBody']=!![];}_0x2fa3c3++;}this['_localBuffer']=_0x416adc;}else{while((_0x2275a4=_0x416adc[_0x6317('0xa')](_0x354521))!=-0x1){_0x540287=_0x416adc['substring'](0x0,_0x2275a4);this['emit'](_0x6317('0x11'),_0x540287);_0x416adc=_0x416adc['substring'](_0x2275a4+_0x354521['length']);}this[_0x6317('0x4')]=_0x416adc;}_0x46f4c9();};module[_0x6317('0x12')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 3889c05..fd48674 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 _0x32c0=['ShowTrunk','getSoundById','save_name','Intervals','ShowSmsAccount','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','then','CreateCmContact','getPauseById','agentPause','agentUnpause','agentLogout','LogoutUser','lodash','moment','client','http','request','error','message','catch','getSquareProjects','GetSquareProjects','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','ShowUser','getContactByPhone','GetContactByPhone','phone','getTrunkById'];(function(_0x1379e2,_0xbd5a13){var _0x45d7a4=function(_0x282b17){while(--_0x282b17){_0x1379e2['push'](_0x1379e2['shift']());}};_0x45d7a4(++_0xbd5a13);}(_0x32c0,0x1f3));var _0x032c=function(_0x4aaf8c,_0x52070a){_0x4aaf8c=_0x4aaf8c-0x0;var _0x198742=_0x32c0[_0x4aaf8c];return _0x198742;};'use strict';var _=require(_0x032c('0x0'));var moment=require(_0x032c('0x1'));var jayson=require('jayson/promise');var client=jayson[_0x032c('0x2')][_0x032c('0x3')]({'port':0x2329});function request(_0x4f5eb9,_0x254198){return new Promise(function(_0x2bc539,_0x283b77){return client[_0x032c('0x4')](_0x4f5eb9,_0x254198)['then'](function(_0x7eb53e){if(_0x7eb53e[_0x032c('0x5')]){return _0x283b77(_0x7eb53e[_0x032c('0x5')][_0x032c('0x6')]);}else{return _0x2bc539(_0x7eb53e['result']);}})[_0x032c('0x7')](function(_0x5d2a4c){return _0x283b77(_0x5d2a4c);});});}exports[_0x032c('0x8')]=function(){return request(_0x032c('0x9'),{'options':{'raw':![],'attributes':['id','name','production']}});};exports[_0x032c('0xa')]=function(_0x5be922){return request(_0x032c('0xb'),{'options':{'raw':![],'where':{'name':_0x5be922},'attributes':['production']}});};exports[_0x032c('0xc')]=function(_0x496317){return request(_0x032c('0xd'),{'options':{'raw':![],'where':{'id':_0x496317},'include':[{'model':_0x032c('0xe'),'as':_0x032c('0xf'),'include':[{'model':_0x032c('0x10'),'as':'CloudProvider'}]}],'attributes':['id',_0x032c('0x11'),_0x032c('0x12')],'smtp':!![]}});};exports[_0x032c('0x13')]=function(_0x40aea5){return request('ShowSquareProject',{'options':{'where':{'id':_0x40aea5},'attributes':[_0x032c('0x11')]}});};exports[_0x032c('0x14')]=function(_0x1ec9d8){return request(_0x032c('0x15'),{'options':{'where':{'id':_0x1ec9d8},'attributes':[_0x032c('0x11')]}});};exports[_0x032c('0x16')]=function(_0x51266f){return request(_0x032c('0x17'),{'options':{'where':{'id':_0x51266f},'attributes':[_0x032c('0x11')]}});};exports[_0x032c('0x18')]=function(_0x3f6f4d){return request(_0x032c('0x19'),{'options':{'where':{'id':_0x3f6f4d},'attributes':[_0x032c('0x1a')]}});};exports['getUserById']=function(_0x1444bb){return request(_0x032c('0x1b'),{'options':{'where':{'id':_0x1444bb},'attributes':[_0x032c('0x11')]}});};exports[_0x032c('0x1c')]=function(_0x2b2693){return request(_0x032c('0x1d'),{'options':{'where':{'phone':_0x2b2693[_0x032c('0x1e')]},'attributes':['id']}});};exports[_0x032c('0x1f')]=function(_0x3a6f71){return request(_0x032c('0x20'),{'options':{'where':{'id':_0x3a6f71},'attributes':[_0x032c('0x11')]}});};exports[_0x032c('0x21')]=function(_0x2b9189){return request('ShowSound',{'options':{'where':{'id':_0x2b9189},'attributes':[_0x032c('0x22')]}});};exports['getIntervalById']=function(_0x5341e6){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x5341e6},'include':[{'model':'Interval','as':_0x032c('0x23')}]}});};exports['getSmsAccountById']=function(_0x2ce758){return request(_0x032c('0x24'),{'options':{'where':{'id':_0x2ce758},'attributes':['id',_0x032c('0x11')]}});};exports['createSmsMessage']=function(_0x135612){return request(_0x032c('0x25'),{'body':_0x135612});};exports[_0x032c('0x26')]=function(_0x2e686d){return request(_0x032c('0x27'),{'body':_0x2e686d});};exports[_0x032c('0x28')]=function(_0xead856){return request('CreateSquareReport',{'body':_[_0x032c('0x29')](_0xead856,{'project_name':_0xead856[_0x032c('0x2a')],'prev_project_name':_0xead856[_0x032c('0x2b')]||'','is_subproject':_0xead856['arg_2']?!![]:![],'leaveAt':moment()[_0x032c('0x2c')](_0x032c('0x2d'))})});};exports[_0x032c('0x2e')]=function(_0x12e3df){return request('CreateSquareRecording',{'body':_0x12e3df});};exports[_0x032c('0x2f')]=function(_0x7150c8){return request(_0x032c('0x30'),{'body':_0x7150c8});};exports[_0x032c('0x31')]=function(_0x51d679){return request(_0x032c('0x32'),{'options':{'raw':![],'where':{'phone':_0x51d679[_0x032c('0x1e')],'ListId':_0x51d679[_0x032c('0x33')]}}})[_0x032c('0x34')](function(_0x306935){if(_0x306935){return _0x306935;}return request(_0x032c('0x35'),{'body':_0x51d679});});};exports[_0x032c('0x36')]=function(_0x5a2297){return request('ShowPause',{'options':{'where':{'id':_0x5a2297},'attributes':[_0x032c('0x11')]}});};exports['agentLogin']=function(_0x6f72ba,_0x3bb5e3){return request('LoginUser',{'body':{'interface':_0x3bb5e3},'options':{'where':_0x6f72ba}});};exports[_0x032c('0x37')]=function(_0x1e8993,_0x3488f1,_0x41a78c){return request('PauseUser',{'body':{'type':_0x3488f1,'uniqueid':_0x41a78c},'options':{'where':_0x1e8993}});};exports[_0x032c('0x38')]=function(_0x2b80b3){return request('UnpauseUser',{'body':{},'options':{'where':_0x2b80b3}});};exports[_0x032c('0x39')]=function(_0x45fcc1){return request(_0x032c('0x3a'),{'body':{},'options':{'where':_0x45fcc1}});}; \ No newline at end of file +var _0xe0c3=['getSquareProjects','GetSquareProjects','name','production','getSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','email','ShowSquareProject','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','ShowUser','getContactByPhone','GetContactByPhone','phone','ShowTrunk','getIntervalById','ShowInterval','Interval','createSmsMessage','CreateSmsMessage','CreateSquareDetailsReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','UnpauseUser','agentLogout','LogoutUser','lodash','jayson/promise','client','http','request','then','error','message','result','catch'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe0c3,0xea));var _0x3e0c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe0c3[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x3e0c('0x0'));var moment=require('moment');var jayson=require(_0x3e0c('0x1'));var client=jayson[_0x3e0c('0x2')][_0x3e0c('0x3')]({'port':0x2329});function request(_0x41c0bf,_0x27e01a){return new Promise(function(_0x410ec4,_0x31851c){return client[_0x3e0c('0x4')](_0x41c0bf,_0x27e01a)[_0x3e0c('0x5')](function(_0x511cfa){if(_0x511cfa['error']){return _0x31851c(_0x511cfa[_0x3e0c('0x6')][_0x3e0c('0x7')]);}else{return _0x410ec4(_0x511cfa[_0x3e0c('0x8')]);}})[_0x3e0c('0x9')](function(_0x29673d){return _0x31851c(_0x29673d);});});}exports[_0x3e0c('0xa')]=function(){return request(_0x3e0c('0xb'),{'options':{'raw':![],'attributes':['id',_0x3e0c('0xc'),_0x3e0c('0xd')]}});};exports[_0x3e0c('0xe')]=function(_0x9372d8){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x9372d8},'attributes':['production']}});};exports[_0x3e0c('0xf')]=function(_0x2a0b19){return request(_0x3e0c('0x10'),{'options':{'raw':![],'where':{'id':_0x2a0b19},'include':[{'model':_0x3e0c('0x11'),'as':_0x3e0c('0x12'),'include':[{'model':_0x3e0c('0x13'),'as':_0x3e0c('0x13')}]}],'attributes':['id','name',_0x3e0c('0x14')],'smtp':!![]}});};exports['getSquareProjectById']=function(_0x2589fc){return request(_0x3e0c('0x15'),{'options':{'where':{'id':_0x2589fc},'attributes':['name']}});};exports[_0x3e0c('0x16')]=function(_0x6d9c61){return request(_0x3e0c('0x17'),{'options':{'where':{'id':_0x6d9c61},'attributes':[_0x3e0c('0xc')]}});};exports[_0x3e0c('0x18')]=function(_0x15a269){return request(_0x3e0c('0x19'),{'options':{'where':{'id':_0x15a269},'attributes':[_0x3e0c('0xc')]}});};exports[_0x3e0c('0x1a')]=function(_0x42b1bd){return request(_0x3e0c('0x1b'),{'options':{'where':{'id':_0x42b1bd},'attributes':[_0x3e0c('0x1c')]}});};exports['getUserById']=function(_0x58c498){return request(_0x3e0c('0x1d'),{'options':{'where':{'id':_0x58c498},'attributes':[_0x3e0c('0xc')]}});};exports[_0x3e0c('0x1e')]=function(_0x41b19f){return request(_0x3e0c('0x1f'),{'options':{'where':{'phone':_0x41b19f[_0x3e0c('0x20')]},'attributes':['id']}});};exports['getTrunkById']=function(_0x2e4a4a){return request(_0x3e0c('0x21'),{'options':{'where':{'id':_0x2e4a4a},'attributes':[_0x3e0c('0xc')]}});};exports['getSoundById']=function(_0x60c48c){return request('ShowSound',{'options':{'where':{'id':_0x60c48c},'attributes':['save_name']}});};exports[_0x3e0c('0x22')]=function(_0x1f3bad){return request(_0x3e0c('0x23'),{'options':{'raw':![],'where':{'id':_0x1f3bad},'include':[{'model':_0x3e0c('0x24'),'as':'Intervals'}]}});};exports['getSmsAccountById']=function(_0x3320c6){return request('ShowSmsAccount',{'options':{'where':{'id':_0x3320c6},'attributes':['id','name']}});};exports[_0x3e0c('0x25')]=function(_0x1769b1){return request(_0x3e0c('0x26'),{'body':_0x1769b1});};exports['createSquareDetailsReport']=function(_0x4272ee){return request(_0x3e0c('0x27'),{'body':_0x4272ee});};exports['createSquareReport']=function(_0x7dba09){return request(_0x3e0c('0x28'),{'body':_[_0x3e0c('0x29')](_0x7dba09,{'project_name':_0x7dba09[_0x3e0c('0x2a')],'prev_project_name':_0x7dba09['arg_2']||'','is_subproject':_0x7dba09[_0x3e0c('0x2b')]?!![]:![],'leaveAt':moment()[_0x3e0c('0x2c')](_0x3e0c('0x2d'))})});};exports[_0x3e0c('0x2e')]=function(_0x4c4bc3){return request(_0x3e0c('0x2f'),{'body':_0x4c4bc3});};exports['createSquareMessage']=function(_0x50de5c){return request(_0x3e0c('0x30'),{'body':_0x50de5c});};exports[_0x3e0c('0x31')]=function(_0x4d3ce2){return request(_0x3e0c('0x32'),{'options':{'raw':![],'where':{'phone':_0x4d3ce2[_0x3e0c('0x20')],'ListId':_0x4d3ce2[_0x3e0c('0x33')]}}})['then'](function(_0x44ecad){if(_0x44ecad){return _0x44ecad;}return request(_0x3e0c('0x34'),{'body':_0x4d3ce2});});};exports['getPauseById']=function(_0x1de9d9){return request(_0x3e0c('0x35'),{'options':{'where':{'id':_0x1de9d9},'attributes':[_0x3e0c('0xc')]}});};exports[_0x3e0c('0x36')]=function(_0x51b0e5,_0x345566){return request(_0x3e0c('0x37'),{'body':{'interface':_0x345566},'options':{'where':_0x51b0e5}});};exports[_0x3e0c('0x38')]=function(_0x5c8061,_0x1dcfe2,_0x1832c5){return request(_0x3e0c('0x39'),{'body':{'type':_0x1dcfe2,'uniqueid':_0x1832c5},'options':{'where':_0x5c8061}});};exports['agentUnpause']=function(_0x206bb2){return request(_0x3e0c('0x3a'),{'body':{},'options':{'where':_0x206bb2}});};exports[_0x3e0c('0x3b')]=function(_0x119409){return request(_0x3e0c('0x3c'),{'body':{},'options':{'where':_0x119409}});}; \ 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 564ab0a..5b9a555 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 _0x5655=['./lex','exports','./polly'];(function(_0x1a3ca2,_0xe144e7){var _0x30ea08=function(_0x37a9f6){while(--_0x37a9f6){_0x1a3ca2['push'](_0x1a3ca2['shift']());}};_0x30ea08(++_0xe144e7);}(_0x5655,0x15e));var _0x5565=function(_0x26efdb,_0x4b20a1){_0x26efdb=_0x26efdb-0x0;var _0x113954=_0x5655[_0x26efdb];return _0x113954;};var polly=require(_0x5565('0x0'));var lex=require(_0x5565('0x1'));module[_0x5565('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x908e=['./polly','./lex'];(function(_0x16e0c8,_0x4861eb){var _0xe4b5af=function(_0x5248bc){while(--_0x5248bc){_0x16e0c8['push'](_0x16e0c8['shift']());}};_0xe4b5af(++_0x4861eb);}(_0x908e,0x182));var _0xe908=function(_0x322522,_0x4db288){_0x322522=_0x322522-0x0;var _0x293bcf=_0x908e[_0x322522];return _0x293bcf;};var polly=require(_0xe908('0x0'));var lex=require(_0xe908('0x1'));module['exports']={'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 35ec7e0..968ca26 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 _0x668b=['./lib/api','exports'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x668b,0x140));var _0xb668=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0x668b[_0x2cfb58];return _0xd99951;};'use strict';var lex=require(_0xb668('0x0'));module[_0xb668('0x1')]=function(_0x51555f,_0x15fbea,_0x2c30c1,_0x49a53b,_0x336ba4,_0x5e2e83){return lex(_0x51555f,_0x15fbea,_0x2c30c1,_0x49a53b,_0x336ba4,_0x5e2e83);}; \ No newline at end of file +var _0x9bde=['exports'];(function(_0x3c4bc1,_0x48e95d){var _0xe614b6=function(_0x9f1876){while(--_0x9f1876){_0x3c4bc1['push'](_0x3c4bc1['shift']());}};_0xe614b6(++_0x48e95d);}(_0x9bde,0xe1));var _0xe9bd=function(_0x50bf32,_0x318a99){_0x50bf32=_0x50bf32-0x0;var _0x2f6b10=_0x9bde[_0x50bf32];return _0x2f6b10;};'use strict';var lex=require('./lib/api');module[_0xe9bd('0x0')]=function(_0x4defda,_0xc79e0b,_0x4c63ca,_0x51786f,_0x3005aa,_0x131f6a){return lex(_0x4defda,_0xc79e0b,_0x4c63ca,_0x51786f,_0x3005aa,_0x131f6a);}; \ 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 890f0a3..072a2fa 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(_0x102b3f,_0x181948){var _0x1fb03b=function(_0x2680e0){while(--_0x2680e0){_0x102b3f['push'](_0x102b3f['shift']());}};_0x1fb03b(++_0x181948);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);}; \ No newline at end of file +var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0xa086c2,_0x21cc9c){var _0x2b8e68=function(_0x822d93){while(--_0x822d93){_0xa086c2['push'](_0xa086c2['shift']());}};_0x2b8e68(++_0x21cc9c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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 c8920d3..e06f561 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 _0x2c92=['exports','./lib/api'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0x2c92,0x87));var _0x22c9=function(_0x31b5b2,_0x5ab927){_0x31b5b2=_0x31b5b2-0x0;var _0x364f13=_0x2c92[_0x31b5b2];return _0x364f13;};'use strict';var polly=require(_0x22c9('0x0'));module[_0x22c9('0x1')]=function(_0x5e508f,_0x54d326,_0x4511c9,_0xa6a045,_0x394753,_0x5d78cf,_0x3f9031){return polly(_0x5e508f,_0x54d326,_0x4511c9,_0xa6a045,_0x394753,_0x5d78cf,_0x3f9031);}; \ No newline at end of file +var _0x2a3a=['exports'];(function(_0x5a44b7,_0x2170e9){var _0x33fefe=function(_0x17d856){while(--_0x17d856){_0x5a44b7['push'](_0x5a44b7['shift']());}};_0x33fefe(++_0x2170e9);}(_0x2a3a,0x6f));var _0xa2a3=function(_0x4b56cd,_0x500b69){_0x4b56cd=_0x4b56cd-0x0;var _0x5f4e10=_0x2a3a[_0x4b56cd];return _0x5f4e10;};'use strict';var polly=require('./lib/api');module[_0xa2a3('0x0')]=function(_0x5aa83b,_0x59a6dc,_0x124240,_0x1a3b91,_0x319150,_0x503c93,_0x5af94e){return polly(_0x5aa83b,_0x59a6dc,_0x124240,_0x1a3b91,_0x319150,_0x503c93,_0x5af94e);}; \ 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 1409b46..b3d3fbb 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 _0x0c78=['aws-sdk','synthesizeSpeech','writeFile','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','bluebird','randomstring'];(function(_0x42b30a,_0x124939){var _0x312bf2=function(_0xc4fb69){while(--_0xc4fb69){_0x42b30a['push'](_0x42b30a['shift']());}};_0x312bf2(++_0x124939);}(_0x0c78,0x1de));var _0x80c7=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x0c78[_0x13b8f3];return _0x1a6d06;};'use strict';var fs=require('fs');var path=require(_0x80c7('0x0'));var BPromise=require(_0x80c7('0x1'));var rs=require(_0x80c7('0x2'));var AWS=require(_0x80c7('0x3'));function pollyResult(_0x1c32ef,_0x40ffd2,_0x42f99b){return new BPromise(function(_0x53daa8,_0x3f6205){_0x1c32ef[_0x80c7('0x4')](_0x40ffd2,function(_0x33446a,_0x34383c){if(_0x33446a){_0x3f6205(_0x33446a);}else if(_0x34383c){if(_0x34383c['AudioStream']instanceof Buffer){fs[_0x80c7('0x5')](_0x42f99b,_0x34383c[_0x80c7('0x6')],function(_0x239e5b){if(_0x239e5b){_0x3f6205(_0x239e5b);}else{_0x53daa8();}});}else{_0x3f6205(new Error(_0x80c7('0x7')));}}else{_0x3f6205(new Error(_0x80c7('0x8')));}});});}module[_0x80c7('0x9')]=function(_0x3662ba,_0x50c29e,_0x4be39b,_0x1c31f8,_0x37870c,_0x26f102,_0x36494c){var _0x30e36f=new AWS[(_0x80c7('0xa'))]({'accessKeyId':_0x3662ba,'secretAccessKey':_0x50c29e,'region':_0x4be39b});var _0x6b1eb0={'Text':_0x37870c,'TextType':_0x26f102||_0x80c7('0xb'),'OutputFormat':_0x80c7('0xc'),'VoiceId':_0x1c31f8};return pollyResult(_0x30e36f,_0x6b1eb0,_0x36494c);}; \ No newline at end of file +var _0x5acb=['writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','path','bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream'];(function(_0x5c69e7,_0x5bd149){var _0x4286c6=function(_0x42931c){while(--_0x42931c){_0x5c69e7['push'](_0x5c69e7['shift']());}};_0x4286c6(++_0x5bd149);}(_0x5acb,0x1f4));var _0xb5ac=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5acb[_0x20a584];return _0x4b41a8;};'use strict';var fs=require('fs');var path=require(_0xb5ac('0x0'));var BPromise=require(_0xb5ac('0x1'));var rs=require(_0xb5ac('0x2'));var AWS=require(_0xb5ac('0x3'));function pollyResult(_0x3d31b5,_0x34ad12,_0x117fd9){return new BPromise(function(_0x5abfd3,_0x67f9e2){_0x3d31b5[_0xb5ac('0x4')](_0x34ad12,function(_0x17a419,_0x5aed70){if(_0x17a419){_0x67f9e2(_0x17a419);}else if(_0x5aed70){if(_0x5aed70[_0xb5ac('0x5')]instanceof Buffer){fs[_0xb5ac('0x6')](_0x117fd9,_0x5aed70['AudioStream'],function(_0x89f0d5){if(_0x89f0d5){_0x67f9e2(_0x89f0d5);}else{_0x5abfd3();}});}else{_0x67f9e2(new Error(_0xb5ac('0x7')));}}else{_0x67f9e2(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0xb5ac('0x8')]=function(_0x595635,_0x415ff7,_0x2d2856,_0x596c48,_0x262637,_0x453bbd,_0xfe3d63){var _0x2bba51=new AWS[(_0xb5ac('0x9'))]({'accessKeyId':_0x595635,'secretAccessKey':_0x415ff7,'region':_0x2d2856});var _0x56687c={'Text':_0x262637,'TextType':_0x453bbd||_0xb5ac('0xa'),'OutputFormat':'mp3','VoiceId':_0x596c48};return pollyResult(_0x2bba51,_0x56687c,_0xfe3d63);}; \ 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 163191e..203c359 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 _0x396b=['./lib/api','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x396b,0x176));var _0xb396=function(_0x526fc7,_0x17de69){_0x526fc7=_0x526fc7-0x0;var _0x3fe5c2=_0x396b[_0x526fc7];return _0x3fe5c2;};'use strict';var asr=require(_0xb396('0x0'));module[_0xb396('0x1')]=function(_0x134d99,_0x190cee,_0x4e660d,_0x1c875d){return asr(_0x134d99,_0x190cee,_0x4e660d);}; \ No newline at end of file +var _0xa3eb=['exports','./lib/api'];(function(_0x39393e,_0x33106f){var _0x1b15b3=function(_0x55dc21){while(--_0x55dc21){_0x39393e['push'](_0x39393e['shift']());}};_0x1b15b3(++_0x33106f);}(_0xa3eb,0x18d));var _0xba3e=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xa3eb[_0xb0f7c3];return _0x28ea68;};'use strict';var asr=require(_0xba3e('0x0'));module[_0xba3e('0x1')]=function(_0x3f08a5,_0x29b29d,_0x402346,_0x3dfef0){return asr(_0x3f08a5,_0x29b29d,_0x402346);}; \ 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 808d8fa..ca81551 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 _0x2333=['length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','string'];(function(_0x411b68,_0x52e768){var _0x41ff90=function(_0x2ab602){while(--_0x2ab602){_0x411b68['push'](_0x411b68['shift']());}};_0x41ff90(++_0x52e768);}(_0x2333,0x11a));var _0x3233=function(_0x4270ca,_0x36d3c0){_0x4270ca=_0x4270ca-0x0;var _0x5ab2f6=_0x2333[_0x4270ca];return _0x5ab2f6;};'use strict';var url=require(_0x3233('0x0'));var BPromise=require(_0x3233('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module['exports']=function(_0x170ef4,_0x42ef73,_0x5a8145){return new BPromise(function(_0x8fdc58,_0x1c473f){var _0x698dea;if(typeof _0x170ef4!==_0x3233('0x2')||_0x170ef4[_0x3233('0x3')]===0x0){return _0x1c473f(_0x3233('0x4'));}if(typeof _0x42ef73!==_0x3233('0x2')||_0x42ef73[_0x3233('0x3')]===0x0){return _0x1c473f(_0x3233('0x5'));}if(typeof _0x5a8145!==_0x3233('0x6')&&(typeof _0x5a8145!==_0x3233('0x2')||_0x5a8145[_0x3233('0x3')]===0x0)){return _0x1c473f(_0x3233('0x7'));}try{_0x698dea=fs[_0x3233('0x8')](_0x170ef4)[_0x3233('0x9')](_0x3233('0xa'));}catch(_0x441fd9){return _0x1c473f(_0x441fd9);}return _0x8fdc58({'method':_0x3233('0xb'),'uri':host+_0x3233('0xc')+_0x42ef73,'body':{'config':{'encoding':_0x3233('0xd'),'sampleRateHertz':_0x3233('0xe'),'languageCode':_0x5a8145},'audio':{'content':_0x698dea}},'json':!![]});});}; \ No newline at end of file +var _0x5645=['https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','toString','POST','LINEAR16','8000','url','bluebird'];(function(_0x3bbdc6,_0x262329){var _0x50a293=function(_0x29a49a){while(--_0x29a49a){_0x3bbdc6['push'](_0x3bbdc6['shift']());}};_0x50a293(++_0x262329);}(_0x5645,0x19e));var _0x5564=function(_0x2adf46,_0xab375d){_0x2adf46=_0x2adf46-0x0;var _0x40fb40=_0x5645[_0x2adf46];return _0x40fb40;};'use strict';var url=require(_0x5564('0x0'));var BPromise=require(_0x5564('0x1'));var fs=require('fs');var host=_0x5564('0x2');module[_0x5564('0x3')]=function(_0x26c54d,_0x5ecd66,_0x241816){return new BPromise(function(_0x64ae4d,_0x1240cd){var _0x821a1a;if(typeof _0x26c54d!==_0x5564('0x4')||_0x26c54d[_0x5564('0x5')]===0x0){return _0x1240cd(_0x5564('0x6'));}if(typeof _0x5ecd66!==_0x5564('0x4')||_0x5ecd66[_0x5564('0x5')]===0x0){return _0x1240cd('key\x20should\x20be\x20a\x20string');}if(typeof _0x241816!=='undefined'&&(typeof _0x241816!==_0x5564('0x4')||_0x241816[_0x5564('0x5')]===0x0)){return _0x1240cd(_0x5564('0x7'));}try{_0x821a1a=fs[_0x5564('0x8')](_0x26c54d)[_0x5564('0x9')]('base64');}catch(_0x1ba45a){return _0x1240cd(_0x1ba45a);}return _0x64ae4d({'method':_0x5564('0xa'),'uri':host+'/v1/speech:recognize?key='+_0x5ecd66,'body':{'config':{'encoding':_0x5564('0xb'),'sampleRateHertz':_0x5564('0xc'),'languageCode':_0x241816},'audio':{'content':_0x821a1a}},'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 3242c42..ea8c5a9 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 _0x35f3=['./asr','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x35f3,0xfa));var _0x335f=function(_0x336a24,_0x1af43f){_0x336a24=_0x336a24-0x0;var _0x7db5e3=_0x35f3[_0x336a24];return _0x7db5e3;};var asr=require(_0x335f('0x0'));module[_0x335f('0x1')]={'asr':asr}; \ No newline at end of file +var _0xbc18=['./asr'];(function(_0x5841ae,_0xd83e28){var _0x3fa6e9=function(_0x1e0ffc){while(--_0x1e0ffc){_0x5841ae['push'](_0x5841ae['shift']());}};_0x3fa6e9(++_0xd83e28);}(_0xbc18,0x171));var _0x8bc1=function(_0x320b8e,_0x1da3fe){_0x320b8e=_0x320b8e-0x0;var _0x55a10a=_0xbc18[_0x320b8e];return _0x55a10a;};var asr=require(_0x8bc1('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 1619a67..5e7fb1a 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 _0xfbb2=['from','audioContent','writeFile','777','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','POST','application/x-www-form-urlencoded','stringify','jQ1olc','null','generic','slice','data','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','writeFileSync','goggleTTS\x20path','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','source','resolvedQuery','action','fulfillment','score','metadata','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','diagnosticInfo','fields','end_conversation','boolValue','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','fulfillmentText','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','bluebird','dialogflow','http','https','path','request-promise','randomstring','sox','parse','./aws','./google','./tilde','../../../config/logger','agi','protocol','https:','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','host','transcode','wav','resolve','tmp','.wav','base64','chmodSync','split','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','input','audioConfig','MP3','text:synthesize','then','generate','.mp3'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0xfbb2,0x16d));var _0x2fbb=function(_0x474c66,_0xbce925){_0x474c66=_0x474c66-0x0;var _0xcbd9bf=_0xfbb2[_0x474c66];return _0xcbd9bf;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0x2fbb('0x0'));var dialogflow=require(_0x2fbb('0x1'));var fs=require('fs');var http=require(_0x2fbb('0x2'));var https=require(_0x2fbb('0x3'));var md5=require('md5');var path=require(_0x2fbb('0x4'));var querystring=require('querystring');var rp=require(_0x2fbb('0x5'));var rs=require(_0x2fbb('0x6'));var sox=require(_0x2fbb('0x7'));var tts=require('google-tts-api');var urlParse=require('url')[_0x2fbb('0x8')];var util=require('util');var aws=require(_0x2fbb('0x9'));var google=require(_0x2fbb('0xa'));var sestek=require('./sestek');var tilde=require(_0x2fbb('0xb'));var logger=require(_0x2fbb('0xc'))(_0x2fbb('0xd'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x44a6bb,_0x2a03be){return new BPromise(function(_0x1f2805,_0x53c271){var _0x431620=urlParse(_0x44a6bb);var _0x51567e=_0x431620[_0x2fbb('0xe')]===_0x2fbb('0xf')?https:http;var _0x4d3c75={'host':_0x431620['host'],'path':_0x431620['path'],'headers':{'user-agent':_0x2fbb('0x10')}};_0x51567e[_0x2fbb('0x11')](_0x4d3c75,function(_0x2c20dc){if(_0x2c20dc[_0x2fbb('0x12')]!==0xc8){logger[_0x2fbb('0x13')](_0x2fbb('0x14')+_0x44a6bb+_0x2fbb('0x15')+_0x2c20dc['statusCode']+'\x20('+_0x2c20dc[_0x2fbb('0x16')]+')');_0x53c271(new Error(_0x2fbb('0x14')+_0x44a6bb+'\x20failed,\x20status\x20code\x20=\x20'+_0x2c20dc[_0x2fbb('0x12')]+'\x20('+_0x2c20dc[_0x2fbb('0x16')]+')'));return;}var _0x10813b=fs[_0x2fbb('0x17')](_0x2a03be);_0x10813b['on'](_0x2fbb('0x18'),function(){logger[_0x2fbb('0x19')](_0x2fbb('0x1a'));_0x10813b[_0x2fbb('0x1b')](_0x1f2805);});_0x10813b['on']('error',function(_0x4a802b){fs[_0x2fbb('0x1c')](_0x2a03be);logger[_0x2fbb('0x13')](_0x2fbb('0x1d'),_0x4a802b);_0x53c271(_0x4a802b);});_0x2c20dc[_0x2fbb('0x1e')](_0x10813b);})['on']('error',function(_0x35da0a){logger[_0x2fbb('0x13')](_0x35da0a);_0x53c271(_0x35da0a);})[_0x2fbb('0x1f')]();});}function uploadFile(_0x42c281){return new BPromise(function(_0x16a8da,_0x4b91b5){var _0x2dea70=urlParse(_0x42c281);var _0x506c7c=_0x2dea70['protocol']===_0x2fbb('0xf')?https:http;var _0x23b44a={'host':_0x2dea70[_0x2fbb('0x20')],'path':_0x2dea70[_0x2fbb('0x4')],'headers':{'user-agent':_0x2fbb('0x10')}};_0x506c7c['get'](_0x23b44a,function(_0x1319b0){if(_0x1319b0['statusCode']!==0xc8){_0x4b91b5(new Error(_0x2fbb('0x14')+_0x42c281+_0x2fbb('0x15')+_0x1319b0['statusCode']+'\x20('+_0x1319b0[_0x2fbb('0x16')]+')'));return;}var _0x4607f3='';_0x1319b0['on']('data',function(_0x2bb9c9){_0x4607f3+=_0x2bb9c9;});_0x1319b0['on'](_0x2fbb('0x1f'),function(){_0x16a8da(_0x4607f3);});})['on'](_0x2fbb('0x13'),function(_0x147f0a){_0x4b91b5(_0x147f0a);})[_0x2fbb('0x1f')]();});}function convertFile(_0x2b5e63,_0x4e4a06){return new BPromise(function(_0x8d69a1,_0x51ea6e){var _0xb7165c=sox[_0x2fbb('0x21')](_0x2b5e63,_0x4e4a06,{'sampleRate':0x1f40,'format':_0x2fbb('0x22'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xb7165c['on'](_0x2fbb('0x13'),function(_0x486f44){logger[_0x2fbb('0x13')]('error\x20convert',_0x486f44);_0x51ea6e(_0x486f44);});_0xb7165c['on'](_0x2fbb('0x1f'),function(){logger[_0x2fbb('0x19')]('finish\x20to\x20convert');_0x8d69a1();});_0xb7165c['start']();});}function base64Decode(_0x55f2f1,_0x55814c){var _0x99ba29=path[_0x2fbb('0x23')](__dirname,_0x2fbb('0x24'),rs['generate'](0x4)+_0x2fbb('0x25'));fs['writeFileSync'](_0x99ba29,_0x55f2f1,_0x2fbb('0x26'));return convertFile(_0x99ba29,_0x55814c)['then'](function(){try{fs[_0x2fbb('0x1c')](_0x99ba29);fs[_0x2fbb('0x27')](_0x55814c,'777');}catch(_0x5cceac){logger[_0x2fbb('0x13')](_0x5cceac);}return _0x55814c[_0x2fbb('0x28')]('.')[0x0];});}function base64Encode(_0xdf3a18){var _0xf3379b=fs['readFileSync'](_0xdf3a18);return new Buffer(_0xf3379b)[_0x2fbb('0x29')](_0x2fbb('0x26'));}exports[_0x2fbb('0x2a')]=function(_0xe7f7b8,_0x51fbce,_0x38d197,_0x43e172,_0x5708c2,_0x4ed06a){var _0x218946,_0x38e9e0;var _0x5e8e9c=_0x2fbb('0x2b');var _0x2874b4=_0x2fbb('0x2c')+_0xe7f7b8;var _0x4e022d={};if(_0x51fbce==='ssml'){_0x4e022d[_0x2fbb('0x2d')]={'ssml':_0x38d197};}else{_0x4e022d[_0x2fbb('0x2d')]={'text':_0x38d197};};_0x4e022d['voice']={'languageCode':_0x43e172,'ssmlGender':_0x5708c2};_0x4e022d[_0x2fbb('0x2e')]={'audioEncoding':_0x2fbb('0x2f'),'sampleRateHertz':0x1f40};var _0x3e361a={'url':_0x5e8e9c+_0x2fbb('0x30')+_0x2874b4,'method':'POST','json':!![],'body':_0x4e022d};return rp(_0x3e361a)[_0x2fbb('0x31')](function(_0x132c54){return new BPromise(function(_0x444815,_0x5bfc63){_0x218946=path[_0x2fbb('0x23')](__dirname,_0x2fbb('0x24'),rs[_0x2fbb('0x32')](0x4)+_0x2fbb('0x33'));var _0x4041a0=Buffer[_0x2fbb('0x34')](_0x132c54[_0x2fbb('0x35')],_0x2fbb('0x26'));return fs[_0x2fbb('0x36')](_0x218946,_0x4041a0,function(_0x2fa437){_0x5bfc63(_0x2fa437);},function(_0x270957){fs['chmodSync'](_0x218946,_0x2fbb('0x37'));_0x444815(_0x270957);});});})[_0x2fbb('0x31')](function(_0x308c9b){_0x38e9e0=path[_0x2fbb('0x23')](__dirname,_0x2fbb('0x24'),rs[_0x2fbb('0x32')](0x4)+_0x2fbb('0x25'));return convertFile(_0x218946,_0x38e9e0);})[_0x2fbb('0x31')](function(){try{fs[_0x2fbb('0x1c')](_0x218946);fs[_0x2fbb('0x27')](_0x38e9e0,_0x2fbb('0x37'));}catch(_0x3dad19){logger[_0x2fbb('0x13')](_0x3dad19);}logger[_0x2fbb('0x19')](_0x2fbb('0x38'),_0x38e9e0[_0x2fbb('0x28')]('.')[0x0]);return _0x38e9e0[_0x2fbb('0x28')]('.')[0x0];});};exports[_0x2fbb('0x39')]=function(_0x4d9724,_0x270e11){var _0x145c82=_0x2fbb('0x3a');var _0x377871,_0x163973;var _0x26e7be;var _0x2c0361={'encoding':'utf8','method':_0x2fbb('0x3b'),'timeout':0x2710,'url':_0x145c82,'headers':{'Content-Type':_0x2fbb('0x3c')},'body':'f.req='+encodeURIComponent(JSON[_0x2fbb('0x3d')]([[[_0x2fbb('0x3e'),JSON[_0x2fbb('0x3d')]([_0x4d9724,_0x270e11||'en',![],_0x2fbb('0x3f')]),null,_0x2fbb('0x40')]]]))};return rp(_0x2c0361)[_0x2fbb('0x31')](function(_0x22aaf4){try{_0x26e7be=eval(_0x22aaf4[_0x2fbb('0x41')](0x5))[0x0][0x2];}catch(_0x33ea7a){throw new Error('parse\x20response\x20failed:\x0a'+_0x22aaf4[_0x2fbb('0x42')]);}if(!_0x26e7be){if(_0x4d9724[_0x2fbb('0x43')]>0xc8){throw new Error(_0x2fbb('0x44'));}else{throw new Error(_0x2fbb('0x45')+_0x270e11+_0x2fbb('0x46'));}}try{_0x26e7be=eval(_0x26e7be)[0x0];}catch(_0xddb4d4){throw new Error(_0x2fbb('0x47')+res[_0x2fbb('0x42')]);}const _0x5a4bf5=_0x26e7be;_0x377871=path[_0x2fbb('0x23')](__dirname,_0x2fbb('0x24'),rs[_0x2fbb('0x32')](0x4)+_0x2fbb('0x33'));fs[_0x2fbb('0x48')](_0x377871,_0x26e7be,{'encoding':_0x2fbb('0x26')});_0x163973=path[_0x2fbb('0x23')](__dirname,_0x2fbb('0x24'),rs['generate'](0x4)+_0x2fbb('0x25'));return convertFile(_0x377871,_0x163973);})['then'](function(){try{fs[_0x2fbb('0x1c')](_0x377871);fs['chmodSync'](_0x163973,_0x2fbb('0x37'));}catch(_0x10ce8d){logger[_0x2fbb('0x13')](_0x10ce8d);}logger[_0x2fbb('0x19')](_0x2fbb('0x49'),_0x163973[_0x2fbb('0x28')]('.')[0x0]);return _0x163973[_0x2fbb('0x28')]('.')[0x0];});};exports['googleASR']=function(_0x46297b,_0x190bd0,_0x3b3e57){return google[_0x2fbb('0x4a')](_0x46297b,_0x190bd0,_0x3b3e57)[_0x2fbb('0x31')](function(_0x25d609){logger[_0x2fbb('0x19')](_0x25d609[_0x2fbb('0x4b')]);return rp(_0x25d609);})['then'](function(_0x4f22eb){var _0x28b78c='';var _0x464891=0x0;try{fs['unlink'](_0x46297b);}catch(_0x449ec7){logger[_0x2fbb('0x13')](_0x449ec7);}if(_0x4f22eb&&_0x4f22eb[_0x2fbb('0x4c')]){_0x28b78c=_0x4f22eb[_0x2fbb('0x4c')][_0x2fbb('0x4d')](function(_0x5e9fa4){return _0x5e9fa4&&_0x5e9fa4['alternatives'][0x0]&&_0x5e9fa4[_0x2fbb('0x4e')][0x0][_0x2fbb('0x4f')]?_0x5e9fa4[_0x2fbb('0x4e')][0x0][_0x2fbb('0x4f')]:'';})[_0x2fbb('0x50')]('\x0a');_0x464891=_0x4f22eb[_0x2fbb('0x4c')][_0x2fbb('0x4d')](function(_0x329735){return _0x329735&&_0x329735[_0x2fbb('0x4e')][0x0]&&_0x329735[_0x2fbb('0x4e')][0x0][_0x2fbb('0x51')]?_0x329735['alternatives'][0x0][_0x2fbb('0x51')]:0x0;})[_0x2fbb('0x50')]('\x0a');}logger[_0x2fbb('0x19')](_0x2fbb('0x52'),_0x28b78c);logger['info'](_0x2fbb('0x53'),_0x464891);return{'transcript':_0x28b78c,'confidence':_0x464891};})[_0x2fbb('0x54')](function(_0x1ae7d8){logger[_0x2fbb('0x13')](_0x2fbb('0x55'),_0x1ae7d8['statusCode'],_0x1ae7d8[_0x2fbb('0x56')],_0x1ae7d8[_0x2fbb('0x57')]);});};exports[_0x2fbb('0x58')]=function(_0x22f1b6,_0x54c847,_0x3154a0,_0x1a719d){var _0x13ac6a=apiai(_0x54c847,{'language':_0x1a719d||'en'});return _0x13ac6a[_0x2fbb('0x59')](_0x3154a0,{'sessionId':md5(_0x22f1b6)})[_0x2fbb('0x31')](function(_0x145911){logger[_0x2fbb('0x19')](JSON[_0x2fbb('0x3d')](_0x145911));return{'source':_0x145911[_0x2fbb('0x5a')][_0x2fbb('0x5b')],'resolvedQuery':_0x145911[_0x2fbb('0x5a')][_0x2fbb('0x5c')],'action':_0x145911[_0x2fbb('0x5a')][_0x2fbb('0x5d')],'actionIncomplete':_0x145911['result']['actionIncomplete'],'speech':_0x145911[_0x2fbb('0x5a')][_0x2fbb('0x5e')]['speech'],'score':_0x145911[_0x2fbb('0x5a')][_0x2fbb('0x5f')],'statusCode':_0x145911['status']['code'],'endConversation':_0x145911[_0x2fbb('0x5a')][_0x2fbb('0x60')]['endConversation']||![],'isFallbackIntent':_0x145911[_0x2fbb('0x5a')][_0x2fbb('0x60')][_0x2fbb('0x61')]};});};exports[_0x2fbb('0x62')]=function(_0x3f9e93,_0x1a231a,_0x4c1a30,_0x3bb2c3,_0x3bfa84,_0x4a1fa1){var _0x2b3e82=_0x3bb2c3[_0x2fbb('0x63')](/\\n/g,'\x0a');var _0x2f5f43={'credentials':{'private_key':_0x2b3e82,'client_email':_0x4c1a30}};var _0xc47d5a=new dialogflow[(_0x2fbb('0x64'))](_0x2f5f43);var _0x5878e9=_0xc47d5a[_0x2fbb('0x65')](_0x1a231a,md5(_0x3f9e93));var _0x37d47b={'session':_0x5878e9,'queryInput':{'text':{'text':_0x3bfa84,'languageCode':_0x4a1fa1}}};return _0xc47d5a[_0x2fbb('0x66')](_0x37d47b)[_0x2fbb('0x31')](function(_0x362748){if(_0x362748&&_0x362748['length']){logger[_0x2fbb('0x19')](_0x2fbb('0x67'),JSON[_0x2fbb('0x3d')](_0x362748));var _0x10ad03=_0x362748[0x0];if(_0x10ad03){var _0x3a0dd9={'action':_0x10ad03[_0x2fbb('0x68')][_0x2fbb('0x5d')],'allRequiredParamsPresent':_0x10ad03['queryResult']['allRequiredParamsPresent'],'endConversation':_0x10ad03[_0x2fbb('0x68')][_0x2fbb('0x69')]&&_0x10ad03[_0x2fbb('0x68')][_0x2fbb('0x69')][_0x2fbb('0x6a')]?_0x10ad03['queryResult'][_0x2fbb('0x69')]['fields'][_0x2fbb('0x6b')][_0x2fbb('0x6c')]:![],'fulfillmentText':_0x10ad03[_0x2fbb('0x68')]['fulfillmentText'],'intentName':_0x10ad03['queryResult'][_0x2fbb('0x6d')]['name'],'intentDisplayName':_0x10ad03[_0x2fbb('0x68')][_0x2fbb('0x6d')][_0x2fbb('0x6e')],'isFallbackIntent':_0x10ad03[_0x2fbb('0x68')][_0x2fbb('0x6d')][_0x2fbb('0x6f')],'languageCode':_0x10ad03[_0x2fbb('0x68')][_0x2fbb('0x70')],'queryText':_0x10ad03[_0x2fbb('0x68')][_0x2fbb('0x71')],'responseId':_0x10ad03[_0x2fbb('0x72')],'score':_0x10ad03[_0x2fbb('0x68')][_0x2fbb('0x73')],'speech':_0x10ad03[_0x2fbb('0x68')][_0x2fbb('0x74')],'providerResponse':JSON[_0x2fbb('0x3d')](_0x362748)};return _0x3a0dd9;}}});};exports[_0x2fbb('0x75')]=function(_0x44db0f,_0x18e646,_0x2a3c7f,_0x3efbe3){return tilde['asr'](_0x44db0f,_0x18e646,_0x2a3c7f,_0x3efbe3)['then'](function(_0x3fef35){try{fs[_0x2fbb('0x1c')](_0x44db0f);}catch(_0x11b04e){logger[_0x2fbb('0x13')](_0x11b04e);}logger[_0x2fbb('0x19')](_0x2fbb('0x76'),_0x3fef35[_0x2fbb('0x4f')]);logger[_0x2fbb('0x19')](_0x2fbb('0x77'),_0x3fef35['confidence']);return _0x3fef35;});};exports[_0x2fbb('0x78')]=function(_0x5cbb4b,_0x1ad66f,_0x3ed406,_0x4e7b3f,_0xdc4ba9,_0x38887b){var _0x535bc7=path[_0x2fbb('0x23')](__dirname,'tmp',rs[_0x2fbb('0x32')](0x4)+_0x2fbb('0x33'));var _0x347e13;return aws[_0x2fbb('0x79')](_0x5cbb4b,_0x1ad66f,_0x3ed406,_0x4e7b3f,_0xdc4ba9,_0x38887b,_0x535bc7)['then'](function(){_0x347e13=path['resolve'](__dirname,_0x2fbb('0x24'),rs['generate'](0x4)+_0x2fbb('0x25'));return convertFile(_0x535bc7,_0x347e13);})[_0x2fbb('0x31')](function(){try{fs[_0x2fbb('0x1c')](_0x535bc7);fs[_0x2fbb('0x27')](_0x347e13,'777');}catch(_0x2630d6){logger[_0x2fbb('0x13')](_0x2630d6);}return _0x347e13[_0x2fbb('0x28')]('.')[0x0];});};exports[_0x2fbb('0x7a')]=function(_0x5de1a0,_0x5b301d,_0x396f2d,_0xe01112,_0x236752,_0x50170c){return aws[_0x2fbb('0x7b')](_0x5de1a0,_0x5b301d,_0x396f2d,_0xe01112,_0x236752,_0x50170c)[_0x2fbb('0x31')](function(_0x40eca1){logger['info'](JSON[_0x2fbb('0x3d')](_0x40eca1));return _0x40eca1;});};exports[_0x2fbb('0x7c')]=function(_0x491a93,_0x21bb5c,_0x2caedd,_0x3ee00c){var _0x5f77d8=util[_0x2fbb('0x7d')](_0x2fbb('0x7e'),ISPEECH_API,_0x491a93,encodeURIComponent(_0x21bb5c),_0x2caedd,_0x3ee00c);var _0x2487f3=path['resolve'](__dirname,_0x2fbb('0x24'),rs['generate'](0x4)+_0x2fbb('0x33'));var _0x5a5392;return downloadFile(_0x5f77d8,_0x2487f3)[_0x2fbb('0x31')](function(){_0x5a5392=path[_0x2fbb('0x23')](__dirname,'tmp',rs[_0x2fbb('0x32')](0x4)+_0x2fbb('0x25'));return convertFile(_0x2487f3,_0x5a5392);})['then'](function(){try{fs[_0x2fbb('0x1c')](_0x2487f3);fs[_0x2fbb('0x27')](_0x5a5392,_0x2fbb('0x37'));}catch(_0x273538){logger[_0x2fbb('0x13')](_0x273538);}return _0x5a5392[_0x2fbb('0x28')]('.')[0x0];});};exports['ispeechASR']=function(_0x38e7a0,_0x5f4eb8,_0x2b4aef,_0x4072f5){var _0x5d1020=util[_0x2fbb('0x7d')](_0x2fbb('0x7f'),ISPEECH_API,_0x5f4eb8,_0x2b4aef,base64Encode(_0x38e7a0),_0x4072f5?util[_0x2fbb('0x7d')](_0x2fbb('0x80'),encodeURIComponent(_0x4072f5)):_0x2fbb('0x81'));return uploadFile(_0x5d1020)[_0x2fbb('0x31')](function(_0x4bafa3){return querystring[_0x2fbb('0x8')](_0x4bafa3);});};exports[_0x2fbb('0x82')]=function(_0x5e23e4,_0x428d64){return sestek['nda'](_0x5e23e4,_0x428d64)[_0x2fbb('0x31')](function(_0x5bd814){logger[_0x2fbb('0x19')](JSON['stringify'](_0x5bd814));var _0x514c85={'speech':_0x5bd814[_0x2fbb('0x83')],'action':_0x5bd814[_0x2fbb('0x84')]?_0x5bd814[_0x2fbb('0x84')][_0x2fbb('0x85')]:undefined,'actiondata':_0x5bd814[_0x2fbb('0x84')]?_0x5bd814[_0x2fbb('0x84')][_0x2fbb('0x86')]:undefined};if(_0x5bd814['channelData']&&_0x5bd814['channelData'][_0x2fbb('0x87')]){return base64Decode(_0x5bd814[_0x2fbb('0x84')][_0x2fbb('0x87')][_0x2fbb('0x88')],path['resolve'](__dirname,'tmp',rs[_0x2fbb('0x32')](0x4)+'.wav'))['then'](function(_0x33869e){_0x514c85[_0x2fbb('0x89')]=_0x33869e;return _0x514c85;});}return _0x514c85;});};exports[_0x2fbb('0x8a')]=function(){return __dirname;}; \ No newline at end of file +var _0x5109=['sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','apiai-promise','bluebird','https','md5','path','request-promise','randomstring','sox','google-tts-api','url','util','./aws','./google','./sestek','./tilde','agi','https://api.ispeech.org/api/rest','https:','host','WHAT_EVER','get','request\x20to\x20','statusCode','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','error','unlink','download\x20error','pipe','end','protocol','\x20failed,\x20status\x20code\x20=\x20','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','writeFileSync','base64','then','chmodSync','777','split','readFileSync','toString','https://texttospeech.googleapis.com/v1/','?key=','voice','audioConfig','MP3','text:synthesize','POST','from','audioContent','writeFile','.wav','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','f.req=','stringify','jQ1olc','slice','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','data','.mp3','goggleTTS\x20path','googleASR','alternatives','transcript','results','map','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','source','actionIncomplete','fulfillment','speech','score','status','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','Dialogflow\x20V2\x20response:','queryResult','action','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','parse'];(function(_0x14bbf3,_0xca820f){var _0x1b280c=function(_0x2a5314){while(--_0x2a5314){_0x14bbf3['push'](_0x14bbf3['shift']());}};_0x1b280c(++_0xca820f);}(_0x5109,0x12d));var _0x9510=function(_0x2c0125,_0x5edafe){_0x2c0125=_0x2c0125-0x0;var _0x30546b=_0x5109[_0x2c0125];return _0x30546b;};'use strict';var apiai=require(_0x9510('0x0'));var BPromise=require(_0x9510('0x1'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require('http');var https=require(_0x9510('0x2'));var md5=require(_0x9510('0x3'));var path=require(_0x9510('0x4'));var querystring=require('querystring');var rp=require(_0x9510('0x5'));var rs=require(_0x9510('0x6'));var sox=require(_0x9510('0x7'));var tts=require(_0x9510('0x8'));var urlParse=require(_0x9510('0x9'))['parse'];var util=require(_0x9510('0xa'));var aws=require(_0x9510('0xb'));var google=require(_0x9510('0xc'));var sestek=require(_0x9510('0xd'));var tilde=require(_0x9510('0xe'));var logger=require('../../../config/logger')(_0x9510('0xf'));var ISPEECH_API=_0x9510('0x10');function downloadFile(_0x2dcceb,_0x517382){return new BPromise(function(_0xc74ebf,_0x497ee6){var _0x4fa2c5=urlParse(_0x2dcceb);var _0xa75a27=_0x4fa2c5['protocol']===_0x9510('0x11')?https:http;var _0x455ff9={'host':_0x4fa2c5[_0x9510('0x12')],'path':_0x4fa2c5[_0x9510('0x4')],'headers':{'user-agent':_0x9510('0x13')}};_0xa75a27[_0x9510('0x14')](_0x455ff9,function(_0x1f36d2){if(_0x1f36d2['statusCode']!==0xc8){logger['error'](_0x9510('0x15')+_0x2dcceb+'\x20failed,\x20status\x20code\x20=\x20'+_0x1f36d2[_0x9510('0x16')]+'\x20('+_0x1f36d2[_0x9510('0x17')]+')');_0x497ee6(new Error(_0x9510('0x15')+_0x2dcceb+'\x20failed,\x20status\x20code\x20=\x20'+_0x1f36d2[_0x9510('0x16')]+'\x20('+_0x1f36d2[_0x9510('0x17')]+')'));return;}var _0x536333=fs[_0x9510('0x18')](_0x517382);_0x536333['on'](_0x9510('0x19'),function(){logger[_0x9510('0x1a')](_0x9510('0x1b'));_0x536333[_0x9510('0x1c')](_0xc74ebf);});_0x536333['on'](_0x9510('0x1d'),function(_0x3789e2){fs[_0x9510('0x1e')](_0x517382);logger['error'](_0x9510('0x1f'),_0x3789e2);_0x497ee6(_0x3789e2);});_0x1f36d2[_0x9510('0x20')](_0x536333);})['on'](_0x9510('0x1d'),function(_0x292dd9){logger[_0x9510('0x1d')](_0x292dd9);_0x497ee6(_0x292dd9);})[_0x9510('0x21')]();});}function uploadFile(_0x15d506){return new BPromise(function(_0x4fd4c5,_0x39810f){var _0x1717bf=urlParse(_0x15d506);var _0x214692=_0x1717bf[_0x9510('0x22')]===_0x9510('0x11')?https:http;var _0x2fa1d8={'host':_0x1717bf[_0x9510('0x12')],'path':_0x1717bf[_0x9510('0x4')],'headers':{'user-agent':_0x9510('0x13')}};_0x214692[_0x9510('0x14')](_0x2fa1d8,function(_0x760e53){if(_0x760e53[_0x9510('0x16')]!==0xc8){_0x39810f(new Error(_0x9510('0x15')+_0x15d506+_0x9510('0x23')+_0x760e53['statusCode']+'\x20('+_0x760e53[_0x9510('0x17')]+')'));return;}var _0xa13db4='';_0x760e53['on']('data',function(_0x2a3790){_0xa13db4+=_0x2a3790;});_0x760e53['on'](_0x9510('0x21'),function(){_0x4fd4c5(_0xa13db4);});})['on'](_0x9510('0x1d'),function(_0x2ff7c5){_0x39810f(_0x2ff7c5);})[_0x9510('0x21')]();});}function convertFile(_0x3699e0,_0x3db47e){return new BPromise(function(_0x3b2a20,_0x1fbd3a){var _0x3a693e=sox[_0x9510('0x24')](_0x3699e0,_0x3db47e,{'sampleRate':0x1f40,'format':_0x9510('0x25'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3a693e['on'](_0x9510('0x1d'),function(_0x499d66){logger[_0x9510('0x1d')](_0x9510('0x26'),_0x499d66);_0x1fbd3a(_0x499d66);});_0x3a693e['on'](_0x9510('0x21'),function(){logger['info'](_0x9510('0x27'));_0x3b2a20();});_0x3a693e[_0x9510('0x28')]();});}function base64Decode(_0x39eb07,_0x2c25f0){var _0x74eb3f=path[_0x9510('0x29')](__dirname,_0x9510('0x2a'),rs[_0x9510('0x2b')](0x4)+'.wav');fs[_0x9510('0x2c')](_0x74eb3f,_0x39eb07,_0x9510('0x2d'));return convertFile(_0x74eb3f,_0x2c25f0)[_0x9510('0x2e')](function(){try{fs[_0x9510('0x1e')](_0x74eb3f);fs[_0x9510('0x2f')](_0x2c25f0,_0x9510('0x30'));}catch(_0x5d72a9){logger[_0x9510('0x1d')](_0x5d72a9);}return _0x2c25f0[_0x9510('0x31')]('.')[0x0];});}function base64Encode(_0x14f1e6){var _0x1ecf95=fs[_0x9510('0x32')](_0x14f1e6);return new Buffer(_0x1ecf95)[_0x9510('0x33')](_0x9510('0x2d'));}exports['googleCloudTTS']=function(_0x55b4ed,_0x4c622e,_0x25a551,_0x4994f6,_0x560a8b,_0x329bee){var _0x429d19,_0x2d59c4;var _0x36ef83=_0x9510('0x34');var _0xb13b43=_0x9510('0x35')+_0x55b4ed;var _0x23a6ca={};if(_0x4c622e==='ssml'){_0x23a6ca['input']={'ssml':_0x25a551};}else{_0x23a6ca['input']={'text':_0x25a551};};_0x23a6ca[_0x9510('0x36')]={'languageCode':_0x4994f6,'ssmlGender':_0x560a8b};_0x23a6ca[_0x9510('0x37')]={'audioEncoding':_0x9510('0x38'),'sampleRateHertz':0x1f40};var _0x4bc90b={'url':_0x36ef83+_0x9510('0x39')+_0xb13b43,'method':_0x9510('0x3a'),'json':!![],'body':_0x23a6ca};return rp(_0x4bc90b)[_0x9510('0x2e')](function(_0x38155c){return new BPromise(function(_0x449e36,_0x114e98){_0x429d19=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+'.mp3');var _0x5e0689=Buffer[_0x9510('0x3b')](_0x38155c[_0x9510('0x3c')],_0x9510('0x2d'));return fs[_0x9510('0x3d')](_0x429d19,_0x5e0689,function(_0x540c60){_0x114e98(_0x540c60);},function(_0x113d43){fs[_0x9510('0x2f')](_0x429d19,'777');_0x449e36(_0x113d43);});});})['then'](function(_0x45c813){_0x2d59c4=path[_0x9510('0x29')](__dirname,_0x9510('0x2a'),rs[_0x9510('0x2b')](0x4)+_0x9510('0x3e'));return convertFile(_0x429d19,_0x2d59c4);})['then'](function(){try{fs[_0x9510('0x1e')](_0x429d19);fs[_0x9510('0x2f')](_0x2d59c4,_0x9510('0x30'));}catch(_0x13bbbf){logger[_0x9510('0x1d')](_0x13bbbf);}logger[_0x9510('0x1a')](_0x9510('0x3f'),_0x2d59c4[_0x9510('0x31')]('.')[0x0]);return _0x2d59c4[_0x9510('0x31')]('.')[0x0];});};exports[_0x9510('0x40')]=function(_0x4f05dd,_0x1d8d65){var _0x2d520a=_0x9510('0x41');var _0x6c9234,_0xf23528;var _0x3ae3ee;var _0x300523={'encoding':_0x9510('0x42'),'method':'POST','timeout':0x2710,'url':_0x2d520a,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x9510('0x43')+encodeURIComponent(JSON[_0x9510('0x44')]([[[_0x9510('0x45'),JSON[_0x9510('0x44')]([_0x4f05dd,_0x1d8d65||'en',![],'null']),null,'generic']]]))};return rp(_0x300523)[_0x9510('0x2e')](function(_0x559e75){try{_0x3ae3ee=eval(_0x559e75[_0x9510('0x46')](0x5))[0x0][0x2];}catch(_0x154028){throw new Error('parse\x20response\x20failed:\x0a'+_0x559e75['data']);}if(!_0x3ae3ee){if(_0x4f05dd[_0x9510('0x47')]>0xc8){throw new Error(_0x9510('0x48'));}else{throw new Error(_0x9510('0x49')+_0x1d8d65+_0x9510('0x4a'));}}try{_0x3ae3ee=eval(_0x3ae3ee)[0x0];}catch(_0x26bb1d){throw new Error(_0x9510('0x4b')+res[_0x9510('0x4c')]);}const _0x20d409=_0x3ae3ee;_0x6c9234=path[_0x9510('0x29')](__dirname,'tmp',rs[_0x9510('0x2b')](0x4)+_0x9510('0x4d'));fs[_0x9510('0x2c')](_0x6c9234,_0x3ae3ee,{'encoding':'base64'});_0xf23528=path['resolve'](__dirname,_0x9510('0x2a'),rs[_0x9510('0x2b')](0x4)+_0x9510('0x3e'));return convertFile(_0x6c9234,_0xf23528);})[_0x9510('0x2e')](function(){try{fs['unlink'](_0x6c9234);fs[_0x9510('0x2f')](_0xf23528,_0x9510('0x30'));}catch(_0x39ff2c){logger[_0x9510('0x1d')](_0x39ff2c);}logger['info'](_0x9510('0x4e'),_0xf23528[_0x9510('0x31')]('.')[0x0]);return _0xf23528[_0x9510('0x31')]('.')[0x0];});};exports[_0x9510('0x4f')]=function(_0x386fc9,_0x322c3d,_0x4eb18b){return google['asr'](_0x386fc9,_0x322c3d,_0x4eb18b)[_0x9510('0x2e')](function(_0x218008){logger[_0x9510('0x1a')](_0x218008['uri']);return rp(_0x218008);})['then'](function(_0x463020){var _0x1f950e='';var _0x301d91=0x0;try{fs['unlink'](_0x386fc9);}catch(_0x180b32){logger[_0x9510('0x1d')](_0x180b32);}if(_0x463020&&_0x463020['results']){_0x1f950e=_0x463020['results']['map'](function(_0x1c15fc){return _0x1c15fc&&_0x1c15fc[_0x9510('0x50')][0x0]&&_0x1c15fc[_0x9510('0x50')][0x0]['transcript']?_0x1c15fc[_0x9510('0x50')][0x0][_0x9510('0x51')]:'';})['join']('\x0a');_0x301d91=_0x463020[_0x9510('0x52')][_0x9510('0x53')](function(_0x234cc3){return _0x234cc3&&_0x234cc3[_0x9510('0x50')][0x0]&&_0x234cc3['alternatives'][0x0][_0x9510('0x54')]?_0x234cc3[_0x9510('0x50')][0x0][_0x9510('0x54')]:0x0;})['join']('\x0a');}logger['info'](_0x9510('0x55'),_0x1f950e);logger[_0x9510('0x1a')](_0x9510('0x56'),_0x301d91);return{'transcript':_0x1f950e,'confidence':_0x301d91};})[_0x9510('0x57')](function(_0x47187c){logger['error'](_0x9510('0x58'),_0x47187c[_0x9510('0x16')],_0x47187c[_0x9510('0x59')],_0x47187c[_0x9510('0x5a')]);});};exports[_0x9510('0x5b')]=function(_0x6cab15,_0x4aac2c,_0x408d83,_0x417829){var _0x3ecd46=apiai(_0x4aac2c,{'language':_0x417829||'en'});return _0x3ecd46[_0x9510('0x5c')](_0x408d83,{'sessionId':md5(_0x6cab15)})[_0x9510('0x2e')](function(_0x151eb7){logger['info'](JSON[_0x9510('0x44')](_0x151eb7));return{'source':_0x151eb7[_0x9510('0x5d')][_0x9510('0x5e')],'resolvedQuery':_0x151eb7[_0x9510('0x5d')]['resolvedQuery'],'action':_0x151eb7[_0x9510('0x5d')]['action'],'actionIncomplete':_0x151eb7['result'][_0x9510('0x5f')],'speech':_0x151eb7[_0x9510('0x5d')][_0x9510('0x60')][_0x9510('0x61')],'score':_0x151eb7[_0x9510('0x5d')][_0x9510('0x62')],'statusCode':_0x151eb7[_0x9510('0x63')][_0x9510('0x64')],'endConversation':_0x151eb7[_0x9510('0x5d')][_0x9510('0x65')][_0x9510('0x66')]||![],'isFallbackIntent':_0x151eb7[_0x9510('0x5d')]['metadata'][_0x9510('0x67')]};});};exports[_0x9510('0x68')]=function(_0x51c97b,_0x12ba76,_0x4ef522,_0x318c1e,_0x127ed2,_0x4c9061){var _0x4e8872=_0x318c1e[_0x9510('0x69')](/\\n/g,'\x0a');var _0x1df9c1={'credentials':{'private_key':_0x4e8872,'client_email':_0x4ef522}};var _0x465572=new dialogflow[(_0x9510('0x6a'))](_0x1df9c1);var _0x1f7630=_0x465572[_0x9510('0x6b')](_0x12ba76,md5(_0x51c97b));var _0x40ccd5={'session':_0x1f7630,'queryInput':{'text':{'text':_0x127ed2,'languageCode':_0x4c9061}}};return _0x465572['detectIntent'](_0x40ccd5)['then'](function(_0x58b3d0){if(_0x58b3d0&&_0x58b3d0['length']){logger['info'](_0x9510('0x6c'),JSON[_0x9510('0x44')](_0x58b3d0));var _0x5e2b9f=_0x58b3d0[0x0];if(_0x5e2b9f){var _0x515076={'action':_0x5e2b9f[_0x9510('0x6d')][_0x9510('0x6e')],'allRequiredParamsPresent':_0x5e2b9f[_0x9510('0x6d')][_0x9510('0x6f')],'endConversation':_0x5e2b9f[_0x9510('0x6d')][_0x9510('0x70')]&&_0x5e2b9f['queryResult'][_0x9510('0x70')][_0x9510('0x71')]?_0x5e2b9f[_0x9510('0x6d')][_0x9510('0x70')][_0x9510('0x71')][_0x9510('0x72')][_0x9510('0x73')]:![],'fulfillmentText':_0x5e2b9f[_0x9510('0x6d')][_0x9510('0x74')],'intentName':_0x5e2b9f['queryResult'][_0x9510('0x75')][_0x9510('0x59')],'intentDisplayName':_0x5e2b9f[_0x9510('0x6d')][_0x9510('0x75')][_0x9510('0x76')],'isFallbackIntent':_0x5e2b9f[_0x9510('0x6d')]['intent'][_0x9510('0x77')],'languageCode':_0x5e2b9f[_0x9510('0x6d')][_0x9510('0x78')],'queryText':_0x5e2b9f[_0x9510('0x6d')][_0x9510('0x79')],'responseId':_0x5e2b9f['responseId'],'score':_0x5e2b9f['queryResult'][_0x9510('0x7a')],'speech':_0x5e2b9f[_0x9510('0x6d')]['fulfillmentText'],'providerResponse':JSON[_0x9510('0x44')](_0x58b3d0)};return _0x515076;}}});};exports[_0x9510('0x7b')]=function(_0x460e2f,_0x48a244,_0x389c32,_0x3baa9f){return tilde['asr'](_0x460e2f,_0x48a244,_0x389c32,_0x3baa9f)[_0x9510('0x2e')](function(_0x2449aa){try{fs[_0x9510('0x1e')](_0x460e2f);}catch(_0x469221){logger['error'](_0x469221);}logger[_0x9510('0x1a')](_0x9510('0x7c'),_0x2449aa[_0x9510('0x51')]);logger[_0x9510('0x1a')](_0x9510('0x7d'),_0x2449aa['confidence']);return _0x2449aa;});};exports[_0x9510('0x7e')]=function(_0x97eb1e,_0x3e3e03,_0x1cf785,_0x2fcc7e,_0x2406e0,_0x11b5d7){var _0x392800=path[_0x9510('0x29')](__dirname,'tmp',rs['generate'](0x4)+'.mp3');var _0x3f35ed;return aws[_0x9510('0x7f')](_0x97eb1e,_0x3e3e03,_0x1cf785,_0x2fcc7e,_0x2406e0,_0x11b5d7,_0x392800)['then'](function(){_0x3f35ed=path[_0x9510('0x29')](__dirname,_0x9510('0x2a'),rs[_0x9510('0x2b')](0x4)+'.wav');return convertFile(_0x392800,_0x3f35ed);})['then'](function(){try{fs['unlink'](_0x392800);fs[_0x9510('0x2f')](_0x3f35ed,'777');}catch(_0x17441b){logger['error'](_0x17441b);}return _0x3f35ed[_0x9510('0x31')]('.')[0x0];});};exports['awsLex']=function(_0xc215f9,_0xd29ad,_0x36a836,_0x31b6f2,_0x5e3c57,_0x1ba409){return aws[_0x9510('0x80')](_0xc215f9,_0xd29ad,_0x36a836,_0x31b6f2,_0x5e3c57,_0x1ba409)['then'](function(_0x413e10){logger[_0x9510('0x1a')](JSON[_0x9510('0x44')](_0x413e10));return _0x413e10;});};exports[_0x9510('0x81')]=function(_0x200f44,_0x29a4ff,_0x22edd8,_0x2da611){var _0x3872a3=util[_0x9510('0x82')](_0x9510('0x83'),ISPEECH_API,_0x200f44,encodeURIComponent(_0x29a4ff),_0x22edd8,_0x2da611);var _0x3d3e8d=path['resolve'](__dirname,'tmp',rs[_0x9510('0x2b')](0x4)+_0x9510('0x4d'));var _0x45b57d;return downloadFile(_0x3872a3,_0x3d3e8d)['then'](function(){_0x45b57d=path['resolve'](__dirname,_0x9510('0x2a'),rs['generate'](0x4)+_0x9510('0x3e'));return convertFile(_0x3d3e8d,_0x45b57d);})[_0x9510('0x2e')](function(){try{fs[_0x9510('0x1e')](_0x3d3e8d);fs[_0x9510('0x2f')](_0x45b57d,_0x9510('0x30'));}catch(_0x70ad01){logger[_0x9510('0x1d')](_0x70ad01);}return _0x45b57d[_0x9510('0x31')]('.')[0x0];});};exports[_0x9510('0x84')]=function(_0x1b6dac,_0x2c1e71,_0x35e0d7,_0x451b4e){var _0x2c2c71=util[_0x9510('0x82')](_0x9510('0x85'),ISPEECH_API,_0x2c1e71,_0x35e0d7,base64Encode(_0x1b6dac),_0x451b4e?util[_0x9510('0x82')](_0x9510('0x86'),encodeURIComponent(_0x451b4e)):_0x9510('0x87'));return uploadFile(_0x2c2c71)[_0x9510('0x2e')](function(_0x5e380e){return querystring[_0x9510('0x88')](_0x5e380e);});};exports[_0x9510('0x89')]=function(_0x563b46,_0x2c46e8){return sestek[_0x9510('0x8a')](_0x563b46,_0x2c46e8)[_0x9510('0x2e')](function(_0x57213f){logger[_0x9510('0x1a')](JSON[_0x9510('0x44')](_0x57213f));var _0x302f27={'speech':_0x57213f[_0x9510('0x8b')],'action':_0x57213f['channelData']?_0x57213f[_0x9510('0x8c')][_0x9510('0x8d')]:undefined,'actiondata':_0x57213f[_0x9510('0x8c')]?_0x57213f['channelData'][_0x9510('0x8e')]:undefined};if(_0x57213f[_0x9510('0x8c')]&&_0x57213f[_0x9510('0x8c')][_0x9510('0x8f')]){return base64Decode(_0x57213f[_0x9510('0x8c')]['AudioFromTts'][_0x9510('0x90')],path['resolve'](__dirname,_0x9510('0x2a'),rs['generate'](0x4)+_0x9510('0x3e')))[_0x9510('0x2e')](function(_0x221545){_0x302f27[_0x9510('0x91')]=_0x221545;return _0x302f27;});}return _0x302f27;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/index.js b/server/services/agi/scripts/sestek/index.js index 63fd40e..7776c22 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 _0xf74b=['exports','./nda'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf74b,0xb9));var _0xbf74=function(_0x1ff37,_0x536989){_0x1ff37=_0x1ff37-0x0;var _0x2e65c1=_0xf74b[_0x1ff37];return _0x2e65c1;};var nda=require(_0xbf74('0x0'));module[_0xbf74('0x1')]={'nda':nda}; \ No newline at end of file +var _0x7346=['./nda'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0x7346,0x1a5));var _0x6734=function(_0xa4048d,_0x257703){_0xa4048d=_0xa4048d-0x0;var _0x1399da=_0x7346[_0xa4048d];return _0x1399da;};var nda=require(_0x6734('0x0'));module['exports']={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index 1abe81e..c9f1864 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 _0x8128=['stringify','request-promise','agi','exports','POST','resolve','/token','password','username','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','dnid','extension','Bearer\x20','access_token','project','body','channelData','ProjectName','ndagenerate_audio','custom_action','custom_action_data'];(function(_0xf26c2e,_0x56c3ea){var _0x46ecb4=function(_0x1be516){while(--_0x1be516){_0xf26c2e['push'](_0xf26c2e['shift']());}};_0x46ecb4(++_0x56c3ea);}(_0x8128,0x1b1));var _0x8812=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x8128[_0x2064e5];return _0x21a233;};'use strict';var rp=require(_0x8812('0x0'));var url=require('url');var logger=require('../../../../../config/logger')(_0x8812('0x1'));module[_0x8812('0x2')]=function(_0x4efc58,_0x5dbf05){var _0x1c189a={'method':_0x8812('0x3'),'uri':url[_0x8812('0x4')](_0x5dbf05['ndauth_url'],_0x8812('0x5')),'form':{'grant_type':_0x8812('0x6'),'username':_0x5dbf05[_0x8812('0x7')],'password':_0x5dbf05[_0x8812('0x6')]},'json':!![]};return rp(_0x1c189a)['then'](function(_0xfdd696){var _0x3d030b={'method':'POST','uri':url['resolve'](_0x5dbf05['ndassistant_url'],_0x8812('0x8')),'body':{'type':_0x5dbf05[_0x8812('0x9')]||_0x8812('0xa'),'channelId':_0x8812('0xb'),'conversation':{'id':_0x4efc58[_0x8812('0xc')]},'from':{'id':_0x4efc58[_0x8812('0xd')],'name':_0x4efc58[_0x8812('0xe')]},'recipient':{'id':_0x4efc58[_0x8812('0xf')],'name':_0x4efc58[_0x8812('0x10')]},'text':_0x5dbf05['text'],'channelData':{}},'headers':{'Authorization':_0x8812('0x11')+_0xfdd696[_0x8812('0x12')]},'json':!![]};if(_0x5dbf05[_0x8812('0x13')]){_0x3d030b[_0x8812('0x14')][_0x8812('0x15')][_0x8812('0x16')]=_0x5dbf05['project'];}if(_0x5dbf05[_0x8812('0x17')]=='1'){_0x3d030b[_0x8812('0x14')][_0x8812('0x15')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x5dbf05[_0x8812('0x18')]){_0x3d030b[_0x8812('0x14')]['channelData']['CustomAction']=_0x5dbf05['custom_action'];if(_0x5dbf05['custom_action_data']){_0x3d030b['body'][_0x8812('0x15')]['CustomActionData']=_0x5dbf05[_0x8812('0x19')];}}logger['info'](JSON[_0x8812('0x1a')](_0x3d030b));return rp(_0x3d030b);});}; \ No newline at end of file +var _0x4584=['stringify','request-promise','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','calleridname','dnid','extension','text','Bearer\x20','project','channelData','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','body','CustomAction','custom_action_data','info'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x4584,0x1cf));var _0x4458=function(_0x4dd063,_0x386d0c){_0x4dd063=_0x4dd063-0x0;var _0x2b8747=_0x4584[_0x4dd063];return _0x2b8747;};'use strict';var rp=require(_0x4458('0x0'));var url=require('url');var logger=require(_0x4458('0x1'))(_0x4458('0x2'));module[_0x4458('0x3')]=function(_0x5340f5,_0x570b9c){var _0x18e5c6={'method':_0x4458('0x4'),'uri':url[_0x4458('0x5')](_0x570b9c[_0x4458('0x6')],_0x4458('0x7')),'form':{'grant_type':_0x4458('0x8'),'username':_0x570b9c[_0x4458('0x9')],'password':_0x570b9c[_0x4458('0x8')]},'json':!![]};return rp(_0x18e5c6)[_0x4458('0xa')](function(_0x51da14){var _0x14bb0f={'method':_0x4458('0x4'),'uri':url[_0x4458('0x5')](_0x570b9c[_0x4458('0xb')],_0x4458('0xc')),'body':{'type':_0x570b9c[_0x4458('0xd')]||_0x4458('0xe'),'channelId':_0x4458('0xf'),'conversation':{'id':_0x5340f5[_0x4458('0x10')]},'from':{'id':_0x5340f5['callerid'],'name':_0x5340f5[_0x4458('0x11')]},'recipient':{'id':_0x5340f5[_0x4458('0x12')],'name':_0x5340f5[_0x4458('0x13')]},'text':_0x570b9c[_0x4458('0x14')],'channelData':{}},'headers':{'Authorization':_0x4458('0x15')+_0x51da14['access_token']},'json':!![]};if(_0x570b9c[_0x4458('0x16')]){_0x14bb0f['body'][_0x4458('0x17')]['ProjectName']=_0x570b9c[_0x4458('0x16')];}if(_0x570b9c[_0x4458('0x18')]=='1'){_0x14bb0f['body']['channelData'][_0x4458('0x19')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x4458('0x1a')};}if(_0x570b9c[_0x4458('0x1b')]){_0x14bb0f[_0x4458('0x1c')][_0x4458('0x17')][_0x4458('0x1d')]=_0x570b9c[_0x4458('0x1b')];if(_0x570b9c[_0x4458('0x1e')]){_0x14bb0f['body'][_0x4458('0x17')]['CustomActionData']=_0x570b9c[_0x4458('0x1e')];}}logger[_0x4458('0x1f')](JSON[_0x4458('0x20')](_0x14bb0f));return rp(_0x14bb0f);});}; \ 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 1c4afe8..254efb3 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 _0x4217=['./lib/api','exports'];(function(_0x24d33f,_0x6da94a){var _0x2bc689=function(_0x13dce4){while(--_0x13dce4){_0x24d33f['push'](_0x24d33f['shift']());}};_0x2bc689(++_0x6da94a);}(_0x4217,0x18a));var _0x7421=function(_0x58003d,_0x123eae){_0x58003d=_0x58003d-0x0;var _0x1af31c=_0x4217[_0x58003d];return _0x1af31c;};'use strict';var asr=require(_0x7421('0x0'));module[_0x7421('0x1')]=function(_0x35319e,_0x499130,_0x3516af,_0x526463){return asr(_0x35319e,_0x499130,_0x3516af,_0x526463);}; \ No newline at end of file +'use strict';var asr=require('./lib/api');module['exports']=function(_0xbe7691,_0x2c2408,_0x2bbb96,_0x3a9e1b){return asr(_0xbe7691,_0x2c2408,_0x2bbb96,_0x3a9e1b);}; \ 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 0f16451..a6be58d 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 _0x19aa=['sha1','update','digest','unix','createReadStream','data','close','send','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','stringify','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','bluebird','lodash','moment','agi','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech'];(function(_0x501e95,_0x52ebcb){var _0x956f02=function(_0x1062b6){while(--_0x1062b6){_0x501e95['push'](_0x501e95['shift']());}};_0x956f02(++_0x52ebcb);}(_0x19aa,0x102));var _0xa19a=function(_0x2c4ea3,_0x9e04ec){_0x2c4ea3=_0x2c4ea3-0x0;var _0x4b9336=_0x19aa[_0x2c4ea3];return _0x4b9336;};'use strict';var BPromise=require(_0xa19a('0x0'));var _=require(_0xa19a('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xa19a('0x2'));var crypto=require('crypto');var logger=require('../../../../../../config/logger')(_0xa19a('0x3'));module['exports']=function(_0x1f0ca6,_0x394c07,_0x3882d1,_0x19f8b9){return new BPromise(function(_0x3d4df8,_0x1763f7){logger[_0xa19a('0x4')](_0xa19a('0x5'),_0x19f8b9||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x996a1e=new WebSocket(_0x19f8b9||_0xa19a('0x6'),{'perMessageDeflate':![]});var _0x5e8ce5='';var _0x1f8931='0';var _0x1704e8='1';var _0x36a0e2=_0xa19a('0x7');function _0x1a44e2(_0x5dfade){var _0xcb0d70=crypto['createHash'](_0xa19a('0x8'));_0xcb0d70[_0xa19a('0x9')](_0x5dfade);return _0xcb0d70[_0xa19a('0xa')]('hex');}function _0x26dc3f(){try{logger[_0xa19a('0x4')]('Open\x20Tilde\x20ASR\x20socket');var _0x66fcca=moment()[_0xa19a('0xb')]();var _0x29a91f=_0x1a44e2(_0x66fcca+_0x394c07+_0x3882d1);_0x996a1e['send'](JSON['stringify']({'appID':_0x394c07,'timestamp':_0x66fcca,'appKey':_0x29a91f}));var _0x3ef909=fs[_0xa19a('0xc')](_0x1f0ca6);_0x3ef909['on'](_0xa19a('0xd'),function(_0x297f23){_0x996a1e['send'](_0x297f23);});_0x3ef909['on'](_0xa19a('0xe'),function(){_0x996a1e[_0xa19a('0xf')](_0xa19a('0x10'));});}catch(_0x32c4e0){logger[_0xa19a('0x11')](_0xa19a('0x12'),JSON['stringify'](_0x32c4e0));_0x996a1e[_0xa19a('0x13')]();}}function _0x9c073c(_0x3ac692){try{if(_0x3ac692){var _0x415405=JSON[_0xa19a('0x14')](_0x3ac692);switch(_0x415405[_0xa19a('0x15')]){case 0x0:if(_0x415405[_0xa19a('0x16')]){if(_0x415405['result'][_0xa19a('0x17')]){logger['info'](_0xa19a('0x18'),JSON['stringify'](_0x415405[_0xa19a('0x16')][_0xa19a('0x19')]));_0x5e8ce5=_0x415405[_0xa19a('0x16')][_0xa19a('0x19')][0x0][_0xa19a('0x1a')];_0x1f8931=_0x415405['result'][_0xa19a('0x19')][0x0][_0xa19a('0x1b')];_0x1704e8='0';_0x36a0e2='Success.';_0x996a1e[_0xa19a('0x13')]();}}break;case 0x1:logger['info'](_0xa19a('0x7'));_0x1704e8='1';_0x36a0e2='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger['info'](_0xa19a('0x1c'));_0x1704e8='2';_0x36a0e2=_0xa19a('0x1c');break;case 0x9:logger[_0xa19a('0x4')](_0xa19a('0x1d'));_0x1704e8='9';_0x36a0e2='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger['info']('Authentication\x20failed.');_0x1704e8='10';_0x36a0e2=_0xa19a('0x1e');break;case 0xb:logger[_0xa19a('0x4')](_0xa19a('0x1f'));_0x1704e8='11';_0x36a0e2=_0xa19a('0x1f');}}}catch(_0x1eaf7d){logger[_0xa19a('0x11')]('Tilde\x20ASR\x20parse\x20error',JSON[_0xa19a('0x20')](_0x1eaf7d));_0x996a1e[_0xa19a('0x13')]();}}function _0x285552(){logger[_0xa19a('0x4')](_0xa19a('0x21'));_0x3d4df8({'transcript':_0x5e8ce5,'confidence':_0x1f8931,'status':_0x1704e8,'status_message':_0x36a0e2});}function _0x27de05(_0x3dcea6){logger[_0xa19a('0x11')](_0xa19a('0x22'));if(!_[_0xa19a('0x23')](_0x3dcea6)){logger[_0xa19a('0x11')](_[_0xa19a('0x24')](_0x3dcea6)?JSON['stringify'](_0x3dcea6):_0x3dcea6);}}_0x996a1e['on'](_0xa19a('0x25'),_0x26dc3f);_0x996a1e['on']('message',_0x9c073c);_0x996a1e['on'](_0xa19a('0xe'),_0x285552);_0x996a1e['on'](_0xa19a('0x11'),_0x27de05);});}; \ No newline at end of file +var _0xcfa2=['Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','bluebird','crypto','../../../../../../config/logger','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','close','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','error'];(function(_0x5be92f,_0x140cb4){var _0x3d139f=function(_0x5f51f7){while(--_0x5f51f7){_0x5be92f['push'](_0x5be92f['shift']());}};_0x3d139f(++_0x140cb4);}(_0xcfa2,0x10f));var _0x2cfa=function(_0x568ef1,_0x239152){_0x568ef1=_0x568ef1-0x0;var _0x209ed6=_0xcfa2[_0x568ef1];return _0x209ed6;};'use strict';var BPromise=require(_0x2cfa('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0x2cfa('0x1'));var logger=require(_0x2cfa('0x2'))('agi');module['exports']=function(_0x12c101,_0x50b7bd,_0x22c141,_0x138261){return new BPromise(function(_0x3fe813,_0x3d33af){logger[_0x2cfa('0x3')]('Tilde\x20URI',_0x138261||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x2fe77c=new WebSocket(_0x138261||_0x2cfa('0x4'),{'perMessageDeflate':![]});var _0x494bee='';var _0x4ec3d3='0';var _0x328ba5='1';var _0x3d6e9f=_0x2cfa('0x5');function _0x137367(_0x1efa64){var _0x1e5b44=crypto[_0x2cfa('0x6')](_0x2cfa('0x7'));_0x1e5b44['update'](_0x1efa64);return _0x1e5b44[_0x2cfa('0x8')](_0x2cfa('0x9'));}function _0x27db4a(){try{logger['info'](_0x2cfa('0xa'));var _0x2f750d=moment()[_0x2cfa('0xb')]();var _0x140641=_0x137367(_0x2f750d+_0x50b7bd+_0x22c141);_0x2fe77c[_0x2cfa('0xc')](JSON[_0x2cfa('0xd')]({'appID':_0x50b7bd,'timestamp':_0x2f750d,'appKey':_0x140641}));var _0x44c1a6=fs[_0x2cfa('0xe')](_0x12c101);_0x44c1a6['on'](_0x2cfa('0xf'),function(_0x1c177d){_0x2fe77c[_0x2cfa('0xc')](_0x1c177d);});_0x44c1a6['on'](_0x2cfa('0x10'),function(){_0x2fe77c[_0x2cfa('0xc')]('EOS');});}catch(_0x495193){logger['error'](_0x2cfa('0x11'),JSON[_0x2cfa('0xd')](_0x495193));_0x2fe77c[_0x2cfa('0x12')]();}}function _0x175d2b(_0x183755){try{if(_0x183755){var _0x35327e=JSON[_0x2cfa('0x13')](_0x183755);switch(_0x35327e[_0x2cfa('0x14')]){case 0x0:if(_0x35327e[_0x2cfa('0x15')]){if(_0x35327e[_0x2cfa('0x15')][_0x2cfa('0x16')]){logger['info'](_0x2cfa('0x17'),JSON['stringify'](_0x35327e['result'][_0x2cfa('0x18')]));_0x494bee=_0x35327e[_0x2cfa('0x15')]['hypotheses'][0x0][_0x2cfa('0x19')];_0x4ec3d3=_0x35327e[_0x2cfa('0x15')][_0x2cfa('0x18')][0x0][_0x2cfa('0x1a')];_0x328ba5='0';_0x3d6e9f=_0x2cfa('0x1b');_0x2fe77c[_0x2cfa('0x12')]();}}break;case 0x1:logger[_0x2cfa('0x3')](_0x2cfa('0x5'));_0x328ba5='1';_0x3d6e9f=_0x2cfa('0x5');break;case 0x2:logger[_0x2cfa('0x3')](_0x2cfa('0x1c'));_0x328ba5='2';_0x3d6e9f=_0x2cfa('0x1c');break;case 0x9:logger[_0x2cfa('0x3')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x328ba5='9';_0x3d6e9f=_0x2cfa('0x1d');break;case 0xa:logger[_0x2cfa('0x3')]('Authentication\x20failed.');_0x328ba5='10';_0x3d6e9f=_0x2cfa('0x1e');break;case 0xb:logger[_0x2cfa('0x3')](_0x2cfa('0x1f'));_0x328ba5='11';_0x3d6e9f=_0x2cfa('0x1f');}}}catch(_0x38f8cd){logger[_0x2cfa('0x20')]('Tilde\x20ASR\x20parse\x20error',JSON[_0x2cfa('0xd')](_0x38f8cd));_0x2fe77c[_0x2cfa('0x12')]();}}function _0x1e67f7(){logger[_0x2cfa('0x3')](_0x2cfa('0x21'));_0x3fe813({'transcript':_0x494bee,'confidence':_0x4ec3d3,'status':_0x328ba5,'status_message':_0x3d6e9f});}function _0x2876c3(_0x5bc648){logger[_0x2cfa('0x20')](_0x2cfa('0x22'));if(!_[_0x2cfa('0x23')](_0x5bc648)){logger[_0x2cfa('0x20')](_[_0x2cfa('0x24')](_0x5bc648)?JSON[_0x2cfa('0xd')](_0x5bc648):_0x5bc648);}}_0x2fe77c['on'](_0x2cfa('0x25'),_0x27db4a);_0x2fe77c['on']('message',_0x175d2b);_0x2fe77c['on'](_0x2cfa('0x10'),_0x1e67f7);_0x2fe77c['on'](_0x2cfa('0x20'),_0x2876c3);});}; \ 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 391fbe6..73fdda4 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 _0x130e=['exports','./asr'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x130e,0x7b));var _0xe130=function(_0x8c050c,_0x513f9a){_0x8c050c=_0x8c050c-0x0;var _0x344363=_0x130e[_0x8c050c];return _0x344363;};var asr=require(_0xe130('0x0'));module[_0xe130('0x1')]={'asr':asr}; \ No newline at end of file +var _0xe903=['exports'];(function(_0x900f0f,_0x1d9fc5){var _0x388aba=function(_0x595c75){while(--_0x595c75){_0x900f0f['push'](_0x900f0f['shift']());}};_0x388aba(++_0x1d9fc5);}(_0xe903,0x183));var _0x3e90=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xe903[_0x4baae2];return _0x1a2285;};var asr=require('./asr');module[_0x3e90('0x0')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index fa8d676..77b69a8 100644 --- a/server/services/agi/server.js +++ b/server/services/agi/server.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','inherits','exports','util','net','events','EventEmitter','./channel','call','emit','error'];(function(_0x56e5b5,_0x1cc144){var _0x5086b7=function(_0x1125dd){while(--_0x1125dd){_0x56e5b5['push'](_0x56e5b5['shift']());}};_0x5086b7(++_0x1cc144);}(_0x34e8,0x12c));var _0x834e=function(_0x271cc5,_0x1a5f16){_0x271cc5=_0x271cc5-0x0;var _0x111169=_0x34e8[_0x271cc5];return _0x111169;};'use strict';var util=require(_0x834e('0x0'));var net=require(_0x834e('0x1'));var EventEmitter=require(_0x834e('0x2'))[_0x834e('0x3')];var AGIError=require('./error');var AGIChannel=require(_0x834e('0x4'));var AGIServer=function(_0x21e2e0,_0x472111,_0x31bf20){var _0x289ef2=this;var _0x19a3e0=null;var _0x398bee=0x0;if(!_0x21e2e0)_0x21e2e0=0x11dd;if(!_0x472111)_0x472111='127.0.0.1';EventEmitter[_0x834e('0x5')](_0x289ef2);function _0x52056d(){if(!_0x21e2e0){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0x8')));return![];}_0x19a3e0=net[_0x834e('0x9')]();_0x19a3e0[_0x834e('0xa')](_0x21e2e0,_0x472111);_0x19a3e0['on'](_0x834e('0xb'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xb'));});_0x19a3e0['on'](_0x834e('0xc'),function(_0x186b3b){_0x19a3e0[_0x834e('0xd')](function(_0x36e124,_0x14038b){if(_0x36e124){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x36e124));}else if(_0x31bf20&&_0x31bf20<0x0){_0x289ef2[_0x834e('0x6')]('error',new AGIError(_0x834e('0xf')));_0x186b3b[_0x834e('0x10')]();}else if(_0x31bf20&&_0x31bf20>0x0&&_0x31bf20<_0x14038b){_0x398bee+=0x1;_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0x11'),_0x398bee));_0x186b3b[_0x834e('0x10')]();}else{var _0x21cc0a=new AGIChannel(_0x186b3b);_0x21cc0a['on']('ready',function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xc'),_0x21cc0a);});}});});_0x19a3e0['on']('error',function(_0x316205){_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x316205['code']));});_0x19a3e0['on'](_0x834e('0x12'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0x12'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x834e('0x13')](function(){_0x52056d();});};util[_0x834e('0x14')](AGIServer,EventEmitter);module[_0x834e('0x15')]=function(_0xb993a1,_0x237947,_0x254677){return new AGIServer(_0xb993a1,_0x237947,_0x254677);}; \ No newline at end of file +var _0x9c44=['./error','./channel','127.0.0.1','call','emit','error','createServer','listen','listening','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','events','EventEmitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c44,0x178));var _0x49c4=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x9c44[_0x5608a3];return _0x1ed50a;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIError=require(_0x49c4('0x2'));var AGIChannel=require(_0x49c4('0x3'));var AGIServer=function(_0x455700,_0x2ad237,_0x4e0313){var _0x4941f1=this;var _0x41a183=null;var _0x57effd=0x0;if(!_0x455700)_0x455700=0x11dd;if(!_0x2ad237)_0x2ad237=_0x49c4('0x4');EventEmitter[_0x49c4('0x5')](_0x4941f1);function _0x69bc41(){if(!_0x455700){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x41a183=net[_0x49c4('0x8')]();_0x41a183[_0x49c4('0x9')](_0x455700,_0x2ad237);_0x41a183['on'](_0x49c4('0xa'),function(){_0x4941f1[_0x49c4('0x6')]('listening');});_0x41a183['on']('connection',function(_0x451ea6){_0x41a183[_0x49c4('0xb')](function(_0x58cad7,_0xb611a1){if(_0x58cad7){_0x4941f1[_0x49c4('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x58cad7));}else if(_0x4e0313&&_0x4e0313<0x0){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x451ea6[_0x49c4('0xc')]();}else if(_0x4e0313&&_0x4e0313>0x0&&_0x4e0313<_0xb611a1){_0x57effd+=0x1;_0x4941f1[_0x49c4('0x6')]('error',new AGIError(_0x49c4('0xd'),_0x57effd));_0x451ea6[_0x49c4('0xc')]();}else{var _0x21f15a=new AGIChannel(_0x451ea6);_0x21f15a['on'](_0x49c4('0xe'),function(){_0x4941f1[_0x49c4('0x6')](_0x49c4('0xf'),_0x21f15a);});}});});_0x41a183['on'](_0x49c4('0x7'),function(_0x3de397){_0x4941f1['emit'](_0x49c4('0x7'),new AGIError(_0x49c4('0x10'),_0x3de397[_0x49c4('0x11')]));});_0x41a183['on'](_0x49c4('0x12'),function(){_0x4941f1[_0x49c4('0x6')]('close',new AGIError(_0x49c4('0x13')));});}process[_0x49c4('0x14')](function(){_0x69bc41();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x3c782d,_0x2f82d5,_0x3addb2){return new AGIServer(_0x3c782d,_0x2f82d5,_0x3addb2);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 50bec2b..9143d14 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 _0x31af=['DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','username','no\x20username\x20configured','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','.wav','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','end','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','no\x20variable\x20selected\x20for\x20the\x20result','getData','response','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','unlink','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','NOBEEP','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','recordFile','tilde\x20%s\x20file\x20created','tildeASR','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','beep','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','ispeech\x20TTS\x20is\x20unreachable','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','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','\x22%s\x22\x20<%s>','email','subject','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','sms_text','debug','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','START\x20CALLY\x20SQUARE','XMCS-UNIQUEID','yes','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','googleCloudTTS','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','VOICEMAIL','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','exports','util','lodash','shelljs','moment','request-promise','../../config/logger','agi','../../config/environment','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getsecretdigits','rpc','mailRpc','prototype','getVariable','getVariableById','then','catch','getVoiceQueue','getVoiceQueueById','name','getSquareProject','getSquareOdbc','getUser','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','format','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','Error\x20executing\x20query\x20%s','info','Query\x20executed\x20correctly\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','channel','arg_1','callerid','createSquareRecording','calleridname','context','extension','priority','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','agentPause','agent','agentUnpause','agentLogout','agentLogin','LOCAL','shellCommand','exec','replace','apiKey','google_cloud_tts_text_type','text','languageCode','MALE','MP3','googleTTS','restAPI','url','method','timeout','number','POST','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','uri','render','headers','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','sestekNDA','ispeechTTS','speed','ispeechASR','ispeech_asr_language','en-US','isConfigured','model','awsPolly','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','awsLex','aws_access_key_id','aws_lex_region','aws_bot_name','googleASR','google_asr_language','appid','appsecret','clear','includes','clone','hasOwnProperty','replaceObjectAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','replaceAllVariables','saveRestApiResult','%s.%s','setVariable','split','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','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','wait','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','application','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','RECOG_CONFIDENCE()','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','database','no\x20database\x20selected','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20found','keys','forEach','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','sip_id','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','Dialogflow\x20is\x20unreachable','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','dialogflowV2_language','Trying\x20DialogflowV2:\x20%s','out','dialogflowV2'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x31af,0xde));var _0xf31a=function(_0x58ee64,_0x5c80fc){_0x58ee64=_0x58ee64-0x0;var _0x25dccb=_0x31af[_0x58ee64];return _0x25dccb;};'use strict';var fs=require('fs');var util=require(_0xf31a('0x0'));var _=require(_0xf31a('0x1'));var sh=require(_0xf31a('0x2'));var odbc=require('odbc')();var rs=require('randomstring');var moment=require(_0xf31a('0x3'));var Mustache=require('mustache');var rp=require(_0xf31a('0x4'));var logger=require(_0xf31a('0x5'))(_0xf31a('0x6'));var config=require(_0xf31a('0x7'));var scripts=require('./scripts');var FILES_PATH=_0xf31a('0x8');var recursiveMapAttributes=[_0xf31a('0x9'),_0xf31a('0xa')];var verticesWithRetry=[_0xf31a('0xb'),'getdigits',_0xf31a('0xc')];var AGIVertices=function(_0xe5778a,_0x410d44,_0xee6b4a){this['channel']=_0xe5778a;this[_0xf31a('0xd')]=_0x410d44;this[_0xf31a('0xe')]=_0xee6b4a;};AGIVertices[_0xf31a('0xf')][_0xf31a('0x10')]=function(_0xf2e284,_0x5165aa){this[_0xf31a('0xd')][_0xf31a('0x11')](_0xf2e284)[_0xf31a('0x12')](function(_0x3f0cc8){_0x5165aa(null,_0x3f0cc8?_0x3f0cc8['name']:![]);})[_0xf31a('0x13')](function(_0x26b85e){_0x5165aa(_0x26b85e);});};AGIVertices['prototype'][_0xf31a('0x14')]=function(_0x46345c,_0x46bdd3){this[_0xf31a('0xd')][_0xf31a('0x15')](_0x46345c)[_0xf31a('0x12')](function(_0x1d2d07){_0x46bdd3(null,_0x1d2d07?_0x1d2d07[_0xf31a('0x16')]:![]);})[_0xf31a('0x13')](function(_0x22522c){_0x46bdd3(_0x22522c);});};AGIVertices[_0xf31a('0xf')][_0xf31a('0x17')]=function(_0x3439ba,_0xccfd8b){this[_0xf31a('0xd')]['getSquareProjectById'](_0x3439ba)[_0xf31a('0x12')](function(_0x27e161){_0xccfd8b(null,_0x27e161?_0x27e161[_0xf31a('0x16')]:![]);})[_0xf31a('0x13')](function(_0x4c3589){_0xccfd8b(_0x4c3589);});};AGIVertices[_0xf31a('0xf')][_0xf31a('0x18')]=function(_0x204dc2,_0x208da3){this[_0xf31a('0xd')]['getSquareOdbcById'](_0x204dc2)[_0xf31a('0x12')](function(_0xd3ac94){_0x208da3(null,_0xd3ac94?_0xd3ac94['dsn']:![]);})[_0xf31a('0x13')](function(_0x504d13){_0x208da3(_0x504d13);});};AGIVertices['prototype'][_0xf31a('0x19')]=function(_0x7ce891,_0x54f9b5){this['rpc']['getUserById'](_0x7ce891)[_0xf31a('0x12')](function(_0x1e4dea){_0x54f9b5(null,_0x1e4dea?_0x1e4dea['name']:![]);})[_0xf31a('0x13')](function(_0x2a8a22){_0x54f9b5(_0x2a8a22);});};AGIVertices[_0xf31a('0xf')][_0xf31a('0x1a')]=function(_0x4c46d9,_0x5d8083){this[_0xf31a('0xd')][_0xf31a('0x1b')](_0x4c46d9)['then'](function(_0x4e115c){_0x5d8083(null,_0x4e115c?_0x4e115c['name']:![]);})['catch'](function(_0x14c82e){_0x5d8083(_0x14c82e);});};AGIVertices[_0xf31a('0xf')][_0xf31a('0x1c')]=function(_0x595db6,_0x2281c5){var _0x2ace06=this;this[_0xf31a('0xd')][_0xf31a('0x1d')](_0x595db6)[_0xf31a('0x12')](function(_0x5a55c6){_0x2281c5(null,_0x5a55c6?_0x2ace06[_0xf31a('0x1e')](_0x5a55c6[_0xf31a('0x1f')]):![]);})['catch'](function(_0x52da7d){_0x2281c5(_0x52da7d);});};AGIVertices[_0xf31a('0xf')][_0xf31a('0x20')]=function(_0x5c842e,_0x1bcfe6){this[_0xf31a('0xd')][_0xf31a('0x21')](_0x5c842e)['then'](function(_0x1d4d9b){_0x1bcfe6(null,_0x1d4d9b?_0x1d4d9b:![]);})[_0xf31a('0x13')](function(_0x289f27){_0x1bcfe6(_0x289f27);});};AGIVertices[_0xf31a('0xf')][_0xf31a('0x22')]=function(_0x19807c,_0x53ffb6,_0xcdf92){this[_0xf31a('0xe')][_0xf31a('0x22')](_0x19807c,_0x53ffb6)[_0xf31a('0x12')](function(){_0xcdf92(null);})[_0xf31a('0x13')](function(_0x42d1a6){_0xcdf92(_0x42d1a6);});};AGIVertices[_0xf31a('0xf')][_0xf31a('0x23')]=function(_0x17c5dc,_0x137ea4){this[_0xf31a('0xd')][_0xf31a('0x24')](_0x17c5dc)[_0xf31a('0x12')](function(_0x25cd42){if(_0x25cd42){if(_0x25cd42[_0xf31a('0x25')]){_0x137ea4(null,[_0x25cd42[_0xf31a('0x26')]]);}else{_0x137ea4(null,_[_0xf31a('0x27')](_0x25cd42[_0xf31a('0x28')],_0xf31a('0x26')));}}else{_0x137ea4(null,![]);}})['catch'](function(_0x2d81f3){_0x137ea4(_0x2d81f3);});};AGIVertices[_0xf31a('0xf')][_0xf31a('0x1e')]=function(_0x424db8){return util[_0xf31a('0x29')]('%s/sounds/converted/%s',FILES_PATH,_0x424db8);};AGIVertices[_0xf31a('0xf')][_0xf31a('0x2a')]=function(_0xe8e0e0,_0x5820e6,_0x474cfc){odbc[_0xf31a('0x2b')](_0xe8e0e0,function(_0xe141dd){if(_0xe141dd){logger[_0xf31a('0x2c')](_0xf31a('0x2d'),_0xe141dd);_0x474cfc(_0xe141dd);}else{logger['info'](_0xf31a('0x2e'));odbc['query'](_0x5820e6,function(_0x44321d,_0x129409){if(_0x44321d){logger['info'](_0xf31a('0x2f'),_0x5820e6);_0x474cfc(_0x44321d);}else{logger[_0xf31a('0x30')](_0xf31a('0x31'),_0x5820e6);odbc['close'](function(_0x5d1176){if(_0x5d1176){logger[_0xf31a('0x2c')](_0xf31a('0x32'),_0x5d1176);}_0x474cfc(null,_0x129409);});}});}});};AGIVertices[_0xf31a('0xf')][_0xf31a('0x33')]=function(_0x2a240d,_0x46587e){this[_0xf31a('0xd')][_0xf31a('0x34')](_0x2a240d)['then'](function(_0x3b4aef){_0x46587e(null,_0x3b4aef?_0x3b4aef:![]);})[_0xf31a('0x13')](function(_0x4ac009){_0x46587e(_0x4ac009);});};AGIVertices[_0xf31a('0xf')][_0xf31a('0x35')]=function(_0x1085c2,_0x44b30b){this['rpc'][_0xf31a('0x35')](_0x1085c2)[_0xf31a('0x12')](function(_0x306415){_0x44b30b(null,_0x306415);})[_0xf31a('0x13')](function(_0x529814){_0x44b30b(_0x529814);});};AGIVertices[_0xf31a('0xf')]['createSquareDetailsReport']=function(_0x303066,_0x172e1c,_0x1ef487){this['rpc'][_0xf31a('0x36')]({'uniqueid':this['channel'][_0xf31a('0x37')],'node':_0x303066[_0xf31a('0x38')],'application':_0x303066[_0xf31a('0x39')],'data':_0x172e1c||null,'project_name':this[_0xf31a('0x3a')][_0xf31a('0x3b')],'callerid':this[_0xf31a('0x3a')][_0xf31a('0x3c')]})[_0xf31a('0x12')](function(_0x344649){if(_0x1ef487){_0x1ef487(null,_0x344649);}})['catch'](function(_0x1a9f36){if(_0x1ef487){_0x1ef487(_0x1a9f36);}});};AGIVertices[_0xf31a('0xf')][_0xf31a('0x3d')]=function(_0x38d568,_0x82885d,_0x12cf9b,_0x2a2459){this['rpc']['createSquareRecording']({'uniqueid':this[_0xf31a('0x3a')][_0xf31a('0x37')],'callerid':this[_0xf31a('0x3a')][_0xf31a('0x3c')],'calleridname':this[_0xf31a('0x3a')][_0xf31a('0x3e')],'context':this['channel'][_0xf31a('0x3f')],'extension':this[_0xf31a('0x3a')][_0xf31a('0x40')],'priority':this[_0xf31a('0x3a')][_0xf31a('0x41')],'accountcode':this[_0xf31a('0x3a')]['accountcode'],'dnid':this[_0xf31a('0x3a')][_0xf31a('0x42')],'projectName':this[_0xf31a('0x3a')][_0xf31a('0x3b')],'saveName':_0x82885d,'filename':_0x38d568[_0xf31a('0x43')]||_0x82885d,'savePath':_0x12cf9b})[_0xf31a('0x12')](function(_0x20bd0c){_0x2a2459(null,_0x20bd0c);})[_0xf31a('0x13')](function(_0x1f8161){_0x2a2459(_0x1f8161);});};AGIVertices[_0xf31a('0xf')]['createSquareMessage']=function(_0x2f1b64,_0x4d17fc,_0x423768,_0x3f8b9b,_0xa9b74c){this[_0xf31a('0xd')][_0xf31a('0x44')]({'uniqueid':this[_0xf31a('0x3a')][_0xf31a('0x37')],'body':_0x2f1b64,'direction':_0x4d17fc,'providerName':_0x423768,'providerResponse':_0x3f8b9b})[_0xf31a('0x12')](function(_0x4aaa57){if(_0xa9b74c){_0xa9b74c(null,_0x4aaa57);}})[_0xf31a('0x13')](function(_0x416227){if(_0xa9b74c){_0xa9b74c(_0x416227);}});};AGIVertices[_0xf31a('0xf')][_0xf31a('0x45')]=function(_0x3877f8,_0x8c6795){this['rpc'][_0xf31a('0x45')]({'firstName':_[_0xf31a('0x46')](_0x3877f8[_0xf31a('0x16')])||_[_0xf31a('0x47')](_0x3877f8[_0xf31a('0x16')])?_0xf31a('0x48')+Math[_0xf31a('0x49')]():_0x3877f8[_0xf31a('0x16')],'lastName':_[_0xf31a('0x46')](_0x3877f8[_0xf31a('0x4a')])||_[_0xf31a('0x47')](_0x3877f8[_0xf31a('0x4a')])?null:_0x3877f8['lastName'],'phone':_0x3877f8[_0xf31a('0x4b')],'ListId':_0x3877f8[_0xf31a('0x4c')],'scheduledat':_0x3877f8[_0xf31a('0x4d')],'callbackUniqueid':this['channel'][_0xf31a('0x37')],'tags':'callback','description':_0xf31a('0x4e')+_0x3877f8[_0xf31a('0x4d')][_0xf31a('0x4f')](),'priority':_0x3877f8[_0xf31a('0x50')]})['then'](function(_0x89bdd){_0x8c6795(null,_0x89bdd);})[_0xf31a('0x13')](function(_0x2ebd69){_0x8c6795(_0x2ebd69);});};AGIVertices[_0xf31a('0xf')][_0xf31a('0x51')]=function(_0x10eb82,_0x5579c6){this[_0xf31a('0xd')]['getPauseById'](_0x10eb82)['then'](function(_0x5d2700){_0x5579c6(null,_0x5d2700?_0x5d2700[_0xf31a('0x16')]:![]);})[_0xf31a('0x13')](function(_0x501409){_0x5579c6(_0x501409);});};AGIVertices['prototype'][_0xf31a('0x52')]=function(_0x292b58,_0xfd1cf7,_0x4bc18c){var _0x4b9586={'role':_0xf31a('0x53')};_0x4b9586[_0x292b58]=this[_0xf31a('0x3a')][_0xf31a('0x3c')];this[_0xf31a('0xd')][_0xf31a('0x52')](_0x4b9586,_0xfd1cf7,this[_0xf31a('0x3a')]['uniqueid'])[_0xf31a('0x12')](function(_0x4e8669){_0x4bc18c(null,_[_0xf31a('0x47')](_0x4e8669)?![]:!![]);})[_0xf31a('0x13')](function(_0x73c0a1){logger['error'](_0x73c0a1);_0x4bc18c(null,![]);});};AGIVertices[_0xf31a('0xf')][_0xf31a('0x54')]=function(_0x24be18,_0xcf0f0b){var _0x122b6d={'role':_0xf31a('0x53')};_0x122b6d[_0x24be18]=this[_0xf31a('0x3a')][_0xf31a('0x3c')];this['rpc'][_0xf31a('0x54')](_0x122b6d)['then'](function(_0x29aeb9){_0xcf0f0b(null,_['isNil'](_0x29aeb9)?![]:!![]);})[_0xf31a('0x13')](function(_0x11cd2b){logger[_0xf31a('0x2c')](_0x11cd2b);_0xcf0f0b(null,![]);});};AGIVertices[_0xf31a('0xf')]['agentLogout']=function(_0x3e109a,_0x21548d){var _0x694196={'role':_0xf31a('0x53')};_0x694196[_0x3e109a]=this[_0xf31a('0x3a')][_0xf31a('0x3c')];this[_0xf31a('0xd')][_0xf31a('0x55')](_0x694196)[_0xf31a('0x12')](function(_0xb2e809){_0x21548d(null,_[_0xf31a('0x47')](_0xb2e809)?![]:!![]);})[_0xf31a('0x13')](function(_0x41f206){logger['error'](_0x41f206);_0x21548d(null,![]);});};AGIVertices[_0xf31a('0xf')][_0xf31a('0x56')]=function(_0x55695a,_0x4558d8){var _0x37b704={'role':'agent'};_0x37b704[_0x55695a]=this[_0xf31a('0x3a')][_0xf31a('0x3c')];var _0x50e484=_0x55695a!='internal'?util['format']('%s/%s@from-sip/n',_0xf31a('0x57'),this[_0xf31a('0x3a')][_0xf31a('0x3c')]):undefined;this[_0xf31a('0xd')][_0xf31a('0x56')](_0x37b704,_0x50e484)[_0xf31a('0x12')](function(_0x560b8d){_0x4558d8(null,_[_0xf31a('0x47')](_0x560b8d)?![]:!![]);})[_0xf31a('0x13')](function(_0x12e5a1){logger[_0xf31a('0x2c')](_0x12e5a1);_0x4558d8(null,![]);});};AGIVertices[_0xf31a('0xf')][_0xf31a('0x58')]=function(_0x12dca4,_0x2bcc4f){sh[_0xf31a('0x59')](_['trim'](_0x12dca4),function(_0x7e978c,_0x53b8e0){var _0x293e14=_0x53b8e0[_0xf31a('0x5a')](/(\r\n|\n|\r)/gm,'');_0x2bcc4f(null,_0x293e14);});};AGIVertices['prototype']['googleCloudTTS']=function(_0x5e7abf,_0x81361f){scripts['googleCloudTTS'](_0x5e7abf[_0xf31a('0x5b')],_0x5e7abf[_0xf31a('0x5c')]||'text',_0x5e7abf[_0xf31a('0x5d')],_0x5e7abf[_0xf31a('0x5e')]||'en-US',_0x5e7abf['ssmlGender']||_0xf31a('0x5f'),_0x5e7abf['audioEncoding']||_0xf31a('0x60'))[_0xf31a('0x12')](function(_0x4eab0e){_0x81361f(null,_0x4eab0e);})['catch'](function(_0x3fc2bb){_0x81361f(_0x3fc2bb);});};AGIVertices[_0xf31a('0xf')][_0xf31a('0x61')]=function(_0x5787e8,_0x49986e){scripts['googleTTS'](_0x5787e8[_0xf31a('0x5d')],_0x5787e8['google_tts_language']||'en',0x1)['then'](function(_0x49435b){_0x49986e(null,_0x49435b);})[_0xf31a('0x13')](function(_0x48de0c){_0x49986e(_0x48de0c);});};AGIVertices[_0xf31a('0xf')][_0xf31a('0x62')]=function(_0x38e3c7,_0x22bb77){var _0x4452a6={'uri':_0x38e3c7[_0xf31a('0x63')],'method':_0x38e3c7[_0xf31a('0x64')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x38e3c7[_0xf31a('0x65')])===_0xf31a('0x66')&&parseInt(_0x38e3c7[_0xf31a('0x65')])>=0x1?parseInt(_0x38e3c7[_0xf31a('0x65')])*0x3e8:0x5*0x3e8};if(_['includes']([_0xf31a('0x67'),'PUT'],_0x4452a6['method'][_0xf31a('0x68')]())){try{_0x4452a6[_0xf31a('0x69')]=_0x38e3c7[_0xf31a('0xa')]?JSON[_0xf31a('0x6a')](_0x38e3c7[_0xf31a('0xa')]):{};}catch(_0x2b3019){logger[_0xf31a('0x2c')](_0xf31a('0x6b'),_0x2b3019);}}try{_0x4452a6['headers']=_0x38e3c7[_0xf31a('0x9')]?JSON[_0xf31a('0x6a')](_0x38e3c7[_0xf31a('0x9')]):{};}catch(_0x4933e0){logger[_0xf31a('0x2c')](_0xf31a('0x6c'),_0x4933e0);}if(_0x38e3c7['computedVariables']){try{var _0x31b51a=require(_0x38e3c7[_0xf31a('0x6d')])[_0xf31a('0x6e')](this,_0x4452a6);_0x4452a6[_0xf31a('0x6f')]=Mustache[_0xf31a('0x70')](_0x38e3c7[_0xf31a('0x63')],_0x31b51a,{},['$$','$$']);if(_0x4452a6['headers']){_0x4452a6[_0xf31a('0x71')]=JSON[_0xf31a('0x6a')](Mustache[_0xf31a('0x70')](JSON[_0xf31a('0x72')](_0x4452a6['headers']),_0x31b51a,{},['$$','$$']));}if(_0x4452a6['body']){_0x4452a6[_0xf31a('0x69')]=JSON[_0xf31a('0x6a')](Mustache[_0xf31a('0x70')](JSON[_0xf31a('0x72')](_0x4452a6[_0xf31a('0x69')]),_0x31b51a,{},['$$','$$']));}}catch(_0x3a772d){logger['error'](_0xf31a('0x73'),_0x3a772d);}}rp(_0x4452a6)[_0xf31a('0x12')](function(_0x1fd44e){var _0xba3819={'statusCode':_0x1fd44e[_0xf31a('0x74')]||0xc8,'statusMessage':_0x1fd44e[_0xf31a('0x75')]||'OK','headers':_0x1fd44e[_0xf31a('0x71')]||{},'body':_0x1fd44e[_0xf31a('0x69')]||{}};_0x22bb77(null,_0xba3819);})['catch'](function(_0x583d4a){var _0x55a76e={'statusCode':_0x583d4a[_0xf31a('0x74')]||0x1f4,'statusMessage':_0x583d4a[_0xf31a('0x76')]||_0xf31a('0x77'),'headers':_0x583d4a['options'][_0xf31a('0x71')]||{},'body':_0x583d4a[_0xf31a('0x78')][_0xf31a('0x69')]||{}};_0x22bb77(null,_0x55a76e);});};AGIVertices[_0xf31a('0xf')]['googleDialogflow']=function(_0x573fbd,_0x381d42){scripts['googleDialogflow'](this[_0xf31a('0x3a')]['uniqueid'],_0x573fbd[_0xf31a('0x79')],_0x573fbd[_0xf31a('0x5d')],_0x573fbd[_0xf31a('0x7a')]||'en')[_0xf31a('0x12')](function(_0xd21867){_0x381d42(null,_0xd21867);})['catch'](function(_0x351733){_0x381d42(_0x351733);});};AGIVertices[_0xf31a('0xf')][_0xf31a('0x7b')]=function(_0x50bbba,_0x1fdb59){scripts[_0xf31a('0x7b')](this[_0xf31a('0x3a')]['uniqueid'],_0x50bbba[_0xf31a('0x7c')],_0x50bbba[_0xf31a('0x7d')],_0x50bbba[_0xf31a('0x7e')],_0x50bbba[_0xf31a('0x5d')],_0x50bbba['dialogflowV2_language']||'en')[_0xf31a('0x12')](function(_0x31b6ee){_0x1fdb59(null,_0x31b6ee);})['catch'](function(_0x512855){_0x1fdb59(_0x512855);});};AGIVertices[_0xf31a('0xf')][_0xf31a('0x7f')]=function(_0x5515e6,_0x1b5c7e){scripts['sestekNDA'](this[_0xf31a('0x3a')],_0x5515e6)[_0xf31a('0x12')](function(_0x3bf3f4){_0x1b5c7e(null,_0x3bf3f4);})['catch'](function(_0x3c7519){_0x1b5c7e(_0x3c7519);});};AGIVertices[_0xf31a('0xf')][_0xf31a('0x80')]=function(_0xbf3985,_0x1b28c5){scripts[_0xf31a('0x80')](_0xbf3985[_0xf31a('0x79')],_0xbf3985['text'],_0xbf3985['ispeech_tts_language']||'en-US',_0xbf3985[_0xf31a('0x81')])[_0xf31a('0x12')](function(_0x2bba06){_0x1b28c5(null,_0x2bba06);})[_0xf31a('0x13')](function(_0x360baf){_0x1b28c5(_0x360baf);});};AGIVertices[_0xf31a('0xf')][_0xf31a('0x82')]=function(_0xe178c3,_0x163780,_0x4bd014){scripts[_0xf31a('0x82')](_0x163780,_0xe178c3[_0xf31a('0x79')],_0xe178c3[_0xf31a('0x83')]||_0xf31a('0x84'),this[_0xf31a('0x85')](_0xe178c3[_0xf31a('0x86')])?_0xe178c3[_0xf31a('0x86')]:undefined)[_0xf31a('0x12')](function(_0x168ebe){_0x4bd014(null,_0x168ebe);})[_0xf31a('0x13')](function(_0x394a38){_0x4bd014(_0x394a38);});};AGIVertices[_0xf31a('0xf')][_0xf31a('0x87')]=function(_0x4e3223,_0x3849d9){scripts[_0xf31a('0x87')](_0x4e3223['aws_access_key_id'],_0x4e3223[_0xf31a('0x88')],_0x4e3223[_0xf31a('0x89')],_0x4e3223[_0xf31a('0x8a')]||_0xf31a('0x8b'),_0x4e3223['text'],_0x4e3223['aws_text_type']||_0xf31a('0x5d'))[_0xf31a('0x12')](function(_0x11d390){_0x3849d9(null,_0x11d390);})[_0xf31a('0x13')](function(_0x4ea997){_0x3849d9(_0x4ea997);});};AGIVertices['prototype']['awsLex']=function(_0x5815f3,_0x46d39a){scripts[_0xf31a('0x8c')](this[_0xf31a('0x3a')][_0xf31a('0x37')],_0x5815f3[_0xf31a('0x8d')],_0x5815f3[_0xf31a('0x88')],_0x5815f3[_0xf31a('0x8e')],_0x5815f3[_0xf31a('0x5d')],_0x5815f3[_0xf31a('0x8f')])[_0xf31a('0x12')](function(_0x17183b){_0x46d39a(null,_0x17183b);})[_0xf31a('0x13')](function(_0x109b70){_0x46d39a(_0x109b70);});};AGIVertices['prototype'][_0xf31a('0x90')]=function(_0x1452e0,_0x4a3959,_0x4c79bd){scripts['googleASR'](_0x4a3959,_0x1452e0[_0xf31a('0x79')],_0x1452e0[_0xf31a('0x91')]||'en-US')[_0xf31a('0x12')](function(_0x524d15){_0x4c79bd(null,_0x524d15);})[_0xf31a('0x13')](function(_0x41a9f9){_0x4c79bd(_0x41a9f9);});};AGIVertices[_0xf31a('0xf')]['tildeASR']=function(_0x1b7365,_0x2f00d0,_0x43015d){scripts['tildeASR'](_0x2f00d0,_0x1b7365[_0xf31a('0x92')],_0x1b7365[_0xf31a('0x93')],_0x1b7365['uri'])[_0xf31a('0x12')](function(_0x9b47e5){_0x43015d(null,_0x9b47e5);})[_0xf31a('0x13')](function(_0x5c0ce2){_0x43015d(_0x5c0ce2);});};AGIVertices['prototype'][_0xf31a('0x94')]=function(_0x5a6036){var _0x26dcc3=_[_0xf31a('0x95')](verticesWithRetry,_0x5a6036['agicommand'])?_0x5a6036:_[_0xf31a('0x96')](_0x5a6036);for(var _0x44e8dc in _0x26dcc3){if(_0x26dcc3[_0xf31a('0x97')](_0x44e8dc)){if(_0x26dcc3[_0x44e8dc]&&_['isString'](_0x26dcc3[_0x44e8dc])){if(_['includes'](recursiveMapAttributes,_0x44e8dc)){_0x26dcc3[_0x44e8dc]=this[_0xf31a('0x98')](_0x26dcc3[_0x44e8dc]);}else{_0x26dcc3[_0x44e8dc]=this['replaceAllVariables'](_0x26dcc3[_0x44e8dc]);}}}}return _0x26dcc3;};AGIVertices[_0xf31a('0xf')][_0xf31a('0x99')]=function(_0x48c0f6){for(var _0x340d5a in _0x48c0f6){if(_0x48c0f6[_0xf31a('0x97')](_0x340d5a)){if(_[_0xf31a('0x9a')](_0x48c0f6[_0x340d5a])){this[_0xf31a('0x99')](_0x48c0f6[_0x340d5a]);}else if(_[_0xf31a('0x9b')](_0x48c0f6[_0x340d5a])){for(var _0x24de43=0x0;_0x24de43<_0x48c0f6[_0x340d5a][_0xf31a('0x9c')];_0x24de43++){this[_0xf31a('0x99')](_0x48c0f6[_0x340d5a][_0x24de43]);}}else if(_['isString'](_0x48c0f6[_0x340d5a])){_0x48c0f6[_0x340d5a]=this[_0xf31a('0x9d')](_0x48c0f6[_0x340d5a]);}}}};AGIVertices[_0xf31a('0xf')][_0xf31a('0x9e')]=function(_0x5ae195,_0x47fa1e){for(var _0x44872a in _0x5ae195){if(_0x5ae195[_0xf31a('0x97')](_0x44872a)){if(_[_0xf31a('0x9a')](_0x5ae195[_0x44872a])){if(!_[_0xf31a('0x46')](_0x5ae195[_0x44872a])){this['saveRestApiResult'](_0x5ae195[_0x44872a],util[_0xf31a('0x29')]('%s.%s',_0x47fa1e,_0x44872a));}}else if(_[_0xf31a('0x9b')](_0x5ae195[_0x44872a])){for(var _0x1b9f29=0x0;_0x1b9f29<_0x5ae195[_0x44872a][_0xf31a('0x9c')];_0x1b9f29++){this[_0xf31a('0x9e')](_0x5ae195[_0x44872a][_0x1b9f29],util['format'](_0xf31a('0x9f'),_0x47fa1e,_0x44872a+'['+_0x1b9f29+']'));}}else{if(!_['isNil'](_0x5ae195[_0x44872a])){this[_0xf31a('0x3a')][_0xf31a('0xa0')](util[_0xf31a('0x29')](_0xf31a('0x9f'),_0x47fa1e,_0x44872a),_0x5ae195[_0x44872a]);}}}}};AGIVertices[_0xf31a('0xf')]['replaceObjectAllVariables']=function(_0x1a08bb){try{var _0x84220=JSON[_0xf31a('0x6a')](_0x1a08bb);this['recursiveNodeIndex'](_0x84220);return JSON[_0xf31a('0x72')](_0x84220);}catch(_0x1c5fc1){return this[_0xf31a('0x9d')](_0x1a08bb);}};AGIVertices[_0xf31a('0xf')]['replaceAllVariables']=function(_0x2adb41){var _0x2bb68e=_0x2adb41['split']('{');for(var _0x54de42=0x1;_0x54de42<_0x2bb68e['length'];_0x54de42+=0x1){var _0x24f3f2=_0x2bb68e[_0x54de42][_0xf31a('0xa1')]('}');if(_0x24f3f2[_0xf31a('0x9c')]>0x1){_0x2adb41=_0x2adb41[_0xf31a('0xa2')]('{'+_0x24f3f2[0x0]+'}',this[_0xf31a('0x3a')]['getVariable'](_0x24f3f2[0x0])[_0xf31a('0xa3')]||_0x24f3f2[0x0]);}}if(_0x2bb68e[_0xf31a('0x9c')]===0x1){return _0x2adb41[_0xf31a('0x4f')]();}return this['replaceAllVariables'](_0x2adb41);};AGIVertices[_0xf31a('0xf')][_0xf31a('0xa4')]=function(_0x1008c4,_0x109240){var _0x4c6cb0=this['channel']['getVariable'](_0x1008c4);if(_0x4c6cb0[_0xf31a('0xa5')]===-0x1){return _0x4c6cb0;}logger[_0xf31a('0x30')](util['format'](_0xf31a('0xa6'),_0x109240,_0x4c6cb0[_0xf31a('0xa3')]));return this[_0xf31a('0x3a')][_0xf31a('0xa0')](_0x109240,_0x4c6cb0['extra']);};AGIVertices[_0xf31a('0xf')][_0xf31a('0x85')]=function(_0x15d0bf){return _0x15d0bf&&_0x15d0bf!=='0'&&_0x15d0bf!=='-1'&&_0x15d0bf!=='';};AGIVertices[_0xf31a('0xf')][_0xf31a('0xa7')]=function(_0x15702f){this[_0xf31a('0x36')][_0xf31a('0x6e')](this,_0x15702f,'-');_0x15702f['retry']=_0x15702f[_0xf31a('0xa7')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xf31a('0xf')][_0xf31a('0xa8')]=function(_0x4a4945){logger[_0xf31a('0x30')](util[_0xf31a('0x29')](_0xf31a('0xa9'),_0x4a4945[_0xf31a('0x38')]));if(!this['isConfigured'](_0x4a4945[_0xf31a('0x5d')])){return this[_0xf31a('0x3a')][_0xf31a('0xaa')](_0xf31a('0xab'));}var _0x5fa7c9='\x22'+_0x4a4945['text']+'\x22';if(this['isConfigured'](_0x4a4945[_0xf31a('0x78')])){_0x5fa7c9+=','+_0x4a4945[_0xf31a('0x78')];}var _0x3a5582=this[_0xf31a('0x3a')][_0xf31a('0x59')](_0xf31a('0xac'),_0x5fa7c9);if(_0x3a5582[_0xf31a('0xa5')]===-0x1){return _0x3a5582;}return this[_0xf31a('0x3a')]['noop'](util[_0xf31a('0x29')](_0xf31a('0xad'),_0x5fa7c9));};AGIVertices[_0xf31a('0xf')][_0xf31a('0xae')]=function(_0x15ba20){logger['info'](util[_0xf31a('0x29')](_0xf31a('0xaf'),_0x15ba20[_0xf31a('0x38')]));if(!this[_0xf31a('0x85')](_0x15ba20[_0xf31a('0xb0')])){return this[_0xf31a('0x3a')]['noop'](_0xf31a('0xb1'));}var _0x443594=_0x15ba20[_0xf31a('0xb0')];if(this[_0xf31a('0x85')](_0x15ba20[_0xf31a('0x78')])){_0x443594+=','+_0x15ba20['options'];}var _0x31dea5=this[_0xf31a('0x3a')][_0xf31a('0x59')](_0xf31a('0xb2'),_0x443594);if(_0x31dea5[_0xf31a('0xa5')]===-0x1){return _0x31dea5;}var _0x32837f=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0xf31a('0xb3'));if(_0x32837f[_0xf31a('0xa5')]===-0x1){return _0x32837f;}var _0x589f59=this[_0xf31a('0xa4')](_0xf31a('0xb4'),_0xf31a('0xb5'));if(_0x589f59[_0xf31a('0xa5')]===-0x1){return _0x589f59;}var _0x537cf9=this[_0xf31a('0xa4')](_0xf31a('0xb6'),_0xf31a('0xb7'));if(_0x537cf9[_0xf31a('0xa5')]===-0x1){return _0x537cf9;}return this[_0xf31a('0x3a')][_0xf31a('0xaa')](util[_0xf31a('0x29')](_0xf31a('0xb8'),_0x443594));};AGIVertices[_0xf31a('0xf')][_0xf31a('0x6')]=function(_0xa357eb){logger[_0xf31a('0x30')](util[_0xf31a('0x29')](_0xf31a('0xb9'),_0xa357eb['label']));return this['channel'][_0xf31a('0x6')]([_0xa357eb['command'],_0xa357eb['args']]);};AGIVertices[_0xf31a('0xf')][_0xf31a('0xba')]=function(_0x179f62){logger[_0xf31a('0x30')](util[_0xf31a('0x29')](_0xf31a('0xbb'),_0x179f62['label']));if(this[_0xf31a('0x85')](_0x179f62['timeout'])){logger[_0xf31a('0x30')](util[_0xf31a('0x29')](_0xf31a('0xbc'),_0x179f62[_0xf31a('0x65')]));var _0x3637c2=this['channel'][_0xf31a('0xbd')](_0x179f62[_0xf31a('0x65')]);if(_0x3637c2[_0xf31a('0xa5')]===-0x1){return _0x3637c2;}}return this[_0xf31a('0x3a')][_0xf31a('0xba')]();};AGIVertices['prototype'][_0xf31a('0xbe')]=function(_0x8cce99){logger[_0xf31a('0x30')](util[_0xf31a('0x29')](_0xf31a('0xbf'),_0x8cce99[_0xf31a('0x38')]));if(!this['isConfigured'](_0x8cce99['list_id'])){return this[_0xf31a('0x3a')][_0xf31a('0x2c')](_0x8cce99,'no\x20list\x20selected');}_0x8cce99[_0xf31a('0x4d')]=moment();if(this[_0xf31a('0x85')](_0x8cce99[_0xf31a('0xc0')])){_0x8cce99[_0xf31a('0x4d')]=moment()[_0xf31a('0xc1')](_0x8cce99['delay'],_0xf31a('0xc2'));}if(!this['isConfigured'](_0x8cce99[_0xf31a('0x50')])){_0x8cce99[_0xf31a('0x50')]=0x2;}this['createCmContact'][_0xf31a('0x6e')](this,_0x8cce99);return this[_0xf31a('0x3a')][_0xf31a('0xaa')](util['format'](_0xf31a('0xc3'),_0x8cce99[_0xf31a('0x4b')],_0x8cce99['list_id'],_0x8cce99[_0xf31a('0x4d')]));};AGIVertices['prototype']['custom_app']=function(_0x3c8549){logger['info'](util[_0xf31a('0x29')](_0xf31a('0xc4'),_0x3c8549[_0xf31a('0x38')]));var _0x89fcd4=this[_0xf31a('0x3a')][_0xf31a('0x59')](_0x3c8549['application'],_0x3c8549['options']);if(_0x89fcd4[_0xf31a('0xa5')]===-0x1){return _0x89fcd4;}return this[_0xf31a('0x3a')][_0xf31a('0xaa')](util['format'](_0xf31a('0xc5'),_0x3c8549[_0xf31a('0xc6')],_0x3c8549[_0xf31a('0x78')]));};AGIVertices[_0xf31a('0xf')]['lumenvoxtts']=function(_0x476865){logger[_0xf31a('0x30')](util[_0xf31a('0x29')](_0xf31a('0xc7'),_0x476865[_0xf31a('0x38')]));if(!this[_0xf31a('0x85')](_0x476865[_0xf31a('0x5d')])){return this[_0xf31a('0x3a')][_0xf31a('0xaa')](_0xf31a('0xab'));}var _0xc49c9f='\x22'+_0x476865['text']+'\x22';if(this[_0xf31a('0x85')](_0x476865['options'])){_0xc49c9f+=','+_0x476865[_0xf31a('0x78')];}var _0x246d4f=this[_0xf31a('0x3a')][_0xf31a('0x59')](_0xf31a('0xac'),_0xc49c9f);if(_0x246d4f[_0xf31a('0xa5')]===-0x1){return _0x246d4f;}return this['channel'][_0xf31a('0xaa')](util['format'](_0xf31a('0xad'),_0xc49c9f));};AGIVertices[_0xf31a('0xf')][_0xf31a('0xc8')]=function(_0x519b33){logger['info'](util[_0xf31a('0x29')](_0xf31a('0xc9'),_0x519b33['label']));if(!this['isConfigured'](_0x519b33['text'])){return this[_0xf31a('0x3a')][_0xf31a('0xaa')](_0xf31a('0xab'));}var _0x17e99c='\x22'+_0x519b33[_0xf31a('0x5d')]+'\x22';if(this[_0xf31a('0x85')](_0x519b33[_0xf31a('0x78')])){_0x17e99c+=','+_0x519b33[_0xf31a('0x78')];}var _0x5d833a=this[_0xf31a('0x3a')][_0xf31a('0x59')](_0xf31a('0xac'),_0x17e99c);if(_0x5d833a['result']===-0x1){return _0x5d833a;}return this[_0xf31a('0x3a')][_0xf31a('0xaa')](util[_0xf31a('0x29')](_0xf31a('0xad'),_0x17e99c));};AGIVertices[_0xf31a('0xf')]['lumenvoxasr']=function(_0x45fac1){logger[_0xf31a('0x30')](util[_0xf31a('0x29')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x45fac1[_0xf31a('0x38')]));if(!this['isConfigured'](_0x45fac1[_0xf31a('0xb0')])){return this['channel'][_0xf31a('0xaa')](_0xf31a('0xb1'));}var _0x742459=_0x45fac1[_0xf31a('0xb0')];if(this[_0xf31a('0x85')](_0x45fac1[_0xf31a('0x78')])){_0x742459+=','+_0x45fac1[_0xf31a('0x78')];}var _0x4bfd2f=this['channel'][_0xf31a('0x59')](_0xf31a('0xb2'),_0x742459);if(_0x4bfd2f[_0xf31a('0xa5')]===-0x1){return _0x4bfd2f;}var _0x111e1c=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0xf31a('0xca'));if(_0x111e1c[_0xf31a('0xa5')]===-0x1){return _0x111e1c;}var _0x4ad44e=this['getAndSetVariable'](_0xf31a('0xb4'),_0xf31a('0xcb'));if(_0x4ad44e['result']===-0x1){return _0x4ad44e;}var _0x5853a2=this[_0xf31a('0xa4')](_0xf31a('0xb6'),_0xf31a('0xcc'));if(_0x5853a2[_0xf31a('0xa5')]===-0x1){return _0x5853a2;}return this[_0xf31a('0x3a')]['noop'](util[_0xf31a('0x29')](_0xf31a('0xb8'),_0x742459));};AGIVertices[_0xf31a('0xf')][_0xf31a('0xcd')]=function(_0x220e22){logger[_0xf31a('0x30')](util[_0xf31a('0x29')](_0xf31a('0xce'),_0x220e22[_0xf31a('0x38')]));if(!this[_0xf31a('0x85')](_0x220e22['grammar'])){return this[_0xf31a('0x3a')][_0xf31a('0xaa')](_0xf31a('0xb1'));}var _0x18fd3a=_0x220e22[_0xf31a('0xb0')];if(this[_0xf31a('0x85')](_0x220e22[_0xf31a('0x78')])){_0x18fd3a+=','+_0x220e22['options'];}var _0x4dfd79=this['channel'][_0xf31a('0x59')](_0xf31a('0xb2'),_0x18fd3a);if(_0x4dfd79[_0xf31a('0xa5')]===-0x1){return _0x4dfd79;}var _0x4d7636=this[_0xf31a('0xa4')](_0xf31a('0xcf'),_0xf31a('0xd0'));if(_0x4d7636[_0xf31a('0xa5')]===-0x1){return _0x4d7636;}var _0x41a050=this[_0xf31a('0xa4')](_0xf31a('0xb4'),_0xf31a('0xd1'));if(_0x41a050[_0xf31a('0xa5')]===-0x1){return _0x41a050;}var _0x3b5e73=this[_0xf31a('0xa4')](_0xf31a('0xb6'),'SESTEK_ASR_INSTANCE');if(_0x3b5e73[_0xf31a('0xa5')]===-0x1){return _0x3b5e73;}return this[_0xf31a('0x3a')]['noop'](util[_0xf31a('0x29')](_0xf31a('0xb8'),_0x18fd3a));};AGIVertices[_0xf31a('0xf')][_0xf31a('0xd2')]=function(_0x464b28){logger[_0xf31a('0x30')](util['format']('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x464b28[_0xf31a('0x38')]));if(!this[_0xf31a('0x85')](_0x464b28['odbc_id'])){return this[_0xf31a('0x3a')][_0xf31a('0x2c')](_0x464b28,_0xf31a('0xd3'));}var _0xb6a6bf=this[_0xf31a('0x18')][_0xf31a('0x6e')](this,_0x464b28[_0xf31a('0xd4')]);if(!_0xb6a6bf){return this['channel']['error'](_0x464b28,_0xf31a('0xd5'));}if(!this[_0xf31a('0x85')](_0x464b28['query'])){return this[_0xf31a('0x3a')][_0xf31a('0x2c')](_0x464b28,_0xf31a('0xd6'));}var _0x4b5097=_0x464b28['query'][_0xf31a('0x5a')](/(\r\n|\n|\r)/gm,'\x20');this[_0xf31a('0x3a')][_0xf31a('0xaa')](util[_0xf31a('0x29')](_0xf31a('0xd7'),_0x4b5097));var _0x5a2e07=this[_0xf31a('0x2a')][_0xf31a('0x6e')](this,_0xb6a6bf,_0x4b5097);this[_0xf31a('0x36')][_0xf31a('0x6e')](this,_0x464b28,_0x4b5097);if(!this['isConfigured'](_0x464b28[_0xf31a('0xd8')])){return this[_0xf31a('0x3a')][_0xf31a('0xaa')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x18ffef=this[_0xf31a('0x10')]['sync'](this,_0x464b28['variable_id']);if(!_0x18ffef){return this[_0xf31a('0x3a')][_0xf31a('0x2c')](_0x464b28,_0xf31a('0xd9'));}var _0xee640c=this;_0x5a2e07['forEach'](function(_0xaa6e9c,_0x1ab500){Object[_0xf31a('0xda')](_0xaa6e9c)[_0xf31a('0xdb')](function(_0x446a40){_0xee640c['channel'][_0xf31a('0xa0')](util['format'](_0xf31a('0xdc'),_0x18ffef,_0x1ab500,_0x446a40),_0xaa6e9c[_0x446a40]);});});this['channel'][_0xf31a('0xa0')](util['format'](_0xf31a('0xdd'),_0x18ffef),_0x5a2e07[_0xf31a('0x9c')]);return this[_0xf31a('0x3a')]['noop'](util['format'](_0xf31a('0xde'),_0x18ffef));};AGIVertices[_0xf31a('0xf')][_0xf31a('0xdf')]=function(_0x46ef98){logger['debug'](util['format'](_0xf31a('0xe0'),_0x46ef98[_0xf31a('0x38')]));if(!this[_0xf31a('0x85')](_0x46ef98['sip_id'])){return this['channel'][_0xf31a('0x2c')](_0x46ef98,_0xf31a('0xe1'));}var _0x5a85bd=this['getUser'][_0xf31a('0x6e')](this,_0x46ef98[_0xf31a('0xe2')]);if(!_0x5a85bd){return this[_0xf31a('0x3a')][_0xf31a('0x2c')](_0x46ef98,_0xf31a('0xe3'));}var _0x3665f9=this['channel'][_0xf31a('0x59')](_0xf31a('0xe4'),[util[_0xf31a('0x29')](_0xf31a('0xe5'),_0x5a85bd),_0x46ef98[_0xf31a('0x65')],_0x46ef98[_0xf31a('0xe6')],_0x46ef98[_0xf31a('0x63')]]);if(_0x3665f9[_0xf31a('0xa5')]===-0x1){return _0x3665f9;}return this[_0xf31a('0x3a')]['noop'](util[_0xf31a('0x29')](_0xf31a('0xe7'),_0xf31a('0xe4')));};AGIVertices[_0xf31a('0xf')][_0xf31a('0xe8')]=function(_0x485b7e){logger[_0xf31a('0x30')](util[_0xf31a('0x29')](_0xf31a('0xe9'),_0x485b7e[_0xf31a('0x38')]));if(!this[_0xf31a('0x85')](_0x485b7e[_0xf31a('0x79')])){return this[_0xf31a('0x3a')][_0xf31a('0xaa')](_0xf31a('0xea'));}if(!this['isConfigured'](_0x485b7e[_0xf31a('0x5d')])){return this[_0xf31a('0x3a')][_0xf31a('0xaa')]('no\x20text\x20configured');}this[_0xf31a('0x3a')][_0xf31a('0xeb')]=!![];this['createSquareDetailsReport'](_0x485b7e);this[_0xf31a('0x44')](_0x485b7e[_0xf31a('0x5d')],'in','','');this[_0xf31a('0x3a')]['noop'](util[_0xf31a('0x29')](_0xf31a('0xec'),_0x485b7e[_0xf31a('0x5d')]));var _0x29e6ef=this['googleDialogflow'][_0xf31a('0x6e')](this,_0x485b7e);if(_0x29e6ef){for(var _0x3cb272 in _0x29e6ef){if(_0x29e6ef[_0xf31a('0x97')](_0x3cb272)){this['channel'][_0xf31a('0xa0')](util[_0xf31a('0x29')](_0xf31a('0xed'),_0x3cb272[_0xf31a('0x68')]()),_0x29e6ef[_0x3cb272]);}}this[_0xf31a('0x44')](_0x29e6ef[_0xf31a('0xee')],'out',_0xf31a('0xe8'),'');return this[_0xf31a('0x3a')]['noop'](util['format']('Dialogflow\x20Result\x20%s',_0x29e6ef[_0xf31a('0xee')]));}return this[_0xf31a('0x3a')][_0xf31a('0x2c')](_0x485b7e,_0xf31a('0xef'));};AGIVertices[_0xf31a('0xf')]['dialogflowV2']=function(_0x299697){logger[_0xf31a('0x30')](util[_0xf31a('0x29')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x299697[_0xf31a('0x38')]));if(!this[_0xf31a('0x85')](_0x299697[_0xf31a('0x7c')])){return this[_0xf31a('0x3a')]['noop'](_0xf31a('0xf0'));}if(!this[_0xf31a('0x85')](_0x299697['client_email'])){return this[_0xf31a('0x3a')]['noop'](_0xf31a('0xf1'));}if(!this[_0xf31a('0x85')](_0x299697[_0xf31a('0x7e')])){return this['channel'][_0xf31a('0xaa')](_0xf31a('0xf2'));}if(!this[_0xf31a('0x85')](_0x299697[_0xf31a('0xf3')])){return this[_0xf31a('0x3a')][_0xf31a('0xaa')]('no\x20anguage\x20configured');}if(!this[_0xf31a('0x85')](_0x299697[_0xf31a('0x5d')])){return this['channel']['noop'](_0xf31a('0xab'));}this['channel']['bot']=!![];this[_0xf31a('0x36')](_0x299697);this[_0xf31a('0x44')](_0x299697[_0xf31a('0x5d')],'in','','');this[_0xf31a('0x3a')][_0xf31a('0xaa')](util['format'](_0xf31a('0xf4'),_0x299697[_0xf31a('0x5d')]));var _0x4cabb4=this['googleDialogflowV2'][_0xf31a('0x6e')](this,_0x299697);if(_0x4cabb4){for(var _0x3dcfad in _0x4cabb4){if(_0x4cabb4[_0xf31a('0x97')](_0x3dcfad)){if(_0x3dcfad!=='providerResponse'){this[_0xf31a('0x3a')][_0xf31a('0xa0')](util[_0xf31a('0x29')]('DIALOGFLOW_%s',_0x3dcfad[_0xf31a('0x68')]()),_0x4cabb4[_0x3dcfad]);}}}this['createSquareMessage'](_0x4cabb4[_0xf31a('0xee')],_0xf31a('0xf5'),_0xf31a('0xf6'),_0x4cabb4['providerResponse']);return this['channel'][_0xf31a('0xaa')](util[_0xf31a('0x29')]('DialogflowV2\x20Result\x20%s',_0x4cabb4['speech']));}return this[_0xf31a('0x3a')]['error'](_0x299697,_0xf31a('0xf7'));};AGIVertices[_0xf31a('0xf')][_0xf31a('0xf8')]=function(_0x5bcf58){logger[_0xf31a('0x30')](util[_0xf31a('0x29')](_0xf31a('0xf9'),_0x5bcf58[_0xf31a('0x38')]));if(!this[_0xf31a('0x85')](_0x5bcf58[_0xf31a('0xfa')])){return this['channel'][_0xf31a('0xaa')]('no\x20ndauth\x20url\x20configured');}if(!this[_0xf31a('0x85')](_0x5bcf58[_0xf31a('0xfb')])){return this[_0xf31a('0x3a')][_0xf31a('0xaa')](_0xf31a('0xfc'));}if(!this['isConfigured'](_0x5bcf58['password'])){return this[_0xf31a('0x3a')][_0xf31a('0xaa')](_0xf31a('0xfd'));}if(!this[_0xf31a('0x85')](_0x5bcf58[_0xf31a('0xfe')])){return this[_0xf31a('0x3a')][_0xf31a('0xaa')](_0xf31a('0xab'));}this[_0xf31a('0x3a')][_0xf31a('0xeb')]=!![];this[_0xf31a('0x36')](_0x5bcf58);this[_0xf31a('0x44')](_0x5bcf58['text'],'in','','');this[_0xf31a('0x3a')][_0xf31a('0xaa')](util[_0xf31a('0x29')](_0xf31a('0xff'),_0x5bcf58['text']));var _0x459b01=this['sestekNDA'][_0xf31a('0x6e')](this,_0x5bcf58);if(_0x459b01){for(var _0x4a9818 in _0x459b01){if(_0x459b01[_0xf31a('0x97')](_0x4a9818)){this[_0xf31a('0x3a')][_0xf31a('0xa0')](util[_0xf31a('0x29')](_0xf31a('0x100'),_0x4a9818[_0xf31a('0x68')]()),_0x459b01[_0x4a9818]);}}this[_0xf31a('0x44')](_0x459b01['speech'],'out','sesteknda','');if(_0x459b01[_0xf31a('0x101')]){this[_0xf31a('0x3a')][_0xf31a('0xaa')](util[_0xf31a('0x29')](_0xf31a('0x102'),_0x459b01[_0xf31a('0x101')]));var _0x194566=this[_0xf31a('0x3a')][_0xf31a('0x103')](_0x459b01[_0xf31a('0x101')]);try{fs['unlink'](_0x459b01[_0xf31a('0x101')]+_0xf31a('0x104'));}catch(_0x587685){logger['error'](_0x587685);}return _0x194566;}else{return this[_0xf31a('0x3a')]['noop'](util[_0xf31a('0x29')]('SestekNDA\x20Result\x20%s',_0x459b01[_0xf31a('0xee')]));}}return this[_0xf31a('0x3a')][_0xf31a('0x2c')](_0x5bcf58,_0xf31a('0x105'));};AGIVertices[_0xf31a('0xf')]['end']=function(_0x102b28){logger[_0xf31a('0x30')](util['format'](_0xf31a('0x106'),_0x102b28[_0xf31a('0x38')]));return this[_0xf31a('0x3a')][_0xf31a('0xaa')](_0xf31a('0x107'));};AGIVertices[_0xf31a('0xf')]['ext_dial']=function(_0x53ea86){logger[_0xf31a('0x30')](util[_0xf31a('0x29')](_0xf31a('0x108'),_0x53ea86[_0xf31a('0x38')]));var _0x225b0b='';if(_0x53ea86['trunk_id']){if(!this[_0xf31a('0x85')](_0x53ea86[_0xf31a('0x109')])){return this[_0xf31a('0x3a')][_0xf31a('0x2c')](_0x53ea86,_0xf31a('0x10a'));}else{var _0x3a5b8e=parseInt(_0x53ea86['trunk_id'],0xa);if(isNaN(_0x3a5b8e)){_0x225b0b=_0x53ea86[_0xf31a('0x109')];}else{_0x225b0b=this[_0xf31a('0x1a')][_0xf31a('0x6e')](this,_0x53ea86[_0xf31a('0x109')]);if(!_0x225b0b){return this[_0xf31a('0x3a')][_0xf31a('0x2c')](_0x53ea86,_0xf31a('0x10b'));}}}}else if(_0x53ea86['trunk_name']){_0x225b0b=_0x53ea86[_0xf31a('0x10c')];}else{return this[_0xf31a('0x3a')]['error'](_0x53ea86,_0xf31a('0x10a'));}var _0x28a62b=this['channel']['exec'](_0xf31a('0xe4'),[util[_0xf31a('0x29')](_0xf31a('0x10d'),_0x225b0b,_0x53ea86['phone']),_0x53ea86[_0xf31a('0x65')],_0x53ea86['opts'],_0x53ea86[_0xf31a('0x63')]]);if(_0x28a62b[_0xf31a('0xa5')]===-0x1){return _0x28a62b;}return this[_0xf31a('0x3a')][_0xf31a('0xaa')](util[_0xf31a('0x29')](_0xf31a('0xe7'),_0xf31a('0xe4')));};AGIVertices['prototype']['finally']=function(_0x34693f){logger[_0xf31a('0x30')](util[_0xf31a('0x29')](_0xf31a('0x10e'),_0x34693f['label']));return this[_0xf31a('0x3a')][_0xf31a('0xaa')](_0xf31a('0x10f'));};AGIVertices[_0xf31a('0xf')][_0xf31a('0x110')]=function(_0x24e01e){logger[_0xf31a('0x30')](util['format'](_0xf31a('0x111'),_0x24e01e[_0xf31a('0x38')]));if(_0x24e01e[_0xf31a('0x112')]===0x0){return this[_0xf31a('0xa7')](_0x24e01e);}_0x24e01e[_0xf31a('0x112')]-=0x1;if(!this[_0xf31a('0x85')](_0x24e01e[_0xf31a('0x113')])){return this[_0xf31a('0x3a')][_0xf31a('0x2c')](_0x24e01e,_0xf31a('0x114'));}var _0x1735fa=this[_0xf31a('0x1c')][_0xf31a('0x6e')](this,_0x24e01e[_0xf31a('0x113')]);if(!_0x1735fa){return this[_0xf31a('0x3a')]['error'](_0x24e01e,_0xf31a('0x115'));}if(!this[_0xf31a('0x85')](_0x24e01e['variable_id'])){return this['channel'][_0xf31a('0x2c')](_0xf31a('0x116'));}var _0x3563aa=this[_0xf31a('0x3a')][_0xf31a('0x117')](_0x1735fa,_0x24e01e[_0xf31a('0x118')],_0x24e01e[_0xf31a('0x119')]);var _0x4a79c6=_0x3563aa['result']?_0x3563aa[_0xf31a('0xa5')][_0xf31a('0x4f')]():'';logger[_0xf31a('0x30')](_0xf31a('0x11a'),JSON[_0xf31a('0x72')](_0x3563aa));if(_0x3563aa[_0xf31a('0xa5')]===-0x1){this['createSquareDetailsReport'][_0xf31a('0x6e')](this,_0x24e01e,_0x4a79c6);return _0x3563aa;}else if(_0x3563aa[_0xf31a('0xa3')]===_0xf31a('0x65')){_0x3563aa[_0xf31a('0xa5')]=_0x4a79c6['length']>=parseInt(_0x24e01e[_0xf31a('0x11b')])?'x':'i';}else{_0x3563aa[_0xf31a('0xa5')]=_0x4a79c6['length']>=parseInt(_0x24e01e[_0xf31a('0x11b')])&&_0x4a79c6[_0xf31a('0x9c')]<=parseInt(_0x24e01e[_0xf31a('0x119')])?'x':'i';}var _0x4191bf=this[_0xf31a('0x10')][_0xf31a('0x6e')](this,_0x24e01e[_0xf31a('0xd8')]);if(!_0x4191bf){return this['channel'][_0xf31a('0x2c')](_0x24e01e,_0xf31a('0xd9'));}this[_0xf31a('0x3a')][_0xf31a('0xa0')](_0x4191bf,_0x4a79c6);if(this[_0xf31a('0x85')](_0x24e01e[_0xf31a('0x11c')])){var _0x6f634f=parseInt(_0x24e01e[_0xf31a('0x11c')],0xa);var _0x43eff1=rs[_0xf31a('0x11d')]({'charset':'*','length':_0x6f634f});var _0x28b525=_0x4a79c6[_0xf31a('0x9c')];if(_0x28b525>0x0){if(_0x28b525>_0x6f634f){this['createSquareDetailsReport'][_0xf31a('0x6e')](this,_0x24e01e,_0x24e01e[_0xf31a('0x11e')]===_0xf31a('0x11f')?_0x43eff1+_0x4a79c6[_0xf31a('0x120')](_0x6f634f):_0x4a79c6['substr'](0x0,_0x28b525-_0x6f634f)+_0x43eff1);}else{this[_0xf31a('0x36')][_0xf31a('0x6e')](this,_0x24e01e,rs[_0xf31a('0x11d')]({'charset':'*','length':_0x28b525}));}}else{this[_0xf31a('0x36')][_0xf31a('0x6e')](this,_0x24e01e,'');}}else{this['createSquareDetailsReport'][_0xf31a('0x6e')](this,_0x24e01e,_0x4a79c6);}return _0x3563aa;};AGIVertices[_0xf31a('0xf')][_0xf31a('0xc')]=function(_0x46adac){logger[_0xf31a('0x30')](util['format']('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x46adac[_0xf31a('0x38')]));return this['getdigits'](_0x46adac);};AGIVertices[_0xf31a('0xf')][_0xf31a('0x121')]=function(_0x3fc459){logger['info'](util[_0xf31a('0x29')](_0xf31a('0x122'),_0x3fc459[_0xf31a('0x38')]));this['createSquareDetailsReport'][_0xf31a('0x6e')](this,_0x3fc459,_0x3fc459[_0xf31a('0x123')]);return this[_0xf31a('0x3a')][_0xf31a('0xaa')](util[_0xf31a('0x29')](_0xf31a('0x124'),_0x3fc459[_0xf31a('0x123')]));};AGIVertices[_0xf31a('0xf')][_0xf31a('0x125')]=function(_0x3a5748){logger[_0xf31a('0x30')](util[_0xf31a('0x29')](_0xf31a('0x126'),_0x3a5748[_0xf31a('0x38')]));if(!this[_0xf31a('0x85')](_0x3a5748['aws_access_key_id'])||!this['isConfigured'](_0x3a5748[_0xf31a('0x88')])){return this[_0xf31a('0x3a')][_0xf31a('0xaa')](_0xf31a('0x127'));}if(!this[_0xf31a('0x85')](_0x3a5748[_0xf31a('0x5d')])){return this[_0xf31a('0x3a')]['noop'](_0xf31a('0xab'));}this[_0xf31a('0x3a')][_0xf31a('0xaa')](util[_0xf31a('0x29')]('Trying\x20aws\x20Polly\x20%s',_0x3a5748['text']));var _0x1381b7=this[_0xf31a('0x87')][_0xf31a('0x6e')](this,_0x3a5748);if(_0x1381b7){this[_0xf31a('0x3a')][_0xf31a('0xaa')](util[_0xf31a('0x29')]('aws\x20Polly\x20%s\x20file\x20created',_0x1381b7));var _0x3165a3=this['channel'][_0xf31a('0x103')](_0x1381b7);try{fs[_0xf31a('0x128')](_0x1381b7+_0xf31a('0x104'));}catch(_0x4db0ca){logger[_0xf31a('0x2c')](_0x4db0ca);}return _0x3165a3;}return this[_0xf31a('0x3a')][_0xf31a('0x2c')](_0x3a5748,_0xf31a('0x129'));};AGIVertices[_0xf31a('0xf')][_0xf31a('0x12a')]=function(_0x67e4c8){logger['info'](util['format'](_0xf31a('0x12b'),_0x67e4c8[_0xf31a('0x38')]));if(!this[_0xf31a('0x85')](_0x67e4c8[_0xf31a('0x8d')])||!this['isConfigured'](_0x67e4c8[_0xf31a('0x88')])){return this['channel'][_0xf31a('0xaa')](_0xf31a('0x127'));}if(!this[_0xf31a('0x85')](_0x67e4c8[_0xf31a('0x8f')])){return this[_0xf31a('0x3a')][_0xf31a('0xaa')](_0xf31a('0x12c'));}if(!this[_0xf31a('0x85')](_0x67e4c8[_0xf31a('0x5d')])){return this[_0xf31a('0x3a')]['noop'](_0xf31a('0xab'));}this['channel'][_0xf31a('0xeb')]=!![];this[_0xf31a('0x36')](_0x67e4c8);this[_0xf31a('0x44')](_0x67e4c8[_0xf31a('0x5d')],'in','','');this['channel'][_0xf31a('0xaa')](util[_0xf31a('0x29')]('Trying\x20Amazon\x20Lex:\x20%s',_0x67e4c8[_0xf31a('0x5d')]));var _0x531ad4=this['awsLex'][_0xf31a('0x6e')](this,_0x67e4c8);if(_0x531ad4){for(var _0x50bb77 in _0x531ad4){if(_0x531ad4[_0xf31a('0x97')](_0x50bb77)&&_['isString'](_0x531ad4[_0x50bb77])){this['channel'][_0xf31a('0xa0')](util[_0xf31a('0x29')](_0xf31a('0x12d'),_0x50bb77[_0xf31a('0x68')]()),_0x531ad4[_0x50bb77]);}}if(_[_0xf31a('0x47')](_0x531ad4[_0xf31a('0x76')])){return this[_0xf31a('0x3a')][_0xf31a('0xaa')](_0xf31a('0x12e'));}else{this[_0xf31a('0x44')](_0x531ad4[_0xf31a('0x76')],_0xf31a('0xf5'),_0xf31a('0x12f'),'');return this[_0xf31a('0x3a')][_0xf31a('0xaa')](util[_0xf31a('0x29')]('Amazon\x20Lex\x20Result\x20%s',_0x531ad4[_0xf31a('0x76')]));}}return this[_0xf31a('0x3a')]['error'](_0x67e4c8,_0xf31a('0x130'));};AGIVertices[_0xf31a('0xf')]['googleasr']=function(_0x886812){logger[_0xf31a('0x30')](util[_0xf31a('0x29')](_0xf31a('0x131'),_0x886812['label'],_0x886812['timeout']));if(!this[_0xf31a('0x85')](_0x886812[_0xf31a('0x79')])){return this['channel'][_0xf31a('0xaa')](_0xf31a('0xea'));}var _0x84479f=_0xf31a('0x132');var _0x1dc508=util['format'](_0xf31a('0x133'),FILES_PATH,rs[_0xf31a('0x11d')](0x4));var _0x129676=util[_0xf31a('0x29')](_0xf31a('0x9f'),_0x1dc508,_0x84479f);var _0x8ea211=!![];if(_0x886812['beep']===_0xf31a('0x134')){_0x8ea211=![];}var _0x3f15c0=this[_0xf31a('0x3a')]['recordFile'](_0x1dc508,_0x84479f,_0x886812[_0xf31a('0x135')],_0x886812[_0xf31a('0x65')],undefined,_0x8ea211);if(_0x3f15c0[_0xf31a('0xa5')]!==-0x1){this['channel'][_0xf31a('0xaa')](util[_0xf31a('0x29')](_0xf31a('0x136'),_0x129676));var _0xf62ad7=this[_0xf31a('0x90')]['sync'](this,_0x886812,_0x129676);if(_0xf62ad7){for(var _0x511a35 in _0xf62ad7){if(_0xf62ad7[_0xf31a('0x97')](_0x511a35)){this['channel']['setVariable'](util[_0xf31a('0x29')](_0xf31a('0x137'),_0x511a35[_0xf31a('0x68')]()),_0xf62ad7[_0x511a35]);}}return this[_0xf31a('0x3a')][_0xf31a('0xaa')](util[_0xf31a('0x29')](_0xf31a('0x138'),JSON['stringify'](_0xf62ad7)));}}return _0x3f15c0;};AGIVertices[_0xf31a('0xf')][_0xf31a('0x139')]=function(_0x5512ca){logger[_0xf31a('0x30')](util[_0xf31a('0x29')](_0xf31a('0x13a'),_0x5512ca['label']));if(!this['isConfigured'](_0x5512ca[_0xf31a('0x92')])){return this[_0xf31a('0x3a')][_0xf31a('0xaa')](_0xf31a('0x13b'));}if(!this['isConfigured'](_0x5512ca[_0xf31a('0x93')])){return this[_0xf31a('0x3a')][_0xf31a('0xaa')](_0xf31a('0x13c'));}var _0xf9267b=_0xf31a('0x132');var _0xb9e2b3=util[_0xf31a('0x29')](_0xf31a('0x133'),FILES_PATH,rs['generate'](0x4));var _0x3a2b4f=util[_0xf31a('0x29')]('%s.%s',_0xb9e2b3,_0xf9267b);var _0x5e2c5b=!![];if(_0x5512ca['beep']===_0xf31a('0x134')){_0x5e2c5b=![];}var _0x215363=this[_0xf31a('0x3a')][_0xf31a('0x13d')](_0xb9e2b3,_0xf9267b,_0x5512ca[_0xf31a('0x135')],_0x5512ca['timeout'],undefined,_0x5e2c5b);if(_0x215363[_0xf31a('0xa5')]!==-0x1){this[_0xf31a('0x3a')]['noop'](util[_0xf31a('0x29')](_0xf31a('0x13e'),_0x3a2b4f));var _0x2fd020=this[_0xf31a('0x13f')][_0xf31a('0x6e')](this,_0x5512ca,_0x3a2b4f);if(_0x2fd020){for(var _0x2f0da1 in _0x2fd020){if(_0x2fd020[_0xf31a('0x97')](_0x2f0da1)){this['channel'][_0xf31a('0xa0')](util[_0xf31a('0x29')](_0xf31a('0x140'),_0x2f0da1['toUpperCase']()),_0x2fd020[_0x2f0da1]);}}return this[_0xf31a('0x3a')][_0xf31a('0xaa')](util[_0xf31a('0x29')](_0xf31a('0x141'),JSON[_0xf31a('0x72')](_0x2fd020)));}}return _0x215363;};AGIVertices[_0xf31a('0xf')][_0xf31a('0x142')]=function(_0x58e32b){logger[_0xf31a('0x30')](util[_0xf31a('0x29')](_0xf31a('0x143'),_0x58e32b['label']));return this[_0xf31a('0x3a')][_0xf31a('0x144')](_0x58e32b[_0xf31a('0x3f')],_0x58e32b[_0xf31a('0x40')],_0x58e32b[_0xf31a('0x41')]);};AGIVertices['prototype']['gotoif']=function(_0xffbaf5){logger[_0xf31a('0x30')](util['format'](_0xf31a('0x145'),_0xffbaf5[_0xf31a('0x38')]));if(!this[_0xf31a('0x85')](_0xffbaf5[_0xf31a('0x146')])){return this[_0xf31a('0x3a')][_0xf31a('0x2c')](_0xffbaf5,'no\x20condition\x20configured');}try{var _0x26f96e=eval(_0xffbaf5[_0xf31a('0x146')])?_0xf31a('0x147'):_0xf31a('0x148');this['channel'][_0xf31a('0xaa')](util['format']('EVAL\x20CONDITION\x20%s\x20%s',_0xffbaf5['condition'],_0x26f96e));return{'code':0xc8,'result':_0x26f96e};}catch(_0x28adf3){return{'code':0xc8,'result':_0xf31a('0x148')};}};AGIVertices[_0xf31a('0xf')][_0xf31a('0x149')]=function(_0x21be35){logger[_0xf31a('0x30')](util['format'](_0xf31a('0x14a'),_0x21be35[_0xf31a('0x38')]));if(!this['isConfigured'](_0x21be35[_0xf31a('0x14b')])){return this[_0xf31a('0x3a')]['error'](_0x21be35,'no\x20interval\x20configured');}var _0x3307c8=this['getIntervals'][_0xf31a('0x6e')](this,_0x21be35['interval_id']);if(!_0x3307c8){return this[_0xf31a('0x3a')][_0xf31a('0x2c')](_0x21be35,_0xf31a('0x14c'));}for(var _0x30fa6b=0x0;_0x30fa6b<_0x3307c8[_0xf31a('0x9c')];_0x30fa6b+=0x1){var _0x272237=this[_0xf31a('0x3a')][_0xf31a('0x10')](util[_0xf31a('0x29')](_0xf31a('0x14d'),_0x3307c8[_0x30fa6b]));if(_0x272237[_0xf31a('0xa5')]===-0x1){return _0x272237;}logger[_0xf31a('0x30')](util[_0xf31a('0x29')](_0xf31a('0x14e'),_0x3307c8[_0x30fa6b],_0x272237['extra']));if(_0x272237[_0xf31a('0xa3')]===_0xf31a('0x147')){logger[_0xf31a('0x30')](util[_0xf31a('0x29')]('IFTIME\x20%s\x20%s',_0x3307c8[_0x30fa6b],_0xf31a('0x147')));this[_0xf31a('0x3a')]['noop'](util[_0xf31a('0x29')](_0xf31a('0x14e'),_0x3307c8[_0x30fa6b],_0xf31a('0x147')));return{'code':0xc8,'result':_0xf31a('0x147')};}else{logger['info'](util[_0xf31a('0x29')](_0xf31a('0x14e'),_0x3307c8[_0x30fa6b],_0xf31a('0x148')));this[_0xf31a('0x3a')][_0xf31a('0xaa')](util['format'](_0xf31a('0x14e'),_0x3307c8[_0x30fa6b],_0xf31a('0x148')));}}return{'code':0xc8,'result':_0xf31a('0x148')};};AGIVertices[_0xf31a('0xf')][_0xf31a('0x14f')]=function(_0x5c1261){logger[_0xf31a('0x30')](util['format'](_0xf31a('0x150'),_0x5c1261[_0xf31a('0x38')]));return this[_0xf31a('0x3a')]['hangup']();};AGIVertices[_0xf31a('0xf')]['ispeechasr']=function(_0x2051b8){logger[_0xf31a('0x30')](util[_0xf31a('0x29')](_0xf31a('0x151'),_0x2051b8['label']));if(!this[_0xf31a('0x85')](_0x2051b8[_0xf31a('0x79')])){return this[_0xf31a('0x3a')][_0xf31a('0xaa')](_0xf31a('0xea'));}var _0xb15a4=_0xf31a('0x132');var _0x40350d=util[_0xf31a('0x29')](_0xf31a('0x133'),FILES_PATH,rs[_0xf31a('0x11d')](0x4));var _0x183cad=util[_0xf31a('0x29')](_0xf31a('0x9f'),_0x40350d,_0xb15a4);var _0x5d710d=!![];if(_0x2051b8[_0xf31a('0x152')]===_0xf31a('0x134')){_0x5d710d=![];}var _0x490c16=this[_0xf31a('0x3a')][_0xf31a('0x13d')](_0x40350d,_0xb15a4,_0x2051b8[_0xf31a('0x135')],_0x2051b8[_0xf31a('0x65')],undefined,_0x5d710d);if(_0x490c16[_0xf31a('0xa5')]!==-0x1){this[_0xf31a('0x3a')][_0xf31a('0xaa')](util[_0xf31a('0x29')](_0xf31a('0x153'),_0x183cad));var _0x29b2f3=this[_0xf31a('0x82')]['sync'](this,_0x2051b8,_0x183cad);if(_0x29b2f3){for(var _0x36c8e7 in _0x29b2f3){if(_0x29b2f3[_0xf31a('0x97')](_0x36c8e7)){this[_0xf31a('0x3a')]['setVariable'](util['format'](_0xf31a('0x154'),_0x36c8e7['toUpperCase']()),_0x29b2f3[_0x36c8e7]);}}return this[_0xf31a('0x3a')][_0xf31a('0xaa')](util[_0xf31a('0x29')](_0xf31a('0x155'),JSON['stringify'](_0x29b2f3)));}}return _0x490c16;};AGIVertices['prototype'][_0xf31a('0x156')]=function(_0x3cfe88){logger[_0xf31a('0x30')](util[_0xf31a('0x29')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x3cfe88[_0xf31a('0x38')]));if(!this['isConfigured'](_0x3cfe88[_0xf31a('0x79')])){return this['channel'][_0xf31a('0xaa')](_0xf31a('0xea'));}if(!this[_0xf31a('0x85')](_0x3cfe88['text'])){return this[_0xf31a('0x3a')]['noop'](_0xf31a('0xab'));}this['channel'][_0xf31a('0xaa')](util['format']('Trying\x20ispeech\x20TTS\x20%s',_0x3cfe88[_0xf31a('0x5d')]));var _0x3119c8=this['ispeechTTS'][_0xf31a('0x6e')](this,_0x3cfe88);if(_0x3119c8){this[_0xf31a('0x3a')][_0xf31a('0xaa')](util[_0xf31a('0x29')](_0xf31a('0x153'),_0x3119c8));var _0x28ab2b=this[_0xf31a('0x3a')]['streamFile'](_0x3119c8,_0x3cfe88[_0xf31a('0x135')]);try{fs[_0xf31a('0x128')](_0x3119c8+'.wav');}catch(_0x10b685){logger[_0xf31a('0x2c')](_0x10b685);}return _0x28ab2b;}return this[_0xf31a('0x3a')][_0xf31a('0x2c')](_0x3cfe88,_0xf31a('0x157'));};AGIVertices['prototype']['login']=function(_0x4d45cc){logger[_0xf31a('0x30')](util[_0xf31a('0x29')](_0xf31a('0x158'),_0x4d45cc[_0xf31a('0x38')]));if(!this[_0xf31a('0x85')](_0x4d45cc[_0xf31a('0x159')])){return this[_0xf31a('0x3a')]['error'](_0x4d45cc,_0xf31a('0x15a'));}logger[_0xf31a('0x30')](util[_0xf31a('0x29')](_0xf31a('0x15b'),this[_0xf31a('0x3a')]['callerid'],_0x4d45cc[_0xf31a('0x159')]));var _0x50fdac=this['agentLogin'][_0xf31a('0x6e')](this,_0x4d45cc[_0xf31a('0x159')]);if(_0x50fdac){logger['info'](util[_0xf31a('0x29')](_0xf31a('0x15c'),this[_0xf31a('0x3a')]['callerid'],_0x4d45cc[_0xf31a('0x159')]));this['channel']['noop'](util['format'](_0xf31a('0x15c'),this[_0xf31a('0x3a')][_0xf31a('0x3c')],_0x4d45cc['findBy']));return{'code':0xc8,'result':_0xf31a('0x15d')};}else{logger[_0xf31a('0x30')](util['format'](_0xf31a('0x15e'),this['channel'][_0xf31a('0x3c')],_0x4d45cc['findBy']));this[_0xf31a('0x3a')]['noop'](util[_0xf31a('0x29')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xf31a('0x3a')]['callerid'],_0x4d45cc[_0xf31a('0x159')]));return{'code':0xc8,'result':_0xf31a('0x15f')};}};AGIVertices[_0xf31a('0xf')]['logout']=function(_0x21f4fa){logger[_0xf31a('0x30')](util['format'](_0xf31a('0x160'),_0x21f4fa[_0xf31a('0x38')]));if(!this[_0xf31a('0x85')](_0x21f4fa[_0xf31a('0x159')])){return this[_0xf31a('0x3a')]['error'](_0x21f4fa,_0xf31a('0x15a'));}logger['info'](util[_0xf31a('0x29')](_0xf31a('0x15b'),this[_0xf31a('0x3a')][_0xf31a('0x3c')],_0x21f4fa[_0xf31a('0x159')]));var _0x40cba5=this[_0xf31a('0x55')][_0xf31a('0x6e')](this,_0x21f4fa[_0xf31a('0x159')]);if(_0x40cba5){logger[_0xf31a('0x30')](util['format'](_0xf31a('0x15c'),this[_0xf31a('0x3a')][_0xf31a('0x3c')],_0x21f4fa['findBy']));this[_0xf31a('0x3a')]['noop'](util['format'](_0xf31a('0x15c'),this['channel'][_0xf31a('0x3c')],_0x21f4fa[_0xf31a('0x159')]));return{'code':0xc8,'result':_0xf31a('0x15d')};}else{logger[_0xf31a('0x30')](util[_0xf31a('0x29')](_0xf31a('0x15e'),this['channel'][_0xf31a('0x3c')],_0x21f4fa[_0xf31a('0x159')]));this[_0xf31a('0x3a')][_0xf31a('0xaa')](util[_0xf31a('0x29')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xf31a('0x3a')][_0xf31a('0x3c')],_0x21f4fa['findBy']));return{'code':0xc8,'result':_0xf31a('0x15f')};}};AGIVertices[_0xf31a('0xf')][_0xf31a('0x161')]=function(_0x1558f3){logger[_0xf31a('0x30')](util['format'](_0xf31a('0x162'),_0x1558f3[_0xf31a('0x38')]));if(!this[_0xf31a('0x85')](_0x1558f3[_0xf31a('0x163')])){return this[_0xf31a('0x3a')][_0xf31a('0x2c')](_0x1558f3,_0xf31a('0x164'));}this[_0xf31a('0x3a')]['noop'](util[_0xf31a('0x29')](_0xf31a('0x165'),_0x1558f3[_0xf31a('0x163')]));var _0x2cb546=eval(_0x1558f3[_0xf31a('0x163')]);if(!this['isConfigured'](_0x1558f3[_0xf31a('0xd8')])){return this['channel'][_0xf31a('0xaa')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x19e610=this['getVariable'][_0xf31a('0x6e')](this,_0x1558f3[_0xf31a('0xd8')]);if(!_0x19e610){return this[_0xf31a('0x3a')]['error'](_0x1558f3,_0xf31a('0xd9'));}if(_[_0xf31a('0x9b')](_0x2cb546)){var _0x2ef83a=this;_0x2cb546['forEach'](function(_0x459ca3,_0x410a61){_0x2ef83a[_0xf31a('0x3a')][_0xf31a('0xa0')](util['format']('%s[%s]',_0x19e610,_0x410a61),_0x459ca3);});return this['channel'][_0xf31a('0xaa')](util[_0xf31a('0x29')](_0xf31a('0x166'),_0x19e610));}else{return this[_0xf31a('0x3a')][_0xf31a('0xa0')](_0x19e610,_0x2cb546);}};AGIVertices['prototype'][_0xf31a('0xb')]=function(_0x31615d){logger[_0xf31a('0x30')](util[_0xf31a('0x29')](_0xf31a('0x167'),_0x31615d[_0xf31a('0x38')]));if(_0x31615d['retry']===0x0){return this[_0xf31a('0xa7')](_0x31615d);}_0x31615d[_0xf31a('0x112')]-=0x1;if(!this[_0xf31a('0x85')](_0x31615d[_0xf31a('0x113')])){return this['channel'][_0xf31a('0x2c')](_0x31615d,_0xf31a('0x114'));}var _0x2b156c=this[_0xf31a('0x1c')][_0xf31a('0x6e')](this,_0x31615d[_0xf31a('0x113')]);if(!_0x2b156c){return this[_0xf31a('0x3a')][_0xf31a('0x2c')](_0x31615d,'no\x20file\x20audio\x20found');}var _0x2e2369=this[_0xf31a('0x3a')]['getData'](_0x2b156c,_0x31615d[_0xf31a('0x118')],_0x31615d['digit']);var _0x1933c4=_0x2e2369['result'];if(_0x2e2369['result']===-0x1){this[_0xf31a('0x36')][_0xf31a('0x6e')](this,_0x31615d,'-1');return _0x2e2369;}else if(_0x2e2369[_0xf31a('0xa3')]==='timeout'){_0x2e2369[_0xf31a('0xa5')]=_0x2e2369[_0xf31a('0xa5')]['length']>0x0?_0x2e2369[_0xf31a('0xa5')]:'t';}else if(_[_0xf31a('0x46')](_0x2e2369[_0xf31a('0xa5')])){_0x2e2369[_0xf31a('0xa5')]='#';_0x1933c4='#';}if(!this[_0xf31a('0x85')](_0x31615d['variable_id'])){this['channel'][_0xf31a('0xaa')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x18de39=this[_0xf31a('0x10')][_0xf31a('0x6e')](this,_0x31615d['variable_id']);if(!_0x18de39){return this[_0xf31a('0x3a')][_0xf31a('0x2c')](_0x31615d,_0xf31a('0xd9'));}this[_0xf31a('0x3a')][_0xf31a('0xa0')](_0x18de39,_0x1933c4);}this[_0xf31a('0x36')]['sync'](this,_0x31615d,_0x1933c4);return _0x2e2369;};AGIVertices[_0xf31a('0xf')][_0xf31a('0xaa')]=function(_0x2618f7){logger['info'](util[_0xf31a('0x29')](_0xf31a('0x168'),_0x2618f7[_0xf31a('0x38')]));return this['channel']['noop'](_0x2618f7[_0xf31a('0x169')]||_0x2618f7[_0xf31a('0x38')]);};AGIVertices['prototype'][_0xf31a('0x16a')]=function(_0x2693c9){logger[_0xf31a('0x30')](util[_0xf31a('0x29')](_0xf31a('0x16b'),_0x2693c9[_0xf31a('0x38')]));if(!this[_0xf31a('0x85')](_0x2693c9[_0xf31a('0x159')])){return this[_0xf31a('0x3a')][_0xf31a('0x2c')](_0x2693c9,_0xf31a('0x15a'));}logger[_0xf31a('0x30')](util['format'](_0xf31a('0x15b'),this[_0xf31a('0x3a')]['callerid'],_0x2693c9[_0xf31a('0x159')]));var _0x5412da=this[_0xf31a('0x51')]['sync'](this,_0x2693c9[_0xf31a('0x16c')]);var _0x1aa5dd=this[_0xf31a('0x52')][_0xf31a('0x6e')](this,_0x2693c9[_0xf31a('0x159')],_0x5412da);if(_0x1aa5dd){logger['info'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xf31a('0x3a')]['callerid'],_0x2693c9['findBy']));this['channel'][_0xf31a('0xaa')](util['format'](_0xf31a('0x15c'),this['channel']['callerid'],_0x2693c9[_0xf31a('0x159')]));return{'code':0xc8,'result':_0xf31a('0x15d')};}else{logger[_0xf31a('0x30')](util[_0xf31a('0x29')](_0xf31a('0x15e'),this[_0xf31a('0x3a')][_0xf31a('0x3c')],_0x2693c9[_0xf31a('0x159')]));this['channel'][_0xf31a('0xaa')](util['format'](_0xf31a('0x15c'),this[_0xf31a('0x3a')][_0xf31a('0x3c')],_0x2693c9[_0xf31a('0x159')]));return{'code':0xc8,'result':_0xf31a('0x15f')};}};AGIVertices['prototype']['playback']=function(_0x66ee66){logger[_0xf31a('0x30')](util['format'](_0xf31a('0x16d'),_0x66ee66['label']));if(!this['isConfigured'](_0x66ee66['file_id'])){return this[_0xf31a('0x3a')]['error'](_0x66ee66,_0xf31a('0x114'));}var _0x3e5147=this[_0xf31a('0x1c')]['sync'](this,_0x66ee66[_0xf31a('0x113')]);if(!_0x3e5147){return this[_0xf31a('0x3a')][_0xf31a('0x2c')](_0x66ee66,_0xf31a('0x115'));}var _0x128e6c=this[_0xf31a('0x3a')][_0xf31a('0x59')](_0xf31a('0x16e'),[_0x3e5147,_0x66ee66[_0xf31a('0xe6')]]);if(_0x128e6c['result']===-0x1){return _0x128e6c;}return this[_0xf31a('0x3a')]['noop'](util[_0xf31a('0x29')]('Executed\x20command\x20%s\x20%s',_0xf31a('0x16e'),_0x3e5147));};AGIVertices[_0xf31a('0xf')][_0xf31a('0x16f')]=function(_0x59caf0){logger[_0xf31a('0x30')](util[_0xf31a('0x29')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x59caf0[_0xf31a('0x38')]));if(!this[_0xf31a('0x85')](_0x59caf0[_0xf31a('0x170')])){return this['channel'][_0xf31a('0x2c')](_0x59caf0,_0xf31a('0x171'));}var _0x23708e='';var _0x309517=parseInt(_0x59caf0[_0xf31a('0x170')],0xa);if(isNaN(_0x309517)){_0x23708e=_0x59caf0['queue_id'];}else{_0x23708e=this[_0xf31a('0x14')][_0xf31a('0x6e')](this,_0x59caf0['queue_id']);if(!_0x23708e){return this['channel'][_0xf31a('0x2c')](_0x59caf0,_0xf31a('0x172'));}}var _0x4fb692='';if(this[_0xf31a('0x85')](_0x59caf0[_0xf31a('0x113')])){var _0x1a7e26=this[_0xf31a('0x1c')][_0xf31a('0x6e')](this,_0x59caf0[_0xf31a('0x113')]);if(_0x1a7e26){_0x4fb692=_0x1a7e26;}}this['createSquareDetailsReport'][_0xf31a('0x6e')](this,_0x59caf0,_0x23708e);if(_0x59caf0[_0xf31a('0xe6')][_0xf31a('0x173')]('x')<0x0){_0x59caf0[_0xf31a('0xe6')]+='x';}if(_0x59caf0['opts']['indexOf']('X')<0x0){_0x59caf0[_0xf31a('0xe6')]+='X';}this[_0xf31a('0x3a')]['setVariable'](_0xf31a('0x174'),_0x23708e?_0x23708e[_0xf31a('0x175')]():'');var _0x569ebc=this[_0xf31a('0x3a')][_0xf31a('0x59')](_0xf31a('0x176'),[_0x23708e,_0x59caf0[_0xf31a('0xe6')],_0x59caf0[_0xf31a('0x63')],_0x4fb692,_0x59caf0[_0xf31a('0x65')],_0x59caf0[_0xf31a('0x6')],_0x59caf0[_0xf31a('0x177')],_0x59caf0[_0xf31a('0x178')],'',_0x59caf0[_0xf31a('0x179')]]);if(_0x569ebc[_0xf31a('0xa5')]===-0x1){return _0x569ebc;}return this[_0xf31a('0x3a')]['noop'](util[_0xf31a('0x29')](_0xf31a('0xc5'),_0xf31a('0x176'),_0x23708e));};AGIVertices[_0xf31a('0xf')][_0xf31a('0x17a')]=function(_0x5b6262){logger[_0xf31a('0x30')](util[_0xf31a('0x29')](_0xf31a('0x17b'),_0x5b6262['label']));var _0x9731aa=_0x5b6262[_0xf31a('0x17c')]||_0xf31a('0x132');var _0x4f3510=util['format'](_0xf31a('0x17d'),this[_0xf31a('0x3a')]['uniqueid'],rs[_0xf31a('0x11d')](0x5));var _0x94a2cc=util[_0xf31a('0x29')](_0xf31a('0x17e'),FILES_PATH,_0x4f3510,_0x9731aa);var _0x1099a6=util[_0xf31a('0x29')](_0xf31a('0x133'),FILES_PATH,_0x4f3510);this[_0xf31a('0x3d')][_0xf31a('0x6e')](this,_0x5b6262,_0x4f3510,_0x94a2cc);this['channel'][_0xf31a('0xa0')](_0xf31a('0x17f'),_0x4f3510);logger[_0xf31a('0x30')](_0xf31a('0x180'),_0x1099a6,_0x9731aa,_0x5b6262[_0xf31a('0x181')],_0x5b6262[_0xf31a('0x65')]);return this['channel'][_0xf31a('0x13d')](_0x1099a6,_0x9731aa,_0x5b6262['escape_digits'],_0x5b6262[_0xf31a('0x65')],undefined,!![]);};AGIVertices[_0xf31a('0xf')][_0xf31a('0x182')]=function(_0x34e20e){logger['info'](util['format'](_0xf31a('0x183'),_0x34e20e['label']));if(!this[_0xf31a('0x85')](_0x34e20e[_0xf31a('0x63')])){return this['channel']['noop'](_0xf31a('0x184'));}var _0x2488c8=this[_0xf31a('0x62')]['sync'](this,_0x34e20e);logger['info'](util[_0xf31a('0x29')](_0xf31a('0x185'),util[_0xf31a('0x186')](_0x2488c8,{'showHidden':![],'depth':null})));if(!this[_0xf31a('0x85')](_0x34e20e[_0xf31a('0xd8')])){return this['channel'][_0xf31a('0xaa')](_0xf31a('0x187'));}var _0x45dc76=this[_0xf31a('0x10')][_0xf31a('0x6e')](this,_0x34e20e[_0xf31a('0xd8')]);if(!_0x45dc76){return this['channel'][_0xf31a('0x2c')](_0x34e20e,_0xf31a('0xd9'));}this[_0xf31a('0x3a')][_0xf31a('0xa0')](util[_0xf31a('0x29')](_0xf31a('0x188'),_0x45dc76),_0x2488c8[_0xf31a('0x74')]?_0x2488c8['statusCode']:_0xf31a('0x189'));this[_0xf31a('0x3a')]['setVariable'](util[_0xf31a('0x29')]('%s_STATUS_MESSAGE',_0x45dc76),_0x2488c8[_0xf31a('0x75')]?_0x2488c8[_0xf31a('0x75')]:'OK');if(_0x2488c8[_0xf31a('0x69')]){try{this['saveRestApiResult'](_0x2488c8[_0xf31a('0x69')],_0x45dc76);}catch(_0x109201){logger[_0xf31a('0x2c')](util[_0xf31a('0x29')](_0xf31a('0x18a'),_0x45dc76));}}return this[_0xf31a('0x3a')][_0xf31a('0xaa')](util[_0xf31a('0x29')](_0xf31a('0xde'),_0x45dc76));};AGIVertices[_0xf31a('0xf')][_0xf31a('0x18b')]=function(_0x4c7384){logger[_0xf31a('0x30')](util['format'](_0xf31a('0x18c'),_0x4c7384[_0xf31a('0x38')]));return this[_0xf31a('0x3a')][_0xf31a('0x18d')](_0x4c7384['digits']['replace'](/\s+/g,''),_0x4c7384['escape_digits']);};AGIVertices[_0xf31a('0xf')][_0xf31a('0x18e')]=function(_0x15d31b){logger[_0xf31a('0x30')](util[_0xf31a('0x29')](_0xf31a('0x18f'),_0x15d31b[_0xf31a('0x38')]));return this[_0xf31a('0x3a')][_0xf31a('0x190')](_0x15d31b[_0xf31a('0x66')][_0xf31a('0x5a')](/\s+/g,''),_0x15d31b['escape_digits']);};AGIVertices[_0xf31a('0xf')][_0xf31a('0x191')]=function(_0x39cc18){logger['info'](util[_0xf31a('0x29')](_0xf31a('0x192'),_0x39cc18[_0xf31a('0x38')]));return this[_0xf31a('0x3a')][_0xf31a('0x193')](_0x39cc18[_0xf31a('0x5d')],_0x39cc18[_0xf31a('0x181')]);};AGIVertices[_0xf31a('0xf')][_0xf31a('0x194')]=function(_0x440ba7){logger['info'](util[_0xf31a('0x29')](_0xf31a('0x195'),_0x440ba7['label']));if(!this['isConfigured'](_0x440ba7[_0xf31a('0x196')])){return this[_0xf31a('0x3a')][_0xf31a('0xaa')](_0xf31a('0x197'));}var _0x418d07=this[_0xf31a('0x20')]['sync'](this,_0x440ba7[_0xf31a('0x196')]);if(!_0x418d07||!_0x418d07[_0xf31a('0x198')]){return this['channel'][_0xf31a('0x2c')](_0x440ba7,_0xf31a('0x199'));}var _0x557249={'from':util[_0xf31a('0x29')](_0xf31a('0x19a'),_0x418d07[_0xf31a('0x16')],_0x418d07[_0xf31a('0x19b')]||_0x418d07[_0xf31a('0x198')]['user']),'to':_0x440ba7['to']||'','cc':_0x440ba7['cc']||'','bcc':_0x440ba7['bcc']||'','subject':_0x440ba7[_0xf31a('0x19c')],'html':_0x440ba7[_0xf31a('0x5d')],'text':_0x440ba7[_0xf31a('0x5d')]};if(this[_0xf31a('0x85')](_0x440ba7[_0xf31a('0x19d')])){}logger['debug'](_0xf31a('0x19e'),JSON[_0xf31a('0x72')](_0x557249));this[_0xf31a('0x36')]['sync'](this,_0x440ba7,_0x440ba7[_0xf31a('0x196')]);this[_0xf31a('0x3a')][_0xf31a('0xaa')](util[_0xf31a('0x29')](_0xf31a('0x19f'),_0x418d07[_0xf31a('0x16')]));this[_0xf31a('0x22')][_0xf31a('0x6e')](this,_0x418d07['smtpOptions'],_0x557249);return this[_0xf31a('0x3a')][_0xf31a('0xaa')](_0xf31a('0x1a0'));};AGIVertices[_0xf31a('0xf')][_0xf31a('0x1a1')]=function(_0x569a6b){logger['info'](util['format'](_0xf31a('0x1a2'),_0x569a6b['label']));return this[_0xf31a('0x3a')][_0xf31a('0xaa')](_0xf31a('0x1a3'));};AGIVertices[_0xf31a('0xf')][_0xf31a('0x1a4')]=function(_0x296075){logger[_0xf31a('0x30')](util[_0xf31a('0x29')](_0xf31a('0x1a5'),_0x296075[_0xf31a('0x38')]));if(!this[_0xf31a('0x85')](_0x296075[_0xf31a('0x1a6')])){return this[_0xf31a('0x3a')][_0xf31a('0xaa')](_0xf31a('0x1a7'));}var _0x3cd5ac=this['getSmsAccount'][_0xf31a('0x6e')](this,_0x296075[_0xf31a('0x1a6')]);if(!_0x3cd5ac){return this[_0xf31a('0x3a')][_0xf31a('0x2c')](_0x296075,'no\x20sms\x20account\x20found');}var _0x514362={'body':_0x296075[_0xf31a('0x1a8')],'phone':_0x296075['to']||'','SmsAccountId':_0x3cd5ac['id']};logger[_0xf31a('0x1a9')]('sendSMS\x20message',JSON['stringify'](_0x514362));this[_0xf31a('0x36')][_0xf31a('0x6e')](this,_0x296075,_0x296075['sms_account_id']);this[_0xf31a('0x3a')][_0xf31a('0xaa')](util[_0xf31a('0x29')](_0xf31a('0x1aa'),_0x3cd5ac['name']));this[_0xf31a('0x35')][_0xf31a('0x6e')](this,_0x514362);return this[_0xf31a('0x3a')][_0xf31a('0xaa')](_0xf31a('0x1ab'));};AGIVertices[_0xf31a('0xf')][_0xf31a('0x1ac')]=function(_0x2ae0e0){logger[_0xf31a('0x30')](util[_0xf31a('0x29')](_0xf31a('0x1ad'),_0x2ae0e0[_0xf31a('0x38')]));if(!this[_0xf31a('0x85')](_0x2ae0e0[_0xf31a('0xd8')])){return this[_0xf31a('0x3a')][_0xf31a('0x2c')](_0x2ae0e0,_0xf31a('0x1ae'));}var _0x8e81dc=this[_0xf31a('0x10')][_0xf31a('0x6e')](this,_0x2ae0e0[_0xf31a('0xd8')]);if(!_0x8e81dc){return this[_0xf31a('0x3a')]['error'](_0x2ae0e0,_0xf31a('0xd9'));}return this[_0xf31a('0x3a')]['setVariable'](_0x8e81dc,_0x2ae0e0[_0xf31a('0x1af')]);};AGIVertices[_0xf31a('0xf')][_0xf31a('0x1b0')]=function(_0x5bbccd){logger[_0xf31a('0x30')](util['format']('Enter\x20in\x20START\x20(%s)\x20block',_0x5bbccd[_0xf31a('0x38')]));this[_0xf31a('0x3a')]['noop'](_0xf31a('0x1b1'));var _0x1192f3=this[_0xf31a('0x3a')][_0xf31a('0x10')](_0xf31a('0x1b2'));if(!_['isEmpty'](_0x1192f3['extra'])){this['channel'][_0xf31a('0x37')]=_0x1192f3['extra'];}if(_0x5bbccd[_0xf31a('0xba')]===_0xf31a('0x1b3')){this[_0xf31a('0x3a')][_0xf31a('0xaa')]('Answer');return this[_0xf31a('0x3a')][_0xf31a('0xba')]();}return this[_0xf31a('0x3a')][_0xf31a('0xaa')](_0xf31a('0x1b4'));};AGIVertices[_0xf31a('0xf')][_0xf31a('0x1b5')]=function(_0x294cf8){logger[_0xf31a('0x30')](util['format'](_0xf31a('0x1b6'),_0x294cf8[_0xf31a('0x38')]));if(!this[_0xf31a('0x85')](_0x294cf8[_0xf31a('0x1b7')])){return this[_0xf31a('0x3a')]['error'](_0x294cf8,_0xf31a('0x1b8'));}var _0x42ffd6=this[_0xf31a('0x17')][_0xf31a('0x6e')](this,_0x294cf8[_0xf31a('0x1b7')]);if(!this['isConfigured'](_0x42ffd6)){return this['channel'][_0xf31a('0x2c')](_0x294cf8,util['format'](_0xf31a('0x1b9'),_0x294cf8[_0xf31a('0x1b7')]));}if(_0x42ffd6===this[_0xf31a('0x3a')][_0xf31a('0x3b')]){return this[_0xf31a('0x3a')][_0xf31a('0x2c')](_0x294cf8,_0xf31a('0x1ba'));}this['createSquareDetailsReport'][_0xf31a('0x6e')](this,_0x294cf8,_0x42ffd6);var _0x126901=this['channel'][_0xf31a('0x59')](_0xf31a('0x1bb'),util['format'](_0xf31a('0x1bc'),config['agi'][_0xf31a('0x1bd')]||'127.0.0.1',_0x42ffd6,this[_0xf31a('0x3a')][_0xf31a('0x3b')]));if(_0x126901[_0xf31a('0xa5')]===-0x1){return _0x126901;}return this[_0xf31a('0x3a')][_0xf31a('0xaa')](util[_0xf31a('0x29')](_0xf31a('0xc5'),_0xf31a('0x1bb'),_0x42ffd6));};AGIVertices['prototype'][_0xf31a('0x1be')]=function(_0x2ea979){logger['info'](util[_0xf31a('0x29')](_0xf31a('0x1bf'),_0x2ea979[_0xf31a('0x38')]));var _0x383f01=this['shellCommand'][_0xf31a('0x6e')](this,_0x2ea979['command']);this[_0xf31a('0x36')][_0xf31a('0x6e')](this,_0x2ea979,_0x2ea979[_0xf31a('0x1c0')]);if(this[_0xf31a('0x85')](_0x2ea979[_0xf31a('0xd8')])){var _0xe930da=this[_0xf31a('0x10')][_0xf31a('0x6e')](this,_0x2ea979[_0xf31a('0xd8')]);if(_0xe930da){this[_0xf31a('0x3a')][_0xf31a('0xa0')](_0xe930da,_0x383f01);return this[_0xf31a('0x3a')][_0xf31a('0xaa')](util[_0xf31a('0x29')](_0xf31a('0x1c1'),_0x2ea979[_0xf31a('0x1c0')],_0xe930da));}}return this[_0xf31a('0x3a')]['noop'](util[_0xf31a('0x29')](_0xf31a('0x1c2'),_0x2ea979[_0xf31a('0x1c0')]));};AGIVertices[_0xf31a('0xf')][_0xf31a('0x1c3')]=function(_0x51b382){logger[_0xf31a('0x30')](util[_0xf31a('0x29')](_0xf31a('0x1c4'),_0x51b382['label']));_0x51b382[_0xf31a('0x5d')]=_0x51b382['text'][_0xf31a('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xf31a('0x85')](_0x51b382[_0xf31a('0x5b')])){return this[_0xf31a('0x3a')][_0xf31a('0xaa')](_0xf31a('0x1c5'));}if(!this['isConfigured'](_0x51b382['text'])){return this[_0xf31a('0x3a')][_0xf31a('0xaa')]('no\x20text\x20configured');}this[_0xf31a('0x3a')]['noop'](util[_0xf31a('0x29')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x51b382[_0xf31a('0x5d')]));var _0xc942ee=this[_0xf31a('0x1c6')][_0xf31a('0x6e')](this,_0x51b382);if(_0xc942ee){this['channel'][_0xf31a('0xaa')](util[_0xf31a('0x29')](_0xf31a('0x1c7'),_0xc942ee));var _0x3d5b41=this[_0xf31a('0x3a')][_0xf31a('0x103')](_0xc942ee);try{fs[_0xf31a('0x128')](_0xc942ee+_0xf31a('0x104'));}catch(_0x32ff03){logger[_0xf31a('0x2c')](_0x32ff03);}return _0x3d5b41;}return this['channel']['error'](_0x51b382,_0xf31a('0x1c8'));};AGIVertices['prototype']['tts']=function(_0x3cfd1f){logger[_0xf31a('0x30')](util[_0xf31a('0x29')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x3cfd1f[_0xf31a('0x38')]));_0x3cfd1f[_0xf31a('0x5d')]=_0x3cfd1f['text'][_0xf31a('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xf31a('0x85')](_0x3cfd1f['text'])){return this[_0xf31a('0x3a')][_0xf31a('0xaa')]('no\x20text\x20configured');}this['channel'][_0xf31a('0xaa')](util[_0xf31a('0x29')](_0xf31a('0x1c9'),_0x3cfd1f['text']));var _0xfccba=this[_0xf31a('0x61')][_0xf31a('0x6e')](this,_0x3cfd1f);if(_0xfccba){this[_0xf31a('0x3a')]['noop'](util[_0xf31a('0x29')](_0xf31a('0x1ca'),_0xfccba));var _0x2c6bfb=this['channel'][_0xf31a('0x103')](_0xfccba);try{fs[_0xf31a('0x128')](_0xfccba+_0xf31a('0x104'));}catch(_0x19bf75){logger['error'](_0x19bf75);}return _0x2c6bfb;}return this['channel'][_0xf31a('0x2c')](_0x3cfd1f,_0xf31a('0x1cb'));};AGIVertices['prototype'][_0xf31a('0x1cc')]=function(_0x4c18d8){logger[_0xf31a('0x30')](util[_0xf31a('0x29')](_0xf31a('0x1cd'),_0x4c18d8[_0xf31a('0x38')]));if(!this[_0xf31a('0x85')](_0x4c18d8[_0xf31a('0x159')])){return this[_0xf31a('0x3a')][_0xf31a('0x2c')](_0x4c18d8,'no\x20find\x20by\x20configured');}logger['info'](util[_0xf31a('0x29')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xf31a('0x3a')][_0xf31a('0x3c')],_0x4c18d8['findBy']));var _0x20a68f=this[_0xf31a('0x54')]['sync'](this,_0x4c18d8[_0xf31a('0x159')]);if(_0x20a68f){logger[_0xf31a('0x30')](util[_0xf31a('0x29')](_0xf31a('0x15c'),this['channel'][_0xf31a('0x3c')],_0x4c18d8[_0xf31a('0x159')]));this[_0xf31a('0x3a')]['noop'](util[_0xf31a('0x29')](_0xf31a('0x15c'),this[_0xf31a('0x3a')]['callerid'],_0x4c18d8[_0xf31a('0x159')]));return{'code':0xc8,'result':_0xf31a('0x15d')};}else{logger[_0xf31a('0x30')](util[_0xf31a('0x29')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xf31a('0x3a')][_0xf31a('0x3c')],_0x4c18d8[_0xf31a('0x159')]));this[_0xf31a('0x3a')][_0xf31a('0xaa')](util[_0xf31a('0x29')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xf31a('0x3c')],_0x4c18d8[_0xf31a('0x159')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xf31a('0xf')][_0xf31a('0x1ce')]=function(_0x1ce36f){logger[_0xf31a('0x30')](util[_0xf31a('0x29')](_0xf31a('0x1cf'),_0x1ce36f[_0xf31a('0x38')]));var _0x2bc116=this[_0xf31a('0x3a')][_0xf31a('0x59')]('VOICEMAIL',[_0x1ce36f[_0xf31a('0x1d0')],_0x1ce36f[_0xf31a('0x78')]]);if(_0x2bc116['result']===-0x1){return _0x2bc116;}return this['channel'][_0xf31a('0xaa')](util[_0xf31a('0x29')](_0xf31a('0xc5'),_0xf31a('0x1d1'),_0x1ce36f[_0xf31a('0x1d0')]));};AGIVertices['prototype'][_0xf31a('0x1d2')]=function(_0x18e356){logger[_0xf31a('0x30')](util[_0xf31a('0x29')](_0xf31a('0x1d3'),_0x18e356[_0xf31a('0x38')]));if(!this['isConfigured'](_0x18e356[_0xf31a('0xd8')])){return this[_0xf31a('0x3a')]['error'](_0x18e356,_0xf31a('0x1ae'));}var _0x490496=this[_0xf31a('0x10')][_0xf31a('0x6e')](this,_0x18e356[_0xf31a('0xd8')]);if(!_0x490496){return this[_0xf31a('0x3a')][_0xf31a('0x2c')](_0x18e356,_0xf31a('0xd9'));}var _0x133263=this[_0xf31a('0x3a')]['getVariable'](_0x490496);return{'code':0xc8,'result':_0x133263[_0xf31a('0xa3')]?_0x133263['extra']:'-'};};String[_0xf31a('0xf')][_0xf31a('0xa2')]=function(_0x30d5bc,_0x66eb48){return this[_0xf31a('0xa1')](_0x30d5bc)['join'](_0x66eb48);};module[_0xf31a('0x1d4')]=AGIVertices; \ No newline at end of file +var _0x4b84=['project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','host','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','replaceAll','join','util','lodash','randomstring','request-promise','../../config/logger','agi','rawHeaders','menu','getsecretdigits','channel','rpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueueById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getTrunk','getTrunkById','getSound','save_name','getMailAccountById','sendMailMessage','mailRpc','getIntervals','getIntervalById','IntervalId','interval','Intervals','getSoundPath','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','arg_1','callerid','createSquareRecording','context','extension','priority','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','scheduledAt','callback','toString','getPauseById','agentPause','agent','agentUnpause','agentLogout','internal','%s/%s@from-sip/n','LOCAL','agentLogin','shellCommand','exec','trim','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','googleTTS','google_tts_language','restAPI','url','method','timeout','includes','POST','PUT','toUpperCase','body','rawBody','parse','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','%s.%s','setVariable','split','extra','getAndSetVariable','result','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','no\x20grammar\x20configured','grammar','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','command','args','wait','answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','no\x20list\x20selected','delay','add','minutes','callback_priority','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','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_INSTANCE','sestekasr','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','odbc_id','no\x20odbc\x20database\x20found','replace','variable_id','no\x20variable\x20found','forEach','%s[%s][%s]','variable\x20%s\x20set','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','sip_id','no\x20user\x20found','DIAL','SIP/%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','hasOwnProperty','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','no\x20client_email\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','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','opts','Executed\x20command\x20%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20found','no\x20variable\x20selected\x20for\x20the\x20result','response','maxdigit','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','unlink','.wav','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','Trying\x20Amazon\x20Lex:\x20%s','amazonlex','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','tilde\x20%s\x20file\x20created','Enter\x20in\x20GOTO\x20(%s)\x20block','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','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','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','%s[%s]','variable\x20%s[key]\x20set','getData','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','pause_id','playback','no\x20file\x20audio\x20selected','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','macro','gosub','QUEUE','record','Enter\x20in\x20RECORD\x20(%s)\x20block','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','number','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','account_id','no\x20mail\x20account\x20configured','getMailAccount','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','bcc','template_id','debug','Trying\x20SendMail\x20with\x20account\x20%s','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','START\x20CALLY\x20SQUARE','yes','Answer','subproject','project_id','getSquareProject','no\x20subproject\x20found\x20with\x20id\x20%d'];(function(_0x51cce9,_0x2b6d62){var _0x32053b=function(_0x18d168){while(--_0x18d168){_0x51cce9['push'](_0x51cce9['shift']());}};_0x32053b(++_0x2b6d62);}(_0x4b84,0x1cc));var _0x44b8=function(_0x29d6e6,_0x264220){_0x29d6e6=_0x29d6e6-0x0;var _0xc75ff0=_0x4b84[_0x29d6e6];return _0xc75ff0;};'use strict';var fs=require('fs');var util=require(_0x44b8('0x0'));var _=require(_0x44b8('0x1'));var sh=require('shelljs');var odbc=require('odbc')();var rs=require(_0x44b8('0x2'));var moment=require('moment');var Mustache=require('mustache');var rp=require(_0x44b8('0x3'));var logger=require(_0x44b8('0x4'))(_0x44b8('0x5'));var config=require('../../config/environment');var scripts=require('./scripts');var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0x44b8('0x6'),'rawBody'];var verticesWithRetry=[_0x44b8('0x7'),'getdigits',_0x44b8('0x8')];var AGIVertices=function(_0x5a2353,_0x5034b6,_0x41d515){this[_0x44b8('0x9')]=_0x5a2353;this[_0x44b8('0xa')]=_0x5034b6;this['mailRpc']=_0x41d515;};AGIVertices[_0x44b8('0xb')][_0x44b8('0xc')]=function(_0x4315f6,_0x9b6048){this[_0x44b8('0xa')][_0x44b8('0xd')](_0x4315f6)[_0x44b8('0xe')](function(_0x4ae8a1){_0x9b6048(null,_0x4ae8a1?_0x4ae8a1[_0x44b8('0xf')]:![]);})[_0x44b8('0x10')](function(_0x4bcc43){_0x9b6048(_0x4bcc43);});};AGIVertices[_0x44b8('0xb')]['getVoiceQueue']=function(_0x833ea3,_0x18d642){this['rpc'][_0x44b8('0x11')](_0x833ea3)['then'](function(_0x54fa95){_0x18d642(null,_0x54fa95?_0x54fa95[_0x44b8('0xf')]:![]);})[_0x44b8('0x10')](function(_0x1722da){_0x18d642(_0x1722da);});};AGIVertices[_0x44b8('0xb')]['getSquareProject']=function(_0x495c74,_0x5d6349){this[_0x44b8('0xa')]['getSquareProjectById'](_0x495c74)[_0x44b8('0xe')](function(_0x31651b){_0x5d6349(null,_0x31651b?_0x31651b['name']:![]);})[_0x44b8('0x10')](function(_0xe3de8f){_0x5d6349(_0xe3de8f);});};AGIVertices['prototype'][_0x44b8('0x12')]=function(_0x3f4688,_0x4b600f){this[_0x44b8('0xa')][_0x44b8('0x13')](_0x3f4688)[_0x44b8('0xe')](function(_0x235bdc){_0x4b600f(null,_0x235bdc?_0x235bdc[_0x44b8('0x14')]:![]);})[_0x44b8('0x10')](function(_0x452f2f){_0x4b600f(_0x452f2f);});};AGIVertices[_0x44b8('0xb')][_0x44b8('0x15')]=function(_0x1e0f2d,_0x1d642b){this[_0x44b8('0xa')]['getUserById'](_0x1e0f2d)[_0x44b8('0xe')](function(_0x3a8aa4){_0x1d642b(null,_0x3a8aa4?_0x3a8aa4[_0x44b8('0xf')]:![]);})[_0x44b8('0x10')](function(_0x305a5c){_0x1d642b(_0x305a5c);});};AGIVertices['prototype'][_0x44b8('0x16')]=function(_0x54677c,_0x41a922){this[_0x44b8('0xa')][_0x44b8('0x17')](_0x54677c)[_0x44b8('0xe')](function(_0x230a3d){_0x41a922(null,_0x230a3d?_0x230a3d['name']:![]);})[_0x44b8('0x10')](function(_0x502acf){_0x41a922(_0x502acf);});};AGIVertices[_0x44b8('0xb')][_0x44b8('0x18')]=function(_0x549a26,_0x17ac44){var _0x470f49=this;this[_0x44b8('0xa')]['getSoundById'](_0x549a26)[_0x44b8('0xe')](function(_0x242342){_0x17ac44(null,_0x242342?_0x470f49['getSoundPath'](_0x242342[_0x44b8('0x19')]):![]);})['catch'](function(_0xfb0028){_0x17ac44(_0xfb0028);});};AGIVertices['prototype']['getMailAccount']=function(_0x5948dc,_0x387293){this[_0x44b8('0xa')][_0x44b8('0x1a')](_0x5948dc)[_0x44b8('0xe')](function(_0x38cd17){_0x387293(null,_0x38cd17?_0x38cd17:![]);})[_0x44b8('0x10')](function(_0x2cf205){_0x387293(_0x2cf205);});};AGIVertices[_0x44b8('0xb')][_0x44b8('0x1b')]=function(_0x28f918,_0x5e1129,_0x417d81){this[_0x44b8('0x1c')]['sendMailMessage'](_0x28f918,_0x5e1129)[_0x44b8('0xe')](function(){_0x417d81(null);})['catch'](function(_0x212983){_0x417d81(_0x212983);});};AGIVertices[_0x44b8('0xb')][_0x44b8('0x1d')]=function(_0xb64609,_0x1b63a7){this['rpc'][_0x44b8('0x1e')](_0xb64609)[_0x44b8('0xe')](function(_0x26265f){if(_0x26265f){if(_0x26265f[_0x44b8('0x1f')]){_0x1b63a7(null,[_0x26265f[_0x44b8('0x20')]]);}else{_0x1b63a7(null,_['map'](_0x26265f[_0x44b8('0x21')],_0x44b8('0x20')));}}else{_0x1b63a7(null,![]);}})[_0x44b8('0x10')](function(_0x3e93af){_0x1b63a7(_0x3e93af);});};AGIVertices[_0x44b8('0xb')][_0x44b8('0x22')]=function(_0x2e8b88){return util[_0x44b8('0x23')](_0x44b8('0x24'),FILES_PATH,_0x2e8b88);};AGIVertices[_0x44b8('0xb')][_0x44b8('0x25')]=function(_0xce304d,_0xa5ac3e,_0xae15f4){odbc[_0x44b8('0x26')](_0xce304d,function(_0x1becb0){if(_0x1becb0){logger[_0x44b8('0x27')](_0x44b8('0x28'),_0x1becb0);_0xae15f4(_0x1becb0);}else{logger[_0x44b8('0x29')](_0x44b8('0x2a'));odbc[_0x44b8('0x2b')](_0xa5ac3e,function(_0x282345,_0x59848c){if(_0x282345){logger[_0x44b8('0x29')](_0x44b8('0x2c'),_0xa5ac3e);_0xae15f4(_0x282345);}else{logger['info'](_0x44b8('0x2d'),_0xa5ac3e);odbc[_0x44b8('0x2e')](function(_0x6658be){if(_0x6658be){logger[_0x44b8('0x27')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x6658be);}_0xae15f4(null,_0x59848c);});}});}});};AGIVertices[_0x44b8('0xb')][_0x44b8('0x2f')]=function(_0x3611b4,_0x1ee3cc){this[_0x44b8('0xa')][_0x44b8('0x30')](_0x3611b4)[_0x44b8('0xe')](function(_0x3581b8){_0x1ee3cc(null,_0x3581b8?_0x3581b8:![]);})[_0x44b8('0x10')](function(_0x3d1be1){_0x1ee3cc(_0x3d1be1);});};AGIVertices[_0x44b8('0xb')][_0x44b8('0x31')]=function(_0xd69398,_0x31f22f){this[_0x44b8('0xa')][_0x44b8('0x31')](_0xd69398)['then'](function(_0x12a0a4){_0x31f22f(null,_0x12a0a4);})[_0x44b8('0x10')](function(_0xbf444f){_0x31f22f(_0xbf444f);});};AGIVertices['prototype'][_0x44b8('0x32')]=function(_0x1054c5,_0x229cc9,_0x585a16){this[_0x44b8('0xa')][_0x44b8('0x32')]({'uniqueid':this[_0x44b8('0x9')][_0x44b8('0x33')],'node':_0x1054c5[_0x44b8('0x34')],'application':_0x1054c5['agicommand'],'data':_0x229cc9||null,'project_name':this['channel'][_0x44b8('0x35')],'callerid':this[_0x44b8('0x9')][_0x44b8('0x36')]})[_0x44b8('0xe')](function(_0x43906b){if(_0x585a16){_0x585a16(null,_0x43906b);}})[_0x44b8('0x10')](function(_0x3fc41b){if(_0x585a16){_0x585a16(_0x3fc41b);}});};AGIVertices[_0x44b8('0xb')][_0x44b8('0x37')]=function(_0xb55911,_0x197782,_0x2a9b2a,_0xc1b9de){this[_0x44b8('0xa')][_0x44b8('0x37')]({'uniqueid':this[_0x44b8('0x9')][_0x44b8('0x33')],'callerid':this[_0x44b8('0x9')][_0x44b8('0x36')],'calleridname':this['channel']['calleridname'],'context':this[_0x44b8('0x9')][_0x44b8('0x38')],'extension':this[_0x44b8('0x9')][_0x44b8('0x39')],'priority':this[_0x44b8('0x9')][_0x44b8('0x3a')],'accountcode':this[_0x44b8('0x9')]['accountcode'],'dnid':this[_0x44b8('0x9')]['dnid'],'projectName':this[_0x44b8('0x9')][_0x44b8('0x35')],'saveName':_0x197782,'filename':_0xb55911[_0x44b8('0x3b')]||_0x197782,'savePath':_0x2a9b2a})[_0x44b8('0xe')](function(_0x103d57){_0xc1b9de(null,_0x103d57);})[_0x44b8('0x10')](function(_0x491600){_0xc1b9de(_0x491600);});};AGIVertices[_0x44b8('0xb')][_0x44b8('0x3c')]=function(_0x10602c,_0x25d266,_0x4ccc77,_0x4e4ed1,_0x2f549d){this[_0x44b8('0xa')][_0x44b8('0x3c')]({'uniqueid':this[_0x44b8('0x9')][_0x44b8('0x33')],'body':_0x10602c,'direction':_0x25d266,'providerName':_0x4ccc77,'providerResponse':_0x4e4ed1})['then'](function(_0x19d95d){if(_0x2f549d){_0x2f549d(null,_0x19d95d);}})[_0x44b8('0x10')](function(_0x2c5c27){if(_0x2f549d){_0x2f549d(_0x2c5c27);}});};AGIVertices[_0x44b8('0xb')][_0x44b8('0x3d')]=function(_0x57d0e2,_0x493840){this[_0x44b8('0xa')]['createCmContact']({'firstName':_[_0x44b8('0x3e')](_0x57d0e2['name'])||_[_0x44b8('0x3f')](_0x57d0e2[_0x44b8('0xf')])?_0x44b8('0x40')+Math[_0x44b8('0x41')]():_0x57d0e2[_0x44b8('0xf')],'lastName':_[_0x44b8('0x3e')](_0x57d0e2[_0x44b8('0x42')])||_['isNil'](_0x57d0e2[_0x44b8('0x42')])?null:_0x57d0e2[_0x44b8('0x42')],'phone':_0x57d0e2[_0x44b8('0x43')],'ListId':_0x57d0e2['list_id'],'scheduledat':_0x57d0e2[_0x44b8('0x44')],'callbackUniqueid':this[_0x44b8('0x9')][_0x44b8('0x33')],'tags':_0x44b8('0x45'),'description':'Callback\x20scheduled\x20at\x20'+_0x57d0e2[_0x44b8('0x44')][_0x44b8('0x46')](),'priority':_0x57d0e2['callback_priority']})[_0x44b8('0xe')](function(_0x19f22b){_0x493840(null,_0x19f22b);})[_0x44b8('0x10')](function(_0x3df6aa){_0x493840(_0x3df6aa);});};AGIVertices[_0x44b8('0xb')]['getPause']=function(_0x5b99a3,_0xc181d2){this[_0x44b8('0xa')][_0x44b8('0x47')](_0x5b99a3)[_0x44b8('0xe')](function(_0x765e45){_0xc181d2(null,_0x765e45?_0x765e45[_0x44b8('0xf')]:![]);})[_0x44b8('0x10')](function(_0xf0fb0d){_0xc181d2(_0xf0fb0d);});};AGIVertices[_0x44b8('0xb')][_0x44b8('0x48')]=function(_0x16c628,_0x3f7576,_0x5af3e6){var _0x1367ae={'role':_0x44b8('0x49')};_0x1367ae[_0x16c628]=this[_0x44b8('0x9')][_0x44b8('0x36')];this[_0x44b8('0xa')][_0x44b8('0x48')](_0x1367ae,_0x3f7576,this[_0x44b8('0x9')][_0x44b8('0x33')])[_0x44b8('0xe')](function(_0x2d6a31){_0x5af3e6(null,_[_0x44b8('0x3f')](_0x2d6a31)?![]:!![]);})[_0x44b8('0x10')](function(_0x1da152){logger[_0x44b8('0x27')](_0x1da152);_0x5af3e6(null,![]);});};AGIVertices[_0x44b8('0xb')][_0x44b8('0x4a')]=function(_0x25f91c,_0x20e563){var _0x4cf835={'role':_0x44b8('0x49')};_0x4cf835[_0x25f91c]=this[_0x44b8('0x9')][_0x44b8('0x36')];this[_0x44b8('0xa')][_0x44b8('0x4a')](_0x4cf835)[_0x44b8('0xe')](function(_0x2ecf65){_0x20e563(null,_['isNil'](_0x2ecf65)?![]:!![]);})[_0x44b8('0x10')](function(_0xc4d667){logger['error'](_0xc4d667);_0x20e563(null,![]);});};AGIVertices[_0x44b8('0xb')][_0x44b8('0x4b')]=function(_0x520929,_0x37e42e){var _0x454fe6={'role':_0x44b8('0x49')};_0x454fe6[_0x520929]=this['channel'][_0x44b8('0x36')];this['rpc'][_0x44b8('0x4b')](_0x454fe6)['then'](function(_0x176536){_0x37e42e(null,_[_0x44b8('0x3f')](_0x176536)?![]:!![]);})[_0x44b8('0x10')](function(_0xb64e26){logger[_0x44b8('0x27')](_0xb64e26);_0x37e42e(null,![]);});};AGIVertices[_0x44b8('0xb')]['agentLogin']=function(_0x2af6be,_0x4a08e8){var _0x458bdf={'role':_0x44b8('0x49')};_0x458bdf[_0x2af6be]=this['channel'][_0x44b8('0x36')];var _0x1ee26b=_0x2af6be!=_0x44b8('0x4c')?util[_0x44b8('0x23')](_0x44b8('0x4d'),_0x44b8('0x4e'),this[_0x44b8('0x9')][_0x44b8('0x36')]):undefined;this[_0x44b8('0xa')][_0x44b8('0x4f')](_0x458bdf,_0x1ee26b)[_0x44b8('0xe')](function(_0x27869f){_0x4a08e8(null,_['isNil'](_0x27869f)?![]:!![]);})[_0x44b8('0x10')](function(_0x4052a9){logger[_0x44b8('0x27')](_0x4052a9);_0x4a08e8(null,![]);});};AGIVertices['prototype'][_0x44b8('0x50')]=function(_0x5cc122,_0x5bff09){sh[_0x44b8('0x51')](_[_0x44b8('0x52')](_0x5cc122),function(_0xb89680,_0x3d80c3){var _0x44bb6b=_0x3d80c3['replace'](/(\r\n|\n|\r)/gm,'');_0x5bff09(null,_0x44bb6b);});};AGIVertices[_0x44b8('0xb')][_0x44b8('0x53')]=function(_0x279753,_0x270224){scripts[_0x44b8('0x53')](_0x279753[_0x44b8('0x54')],_0x279753[_0x44b8('0x55')]||_0x44b8('0x56'),_0x279753['text'],_0x279753[_0x44b8('0x57')]||_0x44b8('0x58'),_0x279753[_0x44b8('0x59')]||_0x44b8('0x5a'),_0x279753['audioEncoding']||'MP3')['then'](function(_0x118f89){_0x270224(null,_0x118f89);})[_0x44b8('0x10')](function(_0x1bee2e){_0x270224(_0x1bee2e);});};AGIVertices[_0x44b8('0xb')][_0x44b8('0x5b')]=function(_0x5beb66,_0x26745c){scripts['googleTTS'](_0x5beb66[_0x44b8('0x56')],_0x5beb66[_0x44b8('0x5c')]||'en',0x1)[_0x44b8('0xe')](function(_0x5da034){_0x26745c(null,_0x5da034);})['catch'](function(_0xb4c6dc){_0x26745c(_0xb4c6dc);});};AGIVertices[_0x44b8('0xb')][_0x44b8('0x5d')]=function(_0x536734,_0x1f5277){var _0x36f217={'uri':_0x536734[_0x44b8('0x5e')],'method':_0x536734[_0x44b8('0x5f')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x536734[_0x44b8('0x60')])==='number'&&parseInt(_0x536734[_0x44b8('0x60')])>=0x1?parseInt(_0x536734[_0x44b8('0x60')])*0x3e8:0x5*0x3e8};if(_[_0x44b8('0x61')]([_0x44b8('0x62'),_0x44b8('0x63')],_0x36f217['method'][_0x44b8('0x64')]())){try{_0x36f217[_0x44b8('0x65')]=_0x536734[_0x44b8('0x66')]?JSON[_0x44b8('0x67')](_0x536734[_0x44b8('0x66')]):{};}catch(_0x1bd9e9){logger[_0x44b8('0x27')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x1bd9e9);}}try{_0x36f217[_0x44b8('0x68')]=_0x536734[_0x44b8('0x6')]?JSON['parse'](_0x536734[_0x44b8('0x6')]):{};}catch(_0xa19e5f){logger['error'](_0x44b8('0x69'),_0xa19e5f);}if(_0x536734['computedVariables']){try{var _0x56dccf=require(_0x536734[_0x44b8('0x6a')])[_0x44b8('0x6b')](this,_0x36f217);_0x36f217[_0x44b8('0x6c')]=Mustache['render'](_0x536734['url'],_0x56dccf,{},['$$','$$']);if(_0x36f217['headers']){_0x36f217[_0x44b8('0x68')]=JSON[_0x44b8('0x67')](Mustache[_0x44b8('0x6d')](JSON[_0x44b8('0x6e')](_0x36f217[_0x44b8('0x68')]),_0x56dccf,{},['$$','$$']));}if(_0x36f217[_0x44b8('0x65')]){_0x36f217[_0x44b8('0x65')]=JSON[_0x44b8('0x67')](Mustache['render'](JSON[_0x44b8('0x6e')](_0x36f217['body']),_0x56dccf,{},['$$','$$']));}}catch(_0x59e7b4){logger['error'](_0x44b8('0x6f'),_0x59e7b4);}}rp(_0x36f217)['then'](function(_0x2166df){var _0x1e37fd={'statusCode':_0x2166df[_0x44b8('0x70')]||0xc8,'statusMessage':_0x2166df[_0x44b8('0x71')]||'OK','headers':_0x2166df[_0x44b8('0x68')]||{},'body':_0x2166df[_0x44b8('0x65')]||{}};_0x1f5277(null,_0x1e37fd);})[_0x44b8('0x10')](function(_0x953f65){var _0x5e8e0b={'statusCode':_0x953f65[_0x44b8('0x70')]||0x1f4,'statusMessage':_0x953f65[_0x44b8('0x72')]||_0x44b8('0x73'),'headers':_0x953f65[_0x44b8('0x74')][_0x44b8('0x68')]||{},'body':_0x953f65[_0x44b8('0x74')][_0x44b8('0x65')]||{}};_0x1f5277(null,_0x5e8e0b);});};AGIVertices[_0x44b8('0xb')][_0x44b8('0x75')]=function(_0x5f4734,_0x4b45a7){scripts[_0x44b8('0x75')](this['channel'][_0x44b8('0x33')],_0x5f4734[_0x44b8('0x76')],_0x5f4734[_0x44b8('0x56')],_0x5f4734['dialogflow_language']||'en')['then'](function(_0x4b22e7){_0x4b45a7(null,_0x4b22e7);})[_0x44b8('0x10')](function(_0x4860af){_0x4b45a7(_0x4860af);});};AGIVertices[_0x44b8('0xb')][_0x44b8('0x77')]=function(_0xf18cb2,_0x322a49){scripts[_0x44b8('0x77')](this[_0x44b8('0x9')][_0x44b8('0x33')],_0xf18cb2[_0x44b8('0x78')],_0xf18cb2[_0x44b8('0x79')],_0xf18cb2[_0x44b8('0x7a')],_0xf18cb2[_0x44b8('0x56')],_0xf18cb2[_0x44b8('0x7b')]||'en')[_0x44b8('0xe')](function(_0x1abe3a){_0x322a49(null,_0x1abe3a);})['catch'](function(_0x410b3a){_0x322a49(_0x410b3a);});};AGIVertices[_0x44b8('0xb')][_0x44b8('0x7c')]=function(_0x379b35,_0x45a6c3){scripts[_0x44b8('0x7c')](this[_0x44b8('0x9')],_0x379b35)[_0x44b8('0xe')](function(_0x39dc52){_0x45a6c3(null,_0x39dc52);})[_0x44b8('0x10')](function(_0x1774db){_0x45a6c3(_0x1774db);});};AGIVertices[_0x44b8('0xb')][_0x44b8('0x7d')]=function(_0x4f9b68,_0xfb6160){scripts[_0x44b8('0x7d')](_0x4f9b68[_0x44b8('0x76')],_0x4f9b68['text'],_0x4f9b68['ispeech_tts_language']||_0x44b8('0x58'),_0x4f9b68[_0x44b8('0x7e')])[_0x44b8('0xe')](function(_0x57c4d7){_0xfb6160(null,_0x57c4d7);})[_0x44b8('0x10')](function(_0x419852){_0xfb6160(_0x419852);});};AGIVertices[_0x44b8('0xb')][_0x44b8('0x7f')]=function(_0x1d7b07,_0x4695b3,_0x327f5a){scripts[_0x44b8('0x7f')](_0x4695b3,_0x1d7b07['key'],_0x1d7b07[_0x44b8('0x80')]||_0x44b8('0x58'),this[_0x44b8('0x81')](_0x1d7b07[_0x44b8('0x82')])?_0x1d7b07[_0x44b8('0x82')]:undefined)[_0x44b8('0xe')](function(_0x9d6d07){_0x327f5a(null,_0x9d6d07);})['catch'](function(_0x5c8ce9){_0x327f5a(_0x5c8ce9);});};AGIVertices['prototype'][_0x44b8('0x83')]=function(_0xc5f9ef,_0x2d74ee){scripts[_0x44b8('0x83')](_0xc5f9ef[_0x44b8('0x84')],_0xc5f9ef[_0x44b8('0x85')],_0xc5f9ef[_0x44b8('0x86')],_0xc5f9ef[_0x44b8('0x87')]||_0x44b8('0x88'),_0xc5f9ef['text'],_0xc5f9ef[_0x44b8('0x89')]||_0x44b8('0x56'))['then'](function(_0x4e204b){_0x2d74ee(null,_0x4e204b);})[_0x44b8('0x10')](function(_0x4ee9e3){_0x2d74ee(_0x4ee9e3);});};AGIVertices[_0x44b8('0xb')][_0x44b8('0x8a')]=function(_0x207164,_0x5e5e1d){scripts[_0x44b8('0x8a')](this[_0x44b8('0x9')][_0x44b8('0x33')],_0x207164[_0x44b8('0x84')],_0x207164['aws_secret_access_key'],_0x207164[_0x44b8('0x8b')],_0x207164['text'],_0x207164[_0x44b8('0x8c')])[_0x44b8('0xe')](function(_0x2d9d62){_0x5e5e1d(null,_0x2d9d62);})[_0x44b8('0x10')](function(_0x3fe77d){_0x5e5e1d(_0x3fe77d);});};AGIVertices[_0x44b8('0xb')][_0x44b8('0x8d')]=function(_0x5b3e72,_0x4d3b82,_0x563d7d){scripts[_0x44b8('0x8d')](_0x4d3b82,_0x5b3e72[_0x44b8('0x76')],_0x5b3e72[_0x44b8('0x8e')]||_0x44b8('0x58'))[_0x44b8('0xe')](function(_0x185b3c){_0x563d7d(null,_0x185b3c);})[_0x44b8('0x10')](function(_0x1236df){_0x563d7d(_0x1236df);});};AGIVertices[_0x44b8('0xb')][_0x44b8('0x8f')]=function(_0x32057a,_0x3dfb2c,_0x3cd117){scripts[_0x44b8('0x8f')](_0x3dfb2c,_0x32057a[_0x44b8('0x90')],_0x32057a[_0x44b8('0x91')],_0x32057a[_0x44b8('0x6c')])[_0x44b8('0xe')](function(_0x5cf8ba){_0x3cd117(null,_0x5cf8ba);})[_0x44b8('0x10')](function(_0x49aecf){_0x3cd117(_0x49aecf);});};AGIVertices[_0x44b8('0xb')]['clear']=function(_0x5db410){var _0x2e171b=_['includes'](verticesWithRetry,_0x5db410['agicommand'])?_0x5db410:_['clone'](_0x5db410);for(var _0x4aa919 in _0x2e171b){if(_0x2e171b['hasOwnProperty'](_0x4aa919)){if(_0x2e171b[_0x4aa919]&&_[_0x44b8('0x92')](_0x2e171b[_0x4aa919])){if(_[_0x44b8('0x61')](recursiveMapAttributes,_0x4aa919)){_0x2e171b[_0x4aa919]=this[_0x44b8('0x93')](_0x2e171b[_0x4aa919]);}else{_0x2e171b[_0x4aa919]=this[_0x44b8('0x94')](_0x2e171b[_0x4aa919]);}}}}return _0x2e171b;};AGIVertices['prototype'][_0x44b8('0x95')]=function(_0x416c89){for(var _0x5bcd22 in _0x416c89){if(_0x416c89['hasOwnProperty'](_0x5bcd22)){if(_[_0x44b8('0x96')](_0x416c89[_0x5bcd22])){this[_0x44b8('0x95')](_0x416c89[_0x5bcd22]);}else if(_[_0x44b8('0x97')](_0x416c89[_0x5bcd22])){for(var _0x507eda=0x0;_0x507eda<_0x416c89[_0x5bcd22][_0x44b8('0x98')];_0x507eda++){this[_0x44b8('0x95')](_0x416c89[_0x5bcd22][_0x507eda]);}}else if(_[_0x44b8('0x92')](_0x416c89[_0x5bcd22])){_0x416c89[_0x5bcd22]=this[_0x44b8('0x94')](_0x416c89[_0x5bcd22]);}}}};AGIVertices[_0x44b8('0xb')][_0x44b8('0x99')]=function(_0x25f605,_0x16344b){for(var _0x21057f in _0x25f605){if(_0x25f605['hasOwnProperty'](_0x21057f)){if(_[_0x44b8('0x96')](_0x25f605[_0x21057f])){if(!_[_0x44b8('0x3e')](_0x25f605[_0x21057f])){this['saveRestApiResult'](_0x25f605[_0x21057f],util[_0x44b8('0x23')](_0x44b8('0x9a'),_0x16344b,_0x21057f));}}else if(_[_0x44b8('0x97')](_0x25f605[_0x21057f])){for(var _0x4da0a5=0x0;_0x4da0a5<_0x25f605[_0x21057f][_0x44b8('0x98')];_0x4da0a5++){this['saveRestApiResult'](_0x25f605[_0x21057f][_0x4da0a5],util[_0x44b8('0x23')](_0x44b8('0x9a'),_0x16344b,_0x21057f+'['+_0x4da0a5+']'));}}else{if(!_['isNil'](_0x25f605[_0x21057f])){this[_0x44b8('0x9')][_0x44b8('0x9b')](util[_0x44b8('0x23')](_0x44b8('0x9a'),_0x16344b,_0x21057f),_0x25f605[_0x21057f]);}}}}};AGIVertices['prototype'][_0x44b8('0x93')]=function(_0xf73cde){try{var _0x10caca=JSON[_0x44b8('0x67')](_0xf73cde);this[_0x44b8('0x95')](_0x10caca);return JSON[_0x44b8('0x6e')](_0x10caca);}catch(_0x10a66a){return this[_0x44b8('0x94')](_0xf73cde);}};AGIVertices[_0x44b8('0xb')]['replaceAllVariables']=function(_0x53cbee){var _0x331e89=_0x53cbee[_0x44b8('0x9c')]('{');for(var _0x1d29cd=0x1;_0x1d29cd<_0x331e89[_0x44b8('0x98')];_0x1d29cd+=0x1){var _0x276c14=_0x331e89[_0x1d29cd]['split']('}');if(_0x276c14[_0x44b8('0x98')]>0x1){_0x53cbee=_0x53cbee['replaceAll']('{'+_0x276c14[0x0]+'}',this[_0x44b8('0x9')]['getVariable'](_0x276c14[0x0])[_0x44b8('0x9d')]||_0x276c14[0x0]);}}if(_0x331e89[_0x44b8('0x98')]===0x1){return _0x53cbee[_0x44b8('0x46')]();}return this[_0x44b8('0x94')](_0x53cbee);};AGIVertices[_0x44b8('0xb')][_0x44b8('0x9e')]=function(_0x1ee7d1,_0x465ef7){var _0x1c7d88=this['channel'][_0x44b8('0xc')](_0x1ee7d1);if(_0x1c7d88[_0x44b8('0x9f')]===-0x1){return _0x1c7d88;}logger[_0x44b8('0x29')](util[_0x44b8('0x23')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x465ef7,_0x1c7d88['extra']));return this['channel'][_0x44b8('0x9b')](_0x465ef7,_0x1c7d88['extra']);};AGIVertices['prototype'][_0x44b8('0x81')]=function(_0x317337){return _0x317337&&_0x317337!=='0'&&_0x317337!=='-1'&&_0x317337!=='';};AGIVertices[_0x44b8('0xb')][_0x44b8('0xa0')]=function(_0x413dd9){this[_0x44b8('0x32')][_0x44b8('0x6b')](this,_0x413dd9,'-');_0x413dd9[_0x44b8('0xa1')]=_0x413dd9['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x44b8('0xb')][_0x44b8('0xa2')]=function(_0x1e2407){logger[_0x44b8('0x29')](util['format'](_0x44b8('0xa3'),_0x1e2407[_0x44b8('0x34')]));if(!this[_0x44b8('0x81')](_0x1e2407['text'])){return this['channel'][_0x44b8('0xa4')](_0x44b8('0xa5'));}var _0x187213='\x22'+_0x1e2407[_0x44b8('0x56')]+'\x22';if(this[_0x44b8('0x81')](_0x1e2407['options'])){_0x187213+=','+_0x1e2407[_0x44b8('0x74')];}var _0x458cfc=this['channel'][_0x44b8('0x51')](_0x44b8('0xa6'),_0x187213);if(_0x458cfc[_0x44b8('0x9f')]===-0x1){return _0x458cfc;}return this[_0x44b8('0x9')]['noop'](util[_0x44b8('0x23')]('Executed\x20command\x20MRCPSynth\x20%s',_0x187213));};AGIVertices[_0x44b8('0xb')][_0x44b8('0xa7')]=function(_0x1eb1b7){logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0xa8'),_0x1eb1b7[_0x44b8('0x34')]));if(!this[_0x44b8('0x81')](_0x1eb1b7['grammar'])){return this[_0x44b8('0x9')][_0x44b8('0xa4')](_0x44b8('0xa9'));}var _0x42e772=_0x1eb1b7[_0x44b8('0xaa')];if(this[_0x44b8('0x81')](_0x1eb1b7['options'])){_0x42e772+=','+_0x1eb1b7['options'];}var _0x342125=this[_0x44b8('0x9')]['exec'](_0x44b8('0xab'),_0x42e772);if(_0x342125[_0x44b8('0x9f')]===-0x1){return _0x342125;}var _0x4e83b6=this[_0x44b8('0x9e')](_0x44b8('0xac'),_0x44b8('0xad'));if(_0x4e83b6[_0x44b8('0x9f')]===-0x1){return _0x4e83b6;}var _0x334522=this[_0x44b8('0x9e')](_0x44b8('0xae'),_0x44b8('0xaf'));if(_0x334522[_0x44b8('0x9f')]===-0x1){return _0x334522;}var _0x225f18=this[_0x44b8('0x9e')](_0x44b8('0xb0'),_0x44b8('0xb1'));if(_0x225f18[_0x44b8('0x9f')]===-0x1){return _0x225f18;}return this[_0x44b8('0x9')]['noop'](util[_0x44b8('0x23')](_0x44b8('0xb2'),_0x42e772));};AGIVertices[_0x44b8('0xb')][_0x44b8('0x5')]=function(_0x584768){logger[_0x44b8('0x29')](util[_0x44b8('0x23')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x584768[_0x44b8('0x34')]));return this['channel'][_0x44b8('0x5')]([_0x584768[_0x44b8('0xb3')],_0x584768[_0x44b8('0xb4')]]);};AGIVertices[_0x44b8('0xb')]['answer']=function(_0x4ff9c0){logger[_0x44b8('0x29')](util[_0x44b8('0x23')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x4ff9c0['label']));if(this['isConfigured'](_0x4ff9c0[_0x44b8('0x60')])){logger[_0x44b8('0x29')](util[_0x44b8('0x23')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x4ff9c0['timeout']));var _0x28da8b=this[_0x44b8('0x9')][_0x44b8('0xb5')](_0x4ff9c0[_0x44b8('0x60')]);if(_0x28da8b[_0x44b8('0x9f')]===-0x1){return _0x28da8b;}}return this[_0x44b8('0x9')][_0x44b8('0xb6')]();};AGIVertices[_0x44b8('0xb')][_0x44b8('0x45')]=function(_0x4ed62f){logger[_0x44b8('0x29')](util['format'](_0x44b8('0xb7'),_0x4ed62f['label']));if(!this['isConfigured'](_0x4ed62f[_0x44b8('0xb8')])){return this[_0x44b8('0x9')][_0x44b8('0x27')](_0x4ed62f,_0x44b8('0xb9'));}_0x4ed62f[_0x44b8('0x44')]=moment();if(this[_0x44b8('0x81')](_0x4ed62f[_0x44b8('0xba')])){_0x4ed62f[_0x44b8('0x44')]=moment()[_0x44b8('0xbb')](_0x4ed62f['delay'],_0x44b8('0xbc'));}if(!this[_0x44b8('0x81')](_0x4ed62f[_0x44b8('0xbd')])){_0x4ed62f['callback_priority']=0x2;}this['createCmContact'][_0x44b8('0x6b')](this,_0x4ed62f);return this['channel'][_0x44b8('0xa4')](util['format'](_0x44b8('0xbe'),_0x4ed62f['phone'],_0x4ed62f['list_id'],_0x4ed62f[_0x44b8('0x44')]));};AGIVertices[_0x44b8('0xb')]['custom_app']=function(_0x32e08e){logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0xbf'),_0x32e08e[_0x44b8('0x34')]));var _0x57b73f=this[_0x44b8('0x9')]['exec'](_0x32e08e['application'],_0x32e08e['options']);if(_0x57b73f[_0x44b8('0x9f')]===-0x1){return _0x57b73f;}return this[_0x44b8('0x9')]['noop'](util[_0x44b8('0x23')](_0x44b8('0xc0'),_0x32e08e['application'],_0x32e08e['options']));};AGIVertices[_0x44b8('0xb')][_0x44b8('0xc1')]=function(_0x51adc0){logger[_0x44b8('0x29')](util[_0x44b8('0x23')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x51adc0[_0x44b8('0x34')]));if(!this[_0x44b8('0x81')](_0x51adc0['text'])){return this[_0x44b8('0x9')][_0x44b8('0xa4')](_0x44b8('0xa5'));}var _0x4edc9b='\x22'+_0x51adc0[_0x44b8('0x56')]+'\x22';if(this['isConfigured'](_0x51adc0[_0x44b8('0x74')])){_0x4edc9b+=','+_0x51adc0['options'];}var _0x5eedf4=this[_0x44b8('0x9')][_0x44b8('0x51')](_0x44b8('0xa6'),_0x4edc9b);if(_0x5eedf4[_0x44b8('0x9f')]===-0x1){return _0x5eedf4;}return this[_0x44b8('0x9')][_0x44b8('0xa4')](util[_0x44b8('0x23')](_0x44b8('0xc2'),_0x4edc9b));};AGIVertices[_0x44b8('0xb')][_0x44b8('0xc3')]=function(_0x1b5352){logger['info'](util[_0x44b8('0x23')](_0x44b8('0xc4'),_0x1b5352[_0x44b8('0x34')]));if(!this[_0x44b8('0x81')](_0x1b5352[_0x44b8('0x56')])){return this[_0x44b8('0x9')][_0x44b8('0xa4')](_0x44b8('0xa5'));}var _0x5c2adc='\x22'+_0x1b5352[_0x44b8('0x56')]+'\x22';if(this[_0x44b8('0x81')](_0x1b5352['options'])){_0x5c2adc+=','+_0x1b5352[_0x44b8('0x74')];}var _0x355a20=this[_0x44b8('0x9')]['exec']('MRCPSynth',_0x5c2adc);if(_0x355a20[_0x44b8('0x9f')]===-0x1){return _0x355a20;}return this[_0x44b8('0x9')]['noop'](util['format'](_0x44b8('0xc2'),_0x5c2adc));};AGIVertices[_0x44b8('0xb')][_0x44b8('0xc5')]=function(_0x2bccf9){logger[_0x44b8('0x29')](util['format'](_0x44b8('0xc6'),_0x2bccf9['label']));if(!this[_0x44b8('0x81')](_0x2bccf9[_0x44b8('0xaa')])){return this[_0x44b8('0x9')][_0x44b8('0xa4')](_0x44b8('0xa9'));}var _0x180c33=_0x2bccf9['grammar'];if(this[_0x44b8('0x81')](_0x2bccf9['options'])){_0x180c33+=','+_0x2bccf9[_0x44b8('0x74')];}var _0x1233a3=this['channel'][_0x44b8('0x51')]('MRCPRecog',_0x180c33);if(_0x1233a3[_0x44b8('0x9f')]===-0x1){return _0x1233a3;}var _0x371094=this[_0x44b8('0x9e')]('RECOG_CONFIDENCE()',_0x44b8('0xc7'));if(_0x371094[_0x44b8('0x9f')]===-0x1){return _0x371094;}var _0x4ff63e=this[_0x44b8('0x9e')]('RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT');if(_0x4ff63e[_0x44b8('0x9f')]===-0x1){return _0x4ff63e;}var _0x4da59c=this[_0x44b8('0x9e')]('RECOG_INSTANCE()',_0x44b8('0xc8'));if(_0x4da59c[_0x44b8('0x9f')]===-0x1){return _0x4da59c;}return this['channel'][_0x44b8('0xa4')](util[_0x44b8('0x23')]('Executed\x20command\x20MRCPRecog\x20%s',_0x180c33));};AGIVertices['prototype'][_0x44b8('0xc9')]=function(_0x440eb4){logger[_0x44b8('0x29')](util[_0x44b8('0x23')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x440eb4[_0x44b8('0x34')]));if(!this[_0x44b8('0x81')](_0x440eb4[_0x44b8('0xaa')])){return this[_0x44b8('0x9')]['noop']('no\x20grammar\x20configured');}var _0xf7cbd8=_0x440eb4[_0x44b8('0xaa')];if(this[_0x44b8('0x81')](_0x440eb4['options'])){_0xf7cbd8+=','+_0x440eb4[_0x44b8('0x74')];}var _0x301770=this['channel'][_0x44b8('0x51')](_0x44b8('0xab'),_0xf7cbd8);if(_0x301770[_0x44b8('0x9f')]===-0x1){return _0x301770;}var _0x2cb698=this[_0x44b8('0x9e')](_0x44b8('0xac'),'SESTEK_ASR_CONFIDENCE');if(_0x2cb698['result']===-0x1){return _0x2cb698;}var _0x46382c=this['getAndSetVariable'](_0x44b8('0xae'),'SESTEK_ASR_TRANSCRIPT');if(_0x46382c[_0x44b8('0x9f')]===-0x1){return _0x46382c;}var _0x36d09c=this[_0x44b8('0x9e')](_0x44b8('0xb0'),_0x44b8('0xca'));if(_0x36d09c[_0x44b8('0x9f')]===-0x1){return _0x36d09c;}return this[_0x44b8('0x9')][_0x44b8('0xa4')](util[_0x44b8('0x23')](_0x44b8('0xb2'),_0xf7cbd8));};AGIVertices[_0x44b8('0xb')][_0x44b8('0xcb')]=function(_0xb8404f){logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0xcc'),_0xb8404f['label']));if(!this[_0x44b8('0x81')](_0xb8404f['odbc_id'])){return this[_0x44b8('0x9')][_0x44b8('0x27')](_0xb8404f,_0x44b8('0xcd'));}var _0x10fd21=this[_0x44b8('0x12')][_0x44b8('0x6b')](this,_0xb8404f[_0x44b8('0xce')]);if(!_0x10fd21){return this['channel']['error'](_0xb8404f,_0x44b8('0xcf'));}if(!this[_0x44b8('0x81')](_0xb8404f[_0x44b8('0x2b')])){return this[_0x44b8('0x9')][_0x44b8('0x27')](_0xb8404f,'no\x20query\x20configured');}var _0x32c4a4=_0xb8404f[_0x44b8('0x2b')][_0x44b8('0xd0')](/(\r\n|\n|\r)/gm,'\x20');this[_0x44b8('0x9')][_0x44b8('0xa4')](util[_0x44b8('0x23')]('query:\x20%s',_0x32c4a4));var _0x4d07e=this[_0x44b8('0x25')][_0x44b8('0x6b')](this,_0x10fd21,_0x32c4a4);this[_0x44b8('0x32')][_0x44b8('0x6b')](this,_0xb8404f,_0x32c4a4);if(!this['isConfigured'](_0xb8404f['variable_id'])){return this[_0x44b8('0x9')][_0x44b8('0xa4')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x5ae640=this[_0x44b8('0xc')]['sync'](this,_0xb8404f[_0x44b8('0xd1')]);if(!_0x5ae640){return this[_0x44b8('0x9')][_0x44b8('0x27')](_0xb8404f,_0x44b8('0xd2'));}var _0x3de181=this;_0x4d07e[_0x44b8('0xd3')](function(_0x249f6a,_0x42c8a5){Object['keys'](_0x249f6a)[_0x44b8('0xd3')](function(_0xf24cdd){_0x3de181[_0x44b8('0x9')]['setVariable'](util[_0x44b8('0x23')](_0x44b8('0xd4'),_0x5ae640,_0x42c8a5,_0xf24cdd),_0x249f6a[_0xf24cdd]);});});this['channel']['setVariable'](util['format']('%s_ROWS_COUNT',_0x5ae640),_0x4d07e[_0x44b8('0x98')]);return this['channel']['noop'](util[_0x44b8('0x23')](_0x44b8('0xd5'),_0x5ae640));};AGIVertices[_0x44b8('0xb')]['dial']=function(_0x36927e){logger['debug'](util[_0x44b8('0x23')](_0x44b8('0xd6'),_0x36927e[_0x44b8('0x34')]));if(!this[_0x44b8('0x81')](_0x36927e['sip_id'])){return this[_0x44b8('0x9')][_0x44b8('0x27')](_0x36927e,_0x44b8('0xd7'));}var _0x494697=this['getUser']['sync'](this,_0x36927e[_0x44b8('0xd8')]);if(!_0x494697){return this[_0x44b8('0x9')]['error'](_0x36927e,_0x44b8('0xd9'));}var _0x188744=this[_0x44b8('0x9')][_0x44b8('0x51')](_0x44b8('0xda'),[util[_0x44b8('0x23')](_0x44b8('0xdb'),_0x494697),_0x36927e[_0x44b8('0x60')],_0x36927e['opts'],_0x36927e[_0x44b8('0x5e')]]);if(_0x188744[_0x44b8('0x9f')]===-0x1){return _0x188744;}return this[_0x44b8('0x9')]['noop'](util[_0x44b8('0x23')]('Executed\x20command\x20%s',_0x44b8('0xda')));};AGIVertices['prototype'][_0x44b8('0xdc')]=function(_0x1978a9){logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0xdd'),_0x1978a9[_0x44b8('0x34')]));if(!this[_0x44b8('0x81')](_0x1978a9[_0x44b8('0x76')])){return this[_0x44b8('0x9')][_0x44b8('0xa4')](_0x44b8('0xde'));}if(!this[_0x44b8('0x81')](_0x1978a9['text'])){return this[_0x44b8('0x9')]['noop'](_0x44b8('0xa5'));}this['channel'][_0x44b8('0xdf')]=!![];this[_0x44b8('0x32')](_0x1978a9);this[_0x44b8('0x3c')](_0x1978a9[_0x44b8('0x56')],'in','','');this[_0x44b8('0x9')][_0x44b8('0xa4')](util[_0x44b8('0x23')]('Trying\x20Dialogflow:\x20%s',_0x1978a9[_0x44b8('0x56')]));var _0x2ea253=this[_0x44b8('0x75')][_0x44b8('0x6b')](this,_0x1978a9);if(_0x2ea253){for(var _0x3ee44e in _0x2ea253){if(_0x2ea253[_0x44b8('0xe0')](_0x3ee44e)){this[_0x44b8('0x9')][_0x44b8('0x9b')](util[_0x44b8('0x23')](_0x44b8('0xe1'),_0x3ee44e[_0x44b8('0x64')]()),_0x2ea253[_0x3ee44e]);}}this[_0x44b8('0x3c')](_0x2ea253[_0x44b8('0xe2')],_0x44b8('0xe3'),'dialogflow','');return this[_0x44b8('0x9')][_0x44b8('0xa4')](util['format'](_0x44b8('0xe4'),_0x2ea253[_0x44b8('0xe2')]));}return this[_0x44b8('0x9')][_0x44b8('0x27')](_0x1978a9,_0x44b8('0xe5'));};AGIVertices['prototype'][_0x44b8('0xe6')]=function(_0x1c8718){logger[_0x44b8('0x29')](util[_0x44b8('0x23')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x1c8718[_0x44b8('0x34')]));if(!this[_0x44b8('0x81')](_0x1c8718['dialogflowV2_project_id'])){return this['channel']['noop']('no\x20project_id\x20configured');}if(!this[_0x44b8('0x81')](_0x1c8718['client_email'])){return this['channel'][_0x44b8('0xa4')](_0x44b8('0xe7'));}if(!this[_0x44b8('0x81')](_0x1c8718['private_key'])){return this[_0x44b8('0x9')][_0x44b8('0xa4')](_0x44b8('0xe8'));}if(!this[_0x44b8('0x81')](_0x1c8718['dialogflowV2_language'])){return this[_0x44b8('0x9')]['noop'](_0x44b8('0xe9'));}if(!this[_0x44b8('0x81')](_0x1c8718['text'])){return this[_0x44b8('0x9')][_0x44b8('0xa4')](_0x44b8('0xa5'));}this[_0x44b8('0x9')][_0x44b8('0xdf')]=!![];this['createSquareDetailsReport'](_0x1c8718);this['createSquareMessage'](_0x1c8718[_0x44b8('0x56')],'in','','');this[_0x44b8('0x9')][_0x44b8('0xa4')](util[_0x44b8('0x23')](_0x44b8('0xea'),_0x1c8718[_0x44b8('0x56')]));var _0x1bed4f=this[_0x44b8('0x77')][_0x44b8('0x6b')](this,_0x1c8718);if(_0x1bed4f){for(var _0x157824 in _0x1bed4f){if(_0x1bed4f[_0x44b8('0xe0')](_0x157824)){if(_0x157824!==_0x44b8('0xeb')){this['channel']['setVariable'](util[_0x44b8('0x23')]('DIALOGFLOW_%s',_0x157824[_0x44b8('0x64')]()),_0x1bed4f[_0x157824]);}}}this[_0x44b8('0x3c')](_0x1bed4f[_0x44b8('0xe2')],'out',_0x44b8('0xe6'),_0x1bed4f[_0x44b8('0xeb')]);return this[_0x44b8('0x9')][_0x44b8('0xa4')](util[_0x44b8('0x23')](_0x44b8('0xec'),_0x1bed4f['speech']));}return this[_0x44b8('0x9')][_0x44b8('0x27')](_0x1c8718,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0x44b8('0xb')][_0x44b8('0xed')]=function(_0x22edd7){logger[_0x44b8('0x29')](util[_0x44b8('0x23')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x22edd7[_0x44b8('0x34')]));if(!this[_0x44b8('0x81')](_0x22edd7[_0x44b8('0xee')])){return this[_0x44b8('0x9')][_0x44b8('0xa4')](_0x44b8('0xef'));}if(!this[_0x44b8('0x81')](_0x22edd7[_0x44b8('0xf0')])){return this[_0x44b8('0x9')][_0x44b8('0xa4')]('no\x20username\x20configured');}if(!this[_0x44b8('0x81')](_0x22edd7[_0x44b8('0xf1')])){return this[_0x44b8('0x9')]['noop']('no\x20password\x20configured');}if(!this[_0x44b8('0x81')](_0x22edd7['ndassistant_url'])){return this[_0x44b8('0x9')][_0x44b8('0xa4')](_0x44b8('0xa5'));}this[_0x44b8('0x9')][_0x44b8('0xdf')]=!![];this[_0x44b8('0x32')](_0x22edd7);this[_0x44b8('0x3c')](_0x22edd7['text'],'in','','');this['channel'][_0x44b8('0xa4')](util[_0x44b8('0x23')](_0x44b8('0xf2'),_0x22edd7[_0x44b8('0x56')]));var _0x506731=this[_0x44b8('0x7c')]['sync'](this,_0x22edd7);if(_0x506731){for(var _0x4d88a6 in _0x506731){if(_0x506731[_0x44b8('0xe0')](_0x4d88a6)){this[_0x44b8('0x9')][_0x44b8('0x9b')](util[_0x44b8('0x23')](_0x44b8('0xf3'),_0x4d88a6[_0x44b8('0x64')]()),_0x506731[_0x4d88a6]);}}this[_0x44b8('0x3c')](_0x506731['speech'],_0x44b8('0xe3'),_0x44b8('0xed'),'');if(_0x506731[_0x44b8('0xf4')]){this['channel'][_0x44b8('0xa4')](util[_0x44b8('0x23')](_0x44b8('0xf5'),_0x506731[_0x44b8('0xf4')]));var _0x4dd93c=this[_0x44b8('0x9')][_0x44b8('0xf6')](_0x506731[_0x44b8('0xf4')]);try{fs['unlink'](_0x506731['audiofile']+'.wav');}catch(_0x4b3c64){logger['error'](_0x4b3c64);}return _0x4dd93c;}else{return this[_0x44b8('0x9')][_0x44b8('0xa4')](util[_0x44b8('0x23')](_0x44b8('0xf7'),_0x506731[_0x44b8('0xe2')]));}}return this[_0x44b8('0x9')][_0x44b8('0x27')](_0x22edd7,_0x44b8('0xf8'));};AGIVertices[_0x44b8('0xb')][_0x44b8('0xf9')]=function(_0x16e1d6){logger['info'](util[_0x44b8('0x23')](_0x44b8('0xfa'),_0x16e1d6[_0x44b8('0x34')]));return this[_0x44b8('0x9')][_0x44b8('0xa4')]('end');};AGIVertices[_0x44b8('0xb')]['ext_dial']=function(_0x4033b5){logger[_0x44b8('0x29')](util[_0x44b8('0x23')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x4033b5[_0x44b8('0x34')]));var _0x964c3c='';if(_0x4033b5['trunk_id']){if(!this[_0x44b8('0x81')](_0x4033b5[_0x44b8('0xfb')])){return this[_0x44b8('0x9')]['error'](_0x4033b5,_0x44b8('0xfc'));}else{var _0x5495e6=parseInt(_0x4033b5[_0x44b8('0xfb')],0xa);if(isNaN(_0x5495e6)){_0x964c3c=_0x4033b5[_0x44b8('0xfb')];}else{_0x964c3c=this[_0x44b8('0x16')]['sync'](this,_0x4033b5[_0x44b8('0xfb')]);if(!_0x964c3c){return this['channel'][_0x44b8('0x27')](_0x4033b5,_0x44b8('0xfd'));}}}}else if(_0x4033b5[_0x44b8('0xfe')]){_0x964c3c=_0x4033b5[_0x44b8('0xfe')];}else{return this[_0x44b8('0x9')][_0x44b8('0x27')](_0x4033b5,'no\x20trunk\x20selected');}var _0x3c0557=this[_0x44b8('0x9')][_0x44b8('0x51')](_0x44b8('0xda'),[util['format'](_0x44b8('0xff'),_0x964c3c,_0x4033b5[_0x44b8('0x43')]),_0x4033b5[_0x44b8('0x60')],_0x4033b5[_0x44b8('0x100')],_0x4033b5[_0x44b8('0x5e')]]);if(_0x3c0557[_0x44b8('0x9f')]===-0x1){return _0x3c0557;}return this[_0x44b8('0x9')][_0x44b8('0xa4')](util[_0x44b8('0x23')](_0x44b8('0x101'),_0x44b8('0xda')));};AGIVertices[_0x44b8('0xb')]['finally']=function(_0x2cf3ac){logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x102'),_0x2cf3ac['label']));return this[_0x44b8('0x9')]['noop'](_0x44b8('0x103'));};AGIVertices[_0x44b8('0xb')][_0x44b8('0x104')]=function(_0x5baaa3){logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x105'),_0x5baaa3[_0x44b8('0x34')]));if(_0x5baaa3[_0x44b8('0xa1')]===0x0){return this['maxRetry'](_0x5baaa3);}_0x5baaa3[_0x44b8('0xa1')]-=0x1;if(!this[_0x44b8('0x81')](_0x5baaa3[_0x44b8('0x106')])){return this[_0x44b8('0x9')][_0x44b8('0x27')](_0x5baaa3,'no\x20file\x20audio\x20selected');}var _0x422f56=this[_0x44b8('0x18')][_0x44b8('0x6b')](this,_0x5baaa3[_0x44b8('0x106')]);if(!_0x422f56){return this[_0x44b8('0x9')][_0x44b8('0x27')](_0x5baaa3,_0x44b8('0x107'));}if(!this['isConfigured'](_0x5baaa3['variable_id'])){return this['channel'][_0x44b8('0x27')](_0x44b8('0x108'));}var _0x46dd24=this['channel']['getData'](_0x422f56,_0x5baaa3[_0x44b8('0x109')],_0x5baaa3[_0x44b8('0x10a')]);var _0x452d24=_0x46dd24[_0x44b8('0x9f')]?_0x46dd24[_0x44b8('0x9f')]['toString']():'';logger['info']('test',JSON['stringify'](_0x46dd24));if(_0x46dd24[_0x44b8('0x9f')]===-0x1){this[_0x44b8('0x32')][_0x44b8('0x6b')](this,_0x5baaa3,_0x452d24);return _0x46dd24;}else if(_0x46dd24[_0x44b8('0x9d')]===_0x44b8('0x60')){_0x46dd24[_0x44b8('0x9f')]=_0x452d24['length']>=parseInt(_0x5baaa3[_0x44b8('0x10b')])?'x':'i';}else{_0x46dd24['result']=_0x452d24[_0x44b8('0x98')]>=parseInt(_0x5baaa3[_0x44b8('0x10b')])&&_0x452d24[_0x44b8('0x98')]<=parseInt(_0x5baaa3['maxdigit'])?'x':'i';}var _0x529d41=this[_0x44b8('0xc')][_0x44b8('0x6b')](this,_0x5baaa3['variable_id']);if(!_0x529d41){return this['channel'][_0x44b8('0x27')](_0x5baaa3,_0x44b8('0xd2'));}this[_0x44b8('0x9')][_0x44b8('0x9b')](_0x529d41,_0x452d24);if(this[_0x44b8('0x81')](_0x5baaa3['hiddendigitsnum'])){var _0x43f4c3=parseInt(_0x5baaa3[_0x44b8('0x10c')],0xa);var _0x150628=rs[_0x44b8('0x10d')]({'charset':'*','length':_0x43f4c3});var _0x12c9e7=_0x452d24[_0x44b8('0x98')];if(_0x12c9e7>0x0){if(_0x12c9e7>_0x43f4c3){this[_0x44b8('0x32')]['sync'](this,_0x5baaa3,_0x5baaa3[_0x44b8('0x10e')]===_0x44b8('0x10f')?_0x150628+_0x452d24[_0x44b8('0x110')](_0x43f4c3):_0x452d24[_0x44b8('0x110')](0x0,_0x12c9e7-_0x43f4c3)+_0x150628);}else{this[_0x44b8('0x32')][_0x44b8('0x6b')](this,_0x5baaa3,rs['generate']({'charset':'*','length':_0x12c9e7}));}}else{this[_0x44b8('0x32')][_0x44b8('0x6b')](this,_0x5baaa3,'');}}else{this[_0x44b8('0x32')][_0x44b8('0x6b')](this,_0x5baaa3,_0x452d24);}return _0x46dd24;};AGIVertices['prototype'][_0x44b8('0x8')]=function(_0xa2a34b){logger[_0x44b8('0x29')](util[_0x44b8('0x23')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0xa2a34b['label']));return this[_0x44b8('0x104')](_0xa2a34b);};AGIVertices[_0x44b8('0xb')][_0x44b8('0x111')]=function(_0x2468b0){logger[_0x44b8('0x29')](util['format'](_0x44b8('0x112'),_0x2468b0[_0x44b8('0x34')]));this[_0x44b8('0x32')][_0x44b8('0x6b')](this,_0x2468b0,_0x2468b0[_0x44b8('0x113')]);return this[_0x44b8('0x9')]['noop'](util[_0x44b8('0x23')](_0x44b8('0x114'),_0x2468b0[_0x44b8('0x113')]));};AGIVertices[_0x44b8('0xb')][_0x44b8('0x115')]=function(_0x773a46){logger[_0x44b8('0x29')](util['format'](_0x44b8('0x116'),_0x773a46[_0x44b8('0x34')]));if(!this[_0x44b8('0x81')](_0x773a46[_0x44b8('0x84')])||!this['isConfigured'](_0x773a46[_0x44b8('0x85')])){return this['channel'][_0x44b8('0xa4')](_0x44b8('0x117'));}if(!this[_0x44b8('0x81')](_0x773a46[_0x44b8('0x56')])){return this['channel'][_0x44b8('0xa4')](_0x44b8('0xa5'));}this[_0x44b8('0x9')]['noop'](util[_0x44b8('0x23')](_0x44b8('0x118'),_0x773a46[_0x44b8('0x56')]));var _0x37145d=this[_0x44b8('0x83')][_0x44b8('0x6b')](this,_0x773a46);if(_0x37145d){this[_0x44b8('0x9')][_0x44b8('0xa4')](util[_0x44b8('0x23')](_0x44b8('0x119'),_0x37145d));var _0x5dd6a9=this[_0x44b8('0x9')]['streamFile'](_0x37145d);try{fs[_0x44b8('0x11a')](_0x37145d+_0x44b8('0x11b'));}catch(_0xc9881e){logger[_0x44b8('0x27')](_0xc9881e);}return _0x5dd6a9;}return this[_0x44b8('0x9')]['error'](_0x773a46,'aws\x20Polly\x20is\x20unreachable');};AGIVertices['prototype'][_0x44b8('0x11c')]=function(_0x239d16){logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x11d'),_0x239d16[_0x44b8('0x34')]));if(!this['isConfigured'](_0x239d16[_0x44b8('0x84')])||!this[_0x44b8('0x81')](_0x239d16['aws_secret_access_key'])){return this[_0x44b8('0x9')]['noop'](_0x44b8('0x117'));}if(!this[_0x44b8('0x81')](_0x239d16['aws_bot_name'])){return this[_0x44b8('0x9')][_0x44b8('0xa4')]('no\x20bot\x20name\x20configured');}if(!this[_0x44b8('0x81')](_0x239d16[_0x44b8('0x56')])){return this[_0x44b8('0x9')][_0x44b8('0xa4')]('no\x20text\x20configured');}this[_0x44b8('0x9')][_0x44b8('0xdf')]=!![];this[_0x44b8('0x32')](_0x239d16);this[_0x44b8('0x3c')](_0x239d16[_0x44b8('0x56')],'in','','');this[_0x44b8('0x9')][_0x44b8('0xa4')](util['format'](_0x44b8('0x11e'),_0x239d16[_0x44b8('0x56')]));var _0xca3c70=this['awsLex'][_0x44b8('0x6b')](this,_0x239d16);if(_0xca3c70){for(var _0x372015 in _0xca3c70){if(_0xca3c70['hasOwnProperty'](_0x372015)&&_[_0x44b8('0x92')](_0xca3c70[_0x372015])){this[_0x44b8('0x9')][_0x44b8('0x9b')](util[_0x44b8('0x23')]('AWS_LEX_%s',_0x372015[_0x44b8('0x64')]()),_0xca3c70[_0x372015]);}}if(_[_0x44b8('0x3f')](_0xca3c70[_0x44b8('0x72')])){return this[_0x44b8('0x9')][_0x44b8('0xa4')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x44b8('0x3c')](_0xca3c70[_0x44b8('0x72')],'out',_0x44b8('0x11f'),'');return this[_0x44b8('0x9')][_0x44b8('0xa4')](util[_0x44b8('0x23')]('Amazon\x20Lex\x20Result\x20%s',_0xca3c70[_0x44b8('0x72')]));}}return this[_0x44b8('0x9')][_0x44b8('0x27')](_0x239d16,_0x44b8('0x120'));};AGIVertices[_0x44b8('0xb')][_0x44b8('0x121')]=function(_0x87c4b1){logger['info'](util[_0x44b8('0x23')](_0x44b8('0x122'),_0x87c4b1[_0x44b8('0x34')],_0x87c4b1[_0x44b8('0x60')]));if(!this['isConfigured'](_0x87c4b1[_0x44b8('0x76')])){return this[_0x44b8('0x9')][_0x44b8('0xa4')]('no\x20key\x20configured');}var _0x55250c=_0x44b8('0x123');var _0x45e3ef=util[_0x44b8('0x23')](_0x44b8('0x124'),FILES_PATH,rs['generate'](0x4));var _0x3dca15=util[_0x44b8('0x23')]('%s.%s',_0x45e3ef,_0x55250c);var _0xd19a35=!![];if(_0x87c4b1[_0x44b8('0x125')]===_0x44b8('0x126')){_0xd19a35=![];}var _0x559b12=this[_0x44b8('0x9')][_0x44b8('0x127')](_0x45e3ef,_0x55250c,_0x87c4b1[_0x44b8('0x128')],_0x87c4b1[_0x44b8('0x60')],undefined,_0xd19a35);if(_0x559b12[_0x44b8('0x9f')]!==-0x1){this['channel'][_0x44b8('0xa4')](util[_0x44b8('0x23')]('google\x20%s\x20file\x20created',_0x3dca15));var _0x2d2994=this[_0x44b8('0x8d')][_0x44b8('0x6b')](this,_0x87c4b1,_0x3dca15);if(_0x2d2994){for(var _0x3b9cd2 in _0x2d2994){if(_0x2d2994[_0x44b8('0xe0')](_0x3b9cd2)){this[_0x44b8('0x9')][_0x44b8('0x9b')](util[_0x44b8('0x23')](_0x44b8('0x129'),_0x3b9cd2['toUpperCase']()),_0x2d2994[_0x3b9cd2]);}}return this['channel']['noop'](util['format'](_0x44b8('0x12a'),JSON[_0x44b8('0x6e')](_0x2d2994)));}}return _0x559b12;};AGIVertices['prototype'][_0x44b8('0x12b')]=function(_0x470c9e){logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x12c'),_0x470c9e[_0x44b8('0x34')]));if(!this['isConfigured'](_0x470c9e[_0x44b8('0x90')])){return this['channel']['noop'](_0x44b8('0x12d'));}if(!this[_0x44b8('0x81')](_0x470c9e[_0x44b8('0x91')])){return this[_0x44b8('0x9')][_0x44b8('0xa4')]('no\x20appsecret\x20configured');}var _0x3906b7=_0x44b8('0x123');var _0x19ddbe=util[_0x44b8('0x23')](_0x44b8('0x124'),FILES_PATH,rs[_0x44b8('0x10d')](0x4));var _0x3f4d24=util['format'](_0x44b8('0x9a'),_0x19ddbe,_0x3906b7);var _0x36bef1=!![];if(_0x470c9e[_0x44b8('0x125')]==='NOBEEP'){_0x36bef1=![];}var _0x2de514=this[_0x44b8('0x9')][_0x44b8('0x127')](_0x19ddbe,_0x3906b7,_0x470c9e[_0x44b8('0x128')],_0x470c9e[_0x44b8('0x60')],undefined,_0x36bef1);if(_0x2de514[_0x44b8('0x9f')]!==-0x1){this[_0x44b8('0x9')][_0x44b8('0xa4')](util['format'](_0x44b8('0x12e'),_0x3f4d24));var _0x292592=this[_0x44b8('0x8f')][_0x44b8('0x6b')](this,_0x470c9e,_0x3f4d24);if(_0x292592){for(var _0x7c1aaa in _0x292592){if(_0x292592[_0x44b8('0xe0')](_0x7c1aaa)){this['channel'][_0x44b8('0x9b')](util[_0x44b8('0x23')]('TILDE_ASR_%s',_0x7c1aaa[_0x44b8('0x64')]()),_0x292592[_0x7c1aaa]);}}return this[_0x44b8('0x9')][_0x44b8('0xa4')](util[_0x44b8('0x23')]('TildeASR\x20Result\x20%s',JSON[_0x44b8('0x6e')](_0x292592)));}}return _0x2de514;};AGIVertices['prototype']['gotoc']=function(_0x9a5734){logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x12f'),_0x9a5734[_0x44b8('0x34')]));return this['channel']['continueAt'](_0x9a5734['context'],_0x9a5734[_0x44b8('0x39')],_0x9a5734[_0x44b8('0x3a')]);};AGIVertices['prototype'][_0x44b8('0x130')]=function(_0x154fe2){logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x131'),_0x154fe2[_0x44b8('0x34')]));if(!this[_0x44b8('0x81')](_0x154fe2[_0x44b8('0x132')])){return this[_0x44b8('0x9')]['error'](_0x154fe2,_0x44b8('0x133'));}try{var _0x1cc640=eval(_0x154fe2[_0x44b8('0x132')])?_0x44b8('0x134'):_0x44b8('0x135');this['channel'][_0x44b8('0xa4')](util[_0x44b8('0x23')]('EVAL\x20CONDITION\x20%s\x20%s',_0x154fe2['condition'],_0x1cc640));return{'code':0xc8,'result':_0x1cc640};}catch(_0xca26a5){return{'code':0xc8,'result':_0x44b8('0x135')};}};AGIVertices[_0x44b8('0xb')][_0x44b8('0x136')]=function(_0x3689d0){logger['info'](util[_0x44b8('0x23')](_0x44b8('0x137'),_0x3689d0['label']));if(!this[_0x44b8('0x81')](_0x3689d0['interval_id'])){return this['channel'][_0x44b8('0x27')](_0x3689d0,_0x44b8('0x138'));}var _0x3af78a=this[_0x44b8('0x1d')]['sync'](this,_0x3689d0[_0x44b8('0x139')]);if(!_0x3af78a){return this[_0x44b8('0x9')][_0x44b8('0x27')](_0x3689d0,_0x44b8('0x13a'));}for(var _0x175ae3=0x0;_0x175ae3<_0x3af78a[_0x44b8('0x98')];_0x175ae3+=0x1){var _0x3c53fa=this[_0x44b8('0x9')][_0x44b8('0xc')](util[_0x44b8('0x23')](_0x44b8('0x13b'),_0x3af78a[_0x175ae3]));if(_0x3c53fa[_0x44b8('0x9f')]===-0x1){return _0x3c53fa;}logger[_0x44b8('0x29')](util['format']('IFTIME\x20%s\x20%s',_0x3af78a[_0x175ae3],_0x3c53fa[_0x44b8('0x9d')]));if(_0x3c53fa[_0x44b8('0x9d')]===_0x44b8('0x134')){logger['info'](util[_0x44b8('0x23')](_0x44b8('0x13c'),_0x3af78a[_0x175ae3],_0x44b8('0x134')));this[_0x44b8('0x9')][_0x44b8('0xa4')](util[_0x44b8('0x23')](_0x44b8('0x13c'),_0x3af78a[_0x175ae3],'true'));return{'code':0xc8,'result':'true'};}else{logger['info'](util[_0x44b8('0x23')](_0x44b8('0x13c'),_0x3af78a[_0x175ae3],_0x44b8('0x135')));this['channel']['noop'](util[_0x44b8('0x23')](_0x44b8('0x13c'),_0x3af78a[_0x175ae3],_0x44b8('0x135')));}}return{'code':0xc8,'result':_0x44b8('0x135')};};AGIVertices[_0x44b8('0xb')][_0x44b8('0x13d')]=function(_0x2c1d36){logger['info'](util[_0x44b8('0x23')](_0x44b8('0x13e'),_0x2c1d36[_0x44b8('0x34')]));return this['channel'][_0x44b8('0x13d')]();};AGIVertices[_0x44b8('0xb')][_0x44b8('0x13f')]=function(_0x4aec46){logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x140'),_0x4aec46['label']));if(!this[_0x44b8('0x81')](_0x4aec46[_0x44b8('0x76')])){return this[_0x44b8('0x9')]['noop'](_0x44b8('0xde'));}var _0x3922b8='wav';var _0x40829b=util[_0x44b8('0x23')](_0x44b8('0x124'),FILES_PATH,rs['generate'](0x4));var _0x310c11=util[_0x44b8('0x23')](_0x44b8('0x9a'),_0x40829b,_0x3922b8);var _0x1d41c8=!![];if(_0x4aec46[_0x44b8('0x125')]===_0x44b8('0x126')){_0x1d41c8=![];}var _0x317eed=this[_0x44b8('0x9')]['recordFile'](_0x40829b,_0x3922b8,_0x4aec46[_0x44b8('0x128')],_0x4aec46[_0x44b8('0x60')],undefined,_0x1d41c8);if(_0x317eed[_0x44b8('0x9f')]!==-0x1){this[_0x44b8('0x9')]['noop'](util['format'](_0x44b8('0x141'),_0x310c11));var _0x549f1c=this[_0x44b8('0x7f')][_0x44b8('0x6b')](this,_0x4aec46,_0x310c11);if(_0x549f1c){for(var _0xb7dbe7 in _0x549f1c){if(_0x549f1c[_0x44b8('0xe0')](_0xb7dbe7)){this[_0x44b8('0x9')]['setVariable'](util['format'](_0x44b8('0x142'),_0xb7dbe7[_0x44b8('0x64')]()),_0x549f1c[_0xb7dbe7]);}}return this[_0x44b8('0x9')][_0x44b8('0xa4')](util['format']('IspeechASR\x20Result\x20%s',JSON[_0x44b8('0x6e')](_0x549f1c)));}}return _0x317eed;};AGIVertices[_0x44b8('0xb')][_0x44b8('0x143')]=function(_0x16fd39){logger['info'](util['format']('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x16fd39[_0x44b8('0x34')]));if(!this['isConfigured'](_0x16fd39[_0x44b8('0x76')])){return this[_0x44b8('0x9')][_0x44b8('0xa4')](_0x44b8('0xde'));}if(!this['isConfigured'](_0x16fd39[_0x44b8('0x56')])){return this[_0x44b8('0x9')]['noop'](_0x44b8('0xa5'));}this[_0x44b8('0x9')][_0x44b8('0xa4')](util[_0x44b8('0x23')](_0x44b8('0x144'),_0x16fd39['text']));var _0x20cc34=this[_0x44b8('0x7d')][_0x44b8('0x6b')](this,_0x16fd39);if(_0x20cc34){this['channel'][_0x44b8('0xa4')](util[_0x44b8('0x23')](_0x44b8('0x141'),_0x20cc34));var _0x48d8c0=this[_0x44b8('0x9')][_0x44b8('0xf6')](_0x20cc34,_0x16fd39[_0x44b8('0x128')]);try{fs['unlink'](_0x20cc34+_0x44b8('0x11b'));}catch(_0x26ed11){logger[_0x44b8('0x27')](_0x26ed11);}return _0x48d8c0;}return this['channel'][_0x44b8('0x27')](_0x16fd39,_0x44b8('0x145'));};AGIVertices['prototype']['login']=function(_0x1cbf9c){logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x146'),_0x1cbf9c['label']));if(!this['isConfigured'](_0x1cbf9c[_0x44b8('0x147')])){return this[_0x44b8('0x9')][_0x44b8('0x27')](_0x1cbf9c,_0x44b8('0x148'));}logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x149'),this[_0x44b8('0x9')][_0x44b8('0x36')],_0x1cbf9c[_0x44b8('0x147')]));var _0x4af0af=this[_0x44b8('0x4f')][_0x44b8('0x6b')](this,_0x1cbf9c[_0x44b8('0x147')]);if(_0x4af0af){logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x14a'),this['channel'][_0x44b8('0x36')],_0x1cbf9c[_0x44b8('0x147')]));this[_0x44b8('0x9')]['noop'](util[_0x44b8('0x23')](_0x44b8('0x14a'),this[_0x44b8('0x9')][_0x44b8('0x36')],_0x1cbf9c[_0x44b8('0x147')]));return{'code':0xc8,'result':_0x44b8('0x14b')};}else{logger['info'](util[_0x44b8('0x23')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x44b8('0x9')]['callerid'],_0x1cbf9c[_0x44b8('0x147')]));this[_0x44b8('0x9')][_0x44b8('0xa4')](util[_0x44b8('0x23')](_0x44b8('0x14c'),this[_0x44b8('0x9')]['callerid'],_0x1cbf9c[_0x44b8('0x147')]));return{'code':0xc8,'result':_0x44b8('0x14d')};}};AGIVertices[_0x44b8('0xb')]['logout']=function(_0x2c7999){logger[_0x44b8('0x29')](util['format'](_0x44b8('0x14e'),_0x2c7999[_0x44b8('0x34')]));if(!this['isConfigured'](_0x2c7999['findBy'])){return this[_0x44b8('0x9')]['error'](_0x2c7999,'no\x20find\x20by\x20configured');}logger['info'](util[_0x44b8('0x23')](_0x44b8('0x149'),this[_0x44b8('0x9')][_0x44b8('0x36')],_0x2c7999[_0x44b8('0x147')]));var _0x15382e=this[_0x44b8('0x4b')]['sync'](this,_0x2c7999[_0x44b8('0x147')]);if(_0x15382e){logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x14a'),this[_0x44b8('0x9')][_0x44b8('0x36')],_0x2c7999[_0x44b8('0x147')]));this[_0x44b8('0x9')][_0x44b8('0xa4')](util[_0x44b8('0x23')](_0x44b8('0x14a'),this[_0x44b8('0x9')][_0x44b8('0x36')],_0x2c7999['findBy']));return{'code':0xc8,'result':_0x44b8('0x14b')};}else{logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x14c'),this[_0x44b8('0x9')][_0x44b8('0x36')],_0x2c7999['findBy']));this[_0x44b8('0x9')][_0x44b8('0xa4')](util[_0x44b8('0x23')](_0x44b8('0x14c'),this['channel'][_0x44b8('0x36')],_0x2c7999[_0x44b8('0x147')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype']['math']=function(_0x216348){logger[_0x44b8('0x29')](util['format'](_0x44b8('0x14f'),_0x216348[_0x44b8('0x34')]));if(!this['isConfigured'](_0x216348[_0x44b8('0x150')])){return this[_0x44b8('0x9')][_0x44b8('0x27')](_0x216348,_0x44b8('0x151'));}this['channel'][_0x44b8('0xa4')](util[_0x44b8('0x23')]('math\x20%s',_0x216348[_0x44b8('0x150')]));var _0x20cac3=eval(_0x216348[_0x44b8('0x150')]);if(!this['isConfigured'](_0x216348[_0x44b8('0xd1')])){return this[_0x44b8('0x9')][_0x44b8('0xa4')](_0x44b8('0x108'));}var _0x59e899=this[_0x44b8('0xc')][_0x44b8('0x6b')](this,_0x216348['variable_id']);if(!_0x59e899){return this['channel']['error'](_0x216348,_0x44b8('0xd2'));}if(_[_0x44b8('0x97')](_0x20cac3)){var _0xeacf3d=this;_0x20cac3[_0x44b8('0xd3')](function(_0xf330f1,_0x3c2c22){_0xeacf3d['channel'][_0x44b8('0x9b')](util[_0x44b8('0x23')](_0x44b8('0x152'),_0x59e899,_0x3c2c22),_0xf330f1);});return this[_0x44b8('0x9')]['noop'](util['format'](_0x44b8('0x153'),_0x59e899));}else{return this[_0x44b8('0x9')][_0x44b8('0x9b')](_0x59e899,_0x20cac3);}};AGIVertices[_0x44b8('0xb')][_0x44b8('0x7')]=function(_0x4ca814){logger[_0x44b8('0x29')](util[_0x44b8('0x23')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x4ca814[_0x44b8('0x34')]));if(_0x4ca814[_0x44b8('0xa1')]===0x0){return this[_0x44b8('0xa0')](_0x4ca814);}_0x4ca814[_0x44b8('0xa1')]-=0x1;if(!this[_0x44b8('0x81')](_0x4ca814[_0x44b8('0x106')])){return this[_0x44b8('0x9')][_0x44b8('0x27')](_0x4ca814,'no\x20file\x20audio\x20selected');}var _0x306e31=this[_0x44b8('0x18')][_0x44b8('0x6b')](this,_0x4ca814[_0x44b8('0x106')]);if(!_0x306e31){return this[_0x44b8('0x9')]['error'](_0x4ca814,'no\x20file\x20audio\x20found');}var _0xf26205=this[_0x44b8('0x9')][_0x44b8('0x154')](_0x306e31,_0x4ca814[_0x44b8('0x109')],_0x4ca814['digit']);var _0x3b5a69=_0xf26205['result'];if(_0xf26205[_0x44b8('0x9f')]===-0x1){this[_0x44b8('0x32')][_0x44b8('0x6b')](this,_0x4ca814,'-1');return _0xf26205;}else if(_0xf26205[_0x44b8('0x9d')]===_0x44b8('0x60')){_0xf26205['result']=_0xf26205[_0x44b8('0x9f')][_0x44b8('0x98')]>0x0?_0xf26205['result']:'t';}else if(_[_0x44b8('0x3e')](_0xf26205[_0x44b8('0x9f')])){_0xf26205[_0x44b8('0x9f')]='#';_0x3b5a69='#';}if(!this['isConfigured'](_0x4ca814[_0x44b8('0xd1')])){this[_0x44b8('0x9')][_0x44b8('0xa4')](_0x44b8('0x108'));}else{var _0x10567c=this[_0x44b8('0xc')]['sync'](this,_0x4ca814[_0x44b8('0xd1')]);if(!_0x10567c){return this[_0x44b8('0x9')]['error'](_0x4ca814,_0x44b8('0xd2'));}this[_0x44b8('0x9')][_0x44b8('0x9b')](_0x10567c,_0x3b5a69);}this[_0x44b8('0x32')][_0x44b8('0x6b')](this,_0x4ca814,_0x3b5a69);return _0xf26205;};AGIVertices[_0x44b8('0xb')][_0x44b8('0xa4')]=function(_0x4576b7){logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x155'),_0x4576b7['label']));return this[_0x44b8('0x9')][_0x44b8('0xa4')](_0x4576b7[_0x44b8('0x156')]||_0x4576b7[_0x44b8('0x34')]);};AGIVertices['prototype'][_0x44b8('0x157')]=function(_0x47aa08){logger[_0x44b8('0x29')](util['format'](_0x44b8('0x158'),_0x47aa08[_0x44b8('0x34')]));if(!this['isConfigured'](_0x47aa08['findBy'])){return this[_0x44b8('0x9')]['error'](_0x47aa08,_0x44b8('0x148'));}logger[_0x44b8('0x29')](util[_0x44b8('0x23')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0x44b8('0x36')],_0x47aa08[_0x44b8('0x147')]));var _0x169d87=this[_0x44b8('0x159')][_0x44b8('0x6b')](this,_0x47aa08[_0x44b8('0x15a')]);var _0x38d6d8=this[_0x44b8('0x48')]['sync'](this,_0x47aa08[_0x44b8('0x147')],_0x169d87);if(_0x38d6d8){logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x14a'),this['channel'][_0x44b8('0x36')],_0x47aa08[_0x44b8('0x147')]));this[_0x44b8('0x9')][_0x44b8('0xa4')](util['format'](_0x44b8('0x14a'),this['channel'][_0x44b8('0x36')],_0x47aa08[_0x44b8('0x147')]));return{'code':0xc8,'result':'success'};}else{logger[_0x44b8('0x29')](util['format'](_0x44b8('0x14c'),this[_0x44b8('0x9')][_0x44b8('0x36')],_0x47aa08[_0x44b8('0x147')]));this['channel'][_0x44b8('0xa4')](util['format'](_0x44b8('0x14a'),this['channel'][_0x44b8('0x36')],_0x47aa08[_0x44b8('0x147')]));return{'code':0xc8,'result':_0x44b8('0x14d')};}};AGIVertices[_0x44b8('0xb')][_0x44b8('0x15b')]=function(_0x3e7cc3){logger[_0x44b8('0x29')](util[_0x44b8('0x23')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x3e7cc3[_0x44b8('0x34')]));if(!this[_0x44b8('0x81')](_0x3e7cc3[_0x44b8('0x106')])){return this[_0x44b8('0x9')][_0x44b8('0x27')](_0x3e7cc3,_0x44b8('0x15c'));}var _0x39d1b4=this[_0x44b8('0x18')][_0x44b8('0x6b')](this,_0x3e7cc3[_0x44b8('0x106')]);if(!_0x39d1b4){return this['channel'][_0x44b8('0x27')](_0x3e7cc3,_0x44b8('0x107'));}var _0x40cb99=this[_0x44b8('0x9')][_0x44b8('0x51')](_0x44b8('0x15d'),[_0x39d1b4,_0x3e7cc3[_0x44b8('0x100')]]);if(_0x40cb99[_0x44b8('0x9f')]===-0x1){return _0x40cb99;}return this[_0x44b8('0x9')][_0x44b8('0xa4')](util['format'](_0x44b8('0xc0'),'PLAYBACK',_0x39d1b4));};AGIVertices[_0x44b8('0xb')][_0x44b8('0x15e')]=function(_0x24c7e9){logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x15f'),_0x24c7e9[_0x44b8('0x34')]));if(!this[_0x44b8('0x81')](_0x24c7e9[_0x44b8('0x160')])){return this[_0x44b8('0x9')][_0x44b8('0x27')](_0x24c7e9,_0x44b8('0x161'));}var _0x2cff2d='';var _0xec2b21=parseInt(_0x24c7e9[_0x44b8('0x160')],0xa);if(isNaN(_0xec2b21)){_0x2cff2d=_0x24c7e9[_0x44b8('0x160')];}else{_0x2cff2d=this['getVoiceQueue']['sync'](this,_0x24c7e9[_0x44b8('0x160')]);if(!_0x2cff2d){return this[_0x44b8('0x9')][_0x44b8('0x27')](_0x24c7e9,_0x44b8('0x162'));}}var _0x26377c='';if(this[_0x44b8('0x81')](_0x24c7e9[_0x44b8('0x106')])){var _0x521f5c=this[_0x44b8('0x18')][_0x44b8('0x6b')](this,_0x24c7e9['file_id']);if(_0x521f5c){_0x26377c=_0x521f5c;}}this[_0x44b8('0x32')][_0x44b8('0x6b')](this,_0x24c7e9,_0x2cff2d);if(_0x24c7e9[_0x44b8('0x100')][_0x44b8('0x163')]('x')<0x0){_0x24c7e9[_0x44b8('0x100')]+='x';}if(_0x24c7e9[_0x44b8('0x100')]['indexOf']('X')<0x0){_0x24c7e9['opts']+='X';}this[_0x44b8('0x9')][_0x44b8('0x9b')](_0x44b8('0x164'),_0x2cff2d?_0x2cff2d[_0x44b8('0x165')]():'');var _0x525eb7=this[_0x44b8('0x9')]['exec']('QUEUE',[_0x2cff2d,_0x24c7e9[_0x44b8('0x100')],_0x24c7e9[_0x44b8('0x5e')],_0x26377c,_0x24c7e9[_0x44b8('0x60')],_0x24c7e9[_0x44b8('0x5')],_0x24c7e9[_0x44b8('0x166')],_0x24c7e9[_0x44b8('0x167')],'',_0x24c7e9['position']]);if(_0x525eb7[_0x44b8('0x9f')]===-0x1){return _0x525eb7;}return this[_0x44b8('0x9')][_0x44b8('0xa4')](util[_0x44b8('0x23')](_0x44b8('0xc0'),_0x44b8('0x168'),_0x2cff2d));};AGIVertices[_0x44b8('0xb')][_0x44b8('0x169')]=function(_0x24ab51){logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x16a'),_0x24ab51[_0x44b8('0x34')]));var _0x4be254=_0x24ab51['recordingFormat']||_0x44b8('0x123');var _0x159848=util[_0x44b8('0x23')]('%s_%s',this[_0x44b8('0x9')][_0x44b8('0x33')],rs[_0x44b8('0x10d')](0x5));var _0x454565=util[_0x44b8('0x23')]('%s/recordings/%s.%s',FILES_PATH,_0x159848,_0x4be254);var _0xb50fef=util[_0x44b8('0x23')](_0x44b8('0x124'),FILES_PATH,_0x159848);this[_0x44b8('0x37')][_0x44b8('0x6b')](this,_0x24ab51,_0x159848,_0x454565);this[_0x44b8('0x9')][_0x44b8('0x9b')](_0x44b8('0x16b'),_0x159848);logger[_0x44b8('0x29')](_0x44b8('0x16c'),_0xb50fef,_0x4be254,_0x24ab51[_0x44b8('0x16d')],_0x24ab51[_0x44b8('0x60')]);return this[_0x44b8('0x9')][_0x44b8('0x127')](_0xb50fef,_0x4be254,_0x24ab51['escape_digits'],_0x24ab51['timeout'],undefined,!![]);};AGIVertices[_0x44b8('0xb')]['restapi']=function(_0x1f1b3b){logger[_0x44b8('0x29')](util[_0x44b8('0x23')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x1f1b3b[_0x44b8('0x34')]));if(!this['isConfigured'](_0x1f1b3b[_0x44b8('0x5e')])){return this['channel']['noop'](_0x44b8('0x16e'));}var _0x230623=this[_0x44b8('0x5d')][_0x44b8('0x6b')](this,_0x1f1b3b);logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x16f'),util[_0x44b8('0x170')](_0x230623,{'showHidden':![],'depth':null})));if(!this[_0x44b8('0x81')](_0x1f1b3b[_0x44b8('0xd1')])){return this['channel'][_0x44b8('0xa4')](_0x44b8('0x171'));}var _0x815569=this[_0x44b8('0xc')][_0x44b8('0x6b')](this,_0x1f1b3b[_0x44b8('0xd1')]);if(!_0x815569){return this['channel'][_0x44b8('0x27')](_0x1f1b3b,_0x44b8('0xd2'));}this[_0x44b8('0x9')]['setVariable'](util[_0x44b8('0x23')]('%s_STATUS_CODE',_0x815569),_0x230623[_0x44b8('0x70')]?_0x230623['statusCode']:'200');this[_0x44b8('0x9')][_0x44b8('0x9b')](util['format'](_0x44b8('0x172'),_0x815569),_0x230623['statusMessage']?_0x230623[_0x44b8('0x71')]:'OK');if(_0x230623[_0x44b8('0x65')]){try{this[_0x44b8('0x99')](_0x230623[_0x44b8('0x65')],_0x815569);}catch(_0x2b27c5){logger['error'](util[_0x44b8('0x23')](_0x44b8('0x173'),_0x815569));}}return this[_0x44b8('0x9')][_0x44b8('0xa4')](util[_0x44b8('0x23')](_0x44b8('0xd5'),_0x815569));};AGIVertices['prototype']['saydigits']=function(_0x43fe5e){logger[_0x44b8('0x29')](util['format'](_0x44b8('0x174'),_0x43fe5e[_0x44b8('0x34')]));return this[_0x44b8('0x9')][_0x44b8('0x175')](_0x43fe5e['digits'][_0x44b8('0xd0')](/\s+/g,''),_0x43fe5e[_0x44b8('0x16d')]);};AGIVertices[_0x44b8('0xb')]['saynumber']=function(_0x50244d){logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x176'),_0x50244d[_0x44b8('0x34')]));return this[_0x44b8('0x9')][_0x44b8('0x177')](_0x50244d[_0x44b8('0x178')]['replace'](/\s+/g,''),_0x50244d[_0x44b8('0x16d')]);};AGIVertices[_0x44b8('0xb')][_0x44b8('0x179')]=function(_0x345d3d){logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x17a'),_0x345d3d[_0x44b8('0x34')]));return this[_0x44b8('0x9')][_0x44b8('0x17b')](_0x345d3d[_0x44b8('0x56')],_0x345d3d[_0x44b8('0x16d')]);};AGIVertices['prototype']['sendMail']=function(_0x51dbd8){logger[_0x44b8('0x29')](util[_0x44b8('0x23')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x51dbd8[_0x44b8('0x34')]));if(!this[_0x44b8('0x81')](_0x51dbd8[_0x44b8('0x17c')])){return this[_0x44b8('0x9')][_0x44b8('0xa4')](_0x44b8('0x17d'));}var _0x38691f=this[_0x44b8('0x17e')][_0x44b8('0x6b')](this,_0x51dbd8[_0x44b8('0x17c')]);if(!_0x38691f||!_0x38691f[_0x44b8('0x17f')]){return this[_0x44b8('0x9')][_0x44b8('0x27')](_0x51dbd8,_0x44b8('0x180'));}var _0x3fce6a={'from':util[_0x44b8('0x23')](_0x44b8('0x181'),_0x38691f[_0x44b8('0xf')],_0x38691f[_0x44b8('0x182')]||_0x38691f[_0x44b8('0x17f')]['user']),'to':_0x51dbd8['to']||'','cc':_0x51dbd8['cc']||'','bcc':_0x51dbd8[_0x44b8('0x183')]||'','subject':_0x51dbd8['subject'],'html':_0x51dbd8['text'],'text':_0x51dbd8['text']};if(this[_0x44b8('0x81')](_0x51dbd8[_0x44b8('0x184')])){}logger[_0x44b8('0x185')]('sendMail\x20message',JSON[_0x44b8('0x6e')](_0x3fce6a));this[_0x44b8('0x32')][_0x44b8('0x6b')](this,_0x51dbd8,_0x51dbd8[_0x44b8('0x17c')]);this[_0x44b8('0x9')][_0x44b8('0xa4')](util[_0x44b8('0x23')](_0x44b8('0x186'),_0x38691f[_0x44b8('0xf')]));this[_0x44b8('0x1b')][_0x44b8('0x6b')](this,_0x38691f['smtpOptions'],_0x3fce6a);return this[_0x44b8('0x9')][_0x44b8('0xa4')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x44b8('0xb')][_0x44b8('0x187')]=function(_0x1e737b){logger['info'](util[_0x44b8('0x23')](_0x44b8('0x188'),_0x1e737b[_0x44b8('0x34')]));return this[_0x44b8('0x9')][_0x44b8('0xa4')](_0x44b8('0x189'));};AGIVertices[_0x44b8('0xb')][_0x44b8('0x18a')]=function(_0x735553){logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x18b'),_0x735553[_0x44b8('0x34')]));if(!this[_0x44b8('0x81')](_0x735553[_0x44b8('0x18c')])){return this[_0x44b8('0x9')][_0x44b8('0xa4')](_0x44b8('0x18d'));}var _0x542e4f=this['getSmsAccount'][_0x44b8('0x6b')](this,_0x735553[_0x44b8('0x18c')]);if(!_0x542e4f){return this[_0x44b8('0x9')][_0x44b8('0x27')](_0x735553,'no\x20sms\x20account\x20found');}var _0x1a78a8={'body':_0x735553[_0x44b8('0x18e')],'phone':_0x735553['to']||'','SmsAccountId':_0x542e4f['id']};logger[_0x44b8('0x185')](_0x44b8('0x18f'),JSON[_0x44b8('0x6e')](_0x1a78a8));this[_0x44b8('0x32')][_0x44b8('0x6b')](this,_0x735553,_0x735553['sms_account_id']);this[_0x44b8('0x9')]['noop'](util[_0x44b8('0x23')](_0x44b8('0x190'),_0x542e4f[_0x44b8('0xf')]));this['createSmsMessage'][_0x44b8('0x6b')](this,_0x1a78a8);return this['channel'][_0x44b8('0xa4')](_0x44b8('0x191'));};AGIVertices[_0x44b8('0xb')][_0x44b8('0x192')]=function(_0x774615){logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x193'),_0x774615[_0x44b8('0x34')]));if(!this[_0x44b8('0x81')](_0x774615[_0x44b8('0xd1')])){return this[_0x44b8('0x9')][_0x44b8('0x27')](_0x774615,'no\x20variable\x20selected');}var _0x2ede32=this[_0x44b8('0xc')][_0x44b8('0x6b')](this,_0x774615['variable_id']);if(!_0x2ede32){return this[_0x44b8('0x9')][_0x44b8('0x27')](_0x774615,_0x44b8('0xd2'));}return this[_0x44b8('0x9')][_0x44b8('0x9b')](_0x2ede32,_0x774615[_0x44b8('0x194')]);};AGIVertices[_0x44b8('0xb')]['start']=function(_0x1ffd7b){logger[_0x44b8('0x29')](util[_0x44b8('0x23')]('Enter\x20in\x20START\x20(%s)\x20block',_0x1ffd7b[_0x44b8('0x34')]));this[_0x44b8('0x9')][_0x44b8('0xa4')](_0x44b8('0x195'));var _0x519e52=this[_0x44b8('0x9')][_0x44b8('0xc')]('XMCS-UNIQUEID');if(!_[_0x44b8('0x3e')](_0x519e52[_0x44b8('0x9d')])){this[_0x44b8('0x9')][_0x44b8('0x33')]=_0x519e52['extra'];}if(_0x1ffd7b['answer']===_0x44b8('0x196')){this['channel'][_0x44b8('0xa4')](_0x44b8('0x197'));return this['channel'][_0x44b8('0xb6')]();}return this[_0x44b8('0x9')]['noop']('Skipped\x20Answer');};AGIVertices['prototype'][_0x44b8('0x198')]=function(_0x3edc61){logger[_0x44b8('0x29')](util['format']('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x3edc61['label']));if(!this[_0x44b8('0x81')](_0x3edc61[_0x44b8('0x199')])){return this[_0x44b8('0x9')][_0x44b8('0x27')](_0x3edc61,'no\x20subproject\x20selected');}var _0x31addc=this[_0x44b8('0x19a')][_0x44b8('0x6b')](this,_0x3edc61[_0x44b8('0x199')]);if(!this[_0x44b8('0x81')](_0x31addc)){return this['channel'][_0x44b8('0x27')](_0x3edc61,util[_0x44b8('0x23')](_0x44b8('0x19b'),_0x3edc61[_0x44b8('0x199')]));}if(_0x31addc===this[_0x44b8('0x9')]['arg_1']){return this[_0x44b8('0x9')][_0x44b8('0x27')](_0x3edc61,_0x44b8('0x19c'));}this[_0x44b8('0x32')][_0x44b8('0x6b')](this,_0x3edc61,_0x31addc);var _0x4390fb=this[_0x44b8('0x9')][_0x44b8('0x51')](_0x44b8('0x19d'),util[_0x44b8('0x23')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x44b8('0x5')][_0x44b8('0x19e')]||_0x44b8('0x19f'),_0x31addc,this[_0x44b8('0x9')][_0x44b8('0x35')]));if(_0x4390fb[_0x44b8('0x9f')]===-0x1){return _0x4390fb;}return this[_0x44b8('0x9')][_0x44b8('0xa4')](util[_0x44b8('0x23')](_0x44b8('0xc0'),'AGI',_0x31addc));};AGIVertices[_0x44b8('0xb')][_0x44b8('0x1a0')]=function(_0x467f72){logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x1a1'),_0x467f72['label']));var _0x47d28a=this[_0x44b8('0x50')][_0x44b8('0x6b')](this,_0x467f72[_0x44b8('0xb3')]);this[_0x44b8('0x32')][_0x44b8('0x6b')](this,_0x467f72,_0x467f72[_0x44b8('0xb3')]);if(this[_0x44b8('0x81')](_0x467f72[_0x44b8('0xd1')])){var _0x43ee4a=this[_0x44b8('0xc')][_0x44b8('0x6b')](this,_0x467f72[_0x44b8('0xd1')]);if(_0x43ee4a){this[_0x44b8('0x9')]['setVariable'](_0x43ee4a,_0x47d28a);return this[_0x44b8('0x9')][_0x44b8('0xa4')](util[_0x44b8('0x23')](_0x44b8('0x1a2'),_0x467f72[_0x44b8('0xb3')],_0x43ee4a));}}return this['channel'][_0x44b8('0xa4')](util[_0x44b8('0x23')](_0x44b8('0x1a3'),_0x467f72['command']));};AGIVertices[_0x44b8('0xb')][_0x44b8('0x1a4')]=function(_0x120e8b){logger[_0x44b8('0x29')](util['format']('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x120e8b[_0x44b8('0x34')]));_0x120e8b[_0x44b8('0x56')]=_0x120e8b[_0x44b8('0x56')][_0x44b8('0xd0')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x120e8b[_0x44b8('0x54')])){return this[_0x44b8('0x9')][_0x44b8('0xa4')]('no\x20apiKey\x20configured');}if(!this[_0x44b8('0x81')](_0x120e8b[_0x44b8('0x56')])){return this[_0x44b8('0x9')][_0x44b8('0xa4')](_0x44b8('0xa5'));}this[_0x44b8('0x9')][_0x44b8('0xa4')](util[_0x44b8('0x23')](_0x44b8('0x1a5'),_0x120e8b[_0x44b8('0x56')]));var _0x418961=this['googleCloudTTS'][_0x44b8('0x6b')](this,_0x120e8b);if(_0x418961){this[_0x44b8('0x9')]['noop'](util[_0x44b8('0x23')](_0x44b8('0x1a6'),_0x418961));var _0x17c1f4=this[_0x44b8('0x9')]['streamFile'](_0x418961);try{fs[_0x44b8('0x11a')](_0x418961+'.wav');}catch(_0x3cda92){logger['error'](_0x3cda92);}return _0x17c1f4;}return this['channel'][_0x44b8('0x27')](_0x120e8b,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x44b8('0xb')]['tts']=function(_0x17db2d){logger[_0x44b8('0x29')](util['format'](_0x44b8('0x1a7'),_0x17db2d['label']));_0x17db2d[_0x44b8('0x56')]=_0x17db2d[_0x44b8('0x56')][_0x44b8('0xd0')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x44b8('0x81')](_0x17db2d[_0x44b8('0x56')])){return this[_0x44b8('0x9')][_0x44b8('0xa4')]('no\x20text\x20configured');}this[_0x44b8('0x9')]['noop'](util['format'](_0x44b8('0x1a8'),_0x17db2d['text']));var _0x54cbce=this[_0x44b8('0x5b')]['sync'](this,_0x17db2d);if(_0x54cbce){this[_0x44b8('0x9')][_0x44b8('0xa4')](util[_0x44b8('0x23')](_0x44b8('0x1a9'),_0x54cbce));var _0x29904b=this[_0x44b8('0x9')]['streamFile'](_0x54cbce);try{fs[_0x44b8('0x11a')](_0x54cbce+_0x44b8('0x11b'));}catch(_0x48040c){logger[_0x44b8('0x27')](_0x48040c);}return _0x29904b;}return this['channel']['error'](_0x17db2d,_0x44b8('0x1aa'));};AGIVertices['prototype'][_0x44b8('0x1ab')]=function(_0x498cc6){logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x1ac'),_0x498cc6[_0x44b8('0x34')]));if(!this[_0x44b8('0x81')](_0x498cc6[_0x44b8('0x147')])){return this[_0x44b8('0x9')][_0x44b8('0x27')](_0x498cc6,_0x44b8('0x148'));}logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x149'),this[_0x44b8('0x9')][_0x44b8('0x36')],_0x498cc6[_0x44b8('0x147')]));var _0x4efee9=this['agentUnpause']['sync'](this,_0x498cc6[_0x44b8('0x147')]);if(_0x4efee9){logger[_0x44b8('0x29')](util['format'](_0x44b8('0x14a'),this['channel'][_0x44b8('0x36')],_0x498cc6[_0x44b8('0x147')]));this[_0x44b8('0x9')]['noop'](util['format'](_0x44b8('0x14a'),this['channel'][_0x44b8('0x36')],_0x498cc6[_0x44b8('0x147')]));return{'code':0xc8,'result':_0x44b8('0x14b')};}else{logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x14c'),this[_0x44b8('0x9')][_0x44b8('0x36')],_0x498cc6[_0x44b8('0x147')]));this[_0x44b8('0x9')]['noop'](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x44b8('0x9')][_0x44b8('0x36')],_0x498cc6[_0x44b8('0x147')]));return{'code':0xc8,'result':_0x44b8('0x14d')};}};AGIVertices[_0x44b8('0xb')][_0x44b8('0x1ad')]=function(_0x11231a){logger[_0x44b8('0x29')](util[_0x44b8('0x23')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x11231a[_0x44b8('0x34')]));var _0x1d10f6=this[_0x44b8('0x9')][_0x44b8('0x51')]('VOICEMAIL',[_0x11231a['mailbox'],_0x11231a[_0x44b8('0x74')]]);if(_0x1d10f6[_0x44b8('0x9f')]===-0x1){return _0x1d10f6;}return this[_0x44b8('0x9')][_0x44b8('0xa4')](util[_0x44b8('0x23')](_0x44b8('0xc0'),_0x44b8('0x1ae'),_0x11231a[_0x44b8('0x1af')]));};AGIVertices['prototype']['vswitch']=function(_0x41449b){logger[_0x44b8('0x29')](util['format'](_0x44b8('0x1b0'),_0x41449b[_0x44b8('0x34')]));if(!this['isConfigured'](_0x41449b[_0x44b8('0xd1')])){return this['channel'][_0x44b8('0x27')](_0x41449b,_0x44b8('0x1b1'));}var _0x29a8c5=this[_0x44b8('0xc')][_0x44b8('0x6b')](this,_0x41449b[_0x44b8('0xd1')]);if(!_0x29a8c5){return this[_0x44b8('0x9')][_0x44b8('0x27')](_0x41449b,_0x44b8('0xd2'));}var _0x32262e=this[_0x44b8('0x9')][_0x44b8('0xc')](_0x29a8c5);return{'code':0xc8,'result':_0x32262e[_0x44b8('0x9d')]?_0x32262e[_0x44b8('0x9d')]:'-'};};String[_0x44b8('0xb')][_0x44b8('0x1b2')]=function(_0x366cec,_0x5d70fd){return this[_0x44b8('0x9c')](_0x366cec)[_0x44b8('0x1b3')](_0x5d70fd);};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 c4290c5..d189b2b 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 _0x392c=['agentringnoanswer','syncAgentRingNoAnswer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','updateAcw','lastPauseAt','timer','update','uniqueid','then','info','[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','finally','prototype','startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','QueuePause','getAgent','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','paused','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','stopAcw','format','acwTimeout','error','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','pauseType','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','acw','isUndefined','linkedid','[%s][HANGUP:LINKEDID]','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','lodash','moment','../ami','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','hangup'];(function(_0x17e735,_0x328f40){var _0x1824d6=function(_0x4460fe){while(--_0x4460fe){_0x17e735['push'](_0x17e735['shift']());}};_0x1824d6(++_0x328f40);}(_0x392c,0x141));var _0xc392=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x392c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc392('0x0'));var moment=require(_0xc392('0x1'));var ami=require(_0xc392('0x2'));var logger=require(_0xc392('0x3'))('acw');var RpcUser=require(_0xc392('0x4'));var RpcVoiceAgentReport=require(_0xc392('0x5'));function Acw(_0x1adf31){this[_0xc392('0x6')]=_0x1adf31['voiceQueues'];this[_0xc392('0x7')]=_0x1adf31[_0xc392('0x7')];this[_0xc392('0x8')]=_0x1adf31['timers'];this[_0xc392('0x9')]={};ami['on'](_0xc392('0xa'),this[_0xc392('0xb')][_0xc392('0xc')](this));ami['on'](_0xc392('0xd'),this['syncHangupRequest'][_0xc392('0xc')](this));ami['on'](_0xc392('0xe'),this['syncHangup']['bind'](this));ami['on'](_0xc392('0xf'),this[_0xc392('0x10')][_0xc392('0xc')](this));ami['on']('attendedtransfer',this[_0xc392('0x11')][_0xc392('0xc')](this));ami['on'](_0xc392('0x12'),this[_0xc392('0x13')][_0xc392('0xc')](this));ami['on'](_0xc392('0x14'),this[_0xc392('0x15')][_0xc392('0xc')](this));}function getDiff(_0x5d3ac3){var _0xdac9f7=moment()[_0xc392('0x16')](0x0);var _0x1c207b=moment(_0x5d3ac3)['milliseconds'](0x0);return _0xdac9f7[_0xc392('0x17')](_0x1c207b,'seconds');}Acw['prototype'][_0xc392('0x18')]=function(_0x495f90,_0x21c16e){var _0x377eb3=this;var _0x98437e=getDiff(_0x377eb3[_0xc392('0x8')][_0x495f90][_0xc392('0x19')]);clearTimeout(_0x377eb3[_0xc392('0x8')][_0x495f90]['timer']);_0x377eb3[_0xc392('0x8')][_0x495f90][_0xc392('0x1a')]=![];return RpcVoiceAgentReport[_0xc392('0x1b')]({'acwtime':_0x98437e},_0x377eb3[_0xc392('0x8')][_0x495f90][_0xc392('0x1c')],_0x495f90)[_0xc392('0x1d')](function(_0x1073ef){logger[_0xc392('0x1e')](_0xc392('0x1f'),_0x21c16e,_0x98437e,_0x1073ef);})[_0xc392('0x20')](function(_0xe8f18f){logger['error'](_0xc392('0x21'),_0x21c16e,_0xe8f18f);})[_0xc392('0x22')](function(){delete _0x377eb3[_0xc392('0x8')][_0x495f90];});};Acw[_0xc392('0x23')][_0xc392('0x24')]=function(_0x45beb0){try{var _0x22e677=this;var _0x18e297=this[_0xc392('0x9')][_0x45beb0][_0xc392('0x25')];var _0x385681=this[_0xc392('0x9')][_0x45beb0][_0xc392('0x26')];var _0x3853a7=this[_0xc392('0x6')][_0x385681];var _0x2bf87f=![];var _0x39f9b8=_0xc392('0x27');if(_0x3853a7[_0xc392('0x28')]&&_0x3853a7['mandatoryDispositionPause']['name']){_0x2bf87f=!![];_0x39f9b8=_0x3853a7[_0xc392('0x29')][_0xc392('0x2a')];}return ami['Action']({'action':_0xc392('0x2b'),'interface':_0x18e297,'paused':!![],'reason':_0x39f9b8})['then'](function(){if(_0x22e677['agents'][_0x18e297]){return RpcUser[_0xc392('0x2c')](_0x22e677[_0xc392('0x7')][_0x18e297]['id'])[_0xc392('0x1d')](function(_0x142842){if(!_0x142842||_0x142842[_0xc392('0x2d')]){logger['info']('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x45beb0,_0x18e297,_0x385681);return;}logger[_0xc392('0x1e')](_0xc392('0x2e'),_0x45beb0,_0x18e297,_0x385681);var _0x2fa472=_0x22e677[_0xc392('0x9')][_0x45beb0][_0xc392('0x2f')]&&_0x22e677[_0xc392('0x9')][_0x45beb0]['destlinkedid']?_0x22e677[_0xc392('0x9')][_0x45beb0][_0xc392('0x30')]:_0x45beb0;return RpcUser['savePause'](_0x22e677[_0xc392('0x7')][_0x18e297],_0x39f9b8,_0x2fa472)[_0xc392('0x1d')](function(_0x32a707){_0x22e677['voiceQueues'][_0x385681]['available']-=0x1;_0x22e677[_0xc392('0x6')][_0x385681][_0xc392('0x31')]+=0x1;return _0x32a707;});})['then'](function(_0x311078){if(_0x2bf87f||!_0x311078){return;}_0x22e677[_0xc392('0x8')][_0x18e297]={};logger['info'](_0xc392('0x32'),_0x45beb0,_0x22e677['voiceQueues'][_0x385681]['acwTimeout'],_0x18e297,_0x385681);_0x22e677[_0xc392('0x8')][_0x18e297][_0xc392('0x1a')]=setTimeout(_0x22e677[_0xc392('0x33')][_0xc392('0xc')](_0x22e677,_0x18e297),_0x22e677[_0xc392('0x6')][_0x385681]['acwTimeout']*0x3e8);_0x22e677[_0xc392('0x8')][_0x18e297][_0xc392('0x19')]=moment()[_0xc392('0x34')]('YYYY-MM-DD\x20HH:mm:ss');_0x22e677[_0xc392('0x8')][_0x18e297][_0xc392('0x1c')]=_0x45beb0;_0x22e677[_0xc392('0x8')][_0x18e297]['queue']=_0x385681;_0x22e677[_0xc392('0x8')][_0x18e297][_0xc392('0x18')]=_0x22e677[_0xc392('0x18')][_0xc392('0xc')](_0x22e677,_0x18e297,_0x45beb0);});}})['catch'](function(){logger['error'](_0xc392('0x32'),_0x45beb0,_0x22e677[_0xc392('0x6')][_0x385681][_0xc392('0x35')],_0x18e297,_0x385681);})[_0xc392('0x22')](function(){delete _0x22e677[_0xc392('0x9')][_0x45beb0];});}catch(_0x4ef8ca){logger[_0xc392('0x36')](_0xc392('0x37'),_0x4ef8ca[_0xc392('0x38')]);}};Acw[_0xc392('0x23')]['stopAcw']=function(_0x216d4c){try{var _0x5cc7f6=this;if(_0x5cc7f6['timers'][_0x216d4c]){_0x5cc7f6[_0xc392('0x8')][_0x216d4c][_0xc392('0x1a')]=![];var _0x1bfbac=_0x5cc7f6['timers'][_0x216d4c][_0xc392('0x1c')];var _0x407d42=_0x5cc7f6[_0xc392('0x8')][_0x216d4c][_0xc392('0x26')];var _0x3a2b62=_0x5cc7f6[_0xc392('0x6')][_0x407d42]['acwTimeout'];logger[_0xc392('0x1e')](_0xc392('0x39'),_0x1bfbac,_0x216d4c);RpcUser[_0xc392('0x2c')](this[_0xc392('0x7')][_0x216d4c]['id'])[_0xc392('0x1d')](function(_0x927008){if(_0x927008[_0xc392('0x3a')]===_0xc392('0x27')){return RpcUser[_0xc392('0x3b')](_0x5cc7f6['agents'][_0x216d4c]);}});RpcVoiceAgentReport[_0xc392('0x1b')]({'acwtime':_0x3a2b62,'agentacw':!![]},_0x1bfbac,_0x216d4c)[_0xc392('0x1d')](function(_0x1bb798){logger[_0xc392('0x1e')]('[%s][UPDATE][ACWTIME:%s]',_0x1bfbac,_0x3a2b62,_0x1bb798);})['catch'](function(_0x1d0e5b){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x1bfbac,_0x1d0e5b);});}else{logger[_0xc392('0x36')](_0xc392('0x3c'),_0x216d4c);if(_0x5cc7f6[_0xc392('0x8')]){logger['info'](_0xc392('0x3d'),JSON[_0xc392('0x3e')](_0x5cc7f6[_0xc392('0x8')]));}}}catch(_0x5d8346){logger['error'](_0xc392('0x3f'),_0x5d8346[_0xc392('0x38')]);}};Acw[_0xc392('0x23')][_0xc392('0xb')]=function(_0x70da6f){try{if(this['voiceQueues'][_0x70da6f[_0xc392('0x26')]]&&(this['voiceQueues'][_0x70da6f[_0xc392('0x26')]]['acw']||this[_0xc392('0x6')][_0x70da6f[_0xc392('0x26')]][_0xc392('0x28')])){if(this[_0xc392('0x7')][_0x70da6f[_0xc392('0x25')]]){this[_0xc392('0x9')][_0x70da6f[_0xc392('0x1c')]]={'queue':_0x70da6f[_0xc392('0x26')],'interface':_0x70da6f[_0xc392('0x25')],'destlinkedid':_0x70da6f[_0xc392('0x30')]};}}}catch(_0x29aca6){logger['error'](_0xc392('0x40'),_0x29aca6[_0xc392('0x38')]);}};Acw[_0xc392('0x23')]['syncAgentConnectPreview']=function(_0x371eef){try{if(this[_0xc392('0x6')][_0x371eef[_0xc392('0x26')]]&&(this[_0xc392('0x6')][_0x371eef[_0xc392('0x26')]][_0xc392('0x41')]||this[_0xc392('0x6')][_0x371eef[_0xc392('0x26')]][_0xc392('0x28')])){if(this[_0xc392('0x7')][_0x371eef[_0xc392('0x25')]]){this[_0xc392('0x9')][_0x371eef[_0xc392('0x1c')]]={'queue':_0x371eef[_0xc392('0x26')],'interface':_0x371eef[_0xc392('0x25')]};}}}catch(_0x12209b){logger[_0xc392('0x36')]('[ACW][syncAgentConnectPreview]\x20%s',_0x12209b['message']);}};Acw[_0xc392('0x23')]['syncHangupRequest']=function(_0xfe33cf){try{if(this['channels'][_0xfe33cf[_0xc392('0x1c')]]&&_[_0xc392('0x42')](this[_0xc392('0x9')][_0xfe33cf[_0xc392('0x1c')]][_0xc392('0x2f')])){logger[_0xc392('0x1e')]('[%s][HANGUP:UNIQUEID]',_0xfe33cf['uniqueid']);this[_0xc392('0x24')](_0xfe33cf[_0xc392('0x1c')]);}else if(this['channels'][_0xfe33cf[_0xc392('0x43')]]&&_['isUndefined'](this[_0xc392('0x9')][_0xfe33cf[_0xc392('0x43')]][_0xc392('0x2f')])){logger[_0xc392('0x1e')](_0xc392('0x44'),_0xfe33cf[_0xc392('0x43')]);this['startAcw'](_0xfe33cf['linkedid']);}}catch(_0x36e92f){logger[_0xc392('0x36')]('[ACW][syncHangupRequest]\x20%s',_0x36e92f[_0xc392('0x38')]);}};Acw[_0xc392('0x23')][_0xc392('0x45')]=function(_0x2db494){try{if(this[_0xc392('0x9')][_0x2db494[_0xc392('0x1c')]]&&this['channels'][_0x2db494['uniqueid']][_0xc392('0x2f')]){logger['info'](_0xc392('0x46'),_0x2db494[_0xc392('0x1c')]);this[_0xc392('0x24')](_0x2db494[_0xc392('0x1c')]);}else if(this[_0xc392('0x9')][_0x2db494[_0xc392('0x43')]]&&this['channels'][_0x2db494['linkedid']][_0xc392('0x2f')]){logger[_0xc392('0x1e')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x2db494[_0xc392('0x43')]);this[_0xc392('0x24')](_0x2db494[_0xc392('0x43')]);}}catch(_0x9ffef8){logger[_0xc392('0x36')](_0xc392('0x47'),_0x9ffef8[_0xc392('0x38')]);}};Acw['prototype']['syncAttendedTransfer']=function(_0x1d6081){try{if(!_[_0xc392('0x48')](this[_0xc392('0x9')][_0x1d6081[_0xc392('0x49')]])){this['startAcw'](_0x1d6081[_0xc392('0x49')]);if(this[_0xc392('0x9')][_0x1d6081['secondtransfereruniqueid']]){this['channels'][_0x1d6081[_0xc392('0x4a')]]['attended']=!![];this[_0xc392('0x9')][_0x1d6081[_0xc392('0x4b')]]=this['channels'][_0x1d6081[_0xc392('0x4a')]];delete this['channels'][_0x1d6081['secondtransfereruniqueid']];}}else if(!_[_0xc392('0x48')](this[_0xc392('0x9')][_0x1d6081['transfertargetuniqueid']])){this[_0xc392('0x24')](_0x1d6081[_0xc392('0x4b')]);if(this['channels'][_0x1d6081['origtransfereruniqueid']]){this[_0xc392('0x9')][_0x1d6081['origtransfereruniqueid']][_0xc392('0x2f')]=!![];this[_0xc392('0x9')][_0x1d6081[_0xc392('0x49')]]=this[_0xc392('0x9')][_0x1d6081['origtransfereruniqueid']];delete this[_0xc392('0x9')][_0x1d6081[_0xc392('0x4c')]];}}}catch(_0x5ba50f){logger[_0xc392('0x36')]('[ACW][syncAttendedTransfer]\x20%s',_0x5ba50f[_0xc392('0x38')]);}};Acw[_0xc392('0x23')][_0xc392('0x13')]=function(_0x11c2d8){try{if(this[_0xc392('0x9')][_0x11c2d8['transfereruniqueid']]){logger['info']('[%s][BLINDTRANSFER:UNIQUEID]',JSON['stringify'](_0x11c2d8[_0xc392('0x4d')]));this[_0xc392('0x24')](_0x11c2d8[_0xc392('0x4d')]);}else if(this[_0xc392('0x9')][_0x11c2d8[_0xc392('0x4e')]]){logger[_0xc392('0x1e')](_0xc392('0x4f'),JSON[_0xc392('0x3e')](_0x11c2d8[_0xc392('0x4e')]));this[_0xc392('0x24')](_0x11c2d8[_0xc392('0x4e')]);}}catch(_0x4d4927){logger[_0xc392('0x36')]('[ACW][syncBlindTransfer]\x20%s',_0x4d4927[_0xc392('0x38')]);}};Acw[_0xc392('0x23')][_0xc392('0x10')]=function(_0x32d71f){try{if(this[_0xc392('0x6')][_0x32d71f[_0xc392('0x26')]]&&this[_0xc392('0x6')][_0x32d71f['queue']][_0xc392('0x50')]===_0xc392('0x51')){if(this[_0xc392('0x7')][_0x32d71f['interface']]){logger['info'](_0xc392('0x52'),_0x32d71f[_0xc392('0x1c')],_0x32d71f[_0xc392('0x25')],_0x32d71f[_0xc392('0x26')]);return RpcUser['savePause'](this[_0xc392('0x7')][_0x32d71f[_0xc392('0x25')]],_0xc392('0x53'),_0x32d71f[_0xc392('0x1c')]);}}}catch(_0x5e1ffa){logger[_0xc392('0x36')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x5e1ffa[_0xc392('0x38')]);}};module['exports']=Acw; \ No newline at end of file +var _0x78c8=['syncAgentConnectPreview','milliseconds','seconds','prototype','lastPauseAt','timer','update','uniqueid','then','info','catch','error','[%s][UPDATE][ERRORS:%s]','finally','startAcw','interface','queue','ACW','mandatoryDispositionPause','Action','getAgent','voicePause','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','available','paused','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','YYYY-MM-DD\x20HH:mm:ss','updateAcw','message','stopAcw','[%s][TIMER][STOP][AGENT:%s]','pauseType','[%s][UPDATE][ACWTIME:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','mandatoryDisposition','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','attended','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','[ACW][syncAgentRingNoAnswer]\x20%s','moment','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview'];(function(_0x3c1edb,_0x153e78){var _0x4cb05a=function(_0x22fb82){while(--_0x22fb82){_0x3c1edb['push'](_0x3c1edb['shift']());}};_0x4cb05a(++_0x153e78);}(_0x78c8,0x98));var _0x878c=function(_0x2c249a,_0x4a6096){_0x2c249a=_0x2c249a-0x0;var _0x3edb89=_0x78c8[_0x2c249a];return _0x3edb89;};'use strict';var _=require('lodash');var moment=require(_0x878c('0x0'));var ami=require('../ami');var logger=require(_0x878c('0x1'))(_0x878c('0x2'));var RpcUser=require(_0x878c('0x3'));var RpcVoiceAgentReport=require(_0x878c('0x4'));function Acw(_0x162b92){this[_0x878c('0x5')]=_0x162b92[_0x878c('0x5')];this[_0x878c('0x6')]=_0x162b92[_0x878c('0x6')];this[_0x878c('0x7')]=_0x162b92['timers'];this[_0x878c('0x8')]={};ami['on'](_0x878c('0x9'),this[_0x878c('0xa')][_0x878c('0xb')](this));ami['on'](_0x878c('0xc'),this[_0x878c('0xd')][_0x878c('0xb')](this));ami['on']('hangup',this[_0x878c('0xe')][_0x878c('0xb')](this));ami['on'](_0x878c('0xf'),this[_0x878c('0x10')][_0x878c('0xb')](this));ami['on'](_0x878c('0x11'),this[_0x878c('0x12')]['bind'](this));ami['on'](_0x878c('0x13'),this[_0x878c('0x14')][_0x878c('0xb')](this));ami['on'](_0x878c('0x15'),this[_0x878c('0x16')][_0x878c('0xb')](this));}function getDiff(_0x5a9cc9){var _0x3bf395=moment()[_0x878c('0x17')](0x0);var _0xec31aa=moment(_0x5a9cc9)['milliseconds'](0x0);return _0x3bf395['diff'](_0xec31aa,_0x878c('0x18'));}Acw[_0x878c('0x19')]['updateAcw']=function(_0x3ffc24,_0x2b3598){var _0xa27a31=this;var _0x3867ee=getDiff(_0xa27a31[_0x878c('0x7')][_0x3ffc24][_0x878c('0x1a')]);clearTimeout(_0xa27a31['timers'][_0x3ffc24][_0x878c('0x1b')]);_0xa27a31['timers'][_0x3ffc24][_0x878c('0x1b')]=![];return RpcVoiceAgentReport[_0x878c('0x1c')]({'acwtime':_0x3867ee},_0xa27a31['timers'][_0x3ffc24][_0x878c('0x1d')],_0x3ffc24)[_0x878c('0x1e')](function(_0x499ebc){logger[_0x878c('0x1f')]('[%s][UPDATE][ACWTIME:%s]',_0x2b3598,_0x3867ee,_0x499ebc);})[_0x878c('0x20')](function(_0x30ca81){logger[_0x878c('0x21')](_0x878c('0x22'),_0x2b3598,_0x30ca81);})[_0x878c('0x23')](function(){delete _0xa27a31[_0x878c('0x7')][_0x3ffc24];});};Acw[_0x878c('0x19')][_0x878c('0x24')]=function(_0x3ab188){try{var _0x3d5413=this;var _0x2dbb49=this[_0x878c('0x8')][_0x3ab188][_0x878c('0x25')];var _0xa23c3c=this[_0x878c('0x8')][_0x3ab188][_0x878c('0x26')];var _0x18f3d5=this[_0x878c('0x5')][_0xa23c3c];var _0x2931cb=![];var _0x3675e5=_0x878c('0x27');if(_0x18f3d5['mandatoryDisposition']&&_0x18f3d5[_0x878c('0x28')]['name']){_0x2931cb=!![];_0x3675e5=_0x18f3d5[_0x878c('0x28')]['name'];}return ami[_0x878c('0x29')]({'action':'QueuePause','interface':_0x2dbb49,'paused':!![],'reason':_0x3675e5})[_0x878c('0x1e')](function(){if(_0x3d5413[_0x878c('0x6')][_0x2dbb49]){return RpcUser[_0x878c('0x2a')](_0x3d5413[_0x878c('0x6')][_0x2dbb49]['id'])[_0x878c('0x1e')](function(_0x8a7a0){if(!_0x8a7a0||_0x8a7a0[_0x878c('0x2b')]){logger[_0x878c('0x1f')](_0x878c('0x2c'),_0x3ab188,_0x2dbb49,_0xa23c3c);return;}logger[_0x878c('0x1f')](_0x878c('0x2d'),_0x3ab188,_0x2dbb49,_0xa23c3c);var _0x4f8678=_0x3d5413[_0x878c('0x8')][_0x3ab188]['attended']&&_0x3d5413[_0x878c('0x8')][_0x3ab188]['destlinkedid']?_0x3d5413['channels'][_0x3ab188][_0x878c('0x2e')]:_0x3ab188;return RpcUser['savePause'](_0x3d5413['agents'][_0x2dbb49],_0x3675e5,_0x4f8678)[_0x878c('0x1e')](function(_0xa187e3){_0x3d5413[_0x878c('0x5')][_0xa23c3c][_0x878c('0x2f')]-=0x1;_0x3d5413[_0x878c('0x5')][_0xa23c3c][_0x878c('0x30')]+=0x1;return _0xa187e3;});})[_0x878c('0x1e')](function(_0x42d256){if(_0x2931cb||!_0x42d256){return;}_0x3d5413[_0x878c('0x7')][_0x2dbb49]={};logger[_0x878c('0x1f')](_0x878c('0x31'),_0x3ab188,_0x3d5413['voiceQueues'][_0xa23c3c][_0x878c('0x32')],_0x2dbb49,_0xa23c3c);_0x3d5413[_0x878c('0x7')][_0x2dbb49][_0x878c('0x1b')]=setTimeout(_0x3d5413['stopAcw'][_0x878c('0xb')](_0x3d5413,_0x2dbb49),_0x3d5413[_0x878c('0x5')][_0xa23c3c][_0x878c('0x32')]*0x3e8);_0x3d5413[_0x878c('0x7')][_0x2dbb49][_0x878c('0x1a')]=moment()['format'](_0x878c('0x33'));_0x3d5413[_0x878c('0x7')][_0x2dbb49][_0x878c('0x1d')]=_0x3ab188;_0x3d5413[_0x878c('0x7')][_0x2dbb49][_0x878c('0x26')]=_0xa23c3c;_0x3d5413[_0x878c('0x7')][_0x2dbb49][_0x878c('0x34')]=_0x3d5413[_0x878c('0x34')][_0x878c('0xb')](_0x3d5413,_0x2dbb49,_0x3ab188);});}})[_0x878c('0x20')](function(){logger['error'](_0x878c('0x31'),_0x3ab188,_0x3d5413[_0x878c('0x5')][_0xa23c3c][_0x878c('0x32')],_0x2dbb49,_0xa23c3c);})[_0x878c('0x23')](function(){delete _0x3d5413['channels'][_0x3ab188];});}catch(_0x5348c1){logger[_0x878c('0x21')]('[ACW][START]\x20%s',_0x5348c1[_0x878c('0x35')]);}};Acw[_0x878c('0x19')][_0x878c('0x36')]=function(_0x34f455){try{var _0x2b7b24=this;if(_0x2b7b24[_0x878c('0x7')][_0x34f455]){_0x2b7b24[_0x878c('0x7')][_0x34f455]['timer']=![];var _0x17fca6=_0x2b7b24['timers'][_0x34f455][_0x878c('0x1d')];var _0x426aa7=_0x2b7b24['timers'][_0x34f455]['queue'];var _0x566142=_0x2b7b24[_0x878c('0x5')][_0x426aa7][_0x878c('0x32')];logger[_0x878c('0x1f')](_0x878c('0x37'),_0x17fca6,_0x34f455);RpcUser['getAgent'](this[_0x878c('0x6')][_0x34f455]['id'])[_0x878c('0x1e')](function(_0x438eb7){if(_0x438eb7[_0x878c('0x38')]===_0x878c('0x27')){return RpcUser['saveUnpause'](_0x2b7b24[_0x878c('0x6')][_0x34f455]);}});RpcVoiceAgentReport[_0x878c('0x1c')]({'acwtime':_0x566142,'agentacw':!![]},_0x17fca6,_0x34f455)[_0x878c('0x1e')](function(_0x28bece){logger['info'](_0x878c('0x39'),_0x17fca6,_0x566142,_0x28bece);})['catch'](function(_0x2f9e0c){logger[_0x878c('0x21')](_0x878c('0x22'),_0x17fca6,_0x2f9e0c);});}else{logger[_0x878c('0x21')](_0x878c('0x3a'),_0x34f455);if(_0x2b7b24[_0x878c('0x7')]){logger[_0x878c('0x1f')](_0x878c('0x3b'),JSON[_0x878c('0x3c')](_0x2b7b24[_0x878c('0x7')]));}}}catch(_0x5c9c5b){logger[_0x878c('0x21')](_0x878c('0x3d'),_0x5c9c5b[_0x878c('0x35')]);}};Acw[_0x878c('0x19')]['syncAgentConnect']=function(_0x4913a0){try{if(this[_0x878c('0x5')][_0x4913a0[_0x878c('0x26')]]&&(this[_0x878c('0x5')][_0x4913a0['queue']]['acw']||this['voiceQueues'][_0x4913a0[_0x878c('0x26')]][_0x878c('0x3e')])){if(this['agents'][_0x4913a0['interface']]){this[_0x878c('0x8')][_0x4913a0['uniqueid']]={'queue':_0x4913a0[_0x878c('0x26')],'interface':_0x4913a0[_0x878c('0x25')],'destlinkedid':_0x4913a0[_0x878c('0x2e')]};}}}catch(_0x19cb79){logger[_0x878c('0x21')]('[ACW][syncAgentConnect]\x20%s',_0x19cb79[_0x878c('0x35')]);}};Acw[_0x878c('0x19')]['syncAgentConnectPreview']=function(_0x21b132){try{if(this[_0x878c('0x5')][_0x21b132[_0x878c('0x26')]]&&(this['voiceQueues'][_0x21b132[_0x878c('0x26')]]['acw']||this[_0x878c('0x5')][_0x21b132[_0x878c('0x26')]]['mandatoryDisposition'])){if(this['agents'][_0x21b132[_0x878c('0x25')]]){this[_0x878c('0x8')][_0x21b132[_0x878c('0x1d')]]={'queue':_0x21b132['queue'],'interface':_0x21b132[_0x878c('0x25')]};}}}catch(_0x4db14d){logger[_0x878c('0x21')]('[ACW][syncAgentConnectPreview]\x20%s',_0x4db14d[_0x878c('0x35')]);}};Acw[_0x878c('0x19')][_0x878c('0xd')]=function(_0x32ee06){try{if(this[_0x878c('0x8')][_0x32ee06[_0x878c('0x1d')]]&&_[_0x878c('0x3f')](this['channels'][_0x32ee06['uniqueid']]['attended'])){logger[_0x878c('0x1f')](_0x878c('0x40'),_0x32ee06[_0x878c('0x1d')]);this[_0x878c('0x24')](_0x32ee06[_0x878c('0x1d')]);}else if(this[_0x878c('0x8')][_0x32ee06[_0x878c('0x41')]]&&_[_0x878c('0x3f')](this[_0x878c('0x8')][_0x32ee06['linkedid']][_0x878c('0x42')])){logger[_0x878c('0x1f')](_0x878c('0x43'),_0x32ee06[_0x878c('0x41')]);this[_0x878c('0x24')](_0x32ee06[_0x878c('0x41')]);}}catch(_0x3b211b){logger[_0x878c('0x21')](_0x878c('0x44'),_0x3b211b[_0x878c('0x35')]);}};Acw['prototype']['syncHangup']=function(_0x122922){try{if(this[_0x878c('0x8')][_0x122922[_0x878c('0x1d')]]&&this[_0x878c('0x8')][_0x122922['uniqueid']][_0x878c('0x42')]){logger[_0x878c('0x1f')](_0x878c('0x45'),_0x122922['uniqueid']);this[_0x878c('0x24')](_0x122922[_0x878c('0x1d')]);}else if(this[_0x878c('0x8')][_0x122922['linkedid']]&&this[_0x878c('0x8')][_0x122922['linkedid']]['attended']){logger[_0x878c('0x1f')](_0x878c('0x46'),_0x122922[_0x878c('0x41')]);this[_0x878c('0x24')](_0x122922[_0x878c('0x41')]);}}catch(_0x44a0a8){logger[_0x878c('0x21')](_0x878c('0x47'),_0x44a0a8[_0x878c('0x35')]);}};Acw[_0x878c('0x19')]['syncAttendedTransfer']=function(_0x5b824a){try{if(!_[_0x878c('0x48')](this['channels'][_0x5b824a[_0x878c('0x49')]])){this[_0x878c('0x24')](_0x5b824a[_0x878c('0x49')]);if(this['channels'][_0x5b824a[_0x878c('0x4a')]]){this[_0x878c('0x8')][_0x5b824a[_0x878c('0x4a')]][_0x878c('0x42')]=!![];this[_0x878c('0x8')][_0x5b824a[_0x878c('0x4b')]]=this[_0x878c('0x8')][_0x5b824a[_0x878c('0x4a')]];delete this[_0x878c('0x8')][_0x5b824a['secondtransfereruniqueid']];}}else if(!_[_0x878c('0x48')](this[_0x878c('0x8')][_0x5b824a[_0x878c('0x4b')]])){this['startAcw'](_0x5b824a['transfertargetuniqueid']);if(this[_0x878c('0x8')][_0x5b824a[_0x878c('0x4c')]]){this['channels'][_0x5b824a[_0x878c('0x4c')]]['attended']=!![];this[_0x878c('0x8')][_0x5b824a[_0x878c('0x49')]]=this[_0x878c('0x8')][_0x5b824a[_0x878c('0x4c')]];delete this[_0x878c('0x8')][_0x5b824a[_0x878c('0x4c')]];}}}catch(_0xeee390){logger[_0x878c('0x21')](_0x878c('0x4d'),_0xeee390[_0x878c('0x35')]);}};Acw[_0x878c('0x19')][_0x878c('0x14')]=function(_0x4a446b){try{if(this[_0x878c('0x8')][_0x4a446b[_0x878c('0x4e')]]){logger['info'](_0x878c('0x4f'),JSON['stringify'](_0x4a446b[_0x878c('0x4e')]));this[_0x878c('0x24')](_0x4a446b[_0x878c('0x4e')]);}else if(this[_0x878c('0x8')][_0x4a446b[_0x878c('0x50')]]){logger['info']('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x878c('0x3c')](_0x4a446b[_0x878c('0x50')]));this[_0x878c('0x24')](_0x4a446b[_0x878c('0x50')]);}}catch(_0x38da83){logger['error'](_0x878c('0x51'),_0x38da83[_0x878c('0x35')]);}};Acw['prototype']['syncAgentRingNoAnswer']=function(_0xa1a09f){try{if(this[_0x878c('0x5')][_0xa1a09f[_0x878c('0x26')]]&&this[_0x878c('0x5')][_0xa1a09f['queue']][_0x878c('0x52')]===_0x878c('0x53')){if(this[_0x878c('0x6')][_0xa1a09f[_0x878c('0x25')]]){logger[_0x878c('0x1f')](_0x878c('0x54'),_0xa1a09f[_0x878c('0x1d')],_0xa1a09f[_0x878c('0x25')],_0xa1a09f[_0x878c('0x26')]);return RpcUser[_0x878c('0x55')](this['agents'][_0xa1a09f[_0x878c('0x25')]],'Auto-Pause',_0xa1a09f[_0x878c('0x1d')]);}}}catch(_0x1cf7be){logger['error'](_0x878c('0x56'),_0x1cf7be[_0x878c('0x35')]);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index bf5fe61..c904a1b 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 _0x2ab9=['Action','promisify','action','format','inspect','error','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','shutdown','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','catch','[ami.js][fullybooted]','exports','util','../../config/logger','asterisk','port','username'];(function(_0x587783,_0x6296e6){var _0x1cca44=function(_0x2c5082){while(--_0x2c5082){_0x587783['push'](_0x587783['shift']());}};_0x1cca44(++_0x6296e6);}(_0x2ab9,0x14f));var _0x92ab=function(_0x1aa4f5,_0x374f24){_0x1aa4f5=_0x1aa4f5-0x0;var _0x5440ab=_0x2ab9[_0x1aa4f5];return _0x5440ab;};'use strict';var Manager=require('asterisk-manager');var BPromise=require('bluebird');var util=require(_0x92ab('0x0'));var logger=require(_0x92ab('0x1'))('ami');var config=require('../../config/environment');var ami=new Manager(config[_0x92ab('0x2')][_0x92ab('0x3')],config['asterisk']['ip'],config['asterisk'][_0x92ab('0x4')],config[_0x92ab('0x2')]['password'],!![]);ami['keepConnected']();ami[_0x92ab('0x5')]=BPromise[_0x92ab('0x6')](ami[_0x92ab('0x7')]);function error(_0x1bdbe1){logger['error'](util[_0x92ab('0x8')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x92ab('0x2')][_0x92ab('0x4')],config['asterisk']['ip'],config[_0x92ab('0x2')][_0x92ab('0x3')],util[_0x92ab('0x9')](_0x1bdbe1,![],null)));}function close(){logger[_0x92ab('0xa')](util['format']('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0x92ab('0x2')][_0x92ab('0x4')],config[_0x92ab('0x2')]['ip'],config[_0x92ab('0x2')]['port']));}ami[_0x92ab('0xb')]=function(){return function(){return ami[_0x92ab('0x5')]({'action':_0x92ab('0xc')});};};ami[_0x92ab('0xd')]=function(){return function(){return ami[_0x92ab('0x5')]({'action':_0x92ab('0xe')});};};ami[_0x92ab('0xf')]=function(){return function(){return ami[_0x92ab('0x5')]({'action':_0x92ab('0x10')});};};ami[_0x92ab('0x11')]=function(){return function(){return ami[_0x92ab('0x5')]({'action':_0x92ab('0x12')});};};ami[_0x92ab('0x13')]=function(){return function(){return ami[_0x92ab('0x5')]({'action':_0x92ab('0x14')});};};function connect(){logger['info'](util[_0x92ab('0x8')](_0x92ab('0x15'),config[_0x92ab('0x2')]['username'],config[_0x92ab('0x2')]['ip'],config[_0x92ab('0x2')]['port']));ami[_0x92ab('0x16')](_0x92ab('0xa'),error);ami[_0x92ab('0x16')](_0x92ab('0x17'),close);}ami['on']('connect',connect);ami['on'](_0x92ab('0x18'),function(_0x35bc88){logger[_0x92ab('0x19')](util[_0x92ab('0x8')](_0x92ab('0x1a'),config[_0x92ab('0x2')]['username'],config['asterisk']['ip'],config[_0x92ab('0x2')][_0x92ab('0x3')],util[_0x92ab('0x9')](_0x35bc88,![],null)));});ami['on'](_0x92ab('0x1b'),function(){logger[_0x92ab('0x19')](util[_0x92ab('0x8')](_0x92ab('0x1c'),config[_0x92ab('0x2')][_0x92ab('0x4')],config[_0x92ab('0x2')]['ip'],config['asterisk'][_0x92ab('0x3')]));return Promise[_0x92ab('0x1d')]()[_0x92ab('0x1e')](ami[_0x92ab('0xb')]())[_0x92ab('0x1e')](ami[_0x92ab('0xd')]())[_0x92ab('0x1e')](ami['actionSipPeerStatus']())[_0x92ab('0x1e')](ami[_0x92ab('0x11')]())[_0x92ab('0x1e')](ami[_0x92ab('0x13')]())[_0x92ab('0x1f')](function(_0x102426){logger['error'](_0x92ab('0x20'),util['inspect'](_0x102426,{'showHidden':![],'depth':null}));});});ami[_0x92ab('0x16')](_0x92ab('0xa'),error);ami[_0x92ab('0x16')]('close',close);module[_0x92ab('0x21')]=ami; \ No newline at end of file +var _0xaaa2=['actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','resolve','then','catch','[ami.js][fullybooted]','exports','asterisk-manager','../../config/logger','ami','../../config/environment','asterisk','port','username','keepConnected','Action','promisify','action','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s'];(function(_0x344ade,_0x43e083){var _0x2d3cd6=function(_0x3b91d9){while(--_0x3b91d9){_0x344ade['push'](_0x344ade['shift']());}};_0x2d3cd6(++_0x43e083);}(_0xaaa2,0x1b8));var _0x2aaa=function(_0x791a0c,_0x30d85d){_0x791a0c=_0x791a0c-0x0;var _0x41e3b8=_0xaaa2[_0x791a0c];return _0x41e3b8;};'use strict';var Manager=require(_0x2aaa('0x0'));var BPromise=require('bluebird');var util=require('util');var logger=require(_0x2aaa('0x1'))(_0x2aaa('0x2'));var config=require(_0x2aaa('0x3'));var ami=new Manager(config[_0x2aaa('0x4')][_0x2aaa('0x5')],config[_0x2aaa('0x4')]['ip'],config[_0x2aaa('0x4')][_0x2aaa('0x6')],config[_0x2aaa('0x4')]['password'],!![]);ami[_0x2aaa('0x7')]();ami[_0x2aaa('0x8')]=BPromise[_0x2aaa('0x9')](ami[_0x2aaa('0xa')]);function error(_0x165bc2){logger['error'](util[_0x2aaa('0xb')](_0x2aaa('0xc'),config['asterisk']['username'],config[_0x2aaa('0x4')]['ip'],config[_0x2aaa('0x4')][_0x2aaa('0x5')],util[_0x2aaa('0xd')](_0x165bc2,![],null)));}function close(){logger[_0x2aaa('0xe')](util[_0x2aaa('0xb')](_0x2aaa('0xf'),config['asterisk']['username'],config[_0x2aaa('0x4')]['ip'],config[_0x2aaa('0x4')][_0x2aaa('0x5')]));}ami[_0x2aaa('0x10')]=function(){return function(){return ami[_0x2aaa('0x8')]({'action':_0x2aaa('0x11')});};};ami[_0x2aaa('0x12')]=function(){return function(){return ami[_0x2aaa('0x8')]({'action':_0x2aaa('0x13')});};};ami[_0x2aaa('0x14')]=function(){return function(){return ami[_0x2aaa('0x8')]({'action':_0x2aaa('0x15')});};};ami[_0x2aaa('0x16')]=function(){return function(){return ami[_0x2aaa('0x8')]({'action':_0x2aaa('0x17')});};};ami[_0x2aaa('0x18')]=function(){return function(){return ami[_0x2aaa('0x8')]({'action':_0x2aaa('0x19')});};};function connect(){logger[_0x2aaa('0x1a')](util[_0x2aaa('0xb')](_0x2aaa('0x1b'),config['asterisk'][_0x2aaa('0x6')],config[_0x2aaa('0x4')]['ip'],config[_0x2aaa('0x4')][_0x2aaa('0x5')]));ami[_0x2aaa('0x1c')](_0x2aaa('0xe'),error);ami[_0x2aaa('0x1c')](_0x2aaa('0x1d'),close);}ami['on'](_0x2aaa('0x1e'),connect);ami['on']('shutdown',function(_0x3741b0){logger[_0x2aaa('0x1a')](util[_0x2aaa('0xb')](_0x2aaa('0x1f'),config['asterisk'][_0x2aaa('0x6')],config['asterisk']['ip'],config[_0x2aaa('0x4')]['port'],util['inspect'](_0x3741b0,![],null)));});ami['on'](_0x2aaa('0x20'),function(){logger[_0x2aaa('0x1a')](util['format']('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x2aaa('0x4')][_0x2aaa('0x6')],config[_0x2aaa('0x4')]['ip'],config[_0x2aaa('0x4')][_0x2aaa('0x5')]));return Promise[_0x2aaa('0x21')]()[_0x2aaa('0x22')](ami[_0x2aaa('0x10')]())[_0x2aaa('0x22')](ami[_0x2aaa('0x12')]())['then'](ami[_0x2aaa('0x14')]())[_0x2aaa('0x22')](ami['actionQueueSummary']())['then'](ami[_0x2aaa('0x18')]())[_0x2aaa('0x23')](function(_0x5635a3){logger[_0x2aaa('0xe')](_0x2aaa('0x24'),util[_0x2aaa('0xd')](_0x5635a3,{'showHidden':![],'depth':null}));});});ami['once'](_0x2aaa('0xe'),error);ami[_0x2aaa('0x1c')]('close',close);module[_0x2aaa('0x25')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 9bee7a6..8cec7a0 100644 --- a/server/services/ami/client.js +++ b/server/services/ami/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['result','catch','exports','jayson/promise','bluebird','../../config/logger','client','http','Request','request','then','debug','rpc','memberReport','error','message'];(function(_0x45b1ba,_0x5a6a21){var _0x145ddb=function(_0x650d42){while(--_0x650d42){_0x45b1ba['push'](_0x45b1ba['shift']());}};_0x145ddb(++_0x5a6a21);}(_0xe706,0xa3));var _0x6e70=function(_0x2ef9e2,_0x376185){_0x2ef9e2=_0x2ef9e2-0x0;var _0x2d4632=_0xe706[_0x2ef9e2];return _0x2d4632;};'use strict';var jayson=require(_0x6e70('0x0'));var BPromise=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('ami');var client=jayson[_0x6e70('0x3')][_0x6e70('0x4')]({'port':0x2329});client[_0x6e70('0x5')]=function(_0x7dfbc3,_0x142c27){return new BPromise(function(_0x2164a4,_0x376a8d){return client[_0x6e70('0x6')](_0x7dfbc3,_0x142c27)[_0x6e70('0x7')](function(_0x4381d1){logger[_0x6e70('0x8')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x142c27,_0x4381d1);if(_0x4381d1[_0x6e70('0xb')]){logger[_0x6e70('0xb')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')],_0x142c27);return _0x376a8d(_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')]);}else{return _0x2164a4(_0x4381d1[_0x6e70('0xd')]);}})[_0x6e70('0xe')](function(_0x4600f9){logger['error']('rpc',_0x6e70('0xa'),_0x7dfbc3,_0x4600f9,_0x142c27);return _0x376a8d(_0x4600f9);});});};module[_0x6e70('0xf')]=client; \ No newline at end of file +var _0x9ffd=['catch','exports','jayson/promise','bluebird','../../config/logger','client','http','Request','then','debug','rpc','memberReport','error','result'];(function(_0x550095,_0x1465f3){var _0x28eff9=function(_0x73d2e2){while(--_0x73d2e2){_0x550095['push'](_0x550095['shift']());}};_0x28eff9(++_0x1465f3);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x1e59c8,_0x65ebb0){_0x1e59c8=_0x1e59c8-0x0;var _0x1006cc=_0x9ffd[_0x1e59c8];return _0x1006cc;};'use strict';var jayson=require(_0xd9ff('0x0'));var BPromise=require(_0xd9ff('0x1'));var logger=require(_0xd9ff('0x2'))('ami');var client=jayson[_0xd9ff('0x3')][_0xd9ff('0x4')]({'port':0x2329});client[_0xd9ff('0x5')]=function(_0x5493ae,_0x53e962){return new BPromise(function(_0x1c9460,_0x111697){return client['request'](_0x5493ae,_0x53e962)[_0xd9ff('0x6')](function(_0x2982c3){logger[_0xd9ff('0x7')](_0xd9ff('0x8'),_0xd9ff('0x9'),_0x5493ae,_0x53e962,_0x2982c3);if(_0x2982c3[_0xd9ff('0xa')]){logger[_0xd9ff('0xa')](_0xd9ff('0x8'),_0xd9ff('0x9'),_0x5493ae,_0x2982c3['error']['message'],_0x53e962);return _0x111697(_0x2982c3['error']['message']);}else{return _0x1c9460(_0x2982c3[_0xd9ff('0xb')]);}})[_0xd9ff('0xc')](function(_0x193537){logger[_0xd9ff('0xa')](_0xd9ff('0x8'),_0xd9ff('0x9'),_0x5493ae,_0x193537,_0x53e962);return _0x111697(_0x193537);});});};module[_0xd9ff('0xd')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 5594b54..90ec20b 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 _0xa1a3=['checkIsTrunkReachable','Trunk','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','checkIfTimeIntervals','ifTimeIvr','ifTime','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','length','push','Action','iftime\x20%s,%s','interval','content','true','catch','command','indexOf','all','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','loopCampaigns','resetActiveCalls','syncCampaigns','undefined','resolve','dialGlobalInterval','dialTimezone','launchHandleIvr','[syncCampaigns]','checkDialMethod','dialMethod','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','[ifTime][promiseAll]','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','AMI\x20IfTime','Error','queue','uniqueId','uniqueid','type','ivr','answertime','outboundAnswerCallsDay','reason','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','syncQueueCallerAbandon','updateOriginated','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','state','Drop','TIMEOUT','agiafterat','countdropretry','countglobal','dialDropRetryFrequency','callAdditionalPhoneAfterMin','verifyAdditionalPhones','voiceQueue','additional','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','ContactId','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','countabandonedretry','dialAbandonedMaxRetry','add','minutes','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','swapAdditionalPhones','channel','actionid','strategy','rrmemory','roundrobin','isNil','locked','paused','stateinterface','idHopper','status','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','run','[booked][RR][finaly]','[booked][unlock]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','response','Success','callProgressDetecting','[callProgressDetecting]\x20','syncVarSet','variable','amdstatus','exten','dialAMDActive','value','outboundAnswerAgiCallsDay','HangupInAMD','membername','custom:amd','buildObj','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','AMD','amd','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','[rescheduleContact][Machine]','HANGUP','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','[syncAgentComplete][createHistory][0]','countbusyretry','dialMachineRetryFrequency','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr]','cause-txt','Normal\x20Clearing','outboundUnknownCallsDay','running','statusMessage','getQueueCampaignStatusMessage','available','inUse','pTalking','ACTIVE','queueSummaryCountersUpdated','assign','filter','dialPreviewRecallmeReminder','online','handlePreviewRecallNotifications','map','user:%s','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]','[actions]','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','emptyContact','notFound','UserId','[emptyContact][createHistory]','[emptyContact]','user:dialPreviewRecallReminder','actionOriginate','object','phone','originate','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','\x22%s,%s%s,,,%s\x22','getCaller','xcally-motion-dialer','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','setXMDContactVariables','Contact','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','dialPrefix','trim','substring','dialCutDigit','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialAbandonedRetryFrequency','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','entity\x20is\x20undefine','[callProgressDetecting]','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','custom:agentbusy','busy','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalAvailable','talking','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive]','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','loggedIn','predictiveIntervalPauses','outboundQueuePauses','[CatchErlangB]','agentBusyFactor','busyFactor','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','scheduledat','Agent','voicePause','unlockContact','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','handleIvr','limitCalls','getContactDialerIvr','[getContactCampaign2][Empty]','RUNNING','checkIsBlackListIvr','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','getContactDialer','checkContactEmpty','countReScheduled','[countReScheduled]\x20','[actionOriginate]\x20','[handlePredictive][limitChannel]','tryOriginatePredictive','dialOrderByScheduledAt','checkIsBlackList','[getContactDialerPredictive]','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','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','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','exports','util','lodash','uuid','moment','ioredis','../../../config/logger','dialer','booked','predictive','syncQueueSummary','../ami','defaults','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/setting','./models/action','./models/history','./models/final','./models/queueCallerAbandon','./models/hangup','XCALLY_IP_AGI','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','queuesSummary','agentconnect','syncAgentConnect','bind','queuecallerabandon','originateresponse','syncOriginateResponse','syncAgentComplete','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','syncNewExten','varset','queuemember','syncQueueMember','syncQueueStatusComplete','getSettings','then','emit','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','voice:queue:%s','name','voice_queue:save','info','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','isUndefined','predictiveIntervalAvgTalktime','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','erlangBusyFactor','merge','getSeconds','startPredictive\x20value\x20cleared','handlePredictive','error','stack','checkContactLowerLimitOriginate','temp','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contactsRescheduled','contacts','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','statedesc','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','pick','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','isIVRCampaign','format','campaign:ivr:%s','sendMessageOneNotActive','originated','is\x20not\x20active','DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','[ifTime][Action]','isTrunkReachable','active','SIP/%s','reachable','unmonitored'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa1a3,0x1a0));var _0x3a1a=function(_0x55953d,_0x3a32ff){_0x55953d=_0x55953d-0x0;var _0x3ea9b9=_0xa1a3[_0x55953d];return _0x3ea9b9;};'use strict';var util=require(_0x3a1a('0x0'));var _=require(_0x3a1a('0x1'));var uuid=require(_0x3a1a('0x2'));var moment=require(_0x3a1a('0x3'));var rr=require('rr');var Redis=require(_0x3a1a('0x4'));var utils=require('./utils');var hopperUtils=require('./utils/hopper');var ut=require('../preview/util/util');var config=require('../../../config/environment/');var logger=require(_0x3a1a('0x5'))(_0x3a1a('0x6'));var loggerBooked=require('../../../config/logger')(_0x3a1a('0x7'));var loggerPredictive=require(_0x3a1a('0x5'))(_0x3a1a('0x8'));var loggerPredictiveCalls=require(_0x3a1a('0x5'))('predictiveCalls');var loggerSyncQueueSummary=require(_0x3a1a('0x5'))(_0x3a1a('0x9'));var ami=require(_0x3a1a('0xa'));config['redis']=_[_0x3a1a('0xb')](config[_0x3a1a('0xc')],{'host':_0x3a1a('0xd'),'port':0x18eb});var io=require(_0x3a1a('0xe'))(new Redis(config[_0x3a1a('0xc')]));var cmHopper=require(_0x3a1a('0xf'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require(_0x3a1a('0x10'));var Interval=require('../rpc/interval');var Action=require(_0x3a1a('0x11'));var History=require(_0x3a1a('0x12'));var Final=require(_0x3a1a('0x13'));var AgentComplete=require('./models/agentComplete');var QueueCallerAbandon=require(_0x3a1a('0x14'));var Hangup=require(_0x3a1a('0x15'));var ipAgi=process['env'][_0x3a1a('0x16')]||'127.0.0.1';var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x3a1a('0x17')][_0x3a1a('0x18')]=function(_0x1345b7){this['tail']=this['tail']?this[_0x3a1a('0x19')][_0x3a1a('0x1a')](_0x1345b7):_0x1345b7();};function Dialer(_0x394888,_0x2216e6){this[_0x3a1a('0x1b')]=new Sequence();this[_0x3a1a('0x1c')]=_0x2216e6;this[_0x3a1a('0x1d')]=_0x394888['voiceQueues'];this[_0x3a1a('0x1e')]=_0x394888['campaigns'];this[_0x3a1a('0x1f')]=_0x394888[_0x3a1a('0x1f')];this[_0x3a1a('0x20')]=_0x394888[_0x3a1a('0x20')];this[_0x3a1a('0x21')]=config[_0x3a1a('0x21')]||0x2;this[_0x3a1a('0x22')]={};this[_0x3a1a('0x23')]={};this[_0x3a1a('0x24')]={};this['uniqueId']={};this[_0x3a1a('0x25')]={};this[_0x3a1a('0x26')]={};this[_0x3a1a('0x27')]={};this[_0x3a1a('0x28')]={};this[_0x3a1a('0x29')]={};this[_0x3a1a('0x2a')]={};this[_0x3a1a('0x2b')]={};ami['on'](_0x3a1a('0x2c'),this[_0x3a1a('0x2d')][_0x3a1a('0x2e')](this));ami['on'](_0x3a1a('0x2f'),this['syncQueueCallerAbandon'][_0x3a1a('0x2e')](this));ami['on'](_0x3a1a('0x30'),this[_0x3a1a('0x31')]['bind'](this));ami['on']('agentcomplete',this[_0x3a1a('0x32')][_0x3a1a('0x2e')](this));ami['on']('custom:queuesummary',this[_0x3a1a('0x9')]['bind'](this));ami['on'](_0x3a1a('0x33'),this[_0x3a1a('0x34')]['bind'](this));ami['on'](_0x3a1a('0x35'),this[_0x3a1a('0x36')][_0x3a1a('0x2e')](this));ami['on']('newexten',this[_0x3a1a('0x37')][_0x3a1a('0x2e')](this));ami['on'](_0x3a1a('0x38'),this['syncVarSet'][_0x3a1a('0x2e')](this));ami['on'](_0x3a1a('0x39'),this[_0x3a1a('0x3a')][_0x3a1a('0x2e')](this));ami['on']('queuestatuscomplete',this[_0x3a1a('0x3b')][_0x3a1a('0x2e')](this));this['loopCampaigns']();this['loopClearZombieChannels']();RpcSetting[_0x3a1a('0x3c')]()[_0x3a1a('0x3d')](function(_0x203254){previewRecallmeReminderInterval=_0x203254['previewRecallmeReminderInterval'];});}function isNotNull(_0x8df4cf){return _0x8df4cf!==null&&!_['isUndefined'](_0x8df4cf);}function msgResponse(_0x6f72d0,_0x82f9e8,_0x243d02){return{'action':_0x6f72d0,'response':_0x82f9e8,'message':_0x243d02,'stack':_0x243d02};}function emit(_0x269696,_0xf1e2e5,_0x4813e1){io['to'](_0x269696)[_0x3a1a('0x3e')](_0xf1e2e5,_0x4813e1);}function emitOutboundVoiceQueueSummary(_0x2fbce7){if(_0x2fbce7['type']==='outbound'){logger[_0x3a1a('0x3f')](_0x3a1a('0x40'),util[_0x3a1a('0x41')](_0x2fbce7,{'showHidden':![],'depth':null}));emit(util['format'](_0x3a1a('0x42'),_0x2fbce7[_0x3a1a('0x43')]),_0x3a1a('0x44'),_0x2fbce7);}}function checkGetDataPredictive(_0x254cd5){if(isNotNull(_0x254cd5)&&!_['isEmpty'](_0x254cd5)){loggerPredictive['info']('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x3a1a('0x45')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x254cd5[_0x3a1a('0x46')]);loggerPredictive['info'](_0x3a1a('0x47'),_0x254cd5[_0x3a1a('0x48')]);loggerPredictive[_0x3a1a('0x45')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x254cd5[_0x3a1a('0x49')]);loggerPredictive[_0x3a1a('0x45')](_0x3a1a('0x4a'),_0x254cd5[_0x3a1a('0x4b')]);loggerPredictive['info']('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x254cd5[_0x3a1a('0x4c')]);loggerPredictive['info'](_0x3a1a('0x4d'),_0x254cd5['predictiveIntervalAvgTalktime']);loggerPredictive[_0x3a1a('0x45')](_0x3a1a('0x4e'));if(_0x254cd5[_0x3a1a('0x46')]>0x0){if(!_[_0x3a1a('0x4f')](_0x254cd5['predictiveIntervalAvgTalktime'])&&_0x254cd5[_0x3a1a('0x50')]>0x0){return!![];}loggerPredictive[_0x3a1a('0x45')](_0x3a1a('0x51'));if(!_[_0x3a1a('0x4f')](_0x254cd5[_0x3a1a('0x4c')])&&_0x254cd5[_0x3a1a('0x4c')]>0x0){return!![];}loggerPredictive['info'](_0x3a1a('0x52'));}else{loggerPredictive[_0x3a1a('0x45')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x3a1a('0x45')](_0x3a1a('0x53'));}return![];}function mergeDataErlangB(_0x50bfbf){return function(_0x5a912a){loggerPredictive[_0x3a1a('0x45')](_0x3a1a('0x54'));loggerPredictive[_0x3a1a('0x45')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5a912a[_0x3a1a('0x55')]);loggerPredictive[_0x3a1a('0x45')](_0x3a1a('0x56'),_0x5a912a[_0x3a1a('0x57')]);loggerPredictive[_0x3a1a('0x45')](_0x3a1a('0x58'),_0x5a912a[_0x3a1a('0x59')]);loggerPredictive[_0x3a1a('0x45')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5a912a[_0x3a1a('0x5a')]);loggerPredictive[_0x3a1a('0x45')](_0x3a1a('0x58'),_0x5a912a['erlangAbandonmentRate']);loggerPredictive[_0x3a1a('0x45')]('---------------------------');_[_0x3a1a('0x5b')](_0x50bfbf,_0x5a912a);};}function ifInterval(_0x567a01,_0x6d452e){if(_[_0x3a1a('0x4f')](_0x6d452e)){return![];}return utils[_0x3a1a('0x5c')](undefined,_0x6d452e)<_0x567a01*0x3c;}function clearPredictiveAttributes(_0xabd49d){if(_0xabd49d[_0x3a1a('0x27')]){_0xabd49d[_0x3a1a('0x27')]=undefined;loggerPredictive[_0x3a1a('0x3f')](_0xabd49d['name'],'startProgressive\x20value\x20cleared');}if(_0xabd49d[_0x3a1a('0x26')]){_0xabd49d[_0x3a1a('0x26')]=undefined;loggerPredictive[_0x3a1a('0x3f')](_0xabd49d[_0x3a1a('0x43')],_0x3a1a('0x5d'));}if(_0xabd49d[_0x3a1a('0x5e')]){clearInterval(_0xabd49d[_0x3a1a('0x5e')]);_0xabd49d[_0x3a1a('0x5e')]=undefined;loggerPredictive[_0x3a1a('0x3f')](_0xabd49d[_0x3a1a('0x43')],'handlePredictive\x20interval\x20cleared');}}function loggerCatchPredictive(_0x34b76e,_0x4dd0e0){return function(_0x24f881){loggerPredictive[_0x3a1a('0x5f')](_0x4dd0e0[_0x3a1a('0x43')],_0x34b76e);loggerPredictive['error'](_0x24f881[_0x3a1a('0x60')]);clearPredictiveAttributes(_0x4dd0e0);};}function loggerCatch(_0x10be24){return function(_0x3b09c1){logger[_0x3a1a('0x5f')](_0x10be24,util[_0x3a1a('0x41')](_0x3b09c1,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0xb1f33b,_0x46028f,_0x251f75){return function(_0x2eb02c){utils[_0x3a1a('0x61')](_0x46028f,_0x251f75,0x0);_0x46028f[_0x3a1a('0x62')]=0x0;logger[_0x3a1a('0x5f')](_0xb1f33b,util[_0x3a1a('0x41')](_0x2eb02c,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x5565ad){return function(_0x41237c){if(isNotNull(_0x41237c)&&isNotNull(_0x41237c[0x0])){if(_0x41237c[0x0]['contactsRescheduled']>0x0){_0x5565ad[_0x3a1a('0x63')]=utils[_0x3a1a('0x64')][_0x3a1a('0x65')];logger['info'](_0x3a1a('0x66')+_0x5565ad[_0x3a1a('0x43')],_0x41237c[0x0][_0x3a1a('0x67')],_0x3a1a('0x68'));}else{_0x5565ad['message']=utils[_0x3a1a('0x64')][_0x3a1a('0x69')];logger[_0x3a1a('0x45')](_0x3a1a('0x6a')+_0x5565ad[_0x3a1a('0x43')]);}}};}function createObjHistory(_0x50a7aa,_0x9047ad,_0x4ecd71,_0x5170e5,_0x488b80){_0x50a7aa[_0x3a1a('0x63')]=_0x4ecd71;var _0x4fa7f0=new Action(_0x50a7aa,_0x9047ad);var _0x18d451=new History(_0x4fa7f0);_0x18d451['state']=_0x5170e5;_0x18d451[_0x3a1a('0x6b')]=_0x488b80;_0x18d451[_0x3a1a('0x6c')]=_0x4fa7f0[_0x3a1a('0x6d')];return _0x18d451;}function unlockQueueStatus(_0x33e0af,_0x5c1c03){setTimeout(function(){if(_['isUndefined'](_0x33e0af[_0x3a1a('0x6e')])){loggerBooked[_0x3a1a('0x5f')](_0x3a1a('0x6f'),_0x5c1c03);}_0x33e0af['queueStatusComplete']=!![];loggerBooked[_0x3a1a('0x45')](_0x3a1a('0x70'),_0x5c1c03,JSON[_0x3a1a('0x71')](_[_0x3a1a('0x72')](_0x33e0af,[_0x3a1a('0x43'),'queueStatusComplete'])));},0x1f3);}function checkInterval(_0x351222){return function(){if(!isNotNull(_0x351222[_0x3a1a('0x73')])){_0x351222[_0x3a1a('0x63')]=utils['CAMPAIGN_STATUS'][_0x3a1a('0x74')];throw _0x351222['name']+_0x3a1a('0x75');}if(!isNotNull(_0x351222[_0x3a1a('0x73')][_0x3a1a('0x76')])){_0x351222['message']=utils[_0x3a1a('0x64')][_0x3a1a('0x74')];throw _0x351222[_0x3a1a('0x43')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x3a1a('0x77')](_0x351222[_0x3a1a('0x73')][_0x3a1a('0x76')]))){_0x351222['message']=utils[_0x3a1a('0x64')][_0x3a1a('0x74')];throw _0x351222[_0x3a1a('0x43')]+_0x3a1a('0x75');}};}function checkIsIVRCampaignActive(_0x51d10e){return function(){if(!utils[_0x3a1a('0x78')](_0x51d10e)){_0x51d10e[_0x3a1a('0x63')]=utils[_0x3a1a('0x64')][_0x3a1a('0x79')];throw _0x51d10e['name']+_0x3a1a('0x7a');}};}function emitCampaignSummary(_0x4a6e00){if(utils[_0x3a1a('0x7b')](_0x4a6e00)){emit(util[_0x3a1a('0x7c')](_0x3a1a('0x7d'),_0x4a6e00[_0x3a1a('0x43')]),'campaign:save',_0x4a6e00);}}function loggerCatchQueueSummary(_0x23e360,_0x126cac){return function(_0xdf740f){clearPredictiveAttributes(_0x126cac);emitCampaignSummary(_0x126cac);loggerSyncQueueSummary['debug'](_0x23e360,util[_0x3a1a('0x41')](_0xdf740f,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x2beef4){if(_0x2beef4[_0x3a1a('0x7e')]){if(_0x2beef4[_0x3a1a('0x7f')]===0x0){_0x2beef4[_0x3a1a('0x7e')]=![];_0x2beef4[_0x3a1a('0x63')]=utils['CAMPAIGN_STATUS']['INACTIVE'];loggerSyncQueueSummary[_0x3a1a('0x3f')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x2beef4[_0x3a1a('0x43')],_0x3a1a('0x80'));}else{_0x2beef4[_0x3a1a('0x63')]=utils['CAMPAIGN_STATUS'][_0x3a1a('0x81')];loggerSyncQueueSummary[_0x3a1a('0x3f')](_0x3a1a('0x82'),_0x2beef4[_0x3a1a('0x43')],_0x3a1a('0x83'));}emitCampaignSummary(_0x2beef4);}}function myreject(_0x2874a6){return function(_0x12c7f4){return _0x2874a6(msgResponse(_0x3a1a('0x84'),'Error',JSON['stringify'](_0x12c7f4)));};}Dialer[_0x3a1a('0x17')][_0x3a1a('0x85')]=function(_0x35720f){return!_['isUndefined'](_0x35720f)&&_0x35720f&&!_['isUndefined'](_0x35720f['name'])&&!_[_0x3a1a('0x4f')](_0x35720f['active'])&&_0x35720f[_0x3a1a('0x86')]&&(this[_0x3a1a('0x20')][util[_0x3a1a('0x7c')](_0x3a1a('0x87'),_0x35720f[_0x3a1a('0x43')])]['status']===_0x3a1a('0x88')||this['trunks'][util[_0x3a1a('0x7c')](_0x3a1a('0x87'),_0x35720f[_0x3a1a('0x43')])]['status']===_0x3a1a('0x89'));};Dialer['prototype'][_0x3a1a('0x8a')]=function(_0x1749f4){var _0x5219af=this;return function(){if(!_0x5219af[_0x3a1a('0x85')](_0x1749f4[_0x3a1a('0x8b')])){if(!_0x5219af[_0x3a1a('0x85')](_0x1749f4[_0x3a1a('0x8c')])){_0x1749f4[_0x3a1a('0x63')]=utils[_0x3a1a('0x64')][_0x3a1a('0x8d')];throw _0x1749f4[_0x3a1a('0x43')]+_0x3a1a('0x8e');}}};};Dialer[_0x3a1a('0x17')][_0x3a1a('0x8f')]=function(_0x35808e,_0x537b0e,_0x2451ab,_0x1eeee1){var _0x1c0b7e=this;return function(){var _0xf3dc14=!![];return _0x1c0b7e['ifTimeIvr'](_0x35808e,_0x537b0e,_0x2451ab,_0x1eeee1,_0xf3dc14);};};Dialer[_0x3a1a('0x17')][_0x3a1a('0x90')]=function(_0x3cb472,_0x4cd39d,_0x9e3069,_0x259c47){var _0x4090ad=this;return function(){var _0x510fc0=![];return _0x4090ad['ifTimeIvr'](_0x3cb472[_0x3a1a('0x76')],_0x4cd39d,_0x9e3069,_0x259c47,_0x510fc0);};};Dialer[_0x3a1a('0x17')][_0x3a1a('0x91')]=function(_0x238b38,_0x48d607,_0x463d9b,_0x2e498a,_0xb7ba9){var _0x1eab50=[];return new Promise(function(_0x4ed112,_0x2398d8){if(!isNotNull(_0x238b38)){_0x2e498a[_0x3a1a('0x63')]=utils[_0x3a1a('0x64')][_0x3a1a('0x74')];return _0x2398d8(msgResponse(_0x3a1a('0x92'),_0x3a1a('0x93'),_0x463d9b+_0x3a1a('0x94')));}if(_['isEmpty'](_0x238b38)){_0x2e498a[_0x3a1a('0x63')]=utils[_0x3a1a('0x64')][_0x3a1a('0x95')];return _0x2398d8(msgResponse('ifTime',_0x3a1a('0x93'),_0x463d9b+_0x3a1a('0x96')));}if(_0x48d607&&_['isUndefined'](config[_0x3a1a('0x97')][_0x48d607])){_0x2e498a[_0x3a1a('0x63')]=utils[_0x3a1a('0x64')][_0x3a1a('0x98')];return _0x2398d8(msgResponse(_0x3a1a('0x92'),_0x3a1a('0x93'),_0x463d9b+_0x3a1a('0x99')+_0x48d607));}if(_[_0x3a1a('0x9a')](_0x238b38)){for(var _0x2072d6=0x0;_0x2072d6<_0x238b38[_0x3a1a('0x9b')];_0x2072d6+=0x1){_0x1eab50[_0x3a1a('0x9c')](ami[_0x3a1a('0x9d')]({'action':'command','command':util[_0x3a1a('0x7c')](_0x3a1a('0x9e'),_0x238b38[_0x2072d6][_0x3a1a('0x9f')],!_[_0x3a1a('0x4f')](config['timezones'][_0x48d607])?_0x48d607:'')})[_0x3a1a('0x3d')](function(_0x535d66){return _0x535d66[_0x3a1a('0xa0')]['indexOf'](_0x3a1a('0xa1'))>=0x0;})[_0x3a1a('0xa2')](myreject(_0x2398d8)));}}else{_0x1eab50[_0x3a1a('0x9c')](ami[_0x3a1a('0x9d')]({'action':_0x3a1a('0xa3'),'command':util[_0x3a1a('0x7c')](_0x3a1a('0x9e'),_0x238b38,!_['isUndefined'](config[_0x3a1a('0x97')][_0x48d607])?_0x48d607:'')})['then'](function(_0x21243d){return _0x21243d[_0x3a1a('0xa0')][_0x3a1a('0xa4')]('true')>=0x0;})[_0x3a1a('0xa2')](myreject(_0x2398d8)));}Promise[_0x3a1a('0xa5')](_0x1eab50)[_0x3a1a('0x3d')](function(_0x34cefb){var _0x44bacf=_[_0x3a1a('0xa6')](_0x34cefb);if(_0x44bacf){return _0x4ed112(_0x44bacf);}else{_0x2e498a[_0x3a1a('0x63')]=_0xb7ba9?utils[_0x3a1a('0x64')][_0x3a1a('0xa7')]:utils['CAMPAIGN_STATUS'][_0x3a1a('0xa8')];return _0x2398d8(msgResponse('[ifTime][promiseAll]',_0x3a1a('0x93'),_0x3a1a('0xa9')+_0xb7ba9+'\x20'+_0x463d9b+_0x3a1a('0xaa')+util[_0x3a1a('0x41')](_0x238b38,{'showHidden':![],'depth':null})+_0x3a1a('0xab')+_0x48d607));}})[_0x3a1a('0xa2')](function(_0x35fc03){return _0x2398d8(msgResponse(_0x3a1a('0x92'),_0x3a1a('0x93'),JSON[_0x3a1a('0x71')](_0x35fc03)));});});};Dialer[_0x3a1a('0x17')][_0x3a1a('0xac')]=function(){var _0x439197=this;return cmHopper[_0x3a1a('0xad')]({'active':![]},{'where':{'active':!![]}})[_0x3a1a('0x3d')](function(){setInterval(function(){_0x439197[_0x3a1a('0xae')]();},0x3e8);});};Dialer[_0x3a1a('0x17')]['syncCampaigns']=function(){var _0x28122e=this;var _0x574ae5;for(var _0x4cff70 in this[_0x3a1a('0x1e')]){if(typeof this[_0x3a1a('0x1e')][_0x4cff70]!==_0x3a1a('0xaf')){_0x574ae5=this[_0x3a1a('0x1e')][_0x4cff70];if(utils[_0x3a1a('0x7b')](_0x574ae5)&&utils['isIVRCampaignActive'](_0x574ae5)){_0x574ae5['sendMessageOneNotActive']=!![];Promise[_0x3a1a('0xb0')]()[_0x3a1a('0x3d')](checkIsIVRCampaignActive(_0x574ae5))['then'](checkInterval(_0x574ae5))['then'](_0x28122e[_0x3a1a('0x8a')](_0x574ae5))[_0x3a1a('0x3d')](_0x28122e[_0x3a1a('0x8f')](_0x574ae5[_0x3a1a('0xb1')],_0x574ae5[_0x3a1a('0xb2')],_0x574ae5[_0x3a1a('0x43')],_0x574ae5))['then'](_0x28122e[_0x3a1a('0x90')](_0x574ae5['Interval'],_0x574ae5[_0x3a1a('0xb2')],_0x574ae5['name'],_0x574ae5))[_0x3a1a('0x3d')](_0x28122e[_0x3a1a('0xb3')](_0x574ae5))[_0x3a1a('0xa2')](loggerCatchQueueSummary(_0x3a1a('0xb4'),_0x574ae5));}else{notSendMessagesCampaign(_0x574ae5);}}}};Dialer[_0x3a1a('0x17')][_0x3a1a('0xb5')]=function(_0x1cb731){if(_0x1cb731[_0x3a1a('0xb6')]!==_0x3a1a('0x8')){clearPredictiveAttributes(_0x1cb731);}switch(_0x1cb731[_0x3a1a('0xb6')]){case _0x3a1a('0xb7'):this[_0x3a1a('0xb8')](_0x1cb731,0x1);break;case _0x3a1a('0xb9'):this['handlePower'](_0x1cb731,_0x1cb731[_0x3a1a('0xba')]);break;case _0x3a1a('0x8'):this['predictive'](_0x1cb731);break;case _0x3a1a('0x7'):this['handlePower'](_0x1cb731,0x1);break;default:logger[_0x3a1a('0x5f')](_0x3a1a('0xbb'),_0x1cb731[_0x3a1a('0x43')],_0x3a1a('0xbc'));}};Dialer[_0x3a1a('0x17')][_0x3a1a('0x92')]=function(_0x17a9d7,_0x2e7520){var _0xedff77=_0x17a9d7[_0x3a1a('0xb2')];var _0x522575=_0x2e7520?_0x17a9d7[_0x3a1a('0xb1')]:_0x17a9d7[_0x3a1a('0x73')][_0x3a1a('0x76')];logger[_0x3a1a('0xbd')](_0x3a1a('0xbe'),_0x522575,_0xedff77,_0x17a9d7[_0x3a1a('0x43')],util[_0x3a1a('0x7c')](_0x3a1a('0xbf'),_0x17a9d7[_0x3a1a('0x43')],_0x17a9d7['id']));var _0x5b3364=null;return Interval[_0x3a1a('0xc0')](_0x522575,_0xedff77)[_0x3a1a('0x3d')](function(_0x2991be){if(_0x2991be===!![]){return _0x2991be;}else{_0x17a9d7[_0x3a1a('0x63')]=_0x2e7520?utils[_0x3a1a('0x64')][_0x3a1a('0xa7')]:utils[_0x3a1a('0x64')][_0x3a1a('0xa8')];_0x5b3364=msgResponse(_0x3a1a('0xc1'),_0x3a1a('0x93'),_0x3a1a('0xa9')+_0x2e7520+'\x20'+_0x17a9d7[_0x3a1a('0x43')]+_0x3a1a('0xaa')+util[_0x3a1a('0x41')](_0x522575,{'showHidden':![],'depth':null})+_0x3a1a('0xab')+_0xedff77);}if(_0x5b3364!==null){logger[_0x3a1a('0xbd')](_0x3a1a('0xc2'),_0x5b3364);_0x5b3364['isGlobal']=_0x2e7520;throw _0x5b3364;}})[_0x3a1a('0xa2')](function(_0x1d5b4d){logger[_0x3a1a('0x5f')](_0x3a1a('0xc3'),_0x1d5b4d);throw msgResponse('[ifTime][Action]',_0x3a1a('0xc4'),util[_0x3a1a('0x41')](_0x1d5b4d,{'showHidden':![],'depth':null}));});};Dialer[_0x3a1a('0x17')][_0x3a1a('0x2d')]=function(_0x3587d0){if(this[_0x3a1a('0x1d')][_0x3587d0[_0x3a1a('0xc5')]]){if(this[_0x3a1a('0xc6')][_0x3587d0[_0x3a1a('0xc7')]]&&this[_0x3a1a('0xc6')][_0x3587d0['uniqueid']][_0x3a1a('0xc8')]!==_0x3a1a('0xc9')){this['updateOriginated'](this[_0x3a1a('0x1d')][_0x3587d0[_0x3a1a('0xc5')]]);this[_0x3a1a('0xc6')][_0x3587d0[_0x3a1a('0xc7')]][_0x3a1a('0xca')]=moment()[_0x3a1a('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0x3a1a('0x17')]['syncAgentComplete']=function(_0x1d9676){var _0x3479e5=this['uniqueId'][_0x1d9676['uniqueid']];if(this[_0x3a1a('0x1d')][_0x1d9676[_0x3a1a('0xc5')]]){if(_0x3479e5&&_0x3479e5[_0x3a1a('0xc8')]!==_0x3a1a('0xc9')){delete this[_0x3a1a('0xc6')][_0x1d9676[_0x3a1a('0xc7')]];this[_0x3a1a('0x1d')][_0x1d9676[_0x3a1a('0xc5')]][_0x3a1a('0xcb')]+=0x1;var _0x1c7f55=new AgentComplete(_0x3479e5,_0x1d9676);if(_0x1d9676[_0x3a1a('0xcc')]==='agent'){_0x1c7f55['agiafterat']=this[_0x3a1a('0x1d')][_0x1d9676[_0x3a1a('0xc5')]][_0x3a1a('0xcd')]&&this[_0x3a1a('0x1d')][_0x1d9676['queue']][_0x3a1a('0xce')]?moment()['format'](_0x3a1a('0xcf')):undefined;}hopperUtils[_0x3a1a('0xd0')](_0x1c7f55)[_0x3a1a('0xa2')](loggerCatch(_0x3a1a('0xd1')));hopperUtils[_0x3a1a('0xd2')](_0x1c7f55)[_0x3a1a('0xa2')](loggerCatch(_0x3a1a('0xd3')));}}};Dialer[_0x3a1a('0x17')][_0x3a1a('0xd4')]=function(_0x8bc1aa){var _0x23ae4d=this[_0x3a1a('0xc6')][_0x8bc1aa[_0x3a1a('0xc7')]];var _0x1d4eed=this;var _0x5f2ff2=![];var _0x447529;var _0x2d83f7;if(this[_0x3a1a('0x1d')][_0x8bc1aa[_0x3a1a('0xc5')]]){if(_0x23ae4d&&_0x23ae4d[_0x3a1a('0xc8')]!==_0x3a1a('0xc9')){delete this[_0x3a1a('0xc6')][_0x8bc1aa['uniqueid']];this[_0x3a1a('0xd5')](this[_0x3a1a('0x1d')][_0x8bc1aa[_0x3a1a('0xc5')]]);_0x23ae4d[_0x3a1a('0xd6')]=moment()['format'](_0x3a1a('0xcf'));var _0x13c4f1=new QueueCallerAbandon(_0x23ae4d,_0x8bc1aa);if(utils[_0x3a1a('0x5c')](_0x23ae4d[_0x3a1a('0xd6')],_0x23ae4d[_0x3a1a('0xd7')])>=_0x23ae4d[_0x3a1a('0xd8')]){this['voiceQueues'][_0x8bc1aa[_0x3a1a('0xc5')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x3a1a('0x1d')][_0x8bc1aa[_0x3a1a('0xc5')]][_0x3a1a('0xd9')]+=0x1;this[_0x3a1a('0x1d')][_0x8bc1aa[_0x3a1a('0xc5')]][_0x3a1a('0xda')]+=0x1;_0x13c4f1[_0x3a1a('0xdb')]=0xa;_0x13c4f1['statedesc']=_0x3a1a('0xdc');_0x13c4f1['dropreason']=_0x3a1a('0xdd');_0x13c4f1[_0x3a1a('0xde')]=this[_0x3a1a('0x1d')][_0x8bc1aa['queue']]['dialQueueProject2']?moment()[_0x3a1a('0x7c')](_0x3a1a('0xcf')):undefined;_0x13c4f1[_0x3a1a('0xdf')]+=0x1;_0x13c4f1[_0x3a1a('0xe0')]+=0x1;_0x447529=this['voiceQueues'][_0x8bc1aa[_0x3a1a('0xc5')]][_0x3a1a('0xe1')];_0x2d83f7=this[_0x3a1a('0x1d')][_0x8bc1aa['queue']][_0x3a1a('0xe2')];hopperUtils[_0x3a1a('0xe3')](_0x13c4f1,_0x13c4f1['state'],_0x23ae4d[_0x3a1a('0xe4')])[_0x3a1a('0x3d')](function(_0x4cdd45){_0x5f2ff2=_0x4cdd45[_0x3a1a('0xe5')]==0x1;if(_0x13c4f1[_0x3a1a('0xdf')]>=_0x1d4eed['voiceQueues'][_0x8bc1aa[_0x3a1a('0xc5')]][_0x3a1a('0xe6')]){_0x1d4eed[_0x3a1a('0xe7')](_0x13c4f1,_0x4cdd45[_0x3a1a('0xe5')]);}else{hopperUtils[_0x3a1a('0xe8')]({'active':![],'countdropretry':_0x13c4f1[_0x3a1a('0xdf')],'scheduledat':moment()['add'](_0x1d4eed[_0x3a1a('0x1d')][_0x8bc1aa[_0x3a1a('0xc5')]][_0x3a1a('0xe1')],'minutes')[_0x3a1a('0x7c')](_0x3a1a('0xcf')),'ContactId':_0x23ae4d[_0x3a1a('0xe9')],'ListId':_0x23ae4d[_0x3a1a('0xea')],'VoiceQueueId':_0x23ae4d[_0x3a1a('0xeb')]||undefined,'CampaignId':_0x23ae4d[_0x3a1a('0xec')]||undefined})[_0x3a1a('0xa2')](loggerCatch(_0x3a1a('0xed')));var _0x42f87e=new History(_0x13c4f1);_0x42f87e[_0x3a1a('0xdb')]=0xa;_0x42f87e[_0x3a1a('0x6b')]=_0x3a1a('0xdc');_0x42f87e[_0x3a1a('0x6d')]=moment()[_0x3a1a('0x7c')](_0x3a1a('0xcf'));_0x42f87e['endtime']=_0x42f87e[_0x3a1a('0x6d')];_0x42f87e[_0x3a1a('0xee')]=_0x13c4f1[_0x3a1a('0xee')];_0x42f87e[_0x3a1a('0xef')]=_0x13c4f1['calleridnum'];hopperUtils['createHistory'](_0x42f87e)[_0x3a1a('0xa2')](loggerCatch(_0x3a1a('0xf0')));}})[_0x3a1a('0x3d')](function(){if(_0x5f2ff2)hopperUtils['swapAdditionalPhones'](_0x13c4f1,_0x447529,_0x2d83f7)[_0x3a1a('0x3d')](function(){return 0x1;});});}else{this[_0x3a1a('0x1d')][_0x8bc1aa[_0x3a1a('0xc5')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x3a1a('0x1d')][_0x8bc1aa[_0x3a1a('0xc5')]][_0x3a1a('0xf1')]+=0x1;_0x13c4f1[_0x3a1a('0xdb')]=0xb;_0x13c4f1['statedesc']=_0x3a1a('0xf2');_0x13c4f1['dropreason']=_0x3a1a('0xf3');_0x13c4f1[_0x3a1a('0xf4')]+=0x1;_0x13c4f1[_0x3a1a('0xe0')]+=0x1;_0x447529=this[_0x3a1a('0x1d')][_0x8bc1aa['queue']]['dialAbandonedRetryFrequency'];_0x2d83f7=this['voiceQueues'][_0x8bc1aa['queue']][_0x3a1a('0xe2')];hopperUtils['verifyAdditionalPhones'](_0x13c4f1,_0x13c4f1[_0x3a1a('0xdb')],_0x23ae4d['voiceQueue'])[_0x3a1a('0x3d')](function(_0x19b871){if(_0x13c4f1[_0x3a1a('0xf4')]>=_0x1d4eed[_0x3a1a('0x1d')][_0x8bc1aa[_0x3a1a('0xc5')]][_0x3a1a('0xf5')]){_0x1d4eed[_0x3a1a('0xe7')](_0x13c4f1,_0x19b871[_0x3a1a('0xe5')]);}else{hopperUtils[_0x3a1a('0xe8')]({'active':![],'countabandonedretry':_0x13c4f1['countabandonedretry'],'scheduledat':moment()[_0x3a1a('0xf6')](_0x1d4eed[_0x3a1a('0x1d')][_0x8bc1aa['queue']]['dialAbandonedRetryFrequency'],_0x3a1a('0xf7'))[_0x3a1a('0x7c')](_0x3a1a('0xcf')),'ContactId':_0x23ae4d[_0x3a1a('0xe9')],'ListId':_0x23ae4d[_0x3a1a('0xea')],'VoiceQueueId':_0x23ae4d[_0x3a1a('0xeb')]||undefined,'CampaignId':_0x23ae4d[_0x3a1a('0xec')]||undefined})[_0x3a1a('0xa2')](loggerCatch(_0x3a1a('0xf8')));var _0x4482da=new History(_0x13c4f1);_0x4482da[_0x3a1a('0xdb')]=0xb;_0x4482da[_0x3a1a('0x6b')]=_0x3a1a('0xf2');_0x4482da['starttime']=moment()['format'](_0x3a1a('0xcf'));_0x4482da[_0x3a1a('0x6c')]=_0x4482da[_0x3a1a('0x6d')];_0x4482da[_0x3a1a('0xee')]=_0x13c4f1[_0x3a1a('0xee')];_0x4482da[_0x3a1a('0xef')]=_0x13c4f1[_0x3a1a('0xef')];hopperUtils['createHistory'](_0x4482da)['catch'](loggerCatch(_0x3a1a('0xf9')));}})[_0x3a1a('0x3d')](function(){if(_0x5f2ff2)hopperUtils[_0x3a1a('0xfa')](_0x13c4f1,_0x447529,_0x2d83f7)[_0x3a1a('0x3d')](function(){return 0x1;});});}}}};Dialer[_0x3a1a('0x17')]['syncNewExten']=function(_0x995ead){if(this[_0x3a1a('0x23')][_0x995ead[_0x3a1a('0xc7')]]){this[_0x3a1a('0x23')][_0x995ead[_0x3a1a('0xc7')]][_0x3a1a('0xfb')]=_0x995ead[_0x3a1a('0xfb')];}if(this[_0x3a1a('0xc6')][_0x995ead[_0x3a1a('0xc7')]]){this[_0x3a1a('0xc6')][_0x995ead[_0x3a1a('0xc7')]][_0x3a1a('0xfb')]=_0x995ead[_0x3a1a('0xfb')];}};Dialer['prototype'][_0x3a1a('0x3a')]=function(_0x224268){if(!this[_0x3a1a('0x23')][_0x224268[_0x3a1a('0xfc')]]){return;}var _0x251ade=this[_0x3a1a('0x1d')][this[_0x3a1a('0x23')][_0x224268[_0x3a1a('0xfc')]]['queue']][_0x3a1a('0xfd')]||_0x3a1a('0xfe');if(_0x251ade===_0x3a1a('0xff')){if(this['actions'][_0x224268[_0x3a1a('0xfc')]]&&_[_0x3a1a('0x100')](this['actions'][_0x224268[_0x3a1a('0xfc')]][_0x3a1a('0x101')])&&_0x224268['status']==='1'&&_0x224268[_0x3a1a('0x102')]==='0'){if(this[_0x3a1a('0x1f')][_0x224268[_0x3a1a('0x103')]]){if(!this[_0x3a1a('0x1f')][_0x224268[_0x3a1a('0x103')]][_0x3a1a('0x101')]){this[_0x3a1a('0x1f')][_0x224268[_0x3a1a('0x103')]]['locked']=!![];this[_0x3a1a('0x23')][_0x224268[_0x3a1a('0xfc')]][_0x3a1a('0x101')]=!![];this[_0x3a1a('0x23')][_0x224268[_0x3a1a('0xfc')]]['stateinterface']=_0x224268[_0x3a1a('0x103')];}}}}else if(_0x251ade==='rrmemory'){if(this[_0x3a1a('0x23')][_0x224268[_0x3a1a('0xfc')]]){if(this[_0x3a1a('0x1f')][_0x224268['stateinterface']]){this[_0x3a1a('0x23')][_0x224268['actionid']][_0x3a1a('0x103')]=_0x224268[_0x3a1a('0x103')];if(_[_0x3a1a('0x100')](this[_0x3a1a('0x29')][this['actions'][_0x224268[_0x3a1a('0xfc')]][_0x3a1a('0xc5')]])){this[_0x3a1a('0x29')][this[_0x3a1a('0x23')][_0x224268[_0x3a1a('0xfc')]]['queue']]=[];}this['queueBooked'][this[_0x3a1a('0x23')][_0x224268[_0x3a1a('0xfc')]][_0x3a1a('0xc5')]][_0x3a1a('0x9c')](_[_0x3a1a('0x5b')](_[_0x3a1a('0x72')](this[_0x3a1a('0x23')][_0x224268[_0x3a1a('0xfc')]],[_0x3a1a('0x104'),'stateinterface']),{'status':_0x224268[_0x3a1a('0x105')],'paused':_0x224268[_0x3a1a('0x102')]}));}}}};Dialer[_0x3a1a('0x17')][_0x3a1a('0x3b')]=function(_0x541402){if(!this['actions'][_0x541402[_0x3a1a('0xfc')]]){return;}var _0x4de08b=this;var _0x4c1c56=this[_0x3a1a('0x1d')][this[_0x3a1a('0x23')][_0x541402[_0x3a1a('0xfc')]]['queue']];var _0x224694=_0x4c1c56[_0x3a1a('0xfd')]||_0x3a1a('0xfe');if(_0x224694===_0x3a1a('0xff')){if(this[_0x3a1a('0x23')][_0x541402['actionid']]&&this['actions'][_0x541402[_0x3a1a('0xfc')]][_0x3a1a('0x103')]){this[_0x3a1a('0x1c')]['run'](this[_0x3a1a('0x23')][_0x541402[_0x3a1a('0xfc')]][_0x3a1a('0x104')],this[_0x3a1a('0x23')][_0x541402['actionid']][_0x3a1a('0x103')])[_0x3a1a('0xa2')](function(_0xc893e){logger[_0x3a1a('0x5f')](_0x3a1a('0x106'),util[_0x3a1a('0x41')](_0xc893e,{'showHidden':![],'depth':null}));})[_0x3a1a('0x1a')](function(){_0x4de08b['updateOriginated'](_0x4de08b[_0x3a1a('0x1d')][_0x4de08b[_0x3a1a('0x23')][_0x541402[_0x3a1a('0xfc')]][_0x3a1a('0xc5')]]);_0x4de08b[_0x3a1a('0x1f')][_0x4de08b['actions'][_0x541402[_0x3a1a('0xfc')]][_0x3a1a('0x103')]]['locked']=![];delete _0x4de08b[_0x3a1a('0x23')][_0x541402[_0x3a1a('0xfc')]];unlockQueueStatus(_0x4c1c56);});}else{this['updateOriginated'](this[_0x3a1a('0x1d')][this['actions'][_0x541402['actionid']][_0x3a1a('0xc5')]]);hopperUtils[_0x3a1a('0xe8')]({'active':![],'ContactId':this[_0x3a1a('0x23')][_0x541402['actionid']][_0x3a1a('0xe9')],'ListId':this['actions'][_0x541402[_0x3a1a('0xfc')]]['ListId'],'VoiceQueueId':this[_0x3a1a('0x23')][_0x541402[_0x3a1a('0xfc')]][_0x3a1a('0xeb')]||undefined,'CampaignId':this[_0x3a1a('0x23')][_0x541402[_0x3a1a('0xfc')]][_0x3a1a('0xec')]||undefined})['catch'](loggerCatch(_0x3a1a('0x107')));delete this[_0x3a1a('0x23')][_0x541402[_0x3a1a('0xfc')]];unlockQueueStatus(_0x4c1c56);}}else if(_0x224694===_0x3a1a('0xfe')){var _0x15c789;if(this['actions'][_0x541402[_0x3a1a('0xfc')]]&&!_['isEmpty'](this[_0x3a1a('0x29')][this[_0x3a1a('0x23')][_0x541402[_0x3a1a('0xfc')]]['queue']])){if(this[_0x3a1a('0x2a')][_0x4de08b['actions'][_0x541402['actionid']][_0x3a1a('0xc5')]]){this[_0x3a1a('0x2a')][_0x4de08b['actions'][_0x541402[_0x3a1a('0xfc')]][_0x3a1a('0xc5')]]=this['queueBookedRR'][this[_0x3a1a('0x23')][_0x541402[_0x3a1a('0xfc')]]['queue']]?this[_0x3a1a('0x2a')][this[_0x3a1a('0x23')][_0x541402[_0x3a1a('0xfc')]]['queue']]:this[_0x3a1a('0x29')][this[_0x3a1a('0x23')][_0x541402[_0x3a1a('0xfc')]][_0x3a1a('0xc5')]]?this[_0x3a1a('0x29')][this[_0x3a1a('0x23')][_0x541402[_0x3a1a('0xfc')]][_0x3a1a('0xc5')]][_0x3a1a('0x108')]||0x0:0x0;}this[_0x3a1a('0x29')][this[_0x3a1a('0x23')][_0x541402['actionid']][_0x3a1a('0xc5')]][_0x3a1a('0x108')]=this[_0x3a1a('0x2a')][this[_0x3a1a('0x23')][_0x541402[_0x3a1a('0xfc')]]['queue']];for(var _0x171379=0x0;_0x171379=_0x160b44[_0x3a1a('0x12d')]){_0x32d820[_0x3a1a('0x12e')](_0x5dd125,_0x347649,_0x11800f,_0x3a1a('0x12f'));}else{if(_0x5dd125[_0x3a1a('0x12b')]>=_0x160b44[_0x3a1a('0x130')]){_0x32d820[_0x3a1a('0x131')](_0x5dd125,_0x347649,_0x11800f,_0x3a1a('0x132'));}else{hopperUtils[_0x3a1a('0xe8')]({'active':![],'countmachineretry':_0x5dd125[_0x3a1a('0x12b')],'scheduledat':moment()[_0x3a1a('0xf6')](_0x160b44['dialMachineRetryFrequency'],_0x3a1a('0xf7'))['format'](_0x3a1a('0xcf')),'ContactId':_0x5dd125[_0x3a1a('0xe9')],'ListId':_0x5dd125[_0x3a1a('0xea')],'VoiceQueueId':_0x5dd125[_0x3a1a('0xeb')]||undefined,'CampaignId':_0x5dd125[_0x3a1a('0xec')]||undefined})[_0x3a1a('0xa2')](loggerCatch(_0x3a1a('0x133')));_0x347649({'reschedule':0x1});}}});}if(_0x18a3f2[_0x3a1a('0xc8')]===_0x3a1a('0xc9')&&this['campaigns'][_0x18a3f2[_0x3a1a('0xc5')]][_0x3a1a('0x11a')]&&_0x4ec556[_0x3a1a('0x11b')]===_0x3a1a('0x134')){delete this[_0x3a1a('0xc6')][_0x4ec556[_0x3a1a('0xc7')]];this[_0x3a1a('0xd5')](this[_0x3a1a('0x1e')][_0x18a3f2['queue']]);_0x2be9e5=new Hangup(_0x18a3f2,_0x4ec556);_0x2be9e5['state']=0x12;_0x2be9e5['statedesc']=_0x3a1a('0x11d');_0x2be9e5[_0x3a1a('0x11e')]=_0x3a1a('0x126');ami[_0x3a1a('0x3e')](_0x3a1a('0x11f'),ut[_0x3a1a('0x120')](_0x2be9e5,_0x3a1a('0x127')));this[_0x3a1a('0x121')](_0x2be9e5,_0x3a1a('0x135'),_0x3a1a('0x136'));}if(_0x18a3f2[_0x3a1a('0xc8')]===_0x3a1a('0xc9')&&this['campaigns'][_0x18a3f2[_0x3a1a('0xc5')]]['dialAMDActive']&&_0x4ec556['value']===_0x3a1a('0x124')){return new Promise(function(_0x4efd1a,_0x4cf23d){delete _0x32d820[_0x3a1a('0xc6')][_0x4ec556[_0x3a1a('0xc7')]];_0x32d820[_0x3a1a('0xd5')](_0x32d820[_0x3a1a('0x1e')][_0x18a3f2[_0x3a1a('0xc5')]]);_0x32d820[_0x3a1a('0x1e')][_0x18a3f2[_0x3a1a('0xc5')]][_0x3a1a('0xcb')]+=0x1;_0x32d820[_0x3a1a('0x1e')][_0x18a3f2[_0x3a1a('0xc5')]][_0x3a1a('0x11c')]+=0x1;var _0x5988c9=_0x32d820[_0x3a1a('0x1e')][_0x18a3f2[_0x3a1a('0xc5')]];var _0x57ec19=new Hangup(_0x18a3f2,_0x4ec556);_0x57ec19[_0x3a1a('0xdb')]=0x13;_0x57ec19['statedesc']='Machine';_0x57ec19['membername']='AMD';_0x57ec19[_0x3a1a('0x12b')]+=0x1;_0x57ec19[_0x3a1a('0xe0')]+=0x1;_0x57ec19[_0x3a1a('0x127')]=!![];ami['emit'](_0x3a1a('0x11f'),ut[_0x3a1a('0x120')](_0x57ec19,_0x3a1a('0x127')));hopperUtils['createHistory'](_0x57ec19)['catch'](loggerCatch(_0x3a1a('0x137')));if(_0x57ec19[_0x3a1a('0x138')]+_0x57ec19[_0x3a1a('0x128')]+_0x57ec19[_0x3a1a('0x129')]+_0x57ec19[_0x3a1a('0x12a')]+_0x57ec19[_0x3a1a('0xdf')]+_0x57ec19[_0x3a1a('0xf4')]+_0x57ec19['countmachineretry']+_0x57ec19['countagentrejectretry']>=_0x5988c9[_0x3a1a('0x12d')]){_0x32d820[_0x3a1a('0x12e')](_0x57ec19,_0x4efd1a,_0x4cf23d,_0x3a1a('0x12f'));}else{if(_0x57ec19['countmachineretry']>=_0x5988c9['dialMachineMaxRetry']){_0x32d820[_0x3a1a('0x131')](_0x57ec19,_0x4efd1a,_0x4cf23d,_0x3a1a('0x132'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x57ec19[_0x3a1a('0x12b')],'scheduledat':moment()[_0x3a1a('0xf6')](_0x5988c9[_0x3a1a('0x139')],_0x3a1a('0xf7'))[_0x3a1a('0x7c')](_0x3a1a('0xcf')),'ContactId':_0x57ec19['ContactId'],'ListId':_0x57ec19[_0x3a1a('0xea')],'VoiceQueueId':_0x57ec19[_0x3a1a('0xeb')]||undefined,'CampaignId':_0x57ec19[_0x3a1a('0xec')]||undefined})[_0x3a1a('0xa2')](loggerCatch(_0x3a1a('0x133')));_0x4efd1a({'reschedule':0x1});}}});}}};Dialer['prototype'][_0x3a1a('0x36')]=function(_0x432591){var _0x54b08f=this[_0x3a1a('0xc6')][_0x432591[_0x3a1a('0xc7')]];var _0x43ed22;if(_0x54b08f&&_0x54b08f[_0x3a1a('0xc8')]===_0x3a1a('0xc9')){delete this['uniqueId'][_0x432591[_0x3a1a('0xc7')]];this[_0x3a1a('0xd5')](this[_0x3a1a('0x1e')][_0x54b08f[_0x3a1a('0xc5')]]);this[_0x3a1a('0x1e')][_0x54b08f['queue']][_0x3a1a('0x13a')]+=0x1;_0x43ed22=new Hangup(_0x54b08f,_0x432591);hopperUtils[_0x3a1a('0xd0')](_0x43ed22)['catch'](loggerCatch(_0x3a1a('0x13b')));hopperUtils['moveContactManagedDialer'](_0x43ed22)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x54b08f&&_0x54b08f[_0x3a1a('0xc8')]!==_0x3a1a('0xc9')&&isNotNull(this[_0x3a1a('0x1d')][_0x54b08f[_0x3a1a('0xc5')]][_0x3a1a('0x13c')])){delete this[_0x3a1a('0xc6')][_0x432591['uniqueid']];this['updateOriginated'](this[_0x3a1a('0x1d')][_0x54b08f['queue']]);this[_0x3a1a('0x1d')][_0x54b08f[_0x3a1a('0xc5')]]['outboundAnswerCallsDay']+=0x1;this[_0x3a1a('0x1d')][_0x54b08f[_0x3a1a('0xc5')]][_0x3a1a('0x11c')]+=0x1;_0x43ed22=new Hangup(_0x54b08f,_0x432591);_0x43ed22[_0x3a1a('0xdb')]=0x10;_0x43ed22[_0x3a1a('0x6b')]=_0x3a1a('0x13d');_0x43ed22[_0x3a1a('0x11e')]=_0x3a1a('0x13e');hopperUtils[_0x3a1a('0xd0')](_0x43ed22)[_0x3a1a('0xa2')](loggerCatch(_0x3a1a('0x13b')));hopperUtils[_0x3a1a('0xd2')](_0x43ed22)[_0x3a1a('0xa2')](loggerCatch(_0x3a1a('0x13f')));}if(_0x54b08f&&_0x54b08f['type']!==_0x3a1a('0xc9')&&!isNotNull(this[_0x3a1a('0x1d')][_0x54b08f[_0x3a1a('0xc5')]]['dialQueueProject'])){if(_0x432591[_0x3a1a('0x140')]===_0x3a1a('0x141')){delete this['uniqueId'][_0x432591[_0x3a1a('0xc7')]];this['voiceQueues'][_0x54b08f['queue']]['outboundAnswerCallsDay']+=0x1;const _0x1bf353=new AgentComplete(_0x54b08f,_0x432591);_0x1bf353['CampaignId']=this[_0x3a1a('0x1d')][_0x54b08f[_0x3a1a('0xc5')]]['id'];hopperUtils[_0x3a1a('0xd0')](_0x1bf353)[_0x3a1a('0xa2')](loggerCatch(_0x3a1a('0xd1')));hopperUtils[_0x3a1a('0xd2')](_0x1bf353)[_0x3a1a('0xa2')](loggerCatch(_0x3a1a('0xd3')));}else{delete this[_0x3a1a('0xc6')][_0x432591[_0x3a1a('0xc7')]];this[_0x3a1a('0xd5')](this[_0x3a1a('0x1d')][_0x54b08f[_0x3a1a('0xc5')]]);this[_0x3a1a('0x1d')][_0x54b08f['queue']][_0x3a1a('0x142')]+=0x1;_0x43ed22=new Hangup(_0x54b08f,_0x432591);_0x43ed22['state']=0xc;_0x43ed22[_0x3a1a('0x6b')]=_0x432591['cause-txt'];_0x43ed22[_0x3a1a('0x11e')]='Unknow';hopperUtils[_0x3a1a('0xd0')](_0x43ed22)[_0x3a1a('0xa2')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0x3a1a('0xd2')](_0x43ed22)[_0x3a1a('0xa2')](loggerCatch(_0x3a1a('0x13f')));}}};Dialer[_0x3a1a('0x17')][_0x3a1a('0x9')]=function(_0x167430){var _0x5589ef=this;if(!_0x5589ef['queuesSummary'][_0x167430['name']]){_0x5589ef[_0x3a1a('0x2b')][_0x167430[_0x3a1a('0x43')]]={'running':![]};}else if(_0x5589ef['queuesSummary'][_0x167430['name']]['running']===!![]){return;}else if(_0x5589ef[_0x3a1a('0x2b')][_0x167430[_0x3a1a('0x43')]][_0x3a1a('0x143')]===![]){_0x5589ef['queuesSummary'][_0x167430['name']][_0x3a1a('0x143')]=!![];}var _0x1b6d88=_0x5589ef[_0x3a1a('0x1d')][_0x167430[_0x3a1a('0x43')]];var _0x64d149=_0x1b6d88[_0x3a1a('0x63')]!==utils['CAMPAIGN_STATUS']['INACTIVE'];var _0x4a1304=utils['isPreviewCampaign'](_0x1b6d88);_0x1b6d88[_0x3a1a('0x144')]=utils[_0x3a1a('0x145')](_0x1b6d88,_0x5589ef[_0x3a1a('0x20')]);Promise[_0x3a1a('0xb0')]()[_0x3a1a('0x3d')](function(){if(_0x1b6d88[_0x3a1a('0x144')]===utils[_0x3a1a('0x64')][_0x3a1a('0x79')]){if(_0x64d149){clearPredictiveAttributes(_0x1b6d88);_0x167430[_0x3a1a('0x26')]=undefined;_0x167430[_0x3a1a('0x27')]=undefined;}if(_0x1b6d88['statusMessage']===utils['CAMPAIGN_STATUS'][_0x3a1a('0x79')]){_0x167430[_0x3a1a('0x146')]=0x0;_0x167430[_0x3a1a('0x102')]=0x0;_0x167430[_0x3a1a('0x147')]=0x0;_0x167430['talking']=0x0;_0x167430[_0x3a1a('0x148')]=0x0;}}else if(_0x1b6d88[_0x3a1a('0x144')]===utils[_0x3a1a('0x64')][_0x3a1a('0x149')]&&!_0x4a1304){return _0x5589ef[_0x3a1a('0x92')](_0x1b6d88,!![])['then'](function(){return _0x5589ef[_0x3a1a('0x92')](_0x1b6d88,![]);})[_0x3a1a('0x3d')](function(){return _0x5589ef['checkDialMethod'](_0x1b6d88);})[_0x3a1a('0xa2')](function(_0x9c589){loggerSyncQueueSummary['debug']('[syncQueueSummary]',util[_0x3a1a('0x41')](_0x9c589,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x1b6d88);});}else{clearPredictiveAttributes(_0x1b6d88);}})[_0x3a1a('0x3d')](function(){var _0x292c3f=_0x167430['compareToOutboundQueue'](_0x1b6d88);if(_0x292c3f||_0x1b6d88[_0x3a1a('0x14a')]){_0x1b6d88['queueSummaryCountersUpdated']=![];_0x167430['updateReportFromOutboundQueue'](_0x1b6d88);Object[_0x3a1a('0x14b')](_0x1b6d88,_0x167430);emitOutboundVoiceQueueSummary(_0x167430);}_0x5589ef['queuesSummary'][_0x1b6d88[_0x3a1a('0x43')]]['running']=![];})[_0x3a1a('0xa2')](function(_0x292b21){logger[_0x3a1a('0x5f')]('[syncQueueSummary]',util[_0x3a1a('0x41')](_0x292b21,{'showHidden':![],'depth':null}));_0x5589ef[_0x3a1a('0x2b')][_0x1b6d88['name']][_0x3a1a('0x143')]=![];});};Dialer[_0x3a1a('0x17')][_0x3a1a('0x34')]=_['throttle'](function(){var _0x155b2f=_[_0x3a1a('0x14c')](this[_0x3a1a('0x1d')],function(_0x3a3091){return _0x3a3091[_0x3a1a('0x14d')];});var _0x88f094=_['filter'](this['agents'],function(_0x88d7e0){return _0x88d7e0[_0x3a1a('0x14e')]&&_0x88d7e0[_0x3a1a('0x105')]===_0x3a1a('0x88');});if(_0x155b2f[_0x3a1a('0x9b')]>0x0&&_0x88f094[_0x3a1a('0x9b')]>0x0){return Promise[_0x3a1a('0xb0')]()[_0x3a1a('0x3d')](cmHopper[_0x3a1a('0x14f')](_[_0x3a1a('0x150')](_0x155b2f,'id'),previewRecallmeReminderInterval,_[_0x3a1a('0x150')](_0x88f094,'id')))[_0x3a1a('0x3d')](function(_0x2fb004){for(var _0x1a3f88=0x0;_0x1a3f88<_0x2fb004['length'];_0x1a3f88++){var _0x4d0e98=_0x2fb004[_0x1a3f88]['Agent'][_0x3a1a('0x43')];if(_0x4d0e98)io['to'](util[_0x3a1a('0x7c')](_0x3a1a('0x151'),_0x4d0e98))[_0x3a1a('0x3e')]('user:dialPreviewRecallReminder',{'hopper':_0x2fb004[_0x1a3f88]});}})[_0x3a1a('0xa2')](function(_0x4c5bb1){logger[_0x3a1a('0x5f')](_0x3a1a('0x152'),_0x4c5bb1);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x3a1a('0x17')]['loopClearZombieChannels']=function(){var _0x5d99e8=this;setInterval(function(){_0x5d99e8[_0x3a1a('0x153')](_0x5d99e8[_0x3a1a('0xc6')],_0x3a1a('0x154'));_0x5d99e8[_0x3a1a('0x153')](_0x5d99e8['actions'],_0x3a1a('0x155'));},0x32c8);};Dialer[_0x3a1a('0x17')]['clearZombieChannels']=function(_0x6eb41d,_0x5f453c){var _0x20c452=this;for(var _0x872fdb in _0x6eb41d){if(typeof _0x6eb41d[_0x872fdb]!==_0x3a1a('0xaf')){this[_0x3a1a('0x1b')]['enqueue'](function(){if(!_[_0x3a1a('0x100')](_0x6eb41d[_0x872fdb])){return ami[_0x3a1a('0x9d')]({'action':_0x3a1a('0x105'),'channel':_0x6eb41d[_0x872fdb][_0x3a1a('0xfb')]})[_0x3a1a('0xa2')](function(_0x86a296){if(_0x86a296['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x6eb41d[_0x872fdb]&&_0x6eb41d[_0x872fdb]['type']!==_0x3a1a('0xc9')){_0x20c452[_0x3a1a('0xd5')](_0x20c452[_0x3a1a('0x1d')][_0x6eb41d[_0x872fdb][_0x3a1a('0xc5')]]);logger['error'](_0x3a1a('0x156'),_0x5f453c,_0x872fdb,_0x6eb41d[_0x872fdb][_0x3a1a('0xc5')]);delete _0x6eb41d[_0x872fdb];}if(_0x6eb41d[_0x872fdb]&&_0x6eb41d[_0x872fdb][_0x3a1a('0xc8')]==='ivr'){_0x20c452[_0x3a1a('0xd5')](_0x20c452[_0x3a1a('0x1e')][_0x6eb41d[_0x872fdb][_0x3a1a('0xc5')]]);logger[_0x3a1a('0x5f')](_0x3a1a('0x157'),_0x5f453c,_0x872fdb,_0x6eb41d[_0x872fdb]['queue']);delete _0x6eb41d[_0x872fdb];}},0x2328);}});}});}}};Dialer['prototype'][_0x3a1a('0x158')]=function(_0xe10dfe){return Promise[_0x3a1a('0xb0')]()[_0x3a1a('0x3d')](voiceQueueRt[_0x3a1a('0x158')](_0xe10dfe))[_0x3a1a('0xa2')](loggerCatch(_0x3a1a('0x159')));};Dialer[_0x3a1a('0x17')][_0x3a1a('0xd5')]=function(_0x367d16){if(!_[_0x3a1a('0x4f')](_0x367d16)&&_0x367d16!==null){if(typeof _0x367d16[_0x3a1a('0x7f')]!==_0x3a1a('0xaf')){if(_0x367d16[_0x3a1a('0x7f')]>0x0){_0x367d16[_0x3a1a('0x7f')]-=0x1;}else{logger[_0x3a1a('0x5f')](_0x3a1a('0x15a'));}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer['prototype'][_0x3a1a('0x15b')]=function(_0x2d014e,_0x56d24f){var _0xf3e909=this;return function(_0x2b6e56){_0xf3e909[_0x3a1a('0xd5')](_0x56d24f);logger[_0x3a1a('0x5f')](_0x2d014e,util[_0x3a1a('0x41')](_0x2b6e56,{'showHidden':![],'depth':null}));};};Dialer[_0x3a1a('0x17')][_0x3a1a('0x15c')]=function(_0x1e0509,_0x4e545b,_0xe8453){var _0x2f9621={'state':0x19,'statedesc':_0x3a1a('0x15d')};this[_0x3a1a('0xd5')](_0x4e545b);this[_0x3a1a('0x121')](_['merge'](_0x2f9621,_[_0x3a1a('0x72')](_0xe8453,[_0x3a1a('0xe9'),_0x3a1a('0xea'),_0x3a1a('0x15e'),_0x3a1a('0xeb'),_0x3a1a('0xec')])),_0x3a1a('0x15f'),_0x3a1a('0x160'));logger[_0x3a1a('0x5f')](_0x1e0509);};Dialer[_0x3a1a('0x17')]['saveInDb']=function(_0x59fe0e,_0x58e222,_0x5bc81b){hopperUtils[_0x3a1a('0xd0')](_0x59fe0e)[_0x3a1a('0xa2')](loggerCatch(_0x58e222));hopperUtils[_0x3a1a('0xd2')](_0x59fe0e)[_0x3a1a('0xa2')](loggerCatch(_0x5bc81b));};Dialer[_0x3a1a('0x17')][_0x3a1a('0xe7')]=function(_0x3c0846,_0x52bcf7){hopperUtils[_0x3a1a('0xd0')](_0x3c0846)[_0x3a1a('0xa2')](loggerCatch(_0x3a1a('0xd1')));if(_0x52bcf7==0x0){hopperUtils[_0x3a1a('0xd2')](_0x3c0846)[_0x3a1a('0xa2')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer[_0x3a1a('0x17')][_0x3a1a('0x152')]=function(_0x7ed276){return Promise['resolve']()[_0x3a1a('0x3d')](cmHopper['handlePreviewRecallNotifications'](_0x7ed276['id'],previewRecallmeReminderInterval))[_0x3a1a('0x3d')](function(_0x2971ab){for(var _0x107298=0x0;_0x107298<_0x2971ab[_0x3a1a('0x9b')];_0x107298++){var _0x34b2da=_0x2971ab[_0x107298]['Agent']['name'];if(_0x34b2da)io['to'](util[_0x3a1a('0x7c')](_0x3a1a('0x151'),_0x34b2da))[_0x3a1a('0x3e')](_0x3a1a('0x161'),{'hopper':_0x2971ab[_0x107298]});}})[_0x3a1a('0xa2')](function(){});};Dialer[_0x3a1a('0x17')][_0x3a1a('0xb3')]=function(_0x3adc4f){var _0x4d0b29=this;return function(){_0x4d0b29['handleIvr'](_0x3adc4f);};};Dialer['prototype'][_0x3a1a('0x162')]=function(_0x33096b,_0x1bd8c8){var _0x1f67d8=this;var _0x396459=uuid['v4']();this[_0x3a1a('0x23')][_0x396459]=new Action(_0x33096b,_0x1bd8c8,_0x396459);return new Promise(function(_0x162b30,_0x5f5b99){if(_[_0x3a1a('0x4f')](_0x33096b)&&typeof _0x33096b!==_0x3a1a('0x163')){return _0x5f5b99(msgResponse('originate','Failure','voiceQueue\x20is\x20undefine'));}if(_[_0x3a1a('0x4f')](_0x1bd8c8[_0x3a1a('0x164')])||_0x1bd8c8['phone']===null){return _0x5f5b99(msgResponse(_0x3a1a('0x165'),_0x3a1a('0x93'),_0x3a1a('0x166')));}var _0x2bdbe5={'XMD-CALLERID':_0x1f67d8[_0x3a1a('0x23')][_0x396459]['getCaller'](),'XMD-AGI':_0x33096b[_0x3a1a('0x13c')]?util['format'](_0x3a1a('0x167'),ipAgi,_0x33096b[_0x3a1a('0x13c')]):_0x3a1a('0x168'),'XMD-AGIAFTER':_0x33096b[_0x3a1a('0xcd')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x33096b[_0x3a1a('0xcd')]):'NONE','XMD-QUEUE':utils[_0x3a1a('0x169')](_0x33096b)?util[_0x3a1a('0x7c')](_0x3a1a('0x16a'),_0x33096b[_0x3a1a('0x43')],_0x33096b['dialQueueOptions']||'',_0x33096b[_0x3a1a('0xce')]?'c':'',_0x33096b[_0x3a1a('0xd8')]||0x3):_0x3a1a('0x168'),'XMD-CONTACTID':_0x1bd8c8[_0x3a1a('0xe9')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x1f67d8[_0x3a1a('0x23')][_0x396459][_0x3a1a('0x16b')](),'XMD-AMD':_0x33096b[_0x3a1a('0x11a')]?'ACTIVE':_0x3a1a('0x168'),'XMD-DESTINATION':_0x3a1a('0x16c')};if(_0x33096b['dialAMDActive']){_0x2bdbe5[_0x3a1a('0x16d')]=_0x33096b['dialAMDInitialSilence']||0x9c4;_0x2bdbe5[_0x3a1a('0x16e')]=_0x33096b[_0x3a1a('0x16f')]||0x5dc;_0x2bdbe5[_0x3a1a('0x170')]=_0x33096b[_0x3a1a('0x171')]||0x320;_0x2bdbe5['XMD-AMDTOTALANALYSISTIME']=_0x33096b[_0x3a1a('0x172')]||0x1388;_0x2bdbe5[_0x3a1a('0x173')]=_0x33096b[_0x3a1a('0x174')]||0x64;_0x2bdbe5[_0x3a1a('0x175')]=_0x33096b['dialAMDBetweenWordsSilence']||0x32;_0x2bdbe5['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x33096b[_0x3a1a('0x176')]||0x3;_0x2bdbe5[_0x3a1a('0x177')]=_0x33096b[_0x3a1a('0x178')]||0x100;_0x2bdbe5[_0x3a1a('0x179')]=_0x33096b[_0x3a1a('0x17a')]||0x1388;}if(utils[_0x3a1a('0x169')](_0x33096b)){_0x2bdbe5[_0x3a1a('0x17b')]=_0x1bd8c8['VoiceQueueId'];}else{_0x2bdbe5[_0x3a1a('0x17c')]=_0x1bd8c8['CampaignId'];}var _0x19294e=utils[_0x3a1a('0x17d')](_0x1bd8c8[_0x3a1a('0x17e')]);Object[_0x3a1a('0x14b')](_0x2bdbe5,_0x19294e);var _0x4dc2ac=_0x1f67d8['isTrunkReachable'](_0x33096b[_0x3a1a('0x8b')])?utils[_0x3a1a('0x17f')](_0x33096b['Trunk'][_0x3a1a('0x180')],_0x33096b[_0x3a1a('0x181')],_0x33096b[_0x3a1a('0x182')]>0x0?utils['getCallerIdRandom'](_0x33096b[_0x3a1a('0x183')],_0x33096b['dialRandomLastDigitCallerIdNumber']):_0x33096b['dialOriginateCallerIdNumber']):utils[_0x3a1a('0x17f')](_['isNil'](_0x33096b['TrunkBackup'])?_0x33096b[_0x3a1a('0x8b')][_0x3a1a('0x180')]:_0x33096b[_0x3a1a('0x8c')][_0x3a1a('0x180')],_0x33096b[_0x3a1a('0x181')],_0x33096b[_0x3a1a('0x182')]>0x0?utils[_0x3a1a('0x184')](_0x33096b[_0x3a1a('0x183')],_0x33096b[_0x3a1a('0x182')]):_0x33096b[_0x3a1a('0x183')]);if(_0x4dc2ac){_0x2bdbe5['XMD-ORIGINATECALLERIDNAME']=_0x1f67d8['actions'][_0x396459][_0x3a1a('0x185')]=utils[_0x3a1a('0x186')](_0x4dc2ac);_0x2bdbe5[_0x3a1a('0x187')]=_0x1bd8c8['phone'];}_0x33096b[_0x3a1a('0x188')]=_0x2bdbe5;return ami[_0x3a1a('0x9d')]({'actionid':_0x396459,'action':_0x3a1a('0x165'),'channel':_0x1f67d8[_0x3a1a('0x85')](_0x33096b[_0x3a1a('0x8b')])?util[_0x3a1a('0x7c')](_0x3a1a('0x189'),_0x33096b[_0x3a1a('0x8b')][_0x3a1a('0x43')],isNotNull(_0x33096b['dialPrefix'])?_0x33096b[_0x3a1a('0x18a')][_0x3a1a('0x18b')]()||'':'',_0x33096b['dialCutDigit']>0x0?_0x1bd8c8[_0x3a1a('0x164')][_0x3a1a('0x18c')](_0x33096b[_0x3a1a('0x18d')]):_0x1bd8c8[_0x3a1a('0x164')]):util[_0x3a1a('0x7c')](_0x3a1a('0x189'),_[_0x3a1a('0x100')](_0x33096b[_0x3a1a('0x8c')])?_0x33096b[_0x3a1a('0x8b')][_0x3a1a('0x43')]:_0x33096b['TrunkBackup'][_0x3a1a('0x43')],isNotNull(_0x33096b[_0x3a1a('0x18a')])?_0x33096b['dialPrefix']['trim']()||'':'',_0x33096b['dialCutDigit']>0x0?_0x1bd8c8[_0x3a1a('0x164')][_0x3a1a('0x18c')](_0x33096b[_0x3a1a('0x18d')]):_0x1bd8c8[_0x3a1a('0x164')]),'callerid':_0x4dc2ac,'Exten':'xcally-motion-dialer','Context':_0x3a1a('0x18e'),'Priority':'1','variable':_0x2bdbe5,'timeout':(_0x33096b[_0x3a1a('0x18f')]||0x1e)*0x3e8,'async':!![],'channelid':_0x396459})[_0x3a1a('0x3d')](function(_0x5518be){return _0x162b30(_0x5518be);})[_0x3a1a('0xa2')](function(_0x12ecbb){_0x33096b[_0x3a1a('0x190')]+=0x1;var _0x307375=new History(_0x1f67d8[_0x3a1a('0x23')][_0x396459]);logger[_0x3a1a('0x5f')](util[_0x3a1a('0x7c')](_0x3a1a('0x191'),JSON[_0x3a1a('0x71')](_0x12ecbb)));_0x307375['state']=0xe;_0x307375[_0x3a1a('0x6b')]=_0x3a1a('0x192');_0x307375[_0x3a1a('0x6d')]=moment()[_0x3a1a('0x7c')](_0x3a1a('0xcf'));_0x307375[_0x3a1a('0x6c')]=_0x307375[_0x3a1a('0x6d')];hopperUtils[_0x3a1a('0xd0')](_0x307375)[_0x3a1a('0xa2')](loggerCatch('[originate][error]'));_0x1f67d8['moveContactManagedDialer'](_0x307375)[_0x3a1a('0xa2')](loggerCatch(_0x3a1a('0x193')))[_0x3a1a('0x1a')](function(){delete _0x1f67d8['actions'][_0x396459];return _0x5f5b99(msgResponse(_0x3a1a('0x165'),'Error',_0x3a1a('0x194')));});});});};Dialer[_0x3a1a('0x17')][_0x3a1a('0x195')]=function(_0x3f2eaa,_0x5da044,_0x33a782){var _0xfaace1=new History(_0x5da044);if(_0xfaace1[_0x3a1a('0x138')]+_0xfaace1[_0x3a1a('0x128')]+_0xfaace1[_0x3a1a('0x129')]+_0xfaace1[_0x3a1a('0x12a')]+_0xfaace1[_0x3a1a('0xdf')]+_0xfaace1[_0x3a1a('0xf4')]+_0xfaace1[_0x3a1a('0x12b')]+_0xfaace1[_0x3a1a('0x12c')]>=_0x33a782[_0x3a1a('0x12d')]-0x1){return!![];}switch(_0x3f2eaa){case 0x3:if(_0xfaace1['countnoanswerretry']>=_0x33a782['dialNoAnswerMaxRetry']-0x1){return!![];}hopperUtils[_0x3a1a('0xe8')]({'active':![],'countnoanswerretry':_0xfaace1[_0x3a1a('0x129')]+=0x1,'scheduledat':moment()[_0x3a1a('0xf6')](_0x33a782[_0x3a1a('0x196')],'minutes')[_0x3a1a('0x7c')](_0x3a1a('0xcf')),'ContactId':_0xfaace1[_0x3a1a('0xe9')],'ListId':_0xfaace1[_0x3a1a('0xea')],'VoiceQueueId':_0xfaace1[_0x3a1a('0xeb')]||undefined,'CampaignId':_0xfaace1[_0x3a1a('0xec')]||undefined})[_0x3a1a('0xa2')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0xfaace1[_0x3a1a('0x138')]>=_0x33a782[_0x3a1a('0x197')]-0x1){return!![];}hopperUtils[_0x3a1a('0xe8')]({'active':![],'countbusyretry':_0xfaace1[_0x3a1a('0x138')]+=0x1,'scheduledat':moment()[_0x3a1a('0xf6')](_0x33a782[_0x3a1a('0x198')],_0x3a1a('0xf7'))[_0x3a1a('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xfaace1[_0x3a1a('0xe9')],'ListId':_0xfaace1[_0x3a1a('0xea')],'VoiceQueueId':_0xfaace1[_0x3a1a('0xeb')]||undefined,'CampaignId':_0xfaace1['CampaignId']||undefined})[_0x3a1a('0xa2')](loggerCatch(_0x3a1a('0x199')));break;case 0x8:if(_0xfaace1[_0x3a1a('0x128')]>=_0x33a782[_0x3a1a('0x19a')]-0x1){return!![];}hopperUtils[_0x3a1a('0xe8')]({'active':![],'countcongestionretry':_0xfaace1[_0x3a1a('0x128')]+=0x1,'scheduledat':moment()['add'](_0x33a782[_0x3a1a('0x19b')],_0x3a1a('0xf7'))[_0x3a1a('0x7c')](_0x3a1a('0xcf')),'ContactId':_0xfaace1['ContactId'],'ListId':_0xfaace1['ListId'],'VoiceQueueId':_0xfaace1[_0x3a1a('0xeb')]||undefined,'CampaignId':_0xfaace1[_0x3a1a('0xec')]||undefined})[_0x3a1a('0xa2')](loggerCatch(_0x3a1a('0x19c')));break;case 0x0:if(_0xfaace1[_0x3a1a('0x12a')]>=_0x33a782[_0x3a1a('0x19d')]-0x1){return!![];}else{hopperUtils['rescheduleContact']({'active':![],'countnosuchnumberretry':_0xfaace1[_0x3a1a('0x12a')]+=0x1,'scheduledat':moment()[_0x3a1a('0xf6')](_0x33a782[_0x3a1a('0x19e')],_0x3a1a('0xf7'))['format'](_0x3a1a('0xcf')),'ContactId':_0xfaace1[_0x3a1a('0xe9')],'ListId':_0xfaace1[_0x3a1a('0xea')],'VoiceQueueId':_0xfaace1['VoiceQueueId']||undefined,'CampaignId':_0xfaace1[_0x3a1a('0xec')]||undefined})[_0x3a1a('0xa2')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0xfaace1[_0x3a1a('0xdf')]>=_0x33a782[_0x3a1a('0xe6')]-0x1){return!![];}hopperUtils[_0x3a1a('0xe8')]({'active':![],'countdropretry':_0xfaace1[_0x3a1a('0xdf')]+=0x1,'scheduledat':moment()[_0x3a1a('0xf6')](_0x33a782[_0x3a1a('0xe1')],_0x3a1a('0xf7'))[_0x3a1a('0x7c')](_0x3a1a('0xcf')),'ContactId':_0xfaace1[_0x3a1a('0xe9')],'ListId':_0xfaace1['ListId'],'VoiceQueueId':_0xfaace1[_0x3a1a('0xeb')]||undefined,'CampaignId':_0xfaace1[_0x3a1a('0xec')]||undefined})[_0x3a1a('0xa2')](loggerCatch(_0x3a1a('0xed')));break;case 0xb:if(_0xfaace1[_0x3a1a('0xf4')]>=_0x33a782['dialAbandonedMaxRetry']-0x1){return!![];}hopperUtils[_0x3a1a('0xe8')]({'active':![],'countabandonedretry':_0xfaace1[_0x3a1a('0xf4')]+=0x1,'scheduledat':moment()[_0x3a1a('0xf6')](_0x33a782[_0x3a1a('0x19f')],_0x3a1a('0xf7'))[_0x3a1a('0x7c')](_0x3a1a('0xcf')),'ContactId':_0xfaace1[_0x3a1a('0xe9')],'ListId':_0xfaace1['ListId'],'VoiceQueueId':_0xfaace1['VoiceQueueId']||undefined,'CampaignId':_0xfaace1[_0x3a1a('0xec')]||undefined})['catch'](loggerCatch(_0x3a1a('0xf8')));break;case 0x13:if(_0xfaace1[_0x3a1a('0x12b')]>=_0x33a782['dialMachineMaxRetry']-0x1){return!![];}hopperUtils[_0x3a1a('0xe8')]({'active':![],'countmachineretry':_0xfaace1[_0x3a1a('0x12b')]+=0x1,'scheduledat':moment()['add'](_0x33a782[_0x3a1a('0x139')],_0x3a1a('0xf7'))[_0x3a1a('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xfaace1[_0x3a1a('0xe9')],'ListId':_0xfaace1[_0x3a1a('0xea')],'VoiceQueueId':_0xfaace1[_0x3a1a('0xeb')]||undefined,'CampaignId':_0xfaace1[_0x3a1a('0xec')]||undefined})['catch'](loggerCatch(_0x3a1a('0x133')));break;case 0x14:if(_0xfaace1[_0x3a1a('0x12c')]>=_0x33a782['dialAgentRejectMaxRetry']-0x1){return!![];}hopperUtils[_0x3a1a('0xe8')]({'active':![],'countagentrejectretry':_0xfaace1[_0x3a1a('0x12c')]+=0x1,'scheduledat':moment()[_0x3a1a('0xf6')](_0x33a782[_0x3a1a('0x1a0')],_0x3a1a('0xf7'))[_0x3a1a('0x7c')](_0x3a1a('0xcf')),'ContactId':_0xfaace1['ContactId'],'ListId':_0xfaace1[_0x3a1a('0xea')],'VoiceQueueId':_0xfaace1[_0x3a1a('0xeb')]||undefined,'CampaignId':_0xfaace1[_0x3a1a('0xec')]||undefined})[_0x3a1a('0xa2')](loggerCatch(_0x3a1a('0x1a1')));break;default:return!![];}};Dialer[_0x3a1a('0x17')][_0x3a1a('0x114')]=function(_0x1f5ef9,_0x3b96b5,_0x336ed8){var _0x2a69df=this;var _0x5a26f3=new History(_0x1f5ef9);var _0x31160f=![];var _0x2c7843;var _0x40ac96;return new Promise(function(_0x3c92d4,_0x5cb9d1){if(_['isUndefined'](_0x3b96b5)&&typeof _0x3b96b5!==_0x3a1a('0x163')){return _0x5cb9d1(msgResponse('[callProgressDetecting]',_0x3a1a('0x93'),_0x3a1a('0x1a2')));}if(_[_0x3a1a('0x4f')](_0x336ed8)&&typeof _0x336ed8!==_0x3a1a('0x163')){return _0x5cb9d1(msgResponse(_0x3a1a('0x1a3'),'Failure',_0x3a1a('0x1a4')));}hopperUtils[_0x3a1a('0xe3')](_0x5a26f3,_0x336ed8[_0x3a1a('0xcc')],_0x3b96b5)['then'](function(_0x45f17b){if(_0x45f17b['additional']==0x1)_0x31160f=!![];switch(_0x336ed8['reason']){case'0':_0x3b96b5[_0x3a1a('0x1a5')]+=0x1;_0x5a26f3[_0x3a1a('0xdb')]=0x0;_0x5a26f3[_0x3a1a('0x6b')]=_0x3a1a('0x1a6');_0x5a26f3[_0x3a1a('0x12a')]+=0x1;_0x5a26f3['countglobal']+=0x1;ami[_0x3a1a('0x3e')]('custom:agentnosuchnumber',ut['buildObj'](_0x1f5ef9,_0x3a1a('0x1a7')));_0x2c7843=_0x3b96b5['dialNoSuchNumberRetryFrequency'];_0x40ac96=_0x3b96b5[_0x3a1a('0xe2')];hopperUtils[_0x3a1a('0xd0')](_0x5a26f3)['catch'](loggerCatch(_0x3a1a('0x137')));if(_0x2a69df[_0x3a1a('0x195')](0x0,_0x1f5ef9,_0x3b96b5)&&!_0x31160f){if(_0x5a26f3[_0x3a1a('0x12a')]>=_0x3b96b5['dialNoSuchNumberMaxRetry']){_0x2a69df[_0x3a1a('0x131')](_0x5a26f3,_0x3c92d4,_0x5cb9d1,_0x3a1a('0x1a8'));}else{_0x2a69df[_0x3a1a('0x12e')](_0x5a26f3,_0x3c92d4,_0x5cb9d1,_0x3a1a('0x1a8'));}}break;case'3':_0x3b96b5[_0x3a1a('0x1a9')]+=0x1;_0x5a26f3[_0x3a1a('0xdb')]=0x3;_0x5a26f3[_0x3a1a('0x6b')]='NoAnswer';_0x5a26f3[_0x3a1a('0x129')]+=0x1;_0x5a26f3[_0x3a1a('0xe0')]+=0x1;var _0x41a661=ut[_0x3a1a('0x1aa')](_0x1f5ef9,_0x3b96b5);ami[_0x3a1a('0x3e')](_0x3a1a('0x1ab'),_0x41a661);_0x2c7843=_0x3b96b5[_0x3a1a('0x196')];_0x40ac96=_0x3b96b5[_0x3a1a('0xe2')];hopperUtils[_0x3a1a('0xd0')](_0x5a26f3)['catch'](loggerCatch(_0x3a1a('0x1ac')));if(_0x2a69df[_0x3a1a('0x195')](0x3,_0x1f5ef9,_0x3b96b5)&&!_0x31160f){if(_0x5a26f3['countnoanswerretry']>=_0x3b96b5[_0x3a1a('0x1ad')]){_0x2a69df[_0x3a1a('0x131')](_0x5a26f3,_0x3c92d4,_0x5cb9d1,_0x3a1a('0x1ae'));}else{_0x2a69df[_0x3a1a('0x12e')](_0x5a26f3,_0x3c92d4,_0x5cb9d1,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x3b96b5[_0x3a1a('0x1af')]+=0x1;_0x5a26f3[_0x3a1a('0xdb')]=0x5;_0x5a26f3[_0x3a1a('0x6b')]='Busy';_0x5a26f3['countbusyretry']+=0x1;_0x5a26f3[_0x3a1a('0xe0')]+=0x1;ami[_0x3a1a('0x3e')](_0x3a1a('0x1b0'),ut['buildObj'](_0x1f5ef9,_0x3a1a('0x1b1')));_0x2c7843=_0x3b96b5['dialBusyRetryFrequency'];_0x40ac96=_0x3b96b5['callAdditionalPhoneAfterMin'];hopperUtils[_0x3a1a('0xd0')](_0x5a26f3)['catch'](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x2a69df[_0x3a1a('0x195')](0x5,_0x1f5ef9,_0x3b96b5)&&!_0x31160f){if(_0x5a26f3[_0x3a1a('0x138')]>=_0x3b96b5[_0x3a1a('0x197')]){_0x2a69df['createStateFinal'](_0x5a26f3,_0x3c92d4,_0x5cb9d1,_0x3a1a('0x1b2'));}else{_0x2a69df[_0x3a1a('0x12e')](_0x5a26f3,_0x3c92d4,_0x5cb9d1,_0x3a1a('0x1b2'));}}break;case'8':_0x3b96b5['outboundCongestionCallsDay']+=0x1;_0x5a26f3[_0x3a1a('0xdb')]=0x8;_0x5a26f3[_0x3a1a('0x6b')]=_0x3a1a('0x1b3');_0x5a26f3[_0x3a1a('0x128')]+=0x1;_0x5a26f3[_0x3a1a('0xe0')]+=0x1;_0x2c7843=_0x3b96b5[_0x3a1a('0x19b')];_0x40ac96=_0x3b96b5[_0x3a1a('0xe2')];ami[_0x3a1a('0x3e')](_0x3a1a('0x1b4'),ut[_0x3a1a('0x120')](_0x1f5ef9,_0x3a1a('0x1b5')));hopperUtils[_0x3a1a('0xd0')](_0x5a26f3)[_0x3a1a('0xa2')](loggerCatch(_0x3a1a('0x1b6')));if(_0x2a69df[_0x3a1a('0x195')](0x8,_0x1f5ef9,_0x3b96b5)&&!_0x31160f){if(_0x5a26f3[_0x3a1a('0x128')]>=_0x3b96b5[_0x3a1a('0x19a')]){_0x2a69df[_0x3a1a('0x131')](_0x5a26f3,_0x3c92d4,_0x5cb9d1,_0x3a1a('0x1b7'));}else{_0x2a69df['stateGlobal'](_0x5a26f3,_0x3c92d4,_0x5cb9d1,'reason\x208\x20congestion');}}break;case'11':_0x3b96b5[_0x3a1a('0x1b8')]+=0x1;_0x5a26f3[_0x3a1a('0xdb')]=0xb;_0x5a26f3['statedesc']=_0x3a1a('0xf2');_0x5a26f3[_0x3a1a('0xf4')]+=0x1;_0x5a26f3['countglobal']+=0x1;_0x2c7843=_0x3b96b5[_0x3a1a('0x19f')];_0x40ac96=_0x3b96b5[_0x3a1a('0xe2')];hopperUtils[_0x3a1a('0xd0')](_0x5a26f3)[_0x3a1a('0xa2')](loggerCatch(_0x3a1a('0xf9')));if(_0x2a69df[_0x3a1a('0x195')](0xb,_0x1f5ef9,_0x3b96b5)&&!_0x31160f){if(_0x5a26f3['countabandonedretry']>=_0x3b96b5[_0x3a1a('0xf5')]){_0x2a69df['createStateFinal'](_0x5a26f3,_0x3c92d4,_0x5cb9d1,_0x3a1a('0x1b9'));}else{_0x2a69df[_0x3a1a('0x12e')](_0x5a26f3,_0x3c92d4,_0x5cb9d1,_0x3a1a('0x1b9'));}}break;case'20':_0x3b96b5[_0x3a1a('0x1ba')]+=0x1;_0x5a26f3[_0x3a1a('0xdb')]=0x14;_0x5a26f3[_0x3a1a('0x6b')]=_0x3a1a('0x1bb');_0x5a26f3[_0x3a1a('0x12c')]+=0x1;_0x5a26f3[_0x3a1a('0xe0')]+=0x1;_0x2c7843=_0x3b96b5[_0x3a1a('0x1a0')];_0x40ac96=_0x3b96b5[_0x3a1a('0xe2')];ami[_0x3a1a('0x3e')](_0x3a1a('0x1bc'),ut['buildObj'](_0x1f5ef9,_0x3a1a('0x1bd')));hopperUtils[_0x3a1a('0xd0')](_0x5a26f3)[_0x3a1a('0xa2')](loggerCatch(_0x3a1a('0x1be')));if(_0x2a69df[_0x3a1a('0x195')](0x14,_0x1f5ef9,_0x3b96b5)&&!_0x31160f){if(_0x5a26f3[_0x3a1a('0x12c')]>=_0x3b96b5[_0x3a1a('0x1bf')]){_0x2a69df[_0x3a1a('0x131')](_0x5a26f3,_0x3c92d4,_0x5cb9d1,'reason\x2020\x20agentreject');}else{_0x2a69df[_0x3a1a('0x12e')](_0x5a26f3,_0x3c92d4,_0x5cb9d1,_0x3a1a('0x1c0'));}}break;default:_0x3b96b5[_0x3a1a('0x142')]+=0x1;_0x5a26f3['state']=0xc;_0x5a26f3[_0x3a1a('0x6b')]=_0x336ed8[_0x3a1a('0xcc')];_0x2c7843=_0x3b96b5[_0x3a1a('0x1a0')];_0x40ac96=_0x3b96b5[_0x3a1a('0xe2')];hopperUtils[_0x3a1a('0xd0')](_0x5a26f3)[_0x3a1a('0xa2')](loggerCatch(_0x3a1a('0x1c1')));if(_0x2a69df[_0x3a1a('0x195')](_0x336ed8[_0x3a1a('0xcc')],_0x1f5ef9,_0x3b96b5)&&!_0x31160f){if(_0x5a26f3['countbusyretry']+_0x5a26f3[_0x3a1a('0x128')]+_0x5a26f3['countnoanswerretry']+_0x5a26f3[_0x3a1a('0x12a')]+_0x5a26f3[_0x3a1a('0xdf')]+_0x5a26f3[_0x3a1a('0xf4')]+_0x5a26f3[_0x3a1a('0x12b')]+_0x5a26f3[_0x3a1a('0x12c')]>=_0x3b96b5[_0x3a1a('0x12d')]){_0x2a69df['stateGlobal'](_0x5a26f3,_0x3c92d4,_0x5cb9d1,_0x336ed8[_0x3a1a('0xcc')]);}else{_0x2a69df[_0x3a1a('0x131')](_0x5a26f3,_0x3c92d4,_0x5cb9d1,_0x336ed8['reason']);}}}})[_0x3a1a('0x3d')](function(){if(_0x31160f){hopperUtils[_0x3a1a('0xfa')](_0x5a26f3,_0x2c7843,_0x40ac96)['then'](function(){return _0x3c92d4(0x1);});}});});};Dialer[_0x3a1a('0x17')][_0x3a1a('0x12e')]=function(_0x300731,_0x18b9f2,_0x3240c0,_0x1d2092){var _0x20cdc8=new Final(_0x300731);_0x20cdc8[_0x3a1a('0xdb')]=0xf;_0x20cdc8[_0x3a1a('0x6b')]='Global';this['createStateFinal'](_0x20cdc8,_0x18b9f2,_0x3240c0,_0x1d2092);};Dialer['prototype'][_0x3a1a('0x131')]=function(_0x4f4006,_0x35590f,_0xa792ac,_0x3d91c7){hopperUtils[_0x3a1a('0xd2')](_0x4f4006)[_0x3a1a('0x3d')](function(){return _0x35590f(msgResponse(_0x3a1a('0x1a3'),_0x3a1a('0x113'),_0x3d91c7));})[_0x3a1a('0xa2')](function(){return _0xa792ac(msgResponse(_0x3a1a('0x1c2'),_0x3a1a('0x93'),_0x3a1a('0x1c3')));});};Dialer[_0x3a1a('0x17')]['predictive']=function(_0x2d731e){var _0x5526c2=_0x2d731e[_0x3a1a('0x1c4')]/0x64;var _0x58536e=_0x2d731e[_0x3a1a('0xd9')]/(_0x2d731e[_0x3a1a('0xd9')]+_0x2d731e[_0x3a1a('0xcb')]);var _0x46a417=Math[_0x3a1a('0x1c5')](_0x2d731e['predictiveIntervalAvailable']*(_0x2d731e[_0x3a1a('0x1c6')]/0x64));var _0x57a6b8=Math[_0x3a1a('0x1c5')](_0x2d731e[_0x3a1a('0x1c7')]*(_0x2d731e['predictiveIntervalMinThreshold']/0x64));var _0x2d7a93=_0x2d731e['available']+_0x2d731e[_0x3a1a('0x1c8')];var _0x3f21f2=Math[_0x3a1a('0x1c9')](_0x2d731e[_0x3a1a('0x55')]*_0x2d731e[_0x3a1a('0x59')]*_0x2d731e[_0x3a1a('0x1ca')]*_0x2d731e[_0x3a1a('0x1cb')]);if(_[_0x3a1a('0x4f')](_0x2d731e['startProgressive'])){if(!_[_0x3a1a('0x4f')](_0x2d731e['startPredictive'])){_0x2d731e[_0x3a1a('0x26')]=undefined;loggerPredictive[_0x3a1a('0x5f')]('[startMethodPredictive][StartProgressive]',_0x3a1a('0x1cc'));}if(!_[_0x3a1a('0x4f')](_0x2d731e[_0x3a1a('0x5e')])){loggerPredictive[_0x3a1a('0x5f')](_0x3a1a('0x1cd'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x2d731e[_0x3a1a('0x5e')]);_0x2d731e[_0x3a1a('0x5e')]=undefined;}_0x2d731e['startProgressive']=moment()['format'](_0x3a1a('0xcf'));loggerPredictive['info'](_0x2d731e['name'],_0x3a1a('0x1ce'),_0x2d731e[_0x3a1a('0x27')]);this[_0x3a1a('0xb8')](_0x2d731e,0x1);}else if(ifInterval(_0x2d731e[_0x3a1a('0x1cf')],_0x2d731e[_0x3a1a('0x27')])){this[_0x3a1a('0xb8')](_0x2d731e,0x1);loggerPredictiveCalls['info'](_0x3a1a('0x1d0'),_0x2d731e[_0x3a1a('0x27')],_0x2d731e['name']);_0x2d731e[_0x3a1a('0x55')]=0x0;_0x2d731e[_0x3a1a('0xda')]=0x0;}else if(_0x5526c2<_0x58536e&&_0x2d731e[_0x3a1a('0x1d1')]===_0x3a1a('0x1d2')){clearPredictiveAttributes(_0x2d731e);loggerPredictive['info'](_0x3a1a('0x1d3'),'Dropped\x20calls\x20day',_0x58536e,_0x3a1a('0x27'),_0x2d731e['name']);}else if(_0x3f21f2<_0x2d731e[_0x3a1a('0xda')]&&_0x2d731e[_0x3a1a('0x1d1')]===_0x3a1a('0x1d2')){clearPredictiveAttributes(_0x2d731e);loggerPredictive[_0x3a1a('0x45')](_0x3a1a('0x1d4'),_0x3a1a('0x1d5'),_0x3f21f2,_0x3a1a('0x1d6'),_0x2d731e[_0x3a1a('0xda')],_0x3a1a('0x27'),_0x2d731e['name']);}else if(!ifInterval(_0x2d731e[_0x3a1a('0x1cf')],_0x2d731e['startProgressive'])&&_[_0x3a1a('0x4f')](_0x2d731e[_0x3a1a('0x26')])&&!_[_0x3a1a('0x4f')](_0x2d731e[_0x3a1a('0x27')])){_0x2d731e[_0x3a1a('0x26')]=moment()[_0x3a1a('0x7c')](_0x3a1a('0xcf'));loggerPredictive[_0x3a1a('0x45')](_0x2d731e[_0x3a1a('0x43')],_0x3a1a('0x1d7'),_0x2d731e[_0x3a1a('0x26')]);hopperUtils[_0x3a1a('0x1d8')](_0x2d731e['dialPredictiveInterval'])[_0x3a1a('0x3d')](this[_0x3a1a('0x1d9')](_0x2d731e))[_0x3a1a('0x3d')](mergeDataErlangB(_0x2d731e))[_0x3a1a('0x3d')](this[_0x3a1a('0x1da')](_0x2d731e))['catch'](loggerCatchPredictive(_0x3a1a('0x1db'),_0x2d731e));}else if(!ifInterval(_0x2d731e['dialPredictiveInterval'],_0x2d731e['startPredictive'])){_0x2d731e['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x2d731e[_0x3a1a('0x26')]=moment()[_0x3a1a('0x7c')](_0x3a1a('0xcf'));loggerPredictive[_0x3a1a('0x45')](_0x2d731e[_0x3a1a('0x43')],_0x3a1a('0x1dc'),_0x2d731e[_0x3a1a('0x26')]);clearInterval(_0x2d731e[_0x3a1a('0x5e')]);_0x2d731e[_0x3a1a('0x5e')]=undefined;hopperUtils[_0x3a1a('0x1d8')](_0x2d731e[_0x3a1a('0x1cf')])[_0x3a1a('0x3d')](this[_0x3a1a('0x1d9')](_0x2d731e))['then'](mergeDataErlangB(_0x2d731e))[_0x3a1a('0x3d')](this[_0x3a1a('0x1da')](_0x2d731e))['catch'](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x2d731e));}else if(_0x2d731e[_0x3a1a('0x1c7')]&&_0x2d7a93<_0x2d731e[_0x3a1a('0x1c7')]-_0x57a6b8){clearPredictiveAttributes(_0x2d731e);loggerPredictive[_0x3a1a('0x45')](_0x2d731e[_0x3a1a('0x43')],_0x3a1a('0x1dd'),_0x2d7a93,')\x20are\x20less\x20than\x20threshold\x20(',_0x2d731e[_0x3a1a('0x1c7')],'-',_0x57a6b8,'=',_0x2d731e[_0x3a1a('0x1c7')]-_0x57a6b8,')');}else if(_0x2d731e[_0x3a1a('0x1c7')]&&_0x2d7a93>_0x2d731e[_0x3a1a('0x1c7')]+_0x46a417){clearPredictiveAttributes(_0x2d731e);loggerPredictive[_0x3a1a('0x45')](_0x2d731e[_0x3a1a('0x43')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x2d7a93,_0x3a1a('0x1de'),_0x2d731e[_0x3a1a('0x1c7')],'+',_0x46a417,'=',_0x2d731e[_0x3a1a('0x1c7')]+_0x46a417,')');}};Dialer[_0x3a1a('0x17')][_0x3a1a('0x1d9')]=function(_0x5be5d9){var _0x116658=this;return function(_0x417991){return new Promise(function(_0x4e5489,_0x906eda){_[_0x3a1a('0x5b')](_0x5be5d9,_0x417991[0x0]);if(checkGetDataPredictive(_0x417991[0x0])){var _0x150814=_0x5be5d9['predictiveIntervalAvailable']=_0x5be5d9[_0x3a1a('0x1c8')]+_0x5be5d9['available'];var _0x260160=_0x5be5d9[_0x3a1a('0x1cf')]*0x3c;var _0x310499=_0x417991[0x0][_0x3a1a('0x50')]+_0x417991[0x0][_0x3a1a('0x4c')];var _0x18c0ad=(_0x417991[0x0][_0x3a1a('0x48')]+_0x417991[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x417991[0x0][_0x3a1a('0x4b')])/_0x417991[0x0][_0x3a1a('0x46')];_0x5be5d9[_0x3a1a('0x1ca')]=_0x18c0ad>0x0?_0x18c0ad:0x1;switch(_0x5be5d9[_0x3a1a('0x1d1')]){case _0x3a1a('0x1d2'):var _0x370798=_0x5be5d9[_0x3a1a('0x1c4')]/0x64;return _0x116658[_0x3a1a('0x1df')](_0x150814,_0x260160,_0x310499,_0x18c0ad,_0x370798)[_0x3a1a('0x3d')](function(_0x124000){return _0x4e5489(_0x124000);});case'agentBusyFactor':var _0x3ca364=_0x5be5d9[_0x3a1a('0x1c4')]/0x64;return _0x116658['busyFactor'](_0x150814,_0x260160,_0x310499,_0x18c0ad,_0x3ca364)[_0x3a1a('0x3d')](function(_0x3e1e58){return _0x4e5489(_0x3e1e58);});default:return _0x906eda(msgResponse(_0x3a1a('0x1e0'),_0x3a1a('0x93'),_0x3a1a('0x1e1')));}}else{return _0x906eda(msgResponse('[getDataPredictive]',_0x3a1a('0x93'),_0x3a1a('0x1e2')));}});};};Dialer[_0x3a1a('0x17')][_0x3a1a('0x1e3')]=function(_0x11e416){var _0x26ef4c=this;return function(_0x52531c){return new Promise(function(_0x3c2aa9,_0x4992ae){_[_0x3a1a('0x5b')](_0x11e416,_0x52531c[0x0]);if(checkGetDataPredictive(_0x52531c[0x0])){loggerPredictive[_0x3a1a('0x45')](JSON['stringify'](_0x52531c[0x0]));if(_0x11e416[_0x3a1a('0x1d1')]==='dropRate'){return _0x26ef4c[_0x3a1a('0x158')](_0x11e416['id'])[_0x3a1a('0x3d')](function(_0x4b25a3){var _0x333bfc=_0x11e416[_0x3a1a('0x1e4')]-_0x4b25a3[0x0]['outboundQueuePauses'];var _0x335086=_0x11e416[_0x3a1a('0x1cf')]*0x3c;var _0x42adcb=_0x52531c[0x0]['predictiveIntervalAvgTalktime']+_0x52531c[0x0]['predictiveIntervalAvgHoldtime'];var _0x7e967f=(_0x52531c[0x0][_0x3a1a('0x48')]+_0x52531c[0x0][_0x3a1a('0x49')]+_0x52531c[0x0][_0x3a1a('0x4b')])/_0x52531c[0x0][_0x3a1a('0x46')];var _0x5e4ace=_0x11e416[_0x3a1a('0x1c4')]/0x64;_0x11e416[_0x3a1a('0x1e5')]=_0x4b25a3[0x0][_0x3a1a('0x1e6')]||0x0;_0x11e416['predictiveIntervalHitRate']=_0x7e967f>0x0?_0x7e967f:0x1;return _0x26ef4c[_0x3a1a('0x1df')](_0x333bfc,_0x335086,_0x42adcb,_0x7e967f,_0x5e4ace);})[_0x3a1a('0x3d')](function(_0x53dd1b){return _0x3c2aa9(_0x53dd1b);})[_0x3a1a('0xa2')](function(_0xeb37a7){return _0x4992ae(msgResponse(_0x3a1a('0x1e7'),_0x3a1a('0x93'),JSON[_0x3a1a('0x71')](_0xeb37a7)));});}if(_0x11e416[_0x3a1a('0x1d1')]===_0x3a1a('0x1e8')){return _0x26ef4c['getVoiceQueueRtPauses'](_0x11e416['id'])['then'](function(_0x1db6ae){var _0x164bf0=_0x11e416[_0x3a1a('0x1e4')]-_0x1db6ae[0x0]['outboundQueuePauses'];var _0x451de3=_0x11e416[_0x3a1a('0x1cf')]*0x3c;var _0x2971ff=_0x52531c[0x0][_0x3a1a('0x50')]+_0x52531c[0x0][_0x3a1a('0x4c')];var _0x3b8224=(_0x52531c[0x0][_0x3a1a('0x48')]+_0x52531c[0x0][_0x3a1a('0x49')]+_0x52531c[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x52531c[0x0][_0x3a1a('0x46')];var _0x5dffe8=_0x11e416['dialPredictiveOptimizationPercentage']/0x64;_0x11e416[_0x3a1a('0x1e5')]=_0x1db6ae[0x0][_0x3a1a('0x1e6')]||0x0;_0x11e416[_0x3a1a('0x1ca')]=_0x3b8224>0x0?_0x3b8224:0x1;return _0x26ef4c[_0x3a1a('0x1e9')](_0x164bf0,_0x451de3,_0x2971ff,_0x3b8224,_0x5dffe8);})['then'](function(_0x233bbc){return _0x3c2aa9(_0x233bbc);})[_0x3a1a('0xa2')](function(_0x19d9de){return _0x4992ae(msgResponse(_0x3a1a('0x1e7'),'Failure',JSON[_0x3a1a('0x71')](_0x19d9de)));});}}else{return _0x4992ae(msgResponse(_0x3a1a('0x1e0'),_0x3a1a('0x93'),_0x3a1a('0x1e2')));}});};};Dialer[_0x3a1a('0x17')]['startMethodPredictive']=function(_0x37bfaa){var _0x549f06=this;return function(){var _0xea42c2=0x0;var _0x321f80=Math[_0x3a1a('0x1c9')](_0x37bfaa[_0x3a1a('0x57')]*0x3e8);if(_0x321f80>0x0){_0x321f80=_0x321f80<0x64?0x64:_0x321f80;loggerPredictive[_0x3a1a('0x45')](_0x37bfaa[_0x3a1a('0x43')],'one\x20call\x20every:',_0x321f80,'milliseconds');_0x37bfaa[_0x3a1a('0x5e')]=setInterval(function(){_0x549f06[_0x3a1a('0x5e')](_0x37bfaa);loggerPredictiveCalls['info'](_0x3a1a('0x1ea'),_0xea42c2+=0x1);},_0x321f80);}else{loggerPredictive[_0x3a1a('0x45')](_0x37bfaa[_0x3a1a('0x43')],_0x3a1a('0x1eb'));}};};Dialer[_0x3a1a('0x17')][_0x3a1a('0x1ec')]=function(_0x31f852,_0x215df8){var _0x10ed5a=this;return function(_0x1c868a){if(_[_0x3a1a('0x77')](_0x1c868a)){if(_[_0x3a1a('0x100')](_0x215df8['UserId'])||!_0x215df8[_0x3a1a('0x1ed')]){if(_0x31f852[_0x3a1a('0xb6')]===_0x3a1a('0x7')){_0x31f852[_0x3a1a('0x6e')]=_[_0x3a1a('0x4f')](_0x31f852[_0x3a1a('0x6e')])?!![]:_0x31f852[_0x3a1a('0x6e')];var _0x7290ea=uuid['v4']();_0x10ed5a[_0x3a1a('0x23')][_0x7290ea]=new Action(_0x31f852,_0x215df8,_0x7290ea);loggerBooked['info'](_0x3a1a('0x1ee'),_0x7290ea,_0x3a1a('0x1ef'),JSON['stringify'](_0x31f852[_0x3a1a('0x6e')]),'Queue:\x20',_0x31f852[_0x3a1a('0x43')]);if(_0x31f852[_0x3a1a('0x6e')]){_0x31f852['queueStatusComplete']=![];_0x10ed5a['queueBooked'][_0x10ed5a[_0x3a1a('0x23')][_0x7290ea][_0x3a1a('0xc5')]]=[];ami[_0x3a1a('0x9d')]({'actionid':_0x7290ea,'action':_0x3a1a('0x1f0'),'queue':_0x31f852[_0x3a1a('0x43')]})[_0x3a1a('0xa2')](function(){_0x10ed5a[_0x3a1a('0xd5')](_0x31f852);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x10ed5a['actions'][_0x7290ea][_0x3a1a('0xe9')],'ListId':_0x10ed5a[_0x3a1a('0x23')][_0x7290ea][_0x3a1a('0xea')],'VoiceQueueId':_0x10ed5a[_0x3a1a('0x23')][_0x7290ea]['VoiceQueueId']||undefined,'CampaignId':_0x10ed5a[_0x3a1a('0x23')][_0x7290ea][_0x3a1a('0xec')]||undefined})[_0x3a1a('0xa2')](loggerCatch(_0x3a1a('0x1f1')));delete _0x10ed5a[_0x3a1a('0x23')][_0x7290ea];});}else{loggerBooked[_0x3a1a('0x45')](_0x3a1a('0x1f2'),JSON['stringify'](_0x31f852[_0x3a1a('0x6e')]),_0x3a1a('0x1f3'),_0x31f852[_0x3a1a('0x43')]);_0x10ed5a['updateOriginated'](_0x31f852);hopperUtils[_0x3a1a('0xe8')]({'active':![],'ContactId':_0x10ed5a['actions'][_0x7290ea]['ContactId'],'ListId':_0x10ed5a[_0x3a1a('0x23')][_0x7290ea][_0x3a1a('0xea')],'VoiceQueueId':_0x10ed5a['actions'][_0x7290ea][_0x3a1a('0xeb')]||undefined,'CampaignId':_0x10ed5a[_0x3a1a('0x23')][_0x7290ea][_0x3a1a('0xec')]||undefined})[_0x3a1a('0xa2')](loggerCatch(_0x3a1a('0x1f1')));delete _0x10ed5a[_0x3a1a('0x23')][_0x7290ea];}}else{return _0x10ed5a[_0x3a1a('0x162')](_0x31f852,_0x215df8);}}else{if(utils[_0x3a1a('0x5c')](undefined,_0x215df8[_0x3a1a('0x1f4')])<_0x31f852['dialRecallMeTimeout']*0x3c){if(_0x215df8[_0x3a1a('0x1f5')]&&!_0x215df8[_0x3a1a('0x1f5')][_0x3a1a('0x1f6')]){_0x10ed5a[_0x3a1a('0x1c')][_0x3a1a('0x10d')](_0x215df8['id'])[_0x3a1a('0x1a')](function(){_0x10ed5a[_0x3a1a('0xd5')](_0x31f852);});}else{hopperUtils[_0x3a1a('0x1f7')]({'active':![]},_0x215df8['id'],0x1)[_0x3a1a('0x1a')](function(){_0x10ed5a['updateOriginated'](_0x31f852);});}}else{_0x31f852[_0x3a1a('0x1f8')]+=0x1;_0x10ed5a[_0x3a1a('0xd5')](_0x31f852);if(_0x31f852[_0x3a1a('0x1f9')]){hopperUtils[_0x3a1a('0xe8')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x215df8[_0x3a1a('0xe9')],'ListId':_0x215df8[_0x3a1a('0xea')],'VoiceQueueId':_0x215df8[_0x3a1a('0xeb')]||undefined,'CampaignId':_0x215df8['CampaignId']||undefined})[_0x3a1a('0xa2')](loggerCatch(_0x3a1a('0x1fa')));hopperUtils[_0x3a1a('0xd0')](createObjHistory(_0x31f852,_0x215df8,utils['CAMPAIGN_STATUS'][_0x3a1a('0x1fb')],0x17,'RecallInQueue'))[_0x3a1a('0xa2')](loggerCatch(_0x3a1a('0x1fc')));}else{_0x10ed5a[_0x3a1a('0x121')](createObjHistory(_0x31f852,_0x215df8,utils['CAMPAIGN_STATUS'][_0x3a1a('0x1fd')],0x16,_0x3a1a('0x1fe')),_0x3a1a('0x1ff'),_0x3a1a('0x200'));}}}}else{_0x31f852[_0x3a1a('0x201')]+=0x1;_0x10ed5a[_0x3a1a('0x121')](createObjHistory(_0x31f852,_0x215df8,utils['CAMPAIGN_STATUS'][_0x3a1a('0x202')],0xd,_0x3a1a('0x203')),_0x3a1a('0x204'),_0x3a1a('0x205'));throw _0x3a1a('0x206');}};};Dialer[_0x3a1a('0x17')][_0x3a1a('0x207')]=function(_0xaecbdb){var _0x2e0d4d=this;var _0x1e0aa7=_0xaecbdb[_0x3a1a('0x208')]-_0xaecbdb['originated'];emitCampaignSummary(_0xaecbdb);if(_0x1e0aa7>0x0&&_0xaecbdb[_0x3a1a('0x62')]==0x0){if(_0x1e0aa7>this[_0x3a1a('0x21')]){_0x1e0aa7=this[_0x3a1a('0x21')];}_0xaecbdb[_0x3a1a('0x62')]=0x1;hopperUtils[_0x3a1a('0x209')](_0xaecbdb,_0x1e0aa7)[_0x3a1a('0x3d')](function(_0x37cce7){_0xaecbdb[_0x3a1a('0x62')]=0x0;if(_0x37cce7){if(!utils['checkContactEmpty'](_0x37cce7)){_0xaecbdb[_0x3a1a('0x63')]=utils[_0x3a1a('0x64')][_0x3a1a('0x69')];logger[_0x3a1a('0x45')](_0x3a1a('0x20a')+_0xaecbdb[_0x3a1a('0x43')]);}else{_0xaecbdb[_0x3a1a('0x7f')]+=_0x37cce7[_0x3a1a('0x9b')];_0xaecbdb[_0x3a1a('0x63')]=utils[_0x3a1a('0x64')][_0x3a1a('0x20b')];for(var _0x1a3d2f=0x0;_0x1a3d2f<_0x37cce7[_0x3a1a('0x9b')];_0x1a3d2f+=0x1){_0xaecbdb['ivrTotalCallsDays']+=0x1;if(_['isNil'](_0x37cce7[_0x1a3d2f])||_[_0x3a1a('0x100')](_0x37cce7[_0x1a3d2f][_0x3a1a('0x17e')])||_['isNil'](_0x37cce7[_0x1a3d2f][_0x3a1a('0x164')])){_0x2e0d4d['emptyContact']('[actionOriginate]\x20',_0xaecbdb,_0x37cce7[_0x1a3d2f]);}else{hopperUtils[_0x3a1a('0x20c')](_[_0x3a1a('0x72')](_0x37cce7[_0x1a3d2f],[_0x3a1a('0xec'),_0x3a1a('0x164')]))[_0x3a1a('0x3d')](_0x2e0d4d[_0x3a1a('0x1ec')](_0xaecbdb,_0x37cce7[_0x1a3d2f]))['catch'](_0x2e0d4d[_0x3a1a('0x15b')](_0x3a1a('0x20d'),_0xaecbdb));}}}}})[_0x3a1a('0xa2')](loggerGetContactDialer(_0x3a1a('0x20e'),_0xaecbdb,_0x1e0aa7));}};Dialer['prototype'][_0x3a1a('0xb8')]=function(_0x35b0cb,_0x258a2f){var _0xfefb7c=this;var _0x1c9174=[];if(_0x258a2f<0x1||_0x35b0cb['dialMethod']===_0x3a1a('0x7')){_0x258a2f=0x1;}var _0x1d1fa8=Math[_0x3a1a('0x1c9')](_0x35b0cb[_0x3a1a('0x146')]*_0x258a2f)-_0x35b0cb[_0x3a1a('0x7f')];if(_0x35b0cb[_0x3a1a('0x20f')]>0x0){var _0x316a5f=_0x35b0cb[_0x3a1a('0x20f')]-_0x35b0cb[_0x3a1a('0x7f')]-_0x35b0cb[_0x3a1a('0x1c8')]-_0x35b0cb[_0x3a1a('0x148')];if(_0x1d1fa8>_0x316a5f){_0x1d1fa8=_0x316a5f;}}if(_0x1d1fa8>0x0&&_0x35b0cb[_0x3a1a('0x62')]==0x0){if(_0x35b0cb[_0x3a1a('0xb6')]===_0x3a1a('0x7')){_0x1d1fa8=0x1;}if(_0x1d1fa8>this[_0x3a1a('0x21')]){_0x1d1fa8=this[_0x3a1a('0x21')];}for(var _0x297f03 in this[_0x3a1a('0x1f')]){if(typeof this[_0x3a1a('0x1f')][_0x297f03]!=='undefined'){if(this[_0x3a1a('0x1f')][_0x297f03]['state']===_0x3a1a('0x210')&&this[_0x3a1a('0x1f')][_0x297f03]['status']===_0x3a1a('0x88')){_0x1c9174[_0x3a1a('0x9c')](this[_0x3a1a('0x1f')][_0x297f03]['id']);}}}_0x35b0cb[_0x3a1a('0x62')]=0x1;hopperUtils[_0x3a1a('0x211')](_0x35b0cb,_0x1c9174,_0x1d1fa8)[_0x3a1a('0x3d')](function(_0x4c4ca4){_0x35b0cb[_0x3a1a('0x62')]=0x0;if(_0x4c4ca4){if(!utils[_0x3a1a('0x212')](_0x4c4ca4)){hopperUtils[_0x3a1a('0x213')](_0x35b0cb)['then'](sendMessageReschedule(_0x35b0cb))['catch'](loggerCatch(_0x3a1a('0x214')));}else{_0x35b0cb['originated']+=_0x4c4ca4[_0x3a1a('0x9b')];_0x35b0cb[_0x3a1a('0x63')]=_0x35b0cb[_0x3a1a('0xb6')]===_0x3a1a('0x7')?utils[_0x3a1a('0x64')][_0x3a1a('0x149')]:utils[_0x3a1a('0x64')]['RUNNING'];for(var _0x55b371=0x0;_0x55b371<_0x4c4ca4[_0x3a1a('0x9b')];_0x55b371+=0x1){if(_[_0x3a1a('0x100')](_0x4c4ca4[_0x55b371])||_[_0x3a1a('0x100')](_0x4c4ca4[_0x55b371][_0x3a1a('0x17e')])||_[_0x3a1a('0x100')](_0x4c4ca4[_0x55b371][_0x3a1a('0x164')])){_0xfefb7c['emptyContact'](_0x3a1a('0x215'),_0x35b0cb,_0x4c4ca4[_0x55b371]);}else{hopperUtils['checkIsBlackList'](_[_0x3a1a('0x72')](_0x4c4ca4[_0x55b371],[_0x3a1a('0xeb'),_0x3a1a('0x164')]))[_0x3a1a('0x3d')](_0xfefb7c[_0x3a1a('0x1ec')](_0x35b0cb,_0x4c4ca4[_0x55b371]))[_0x3a1a('0xa2')](_0xfefb7c['loggerHandler'](_0x3a1a('0x215'),_0x35b0cb));}}}}})['catch'](loggerGetContactDialer('[getContactDialer2]',_0x35b0cb,_0x1d1fa8));}};Dialer[_0x3a1a('0x17')][_0x3a1a('0x5e')]=function(_0x48b167){if(_0x48b167[_0x3a1a('0x20f')]>0x0){var _0x31b958=_0x48b167['dialLimitQueue']-_0x48b167[_0x3a1a('0x7f')]-_0x48b167[_0x3a1a('0x1c8')];if(_0x31b958>0x0&&_0x48b167[_0x3a1a('0x62')]==0x0){this['tryOriginatePredictive'](_0x48b167);}else{loggerPredictiveCalls[_0x3a1a('0x45')](_0x3a1a('0x216'));}}else{this[_0x3a1a('0x217')](_0x48b167);}};Dialer[_0x3a1a('0x17')][_0x3a1a('0x217')]=function(_0x10417e){var _0x2c126c=this;var _0x536511=[];_0x10417e['originated']+=0x1;for(var _0x4c19a6 in this['agents']){if(typeof this[_0x3a1a('0x1f')][_0x4c19a6]!==_0x3a1a('0xaf')){if(this[_0x3a1a('0x1f')][_0x4c19a6]['state']===_0x3a1a('0x210')&&this[_0x3a1a('0x1f')][_0x4c19a6]['status']===_0x3a1a('0x88')){_0x536511['push'](this[_0x3a1a('0x1f')][_0x4c19a6]['id']);}}}_0x10417e[_0x3a1a('0x62')]=0x1;return this[_0x3a1a('0x211')](_0x10417e['id'],_0x536511,0x1,_0x10417e[_0x3a1a('0x218')],_0x10417e)[_0x3a1a('0x3d')](function(_0x3d30d6){_0x10417e[_0x3a1a('0x62')]=0x1;if(_0x3d30d6){if(!utils['checkContactEmpty'](_0x3d30d6)){utils[_0x3a1a('0x61')](_0x10417e,0x1,0x0);return hopperUtils[_0x3a1a('0x213')](_0x10417e)['then'](sendMessageReschedule(_0x10417e))['catch'](loggerCatch(_0x3a1a('0x214')));}else{_0x10417e[_0x3a1a('0x63')]=utils[_0x3a1a('0x64')][_0x3a1a('0x20b')];if(_[_0x3a1a('0x100')](_0x3d30d6[0x0])||_[_0x3a1a('0x100')](_0x3d30d6[0x0][_0x3a1a('0x17e')])||_[_0x3a1a('0x100')](_0x3d30d6[0x0][_0x3a1a('0x164')])){_0x2c126c[_0x3a1a('0x15c')](_0x3a1a('0x215'),_0x10417e,_0x3d30d6[0x0]);}else{return hopperUtils[_0x3a1a('0x219')](_[_0x3a1a('0x72')](_0x3d30d6[0x0],[_0x3a1a('0xeb'),'phone']))[_0x3a1a('0x3d')](_0x2c126c[_0x3a1a('0x1ec')](_0x10417e,_0x3d30d6[0x0]))[_0x3a1a('0xa2')](_0x2c126c[_0x3a1a('0x15b')]('[actionOriginatePredictive]\x20',_0x10417e));}}}})[_0x3a1a('0xa2')](loggerGetContactDialer(_0x3a1a('0x21a'),_0x10417e,0x1));};Dialer[_0x3a1a('0x17')][_0x3a1a('0x1df')]=function(_0x5763c7,_0x490e07,_0x45986c,_0x58713a,_0x4af401,_0x8c4c08){loggerPredictive[_0x3a1a('0x45')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0x3a1a('0x45')]('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',_0x5763c7);loggerPredictive['info'](_0x3a1a('0x21b'),_0x490e07);loggerPredictive[_0x3a1a('0x45')]('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x45986c);loggerPredictive[_0x3a1a('0x45')](_0x3a1a('0x21c'),_0x58713a);loggerPredictive[_0x3a1a('0x45')](_0x3a1a('0x21d'),_0x4af401);loggerPredictive[_0x3a1a('0x45')](_0x3a1a('0x4e'));return new Promise(function(_0xc083a7,_0x6027ad){if(_0x5763c7<=0x0||isNaN(_0x5763c7)){return _0x6027ad(msgResponse(_0x3a1a('0x21e'),'Error',_0x3a1a('0x21f')+_0x5763c7));}if(_0x45986c<=0x0||isNaN(_0x45986c)){return _0x6027ad(msgResponse('[abandonmentRate]',_0x3a1a('0xc4'),_0x3a1a('0x220')+_0x45986c));}if(_0x58713a<=0x0||isNaN(_0x58713a)){return _0x6027ad(msgResponse(_0x3a1a('0x21e'),_0x3a1a('0xc4'),_0x3a1a('0x221')+_0x58713a));}if(_0x490e07<=0x0||isNaN(_0x490e07)){return _0x6027ad(msgResponse(_0x3a1a('0x21e'),_0x3a1a('0xc4'),_0x3a1a('0x222')+_0x490e07));}if(_0x4af401<=0x0||isNaN(_0x4af401)){return _0x6027ad(msgResponse(_0x3a1a('0x21e'),_0x3a1a('0xc4'),_0x3a1a('0x223')+_0x4af401));}_0x8c4c08=_0x8c4c08||0x0;var _0x478215=0x1/_0x45986c;var _0x34e701=0x0;var _0x2faac9=0x0;var _0x5217e6=0x0;var _0x113778=0x0;for(var _0x1cf14a=0x0;_0x5217e6<_0x4af401;_0x1cf14a+=0x1){_0x2faac9=_0x1cf14a/_0x490e07;_0x34e701=(_0x58713a*_0x2faac9+_0x8c4c08)/_0x478215;_0x5217e6=utils['erlangb'](_0x34e701,_0x5763c7);_0x113778=_0x34e701/_0x5763c7*(0x1-utils[_0x3a1a('0x224')](_0x34e701,_0x5763c7));}return _0xc083a7({'erlangCalls':_0x1cf14a,'erlangCallToSecond':_0x490e07/_0x1cf14a,'erlangAbandonmentRate':_0x5217e6,'erlangBusyFactor':_0x113778});});};Dialer['prototype'][_0x3a1a('0x1e9')]=function(_0x52c9f5,_0xdd930a,_0x50b682,_0x19fb53,_0x325ead,_0x350d69){loggerPredictive['info']('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x3a1a('0x45')]('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',_0x52c9f5);loggerPredictive[_0x3a1a('0x45')](_0x3a1a('0x21b'),_0xdd930a);loggerPredictive[_0x3a1a('0x45')](_0x3a1a('0x225'),_0x50b682);loggerPredictive[_0x3a1a('0x45')](_0x3a1a('0x21c'),_0x19fb53);loggerPredictive[_0x3a1a('0x45')](_0x3a1a('0x226'),_0x325ead);loggerPredictive[_0x3a1a('0x45')]('---------------------------');return new Promise(function(_0x51de75,_0x24ab82){if(_0x52c9f5<=0x0||isNaN(_0x52c9f5)){return _0x24ab82(msgResponse(_0x3a1a('0x227'),_0x3a1a('0xc4'),_0x3a1a('0x21f')+_0x52c9f5));}if(_0x50b682<=0x0||isNaN(_0x50b682)){return _0x24ab82(msgResponse(_0x3a1a('0x227'),_0x3a1a('0xc4'),_0x3a1a('0x220')+_0x50b682));}if(_0x19fb53<=0x0||isNaN(_0x19fb53)){return _0x24ab82(msgResponse(_0x3a1a('0x227'),_0x3a1a('0xc4'),_0x3a1a('0x221')+_0x19fb53));}if(_0xdd930a<=0x0||isNaN(_0xdd930a)){return _0x24ab82(msgResponse(_0x3a1a('0x227'),_0x3a1a('0xc4'),_0x3a1a('0x222')+_0xdd930a));}if(_0x325ead<=0x0||isNaN(_0x325ead)){return _0x24ab82(msgResponse(_0x3a1a('0x227'),_0x3a1a('0xc4'),_0x3a1a('0x228')+_0x325ead));}_0x350d69=_0x350d69||0x0;var _0x513a10=0x1/_0x50b682;var _0x21046f=0x0;var _0x537342=0x0;var _0x532b54=0x0;var _0x415653=0x0;for(var _0x297ddd=0x0;_0x415653<_0x325ead;_0x297ddd+=0x1){_0x537342=_0x297ddd/_0xdd930a;_0x21046f=(_0x19fb53*_0x537342+_0x350d69)/_0x513a10;_0x532b54=utils['erlangb'](_0x21046f,_0x52c9f5);_0x415653=_0x21046f/_0x52c9f5*(0x1-utils['erlangb'](_0x21046f,_0x52c9f5));}return _0x51de75({'erlangCalls':_0x297ddd,'erlangCallToSecond':_0xdd930a/_0x297ddd,'erlangAbandonmentRate':_0x532b54,'erlangBusyFactor':_0x415653});});};module[_0x3a1a('0x229')]=Dialer; \ No newline at end of file +var _0x9789=['voice_queue:save','-----\x20Stats\x20Predictive\x20---','info','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\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','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','getSeconds','startProgressive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','checkContactLowerLimitOriginate','temp','contactsRescheduled','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','contacts','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','message','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','pick','Interval','\x20INTERVAL_IS_NULL','Intervals','NULL_INTERVAL','isEmpty','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','isIVRCampaign','campaign:save','originated','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','DISACTIVED','is\x20disactive','[ifTime][Action]','Error','isTrunkReachable','SIP/%s','status','reachable','checkIsTrunkReachable','Trunk','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','Failure','EMPTY_INTERVAL','ifTime','\x20Intervals\x20is\x20empty\x20','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','length','push','Action','iftime\x20%s,%s','timezones','indexOf','true','catch','content','all','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','Global:\x20','Timezone:\x20','resetActiveCalls','undefined','resolve','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','launchHandleIvr','[syncCampaigns]','checkDialMethod','dialMethod','handlePower','power','dialPowerLevel','predictive','Queue','method\x20not\x20recognized','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','\x20Interval\x20is\x20overtime:\x20','isGlobal','queue','uniqueid','ivr','updateOriginated','answertime','YYYY-MM-DD\x20HH:mm:ss','reason','agiafterat','dialQueueProject2','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','state','statedesc','Drop','dropreason','countglobal','dialDropRetryFrequency','callAdditionalPhoneAfterMin','verifyAdditionalPhones','additional','countdropretry','dialDropMaxRetry','queueCallerAbandonCreateState','add','minutes','ContactId','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','calleridname','calleridnum','swapAdditionalPhones','predictiveIntervalDroppedCallsCallersExit','outboundDropCallsDayCallersExit','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','Abandoned','channel','actionid','strategy','roundrobin','isNil','locked','paused','stateinterface','rrmemory','[Catch][Preview][syncQueueStatusComplete]','finally','rescheduleContact','queueBookedRR','_rr','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','idHopper','run','[booked][RR][finaly]','Agent:\x20','[booked][unlock]','[unlock][syncQueueStatusComplete]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','syncOriginateResponse','response','callProgressDetecting','[callProgressDetecting]\x20','variable','amdstatus','exten','dialAMDActive','value','HANGUP','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','custom:amd','buildObj','amd','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','Machine','countmachineretry','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','[rescheduleContact][Machine]','[syncHangupInAMDIvr]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','AnswerAGI','AGI','dialQueueProject','Normal\x20Clearing','[syncAgentComplete]','outboundUnknownCallsDay','cause-txt','Unknow','running','isPreviewCampaign','statusMessage','available','inUse','pTalking','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','assign','throttle','filter','dialPreviewRecallmeReminder','handlePreviewRecallNotifications','map','user:dialPreviewRecallReminder','loopClearZombieChannels','clearZombieChannels','[uniqueid]','[actions]','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','UserId','[emptyContact][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','checkPreviewRecallReminder','Agent','handleIvr','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialAgiAfterHangupAgent','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','isOutboundQueue','XMD-VOICEQUEUEID','Contact','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','dialOriginateCallerIdName','getCallerIdRandom','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','dialPrefix','dialCutDigit','substring','TrunkBackup','xcally-motion-dialer','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][Abandoned]','dialMachineRetryFrequency','[callProgressDetecting]','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberRetryFrequency','reason\x200\x20no\x20such\x20number....','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','checkRetriveMax','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','dialAgentRejectRetryFrequency','Success','[moveContactManagedDialer][0]','contact\x20not\x20moved','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','talking','floor','erlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','started\x20in\x20predictive\x20at','avgHandleTime','startMethodPredictive','recalculate\x20predictive\x20at','getDataPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalAnsweredCalls','dialPredictiveOptimizationPercentage','abandonmentRate','[getDataPredictive]','Unknown\x20Predictive','getDataPredictiveOld','loggedIn','outboundQueuePauses','predictiveIntervalDroppedCallsTimeout','[CatchErlangB]','agentBusyFactor','predictiveIntervalPauses','busyFactor','milliseconds','[handlePredictive]','checkContactBlack','recallme','booked','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','voicePause','unlockContact','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RecallInQueue','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','getContactDialerIvr','checkContactEmpty','[getContactCampaign2][Empty]','RUNNING','[actionOriginate]\x20','checkIsBlackListIvr','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','getContactDialer','countReScheduled','[countReScheduled]\x20','checkIsBlackList','tryOriginatePredictive','[handlePredictive][limitChannel]','not_inuse','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\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]','m\x20=\x20','Umin\x20=\x20','util','uuid','ioredis','./utils','./utils/hopper','../../../config/logger','dialer','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/interval','./models/action','./models/history','./models/final','./models/agentComplete','env','XCALLY_IP_AGI','127.0.0.1','prototype','enqueue','tail','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','uniqueId','optionPredictive','startPredictive','startProgressive','queueBooked','queuesSummary','agentconnect','syncAgentConnect','queuecallerabandon','syncQueueCallerAbandon','bind','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete','syncHangup','syncNewExten','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','getSettings','then','previewRecallmeReminderInterval','isUndefined','emit','type','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','voice:queue:%s','name'];(function(_0x395097,_0x6babd0){var _0x19f253=function(_0x4ba8fa){while(--_0x4ba8fa){_0x395097['push'](_0x395097['shift']());}};_0x19f253(++_0x6babd0);}(_0x9789,0x1d0));var _0x9978=function(_0x5e7913,_0x3d4099){_0x5e7913=_0x5e7913-0x0;var _0x1d50a2=_0x9789[_0x5e7913];return _0x1d50a2;};'use strict';var util=require(_0x9978('0x0'));var _=require('lodash');var uuid=require(_0x9978('0x1'));var moment=require('moment');var rr=require('rr');var Redis=require(_0x9978('0x2'));var utils=require(_0x9978('0x3'));var hopperUtils=require(_0x9978('0x4'));var ut=require('../preview/util/util');var config=require('../../../config/environment/');var logger=require(_0x9978('0x5'))(_0x9978('0x6'));var loggerBooked=require(_0x9978('0x5'))('booked');var loggerPredictive=require(_0x9978('0x5'))('predictive');var loggerPredictiveCalls=require(_0x9978('0x5'))(_0x9978('0x7'));var loggerSyncQueueSummary=require(_0x9978('0x5'))(_0x9978('0x8'));var ami=require(_0x9978('0x9'));config[_0x9978('0xa')]=_[_0x9978('0xb')](config['redis'],{'host':_0x9978('0xc'),'port':0x18eb});var io=require(_0x9978('0xd'))(new Redis(config['redis']));var cmHopper=require(_0x9978('0xe'));var voiceQueueRt=require(_0x9978('0xf'));var RpcSetting=require('../rpc/setting');var Interval=require(_0x9978('0x10'));var Action=require(_0x9978('0x11'));var History=require(_0x9978('0x12'));var Final=require(_0x9978('0x13'));var AgentComplete=require(_0x9978('0x14'));var QueueCallerAbandon=require('./models/queueCallerAbandon');var Hangup=require('./models/hangup');var ipAgi=process[_0x9978('0x15')][_0x9978('0x16')]||_0x9978('0x17');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x9978('0x18')][_0x9978('0x19')]=function(_0x36af60){this['tail']=this[_0x9978('0x1a')]?this['tail']['finally'](_0x36af60):_0x36af60();};function Dialer(_0x7bbee4,_0x132d7f){this[_0x9978('0x1b')]=new Sequence();this[_0x9978('0x1c')]=_0x132d7f;this[_0x9978('0x1d')]=_0x7bbee4[_0x9978('0x1d')];this[_0x9978('0x1e')]=_0x7bbee4[_0x9978('0x1e')];this['agents']=_0x7bbee4[_0x9978('0x1f')];this[_0x9978('0x20')]=_0x7bbee4[_0x9978('0x20')];this[_0x9978('0x21')]=config[_0x9978('0x21')]||0x2;this[_0x9978('0x22')]={};this[_0x9978('0x23')]={};this['contactsId']={};this[_0x9978('0x24')]={};this[_0x9978('0x25')]={};this[_0x9978('0x26')]={};this[_0x9978('0x27')]={};this['ivrOriginated']={};this[_0x9978('0x28')]={};this['queueBookedRR']={};this[_0x9978('0x29')]={};ami['on'](_0x9978('0x2a'),this[_0x9978('0x2b')]['bind'](this));ami['on'](_0x9978('0x2c'),this[_0x9978('0x2d')][_0x9978('0x2e')](this));ami['on']('originateresponse',this['syncOriginateResponse'][_0x9978('0x2e')](this));ami['on']('agentcomplete',this[_0x9978('0x2f')][_0x9978('0x2e')](this));ami['on'](_0x9978('0x30'),this['syncQueueSummary'][_0x9978('0x2e')](this));ami['on'](_0x9978('0x31'),this[_0x9978('0x32')][_0x9978('0x2e')](this));ami['on']('hangup',this[_0x9978('0x33')]['bind'](this));ami['on']('newexten',this[_0x9978('0x34')][_0x9978('0x2e')](this));ami['on']('varset',this[_0x9978('0x35')][_0x9978('0x2e')](this));ami['on'](_0x9978('0x36'),this[_0x9978('0x37')]['bind'](this));ami['on'](_0x9978('0x38'),this[_0x9978('0x39')][_0x9978('0x2e')](this));this[_0x9978('0x3a')]();this['loopClearZombieChannels']();RpcSetting[_0x9978('0x3b')]()[_0x9978('0x3c')](function(_0x4afa57){previewRecallmeReminderInterval=_0x4afa57[_0x9978('0x3d')];});}function isNotNull(_0x3f1a4d){return _0x3f1a4d!==null&&!_[_0x9978('0x3e')](_0x3f1a4d);}function msgResponse(_0x476d4a,_0x233e01,_0x4aad7d){return{'action':_0x476d4a,'response':_0x233e01,'message':_0x4aad7d,'stack':_0x4aad7d};}function emit(_0x239830,_0x4c8df0,_0x5d380d){io['to'](_0x239830)[_0x9978('0x3f')](_0x4c8df0,_0x5d380d);}function emitOutboundVoiceQueueSummary(_0x2f3348){if(_0x2f3348[_0x9978('0x40')]==='outbound'){logger[_0x9978('0x41')](_0x9978('0x42'),util[_0x9978('0x43')](_0x2f3348,{'showHidden':![],'depth':null}));emit(util[_0x9978('0x44')](_0x9978('0x45'),_0x2f3348[_0x9978('0x46')]),_0x9978('0x47'),_0x2f3348);}}function checkGetDataPredictive(_0x2f8545){if(isNotNull(_0x2f8545)&&!_['isEmpty'](_0x2f8545)){loggerPredictive['info'](_0x9978('0x48'));loggerPredictive[_0x9978('0x49')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2f8545[_0x9978('0x4a')]);loggerPredictive[_0x9978('0x49')](_0x9978('0x4b'),_0x2f8545['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x9978('0x49')](_0x9978('0x4c'),_0x2f8545['predictiveIntervalDroppedCallsTimeout']);loggerPredictive['info'](_0x9978('0x4d'),_0x2f8545['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x9978('0x49')](_0x9978('0x4e'),_0x2f8545[_0x9978('0x4f')]);loggerPredictive[_0x9978('0x49')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2f8545[_0x9978('0x50')]);loggerPredictive['info'](_0x9978('0x51'));if(_0x2f8545[_0x9978('0x4a')]>0x0){if(!_['isUndefined'](_0x2f8545['predictiveIntervalAvgTalktime'])&&_0x2f8545[_0x9978('0x50')]>0x0){return!![];}loggerPredictive['info'](_0x9978('0x52'));if(!_[_0x9978('0x3e')](_0x2f8545['predictiveIntervalAvgHoldtime'])&&_0x2f8545[_0x9978('0x4f')]>0x0){return!![];}loggerPredictive[_0x9978('0x49')](_0x9978('0x53'));}else{loggerPredictive['info'](_0x9978('0x54'));}}else{loggerPredictive[_0x9978('0x49')](_0x9978('0x55'));}return![];}function mergeDataErlangB(_0x5b20d0){return function(_0x40b9ff){loggerPredictive[_0x9978('0x49')](_0x9978('0x56'));loggerPredictive[_0x9978('0x49')](_0x9978('0x57'),_0x40b9ff['erlangCalls']);loggerPredictive['info'](_0x9978('0x58'),_0x40b9ff[_0x9978('0x59')]);loggerPredictive['info'](_0x9978('0x5a'),_0x40b9ff[_0x9978('0x5b')]);loggerPredictive['info'](_0x9978('0x5c'),_0x40b9ff['erlangBusyFactor']);loggerPredictive[_0x9978('0x49')](_0x9978('0x5a'),_0x40b9ff[_0x9978('0x5b')]);loggerPredictive['info'](_0x9978('0x51'));_[_0x9978('0x5d')](_0x5b20d0,_0x40b9ff);};}function ifInterval(_0x2c8c63,_0x2dafad){if(_['isUndefined'](_0x2dafad)){return![];}return utils[_0x9978('0x5e')](undefined,_0x2dafad)<_0x2c8c63*0x3c;}function clearPredictiveAttributes(_0x2ef85b){if(_0x2ef85b[_0x9978('0x27')]){_0x2ef85b[_0x9978('0x27')]=undefined;loggerPredictive[_0x9978('0x41')](_0x2ef85b['name'],_0x9978('0x5f'));}if(_0x2ef85b[_0x9978('0x26')]){_0x2ef85b[_0x9978('0x26')]=undefined;loggerPredictive[_0x9978('0x41')](_0x2ef85b[_0x9978('0x46')],'startPredictive\x20value\x20cleared');}if(_0x2ef85b[_0x9978('0x60')]){clearInterval(_0x2ef85b[_0x9978('0x60')]);_0x2ef85b[_0x9978('0x60')]=undefined;loggerPredictive['debug'](_0x2ef85b[_0x9978('0x46')],_0x9978('0x61'));}}function loggerCatchPredictive(_0x38cd8d,_0x297d96){return function(_0x54bba9){loggerPredictive[_0x9978('0x62')](_0x297d96[_0x9978('0x46')],_0x38cd8d);loggerPredictive[_0x9978('0x62')](_0x54bba9['stack']);clearPredictiveAttributes(_0x297d96);};}function loggerCatch(_0x4103f3){return function(_0x35b8aa){logger[_0x9978('0x62')](_0x4103f3,util[_0x9978('0x43')](_0x35b8aa,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x40fa51,_0x2bd447,_0xc488b2){return function(_0x2023f1){utils[_0x9978('0x63')](_0x2bd447,_0xc488b2,0x0);_0x2bd447[_0x9978('0x64')]=0x0;logger[_0x9978('0x62')](_0x40fa51,util[_0x9978('0x43')](_0x2023f1,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0xb347b9){return function(_0x48bf4c){if(isNotNull(_0x48bf4c)&&isNotNull(_0x48bf4c[0x0])){if(_0x48bf4c[0x0][_0x9978('0x65')]>0x0){_0xb347b9['message']=utils[_0x9978('0x66')][_0x9978('0x67')];logger['info']('[getContactDialer2][ReScheduled]'+_0xb347b9[_0x9978('0x46')],_0x48bf4c[0x0][_0x9978('0x65')],_0x9978('0x68'));}else{_0xb347b9['message']=utils[_0x9978('0x66')][_0x9978('0x69')];logger[_0x9978('0x49')](_0x9978('0x6a')+_0xb347b9[_0x9978('0x46')]);}}};}function createObjHistory(_0x16249b,_0x2a69b8,_0x16523d,_0x328e61,_0xf6e776){_0x16249b[_0x9978('0x6b')]=_0x16523d;var _0x41ff1a=new Action(_0x16249b,_0x2a69b8);var _0x3cb421=new History(_0x41ff1a);_0x3cb421['state']=_0x328e61;_0x3cb421['statedesc']=_0xf6e776;_0x3cb421[_0x9978('0x6c')]=_0x41ff1a[_0x9978('0x6d')];return _0x3cb421;}function unlockQueueStatus(_0xd99079,_0xfa705d){setTimeout(function(){if(_[_0x9978('0x3e')](_0xd99079[_0x9978('0x6e')])){loggerBooked[_0x9978('0x62')](_0x9978('0x6f'),_0xfa705d);}_0xd99079[_0x9978('0x6e')]=!![];loggerBooked[_0x9978('0x49')](_0x9978('0x70'),_0xfa705d,JSON[_0x9978('0x71')](_[_0x9978('0x72')](_0xd99079,['name',_0x9978('0x6e')])));},0x1f3);}function checkInterval(_0x16eb55){return function(){if(!isNotNull(_0x16eb55[_0x9978('0x73')])){_0x16eb55['message']=utils['CAMPAIGN_STATUS']['NULL_INTERVAL'];throw _0x16eb55[_0x9978('0x46')]+_0x9978('0x74');}if(!isNotNull(_0x16eb55[_0x9978('0x73')][_0x9978('0x75')])){_0x16eb55[_0x9978('0x6b')]=utils['CAMPAIGN_STATUS'][_0x9978('0x76')];throw _0x16eb55[_0x9978('0x46')]+_0x9978('0x74');}if(!isNotNull(_[_0x9978('0x77')](_0x16eb55[_0x9978('0x73')][_0x9978('0x75')]))){_0x16eb55[_0x9978('0x6b')]=utils[_0x9978('0x66')][_0x9978('0x76')];throw _0x16eb55[_0x9978('0x46')]+_0x9978('0x74');}};}function checkIsIVRCampaignActive(_0x1bd05c){return function(){if(!utils[_0x9978('0x78')](_0x1bd05c)){_0x1bd05c[_0x9978('0x6b')]=utils[_0x9978('0x66')][_0x9978('0x79')];throw _0x1bd05c[_0x9978('0x46')]+_0x9978('0x7a');}};}function emitCampaignSummary(_0x137f71){if(utils[_0x9978('0x7b')](_0x137f71)){emit(util[_0x9978('0x44')]('campaign:ivr:%s',_0x137f71[_0x9978('0x46')]),_0x9978('0x7c'),_0x137f71);}}function loggerCatchQueueSummary(_0x27a309,_0x2600b2){return function(_0x6cd125){clearPredictiveAttributes(_0x2600b2);emitCampaignSummary(_0x2600b2);loggerSyncQueueSummary[_0x9978('0x41')](_0x27a309,util['inspect'](_0x6cd125,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x375a0a){if(_0x375a0a['sendMessageOneNotActive']){if(_0x375a0a[_0x9978('0x7d')]===0x0){_0x375a0a[_0x9978('0x7e')]=![];_0x375a0a[_0x9978('0x6b')]=utils[_0x9978('0x66')][_0x9978('0x79')];loggerSyncQueueSummary[_0x9978('0x41')](_0x9978('0x7f'),_0x375a0a[_0x9978('0x46')],'is\x20not\x20active');}else{_0x375a0a['message']=utils[_0x9978('0x66')][_0x9978('0x80')];loggerSyncQueueSummary[_0x9978('0x41')](_0x9978('0x7f'),_0x375a0a[_0x9978('0x46')],_0x9978('0x81'));}emitCampaignSummary(_0x375a0a);}}function myreject(_0xa32f96){return function(_0x109579){return _0xa32f96(msgResponse(_0x9978('0x82'),_0x9978('0x83'),JSON['stringify'](_0x109579)));};}Dialer[_0x9978('0x18')][_0x9978('0x84')]=function(_0x30efd2){return!_['isUndefined'](_0x30efd2)&&_0x30efd2&&!_[_0x9978('0x3e')](_0x30efd2[_0x9978('0x46')])&&!_[_0x9978('0x3e')](_0x30efd2['active'])&&_0x30efd2['active']&&(this['trunks'][util[_0x9978('0x44')](_0x9978('0x85'),_0x30efd2[_0x9978('0x46')])][_0x9978('0x86')]===_0x9978('0x87')||this[_0x9978('0x20')][util[_0x9978('0x44')](_0x9978('0x85'),_0x30efd2[_0x9978('0x46')])]['status']==='unmonitored');};Dialer[_0x9978('0x18')][_0x9978('0x88')]=function(_0x3ef491){var _0x13f0f0=this;return function(){if(!_0x13f0f0[_0x9978('0x84')](_0x3ef491[_0x9978('0x89')])){if(!_0x13f0f0['isTrunkReachable'](_0x3ef491['TrunkBackup'])){_0x3ef491['message']=utils[_0x9978('0x66')]['TRUNK_NOT_REACHABLE'];throw _0x3ef491[_0x9978('0x46')]+_0x9978('0x8a');}}};};Dialer[_0x9978('0x18')][_0x9978('0x8b')]=function(_0x13f64c,_0x258ff1,_0x4ebd79,_0x4feab1){var _0x2390d5=this;return function(){var _0x4c77ea=!![];return _0x2390d5[_0x9978('0x8c')](_0x13f64c,_0x258ff1,_0x4ebd79,_0x4feab1,_0x4c77ea);};};Dialer[_0x9978('0x18')]['checkIfTimeIntervals']=function(_0x16f81a,_0x2749a3,_0xe50039,_0x3c8674){var _0x20b2ca=this;return function(){var _0x80beae=![];return _0x20b2ca['ifTimeIvr'](_0x16f81a[_0x9978('0x75')],_0x2749a3,_0xe50039,_0x3c8674,_0x80beae);};};Dialer['prototype'][_0x9978('0x8c')]=function(_0x4599b7,_0x21ca93,_0xd19f5c,_0x362b9b,_0x459c47){var _0x1f189b=[];return new Promise(function(_0x87d103,_0x4cad4d){if(!isNotNull(_0x4599b7)){_0x362b9b[_0x9978('0x6b')]=utils[_0x9978('0x66')]['NULL_INTERVAL'];return _0x4cad4d(msgResponse('ifTime',_0x9978('0x8d'),_0xd19f5c+'\x20Intervals\x20is\x20null\x20'));}if(_[_0x9978('0x77')](_0x4599b7)){_0x362b9b[_0x9978('0x6b')]=utils[_0x9978('0x66')][_0x9978('0x8e')];return _0x4cad4d(msgResponse(_0x9978('0x8f'),_0x9978('0x8d'),_0xd19f5c+_0x9978('0x90')));}if(_0x21ca93&&_['isUndefined'](config['timezones'][_0x21ca93])){_0x362b9b[_0x9978('0x6b')]=utils['CAMPAIGN_STATUS'][_0x9978('0x91')];return _0x4cad4d(msgResponse('ifTime','Failure',_0xd19f5c+_0x9978('0x92')+_0x21ca93));}if(_[_0x9978('0x93')](_0x4599b7)){for(var _0x362e21=0x0;_0x362e21<_0x4599b7[_0x9978('0x94')];_0x362e21+=0x1){_0x1f189b[_0x9978('0x95')](ami[_0x9978('0x96')]({'action':'command','command':util['format'](_0x9978('0x97'),_0x4599b7[_0x362e21]['interval'],!_[_0x9978('0x3e')](config[_0x9978('0x98')][_0x21ca93])?_0x21ca93:'')})[_0x9978('0x3c')](function(_0x595b47){return _0x595b47['content'][_0x9978('0x99')](_0x9978('0x9a'))>=0x0;})[_0x9978('0x9b')](myreject(_0x4cad4d)));}}else{_0x1f189b[_0x9978('0x95')](ami[_0x9978('0x96')]({'action':'command','command':util[_0x9978('0x44')](_0x9978('0x97'),_0x4599b7,!_[_0x9978('0x3e')](config['timezones'][_0x21ca93])?_0x21ca93:'')})['then'](function(_0x392cb3){return _0x392cb3[_0x9978('0x9c')][_0x9978('0x99')]('true')>=0x0;})[_0x9978('0x9b')](myreject(_0x4cad4d)));}Promise[_0x9978('0x9d')](_0x1f189b)[_0x9978('0x3c')](function(_0x3e8f09){var _0x330782=_[_0x9978('0x9e')](_0x3e8f09);if(_0x330782){return _0x87d103(_0x330782);}else{_0x362b9b[_0x9978('0x6b')]=_0x459c47?utils['CAMPAIGN_STATUS'][_0x9978('0x9f')]:utils[_0x9978('0x66')][_0x9978('0xa0')];return _0x4cad4d(msgResponse('[ifTime][promiseAll]','Failure',_0x9978('0xa1')+_0x459c47+'\x20'+_0xd19f5c+'\x20Interval\x20is\x20overtime:\x20'+util[_0x9978('0x43')](_0x4599b7,{'showHidden':![],'depth':null})+_0x9978('0xa2')+_0x21ca93));}})[_0x9978('0x9b')](function(_0xd0ab37){return _0x4cad4d(msgResponse(_0x9978('0x8f'),_0x9978('0x8d'),JSON['stringify'](_0xd0ab37)));});});};Dialer[_0x9978('0x18')]['loopCampaigns']=function(){var _0x265152=this;return cmHopper[_0x9978('0xa3')]({'active':![]},{'where':{'active':!![]}})[_0x9978('0x3c')](function(){setInterval(function(){_0x265152['syncCampaigns']();},0x3e8);});};Dialer[_0x9978('0x18')]['syncCampaigns']=function(){var _0x2b5c1a=this;var _0x59e272;for(var _0x247ad2 in this['campaigns']){if(typeof this['campaigns'][_0x247ad2]!==_0x9978('0xa4')){_0x59e272=this['campaigns'][_0x247ad2];if(utils['isIVRCampaign'](_0x59e272)&&utils[_0x9978('0x78')](_0x59e272)){_0x59e272['sendMessageOneNotActive']=!![];Promise[_0x9978('0xa5')]()[_0x9978('0x3c')](checkIsIVRCampaignActive(_0x59e272))[_0x9978('0x3c')](checkInterval(_0x59e272))[_0x9978('0x3c')](_0x2b5c1a[_0x9978('0x88')](_0x59e272))['then'](_0x2b5c1a[_0x9978('0x8b')](_0x59e272[_0x9978('0xa6')],_0x59e272[_0x9978('0xa7')],_0x59e272[_0x9978('0x46')],_0x59e272))[_0x9978('0x3c')](_0x2b5c1a[_0x9978('0xa8')](_0x59e272[_0x9978('0x73')],_0x59e272[_0x9978('0xa7')],_0x59e272[_0x9978('0x46')],_0x59e272))[_0x9978('0x3c')](_0x2b5c1a[_0x9978('0xa9')](_0x59e272))[_0x9978('0x9b')](loggerCatchQueueSummary(_0x9978('0xaa'),_0x59e272));}else{notSendMessagesCampaign(_0x59e272);}}}};Dialer[_0x9978('0x18')][_0x9978('0xab')]=function(_0xce591e){if(_0xce591e[_0x9978('0xac')]!=='predictive'){clearPredictiveAttributes(_0xce591e);}switch(_0xce591e[_0x9978('0xac')]){case'progressive':this[_0x9978('0xad')](_0xce591e,0x1);break;case _0x9978('0xae'):this[_0x9978('0xad')](_0xce591e,_0xce591e[_0x9978('0xaf')]);break;case _0x9978('0xb0'):this[_0x9978('0xb0')](_0xce591e);break;case'booked':this[_0x9978('0xad')](_0xce591e,0x1);break;default:logger[_0x9978('0x62')](_0x9978('0xb1'),_0xce591e[_0x9978('0x46')],_0x9978('0xb2'));}};Dialer[_0x9978('0x18')]['ifTime']=function(_0x4b182e,_0x38c9f3){var _0x443a86=_0x4b182e[_0x9978('0xa7')];var _0x36b6d7=_0x38c9f3?_0x4b182e[_0x9978('0xa6')]:_0x4b182e['Interval'][_0x9978('0x75')];logger[_0x9978('0xb3')](_0x9978('0xb4'),_0x36b6d7,_0x443a86,_0x4b182e['name'],util[_0x9978('0x44')](_0x9978('0xb5'),_0x4b182e[_0x9978('0x46')],_0x4b182e['id']));var _0x53e561=null;return Interval[_0x9978('0xb6')](_0x36b6d7,_0x443a86)[_0x9978('0x3c')](function(_0x577886){if(_0x577886===!![]){return _0x577886;}else{_0x4b182e['message']=_0x38c9f3?utils[_0x9978('0x66')]['OVERTIME_GLOBAL_INTERVAL']:utils[_0x9978('0x66')][_0x9978('0xa0')];_0x53e561=msgResponse('[ifTime][promiseAll]','Failure','Global:\x20'+_0x38c9f3+'\x20'+_0x4b182e[_0x9978('0x46')]+_0x9978('0xb7')+util[_0x9978('0x43')](_0x36b6d7,{'showHidden':![],'depth':null})+_0x9978('0xa2')+_0x443a86);}if(_0x53e561!==null){logger[_0x9978('0xb3')]('Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:',_0x53e561);_0x53e561[_0x9978('0xb8')]=_0x38c9f3;throw _0x53e561;}})[_0x9978('0x9b')](function(_0x5a5cb7){logger[_0x9978('0x62')]('AMI\x20IfTime',_0x5a5cb7);throw msgResponse(_0x9978('0x82'),_0x9978('0x83'),util[_0x9978('0x43')](_0x5a5cb7,{'showHidden':![],'depth':null}));});};Dialer[_0x9978('0x18')]['syncAgentConnect']=function(_0x579b14){if(this[_0x9978('0x1d')][_0x579b14[_0x9978('0xb9')]]){if(this['uniqueId'][_0x579b14[_0x9978('0xba')]]&&this[_0x9978('0x24')][_0x579b14[_0x9978('0xba')]][_0x9978('0x40')]!==_0x9978('0xbb')){this[_0x9978('0xbc')](this['voiceQueues'][_0x579b14[_0x9978('0xb9')]]);this[_0x9978('0x24')][_0x579b14[_0x9978('0xba')]][_0x9978('0xbd')]=moment()[_0x9978('0x44')](_0x9978('0xbe'));}}};Dialer['prototype'][_0x9978('0x2f')]=function(_0x22da9f){var _0x1d3f24=this[_0x9978('0x24')][_0x22da9f[_0x9978('0xba')]];if(this[_0x9978('0x1d')][_0x22da9f[_0x9978('0xb9')]]){if(_0x1d3f24&&_0x1d3f24[_0x9978('0x40')]!=='ivr'){delete this['uniqueId'][_0x22da9f[_0x9978('0xba')]];this[_0x9978('0x1d')][_0x22da9f[_0x9978('0xb9')]]['outboundAnswerCallsDay']+=0x1;var _0x2d3d7d=new AgentComplete(_0x1d3f24,_0x22da9f);if(_0x22da9f[_0x9978('0xbf')]==='agent'){_0x2d3d7d[_0x9978('0xc0')]=this['voiceQueues'][_0x22da9f[_0x9978('0xb9')]][_0x9978('0xc1')]&&this['voiceQueues'][_0x22da9f[_0x9978('0xb9')]]['dialAgiAfterHangupAgent']?moment()['format'](_0x9978('0xbe')):undefined;}hopperUtils[_0x9978('0xc2')](_0x2d3d7d)['catch'](loggerCatch(_0x9978('0xc3')));hopperUtils[_0x9978('0xc4')](_0x2d3d7d)['catch'](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x9978('0x18')]['syncQueueCallerAbandon']=function(_0x31aefc){var _0x57ec15=this[_0x9978('0x24')][_0x31aefc['uniqueid']];var _0x45d30a=this;var _0x2b3a7a=![];var _0x2353f3;var _0x2ba650;if(this['voiceQueues'][_0x31aefc[_0x9978('0xb9')]]){if(_0x57ec15&&_0x57ec15[_0x9978('0x40')]!==_0x9978('0xbb')){delete this[_0x9978('0x24')][_0x31aefc['uniqueid']];this[_0x9978('0xbc')](this[_0x9978('0x1d')][_0x31aefc['queue']]);_0x57ec15[_0x9978('0xc5')]=moment()[_0x9978('0x44')](_0x9978('0xbe'));var _0x1f0275=new QueueCallerAbandon(_0x57ec15,_0x31aefc);if(utils[_0x9978('0x5e')](_0x57ec15[_0x9978('0xc5')],_0x57ec15[_0x9978('0xc6')])>=_0x57ec15[_0x9978('0xc7')]){this[_0x9978('0x1d')][_0x31aefc['queue']]['predictiveIntervalDroppedCallsTimeout']+=0x1;this['voiceQueues'][_0x31aefc[_0x9978('0xb9')]][_0x9978('0xc8')]+=0x1;this['voiceQueues'][_0x31aefc[_0x9978('0xb9')]][_0x9978('0xc9')]+=0x1;_0x1f0275[_0x9978('0xca')]=0xa;_0x1f0275[_0x9978('0xcb')]=_0x9978('0xcc');_0x1f0275[_0x9978('0xcd')]='TIMEOUT';_0x1f0275['agiafterat']=this['voiceQueues'][_0x31aefc[_0x9978('0xb9')]][_0x9978('0xc1')]?moment()[_0x9978('0x44')](_0x9978('0xbe')):undefined;_0x1f0275['countdropretry']+=0x1;_0x1f0275[_0x9978('0xce')]+=0x1;_0x2353f3=this[_0x9978('0x1d')][_0x31aefc[_0x9978('0xb9')]][_0x9978('0xcf')];_0x2ba650=this[_0x9978('0x1d')][_0x31aefc[_0x9978('0xb9')]][_0x9978('0xd0')];hopperUtils[_0x9978('0xd1')](_0x1f0275,_0x1f0275['state'],_0x57ec15['voiceQueue'])[_0x9978('0x3c')](function(_0x24c148){_0x2b3a7a=_0x24c148[_0x9978('0xd2')]==0x1;if(_0x1f0275[_0x9978('0xd3')]>=_0x45d30a[_0x9978('0x1d')][_0x31aefc[_0x9978('0xb9')]][_0x9978('0xd4')]){_0x45d30a[_0x9978('0xd5')](_0x1f0275,_0x24c148['additional']);}else{hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x1f0275[_0x9978('0xd3')],'scheduledat':moment()[_0x9978('0xd6')](_0x45d30a[_0x9978('0x1d')][_0x31aefc[_0x9978('0xb9')]][_0x9978('0xcf')],_0x9978('0xd7'))[_0x9978('0x44')](_0x9978('0xbe')),'ContactId':_0x57ec15[_0x9978('0xd8')],'ListId':_0x57ec15[_0x9978('0xd9')],'VoiceQueueId':_0x57ec15[_0x9978('0xda')]||undefined,'CampaignId':_0x57ec15[_0x9978('0xdb')]||undefined})[_0x9978('0x9b')](loggerCatch(_0x9978('0xdc')));var _0x2940d9=new History(_0x1f0275);_0x2940d9['state']=0xa;_0x2940d9[_0x9978('0xcb')]=_0x9978('0xcc');_0x2940d9['starttime']=moment()['format'](_0x9978('0xbe'));_0x2940d9[_0x9978('0x6c')]=_0x2940d9[_0x9978('0x6d')];_0x2940d9[_0x9978('0xdd')]=_0x1f0275[_0x9978('0xdd')];_0x2940d9[_0x9978('0xde')]=_0x1f0275['calleridnum'];hopperUtils[_0x9978('0xc2')](_0x2940d9)[_0x9978('0x9b')](loggerCatch('[syncAgentComplete][createHistory][10]'));}})[_0x9978('0x3c')](function(){if(_0x2b3a7a)hopperUtils[_0x9978('0xdf')](_0x1f0275,_0x2353f3,_0x2ba650)['then'](function(){return 0x1;});});}else{this[_0x9978('0x1d')][_0x31aefc[_0x9978('0xb9')]][_0x9978('0xe0')]+=0x1;this[_0x9978('0x1d')][_0x31aefc['queue']][_0x9978('0xe1')]+=0x1;_0x1f0275['state']=0xb;_0x1f0275[_0x9978('0xcb')]='Abandoned';_0x1f0275[_0x9978('0xcd')]=_0x9978('0xe2');_0x1f0275[_0x9978('0xe3')]+=0x1;_0x1f0275[_0x9978('0xce')]+=0x1;_0x2353f3=this[_0x9978('0x1d')][_0x31aefc['queue']][_0x9978('0xe4')];_0x2ba650=this[_0x9978('0x1d')][_0x31aefc['queue']][_0x9978('0xd0')];hopperUtils[_0x9978('0xd1')](_0x1f0275,_0x1f0275[_0x9978('0xca')],_0x57ec15['voiceQueue'])[_0x9978('0x3c')](function(_0x5f59bf){if(_0x1f0275[_0x9978('0xe3')]>=_0x45d30a[_0x9978('0x1d')][_0x31aefc[_0x9978('0xb9')]][_0x9978('0xe5')]){_0x45d30a[_0x9978('0xd5')](_0x1f0275,_0x5f59bf[_0x9978('0xd2')]);}else{hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x1f0275[_0x9978('0xe3')],'scheduledat':moment()['add'](_0x45d30a[_0x9978('0x1d')][_0x31aefc[_0x9978('0xb9')]][_0x9978('0xe4')],_0x9978('0xd7'))[_0x9978('0x44')](_0x9978('0xbe')),'ContactId':_0x57ec15[_0x9978('0xd8')],'ListId':_0x57ec15[_0x9978('0xd9')],'VoiceQueueId':_0x57ec15[_0x9978('0xda')]||undefined,'CampaignId':_0x57ec15[_0x9978('0xdb')]||undefined})[_0x9978('0x9b')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x109952=new History(_0x1f0275);_0x109952[_0x9978('0xca')]=0xb;_0x109952[_0x9978('0xcb')]=_0x9978('0xe6');_0x109952[_0x9978('0x6d')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x109952[_0x9978('0x6c')]=_0x109952[_0x9978('0x6d')];_0x109952['calleridname']=_0x1f0275[_0x9978('0xdd')];_0x109952[_0x9978('0xde')]=_0x1f0275[_0x9978('0xde')];hopperUtils[_0x9978('0xc2')](_0x109952)[_0x9978('0x9b')](loggerCatch('[syncAgentComplete][createHistory][11]'));}})[_0x9978('0x3c')](function(){if(_0x2b3a7a)hopperUtils['swapAdditionalPhones'](_0x1f0275,_0x2353f3,_0x2ba650)[_0x9978('0x3c')](function(){return 0x1;});});}}}};Dialer[_0x9978('0x18')][_0x9978('0x34')]=function(_0x550c1a){if(this[_0x9978('0x23')][_0x550c1a['uniqueid']]){this['actions'][_0x550c1a[_0x9978('0xba')]][_0x9978('0xe7')]=_0x550c1a[_0x9978('0xe7')];}if(this[_0x9978('0x24')][_0x550c1a['uniqueid']]){this['uniqueId'][_0x550c1a[_0x9978('0xba')]][_0x9978('0xe7')]=_0x550c1a[_0x9978('0xe7')];}};Dialer[_0x9978('0x18')][_0x9978('0x37')]=function(_0x24f219){if(!this['actions'][_0x24f219['actionid']]){return;}var _0x572cb9=this['voiceQueues'][this[_0x9978('0x23')][_0x24f219[_0x9978('0xe8')]]['queue']][_0x9978('0xe9')]||'rrmemory';if(_0x572cb9===_0x9978('0xea')){if(this[_0x9978('0x23')][_0x24f219['actionid']]&&_[_0x9978('0xeb')](this[_0x9978('0x23')][_0x24f219[_0x9978('0xe8')]][_0x9978('0xec')])&&_0x24f219[_0x9978('0x86')]==='1'&&_0x24f219[_0x9978('0xed')]==='0'){if(this[_0x9978('0x1f')][_0x24f219['stateinterface']]){if(!this[_0x9978('0x1f')][_0x24f219[_0x9978('0xee')]][_0x9978('0xec')]){this[_0x9978('0x1f')][_0x24f219[_0x9978('0xee')]][_0x9978('0xec')]=!![];this[_0x9978('0x23')][_0x24f219[_0x9978('0xe8')]]['locked']=!![];this[_0x9978('0x23')][_0x24f219['actionid']]['stateinterface']=_0x24f219['stateinterface'];}}}}else if(_0x572cb9==='rrmemory'){if(this['actions'][_0x24f219[_0x9978('0xe8')]]){if(this['agents'][_0x24f219[_0x9978('0xee')]]){this['actions'][_0x24f219[_0x9978('0xe8')]][_0x9978('0xee')]=_0x24f219[_0x9978('0xee')];if(_[_0x9978('0xeb')](this[_0x9978('0x28')][this[_0x9978('0x23')][_0x24f219[_0x9978('0xe8')]][_0x9978('0xb9')]])){this[_0x9978('0x28')][this['actions'][_0x24f219[_0x9978('0xe8')]][_0x9978('0xb9')]]=[];}this['queueBooked'][this[_0x9978('0x23')][_0x24f219[_0x9978('0xe8')]][_0x9978('0xb9')]][_0x9978('0x95')](_[_0x9978('0x5d')](_[_0x9978('0x72')](this['actions'][_0x24f219[_0x9978('0xe8')]],['idHopper','stateinterface']),{'status':_0x24f219[_0x9978('0x86')],'paused':_0x24f219['paused']}));}}}};Dialer[_0x9978('0x18')][_0x9978('0x39')]=function(_0x520ba1){if(!this[_0x9978('0x23')][_0x520ba1['actionid']]){return;}var _0x119286=this;var _0x3ee40d=this[_0x9978('0x1d')][this[_0x9978('0x23')][_0x520ba1[_0x9978('0xe8')]][_0x9978('0xb9')]];var _0x1e7689=_0x3ee40d[_0x9978('0xe9')]||_0x9978('0xef');if(_0x1e7689===_0x9978('0xea')){if(this['actions'][_0x520ba1['actionid']]&&this[_0x9978('0x23')][_0x520ba1[_0x9978('0xe8')]][_0x9978('0xee')]){this[_0x9978('0x1c')]['run'](this['actions'][_0x520ba1[_0x9978('0xe8')]]['idHopper'],this[_0x9978('0x23')][_0x520ba1['actionid']]['stateinterface'])[_0x9978('0x9b')](function(_0x5c670b){logger[_0x9978('0x62')](_0x9978('0xf0'),util[_0x9978('0x43')](_0x5c670b,{'showHidden':![],'depth':null}));})[_0x9978('0xf1')](function(){_0x119286[_0x9978('0xbc')](_0x119286[_0x9978('0x1d')][_0x119286[_0x9978('0x23')][_0x520ba1[_0x9978('0xe8')]][_0x9978('0xb9')]]);_0x119286[_0x9978('0x1f')][_0x119286[_0x9978('0x23')][_0x520ba1[_0x9978('0xe8')]][_0x9978('0xee')]]['locked']=![];delete _0x119286[_0x9978('0x23')][_0x520ba1[_0x9978('0xe8')]];unlockQueueStatus(_0x3ee40d);});}else{this[_0x9978('0xbc')](this[_0x9978('0x1d')][this['actions'][_0x520ba1[_0x9978('0xe8')]][_0x9978('0xb9')]]);hopperUtils[_0x9978('0xf2')]({'active':![],'ContactId':this[_0x9978('0x23')][_0x520ba1['actionid']]['ContactId'],'ListId':this[_0x9978('0x23')][_0x520ba1['actionid']]['ListId'],'VoiceQueueId':this['actions'][_0x520ba1[_0x9978('0xe8')]][_0x9978('0xda')]||undefined,'CampaignId':this[_0x9978('0x23')][_0x520ba1[_0x9978('0xe8')]][_0x9978('0xdb')]||undefined})['catch'](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x9978('0x23')][_0x520ba1['actionid']];unlockQueueStatus(_0x3ee40d);}}else if(_0x1e7689==='rrmemory'){var _0x44a19a;if(this[_0x9978('0x23')][_0x520ba1['actionid']]&&!_['isEmpty'](this['queueBooked'][this[_0x9978('0x23')][_0x520ba1[_0x9978('0xe8')]][_0x9978('0xb9')]])){if(this[_0x9978('0xf3')][_0x119286[_0x9978('0x23')][_0x520ba1[_0x9978('0xe8')]]['queue']]){this[_0x9978('0xf3')][_0x119286[_0x9978('0x23')][_0x520ba1[_0x9978('0xe8')]][_0x9978('0xb9')]]=this['queueBookedRR'][this[_0x9978('0x23')][_0x520ba1[_0x9978('0xe8')]][_0x9978('0xb9')]]?this[_0x9978('0xf3')][this[_0x9978('0x23')][_0x520ba1[_0x9978('0xe8')]][_0x9978('0xb9')]]:this[_0x9978('0x28')][this[_0x9978('0x23')][_0x520ba1[_0x9978('0xe8')]][_0x9978('0xb9')]]?this[_0x9978('0x28')][this[_0x9978('0x23')][_0x520ba1['actionid']]['queue']]['_rr']||0x0:0x0;}this[_0x9978('0x28')][this['actions'][_0x520ba1[_0x9978('0xe8')]][_0x9978('0xb9')]][_0x9978('0xf4')]=this[_0x9978('0xf3')][this[_0x9978('0x23')][_0x520ba1[_0x9978('0xe8')]][_0x9978('0xb9')]];for(var _0x3f40a5=0x0;_0x3f40a5=_0x11d3f9[_0x9978('0x11e')]){_0x432601[_0x9978('0x11f')](_0x57678d,_0x142917,_0x36489b,_0x9978('0x120'));}else{if(_0x57678d[_0x9978('0x117')]>=_0x11d3f9[_0x9978('0x121')]){_0x432601[_0x9978('0x122')](_0x57678d,_0x142917,_0x36489b,_0x9978('0x123'));}else{hopperUtils[_0x9978('0xf2')]({'active':![],'countmachineretry':_0x57678d[_0x9978('0x117')],'scheduledat':moment()[_0x9978('0xd6')](_0x11d3f9['dialMachineRetryFrequency'],_0x9978('0xd7'))[_0x9978('0x44')](_0x9978('0xbe')),'ContactId':_0x57678d[_0x9978('0xd8')],'ListId':_0x57678d[_0x9978('0xd9')],'VoiceQueueId':_0x57678d[_0x9978('0xda')]||undefined,'CampaignId':_0x57678d[_0x9978('0xdb')]||undefined})['catch'](loggerCatch(_0x9978('0x124')));_0x142917({'reschedule':0x1});}}});}if(_0x14c63e['type']===_0x9978('0xbb')&&this[_0x9978('0x1e')][_0x14c63e[_0x9978('0xb9')]][_0x9978('0x108')]&&_0x4fee07[_0x9978('0x109')]===_0x9978('0x10a')){delete this['uniqueId'][_0x4fee07[_0x9978('0xba')]];this[_0x9978('0xbc')](this[_0x9978('0x1e')][_0x14c63e[_0x9978('0xb9')]]);_0x5c1761=new Hangup(_0x14c63e,_0x4fee07);_0x5c1761[_0x9978('0xca')]=0x12;_0x5c1761[_0x9978('0xcb')]='HangupInAMD';_0x5c1761['membername']=_0x9978('0x10f');ami[_0x9978('0x3f')](_0x9978('0x110'),ut[_0x9978('0x111')](_0x5c1761,_0x9978('0x112')));this['saveInDb'](_0x5c1761,'[syncHangupInAMDIvr][createHistory]',_0x9978('0x125'));}if(_0x14c63e[_0x9978('0x40')]===_0x9978('0xbb')&&this[_0x9978('0x1e')][_0x14c63e[_0x9978('0xb9')]]['dialAMDActive']&&_0x4fee07[_0x9978('0x109')]==='MACHINE'){return new Promise(function(_0x14f777,_0x691760){delete _0x432601[_0x9978('0x24')][_0x4fee07['uniqueid']];_0x432601['updateOriginated'](_0x432601[_0x9978('0x1e')][_0x14c63e[_0x9978('0xb9')]]);_0x432601[_0x9978('0x1e')][_0x14c63e[_0x9978('0xb9')]][_0x9978('0x10b')]+=0x1;_0x432601[_0x9978('0x1e')][_0x14c63e['queue']][_0x9978('0x10c')]+=0x1;var _0x5d5f69=_0x432601[_0x9978('0x1e')][_0x14c63e['queue']];var _0x240981=new Hangup(_0x14c63e,_0x4fee07);_0x240981[_0x9978('0xca')]=0x13;_0x240981[_0x9978('0xcb')]=_0x9978('0x116');_0x240981[_0x9978('0x10e')]=_0x9978('0x10f');_0x240981[_0x9978('0x117')]+=0x1;_0x240981['countglobal']+=0x1;_0x240981[_0x9978('0x112')]=!![];ami[_0x9978('0x3f')](_0x9978('0x110'),ut[_0x9978('0x111')](_0x240981,_0x9978('0x112')));hopperUtils[_0x9978('0xc2')](_0x240981)[_0x9978('0x9b')](loggerCatch(_0x9978('0x118')));if(_0x240981[_0x9978('0x119')]+_0x240981[_0x9978('0x11a')]+_0x240981[_0x9978('0x11b')]+_0x240981[_0x9978('0x11c')]+_0x240981[_0x9978('0xd3')]+_0x240981[_0x9978('0xe3')]+_0x240981[_0x9978('0x117')]+_0x240981['countagentrejectretry']>=_0x5d5f69[_0x9978('0x11e')]){_0x432601[_0x9978('0x11f')](_0x240981,_0x14f777,_0x691760,'reason19\x20machine....');}else{if(_0x240981[_0x9978('0x117')]>=_0x5d5f69[_0x9978('0x121')]){_0x432601[_0x9978('0x122')](_0x240981,_0x14f777,_0x691760,_0x9978('0x123'));}else{hopperUtils[_0x9978('0xf2')]({'active':![],'countmachineretry':_0x240981[_0x9978('0x117')],'scheduledat':moment()[_0x9978('0xd6')](_0x5d5f69['dialMachineRetryFrequency'],'minutes')[_0x9978('0x44')](_0x9978('0xbe')),'ContactId':_0x240981['ContactId'],'ListId':_0x240981[_0x9978('0xd9')],'VoiceQueueId':_0x240981[_0x9978('0xda')]||undefined,'CampaignId':_0x240981[_0x9978('0xdb')]||undefined})[_0x9978('0x9b')](loggerCatch('[rescheduleContact][Machine]'));_0x14f777({'reschedule':0x1});}}});}}};Dialer[_0x9978('0x18')][_0x9978('0x33')]=function(_0x881225){var _0x12d161=this[_0x9978('0x24')][_0x881225['uniqueid']];var _0x3313b1;if(_0x12d161&&_0x12d161[_0x9978('0x40')]===_0x9978('0xbb')){delete this[_0x9978('0x24')][_0x881225['uniqueid']];this['updateOriginated'](this[_0x9978('0x1e')][_0x12d161[_0x9978('0xb9')]]);this[_0x9978('0x1e')][_0x12d161[_0x9978('0xb9')]][_0x9978('0x126')]+=0x1;_0x3313b1=new Hangup(_0x12d161,_0x881225);hopperUtils[_0x9978('0xc2')](_0x3313b1)[_0x9978('0x9b')](loggerCatch(_0x9978('0x127')));hopperUtils[_0x9978('0xc4')](_0x3313b1)[_0x9978('0x9b')](loggerCatch(_0x9978('0x128')));}if(_0x12d161&&_0x12d161[_0x9978('0x40')]!=='ivr'&&isNotNull(this[_0x9978('0x1d')][_0x12d161[_0x9978('0xb9')]]['dialQueueProject'])){delete this['uniqueId'][_0x881225[_0x9978('0xba')]];this[_0x9978('0xbc')](this[_0x9978('0x1d')][_0x12d161[_0x9978('0xb9')]]);this[_0x9978('0x1d')][_0x12d161['queue']][_0x9978('0x10b')]+=0x1;this[_0x9978('0x1d')][_0x12d161['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x3313b1=new Hangup(_0x12d161,_0x881225);_0x3313b1[_0x9978('0xca')]=0x10;_0x3313b1['statedesc']=_0x9978('0x129');_0x3313b1[_0x9978('0x10e')]=_0x9978('0x12a');hopperUtils[_0x9978('0xc2')](_0x3313b1)[_0x9978('0x9b')](loggerCatch(_0x9978('0x127')));hopperUtils['moveContactManagedDialer'](_0x3313b1)[_0x9978('0x9b')](loggerCatch('[syncHangupIvr]'));}if(_0x12d161&&_0x12d161[_0x9978('0x40')]!==_0x9978('0xbb')&&!isNotNull(this['voiceQueues'][_0x12d161['queue']][_0x9978('0x12b')])){if(_0x881225['cause-txt']===_0x9978('0x12c')){delete this[_0x9978('0x24')][_0x881225['uniqueid']];this[_0x9978('0x1d')][_0x12d161[_0x9978('0xb9')]]['outboundAnswerCallsDay']+=0x1;const _0x569075=new AgentComplete(_0x12d161,_0x881225);_0x569075[_0x9978('0xdb')]=this[_0x9978('0x1d')][_0x12d161[_0x9978('0xb9')]]['id'];hopperUtils[_0x9978('0xc2')](_0x569075)['catch'](loggerCatch(_0x9978('0xc3')));hopperUtils[_0x9978('0xc4')](_0x569075)[_0x9978('0x9b')](loggerCatch(_0x9978('0x12d')));}else{delete this[_0x9978('0x24')][_0x881225[_0x9978('0xba')]];this[_0x9978('0xbc')](this[_0x9978('0x1d')][_0x12d161[_0x9978('0xb9')]]);this[_0x9978('0x1d')][_0x12d161[_0x9978('0xb9')]][_0x9978('0x12e')]+=0x1;_0x3313b1=new Hangup(_0x12d161,_0x881225);_0x3313b1[_0x9978('0xca')]=0xc;_0x3313b1[_0x9978('0xcb')]=_0x881225[_0x9978('0x12f')];_0x3313b1[_0x9978('0x10e')]=_0x9978('0x130');hopperUtils['createHistory'](_0x3313b1)[_0x9978('0x9b')](loggerCatch(_0x9978('0x127')));hopperUtils['moveContactManagedDialer'](_0x3313b1)[_0x9978('0x9b')](loggerCatch(_0x9978('0x128')));}}};Dialer['prototype'][_0x9978('0x8')]=function(_0x2ac8e7){var _0x352516=this;if(!_0x352516[_0x9978('0x29')][_0x2ac8e7[_0x9978('0x46')]]){_0x352516['queuesSummary'][_0x2ac8e7[_0x9978('0x46')]]={'running':![]};}else if(_0x352516['queuesSummary'][_0x2ac8e7[_0x9978('0x46')]][_0x9978('0x131')]===!![]){return;}else if(_0x352516[_0x9978('0x29')][_0x2ac8e7[_0x9978('0x46')]][_0x9978('0x131')]===![]){_0x352516['queuesSummary'][_0x2ac8e7[_0x9978('0x46')]][_0x9978('0x131')]=!![];}var _0x23a2fc=_0x352516[_0x9978('0x1d')][_0x2ac8e7[_0x9978('0x46')]];var _0x4ab2c7=_0x23a2fc[_0x9978('0x6b')]!==utils['CAMPAIGN_STATUS'][_0x9978('0x79')];var _0x49d600=utils[_0x9978('0x132')](_0x23a2fc);_0x23a2fc[_0x9978('0x133')]=utils['getQueueCampaignStatusMessage'](_0x23a2fc,_0x352516[_0x9978('0x20')]);Promise[_0x9978('0xa5')]()[_0x9978('0x3c')](function(){if(_0x23a2fc['statusMessage']===utils[_0x9978('0x66')][_0x9978('0x79')]){if(_0x4ab2c7){clearPredictiveAttributes(_0x23a2fc);_0x2ac8e7[_0x9978('0x26')]=undefined;_0x2ac8e7[_0x9978('0x27')]=undefined;}if(_0x23a2fc['statusMessage']===utils[_0x9978('0x66')]['INACTIVE']){_0x2ac8e7[_0x9978('0x134')]=0x0;_0x2ac8e7[_0x9978('0xed')]=0x0;_0x2ac8e7[_0x9978('0x135')]=0x0;_0x2ac8e7['talking']=0x0;_0x2ac8e7[_0x9978('0x136')]=0x0;}}else if(_0x23a2fc['statusMessage']===utils['CAMPAIGN_STATUS'][_0x9978('0x137')]&&!_0x49d600){return _0x352516[_0x9978('0x8f')](_0x23a2fc,!![])[_0x9978('0x3c')](function(){return _0x352516[_0x9978('0x8f')](_0x23a2fc,![]);})[_0x9978('0x3c')](function(){return _0x352516[_0x9978('0xab')](_0x23a2fc);})['catch'](function(_0x4e2d6f){loggerSyncQueueSummary[_0x9978('0x41')](_0x9978('0x138'),util['inspect'](_0x4e2d6f,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x23a2fc);});}else{clearPredictiveAttributes(_0x23a2fc);}})['then'](function(){var _0x5c987b=_0x2ac8e7[_0x9978('0x139')](_0x23a2fc);if(_0x5c987b||_0x23a2fc[_0x9978('0x13a')]){_0x23a2fc['queueSummaryCountersUpdated']=![];_0x2ac8e7['updateReportFromOutboundQueue'](_0x23a2fc);Object[_0x9978('0x13b')](_0x23a2fc,_0x2ac8e7);emitOutboundVoiceQueueSummary(_0x2ac8e7);}_0x352516[_0x9978('0x29')][_0x23a2fc[_0x9978('0x46')]][_0x9978('0x131')]=![];})[_0x9978('0x9b')](function(_0x4c50a6){logger[_0x9978('0x62')](_0x9978('0x138'),util['inspect'](_0x4c50a6,{'showHidden':![],'depth':null}));_0x352516[_0x9978('0x29')][_0x23a2fc[_0x9978('0x46')]][_0x9978('0x131')]=![];});};Dialer[_0x9978('0x18')][_0x9978('0x32')]=_[_0x9978('0x13c')](function(){var _0x2c9f3f=_[_0x9978('0x13d')](this['voiceQueues'],function(_0x4b620d){return _0x4b620d[_0x9978('0x13e')];});var _0x3002b7=_[_0x9978('0x13d')](this[_0x9978('0x1f')],function(_0x5e9922){return _0x5e9922['online']&&_0x5e9922[_0x9978('0x86')]===_0x9978('0x87');});if(_0x2c9f3f[_0x9978('0x94')]>0x0&&_0x3002b7['length']>0x0){return Promise[_0x9978('0xa5')]()[_0x9978('0x3c')](cmHopper[_0x9978('0x13f')](_[_0x9978('0x140')](_0x2c9f3f,'id'),previewRecallmeReminderInterval,_['map'](_0x3002b7,'id')))['then'](function(_0x5b692c){for(var _0x208b99=0x0;_0x208b99<_0x5b692c[_0x9978('0x94')];_0x208b99++){var _0x1818c2=_0x5b692c[_0x208b99]['Agent'][_0x9978('0x46')];if(_0x1818c2)io['to'](util['format']('user:%s',_0x1818c2))[_0x9978('0x3f')](_0x9978('0x141'),{'hopper':_0x5b692c[_0x208b99]});}})[_0x9978('0x9b')](function(_0x5a8fea){logger['error']('checkPreviewRecallReminder',_0x5a8fea);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x9978('0x18')][_0x9978('0x142')]=function(){var _0x31245c=this;setInterval(function(){_0x31245c[_0x9978('0x143')](_0x31245c[_0x9978('0x24')],_0x9978('0x144'));_0x31245c[_0x9978('0x143')](_0x31245c[_0x9978('0x23')],_0x9978('0x145'));},0x32c8);};Dialer[_0x9978('0x18')][_0x9978('0x143')]=function(_0x1c861c,_0x5d2150){var _0x244a04=this;for(var _0x1a1a4a in _0x1c861c){if(typeof _0x1c861c[_0x1a1a4a]!==_0x9978('0xa4')){this['sequence'][_0x9978('0x19')](function(){if(!_[_0x9978('0xeb')](_0x1c861c[_0x1a1a4a])){return ami[_0x9978('0x96')]({'action':_0x9978('0x86'),'channel':_0x1c861c[_0x1a1a4a][_0x9978('0xe7')]})[_0x9978('0x9b')](function(_0x16bed5){if(_0x16bed5[_0x9978('0x6b')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x1c861c[_0x1a1a4a]&&_0x1c861c[_0x1a1a4a][_0x9978('0x40')]!=='ivr'){_0x244a04['updateOriginated'](_0x244a04['voiceQueues'][_0x1c861c[_0x1a1a4a]['queue']]);logger['error'](_0x9978('0x146'),_0x5d2150,_0x1a1a4a,_0x1c861c[_0x1a1a4a][_0x9978('0xb9')]);delete _0x1c861c[_0x1a1a4a];}if(_0x1c861c[_0x1a1a4a]&&_0x1c861c[_0x1a1a4a]['type']==='ivr'){_0x244a04['updateOriginated'](_0x244a04['campaigns'][_0x1c861c[_0x1a1a4a][_0x9978('0xb9')]]);logger[_0x9978('0x62')](_0x9978('0x147'),_0x5d2150,_0x1a1a4a,_0x1c861c[_0x1a1a4a][_0x9978('0xb9')]);delete _0x1c861c[_0x1a1a4a];}},0x2328);}});}});}}};Dialer[_0x9978('0x18')][_0x9978('0x148')]=function(_0xd0aaf0){return Promise['resolve']()[_0x9978('0x3c')](voiceQueueRt['getVoiceQueueRtPauses'](_0xd0aaf0))['catch'](loggerCatch(_0x9978('0x149')));};Dialer[_0x9978('0x18')][_0x9978('0xbc')]=function(_0x10a9e3){if(!_['isUndefined'](_0x10a9e3)&&_0x10a9e3!==null){if(typeof _0x10a9e3[_0x9978('0x7d')]!==_0x9978('0xa4')){if(_0x10a9e3[_0x9978('0x7d')]>0x0){_0x10a9e3[_0x9978('0x7d')]-=0x1;}else{logger[_0x9978('0x62')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x9978('0x62')](_0x9978('0x14a'));}};Dialer[_0x9978('0x18')][_0x9978('0x14b')]=function(_0x1734b3,_0x453ece){var _0x260c4f=this;return function(_0x3de10b){_0x260c4f[_0x9978('0xbc')](_0x453ece);logger[_0x9978('0x62')](_0x1734b3,util[_0x9978('0x43')](_0x3de10b,{'showHidden':![],'depth':null}));};};Dialer[_0x9978('0x18')][_0x9978('0x14c')]=function(_0xf9789f,_0x52a536,_0x32fc8a){var _0xaeb43={'state':0x19,'statedesc':'notFound'};this[_0x9978('0xbc')](_0x52a536);this['saveInDb'](_[_0x9978('0x5d')](_0xaeb43,_[_0x9978('0x72')](_0x32fc8a,[_0x9978('0xd8'),_0x9978('0xd9'),_0x9978('0x14d'),_0x9978('0xda'),_0x9978('0xdb')])),_0x9978('0x14e'),'[emptyContact]');logger[_0x9978('0x62')](_0xf9789f);};Dialer[_0x9978('0x18')]['saveInDb']=function(_0x5cacfe,_0x5293fb,_0x2b5904){hopperUtils['createHistory'](_0x5cacfe)[_0x9978('0x9b')](loggerCatch(_0x5293fb));hopperUtils[_0x9978('0xc4')](_0x5cacfe)[_0x9978('0x9b')](loggerCatch(_0x2b5904));};Dialer[_0x9978('0x18')][_0x9978('0xd5')]=function(_0x51373c,_0x1cadb2){hopperUtils[_0x9978('0xc2')](_0x51373c)[_0x9978('0x9b')](loggerCatch(_0x9978('0xc3')));if(_0x1cadb2==0x0){hopperUtils[_0x9978('0xc4')](_0x51373c)['catch'](loggerCatch(_0x9978('0x14f')));}};Dialer[_0x9978('0x18')][_0x9978('0x150')]=function(_0x1c8db2){return Promise['resolve']()['then'](cmHopper['handlePreviewRecallNotifications'](_0x1c8db2['id'],previewRecallmeReminderInterval))[_0x9978('0x3c')](function(_0x22bdbc){for(var _0x10bbd0=0x0;_0x10bbd0<_0x22bdbc[_0x9978('0x94')];_0x10bbd0++){var _0x99375f=_0x22bdbc[_0x10bbd0][_0x9978('0x151')]['name'];if(_0x99375f)io['to'](util[_0x9978('0x44')]('user:%s',_0x99375f))[_0x9978('0x3f')](_0x9978('0x141'),{'hopper':_0x22bdbc[_0x10bbd0]});}})[_0x9978('0x9b')](function(){});};Dialer[_0x9978('0x18')][_0x9978('0xa9')]=function(_0x5ae6dd){var _0x52a520=this;return function(){_0x52a520[_0x9978('0x152')](_0x5ae6dd);};};Dialer[_0x9978('0x18')][_0x9978('0x153')]=function(_0x310c1b,_0x5b5eb0){var _0x20539e=this;var _0x284875=uuid['v4']();this[_0x9978('0x23')][_0x284875]=new Action(_0x310c1b,_0x5b5eb0,_0x284875);return new Promise(function(_0x4e508b,_0x505133){if(_[_0x9978('0x3e')](_0x310c1b)&&typeof _0x310c1b!==_0x9978('0x154')){return _0x505133(msgResponse(_0x9978('0x155'),_0x9978('0x8d'),_0x9978('0x156')));}if(_[_0x9978('0x3e')](_0x5b5eb0[_0x9978('0x157')])||_0x5b5eb0[_0x9978('0x157')]===null){return _0x505133(msgResponse(_0x9978('0x155'),_0x9978('0x8d'),_0x9978('0x158')));}var _0x368ee7={'XMD-CALLERID':_0x20539e[_0x9978('0x23')][_0x284875][_0x9978('0x159')](),'XMD-AGI':_0x310c1b['dialQueueProject']?util['format'](_0x9978('0x15a'),ipAgi,_0x310c1b[_0x9978('0x12b')]):_0x9978('0x15b'),'XMD-AGIAFTER':_0x310c1b[_0x9978('0xc1')]?util[_0x9978('0x44')](_0x9978('0x15a'),ipAgi,_0x310c1b['dialQueueProject2']):'NONE','XMD-QUEUE':utils['isOutboundQueue'](_0x310c1b)?util['format'](_0x9978('0x15c'),_0x310c1b[_0x9978('0x46')],_0x310c1b[_0x9978('0x15d')]||'',_0x310c1b[_0x9978('0x15e')]?'c':'',_0x310c1b['dialQueueTimeout']||0x3):'NONE','XMD-CONTACTID':_0x5b5eb0['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x20539e['actions'][_0x284875]['getCaller'](),'XMD-AMD':_0x310c1b[_0x9978('0x108')]?_0x9978('0x137'):_0x9978('0x15b'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x310c1b['dialAMDActive']){_0x368ee7[_0x9978('0x15f')]=_0x310c1b[_0x9978('0x160')]||0x9c4;_0x368ee7[_0x9978('0x161')]=_0x310c1b[_0x9978('0x162')]||0x5dc;_0x368ee7['XMD-AMDAFTERGREETINGSILENCE']=_0x310c1b['dialAMDAfterGreetingSilence']||0x320;_0x368ee7[_0x9978('0x163')]=_0x310c1b[_0x9978('0x164')]||0x1388;_0x368ee7['XMD-AMDMINWORDLENGTH']=_0x310c1b[_0x9978('0x165')]||0x64;_0x368ee7[_0x9978('0x166')]=_0x310c1b[_0x9978('0x167')]||0x32;_0x368ee7[_0x9978('0x168')]=_0x310c1b['dialAMDMaximumNumberOfWords']||0x3;_0x368ee7[_0x9978('0x169')]=_0x310c1b[_0x9978('0x16a')]||0x100;_0x368ee7[_0x9978('0x16b')]=_0x310c1b['dialAMDMaximumWordLength']||0x1388;}if(utils[_0x9978('0x16c')](_0x310c1b)){_0x368ee7[_0x9978('0x16d')]=_0x5b5eb0['VoiceQueueId'];}else{_0x368ee7['XMD-CAMPAIGNID']=_0x5b5eb0[_0x9978('0xdb')];}var _0x4fec9d=utils['setXMDContactVariables'](_0x5b5eb0[_0x9978('0x16e')]);Object[_0x9978('0x13b')](_0x368ee7,_0x4fec9d);var _0x448d51=_0x20539e[_0x9978('0x84')](_0x310c1b[_0x9978('0x89')])?utils[_0x9978('0x16f')](_0x310c1b[_0x9978('0x89')][_0x9978('0x170')],_0x310c1b['dialOriginateCallerIdName'],_0x310c1b[_0x9978('0x171')]>0x0?utils['getCallerIdRandom'](_0x310c1b[_0x9978('0x172')],_0x310c1b[_0x9978('0x171')]):_0x310c1b['dialOriginateCallerIdNumber']):utils[_0x9978('0x16f')](_[_0x9978('0xeb')](_0x310c1b['TrunkBackup'])?_0x310c1b[_0x9978('0x89')][_0x9978('0x170')]:_0x310c1b['TrunkBackup']['callerid'],_0x310c1b[_0x9978('0x173')],_0x310c1b[_0x9978('0x171')]>0x0?utils[_0x9978('0x174')](_0x310c1b[_0x9978('0x172')],_0x310c1b['dialRandomLastDigitCallerIdNumber']):_0x310c1b[_0x9978('0x172')]);if(_0x448d51){_0x368ee7[_0x9978('0x175')]=_0x20539e[_0x9978('0x23')][_0x284875][_0x9978('0x176')]=utils[_0x9978('0x177')](_0x448d51);_0x368ee7[_0x9978('0x178')]=_0x5b5eb0['phone'];}_0x310c1b[_0x9978('0x179')]=_0x368ee7;return ami[_0x9978('0x96')]({'actionid':_0x284875,'action':_0x9978('0x155'),'channel':_0x20539e[_0x9978('0x84')](_0x310c1b[_0x9978('0x89')])?util[_0x9978('0x44')](_0x9978('0x17a'),_0x310c1b[_0x9978('0x89')]['name'],isNotNull(_0x310c1b[_0x9978('0x17b')])?_0x310c1b[_0x9978('0x17b')]['trim']()||'':'',_0x310c1b[_0x9978('0x17c')]>0x0?_0x5b5eb0[_0x9978('0x157')][_0x9978('0x17d')](_0x310c1b[_0x9978('0x17c')]):_0x5b5eb0[_0x9978('0x157')]):util[_0x9978('0x44')]('SIP/%s/%s%s',_['isNil'](_0x310c1b[_0x9978('0x17e')])?_0x310c1b[_0x9978('0x89')][_0x9978('0x46')]:_0x310c1b['TrunkBackup'][_0x9978('0x46')],isNotNull(_0x310c1b[_0x9978('0x17b')])?_0x310c1b[_0x9978('0x17b')]['trim']()||'':'',_0x310c1b['dialCutDigit']>0x0?_0x5b5eb0[_0x9978('0x157')][_0x9978('0x17d')](_0x310c1b[_0x9978('0x17c')]):_0x5b5eb0['phone']),'callerid':_0x448d51,'Exten':_0x9978('0x17f'),'Context':'from-sip','Priority':'1','variable':_0x368ee7,'timeout':(_0x310c1b['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x284875})['then'](function(_0x2bb797){return _0x4e508b(_0x2bb797);})[_0x9978('0x9b')](function(_0x3dd968){_0x310c1b[_0x9978('0x180')]+=0x1;var _0x50a424=new History(_0x20539e['actions'][_0x284875]);logger[_0x9978('0x62')](util['format'](_0x9978('0x181'),JSON['stringify'](_0x3dd968)));_0x50a424['state']=0xe;_0x50a424[_0x9978('0xcb')]=_0x9978('0x182');_0x50a424[_0x9978('0x6d')]=moment()[_0x9978('0x44')]('YYYY-MM-DD\x20HH:mm:ss');_0x50a424['endtime']=_0x50a424['starttime'];hopperUtils[_0x9978('0xc2')](_0x50a424)[_0x9978('0x9b')](loggerCatch(_0x9978('0x183')));_0x20539e[_0x9978('0xc4')](_0x50a424)[_0x9978('0x9b')](loggerCatch(_0x9978('0x183')))[_0x9978('0xf1')](function(){delete _0x20539e['actions'][_0x284875];return _0x505133(msgResponse(_0x9978('0x155'),_0x9978('0x83'),_0x9978('0x184')));});});});};Dialer['prototype']['checkRetriveMax']=function(_0x59b8d2,_0x17a689,_0x5df043){var _0xa254d0=new History(_0x17a689);if(_0xa254d0['countbusyretry']+_0xa254d0['countcongestionretry']+_0xa254d0[_0x9978('0x11b')]+_0xa254d0[_0x9978('0x11c')]+_0xa254d0[_0x9978('0xd3')]+_0xa254d0['countabandonedretry']+_0xa254d0['countmachineretry']+_0xa254d0[_0x9978('0x11d')]>=_0x5df043[_0x9978('0x11e')]-0x1){return!![];}switch(_0x59b8d2){case 0x3:if(_0xa254d0[_0x9978('0x11b')]>=_0x5df043[_0x9978('0x185')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countnoanswerretry':_0xa254d0[_0x9978('0x11b')]+=0x1,'scheduledat':moment()[_0x9978('0xd6')](_0x5df043[_0x9978('0x186')],_0x9978('0xd7'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xa254d0[_0x9978('0xd8')],'ListId':_0xa254d0[_0x9978('0xd9')],'VoiceQueueId':_0xa254d0['VoiceQueueId']||undefined,'CampaignId':_0xa254d0[_0x9978('0xdb')]||undefined})[_0x9978('0x9b')](loggerCatch(_0x9978('0x187')));break;case 0x5:if(_0xa254d0[_0x9978('0x119')]>=_0x5df043['dialBusyMaxRetry']-0x1){return!![];}hopperUtils[_0x9978('0xf2')]({'active':![],'countbusyretry':_0xa254d0[_0x9978('0x119')]+=0x1,'scheduledat':moment()[_0x9978('0xd6')](_0x5df043[_0x9978('0x188')],'minutes')[_0x9978('0x44')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xa254d0[_0x9978('0xd8')],'ListId':_0xa254d0[_0x9978('0xd9')],'VoiceQueueId':_0xa254d0['VoiceQueueId']||undefined,'CampaignId':_0xa254d0[_0x9978('0xdb')]||undefined})[_0x9978('0x9b')](loggerCatch(_0x9978('0x189')));break;case 0x8:if(_0xa254d0['countcongestionretry']>=_0x5df043[_0x9978('0x18a')]-0x1){return!![];}hopperUtils[_0x9978('0xf2')]({'active':![],'countcongestionretry':_0xa254d0['countcongestionretry']+=0x1,'scheduledat':moment()[_0x9978('0xd6')](_0x5df043['dialCongestionRetryFrequency'],_0x9978('0xd7'))[_0x9978('0x44')](_0x9978('0xbe')),'ContactId':_0xa254d0[_0x9978('0xd8')],'ListId':_0xa254d0[_0x9978('0xd9')],'VoiceQueueId':_0xa254d0[_0x9978('0xda')]||undefined,'CampaignId':_0xa254d0[_0x9978('0xdb')]||undefined})[_0x9978('0x9b')](loggerCatch(_0x9978('0x18b')));break;case 0x0:if(_0xa254d0[_0x9978('0x11c')]>=_0x5df043[_0x9978('0x18c')]-0x1){return!![];}else{hopperUtils[_0x9978('0xf2')]({'active':![],'countnosuchnumberretry':_0xa254d0[_0x9978('0x11c')]+=0x1,'scheduledat':moment()['add'](_0x5df043['dialNoSuchNumberRetryFrequency'],_0x9978('0xd7'))[_0x9978('0x44')](_0x9978('0xbe')),'ContactId':_0xa254d0[_0x9978('0xd8')],'ListId':_0xa254d0[_0x9978('0xd9')],'VoiceQueueId':_0xa254d0['VoiceQueueId']||undefined,'CampaignId':_0xa254d0[_0x9978('0xdb')]||undefined})['catch'](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0xa254d0[_0x9978('0xd3')]>=_0x5df043['dialDropMaxRetry']-0x1){return!![];}hopperUtils[_0x9978('0xf2')]({'active':![],'countdropretry':_0xa254d0[_0x9978('0xd3')]+=0x1,'scheduledat':moment()[_0x9978('0xd6')](_0x5df043[_0x9978('0xcf')],_0x9978('0xd7'))[_0x9978('0x44')](_0x9978('0xbe')),'ContactId':_0xa254d0[_0x9978('0xd8')],'ListId':_0xa254d0['ListId'],'VoiceQueueId':_0xa254d0[_0x9978('0xda')]||undefined,'CampaignId':_0xa254d0[_0x9978('0xdb')]||undefined})[_0x9978('0x9b')](loggerCatch(_0x9978('0xdc')));break;case 0xb:if(_0xa254d0[_0x9978('0xe3')]>=_0x5df043[_0x9978('0xe5')]-0x1){return!![];}hopperUtils[_0x9978('0xf2')]({'active':![],'countabandonedretry':_0xa254d0[_0x9978('0xe3')]+=0x1,'scheduledat':moment()[_0x9978('0xd6')](_0x5df043[_0x9978('0xe4')],_0x9978('0xd7'))['format'](_0x9978('0xbe')),'ContactId':_0xa254d0['ContactId'],'ListId':_0xa254d0['ListId'],'VoiceQueueId':_0xa254d0[_0x9978('0xda')]||undefined,'CampaignId':_0xa254d0[_0x9978('0xdb')]||undefined})[_0x9978('0x9b')](loggerCatch(_0x9978('0x18d')));break;case 0x13:if(_0xa254d0[_0x9978('0x117')]>=_0x5df043[_0x9978('0x121')]-0x1){return!![];}hopperUtils[_0x9978('0xf2')]({'active':![],'countmachineretry':_0xa254d0['countmachineretry']+=0x1,'scheduledat':moment()['add'](_0x5df043[_0x9978('0x18e')],_0x9978('0xd7'))[_0x9978('0x44')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xa254d0['ContactId'],'ListId':_0xa254d0[_0x9978('0xd9')],'VoiceQueueId':_0xa254d0[_0x9978('0xda')]||undefined,'CampaignId':_0xa254d0[_0x9978('0xdb')]||undefined})[_0x9978('0x9b')](loggerCatch(_0x9978('0x124')));break;case 0x14:if(_0xa254d0[_0x9978('0x11d')]>=_0x5df043['dialAgentRejectMaxRetry']-0x1){return!![];}hopperUtils[_0x9978('0xf2')]({'active':![],'countagentrejectretry':_0xa254d0['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x9978('0xd6')](_0x5df043['dialAgentRejectRetryFrequency'],'minutes')[_0x9978('0x44')](_0x9978('0xbe')),'ContactId':_0xa254d0['ContactId'],'ListId':_0xa254d0[_0x9978('0xd9')],'VoiceQueueId':_0xa254d0['VoiceQueueId']||undefined,'CampaignId':_0xa254d0[_0x9978('0xdb')]||undefined})[_0x9978('0x9b')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x9978('0x18')][_0x9978('0x103')]=function(_0x58e7bf,_0x26492d,_0x2392b7){var _0x2b5245=this;var _0x14db51=new History(_0x58e7bf);var _0x4892a3=![];var _0x1dfeb9;var _0x29bc73;return new Promise(function(_0x259509,_0x1ce70c){if(_[_0x9978('0x3e')](_0x26492d)&&typeof _0x26492d!==_0x9978('0x154')){return _0x1ce70c(msgResponse('[callProgressDetecting]',_0x9978('0x8d'),'entity\x20is\x20undefine'));}if(_['isUndefined'](_0x2392b7)&&typeof _0x2392b7!=='object'){return _0x1ce70c(msgResponse(_0x9978('0x18f'),'Failure','evt\x20is\x20undefine'));}hopperUtils[_0x9978('0xd1')](_0x14db51,_0x2392b7[_0x9978('0xbf')],_0x26492d)[_0x9978('0x3c')](function(_0x12730b){if(_0x12730b[_0x9978('0xd2')]==0x1)_0x4892a3=!![];switch(_0x2392b7[_0x9978('0xbf')]){case'0':_0x26492d['outboundNoSuchCallsDay']+=0x1;_0x14db51[_0x9978('0xca')]=0x0;_0x14db51['statedesc']='NoSuchNumber';_0x14db51[_0x9978('0x11c')]+=0x1;_0x14db51[_0x9978('0xce')]+=0x1;ami[_0x9978('0x3f')](_0x9978('0x190'),ut[_0x9978('0x111')](_0x58e7bf,_0x9978('0x191')));_0x1dfeb9=_0x26492d[_0x9978('0x192')];_0x29bc73=_0x26492d[_0x9978('0xd0')];hopperUtils[_0x9978('0xc2')](_0x14db51)[_0x9978('0x9b')](loggerCatch(_0x9978('0x118')));if(_0x2b5245['checkRetriveMax'](0x0,_0x58e7bf,_0x26492d)&&!_0x4892a3){if(_0x14db51[_0x9978('0x11c')]>=_0x26492d[_0x9978('0x18c')]){_0x2b5245[_0x9978('0x122')](_0x14db51,_0x259509,_0x1ce70c,_0x9978('0x193'));}else{_0x2b5245[_0x9978('0x11f')](_0x14db51,_0x259509,_0x1ce70c,_0x9978('0x193'));}}break;case'3':_0x26492d['outboundNoAnswerCallsDay']+=0x1;_0x14db51[_0x9978('0xca')]=0x3;_0x14db51['statedesc']='NoAnswer';_0x14db51[_0x9978('0x11b')]+=0x1;_0x14db51[_0x9978('0xce')]+=0x1;var _0x451e84=ut[_0x9978('0x194')](_0x58e7bf,_0x26492d);ami['emit'](_0x9978('0x195'),_0x451e84);_0x1dfeb9=_0x26492d[_0x9978('0x186')];_0x29bc73=_0x26492d[_0x9978('0xd0')];hopperUtils[_0x9978('0xc2')](_0x14db51)[_0x9978('0x9b')](loggerCatch(_0x9978('0x196')));if(_0x2b5245[_0x9978('0x197')](0x3,_0x58e7bf,_0x26492d)&&!_0x4892a3){if(_0x14db51[_0x9978('0x11b')]>=_0x26492d['dialNoAnswerMaxRetry']){_0x2b5245['createStateFinal'](_0x14db51,_0x259509,_0x1ce70c,'reason\x203\x20ringing\x20no\x20answer');}else{_0x2b5245['stateGlobal'](_0x14db51,_0x259509,_0x1ce70c,_0x9978('0x198'));}}break;case'5':_0x26492d[_0x9978('0x199')]+=0x1;_0x14db51['state']=0x5;_0x14db51[_0x9978('0xcb')]=_0x9978('0x19a');_0x14db51[_0x9978('0x119')]+=0x1;_0x14db51[_0x9978('0xce')]+=0x1;ami[_0x9978('0x3f')]('custom:agentbusy',ut[_0x9978('0x111')](_0x58e7bf,_0x9978('0x19b')));_0x1dfeb9=_0x26492d[_0x9978('0x188')];_0x29bc73=_0x26492d['callAdditionalPhoneAfterMin'];hopperUtils[_0x9978('0xc2')](_0x14db51)[_0x9978('0x9b')](loggerCatch(_0x9978('0x19c')));if(_0x2b5245[_0x9978('0x197')](0x5,_0x58e7bf,_0x26492d)&&!_0x4892a3){if(_0x14db51[_0x9978('0x119')]>=_0x26492d['dialBusyMaxRetry']){_0x2b5245[_0x9978('0x122')](_0x14db51,_0x259509,_0x1ce70c,_0x9978('0x19d'));}else{_0x2b5245[_0x9978('0x11f')](_0x14db51,_0x259509,_0x1ce70c,_0x9978('0x19d'));}}break;case'8':_0x26492d[_0x9978('0x19e')]+=0x1;_0x14db51[_0x9978('0xca')]=0x8;_0x14db51[_0x9978('0xcb')]=_0x9978('0x19f');_0x14db51[_0x9978('0x11a')]+=0x1;_0x14db51[_0x9978('0xce')]+=0x1;_0x1dfeb9=_0x26492d[_0x9978('0x1a0')];_0x29bc73=_0x26492d[_0x9978('0xd0')];ami[_0x9978('0x3f')](_0x9978('0x1a1'),ut[_0x9978('0x111')](_0x58e7bf,_0x9978('0x1a2')));hopperUtils['createHistory'](_0x14db51)[_0x9978('0x9b')](loggerCatch(_0x9978('0x1a3')));if(_0x2b5245[_0x9978('0x197')](0x8,_0x58e7bf,_0x26492d)&&!_0x4892a3){if(_0x14db51[_0x9978('0x11a')]>=_0x26492d['dialCongestionMaxRetry']){_0x2b5245[_0x9978('0x122')](_0x14db51,_0x259509,_0x1ce70c,_0x9978('0x1a4'));}else{_0x2b5245['stateGlobal'](_0x14db51,_0x259509,_0x1ce70c,_0x9978('0x1a4'));}}break;case'11':_0x26492d['outboundAbandonedCallsDay']+=0x1;_0x14db51[_0x9978('0xca')]=0xb;_0x14db51[_0x9978('0xcb')]='Abandoned';_0x14db51[_0x9978('0xe3')]+=0x1;_0x14db51[_0x9978('0xce')]+=0x1;_0x1dfeb9=_0x26492d[_0x9978('0xe4')];_0x29bc73=_0x26492d[_0x9978('0xd0')];hopperUtils[_0x9978('0xc2')](_0x14db51)[_0x9978('0x9b')](loggerCatch(_0x9978('0x1a5')));if(_0x2b5245[_0x9978('0x197')](0xb,_0x58e7bf,_0x26492d)&&!_0x4892a3){if(_0x14db51[_0x9978('0xe3')]>=_0x26492d['dialAbandonedMaxRetry']){_0x2b5245[_0x9978('0x122')](_0x14db51,_0x259509,_0x1ce70c,_0x9978('0x1a6'));}else{_0x2b5245[_0x9978('0x11f')](_0x14db51,_0x259509,_0x1ce70c,_0x9978('0x1a6'));}}break;case'20':_0x26492d['outboundRejectCallsDay']+=0x1;_0x14db51[_0x9978('0xca')]=0x14;_0x14db51[_0x9978('0xcb')]=_0x9978('0x1a7');_0x14db51['countagentrejectretry']+=0x1;_0x14db51[_0x9978('0xce')]+=0x1;_0x1dfeb9=_0x26492d['dialAgentRejectRetryFrequency'];_0x29bc73=_0x26492d['callAdditionalPhoneAfterMin'];ami[_0x9978('0x3f')](_0x9978('0x1a8'),ut[_0x9978('0x111')](_0x58e7bf,_0x9978('0x1a9')));hopperUtils[_0x9978('0xc2')](_0x14db51)[_0x9978('0x9b')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x2b5245['checkRetriveMax'](0x14,_0x58e7bf,_0x26492d)&&!_0x4892a3){if(_0x14db51[_0x9978('0x11d')]>=_0x26492d[_0x9978('0x1aa')]){_0x2b5245[_0x9978('0x122')](_0x14db51,_0x259509,_0x1ce70c,_0x9978('0x1ab'));}else{_0x2b5245[_0x9978('0x11f')](_0x14db51,_0x259509,_0x1ce70c,_0x9978('0x1ab'));}}break;default:_0x26492d[_0x9978('0x12e')]+=0x1;_0x14db51[_0x9978('0xca')]=0xc;_0x14db51[_0x9978('0xcb')]=_0x2392b7['reason'];_0x1dfeb9=_0x26492d[_0x9978('0x1ac')];_0x29bc73=_0x26492d[_0x9978('0xd0')];hopperUtils[_0x9978('0xc2')](_0x14db51)[_0x9978('0x9b')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x2b5245[_0x9978('0x197')](_0x2392b7['reason'],_0x58e7bf,_0x26492d)&&!_0x4892a3){if(_0x14db51['countbusyretry']+_0x14db51['countcongestionretry']+_0x14db51[_0x9978('0x11b')]+_0x14db51[_0x9978('0x11c')]+_0x14db51[_0x9978('0xd3')]+_0x14db51[_0x9978('0xe3')]+_0x14db51[_0x9978('0x117')]+_0x14db51[_0x9978('0x11d')]>=_0x26492d[_0x9978('0x11e')]){_0x2b5245[_0x9978('0x11f')](_0x14db51,_0x259509,_0x1ce70c,_0x2392b7['reason']);}else{_0x2b5245[_0x9978('0x122')](_0x14db51,_0x259509,_0x1ce70c,_0x2392b7['reason']);}}}})[_0x9978('0x3c')](function(){if(_0x4892a3){hopperUtils[_0x9978('0xdf')](_0x14db51,_0x1dfeb9,_0x29bc73)[_0x9978('0x3c')](function(){return _0x259509(0x1);});}});});};Dialer[_0x9978('0x18')][_0x9978('0x11f')]=function(_0x32433a,_0x561715,_0x291f17,_0x3feb46){var _0x14b261=new Final(_0x32433a);_0x14b261[_0x9978('0xca')]=0xf;_0x14b261[_0x9978('0xcb')]='Global';this['createStateFinal'](_0x14b261,_0x561715,_0x291f17,_0x3feb46);};Dialer['prototype'][_0x9978('0x122')]=function(_0x29c394,_0x523dec,_0x5b14b1,_0x1ec1dd){hopperUtils[_0x9978('0xc4')](_0x29c394)[_0x9978('0x3c')](function(){return _0x523dec(msgResponse(_0x9978('0x18f'),_0x9978('0x1ad'),_0x1ec1dd));})['catch'](function(){return _0x5b14b1(msgResponse(_0x9978('0x1ae'),_0x9978('0x8d'),_0x9978('0x1af')));});};Dialer['prototype'][_0x9978('0xb0')]=function(_0x292dc6){var _0x55e74d=_0x292dc6['dialPredictiveOptimizationPercentage']/0x64;var _0xaf432b=_0x292dc6[_0x9978('0xc8')]/(_0x292dc6[_0x9978('0xc8')]+_0x292dc6[_0x9978('0x10b')]);var _0x55bcbe=Math[_0x9978('0x1b0')](_0x292dc6[_0x9978('0x1b1')]*(_0x292dc6[_0x9978('0x1b2')]/0x64));var _0x235748=Math[_0x9978('0x1b0')](_0x292dc6[_0x9978('0x1b1')]*(_0x292dc6[_0x9978('0x1b3')]/0x64));var _0x40e39b=_0x292dc6['available']+_0x292dc6[_0x9978('0x1b4')];var _0x521aa9=Math[_0x9978('0x1b5')](_0x292dc6[_0x9978('0x1b6')]*_0x292dc6[_0x9978('0x5b')]*_0x292dc6[_0x9978('0x1b7')]*_0x292dc6[_0x9978('0x1b8')]);if(_[_0x9978('0x3e')](_0x292dc6[_0x9978('0x27')])){if(!_[_0x9978('0x3e')](_0x292dc6[_0x9978('0x26')])){_0x292dc6[_0x9978('0x26')]=undefined;loggerPredictive[_0x9978('0x62')](_0x9978('0x1b9'),_0x9978('0x1ba'));}if(!_[_0x9978('0x3e')](_0x292dc6[_0x9978('0x60')])){loggerPredictive[_0x9978('0x62')](_0x9978('0x1b9'),_0x9978('0x1bb'));clearInterval(_0x292dc6[_0x9978('0x60')]);_0x292dc6[_0x9978('0x60')]=undefined;}_0x292dc6[_0x9978('0x27')]=moment()[_0x9978('0x44')](_0x9978('0xbe'));loggerPredictive[_0x9978('0x49')](_0x292dc6['name'],_0x9978('0x1bc'),_0x292dc6[_0x9978('0x27')]);this[_0x9978('0xad')](_0x292dc6,0x1);}else if(ifInterval(_0x292dc6[_0x9978('0x1bd')],_0x292dc6[_0x9978('0x27')])){this['handlePower'](_0x292dc6,0x1);loggerPredictiveCalls[_0x9978('0x49')]('[startMethodPredictive][StartProgressive][Loop]',_0x292dc6[_0x9978('0x27')],_0x292dc6[_0x9978('0x46')]);_0x292dc6[_0x9978('0x1b6')]=0x0;_0x292dc6[_0x9978('0xc9')]=0x0;}else if(_0x55e74d<_0xaf432b&&_0x292dc6[_0x9978('0x1be')]===_0x9978('0x1bf')){clearPredictiveAttributes(_0x292dc6);loggerPredictive[_0x9978('0x49')](_0x9978('0x1c0'),_0x9978('0x1c1'),_0xaf432b,_0x9978('0x27'),_0x292dc6[_0x9978('0x46')]);}else if(_0x521aa9<_0x292dc6[_0x9978('0xc9')]&&_0x292dc6[_0x9978('0x1be')]===_0x9978('0x1bf')){clearPredictiveAttributes(_0x292dc6);loggerPredictive['info'](_0x9978('0x1c2'),_0x9978('0x1c3'),_0x521aa9,'Drop\x20in\x20this\x20interval',_0x292dc6[_0x9978('0xc9')],'startProgressive',_0x292dc6[_0x9978('0x46')]);}else if(!ifInterval(_0x292dc6[_0x9978('0x1bd')],_0x292dc6[_0x9978('0x27')])&&_[_0x9978('0x3e')](_0x292dc6[_0x9978('0x26')])&&!_[_0x9978('0x3e')](_0x292dc6[_0x9978('0x27')])){_0x292dc6[_0x9978('0x26')]=moment()['format'](_0x9978('0xbe'));loggerPredictive[_0x9978('0x49')](_0x292dc6[_0x9978('0x46')],_0x9978('0x1c4'),_0x292dc6['startPredictive']);hopperUtils[_0x9978('0x1c5')](_0x292dc6['dialPredictiveInterval'])[_0x9978('0x3c')](this['getDataPredictive'](_0x292dc6))[_0x9978('0x3c')](mergeDataErlangB(_0x292dc6))[_0x9978('0x3c')](this[_0x9978('0x1c6')](_0x292dc6))[_0x9978('0x9b')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x292dc6));}else if(!ifInterval(_0x292dc6['dialPredictiveInterval'],_0x292dc6[_0x9978('0x26')])){_0x292dc6[_0x9978('0xc9')]=0x0;_0x292dc6[_0x9978('0x26')]=moment()[_0x9978('0x44')](_0x9978('0xbe'));loggerPredictive['info'](_0x292dc6[_0x9978('0x46')],_0x9978('0x1c7'),_0x292dc6['startPredictive']);clearInterval(_0x292dc6['handlePredictive']);_0x292dc6[_0x9978('0x60')]=undefined;hopperUtils[_0x9978('0x1c5')](_0x292dc6[_0x9978('0x1bd')])[_0x9978('0x3c')](this[_0x9978('0x1c8')](_0x292dc6))[_0x9978('0x3c')](mergeDataErlangB(_0x292dc6))['then'](this[_0x9978('0x1c6')](_0x292dc6))[_0x9978('0x9b')](loggerCatchPredictive(_0x9978('0x1c9'),_0x292dc6));}else if(_0x292dc6['predictiveIntervalAvailable']&&_0x40e39b<_0x292dc6[_0x9978('0x1b1')]-_0x235748){clearPredictiveAttributes(_0x292dc6);loggerPredictive[_0x9978('0x49')](_0x292dc6[_0x9978('0x46')],_0x9978('0x1ca'),_0x40e39b,_0x9978('0x1cb'),_0x292dc6[_0x9978('0x1b1')],'-',_0x235748,'=',_0x292dc6[_0x9978('0x1b1')]-_0x235748,')');}else if(_0x292dc6[_0x9978('0x1b1')]&&_0x40e39b>_0x292dc6['predictiveIntervalAvailable']+_0x55bcbe){clearPredictiveAttributes(_0x292dc6);loggerPredictive[_0x9978('0x49')](_0x292dc6['name'],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x40e39b,_0x9978('0x1cc'),_0x292dc6[_0x9978('0x1b1')],'+',_0x55bcbe,'=',_0x292dc6[_0x9978('0x1b1')]+_0x55bcbe,')');}};Dialer[_0x9978('0x18')][_0x9978('0x1c8')]=function(_0xecb58d){var _0x1afc6d=this;return function(_0x10f556){return new Promise(function(_0x36211e,_0x2158a4){_['merge'](_0xecb58d,_0x10f556[0x0]);if(checkGetDataPredictive(_0x10f556[0x0])){var _0x24bd87=_0xecb58d[_0x9978('0x1b1')]=_0xecb58d[_0x9978('0x1b4')]+_0xecb58d['available'];var _0x5f235c=_0xecb58d[_0x9978('0x1bd')]*0x3c;var _0x43f430=_0x10f556[0x0][_0x9978('0x50')]+_0x10f556[0x0][_0x9978('0x4f')];var _0x41f7ea=(_0x10f556[0x0][_0x9978('0x1cd')]+_0x10f556[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x10f556[0x0][_0x9978('0xe0')])/_0x10f556[0x0][_0x9978('0x4a')];_0xecb58d[_0x9978('0x1b7')]=_0x41f7ea>0x0?_0x41f7ea:0x1;switch(_0xecb58d[_0x9978('0x1be')]){case _0x9978('0x1bf'):var _0x398bc0=_0xecb58d[_0x9978('0x1ce')]/0x64;return _0x1afc6d[_0x9978('0x1cf')](_0x24bd87,_0x5f235c,_0x43f430,_0x41f7ea,_0x398bc0)[_0x9978('0x3c')](function(_0x3d4745){return _0x36211e(_0x3d4745);});case'agentBusyFactor':var _0x2b1ecb=_0xecb58d['dialPredictiveOptimizationPercentage']/0x64;return _0x1afc6d['busyFactor'](_0x24bd87,_0x5f235c,_0x43f430,_0x41f7ea,_0x2b1ecb)[_0x9978('0x3c')](function(_0x2484ee){return _0x36211e(_0x2484ee);});default:return _0x2158a4(msgResponse(_0x9978('0x1d0'),_0x9978('0x8d'),_0x9978('0x1d1')));}}else{return _0x2158a4(msgResponse(_0x9978('0x1d0'),_0x9978('0x8d'),'check\x20failure'));}});};};Dialer['prototype'][_0x9978('0x1d2')]=function(_0x17dbd8){var _0x29b5e1=this;return function(_0x2a6539){return new Promise(function(_0x3ce2b8,_0x170148){_['merge'](_0x17dbd8,_0x2a6539[0x0]);if(checkGetDataPredictive(_0x2a6539[0x0])){loggerPredictive['info'](JSON[_0x9978('0x71')](_0x2a6539[0x0]));if(_0x17dbd8[_0x9978('0x1be')]==='dropRate'){return _0x29b5e1[_0x9978('0x148')](_0x17dbd8['id'])['then'](function(_0x42308e){var _0xe5f88f=_0x17dbd8[_0x9978('0x1d3')]-_0x42308e[0x0][_0x9978('0x1d4')];var _0x55ece4=_0x17dbd8[_0x9978('0x1bd')]*0x3c;var _0x280c65=_0x2a6539[0x0][_0x9978('0x50')]+_0x2a6539[0x0][_0x9978('0x4f')];var _0x2b330f=(_0x2a6539[0x0][_0x9978('0x1cd')]+_0x2a6539[0x0][_0x9978('0x1d5')]+_0x2a6539[0x0][_0x9978('0xe0')])/_0x2a6539[0x0][_0x9978('0x4a')];var _0xe70476=_0x17dbd8['dialPredictiveOptimizationPercentage']/0x64;_0x17dbd8['predictiveIntervalPauses']=_0x42308e[0x0][_0x9978('0x1d4')]||0x0;_0x17dbd8[_0x9978('0x1b7')]=_0x2b330f>0x0?_0x2b330f:0x1;return _0x29b5e1[_0x9978('0x1cf')](_0xe5f88f,_0x55ece4,_0x280c65,_0x2b330f,_0xe70476);})[_0x9978('0x3c')](function(_0x2bd3e9){return _0x3ce2b8(_0x2bd3e9);})[_0x9978('0x9b')](function(_0x3fd0f8){return _0x170148(msgResponse(_0x9978('0x1d6'),_0x9978('0x8d'),JSON['stringify'](_0x3fd0f8)));});}if(_0x17dbd8['dialPredictiveOptimization']===_0x9978('0x1d7')){return _0x29b5e1[_0x9978('0x148')](_0x17dbd8['id'])[_0x9978('0x3c')](function(_0x5a35aa){var _0x153c18=_0x17dbd8[_0x9978('0x1d3')]-_0x5a35aa[0x0][_0x9978('0x1d4')];var _0x4e9604=_0x17dbd8[_0x9978('0x1bd')]*0x3c;var _0x2edb29=_0x2a6539[0x0][_0x9978('0x50')]+_0x2a6539[0x0][_0x9978('0x4f')];var _0x46c020=(_0x2a6539[0x0][_0x9978('0x1cd')]+_0x2a6539[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x2a6539[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x2a6539[0x0]['predictiveIntervalTotalCalls'];var _0x1a9d71=_0x17dbd8['dialPredictiveOptimizationPercentage']/0x64;_0x17dbd8[_0x9978('0x1d8')]=_0x5a35aa[0x0][_0x9978('0x1d4')]||0x0;_0x17dbd8[_0x9978('0x1b7')]=_0x46c020>0x0?_0x46c020:0x1;return _0x29b5e1[_0x9978('0x1d9')](_0x153c18,_0x4e9604,_0x2edb29,_0x46c020,_0x1a9d71);})[_0x9978('0x3c')](function(_0x252640){return _0x3ce2b8(_0x252640);})['catch'](function(_0x429f2a){return _0x170148(msgResponse(_0x9978('0x1d6'),'Failure',JSON[_0x9978('0x71')](_0x429f2a)));});}}else{return _0x170148(msgResponse(_0x9978('0x1d0'),'Failure','check\x20failure'));}});};};Dialer['prototype'][_0x9978('0x1c6')]=function(_0x2549b6){var _0x17b625=this;return function(){var _0x2c8d05=0x0;var _0x25f546=Math['floor'](_0x2549b6['erlangCallToSecond']*0x3e8);if(_0x25f546>0x0){_0x25f546=_0x25f546<0x64?0x64:_0x25f546;loggerPredictive['info'](_0x2549b6[_0x9978('0x46')],'one\x20call\x20every:',_0x25f546,_0x9978('0x1da'));_0x2549b6[_0x9978('0x60')]=setInterval(function(){_0x17b625[_0x9978('0x60')](_0x2549b6);loggerPredictiveCalls[_0x9978('0x49')](_0x9978('0x1db'),_0x2c8d05+=0x1);},_0x25f546);}else{loggerPredictive[_0x9978('0x49')](_0x2549b6[_0x9978('0x46')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x9978('0x18')][_0x9978('0x1dc')]=function(_0x2e8b60,_0x24e3db){var _0x305e28=this;return function(_0x576aee){if(_[_0x9978('0x77')](_0x576aee)){if(_[_0x9978('0xeb')](_0x24e3db[_0x9978('0x14d')])||!_0x24e3db[_0x9978('0x1dd')]){if(_0x2e8b60[_0x9978('0xac')]===_0x9978('0x1de')){_0x2e8b60[_0x9978('0x6e')]=_['isUndefined'](_0x2e8b60[_0x9978('0x6e')])?!![]:_0x2e8b60['queueStatusComplete'];var _0x45878d=uuid['v4']();_0x305e28[_0x9978('0x23')][_0x45878d]=new Action(_0x2e8b60,_0x24e3db,_0x45878d);loggerBooked[_0x9978('0x49')](_0x9978('0x1df'),_0x45878d,_0x9978('0x1e0'),JSON[_0x9978('0x71')](_0x2e8b60[_0x9978('0x6e')]),_0x9978('0x1e1'),_0x2e8b60['name']);if(_0x2e8b60[_0x9978('0x6e')]){_0x2e8b60[_0x9978('0x6e')]=![];_0x305e28[_0x9978('0x28')][_0x305e28[_0x9978('0x23')][_0x45878d]['queue']]=[];ami[_0x9978('0x96')]({'actionid':_0x45878d,'action':_0x9978('0x1e2'),'queue':_0x2e8b60['name']})[_0x9978('0x9b')](function(){_0x305e28['updateOriginated'](_0x2e8b60);hopperUtils[_0x9978('0xf2')]({'active':![],'ContactId':_0x305e28[_0x9978('0x23')][_0x45878d][_0x9978('0xd8')],'ListId':_0x305e28[_0x9978('0x23')][_0x45878d][_0x9978('0xd9')],'VoiceQueueId':_0x305e28[_0x9978('0x23')][_0x45878d][_0x9978('0xda')]||undefined,'CampaignId':_0x305e28[_0x9978('0x23')][_0x45878d][_0x9978('0xdb')]||undefined})[_0x9978('0x9b')](loggerCatch(_0x9978('0x1e3')));delete _0x305e28['actions'][_0x45878d];});}else{loggerBooked['info'](_0x9978('0x1e4'),JSON['stringify'](_0x2e8b60[_0x9978('0x6e')]),'Queue:\x20',_0x2e8b60[_0x9978('0x46')]);_0x305e28[_0x9978('0xbc')](_0x2e8b60);hopperUtils[_0x9978('0xf2')]({'active':![],'ContactId':_0x305e28[_0x9978('0x23')][_0x45878d][_0x9978('0xd8')],'ListId':_0x305e28[_0x9978('0x23')][_0x45878d][_0x9978('0xd9')],'VoiceQueueId':_0x305e28[_0x9978('0x23')][_0x45878d][_0x9978('0xda')]||undefined,'CampaignId':_0x305e28['actions'][_0x45878d][_0x9978('0xdb')]||undefined})['catch'](loggerCatch(_0x9978('0x1e3')));delete _0x305e28[_0x9978('0x23')][_0x45878d];}}else{return _0x305e28['actionOriginate'](_0x2e8b60,_0x24e3db);}}else{if(utils[_0x9978('0x5e')](undefined,_0x24e3db[_0x9978('0x1e5')])<_0x2e8b60[_0x9978('0x1e6')]*0x3c){if(_0x24e3db[_0x9978('0x151')]&&!_0x24e3db[_0x9978('0x151')][_0x9978('0x1e7')]){_0x305e28['preview'][_0x9978('0xf9')](_0x24e3db['id'])[_0x9978('0xf1')](function(){_0x305e28['updateOriginated'](_0x2e8b60);});}else{hopperUtils[_0x9978('0x1e8')]({'active':![]},_0x24e3db['id'],0x1)[_0x9978('0xf1')](function(){_0x305e28[_0x9978('0xbc')](_0x2e8b60);});}}else{_0x2e8b60[_0x9978('0x1e9')]+=0x1;_0x305e28[_0x9978('0xbc')](_0x2e8b60);if(_0x2e8b60[_0x9978('0x1ea')]){hopperUtils[_0x9978('0xf2')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x24e3db[_0x9978('0xd8')],'ListId':_0x24e3db[_0x9978('0xd9')],'VoiceQueueId':_0x24e3db[_0x9978('0xda')]||undefined,'CampaignId':_0x24e3db[_0x9978('0xdb')]||undefined})['catch'](loggerCatch(_0x9978('0x1eb')));hopperUtils[_0x9978('0xc2')](createObjHistory(_0x2e8b60,_0x24e3db,utils['CAMPAIGN_STATUS'][_0x9978('0x1ec')],0x17,_0x9978('0x1ed')))[_0x9978('0x9b')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x305e28['saveInDb'](createObjHistory(_0x2e8b60,_0x24e3db,utils[_0x9978('0x66')]['RECALL_TIMEOUT'],0x16,'RecallFailedTimeout'),_0x9978('0x1ee'),_0x9978('0x1ef'));}}}}else{_0x2e8b60[_0x9978('0x1f0')]+=0x1;_0x305e28['saveInDb'](createObjHistory(_0x2e8b60,_0x24e3db,utils[_0x9978('0x66')]['BLACKLIST'],0xd,'Blacklist'),_0x9978('0x1f1'),_0x9978('0x1f2'));throw _0x9978('0x1f3');}};};Dialer[_0x9978('0x18')][_0x9978('0x152')]=function(_0x5f4206){var _0x22807b=this;var _0x1528e5=_0x5f4206[_0x9978('0x1f4')]-_0x5f4206[_0x9978('0x7d')];emitCampaignSummary(_0x5f4206);if(_0x1528e5>0x0&&_0x5f4206[_0x9978('0x64')]==0x0){if(_0x1528e5>this[_0x9978('0x21')]){_0x1528e5=this['maxNumberOriginate'];}_0x5f4206[_0x9978('0x64')]=0x1;hopperUtils[_0x9978('0x1f5')](_0x5f4206,_0x1528e5)[_0x9978('0x3c')](function(_0xd0f2c){_0x5f4206[_0x9978('0x64')]=0x0;if(_0xd0f2c){if(!utils[_0x9978('0x1f6')](_0xd0f2c)){_0x5f4206[_0x9978('0x6b')]=utils[_0x9978('0x66')][_0x9978('0x69')];logger['info'](_0x9978('0x1f7')+_0x5f4206[_0x9978('0x46')]);}else{_0x5f4206[_0x9978('0x7d')]+=_0xd0f2c[_0x9978('0x94')];_0x5f4206[_0x9978('0x6b')]=utils[_0x9978('0x66')][_0x9978('0x1f8')];for(var _0x4fed34=0x0;_0x4fed34<_0xd0f2c['length'];_0x4fed34+=0x1){_0x5f4206['ivrTotalCallsDays']+=0x1;if(_[_0x9978('0xeb')](_0xd0f2c[_0x4fed34])||_['isNil'](_0xd0f2c[_0x4fed34][_0x9978('0x16e')])||_[_0x9978('0xeb')](_0xd0f2c[_0x4fed34][_0x9978('0x157')])){_0x22807b[_0x9978('0x14c')](_0x9978('0x1f9'),_0x5f4206,_0xd0f2c[_0x4fed34]);}else{hopperUtils[_0x9978('0x1fa')](_[_0x9978('0x72')](_0xd0f2c[_0x4fed34],['CampaignId',_0x9978('0x157')]))['then'](_0x22807b[_0x9978('0x1dc')](_0x5f4206,_0xd0f2c[_0x4fed34]))['catch'](_0x22807b[_0x9978('0x14b')](_0x9978('0x1fb'),_0x5f4206));}}}}})[_0x9978('0x9b')](loggerGetContactDialer(_0x9978('0x1fc'),_0x5f4206,_0x1528e5));}};Dialer[_0x9978('0x18')][_0x9978('0xad')]=function(_0x584309,_0x5dedac){var _0x312899=this;var _0x2c8dbc=[];if(_0x5dedac<0x1||_0x584309[_0x9978('0xac')]===_0x9978('0x1de')){_0x5dedac=0x1;}var _0x263400=Math['floor'](_0x584309[_0x9978('0x134')]*_0x5dedac)-_0x584309[_0x9978('0x7d')];if(_0x584309[_0x9978('0x1fd')]>0x0){var _0x5dbceb=_0x584309[_0x9978('0x1fd')]-_0x584309[_0x9978('0x7d')]-_0x584309[_0x9978('0x1b4')]-_0x584309[_0x9978('0x136')];if(_0x263400>_0x5dbceb){_0x263400=_0x5dbceb;}}if(_0x263400>0x0&&_0x584309[_0x9978('0x64')]==0x0){if(_0x584309[_0x9978('0xac')]===_0x9978('0x1de')){_0x263400=0x1;}if(_0x263400>this[_0x9978('0x21')]){_0x263400=this[_0x9978('0x21')];}for(var _0x3c3492 in this[_0x9978('0x1f')]){if(typeof this['agents'][_0x3c3492]!=='undefined'){if(this[_0x9978('0x1f')][_0x3c3492][_0x9978('0xca')]==='not_inuse'&&this[_0x9978('0x1f')][_0x3c3492][_0x9978('0x86')]===_0x9978('0x87')){_0x2c8dbc[_0x9978('0x95')](this[_0x9978('0x1f')][_0x3c3492]['id']);}}}_0x584309[_0x9978('0x64')]=0x1;hopperUtils[_0x9978('0x1fe')](_0x584309,_0x2c8dbc,_0x263400)['then'](function(_0x2d7d10){_0x584309['temp']=0x0;if(_0x2d7d10){if(!utils[_0x9978('0x1f6')](_0x2d7d10)){hopperUtils[_0x9978('0x1ff')](_0x584309)[_0x9978('0x3c')](sendMessageReschedule(_0x584309))[_0x9978('0x9b')](loggerCatch(_0x9978('0x200')));}else{_0x584309[_0x9978('0x7d')]+=_0x2d7d10[_0x9978('0x94')];_0x584309[_0x9978('0x6b')]=_0x584309[_0x9978('0xac')]==='booked'?utils[_0x9978('0x66')]['ACTIVE']:utils['CAMPAIGN_STATUS'][_0x9978('0x1f8')];for(var _0x333d89=0x0;_0x333d89<_0x2d7d10[_0x9978('0x94')];_0x333d89+=0x1){if(_[_0x9978('0xeb')](_0x2d7d10[_0x333d89])||_[_0x9978('0xeb')](_0x2d7d10[_0x333d89][_0x9978('0x16e')])||_['isNil'](_0x2d7d10[_0x333d89]['phone'])){_0x312899['emptyContact']('[actionOriginate]\x20',_0x584309,_0x2d7d10[_0x333d89]);}else{hopperUtils[_0x9978('0x201')](_['pick'](_0x2d7d10[_0x333d89],[_0x9978('0xda'),_0x9978('0x157')]))[_0x9978('0x3c')](_0x312899[_0x9978('0x1dc')](_0x584309,_0x2d7d10[_0x333d89]))['catch'](_0x312899['loggerHandler'](_0x9978('0x1f9'),_0x584309));}}}}})[_0x9978('0x9b')](loggerGetContactDialer('[getContactDialer2]',_0x584309,_0x263400));}};Dialer['prototype'][_0x9978('0x60')]=function(_0x33cc32){if(_0x33cc32[_0x9978('0x1fd')]>0x0){var _0x52abd8=_0x33cc32[_0x9978('0x1fd')]-_0x33cc32[_0x9978('0x7d')]-_0x33cc32[_0x9978('0x1b4')];if(_0x52abd8>0x0&&_0x33cc32[_0x9978('0x64')]==0x0){this[_0x9978('0x202')](_0x33cc32);}else{loggerPredictiveCalls[_0x9978('0x49')](_0x9978('0x203'));}}else{this[_0x9978('0x202')](_0x33cc32);}};Dialer[_0x9978('0x18')]['tryOriginatePredictive']=function(_0xd660b7){var _0x123839=this;var _0x209119=[];_0xd660b7[_0x9978('0x7d')]+=0x1;for(var _0x16c00f in this[_0x9978('0x1f')]){if(typeof this['agents'][_0x16c00f]!=='undefined'){if(this[_0x9978('0x1f')][_0x16c00f][_0x9978('0xca')]===_0x9978('0x204')&&this[_0x9978('0x1f')][_0x16c00f][_0x9978('0x86')]===_0x9978('0x87')){_0x209119[_0x9978('0x95')](this['agents'][_0x16c00f]['id']);}}}_0xd660b7[_0x9978('0x64')]=0x1;return this['getContactDialer'](_0xd660b7['id'],_0x209119,0x1,_0xd660b7['dialOrderByScheduledAt'],_0xd660b7)['then'](function(_0x4579b6){_0xd660b7[_0x9978('0x64')]=0x1;if(_0x4579b6){if(!utils[_0x9978('0x1f6')](_0x4579b6)){utils[_0x9978('0x63')](_0xd660b7,0x1,0x0);return hopperUtils['countReScheduled'](_0xd660b7)['then'](sendMessageReschedule(_0xd660b7))[_0x9978('0x9b')](loggerCatch(_0x9978('0x200')));}else{_0xd660b7['message']=utils['CAMPAIGN_STATUS'][_0x9978('0x1f8')];if(_[_0x9978('0xeb')](_0x4579b6[0x0])||_[_0x9978('0xeb')](_0x4579b6[0x0][_0x9978('0x16e')])||_[_0x9978('0xeb')](_0x4579b6[0x0][_0x9978('0x157')])){_0x123839[_0x9978('0x14c')](_0x9978('0x1f9'),_0xd660b7,_0x4579b6[0x0]);}else{return hopperUtils[_0x9978('0x201')](_[_0x9978('0x72')](_0x4579b6[0x0],[_0x9978('0xda'),_0x9978('0x157')]))[_0x9978('0x3c')](_0x123839[_0x9978('0x1dc')](_0xd660b7,_0x4579b6[0x0]))['catch'](_0x123839['loggerHandler'](_0x9978('0x205'),_0xd660b7));}}}})[_0x9978('0x9b')](loggerGetContactDialer(_0x9978('0x206'),_0xd660b7,0x1));};Dialer[_0x9978('0x18')][_0x9978('0x1cf')]=function(_0x51ba4c,_0x1bdc51,_0x36b646,_0x2b7769,_0x1450fa,_0x17d4a4){loggerPredictive[_0x9978('0x49')](_0x9978('0x207'));loggerPredictive[_0x9978('0x49')](_0x9978('0x208'),_0x51ba4c);loggerPredictive[_0x9978('0x49')](_0x9978('0x209'),_0x1bdc51);loggerPredictive[_0x9978('0x49')](_0x9978('0x20a'),_0x36b646);loggerPredictive[_0x9978('0x49')](_0x9978('0x20b'),_0x2b7769);loggerPredictive[_0x9978('0x49')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1450fa);loggerPredictive[_0x9978('0x49')](_0x9978('0x51'));return new Promise(function(_0x3a3719,_0x463479){if(_0x51ba4c<=0x0||isNaN(_0x51ba4c)){return _0x463479(msgResponse(_0x9978('0x20c'),_0x9978('0x83'),'m\x20=\x20'+_0x51ba4c));}if(_0x36b646<=0x0||isNaN(_0x36b646)){return _0x463479(msgResponse(_0x9978('0x20c'),'Error',_0x9978('0x20d')+_0x36b646));}if(_0x2b7769<=0x0||isNaN(_0x2b7769)){return _0x463479(msgResponse(_0x9978('0x20c'),_0x9978('0x83'),_0x9978('0x20e')+_0x2b7769));}if(_0x1bdc51<=0x0||isNaN(_0x1bdc51)){return _0x463479(msgResponse(_0x9978('0x20c'),_0x9978('0x83'),_0x9978('0x20f')+_0x1bdc51));}if(_0x1450fa<=0x0||isNaN(_0x1450fa)){return _0x463479(msgResponse(_0x9978('0x20c'),_0x9978('0x83'),_0x9978('0x210')+_0x1450fa));}_0x17d4a4=_0x17d4a4||0x0;var _0x46c962=0x1/_0x36b646;var _0x18cfbb=0x0;var _0x43aa42=0x0;var _0x155a2a=0x0;var _0x5572cf=0x0;for(var _0x3f5085=0x0;_0x155a2a<_0x1450fa;_0x3f5085+=0x1){_0x43aa42=_0x3f5085/_0x1bdc51;_0x18cfbb=(_0x2b7769*_0x43aa42+_0x17d4a4)/_0x46c962;_0x155a2a=utils[_0x9978('0x211')](_0x18cfbb,_0x51ba4c);_0x5572cf=_0x18cfbb/_0x51ba4c*(0x1-utils[_0x9978('0x211')](_0x18cfbb,_0x51ba4c));}return _0x3a3719({'erlangCalls':_0x3f5085,'erlangCallToSecond':_0x1bdc51/_0x3f5085,'erlangAbandonmentRate':_0x155a2a,'erlangBusyFactor':_0x5572cf});});};Dialer[_0x9978('0x18')][_0x9978('0x1d9')]=function(_0x3ba3fe,_0x1ab5c0,_0x2bc419,_0x22adb0,_0x17b9fe,_0x42ee8e){loggerPredictive[_0x9978('0x49')](_0x9978('0x212'));loggerPredictive[_0x9978('0x49')](_0x9978('0x208'),_0x3ba3fe);loggerPredictive[_0x9978('0x49')](_0x9978('0x209'),_0x1ab5c0);loggerPredictive[_0x9978('0x49')]('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2bc419);loggerPredictive[_0x9978('0x49')](_0x9978('0x20b'),_0x22adb0);loggerPredictive[_0x9978('0x49')](_0x9978('0x213'),_0x17b9fe);loggerPredictive[_0x9978('0x49')](_0x9978('0x51'));return new Promise(function(_0x7b4b67,_0x350ddb){if(_0x3ba3fe<=0x0||isNaN(_0x3ba3fe)){return _0x350ddb(msgResponse(_0x9978('0x214'),_0x9978('0x83'),_0x9978('0x215')+_0x3ba3fe));}if(_0x2bc419<=0x0||isNaN(_0x2bc419)){return _0x350ddb(msgResponse('[busyFactor]','Error',_0x9978('0x20d')+_0x2bc419));}if(_0x22adb0<=0x0||isNaN(_0x22adb0)){return _0x350ddb(msgResponse(_0x9978('0x214'),_0x9978('0x83'),_0x9978('0x20e')+_0x22adb0));}if(_0x1ab5c0<=0x0||isNaN(_0x1ab5c0)){return _0x350ddb(msgResponse(_0x9978('0x214'),'Error',_0x9978('0x20f')+_0x1ab5c0));}if(_0x17b9fe<=0x0||isNaN(_0x17b9fe)){return _0x350ddb(msgResponse(_0x9978('0x214'),_0x9978('0x83'),_0x9978('0x216')+_0x17b9fe));}_0x42ee8e=_0x42ee8e||0x0;var _0x1adb34=0x1/_0x2bc419;var _0x284ba3=0x0;var _0x4e80f4=0x0;var _0x55a672=0x0;var _0x130f00=0x0;for(var _0x1f763a=0x0;_0x130f00<_0x17b9fe;_0x1f763a+=0x1){_0x4e80f4=_0x1f763a/_0x1ab5c0;_0x284ba3=(_0x22adb0*_0x4e80f4+_0x42ee8e)/_0x1adb34;_0x55a672=utils['erlangb'](_0x284ba3,_0x3ba3fe);_0x130f00=_0x284ba3/_0x3ba3fe*(0x1-utils[_0x9978('0x211')](_0x284ba3,_0x3ba3fe));}return _0x7b4b67({'erlangCalls':_0x1f763a,'erlangCallToSecond':_0x1ab5c0/_0x1f763a,'erlangAbandonmentRate':_0x55a672,'erlangBusyFactor':_0x130f00});});};module['exports']=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/models/action.js b/server/services/ami/dialer/models/action.js index f56550b..0cd10af 100644 --- a/server/services/ami/dialer/models/action.js +++ b/server/services/ami/dialer/models/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2cff=['countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','voiceQueue','dialCutDigit','substring','getQueue','exports','util','lodash','moment','isNil','string','uniqueid','name','phone','Contact','firstName','lastName','number','queue','active','type','dialQueueTimeout','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry'];(function(_0x5806e2,_0x272c9d){var _0x33e191=function(_0x4a184a){while(--_0x4a184a){_0x5806e2['push'](_0x5806e2['shift']());}};_0x33e191(++_0x272c9d);}(_0x2cff,0x152));var _0xf2cf=function(_0x2a58f4,_0x13885b){_0x2a58f4=_0x2a58f4-0x0;var _0x58ef72=_0x2cff[_0x2a58f4];return _0x58ef72;};'use strict';var util=require(_0xf2cf('0x0'));var _=require(_0xf2cf('0x1'));var moment=require(_0xf2cf('0x2'));function checkNameSurname(_0x470416,_0x3eb107,_0x135532){var _0x27b63c='';if(!_[_0xf2cf('0x3')](_0x3eb107)&&_0xf2cf('0x4')===typeof _0x3eb107){_0x27b63c+=_0x3eb107;}if(!_[_0xf2cf('0x3')](_0x135532)&&_0xf2cf('0x4')===typeof _0x135532){_0x27b63c+='\x20'+_0x135532;}if(_0x27b63c!==''){return _0x27b63c;}return _0x470416;}function Action(_0x54722a,_0x2e17e8,_0x24bf91){this['voiceQueue']=_0x54722a;this[_0xf2cf('0x5')]=_0x24bf91||undefined;this[_0xf2cf('0x6')]=checkNameSurname(_0x2e17e8['Contact'][_0xf2cf('0x7')],_0x2e17e8[_0xf2cf('0x8')][_0xf2cf('0x9')],_0x2e17e8['Contact'][_0xf2cf('0xa')]);this[_0xf2cf('0xb')]=_0x2e17e8[_0xf2cf('0x7')];this[_0xf2cf('0xc')]=_0x54722a[_0xf2cf('0x6')];this[_0xf2cf('0xd')]=_0x2e17e8['active']||![];this[_0xf2cf('0xe')]=_0x54722a[_0xf2cf('0xe')];this[_0xf2cf('0xf')]=_0x54722a[_0xf2cf('0xf')]||0x3;this['scheduledat']=_0x2e17e8['scheduledat'];this[_0xf2cf('0x10')]=_0x2e17e8[_0xf2cf('0x10')];this[_0xf2cf('0x11')]=_0x2e17e8[_0xf2cf('0x11')];this[_0xf2cf('0x12')]=_0x2e17e8[_0xf2cf('0x12')];this[_0xf2cf('0x13')]=_0x2e17e8[_0xf2cf('0x13')];this[_0xf2cf('0x14')]=_0x2e17e8[_0xf2cf('0x14')];this[_0xf2cf('0x15')]=_0x2e17e8[_0xf2cf('0x15')];this['countmachineretry']=_0x2e17e8[_0xf2cf('0x16')];this[_0xf2cf('0x17')]=_0x2e17e8[_0xf2cf('0x17')];this[_0xf2cf('0x18')]=_0x2e17e8[_0xf2cf('0x18')];this[_0xf2cf('0x19')]=_0x2e17e8[_0xf2cf('0x19')];this[_0xf2cf('0x1a')]=_0x2e17e8['UserId'];this[_0xf2cf('0x1b')]=_0x2e17e8[_0xf2cf('0x1b')];this[_0xf2cf('0x1c')]=_0x2e17e8[_0xf2cf('0x1c')];this['idHopper']=_0x2e17e8['id'];this['ContactFirstName']=_0x2e17e8[_0xf2cf('0x8')][_0xf2cf('0x9')]||'';this['starttime']=moment()[_0xf2cf('0x1d')](_0xf2cf('0x1e'));this[_0xf2cf('0x1f')]=_0x2e17e8[_0xf2cf('0x1f')];this[_0xf2cf('0x20')]=_0x2e17e8['callbackuniqueid'];this['callbackat']=_0x2e17e8[_0xf2cf('0x21')];this['recallme']=_0x2e17e8[_0xf2cf('0x22')];this[_0xf2cf('0x23')]='';this[_0xf2cf('0x24')]='';}Action[_0xf2cf('0x25')][_0xf2cf('0x26')]=function(){return util['format'](_0xf2cf('0x27'),this[_0xf2cf('0x6')],this[_0xf2cf('0x28')][_0xf2cf('0x29')]>0x0?this[_0xf2cf('0xb')][_0xf2cf('0x2a')](this[_0xf2cf('0x28')]['dialCutDigit']):this['number']);};Action[_0xf2cf('0x25')][_0xf2cf('0x2b')]=function(){return this[_0xf2cf('0xc')];};module[_0xf2cf('0x2c')]=Action; \ No newline at end of file +var _0xc94c=['firstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','lodash','moment','isNil','string','voiceQueue','name','Contact','phone','lastName','number','queue','active','type','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper'];(function(_0x5e0b9b,_0x10e7f3){var _0x2b6bee=function(_0x5efb51){while(--_0x5efb51){_0x5e0b9b['push'](_0x5e0b9b['shift']());}};_0x2b6bee(++_0x10e7f3);}(_0xc94c,0x19c));var _0xcc94=function(_0x33d7a1,_0x7ff978){_0x33d7a1=_0x33d7a1-0x0;var _0x426e90=_0xc94c[_0x33d7a1];return _0x426e90;};'use strict';var util=require('util');var _=require(_0xcc94('0x0'));var moment=require(_0xcc94('0x1'));function checkNameSurname(_0x32a0ae,_0x5c3f3f,_0x4c99a0){var _0x118667='';if(!_[_0xcc94('0x2')](_0x5c3f3f)&&_0xcc94('0x3')===typeof _0x5c3f3f){_0x118667+=_0x5c3f3f;}if(!_[_0xcc94('0x2')](_0x4c99a0)&&_0xcc94('0x3')===typeof _0x4c99a0){_0x118667+='\x20'+_0x4c99a0;}if(_0x118667!==''){return _0x118667;}return _0x32a0ae;}function Action(_0x2e7195,_0x1a2b76,_0x1ea25f){this[_0xcc94('0x4')]=_0x2e7195;this['uniqueid']=_0x1ea25f||undefined;this[_0xcc94('0x5')]=checkNameSurname(_0x1a2b76[_0xcc94('0x6')][_0xcc94('0x7')],_0x1a2b76[_0xcc94('0x6')]['firstName'],_0x1a2b76['Contact'][_0xcc94('0x8')]);this[_0xcc94('0x9')]=_0x1a2b76['phone'];this[_0xcc94('0xa')]=_0x2e7195[_0xcc94('0x5')];this[_0xcc94('0xb')]=_0x1a2b76[_0xcc94('0xb')]||![];this[_0xcc94('0xc')]=_0x2e7195['type'];this['dialQueueTimeout']=_0x2e7195['dialQueueTimeout']||0x3;this['scheduledat']=_0x1a2b76[_0xcc94('0xd')];this['countbusyretry']=_0x1a2b76[_0xcc94('0xe')];this[_0xcc94('0xf')]=_0x1a2b76[_0xcc94('0xf')];this['countnoanswerretry']=_0x1a2b76[_0xcc94('0x10')];this[_0xcc94('0x11')]=_0x1a2b76[_0xcc94('0x11')];this[_0xcc94('0x12')]=_0x1a2b76[_0xcc94('0x12')];this[_0xcc94('0x13')]=_0x1a2b76[_0xcc94('0x13')];this[_0xcc94('0x14')]=_0x1a2b76[_0xcc94('0x14')];this[_0xcc94('0x15')]=_0x1a2b76[_0xcc94('0x15')];this[_0xcc94('0x16')]=_0x1a2b76[_0xcc94('0x16')];this[_0xcc94('0x17')]=_0x1a2b76[_0xcc94('0x17')];this[_0xcc94('0x18')]=_0x1a2b76[_0xcc94('0x18')];this[_0xcc94('0x19')]=_0x1a2b76['VoiceQueueId'];this[_0xcc94('0x1a')]=_0x1a2b76[_0xcc94('0x1a')];this[_0xcc94('0x1b')]=_0x1a2b76['id'];this['ContactFirstName']=_0x1a2b76[_0xcc94('0x6')][_0xcc94('0x1c')]||'';this[_0xcc94('0x1d')]=moment()[_0xcc94('0x1e')](_0xcc94('0x1f'));this[_0xcc94('0x20')]=_0x1a2b76[_0xcc94('0x20')];this[_0xcc94('0x21')]=_0x1a2b76['callbackuniqueid'];this[_0xcc94('0x22')]=_0x1a2b76[_0xcc94('0x22')];this[_0xcc94('0x23')]=_0x1a2b76[_0xcc94('0x23')];this[_0xcc94('0x24')]='';this[_0xcc94('0x25')]='';}Action[_0xcc94('0x26')][_0xcc94('0x27')]=function(){return util['format'](_0xcc94('0x28'),this[_0xcc94('0x5')],this['voiceQueue'][_0xcc94('0x29')]>0x0?this['number'][_0xcc94('0x2a')](this[_0xcc94('0x4')][_0xcc94('0x29')]):this[_0xcc94('0x9')]);};Action[_0xcc94('0x26')][_0xcc94('0x2b')]=function(){return this['queue'];};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/models/agentComplete.js b/server/services/ami/dialer/models/agentComplete.js index 288d8e5..69bd509 100644 --- a/server/services/ami/dialer/models/agentComplete.js +++ b/server/services/ami/dialer/models/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2175=['campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','starttime','responsetime','answertime','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','../utils','state','statedesc','Answer','type'];(function(_0x2b560b,_0x878870){var _0x151fe8=function(_0xc2f4d9){while(--_0xc2f4d9){_0x2b560b['push'](_0x2b560b['shift']());}};_0x151fe8(++_0x878870);}(_0x2175,0x143));var _0x5217=function(_0x42c2ad,_0x975f90){_0x42c2ad=_0x42c2ad-0x0;var _0xb22f48=_0x2175[_0x42c2ad];return _0xb22f48;};'use strict';var moment=require('moment');var utils=require(_0x5217('0x0'));function AgentComplete(_0x5401be,_0x128ee2){this[_0x5217('0x1')]=0x4;this[_0x5217('0x2')]=_0x5217('0x3');this['scheduledat']=_0x5401be['scheduledat'];this[_0x5217('0x4')]=_0x5401be[_0x5217('0x4')];this[_0x5217('0x5')]=_0x5401be[_0x5217('0x4')]==='outbound'?_0x5217('0x6'):_0x5401be[_0x5217('0x4')];this['countbusyretry']=_0x5401be[_0x5217('0x7')];this['countcongestionretry']=_0x5401be[_0x5217('0x8')];this[_0x5217('0x9')]=_0x5401be[_0x5217('0x9')];this[_0x5217('0xa')]=_0x5401be[_0x5217('0x7')]+_0x5401be[_0x5217('0x8')]+_0x5401be[_0x5217('0x9')]+_0x5401be[_0x5217('0xb')]+_0x5401be[_0x5217('0xc')]+_0x5401be[_0x5217('0xd')]+_0x5401be[_0x5217('0xe')]+_0x5401be[_0x5217('0xf')];this[_0x5217('0xb')]=_0x5401be['countnosuchnumberretry'];this['countdropretry']=_0x5401be[_0x5217('0xc')];this['countabandonedretry']=_0x5401be[_0x5217('0xd')];this[_0x5217('0xe')]=_0x5401be[_0x5217('0xe')];this[_0x5217('0xf')]=_0x5401be[_0x5217('0xf')];this[_0x5217('0x10')]=_0x128ee2[_0x5217('0x10')];this[_0x5217('0x11')]=_0x5401be[_0x5217('0x12')];this['calleridnum']=_0x5401be['number'];this[_0x5217('0x13')]=_0x5401be[_0x5217('0x13')];this[_0x5217('0x14')]=_0x5401be[_0x5217('0x14')];this['answertime']=_0x5401be[_0x5217('0x15')];this['endtime']=moment()['format'](_0x5217('0x16'));this[_0x5217('0x17')]=utils[_0x5217('0x18')](_0x5401be[_0x5217('0x14')],_0x5401be[_0x5217('0x13')]);this[_0x5217('0x19')]=utils[_0x5217('0x18')](_0x5401be[_0x5217('0x15')],_0x5401be[_0x5217('0x14')]);this[_0x5217('0x1a')]=utils[_0x5217('0x18')](this['endtime'],_0x5401be['answertime']);this['queue']=_0x128ee2[_0x5217('0x6')];this[_0x5217('0x1b')]=_0x128ee2[_0x5217('0x1b')];this[_0x5217('0x1c')]=_0x128ee2[_0x5217('0x1c')];this[_0x5217('0x1d')]=_0x5401be[_0x5217('0x1d')];this[_0x5217('0x1e')]=_0x5401be[_0x5217('0x1e')];this[_0x5217('0x1f')]=_0x5401be['callbackat'];this['recallme']=_0x5401be[_0x5217('0x20')];this[_0x5217('0x21')]=_0x5401be[_0x5217('0x21')];this['ListId']=_0x5401be['ListId'];this[_0x5217('0x22')]=_0x5401be[_0x5217('0x22')];this[_0x5217('0x23')]=_0x5401be[_0x5217('0x23')];this[_0x5217('0x24')]=_0x5401be[_0x5217('0x24')];this[_0x5217('0x25')]=_0x5401be[_0x5217('0x25')]||'';this[_0x5217('0x26')]=_0x5401be['originatecalleridname']||'';this[_0x5217('0x27')]=_0x5401be['agiafterat'];}module[_0x5217('0x28')]=AgentComplete; \ No newline at end of file +var _0x7742=['countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','answertime','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','endtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','moment','../utils','state','statedesc','Answer','scheduledat','type','campaigntype','queue'];(function(_0x30f881,_0xb20ecb){var _0x2d7837=function(_0x4e9c8a){while(--_0x4e9c8a){_0x30f881['push'](_0x30f881['shift']());}};_0x2d7837(++_0xb20ecb);}(_0x7742,0x12b));var _0x2774=function(_0x2bcaa0,_0x23375c){_0x2bcaa0=_0x2bcaa0-0x0;var _0x37b9d3=_0x7742[_0x2bcaa0];return _0x37b9d3;};'use strict';var moment=require(_0x2774('0x0'));var utils=require(_0x2774('0x1'));function AgentComplete(_0x297cce,_0x3a0ad5){this[_0x2774('0x2')]=0x4;this[_0x2774('0x3')]=_0x2774('0x4');this[_0x2774('0x5')]=_0x297cce[_0x2774('0x5')];this[_0x2774('0x6')]=_0x297cce[_0x2774('0x6')];this[_0x2774('0x7')]=_0x297cce[_0x2774('0x6')]==='outbound'?_0x2774('0x8'):_0x297cce['type'];this[_0x2774('0x9')]=_0x297cce[_0x2774('0x9')];this[_0x2774('0xa')]=_0x297cce[_0x2774('0xa')];this['countnoanswerretry']=_0x297cce[_0x2774('0xb')];this[_0x2774('0xc')]=_0x297cce[_0x2774('0x9')]+_0x297cce[_0x2774('0xa')]+_0x297cce[_0x2774('0xb')]+_0x297cce[_0x2774('0xd')]+_0x297cce[_0x2774('0xe')]+_0x297cce[_0x2774('0xf')]+_0x297cce[_0x2774('0x10')]+_0x297cce[_0x2774('0x11')];this[_0x2774('0xd')]=_0x297cce[_0x2774('0xd')];this[_0x2774('0xe')]=_0x297cce['countdropretry'];this['countabandonedretry']=_0x297cce[_0x2774('0xf')];this[_0x2774('0x10')]=_0x297cce['countmachineretry'];this[_0x2774('0x11')]=_0x297cce[_0x2774('0x11')];this[_0x2774('0x12')]=_0x3a0ad5[_0x2774('0x12')];this[_0x2774('0x13')]=_0x297cce['name'];this[_0x2774('0x14')]=_0x297cce[_0x2774('0x15')];this[_0x2774('0x16')]=_0x297cce['starttime'];this['responsetime']=_0x297cce[_0x2774('0x17')];this['answertime']=_0x297cce[_0x2774('0x18')];this['endtime']=moment()['format'](_0x2774('0x19'));this[_0x2774('0x1a')]=utils[_0x2774('0x1b')](_0x297cce[_0x2774('0x17')],_0x297cce[_0x2774('0x16')]);this[_0x2774('0x1c')]=utils[_0x2774('0x1b')](_0x297cce[_0x2774('0x18')],_0x297cce[_0x2774('0x17')]);this[_0x2774('0x1d')]=utils[_0x2774('0x1b')](this[_0x2774('0x1e')],_0x297cce[_0x2774('0x18')]);this[_0x2774('0x8')]=_0x3a0ad5[_0x2774('0x8')];this[_0x2774('0x1f')]=_0x3a0ad5[_0x2774('0x1f')];this[_0x2774('0x20')]=_0x3a0ad5[_0x2774('0x20')];this[_0x2774('0x21')]=_0x297cce[_0x2774('0x21')];this[_0x2774('0x22')]=_0x297cce['callbackuniqueid'];this[_0x2774('0x23')]=_0x297cce[_0x2774('0x23')];this[_0x2774('0x24')]=_0x297cce[_0x2774('0x24')];this[_0x2774('0x25')]=_0x297cce[_0x2774('0x25')];this[_0x2774('0x26')]=_0x297cce['ListId'];this[_0x2774('0x27')]=_0x297cce['UserId'];this[_0x2774('0x28')]=_0x297cce['VoiceQueueId'];this[_0x2774('0x29')]=_0x297cce[_0x2774('0x29')];this[_0x2774('0x2a')]=_0x297cce[_0x2774('0x2a')]||'';this['originatecalleridname']=_0x297cce['originatecalleridname']||'';this['agiafterat']=_0x297cce['agiafterat'];}module[_0x2774('0x2b')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/models/final.js b/server/services/ami/dialer/models/final.js index be8065d..73d7a7b 100644 --- a/server/services/ami/dialer/models/final.js +++ b/server/services/ami/dialer/models/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5ef6=['endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime'];(function(_0x371a8f,_0x17fbbb){var _0x2adf81=function(_0x2ef079){while(--_0x2ef079){_0x371a8f['push'](_0x371a8f['shift']());}};_0x2adf81(++_0x17fbbb);}(_0x5ef6,0x95));var _0x65ef=function(_0x70504d,_0x34e810){_0x70504d=_0x70504d-0x0;var _0x47e29b=_0x5ef6[_0x70504d];return _0x47e29b;};'use strict';function Final(_0x229999){this[_0x65ef('0x0')]=_0x229999[_0x65ef('0x0')];this[_0x65ef('0x1')]=_0x229999[_0x65ef('0x1')];this[_0x65ef('0x2')]=_0x229999[_0x65ef('0x2')];this['campaigntype']=_0x229999[_0x65ef('0x2')]==='outbound'?_0x65ef('0x3'):_0x229999[_0x65ef('0x2')];this[_0x65ef('0x4')]=_0x229999[_0x65ef('0x4')];this[_0x65ef('0x5')]=_0x229999['countcongestionretry'];this[_0x65ef('0x6')]=_0x229999['countnoanswerretry'];this['countglobal']=_0x229999[_0x65ef('0x4')]+_0x229999[_0x65ef('0x5')]+_0x229999[_0x65ef('0x6')]+_0x229999[_0x65ef('0x7')]+_0x229999[_0x65ef('0x8')]+_0x229999[_0x65ef('0x9')]+_0x229999[_0x65ef('0xa')]+_0x229999[_0x65ef('0xb')];this[_0x65ef('0x7')]=_0x229999[_0x65ef('0x7')];this[_0x65ef('0x8')]=_0x229999[_0x65ef('0x8')];this[_0x65ef('0x9')]=_0x229999[_0x65ef('0x9')];this[_0x65ef('0xa')]=_0x229999[_0x65ef('0xa')];this[_0x65ef('0xb')]=_0x229999[_0x65ef('0xb')];this[_0x65ef('0x3')]=_0x229999[_0x65ef('0x3')];this[_0x65ef('0xc')]=_0x229999[_0x65ef('0xc')];this[_0x65ef('0xd')]=_0x229999[_0x65ef('0xd')];this['starttime']=_0x229999[_0x65ef('0xe')];this[_0x65ef('0xf')]=_0x229999[_0x65ef('0xf')];this[_0x65ef('0x10')]=_0x229999[_0x65ef('0xf')];this[_0x65ef('0x11')]=_0x229999[_0x65ef('0x11')]||0x0;this[_0x65ef('0x12')]=_0x229999[_0x65ef('0x12')]||0x0;this[_0x65ef('0x13')]=_0x229999[_0x65ef('0x13')]||0x0;this['callback']=_0x229999[_0x65ef('0x14')];this[_0x65ef('0x15')]=_0x229999[_0x65ef('0x15')];this['callbackat']=_0x229999[_0x65ef('0x16')];this[_0x65ef('0x17')]=_0x229999[_0x65ef('0x17')];this['ContactId']=_0x229999[_0x65ef('0x18')];this['ListId']=_0x229999[_0x65ef('0x19')];this[_0x65ef('0x1a')]=_0x229999[_0x65ef('0x1a')];this['VoiceQueueId']=_0x229999['VoiceQueueId'];this[_0x65ef('0x1b')]=_0x229999[_0x65ef('0x1b')];this[_0x65ef('0x1c')]=_0x229999['originatecalleridnum']||'';this[_0x65ef('0x1d')]=_0x229999[_0x65ef('0x1d')]||'';this[_0x65ef('0x1e')]=_0x229999[_0x65ef('0x1e')];this[_0x65ef('0x1f')]=_0x229999[_0x65ef('0x1f')];}module[_0x65ef('0x20')]=Final; \ No newline at end of file +var _0x9086=['CampaignId','originatecalleridname','state','statedesc','uniqueid','scheduledat','type','campaigntype','outbound','countnoanswerretry','countglobal','countbusyretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','queue','calleridname','starttime','responsetime','endtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId'];(function(_0x5edf49,_0x598d93){var _0x4c6590=function(_0x45f646){while(--_0x45f646){_0x5edf49['push'](_0x5edf49['shift']());}};_0x4c6590(++_0x598d93);}(_0x9086,0x84));var _0x6908=function(_0x491468,_0x42f169){_0x491468=_0x491468-0x0;var _0x5b8c22=_0x9086[_0x491468];return _0x5b8c22;};'use strict';function Final(_0x50cfa6){this[_0x6908('0x0')]=_0x50cfa6[_0x6908('0x0')];this[_0x6908('0x1')]=_0x50cfa6[_0x6908('0x1')];this[_0x6908('0x2')]=_0x50cfa6['type'];this[_0x6908('0x3')]=_0x50cfa6[_0x6908('0x2')]===_0x6908('0x4')?'queue':_0x50cfa6[_0x6908('0x2')];this['countbusyretry']=_0x50cfa6['countbusyretry'];this['countcongestionretry']=_0x50cfa6['countcongestionretry'];this[_0x6908('0x5')]=_0x50cfa6['countnoanswerretry'];this[_0x6908('0x6')]=_0x50cfa6[_0x6908('0x7')]+_0x50cfa6['countcongestionretry']+_0x50cfa6[_0x6908('0x5')]+_0x50cfa6['countnosuchnumberretry']+_0x50cfa6[_0x6908('0x8')]+_0x50cfa6[_0x6908('0x9')]+_0x50cfa6[_0x6908('0xa')]+_0x50cfa6[_0x6908('0xb')];this['countnosuchnumberretry']=_0x50cfa6[_0x6908('0xc')];this[_0x6908('0x8')]=_0x50cfa6[_0x6908('0x8')];this[_0x6908('0x9')]=_0x50cfa6[_0x6908('0x9')];this[_0x6908('0xa')]=_0x50cfa6[_0x6908('0xa')];this[_0x6908('0xb')]=_0x50cfa6[_0x6908('0xb')];this[_0x6908('0xd')]=_0x50cfa6[_0x6908('0xd')];this['calleridname']=_0x50cfa6[_0x6908('0xe')];this['calleridnum']=_0x50cfa6['calleridnum'];this['starttime']=_0x50cfa6[_0x6908('0xf')];this[_0x6908('0x10')]=_0x50cfa6[_0x6908('0x10')];this[_0x6908('0x11')]=_0x50cfa6[_0x6908('0x10')];this['ringtime']=_0x50cfa6['ringtime']||0x0;this[_0x6908('0x12')]=_0x50cfa6['holdtime']||0x0;this[_0x6908('0x13')]=_0x50cfa6['talktime']||0x0;this[_0x6908('0x14')]=_0x50cfa6[_0x6908('0x14')];this[_0x6908('0x15')]=_0x50cfa6[_0x6908('0x15')];this[_0x6908('0x16')]=_0x50cfa6[_0x6908('0x16')];this[_0x6908('0x17')]=_0x50cfa6[_0x6908('0x17')];this[_0x6908('0x18')]=_0x50cfa6[_0x6908('0x18')];this[_0x6908('0x19')]=_0x50cfa6[_0x6908('0x19')];this['UserId']=_0x50cfa6[_0x6908('0x1a')];this[_0x6908('0x1b')]=_0x50cfa6['VoiceQueueId'];this['CampaignId']=_0x50cfa6[_0x6908('0x1c')];this['originatecalleridnum']=_0x50cfa6['originatecalleridnum']||'';this[_0x6908('0x1d')]=_0x50cfa6[_0x6908('0x1d')]||'';this[_0x6908('0x1e')]=_0x50cfa6[_0x6908('0x1e')];this[_0x6908('0x1f')]=_0x50cfa6[_0x6908('0x1f')];}module['exports']=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/models/hangup.js b/server/services/ami/dialer/models/hangup.js index c4aa972..bfcada3 100644 --- a/server/services/ami/dialer/models/hangup.js +++ b/server/services/ami/dialer/models/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x934b=['moment','../utils','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','membername','IVR','reason','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports'];(function(_0x3e9dc2,_0x1514e3){var _0x1da742=function(_0x48aafe){while(--_0x48aafe){_0x3e9dc2['push'](_0x3e9dc2['shift']());}};_0x1da742(++_0x1514e3);}(_0x934b,0xa8));var _0xb934=function(_0x3a5b74,_0x4960ee){_0x3a5b74=_0x3a5b74-0x0;var _0x366746=_0x934b[_0x3a5b74];return _0x366746;};'use strict';var moment=require(_0xb934('0x0'));var utils=require(_0xb934('0x1'));function Hangup(_0x575a27,_0x1f5c5e){this[_0xb934('0x2')]=0x4;this[_0xb934('0x3')]=_0xb934('0x4');this[_0xb934('0x5')]=_0x575a27[_0xb934('0x5')];this[_0xb934('0x6')]=_0x575a27[_0xb934('0x6')];this[_0xb934('0x7')]=_0x575a27[_0xb934('0x6')]===_0xb934('0x8')?_0xb934('0x9'):_0x575a27[_0xb934('0x6')];this['amd']=_0x575a27['amd']||![];this[_0xb934('0xa')]=_0x575a27['countbusyretry'];this[_0xb934('0xb')]=_0x575a27[_0xb934('0xb')];this[_0xb934('0xc')]=_0x575a27[_0xb934('0xc')];this[_0xb934('0xd')]=_0x575a27[_0xb934('0xa')]+_0x575a27[_0xb934('0xb')]+_0x575a27[_0xb934('0xc')]+_0x575a27[_0xb934('0xe')]+_0x575a27[_0xb934('0xf')]+_0x575a27[_0xb934('0x10')]+_0x575a27[_0xb934('0x11')]+_0x575a27['countagentrejectretry'];this[_0xb934('0xe')]=_0x575a27[_0xb934('0xe')];this[_0xb934('0xf')]=_0x575a27[_0xb934('0xf')];this[_0xb934('0x10')]=_0x575a27[_0xb934('0x10')];this[_0xb934('0x11')]=_0x575a27[_0xb934('0x11')];this[_0xb934('0x12')]=_0x575a27['countagentrejectretry'];this[_0xb934('0x13')]=_0x1f5c5e['uniqueid'];this['calleridname']=_0x575a27[_0xb934('0x14')];this['calleridnum']=_0x575a27['number'];this[_0xb934('0x15')]=_0x575a27['starttime'];this[_0xb934('0x16')]=_0x575a27['responsetime'];this[_0xb934('0x17')]=moment()[_0xb934('0x18')](_0xb934('0x19'));this[_0xb934('0x1a')]=utils[_0xb934('0x1b')](_0x575a27[_0xb934('0x16')],_0x575a27[_0xb934('0x15')]);this[_0xb934('0x1c')]=0x0;this[_0xb934('0x1d')]=utils[_0xb934('0x1b')](this[_0xb934('0x17')],_0x575a27[_0xb934('0x16')]);this[_0xb934('0x9')]=_0x575a27[_0xb934('0x9')];this[_0xb934('0x1e')]=_0xb934('0x1f');this[_0xb934('0x20')]=_0x1f5c5e['cause-txt'];this[_0xb934('0x21')]=_0x575a27[_0xb934('0x21')];this['callbackuniqueid']=_0x575a27[_0xb934('0x22')];this['callbackat']=_0x575a27['callbackat'];this['recallme']=_0x575a27[_0xb934('0x23')];this[_0xb934('0x24')]=_0x575a27['ContactId'];this[_0xb934('0x25')]=_0x575a27[_0xb934('0x25')];this[_0xb934('0x26')]=_0x575a27['UserId'];this[_0xb934('0x27')]=_0x575a27[_0xb934('0x27')];this[_0xb934('0x28')]=_0x575a27[_0xb934('0x28')];}module[_0xb934('0x29')]=Hangup; \ No newline at end of file +var _0x85e1=['countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','talktime','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','exports','moment','../utils','state','statedesc','scheduledat','type','outbound','queue','amd','countbusyretry','countglobal','countcongestionretry','countnoanswerretry','countnosuchnumberretry'];(function(_0x33a314,_0x4d5c24){var _0x4981fe=function(_0x121dfc){while(--_0x121dfc){_0x33a314['push'](_0x33a314['shift']());}};_0x4981fe(++_0x4d5c24);}(_0x85e1,0x111));var _0x185e=function(_0x47d739,_0x1f2dc7){_0x47d739=_0x47d739-0x0;var _0x2c2473=_0x85e1[_0x47d739];return _0x2c2473;};'use strict';var moment=require(_0x185e('0x0'));var utils=require(_0x185e('0x1'));function Hangup(_0x51a9ea,_0x23d8a1){this[_0x185e('0x2')]=0x4;this[_0x185e('0x3')]='Answer';this[_0x185e('0x4')]=_0x51a9ea[_0x185e('0x4')];this['type']=_0x51a9ea[_0x185e('0x5')];this['campaigntype']=_0x51a9ea[_0x185e('0x5')]===_0x185e('0x6')?_0x185e('0x7'):_0x51a9ea[_0x185e('0x5')];this[_0x185e('0x8')]=_0x51a9ea[_0x185e('0x8')]||![];this[_0x185e('0x9')]=_0x51a9ea[_0x185e('0x9')];this['countcongestionretry']=_0x51a9ea['countcongestionretry'];this['countnoanswerretry']=_0x51a9ea['countnoanswerretry'];this[_0x185e('0xa')]=_0x51a9ea[_0x185e('0x9')]+_0x51a9ea[_0x185e('0xb')]+_0x51a9ea[_0x185e('0xc')]+_0x51a9ea[_0x185e('0xd')]+_0x51a9ea[_0x185e('0xe')]+_0x51a9ea[_0x185e('0xf')]+_0x51a9ea[_0x185e('0x10')]+_0x51a9ea[_0x185e('0x11')];this[_0x185e('0xd')]=_0x51a9ea[_0x185e('0xd')];this[_0x185e('0xe')]=_0x51a9ea[_0x185e('0xe')];this[_0x185e('0xf')]=_0x51a9ea[_0x185e('0xf')];this['countmachineretry']=_0x51a9ea[_0x185e('0x10')];this[_0x185e('0x11')]=_0x51a9ea[_0x185e('0x11')];this[_0x185e('0x12')]=_0x23d8a1['uniqueid'];this['calleridname']=_0x51a9ea[_0x185e('0x13')];this[_0x185e('0x14')]=_0x51a9ea[_0x185e('0x15')];this[_0x185e('0x16')]=_0x51a9ea['starttime'];this[_0x185e('0x17')]=_0x51a9ea[_0x185e('0x17')];this[_0x185e('0x18')]=moment()['format'](_0x185e('0x19'));this[_0x185e('0x1a')]=utils[_0x185e('0x1b')](_0x51a9ea['responsetime'],_0x51a9ea[_0x185e('0x16')]);this['holdtime']=0x0;this[_0x185e('0x1c')]=utils['getSeconds'](this[_0x185e('0x18')],_0x51a9ea[_0x185e('0x17')]);this[_0x185e('0x7')]=_0x51a9ea['queue'];this['membername']=_0x185e('0x1d');this[_0x185e('0x1e')]=_0x23d8a1[_0x185e('0x1f')];this[_0x185e('0x20')]=_0x51a9ea[_0x185e('0x20')];this[_0x185e('0x21')]=_0x51a9ea['callbackuniqueid'];this[_0x185e('0x22')]=_0x51a9ea[_0x185e('0x22')];this[_0x185e('0x23')]=_0x51a9ea['recallme'];this['ContactId']=_0x51a9ea[_0x185e('0x24')];this[_0x185e('0x25')]=_0x51a9ea['ListId'];this['UserId']=_0x51a9ea['UserId'];this[_0x185e('0x26')]=_0x51a9ea['VoiceQueueId'];this[_0x185e('0x27')]=_0x51a9ea[_0x185e('0x27')];}module[_0x185e('0x28')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/models/history.js b/server/services/ami/dialer/models/history.js index 2dff89f..4650294 100644 --- a/server/services/ami/dialer/models/history.js +++ b/server/services/ami/dialer/models/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x015e=['number','starttime','responsetime','endtime','ringtime','getSeconds','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','calleridname','name','calleridnum'];(function(_0x4178af,_0x388652){var _0x20f4b1=function(_0x504188){while(--_0x504188){_0x4178af['push'](_0x4178af['shift']());}};_0x20f4b1(++_0x388652);}(_0x015e,0x1d0));var _0xe015=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0x015e[_0x474bc0];return _0x4b24cf;};'use strict';var utils=require('../utils');function History(_0x2430ec){this[_0xe015('0x0')]=_0x2430ec[_0xe015('0x0')];this[_0xe015('0x1')]=_0x2430ec[_0xe015('0x1')]||undefined;this['type']=_0x2430ec[_0xe015('0x2')];this[_0xe015('0x3')]=_0x2430ec[_0xe015('0x2')]===_0xe015('0x4')?_0xe015('0x5'):_0x2430ec[_0xe015('0x2')];this[_0xe015('0x6')]=_0x2430ec['countbusyretry'];this[_0xe015('0x7')]=_0x2430ec[_0xe015('0x7')];this[_0xe015('0x8')]=_0x2430ec[_0xe015('0x8')];this['countglobal']=_0x2430ec['countbusyretry']+_0x2430ec[_0xe015('0x7')]+_0x2430ec['countnoanswerretry']+_0x2430ec[_0xe015('0x9')]+_0x2430ec['countdropretry']+_0x2430ec[_0xe015('0xa')]+_0x2430ec[_0xe015('0xb')]+_0x2430ec[_0xe015('0xc')];this[_0xe015('0x9')]=_0x2430ec[_0xe015('0x9')];this[_0xe015('0xd')]=_0x2430ec[_0xe015('0xd')];this[_0xe015('0xa')]=_0x2430ec['countabandonedretry'];this[_0xe015('0xb')]=_0x2430ec[_0xe015('0xb')];this[_0xe015('0xc')]=_0x2430ec[_0xe015('0xc')];this[_0xe015('0x5')]=_0x2430ec[_0xe015('0x5')];this[_0xe015('0xe')]=_0x2430ec[_0xe015('0xf')];this[_0xe015('0x10')]=_0x2430ec[_0xe015('0x11')];this[_0xe015('0x12')]=_0x2430ec[_0xe015('0x12')];this['responsetime']=_0x2430ec[_0xe015('0x13')];this[_0xe015('0x14')]=_0x2430ec[_0xe015('0x13')];this[_0xe015('0x15')]=utils[_0xe015('0x16')](_0x2430ec[_0xe015('0x13')],_0x2430ec[_0xe015('0x12')]);this['holdtime']=0x0;this['talktime']=0x0;this['callback']=_0x2430ec[_0xe015('0x17')];this[_0xe015('0x18')]=_0x2430ec[_0xe015('0x18')];this[_0xe015('0x19')]=_0x2430ec[_0xe015('0x19')];this['recallme']=_0x2430ec[_0xe015('0x1a')];this[_0xe015('0x1b')]=_0x2430ec[_0xe015('0x1b')];this[_0xe015('0x1c')]=_0x2430ec[_0xe015('0x1c')];this['UserId']=_0x2430ec[_0xe015('0x1d')];this[_0xe015('0x1e')]=_0x2430ec[_0xe015('0x1e')];this[_0xe015('0x1f')]=_0x2430ec[_0xe015('0x1f')];this[_0xe015('0x20')]=_0x2430ec[_0xe015('0x20')]||'';this[_0xe015('0x21')]=_0x2430ec[_0xe015('0x21')]||'';this[_0xe015('0x22')]=_0x2430ec[_0xe015('0x22')];this[_0xe015('0x23')]=_0x2430ec['statedesc'];}module[_0xe015('0x24')]=History; \ No newline at end of file +var _0x9190=['getSeconds','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','name','calleridnum','number','starttime','responsetime','endtime','ringtime'];(function(_0x2c8597,_0x1f0ea1){var _0xb7037f=function(_0x40054c){while(--_0x40054c){_0x2c8597['push'](_0x2c8597['shift']());}};_0xb7037f(++_0x1f0ea1);}(_0x9190,0x140));var _0x0919=function(_0x576d37,_0x492f6d){_0x576d37=_0x576d37-0x0;var _0x1a10ee=_0x9190[_0x576d37];return _0x1a10ee;};'use strict';var utils=require(_0x0919('0x0'));function History(_0xdff6ac){this['uniqueid']=_0xdff6ac['uniqueid'];this[_0x0919('0x1')]=_0xdff6ac['scheduledat']||undefined;this[_0x0919('0x2')]=_0xdff6ac[_0x0919('0x2')];this[_0x0919('0x3')]=_0xdff6ac['type']===_0x0919('0x4')?_0x0919('0x5'):_0xdff6ac['type'];this[_0x0919('0x6')]=_0xdff6ac[_0x0919('0x6')];this[_0x0919('0x7')]=_0xdff6ac[_0x0919('0x7')];this[_0x0919('0x8')]=_0xdff6ac[_0x0919('0x8')];this[_0x0919('0x9')]=_0xdff6ac[_0x0919('0x6')]+_0xdff6ac[_0x0919('0x7')]+_0xdff6ac['countnoanswerretry']+_0xdff6ac[_0x0919('0xa')]+_0xdff6ac[_0x0919('0xb')]+_0xdff6ac[_0x0919('0xc')]+_0xdff6ac[_0x0919('0xd')]+_0xdff6ac['countagentrejectretry'];this[_0x0919('0xa')]=_0xdff6ac[_0x0919('0xa')];this['countdropretry']=_0xdff6ac[_0x0919('0xb')];this['countabandonedretry']=_0xdff6ac[_0x0919('0xc')];this[_0x0919('0xd')]=_0xdff6ac[_0x0919('0xd')];this[_0x0919('0xe')]=_0xdff6ac['countagentrejectretry'];this['queue']=_0xdff6ac[_0x0919('0x5')];this['calleridname']=_0xdff6ac[_0x0919('0xf')];this[_0x0919('0x10')]=_0xdff6ac[_0x0919('0x11')];this[_0x0919('0x12')]=_0xdff6ac[_0x0919('0x12')];this[_0x0919('0x13')]=_0xdff6ac['responsetime'];this[_0x0919('0x14')]=_0xdff6ac['responsetime'];this[_0x0919('0x15')]=utils[_0x0919('0x16')](_0xdff6ac[_0x0919('0x13')],_0xdff6ac[_0x0919('0x12')]);this['holdtime']=0x0;this[_0x0919('0x17')]=0x0;this[_0x0919('0x18')]=_0xdff6ac[_0x0919('0x18')];this['callbackuniqueid']=_0xdff6ac[_0x0919('0x19')];this[_0x0919('0x1a')]=_0xdff6ac[_0x0919('0x1a')];this['recallme']=_0xdff6ac[_0x0919('0x1b')];this[_0x0919('0x1c')]=_0xdff6ac[_0x0919('0x1c')];this['ListId']=_0xdff6ac[_0x0919('0x1d')];this['UserId']=_0xdff6ac[_0x0919('0x1e')];this[_0x0919('0x1f')]=_0xdff6ac[_0x0919('0x1f')];this[_0x0919('0x20')]=_0xdff6ac['CampaignId'];this[_0x0919('0x21')]=_0xdff6ac[_0x0919('0x21')]||'';this[_0x0919('0x22')]=_0xdff6ac[_0x0919('0x22')]||'';this[_0x0919('0x23')]=_0xdff6ac[_0x0919('0x23')];this[_0x0919('0x24')]=_0xdff6ac['statedesc'];}module[_0x0919('0x25')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/models/queueCallerAbandon.js b/server/services/ami/dialer/models/queueCallerAbandon.js index 0022ea0..2d95688 100644 --- a/server/services/ami/dialer/models/queueCallerAbandon.js +++ b/server/services/ami/dialer/models/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd677=['holdtime','talktime','queue','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','starttime','responsetime','droptime','dropreason','endtime','ringtime','getSeconds'];(function(_0x20d290,_0x40fc11){var _0x2bfa8f=function(_0x2498e0){while(--_0x2498e0){_0x20d290['push'](_0x20d290['shift']());}};_0x2bfa8f(++_0x40fc11);}(_0xd677,0xc1));var _0x7d67=function(_0x591168,_0x36a0ac){_0x591168=_0x591168-0x0;var _0x575a1e=_0xd677[_0x591168];return _0x575a1e;};'use strict';var utils=require(_0x7d67('0x0'));function QueueCallerAbandon(_0x4d037f,_0x3ec9f8){this[_0x7d67('0x1')]=_0x4d037f[_0x7d67('0x1')];this['type']=_0x4d037f[_0x7d67('0x2')];this['campaigntype']=_0x4d037f[_0x7d67('0x2')]===_0x7d67('0x3')?'queue':_0x4d037f[_0x7d67('0x2')];this[_0x7d67('0x4')]=_0x4d037f[_0x7d67('0x4')];this[_0x7d67('0x5')]=_0x4d037f[_0x7d67('0x5')];this[_0x7d67('0x6')]=_0x4d037f['countnoanswerretry'];this[_0x7d67('0x7')]=_0x4d037f[_0x7d67('0x4')]+_0x4d037f['countcongestionretry']+_0x4d037f[_0x7d67('0x6')]+_0x4d037f[_0x7d67('0x8')]+_0x4d037f[_0x7d67('0x9')]+_0x4d037f[_0x7d67('0xa')]+_0x4d037f['countmachineretry']+_0x4d037f[_0x7d67('0xb')];this[_0x7d67('0x8')]=_0x4d037f[_0x7d67('0x8')];this['countdropretry']=_0x4d037f[_0x7d67('0x9')];this['countabandonedretry']=_0x4d037f['countabandonedretry'];this[_0x7d67('0xc')]=_0x4d037f[_0x7d67('0xc')];this[_0x7d67('0xb')]=_0x4d037f[_0x7d67('0xb')];this[_0x7d67('0xd')]=_0x3ec9f8[_0x7d67('0xd')];this[_0x7d67('0xe')]=_0x4d037f['name'];this['calleridnum']=_0x4d037f['number'];this[_0x7d67('0xf')]=_0x4d037f[_0x7d67('0xf')];this[_0x7d67('0x10')]=_0x4d037f[_0x7d67('0x10')];this[_0x7d67('0x11')]=_0x4d037f[_0x7d67('0x11')];this[_0x7d67('0x12')]=_0x4d037f['dropreason'];this[_0x7d67('0x13')]=this[_0x7d67('0x11')];this[_0x7d67('0x14')]=utils[_0x7d67('0x15')](_0x4d037f['responsetime'],_0x4d037f[_0x7d67('0xf')]);this[_0x7d67('0x16')]=utils[_0x7d67('0x15')](this[_0x7d67('0x11')],_0x4d037f['responsetime']);this[_0x7d67('0x17')]=0x0;this[_0x7d67('0x18')]=_0x3ec9f8[_0x7d67('0x18')];this[_0x7d67('0x19')]=_0x3ec9f8[_0x7d67('0x1a')];this[_0x7d67('0x1b')]=_0x3ec9f8[_0x7d67('0x1b')];this[_0x7d67('0x1c')]=_0x4d037f[_0x7d67('0x1c')];this[_0x7d67('0x1d')]=_0x4d037f[_0x7d67('0x1d')];this[_0x7d67('0x1e')]=_0x4d037f[_0x7d67('0x1e')];this[_0x7d67('0x1f')]=_0x4d037f[_0x7d67('0x1f')];this[_0x7d67('0x20')]=_0x4d037f[_0x7d67('0x20')];this[_0x7d67('0x21')]=_0x4d037f['ListId'];this[_0x7d67('0x22')]=_0x4d037f[_0x7d67('0x22')];this[_0x7d67('0x23')]=_0x4d037f[_0x7d67('0x23')];this[_0x7d67('0x24')]=_0x4d037f[_0x7d67('0x24')];this[_0x7d67('0x25')]=_0x4d037f[_0x7d67('0x25')]||'';this[_0x7d67('0x26')]=_0x4d037f[_0x7d67('0x26')]||'';this['agiafterat']=_0x4d037f[_0x7d67('0x27')];this[_0x7d67('0x28')]=_0x4d037f['state'];this[_0x7d67('0x29')]=_0x4d037f[_0x7d67('0x29')];}module[_0x7d67('0x2a')]=QueueCallerAbandon; \ No newline at end of file +var _0xc709=['originatecalleridname','agiafterat','state','statedesc','../utils','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime','responsetime','droptime','dropreason','endtime','getSeconds','holdtime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId'];(function(_0x22c5d6,_0x3df817){var _0x2ebb82=function(_0x566607){while(--_0x566607){_0x22c5d6['push'](_0x22c5d6['shift']());}};_0x2ebb82(++_0x3df817);}(_0xc709,0x7f));var _0x9c70=function(_0x2211ed,_0x1bca0b){_0x2211ed=_0x2211ed-0x0;var _0x4d78cc=_0xc709[_0x2211ed];return _0x4d78cc;};'use strict';var utils=require(_0x9c70('0x0'));function QueueCallerAbandon(_0x169093,_0x2238c3){this[_0x9c70('0x1')]=_0x169093[_0x9c70('0x1')];this[_0x9c70('0x2')]=_0x169093[_0x9c70('0x2')];this[_0x9c70('0x3')]=_0x169093[_0x9c70('0x2')]==='outbound'?_0x9c70('0x4'):_0x169093[_0x9c70('0x2')];this[_0x9c70('0x5')]=_0x169093[_0x9c70('0x5')];this[_0x9c70('0x6')]=_0x169093[_0x9c70('0x6')];this[_0x9c70('0x7')]=_0x169093['countnoanswerretry'];this[_0x9c70('0x8')]=_0x169093[_0x9c70('0x5')]+_0x169093['countcongestionretry']+_0x169093[_0x9c70('0x7')]+_0x169093[_0x9c70('0x9')]+_0x169093[_0x9c70('0xa')]+_0x169093[_0x9c70('0xb')]+_0x169093[_0x9c70('0xc')]+_0x169093[_0x9c70('0xd')];this['countnosuchnumberretry']=_0x169093[_0x9c70('0x9')];this[_0x9c70('0xa')]=_0x169093[_0x9c70('0xa')];this[_0x9c70('0xb')]=_0x169093[_0x9c70('0xb')];this[_0x9c70('0xc')]=_0x169093[_0x9c70('0xc')];this['countagentrejectretry']=_0x169093[_0x9c70('0xd')];this[_0x9c70('0xe')]=_0x2238c3[_0x9c70('0xe')];this[_0x9c70('0xf')]=_0x169093[_0x9c70('0x10')];this['calleridnum']=_0x169093[_0x9c70('0x11')];this[_0x9c70('0x12')]=_0x169093['starttime'];this[_0x9c70('0x13')]=_0x169093['responsetime'];this[_0x9c70('0x14')]=_0x169093[_0x9c70('0x14')];this[_0x9c70('0x15')]=_0x169093[_0x9c70('0x15')];this[_0x9c70('0x16')]=this[_0x9c70('0x14')];this['ringtime']=utils[_0x9c70('0x17')](_0x169093[_0x9c70('0x13')],_0x169093[_0x9c70('0x12')]);this[_0x9c70('0x18')]=utils[_0x9c70('0x17')](this['droptime'],_0x169093[_0x9c70('0x13')]);this['talktime']=0x0;this[_0x9c70('0x4')]=_0x2238c3[_0x9c70('0x4')];this[_0x9c70('0x19')]=_0x2238c3[_0x9c70('0x1a')];this[_0x9c70('0x1b')]=_0x2238c3['reason'];this[_0x9c70('0x1c')]=_0x169093['callback'];this[_0x9c70('0x1d')]=_0x169093[_0x9c70('0x1d')];this['callbackat']=_0x169093[_0x9c70('0x1e')];this[_0x9c70('0x1f')]=_0x169093[_0x9c70('0x1f')];this[_0x9c70('0x20')]=_0x169093['ContactId'];this[_0x9c70('0x21')]=_0x169093[_0x9c70('0x21')];this[_0x9c70('0x22')]=_0x169093[_0x9c70('0x22')];this[_0x9c70('0x23')]=_0x169093[_0x9c70('0x23')];this[_0x9c70('0x24')]=_0x169093[_0x9c70('0x24')];this['originatecalleridnum']=_0x169093['originatecalleridnum']||'';this[_0x9c70('0x25')]=_0x169093['originatecalleridname']||'';this[_0x9c70('0x26')]=_0x169093[_0x9c70('0x26')];this[_0x9c70('0x27')]=_0x169093[_0x9c70('0x27')];this[_0x9c70('0x28')]=_0x169093['statedesc'];}module['exports']=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/hopper.js b/server/services/ami/dialer/utils/hopper.js index ae04f7b..f031821 100644 --- a/server/services/ami/dialer/utils/hopper.js +++ b/server/services/ami/dialer/utils/hopper.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4c60=['unlockContact','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackListIvr','[checkIsBlackListIvr]','[verifyAdditionalPhone]','verifyAdditionalPhones','[swapAdditionalPhone]','swapAdditionalPhones','[avgHandleTime]','avgHandleTime','[createHistory]','createHistory','util','../../../../config/logger','dialer','../../rpc/cmHopper','../../rpc/cmHopperBlack','getContactDialer','dialOrderByScheduledAt','catch','temp','[getContactDialer]','error','[getContactDialerIvr]','countReScheduled','[countReScheduled]','[rescheduleContact]','rescheduleContact','[unlockContact]'];(function(_0x2d80b3,_0x1fdf34){var _0x37faf9=function(_0x125ee1){while(--_0x125ee1){_0x2d80b3['push'](_0x2d80b3['shift']());}};_0x37faf9(++_0x1fdf34);}(_0x4c60,0xc1));var _0x04c6=function(_0x6d6206,_0x200a80){_0x6d6206=_0x6d6206-0x0;var _0x3dc45b=_0x4c60[_0x6d6206];return _0x3dc45b;};'use strict';var util=require(_0x04c6('0x0'));var logger=require(_0x04c6('0x1'))(_0x04c6('0x2'));var cmHopper=require(_0x04c6('0x3'));var cmHopperAdditionalPhone=require('../../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0x04c6('0x4'));var cmHopperHistory=require('../../rpc/cmHopperHistory');function inspectError(_0x52a464){return util['inspect'](_0x52a464,{'showHidden':![],'depth':null});}function getContactDialer(_0x53ca7a,_0x3a9493,_0xc6e772){return cmHopper[_0x04c6('0x5')](_0x53ca7a['id'],_0x3a9493,_0xc6e772,_0x53ca7a[_0x04c6('0x6')])[_0x04c6('0x7')](function(_0x39be2d){_0x53ca7a[_0x04c6('0x8')]=0x0;logger['error'](_0x04c6('0x9'),inspectError(_0x39be2d));});}exports[_0x04c6('0x5')]=getContactDialer;function getContactDialerIvr(_0x207649,_0x30b901){return cmHopper['getContactDialerIvr'](_0x207649['id'],_0x30b901,_0x207649['dialOrderByScheduledAt'])['catch'](function(_0x376da8){_0x207649['temp']=0x0;logger[_0x04c6('0xa')](_0x04c6('0xb'),inspectError(_0x376da8));});}exports['getContactDialerIvr']=getContactDialerIvr;function countReScheduled(_0x4316f8){return cmHopper[_0x04c6('0xc')](_0x4316f8)[_0x04c6('0x7')](function(_0x4e5e6){logger['error'](_0x04c6('0xd'),inspectError(_0x4e5e6));});}exports[_0x04c6('0xc')]=countReScheduled;function rescheduleContact(_0x4384ad){return cmHopper['rescheduleContact'](_0x4384ad)[_0x04c6('0x7')](function(_0x15cbe0){logger[_0x04c6('0xa')](_0x04c6('0xe'),inspectError(_0x15cbe0));});}exports[_0x04c6('0xf')]=rescheduleContact;function unlockContact(_0x19a26f,_0x1cd963,_0x3d46a9){return cmHopper['unlockContact'](_0x19a26f,_0x1cd963,_0x3d46a9)[_0x04c6('0x7')](function(_0xa2bc92){logger[_0x04c6('0xa')](_0x04c6('0x10'),inspectError(_0xa2bc92));});}exports[_0x04c6('0x11')]=unlockContact;function moveContactManagedDialer(_0xfb4db5){return cmHopper[_0x04c6('0x12')](_0xfb4db5)[_0x04c6('0x7')](function(_0x47f400){logger[_0x04c6('0xa')](_0x04c6('0x13'),inspectError(_0x47f400));});}exports[_0x04c6('0x12')]=moveContactManagedDialer;function checkIsBlackList(_0x558b43){return cmHopperBlack['checkIsBlackList'](_0x558b43)['catch'](function(_0x41ad4f){logger[_0x04c6('0xa')]('[checkIsBlackList]',inspectError(_0x41ad4f));});}exports['checkIsBlackList']=checkIsBlackList;function checkIsBlackListIvr(_0x1e6854){return cmHopperBlack[_0x04c6('0x14')](_0x1e6854)[_0x04c6('0x7')](function(_0x5daa22){logger[_0x04c6('0xa')](_0x04c6('0x15'),inspectError(_0x5daa22));});}exports[_0x04c6('0x14')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x49c179,_0x2d3277,_0x41e29f){return cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x49c179,_0x2d3277,_0x41e29f)['catch'](function(_0x4c8d72){logger[_0x04c6('0xa')](_0x04c6('0x16'),inspectError(_0x4c8d72));});}exports[_0x04c6('0x17')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x115e35,_0x3e1328,_0x52e5f5){return cmHopperAdditionalPhone['swapAdditionalPhones'](_0x115e35,_0x3e1328,_0x52e5f5)[_0x04c6('0x7')](function(_0x2ab1d2){logger[_0x04c6('0xa')](_0x04c6('0x18'),inspectError(_0x2ab1d2));});}exports[_0x04c6('0x19')]=swapAdditionalPhones;function avgHandleTime(_0x1f5aaf){return cmHopperHistory['avgHandleTime'](_0x1f5aaf)[_0x04c6('0x7')](function(_0x165cb5){logger['error'](_0x04c6('0x1a'),inspectError(_0x165cb5));});}exports[_0x04c6('0x1b')]=avgHandleTime;function createHistory(_0x5f1331){return cmHopperHistory['createHistory'](_0x5f1331)[_0x04c6('0x7')](function(_0x3a6d92){logger[_0x04c6('0xa')](_0x04c6('0x1c'),inspectError(_0x3a6d92));});}exports[_0x04c6('0x1d')]=createHistory; \ No newline at end of file +var _0xb091=['swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[avgHandleTime]','createHistory','[createHistory]','../../../../config/logger','dialer','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperHistory','getContactDialer','dialOrderByScheduledAt','catch','temp','error','[getContactDialer]','getContactDialerIvr','[getContactDialerIvr]','[countReScheduled]','countReScheduled','rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]','moveContactManagedDialer','[checkIsBlackList]','checkIsBlackList','checkIsBlackListIvr','verifyAdditionalPhones'];(function(_0x35c181,_0x3d21f7){var _0x1b33ff=function(_0x4ff444){while(--_0x4ff444){_0x35c181['push'](_0x35c181['shift']());}};_0x1b33ff(++_0x3d21f7);}(_0xb091,0x16e));var _0x1b09=function(_0xa3ec0a,_0x54cdec){_0xa3ec0a=_0xa3ec0a-0x0;var _0x4ed13c=_0xb091[_0xa3ec0a];return _0x4ed13c;};'use strict';var util=require('util');var logger=require(_0x1b09('0x0'))(_0x1b09('0x1'));var cmHopper=require(_0x1b09('0x2'));var cmHopperAdditionalPhone=require(_0x1b09('0x3'));var cmHopperBlack=require('../../rpc/cmHopperBlack');var cmHopperHistory=require(_0x1b09('0x4'));function inspectError(_0x59af61){return util['inspect'](_0x59af61,{'showHidden':![],'depth':null});}function getContactDialer(_0x295863,_0x24d22c,_0x4e252c){return cmHopper[_0x1b09('0x5')](_0x295863['id'],_0x24d22c,_0x4e252c,_0x295863[_0x1b09('0x6')])[_0x1b09('0x7')](function(_0x5ce726){_0x295863[_0x1b09('0x8')]=0x0;logger[_0x1b09('0x9')](_0x1b09('0xa'),inspectError(_0x5ce726));});}exports[_0x1b09('0x5')]=getContactDialer;function getContactDialerIvr(_0x159b95,_0x3362e4){return cmHopper[_0x1b09('0xb')](_0x159b95['id'],_0x3362e4,_0x159b95[_0x1b09('0x6')])[_0x1b09('0x7')](function(_0x36aa1b){_0x159b95[_0x1b09('0x8')]=0x0;logger['error'](_0x1b09('0xc'),inspectError(_0x36aa1b));});}exports[_0x1b09('0xb')]=getContactDialerIvr;function countReScheduled(_0x5690cb){return cmHopper['countReScheduled'](_0x5690cb)[_0x1b09('0x7')](function(_0x4284ad){logger[_0x1b09('0x9')](_0x1b09('0xd'),inspectError(_0x4284ad));});}exports[_0x1b09('0xe')]=countReScheduled;function rescheduleContact(_0x3a44f1){return cmHopper[_0x1b09('0xf')](_0x3a44f1)['catch'](function(_0x37fdb2){logger['error'](_0x1b09('0x10'),inspectError(_0x37fdb2));});}exports[_0x1b09('0xf')]=rescheduleContact;function unlockContact(_0x11ab46,_0x37673e,_0x10b7eb){return cmHopper[_0x1b09('0x11')](_0x11ab46,_0x37673e,_0x10b7eb)[_0x1b09('0x7')](function(_0x33129b){logger[_0x1b09('0x9')](_0x1b09('0x12'),inspectError(_0x33129b));});}exports[_0x1b09('0x11')]=unlockContact;function moveContactManagedDialer(_0x231ef6){return cmHopper[_0x1b09('0x13')](_0x231ef6)['catch'](function(_0x214c6b){logger[_0x1b09('0x9')]('[moveContactManagedDialer]',inspectError(_0x214c6b));});}exports['moveContactManagedDialer']=moveContactManagedDialer;function checkIsBlackList(_0xe93ac4){return cmHopperBlack['checkIsBlackList'](_0xe93ac4)[_0x1b09('0x7')](function(_0x5bb127){logger[_0x1b09('0x9')](_0x1b09('0x14'),inspectError(_0x5bb127));});}exports[_0x1b09('0x15')]=checkIsBlackList;function checkIsBlackListIvr(_0x1e8f97){return cmHopperBlack[_0x1b09('0x16')](_0x1e8f97)[_0x1b09('0x7')](function(_0x363e78){logger[_0x1b09('0x9')]('[checkIsBlackListIvr]',inspectError(_0x363e78));});}exports['checkIsBlackListIvr']=checkIsBlackListIvr;function verifyAdditionalPhones(_0x27f4f5,_0x41c786,_0x4ce7dc){return cmHopperAdditionalPhone[_0x1b09('0x17')](_0x27f4f5,_0x41c786,_0x4ce7dc)[_0x1b09('0x7')](function(_0x6e132c){logger[_0x1b09('0x9')]('[verifyAdditionalPhone]',inspectError(_0x6e132c));});}exports[_0x1b09('0x17')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x15be49,_0x4936d0,_0x2d3b86){return cmHopperAdditionalPhone[_0x1b09('0x18')](_0x15be49,_0x4936d0,_0x2d3b86)['catch'](function(_0x13c89c){logger[_0x1b09('0x9')](_0x1b09('0x19'),inspectError(_0x13c89c));});}exports[_0x1b09('0x18')]=swapAdditionalPhones;function avgHandleTime(_0x547fbb){return cmHopperHistory[_0x1b09('0x1a')](_0x547fbb)[_0x1b09('0x7')](function(_0x532589){logger[_0x1b09('0x9')](_0x1b09('0x1b'),inspectError(_0x532589));});}exports[_0x1b09('0x1a')]=avgHandleTime;function createHistory(_0x1cbbd5){return cmHopperHistory[_0x1b09('0x1c')](_0x1cbbd5)[_0x1b09('0x7')](function(_0x34620f){logger['error'](_0x1b09('0x1d'),inspectError(_0x34620f));});}exports[_0x1b09('0x1c')]=createHistory; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/index.js b/server/services/ami/dialer/utils/index.js index 95a63e9..29301a5 100644 --- a/server/services/ami/dialer/utils/index.js +++ b/server/services/ami/dialer/utils/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2c34=['util','../../../../config/logger','../../../../config/environment/shared','timezones','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','NOT_ACTIVE','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','dialMethod','preview','isPreviewCampaign','ivr','isIVRCampaign','type','isOutboundQueue','dialActive','isQueueCampaignActive','isIVRCampaignActive','diff','seconds','getSeconds','message','available','loggedIn','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','active','hasQueueCampaignDataChanged','isNil','dialGlobalInterval','Interval','NULL_INTERVAL','isEmpty','Intervals','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','reachable','unmonitored','includes','TrunkBackup','INACTIVE','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','DISACTIVED','getQueueCampaignActiveStatusMessage','match','isUndefined','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','getCallerId','\x5cw{0,','pow','replace','random','toString','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','erlangb','createdAt','tags','updatedAt','undefined','description','length','XMD-','toUpperCase','setXMDContactVariables','lodash','moment'];(function(_0x443278,_0x62a500){var _0x27a18c=function(_0x46d8bd){while(--_0x46d8bd){_0x443278['push'](_0x443278['shift']());}};_0x27a18c(++_0x62a500);}(_0x2c34,0x10c));var _0x42c3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2c34[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x42c3('0x0'));var moment=require(_0x42c3('0x1'));var util=require(_0x42c3('0x2'));var logger=require(_0x42c3('0x3'))('dialer');var timezones=require(_0x42c3('0x4'))[_0x42c3('0x5')];var CAMPAIGN_STATUS={'ACTIVE':_0x42c3('0x6'),'BLACKLIST':_0x42c3('0x7'),'CONTACTS_RESCHEDULED':_0x42c3('0x8'),'DEACTIVATED':_0x42c3('0x9'),'DISACTIVED':'IS_DISACTIVED','EMPTY_INTERVAL':'INTERVAL_IS_EMPTY','INACTIVE':_0x42c3('0xa'),'NO_AGENTS_LOGGED':'AGENTS_NOT_LOGGED','NO_AVAILABLE_CONTACTS':_0x42c3('0xb'),'NULL_INTERVAL':_0x42c3('0xc'),'OVERTIME_INTERVAL':_0x42c3('0xd'),'OVERTIME_GLOBAL_INTERVAL':_0x42c3('0xe'),'QUEUE_RECALL':_0x42c3('0xf'),'RECALL_TIMEOUT':_0x42c3('0x10'),'RUNNING':_0x42c3('0x11'),'UNKNOWN_TIMEZONE':_0x42c3('0x12'),'UNREACHABLE_TRUNK':_0x42c3('0x13')};exports[_0x42c3('0x14')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x3275e8){return _0x3275e8[_0x42c3('0x15')]===_0x42c3('0x16');}exports[_0x42c3('0x17')]=isPreviewCampaign;function isIVRCampaign(_0x30f0d2){return _0x30f0d2['type']===_0x42c3('0x18');}exports[_0x42c3('0x19')]=isIVRCampaign;function isOutboundQueue(_0x1d5750){return _0x1d5750[_0x42c3('0x1a')]==='outbound';}exports[_0x42c3('0x1b')]=isOutboundQueue;function isQueueCampaignActive(_0x5bde59){return _0x5bde59[_0x42c3('0x1c')];}exports[_0x42c3('0x1d')]=isQueueCampaignActive;function isIVRCampaignActive(_0x195e28){return _0x195e28['active'];}exports[_0x42c3('0x1e')]=isIVRCampaignActive;function getSeconds(_0x3ad7ed,_0x14d7e5){var _0x23b42a=moment(_0x3ad7ed)['milliseconds'](0x0);var _0x30255d=moment(_0x14d7e5)['milliseconds'](0x0);return _0x23b42a[_0x42c3('0x1f')](_0x30255d,_0x42c3('0x20'));}exports[_0x42c3('0x21')]=getSeconds;function hasQueueCampaignDataChanged(_0x2289d1,_0x275f88){var _0x3db4a8=![];var _0x574462=_0x2289d1[_0x42c3('0x15')]!==_0x275f88[_0x42c3('0x15')]||_0x2289d1[_0x42c3('0x1c')]!==_0x275f88[_0x42c3('0x1c')]||_0x2289d1[_0x42c3('0x22')]!==_0x275f88[_0x42c3('0x22')];var _0x3493cd=_0x2289d1[_0x42c3('0x23')]!==_0x275f88['available']||_0x2289d1[_0x42c3('0x24')]!==_0x275f88['loggedIn']||_0x2289d1['loggedInDb']!==_0x275f88['loggedInDb']||_0x2289d1[_0x42c3('0x25')]!==_0x275f88[_0x42c3('0x25')]||_0x2289d1[_0x42c3('0x26')]!==_0x275f88['talking']||_0x2289d1[_0x42c3('0x27')]!==_0x275f88[_0x42c3('0x27')]||_0x2289d1['waiting']!==_0x275f88[_0x42c3('0x28')]||_0x2289d1[_0x42c3('0x29')]!==_0x275f88[_0x42c3('0x29')]||_0x2289d1[_0x42c3('0x2a')]!==_0x275f88['originated'];if(_0x2289d1[_0x42c3('0x2b')]&&_0x275f88[_0x42c3('0x2b')]){_0x3db4a8=_0x2289d1[_0x42c3('0x2b')][_0x42c3('0x2c')]!==_0x275f88[_0x42c3('0x2b')][_0x42c3('0x2c')]||_0x2289d1['Trunk'][_0x42c3('0x2d')]!==_0x275f88['Trunk'][_0x42c3('0x2d')];}return _0x574462||_0x3493cd||_0x3db4a8;}exports[_0x42c3('0x2e')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x38df35){var _0x5d43e3=null;var _0x34b26a=_0x38df35['dialTimezone'];if(_[_0x42c3('0x2f')](_0x38df35[_0x42c3('0x30')])||_[_0x42c3('0x2f')](_0x38df35[_0x42c3('0x31')])||_['isNil'](_0x38df35['Interval']['Intervals'])){_0x5d43e3=CAMPAIGN_STATUS[_0x42c3('0x32')];}else if(_['isEmpty'](_0x38df35['dialGlobalInterval'])||_[_0x42c3('0x33')](_0x38df35['Interval'][_0x42c3('0x34')])){_0x5d43e3=CAMPAIGN_STATUS[_0x42c3('0x35')];}else if(_0x34b26a&&!timezones[_0x34b26a]){_0x5d43e3=CAMPAIGN_STATUS[_0x42c3('0x36')];}return _0x5d43e3;}function checkAnyValidTrunk(_0x3e25ea,_0x23d510){var _0x431e30=null;var _0x5a1bb9='SIP/';var _0x6035dc=[_0x42c3('0x37'),_0x42c3('0x38')];var _0x3c9c9b=!![];if(_0x3e25ea['Trunk']&&_0x3e25ea[_0x42c3('0x2b')][_0x42c3('0x2d')]){_0x5a1bb9+=_0x3e25ea[_0x42c3('0x2b')][_0x42c3('0x2c')];_0x431e30=_0x23d510[_0x5a1bb9];_0x3c9c9b=_0x6035dc[_0x42c3('0x39')](_0x431e30['status']);}else if(_0x3e25ea[_0x42c3('0x3a')]&&_0x3e25ea[_0x42c3('0x3a')][_0x42c3('0x2d')]){_0x5a1bb9+=_0x3e25ea[_0x42c3('0x3a')][_0x42c3('0x2c')];_0x431e30=_0x23d510[_0x5a1bb9];_0x3c9c9b=_0x6035dc[_0x42c3('0x39')](_0x431e30['status']);}return _0x3c9c9b;}function getQueueCampaignStatusMessage(_0x57a184,_0x4f97c1){var _0x47eeda=CAMPAIGN_STATUS[_0x42c3('0x6')];var _0x586d9f=isPreviewCampaign(_0x57a184);if(!isQueueCampaignActive(_0x57a184)){if(_0x586d9f){_0x47eeda=CAMPAIGN_STATUS[_0x42c3('0x3b')];}else{if(_0x57a184[_0x42c3('0x2a')]===0x0&&_0x57a184[_0x42c3('0x26')]===0x0&&_0x57a184[_0x42c3('0x28')]===0x0&&(_0x57a184[_0x42c3('0x27')]||0x0)===0x0){_0x47eeda=CAMPAIGN_STATUS['INACTIVE'];}else{_0x47eeda=CAMPAIGN_STATUS['DISACTIVED'];}}}else if(_0x57a184[_0x42c3('0x24')]===0x0){_0x47eeda=CAMPAIGN_STATUS[_0x42c3('0x3c')];}else if(!checkAnyValidTrunk(_0x57a184,_0x4f97c1)){_0x47eeda=CAMPAIGN_STATUS[_0x42c3('0x3d')];}else if(!isPreviewCampaign(_0x57a184)){var _0x146a06=checkAnyValidQueueCampaignInterval(_0x57a184);if(_0x146a06){_0x47eeda=_0x146a06;}}return _0x47eeda;}exports['getQueueCampaignStatusMessage']=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x37f928){var _0x12f386=CAMPAIGN_STATUS[_0x42c3('0x3e')];if(_0x37f928[_0x42c3('0x2a')]===0x0&&_0x37f928[_0x42c3('0x26')]===0x0&&_0x37f928[_0x42c3('0x28')]===0x0&&(_0x37f928[_0x42c3('0x27')]||0x0)===0x0){_0x12f386=CAMPAIGN_STATUS[_0x42c3('0x3b')];}return _0x12f386;}exports[_0x42c3('0x3f')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x189893){var _0x32b15b=_0x189893[_0x42c3('0x40')](/"(.*?)"/);return _0x32b15b?_0x32b15b[0x1]:_0x189893;}exports['extractCalleridName']=extractCalleridName;function getCallerId(_0x559ccb,_0x114d15,_0x5a2473){if(!_[_0x42c3('0x41')](_0x5a2473)&&typeof _0x5a2473===_0x42c3('0x42')&&!_['isEmpty'](_0x5a2473)){if(!_[_0x42c3('0x41')](_0x114d15)&&typeof _0x114d15===_0x42c3('0x42')&&!_[_0x42c3('0x33')](_0x114d15)){return util[_0x42c3('0x43')](_0x42c3('0x44'),_0x114d15,_0x5a2473);}return util[_0x42c3('0x43')](_0x42c3('0x44'),_0x5a2473,_0x5a2473);}if(!_[_0x42c3('0x41')](_0x559ccb)&&typeof _0x559ccb==='string'&&!_[_0x42c3('0x33')](_0x559ccb)){return _0x559ccb;}return _0x42c3('0x45');}exports[_0x42c3('0x46')]=getCallerId;function getCallerIdRandom(_0xaa1997,_0x2ecb41){var _0x2901f5;var _0x23090e;var _0x3eaee4;if(_0x2ecb41<=0x0){_0x2ecb41=0x1;}_0x2901f5=new RegExp(_0x42c3('0x47')+_0x2ecb41+'}$');_0x23090e=Math[_0x42c3('0x48')](0xa,_0x2ecb41-0x1);_0x3eaee4=Math['pow'](0xa,_0x2ecb41)-0x1;return util['format']('%s',_[_0x42c3('0x49')](_0xaa1997,_0x2901f5,_[_0x42c3('0x4a')](_0x23090e,_0x3eaee4)[_0x42c3('0x4b')]()));}exports[_0x42c3('0x4c')]=getCallerIdRandom;function decrementOriginate(_0x53714f){if(_0x53714f[_0x42c3('0x2a')]&&_0x53714f[_0x42c3('0x2a')]>0x0){_0x53714f[_0x42c3('0x2a')]-=0x1;}else{logger[_0x42c3('0x4d')](_0x42c3('0x4e'));}}exports[_0x42c3('0x4f')]=decrementOriginate;function checkContactEmpty(_0x2ff627){return _0x2ff627&&_0x2ff627['length']>0x0;}exports['checkContactEmpty']=checkContactEmpty;function erlangb(_0x495888,_0x4ae1c9){if(_0x4ae1c9===0x0){return 0x0;}var _0x58de84=0x1;for(var _0xeabb70=0x1;_0xeabb70<=_0x4ae1c9;_0xeabb70+=0x1){_0x58de84=0x1+_0x58de84*_0xeabb70/_0x495888;}return 0x1/_0x58de84;}exports[_0x42c3('0x50')]=erlangb;function checkContactLowerLimitOriginate(_0x2a80c9,_0x35f15e,_0x135cf8){if(_0x35f15e>_0x135cf8){for(var _0x57c58a=0x0;_0x57c58a<_0x35f15e-_0x135cf8;_0x57c58a+=0x1){decrementOriginate(_0x2a80c9);}}}exports['checkContactLowerLimitOriginate']=checkContactLowerLimitOriginate;function setXMDContactVariables(_0xa69c63){var _0x4e3d6d={};var _0x17aeb1=['id',_0x42c3('0x51'),_0x42c3('0x52'),_0x42c3('0x53')];const _0x26c114=0xfa;if(_0xa69c63){for(var _0x1f284e in _0xa69c63){if(typeof _0xa69c63[_0x1f284e]!==_0x42c3('0x54')){if(!_[_0x42c3('0x2f')](_0xa69c63[_0x1f284e])&&!_0x17aeb1[_0x42c3('0x39')](_0x1f284e)){if(_0x1f284e===_0x42c3('0x55')&&_0xa69c63[_0x1f284e][_0x42c3('0x56')]>_0x26c114){_0x4e3d6d[_0x42c3('0x57')+_0x1f284e[_0x42c3('0x58')]()]=_0xa69c63[_0x1f284e]['toString']()['substring'](0x0,_0x26c114);}else{_0x4e3d6d['XMD-'+_0x1f284e[_0x42c3('0x58')]()]=_0xa69c63[_0x1f284e];}}}}}return _0x4e3d6d;}exports[_0x42c3('0x59')]=setXMDContactVariables; \ No newline at end of file +var _0xa057=['originated','Trunk','name','dialTimezone','isNil','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','reachable','includes','status','TrunkBackup','ACTIVE','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','getQueueCampaignActiveStatusMessage','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','pow','replace','random','toString','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','createdAt','tags','updatedAt','undefined','description','XMD-','toUpperCase','substring','setXMDContactVariables','lodash','moment','util','../../../../config/logger','dialer','../../../../config/environment/shared','timezones','BLACKLIST','RESCHEDULED_CONTACTS','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','preview','isPreviewCampaign','ivr','isIVRCampaign','type','outbound','dialActive','isQueueCampaignActive','active','isIVRCampaignActive','milliseconds','diff','seconds','dialMethod','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse'];(function(_0xe07a7d,_0x5cd6c4){var _0x32645c=function(_0x1edb43){while(--_0x1edb43){_0xe07a7d['push'](_0xe07a7d['shift']());}};_0x32645c(++_0x5cd6c4);}(_0xa057,0xea));var _0x7a05=function(_0x4e7010,_0x5b55fb){_0x4e7010=_0x4e7010-0x0;var _0x1e80a6=_0xa057[_0x4e7010];return _0x1e80a6;};'use strict';var _=require(_0x7a05('0x0'));var moment=require(_0x7a05('0x1'));var util=require(_0x7a05('0x2'));var logger=require(_0x7a05('0x3'))(_0x7a05('0x4'));var timezones=require(_0x7a05('0x5'))[_0x7a05('0x6')];var CAMPAIGN_STATUS={'ACTIVE':'ACTIVE','BLACKLIST':_0x7a05('0x7'),'CONTACTS_RESCHEDULED':_0x7a05('0x8'),'DEACTIVATED':'DEACTIVATED','DISACTIVED':_0x7a05('0x9'),'EMPTY_INTERVAL':_0x7a05('0xa'),'INACTIVE':_0x7a05('0xb'),'NO_AGENTS_LOGGED':_0x7a05('0xc'),'NO_AVAILABLE_CONTACTS':_0x7a05('0xd'),'NULL_INTERVAL':_0x7a05('0xe'),'OVERTIME_INTERVAL':'INTERVAL_IS_OVERTIME','OVERTIME_GLOBAL_INTERVAL':_0x7a05('0xf'),'QUEUE_RECALL':_0x7a05('0x10'),'RECALL_TIMEOUT':_0x7a05('0x11'),'RUNNING':_0x7a05('0x12'),'UNKNOWN_TIMEZONE':_0x7a05('0x13'),'UNREACHABLE_TRUNK':_0x7a05('0x14')};exports[_0x7a05('0x15')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x3d6c58){return _0x3d6c58['dialMethod']===_0x7a05('0x16');}exports[_0x7a05('0x17')]=isPreviewCampaign;function isIVRCampaign(_0x4ff0ff){return _0x4ff0ff['type']===_0x7a05('0x18');}exports[_0x7a05('0x19')]=isIVRCampaign;function isOutboundQueue(_0x54412b){return _0x54412b[_0x7a05('0x1a')]===_0x7a05('0x1b');}exports['isOutboundQueue']=isOutboundQueue;function isQueueCampaignActive(_0x5dabea){return _0x5dabea[_0x7a05('0x1c')];}exports[_0x7a05('0x1d')]=isQueueCampaignActive;function isIVRCampaignActive(_0x10bccb){return _0x10bccb[_0x7a05('0x1e')];}exports[_0x7a05('0x1f')]=isIVRCampaignActive;function getSeconds(_0x4c7c37,_0x408fdb){var _0x565935=moment(_0x4c7c37)[_0x7a05('0x20')](0x0);var _0x5a9dd2=moment(_0x408fdb)[_0x7a05('0x20')](0x0);return _0x565935[_0x7a05('0x21')](_0x5a9dd2,_0x7a05('0x22'));}exports['getSeconds']=getSeconds;function hasQueueCampaignDataChanged(_0x5649b3,_0x433b91){var _0x2289a2=![];var _0x5a67cd=_0x5649b3[_0x7a05('0x23')]!==_0x433b91['dialMethod']||_0x5649b3['dialActive']!==_0x433b91[_0x7a05('0x1c')]||_0x5649b3['message']!==_0x433b91[_0x7a05('0x24')];var _0x15a28c=_0x5649b3['available']!==_0x433b91[_0x7a05('0x25')]||_0x5649b3[_0x7a05('0x26')]!==_0x433b91['loggedIn']||_0x5649b3[_0x7a05('0x27')]!==_0x433b91[_0x7a05('0x27')]||_0x5649b3['paused']!==_0x433b91[_0x7a05('0x28')]||_0x5649b3['talking']!==_0x433b91[_0x7a05('0x29')]||_0x5649b3[_0x7a05('0x2a')]!==_0x433b91['pTalking']||_0x5649b3[_0x7a05('0x2b')]!==_0x433b91[_0x7a05('0x2b')]||_0x5649b3[_0x7a05('0x2c')]!==_0x433b91['inUse']||_0x5649b3[_0x7a05('0x2d')]!==_0x433b91[_0x7a05('0x2d')];if(_0x5649b3['Trunk']&&_0x433b91[_0x7a05('0x2e')]){_0x2289a2=_0x5649b3['Trunk']['name']!==_0x433b91[_0x7a05('0x2e')][_0x7a05('0x2f')]||_0x5649b3[_0x7a05('0x2e')][_0x7a05('0x1e')]!==_0x433b91[_0x7a05('0x2e')]['active'];}return _0x5a67cd||_0x15a28c||_0x2289a2;}exports['hasQueueCampaignDataChanged']=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0xe1901a){var _0x22d33a=null;var _0x149914=_0xe1901a[_0x7a05('0x30')];if(_[_0x7a05('0x31')](_0xe1901a['dialGlobalInterval'])||_[_0x7a05('0x31')](_0xe1901a[_0x7a05('0x32')])||_[_0x7a05('0x31')](_0xe1901a['Interval'][_0x7a05('0x33')])){_0x22d33a=CAMPAIGN_STATUS[_0x7a05('0x34')];}else if(_[_0x7a05('0x35')](_0xe1901a['dialGlobalInterval'])||_[_0x7a05('0x35')](_0xe1901a[_0x7a05('0x32')][_0x7a05('0x33')])){_0x22d33a=CAMPAIGN_STATUS[_0x7a05('0x36')];}else if(_0x149914&&!timezones[_0x149914]){_0x22d33a=CAMPAIGN_STATUS[_0x7a05('0x37')];}return _0x22d33a;}function checkAnyValidTrunk(_0x2b34fd,_0x3d9f58){var _0xbb104e=null;var _0x39c305='SIP/';var _0x112080=[_0x7a05('0x38'),'unmonitored'];var _0xa16343=!![];if(_0x2b34fd[_0x7a05('0x2e')]&&_0x2b34fd['Trunk'][_0x7a05('0x1e')]){_0x39c305+=_0x2b34fd[_0x7a05('0x2e')][_0x7a05('0x2f')];_0xbb104e=_0x3d9f58[_0x39c305];_0xa16343=_0x112080[_0x7a05('0x39')](_0xbb104e[_0x7a05('0x3a')]);}else if(_0x2b34fd['TrunkBackup']&&_0x2b34fd[_0x7a05('0x3b')][_0x7a05('0x1e')]){_0x39c305+=_0x2b34fd[_0x7a05('0x3b')][_0x7a05('0x2f')];_0xbb104e=_0x3d9f58[_0x39c305];_0xa16343=_0x112080['includes'](_0xbb104e['status']);}return _0xa16343;}function getQueueCampaignStatusMessage(_0x330e76,_0x1fc30c){var _0x30b581=CAMPAIGN_STATUS[_0x7a05('0x3c')];var _0xdfa9b4=isPreviewCampaign(_0x330e76);if(!isQueueCampaignActive(_0x330e76)){if(_0xdfa9b4){_0x30b581=CAMPAIGN_STATUS[_0x7a05('0x3d')];}else{if(_0x330e76[_0x7a05('0x2d')]===0x0&&_0x330e76[_0x7a05('0x29')]===0x0&&_0x330e76['waiting']===0x0&&(_0x330e76[_0x7a05('0x2a')]||0x0)===0x0){_0x30b581=CAMPAIGN_STATUS[_0x7a05('0x3d')];}else{_0x30b581=CAMPAIGN_STATUS[_0x7a05('0x3e')];}}}else if(_0x330e76[_0x7a05('0x26')]===0x0){_0x30b581=CAMPAIGN_STATUS[_0x7a05('0x3f')];}else if(!checkAnyValidTrunk(_0x330e76,_0x1fc30c)){_0x30b581=CAMPAIGN_STATUS[_0x7a05('0x40')];}else if(!isPreviewCampaign(_0x330e76)){var _0x6c4d4b=checkAnyValidQueueCampaignInterval(_0x330e76);if(_0x6c4d4b){_0x30b581=_0x6c4d4b;}}return _0x30b581;}exports[_0x7a05('0x41')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x376912){var _0x14cfa7=CAMPAIGN_STATUS[_0x7a05('0x3e')];if(_0x376912[_0x7a05('0x2d')]===0x0&&_0x376912[_0x7a05('0x29')]===0x0&&_0x376912[_0x7a05('0x2b')]===0x0&&(_0x376912[_0x7a05('0x2a')]||0x0)===0x0){_0x14cfa7=CAMPAIGN_STATUS[_0x7a05('0x3d')];}return _0x14cfa7;}exports[_0x7a05('0x42')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x1cc53a){var _0x202088=_0x1cc53a['match'](/"(.*?)"/);return _0x202088?_0x202088[0x1]:_0x1cc53a;}exports[_0x7a05('0x43')]=extractCalleridName;function getCallerId(_0x3f143c,_0x4adb69,_0x40fa45){if(!_[_0x7a05('0x44')](_0x40fa45)&&typeof _0x40fa45==='string'&&!_['isEmpty'](_0x40fa45)){if(!_[_0x7a05('0x44')](_0x4adb69)&&typeof _0x4adb69===_0x7a05('0x45')&&!_[_0x7a05('0x35')](_0x4adb69)){return util[_0x7a05('0x46')](_0x7a05('0x47'),_0x4adb69,_0x40fa45);}return util[_0x7a05('0x46')](_0x7a05('0x47'),_0x40fa45,_0x40fa45);}if(!_['isUndefined'](_0x3f143c)&&typeof _0x3f143c==='string'&&!_[_0x7a05('0x35')](_0x3f143c)){return _0x3f143c;}return'\x22\x22\x20<>';}exports['getCallerId']=getCallerId;function getCallerIdRandom(_0x2107d3,_0x58c2d3){var _0x3d3e31;var _0x8d5213;var _0x56e7e6;if(_0x58c2d3<=0x0){_0x58c2d3=0x1;}_0x3d3e31=new RegExp('\x5cw{0,'+_0x58c2d3+'}$');_0x8d5213=Math[_0x7a05('0x48')](0xa,_0x58c2d3-0x1);_0x56e7e6=Math['pow'](0xa,_0x58c2d3)-0x1;return util['format']('%s',_[_0x7a05('0x49')](_0x2107d3,_0x3d3e31,_[_0x7a05('0x4a')](_0x8d5213,_0x56e7e6)[_0x7a05('0x4b')]()));}exports[_0x7a05('0x4c')]=getCallerIdRandom;function decrementOriginate(_0x2ac412){if(_0x2ac412[_0x7a05('0x2d')]&&_0x2ac412['originated']>0x0){_0x2ac412['originated']-=0x1;}else{logger[_0x7a05('0x4d')](_0x7a05('0x4e'));}}exports[_0x7a05('0x4f')]=decrementOriginate;function checkContactEmpty(_0x102f70){return _0x102f70&&_0x102f70[_0x7a05('0x50')]>0x0;}exports[_0x7a05('0x51')]=checkContactEmpty;function erlangb(_0x3f82e0,_0x3f4b6e){if(_0x3f4b6e===0x0){return 0x0;}var _0x4d5ea4=0x1;for(var _0x2276c2=0x1;_0x2276c2<=_0x3f4b6e;_0x2276c2+=0x1){_0x4d5ea4=0x1+_0x4d5ea4*_0x2276c2/_0x3f82e0;}return 0x1/_0x4d5ea4;}exports[_0x7a05('0x52')]=erlangb;function checkContactLowerLimitOriginate(_0x34a1c3,_0x1d0c35,_0x7f24d7){if(_0x1d0c35>_0x7f24d7){for(var _0x26d96b=0x0;_0x26d96b<_0x1d0c35-_0x7f24d7;_0x26d96b+=0x1){decrementOriginate(_0x34a1c3);}}}exports[_0x7a05('0x53')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x1c69fa){var _0xbdf11={};var _0x1361a2=['id',_0x7a05('0x54'),_0x7a05('0x55'),_0x7a05('0x56')];const _0x2325ee=0xfa;if(_0x1c69fa){for(var _0x553081 in _0x1c69fa){if(typeof _0x1c69fa[_0x553081]!==_0x7a05('0x57')){if(!_['isNil'](_0x1c69fa[_0x553081])&&!_0x1361a2[_0x7a05('0x39')](_0x553081)){if(_0x553081===_0x7a05('0x58')&&_0x1c69fa[_0x553081][_0x7a05('0x50')]>_0x2325ee){_0xbdf11[_0x7a05('0x59')+_0x553081[_0x7a05('0x5a')]()]=_0x1c69fa[_0x553081][_0x7a05('0x4b')]()[_0x7a05('0x5b')](0x0,_0x2325ee);}else{_0xbdf11[_0x7a05('0x59')+_0x553081[_0x7a05('0x5a')]()]=_0x1c69fa[_0x553081];}}}}}return _0xbdf11;}exports[_0x7a05('0x5c')]=setXMDContactVariables; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 6619d9f..6be462c 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(_0x5cc7ce,_0x1d8604){var _0x42ccfd=function(_0x4a5520){while(--_0x4a5520){_0x5cc7ce['push'](_0x5cc7ce['shift']());}};_0x42ccfd(++_0x1d8604);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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(_0x205992,_0x4bd366){var _0x36c475=function(_0x2f5812){while(--_0x2f5812){_0x205992['push'](_0x205992['shift']());}};_0x36c475(++_0x4bd366);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'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 275f347..6ad7118 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 _0x14a0=['newchannel','syncNewchannel','bind','varset','syncVarSet','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','from-voip-provider','faxAccounts','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','actions','prototype','variable','value','channelstate','channelstatedesc','operation','status','filename','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','parse','.pdf','application/pdf','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','syncOriginateResponse','merge','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','SUCCESS','faxstatusstring','SENDING\x20FAILED','send','execOriginate','FaxAccountId','message','Fax\x20received','Fax\x20failed','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','path','dir','XMF-PATH','Action','variablesAction','ext','isTrunkReachable','isNil','active','SIP/%s','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','fax','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','lodash','bluebird','uuid','moment','tiff2pdf','./util/gs','../../../config/logger','../ami','./rpcDb','./channel','./util/util','./action','../rpc/attachment','channels','trunks'];(function(_0x487676,_0x31e92d){var _0x5220b5=function(_0x2155e1){while(--_0x2155e1){_0x487676['push'](_0x487676['shift']());}};_0x5220b5(++_0x31e92d);}(_0x14a0,0x156));var _0x014a=function(_0x2801d2,_0x8627e4){_0x2801d2=_0x2801d2-0x0;var _0x2503ff=_0x14a0[_0x2801d2];return _0x2503ff;};'use strict';var util=require('util');var _=require(_0x014a('0x0'));var BPromise=require(_0x014a('0x1'));var uuid=require(_0x014a('0x2'));var moment=require(_0x014a('0x3'));var path=require('path');var tiff2pdf=require(_0x014a('0x4'));var gs=require(_0x014a('0x5'));var logger=require(_0x014a('0x6'))('fax');var ami=require(_0x014a('0x7'));var rpcDb=require(_0x014a('0x8'));var Channel=require(_0x014a('0x9'));var ut=require(_0x014a('0xa'));var Action=require(_0x014a('0xb'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x014a('0xc'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x5bb311){this[_0x014a('0xd')]={};this['faxAccounts']=_0x5bb311['faxAccounts'];this[_0x014a('0xe')]=_0x5bb311[_0x014a('0xe')];this['actions']={};ami['on'](_0x014a('0xf'),this[_0x014a('0x10')][_0x014a('0x11')](this));ami['on'](_0x014a('0x12'),this[_0x014a('0x13')][_0x014a('0x11')](this));ami['on']('newstate',this[_0x014a('0x14')][_0x014a('0x11')](this));ami['on'](_0x014a('0x15'),this[_0x014a('0x16')]['bind'](this));ami['on'](_0x014a('0x17'),this[_0x014a('0x18')]['bind'](this));ami['on'](_0x014a('0x19'),this[_0x014a('0x1a')][_0x014a('0x11')](this));ami['on'](_0x014a('0x1b'),this[_0x014a('0x1c')]['bind'](this));ami['on'](_0x014a('0x1d'),this['syncOriginateResponse'][_0x014a('0x11')](this));}Fax['prototype'][_0x014a('0x10')]=function(_0x488b2c){if(_0x488b2c['context']===_0x014a('0x1e')){for(var _0x3608d8 in this[_0x014a('0x1f')]){if(this[_0x014a('0x1f')][_0x014a('0x20')](_0x3608d8)){if(_0x488b2c[_0x014a('0x21')]===this[_0x014a('0x1f')][_0x3608d8][_0x014a('0x22')]){this[_0x014a('0xd')][_0x488b2c['uniqueid']]={};this[_0x014a('0xd')][_0x488b2c[_0x014a('0x23')]][_0x014a('0x24')]=_0x488b2c[_0x014a('0x24')];this[_0x014a('0xd')][_0x488b2c[_0x014a('0x23')]]['id']=this['faxAccounts'][_0x3608d8]['id'];this['channels'][_0x488b2c['uniqueid']]['name']=this['faxAccounts'][_0x3608d8][_0x014a('0x25')];logger[_0x014a('0x26')](_0x488b2c[_0x014a('0x23')],_0x014a('0x27'));}}}}if(this[_0x014a('0x28')][_0x488b2c[_0x014a('0x23')]]){this[_0x014a('0xd')][_0x488b2c[_0x014a('0x23')]]={};this[_0x014a('0xd')][_0x488b2c[_0x014a('0x23')]][_0x014a('0x24')]=_0x488b2c[_0x014a('0x24')];logger[_0x014a('0x26')](_0x488b2c[_0x014a('0x23')],_0x014a('0x27'));}};Fax[_0x014a('0x29')][_0x014a('0x13')]=function(_0x277cf0){if(this[_0x014a('0xd')][_0x277cf0[_0x014a('0x23')]]){for(var _0xec972a in _0x277cf0[_0x014a('0x2a')]){if(_0x277cf0[_0x014a('0x2a')][_0x014a('0x20')](_0xec972a)){this[_0x014a('0xd')][_0x277cf0[_0x014a('0x23')]][_0xec972a]=_0x277cf0[_0x014a('0x2b')];}}}};Fax[_0x014a('0x29')]['syncNewState']=function(_0x33f4c7){if(this[_0x014a('0xd')][_0x33f4c7['uniqueid']]){this['channels'][_0x33f4c7[_0x014a('0x23')]][_0x014a('0x2c')]=_0x33f4c7['channelstate'];this[_0x014a('0xd')][_0x33f4c7[_0x014a('0x23')]][_0x014a('0x2d')]=_0x33f4c7['channelstatedesc'];}};Fax[_0x014a('0x29')][_0x014a('0x16')]=function(_0x255721){if(this['channels'][_0x255721[_0x014a('0x23')]]){for(var _0x570c88 in _0x255721[_0x014a('0x2a')]){if(_0x255721[_0x014a('0x2a')][_0x014a('0x20')](_0x570c88)){this[_0x014a('0xd')][_0x255721[_0x014a('0x23')]][_0x570c88]=_0x255721[_0x014a('0x2b')];}}}};Fax['prototype'][_0x014a('0x18')]=function(_0x4d5a3c){if(this[_0x014a('0xd')][_0x4d5a3c[_0x014a('0x23')]]){this[_0x014a('0xd')][_0x4d5a3c[_0x014a('0x23')]][_0x014a('0x2e')]=_0x4d5a3c[_0x014a('0x2e')];this[_0x014a('0xd')][_0x4d5a3c[_0x014a('0x23')]][_0x014a('0x2f')]=_0x4d5a3c[_0x014a('0x2f')];this['channels'][_0x4d5a3c[_0x014a('0x23')]][_0x014a('0x22')]=_0x4d5a3c['localstationid'];this[_0x014a('0xd')][_0x4d5a3c[_0x014a('0x23')]][_0x014a('0x30')]=_0x4d5a3c[_0x014a('0x30')];logger[_0x014a('0x26')](_0x4d5a3c['uniqueid'],'\x20syncFaxStatus\x20');}};Fax[_0x014a('0x29')][_0x014a('0x1a')]=function(_0x2ac3f7){var _0x289cde=this;if(this['channels'][_0x2ac3f7['uniqueid']]){var _0x4d5913=this['channels'][_0x2ac3f7[_0x014a('0x23')]]['id'];this[_0x014a('0xd')][_0x2ac3f7[_0x014a('0x23')]][_0x014a('0x31')]=_0x2ac3f7[_0x014a('0x31')];this[_0x014a('0xd')][_0x2ac3f7['uniqueid']][_0x014a('0x32')]=_0x2ac3f7[_0x014a('0x32')];this[_0x014a('0xd')][_0x2ac3f7['uniqueid']]['localstationid']=_0x2ac3f7[_0x014a('0x22')];this[_0x014a('0xd')][_0x2ac3f7[_0x014a('0x23')]][_0x014a('0x33')]=_0x2ac3f7[_0x014a('0x33')];this[_0x014a('0xd')][_0x2ac3f7[_0x014a('0x23')]][_0x014a('0x34')]=_0x2ac3f7[_0x014a('0x34')];this[_0x014a('0xd')][_0x2ac3f7[_0x014a('0x23')]][_0x014a('0x30')]=_0x2ac3f7['filename'];this[_0x014a('0xd')][_0x2ac3f7[_0x014a('0x23')]]['calleridnum']=_0x2ac3f7[_0x014a('0x35')];if(this[_0x014a('0xd')][_0x2ac3f7['uniqueid']][_0x014a('0x32')]>0x0){tiff2pdf(_0x2ac3f7['filename'],_0x014a('0x36'),function(_0x2d0fa5){logger[_0x014a('0x26')](_0x2ac3f7['uniqueid'],_0x014a('0x37'),_0x2d0fa5['message']);attachment['create']({'name':path[_0x014a('0x38')](_0x2ac3f7['filename'])[_0x014a('0x25')],'basename':path['parse'](_0x2ac3f7[_0x014a('0x30')])[_0x014a('0x25')]+_0x014a('0x39'),'type':_0x014a('0x3a')})['then'](function(_0x4e0dbc){faxAccount[_0x014a('0x3b')](_0x4d5913,{'from':_0x2ac3f7[_0x014a('0x35')],'mapKey':'fax','body':path[_0x014a('0x38')](_0x2ac3f7[_0x014a('0x30')])[_0x014a('0x25')]+_0x014a('0x39'),'AttachmentId':_0x4e0dbc['id']})[_0x014a('0x3c')](function(_0x412541){logger[_0x014a('0x3d')](_0x2ac3f7[_0x014a('0x23')],_0x014a('0x3e'),JSON[_0x014a('0x3f')](_0x412541));});})[_0x014a('0x3c')](function(_0x1f0d6e){logger[_0x014a('0x3d')](_0x2ac3f7[_0x014a('0x23')],_0x014a('0x40'),JSON[_0x014a('0x3f')](_0x1f0d6e));});});}logger[_0x014a('0x26')](_0x2ac3f7[_0x014a('0x23')],_0x014a('0x40'));}};Fax[_0x014a('0x29')][_0x014a('0x41')]=function(_0x7ba342){if(this[_0x014a('0x28')][_0x7ba342['uniqueid']]){_[_0x014a('0x42')](this[_0x014a('0xd')][_0x7ba342['uniqueid']],_['pick'](_0x7ba342,[_0x014a('0x43'),_0x014a('0x44')]));}};function updateStatus(_0x1cae14){if(_0x1cae14[_0x014a('0x45')]){faxMessage[_0x014a('0x46')](_0x1cae14[_0x014a('0x45')],{'failMessage':_0x014a('0x47')})[_0x014a('0x48')](function(_0x32cf21){ut[_0x014a('0x49')](_0x014a('0x4a'),_0x32cf21);})[_0x014a('0x3c')](function(_0x5085ca){ut[_0x014a('0x49')](_0x014a('0x4b'),_0x5085ca);});}else{ut[_0x014a('0x49')](_0x014a('0x4c'));}}Fax[_0x014a('0x29')][_0x014a('0x4d')]=function(_0x4fd068,_0x4d4391,_0x15de29){var _0x54584d=this;var _0x223f58={};if(_0x4d4391){_0x223f58={'read':_0x4d4391};}else{_0x223f58={'failMessage':_0x15de29};}if(this['actions'][_0x4fd068][_0x014a('0x45')]){faxMessage[_0x014a('0x46')](this[_0x014a('0x28')][_0x4fd068][_0x014a('0x45')],_0x223f58)[_0x014a('0x48')](function(_0x4e7b6e){ut[_0x014a('0x49')](_0x014a('0x4e'),_0x4e7b6e);})[_0x014a('0x3c')](function(_0x25a146){ut['logger'](_0x014a('0x4f'),_0x25a146);})[_0x014a('0x50')](function(){delete _0x54584d[_0x014a('0xd')][_0x4fd068];delete _0x54584d[_0x014a('0x28')][_0x4fd068];});}else{ut[_0x014a('0x49')](_0x014a('0x51'));delete this[_0x014a('0xd')][_0x4fd068];delete this['actions'][_0x4fd068];}};Fax[_0x014a('0x29')]['syncHangup']=function(_0x529cff){var _0x1efe2b=this;if(this[_0x014a('0xd')][_0x529cff[_0x014a('0x23')]]){if(this['actions'][_0x529cff[_0x014a('0x23')]]){this[_0x014a('0xd')][_0x529cff['uniqueid']]['id']=this[_0x014a('0x28')][_0x529cff[_0x014a('0x23')]]['id'];this[_0x014a('0xd')][_0x529cff[_0x014a('0x23')]]['name']=this[_0x014a('0x28')][_0x529cff[_0x014a('0x23')]][_0x014a('0x25')];}logger[_0x014a('0x26')](_0x529cff[_0x014a('0x23')],this[_0x014a('0x28')][_0x529cff[_0x014a('0x23')]]?_0x014a('0x52'):_0x014a('0x53'),JSON[_0x014a('0x3f')](this[_0x014a('0xd')][_0x529cff[_0x014a('0x23')]]));if(this[_0x014a('0x28')][_0x529cff['uniqueid']]){if(this[_0x014a('0xd')][_0x529cff[_0x014a('0x23')]]['faxpages']>0x0&&this[_0x014a('0xd')][_0x529cff[_0x014a('0x23')]][_0x014a('0x17')]===_0x014a('0x54')){this[_0x014a('0x4d')](_0x529cff[_0x014a('0x23')],!![]);}else{this[_0x014a('0x4d')](_0x529cff['uniqueid'],![],this[_0x014a('0xd')][_0x529cff[_0x014a('0x23')]][_0x014a('0x55')]?'SENDING\x20FAILED:\x20'+this['channels'][_0x529cff['uniqueid']][_0x014a('0x55')]:_0x014a('0x56'));}}}};Fax[_0x014a('0x29')][_0x014a('0x57')]=function(_0x582cfa){var _0x4176f7=this;return new BPromise(function(_0x5b57a4,_0x2f344e){_0x4176f7[_0x014a('0x58')](_0x582cfa,_0x4176f7['faxAccounts'][_0x582cfa[_0x014a('0x59')]])[_0x014a('0x48')](function(_0x13bb31){ut['logger']('[Fax][execOriginate][success]',_0x13bb31);_0x5b57a4(ut[_0x014a('0x5a')](_0x014a('0x5b')));})[_0x014a('0x3c')](function(_0x113801){ut[_0x014a('0x49')]('[Fax][execOriginate][failure]',_0x113801);updateStatus(_0x582cfa);_0x2f344e(ut[_0x014a('0x5a')](_0x014a('0x5c')));});});};Fax[_0x014a('0x29')]['checkAfterSend']=function(_0x269e85){var _0x3583aa=this;return new BPromise(function(_0x3c32c4,_0x2aaf22){var _0x297226=_0x3583aa[_0x014a('0x5d')](_0x3583aa[_0x014a('0x1f')][_0x269e85[_0x014a('0x59')]][_0x014a('0x5e')],_0x269e85);if(_0x297226[_0x014a('0x5f')]){_0x3c32c4(ut[_0x014a('0x5a')](_0x014a('0x60')));}else{_0x2aaf22(ut['message'](_0x297226[_0x014a('0x5a')]));}});};function originate(_0x3bbb8d,_0xdb13b2,_0x5e742f){return new BPromise(function(_0x426dcb,_0x1573c0){if(_0x5e742f){var _0xc2c81a=util[_0x014a('0x61')](_0x014a('0x62'),path['parse'](_0x3bbb8d['path'])[_0x014a('0x25')],_0x3bbb8d['path']);gs[_0x014a('0x63')](_0xc2c81a)[_0x014a('0x48')](function(){_0x3bbb8d['path']=util[_0x014a('0x61')](_0x014a('0x64'),path[_0x014a('0x38')](_0x3bbb8d[_0x014a('0x65')])[_0x014a('0x66')],path[_0x014a('0x38')](_0x3bbb8d[_0x014a('0x65')])[_0x014a('0x25')]);_0xdb13b2[_0x014a('0x67')]=_0x3bbb8d[_0x014a('0x65')];ut['logger']('Convert\x20pdf\x20to\x20tif','');ami[_0x014a('0x68')](ut[_0x014a('0x69')](_0x3bbb8d,_0xdb13b2))['then'](function(_0x5391db){_0x426dcb(_0x5391db);})[_0x014a('0x3c')](function(_0x4c02ac){_0x1573c0(_0x4c02ac);});})['catch'](function(_0x301ab5){_0x1573c0(_0x301ab5);});}else{ami[_0x014a('0x68')](ut[_0x014a('0x69')](_0x3bbb8d,_0xdb13b2))['then'](function(_0x15a7cd){_0x426dcb(_0x15a7cd);})['catch'](function(_0x527eb1){_0x1573c0(_0x527eb1);});}});}Fax[_0x014a('0x29')][_0x014a('0x58')]=function(_0x2393bc,_0x5c0892){var _0x3099ea=this;return new BPromise(function(_0x2bf105,_0x14477d){var _0x8698f7=uuid['v4']();var _0xfe1f08=ut['addVariables'](_0x2393bc,_0x5c0892);_0x3099ea[_0x014a('0x28')][_0x8698f7]=new Action(_0x8698f7,_0x5c0892,_0x2393bc);var _0x3210fd=_0x3099ea['actions'][_0x8698f7];if(path['parse'](_0x2393bc[_0x014a('0x65')])[_0x014a('0x6a')]===_0x014a('0x39')){originate(_0x3210fd,_0xfe1f08,!![])[_0x014a('0x48')](function(_0x3855ea){_0x2bf105(_0x3855ea);})[_0x014a('0x3c')](function(_0x22ab79){_0x14477d(_0x22ab79);});}else{originate(_0x3210fd,_0xfe1f08,![])[_0x014a('0x48')](function(_0x1634fa){_0x2bf105(_0x1634fa);})['catch'](function(_0x5e8d35){_0x14477d(_0x5e8d35);});}});};Fax[_0x014a('0x29')][_0x014a('0x6b')]=function(_0x354dc1){return!_[_0x014a('0x6c')](_0x354dc1)&&!_[_0x014a('0x6c')](_0x354dc1[_0x014a('0x25')])&&!_['isNil'](_0x354dc1[_0x014a('0x6d')])&&_0x354dc1[_0x014a('0x6d')]&&!_[_0x014a('0x6c')](this['trunks'][util[_0x014a('0x61')](_0x014a('0x6e'),_0x354dc1[_0x014a('0x25')])])&&!_[_0x014a('0x6c')](this['trunks'][util[_0x014a('0x61')](_0x014a('0x6e'),_0x354dc1[_0x014a('0x25')])][_0x014a('0x2f')])&&(this[_0x014a('0xe')][util[_0x014a('0x61')]('SIP/%s',_0x354dc1[_0x014a('0x25')])][_0x014a('0x2f')]==='reachable'||this[_0x014a('0xe')][util[_0x014a('0x61')](_0x014a('0x6e'),_0x354dc1[_0x014a('0x25')])][_0x014a('0x2f')]===_0x014a('0x6f'));};Fax[_0x014a('0x29')]['checkTrunk']=function(_0x56fe57,_0xdbc4dc){if(!this[_0x014a('0x6b')](_0x56fe57)){ut[_0x014a('0x49')](_0x014a('0x70'),_[_0x014a('0x6c')](_0x56fe57)?'':_0x56fe57[_0x014a('0x25')]+_0x014a('0x71'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}if(_['isNil'](_0xdbc4dc[_0x014a('0x72')])){ut['logger']('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0x014a('0x3f')](_0xdbc4dc));return{'isValid':![],'message':_0x014a('0x73')};}if(_[_0x014a('0x6c')](_0xdbc4dc['path'])){ut['logger'](_0x014a('0x74'),JSON['stringify'](_0xdbc4dc));return{'isValid':![],'message':_0x014a('0x75')};}return{'isValid':!![],'message':_0x014a('0x76')};};module['exports']=Fax; \ No newline at end of file +var _0x5dab=['Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','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','format','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','Action','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','util','lodash','bluebird','uuid','moment','path','tiff2pdf','../../../config/logger','./channel','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','newstate','syncNewState','newexten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','originateresponse','prototype','context','hasOwnProperty','exten','channel','uniqueid','name','info','\x20syncNewchannel\x20','channelstate','channelstatedesc','syncNewExten','variable','value','operation','status','localstationid','filename','\x20syncFaxStatus\x20','remotestationid','resolution','transferrate','calleridnum','pagestransferred','/var/opt/motion2/server/files/attachments/','message','create','parse','.pdf','application/pdf','then','fax','catch','\x20notify\x20','error','\x20receiveFax\x20','syncOriginateResponse','merge','response','reason','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','AttachmentId','update','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','stringify','faxpages','SUCCESS','faxstatusstring','execOriginate','FaxAccountId','[Fax][execOriginate][success]'];(function(_0xe706ae,_0x52e822){var _0x19e176=function(_0x23d680){while(--_0x23d680){_0xe706ae['push'](_0xe706ae['shift']());}};_0x19e176(++_0x52e822);}(_0x5dab,0x183));var _0xb5da=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x5dab[_0x30ae5e];return _0x1f2e93;};'use strict';var util=require(_0xb5da('0x0'));var _=require(_0xb5da('0x1'));var BPromise=require(_0xb5da('0x2'));var uuid=require(_0xb5da('0x3'));var moment=require(_0xb5da('0x4'));var path=require(_0xb5da('0x5'));var tiff2pdf=require(_0xb5da('0x6'));var gs=require('./util/gs');var logger=require(_0xb5da('0x7'))('fax');var ami=require('../ami');var rpcDb=require('./rpcDb');var Channel=require(_0xb5da('0x8'));var ut=require('./util/util');var Action=require(_0xb5da('0x9'));var faxAccount=require(_0xb5da('0xa'));var attachment=require(_0xb5da('0xb'));var faxMessage=require(_0xb5da('0xc'));function Fax(_0xfd27f4){this[_0xb5da('0xd')]={};this[_0xb5da('0xe')]=_0xfd27f4[_0xb5da('0xe')];this[_0xb5da('0xf')]=_0xfd27f4[_0xb5da('0xf')];this[_0xb5da('0x10')]={};ami['on'](_0xb5da('0x11'),this[_0xb5da('0x12')][_0xb5da('0x13')](this));ami['on']('varset',this['syncVarSet'][_0xb5da('0x13')](this));ami['on'](_0xb5da('0x14'),this[_0xb5da('0x15')][_0xb5da('0x13')](this));ami['on'](_0xb5da('0x16'),this['syncNewExten'][_0xb5da('0x13')](this));ami['on'](_0xb5da('0x17'),this[_0xb5da('0x18')][_0xb5da('0x13')](this));ami['on'](_0xb5da('0x19'),this[_0xb5da('0x1a')]['bind'](this));ami['on']('hangup',this['syncHangup']['bind'](this));ami['on'](_0xb5da('0x1b'),this['syncOriginateResponse']['bind'](this));}Fax[_0xb5da('0x1c')][_0xb5da('0x12')]=function(_0x45378a){if(_0x45378a[_0xb5da('0x1d')]==='from-voip-provider'){for(var _0x28dcdf in this['faxAccounts']){if(this[_0xb5da('0xe')][_0xb5da('0x1e')](_0x28dcdf)){if(_0x45378a[_0xb5da('0x1f')]===this[_0xb5da('0xe')][_0x28dcdf]['localstationid']){this[_0xb5da('0xd')][_0x45378a['uniqueid']]={};this[_0xb5da('0xd')][_0x45378a['uniqueid']][_0xb5da('0x20')]=_0x45378a[_0xb5da('0x20')];this[_0xb5da('0xd')][_0x45378a[_0xb5da('0x21')]]['id']=this[_0xb5da('0xe')][_0x28dcdf]['id'];this[_0xb5da('0xd')][_0x45378a[_0xb5da('0x21')]][_0xb5da('0x22')]=this['faxAccounts'][_0x28dcdf][_0xb5da('0x22')];logger[_0xb5da('0x23')](_0x45378a[_0xb5da('0x21')],_0xb5da('0x24'));}}}}if(this[_0xb5da('0x10')][_0x45378a[_0xb5da('0x21')]]){this['channels'][_0x45378a['uniqueid']]={};this[_0xb5da('0xd')][_0x45378a[_0xb5da('0x21')]][_0xb5da('0x20')]=_0x45378a['channel'];logger['info'](_0x45378a[_0xb5da('0x21')],_0xb5da('0x24'));}};Fax[_0xb5da('0x1c')]['syncVarSet']=function(_0xe0051a){if(this[_0xb5da('0xd')][_0xe0051a[_0xb5da('0x21')]]){for(var _0x13ee39 in _0xe0051a['variable']){if(_0xe0051a['variable']['hasOwnProperty'](_0x13ee39)){this[_0xb5da('0xd')][_0xe0051a['uniqueid']][_0x13ee39]=_0xe0051a['value'];}}}};Fax[_0xb5da('0x1c')]['syncNewState']=function(_0x4c2cee){if(this[_0xb5da('0xd')][_0x4c2cee[_0xb5da('0x21')]]){this[_0xb5da('0xd')][_0x4c2cee[_0xb5da('0x21')]][_0xb5da('0x25')]=_0x4c2cee[_0xb5da('0x25')];this['channels'][_0x4c2cee[_0xb5da('0x21')]][_0xb5da('0x26')]=_0x4c2cee['channelstatedesc'];}};Fax[_0xb5da('0x1c')][_0xb5da('0x27')]=function(_0xaa8b7a){if(this[_0xb5da('0xd')][_0xaa8b7a['uniqueid']]){for(var _0x3cbfef in _0xaa8b7a[_0xb5da('0x28')]){if(_0xaa8b7a[_0xb5da('0x28')][_0xb5da('0x1e')](_0x3cbfef)){this['channels'][_0xaa8b7a[_0xb5da('0x21')]][_0x3cbfef]=_0xaa8b7a[_0xb5da('0x29')];}}}};Fax[_0xb5da('0x1c')][_0xb5da('0x18')]=function(_0x15e685){if(this[_0xb5da('0xd')][_0x15e685[_0xb5da('0x21')]]){this[_0xb5da('0xd')][_0x15e685[_0xb5da('0x21')]][_0xb5da('0x2a')]=_0x15e685[_0xb5da('0x2a')];this['channels'][_0x15e685[_0xb5da('0x21')]][_0xb5da('0x2b')]=_0x15e685['status'];this[_0xb5da('0xd')][_0x15e685[_0xb5da('0x21')]]['localstationid']=_0x15e685[_0xb5da('0x2c')];this[_0xb5da('0xd')][_0x15e685[_0xb5da('0x21')]][_0xb5da('0x2d')]=_0x15e685[_0xb5da('0x2d')];logger['info'](_0x15e685[_0xb5da('0x21')],_0xb5da('0x2e'));}};Fax[_0xb5da('0x1c')][_0xb5da('0x1a')]=function(_0x29f371){var _0x3d6e4f=this;if(this[_0xb5da('0xd')][_0x29f371[_0xb5da('0x21')]]){var _0x9d5758=this[_0xb5da('0xd')][_0x29f371[_0xb5da('0x21')]]['id'];this[_0xb5da('0xd')][_0x29f371[_0xb5da('0x21')]][_0xb5da('0x2f')]=_0x29f371['remotestationid'];this[_0xb5da('0xd')][_0x29f371[_0xb5da('0x21')]]['pagestransferred']=_0x29f371['pagestransferred'];this[_0xb5da('0xd')][_0x29f371['uniqueid']][_0xb5da('0x2c')]=_0x29f371[_0xb5da('0x2c')];this['channels'][_0x29f371[_0xb5da('0x21')]][_0xb5da('0x30')]=_0x29f371['resolution'];this[_0xb5da('0xd')][_0x29f371[_0xb5da('0x21')]][_0xb5da('0x31')]=_0x29f371['transferrate'];this[_0xb5da('0xd')][_0x29f371['uniqueid']][_0xb5da('0x2d')]=_0x29f371[_0xb5da('0x2d')];this[_0xb5da('0xd')][_0x29f371[_0xb5da('0x21')]][_0xb5da('0x32')]=_0x29f371['calleridnum'];if(this[_0xb5da('0xd')][_0x29f371[_0xb5da('0x21')]][_0xb5da('0x33')]>0x0){tiff2pdf(_0x29f371[_0xb5da('0x2d')],_0xb5da('0x34'),function(_0x5dbab2){logger[_0xb5da('0x23')](_0x29f371[_0xb5da('0x21')],'\x20result\x20conversion\x20file\x20',_0x5dbab2[_0xb5da('0x35')]);attachment[_0xb5da('0x36')]({'name':path[_0xb5da('0x37')](_0x29f371[_0xb5da('0x2d')])[_0xb5da('0x22')],'basename':path['parse'](_0x29f371[_0xb5da('0x2d')])[_0xb5da('0x22')]+_0xb5da('0x38'),'type':_0xb5da('0x39')})[_0xb5da('0x3a')](function(_0x20f7c6){faxAccount['notify'](_0x9d5758,{'from':_0x29f371['calleridnum'],'mapKey':_0xb5da('0x3b'),'body':path[_0xb5da('0x37')](_0x29f371[_0xb5da('0x2d')])[_0xb5da('0x22')]+_0xb5da('0x38'),'AttachmentId':_0x20f7c6['id']})[_0xb5da('0x3c')](function(_0x46ed49){logger['error'](_0x29f371['uniqueid'],_0xb5da('0x3d'),JSON['stringify'](_0x46ed49));});})['catch'](function(_0xea5954){logger[_0xb5da('0x3e')](_0x29f371['uniqueid'],_0xb5da('0x3f'),JSON['stringify'](_0xea5954));});});}logger['info'](_0x29f371[_0xb5da('0x21')],_0xb5da('0x3f'));}};Fax[_0xb5da('0x1c')][_0xb5da('0x40')]=function(_0x40eb16){if(this['actions'][_0x40eb16[_0xb5da('0x21')]]){_[_0xb5da('0x41')](this['channels'][_0x40eb16[_0xb5da('0x21')]],_['pick'](_0x40eb16,[_0xb5da('0x42'),_0xb5da('0x43')]));}};function updateStatus(_0x5a4496){if(_0x5a4496['AttachmentId']){faxMessage['update'](_0x5a4496['AttachmentId'],{'failMessage':_0xb5da('0x44')})[_0xb5da('0x3a')](function(_0x8aca71){ut[_0xb5da('0x45')]('[Fax][Message][Error][Updated]',_0x8aca71);})[_0xb5da('0x3c')](function(_0x493f5b){ut[_0xb5da('0x45')](_0xb5da('0x46'),_0x493f5b);});}else{ut[_0xb5da('0x45')](_0xb5da('0x47'));}}Fax[_0xb5da('0x1c')][_0xb5da('0x48')]=function(_0x249571,_0x2c82c6,_0x357449){var _0x27fe34=this;var _0x1d9e86={};if(_0x2c82c6){_0x1d9e86={'read':_0x2c82c6};}else{_0x1d9e86={'failMessage':_0x357449};}if(this['actions'][_0x249571][_0xb5da('0x49')]){faxMessage[_0xb5da('0x4a')](this[_0xb5da('0x10')][_0x249571][_0xb5da('0x49')],_0x1d9e86)[_0xb5da('0x3a')](function(_0x423354){ut[_0xb5da('0x45')](_0xb5da('0x4b'),_0x423354);})['catch'](function(_0x1ebd78){ut['logger'](_0xb5da('0x4c'),_0x1ebd78);})[_0xb5da('0x4d')](function(){delete _0x27fe34[_0xb5da('0xd')][_0x249571];delete _0x27fe34[_0xb5da('0x10')][_0x249571];});}else{ut[_0xb5da('0x45')](_0xb5da('0x4e'));delete this[_0xb5da('0xd')][_0x249571];delete this[_0xb5da('0x10')][_0x249571];}};Fax[_0xb5da('0x1c')][_0xb5da('0x4f')]=function(_0x2b70aa){var _0x377604=this;if(this[_0xb5da('0xd')][_0x2b70aa[_0xb5da('0x21')]]){if(this[_0xb5da('0x10')][_0x2b70aa['uniqueid']]){this['channels'][_0x2b70aa[_0xb5da('0x21')]]['id']=this[_0xb5da('0x10')][_0x2b70aa['uniqueid']]['id'];this[_0xb5da('0xd')][_0x2b70aa[_0xb5da('0x21')]][_0xb5da('0x22')]=this[_0xb5da('0x10')][_0x2b70aa['uniqueid']][_0xb5da('0x22')];}logger[_0xb5da('0x23')](_0x2b70aa[_0xb5da('0x21')],this[_0xb5da('0x10')][_0x2b70aa[_0xb5da('0x21')]]?_0xb5da('0x50'):_0xb5da('0x51'),JSON[_0xb5da('0x52')](this[_0xb5da('0xd')][_0x2b70aa['uniqueid']]));if(this[_0xb5da('0x10')][_0x2b70aa[_0xb5da('0x21')]]){if(this['channels'][_0x2b70aa[_0xb5da('0x21')]][_0xb5da('0x53')]>0x0&&this[_0xb5da('0xd')][_0x2b70aa[_0xb5da('0x21')]][_0xb5da('0x17')]===_0xb5da('0x54')){this[_0xb5da('0x48')](_0x2b70aa[_0xb5da('0x21')],!![]);}else{this[_0xb5da('0x48')](_0x2b70aa[_0xb5da('0x21')],![],this[_0xb5da('0xd')][_0x2b70aa[_0xb5da('0x21')]][_0xb5da('0x55')]?'SENDING\x20FAILED:\x20'+this[_0xb5da('0xd')][_0x2b70aa[_0xb5da('0x21')]][_0xb5da('0x55')]:'SENDING\x20FAILED');}}}};Fax[_0xb5da('0x1c')]['send']=function(_0x452c87){var _0x2c2172=this;return new BPromise(function(_0x2efb51,_0x1cf401){_0x2c2172[_0xb5da('0x56')](_0x452c87,_0x2c2172[_0xb5da('0xe')][_0x452c87[_0xb5da('0x57')]])[_0xb5da('0x3a')](function(_0x10ced4){ut['logger'](_0xb5da('0x58'),_0x10ced4);_0x2efb51(ut[_0xb5da('0x35')](_0xb5da('0x59')));})[_0xb5da('0x3c')](function(_0x4e3cda){ut['logger'](_0xb5da('0x5a'),_0x4e3cda);updateStatus(_0x452c87);_0x1cf401(ut['message'](_0xb5da('0x5b')));});});};Fax[_0xb5da('0x1c')][_0xb5da('0x5c')]=function(_0x176fa3){var _0x19accf=this;return new BPromise(function(_0x45be6a,_0x4e9636){var _0x1c72cc=_0x19accf[_0xb5da('0x5d')](_0x19accf[_0xb5da('0xe')][_0x176fa3[_0xb5da('0x57')]][_0xb5da('0x5e')],_0x176fa3);if(_0x1c72cc[_0xb5da('0x5f')]){_0x45be6a(ut['message']('Trunk\x20Reachable'));}else{_0x4e9636(ut[_0xb5da('0x35')](_0x1c72cc[_0xb5da('0x35')]));}});};function originate(_0xb4505,_0xdc6d7a,_0xcbb6ae){return new BPromise(function(_0x120497,_0xc4c22a){if(_0xcbb6ae){var _0xdbc777=util['format'](_0xb5da('0x60'),path['parse'](_0xb4505['path'])[_0xb5da('0x22')],_0xb4505[_0xb5da('0x5')]);gs[_0xb5da('0x61')](_0xdbc777)[_0xb5da('0x3a')](function(){_0xb4505[_0xb5da('0x5')]=util[_0xb5da('0x62')](_0xb5da('0x63'),path[_0xb5da('0x37')](_0xb4505[_0xb5da('0x5')])['dir'],path[_0xb5da('0x37')](_0xb4505['path'])[_0xb5da('0x22')]);_0xdc6d7a[_0xb5da('0x64')]=_0xb4505[_0xb5da('0x5')];ut[_0xb5da('0x45')](_0xb5da('0x65'),'');ami['Action'](ut[_0xb5da('0x66')](_0xb4505,_0xdc6d7a))[_0xb5da('0x3a')](function(_0x51dd41){_0x120497(_0x51dd41);})['catch'](function(_0x12c068){_0xc4c22a(_0x12c068);});})[_0xb5da('0x3c')](function(_0x556a2c){_0xc4c22a(_0x556a2c);});}else{ami[_0xb5da('0x67')](ut[_0xb5da('0x66')](_0xb4505,_0xdc6d7a))['then'](function(_0x214391){_0x120497(_0x214391);})[_0xb5da('0x3c')](function(_0x67e62c){_0xc4c22a(_0x67e62c);});}});}Fax[_0xb5da('0x1c')][_0xb5da('0x56')]=function(_0x3243ee,_0x542e24){var _0x1a7311=this;return new BPromise(function(_0x4039d1,_0x223eeb){var _0x2fdb9d=uuid['v4']();var _0x2d95d0=ut[_0xb5da('0x68')](_0x3243ee,_0x542e24);_0x1a7311['actions'][_0x2fdb9d]=new Action(_0x2fdb9d,_0x542e24,_0x3243ee);var _0x4d9fb5=_0x1a7311[_0xb5da('0x10')][_0x2fdb9d];if(path['parse'](_0x3243ee[_0xb5da('0x5')])[_0xb5da('0x69')]==='.pdf'){originate(_0x4d9fb5,_0x2d95d0,!![])[_0xb5da('0x3a')](function(_0x23ccbf){_0x4039d1(_0x23ccbf);})[_0xb5da('0x3c')](function(_0x1c0dfa){_0x223eeb(_0x1c0dfa);});}else{originate(_0x4d9fb5,_0x2d95d0,![])[_0xb5da('0x3a')](function(_0x1db86b){_0x4039d1(_0x1db86b);})[_0xb5da('0x3c')](function(_0x434e25){_0x223eeb(_0x434e25);});}});};Fax['prototype'][_0xb5da('0x6a')]=function(_0x1b0fd8){return!_[_0xb5da('0x6b')](_0x1b0fd8)&&!_['isNil'](_0x1b0fd8[_0xb5da('0x22')])&&!_[_0xb5da('0x6b')](_0x1b0fd8[_0xb5da('0x6c')])&&_0x1b0fd8[_0xb5da('0x6c')]&&!_[_0xb5da('0x6b')](this[_0xb5da('0xf')][util[_0xb5da('0x62')]('SIP/%s',_0x1b0fd8['name'])])&&!_['isNil'](this[_0xb5da('0xf')][util['format'](_0xb5da('0x6d'),_0x1b0fd8['name'])][_0xb5da('0x2b')])&&(this[_0xb5da('0xf')][util[_0xb5da('0x62')](_0xb5da('0x6d'),_0x1b0fd8[_0xb5da('0x22')])]['status']===_0xb5da('0x6e')||this['trunks'][util[_0xb5da('0x62')](_0xb5da('0x6d'),_0x1b0fd8[_0xb5da('0x22')])][_0xb5da('0x2b')]===_0xb5da('0x6f'));};Fax[_0xb5da('0x1c')][_0xb5da('0x5d')]=function(_0x52ab58,_0xcabb56){if(!this[_0xb5da('0x6a')](_0x52ab58)){ut[_0xb5da('0x45')]('[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]',_[_0xb5da('0x6b')](_0x52ab58)?'':_0x52ab58[_0xb5da('0x22')]+_0xb5da('0x70'));return{'isValid':![],'message':_0xb5da('0x71')};}if(_[_0xb5da('0x6b')](_0xcabb56[_0xb5da('0x3b')])){ut[_0xb5da('0x45')](_0xb5da('0x72'),JSON[_0xb5da('0x52')](_0xcabb56));return{'isValid':![],'message':_0xb5da('0x73')};}if(_[_0xb5da('0x6b')](_0xcabb56[_0xb5da('0x5')])){ut[_0xb5da('0x45')](_0xb5da('0x74'),JSON[_0xb5da('0x52')](_0xcabb56));return{'isValid':![],'message':_0xb5da('0x75')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0xb5da('0x76')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 01b0b3c..5f99ef9 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 _0xa602=['util','../../../config/logger','preview','lodash','../rpc/faxAccount','inspect','notify','resolve','then','[Notify]\x20'];(function(_0x458c52,_0x5e3fb4){var _0x43f43b=function(_0x5cdfeb){while(--_0x5cdfeb){_0x458c52['push'](_0x458c52['shift']());}};_0x43f43b(++_0x5e3fb4);}(_0xa602,0x172));var _0x2a60=function(_0x4a6fe2,_0x543a05){_0x4a6fe2=_0x4a6fe2-0x0;var _0x33fc31=_0xa602[_0x4a6fe2];return _0x33fc31;};'use strict';var util=require(_0x2a60('0x0'));var BPromise=require('bluebird');var logger=require(_0x2a60('0x1'))(_0x2a60('0x2'));var _=require(_0x2a60('0x3'));var faxAccount=require(_0x2a60('0x4'));function loggerCatch(_0x2bd125){return function(_0x3ddb5f){logger['error'](_0x2bd125,util[_0x2a60('0x5')](_0x3ddb5f,{'showHidden':![],'depth':null}));};}exports[_0x2a60('0x6')]=function(_0x294945,_0x1f38de){return BPromise[_0x2a60('0x7')]()[_0x2a60('0x8')](faxAccount[_0x2a60('0x6')](_0x294945,_0x1f38de))['catch'](loggerCatch(_0x2a60('0x9')));}; \ No newline at end of file +var _0x40e2=['lodash','inspect','notify','resolve','then','catch','[Notify]\x20','util','bluebird','../../../config/logger','preview'];(function(_0x47a897,_0x1f5728){var _0x30afe2=function(_0x46f1ff){while(--_0x46f1ff){_0x47a897['push'](_0x47a897['shift']());}};_0x30afe2(++_0x1f5728);}(_0x40e2,0xb7));var _0x240e=function(_0x1685c9,_0x1f272c){_0x1685c9=_0x1685c9-0x0;var _0x19b762=_0x40e2[_0x1685c9];return _0x19b762;};'use strict';var util=require(_0x240e('0x0'));var BPromise=require(_0x240e('0x1'));var logger=require(_0x240e('0x2'))(_0x240e('0x3'));var _=require(_0x240e('0x4'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x55b5e7){return function(_0x3e818a){logger['error'](_0x55b5e7,util[_0x240e('0x5')](_0x3e818a,{'showHidden':![],'depth':null}));};}exports[_0x240e('0x6')]=function(_0x4a0572,_0x522afa){return BPromise[_0x240e('0x7')]()[_0x240e('0x8')](faxAccount[_0x240e('0x6')](_0x4a0572,_0x522afa))[_0x240e('0x9')](loggerCatch(_0x240e('0xa')));}; \ 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 8280795..0266093 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 _0xb156=['bluebird','child_process','exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect','util','fax'];(function(_0x33de54,_0x5434b9){var _0x18fe1f=function(_0x3fe66c){while(--_0x3fe66c){_0x33de54['push'](_0x33de54['shift']());}};_0x18fe1f(++_0x5434b9);}(_0xb156,0xbc));var _0x6b15=function(_0x21774b,_0x4a6d2b){_0x21774b=_0x21774b-0x0;var _0x4675b2=_0xb156[_0x21774b];return _0x4675b2;};'use strict';var util=require(_0x6b15('0x0'));var logger=require('../../../../config/logger')(_0x6b15('0x1'));var BPromise=require(_0x6b15('0x2'));var exec=require(_0x6b15('0x3'))[_0x6b15('0x4')];exports[_0x6b15('0x5')]=function(_0x1956ce){return new BPromise(function(_0xd91d6e,_0x1b7b58){exec(_0x1956ce,function(_0x4d27cd,_0x21d657,_0x2a9636){logger[_0x6b15('0x6')](_0x6b15('0x7'),_0x21d657);if(_0x4d27cd){logger['info']('Exec\x20gs',_0x6b15('0x8'),util[_0x6b15('0x9')](_0x4d27cd,{'showHidden':![],'depth':null}),_0x21d657,_0x2a9636);_0x1b7b58(_0x4d27cd);}_0xd91d6e(_0x21d657);});});}; \ No newline at end of file +var _0x504d=['Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger','fax','bluebird','child_process','exec','execute','info'];(function(_0x270d0c,_0x3b7e3a){var _0x620238=function(_0xba7526){while(--_0xba7526){_0x270d0c['push'](_0x270d0c['shift']());}};_0x620238(++_0x3b7e3a);}(_0x504d,0xc9));var _0xd504=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0x504d[_0x75f869];return _0x10af8b;};'use strict';var util=require(_0xd504('0x0'));var logger=require(_0xd504('0x1'))(_0xd504('0x2'));var BPromise=require(_0xd504('0x3'));var exec=require(_0xd504('0x4'))[_0xd504('0x5')];exports[_0xd504('0x6')]=function(_0x367963){return new BPromise(function(_0x58a65f,_0x3de0a8){exec(_0x367963,function(_0x11c989,_0x1f006f,_0x5c89b7){logger[_0xd504('0x7')](_0xd504('0x8'),_0x1f006f);if(_0x11c989){logger[_0xd504('0x7')](_0xd504('0x8'),_0xd504('0x9'),util[_0xd504('0xa')](_0x11c989,{'showHidden':![],'depth':null}),_0x1f006f,_0x5c89b7);_0x3de0a8(_0x11c989);}_0x58a65f(_0x1f006f);});});}; \ 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 7837caa..9228f6f 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 _0x2b41=['../../../../config/logger','fax','message','info','inspect','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','gateway','t38timeout','localstationid','path','variablesAction','uniqueid','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','util','lodash','moment'];(function(_0x128f49,_0x1f417b){var _0xfb7600=function(_0x43ba2f){while(--_0x43ba2f){_0x128f49['push'](_0x128f49['shift']());}};_0xfb7600(++_0x1f417b);}(_0x2b41,0x1b7));var _0x12b4=function(_0x476f2f,_0x30dc16){_0x476f2f=_0x476f2f-0x0;var _0x213a4d=_0x2b41[_0x476f2f];return _0x213a4d;};'use strict';var util=require(_0x12b4('0x0'));var _=require(_0x12b4('0x1'));var moment=require(_0x12b4('0x2'));var logger=require(_0x12b4('0x3'))(_0x12b4('0x4'));exports[_0x12b4('0x5')]=function(_0x40f53f){return{'message':_0x40f53f};};exports['logger']=function(_0x528343,_0x39b86c){logger[_0x12b4('0x6')](_0x528343,util[_0x12b4('0x7')](_0x39b86c,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x31e8c1,_0x5ec860){var _0x41985d={'XMF-ECM':_0x5ec860[_0x12b4('0x8')],'XMF-HEADERINFO':_0x5ec860[_0x12b4('0x9')],'XMF-MINRATE':_0x5ec860[_0x12b4('0xa')],'XMF-MAXRATE':_0x5ec860[_0x12b4('0xb')],'XMF-MODEM':util[_0x12b4('0xc')](_0x12b4('0xd'),_0x5ec860[_0x12b4('0xe')]),'XMF-GATEWAY':_0x5ec860[_0x12b4('0xf')],'XMF-FAXDETECT':_0x5ec860['faxdetect'],'XMF-T38TIMEOUT':_0x5ec860[_0x12b4('0x10')],'XMF-LOCALSTATIONID':_0x5ec860[_0x12b4('0x11')],'XMF-PATH':_0x31e8c1[_0x12b4('0x12')]};return _0x41985d;};exports[_0x12b4('0x13')]=function(_0x4ad412,_0x2d3731){return{'actionid':_0x4ad412[_0x12b4('0x14')],'action':_0x12b4('0x15'),'channel':_0x4ad412[_0x12b4('0x16')],'Exten':_0x12b4('0x17'),'Context':_0x12b4('0x18'),'Priority':'1','callerid':util['format'](_0x12b4('0x19'),_0x4ad412[_0x12b4('0x9')]?_0x4ad412[_0x12b4('0x9')]:'',_0x4ad412['localstationid']),'variable':_0x2d3731,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x4ad412[_0x12b4('0x14')]};}; \ No newline at end of file +var _0xdc84=['info','inspect','addVariables','ecm','headerinfo','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','path','uniqueid','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','util','lodash','moment','../../../../config/logger','fax','logger'];(function(_0xb59853,_0x33378b){var _0x1b4954=function(_0x5f23b1){while(--_0x5f23b1){_0xb59853['push'](_0xb59853['shift']());}};_0x1b4954(++_0x33378b);}(_0xdc84,0x1d5));var _0x4dc8=function(_0x1ac6ec,_0x1f81fc){_0x1ac6ec=_0x1ac6ec-0x0;var _0x48a489=_0xdc84[_0x1ac6ec];return _0x48a489;};'use strict';var util=require(_0x4dc8('0x0'));var _=require(_0x4dc8('0x1'));var moment=require(_0x4dc8('0x2'));var logger=require(_0x4dc8('0x3'))(_0x4dc8('0x4'));exports['message']=function(_0xc9c36a){return{'message':_0xc9c36a};};exports[_0x4dc8('0x5')]=function(_0x3ee948,_0x1a8b94){logger[_0x4dc8('0x6')](_0x3ee948,util[_0x4dc8('0x7')](_0x1a8b94,{'showHidden':![],'depth':null}));};exports[_0x4dc8('0x8')]=function(_0x50a7ae,_0x146438){var _0x37461b={'XMF-ECM':_0x146438[_0x4dc8('0x9')],'XMF-HEADERINFO':_0x146438[_0x4dc8('0xa')],'XMF-MINRATE':_0x146438['minrate'],'XMF-MAXRATE':_0x146438['maxrate'],'XMF-MODEM':util[_0x4dc8('0xb')](_0x4dc8('0xc'),_0x146438[_0x4dc8('0xd')]),'XMF-GATEWAY':_0x146438[_0x4dc8('0xe')],'XMF-FAXDETECT':_0x146438[_0x4dc8('0xf')],'XMF-T38TIMEOUT':_0x146438[_0x4dc8('0x10')],'XMF-LOCALSTATIONID':_0x146438[_0x4dc8('0x11')],'XMF-PATH':_0x50a7ae[_0x4dc8('0x12')]};return _0x37461b;};exports['variablesAction']=function(_0x2d7dad,_0x1c2f1e){return{'actionid':_0x2d7dad[_0x4dc8('0x13')],'action':_0x4dc8('0x14'),'channel':_0x2d7dad[_0x4dc8('0x15')],'Exten':_0x4dc8('0x16'),'Context':_0x4dc8('0x17'),'Priority':'1','callerid':util[_0x4dc8('0xb')](_0x4dc8('0x18'),_0x2d7dad[_0x4dc8('0xa')]?_0x2d7dad[_0x4dc8('0xa')]:'',_0x2d7dad[_0x4dc8('0x11')]),'variable':_0x1c2f1e,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x2d7dad[_0x4dc8('0x13')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 6a69778..269e3f5 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 _0x544c=['util','moment','./server','./realtime','./acw','./trigger','./preview','./fax','./rpc/user','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','hour','resolve','getAgents','then','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','getFreshsalesAccounts','initFreshsalesAccounts','initServicenowAccounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','[index.js][initParams]','inspect','sync','error','[index.js][main]'];(function(_0x5845f3,_0x163e25){var _0x29e546=function(_0x3e90a1){while(--_0x3e90a1){_0x5845f3['push'](_0x5845f3['shift']());}};_0x29e546(++_0x163e25);}(_0x544c,0xd8));var _0xc544=function(_0x4126dc,_0x1430f8){_0x4126dc=_0x4126dc-0x0;var _0xef998b=_0x544c[_0x4126dc];return _0xef998b;};'use strict';var util=require(_0xc544('0x0'));var moment=require(_0xc544('0x1'));var server=require(_0xc544('0x2'));var Realtime=require(_0xc544('0x3'));var Report=require('./report');var Acw=require(_0xc544('0x4'));var Trigger=require(_0xc544('0x5'));var Dialer=require('./dialer');var Preview=require(_0xc544('0x6'));var Fax=require(_0xc544('0x7'));var user=require(_0xc544('0x8'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0xc544('0x9'));var voiceCallReport=require(_0xc544('0xa'));var trunk=require(_0xc544('0xb'));var trigger=require(_0xc544('0xc'));var template=require(_0xc544('0xd'));var cmHopperHistory=require(_0xc544('0xe'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0xc544('0xf'));var faxAccount=require(_0xc544('0x10'));var zendesk=require(_0xc544('0x11'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0xc544('0x12'));var freshdesk=require(_0xc544('0x13'));var desk=require(_0xc544('0x14'));var zoho=require(_0xc544('0x15'));var vtiger=require(_0xc544('0x16'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0xc544('0x17'));var dynamics365=require(_0xc544('0x18'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0xc544('0x19'))('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0xc544('0x1a'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0xc544('0x1a'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0xc544('0x1b')]()['then'](user[_0xc544('0x1c')]())[_0xc544('0x1d')](realtime[_0xc544('0x1e')]())[_0xc544('0x1d')](user[_0xc544('0x1f')]())[_0xc544('0x1d')](realtime[_0xc544('0x20')]())['then'](trunk[_0xc544('0x21')]())[_0xc544('0x1d')](realtime[_0xc544('0x22')]())[_0xc544('0x1d')](voiceQueue[_0xc544('0x23')]())[_0xc544('0x1d')](realtime[_0xc544('0x24')]())[_0xc544('0x1d')](trigger[_0xc544('0x25')]())[_0xc544('0x1d')](realtime['initTriggers']())[_0xc544('0x1d')](template[_0xc544('0x26')]())['then'](realtime[_0xc544('0x27')]())[_0xc544('0x1d')](zendesk[_0xc544('0x28')]())[_0xc544('0x1d')](realtime[_0xc544('0x29')]())[_0xc544('0x1d')](salesforce[_0xc544('0x2a')]())[_0xc544('0x1d')](realtime['initSalesforceAccounts']())[_0xc544('0x1d')](sugarcrm['getSugarcrmAccounts']())[_0xc544('0x1d')](realtime[_0xc544('0x2b')]())[_0xc544('0x1d')](freshdesk[_0xc544('0x2c')]())[_0xc544('0x1d')](realtime['initFreshdeskAccounts']())['then'](desk[_0xc544('0x2d')]())[_0xc544('0x1d')](realtime[_0xc544('0x2e')]())[_0xc544('0x1d')](zoho[_0xc544('0x2f')]())['then'](realtime['initZohoAccounts']())[_0xc544('0x1d')](vtiger['getVtigerAccounts']())[_0xc544('0x1d')](realtime['initVtigerAccounts']())[_0xc544('0x1d')](freshsales[_0xc544('0x30')]())[_0xc544('0x1d')](realtime[_0xc544('0x31')]())[_0xc544('0x1d')](servicenow['getServicenowAccounts']())[_0xc544('0x1d')](realtime[_0xc544('0x32')]())['then'](dynamics365['getDynamics365Accounts']())[_0xc544('0x1d')](realtime[_0xc544('0x33')]())[_0xc544('0x1d')](campaign[_0xc544('0x34')]())['then'](realtime[_0xc544('0x35')]())[_0xc544('0x1d')](voiceExtension[_0xc544('0x36')]())[_0xc544('0x1d')](realtime[_0xc544('0x37')]())[_0xc544('0x1d')](faxAccount[_0xc544('0x38')]())[_0xc544('0x1d')](realtime[_0xc544('0x39')]())['then'](function(){return realtime;});}function initParams(){return Promise[_0xc544('0x1b')]()[_0xc544('0x1d')](voiceQueueReport[_0xc544('0x3a')]())[_0xc544('0x1d')](realtime[_0xc544('0x3b')]())[_0xc544('0x1d')](cmHopperHistory[_0xc544('0x3c')]())[_0xc544('0x1d')](realtime[_0xc544('0x3d')]())['then'](cmHopperHistory[_0xc544('0x3e')]())['then'](realtime[_0xc544('0x3f')]())[_0xc544('0x1d')](voiceCallReport[_0xc544('0x40')]())[_0xc544('0x1d')](realtime[_0xc544('0x41')]())[_0xc544('0x42')](function(_0x10f4ce){logger['error'](_0xc544('0x43'),util[_0xc544('0x44')](_0x10f4ce,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)[_0xc544('0x1d')](function(){return initRealtime();})[_0xc544('0x1d')](function(){return initParams();})[_0xc544('0x1d')](function(){report[_0xc544('0x45')]();setInterval(initRealtime,0x1388);})[_0xc544('0x42')](function(_0x136c15){logger[_0xc544('0x46')](_0xc544('0x47'),util[_0xc544('0x44')](_0x136c15,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0xb71a=['initVoiceExtensions','getFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','[index.js][initParams]','inspect','listen','sync','[index.js][main]','util','moment','./server','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','ami','get','resolve','then','getAgents','initAgents','getTelephones','initTrunks','getVoiceQueues','initVoiceQueues','initTriggers','getTemplates','initTemplates','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initDynamics365Accounts','getCampaigns','initCampaigns'];(function(_0x2aecb2,_0x343312){var _0x3ebb80=function(_0x19fab3){while(--_0x19fab3){_0x2aecb2['push'](_0x2aecb2['shift']());}};_0x3ebb80(++_0x343312);}(_0xb71a,0x16b));var _0xab71=function(_0x12ddb2,_0x5ad61e){_0x12ddb2=_0x12ddb2-0x0;var _0x10b6dd=_0xb71a[_0x12ddb2];return _0x10b6dd;};'use strict';var util=require(_0xab71('0x0'));var moment=require(_0xab71('0x1'));var server=require(_0xab71('0x2'));var Realtime=require('./realtime');var Report=require(_0xab71('0x3'));var Acw=require(_0xab71('0x4'));var Trigger=require(_0xab71('0x5'));var Dialer=require(_0xab71('0x6'));var Preview=require(_0xab71('0x7'));var Fax=require(_0xab71('0x8'));var user=require(_0xab71('0x9'));var voiceQueue=require(_0xab71('0xa'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0xab71('0xb'));var trunk=require(_0xab71('0xc'));var trigger=require(_0xab71('0xd'));var template=require(_0xab71('0xe'));var cmHopperHistory=require(_0xab71('0xf'));var campaign=require(_0xab71('0x10'));var voiceExtension=require(_0xab71('0x11'));var faxAccount=require(_0xab71('0x12'));var zendesk=require(_0xab71('0x13'));var salesforce=require(_0xab71('0x14'));var sugarcrm=require(_0xab71('0x15'));var freshdesk=require(_0xab71('0x16'));var desk=require(_0xab71('0x17'));var zoho=require(_0xab71('0x18'));var vtiger=require(_0xab71('0x19'));var freshsales=require(_0xab71('0x1a'));var servicenow=require(_0xab71('0x1b'));var dynamics365=require(_0xab71('0x1c'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require('../../config/logger')(_0xab71('0x1d'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xab71('0x1e')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get']('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0xab71('0x1f')]()[_0xab71('0x20')](user[_0xab71('0x21')]())[_0xab71('0x20')](realtime[_0xab71('0x22')]())[_0xab71('0x20')](user[_0xab71('0x23')]())[_0xab71('0x20')](realtime['initTelephones']())[_0xab71('0x20')](trunk['getTrunks']())[_0xab71('0x20')](realtime[_0xab71('0x24')]())[_0xab71('0x20')](voiceQueue[_0xab71('0x25')]())[_0xab71('0x20')](realtime[_0xab71('0x26')]())[_0xab71('0x20')](trigger['getTriggers']())[_0xab71('0x20')](realtime[_0xab71('0x27')]())[_0xab71('0x20')](template[_0xab71('0x28')]())[_0xab71('0x20')](realtime[_0xab71('0x29')]())[_0xab71('0x20')](zendesk['getZendeskAccounts']())[_0xab71('0x20')](realtime[_0xab71('0x2a')]())[_0xab71('0x20')](salesforce[_0xab71('0x2b')]())[_0xab71('0x20')](realtime[_0xab71('0x2c')]())['then'](sugarcrm['getSugarcrmAccounts']())[_0xab71('0x20')](realtime['initSugarcrmAccounts']())['then'](freshdesk[_0xab71('0x2d')]())['then'](realtime[_0xab71('0x2e')]())[_0xab71('0x20')](desk[_0xab71('0x2f')]())[_0xab71('0x20')](realtime['initDeskAccounts']())[_0xab71('0x20')](zoho[_0xab71('0x30')]())[_0xab71('0x20')](realtime[_0xab71('0x31')]())[_0xab71('0x20')](vtiger[_0xab71('0x32')]())['then'](realtime['initVtigerAccounts']())[_0xab71('0x20')](freshsales[_0xab71('0x33')]())[_0xab71('0x20')](realtime[_0xab71('0x34')]())[_0xab71('0x20')](servicenow[_0xab71('0x35')]())[_0xab71('0x20')](realtime['initServicenowAccounts']())[_0xab71('0x20')](dynamics365['getDynamics365Accounts']())[_0xab71('0x20')](realtime[_0xab71('0x36')]())[_0xab71('0x20')](campaign[_0xab71('0x37')]())[_0xab71('0x20')](realtime[_0xab71('0x38')]())[_0xab71('0x20')](voiceExtension['getVoiceExtensions']())['then'](realtime[_0xab71('0x39')]())[_0xab71('0x20')](faxAccount[_0xab71('0x3a')]())[_0xab71('0x20')](realtime['initFaxAccounts']())[_0xab71('0x20')](function(){return realtime;});}function initParams(){return Promise[_0xab71('0x1f')]()['then'](voiceQueueReport[_0xab71('0x3b')]())[_0xab71('0x20')](realtime[_0xab71('0x3c')]())[_0xab71('0x20')](cmHopperHistory[_0xab71('0x3d')]())['then'](realtime['initVoiceQueueHopperHistory']())[_0xab71('0x20')](cmHopperHistory['getCampaignHopperHistory']())[_0xab71('0x20')](realtime[_0xab71('0x3e')]())[_0xab71('0x20')](voiceCallReport['getVoiceCallReports']())[_0xab71('0x20')](realtime[_0xab71('0x3f')]())[_0xab71('0x40')](function(_0x159813){logger['error'](_0xab71('0x41'),util[_0xab71('0x42')](_0x159813,{'showHidden':![],'depth':null}));});}function main(){return server[_0xab71('0x43')](realtime,preview,fax)[_0xab71('0x20')](function(){return initRealtime();})[_0xab71('0x20')](function(){return initParams();})['then'](function(){report[_0xab71('0x44')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x3e3b39){logger['error'](_0xab71('0x45'),util[_0xab71('0x42')](_0x3e3b39,{'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 d2bcd99..83cd409 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 _0xb33c=['not_inuse','inuse','talking','toNumber','format','fullname','status','stringify','emit','user:ami:update','omit','user:presence','exports','lodash','util','moment','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','email','accountcode','state','stateTime','address','phone','mobile','interface','online','voiceStatus','unknown','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','prototype','updateStatusRealtime'];(function(_0x3d594b,_0x3ae484){var _0x5911b9=function(_0x20b640){while(--_0x20b640){_0x3d594b['push'](_0x3d594b['shift']());}};_0x5911b9(++_0x3ae484);}(_0xb33c,0x12c));var _0xcb33=function(_0x5f5c12,_0x4cfc13){_0x5f5c12=_0x5f5c12-0x0;var _0x5573ec=_0xb33c[_0x5f5c12];return _0x5573ec;};'use strict';var _=require(_0xcb33('0x0'));var util=require(_0xcb33('0x1'));var moment=require(_0xcb33('0x2'));var md5=require(_0xcb33('0x3'));var Redis=require(_0xcb33('0x4'));var config=require(_0xcb33('0x5'));config[_0xcb33('0x6')]=_['defaults'](config[_0xcb33('0x6')],{'host':_0xcb33('0x7'),'port':0x18eb});var io=require(_0xcb33('0x8'))(new Redis(config[_0xcb33('0x6')]));function Agent(_0x253f6a){this['id']=_0x253f6a['id']||0x0;this[_0xcb33('0x9')]=_0x253f6a[_0xcb33('0x9')]||'';this[_0xcb33('0xa')]=_0x253f6a['email']||'';this[_0xcb33('0xb')]=_0x253f6a[_0xcb33('0xb')]||'';this['fullname']=_0x253f6a['fullname']||'';this[_0xcb33('0xc')]='unknown';this[_0xcb33('0xd')]=0x0;this['status']='unknown';this[_0xcb33('0xe')]='';this[_0xcb33('0xf')]='';this[_0xcb33('0x10')]='';this[_0xcb33('0x11')]='';this[_0xcb33('0x12')]=_0x253f6a[_0xcb33('0x12')]||![];this[_0xcb33('0x13')]=_0xcb33('0x14');this[_0xcb33('0x15')]=0x0;this[_0xcb33('0x16')]='';this[_0xcb33('0x17')]='';this[_0xcb33('0x18')]=![];this[_0xcb33('0x19')]=![];this['md5']='';}Agent[_0xcb33('0x1a')][_0xcb33('0x1b')]=function(_0x318e46){var _0x1047a5;if(_0x318e46&&_0x318e46[_0xcb33('0xc')]){_0x1047a5=_0x318e46['state']['toLowerCase']();switch(_0x1047a5){case _0xcb33('0x1c'):_0x1047a5='idle';break;case _0xcb33('0x1d'):_0x1047a5=_0xcb33('0x1e');break;}}if(_0x1047a5&&this['voiceStatus']!==_0x1047a5||_0x318e46['statePause']){this[_0xcb33('0x15')]=_[_0xcb33('0x1f')](moment()[_0xcb33('0x20')]('x'));}if(_0x1047a5){this['voiceStatus']=_0x1047a5;}var _0x408374={'id':this['id'],'name':this['name'],'email':this[_0xcb33('0xa')],'accountcode':this['accountcode'],'fullname':this[_0xcb33('0x21')],'state':this[_0xcb33('0xc')],'stateTime':this[_0xcb33('0xd')],'status':this[_0xcb33('0x22')],'address':this[_0xcb33('0xe')],'online':this[_0xcb33('0x12')],'voiceStatus':this[_0xcb33('0x13')],'voiceStatusTime':this[_0xcb33('0x15')],'voiceStatusCallerIdNumber':this[_0xcb33('0x16')],'voiceStatusQueue':this[_0xcb33('0x17')],'interface':this[_0xcb33('0x11')],'onhold':this[_0xcb33('0x18')]};var _0x72eb06=md5(JSON[_0xcb33('0x23')](_0x408374));if(this[_0xcb33('0x3')]!==_0x72eb06){this[_0xcb33('0x3')]=_0x72eb06;io['to'](util[_0xcb33('0x20')]('user:%s',_0x408374['name']))[_0xcb33('0x24')](_0xcb33('0x25'),_[_0xcb33('0x26')](_0x408374,['online']));io['emit'](_0xcb33('0x27'),_0x408374);}};module[_0xcb33('0x28')]=Agent; \ No newline at end of file +var _0x0c22=['name','fullname','state','stateTime','status','unknown','phone','interface','online','voiceStatus','onhold','local','prototype','toLowerCase','not_inuse','idle','talking','statePause','voiceStatusTime','accountcode','voiceStatusCallerIdNumber','voiceStatusQueue','stringify','format','user:%s','emit','user:ami:update','omit','exports','lodash','util','md5','../../../config/environment','redis','defaults'];(function(_0xafe951,_0x366ebd){var _0x3f287b=function(_0x77b99a){while(--_0x77b99a){_0xafe951['push'](_0xafe951['shift']());}};_0x3f287b(++_0x366ebd);}(_0x0c22,0x17b));var _0x20c2=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x0c22[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x20c2('0x0'));var util=require(_0x20c2('0x1'));var moment=require('moment');var md5=require(_0x20c2('0x2'));var Redis=require('ioredis');var config=require(_0x20c2('0x3'));config[_0x20c2('0x4')]=_[_0x20c2('0x5')](config[_0x20c2('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function Agent(_0xcd1232){this['id']=_0xcd1232['id']||0x0;this[_0x20c2('0x6')]=_0xcd1232[_0x20c2('0x6')]||'';this['email']=_0xcd1232['email']||'';this['accountcode']=_0xcd1232['accountcode']||'';this['fullname']=_0xcd1232[_0x20c2('0x7')]||'';this[_0x20c2('0x8')]='unknown';this[_0x20c2('0x9')]=0x0;this[_0x20c2('0xa')]=_0x20c2('0xb');this['address']='';this[_0x20c2('0xc')]='';this['mobile']='';this[_0x20c2('0xd')]='';this[_0x20c2('0xe')]=_0xcd1232['online']||![];this[_0x20c2('0xf')]='unknown';this['voiceStatusTime']=0x0;this['voiceStatusCallerIdNumber']='';this['voiceStatusQueue']='';this[_0x20c2('0x10')]=![];this[_0x20c2('0x11')]=![];this[_0x20c2('0x2')]='';}Agent[_0x20c2('0x12')]['updateStatusRealtime']=function(_0x3bdfcb){var _0x27bb48;if(_0x3bdfcb&&_0x3bdfcb[_0x20c2('0x8')]){_0x27bb48=_0x3bdfcb[_0x20c2('0x8')][_0x20c2('0x13')]();switch(_0x27bb48){case _0x20c2('0x14'):_0x27bb48=_0x20c2('0x15');break;case'inuse':_0x27bb48=_0x20c2('0x16');break;}}if(_0x27bb48&&this[_0x20c2('0xf')]!==_0x27bb48||_0x3bdfcb[_0x20c2('0x17')]){this[_0x20c2('0x18')]=_['toNumber'](moment()['format']('x'));}if(_0x27bb48){this[_0x20c2('0xf')]=_0x27bb48;}var _0x47ece0={'id':this['id'],'name':this[_0x20c2('0x6')],'email':this['email'],'accountcode':this[_0x20c2('0x19')],'fullname':this['fullname'],'state':this[_0x20c2('0x8')],'stateTime':this[_0x20c2('0x9')],'status':this['status'],'address':this['address'],'online':this['online'],'voiceStatus':this[_0x20c2('0xf')],'voiceStatusTime':this[_0x20c2('0x18')],'voiceStatusCallerIdNumber':this[_0x20c2('0x1a')],'voiceStatusQueue':this[_0x20c2('0x1b')],'interface':this[_0x20c2('0xd')],'onhold':this[_0x20c2('0x10')]};var _0x40f178=md5(JSON[_0x20c2('0x1c')](_0x47ece0));if(this[_0x20c2('0x2')]!==_0x40f178){this['md5']=_0x40f178;io['to'](util[_0x20c2('0x1d')](_0x20c2('0x1e'),_0x47ece0[_0x20c2('0x6')]))[_0x20c2('0x1f')](_0x20c2('0x20'),_[_0x20c2('0x21')](_0x47ece0,[_0x20c2('0xe')]));io[_0x20c2('0x1f')]('user:presence',_0x47ece0);}};module[_0x20c2('0x22')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index aed53c4..3584ff3 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 _0x6f21=['SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','originated','temp','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialCutDigit','TrunkBackup','Trunk','Interval'];(function(_0x18bf1d,_0x10a82d){var _0xe6eafa=function(_0x31fe29){while(--_0x31fe29){_0x18bf1d['push'](_0x18bf1d['shift']());}};_0xe6eafa(++_0x10a82d);}(_0x6f21,0x66));var _0x16f2=function(_0x456b86,_0x42ca24){_0x456b86=_0x456b86-0x0;var _0x2cd607=_0x6f21[_0x456b86];return _0x2cd607;};'use strict';function Campaign(_0x5e1f9a){this['id']=_0x5e1f9a['id']||0x0;this[_0x16f2('0x0')]=_0x5e1f9a[_0x16f2('0x0')]||'';this['type']=_0x5e1f9a[_0x16f2('0x1')]||_0x16f2('0x2');this[_0x16f2('0x3')]=0x0;this[_0x16f2('0x4')]=0x0;this['ivrAnswerCallsDay']=0x0;this[_0x16f2('0x5')]=0x0;this[_0x16f2('0x6')]='';this[_0x16f2('0x7')]=!![];this[_0x16f2('0x8')]=_0x5e1f9a[_0x16f2('0x8')];this[_0x16f2('0x9')]=_0x5e1f9a[_0x16f2('0x9')];this[_0x16f2('0xa')]=_0x5e1f9a[_0x16f2('0xa')]||null;this['dialGlobalInterval']=_0x5e1f9a[_0x16f2('0xb')]?_0x5e1f9a['dialGlobalInterval']:null;this[_0x16f2('0xc')]=_0x5e1f9a[_0x16f2('0xc')];this[_0x16f2('0xd')]=_0x5e1f9a[_0x16f2('0xd')];this[_0x16f2('0xe')]=_0x5e1f9a[_0x16f2('0xe')]||0x1e;this[_0x16f2('0xf')]=_0x5e1f9a[_0x16f2('0xf')];this[_0x16f2('0x10')]=_0x5e1f9a[_0x16f2('0x10')];this[_0x16f2('0x11')]=_0x5e1f9a['dialBusyMaxRetry'];this['dialBusyRetryFrequency']=_0x5e1f9a[_0x16f2('0x12')];this['dialNoAnswerMaxRetry']=_0x5e1f9a[_0x16f2('0x13')];this[_0x16f2('0x14')]=_0x5e1f9a['dialNoAnswerRetryFrequency'];this['dialGlobalMaxRetry']=_0x5e1f9a['dialGlobalMaxRetry'];this[_0x16f2('0x15')]=_0x5e1f9a[_0x16f2('0x15')]||0x3;this[_0x16f2('0x16')]=_0x5e1f9a[_0x16f2('0x16')]||0x96;this[_0x16f2('0x17')]=_0x5e1f9a['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0x5e1f9a[_0x16f2('0x18')]||0x96;this[_0x16f2('0x19')]=_0x5e1f9a['dialAbandonedMaxRetry']||0x3;this[_0x16f2('0x1a')]=_0x5e1f9a['dialAbandonedRetryFrequency']||0x96;this['dialMachineMaxRetry']=_0x5e1f9a['dialMachineMaxRetry']||0x3;this[_0x16f2('0x1b')]=_0x5e1f9a[_0x16f2('0x1b')]||0x96;this[_0x16f2('0x1c')]=_0x5e1f9a[_0x16f2('0x1c')]||0x3;this[_0x16f2('0x1d')]=_0x5e1f9a['dialAgentRejectRetryFrequency']||0x96;this[_0x16f2('0x1e')]=_0x5e1f9a[_0x16f2('0x1e')]||'DESC';this[_0x16f2('0x1f')]=_0x5e1f9a['dialPrefix']||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x5e1f9a['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x16f2('0x20')]=_0x5e1f9a[_0x16f2('0x20')]||undefined;this['TrunkBackup']=_0x5e1f9a['TrunkBackup']?_0x5e1f9a[_0x16f2('0x21')]:undefined;this[_0x16f2('0x22')]=_0x5e1f9a[_0x16f2('0x22')]?_0x5e1f9a[_0x16f2('0x22')]:undefined;this[_0x16f2('0x23')]=_0x5e1f9a[_0x16f2('0x23')]?_0x5e1f9a[_0x16f2('0x23')]:undefined;this['SquareProject']=_0x5e1f9a[_0x16f2('0x24')]?_0x5e1f9a[_0x16f2('0x24')]:undefined;this['dialQueueProject']=_0x5e1f9a[_0x16f2('0x24')]?_0x5e1f9a['SquareProject'][_0x16f2('0x0')]:undefined;this[_0x16f2('0x25')]=_0x5e1f9a[_0x16f2('0x25')]||![];this[_0x16f2('0x26')]=_0x5e1f9a[_0x16f2('0x26')];this[_0x16f2('0x27')]=_0x5e1f9a[_0x16f2('0x27')];this[_0x16f2('0x28')]=_0x5e1f9a[_0x16f2('0x28')];this[_0x16f2('0x29')]=_0x5e1f9a['dialAMDTotalAnalysisTime'];this['dialAMDMinWordLength']=_0x5e1f9a['dialAMDMinWordLength'];this[_0x16f2('0x2a')]=_0x5e1f9a[_0x16f2('0x2a')];this[_0x16f2('0x2b')]=_0x5e1f9a[_0x16f2('0x2b')];this[_0x16f2('0x2c')]=_0x5e1f9a[_0x16f2('0x2c')];this[_0x16f2('0x2d')]=_0x5e1f9a[_0x16f2('0x2d')];}module['exports']=Campaign; \ No newline at end of file +var _0x463b=['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','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry'];(function(_0x53816b,_0x2f9ba3){var _0x7f2259=function(_0x351304){while(--_0x351304){_0x53816b['push'](_0x53816b['shift']());}};_0x7f2259(++_0x2f9ba3);}(_0x463b,0x174));var _0xb463=function(_0x3c0808,_0x5bb24a){_0x3c0808=_0x3c0808-0x0;var _0x7c275d=_0x463b[_0x3c0808];return _0x7c275d;};'use strict';function Campaign(_0xe759cc){this['id']=_0xe759cc['id']||0x0;this['name']=_0xe759cc[_0xb463('0x0')]||'';this[_0xb463('0x1')]=_0xe759cc[_0xb463('0x1')]||_0xb463('0x2');this[_0xb463('0x3')]=0x0;this[_0xb463('0x4')]=0x0;this['ivrAnswerCallsDay']=0x0;this[_0xb463('0x5')]=0x0;this[_0xb463('0x6')]='';this[_0xb463('0x7')]=!![];this['active']=_0xe759cc['active'];this['limitCalls']=_0xe759cc['limitCalls'];this['dialTimezone']=_0xe759cc[_0xb463('0x8')]||null;this[_0xb463('0x9')]=_0xe759cc[_0xb463('0x9')]?_0xe759cc[_0xb463('0x9')]:null;this[_0xb463('0xa')]=_0xe759cc[_0xb463('0xa')];this[_0xb463('0xb')]=_0xe759cc[_0xb463('0xb')];this[_0xb463('0xc')]=_0xe759cc[_0xb463('0xc')]||0x1e;this[_0xb463('0xd')]=_0xe759cc[_0xb463('0xd')];this[_0xb463('0xe')]=_0xe759cc[_0xb463('0xe')];this[_0xb463('0xf')]=_0xe759cc[_0xb463('0xf')];this[_0xb463('0x10')]=_0xe759cc[_0xb463('0x10')];this[_0xb463('0x11')]=_0xe759cc[_0xb463('0x11')];this[_0xb463('0x12')]=_0xe759cc[_0xb463('0x12')];this[_0xb463('0x13')]=_0xe759cc[_0xb463('0x13')];this[_0xb463('0x14')]=_0xe759cc[_0xb463('0x14')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0xe759cc['dialNoSuchNumberRetryFrequency']||0x96;this[_0xb463('0x15')]=_0xe759cc[_0xb463('0x15')]||0x3;this[_0xb463('0x16')]=_0xe759cc[_0xb463('0x16')]||0x96;this['dialAbandonedMaxRetry']=_0xe759cc[_0xb463('0x17')]||0x3;this['dialAbandonedRetryFrequency']=_0xe759cc[_0xb463('0x18')]||0x96;this[_0xb463('0x19')]=_0xe759cc[_0xb463('0x19')]||0x3;this[_0xb463('0x1a')]=_0xe759cc[_0xb463('0x1a')]||0x96;this[_0xb463('0x1b')]=_0xe759cc[_0xb463('0x1b')]||0x3;this[_0xb463('0x1c')]=_0xe759cc[_0xb463('0x1c')]||0x96;this['dialOrderByScheduledAt']=_0xe759cc[_0xb463('0x1d')]||_0xb463('0x1e');this[_0xb463('0x1f')]=_0xe759cc[_0xb463('0x1f')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0xe759cc[_0xb463('0x20')]||undefined;this[_0xb463('0x21')]=_0xe759cc[_0xb463('0x21')]||undefined;this['TrunkBackup']=_0xe759cc[_0xb463('0x22')]?_0xe759cc['TrunkBackup']:undefined;this['Trunk']=_0xe759cc[_0xb463('0x23')]?_0xe759cc['Trunk']:undefined;this[_0xb463('0x24')]=_0xe759cc[_0xb463('0x24')]?_0xe759cc[_0xb463('0x24')]:undefined;this[_0xb463('0x25')]=_0xe759cc['SquareProject']?_0xe759cc[_0xb463('0x25')]:undefined;this[_0xb463('0x26')]=_0xe759cc[_0xb463('0x25')]?_0xe759cc[_0xb463('0x25')]['name']:undefined;this[_0xb463('0x27')]=_0xe759cc[_0xb463('0x27')]||![];this[_0xb463('0x28')]=_0xe759cc[_0xb463('0x28')];this[_0xb463('0x29')]=_0xe759cc['dialAMDGreeting'];this[_0xb463('0x2a')]=_0xe759cc['dialAMDAfterGreetingSilence'];this[_0xb463('0x2b')]=_0xe759cc[_0xb463('0x2b')];this[_0xb463('0x2c')]=_0xe759cc[_0xb463('0x2c')];this[_0xb463('0x2d')]=_0xe759cc[_0xb463('0x2d')];this[_0xb463('0x2e')]=_0xe759cc[_0xb463('0x2e')];this[_0xb463('0x2f')]=_0xe759cc['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0xe759cc[_0xb463('0x30')];}module[_0xb463('0x31')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 7b443c3..3423ee5 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 _0xc177=['mohtime','exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinename','accountcode','context','uniqueid','exten','answered','answertime','unmanaged','abandoned','lastapplication','lastdata','duration','billableseconds','holdtime','type','tag','disposition','monitors','transfercalleridnum','transferconnectedlinenum'];(function(_0x1857d0,_0x6eade0){var _0x3e3c46=function(_0x3915b8){while(--_0x3915b8){_0x1857d0['push'](_0x1857d0['shift']());}};_0x3e3c46(++_0x6eade0);}(_0xc177,0x1b2));var _0x7c17=function(_0x32e9bd,_0x1f2150){_0x32e9bd=_0x32e9bd-0x0;var _0xc7bf7a=_0xc177[_0x32e9bd];return _0xc7bf7a;};'use strict';function Channel(){this[_0x7c17('0x0')]=null;this[_0x7c17('0x1')]='';this[_0x7c17('0x2')]='';this[_0x7c17('0x3')]=0x0;this[_0x7c17('0x4')]='';this['connectedlinenum']=undefined;this[_0x7c17('0x5')]=undefined;this[_0x7c17('0x6')]=0x0;this[_0x7c17('0x7')]='';this[_0x7c17('0x8')]=0x0;this['linkedid']=0x0;this[_0x7c17('0x9')]=0x0;this[_0x7c17('0xa')]=![];this[_0x7c17('0xb')]=null;this['endtime']=null;this[_0x7c17('0xc')]=![];this[_0x7c17('0xd')]=![];this[_0x7c17('0xe')]='';this[_0x7c17('0xf')]='';this[_0x7c17('0x10')]=0x0;this[_0x7c17('0x11')]=0x0;this[_0x7c17('0x12')]=0x0;this[_0x7c17('0x13')]=null;this[_0x7c17('0x14')]=null;this[_0x7c17('0x15')]=null;this['monitor']=![];this['monitorFilename']=null;this['queue']=null;this[_0x7c17('0x16')]=[];this[_0x7c17('0x17')]=undefined;this[_0x7c17('0x18')]=undefined;this['transferType']=undefined;this[_0x7c17('0x19')]=0x0;}module[_0x7c17('0x1a')]=Channel; \ No newline at end of file +var _0x5ec3=['tag','disposition','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','mohtime','starttime','destinationchannel','calleridnum','connectedlinenum','connectedlinename','context','uniqueid','linkedid','exten','answered','answertime','endtime','unmanaged','abandoned','lastdata','duration','billableseconds','holdtime'];(function(_0x259264,_0xfe2f1f){var _0x333ff4=function(_0x366e5c){while(--_0x366e5c){_0x259264['push'](_0x259264['shift']());}};_0x333ff4(++_0xfe2f1f);}(_0x5ec3,0xf2));var _0x35ec=function(_0x347239,_0x1f0fc0){_0x347239=_0x347239-0x0;var _0x4bda66=_0x5ec3[_0x347239];return _0x4bda66;};'use strict';function Channel(){this[_0x35ec('0x0')]=null;this['channel']='';this[_0x35ec('0x1')]='';this[_0x35ec('0x2')]=0x0;this['calleridname']='';this[_0x35ec('0x3')]=undefined;this[_0x35ec('0x4')]=undefined;this['accountcode']=0x0;this[_0x35ec('0x5')]='';this[_0x35ec('0x6')]=0x0;this[_0x35ec('0x7')]=0x0;this[_0x35ec('0x8')]=0x0;this[_0x35ec('0x9')]=![];this[_0x35ec('0xa')]=null;this[_0x35ec('0xb')]=null;this[_0x35ec('0xc')]=![];this[_0x35ec('0xd')]=![];this['lastapplication']='';this[_0x35ec('0xe')]='';this[_0x35ec('0xf')]=0x0;this[_0x35ec('0x10')]=0x0;this[_0x35ec('0x11')]=0x0;this['type']=null;this[_0x35ec('0x12')]=null;this[_0x35ec('0x13')]=null;this['monitor']=![];this[_0x35ec('0x14')]=null;this[_0x35ec('0x15')]=null;this[_0x35ec('0x16')]=[];this[_0x35ec('0x17')]=undefined;this[_0x35ec('0x18')]=undefined;this['transferType']=undefined;this[_0x35ec('0x19')]=0x0;}module['exports']=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 9d64e8d..973e318 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 _0x844d=['name','username','remoteUri','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports'];(function(_0x11df3a,_0x13ca61){var _0x234551=function(_0x988bda){while(--_0x988bda){_0x11df3a['push'](_0x11df3a['shift']());}};_0x234551(++_0x13ca61);}(_0x844d,0x180));var _0xd844=function(_0x12b683,_0x124186){_0x12b683=_0x12b683-0x0;var _0xfb150b=_0x844d[_0x12b683];return _0xfb150b;};'use strict';function DeskAccount(_0x420e20){this['id']=_0x420e20['id']||0x0;this['name']=_0x420e20[_0xd844('0x0')]||'';this[_0xd844('0x1')]=_0x420e20[_0xd844('0x1')]||'';this[_0xd844('0x2')]=_0x420e20[_0xd844('0x2')]||'';this['authType']=_0x420e20['authType']||'';this[_0xd844('0x3')]=_0x420e20[_0xd844('0x3')]||'';this[_0xd844('0x4')]=_0x420e20[_0xd844('0x4')]||'';this[_0xd844('0x5')]=_0x420e20[_0xd844('0x5')]||'';this['token']=_0x420e20[_0xd844('0x6')]||'';this[_0xd844('0x7')]=_0x420e20[_0xd844('0x7')]||'';this[_0xd844('0x8')]=_0x420e20[_0xd844('0x8')]||'';this['serverUrl']=_0x420e20[_0xd844('0x9')]||'';this['Configurations']=_0x420e20[_0xd844('0xa')]||{};}module[_0xd844('0xb')]=DeskAccount; \ No newline at end of file +var _0x7245=['exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations'];(function(_0x2b0b1e,_0x114202){var _0x57ed7a=function(_0x409caa){while(--_0x409caa){_0x2b0b1e['push'](_0x2b0b1e['shift']());}};_0x57ed7a(++_0x114202);}(_0x7245,0x153));var _0x5724=function(_0x2a7127,_0x2beef0){_0x2a7127=_0x2a7127-0x0;var _0x5658d3=_0x7245[_0x2a7127];return _0x5658d3;};'use strict';function DeskAccount(_0x4d76b0){this['id']=_0x4d76b0['id']||0x0;this[_0x5724('0x0')]=_0x4d76b0[_0x5724('0x0')]||'';this[_0x5724('0x1')]=_0x4d76b0[_0x5724('0x1')]||'';this[_0x5724('0x2')]=_0x4d76b0[_0x5724('0x2')]||'';this[_0x5724('0x3')]=_0x4d76b0['authType']||'';this[_0x5724('0x4')]=_0x4d76b0[_0x5724('0x4')]||'';this[_0x5724('0x5')]=_0x4d76b0[_0x5724('0x5')]||'';this['consumerSecret']=_0x4d76b0[_0x5724('0x6')]||'';this[_0x5724('0x7')]=_0x4d76b0[_0x5724('0x7')]||'';this[_0x5724('0x8')]=_0x4d76b0[_0x5724('0x8')]||'';this[_0x5724('0x9')]=_0x4d76b0['type']||'';this[_0x5724('0xa')]=_0x4d76b0[_0x5724('0xa')]||'';this[_0x5724('0xb')]=_0x4d76b0['Configurations']||{};}module[_0x5724('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 4c79cd3..4c92027 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 _0xf61c=['password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name','username'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0xf61c,0x18a));var _0xcf61=function(_0x23bf16,_0x1dfa63){_0x23bf16=_0x23bf16-0x0;var _0x187ce0=_0xf61c[_0x23bf16];return _0x187ce0;};'use strict';function Dynamics365Account(_0x4ba556){this['id']=_0x4ba556['id']||0x0;this['name']=_0x4ba556[_0xcf61('0x0')]||'';this[_0xcf61('0x1')]=_0x4ba556[_0xcf61('0x1')]||'';this[_0xcf61('0x2')]=_0x4ba556[_0xcf61('0x2')]||'';this[_0xcf61('0x3')]=_0x4ba556[_0xcf61('0x3')]||'';this[_0xcf61('0x4')]=_0x4ba556[_0xcf61('0x4')]||'';this[_0xcf61('0x5')]=_0x4ba556['clientId']||'';this[_0xcf61('0x6')]=_0x4ba556['clientSecret']||{};this[_0xcf61('0x7')]=_0x4ba556['serverUrl']||'';this[_0xcf61('0x8')]=_0x4ba556['modernAuthentication']||![];this[_0xcf61('0x9')]=_0x4ba556[_0xcf61('0x9')]||{};this['CloudProvider']=_0x4ba556[_0xcf61('0xa')]||{};}module[_0xcf61('0xb')]=Dynamics365Account; \ No newline at end of file +var _0x44e2=['name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider'];(function(_0x269616,_0x43b8be){var _0x13b25d=function(_0x24b783){while(--_0x24b783){_0x269616['push'](_0x269616['shift']());}};_0x13b25d(++_0x43b8be);}(_0x44e2,0xb0));var _0x244e=function(_0x455b18,_0x414a4e){_0x455b18=_0x455b18-0x0;var _0x367314=_0x44e2[_0x455b18];return _0x367314;};'use strict';function Dynamics365Account(_0x419a65){this['id']=_0x419a65['id']||0x0;this[_0x244e('0x0')]=_0x419a65[_0x244e('0x0')]||'';this[_0x244e('0x1')]=_0x419a65['username']||'';this[_0x244e('0x2')]=_0x419a65[_0x244e('0x2')]||'';this[_0x244e('0x3')]=_0x419a65[_0x244e('0x3')]||'';this[_0x244e('0x4')]=_0x419a65[_0x244e('0x4')]||'';this[_0x244e('0x5')]=_0x419a65[_0x244e('0x5')]||'';this[_0x244e('0x6')]=_0x419a65[_0x244e('0x6')]||{};this[_0x244e('0x7')]=_0x419a65['serverUrl']||'';this[_0x244e('0x8')]=_0x419a65[_0x244e('0x8')]||![];this[_0x244e('0x9')]=_0x419a65[_0x244e('0x9')]||{};this[_0x244e('0xa')]=_0x419a65['CloudProvider']||{};}module['exports']=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 2f29b27..a64dc9c 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 _0x668d=['minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','exports','name','ecm','headerinfo','localstationid'];(function(_0x14c847,_0x48d94e){var _0x2b9138=function(_0x45bb5f){while(--_0x45bb5f){_0x14c847['push'](_0x14c847['shift']());}};_0x2b9138(++_0x48d94e);}(_0x668d,0x14c));var _0xd668=function(_0x2c4ac8,_0x3ed4c5){_0x2c4ac8=_0x2c4ac8-0x0;var _0x4721bb=_0x668d[_0x2c4ac8];return _0x4721bb;};'use strict';function FaxAccount(_0x538a17){this['id']=_0x538a17['id']||0x0;this['name']=_0x538a17[_0xd668('0x0')]||'';this['description']=_0x538a17['description'];this[_0xd668('0x1')]=_0x538a17[_0xd668('0x1')];this[_0xd668('0x2')]=_0x538a17[_0xd668('0x2')];this['localstationid']=_0x538a17[_0xd668('0x3')];this[_0xd668('0x4')]=_0x538a17[_0xd668('0x4')]||0x960;this[_0xd668('0x5')]=_0x538a17[_0xd668('0x5')]||0x3840;this[_0xd668('0x6')]=_0x538a17[_0xd668('0x6')]||_0xd668('0x7');this[_0xd668('0x8')]=_0x538a17[_0xd668('0x8')]||'no';this[_0xd668('0x9')]=_0x538a17[_0xd668('0x9')]||'no';this[_0xd668('0xa')]=_0x538a17['t38timeout']||0x1388;this[_0xd668('0xb')]=_0x538a17[_0xd668('0xb')]||'SIP';this['Trunk']=_0x538a17[_0xd668('0xc')]?_0x538a17[_0xd668('0xc')]:undefined;this[_0xd668('0xd')]=_0x538a17[_0xd668('0xd')];this[_0xd668('0xe')]=_0x538a17[_0xd668('0xe')];}module[_0xd668('0xf')]=FaxAccount; \ No newline at end of file +var _0x4aef=['t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','v17,v27,v29','gateway','faxdetect'];(function(_0x2de9d0,_0x17bfc9){var _0x205b66=function(_0x58899b){while(--_0x58899b){_0x2de9d0['push'](_0x2de9d0['shift']());}};_0x205b66(++_0x17bfc9);}(_0x4aef,0x197));var _0xf4ae=function(_0x34d2a0,_0x6cde4f){_0x34d2a0=_0x34d2a0-0x0;var _0x505c5b=_0x4aef[_0x34d2a0];return _0x505c5b;};'use strict';function FaxAccount(_0x48cb5a){this['id']=_0x48cb5a['id']||0x0;this[_0xf4ae('0x0')]=_0x48cb5a[_0xf4ae('0x0')]||'';this[_0xf4ae('0x1')]=_0x48cb5a['description'];this[_0xf4ae('0x2')]=_0x48cb5a['ecm'];this[_0xf4ae('0x3')]=_0x48cb5a['headerinfo'];this[_0xf4ae('0x4')]=_0x48cb5a[_0xf4ae('0x4')];this[_0xf4ae('0x5')]=_0x48cb5a[_0xf4ae('0x5')]||0x960;this['maxrate']=_0x48cb5a['maxrate']||0x3840;this['modem']=_0x48cb5a['modem']||_0xf4ae('0x6');this[_0xf4ae('0x7')]=_0x48cb5a['gateway']||'no';this[_0xf4ae('0x8')]=_0x48cb5a[_0xf4ae('0x8')]||'no';this[_0xf4ae('0x9')]=_0x48cb5a[_0xf4ae('0x9')]||0x1388;this[_0xf4ae('0xa')]=_0x48cb5a[_0xf4ae('0xa')]||_0xf4ae('0xb');this[_0xf4ae('0xc')]=_0x48cb5a[_0xf4ae('0xc')]?_0x48cb5a[_0xf4ae('0xc')]:undefined;this['ListId']=_0x48cb5a[_0xf4ae('0xd')];this[_0xf4ae('0xe')]=_0x48cb5a[_0xf4ae('0xe')];}module[_0xf4ae('0xf')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index c7ea637..5764907 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 _0xea02=['Configurations','exports','name','username','remoteUri','serverUrl'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xea02,0xaa));var _0x2ea0=function(_0x6e7a6d,_0x591ad5){_0x6e7a6d=_0x6e7a6d-0x0;var _0xb01ef=_0xea02[_0x6e7a6d];return _0xb01ef;};'use strict';function FreshdeskAccount(_0x4b9bad){this['id']=_0x4b9bad['id']||0x0;this[_0x2ea0('0x0')]=_0x4b9bad[_0x2ea0('0x0')]||'';this[_0x2ea0('0x1')]=_0x4b9bad['username']||'';this['apiKey']=_0x4b9bad['token']||'';this['remoteUri']=_0x4b9bad[_0x2ea0('0x2')]||'';this[_0x2ea0('0x3')]=_0x4b9bad[_0x2ea0('0x3')]||'';this[_0x2ea0('0x4')]=_0x4b9bad['Configurations']||{};}module[_0x2ea0('0x5')]=FreshdeskAccount; \ No newline at end of file +var _0x4255=['username','apiKey','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x3f534d,_0xa53214){var _0x32182e=function(_0x33379a){while(--_0x33379a){_0x3f534d['push'](_0x3f534d['shift']());}};_0x32182e(++_0xa53214);}(_0x4255,0x11e));var _0x5425=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x4255[_0x5d2803];return _0xdcad2c;};'use strict';function FreshdeskAccount(_0x5ada60){this['id']=_0x5ada60['id']||0x0;this[_0x5425('0x0')]=_0x5ada60[_0x5425('0x0')]||'';this[_0x5425('0x1')]=_0x5ada60[_0x5425('0x1')]||'';this[_0x5425('0x2')]=_0x5ada60['token']||'';this['remoteUri']=_0x5ada60[_0x5425('0x3')]||'';this['serverUrl']=_0x5ada60[_0x5425('0x4')]||'';this[_0x5425('0x5')]=_0x5ada60['Configurations']||{};}module[_0x5425('0x6')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index b378dd7..d789e1d 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 _0x99fb=['Configurations','exports','name','username','apiKey','token','remoteUri','serverUrl'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x99fb,0x92));var _0xb99f=function(_0x5e59d6,_0xe22a24){_0x5e59d6=_0x5e59d6-0x0;var _0x360447=_0x99fb[_0x5e59d6];return _0x360447;};'use strict';function FreshsalesAccount(_0x534134){this['id']=_0x534134['id']||0x0;this['name']=_0x534134[_0xb99f('0x0')]||'';this[_0xb99f('0x1')]=_0x534134[_0xb99f('0x1')]||'';this[_0xb99f('0x2')]=_0x534134[_0xb99f('0x3')]||'';this['remoteUri']=_0x534134[_0xb99f('0x4')]||'';this[_0xb99f('0x5')]=_0x534134['serverUrl']||'';this[_0xb99f('0x6')]=_0x534134[_0xb99f('0x6')]||{};}module[_0xb99f('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0xd5b2=['token','remoteUri','serverUrl','exports','name','username','apiKey'];(function(_0x535963,_0x326515){var _0x3975f6=function(_0x2e624f){while(--_0x2e624f){_0x535963['push'](_0x535963['shift']());}};_0x3975f6(++_0x326515);}(_0xd5b2,0x10e));var _0x2d5b=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xd5b2[_0x24237f];return _0x48298e;};'use strict';function FreshsalesAccount(_0x3d9fde){this['id']=_0x3d9fde['id']||0x0;this[_0x2d5b('0x0')]=_0x3d9fde[_0x2d5b('0x0')]||'';this['username']=_0x3d9fde[_0x2d5b('0x1')]||'';this[_0x2d5b('0x2')]=_0x3d9fde[_0x2d5b('0x3')]||'';this[_0x2d5b('0x4')]=_0x3d9fde[_0x2d5b('0x4')]||'';this[_0x2d5b('0x5')]=_0x3d9fde['serverUrl']||'';this['Configurations']=_0x3d9fde['Configurations']||{};}module[_0x2d5b('0x6')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 63d649a..66e8d52 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 _0xac03=['variables','uniqueid','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','context','exten','holdtime','lastAssignedTo','motionChannel','voice','routealias','mohtime'];(function(_0x1735f3,_0x56a029){var _0x4c5a16=function(_0x500b11){while(--_0x500b11){_0x1735f3['push'](_0x1735f3['shift']());}};_0x4c5a16(++_0x56a029);}(_0xac03,0x181));var _0x3ac0=function(_0x53165f,_0x2c836f){_0x53165f=_0x53165f-0x0;var _0x24cc7c=_0xac03[_0x53165f];return _0x24cc7c;};'use strict';function QueueReport(){this['type']='inbound';this[_0x3ac0('0x0')]='';this['calleridnum']='';this[_0x3ac0('0x1')]='';this[_0x3ac0('0x2')]='';this[_0x3ac0('0x3')]=null;this[_0x3ac0('0x4')]=null;this[_0x3ac0('0x5')]=0x1;this[_0x3ac0('0x6')]=0x1;this['queuecallerabandon']=![];this['queuecallerabandonAt']=null;this[_0x3ac0('0x7')]=![];this[_0x3ac0('0x8')]=null;this[_0x3ac0('0x9')]=![];this[_0x3ac0('0xa')]=null;this[_0x3ac0('0xb')]=0x1;this[_0x3ac0('0xc')]='';this[_0x3ac0('0xd')]='';this[_0x3ac0('0xe')]='';this['accountcode']='';this[_0x3ac0('0xf')]='';this[_0x3ac0('0x10')]='';this['priority']='';this[_0x3ac0('0x11')]=0x0;this['assigned']=![];this[_0x3ac0('0x12')]='';this[_0x3ac0('0x13')]=_0x3ac0('0x14');this[_0x3ac0('0x15')]=null;this[_0x3ac0('0x16')]=0x0;this[_0x3ac0('0x17')]={};}module['exports']=QueueReport; \ No newline at end of file +var _0x6c6d=['holdtime','assigned','motionChannel','voice','routealias','mohtime','exports','type','inbound','calleridnum','calleridname','queuecallerjoinAt','queuecallerleaveAt','position','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','priority'];(function(_0xbdea63,_0x3a313e){var _0x454901=function(_0x3ce860){while(--_0x3ce860){_0xbdea63['push'](_0xbdea63['shift']());}};_0x454901(++_0x3a313e);}(_0x6c6d,0x89));var _0xd6c6=function(_0x3bf7d0,_0x2f0c82){_0x3bf7d0=_0x3bf7d0-0x0;var _0x9daf20=_0x6c6d[_0x3bf7d0];return _0x9daf20;};'use strict';function QueueReport(){this[_0xd6c6('0x0')]=_0xd6c6('0x1');this['uniqueid']='';this[_0xd6c6('0x2')]='';this[_0xd6c6('0x3')]='';this['queue']='';this[_0xd6c6('0x4')]=null;this[_0xd6c6('0x5')]=null;this[_0xd6c6('0x6')]=0x1;this['count']=0x1;this[_0xd6c6('0x7')]=![];this[_0xd6c6('0x8')]=null;this[_0xd6c6('0x9')]=![];this[_0xd6c6('0xa')]=null;this[_0xd6c6('0xb')]=![];this['queuecallerexitAt']=null;this[_0xd6c6('0xc')]=0x1;this[_0xd6c6('0xd')]='';this[_0xd6c6('0xe')]='';this[_0xd6c6('0xf')]='';this[_0xd6c6('0x10')]='';this[_0xd6c6('0x11')]='';this['exten']='';this[_0xd6c6('0x12')]='';this[_0xd6c6('0x13')]=0x0;this[_0xd6c6('0x14')]=![];this['lastAssignedTo']='';this[_0xd6c6('0x15')]=_0xd6c6('0x16');this[_0xd6c6('0x17')]=null;this[_0xd6c6('0x18')]=0x0;this['variables']={};}module[_0xd6c6('0x19')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index c309c02..fdaf9ab 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 _0x7e98=['Configurations','name','remoteUri','password','clientId','clientSecret','securityToken','type','serverUrl'];(function(_0x35d775,_0x25431e){var _0x59384d=function(_0x1a0c15){while(--_0x1a0c15){_0x35d775['push'](_0x35d775['shift']());}};_0x59384d(++_0x25431e);}(_0x7e98,0x1ba));var _0x87e9=function(_0x1bf901,_0x318eb8){_0x1bf901=_0x1bf901-0x0;var _0x29976c=_0x7e98[_0x1bf901];return _0x29976c;};'use strict';function SalesforceAccount(_0x55590b){this['id']=_0x55590b['id']||0x0;this['name']=_0x55590b[_0x87e9('0x0')]||'';this['username']=_0x55590b['username']||'';this[_0x87e9('0x1')]=_0x55590b['remoteUri']||'';this[_0x87e9('0x2')]=_0x55590b[_0x87e9('0x2')]||'';this[_0x87e9('0x3')]=_0x55590b[_0x87e9('0x3')]||'';this[_0x87e9('0x4')]=_0x55590b[_0x87e9('0x4')]||'';this[_0x87e9('0x5')]=_0x55590b[_0x87e9('0x5')]||'';this[_0x87e9('0x6')]=_0x55590b['type']||'integrationTab';this[_0x87e9('0x7')]=_0x55590b[_0x87e9('0x7')]||'';this[_0x87e9('0x8')]=_0x55590b[_0x87e9('0x8')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file +var _0xd9db=['securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret'];(function(_0x187842,_0x58331c){var _0x5dbcf3=function(_0x55faef){while(--_0x55faef){_0x187842['push'](_0x187842['shift']());}};_0x5dbcf3(++_0x58331c);}(_0xd9db,0x8a));var _0xbd9d=function(_0x3b99d8,_0x26f20b){_0x3b99d8=_0x3b99d8-0x0;var _0x46e759=_0xd9db[_0x3b99d8];return _0x46e759;};'use strict';function SalesforceAccount(_0x286478){this['id']=_0x286478['id']||0x0;this[_0xbd9d('0x0')]=_0x286478['name']||'';this[_0xbd9d('0x1')]=_0x286478[_0xbd9d('0x1')]||'';this[_0xbd9d('0x2')]=_0x286478[_0xbd9d('0x2')]||'';this[_0xbd9d('0x3')]=_0x286478[_0xbd9d('0x3')]||'';this[_0xbd9d('0x4')]=_0x286478[_0xbd9d('0x4')]||'';this[_0xbd9d('0x5')]=_0x286478[_0xbd9d('0x5')]||'';this[_0xbd9d('0x6')]=_0x286478['securityToken']||'';this['type']=_0x286478[_0xbd9d('0x7')]||_0xbd9d('0x8');this[_0xbd9d('0x9')]=_0x286478['serverUrl']||'';this[_0xbd9d('0xa')]=_0x286478[_0xbd9d('0xa')]||{};}module[_0xbd9d('0xb')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 906537b..5da0618 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 _0xf700=['remoteUri','serverUrl','Configurations','name','username','password'];(function(_0x245343,_0x183cdd){var _0x23f296=function(_0x573485){while(--_0x573485){_0x245343['push'](_0x245343['shift']());}};_0x23f296(++_0x183cdd);}(_0xf700,0x10b));var _0x0f70=function(_0x1825ef,_0x205316){_0x1825ef=_0x1825ef-0x0;var _0x11382a=_0xf700[_0x1825ef];return _0x11382a;};'use strict';function ServicenowAccount(_0xcef295){this['id']=_0xcef295['id']||0x0;this['name']=_0xcef295[_0x0f70('0x0')]||'';this[_0x0f70('0x1')]=_0xcef295[_0x0f70('0x1')]||'';this[_0x0f70('0x2')]=_0xcef295[_0x0f70('0x2')]||'';this['remoteUri']=_0xcef295[_0x0f70('0x3')]||'';this['serverUrl']=_0xcef295[_0x0f70('0x4')]||'';this[_0x0f70('0x5')]=_0xcef295[_0x0f70('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file +var _0x3597=['name','username','remoteUri','serverUrl','Configurations','exports'];(function(_0x554b32,_0x577efd){var _0x2d896d=function(_0x2f4a14){while(--_0x2f4a14){_0x554b32['push'](_0x554b32['shift']());}};_0x2d896d(++_0x577efd);}(_0x3597,0x156));var _0x7359=function(_0x1d3530,_0x59ae97){_0x1d3530=_0x1d3530-0x0;var _0x13868c=_0x3597[_0x1d3530];return _0x13868c;};'use strict';function ServicenowAccount(_0x53fffd){this['id']=_0x53fffd['id']||0x0;this['name']=_0x53fffd[_0x7359('0x0')]||'';this[_0x7359('0x1')]=_0x53fffd[_0x7359('0x1')]||'';this['password']=_0x53fffd['password']||'';this[_0x7359('0x2')]=_0x53fffd[_0x7359('0x2')]||'';this['serverUrl']=_0x53fffd[_0x7359('0x3')]||'';this[_0x7359('0x4')]=_0x53fffd['Configurations']||{};}module[_0x7359('0x5')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 13a495b..1c28bed 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 _0x5b8c=['serverUrl','Configurations','name','password','remoteUri'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x5b8c,0x1bf));var _0xc5b8=function(_0x436849,_0x430b00){_0x436849=_0x436849-0x0;var _0x5c5f73=_0x5b8c[_0x436849];return _0x5c5f73;};'use strict';function SugarcrmAccount(_0x2c3043){this['id']=_0x2c3043['id']||0x0;this[_0xc5b8('0x0')]=_0x2c3043['name']||'';this['username']=_0x2c3043['username']||'';this[_0xc5b8('0x1')]=_0x2c3043[_0xc5b8('0x1')]||'';this[_0xc5b8('0x2')]=_0x2c3043[_0xc5b8('0x2')]||'';this['serverUrl']=_0x2c3043[_0xc5b8('0x3')]||'';this[_0xc5b8('0x4')]=_0x2c3043[_0xc5b8('0x4')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file +var _0x36f3=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x1e4a8e,_0x18022b){var _0x5408f9=function(_0x4ef2ed){while(--_0x4ef2ed){_0x1e4a8e['push'](_0x1e4a8e['shift']());}};_0x5408f9(++_0x18022b);}(_0x36f3,0x19c));var _0x336f=function(_0x103bbf,_0x22a36a){_0x103bbf=_0x103bbf-0x0;var _0x25be40=_0x36f3[_0x103bbf];return _0x25be40;};'use strict';function SugarcrmAccount(_0x126b05){this['id']=_0x126b05['id']||0x0;this[_0x336f('0x0')]=_0x126b05[_0x336f('0x0')]||'';this[_0x336f('0x1')]=_0x126b05['username']||'';this[_0x336f('0x2')]=_0x126b05[_0x336f('0x2')]||'';this[_0x336f('0x3')]=_0x126b05[_0x336f('0x3')]||'';this[_0x336f('0x4')]=_0x126b05[_0x336f('0x4')]||'';this[_0x336f('0x5')]=_0x126b05[_0x336f('0x5')]||{};}module[_0x336f('0x6')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 19ce2dc..771701e 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 _0xdac7=['state','unknown','stateTime','status','name'];(function(_0x2a6f5b,_0x494437){var _0x46fdd5=function(_0x7041b7){while(--_0x7041b7){_0x2a6f5b['push'](_0x2a6f5b['shift']());}};_0x46fdd5(++_0x494437);}(_0xdac7,0x180));var _0x7dac=function(_0x58118f,_0x5c9e09){_0x58118f=_0x58118f-0x0;var _0x2618f4=_0xdac7[_0x58118f];return _0x2618f4;};'use strict';function Telephone(_0x3e7e45){this['id']=_0x3e7e45['id']||0x0;this[_0x7dac('0x0')]=_0x3e7e45['name']||'';this['accountcode']=_0x3e7e45['accountcode']||'';this[_0x7dac('0x1')]=_0x7dac('0x2');this[_0x7dac('0x3')]=0x0;this[_0x7dac('0x4')]='unknown';this['address']='';}module['exports']=Telephone; \ No newline at end of file +var _0x2ec8=['state','unknown','stateTime','status','address','exports','name','accountcode'];(function(_0x4b3680,_0x4026b6){var _0x14ec1b=function(_0x58082e){while(--_0x58082e){_0x4b3680['push'](_0x4b3680['shift']());}};_0x14ec1b(++_0x4026b6);}(_0x2ec8,0x6e));var _0x82ec=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x2ec8[_0x5ddb1c];return _0x354adc;};'use strict';function Telephone(_0x34bf81){this['id']=_0x34bf81['id']||0x0;this[_0x82ec('0x0')]=_0x34bf81['name']||'';this['accountcode']=_0x34bf81[_0x82ec('0x1')]||'';this[_0x82ec('0x2')]=_0x82ec('0x3');this[_0x82ec('0x4')]=0x0;this[_0x82ec('0x5')]=_0x82ec('0x3');this[_0x82ec('0x6')]='';}module[_0x82ec('0x7')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 4661805..319218a 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(_0x5531aa,_0x392d76){var _0x46b05d=function(_0x4e1c21){while(--_0x4e1c21){_0x5531aa['push'](_0x5531aa['shift']());}};_0x46b05d(++_0x392d76);}(_0xb10b,0x12a));var _0xbb10=function(_0x42cc58,_0x5a4760){_0x42cc58=_0x42cc58-0x0;var _0x5ca9cb=_0xb10b[_0x42cc58];return _0x5ca9cb;};'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 _0xb10b=['name','html'];(function(_0x11fd53,_0x38cdb7){var _0x35050a=function(_0x37cf24){while(--_0x37cf24){_0x11fd53['push'](_0x11fd53['shift']());}};_0x35050a(++_0x38cdb7);}(_0xb10b,0x12a));var _0xbb10=function(_0x208b7a,_0x2e3baa){_0x208b7a=_0x208b7a-0x0;var _0x37b7ec=_0xb10b[_0x208b7a];return _0x37b7ec;};'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 diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 3c6189d..836def0 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 _0xb7e7=['Actions','exports','name','channel','status','AllConditions','AnyConditions'];(function(_0x41d902,_0x29d0b){var _0x360fb1=function(_0x2517ae){while(--_0x2517ae){_0x41d902['push'](_0x41d902['shift']());}};_0x360fb1(++_0x29d0b);}(_0xb7e7,0x121));var _0x7b7e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xb7e7[_0x19e35c];return _0x3e1fe8;};'use strict';function Trigger(_0x2e5e07){this['id']=_0x2e5e07['id']||0x0;this['name']=_0x2e5e07[_0x7b7e('0x0')]||'';this['channel']=_0x2e5e07[_0x7b7e('0x1')]||'voice';this[_0x7b7e('0x2')]=_0x2e5e07['status']||![];this[_0x7b7e('0x3')]=_0x2e5e07[_0x7b7e('0x3')]||[];this[_0x7b7e('0x4')]=_0x2e5e07['AnyConditions']||[];this['Actions']=_0x2e5e07[_0x7b7e('0x5')]||[];}module[_0x7b7e('0x6')]=Trigger; \ No newline at end of file +var _0xda3f=['Actions','name','status','AllConditions','AnyConditions'];(function(_0x163419,_0x37db68){var _0x1404cf=function(_0x40da17){while(--_0x40da17){_0x163419['push'](_0x163419['shift']());}};_0x1404cf(++_0x37db68);}(_0xda3f,0xec));var _0xfda3=function(_0x3cd400,_0x2a7fc8){_0x3cd400=_0x3cd400-0x0;var _0x5cd65d=_0xda3f[_0x3cd400];return _0x5cd65d;};'use strict';function Trigger(_0x33f0ce){this['id']=_0x33f0ce['id']||0x0;this[_0xfda3('0x0')]=_0x33f0ce[_0xfda3('0x0')]||'';this['channel']=_0x33f0ce['channel']||'voice';this[_0xfda3('0x1')]=_0x33f0ce['status']||![];this[_0xfda3('0x2')]=_0x33f0ce[_0xfda3('0x2')]||[];this['AnyConditions']=_0x33f0ce[_0xfda3('0x3')]||[];this[_0xfda3('0x4')]=_0x33f0ce['Actions']||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index e250c45..7b2e85c 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 _0x980c=['refresh','stateRegistry','registrationtime','address','defaultuser','exports','active','name','state','status','unknown','registry','indexOf','split','host','port','domain','domainport'];(function(_0x2fb9e3,_0x4bb3ab){var _0x631166=function(_0x148fbf){while(--_0x148fbf){_0x2fb9e3['push'](_0x2fb9e3['shift']());}};_0x631166(++_0x4bb3ab);}(_0x980c,0x72));var _0xc980=function(_0x517d25,_0x5b5abb){_0x517d25=_0x517d25-0x0;var _0x437edf=_0x980c[_0x517d25];return _0x437edf;};'use strict';function Trunk(_0x4fbc46){this['id']=_0x4fbc46['id']||0x0;this[_0xc980('0x0')]=_0x4fbc46['active']||![];this[_0xc980('0x1')]=_0x4fbc46[_0xc980('0x1')]||'';this[_0xc980('0x2')]='unknown';this['stateTime']=0x0;this[_0xc980('0x3')]=_0xc980('0x4');this[_0xc980('0x5')]=_0x4fbc46[_0xc980('0x5')]&&_0x4fbc46['registry'][_0xc980('0x6')](':')?_0x4fbc46[_0xc980('0x5')][_0xc980('0x7')](':')[0x0]:'';this[_0xc980('0x8')]='';this[_0xc980('0x9')]='';this[_0xc980('0xa')]='';this[_0xc980('0xb')]='';this[_0xc980('0xc')]='';this[_0xc980('0xd')]='unknown';this[_0xc980('0xe')]='';this[_0xc980('0xf')]='';this[_0xc980('0x10')]=_0x4fbc46[_0xc980('0x10')]||'';}module[_0xc980('0x11')]=Trunk; \ No newline at end of file +var _0x54e7=['refresh','stateRegistry','registrationtime','address','defaultuser','exports','active','name','unknown','stateTime','status','registry','indexOf','split','host','port','domain','domainport'];(function(_0x1cef5c,_0x403f3d){var _0x4c4b5e=function(_0xbb6a79){while(--_0xbb6a79){_0x1cef5c['push'](_0x1cef5c['shift']());}};_0x4c4b5e(++_0x403f3d);}(_0x54e7,0x72));var _0x754e=function(_0x44ea7d,_0xe6516){_0x44ea7d=_0x44ea7d-0x0;var _0x16af83=_0x54e7[_0x44ea7d];return _0x16af83;};'use strict';function Trunk(_0x3253db){this['id']=_0x3253db['id']||0x0;this['active']=_0x3253db[_0x754e('0x0')]||![];this[_0x754e('0x1')]=_0x3253db[_0x754e('0x1')]||'';this['state']=_0x754e('0x2');this[_0x754e('0x3')]=0x0;this[_0x754e('0x4')]=_0x754e('0x2');this[_0x754e('0x5')]=_0x3253db[_0x754e('0x5')]&&_0x3253db[_0x754e('0x5')][_0x754e('0x6')](':')?_0x3253db[_0x754e('0x5')][_0x754e('0x7')](':')[0x0]:'';this[_0x754e('0x8')]='';this[_0x754e('0x9')]='';this[_0x754e('0xa')]='';this[_0x754e('0xb')]='';this[_0x754e('0xc')]='';this[_0x754e('0xd')]=_0x754e('0x2');this[_0x754e('0xe')]='';this[_0x754e('0xf')]='';this[_0x754e('0x10')]=_0x3253db[_0x754e('0x10')]||'';}module[_0x754e('0x11')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 1486845..8f5552f 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 _0x9ec7=['exten','recordingFormat','mandatoryDisposition','exports'];(function(_0x472c5f,_0x1af4f1){var _0x18c381=function(_0x20ac4d){while(--_0x20ac4d){_0x472c5f['push'](_0x472c5f['shift']());}};_0x18c381(++_0x1af4f1);}(_0x9ec7,0x1a8));var _0x79ec=function(_0x26a4ad,_0x22d437){_0x26a4ad=_0x26a4ad-0x0;var _0x41ccff=_0x9ec7[_0x26a4ad];return _0x41ccff;};'use strict';function voiceExtension(_0x417cfa){this['id']=_0x417cfa['id']||0x0;this['exten']=_0x417cfa[_0x79ec('0x0')]||'';this[_0x79ec('0x1')]=_0x417cfa[_0x79ec('0x1')]||'none';this[_0x79ec('0x2')]=_0x417cfa['mandatoryDisposition']||![];}module[_0x79ec('0x3')]=voiceExtension; \ No newline at end of file +var _0x218c=['exports','exten','recordingFormat','none','mandatoryDisposition'];(function(_0x8d6ed2,_0x574627){var _0x1edb62=function(_0x55e22f){while(--_0x55e22f){_0x8d6ed2['push'](_0x8d6ed2['shift']());}};_0x1edb62(++_0x574627);}(_0x218c,0x14b));var _0xc218=function(_0xc144be,_0x385142){_0xc144be=_0xc144be-0x0;var _0x4ffd89=_0x218c[_0xc144be];return _0x4ffd89;};'use strict';function voiceExtension(_0x599b09){this['id']=_0x599b09['id']||0x0;this[_0xc218('0x0')]=_0x599b09[_0xc218('0x0')]||'';this[_0xc218('0x1')]=_0x599b09[_0xc218('0x1')]||_0xc218('0x2');this[_0xc218('0x3')]=_0x599b09[_0xc218('0x3')]||![];}module[_0xc218('0x4')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 8afd30b..eaeda37 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 _0xe767=['predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav49','gsm','fewestcalls','leastrecent','linear','random','rrmemory','wrandom','name','monitor_format','type','inbound','sumHoldTime','sumBillable','unmanaged','busy','invalid','loggedIn','notInUse','paused','ringing','ringInUse','talking','unavailable','unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','message','statusMessage','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','handlePredictive','predictiveIntervalMultiplicativeFactor'];(function(_0x2e33fc,_0x4ceb76){var _0x2a74d4=function(_0x171dc5){while(--_0x171dc5){_0x2e33fc['push'](_0x2e33fc['shift']());}};_0x2a74d4(++_0x4ceb76);}(_0xe767,0x11e));var _0x7e76=function(_0x44fa3a,_0x475fdc){_0x44fa3a=_0x44fa3a-0x0;var _0x431a37=_0xe767[_0x44fa3a];return _0x431a37;};'use strict';var monitorFormat={'wav':'wav','wav49':_0x7e76('0x0'),'gsm':_0x7e76('0x1')};var strategy={'fewestcalls':_0x7e76('0x2'),'leastrecent':_0x7e76('0x3'),'linear':_0x7e76('0x4'),'random':_0x7e76('0x5'),'ringall':'ringall','rr':'roundrobin','rrmemory':_0x7e76('0x6'),'rrordered':'rrordered','wrandom':_0x7e76('0x7')};function VoiceQueue(_0x5d179a){this['id']=_0x5d179a['id']||0x0;this[_0x7e76('0x8')]=_0x5d179a[_0x7e76('0x8')]||'';this[_0x7e76('0x9')]=_0x5d179a[_0x7e76('0x9')]||'';this[_0x7e76('0xa')]=_0x5d179a[_0x7e76('0xa')]||_0x7e76('0xb');this['waiting']=0x0;this['total']=0x0;this['answered']=0x0;this['sumDuration']=0x0;this[_0x7e76('0xc')]=0x0;this[_0x7e76('0xd')]=0x0;this[_0x7e76('0xe')]=0x0;this['abandoned']=0x0;this['available']=0x0;this[_0x7e76('0xf')]=0x0;this['inUse']=0x0;this[_0x7e76('0x10')]=0x0;this[_0x7e76('0x11')]=0x0;this[_0x7e76('0x12')]=0x0;this['onHold']=0x0;this[_0x7e76('0x13')]=0x0;this[_0x7e76('0x14')]=0x0;this[_0x7e76('0x15')]=0x0;this[_0x7e76('0x16')]=0x0;this[_0x7e76('0x17')]=0x0;this[_0x7e76('0x18')]=0x0;this[_0x7e76('0x19')]=_0x5d179a[_0x7e76('0x19')]||![];this[_0x7e76('0x1a')]=_0x5d179a[_0x7e76('0x1a')]||0xa;this['autopause']=_0x5d179a[_0x7e76('0x1b')]||'no';this[_0x7e76('0x1c')]=!![];this[_0x7e76('0x1d')]='';this[_0x7e76('0x1e')]='';this['originated']=0x0;this[_0x7e76('0x1f')]=0x0;this[_0x7e76('0x20')]=_0x5d179a[_0x7e76('0x20')]||null;this['dialGlobalInterval']=_0x5d179a[_0x7e76('0x21')]?_0x5d179a[_0x7e76('0x21')]:null;this[_0x7e76('0x22')]=_0x5d179a['dialActive'];this[_0x7e76('0x23')]=_0x5d179a[_0x7e76('0x23')]||'progressive';this[_0x7e76('0x24')]=_0x5d179a['dialLimitChannel']||0x0;this[_0x7e76('0x25')]=_0x5d179a[_0x7e76('0x25')]||0x0;this[_0x7e76('0x26')]=_0x5d179a[_0x7e76('0x26')]||0x1;this[_0x7e76('0x27')]=_0x5d179a[_0x7e76('0x27')]||'dropRate';this[_0x7e76('0x28')]=_0x5d179a['dialPredictiveOptimizationPercentage']||0.03;this[_0x7e76('0x29')]=_0x5d179a[_0x7e76('0x29')]||0x258;this[_0x7e76('0x2a')]=_0x5d179a['dialOriginateCallerIdName']||_0x7e76('0x2b');this[_0x7e76('0x2c')]=_0x5d179a['dialOriginateCallerIdNumber']||'anonymous';this['dialOriginateTimeout']=_0x5d179a[_0x7e76('0x2d')]||0x1e;this[_0x7e76('0x2e')]=_0x5d179a[_0x7e76('0x2e')]||_0x7e76('0x2f');this[_0x7e76('0x30')]=_0x5d179a['dialQueueTimeout']||0x3;this[_0x7e76('0x31')]=_0x5d179a[_0x7e76('0x31')]||undefined;this[_0x7e76('0x32')]=_0x5d179a[_0x7e76('0x32')]||0x3;this[_0x7e76('0x33')]=_0x5d179a[_0x7e76('0x33')]||0x96;this[_0x7e76('0x34')]=_0x5d179a['dialBusyMaxRetry']||0x3;this[_0x7e76('0x35')]=_0x5d179a['dialBusyRetryFrequency']||0x96;this[_0x7e76('0x36')]=_0x5d179a['dialNoAnswerMaxRetry']||0x3;this['dialNoAnswerRetryFrequency']=_0x5d179a[_0x7e76('0x37')]||0x96;this[_0x7e76('0x38')]=_0x5d179a['dialNoSuchNumberMaxRetry']||0x3;this[_0x7e76('0x39')]=_0x5d179a['dialNoSuchNumberRetryFrequency']||0x96;this['dialDropMaxRetry']=_0x5d179a[_0x7e76('0x3a')]||0x3;this['dialDropRetryFrequency']=_0x5d179a[_0x7e76('0x3b')]||0x96;this[_0x7e76('0x3c')]=_0x5d179a[_0x7e76('0x3c')]||0x3;this[_0x7e76('0x3d')]=_0x5d179a[_0x7e76('0x3d')]||0x96;this['dialMachineMaxRetry']=_0x5d179a['dialMachineMaxRetry']||0x3;this[_0x7e76('0x3e')]=_0x5d179a['dialMachineRetryFrequency']||0x96;this['dialAgentRejectMaxRetry']=_0x5d179a[_0x7e76('0x3f')]||0x3;this[_0x7e76('0x40')]=_0x5d179a['dialAgentRejectRetryFrequency']||0x96;this[_0x7e76('0x41')]=_0x5d179a[_0x7e76('0x41')]||0x3;this[_0x7e76('0x42')]=_0x5d179a[_0x7e76('0x42')]||0x4;this[_0x7e76('0x43')]=_0x5d179a[_0x7e76('0x43')]?_0x5d179a['Trunk']:undefined;this['TrunkBackup']=_0x5d179a[_0x7e76('0x44')]?_0x5d179a[_0x7e76('0x44')]:undefined;this[_0x7e76('0x45')]=_0x5d179a['dialPrefix']||undefined;this[_0x7e76('0x46')]=_0x5d179a[_0x7e76('0x46')]?_0x5d179a[_0x7e76('0x46')]:undefined;this[_0x7e76('0x47')]=_0x5d179a[_0x7e76('0x47')]||_0x7e76('0x48');this[_0x7e76('0x49')]=_0x5d179a['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0x5d179a[_0x7e76('0x4a')]||undefined;this[_0x7e76('0x4b')]=strategy[_0x5d179a[_0x7e76('0x4b')]];this[_0x7e76('0x4c')]=!![];this['dialAMDActive']=_0x5d179a['dialAMDActive']||![];this[_0x7e76('0x4d')]=_0x5d179a[_0x7e76('0x4d')];this[_0x7e76('0x4e')]=_0x5d179a['dialAMDGreeting'];this[_0x7e76('0x4f')]=_0x5d179a[_0x7e76('0x4f')];this[_0x7e76('0x50')]=_0x5d179a[_0x7e76('0x50')];this['dialAMDMinWordLength']=_0x5d179a[_0x7e76('0x51')];this['dialAMDBetweenWordsSilence']=_0x5d179a[_0x7e76('0x52')];this[_0x7e76('0x53')]=_0x5d179a[_0x7e76('0x53')];this[_0x7e76('0x54')]=_0x5d179a[_0x7e76('0x54')];this['dialAMDMaximumWordLength']=_0x5d179a[_0x7e76('0x55')];this[_0x7e76('0x56')]=0x0;this[_0x7e76('0x57')]=0x0;this[_0x7e76('0x58')]=_0x5d179a[_0x7e76('0x58')];this[_0x7e76('0x59')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x7e76('0x5a')]=0x0;this[_0x7e76('0x5b')]=0x0;this[_0x7e76('0x5c')]=0x0;this[_0x7e76('0x5d')]=0x0;this[_0x7e76('0x5e')]=0x0;this[_0x7e76('0x5f')]=0x0;this[_0x7e76('0x60')]=0x0;this[_0x7e76('0x61')]=0x0;this[_0x7e76('0x62')]=0x0;this[_0x7e76('0x63')]=0x0;this[_0x7e76('0x64')]=0x0;this[_0x7e76('0x65')]=undefined;this['startPredictive']=undefined;this[_0x7e76('0x66')]=undefined;this[_0x7e76('0x67')]=1.05;this[_0x7e76('0x68')]=0x0;this[_0x7e76('0x69')]=0x0;this[_0x7e76('0x6a')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0x7e76('0x6b')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0x7e76('0x6c')]=0x0;this[_0x7e76('0x6d')]=0x0;this[_0x7e76('0x6e')]=_0x5d179a[_0x7e76('0x6f')]||0x14;this[_0x7e76('0x70')]=_0x5d179a[_0x7e76('0x6f')]||0xa;this[_0x7e76('0x71')]=0x0;this[_0x7e76('0x72')]=0x0;this[_0x7e76('0x73')]=0x1;this[_0x7e76('0x74')]=0x0;this[_0x7e76('0x75')]=0x0;this[_0x7e76('0x76')]=0x0;this['erlangBusyFactor']=0x0;this[_0x7e76('0x77')]=_0x5d179a[_0x7e76('0x77')]||0x1e;this[_0x7e76('0x78')]=_0x5d179a[_0x7e76('0x78')]||![];this[_0x7e76('0x79')]=!!_0x5d179a['dialPreviewAutoRecallMe']||![];this[_0x7e76('0x7a')]=!!_0x5d179a['dialPreviewRecallmeReminder']||![];this['dialQueueProject2']=_0x5d179a[_0x7e76('0x7b')]||undefined;this[_0x7e76('0x7c')]=_0x5d179a[_0x7e76('0x7c')]||![];this[_0x7e76('0x7d')]=_0x5d179a[_0x7e76('0x7d')]||![];this[_0x7e76('0x9')]=monitorFormat[_0x5d179a[_0x7e76('0x9')]]?monitorFormat[_0x5d179a[_0x7e76('0x9')]]:undefined;this[_0x7e76('0x7e')]=_0x5d179a[_0x7e76('0x7e')]||![];this[_0x7e76('0x7f')]=_0x5d179a[_0x7e76('0x7f')]?_0x5d179a[_0x7e76('0x7f')]:undefined;this[_0x7e76('0x80')]=![];}module[_0x7e76('0x81')]=VoiceQueue; \ No newline at end of file +var _0x7278=['dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','wav','wav49','gsm','fewestcalls','leastrecent','random','ringall','roundrobin','rrmemory','rrordered','wrandom','name','monitor_format','type','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','available','busy','invalid','loggedIn','notInUse','paused','ringing','talking','unavailable','unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','statusMessage','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x7278,0x161));var _0x8727=function(_0xc1eb45,_0x1347fb){_0xc1eb45=_0xc1eb45-0x0;var _0x86926f=_0x7278[_0xc1eb45];return _0x86926f;};'use strict';var monitorFormat={'wav':_0x8727('0x0'),'wav49':_0x8727('0x1'),'gsm':_0x8727('0x2')};var strategy={'fewestcalls':_0x8727('0x3'),'leastrecent':_0x8727('0x4'),'linear':'linear','random':_0x8727('0x5'),'ringall':_0x8727('0x6'),'rr':_0x8727('0x7'),'rrmemory':_0x8727('0x8'),'rrordered':_0x8727('0x9'),'wrandom':_0x8727('0xa')};function VoiceQueue(_0x180b71){this['id']=_0x180b71['id']||0x0;this['name']=_0x180b71[_0x8727('0xb')]||'';this[_0x8727('0xc')]=_0x180b71[_0x8727('0xc')]||'';this[_0x8727('0xd')]=_0x180b71[_0x8727('0xd')]||'inbound';this['waiting']=0x0;this['total']=0x0;this[_0x8727('0xe')]=0x0;this[_0x8727('0xf')]=0x0;this[_0x8727('0x10')]=0x0;this[_0x8727('0x11')]=0x0;this[_0x8727('0x12')]=0x0;this[_0x8727('0x13')]=0x0;this[_0x8727('0x14')]=0x0;this[_0x8727('0x15')]=0x0;this['inUse']=0x0;this[_0x8727('0x16')]=0x0;this[_0x8727('0x17')]=0x0;this[_0x8727('0x18')]=0x0;this['onHold']=0x0;this[_0x8727('0x19')]=0x0;this[_0x8727('0x1a')]=0x0;this['ringInUse']=0x0;this[_0x8727('0x1b')]=0x0;this[_0x8727('0x1c')]=0x0;this[_0x8727('0x1d')]=0x0;this[_0x8727('0x1e')]=_0x180b71[_0x8727('0x1e')]||![];this[_0x8727('0x1f')]=_0x180b71[_0x8727('0x1f')]||0xa;this[_0x8727('0x20')]=_0x180b71[_0x8727('0x20')]||'no';this[_0x8727('0x21')]=!![];this['message']='';this[_0x8727('0x22')]='';this[_0x8727('0x23')]=0x0;this[_0x8727('0x24')]=0x0;this[_0x8727('0x25')]=_0x180b71[_0x8727('0x25')]||null;this[_0x8727('0x26')]=_0x180b71['dialGlobalInterval']?_0x180b71['dialGlobalInterval']:null;this[_0x8727('0x27')]=_0x180b71['dialActive'];this[_0x8727('0x28')]=_0x180b71[_0x8727('0x28')]||_0x8727('0x29');this[_0x8727('0x2a')]=_0x180b71[_0x8727('0x2a')]||0x0;this['dialLimitQueue']=_0x180b71[_0x8727('0x2b')]||0x0;this[_0x8727('0x2c')]=_0x180b71[_0x8727('0x2c')]||0x1;this[_0x8727('0x2d')]=_0x180b71[_0x8727('0x2d')]||_0x8727('0x2e');this[_0x8727('0x2f')]=_0x180b71[_0x8727('0x2f')]||0.03;this[_0x8727('0x30')]=_0x180b71[_0x8727('0x30')]||0x258;this[_0x8727('0x31')]=_0x180b71[_0x8727('0x31')]||'anonymous';this[_0x8727('0x32')]=_0x180b71[_0x8727('0x32')]||'anonymous';this['dialOriginateTimeout']=_0x180b71[_0x8727('0x33')]||0x1e;this[_0x8727('0x34')]=_0x180b71[_0x8727('0x34')]||'tTxX';this[_0x8727('0x35')]=_0x180b71[_0x8727('0x35')]||0x3;this[_0x8727('0x36')]=_0x180b71[_0x8727('0x36')]||undefined;this[_0x8727('0x37')]=_0x180b71[_0x8727('0x37')]||0x3;this[_0x8727('0x38')]=_0x180b71[_0x8727('0x38')]||0x96;this['dialBusyMaxRetry']=_0x180b71[_0x8727('0x39')]||0x3;this[_0x8727('0x3a')]=_0x180b71['dialBusyRetryFrequency']||0x96;this[_0x8727('0x3b')]=_0x180b71[_0x8727('0x3b')]||0x3;this[_0x8727('0x3c')]=_0x180b71[_0x8727('0x3c')]||0x96;this[_0x8727('0x3d')]=_0x180b71[_0x8727('0x3d')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x180b71[_0x8727('0x3e')]||0x96;this['dialDropMaxRetry']=_0x180b71[_0x8727('0x3f')]||0x3;this['dialDropRetryFrequency']=_0x180b71[_0x8727('0x40')]||0x96;this[_0x8727('0x41')]=_0x180b71[_0x8727('0x41')]||0x3;this[_0x8727('0x42')]=_0x180b71[_0x8727('0x42')]||0x96;this[_0x8727('0x43')]=_0x180b71[_0x8727('0x43')]||0x3;this['dialMachineRetryFrequency']=_0x180b71[_0x8727('0x44')]||0x96;this[_0x8727('0x45')]=_0x180b71[_0x8727('0x45')]||0x3;this[_0x8727('0x46')]=_0x180b71[_0x8727('0x46')]||0x96;this[_0x8727('0x47')]=_0x180b71[_0x8727('0x47')]||0x3;this[_0x8727('0x48')]=_0x180b71[_0x8727('0x48')]||0x4;this[_0x8727('0x49')]=_0x180b71[_0x8727('0x49')]?_0x180b71[_0x8727('0x49')]:undefined;this['TrunkBackup']=_0x180b71['TrunkBackup']?_0x180b71[_0x8727('0x4a')]:undefined;this[_0x8727('0x4b')]=_0x180b71[_0x8727('0x4b')]||undefined;this[_0x8727('0x4c')]=_0x180b71['Interval']?_0x180b71[_0x8727('0x4c')]:undefined;this[_0x8727('0x4d')]=_0x180b71[_0x8727('0x4d')]||_0x8727('0x4e');this[_0x8727('0x4f')]=_0x180b71['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x8727('0x50')]=_0x180b71[_0x8727('0x50')]||undefined;this[_0x8727('0x51')]=strategy[_0x180b71[_0x8727('0x51')]];this[_0x8727('0x52')]=!![];this[_0x8727('0x53')]=_0x180b71[_0x8727('0x53')]||![];this[_0x8727('0x54')]=_0x180b71[_0x8727('0x54')];this[_0x8727('0x55')]=_0x180b71[_0x8727('0x55')];this[_0x8727('0x56')]=_0x180b71['dialAMDAfterGreetingSilence'];this[_0x8727('0x57')]=_0x180b71[_0x8727('0x57')];this[_0x8727('0x58')]=_0x180b71[_0x8727('0x58')];this[_0x8727('0x59')]=_0x180b71[_0x8727('0x59')];this[_0x8727('0x5a')]=_0x180b71[_0x8727('0x5a')];this[_0x8727('0x5b')]=_0x180b71[_0x8727('0x5b')];this[_0x8727('0x5c')]=_0x180b71[_0x8727('0x5c')];this[_0x8727('0x5d')]=0x0;this[_0x8727('0x5e')]=0x0;this['timeout']=_0x180b71[_0x8727('0x5f')];this[_0x8727('0x60')]=0x0;this[_0x8727('0x61')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x8727('0x62')]=0x0;this[_0x8727('0x63')]=0x0;this[_0x8727('0x64')]=0x0;this[_0x8727('0x65')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0x8727('0x66')]=0x0;this[_0x8727('0x67')]=0x0;this[_0x8727('0x68')]=0x0;this[_0x8727('0x69')]=0x0;this[_0x8727('0x6a')]=0x0;this[_0x8727('0x6b')]=0x0;this[_0x8727('0x6c')]=undefined;this[_0x8727('0x6d')]=undefined;this[_0x8727('0x6e')]=undefined;this[_0x8727('0x6f')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0x8727('0x70')]=0x0;this[_0x8727('0x71')]=0x0;this[_0x8727('0x72')]=0x0;this[_0x8727('0x73')]=0x0;this[_0x8727('0x74')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0x8727('0x75')]=0x0;this[_0x8727('0x76')]=_0x180b71[_0x8727('0x77')]||0x14;this['predictiveIntervalMinThreshold']=_0x180b71[_0x8727('0x77')]||0xa;this[_0x8727('0x78')]=0x0;this[_0x8727('0x79')]=0x0;this[_0x8727('0x7a')]=0x1;this[_0x8727('0x7b')]=0x0;this[_0x8727('0x7c')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0x8727('0x7d')]=0x0;this[_0x8727('0x7e')]=_0x180b71[_0x8727('0x7e')]||0x1e;this['dialRecallInQueue']=_0x180b71[_0x8727('0x7f')]||![];this[_0x8727('0x80')]=!!_0x180b71[_0x8727('0x80')]||![];this[_0x8727('0x81')]=!!_0x180b71[_0x8727('0x81')]||![];this[_0x8727('0x82')]=_0x180b71[_0x8727('0x82')]||undefined;this['dialAgiAfterHangupClient']=_0x180b71[_0x8727('0x83')]||![];this[_0x8727('0x84')]=_0x180b71[_0x8727('0x84')]||![];this[_0x8727('0xc')]=monitorFormat[_0x180b71[_0x8727('0xc')]]?monitorFormat[_0x180b71[_0x8727('0xc')]]:undefined;this[_0x8727('0x85')]=_0x180b71['mandatoryDisposition']||![];this[_0x8727('0x86')]=_0x180b71[_0x8727('0x86')]?_0x180b71[_0x8727('0x86')]:undefined;this['queueSummaryCountersUpdated']=![];}module[_0x8727('0x87')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index 72fb2eb..832f230 100644 --- a/server/services/ami/model/voiceQueueSummary.js +++ b/server/services/ami/model/voiceQueueSummary.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2263=['message','statusMessage','Trunk','active','callerid','prototype','createReport','loggedin','callers','SIP/','incall','status','booked','keys','queue','dialer','exten','xcally-motion-preview','some','compareToOutboundQueue','answered','preview','available','loggedIn','loggedInDb','paused','ringing','talking','waiting','inUse','originated','outboundAbandonedCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundUnknownCallsDay','pTalking','sumBillable','sumDuration','total','name','strategy','busy','invalid','onHold','notInUse','ringInUse','sumHoldTime','type','unavailable','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive'];(function(_0x2b7b04,_0x3885fb){var _0x3e415f=function(_0x41181c){while(--_0x41181c){_0x2b7b04['push'](_0x2b7b04['shift']());}};_0x3e415f(++_0x3885fb);}(_0x2263,0x6e));var _0x3226=function(_0x2c96f6,_0x877207){_0x2c96f6=_0x2c96f6-0x0;var _0x6d4808=_0x2263[_0x2c96f6];return _0x6d4808;};'use strict';var INBOUND_COUNTERS=[_0x3226('0x0'),_0x3226('0x1'),_0x3226('0x2'),_0x3226('0x3'),_0x3226('0x4'),_0x3226('0x5'),_0x3226('0x6')];var OUTBOUND_COUNTERS=[_0x3226('0x0'),'answered',_0x3226('0x7'),_0x3226('0x1'),_0x3226('0x2'),_0x3226('0x8'),_0x3226('0x9'),'outboundAnswerCallsDay',_0x3226('0xa'),_0x3226('0xb'),'outboundCongestionCallsDay','outboundNoAnswerCallsDay',_0x3226('0xc'),_0x3226('0xd'),'outboundRejectCallsDay',_0x3226('0xe'),_0x3226('0x3'),_0x3226('0xf'),_0x3226('0x5'),_0x3226('0x10'),_0x3226('0x11'),_0x3226('0x12'),'waiting'];function VoiceQueueSummary(_0x1e2c60){this['id']=_0x1e2c60['id'];this[_0x3226('0x13')]=_0x1e2c60[_0x3226('0x13')];this[_0x3226('0x14')]=_0x1e2c60['strategy'];this['abandoned']=_0x1e2c60['abandoned']||0x0;this['answered']=_0x1e2c60['answered']||0x0;this[_0x3226('0x0')]=_0x1e2c60[_0x3226('0x0')]||0x0;this[_0x3226('0x15')]=_0x1e2c60[_0x3226('0x15')]||0x0;this['inUse']=_0x1e2c60['inUse']||0x0;this[_0x3226('0x16')]=_0x1e2c60[_0x3226('0x16')]||0x0;this[_0x3226('0x1')]=_0x1e2c60['loggedIn']||0x0;this[_0x3226('0x2')]=_0x1e2c60[_0x3226('0x2')]||0x0;this[_0x3226('0x17')]=_0x1e2c60[_0x3226('0x17')]||0x0;this[_0x3226('0x18')]=_0x1e2c60[_0x3226('0x18')]||0x0;this['paused']=_0x1e2c60['paused']||0x0;this[_0x3226('0x4')]=_0x1e2c60['ringing']||0x0;this[_0x3226('0x19')]=_0x1e2c60[_0x3226('0x19')];this[_0x3226('0x10')]=_0x1e2c60[_0x3226('0x10')];this[_0x3226('0x11')]=_0x1e2c60[_0x3226('0x11')];this['sumHoldTime']=_0x1e2c60[_0x3226('0x1a')]||0x0;this[_0x3226('0x5')]=_0x1e2c60['talking']||0x0;this[_0x3226('0x12')]=_0x1e2c60[_0x3226('0x12')]||0x0;this[_0x3226('0x1b')]=_0x1e2c60['type'];this[_0x3226('0x1c')]=_0x1e2c60[_0x3226('0x1c')]||0x0;this[_0x3226('0x1d')]=_0x1e2c60[_0x3226('0x1d')]||0x0;this[_0x3226('0x1e')]=_0x1e2c60[_0x3226('0x1e')]||0x0;this[_0x3226('0x6')]=_0x1e2c60[_0x3226('0x6')]||0x0;if(_0x1e2c60['type']===_0x3226('0x1f')){this['pTalking']=_0x1e2c60[_0x3226('0xf')]||0x0;this['dialActive']=_0x1e2c60[_0x3226('0x20')];this['dialMethod']=_0x1e2c60[_0x3226('0x21')];this['dialOriginateCallerIdName']=_0x1e2c60[_0x3226('0x22')];this[_0x3226('0x23')]=_0x1e2c60['dialOriginateCallerIdNumber'];this[_0x3226('0x24')]=_0x1e2c60[_0x3226('0x24')];this[_0x3226('0x25')]=_0x1e2c60[_0x3226('0x25')];this[_0x3226('0x26')]=_0x1e2c60[_0x3226('0x26')];this[_0x3226('0x27')]=_0x1e2c60['outboundAnswerAgiCallsDay'];this[_0x3226('0x28')]=_0x1e2c60['outboundAnswerCallsDay'];this[_0x3226('0xa')]=_0x1e2c60[_0x3226('0xa')];this[_0x3226('0xb')]=_0x1e2c60['outboundBusyCallsDay'];this[_0x3226('0x29')]=_0x1e2c60['outboundCongestionCallsDay'];this['outboundDropCallsDayACS']=_0x1e2c60[_0x3226('0x2a')];this[_0x3226('0x2b')]=_0x1e2c60[_0x3226('0x2b')];this[_0x3226('0x2c')]=_0x1e2c60[_0x3226('0x2c')];this[_0x3226('0x2d')]=_0x1e2c60[_0x3226('0x2d')];this[_0x3226('0xc')]=_0x1e2c60[_0x3226('0xc')];this['outboundOriginateFailureCallsDay']=_0x1e2c60[_0x3226('0x2e')];this[_0x3226('0xd')]=_0x1e2c60[_0x3226('0xd')];this[_0x3226('0x2f')]=_0x1e2c60[_0x3226('0x2f')];this[_0x3226('0xe')]=_0x1e2c60[_0x3226('0xe')];this[_0x3226('0x30')]=_0x1e2c60[_0x3226('0x30')];this[_0x3226('0x31')]=_0x1e2c60[_0x3226('0x31')];this[_0x3226('0x32')]=_0x1e2c60[_0x3226('0x32')];this[_0x3226('0x33')]=_0x1e2c60['predictiveIntervalDroppedCallsCallersExit'];this['predictiveIntervalDroppedCallsTimeout']=_0x1e2c60[_0x3226('0x34')];this['predictiveIntervalErlangCalls']=_0x1e2c60[_0x3226('0x35')];this['predictiveIntervalErlangCallsDroppedCalls']=_0x1e2c60[_0x3226('0x36')];this[_0x3226('0x37')]=_0x1e2c60[_0x3226('0x37')];this[_0x3226('0x38')]=_0x1e2c60[_0x3226('0x38')];this['predictiveIntervalPauses']=_0x1e2c60[_0x3226('0x39')];this['predictiveIntervalAvailable']=_0x1e2c60[_0x3226('0x3a')];this['predictiveIntervalTotalCalls']=_0x1e2c60[_0x3226('0x3b')];this[_0x3226('0x8')]=_0x1e2c60[_0x3226('0x8')];this['erlangCalls']=_0x1e2c60[_0x3226('0x3c')];this[_0x3226('0x3d')]=_0x1e2c60[_0x3226('0x3d')];this[_0x3226('0x3e')]=_0x1e2c60[_0x3226('0x3e')];this[_0x3226('0x3f')]=_0x1e2c60[_0x3226('0x3f')];this[_0x3226('0x40')]=_0x1e2c60[_0x3226('0x40')];this[_0x3226('0x41')]=_0x1e2c60[_0x3226('0x41')];this[_0x3226('0x42')]=_0x1e2c60[_0x3226('0x42')];this[_0x3226('0x43')]=_0x1e2c60[_0x3226('0x43')];}if(_0x1e2c60['Trunk']){this[_0x3226('0x44')]={'id':_0x1e2c60[_0x3226('0x44')]['id'],'name':_0x1e2c60[_0x3226('0x44')][_0x3226('0x13')],'active':_0x1e2c60['Trunk'][_0x3226('0x45')],'callerid':_0x1e2c60[_0x3226('0x44')][_0x3226('0x46')]};}}VoiceQueueSummary[_0x3226('0x47')][_0x3226('0x48')]=function(_0x60a818,_0x34fe50,_0x1d0e02,_0x3f3efd){this['loggedInDb']=0x0;this[_0x3226('0x5')]=0x0;this[_0x3226('0x3')]=0x0;this[_0x3226('0x1d')]=0x0;this[_0x3226('0x18')]=0x0;this[_0x3226('0x7')]=0x0;this[_0x3226('0x15')]=0x0;this['invalid']=0x0;this['unavailable']=0x0;this[_0x3226('0x4')]=0x0;this[_0x3226('0x19')]=0x0;this['onHold']=0x0;if(_0x1d0e02){if(_0x1d0e02[_0x3226('0x0')]){this[_0x3226('0x0')]=Number(_0x1d0e02[_0x3226('0x0')]);}if(_0x1d0e02[_0x3226('0x49')]){this[_0x3226('0x1')]=Number(_0x1d0e02[_0x3226('0x49')]);}if(_0x1d0e02[_0x3226('0x4a')]){this[_0x3226('0x6')]=Number(_0x1d0e02['callers']);}}for(var _0xc63c19=0x0;_0xc63c19<_0x60a818['length'];_0xc63c19++){var _0x25664e=_0x34fe50[_0x3226('0x4b')+_0x60a818[_0xc63c19]['name']];if(_0x25664e&&_0x25664e['online']){this[_0x3226('0x2')]+=0x1;}if(_0x60a818[_0xc63c19][_0x3226('0x4c')]==='1'){this[_0x3226('0x5')]+=0x1;}if(_0x60a818[_0xc63c19][_0x3226('0x3')]==='1'&&!['2','7','8']['includes'](_0x60a818[_0xc63c19][_0x3226('0x4d')])){this[_0x3226('0x3')]+=0x1;}switch(_0x60a818[_0xc63c19]['status']){case'0':this[_0x3226('0x1d')]+=0x1;break;case'1':this[_0x3226('0x18')]+=0x1;break;case'2':this['inUse']+=0x1;break;case'3':this[_0x3226('0x15')]+=0x1;break;case'4':this[_0x3226('0x16')]+=0x1;break;case'5':this[_0x3226('0x1c')]+=0x1;break;case'6':this[_0x3226('0x4')]+=0x1;break;case'7':this[_0x3226('0x19')]+=0x1;break;case'8':this['onHold']+=0x1;break;}}if(this[_0x3226('0x21')]===_0x3226('0x4e')){var _0x3199b1=Object[_0x3226('0x4f')](_0x3f3efd);for(var _0xe890c=0x0;_0xe890c<_0x3199b1['length'];_0xe890c++){var _0x45f6bf=_0x3199b1[_0xe890c];var _0x206733=_0x3f3efd[_0x45f6bf];if(_0x206733[_0x3226('0x50')]===this[_0x3226('0x13')]&&_0x206733[_0x3226('0x1b')]===_0x3226('0x51')&&_0x206733[_0x3226('0x52')]===_0x3226('0x53')){this[_0x3226('0x5')]+=0x1;}}if(this[_0x3226('0x5')]>this[_0x3226('0x7')]){this[_0x3226('0x5')]=this[_0x3226('0x7')];}this['pTalking']=0x0;}return this;};VoiceQueueSummary[_0x3226('0x47')]['compareToInboundQueue']=function(_0x349852){var _0x4e5527=![];if(_0x349852){_0x4e5527=INBOUND_COUNTERS[_0x3226('0x54')](function(_0x222a6d){return this[_0x222a6d]!==_0x349852[_0x222a6d];},this);}return _0x4e5527;};VoiceQueueSummary['prototype'][_0x3226('0x55')]=function(_0x454144){var _0x3f673d=![];var _0x4ca7f4=![];var _0x165609=![];if(_0x454144){_0x3f673d=this[_0x3226('0x21')]!==_0x454144[_0x3226('0x21')]||this['dialActive']!==_0x454144[_0x3226('0x20')]||this[_0x3226('0x42')]!==_0x454144[_0x3226('0x42')]||this[_0x3226('0x43')]!==_0x454144['statusMessage'];_0x4ca7f4=OUTBOUND_COUNTERS['some'](function(_0x407fa5){return this[_0x407fa5]!==_0x454144[_0x407fa5];},this);if(this[_0x3226('0x44')]&&_0x454144[_0x3226('0x44')]){_0x165609=this[_0x3226('0x44')][_0x3226('0x13')]!==_0x454144[_0x3226('0x44')][_0x3226('0x13')]||this[_0x3226('0x44')][_0x3226('0x45')]!==_0x454144['Trunk'][_0x3226('0x45')];}}return _0x3f673d||_0x4ca7f4||_0x165609;};VoiceQueueSummary[_0x3226('0x47')]['updateReportFromOutboundQueue']=function(_0x75d0f2){this[_0x3226('0x56')]=_0x75d0f2[_0x3226('0x56')];this['message']=_0x75d0f2[_0x3226('0x42')];this[_0x3226('0x43')]=_0x75d0f2['statusMessage'];this[_0x3226('0x8')]=_0x75d0f2['originated'];this[_0x3226('0x9')]=_0x75d0f2[_0x3226('0x9')];this[_0x3226('0x28')]=_0x75d0f2['outboundAnswerCallsDay'];this['outboundBlacklistCallsDay']=_0x75d0f2['outboundBlacklistCallsDay'];this[_0x3226('0xb')]=_0x75d0f2[_0x3226('0xb')];this[_0x3226('0x29')]=_0x75d0f2[_0x3226('0x29')];this['outboundNoAnswerCallsDay']=_0x75d0f2['outboundNoAnswerCallsDay'];this[_0x3226('0xc')]=_0x75d0f2[_0x3226('0xc')];this[_0x3226('0xd')]=_0x75d0f2[_0x3226('0xd')];this[_0x3226('0x2f')]=_0x75d0f2[_0x3226('0x2f')];this[_0x3226('0xe')]=_0x75d0f2[_0x3226('0xe')];this['sumBillable']=_0x75d0f2[_0x3226('0x10')];this[_0x3226('0x11')]=_0x75d0f2[_0x3226('0x11')];this[_0x3226('0x12')]=_0x75d0f2['total'];if(this[_0x3226('0x21')]===_0x3226('0x57')){this[_0x3226('0xf')]=_0x75d0f2[_0x3226('0xf')];}};module['exports']=VoiceQueueSummary; \ No newline at end of file +var _0x8c32=['outboundDropCallsDayTimeout','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','callerid','prototype','loggedin','callers','SIP/','online','incall','includes','dialMethod','length','queue','dialer','exten','xcally-motion-preview','compareToInboundQueue','compareToOutboundQueue','active','updateReportFromOutboundQueue','outboundNoSuchCallsDay','preview','exports','available','loggedIn','loggedInDb','paused','ringing','talking','waiting','answered','inUse','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundReCallsDay','outboundRejectCallsDay','sumBillable','total','name','strategy','abandoned','busy','invalid','onHold','notInUse','ringInUse','sumDuration','sumHoldTime','type','unavailable','unknown','unmanaged','outbound','pTalking','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit'];(function(_0x1be50b,_0x27c249){var _0x5a70eb=function(_0x3732f5){while(--_0x3732f5){_0x1be50b['push'](_0x1be50b['shift']());}};_0x5a70eb(++_0x27c249);}(_0x8c32,0x130));var _0x28c3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8c32[_0x321bb2];return _0x9c12ed;};'use strict';var INBOUND_COUNTERS=[_0x28c3('0x0'),_0x28c3('0x1'),_0x28c3('0x2'),_0x28c3('0x3'),_0x28c3('0x4'),_0x28c3('0x5'),_0x28c3('0x6')];var OUTBOUND_COUNTERS=[_0x28c3('0x0'),_0x28c3('0x7'),_0x28c3('0x8'),_0x28c3('0x1'),_0x28c3('0x2'),'originated',_0x28c3('0x9'),_0x28c3('0xa'),_0x28c3('0xb'),_0x28c3('0xc'),_0x28c3('0xd'),_0x28c3('0xe'),'outboundNoSuchCallsDay',_0x28c3('0xf'),_0x28c3('0x10'),'outboundUnknownCallsDay','paused','pTalking',_0x28c3('0x5'),_0x28c3('0x11'),'sumDuration',_0x28c3('0x12'),_0x28c3('0x6')];function VoiceQueueSummary(_0x904880){this['id']=_0x904880['id'];this['name']=_0x904880[_0x28c3('0x13')];this[_0x28c3('0x14')]=_0x904880[_0x28c3('0x14')];this[_0x28c3('0x15')]=_0x904880[_0x28c3('0x15')]||0x0;this['answered']=_0x904880[_0x28c3('0x7')]||0x0;this['available']=_0x904880[_0x28c3('0x0')]||0x0;this['busy']=_0x904880[_0x28c3('0x16')]||0x0;this['inUse']=_0x904880[_0x28c3('0x8')]||0x0;this[_0x28c3('0x17')]=_0x904880['invalid']||0x0;this[_0x28c3('0x1')]=_0x904880['loggedIn']||0x0;this['loggedInDb']=_0x904880['loggedInDb']||0x0;this[_0x28c3('0x18')]=_0x904880[_0x28c3('0x18')]||0x0;this[_0x28c3('0x19')]=_0x904880['notInUse']||0x0;this[_0x28c3('0x3')]=_0x904880[_0x28c3('0x3')]||0x0;this[_0x28c3('0x4')]=_0x904880[_0x28c3('0x4')]||0x0;this[_0x28c3('0x1a')]=_0x904880[_0x28c3('0x1a')];this[_0x28c3('0x11')]=_0x904880[_0x28c3('0x11')];this[_0x28c3('0x1b')]=_0x904880[_0x28c3('0x1b')];this[_0x28c3('0x1c')]=_0x904880[_0x28c3('0x1c')]||0x0;this[_0x28c3('0x5')]=_0x904880[_0x28c3('0x5')]||0x0;this[_0x28c3('0x12')]=_0x904880[_0x28c3('0x12')]||0x0;this[_0x28c3('0x1d')]=_0x904880[_0x28c3('0x1d')];this[_0x28c3('0x1e')]=_0x904880[_0x28c3('0x1e')]||0x0;this[_0x28c3('0x1f')]=_0x904880[_0x28c3('0x1f')]||0x0;this[_0x28c3('0x20')]=_0x904880[_0x28c3('0x20')]||0x0;this['waiting']=_0x904880[_0x28c3('0x6')]||0x0;if(_0x904880[_0x28c3('0x1d')]===_0x28c3('0x21')){this[_0x28c3('0x22')]=_0x904880[_0x28c3('0x22')]||0x0;this['dialActive']=_0x904880[_0x28c3('0x23')];this['dialMethod']=_0x904880['dialMethod'];this[_0x28c3('0x24')]=_0x904880['dialOriginateCallerIdName'];this[_0x28c3('0x25')]=_0x904880[_0x28c3('0x25')];this[_0x28c3('0x26')]=_0x904880['dialOriginateTimeout'];this[_0x28c3('0x27')]=_0x904880[_0x28c3('0x27')];this[_0x28c3('0x28')]=_0x904880[_0x28c3('0x28')];this['outboundAnswerAgiCallsDay']=_0x904880[_0x28c3('0x29')];this[_0x28c3('0xa')]=_0x904880[_0x28c3('0xa')];this['outboundBlacklistCallsDay']=_0x904880[_0x28c3('0xb')];this['outboundBusyCallsDay']=_0x904880[_0x28c3('0xc')];this[_0x28c3('0xd')]=_0x904880[_0x28c3('0xd')];this[_0x28c3('0x2a')]=_0x904880['outboundDropCallsDayACS'];this[_0x28c3('0x2b')]=_0x904880[_0x28c3('0x2b')];this['outboundDropCallsDayTimeout']=_0x904880[_0x28c3('0x2c')];this[_0x28c3('0xe')]=_0x904880[_0x28c3('0xe')];this['outboundNoSuchCallsDay']=_0x904880['outboundNoSuchCallsDay'];this['outboundOriginateFailureCallsDay']=_0x904880['outboundOriginateFailureCallsDay'];this[_0x28c3('0xf')]=_0x904880[_0x28c3('0xf')];this[_0x28c3('0x10')]=_0x904880[_0x28c3('0x10')];this[_0x28c3('0x2d')]=_0x904880['outboundUnknownCallsDay'];this[_0x28c3('0x2e')]=_0x904880[_0x28c3('0x2e')];this[_0x28c3('0x2f')]=_0x904880[_0x28c3('0x2f')];this[_0x28c3('0x30')]=_0x904880[_0x28c3('0x30')];this[_0x28c3('0x31')]=_0x904880[_0x28c3('0x31')];this[_0x28c3('0x32')]=_0x904880[_0x28c3('0x32')];this[_0x28c3('0x33')]=_0x904880['predictiveIntervalErlangCalls'];this[_0x28c3('0x34')]=_0x904880[_0x28c3('0x34')];this['predictiveIntervalHitRate']=_0x904880[_0x28c3('0x35')];this[_0x28c3('0x36')]=_0x904880[_0x28c3('0x36')];this[_0x28c3('0x37')]=_0x904880[_0x28c3('0x37')];this[_0x28c3('0x38')]=_0x904880[_0x28c3('0x38')];this[_0x28c3('0x39')]=_0x904880['predictiveIntervalTotalCalls'];this[_0x28c3('0x3a')]=_0x904880['originated'];this[_0x28c3('0x3b')]=_0x904880[_0x28c3('0x3b')];this['erlangCallToSecond']=_0x904880['erlangCallToSecond'];this['erlangAbandonmentRate']=_0x904880['erlangAbandonmentRate'];this[_0x28c3('0x3c')]=_0x904880[_0x28c3('0x3c')];this[_0x28c3('0x3d')]=_0x904880[_0x28c3('0x3d')];this[_0x28c3('0x3e')]=_0x904880[_0x28c3('0x3e')];this[_0x28c3('0x3f')]=_0x904880['message'];this[_0x28c3('0x40')]=_0x904880[_0x28c3('0x40')];}if(_0x904880['Trunk']){this[_0x28c3('0x41')]={'id':_0x904880[_0x28c3('0x41')]['id'],'name':_0x904880['Trunk'][_0x28c3('0x13')],'active':_0x904880['Trunk']['active'],'callerid':_0x904880[_0x28c3('0x41')][_0x28c3('0x42')]};}}VoiceQueueSummary[_0x28c3('0x43')]['createReport']=function(_0x46bb17,_0x5957d9,_0x1a9aac,_0x47f733){this[_0x28c3('0x2')]=0x0;this[_0x28c3('0x5')]=0x0;this[_0x28c3('0x3')]=0x0;this['unknown']=0x0;this['notInUse']=0x0;this[_0x28c3('0x8')]=0x0;this['busy']=0x0;this[_0x28c3('0x17')]=0x0;this[_0x28c3('0x1e')]=0x0;this[_0x28c3('0x4')]=0x0;this[_0x28c3('0x1a')]=0x0;this[_0x28c3('0x18')]=0x0;if(_0x1a9aac){if(_0x1a9aac[_0x28c3('0x0')]){this[_0x28c3('0x0')]=Number(_0x1a9aac['available']);}if(_0x1a9aac[_0x28c3('0x44')]){this[_0x28c3('0x1')]=Number(_0x1a9aac[_0x28c3('0x44')]);}if(_0x1a9aac[_0x28c3('0x45')]){this[_0x28c3('0x6')]=Number(_0x1a9aac[_0x28c3('0x45')]);}}for(var _0x30a0d8=0x0;_0x30a0d8<_0x46bb17['length'];_0x30a0d8++){var _0x471f57=_0x5957d9[_0x28c3('0x46')+_0x46bb17[_0x30a0d8][_0x28c3('0x13')]];if(_0x471f57&&_0x471f57[_0x28c3('0x47')]){this[_0x28c3('0x2')]+=0x1;}if(_0x46bb17[_0x30a0d8][_0x28c3('0x48')]==='1'){this['talking']+=0x1;}if(_0x46bb17[_0x30a0d8][_0x28c3('0x3')]==='1'&&!['2','7','8'][_0x28c3('0x49')](_0x46bb17[_0x30a0d8]['status'])){this[_0x28c3('0x3')]+=0x1;}switch(_0x46bb17[_0x30a0d8]['status']){case'0':this['unknown']+=0x1;break;case'1':this[_0x28c3('0x19')]+=0x1;break;case'2':this[_0x28c3('0x8')]+=0x1;break;case'3':this[_0x28c3('0x16')]+=0x1;break;case'4':this[_0x28c3('0x17')]+=0x1;break;case'5':this['unavailable']+=0x1;break;case'6':this[_0x28c3('0x4')]+=0x1;break;case'7':this['ringInUse']+=0x1;break;case'8':this[_0x28c3('0x18')]+=0x1;break;}}if(this[_0x28c3('0x4a')]==='booked'){var _0x281195=Object['keys'](_0x47f733);for(var _0x1cc1d5=0x0;_0x1cc1d5<_0x281195[_0x28c3('0x4b')];_0x1cc1d5++){var _0x1a8eec=_0x281195[_0x1cc1d5];var _0x3b5c08=_0x47f733[_0x1a8eec];if(_0x3b5c08[_0x28c3('0x4c')]===this[_0x28c3('0x13')]&&_0x3b5c08[_0x28c3('0x1d')]===_0x28c3('0x4d')&&_0x3b5c08[_0x28c3('0x4e')]===_0x28c3('0x4f')){this[_0x28c3('0x5')]+=0x1;}}if(this[_0x28c3('0x5')]>this[_0x28c3('0x8')]){this['talking']=this[_0x28c3('0x8')];}this['pTalking']=0x0;}return this;};VoiceQueueSummary[_0x28c3('0x43')][_0x28c3('0x50')]=function(_0x3ab2be){var _0x4ec30b=![];if(_0x3ab2be){_0x4ec30b=INBOUND_COUNTERS['some'](function(_0xab3e54){return this[_0xab3e54]!==_0x3ab2be[_0xab3e54];},this);}return _0x4ec30b;};VoiceQueueSummary[_0x28c3('0x43')][_0x28c3('0x51')]=function(_0x4c1584){var _0x2d2fde=![];var _0x5608e6=![];var _0x2ed4af=![];if(_0x4c1584){_0x2d2fde=this[_0x28c3('0x4a')]!==_0x4c1584['dialMethod']||this[_0x28c3('0x23')]!==_0x4c1584[_0x28c3('0x23')]||this['message']!==_0x4c1584[_0x28c3('0x3f')]||this[_0x28c3('0x40')]!==_0x4c1584[_0x28c3('0x40')];_0x5608e6=OUTBOUND_COUNTERS['some'](function(_0x22de91){return this[_0x22de91]!==_0x4c1584[_0x22de91];},this);if(this['Trunk']&&_0x4c1584[_0x28c3('0x41')]){_0x2ed4af=this[_0x28c3('0x41')]['name']!==_0x4c1584[_0x28c3('0x41')][_0x28c3('0x13')]||this[_0x28c3('0x41')][_0x28c3('0x52')]!==_0x4c1584['Trunk']['active'];}}return _0x2d2fde||_0x5608e6||_0x2ed4af;};VoiceQueueSummary[_0x28c3('0x43')][_0x28c3('0x53')]=function(_0x39b17){this['answered']=_0x39b17[_0x28c3('0x7')];this[_0x28c3('0x3f')]=_0x39b17[_0x28c3('0x3f')];this[_0x28c3('0x40')]=_0x39b17[_0x28c3('0x40')];this[_0x28c3('0x3a')]=_0x39b17['originated'];this[_0x28c3('0x9')]=_0x39b17['outboundAbandonedCallsDay'];this[_0x28c3('0xa')]=_0x39b17[_0x28c3('0xa')];this['outboundBlacklistCallsDay']=_0x39b17[_0x28c3('0xb')];this[_0x28c3('0xc')]=_0x39b17['outboundBusyCallsDay'];this[_0x28c3('0xd')]=_0x39b17['outboundCongestionCallsDay'];this[_0x28c3('0xe')]=_0x39b17[_0x28c3('0xe')];this[_0x28c3('0x54')]=_0x39b17[_0x28c3('0x54')];this['outboundReCallsDay']=_0x39b17[_0x28c3('0xf')];this[_0x28c3('0x10')]=_0x39b17[_0x28c3('0x10')];this['outboundUnknownCallsDay']=_0x39b17[_0x28c3('0x2d')];this[_0x28c3('0x11')]=_0x39b17[_0x28c3('0x11')];this['sumDuration']=_0x39b17[_0x28c3('0x1b')];this[_0x28c3('0x12')]=_0x39b17[_0x28c3('0x12')];if(this[_0x28c3('0x4a')]===_0x28c3('0x55')){this[_0x28c3('0x22')]=_0x39b17[_0x28c3('0x22')];}};module[_0x28c3('0x56')]=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 5e05e07..14db8d0 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 _0x310f=['name','username','remoteUri','serverUrl','Configurations','exports'];(function(_0x2e044f,_0x53e4e5){var _0x4f3f68=function(_0x5b5fff){while(--_0x5b5fff){_0x2e044f['push'](_0x2e044f['shift']());}};_0x4f3f68(++_0x53e4e5);}(_0x310f,0xf0));var _0xf310=function(_0x5ae7bb,_0x23a7c9){_0x5ae7bb=_0x5ae7bb-0x0;var _0x38bb27=_0x310f[_0x5ae7bb];return _0x38bb27;};'use strict';function VtigerAccount(_0x5c7281){this['id']=_0x5c7281['id']||0x0;this[_0xf310('0x0')]=_0x5c7281[_0xf310('0x0')]||'';this[_0xf310('0x1')]=_0x5c7281[_0xf310('0x1')]||'';this['accessKey']=_0x5c7281['accessKey']||'';this[_0xf310('0x2')]=_0x5c7281['remoteUri']||'';this[_0xf310('0x3')]=_0x5c7281[_0xf310('0x3')]||'';this['Configurations']=_0x5c7281[_0xf310('0x4')]||{};}module[_0xf310('0x5')]=VtigerAccount; \ No newline at end of file +var _0xd54f=['username','accessKey','remoteUri','serverUrl','Configurations','name'];(function(_0x522c6d,_0x4d250d){var _0x26300d=function(_0x3ab228){while(--_0x3ab228){_0x522c6d['push'](_0x522c6d['shift']());}};_0x26300d(++_0x4d250d);}(_0xd54f,0x6b));var _0xfd54=function(_0x3e4a0c,_0x49faa6){_0x3e4a0c=_0x3e4a0c-0x0;var _0x5dbebf=_0xd54f[_0x3e4a0c];return _0x5dbebf;};'use strict';function VtigerAccount(_0x9a200e){this['id']=_0x9a200e['id']||0x0;this[_0xfd54('0x0')]=_0x9a200e[_0xfd54('0x0')]||'';this[_0xfd54('0x1')]=_0x9a200e['username']||'';this[_0xfd54('0x2')]=_0x9a200e['accessKey']||'';this[_0xfd54('0x3')]=_0x9a200e['remoteUri']||'';this[_0xfd54('0x4')]=_0x9a200e[_0xfd54('0x4')]||'';this['Configurations']=_0x9a200e[_0xfd54('0x5')]||{};}module['exports']=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 2c19d42..9094abb 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 _0xe6b4=['authType','type','integrationTab','serverUrl','Configurations','exports','name','username','password','token','remoteUri'];(function(_0x431537,_0x2cc4eb){var _0x45d82e=function(_0x2f94bf){while(--_0x2f94bf){_0x431537['push'](_0x431537['shift']());}};_0x45d82e(++_0x2cc4eb);}(_0xe6b4,0x17c));var _0x4e6b=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe6b4[_0x2641f9];return _0x585741;};'use strict';function ZendeskAccount(_0x3d8042){this['id']=_0x3d8042['id']||0x0;this['name']=_0x3d8042[_0x4e6b('0x0')]||'';this[_0x4e6b('0x1')]=_0x3d8042[_0x4e6b('0x1')]||'';this[_0x4e6b('0x2')]=_0x3d8042['password']||'';this['token']=_0x3d8042[_0x4e6b('0x3')]||'';this[_0x4e6b('0x4')]=_0x3d8042[_0x4e6b('0x4')]||'';this[_0x4e6b('0x5')]=_0x3d8042[_0x4e6b('0x5')]||'';this[_0x4e6b('0x6')]=_0x3d8042['type']||_0x4e6b('0x7');this[_0x4e6b('0x8')]=_0x3d8042[_0x4e6b('0x8')]||'';this[_0x4e6b('0x9')]=_0x3d8042['Configurations']||{};}module[_0x4e6b('0xa')]=ZendeskAccount; \ No newline at end of file +var _0xf52e=['exports','name','username','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations'];(function(_0xa8b370,_0x2b77db){var _0x643e37=function(_0x1486eb){while(--_0x1486eb){_0xa8b370['push'](_0xa8b370['shift']());}};_0x643e37(++_0x2b77db);}(_0xf52e,0x1f0));var _0xef52=function(_0x48e287,_0xd797c7){_0x48e287=_0x48e287-0x0;var _0x2fc415=_0xf52e[_0x48e287];return _0x2fc415;};'use strict';function ZendeskAccount(_0x3ebbf3){this['id']=_0x3ebbf3['id']||0x0;this['name']=_0x3ebbf3[_0xef52('0x0')]||'';this['username']=_0x3ebbf3[_0xef52('0x1')]||'';this[_0xef52('0x2')]=_0x3ebbf3['password']||'';this['token']=_0x3ebbf3[_0xef52('0x3')]||'';this[_0xef52('0x4')]=_0x3ebbf3[_0xef52('0x4')]||'';this[_0xef52('0x5')]=_0x3ebbf3[_0xef52('0x5')]||'';this[_0xef52('0x6')]=_0x3ebbf3[_0xef52('0x6')]||_0xef52('0x7');this[_0xef52('0x8')]=_0x3ebbf3[_0xef52('0x8')]||'';this[_0xef52('0x9')]=_0x3ebbf3[_0xef52('0x9')]||{};}module[_0xef52('0xa')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 9e5ee8b..959a895 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 _0x04d4=['serverUrl','code','refreshToken','Configurations','exports','name','description','host','clientId','clientSecret'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x04d4,0x73));var _0x404d=function(_0x41df5b,_0x338095){_0x41df5b=_0x41df5b-0x0;var _0x182499=_0x04d4[_0x41df5b];return _0x182499;};'use strict';function ZohoAccount(_0x3035cf){this['id']=_0x3035cf['id']||0x0;this[_0x404d('0x0')]=_0x3035cf[_0x404d('0x0')]||'';this[_0x404d('0x1')]=_0x3035cf[_0x404d('0x1')]||'';this[_0x404d('0x2')]=_0x3035cf[_0x404d('0x2')]||'';this['zone']=_0x3035cf['zone']||'';this['clientId']=_0x3035cf[_0x404d('0x3')]||'';this[_0x404d('0x4')]=_0x3035cf[_0x404d('0x4')]||'';this[_0x404d('0x5')]=_0x3035cf[_0x404d('0x5')]||'';this[_0x404d('0x6')]=_0x3035cf[_0x404d('0x6')]||'';this[_0x404d('0x7')]=_0x3035cf[_0x404d('0x7')]||'';this[_0x404d('0x8')]=_0x3035cf[_0x404d('0x8')]||{};}module[_0x404d('0x9')]=ZohoAccount; \ No newline at end of file +var _0x41f4=['refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret','code'];(function(_0x21b706,_0x1022f4){var _0x13b94a=function(_0x3116da){while(--_0x3116da){_0x21b706['push'](_0x21b706['shift']());}};_0x13b94a(++_0x1022f4);}(_0x41f4,0x71));var _0x441f=function(_0x7bd14b,_0x12603d){_0x7bd14b=_0x7bd14b-0x0;var _0x50491f=_0x41f4[_0x7bd14b];return _0x50491f;};'use strict';function ZohoAccount(_0x5b3bee){this['id']=_0x5b3bee['id']||0x0;this[_0x441f('0x0')]=_0x5b3bee[_0x441f('0x0')]||'';this[_0x441f('0x1')]=_0x5b3bee[_0x441f('0x1')]||'';this['host']=_0x5b3bee[_0x441f('0x2')]||'';this[_0x441f('0x3')]=_0x5b3bee[_0x441f('0x3')]||'';this['clientId']=_0x5b3bee[_0x441f('0x4')]||'';this[_0x441f('0x5')]=_0x5b3bee[_0x441f('0x5')]||'';this['serverUrl']=_0x5b3bee['serverUrl']||'';this[_0x441f('0x6')]=_0x5b3bee[_0x441f('0x6')]||'';this[_0x441f('0x7')]=_0x5b3bee['refreshToken']||'';this[_0x441f('0x8')]=_0x5b3bee['Configurations']||{};}module[_0x441f('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 210e836..920ba19 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 _0x1a85=['scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports','moment','isNil','string','uniqueid','queue','type','campaigntype','dialAnswer','membername','Agent','name','channelAgent','format','SIP/%s','calleridname','Contact','phone','firstName','lastName','active'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0x1a85,0x178));var _0x51a8=function(_0x327e47,_0x1f69a3){_0x327e47=_0x327e47-0x0;var _0xd2b5cd=_0x1a85[_0x327e47];return _0xd2b5cd;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x51a8('0x0'));function checkNameSurname(_0x382cb8,_0x43e22a,_0x498466){var _0x562d89='';if(!_[_0x51a8('0x1')](_0x43e22a)&&_0x51a8('0x2')===typeof _0x43e22a){_0x562d89+=_0x43e22a;}if(!_[_0x51a8('0x1')](_0x498466)&&'string'===typeof _0x498466){_0x562d89+='\x20'+_0x498466;}if(_0x562d89!==''){return _0x562d89;}return _0x382cb8;}function Action(_0xaac0bf,_0x4b76a8,_0x2c1180,_0x5cf430,_0x331117){this[_0x51a8('0x3')]=_0x2c1180||undefined;this['idContact']=_0xaac0bf['id'];this[_0x51a8('0x4')]=_0x4b76a8['name'];this['type']=_0x4b76a8[_0x51a8('0x5')];this[_0x51a8('0x6')]=_0x51a8('0x4');this[_0x51a8('0x7')]=![];this[_0x51a8('0x8')]=_[_0x51a8('0x1')](_0xaac0bf[_0x51a8('0x9')])?undefined:_0xaac0bf[_0x51a8('0x9')][_0x51a8('0xa')];this[_0x51a8('0xb')]=this[_0x51a8('0x8')]?util[_0x51a8('0xc')](_0x51a8('0xd'),this[_0x51a8('0x8')]):_0x5cf430||undefined;this[_0x51a8('0xe')]=checkNameSurname(_0xaac0bf[_0x51a8('0xf')][_0x51a8('0x10')],_0xaac0bf['Contact'][_0x51a8('0x11')],_0xaac0bf[_0x51a8('0xf')][_0x51a8('0x12')]);this['active']=_0xaac0bf[_0x51a8('0x13')]||![];this['calleridnum']=_0xaac0bf[_0x51a8('0x10')];this[_0x51a8('0x14')]=_0xaac0bf[_0x51a8('0x14')];this[_0x51a8('0x15')]=_0xaac0bf[_0x51a8('0x15')]||0x0;this[_0x51a8('0x16')]=_0xaac0bf[_0x51a8('0x16')]||0x0;this['countnoanswerretry']=_0xaac0bf[_0x51a8('0x17')]||0x0;this[_0x51a8('0x18')]=(_0xaac0bf[_0x51a8('0x15')]||0x0)+(_0xaac0bf[_0x51a8('0x16')]||0x0)+(_0xaac0bf[_0x51a8('0x17')]||0x0)+(_0xaac0bf[_0x51a8('0x19')]||0x0)+(_0xaac0bf['countdropretry']||0x0)+(_0xaac0bf[_0x51a8('0x1a')]||0x0)+(_0xaac0bf[_0x51a8('0x1b')]||0x0)+(_0xaac0bf[_0x51a8('0x1c')]||0x0);this[_0x51a8('0x19')]=_0xaac0bf[_0x51a8('0x19')]||0x0;this[_0x51a8('0x1d')]=_0xaac0bf[_0x51a8('0x1d')]||0x0;this[_0x51a8('0x1a')]=_0xaac0bf['countabandonedretry']||0x0;this[_0x51a8('0x1b')]=_0xaac0bf['countmachineretry']||0x0;this[_0x51a8('0x1c')]=_0xaac0bf[_0x51a8('0x1c')]||0x0;this[_0x51a8('0x1e')]=_0xaac0bf[_0x51a8('0x1e')];this['callbackuniqueid']=_0xaac0bf[_0x51a8('0x1f')];this['callbackat']=_0xaac0bf['callbackat'];this[_0x51a8('0x20')]=_0xaac0bf['recallme'];this[_0x51a8('0x21')]=_0xaac0bf[_0x51a8('0x21')];this[_0x51a8('0x22')]=_0xaac0bf[_0x51a8('0x22')];this[_0x51a8('0x23')]=_[_0x51a8('0x1')](_0xaac0bf[_0x51a8('0x9')])?_0xaac0bf[_0x51a8('0x23')]:_0xaac0bf['Agent']['id'];this[_0x51a8('0x24')]=_0xaac0bf[_0x51a8('0x24')];this[_0x51a8('0x25')]='';this[_0x51a8('0x26')]='';}Action[_0x51a8('0x27')][_0x51a8('0x28')]=function(){return util[_0x51a8('0xc')](_0x51a8('0x29'),this[_0x51a8('0xe')],this[_0x51a8('0x2a')]);};module[_0x51a8('0x2b')]=Action; \ No newline at end of file +var _0x5fdc=['number','util','lodash','moment','isNil','string','queue','name','type','dialAnswer','membername','Agent','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countnoanswerretry','countglobal','countbusyretry','countcongestionretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','prototype','getCaller','format','\x22%s\x22\x20<%s>'];(function(_0xb0002a,_0x53f06e){var _0x55b76f=function(_0x279acc){while(--_0x279acc){_0xb0002a['push'](_0xb0002a['shift']());}};_0x55b76f(++_0x53f06e);}(_0x5fdc,0x127));var _0xc5fd=function(_0x23d8cc,_0x4b2ce1){_0x23d8cc=_0x23d8cc-0x0;var _0x2d625d=_0x5fdc[_0x23d8cc];return _0x2d625d;};'use strict';var util=require(_0xc5fd('0x0'));var _=require(_0xc5fd('0x1'));var moment=require(_0xc5fd('0x2'));function checkNameSurname(_0x1d01cf,_0x36e895,_0x341db9){var _0x3be451='';if(!_[_0xc5fd('0x3')](_0x36e895)&&_0xc5fd('0x4')===typeof _0x36e895){_0x3be451+=_0x36e895;}if(!_[_0xc5fd('0x3')](_0x341db9)&&_0xc5fd('0x4')===typeof _0x341db9){_0x3be451+='\x20'+_0x341db9;}if(_0x3be451!==''){return _0x3be451;}return _0x1d01cf;}function Action(_0xea5748,_0x44722b,_0x216902,_0x15ffe7,_0x5a2eb4){this['uniqueid']=_0x216902||undefined;this['idContact']=_0xea5748['id'];this[_0xc5fd('0x5')]=_0x44722b[_0xc5fd('0x6')];this[_0xc5fd('0x7')]=_0x44722b[_0xc5fd('0x7')];this['campaigntype']='queue';this[_0xc5fd('0x8')]=![];this[_0xc5fd('0x9')]=_[_0xc5fd('0x3')](_0xea5748[_0xc5fd('0xa')])?undefined:_0xea5748[_0xc5fd('0xa')][_0xc5fd('0x6')];this['channelAgent']=this[_0xc5fd('0x9')]?util['format']('SIP/%s',this[_0xc5fd('0x9')]):_0x15ffe7||undefined;this[_0xc5fd('0xb')]=checkNameSurname(_0xea5748[_0xc5fd('0xc')][_0xc5fd('0xd')],_0xea5748[_0xc5fd('0xc')][_0xc5fd('0xe')],_0xea5748[_0xc5fd('0xc')][_0xc5fd('0xf')]);this['active']=_0xea5748[_0xc5fd('0x10')]||![];this[_0xc5fd('0x11')]=_0xea5748[_0xc5fd('0xd')];this[_0xc5fd('0x12')]=_0xea5748['scheduledat'];this['countbusyretry']=_0xea5748['countbusyretry']||0x0;this['countcongestionretry']=_0xea5748['countcongestionretry']||0x0;this[_0xc5fd('0x13')]=_0xea5748[_0xc5fd('0x13')]||0x0;this[_0xc5fd('0x14')]=(_0xea5748[_0xc5fd('0x15')]||0x0)+(_0xea5748[_0xc5fd('0x16')]||0x0)+(_0xea5748[_0xc5fd('0x13')]||0x0)+(_0xea5748[_0xc5fd('0x17')]||0x0)+(_0xea5748['countdropretry']||0x0)+(_0xea5748[_0xc5fd('0x18')]||0x0)+(_0xea5748[_0xc5fd('0x19')]||0x0)+(_0xea5748[_0xc5fd('0x1a')]||0x0);this[_0xc5fd('0x17')]=_0xea5748[_0xc5fd('0x17')]||0x0;this['countdropretry']=_0xea5748[_0xc5fd('0x1b')]||0x0;this[_0xc5fd('0x18')]=_0xea5748[_0xc5fd('0x18')]||0x0;this[_0xc5fd('0x19')]=_0xea5748['countmachineretry']||0x0;this['countagentrejectretry']=_0xea5748[_0xc5fd('0x1a')]||0x0;this[_0xc5fd('0x1c')]=_0xea5748[_0xc5fd('0x1c')];this[_0xc5fd('0x1d')]=_0xea5748[_0xc5fd('0x1d')];this[_0xc5fd('0x1e')]=_0xea5748['callbackat'];this[_0xc5fd('0x1f')]=_0xea5748[_0xc5fd('0x1f')];this[_0xc5fd('0x20')]=_0xea5748[_0xc5fd('0x20')];this[_0xc5fd('0x21')]=_0xea5748[_0xc5fd('0x21')];this[_0xc5fd('0x22')]=_['isNil'](_0xea5748[_0xc5fd('0xa')])?_0xea5748['UserId']:_0xea5748[_0xc5fd('0xa')]['id'];this[_0xc5fd('0x23')]=_0xea5748[_0xc5fd('0x23')];this[_0xc5fd('0x24')]='';this['originatecalleridname']='';}Action[_0xc5fd('0x25')][_0xc5fd('0x26')]=function(){return util[_0xc5fd('0x27')](_0xc5fd('0x28'),this[_0xc5fd('0xb')],this[_0xc5fd('0x29')]);};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 3e1e3e5..b4c9ba4 100644 --- a/server/services/ami/preview/index.js +++ b/server/services/ami/preview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','format','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialMethod','booked','type','outbound','dialActive','setMessage','recallMe','clearZombieChannel','sequence','isNil','Queue','queue','originated:\x20','stringify','pick','UserId','VoiceQueueId','ListId','channel','message','No\x20such\x20channel','dialAnswer','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','size','getContactRecallMe','then','length','getDiff','scheduledat','Agent','voicePause','run','[RecallMe]','catch','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[getContactRecallMe]','IsNotLoggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','UNREACHABLE_TRUNK','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','cloneAction','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','activeContact','linkedid','idContact','incrementPreviewCounters','ANSWER','answertime','[syncHangup][talking][increment]','pTalking:\x20','custom:agentconnect','connect','acw','mandatoryDisposition','custom:agentConnectPreview','channelAgent','uniqueid','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','\x20Queue','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','unlockAgent','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','swapAdditionalPhones','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','countmachineretry','cause-txt','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','status','reachable','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','Trunk','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variables','variablesAction','Action','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','response','rejected','Answer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncHangupRequest','addVariable','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','../dialer/utils','redis','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncDialEnd','syncNewExten'];(function(_0x1a60f3,_0x507b6b){var _0x28ad4d=function(_0x23747d){while(--_0x23747d){_0x1a60f3['push'](_0x1a60f3['shift']());}};_0x28ad4d(++_0x507b6b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var uuid=require(_0x0a9e('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));var logger=require('../../../config/logger')(_0x0a9e('0x4'));var loggerAction=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var ami=require(_0x0a9e('0x7'));var rpcDb=require(_0x0a9e('0x8'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x0a9e('0x9'));var ut=require(_0x0a9e('0xa'));var utils=require(_0x0a9e('0xb'));config['redis']=_['defaults'](config[_0x0a9e('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0xc')]));var Sequence=function(){};Sequence[_0x0a9e('0xd')][_0x0a9e('0xe')]=function(_0x3ab53f){this[_0x0a9e('0xf')]=this[_0x0a9e('0xf')]?this['tail']['finally'](_0x3ab53f):_0x3ab53f();};function Preview(_0x527cdd){this['sequence']=new Sequence();this[_0x0a9e('0x10')]=_0x527cdd[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x527cdd[_0x0a9e('0x12')];this[_0x0a9e('0x13')]={};this[_0x0a9e('0x14')]=_0x527cdd['agents'];this[_0x0a9e('0x15')]=0x0;ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x19'),this[_0x0a9e('0x1a')]['bind'](this));ami['on'](_0x0a9e('0x1b'),this['syncHangupRequest'][_0x0a9e('0x18')](this));ami['on']('dialend',this[_0x0a9e('0x1c')][_0x0a9e('0x18')](this));ami['on']('newexten',this[_0x0a9e('0x1d')]['bind'](this));ami['on'](_0x0a9e('0x1e'),this[_0x0a9e('0x1f')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x20'),this[_0x0a9e('0x21')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x22'),this[_0x0a9e('0x23')][_0x0a9e('0x18')](this));this[_0x0a9e('0x24')](this[_0x0a9e('0x10')]);}function emit(_0x105080,_0x4bb1e3,_0x2c3407){io['to'](_0x105080)[_0x0a9e('0x25')](_0x4bb1e3,_0x2c3407);}function emitVoiceQueueChannelRemove(_0x53682f){logger[_0x0a9e('0x26')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x53682f));emit(util[_0x0a9e('0x27')](_0x0a9e('0x28'),_0x53682f[_0x0a9e('0x29')]),_0x0a9e('0x2a'),_0x53682f);io['emit'](_0x0a9e('0x2b'),_0x53682f);}function notSendMessagesQueue(_0x2fb0e4){if(_0x2fb0e4[_0x0a9e('0x2c')]){if(_0x2fb0e4[_0x0a9e('0x2d')]===0x0&&_0x2fb0e4[_0x0a9e('0x2e')]===0x0){_0x2fb0e4[_0x0a9e('0x2c')]=![];_0x2fb0e4[_0x0a9e('0x2f')]=0x0;_0x2fb0e4['paused']=0x0;_0x2fb0e4['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4['name']+_0x0a9e('0x34'));}else{_0x2fb0e4['message']=utils[_0x0a9e('0x30')]['DEACTIVATED'];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4[_0x0a9e('0x29')]+_0x0a9e('0x35'));}}}Preview[_0x0a9e('0xd')][_0x0a9e('0x24')]=function(){var _0x11c3b6=this;setInterval(function(){_0x11c3b6[_0x0a9e('0x36')]();},0x7cf);};Preview['prototype'][_0x0a9e('0x36')]=function(){var _0x468813=this[_0x0a9e('0x10')];this[_0x0a9e('0x15')]+=0x1;for(var _0x5c877d in _0x468813){if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&(_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x4')||_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x39'))&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(this[_0x0a9e('0x15')]>0x7){this[_0x0a9e('0x15')]=0x0;this['clearZombieChannels']();}}if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&_0x468813[_0x5c877d]['dialMethod']===_0x0a9e('0x4')&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(_0x468813[_0x5c877d][_0x0a9e('0x3c')]){this[_0x0a9e('0x3d')](_0x468813[_0x5c877d]);if(_0x468813[_0x5c877d]['dialPreviewAutoRecallMe'])this[_0x0a9e('0x3e')](_0x468813[_0x5c877d]);}else{notSendMessagesQueue(_0x468813[_0x5c877d]);}}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3f')]=function(_0x2da5c0){var _0x2b45ea=this;this[_0x0a9e('0x40')][_0x0a9e('0xe')](function(){if(!_[_0x0a9e('0x41')](_0x2b45ea['actions'][_0x2da5c0])){loggerAction[_0x0a9e('0x26')]('[clearZombieChannels][talking]',_0x2da5c0,_0x0a9e('0x42'),_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')],_0x0a9e('0x44'),JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2d')]),'pTalking:\x20',JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea['actions'][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2e')]),JSON[_0x0a9e('0x45')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]['dialAnswer']),JSON[_0x0a9e('0x45')](_[_0x0a9e('0x46')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0],['contactId',_0x0a9e('0x47'),_0x0a9e('0x48'),_0x0a9e('0x49')])));return ami['Action']({'action':'status','channel':_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4a')]})['catch'](function(_0x2b814e){if(_0x2b814e[_0x0a9e('0x4b')]===_0x0a9e('0x4c')){setTimeout(function(){if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]){ut['updateOriginated'](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],'[clearZombieChannel]');if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4d')]===!![]){ut[_0x0a9e('0x4e')](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],_0x0a9e('0x4f'));ut[_0x0a9e('0x50')](_0x0a9e('0x51')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);}ut[_0x0a9e('0x50')](_0x0a9e('0x52')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);delete _0x2b45ea[_0x0a9e('0x13')][_0x2da5c0];}},0x2328);}});}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x53')]=function(){var _0x37f6cc=this;loggerAction['info']('[action]',_[_0x0a9e('0x54')](this[_0x0a9e('0x13')]));for(var _0x405c8f in this[_0x0a9e('0x13')]){if(_0x37f6cc[_0x0a9e('0x13')][_0x0a9e('0x37')](_0x405c8f)){_0x37f6cc[_0x0a9e('0x3f')](_0x405c8f);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3e')]=function(_0x25c6e6){var _0x2c2cb0=this;rpcDb[_0x0a9e('0x55')](_0x25c6e6['id'],ut['agentReadyId'](this[_0x0a9e('0x14')]))[_0x0a9e('0x56')](function(_0xdd268f){if(!_[_0x0a9e('0x41')](_0xdd268f)){for(var _0x2e8caf=0x0;_0x2e8caf<_0xdd268f[_0x0a9e('0x57')];_0x2e8caf+=0x1){if(ut[_0x0a9e('0x58')](_0xdd268f[_0x2e8caf][_0x0a9e('0x59')])<_0x25c6e6['dialRecallMeTimeout']*0x3c){if(_0xdd268f[_0x2e8caf][_0x0a9e('0x5a')]&&!_0xdd268f[_0x2e8caf]['Agent'][_0x0a9e('0x5b')]){_0x2c2cb0[_0x0a9e('0x5c')](_0xdd268f[_0x2e8caf]['id'])[_0x0a9e('0x56')](ut['logger2'](_0x0a9e('0x5d')))[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x5d')));}else{rpcDb[_0x0a9e('0x60')](_0xdd268f[_0x2e8caf]['id']);}}else{var _0x37be73=new Action(_0xdd268f[_0x2e8caf],_0x25c6e6);_0x37be73[_0x0a9e('0x61')]=moment()['format'](_0x0a9e('0x62'));_0x25c6e6[_0x0a9e('0x63')]+=0x1;ut[_0x0a9e('0x64')](_0x37be73,0x17,_0x0a9e('0x65'));if(_0x25c6e6[_0x0a9e('0x66')]){rpcDb[_0x0a9e('0x67')](ut[_0x0a9e('0x68')](_0xdd268f[_0x2e8caf]));rpcDb[_0x0a9e('0x69')](_0x37be73,_0x0a9e('0x6a'));}else{ut['logCustomer'](_0x37be73,0x16,_0x0a9e('0x6b'));rpcDb[_0x0a9e('0x69')](_0x37be73,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x37be73,'[HistoryRecallClose]');}}}}})[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x6c')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x3d')]=function(_0x30decb){_0x30decb[_0x0a9e('0x2c')]=!![];if(ut[_0x0a9e('0x6d')](_0x30decb['loggedIn'])){_0x30decb['message']=utils['CAMPAIGN_STATUS'][_0x0a9e('0x6e')];}else if(!ut[_0x0a9e('0x6f')](_0x30decb[_0x0a9e('0x3c')])){_0x30decb['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];}else if(!this['isTrunkReachable'](_0x30decb['Trunk'])){if(!this[_0x0a9e('0x70')](_0x30decb['TrunkBackup'])){_0x30decb[_0x0a9e('0x4b')]=utils['CAMPAIGN_STATUS'][_0x0a9e('0x71')];}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}};Preview['prototype'][_0x0a9e('0x72')]=function(_0x3aedd0,_0x49c095,_0x145931){var _0x5ce9ac=this;var _0x211ef9=this['actions'][_0x49c095];var _0xe22ccc=this['campaignsPreview'][_0x211ef9['queue']];var _0x5df0ad;var _0x2da03c=![];var _0x47de4c=0x2;var _0x2f7092=0x3;if(_0xe22ccc){switch(_0x145931){case'1':_0xe22ccc[_0x0a9e('0x73')]+=0x1;_0x211ef9[_0x0a9e('0x74')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x0,_0x0a9e('0x77'));ami[_0x0a9e('0x25')]('custom:agentnosuchnumber',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x79')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0x7a'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'0',_0xe22ccc)[_0x0a9e('0x56')](function(_0x5d86e9){_0x2da03c=_0x5d86e9[_0x0a9e('0x7c')]==0x1;_0x47de4c=_0xe22ccc[_0x0a9e('0x7d')];_0x2f7092=_0xe22ccc['callAdditionalPhoneAfterMin'];if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc['dialGlobalMaxRetry']){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb['createCustomerFinal'](_0x5df0ad,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x211ef9[_0x0a9e('0x74')]>=_0xe22ccc['dialNoSuchNumberMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x80'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0x74'),_0xe22ccc[_0x0a9e('0x7d')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}delete this['actions'][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x211ef9[_0x0a9e('0x74')]++;logger[_0x0a9e('0x26')]('actioncountonusuch',_0x211ef9[_0x0a9e('0x74')]);logger[_0x0a9e('0x26')]('id',_0x211ef9[_0x0a9e('0x85')]);_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnosuchnumberretry':_0x211ef9[_0x0a9e('0x74')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0x87'):var _0x88dcbf=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x211ef9['responsetime']=_0x88dcbf;_0x211ef9[_0x0a9e('0x88')]=_0x88dcbf;_0x211ef9[_0x0a9e('0x4d')]=!![];_0xe22ccc[_0x0a9e('0x2e')]+=0x1;logger['info'](_0x0a9e('0x89'),_0x211ef9['uniqueid'],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0xe22ccc[_0x0a9e('0x2e')]);ami[_0x0a9e('0x25')](_0x0a9e('0x8b'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x8c'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));if(_0xe22ccc[_0x0a9e('0x8d')]||_0xe22ccc[_0x0a9e('0x8e')]){ami[_0x0a9e('0x25')](_0x0a9e('0x8f'),{'queue':_0x211ef9[_0x0a9e('0x43')],'interface':_0x211ef9[_0x0a9e('0x90')],'uniqueid':_0x211ef9[_0x0a9e('0x91')]});}break;case'16':ami[_0x0a9e('0x25')](_0x0a9e('0x92'),ut['buildObj'](_0x211ef9,_0x0a9e('0x93'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x211ef9,_0x0a9e('0x93')));_0xe22ccc[_0x0a9e('0x94')]+=0x1;_0xe22ccc['total']+=0x1;_0xe22ccc[_0x0a9e('0x95')]+=0x1;ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0x96'));_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x4,'Answer');rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0x97'));rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x98'));rpcDb[_0x0a9e('0x99')](_0x211ef9);_0xe22ccc[_0x0a9e('0x9a')]+=_0x211ef9[_0x0a9e('0x9b')];_0xe22ccc[_0x0a9e('0x9c')]+=_0x211ef9[_0x0a9e('0x9b')];logger['info'](_0x0a9e('0x9d'),_0x211ef9[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0xe22ccc['name'],_0x0a9e('0x8a'),_0xe22ccc['pTalking']);delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'BUSY':_0xe22ccc[_0x0a9e('0x9f')]+=0x1;_0x211ef9[_0x0a9e('0xa0')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x5,_0x0a9e('0xa1'));_0x47de4c=_0xe22ccc[_0x0a9e('0xa2')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')]('custom:agentbusy',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xa4')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xa5'));_0x5ce9ac['verifyAdditionalPhones'](_0x211ef9,'5',_0xe22ccc)[_0x0a9e('0x56')](function(_0x3511c9){_0x2da03c=_0x3511c9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xa8'));}else{if(_0x211ef9[_0x0a9e('0xa0')]>=_0xe22ccc[_0x0a9e('0xa9')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xa5'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xa0'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xa0')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countbusyretry':_0x211ef9[_0x0a9e('0xa0')]}})['then'](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xab'):_0xe22ccc['outboundNoAnswerCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xac')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x3,'NoAnswer');_0x47de4c=_0xe22ccc[_0x0a9e('0xad')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];var _0x2d2286=ut[_0x0a9e('0xae')](_0x211ef9,_0xe22ccc);ami[_0x0a9e('0x25')](_0x0a9e('0xaf'),_0x2d2286);rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logNoAnswer]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'3',_0xe22ccc)[_0x0a9e('0x56')](function(_0x45c109){_0x2da03c=_0x45c109[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x211ef9[_0x0a9e('0xac')]>=_0xe22ccc[_0x0a9e('0xb0')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xb1'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xac'),_0xe22ccc[_0x0a9e('0xad')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'CONGESTION':_0xe22ccc[_0x0a9e('0xb2')]+=0x1;_0x211ef9[_0x0a9e('0xb3')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x8,_0x0a9e('0xb4'));_0x47de4c=_0xe22ccc['dialCongestionRetryFrequency'];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami['emit'](_0x0a9e('0xb5'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xb6')));rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logCongestion]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'8',_0xe22ccc)[_0x0a9e('0x56')](function(_0x1d4877){_0x2da03c=_0x1d4877['additional']==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xb7'));}else{if(_0x211ef9[_0x0a9e('0xb3')]>=_0xe22ccc[_0x0a9e('0xb8')]){rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xb9'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xb3'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xb3')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countcongestionretry':_0x211ef9[_0x0a9e('0xb3')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xbb'):_0xe22ccc[_0x0a9e('0xbc')]+=0x1;_0x211ef9[_0x0a9e('0xbd')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x14,_0x0a9e('0xbe'));_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')](_0x0a9e('0xc0'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xc1')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc2'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)[_0x0a9e('0x56')](function(_0x4989f9){_0x2da03c=_0x4989f9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x14,_0x0a9e('0xbe'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xc3'));}else{if(_0x211ef9[_0x0a9e('0xbd')]>=_0xe22ccc['dialAgentRejectMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0xbd'),_0xe22ccc[_0x0a9e('0xbf')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case'ABANDONED':_0xe22ccc['outboundAbandonedCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc4')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xb,_0x0a9e('0xc5'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc6'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'11',_0xe22ccc)[_0x0a9e('0x56')](function(_0x586510){_0x2da03c=_0x586510[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xc6'));}else{if(_0x211ef9['countabandonedetry']>=_0xe22ccc[_0x0a9e('0xc7')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xc6'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,'countabandonedretry',_0xe22ccc['dialAbandonedRetryFrequency']),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'18':_0xe22ccc['outboundUnknownCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc8')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x12,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0['dialstatus']);ami['emit'](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xcb'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2eb028){_0x2da03c=_0x2eb028['additional']==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x12,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xcb'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xcb'));}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'19':_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x13,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);ami[_0x0a9e('0x25')](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0xce'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2fea95){_0x2da03c=_0x2fea95[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xce'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xce'));}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})['then'](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;default:if(_0x211ef9[_0x0a9e('0x4d')]){ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0xcf'));ut[_0x0a9e('0x50')](_0x0a9e('0xd0')+_0xe22ccc[_0x0a9e('0x29')],_0x3aedd0);}_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xc,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];rpcDb['createCustomerHistory'](_0x211ef9,'[callProgressDetectingCustomer][logUnknown]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)['then'](function(_0x1d999b){_0x2da03c=_0x1d999b[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xd1'));}delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});}});}if(!(_0x211ef9[_0x0a9e('0x4d')]&&_0x145931==='16')){ut[_0x0a9e('0xd2')](_0xe22ccc,'[callProgressDetectingCustomer]');logger[_0x0a9e('0x26')](_0x0a9e('0xd3'),_0x211ef9[_0x0a9e('0x91')],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x44'),_0xe22ccc[_0x0a9e('0x2d')]);}if(_0x145931!==_0x0a9e('0x87')){delete this[_0x0a9e('0x13')][_0x3aedd0['linkedid']];delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0xd4')]];}_0xe22ccc['queueSummaryCountersUpdated']=!![];}};Preview[_0x0a9e('0xd')][_0x0a9e('0xd5')]=function(_0x1f6f1c,_0x5822a7,_0x5c3b6f){if(_['isUndefined'](_0x5822a7)&&_0x0a9e('0xd6')!==typeof _0x5822a7){return;}if(_[_0x0a9e('0xd7')](_0x5c3b6f)&&'object'!==typeof _0x5c3b6f){return;}switch(_0x5c3b6f[_0x0a9e('0xd8')]){case'0':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x0,_0x0a9e('0x77'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xda'));break;case'3':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x3,_0x0a9e('0xdb'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdd'));break;case'5':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x5,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xde'));break;case'8':ut['logAgent'](_0x1f6f1c,0x8,_0x0a9e('0xb4'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xdf'));break;case'22':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x16,_0x0a9e('0xe0'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xe1'));break;default:ut[_0x0a9e('0xd9')](_0x1f6f1c,0xc,_0x5c3b6f['reason']);rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdf'));}ut[_0x0a9e('0xd2')](_0x5822a7,_0x0a9e('0xe2'));logger['info'](_0x0a9e('0xe3'),_0x1f6f1c[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0x5822a7[_0x0a9e('0x29')],_0x0a9e('0x44'),_0x5822a7[_0x0a9e('0x2d')]);delete this[_0x0a9e('0x13')][_0x1f6f1c[_0x0a9e('0x91')]];};Preview[_0x0a9e('0xd')][_0x0a9e('0x7b')]=function(_0x57f0ad,_0x2272bc,_0x88b25f){return cmHopperAdditionalPhone[_0x0a9e('0x7b')](_0x57f0ad,_0x2272bc,_0x88b25f)[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')](_0x0a9e('0xe4')));};Preview[_0x0a9e('0xd')][_0x0a9e('0xba')]=function(_0x566b90,_0x3b581c,_0xd2391){return cmHopperAdditionalPhone[_0x0a9e('0xba')](_0x566b90,_0x3b581c,_0xd2391)['catch'](logger[_0x0a9e('0x26')](_0x0a9e('0xe5')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x86')]=function(_0x370b5e){return Promise[_0x0a9e('0xe6')]()[_0x0a9e('0x56')](cmHopperAdditionalPhone[_0x0a9e('0x86')](_0x370b5e))[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')]('[incrementPreviewCounters]\x20'));};Preview[_0x0a9e('0xd')][_0x0a9e('0xe7')]=function(_0x15a9ed,_0x3db98f,_0x2b624e,_0x3942fd,_0x5cb48d){var _0x382687=this;return new Promise(function(_0x4f854b,_0x5bd139){if(_['isNil'](_0x3db98f)||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe8')])||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe9')])||_['isNil'](_0x3db98f[_0x0a9e('0x48')])){_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xea'),_0x3942fd,_0x5cb48d));return;}var _0x1fdb10=uuid['v4']();var _0x2c8d1d=_0x382687['campaignsPreview'][_0x3db98f['Queue'][_0x0a9e('0x29')]];var _0x33bcb2=_0x2b624e?_0x382687[_0x0a9e('0x14')][_0x2b624e]['id']:undefined;_0x382687['actions'][_0x1fdb10]=new Action(_0x3db98f,_0x2c8d1d,_0x1fdb10,_0x2b624e,_0x33bcb2);var _0x319752=_0x382687[_0x0a9e('0x13')][_0x1fdb10];_0x319752[_0x0a9e('0xaa')]=_0x3942fd;_0x319752['activeContact']=_0x5cb48d;_0x319752[_0x0a9e('0xeb')]=_0x2b624e;if(_[_0x0a9e('0xec')](_0x15a9ed)){_0x382687[_0x0a9e('0xed')](_0x319752,_0x2c8d1d,_0x3db98f,_0x2b624e)['then'](function(_0x272291){logger[_0x0a9e('0x26')](_0x0a9e('0xee'),'Queue:\x20'+_0x319752['queue']+'\x20IdHopper:\x20'+_0x319752[_0x0a9e('0x85')],JSON[_0x0a9e('0x45')](_0x272291));ami[_0x0a9e('0x25')](_0x0a9e('0xef'),ut['buildObj'](_0x319752,_0x0a9e('0xf0'),_0x382687['campaignsPreview'][_0x319752[_0x0a9e('0x43')]]));_0x4f854b(ut[_0x0a9e('0x4b')](_0x0a9e('0xf1')));})['catch'](function(_0x33b4b3){ut[_0x0a9e('0x32')](_0x0a9e('0xf2'),_0x33b4b3);_0x5bd139(ut['message'](_0x0a9e('0xf3'),_0x3942fd,_0x5cb48d));});}else{_0x2c8d1d['outboundBlacklistCallsDay']+=0x1;ut[_0x0a9e('0xf4')](_0x319752);rpcDb['createHistory'](_0x319752,_0x0a9e('0xf5'));delete _0x382687['actions'][_0x1fdb10];_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xf6'),_0x3942fd,_0x5cb48d));}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x70')]=function(_0x1e306c){return!_[_0x0a9e('0x41')](_0x1e306c)&&!_[_0x0a9e('0x41')](_0x1e306c['name'])&&!_[_0x0a9e('0x41')](_0x1e306c[_0x0a9e('0xf7')])&&_0x1e306c['active']&&!_[_0x0a9e('0x41')](this[_0x0a9e('0x12')][util['format'](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])])&&!_[_0x0a9e('0x41')](this['trunks'][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')])&&(this[_0x0a9e('0x12')][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfa')||this['trunks'][util[_0x0a9e('0x27')]('SIP/%s',_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfb'));};Preview[_0x0a9e('0xd')][_0x0a9e('0x5c')]=function(_0x2d45db,_0x5691ac){return this[_0x0a9e('0xfc')](_0x2d45db,_0x5691ac)[_0x0a9e('0x56')](function(_0x2977a7){return _['pick'](_0x2977a7,[_0x0a9e('0x4b')]);})[_0x0a9e('0x5e')](function(_0x4435d2){if(_0x4435d2[_0x0a9e('0xfd')]){rpcDb[_0x0a9e('0xfe')](_0x2d45db);}if(_0x4435d2[_0x0a9e('0xf7')]){rpcDb[_0x0a9e('0x60')](_0x2d45db);}throw _['pick'](_0x4435d2,[_0x0a9e('0x4b')]);});};Preview[_0x0a9e('0xd')][_0x0a9e('0xfc')]=function(_0x2ce3be,_0x3de77e){var _0x241404=this;var _0x8120e,_0x5d6a48;return rpcDb['getContactPreview'](_0x2ce3be)[_0x0a9e('0x56')](function(_0x3f507c){if(!_[_0x0a9e('0x41')](_0x3f507c[0x0])){_0x5d6a48=_0x3f507c[0x0][_0x0a9e('0xff')]?![]:!![];_0x8120e=_0x3f507c[0x0][_0x0a9e('0xff')]?!![]:![];_0x8120e=_0x3de77e?!![]:_0x8120e;}var _0x131da8=_0x241404[_0x0a9e('0x100')](_0x3f507c);if(_0x131da8['isValid']){rpcDb[_0x0a9e('0x101')](_[_0x0a9e('0x46')](_0x3f507c[0x0],[_0x0a9e('0x48'),_0x0a9e('0xe9')]))[_0x0a9e('0x56')](function(_0x3c6082){_0x241404[_0x0a9e('0xe7')](_0x3c6082,_0x3f507c[0x0],_0x3de77e,_0x5d6a48,_0x8120e)['then'](function(_0x311288){return _0x311288;})[_0x0a9e('0x5e')](function(_0x231826){throw _0x231826;});})['catch'](function(_0x2b8ad4){ut[_0x0a9e('0x32')](_0x0a9e('0x102'),_0x2b8ad4);throw ut[_0x0a9e('0x4b')]('Call\x20unsuccessful',_0x5d6a48,_0x8120e);});}else{throw ut[_0x0a9e('0x4b')](_0x131da8[_0x0a9e('0x4b')],_0x5d6a48,_0x8120e);}})[_0x0a9e('0x5e')](function(_0x93d953){ut[_0x0a9e('0x32')](_0x0a9e('0x103'),_0x93d953);throw ut[_0x0a9e('0x4b')](_0x0a9e('0x104'),![],!![]);});};Preview['prototype'][_0x0a9e('0x100')]=function(_0x266aa1){if(_[_0x0a9e('0x41')](_0x266aa1)||_[_0x0a9e('0xec')](_0x266aa1)||!_['isNil'](_0x266aa1[0x0]['Agent'])&&_[_0x0a9e('0x41')](_0x266aa1[0x0][_0x0a9e('0x5a')][_0x0a9e('0x29')])){ut['logger'](_0x0a9e('0x105'),_0x266aa1);return{'isValid':![],'message':_0x0a9e('0x106')};}var _0x4d8a67=this[_0x0a9e('0x10')][_0x266aa1[0x0]['Queue'][_0x0a9e('0x29')]];_0x4d8a67['message']=utils['CAMPAIGN_STATUS']['ACTIVE'];if(_[_0x0a9e('0x41')](_0x4d8a67)){ut[_0x0a9e('0x32')](_0x0a9e('0x107'),_0x4d8a67);return{'isValid':![],'message':_0x0a9e('0x108')};}if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x109')])){ut['logger'](_0x0a9e('0x10a'),_0x0a9e('0x10b')+_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x10c'));if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x10d')])){ut[_0x0a9e('0x32')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x4d8a67['name']+_0x0a9e('0x10e'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x0a9e('0x6f')](_0x4d8a67[_0x0a9e('0x3c')])){ut[_0x0a9e('0x32')](_0x0a9e('0x10f'),_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x110'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x4d8a67[_0x0a9e('0x29')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x0a9e('0xd')]['execCall']=function(_0x38dceb,_0x5dc978,_0x550cbf,_0x26223f){var _0x4a7a3c=this;return new Promise(function(_0x24470a,_0x142e53){var _0xe1ab0d=_0x38dceb['uniqueid'];var _0x4152cd=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?util['format']('SIP/%s/%s%s',_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978[_0x0a9e('0x111')][_0x0a9e('0x112')]()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')][_0x0a9e('0x114')](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf['phone']):util['format']('SIP/%s/%s%s',_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978['dialPrefix']['trim']()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')]['substring'](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf[_0x0a9e('0xe9')]);var _0x2e2280=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?ut[_0x0a9e('0x115')](_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978[_0x0a9e('0x11a')]):ut[_0x0a9e('0x115')](_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978['dialOriginateCallerIdNumber']);if(_0x2e2280){_0x38dceb[_0x0a9e('0x11b')]=ut[_0x0a9e('0x11c')](_0x2e2280);_0x38dceb[_0x0a9e('0x11d')]=ut[_0x0a9e('0x11e')](_0x2e2280);}var _0x33359a=ut[_0x0a9e('0x11f')](_0x5dc978,_0x550cbf,_0x4152cd,_0x2e2280,_0xe1ab0d,_0x38dceb);var _0xa8b5de=utils['setXMDContactVariables'](_0x550cbf[_0x0a9e('0xe8')]);Object['assign'](_0x33359a,_0xa8b5de);_[_0x0a9e('0x120')](_0x38dceb,ut[_0x0a9e('0x121')](_0x33359a));_0x38dceb[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x5dc978[_0x0a9e('0x122')]=_0x33359a;var _0x465003=ut[_0x0a9e('0x123')](_0x38dceb,_0x5dc978,_0x33359a,_0x38dceb[_0x0a9e('0x83')],_0x26223f);return ami[_0x0a9e('0x124')](_0x465003)[_0x0a9e('0x56')](function(_0x8231e5){_0x5dc978[_0x0a9e('0x2d')]+=0x1;logger[_0x0a9e('0x26')](_0x0a9e('0x125'),_0xe1ab0d,_0x0a9e('0x9e'),_0x5dc978['name'],'originated:\x20',_0x5dc978[_0x0a9e('0x2d')]);_0x24470a(_0x8231e5);})[_0x0a9e('0x5e')](function(_0x52b365){ut['logAgent'](_0x38dceb,0xe,_0x0a9e('0x126'));rpcDb[_0x0a9e('0xdc')](_0x38dceb,_0x0a9e('0x127'));_0x142e53(_0x52b365);});});};Preview['prototype'][_0x0a9e('0x1d')]=function(_0x5b6447){if(this[_0x0a9e('0x13')][_0x5b6447['linkedid']]){this[_0x0a9e('0x13')][_0x5b6447['linkedid']][_0x0a9e('0x4a')]=_0x5b6447[_0x0a9e('0x4a')];}};Preview[_0x0a9e('0xd')]['syncOriginateResponse']=function(_0x316b51){var _0x497fda=this;var _0x505ffd=this[_0x0a9e('0x13')][_0x316b51[_0x0a9e('0x128')]];if(_0x505ffd){if(_0x505ffd[_0x0a9e('0xeb')]&&this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]){ut[_0x0a9e('0x129')](_0x505ffd,this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]][_0x0a9e('0x29')],this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]['id']);}var _0x98bf26=_[_0x0a9e('0x12a')](_0x505ffd);_0x98bf26[_0x0a9e('0x12b')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));var _0x310026=_0x497fda[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]];if(ut['isFailure'](_0x316b51[_0x0a9e('0x12c')])){if(_0x505ffd[_0x0a9e('0xaa')]){rpcDb[_0x0a9e('0xfe')](_0x505ffd[_0x0a9e('0x85')]);}if(_0x505ffd['activeContact']){rpcDb['disableContact'](_0x505ffd['idContact']);}ami[_0x0a9e('0x25')]('custom:agentringnoanswer',ut[_0x0a9e('0x78')](_0x505ffd,_0x0a9e('0x12d'),this[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]]));this[_0x0a9e('0xd5')](_0x98bf26,_0x310026,_0x316b51);}else{_0x505ffd[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));ut[_0x0a9e('0xd9')](_0x98bf26,0x4,_0x0a9e('0x12e'));rpcDb['createAgentHistory'](_0x98bf26,_0x0a9e('0x12f'));}}};Preview['prototype'][_0x0a9e('0x1a')]=function(_0x586d2f){var _0xf4de86=this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]];var _0x556bb7;if(_0xf4de86){_0x556bb7=this[_0x0a9e('0x10')][_0xf4de86[_0x0a9e('0x43')]];logger['info']('[syncHangup][talking]',_0x586d2f[_0x0a9e('0x84')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],'pTalking:\x20',_0x556bb7['pTalking']);}if(this['actions'][_0x586d2f[_0x0a9e('0x84')]]&&_0x586d2f[_0x0a9e('0x84')]!==_0x586d2f[_0x0a9e('0x91')]){if(_0x586d2f[_0x0a9e('0x130')]==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')](_0x0a9e('0x131'),_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}}else if(_0xf4de86&&_[_0x0a9e('0x41')](_0xf4de86['statedesc'])&&_0x556bb7[_0x0a9e('0x132')]&&_0x586d2f[_0x0a9e('0x84')]===_0x586d2f[_0x0a9e('0x91')]&&_[_0x0a9e('0x41')](_0x586d2f[_0x0a9e('0xd8')])&&_0x586d2f[_0x0a9e('0x130')]==='16'&&_0x586d2f[_0x0a9e('0x133')]==='6'&&_[_0x0a9e('0xd7')](_0xf4de86[_0x0a9e('0x134')])){if(_0xf4de86['unlockAgent']){rpcDb['unlockContact'](_0xf4de86[_0x0a9e('0x85')]);}if(_0xf4de86[_0x0a9e('0x83')]){rpcDb['disableContact'](_0xf4de86[_0x0a9e('0x85')]);}_0x586d2f[_0x0a9e('0xd8')]='22';this['callProgressDetectingAgent'](_0xf4de86,_0x556bb7,_0x586d2f);}else if(_0xf4de86&&_0xf4de86[_0x0a9e('0x134')]){if(_0x586d2f['cause']==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]]['dialAnswer']){logger[_0x0a9e('0x26')](_0x0a9e('0x135'),_0x586d2f['linkedid'],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f['linkedid']][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')]('[syncHangup][talking][cause]',_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f['linkedid'],_0x586d2f['cause']);}}};Preview['prototype']['syncDialEnd']=function(_0x5e9817){if(this[_0x0a9e('0x13')][_0x5e9817[_0x0a9e('0xd4')]]&&_0x5e9817['destlinkedid']!==_0x5e9817['destuniqueid']){this[_0x0a9e('0x72')](_0x5e9817,_0x5e9817['destlinkedid'],_0x5e9817[_0x0a9e('0xcd')]);}};Preview[_0x0a9e('0xd')][_0x0a9e('0x136')]=function(_0x175c97){if(this[_0x0a9e('0x13')][_0x175c97[_0x0a9e('0x84')]]&&_0x175c97['linkedid']!==_0x175c97[_0x0a9e('0x91')]&&!this[_0x0a9e('0x13')][_0x175c97['linkedid']][_0x0a9e('0x4d')]){if(_0x175c97[_0x0a9e('0x130')]==='1'){this[_0x0a9e('0x72')](_0x175c97,_0x175c97[_0x0a9e('0x84')],_0x175c97[_0x0a9e('0x130')]);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x137')]=function(_0x4a36df,_0x331216,_0x508395){if(this[_0x0a9e('0x13')][_0x4a36df]){if(_[_0x0a9e('0x41')](this['actions'][_0x4a36df][_0x0a9e('0x122')])){this[_0x0a9e('0x13')][_0x4a36df]['variables']={};}this[_0x0a9e('0x13')][_0x4a36df]['variables'][_0x331216]=_0x508395;}};Preview[_0x0a9e('0xd')][_0x0a9e('0x1f')]=function(_0x5d0620){try{if(!_[_0x0a9e('0x41')](_0x5d0620)){if(ut['filterKey'](_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0])){this[_0x0a9e('0x137')](_0x5d0620[_0x0a9e('0x91')],_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0],_0x5d0620[_0x0a9e('0x13a')]);}}}catch(_0x53b5c2){logger[_0x0a9e('0x13b')](_0x0a9e('0x13c'),util[_0x0a9e('0x13d')](_0x53b5c2,{'showHidden':![],'depth':null}));}};Preview[_0x0a9e('0xd')][_0x0a9e('0x21')]=function(_0x5932ad){if(_0x5932ad){if(this[_0x0a9e('0x13')][_0x5932ad['transfertargetlinkedid']]){this['actions'][_0x5932ad[_0x0a9e('0x13e')]]['transfer']=!![];}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x23')]=function(_0x58d5fd){if(_0x58d5fd){if(this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]]){this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]][_0x0a9e('0x134')]=!![];}}};module[_0x0a9e('0x140')]=Preview; \ No newline at end of file +var _0xa9e0=['varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','format','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialMethod','booked','type','outbound','dialActive','setMessage','recallMe','clearZombieChannel','sequence','isNil','Queue','queue','originated:\x20','stringify','pick','UserId','VoiceQueueId','ListId','channel','message','No\x20such\x20channel','dialAnswer','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','size','getContactRecallMe','then','length','getDiff','scheduledat','Agent','voicePause','run','[RecallMe]','catch','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[getContactRecallMe]','IsNotLoggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','UNREACHABLE_TRUNK','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','cloneAction','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','activeContact','linkedid','idContact','incrementPreviewCounters','ANSWER','answertime','[syncHangup][talking][increment]','pTalking:\x20','custom:agentconnect','connect','acw','mandatoryDisposition','custom:agentConnectPreview','channelAgent','uniqueid','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','\x20Queue','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','unlockAgent','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','swapAdditionalPhones','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','countmachineretry','cause-txt','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','status','reachable','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','Trunk','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variables','variablesAction','Action','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','response','rejected','Answer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncHangupRequest','addVariable','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','../dialer/utils','redis','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncDialEnd','syncNewExten'];(function(_0x580278,_0x35fa8c){var _0x3fbb8a=function(_0x3b78a4){while(--_0x3b78a4){_0x580278['push'](_0x580278['shift']());}};_0x3fbb8a(++_0x35fa8c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var uuid=require(_0x0a9e('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));var logger=require('../../../config/logger')(_0x0a9e('0x4'));var loggerAction=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var ami=require(_0x0a9e('0x7'));var rpcDb=require(_0x0a9e('0x8'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x0a9e('0x9'));var ut=require(_0x0a9e('0xa'));var utils=require(_0x0a9e('0xb'));config['redis']=_['defaults'](config[_0x0a9e('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0xc')]));var Sequence=function(){};Sequence[_0x0a9e('0xd')][_0x0a9e('0xe')]=function(_0x3ab53f){this[_0x0a9e('0xf')]=this[_0x0a9e('0xf')]?this['tail']['finally'](_0x3ab53f):_0x3ab53f();};function Preview(_0x527cdd){this['sequence']=new Sequence();this[_0x0a9e('0x10')]=_0x527cdd[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x527cdd[_0x0a9e('0x12')];this[_0x0a9e('0x13')]={};this[_0x0a9e('0x14')]=_0x527cdd['agents'];this[_0x0a9e('0x15')]=0x0;ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x19'),this[_0x0a9e('0x1a')]['bind'](this));ami['on'](_0x0a9e('0x1b'),this['syncHangupRequest'][_0x0a9e('0x18')](this));ami['on']('dialend',this[_0x0a9e('0x1c')][_0x0a9e('0x18')](this));ami['on']('newexten',this[_0x0a9e('0x1d')]['bind'](this));ami['on'](_0x0a9e('0x1e'),this[_0x0a9e('0x1f')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x20'),this[_0x0a9e('0x21')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x22'),this[_0x0a9e('0x23')][_0x0a9e('0x18')](this));this[_0x0a9e('0x24')](this[_0x0a9e('0x10')]);}function emit(_0x105080,_0x4bb1e3,_0x2c3407){io['to'](_0x105080)[_0x0a9e('0x25')](_0x4bb1e3,_0x2c3407);}function emitVoiceQueueChannelRemove(_0x53682f){logger[_0x0a9e('0x26')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x53682f));emit(util[_0x0a9e('0x27')](_0x0a9e('0x28'),_0x53682f[_0x0a9e('0x29')]),_0x0a9e('0x2a'),_0x53682f);io['emit'](_0x0a9e('0x2b'),_0x53682f);}function notSendMessagesQueue(_0x2fb0e4){if(_0x2fb0e4[_0x0a9e('0x2c')]){if(_0x2fb0e4[_0x0a9e('0x2d')]===0x0&&_0x2fb0e4[_0x0a9e('0x2e')]===0x0){_0x2fb0e4[_0x0a9e('0x2c')]=![];_0x2fb0e4[_0x0a9e('0x2f')]=0x0;_0x2fb0e4['paused']=0x0;_0x2fb0e4['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4['name']+_0x0a9e('0x34'));}else{_0x2fb0e4['message']=utils[_0x0a9e('0x30')]['DEACTIVATED'];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4[_0x0a9e('0x29')]+_0x0a9e('0x35'));}}}Preview[_0x0a9e('0xd')][_0x0a9e('0x24')]=function(){var _0x11c3b6=this;setInterval(function(){_0x11c3b6[_0x0a9e('0x36')]();},0x7cf);};Preview['prototype'][_0x0a9e('0x36')]=function(){var _0x468813=this[_0x0a9e('0x10')];this[_0x0a9e('0x15')]+=0x1;for(var _0x5c877d in _0x468813){if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&(_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x4')||_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x39'))&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(this[_0x0a9e('0x15')]>0x7){this[_0x0a9e('0x15')]=0x0;this['clearZombieChannels']();}}if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&_0x468813[_0x5c877d]['dialMethod']===_0x0a9e('0x4')&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(_0x468813[_0x5c877d][_0x0a9e('0x3c')]){this[_0x0a9e('0x3d')](_0x468813[_0x5c877d]);if(_0x468813[_0x5c877d]['dialPreviewAutoRecallMe'])this[_0x0a9e('0x3e')](_0x468813[_0x5c877d]);}else{notSendMessagesQueue(_0x468813[_0x5c877d]);}}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3f')]=function(_0x2da5c0){var _0x2b45ea=this;this[_0x0a9e('0x40')][_0x0a9e('0xe')](function(){if(!_[_0x0a9e('0x41')](_0x2b45ea['actions'][_0x2da5c0])){loggerAction[_0x0a9e('0x26')]('[clearZombieChannels][talking]',_0x2da5c0,_0x0a9e('0x42'),_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')],_0x0a9e('0x44'),JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2d')]),'pTalking:\x20',JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea['actions'][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2e')]),JSON[_0x0a9e('0x45')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]['dialAnswer']),JSON[_0x0a9e('0x45')](_[_0x0a9e('0x46')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0],['contactId',_0x0a9e('0x47'),_0x0a9e('0x48'),_0x0a9e('0x49')])));return ami['Action']({'action':'status','channel':_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4a')]})['catch'](function(_0x2b814e){if(_0x2b814e[_0x0a9e('0x4b')]===_0x0a9e('0x4c')){setTimeout(function(){if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]){ut['updateOriginated'](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],'[clearZombieChannel]');if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4d')]===!![]){ut[_0x0a9e('0x4e')](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],_0x0a9e('0x4f'));ut[_0x0a9e('0x50')](_0x0a9e('0x51')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);}ut[_0x0a9e('0x50')](_0x0a9e('0x52')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);delete _0x2b45ea[_0x0a9e('0x13')][_0x2da5c0];}},0x2328);}});}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x53')]=function(){var _0x37f6cc=this;loggerAction['info']('[action]',_[_0x0a9e('0x54')](this[_0x0a9e('0x13')]));for(var _0x405c8f in this[_0x0a9e('0x13')]){if(_0x37f6cc[_0x0a9e('0x13')][_0x0a9e('0x37')](_0x405c8f)){_0x37f6cc[_0x0a9e('0x3f')](_0x405c8f);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3e')]=function(_0x25c6e6){var _0x2c2cb0=this;rpcDb[_0x0a9e('0x55')](_0x25c6e6['id'],ut['agentReadyId'](this[_0x0a9e('0x14')]))[_0x0a9e('0x56')](function(_0xdd268f){if(!_[_0x0a9e('0x41')](_0xdd268f)){for(var _0x2e8caf=0x0;_0x2e8caf<_0xdd268f[_0x0a9e('0x57')];_0x2e8caf+=0x1){if(ut[_0x0a9e('0x58')](_0xdd268f[_0x2e8caf][_0x0a9e('0x59')])<_0x25c6e6['dialRecallMeTimeout']*0x3c){if(_0xdd268f[_0x2e8caf][_0x0a9e('0x5a')]&&!_0xdd268f[_0x2e8caf]['Agent'][_0x0a9e('0x5b')]){_0x2c2cb0[_0x0a9e('0x5c')](_0xdd268f[_0x2e8caf]['id'])[_0x0a9e('0x56')](ut['logger2'](_0x0a9e('0x5d')))[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x5d')));}else{rpcDb[_0x0a9e('0x60')](_0xdd268f[_0x2e8caf]['id']);}}else{var _0x37be73=new Action(_0xdd268f[_0x2e8caf],_0x25c6e6);_0x37be73[_0x0a9e('0x61')]=moment()['format'](_0x0a9e('0x62'));_0x25c6e6[_0x0a9e('0x63')]+=0x1;ut[_0x0a9e('0x64')](_0x37be73,0x17,_0x0a9e('0x65'));if(_0x25c6e6[_0x0a9e('0x66')]){rpcDb[_0x0a9e('0x67')](ut[_0x0a9e('0x68')](_0xdd268f[_0x2e8caf]));rpcDb[_0x0a9e('0x69')](_0x37be73,_0x0a9e('0x6a'));}else{ut['logCustomer'](_0x37be73,0x16,_0x0a9e('0x6b'));rpcDb[_0x0a9e('0x69')](_0x37be73,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x37be73,'[HistoryRecallClose]');}}}}})[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x6c')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x3d')]=function(_0x30decb){_0x30decb[_0x0a9e('0x2c')]=!![];if(ut[_0x0a9e('0x6d')](_0x30decb['loggedIn'])){_0x30decb['message']=utils['CAMPAIGN_STATUS'][_0x0a9e('0x6e')];}else if(!ut[_0x0a9e('0x6f')](_0x30decb[_0x0a9e('0x3c')])){_0x30decb['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];}else if(!this['isTrunkReachable'](_0x30decb['Trunk'])){if(!this[_0x0a9e('0x70')](_0x30decb['TrunkBackup'])){_0x30decb[_0x0a9e('0x4b')]=utils['CAMPAIGN_STATUS'][_0x0a9e('0x71')];}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}};Preview['prototype'][_0x0a9e('0x72')]=function(_0x3aedd0,_0x49c095,_0x145931){var _0x5ce9ac=this;var _0x211ef9=this['actions'][_0x49c095];var _0xe22ccc=this['campaignsPreview'][_0x211ef9['queue']];var _0x5df0ad;var _0x2da03c=![];var _0x47de4c=0x2;var _0x2f7092=0x3;if(_0xe22ccc){switch(_0x145931){case'1':_0xe22ccc[_0x0a9e('0x73')]+=0x1;_0x211ef9[_0x0a9e('0x74')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x0,_0x0a9e('0x77'));ami[_0x0a9e('0x25')]('custom:agentnosuchnumber',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x79')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0x7a'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'0',_0xe22ccc)[_0x0a9e('0x56')](function(_0x5d86e9){_0x2da03c=_0x5d86e9[_0x0a9e('0x7c')]==0x1;_0x47de4c=_0xe22ccc[_0x0a9e('0x7d')];_0x2f7092=_0xe22ccc['callAdditionalPhoneAfterMin'];if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc['dialGlobalMaxRetry']){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb['createCustomerFinal'](_0x5df0ad,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x211ef9[_0x0a9e('0x74')]>=_0xe22ccc['dialNoSuchNumberMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x80'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0x74'),_0xe22ccc[_0x0a9e('0x7d')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}delete this['actions'][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x211ef9[_0x0a9e('0x74')]++;logger[_0x0a9e('0x26')]('actioncountonusuch',_0x211ef9[_0x0a9e('0x74')]);logger[_0x0a9e('0x26')]('id',_0x211ef9[_0x0a9e('0x85')]);_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnosuchnumberretry':_0x211ef9[_0x0a9e('0x74')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0x87'):var _0x88dcbf=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x211ef9['responsetime']=_0x88dcbf;_0x211ef9[_0x0a9e('0x88')]=_0x88dcbf;_0x211ef9[_0x0a9e('0x4d')]=!![];_0xe22ccc[_0x0a9e('0x2e')]+=0x1;logger['info'](_0x0a9e('0x89'),_0x211ef9['uniqueid'],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0xe22ccc[_0x0a9e('0x2e')]);ami[_0x0a9e('0x25')](_0x0a9e('0x8b'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x8c'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));if(_0xe22ccc[_0x0a9e('0x8d')]||_0xe22ccc[_0x0a9e('0x8e')]){ami[_0x0a9e('0x25')](_0x0a9e('0x8f'),{'queue':_0x211ef9[_0x0a9e('0x43')],'interface':_0x211ef9[_0x0a9e('0x90')],'uniqueid':_0x211ef9[_0x0a9e('0x91')]});}break;case'16':ami[_0x0a9e('0x25')](_0x0a9e('0x92'),ut['buildObj'](_0x211ef9,_0x0a9e('0x93'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x211ef9,_0x0a9e('0x93')));_0xe22ccc[_0x0a9e('0x94')]+=0x1;_0xe22ccc['total']+=0x1;_0xe22ccc[_0x0a9e('0x95')]+=0x1;ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0x96'));_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x4,'Answer');rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0x97'));rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x98'));rpcDb[_0x0a9e('0x99')](_0x211ef9);_0xe22ccc[_0x0a9e('0x9a')]+=_0x211ef9[_0x0a9e('0x9b')];_0xe22ccc[_0x0a9e('0x9c')]+=_0x211ef9[_0x0a9e('0x9b')];logger['info'](_0x0a9e('0x9d'),_0x211ef9[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0xe22ccc['name'],_0x0a9e('0x8a'),_0xe22ccc['pTalking']);delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'BUSY':_0xe22ccc[_0x0a9e('0x9f')]+=0x1;_0x211ef9[_0x0a9e('0xa0')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x5,_0x0a9e('0xa1'));_0x47de4c=_0xe22ccc[_0x0a9e('0xa2')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')]('custom:agentbusy',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xa4')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xa5'));_0x5ce9ac['verifyAdditionalPhones'](_0x211ef9,'5',_0xe22ccc)[_0x0a9e('0x56')](function(_0x3511c9){_0x2da03c=_0x3511c9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xa8'));}else{if(_0x211ef9[_0x0a9e('0xa0')]>=_0xe22ccc[_0x0a9e('0xa9')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xa5'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xa0'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xa0')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countbusyretry':_0x211ef9[_0x0a9e('0xa0')]}})['then'](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xab'):_0xe22ccc['outboundNoAnswerCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xac')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x3,'NoAnswer');_0x47de4c=_0xe22ccc[_0x0a9e('0xad')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];var _0x2d2286=ut[_0x0a9e('0xae')](_0x211ef9,_0xe22ccc);ami[_0x0a9e('0x25')](_0x0a9e('0xaf'),_0x2d2286);rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logNoAnswer]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'3',_0xe22ccc)[_0x0a9e('0x56')](function(_0x45c109){_0x2da03c=_0x45c109[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x211ef9[_0x0a9e('0xac')]>=_0xe22ccc[_0x0a9e('0xb0')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xb1'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xac'),_0xe22ccc[_0x0a9e('0xad')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'CONGESTION':_0xe22ccc[_0x0a9e('0xb2')]+=0x1;_0x211ef9[_0x0a9e('0xb3')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x8,_0x0a9e('0xb4'));_0x47de4c=_0xe22ccc['dialCongestionRetryFrequency'];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami['emit'](_0x0a9e('0xb5'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xb6')));rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logCongestion]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'8',_0xe22ccc)[_0x0a9e('0x56')](function(_0x1d4877){_0x2da03c=_0x1d4877['additional']==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xb7'));}else{if(_0x211ef9[_0x0a9e('0xb3')]>=_0xe22ccc[_0x0a9e('0xb8')]){rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xb9'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xb3'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xb3')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countcongestionretry':_0x211ef9[_0x0a9e('0xb3')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xbb'):_0xe22ccc[_0x0a9e('0xbc')]+=0x1;_0x211ef9[_0x0a9e('0xbd')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x14,_0x0a9e('0xbe'));_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')](_0x0a9e('0xc0'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xc1')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc2'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)[_0x0a9e('0x56')](function(_0x4989f9){_0x2da03c=_0x4989f9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x14,_0x0a9e('0xbe'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xc3'));}else{if(_0x211ef9[_0x0a9e('0xbd')]>=_0xe22ccc['dialAgentRejectMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0xbd'),_0xe22ccc[_0x0a9e('0xbf')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case'ABANDONED':_0xe22ccc['outboundAbandonedCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc4')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xb,_0x0a9e('0xc5'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc6'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'11',_0xe22ccc)[_0x0a9e('0x56')](function(_0x586510){_0x2da03c=_0x586510[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xc6'));}else{if(_0x211ef9['countabandonedetry']>=_0xe22ccc[_0x0a9e('0xc7')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xc6'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,'countabandonedretry',_0xe22ccc['dialAbandonedRetryFrequency']),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'18':_0xe22ccc['outboundUnknownCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc8')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x12,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0['dialstatus']);ami['emit'](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xcb'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2eb028){_0x2da03c=_0x2eb028['additional']==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x12,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xcb'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xcb'));}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'19':_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x13,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);ami[_0x0a9e('0x25')](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0xce'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2fea95){_0x2da03c=_0x2fea95[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xce'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xce'));}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})['then'](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;default:if(_0x211ef9[_0x0a9e('0x4d')]){ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0xcf'));ut[_0x0a9e('0x50')](_0x0a9e('0xd0')+_0xe22ccc[_0x0a9e('0x29')],_0x3aedd0);}_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xc,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];rpcDb['createCustomerHistory'](_0x211ef9,'[callProgressDetectingCustomer][logUnknown]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)['then'](function(_0x1d999b){_0x2da03c=_0x1d999b[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xd1'));}delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});}});}if(!(_0x211ef9[_0x0a9e('0x4d')]&&_0x145931==='16')){ut[_0x0a9e('0xd2')](_0xe22ccc,'[callProgressDetectingCustomer]');logger[_0x0a9e('0x26')](_0x0a9e('0xd3'),_0x211ef9[_0x0a9e('0x91')],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x44'),_0xe22ccc[_0x0a9e('0x2d')]);}if(_0x145931!==_0x0a9e('0x87')){delete this[_0x0a9e('0x13')][_0x3aedd0['linkedid']];delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0xd4')]];}_0xe22ccc['queueSummaryCountersUpdated']=!![];}};Preview[_0x0a9e('0xd')][_0x0a9e('0xd5')]=function(_0x1f6f1c,_0x5822a7,_0x5c3b6f){if(_['isUndefined'](_0x5822a7)&&_0x0a9e('0xd6')!==typeof _0x5822a7){return;}if(_[_0x0a9e('0xd7')](_0x5c3b6f)&&'object'!==typeof _0x5c3b6f){return;}switch(_0x5c3b6f[_0x0a9e('0xd8')]){case'0':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x0,_0x0a9e('0x77'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xda'));break;case'3':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x3,_0x0a9e('0xdb'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdd'));break;case'5':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x5,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xde'));break;case'8':ut['logAgent'](_0x1f6f1c,0x8,_0x0a9e('0xb4'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xdf'));break;case'22':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x16,_0x0a9e('0xe0'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xe1'));break;default:ut[_0x0a9e('0xd9')](_0x1f6f1c,0xc,_0x5c3b6f['reason']);rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdf'));}ut[_0x0a9e('0xd2')](_0x5822a7,_0x0a9e('0xe2'));logger['info'](_0x0a9e('0xe3'),_0x1f6f1c[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0x5822a7[_0x0a9e('0x29')],_0x0a9e('0x44'),_0x5822a7[_0x0a9e('0x2d')]);delete this[_0x0a9e('0x13')][_0x1f6f1c[_0x0a9e('0x91')]];};Preview[_0x0a9e('0xd')][_0x0a9e('0x7b')]=function(_0x57f0ad,_0x2272bc,_0x88b25f){return cmHopperAdditionalPhone[_0x0a9e('0x7b')](_0x57f0ad,_0x2272bc,_0x88b25f)[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')](_0x0a9e('0xe4')));};Preview[_0x0a9e('0xd')][_0x0a9e('0xba')]=function(_0x566b90,_0x3b581c,_0xd2391){return cmHopperAdditionalPhone[_0x0a9e('0xba')](_0x566b90,_0x3b581c,_0xd2391)['catch'](logger[_0x0a9e('0x26')](_0x0a9e('0xe5')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x86')]=function(_0x370b5e){return Promise[_0x0a9e('0xe6')]()[_0x0a9e('0x56')](cmHopperAdditionalPhone[_0x0a9e('0x86')](_0x370b5e))[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')]('[incrementPreviewCounters]\x20'));};Preview[_0x0a9e('0xd')][_0x0a9e('0xe7')]=function(_0x15a9ed,_0x3db98f,_0x2b624e,_0x3942fd,_0x5cb48d){var _0x382687=this;return new Promise(function(_0x4f854b,_0x5bd139){if(_['isNil'](_0x3db98f)||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe8')])||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe9')])||_['isNil'](_0x3db98f[_0x0a9e('0x48')])){_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xea'),_0x3942fd,_0x5cb48d));return;}var _0x1fdb10=uuid['v4']();var _0x2c8d1d=_0x382687['campaignsPreview'][_0x3db98f['Queue'][_0x0a9e('0x29')]];var _0x33bcb2=_0x2b624e?_0x382687[_0x0a9e('0x14')][_0x2b624e]['id']:undefined;_0x382687['actions'][_0x1fdb10]=new Action(_0x3db98f,_0x2c8d1d,_0x1fdb10,_0x2b624e,_0x33bcb2);var _0x319752=_0x382687[_0x0a9e('0x13')][_0x1fdb10];_0x319752[_0x0a9e('0xaa')]=_0x3942fd;_0x319752['activeContact']=_0x5cb48d;_0x319752[_0x0a9e('0xeb')]=_0x2b624e;if(_[_0x0a9e('0xec')](_0x15a9ed)){_0x382687[_0x0a9e('0xed')](_0x319752,_0x2c8d1d,_0x3db98f,_0x2b624e)['then'](function(_0x272291){logger[_0x0a9e('0x26')](_0x0a9e('0xee'),'Queue:\x20'+_0x319752['queue']+'\x20IdHopper:\x20'+_0x319752[_0x0a9e('0x85')],JSON[_0x0a9e('0x45')](_0x272291));ami[_0x0a9e('0x25')](_0x0a9e('0xef'),ut['buildObj'](_0x319752,_0x0a9e('0xf0'),_0x382687['campaignsPreview'][_0x319752[_0x0a9e('0x43')]]));_0x4f854b(ut[_0x0a9e('0x4b')](_0x0a9e('0xf1')));})['catch'](function(_0x33b4b3){ut[_0x0a9e('0x32')](_0x0a9e('0xf2'),_0x33b4b3);_0x5bd139(ut['message'](_0x0a9e('0xf3'),_0x3942fd,_0x5cb48d));});}else{_0x2c8d1d['outboundBlacklistCallsDay']+=0x1;ut[_0x0a9e('0xf4')](_0x319752);rpcDb['createHistory'](_0x319752,_0x0a9e('0xf5'));delete _0x382687['actions'][_0x1fdb10];_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xf6'),_0x3942fd,_0x5cb48d));}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x70')]=function(_0x1e306c){return!_[_0x0a9e('0x41')](_0x1e306c)&&!_[_0x0a9e('0x41')](_0x1e306c['name'])&&!_[_0x0a9e('0x41')](_0x1e306c[_0x0a9e('0xf7')])&&_0x1e306c['active']&&!_[_0x0a9e('0x41')](this[_0x0a9e('0x12')][util['format'](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])])&&!_[_0x0a9e('0x41')](this['trunks'][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')])&&(this[_0x0a9e('0x12')][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfa')||this['trunks'][util[_0x0a9e('0x27')]('SIP/%s',_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfb'));};Preview[_0x0a9e('0xd')][_0x0a9e('0x5c')]=function(_0x2d45db,_0x5691ac){return this[_0x0a9e('0xfc')](_0x2d45db,_0x5691ac)[_0x0a9e('0x56')](function(_0x2977a7){return _['pick'](_0x2977a7,[_0x0a9e('0x4b')]);})[_0x0a9e('0x5e')](function(_0x4435d2){if(_0x4435d2[_0x0a9e('0xfd')]){rpcDb[_0x0a9e('0xfe')](_0x2d45db);}if(_0x4435d2[_0x0a9e('0xf7')]){rpcDb[_0x0a9e('0x60')](_0x2d45db);}throw _['pick'](_0x4435d2,[_0x0a9e('0x4b')]);});};Preview[_0x0a9e('0xd')][_0x0a9e('0xfc')]=function(_0x2ce3be,_0x3de77e){var _0x241404=this;var _0x8120e,_0x5d6a48;return rpcDb['getContactPreview'](_0x2ce3be)[_0x0a9e('0x56')](function(_0x3f507c){if(!_[_0x0a9e('0x41')](_0x3f507c[0x0])){_0x5d6a48=_0x3f507c[0x0][_0x0a9e('0xff')]?![]:!![];_0x8120e=_0x3f507c[0x0][_0x0a9e('0xff')]?!![]:![];_0x8120e=_0x3de77e?!![]:_0x8120e;}var _0x131da8=_0x241404[_0x0a9e('0x100')](_0x3f507c);if(_0x131da8['isValid']){rpcDb[_0x0a9e('0x101')](_[_0x0a9e('0x46')](_0x3f507c[0x0],[_0x0a9e('0x48'),_0x0a9e('0xe9')]))[_0x0a9e('0x56')](function(_0x3c6082){_0x241404[_0x0a9e('0xe7')](_0x3c6082,_0x3f507c[0x0],_0x3de77e,_0x5d6a48,_0x8120e)['then'](function(_0x311288){return _0x311288;})[_0x0a9e('0x5e')](function(_0x231826){throw _0x231826;});})['catch'](function(_0x2b8ad4){ut[_0x0a9e('0x32')](_0x0a9e('0x102'),_0x2b8ad4);throw ut[_0x0a9e('0x4b')]('Call\x20unsuccessful',_0x5d6a48,_0x8120e);});}else{throw ut[_0x0a9e('0x4b')](_0x131da8[_0x0a9e('0x4b')],_0x5d6a48,_0x8120e);}})[_0x0a9e('0x5e')](function(_0x93d953){ut[_0x0a9e('0x32')](_0x0a9e('0x103'),_0x93d953);throw ut[_0x0a9e('0x4b')](_0x0a9e('0x104'),![],!![]);});};Preview['prototype'][_0x0a9e('0x100')]=function(_0x266aa1){if(_[_0x0a9e('0x41')](_0x266aa1)||_[_0x0a9e('0xec')](_0x266aa1)||!_['isNil'](_0x266aa1[0x0]['Agent'])&&_[_0x0a9e('0x41')](_0x266aa1[0x0][_0x0a9e('0x5a')][_0x0a9e('0x29')])){ut['logger'](_0x0a9e('0x105'),_0x266aa1);return{'isValid':![],'message':_0x0a9e('0x106')};}var _0x4d8a67=this[_0x0a9e('0x10')][_0x266aa1[0x0]['Queue'][_0x0a9e('0x29')]];_0x4d8a67['message']=utils['CAMPAIGN_STATUS']['ACTIVE'];if(_[_0x0a9e('0x41')](_0x4d8a67)){ut[_0x0a9e('0x32')](_0x0a9e('0x107'),_0x4d8a67);return{'isValid':![],'message':_0x0a9e('0x108')};}if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x109')])){ut['logger'](_0x0a9e('0x10a'),_0x0a9e('0x10b')+_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x10c'));if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x10d')])){ut[_0x0a9e('0x32')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x4d8a67['name']+_0x0a9e('0x10e'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x0a9e('0x6f')](_0x4d8a67[_0x0a9e('0x3c')])){ut[_0x0a9e('0x32')](_0x0a9e('0x10f'),_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x110'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x4d8a67[_0x0a9e('0x29')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x0a9e('0xd')]['execCall']=function(_0x38dceb,_0x5dc978,_0x550cbf,_0x26223f){var _0x4a7a3c=this;return new Promise(function(_0x24470a,_0x142e53){var _0xe1ab0d=_0x38dceb['uniqueid'];var _0x4152cd=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?util['format']('SIP/%s/%s%s',_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978[_0x0a9e('0x111')][_0x0a9e('0x112')]()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')][_0x0a9e('0x114')](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf['phone']):util['format']('SIP/%s/%s%s',_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978['dialPrefix']['trim']()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')]['substring'](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf[_0x0a9e('0xe9')]);var _0x2e2280=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?ut[_0x0a9e('0x115')](_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978[_0x0a9e('0x11a')]):ut[_0x0a9e('0x115')](_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978['dialOriginateCallerIdNumber']);if(_0x2e2280){_0x38dceb[_0x0a9e('0x11b')]=ut[_0x0a9e('0x11c')](_0x2e2280);_0x38dceb[_0x0a9e('0x11d')]=ut[_0x0a9e('0x11e')](_0x2e2280);}var _0x33359a=ut[_0x0a9e('0x11f')](_0x5dc978,_0x550cbf,_0x4152cd,_0x2e2280,_0xe1ab0d,_0x38dceb);var _0xa8b5de=utils['setXMDContactVariables'](_0x550cbf[_0x0a9e('0xe8')]);Object['assign'](_0x33359a,_0xa8b5de);_[_0x0a9e('0x120')](_0x38dceb,ut[_0x0a9e('0x121')](_0x33359a));_0x38dceb[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x5dc978[_0x0a9e('0x122')]=_0x33359a;var _0x465003=ut[_0x0a9e('0x123')](_0x38dceb,_0x5dc978,_0x33359a,_0x38dceb[_0x0a9e('0x83')],_0x26223f);return ami[_0x0a9e('0x124')](_0x465003)[_0x0a9e('0x56')](function(_0x8231e5){_0x5dc978[_0x0a9e('0x2d')]+=0x1;logger[_0x0a9e('0x26')](_0x0a9e('0x125'),_0xe1ab0d,_0x0a9e('0x9e'),_0x5dc978['name'],'originated:\x20',_0x5dc978[_0x0a9e('0x2d')]);_0x24470a(_0x8231e5);})[_0x0a9e('0x5e')](function(_0x52b365){ut['logAgent'](_0x38dceb,0xe,_0x0a9e('0x126'));rpcDb[_0x0a9e('0xdc')](_0x38dceb,_0x0a9e('0x127'));_0x142e53(_0x52b365);});});};Preview['prototype'][_0x0a9e('0x1d')]=function(_0x5b6447){if(this[_0x0a9e('0x13')][_0x5b6447['linkedid']]){this[_0x0a9e('0x13')][_0x5b6447['linkedid']][_0x0a9e('0x4a')]=_0x5b6447[_0x0a9e('0x4a')];}};Preview[_0x0a9e('0xd')]['syncOriginateResponse']=function(_0x316b51){var _0x497fda=this;var _0x505ffd=this[_0x0a9e('0x13')][_0x316b51[_0x0a9e('0x128')]];if(_0x505ffd){if(_0x505ffd[_0x0a9e('0xeb')]&&this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]){ut[_0x0a9e('0x129')](_0x505ffd,this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]][_0x0a9e('0x29')],this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]['id']);}var _0x98bf26=_[_0x0a9e('0x12a')](_0x505ffd);_0x98bf26[_0x0a9e('0x12b')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));var _0x310026=_0x497fda[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]];if(ut['isFailure'](_0x316b51[_0x0a9e('0x12c')])){if(_0x505ffd[_0x0a9e('0xaa')]){rpcDb[_0x0a9e('0xfe')](_0x505ffd[_0x0a9e('0x85')]);}if(_0x505ffd['activeContact']){rpcDb['disableContact'](_0x505ffd['idContact']);}ami[_0x0a9e('0x25')]('custom:agentringnoanswer',ut[_0x0a9e('0x78')](_0x505ffd,_0x0a9e('0x12d'),this[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]]));this[_0x0a9e('0xd5')](_0x98bf26,_0x310026,_0x316b51);}else{_0x505ffd[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));ut[_0x0a9e('0xd9')](_0x98bf26,0x4,_0x0a9e('0x12e'));rpcDb['createAgentHistory'](_0x98bf26,_0x0a9e('0x12f'));}}};Preview['prototype'][_0x0a9e('0x1a')]=function(_0x586d2f){var _0xf4de86=this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]];var _0x556bb7;if(_0xf4de86){_0x556bb7=this[_0x0a9e('0x10')][_0xf4de86[_0x0a9e('0x43')]];logger['info']('[syncHangup][talking]',_0x586d2f[_0x0a9e('0x84')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],'pTalking:\x20',_0x556bb7['pTalking']);}if(this['actions'][_0x586d2f[_0x0a9e('0x84')]]&&_0x586d2f[_0x0a9e('0x84')]!==_0x586d2f[_0x0a9e('0x91')]){if(_0x586d2f[_0x0a9e('0x130')]==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')](_0x0a9e('0x131'),_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}}else if(_0xf4de86&&_[_0x0a9e('0x41')](_0xf4de86['statedesc'])&&_0x556bb7[_0x0a9e('0x132')]&&_0x586d2f[_0x0a9e('0x84')]===_0x586d2f[_0x0a9e('0x91')]&&_[_0x0a9e('0x41')](_0x586d2f[_0x0a9e('0xd8')])&&_0x586d2f[_0x0a9e('0x130')]==='16'&&_0x586d2f[_0x0a9e('0x133')]==='6'&&_[_0x0a9e('0xd7')](_0xf4de86[_0x0a9e('0x134')])){if(_0xf4de86['unlockAgent']){rpcDb['unlockContact'](_0xf4de86[_0x0a9e('0x85')]);}if(_0xf4de86[_0x0a9e('0x83')]){rpcDb['disableContact'](_0xf4de86[_0x0a9e('0x85')]);}_0x586d2f[_0x0a9e('0xd8')]='22';this['callProgressDetectingAgent'](_0xf4de86,_0x556bb7,_0x586d2f);}else if(_0xf4de86&&_0xf4de86[_0x0a9e('0x134')]){if(_0x586d2f['cause']==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]]['dialAnswer']){logger[_0x0a9e('0x26')](_0x0a9e('0x135'),_0x586d2f['linkedid'],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f['linkedid']][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')]('[syncHangup][talking][cause]',_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f['linkedid'],_0x586d2f['cause']);}}};Preview['prototype']['syncDialEnd']=function(_0x5e9817){if(this[_0x0a9e('0x13')][_0x5e9817[_0x0a9e('0xd4')]]&&_0x5e9817['destlinkedid']!==_0x5e9817['destuniqueid']){this[_0x0a9e('0x72')](_0x5e9817,_0x5e9817['destlinkedid'],_0x5e9817[_0x0a9e('0xcd')]);}};Preview[_0x0a9e('0xd')][_0x0a9e('0x136')]=function(_0x175c97){if(this[_0x0a9e('0x13')][_0x175c97[_0x0a9e('0x84')]]&&_0x175c97['linkedid']!==_0x175c97[_0x0a9e('0x91')]&&!this[_0x0a9e('0x13')][_0x175c97['linkedid']][_0x0a9e('0x4d')]){if(_0x175c97[_0x0a9e('0x130')]==='1'){this[_0x0a9e('0x72')](_0x175c97,_0x175c97[_0x0a9e('0x84')],_0x175c97[_0x0a9e('0x130')]);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x137')]=function(_0x4a36df,_0x331216,_0x508395){if(this[_0x0a9e('0x13')][_0x4a36df]){if(_[_0x0a9e('0x41')](this['actions'][_0x4a36df][_0x0a9e('0x122')])){this[_0x0a9e('0x13')][_0x4a36df]['variables']={};}this[_0x0a9e('0x13')][_0x4a36df]['variables'][_0x331216]=_0x508395;}};Preview[_0x0a9e('0xd')][_0x0a9e('0x1f')]=function(_0x5d0620){try{if(!_[_0x0a9e('0x41')](_0x5d0620)){if(ut['filterKey'](_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0])){this[_0x0a9e('0x137')](_0x5d0620[_0x0a9e('0x91')],_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0],_0x5d0620[_0x0a9e('0x13a')]);}}}catch(_0x53b5c2){logger[_0x0a9e('0x13b')](_0x0a9e('0x13c'),util[_0x0a9e('0x13d')](_0x53b5c2,{'showHidden':![],'depth':null}));}};Preview[_0x0a9e('0xd')][_0x0a9e('0x21')]=function(_0x5932ad){if(_0x5932ad){if(this[_0x0a9e('0x13')][_0x5932ad['transfertargetlinkedid']]){this['actions'][_0x5932ad[_0x0a9e('0x13e')]]['transfer']=!![];}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x23')]=function(_0x58d5fd){if(_0x58d5fd){if(this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]]){this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]][_0x0a9e('0x134')]=!![];}}};module[_0x0a9e('0x140')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 7d1ed50..4d35529 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 _0x6096=['queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','createHistory','[createHistory]\x20','resolve','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','catch','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','rescheduleContact','UserId','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','connectedlinename','membername','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x6096,0x151));var _0x6609=function(_0x40f201,_0x3c7f3a){_0x40f201=_0x40f201-0x0;var _0x51dec7=_0x6096[_0x40f201];return _0x51dec7;};'use strict';var util=require(_0x6609('0x0'));var BPromise=require(_0x6609('0x1'));var logger=require(_0x6609('0x2'))(_0x6609('0x3'));var cmHopper=require(_0x6609('0x4'));var cmHopperHistory=require(_0x6609('0x5'));var cmHopperBlack=require(_0x6609('0x6'));var agentReportPreview=require(_0x6609('0x7'));var voiceQueueReport=require(_0x6609('0x8'));function loggerCatch(_0x3a5043){return function(_0x201f1a){logger[_0x6609('0x9')](_0x3a5043,util[_0x6609('0xa')](_0x201f1a,{'showHidden':![],'depth':null}));};}function create(_0x314462){return cmHopperHistory[_0x6609('0xb')](_0x314462)['catch'](loggerCatch(_0x6609('0xc')));}function createAgent(_0x2fc1db){return BPromise[_0x6609('0xd')]()[_0x6609('0xe')](agentReportPreview[_0x6609('0xb')](_0x2fc1db))['catch'](loggerCatch('[createHistory]\x20'));}function moveContact(_0x345509){return cmHopper[_0x6609('0xf')](_0x345509,!![])['catch'](loggerCatch(_0x6609('0x10')));}exports[_0x6609('0x11')]=function(_0x36d706){return cmHopperBlack[_0x6609('0x11')](_0x36d706)[_0x6609('0x12')](loggerCatch(_0x6609('0x13')));};exports[_0x6609('0x14')]=function(_0x5ebee4){return BPromise[_0x6609('0xd')]()[_0x6609('0xe')](cmHopper[_0x6609('0x14')](_0x5ebee4))['catch'](loggerCatch(_0x6609('0x15')));};exports[_0x6609('0xb')]=function(_0x59a72e,_0x2ff7f7){create(_0x59a72e)['catch'](loggerCatch(_0x2ff7f7));moveContact(_0x59a72e)[_0x6609('0x12')](loggerCatch(_0x2ff7f7));};exports[_0x6609('0x16')]=function(_0x336441,_0x377438){createAgent(_0x336441)[_0x6609('0x12')](loggerCatch(_0x377438));};exports[_0x6609('0x17')]=function(_0x4ff5ce,_0x437571){create(_0x4ff5ce)[_0x6609('0x12')](loggerCatch(_0x437571));};exports['createCustomerFinal']=function(_0x431fee,_0x3221f1){moveContact(_0x431fee)['catch'](loggerCatch(_0x3221f1));};exports[_0x6609('0x18')]=function(_0x23b850,_0x1fb616,_0x21b921){if(_0x1fb616){_0x23b850[_0x6609('0x19')]=null;}if(_0x21b921){_0x23b850['active']=![];}return cmHopper[_0x6609('0x18')](_0x23b850)['catch'](loggerCatch('[rescheduleContact]\x20'));};exports[_0x6609('0x1a')]=function(_0xf1098d){return cmHopper['countReScheduled'](_0xf1098d)[_0x6609('0x12')](loggerCatch(_0x6609('0x1b')));};exports[_0x6609('0x1c')]=function(_0x11d958){return cmHopper['unlockContact']({'UserId':null},_0x11d958,0x1)[_0x6609('0x12')](loggerCatch(_0x6609('0x1d')));};exports[_0x6609('0x1e')]=function(_0x11a97a){return cmHopper[_0x6609('0x1c')]({'active':![]},_0x11a97a,0x1)[_0x6609('0x12')](loggerCatch(_0x6609('0x1f')));};exports['crateCustomerReportQueue']=function(_0x1fd32d){var _0x4a7d67={};_0x4a7d67[_0x6609('0x20')]=_0x1fd32d['type'];_0x4a7d67[_0x6609('0x21')]=_0x1fd32d['uniqueid'];_0x4a7d67[_0x6609('0x22')]=_0x1fd32d[_0x6609('0x22')];_0x4a7d67[_0x6609('0x23')]=_0x1fd32d[_0x6609('0x23')];_0x4a7d67[_0x6609('0x24')]=_0x1fd32d['queue'];_0x4a7d67[_0x6609('0x25')]=_0x1fd32d[_0x6609('0x26')];_0x4a7d67['queuecallerleaveAt']=_0x1fd32d[_0x6609('0x26')];_0x4a7d67[_0x6609('0x27')]=0x1;_0x4a7d67['queuecallercompleteAt']=_0x1fd32d['endtime'];_0x4a7d67[_0x6609('0x28')]=_0x1fd32d[_0x6609('0x29')];_0x4a7d67['context']=_0x6609('0x2a');_0x4a7d67[_0x6609('0x2b')]=_0x6609('0x2c');_0x4a7d67[_0x6609('0x2d')]=0x0;_0x4a7d67[_0x6609('0x2e')]=0x1;_0x4a7d67[_0x6609('0x2f')]=_0x1fd32d[_0x6609('0x29')];_0x4a7d67[_0x6609('0x30')]=_0x6609('0x31');return BPromise[_0x6609('0xd')]()[_0x6609('0xe')](voiceQueueReport[_0x6609('0x32')](_0x4a7d67))[_0x6609('0x12')](loggerCatch(_0x6609('0x33')));};exports[_0x6609('0x34')]=function(_0x36fa8d,_0x386eb0){return BPromise[_0x6609('0xd')]()['then'](cmHopper[_0x6609('0x34')](_0x36fa8d,_0x386eb0))[_0x6609('0x12')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0x6609('0x35')]=function(_0x3a8777){return cmHopper[_0x6609('0x18')](_0x3a8777,!![],!![])[_0x6609('0x12')](loggerCatch(_0x6609('0x36')));}; \ No newline at end of file +var _0xe42b=['active','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','endtime','membername','context','exten','holdtime','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueReport','inspect','createHistory','[createHistory]\x20','resolve','catch','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','then','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','rescheduleContact','UserId'];(function(_0x3e25c1,_0x1d15f9){var _0x52e7f2=function(_0x597a5a){while(--_0x597a5a){_0x3e25c1['push'](_0x3e25c1['shift']());}};_0x52e7f2(++_0x1d15f9);}(_0xe42b,0x154));var _0xbe42=function(_0x120ab8,_0x577eb9){_0x120ab8=_0x120ab8-0x0;var _0x597e51=_0xe42b[_0x120ab8];return _0x597e51;};'use strict';var util=require(_0xbe42('0x0'));var BPromise=require(_0xbe42('0x1'));var logger=require(_0xbe42('0x2'))(_0xbe42('0x3'));var cmHopper=require(_0xbe42('0x4'));var cmHopperHistory=require(_0xbe42('0x5'));var cmHopperBlack=require(_0xbe42('0x6'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0xbe42('0x7'));function loggerCatch(_0x275f85){return function(_0x4263a3){logger['error'](_0x275f85,util[_0xbe42('0x8')](_0x4263a3,{'showHidden':![],'depth':null}));};}function create(_0x261ffe){return cmHopperHistory[_0xbe42('0x9')](_0x261ffe)['catch'](loggerCatch(_0xbe42('0xa')));}function createAgent(_0x468c93){return BPromise[_0xbe42('0xb')]()['then'](agentReportPreview[_0xbe42('0x9')](_0x468c93))[_0xbe42('0xc')](loggerCatch(_0xbe42('0xa')));}function moveContact(_0x14b71c){return cmHopper[_0xbe42('0xd')](_0x14b71c,!![])[_0xbe42('0xc')](loggerCatch(_0xbe42('0xe')));}exports[_0xbe42('0xf')]=function(_0x5f1109){return cmHopperBlack[_0xbe42('0xf')](_0x5f1109)['catch'](loggerCatch(_0xbe42('0x10')));};exports[_0xbe42('0x11')]=function(_0x10325c){return BPromise[_0xbe42('0xb')]()[_0xbe42('0x12')](cmHopper[_0xbe42('0x11')](_0x10325c))[_0xbe42('0xc')](loggerCatch(_0xbe42('0x13')));};exports[_0xbe42('0x9')]=function(_0x565091,_0x59e91a){create(_0x565091)[_0xbe42('0xc')](loggerCatch(_0x59e91a));moveContact(_0x565091)['catch'](loggerCatch(_0x59e91a));};exports[_0xbe42('0x14')]=function(_0x334cd8,_0x29546e){createAgent(_0x334cd8)['catch'](loggerCatch(_0x29546e));};exports[_0xbe42('0x15')]=function(_0x47c22f,_0x1f857c){create(_0x47c22f)[_0xbe42('0xc')](loggerCatch(_0x1f857c));};exports['createCustomerFinal']=function(_0x7f2baf,_0x2a54d5){moveContact(_0x7f2baf)[_0xbe42('0xc')](loggerCatch(_0x2a54d5));};exports[_0xbe42('0x16')]=function(_0x5839c1,_0x48f685,_0x3b7e24){if(_0x48f685){_0x5839c1[_0xbe42('0x17')]=null;}if(_0x3b7e24){_0x5839c1[_0xbe42('0x18')]=![];}return cmHopper[_0xbe42('0x16')](_0x5839c1)[_0xbe42('0xc')](loggerCatch('[rescheduleContact]\x20'));};exports[_0xbe42('0x19')]=function(_0x83c714){return cmHopper[_0xbe42('0x19')](_0x83c714)[_0xbe42('0xc')](loggerCatch('[countReScheduled]\x20'));};exports[_0xbe42('0x1a')]=function(_0x4849f4){return cmHopper['unlockContact']({'UserId':null},_0x4849f4,0x1)[_0xbe42('0xc')](loggerCatch(_0xbe42('0x1b')));};exports[_0xbe42('0x1c')]=function(_0x102c9d){return cmHopper[_0xbe42('0x1a')]({'active':![]},_0x102c9d,0x1)[_0xbe42('0xc')](loggerCatch(_0xbe42('0x1d')));};exports[_0xbe42('0x1e')]=function(_0x5c2485){var _0xe511e3={};_0xe511e3[_0xbe42('0x1f')]=_0x5c2485[_0xbe42('0x1f')];_0xe511e3[_0xbe42('0x20')]=_0x5c2485['uniqueid'];_0xe511e3[_0xbe42('0x21')]=_0x5c2485['calleridnum'];_0xe511e3[_0xbe42('0x22')]=_0x5c2485[_0xbe42('0x22')];_0xe511e3['queue']=_0x5c2485[_0xbe42('0x23')];_0xe511e3[_0xbe42('0x24')]=_0x5c2485[_0xbe42('0x25')];_0xe511e3[_0xbe42('0x26')]=_0x5c2485[_0xbe42('0x25')];_0xe511e3['queuecallercomplete']=0x1;_0xe511e3['queuecallercompleteAt']=_0x5c2485[_0xbe42('0x27')];_0xe511e3['connectedlinename']=_0x5c2485[_0xbe42('0x28')];_0xe511e3[_0xbe42('0x29')]='from-sip';_0xe511e3[_0xbe42('0x2a')]='xcally-motion-preview';_0xe511e3[_0xbe42('0x2b')]=0x0;_0xe511e3['assigned']=0x1;_0xe511e3[_0xbe42('0x2c')]=_0x5c2485[_0xbe42('0x28')];_0xe511e3[_0xbe42('0x2d')]=_0xbe42('0x2e');return BPromise['resolve']()['then'](voiceQueueReport[_0xbe42('0x2f')](_0xe511e3))[_0xbe42('0xc')](loggerCatch(_0xbe42('0x30')));};exports[_0xbe42('0x31')]=function(_0x4f1f19,_0x25d41d){return BPromise[_0xbe42('0xb')]()[_0xbe42('0x12')](cmHopper[_0xbe42('0x31')](_0x4f1f19,_0x25d41d))[_0xbe42('0xc')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0xbe42('0x32')]=function(_0x52fe9c){return cmHopper['rescheduleContact'](_0x52fe9c,!![],!![])['catch'](loggerCatch(_0xbe42('0x33')));}; \ No newline at end of file diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index 7876bde..8c06819 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 _0x6fd9=['info','logger2','message','getCallerId','isUndefined','isEmpty','format','string','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','\x22%s\x22\x20<%s>','calleridname','calleridnum','VoiceQueueId','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','toLower','updateOriginated','originated','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','Blacklist','responsetime','logAgent','state','getSeconds','logLookAgent','membername','logCustomer','endtime','ringtime','starttime','talktime','answertime','variablesAction','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','cloneAction','clone','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','lastevent','name','queue','interface','motionChannel','voice','mandatoryDisposition','agentReadyId','hasOwnProperty','not_inuse','status','reachable','getDiff','diff','seconds','createBody','CampaignId','filterKey','idContact','type','active','countglobal','callback','callbackat','recallme','UserId','sipcallid','xmd-voicequeueid','xmd-phone','xmd-listid','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','variables','forEach','toLowerCase','buildNoAnswerEventPayload','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','loggerCatch','error','inspect','logger'];(function(_0x533a89,_0x34002){var _0xd59952=function(_0x38547a){while(--_0x38547a){_0x533a89['push'](_0x533a89['shift']());}};_0xd59952(++_0x34002);}(_0x6fd9,0x190));var _0x96fd=function(_0x8a4bb,_0x39a786){_0x8a4bb=_0x8a4bb-0x0;var _0x4050c2=_0x6fd9[_0x8a4bb];return _0x4050c2;};'use strict';var util=require(_0x96fd('0x0'));var _=require(_0x96fd('0x1'));var moment=require(_0x96fd('0x2'));var logger=require(_0x96fd('0x3'))(_0x96fd('0x4'));var ipAgi=process[_0x96fd('0x5')][_0x96fd('0x6')]||'127.0.0.1';var utils=require('../../dialer/utils');exports[_0x96fd('0x7')]=function(_0x4f6a51){return function(_0x54feba){logger[_0x96fd('0x8')](_0x4f6a51,util[_0x96fd('0x9')](_0x54feba,{'showHidden':![],'depth':null}));};};exports[_0x96fd('0xa')]=function(_0x3286a9,_0x2e1d0c){logger[_0x96fd('0xb')](_0x3286a9,util[_0x96fd('0x9')](_0x2e1d0c,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x198887,_0x9af5a5){logger[_0x96fd('0x8')](_0x198887,util[_0x96fd('0x9')](_0x9af5a5,{'showHidden':![],'depth':null}));};exports[_0x96fd('0xc')]=function(_0x49018b){return function(_0x554946){logger[_0x96fd('0xb')](_0x49018b,util[_0x96fd('0x9')](_0x554946,{'showHidden':![],'depth':null}));};};exports[_0x96fd('0xd')]=function(_0x15a090,_0x4bc881,_0x561e12){return{'message':_0x15a090,'unlock':_0x4bc881,'active':_0x561e12};};exports[_0x96fd('0xe')]=function(_0x3b997e,_0x14296f,_0x89c8c3){if(!_[_0x96fd('0xf')](_0x89c8c3)&&'string'===typeof _0x89c8c3&&!_[_0x96fd('0x10')](_0x89c8c3)){if(!_['isUndefined'](_0x14296f)&&'string'===typeof _0x14296f&&!_[_0x96fd('0x10')](_0x14296f)){return util['format']('\x22%s\x22\x20<%s>',_0x14296f,_0x89c8c3);}return util[_0x96fd('0x11')]('\x22%s\x22\x20<%s>',_0x89c8c3,_0x89c8c3);}if(!_['isUndefined'](_0x3b997e)&&_0x96fd('0x12')===typeof _0x3b997e&&!_[_0x96fd('0x10')](_0x3b997e)){return _0x3b997e;}return _0x96fd('0x13');};exports[_0x96fd('0x14')]=function(_0xb4c1e7){if(_[_0x96fd('0x15')](_0xb4c1e7)){return![];}return _0xb4c1e7;};exports[_0x96fd('0x16')]=function(_0x2c46fe,_0x5d89da,_0x3ecada,_0x14cb1e,_0x58061a,_0x1cec38){var _0x5f03cc={'XMD-QUEUE':_0x5d89da[_0x96fd('0x17')]?_0x5d89da[_0x96fd('0x17')]['name']:'','XMD-CALLERID':_0x14cb1e,'XMD-CALLERID-PREVIEW':_0x1cec38?util[_0x96fd('0x11')](_0x96fd('0x18'),_0x1cec38[_0x96fd('0x19')],_0x1cec38[_0x96fd('0x1a')]):_0x14cb1e,'XMD-DIALID':_0x58061a,'XMD-CONTACTID':_0x5d89da['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x14cb1e,'XMD-VOICEQUEUEID':_0x5d89da[_0x96fd('0x1b')],'XMD-DIALCHANNEL':_0x3ecada,'XMD-DIALTIMEOUT':_0x2c46fe['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util['format'](_0x96fd('0x1c'),_0x2c46fe[_0x96fd('0x1d')]?'g':'',_['isEmpty'](_0x2c46fe[_0x96fd('0x1e')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x2c46fe[_0x96fd('0x1f')]||'','XMD-AGI':_0x2c46fe[_0x96fd('0x20')]?util['format'](_0x96fd('0x21'),ipAgi,_0x2c46fe[_0x96fd('0x20')]):_0x96fd('0x22'),'XMD-AGIAFTER':_0x2c46fe[_0x96fd('0x1d')]?util['format'](_0x96fd('0x21'),ipAgi,_0x2c46fe['dialQueueProject2']):'NONE','XMD-ORIGINATECALLERIDNUM':_0x1cec38?_0x1cec38[_0x96fd('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x1cec38?_0x1cec38['originatecalleridname']:'','XMD-DESTINATION':_0x96fd('0x24'),'SIPADDHEADER':_0x96fd('0x25')};if(!_[_0x96fd('0x10')](_0x2c46fe['monitor_format'])){_0x5f03cc[util['format']('%s',_0x96fd('0x26'))]=_0x2c46fe[_0x96fd('0x1e')];_0x5f03cc[util[_0x96fd('0x11')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x58061a;}return _0x5f03cc;};exports['toLowerVariables']=function(_0x4eb62a){var _0x8d8119={};for(var _0x25f743 in _0x4eb62a){if(_0x4eb62a['hasOwnProperty'](_0x25f743)){_0x8d8119[util[_0x96fd('0x11')]('%s',_[_0x96fd('0x27')](_0x25f743))]=_0x4eb62a[_0x25f743];}}return{'variables':_0x8d8119};};exports[_0x96fd('0x28')]=function(_0x4cca05,_0x76338d){if(!_[_0x96fd('0x15')](_0x4cca05)){if(_0x4cca05['hasOwnProperty'](_0x96fd('0x29'))){if(_0x4cca05['originated']>0x0){_0x4cca05[_0x96fd('0x29')]-=0x1;}else{logger[_0x96fd('0x8')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x76338d);}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x76338d);}};exports[_0x96fd('0x2a')]=function(_0x2e9ec6){var _0x44de1d=moment()[_0x96fd('0x11')](_0x96fd('0x2b'));_0x2e9ec6['state']=0xd;_0x2e9ec6['statedesc']=_0x96fd('0x2c');_0x2e9ec6['starttime']=_0x44de1d;_0x2e9ec6[_0x96fd('0x2d')]=_0x44de1d;_0x2e9ec6['endtime']=_0x44de1d;};exports[_0x96fd('0x2e')]=function(_0x1cf889,_0x44d67f,_0x50b9db){var _0xd2f686=moment()['format'](_0x96fd('0x2b'));_0x1cf889[_0x96fd('0x2f')]=_0x44d67f;_0x1cf889['statedesc']=_0x50b9db;_0x1cf889[_0x96fd('0x2d')]=_0xd2f686;_0x1cf889['ringtime']=utils[_0x96fd('0x30')](_0x1cf889[_0x96fd('0x2d')],_0x1cf889['starttime']);};exports[_0x96fd('0x31')]=function(_0x3a9daf,_0x9c30,_0x4cb08f){_0x3a9daf[_0x96fd('0x32')]=_0x9c30;_0x3a9daf['UserId']=_0x4cb08f;};exports[_0x96fd('0x33')]=function(_0xb7798a,_0x1cf1db,_0x3d5b7e){var _0x4c1ca9=moment()[_0x96fd('0x11')](_0x96fd('0x2b'));_0xb7798a['state']=_0x1cf1db;_0xb7798a['statedesc']=_0x3d5b7e;_0xb7798a['responsetime']=_0xb7798a[_0x96fd('0x2d')]?_0xb7798a[_0x96fd('0x2d')]:_0x4c1ca9;_0xb7798a[_0x96fd('0x34')]=_0xb7798a['endtime']?_0xb7798a['endtime']:_0x4c1ca9;_0xb7798a[_0x96fd('0x35')]=utils[_0x96fd('0x30')](_0xb7798a[_0x96fd('0x2d')]||0x0,_0xb7798a[_0x96fd('0x36')]||0x0);_0xb7798a[_0x96fd('0x37')]=_0xb7798a['answertime']?utils['getSeconds'](_0xb7798a['endtime'],_0xb7798a[_0x96fd('0x38')]):0x0;};exports['isFailure']=function(_0x1de97e){return _0x1de97e==='Failure';};exports[_0x96fd('0x39')]=function(_0xc2bf66,_0x4e0724,_0x3d451c,_0x27a022,_0x504678){var _0x5a10be=_0x27a022?'RECALL':_0xc2bf66[_0x96fd('0x19')];_0x5a10be=_0x504678?_0x96fd('0x3a'):_0x5a10be;return{'actionid':_0xc2bf66[_0x96fd('0x3b')],'action':_0x96fd('0x3c'),'channel':_0xc2bf66[_0x96fd('0x3d')],'callerid':util['format'](_0x96fd('0x18'),_0x5a10be,_0xc2bf66['calleridnum']),'Exten':'xcally-motion-preview','Context':_0x96fd('0x3e'),'Priority':'1','variable':_0x3d451c,'timeout':(_0x4e0724[_0x96fd('0x3f')]||0x1e)*0x3e8,'async':!![],'channelid':_0xc2bf66[_0x96fd('0x3b')]};};exports[_0x96fd('0x40')]=function(_0x3388c4){return _0x3388c4[_0x96fd('0x41')]+_0x3388c4[_0x96fd('0x42')]+_0x3388c4[_0x96fd('0x43')]+_0x3388c4['countagentrejectretry']+_0x3388c4[_0x96fd('0x44')];};exports[_0x96fd('0x45')]=function(_0x7f0c55){var _0x6ca1a8=_[_0x96fd('0x46')](_0x7f0c55);_0x6ca1a8[_0x96fd('0x2f')]=0xf;_0x6ca1a8['statedesc']='Global';return _0x6ca1a8;};exports['scheduledAt']=function(_0x33a327,_0x37bab6,_0x5901e8){var _0x13edf8={};_0x13edf8[_0x37bab6]=_0x33a327[_0x37bab6];_0x13edf8['active']=![];_0x13edf8[_0x96fd('0x47')]=moment()[_0x96fd('0x48')](_0x5901e8,_0x96fd('0x49'))[_0x96fd('0x11')](_0x96fd('0x2b'));_0x13edf8['ContactId']=_0x33a327['ContactId'];_0x13edf8[_0x96fd('0x4a')]=_0x33a327[_0x96fd('0x4a')];_0x13edf8['VoiceQueueId']=_0x33a327[_0x96fd('0x1b')]||undefined;return _0x13edf8;};exports[_0x96fd('0x4b')]=function(_0x4b3f36,_0x3cf597){if(!_[_0x96fd('0x15')](_0x4b3f36)){if(_0x4b3f36[_0x96fd('0x4c')]>0x0){_0x4b3f36[_0x96fd('0x4c')]-=0x1;}else{logger['error'](_0x3cf597,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0x96fd('0x8')](_0x3cf597,_0x96fd('0x4d'));}};exports['IsNotLoggedIn']=function(_0x20c47b){if(_0x20c47b<=0x0){return!![];}return![];};function buildObj(_0x40a779,_0x16fcb8,_0x587ccf){_0x40a779[_0x96fd('0x4e')]=_0x16fcb8;_0x40a779[_0x96fd('0x4f')]=_0x40a779[_0x96fd('0x50')];_0x40a779[_0x96fd('0x51')]=_0x40a779['channelAgent'];_0x40a779[_0x96fd('0x52')]=_0x96fd('0x53');if(_0x587ccf){_0x40a779['mandatoryDisposition']=_0x587ccf[_0x96fd('0x54')];}return _0x40a779;}exports['buildObj']=buildObj;exports[_0x96fd('0x55')]=function(_0x5f7e09){var _0x5e57fd=[];for(var _0x5d4949 in _0x5f7e09){if(_0x5f7e09[_0x96fd('0x56')](_0x5d4949)){if(!_[_0x96fd('0x15')](_0x5f7e09[_0x5d4949])&&_0x5f7e09[_0x5d4949][_0x96fd('0x2f')]===_0x96fd('0x57')&&_0x5f7e09[_0x5d4949][_0x96fd('0x58')]===_0x96fd('0x59')){_0x5e57fd['push'](_0x5f7e09[_0x5d4949]['id']);}}}return _0x5e57fd;};exports[_0x96fd('0x5a')]=function(_0x567aef){var _0x4595e1=moment()['milliseconds'](0x0);var _0x45ddf5=moment(_0x567aef)['milliseconds'](0x0);return _0x4595e1[_0x96fd('0x5b')](_0x45ddf5,_0x96fd('0x5c'));};exports[_0x96fd('0x5d')]=function(_0xf8dd2){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0xf8dd2['ContactId'],'ListId':_0xf8dd2[_0x96fd('0x4a')],'VoiceQueueId':_0xf8dd2['VoiceQueueId']||undefined,'CampaignId':_0xf8dd2[_0x96fd('0x5e')]||undefined};};exports[_0x96fd('0x5f')]=function(_0x2d8062){if(_0x2d8062===_0x96fd('0x3b')||_0x2d8062===_0x96fd('0x60')||_0x2d8062===_0x96fd('0x50')||_0x2d8062===_0x96fd('0x61')||_0x2d8062==='campaigntype'||_0x2d8062==='dialAnswer'||_0x2d8062==='membername'||_0x2d8062===_0x96fd('0x3d')||_0x2d8062===_0x96fd('0x19')||_0x2d8062===_0x96fd('0x62')||_0x2d8062==='calleridnum'||_0x2d8062===_0x96fd('0x47')||_0x2d8062===_0x96fd('0x41')||_0x2d8062===_0x96fd('0x42')||_0x2d8062===_0x96fd('0x43')||_0x2d8062===_0x96fd('0x63')||_0x2d8062===_0x96fd('0x64')||_0x2d8062==='callbackuniqueid'||_0x2d8062===_0x96fd('0x65')||_0x2d8062===_0x96fd('0x66')||_0x2d8062==='ContactId'||_0x2d8062==='ListId'||_0x2d8062===_0x96fd('0x67')||_0x2d8062===_0x96fd('0x1b')||_0x2d8062===_0x96fd('0x68')||_0x2d8062===_0x96fd('0x69')||_0x2d8062==='xmd-queue'||_0x2d8062===_0x96fd('0x6a')||_0x2d8062===_0x96fd('0x6b')||_0x2d8062==='xmd-dialurl'||_0x2d8062===_0x96fd('0x6c')||_0x2d8062===_0x96fd('0x6d')||_0x2d8062==='xmd-dialid'||_0x2d8062===_0x96fd('0x6e')||_0x2d8062===_0x96fd('0x6f')||_0x2d8062===_0x96fd('0x70')||_0x2d8062===_0x96fd('0x71')||_0x2d8062===_0x96fd('0x72')||_0x2d8062===_0x96fd('0x73')||_0x2d8062===_0x96fd('0x74')||_0x2d8062==='rtpaudioqosbridged'||_0x2d8062===_0x96fd('0x75')||_0x2d8062===_0x96fd('0x76')||_0x2d8062==='rtpaudioqosloss'||_0x2d8062===_0x96fd('0x77')||_0x2d8062===_0x96fd('0x78')||_0x2d8062===_0x96fd('0x79')||_0x2d8062===_0x96fd('0x74')||_0x2d8062===_0x96fd('0x7a')||_0x2d8062===_0x96fd('0x75')||_0x2d8062===_0x96fd('0x76')||_0x2d8062==='rtpaudioqosloss'||_0x2d8062==='rtpaudioqoslossbridged'||_0x2d8062===_0x96fd('0x78')||_0x2d8062===_0x96fd('0x79')||_0x2d8062===_0x96fd('0x7b')||_0x2d8062===_0x96fd('0x7c')||_0x2d8062===_0x96fd('0x2f')||_0x2d8062==='statedesc'){return![];}return!![];};exports[_0x96fd('0x7d')]=function(_0x4f84a1,_0x163d4c){var _0x4ab9c3,_0x37b9cb,_0x343acf;if(_0x163d4c<=0x0){_0x163d4c=0x1;}_0x4ab9c3=new RegExp(_0x96fd('0x7e')+_0x163d4c+'}$');_0x37b9cb=Math['pow'](0xa,_0x163d4c-0x1);_0x343acf=Math[_0x96fd('0x7f')](0xa,_0x163d4c)-0x1;return util[_0x96fd('0x11')]('%s',_[_0x96fd('0x80')](_0x4f84a1,_0x4ab9c3,_[_0x96fd('0x81')](_0x37b9cb,_0x343acf)));};exports[_0x96fd('0x82')]=function(_0xc57065){var _0x4f447d=_0xc57065[_0x96fd('0x83')](/"(.*?)"/);return _0x4f447d?_0x4f447d[0x1]:_0xc57065;};exports[_0x96fd('0x84')]=function(_0x176f2d){var _0x4337bf=_0x176f2d['match'](/<(.*?)>/);return _0x4337bf?_0x4337bf[0x1]:_0x176f2d;};function buildNoAnswerEventPayload(_0xc79bab,_0x51454f){var _0x3a950e=buildObj(_0xc79bab,'noanswer');if(!_[_0x96fd('0x10')](_0x51454f[_0x96fd('0x85')])){Object['keys'](_0x51454f[_0x96fd('0x85')])[_0x96fd('0x86')](function(_0x8419f8){_0x3a950e[_0x8419f8[_0x96fd('0x87')]()]=_0x51454f['variables'][_0x8419f8];});}return _0x3a950e;}exports[_0x96fd('0x88')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0x628e=['rtpaudioqosbridged','getCallerIdRandom','\x5cw{0,','pow','replace','extractCalleridName','match','extractCalleridNumber','noanswer','forEach','toLowerCase','variables','util','../../../../config/logger','env','127.0.0.1','../../dialer/utils','loggerCatch','error','inspect','logger','info','loggerError','logger2','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','Queue','name','calleridname','calleridnum','ContactId','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','NONE','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','toLowerVariables','toLower','updateOriginated','hasOwnProperty','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','starttime','responsetime','endtime','logAgent','ringtime','getSeconds','logLookAgent','membername','logCustomer','talktime','answertime','Failure','RECALL','uniqueid','originate','channelAgent','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','active','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','interface','motionChannel','voice','mandatoryDisposition','buildObj','agentReadyId','status','reachable','getDiff','milliseconds','seconds','createBody','filterKey','idContact','campaigntype','dialAnswer','scheduledat','countglobal','callback','callbackuniqueid','callbackat','recallme','UserId','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agi','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos'];(function(_0x226a13,_0x3609a1){var _0x1fa9f0=function(_0x229804){while(--_0x229804){_0x226a13['push'](_0x226a13['shift']());}};_0x1fa9f0(++_0x3609a1);}(_0x628e,0x97));var _0xe628=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x628e[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xe628('0x0'));var _=require('lodash');var moment=require('moment');var logger=require(_0xe628('0x1'))('preview');var ipAgi=process[_0xe628('0x2')]['XCALLY_IP_AGI']||_0xe628('0x3');var utils=require(_0xe628('0x4'));exports[_0xe628('0x5')]=function(_0x47065d){return function(_0x4f7204){logger[_0xe628('0x6')](_0x47065d,util[_0xe628('0x7')](_0x4f7204,{'showHidden':![],'depth':null}));};};exports[_0xe628('0x8')]=function(_0x584a40,_0x356ed4){logger[_0xe628('0x9')](_0x584a40,util['inspect'](_0x356ed4,{'showHidden':![],'depth':null}));};exports[_0xe628('0xa')]=function(_0x42a23a,_0x2ae713){logger['error'](_0x42a23a,util[_0xe628('0x7')](_0x2ae713,{'showHidden':![],'depth':null}));};exports[_0xe628('0xb')]=function(_0x4cda6f){return function(_0x1fc16f){logger[_0xe628('0x9')](_0x4cda6f,util[_0xe628('0x7')](_0x1fc16f,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x502e80,_0x45a123,_0x54b6cf){return{'message':_0x502e80,'unlock':_0x45a123,'active':_0x54b6cf};};exports[_0xe628('0xc')]=function(_0x1a4c05,_0x4f7122,_0x874fa8){if(!_[_0xe628('0xd')](_0x874fa8)&&_0xe628('0xe')===typeof _0x874fa8&&!_[_0xe628('0xf')](_0x874fa8)){if(!_[_0xe628('0xd')](_0x4f7122)&&_0xe628('0xe')===typeof _0x4f7122&&!_[_0xe628('0xf')](_0x4f7122)){return util[_0xe628('0x10')](_0xe628('0x11'),_0x4f7122,_0x874fa8);}return util[_0xe628('0x10')](_0xe628('0x11'),_0x874fa8,_0x874fa8);}if(!_[_0xe628('0xd')](_0x1a4c05)&&_0xe628('0xe')===typeof _0x1a4c05&&!_[_0xe628('0xf')](_0x1a4c05)){return _0x1a4c05;}return _0xe628('0x12');};exports[_0xe628('0x13')]=function(_0x386c4f){if(_[_0xe628('0x14')](_0x386c4f)){return![];}return _0x386c4f;};exports['addVariables']=function(_0x1588c5,_0x131353,_0x250244,_0x2d216d,_0x20fcec,_0x1639a4){var _0x20be40={'XMD-QUEUE':_0x131353[_0xe628('0x15')]?_0x131353[_0xe628('0x15')][_0xe628('0x16')]:'','XMD-CALLERID':_0x2d216d,'XMD-CALLERID-PREVIEW':_0x1639a4?util[_0xe628('0x10')](_0xe628('0x11'),_0x1639a4[_0xe628('0x17')],_0x1639a4[_0xe628('0x18')]):_0x2d216d,'XMD-DIALID':_0x20fcec,'XMD-CONTACTID':_0x131353[_0xe628('0x19')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x2d216d,'XMD-VOICEQUEUEID':_0x131353[_0xe628('0x1a')],'XMD-DIALCHANNEL':_0x250244,'XMD-DIALTIMEOUT':_0x1588c5[_0xe628('0x1b')]||0x1e,'XMD-DIALOPTIONS':util[_0xe628('0x10')]('\x22rtTxX%s%s\x22',_0x1588c5[_0xe628('0x1c')]?'g':'',_[_0xe628('0xf')](_0x1588c5[_0xe628('0x1d')])?'':_0xe628('0x1e')),'XMD-DIALURL':_0x1588c5[_0xe628('0x1f')]||'','XMD-AGI':_0x1588c5['dialQueueProject']?util[_0xe628('0x10')]('\x22agi://%s/square,%s\x22',ipAgi,_0x1588c5[_0xe628('0x20')]):'NONE','XMD-AGIAFTER':_0x1588c5['dialQueueProject2']?util[_0xe628('0x10')]('\x22agi://%s/square,%s\x22',ipAgi,_0x1588c5[_0xe628('0x1c')]):_0xe628('0x21'),'XMD-ORIGINATECALLERIDNUM':_0x1639a4?_0x1639a4['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x1639a4?_0x1639a4['originatecalleridname']:'','XMD-DESTINATION':_0xe628('0x22'),'SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_['isEmpty'](_0x1588c5[_0xe628('0x1d')])){_0x20be40[util[_0xe628('0x10')]('%s',_0xe628('0x23'))]=_0x1588c5['monitor_format'];_0x20be40[util[_0xe628('0x10')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x20fcec;}return _0x20be40;};exports[_0xe628('0x24')]=function(_0x1e2180){var _0x57611d={};for(var _0x1eac75 in _0x1e2180){if(_0x1e2180['hasOwnProperty'](_0x1eac75)){_0x57611d[util[_0xe628('0x10')]('%s',_[_0xe628('0x25')](_0x1eac75))]=_0x1e2180[_0x1eac75];}}return{'variables':_0x57611d};};exports[_0xe628('0x26')]=function(_0x1478af,_0x394d38){if(!_[_0xe628('0x14')](_0x1478af)){if(_0x1478af[_0xe628('0x27')](_0xe628('0x28'))){if(_0x1478af[_0xe628('0x28')]>0x0){_0x1478af[_0xe628('0x28')]-=0x1;}else{logger[_0xe628('0x6')](_0xe628('0x29'),_0x394d38);}}}else{logger['error'](_0xe628('0x2a'),_0x394d38);}};exports['logBlacklist']=function(_0x191726){var _0x59f2a4=moment()[_0xe628('0x10')](_0xe628('0x2b'));_0x191726[_0xe628('0x2c')]=0xd;_0x191726[_0xe628('0x2d')]='Blacklist';_0x191726[_0xe628('0x2e')]=_0x59f2a4;_0x191726[_0xe628('0x2f')]=_0x59f2a4;_0x191726[_0xe628('0x30')]=_0x59f2a4;};exports[_0xe628('0x31')]=function(_0x108f26,_0x400d32,_0x45929f){var _0x59905d=moment()[_0xe628('0x10')](_0xe628('0x2b'));_0x108f26[_0xe628('0x2c')]=_0x400d32;_0x108f26[_0xe628('0x2d')]=_0x45929f;_0x108f26['responsetime']=_0x59905d;_0x108f26[_0xe628('0x32')]=utils[_0xe628('0x33')](_0x108f26[_0xe628('0x2f')],_0x108f26[_0xe628('0x2e')]);};exports[_0xe628('0x34')]=function(_0x86f5e4,_0x4321e3,_0x5b0dd3){_0x86f5e4[_0xe628('0x35')]=_0x4321e3;_0x86f5e4['UserId']=_0x5b0dd3;};exports[_0xe628('0x36')]=function(_0x248ed1,_0x1f226c,_0x4b2ab9){var _0x4c535e=moment()[_0xe628('0x10')](_0xe628('0x2b'));_0x248ed1[_0xe628('0x2c')]=_0x1f226c;_0x248ed1['statedesc']=_0x4b2ab9;_0x248ed1[_0xe628('0x2f')]=_0x248ed1['responsetime']?_0x248ed1['responsetime']:_0x4c535e;_0x248ed1[_0xe628('0x30')]=_0x248ed1['endtime']?_0x248ed1[_0xe628('0x30')]:_0x4c535e;_0x248ed1[_0xe628('0x32')]=utils[_0xe628('0x33')](_0x248ed1[_0xe628('0x2f')]||0x0,_0x248ed1[_0xe628('0x2e')]||0x0);_0x248ed1[_0xe628('0x37')]=_0x248ed1[_0xe628('0x38')]?utils[_0xe628('0x33')](_0x248ed1[_0xe628('0x30')],_0x248ed1[_0xe628('0x38')]):0x0;};exports['isFailure']=function(_0x461127){return _0x461127===_0xe628('0x39');};exports['variablesAction']=function(_0x4ef361,_0x3dc956,_0x41455e,_0x56d0b1,_0x331530){var _0x29c578=_0x56d0b1?_0xe628('0x3a'):_0x4ef361['calleridname'];_0x29c578=_0x331530?'BOOKED':_0x29c578;return{'actionid':_0x4ef361[_0xe628('0x3b')],'action':_0xe628('0x3c'),'channel':_0x4ef361[_0xe628('0x3d')],'callerid':util[_0xe628('0x10')](_0xe628('0x11'),_0x29c578,_0x4ef361['calleridnum']),'Exten':'xcally-motion-preview','Context':'from-sip','Priority':'1','variable':_0x41455e,'timeout':(_0x3dc956[_0xe628('0x3e')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4ef361['uniqueid']};};exports[_0xe628('0x3f')]=function(_0x2e28a6){return _0x2e28a6[_0xe628('0x40')]+_0x2e28a6[_0xe628('0x41')]+_0x2e28a6[_0xe628('0x42')]+_0x2e28a6[_0xe628('0x43')]+_0x2e28a6[_0xe628('0x44')];};exports[_0xe628('0x45')]=function(_0xf42919){var _0x46627b=_[_0xe628('0x46')](_0xf42919);_0x46627b[_0xe628('0x2c')]=0xf;_0x46627b[_0xe628('0x2d')]=_0xe628('0x47');return _0x46627b;};exports[_0xe628('0x48')]=function(_0x4c473b,_0x1e72b4,_0x4be53f){var _0x12aca3={};_0x12aca3[_0x1e72b4]=_0x4c473b[_0x1e72b4];_0x12aca3[_0xe628('0x49')]=![];_0x12aca3['scheduledat']=moment()[_0xe628('0x4a')](_0x4be53f,_0xe628('0x4b'))[_0xe628('0x10')](_0xe628('0x2b'));_0x12aca3[_0xe628('0x19')]=_0x4c473b[_0xe628('0x19')];_0x12aca3[_0xe628('0x4c')]=_0x4c473b['ListId'];_0x12aca3['VoiceQueueId']=_0x4c473b[_0xe628('0x1a')]||undefined;return _0x12aca3;};exports[_0xe628('0x4d')]=function(_0x206cf7,_0x1e77fc){if(!_[_0xe628('0x14')](_0x206cf7)){if(_0x206cf7[_0xe628('0x4e')]>0x0){_0x206cf7[_0xe628('0x4e')]-=0x1;}else{logger[_0xe628('0x6')](_0x1e77fc,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger['error'](_0x1e77fc,_0xe628('0x4f'));}};exports[_0xe628('0x50')]=function(_0x2edca3){if(_0x2edca3<=0x0){return!![];}return![];};function buildObj(_0x1ccdfe,_0x9d5581,_0x38dbfb){_0x1ccdfe[_0xe628('0x51')]=_0x9d5581;_0x1ccdfe[_0xe628('0x16')]=_0x1ccdfe[_0xe628('0x52')];_0x1ccdfe[_0xe628('0x53')]=_0x1ccdfe[_0xe628('0x3d')];_0x1ccdfe[_0xe628('0x54')]=_0xe628('0x55');if(_0x38dbfb){_0x1ccdfe[_0xe628('0x56')]=_0x38dbfb[_0xe628('0x56')];}return _0x1ccdfe;}exports[_0xe628('0x57')]=buildObj;exports[_0xe628('0x58')]=function(_0x54bdf7){var _0x44f7df=[];for(var _0x1492d0 in _0x54bdf7){if(_0x54bdf7['hasOwnProperty'](_0x1492d0)){if(!_[_0xe628('0x14')](_0x54bdf7[_0x1492d0])&&_0x54bdf7[_0x1492d0]['state']==='not_inuse'&&_0x54bdf7[_0x1492d0][_0xe628('0x59')]===_0xe628('0x5a')){_0x44f7df['push'](_0x54bdf7[_0x1492d0]['id']);}}}return _0x44f7df;};exports[_0xe628('0x5b')]=function(_0x421efd){var _0x2627bb=moment()[_0xe628('0x5c')](0x0);var _0x1c5605=moment(_0x421efd)[_0xe628('0x5c')](0x0);return _0x2627bb['diff'](_0x1c5605,_0xe628('0x5d'));};exports[_0xe628('0x5e')]=function(_0x4fb991){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x4fb991[_0xe628('0x19')],'ListId':_0x4fb991[_0xe628('0x4c')],'VoiceQueueId':_0x4fb991[_0xe628('0x1a')]||undefined,'CampaignId':_0x4fb991['CampaignId']||undefined};};exports[_0xe628('0x5f')]=function(_0x2fc4dd){if(_0x2fc4dd===_0xe628('0x3b')||_0x2fc4dd===_0xe628('0x60')||_0x2fc4dd===_0xe628('0x52')||_0x2fc4dd==='type'||_0x2fc4dd===_0xe628('0x61')||_0x2fc4dd===_0xe628('0x62')||_0x2fc4dd===_0xe628('0x35')||_0x2fc4dd===_0xe628('0x3d')||_0x2fc4dd===_0xe628('0x17')||_0x2fc4dd==='active'||_0x2fc4dd===_0xe628('0x18')||_0x2fc4dd===_0xe628('0x63')||_0x2fc4dd===_0xe628('0x40')||_0x2fc4dd===_0xe628('0x41')||_0x2fc4dd===_0xe628('0x42')||_0x2fc4dd===_0xe628('0x64')||_0x2fc4dd===_0xe628('0x65')||_0x2fc4dd===_0xe628('0x66')||_0x2fc4dd===_0xe628('0x67')||_0x2fc4dd===_0xe628('0x68')||_0x2fc4dd===_0xe628('0x19')||_0x2fc4dd===_0xe628('0x4c')||_0x2fc4dd===_0xe628('0x69')||_0x2fc4dd===_0xe628('0x1a')||_0x2fc4dd===_0xe628('0x6a')||_0x2fc4dd===_0xe628('0x6b')||_0x2fc4dd===_0xe628('0x6c')||_0x2fc4dd===_0xe628('0x6d')||_0x2fc4dd===_0xe628('0x6e')||_0x2fc4dd===_0xe628('0x6f')||_0x2fc4dd===_0xe628('0x70')||_0x2fc4dd===_0xe628('0x71')||_0x2fc4dd===_0xe628('0x72')||_0x2fc4dd===_0xe628('0x73')||_0x2fc4dd===_0xe628('0x74')||_0x2fc4dd===_0xe628('0x75')||_0x2fc4dd===_0xe628('0x76')||_0x2fc4dd==='xmd-agiafter'||_0x2fc4dd===_0xe628('0x77')||_0x2fc4dd==='rtpaudioqos'||_0x2fc4dd==='rtpaudioqosbridged'||_0x2fc4dd===_0xe628('0x78')||_0x2fc4dd===_0xe628('0x79')||_0x2fc4dd===_0xe628('0x7a')||_0x2fc4dd===_0xe628('0x7b')||_0x2fc4dd===_0xe628('0x7c')||_0x2fc4dd===_0xe628('0x7d')||_0x2fc4dd===_0xe628('0x7e')||_0x2fc4dd===_0xe628('0x7f')||_0x2fc4dd===_0xe628('0x78')||_0x2fc4dd===_0xe628('0x79')||_0x2fc4dd===_0xe628('0x7a')||_0x2fc4dd===_0xe628('0x7b')||_0x2fc4dd===_0xe628('0x7c')||_0x2fc4dd===_0xe628('0x7d')||_0x2fc4dd==='bridgepeer'||_0x2fc4dd==='bridgepvtcallid'||_0x2fc4dd===_0xe628('0x2c')||_0x2fc4dd===_0xe628('0x2d')){return![];}return!![];};exports[_0xe628('0x80')]=function(_0x1d35c5,_0x286d53){var _0x547842,_0x2bf9a6,_0x3e76ed;if(_0x286d53<=0x0){_0x286d53=0x1;}_0x547842=new RegExp(_0xe628('0x81')+_0x286d53+'}$');_0x2bf9a6=Math['pow'](0xa,_0x286d53-0x1);_0x3e76ed=Math[_0xe628('0x82')](0xa,_0x286d53)-0x1;return util[_0xe628('0x10')]('%s',_[_0xe628('0x83')](_0x1d35c5,_0x547842,_['random'](_0x2bf9a6,_0x3e76ed)));};exports[_0xe628('0x84')]=function(_0x5762d8){var _0x495af6=_0x5762d8[_0xe628('0x85')](/"(.*?)"/);return _0x495af6?_0x495af6[0x1]:_0x5762d8;};exports[_0xe628('0x86')]=function(_0x3676dd){var _0x1692e3=_0x3676dd[_0xe628('0x85')](/<(.*?)>/);return _0x1692e3?_0x1692e3[0x1]:_0x3676dd;};function buildNoAnswerEventPayload(_0xf02ac4,_0x38d31b){var _0x591e18=buildObj(_0xf02ac4,_0xe628('0x87'));if(!_[_0xe628('0xf')](_0x38d31b['variables'])){Object['keys'](_0x38d31b['variables'])[_0xe628('0x88')](function(_0x106f48){_0x591e18[_0x106f48[_0xe628('0x89')]()]=_0x38d31b[_0xe628('0x8a')][_0x106f48];});}return _0x591e18;}exports['buildNoAnswerEventPayload']=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 60a0dcd..1be90f5 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 _0xeaa5=['queueadd','string','queuepause','boolean','voicequeuechannel','voicechannel','voicequeuechannelhangup'];(function(_0x5b951b,_0x5838e3){var _0x37d083=function(_0x513ac3){while(--_0x513ac3){_0x5b951b['push'](_0x5b951b['shift']());}};_0x37d083(++_0x5838e3);}(_0xeaa5,0x1ce));var _0x5eaa=function(_0x59d907,_0x4c0e8e){_0x59d907=_0x59d907-0x0;var _0x39771b=_0xeaa5[_0x59d907];return _0x39771b;};'use strict';exports[_0x5eaa('0x0')]={'queue':{'type':_0x5eaa('0x1'),'required':!![]},'interface':{'type':_0x5eaa('0x1'),'required':!![]},'membername':{'type':_0x5eaa('0x1'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':'boolean','required':![]}};exports['queueremove']={'queue':{'type':_0x5eaa('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0x5eaa('0x2')]={'interface':{'type':_0x5eaa('0x1'),'required':!![]},'paused':{'type':_0x5eaa('0x3')},'reason':{'type':'string','required':![]}};exports['reload']={'module':{'type':'string','required':![]}};exports[_0x5eaa('0x4')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x5eaa('0x5')]={'uniqueid':{'type':_0x5eaa('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':'string'},'mixmonitorid':{'type':_0x5eaa('0x1')}};exports[_0x5eaa('0x6')]={'uniqueid':{'type':_0x5eaa('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x5eaa('0x1'),'required':!![]},'exten':{'type':_0x5eaa('0x1'),'required':!![]},'context':{'type':_0x5eaa('0x1')}}; \ No newline at end of file +var _0x358f=['voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number','boolean','queuepause','reload','voicequeuechannel'];(function(_0x5b3968,_0x5424a2){var _0x1b0b09=function(_0x39b98c){while(--_0x39b98c){_0x5b3968['push'](_0x5b3968['shift']());}};_0x1b0b09(++_0x5424a2);}(_0x358f,0x111));var _0xf358=function(_0x22d08b,_0xb67373){_0x22d08b=_0x22d08b-0x0;var _0x31de72=_0x358f[_0x22d08b];return _0x31de72;};'use strict';exports[_0xf358('0x0')]={'queue':{'type':_0xf358('0x1'),'required':!![]},'interface':{'type':_0xf358('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0xf358('0x2'),'required':![]},'paused':{'type':_0xf358('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':'string','required':!![]},'interface':{'type':_0xf358('0x1'),'required':!![]}};exports[_0xf358('0x4')]={'interface':{'type':_0xf358('0x1'),'required':!![]},'paused':{'type':_0xf358('0x3')},'reason':{'type':_0xf358('0x1'),'required':![]}};exports[_0xf358('0x5')]={'module':{'type':_0xf358('0x1'),'required':![]}};exports[_0xf358('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xf358('0x7')]={'uniqueid':{'type':_0xf358('0x1'),'required':!![]},'filename':{'type':_0xf358('0x1')},'format':{'type':_0xf358('0x1')},'mixmonitorid':{'type':'string'}};exports[_0xf358('0x8')]={'uniqueid':{'type':_0xf358('0x1'),'required':!![]}};exports[_0xf358('0x9')]={'uniqueid':{'type':_0xf358('0x1'),'required':!![]},'exten':{'type':_0xf358('0x1'),'required':!![]},'context':{'type':'string'}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index abcf214..8b52ed6 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 _0xdb28=['initTriggers','triggers','initTemplates','initZendeskAccounts','zendeskAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','groupBy','uniqueid','queuecallerexit','queuecallerabandon','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','diff','queuecallercomplete','queuecallerleaveAt','initVoiceCallReports','outbound','duration','disposition','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initVoiceQueues','exports','lodash','moment','util','../model/agent','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','telephones','trunks','voiceQueues','campaigns','templates','voiceExtensions','channels','queueChannels','outboundChannels','timers','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','isNil','interface','sumDuration','sumBillable','isEmpty','ivrAnswerCallsDay','total','answered','unmanaged','abandoned','sumHoldTime','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','initAgents','agents','length','isUndefined','mergeFromDatabase','initTelephones','initTrunks'];(function(_0x1b2df5,_0x140e9c){var _0x35c8a8=function(_0x42c33e){while(--_0x42c33e){_0x1b2df5['push'](_0x1b2df5['shift']());}};_0x35c8a8(++_0x140e9c);}(_0xdb28,0x106));var _0x8db2=function(_0x104a18,_0x102a48){_0x104a18=_0x104a18-0x0;var _0x529c67=_0xdb28[_0x104a18];return _0x529c67;};'use strict';var _=require(_0x8db2('0x0'));var moment=require(_0x8db2('0x1'));var util=require(_0x8db2('0x2'));var Agent=require(_0x8db2('0x3'));var Telephone=require('../model/telephone');var Trunk=require(_0x8db2('0x4'));var VoiceQueue=require(_0x8db2('0x5'));var Trigger=require(_0x8db2('0x6'));var Template=require(_0x8db2('0x7'));var Campaign=require(_0x8db2('0x8'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x8db2('0x9'));var SalesforceAccount=require(_0x8db2('0xa'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0x8db2('0xb'));var DeskAccount=require(_0x8db2('0xc'));var VtigerAccount=require(_0x8db2('0xd'));var ServicenowAccount=require(_0x8db2('0xe'));var Dynamics365Account=require(_0x8db2('0xf'));var FreshsalesAccount=require(_0x8db2('0x10'));var FaxAccount=require(_0x8db2('0x11'));function Realtime(){this['agents']={};this[_0x8db2('0x12')]={};this[_0x8db2('0x13')]={};this[_0x8db2('0x14')]={};this['triggers']={};this[_0x8db2('0x15')]={};this[_0x8db2('0x16')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x8db2('0x17')]={};this[_0x8db2('0x18')]={};this[_0x8db2('0x19')]={};this[_0x8db2('0x1a')]={};this[_0x8db2('0x1b')]={};this['settings']={};this['zendeskAccounts']={};this[_0x8db2('0x1c')]={};this[_0x8db2('0x1d')]={};this[_0x8db2('0x1e')]={};this[_0x8db2('0x1f')]={};this[_0x8db2('0x20')]={};this[_0x8db2('0x21')]={};this[_0x8db2('0x22')]={};this[_0x8db2('0x23')]={};this[_0x8db2('0x24')]={};this[_0x8db2('0x25')]={};}function freeIsNotKey(_0x5489a9,_0x13b0f5,_0x24da1b){var _0x48101e=_[_0x8db2('0x26')](_0x5489a9,function(_0x44957d){return _0x44957d[_0x24da1b];});for(var _0x21db8c in _0x13b0f5){if(_0x13b0f5[_0x8db2('0x27')](_0x21db8c)){if(!_0x48101e[_0x21db8c]){delete _0x13b0f5[_0x21db8c];}}}}function freeIsNotKeySip(_0x2efd06,_0x46ce14){var _0x51d60d=_['mapKeys'](_0x2efd06,function(_0x77789){return util[_0x8db2('0x28')](_0x8db2('0x29'),_0x77789[_0x8db2('0x2a')]);});for(var _0x58562e in _0x46ce14){if(_0x46ce14[_0x8db2('0x27')](_0x58562e)){if(!_0x51d60d[_0x58562e]){delete _0x46ce14[_0x58562e];}}}}function freeIsNotKeyAgent(_0x36a9ff,_0x260940){var _0x297ba3=_[_0x8db2('0x26')](_0x36a9ff,function(_0x597260){var _0x124467=_[_0x8db2('0x2b')](_0x597260[_0x8db2('0x2c')])?util[_0x8db2('0x28')](_0x8db2('0x29'),_0x597260[_0x8db2('0x2a')]):_0x597260[_0x8db2('0x2c')];return _0x124467;});for(var _0x5c6614 in _0x260940){if(_0x260940[_0x8db2('0x27')](_0x5c6614)){if(!_0x297ba3[_0x5c6614]){delete _0x260940[_0x5c6614];}}}}function clearVoiceCallReports(_0x4f6516){_0x4f6516['total']=0x0;_0x4f6516['answered']=0x0;_0x4f6516['sumHoldTime']=0x0;_0x4f6516[_0x8db2('0x2d')]=0x0;_0x4f6516[_0x8db2('0x2e')]=0x0;}function clearCampaigns(_0x3be281){if(!_[_0x8db2('0x2f')](_0x3be281)){for(var _0x145328 in _0x3be281){if(_0x3be281[_0x8db2('0x27')](_0x145328)){_0x3be281[_0x145328]['ivrTotalCallsDays']=0x0;_0x3be281[_0x145328][_0x8db2('0x30')]=0x0;}}}}function clearVoiceQueues(_0x372311){if(!_[_0x8db2('0x2f')](_0x372311)){for(var _0x8b7cec in _0x372311){if(_0x372311['hasOwnProperty'](_0x8b7cec)){_0x372311[_0x8b7cec][_0x8db2('0x31')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x32')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x33')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x34')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x35')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x2d')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x2e')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x36')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x37')]=0x0;_0x372311[_0x8b7cec]['outboundBusyCallsDay']=0x0;_0x372311[_0x8b7cec][_0x8db2('0x38')]=0x0;_0x372311[_0x8b7cec]['outboundNoSuchCallsDay']=0x0;_0x372311[_0x8b7cec]['outboundUnknownCallsDay']=0x0;_0x372311[_0x8b7cec][_0x8db2('0x39')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x3a')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x3b')]=0x0;_0x372311[_0x8b7cec]['outboundOriginateFailureCallsDay']=0x0;_0x372311[_0x8b7cec][_0x8db2('0x3c')]=0x0;_0x372311[_0x8b7cec]['outboundReCallsDay']=0x0;_0x372311[_0x8b7cec][_0x8db2('0x36')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x3d')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x3e')]=!![];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x35d337,_0x1a460b){for(var _0x4df530 in _0x1a460b){if(_0x35d337['hasOwnProperty'](_0x4df530)){_0x35d337[_0x4df530]=_0x1a460b[_0x4df530];}}};Realtime[_0x8db2('0x3f')][_0x8db2('0x40')]=function(){var _0xc884a=this;return function(_0x2a2d65){if(_0x2a2d65){freeIsNotKeyAgent(_0x2a2d65,_0xc884a[_0x8db2('0x41')]);for(var _0xd39848=0x0,_0x101711={};_0xd39848<_0x2a2d65[_0x8db2('0x42')];_0xd39848+=0x1){_0x101711=_0x2a2d65[_0xd39848];var _0x46e0c8=_[_0x8db2('0x2b')](_0x101711['interface'])?util[_0x8db2('0x28')](_0x8db2('0x29'),_0x101711['name']):_0x101711[_0x8db2('0x2c')];if(_[_0x8db2('0x43')](_0xc884a['agents'][_0x46e0c8])){_0xc884a['agents'][_0x46e0c8]=new Agent(_0x101711);}else{_0xc884a[_0x8db2('0x44')](_0xc884a['agents'][_0x46e0c8],_0x101711);}}}return _0xc884a[_0x8db2('0x41')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x45')]=function(){var _0x22c896=this;return function(_0x5cc419){if(_0x5cc419){freeIsNotKeySip(_0x5cc419,_0x22c896[_0x8db2('0x12')]);for(var _0x5e34e0=0x0,_0x227a08={};_0x5e34e0<_0x5cc419[_0x8db2('0x42')];_0x5e34e0+=0x1){_0x227a08=_0x5cc419[_0x5e34e0];if(_[_0x8db2('0x43')](_0x22c896[_0x8db2('0x12')][util['format']('SIP/%s',_0x227a08[_0x8db2('0x2a')])])){_0x22c896[_0x8db2('0x12')][util['format'](_0x8db2('0x29'),_0x227a08[_0x8db2('0x2a')])]=new Telephone(_0x227a08);}else{_0x22c896[_0x8db2('0x44')](_0x22c896['telephones'][util[_0x8db2('0x28')](_0x8db2('0x29'),_0x227a08[_0x8db2('0x2a')])],_0x227a08);}}}return _0x22c896[_0x8db2('0x12')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x46')]=function(){var _0x380046=this;return function(_0x1575ea){if(_0x1575ea){freeIsNotKeySip(_0x1575ea,_0x380046[_0x8db2('0x13')]);for(var _0x63c561=0x0,_0x21cf7c={};_0x63c561<_0x1575ea[_0x8db2('0x42')];_0x63c561+=0x1){_0x21cf7c=_0x1575ea[_0x63c561];if(_[_0x8db2('0x43')](_0x380046['trunks'][util[_0x8db2('0x28')](_0x8db2('0x29'),_0x21cf7c['name'])])){_0x380046['trunks'][util[_0x8db2('0x28')]('SIP/%s',_0x21cf7c[_0x8db2('0x2a')])]=new Trunk(_0x21cf7c);}else{_0x380046[_0x8db2('0x44')](_0x380046[_0x8db2('0x13')][util[_0x8db2('0x28')](_0x8db2('0x29'),_0x21cf7c[_0x8db2('0x2a')])],_0x21cf7c);}}}return _0x380046[_0x8db2('0x13')];};};Realtime['prototype'][_0x8db2('0x47')]=function(){var _0x3d44de=this;return function(_0x40c69e){if(_0x40c69e){freeIsNotKey(_0x40c69e,_0x3d44de[_0x8db2('0x48')],'id');for(var _0x482b26=0x0,_0x424c27={};_0x482b26<_0x40c69e[_0x8db2('0x42')];_0x482b26+=0x1){_0x424c27=_0x40c69e[_0x482b26];if(_[_0x8db2('0x43')](_0x3d44de[_0x8db2('0x48')][_0x424c27['id']])){_0x3d44de['triggers'][_0x424c27['id']]=new Trigger(_0x424c27);}else{_0x3d44de[_0x8db2('0x44')](_0x3d44de['triggers'][_0x424c27['id']],_0x424c27);}}}return _0x3d44de[_0x8db2('0x48')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x49')]=function(){var _0x4d2164=this;return function(_0x4b0e72){if(_0x4b0e72){freeIsNotKey(_0x4b0e72,_0x4d2164[_0x8db2('0x16')],'id');for(var _0x47c556=0x0,_0x173cc7={};_0x47c556<_0x4b0e72[_0x8db2('0x42')];_0x47c556+=0x1){_0x173cc7=_0x4b0e72[_0x47c556];if(_[_0x8db2('0x43')](_0x4d2164[_0x8db2('0x16')][_0x173cc7['id']])){_0x4d2164[_0x8db2('0x16')][_0x173cc7['id']]=new Template(_0x173cc7);}else{_0x4d2164[_0x8db2('0x44')](_0x4d2164[_0x8db2('0x16')][_0x173cc7['id']],_0x173cc7);}}}return _0x4d2164[_0x8db2('0x16')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x4a')]=function(){var _0x1362ed=this;return function(_0x36f9d6){if(_0x36f9d6){freeIsNotKey(_0x36f9d6,_0x1362ed['zendeskAccounts'],'id');for(var _0x449109=0x0,_0x2ada52={};_0x449109<_0x36f9d6[_0x8db2('0x42')];_0x449109+=0x1){_0x2ada52=_0x36f9d6[_0x449109];if(_[_0x8db2('0x43')](_0x1362ed['zendeskAccounts'][_0x2ada52['id']])){_0x1362ed['zendeskAccounts'][_0x2ada52['id']]=new ZendeskAccount(_0x2ada52);}else{_0x1362ed[_0x8db2('0x44')](_0x1362ed[_0x8db2('0x4b')][_0x2ada52['id']],_0x2ada52);}}}return _0x1362ed[_0x8db2('0x4b')];};};Realtime['prototype']['initSalesforceAccounts']=function(){var _0x494d6e=this;return function(_0x44ac56){if(_0x44ac56){freeIsNotKey(_0x44ac56,_0x494d6e[_0x8db2('0x1c')],'id');for(var _0x55c7dd=0x0,_0x383fa1={};_0x55c7dd<_0x44ac56[_0x8db2('0x42')];_0x55c7dd+=0x1){_0x383fa1=_0x44ac56[_0x55c7dd];if(_[_0x8db2('0x43')](_0x494d6e[_0x8db2('0x1c')][_0x383fa1['id']])){_0x494d6e['salesforceAccounts'][_0x383fa1['id']]=new SalesforceAccount(_0x383fa1);}else{_0x494d6e['mergeFromDatabase'](_0x494d6e[_0x8db2('0x1c')][_0x383fa1['id']],_0x383fa1);}}}return _0x494d6e[_0x8db2('0x1c')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x4c')]=function(){var _0x3daed6=this;return function(_0x2bf408){if(_0x2bf408){freeIsNotKey(_0x2bf408,_0x3daed6[_0x8db2('0x1e')],'id');for(var _0x3ca2a7=0x0,_0x4187d6={};_0x3ca2a7<_0x2bf408[_0x8db2('0x42')];_0x3ca2a7+=0x1){_0x4187d6=_0x2bf408[_0x3ca2a7];if(_[_0x8db2('0x43')](_0x3daed6[_0x8db2('0x1e')][_0x4187d6['id']])){_0x3daed6[_0x8db2('0x1e')][_0x4187d6['id']]=new FreshdeskAccount(_0x4187d6);}else{_0x3daed6[_0x8db2('0x44')](_0x3daed6[_0x8db2('0x1e')][_0x4187d6['id']],_0x4187d6);}}}return _0x3daed6['freshdeskAccounts'];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x4d')]=function(){var _0x579317=this;return function(_0x27b644){if(_0x27b644){freeIsNotKey(_0x27b644,_0x579317[_0x8db2('0x1f')],'id');for(var _0x3af298=0x0,_0x547215={};_0x3af298<_0x27b644[_0x8db2('0x42')];_0x3af298+=0x1){_0x547215=_0x27b644[_0x3af298];if(_[_0x8db2('0x43')](_0x579317[_0x8db2('0x1f')][_0x547215['id']])){_0x579317[_0x8db2('0x1f')][_0x547215['id']]=new ZohoAccount(_0x547215);}else{_0x579317[_0x8db2('0x44')](_0x579317['zohoAccounts'][_0x547215['id']],_0x547215);}}}return _0x579317[_0x8db2('0x1f')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x4e')]=function(){var _0x58bb60=this;return function(_0x1e7d1a){if(_0x1e7d1a){freeIsNotKey(_0x1e7d1a,_0x58bb60[_0x8db2('0x20')],'id');for(var _0x33dddd=0x0,_0x7b0de8={};_0x33dddd<_0x1e7d1a[_0x8db2('0x42')];_0x33dddd+=0x1){_0x7b0de8=_0x1e7d1a[_0x33dddd];if(_[_0x8db2('0x43')](_0x58bb60[_0x8db2('0x20')][_0x7b0de8['id']])){_0x58bb60['deskAccounts'][_0x7b0de8['id']]=new DeskAccount(_0x7b0de8);}else{_0x58bb60[_0x8db2('0x44')](_0x58bb60[_0x8db2('0x20')][_0x7b0de8['id']],_0x7b0de8);}}}return _0x58bb60['deskAccounts'];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x4f')]=function(){var _0x533e41=this;return function(_0x107bbe){if(_0x107bbe){freeIsNotKey(_0x107bbe,_0x533e41[_0x8db2('0x1d')],'id');for(var _0x63e8f7=0x0,_0x30f4f3={};_0x63e8f7<_0x107bbe[_0x8db2('0x42')];_0x63e8f7+=0x1){_0x30f4f3=_0x107bbe[_0x63e8f7];if(_[_0x8db2('0x43')](_0x533e41[_0x8db2('0x1d')][_0x30f4f3['id']])){_0x533e41[_0x8db2('0x1d')][_0x30f4f3['id']]=new SugarcrmAccount(_0x30f4f3);}else{_0x533e41[_0x8db2('0x44')](_0x533e41[_0x8db2('0x1d')][_0x30f4f3['id']],_0x30f4f3);}}}return _0x533e41[_0x8db2('0x1d')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x50')]=function(){var _0x1ce89f=this;return function(_0x64ec90){if(_0x64ec90){freeIsNotKey(_0x64ec90,_0x1ce89f[_0x8db2('0x21')],'id');for(var _0x4a20a7=0x0,_0xe0c3e={};_0x4a20a7<_0x64ec90[_0x8db2('0x42')];_0x4a20a7+=0x1){_0xe0c3e=_0x64ec90[_0x4a20a7];if(_[_0x8db2('0x43')](_0x1ce89f[_0x8db2('0x21')][_0xe0c3e['id']])){_0x1ce89f[_0x8db2('0x21')][_0xe0c3e['id']]=new VtigerAccount(_0xe0c3e);}else{_0x1ce89f['mergeFromDatabase'](_0x1ce89f[_0x8db2('0x21')][_0xe0c3e['id']],_0xe0c3e);}}}return _0x1ce89f[_0x8db2('0x21')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x51')]=function(){var _0x2ad70f=this;return function(_0x348da8){if(_0x348da8){freeIsNotKey(_0x348da8,_0x2ad70f[_0x8db2('0x22')],'id');for(var _0x2c7b04=0x0,_0x24cfe9={};_0x2c7b04<_0x348da8[_0x8db2('0x42')];_0x2c7b04+=0x1){_0x24cfe9=_0x348da8[_0x2c7b04];if(_[_0x8db2('0x43')](_0x2ad70f[_0x8db2('0x22')][_0x24cfe9['id']])){_0x2ad70f[_0x8db2('0x22')][_0x24cfe9['id']]=new ServicenowAccount(_0x24cfe9);}else{_0x2ad70f[_0x8db2('0x44')](_0x2ad70f[_0x8db2('0x22')][_0x24cfe9['id']],_0x24cfe9);}}}return _0x2ad70f[_0x8db2('0x22')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x52')]=function(){var _0x5a719f=this;return function(_0x3273dd){if(_0x3273dd){freeIsNotKey(_0x3273dd,_0x5a719f['dynamics365Accounts'],'id');for(var _0x364176=0x0,_0x570c53={};_0x364176<_0x3273dd[_0x8db2('0x42')];_0x364176+=0x1){_0x570c53=_0x3273dd[_0x364176];if(_[_0x8db2('0x43')](_0x5a719f[_0x8db2('0x23')][_0x570c53['id']])){_0x5a719f[_0x8db2('0x23')][_0x570c53['id']]=new Dynamics365Account(_0x570c53);}else{_0x5a719f[_0x8db2('0x44')](_0x5a719f['dynamics365Accounts'][_0x570c53['id']],_0x570c53);}}}return _0x5a719f['dynamics365Accounts'];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x53')]=function(){var _0x21ec87=this;return function(_0x3ba1d2){if(_0x3ba1d2){freeIsNotKey(_0x3ba1d2,_0x21ec87[_0x8db2('0x24')],'id');for(var _0x1f28d2=0x0,_0x3e3de3={};_0x1f28d2<_0x3ba1d2[_0x8db2('0x42')];_0x1f28d2+=0x1){_0x3e3de3=_0x3ba1d2[_0x1f28d2];if(_['isUndefined'](_0x21ec87[_0x8db2('0x24')][_0x3e3de3['id']])){_0x21ec87[_0x8db2('0x24')][_0x3e3de3['id']]=new FreshsalesAccount(_0x3e3de3);}else{_0x21ec87[_0x8db2('0x44')](_0x21ec87[_0x8db2('0x24')][_0x3e3de3['id']],_0x3e3de3);}}}return _0x21ec87[_0x8db2('0x24')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x54')]=function(){var _0x20caf0=this;return function(_0x4938bb){for(var _0x54318c=0x0;_0x54318c<_0x4938bb[_0x8db2('0x42')];_0x54318c+=0x1){_[_0x8db2('0x55')](_0x20caf0[_0x8db2('0x14')][_0x4938bb[_0x54318c][_0x8db2('0x2a')]],_0x4938bb[_0x54318c]);}return _0x20caf0[_0x8db2('0x14')];};};Realtime['prototype']['initVoiceQueueReports']=function(){var _0x3611da=this;return function(_0x364807){clearVoiceQueues(_0x3611da['voiceQueues']);if(_0x364807){_0x364807=_[_0x8db2('0x56')](_0x364807,_0x8db2('0x57'));for(var _0x1ab84c in _0x364807){if(_0x364807['hasOwnProperty'](_0x1ab84c)){for(var _0x26523b=0x0;_0x26523b<_0x364807[_0x1ab84c][_0x8db2('0x42')];_0x26523b+=0x1){var _0x2cf731=_0x364807[_0x1ab84c][_0x26523b]['queue'];if(_0x3611da[_0x8db2('0x14')][_0x2cf731]){if(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x58')]){_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x33')]+=0x1;}if(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x59')]){_0x3611da['voiceQueues'][_0x2cf731][_0x8db2('0x34')]+=0x1;}_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x35')]+=moment(_0x364807[_0x1ab84c][_0x26523b]['queuecallerleaveAt'])['diff'](moment(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x5a')]),_0x8db2('0x5b'))||0x0;if(_0x26523b===_0x364807[_0x1ab84c]['length']-0x1){_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x2d')]+=moment(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x5c')]||_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x5d')]||_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x5e')])[_0x8db2('0x5f')](moment(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x5a')]),_0x8db2('0x5b'))||0x0;_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x31')]+=0x1;if(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x60')]){_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x32')]+=0x1;_0x3611da['voiceQueues'][_0x2cf731][_0x8db2('0x2e')]+=moment(_0x364807[_0x1ab84c][_0x26523b]['queuecallercompleteAt'])[_0x8db2('0x5f')](moment(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x61')]),'seconds')||0x0;}}else{_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x2d')]+=_0x3611da['voiceQueues'][_0x2cf731][_0x8db2('0x35')]||0x0;}}}}}}return _0x3611da[_0x8db2('0x14')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x62')]=function(){var _0x242379=this;return function(_0x31a095){clearVoiceCallReports(_0x242379[_0x8db2('0x63')]);if(_0x31a095){for(var _0x3ac0fa=0x0;_0x3ac0fa<_0x31a095[_0x8db2('0x42')];_0x3ac0fa+=0x1){_0x242379['outbound']['total']+=0x1;_0x242379[_0x8db2('0x63')]['sumDuration']+=_0x31a095[_0x3ac0fa][_0x8db2('0x64')];if(_0x31a095[_0x3ac0fa][_0x8db2('0x65')]===_0x8db2('0x66')){_0x242379['outbound'][_0x8db2('0x32')]+=0x1;_0x242379[_0x8db2('0x63')][_0x8db2('0x35')]+=_0x31a095[_0x3ac0fa]['duration']-_0x31a095[_0x3ac0fa][_0x8db2('0x67')]||0x0;_0x242379[_0x8db2('0x63')][_0x8db2('0x2e')]+=_0x31a095[_0x3ac0fa][_0x8db2('0x67')];}}}return _0x242379['outbound'];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x68')]=function(){var _0x299640=this;return function(_0x1edb1a){if(_0x1edb1a){freeIsNotKey(_0x1edb1a,_0x299640[_0x8db2('0x15')],_0x8db2('0x2a'));for(var _0x1aadfb=0x0,_0x3682bf={};_0x1aadfb<_0x1edb1a[_0x8db2('0x42')];_0x1aadfb+=0x1){_0x3682bf=_0x1edb1a[_0x1aadfb];if(_[_0x8db2('0x43')](_0x299640[_0x8db2('0x15')][_0x3682bf['name']])){_0x299640[_0x8db2('0x15')][_0x3682bf[_0x8db2('0x2a')]]=new Campaign(_0x3682bf);}else{_0x299640[_0x8db2('0x44')](_0x299640['campaigns'][_0x3682bf['name']],_0x3682bf);_0x299640['campaigns'][_0x3682bf[_0x8db2('0x2a')]][_0x8db2('0x69')]=_0x3682bf[_0x8db2('0x6a')]?_0x3682bf[_0x8db2('0x6a')][_0x8db2('0x2a')]:undefined;}}}return _0x299640[_0x8db2('0x15')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x6b')]=function(){var _0x3b1929=this;return function(_0x37cf6d){if(_0x37cf6d){freeIsNotKey(_0x37cf6d,_0x3b1929[_0x8db2('0x17')],'id');for(var _0x4d0ff6=0x0,_0x360a06={};_0x4d0ff6<_0x37cf6d[_0x8db2('0x42')];_0x4d0ff6+=0x1){_0x360a06=_0x37cf6d[_0x4d0ff6];if(_[_0x8db2('0x43')](_0x3b1929[_0x8db2('0x17')][_0x360a06['id']])){_0x3b1929['voiceExtensions'][_0x360a06['id']]=new VoiceExtension(_0x360a06);}else{_0x3b1929['mergeFromDatabase'](_0x3b1929[_0x8db2('0x17')][_0x360a06['id']],_0x360a06);}}}return _0x3b1929[_0x8db2('0x17')];};};Realtime['prototype'][_0x8db2('0x6c')]=function(){var _0x121f31=this;return function(_0x9132b4){clearCampaigns(_0x121f31['campaigns']);for(var _0x5dc46c=0x0;_0x5dc46c<_0x9132b4['length'];_0x5dc46c+=0x1){_[_0x8db2('0x55')](_0x121f31[_0x8db2('0x15')][_0x9132b4[_0x5dc46c][_0x8db2('0x2a')]],_0x9132b4[_0x5dc46c]);}return _0x121f31[_0x8db2('0x15')];};};Realtime[_0x8db2('0x3f')]['initFaxAccounts']=function(){var _0x30930a=this;return function(_0x5e349c){if(_0x5e349c){freeIsNotKey(_0x5e349c,_0x30930a[_0x8db2('0x25')],'id');for(var _0x353101=0x0,_0xa083b1={};_0x353101<_0x5e349c[_0x8db2('0x42')];_0x353101+=0x1){_0xa083b1=_0x5e349c[_0x353101];if(_[_0x8db2('0x43')](_0x30930a['faxAccounts'][_0xa083b1['id']])){_0x30930a['faxAccounts'][_0xa083b1['id']]=new FaxAccount(_0xa083b1);}else{_0x30930a[_0x8db2('0x44')](_0x30930a['faxAccounts'][_0xa083b1['id']],_0xa083b1);}}}return _0x30930a[_0x8db2('0x25')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x6d')]=function(){var _0x1e7bc2=this;return function(_0x2b7224){if(_0x2b7224){freeIsNotKey(_0x2b7224,_0x1e7bc2[_0x8db2('0x14')],'name');for(var _0x19f9a0=0x0,_0x222ea2={};_0x19f9a0<_0x2b7224[_0x8db2('0x42')];_0x19f9a0+=0x1){_0x222ea2=_0x2b7224[_0x19f9a0];if(_['isUndefined'](_0x1e7bc2[_0x8db2('0x14')][_0x222ea2[_0x8db2('0x2a')]])){_0x1e7bc2['voiceQueues'][_0x222ea2[_0x8db2('0x2a')]]=new VoiceQueue(_0x222ea2);}else{_0x1e7bc2[_0x8db2('0x44')](_0x1e7bc2[_0x8db2('0x14')][_0x222ea2[_0x8db2('0x2a')]],_0x222ea2);}}}return _0x1e7bc2[_0x8db2('0x14')];};};module[_0x8db2('0x6e')]=Realtime; \ No newline at end of file +var _0x5f2f=['initCampaignHopperHistory','merge','initFaxAccounts','initVoiceQueues','exports','lodash','moment','util','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','voiceQueues','templates','outbound','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','name','isNil','interface','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','total','answered','unmanaged','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundRejectCallsDay','queueStatusComplete','prototype','mergeFromDatabase','length','isUndefined','initTelephones','SIP/%s','trunks','initTriggers','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','abandoned','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions'];(function(_0xb4929d,_0x3eb455){var _0x12e61a=function(_0x4afb4e){while(--_0x4afb4e){_0xb4929d['push'](_0xb4929d['shift']());}};_0x12e61a(++_0x3eb455);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5bb3a6,_0xc89ee3){_0x5bb3a6=_0x5bb3a6-0x0;var _0x279273=_0x5f2f[_0x5bb3a6];return _0x279273;};'use strict';var _=require(_0xf5f2('0x0'));var moment=require(_0xf5f2('0x1'));var util=require(_0xf5f2('0x2'));var Agent=require(_0xf5f2('0x3'));var Telephone=require(_0xf5f2('0x4'));var Trunk=require(_0xf5f2('0x5'));var VoiceQueue=require(_0xf5f2('0x6'));var Trigger=require(_0xf5f2('0x7'));var Template=require('../model/template');var Campaign=require('../model/campaign');var VoiceExtension=require(_0xf5f2('0x8'));var ZendeskAccount=require(_0xf5f2('0x9'));var SalesforceAccount=require(_0xf5f2('0xa'));var FreshdeskAccount=require(_0xf5f2('0xb'));var SugarcrmAccount=require(_0xf5f2('0xc'));var ZohoAccount=require(_0xf5f2('0xd'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0xf5f2('0xe'));var ServicenowAccount=require(_0xf5f2('0xf'));var Dynamics365Account=require(_0xf5f2('0x10'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0xf5f2('0x11'));function Realtime(){this[_0xf5f2('0x12')]={};this[_0xf5f2('0x13')]={};this['trunks']={};this[_0xf5f2('0x14')]={};this['triggers']={};this['campaigns']={};this[_0xf5f2('0x15')]={};this[_0xf5f2('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xf5f2('0x17')]={};this[_0xf5f2('0x18')]={};this[_0xf5f2('0x19')]={};this[_0xf5f2('0x1a')]={};this[_0xf5f2('0x1b')]={};this[_0xf5f2('0x1c')]={};this['salesforceAccounts']={};this[_0xf5f2('0x1d')]={};this[_0xf5f2('0x1e')]={};this[_0xf5f2('0x1f')]={};this[_0xf5f2('0x20')]={};this[_0xf5f2('0x21')]={};this['servicenowAccounts']={};this[_0xf5f2('0x22')]={};this[_0xf5f2('0x23')]={};this[_0xf5f2('0x24')]={};}function freeIsNotKey(_0x1b6dd2,_0x23e23a,_0x3a9dbb){var _0xdb61b3=_[_0xf5f2('0x25')](_0x1b6dd2,function(_0x11f702){return _0x11f702[_0x3a9dbb];});for(var _0x228ace in _0x23e23a){if(_0x23e23a[_0xf5f2('0x26')](_0x228ace)){if(!_0xdb61b3[_0x228ace]){delete _0x23e23a[_0x228ace];}}}}function freeIsNotKeySip(_0x28e097,_0x4ff59b){var _0x3ee69=_[_0xf5f2('0x25')](_0x28e097,function(_0x626999){return util[_0xf5f2('0x27')]('SIP/%s',_0x626999[_0xf5f2('0x28')]);});for(var _0x47101e in _0x4ff59b){if(_0x4ff59b['hasOwnProperty'](_0x47101e)){if(!_0x3ee69[_0x47101e]){delete _0x4ff59b[_0x47101e];}}}}function freeIsNotKeyAgent(_0x47acfc,_0x2d2805){var _0x388e6c=_['mapKeys'](_0x47acfc,function(_0x45b74f){var _0x170042=_[_0xf5f2('0x29')](_0x45b74f[_0xf5f2('0x2a')])?util[_0xf5f2('0x27')]('SIP/%s',_0x45b74f[_0xf5f2('0x28')]):_0x45b74f[_0xf5f2('0x2a')];return _0x170042;});for(var _0x4e8bda in _0x2d2805){if(_0x2d2805[_0xf5f2('0x26')](_0x4e8bda)){if(!_0x388e6c[_0x4e8bda]){delete _0x2d2805[_0x4e8bda];}}}}function clearVoiceCallReports(_0x287ad5){_0x287ad5['total']=0x0;_0x287ad5['answered']=0x0;_0x287ad5[_0xf5f2('0x2b')]=0x0;_0x287ad5[_0xf5f2('0x2c')]=0x0;_0x287ad5[_0xf5f2('0x2d')]=0x0;}function clearCampaigns(_0x1a5bb3){if(!_[_0xf5f2('0x2e')](_0x1a5bb3)){for(var _0x788a8d in _0x1a5bb3){if(_0x1a5bb3[_0xf5f2('0x26')](_0x788a8d)){_0x1a5bb3[_0x788a8d][_0xf5f2('0x2f')]=0x0;_0x1a5bb3[_0x788a8d][_0xf5f2('0x30')]=0x0;}}}}function clearVoiceQueues(_0x4ab014){if(!_[_0xf5f2('0x2e')](_0x4ab014)){for(var _0x102449 in _0x4ab014){if(_0x4ab014[_0xf5f2('0x26')](_0x102449)){_0x4ab014[_0x102449][_0xf5f2('0x31')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x32')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x33')]=0x0;_0x4ab014[_0x102449]['abandoned']=0x0;_0x4ab014[_0x102449]['sumHoldTime']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x2c')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x2d')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x34')]=0x0;_0x4ab014[_0x102449]['outboundNoAnswerCallsDay']=0x0;_0x4ab014[_0x102449]['outboundBusyCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x35')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x36')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x37')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x38')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x39')]=0x0;_0x4ab014[_0x102449]['outboundBlacklistCallsDay']=0x0;_0x4ab014[_0x102449]['outboundOriginateFailureCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x3a')]=0x0;_0x4ab014[_0x102449]['outboundReCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x34')]=0x0;_0x4ab014[_0x102449]['outboundAnswerCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x3b')]=!![];}}}}Realtime[_0xf5f2('0x3c')][_0xf5f2('0x3d')]=function(_0x428770,_0x256bd9){for(var _0x277eee in _0x256bd9){if(_0x428770[_0xf5f2('0x26')](_0x277eee)){_0x428770[_0x277eee]=_0x256bd9[_0x277eee];}}};Realtime[_0xf5f2('0x3c')]['initAgents']=function(){var _0x4149e6=this;return function(_0x43e4ff){if(_0x43e4ff){freeIsNotKeyAgent(_0x43e4ff,_0x4149e6[_0xf5f2('0x12')]);for(var _0x43c77d=0x0,_0x1408b9={};_0x43c77d<_0x43e4ff[_0xf5f2('0x3e')];_0x43c77d+=0x1){_0x1408b9=_0x43e4ff[_0x43c77d];var _0x297c0c=_['isNil'](_0x1408b9[_0xf5f2('0x2a')])?util[_0xf5f2('0x27')]('SIP/%s',_0x1408b9[_0xf5f2('0x28')]):_0x1408b9['interface'];if(_[_0xf5f2('0x3f')](_0x4149e6[_0xf5f2('0x12')][_0x297c0c])){_0x4149e6[_0xf5f2('0x12')][_0x297c0c]=new Agent(_0x1408b9);}else{_0x4149e6[_0xf5f2('0x3d')](_0x4149e6['agents'][_0x297c0c],_0x1408b9);}}}return _0x4149e6['agents'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x40')]=function(){var _0x20eb74=this;return function(_0x4ec8fb){if(_0x4ec8fb){freeIsNotKeySip(_0x4ec8fb,_0x20eb74[_0xf5f2('0x13')]);for(var _0x4f7f80=0x0,_0x9da533={};_0x4f7f80<_0x4ec8fb['length'];_0x4f7f80+=0x1){_0x9da533=_0x4ec8fb[_0x4f7f80];if(_[_0xf5f2('0x3f')](_0x20eb74[_0xf5f2('0x13')][util['format'](_0xf5f2('0x41'),_0x9da533[_0xf5f2('0x28')])])){_0x20eb74[_0xf5f2('0x13')][util[_0xf5f2('0x27')]('SIP/%s',_0x9da533['name'])]=new Telephone(_0x9da533);}else{_0x20eb74[_0xf5f2('0x3d')](_0x20eb74[_0xf5f2('0x13')][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x9da533[_0xf5f2('0x28')])],_0x9da533);}}}return _0x20eb74[_0xf5f2('0x13')];};};Realtime[_0xf5f2('0x3c')]['initTrunks']=function(){var _0x110fe5=this;return function(_0x3b4ea6){if(_0x3b4ea6){freeIsNotKeySip(_0x3b4ea6,_0x110fe5['trunks']);for(var _0xc6a1ae=0x0,_0x3f3895={};_0xc6a1ae<_0x3b4ea6[_0xf5f2('0x3e')];_0xc6a1ae+=0x1){_0x3f3895=_0x3b4ea6[_0xc6a1ae];if(_[_0xf5f2('0x3f')](_0x110fe5[_0xf5f2('0x42')][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])])){_0x110fe5['trunks'][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])]=new Trunk(_0x3f3895);}else{_0x110fe5['mergeFromDatabase'](_0x110fe5['trunks'][util['format'](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])],_0x3f3895);}}}return _0x110fe5['trunks'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x43')]=function(){var _0x28e33f=this;return function(_0x31f86c){if(_0x31f86c){freeIsNotKey(_0x31f86c,_0x28e33f[_0xf5f2('0x44')],'id');for(var _0x2b3b1c=0x0,_0x1a6ec1={};_0x2b3b1c<_0x31f86c[_0xf5f2('0x3e')];_0x2b3b1c+=0x1){_0x1a6ec1=_0x31f86c[_0x2b3b1c];if(_[_0xf5f2('0x3f')](_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']])){_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']]=new Trigger(_0x1a6ec1);}else{_0x28e33f[_0xf5f2('0x3d')](_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']],_0x1a6ec1);}}}return _0x28e33f[_0xf5f2('0x44')];};};Realtime['prototype'][_0xf5f2('0x45')]=function(){var _0x578c93=this;return function(_0x3d62c1){if(_0x3d62c1){freeIsNotKey(_0x3d62c1,_0x578c93[_0xf5f2('0x15')],'id');for(var _0x218def=0x0,_0x36a4b0={};_0x218def<_0x3d62c1[_0xf5f2('0x3e')];_0x218def+=0x1){_0x36a4b0=_0x3d62c1[_0x218def];if(_[_0xf5f2('0x3f')](_0x578c93['templates'][_0x36a4b0['id']])){_0x578c93[_0xf5f2('0x15')][_0x36a4b0['id']]=new Template(_0x36a4b0);}else{_0x578c93[_0xf5f2('0x3d')](_0x578c93[_0xf5f2('0x15')][_0x36a4b0['id']],_0x36a4b0);}}}return _0x578c93[_0xf5f2('0x15')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x46')]=function(){var _0xf638ff=this;return function(_0x297f07){if(_0x297f07){freeIsNotKey(_0x297f07,_0xf638ff['zendeskAccounts'],'id');for(var _0x35dece=0x0,_0x33ec29={};_0x35dece<_0x297f07[_0xf5f2('0x3e')];_0x35dece+=0x1){_0x33ec29=_0x297f07[_0x35dece];if(_['isUndefined'](_0xf638ff[_0xf5f2('0x1c')][_0x33ec29['id']])){_0xf638ff[_0xf5f2('0x1c')][_0x33ec29['id']]=new ZendeskAccount(_0x33ec29);}else{_0xf638ff[_0xf5f2('0x3d')](_0xf638ff['zendeskAccounts'][_0x33ec29['id']],_0x33ec29);}}}return _0xf638ff['zendeskAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x47')]=function(){var _0x5db519=this;return function(_0x14aa81){if(_0x14aa81){freeIsNotKey(_0x14aa81,_0x5db519['salesforceAccounts'],'id');for(var _0x740321=0x0,_0x497eb8={};_0x740321<_0x14aa81[_0xf5f2('0x3e')];_0x740321+=0x1){_0x497eb8=_0x14aa81[_0x740321];if(_['isUndefined'](_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']])){_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']]=new SalesforceAccount(_0x497eb8);}else{_0x5db519[_0xf5f2('0x3d')](_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']],_0x497eb8);}}}return _0x5db519['salesforceAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x49')]=function(){var _0x4f6b01=this;return function(_0x58213b){if(_0x58213b){freeIsNotKey(_0x58213b,_0x4f6b01[_0xf5f2('0x1e')],'id');for(var _0x3dc0c4=0x0,_0x57782c={};_0x3dc0c4<_0x58213b[_0xf5f2('0x3e')];_0x3dc0c4+=0x1){_0x57782c=_0x58213b[_0x3dc0c4];if(_[_0xf5f2('0x3f')](_0x4f6b01[_0xf5f2('0x1e')][_0x57782c['id']])){_0x4f6b01[_0xf5f2('0x1e')][_0x57782c['id']]=new FreshdeskAccount(_0x57782c);}else{_0x4f6b01['mergeFromDatabase'](_0x4f6b01['freshdeskAccounts'][_0x57782c['id']],_0x57782c);}}}return _0x4f6b01[_0xf5f2('0x1e')];};};Realtime[_0xf5f2('0x3c')]['initZohoAccounts']=function(){var _0x40eef=this;return function(_0x43fc49){if(_0x43fc49){freeIsNotKey(_0x43fc49,_0x40eef[_0xf5f2('0x1f')],'id');for(var _0x14029e=0x0,_0x2b038e={};_0x14029e<_0x43fc49[_0xf5f2('0x3e')];_0x14029e+=0x1){_0x2b038e=_0x43fc49[_0x14029e];if(_[_0xf5f2('0x3f')](_0x40eef['zohoAccounts'][_0x2b038e['id']])){_0x40eef['zohoAccounts'][_0x2b038e['id']]=new ZohoAccount(_0x2b038e);}else{_0x40eef[_0xf5f2('0x3d')](_0x40eef[_0xf5f2('0x1f')][_0x2b038e['id']],_0x2b038e);}}}return _0x40eef[_0xf5f2('0x1f')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x4a')]=function(){var _0x5a861d=this;return function(_0xdb1106){if(_0xdb1106){freeIsNotKey(_0xdb1106,_0x5a861d[_0xf5f2('0x20')],'id');for(var _0x18b124=0x0,_0x519c24={};_0x18b124<_0xdb1106[_0xf5f2('0x3e')];_0x18b124+=0x1){_0x519c24=_0xdb1106[_0x18b124];if(_['isUndefined'](_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']])){_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']]=new DeskAccount(_0x519c24);}else{_0x5a861d[_0xf5f2('0x3d')](_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']],_0x519c24);}}}return _0x5a861d['deskAccounts'];};};Realtime['prototype'][_0xf5f2('0x4b')]=function(){var _0x4de303=this;return function(_0xa39c65){if(_0xa39c65){freeIsNotKey(_0xa39c65,_0x4de303[_0xf5f2('0x1d')],'id');for(var _0x572ec1=0x0,_0x3f0579={};_0x572ec1<_0xa39c65[_0xf5f2('0x3e')];_0x572ec1+=0x1){_0x3f0579=_0xa39c65[_0x572ec1];if(_[_0xf5f2('0x3f')](_0x4de303['sugarcrmAccounts'][_0x3f0579['id']])){_0x4de303[_0xf5f2('0x1d')][_0x3f0579['id']]=new SugarcrmAccount(_0x3f0579);}else{_0x4de303[_0xf5f2('0x3d')](_0x4de303[_0xf5f2('0x1d')][_0x3f0579['id']],_0x3f0579);}}}return _0x4de303[_0xf5f2('0x1d')];};};Realtime['prototype'][_0xf5f2('0x4c')]=function(){var _0x506fe5=this;return function(_0x2cbe1e){if(_0x2cbe1e){freeIsNotKey(_0x2cbe1e,_0x506fe5[_0xf5f2('0x21')],'id');for(var _0x2e6f5d=0x0,_0x380c08={};_0x2e6f5d<_0x2cbe1e[_0xf5f2('0x3e')];_0x2e6f5d+=0x1){_0x380c08=_0x2cbe1e[_0x2e6f5d];if(_['isUndefined'](_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']])){_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']]=new VtigerAccount(_0x380c08);}else{_0x506fe5[_0xf5f2('0x3d')](_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']],_0x380c08);}}}return _0x506fe5[_0xf5f2('0x21')];};};Realtime['prototype'][_0xf5f2('0x4d')]=function(){var _0x5ee6bc=this;return function(_0x4c96ee){if(_0x4c96ee){freeIsNotKey(_0x4c96ee,_0x5ee6bc[_0xf5f2('0x4e')],'id');for(var _0x4802c5=0x0,_0x10f2b8={};_0x4802c5<_0x4c96ee[_0xf5f2('0x3e')];_0x4802c5+=0x1){_0x10f2b8=_0x4c96ee[_0x4802c5];if(_[_0xf5f2('0x3f')](_0x5ee6bc[_0xf5f2('0x4e')][_0x10f2b8['id']])){_0x5ee6bc['servicenowAccounts'][_0x10f2b8['id']]=new ServicenowAccount(_0x10f2b8);}else{_0x5ee6bc[_0xf5f2('0x3d')](_0x5ee6bc[_0xf5f2('0x4e')][_0x10f2b8['id']],_0x10f2b8);}}}return _0x5ee6bc[_0xf5f2('0x4e')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x4f')]=function(){var _0x35d868=this;return function(_0x158768){if(_0x158768){freeIsNotKey(_0x158768,_0x35d868['dynamics365Accounts'],'id');for(var _0x1f55af=0x0,_0x2d171d={};_0x1f55af<_0x158768[_0xf5f2('0x3e')];_0x1f55af+=0x1){_0x2d171d=_0x158768[_0x1f55af];if(_[_0xf5f2('0x3f')](_0x35d868['dynamics365Accounts'][_0x2d171d['id']])){_0x35d868[_0xf5f2('0x22')][_0x2d171d['id']]=new Dynamics365Account(_0x2d171d);}else{_0x35d868['mergeFromDatabase'](_0x35d868[_0xf5f2('0x22')][_0x2d171d['id']],_0x2d171d);}}}return _0x35d868[_0xf5f2('0x22')];};};Realtime['prototype'][_0xf5f2('0x50')]=function(){var _0x975bd8=this;return function(_0xa0c139){if(_0xa0c139){freeIsNotKey(_0xa0c139,_0x975bd8[_0xf5f2('0x23')],'id');for(var _0x146462=0x0,_0x4bd113={};_0x146462<_0xa0c139[_0xf5f2('0x3e')];_0x146462+=0x1){_0x4bd113=_0xa0c139[_0x146462];if(_[_0xf5f2('0x3f')](_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']])){_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']]=new FreshsalesAccount(_0x4bd113);}else{_0x975bd8[_0xf5f2('0x3d')](_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']],_0x4bd113);}}}return _0x975bd8['freshsalesAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x51')]=function(){var _0x4800fe=this;return function(_0x3f677e){for(var _0x36503c=0x0;_0x36503c<_0x3f677e[_0xf5f2('0x3e')];_0x36503c+=0x1){_['merge'](_0x4800fe['voiceQueues'][_0x3f677e[_0x36503c]['name']],_0x3f677e[_0x36503c]);}return _0x4800fe[_0xf5f2('0x14')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x52')]=function(){var _0x450691=this;return function(_0x55da4d){clearVoiceQueues(_0x450691['voiceQueues']);if(_0x55da4d){_0x55da4d=_[_0xf5f2('0x53')](_0x55da4d,_0xf5f2('0x54'));for(var _0xc10cf3 in _0x55da4d){if(_0x55da4d[_0xf5f2('0x26')](_0xc10cf3)){for(var _0x794e0c=0x0;_0x794e0c<_0x55da4d[_0xc10cf3][_0xf5f2('0x3e')];_0x794e0c+=0x1){var _0x11c302=_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x55')];if(_0x450691[_0xf5f2('0x14')][_0x11c302]){if(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x56')]){_0x450691[_0xf5f2('0x14')][_0x11c302]['unmanaged']+=0x1;}if(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerabandon']){_0x450691['voiceQueues'][_0x11c302][_0xf5f2('0x57')]+=0x1;}_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2b')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x58')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerjoinAt']),_0xf5f2('0x5a'))||0x0;if(_0x794e0c===_0x55da4d[_0xc10cf3][_0xf5f2('0x3e')]-0x1){_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2c')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5b')]||_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerabandonAt']||_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5c')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerjoinAt']),_0xf5f2('0x5a'))||0x0;_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x31')]+=0x1;if(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5d')]){_0x450691['voiceQueues'][_0x11c302][_0xf5f2('0x32')]+=0x1;_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2d')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5b')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2c')]+=_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2b')]||0x0;}}}}}}return _0x450691['voiceQueues'];};};Realtime['prototype'][_0xf5f2('0x5e')]=function(){var _0x4f2fcc=this;return function(_0x4c4420){clearVoiceCallReports(_0x4f2fcc['outbound']);if(_0x4c4420){for(var _0x57cb18=0x0;_0x57cb18<_0x4c4420[_0xf5f2('0x3e')];_0x57cb18+=0x1){_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x31')]+=0x1;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2c')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x5f')];if(_0x4c4420[_0x57cb18][_0xf5f2('0x60')]===_0xf5f2('0x61')){_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x32')]+=0x1;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2b')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x5f')]-_0x4c4420[_0x57cb18][_0xf5f2('0x62')]||0x0;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2d')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x62')];}}}return _0x4f2fcc[_0xf5f2('0x16')];};};Realtime['prototype'][_0xf5f2('0x63')]=function(){var _0x35299d=this;return function(_0x21043b){if(_0x21043b){freeIsNotKey(_0x21043b,_0x35299d[_0xf5f2('0x64')],_0xf5f2('0x28'));for(var _0x308220=0x0,_0x16491c={};_0x308220<_0x21043b[_0xf5f2('0x3e')];_0x308220+=0x1){_0x16491c=_0x21043b[_0x308220];if(_['isUndefined'](_0x35299d[_0xf5f2('0x64')][_0x16491c['name']])){_0x35299d['campaigns'][_0x16491c['name']]=new Campaign(_0x16491c);}else{_0x35299d['mergeFromDatabase'](_0x35299d['campaigns'][_0x16491c['name']],_0x16491c);_0x35299d[_0xf5f2('0x64')][_0x16491c[_0xf5f2('0x28')]][_0xf5f2('0x65')]=_0x16491c[_0xf5f2('0x66')]?_0x16491c[_0xf5f2('0x66')][_0xf5f2('0x28')]:undefined;}}}return _0x35299d['campaigns'];};};Realtime['prototype'][_0xf5f2('0x67')]=function(){var _0x578a22=this;return function(_0x418ece){if(_0x418ece){freeIsNotKey(_0x418ece,_0x578a22[_0xf5f2('0x68')],'id');for(var _0x59161c=0x0,_0x4f3ad4={};_0x59161c<_0x418ece[_0xf5f2('0x3e')];_0x59161c+=0x1){_0x4f3ad4=_0x418ece[_0x59161c];if(_[_0xf5f2('0x3f')](_0x578a22['voiceExtensions'][_0x4f3ad4['id']])){_0x578a22[_0xf5f2('0x68')][_0x4f3ad4['id']]=new VoiceExtension(_0x4f3ad4);}else{_0x578a22[_0xf5f2('0x3d')](_0x578a22['voiceExtensions'][_0x4f3ad4['id']],_0x4f3ad4);}}}return _0x578a22[_0xf5f2('0x68')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x69')]=function(){var _0x4c1678=this;return function(_0x33e9ad){clearCampaigns(_0x4c1678[_0xf5f2('0x64')]);for(var _0x14db86=0x0;_0x14db86<_0x33e9ad[_0xf5f2('0x3e')];_0x14db86+=0x1){_[_0xf5f2('0x6a')](_0x4c1678[_0xf5f2('0x64')][_0x33e9ad[_0x14db86][_0xf5f2('0x28')]],_0x33e9ad[_0x14db86]);}return _0x4c1678[_0xf5f2('0x64')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x6b')]=function(){var _0x191af3=this;return function(_0x2601aa){if(_0x2601aa){freeIsNotKey(_0x2601aa,_0x191af3[_0xf5f2('0x24')],'id');for(var _0x407dd8=0x0,_0xe900ea={};_0x407dd8<_0x2601aa[_0xf5f2('0x3e')];_0x407dd8+=0x1){_0xe900ea=_0x2601aa[_0x407dd8];if(_[_0xf5f2('0x3f')](_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']])){_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']]=new FaxAccount(_0xe900ea);}else{_0x191af3[_0xf5f2('0x3d')](_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']],_0xe900ea);}}}return _0x191af3['faxAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x6c')]=function(){var _0x5d6c6e=this;return function(_0x2e49ce){if(_0x2e49ce){freeIsNotKey(_0x2e49ce,_0x5d6c6e[_0xf5f2('0x14')],'name');for(var _0xb56304=0x0,_0x2f54eb={};_0xb56304<_0x2e49ce[_0xf5f2('0x3e')];_0xb56304+=0x1){_0x2f54eb=_0x2e49ce[_0xb56304];if(_['isUndefined'](_0x5d6c6e['voiceQueues'][_0x2f54eb[_0xf5f2('0x28')]])){_0x5d6c6e[_0xf5f2('0x14')][_0x2f54eb[_0xf5f2('0x28')]]=new VoiceQueue(_0x2f54eb);}else{_0x5d6c6e['mergeFromDatabase'](_0x5d6c6e['voiceQueues'][_0x2f54eb[_0xf5f2('0x28')]],_0x2f54eb);}}}return _0x5d6c6e[_0xf5f2('0x14')];};};module[_0xf5f2('0x6d')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index 0d14752..8bf6511 100644 --- a/server/services/ami/realtime/utils.js +++ b/server/services/ami/realtime/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd11e=['hasOwnProperty','mergeDBDataToRealtime','assign'];(function(_0x1a3419,_0x4dc0e5){var _0x467dae=function(_0x215e92){while(--_0x215e92){_0x1a3419['push'](_0x1a3419['shift']());}};_0x467dae(++_0x4dc0e5);}(_0xd11e,0x86));var _0xed11=function(_0x25fa25,_0x26b171){_0x25fa25=_0x25fa25-0x0;var _0x1a9bbd=_0xd11e[_0x25fa25];return _0x1a9bbd;};'use strict';function mergeDBDataToRealtime(_0x21fcdc,_0x3ad1ee){var _0x452a71=Object[_0xed11('0x0')]({},_0x21fcdc);for(var _0x14d39d in _0x3ad1ee){if(_0x452a71[_0xed11('0x1')](_0x14d39d)){_0x452a71[_0x14d39d]=_0x3ad1ee[_0x14d39d];}}return _0x452a71;}exports[_0xed11('0x2')]=mergeDBDataToRealtime; \ No newline at end of file +var _0xffa9=['assign','hasOwnProperty','mergeDBDataToRealtime'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xffa9,0x111));var _0x9ffa=function(_0x458709,_0x1981ea){_0x458709=_0x458709-0x0;var _0x48cbd7=_0xffa9[_0x458709];return _0x48cbd7;};'use strict';function mergeDBDataToRealtime(_0xf6588c,_0x4e34ea){var _0x123ea0=Object[_0x9ffa('0x0')]({},_0xf6588c);for(var _0x1c2c38 in _0x4e34ea){if(_0x123ea0[_0x9ffa('0x1')](_0x1c2c38)){_0x123ea0[_0x1c2c38]=_0x4e34ea[_0x1c2c38];}}return _0x123ea0;}exports[_0x9ffa('0x2')]=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index ea9a0ce..8f251f9 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 _0xddca=['./voiceAgentReport','realtime','agents','telephones','prototype','sync','xdr','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','voiceAgentReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','accountcode','name','isNil','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','interface','format','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','getAgentByInternal','keys','getCallType','channel','calleridnum','outbound','destination','exten','type','dialer','lastapplication','queue','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','disposition','ANSWERED','transfers','transfereelinkedid','linkedid','split','UserId','membername','monitor','monitors','monitorFilename','filename','createdAt','calleridname','connectedlinename','isArray','forEach','Local','substring','indexOf','find','mobile','phone','lastIndexOf','transfererlinkedid','lodash','moment','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport'];(function(_0x1702e1,_0x3a8949){var _0x2bdc8c=function(_0x362a55){while(--_0x362a55){_0x1702e1['push'](_0x1702e1['shift']());}};_0x2bdc8c(++_0x3a8949);}(_0xddca,0x164));var _0xaddc=function(_0x3412ab,_0x5a2b22){_0x3412ab=_0x3412ab-0x0;var _0x37ad1d=_0xddca[_0x3412ab];return _0x37ad1d;};'use strict';var _=require(_0xaddc('0x0'));var moment=require(_0xaddc('0x1'));var util=require('util');var config=require(_0xaddc('0x2'));var ami=require(_0xaddc('0x3'));var RpcVoiceAgentReport=require(_0xaddc('0x4'));var RpcVoiceCallReport=require(_0xaddc('0x5'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0xaddc('0x6'));var RpcVoiceQueueReport=require(_0xaddc('0x7'));var RpcVoiceRecording=require(_0xaddc('0x8'));var RpcVoiceTransferReport=require(_0xaddc('0x9'));var VoiceQueueReport=require(_0xaddc('0xa'));var VoiceCallReport=require(_0xaddc('0xb'));var VoiceAgentReport=require(_0xaddc('0xc'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require('./userReport');function Report(_0x4236d3){this[_0xaddc('0xd')]=_0x4236d3;this[_0xaddc('0xe')]=_0x4236d3[_0xaddc('0xe')];this[_0xaddc('0xf')]=_0x4236d3['telephones'];}Report[_0xaddc('0x10')][_0xaddc('0x11')]=function(_0x2a4719){var _0x509b4b=new VoiceQueueReport(this[_0xaddc('0xd')]);var _0xc1bd87=new VoiceAgentReport(this[_0xaddc('0xd')]);var _0x14a913=new VoiceDialReport(this['realtime']);var _0x51c2f0=new VoiceCallReport(this['realtime']);var _0x1a29a9=new UserReport(this[_0xaddc('0xd')]);if(config[_0xaddc('0x12')]&&config['xdr']['disabled']){ami['on'](_0xaddc('0x13'),this[_0xaddc('0x14')][_0xaddc('0x15')](this));ami['on'](_0xaddc('0x16'),this[_0xaddc('0x17')]['bind'](this));ami['on']('custom:voiceAgentReport',this[_0xaddc('0x18')][_0xaddc('0x15')](this));ami['on']('custom:voiceDialReport',this[_0xaddc('0x19')][_0xaddc('0x15')](this));ami['on'](_0xaddc('0x1a'),this[_0xaddc('0x1b')][_0xaddc('0x15')](this));ami['on'](_0xaddc('0x1c'),this[_0xaddc('0x1d')][_0xaddc('0x15')](this));}};Report[_0xaddc('0x10')][_0xaddc('0x1e')]=function(_0x393d55){var _0x30e011;_0x30e011=_['find'](this['agents'],function(_0x33ee1d){return _0x33ee1d[_0xaddc('0x1f')]==_0x393d55||_0x33ee1d[_0xaddc('0x20')]==_0x393d55;});if(_[_0xaddc('0x21')](_0x30e011)){var _0x49365d=_['find'](this['telephones'],function(_0x3177c5){return _0x3177c5['accountcode']==_0x393d55||_0x3177c5[_0xaddc('0x20')]==_0x393d55;});if(_0x49365d){_0x30e011=_['find'](this[_0xaddc('0xe')],function(_0xf94ae5){return _0xf94ae5['interface']==util['format'](_0xaddc('0x22'),_0x49365d[_0xaddc('0x20')]);});}}return _0x30e011;};Report['prototype'][_0xaddc('0x14')]=function(_0x4e3e4b){for(var _0x413ae4=0x0;_0x413ae4<_0x4e3e4b[_0xaddc('0x23')];_0x413ae4+=0x1){var _0x1218c6=this['findAgent'](_0x4e3e4b[_0x413ae4][_0xaddc('0x24')]);if(_0x1218c6){_0x4e3e4b[_0x413ae4][_0xaddc('0x1f')]=_0x1218c6['accountcode'];_0x4e3e4b[_0x413ae4][_0xaddc('0x25')]=!![];_0x4e3e4b[_0x413ae4][_0xaddc('0x26')]=_0x1218c6['name'];_0x4e3e4b[_0x413ae4][_0xaddc('0x27')]=_[_0xaddc('0x21')](_0x1218c6[_0xaddc('0x27')])?util[_0xaddc('0x28')](_0xaddc('0x22'),_0x1218c6['name']):_0x1218c6[_0xaddc('0x27')];if(_0x4e3e4b[_0x413ae4][_0xaddc('0x29')]){_0x4e3e4b[_0x413ae4]['queuecallercompleteAt']=moment()[_0xaddc('0x28')](_0xaddc('0x2a'));}if(_0x4e3e4b[_0x413ae4][_0xaddc('0x2b')]){_0x4e3e4b[_0x413ae4][_0xaddc('0x2c')]=moment()[_0xaddc('0x28')](_0xaddc('0x2a'));}RpcMemberReport[_0xaddc('0x14')](_0x4e3e4b[_0x413ae4]);}RpcVoiceQueueReport[_0xaddc('0x2d')](_0x4e3e4b[_0x413ae4]);}};function extractCalleridNumber(_0x582b71){var _0x444675=_0x582b71[_0xaddc('0x2e')](/<(.*?)>/);return _0x444675?_0x444675[0x1]:_0x582b71;}Report[_0xaddc('0x10')][_0xaddc('0x2f')]=function(_0x35c2a9){for(var _0x489f00=0x0;_0x489f00',_0x12ba3c['calleridname'],_0x12ba3c[_0xaddc('0x33')]);}if(RpcVoiceTransferReport[_0xaddc('0x45')][_0x12ba3c['linkedid']]){var _0x377856=RpcVoiceTransferReport[_0xaddc('0x45')][_0x12ba3c['linkedid']];_0x377856[_0xaddc('0x46')]=_0x12ba3c['uniqueid'];RpcVoiceTransferReport[_0xaddc('0x1b')](_0x377856);delete RpcVoiceTransferReport[_0xaddc('0x45')][_0x12ba3c[_0xaddc('0x47')]];}if(_[_0xaddc('0x21')](_0x12ba3c[_0xaddc('0x37')])){_0x12ba3c[_0xaddc('0x37')]=this[_0xaddc('0x31')](_0x12ba3c);}if(_[_0xaddc('0x21')](_0x12ba3c['UserId'])){var _0x5acb73=_0x12ba3c[_0xaddc('0x32')][_0xaddc('0x48')]('-')[0x0];var _0x4fb8c2=this[_0xaddc('0xe')][_0x5acb73];if(!_0x4fb8c2)_0x4fb8c2=this[_0xaddc('0x2f')](_0x12ba3c['accountcode']);if(_0x4fb8c2){_0x12ba3c[_0xaddc('0x49')]=_0x4fb8c2['id'];_0x12ba3c[_0xaddc('0x4a')]=_0x4fb8c2['name'];}}RpcVoiceCallReport[_0xaddc('0x2d')](_0x12ba3c);if(_0x12ba3c[_0xaddc('0x4b')]){for(var _0x383954=0x0;_0x383954<_0x12ba3c[_0xaddc('0x4c')][_0xaddc('0x23')];_0x383954+=0x1){_0x12ba3c[_0xaddc('0x4d')]=_0x12ba3c[_0xaddc('0x4c')][_0x383954][_0xaddc('0x4e')];_0x12ba3c[_0xaddc('0x4f')]=_0x12ba3c[_0xaddc('0x4c')][_0x383954][_0xaddc('0x4f')];if(_0x12ba3c[_0xaddc('0x36')]==_0xaddc('0x3f')){_0x12ba3c[_0xaddc('0x33')]=_0x12ba3c[_0xaddc('0x24')];_0x12ba3c[_0xaddc('0x50')]=_0x12ba3c['connectedlinename'];_0x12ba3c[_0xaddc('0x24')]=_0x12ba3c[_0xaddc('0x1f')];_0x12ba3c[_0xaddc('0x51')]=_0x12ba3c[_0xaddc('0x4a')];_0x12ba3c[_0xaddc('0x36')]=_0x12ba3c['originatecalleridnum'];}else if(_0x12ba3c[_0xaddc('0x36')]=='xcally-motion-dialer'){_0x12ba3c[_0xaddc('0x33')]=_0x12ba3c[_0xaddc('0x35')];_0x12ba3c[_0xaddc('0x36')]=_0x12ba3c['originatecalleridnum'];}RpcVoiceRecording[_0xaddc('0x2d')](_0x12ba3c);}}};Report[_0xaddc('0x10')][_0xaddc('0x18')]=function(_0x125c51){if(_[_0xaddc('0x52')](_0x125c51)){_0x125c51[_0xaddc('0x53')](function(_0x1fa214){RpcVoiceAgentReport[_0xaddc('0x2d')](_0x1fa214);});}else{RpcVoiceAgentReport[_0xaddc('0x2d')](_0x125c51);}};Report[_0xaddc('0x10')][_0xaddc('0x19')]=function(_0x502f70){RpcVoiceDialReport[_0xaddc('0x2d')](_0x502f70);var _0x3ac7bc;var _0x232f4c;var _0x33794c=_0x502f70[_0xaddc('0x32')];if(_['startsWith'](_0x33794c,_0xaddc('0x54'))){_0x232f4c=_0x33794c[_0xaddc('0x55')](_0x33794c[_0xaddc('0x56')]('/')+0x1,_0x33794c['indexOf']('@'));_0x3ac7bc=_[_0xaddc('0x57')](this[_0xaddc('0xe')],function(_0x11746e){return _0x11746e[_0xaddc('0x58')]==_0x232f4c||_0x11746e[_0xaddc('0x59')]==_0x232f4c||_0x11746e[_0xaddc('0x1f')]==_0x232f4c;});}else{_0x232f4c=_0x33794c[_0xaddc('0x55')](_0x33794c['indexOf']('/')+0x1,_0x33794c[_0xaddc('0x5a')]('-'));_0x3ac7bc=this[_0xaddc('0x1e')](_0x232f4c);}if(_0x3ac7bc){_0x502f70[_0xaddc('0x27')]=_[_0xaddc('0x21')](_0x3ac7bc[_0xaddc('0x27')])?util[_0xaddc('0x28')]('SIP/%s',_0x3ac7bc['name']):_0x3ac7bc[_0xaddc('0x27')];_0x502f70['membername']=_0x3ac7bc['name'];_0x502f70[_0xaddc('0x1f')]=_0x3ac7bc[_0xaddc('0x1f')];RpcMemberReport[_0xaddc('0x19')](_0x502f70);}};Report[_0xaddc('0x10')]['blindTransfer']=function(_0x445bf8){RpcVoiceTransferReport[_0xaddc('0x45')][_0x445bf8[_0xaddc('0x5b')]]=_0x445bf8;};Report[_0xaddc('0x10')]['attendedTransfer']=function(_0x2411bd){RpcVoiceTransferReport[_0xaddc('0x1d')](_0x2411bd);};module['exports']=Report; \ No newline at end of file +var _0xcf93=['internal','destination','exten','type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','callerid','calleridpreview','destinationchannel','channel','disposition','ANSWERED','connectedlinenum','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','blindTransfer','UserId','monitors','createdAt','connectedlinename','membername','xcally-motion-dialer','voiceAgentReport','Local','substring','indexOf','mobile','transfererlinkedid','util','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/voiceQueueReport','./voiceCallReport','./voiceDialReport','./userReport','agents','telephones','prototype','sync','realtime','xdr','custom:voiceQueueReport','voiceQueueReport','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','bind','custom:voiceDialReport','voiceDialReport','attendedtransfer','attendedTransfer','find','accountcode','isNil','name','interface','format','SIP/%s','length','findAgent','assigned','lastAssignedTo','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','create','keys','getCallType','split','getAgentByInternal','calleridnum','outbound'];(function(_0x46f4e9,_0x1de9a2){var _0xf6ae2f=function(_0x230fe6){while(--_0x230fe6){_0x46f4e9['push'](_0x46f4e9['shift']());}};_0xf6ae2f(++_0x1de9a2);}(_0xcf93,0x168));var _0x3cf9=function(_0x1cf191,_0x359410){_0x1cf191=_0x1cf191-0x0;var _0x5dfa4a=_0xcf93[_0x1cf191];return _0x5dfa4a;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0x3cf9('0x0'));var config=require('../../../config/environment');var ami=require('../ami');var RpcVoiceAgentReport=require(_0x3cf9('0x1'));var RpcVoiceCallReport=require(_0x3cf9('0x2'));var RpcVoiceDialReport=require(_0x3cf9('0x3'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0x3cf9('0x4'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0x3cf9('0x5'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0x3cf9('0x6'));var UserReport=require(_0x3cf9('0x7'));function Report(_0x9ed2bc){this['realtime']=_0x9ed2bc;this[_0x3cf9('0x8')]=_0x9ed2bc[_0x3cf9('0x8')];this[_0x3cf9('0x9')]=_0x9ed2bc[_0x3cf9('0x9')];}Report[_0x3cf9('0xa')][_0x3cf9('0xb')]=function(_0x50f262){var _0x591aec=new VoiceQueueReport(this[_0x3cf9('0xc')]);var _0x1f9b42=new VoiceAgentReport(this[_0x3cf9('0xc')]);var _0x1b930d=new VoiceDialReport(this[_0x3cf9('0xc')]);var _0x32ae3a=new VoiceCallReport(this['realtime']);var _0x331e64=new UserReport(this[_0x3cf9('0xc')]);if(config['xdr']&&config[_0x3cf9('0xd')]['disabled']){ami['on'](_0x3cf9('0xe'),this[_0x3cf9('0xf')]['bind'](this));ami['on'](_0x3cf9('0x10'),this[_0x3cf9('0x11')]['bind'](this));ami['on'](_0x3cf9('0x12'),this['voiceAgentReport'][_0x3cf9('0x13')](this));ami['on'](_0x3cf9('0x14'),this[_0x3cf9('0x15')][_0x3cf9('0x13')](this));ami['on']('blindtransfer',this['blindTransfer']['bind'](this));ami['on'](_0x3cf9('0x16'),this[_0x3cf9('0x17')][_0x3cf9('0x13')](this));}};Report[_0x3cf9('0xa')]['findAgent']=function(_0x3e6669){var _0x374f38;_0x374f38=_[_0x3cf9('0x18')](this[_0x3cf9('0x8')],function(_0x452021){return _0x452021[_0x3cf9('0x19')]==_0x3e6669||_0x452021['name']==_0x3e6669;});if(_[_0x3cf9('0x1a')](_0x374f38)){var _0x401374=_[_0x3cf9('0x18')](this['telephones'],function(_0x15d6ea){return _0x15d6ea['accountcode']==_0x3e6669||_0x15d6ea[_0x3cf9('0x1b')]==_0x3e6669;});if(_0x401374){_0x374f38=_[_0x3cf9('0x18')](this[_0x3cf9('0x8')],function(_0x35f62d){return _0x35f62d[_0x3cf9('0x1c')]==util[_0x3cf9('0x1d')](_0x3cf9('0x1e'),_0x401374[_0x3cf9('0x1b')]);});}}return _0x374f38;};Report['prototype']['voiceQueueReport']=function(_0x4353c9){for(var _0x3ef56b=0x0;_0x3ef56b<_0x4353c9[_0x3cf9('0x1f')];_0x3ef56b+=0x1){var _0x30159e=this[_0x3cf9('0x20')](_0x4353c9[_0x3ef56b]['connectedlinenum']);if(_0x30159e){_0x4353c9[_0x3ef56b][_0x3cf9('0x19')]=_0x30159e[_0x3cf9('0x19')];_0x4353c9[_0x3ef56b][_0x3cf9('0x21')]=!![];_0x4353c9[_0x3ef56b][_0x3cf9('0x22')]=_0x30159e['name'];_0x4353c9[_0x3ef56b][_0x3cf9('0x1c')]=_[_0x3cf9('0x1a')](_0x30159e[_0x3cf9('0x1c')])?util[_0x3cf9('0x1d')](_0x3cf9('0x1e'),_0x30159e[_0x3cf9('0x1b')]):_0x30159e[_0x3cf9('0x1c')];if(_0x4353c9[_0x3ef56b][_0x3cf9('0x23')]){_0x4353c9[_0x3ef56b]['queuecallercompleteAt']=moment()[_0x3cf9('0x1d')](_0x3cf9('0x24'));}if(_0x4353c9[_0x3ef56b]['queuecallerexit']){_0x4353c9[_0x3ef56b][_0x3cf9('0x25')]=moment()['format'](_0x3cf9('0x24'));}RpcMemberReport['voiceQueueReport'](_0x4353c9[_0x3ef56b]);}RpcVoiceQueueReport[_0x3cf9('0x26')](_0x4353c9[_0x3ef56b]);}};function extractCalleridNumber(_0x5b8480){var _0x1f4058=_0x5b8480['match'](/<(.*?)>/);return _0x1f4058?_0x1f4058[0x1]:_0x5b8480;}Report[_0x3cf9('0xa')]['getAgentByInternal']=function(_0xa3f552){for(var _0xd56ee0=0x0;_0xd56ee00x0?!![]:![];if(!_0x26cbee){return this[_0x2cb8('0x17')](this[_0x2cb8('0x61')][_0x2cb8('0x70')]);}};VoiceQueueReport['prototype']['syncQueueMember']=function(_0x41684c){var _0x1013c0=this[_0x2cb8('0x61')]['id'];if(this[_0x2cb8('0x61')][_0x2cb8('0x6a')][_0x1013c0]&&this[_0x2cb8('0x61')][_0x2cb8('0x6a')][_0x1013c0][_0x41684c[_0x2cb8('0x6b')]]){this[_0x2cb8('0x61')][_0x2cb8('0x6a')][_0x1013c0][_0x41684c[_0x2cb8('0x6b')]]['agents']['push'](_0x41684c);}};VoiceQueueReport[_0x2cb8('0x3a')][_0x2cb8('0x71')]=function(_0x4e8d9e){var _0x1710e7=this;try{if(this[_0x2cb8('0x5c')](_0x4e8d9e)&&this[_0x2cb8('0x5c')](_0x4e8d9e[_0x2cb8('0x4e')])){logger[_0x2cb8('0x4a')](_0x2cb8('0x72'),util[_0x2cb8('0x41')](_0x4e8d9e,{'showHidden':![],'depth':null}));var _0x3c0d8b=this[_0x2cb8('0x13')][_0x4e8d9e[_0x2cb8('0x4e')]];if(_0x3c0d8b){logger[_0x2cb8('0x4a')]('[voiceQueueReport][queuesummary]\x20name:%s',_0x3c0d8b[_0x2cb8('0x5a')]);this[_0x2cb8('0x61')]['queues'][_0x3c0d8b['name']]={'summaryEvent':_0x4e8d9e};this[_0x2cb8('0x61')]['statusRequests']+=0x1;return ami[_0x2cb8('0x3e')]({'action':_0x2cb8('0x6a'),'queue':_0x3c0d8b[_0x2cb8('0x5a')]})['then'](function(_0xc4298){if(!_0x1710e7[_0x2cb8('0x61')][_0x2cb8('0x6a')][_0x4e8d9e[_0x2cb8('0x6b')]]){_0x1710e7[_0x2cb8('0x61')][_0x2cb8('0x6a')][_0x4e8d9e[_0x2cb8('0x6b')]]={};}_0x1710e7[_0x2cb8('0x61')]['queuestatus'][_0x4e8d9e[_0x2cb8('0x6b')]][_0xc4298[_0x2cb8('0x6b')]]={'queue':_0x3c0d8b[_0x2cb8('0x5a')],'agents':[]};})[_0x2cb8('0x5f')](function(_0xc467c6){throw _0xc467c6;});}}}catch(_0x2b148b){logger[_0x2cb8('0x42')](_0x2cb8('0x63'),util[_0x2cb8('0x41')](_0x2b148b,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x2cb8('0x17')]=function(_0x2bf1f6){if(this[_0x2cb8('0x61')]['statusRequests']>0x0){this['summary'][_0x2cb8('0x70')]=_0x2bf1f6;return;}logger[_0x2cb8('0x4a')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util['inspect'](_0x2bf1f6,{'showHidden':![],'depth':null}));this[_0x2cb8('0x61')]=initializeSummary();ami[_0x2cb8('0x48')](_0x2cb8('0x73'),{});};VoiceQueueReport['prototype'][_0x2cb8('0x1c')]=function(_0x6bb5de){try{if(this['isNotNull'](_0x6bb5de)){logger['debug']('[%s][voiceQueueReport][queuecallerjoin]',_0x6bb5de[_0x2cb8('0x4d')],util['inspect'](_0x6bb5de,{'showHidden':![],'depth':null}));if(_[_0x2cb8('0x5d')](this[_0x2cb8('0xf')][_0x6bb5de[_0x2cb8('0x4d')]])){this[_0x2cb8('0xf')][_0x6bb5de[_0x2cb8('0x4d')]]=[];}if(_['isUndefined'](this['channels'][_0x6bb5de[_0x2cb8('0x4d')]])){this[_0x2cb8('0x11')][_0x6bb5de[_0x2cb8('0x4d')]]={};}var _0x14c41f=new QueueReport();_0x14c41f['queue']=_0x6bb5de[_0x2cb8('0x4e')];_0x14c41f[_0x2cb8('0x57')]=this['voiceQueues'][_0x14c41f['queue']]&&this['voiceQueues'][_0x14c41f[_0x2cb8('0x4e')]][_0x2cb8('0x57')]?this[_0x2cb8('0x13')][_0x14c41f['queue']][_0x2cb8('0x57')]||_0x2cb8('0x58'):_0x2cb8('0x58');_0x14c41f['queuecallerjoinAt']=moment()[_0x2cb8('0x53')](_0x2cb8('0x74'));_0x14c41f[_0x2cb8('0x75')]=_0x6bb5de['position'];_0x14c41f[_0x2cb8('0x76')]=_0x6bb5de[_0x2cb8('0x76')];_0x14c41f[_0x2cb8('0x4d')]=_0x6bb5de[_0x2cb8('0x4d')];_0x14c41f[_0x2cb8('0x77')]=this[_0x2cb8('0x11')][_0x6bb5de['uniqueid']][_0x2cb8('0x77')];logger[_0x2cb8('0x78')](_0x2cb8('0x79'),_0x14c41f[_0x2cb8('0x4e')],_0x14c41f[_0x2cb8('0x57')]);Object[_0x2cb8('0x7a')](_0x14c41f,_[_0x2cb8('0x7b')](_0x6bb5de,_[_0x2cb8('0x7c')](_0x14c41f)));this[_0x2cb8('0xf')][_0x6bb5de[_0x2cb8('0x4d')]][_0x2cb8('0x7d')](_0x14c41f);this['channels'][_0x6bb5de[_0x2cb8('0x4d')]]=_0x14c41f;this['emitVoiceQueueChannelSave'](_0x14c41f,_0x2cb8('0x1b'));}}catch(_0xf5c977){logger[_0x2cb8('0x42')](_0x2cb8('0x7e'),_0x6bb5de['uniqueid'],util[_0x2cb8('0x41')](_0xf5c977,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2cb8('0x3a')][_0x2cb8('0x7f')]=function(_0x2eba4e){try{if(this[_0x2cb8('0x5c')](_0x2eba4e)){logger[_0x2cb8('0x4a')]('[%s][voiceQueueReport][queuecallerabandon]',_0x2eba4e['uniqueid'],util[_0x2cb8('0x41')](_0x2eba4e,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x2eba4e[_0x2cb8('0x4d')]]){var _0xa247b8=_[_0x2cb8('0x80')](this[_0x2cb8('0xf')][_0x2eba4e['uniqueid']]);_0xa247b8['queuecallercomplete']=![];_0xa247b8[_0x2cb8('0x81')]=null;_0xa247b8['holdtime']=_0x2eba4e[_0x2cb8('0x82')];_0xa247b8['originalposition']=_0x2eba4e[_0x2cb8('0x83')];_0xa247b8[_0x2cb8('0x38')]=!![];_0xa247b8[_0x2cb8('0x84')]=moment()['format'](_0x2cb8('0x74'));_0xa247b8[_0x2cb8('0x51')]='ABANDONED';_0xa247b8[_0x2cb8('0x85')]=null;logger['info'](_0x2cb8('0x86'),_0xa247b8[_0x2cb8('0x4e')],_0xa247b8[_0x2cb8('0x57')]);this[_0x2cb8('0x11')][_0x2eba4e[_0x2cb8('0x4d')]]=_0xa247b8;this[_0x2cb8('0x46')](_0xa247b8,_0x2cb8('0x38'));}}}catch(_0x520343){logger[_0x2cb8('0x42')](_0x2cb8('0x87'),_0x2eba4e[_0x2cb8('0x4d')],util['inspect'](_0x520343,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2cb8('0x3a')][_0x2cb8('0x1e')]=function(_0x9a824d){try{if(this['isNotNull'](_0x9a824d)){logger[_0x2cb8('0x4a')]('[%s][voiceQueueReport][queuecallerleave]',_0x9a824d['uniqueid'],util[_0x2cb8('0x41')](_0x9a824d,{'showHidden':![],'depth':null}));if(this[_0x2cb8('0xf')][_0x9a824d[_0x2cb8('0x4d')]]){var _0x13be05=_[_0x2cb8('0x80')](this[_0x2cb8('0xf')][_0x9a824d[_0x2cb8('0x4d')]]);_0x13be05[_0x2cb8('0x88')]=moment()[_0x2cb8('0x53')](_0x2cb8('0x74'));_0x13be05['connectedlinenum']=_0x9a824d['connectedlinenum'];_0x13be05[_0x2cb8('0x89')]=_0x9a824d[_0x2cb8('0x89')];logger[_0x2cb8('0x78')](_0x2cb8('0x8a'),_0x13be05[_0x2cb8('0x4e')],_0x13be05[_0x2cb8('0x57')],_0x9a824d[_0x2cb8('0x8b')],_0x9a824d[_0x2cb8('0x89')]);this['channels'][_0x9a824d[_0x2cb8('0x4d')]]=_0x13be05;this[_0x2cb8('0x49')](_0x13be05,_0x2cb8('0x1d'));}}}catch(_0x395487){logger[_0x2cb8('0x42')]('[%s][voiceQueueReport][queuecallerleave]',_0x9a824d[_0x2cb8('0x4d')],util[_0x2cb8('0x41')](_0x395487,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2cb8('0x3a')][_0x2cb8('0x21')]=function(_0xc0668b){try{if(this['isNotNull'](_0xc0668b)){logger['debug']('[%s][voiceQueueReport][agentconnect]',_0xc0668b[_0x2cb8('0x4d')],util[_0x2cb8('0x41')](_0xc0668b,{'showHidden':![],'depth':null}));if(this['queueReports'][_0xc0668b['uniqueid']]){var _0x4c7c7b=_[_0x2cb8('0x80')](this[_0x2cb8('0xf')][_0xc0668b[_0x2cb8('0x4d')]]);_0x4c7c7b[_0x2cb8('0x39')]=!![];_0x4c7c7b['queuecallerexitreason']=_0x2cb8('0x8c');logger[_0x2cb8('0x78')](_0x2cb8('0x8d'),_0x4c7c7b['queue'],_0x4c7c7b['type']);}}}catch(_0x2da478){logger[_0x2cb8('0x42')](_0x2cb8('0x8e'),_0xc0668b['uniqueid'],util[_0x2cb8('0x41')](_0x2da478,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2cb8('0x3a')][_0x2cb8('0x20')]=function(_0x175c9b){try{if(this['isNotNull'](_0x175c9b)){logger[_0x2cb8('0x4a')](_0x2cb8('0x8f'),_0x175c9b[_0x2cb8('0x4d')],util[_0x2cb8('0x41')](_0x175c9b,{'showHidden':![],'depth':null}));if(this[_0x2cb8('0xf')][_0x175c9b[_0x2cb8('0x4d')]]){var _0x5923f6=_['last'](this['queueReports'][_0x175c9b['uniqueid']]);_0x5923f6[_0x2cb8('0x38')]=![];_0x5923f6['queuecallerabandonAt']=null;_0x5923f6[_0x2cb8('0x90')]=!![];_0x5923f6[_0x2cb8('0x85')]=_0x175c9b[_0x2cb8('0x91')];_0x5923f6['holdtime']=_0x175c9b[_0x2cb8('0x82')];_0x5923f6[_0x2cb8('0x39')]=!![];_0x5923f6[_0x2cb8('0x37')]=![];_0x5923f6[_0x2cb8('0x92')]=null;if(!_0x5923f6[_0x2cb8('0x93')]){if(_0x175c9b[_0x2cb8('0x94')]=='transfer'){_0x5923f6[_0x2cb8('0x51')]='COMPLETED';logger[_0x2cb8('0x78')](_0x2cb8('0x95'),_0x5923f6[_0x2cb8('0x4e')],_0x5923f6[_0x2cb8('0x57')]);}else{if(_[_0x2cb8('0x96')](_0x175c9b[_0x2cb8('0x40')][_0x2cb8('0x97')](),'local/')){if(this[_0x2cb8('0xf')][_0x175c9b['linkedid']]){var _0x2a1509=_[_0x2cb8('0x80')](this[_0x2cb8('0xf')][_0x175c9b['linkedid']]);_0x2a1509['queuecallercomplete']=![];_0x2a1509[_0x2cb8('0x37')]=!![];_0x2a1509['queuecallerexitAt']=moment(_0x5923f6[_0x2cb8('0x98')])['add'](_0x175c9b[_0x2cb8('0x82')],_0x2cb8('0x99'))[_0x2cb8('0x53')](_0x2cb8('0x74'));_0x2a1509['queuecallerexitreason']=_0x2cb8('0x9a');_0x2a1509[_0x2cb8('0x93')]=!![];_0x2a1509[_0x2cb8('0x9b')]=_0x2cb8('0x9c');_0x2a1509[_0x2cb8('0x9d')]=_0x175c9b[_0x2cb8('0x9e')];_0x2a1509['transferuniqueid']=_0x175c9b['uniqueid'];logger[_0x2cb8('0x78')](_0x2cb8('0x9f'),_0x2a1509[_0x2cb8('0x4e')],_0x2a1509[_0x2cb8('0x57')]);var _0x33bddd=this[_0x2cb8('0xf')][_0x175c9b['linkedid']];this[_0x2cb8('0xf')][_0x175c9b[_0x2cb8('0xa0')]]=this[_0x2cb8('0xf')][_0x175c9b[_0x2cb8('0x4d')]];this[_0x2cb8('0xf')][_0x175c9b['uniqueid']]=_0x33bddd;}}else{_0x5923f6['queuecallerexitreason']=_0x2cb8('0xa1')+_0x175c9b[_0x2cb8('0x94')]['toUpperCase']();logger[_0x2cb8('0x78')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x5923f6[_0x2cb8('0x4e')],_0x5923f6[_0x2cb8('0x57')],_0x5923f6['queuecallerexitreason']);}}}this[_0x2cb8('0x11')][_0x175c9b['uniqueid']]=_0x5923f6;}}}catch(_0x1f1019){logger[_0x2cb8('0x42')]('[%s][voiceQueueReport][agentcomplete]',_0x175c9b[_0x2cb8('0x4d')],util[_0x2cb8('0x41')](_0x1f1019,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncVarSet']=function(_0x34c98f){try{if(this[_0x2cb8('0x5c')](_0x34c98f)){logger[_0x2cb8('0x4a')]('[%s][voiceQueueReport][varset]',_0x34c98f[_0x2cb8('0x4d')],util['inspect'](_0x34c98f,{'showHidden':![],'depth':null}));this['addVariable'](_0x34c98f['uniqueid'],_[_0x2cb8('0x7c')](_0x34c98f[_0x2cb8('0xa2')])[0x0],_0x34c98f['value']);if(this[_0x2cb8('0xf')][_0x34c98f['uniqueid']]){var _0x365e8f=_[_0x2cb8('0x80')](this[_0x2cb8('0xf')][_0x34c98f['uniqueid']]);if(_0x365e8f){if(this['isNotNull'](_0x34c98f[_0x2cb8('0xa2')])&&this['isNotNull'](_0x34c98f[_0x2cb8('0xa2')]['queuestatus'])){switch(_0x34c98f[_0x2cb8('0xa3')]){case _0x2cb8('0xa4'):_0x365e8f[_0x2cb8('0x37')]=![];_0x365e8f[_0x2cb8('0x92')]=null;break;case _0x2cb8('0xa5'):_0x365e8f[_0x2cb8('0xa6')]=_0x2cb8('0xa7');_0x365e8f[_0x2cb8('0x37')]=!![];_0x365e8f[_0x2cb8('0x92')]=moment()[_0x2cb8('0x53')](_0x2cb8('0x74'));_0x365e8f['queuecallerleaveAt']=moment()[_0x2cb8('0x53')](_0x2cb8('0x74'));logger[_0x2cb8('0x4a')](_0x2cb8('0xa8'),_0x34c98f['uniqueid'],util[_0x2cb8('0x41')](_0x365e8f,{'showHidden':![],'depth':null}));ami['emit'](_0x2cb8('0xa9'),_0x365e8f);break;default:_0x365e8f[_0x2cb8('0x37')]=!![];_0x365e8f[_0x2cb8('0x92')]=moment()[_0x2cb8('0x53')](_0x2cb8('0x74'));_0x365e8f[_0x2cb8('0x88')]=moment()[_0x2cb8('0x53')](_0x2cb8('0x74'));}_0x365e8f[_0x2cb8('0x38')]=![];_0x365e8f[_0x2cb8('0x84')]=null;_0x365e8f['queuecallerexitreason']=_0x34c98f['value'];this['channels'][_0x34c98f['uniqueid']]=_0x365e8f;this[_0x2cb8('0x46')](_0x365e8f,'varset');}else if(this[_0x2cb8('0x5c')](_0x34c98f['variable'])&&this[_0x2cb8('0x5c')](_0x34c98f[_0x2cb8('0xa2')][_0x2cb8('0xaa')])){if(!_0x365e8f[_0x2cb8('0x38')]){_0x365e8f[_0x2cb8('0x37')]=!![];_0x365e8f['queuecallerexitAt']=moment()[_0x2cb8('0x53')]('YYYY-MM-DD\x20HH:mm:ss');_0x365e8f[_0x2cb8('0x51')]=_0x2cb8('0xab');_0x365e8f[_0x2cb8('0x88')]=moment()['format'](_0x2cb8('0x74'));this[_0x2cb8('0x11')][_0x34c98f[_0x2cb8('0x4d')]]=_0x365e8f;}}logger['info'](_0x2cb8('0xac'),_0x34c98f[_0x2cb8('0x4d')],_0x365e8f[_0x2cb8('0x4e')],_0x365e8f[_0x2cb8('0x57')],_['keys'](_0x34c98f[_0x2cb8('0xa2')])[0x0],_0x34c98f['value']);_0x365e8f[_0x2cb8('0x15')]=this[_0x2cb8('0x15')][_0x34c98f['uniqueid']];}}}}catch(_0x1e821c){logger[_0x2cb8('0x42')](_0x2cb8('0xad'),_0x34c98f[_0x2cb8('0x4d')],util[_0x2cb8('0x41')](_0x1e821c,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['addVariable']=function(_0x43fb62,_0x44204e,_0x183199){var _0x1e7448=['rtpaudioqos','rtpaudioqosbridged',_0x2cb8('0xae'),_0x2cb8('0xaf'),'rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt',_0x2cb8('0xb0'),_0x2cb8('0xb1'),'sipuri',_0x2cb8('0xb2'),'bridgepvtcallid',_0x2cb8('0xb3'),_0x2cb8('0xb4'),'memberinterface',_0x2cb8('0xb5'),_0x2cb8('0x91'),'memberpenalty',_0x2cb8('0xb6')];if(!_['isNil'](_0x44204e)&&!_['includes'](_0x1e7448,_0x44204e)){if(_[_0x2cb8('0x5d')](this[_0x2cb8('0x15')][_0x43fb62])){this[_0x2cb8('0x15')][_0x43fb62]={};}this['variables'][_0x43fb62][_0x44204e]=_0x183199;}};VoiceQueueReport[_0x2cb8('0x3a')][_0x2cb8('0xb7')]=function(_0x4cb4b0,_0x237a32,_0x4465f1){try{var _0x4664c6={};if(this['queueReports'][_0x4cb4b0]){for(var _0x24a5db=0x0;_0x24a5db0x0?!![]:![];if(!_0x96cfed){return this[_0x733d('0x6f')](this[_0x733d('0x60')]['completeEvent']);}};VoiceQueueReport[_0x733d('0xb')][_0x733d('0x1c')]=function(_0x56f38c){var _0x25d351=this[_0x733d('0x60')]['id'];if(this[_0x733d('0x60')][_0x733d('0x63')][_0x25d351]&&this[_0x733d('0x60')][_0x733d('0x63')][_0x25d351][_0x56f38c[_0x733d('0x62')]]){this[_0x733d('0x60')]['queuestatus'][_0x25d351][_0x56f38c[_0x733d('0x62')]]['agents'][_0x733d('0x70')](_0x56f38c);}};VoiceQueueReport[_0x733d('0xb')][_0x733d('0x19')]=function(_0x287535){var _0x5ec812=this;try{if(this[_0x733d('0x5d')](_0x287535)&&this[_0x733d('0x5d')](_0x287535[_0x733d('0x51')])){logger['debug']('[voiceQueueReport][queuesummary]\x20event:',util['inspect'](_0x287535,{'showHidden':![],'depth':null}));var _0x3aaceb=this[_0x733d('0x15')][_0x287535[_0x733d('0x51')]];if(_0x3aaceb){logger['debug']('[voiceQueueReport][queuesummary]\x20name:%s',_0x3aaceb[_0x733d('0x5b')]);this[_0x733d('0x60')][_0x733d('0x64')][_0x3aaceb[_0x733d('0x5b')]]={'summaryEvent':_0x287535};this['summary'][_0x733d('0x6e')]+=0x1;return ami[_0x733d('0x3d')]({'action':_0x733d('0x63'),'queue':_0x3aaceb[_0x733d('0x5b')]})[_0x733d('0x71')](function(_0x27d668){if(!_0x5ec812[_0x733d('0x60')][_0x733d('0x63')][_0x287535[_0x733d('0x62')]]){_0x5ec812[_0x733d('0x60')]['queuestatus'][_0x287535[_0x733d('0x62')]]={};}_0x5ec812[_0x733d('0x60')][_0x733d('0x63')][_0x287535[_0x733d('0x62')]][_0x27d668['actionid']]={'queue':_0x3aaceb[_0x733d('0x5b')],'agents':[]};})['catch'](function(_0x3556a1){throw _0x3556a1;});}}}catch(_0x4ac461){logger['error']('[voiceQueueReport][queuesummary]',util['inspect'](_0x4ac461,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x733d('0x6f')]=function(_0x2541b7){if(this[_0x733d('0x60')][_0x733d('0x6e')]>0x0){this[_0x733d('0x60')][_0x733d('0x72')]=_0x2541b7;return;}logger['debug'](_0x733d('0x73'),util['inspect'](_0x2541b7,{'showHidden':![],'depth':null}));this['summary']=initializeSummary();ami[_0x733d('0x4a')](_0x733d('0x74'),{});};VoiceQueueReport[_0x733d('0xb')]['syncQueueCallerJoin']=function(_0x236fbc){try{if(this[_0x733d('0x5d')](_0x236fbc)){logger['debug'](_0x733d('0x75'),_0x236fbc[_0x733d('0x4e')],util['inspect'](_0x236fbc,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x733d('0x10')][_0x236fbc['uniqueid']])){this[_0x733d('0x10')][_0x236fbc[_0x733d('0x4e')]]=[];}if(_[_0x733d('0x5e')](this[_0x733d('0x13')][_0x236fbc[_0x733d('0x4e')]])){this['channels'][_0x236fbc['uniqueid']]={};}var _0xe1878a=new QueueReport();_0xe1878a[_0x733d('0x51')]=_0x236fbc[_0x733d('0x51')];_0xe1878a[_0x733d('0x59')]=this[_0x733d('0x15')][_0xe1878a[_0x733d('0x51')]]&&this[_0x733d('0x15')][_0xe1878a[_0x733d('0x51')]]['type']?this['voiceQueues'][_0xe1878a[_0x733d('0x51')]][_0x733d('0x59')]||_0x733d('0x6b'):_0x733d('0x6b');_0xe1878a[_0x733d('0x76')]=moment()['format'](_0x733d('0x77'));_0xe1878a[_0x733d('0x78')]=_0x236fbc[_0x733d('0x78')];_0xe1878a[_0x733d('0x79')]=_0x236fbc[_0x733d('0x79')];_0xe1878a['uniqueid']=_0x236fbc['uniqueid'];_0xe1878a[_0x733d('0x7a')]=this[_0x733d('0x13')][_0x236fbc['uniqueid']][_0x733d('0x7a')];logger[_0x733d('0x7b')](_0x733d('0x7c'),_0xe1878a[_0x733d('0x51')],_0xe1878a[_0x733d('0x59')]);Object['assign'](_0xe1878a,_[_0x733d('0x7d')](_0x236fbc,_[_0x733d('0x7e')](_0xe1878a)));this[_0x733d('0x10')][_0x236fbc['uniqueid']]['push'](_0xe1878a);this[_0x733d('0x13')][_0x236fbc['uniqueid']]=_0xe1878a;this[_0x733d('0x4b')](_0xe1878a,_0x733d('0x1d'));}}catch(_0x40126d){logger[_0x733d('0x42')](_0x733d('0x75'),_0x236fbc[_0x733d('0x4e')],util[_0x733d('0x44')](_0x40126d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x733d('0xb')][_0x733d('0x20')]=function(_0x1dc78f){try{if(this[_0x733d('0x5d')](_0x1dc78f)){logger['debug'](_0x733d('0x7f'),_0x1dc78f[_0x733d('0x4e')],util[_0x733d('0x44')](_0x1dc78f,{'showHidden':![],'depth':null}));if(this[_0x733d('0x10')][_0x1dc78f[_0x733d('0x4e')]]){var _0x1f974c=_[_0x733d('0x80')](this[_0x733d('0x10')][_0x1dc78f['uniqueid']]);_0x1f974c['queuecallercomplete']=![];_0x1f974c[_0x733d('0x81')]=null;_0x1f974c[_0x733d('0x82')]=_0x1dc78f[_0x733d('0x82')];_0x1f974c[_0x733d('0x83')]=_0x1dc78f[_0x733d('0x83')];_0x1f974c[_0x733d('0x1f')]=!![];_0x1f974c[_0x733d('0x84')]=moment()[_0x733d('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');_0x1f974c[_0x733d('0x55')]=_0x733d('0x85');_0x1f974c[_0x733d('0x86')]=null;logger[_0x733d('0x7b')](_0x733d('0x87'),_0x1f974c[_0x733d('0x51')],_0x1f974c['type']);this[_0x733d('0x13')][_0x1dc78f['uniqueid']]=_0x1f974c;this[_0x733d('0x49')](_0x1f974c,_0x733d('0x1f'));}}}catch(_0x499728){logger[_0x733d('0x42')](_0x733d('0x7f'),_0x1dc78f[_0x733d('0x4e')],util[_0x733d('0x44')](_0x499728,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x733d('0xb')][_0x733d('0x22')]=function(_0xe5122){try{if(this[_0x733d('0x5d')](_0xe5122)){logger[_0x733d('0x4c')](_0x733d('0x88'),_0xe5122[_0x733d('0x4e')],util[_0x733d('0x44')](_0xe5122,{'showHidden':![],'depth':null}));if(this['queueReports'][_0xe5122[_0x733d('0x4e')]]){var _0x269a72=_[_0x733d('0x80')](this[_0x733d('0x10')][_0xe5122['uniqueid']]);_0x269a72[_0x733d('0x89')]=moment()['format'](_0x733d('0x77'));_0x269a72[_0x733d('0x8a')]=_0xe5122[_0x733d('0x8a')];_0x269a72['connectedlinename']=_0xe5122[_0x733d('0x8b')];logger[_0x733d('0x7b')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x269a72[_0x733d('0x51')],_0x269a72[_0x733d('0x59')],_0xe5122['connectedlinenum'],_0xe5122[_0x733d('0x8b')]);this[_0x733d('0x13')][_0xe5122[_0x733d('0x4e')]]=_0x269a72;this[_0x733d('0x4b')](_0x269a72,'queuecallerleave');}}}catch(_0x11cda8){logger[_0x733d('0x42')](_0x733d('0x88'),_0xe5122[_0x733d('0x4e')],util[_0x733d('0x44')](_0x11cda8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x733d('0xb')][_0x733d('0x25')]=function(_0x2a9e5d){try{if(this[_0x733d('0x5d')](_0x2a9e5d)){logger['debug'](_0x733d('0x8c'),_0x2a9e5d[_0x733d('0x4e')],util[_0x733d('0x44')](_0x2a9e5d,{'showHidden':![],'depth':null}));if(this[_0x733d('0x10')][_0x2a9e5d[_0x733d('0x4e')]]){var _0x1f5e7a=_[_0x733d('0x80')](this['queueReports'][_0x2a9e5d[_0x733d('0x4e')]]);_0x1f5e7a[_0x733d('0x39')]=!![];_0x1f5e7a[_0x733d('0x55')]=_0x733d('0x8d');logger[_0x733d('0x7b')](_0x733d('0x8e'),_0x1f5e7a[_0x733d('0x51')],_0x1f5e7a['type']);}}}catch(_0x38f277){logger[_0x733d('0x42')](_0x733d('0x8c'),_0x2a9e5d['uniqueid'],util[_0x733d('0x44')](_0x38f277,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x733d('0xb')][_0x733d('0x23')]=function(_0x57aa32){try{if(this['isNotNull'](_0x57aa32)){logger[_0x733d('0x4c')]('[%s][voiceQueueReport][agentcomplete]',_0x57aa32[_0x733d('0x4e')],util[_0x733d('0x44')](_0x57aa32,{'showHidden':![],'depth':null}));if(this[_0x733d('0x10')][_0x57aa32[_0x733d('0x4e')]]){var _0x4ead5e=_[_0x733d('0x80')](this[_0x733d('0x10')][_0x57aa32[_0x733d('0x4e')]]);_0x4ead5e['queuecallerabandon']=![];_0x4ead5e[_0x733d('0x84')]=null;_0x4ead5e[_0x733d('0x8f')]=!![];_0x4ead5e['lastAssignedTo']=_0x57aa32[_0x733d('0x90')];_0x4ead5e['holdtime']=_0x57aa32['holdtime'];_0x4ead5e[_0x733d('0x39')]=!![];_0x4ead5e[_0x733d('0x38')]=![];_0x4ead5e['queuecallerexitAt']=null;if(!_0x4ead5e[_0x733d('0x91')]){if(_0x57aa32[_0x733d('0x92')]==_0x733d('0x91')){_0x4ead5e[_0x733d('0x55')]=_0x733d('0x93');logger[_0x733d('0x7b')](_0x733d('0x94'),_0x4ead5e[_0x733d('0x51')],_0x4ead5e[_0x733d('0x59')]);}else{if(_[_0x733d('0x95')](_0x57aa32['channel']['toLowerCase'](),'local/')){if(this[_0x733d('0x10')][_0x57aa32[_0x733d('0x96')]]){var _0x504f88=_[_0x733d('0x80')](this['queueReports'][_0x57aa32['linkedid']]);_0x504f88['queuecallercomplete']=![];_0x504f88[_0x733d('0x38')]=!![];_0x504f88['queuecallerexitAt']=moment(_0x4ead5e[_0x733d('0x76')])[_0x733d('0x97')](_0x57aa32['holdtime'],_0x733d('0x98'))[_0x733d('0x4f')](_0x733d('0x77'));_0x504f88[_0x733d('0x55')]=_0x733d('0x99');_0x504f88['transfer']=!![];_0x504f88[_0x733d('0x9a')]='FORWARD';_0x504f88['transferexten']=_0x57aa32['destexten'];_0x504f88['transferuniqueid']=_0x57aa32[_0x733d('0x4e')];logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x504f88[_0x733d('0x51')],_0x504f88[_0x733d('0x59')]);var _0x1dda58=this[_0x733d('0x10')][_0x57aa32[_0x733d('0x96')]];this['queueReports'][_0x57aa32[_0x733d('0x96')]]=this[_0x733d('0x10')][_0x57aa32['uniqueid']];this[_0x733d('0x10')][_0x57aa32[_0x733d('0x4e')]]=_0x1dda58;}}else{_0x4ead5e[_0x733d('0x55')]='COMPLETEDBY'+_0x57aa32['reason'][_0x733d('0x9b')]();logger['info'](_0x733d('0x9c'),_0x4ead5e['queue'],_0x4ead5e['type'],_0x4ead5e[_0x733d('0x55')]);}}}this[_0x733d('0x13')][_0x57aa32[_0x733d('0x4e')]]=_0x4ead5e;}}}catch(_0x5007f7){logger['error'](_0x733d('0x9d'),_0x57aa32[_0x733d('0x4e')],util[_0x733d('0x44')](_0x5007f7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x733d('0xb')]['syncVarSet']=function(_0x66dc45){try{if(this[_0x733d('0x5d')](_0x66dc45)){logger[_0x733d('0x4c')](_0x733d('0x9e'),_0x66dc45[_0x733d('0x4e')],util[_0x733d('0x44')](_0x66dc45,{'showHidden':![],'depth':null}));this['addVariable'](_0x66dc45[_0x733d('0x4e')],_['keys'](_0x66dc45[_0x733d('0x9f')])[0x0],_0x66dc45['value']);if(this[_0x733d('0x10')][_0x66dc45[_0x733d('0x4e')]]){var _0x6d9ac0=_[_0x733d('0x80')](this[_0x733d('0x10')][_0x66dc45[_0x733d('0x4e')]]);if(_0x6d9ac0){if(this[_0x733d('0x5d')](_0x66dc45[_0x733d('0x9f')])&&this[_0x733d('0x5d')](_0x66dc45[_0x733d('0x9f')][_0x733d('0x63')])){switch(_0x66dc45[_0x733d('0xa0')]){case _0x733d('0xa1'):_0x6d9ac0['queuecallerexit']=![];_0x6d9ac0[_0x733d('0xa2')]=null;break;case'TIMEOUT':_0x6d9ac0[_0x733d('0xa3')]=_0x733d('0xa4');_0x6d9ac0[_0x733d('0x38')]=!![];_0x6d9ac0[_0x733d('0xa2')]=moment()[_0x733d('0x4f')](_0x733d('0x77'));_0x6d9ac0['queuecallerleaveAt']=moment()[_0x733d('0x4f')](_0x733d('0x77'));logger['debug'](_0x733d('0xa5'),_0x66dc45[_0x733d('0x4e')],util[_0x733d('0x44')](_0x6d9ac0,{'showHidden':![],'depth':null}));ami['emit']('custom:timeout',_0x6d9ac0);break;default:_0x6d9ac0[_0x733d('0x38')]=!![];_0x6d9ac0[_0x733d('0xa2')]=moment()[_0x733d('0x4f')](_0x733d('0x77'));_0x6d9ac0[_0x733d('0x89')]=moment()[_0x733d('0x4f')](_0x733d('0x77'));}_0x6d9ac0[_0x733d('0x1f')]=![];_0x6d9ac0[_0x733d('0x84')]=null;_0x6d9ac0['queuecallerexitreason']=_0x66dc45[_0x733d('0xa0')];this['channels'][_0x66dc45[_0x733d('0x4e')]]=_0x6d9ac0;this[_0x733d('0x49')](_0x6d9ac0,'varset');}else if(this[_0x733d('0x5d')](_0x66dc45[_0x733d('0x9f')])&&this[_0x733d('0x5d')](_0x66dc45[_0x733d('0x9f')][_0x733d('0xa6')])){if(!_0x6d9ac0[_0x733d('0x1f')]){_0x6d9ac0[_0x733d('0x38')]=!![];_0x6d9ac0[_0x733d('0xa2')]=moment()[_0x733d('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');_0x6d9ac0[_0x733d('0x55')]=_0x733d('0xa7');_0x6d9ac0[_0x733d('0x89')]=moment()['format'](_0x733d('0x77'));this[_0x733d('0x13')][_0x66dc45['uniqueid']]=_0x6d9ac0;}}logger[_0x733d('0x7b')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x66dc45['uniqueid'],_0x6d9ac0[_0x733d('0x51')],_0x6d9ac0[_0x733d('0x59')],_[_0x733d('0x7e')](_0x66dc45[_0x733d('0x9f')])[0x0],_0x66dc45[_0x733d('0xa0')]);_0x6d9ac0[_0x733d('0x17')]=this['variables'][_0x66dc45['uniqueid']];}}}}catch(_0x3910b6){logger[_0x733d('0x42')](_0x733d('0x9e'),_0x66dc45[_0x733d('0x4e')],util[_0x733d('0x44')](_0x3910b6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x733d('0xb')][_0x733d('0xa8')]=function(_0x1aa8a8,_0x11519b,_0x396748){var _0x456582=[_0x733d('0xa9'),'rtpaudioqosbridged',_0x733d('0xaa'),_0x733d('0xab'),'rtpaudioqosloss',_0x733d('0xac'),'rtpaudioqosrtt',_0x733d('0xad'),_0x733d('0xae'),_0x733d('0xaf'),_0x733d('0xb0'),'bridgepvtcallid',_0x733d('0xb1'),_0x733d('0xb2'),_0x733d('0xb3'),'memberlastcall',_0x733d('0x90'),_0x733d('0xb4'),_0x733d('0xb5')];if(!_['isNil'](_0x11519b)&&!_[_0x733d('0xb6')](_0x456582,_0x11519b)){if(_[_0x733d('0x5e')](this[_0x733d('0x17')][_0x1aa8a8])){this[_0x733d('0x17')][_0x1aa8a8]={};}this[_0x733d('0x17')][_0x1aa8a8][_0x11519b]=_0x396748;}};VoiceQueueReport[_0x733d('0xb')][_0x733d('0xb7')]=function(_0x3b6f8b,_0x261272,_0x106c3d){try{var _0x3057b4={};if(this[_0x733d('0x10')][_0x3b6f8b]){for(var _0x511038=0x0;_0x511038=0x0?moment(_0x4d495d[_0xc133('0x17')])[_0xc133('0xf')](_0x4d495d[_0xc133('0x16')],_0xc133('0x18')):null,'data1':_0xc133('0x19'),'data2':_0x4d495d['accountcode'],'data3':_0x4d495d['exten'],'data4':_0x4d495d['dialstring']||null,'role':'agent','internal':_0x4d495d[_0xc133('0x12')]?_[_0xc133('0x1a')](_0x4d495d['accountcode']):undefined,'uniqueid':_0x4d495d[_0xc133('0x13')]},'log':_0xc133('0x7')});}; \ No newline at end of file +var _0x19f6=['membername','starttime','endtime','seconds','dialstring','moment','lodash','util','queuecallercompleteAt','queuecallerexitAt','Request','voice','lastAssignedTo','interface','format','TALKING','queuecallerleaveAt','diff','inbound','calleridnum','exten','agent','accountcode','toNumber','uniqueid','CreateMemberReport','voiceDialReport'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x19f6,0x17f));var _0x619f=function(_0x3128b3,_0x4e8233){_0x3128b3=_0x3128b3-0x0;var _0x469a38=_0x19f6[_0x3128b3];return _0x469a38;};'use strict';var moment=require(_0x619f('0x0'));var _=require(_0x619f('0x1'));var util=require(_0x619f('0x2'));var client=require('../client');exports['voiceQueueReport']=function(_0x205c38){var _0x4e3df8=_0x205c38[_0x619f('0x3')]||_0x205c38[_0x619f('0x4')];return client[_0x619f('0x5')]('CreateMemberReport',{'body':{'channel':_0x619f('0x6'),'membername':_0x205c38[_0x619f('0x7')],'interface':_['isNil'](_0x205c38[_0x619f('0x8')])?util[_0x619f('0x9')]('SIP/%s',_0x205c38[_0x619f('0x7')]):_0x205c38[_0x619f('0x8')],'type':_0x619f('0xa'),'enterAt':_0x205c38[_0x619f('0xb')],'exitAt':_0x4e3df8,'duration':moment(_0x4e3df8)[_0x619f('0xc')](_0x205c38[_0x619f('0xb')],'seconds'),'data1':_0x619f('0xd'),'data2':_0x205c38[_0x619f('0xe')],'data3':_0x205c38[_0x619f('0xf')],'data4':null,'data5':_0x205c38['queue'],'role':_0x619f('0x10'),'internal':_0x205c38[_0x619f('0x11')]?_[_0x619f('0x12')](_0x205c38[_0x619f('0x11')]):undefined,'uniqueid':_0x205c38[_0x619f('0x13')]},'log':_0x619f('0x14')});};exports[_0x619f('0x15')]=function(_0x18296d){return client[_0x619f('0x5')](_0x619f('0x14'),{'body':{'channel':_0x619f('0x6'),'membername':_0x18296d[_0x619f('0x16')],'interface':_0x18296d[_0x619f('0x8')],'type':_0x619f('0xa'),'enterAt':_0x18296d[_0x619f('0x17')],'exitAt':_0x18296d[_0x619f('0x18')],'duration':moment(_0x18296d[_0x619f('0x18')])[_0x619f('0xc')](_0x18296d[_0x619f('0x17')],_0x619f('0x19'))>=0x0?moment(_0x18296d[_0x619f('0x18')])['diff'](_0x18296d[_0x619f('0x17')],'seconds'):null,'data1':'outbound','data2':_0x18296d[_0x619f('0x11')],'data3':_0x18296d[_0x619f('0xf')],'data4':_0x18296d[_0x619f('0x1a')]||null,'role':_0x619f('0x10'),'internal':_0x18296d[_0x619f('0x11')]?_[_0x619f('0x12')](_0x18296d[_0x619f('0x11')]):undefined,'uniqueid':_0x18296d[_0x619f('0x13')]},'log':'CreateMemberReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 14048f4..aa5a23c 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 _0x5cfa=['Request','../client'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x5cfa,0x12b));var _0xa5cf=function(_0x10c0e6,_0xa037a5){_0x10c0e6=_0x10c0e6-0x0;var _0x5c320a=_0x5cfa[_0x10c0e6];return _0x5c320a;};'use strict';var client=require(_0xa5cf('0x0'));exports['getSettings']=function(){return client[_0xa5cf('0x1')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer','previewRecallmeReminderInterval']},'log':'GetSettings'});}; \ No newline at end of file +var _0x2b65=['ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings','../client','getSettings','Request'];(function(_0x547e20,_0x284545){var _0x359171=function(_0x590250){while(--_0x590250){_0x547e20['push'](_0x547e20['shift']());}};_0x359171(++_0x284545);}(_0x2b65,0x131));var _0x52b6=function(_0x13eaae,_0x11ec0a){_0x13eaae=_0x13eaae-0x0;var _0x4493db=_0x2b65[_0x13eaae];return _0x4493db;};'use strict';var client=require(_0x52b6('0x0'));exports[_0x52b6('0x1')]=function(){return client[_0x52b6('0x2')](_0x52b6('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x52b6('0x4'),_0x52b6('0x5')]},'log':_0x52b6('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 4a42c99..d21ba05 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 _0x5b92=['Request','GetTemplate','name','html','../client','getTemplates'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0x5b92,0x136));var _0x25b9=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x5b92[_0x3b380d];return _0x54502b;};'use strict';var client=require(_0x25b9('0x0'));exports[_0x25b9('0x1')]=function(_0x379f8f){return function(_0x5a2a59){return client[_0x25b9('0x2')](_0x25b9('0x3'),{'options':{'raw':!![],'attributes':['id',_0x25b9('0x4'),_0x25b9('0x5')]},'log':_0x25b9('0x3')});};}; \ No newline at end of file +var _0x1ad2=['getTemplates','html','GetTemplate','../client'];(function(_0x26fb16,_0x4d40ad){var _0x1e6e90=function(_0x2dd264){while(--_0x2dd264){_0x26fb16['push'](_0x26fb16['shift']());}};_0x1e6e90(++_0x4d40ad);}(_0x1ad2,0x19b));var _0x21ad=function(_0xaf15c2,_0x3238c1){_0xaf15c2=_0xaf15c2-0x0;var _0x475398=_0x1ad2[_0xaf15c2];return _0x475398;};'use strict';var client=require(_0x21ad('0x0'));exports[_0x21ad('0x1')]=function(_0x4e0cc6){return function(_0x53e3ca){return client['Request']('GetTemplate',{'options':{'raw':!![],'attributes':['id','name',_0x21ad('0x2')]},'log':_0x21ad('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 7684197..8eda349 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 _0x0239=['data2','data3','data4','data5','data6','data7','../client','getTriggers','Request','GetTrigger','channel','Condition','field','operator','value','AnyConditions','Action','Actions','action','data1'];(function(_0x3e8955,_0x47f8f2){var _0x2acda5=function(_0x211f80){while(--_0x211f80){_0x3e8955['push'](_0x3e8955['shift']());}};_0x2acda5(++_0x47f8f2);}(_0x0239,0x7e));var _0x9023=function(_0x204e14,_0x430bda){_0x204e14=_0x204e14-0x0;var _0x218450=_0x0239[_0x204e14];return _0x218450;};'use strict';var client=require(_0x9023('0x0'));exports[_0x9023('0x1')]=function(_0x3c1906){return function(_0x2fde85){return client[_0x9023('0x2')](_0x9023('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x9023('0x4'),'status'],'include':[{'model':_0x9023('0x5'),'as':'AllConditions','attributes':['id',_0x9023('0x6'),_0x9023('0x7'),_0x9023('0x8')]},{'model':_0x9023('0x5'),'as':_0x9023('0x9'),'attributes':['id','field',_0x9023('0x7'),_0x9023('0x8')]},{'model':_0x9023('0xa'),'as':_0x9023('0xb'),'attributes':['id',_0x9023('0xc'),_0x9023('0xd'),_0x9023('0xe'),_0x9023('0xf'),_0x9023('0x10'),_0x9023('0x11'),_0x9023('0x12'),_0x9023('0x13')]}]},'log':_0x9023('0x3')});};}; \ No newline at end of file +var _0x64e3=['data3','data5','data6','data7','GetTrigger','../client','getTriggers','Request','name','Condition','AllConditions','field','value','AnyConditions','operator','data1','data2'];(function(_0x1de837,_0x225e84){var _0x46a186=function(_0xdbca57){while(--_0xdbca57){_0x1de837['push'](_0x1de837['shift']());}};_0x46a186(++_0x225e84);}(_0x64e3,0x17b));var _0x364e=function(_0x5de1bc,_0x434be1){_0x5de1bc=_0x5de1bc-0x0;var _0x19f4b8=_0x64e3[_0x5de1bc];return _0x19f4b8;};'use strict';var client=require(_0x364e('0x0'));exports[_0x364e('0x1')]=function(_0x22d7d0){return function(_0x14372a){return client[_0x364e('0x2')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0x364e('0x3'),'channel','status'],'include':[{'model':_0x364e('0x4'),'as':_0x364e('0x5'),'attributes':['id',_0x364e('0x6'),'operator',_0x364e('0x7')]},{'model':_0x364e('0x4'),'as':_0x364e('0x8'),'attributes':['id',_0x364e('0x6'),_0x364e('0x9'),'value']},{'model':'Action','as':'Actions','attributes':['id','action',_0x364e('0xa'),_0x364e('0xb'),_0x364e('0xc'),'data4',_0x364e('0xd'),_0x364e('0xe'),_0x364e('0xf')]}]},'log':_0x364e('0x10')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 4c9cc53..b0d13c3 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 _0xea44=['defaultuser','../client','getTrunks','GetTrunk','name'];(function(_0x3c9705,_0x18ae9c){var _0x110709=function(_0x48d777){while(--_0x48d777){_0x3c9705['push'](_0x3c9705['shift']());}};_0x110709(++_0x18ae9c);}(_0xea44,0x1a5));var _0x4ea4=function(_0x37dd7e,_0x30379f){_0x37dd7e=_0x37dd7e-0x0;var _0x3bc6c6=_0xea44[_0x37dd7e];return _0x3bc6c6;};'use strict';var client=require(_0x4ea4('0x0'));exports[_0x4ea4('0x1')]=function(_0x3e97d9){return function(_0x3a0154){return client['Request'](_0x4ea4('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x4ea4('0x3'),'registry',_0x4ea4('0x4')]},'log':_0x4ea4('0x2')});};}; \ No newline at end of file +var _0xbfc0=['getTrunks','Request','GetTrunk','name','registry','../client'];(function(_0x3eeb13,_0x33d336){var _0x250f63=function(_0x3e0e9b){while(--_0x3e0e9b){_0x3eeb13['push'](_0x3eeb13['shift']());}};_0x250f63(++_0x33d336);}(_0xbfc0,0x125));var _0x0bfc=function(_0x564e9f,_0x225a15){_0x564e9f=_0x564e9f-0x0;var _0x3a9f3e=_0xbfc0[_0x564e9f];return _0x3a9f3e;};'use strict';var client=require(_0x0bfc('0x0'));exports[_0x0bfc('0x1')]=function(_0x1549a0){return function(_0x44ffdf){return client[_0x0bfc('0x2')](_0x0bfc('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x0bfc('0x4'),_0x0bfc('0x5'),'defaultuser']},'log':_0x0bfc('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 53b6e87..2d34b23 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 _0x34e8=['../client','getAgents','Request','GetUser','name','email','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','mobile','interface','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser','agent','lastPauseAt'];(function(_0x1e9d5e,_0x15ebdb){var _0x42f4f2=function(_0x1d7faa){while(--_0x1d7faa){_0x1e9d5e['push'](_0x1e9d5e['shift']());}};_0x42f4f2(++_0x15ebdb);}(_0x34e8,0x12c));var _0x834e=function(_0x1ea6b5,_0x3ba862){_0x1ea6b5=_0x1ea6b5-0x0;var _0x2a63da=_0x34e8[_0x1ea6b5];return _0x2a63da;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(){return function(){return client[_0x834e('0x2')](_0x834e('0x3'),{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6'),_0x834e('0x7'),_0x834e('0x8'),_0x834e('0x9'),_0x834e('0xa'),'lastPauseAt',_0x834e('0xb'),'phone',_0x834e('0xc'),_0x834e('0xd')]},'log':_0x834e('0x1')});};};exports[_0x834e('0xe')]=function(){return function(){return client[_0x834e('0x2')](_0x834e('0x3'),{'options':{'raw':!![],'where':{'role':_0x834e('0xf')},'attributes':['id',_0x834e('0x4'),_0x834e('0x6'),_0x834e('0x10')]},'log':_0x834e('0xe')});};};exports[_0x834e('0x11')]=function(_0x14038b,_0x2e1a37,_0x293514){return client[_0x834e('0x2')](_0x834e('0x12'),{'body':{'type':_0x2e1a37,'uniqueid':_0x293514},'options':{'where':{'id':_0x14038b['id']}},'log':'savePause'});};exports[_0x834e('0x13')]=function(_0x6cd9b9){return client['Request'](_0x834e('0x14'),{'body':{},'options':{'where':{'id':_0x6cd9b9['id']}},'log':_0x834e('0x11')});};exports[_0x834e('0x15')]=function(_0x21cc0a){return client['Request'](_0x834e('0x16'),{'options':{'raw':![],'where':{'role':_0x834e('0x17'),'id':_0x21cc0a},'attributes':['id','name',_0x834e('0x5'),'accountcode',_0x834e('0x7'),_0x834e('0x8'),'lastLoginAt',_0x834e('0xa'),_0x834e('0x18'),_0x834e('0xb'),'interface']},'log':_0x834e('0x15')});}; \ No newline at end of file +var _0x70e0=['getAgents','Request','name','email','accountcode','fullname','lastLoginAt','lastPauseAt','interface','getTelephones','GetUser','telephone','savePause','PauseUser','saveUnpause','getAgent','agent','online','pauseType','../client'];(function(_0x2d1a72,_0x299152){var _0x581cb0=function(_0x493c9b){while(--_0x493c9b){_0x2d1a72['push'](_0x2d1a72['shift']());}};_0x581cb0(++_0x299152);}(_0x70e0,0x17b));var _0x070e=function(_0x12dbbc,_0x3b730e){_0x12dbbc=_0x12dbbc-0x0;var _0x21e8f1=_0x70e0[_0x12dbbc];return _0x21e8f1;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5'),_0x070e('0x6'),'online',_0x070e('0x7'),'pauseType',_0x070e('0x8'),'voicePause','phone','mobile',_0x070e('0x9')]},'log':_0x070e('0x1')});};};exports[_0x070e('0xa')]=function(){return function(){return client[_0x070e('0x2')](_0x070e('0xb'),{'options':{'raw':!![],'where':{'role':_0x070e('0xc')},'attributes':['id',_0x070e('0x3'),'accountcode','internal']},'log':_0x070e('0xa')});};};exports[_0x070e('0xd')]=function(_0x12bb37,_0xb8d819,_0xa927a2){return client[_0x070e('0x2')](_0x070e('0xe'),{'body':{'type':_0xb8d819,'uniqueid':_0xa927a2},'options':{'where':{'id':_0x12bb37['id']}},'log':_0x070e('0xd')});};exports[_0x070e('0xf')]=function(_0x5bf079){return client[_0x070e('0x2')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5bf079['id']}},'log':'savePause'});};exports[_0x070e('0x10')]=function(_0x56c7ba){return client['Request']('ShowUser',{'options':{'raw':![],'where':{'role':_0x070e('0x11'),'id':_0x56c7ba},'attributes':['id',_0x070e('0x3'),'email','accountcode',_0x070e('0x6'),_0x070e('0x12'),_0x070e('0x7'),_0x070e('0x13'),'lastPauseAt','voicePause',_0x070e('0x9')]},'log':_0x070e('0x10')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 426230a..1cb4c47 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 _0xe720=['CreateVoiceAgentReport','update','UpdateVoiceAgentReport','create','Request'];(function(_0x21f931,_0x598b2d){var _0x3f083c=function(_0x1c7c49){while(--_0x1c7c49){_0x21f931['push'](_0x21f931['shift']());}};_0x3f083c(++_0x598b2d);}(_0xe720,0x17a));var _0x0e72=function(_0x8c15,_0x32066d){_0x8c15=_0x8c15-0x0;var _0x3373b4=_0xe720[_0x8c15];return _0x3373b4;};'use strict';var client=require('../client');exports[_0x0e72('0x0')]=function(_0xd24b69){return client[_0x0e72('0x1')](_0x0e72('0x2'),{'body':_0xd24b69,'log':'CreateVoiceAgentReport'});};exports[_0x0e72('0x3')]=function(_0x276268,_0x52ab6a,_0x7f3c31){return client['Request'](_0x0e72('0x4'),{'body':_0x276268,'options':{'where':{'uniqueid':_0x52ab6a,'interface':_0x7f3c31,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file +var _0x6c43=['UpdateVoiceAgentReport','../client','Request','CreateVoiceAgentReport','update'];(function(_0x5db339,_0x21b8fe){var _0x2370e8=function(_0x4d8cfd){while(--_0x4d8cfd){_0x5db339['push'](_0x5db339['shift']());}};_0x2370e8(++_0x21b8fe);}(_0x6c43,0x1c3));var _0x36c4=function(_0x5bc27a,_0x32e2d1){_0x5bc27a=_0x5bc27a-0x0;var _0x2c8a4d=_0x6c43[_0x5bc27a];return _0x2c8a4d;};'use strict';var client=require(_0x36c4('0x0'));exports['create']=function(_0x5d315f){return client[_0x36c4('0x1')](_0x36c4('0x2'),{'body':_0x5d315f,'log':_0x36c4('0x2')});};exports[_0x36c4('0x3')]=function(_0x15d906,_0x318b23,_0x2cb99e){return client[_0x36c4('0x1')]('UpdateVoiceAgentReport',{'body':_0x15d906,'options':{'where':{'uniqueid':_0x318b23,'interface':_0x2cb99e,'agentcomplete':!![]}},'log':_0x36c4('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 701a3d7..08dd7fa 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 _0x1394=['merge','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','disposition','duration','billableseconds','GetVoiceCallReports','moment','util','../client','create','Request','CreateVoiceCallReport'];(function(_0xb7ce31,_0x13168d){var _0x3101c4=function(_0x4a8427){while(--_0x4a8427){_0xb7ce31['push'](_0xb7ce31['shift']());}};_0x3101c4(++_0x13168d);}(_0x1394,0x170));var _0x4139=function(_0x5d6704,_0x599319){_0x5d6704=_0x5d6704-0x0;var _0x416fd9=_0x1394[_0x5d6704];return _0x416fd9;};'use strict';var moment=require(_0x4139('0x0'));var util=require(_0x4139('0x1'));var _=require('lodash');var client=require(_0x4139('0x2'));exports[_0x4139('0x3')]=function(_0x1945df){return client[_0x4139('0x4')](_0x4139('0x5'),{'body':_[_0x4139('0x6')](_0x1945df,{'source':_0x1945df[_0x4139('0x7')],'destinationcontext':_0x1945df[_0x4139('0x8')],'callerid':_0x1945df[_0x4139('0x9')],'amaflags':_0x4139('0xa')}),'log':_0x4139('0x5')});};exports[_0x4139('0xb')]=function(){return function(){return client[_0x4139('0x4')](_0x4139('0xc'),{'options':{'where':{'type':[_0x4139('0xd')],'createdAt':{'$between':[moment()[_0x4139('0xe')](_0x4139('0xf'))[_0x4139('0x10')](_0x4139('0x11')),moment()['endOf'](_0x4139('0xf'))[_0x4139('0x10')](_0x4139('0x11'))]}},'attributes':['type',_0x4139('0x12'),_0x4139('0x13'),_0x4139('0x14')]},'log':_0x4139('0x15')});};}; \ No newline at end of file +var _0xb2fc=['getVoiceCallReports','startOf','format','YYYY-MM-DD\x20HH:mm:ss','type','disposition','duration','billableseconds','GetVoiceCallReports','moment','util','lodash','create','Request','CreateVoiceCallReport','merge','calleridnum','context','DOCUMENTATION'];(function(_0x2269c9,_0x25b537){var _0x2a60fe=function(_0x5df817){while(--_0x5df817){_0x2269c9['push'](_0x2269c9['shift']());}};_0x2a60fe(++_0x25b537);}(_0xb2fc,0x1d1));var _0xcb2f=function(_0x46c187,_0x5185f8){_0x46c187=_0x46c187-0x0;var _0x5d93ff=_0xb2fc[_0x46c187];return _0x5d93ff;};'use strict';var moment=require(_0xcb2f('0x0'));var util=require(_0xcb2f('0x1'));var _=require(_0xcb2f('0x2'));var client=require('../client');exports[_0xcb2f('0x3')]=function(_0x561495){return client[_0xcb2f('0x4')](_0xcb2f('0x5'),{'body':_[_0xcb2f('0x6')](_0x561495,{'source':_0x561495[_0xcb2f('0x7')],'destinationcontext':_0x561495[_0xcb2f('0x8')],'callerid':_0x561495['callerid'],'amaflags':_0xcb2f('0x9')}),'log':_0xcb2f('0x5')});};exports[_0xcb2f('0xa')]=function(){return function(){return client[_0xcb2f('0x4')]('GetVoiceCallReport',{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0xcb2f('0xb')]('day')[_0xcb2f('0xc')]('YYYY-MM-DD\x20HH:mm:ss'),moment()['endOf']('day')[_0xcb2f('0xc')](_0xcb2f('0xd'))]}},'attributes':[_0xcb2f('0xe'),_0xcb2f('0xf'),_0xcb2f('0x10'),_0xcb2f('0x11')]},'log':_0xcb2f('0x12')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 47e8334..0c86965 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 _0x6892=['create','Request','CreateVoiceDialReport'];(function(_0x476474,_0x5ba635){var _0x4ba929=function(_0x5b129b){while(--_0x5b129b){_0x476474['push'](_0x476474['shift']());}};_0x4ba929(++_0x5ba635);}(_0x6892,0x1da));var _0x2689=function(_0x5c49fc,_0xe189b5){_0x5c49fc=_0x5c49fc-0x0;var _0x5532fe=_0x6892[_0x5c49fc];return _0x5532fe;};'use strict';var client=require('../client');exports[_0x2689('0x0')]=function(_0x3aa21c){return client[_0x2689('0x1')](_0x2689('0x2'),{'body':_0x3aa21c,'log':_0x2689('0x2')});}; \ No newline at end of file +var _0xfa08=['../client','CreateVoiceDialReport'];(function(_0x147b94,_0x59d886){var _0x2f2b62=function(_0x321aae){while(--_0x321aae){_0x147b94['push'](_0x147b94['shift']());}};_0x2f2b62(++_0x59d886);}(_0xfa08,0x15c));var _0x8fa0=function(_0x4e82cc,_0x59b42b){_0x4e82cc=_0x4e82cc-0x0;var _0x53fa3f=_0xfa08[_0x4e82cc];return _0x53fa3f;};'use strict';var client=require(_0x8fa0('0x0'));exports['create']=function(_0x5d44c6){return client['Request'](_0x8fa0('0x1'),{'body':_0x5d44c6,'log':_0x8fa0('0x1')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 136e53d..0787cda 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 _0xe5b5=['getVoiceExtensions','Request','GetVoiceExtension','exten','recordingFormat','../client'];(function(_0x4aa1e9,_0x3cafa2){var _0x5e9306=function(_0x10c491){while(--_0x10c491){_0x4aa1e9['push'](_0x4aa1e9['shift']());}};_0x5e9306(++_0x3cafa2);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x21353c,_0x2ea587){_0x21353c=_0x21353c-0x0;var _0xa99120=_0xe5b5[_0x21353c];return _0xa99120;};'use strict';var client=require(_0x5e5b('0x0'));exports[_0x5e5b('0x1')]=function(){return function(){return client[_0x5e5b('0x2')](_0x5e5b('0x3'),{'options':{'raw':!![],'attributes':['id',_0x5e5b('0x4'),_0x5e5b('0x5')],'where':{'VoiceExtensionId':null}},'log':_0x5e5b('0x1')});};}; \ No newline at end of file +var _0x26c2=['GetVoiceExtension','exten','recordingFormat','getVoiceExtensions'];(function(_0x7d62cb,_0x7622c){var _0x3a6266=function(_0x1cc5fa){while(--_0x1cc5fa){_0x7d62cb['push'](_0x7d62cb['shift']());}};_0x3a6266(++_0x7622c);}(_0x26c2,0x130));var _0x226c=function(_0x3699f5,_0x2095ba){_0x3699f5=_0x3699f5-0x0;var _0x19ecfc=_0x26c2[_0x3699f5];return _0x19ecfc;};'use strict';var client=require('../client');exports['getVoiceExtensions']=function(){return function(){return client['Request'](_0x226c('0x0'),{'options':{'raw':!![],'attributes':['id',_0x226c('0x1'),_0x226c('0x2')],'where':{'VoiceExtensionId':null}},'log':_0x226c('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 04eb095..5990f34 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 _0xb3b7=['dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','active','mandatoryDispositionPause','name','TrunkBackup','callerid','Interval','Intervals','interval','getVoiceQueues','Request','GetVoiceQueue','acw','acwTimeout','autopause','monitor_format','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry'];(function(_0x20efe6,_0x2d6285){var _0x2680c2=function(_0x1c969b){while(--_0x1c969b){_0x20efe6['push'](_0x20efe6['shift']());}};_0x2680c2(++_0x2d6285);}(_0xb3b7,0x16a));var _0x7b3b=function(_0x465e9a,_0xd308b3){_0x465e9a=_0x465e9a-0x0;var _0x5b1da1=_0xb3b7[_0x465e9a];return _0x5b1da1;};'use strict';var client=require('../client');exports[_0x7b3b('0x0')]=function(){return function(){return client[_0x7b3b('0x1')](_0x7b3b('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x7b3b('0x3'),_0x7b3b('0x4'),_0x7b3b('0x5'),_0x7b3b('0x6'),'type',_0x7b3b('0x7'),_0x7b3b('0x8'),_0x7b3b('0x9'),_0x7b3b('0xa'),_0x7b3b('0xb'),'dialPredictiveOptimization',_0x7b3b('0xc'),_0x7b3b('0xd'),_0x7b3b('0xe'),_0x7b3b('0xf'),_0x7b3b('0x10'),_0x7b3b('0x11'),_0x7b3b('0x12'),_0x7b3b('0x13'),'dialCongestionMaxRetry',_0x7b3b('0x14'),_0x7b3b('0x15'),_0x7b3b('0x16'),_0x7b3b('0x17'),'dialNoAnswerRetryFrequency',_0x7b3b('0x18'),'dialTimezone',_0x7b3b('0x19'),_0x7b3b('0x1a'),_0x7b3b('0x1b'),_0x7b3b('0x1c'),_0x7b3b('0x1d'),'dialAMDGreeting','dialAMDAfterGreetingSilence',_0x7b3b('0x1e'),'dialAMDMinWordLength',_0x7b3b('0x1f'),'dialAMDMaximumNumberOfWords',_0x7b3b('0x20'),_0x7b3b('0x21'),_0x7b3b('0x22'),_0x7b3b('0x23'),_0x7b3b('0x24'),_0x7b3b('0x25'),_0x7b3b('0x26'),_0x7b3b('0x27'),_0x7b3b('0x28'),_0x7b3b('0x6'),_0x7b3b('0x29'),_0x7b3b('0x2a'),_0x7b3b('0x2b'),_0x7b3b('0x2c'),_0x7b3b('0x2d'),'dialDropMaxRetry',_0x7b3b('0x2e'),_0x7b3b('0x2f'),'dialAbandonedRetryFrequency',_0x7b3b('0x30'),'dialMachineRetryFrequency',_0x7b3b('0x31'),_0x7b3b('0x32'),'mandatoryDisposition',_0x7b3b('0x33'),_0x7b3b('0x34'),_0x7b3b('0x35'),_0x7b3b('0x36')],'include':[{'model':'Trunk','as':_0x7b3b('0x37'),'attributes':['id','name','callerid',_0x7b3b('0x38')]},{'model':'Pause','as':_0x7b3b('0x39'),'attributes':['id',_0x7b3b('0x3a')]},{'model':_0x7b3b('0x37'),'as':_0x7b3b('0x3b'),'attributes':['id',_0x7b3b('0x3a'),_0x7b3b('0x3c'),_0x7b3b('0x38')]},{'model':_0x7b3b('0x3d'),'as':_0x7b3b('0x3d'),'attributes':['id','name'],'include':[{'model':_0x7b3b('0x3d'),'as':_0x7b3b('0x3e'),'attributes':['id','name',_0x7b3b('0x3f')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file +var _0x96f2=['dialOriginateCallerIdNumber','dialQueueOptions','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','Trunk','callerid','TrunkBackup','active','Interval','Intervals','interval','../client','getVoiceQueues','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type','dialMethod','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x96f2,0x195));var _0x296f=function(_0x41ff4b,_0x10bc07){_0x41ff4b=_0x41ff4b-0x0;var _0x59db9d=_0x96f2[_0x41ff4b];return _0x59db9d;};'use strict';var client=require(_0x296f('0x0'));exports[_0x296f('0x1')]=function(){return function(){return client['Request'](_0x296f('0x2'),{'options':{'raw':![],'attributes':['id',_0x296f('0x3'),_0x296f('0x4'),_0x296f('0x5'),_0x296f('0x6'),_0x296f('0x7'),_0x296f('0x8'),'dialActive',_0x296f('0x9'),_0x296f('0xa'),_0x296f('0xb'),'dialPowerLevel',_0x296f('0xc'),_0x296f('0xd'),_0x296f('0xe'),'dialOriginateCallerIdName',_0x296f('0xf'),'dialOriginateTimeout',_0x296f('0x10'),'dialQueueTimeout',_0x296f('0x11'),'dialCongestionMaxRetry',_0x296f('0x12'),_0x296f('0x13'),_0x296f('0x14'),_0x296f('0x15'),'dialNoAnswerRetryFrequency',_0x296f('0x16'),_0x296f('0x17'),_0x296f('0x18'),_0x296f('0x19'),_0x296f('0x1a'),_0x296f('0x1b'),_0x296f('0x1c'),_0x296f('0x1d'),_0x296f('0x1e'),_0x296f('0x1f'),'dialAMDMinWordLength',_0x296f('0x20'),_0x296f('0x21'),_0x296f('0x22'),_0x296f('0x23'),'timeout',_0x296f('0x24'),_0x296f('0x25'),_0x296f('0x26'),'dialAgiAfterHangupAgent',_0x296f('0x27'),_0x296f('0x28'),_0x296f('0x7'),_0x296f('0x29'),'dialRandomLastDigitCallerIdNumber','dialCutDigit',_0x296f('0x2a'),'dialNoSuchNumberRetryFrequency',_0x296f('0x2b'),_0x296f('0x2c'),_0x296f('0x2d'),_0x296f('0x2e'),_0x296f('0x2f'),_0x296f('0x30'),'dialAgentRejectMaxRetry',_0x296f('0x31'),_0x296f('0x32'),'dialPredictiveIntervalMaxThreshold',_0x296f('0x33'),_0x296f('0x34'),'dialPreviewRecallmeReminder'],'include':[{'model':'Trunk','as':_0x296f('0x35'),'attributes':['id',_0x296f('0x3'),_0x296f('0x36'),'active']},{'model':'Pause','as':'mandatoryDispositionPause','attributes':['id',_0x296f('0x3')]},{'model':_0x296f('0x35'),'as':_0x296f('0x37'),'attributes':['id','name',_0x296f('0x36'),_0x296f('0x38')]},{'model':_0x296f('0x39'),'as':_0x296f('0x39'),'attributes':['id',_0x296f('0x3')],'include':[{'model':_0x296f('0x39'),'as':_0x296f('0x3a'),'attributes':['id','name',_0x296f('0x3b')]}]}]},'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 fea514d..4c63620 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(_0x6cbee,_0x55a318){var _0x4218ec=function(_0x179d74){while(--_0x179d74){_0x6cbee['push'](_0x6cbee['shift']());}};_0x4218ec(++_0x55a318);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'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(_0x2b7734,_0x400c9e){var _0x111328=function(_0x114cb4){while(--_0x114cb4){_0x2b7734['push'](_0x2b7734['shift']());}};_0x111328(++_0x400c9e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'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 235b181..acd8397 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 _0xbdfc=['Request','GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses'];(function(_0x189b2d,_0x2f8a9c){var _0x478dba=function(_0x2f966d){while(--_0x2f966d){_0x189b2d['push'](_0x189b2d['shift']());}};_0x478dba(++_0x2f8a9c);}(_0xbdfc,0xa6));var _0xcbdf=function(_0x3a7767,_0x3ada12){_0x3a7767=_0x3a7767-0x0;var _0x3e2724=_0xbdfc[_0x3a7767];return _0x3e2724;};'use strict';var client=require(_0xcbdf('0x0'));exports[_0xcbdf('0x1')]=function(_0x313017){return function(){return client[_0xcbdf('0x2')](_0xcbdf('0x3'),{'options':{'where':{'VoiceQueueId':_0x313017,'paused':!![]},'raw':!![]},'log':_0xcbdf('0x1')});};}; \ No newline at end of file +var _0xb4e3=['GetVoiceQueueRtPauses','getVoiceQueueRtPauses','Request'];(function(_0x112f04,_0x53cf9a){var _0x30ffaf=function(_0x32a95a){while(--_0x32a95a){_0x112f04['push'](_0x112f04['shift']());}};_0x30ffaf(++_0x53cf9a);}(_0xb4e3,0xd9));var _0x3b4e=function(_0x2f71f6,_0x3a1f4d){_0x2f71f6=_0x2f71f6-0x0;var _0x2b23ea=_0xb4e3[_0x2f71f6];return _0x2b23ea;};'use strict';var client=require('../client');exports[_0x3b4e('0x0')]=function(_0x576ba3){return function(){return client[_0x3b4e('0x1')](_0x3b4e('0x2'),{'options':{'where':{'VoiceQueueId':_0x576ba3,'paused':!![]},'raw':!![]},'log':_0x3b4e('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 1dfe1bf..58e5ac9 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 _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x1f0674,_0x583186){var _0x316f5a=function(_0x4e52b6){while(--_0x4e52b6){_0x1f0674['push'](_0x1f0674['shift']());}};_0x316f5a(++_0x583186);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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 +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x2dd8e4,_0x12592d){var _0x2904cd=function(_0x58e626){while(--_0x58e626){_0x2dd8e4['push'](_0x2dd8e4['shift']());}};_0x2904cd(++_0x12592d);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'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 8758e29..5cdbe2c 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 _0x3578=['transfereeconnectedlinename','transfereeaccountcode','transfereelinkedid','isexternal','context','extension','blind','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','origtransfererexten','attended','../client','blindTransfer','Request','CreateVoiceTransferReport','result','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transferercontext','transfererexten','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum'];(function(_0x45aa91,_0x4fbb10){var _0x186ac1=function(_0xb2619b){while(--_0xb2619b){_0x45aa91['push'](_0x45aa91['shift']());}};_0x186ac1(++_0x4fbb10);}(_0x3578,0x189));var _0x8357=function(_0x4c9cb5,_0xcf85d4){_0x4c9cb5=_0x4c9cb5-0x0;var _0x20310b=_0x3578[_0x4c9cb5];return _0x20310b;};'use strict';var client=require(_0x8357('0x0'));exports['transfers']={};exports[_0x8357('0x1')]=function(_0x5a9f55){return client[_0x8357('0x2')](_0x8357('0x3'),{'body':{'result':_0x5a9f55[_0x8357('0x4')],'transfererchannel':_0x5a9f55['transfererchannel'],'transferercalleridnum':_0x5a9f55['transferercalleridnum'],'transferercalleridname':_0x5a9f55[_0x8357('0x5')],'transfererconnectedlinenum':_0x5a9f55[_0x8357('0x6')],'transfererconnectedlinename':_0x5a9f55[_0x8357('0x7')],'transfereraccountcode':_0x5a9f55['transfereraccountcode'],'transferercontext':_0x5a9f55[_0x8357('0x8')],'transfererexten':_0x5a9f55[_0x8357('0x9')],'transfererlinkedid':_0x5a9f55['transfererlinkedid'],'transfereechannel':_0x5a9f55[_0x8357('0xa')],'transfereecalleridnum':_0x5a9f55[_0x8357('0xb')],'transfereecalleridname':_0x5a9f55[_0x8357('0xc')],'transfereeconnectedlinenum':_0x5a9f55[_0x8357('0xd')],'transfereeconnectedlinename':_0x5a9f55[_0x8357('0xe')],'transfereeaccountcode':_0x5a9f55[_0x8357('0xf')],'transfereecontext':_0x5a9f55['transfereecontext'],'transfereeexten':_0x5a9f55['transfereeexten'],'transfereelinkedid':_0x5a9f55[_0x8357('0x10')],'isexternal':_0x5a9f55[_0x8357('0x11')],'context':_0x5a9f55[_0x8357('0x12')],'extension':_0x5a9f55[_0x8357('0x13')],'type':_0x8357('0x14')},'log':_0x8357('0x3')});};exports['attendedTransfer']=function(_0x279977){return client[_0x8357('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x279977[_0x8357('0x4')],'transfererchannel':_0x279977[_0x8357('0x15')],'transferercalleridnum':_0x279977[_0x8357('0x16')],'transferercalleridname':_0x279977[_0x8357('0x17')],'transfererconnectedlinenum':_0x279977['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x279977[_0x8357('0x18')],'transfereraccountcode':_0x279977[_0x8357('0x19')],'transferercontext':_0x279977['secondtransferercontext'],'transfererexten':_0x279977[_0x8357('0x1a')],'transfererlinkedid':_0x279977[_0x8357('0x1b')],'transfereechannel':_0x279977[_0x8357('0x1c')],'transfereecalleridnum':_0x279977['transfertargetcalleridnum'],'transfereecalleridname':_0x279977[_0x8357('0x1d')],'transfereeconnectedlinenum':_0x279977[_0x8357('0x1e')],'transfereeconnectedlinename':_0x279977[_0x8357('0x1f')],'transfereeaccountcode':_0x279977[_0x8357('0x20')],'transfereecontext':_0x279977[_0x8357('0x21')],'transfereeexten':_0x279977['transfertargetexten'],'transfereelinkedid':_0x279977[_0x8357('0x22')],'isexternal':_0x279977['isexternal'],'context':_0x279977['origtransferercontext'],'extension':_0x279977[_0x8357('0x23')],'type':_0x8357('0x24')},'log':_0x8357('0x3')});}; \ No newline at end of file +var _0xbaae=['transfererconnectedlinename','transfereraccountcode','transferercontext','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereecontext','isexternal','context','extension','blind','CreateVoiceTransferReport','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','../client','transfers','blindTransfer','Request','result','transferercalleridname'];(function(_0x4bbf69,_0x117750){var _0x30152c=function(_0x4e004e){while(--_0x4e004e){_0x4bbf69['push'](_0x4bbf69['shift']());}};_0x30152c(++_0x117750);}(_0xbaae,0x16c));var _0xebaa=function(_0x222967,_0x399bf3){_0x222967=_0x222967-0x0;var _0x44fc55=_0xbaae[_0x222967];return _0x44fc55;};'use strict';var client=require(_0xebaa('0x0'));exports[_0xebaa('0x1')]={};exports[_0xebaa('0x2')]=function(_0x2f1c7e){return client[_0xebaa('0x3')]('CreateVoiceTransferReport',{'body':{'result':_0x2f1c7e[_0xebaa('0x4')],'transfererchannel':_0x2f1c7e['transfererchannel'],'transferercalleridnum':_0x2f1c7e['transferercalleridnum'],'transferercalleridname':_0x2f1c7e[_0xebaa('0x5')],'transfererconnectedlinenum':_0x2f1c7e['transfererconnectedlinenum'],'transfererconnectedlinename':_0x2f1c7e[_0xebaa('0x6')],'transfereraccountcode':_0x2f1c7e[_0xebaa('0x7')],'transferercontext':_0x2f1c7e[_0xebaa('0x8')],'transfererexten':_0x2f1c7e['transfererexten'],'transfererlinkedid':_0x2f1c7e[_0xebaa('0x9')],'transfereechannel':_0x2f1c7e[_0xebaa('0xa')],'transfereecalleridnum':_0x2f1c7e[_0xebaa('0xb')],'transfereecalleridname':_0x2f1c7e[_0xebaa('0xc')],'transfereeconnectedlinenum':_0x2f1c7e['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x2f1c7e['transfereeconnectedlinename'],'transfereeaccountcode':_0x2f1c7e['transfereeaccountcode'],'transfereecontext':_0x2f1c7e[_0xebaa('0xd')],'transfereeexten':_0x2f1c7e['transfereeexten'],'transfereelinkedid':_0x2f1c7e['transfereelinkedid'],'isexternal':_0x2f1c7e[_0xebaa('0xe')],'context':_0x2f1c7e[_0xebaa('0xf')],'extension':_0x2f1c7e[_0xebaa('0x10')],'type':_0xebaa('0x11')},'log':_0xebaa('0x12')});};exports[_0xebaa('0x13')]=function(_0xc3976c){return client[_0xebaa('0x3')](_0xebaa('0x12'),{'body':{'result':_0xc3976c[_0xebaa('0x4')],'transfererchannel':_0xc3976c[_0xebaa('0x14')],'transferercalleridnum':_0xc3976c[_0xebaa('0x15')],'transferercalleridname':_0xc3976c[_0xebaa('0x16')],'transfererconnectedlinenum':_0xc3976c[_0xebaa('0x17')],'transfererconnectedlinename':_0xc3976c[_0xebaa('0x18')],'transfereraccountcode':_0xc3976c[_0xebaa('0x19')],'transferercontext':_0xc3976c['secondtransferercontext'],'transfererexten':_0xc3976c['secondtransfererexten'],'transfererlinkedid':_0xc3976c[_0xebaa('0x1a')],'transfereechannel':_0xc3976c[_0xebaa('0x1b')],'transfereecalleridnum':_0xc3976c[_0xebaa('0x1c')],'transfereecalleridname':_0xc3976c[_0xebaa('0x1d')],'transfereeconnectedlinenum':_0xc3976c[_0xebaa('0x1e')],'transfereeconnectedlinename':_0xc3976c['transfertargetconnectedlinename'],'transfereeaccountcode':_0xc3976c[_0xebaa('0x1f')],'transfereecontext':_0xc3976c[_0xebaa('0x20')],'transfereeexten':_0xc3976c[_0xebaa('0x21')],'transfereelinkedid':_0xc3976c[_0xebaa('0x22')],'isexternal':_0xc3976c['isexternal'],'context':_0xc3976c[_0xebaa('0x23')],'extension':_0xc3976c[_0xebaa('0x24')],'type':'attended'},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 1105195..b49a77a 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 _0x7a54=['http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','moment','../../../config/environment','../ami','../model/voiceQueueSummary','listen','name','timers','updateAcw','agents','updateStatusRealtime','voiceStatus','pause','isConnected','error','asterisk','ami\x20disconnected','join','pick','keys','reload','Reload','message','catch','username','command','action','Command','then','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','channels','validate','map','uniqueid','channel','format','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','isNil','toLowerCase','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','Action','StopMixMonitor','destinationchannel','stop','filename','queueChannels','type','outbound','includes','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','run','custom:','event','faxAccounts','send'];(function(_0x46611d,_0xbfc25d){var _0x25ffc8=function(_0x33bdb7){while(--_0x33bdb7){_0x46611d['push'](_0x46611d['shift']());}};_0x25ffc8(++_0xbfc25d);}(_0x7a54,0x106));var _0x47a5=function(_0x39379f,_0x18e9d8){_0x39379f=_0x39379f-0x0;var _0x4b8a0d=_0x7a54[_0x39379f];return _0x4b8a0d;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var jayson=require(_0x47a5('0x2'));var schema=require('validate');var moment=require(_0x47a5('0x3'));var config=require(_0x47a5('0x4'));var properties=require('../properties');var ami=require(_0x47a5('0x5'));var VoiceQueueSummary=require(_0x47a5('0x6'));exports[_0x47a5('0x7')]=function(_0x3717e1,_0xfdf934,_0x545a97){return new Promise(function(_0x3d5629,_0x59199c){var _0x343372={'QueuePause':function(_0x30e405){return new Promise(function(_0x506eda){var _0x194fb0=util['format']('%s/%s','SIP',_0x30e405[_0x47a5('0x8')]);if(_0x3717e1[_0x47a5('0x9')]&&_0x3717e1['timers'][_0x194fb0]&&_0x3717e1[_0x47a5('0x9')][_0x194fb0]['timer']){_0x3717e1['timers'][_0x194fb0][_0x47a5('0xa')]();}if(_0x3717e1[_0x47a5('0xb')][_0x194fb0]){_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xc')]({'state':_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xd')],'statePause':_0x30e405[_0x47a5('0xe')]?!![]:![]});}_0x506eda({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x44bd3e){var _0x221b54=this;return new Promise(function(_0x1cf309,_0x711793){if(ami[_0x47a5('0xf')]()==![]){return _0x711793(_0x221b54[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}_0x44bd3e=_[_0x47a5('0x14')](_0x44bd3e,_[_0x47a5('0x15')](properties[_0x47a5('0x16')]['module']));_0x44bd3e['action']=_0x47a5('0x17');return ami['Action'](_0x44bd3e)['then'](function(_0x423a81){_0x1cf309({'code':0xc8,'message':_0x423a81[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x1ef371){_0x711793(_0x221b54[_0x47a5('0x10')](0x1f5,_0x1ef371[_0x47a5('0x18')]));});});},'Command':function(_0x2763d6){var _0xe3c618=this;return new Promise(function(_0x3aed38,_0x4a9fcb){if(ami[_0x47a5('0xf')]()==![]){return _0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f4,[config['asterisk']['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')]['join']('\x20')));}_0x2763d6=_[_0x47a5('0x14')](_0x2763d6,_0x47a5('0x1b'));_0x2763d6[_0x47a5('0x1c')]=_0x47a5('0x1d');return ami['Action'](_0x2763d6)[_0x47a5('0x1e')](function(_0x385687){_0x3aed38({'code':0xc8,'message':_0x385687['content']});})[_0x47a5('0x19')](function(_0xc4cd63){_0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f5,_0xc4cd63[_0x47a5('0x18')]));});});},'VoiceQueues':function(){return new Promise(function(_0x3abd6a){var _0x50bf17=[];for(var _0x53078a in _0x3717e1[_0x47a5('0x1f')]){if(_0x3717e1['voiceQueues'][_0x47a5('0x20')](_0x53078a)){var _0x5b6c4e=_0x3717e1[_0x47a5('0x1f')][_0x53078a];var _0x378208=new VoiceQueueSummary(_0x5b6c4e);_0x50bf17[_0x47a5('0x21')](_0x378208);}}_0x3abd6a({'count':_0x50bf17[_0x47a5('0x22')],'rows':_0x50bf17});});},'UpdateVoiceQueue':function(_0x21f296){return new Promise(function(_0x3ba0b7,_0x24b162){var _0x136b14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x1f')],{'id':parseInt(_0x21f296['id'])});var _0x1127f8=_[_0x47a5('0x24')](_0x21f296,['id']);if(_0x136b14){for(var _0x3ad507 in _0x1127f8){if(typeof _0x1127f8[_0x3ad507]!=='undefined'&&typeof _0x136b14[_0x3ad507]!==_0x47a5('0x25')){_0x136b14[_0x3ad507]=_0x1127f8[_0x3ad507];}}_0x3ba0b7(_0x136b14);}else{_0x24b162();}});},'VoiceChannels':function(){return new Promise(function(_0x51833b){var _0x2ef875=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x27')]);_0x51833b({'count':_0x2ef875['length'],'rows':_0x2ef875});});},'VoiceChannelMixMonitor':function(_0x256650){var _0x625952=this;return new Promise(function(_0x39b50b,_0x1f1c68){if(ami['isConnected']()==![]){return _0x1f1c68(_0x625952['error'](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],'ami\x20disconnected'][_0x47a5('0x13')]('\x20')));}var _0x51544e=schema(properties['voicechannel'])[_0x47a5('0x28')](_0x256650);if(_0x51544e['length']>0x0){return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x51544e,'message')['join'](',\x20')));}var _0x274e34=_['find'](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x256650[_0x47a5('0x2a')]});if(_0x274e34&&_0x274e34[_0x47a5('0x2b')]){var _0x52749b=util[_0x47a5('0x2c')]('%s.%s',_0x256650['filename']||_0x256650[_0x47a5('0x2a')],_0x256650['format']||_0x47a5('0x2d'));return ami['Action']({'action':_0x47a5('0x2e'),'channel':_0x274e34[_0x47a5('0x2b')],'file':_0x52749b,'options':_0x47a5('0x2f')})[_0x47a5('0x1e')](function(_0x36add5){var _0xed6320=_[_0x47a5('0x23')](_0x274e34[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52749b['toLowerCase']()});if(_[_0x47a5('0x32')](_0xed6320)){_0x274e34[_0x47a5('0x30')]['push']({'filename':_0x47a5('0x31')+_0x52749b[_0x47a5('0x33')](),'createdAt':moment()[_0x47a5('0x2c')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x36add5[_0x47a5('0x34')],'status':_0x47a5('0x35')});}else{_0xed6320['mixmonitorid']=_0x36add5[_0x47a5('0x34')];_0xed6320[_0x47a5('0x36')]='rec';}_0x39b50b({'code':0xc8,'message':[_0x256650['uniqueid'],'MixMonitor\x20Success',_0x36add5[_0x47a5('0x34')]]['join']('\x20'),'mixmonitorid':_0x36add5[_0x47a5('0x34')]});})[_0x47a5('0x19')](function(_0x301a85){_0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,[_0x256650[_0x47a5('0x2a')],_0x301a85[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,_0x47a5('0x37')));}});},'VoiceChannelStopMixMonitor':function(_0x280500){var _0x1658e8=this;return new Promise(function(_0x23d6d8,_0x56dbbd){if(ami[_0x47a5('0xf')]()==![]){return _0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')]['join']('\x20')));}var _0x47c7a2=schema(properties['voicechannel'])['validate'](_0x280500);if(_0x47c7a2[_0x47a5('0x22')]>0x0){return _0x56dbbd(_0x1658e8['error'](0x1f4,_[_0x47a5('0x29')](_0x47c7a2,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x494526=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x280500['uniqueid']});if(_0x494526){return Promise['resolve']()[_0x47a5('0x1e')](function(){if(_0x494526['channel']){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x2b')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){if(_0x494526[_0x47a5('0x3a')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x3a')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){var _0x3574d4=_[_0x47a5('0x23')](_0x494526[_0x47a5('0x30')],{'mixmonitorid':_0x280500['mixmonitorid']});if(_0x3574d4){_0x3574d4[_0x47a5('0x36')]=_0x47a5('0x3b');}})['then'](function(){var _0x52b3a8=util[_0x47a5('0x2c')]('%s.%s',_0x280500[_0x47a5('0x3c')]||_0x280500[_0x47a5('0x2a')],_0x280500['format']||'wav');var _0x3d85cc=_['find'](_0x494526[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52b3a8[_0x47a5('0x33')]()});if(_0x3d85cc){_0x3d85cc[_0x47a5('0x36')]=_0x47a5('0x3b');}})[_0x47a5('0x1e')](function(){_0x23d6d8({'code':0xc8,'message':[_0x280500[_0x47a5('0x2a')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0x47a5('0x19')](function(_0x411230){_0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f5,[_0x280500[_0x47a5('0x2a')],_0x411230[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x56dbbd(_0x1658e8['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannels':function(_0x1c9a62){var _0x5f6a=this;return new Promise(function(_0x5c3c75){var _0x12ca40=_['values'](_0x3717e1[_0x47a5('0x3d')]);var _0xe31817={'count':_0x12ca40[_0x47a5('0x22')],'rows':_0x12ca40};if(_0x1c9a62&&_0x1c9a62[_0x47a5('0x3e')]){if(!['inbound',_0x47a5('0x3f')][_0x47a5('0x40')](_0x1c9a62[_0x47a5('0x3e')])){return _0x59199c(_0x5f6a[_0x47a5('0x10')](0x190,_0x47a5('0x41')));}var _0x6a53b3=_[_0x47a5('0x42')](_0x12ca40,function(_0x481089){return _0x481089[_0x47a5('0x3e')]===_0x1c9a62[_0x47a5('0x3e')];});_0xe31817[_0x47a5('0x43')]=_0x6a53b3[_0x47a5('0x22')];_0xe31817[_0x47a5('0x44')]=_0x6a53b3;}_0x5c3c75(_0xe31817);});},'VoiceQueuesChannel':function(_0x1ab0bf){var _0x572233=this;return new Promise(function(_0x1ad6a9,_0x245a15){var _0x1aa581=schema(properties['voicequeuechannel'])[_0x47a5('0x28')](_0x1ab0bf);if(_0x1aa581[_0x47a5('0x22')]>0x0){return _0x245a15(_0x572233[_0x47a5('0x10')](0x1f4,_['map'](_0x1aa581,'message')[_0x47a5('0x13')](',\x20')));}var _0x376e1d=_['find'](_0x3717e1['queueChannels'],{'uniqueid':_0x1ab0bf[_0x47a5('0x2a')]});if(_0x376e1d){_0x1ad6a9(_0x376e1d);}else{return _0x245a15(_0x572233['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannelHangup':function(_0x5d383d){var _0x482de6=this;return new Promise(function(_0x389ed9,_0x46d2d3){if(ami['isConnected']()==![]){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config['asterisk']['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x867da0=schema(properties[_0x47a5('0x45')])['validate'](_0x5d383d);if(_0x867da0[_0x47a5('0x22')]>0x0){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x867da0,'message')[_0x47a5('0x13')](',\x20')));}var _0x4db625=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x5d383d[_0x47a5('0x2a')]});if(_0x4db625&&_0x4db625[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':'Hangup','channel':_0x4db625[_0x47a5('0x2b')]})['then'](function(_0x5cbe97){_0x389ed9({'code':0xc8,'message':[_0x5d383d['uniqueid'],_0x5cbe97['message'][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')});})[_0x47a5('0x19')](function(_0x52e3ee){_0x46d2d3(_0x482de6['error'](0x1f5,[_0x5d383d[_0x47a5('0x2a')],_0x52e3ee[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x3474b7){var _0x519e9e=this;return new Promise(function(_0x22c886,_0x274d31){if(ami['isConnected']()==![]){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x35cca8=schema(properties[_0x47a5('0x46')])['validate'](_0x3474b7);if(_0x35cca8[_0x47a5('0x22')]>0x0){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x35cca8,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x4bbe14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x3474b7[_0x47a5('0x2a')]});if(_0x4bbe14&&_0x4bbe14[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x47'),'channel':_0x4bbe14[_0x47a5('0x2b')],'exten':_0x3474b7[_0x47a5('0x48')],'context':_0x3474b7[_0x47a5('0x49')]||_0x4bbe14[_0x47a5('0x49')],'priority':0x1})[_0x47a5('0x1e')](function(_0x44fda9){_0x22c886({'code':0xc8,'message':[_0x3474b7[_0x47a5('0x2a')],_0x44fda9[_0x47a5('0x18')][_0x47a5('0x33')]()]['join']('\x20')});})[_0x47a5('0x19')](function(_0x284fb8){_0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,[_0x3474b7['uniqueid'],_0x284fb8[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x3ac402){return new Promise(function(_0x522ccf){var _0x2d5ee6=_['values'](_0x3717e1[_0x47a5('0xb')]);if(_0x3ac402&&_0x3ac402['id']){var _0x4cf7c5=_[_0x47a5('0x23')](_0x2d5ee6,function(_0x2f27c3){return _0x2f27c3['id']===_0x3ac402['id'];});_0x522ccf(_0x4cf7c5);}else{_0x522ccf({'count':_0x2d5ee6[_0x47a5('0x22')],'rows':_0x2d5ee6});}});},'Telephones':function(){return new Promise(function(_0x58473b){var _0x4af557=_['values'](_0x3717e1[_0x47a5('0x4a')]);_0x58473b({'count':_0x4af557[_0x47a5('0x22')],'rows':_0x4af557});});},'Trunks':function(){return new Promise(function(_0xe3c0a7){var _0x117510=_['values'](_0x3717e1[_0x47a5('0x4b')]);_0xe3c0a7({'count':_0x117510[_0x47a5('0x22')],'rows':_0x117510});});},'OutboundChannels':function(){return new Promise(function(_0x390bc0){var _0xd5b23f=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x4c')]);_0x390bc0({'count':_0xd5b23f[_0x47a5('0x22')],'rows':_0xd5b23f});});},'Outbound':function(){return new Promise(function(_0x39939a){_0x39939a(_0x3717e1[_0x47a5('0x3f')]);});},'Campaigns':function(){return new Promise(function(_0xc69a68){var _0x2e6fcc=_[_0x47a5('0x26')](_0x3717e1['campaigns']);_0xc69a68({'count':_0x2e6fcc[_0x47a5('0x22')],'rows':_0x2e6fcc});});},'VoiceQueuesPreview':function(_0x4833be){var _0x2ad00a=this;return new Promise(function(_0x2ac30f,_0x281e5f){_0xfdf934[_0x47a5('0x4d')](_0x4833be['id'])[_0x47a5('0x1e')](function(_0xa9c853){_0x2ac30f({'code':0xc8,'message':_0xa9c853[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x11c1db){_0x281e5f(_0x2ad00a[_0x47a5('0x10')](0x1f4,_0x11c1db[_0x47a5('0x18')]));});});},'EventManager':function(_0x1f07ac){var _0x8f0035=this;return new Promise(function(_0x2d434c,_0x441d64){if(!_0x1f07ac['event']){return _0x441d64(_0x8f0035['error'](0x1f4,'Event\x20name\x20mandatory'));}ami['emit'](_0x47a5('0x4e')+_0x1f07ac[_0x47a5('0x4f')],_0x1f07ac['message']);_0x2d434c({'code':0xc8,'message':_0x1f07ac});});},'FaxAccounts':function(){return new Promise(function(_0x732e00){var _0x44dda2=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x50')]);_0x732e00({'count':_0x44dda2[_0x47a5('0x22')],'rows':_0x44dda2});});},'SendFax':function(_0x930d25){var _0x218dfa=this;return new Promise(function(_0x1c7302,_0x2e9a96){_0x545a97[_0x47a5('0x51')](_0x930d25)[_0x47a5('0x1e')](function(_0x5e5f16){_0x1c7302({'code':0xc8,'message':_0x5e5f16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x420671){_0x2e9a96(_0x218dfa['error'](0x1f4,_0x420671[_0x47a5('0x18')]));});});},'CheckAfterSend':function(_0x32f393){var _0x17b61d=this;return new Promise(function(_0x5d41d8,_0x19dc8c){_0x545a97['checkAfterSend'](_0x32f393)['then'](function(_0x356e16){_0x5d41d8({'code':0xc8,'message':_0x356e16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x27333e){_0x19dc8c(_0x17b61d[_0x47a5('0x10')](0x1f4,_0x27333e[_0x47a5('0x18')]));});});}};var _0x479a82=jayson['server'](_0x343372)[_0x47a5('0x52')]();_0x479a82['on']('error',function(_0x24dbee){return _0x59199c(_0x24dbee);});_0x479a82[_0x47a5('0x7')](0x232a,_0x47a5('0x53'),function(){console[_0x47a5('0x54')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x3d5629(_0x47a5('0x55')+0x232a);});});}; \ No newline at end of file +var _0x7a54=['http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','moment','../../../config/environment','../ami','../model/voiceQueueSummary','listen','name','timers','updateAcw','agents','updateStatusRealtime','voiceStatus','pause','isConnected','error','asterisk','ami\x20disconnected','join','pick','keys','reload','Reload','message','catch','username','command','action','Command','then','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','channels','validate','map','uniqueid','channel','format','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','isNil','toLowerCase','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','Action','StopMixMonitor','destinationchannel','stop','filename','queueChannels','type','outbound','includes','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','run','custom:','event','faxAccounts','send'];(function(_0x2f3043,_0x4883cd){var _0x11e77e=function(_0x4ec86a){while(--_0x4ec86a){_0x2f3043['push'](_0x2f3043['shift']());}};_0x11e77e(++_0x4883cd);}(_0x7a54,0x106));var _0x47a5=function(_0x3f8fc4,_0xfc88dd){_0x3f8fc4=_0x3f8fc4-0x0;var _0x204223=_0x7a54[_0x3f8fc4];return _0x204223;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var jayson=require(_0x47a5('0x2'));var schema=require('validate');var moment=require(_0x47a5('0x3'));var config=require(_0x47a5('0x4'));var properties=require('../properties');var ami=require(_0x47a5('0x5'));var VoiceQueueSummary=require(_0x47a5('0x6'));exports[_0x47a5('0x7')]=function(_0x3717e1,_0xfdf934,_0x545a97){return new Promise(function(_0x3d5629,_0x59199c){var _0x343372={'QueuePause':function(_0x30e405){return new Promise(function(_0x506eda){var _0x194fb0=util['format']('%s/%s','SIP',_0x30e405[_0x47a5('0x8')]);if(_0x3717e1[_0x47a5('0x9')]&&_0x3717e1['timers'][_0x194fb0]&&_0x3717e1[_0x47a5('0x9')][_0x194fb0]['timer']){_0x3717e1['timers'][_0x194fb0][_0x47a5('0xa')]();}if(_0x3717e1[_0x47a5('0xb')][_0x194fb0]){_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xc')]({'state':_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xd')],'statePause':_0x30e405[_0x47a5('0xe')]?!![]:![]});}_0x506eda({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x44bd3e){var _0x221b54=this;return new Promise(function(_0x1cf309,_0x711793){if(ami[_0x47a5('0xf')]()==![]){return _0x711793(_0x221b54[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}_0x44bd3e=_[_0x47a5('0x14')](_0x44bd3e,_[_0x47a5('0x15')](properties[_0x47a5('0x16')]['module']));_0x44bd3e['action']=_0x47a5('0x17');return ami['Action'](_0x44bd3e)['then'](function(_0x423a81){_0x1cf309({'code':0xc8,'message':_0x423a81[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x1ef371){_0x711793(_0x221b54[_0x47a5('0x10')](0x1f5,_0x1ef371[_0x47a5('0x18')]));});});},'Command':function(_0x2763d6){var _0xe3c618=this;return new Promise(function(_0x3aed38,_0x4a9fcb){if(ami[_0x47a5('0xf')]()==![]){return _0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f4,[config['asterisk']['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')]['join']('\x20')));}_0x2763d6=_[_0x47a5('0x14')](_0x2763d6,_0x47a5('0x1b'));_0x2763d6[_0x47a5('0x1c')]=_0x47a5('0x1d');return ami['Action'](_0x2763d6)[_0x47a5('0x1e')](function(_0x385687){_0x3aed38({'code':0xc8,'message':_0x385687['content']});})[_0x47a5('0x19')](function(_0xc4cd63){_0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f5,_0xc4cd63[_0x47a5('0x18')]));});});},'VoiceQueues':function(){return new Promise(function(_0x3abd6a){var _0x50bf17=[];for(var _0x53078a in _0x3717e1[_0x47a5('0x1f')]){if(_0x3717e1['voiceQueues'][_0x47a5('0x20')](_0x53078a)){var _0x5b6c4e=_0x3717e1[_0x47a5('0x1f')][_0x53078a];var _0x378208=new VoiceQueueSummary(_0x5b6c4e);_0x50bf17[_0x47a5('0x21')](_0x378208);}}_0x3abd6a({'count':_0x50bf17[_0x47a5('0x22')],'rows':_0x50bf17});});},'UpdateVoiceQueue':function(_0x21f296){return new Promise(function(_0x3ba0b7,_0x24b162){var _0x136b14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x1f')],{'id':parseInt(_0x21f296['id'])});var _0x1127f8=_[_0x47a5('0x24')](_0x21f296,['id']);if(_0x136b14){for(var _0x3ad507 in _0x1127f8){if(typeof _0x1127f8[_0x3ad507]!=='undefined'&&typeof _0x136b14[_0x3ad507]!==_0x47a5('0x25')){_0x136b14[_0x3ad507]=_0x1127f8[_0x3ad507];}}_0x3ba0b7(_0x136b14);}else{_0x24b162();}});},'VoiceChannels':function(){return new Promise(function(_0x51833b){var _0x2ef875=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x27')]);_0x51833b({'count':_0x2ef875['length'],'rows':_0x2ef875});});},'VoiceChannelMixMonitor':function(_0x256650){var _0x625952=this;return new Promise(function(_0x39b50b,_0x1f1c68){if(ami['isConnected']()==![]){return _0x1f1c68(_0x625952['error'](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],'ami\x20disconnected'][_0x47a5('0x13')]('\x20')));}var _0x51544e=schema(properties['voicechannel'])[_0x47a5('0x28')](_0x256650);if(_0x51544e['length']>0x0){return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x51544e,'message')['join'](',\x20')));}var _0x274e34=_['find'](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x256650[_0x47a5('0x2a')]});if(_0x274e34&&_0x274e34[_0x47a5('0x2b')]){var _0x52749b=util[_0x47a5('0x2c')]('%s.%s',_0x256650['filename']||_0x256650[_0x47a5('0x2a')],_0x256650['format']||_0x47a5('0x2d'));return ami['Action']({'action':_0x47a5('0x2e'),'channel':_0x274e34[_0x47a5('0x2b')],'file':_0x52749b,'options':_0x47a5('0x2f')})[_0x47a5('0x1e')](function(_0x36add5){var _0xed6320=_[_0x47a5('0x23')](_0x274e34[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52749b['toLowerCase']()});if(_[_0x47a5('0x32')](_0xed6320)){_0x274e34[_0x47a5('0x30')]['push']({'filename':_0x47a5('0x31')+_0x52749b[_0x47a5('0x33')](),'createdAt':moment()[_0x47a5('0x2c')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x36add5[_0x47a5('0x34')],'status':_0x47a5('0x35')});}else{_0xed6320['mixmonitorid']=_0x36add5[_0x47a5('0x34')];_0xed6320[_0x47a5('0x36')]='rec';}_0x39b50b({'code':0xc8,'message':[_0x256650['uniqueid'],'MixMonitor\x20Success',_0x36add5[_0x47a5('0x34')]]['join']('\x20'),'mixmonitorid':_0x36add5[_0x47a5('0x34')]});})[_0x47a5('0x19')](function(_0x301a85){_0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,[_0x256650[_0x47a5('0x2a')],_0x301a85[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,_0x47a5('0x37')));}});},'VoiceChannelStopMixMonitor':function(_0x280500){var _0x1658e8=this;return new Promise(function(_0x23d6d8,_0x56dbbd){if(ami[_0x47a5('0xf')]()==![]){return _0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')]['join']('\x20')));}var _0x47c7a2=schema(properties['voicechannel'])['validate'](_0x280500);if(_0x47c7a2[_0x47a5('0x22')]>0x0){return _0x56dbbd(_0x1658e8['error'](0x1f4,_[_0x47a5('0x29')](_0x47c7a2,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x494526=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x280500['uniqueid']});if(_0x494526){return Promise['resolve']()[_0x47a5('0x1e')](function(){if(_0x494526['channel']){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x2b')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){if(_0x494526[_0x47a5('0x3a')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x3a')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){var _0x3574d4=_[_0x47a5('0x23')](_0x494526[_0x47a5('0x30')],{'mixmonitorid':_0x280500['mixmonitorid']});if(_0x3574d4){_0x3574d4[_0x47a5('0x36')]=_0x47a5('0x3b');}})['then'](function(){var _0x52b3a8=util[_0x47a5('0x2c')]('%s.%s',_0x280500[_0x47a5('0x3c')]||_0x280500[_0x47a5('0x2a')],_0x280500['format']||'wav');var _0x3d85cc=_['find'](_0x494526[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52b3a8[_0x47a5('0x33')]()});if(_0x3d85cc){_0x3d85cc[_0x47a5('0x36')]=_0x47a5('0x3b');}})[_0x47a5('0x1e')](function(){_0x23d6d8({'code':0xc8,'message':[_0x280500[_0x47a5('0x2a')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0x47a5('0x19')](function(_0x411230){_0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f5,[_0x280500[_0x47a5('0x2a')],_0x411230[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x56dbbd(_0x1658e8['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannels':function(_0x1c9a62){var _0x5f6a=this;return new Promise(function(_0x5c3c75){var _0x12ca40=_['values'](_0x3717e1[_0x47a5('0x3d')]);var _0xe31817={'count':_0x12ca40[_0x47a5('0x22')],'rows':_0x12ca40};if(_0x1c9a62&&_0x1c9a62[_0x47a5('0x3e')]){if(!['inbound',_0x47a5('0x3f')][_0x47a5('0x40')](_0x1c9a62[_0x47a5('0x3e')])){return _0x59199c(_0x5f6a[_0x47a5('0x10')](0x190,_0x47a5('0x41')));}var _0x6a53b3=_[_0x47a5('0x42')](_0x12ca40,function(_0x481089){return _0x481089[_0x47a5('0x3e')]===_0x1c9a62[_0x47a5('0x3e')];});_0xe31817[_0x47a5('0x43')]=_0x6a53b3[_0x47a5('0x22')];_0xe31817[_0x47a5('0x44')]=_0x6a53b3;}_0x5c3c75(_0xe31817);});},'VoiceQueuesChannel':function(_0x1ab0bf){var _0x572233=this;return new Promise(function(_0x1ad6a9,_0x245a15){var _0x1aa581=schema(properties['voicequeuechannel'])[_0x47a5('0x28')](_0x1ab0bf);if(_0x1aa581[_0x47a5('0x22')]>0x0){return _0x245a15(_0x572233[_0x47a5('0x10')](0x1f4,_['map'](_0x1aa581,'message')[_0x47a5('0x13')](',\x20')));}var _0x376e1d=_['find'](_0x3717e1['queueChannels'],{'uniqueid':_0x1ab0bf[_0x47a5('0x2a')]});if(_0x376e1d){_0x1ad6a9(_0x376e1d);}else{return _0x245a15(_0x572233['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannelHangup':function(_0x5d383d){var _0x482de6=this;return new Promise(function(_0x389ed9,_0x46d2d3){if(ami['isConnected']()==![]){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config['asterisk']['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x867da0=schema(properties[_0x47a5('0x45')])['validate'](_0x5d383d);if(_0x867da0[_0x47a5('0x22')]>0x0){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x867da0,'message')[_0x47a5('0x13')](',\x20')));}var _0x4db625=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x5d383d[_0x47a5('0x2a')]});if(_0x4db625&&_0x4db625[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':'Hangup','channel':_0x4db625[_0x47a5('0x2b')]})['then'](function(_0x5cbe97){_0x389ed9({'code':0xc8,'message':[_0x5d383d['uniqueid'],_0x5cbe97['message'][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')});})[_0x47a5('0x19')](function(_0x52e3ee){_0x46d2d3(_0x482de6['error'](0x1f5,[_0x5d383d[_0x47a5('0x2a')],_0x52e3ee[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x3474b7){var _0x519e9e=this;return new Promise(function(_0x22c886,_0x274d31){if(ami['isConnected']()==![]){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x35cca8=schema(properties[_0x47a5('0x46')])['validate'](_0x3474b7);if(_0x35cca8[_0x47a5('0x22')]>0x0){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x35cca8,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x4bbe14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x3474b7[_0x47a5('0x2a')]});if(_0x4bbe14&&_0x4bbe14[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x47'),'channel':_0x4bbe14[_0x47a5('0x2b')],'exten':_0x3474b7[_0x47a5('0x48')],'context':_0x3474b7[_0x47a5('0x49')]||_0x4bbe14[_0x47a5('0x49')],'priority':0x1})[_0x47a5('0x1e')](function(_0x44fda9){_0x22c886({'code':0xc8,'message':[_0x3474b7[_0x47a5('0x2a')],_0x44fda9[_0x47a5('0x18')][_0x47a5('0x33')]()]['join']('\x20')});})[_0x47a5('0x19')](function(_0x284fb8){_0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,[_0x3474b7['uniqueid'],_0x284fb8[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x3ac402){return new Promise(function(_0x522ccf){var _0x2d5ee6=_['values'](_0x3717e1[_0x47a5('0xb')]);if(_0x3ac402&&_0x3ac402['id']){var _0x4cf7c5=_[_0x47a5('0x23')](_0x2d5ee6,function(_0x2f27c3){return _0x2f27c3['id']===_0x3ac402['id'];});_0x522ccf(_0x4cf7c5);}else{_0x522ccf({'count':_0x2d5ee6[_0x47a5('0x22')],'rows':_0x2d5ee6});}});},'Telephones':function(){return new Promise(function(_0x58473b){var _0x4af557=_['values'](_0x3717e1[_0x47a5('0x4a')]);_0x58473b({'count':_0x4af557[_0x47a5('0x22')],'rows':_0x4af557});});},'Trunks':function(){return new Promise(function(_0xe3c0a7){var _0x117510=_['values'](_0x3717e1[_0x47a5('0x4b')]);_0xe3c0a7({'count':_0x117510[_0x47a5('0x22')],'rows':_0x117510});});},'OutboundChannels':function(){return new Promise(function(_0x390bc0){var _0xd5b23f=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x4c')]);_0x390bc0({'count':_0xd5b23f[_0x47a5('0x22')],'rows':_0xd5b23f});});},'Outbound':function(){return new Promise(function(_0x39939a){_0x39939a(_0x3717e1[_0x47a5('0x3f')]);});},'Campaigns':function(){return new Promise(function(_0xc69a68){var _0x2e6fcc=_[_0x47a5('0x26')](_0x3717e1['campaigns']);_0xc69a68({'count':_0x2e6fcc[_0x47a5('0x22')],'rows':_0x2e6fcc});});},'VoiceQueuesPreview':function(_0x4833be){var _0x2ad00a=this;return new Promise(function(_0x2ac30f,_0x281e5f){_0xfdf934[_0x47a5('0x4d')](_0x4833be['id'])[_0x47a5('0x1e')](function(_0xa9c853){_0x2ac30f({'code':0xc8,'message':_0xa9c853[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x11c1db){_0x281e5f(_0x2ad00a[_0x47a5('0x10')](0x1f4,_0x11c1db[_0x47a5('0x18')]));});});},'EventManager':function(_0x1f07ac){var _0x8f0035=this;return new Promise(function(_0x2d434c,_0x441d64){if(!_0x1f07ac['event']){return _0x441d64(_0x8f0035['error'](0x1f4,'Event\x20name\x20mandatory'));}ami['emit'](_0x47a5('0x4e')+_0x1f07ac[_0x47a5('0x4f')],_0x1f07ac['message']);_0x2d434c({'code':0xc8,'message':_0x1f07ac});});},'FaxAccounts':function(){return new Promise(function(_0x732e00){var _0x44dda2=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x50')]);_0x732e00({'count':_0x44dda2[_0x47a5('0x22')],'rows':_0x44dda2});});},'SendFax':function(_0x930d25){var _0x218dfa=this;return new Promise(function(_0x1c7302,_0x2e9a96){_0x545a97[_0x47a5('0x51')](_0x930d25)[_0x47a5('0x1e')](function(_0x5e5f16){_0x1c7302({'code':0xc8,'message':_0x5e5f16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x420671){_0x2e9a96(_0x218dfa['error'](0x1f4,_0x420671[_0x47a5('0x18')]));});});},'CheckAfterSend':function(_0x32f393){var _0x17b61d=this;return new Promise(function(_0x5d41d8,_0x19dc8c){_0x545a97['checkAfterSend'](_0x32f393)['then'](function(_0x356e16){_0x5d41d8({'code':0xc8,'message':_0x356e16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x27333e){_0x19dc8c(_0x17b61d[_0x47a5('0x10')](0x1f4,_0x27333e[_0x47a5('0x18')]));});});}};var _0x479a82=jayson['server'](_0x343372)[_0x47a5('0x52')]();_0x479a82['on']('error',function(_0x24dbee){return _0x59199c(_0x24dbee);});_0x479a82[_0x47a5('0x7')](0x232a,_0x47a5('0x53'),function(){console[_0x47a5('0x54')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x3d5629(_0x47a5('0x55')+0x232a);});});}; \ No newline at end of file diff --git a/server/services/ami/trigger/cmContact/index.js b/server/services/ami/trigger/cmContact/index.js index ee204aa..99e4bab 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 _0x23bb=['[CM][%s][%s]\x20Autocreate\x20enabled','firstName','calleridname','','Unknown','destcalleridname','createContact','[CM][%s][%s]\x20Contact\x20created:%s','push','format','user:%s','name','trigger:%s','action','toLowerCase','lodash','util','../../../../config/environment','../../../../config/logger','../../rpc/cmContact','redis','defaults','info','stringify','emit','data1','data2','isNil','data5','xmd-contactid','ListId','data3','phone','$or','map','destcalleridnum','routeId','calleridnum','lastName','mobile','fax','createdAt','scheduledAt','union','resolve','then','length','[CM][%s][%s]\x20Contact\x20found:%s','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','uniqueid','data4'];(function(_0x49da57,_0x4f7a76){var _0xc1f3d4=function(_0x2d24c2){while(--_0x2d24c2){_0x49da57['push'](_0x49da57['shift']());}};_0xc1f3d4(++_0x4f7a76);}(_0x23bb,0x79));var _0xb23b=function(_0x5673c6,_0xc302ec){_0x5673c6=_0x5673c6-0x0;var _0x130bd9=_0x23bb[_0x5673c6];return _0x130bd9;};'use strict';var _=require(_0xb23b('0x0'));var BPromise=require('bluebird');var Redis=require('ioredis');var util=require(_0xb23b('0x1'));var config=require(_0xb23b('0x2'));var logger=require(_0xb23b('0x3'))('trigger');var cmContactRpc=require(_0xb23b('0x4'));config[_0xb23b('0x5')]=_[_0xb23b('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb23b('0x5')]));function emit(_0x4c5626,_0x4a2873,_0x596a94,_0x29e8e9,_0x4d00fe){logger[_0xb23b('0x7')]('[CM][%s][%s]',_0x4c5626,_0x4a2873['id'],_0x596a94,_0x29e8e9,JSON[_0xb23b('0x8')](_0x4d00fe));io['to'](_0x596a94)[_0xb23b('0x9')](_0x29e8e9,_0x4d00fe);}exports['exec']=function(_0xa56813,_0x2fe30e,_0x56e9ba,_0x4517ca){var _0x2c665c,_0x1b5f93;var _0x5cc7fd={};var _0x1048f2;var _0x2cb34d=Number(_0x56e9ba[_0xb23b('0xa')]);var _0x3f956c=_0x56e9ba[_0xb23b('0xb')]?Boolean(Number(_0x56e9ba[_0xb23b('0xb')])):![];var _0x3ee84b;var _0x12ae1c=![];if(!_[_0xb23b('0xc')](_0x56e9ba[_0xb23b('0xd')])){if(_0x56e9ba[_0xb23b('0xd')]=='1')_0x12ae1c=!![];}if(!_0x12ae1c){if(_0x4517ca[_0xb23b('0xe')]){_0x5cc7fd['id']=_0x4517ca[_0xb23b('0xe')];}}if(!_0x5cc7fd['id']){_0x5cc7fd[_0xb23b('0xf')]=_0x2cb34d;_0x3ee84b=_0x56e9ba[_0xb23b('0x10')]&&_0x56e9ba[_0xb23b('0x10')]!=='0'?_0x56e9ba[_0xb23b('0x10')]['split'](','):[_0xb23b('0x11')];_0x5cc7fd[_0xb23b('0x12')]=_[_0xb23b('0x13')](_0x3ee84b,function(_0x2d9584){var _0x158e02={};_0x158e02[_0x2d9584]=_0x4517ca['routeId']?_0x4517ca[_0xb23b('0x14')]:_0x4517ca['calleridnum'];return _0x158e02;});_0x1048f2=_0x4517ca[_0xb23b('0x15')]?_0x4517ca[_0xb23b('0x14')]:_0x4517ca[_0xb23b('0x16')];}var _0x5ddf16=['id','firstName',_0xb23b('0x17'),_0xb23b('0x11'),_0xb23b('0x18'),_0xb23b('0x19'),_0xb23b('0xf'),_0xb23b('0x1a'),_0xb23b('0x1b'),'updatedAt'];var _0x1e95a9=_[_0xb23b('0x1c')](_0x5ddf16,_0x3ee84b);BPromise[_0xb23b('0x1d')]()[_0xb23b('0x1e')](cmContactRpc['getContacts']({'attributes':_0x1e95a9,'where':_0x5cc7fd,'phone':_0x1048f2}))[_0xb23b('0x1e')](function(_0x3bec93){_0x1b5f93=_0x3bec93;if(!_['isEmpty'](_0x1b5f93)){if(_0x1b5f93[_0xb23b('0x1f')]===0x1){_0x2c665c=_0x1b5f93[0x0];logger['info'](_0xb23b('0x20'),_0x4517ca['uniqueid'],_0x2fe30e['id'],_0x2c665c['id']);}else{logger[_0xb23b('0x7')](_0xb23b('0x21'),_0x4517ca['uniqueid'],_0x2fe30e['id'],_[_0xb23b('0x13')](_0x1b5f93,'id')[_0xb23b('0x22')](','));}return;}else{logger[_0xb23b('0x7')](_0xb23b('0x23'),_0x4517ca[_0xb23b('0x24')],_0x2fe30e['id']);var _0x5ebe63={'ListId':_0x2cb34d};var _0x6c68fa=_0x56e9ba[_0xb23b('0x25')]&&_0x56e9ba[_0xb23b('0x25')]!=='0'?_0x56e9ba[_0xb23b('0x25')]:_0xb23b('0x11');if(_0x3f956c){logger[_0xb23b('0x7')](_0xb23b('0x26'),_0x4517ca[_0xb23b('0x24')],_0x2fe30e['id']);_0x5ebe63[_0x6c68fa]=_['isNil'](_0x4517ca[_0xb23b('0x15')])?_0x4517ca[_0xb23b('0x16')]:_0x4517ca[_0xb23b('0x14')];if(_['isNil'](_0x4517ca[_0xb23b('0x15')])){_0x5ebe63[_0xb23b('0x27')]=_0x4517ca[_0xb23b('0x28')]&&_0x4517ca[_0xb23b('0x28')]!==_0xb23b('0x29')?_0x4517ca['calleridname']:_0xb23b('0x2a');}else{_0x5ebe63[_0xb23b('0x27')]=_0x4517ca[_0xb23b('0x2b')]&&_0x4517ca[_0xb23b('0x2b')]!==_0xb23b('0x29')?_0x4517ca[_0xb23b('0x2b')]:_0xb23b('0x2a');}return BPromise[_0xb23b('0x1d')]()[_0xb23b('0x1e')](cmContactRpc[_0xb23b('0x2c')](_0x5ebe63))[_0xb23b('0x1e')](function(_0x4654db){_0x2c665c=_0x4654db;_0x1b5f93['push'](_0x4654db);if(_0x2c665c){logger[_0xb23b('0x7')](_0xb23b('0x2d'),_0x4517ca[_0xb23b('0x24')],_0x2fe30e['id'],_0x2c665c['id']);}return;});}else{logger[_0xb23b('0x7')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x4517ca[_0xb23b('0x24')],_0x2fe30e['id']);_0x5ebe63[_0x6c68fa]=_[_0xb23b('0xc')](_0x4517ca[_0xb23b('0x15')])?_0x4517ca[_0xb23b('0x16')]:_0x4517ca[_0xb23b('0x14')];if(_['isNil'](_0x4517ca[_0xb23b('0x15')])){_0x5ebe63['firstName']=_0x4517ca[_0xb23b('0x28')]&&_0x4517ca['calleridname']!==_0xb23b('0x29')?_0x4517ca['calleridname']:_0xb23b('0x2a');}else{_0x5ebe63['firstName']=_0x4517ca['destcalleridname']&&_0x4517ca[_0xb23b('0x2b')]!==_0xb23b('0x29')?_0x4517ca[_0xb23b('0x2b')]:'Unknown';}_0x2c665c=_0x5ebe63;_0x1b5f93[_0xb23b('0x2e')](_0x5ebe63);return;}}})[_0xb23b('0x1e')](function(){if(_0xa56813){emit(_0x4517ca[_0xb23b('0x24')],_0x2fe30e,util[_0xb23b('0x2f')](_0xb23b('0x30'),_0xa56813[_0xb23b('0x31')]),util[_0xb23b('0x2f')](_0xb23b('0x32'),_0x56e9ba[_0xb23b('0x33')][_0xb23b('0x34')]()),{'evt':_['merge'](_0x4517ca,{'autoCreate':_0x3f956c}),'contact':_0x2c665c===undefined?{}:_0x2c665c,'contacts':_0x1b5f93[_0xb23b('0x1f')]===0x0?undefined:_0x1b5f93});}});}; \ No newline at end of file +var _0x369d=['map','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','Unknown','destcalleridname','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','trigger:%s','action','merge','lodash','bluebird','ioredis','../../../../config/environment','../../../../config/logger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','[CM][%s][%s]','emit','exec','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','routeId','calleridnum','destcalleridnum','firstName','lastName','mobile','fax','createdAt','updatedAt','union','resolve','then','getContacts','isEmpty','length','info','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]'];(function(_0x1a7025,_0x19c274){var _0x21325c=function(_0x1a6291){while(--_0x1a6291){_0x1a7025['push'](_0x1a7025['shift']());}};_0x21325c(++_0x19c274);}(_0x369d,0x166));var _0xd369=function(_0x483cd6,_0x58eba6){_0x483cd6=_0x483cd6-0x0;var _0x2817f7=_0x369d[_0x483cd6];return _0x2817f7;};'use strict';var _=require(_0xd369('0x0'));var BPromise=require(_0xd369('0x1'));var Redis=require(_0xd369('0x2'));var util=require('util');var config=require(_0xd369('0x3'));var logger=require(_0xd369('0x4'))('trigger');var cmContactRpc=require(_0xd369('0x5'));config[_0xd369('0x6')]=_[_0xd369('0x7')](config[_0xd369('0x6')],{'host':_0xd369('0x8'),'port':0x18eb});var io=require(_0xd369('0x9'))(new Redis(config[_0xd369('0x6')]));function emit(_0xb8b844,_0x32c0a8,_0x376909,_0x2fcdaf,_0x4138d6){logger['info'](_0xd369('0xa'),_0xb8b844,_0x32c0a8['id'],_0x376909,_0x2fcdaf,JSON['stringify'](_0x4138d6));io['to'](_0x376909)[_0xd369('0xb')](_0x2fcdaf,_0x4138d6);}exports[_0xd369('0xc')]=function(_0x11f447,_0x4852e5,_0x53ded3,_0x3889da){var _0x3b9b5f,_0x3d43fa;var _0x5eb312={};var _0x53dede;var _0x3729ce=Number(_0x53ded3['data1']);var _0x1e1048=_0x53ded3[_0xd369('0xd')]?Boolean(Number(_0x53ded3[_0xd369('0xd')])):![];var _0x231b4d;var _0x14cccd=![];if(!_[_0xd369('0xe')](_0x53ded3[_0xd369('0xf')])){if(_0x53ded3['data5']=='1')_0x14cccd=!![];}if(!_0x14cccd){if(_0x3889da[_0xd369('0x10')]){_0x5eb312['id']=_0x3889da[_0xd369('0x10')];}}if(!_0x5eb312['id']){_0x5eb312[_0xd369('0x11')]=_0x3729ce;_0x231b4d=_0x53ded3[_0xd369('0x12')]&&_0x53ded3[_0xd369('0x12')]!=='0'?_0x53ded3[_0xd369('0x12')][_0xd369('0x13')](','):[_0xd369('0x14')];_0x5eb312[_0xd369('0x15')]=_['map'](_0x231b4d,function(_0x25b19e){var _0x5d6ee7={};_0x5d6ee7[_0x25b19e]=_0x3889da[_0xd369('0x16')]?_0x3889da['destcalleridnum']:_0x3889da[_0xd369('0x17')];return _0x5d6ee7;});_0x53dede=_0x3889da[_0xd369('0x16')]?_0x3889da[_0xd369('0x18')]:_0x3889da[_0xd369('0x17')];}var _0x2f7217=['id',_0xd369('0x19'),_0xd369('0x1a'),'phone',_0xd369('0x1b'),_0xd369('0x1c'),'ListId',_0xd369('0x1d'),'scheduledAt',_0xd369('0x1e')];var _0x506f75=_[_0xd369('0x1f')](_0x2f7217,_0x231b4d);BPromise[_0xd369('0x20')]()[_0xd369('0x21')](cmContactRpc[_0xd369('0x22')]({'attributes':_0x506f75,'where':_0x5eb312,'phone':_0x53dede}))['then'](function(_0x3c8055){_0x3d43fa=_0x3c8055;if(!_[_0xd369('0x23')](_0x3d43fa)){if(_0x3d43fa[_0xd369('0x24')]===0x1){_0x3b9b5f=_0x3d43fa[0x0];logger[_0xd369('0x25')](_0xd369('0x26'),_0x3889da[_0xd369('0x27')],_0x4852e5['id'],_0x3b9b5f['id']);}else{logger['info'](_0xd369('0x28'),_0x3889da[_0xd369('0x27')],_0x4852e5['id'],_[_0xd369('0x29')](_0x3d43fa,'id')[_0xd369('0x2a')](','));}return;}else{logger[_0xd369('0x25')](_0xd369('0x2b'),_0x3889da[_0xd369('0x27')],_0x4852e5['id']);var _0x2b99c3={'ListId':_0x3729ce};var _0x448194=_0x53ded3[_0xd369('0x2c')]&&_0x53ded3[_0xd369('0x2c')]!=='0'?_0x53ded3[_0xd369('0x2c')]:_0xd369('0x14');if(_0x1e1048){logger[_0xd369('0x25')](_0xd369('0x2d'),_0x3889da['uniqueid'],_0x4852e5['id']);_0x2b99c3[_0x448194]=_[_0xd369('0xe')](_0x3889da[_0xd369('0x16')])?_0x3889da[_0xd369('0x17')]:_0x3889da[_0xd369('0x18')];if(_[_0xd369('0xe')](_0x3889da[_0xd369('0x16')])){_0x2b99c3[_0xd369('0x19')]=_0x3889da[_0xd369('0x2e')]&&_0x3889da[_0xd369('0x2e')]!==_0xd369('0x2f')?_0x3889da[_0xd369('0x2e')]:_0xd369('0x30');}else{_0x2b99c3[_0xd369('0x19')]=_0x3889da[_0xd369('0x31')]&&_0x3889da[_0xd369('0x31')]!==''?_0x3889da[_0xd369('0x31')]:_0xd369('0x30');}return BPromise[_0xd369('0x20')]()[_0xd369('0x21')](cmContactRpc['createContact'](_0x2b99c3))['then'](function(_0x49ad39){_0x3b9b5f=_0x49ad39;_0x3d43fa[_0xd369('0x32')](_0x49ad39);if(_0x3b9b5f){logger['info'](_0xd369('0x33'),_0x3889da[_0xd369('0x27')],_0x4852e5['id'],_0x3b9b5f['id']);}return;});}else{logger[_0xd369('0x25')](_0xd369('0x34'),_0x3889da[_0xd369('0x27')],_0x4852e5['id']);_0x2b99c3[_0x448194]=_[_0xd369('0xe')](_0x3889da[_0xd369('0x16')])?_0x3889da[_0xd369('0x17')]:_0x3889da[_0xd369('0x18')];if(_['isNil'](_0x3889da['routeId'])){_0x2b99c3[_0xd369('0x19')]=_0x3889da[_0xd369('0x2e')]&&_0x3889da['calleridname']!==_0xd369('0x2f')?_0x3889da[_0xd369('0x2e')]:_0xd369('0x30');}else{_0x2b99c3[_0xd369('0x19')]=_0x3889da[_0xd369('0x31')]&&_0x3889da[_0xd369('0x31')]!==_0xd369('0x2f')?_0x3889da[_0xd369('0x31')]:_0xd369('0x30');}_0x3b9b5f=_0x2b99c3;_0x3d43fa['push'](_0x2b99c3);return;}}})['then'](function(){if(_0x11f447){emit(_0x3889da[_0xd369('0x27')],_0x4852e5,util[_0xd369('0x35')]('user:%s',_0x11f447['name']),util['format'](_0xd369('0x36'),_0x53ded3[_0xd369('0x37')]['toLowerCase']()),{'evt':_[_0xd369('0x38')](_0x3889da,{'autoCreate':_0x1e1048}),'contact':_0x3b9b5f===undefined?{}:_0x3b9b5f,'contacts':_0x3d43fa[_0xd369('0x24')]===0x0?undefined:_0x3d43fa});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 47265e0..9a3c6aa 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 _0xe137=['interaction','message','event','membername','lastevent','mailSubstatus','null','substatus','created','equals','exports','url','mustache','ioredis','./urlforward','./integration','../../../config/environment','trigger','redis','localhost','popup','winapp','triggers','agents','voiceQueues','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','sugarcrmAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentnosuchnumber','custom:agentbusy','custom:amd','custom:timeout','syncAgentDial','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:outgoingmessage','custom:rejectmessage','custom:offlineMessage','info','stringify','emit','prototype','clone','motionChannel','undefined','voice','debug','inspect','checkTriggers','interface','hasOwnProperty','status','checkTrigger','merge','variables','length','Actions','toLowerCase','contactmanager','browser','data1','TemplateId','data2','html','templates','template\x20not\x20found','uri','buildUri','isNil','data3','data4','location','uriLocation','windowWidth','data5','data6','600','winApplication','render','format','user:%s','trigger:%s:%s','action','jscripty','name','trigger:%s','exec','integration','queue','routeId','parse','search','AllConditions','channel','some','AnyConditions','checkConditions','evt','field','account','chat','ChatWebsiteId','operator','value','upperFirst','AccountId'];(function(_0x4dd2ce,_0x297a7e){var _0x477022=function(_0x28f544){while(--_0x28f544){_0x4dd2ce['push'](_0x4dd2ce['shift']());}};_0x477022(++_0x297a7e);}(_0xe137,0x176));var _0x7e13=function(_0x2c7b86,_0x59ef3c){_0x2c7b86=_0x2c7b86-0x0;var _0x256735=_0xe137[_0x2c7b86];return _0x256735;};'use strict';var util=require('util');var _=require('lodash');var url=require(_0x7e13('0x0'));var Mustache=require(_0x7e13('0x1'));var Redis=require(_0x7e13('0x2'));var urlforward=require(_0x7e13('0x3'));var integration=require(_0x7e13('0x4'));var cmContact=require('./cmContact');var script=require('./script');var config=require(_0x7e13('0x5'));var logger=require('../../../config/logger')(_0x7e13('0x6'));var ami=require('../ami');config[_0x7e13('0x7')]=_['defaults'](config[_0x7e13('0x7')],{'host':_0x7e13('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var operators={'equals':function(_0x51c369,_0x501aad){return _0x51c369==_0x501aad;},'not_equals':function(_0x4f01a2,_0x57adf0){return _0x4f01a2!=_0x57adf0;}};var barAndWebActions=[_0x7e13('0x9'),_0x7e13('0x0'),_0x7e13('0xa')];function Trigger(_0x2c3a78){this[_0x7e13('0xb')]=_0x2c3a78[_0x7e13('0xb')];this[_0x7e13('0xc')]=_0x2c3a78['agents'];this[_0x7e13('0xd')]=_0x2c3a78[_0x7e13('0xd')];this['templates']=_0x2c3a78['templates'];this[_0x7e13('0xe')]=_0x2c3a78[_0x7e13('0xe')];this[_0x7e13('0xf')]=_0x2c3a78[_0x7e13('0xf')];this[_0x7e13('0x10')]=_0x2c3a78['freshdeskAccounts'];this[_0x7e13('0x11')]=_0x2c3a78[_0x7e13('0x11')];this['sugarcrmAccounts']=_0x2c3a78['sugarcrmAccounts'];this[_0x7e13('0x12')]=_0x2c3a78[_0x7e13('0x12')];this[_0x7e13('0x13')]=_0x2c3a78[_0x7e13('0x13')];this[_0x7e13('0x14')]=_0x2c3a78[_0x7e13('0x14')];this[_0x7e13('0x15')]=_0x2c3a78[_0x7e13('0x15')];this[_0x7e13('0x16')]=_0x2c3a78[_0x7e13('0x16')];this[_0x7e13('0x17')]=_0x2c3a78[_0x7e13('0x17')];this[_0x7e13('0x18')]={'zendesk':this[_0x7e13('0xf')],'salesforce':this[_0x7e13('0x11')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0x7e13('0x19')],'zoho':this[_0x7e13('0x12')],'desk':this['deskAccounts'],'vtiger':this['vtigerAccounts'],'dynamics365':this[_0x7e13('0x16')],'freshsales':this[_0x7e13('0x17')],'servicenow':this['servicenowAccounts']};ami['on'](_0x7e13('0x1a'),this[_0x7e13('0x1b')][_0x7e13('0x1c')](this));ami['on'](_0x7e13('0x1d'),this[_0x7e13('0x1b')][_0x7e13('0x1c')](this));ami['on']('custom:agentringnoanswer',this['syncCustomEvent'][_0x7e13('0x1c')](this));ami['on']('custom:agentcomplete',this[_0x7e13('0x1b')][_0x7e13('0x1c')](this));ami['on'](_0x7e13('0x1e'),this[_0x7e13('0x1b')][_0x7e13('0x1c')](this));ami['on']('custom:agentnoanswer',this[_0x7e13('0x1b')]['bind'](this));ami['on'](_0x7e13('0x1f'),this[_0x7e13('0x1b')][_0x7e13('0x1c')](this));ami['on']('custom:agentcongestion',this[_0x7e13('0x1b')][_0x7e13('0x1c')](this));ami['on']('custom:agentreject',this[_0x7e13('0x1b')][_0x7e13('0x1c')](this));ami['on'](_0x7e13('0x20'),this[_0x7e13('0x1b')][_0x7e13('0x1c')](this));ami['on']('custom:queuecallerabandon',this[_0x7e13('0x1b')][_0x7e13('0x1c')](this));ami['on'](_0x7e13('0x21'),this['syncCustomEvent'][_0x7e13('0x1c')](this));ami['on']('custom:dialbegin',this['syncAgentDial'][_0x7e13('0x1c')](this));ami['on']('custom:dialconnect',this[_0x7e13('0x22')]['bind'](this));ami['on'](_0x7e13('0x23'),this[_0x7e13('0x22')][_0x7e13('0x1c')](this));ami['on'](_0x7e13('0x24'),this['syncCustomEvent'][_0x7e13('0x1c')](this));ami['on'](_0x7e13('0x25'),this[_0x7e13('0x1b')][_0x7e13('0x1c')](this));ami['on'](_0x7e13('0x26'),this[_0x7e13('0x1b')][_0x7e13('0x1c')](this));ami['on']('custom:incomingmessage',this[_0x7e13('0x1b')][_0x7e13('0x1c')](this));ami['on'](_0x7e13('0x27'),this[_0x7e13('0x1b')][_0x7e13('0x1c')](this));ami['on']('custom:acceptmessage',this[_0x7e13('0x1b')][_0x7e13('0x1c')](this));ami['on'](_0x7e13('0x28'),this[_0x7e13('0x1b')][_0x7e13('0x1c')](this));ami['on'](_0x7e13('0x29'),this[_0x7e13('0x1b')][_0x7e13('0x1c')](this));}Trigger['prototype']['emit']=function(_0x241ad7,_0x5c1042,_0x4208f7){logger[_0x7e13('0x2a')](_0x241ad7,_0x5c1042,JSON[_0x7e13('0x2b')](_0x4208f7));io['to'](_0x241ad7)[_0x7e13('0x2c')](_0x5c1042,_0x4208f7);};Trigger[_0x7e13('0x2d')]['syncCustomEvent']=function(_0x180252){var _0x408ed6=_[_0x7e13('0x2e')](_0x180252);if(typeof _0x408ed6[_0x7e13('0x2f')]===_0x7e13('0x30')){_0x408ed6[_0x7e13('0x2f')]=_0x7e13('0x31');}logger[_0x7e13('0x32')](_0x7e13('0x1b'),util[_0x7e13('0x33')](_0x408ed6,{'showHidden':!![],'depth':null}));this[_0x7e13('0x34')](_0x408ed6);};Trigger[_0x7e13('0x2d')][_0x7e13('0x22')]=function(_0x113c4f){if(this[_0x7e13('0xc')][_0x113c4f[_0x7e13('0x35')]]){this[_0x7e13('0x1b')](_0x113c4f);}};Trigger['prototype'][_0x7e13('0x34')]=function(_0xccdd0){var _0x472b53;for(var _0x46d616 in this[_0x7e13('0xb')]){if(this[_0x7e13('0xb')][_0x7e13('0x36')](_0x46d616)){if(this[_0x7e13('0xb')][_0x46d616][_0x7e13('0x37')]){_0x472b53=this[_0x7e13('0x38')](this[_0x7e13('0xb')][_0x46d616],_0xccdd0);if(_0x472b53){_[_0x7e13('0x39')](_0xccdd0,_0xccdd0[_0x7e13('0x3a')]);for(var _0x5a3b1a=0x0,_0x279318,_0x29905a,_0x2d6726;_0x5a3b1a0x0){_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 +var _0x3e74=['customField','content','idField','custom_fields','variable','variableName','name','Variable','toLowerCase','priority','Creating\x20new\x20ticket...','getString','phone','new','xCALLY','Motion','CTI','concat','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','stripTrailingSlash','serverUrl','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','newTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','catch','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridnum','The\x20Enduser\x20ID\x20is:','trigger:desk:display','trigger:browser:url','%s/agent/tickets/%s','stringify','unmanaged','monitor_format','lastevent','toUpperCase','calleridnum','lodash','md5','util','ioredis','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Getting\x20agent\x20with\x20email','%s/users','then','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','format','debug','[HTTP]','GET','authType','basic','%s:%s','username','password','token','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','total_entries','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','length','forEach','includes','string','picklist','type','nameField'];(function(_0x12080f,_0x5cebcd){var _0x1b1448=function(_0x22e27c){while(--_0x22e27c){_0x12080f['push'](_0x12080f['shift']());}};_0x1b1448(++_0x5cebcd);}(_0x3e74,0x175));var _0x43e7=function(_0x2b15e2,_0x26aa37){_0x2b15e2=_0x2b15e2-0x0;var _0x56136d=_0x3e74[_0x2b15e2];return _0x56136d;};'use strict';var _=require(_0x43e7('0x0'));var rp=require('request-promise');var md5=require(_0x43e7('0x1'));var util=require(_0x43e7('0x2'));var Redis=require(_0x43e7('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x43e7('0x4'))('desk');config[_0x43e7('0x5')]=_[_0x43e7('0x6')](config[_0x43e7('0x5')],{'host':_0x43e7('0x7'),'port':0x18eb});var io=require(_0x43e7('0x8'))(new Redis(config['redis']));function emit(_0x45a0d1,_0x3491d6,_0x2ede2d){io['to'](_0x45a0d1)[_0x43e7('0x9')](_0x3491d6,_0x2ede2d);}var headers={'Content-Type':_0x43e7('0xa'),'Accept':'application/json'};function getUser(_0x212c6c,_0x554d44){if(intUtil['validateEmail'](_0x554d44)===!![]){logger[_0x43e7('0xb')](_0x43e7('0xc'),_0x554d44);return request({'uri':util['format'](_0x43e7('0xd'),_0x212c6c['remoteUri'])})[_0x43e7('0xe')](function(_0x37302c){if(_0x37302c['total_entries']){return _[_0x43e7('0xf')](_0x37302c[_0x43e7('0x10')][_0x43e7('0x11')],{'email':_0x554d44});}})[_0x43e7('0xe')](function(_0x4e008c){if(_0x4e008c){logger['info'](_0x43e7('0x12'));return _0x4e008c;}else{logger[_0x43e7('0xb')](_0x43e7('0x13'));return request({'uri':util['format']('%s/users/me',_0x212c6c[_0x43e7('0x14')])});}});}else{logger[_0x43e7('0xb')](_0x43e7('0x15'));return request({'uri':util[_0x43e7('0x16')]('%s/users/me',_0x212c6c['remoteUri'])});}}function request(_0xdf16c){logger[_0x43e7('0x17')](_0x43e7('0x18'),JSON['stringify'](_0xdf16c));return rp(_['defaults'](_0xdf16c,{'method':_0x43e7('0x19'),'headers':headers,'json':!![]}));}function getAuth(_0x1ca758){var _0x9037d3;if(_0x1ca758[_0x43e7('0x1a')]===_0x43e7('0x1b')){_0x9037d3=util[_0x43e7('0x16')](_0x43e7('0x1c'),_0x1ca758[_0x43e7('0x1d')],_0x1ca758[_0x43e7('0x1e')]);}else if(_0x1ca758[_0x43e7('0x1a')]===_0x43e7('0x1f')){_0x9037d3=util[_0x43e7('0x16')]('%s/token:%s',_0x1ca758[_0x43e7('0x1d')],_0x1ca758[_0x43e7('0x1f')]);}return util['format'](_0x43e7('0x20'),new Buffer(_0x9037d3)[_0x43e7('0x21')](_0x43e7('0x22')));}function getEndUser(_0x28aacc,_0x4077fb,_0x2f4cb4){logger['info'](_0x43e7('0x23'),_0x2f4cb4);return request({'uri':util['format']('%s/customers/search',_0x28aacc[_0x43e7('0x14')]),'qs':{'phone':_0x2f4cb4}})[_0x43e7('0xe')](function(_0x4b2b9f){if(_0x4b2b9f[_0x43e7('0x24')]){logger['info'](_0x43e7('0x25'));return _0x4b2b9f['_embedded'][_0x43e7('0x11')][0x0];}else{logger[_0x43e7('0xb')](_0x43e7('0x26'));return request({'uri':util[_0x43e7('0x16')]('%s/customers',_0x28aacc['remoteUri']),'method':_0x43e7('0x27'),'body':{'first_name':_0x4077fb,'title':_0x4077fb,'phone_numbers':[{'type':'work','value':_0x2f4cb4}]}});}});}function getTags(_0x2dd5f,_0x40dc8f){var _0x3565cf=[];if(_0x2dd5f&&_0x2dd5f[_0x43e7('0x28')]>0x0){_0x3565cf=_['map'](_0x2dd5f,_0x40dc8f);}return _0x3565cf;}function getCustomFields(_0x33a1a5,_0x4690a6){var _0x45b675=[];var _0x50f9f5={'custom_fields':{}};if(_0x33a1a5[_0x43e7('0x28')]>0x0){_[_0x43e7('0x29')](_0x33a1a5,function(_0x2b85a5){if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5[_0x43e7('0x2d')])&&_0x2b85a5[_0x43e7('0x2e')]&&!_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x2b85a5[_0x43e7('0x2e')]['toLowerCase']()]=_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x21')]();}else if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5['type'])&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x2b85a5['content']['toString']();}else if(_0x2b85a5['type']===_0x43e7('0x33')&&_0x2b85a5[_0x43e7('0x34')]&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x34')]]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5['idField']]=_0x4690a6[_0x2b85a5['variableName']]['toString']());}else if(_0x2b85a5['type']==='customVariable'&&_0x2b85a5['Variable']&&_0x2b85a5['Variable'][_0x43e7('0x35')]&&_0x2b85a5['idField']&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x36')][_0x43e7('0x35')][_0x43e7('0x37')]()]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x4690a6[_0x2b85a5[_0x43e7('0x36')]['name']['toLowerCase']()]['toString']());}});}if(_0x50f9f5[_0x43e7('0x38')]){_0x50f9f5[_0x43e7('0x38')]=Number(_0x50f9f5[_0x43e7('0x38')]);}return _0x50f9f5;}function getTicket(_0x16cdba,_0x1b1440,_0x1ed538,_0x1d4589,_0x2ffd43){logger['info'](_0x43e7('0x39'));var _0x2b0ffe=_['merge']({'subject':intUtil[_0x43e7('0x3a')](_0x1d4589['Subjects'],_0x2ffd43,'\x20'),'type':_0x43e7('0x3b'),'status':_0x43e7('0x3c'),'labels':[_0x43e7('0x3d'),_0x43e7('0x3e'),_0x43e7('0x3f')][_0x43e7('0x40')](getTags(_0x1d4589['Tags'],'name')),'description':intUtil[_0x43e7('0x3a')](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a'),'_links':{'assigned_user':{'href':util[_0x43e7('0x16')](_0x43e7('0x42'),_0x1b1440['id']),'class':_0x43e7('0x43')}},'message':{'direction':'in','body':intUtil['getString'](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a')}},getCustomFields(_0x1d4589[_0x43e7('0x44')],_0x2ffd43));return request({'uri':util['format'](_0x43e7('0x45'),_0x16cdba['remoteUri'],_0x1ed538['id']),'method':_0x43e7('0x27'),'body':_0x2b0ffe});}exports['queue']=function(_0x3d81ae,_0x3b4235,_0x3a5807,_0x1c2c6b,_0x49b866,_0x47d6a1){var _0x103393,_0x40c509;_0x47d6a1[_0x43e7('0x14')]=intUtil[_0x43e7('0x46')](_0x47d6a1['remoteUri']);_0x47d6a1['serverUrl']=intUtil['stripTrailingSlash'](_0x47d6a1[_0x43e7('0x47')]);if(_0x49b866&&_0x49b866['monitor_format']){logger[_0x43e7('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3b4235[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x47d6a1[_0x43e7('0x47')],_0x3b4235[_0x43e7('0x4a')],md5(_0x3b4235[_0x43e7('0x4a')]));}else{_0x3b4235['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x47d6a1);return getUser(_0x47d6a1,_0x1c2c6b[_0x43e7('0x4c')])[_0x43e7('0xe')](function(_0x1fd277){_0x103393=_0x1fd277;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x103393['id']);return getEndUser(_0x47d6a1,_0x3b4235['calleridname'],_0x3b4235['calleridnum']);})[_0x43e7('0xe')](function(_0x36a09e){_0x40c509=_0x36a09e;logger[_0x43e7('0xb')]('The\x20Enduser\x20ID\x20is:',_0x40c509['id']);return getTicket(_0x47d6a1,_0x103393,_0x40c509,_0x3a5807,_0x3b4235);})['then'](function(_0x56489b){if(_0x56489b){logger[_0x43e7('0xb')](_0x43e7('0x4e'));logger['info'](_0x43e7('0x4f'),_0x56489b['id']);switch(_0x47d6a1[_0x43e7('0x2d')]){case _0x43e7('0x50'):logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0x43e7('0x51'),_0x1c2c6b[_0x43e7('0x35')]),'trigger:desk:display',{'recordId':_0x56489b['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')](_0x43e7('0x53'),_0x43e7('0x54'));emit(util['format'](_0x43e7('0x51'),_0x1c2c6b['name']),'trigger:browser:url',{'uri':util[_0x43e7('0x16')](_0x43e7('0x55'),_0x56489b['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x53'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x1cd87c){console[_0x43e7('0x56')](_0x1cd87c);logger[_0x43e7('0x56')](_0x43e7('0x53'),JSON['stringify'](_0x1cd87c));});};exports[_0x43e7('0x59')]=function(_0x46c910,_0x499c03,_0x39e3ca,_0x4e6f6d,_0x35b799,_0x520857,_0x34e2ec){var _0x1f561f,_0xfe13fa;_0x520857['remoteUri']=intUtil['stripTrailingSlash'](_0x520857[_0x43e7('0x14')]);_0x520857[_0x43e7('0x47')]=intUtil[_0x43e7('0x46')](_0x520857[_0x43e7('0x47')]);if(_0x34e2ec&&_0x34e2ec[_0x43e7('0x5a')]&&_0x34e2ec[_0x43e7('0x5a')]!==_0x43e7('0x5b')){logger[_0x43e7('0xb')](_0x43e7('0x5c'),_0x43e7('0x5d'));_0x499c03[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x520857[_0x43e7('0x47')],_0x499c03['uniqueid'],md5(_0x499c03[_0x43e7('0x4a')]));}headers[_0x43e7('0x4b')]=getAuth(_0x520857);return getUser(_0x520857,_0x4e6f6d[_0x43e7('0x4c')])['then'](function(_0x5d63c6){_0x1f561f=_0x5d63c6;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x1f561f['id']);return getEndUser(_0x520857,_0x499c03['destcalleridname'],_0x499c03[_0x43e7('0x5e')]);})['then'](function(_0x49a6ce){_0xfe13fa=_0x49a6ce;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xfe13fa['id']);return getTicket(_0x520857,_0x1f561f,_0xfe13fa,_0x39e3ca,_0x499c03);})[_0x43e7('0xe')](function(_0x40155c){if(_0x40155c){logger[_0x43e7('0xb')]('Ticket\x20created!');logger[_0x43e7('0xb')](_0x43e7('0x4f'),_0x40155c['id']);switch(_0x520857['type']){case _0x43e7('0x50'):logger[_0x43e7('0xb')](_0x43e7('0x53'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format']('user:%s',_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x60'),{'recordId':_0x40155c['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x43e7('0x16')](_0x43e7('0x51'),_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x61'),{'uri':util['format'](_0x43e7('0x62'),_0x520857[_0x43e7('0x14')],_0x40155c['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x5c'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x4665db){logger[_0x43e7('0x56')](_0x43e7('0x5c'),JSON[_0x43e7('0x63')](_0x4665db));});};exports[_0x43e7('0x64')]=function(_0x57fdfe,_0x5f3824,_0x2b0711,_0x58a3a8,_0x501616,_0x50edb2){var _0xb3e981,_0xe666b0;_0x50edb2['remoteUri']=intUtil[_0x43e7('0x46')](_0x50edb2[_0x43e7('0x14')]);_0x50edb2[_0x43e7('0x47')]=intUtil['stripTrailingSlash'](_0x50edb2[_0x43e7('0x47')]);if(_0x501616&&_0x501616[_0x43e7('0x65')]){logger[_0x43e7('0xb')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',_0x43e7('0x5d'));_0x5f3824[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x50edb2[_0x43e7('0x47')],_0x5f3824[_0x43e7('0x4a')],md5(_0x5f3824['uniqueid']));}else{_0x5f3824['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x50edb2);return getUser(_0x50edb2)['then'](function(_0x5cb26e){_0xb3e981=_0x5cb26e;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0xb3e981['id']);return getEndUser(_0x50edb2,_0x5f3824['calleridname'],_0x5f3824[_0x43e7('0x68')]);})[_0x43e7('0xe')](function(_0x1e2fed){_0xe666b0=_0x1e2fed;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xe666b0['id']);return getTicket(_0x50edb2,_0xb3e981,_0xe666b0,_0x2b0711,_0x5f3824);})[_0x43e7('0xe')](function(_0x398a78){if(_0x398a78){logger['info'](_0x43e7('0x4e'));logger[_0x43e7('0xb')]('The\x20Ticket\x20ID\x20is:',_0x398a78['id']);}})[_0x43e7('0x58')](function(_0x5c2c5f){logger[_0x43e7('0x56')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',JSON[_0x43e7('0x63')](_0x5c2c5f));});}; \ 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 3dcc226..da656f7 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 _0x7edc=['[OUTBOUND]',']\x20The\x20User\x20email\x20is:','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','openNewTab','name',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','lodash','util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','socket.io-emitter','modernAuthentication','remoteUri','tenantId','CloudProvider','resolve','data5','POST','clientId','username','password','clientSecret','then','access_token','catch','toUpperCase',']\x20Wrong\x20credentials!','message','GET','Bearer\x20','4.0','value','isNil','validateEmail','email','userEmail','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','length','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','body','substring','lastIndexOf','enduserId','toLowerCase','telephone1','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','picklist','nameField','idField','indexOf','content','ticketType','incident','assign','Subjects','getString','Descriptions','/contacts(','Fields','phonecall','queue','callDirection','phonecalls','headers','odata-entityid','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','data7','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','none'];(function(_0x367f3c,_0x544617){var _0x2904cf=function(_0x22102f){while(--_0x22102f){_0x367f3c['push'](_0x367f3c['shift']());}};_0x2904cf(++_0x544617);}(_0x7edc,0x1c2));var _0xc7ed=function(_0x311666,_0x17b07d){_0x311666=_0x311666-0x0;var _0x2bc692=_0x7edc[_0x311666];return _0x2bc692;};'use strict';var _=require(_0xc7ed('0x0'));var rp=require('request-promise');var util=require(_0xc7ed('0x1'));var intUtil=require('./util');var md5=require(_0xc7ed('0x2'));var Redis=require(_0xc7ed('0x3'));var logger=require(_0xc7ed('0x4'))(_0xc7ed('0x5'));var config=require(_0xc7ed('0x6'));config[_0xc7ed('0x7')]=_[_0xc7ed('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xc7ed('0x9'))(new Redis(config['redis']));function getAuthToken(_0x157370,_0x2fcd5e,_0x54b9f8){if(_0x157370[_0xc7ed('0xa')]){_0x157370[_0xc7ed('0xb')]=_0x157370['CloudProvider']['data7'];_0x157370[_0xc7ed('0xc')]=_0x157370[_0xc7ed('0xd')]['data2'];return Promise[_0xc7ed('0xe')](_0x157370[_0xc7ed('0xd')][_0xc7ed('0xf')]);}var _0x598208={'method':_0xc7ed('0x10'),'uri':_0x2fcd5e,'form':{'client_id':_0x157370[_0xc7ed('0x11')],'resource':_0x157370['remoteUri'],'username':_0x157370[_0xc7ed('0x12')],'password':_0x157370['password'],'grant_type':_0xc7ed('0x13'),'client_secret':_0x157370[_0xc7ed('0x14')]},'json':!![]};return rp(_0x598208)[_0xc7ed('0x15')](function(_0x33d045){return _0x33d045[_0xc7ed('0x16')];})[_0xc7ed('0x17')](function(_0x789ecf){logger['error']('['+[_0x54b9f8[_0xc7ed('0x18')]()]+_0xc7ed('0x19'));return _0x789ecf[_0xc7ed('0x1a')];});}function getUser(_0x1bbb6e,_0x29c91f,_0x18eddd,_0x3f86ce,_0x5d4111,_0x2c6ec1){return new Promise(function(_0x1eec42,_0x55d548){return getAuthToken(_0x29c91f,_0x3f86ce,_0x2c6ec1)['then'](function(_0x536e4a){var _0x5f0105={'method':_0xc7ed('0x1b'),'uri':_0x5d4111+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0xc7ed('0x1c')+_0x536e4a,'OData-Version':_0xc7ed('0x1d')},'json':!![]};return rp(_0x5f0105);})[_0xc7ed('0x15')](function(_0x42ecc1){var _0x59c7af=_0x42ecc1[_0xc7ed('0x1e')];var _0x2929c7=![];var _0x390ab7=null;if(!_[_0xc7ed('0x1f')](_0x18eddd)){if(intUtil[_0xc7ed('0x20')](_0x18eddd[_0xc7ed('0x21')])){_0x1bbb6e[_0xc7ed('0x22')]=_0x18eddd[_0xc7ed('0x21')];for(_0x390ab7=0x0;_0x390ab7<_0x59c7af['length'];_0x390ab7++){if(_0x59c7af[_0x390ab7][_0xc7ed('0x23')]===_0x18eddd[_0xc7ed('0x21')]&&!_0x59c7af[_0x390ab7][_0xc7ed('0x24')]){_0x2929c7=!![];logger[_0xc7ed('0x25')]('['+[_0x2c6ec1[_0xc7ed('0x18')]()]+_0xc7ed('0x26')+_0x59c7af[_0x390ab7][_0xc7ed('0x27')]+'!');_0x1bbb6e[_0xc7ed('0x28')]=_0x59c7af[_0x390ab7][_0xc7ed('0x27')];}}}}if(!_0x2929c7){logger['info']('['+[_0x2c6ec1[_0xc7ed('0x18')]()]+_0xc7ed('0x29'));_0x1bbb6e[_0xc7ed('0x22')]=_0x29c91f[_0xc7ed('0x12')];for(_0x390ab7=0x0;_0x390ab7<_0x59c7af[_0xc7ed('0x2a')];_0x390ab7++){if(_0x59c7af[_0x390ab7][_0xc7ed('0x23')]===_0x29c91f[_0xc7ed('0x12')]){_0x1bbb6e[_0xc7ed('0x28')]=_0x59c7af[_0x390ab7][_0xc7ed('0x27')];}}}_0x1eec42(_0x1bbb6e);})[_0xc7ed('0x17')](function(_0x392ac7){_0x55d548(_0x392ac7[_0xc7ed('0x1a')]);});});}function createEndUser(_0x312ec3,_0x1b625a,_0x926e7c,_0x573b02,_0x13275d,_0x50d4a5,_0x5094f9){return new Promise(function(_0x2167fb,_0x4957c6){return getAuthToken(_0x1b625a,_0x926e7c,_0x50d4a5)[_0xc7ed('0x15')](function(_0x367533){var _0x590b8d=_0x50d4a5['toLowerCase']()===_0xc7ed('0x2b')?_0x13275d[_0xc7ed('0x2c')]:_0x13275d[_0xc7ed('0x2d')];var _0x329baf={'method':_0xc7ed('0x10'),'uri':_0x573b02+_0xc7ed('0x2e'),'body':{'fullname':_0x590b8d,'firstname':_0x590b8d,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xc7ed('0x2f')+_0x312ec3[_0xc7ed('0x28')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x367533,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};_0x329baf[_0xc7ed('0x30')][_0x5094f9]=_0x590b8d;return rp(_0x329baf);})[_0xc7ed('0x15')](function(_0x5d4c91){var _0x2b37a1=_0x5d4c91['headers']['odata-entityid'];var _0x599dee=_0x2b37a1[_0xc7ed('0x31')](_0x2b37a1[_0xc7ed('0x32')]('(')+0x1,_0x2b37a1[_0xc7ed('0x32')](')'));_0x312ec3[_0xc7ed('0x33')]=_0x599dee;_0x2167fb(_0x312ec3);})[_0xc7ed('0x17')](function(_0x23ca28){_0x4957c6(_0x23ca28[_0xc7ed('0x1a')]);});});}function getEndUser(_0x205b4b,_0x3aa1e3,_0x15fb39,_0x3932d8,_0x171ee1,_0x94cde8,_0x1d065c,_0x15aa49){var _0x195287=_0x94cde8[_0xc7ed('0x34')]()===_0xc7ed('0x2b')?_0x171ee1[_0xc7ed('0x2c')]:_0x171ee1[_0xc7ed('0x2d')];return getAuthToken(_0x3aa1e3,_0x15fb39,_0x94cde8)[_0xc7ed('0x15')](function(_0x3f56e0){_0x15aa49=_0x15aa49?_0x15aa49:_0xc7ed('0x35');var _0x27c82f={'method':'GET','uri':_0x3932d8+_0xc7ed('0x36')+_0x15aa49+_0xc7ed('0x37')+_0x15aa49+_0xc7ed('0x38')+_0x195287[_0xc7ed('0x39')]('+','%2b')+'\x27','headers':{'Authorization':_0xc7ed('0x1c')+_0x3f56e0,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x27c82f);})[_0xc7ed('0x15')](function(_0x5c1d53){var _0x47bd35=![];if(!_0x5c1d53)return _0x47bd35;var _0x31b875=_0x5c1d53['value'];for(var _0x5bb197=0x0;_0x5bb197<_0x31b875[_0xc7ed('0x2a')];_0x5bb197++){if(_0x31b875[_0x5bb197][_0x15aa49]===_0x195287){_0x47bd35=!![];_0x205b4b[_0xc7ed('0x33')]=_0x31b875[_0x5bb197]['contactid'];}}return _0x47bd35;})[_0xc7ed('0x15')](function(_0x56788c){if(_0x56788c)return _0x205b4b;if(_0x1d065c===_0xc7ed('0x3a')){logger[_0xc7ed('0x25')]('['+[_0x94cde8[_0xc7ed('0x18')]()]+_0xc7ed('0x3b'));return _0x205b4b;}return createEndUser(_0x205b4b,_0x3aa1e3,_0x15fb39,_0x3932d8,_0x171ee1,_0x94cde8,_0x15aa49)['then'](function(_0x26cbcc){logger[_0xc7ed('0x25')]('['+[_0x94cde8['toUpperCase']()]+_0xc7ed('0x3c'),_0x26cbcc[_0xc7ed('0x33')]);return _0x26cbcc;});});}function getCustomFields(_0x344a39,_0x4f5f90,_0x357d8e){var _0x2d6130={};if(_0x344a39[_0xc7ed('0x2a')]>0x0){_[_0xc7ed('0x3d')](_0x344a39,function(_0x389733){if(_[_0xc7ed('0x3e')](['string',_0xc7ed('0x3f')],_0x389733['type'])&&_0x389733[_0xc7ed('0x40')]&&!_0x389733['customField']){var _0x932c2d=_0x389733[_0xc7ed('0x41')][_0xc7ed('0x34')]();var _0x50aa9a=_0x932c2d['substring'](0x0,_0x932c2d['indexOf']('_'));var _0xbbdd5c=_0x932c2d[_0xc7ed('0x31')](_0x932c2d[_0xc7ed('0x42')]('_')+0x1);if(_0x50aa9a===_0x357d8e){_0x2d6130[_0xbbdd5c]=_0x389733[_0xc7ed('0x43')];}}});}return _0x2d6130;}function getTicket(_0x49a705,_0x3ccc2a,_0x2a3cce,_0xe9ae13,_0x5ee8ab,_0x19bff0,_0x452353){return new Promise(function(_0x22c27c,_0x54f6dd){var _0x42d5de;return getAuthToken(_0x3ccc2a,_0x2a3cce,_0x452353)[_0xc7ed('0x15')](function(_0x689eee){if(_0x19bff0[_0xc7ed('0x44')]===_0xc7ed('0x45')){_0x42d5de={'method':_0xc7ed('0x10'),'uri':_0xe9ae13+'incidents','body':Object[_0xc7ed('0x46')]({},{'title':intUtil['getString'](_0x19bff0[_0xc7ed('0x47')],_0x5ee8ab,'\x20'),'description':intUtil[_0xc7ed('0x48')](_0x19bff0[_0xc7ed('0x49')],_0x5ee8ab,'\x0a'),'customerid_contact@odata.bind':_0x49a705[_0xc7ed('0x33')]?_0xc7ed('0x4a')+_0x49a705[_0xc7ed('0x33')]+')':undefined,'ownerid@odata.bind':_0xc7ed('0x2f')+_0x49a705['userId']+')','caseorigincode':'1'},getCustomFields(_0x19bff0[_0xc7ed('0x4b')],_0x5ee8ab,_0x19bff0[_0xc7ed('0x44')])),'headers':{'Authorization':_0xc7ed('0x1c')+_0x689eee,'OData-Version':_0xc7ed('0x1d')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x19bff0[_0xc7ed('0x44')]===_0xc7ed('0x4c')){var _0x1f546c=_0x49a705['enduserId']?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x49a705['userId']+')','participationtypemask':_0x49a705['callDirection']===_0xc7ed('0x4d')?0x2:0x1},{'partyid_contact@odata.bind':_0xc7ed('0x4a')+_0x49a705['enduserId']+')','participationtypemask':_0x49a705[_0xc7ed('0x4e')]===_0xc7ed('0x4d')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xc7ed('0x2f')+_0x49a705[_0xc7ed('0x28')]+')','participationtypemask':_0x49a705['callDirection']===_0xc7ed('0x4d')?0x2:0x1}];_0x42d5de={'method':_0xc7ed('0x10'),'uri':_0xe9ae13+_0xc7ed('0x4f'),'body':Object[_0xc7ed('0x46')]({},{'subject':intUtil[_0xc7ed('0x48')](_0x19bff0[_0xc7ed('0x47')],_0x5ee8ab,'\x20'),'phonenumber':String(_0x5ee8ab[_0xc7ed('0x2d')]),'description':intUtil[_0xc7ed('0x48')](_0x19bff0[_0xc7ed('0x49')],_0x5ee8ab,'\x0a'),'regardingobjectid_contact@odata.bind':_0x49a705['enduserId']?_0xc7ed('0x4a')+_0x49a705[_0xc7ed('0x33')]+')':undefined,'ownerid@odata.bind':_0xc7ed('0x2f')+_0x49a705[_0xc7ed('0x28')]+')','directioncode':_0x49a705[_0xc7ed('0x4e')]===_0xc7ed('0x4d')?![]:!![],'phonecall_activity_parties':_0x1f546c},getCustomFields(_0x19bff0[_0xc7ed('0x4b')],_0x5ee8ab,_0x19bff0[_0xc7ed('0x44')])),'headers':{'Authorization':'Bearer\x20'+_0x689eee,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x42d5de);})[_0xc7ed('0x15')](function(_0x2d0700){var _0x15969e=_0x2d0700[_0xc7ed('0x50')][_0xc7ed('0x51')];var _0x5cb3a1=_0x15969e['substring'](_0x15969e[_0xc7ed('0x32')]('(')+0x1,_0x15969e[_0xc7ed('0x32')](')'));_0x49a705[_0xc7ed('0x52')]=_0x5cb3a1;_0x22c27c(_0x49a705);})[_0xc7ed('0x17')](function(_0x2a0ded){_0x54f6dd(_0x2a0ded[_0xc7ed('0x1a')]);});});}function emit(_0x369ab3,_0x541b7e,_0x25f4df,_0x1a0061){var _0x475c97={'uri':util[_0xc7ed('0x53')](_0xc7ed('0x54'),_0x369ab3,_0x25f4df,_0x1a0061)};io['to'](util[_0xc7ed('0x53')](_0xc7ed('0x55'),_0x541b7e))[_0xc7ed('0x56')](_0xc7ed('0x57'),_0x475c97);}exports['cs']=function(_0x4eb4ff,_0x187227,_0xf55059,_0x42aeb5,_0x5cb9fc,_0x40f6a8,_0x181ea0,_0x3c80fe){var _0x2fd105={};_0x40f6a8[_0xc7ed('0xb')]=_0x40f6a8[_0xc7ed('0xa')]?intUtil['stripTrailingSlash'](_0x40f6a8[_0xc7ed('0xd')][_0xc7ed('0x58')]):intUtil[_0xc7ed('0x59')](_0x40f6a8[_0xc7ed('0xb')]);_0x40f6a8[_0xc7ed('0x5a')]=intUtil['stripTrailingSlash'](_0x40f6a8[_0xc7ed('0x5a')]);_0x2fd105[_0xc7ed('0x4e')]=_0x3c80fe==='queue'||_0x3c80fe===_0xc7ed('0x5b')?_0xc7ed('0x4d'):_0xc7ed('0x2b');var _0x1d92f1=_0x40f6a8['modernAuthentication']?util[_0xc7ed('0x53')](_0xc7ed('0x5c'),_0x40f6a8[_0xc7ed('0xd')]['data7']):util['format'](_0xc7ed('0x5c'),_0x40f6a8['remoteUri']);var _0x58add3=util[_0xc7ed('0x53')](_0xc7ed('0x5d'),_0x40f6a8[_0xc7ed('0xc')]);var _0x4a9563=util[_0xc7ed('0x53')](_0xc7ed('0x5e'),_0x40f6a8[_0xc7ed('0x5a')],_0x187227[_0xc7ed('0x5f')],md5(_0x187227[_0xc7ed('0x5f')]));if(_0x5cb9fc&&_0x5cb9fc[_0xc7ed('0x60')]){logger[_0xc7ed('0x25')]('[QUEUE]',_0xc7ed('0x61'));_0x187227[_0xc7ed('0x62')]=_0x4a9563;}else if(_0x181ea0&&_0x181ea0['recordingFormat']&&_0x181ea0['recordingFormat']!==_0xc7ed('0x63')){logger[_0xc7ed('0x25')](_0xc7ed('0x64'),'Recording\x20is\x20enabled!');_0x187227['recordingURL']=_0x4a9563;}else{_0x187227[_0xc7ed('0x62')]='';}return getUser(_0x2fd105,_0x40f6a8,_0x42aeb5,_0x58add3,_0x1d92f1,_0x3c80fe)['then'](function(_0x27e303){logger[_0xc7ed('0x25')]('['+_0x3c80fe[_0xc7ed('0x18')]()+']\x20The\x20User\x20ID\x20is:',_0x27e303[_0xc7ed('0x28')]);logger['info']('['+_0x3c80fe[_0xc7ed('0x18')]()+_0xc7ed('0x65'),_0x27e303[_0xc7ed('0x22')]);return getEndUser(_0x27e303,_0x40f6a8,_0x58add3,_0x1d92f1,_0x187227,_0x3c80fe,_0xf55059[_0xc7ed('0x66')],_0xf55059['additionalSearchContact']);})['then'](function(_0x5e087b){logger['info']('['+_0x3c80fe[_0xc7ed('0x18')]()+_0xc7ed('0x67'),_0x5e087b[_0xc7ed('0x33')]);logger[_0xc7ed('0x25')]('['+_0x3c80fe[_0xc7ed('0x18')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x187227[_0xc7ed('0x2d')]);return getTicket(_0x5e087b,_0x40f6a8,_0x58add3,_0x1d92f1,_0x187227,_0xf55059,_0x3c80fe);})[_0xc7ed('0x15')](function(_0x1b931b){logger[_0xc7ed('0x25')](util['format']('['+_0x3c80fe[_0xc7ed('0x18')]()+_0xc7ed('0x68'),_0xf55059['ticketType'],_0x1b931b[_0xc7ed('0x52')]));logger[_0xc7ed('0x25')](util['format']('['+_0x3c80fe[_0xc7ed('0x18')]()+_0xc7ed('0x69'),_0x3c80fe));if(_0x3c80fe!==_0xc7ed('0x5b')&&_0xf55059[_0xc7ed('0x6a')]){logger[_0xc7ed('0x25')]('['+_0x3c80fe[_0xc7ed('0x18')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x40f6a8[_0xc7ed('0xb')],_0x42aeb5[_0xc7ed('0x6b')],_0xf55059[_0xc7ed('0x44')],_0x1b931b['ticketId']);}})['catch'](function(_0x502e56){logger['error']('['+_0x3c80fe[_0xc7ed('0x18')]()+_0xc7ed('0x6c'),_0x502e56[_0xc7ed('0x1a')]);console['error'](_0xc7ed('0x6d'),_0x502e56);});}; \ No newline at end of file +var _0xba9f=['type','nameField','idField','indexOf','ticketType','assign','getString','/contacts(','Fields','phonecall','callDirection','queue','Descriptions','headers','substring','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','trigger:browser:url','modernAuthentication','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none',']\x20The\x20User\x20ID\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','openNewTab','error',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','socket.io-emitter','remoteUri','data7','tenantId','data5','POST','clientId','password','access_token','catch','toUpperCase',']\x20Wrong\x20credentials!','message','GET','Bearer\x20','4.0','then','value','isNil','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','toLowerCase','outbound','calleridnum','/systemusers(','body','odata-entityid','lastIndexOf','destcalleridnum','telephone1','contacts?$select=','\x20eq\x20\x27','replace','%2b','enduserId','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','string','picklist'];(function(_0x11b6a8,_0x38b981){var _0x5537a9=function(_0x1f1699){while(--_0x1f1699){_0x11b6a8['push'](_0x11b6a8['shift']());}};_0x5537a9(++_0x38b981);}(_0xba9f,0x1bb));var _0xfba9=function(_0x49068f,_0x252a71){_0x49068f=_0x49068f-0x0;var _0x5a3090=_0xba9f[_0x49068f];return _0x5a3090;};'use strict';var _=require(_0xfba9('0x0'));var rp=require(_0xfba9('0x1'));var util=require('util');var intUtil=require('./util');var md5=require('md5');var Redis=require(_0xfba9('0x2'));var logger=require(_0xfba9('0x3'))(_0xfba9('0x4'));var config=require(_0xfba9('0x5'));config[_0xfba9('0x6')]=_['defaults'](config[_0xfba9('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xfba9('0x7'))(new Redis(config[_0xfba9('0x6')]));function getAuthToken(_0x4f3da3,_0x10ffa1,_0x59ec28){if(_0x4f3da3['modernAuthentication']){_0x4f3da3[_0xfba9('0x8')]=_0x4f3da3['CloudProvider'][_0xfba9('0x9')];_0x4f3da3[_0xfba9('0xa')]=_0x4f3da3['CloudProvider']['data2'];return Promise['resolve'](_0x4f3da3['CloudProvider'][_0xfba9('0xb')]);}var _0x26ba3d={'method':_0xfba9('0xc'),'uri':_0x10ffa1,'form':{'client_id':_0x4f3da3[_0xfba9('0xd')],'resource':_0x4f3da3['remoteUri'],'username':_0x4f3da3['username'],'password':_0x4f3da3['password'],'grant_type':_0xfba9('0xe'),'client_secret':_0x4f3da3['clientSecret']},'json':!![]};return rp(_0x26ba3d)['then'](function(_0x304f41){return _0x304f41[_0xfba9('0xf')];})[_0xfba9('0x10')](function(_0xa8bbb4){logger['error']('['+[_0x59ec28[_0xfba9('0x11')]()]+_0xfba9('0x12'));return _0xa8bbb4[_0xfba9('0x13')];});}function getUser(_0x173a2d,_0x2c50d0,_0x4f3231,_0x2e0847,_0x558306,_0x2359ab){return new Promise(function(_0x4dd508,_0x4d11b0){return getAuthToken(_0x2c50d0,_0x2e0847,_0x2359ab)['then'](function(_0x18464c){var _0x54e51c={'method':_0xfba9('0x14'),'uri':_0x558306+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0xfba9('0x15')+_0x18464c,'OData-Version':_0xfba9('0x16')},'json':!![]};return rp(_0x54e51c);})[_0xfba9('0x17')](function(_0x117b7f){var _0x1f0e98=_0x117b7f[_0xfba9('0x18')];var _0x16013b=![];var _0x4d75cb=null;if(!_[_0xfba9('0x19')](_0x4f3231)){if(intUtil[_0xfba9('0x1a')](_0x4f3231[_0xfba9('0x1b')])){_0x173a2d[_0xfba9('0x1c')]=_0x4f3231[_0xfba9('0x1b')];for(_0x4d75cb=0x0;_0x4d75cb<_0x1f0e98[_0xfba9('0x1d')];_0x4d75cb++){if(_0x1f0e98[_0x4d75cb][_0xfba9('0x1e')]===_0x4f3231[_0xfba9('0x1b')]&&!_0x1f0e98[_0x4d75cb][_0xfba9('0x1f')]){_0x16013b=!![];logger[_0xfba9('0x20')]('['+[_0x2359ab['toUpperCase']()]+']\x20Agent\x20found\x20'+_0x1f0e98[_0x4d75cb][_0xfba9('0x21')]+'!');_0x173a2d[_0xfba9('0x22')]=_0x1f0e98[_0x4d75cb][_0xfba9('0x21')];}}}}if(!_0x16013b){logger[_0xfba9('0x20')]('['+[_0x2359ab['toUpperCase']()]+_0xfba9('0x23'));_0x173a2d['userEmail']=_0x2c50d0[_0xfba9('0x24')];for(_0x4d75cb=0x0;_0x4d75cb<_0x1f0e98[_0xfba9('0x1d')];_0x4d75cb++){if(_0x1f0e98[_0x4d75cb][_0xfba9('0x1e')]===_0x2c50d0[_0xfba9('0x24')]){_0x173a2d[_0xfba9('0x22')]=_0x1f0e98[_0x4d75cb][_0xfba9('0x21')];}}}_0x4dd508(_0x173a2d);})[_0xfba9('0x10')](function(_0x19234d){_0x4d11b0(_0x19234d[_0xfba9('0x13')]);});});}function createEndUser(_0x42b446,_0x34c2a6,_0x479f7c,_0x54b405,_0x24da74,_0x48bd35,_0x2dca3a){return new Promise(function(_0x238ddb,_0x16b76a){return getAuthToken(_0x34c2a6,_0x479f7c,_0x48bd35)[_0xfba9('0x17')](function(_0x34c43e){var _0xa3746c=_0x48bd35[_0xfba9('0x25')]()===_0xfba9('0x26')?_0x24da74['destcalleridnum']:_0x24da74[_0xfba9('0x27')];var _0xca4505={'method':_0xfba9('0xc'),'uri':_0x54b405+'contacts','body':{'fullname':_0xa3746c,'firstname':_0xa3746c,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xfba9('0x28')+_0x42b446[_0xfba9('0x22')]+')'},'headers':{'Authorization':_0xfba9('0x15')+_0x34c43e,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};_0xca4505[_0xfba9('0x29')][_0x2dca3a]=_0xa3746c;return rp(_0xca4505);})[_0xfba9('0x17')](function(_0xa165e0){var _0x36c13a=_0xa165e0['headers'][_0xfba9('0x2a')];var _0x10a7b1=_0x36c13a['substring'](_0x36c13a[_0xfba9('0x2b')]('(')+0x1,_0x36c13a[_0xfba9('0x2b')](')'));_0x42b446['enduserId']=_0x10a7b1;_0x238ddb(_0x42b446);})[_0xfba9('0x10')](function(_0x51778f){_0x16b76a(_0x51778f['message']);});});}function getEndUser(_0x18622c,_0x1edb73,_0x48437c,_0x3417c8,_0xceb13e,_0x3499b3,_0x1fe647,_0x1d9526){var _0x520d45=_0x3499b3[_0xfba9('0x25')]()===_0xfba9('0x26')?_0xceb13e[_0xfba9('0x2c')]:_0xceb13e[_0xfba9('0x27')];return getAuthToken(_0x1edb73,_0x48437c,_0x3499b3)['then'](function(_0x481182){_0x1d9526=_0x1d9526?_0x1d9526:_0xfba9('0x2d');var _0x27cae8={'method':_0xfba9('0x14'),'uri':_0x3417c8+_0xfba9('0x2e')+_0x1d9526+'&$filter='+_0x1d9526+_0xfba9('0x2f')+_0x520d45[_0xfba9('0x30')]('+',_0xfba9('0x31'))+'\x27','headers':{'Authorization':_0xfba9('0x15')+_0x481182,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x27cae8);})[_0xfba9('0x17')](function(_0x969482){var _0x1fffb1=![];if(!_0x969482)return _0x1fffb1;var _0x3f6bf4=_0x969482[_0xfba9('0x18')];for(var _0xa56f9e=0x0;_0xa56f9e<_0x3f6bf4['length'];_0xa56f9e++){if(_0x3f6bf4[_0xa56f9e][_0x1d9526]===_0x520d45){_0x1fffb1=!![];_0x18622c[_0xfba9('0x32')]=_0x3f6bf4[_0xa56f9e]['contactid'];}}return _0x1fffb1;})[_0xfba9('0x17')](function(_0x24b9f6){if(_0x24b9f6)return _0x18622c;if(_0x1fe647===_0xfba9('0x33')){logger[_0xfba9('0x20')]('['+[_0x3499b3['toUpperCase']()]+_0xfba9('0x34'));return _0x18622c;}return createEndUser(_0x18622c,_0x1edb73,_0x48437c,_0x3417c8,_0xceb13e,_0x3499b3,_0x1d9526)[_0xfba9('0x17')](function(_0x1e3364){logger[_0xfba9('0x20')]('['+[_0x3499b3['toUpperCase']()]+_0xfba9('0x35'),_0x1e3364[_0xfba9('0x32')]);return _0x1e3364;});});}function getCustomFields(_0x222048,_0x3b613f,_0x142884){var _0x3d1f56={};if(_0x222048[_0xfba9('0x1d')]>0x0){_[_0xfba9('0x36')](_0x222048,function(_0x38aece){if(_['includes']([_0xfba9('0x37'),_0xfba9('0x38')],_0x38aece[_0xfba9('0x39')])&&_0x38aece[_0xfba9('0x3a')]&&!_0x38aece['customField']){var _0x3531a6=_0x38aece[_0xfba9('0x3b')]['toLowerCase']();var _0x14833e=_0x3531a6['substring'](0x0,_0x3531a6[_0xfba9('0x3c')]('_'));var _0x298a19=_0x3531a6['substring'](_0x3531a6[_0xfba9('0x3c')]('_')+0x1);if(_0x14833e===_0x142884){_0x3d1f56[_0x298a19]=_0x38aece['content'];}}});}return _0x3d1f56;}function getTicket(_0x2c427f,_0xa3cb0d,_0x9b7847,_0x111e25,_0x510024,_0x5f48cd,_0x24c0b9){return new Promise(function(_0x56a57f,_0x1c6751){var _0xc6b66d;return getAuthToken(_0xa3cb0d,_0x9b7847,_0x24c0b9)['then'](function(_0x1810be){if(_0x5f48cd[_0xfba9('0x3d')]==='incident'){_0xc6b66d={'method':_0xfba9('0xc'),'uri':_0x111e25+'incidents','body':Object[_0xfba9('0x3e')]({},{'title':intUtil[_0xfba9('0x3f')](_0x5f48cd['Subjects'],_0x510024,'\x20'),'description':intUtil['getString'](_0x5f48cd['Descriptions'],_0x510024,'\x0a'),'customerid_contact@odata.bind':_0x2c427f[_0xfba9('0x32')]?_0xfba9('0x40')+_0x2c427f[_0xfba9('0x32')]+')':undefined,'ownerid@odata.bind':_0xfba9('0x28')+_0x2c427f[_0xfba9('0x22')]+')','caseorigincode':'1'},getCustomFields(_0x5f48cd[_0xfba9('0x41')],_0x510024,_0x5f48cd[_0xfba9('0x3d')])),'headers':{'Authorization':_0xfba9('0x15')+_0x1810be,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x5f48cd[_0xfba9('0x3d')]===_0xfba9('0x42')){var _0x4e87d4=_0x2c427f['enduserId']?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x2c427f[_0xfba9('0x22')]+')','participationtypemask':_0x2c427f[_0xfba9('0x43')]===_0xfba9('0x44')?0x2:0x1},{'partyid_contact@odata.bind':_0xfba9('0x40')+_0x2c427f['enduserId']+')','participationtypemask':_0x2c427f[_0xfba9('0x43')]==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xfba9('0x28')+_0x2c427f[_0xfba9('0x22')]+')','participationtypemask':_0x2c427f[_0xfba9('0x43')]===_0xfba9('0x44')?0x2:0x1}];_0xc6b66d={'method':_0xfba9('0xc'),'uri':_0x111e25+'phonecalls','body':Object['assign']({},{'subject':intUtil[_0xfba9('0x3f')](_0x5f48cd['Subjects'],_0x510024,'\x20'),'phonenumber':String(_0x510024[_0xfba9('0x27')]),'description':intUtil[_0xfba9('0x3f')](_0x5f48cd[_0xfba9('0x45')],_0x510024,'\x0a'),'regardingobjectid_contact@odata.bind':_0x2c427f[_0xfba9('0x32')]?_0xfba9('0x40')+_0x2c427f[_0xfba9('0x32')]+')':undefined,'ownerid@odata.bind':_0xfba9('0x28')+_0x2c427f['userId']+')','directioncode':_0x2c427f['callDirection']===_0xfba9('0x44')?![]:!![],'phonecall_activity_parties':_0x4e87d4},getCustomFields(_0x5f48cd[_0xfba9('0x41')],_0x510024,_0x5f48cd[_0xfba9('0x3d')])),'headers':{'Authorization':_0xfba9('0x15')+_0x1810be,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0xc6b66d);})[_0xfba9('0x17')](function(_0xbb9039){var _0x270ee7=_0xbb9039[_0xfba9('0x46')][_0xfba9('0x2a')];var _0x39267a=_0x270ee7[_0xfba9('0x47')](_0x270ee7[_0xfba9('0x2b')]('(')+0x1,_0x270ee7['lastIndexOf'](')'));_0x2c427f[_0xfba9('0x48')]=_0x39267a;_0x56a57f(_0x2c427f);})[_0xfba9('0x10')](function(_0x29792d){_0x1c6751(_0x29792d[_0xfba9('0x13')]);});});}function emit(_0x5d3e72,_0x40c8c3,_0x40a78e,_0xd6b29d){var _0x2fa671={'uri':util[_0xfba9('0x49')](_0xfba9('0x4a'),_0x5d3e72,_0x40a78e,_0xd6b29d)};io['to'](util[_0xfba9('0x49')](_0xfba9('0x4b'),_0x40c8c3))['emit'](_0xfba9('0x4c'),_0x2fa671);}exports['cs']=function(_0x36d7d2,_0x439104,_0x1f672c,_0x5b32a4,_0x2af7fb,_0xf2bec6,_0x281a97,_0x2733c8){var _0x346e9a={};_0xf2bec6[_0xfba9('0x8')]=_0xf2bec6[_0xfba9('0x4d')]?intUtil[_0xfba9('0x4e')](_0xf2bec6['CloudProvider'][_0xfba9('0x9')]):intUtil[_0xfba9('0x4e')](_0xf2bec6['remoteUri']);_0xf2bec6['serverUrl']=intUtil[_0xfba9('0x4e')](_0xf2bec6[_0xfba9('0x4f')]);_0x346e9a['callDirection']=_0x2733c8===_0xfba9('0x44')||_0x2733c8===_0xfba9('0x50')?_0xfba9('0x44'):_0xfba9('0x26');var _0x301a77=_0xf2bec6[_0xfba9('0x4d')]?util[_0xfba9('0x49')](_0xfba9('0x51'),_0xf2bec6['CloudProvider']['data7']):util[_0xfba9('0x49')]('%s/api/data/v9.0/',_0xf2bec6[_0xfba9('0x8')]);var _0x5f1e27=util[_0xfba9('0x49')](_0xfba9('0x52'),_0xf2bec6[_0xfba9('0xa')]);var _0x48c9a2=util[_0xfba9('0x49')](_0xfba9('0x53'),_0xf2bec6[_0xfba9('0x4f')],_0x439104['uniqueid'],md5(_0x439104[_0xfba9('0x54')]));if(_0x2af7fb&&_0x2af7fb['monitor_format']){logger[_0xfba9('0x20')](_0xfba9('0x55'),_0xfba9('0x56'));_0x439104[_0xfba9('0x57')]=_0x48c9a2;}else if(_0x281a97&&_0x281a97[_0xfba9('0x58')]&&_0x281a97[_0xfba9('0x58')]!==_0xfba9('0x59')){logger[_0xfba9('0x20')]('[OUTBOUND]',_0xfba9('0x56'));_0x439104[_0xfba9('0x57')]=_0x48c9a2;}else{_0x439104[_0xfba9('0x57')]='';}return getUser(_0x346e9a,_0xf2bec6,_0x5b32a4,_0x5f1e27,_0x301a77,_0x2733c8)[_0xfba9('0x17')](function(_0x314e36){logger[_0xfba9('0x20')]('['+_0x2733c8[_0xfba9('0x11')]()+_0xfba9('0x5a'),_0x314e36['userId']);logger[_0xfba9('0x20')]('['+_0x2733c8[_0xfba9('0x11')]()+']\x20The\x20User\x20email\x20is:',_0x314e36['userEmail']);return getEndUser(_0x314e36,_0xf2bec6,_0x5f1e27,_0x301a77,_0x439104,_0x2733c8,_0x1f672c[_0xfba9('0x5b')],_0x1f672c[_0xfba9('0x5c')]);})[_0xfba9('0x17')](function(_0x43faed){logger['info']('['+_0x2733c8[_0xfba9('0x11')]()+_0xfba9('0x5d'),_0x43faed[_0xfba9('0x32')]);logger[_0xfba9('0x20')]('['+_0x2733c8[_0xfba9('0x11')]()+_0xfba9('0x5e'),_0x439104[_0xfba9('0x27')]);return getTicket(_0x43faed,_0xf2bec6,_0x5f1e27,_0x301a77,_0x439104,_0x1f672c,_0x2733c8);})[_0xfba9('0x17')](function(_0x27ae25){logger[_0xfba9('0x20')](util[_0xfba9('0x49')]('['+_0x2733c8['toUpperCase']()+_0xfba9('0x5f'),_0x1f672c[_0xfba9('0x3d')],_0x27ae25[_0xfba9('0x48')]));logger[_0xfba9('0x20')](util[_0xfba9('0x49')]('['+_0x2733c8[_0xfba9('0x11')]()+']\x20Call\x20direction:\x20%s',_0x2733c8));if(_0x2733c8!==_0xfba9('0x50')&&_0x1f672c[_0xfba9('0x60')]){logger[_0xfba9('0x20')]('['+_0x2733c8[_0xfba9('0x11')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0xf2bec6[_0xfba9('0x8')],_0x5b32a4['name'],_0x1f672c['ticketType'],_0x27ae25[_0xfba9('0x48')]);}})[_0xfba9('0x10')](function(_0x591211){logger[_0xfba9('0x61')]('['+_0x2733c8['toUpperCase']()+_0xfba9('0x62'),_0x591211[_0xfba9('0x13')]);console[_0xfba9('0x61')](_0xfba9('0x63'),_0x591211);});}; \ 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 4dabcf2..1998ac5 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 _0x652e=['Descriptions','
','Tags','name','Fields','custom_fields','keyBy','value','%s/api/v2/tickets','remoteUri','POST','validateEmail','then','length','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','base64','[HTTP]','stringify','GET','map','string','picklist','type','nameField','customField','toLowerCase','content','toString','includes','push','idField','variable','variableName','Variable','stripTrailingSlash','serverUrl','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridnum','The\x20Enduser\x20ID\x20is:','monitor_format','toUpperCase','lastevent','lodash','request-promise','md5','util','ioredis','../../../../config/environment','../../../../config/logger','freshdesk','defaults','redis','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','Subjects'];(function(_0x1a6ed3,_0x1b83cd){var _0x4e3251=function(_0x27f9c8){while(--_0x27f9c8){_0x1a6ed3['push'](_0x1a6ed3['shift']());}};_0x4e3251(++_0x1b83cd);}(_0x652e,0x1b7));var _0xe652=function(_0x53b3e2,_0x3e692f){_0x53b3e2=_0x53b3e2-0x0;var _0x2a0378=_0x652e[_0x53b3e2];return _0x2a0378;};'use strict';var _=require(_0xe652('0x0'));var rp=require(_0xe652('0x1'));var md5=require(_0xe652('0x2'));var util=require(_0xe652('0x3'));var Redis=require(_0xe652('0x4'));var intUtil=require('./util');var config=require(_0xe652('0x5'));var logger=require(_0xe652('0x6'))(_0xe652('0x7'));config['redis']=_[_0xe652('0x8')](config[_0xe652('0x9')],{'host':_0xe652('0xa'),'port':0x18eb});var io=require(_0xe652('0xb'))(new Redis(config[_0xe652('0x9')]));var headers={'Content-Type':_0xe652('0xc'),'Accept':_0xe652('0xc')};function emit(_0x449db2,_0x52b766,_0x46cd70){io['to'](_0x449db2)['emit'](_0x52b766,_0x46cd70);}function getTicket(_0x5d11e4,_0x394196,_0x245683,_0x370f35,_0x568660){logger[_0xe652('0xd')](_0xe652('0xe'));var _0x57fd98=_[_0xe652('0xf')]({'responder_id':_0x394196['id'],'requester_id':_0x245683['id'],'name':util[_0xe652('0x10')](_0xe652('0x11'),_0x568660[_0xe652('0x12')]),'phone':_0x568660[_0xe652('0x13')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x370f35[_0xe652('0x14')],_0x568660,'\x20'),'description':intUtil['getString'](_0x370f35[_0xe652('0x15')],_0x568660,_0xe652('0x16')),'tags':getTags(_0x370f35[_0xe652('0x17')],_0xe652('0x18'))},getCustomFields(_0x370f35[_0xe652('0x19')],_0x568660));_0x57fd98[_0xe652('0x1a')]=_['mapValues'](_[_0xe652('0x1b')](_0x57fd98['custom_fields'],'id'),_0xe652('0x1c'));return request({'uri':util[_0xe652('0x10')](_0xe652('0x1d'),_0x5d11e4[_0xe652('0x1e')]),'method':_0xe652('0x1f'),'body':_0x57fd98})['then'](function(_0xe9f084){logger[_0xe652('0xd')]('Ticket\x20created!');return _0xe9f084;});}function getUser(_0x5e1f3d,_0x32bf3c){if(intUtil[_0xe652('0x20')](_0x32bf3c)){return request({'uri':util[_0xe652('0x10')]('%s/api/v2/agents',_0x5e1f3d['remoteUri']),'qs':{'email':_0x32bf3c}})[_0xe652('0x21')](function(_0x11e723){if(_0x11e723[_0xe652('0x22')]){logger[_0xe652('0xd')]('Agent\x20found!');return _['find'](_0x11e723,function(_0x64be74){return _0x64be74[_0xe652('0x23')][_0xe652('0x24')]===_0x32bf3c;});}else{logger[_0xe652('0xd')](_0xe652('0x25'));return request({'uri':util[_0xe652('0x10')]('%s/api/v2/agents/me',_0x5e1f3d['remoteUri'])})['then'](function(_0x5c8ad3){logger[_0xe652('0xd')](_0xe652('0x26'));return _0x5c8ad3;});}});}else{logger['info'](_0xe652('0x27'));return request({'uri':util[_0xe652('0x10')](_0xe652('0x28'),_0x5e1f3d[_0xe652('0x1e')])})[_0xe652('0x21')](function(_0x50158c){logger[_0xe652('0xd')](_0xe652('0x26'));return _0x50158c;});}}function getEndUser(_0x14b580,_0x4b5787,_0x59e431){logger[_0xe652('0xd')](_0xe652('0x29'),_0x59e431);return request({'uri':util[_0xe652('0x10')](_0xe652('0x2a'),_0x14b580['remoteUri']),'qs':{'phone':_0x59e431}})[_0xe652('0x21')](function(_0x2be751){if(_0x2be751['length']){logger[_0xe652('0xd')]('Enduser\x20found!');return _['find'](_0x2be751,{'phone':_0x59e431});}else{logger[_0xe652('0xd')](_0xe652('0x2b'));return request({'uri':util[_0xe652('0x10')](_0xe652('0x2a'),_0x14b580[_0xe652('0x1e')]),'method':_0xe652('0x1f'),'body':{'name':_0x4b5787,'phone':_0x59e431}})[_0xe652('0x21')](function(_0x1c3b4d){logger['info'](_0xe652('0x2c'));return _0x1c3b4d;});}});}function getAuth(_0x26522b){return util[_0xe652('0x10')](_0xe652('0x2d'),new Buffer(_0x26522b[_0xe652('0x2e')]+':X')['toString'](_0xe652('0x2f')));}function request(_0x393470){logger['debug'](_0xe652('0x30'),JSON[_0xe652('0x31')](_0x393470));return rp(_[_0xe652('0x8')](_0x393470,{'method':_0xe652('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x478e00,_0x55d0aa){var _0x2553a6=[];if(_0x478e00&&_0x478e00['length']>0x0){_0x2553a6=_[_0xe652('0x33')](_0x478e00,_0x55d0aa);}return _0x2553a6;}function getCustomFields(_0x2a02c9,_0x932ebb){var _0x375240=[];var _0x3040dd={'custom_fields':[]};if(_0x2a02c9[_0xe652('0x22')]>0x0){_['forEach'](_0x2a02c9,function(_0xd26643){if(_['includes']([_0xe652('0x34'),_0xe652('0x35')],_0xd26643[_0xe652('0x36')])&&_0xd26643[_0xe652('0x37')]&&!_0xd26643[_0xe652('0x38')]){_0x3040dd[_0xd26643[_0xe652('0x37')][_0xe652('0x39')]()]=_0xd26643[_0xe652('0x3a')][_0xe652('0x3b')]();}else if(_[_0xe652('0x3c')](['string',_0xe652('0x35')],_0xd26643[_0xe652('0x36')])&&_0xd26643['idField']&&_0xd26643['customField']){_0x3040dd[_0xe652('0x1a')][_0xe652('0x3d')]({'id':_0xd26643[_0xe652('0x3e')],'value':_0xd26643[_0xe652('0x3a')][_0xe652('0x3b')]()});}else if(_0xd26643[_0xe652('0x36')]===_0xe652('0x3f')&&_0xd26643[_0xe652('0x40')]&&_0xd26643[_0xe652('0x3e')]&&_0xd26643[_0xe652('0x38')]){_0x932ebb[_0xd26643[_0xe652('0x40')]]&&_0x3040dd[_0xe652('0x1a')]['push']({'id':_0xd26643[_0xe652('0x3e')],'value':_0x932ebb[_0xd26643[_0xe652('0x40')]][_0xe652('0x3b')]()});}else if(_0xd26643['type']==='customVariable'&&_0xd26643[_0xe652('0x41')]&&_0xd26643[_0xe652('0x41')][_0xe652('0x18')]&&_0xd26643[_0xe652('0x3e')]&&_0xd26643[_0xe652('0x38')]){_0x932ebb[_0xd26643['Variable']['name']['toLowerCase']()]&&_0x3040dd[_0xe652('0x1a')][_0xe652('0x3d')]({'id':_0xd26643[_0xe652('0x3e')],'value':_0x932ebb[_0xd26643[_0xe652('0x41')][_0xe652('0x18')]['toLowerCase']()][_0xe652('0x3b')]()});}});}return _0x3040dd;}exports['queue']=function(_0x46a39c,_0x36b9ee,_0x1f31dd,_0x4e32f1,_0x1c07a1,_0x537d3d){var _0x27a570,_0x39ae7c;_0x537d3d['remoteUri']=intUtil[_0xe652('0x42')](_0x537d3d[_0xe652('0x1e')]);_0x537d3d[_0xe652('0x43')]=intUtil[_0xe652('0x42')](_0x537d3d[_0xe652('0x43')]);if(_0x1c07a1&&_0x1c07a1['monitor_format']){logger[_0xe652('0xd')](_0xe652('0x44'),'Recording\x20is\x20enabled!');_0x36b9ee[_0xe652('0x45')]=util[_0xe652('0x10')](_0xe652('0x46'),_0x537d3d['serverUrl'],_0x36b9ee[_0xe652('0x47')],md5(_0x36b9ee[_0xe652('0x47')]));}else{_0x36b9ee[_0xe652('0x45')]='';}headers[_0xe652('0x48')]=getAuth(_0x537d3d);return getUser(_0x537d3d,_0x4e32f1[_0xe652('0x24')])['then'](function(_0x70d798){_0x27a570=_0x70d798;logger['info'](_0xe652('0x49'),_0x27a570['id']);return getEndUser(_0x537d3d,_0x36b9ee['calleridname'],_0x36b9ee[_0xe652('0x13')]);})['then'](function(_0x3cce7f){_0x39ae7c=_0x3cce7f;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39ae7c['id']);return getTicket(_0x537d3d,_0x27a570,_0x39ae7c,_0x1f31dd,_0x36b9ee);})['then'](function(_0x1b4ace){if(_0x1b4ace&&_0x1b4ace['id']){logger['info'](_0xe652('0x4a'));logger[_0xe652('0xd')](_0xe652('0x4b'),_0x1b4ace['id']);logger[_0xe652('0xd')](_0xe652('0x44'),_0xe652('0x4c'));emit(util[_0xe652('0x10')](_0xe652('0x4d'),_0x4e32f1[_0xe652('0x18')]),_0xe652('0x4e'),{'uri':util[_0xe652('0x10')](_0xe652('0x4f'),_0x537d3d[_0xe652('0x1e')],_0x1b4ace['id'])});}})[_0xe652('0x50')](function(_0x1f0610){logger[_0xe652('0x51')](_0xe652('0x44'),JSON[_0xe652('0x31')](_0x1f0610));});};exports[_0xe652('0x52')]=function(_0x24f7b7,_0x501009,_0x711b34,_0x5d4e88,_0x21771f,_0x296dd2,_0x147997){var _0x2ec633,_0x38c603;_0x296dd2[_0xe652('0x1e')]=intUtil[_0xe652('0x42')](_0x296dd2[_0xe652('0x1e')]);_0x296dd2[_0xe652('0x43')]=intUtil['stripTrailingSlash'](_0x296dd2['serverUrl']);if(_0x147997&&_0x147997[_0xe652('0x53')]&&_0x147997[_0xe652('0x53')]!==_0xe652('0x54')){logger[_0xe652('0xd')](_0xe652('0x55'),_0xe652('0x56'));_0x501009[_0xe652('0x45')]=util['format'](_0xe652('0x46'),_0x296dd2[_0xe652('0x43')],_0x501009[_0xe652('0x47')],md5(_0x501009[_0xe652('0x47')]));}headers[_0xe652('0x48')]=getAuth(_0x296dd2);return getUser(_0x296dd2,_0x5d4e88[_0xe652('0x24')])['then'](function(_0x2c574b){_0x2ec633=_0x2c574b;logger[_0xe652('0xd')](_0xe652('0x49'),_0x2ec633['id']);return getEndUser(_0x296dd2,_0x501009['destcalleridname'],_0x501009[_0xe652('0x57')]);})[_0xe652('0x21')](function(_0x575e1d){_0x38c603=_0x575e1d;logger[_0xe652('0xd')](_0xe652('0x58'),_0x38c603['id']);return getTicket(_0x296dd2,_0x2ec633,_0x38c603,_0x711b34,_0x501009);})[_0xe652('0x21')](function(_0x33ed9b){if(_0x33ed9b&&_0x33ed9b['id']){logger[_0xe652('0xd')](_0xe652('0x4a'));logger[_0xe652('0xd')](_0xe652('0x4b'),_0x33ed9b['id']);logger['info'](_0xe652('0x55'),_0xe652('0x4c'));emit(util[_0xe652('0x10')](_0xe652('0x4d'),_0x5d4e88['name']),_0xe652('0x4e'),{'uri':util[_0xe652('0x10')]('%s/helpdesk/tickets/%d',_0x296dd2['remoteUri'],_0x33ed9b['id'])});}})[_0xe652('0x50')](function(_0x5afb2d){logger[_0xe652('0x51')](_0xe652('0x55'),JSON['stringify'](_0x5afb2d));});};exports['unmanaged']=function(_0x3b01f0,_0x32dcb5,_0x281ae6,_0x4acfd3,_0x47f9f9,_0x465edd){var _0x571160,_0x3dfde9;_0x465edd[_0xe652('0x1e')]=intUtil[_0xe652('0x42')](_0x465edd[_0xe652('0x1e')]);_0x465edd[_0xe652('0x43')]=intUtil['stripTrailingSlash'](_0x465edd[_0xe652('0x43')]);if(_0x47f9f9&&_0x47f9f9[_0xe652('0x59')]){logger[_0xe652('0xd')]('['+_0x32dcb5['lastevent'][_0xe652('0x5a')]()+']',_0xe652('0x56'));_0x32dcb5[_0xe652('0x45')]=util['format'](_0xe652('0x46'),_0x465edd[_0xe652('0x43')],_0x32dcb5['uniqueid'],md5(_0x32dcb5['uniqueid']));}else{_0x32dcb5['recordingURL']='';}headers['Authorization']=getAuth(_0x465edd);return getUser(_0x465edd,'')['then'](function(_0x350f09){_0x571160=_0x350f09;logger[_0xe652('0xd')](_0xe652('0x49'),_0x571160['id']);return getEndUser(_0x465edd,_0x32dcb5[_0xe652('0x12')],_0x32dcb5[_0xe652('0x13')]);})[_0xe652('0x21')](function(_0x4848f2){_0x3dfde9=_0x4848f2;logger[_0xe652('0xd')](_0xe652('0x58'),_0x3dfde9['id']);return getTicket(_0x465edd,_0x571160,_0x3dfde9,_0x281ae6,_0x32dcb5);})['then'](function(_0x3923c2){if(_0x3923c2){logger[_0xe652('0xd')]('Ticket\x20created!');logger[_0xe652('0xd')](_0xe652('0x4b'),_0x3923c2['id']);}})['catch'](function(_0x3723b7){logger['error']('['+_0x32dcb5[_0xe652('0x5b')]['toUpperCase']()+']',JSON[_0xe652('0x31')](_0x3723b7));});}; \ No newline at end of file +var _0x67ef=['push','content','variableName','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','unmanaged','monitor_format','lastevent','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','format','Caller\x20-\x20%s','Subjects','getString','Descriptions','name','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','length','find','contact','email','%s/api/v2/agents/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','stringify','GET','map','forEach','picklist','type','nameField','customField','includes','string','idField'];(function(_0x2b8a96,_0x30d1c6){var _0x319d3d=function(_0x2b9311){while(--_0x2b9311){_0x2b8a96['push'](_0x2b8a96['shift']());}};_0x319d3d(++_0x30d1c6);}(_0x67ef,0x7f));var _0xf67e=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x67ef[_0x12fc8d];return _0x3f9d04;};'use strict';var _=require(_0xf67e('0x0'));var rp=require(_0xf67e('0x1'));var md5=require(_0xf67e('0x2'));var util=require(_0xf67e('0x3'));var Redis=require(_0xf67e('0x4'));var intUtil=require(_0xf67e('0x5'));var config=require('../../../../config/environment');var logger=require(_0xf67e('0x6'))('freshdesk');config[_0xf67e('0x7')]=_[_0xf67e('0x8')](config[_0xf67e('0x7')],{'host':_0xf67e('0x9'),'port':0x18eb});var io=require(_0xf67e('0xa'))(new Redis(config[_0xf67e('0x7')]));var headers={'Content-Type':_0xf67e('0xb'),'Accept':_0xf67e('0xb')};function emit(_0x4cec71,_0x5e6d9b,_0xb2be5a){io['to'](_0x4cec71)['emit'](_0x5e6d9b,_0xb2be5a);}function getTicket(_0x22a1bc,_0x3bd3b6,_0x4f137e,_0x3d821f,_0xd9d94a){logger[_0xf67e('0xc')](_0xf67e('0xd'));var _0x28fd9b=_['merge']({'responder_id':_0x3bd3b6['id'],'requester_id':_0x4f137e['id'],'name':util[_0xf67e('0xe')](_0xf67e('0xf'),_0xd9d94a['calleridname']),'phone':_0xd9d94a['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x3d821f[_0xf67e('0x10')],_0xd9d94a,'\x20'),'description':intUtil[_0xf67e('0x11')](_0x3d821f[_0xf67e('0x12')],_0xd9d94a,'
'),'tags':getTags(_0x3d821f['Tags'],_0xf67e('0x13'))},getCustomFields(_0x3d821f[_0xf67e('0x14')],_0xd9d94a));_0x28fd9b[_0xf67e('0x15')]=_[_0xf67e('0x16')](_[_0xf67e('0x17')](_0x28fd9b[_0xf67e('0x15')],'id'),_0xf67e('0x18'));return request({'uri':util[_0xf67e('0xe')](_0xf67e('0x19'),_0x22a1bc[_0xf67e('0x1a')]),'method':_0xf67e('0x1b'),'body':_0x28fd9b})[_0xf67e('0x1c')](function(_0x297fa1){logger[_0xf67e('0xc')](_0xf67e('0x1d'));return _0x297fa1;});}function getUser(_0x5425f4,_0x444e12){if(intUtil[_0xf67e('0x1e')](_0x444e12)){return request({'uri':util[_0xf67e('0xe')]('%s/api/v2/agents',_0x5425f4[_0xf67e('0x1a')]),'qs':{'email':_0x444e12}})[_0xf67e('0x1c')](function(_0x4cd61e){if(_0x4cd61e[_0xf67e('0x1f')]){logger['info']('Agent\x20found!');return _[_0xf67e('0x20')](_0x4cd61e,function(_0x54d98e){return _0x54d98e[_0xf67e('0x21')][_0xf67e('0x22')]===_0x444e12;});}else{logger[_0xf67e('0xc')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xf67e('0xe')](_0xf67e('0x23'),_0x5425f4[_0xf67e('0x1a')])})[_0xf67e('0x1c')](function(_0x4e1dbf){logger[_0xf67e('0xc')]('Admin\x20account\x20selected.');return _0x4e1dbf;});}});}else{logger['info'](_0xf67e('0x24'));return request({'uri':util[_0xf67e('0xe')](_0xf67e('0x23'),_0x5425f4[_0xf67e('0x1a')])})[_0xf67e('0x1c')](function(_0x11bc50){logger[_0xf67e('0xc')](_0xf67e('0x25'));return _0x11bc50;});}}function getEndUser(_0x265b5c,_0x34e418,_0x1dd200){logger[_0xf67e('0xc')]('Searching\x20enduser\x20with\x20phone',_0x1dd200);return request({'uri':util['format'](_0xf67e('0x26'),_0x265b5c[_0xf67e('0x1a')]),'qs':{'phone':_0x1dd200}})[_0xf67e('0x1c')](function(_0xc31bdc){if(_0xc31bdc[_0xf67e('0x1f')]){logger[_0xf67e('0xc')](_0xf67e('0x27'));return _['find'](_0xc31bdc,{'phone':_0x1dd200});}else{logger[_0xf67e('0xc')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format'](_0xf67e('0x26'),_0x265b5c[_0xf67e('0x1a')]),'method':_0xf67e('0x1b'),'body':{'name':_0x34e418,'phone':_0x1dd200}})[_0xf67e('0x1c')](function(_0x426a53){logger['info'](_0xf67e('0x28'));return _0x426a53;});}});}function getAuth(_0x40d9ca){return util[_0xf67e('0xe')](_0xf67e('0x29'),new Buffer(_0x40d9ca[_0xf67e('0x2a')]+':X')[_0xf67e('0x2b')](_0xf67e('0x2c')));}function request(_0x357d75){logger[_0xf67e('0x2d')]('[HTTP]',JSON[_0xf67e('0x2e')](_0x357d75));return rp(_[_0xf67e('0x8')](_0x357d75,{'method':_0xf67e('0x2f'),'headers':headers,'json':!![]}));}function getTags(_0x1b410d,_0x1b4847){var _0x1f8d9e=[];if(_0x1b410d&&_0x1b410d[_0xf67e('0x1f')]>0x0){_0x1f8d9e=_[_0xf67e('0x30')](_0x1b410d,_0x1b4847);}return _0x1f8d9e;}function getCustomFields(_0x241ff5,_0x5d3265){var _0x36d9b6=[];var _0x449de3={'custom_fields':[]};if(_0x241ff5[_0xf67e('0x1f')]>0x0){_[_0xf67e('0x31')](_0x241ff5,function(_0x35973a){if(_['includes'](['string',_0xf67e('0x32')],_0x35973a[_0xf67e('0x33')])&&_0x35973a[_0xf67e('0x34')]&&!_0x35973a[_0xf67e('0x35')]){_0x449de3[_0x35973a['nameField']['toLowerCase']()]=_0x35973a['content']['toString']();}else if(_[_0xf67e('0x36')]([_0xf67e('0x37'),_0xf67e('0x32')],_0x35973a['type'])&&_0x35973a[_0xf67e('0x38')]&&_0x35973a[_0xf67e('0x35')]){_0x449de3[_0xf67e('0x15')][_0xf67e('0x39')]({'id':_0x35973a['idField'],'value':_0x35973a[_0xf67e('0x3a')]['toString']()});}else if(_0x35973a[_0xf67e('0x33')]==='variable'&&_0x35973a[_0xf67e('0x3b')]&&_0x35973a[_0xf67e('0x38')]&&_0x35973a['customField']){_0x5d3265[_0x35973a[_0xf67e('0x3b')]]&&_0x449de3[_0xf67e('0x15')][_0xf67e('0x39')]({'id':_0x35973a['idField'],'value':_0x5d3265[_0x35973a[_0xf67e('0x3b')]][_0xf67e('0x2b')]()});}else if(_0x35973a['type']===_0xf67e('0x3c')&&_0x35973a['Variable']&&_0x35973a['Variable']['name']&&_0x35973a[_0xf67e('0x38')]&&_0x35973a[_0xf67e('0x35')]){_0x5d3265[_0x35973a[_0xf67e('0x3d')][_0xf67e('0x13')][_0xf67e('0x3e')]()]&&_0x449de3[_0xf67e('0x15')][_0xf67e('0x39')]({'id':_0x35973a[_0xf67e('0x38')],'value':_0x5d3265[_0x35973a[_0xf67e('0x3d')][_0xf67e('0x13')]['toLowerCase']()][_0xf67e('0x2b')]()});}});}return _0x449de3;}exports[_0xf67e('0x3f')]=function(_0x3d0395,_0x44fcdf,_0x3b13dd,_0xa8c3df,_0x2af6fa,_0x3fff98){var _0x55c0e0,_0x5322b2;_0x3fff98['remoteUri']=intUtil[_0xf67e('0x40')](_0x3fff98[_0xf67e('0x1a')]);_0x3fff98[_0xf67e('0x41')]=intUtil[_0xf67e('0x40')](_0x3fff98[_0xf67e('0x41')]);if(_0x2af6fa&&_0x2af6fa['monitor_format']){logger[_0xf67e('0xc')](_0xf67e('0x42'),_0xf67e('0x43'));_0x44fcdf[_0xf67e('0x44')]=util[_0xf67e('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3fff98[_0xf67e('0x41')],_0x44fcdf['uniqueid'],md5(_0x44fcdf[_0xf67e('0x45')]));}else{_0x44fcdf[_0xf67e('0x44')]='';}headers[_0xf67e('0x46')]=getAuth(_0x3fff98);return getUser(_0x3fff98,_0xa8c3df[_0xf67e('0x22')])[_0xf67e('0x1c')](function(_0x521c32){_0x55c0e0=_0x521c32;logger[_0xf67e('0xc')](_0xf67e('0x47'),_0x55c0e0['id']);return getEndUser(_0x3fff98,_0x44fcdf[_0xf67e('0x48')],_0x44fcdf[_0xf67e('0x49')]);})[_0xf67e('0x1c')](function(_0x948459){_0x5322b2=_0x948459;logger[_0xf67e('0xc')](_0xf67e('0x4a'),_0x5322b2['id']);return getTicket(_0x3fff98,_0x55c0e0,_0x5322b2,_0x3b13dd,_0x44fcdf);})[_0xf67e('0x1c')](function(_0x29e7c2){if(_0x29e7c2&&_0x29e7c2['id']){logger[_0xf67e('0xc')](_0xf67e('0x1d'));logger[_0xf67e('0xc')]('The\x20Ticket\x20ID\x20is:',_0x29e7c2['id']);logger['info'](_0xf67e('0x42'),_0xf67e('0x4b'));emit(util[_0xf67e('0xe')](_0xf67e('0x4c'),_0xa8c3df[_0xf67e('0x13')]),_0xf67e('0x4d'),{'uri':util[_0xf67e('0xe')](_0xf67e('0x4e'),_0x3fff98['remoteUri'],_0x29e7c2['id'])});}})[_0xf67e('0x4f')](function(_0x4fe6cd){logger[_0xf67e('0x50')](_0xf67e('0x42'),JSON[_0xf67e('0x2e')](_0x4fe6cd));});};exports[_0xf67e('0x51')]=function(_0x5a225c,_0x389853,_0x79cae4,_0x19fd67,_0x260ab4,_0x4be977,_0x4abeba){var _0x493422,_0x4104a2;_0x4be977[_0xf67e('0x1a')]=intUtil[_0xf67e('0x40')](_0x4be977['remoteUri']);_0x4be977[_0xf67e('0x41')]=intUtil[_0xf67e('0x40')](_0x4be977['serverUrl']);if(_0x4abeba&&_0x4abeba['recordingFormat']&&_0x4abeba['recordingFormat']!==_0xf67e('0x52')){logger['info'](_0xf67e('0x53'),_0xf67e('0x43'));_0x389853[_0xf67e('0x44')]=util[_0xf67e('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4be977[_0xf67e('0x41')],_0x389853[_0xf67e('0x45')],md5(_0x389853['uniqueid']));}headers[_0xf67e('0x46')]=getAuth(_0x4be977);return getUser(_0x4be977,_0x19fd67[_0xf67e('0x22')])[_0xf67e('0x1c')](function(_0x43037a){_0x493422=_0x43037a;logger[_0xf67e('0xc')](_0xf67e('0x47'),_0x493422['id']);return getEndUser(_0x4be977,_0x389853[_0xf67e('0x54')],_0x389853[_0xf67e('0x55')]);})[_0xf67e('0x1c')](function(_0x5a1752){_0x4104a2=_0x5a1752;logger['info']('The\x20Enduser\x20ID\x20is:',_0x4104a2['id']);return getTicket(_0x4be977,_0x493422,_0x4104a2,_0x79cae4,_0x389853);})['then'](function(_0x2cf46a){if(_0x2cf46a&&_0x2cf46a['id']){logger[_0xf67e('0xc')]('Ticket\x20created!');logger[_0xf67e('0xc')](_0xf67e('0x56'),_0x2cf46a['id']);logger[_0xf67e('0xc')](_0xf67e('0x53'),_0xf67e('0x4b'));emit(util['format']('user:%s',_0x19fd67[_0xf67e('0x13')]),_0xf67e('0x4d'),{'uri':util['format'](_0xf67e('0x4e'),_0x4be977['remoteUri'],_0x2cf46a['id'])});}})['catch'](function(_0x39bae5){logger[_0xf67e('0x50')](_0xf67e('0x53'),JSON['stringify'](_0x39bae5));});};exports[_0xf67e('0x57')]=function(_0x5a5810,_0x58c754,_0x23a4c5,_0x345821,_0x4d0794,_0x441c86){var _0x1d3f6f,_0x37c231;_0x441c86[_0xf67e('0x1a')]=intUtil[_0xf67e('0x40')](_0x441c86[_0xf67e('0x1a')]);_0x441c86[_0xf67e('0x41')]=intUtil['stripTrailingSlash'](_0x441c86['serverUrl']);if(_0x4d0794&&_0x4d0794[_0xf67e('0x58')]){logger[_0xf67e('0xc')]('['+_0x58c754[_0xf67e('0x59')][_0xf67e('0x5a')]()+']',_0xf67e('0x43'));_0x58c754[_0xf67e('0x44')]=util[_0xf67e('0xe')](_0xf67e('0x5b'),_0x441c86[_0xf67e('0x41')],_0x58c754['uniqueid'],md5(_0x58c754[_0xf67e('0x45')]));}else{_0x58c754['recordingURL']='';}headers['Authorization']=getAuth(_0x441c86);return getUser(_0x441c86,'')[_0xf67e('0x1c')](function(_0x5dccb5){_0x1d3f6f=_0x5dccb5;logger[_0xf67e('0xc')](_0xf67e('0x47'),_0x1d3f6f['id']);return getEndUser(_0x441c86,_0x58c754[_0xf67e('0x48')],_0x58c754[_0xf67e('0x49')]);})[_0xf67e('0x1c')](function(_0x1ac472){_0x37c231=_0x1ac472;logger[_0xf67e('0xc')]('The\x20Enduser\x20ID\x20is:',_0x37c231['id']);return getTicket(_0x441c86,_0x1d3f6f,_0x37c231,_0x23a4c5,_0x58c754);})[_0xf67e('0x1c')](function(_0x42797e){if(_0x42797e){logger[_0xf67e('0xc')](_0xf67e('0x1d'));logger[_0xf67e('0xc')](_0xf67e('0x56'),_0x42797e['id']);}})[_0xf67e('0x4f')](function(_0x30513b){logger[_0xf67e('0x50')]('['+_0x58c754['lastevent'][_0xf67e('0x5a')]()+']',JSON[_0xf67e('0x2e')](_0x30513b));});}; \ 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 f114fb4..c54ad5b 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 _0xdc3d=['&f=','find','contacts','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','/api/tasks','Subjects','getString','Descriptions','Contact','add','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','stripTrailingSlash','remoteUri','serverUrl','toLowerCase','outbound','destcalleridnum','callDirection','queue','uniqueid','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','unmanaged','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','lodash','util','moment','bluebird','./util','../../../../config/environment','freshsales','defaults','redis','localhost','socket.io-emitter','GET','/api/selector/owners','Getting\x20admin\x20information','then','users','length','email','info','adminId','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','headers','agentEmail','Getting\x20user\x20with\x20email','User\x20found:','userId','userEmail','adminEmail','/api/lookup?q='];(function(_0x20e664,_0x1d56e5){var _0x59bfcb=function(_0x40a927){while(--_0x40a927){_0x20e664['push'](_0x20e664['shift']());}};_0x59bfcb(++_0x1d56e5);}(_0xdc3d,0x1c5));var _0xddc3=function(_0x5c8c55,_0x4f9ff0){_0x5c8c55=_0x5c8c55-0x0;var _0x5981fa=_0xdc3d[_0x5c8c55];return _0x5981fa;};'use strict';var _=require(_0xddc3('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0xddc3('0x1'));var moment=require(_0xddc3('0x2'));var Promise=require(_0xddc3('0x3'));var Redis=require('ioredis');var intUtil=require(_0xddc3('0x4'));var config=require(_0xddc3('0x5'));var logger=require('../../../../config/logger')(_0xddc3('0x6'));config['redis']=_[_0xddc3('0x7')](config[_0xddc3('0x8')],{'host':_0xddc3('0x9'),'port':0x18eb});var io=require(_0xddc3('0xa'))(new Redis(config[_0xddc3('0x8')]));function getAdminId(_0x831b75,_0x357cb2,_0x37ca5a,_0x40271e){return new Promise(function(_0x5f47e0,_0x3af93c){var _0x1eccf5=![];var _0x41a74b={'method':_0xddc3('0xb'),'uri':_0x40271e+_0xddc3('0xc'),'json':!![]};_0x41a74b['headers']=_0x37ca5a;logger['info'](_0xddc3('0xd'));return rp(_0x41a74b)[_0xddc3('0xe')](function(_0x41b4fb){if(_0x41b4fb){var _0x458a66=_0x41b4fb[_0xddc3('0xf')];var _0x316e0e=null;for(_0x316e0e=0x0;_0x316e0e<_0x458a66[_0xddc3('0x10')];_0x316e0e++){if(_0x458a66[_0x316e0e][_0xddc3('0x11')]===_0x831b75['adminEmail']){_0x831b75['adminId']=_0x458a66[_0x316e0e]['id'];_0x1eccf5=!![];}}if(_0x1eccf5){logger[_0xddc3('0x12')]('Admin\x20found:',_0x831b75[_0xddc3('0x13')]);_0x5f47e0(_0x831b75);}else{_0x3af93c({'statusCode':0x194,'message':_0xddc3('0x14')});}}else{_0x3af93c({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xddc3('0x15')](function(_0x12e148){logger[_0xddc3('0x16')]('['+[_0x357cb2[_0xddc3('0x17')]()]+']',_0x12e148[_0xddc3('0x18')]);_0x3af93c(_0x12e148);});});}function getUser(_0x3ddaba,_0x3f62c0,_0x43719b){return function(_0x4c87f9){return new Promise(function(_0x53dd0e,_0x572864){var _0x31f692={'method':_0xddc3('0xb'),'uri':_0x43719b+_0xddc3('0xc'),'json':!![]};_0x31f692[_0xddc3('0x19')]=_0x3f62c0;logger[_0xddc3('0x12')]('Getting\x20user\x20list');return rp(_0x31f692)[_0xddc3('0xe')](function(_0x25f352){if(_0x25f352){var _0x5c994b=_0x25f352[_0xddc3('0xf')];var _0x211a40=![];var _0x3c8fd6=null;if(_0x4c87f9[_0xddc3('0x1a')]!==null){logger['info'](_0xddc3('0x1b'),_0x4c87f9['agentEmail']);_0x4c87f9['userEmail']=_0x4c87f9[_0xddc3('0x1a')];for(_0x3c8fd6=0x0;_0x3c8fd6<_0x5c994b[_0xddc3('0x10')];_0x3c8fd6++){if(_0x5c994b[_0x3c8fd6][_0xddc3('0x11')]===_0x4c87f9[_0xddc3('0x1a')]){_0x211a40=!![];_0x4c87f9['userId']=_0x5c994b[_0x3c8fd6]['id'];logger[_0xddc3('0x12')](_0xddc3('0x1c'),_0x4c87f9[_0xddc3('0x1d')]);}}}if(!_0x211a40){logger[_0xddc3('0x12')]('Admin\x20selected');_0x4c87f9[_0xddc3('0x1e')]=_0x4c87f9[_0xddc3('0x1f')];_0x4c87f9[_0xddc3('0x1d')]=_0x4c87f9[_0xddc3('0x13')];_0x211a40=!![];}if(_0x211a40){_0x53dd0e(_0x4c87f9);}else{_0x572864({'statusCode':0x194,'message':_0xddc3('0x14')});}}else{_0x572864({'statusCode':0x194,'message':_0xddc3('0x14')});}})['catch'](function(_0x4d4a0d){logger['error']('['+[_0x3ddaba['toUpperCase']()]+']',_0x4d4a0d[_0xddc3('0x18')]);_0x572864(_0x4d4a0d);});});};}function searchContact(_0x44c155,_0x3687ed,_0x44f67a,_0x102503){return new Promise(function(_0x3d87e9,_0x1e3404){var _0x441275={'method':_0xddc3('0xb'),'headers':_0x3687ed,'uri':_0x44c155+_0xddc3('0x20')+_0x102503+_0xddc3('0x21')+_0x44f67a+'&entities=contact','json':!![]};rp(_0x441275)[_0xddc3('0xe')](function(_0x2bf75c){var _0x53d3d2=_[_0xddc3('0x22')](_0x2bf75c[_0xddc3('0x23')]['contacts'],[_0x44f67a,_0x102503]);_0x3d87e9(_0x53d3d2);})['catch'](function(_0x424ba6){_0x1e3404(_0x424ba6);});});}function getEndUser(_0x1a50b6,_0x695612,_0x265040){return function(_0x5314e9){return new Promise(function(_0x21fc00,_0x2104b5){logger[_0xddc3('0x12')](util['format'](_0xddc3('0x24'),_0x5314e9[_0xddc3('0x25')]));searchContact(_0x265040,_0x695612,_0xddc3('0x26'),_0x5314e9[_0xddc3('0x25')])[_0xddc3('0xe')](function(_0x531f42){if(_0x531f42){_0x5314e9[_0xddc3('0x27')]=_0x531f42['id'];logger[_0xddc3('0x12')](_0xddc3('0x28'),_0x5314e9['endUserId']);return _0x21fc00(_0x5314e9);}searchContact(_0x265040,_0x695612,_0xddc3('0x29'),_0x5314e9[_0xddc3('0x25')])[_0xddc3('0xe')](function(_0x5a7b51){if(_0x5a7b51){_0x5314e9[_0xddc3('0x27')]=_0x5a7b51['id'];logger[_0xddc3('0x12')](_0xddc3('0x2a'),_0x5314e9[_0xddc3('0x27')]);return _0x21fc00(_0x5314e9);}createEndUser(_0x5314e9,_0x1a50b6,_0x695612,_0x265040)[_0xddc3('0xe')](function(_0x426722){logger[_0xddc3('0x12')](_0xddc3('0x2b'),_0x426722['endUserId']);return _0x21fc00(_0x426722);});});})['catch'](function(_0x505a02){_0x2104b5(_0x505a02);});});};}function createEndUser(_0x396559,_0x58d2e3,_0x40f273,_0x1524ca){return new Promise(function(_0x56ce64,_0x1ef70a){var _0xf58fa7=moment();var _0x2ee5e9={'method':_0xddc3('0x2c'),'uri':_0x1524ca+_0xddc3('0x2d'),'body':{'contact':{'last_name':_0x396559['contactNumber'],'work_number':_0x396559[_0xddc3('0x25')],'mobile_number':_0x396559[_0xddc3('0x25')],'owner_id':_0x396559[_0xddc3('0x1d')],'created_at':_0xf58fa7[_0xddc3('0x2e')](_0xddc3('0x2f'))}},'json':!![]};_0x2ee5e9[_0xddc3('0x19')]=_0x40f273;logger[_0xddc3('0x12')](_0xddc3('0x30'));return rp(_0x2ee5e9)[_0xddc3('0xe')](function(_0x2a520d){_0x396559[_0xddc3('0x27')]=_0x2a520d[_0xddc3('0x31')]['id'];_0x56ce64(_0x396559);})[_0xddc3('0x15')](function(_0x3c6d43){logger[_0xddc3('0x16')]('['+[_0x58d2e3['toUpperCase']()]+']',_0x3c6d43[_0xddc3('0x18')]);_0x1ef70a(_0x3c6d43[_0xddc3('0x18')]);});});}function getTicket(_0x6416c4,_0x3e8382,_0x539792,_0x9318c5,_0x319e18){return function(_0x228211){logger[_0xddc3('0x12')]('Creating\x20new\x20task');return new Promise(function(_0x159542,_0x49a693){var _0x68067e=moment();var _0x1612b4={'method':'POST','uri':_0x539792+_0xddc3('0x32'),'body':{'title':intUtil['getString'](_0x9318c5[_0xddc3('0x33')],_0x319e18,'\x20'),'description':intUtil[_0xddc3('0x34')](_0x9318c5[_0xddc3('0x35')],_0x319e18,'\x0a'),'owner_id':_0x228211['userId'],'creater_id':_0x228211[_0xddc3('0x13')],'targetable_id':_0x228211['endUserId'],'targetable_type':_0xddc3('0x36'),'created_at':_0x68067e['format'](_0xddc3('0x2f')),'due_date':_0x68067e[_0xddc3('0x37')](0x1e,'m')[_0xddc3('0x2e')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x1612b4[_0xddc3('0x19')]=_0x3e8382;return rp(_0x1612b4)['then'](function(_0x2be6ac){_0x228211['ticketId']=_0x2be6ac[_0xddc3('0x38')]['id'];logger['info'](_0xddc3('0x39'),_0x228211['ticketId']);_0x159542(_0x228211);})[_0xddc3('0x15')](function(_0x2a7752){logger['error']('['+[_0x6416c4['toUpperCase']()]+']',_0x2a7752[_0xddc3('0x18')]);_0x49a693(_0x2a7752[_0xddc3('0x18')]);});});};}function emit(_0x554558,_0x8ad3c,_0x999958){var _0x4df7fd={'uri':_0x554558+_0xddc3('0x3a')+_0x999958};io['to'](util[_0xddc3('0x2e')](_0xddc3('0x3b'),_0x8ad3c))[_0xddc3('0x3c')](_0xddc3('0x3d'),_0x4df7fd);}exports['cs']=function(_0x5a267c,_0x45738e,_0x546c41,_0x244763,_0x2ac48a,_0x36244e,_0x501ee1,_0xfb6001){var _0xee403d={};var _0x6a6e75={'Authorization':_0xddc3('0x3e')+_0x36244e[_0xddc3('0x3f')]};_0x36244e['remoteUri']=intUtil[_0xddc3('0x40')](_0x36244e[_0xddc3('0x41')]);_0x36244e[_0xddc3('0x42')]=intUtil[_0xddc3('0x40')](_0x36244e[_0xddc3('0x42')]);var _0x7ec1d6=_0x36244e[_0xddc3('0x41')];_0xee403d[_0xddc3('0x1f')]=_0x36244e['username'];_0xee403d[_0xddc3('0x25')]=_0xfb6001[_0xddc3('0x43')]()===_0xddc3('0x44')?_0x45738e[_0xddc3('0x45')]:_0x45738e['calleridnum'];_0xee403d[_0xddc3('0x46')]=_0xfb6001===_0xddc3('0x47')||_0xfb6001==='unmanaged'?_0xddc3('0x47'):_0xddc3('0x44');if(_0x244763){_0xee403d[_0xddc3('0x1a')]=_0x244763[_0xddc3('0x11')];}var _0x30e720=util[_0xddc3('0x2e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x36244e[_0xddc3('0x42')],_0x45738e[_0xddc3('0x48')],md5(_0x45738e[_0xddc3('0x48')]));if(_0x2ac48a&&_0x2ac48a['monitor_format']){logger[_0xddc3('0x12')]('[QUEUE]',_0xddc3('0x49'));_0x45738e['recordingURL']=_0x30e720;}else if(_0x501ee1&&_0x501ee1['recordingFormat']&&_0x501ee1[_0xddc3('0x4a')]!==_0xddc3('0x4b')){logger[_0xddc3('0x12')](_0xddc3('0x4c'),_0xddc3('0x49'));_0x45738e[_0xddc3('0x4d')]=_0x30e720;}else{_0x45738e[_0xddc3('0x4d')]='';}return getAdminId(_0xee403d,_0xfb6001,_0x6a6e75,_0x7ec1d6)['then'](getUser(_0xfb6001,_0x6a6e75,_0x7ec1d6))[_0xddc3('0xe')](getEndUser(_0xfb6001,_0x6a6e75,_0x7ec1d6))['then'](getTicket(_0xfb6001,_0x6a6e75,_0x7ec1d6,_0x546c41,_0x45738e))['then'](function(_0x220e60){logger[_0xddc3('0x12')](util[_0xddc3('0x2e')]('The\x20ticket\x20ID\x20is:\x20%s',_0x220e60['ticketId']));if(_0xfb6001!==_0xddc3('0x4e')){logger[_0xddc3('0x12')]('['+[_0xfb6001[_0xddc3('0x17')]()]+']',_0xddc3('0x4f'));emit(_0x7ec1d6,_0x244763['name'],_0x220e60[_0xddc3('0x27')]);}})[_0xddc3('0x15')](function(_0xe455a2){logger[_0xddc3('0x16')]('['+[_0xfb6001[_0xddc3('0x17')]()]+_0xddc3('0x50'),util['inspect'](_0xe455a2,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x8ccd=['./util','../../../../config/environment','freshsales','redis','defaults','socket.io-emitter','GET','/api/selector/owners','headers','then','length','email','adminId','info','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','Getting\x20user\x20list','users','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','Admin\x20selected','adminEmail','&f=','&entities=contact','contacts','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','contactNumber','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','Contact','add','ticketId','task','Task\x20created:','user:%s','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','destcalleridnum','callDirection','queue','uniqueid','Recording\x20is\x20enabled!','recordingURL','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','unmanaged','Displaying\x20task\x20in\x20a\x20new\x20tab...','name','request-promise','md5','moment','bluebird','ioredis'];(function(_0x447aeb,_0x5ef19a){var _0x43d044=function(_0x2c6d58){while(--_0x2c6d58){_0x447aeb['push'](_0x447aeb['shift']());}};_0x43d044(++_0x5ef19a);}(_0x8ccd,0x190));var _0xd8cc=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x8ccd[_0x9cd4c3];return _0x4c9025;};'use strict';var _=require('lodash');var rp=require(_0xd8cc('0x0'));var md5=require(_0xd8cc('0x1'));var util=require('util');var moment=require(_0xd8cc('0x2'));var Promise=require(_0xd8cc('0x3'));var Redis=require(_0xd8cc('0x4'));var intUtil=require(_0xd8cc('0x5'));var config=require(_0xd8cc('0x6'));var logger=require('../../../../config/logger')(_0xd8cc('0x7'));config[_0xd8cc('0x8')]=_[_0xd8cc('0x9')](config[_0xd8cc('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xd8cc('0xa'))(new Redis(config[_0xd8cc('0x8')]));function getAdminId(_0x25ba28,_0x3eb205,_0x5d3a30,_0x2192e1){return new Promise(function(_0x5ea0e1,_0x38ab30){var _0x5671db=![];var _0x36fb06={'method':_0xd8cc('0xb'),'uri':_0x2192e1+_0xd8cc('0xc'),'json':!![]};_0x36fb06[_0xd8cc('0xd')]=_0x5d3a30;logger['info']('Getting\x20admin\x20information');return rp(_0x36fb06)[_0xd8cc('0xe')](function(_0x898884){if(_0x898884){var _0x2ebead=_0x898884['users'];var _0x3b5475=null;for(_0x3b5475=0x0;_0x3b5475<_0x2ebead[_0xd8cc('0xf')];_0x3b5475++){if(_0x2ebead[_0x3b5475][_0xd8cc('0x10')]===_0x25ba28['adminEmail']){_0x25ba28[_0xd8cc('0x11')]=_0x2ebead[_0x3b5475]['id'];_0x5671db=!![];}}if(_0x5671db){logger[_0xd8cc('0x12')]('Admin\x20found:',_0x25ba28['adminId']);_0x5ea0e1(_0x25ba28);}else{_0x38ab30({'statusCode':0x194,'message':_0xd8cc('0x13')});}}else{_0x38ab30({'statusCode':0x194,'message':_0xd8cc('0x13')});}})[_0xd8cc('0x14')](function(_0x145ea7){logger[_0xd8cc('0x15')]('['+[_0x3eb205[_0xd8cc('0x16')]()]+']',_0x145ea7[_0xd8cc('0x17')]);_0x38ab30(_0x145ea7);});});}function getUser(_0xd81622,_0x2073b9,_0x533116){return function(_0x3e8884){return new Promise(function(_0x5ad04b,_0x4870b4){var _0x50fbd1={'method':_0xd8cc('0xb'),'uri':_0x533116+'/api/selector/owners','json':!![]};_0x50fbd1[_0xd8cc('0xd')]=_0x2073b9;logger['info'](_0xd8cc('0x18'));return rp(_0x50fbd1)[_0xd8cc('0xe')](function(_0x294e0e){if(_0x294e0e){var _0x1f0ef5=_0x294e0e[_0xd8cc('0x19')];var _0x7cae=![];var _0x599210=null;if(_0x3e8884[_0xd8cc('0x1a')]!==null){logger['info'](_0xd8cc('0x1b'),_0x3e8884[_0xd8cc('0x1a')]);_0x3e8884[_0xd8cc('0x1c')]=_0x3e8884[_0xd8cc('0x1a')];for(_0x599210=0x0;_0x599210<_0x1f0ef5['length'];_0x599210++){if(_0x1f0ef5[_0x599210]['email']===_0x3e8884['agentEmail']){_0x7cae=!![];_0x3e8884[_0xd8cc('0x1d')]=_0x1f0ef5[_0x599210]['id'];logger[_0xd8cc('0x12')](_0xd8cc('0x1e'),_0x3e8884[_0xd8cc('0x1d')]);}}}if(!_0x7cae){logger['info'](_0xd8cc('0x1f'));_0x3e8884[_0xd8cc('0x1c')]=_0x3e8884[_0xd8cc('0x20')];_0x3e8884['userId']=_0x3e8884['adminId'];_0x7cae=!![];}if(_0x7cae){_0x5ad04b(_0x3e8884);}else{_0x4870b4({'statusCode':0x194,'message':_0xd8cc('0x13')});}}else{_0x4870b4({'statusCode':0x194,'message':_0xd8cc('0x13')});}})['catch'](function(_0x471c06){logger[_0xd8cc('0x15')]('['+[_0xd81622[_0xd8cc('0x16')]()]+']',_0x471c06['message']);_0x4870b4(_0x471c06);});});};}function searchContact(_0x4bdb7b,_0x49014d,_0x3d3758,_0x4566ef){return new Promise(function(_0x1818b8,_0x55d6a2){var _0x40ce2f={'method':'GET','headers':_0x49014d,'uri':_0x4bdb7b+'/api/lookup?q='+_0x4566ef+_0xd8cc('0x21')+_0x3d3758+_0xd8cc('0x22'),'json':!![]};rp(_0x40ce2f)[_0xd8cc('0xe')](function(_0x596b5c){var _0x150047=_['find'](_0x596b5c[_0xd8cc('0x23')][_0xd8cc('0x23')],[_0x3d3758,_0x4566ef]);_0x1818b8(_0x150047);})[_0xd8cc('0x14')](function(_0x12648c){_0x55d6a2(_0x12648c);});});}function getEndUser(_0x27ba16,_0x10108d,_0x26d558){return function(_0x5c62d0){return new Promise(function(_0x5de097,_0x1943e3){logger[_0xd8cc('0x12')](util['format']('Searching\x20contact\x20with\x20phone\x20%s',_0x5c62d0['contactNumber']));searchContact(_0x26d558,_0x10108d,_0xd8cc('0x24'),_0x5c62d0['contactNumber'])['then'](function(_0x39a34a){if(_0x39a34a){_0x5c62d0[_0xd8cc('0x25')]=_0x39a34a['id'];logger[_0xd8cc('0x12')](_0xd8cc('0x26'),_0x5c62d0['endUserId']);return _0x5de097(_0x5c62d0);}searchContact(_0x26d558,_0x10108d,_0xd8cc('0x27'),_0x5c62d0[_0xd8cc('0x28')])['then'](function(_0x25f694){if(_0x25f694){_0x5c62d0['endUserId']=_0x25f694['id'];logger[_0xd8cc('0x12')](_0xd8cc('0x29'),_0x5c62d0[_0xd8cc('0x25')]);return _0x5de097(_0x5c62d0);}createEndUser(_0x5c62d0,_0x27ba16,_0x10108d,_0x26d558)['then'](function(_0xc4af3c){logger[_0xd8cc('0x12')](_0xd8cc('0x2a'),_0xc4af3c['endUserId']);return _0x5de097(_0xc4af3c);});});})[_0xd8cc('0x14')](function(_0x1281ca){_0x1943e3(_0x1281ca);});});};}function createEndUser(_0x3275b8,_0x23282b,_0x8938e5,_0x20c623){return new Promise(function(_0x33c525,_0x140bf0){var _0x1c3f00=moment();var _0x2465b1={'method':_0xd8cc('0x2b'),'uri':_0x20c623+_0xd8cc('0x2c'),'body':{'contact':{'last_name':_0x3275b8[_0xd8cc('0x28')],'work_number':_0x3275b8[_0xd8cc('0x28')],'mobile_number':_0x3275b8['contactNumber'],'owner_id':_0x3275b8[_0xd8cc('0x1d')],'created_at':_0x1c3f00[_0xd8cc('0x2d')](_0xd8cc('0x2e'))}},'json':!![]};_0x2465b1[_0xd8cc('0xd')]=_0x8938e5;logger[_0xd8cc('0x12')](_0xd8cc('0x2f'));return rp(_0x2465b1)['then'](function(_0x4234d9){_0x3275b8[_0xd8cc('0x25')]=_0x4234d9[_0xd8cc('0x30')]['id'];_0x33c525(_0x3275b8);})[_0xd8cc('0x14')](function(_0x16bbd6){logger[_0xd8cc('0x15')]('['+[_0x23282b[_0xd8cc('0x16')]()]+']',_0x16bbd6[_0xd8cc('0x17')]);_0x140bf0(_0x16bbd6[_0xd8cc('0x17')]);});});}function getTicket(_0x4893d4,_0x31d73f,_0x20b7c0,_0x332b24,_0x12a338){return function(_0x263cf5){logger[_0xd8cc('0x12')](_0xd8cc('0x31'));return new Promise(function(_0x2bca5a,_0x5d4b21){var _0x4a7d76=moment();var _0x1a88e4={'method':_0xd8cc('0x2b'),'uri':_0x20b7c0+_0xd8cc('0x32'),'body':{'title':intUtil[_0xd8cc('0x33')](_0x332b24[_0xd8cc('0x34')],_0x12a338,'\x20'),'description':intUtil[_0xd8cc('0x33')](_0x332b24[_0xd8cc('0x35')],_0x12a338,'\x0a'),'owner_id':_0x263cf5[_0xd8cc('0x1d')],'creater_id':_0x263cf5[_0xd8cc('0x11')],'targetable_id':_0x263cf5['endUserId'],'targetable_type':_0xd8cc('0x36'),'created_at':_0x4a7d76[_0xd8cc('0x2d')](_0xd8cc('0x2e')),'due_date':_0x4a7d76[_0xd8cc('0x37')](0x1e,'m')[_0xd8cc('0x2d')](_0xd8cc('0x2e'))},'json':!![]};_0x1a88e4[_0xd8cc('0xd')]=_0x31d73f;return rp(_0x1a88e4)[_0xd8cc('0xe')](function(_0xea3e21){_0x263cf5[_0xd8cc('0x38')]=_0xea3e21[_0xd8cc('0x39')]['id'];logger[_0xd8cc('0x12')](_0xd8cc('0x3a'),_0x263cf5['ticketId']);_0x2bca5a(_0x263cf5);})[_0xd8cc('0x14')](function(_0x3f14b7){logger[_0xd8cc('0x15')]('['+[_0x4893d4[_0xd8cc('0x16')]()]+']',_0x3f14b7[_0xd8cc('0x17')]);_0x5d4b21(_0x3f14b7['message']);});});};}function emit(_0x1185a9,_0x474428,_0x4e716f){var _0x4f0c5b={'uri':_0x1185a9+'/contacts/'+_0x4e716f};io['to'](util[_0xd8cc('0x2d')](_0xd8cc('0x3b'),_0x474428))['emit'](_0xd8cc('0x3c'),_0x4f0c5b);}exports['cs']=function(_0x28d355,_0x5ef1f0,_0xa2bff6,_0x534e28,_0x102f5e,_0x5a78e9,_0x1f9ac5,_0x345031){var _0x381cef={};var _0xbcbb75={'Authorization':_0xd8cc('0x3d')+_0x5a78e9[_0xd8cc('0x3e')]};_0x5a78e9[_0xd8cc('0x3f')]=intUtil[_0xd8cc('0x40')](_0x5a78e9[_0xd8cc('0x3f')]);_0x5a78e9['serverUrl']=intUtil[_0xd8cc('0x40')](_0x5a78e9[_0xd8cc('0x41')]);var _0x1bf860=_0x5a78e9[_0xd8cc('0x3f')];_0x381cef[_0xd8cc('0x20')]=_0x5a78e9[_0xd8cc('0x42')];_0x381cef['contactNumber']=_0x345031[_0xd8cc('0x43')]()===_0xd8cc('0x44')?_0x5ef1f0[_0xd8cc('0x45')]:_0x5ef1f0['calleridnum'];_0x381cef[_0xd8cc('0x46')]=_0x345031===_0xd8cc('0x47')||_0x345031==='unmanaged'?_0xd8cc('0x47'):_0xd8cc('0x44');if(_0x534e28){_0x381cef['agentEmail']=_0x534e28[_0xd8cc('0x10')];}var _0x69c5b3=util[_0xd8cc('0x2d')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5a78e9[_0xd8cc('0x41')],_0x5ef1f0[_0xd8cc('0x48')],md5(_0x5ef1f0[_0xd8cc('0x48')]));if(_0x102f5e&&_0x102f5e['monitor_format']){logger[_0xd8cc('0x12')]('[QUEUE]',_0xd8cc('0x49'));_0x5ef1f0[_0xd8cc('0x4a')]=_0x69c5b3;}else if(_0x1f9ac5&&_0x1f9ac5['recordingFormat']&&_0x1f9ac5['recordingFormat']!==_0xd8cc('0x4b')){logger[_0xd8cc('0x12')](_0xd8cc('0x4c'),_0xd8cc('0x49'));_0x5ef1f0['recordingURL']=_0x69c5b3;}else{_0x5ef1f0['recordingURL']='';}return getAdminId(_0x381cef,_0x345031,_0xbcbb75,_0x1bf860)[_0xd8cc('0xe')](getUser(_0x345031,_0xbcbb75,_0x1bf860))['then'](getEndUser(_0x345031,_0xbcbb75,_0x1bf860))[_0xd8cc('0xe')](getTicket(_0x345031,_0xbcbb75,_0x1bf860,_0xa2bff6,_0x5ef1f0))[_0xd8cc('0xe')](function(_0x4a7a4a){logger[_0xd8cc('0x12')](util['format'](_0xd8cc('0x4d'),_0x4a7a4a[_0xd8cc('0x38')]));if(_0x345031!==_0xd8cc('0x4e')){logger[_0xd8cc('0x12')]('['+[_0x345031[_0xd8cc('0x16')]()]+']',_0xd8cc('0x4f'));emit(_0x1bf860,_0x534e28[_0xd8cc('0x50')],_0x4a7a4a[_0xd8cc('0x25')]);}})['catch'](function(_0x3a53c4){logger['error']('['+[_0x345031[_0xd8cc('0x16')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util['inspect'](_0x3a53c4,{'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 71ba2d3..a382930 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 _0xcc80=['toLowerCase','data2','find','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','servicenow','unknown\x20integration','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','../../../../config/logger','format','%s\x20account\x20#%s\x20not\x20found','lodash','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','includes','data1'];(function(_0x393ad5,_0x2a7a68){var _0x31f723=function(_0x4877c){while(--_0x4877c){_0x393ad5['push'](_0x393ad5['shift']());}};_0x31f723(++_0x2a7a68);}(_0xcc80,0xb7));var _0x0cc8=function(_0x12c57c,_0x31c878){_0x12c57c=_0x12c57c-0x0;var _0x30a019=_0xcc80[_0x12c57c];return _0x30a019;};'use strict';var _=require(_0x0cc8('0x0'));var util=require('util');var zendesk=require(_0x0cc8('0x1'));var salesforce=require(_0x0cc8('0x2'));var sugarcrm=require(_0x0cc8('0x3'));var freshdesk=require(_0x0cc8('0x4'));var zoho=require(_0x0cc8('0x5'));var desk=require(_0x0cc8('0x6'));var vtiger=require(_0x0cc8('0x7'));var servicenow=require(_0x0cc8('0x8'));var dynamics365=require(_0x0cc8('0x9'));var freshsales=require(_0x0cc8('0xa'));var integrations=[_0x0cc8('0xb'),_0x0cc8('0xc'),_0x0cc8('0xd'),_0x0cc8('0xe'),_0x0cc8('0xf'),_0x0cc8('0x10'),_0x0cc8('0x11'),_0x0cc8('0x12'),_0x0cc8('0x13'),'servicenow'];exports['exec']=function(_0x28167d,_0x398782,_0x2343e4,_0x125900,_0x5867d7,_0x28a7de){if(_0x2343e4){if(_[_0x0cc8('0x14')](integrations,_0x28167d[_0x0cc8('0x15')][_0x0cc8('0x16')]())){try{var _0x246047=null;var _0x23c655='';var _0x1fd603=_0x2343e4[_0x28167d[_0x0cc8('0x15')][_0x0cc8('0x16')]()];if(_0x1fd603){var _0x45fb44=_0x1fd603[_0x28167d[_0x0cc8('0x17')]];if(_0x45fb44){var _0x23a5dd=_[_0x0cc8('0x18')](_0x45fb44[_0x0cc8('0x19')],{'id':parseInt(_0x28167d[_0x0cc8('0x1a')],0xa)});if(_0x23a5dd){if(_0x125900){if(_0x5867d7&&_0x398782[_0x0cc8('0x1b')]){_0x23c655='queue';}else if(_0x398782[_0x0cc8('0x1c')]){_0x23c655=_0x0cc8('0x1d');}else{console[_0x0cc8('0x1e')](_0x0cc8('0x1f'),_0x398782);}}else{_0x23c655=_0x0cc8('0x20');}switch(_0x28167d[_0x0cc8('0x15')][_0x0cc8('0x16')]()){case'zendesk':zendesk[_0x23c655](_0x28167d,_0x398782,_0x23a5dd,_0x125900,_0x5867d7,_0x45fb44,_0x28a7de);break;case'salesforce':salesforce[_0x23c655](_0x28167d,_0x398782,_0x23a5dd,_0x125900,_0x5867d7,_0x45fb44,_0x28a7de);break;case'sugarcrm':sugarcrm[_0x23c655](_0x28167d,_0x398782,_0x23a5dd,_0x125900,_0x5867d7,_0x45fb44,_0x28a7de);break;case _0x0cc8('0xe'):freshdesk[_0x23c655](_0x28167d,_0x398782,_0x23a5dd,_0x125900,_0x5867d7,_0x45fb44,_0x28a7de);break;case _0x0cc8('0xf'):zoho[_0x23c655](_0x28167d,_0x398782,_0x23a5dd,_0x125900,_0x5867d7,_0x45fb44,_0x28a7de);break;case _0x0cc8('0x10'):desk[_0x23c655](_0x28167d,_0x398782,_0x23a5dd,_0x125900,_0x5867d7,_0x45fb44,_0x28a7de);break;case _0x0cc8('0x11'):vtiger[_0x23c655](_0x28167d,_0x398782,_0x23a5dd,_0x125900,_0x5867d7,_0x45fb44,_0x28a7de);break;case _0x0cc8('0x13'):freshsales['cs'](_0x28167d,_0x398782,_0x23a5dd,_0x125900,_0x5867d7,_0x45fb44,_0x28a7de,_0x23c655);break;case _0x0cc8('0x21'):servicenow['cs'](_0x28167d,_0x398782,_0x23a5dd,_0x125900,_0x5867d7,_0x45fb44,_0x28a7de,_0x23c655);break;case _0x0cc8('0x12'):dynamics365['cs'](_0x28167d,_0x398782,_0x23a5dd,_0x125900,_0x5867d7,_0x45fb44,_0x28a7de,_0x23c655);break;default:console[_0x0cc8('0x1e')](_0x0cc8('0x22'));}}else{_0x246047=require('../../../../config/logger')(_0x28167d[_0x0cc8('0x15')][_0x0cc8('0x16')]());_0x246047[_0x0cc8('0x23')](_0x0cc8('0x24'),util['format'](_0x0cc8('0x25'),_0x28167d[_0x0cc8('0x15')]['toLowerCase'](),_0x28167d[_0x0cc8('0x1a')]));}}else{_0x246047=require(_0x0cc8('0x26'))(_0x28167d[_0x0cc8('0x15')]['toLowerCase']());_0x246047[_0x0cc8('0x23')](_0x0cc8('0x24'),util[_0x0cc8('0x27')](_0x0cc8('0x28'),_0x28167d['data1'][_0x0cc8('0x16')](),_0x28167d[_0x0cc8('0x17')]));}}else{}}catch(_0x572434){console[_0x0cc8('0x23')](_0x572434);}}}}; \ No newline at end of file +var _0x0f6a=['../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','toLowerCase','util','./zendesk','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','desk','vtiger','dynamics365','freshsales','exec','includes','data1','data2','find','Configurations','data3','queue','routeId','outbound','EVENT\x20UNKNOWN','log','unknown\x20integration'];(function(_0x2c7f4a,_0x393803){var _0x47c318=function(_0x55af07){while(--_0x55af07){_0x2c7f4a['push'](_0x2c7f4a['shift']());}};_0x47c318(++_0x393803);}(_0x0f6a,0x1b6));var _0xa0f6=function(_0x14c34e,_0x10d2dc){_0x14c34e=_0x14c34e-0x0;var _0x536c95=_0x0f6a[_0x14c34e];return _0x536c95;};'use strict';var _=require('lodash');var util=require(_0xa0f6('0x0'));var zendesk=require(_0xa0f6('0x1'));var salesforce=require('./salesforce');var sugarcrm=require('./sugarcrm');var freshdesk=require(_0xa0f6('0x2'));var zoho=require(_0xa0f6('0x3'));var desk=require(_0xa0f6('0x4'));var vtiger=require(_0xa0f6('0x5'));var servicenow=require(_0xa0f6('0x6'));var dynamics365=require(_0xa0f6('0x7'));var freshsales=require(_0xa0f6('0x8'));var integrations=[_0xa0f6('0x9'),_0xa0f6('0xa'),_0xa0f6('0xb'),_0xa0f6('0xc'),'zoho',_0xa0f6('0xd'),_0xa0f6('0xe'),_0xa0f6('0xf'),_0xa0f6('0x10'),'servicenow'];exports[_0xa0f6('0x11')]=function(_0x309405,_0x56862a,_0x2a6f4c,_0x1ae5a1,_0x3aed04,_0x3f45c2){if(_0x2a6f4c){if(_[_0xa0f6('0x12')](integrations,_0x309405[_0xa0f6('0x13')]['toLowerCase']())){try{var _0xf14274=null;var _0xb421f3='';var _0x12bbfe=_0x2a6f4c[_0x309405['data1']['toLowerCase']()];if(_0x12bbfe){var _0x1c17ac=_0x12bbfe[_0x309405[_0xa0f6('0x14')]];if(_0x1c17ac){var _0x2c620b=_[_0xa0f6('0x15')](_0x1c17ac[_0xa0f6('0x16')],{'id':parseInt(_0x309405[_0xa0f6('0x17')],0xa)});if(_0x2c620b){if(_0x1ae5a1){if(_0x3aed04&&_0x56862a[_0xa0f6('0x18')]){_0xb421f3=_0xa0f6('0x18');}else if(_0x56862a[_0xa0f6('0x19')]){_0xb421f3=_0xa0f6('0x1a');}else{console['log'](_0xa0f6('0x1b'),_0x56862a);}}else{_0xb421f3='unmanaged';}switch(_0x309405[_0xa0f6('0x13')]['toLowerCase']()){case _0xa0f6('0x9'):zendesk[_0xb421f3](_0x309405,_0x56862a,_0x2c620b,_0x1ae5a1,_0x3aed04,_0x1c17ac,_0x3f45c2);break;case'salesforce':salesforce[_0xb421f3](_0x309405,_0x56862a,_0x2c620b,_0x1ae5a1,_0x3aed04,_0x1c17ac,_0x3f45c2);break;case _0xa0f6('0xb'):sugarcrm[_0xb421f3](_0x309405,_0x56862a,_0x2c620b,_0x1ae5a1,_0x3aed04,_0x1c17ac,_0x3f45c2);break;case _0xa0f6('0xc'):freshdesk[_0xb421f3](_0x309405,_0x56862a,_0x2c620b,_0x1ae5a1,_0x3aed04,_0x1c17ac,_0x3f45c2);break;case'zoho':zoho[_0xb421f3](_0x309405,_0x56862a,_0x2c620b,_0x1ae5a1,_0x3aed04,_0x1c17ac,_0x3f45c2);break;case _0xa0f6('0xd'):desk[_0xb421f3](_0x309405,_0x56862a,_0x2c620b,_0x1ae5a1,_0x3aed04,_0x1c17ac,_0x3f45c2);break;case _0xa0f6('0xe'):vtiger[_0xb421f3](_0x309405,_0x56862a,_0x2c620b,_0x1ae5a1,_0x3aed04,_0x1c17ac,_0x3f45c2);break;case _0xa0f6('0x10'):freshsales['cs'](_0x309405,_0x56862a,_0x2c620b,_0x1ae5a1,_0x3aed04,_0x1c17ac,_0x3f45c2,_0xb421f3);break;case'servicenow':servicenow['cs'](_0x309405,_0x56862a,_0x2c620b,_0x1ae5a1,_0x3aed04,_0x1c17ac,_0x3f45c2,_0xb421f3);break;case _0xa0f6('0xf'):dynamics365['cs'](_0x309405,_0x56862a,_0x2c620b,_0x1ae5a1,_0x3aed04,_0x1c17ac,_0x3f45c2,_0xb421f3);break;default:console[_0xa0f6('0x1c')](_0xa0f6('0x1d'));}}else{_0xf14274=require(_0xa0f6('0x1e'))(_0x309405[_0xa0f6('0x13')]['toLowerCase']());_0xf14274[_0xa0f6('0x1f')](_0xa0f6('0x20'),util[_0xa0f6('0x21')](_0xa0f6('0x22'),_0x309405[_0xa0f6('0x13')][_0xa0f6('0x23')](),_0x309405[_0xa0f6('0x17')]));}}else{_0xf14274=require(_0xa0f6('0x1e'))(_0x309405[_0xa0f6('0x13')][_0xa0f6('0x23')]());_0xf14274[_0xa0f6('0x1f')]('[EXEC]',util[_0xa0f6('0x21')]('%s\x20account\x20#%s\x20not\x20found',_0x309405[_0xa0f6('0x13')][_0xa0f6('0x23')](),_0x309405[_0xa0f6('0x14')]));}}else{}}catch(_0x26f398){console['error'](_0x26f398);}}}}; \ 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 77fb24f..2b4e2b5 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 _0x2d37=['[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','recordingFormat','none','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','outbound','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','error','[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','calleridname','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','jsforce','ioredis','./util','salesforce','redis','defaults','localhost','socket.io-emitter','emit','getString','Subjects','Descriptions','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','account','WhatId','ticketType','Case','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','validateEmail','User','find','then','Email','Agent\x20%s\x20found.','Name','identity','resolve','display_name','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','additionalSearchLead','account_contact_lead','additionalSearchAccount','Account','execute','length','Lead','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','','Caller\x20-\x20%s','LastName','Company','No\x20Company','format','forEach','includes','string','picklist','idField','content','variable','variableName','toString','customVariable','Variable','name','concat','securityToken','Connection','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','remoteUri','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','newTab','user:%s','trigger:browser:url','%s/%s/e','instanceUrl'];(function(_0x1edc60,_0x594ea2){var _0xd1b268=function(_0x5f0361){while(--_0x5f0361){_0x1edc60['push'](_0x1edc60['shift']());}};_0xd1b268(++_0x594ea2);}(_0x2d37,0x1a1));var _0x72d3=function(_0x46483b,_0x193030){_0x46483b=_0x46483b-0x0;var _0xcce126=_0x2d37[_0x46483b];return _0xcce126;};'use strict';var _=require(_0x72d3('0x0'));var rp=require(_0x72d3('0x1'));var moment=require(_0x72d3('0x2'));var BPromise=require(_0x72d3('0x3'));var md5=require(_0x72d3('0x4'));var jsforce=require(_0x72d3('0x5'));var util=require('util');var Redis=require(_0x72d3('0x6'));var intUtil=require(_0x72d3('0x7'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x72d3('0x8'));config[_0x72d3('0x9')]=_[_0x72d3('0xa')](config[_0x72d3('0x9')],{'host':_0x72d3('0xb'),'port':0x18eb});var io=require(_0x72d3('0xc'))(new Redis(config[_0x72d3('0x9')]));function emit(_0x38fabd,_0x3d1f93,_0x55a7a3){io['to'](_0x38fabd)[_0x72d3('0xd')](_0x3d1f93,_0x55a7a3);}function getTicket(_0x3d1738,_0xcb11a4,_0x2d44fb,_0x49c325,_0x1a838b,_0x26443e,_0x8ed5fa,_0x59aa2c){var _0x326354=Object['assign']({},{'OwnerId':_0xcb11a4['id'],'Subject':intUtil[_0x72d3('0xe')](_0x49c325[_0x72d3('0xf')],_0x1a838b,'\x20'),'Description':intUtil['getString'](_0x49c325[_0x72d3('0x10')],_0x1a838b,'\x0a')},getCustomFields(_0x26443e,_0x1a838b));if(_0x2d44fb){if(_0x49c325['ticketType']===_0x72d3('0x11')){_0x326354[_0x72d3('0x12')]=moment[_0x72d3('0x13')]();_0x326354[_0x72d3('0x14')]=![];_0x326354[_0x72d3('0x15')]=![];if(_0x2d44fb[_0x72d3('0x16')]===_0x72d3('0x17')||_0x2d44fb[_0x72d3('0x16')]===_0x72d3('0x18')){_0x326354[_0x72d3('0x19')]=_0x2d44fb['id'];}else if(_0x2d44fb['endUserType']===_0x72d3('0x1a')){_0x326354[_0x72d3('0x1b')]=_0x2d44fb['id'];}}else if(_0x49c325[_0x72d3('0x1c')]===_0x72d3('0x1d')){if(_0x2d44fb[_0x72d3('0x16')]===_0x72d3('0x17')){_0x326354['ContactId']=_0x2d44fb['id'];}else if(_0x2d44fb[_0x72d3('0x16')]==='account'){_0x326354[_0x72d3('0x1e')]=_0x2d44fb['id'];}else if(_0x2d44fb[_0x72d3('0x16')]===_0x72d3('0x18')&&_0x49c325[_0x72d3('0x1f')]){_0x326354[_0x49c325['leadId']]=_0x2d44fb['id'];}else{logger[_0x72d3('0x20')](_0x72d3('0x21'));}}}return _0x8ed5fa[_0x72d3('0x22')](_0x49c325[_0x72d3('0x1c')])[_0x72d3('0x23')](_0x326354);}function getUser(_0x28705a,_0x7a2686,_0x1bebba){if(!_['isNil'](_0x7a2686)&&intUtil[_0x72d3('0x24')](_0x7a2686)){var _0xd6f6e1={'Email':_0x7a2686};var _0x549d16={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x1bebba[_0x72d3('0x22')](_0x72d3('0x25'))[_0x72d3('0x26')](_0xd6f6e1,_0x549d16)['execute']()[_0x72d3('0x27')](function(_0x51a507){if(_0x51a507['length']){var _0x12009f=_[_0x72d3('0x26')](_0x51a507,function(_0x249c0b){return _0x249c0b[_0x72d3('0x28')]===_0x7a2686;});if(_0x12009f){logger[_0x72d3('0x20')](_0x72d3('0x29'),_0x7a2686);return BPromise['resolve']({'id':_0x12009f['Id'],'name':_0x12009f[_0x72d3('0x2a')]});}}else{logger[_0x72d3('0x20')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x7a2686);return _0x1bebba[_0x72d3('0x2b')]()[_0x72d3('0x27')](function(_0x792e02){return BPromise[_0x72d3('0x2c')]({'id':_0x792e02['user_id'],'name':_0x792e02[_0x72d3('0x2d')]});});}});}else{logger[_0x72d3('0x20')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x7a2686);return _0x1bebba[_0x72d3('0x2b')]()[_0x72d3('0x27')](function(_0xc6a0cc){return BPromise[_0x72d3('0x2c')]({'id':_0xc6a0cc[_0x72d3('0x2e')],'name':_0xc6a0cc['display_name']});});}}function getEndUser(_0x49e052,_0x64f078,_0x37e1a6,_0x5ccbaf,_0x5d237f){var _0x561760={'$or':{'Phone':_0x5ccbaf}};var _0x1f9a08={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0x72d3('0x27')](function(){logger[_0x72d3('0x20')](_0x72d3('0x2f'),_0x5ccbaf,_0x64f078['moduleSearch']);switch(_0x64f078[_0x72d3('0x30')]){case _0x72d3('0x31'):var _0x1af2b9=_[_0x72d3('0x32')](_0x561760);if(_0x64f078['additionalSearchContact']){var _0x2f4ee2={};_0x2f4ee2[_0x64f078[_0x72d3('0x33')]]=_0x5ccbaf;_[_0x72d3('0x34')](_0x1af2b9[_0x72d3('0x35')],_0x2f4ee2);}return _0x5d237f[_0x72d3('0x22')](_0x72d3('0x36'))[_0x72d3('0x26')](_0x1af2b9,_0x1f9a08)['execute']()[_0x72d3('0x27')](function(_0x3c8b50){if(_0x3c8b50&&_0x3c8b50['length']){return _0x3c8b50;}else{var _0x207f75=_[_0x72d3('0x32')](_0x561760);if(_0x64f078[_0x72d3('0x37')]){var _0xfe1803={};_0xfe1803[_0x64f078[_0x72d3('0x37')]]=_0x5ccbaf;_[_0x72d3('0x34')](_0x207f75[_0x72d3('0x35')],_0xfe1803);}return _0x5d237f[_0x72d3('0x22')]('Lead')['find'](_0x207f75,_0x1f9a08);}});case _0x72d3('0x38'):var _0x5e537b=_[_0x72d3('0x32')](_0x561760);if(_0x64f078[_0x72d3('0x39')]){var _0x2f4ee2={};_0x2f4ee2[_0x64f078[_0x72d3('0x39')]]=_0x5ccbaf;_['merge'](_0x5e537b['$or'],_0x2f4ee2);}return _0x5d237f['sobject'](_0x72d3('0x3a'))[_0x72d3('0x26')](_0x5e537b,_0x1f9a08)[_0x72d3('0x3b')]()[_0x72d3('0x27')](function(_0x3510bc){if(_0x3510bc&&_0x3510bc[_0x72d3('0x3c')]){return _0x3510bc;}else{var _0x1b8242=_[_0x72d3('0x32')](_0x561760);if(_0x64f078['additionalSearchContact']){var _0x103330={};_0x103330[_0x64f078['additionalSearchContact']]=_0x5ccbaf;_[_0x72d3('0x34')](_0x1b8242['$or'],_0x103330);}return _0x5d237f[_0x72d3('0x22')](_0x72d3('0x36'))[_0x72d3('0x26')](_0x1b8242,_0x1f9a08)[_0x72d3('0x27')](function(_0x204539){if(_0x204539&&_0x204539[_0x72d3('0x3c')]){return _0x204539;}else{var _0x52cd76=_[_0x72d3('0x32')](_0x561760);if(_0x64f078[_0x72d3('0x37')]){var _0x3e2f3c={};_0x3e2f3c[_0x64f078[_0x72d3('0x37')]]=_0x5ccbaf;_[_0x72d3('0x34')](_0x52cd76['$or'],_0x3e2f3c);}return _0x5d237f[_0x72d3('0x22')](_0x72d3('0x3d'))['find'](_0x52cd76,_0x1f9a08);}});}});case _0x72d3('0x17'):var _0x1af2b9=_['cloneDeep'](_0x561760);if(_0x64f078[_0x72d3('0x33')]){var _0x2f4ee2={};_0x2f4ee2[_0x64f078[_0x72d3('0x33')]]=_0x5ccbaf;_['merge'](_0x1af2b9['$or'],_0x2f4ee2);}return _0x5d237f[_0x72d3('0x22')](_0x72d3('0x36'))[_0x72d3('0x26')](_0x1af2b9,_0x1f9a08)[_0x72d3('0x3b')]();case _0x72d3('0x18'):var _0x31c901=_['cloneDeep'](_0x561760);if(_0x64f078['additionalSearchLead']){var _0x2f4ee2={};_0x2f4ee2[_0x64f078[_0x72d3('0x37')]]=_0x5ccbaf;_[_0x72d3('0x34')](_0x31c901[_0x72d3('0x35')],_0x2f4ee2);}return _0x5d237f[_0x72d3('0x22')](_0x72d3('0x3d'))['find'](_0x31c901,_0x1f9a08);case _0x72d3('0x1a'):var _0x5e537b=_[_0x72d3('0x32')](_0x561760);if(_0x64f078[_0x72d3('0x39')]){var _0x2f4ee2={};_0x2f4ee2[_0x64f078['additionalSearchAccount']]=_0x5ccbaf;_['merge'](_0x5e537b[_0x72d3('0x35')],_0x2f4ee2);}return _0x5d237f['sobject'](_0x72d3('0x3a'))[_0x72d3('0x26')](_0x5e537b,_0x1f9a08);default:return null;}})[_0x72d3('0x27')](function(_0x2ab36c){if(_0x2ab36c&&_0x2ab36c[_0x72d3('0x3c')]){var _0x348270=_['first'](_0x2ab36c);if(_0x348270){return BPromise[_0x72d3('0x2c')]({'id':_0x348270['Id'],'name':_0x348270[_0x72d3('0x2a')],'phone':_0x348270['Phone'],'endUserType':_0x348270[_0x72d3('0x3e')][_0x72d3('0x3f')][_0x72d3('0x40')]()});}}})[_0x72d3('0x27')](function(_0x4fb0a6){if(_0x4fb0a6){logger[_0x72d3('0x20')](_0x72d3('0x41'),_0x4fb0a6[_0x72d3('0x16')],_0x5ccbaf);return BPromise[_0x72d3('0x2c')](_0x4fb0a6);}else{logger[_0x72d3('0x20')](_0x72d3('0x42'),_0x5ccbaf);var _0x3bd669={'Phone':_0x5ccbaf};if(_0x64f078[_0x72d3('0x43')]){if(_0x64f078[_0x72d3('0x43')]===_0x72d3('0x17')){logger[_0x72d3('0x20')](_0x72d3('0x44'),_0x5ccbaf,_0x64f078[_0x72d3('0x43')]);_0x3bd669['LastName']=_0x37e1a6!==_0x72d3('0x45')?_0x37e1a6:util['format'](_0x72d3('0x46'),_0x5ccbaf);}else if(_0x64f078[_0x72d3('0x43')]===_0x72d3('0x18')){logger['info'](_0x72d3('0x44'),_0x5ccbaf,_0x64f078[_0x72d3('0x43')]);_0x3bd669[_0x72d3('0x47')]=_0x37e1a6!==_0x72d3('0x45')?_0x37e1a6:util['format'](_0x72d3('0x46'),_0x5ccbaf);_0x3bd669[_0x72d3('0x48')]=_0x72d3('0x49');}else if(_0x64f078[_0x72d3('0x43')]==='account'){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x5ccbaf,_0x64f078[_0x72d3('0x43')]);_0x3bd669['Name']=_0x37e1a6!==_0x72d3('0x45')?_0x37e1a6:util[_0x72d3('0x4a')]('Caller\x20-\x20%s',_0x5ccbaf);}else{return null;}}return _0x5d237f['sobject'](_['upperFirst'](_0x64f078[_0x72d3('0x43')]))[_0x72d3('0x23')](_0x3bd669)['then'](function(_0x188aba){return BPromise[_0x72d3('0x2c')]({'id':_0x188aba['id'],'endUserType':_0x64f078[_0x72d3('0x43')]});});}});}function getCustomFields(_0x21cf29,_0x501c3d){var _0x478011={};if(_0x21cf29[_0x72d3('0x3c')]>0x0){_[_0x72d3('0x4b')](_0x21cf29,function(_0x511572){if(_[_0x72d3('0x4c')]([_0x72d3('0x4d'),_0x72d3('0x4e')],_0x511572[_0x72d3('0x3f')])&&_0x511572[_0x72d3('0x4f')]){_0x478011[_0x511572[_0x72d3('0x4f')]]=_0x511572[_0x72d3('0x50')]['toString']();}else if(_0x511572[_0x72d3('0x3f')]===_0x72d3('0x51')&&_0x511572[_0x72d3('0x52')]&&_0x511572[_0x72d3('0x4f')]){_0x501c3d[_0x511572[_0x72d3('0x52')]]&&(_0x478011[_0x511572[_0x72d3('0x4f')]]=_0x501c3d[_0x511572[_0x72d3('0x52')]][_0x72d3('0x53')]());}else if(_0x511572['type']===_0x72d3('0x54')&&_0x511572['Variable']&&_0x511572[_0x72d3('0x55')]['name']&&_0x511572[_0x72d3('0x4f')]){_0x501c3d[_0x511572[_0x72d3('0x55')]['name']['toLowerCase']()]&&(_0x478011[_0x511572['idField']]=_0x501c3d[_0x511572[_0x72d3('0x55')][_0x72d3('0x56')][_0x72d3('0x40')]()][_0x72d3('0x53')]());}});}return _0x478011;}function getConnection(_0x5e437d){var _0x3a8dd5=_0x5e437d['password'][_0x72d3('0x57')](_0x5e437d[_0x72d3('0x58')]);var _0x4aef62=new jsforce[(_0x72d3('0x59'))]({'oauth2':{'loginUrl':_0x5e437d['remoteUri']||'https://login.salesforce.com','clientId':_0x5e437d['clientId'],'clientSecret':_0x5e437d[_0x72d3('0x5a')]}});return _0x4aef62[_0x72d3('0x5b')](_0x5e437d[_0x72d3('0x5c')],_0x3a8dd5)[_0x72d3('0x27')](function(){logger[_0x72d3('0x20')](_0x72d3('0x5d'));return _0x4aef62;});}exports[_0x72d3('0x5e')]=function(_0x4e3a39,_0x149ea1,_0xc4b794,_0x4554cf,_0x2cb789,_0x539b87){var _0x13ac93,_0x16ee80,_0x181a81,_0x2d1bad;_0x539b87[_0x72d3('0x5f')]=intUtil[_0x72d3('0x60')](_0x539b87[_0x72d3('0x5f')]);_0x539b87[_0x72d3('0x61')]=intUtil[_0x72d3('0x60')](_0x539b87[_0x72d3('0x61')]);if(_0x2cb789&&_0x2cb789[_0x72d3('0x62')]){logger['info'](_0x72d3('0x63'),'Recording\x20is\x20enabled!');_0x149ea1[_0x72d3('0x64')]=util[_0x72d3('0x4a')](_0x72d3('0x65'),_0x539b87[_0x72d3('0x5f')],_0x149ea1[_0x72d3('0x66')],md5(_0x149ea1[_0x72d3('0x66')]));}else{_0x149ea1['recordingURL']='';}return getConnection(_0x539b87)[_0x72d3('0x27')](function(_0x2c8aea){_0x2d1bad=_0x2c8aea;return getUser(_0x539b87,_0x4554cf[_0x72d3('0x67')],_0x2d1bad);})[_0x72d3('0x27')](function(_0x4c1f47){_0x13ac93=_0x4c1f47;return getEndUser(_0x539b87,_0xc4b794,_0x149ea1['calleridname'],_0x149ea1[_0x72d3('0x68')],_0x2d1bad);})[_0x72d3('0x27')](function(_0x4c1b93){_0x16ee80=_0x4c1b93;return getTicket(_0x539b87,_0x13ac93,_0x16ee80,_0xc4b794,_0x149ea1,_0xc4b794[_0x72d3('0x69')],_0x2d1bad,_0x72d3('0x5e'));})[_0x72d3('0x27')](function(_0x131367){_0x181a81=_0x131367;logger[_0x72d3('0x20')](_0x72d3('0x6a'),_0x181a81['id']);logger[_0x72d3('0x20')](_0x72d3('0x6b'),_0x181a81['id'],_0x4554cf[_0x72d3('0x56')],_0x539b87[_0x72d3('0x3f')]);switch(_0x539b87['type']){case _0x72d3('0x6c'):emit(util[_0x72d3('0x4a')]('user:%s',_0x4554cf[_0x72d3('0x56')]),_0x72d3('0x6d'),{'recordId':_0x181a81['id']});break;case _0x72d3('0x6e'):emit(util['format'](_0x72d3('0x6f'),_0x4554cf[_0x72d3('0x56')]),_0x72d3('0x70'),{'uri':util[_0x72d3('0x4a')](_0x72d3('0x71'),_0x2d1bad[_0x72d3('0x72')],_0x181a81['id'])});break;default:logger['error'](_0x72d3('0x73'));}})[_0x72d3('0x74')](function(_0xf67aa9){logger['error'](_0x72d3('0x63'),_0xf67aa9);});};exports['outbound']=function(_0x6f21fa,_0x2f939c,_0x4e416c,_0x2c7470,_0x172003,_0x4fbcf0,_0x4ebb9a){var _0x54bd8c,_0x59db43,_0x4f87c8,_0x6bdb1d;_0x4fbcf0[_0x72d3('0x5f')]=intUtil[_0x72d3('0x60')](_0x4fbcf0['serverUrl']);_0x4fbcf0['remoteUri']=intUtil[_0x72d3('0x60')](_0x4fbcf0['remoteUri']);if(_0x4ebb9a&&_0x4ebb9a[_0x72d3('0x75')]&&_0x4ebb9a[_0x72d3('0x75')]!==_0x72d3('0x76')){logger[_0x72d3('0x20')]('[OUTBOUND]',_0x72d3('0x77'));_0x2f939c[_0x72d3('0x64')]=util['format'](_0x72d3('0x65'),_0x4fbcf0[_0x72d3('0x5f')],_0x2f939c[_0x72d3('0x66')],md5(_0x2f939c[_0x72d3('0x66')]));}return getConnection(_0x4fbcf0)[_0x72d3('0x27')](function(_0xffb7f3){_0x6bdb1d=_0xffb7f3;return getUser(_0x4fbcf0,_0x2c7470['email'],_0x6bdb1d);})['then'](function(_0x5670b9){_0x54bd8c=_0x5670b9;return getEndUser(_0x4fbcf0,_0x4e416c,_0x2f939c[_0x72d3('0x78')],_0x2f939c[_0x72d3('0x79')],_0x6bdb1d);})['then'](function(_0x32f31b){_0x59db43=_0x32f31b;return getTicket(_0x4fbcf0,_0x54bd8c,_0x59db43,_0x4e416c,_0x2f939c,_0x4e416c[_0x72d3('0x69')],_0x6bdb1d,_0x72d3('0x7a'));})[_0x72d3('0x27')](function(_0x4a10a0){_0x4f87c8=_0x4a10a0;logger['info']('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x4f87c8['id']);logger[_0x72d3('0x20')](_0x72d3('0x7b'),_0x4f87c8['id'],_0x2c7470[_0x72d3('0x56')],_0x4fbcf0[_0x72d3('0x3f')]);switch(_0x4fbcf0[_0x72d3('0x3f')]){case _0x72d3('0x6c'):emit(util[_0x72d3('0x4a')](_0x72d3('0x6f'),_0x2c7470[_0x72d3('0x56')]),'trigger:salesforce:display',{'recordId':_0x4f87c8['id']});break;case'newTab':emit(util[_0x72d3('0x4a')](_0x72d3('0x6f'),_0x2c7470[_0x72d3('0x56')]),_0x72d3('0x70'),{'uri':util[_0x72d3('0x4a')](_0x72d3('0x71'),_0x6bdb1d[_0x72d3('0x72')],_0x4f87c8['id'])});break;default:logger[_0x72d3('0x7c')](_0x72d3('0x7d'),_0x72d3('0x7e'));}})['catch'](function(_0x5a9c5e){logger[_0x72d3('0x7c')](_0x72d3('0x7d'),_0x5a9c5e);});};exports[_0x72d3('0x7f')]=function(_0x135d84,_0xcaf992,_0x4bfc43,_0x5f1808,_0x55c3ea,_0x213b36){var _0xd6bca0,_0x16d0fd,_0x3f5437,_0x5796fc;_0x213b36[_0x72d3('0x5f')]=intUtil[_0x72d3('0x60')](_0x213b36[_0x72d3('0x5f')]);_0x213b36[_0x72d3('0x61')]=intUtil[_0x72d3('0x60')](_0x213b36['remoteUri']);if(_0x55c3ea&&_0x55c3ea[_0x72d3('0x62')]){logger[_0x72d3('0x20')]('['+_0xcaf992[_0x72d3('0x80')]['toUpperCase']()+']',_0x72d3('0x77'));_0xcaf992['recordingURL']=util['format'](_0x72d3('0x65'),_0x213b36[_0x72d3('0x5f')],_0xcaf992['uniqueid'],md5(_0xcaf992[_0x72d3('0x66')]));}else{_0xcaf992[_0x72d3('0x64')]='';}return getConnection(_0x213b36)['then'](function(_0x277f42){_0x5796fc=_0x277f42;if(!_['isNil'](_0x5f1808)){return getUser(_0x213b36,_0x5f1808[_0x72d3('0x56')],_0x5796fc);}else{return getUser(_0x213b36,null,_0x5796fc);}})[_0x72d3('0x27')](function(_0x2024e2){_0xd6bca0=_0x2024e2;return getEndUser(_0x213b36,_0x4bfc43,_0xcaf992[_0x72d3('0x81')],_0xcaf992[_0x72d3('0x68')],_0x5796fc);})['then'](function(_0x4d382e){_0x16d0fd=_0x4d382e;return getTicket(_0x213b36,_0xd6bca0,_0x16d0fd,_0x4bfc43,_0xcaf992,_0x4bfc43['Fields'],_0x5796fc);})[_0x72d3('0x27')](function(_0x5bd5cc){_0x3f5437=_0x5bd5cc;logger[_0x72d3('0x20')]('['+_0xcaf992[_0x72d3('0x80')][_0x72d3('0x82')]()+_0x72d3('0x83'),_0x3f5437['id']);logger[_0x72d3('0x20')]('['+_0xcaf992[_0x72d3('0x80')][_0x72d3('0x82')]()+_0x72d3('0x84'),_0x213b36['type']);})[_0x72d3('0x74')](function(_0x411ac9){logger[_0x72d3('0x7c')]('['+_0xcaf992['lastevent'][_0x72d3('0x82')]()+']',_0x411ac9);});}; \ No newline at end of file +var _0xa63a=['upperFirst','forEach','includes','idField','toString','variable','variableName','customVariable','Variable','name','password','concat','securityToken','Connection','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','serverUrl','stripTrailingSlash','remoteUri','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','queue','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','user:%s','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','error','[QUEUE]','recordingFormat','none','[OUTBOUND]','outbound','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','%s/%s/e','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','jsforce','util','ioredis','./util','../../../../config/environment','redis','defaults','emit','assign','Subjects','Descriptions','ticketType','Task','ActivityDate','IsReminderSet','IsRecurrence','endUserType','lead','WhoId','account','WhatId','Case','contact','AccountId','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','create','isNil','validateEmail','sobject','find','execute','then','Email','info','Agent\x20%s\x20found.','identity','user_id','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','resolve','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','length','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','first','Name','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','','Caller\x20-\x20%s','Company','No\x20Company','format'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xa63a,0xb9));var _0xaa63=function(_0x40b2ed,_0x2b1765){_0x40b2ed=_0x40b2ed-0x0;var _0x18397d=_0xa63a[_0x40b2ed];return _0x18397d;};'use strict';var _=require(_0xaa63('0x0'));var rp=require(_0xaa63('0x1'));var moment=require(_0xaa63('0x2'));var BPromise=require(_0xaa63('0x3'));var md5=require('md5');var jsforce=require(_0xaa63('0x4'));var util=require(_0xaa63('0x5'));var Redis=require(_0xaa63('0x6'));var intUtil=require(_0xaa63('0x7'));var config=require(_0xaa63('0x8'));var logger=require('../../../../config/logger')('salesforce');config[_0xaa63('0x9')]=_[_0xaa63('0xa')](config[_0xaa63('0x9')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x2fa089,_0x40415c,_0x448632){io['to'](_0x2fa089)[_0xaa63('0xb')](_0x40415c,_0x448632);}function getTicket(_0x25c6dd,_0xa3d59a,_0x303372,_0x30fce0,_0x7559d0,_0x46e427,_0x1a1f8c,_0x29b370){var _0x18b42b=Object[_0xaa63('0xc')]({},{'OwnerId':_0xa3d59a['id'],'Subject':intUtil['getString'](_0x30fce0[_0xaa63('0xd')],_0x7559d0,'\x20'),'Description':intUtil['getString'](_0x30fce0[_0xaa63('0xe')],_0x7559d0,'\x0a')},getCustomFields(_0x46e427,_0x7559d0));if(_0x303372){if(_0x30fce0[_0xaa63('0xf')]===_0xaa63('0x10')){_0x18b42b[_0xaa63('0x11')]=moment['utc']();_0x18b42b[_0xaa63('0x12')]=![];_0x18b42b[_0xaa63('0x13')]=![];if(_0x303372[_0xaa63('0x14')]==='contact'||_0x303372[_0xaa63('0x14')]===_0xaa63('0x15')){_0x18b42b[_0xaa63('0x16')]=_0x303372['id'];}else if(_0x303372['endUserType']===_0xaa63('0x17')){_0x18b42b[_0xaa63('0x18')]=_0x303372['id'];}}else if(_0x30fce0[_0xaa63('0xf')]===_0xaa63('0x19')){if(_0x303372[_0xaa63('0x14')]===_0xaa63('0x1a')){_0x18b42b['ContactId']=_0x303372['id'];}else if(_0x303372[_0xaa63('0x14')]===_0xaa63('0x17')){_0x18b42b[_0xaa63('0x1b')]=_0x303372['id'];}else if(_0x303372['endUserType']==='lead'&&_0x30fce0[_0xaa63('0x1c')]){_0x18b42b[_0x30fce0['leadId']]=_0x303372['id'];}else{logger['info'](_0xaa63('0x1d'));}}}return _0x1a1f8c['sobject'](_0x30fce0[_0xaa63('0xf')])[_0xaa63('0x1e')](_0x18b42b);}function getUser(_0x305c73,_0x5bddb8,_0x10f0d9){if(!_[_0xaa63('0x1f')](_0x5bddb8)&&intUtil[_0xaa63('0x20')](_0x5bddb8)){var _0x299537={'Email':_0x5bddb8};var _0x41c132={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x10f0d9[_0xaa63('0x21')]('User')[_0xaa63('0x22')](_0x299537,_0x41c132)[_0xaa63('0x23')]()[_0xaa63('0x24')](function(_0x1661f2){if(_0x1661f2['length']){var _0x3d3234=_['find'](_0x1661f2,function(_0x5554bd){return _0x5554bd[_0xaa63('0x25')]===_0x5bddb8;});if(_0x3d3234){logger[_0xaa63('0x26')](_0xaa63('0x27'),_0x5bddb8);return BPromise['resolve']({'id':_0x3d3234['Id'],'name':_0x3d3234['Name']});}}else{logger[_0xaa63('0x26')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x5bddb8);return _0x10f0d9[_0xaa63('0x28')]()[_0xaa63('0x24')](function(_0x3f12f0){return BPromise['resolve']({'id':_0x3f12f0[_0xaa63('0x29')],'name':_0x3f12f0[_0xaa63('0x2a')]});});}});}else{logger[_0xaa63('0x26')](_0xaa63('0x2b'),_0x5bddb8);return _0x10f0d9['identity']()[_0xaa63('0x24')](function(_0x4cba16){return BPromise[_0xaa63('0x2c')]({'id':_0x4cba16[_0xaa63('0x29')],'name':_0x4cba16['display_name']});});}}function getEndUser(_0x3d5e39,_0x105bf3,_0x377de8,_0x5f0c1f,_0x5f335c){var _0x1eee92={'$or':{'Phone':_0x5f0c1f}};var _0x1ea35b={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xaa63('0x2c')]()[_0xaa63('0x24')](function(){logger['info'](_0xaa63('0x2d'),_0x5f0c1f,_0x105bf3['moduleSearch']);switch(_0x105bf3[_0xaa63('0x2e')]){case _0xaa63('0x2f'):var _0x34e62a=_[_0xaa63('0x30')](_0x1eee92);if(_0x105bf3[_0xaa63('0x31')]){var _0x1d69e1={};_0x1d69e1[_0x105bf3[_0xaa63('0x31')]]=_0x5f0c1f;_[_0xaa63('0x32')](_0x34e62a[_0xaa63('0x33')],_0x1d69e1);}return _0x5f335c[_0xaa63('0x21')](_0xaa63('0x34'))[_0xaa63('0x22')](_0x34e62a,_0x1ea35b)['execute']()[_0xaa63('0x24')](function(_0x2254a9){if(_0x2254a9&&_0x2254a9[_0xaa63('0x35')]){return _0x2254a9;}else{var _0x1134ad=_[_0xaa63('0x30')](_0x1eee92);if(_0x105bf3[_0xaa63('0x36')]){var _0x26a737={};_0x26a737[_0x105bf3['additionalSearchLead']]=_0x5f0c1f;_['merge'](_0x1134ad['$or'],_0x26a737);}return _0x5f335c['sobject'](_0xaa63('0x37'))[_0xaa63('0x22')](_0x1134ad,_0x1ea35b);}});case _0xaa63('0x38'):var _0x57f033=_[_0xaa63('0x30')](_0x1eee92);if(_0x105bf3[_0xaa63('0x39')]){var _0x1d69e1={};_0x1d69e1[_0x105bf3[_0xaa63('0x39')]]=_0x5f0c1f;_[_0xaa63('0x32')](_0x57f033['$or'],_0x1d69e1);}return _0x5f335c[_0xaa63('0x21')]('Account')[_0xaa63('0x22')](_0x57f033,_0x1ea35b)[_0xaa63('0x23')]()[_0xaa63('0x24')](function(_0x1ae47a){if(_0x1ae47a&&_0x1ae47a[_0xaa63('0x35')]){return _0x1ae47a;}else{var _0x47d98c=_[_0xaa63('0x30')](_0x1eee92);if(_0x105bf3['additionalSearchContact']){var _0x17ee34={};_0x17ee34[_0x105bf3[_0xaa63('0x31')]]=_0x5f0c1f;_['merge'](_0x47d98c[_0xaa63('0x33')],_0x17ee34);}return _0x5f335c[_0xaa63('0x21')](_0xaa63('0x34'))[_0xaa63('0x22')](_0x47d98c,_0x1ea35b)[_0xaa63('0x24')](function(_0x1196cb){if(_0x1196cb&&_0x1196cb['length']){return _0x1196cb;}else{var _0xbd6ae=_[_0xaa63('0x30')](_0x1eee92);if(_0x105bf3[_0xaa63('0x36')]){var _0x572867={};_0x572867[_0x105bf3['additionalSearchLead']]=_0x5f0c1f;_[_0xaa63('0x32')](_0xbd6ae[_0xaa63('0x33')],_0x572867);}return _0x5f335c[_0xaa63('0x21')]('Lead')[_0xaa63('0x22')](_0xbd6ae,_0x1ea35b);}});}});case'contact':var _0x34e62a=_['cloneDeep'](_0x1eee92);if(_0x105bf3[_0xaa63('0x31')]){var _0x1d69e1={};_0x1d69e1[_0x105bf3[_0xaa63('0x31')]]=_0x5f0c1f;_['merge'](_0x34e62a[_0xaa63('0x33')],_0x1d69e1);}return _0x5f335c[_0xaa63('0x21')](_0xaa63('0x34'))['find'](_0x34e62a,_0x1ea35b)[_0xaa63('0x23')]();case _0xaa63('0x15'):var _0xf0a1c6=_['cloneDeep'](_0x1eee92);if(_0x105bf3[_0xaa63('0x36')]){var _0x1d69e1={};_0x1d69e1[_0x105bf3[_0xaa63('0x36')]]=_0x5f0c1f;_[_0xaa63('0x32')](_0xf0a1c6[_0xaa63('0x33')],_0x1d69e1);}return _0x5f335c[_0xaa63('0x21')]('Lead')[_0xaa63('0x22')](_0xf0a1c6,_0x1ea35b);case _0xaa63('0x17'):var _0x57f033=_[_0xaa63('0x30')](_0x1eee92);if(_0x105bf3[_0xaa63('0x39')]){var _0x1d69e1={};_0x1d69e1[_0x105bf3[_0xaa63('0x39')]]=_0x5f0c1f;_['merge'](_0x57f033['$or'],_0x1d69e1);}return _0x5f335c[_0xaa63('0x21')](_0xaa63('0x3a'))[_0xaa63('0x22')](_0x57f033,_0x1ea35b);default:return null;}})[_0xaa63('0x24')](function(_0x302988){if(_0x302988&&_0x302988[_0xaa63('0x35')]){var _0x297d4d=_[_0xaa63('0x3b')](_0x302988);if(_0x297d4d){return BPromise['resolve']({'id':_0x297d4d['Id'],'name':_0x297d4d[_0xaa63('0x3c')],'phone':_0x297d4d[_0xaa63('0x3d')],'endUserType':_0x297d4d[_0xaa63('0x3e')][_0xaa63('0x3f')][_0xaa63('0x40')]()});}}})[_0xaa63('0x24')](function(_0x540226){if(_0x540226){logger['info'](_0xaa63('0x41'),_0x540226['endUserType'],_0x5f0c1f);return BPromise[_0xaa63('0x2c')](_0x540226);}else{logger[_0xaa63('0x26')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x5f0c1f);var _0x1a7d1f={'Phone':_0x5f0c1f};if(_0x105bf3[_0xaa63('0x42')]){if(_0x105bf3[_0xaa63('0x42')]==='contact'){logger[_0xaa63('0x26')](_0xaa63('0x43'),_0x5f0c1f,_0x105bf3[_0xaa63('0x42')]);_0x1a7d1f['LastName']=_0x377de8!==_0xaa63('0x44')?_0x377de8:util['format'](_0xaa63('0x45'),_0x5f0c1f);}else if(_0x105bf3['moduleCreate']===_0xaa63('0x15')){logger[_0xaa63('0x26')](_0xaa63('0x43'),_0x5f0c1f,_0x105bf3[_0xaa63('0x42')]);_0x1a7d1f['LastName']=_0x377de8!==_0xaa63('0x44')?_0x377de8:util['format'](_0xaa63('0x45'),_0x5f0c1f);_0x1a7d1f[_0xaa63('0x46')]=_0xaa63('0x47');}else if(_0x105bf3[_0xaa63('0x42')]===_0xaa63('0x17')){logger[_0xaa63('0x26')](_0xaa63('0x43'),_0x5f0c1f,_0x105bf3[_0xaa63('0x42')]);_0x1a7d1f[_0xaa63('0x3c')]=_0x377de8!==_0xaa63('0x44')?_0x377de8:util[_0xaa63('0x48')]('Caller\x20-\x20%s',_0x5f0c1f);}else{return null;}}return _0x5f335c[_0xaa63('0x21')](_[_0xaa63('0x49')](_0x105bf3[_0xaa63('0x42')]))['create'](_0x1a7d1f)[_0xaa63('0x24')](function(_0x1d8fa3){return BPromise['resolve']({'id':_0x1d8fa3['id'],'endUserType':_0x105bf3[_0xaa63('0x42')]});});}});}function getCustomFields(_0x4d3ae5,_0x3a89d2){var _0x59da1b={};if(_0x4d3ae5[_0xaa63('0x35')]>0x0){_[_0xaa63('0x4a')](_0x4d3ae5,function(_0x3e3f34){if(_[_0xaa63('0x4b')](['string','picklist'],_0x3e3f34[_0xaa63('0x3f')])&&_0x3e3f34[_0xaa63('0x4c')]){_0x59da1b[_0x3e3f34['idField']]=_0x3e3f34['content'][_0xaa63('0x4d')]();}else if(_0x3e3f34[_0xaa63('0x3f')]===_0xaa63('0x4e')&&_0x3e3f34[_0xaa63('0x4f')]&&_0x3e3f34[_0xaa63('0x4c')]){_0x3a89d2[_0x3e3f34[_0xaa63('0x4f')]]&&(_0x59da1b[_0x3e3f34[_0xaa63('0x4c')]]=_0x3a89d2[_0x3e3f34[_0xaa63('0x4f')]][_0xaa63('0x4d')]());}else if(_0x3e3f34['type']===_0xaa63('0x50')&&_0x3e3f34[_0xaa63('0x51')]&&_0x3e3f34[_0xaa63('0x51')][_0xaa63('0x52')]&&_0x3e3f34['idField']){_0x3a89d2[_0x3e3f34[_0xaa63('0x51')][_0xaa63('0x52')]['toLowerCase']()]&&(_0x59da1b[_0x3e3f34[_0xaa63('0x4c')]]=_0x3a89d2[_0x3e3f34[_0xaa63('0x51')]['name'][_0xaa63('0x40')]()][_0xaa63('0x4d')]());}});}return _0x59da1b;}function getConnection(_0x2caaf6){var _0x55bd02=_0x2caaf6[_0xaa63('0x53')][_0xaa63('0x54')](_0x2caaf6[_0xaa63('0x55')]);var _0x521706=new jsforce[(_0xaa63('0x56'))]({'oauth2':{'loginUrl':_0x2caaf6['remoteUri']||_0xaa63('0x57'),'clientId':_0x2caaf6[_0xaa63('0x58')],'clientSecret':_0x2caaf6[_0xaa63('0x59')]}});return _0x521706[_0xaa63('0x5a')](_0x2caaf6[_0xaa63('0x5b')],_0x55bd02)[_0xaa63('0x24')](function(){logger[_0xaa63('0x26')](_0xaa63('0x5c'));return _0x521706;});}exports['queue']=function(_0x23d96a,_0x16dd88,_0x539b20,_0x1a90d2,_0xd4129b,_0x3b3f9f){var _0x13ab4e,_0x47dcbc,_0x4c297a,_0x609b8f;_0x3b3f9f[_0xaa63('0x5d')]=intUtil[_0xaa63('0x5e')](_0x3b3f9f[_0xaa63('0x5d')]);_0x3b3f9f[_0xaa63('0x5f')]=intUtil[_0xaa63('0x5e')](_0x3b3f9f[_0xaa63('0x5f')]);if(_0xd4129b&&_0xd4129b[_0xaa63('0x60')]){logger[_0xaa63('0x26')]('[QUEUE]',_0xaa63('0x61'));_0x16dd88[_0xaa63('0x62')]=util[_0xaa63('0x48')](_0xaa63('0x63'),_0x3b3f9f[_0xaa63('0x5d')],_0x16dd88[_0xaa63('0x64')],md5(_0x16dd88[_0xaa63('0x64')]));}else{_0x16dd88[_0xaa63('0x62')]='';}return getConnection(_0x3b3f9f)[_0xaa63('0x24')](function(_0x399cc4){_0x609b8f=_0x399cc4;return getUser(_0x3b3f9f,_0x1a90d2[_0xaa63('0x65')],_0x609b8f);})['then'](function(_0xfe34bd){_0x13ab4e=_0xfe34bd;return getEndUser(_0x3b3f9f,_0x539b20,_0x16dd88[_0xaa63('0x66')],_0x16dd88[_0xaa63('0x67')],_0x609b8f);})[_0xaa63('0x24')](function(_0xd912f8){_0x47dcbc=_0xd912f8;return getTicket(_0x3b3f9f,_0x13ab4e,_0x47dcbc,_0x539b20,_0x16dd88,_0x539b20[_0xaa63('0x68')],_0x609b8f,_0xaa63('0x69'));})['then'](function(_0x5bd025){_0x4c297a=_0x5bd025;logger[_0xaa63('0x26')](_0xaa63('0x6a'),_0x4c297a['id']);logger['info'](_0xaa63('0x6b'),_0x4c297a['id'],_0x1a90d2[_0xaa63('0x52')],_0x3b3f9f[_0xaa63('0x3f')]);switch(_0x3b3f9f[_0xaa63('0x3f')]){case _0xaa63('0x6c'):emit(util[_0xaa63('0x48')]('user:%s',_0x1a90d2[_0xaa63('0x52')]),_0xaa63('0x6d'),{'recordId':_0x4c297a['id']});break;case'newTab':emit(util[_0xaa63('0x48')](_0xaa63('0x6e'),_0x1a90d2[_0xaa63('0x52')]),'trigger:browser:url',{'uri':util[_0xaa63('0x48')]('%s/%s/e',_0x609b8f['instanceUrl'],_0x4c297a['id'])});break;default:logger['error'](_0xaa63('0x6f'));}})[_0xaa63('0x70')](function(_0x35bfa4){logger[_0xaa63('0x71')](_0xaa63('0x72'),_0x35bfa4);});};exports['outbound']=function(_0x28d81c,_0x4f4105,_0x277d8d,_0x1cffa6,_0x9cffa5,_0x37891b,_0x1968be){var _0x3b3561,_0x37940a,_0x15cacd,_0x51331e;_0x37891b[_0xaa63('0x5d')]=intUtil[_0xaa63('0x5e')](_0x37891b[_0xaa63('0x5d')]);_0x37891b[_0xaa63('0x5f')]=intUtil['stripTrailingSlash'](_0x37891b[_0xaa63('0x5f')]);if(_0x1968be&&_0x1968be[_0xaa63('0x73')]&&_0x1968be[_0xaa63('0x73')]!==_0xaa63('0x74')){logger[_0xaa63('0x26')](_0xaa63('0x75'),_0xaa63('0x61'));_0x4f4105[_0xaa63('0x62')]=util[_0xaa63('0x48')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x37891b[_0xaa63('0x5d')],_0x4f4105['uniqueid'],md5(_0x4f4105[_0xaa63('0x64')]));}return getConnection(_0x37891b)['then'](function(_0x35fa42){_0x51331e=_0x35fa42;return getUser(_0x37891b,_0x1cffa6[_0xaa63('0x65')],_0x51331e);})[_0xaa63('0x24')](function(_0x3058c2){_0x3b3561=_0x3058c2;return getEndUser(_0x37891b,_0x277d8d,_0x4f4105['destcalleridname'],_0x4f4105['destcalleridnum'],_0x51331e);})[_0xaa63('0x24')](function(_0x321663){_0x37940a=_0x321663;return getTicket(_0x37891b,_0x3b3561,_0x37940a,_0x277d8d,_0x4f4105,_0x277d8d[_0xaa63('0x68')],_0x51331e,_0xaa63('0x76'));})['then'](function(_0x5ec2fa){_0x15cacd=_0x5ec2fa;logger[_0xaa63('0x26')](_0xaa63('0x77'),_0x15cacd['id']);logger[_0xaa63('0x26')](_0xaa63('0x78'),_0x15cacd['id'],_0x1cffa6[_0xaa63('0x52')],_0x37891b['type']);switch(_0x37891b[_0xaa63('0x3f')]){case _0xaa63('0x6c'):emit(util[_0xaa63('0x48')](_0xaa63('0x6e'),_0x1cffa6[_0xaa63('0x52')]),_0xaa63('0x6d'),{'recordId':_0x15cacd['id']});break;case _0xaa63('0x79'):emit(util[_0xaa63('0x48')](_0xaa63('0x6e'),_0x1cffa6[_0xaa63('0x52')]),'trigger:browser:url',{'uri':util[_0xaa63('0x48')](_0xaa63('0x7a'),_0x51331e['instanceUrl'],_0x15cacd['id'])});break;default:logger['error'](_0xaa63('0x75'),_0xaa63('0x7b'));}})[_0xaa63('0x70')](function(_0x2a484d){logger[_0xaa63('0x71')]('[OUTBOUND]',_0x2a484d);});};exports[_0xaa63('0x7c')]=function(_0x33b598,_0x2033d0,_0x71f162,_0x36265d,_0x4d1d18,_0x5e5962){var _0x5e6f2d,_0x46a890,_0x162886,_0x28204e;_0x5e5962[_0xaa63('0x5d')]=intUtil['stripTrailingSlash'](_0x5e5962['serverUrl']);_0x5e5962[_0xaa63('0x5f')]=intUtil[_0xaa63('0x5e')](_0x5e5962[_0xaa63('0x5f')]);if(_0x4d1d18&&_0x4d1d18[_0xaa63('0x60')]){logger[_0xaa63('0x26')]('['+_0x2033d0[_0xaa63('0x7d')]['toUpperCase']()+']',_0xaa63('0x61'));_0x2033d0['recordingURL']=util[_0xaa63('0x48')](_0xaa63('0x63'),_0x5e5962['serverUrl'],_0x2033d0[_0xaa63('0x64')],md5(_0x2033d0[_0xaa63('0x64')]));}else{_0x2033d0['recordingURL']='';}return getConnection(_0x5e5962)['then'](function(_0x50bdd6){_0x28204e=_0x50bdd6;if(!_[_0xaa63('0x1f')](_0x36265d)){return getUser(_0x5e5962,_0x36265d['name'],_0x28204e);}else{return getUser(_0x5e5962,null,_0x28204e);}})[_0xaa63('0x24')](function(_0xf153c){_0x5e6f2d=_0xf153c;return getEndUser(_0x5e5962,_0x71f162,_0x2033d0[_0xaa63('0x66')],_0x2033d0[_0xaa63('0x67')],_0x28204e);})[_0xaa63('0x24')](function(_0x5d25f2){_0x46a890=_0x5d25f2;return getTicket(_0x5e5962,_0x5e6f2d,_0x46a890,_0x71f162,_0x2033d0,_0x71f162[_0xaa63('0x68')],_0x28204e);})[_0xaa63('0x24')](function(_0x4bda80){_0x162886=_0x4bda80;logger[_0xaa63('0x26')]('['+_0x2033d0[_0xaa63('0x7d')][_0xaa63('0x7e')]()+_0xaa63('0x7f'),_0x162886['id']);logger['info']('['+_0x2033d0[_0xaa63('0x7d')][_0xaa63('0x7e')]()+_0xaa63('0x80'),_0x5e5962[_0xaa63('0x3f')]);})[_0xaa63('0x70')](function(_0x4c15f3){logger[_0xaa63('0x71')]('['+_0x2033d0[_0xaa63('0x7d')][_0xaa63('0x7e')]()+']',_0x4c15f3);});}; \ 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 0c5ecae..28957e3 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 _0xf8b8=['catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','active','userId','sys_id','userEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','sys_user?','endUserNumber','user','true','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','picklist','type','customField','nameField','toLowerCase','content','toString','idField','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','POST','incident','assign','Subjects','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','Incident\x20-\x20','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','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','email','adminEmail','destcalleridnum','calleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','request-promise','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','info','toUpperCase','],\x20getAdminUser\x20crm'];(function(_0x3b231a,_0x53a00d){var _0x18d67a=function(_0x5e14c6){while(--_0x5e14c6){_0x3b231a['push'](_0x3b231a['shift']());}};_0x18d67a(++_0x53a00d);}(_0xf8b8,0x1b7));var _0x8f8b=function(_0x342b26,_0x1d8862){_0x342b26=_0x342b26-0x0;var _0x1f3d90=_0xf8b8[_0x342b26];return _0x1f3d90;};'use strict';var _=require(_0x8f8b('0x0'));var Promise=require('bluebird');var rp=require(_0x8f8b('0x1'));var util=require(_0x8f8b('0x2'));var md5=require(_0x8f8b('0x3'));var Redis=require(_0x8f8b('0x4'));var intUtil=require(_0x8f8b('0x5'));var config=require(_0x8f8b('0x6'));var logger=require(_0x8f8b('0x7'))('servicenow');config[_0x8f8b('0x8')]=_[_0x8f8b('0x9')](config['redis'],{'host':_0x8f8b('0xa'),'port':0x18eb});var io=require(_0x8f8b('0xb'))(new Redis(config[_0x8f8b('0x8')]));function getAdminUser(_0x366ced,_0x33b33f,_0x37d8fa,_0x308742,_0x2838d0,_0x2d33ec){return new Promise(function(_0x3aec4e,_0x3d6d40){var _0x21a5a2={'method':_0x8f8b('0xc'),'uri':_0x308742+_0x8f8b('0xd')+'&'+_0x2838d0+'&'+_0x2d33ec,'auth':_0x33b33f,'json':!![]};return rp(_0x21a5a2)[_0x8f8b('0xe')](function(_0x44b7d7){if(_0x44b7d7[_0x8f8b('0xf')][_0x8f8b('0x10')]>0x0){_0x37d8fa[_0x8f8b('0x11')]=_0x44b7d7[_0x8f8b('0xf')][0x0]['sys_id'];}logger[_0x8f8b('0x12')]('['+[_0x366ced[_0x8f8b('0x13')]()]+_0x8f8b('0x14'),_0x37d8fa);_0x3aec4e(_0x37d8fa);})[_0x8f8b('0x15')](function(_0x41a812){logger[_0x8f8b('0x16')]('['+[_0x366ced[_0x8f8b('0x13')]()]+']',_0x41a812[_0x8f8b('0x17')]);_0x3d6d40(_0x41a812[_0x8f8b('0x17')]);});});}function getUser(_0x264225,_0x546058,_0x1e7a9c,_0x5ee454,_0x1eaf3b){return function(_0x488450){logger[_0x8f8b('0x12')]('['+[_0x264225[_0x8f8b('0x13')]()]+_0x8f8b('0x18'),_0x488450);return new Promise(function(_0x2a0b3e,_0x8e70f){if(intUtil[_0x8f8b('0x19')](_0x488450['userEmail'])){var _0x4540c9={'method':_0x8f8b('0xc'),'uri':_0x1e7a9c+_0x8f8b('0x1a')+_0x488450['userEmail']+'&'+_0x5ee454+'&'+_0x1eaf3b,'auth':_0x546058,'json':!![]};logger[_0x8f8b('0x12')]('['+[_0x264225[_0x8f8b('0x13')]()]+_0x8f8b('0x1b'),_0x4540c9);return rp(_0x4540c9)[_0x8f8b('0xe')](function(_0x1d4d73){logger[_0x8f8b('0x12')]('['+[_0x264225[_0x8f8b('0x13')]()]+'],\x20getUser\x20entity',_0x1d4d73);if(_0x1d4d73['result'][_0x8f8b('0x10')]>0x0&&String(_0x1d4d73[_0x8f8b('0xf')][0x0][_0x8f8b('0x1c')])==='true'){_0x488450[_0x8f8b('0x1d')]=_0x1d4d73['result'][0x0][_0x8f8b('0x1e')];}else{_0x488450[_0x8f8b('0x1d')]=_0x488450[_0x8f8b('0x11')];_0x488450[_0x8f8b('0x1f')]=_0x488450['adminEmail'];}logger[_0x8f8b('0x12')]('['+[_0x264225[_0x8f8b('0x13')]()]+_0x8f8b('0x20'),_0x488450);_0x2a0b3e(_0x488450);})[_0x8f8b('0x15')](function(_0x2718cc){logger[_0x8f8b('0x16')]('['+[_0x264225[_0x8f8b('0x13')]()]+']',_0x2718cc[_0x8f8b('0x17')]);_0x8e70f(_0x2718cc[_0x8f8b('0x17')]);});}else{logger[_0x8f8b('0x12')]('['+[_0x264225['toUpperCase']()]+_0x8f8b('0x21'));_0x488450[_0x8f8b('0x1d')]=_0x488450[_0x8f8b('0x11')];_0x488450['userEmail']=_0x488450['adminEmail'];_0x2a0b3e(_0x488450);}});};}function createEndUser(_0x12b099,_0x33843f,_0x9eff54,_0x349fbe,_0x67839d){logger[_0x8f8b('0x12')]('['+[_0x12b099[_0x8f8b('0x13')]()]+_0x8f8b('0x22'),_0x9eff54);return new Promise(function(_0x279c07,_0xc221f8){var _0x15cf60={'method':'POST','uri':_0x349fbe+_0x8f8b('0x23')+_0x67839d,'body':{'user_name':_0x9eff54[_0x8f8b('0x24')],'roles':_0x8f8b('0x25'),'first_name':_0x9eff54[_0x8f8b('0x24')],'active':_0x8f8b('0x26'),'date_format':'System','phone':_0x9eff54['endUserNumber']},'auth':_0x33843f,'json':!![]};return rp(_0x15cf60)[_0x8f8b('0xe')](function(_0x3ebe99){logger[_0x8f8b('0x12')]('['+[_0x12b099[_0x8f8b('0x13')]()]+_0x8f8b('0x27'),_0x3ebe99[_0x8f8b('0xf')]);_0x9eff54[_0x8f8b('0x28')]=_0x3ebe99[_0x8f8b('0xf')]['sys_id'];_0x279c07(_0x9eff54);})['catch'](function(_0x2d64b5){logger['error']('['+[_0x12b099['toUpperCase']()]+']',_0x2d64b5[_0x8f8b('0x17')]);_0xc221f8(_0x2d64b5[_0x8f8b('0x17')]);});});}function getEndUser(_0x2b29d8,_0x303b4f,_0xb9d95b,_0x2207f8,_0x546399){return function(_0x4b5c1e){logger[_0x8f8b('0x12')]('['+[_0x2b29d8['toUpperCase']()]+_0x8f8b('0x29'),_0x4b5c1e);return new Promise(function(_0xfe94de,_0x3cb79b){var _0x3d3c06={'method':_0x8f8b('0xc'),'uri':_0xb9d95b+_0x8f8b('0x2a')+_0x4b5c1e[_0x8f8b('0x24')]+'&'+_0x2207f8+'&'+_0x546399,'auth':_0x303b4f,'json':!![]};return rp(_0x3d3c06)[_0x8f8b('0xe')](function(_0x4394ba){if(_0x4394ba[_0x8f8b('0xf')][_0x8f8b('0x10')]>0x0){_0x4b5c1e[_0x8f8b('0x28')]=_0x4394ba[_0x8f8b('0xf')][0x0][_0x8f8b('0x1e')];logger[_0x8f8b('0x12')]('['+[_0x2b29d8[_0x8f8b('0x13')]()]+_0x8f8b('0x2b'),_0x4b5c1e);_0xfe94de(_0x4b5c1e);}else{return createEndUser(_0x2b29d8,_0x303b4f,_0x4b5c1e,_0xb9d95b,_0x2207f8)[_0x8f8b('0xe')](function(_0x2bef41){logger[_0x8f8b('0x12')]('['+[_0x2b29d8[_0x8f8b('0x13')]()]+_0x8f8b('0x2c'),_0x2bef41);_0xfe94de(_0x2bef41);});}})[_0x8f8b('0x15')](function(_0x420faf){logger[_0x8f8b('0x16')]('['+[_0x2b29d8[_0x8f8b('0x13')]()]+']',_0x420faf['message']);_0x3cb79b(_0x420faf[_0x8f8b('0x17')]);});});};}function getCustomFields(_0x4f96ca,_0x505a91){var _0x53bb7a={};if(_0x4f96ca[_0x8f8b('0x10')]>0x0){_[_0x8f8b('0x2d')](_0x4f96ca,function(_0x1eb45c){if(_[_0x8f8b('0x2e')]([_0x8f8b('0x2f'),_0x8f8b('0x30')],_0x1eb45c[_0x8f8b('0x31')])&&_0x1eb45c['nameField']&&!_0x1eb45c[_0x8f8b('0x32')]){_0x53bb7a[_0x1eb45c[_0x8f8b('0x33')][_0x8f8b('0x34')]()]=_0x1eb45c[_0x8f8b('0x35')][_0x8f8b('0x36')]();}else if(_['includes']([_0x8f8b('0x2f'),_0x8f8b('0x30')],_0x1eb45c['type'])&&_0x1eb45c[_0x8f8b('0x37')]&&_0x1eb45c['customField']){_0x53bb7a[_0x1eb45c['idField'][_0x8f8b('0x34')]()]=_0x1eb45c['content']['toString']();}else if(_0x1eb45c[_0x8f8b('0x31')]==='variable'&&_0x1eb45c[_0x8f8b('0x38')]&&_0x1eb45c[_0x8f8b('0x37')]&&_0x1eb45c[_0x8f8b('0x32')]){_0x53bb7a[_0x1eb45c[_0x8f8b('0x37')]['toLowerCase']()]=_0x505a91[_0x1eb45c[_0x8f8b('0x38')]][_0x8f8b('0x36')]();}else if(_0x1eb45c['type']==='customVariable'&&_0x1eb45c[_0x8f8b('0x39')]&&_0x1eb45c[_0x8f8b('0x39')][_0x8f8b('0x3a')]&&_0x1eb45c[_0x8f8b('0x37')]&&_0x1eb45c['customField']){_0x53bb7a[_0x1eb45c[_0x8f8b('0x37')][_0x8f8b('0x34')]()]=_0x505a91[_0x1eb45c[_0x8f8b('0x39')]['name'][_0x8f8b('0x34')]()]['toString']();}});}return _0x53bb7a;}function getTicket(_0x5f3dc6,_0x535708,_0x395452,_0x1ce63e,_0x20d65a,_0x229571){return function(_0x11c715){logger[_0x8f8b('0x12')]('['+[_0x5f3dc6[_0x8f8b('0x13')]()]+_0x8f8b('0x3b'),_0x11c715);return new Promise(function(_0x14abab,_0x59ac5d){var _0x290c80=_0x5f3dc6[_0x8f8b('0x34')]()===_0x8f8b('0x3c')?_0x11c715[_0x8f8b('0x1d')]:_0x11c715[_0x8f8b('0x28')];var _0x21104a={'method':_0x8f8b('0x3d'),'uri':_0x395452+_0x8f8b('0x3e')+'?'+_0x229571,'body':Object[_0x8f8b('0x3f')]({},{'active':_0x8f8b('0x26'),'caller_id':_0x290c80,'assigned_to':_0x11c715[_0x8f8b('0x1d')],'short_description':intUtil['getString'](_0x1ce63e[_0x8f8b('0x40')],_0x20d65a,'\x20'),'description':intUtil[_0x8f8b('0x41')](_0x1ce63e[_0x8f8b('0x42')],_0x20d65a,'\x0a')},getCustomFields(_0x1ce63e[_0x8f8b('0x43')],_0x20d65a)),'auth':_0x535708,'json':!![]};return rp(_0x21104a)[_0x8f8b('0xe')](function(_0x521539){logger['info']('['+[_0x5f3dc6['toUpperCase']()]+_0x8f8b('0x44'),_0x521539[_0x8f8b('0xf')]);_0x11c715[_0x8f8b('0x45')]=_0x521539[_0x8f8b('0xf')][_0x8f8b('0x1e')];_0x11c715[_0x8f8b('0x46')]=_0x521539[_0x8f8b('0xf')]['number'];logger[_0x8f8b('0x12')]('['+[_0x5f3dc6[_0x8f8b('0x13')]()]+_0x8f8b('0x47'),_0x11c715);_0x14abab(_0x11c715);})[_0x8f8b('0x15')](function(_0x5268f4){logger[_0x8f8b('0x16')]('['+[_0x5f3dc6[_0x8f8b('0x13')]()]+']',_0x5268f4[_0x8f8b('0x17')]);_0x59ac5d(_0x5268f4[_0x8f8b('0x17')]);});});};}function createRemoteTag(_0x52e6d9,_0x4835b4,_0x3dc9d0,_0x4b2634){return new Promise(function(_0x3e68fd,_0x18d887){var _0x32b826={'method':_0x8f8b('0x3d'),'uri':_0x3dc9d0+_0x8f8b('0x48')+'?'+_0x4b2634,'body':{'short_description':_0x52e6d9,'global':!![],'active':!![],'name':_0x52e6d9},'auth':_0x4835b4,'json':!![]};return rp(_0x32b826)[_0x8f8b('0xe')](function(_0x880c79){var _0x1a3eb7=_0x880c79['result'][_0x8f8b('0x1e')];_0x3e68fd(_0x1a3eb7);});});}function getRemoteTag(_0x17a541,_0x500cef,_0x45ea8a,_0x1162e4,_0x558df9){return new Promise(function(_0x11ef3f,_0x451af8){var _0x36f05d={'method':'GET','uri':_0x45ea8a+_0x8f8b('0x48')+_0x8f8b('0x49')+_0x17a541+'&'+_0x1162e4,'auth':_0x500cef,'json':!![]};return rp(_0x36f05d)[_0x8f8b('0xe')](function(_0x34d8b6){if(_0x34d8b6[_0x8f8b('0xf')][_0x8f8b('0x10')]>0x0){var _0x3d1f6d=_0x34d8b6[_0x8f8b('0xf')][0x0]['sys_id'];_0x11ef3f(_0x3d1f6d);}else{return createRemoteTag(_0x17a541,_0x500cef,_0x45ea8a,_0x1162e4)[_0x8f8b('0xe')](function(_0x4a9141){_0x11ef3f(_0x4a9141);});}});});}function assignTagToIncident(_0x218004,_0x3d6d73,_0x35c54f,_0x164353,_0x375a8f){return new Promise(function(_0x189d8d,_0x2a8228){var _0x58d09a={'method':_0x8f8b('0x3d'),'uri':_0x35c54f+'label_entry'+'?'+_0x375a8f,'body':{'label':_0x218004,'table':_0x8f8b('0x3e'),'id_type':'Incident','table_key':_0x164353[_0x8f8b('0x45')],'title':_0x8f8b('0x4a')+_0x164353[_0x8f8b('0x46')],'id_display':_0x164353[_0x8f8b('0x46')]},'auth':_0x3d6d73,'json':!![]};return rp(_0x58d09a)[_0x8f8b('0xe')](function(_0x3c2bde){_0x189d8d();})[_0x8f8b('0x15')](function(){_0x189d8d();});});}function manageTags(_0x1453fc,_0x1f8ace,_0x54ca4f,_0x3376c7,_0x3b05e8,_0x4f0eda,_0x58b661){return new Promise(function(_0x5e6cfb,_0x356f72){var _0x42302c=[];_0x1f8ace[_0x8f8b('0x2d')](function(_0x56ef99){_0x42302c[_0x8f8b('0x4b')](getRemoteTag(_0x56ef99,_0x54ca4f,_0x3376c7,_0x4f0eda,_0x58b661));});return Promise[_0x8f8b('0x4c')](_0x42302c)[_0x8f8b('0xe')](function(_0x3976f4){if(_0x3976f4[_0x8f8b('0x10')]){logger[_0x8f8b('0x12')]('['+[_0x1453fc[_0x8f8b('0x13')]()]+_0x8f8b('0x4d'),_0x3976f4);var _0x2948fa=[];_0x3976f4['forEach'](function(_0x54a34d){_0x2948fa['push'](assignTagToIncident(_0x54a34d,_0x54ca4f,_0x3376c7,_0x3b05e8,_0x4f0eda));});return Promise[_0x8f8b('0x4c')](_0x2948fa)['then'](function(){_0x5e6cfb();})[_0x8f8b('0x15')](function(){_0x5e6cfb();});}else{_0x5e6cfb();}});});}function getTags(_0x31ce5d,_0x29eaa2,_0x4ac509,_0x34835c,_0x54e464,_0x2e0b0a){return function(_0x1b8496){return new Promise(function(_0x22f912,_0x300e08){var _0x198b2c=[];var _0x170e9f=_0x34835c[_0x8f8b('0x4e')];if(_0x170e9f&&_0x170e9f[_0x8f8b('0x10')]>0x0){_0x198b2c=_[_0x8f8b('0x4f')](_0x170e9f,_0x8f8b('0x3a'));}if(_0x198b2c[_0x8f8b('0x10')]>0x0){return manageTags(_0x31ce5d,_0x198b2c,_0x29eaa2,_0x4ac509,_0x1b8496,_0x54e464,_0x2e0b0a)['then'](function(){_0x22f912(_0x1b8496);});}else{_0x22f912(_0x1b8496);}});};}function emit(_0x5c8a94,_0x313f58,_0x3a5a34){var _0x3a52c1=_0x8f8b('0x50')+_0x8f8b('0x51')+_0x8f8b('0x52')+'%255EORDERBYDESCnumber';var _0x53a96b={'uri':_0x5c8a94+_0x8f8b('0x53')+_0x3a5a34+_0x3a52c1};io['to'](util[_0x8f8b('0x54')](_0x8f8b('0x55'),_0x313f58))[_0x8f8b('0x56')](_0x8f8b('0x57'),_0x53a96b);}exports['cs']=function(_0xfc92d0,_0x1ce9b7,_0x4b408f,_0x5b8bad,_0x1f703d,_0x31497e,_0x3d5c09,_0x5a70f4){var _0x35be7e={};var _0x146c2e={'user':_0x31497e[_0x8f8b('0x58')],'pass':_0x31497e[_0x8f8b('0x59')]};var _0x1dee92=_0x8f8b('0x5a');var _0xd9ce9f=_0x8f8b('0x5b');_0x31497e[_0x8f8b('0x5c')]=intUtil[_0x8f8b('0x5d')](_0x31497e[_0x8f8b('0x5c')]);_0x31497e['serverUrl']=intUtil[_0x8f8b('0x5d')](_0x31497e[_0x8f8b('0x5e')]);var _0xea7107=util[_0x8f8b('0x54')]('%s/api/now/table/',_0x31497e[_0x8f8b('0x5c')]);_0x35be7e[_0x8f8b('0x1f')]=!_['isNil'](_0x5b8bad)?_0x5b8bad[_0x8f8b('0x5f')]:null;_0x35be7e[_0x8f8b('0x60')]=_0x31497e[_0x8f8b('0x5f')];_0x35be7e[_0x8f8b('0x24')]=_0x5a70f4[_0x8f8b('0x34')]()===_0x8f8b('0x3c')?_0x1ce9b7[_0x8f8b('0x61')]:_0x1ce9b7[_0x8f8b('0x62')];_0x35be7e[_0x8f8b('0x63')]=_0x5a70f4===_0x8f8b('0x64')||_0x5a70f4==='unmanaged'?_0x8f8b('0x64'):_0x8f8b('0x3c');var _0x17a787=util[_0x8f8b('0x54')](_0x8f8b('0x65'),_0x31497e[_0x8f8b('0x5e')],_0x1ce9b7['uniqueid'],md5(_0x1ce9b7[_0x8f8b('0x66')]));if(_0x1f703d&&_0x1f703d[_0x8f8b('0x67')]){logger[_0x8f8b('0x12')]('[QUEUE]',_0x8f8b('0x68'));_0x1ce9b7[_0x8f8b('0x69')]=_0x17a787;}else if(_0x3d5c09&&_0x3d5c09[_0x8f8b('0x6a')]&&_0x3d5c09[_0x8f8b('0x6a')]!==_0x8f8b('0x6b')){logger['info'](_0x8f8b('0x6c'),_0x8f8b('0x68'));_0x1ce9b7[_0x8f8b('0x69')]=_0x17a787;}else{_0x1ce9b7[_0x8f8b('0x69')]='';}return getAdminUser(_0x5a70f4,_0x146c2e,_0x35be7e,_0xea7107,_0xd9ce9f,_0x1dee92)[_0x8f8b('0xe')](getUser(_0x5a70f4,_0x146c2e,_0xea7107,_0xd9ce9f,_0x1dee92))[_0x8f8b('0xe')](getEndUser(_0x5a70f4,_0x146c2e,_0xea7107,_0xd9ce9f,_0x1dee92))[_0x8f8b('0xe')](getTicket(_0x5a70f4,_0x146c2e,_0xea7107,_0x4b408f,_0x1ce9b7,_0xd9ce9f))[_0x8f8b('0xe')](function(_0x208070){logger[_0x8f8b('0x12')](util['format'](_0x8f8b('0x6d'),_0x208070[_0x8f8b('0x45')]));logger[_0x8f8b('0x12')](util[_0x8f8b('0x54')](_0x8f8b('0x6e'),_0x5a70f4));if(_0x5a70f4!==_0x8f8b('0x6f')){logger[_0x8f8b('0x12')]('['+[_0x5a70f4['toUpperCase']()]+']',_0x8f8b('0x70'));emit(_0x31497e[_0x8f8b('0x5c')],_0x5b8bad[_0x8f8b('0x3a')],_0x208070['ticketId']);}})['catch'](function(_0x4f9377){logger[_0x8f8b('0x16')]('['+[_0x5a70f4['toUpperCase']()]+_0x8f8b('0x71'),util[_0x8f8b('0x72')](_0x4f9377,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xc1de=['type','nameField','content','toString','idField','customField','variableName','toLowerCase','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','POST','assign','Subjects','getString','Descriptions','Fields','ticketNumber','number',']\x20getTicket\x20crm','label','label_entry','incident','Incident','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','format','user:%s','emit','password','sysparm_limit=1','sysparm_display_value=true','stripTrailingSlash','remoteUri','serverUrl','isNil','email','calleridnum','callDirection','unmanaged','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','ticketId','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment','servicenow','redis','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','info','],\x20getAdminUser\x20crm','error','toUpperCase','message','userEmail','GET','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','true','userId','catch',']\x20using\x20admin\x20profile','adminEmail','],\x20createEndUser\x20input\x20crm','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','sys_id','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','picklist'];(function(_0x5dee30,_0x54df56){var _0x236cb6=function(_0x1c2173){while(--_0x1c2173){_0x5dee30['push'](_0x5dee30['shift']());}};_0x236cb6(++_0x54df56);}(_0xc1de,0xaa));var _0xec1d=function(_0x420e5a,_0xd249dd){_0x420e5a=_0x420e5a-0x0;var _0x3721d8=_0xc1de[_0x420e5a];return _0x3721d8;};'use strict';var _=require('lodash');var Promise=require(_0xec1d('0x0'));var rp=require(_0xec1d('0x1'));var util=require(_0xec1d('0x2'));var md5=require(_0xec1d('0x3'));var Redis=require(_0xec1d('0x4'));var intUtil=require(_0xec1d('0x5'));var config=require(_0xec1d('0x6'));var logger=require('../../../../config/logger')(_0xec1d('0x7'));config[_0xec1d('0x8')]=_['defaults'](config['redis'],{'host':_0xec1d('0x9'),'port':0x18eb});var io=require(_0xec1d('0xa'))(new Redis(config[_0xec1d('0x8')]));function getAdminUser(_0x42b076,_0x15d070,_0x40a093,_0x586949,_0x2557e7,_0x2f7807){return new Promise(function(_0x13a156,_0x1fb35a){var _0x1dd83d={'method':'GET','uri':_0x586949+_0xec1d('0xb')+'&'+_0x2557e7+'&'+_0x2f7807,'auth':_0x15d070,'json':!![]};return rp(_0x1dd83d)[_0xec1d('0xc')](function(_0x31e231){if(_0x31e231[_0xec1d('0xd')][_0xec1d('0xe')]>0x0){_0x40a093[_0xec1d('0xf')]=_0x31e231[_0xec1d('0xd')][0x0]['sys_id'];}logger[_0xec1d('0x10')]('['+[_0x42b076['toUpperCase']()]+_0xec1d('0x11'),_0x40a093);_0x13a156(_0x40a093);})['catch'](function(_0xb44215){logger[_0xec1d('0x12')]('['+[_0x42b076[_0xec1d('0x13')]()]+']',_0xb44215[_0xec1d('0x14')]);_0x1fb35a(_0xb44215[_0xec1d('0x14')]);});});}function getUser(_0x353462,_0x44a9de,_0x5dbb32,_0x5d4e1b,_0x2edf38){return function(_0x3c9a5f){logger[_0xec1d('0x10')]('['+[_0x353462[_0xec1d('0x13')]()]+'],\x20getUser\x20input\x20crm',_0x3c9a5f);return new Promise(function(_0x1ed3b,_0x5236a5){if(intUtil['validateEmail'](_0x3c9a5f[_0xec1d('0x15')])){var _0x403684={'method':_0xec1d('0x16'),'uri':_0x5dbb32+_0xec1d('0x17')+_0x3c9a5f['userEmail']+'&'+_0x5d4e1b+'&'+_0x2edf38,'auth':_0x44a9de,'json':!![]};logger[_0xec1d('0x10')]('['+[_0x353462[_0xec1d('0x13')]()]+_0xec1d('0x18'),_0x403684);return rp(_0x403684)[_0xec1d('0xc')](function(_0x1bce0e){logger[_0xec1d('0x10')]('['+[_0x353462['toUpperCase']()]+'],\x20getUser\x20entity',_0x1bce0e);if(_0x1bce0e['result'][_0xec1d('0xe')]>0x0&&String(_0x1bce0e[_0xec1d('0xd')][0x0]['active'])===_0xec1d('0x19')){_0x3c9a5f[_0xec1d('0x1a')]=_0x1bce0e['result'][0x0]['sys_id'];}else{_0x3c9a5f[_0xec1d('0x1a')]=_0x3c9a5f[_0xec1d('0xf')];_0x3c9a5f[_0xec1d('0x15')]=_0x3c9a5f['adminEmail'];}logger[_0xec1d('0x10')]('['+[_0x353462[_0xec1d('0x13')]()]+'],\x20getUser\x20crm',_0x3c9a5f);_0x1ed3b(_0x3c9a5f);})[_0xec1d('0x1b')](function(_0x558399){logger[_0xec1d('0x12')]('['+[_0x353462[_0xec1d('0x13')]()]+']',_0x558399[_0xec1d('0x14')]);_0x5236a5(_0x558399[_0xec1d('0x14')]);});}else{logger['info']('['+[_0x353462[_0xec1d('0x13')]()]+_0xec1d('0x1c'));_0x3c9a5f[_0xec1d('0x1a')]=_0x3c9a5f[_0xec1d('0xf')];_0x3c9a5f['userEmail']=_0x3c9a5f[_0xec1d('0x1d')];_0x1ed3b(_0x3c9a5f);}});};}function createEndUser(_0x262de7,_0x5709aa,_0x4f3eb8,_0x3a833c,_0x54b1c8){logger[_0xec1d('0x10')]('['+[_0x262de7[_0xec1d('0x13')]()]+_0xec1d('0x1e'),_0x4f3eb8);return new Promise(function(_0x369980,_0xfc0df4){var _0x53ef3c={'method':'POST','uri':_0x3a833c+_0xec1d('0x1f')+_0x54b1c8,'body':{'user_name':_0x4f3eb8[_0xec1d('0x20')],'roles':_0xec1d('0x21'),'first_name':_0x4f3eb8[_0xec1d('0x20')],'active':'true','date_format':_0xec1d('0x22'),'phone':_0x4f3eb8['endUserNumber']},'auth':_0x5709aa,'json':!![]};return rp(_0x53ef3c)[_0xec1d('0xc')](function(_0x4bbe8e){logger[_0xec1d('0x10')]('['+[_0x262de7[_0xec1d('0x13')]()]+_0xec1d('0x23'),_0x4bbe8e[_0xec1d('0xd')]);_0x4f3eb8[_0xec1d('0x24')]=_0x4bbe8e[_0xec1d('0xd')][_0xec1d('0x25')];_0x369980(_0x4f3eb8);})[_0xec1d('0x1b')](function(_0x84c46f){logger[_0xec1d('0x12')]('['+[_0x262de7[_0xec1d('0x13')]()]+']',_0x84c46f[_0xec1d('0x14')]);_0xfc0df4(_0x84c46f[_0xec1d('0x14')]);});});}function getEndUser(_0xcb7c2,_0x31496b,_0x250d77,_0x9b4542,_0x3af791){return function(_0x1f1da8){logger['info']('['+[_0xcb7c2[_0xec1d('0x13')]()]+'],\x20getEndUser\x20input\x20crm',_0x1f1da8);return new Promise(function(_0x7b67c,_0x4378a2){var _0x29acb6={'method':_0xec1d('0x16'),'uri':_0x250d77+_0xec1d('0x26')+_0x1f1da8[_0xec1d('0x20')]+'&'+_0x9b4542+'&'+_0x3af791,'auth':_0x31496b,'json':!![]};return rp(_0x29acb6)[_0xec1d('0xc')](function(_0x49f6bc){if(_0x49f6bc[_0xec1d('0xd')][_0xec1d('0xe')]>0x0){_0x1f1da8['endUserId']=_0x49f6bc[_0xec1d('0xd')][0x0][_0xec1d('0x25')];logger[_0xec1d('0x10')]('['+[_0xcb7c2[_0xec1d('0x13')]()]+_0xec1d('0x27'),_0x1f1da8);_0x7b67c(_0x1f1da8);}else{return createEndUser(_0xcb7c2,_0x31496b,_0x1f1da8,_0x250d77,_0x9b4542)[_0xec1d('0xc')](function(_0x4c06e2){logger[_0xec1d('0x10')]('['+[_0xcb7c2[_0xec1d('0x13')]()]+_0xec1d('0x28'),_0x4c06e2);_0x7b67c(_0x4c06e2);});}})[_0xec1d('0x1b')](function(_0x15ddb8){logger[_0xec1d('0x12')]('['+[_0xcb7c2[_0xec1d('0x13')]()]+']',_0x15ddb8[_0xec1d('0x14')]);_0x4378a2(_0x15ddb8[_0xec1d('0x14')]);});});};}function getCustomFields(_0x2dfa12,_0x4838ec){var _0x4027ba={};if(_0x2dfa12[_0xec1d('0xe')]>0x0){_[_0xec1d('0x29')](_0x2dfa12,function(_0x5a7a84){if(_[_0xec1d('0x2a')](['string',_0xec1d('0x2b')],_0x5a7a84[_0xec1d('0x2c')])&&_0x5a7a84[_0xec1d('0x2d')]&&!_0x5a7a84['customField']){_0x4027ba[_0x5a7a84[_0xec1d('0x2d')]['toLowerCase']()]=_0x5a7a84[_0xec1d('0x2e')][_0xec1d('0x2f')]();}else if(_[_0xec1d('0x2a')](['string',_0xec1d('0x2b')],_0x5a7a84[_0xec1d('0x2c')])&&_0x5a7a84[_0xec1d('0x30')]&&_0x5a7a84[_0xec1d('0x31')]){_0x4027ba[_0x5a7a84['idField']['toLowerCase']()]=_0x5a7a84[_0xec1d('0x2e')][_0xec1d('0x2f')]();}else if(_0x5a7a84[_0xec1d('0x2c')]==='variable'&&_0x5a7a84[_0xec1d('0x32')]&&_0x5a7a84[_0xec1d('0x30')]&&_0x5a7a84['customField']){_0x4027ba[_0x5a7a84[_0xec1d('0x30')][_0xec1d('0x33')]()]=_0x4838ec[_0x5a7a84[_0xec1d('0x32')]][_0xec1d('0x2f')]();}else if(_0x5a7a84[_0xec1d('0x2c')]===_0xec1d('0x34')&&_0x5a7a84[_0xec1d('0x35')]&&_0x5a7a84[_0xec1d('0x35')][_0xec1d('0x36')]&&_0x5a7a84[_0xec1d('0x30')]&&_0x5a7a84[_0xec1d('0x31')]){_0x4027ba[_0x5a7a84[_0xec1d('0x30')][_0xec1d('0x33')]()]=_0x4838ec[_0x5a7a84[_0xec1d('0x35')][_0xec1d('0x36')][_0xec1d('0x33')]()][_0xec1d('0x2f')]();}});}return _0x4027ba;}function getTicket(_0x1a809c,_0x5ed707,_0x764b14,_0x3fca40,_0x357ba5,_0x1abb0e){return function(_0x421f97){logger['info']('['+[_0x1a809c[_0xec1d('0x13')]()]+_0xec1d('0x37'),_0x421f97);return new Promise(function(_0x376166,_0x42ce28){var _0x17499e=_0x1a809c[_0xec1d('0x33')]()==='outbound'?_0x421f97['userId']:_0x421f97['endUserId'];var _0x4ad88c={'method':_0xec1d('0x38'),'uri':_0x764b14+'incident'+'?'+_0x1abb0e,'body':Object[_0xec1d('0x39')]({},{'active':'true','caller_id':_0x17499e,'assigned_to':_0x421f97[_0xec1d('0x1a')],'short_description':intUtil['getString'](_0x3fca40[_0xec1d('0x3a')],_0x357ba5,'\x20'),'description':intUtil[_0xec1d('0x3b')](_0x3fca40[_0xec1d('0x3c')],_0x357ba5,'\x0a')},getCustomFields(_0x3fca40[_0xec1d('0x3d')],_0x357ba5)),'auth':_0x5ed707,'json':!![]};return rp(_0x4ad88c)[_0xec1d('0xc')](function(_0x5a09a1){logger[_0xec1d('0x10')]('['+[_0x1a809c[_0xec1d('0x13')]()]+']\x20POST\x20incident\x20entity\x20schema',_0x5a09a1[_0xec1d('0xd')]);_0x421f97['ticketId']=_0x5a09a1['result']['sys_id'];_0x421f97[_0xec1d('0x3e')]=_0x5a09a1[_0xec1d('0xd')][_0xec1d('0x3f')];logger[_0xec1d('0x10')]('['+[_0x1a809c[_0xec1d('0x13')]()]+_0xec1d('0x40'),_0x421f97);_0x376166(_0x421f97);})[_0xec1d('0x1b')](function(_0x5a5f08){logger[_0xec1d('0x12')]('['+[_0x1a809c[_0xec1d('0x13')]()]+']',_0x5a5f08['message']);_0x42ce28(_0x5a5f08[_0xec1d('0x14')]);});});};}function createRemoteTag(_0x2aa10e,_0x38168a,_0x5466d4,_0x26da38){return new Promise(function(_0x436a5e,_0x59ae07){var _0x3cb2e2={'method':_0xec1d('0x38'),'uri':_0x5466d4+_0xec1d('0x41')+'?'+_0x26da38,'body':{'short_description':_0x2aa10e,'global':!![],'active':!![],'name':_0x2aa10e},'auth':_0x38168a,'json':!![]};return rp(_0x3cb2e2)[_0xec1d('0xc')](function(_0x5c289d){var _0x5bab0a=_0x5c289d['result']['sys_id'];_0x436a5e(_0x5bab0a);});});}function getRemoteTag(_0x5b84c2,_0x17e686,_0x3238dc,_0x40b465,_0x22e110){return new Promise(function(_0xb1e712,_0x58da92){var _0x11e0b2={'method':'GET','uri':_0x3238dc+_0xec1d('0x41')+'?sysparm_query=name%3D'+_0x5b84c2+'&'+_0x40b465,'auth':_0x17e686,'json':!![]};return rp(_0x11e0b2)[_0xec1d('0xc')](function(_0x24ec6e){if(_0x24ec6e['result'][_0xec1d('0xe')]>0x0){var _0x3c99b3=_0x24ec6e[_0xec1d('0xd')][0x0][_0xec1d('0x25')];_0xb1e712(_0x3c99b3);}else{return createRemoteTag(_0x5b84c2,_0x17e686,_0x3238dc,_0x40b465)[_0xec1d('0xc')](function(_0x5ef9a3){_0xb1e712(_0x5ef9a3);});}});});}function assignTagToIncident(_0x117784,_0x29b2f8,_0x18b7ea,_0x5e70d2,_0x1db5c1){return new Promise(function(_0x96326,_0x5b0cac){var _0x7ddd3e={'method':_0xec1d('0x38'),'uri':_0x18b7ea+_0xec1d('0x42')+'?'+_0x1db5c1,'body':{'label':_0x117784,'table':_0xec1d('0x43'),'id_type':_0xec1d('0x44'),'table_key':_0x5e70d2['ticketId'],'title':_0xec1d('0x45')+_0x5e70d2['ticketNumber'],'id_display':_0x5e70d2[_0xec1d('0x3e')]},'auth':_0x29b2f8,'json':!![]};return rp(_0x7ddd3e)[_0xec1d('0xc')](function(_0x45ecc4){_0x96326();})[_0xec1d('0x1b')](function(){_0x96326();});});}function manageTags(_0xc1f353,_0x4451ca,_0x280dcd,_0x47bae3,_0x26563e,_0x4a21d5,_0x48eeb2){return new Promise(function(_0x3cad69,_0x17c5d5){var _0x4626d1=[];_0x4451ca[_0xec1d('0x29')](function(_0x29da68){_0x4626d1[_0xec1d('0x46')](getRemoteTag(_0x29da68,_0x280dcd,_0x47bae3,_0x4a21d5,_0x48eeb2));});return Promise[_0xec1d('0x47')](_0x4626d1)[_0xec1d('0xc')](function(_0x169db1){if(_0x169db1['length']){logger[_0xec1d('0x10')]('['+[_0xc1f353[_0xec1d('0x13')]()]+_0xec1d('0x48'),_0x169db1);var _0x48938c=[];_0x169db1['forEach'](function(_0x587979){_0x48938c[_0xec1d('0x46')](assignTagToIncident(_0x587979,_0x280dcd,_0x47bae3,_0x26563e,_0x4a21d5));});return Promise['all'](_0x48938c)[_0xec1d('0xc')](function(){_0x3cad69();})[_0xec1d('0x1b')](function(){_0x3cad69();});}else{_0x3cad69();}});});}function getTags(_0x4ac7cf,_0x58dcd1,_0x1d9e33,_0x393c78,_0x355aa2,_0x39a786){return function(_0x3fc78a){return new Promise(function(_0xd2f5ca,_0x1bc302){var _0x4d3395=[];var _0x3ef728=_0x393c78[_0xec1d('0x49')];if(_0x3ef728&&_0x3ef728['length']>0x0){_0x4d3395=_[_0xec1d('0x4a')](_0x3ef728,'name');}if(_0x4d3395[_0xec1d('0xe')]>0x0){return manageTags(_0x4ac7cf,_0x4d3395,_0x58dcd1,_0x1d9e33,_0x3fc78a,_0x355aa2,_0x39a786)['then'](function(){_0xd2f5ca(_0x3fc78a);});}else{_0xd2f5ca(_0x3fc78a);}});};}function emit(_0x4d0764,_0x3d862b,_0x177a24){var _0x304ffb='%26sysparm_record_target%3Dincident'+_0xec1d('0x4b')+_0xec1d('0x4c')+_0xec1d('0x4d');var _0x57e2e9={'uri':_0x4d0764+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x177a24+_0x304ffb};io['to'](util[_0xec1d('0x4e')](_0xec1d('0x4f'),_0x3d862b))[_0xec1d('0x50')]('trigger:browser:url',_0x57e2e9);}exports['cs']=function(_0x1283dc,_0x54bcab,_0x59cd03,_0x32a13a,_0x313a42,_0x575959,_0x3f6fce,_0x1b9cae){var _0x2951c3={};var _0x222ada={'user':_0x575959['username'],'pass':_0x575959[_0xec1d('0x51')]};var _0xeef44c=_0xec1d('0x52');var _0x4a911f=_0xec1d('0x53');_0x575959['remoteUri']=intUtil[_0xec1d('0x54')](_0x575959[_0xec1d('0x55')]);_0x575959[_0xec1d('0x56')]=intUtil[_0xec1d('0x54')](_0x575959[_0xec1d('0x56')]);var _0x468d52=util[_0xec1d('0x4e')]('%s/api/now/table/',_0x575959[_0xec1d('0x55')]);_0x2951c3['userEmail']=!_[_0xec1d('0x57')](_0x32a13a)?_0x32a13a[_0xec1d('0x58')]:null;_0x2951c3[_0xec1d('0x1d')]=_0x575959[_0xec1d('0x58')];_0x2951c3[_0xec1d('0x20')]=_0x1b9cae[_0xec1d('0x33')]()==='outbound'?_0x54bcab['destcalleridnum']:_0x54bcab[_0xec1d('0x59')];_0x2951c3[_0xec1d('0x5a')]=_0x1b9cae==='queue'||_0x1b9cae===_0xec1d('0x5b')?'queue':_0xec1d('0x5c');var _0x43f159=util[_0xec1d('0x4e')](_0xec1d('0x5d'),_0x575959[_0xec1d('0x56')],_0x54bcab[_0xec1d('0x5e')],md5(_0x54bcab[_0xec1d('0x5e')]));if(_0x313a42&&_0x313a42[_0xec1d('0x5f')]){logger['info'](_0xec1d('0x60'),_0xec1d('0x61'));_0x54bcab[_0xec1d('0x62')]=_0x43f159;}else if(_0x3f6fce&&_0x3f6fce['recordingFormat']&&_0x3f6fce[_0xec1d('0x63')]!=='none'){logger[_0xec1d('0x10')](_0xec1d('0x64'),_0xec1d('0x61'));_0x54bcab[_0xec1d('0x62')]=_0x43f159;}else{_0x54bcab[_0xec1d('0x62')]='';}return getAdminUser(_0x1b9cae,_0x222ada,_0x2951c3,_0x468d52,_0x4a911f,_0xeef44c)[_0xec1d('0xc')](getUser(_0x1b9cae,_0x222ada,_0x468d52,_0x4a911f,_0xeef44c))['then'](getEndUser(_0x1b9cae,_0x222ada,_0x468d52,_0x4a911f,_0xeef44c))[_0xec1d('0xc')](getTicket(_0x1b9cae,_0x222ada,_0x468d52,_0x59cd03,_0x54bcab,_0x4a911f))[_0xec1d('0xc')](function(_0x4f623d){logger[_0xec1d('0x10')](util[_0xec1d('0x4e')](_0xec1d('0x65'),_0x4f623d[_0xec1d('0x66')]));logger[_0xec1d('0x10')](util[_0xec1d('0x4e')](_0xec1d('0x67'),_0x1b9cae));if(_0x1b9cae!==_0xec1d('0x5b')){logger[_0xec1d('0x10')]('['+[_0x1b9cae[_0xec1d('0x13')]()]+']',_0xec1d('0x68'));emit(_0x575959[_0xec1d('0x55')],_0x32a13a['name'],_0x4f623d[_0xec1d('0x66')]);}})[_0xec1d('0x1b')](function(_0x26b27b){logger[_0xec1d('0x12')]('['+[_0x1b9cae[_0xec1d('0x13')]()]+_0xec1d('0x69'),util[_0xec1d('0x6a')](_0x26b27b,{'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 e114e5a..b6efd9b 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 _0x4f4d=['Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','forEach','type','string','customField','toLowerCase','custom_fields','Variable','login','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','queue','remoteUri','stripTrailingSlash','serverUrl','uri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','%s/service/v4_1/rest.php','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','The\x20Ticket\x20ID\x20is:','catch','error','unmanaged','lastevent','toUpperCase','Inbound','lodash','bluebird','md5','util','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','emit','info','name','getString','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction','length','variableName','push','idField','set_entry','JSON','Calls','format','Basic\x20%s','toString','base64','get_server_info','stringify','isNil','Getting\x20agent\x20with\x20name','get_entry_list','user_name','then','entry_list','value','Agent\x20found!','resolve','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','find'];(function(_0x499d2c,_0x200eb0){var _0x4c97bb=function(_0xb827ed){while(--_0xb827ed){_0x499d2c['push'](_0x499d2c['shift']());}};_0x4c97bb(++_0x200eb0);}(_0x4f4d,0x128));var _0xd4f4=function(_0x53b133,_0x176261){_0x53b133=_0x53b133-0x0;var _0x5647e0=_0x4f4d[_0x53b133];return _0x5647e0;};'use strict';var _=require(_0xd4f4('0x0'));var rp=require('request-promise');var BPromise=require(_0xd4f4('0x1'));var md5=require(_0xd4f4('0x2'));var util=require(_0xd4f4('0x3'));var Redis=require('ioredis');var intUtil=require(_0xd4f4('0x4'));var config=require(_0xd4f4('0x5'));var logger=require(_0xd4f4('0x6'))(_0xd4f4('0x7'));config[_0xd4f4('0x8')]=_[_0xd4f4('0x9')](config[_0xd4f4('0x8')],{'host':_0xd4f4('0xa'),'port':0x18eb});var io=require(_0xd4f4('0xb'))(new Redis(config[_0xd4f4('0x8')]));var def={'method':_0xd4f4('0xc'),'json':!![]};function emit(_0x206e0f,_0x5ae1b7,_0x4616b7){io['to'](_0x206e0f)[_0xd4f4('0xd')](_0x5ae1b7,_0x4616b7);}function getTicket(_0xa19159,_0x43bc96,_0x2a6bde,_0x3258eb,_0x810c9d,_0x1d4c63,_0x37db28,_0x51f9d7){logger[_0xd4f4('0xe')]('Creating\x20new\x20ticket...');var _0x43b835=new Date();var _0x467c60=[{'name':_0xd4f4('0xf'),'value':intUtil['getString'](_0x3258eb['Subjects'],_0x810c9d,'\x20')},{'name':'assigned_user_id','value':_0x43bc96['id']},{'name':'created_by','value':_0x43bc96['id']},{'name':'description','value':intUtil[_0xd4f4('0x10')](_0x3258eb['Descriptions'],_0x810c9d,'\x0a')},{'name':_0xd4f4('0x11'),'value':_0x43b835[_0xd4f4('0x12')]()[_0xd4f4('0x13')](0x0,0x13)[_0xd4f4('0x14')]('T','\x20')},{'name':_0xd4f4('0x15'),'value':'0'},{'name':_0xd4f4('0x16'),'value':'15'},{'name':_0xd4f4('0x17'),'value':_0x2a6bde['id']},{'name':_0xd4f4('0x18'),'value':_0xd4f4('0x19')},{'name':_0xd4f4('0x1a'),'value':_0x2a6bde[_0xd4f4('0xf')]},{'name':_0xd4f4('0x1b'),'value':_0x51f9d7}];if(_0x1d4c63[_0xd4f4('0x1c')]){_['forEach'](_0x1d4c63,function(_0x44f2af){if(_0x810c9d[_0x44f2af[_0xd4f4('0x1d')]]){_0x467c60[_0xd4f4('0x1e')]({'name':_0x44f2af[_0xd4f4('0x1f')],'value':_0x810c9d[_0x44f2af[_0xd4f4('0x1d')]]});}});}return request({'form':{'method':_0xd4f4('0x20'),'input_type':_0xd4f4('0x21'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x37db28['id'],'module_name':_0xd4f4('0x22'),'name_value_list':_0x467c60})}});}function getAuth(_0x482b91){return util[_0xd4f4('0x23')](_0xd4f4('0x24'),new Buffer(_0x482b91['apiKey']+':X')[_0xd4f4('0x25')](_0xd4f4('0x26')));}function getServerInfo(_0x18eb55){return request({'form':{'method':_0xd4f4('0x27'),'input_type':_0xd4f4('0x21'),'response_type':_0xd4f4('0x21'),'rest_data':JSON[_0xd4f4('0x28')]({'session':_0x18eb55['id']})}});}function getUser(_0x302232,_0x473a13,_0x33c6c5){if(!_[_0xd4f4('0x29')](_0x473a13)){logger[_0xd4f4('0xe')](_0xd4f4('0x2a'),_0x473a13);return request({'form':{'method':_0xd4f4('0x2b'),'input_type':_0xd4f4('0x21'),'response_type':_0xd4f4('0x21'),'rest_data':JSON[_0xd4f4('0x28')]({'session':_0x33c6c5['id'],'module_name':'Employees','query':util[_0xd4f4('0x23')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x473a13),'order_by':'','offset':'0','select_fields':['id',_0xd4f4('0xf'),_0xd4f4('0x2c')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xd4f4('0x2d')](function(_0x588d0a){if(_0x588d0a['entry_list'][_0xd4f4('0x1c')]){var _0x2b6e5e=_['find'](_0x588d0a[_0xd4f4('0x2e')],function(_0x1b1ca4){return _0x1b1ca4['name_value_list'][_0xd4f4('0x2c')][_0xd4f4('0x2f')]===_0x473a13;});if(_0x2b6e5e){logger[_0xd4f4('0xe')](_0xd4f4('0x30'));return BPromise[_0xd4f4('0x31')]({'id':_0x2b6e5e[_0xd4f4('0x32')]['id'][_0xd4f4('0x2f')],'name':_0x2b6e5e[_0xd4f4('0x32')][_0xd4f4('0xf')][_0xd4f4('0x2f')]});}}logger[_0xd4f4('0xe')](_0xd4f4('0x33'));return BPromise[_0xd4f4('0x31')]({'id':_0x33c6c5[_0xd4f4('0x32')][_0xd4f4('0x34')][_0xd4f4('0x2f')],'name':_0x33c6c5['name_value_list'][_0xd4f4('0x2c')]['value']});});}else{logger[_0xd4f4('0xe')](_0xd4f4('0x35'));return BPromise[_0xd4f4('0x31')]({'id':_0x33c6c5[_0xd4f4('0x32')]['user_id'][_0xd4f4('0x2f')],'name':_0x33c6c5[_0xd4f4('0x32')][_0xd4f4('0x2c')]['value']});}}function getEndUser(_0x429987,_0x3be0e5,_0x28cc7c,_0x3ca3b3){logger[_0xd4f4('0xe')](_0xd4f4('0x36'),_0x28cc7c);return request({'form':{'method':_0xd4f4('0x2b'),'input_type':_0xd4f4('0x21'),'response_type':_0xd4f4('0x21'),'rest_data':JSON['stringify']({'session':_0x3ca3b3['id'],'module_name':_0xd4f4('0x19'),'query':util['format'](_0xd4f4('0x37'),_0x28cc7c),'order_by':'','offset':'0','select_fields':['id','name',_0xd4f4('0x38')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xd4f4('0x2d')](function(_0x524417){if(_0x524417[_0xd4f4('0x2e')]['length']){var _0x50d39f=_[_0xd4f4('0x39')](_0x524417[_0xd4f4('0x2e')],function(_0xe074f8){return _0xe074f8['name_value_list'][_0xd4f4('0x38')][_0xd4f4('0x2f')]===_0x28cc7c;});if(_0x50d39f){logger[_0xd4f4('0xe')](_0xd4f4('0x3a'));return BPromise[_0xd4f4('0x31')]({'id':_0x50d39f[_0xd4f4('0x32')]['id'][_0xd4f4('0x2f')],'name':_0x50d39f[_0xd4f4('0x32')][_0xd4f4('0xf')][_0xd4f4('0x2f')],'phone':_0x50d39f[_0xd4f4('0x32')][_0xd4f4('0x38')][_0xd4f4('0x2f')]});}}else{logger[_0xd4f4('0xe')](_0xd4f4('0x3b'));return request({'form':{'method':_0xd4f4('0x20'),'input_type':_0xd4f4('0x21'),'response_type':_0xd4f4('0x21'),'rest_data':JSON[_0xd4f4('0x28')]({'session':_0x3ca3b3['id'],'module_name':_0xd4f4('0x19'),'name_value_list':[{'name':_0xd4f4('0x3c'),'value':_0x3be0e5!==''?_0x3be0e5:util[_0xd4f4('0x23')](_0xd4f4('0x3d'),_0x28cc7c)},{'name':_0xd4f4('0x38'),'value':_0x28cc7c}]})}})[_0xd4f4('0x2d')](function(_0x190c5f){logger['info'](_0xd4f4('0x3e'));return BPromise[_0xd4f4('0x31')]({'id':_0x190c5f['id'],'name':_0x190c5f['entry_list'][_0xd4f4('0x3c')][_0xd4f4('0x2f')],'phone':_0x190c5f[_0xd4f4('0x2e')][_0xd4f4('0x38')]['value']});});}});}function request(_0xa0130c){logger[_0xd4f4('0x3f')](_0xd4f4('0x40'),JSON['stringify'](_0xa0130c));return rp(_['merge'](def,_0xa0130c));}function getTags(_0x4c6b34,_0x343ce2){var _0x36c342=[];if(_0x4c6b34&&_0x4c6b34[_0xd4f4('0x1c')]>0x0){_0x36c342=_['map'](_0x4c6b34,_0x343ce2);}return _0x36c342;}function getCustomFields(_0xbe81f9,_0x33e521){var _0x1b19b7=[];var _0xd8cc5={'custom_fields':[]};if(_0xbe81f9['length']>0x0){_[_0xd4f4('0x41')](_0xbe81f9,function(_0x3889bd){if(_0x3889bd[_0xd4f4('0x42')]===_0xd4f4('0x43')&&_0x3889bd['nameField']&&!_0x3889bd[_0xd4f4('0x44')]){_0xd8cc5[_0x3889bd['nameField'][_0xd4f4('0x45')]()]=_0x3889bd['content'][_0xd4f4('0x25')]();}else if(_0x3889bd[_0xd4f4('0x42')]===_0xd4f4('0x43')&&_0x3889bd['idField']&&_0x3889bd['customField']){_0xd8cc5[_0xd4f4('0x46')][_0xd4f4('0x1e')]({'id':_0x3889bd[_0xd4f4('0x1f')],'value':_0x3889bd['content'][_0xd4f4('0x25')]()});}else if(_0x3889bd[_0xd4f4('0x42')]==='variable'&&_0x3889bd[_0xd4f4('0x1d')]&&_0x3889bd[_0xd4f4('0x1f')]&&_0x3889bd[_0xd4f4('0x44')]){_0x33e521[_0x3889bd['variableName']]&&_0xd8cc5[_0xd4f4('0x46')]['push']({'id':_0x3889bd[_0xd4f4('0x1f')],'value':_0x33e521[_0x3889bd[_0xd4f4('0x1d')]][_0xd4f4('0x25')]()});}else if(_0x3889bd[_0xd4f4('0x42')]==='customVariable'&&_0x3889bd['Variable']&&_0x3889bd[_0xd4f4('0x47')][_0xd4f4('0xf')]&&_0x3889bd['idField']&&_0x3889bd['customField']){_0x33e521[_0x3889bd[_0xd4f4('0x47')][_0xd4f4('0xf')][_0xd4f4('0x45')]()]&&_0xd8cc5[_0xd4f4('0x46')][_0xd4f4('0x1e')]({'id':_0x3889bd[_0xd4f4('0x1f')],'value':_0x33e521[_0x3889bd[_0xd4f4('0x47')]['name'][_0xd4f4('0x45')]()][_0xd4f4('0x25')]()});}});}return _0xd8cc5;}function getConnection(_0x59079f){return request({'method':_0xd4f4('0xc'),'form':{'method':_0xd4f4('0x48'),'input_type':_0xd4f4('0x21'),'response_type':'JSON','rest_data':JSON[_0xd4f4('0x28')]({'user_auth':{'user_name':_0x59079f['username'],'password':_0x59079f[_0xd4f4('0x49')],'encryption':_0xd4f4('0x4a')},'application':_0xd4f4('0x4b')})}})[_0xd4f4('0x2d')](function(_0xcc4c1d){var _0x27f730=_0xcc4c1d;if(_0x27f730['id']){def[_0xd4f4('0x4c')]=_0x27f730['id'];return BPromise[_0xd4f4('0x31')](_0x27f730);}else{throw new Error(util[_0xd4f4('0x23')](_0xd4f4('0x4d'),_0x59079f['id']));}});}function setRelationship(_0x4e6290,_0x5a2d56,_0x477e8b,_0x4d86f9){return request({'form':{'method':'set_relationship','input_type':'JSON','response_type':_0xd4f4('0x21'),'rest_data':JSON['stringify']({'session':_0x4e6290['id'],'module_name':'Calls','module_id':_0x477e8b['id'],'link_field_name':_0x4d86f9,'related_ids':[_0x5a2d56['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xd4f4('0x4e')]=function(_0x21754a,_0x5730f6,_0x1e9e2a,_0x4246f2,_0x3b648f,_0x4ab26a){var _0x2051c9,_0x137bc1,_0x8e58d3,_0x583ab9;_0x4ab26a[_0xd4f4('0x4f')]=intUtil[_0xd4f4('0x50')](_0x4ab26a[_0xd4f4('0x4f')]);_0x4ab26a[_0xd4f4('0x51')]=intUtil[_0xd4f4('0x50')](_0x4ab26a[_0xd4f4('0x51')]);def[_0xd4f4('0x52')]=util[_0xd4f4('0x23')]('%s/service/v4_1/rest.php',_0x4ab26a[_0xd4f4('0x4f')]);if(_0x3b648f&&_0x3b648f[_0xd4f4('0x53')]){logger[_0xd4f4('0xe')](_0xd4f4('0x54'),_0xd4f4('0x55'));_0x5730f6[_0xd4f4('0x56')]=util[_0xd4f4('0x23')](_0xd4f4('0x57'),_0x4ab26a['serverUrl'],_0x5730f6['uniqueid'],md5(_0x5730f6[_0xd4f4('0x58')]));}else{_0x5730f6['recordingURL']='';}return getConnection(_0x4ab26a)[_0xd4f4('0x2d')](function(_0x47c944){_0x583ab9=_0x47c944;return getUser(_0x4ab26a,_0x4246f2[_0xd4f4('0xf')],_0x583ab9);})['then'](function(_0xd9559b){_0x2051c9=_0xd9559b;logger[_0xd4f4('0xe')](_0xd4f4('0x59'),_0x2051c9['id']);return getEndUser(_0x4ab26a,_0x5730f6[_0xd4f4('0x5a')],_0x5730f6[_0xd4f4('0x5b')],_0x583ab9);})[_0xd4f4('0x2d')](function(_0x5b693b){_0x137bc1=_0x5b693b;logger[_0xd4f4('0xe')](_0xd4f4('0x5c'),_0x137bc1['id']);return getTicket(_0x4ab26a,_0x2051c9,_0x137bc1,_0x1e9e2a,_0x5730f6,_0x1e9e2a[_0xd4f4('0x5d')],_0x583ab9,'Inbound');})[_0xd4f4('0x2d')](function(_0x4d32c5){_0x8e58d3=_0x4d32c5;logger[_0xd4f4('0xe')](_0xd4f4('0x5e'));logger[_0xd4f4('0xe')]('The\x20Ticket\x20ID\x20is:',_0x8e58d3['id']);return setRelationship(_0x583ab9,_0x2051c9,_0x8e58d3,_0xd4f4('0x5f'));})[_0xd4f4('0x2d')](function(){return setRelationship(_0x583ab9,_0x137bc1,_0x8e58d3,_0xd4f4('0x60'));})['then'](function(){return getServerInfo(_0x583ab9);})[_0xd4f4('0x2d')](function(_0x45ff61){var _0x1b27e7=parseInt(_0x45ff61[_0xd4f4('0x61')][_0xd4f4('0x62')](0x0));var _0x2e28bd=util[_0xd4f4('0x23')](_0xd4f4('0x63'),_0x4ab26a['remoteUri'],_0x8e58d3['id']);if(_0x1b27e7>0x6){_0x2e28bd=util[_0xd4f4('0x23')](_0xd4f4('0x64'),_0x4ab26a[_0xd4f4('0x4f')],_0x8e58d3['id']);}logger['info'](_0xd4f4('0x54'),_0xd4f4('0x65'));emit(util['format'](_0xd4f4('0x66'),_0x4246f2[_0xd4f4('0xf')]),_0xd4f4('0x67'),{'uri':_0x2e28bd});})['catch'](function(_0x10afd5){logger['error'](_0xd4f4('0x54'),JSON[_0xd4f4('0x28')](_0x10afd5));});};exports[_0xd4f4('0x68')]=function(_0x323ac0,_0x45d673,_0x259354,_0x5552f1,_0x266a0c,_0x32a660,_0x157352){var _0x3e1072,_0x3c5884,_0x3cbe8f,_0x5145ec;_0x32a660[_0xd4f4('0x4f')]=intUtil[_0xd4f4('0x50')](_0x32a660[_0xd4f4('0x4f')]);_0x32a660[_0xd4f4('0x51')]=intUtil[_0xd4f4('0x50')](_0x32a660[_0xd4f4('0x51')]);def['uri']=util[_0xd4f4('0x23')](_0xd4f4('0x69'),_0x32a660[_0xd4f4('0x4f')]);if(_0x157352&&_0x157352['recordingFormat']&&_0x157352['recordingFormat']!==_0xd4f4('0x6a')){logger[_0xd4f4('0xe')](_0xd4f4('0x6b'),'Recording\x20is\x20enabled!');_0x45d673[_0xd4f4('0x56')]=util[_0xd4f4('0x23')](_0xd4f4('0x57'),_0x32a660['serverUrl'],_0x45d673['uniqueid'],md5(_0x45d673['uniqueid']));}return getConnection(_0x32a660)[_0xd4f4('0x2d')](function(_0x19da33){_0x5145ec=_0x19da33;return getUser(_0x32a660,_0x5552f1[_0xd4f4('0xf')],_0x5145ec);})[_0xd4f4('0x2d')](function(_0x49ed64){_0x3e1072=_0x49ed64;logger[_0xd4f4('0xe')](_0xd4f4('0x59'),_0x3e1072['id']);return getEndUser(_0x32a660,_0x45d673[_0xd4f4('0x6c')],_0x45d673[_0xd4f4('0x6d')],_0x5145ec);})[_0xd4f4('0x2d')](function(_0x3ad072){_0x3c5884=_0x3ad072;logger[_0xd4f4('0xe')](_0xd4f4('0x5c'),_0x3c5884['id']);return getTicket(_0x32a660,_0x3e1072,_0x3c5884,_0x259354,_0x45d673,_0x259354[_0xd4f4('0x5d')],_0x5145ec,_0xd4f4('0x6e'));})[_0xd4f4('0x2d')](function(_0x4fe1c6){_0x3cbe8f=_0x4fe1c6;logger[_0xd4f4('0xe')](_0xd4f4('0x5e'));logger[_0xd4f4('0xe')](_0xd4f4('0x6f'),_0x3cbe8f['id']);return setRelationship(_0x5145ec,_0x3e1072,_0x3cbe8f,_0xd4f4('0x5f'));})['then'](function(){return setRelationship(_0x5145ec,_0x3c5884,_0x3cbe8f,_0xd4f4('0x60'));})['then'](function(){return getServerInfo(_0x5145ec);})['then'](function(_0x265f76){var _0x53d394=parseInt(_0x265f76['version'][_0xd4f4('0x62')](0x0));var _0x3a53cd=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x32a660[_0xd4f4('0x4f')],_0x3cbe8f['id']);if(_0x53d394>0x6){_0x3a53cd=util[_0xd4f4('0x23')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x32a660[_0xd4f4('0x4f')],_0x3cbe8f['id']);}logger[_0xd4f4('0xe')]('[OUTBOUND]',_0xd4f4('0x65'));emit(util[_0xd4f4('0x23')](_0xd4f4('0x66'),_0x5552f1[_0xd4f4('0xf')]),_0xd4f4('0x67'),{'uri':_0x3a53cd});})[_0xd4f4('0x70')](function(_0x4e9a5a){logger[_0xd4f4('0x71')](_0xd4f4('0x6b'),JSON['stringify'](_0x4e9a5a));});};exports[_0xd4f4('0x72')]=function(_0x30da19,_0x5c7fe7,_0x30ea80,_0x1cabd1,_0x10074,_0x4bd066){var _0x3f08ff,_0x22f7e1,_0x290ebf,_0x14302c;_0x4bd066[_0xd4f4('0x4f')]=intUtil[_0xd4f4('0x50')](_0x4bd066[_0xd4f4('0x4f')]);_0x4bd066[_0xd4f4('0x51')]=intUtil[_0xd4f4('0x50')](_0x4bd066[_0xd4f4('0x51')]);def[_0xd4f4('0x52')]=util[_0xd4f4('0x23')]('%s/service/v4_1/rest.php',_0x4bd066[_0xd4f4('0x4f')]);if(_0x10074&&_0x10074[_0xd4f4('0x53')]){logger[_0xd4f4('0xe')]('['+_0x5c7fe7[_0xd4f4('0x73')][_0xd4f4('0x74')]()+']','Recording\x20is\x20enabled!');_0x5c7fe7[_0xd4f4('0x56')]=util[_0xd4f4('0x23')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4bd066['serverUrl'],_0x5c7fe7[_0xd4f4('0x58')],md5(_0x5c7fe7['uniqueid']));}else{_0x5c7fe7[_0xd4f4('0x56')]='';}return getConnection(_0x4bd066)[_0xd4f4('0x2d')](function(_0x5cf12a){_0x14302c=_0x5cf12a;if(!_['isNil'](_0x1cabd1)){return getUser(_0x4bd066,_0x1cabd1['name'],_0x14302c);}else{return getUser(_0x4bd066,null,_0x14302c);}})[_0xd4f4('0x2d')](function(_0x285fab){_0x3f08ff=_0x285fab;logger['info'](_0xd4f4('0x59'),_0x3f08ff['id']);return getEndUser(_0x4bd066,_0x5c7fe7[_0xd4f4('0x5a')],_0x5c7fe7[_0xd4f4('0x5b')],_0x14302c);})['then'](function(_0xef66b6){_0x22f7e1=_0xef66b6;logger['info'](_0xd4f4('0x5c'),_0x22f7e1['id']);return getTicket(_0x4bd066,_0x3f08ff,_0x22f7e1,_0x30ea80,_0x5c7fe7,_0x30ea80[_0xd4f4('0x5d')],_0x14302c,_0xd4f4('0x75'));})[_0xd4f4('0x2d')](function(_0xa0a29a){_0x290ebf=_0xa0a29a;logger[_0xd4f4('0xe')](_0xd4f4('0x5e'));logger[_0xd4f4('0xe')](_0xd4f4('0x6f'),_0x290ebf['id']);return setRelationship(_0x14302c,_0x3f08ff,_0x290ebf,_0xd4f4('0x5f'));})[_0xd4f4('0x2d')](function(){return setRelationship(_0x14302c,_0x22f7e1,_0x290ebf,_0xd4f4('0x60'));})[_0xd4f4('0x2d')](function(){return getServerInfo(_0x14302c);})[_0xd4f4('0x70')](function(_0xae15b2){logger[_0xd4f4('0x71')]('['+_0x5c7fe7[_0xd4f4('0x73')][_0xd4f4('0x74')]()+']',JSON[_0xd4f4('0x28')](_0xae15b2));});}; \ No newline at end of file +var _0x6a71=['%s/#bwc/index.php?module=Calls&action=EditView&record=%s','error','lastevent','toUpperCase','isNil','Inbound','lodash','request-promise','bluebird','md5','ioredis','../../../../config/environment','defaults','redis','localhost','emit','info','Creating\x20new\x20ticket...','name','Subjects','assigned_user_id','description','getString','Descriptions','date_start','replace','duration_hours','duration_minutes','parent_id','length','forEach','push','idField','variableName','JSON','Calls','Basic\x20%s','apiKey','toString','base64','get_server_info','stringify','Getting\x20agent\x20with\x20name','Employees','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','value','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','type','string','toLowerCase','customField','custom_fields','content','variable','customVariable','Variable','username','password','PLAIN','xCALLY\x20Motion\x20integration','set_relationship','queue','stripTrailingSlash','remoteUri','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','outbound','recordingFormat','none','destcalleridname','Outbound','users'];(function(_0x2d5dcf,_0xf71498){var _0x42a3e8=function(_0xaa41d8){while(--_0xaa41d8){_0x2d5dcf['push'](_0x2d5dcf['shift']());}};_0x42a3e8(++_0xf71498);}(_0x6a71,0x15f));var _0x16a7=function(_0x13cfca,_0x20fa91){_0x13cfca=_0x13cfca-0x0;var _0x950904=_0x6a71[_0x13cfca];return _0x950904;};'use strict';var _=require(_0x16a7('0x0'));var rp=require(_0x16a7('0x1'));var BPromise=require(_0x16a7('0x2'));var md5=require(_0x16a7('0x3'));var util=require('util');var Redis=require(_0x16a7('0x4'));var intUtil=require('./util');var config=require(_0x16a7('0x5'));var logger=require('../../../../config/logger')('sugarcrm');config['redis']=_[_0x16a7('0x6')](config[_0x16a7('0x7')],{'host':_0x16a7('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x16a7('0x7')]));var def={'method':'POST','json':!![]};function emit(_0x163248,_0x33d021,_0x5b7d02){io['to'](_0x163248)[_0x16a7('0x9')](_0x33d021,_0x5b7d02);}function getTicket(_0x1fd44d,_0x8a99f4,_0x40472c,_0x5121b0,_0x5c6419,_0xd0c3b2,_0x24cde7,_0x131ddf){logger[_0x16a7('0xa')](_0x16a7('0xb'));var _0x10f923=new Date();var _0x13e93c=[{'name':_0x16a7('0xc'),'value':intUtil['getString'](_0x5121b0[_0x16a7('0xd')],_0x5c6419,'\x20')},{'name':_0x16a7('0xe'),'value':_0x8a99f4['id']},{'name':'created_by','value':_0x8a99f4['id']},{'name':_0x16a7('0xf'),'value':intUtil[_0x16a7('0x10')](_0x5121b0[_0x16a7('0x11')],_0x5c6419,'\x0a')},{'name':_0x16a7('0x12'),'value':_0x10f923['toISOString']()['slice'](0x0,0x13)[_0x16a7('0x13')]('T','\x20')},{'name':_0x16a7('0x14'),'value':'0'},{'name':_0x16a7('0x15'),'value':'15'},{'name':_0x16a7('0x16'),'value':_0x40472c['id']},{'name':'parent_type','value':'Contacts'},{'name':'parent_name','value':_0x40472c['name']},{'name':'direction','value':_0x131ddf}];if(_0xd0c3b2[_0x16a7('0x17')]){_[_0x16a7('0x18')](_0xd0c3b2,function(_0x2e5649){if(_0x5c6419[_0x2e5649['variableName']]){_0x13e93c[_0x16a7('0x19')]({'name':_0x2e5649[_0x16a7('0x1a')],'value':_0x5c6419[_0x2e5649[_0x16a7('0x1b')]]});}});}return request({'form':{'method':'set_entry','input_type':_0x16a7('0x1c'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x24cde7['id'],'module_name':_0x16a7('0x1d'),'name_value_list':_0x13e93c})}});}function getAuth(_0x2badda){return util['format'](_0x16a7('0x1e'),new Buffer(_0x2badda[_0x16a7('0x1f')]+':X')[_0x16a7('0x20')](_0x16a7('0x21')));}function getServerInfo(_0x2550e6){return request({'form':{'method':_0x16a7('0x22'),'input_type':'JSON','response_type':_0x16a7('0x1c'),'rest_data':JSON[_0x16a7('0x23')]({'session':_0x2550e6['id']})}});}function getUser(_0x1b544c,_0x324f22,_0x1def83){if(!_['isNil'](_0x324f22)){logger[_0x16a7('0xa')](_0x16a7('0x24'),_0x324f22);return request({'form':{'method':'get_entry_list','input_type':_0x16a7('0x1c'),'response_type':_0x16a7('0x1c'),'rest_data':JSON[_0x16a7('0x23')]({'session':_0x1def83['id'],'module_name':_0x16a7('0x25'),'query':util[_0x16a7('0x26')](_0x16a7('0x27'),_0x324f22),'order_by':'','offset':'0','select_fields':['id',_0x16a7('0xc'),_0x16a7('0x28')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x16a7('0x29')](function(_0x119d4e){if(_0x119d4e[_0x16a7('0x2a')]['length']){var _0x1b9d61=_[_0x16a7('0x2b')](_0x119d4e[_0x16a7('0x2a')],function(_0xcdba12){return _0xcdba12[_0x16a7('0x2c')][_0x16a7('0x28')][_0x16a7('0x2d')]===_0x324f22;});if(_0x1b9d61){logger[_0x16a7('0xa')]('Agent\x20found!');return BPromise[_0x16a7('0x2e')]({'id':_0x1b9d61[_0x16a7('0x2c')]['id']['value'],'name':_0x1b9d61[_0x16a7('0x2c')][_0x16a7('0xc')][_0x16a7('0x2d')]});}}logger[_0x16a7('0xa')](_0x16a7('0x2f'));return BPromise[_0x16a7('0x2e')]({'id':_0x1def83[_0x16a7('0x2c')][_0x16a7('0x30')][_0x16a7('0x2d')],'name':_0x1def83[_0x16a7('0x2c')][_0x16a7('0x28')][_0x16a7('0x2d')]});});}else{logger['info']('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0x16a7('0x2e')]({'id':_0x1def83['name_value_list']['user_id'][_0x16a7('0x2d')],'name':_0x1def83[_0x16a7('0x2c')][_0x16a7('0x28')][_0x16a7('0x2d')]});}}function getEndUser(_0x58104a,_0x25f3d0,_0x46df1b,_0x29e378){logger[_0x16a7('0xa')](_0x16a7('0x31'),_0x46df1b);return request({'form':{'method':'get_entry_list','input_type':_0x16a7('0x1c'),'response_type':_0x16a7('0x1c'),'rest_data':JSON[_0x16a7('0x23')]({'session':_0x29e378['id'],'module_name':_0x16a7('0x32'),'query':util[_0x16a7('0x26')](_0x16a7('0x33'),_0x46df1b),'order_by':'','offset':'0','select_fields':['id',_0x16a7('0xc'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x3aff47){if(_0x3aff47[_0x16a7('0x2a')]['length']){var _0x53d6e1=_[_0x16a7('0x2b')](_0x3aff47['entry_list'],function(_0xfdc7b0){return _0xfdc7b0[_0x16a7('0x2c')][_0x16a7('0x34')]['value']===_0x46df1b;});if(_0x53d6e1){logger[_0x16a7('0xa')](_0x16a7('0x35'));return BPromise[_0x16a7('0x2e')]({'id':_0x53d6e1['name_value_list']['id'][_0x16a7('0x2d')],'name':_0x53d6e1[_0x16a7('0x2c')]['name'][_0x16a7('0x2d')],'phone':_0x53d6e1[_0x16a7('0x2c')][_0x16a7('0x34')][_0x16a7('0x2d')]});}}else{logger['info'](_0x16a7('0x36'));return request({'form':{'method':'set_entry','input_type':_0x16a7('0x1c'),'response_type':_0x16a7('0x1c'),'rest_data':JSON[_0x16a7('0x23')]({'session':_0x29e378['id'],'module_name':_0x16a7('0x32'),'name_value_list':[{'name':_0x16a7('0x37'),'value':_0x25f3d0!==_0x16a7('0x38')?_0x25f3d0:util[_0x16a7('0x26')](_0x16a7('0x39'),_0x46df1b)},{'name':_0x16a7('0x34'),'value':_0x46df1b}]})}})[_0x16a7('0x29')](function(_0x1f510b){logger[_0x16a7('0xa')](_0x16a7('0x3a'));return BPromise['resolve']({'id':_0x1f510b['id'],'name':_0x1f510b[_0x16a7('0x2a')]['first_name'][_0x16a7('0x2d')],'phone':_0x1f510b['entry_list']['phone_home']['value']});});}});}function request(_0x113c9b){logger[_0x16a7('0x3b')](_0x16a7('0x3c'),JSON['stringify'](_0x113c9b));return rp(_[_0x16a7('0x3d')](def,_0x113c9b));}function getTags(_0x493475,_0x42b357){var _0x2436d3=[];if(_0x493475&&_0x493475[_0x16a7('0x17')]>0x0){_0x2436d3=_[_0x16a7('0x3e')](_0x493475,_0x42b357);}return _0x2436d3;}function getCustomFields(_0x591547,_0x398a2c){var _0x20cc26=[];var _0x58e9b5={'custom_fields':[]};if(_0x591547[_0x16a7('0x17')]>0x0){_['forEach'](_0x591547,function(_0x113301){if(_0x113301[_0x16a7('0x3f')]===_0x16a7('0x40')&&_0x113301['nameField']&&!_0x113301['customField']){_0x58e9b5[_0x113301['nameField'][_0x16a7('0x41')]()]=_0x113301['content']['toString']();}else if(_0x113301['type']===_0x16a7('0x40')&&_0x113301[_0x16a7('0x1a')]&&_0x113301[_0x16a7('0x42')]){_0x58e9b5[_0x16a7('0x43')][_0x16a7('0x19')]({'id':_0x113301[_0x16a7('0x1a')],'value':_0x113301[_0x16a7('0x44')]['toString']()});}else if(_0x113301['type']===_0x16a7('0x45')&&_0x113301['variableName']&&_0x113301[_0x16a7('0x1a')]&&_0x113301[_0x16a7('0x42')]){_0x398a2c[_0x113301[_0x16a7('0x1b')]]&&_0x58e9b5[_0x16a7('0x43')][_0x16a7('0x19')]({'id':_0x113301[_0x16a7('0x1a')],'value':_0x398a2c[_0x113301['variableName']][_0x16a7('0x20')]()});}else if(_0x113301['type']===_0x16a7('0x46')&&_0x113301[_0x16a7('0x47')]&&_0x113301[_0x16a7('0x47')][_0x16a7('0xc')]&&_0x113301[_0x16a7('0x1a')]&&_0x113301[_0x16a7('0x42')]){_0x398a2c[_0x113301[_0x16a7('0x47')][_0x16a7('0xc')]['toLowerCase']()]&&_0x58e9b5[_0x16a7('0x43')][_0x16a7('0x19')]({'id':_0x113301[_0x16a7('0x1a')],'value':_0x398a2c[_0x113301['Variable'][_0x16a7('0xc')][_0x16a7('0x41')]()][_0x16a7('0x20')]()});}});}return _0x58e9b5;}function getConnection(_0x5475d4){return request({'method':'POST','form':{'method':'login','input_type':_0x16a7('0x1c'),'response_type':_0x16a7('0x1c'),'rest_data':JSON[_0x16a7('0x23')]({'user_auth':{'user_name':_0x5475d4[_0x16a7('0x48')],'password':_0x5475d4[_0x16a7('0x49')],'encryption':_0x16a7('0x4a')},'application':_0x16a7('0x4b')})}})[_0x16a7('0x29')](function(_0x253327){var _0x515a0a=_0x253327;if(_0x515a0a['id']){def['sessionID']=_0x515a0a['id'];return BPromise[_0x16a7('0x2e')](_0x515a0a);}else{throw new Error(util[_0x16a7('0x26')]('Account\x20%d\x20is\x20not\x20valid',_0x5475d4['id']));}});}function setRelationship(_0x5c10bf,_0x41b67e,_0xf11a3b,_0x2041cc){return request({'form':{'method':_0x16a7('0x4c'),'input_type':_0x16a7('0x1c'),'response_type':_0x16a7('0x1c'),'rest_data':JSON[_0x16a7('0x23')]({'session':_0x5c10bf['id'],'module_name':'Calls','module_id':_0xf11a3b['id'],'link_field_name':_0x2041cc,'related_ids':[_0x41b67e['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x16a7('0x4d')]=function(_0x5e22e4,_0x376416,_0x20d2d7,_0x445c80,_0x4ca125,_0x464a6f){var _0x592209,_0x16f613,_0x1b441e,_0x2e35ec;_0x464a6f['remoteUri']=intUtil[_0x16a7('0x4e')](_0x464a6f[_0x16a7('0x4f')]);_0x464a6f['serverUrl']=intUtil['stripTrailingSlash'](_0x464a6f[_0x16a7('0x50')]);def[_0x16a7('0x51')]=util['format'](_0x16a7('0x52'),_0x464a6f[_0x16a7('0x4f')]);if(_0x4ca125&&_0x4ca125[_0x16a7('0x53')]){logger[_0x16a7('0xa')](_0x16a7('0x54'),_0x16a7('0x55'));_0x376416['recordingURL']=util[_0x16a7('0x26')](_0x16a7('0x56'),_0x464a6f[_0x16a7('0x50')],_0x376416[_0x16a7('0x57')],md5(_0x376416[_0x16a7('0x57')]));}else{_0x376416[_0x16a7('0x58')]='';}return getConnection(_0x464a6f)[_0x16a7('0x29')](function(_0x441153){_0x2e35ec=_0x441153;return getUser(_0x464a6f,_0x445c80[_0x16a7('0xc')],_0x2e35ec);})['then'](function(_0x27f616){_0x592209=_0x27f616;logger['info'](_0x16a7('0x59'),_0x592209['id']);return getEndUser(_0x464a6f,_0x376416[_0x16a7('0x5a')],_0x376416[_0x16a7('0x5b')],_0x2e35ec);})[_0x16a7('0x29')](function(_0x8d7c3){_0x16f613=_0x8d7c3;logger['info'](_0x16a7('0x5c'),_0x16f613['id']);return getTicket(_0x464a6f,_0x592209,_0x16f613,_0x20d2d7,_0x376416,_0x20d2d7[_0x16a7('0x5d')],_0x2e35ec,'Inbound');})[_0x16a7('0x29')](function(_0x13a2e1){_0x1b441e=_0x13a2e1;logger[_0x16a7('0xa')](_0x16a7('0x5e'));logger['info'](_0x16a7('0x5f'),_0x1b441e['id']);return setRelationship(_0x2e35ec,_0x592209,_0x1b441e,'users');})[_0x16a7('0x29')](function(){return setRelationship(_0x2e35ec,_0x16f613,_0x1b441e,_0x16a7('0x60'));})[_0x16a7('0x29')](function(){return getServerInfo(_0x2e35ec);})[_0x16a7('0x29')](function(_0x2df775){var _0x594dde=parseInt(_0x2df775[_0x16a7('0x61')][_0x16a7('0x62')](0x0));var _0x959b36=util[_0x16a7('0x26')](_0x16a7('0x63'),_0x464a6f['remoteUri'],_0x1b441e['id']);if(_0x594dde>0x6){_0x959b36=util['format']('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x464a6f[_0x16a7('0x4f')],_0x1b441e['id']);}logger[_0x16a7('0xa')](_0x16a7('0x54'),_0x16a7('0x64'));emit(util[_0x16a7('0x26')]('user:%s',_0x445c80[_0x16a7('0xc')]),_0x16a7('0x65'),{'uri':_0x959b36});})[_0x16a7('0x66')](function(_0x594c48){logger['error'](_0x16a7('0x54'),JSON[_0x16a7('0x23')](_0x594c48));});};exports[_0x16a7('0x67')]=function(_0x426f5b,_0x17da0e,_0x2ec7bb,_0xbe9c80,_0xc075e9,_0x292299,_0x22fed7){var _0x4f13f9,_0x2e2303,_0x1a2c87,_0x5a9982;_0x292299['remoteUri']=intUtil[_0x16a7('0x4e')](_0x292299[_0x16a7('0x4f')]);_0x292299[_0x16a7('0x50')]=intUtil[_0x16a7('0x4e')](_0x292299[_0x16a7('0x50')]);def['uri']=util[_0x16a7('0x26')](_0x16a7('0x52'),_0x292299['remoteUri']);if(_0x22fed7&&_0x22fed7[_0x16a7('0x68')]&&_0x22fed7[_0x16a7('0x68')]!==_0x16a7('0x69')){logger[_0x16a7('0xa')]('[OUTBOUND]',_0x16a7('0x55'));_0x17da0e[_0x16a7('0x58')]=util[_0x16a7('0x26')](_0x16a7('0x56'),_0x292299[_0x16a7('0x50')],_0x17da0e[_0x16a7('0x57')],md5(_0x17da0e[_0x16a7('0x57')]));}return getConnection(_0x292299)[_0x16a7('0x29')](function(_0x31b6d9){_0x5a9982=_0x31b6d9;return getUser(_0x292299,_0xbe9c80['name'],_0x5a9982);})[_0x16a7('0x29')](function(_0x5388c4){_0x4f13f9=_0x5388c4;logger['info']('The\x20User\x20ID\x20is:',_0x4f13f9['id']);return getEndUser(_0x292299,_0x17da0e[_0x16a7('0x6a')],_0x17da0e['destcalleridnum'],_0x5a9982);})[_0x16a7('0x29')](function(_0x2af40e){_0x2e2303=_0x2af40e;logger[_0x16a7('0xa')](_0x16a7('0x5c'),_0x2e2303['id']);return getTicket(_0x292299,_0x4f13f9,_0x2e2303,_0x2ec7bb,_0x17da0e,_0x2ec7bb['Fields'],_0x5a9982,_0x16a7('0x6b'));})[_0x16a7('0x29')](function(_0x3b14e1){_0x1a2c87=_0x3b14e1;logger['info']('Ticket\x20created!');logger[_0x16a7('0xa')](_0x16a7('0x5f'),_0x1a2c87['id']);return setRelationship(_0x5a9982,_0x4f13f9,_0x1a2c87,_0x16a7('0x6c'));})[_0x16a7('0x29')](function(){return setRelationship(_0x5a9982,_0x2e2303,_0x1a2c87,_0x16a7('0x60'));})[_0x16a7('0x29')](function(){return getServerInfo(_0x5a9982);})['then'](function(_0x42b3f1){var _0x5001f5=parseInt(_0x42b3f1[_0x16a7('0x61')][_0x16a7('0x62')](0x0));var _0x280391=util[_0x16a7('0x26')](_0x16a7('0x63'),_0x292299[_0x16a7('0x4f')],_0x1a2c87['id']);if(_0x5001f5>0x6){_0x280391=util[_0x16a7('0x26')](_0x16a7('0x6d'),_0x292299[_0x16a7('0x4f')],_0x1a2c87['id']);}logger[_0x16a7('0xa')]('[OUTBOUND]',_0x16a7('0x64'));emit(util[_0x16a7('0x26')]('user:%s',_0xbe9c80['name']),'trigger:browser:url',{'uri':_0x280391});})[_0x16a7('0x66')](function(_0x5bb44f){logger[_0x16a7('0x6e')]('[OUTBOUND]',JSON[_0x16a7('0x23')](_0x5bb44f));});};exports['unmanaged']=function(_0x236474,_0x1fc29f,_0x2c6b95,_0x2a8875,_0x3f22b9,_0x4cb13d){var _0x579552,_0x38f9b7,_0x305132,_0x53da78;_0x4cb13d[_0x16a7('0x4f')]=intUtil['stripTrailingSlash'](_0x4cb13d['remoteUri']);_0x4cb13d[_0x16a7('0x50')]=intUtil[_0x16a7('0x4e')](_0x4cb13d[_0x16a7('0x50')]);def[_0x16a7('0x51')]=util[_0x16a7('0x26')](_0x16a7('0x52'),_0x4cb13d[_0x16a7('0x4f')]);if(_0x3f22b9&&_0x3f22b9['monitor_format']){logger['info']('['+_0x1fc29f[_0x16a7('0x6f')][_0x16a7('0x70')]()+']',_0x16a7('0x55'));_0x1fc29f[_0x16a7('0x58')]=util[_0x16a7('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4cb13d[_0x16a7('0x50')],_0x1fc29f['uniqueid'],md5(_0x1fc29f[_0x16a7('0x57')]));}else{_0x1fc29f[_0x16a7('0x58')]='';}return getConnection(_0x4cb13d)[_0x16a7('0x29')](function(_0x1a660e){_0x53da78=_0x1a660e;if(!_[_0x16a7('0x71')](_0x2a8875)){return getUser(_0x4cb13d,_0x2a8875['name'],_0x53da78);}else{return getUser(_0x4cb13d,null,_0x53da78);}})[_0x16a7('0x29')](function(_0x2c5d2f){_0x579552=_0x2c5d2f;logger['info'](_0x16a7('0x59'),_0x579552['id']);return getEndUser(_0x4cb13d,_0x1fc29f[_0x16a7('0x5a')],_0x1fc29f[_0x16a7('0x5b')],_0x53da78);})[_0x16a7('0x29')](function(_0x58b65d){_0x38f9b7=_0x58b65d;logger[_0x16a7('0xa')](_0x16a7('0x5c'),_0x38f9b7['id']);return getTicket(_0x4cb13d,_0x579552,_0x38f9b7,_0x2c6b95,_0x1fc29f,_0x2c6b95[_0x16a7('0x5d')],_0x53da78,_0x16a7('0x72'));})['then'](function(_0x99021c){_0x305132=_0x99021c;logger['info'](_0x16a7('0x5e'));logger[_0x16a7('0xa')](_0x16a7('0x5f'),_0x305132['id']);return setRelationship(_0x53da78,_0x579552,_0x305132,_0x16a7('0x6c'));})[_0x16a7('0x29')](function(){return setRelationship(_0x53da78,_0x38f9b7,_0x305132,_0x16a7('0x60'));})['then'](function(){return getServerInfo(_0x53da78);})[_0x16a7('0x66')](function(_0x5a5e9f){logger[_0x16a7('0x6e')]('['+_0x1fc29f[_0x16a7('0x6f')][_0x16a7('0x70')]()+']',JSON[_0x16a7('0x23')](_0x5a5e9f));});}; \ 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 612b812..48dd62a 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 _0x2a05=['toLowerCase','keyValue','keyType','key','format','keyContent','%s:\x20%s','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','test','lodash','getString','length','sortBy','string','type','variable','variableName','push','toString','customVariable','Variable','name'];(function(_0x34a923,_0x3ce38d){var _0x46442b=function(_0x110960){while(--_0x110960){_0x34a923['push'](_0x34a923['shift']());}};_0x46442b(++_0x3ce38d);}(_0x2a05,0xb0));var _0x52a0=function(_0x4ae83b,_0x49d7b0){_0x4ae83b=_0x4ae83b-0x0;var _0x17a4fe=_0x2a05[_0x4ae83b];return _0x17a4fe;};'use strict';var _=require(_0x52a0('0x0'));var util=require('util');exports[_0x52a0('0x1')]=function(_0x1641e7,_0x451af4,_0x5bd85d){var _0x406c58=[];if(_0x1641e7[_0x52a0('0x2')]>0x0){var _0x1e8d87=_[_0x52a0('0x3')](_0x1641e7,['id']);for(var _0x4588ef=0x0;_0x4588ef<_0x1e8d87[_0x52a0('0x2')];_0x4588ef++){var _0x31e3f8=_0x1e8d87[_0x4588ef];if(_0x31e3f8['type']===_0x52a0('0x4')){_0x406c58['push'](_0x31e3f8['content']);}else if(_0x31e3f8[_0x52a0('0x5')]===_0x52a0('0x6')&&_0x31e3f8[_0x52a0('0x7')]){_0x451af4[_0x31e3f8[_0x52a0('0x7')]]&&_0x406c58[_0x52a0('0x8')](_0x451af4[_0x31e3f8[_0x52a0('0x7')]][_0x52a0('0x9')]());}else if(_0x31e3f8['type']===_0x52a0('0xa')&&_0x31e3f8[_0x52a0('0xb')]&&_0x31e3f8[_0x52a0('0xb')][_0x52a0('0xc')]){_0x451af4[_0x31e3f8['Variable'][_0x52a0('0xc')][_0x52a0('0xd')]()]&&_0x406c58[_0x52a0('0x8')](_0x451af4[_0x31e3f8['Variable'][_0x52a0('0xc')][_0x52a0('0xd')]()][_0x52a0('0x9')]());}else if(_0x31e3f8[_0x52a0('0x5')]===_0x52a0('0xe')){if(_0x31e3f8[_0x52a0('0xf')]==='string'&&_0x31e3f8[_0x52a0('0x10')]){_0x406c58[_0x52a0('0x8')](util[_0x52a0('0x11')]('%s:\x20%s',_0x31e3f8[_0x52a0('0x10')],_0x31e3f8[_0x52a0('0x12')]));}else if(_0x31e3f8[_0x52a0('0xf')]==='variable'&&_0x31e3f8[_0x52a0('0x7')]&&_0x31e3f8['key']){_0x451af4[_0x31e3f8[_0x52a0('0x7')]]&&_0x406c58['push'](util[_0x52a0('0x11')](_0x52a0('0x13'),_0x31e3f8[_0x52a0('0x10')],_0x451af4[_0x31e3f8[_0x52a0('0x7')]]));}else if(_0x31e3f8[_0x52a0('0xf')]==='customVariable'&&_0x31e3f8[_0x52a0('0xb')]&&_0x31e3f8[_0x52a0('0xb')]['name']&&_0x31e3f8[_0x52a0('0x10')]){_0x451af4[_0x31e3f8['Variable'][_0x52a0('0xc')]['toLowerCase']()]&&_0x406c58[_0x52a0('0x8')](util[_0x52a0('0x11')](_0x52a0('0x13'),_0x31e3f8['key'],_0x451af4[_0x31e3f8[_0x52a0('0xb')][_0x52a0('0xc')][_0x52a0('0xd')]()]));}}}}return _0x406c58['join'](_0x5bd85d);};exports[_0x52a0('0x14')]=function(_0x3152da){var _0x19d997=_0x3152da[_0x52a0('0x15')](-0x1);if(_0x19d997==='/'){_0x3152da=_0x3152da[_0x52a0('0x16')](0x0,_0x3152da[_0x52a0('0x17')](_0x19d997));}return _0x3152da;};exports[_0x52a0('0x18')]=function(_0x3786d2){if(!_[_0x52a0('0x19')](_0x3786d2)&&_0x3786d2!==''){var _0x41e405=/^(([^<>()\[\]\\.,;:\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 _0x41e405[_0x52a0('0x1a')](String(_0x3786d2)[_0x52a0('0xd')]());}else{return![];}}; \ No newline at end of file +var _0x5b2a=['string','key','format','%s:\x20%s','join','slice','substring','validateEmail','isNil','lodash','util','getString','sortBy','type','content','variable','variableName','customVariable','Variable','toLowerCase','push','toString','keyValue','keyType'];(function(_0x582d69,_0x406136){var _0x3ae6f8=function(_0x5e71c4){while(--_0x5e71c4){_0x582d69['push'](_0x582d69['shift']());}};_0x3ae6f8(++_0x406136);}(_0x5b2a,0x69));var _0xa5b2=function(_0x1e393b,_0x355f6b){_0x1e393b=_0x1e393b-0x0;var _0x3d0bfe=_0x5b2a[_0x1e393b];return _0x3d0bfe;};'use strict';var _=require(_0xa5b2('0x0'));var util=require(_0xa5b2('0x1'));exports[_0xa5b2('0x2')]=function(_0x5e72e5,_0x123fa4,_0x7efabd){var _0x3aa6d7=[];if(_0x5e72e5['length']>0x0){var _0xdec989=_[_0xa5b2('0x3')](_0x5e72e5,['id']);for(var _0x3a4e29=0x0;_0x3a4e29<_0xdec989['length'];_0x3a4e29++){var _0x5737ef=_0xdec989[_0x3a4e29];if(_0x5737ef[_0xa5b2('0x4')]==='string'){_0x3aa6d7['push'](_0x5737ef[_0xa5b2('0x5')]);}else if(_0x5737ef['type']===_0xa5b2('0x6')&&_0x5737ef[_0xa5b2('0x7')]){_0x123fa4[_0x5737ef[_0xa5b2('0x7')]]&&_0x3aa6d7['push'](_0x123fa4[_0x5737ef[_0xa5b2('0x7')]]['toString']());}else if(_0x5737ef['type']===_0xa5b2('0x8')&&_0x5737ef[_0xa5b2('0x9')]&&_0x5737ef[_0xa5b2('0x9')]['name']){_0x123fa4[_0x5737ef[_0xa5b2('0x9')]['name'][_0xa5b2('0xa')]()]&&_0x3aa6d7[_0xa5b2('0xb')](_0x123fa4[_0x5737ef[_0xa5b2('0x9')]['name'][_0xa5b2('0xa')]()][_0xa5b2('0xc')]());}else if(_0x5737ef['type']===_0xa5b2('0xd')){if(_0x5737ef[_0xa5b2('0xe')]===_0xa5b2('0xf')&&_0x5737ef[_0xa5b2('0x10')]){_0x3aa6d7[_0xa5b2('0xb')](util[_0xa5b2('0x11')](_0xa5b2('0x12'),_0x5737ef[_0xa5b2('0x10')],_0x5737ef['keyContent']));}else if(_0x5737ef[_0xa5b2('0xe')]===_0xa5b2('0x6')&&_0x5737ef[_0xa5b2('0x7')]&&_0x5737ef['key']){_0x123fa4[_0x5737ef['variableName']]&&_0x3aa6d7[_0xa5b2('0xb')](util[_0xa5b2('0x11')](_0xa5b2('0x12'),_0x5737ef[_0xa5b2('0x10')],_0x123fa4[_0x5737ef[_0xa5b2('0x7')]]));}else if(_0x5737ef[_0xa5b2('0xe')]===_0xa5b2('0x8')&&_0x5737ef[_0xa5b2('0x9')]&&_0x5737ef[_0xa5b2('0x9')]['name']&&_0x5737ef[_0xa5b2('0x10')]){_0x123fa4[_0x5737ef['Variable']['name'][_0xa5b2('0xa')]()]&&_0x3aa6d7['push'](util[_0xa5b2('0x11')](_0xa5b2('0x12'),_0x5737ef[_0xa5b2('0x10')],_0x123fa4[_0x5737ef[_0xa5b2('0x9')]['name']['toLowerCase']()]));}}}}return _0x3aa6d7[_0xa5b2('0x13')](_0x7efabd);};exports['stripTrailingSlash']=function(_0x49148a){var _0x6f349a=_0x49148a[_0xa5b2('0x14')](-0x1);if(_0x6f349a==='/'){_0x49148a=_0x49148a[_0xa5b2('0x15')](0x0,_0x49148a['lastIndexOf'](_0x6f349a));}return _0x49148a;};exports[_0xa5b2('0x16')]=function(_0xe2ad7b){if(!_[_0xa5b2('0x17')](_0xe2ad7b)&&_0xe2ad7b!==''){var _0x2e0cb4=/^(([^<>()\[\]\\.,;:\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 _0x2e0cb4['test'](String(_0xe2ad7b)[_0xa5b2('0xa')]());}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 6dc381c..62e8666 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['info','Creating\x20new\x20ticket...','merge','Normal','Subjects','POST','format','%s/webservice.php','remoteUri','create','username','sessionName','HelpDesk','stringify','success','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','then','Agent\x20found!','resolve','email1','first_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','admin','catch','userId','getUser','Searching\x20end\x20user\x20with\x20phone','GET','query','Enduser\x20found!','firstname','Enduser\x20created.','lastname','phone','accessKey','getchallenge','login','token','getConnection','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','lastevent','toUpperCase','lodash','request-promise','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','localhost','socket.io-emitter','emit','length','forEach','includes','picklist','idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase'];(function(_0x32cf96,_0x7502d5){var _0x125cc1=function(_0x376987){while(--_0x376987){_0x32cf96['push'](_0x32cf96['shift']());}};_0x125cc1(++_0x7502d5);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var rp=require(_0x0d8b('0x1'));var BPromise=require('bluebird');var md5=require('md5');var util=require('util');var Redis=require(_0x0d8b('0x2'));var intUtil=require(_0x0d8b('0x3'));var config=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));config['redis']=_['defaults'](config[_0x0d8b('0x7')],{'host':_0x0d8b('0x8'),'port':0x18eb});var io=require(_0x0d8b('0x9'))(new Redis(config['redis']));function emit(_0x413284,_0x284169,_0x58e4e2){io['to'](_0x413284)[_0x0d8b('0xa')](_0x284169,_0x58e4e2);}function getCustomFields(_0x348e65,_0x3b027f){var _0x1f4800={};if(_0x348e65[_0x0d8b('0xb')]>0x0){_[_0x0d8b('0xc')](_0x348e65,function(_0x2c5e9e){if(_[_0x0d8b('0xd')](['string',_0x0d8b('0xe')],_0x2c5e9e['type'])&&_0x2c5e9e[_0x0d8b('0xf')]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x2c5e9e[_0x0d8b('0x10')][_0x0d8b('0x11')]();}else if(_0x2c5e9e[_0x0d8b('0x12')]===_0x0d8b('0x13')&&_0x2c5e9e[_0x0d8b('0x14')]&&_0x2c5e9e[_0x0d8b('0xf')]&&_0x3b027f[_0x2c5e9e[_0x0d8b('0x14')]]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x3b027f[_0x2c5e9e[_0x0d8b('0x14')]][_0x0d8b('0x11')]();}else if(_0x2c5e9e[_0x0d8b('0x12')]===_0x0d8b('0x15')&&_0x2c5e9e['Variable']&&_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')]&&_0x2c5e9e[_0x0d8b('0xf')]&&_0x3b027f[_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')]['toLowerCase']()]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x3b027f[_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')][_0x0d8b('0x18')]()][_0x0d8b('0x11')]();}});}return _0x1f4800;}function createTicket(_0x18dd2d,_0x264b39,_0xa3612a,_0x4a15bf,_0x27512e,_0x23d58f,_0x196c0a){logger[_0x0d8b('0x19')](_0x0d8b('0x1a'));var _0x5b709c=_[_0x0d8b('0x1b')]({'parent_id':'','assigned_user_id':_0x264b39['id'],'ticketpriorities':_0x0d8b('0x1c'),'ticketstatus':'Open','ticket_title':intUtil['getString'](_0x4a15bf[_0x0d8b('0x1d')],_0x27512e,'\x20'),'description':intUtil['getString'](_0x4a15bf['Descriptions'],_0x27512e,'\x0a'),'contact_id':_0xa3612a['id']},getCustomFields(_0x23d58f,_0x27512e));var _0x5527d8={'method':_0x0d8b('0x1e'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x18dd2d[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x22'),'username':_0x18dd2d[_0x0d8b('0x23')],'sessionName':_0x196c0a[_0x0d8b('0x24')],'elementType':_0x0d8b('0x25'),'element':JSON[_0x0d8b('0x26')](_0x5b709c)},'json':!![]};return request(_0x5527d8)['then'](function(_0xe8bbee){if(_0xe8bbee[_0x0d8b('0x27')]){return BPromise['resolve']({'id':_0xe8bbee[_0x0d8b('0x28')]['id']});}else{throw new Error(util['format'](_0x0d8b('0x29'),JSON[_0x0d8b('0x26')](_0xe8bbee[_0x0d8b('0x2a')])));}})['catch'](function(_0x59a905){var _0x28f639=_0x59a905[_0x0d8b('0x2b')]||0x1f4;logger['error'](_0x0d8b('0x2c'),'createTicket',_0x28f639,JSON[_0x0d8b('0x26')](_0x59a905));});}function getUser(_0x4b59e5,_0x97050a,_0x48f24f){if(intUtil[_0x0d8b('0x2d')](_0x97050a)){logger['info'](_0x0d8b('0x2e'),_0x97050a);return request({'method':'GET','uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x4b59e5[_0x0d8b('0x21')]),'qs':{'operation':'query','username':_0x4b59e5['username'],'sessionName':_0x48f24f['sessionName'],'query':util[_0x0d8b('0x1f')]('SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;',_0x97050a)},'json':!![]})[_0x0d8b('0x2f')](function(_0x54f6f3){if(_0x54f6f3['success']&&_0x54f6f3[_0x0d8b('0x28')][_0x0d8b('0xb')]){logger[_0x0d8b('0x19')](_0x0d8b('0x30'));return BPromise[_0x0d8b('0x31')]({'id':_0x54f6f3[_0x0d8b('0x28')][0x0]['id'],'email':_0x54f6f3[_0x0d8b('0x28')][0x0][_0x0d8b('0x32')],'name':_0x54f6f3['result'][0x0][_0x0d8b('0x33')]+'\x20'+_0x54f6f3[_0x0d8b('0x28')]['last_name']});}else{logger[_0x0d8b('0x19')](_0x0d8b('0x34'));return BPromise[_0x0d8b('0x31')]({'id':_0x48f24f['userId'],'email':_0x4b59e5[_0x0d8b('0x23')],'name':_0x0d8b('0x35')});}})[_0x0d8b('0x36')](function(_0x31ceba){var _0x933e01=_0x31ceba['statusCode']||0x1f4;logger[_0x0d8b('0x2a')](_0x0d8b('0x2c'),'getUser',_0x933e01,JSON[_0x0d8b('0x26')](_0x31ceba));});}else{logger[_0x0d8b('0x19')](_0x0d8b('0x34'));return BPromise[_0x0d8b('0x31')]({'id':_0x48f24f[_0x0d8b('0x37')],'email':_0x4b59e5['username'],'name':'admin'})[_0x0d8b('0x36')](function(_0x5c2c04){var _0x531c55=_0x5c2c04[_0x0d8b('0x2b')]||0x1f4;logger[_0x0d8b('0x2a')](_0x0d8b('0x2c'),_0x0d8b('0x38'),_0x531c55,JSON[_0x0d8b('0x26')](_0x5c2c04));});}}function getEndUser(_0x24c789,_0x579324,_0x6e5bab,_0x6a02ad){logger[_0x0d8b('0x19')](_0x0d8b('0x39'),_0x6e5bab);return request({'method':_0x0d8b('0x3a'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x24c789['remoteUri']),'qs':{'operation':_0x0d8b('0x3b'),'username':_0x24c789[_0x0d8b('0x23')],'sessionName':_0x6a02ad[_0x0d8b('0x24')],'query':util[_0x0d8b('0x1f')]('SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;',_0x6e5bab,_0x6e5bab,_0x6e5bab,_0x6e5bab,_0x6e5bab)},'json':!![]})[_0x0d8b('0x2f')](function(_0x4b4bde){if(_0x4b4bde[_0x0d8b('0x27')]&&_0x4b4bde[_0x0d8b('0x28')][_0x0d8b('0xb')]){logger[_0x0d8b('0x19')](_0x0d8b('0x3c'));return BPromise[_0x0d8b('0x31')]({'id':_0x4b4bde[_0x0d8b('0x28')][0x0]['id'],'name':_0x4b4bde[_0x0d8b('0x28')][0x0][_0x0d8b('0x3d')]+'\x20'+_0x4b4bde[_0x0d8b('0x28')][0x0]['lastname'],'phone':_0x6e5bab});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'method':'POST','uri':util['format'](_0x0d8b('0x20'),_0x24c789[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x22'),'sessionName':_0x6a02ad['sessionName'],'elementType':'Contacts','element':JSON[_0x0d8b('0x26')]({'lastname':_0x579324,'phone':_0x6e5bab,'assigned_user_id':'\x20'})},'json':!![]})[_0x0d8b('0x2f')](function(_0x344278){logger['info'](_0x0d8b('0x3e'));return BPromise[_0x0d8b('0x31')]({'id':_0x344278['result']['id'],'name':_0x344278['result'][_0x0d8b('0x3f')],'phone':_0x344278['result'][_0x0d8b('0x40')]});})['catch'](function(_0x53f643){var _0x30ccee=_0x53f643[_0x0d8b('0x2b')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','getEndUser',_0x30ccee,JSON['stringify'](_0x53f643));});}});}function getConnection(_0x374d40){var _0x1e0498=_0x374d40[_0x0d8b('0x23')];var _0x490eda=_0x374d40[_0x0d8b('0x41')];return request({'method':_0x0d8b('0x3a'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x374d40[_0x0d8b('0x21')]),'qs':{'operation':_0x0d8b('0x42'),'username':_0x1e0498},'json':!![]})[_0x0d8b('0x2f')](function(_0x1d5067){if(_0x1d5067[_0x0d8b('0x27')]){return request({'method':_0x0d8b('0x1e'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x374d40[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x43'),'username':_0x1e0498,'accessKey':md5(_0x1d5067[_0x0d8b('0x28')][_0x0d8b('0x44')]+_0x490eda)},'json':!![]});}})[_0x0d8b('0x2f')](function(_0x1e162c){if(_0x1e162c[_0x0d8b('0x27')]){return BPromise['resolve'](_0x1e162c[_0x0d8b('0x28')]);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0x374d40['id']));}})[_0x0d8b('0x36')](function(_0x113fb7){var _0x3f943a=_0x113fb7[_0x0d8b('0x2b')]||0x1f4;logger['error'](_0x0d8b('0x2c'),_0x0d8b('0x45'),_0x3f943a,JSON[_0x0d8b('0x26')](_0x113fb7));});}function request(_0x241587){logger[_0x0d8b('0x19')]('[HTTP]',JSON['stringify'](_0x241587));return rp(_0x241587);}exports['queue']=function(_0x573f4f,_0x368ede,_0xf22c3c,_0x5e3bb4,_0x4950a8,_0x44c5c1){var _0x3d3cb6,_0x5c5bd7,_0x5ef6c3,_0x900906;_0x44c5c1[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x44c5c1[_0x0d8b('0x21')]);if(_0x4950a8&&_0x4950a8[_0x0d8b('0x47')]){logger['info'](_0x0d8b('0x48'),_0x0d8b('0x49'));_0x368ede['recordingURL']=util['format'](_0x0d8b('0x4a'),_0x44c5c1[_0x0d8b('0x4b')],_0x368ede['uniqueid'],md5(_0x368ede['uniqueid']));}else{_0x368ede[_0x0d8b('0x4c')]='';}return getConnection(_0x44c5c1)[_0x0d8b('0x2f')](function(_0x377027){_0x900906=_0x377027;return getUser(_0x44c5c1,_0x5e3bb4[_0x0d8b('0x4d')],_0x900906);})['then'](function(_0x356b3d){_0x3d3cb6=_0x356b3d;logger['info']('The\x20User\x20ID\x20is:',_0x3d3cb6['id']);return getEndUser(_0x44c5c1,_0x368ede[_0x0d8b('0x4e')],_0x368ede[_0x0d8b('0x4f')],_0x900906);})['then'](function(_0x4a8f33){_0x5c5bd7=_0x4a8f33;logger[_0x0d8b('0x19')](_0x0d8b('0x50'),_0x5c5bd7['id']);return createTicket(_0x44c5c1,_0x3d3cb6,_0x5c5bd7,_0xf22c3c,_0x368ede,_0xf22c3c[_0x0d8b('0x51')],_0x900906);})[_0x0d8b('0x2f')](function(_0x3afc3a){_0x5ef6c3=_0x3afc3a;logger[_0x0d8b('0x19')](_0x0d8b('0x52'));logger[_0x0d8b('0x19')]('The\x20Ticket\x20ID\x20is:',_0x5ef6c3['id']);var _0x24a859=util[_0x0d8b('0x1f')](_0x0d8b('0x53'),_0x44c5c1[_0x0d8b('0x21')],_[_0x0d8b('0x54')](_0x5ef6c3['id'],'x')[0x1]);logger[_0x0d8b('0x19')](_0x0d8b('0x48'),_0x0d8b('0x55'));emit(util[_0x0d8b('0x1f')]('user:%s',_0x5e3bb4[_0x0d8b('0x17')]),_0x0d8b('0x56'),{'uri':_0x24a859});})[_0x0d8b('0x36')](function(_0x23de9e){logger[_0x0d8b('0x2a')]('[QUEUE]',JSON[_0x0d8b('0x26')](_0x23de9e));});};exports[_0x0d8b('0x57')]=function(_0x181d49,_0x17a87f,_0x1d6cd4,_0x59ada2,_0x4d0e7c,_0x3b1166,_0x291b83){var _0x3e4a41,_0xbbb520,_0x5a70bd,_0x199122;_0x3b1166[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x3b1166['remoteUri']);_0x3b1166[_0x0d8b('0x4b')]=intUtil['stripTrailingSlash'](_0x3b1166[_0x0d8b('0x4b')]);if(_0x291b83&&_0x291b83[_0x0d8b('0x58')]&&_0x291b83[_0x0d8b('0x58')]!==_0x0d8b('0x59')){logger[_0x0d8b('0x19')](_0x0d8b('0x5a'),'Recording\x20is\x20enabled!');_0x17a87f[_0x0d8b('0x4c')]=util['format'](_0x0d8b('0x4a'),_0x3b1166[_0x0d8b('0x4b')],_0x17a87f[_0x0d8b('0x5b')],md5(_0x17a87f[_0x0d8b('0x5b')]));}return getConnection(_0x3b1166)['then'](function(_0x19e097){_0x199122=_0x19e097;return getUser(_0x3b1166,_0x59ada2[_0x0d8b('0x4d')],_0x199122);})[_0x0d8b('0x2f')](function(_0x2332fc){_0x3e4a41=_0x2332fc;logger[_0x0d8b('0x19')](_0x0d8b('0x5c'),_0x3e4a41['id']);return getEndUser(_0x3b1166,_0x17a87f[_0x0d8b('0x5d')],_0x17a87f[_0x0d8b('0x5e')],_0x199122);})[_0x0d8b('0x2f')](function(_0x34affb){_0xbbb520=_0x34affb;logger['info']('The\x20Enduser\x20ID\x20is:',_0xbbb520['id']);return createTicket(_0x3b1166,_0x3e4a41,_0xbbb520,_0x1d6cd4,_0x17a87f,_0x1d6cd4[_0x0d8b('0x51')],_0x199122);})[_0x0d8b('0x2f')](function(_0x53e399){_0x5a70bd=_0x53e399;logger[_0x0d8b('0x19')]('Ticket\x20created!');logger['info'](_0x0d8b('0x5f'),_0x5a70bd['id']);var _0x1c4e96=util['format']('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x3b1166[_0x0d8b('0x21')],_[_0x0d8b('0x54')](_0x5a70bd['id'],'x')[0x1]);logger[_0x0d8b('0x19')](_0x0d8b('0x5a'),_0x0d8b('0x55'));emit(util[_0x0d8b('0x1f')](_0x0d8b('0x60'),_0x59ada2['name']),_0x0d8b('0x56'),{'uri':_0x1c4e96});})['catch'](function(_0x1a203e){logger[_0x0d8b('0x2a')](_0x0d8b('0x5a'),JSON[_0x0d8b('0x26')](_0x1a203e));});};exports['unmanaged']=function(_0x3fe47d,_0x4a1c4a,_0x3a356b,_0x2c6c5f,_0x1c5fe2,_0x2ebea3){var _0xc5c35f,_0x2b44e5,_0x3e927c,_0x91aa89;_0x2ebea3[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x2ebea3['remoteUri']);_0x2ebea3[_0x0d8b('0x4b')]=intUtil['stripTrailingSlash'](_0x2ebea3[_0x0d8b('0x4b')]);if(_0x1c5fe2&&_0x1c5fe2[_0x0d8b('0x47')]){logger['info']('['+_0x4a1c4a[_0x0d8b('0x61')]['toUpperCase']()+']',_0x0d8b('0x49'));_0x4a1c4a[_0x0d8b('0x4c')]=util[_0x0d8b('0x1f')](_0x0d8b('0x4a'),_0x2ebea3[_0x0d8b('0x4b')],_0x4a1c4a[_0x0d8b('0x5b')],md5(_0x4a1c4a[_0x0d8b('0x5b')]));}else{_0x4a1c4a[_0x0d8b('0x4c')]='';}return getConnection(_0x2ebea3)['then'](function(_0x10eca6){_0x91aa89=_0x10eca6;return getUser(_0x2ebea3,'',_0x91aa89);})[_0x0d8b('0x2f')](function(_0x5b2916){_0xc5c35f=_0x5b2916;logger[_0x0d8b('0x19')](_0x0d8b('0x5c'),_0xc5c35f['id']);return getEndUser(_0x2ebea3,_0x4a1c4a[_0x0d8b('0x4e')],_0x4a1c4a[_0x0d8b('0x4f')],_0x91aa89);})[_0x0d8b('0x2f')](function(_0x9e44b4){_0x2b44e5=_0x9e44b4;logger[_0x0d8b('0x19')](_0x0d8b('0x50'),_0x2b44e5['id']);return createTicket(_0x2ebea3,_0xc5c35f,_0x2b44e5,_0x3a356b,_0x4a1c4a,_0x3a356b[_0x0d8b('0x51')],_0x91aa89);})[_0x0d8b('0x2f')](function(_0xe35028){_0x3e927c=_0xe35028;logger[_0x0d8b('0x19')]('Ticket\x20created!');logger[_0x0d8b('0x19')](_0x0d8b('0x5f'),_0x3e927c['id']);})[_0x0d8b('0x36')](function(_0x58525c){logger['error']('['+_0x4a1c4a[_0x0d8b('0x61')][_0x0d8b('0x62')]()+']',JSON[_0x0d8b('0x26')](_0x58525c));});}; \ No newline at end of file +var _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x5800e4,_0x8ead45){var _0x1f8902=function(_0x5de2f6){while(--_0x5de2f6){_0x5800e4['push'](_0x5800e4['shift']());}};_0x1f8902(++_0x8ead45);}(_0x9c44,0x178));var _0x49c4=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x9c44[_0x1969a7];return _0x3d665f;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index d7532c1..8c2291a 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 _0xae48=['then','user','%s/users/me.json','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','username','%s/token:%s','token','Basic\x20%s','[HTTP]','map','includes','string','picklist','type','customField','nameField','toLowerCase','content','toString','idField','custom_fields','push','variableName','customVariable','Variable','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','uniqueid','Authorization','email','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/agent/tickets/%s','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','inspect','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','/api/v2','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','lodash','md5','util','ioredis','./util','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','POST','merge','Tags','name','Subjects','getString','Descriptions','Ticket\x20created!','%s/search.json','type:user\x20role:agent\x20email:%s','find','results','agent','remoteUri'];(function(_0x5020e4,_0x5d98ea){var _0x1a8027=function(_0x526f1b){while(--_0x526f1b){_0x5020e4['push'](_0x5020e4['shift']());}};_0x1a8027(++_0x5d98ea);}(_0xae48,0x175));var _0x8ae4=function(_0xa4928c,_0x16b89c){_0xa4928c=_0xa4928c-0x0;var _0x27cc29=_0xae48[_0xa4928c];return _0x27cc29;};'use strict';var _=require(_0x8ae4('0x0'));var rp=require('request-promise');var md5=require(_0x8ae4('0x1'));var util=require(_0x8ae4('0x2'));var Redis=require(_0x8ae4('0x3'));var intUtil=require(_0x8ae4('0x4'));var config=require('../../../../config/environment');var logger=require(_0x8ae4('0x5'))(_0x8ae4('0x6'));config[_0x8ae4('0x7')]=_[_0x8ae4('0x8')](config[_0x8ae4('0x7')],{'host':_0x8ae4('0x9'),'port':0x18eb});var io=require(_0x8ae4('0xa'))(new Redis(config[_0x8ae4('0x7')]));function emit(_0x50d848,_0x5af0ff,_0x216059){io['to'](_0x50d848)[_0x8ae4('0xb')](_0x5af0ff,_0x216059);}var headers={'Content-Type':_0x8ae4('0xc'),'Accept':'application/json'};function getTicket(_0x3391fb,_0x4f506,_0x20d04e,_0x1fb893,_0x3f4862){logger[_0x8ae4('0xd')](_0x8ae4('0xe'));return request({'uri':util[_0x8ae4('0xf')](_0x8ae4('0x10'),_0x3391fb['remoteUri']),'method':_0x8ae4('0x11'),'body':{'ticket':_[_0x8ae4('0x12')]({'requester_id':_0x20d04e['id'],'submitter_id':_0x4f506?_0x4f506['id']:undefined,'assignee_id':_0x4f506?_0x4f506['id']:undefined,'tags':getTags(_0x1fb893[_0x8ae4('0x13')],_0x8ae4('0x14')),'subject':intUtil['getString'](_0x1fb893[_0x8ae4('0x15')],_0x3f4862,'\x20'),'description':intUtil[_0x8ae4('0x16')](_0x1fb893['Descriptions'],_0x3f4862,'\x0a'),'comment':{'public':![],'body':intUtil[_0x8ae4('0x16')](_0x1fb893[_0x8ae4('0x17')],_0x3f4862,'\x0a')}},getCustomFields(_0x1fb893['Fields'],_0x3f4862))}})['then'](function(_0x117c78){logger['info'](_0x8ae4('0x18'));return _0x117c78['ticket'];});}function getUser(_0x1dbc50,_0x3b5a93){if(intUtil['validateEmail'](_0x3b5a93)){logger[_0x8ae4('0xd')]('Getting\x20agent\x20with\x20email',_0x3b5a93);return request({'uri':util[_0x8ae4('0xf')](_0x8ae4('0x19'),_0x1dbc50['remoteUri']),'qs':{'query':util[_0x8ae4('0xf')](_0x8ae4('0x1a'),_0x3b5a93)}})['then'](function(_0x402db0){if(_0x402db0['count']){logger[_0x8ae4('0xd')]('Agent\x20found!');return _[_0x8ae4('0x1b')](_0x402db0[_0x8ae4('0x1c')],{'email':_0x3b5a93,'role':_0x8ae4('0x1d')});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x8ae4('0xf')]('%s/users/me.json',_0x1dbc50[_0x8ae4('0x1e')])})[_0x8ae4('0x1f')](function(_0xc4dc3c){logger[_0x8ae4('0xd')]('Admin\x20account\x20selected.');return _0xc4dc3c[_0x8ae4('0x20')];});}});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x8ae4('0xf')](_0x8ae4('0x21'),_0x1dbc50[_0x8ae4('0x1e')])})['then'](function(_0x4e95fb){logger['info'](_0x8ae4('0x22'));return _0x4e95fb['user'];});}}function getEndUser(_0x446920,_0x2e8797,_0x21b17f){logger['info'](_0x8ae4('0x23'),_0x21b17f);return request({'uri':util[_0x8ae4('0xf')](_0x8ae4('0x19'),_0x446920[_0x8ae4('0x1e')]),'qs':{'query':util[_0x8ae4('0xf')](_0x8ae4('0x24'),_0x21b17f)}})[_0x8ae4('0x1f')](function(_0x329563){var _0x6dc0cd;if(_0x329563[_0x8ae4('0x1c')][_0x8ae4('0x25')]){_0x329563[_0x8ae4('0x1c')]=_[_0x8ae4('0x26')](_0x329563[_0x8ae4('0x1c')],{'suspended':![],'role':_0x8ae4('0x27')});if(_0x329563[_0x8ae4('0x1c')][_0x8ae4('0x25')]){_0x6dc0cd=_[_0x8ae4('0x28')](_0x329563[_0x8ae4('0x1c')]);}}if(_0x6dc0cd){logger[_0x8ae4('0xd')](_0x8ae4('0x29'));return _0x6dc0cd;}else{logger[_0x8ae4('0xd')](_0x8ae4('0x2a'));return request({'uri':util[_0x8ae4('0xf')](_0x8ae4('0x2b'),_0x446920['remoteUri']),'method':_0x8ae4('0x11'),'body':{'user':{'role':_0x8ae4('0x27'),'name':util[_0x8ae4('0xf')](_0x8ae4('0x2c'),_0x2e8797||_0x21b17f),'phone':_0x21b17f}}})[_0x8ae4('0x1f')](function(_0x14f88b){logger[_0x8ae4('0xd')](_0x8ae4('0x2d'));return _0x14f88b[_0x8ae4('0x20')];});}});}function getAuth(_0x1e5f55){var _0x24e4ff;if(_0x1e5f55[_0x8ae4('0x2e')]===_0x8ae4('0x2f')){_0x24e4ff=util[_0x8ae4('0xf')]('%s:%s',_0x1e5f55[_0x8ae4('0x30')],_0x1e5f55['password']);}else if(_0x1e5f55[_0x8ae4('0x2e')]==='token'){_0x24e4ff=util['format'](_0x8ae4('0x31'),_0x1e5f55[_0x8ae4('0x30')],_0x1e5f55[_0x8ae4('0x32')]);}return util[_0x8ae4('0xf')](_0x8ae4('0x33'),new Buffer(_0x24e4ff)['toString']('base64'));}function request(_0x1efad3){logger['debug'](_0x8ae4('0x34'),JSON['stringify'](_0x1efad3));return rp(_[_0x8ae4('0x8')](_0x1efad3,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x420a59,_0x479ede){var _0xa21230=[];if(_0x420a59&&_0x420a59['length']>0x0){_0xa21230=_[_0x8ae4('0x35')](_0x420a59,_0x479ede);}return _0xa21230;}function getCustomFields(_0x1bbbb2,_0x139a01){var _0x52808e=[];var _0x56b634={'custom_fields':[]};if(_0x1bbbb2[_0x8ae4('0x25')]>0x0){_['forEach'](_0x1bbbb2,function(_0xae361b){if(_[_0x8ae4('0x36')]([_0x8ae4('0x37'),_0x8ae4('0x38')],_0xae361b[_0x8ae4('0x39')])&&_0xae361b['nameField']&&!_0xae361b[_0x8ae4('0x3a')]){_0x56b634[_0xae361b[_0x8ae4('0x3b')][_0x8ae4('0x3c')]()]=_0xae361b[_0x8ae4('0x3d')][_0x8ae4('0x3e')]();}else if(_[_0x8ae4('0x36')]([_0x8ae4('0x37'),_0x8ae4('0x38')],_0xae361b[_0x8ae4('0x39')])&&_0xae361b[_0x8ae4('0x3f')]&&_0xae361b['customField']){_0x56b634[_0x8ae4('0x40')][_0x8ae4('0x41')]({'id':_0xae361b[_0x8ae4('0x3f')],'value':_0xae361b['content']['toString']()});}else if(_0xae361b[_0x8ae4('0x39')]==='variable'&&_0xae361b[_0x8ae4('0x42')]&&_0xae361b[_0x8ae4('0x3f')]&&_0xae361b[_0x8ae4('0x3a')]){_0x139a01[_0xae361b[_0x8ae4('0x42')]]&&_0x56b634[_0x8ae4('0x40')][_0x8ae4('0x41')]({'id':_0xae361b[_0x8ae4('0x3f')],'value':_0x139a01[_0xae361b[_0x8ae4('0x42')]]['toString']()});}else if(_0xae361b[_0x8ae4('0x39')]===_0x8ae4('0x43')&&_0xae361b[_0x8ae4('0x44')]&&_0xae361b[_0x8ae4('0x44')][_0x8ae4('0x14')]&&_0xae361b[_0x8ae4('0x3f')]&&_0xae361b[_0x8ae4('0x3a')]){_0x139a01[_0xae361b['Variable'][_0x8ae4('0x14')][_0x8ae4('0x3c')]()]&&_0x56b634['custom_fields'][_0x8ae4('0x41')]({'id':_0xae361b[_0x8ae4('0x3f')],'value':_0x139a01[_0xae361b['Variable'][_0x8ae4('0x14')][_0x8ae4('0x3c')]()][_0x8ae4('0x3e')]()});}});}return _0x56b634;}exports['queue']=function(_0x35dfd9,_0x3fa7c9,_0x13f8c7,_0x2bf364,_0x1b40e0,_0x4d91a3){var _0x2cdc47,_0x1a038a;_0x4d91a3['remoteUri']=intUtil[_0x8ae4('0x45')](_0x4d91a3[_0x8ae4('0x1e')]);_0x4d91a3[_0x8ae4('0x46')]=intUtil['stripTrailingSlash'](_0x4d91a3[_0x8ae4('0x46')]);if(_0x1b40e0&&_0x1b40e0[_0x8ae4('0x47')]){logger[_0x8ae4('0xd')](_0x8ae4('0x48'),'Recording\x20is\x20enabled!');_0x3fa7c9[_0x8ae4('0x49')]=util[_0x8ae4('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4d91a3[_0x8ae4('0x46')],_0x3fa7c9[_0x8ae4('0x4a')],md5(_0x3fa7c9[_0x8ae4('0x4a')]));}else{_0x3fa7c9[_0x8ae4('0x49')]='';}headers[_0x8ae4('0x4b')]=getAuth(_0x4d91a3);return getUser(_0x4d91a3,_0x2bf364[_0x8ae4('0x4c')])[_0x8ae4('0x1f')](function(_0x41c8e9){_0x2cdc47=_0x41c8e9;logger[_0x8ae4('0xd')]('The\x20User\x20ID\x20is:',_0x2cdc47['id']);return getEndUser(_0x4d91a3,_0x3fa7c9['calleridname'],_0x3fa7c9[_0x8ae4('0x4d')]);})['then'](function(_0x2e92d0){_0x1a038a=_0x2e92d0;logger[_0x8ae4('0xd')](_0x8ae4('0x4e'),_0x1a038a['id']);return getTicket(_0x4d91a3,_0x2cdc47,_0x1a038a,_0x13f8c7,_0x3fa7c9);})[_0x8ae4('0x1f')](function(_0x161914){if(_0x161914){logger[_0x8ae4('0xd')](_0x8ae4('0x4f'),_0x161914['id']);switch(_0x4d91a3[_0x8ae4('0x39')]){case'integrationTab':logger[_0x8ae4('0xd')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x8ae4('0xf')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x4d91a3[_0x8ae4('0x1e')],_0x2cdc47['id'],_0x161914['id']),'method':_0x8ae4('0x11')});case _0x8ae4('0x50'):logger[_0x8ae4('0xd')](_0x8ae4('0x48'),_0x8ae4('0x51'));emit(util[_0x8ae4('0xf')](_0x8ae4('0x52'),_0x2bf364['name']),'trigger:browser:url',{'uri':util[_0x8ae4('0xf')](_0x8ae4('0x53'),_0x4d91a3[_0x8ae4('0x1e')]['replace']('/api/v2',''),_0x161914['id'])});break;default:logger[_0x8ae4('0x54')]('[QUEUE]',_0x8ae4('0x55'));}}})[_0x8ae4('0x56')](function(_0x33ff99){logger[_0x8ae4('0x54')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0x8ae4('0x57')](_0x33ff99,{'showHidden':!![],'depth':null}));});};exports[_0x8ae4('0x58')]=function(_0xc755e8,_0x17ee62,_0x2c5b0c,_0x30c400,_0x539249,_0x357174,_0x114ff9){var _0x186701,_0x5aa826;_0x357174['remoteUri']=intUtil[_0x8ae4('0x45')](_0x357174[_0x8ae4('0x1e')]);_0x357174[_0x8ae4('0x46')]=intUtil[_0x8ae4('0x45')](_0x357174[_0x8ae4('0x46')]);if(_0x114ff9&&_0x114ff9[_0x8ae4('0x59')]&&_0x114ff9['recordingFormat']!==_0x8ae4('0x5a')){logger[_0x8ae4('0xd')](_0x8ae4('0x5b'),_0x8ae4('0x5c'));_0x17ee62['recordingURL']=util[_0x8ae4('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x357174[_0x8ae4('0x46')],_0x17ee62[_0x8ae4('0x4a')],md5(_0x17ee62[_0x8ae4('0x4a')]));}headers['Authorization']=getAuth(_0x357174);return getUser(_0x357174,_0x30c400['email'])[_0x8ae4('0x1f')](function(_0x3494ac){_0x186701=_0x3494ac;logger['info'](_0x8ae4('0x5d'),_0x186701['id']);return getEndUser(_0x357174,_0x17ee62['destcalleridname'],_0x17ee62['destcalleridnum']);})[_0x8ae4('0x1f')](function(_0x599674){_0x5aa826=_0x599674;logger[_0x8ae4('0xd')](_0x8ae4('0x4e'),_0x5aa826['id']);return getTicket(_0x357174,_0x186701,_0x5aa826,_0x2c5b0c,_0x17ee62);})[_0x8ae4('0x1f')](function(_0x2f6faa){if(_0x2f6faa){logger[_0x8ae4('0xd')](_0x8ae4('0x4f'),_0x2f6faa['id']);switch(_0x357174[_0x8ae4('0x39')]){case _0x8ae4('0x5e'):logger[_0x8ae4('0xd')](_0x8ae4('0x5b'),_0x8ae4('0x5f'));return request({'uri':util[_0x8ae4('0xf')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x357174[_0x8ae4('0x1e')],_0x186701['id'],_0x2f6faa['id']),'method':_0x8ae4('0x11')});case _0x8ae4('0x50'):logger[_0x8ae4('0xd')](_0x8ae4('0x5b'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x8ae4('0xf')]('user:%s',_0x30c400[_0x8ae4('0x14')]),'trigger:browser:url',{'uri':util[_0x8ae4('0xf')](_0x8ae4('0x53'),_0x357174[_0x8ae4('0x1e')]['replace'](_0x8ae4('0x60'),''),_0x2f6faa['id'])});break;default:logger['error'](_0x8ae4('0x5b'),_0x8ae4('0x55'));}}})[_0x8ae4('0x56')](function(_0xa76cf1){logger[_0x8ae4('0x54')](_0x8ae4('0x61'),util['inspect'](_0xa76cf1,{'showHidden':!![],'depth':null}));});};exports[_0x8ae4('0x62')]=function(_0x389dd8,_0x3d82c0,_0xf17a19,_0x624a12,_0x38f03e,_0x16c200){var _0x1636eb,_0xd99787;_0x16c200[_0x8ae4('0x1e')]=intUtil[_0x8ae4('0x45')](_0x16c200[_0x8ae4('0x1e')]);_0x16c200['serverUrl']=intUtil['stripTrailingSlash'](_0x16c200[_0x8ae4('0x46')]);if(_0x38f03e&&_0x38f03e[_0x8ae4('0x47')]){logger[_0x8ae4('0xd')]('['+_0x3d82c0['lastevent'][_0x8ae4('0x63')]()+']',_0x8ae4('0x5c'));_0x3d82c0[_0x8ae4('0x49')]=util[_0x8ae4('0xf')](_0x8ae4('0x64'),_0x16c200[_0x8ae4('0x46')],_0x3d82c0['uniqueid'],md5(_0x3d82c0[_0x8ae4('0x4a')]));}else{_0x3d82c0['recordingURL']='';}headers[_0x8ae4('0x4b')]=getAuth(_0x16c200);return getUser(_0x16c200)['then'](function(_0x551008){_0x1636eb=_0x551008;logger[_0x8ae4('0xd')](_0x8ae4('0x5d'),_0x1636eb['id']);return getEndUser(_0x16c200,_0x3d82c0['calleridname'],_0x3d82c0[_0x8ae4('0x4d')]);})[_0x8ae4('0x1f')](function(_0x4c2f44){_0xd99787=_0x4c2f44;logger[_0x8ae4('0xd')](_0x8ae4('0x4e'),_0xd99787['id']);return getTicket(_0x16c200,_0x1636eb,_0xd99787,_0xf17a19,_0x3d82c0);})['then'](function(_0x4f82b2){if(_0x4f82b2){logger[_0x8ae4('0xd')](_0x8ae4('0x4f'),_0x4f82b2['id']);}})[_0x8ae4('0x56')](function(_0x456251){logger[_0x8ae4('0x54')]('['+_0x3d82c0['lastevent'][_0x8ae4('0x63')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x456251,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x102d=['email','calleridname','calleridnum','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','outbound','recordingFormat','none','destcalleridnum','The\x20Enduser\x20ID\x20is:','[OUTBOUND]','%s/channels/voice/agents/%d/tickets/%d/display.json','%s/agent/tickets/%s','replace','inspect','unmanaged','toUpperCase','The\x20User\x20ID\x20is:','lastevent','\x20Error\x20running\x20Zendesk\x20integration','request-promise','md5','util','ioredis','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','format','type:user\x20role:agent\x20email:%s','count','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','results','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','%s/token:%s','Basic\x20%s','toString','base64','debug','forEach','includes','string','type','customField','nameField','toLowerCase','content','picklist','idField','variable','variableName','custom_fields','push','customVariable','Variable','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization'];(function(_0x54d4a8,_0x585a59){var _0x3b321b=function(_0x245c6a){while(--_0x245c6a){_0x54d4a8['push'](_0x54d4a8['shift']());}};_0x3b321b(++_0x585a59);}(_0x102d,0x8c));var _0xd102=function(_0x1664bb,_0x280c18){_0x1664bb=_0x1664bb-0x0;var _0x4cdeb0=_0x102d[_0x1664bb];return _0x4cdeb0;};'use strict';var _=require('lodash');var rp=require(_0xd102('0x0'));var md5=require(_0xd102('0x1'));var util=require(_0xd102('0x2'));var Redis=require(_0xd102('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xd102('0x4'))(_0xd102('0x5'));config[_0xd102('0x6')]=_[_0xd102('0x7')](config[_0xd102('0x6')],{'host':_0xd102('0x8'),'port':0x18eb});var io=require(_0xd102('0x9'))(new Redis(config[_0xd102('0x6')]));function emit(_0x2d0b47,_0x47c24a,_0x3d7512){io['to'](_0x2d0b47)[_0xd102('0xa')](_0x47c24a,_0x3d7512);}var headers={'Content-Type':_0xd102('0xb'),'Accept':_0xd102('0xb')};function getTicket(_0x2921ed,_0x1fc048,_0x21bb11,_0xa2f6f8,_0x4e41fe){logger[_0xd102('0xc')](_0xd102('0xd'));return request({'uri':util['format'](_0xd102('0xe'),_0x2921ed[_0xd102('0xf')]),'method':_0xd102('0x10'),'body':{'ticket':_[_0xd102('0x11')]({'requester_id':_0x21bb11['id'],'submitter_id':_0x1fc048?_0x1fc048['id']:undefined,'assignee_id':_0x1fc048?_0x1fc048['id']:undefined,'tags':getTags(_0xa2f6f8[_0xd102('0x12')],_0xd102('0x13')),'subject':intUtil[_0xd102('0x14')](_0xa2f6f8[_0xd102('0x15')],_0x4e41fe,'\x20'),'description':intUtil[_0xd102('0x14')](_0xa2f6f8[_0xd102('0x16')],_0x4e41fe,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0xa2f6f8[_0xd102('0x16')],_0x4e41fe,'\x0a')}},getCustomFields(_0xa2f6f8['Fields'],_0x4e41fe))}})[_0xd102('0x17')](function(_0x18a86e){logger['info'](_0xd102('0x18'));return _0x18a86e[_0xd102('0x19')];});}function getUser(_0x442f54,_0x25e7b1){if(intUtil[_0xd102('0x1a')](_0x25e7b1)){logger[_0xd102('0xc')](_0xd102('0x1b'),_0x25e7b1);return request({'uri':util['format'](_0xd102('0x1c'),_0x442f54['remoteUri']),'qs':{'query':util[_0xd102('0x1d')](_0xd102('0x1e'),_0x25e7b1)}})[_0xd102('0x17')](function(_0x11555a){if(_0x11555a[_0xd102('0x1f')]){logger[_0xd102('0xc')]('Agent\x20found!');return _[_0xd102('0x20')](_0x11555a['results'],{'email':_0x25e7b1,'role':_0xd102('0x21')});}else{logger[_0xd102('0xc')](_0xd102('0x22'));return request({'uri':util[_0xd102('0x1d')](_0xd102('0x23'),_0x442f54[_0xd102('0xf')])})[_0xd102('0x17')](function(_0x162ea3){logger[_0xd102('0xc')](_0xd102('0x24'));return _0x162ea3['user'];});}});}else{logger[_0xd102('0xc')](_0xd102('0x22'));return request({'uri':util[_0xd102('0x1d')](_0xd102('0x23'),_0x442f54[_0xd102('0xf')])})[_0xd102('0x17')](function(_0x5216df){logger[_0xd102('0xc')](_0xd102('0x24'));return _0x5216df[_0xd102('0x25')];});}}function getEndUser(_0x4710e5,_0x4f8130,_0x38591e){logger[_0xd102('0xc')](_0xd102('0x26'),_0x38591e);return request({'uri':util[_0xd102('0x1d')](_0xd102('0x1c'),_0x4710e5[_0xd102('0xf')]),'qs':{'query':util[_0xd102('0x1d')]('type:user\x20role:end-user\x20phone:%s',_0x38591e)}})[_0xd102('0x17')](function(_0x10ad2a){var _0x27cd2d;if(_0x10ad2a[_0xd102('0x27')][_0xd102('0x28')]){_0x10ad2a['results']=_[_0xd102('0x29')](_0x10ad2a[_0xd102('0x27')],{'suspended':![],'role':_0xd102('0x2a')});if(_0x10ad2a[_0xd102('0x27')]['length']){_0x27cd2d=_[_0xd102('0x2b')](_0x10ad2a[_0xd102('0x27')]);}}if(_0x27cd2d){logger['info'](_0xd102('0x2c'));return _0x27cd2d;}else{logger[_0xd102('0xc')](_0xd102('0x2d'));return request({'uri':util[_0xd102('0x1d')](_0xd102('0x2e'),_0x4710e5[_0xd102('0xf')]),'method':_0xd102('0x10'),'body':{'user':{'role':'end-user','name':util[_0xd102('0x1d')](_0xd102('0x2f'),_0x4f8130||_0x38591e),'phone':_0x38591e}}})[_0xd102('0x17')](function(_0x43bead){logger[_0xd102('0xc')](_0xd102('0x30'));return _0x43bead[_0xd102('0x25')];});}});}function getAuth(_0x34922f){var _0x1049ef;if(_0x34922f[_0xd102('0x31')]===_0xd102('0x32')){_0x1049ef=util[_0xd102('0x1d')](_0xd102('0x33'),_0x34922f[_0xd102('0x34')],_0x34922f[_0xd102('0x32')]);}else if(_0x34922f[_0xd102('0x31')]==='token'){_0x1049ef=util[_0xd102('0x1d')](_0xd102('0x35'),_0x34922f['username'],_0x34922f['token']);}return util[_0xd102('0x1d')](_0xd102('0x36'),new Buffer(_0x1049ef)[_0xd102('0x37')](_0xd102('0x38')));}function request(_0x448eb2){logger[_0xd102('0x39')]('[HTTP]',JSON['stringify'](_0x448eb2));return rp(_['defaults'](_0x448eb2,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x5ccd02,_0x570222){var _0x2ee293=[];if(_0x5ccd02&&_0x5ccd02['length']>0x0){_0x2ee293=_['map'](_0x5ccd02,_0x570222);}return _0x2ee293;}function getCustomFields(_0x23f0f7,_0x59eb4c){var _0x4afb83=[];var _0x360771={'custom_fields':[]};if(_0x23f0f7['length']>0x0){_[_0xd102('0x3a')](_0x23f0f7,function(_0x4b4317){if(_[_0xd102('0x3b')]([_0xd102('0x3c'),'picklist'],_0x4b4317[_0xd102('0x3d')])&&_0x4b4317['nameField']&&!_0x4b4317[_0xd102('0x3e')]){_0x360771[_0x4b4317[_0xd102('0x3f')][_0xd102('0x40')]()]=_0x4b4317[_0xd102('0x41')][_0xd102('0x37')]();}else if(_[_0xd102('0x3b')]([_0xd102('0x3c'),_0xd102('0x42')],_0x4b4317[_0xd102('0x3d')])&&_0x4b4317[_0xd102('0x43')]&&_0x4b4317[_0xd102('0x3e')]){_0x360771['custom_fields']['push']({'id':_0x4b4317[_0xd102('0x43')],'value':_0x4b4317[_0xd102('0x41')][_0xd102('0x37')]()});}else if(_0x4b4317[_0xd102('0x3d')]===_0xd102('0x44')&&_0x4b4317[_0xd102('0x45')]&&_0x4b4317[_0xd102('0x43')]&&_0x4b4317['customField']){_0x59eb4c[_0x4b4317[_0xd102('0x45')]]&&_0x360771[_0xd102('0x46')][_0xd102('0x47')]({'id':_0x4b4317['idField'],'value':_0x59eb4c[_0x4b4317['variableName']][_0xd102('0x37')]()});}else if(_0x4b4317[_0xd102('0x3d')]===_0xd102('0x48')&&_0x4b4317[_0xd102('0x49')]&&_0x4b4317[_0xd102('0x49')][_0xd102('0x13')]&&_0x4b4317[_0xd102('0x43')]&&_0x4b4317[_0xd102('0x3e')]){_0x59eb4c[_0x4b4317[_0xd102('0x49')]['name'][_0xd102('0x40')]()]&&_0x360771[_0xd102('0x46')][_0xd102('0x47')]({'id':_0x4b4317[_0xd102('0x43')],'value':_0x59eb4c[_0x4b4317[_0xd102('0x49')][_0xd102('0x13')]['toLowerCase']()][_0xd102('0x37')]()});}});}return _0x360771;}exports[_0xd102('0x4a')]=function(_0x125324,_0x1613f8,_0x578271,_0x4cd3d0,_0x45b837,_0x4e38dd){var _0xf28f62,_0x56cc55;_0x4e38dd[_0xd102('0xf')]=intUtil['stripTrailingSlash'](_0x4e38dd[_0xd102('0xf')]);_0x4e38dd[_0xd102('0x4b')]=intUtil[_0xd102('0x4c')](_0x4e38dd[_0xd102('0x4b')]);if(_0x45b837&&_0x45b837[_0xd102('0x4d')]){logger[_0xd102('0xc')](_0xd102('0x4e'),_0xd102('0x4f'));_0x1613f8[_0xd102('0x50')]=util[_0xd102('0x1d')](_0xd102('0x51'),_0x4e38dd[_0xd102('0x4b')],_0x1613f8['uniqueid'],md5(_0x1613f8[_0xd102('0x52')]));}else{_0x1613f8['recordingURL']='';}headers[_0xd102('0x53')]=getAuth(_0x4e38dd);return getUser(_0x4e38dd,_0x4cd3d0[_0xd102('0x54')])[_0xd102('0x17')](function(_0x238c4d){_0xf28f62=_0x238c4d;logger['info']('The\x20User\x20ID\x20is:',_0xf28f62['id']);return getEndUser(_0x4e38dd,_0x1613f8[_0xd102('0x55')],_0x1613f8[_0xd102('0x56')]);})[_0xd102('0x17')](function(_0x686b7a){_0x56cc55=_0x686b7a;logger[_0xd102('0xc')]('The\x20Enduser\x20ID\x20is:',_0x56cc55['id']);return getTicket(_0x4e38dd,_0xf28f62,_0x56cc55,_0x578271,_0x1613f8);})[_0xd102('0x17')](function(_0x37b9b2){if(_0x37b9b2){logger['info'](_0xd102('0x57'),_0x37b9b2['id']);switch(_0x4e38dd['type']){case _0xd102('0x58'):logger[_0xd102('0xc')](_0xd102('0x4e'),_0xd102('0x59'));return request({'uri':util[_0xd102('0x1d')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x4e38dd[_0xd102('0xf')],_0xf28f62['id'],_0x37b9b2['id']),'method':_0xd102('0x10')});case'newTab':logger[_0xd102('0xc')](_0xd102('0x4e'),_0xd102('0x5a'));emit(util[_0xd102('0x1d')](_0xd102('0x5b'),_0x4cd3d0['name']),_0xd102('0x5c'),{'uri':util['format']('%s/agent/tickets/%s',_0x4e38dd[_0xd102('0xf')]['replace'](_0xd102('0x5d'),''),_0x37b9b2['id'])});break;default:logger[_0xd102('0x5e')](_0xd102('0x4e'),_0xd102('0x5f'));}}})[_0xd102('0x60')](function(_0x120b1c){logger[_0xd102('0x5e')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x120b1c,{'showHidden':!![],'depth':null}));});};exports[_0xd102('0x61')]=function(_0x24c23d,_0x212e2e,_0x3ebb93,_0x25bced,_0xb697f3,_0x4535da,_0x30bdd2){var _0x4e16e3,_0x44c20c;_0x4535da[_0xd102('0xf')]=intUtil[_0xd102('0x4c')](_0x4535da[_0xd102('0xf')]);_0x4535da[_0xd102('0x4b')]=intUtil[_0xd102('0x4c')](_0x4535da[_0xd102('0x4b')]);if(_0x30bdd2&&_0x30bdd2[_0xd102('0x62')]&&_0x30bdd2[_0xd102('0x62')]!==_0xd102('0x63')){logger['info']('[OUTBOUND]',_0xd102('0x4f'));_0x212e2e[_0xd102('0x50')]=util[_0xd102('0x1d')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4535da[_0xd102('0x4b')],_0x212e2e[_0xd102('0x52')],md5(_0x212e2e['uniqueid']));}headers['Authorization']=getAuth(_0x4535da);return getUser(_0x4535da,_0x25bced[_0xd102('0x54')])['then'](function(_0x1092f5){_0x4e16e3=_0x1092f5;logger[_0xd102('0xc')]('The\x20User\x20ID\x20is:',_0x4e16e3['id']);return getEndUser(_0x4535da,_0x212e2e['destcalleridname'],_0x212e2e[_0xd102('0x64')]);})[_0xd102('0x17')](function(_0x470982){_0x44c20c=_0x470982;logger['info'](_0xd102('0x65'),_0x44c20c['id']);return getTicket(_0x4535da,_0x4e16e3,_0x44c20c,_0x3ebb93,_0x212e2e);})[_0xd102('0x17')](function(_0x27f2db){if(_0x27f2db){logger[_0xd102('0xc')](_0xd102('0x57'),_0x27f2db['id']);switch(_0x4535da[_0xd102('0x3d')]){case _0xd102('0x58'):logger[_0xd102('0xc')](_0xd102('0x66'),_0xd102('0x59'));return request({'uri':util[_0xd102('0x1d')](_0xd102('0x67'),_0x4535da[_0xd102('0xf')],_0x4e16e3['id'],_0x27f2db['id']),'method':_0xd102('0x10')});case'newTab':logger[_0xd102('0xc')](_0xd102('0x66'),_0xd102('0x5a'));emit(util['format'](_0xd102('0x5b'),_0x25bced[_0xd102('0x13')]),'trigger:browser:url',{'uri':util[_0xd102('0x1d')](_0xd102('0x68'),_0x4535da[_0xd102('0xf')][_0xd102('0x69')](_0xd102('0x5d'),''),_0x27f2db['id'])});break;default:logger[_0xd102('0x5e')](_0xd102('0x66'),_0xd102('0x5f'));}}})[_0xd102('0x60')](function(_0x404815){logger[_0xd102('0x5e')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0xd102('0x6a')](_0x404815,{'showHidden':!![],'depth':null}));});};exports[_0xd102('0x6b')]=function(_0x5d1b4e,_0x2378e5,_0x10220e,_0x2a704d,_0x528d63,_0x343e2c){var _0x290d9,_0x633fbe;_0x343e2c['remoteUri']=intUtil[_0xd102('0x4c')](_0x343e2c[_0xd102('0xf')]);_0x343e2c['serverUrl']=intUtil[_0xd102('0x4c')](_0x343e2c[_0xd102('0x4b')]);if(_0x528d63&&_0x528d63['monitor_format']){logger[_0xd102('0xc')]('['+_0x2378e5['lastevent'][_0xd102('0x6c')]()+']',_0xd102('0x4f'));_0x2378e5[_0xd102('0x50')]=util['format'](_0xd102('0x51'),_0x343e2c[_0xd102('0x4b')],_0x2378e5['uniqueid'],md5(_0x2378e5['uniqueid']));}else{_0x2378e5[_0xd102('0x50')]='';}headers[_0xd102('0x53')]=getAuth(_0x343e2c);return getUser(_0x343e2c)[_0xd102('0x17')](function(_0x4da47a){_0x290d9=_0x4da47a;logger[_0xd102('0xc')](_0xd102('0x6d'),_0x290d9['id']);return getEndUser(_0x343e2c,_0x2378e5['calleridname'],_0x2378e5[_0xd102('0x56')]);})['then'](function(_0x480962){_0x633fbe=_0x480962;logger[_0xd102('0xc')](_0xd102('0x65'),_0x633fbe['id']);return getTicket(_0x343e2c,_0x290d9,_0x633fbe,_0x10220e,_0x2378e5);})[_0xd102('0x17')](function(_0x12c3f0){if(_0x12c3f0){logger[_0xd102('0xc')](_0xd102('0x57'),_0x12c3f0['id']);}})[_0xd102('0x60')](function(_0x2d8ab9){logger[_0xd102('0x5e')]('['+_0x2378e5[_0xd102('0x6e')][_0xd102('0x6c')]()+']'+_0xd102('0x6f'),util[_0xd102('0x6a')](_0x2d8ab9,{'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 5548294..26694ee 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 _0x7b05=['moment','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','socket.io-emitter','debug','length','forEach','includes','picklist','type','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','add','catch','error','Search\x20user','format','Zoho-oauthtoken\x20','users','findIndex','email','info','Agent\x20found!','profile','Administrator','user','Using\x20the\x20admin\x20account!','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','stringify','data','enduserType','https://www.zohoapis.','startCase','moduleCreate','role','first_name','code','SUCCESS','details','Error:\x20','GET','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','lead','Leads','Creating\x20new\x20call...','Owner','administrator','Subject','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','utc','endtime','Call_Duration','diff','starttime','YYYY-MM-DDTHH:mm:ss','called','Call_Result','Called','complete','connect','rejected','Rejected','abandoned','timeout','Timeout','Call_Start_Time','outbound','Call_Type','Inbound','merge','/crm/v2/Calls','Call\x20created!','err','stack','log','queue','host','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','uniqueid','/downloads?type=uniqueid&token=','recordingURL','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','/api/voice/recordings/','destcalleridname','destcalleridnum','unmanaged','lastevent','toUpperCase','calleridnum','lodash','request-promise','md5','util'];(function(_0x15d73c,_0x266a4c){var _0x1ae61a=function(_0x53f2a9){while(--_0x53f2a9){_0x15d73c['push'](_0x15d73c['shift']());}};_0x1ae61a(++_0x266a4c);}(_0x7b05,0x91));var _0x57b0=function(_0x1030ce,_0xbe3f74){_0x1030ce=_0x1030ce-0x0;var _0x3367fd=_0x7b05[_0x1030ce];return _0x3367fd;};'use strict';var _=require(_0x57b0('0x0'));var rp=require(_0x57b0('0x1'));var md5=require(_0x57b0('0x2'));var util=require(_0x57b0('0x3'));var intUtil=require('./util');var moment=require(_0x57b0('0x4'));var Redis=require('ioredis');var BPromise=require(_0x57b0('0x5'));var config=require(_0x57b0('0x6'));var logger=require(_0x57b0('0x7'))(_0x57b0('0x8'));config[_0x57b0('0x9')]=_['defaults'](config[_0x57b0('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x57b0('0xa'))(new Redis(config[_0x57b0('0x9')]));function emit(_0x4c970f,_0x59e88a,_0x59969a){io['to'](_0x4c970f)['emit'](_0x59e88a,_0x59969a);}function request(_0x13988a){logger[_0x57b0('0xb')]('[HTTP]',JSON['stringify'](_0x13988a));return rp(_0x13988a);}function getCustomFields(_0x55b609,_0x2843dc){var _0x238f48={};if(_0x55b609[_0x57b0('0xc')]>0x0){_[_0x57b0('0xd')](_0x55b609,function(_0x23c081){if(_[_0x57b0('0xe')](['string',_0x57b0('0xf')],_0x23c081[_0x57b0('0x10')])&&_0x23c081[_0x57b0('0x11')]){_0x238f48[_0x23c081['idField']]=_0x23c081['content'][_0x57b0('0x12')]();}else if(_0x23c081[_0x57b0('0x10')]===_0x57b0('0x13')&&_0x23c081[_0x57b0('0x14')]&&_0x23c081['idField']&&_0x2843dc[_0x23c081[_0x57b0('0x14')]]){_0x238f48[_0x23c081['idField']]=_0x2843dc[_0x23c081[_0x57b0('0x14')]][_0x57b0('0x12')]();}else if(_0x23c081['type']===_0x57b0('0x15')&&_0x23c081[_0x57b0('0x16')]&&_0x23c081[_0x57b0('0x16')][_0x57b0('0x17')]&&_0x23c081[_0x57b0('0x11')]&&_0x2843dc[_0x23c081['Variable'][_0x57b0('0x17')]['toLowerCase']()]){_0x238f48[_0x23c081['idField']]=_0x2843dc[_0x23c081[_0x57b0('0x16')][_0x57b0('0x17')][_0x57b0('0x18')]()][_0x57b0('0x12')]();}});}return _0x238f48;}function getName(_0x2b9368){if(_0x2b9368[_0x57b0('0x19')]('\x20')>0x0){var _0x568276=_0x2b9368[_0x57b0('0x1a')](/ (.+)/);if(_0x568276[0x1]){return _0x568276;}}return[_0x2b9368,_0x2b9368];}var accountsTokens={};function getAccessToken(_0x1d81ff){return new Promise(function(_0x35a457,_0x4c7ea2){if(!_[_0x57b0('0x1b')](accountsTokens[_0x1d81ff['id']])&&!_[_0x57b0('0x1b')](accountsTokens[_0x1d81ff['id']][_0x57b0('0x1c')])){if(moment()[_0x57b0('0x1d')](accountsTokens[_0x1d81ff['id']][_0x57b0('0x1e')])){_0x35a457(accountsTokens[_0x1d81ff['id']][_0x57b0('0x1c')]);}}var _0x29cf6f;switch(_0x1d81ff[_0x57b0('0x1f')]){case'US':_0x29cf6f=_0x57b0('0x20');break;case'AU':_0x29cf6f='https://accounts.zoho.com.au';break;case'EU':_0x29cf6f='https://accounts.zoho.eu';break;case'IN':_0x29cf6f=_0x57b0('0x21');break;case'CN':_0x29cf6f='https://accounts.zoho.com.cn';break;default:_0x29cf6f=_0x57b0('0x22');break;}var _0x3ce739={'method':_0x57b0('0x23'),'uri':_0x29cf6f+_0x57b0('0x24'),'qs':{'refresh_token':_0x1d81ff[_0x57b0('0x25')],'client_id':_0x1d81ff[_0x57b0('0x26')],'client_secret':_0x1d81ff[_0x57b0('0x27')],'grant_type':_0x57b0('0x28')},'json':!![]};return rp(_0x3ce739)[_0x57b0('0x29')](function(_0x109678){accountsTokens[_0x1d81ff['id']]={'access_token':_0x109678[_0x57b0('0x1c')],'expires_in':moment()[_0x57b0('0x2a')](_0x109678[_0x57b0('0x1e')],'seconds')};_0x35a457(_0x109678[_0x57b0('0x1c')]);})[_0x57b0('0x2b')](function(_0xf8e773){logger[_0x57b0('0x2c')]('Failing\x20creating\x20the\x20access_token',_0xf8e773['stack']);_0x4c7ea2(_0xf8e773);});});}function getUser(_0x325e39,_0x3aaf57,_0x1ccf42,_0x5958a8){logger['info'](_0x57b0('0x2d'));return request({'method':'GET','uri':util[_0x57b0('0x2e')]('https://www.zohoapis.%s/crm/v2/users',_0x3aaf57),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0x57b0('0x2f')+_0x325e39},'json':!![]})[_0x57b0('0x29')](function(_0x5e2961){if(_0x5e2961[_0x57b0('0x30')]){var _0x32e03e=-0x1;if(_['isArrayLikeObject'](_0x5e2961[_0x57b0('0x30')])){if(!_[_0x57b0('0x1b')](_0x5958a8)){_0x32e03e=_[_0x57b0('0x31')](_0x5e2961['users'],function(_0x575a07){return _0x575a07[_0x57b0('0x32')]===_0x5958a8;});}if(_0x32e03e>=0x0){logger[_0x57b0('0x33')](_0x57b0('0x34'));}else{logger[_0x57b0('0x33')]('Using\x20the\x20admin\x20account!');_0x32e03e=_['findIndex'](_0x5e2961['users'],function(_0x5ac90e){return _0x5ac90e[_0x57b0('0x35')][_0x57b0('0x17')]===_0x57b0('0x36');});}return _0x5e2961[_0x57b0('0x30')][_0x32e03e];}else{if(_0x5e2961[_0x57b0('0x37')]['profile'][_0x57b0('0x17')]===_0x57b0('0x36')){logger[_0x57b0('0x33')](_0x57b0('0x38'));user=_0x5e2961['user'];return user;}else{logger[_0x57b0('0x2c')](_0x57b0('0x39'),JSON['stringify'](_0x5e2961));throw new Error(_0x57b0('0x3a')+JSON[_0x57b0('0x3b')](_0x5e2961));}}}else{logger['error']('The\x20failing\x20result\x20is',JSON[_0x57b0('0x3b')](_0x5e2961));throw new Error(_0x57b0('0x3a')+JSON[_0x57b0('0x3b')](_0x5e2961));}})[_0x57b0('0x2b')](function(_0x2052e8){console[_0x57b0('0x2c')](_0x2052e8);});}function getZohoUser(_0x30c9b7,_0x451a88){return new BPromise(function(_0x3e90f5,_0x33f0b2){request(_0x30c9b7)[_0x57b0('0x29')](function(_0xb12b18){var _0x560ba1=null;if(_0xb12b18){_0x560ba1=_0xb12b18[_0x57b0('0x3c')][0x0];_0x560ba1[_0x57b0('0x3d')]=_0x451a88;}_0x3e90f5(_0x560ba1);})[_0x57b0('0x2b')](function(_0x558fb8){_0x33f0b2(_0x558fb8);});});}function createEndUser(_0x4c0874,_0x48bf5c,_0x14ce66,_0x2204c8,_0xc3b922,_0x197ccf){var _0x14ce66=getName(_0x14ce66);return request({'method':_0x57b0('0x23'),'uri':_0x57b0('0x3e')+_0x48bf5c+'/crm/v2/'+_[_0x57b0('0x3f')](_0x197ccf[_0x57b0('0x40')])+'s','body':{'data':[{'Last_Name':_0x14ce66[0x1],'First_Name':_0x14ce66[0x0],'Phone':_0x2204c8,'Owner':{'name':!_[_0x57b0('0x1b')](_0xc3b922[_0x57b0('0x41')][_0x57b0('0x17')])?_0xc3b922['role'][_0x57b0('0x17')]:!_[_0x57b0('0x1b')](_0xc3b922[_0x57b0('0x42')])?_0xc3b922[_0x57b0('0x42')]+'\x20'+_0xc3b922['last_name']:_0xc3b922['last_name'],'id':_0xc3b922['id']}}]},'headers':{'Authorization':_0x57b0('0x2f')+_0x4c0874},'json':!![]})[_0x57b0('0x29')](function(_0x49c98f){if(_0x49c98f&&_0x49c98f[_0x57b0('0x3c')][0x0][_0x57b0('0x43')]===_0x57b0('0x44')){var _0x546d5d=_0x49c98f['data'][0x0][_0x57b0('0x45')];_0x546d5d[_0x57b0('0x3d')]=_[_0x57b0('0x3f')](_0x197ccf[_0x57b0('0x40')])+'s';return _0x546d5d;}logger[_0x57b0('0x2c')]('The\x20failing\x20result\x20is',JSON[_0x57b0('0x3b')](data));throw new Error(_0x57b0('0x46')+JSON[_0x57b0('0x3b')](data));})[_0x57b0('0x2b')](function(_0x15377c){console['log']('CREATE\x20ERROR',_0x15377c);});}function getEndUser(_0x4a0600,_0x5042ad,_0x8a162d,_0xce6002,_0xb79dce,_0x2af039,_0x190297){var _0x3bef86={'method':_0x57b0('0x47'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x4a0600},'json':!![]};switch(_0x190297[_0x57b0('0x48')]){case _0x57b0('0x49'):_0x3bef86[_0x57b0('0x4a')]=_0x57b0('0x3e')+_0x5042ad+_0x57b0('0x4b')+_0xb79dce+'))';return getZohoUser(_0x3bef86,_0x57b0('0x4c'))[_0x57b0('0x29')](function(_0x48eb9f){if(_0x48eb9f)return _0x48eb9f;_0x3bef86[_0x57b0('0x4a')]='https://www.zohoapis.'+_0x5042ad+_0x57b0('0x4d')+_0xb79dce+'))';return getZohoUser(_0x3bef86,'Leads')[_0x57b0('0x29')](function(_0x5cae47){if(_0x5cae47)return _0x5cae47;if(_0x190297[_0x57b0('0x40')]!=_0x57b0('0x4e')){return createEndUser(_0x4a0600,_0x5042ad,_0xce6002,_0xb79dce,_0x2af039,_0x190297);}else{return{};}});});break;case'contact':_0x3bef86[_0x57b0('0x4a')]=_0x57b0('0x3e')+_0x5042ad+_0x57b0('0x4b')+_0xb79dce+'))';return getZohoUser(_0x3bef86,'Contacts')[_0x57b0('0x29')](function(_0xb8f21){if(_0xb8f21)return _0xb8f21;if(_0x190297['moduleCreate']!=_0x57b0('0x4e')){return createEndUser(_0x4a0600,_0x5042ad,_0xce6002,_0xb79dce,_0x2af039,_0x190297);}else{return{};}});break;case _0x57b0('0x4f'):_0x3bef86['uri']=_0x57b0('0x3e')+_0x5042ad+_0x57b0('0x4d')+_0xb79dce+'))';return getZohoUser(_0x3bef86,_0x57b0('0x50'))[_0x57b0('0x29')](function(_0x1a3003){if(_0x1a3003)return _0x1a3003;if(_0x190297['moduleCreate']!='nothing'){return createEndUser(_0x4a0600,_0x5042ad,_0xce6002,_0xb79dce,_0x2af039,_0x190297);}else{return{};}});break;}}function getCall(_0x3696b5,_0x1e0702,_0x22f0ae,_0x4b4b2a,_0x391e73,_0x1688d4,_0x243f3c,_0x44a7d2){logger[_0x57b0('0x33')](_0x57b0('0x51'));var _0x1fd9e1={};_0x1fd9e1[_0x57b0('0x52')]={'name':!_[_0x57b0('0x1b')](_0x4b4b2a[_0x57b0('0x41')][_0x57b0('0x17')])&&!_[_0x57b0('0x1b')](_0x4b4b2a[_0x57b0('0x35')][_0x57b0('0x17')])&&_0x4b4b2a[_0x57b0('0x35')][_0x57b0('0x17')]===_0x57b0('0x53')?_0x4b4b2a[_0x57b0('0x41')]['name']:!_[_0x57b0('0x1b')](_0x4b4b2a[_0x57b0('0x42')])?_0x4b4b2a[_0x57b0('0x42')]+'\x20'+_0x4b4b2a['last_name']:_0x4b4b2a['last_name'],'id':_0x4b4b2a['id']};_0x1fd9e1[_0x57b0('0x54')]=intUtil['getString'](_0x1688d4['Subjects'],_0x243f3c,'\x20');_0x1fd9e1[_0x57b0('0x55')]=intUtil['getString'](_0x1688d4[_0x57b0('0x56')],_0x243f3c,'\x0a');if(_0x391e73['enduserType']===_0x57b0('0x4c')){_0x1fd9e1[_0x57b0('0x57')]={'name':!_['isNil'](_0x391e73['Full_Name'])?_0x391e73[_0x57b0('0x58')]:!_[_0x57b0('0x1b')](_0x391e73['First_Name'])?_0x391e73[_0x57b0('0x59')]+'\x20'+_0x391e73[_0x57b0('0x5a')]:_0x391e73[_0x57b0('0x5a')],'id':_0x391e73['id']};}if(_0x391e73[_0x57b0('0x3d')]==='Leads'){_0x1fd9e1[_0x57b0('0x5b')]={'name':!_[_0x57b0('0x1b')](_0x391e73['Full_Name'])?_0x391e73[_0x57b0('0x58')]:!_[_0x57b0('0x1b')](_0x391e73[_0x57b0('0x59')])?_0x391e73['First_Name']+'\x20'+_0x391e73[_0x57b0('0x5a')]:_0x391e73[_0x57b0('0x5a')],'id':_0x391e73['id']};_0x1fd9e1[_0x57b0('0x5c')]=_['startCase'](_0x391e73['enduserType']);}if(_0x243f3c[_0x57b0('0x5d')]){_0x1fd9e1['Call_Duration']=moment[_0x57b0('0x5e')](parseInt(_0x243f3c['talktime'])*0x3e8)[_0x57b0('0x2e')]('mm:ss');}else if(_0x243f3c['answertime']&&_0x243f3c[_0x57b0('0x5f')]){_0x1fd9e1[_0x57b0('0x60')]=moment['utc'](moment(_0x243f3c['endtime'],'YYYY-MM-DDTHH:mm:ss')[_0x57b0('0x61')](moment(_0x243f3c[_0x57b0('0x62')],_0x57b0('0x63'))))[_0x57b0('0x2e')]('mm:ss');}switch(_0x243f3c['lastevent']){case _0x57b0('0x64'):_0x1fd9e1[_0x57b0('0x65')]=_0x57b0('0x66');break;case _0x57b0('0x67'):case _0x57b0('0x68'):_0x1fd9e1[_0x57b0('0x65')]='Answered';break;case _0x57b0('0x69'):_0x1fd9e1[_0x57b0('0x65')]=_0x57b0('0x6a');break;case _0x57b0('0x6b'):_0x1fd9e1[_0x57b0('0x65')]='Abandoned';break;case _0x57b0('0x6c'):_0x1fd9e1[_0x57b0('0x65')]=_0x57b0('0x6d');default:}_0x1fd9e1[_0x57b0('0x6e')]=(_0x44a7d2===_0x57b0('0x6f')?moment(_0x243f3c[_0x57b0('0x62')])['format']('YYYY-MM-DDTHH:mm:ss'):moment(_0x243f3c['agentcalledAt'])[_0x57b0('0x2e')](_0x57b0('0x63')))||moment()['format'](_0x57b0('0x63'));_0x1fd9e1[_0x57b0('0x70')]=_0x44a7d2||_0x57b0('0x71');_0x1fd9e1=_[_0x57b0('0x72')](_0x1fd9e1,getCustomFields(_0x1688d4['Fields'],_0x243f3c));return request({'method':'POST','uri':'https://www.zohoapis.'+_0x1e0702+_0x57b0('0x73'),'headers':{'Authorization':_0x57b0('0x2f')+_0x3696b5},'body':{'data':[_0x1fd9e1]},'json':!![]})[_0x57b0('0x29')](function(_0x49e65c){if(_0x49e65c&&_0x49e65c[_0x57b0('0x3c')][0x0]['code']==='SUCCESS'){logger['info'](_0x57b0('0x74'));return{'id':_0x49e65c['data'][0x0][_0x57b0('0x45')]['id']};}})[_0x57b0('0x2b')](function(_0xef1a9f){logger[_0x57b0('0x33')](_0x57b0('0x75'),_0xef1a9f[_0x57b0('0x76')]);console[_0x57b0('0x77')](_0x57b0('0x75'),_0xef1a9f);});}exports[_0x57b0('0x78')]=function(_0x4e843b,_0x8a2d93,_0x1f14b7,_0x2a81b2,_0x4849fc,_0x27c8ba){var _0x285d29,_0x2081d9,_0xd2c9a7;_0x27c8ba[_0x57b0('0x79')]=intUtil['stripTrailingSlash'](_0x27c8ba['host']);_0x27c8ba[_0x57b0('0x7a')]=intUtil[_0x57b0('0x7b')](_0x27c8ba['serverUrl']);if(_0x4849fc&&_0x4849fc[_0x57b0('0x7c')]){logger[_0x57b0('0x33')](_0x57b0('0x7d'),'Recording\x20is\x20enabled!');_0x8a2d93['recordingURL']=_0x27c8ba[_0x57b0('0x7a')]+'/api/voice/recordings/'+_0x8a2d93[_0x57b0('0x7e')]+_0x57b0('0x7f')+md5(_0x8a2d93[_0x57b0('0x7e')]);}else{_0x8a2d93[_0x57b0('0x80')]='';}var _0x32f519=_0x27c8ba[_0x57b0('0x79')]===_0x57b0('0x81')?'eu':_0x57b0('0x82');return getAccessToken(_0x27c8ba)['then'](function(_0x30badf){_0xd2c9a7=_0x30badf;return getUser(_0xd2c9a7,_0x32f519,_0x27c8ba,_0x2a81b2[_0x57b0('0x32')]);})[_0x57b0('0x29')](function(_0x34a26d){_0x285d29=_0x34a26d;logger['info'](_0x57b0('0x83'),_0x285d29['id']);return getEndUser(_0xd2c9a7,_0x32f519,_0x27c8ba,_0x8a2d93[_0x57b0('0x84')],_0x8a2d93['calleridnum'],_0x285d29,_0x1f14b7);})[_0x57b0('0x29')](function(_0x272540){_0x2081d9=_0x272540;return getCall(_0xd2c9a7,_0x32f519,_0x27c8ba,_0x285d29,_0x2081d9,_0x1f14b7,_0x8a2d93,_0x57b0('0x71'));})[_0x57b0('0x29')](function(_0x55c976){if(_0x55c976){logger['info'](_0x57b0('0x85'),_0x55c976['id']);logger[_0x57b0('0x33')](_0x57b0('0x7d'),_0x57b0('0x86'));emit(util[_0x57b0('0x2e')](_0x57b0('0x87'),_0x2a81b2[_0x57b0('0x17')]),_0x57b0('0x88'),{'uri':_0x57b0('0x89')+_0x27c8ba[_0x57b0('0x79')]+_0x57b0('0x8a')+_0x55c976['id']});}})[_0x57b0('0x2b')](function(_0x48b9ff){logger[_0x57b0('0x2c')]('[QUEUE]',JSON[_0x57b0('0x3b')](_0x48b9ff));});};exports[_0x57b0('0x6f')]=function(_0x38a8c6,_0x34bcfd,_0x44a23c,_0x171f76,_0x3901f4,_0x320a81,_0x4d7b4e){var _0x3fb11f,_0x2d6808,_0xbcbc00;_0x320a81[_0x57b0('0x79')]=intUtil['stripTrailingSlash'](_0x320a81[_0x57b0('0x79')]);_0x320a81['serverUrl']=intUtil[_0x57b0('0x7b')](_0x320a81[_0x57b0('0x7a')]);if(_0x4d7b4e&&_0x4d7b4e['recordingFormat']&&_0x4d7b4e[_0x57b0('0x8b')]!=='none'){logger['info'](_0x57b0('0x8c'),_0x57b0('0x8d'));_0x34bcfd['recordingURL']=_0x320a81[_0x57b0('0x7a')]+_0x57b0('0x8e')+_0x34bcfd[_0x57b0('0x7e')]+'/downloads?type=uniqueid&token='+md5(_0x34bcfd['uniqueid']);}var _0x369eba=_0x320a81[_0x57b0('0x79')]===_0x57b0('0x81')?'eu':_0x57b0('0x82');return getAccessToken(_0x320a81)[_0x57b0('0x29')](function(_0x3f14f1){_0xbcbc00=_0x3f14f1;return getUser(_0xbcbc00,_0x369eba,_0x320a81,_0x171f76[_0x57b0('0x32')]);})['then'](function(_0x59bd57){_0x3fb11f=_0x59bd57;logger['info']('The\x20User\x20ID\x20is:',_0x3fb11f['id']);return getEndUser(_0xbcbc00,_0x369eba,_0x320a81,_0x34bcfd[_0x57b0('0x8f')],_0x34bcfd[_0x57b0('0x90')],_0x3fb11f,_0x44a23c);})[_0x57b0('0x29')](function(_0x20cf7f){_0x2d6808=_0x20cf7f;return getCall(_0xbcbc00,_0x369eba,_0x320a81,_0x3fb11f,_0x2d6808,_0x44a23c,_0x34bcfd,'Outbound');})[_0x57b0('0x29')](function(_0x40b843){if(_0x40b843){logger[_0x57b0('0x33')]('The\x20Call\x20ID\x20is:',_0x40b843['id']);logger['info'](_0x57b0('0x8c'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x57b0('0x87'),_0x171f76[_0x57b0('0x17')]),_0x57b0('0x88'),{'uri':_0x57b0('0x89')+_0x320a81[_0x57b0('0x79')]+_0x57b0('0x8a')+_0x40b843['id']});}})['catch'](function(_0x327164){logger[_0x57b0('0x2c')]('[OUTBOUND]',JSON['stringify'](_0x327164));});};exports[_0x57b0('0x91')]=function(_0x235187,_0x1eaeee,_0x813b4c,_0x2d7114,_0x139e2e,_0x13e054){var _0x3cc9ec,_0x24afde,_0xb3bd3;_0x13e054[_0x57b0('0x79')]=intUtil[_0x57b0('0x7b')](_0x13e054[_0x57b0('0x79')]);_0x13e054['serverUrl']=intUtil[_0x57b0('0x7b')](_0x13e054[_0x57b0('0x7a')]);if(_0x139e2e&&_0x139e2e['monitor_format']){logger['info']('['+_0x1eaeee[_0x57b0('0x92')][_0x57b0('0x93')]()+']',_0x57b0('0x8d'));_0x1eaeee[_0x57b0('0x80')]=_0x13e054[_0x57b0('0x7a')]+'/api/voice/recordings/'+_0x1eaeee['uniqueid']+_0x57b0('0x7f')+md5(_0x1eaeee[_0x57b0('0x7e')]);}else{_0x1eaeee[_0x57b0('0x80')]='';}var _0x28a267=_0x13e054[_0x57b0('0x79')]==='zoho.eu'?'eu':_0x57b0('0x82');return getAccessToken(_0x13e054)[_0x57b0('0x29')](function(_0x8ef4d6){_0xb3bd3=_0x8ef4d6;return getUser(_0xb3bd3,_0x28a267,_0x13e054);})[_0x57b0('0x29')](function(_0x5ea658){_0x3cc9ec=_0x5ea658;logger['info']('The\x20User\x20ID\x20is:',_0x3cc9ec['id']);return getEndUser(_0xb3bd3,_0x28a267,_0x13e054,_0x1eaeee['calleridname'],_0x1eaeee[_0x57b0('0x94')],_0x3cc9ec,_0x813b4c);})[_0x57b0('0x29')](function(_0x5dadd6){_0x24afde=_0x5dadd6;return getCall(_0xb3bd3,_0x28a267,_0x13e054,_0x3cc9ec,_0x24afde,_0x813b4c,_0x1eaeee,_0x57b0('0x71'));})[_0x57b0('0x29')](function(_0x255813){if(_0x255813){logger[_0x57b0('0x33')](_0x57b0('0x85'),_0x255813['id']);}})['catch'](function(_0x214e65){logger[_0x57b0('0x2c')]('['+_0x1eaeee[_0x57b0('0x92')][_0x57b0('0x93')]()+']',JSON[_0x57b0('0x3b')](_0x214e65));});}; \ No newline at end of file +var _0xf91d=['Call_Type','Fields','/crm/v2/Calls','SUCCESS','err','log','host','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','trigger:browser:url','/api/voice/recordings/','lodash','request-promise','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','zoho','redis','defaults','localhost','emit','debug','[HTTP]','stringify','length','forEach','picklist','idField','content','toString','type','variable','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','isBefore','expires_in','access_token','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','add','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','then','users','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator','profile','The\x20failing\x20result\x20is','catch','enduserType','https://www.zohoapis.','/crm/v2/','startCase','role','first_name','last_name','Zoho-oauthtoken\x20','data','code','details','Error:\x20','CREATE\x20ERROR','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','Leads','nothing','contact','moduleCreate','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Creating\x20new\x20call...','Owner','Subject','getString','Subjects','Description','Who_Id','Last_Name','Full_Name','First_Name','$se_module','talktime','Call_Duration','utc','mm:ss','endtime','YYYY-MM-DDTHH:mm:ss','starttime','format','lastevent','called','Call_Result','Called','complete','Answered','rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt'];(function(_0x4b73a2,_0x40b5fe){var _0x383c66=function(_0x3917ae){while(--_0x3917ae){_0x4b73a2['push'](_0x4b73a2['shift']());}};_0x383c66(++_0x40b5fe);}(_0xf91d,0x155));var _0xdf91=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xf91d[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xdf91('0x0'));var rp=require(_0xdf91('0x1'));var md5=require(_0xdf91('0x2'));var util=require(_0xdf91('0x3'));var intUtil=require(_0xdf91('0x4'));var moment=require(_0xdf91('0x5'));var Redis=require(_0xdf91('0x6'));var BPromise=require(_0xdf91('0x7'));var config=require(_0xdf91('0x8'));var logger=require('../../../../config/logger')(_0xdf91('0x9'));config[_0xdf91('0xa')]=_[_0xdf91('0xb')](config['redis'],{'host':_0xdf91('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x460774,_0x40d9eb,_0x5d710a){io['to'](_0x460774)[_0xdf91('0xd')](_0x40d9eb,_0x5d710a);}function request(_0x5e2038){logger[_0xdf91('0xe')](_0xdf91('0xf'),JSON[_0xdf91('0x10')](_0x5e2038));return rp(_0x5e2038);}function getCustomFields(_0x528a7f,_0x15ff50){var _0x1473aa={};if(_0x528a7f[_0xdf91('0x11')]>0x0){_[_0xdf91('0x12')](_0x528a7f,function(_0x59868e){if(_['includes'](['string',_0xdf91('0x13')],_0x59868e['type'])&&_0x59868e[_0xdf91('0x14')]){_0x1473aa[_0x59868e[_0xdf91('0x14')]]=_0x59868e[_0xdf91('0x15')][_0xdf91('0x16')]();}else if(_0x59868e[_0xdf91('0x17')]===_0xdf91('0x18')&&_0x59868e['variableName']&&_0x59868e[_0xdf91('0x14')]&&_0x15ff50[_0x59868e['variableName']]){_0x1473aa[_0x59868e[_0xdf91('0x14')]]=_0x15ff50[_0x59868e['variableName']]['toString']();}else if(_0x59868e[_0xdf91('0x17')]===_0xdf91('0x19')&&_0x59868e['Variable']&&_0x59868e[_0xdf91('0x1a')][_0xdf91('0x1b')]&&_0x59868e[_0xdf91('0x14')]&&_0x15ff50[_0x59868e[_0xdf91('0x1a')][_0xdf91('0x1b')][_0xdf91('0x1c')]()]){_0x1473aa[_0x59868e['idField']]=_0x15ff50[_0x59868e[_0xdf91('0x1a')][_0xdf91('0x1b')][_0xdf91('0x1c')]()]['toString']();}});}return _0x1473aa;}function getName(_0x294823){if(_0x294823[_0xdf91('0x1d')]('\x20')>0x0){var _0x427af8=_0x294823[_0xdf91('0x1e')](/ (.+)/);if(_0x427af8[0x1]){return _0x427af8;}}return[_0x294823,_0x294823];}var accountsTokens={};function getAccessToken(_0x2704fa){return new Promise(function(_0x15e91f,_0x2d83b6){if(!_['isNil'](accountsTokens[_0x2704fa['id']])&&!_[_0xdf91('0x1f')](accountsTokens[_0x2704fa['id']]['access_token'])){if(moment()[_0xdf91('0x20')](accountsTokens[_0x2704fa['id']][_0xdf91('0x21')])){_0x15e91f(accountsTokens[_0x2704fa['id']][_0xdf91('0x22')]);}}var _0x52cdc6;switch(_0x2704fa[_0xdf91('0x23')]){case'US':_0x52cdc6=_0xdf91('0x24');break;case'AU':_0x52cdc6='https://accounts.zoho.com.au';break;case'EU':_0x52cdc6=_0xdf91('0x25');break;case'IN':_0x52cdc6=_0xdf91('0x26');break;case'CN':_0x52cdc6=_0xdf91('0x27');break;default:_0x52cdc6=_0xdf91('0x25');break;}var _0x2b4bb8={'method':_0xdf91('0x28'),'uri':_0x52cdc6+_0xdf91('0x29'),'qs':{'refresh_token':_0x2704fa[_0xdf91('0x2a')],'client_id':_0x2704fa[_0xdf91('0x2b')],'client_secret':_0x2704fa[_0xdf91('0x2c')],'grant_type':_0xdf91('0x2d')},'json':!![]};return rp(_0x2b4bb8)['then'](function(_0x3922fe){accountsTokens[_0x2704fa['id']]={'access_token':_0x3922fe[_0xdf91('0x22')],'expires_in':moment()[_0xdf91('0x2e')](_0x3922fe['expires_in'],'seconds')};_0x15e91f(_0x3922fe[_0xdf91('0x22')]);})['catch'](function(_0x9aba18){logger[_0xdf91('0x2f')](_0xdf91('0x30'),_0x9aba18[_0xdf91('0x31')]);_0x2d83b6(_0x9aba18);});});}function getUser(_0x41d8f7,_0x3fd07d,_0xf75af6,_0xe097cc){logger[_0xdf91('0x32')](_0xdf91('0x33'));return request({'method':_0xdf91('0x34'),'uri':util['format'](_0xdf91('0x35'),_0x3fd07d),'qs':{'type':_0xdf91('0x36')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x41d8f7},'json':!![]})[_0xdf91('0x37')](function(_0x2552cb){if(_0x2552cb[_0xdf91('0x38')]){var _0x51a9f6=-0x1;if(_['isArrayLikeObject'](_0x2552cb[_0xdf91('0x38')])){if(!_[_0xdf91('0x1f')](_0xe097cc)){_0x51a9f6=_[_0xdf91('0x39')](_0x2552cb[_0xdf91('0x38')],function(_0x1337e3){return _0x1337e3[_0xdf91('0x3a')]===_0xe097cc;});}if(_0x51a9f6>=0x0){logger[_0xdf91('0x32')](_0xdf91('0x3b'));}else{logger[_0xdf91('0x32')](_0xdf91('0x3c'));_0x51a9f6=_['findIndex'](_0x2552cb[_0xdf91('0x38')],function(_0x44bb1f){return _0x44bb1f['profile'][_0xdf91('0x1b')]===_0xdf91('0x3d');});}return _0x2552cb['users'][_0x51a9f6];}else{if(_0x2552cb['user'][_0xdf91('0x3e')][_0xdf91('0x1b')]===_0xdf91('0x3d')){logger[_0xdf91('0x32')]('Using\x20the\x20admin\x20account!');user=_0x2552cb['user'];return user;}else{logger[_0xdf91('0x2f')]('The\x20failing\x20result\x20is',JSON[_0xdf91('0x10')](_0x2552cb));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON['stringify'](_0x2552cb));}}}else{logger[_0xdf91('0x2f')](_0xdf91('0x3f'),JSON[_0xdf91('0x10')](_0x2552cb));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON['stringify'](_0x2552cb));}})[_0xdf91('0x40')](function(_0x2526bb){console[_0xdf91('0x2f')](_0x2526bb);});}function getZohoUser(_0x950043,_0x5d787b){return new BPromise(function(_0xfeb796,_0x52aca0){request(_0x950043)[_0xdf91('0x37')](function(_0x23ea64){var _0x5643c1=null;if(_0x23ea64){_0x5643c1=_0x23ea64['data'][0x0];_0x5643c1[_0xdf91('0x41')]=_0x5d787b;}_0xfeb796(_0x5643c1);})[_0xdf91('0x40')](function(_0xccc709){_0x52aca0(_0xccc709);});});}function createEndUser(_0x9aacbf,_0x30d16f,_0x1deaf7,_0x123a06,_0x25a7eb,_0x49856f){var _0x1deaf7=getName(_0x1deaf7);return request({'method':_0xdf91('0x28'),'uri':_0xdf91('0x42')+_0x30d16f+_0xdf91('0x43')+_[_0xdf91('0x44')](_0x49856f['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x1deaf7[0x1],'First_Name':_0x1deaf7[0x0],'Phone':_0x123a06,'Owner':{'name':!_['isNil'](_0x25a7eb[_0xdf91('0x45')][_0xdf91('0x1b')])?_0x25a7eb[_0xdf91('0x45')][_0xdf91('0x1b')]:!_[_0xdf91('0x1f')](_0x25a7eb[_0xdf91('0x46')])?_0x25a7eb[_0xdf91('0x46')]+'\x20'+_0x25a7eb[_0xdf91('0x47')]:_0x25a7eb[_0xdf91('0x47')],'id':_0x25a7eb['id']}}]},'headers':{'Authorization':_0xdf91('0x48')+_0x9aacbf},'json':!![]})['then'](function(_0x2ca195){if(_0x2ca195&&_0x2ca195[_0xdf91('0x49')][0x0][_0xdf91('0x4a')]==='SUCCESS'){var _0x14c8f1=_0x2ca195[_0xdf91('0x49')][0x0][_0xdf91('0x4b')];_0x14c8f1[_0xdf91('0x41')]=_[_0xdf91('0x44')](_0x49856f['moduleCreate'])+'s';return _0x14c8f1;}logger[_0xdf91('0x2f')](_0xdf91('0x3f'),JSON[_0xdf91('0x10')](data));throw new Error(_0xdf91('0x4c')+JSON[_0xdf91('0x10')](data));})['catch'](function(_0x524b28){console['log'](_0xdf91('0x4d'),_0x524b28);});}function getEndUser(_0xd7b886,_0x41233e,_0x18772d,_0x328d95,_0x5b1009,_0x3a5b69,_0x4315d8){var _0x22d00b={'method':_0xdf91('0x34'),'uri':'','headers':{'Authorization':_0xdf91('0x48')+_0xd7b886},'json':!![]};switch(_0x4315d8['moduleSearch']){case _0xdf91('0x4e'):_0x22d00b[_0xdf91('0x4f')]=_0xdf91('0x42')+_0x41233e+_0xdf91('0x50')+_0x5b1009+'))';return getZohoUser(_0x22d00b,_0xdf91('0x51'))[_0xdf91('0x37')](function(_0x31a221){if(_0x31a221)return _0x31a221;_0x22d00b[_0xdf91('0x4f')]=_0xdf91('0x42')+_0x41233e+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x5b1009+'))';return getZohoUser(_0x22d00b,_0xdf91('0x52'))[_0xdf91('0x37')](function(_0x4eafde){if(_0x4eafde)return _0x4eafde;if(_0x4315d8['moduleCreate']!=_0xdf91('0x53')){return createEndUser(_0xd7b886,_0x41233e,_0x328d95,_0x5b1009,_0x3a5b69,_0x4315d8);}else{return{};}});});break;case _0xdf91('0x54'):_0x22d00b[_0xdf91('0x4f')]=_0xdf91('0x42')+_0x41233e+_0xdf91('0x50')+_0x5b1009+'))';return getZohoUser(_0x22d00b,_0xdf91('0x51'))[_0xdf91('0x37')](function(_0x1a177b){if(_0x1a177b)return _0x1a177b;if(_0x4315d8[_0xdf91('0x55')]!='nothing'){return createEndUser(_0xd7b886,_0x41233e,_0x328d95,_0x5b1009,_0x3a5b69,_0x4315d8);}else{return{};}});break;case _0xdf91('0x56'):_0x22d00b[_0xdf91('0x4f')]='https://www.zohoapis.'+_0x41233e+_0xdf91('0x57')+_0x5b1009+'))';return getZohoUser(_0x22d00b,'Leads')[_0xdf91('0x37')](function(_0x4969a8){if(_0x4969a8)return _0x4969a8;if(_0x4315d8[_0xdf91('0x55')]!='nothing'){return createEndUser(_0xd7b886,_0x41233e,_0x328d95,_0x5b1009,_0x3a5b69,_0x4315d8);}else{return{};}});break;}}function getCall(_0x4d9aac,_0x3287bd,_0x5817c9,_0xece38f,_0x476b0b,_0x36c8f5,_0x746c8f,_0xc6fc5e){logger[_0xdf91('0x32')](_0xdf91('0x58'));var _0x53f50e={};_0x53f50e[_0xdf91('0x59')]={'name':!_[_0xdf91('0x1f')](_0xece38f['role'][_0xdf91('0x1b')])&&!_[_0xdf91('0x1f')](_0xece38f['profile'][_0xdf91('0x1b')])&&_0xece38f[_0xdf91('0x3e')][_0xdf91('0x1b')]==='administrator'?_0xece38f[_0xdf91('0x45')]['name']:!_[_0xdf91('0x1f')](_0xece38f[_0xdf91('0x46')])?_0xece38f[_0xdf91('0x46')]+'\x20'+_0xece38f[_0xdf91('0x47')]:_0xece38f[_0xdf91('0x47')],'id':_0xece38f['id']};_0x53f50e[_0xdf91('0x5a')]=intUtil[_0xdf91('0x5b')](_0x36c8f5[_0xdf91('0x5c')],_0x746c8f,'\x20');_0x53f50e[_0xdf91('0x5d')]=intUtil[_0xdf91('0x5b')](_0x36c8f5['Descriptions'],_0x746c8f,'\x0a');if(_0x476b0b[_0xdf91('0x41')]==='Contacts'){_0x53f50e[_0xdf91('0x5e')]={'name':!_[_0xdf91('0x1f')](_0x476b0b['Full_Name'])?_0x476b0b['Full_Name']:!_[_0xdf91('0x1f')](_0x476b0b['First_Name'])?_0x476b0b['First_Name']+'\x20'+_0x476b0b[_0xdf91('0x5f')]:_0x476b0b[_0xdf91('0x5f')],'id':_0x476b0b['id']};}if(_0x476b0b[_0xdf91('0x41')]===_0xdf91('0x52')){_0x53f50e['What_Id']={'name':!_[_0xdf91('0x1f')](_0x476b0b[_0xdf91('0x60')])?_0x476b0b[_0xdf91('0x60')]:!_[_0xdf91('0x1f')](_0x476b0b['First_Name'])?_0x476b0b[_0xdf91('0x61')]+'\x20'+_0x476b0b['Last_Name']:_0x476b0b['Last_Name'],'id':_0x476b0b['id']};_0x53f50e[_0xdf91('0x62')]=_[_0xdf91('0x44')](_0x476b0b[_0xdf91('0x41')]);}if(_0x746c8f[_0xdf91('0x63')]){_0x53f50e[_0xdf91('0x64')]=moment[_0xdf91('0x65')](parseInt(_0x746c8f[_0xdf91('0x63')])*0x3e8)['format'](_0xdf91('0x66'));}else if(_0x746c8f['answertime']&&_0x746c8f[_0xdf91('0x67')]){_0x53f50e[_0xdf91('0x64')]=moment['utc'](moment(_0x746c8f[_0xdf91('0x67')],_0xdf91('0x68'))['diff'](moment(_0x746c8f[_0xdf91('0x69')],_0xdf91('0x68'))))[_0xdf91('0x6a')](_0xdf91('0x66'));}switch(_0x746c8f[_0xdf91('0x6b')]){case _0xdf91('0x6c'):_0x53f50e[_0xdf91('0x6d')]=_0xdf91('0x6e');break;case _0xdf91('0x6f'):case'connect':_0x53f50e[_0xdf91('0x6d')]=_0xdf91('0x70');break;case _0xdf91('0x71'):_0x53f50e[_0xdf91('0x6d')]='Rejected';break;case _0xdf91('0x72'):_0x53f50e[_0xdf91('0x6d')]=_0xdf91('0x73');break;case _0xdf91('0x74'):_0x53f50e[_0xdf91('0x6d')]=_0xdf91('0x75');default:}_0x53f50e[_0xdf91('0x76')]=(_0xc6fc5e===_0xdf91('0x77')?moment(_0x746c8f[_0xdf91('0x69')])[_0xdf91('0x6a')](_0xdf91('0x68')):moment(_0x746c8f[_0xdf91('0x78')])['format'](_0xdf91('0x68')))||moment()[_0xdf91('0x6a')](_0xdf91('0x68'));_0x53f50e[_0xdf91('0x79')]=_0xc6fc5e||'Inbound';_0x53f50e=_['merge'](_0x53f50e,getCustomFields(_0x36c8f5[_0xdf91('0x7a')],_0x746c8f));return request({'method':_0xdf91('0x28'),'uri':_0xdf91('0x42')+_0x3287bd+_0xdf91('0x7b'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x4d9aac},'body':{'data':[_0x53f50e]},'json':!![]})[_0xdf91('0x37')](function(_0x4daf9b){if(_0x4daf9b&&_0x4daf9b[_0xdf91('0x49')][0x0][_0xdf91('0x4a')]===_0xdf91('0x7c')){logger[_0xdf91('0x32')]('Call\x20created!');return{'id':_0x4daf9b[_0xdf91('0x49')][0x0]['details']['id']};}})[_0xdf91('0x40')](function(_0x2ccfed){logger[_0xdf91('0x32')](_0xdf91('0x7d'),_0x2ccfed[_0xdf91('0x31')]);console[_0xdf91('0x7e')]('err',_0x2ccfed);});}exports['queue']=function(_0x4ab906,_0x50990c,_0x585856,_0x2c79cd,_0x2d2ffa,_0x12b85b){var _0x482251,_0x4aa736,_0x24f7b3;_0x12b85b[_0xdf91('0x7f')]=intUtil[_0xdf91('0x80')](_0x12b85b[_0xdf91('0x7f')]);_0x12b85b[_0xdf91('0x81')]=intUtil['stripTrailingSlash'](_0x12b85b[_0xdf91('0x81')]);if(_0x2d2ffa&&_0x2d2ffa[_0xdf91('0x82')]){logger[_0xdf91('0x32')]('[QUEUE]',_0xdf91('0x83'));_0x50990c[_0xdf91('0x84')]=_0x12b85b['serverUrl']+'/api/voice/recordings/'+_0x50990c[_0xdf91('0x85')]+_0xdf91('0x86')+md5(_0x50990c[_0xdf91('0x85')]);}else{_0x50990c[_0xdf91('0x84')]='';}var _0x21013d=_0x12b85b['host']===_0xdf91('0x87')?'eu':_0xdf91('0x88');return getAccessToken(_0x12b85b)[_0xdf91('0x37')](function(_0x3bcd27){_0x24f7b3=_0x3bcd27;return getUser(_0x24f7b3,_0x21013d,_0x12b85b,_0x2c79cd[_0xdf91('0x3a')]);})[_0xdf91('0x37')](function(_0x4c48e0){_0x482251=_0x4c48e0;logger[_0xdf91('0x32')](_0xdf91('0x89'),_0x482251['id']);return getEndUser(_0x24f7b3,_0x21013d,_0x12b85b,_0x50990c[_0xdf91('0x8a')],_0x50990c[_0xdf91('0x8b')],_0x482251,_0x585856);})[_0xdf91('0x37')](function(_0x237105){_0x4aa736=_0x237105;return getCall(_0x24f7b3,_0x21013d,_0x12b85b,_0x482251,_0x4aa736,_0x585856,_0x50990c,'Inbound');})[_0xdf91('0x37')](function(_0x289d68){if(_0x289d68){logger[_0xdf91('0x32')](_0xdf91('0x8c'),_0x289d68['id']);logger['info'](_0xdf91('0x8d'),_0xdf91('0x8e'));emit(util[_0xdf91('0x6a')](_0xdf91('0x8f'),_0x2c79cd[_0xdf91('0x1b')]),'trigger:browser:url',{'uri':_0xdf91('0x90')+_0x12b85b[_0xdf91('0x7f')]+_0xdf91('0x91')+_0x289d68['id']});}})['catch'](function(_0xe04f38){logger[_0xdf91('0x2f')](_0xdf91('0x8d'),JSON['stringify'](_0xe04f38));});};exports[_0xdf91('0x77')]=function(_0x281579,_0x4342b4,_0x3deb2e,_0x33f910,_0x15e1ee,_0x535572,_0x58e2b1){var _0x35aefa,_0x58b645,_0x5b0cfc;_0x535572['host']=intUtil[_0xdf91('0x80')](_0x535572[_0xdf91('0x7f')]);_0x535572['serverUrl']=intUtil[_0xdf91('0x80')](_0x535572[_0xdf91('0x81')]);if(_0x58e2b1&&_0x58e2b1[_0xdf91('0x92')]&&_0x58e2b1[_0xdf91('0x92')]!==_0xdf91('0x93')){logger[_0xdf91('0x32')](_0xdf91('0x94'),_0xdf91('0x83'));_0x4342b4['recordingURL']=_0x535572[_0xdf91('0x81')]+'/api/voice/recordings/'+_0x4342b4[_0xdf91('0x85')]+_0xdf91('0x86')+md5(_0x4342b4[_0xdf91('0x85')]);}var _0x35359e=_0x535572[_0xdf91('0x7f')]===_0xdf91('0x87')?'eu':_0xdf91('0x88');return getAccessToken(_0x535572)['then'](function(_0x3ec626){_0x5b0cfc=_0x3ec626;return getUser(_0x5b0cfc,_0x35359e,_0x535572,_0x33f910[_0xdf91('0x3a')]);})['then'](function(_0x149986){_0x35aefa=_0x149986;logger['info'](_0xdf91('0x89'),_0x35aefa['id']);return getEndUser(_0x5b0cfc,_0x35359e,_0x535572,_0x4342b4[_0xdf91('0x95')],_0x4342b4[_0xdf91('0x96')],_0x35aefa,_0x3deb2e);})[_0xdf91('0x37')](function(_0x42fcce){_0x58b645=_0x42fcce;return getCall(_0x5b0cfc,_0x35359e,_0x535572,_0x35aefa,_0x58b645,_0x3deb2e,_0x4342b4,_0xdf91('0x97'));})[_0xdf91('0x37')](function(_0x103334){if(_0x103334){logger[_0xdf91('0x32')](_0xdf91('0x8c'),_0x103334['id']);logger[_0xdf91('0x32')](_0xdf91('0x94'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xdf91('0x6a')](_0xdf91('0x8f'),_0x33f910[_0xdf91('0x1b')]),_0xdf91('0x98'),{'uri':'https://crm.'+_0x535572[_0xdf91('0x7f')]+_0xdf91('0x91')+_0x103334['id']});}})[_0xdf91('0x40')](function(_0x5e7b2f){logger[_0xdf91('0x2f')]('[OUTBOUND]',JSON['stringify'](_0x5e7b2f));});};exports['unmanaged']=function(_0x3d1ff0,_0x4b01fb,_0x233b5c,_0x3e7b36,_0x4e14e8,_0x57c0c0){var _0x4d30f4,_0x51ee9a,_0x4b8d9a;_0x57c0c0[_0xdf91('0x7f')]=intUtil['stripTrailingSlash'](_0x57c0c0[_0xdf91('0x7f')]);_0x57c0c0[_0xdf91('0x81')]=intUtil[_0xdf91('0x80')](_0x57c0c0[_0xdf91('0x81')]);if(_0x4e14e8&&_0x4e14e8['monitor_format']){logger[_0xdf91('0x32')]('['+_0x4b01fb[_0xdf91('0x6b')]['toUpperCase']()+']',_0xdf91('0x83'));_0x4b01fb[_0xdf91('0x84')]=_0x57c0c0[_0xdf91('0x81')]+_0xdf91('0x99')+_0x4b01fb[_0xdf91('0x85')]+_0xdf91('0x86')+md5(_0x4b01fb[_0xdf91('0x85')]);}else{_0x4b01fb[_0xdf91('0x84')]='';}var _0x2ef7d2=_0x57c0c0['host']===_0xdf91('0x87')?'eu':_0xdf91('0x88');return getAccessToken(_0x57c0c0)['then'](function(_0x4c6980){_0x4b8d9a=_0x4c6980;return getUser(_0x4b8d9a,_0x2ef7d2,_0x57c0c0);})['then'](function(_0x470e40){_0x4d30f4=_0x470e40;logger[_0xdf91('0x32')](_0xdf91('0x89'),_0x4d30f4['id']);return getEndUser(_0x4b8d9a,_0x2ef7d2,_0x57c0c0,_0x4b01fb[_0xdf91('0x8a')],_0x4b01fb[_0xdf91('0x8b')],_0x4d30f4,_0x233b5c);})[_0xdf91('0x37')](function(_0x525bc7){_0x51ee9a=_0x525bc7;return getCall(_0x4b8d9a,_0x2ef7d2,_0x57c0c0,_0x4d30f4,_0x51ee9a,_0x233b5c,_0x4b01fb,'Inbound');})['then'](function(_0x508541){if(_0x508541){logger[_0xdf91('0x32')](_0xdf91('0x8c'),_0x508541['id']);}})[_0xdf91('0x40')](function(_0x51a55b){logger['error']('['+_0x4b01fb[_0xdf91('0x6b')]['toUpperCase']()+']',JSON[_0xdf91('0x10')](_0x51a55b));});}; \ 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 9076589..d726c5f 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 _0x4994=['trigger','exec','data2','Script','data3','render','error','info','util','shelljs','mustache','../../../../config/logger'];(function(_0xb3dbfa,_0x202282){var _0x38c66e=function(_0x356cfa){while(--_0x356cfa){_0xb3dbfa['push'](_0xb3dbfa['shift']());}};_0x38c66e(++_0x202282);}(_0x4994,0x74));var _0x4499=function(_0x1f7406,_0x9cae1b){_0x1f7406=_0x1f7406-0x0;var _0x2608be=_0x4994[_0x1f7406];return _0x2608be;};'use strict';var util=require(_0x4499('0x0'));var sh=require(_0x4499('0x1'));var Mustache=require(_0x4499('0x2'));var logger=require(_0x4499('0x3'))(_0x4499('0x4'));exports[_0x4499('0x5')]=function(_0xafe25a,_0x1b00ef){var _0xdba2fd=_0xafe25a['data2']?_0xafe25a[_0x4499('0x6')]:_0x4499('0x7');var _0x3c3891=_0xafe25a[_0x4499('0x8')]?Mustache[_0x4499('0x9')](_0xafe25a[_0x4499('0x8')],_0x1b00ef):_0x1b00ef;sh['exec'](_0x3c3891,function(_0x1b9b61,_0x2cbb2b,_0x52718e){if(_0x1b9b61!==0x0){logger[_0x4499('0xa')](util['format']('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0xdba2fd,_0x3c3891,_0x1b9b61,_0x52718e));}else{logger[_0x4499('0xb')](util['format']('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0xdba2fd,_0x3c3891,_0x2cbb2b));}});}; \ No newline at end of file +var _0x5489=['exec','data2','Script','data3','render','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','trigger'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0x5489,0x15c));var _0x9548=function(_0x5d2942,_0x1bf2ff){_0x5d2942=_0x5d2942-0x0;var _0x332b83=_0x5489[_0x5d2942];return _0x332b83;};'use strict';var util=require(_0x9548('0x0'));var sh=require('shelljs');var Mustache=require('mustache');var logger=require('../../../../config/logger')(_0x9548('0x1'));exports[_0x9548('0x2')]=function(_0xb4d06d,_0x4a359d){var _0x148716=_0xb4d06d[_0x9548('0x3')]?_0xb4d06d[_0x9548('0x3')]:_0x9548('0x4');var _0xdcc274=_0xb4d06d[_0x9548('0x5')]?Mustache[_0x9548('0x6')](_0xb4d06d[_0x9548('0x5')],_0x4a359d):_0x4a359d;sh['exec'](_0xdcc274,function(_0x557105,_0x54d331,_0x3fc75f){if(_0x557105!==0x0){logger['error'](util['format'](_0x9548('0x7'),_0x148716,_0xdcc274,_0x557105,_0x3fc75f));}else{logger['info'](util[_0x9548('0x8')](_0x9548('0x9'),_0x148716,_0xdcc274,_0x54d331));}});}; \ 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 cc0664d..92d383a 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 _0xd609=['request-promise','util','../../../../config/logger','trigger','exec','data1','data2','number','data5','headers','parse','error','stack','GET','DELETE','POST','data7','render','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','info','format','stringify','isNil','object','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name'];(function(_0x2c53f2,_0x4c562f){var _0x1f24bb=function(_0x2d6580){while(--_0x2d6580){_0x2c53f2['push'](_0x2c53f2['shift']());}};_0x1f24bb(++_0x4c562f);}(_0xd609,0xcb));var _0x9d60=function(_0x565ff6,_0x139d99){_0x565ff6=_0x565ff6-0x0;var _0x5e1cc5=_0xd609[_0x565ff6];return _0x5e1cc5;};'use strict';var rp=require(_0x9d60('0x0'));var util=require(_0x9d60('0x1'));var _=require('lodash');var Mustache=require('mustache');var logger=require(_0x9d60('0x2'))(_0x9d60('0x3'));exports[_0x9d60('0x4')]=function(_0x52b632,_0x1fde70){var _0x122509,_0xc57422;var _0x3b2ec5={'method':_0x52b632[_0x9d60('0x5')]['toUpperCase'](),'uri':Mustache['render'](_0x52b632[_0x9d60('0x6')],_0x1fde70),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x52b632['data5'])===_0x9d60('0x7')&&parseInt(_0x52b632['data5'])>=0x1&&parseInt(_0x52b632['data5'])<=0xa?parseInt(_0x52b632[_0x9d60('0x8')])*0x3e8:0x5*0x3e8};try{_0x3b2ec5[_0x9d60('0x9')]=_0x52b632['data6']?JSON[_0x9d60('0xa')](Mustache['render'](_0x52b632['data6'],_0x1fde70)):{};}catch(_0x5c3974){logger[_0x9d60('0xb')](_0x5c3974[_0x9d60('0xc')]);}switch(_0x52b632[_0x9d60('0x5')]['toUpperCase']()){case _0x9d60('0xd'):case _0x9d60('0xe'):_0x122509=null;_0x3b2ec5['qs']=_0x1fde70;break;case _0x9d60('0xf'):case'PUT':if(_0x52b632[_0x9d60('0x10')]){try{_0x122509=JSON['parse'](Mustache[_0x9d60('0x11')](_0x52b632['data7'],_0x1fde70));_0x3b2ec5['body']=_0x122509;}catch(_0x1fdfd0){logger[_0x9d60('0xb')](_0x1fdfd0[_0x9d60('0xc')]);logger[_0x9d60('0xb')](_0x9d60('0x12'));}}else{_0x122509=_0x1fde70;_0x3b2ec5[_0x9d60('0x13')]=_0x122509;}break;}logger[_0x9d60('0x14')](util[_0x9d60('0x15')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x52b632[_0x9d60('0x5')],_0x52b632[_0x9d60('0x6')],JSON[_0x9d60('0x16')](_0x3b2ec5)));rp(_0x3b2ec5)['then'](function(_0x52ec78){_0x122509=!_[_0x9d60('0x17')](_0x122509)?',\x20request\x20body:\x20'+_0x122509:'';_0xc57422=typeof _0x52ec78['body']===_0x9d60('0x18')?JSON[_0x9d60('0x16')](_0x52ec78[_0x9d60('0x13')]):_0x52ec78[_0x9d60('0x13')];logger[_0x9d60('0x14')](util[_0x9d60('0x15')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x52b632['data1'],_0x52b632[_0x9d60('0x6')],_0x52ec78[_0x9d60('0x19')],_0xc57422));})[_0x9d60('0x1a')](function(_0x2dcd6f){logger[_0x9d60('0xb')](util['format'](_0x9d60('0x1b'),_0x52b632[_0x9d60('0x5')],_0x52b632[_0x9d60('0x6')],_0x2dcd6f[_0x9d60('0x19')],_0x2dcd6f[_0x9d60('0x1c')],_0x2dcd6f['message']));});}; \ No newline at end of file +var _0xf089=['then','isNil','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','data2','name','message','request-promise','util','mustache','trigger','exec','data1','toUpperCase','render','data5','headers','parse','data6','error','stack','GET','DELETE','POST','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s'];(function(_0x492322,_0x42e68c){var _0x1dfdbd=function(_0x2063d0){while(--_0x2063d0){_0x492322['push'](_0x492322['shift']());}};_0x1dfdbd(++_0x42e68c);}(_0xf089,0x83));var _0x9f08=function(_0x1e8fe3,_0x590dfe){_0x1e8fe3=_0x1e8fe3-0x0;var _0x1c10a8=_0xf089[_0x1e8fe3];return _0x1c10a8;};'use strict';var rp=require(_0x9f08('0x0'));var util=require(_0x9f08('0x1'));var _=require('lodash');var Mustache=require(_0x9f08('0x2'));var logger=require('../../../../config/logger')(_0x9f08('0x3'));exports[_0x9f08('0x4')]=function(_0xa9a5ad,_0x1741d3){var _0x59a566,_0x48fb4a;var _0x1ba7f3={'method':_0xa9a5ad[_0x9f08('0x5')][_0x9f08('0x6')](),'uri':Mustache[_0x9f08('0x7')](_0xa9a5ad['data2'],_0x1741d3),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0xa9a5ad['data5'])==='number'&&parseInt(_0xa9a5ad[_0x9f08('0x8')])>=0x1&&parseInt(_0xa9a5ad['data5'])<=0xa?parseInt(_0xa9a5ad['data5'])*0x3e8:0x5*0x3e8};try{_0x1ba7f3[_0x9f08('0x9')]=_0xa9a5ad['data6']?JSON[_0x9f08('0xa')](Mustache[_0x9f08('0x7')](_0xa9a5ad[_0x9f08('0xb')],_0x1741d3)):{};}catch(_0x1295a0){logger[_0x9f08('0xc')](_0x1295a0[_0x9f08('0xd')]);}switch(_0xa9a5ad[_0x9f08('0x5')][_0x9f08('0x6')]()){case _0x9f08('0xe'):case _0x9f08('0xf'):_0x59a566=null;_0x1ba7f3['qs']=_0x1741d3;break;case _0x9f08('0x10'):case _0x9f08('0x11'):if(_0xa9a5ad['data7']){try{_0x59a566=JSON[_0x9f08('0xa')](Mustache[_0x9f08('0x7')](_0xa9a5ad[_0x9f08('0x12')],_0x1741d3));_0x1ba7f3[_0x9f08('0x13')]=_0x59a566;}catch(_0x2e45fb){logger[_0x9f08('0xc')](_0x2e45fb[_0x9f08('0xd')]);logger[_0x9f08('0xc')](_0x9f08('0x14'));}}else{_0x59a566=_0x1741d3;_0x1ba7f3[_0x9f08('0x13')]=_0x59a566;}break;}logger[_0x9f08('0x15')](util[_0x9f08('0x16')](_0x9f08('0x17'),_0xa9a5ad[_0x9f08('0x5')],_0xa9a5ad['data2'],JSON['stringify'](_0x1ba7f3)));rp(_0x1ba7f3)[_0x9f08('0x18')](function(_0x53e023){_0x59a566=!_[_0x9f08('0x19')](_0x59a566)?',\x20request\x20body:\x20'+_0x59a566:'';_0x48fb4a=typeof _0x53e023['body']==='object'?JSON['stringify'](_0x53e023[_0x9f08('0x13')]):_0x53e023[_0x9f08('0x13')];logger[_0x9f08('0x15')](util[_0x9f08('0x16')](_0x9f08('0x1a'),_0xa9a5ad[_0x9f08('0x5')],_0xa9a5ad['data2'],_0x53e023['statusCode'],_0x48fb4a));})['catch'](function(_0x221bc3){logger['error'](util[_0x9f08('0x16')](_0x9f08('0x1b'),_0xa9a5ad[_0x9f08('0x5')],_0xa9a5ad[_0x9f08('0x1c')],_0x221bc3['statusCode'],_0x221bc3[_0x9f08('0x1d')],_0x221bc3[_0x9f08('0x1e')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 6caad99..664f5c0 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 _0x6de3=['jayson/promise','bluebird','../../config/logger','client','Request','request','debug','rpc','error','message','result','catch','routing','exports'];(function(_0x5071ed,_0x2b47a9){var _0x2c1b70=function(_0x51e526){while(--_0x51e526){_0x5071ed['push'](_0x5071ed['shift']());}};_0x2c1b70(++_0x2b47a9);}(_0x6de3,0xc4));var _0x36de=function(_0x22d3f9,_0x264524){_0x22d3f9=_0x22d3f9-0x0;var _0x4749e7=_0x6de3[_0x22d3f9];return _0x4749e7;};'use strict';var jayson=require(_0x36de('0x0'));var BPromise=require(_0x36de('0x1'));var logger=require(_0x36de('0x2'))('routing');var client=jayson[_0x36de('0x3')]['http']({'port':0x2329});client[_0x36de('0x4')]=function(_0x2bd190,_0x57fcce){return new BPromise(function(_0x5d1a4b,_0x55b410){return client[_0x36de('0x5')](_0x2bd190,_0x57fcce)['then'](function(_0x2be7e5){logger[_0x36de('0x6')](_0x36de('0x7'),'routing',_0x2bd190,_0x57fcce,_0x2be7e5);if(_0x2be7e5['error']){logger[_0x36de('0x8')](_0x36de('0x7'),'routing',_0x2bd190,_0x2be7e5[_0x36de('0x8')][_0x36de('0x9')],_0x57fcce);return _0x55b410(_0x2be7e5[_0x36de('0x8')][_0x36de('0x9')]);}else{return _0x5d1a4b(_0x2be7e5[_0x36de('0xa')]);}})[_0x36de('0xb')](function(_0x5ca658){logger[_0x36de('0x8')]('rpc',_0x36de('0xc'),_0x2bd190,_0x5ca658,_0x57fcce);return _0x55b410(_0x5ca658);});});};module[_0x36de('0xd')]=client; \ No newline at end of file +var _0x2136=['rpc','error','message','result','catch','exports','jayson/promise','../../config/logger','routing','client','http','Request','request','then','debug'];(function(_0x3ee04d,_0x5cc30f){var _0x4facf7=function(_0x22ad69){while(--_0x22ad69){_0x3ee04d['push'](_0x3ee04d['shift']());}};_0x4facf7(++_0x5cc30f);}(_0x2136,0x105));var _0x6213=function(_0xb1c60b,_0x385134){_0xb1c60b=_0xb1c60b-0x0;var _0x4c391d=_0x2136[_0xb1c60b];return _0x4c391d;};'use strict';var jayson=require(_0x6213('0x0'));var BPromise=require('bluebird');var logger=require(_0x6213('0x1'))(_0x6213('0x2'));var client=jayson[_0x6213('0x3')][_0x6213('0x4')]({'port':0x2329});client[_0x6213('0x5')]=function(_0x53c412,_0x48d53d){return new BPromise(function(_0x33fb7e,_0x3da3d7){return client[_0x6213('0x6')](_0x53c412,_0x48d53d)[_0x6213('0x7')](function(_0x24ca81){logger[_0x6213('0x8')](_0x6213('0x9'),_0x6213('0x2'),_0x53c412,_0x48d53d,_0x24ca81);if(_0x24ca81['error']){logger[_0x6213('0xa')]('rpc','routing',_0x53c412,_0x24ca81[_0x6213('0xa')][_0x6213('0xb')],_0x48d53d);return _0x3da3d7(_0x24ca81['error'][_0x6213('0xb')]);}else{return _0x33fb7e(_0x24ca81[_0x6213('0xc')]);}})[_0x6213('0xd')](function(_0x41fa5b){logger[_0x6213('0xa')](_0x6213('0x9'),'routing',_0x53c412,_0x41fa5b,_0x48d53d);return _0x3da3d7(_0x41fa5b);});});};module[_0x6213('0xe')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index da2e086..d562f70 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 _0xc380=['listen','getSettings','loginMailFrequency','catch','error','Email\x20service\x20initialization','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','email','then','initMailAccounts','refresh','mailAccounts'];(function(_0x5aa9d6,_0x56eb8b){var _0x48f997=function(_0x2f53a0){while(--_0x2f53a0){_0x5aa9d6['push'](_0x5aa9d6['shift']());}};_0x48f997(++_0x56eb8b);}(_0xc380,0x106));var _0x0c38=function(_0x5c83aa,_0x5a8ba9){_0x5c83aa=_0x5c83aa-0x0;var _0x36a56a=_0xc380[_0x5c83aa];return _0x36a56a;};'use strict';var server=require(_0x0c38('0x0'));var Realtime=require(_0x0c38('0x1'));var EmailChannel=require(_0x0c38('0x2'));var mailAccount=require(_0x0c38('0x3'));var setting=require(_0x0c38('0x4'));var logger=require('../../config/logger')(_0x0c38('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()[_0x0c38('0x6')](mailAccount['getMailAccounts']())[_0x0c38('0x6')](realtime[_0x0c38('0x7')]())[_0x0c38('0x6')](function(){email[_0x0c38('0x8')](realtime[_0x0c38('0x9')]);return realtime;});}function main(){return server[_0x0c38('0xa')](realtime,email)['then'](function(){return initRealtime();})['then'](function(){return setting[_0x0c38('0xb')]();})[_0x0c38('0x6')](function(_0x8a41c1){return setInterval(initRealtime,_0x8a41c1[_0x0c38('0xc')]*0x3e8);})[_0x0c38('0xd')](function(_0x5b5aeb){logger[_0x0c38('0xe')](_0x0c38('0xf'),_0x5b5aeb);});}main(); \ No newline at end of file +var _0x2925=['resolve','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','listen','loginMailFrequency','Email\x20service\x20initialization','./rpc/setting','../../config/logger'];(function(_0x49a57c,_0x2eb02c){var _0x4e0316=function(_0x37e2e5){while(--_0x37e2e5){_0x49a57c['push'](_0x49a57c['shift']());}};_0x4e0316(++_0x2eb02c);}(_0x2925,0x8d));var _0x5292=function(_0x45e504,_0x2171ea){_0x45e504=_0x45e504-0x0;var _0x2325d2=_0x2925[_0x45e504];return _0x2325d2;};'use strict';var server=require('./server');var Realtime=require('./realtime');var EmailChannel=require('./lib/email');var mailAccount=require('./rpc/mailAccount');var setting=require(_0x5292('0x0'));var logger=require(_0x5292('0x1'))('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x5292('0x2')]()[_0x5292('0x3')](mailAccount[_0x5292('0x4')]())['then'](realtime[_0x5292('0x5')]())['then'](function(){email[_0x5292('0x6')](realtime[_0x5292('0x7')]);return realtime;});}function main(){return server[_0x5292('0x8')](realtime,email)['then'](function(){return initRealtime();})['then'](function(){return setting['getSettings']();})[_0x5292('0x3')](function(_0x43aba6){return setInterval(initRealtime,_0x43aba6[_0x5292('0x9')]*0x3e8);})['catch'](function(_0x2d1a77){logger['error'](_0x5292('0xa'),_0x2d1a77);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 73bb18f..00f3506 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 _0xb5fe=['send','verifySmtp','Smtp','verify','verified','exports','moment','bluebird','email','defaults','localhost','redis','./smtp','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','name','key','active','Imap','messageStatus','total','stringify','mailAccount:update','refresh','hasOwnProperty','service','custom','provider','handleImapEmail','bind','handleImapEnd','isNil','status','disabled','handleImapBox','connected','messages','emit','info','firstName','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','handleImapError','sendMail'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0xb5fe,0x150));var _0xeb5f=function(_0x1af4f9,_0x2c1ef8){_0x1af4f9=_0x1af4f9-0x0;var _0x3364ce=_0xb5fe[_0x1af4f9];return _0x3364ce;};'use strict';var _=require('lodash');var moment=require(_0xeb5f('0x0'));var BPromise=require(_0xeb5f('0x1'));var md5=require('md5');var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xeb5f('0x2'));config['redis']=_[_0xeb5f('0x3')](config['redis'],{'host':_0xeb5f('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xeb5f('0x5')]));var EmailImap=require('./imap');var EmailSmtp=require(_0xeb5f('0x6'));var mailAccount=require(_0xeb5f('0x7'));var md5Accounts={};function EmailChannel(_0x2b0e6f){logger['info'](_0xeb5f('0x8'));this[_0xeb5f('0x9')]=_0x2b0e6f[_0xeb5f('0x9')];this[_0xeb5f('0xa')]={};this[_0xeb5f('0xb')]=new EmailSmtp();}EmailChannel[_0xeb5f('0xc')]['emit']=function(_0x230f51){var _0x45065d=this[_0xeb5f('0x9')][_0x230f51];var _0x4b520a={'id':_0x45065d['id'],'name':_0x45065d[_0xeb5f('0xd')],'key':_0x45065d[_0xeb5f('0xe')],'active':_0x45065d[_0xeb5f('0xf')],'Imap':{'status':_0x45065d[_0xeb5f('0x10')]['status'],'messageStatus':_0x45065d['Imap'][_0xeb5f('0x11')],'total':_0x45065d[_0xeb5f('0x10')][_0xeb5f('0x12')]}};if(_['isNil'](md5Accounts[_0x230f51])){md5Accounts[_0x230f51]={};}var _0x46d411=md5(JSON[_0xeb5f('0x13')](_0x4b520a));if(md5Accounts[_0x230f51]['md5']!==_0x46d411){md5Accounts[_0x230f51]['md5']=_0x46d411;io['emit'](_0xeb5f('0x14'),_0x4b520a);}};EmailChannel['prototype'][_0xeb5f('0x15')]=function(_0x1c0ac8){for(var _0x5611b7 in _0x1c0ac8){if(_0x1c0ac8[_0xeb5f('0x16')](_0x5611b7)){if(_0x1c0ac8[_0x5611b7]['Imap']&&_0x1c0ac8[_0x5611b7]['active']){var _0x1081da=_0x1c0ac8[_0x5611b7]['Imap'];if(!_0x1081da[_0xeb5f('0x17')]&&_0x1c0ac8[_0x5611b7]['provider']!==_0xeb5f('0x18'))_0x1081da[_0xeb5f('0x17')]=_0x1c0ac8[_0x5611b7][_0xeb5f('0x19')];if(!this[_0xeb5f('0xa')][_0xeb5f('0x16')](_0x1081da['id'])){this[_0xeb5f('0xa')][_0x1081da['id']]=new EmailImap(_0x1081da,_0x1c0ac8[_0x5611b7][_0xeb5f('0x2')]);this[_0xeb5f('0xa')][_0x1081da['id']]['on']('box',this['handleImapBox']['bind'](this,_0x5611b7));this['imapAccounts'][_0x1081da['id']]['on'](_0xeb5f('0x2'),this[_0xeb5f('0x1a')][_0xeb5f('0x1b')](this,_0x5611b7));this[_0xeb5f('0xa')][_0x1081da['id']]['on']('end',this[_0xeb5f('0x1c')][_0xeb5f('0x1b')](this,_0x5611b7));this[_0xeb5f('0xa')][_0x1081da['id']]['on']('error',this['handleImapError'][_0xeb5f('0x1b')](this,_0x5611b7));}}else{if(_[_0xeb5f('0x1d')](this[_0xeb5f('0x9')][_0x5611b7][_0xeb5f('0x10')])){this[_0xeb5f('0x9')][_0x5611b7][_0xeb5f('0x10')]={};}this[_0xeb5f('0x9')][_0x5611b7]['Imap'][_0xeb5f('0x1e')]=_0xeb5f('0x1f');this[_0xeb5f('0x9')][_0x5611b7][_0xeb5f('0x10')][_0xeb5f('0x11')]='';this['emit'](_0x5611b7);}}}};EmailChannel[_0xeb5f('0xc')][_0xeb5f('0x20')]=function(_0x48a97d,_0x25a32d){if(this[_0xeb5f('0x9')][_0x48a97d]){this[_0xeb5f('0x9')][_0x48a97d][_0xeb5f('0x10')][_0xeb5f('0x1e')]=_0xeb5f('0x21');this[_0xeb5f('0x9')][_0x48a97d][_0xeb5f('0x10')][_0xeb5f('0x11')]=_0x25a32d[_0xeb5f('0xd')];if(_0x25a32d['messages']){this[_0xeb5f('0x9')][_0x48a97d][_0xeb5f('0x10')][_0xeb5f('0x12')]=_0x25a32d[_0xeb5f('0x22')][_0xeb5f('0x12')];}return this[_0xeb5f('0x23')](_0x48a97d);}};EmailChannel[_0xeb5f('0xc')]['handleImapEmail']=function(_0x5cc755,_0x30aeb7){logger[_0xeb5f('0x24')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x30aeb7[_0xeb5f('0x25')],_0x30aeb7[_0xeb5f('0x26')],_0x30aeb7[_0xeb5f('0x27')],_0x5cc755);if(this['mailAccounts'][_0x5cc755]){return mailAccount[_0xeb5f('0x28')](_0x5cc755,_0x30aeb7)[_0xeb5f('0x29')](function(_0x17cad0){if(_0x17cad0){logger[_0xeb5f('0x24')](_0xeb5f('0x2a'));}})[_0xeb5f('0x2b')](function(_0x266c9c){logger[_0xeb5f('0x2c')](_0xeb5f('0x2d'),JSON['stringify'](_0x266c9c));});}};EmailChannel[_0xeb5f('0xc')][_0xeb5f('0x1c')]=function(_0x487b80){if(this[_0xeb5f('0x9')][_0x487b80]&&this['mailAccounts'][_0x487b80][_0xeb5f('0x10')]){if(this[_0xeb5f('0xa')][this[_0xeb5f('0x9')][_0x487b80][_0xeb5f('0x10')]['id']]){delete this[_0xeb5f('0xa')][this['mailAccounts'][_0x487b80][_0xeb5f('0x10')]['id']];}this[_0xeb5f('0x9')][_0x487b80][_0xeb5f('0x10')][_0xeb5f('0x2e')]=moment();this[_0xeb5f('0x23')](_0x487b80);}};EmailChannel[_0xeb5f('0xc')][_0xeb5f('0x2f')]=function(_0xec640b,_0x4d18e3){if(this['mailAccounts'][_0xec640b]){this[_0xeb5f('0x9')][_0xec640b][_0xeb5f('0x10')][_0xeb5f('0x1e')]=_0xeb5f('0x2c');this[_0xeb5f('0x9')][_0xec640b][_0xeb5f('0x10')][_0xeb5f('0x11')]=_0x4d18e3;return this[_0xeb5f('0x23')](_0xec640b);}};EmailChannel[_0xeb5f('0xc')][_0xeb5f('0x30')]=function(_0xeb030b,_0x484517){return this['smtp'][_0xeb5f('0x31')](_0xeb030b,_0x484517);};EmailChannel[_0xeb5f('0xc')][_0xeb5f('0x32')]=function(_0x172194){var _0x53d4cf=this;if(this[_0xeb5f('0x9')][_0x172194['id']]){if(_[_0xeb5f('0x1d')](this[_0xeb5f('0x9')][_0x172194['id']][_0xeb5f('0x33')])){this['mailAccounts'][_0x172194['id']][_0xeb5f('0x33')]={};}this[_0xeb5f('0x9')][_0x172194['id']][_0xeb5f('0x33')][_0xeb5f('0x2e')]=moment();return new BPromise(function(_0x3de576,_0x4038d9){return _0x53d4cf[_0xeb5f('0xb')][_0xeb5f('0x34')](_0x172194)['then'](function(_0x26edc3){_0x53d4cf[_0xeb5f('0x9')][_0x172194['id']]['Smtp']['status']=_0xeb5f('0x35');_0x53d4cf[_0xeb5f('0x9')][_0x172194['id']][_0xeb5f('0x33')][_0xeb5f('0x11')]='';_0x53d4cf[_0xeb5f('0x23')](_0x172194['id']);_0x3de576(_0x26edc3);})['catch'](function(_0x8fe873){_0x53d4cf[_0xeb5f('0x9')][_0x172194['id']][_0xeb5f('0x33')][_0xeb5f('0x1e')]=_0xeb5f('0x2c');_0x53d4cf[_0xeb5f('0x9')][_0x172194['id']][_0xeb5f('0x33')][_0xeb5f('0x11')]=_0x8fe873;_0x53d4cf[_0xeb5f('0x23')](_0x172194['id']);_0x4038d9(_0x8fe873);});});}return this['smtp']['verify'](_0x172194);};module[_0xeb5f('0x36')]=EmailChannel; \ No newline at end of file +var _0x38c3=['./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','messageStatus','total','mailAccount:update','refresh','provider','custom','service','hasOwnProperty','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','isNil','status','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','lastSync','handleImapError','sendMail','send','verifySmtp','Smtp','verify','exports','lodash','moment','md5','../../../config/environment','../../../config/logger','email','redis','localhost','socket.io-emitter'];(function(_0x41f15f,_0x1a39ef){var _0x269a71=function(_0x52c50e){while(--_0x52c50e){_0x41f15f['push'](_0x41f15f['shift']());}};_0x269a71(++_0x1a39ef);}(_0x38c3,0x153));var _0x338c=function(_0x32ffb5,_0x3866b5){_0x32ffb5=_0x32ffb5-0x0;var _0x3cbd7a=_0x38c3[_0x32ffb5];return _0x3cbd7a;};'use strict';var _=require(_0x338c('0x0'));var moment=require(_0x338c('0x1'));var BPromise=require('bluebird');var md5=require(_0x338c('0x2'));var Redis=require('ioredis');var config=require(_0x338c('0x3'));var logger=require(_0x338c('0x4'))(_0x338c('0x5'));config['redis']=_['defaults'](config[_0x338c('0x6')],{'host':_0x338c('0x7'),'port':0x18eb});var io=require(_0x338c('0x8'))(new Redis(config['redis']));var EmailImap=require(_0x338c('0x9'));var EmailSmtp=require(_0x338c('0xa'));var mailAccount=require(_0x338c('0xb'));var md5Accounts={};function EmailChannel(_0x35e81d){logger[_0x338c('0xc')](_0x338c('0xd'));this[_0x338c('0xe')]=_0x35e81d[_0x338c('0xe')];this[_0x338c('0xf')]={};this[_0x338c('0x10')]=new EmailSmtp();}EmailChannel[_0x338c('0x11')][_0x338c('0x12')]=function(_0x46946c){var _0x14cd5=this[_0x338c('0xe')][_0x46946c];var _0x556c32={'id':_0x14cd5['id'],'name':_0x14cd5[_0x338c('0x13')],'key':_0x14cd5[_0x338c('0x14')],'active':_0x14cd5[_0x338c('0x15')],'Imap':{'status':_0x14cd5[_0x338c('0x16')]['status'],'messageStatus':_0x14cd5['Imap'][_0x338c('0x17')],'total':_0x14cd5[_0x338c('0x16')][_0x338c('0x18')]}};if(_['isNil'](md5Accounts[_0x46946c])){md5Accounts[_0x46946c]={};}var _0x448393=md5(JSON['stringify'](_0x556c32));if(md5Accounts[_0x46946c][_0x338c('0x2')]!==_0x448393){md5Accounts[_0x46946c][_0x338c('0x2')]=_0x448393;io[_0x338c('0x12')](_0x338c('0x19'),_0x556c32);}};EmailChannel[_0x338c('0x11')][_0x338c('0x1a')]=function(_0x463507){for(var _0x7fde0c in _0x463507){if(_0x463507['hasOwnProperty'](_0x7fde0c)){if(_0x463507[_0x7fde0c][_0x338c('0x16')]&&_0x463507[_0x7fde0c][_0x338c('0x15')]){var _0x33e4d7=_0x463507[_0x7fde0c][_0x338c('0x16')];if(!_0x33e4d7['service']&&_0x463507[_0x7fde0c][_0x338c('0x1b')]!==_0x338c('0x1c'))_0x33e4d7[_0x338c('0x1d')]=_0x463507[_0x7fde0c][_0x338c('0x1b')];if(!this[_0x338c('0xf')][_0x338c('0x1e')](_0x33e4d7['id'])){this['imapAccounts'][_0x33e4d7['id']]=new EmailImap(_0x33e4d7,_0x463507[_0x7fde0c][_0x338c('0x5')]);this['imapAccounts'][_0x33e4d7['id']]['on']('box',this[_0x338c('0x1f')][_0x338c('0x20')](this,_0x7fde0c));this['imapAccounts'][_0x33e4d7['id']]['on']('email',this[_0x338c('0x21')][_0x338c('0x20')](this,_0x7fde0c));this[_0x338c('0xf')][_0x33e4d7['id']]['on'](_0x338c('0x22'),this[_0x338c('0x23')]['bind'](this,_0x7fde0c));this['imapAccounts'][_0x33e4d7['id']]['on'](_0x338c('0x24'),this['handleImapError']['bind'](this,_0x7fde0c));}}else{if(_[_0x338c('0x25')](this[_0x338c('0xe')][_0x7fde0c]['Imap'])){this[_0x338c('0xe')][_0x7fde0c]['Imap']={};}this['mailAccounts'][_0x7fde0c][_0x338c('0x16')]['status']='disabled';this['mailAccounts'][_0x7fde0c]['Imap']['messageStatus']='';this[_0x338c('0x12')](_0x7fde0c);}}}};EmailChannel[_0x338c('0x11')]['handleImapBox']=function(_0x266782,_0x1fa262){if(this[_0x338c('0xe')][_0x266782]){this[_0x338c('0xe')][_0x266782]['Imap'][_0x338c('0x26')]=_0x338c('0x27');this[_0x338c('0xe')][_0x266782][_0x338c('0x16')][_0x338c('0x17')]=_0x1fa262[_0x338c('0x13')];if(_0x1fa262[_0x338c('0x28')]){this['mailAccounts'][_0x266782][_0x338c('0x16')]['total']=_0x1fa262[_0x338c('0x28')][_0x338c('0x18')];}return this['emit'](_0x266782);}};EmailChannel[_0x338c('0x11')]['handleImapEmail']=function(_0x2596f5,_0x53033c){logger[_0x338c('0xc')](_0x338c('0x29'),_0x53033c[_0x338c('0x2a')],_0x53033c['lastName'],_0x53033c[_0x338c('0x2b')],_0x2596f5);if(this[_0x338c('0xe')][_0x2596f5]){return mailAccount[_0x338c('0x2c')](_0x2596f5,_0x53033c)[_0x338c('0x2d')](function(_0xb7c47e){if(_0xb7c47e){logger[_0x338c('0xc')](_0x338c('0x2e'));}})[_0x338c('0x2f')](function(_0x1638e2){logger[_0x338c('0x24')](_0x338c('0x30'),JSON[_0x338c('0x31')](_0x1638e2));});}};EmailChannel[_0x338c('0x11')]['handleImapEnd']=function(_0x1a235f){if(this[_0x338c('0xe')][_0x1a235f]&&this[_0x338c('0xe')][_0x1a235f][_0x338c('0x16')]){if(this[_0x338c('0xf')][this[_0x338c('0xe')][_0x1a235f][_0x338c('0x16')]['id']]){delete this[_0x338c('0xf')][this[_0x338c('0xe')][_0x1a235f]['Imap']['id']];}this[_0x338c('0xe')][_0x1a235f]['Imap'][_0x338c('0x32')]=moment();this[_0x338c('0x12')](_0x1a235f);}};EmailChannel['prototype'][_0x338c('0x33')]=function(_0x3d9359,_0x2df060){if(this['mailAccounts'][_0x3d9359]){this[_0x338c('0xe')][_0x3d9359][_0x338c('0x16')]['status']=_0x338c('0x24');this['mailAccounts'][_0x3d9359][_0x338c('0x16')][_0x338c('0x17')]=_0x2df060;return this[_0x338c('0x12')](_0x3d9359);}};EmailChannel['prototype'][_0x338c('0x34')]=function(_0x30bc64,_0x846174){return this['smtp'][_0x338c('0x35')](_0x30bc64,_0x846174);};EmailChannel[_0x338c('0x11')][_0x338c('0x36')]=function(_0x3351b9){var _0x1ffbe7=this;if(this[_0x338c('0xe')][_0x3351b9['id']]){if(_[_0x338c('0x25')](this[_0x338c('0xe')][_0x3351b9['id']][_0x338c('0x37')])){this[_0x338c('0xe')][_0x3351b9['id']]['Smtp']={};}this[_0x338c('0xe')][_0x3351b9['id']][_0x338c('0x37')]['lastSync']=moment();return new BPromise(function(_0x2e7ecb,_0x6341f8){return _0x1ffbe7['smtp']['verify'](_0x3351b9)[_0x338c('0x2d')](function(_0x13a0af){_0x1ffbe7[_0x338c('0xe')][_0x3351b9['id']][_0x338c('0x37')][_0x338c('0x26')]='verified';_0x1ffbe7[_0x338c('0xe')][_0x3351b9['id']][_0x338c('0x37')]['messageStatus']='';_0x1ffbe7['emit'](_0x3351b9['id']);_0x2e7ecb(_0x13a0af);})[_0x338c('0x2f')](function(_0x5efd8e){_0x1ffbe7[_0x338c('0xe')][_0x3351b9['id']][_0x338c('0x37')]['status']='error';_0x1ffbe7[_0x338c('0xe')][_0x3351b9['id']][_0x338c('0x37')][_0x338c('0x17')]=_0x5efd8e;_0x1ffbe7[_0x338c('0x12')](_0x3351b9['id']);_0x6341f8(_0x5efd8e);});});}return this[_0x338c('0x10')][_0x338c('0x38')](_0x3351b9);};module[_0x338c('0x39')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 0b8dd0f..61946ef 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 _0x2d7a=['handleOpenBox','box','readUnseen','handleCloseBox','handleError','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','handleMessageBody','attributes','handleMessageAttributes','handleSimpleParser','parser','emit','stringify','hasOwnProperty','upperFirst','exports','lodash','util','imap','mailparser','iconv','EventEmitter','./utils','../../../config/logger','email','mailbox','account','once','ready','bind','end','handleEnd','error','connect','inherits','prototype','getAccount','connTimeout','authTimeout','service','user','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','password','authentication','anonymous@xcally.com','host','port','tls','autotls','required','handleReady','openBox'];(function(_0x57ece6,_0x265ff0){var _0x4ca591=function(_0x54fab4){while(--_0x54fab4){_0x57ece6['push'](_0x57ece6['shift']());}};_0x4ca591(++_0x265ff0);}(_0x2d7a,0x153));var _0xa2d7=function(_0x370105,_0x939451){_0x370105=_0x370105-0x0;var _0xf59e4=_0x2d7a[_0x370105];return _0xf59e4;};'use strict';var _=require(_0xa2d7('0x0'));var util=require(_0xa2d7('0x1'));var Imap=require(_0xa2d7('0x2'));var simpleParser=require(_0xa2d7('0x3'))['simpleParser'];var Iconv=require(_0xa2d7('0x4'))['Iconv'];var EventEmitter=require('events')[_0xa2d7('0x5')];var utils=require(_0xa2d7('0x6'));var logger=require(_0xa2d7('0x7'))(_0xa2d7('0x8'));function EmailImap(_0xb184bd,_0x1699c2){this[_0xa2d7('0x9')]=_0xb184bd[_0xa2d7('0x9')];this['account']=this['getAccount'](_0xb184bd,_0x1699c2);this['imap']=new Imap(this[_0xa2d7('0xa')]);this[_0xa2d7('0x2')][_0xa2d7('0xb')](_0xa2d7('0xc'),this['handleReady'][_0xa2d7('0xd')](this));this['imap']['once'](_0xa2d7('0xe'),this[_0xa2d7('0xf')][_0xa2d7('0xd')](this));this['imap']['on'](_0xa2d7('0x10'),this['handleError'][_0xa2d7('0xd')](this));this[_0xa2d7('0x2')][_0xa2d7('0x11')]();}util[_0xa2d7('0x12')](EmailImap,EventEmitter);EmailImap[_0xa2d7('0x13')][_0xa2d7('0x14')]=function(_0x2aadfe,_0x2766ef){var _0xe8426a={'connTimeout':_0x2aadfe[_0xa2d7('0x15')]?_0x2aadfe['connTimeout']*0x3e8:0x2710,'authTimeout':_0x2aadfe['authTimeout']?_0x2aadfe[_0xa2d7('0x16')]*0x3e8:0x1388};if(_0x2aadfe[_0xa2d7('0x17')]){_0xe8426a['user']=_0x2aadfe[_0xa2d7('0x18')];if(_0x2aadfe[_0xa2d7('0x19')]){_0xe8426a[_0xa2d7('0x1a')]=utils[_0xa2d7('0x1b')](_0x2aadfe[_0xa2d7('0x1c')]['data5'],_0x2aadfe[_0xa2d7('0x18')]);}else{_0xe8426a[_0xa2d7('0x1d')]=_0x2aadfe['password'];}}else{if(_0x2aadfe[_0xa2d7('0x1e')]){_0xe8426a[_0xa2d7('0x18')]=_0x2aadfe[_0xa2d7('0x18')];_0xe8426a[_0xa2d7('0x1d')]=_0x2aadfe[_0xa2d7('0x1d')];}}_0xe8426a[_0xa2d7('0x8')]=_0x2766ef||_0x2aadfe['user']||_0xa2d7('0x1f');_0xe8426a[_0xa2d7('0x20')]=_0x2aadfe[_0xa2d7('0x20')];_0xe8426a[_0xa2d7('0x21')]=_0x2aadfe[_0xa2d7('0x21')]||0x3e1;if(_0x2aadfe[_0xa2d7('0x22')]){_0xe8426a[_0xa2d7('0x22')]=!![];}else{_0xe8426a[_0xa2d7('0x22')]=![];_0xe8426a[_0xa2d7('0x23')]=_0xa2d7('0x24');}return _0xe8426a;};EmailImap[_0xa2d7('0x13')][_0xa2d7('0x25')]=function(){this[_0xa2d7('0x2')][_0xa2d7('0x26')](this['mailbox'],![],this[_0xa2d7('0x27')][_0xa2d7('0xd')](this));};EmailImap[_0xa2d7('0x13')]['handleOpenBox']=function(_0x22b959,_0x3e87d6){if(_0x22b959){this['handleError'](_0x22b959,!![]);}else{this['emit'](_0xa2d7('0x28'),_0x3e87d6);this[_0xa2d7('0x29')]();}};EmailImap['prototype'][_0xa2d7('0x2a')]=function(_0x850f85){if(_0x850f85){this[_0xa2d7('0x2b')](_0x850f85,!![]);}else{this[_0xa2d7('0x2')][_0xa2d7('0xe')]();}};EmailImap[_0xa2d7('0x13')][_0xa2d7('0x29')]=function(){this[_0xa2d7('0x2')]['search']([_0xa2d7('0x2c')],this[_0xa2d7('0x2d')][_0xa2d7('0xd')](this));};EmailImap[_0xa2d7('0x13')]['handleReadUnseen']=function(_0x43fc86,_0x1c4380){if(_0x43fc86){this['handleError'](_0x43fc86,!![]);}else{if(_0x1c4380[_0xa2d7('0x2e')]){try{var _0x3d9c93=this['imap'][_0xa2d7('0x2f')](_0x1c4380,{'bodies':'','markSeen':!![]});_0x3d9c93['on'](_0xa2d7('0x30'),this[_0xa2d7('0x31')][_0xa2d7('0xd')](this));_0x3d9c93[_0xa2d7('0xb')](_0xa2d7('0x10'),this[_0xa2d7('0x32')][_0xa2d7('0xd')](this));_0x3d9c93['once'](_0xa2d7('0xe'),this[_0xa2d7('0x33')][_0xa2d7('0xd')](this));}catch(_0x58367d){logger['error'](_0x58367d);}}else{this[_0xa2d7('0x2')][_0xa2d7('0x34')](!![],this['handleCloseBox'][_0xa2d7('0xd')](this));}}};EmailImap[_0xa2d7('0x13')][_0xa2d7('0x31')]=function(_0x4297e8){_0x4297e8['on']('body',this[_0xa2d7('0x35')][_0xa2d7('0xd')](this));_0x4297e8[_0xa2d7('0xb')](_0xa2d7('0x36'),this[_0xa2d7('0x37')][_0xa2d7('0xd')](this));_0x4297e8['once']('end',this['handleMessageEnd'][_0xa2d7('0xd')](this));};EmailImap[_0xa2d7('0x13')][_0xa2d7('0x35')]=function(_0x238af2){simpleParser(_0x238af2,{'Iconv':Iconv},this[_0xa2d7('0x38')][_0xa2d7('0xd')](this));};EmailImap[_0xa2d7('0x13')]['handleMessageAttributes']=function(){};EmailImap[_0xa2d7('0x13')]['handleMessageEnd']=function(){};EmailImap[_0xa2d7('0x13')][_0xa2d7('0x38')]=function(_0x4ec15c,_0x2d289b){if(_0x4ec15c){logger[_0xa2d7('0x10')](_0x4ec15c);}else{var _0x453e5a=this;utils[_0xa2d7('0x39')](this[_0xa2d7('0xa')],_0x2d289b,function(_0x17ab86){_0x453e5a[_0xa2d7('0x3a')](_0xa2d7('0x8'),_0x17ab86);});}};EmailImap[_0xa2d7('0x13')][_0xa2d7('0x33')]=function(){this[_0xa2d7('0x2')][_0xa2d7('0x34')](!![],this['handleCloseBox'][_0xa2d7('0xd')](this));};EmailImap[_0xa2d7('0x13')][_0xa2d7('0x32')]=function(_0x2a12be){this[_0xa2d7('0x2b')](_0x2a12be);this[_0xa2d7('0x2')][_0xa2d7('0x34')](!![],this[_0xa2d7('0x2a')]['bind'](this));};EmailImap[_0xa2d7('0x13')][_0xa2d7('0xf')]=function(){this[_0xa2d7('0x3a')]('end');};EmailImap['prototype'][_0xa2d7('0x2b')]=function(_0xd551c4,_0x5d0411){logger['error']('handleError',this[_0xa2d7('0xa')]['email'],JSON[_0xa2d7('0x3b')](_0xd551c4));var _0xb17ec3='';if(_0xd551c4){if(_0xd551c4['textCode']){_0xb17ec3=_0xd551c4['textCode'];}else{for(var _0x4f17ea in _0xd551c4){if(_0xd551c4[_0xa2d7('0x3c')](_0x4f17ea)){_0xb17ec3+=_[_0xa2d7('0x3d')](_0x4f17ea)+':\x20'+_0xd551c4[_0x4f17ea]+'\x0a';}}}}if(_0x5d0411){this[_0xa2d7('0x2')]['end']();}else{this[_0xa2d7('0x3a')]('error',_0xb17ec3);this[_0xa2d7('0x3a')](_0xa2d7('0xe'));}};module[_0xa2d7('0x3e')]=EmailImap; \ No newline at end of file +var _0xea30=['handleFetchMessage','error','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','handleMessageAttributes','handleSimpleParser','handleMessageEnd','parser','stringify','textCode','hasOwnProperty','upperFirst','exports','util','mailparser','simpleParser','iconv','Iconv','EventEmitter','./utils','../../../config/logger','email','mailbox','account','imap','ready','once','end','handleEnd','handleError','inherits','getAccount','connTimeout','authTimeout','service','user','generateXOAuth2Token','data5','password','anonymous@xcally.com','host','tls','autotls','required','prototype','handleReady','bind','emit','readUnseen','handleCloseBox','search','handleReadUnseen','length','fetch','message'];(function(_0x242a2d,_0x4ed72e){var _0x762099=function(_0x4f20ab){while(--_0x4f20ab){_0x242a2d['push'](_0x242a2d['shift']());}};_0x762099(++_0x4ed72e);}(_0xea30,0x1a6));var _0x0ea3=function(_0x588742,_0x52257c){_0x588742=_0x588742-0x0;var _0x527ef5=_0xea30[_0x588742];return _0x527ef5;};'use strict';var _=require('lodash');var util=require(_0x0ea3('0x0'));var Imap=require('imap');var simpleParser=require(_0x0ea3('0x1'))[_0x0ea3('0x2')];var Iconv=require(_0x0ea3('0x3'))[_0x0ea3('0x4')];var EventEmitter=require('events')[_0x0ea3('0x5')];var utils=require(_0x0ea3('0x6'));var logger=require(_0x0ea3('0x7'))(_0x0ea3('0x8'));function EmailImap(_0x26965a,_0xcdcb99){this[_0x0ea3('0x9')]=_0x26965a[_0x0ea3('0x9')];this[_0x0ea3('0xa')]=this['getAccount'](_0x26965a,_0xcdcb99);this[_0x0ea3('0xb')]=new Imap(this[_0x0ea3('0xa')]);this[_0x0ea3('0xb')]['once'](_0x0ea3('0xc'),this['handleReady']['bind'](this));this[_0x0ea3('0xb')][_0x0ea3('0xd')](_0x0ea3('0xe'),this[_0x0ea3('0xf')]['bind'](this));this[_0x0ea3('0xb')]['on']('error',this[_0x0ea3('0x10')]['bind'](this));this[_0x0ea3('0xb')]['connect']();}util[_0x0ea3('0x11')](EmailImap,EventEmitter);EmailImap['prototype'][_0x0ea3('0x12')]=function(_0x49f68e,_0x28fd71){var _0x1dcd1f={'connTimeout':_0x49f68e[_0x0ea3('0x13')]?_0x49f68e[_0x0ea3('0x13')]*0x3e8:0x2710,'authTimeout':_0x49f68e[_0x0ea3('0x14')]?_0x49f68e[_0x0ea3('0x14')]*0x3e8:0x1388};if(_0x49f68e[_0x0ea3('0x15')]){_0x1dcd1f['user']=_0x49f68e[_0x0ea3('0x16')];if(_0x49f68e['modernAuthentication']){_0x1dcd1f['xoauth2']=utils[_0x0ea3('0x17')](_0x49f68e['CloudProvider'][_0x0ea3('0x18')],_0x49f68e[_0x0ea3('0x16')]);}else{_0x1dcd1f[_0x0ea3('0x19')]=_0x49f68e[_0x0ea3('0x19')];}}else{if(_0x49f68e['authentication']){_0x1dcd1f[_0x0ea3('0x16')]=_0x49f68e['user'];_0x1dcd1f['password']=_0x49f68e[_0x0ea3('0x19')];}}_0x1dcd1f[_0x0ea3('0x8')]=_0x28fd71||_0x49f68e['user']||_0x0ea3('0x1a');_0x1dcd1f['host']=_0x49f68e[_0x0ea3('0x1b')];_0x1dcd1f['port']=_0x49f68e['port']||0x3e1;if(_0x49f68e[_0x0ea3('0x1c')]){_0x1dcd1f[_0x0ea3('0x1c')]=!![];}else{_0x1dcd1f[_0x0ea3('0x1c')]=![];_0x1dcd1f[_0x0ea3('0x1d')]=_0x0ea3('0x1e');}return _0x1dcd1f;};EmailImap[_0x0ea3('0x1f')][_0x0ea3('0x20')]=function(){this[_0x0ea3('0xb')]['openBox'](this[_0x0ea3('0x9')],![],this['handleOpenBox'][_0x0ea3('0x21')](this));};EmailImap[_0x0ea3('0x1f')]['handleOpenBox']=function(_0x3f0fee,_0x32b04a){if(_0x3f0fee){this[_0x0ea3('0x10')](_0x3f0fee,!![]);}else{this[_0x0ea3('0x22')]('box',_0x32b04a);this[_0x0ea3('0x23')]();}};EmailImap[_0x0ea3('0x1f')][_0x0ea3('0x24')]=function(_0x558ea3){if(_0x558ea3){this[_0x0ea3('0x10')](_0x558ea3,!![]);}else{this[_0x0ea3('0xb')][_0x0ea3('0xe')]();}};EmailImap['prototype'][_0x0ea3('0x23')]=function(){this[_0x0ea3('0xb')][_0x0ea3('0x25')](['UNSEEN'],this[_0x0ea3('0x26')][_0x0ea3('0x21')](this));};EmailImap[_0x0ea3('0x1f')][_0x0ea3('0x26')]=function(_0x492c48,_0x149f05){if(_0x492c48){this[_0x0ea3('0x10')](_0x492c48,!![]);}else{if(_0x149f05[_0x0ea3('0x27')]){try{var _0x2c3d20=this[_0x0ea3('0xb')][_0x0ea3('0x28')](_0x149f05,{'bodies':'','markSeen':!![]});_0x2c3d20['on'](_0x0ea3('0x29'),this[_0x0ea3('0x2a')][_0x0ea3('0x21')](this));_0x2c3d20[_0x0ea3('0xd')](_0x0ea3('0x2b'),this[_0x0ea3('0x2c')]['bind'](this));_0x2c3d20[_0x0ea3('0xd')]('end',this[_0x0ea3('0x2d')][_0x0ea3('0x21')](this));}catch(_0x117e9b){logger[_0x0ea3('0x2b')](_0x117e9b);}}else{this[_0x0ea3('0xb')][_0x0ea3('0x2e')](!![],this['handleCloseBox'][_0x0ea3('0x21')](this));}}};EmailImap[_0x0ea3('0x1f')][_0x0ea3('0x2a')]=function(_0x235075){_0x235075['on'](_0x0ea3('0x2f'),this[_0x0ea3('0x30')][_0x0ea3('0x21')](this));_0x235075[_0x0ea3('0xd')]('attributes',this[_0x0ea3('0x31')][_0x0ea3('0x21')](this));_0x235075[_0x0ea3('0xd')]('end',this['handleMessageEnd'][_0x0ea3('0x21')](this));};EmailImap[_0x0ea3('0x1f')][_0x0ea3('0x30')]=function(_0x28a7aa){simpleParser(_0x28a7aa,{'Iconv':Iconv},this[_0x0ea3('0x32')]['bind'](this));};EmailImap[_0x0ea3('0x1f')][_0x0ea3('0x31')]=function(){};EmailImap[_0x0ea3('0x1f')][_0x0ea3('0x33')]=function(){};EmailImap['prototype']['handleSimpleParser']=function(_0x5029e3,_0x5b4f0e){if(_0x5029e3){logger[_0x0ea3('0x2b')](_0x5029e3);}else{var _0x283c72=this;utils[_0x0ea3('0x34')](this[_0x0ea3('0xa')],_0x5b4f0e,function(_0x2d25a7){_0x283c72['emit'](_0x0ea3('0x8'),_0x2d25a7);});}};EmailImap['prototype'][_0x0ea3('0x2d')]=function(){this[_0x0ea3('0xb')]['closeBox'](!![],this['handleCloseBox'][_0x0ea3('0x21')](this));};EmailImap[_0x0ea3('0x1f')][_0x0ea3('0x2c')]=function(_0x11b83b){this[_0x0ea3('0x10')](_0x11b83b);this[_0x0ea3('0xb')]['closeBox'](!![],this['handleCloseBox'][_0x0ea3('0x21')](this));};EmailImap[_0x0ea3('0x1f')][_0x0ea3('0xf')]=function(){this[_0x0ea3('0x22')](_0x0ea3('0xe'));};EmailImap[_0x0ea3('0x1f')][_0x0ea3('0x10')]=function(_0x1489b2,_0x202fea){logger[_0x0ea3('0x2b')](_0x0ea3('0x10'),this[_0x0ea3('0xa')][_0x0ea3('0x8')],JSON[_0x0ea3('0x35')](_0x1489b2));var _0x4e857d='';if(_0x1489b2){if(_0x1489b2[_0x0ea3('0x36')]){_0x4e857d=_0x1489b2[_0x0ea3('0x36')];}else{for(var _0x226f10 in _0x1489b2){if(_0x1489b2[_0x0ea3('0x37')](_0x226f10)){_0x4e857d+=_[_0x0ea3('0x38')](_0x226f10)+':\x20'+_0x1489b2[_0x226f10]+'\x0a';}}}}if(_0x202fea){this['imap'][_0x0ea3('0xe')]();}else{this[_0x0ea3('0x22')](_0x0ea3('0x2b'),_0x4e857d);this[_0x0ea3('0x22')](_0x0ea3('0xe'));}};module[_0x0ea3('0x39')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 9ed42f9..740fbc3 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 _0x6d0a=['createTransport','use','compile','sendMail','verify','toString','exports','nodemailer-plugin-inline-base64','prototype','send'];(function(_0x4e697a,_0x56a14b){var _0x88850c=function(_0x4e368a){while(--_0x4e368a){_0x4e697a['push'](_0x4e697a['shift']());}};_0x88850c(++_0x56a14b);}(_0x6d0a,0x75));var _0xa6d0=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x6d0a[_0x160c73];return _0xd9302;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0xa6d0('0x0'));function EmailSmtp(){}EmailSmtp[_0xa6d0('0x1')][_0xa6d0('0x2')]=function(_0x188cf2,_0x798105){return new Promise(function(_0x385379,_0x2cf00a){var _0x46d248=nodemailer[_0xa6d0('0x3')](_0x188cf2);_0x46d248[_0xa6d0('0x4')](_0xa6d0('0x5'),inlineBase64());_0x46d248[_0xa6d0('0x6')](_0x798105,function(_0x28d106,_0x2310c9){if(_0x28d106){_0x2cf00a(_0x28d106['toString']());}else{_0x385379(_0x2310c9);}});});};EmailSmtp['prototype'][_0xa6d0('0x7')]=function(_0x5d3538){return new Promise(function(_0x3a62d7,_0x2d96bf){var _0x4de0bb=nodemailer[_0xa6d0('0x3')](_0x5d3538);_0x4de0bb[_0xa6d0('0x7')](function(_0x21ddc2,_0x29bbe9){if(_0x21ddc2){_0x2d96bf(_0x21ddc2[_0xa6d0('0x8')]());}else{if(_0x29bbe9){_0x3a62d7(_0x29bbe9);}else{_0x2d96bf('Not\x20verifired');}}});});};module[_0xa6d0('0x9')]=EmailSmtp; \ No newline at end of file +var _0x3305=['exports','nodemailer','nodemailer-plugin-inline-base64','prototype','send','createTransport','compile','sendMail','toString','verify'];(function(_0x4e0a62,_0x539721){var _0xfe8ea9=function(_0x3b79a8){while(--_0x3b79a8){_0x4e0a62['push'](_0x4e0a62['shift']());}};_0xfe8ea9(++_0x539721);}(_0x3305,0x119));var _0x5330=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x3305[_0x42cae2];return _0x5f256f;};'use strict';var nodemailer=require(_0x5330('0x0'));var inlineBase64=require(_0x5330('0x1'));function EmailSmtp(){}EmailSmtp[_0x5330('0x2')][_0x5330('0x3')]=function(_0x333e4f,_0x590a08){return new Promise(function(_0x5e788d,_0x4b68ad){var _0x554bed=nodemailer[_0x5330('0x4')](_0x333e4f);_0x554bed['use'](_0x5330('0x5'),inlineBase64());_0x554bed[_0x5330('0x6')](_0x590a08,function(_0x58e426,_0x209274){if(_0x58e426){_0x4b68ad(_0x58e426[_0x5330('0x7')]());}else{_0x5e788d(_0x209274);}});});};EmailSmtp[_0x5330('0x2')][_0x5330('0x8')]=function(_0x14b4c1){return new Promise(function(_0x57a6ec,_0x6377b0){var _0x5c1c75=nodemailer[_0x5330('0x4')](_0x14b4c1);_0x5c1c75[_0x5330('0x8')](function(_0x8ed4cb,_0x3ab33f){if(_0x8ed4cb){_0x6377b0(_0x8ed4cb['toString']());}else{if(_0x3ab33f){_0x57a6ec(_0x3ab33f);}else{_0x6377b0('Not\x20verifired');}}});});};module[_0x5330('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 4c4f5ef..f13e96f 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 _0x5011=['%s-%s','now','root','server/files/attachments/','content','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','indexOf','line','parser','from','subject','messageId','YYYY-MM-DD\x20HH:mm:ss','filter','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','BodyHTML','

Empty\x20message

','Attachments','Title','Data','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','base64','moment','randomstring','path','util','../../../config/logger','email','head','value','address','anonymous','generate','@xcally.com','name','substring','split','slice','join','Anonymous','length','isEmpty','html','replace','includes','\x20[Attachment:\x20','body','textAsHtml','0x1?_0x10f832[_0x1501('0xf')](0x0,-0x1)[_0x1501('0x10')]('\x20'):_0x4226a8[_0x1501('0xc')];}return _0x1501('0x11');}function getLastName(_0x55eb9b){var _0x2b458d=_['head'](_0x55eb9b['value']);if(_0x2b458d&&_0x2b458d[_0x1501('0xc')]){var _0x517adc=_0x2b458d[_0x1501('0xc')][_0x1501('0xe')](/\s+/);return _0x517adc[_0x1501('0x12')]>0x1?_0x517adc['pop']():'';}return'';}function getMails(_0x582869,_0x1df6b6){var _0x5e3f6e='';for(var _0x37ef84=0x0;_0x37ef84<_0x1df6b6['value'][_0x1501('0x12')];_0x37ef84+=0x1){if(_0x1df6b6[_0x1501('0x7')][_0x37ef84][_0x1501('0x8')]!==_0x582869){if(!_[_0x1501('0x13')](_0x5e3f6e)){_0x5e3f6e+=',';}_0x5e3f6e+=_0x1df6b6['value'][_0x37ef84][_0x1501('0xc')]||_0x1df6b6['value'][_0x37ef84]['address']||'';_0x5e3f6e+='\x20<';_0x5e3f6e+=_0x1df6b6['value'][_0x37ef84][_0x1501('0x8')]?_0x1df6b6[_0x1501('0x7')][_0x37ef84][_0x1501('0x8')]:_0x1501('0x9')+random[_0x1501('0xa')](0x6)+_0x1501('0xb');_0x5e3f6e+='>';}}return _0x5e3f6e;}function parseEmail(_0x65d2b,_0x3d99ff,_0x29169d){if(_0x3d99ff[_0x1501('0x14')]){var _0xc464e2=/)<[^<]*)*<\/script>/gi;while(_0xc464e2['test'](_0x3d99ff[_0x1501('0x14')])){_0x3d99ff[_0x1501('0x14')]=_0x3d99ff[_0x1501('0x14')][_0x1501('0x15')](_0xc464e2,'');}if(_0x3d99ff[_0x1501('0x14')][_0x1501('0x16')](_0x1501('0x17'))){var _0x4c7b94=[];_0x3d99ff[_0x1501('0x18')][_0x1501('0x19')](_0x494009=>{_0x4c7b94[_0x1501('0x1a')](_0x494009[_0x1501('0x1b')]);});var _0xae39c2=/]+>/g;var _0x221bcd=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x41e17a=_0x3d99ff['html'][_0x1501('0x15')](_0x221bcd,'_SRC');var _0x326bf2=_0x41e17a[_0x1501('0x15')](_0xae39c2,_0x1501('0x1c'));for(let _0x2b1b95=0x0;_0x2b1b95<_0x4c7b94['length'];_0x2b1b95++){var _0x2ba1e2=_0x326bf2[_0x1501('0x15')](_0x1501('0x1c'),_0x1501('0x1d')+_0x4c7b94[_0x2b1b95]+'\x20]');_0x326bf2=_0x2ba1e2;}_0x3d99ff[_0x1501('0x14')]=_0x326bf2;}_0x29169d[_0x1501('0x1e')]=_0x3d99ff['html'];}else{_0x29169d[_0x1501('0x1e')]=_0x3d99ff[_0x1501('0x1f')];}if(_0x29169d[_0x1501('0x1e')]){_0x29169d[_0x1501('0x1e')]=_0x29169d[_0x1501('0x1e')][_0x1501('0x15')](/0x0){var _0x34e154=[_0x1501('0x2e'),_0x1501('0x2f'),'Precedence:\x20auto_reply'];for(var _0x13b5c6=0x0;_0x13b5c6<_0x3d99ff['headerLines'][_0x1501('0x12')];_0x13b5c6++){var _0x1aaaa=_[_0x1501('0x30')](_0x34e154,_0x3d99ff[_0x1501('0x2d')][_0x13b5c6][_0x1501('0x31')]);if(_0x1aaaa>=0x0){_0x29169d['isAutoreply']=!![];}}}return _0x29169d;}exports[_0x1501('0x32')]=function(_0x406ab4,_0x4b6c32,_0x3d1588){var _0x18fc09={'from':getAddress(_0x4b6c32[_0x1501('0x33')]),'firstName':getFirstName(_0x4b6c32[_0x1501('0x33')]),'lastName':getLastName(_0x4b6c32['from']),'mapKey':_0x1501('0x5'),'message':{'from':getMails(_0x406ab4[_0x1501('0x5')],_0x4b6c32[_0x1501('0x33')]),'to':_0x406ab4[_0x1501('0x5')],'cc':'','subject':_0x4b6c32[_0x1501('0x34')]||'','messageId':_0x4b6c32[_0x1501('0x35')],'inReplyTo':_0x4b6c32['inReplyTo'],'sentAt':moment(_0x4b6c32['date'])[_0x1501('0x27')](_0x1501('0x36')),'attach':![],'attachments':[]}};if(!_0x4b6c32[_0x1501('0x14')]&&!_0x4b6c32['textAsHtml']){var _0x13ad26=_[_0x1501('0x37')](_0x4b6c32[_0x1501('0x18')],{'contentType':'application/ms-tnef'});if(_0x13ad26[_0x1501('0x12')]){logger['info'](util[_0x1501('0x27')](_0x1501('0x38'),_0x4b6c32['messageId']));tnef[_0x1501('0x39')](_[_0x1501('0x3a')](_0x13ad26)[_0x1501('0x2c')],function(_0x2601e3,_0x315083){if(_0x315083){_0x4b6c32[_0x1501('0x14')]=_0x315083[_0x1501('0x3b')]||_0x1501('0x3c');if(_0x315083[_0x1501('0x3d')]){for(var _0x2341ad=0x0;_0x2341ad<_0x315083[_0x1501('0x3d')][_0x1501('0x12')];_0x2341ad++){var _0x3843dc=_0x315083[_0x1501('0x3d')][_0x2341ad];_0x18fc09[_0x1501('0x21')][_0x1501('0x18')][_0x1501('0x1a')]({'filename':_0x3843dc[_0x1501('0x3e')],'content':Buffer[_0x1501('0x33')](_0x3843dc[_0x1501('0x3f')])});}}}_0x3d1588(parseEmail(_0x406ab4,_0x4b6c32,_0x18fc09));});}else{_0x4b6c32['html']='

Empty\x20message

';_0x3d1588(parseEmail(_0x406ab4,_0x4b6c32,_0x18fc09));}}else{_0x3d1588(parseEmail(_0x406ab4,_0x4b6c32,_0x18fc09));}};exports[_0x1501('0x40')]=function(_0x21a219,_0x5d798f){var _0x26611d=[_0x1501('0x41')+(_0x5d798f||''),_0x1501('0x42')+_0x21a219,'',''];return Buffer[_0x1501('0x33')](_0x26611d['join'](''),_0x1501('0x43'))[_0x1501('0x44')](_0x1501('0x45'));}; \ No newline at end of file +var _0xc0d8=['parser','from','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','messageId','parseBuffer','first','BodyHTML','

Empty\x20message

','Attachments','push','Title','Data','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','base64','lodash','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','address','anonymous','generate','@xcally.com','value','name','substring','indexOf','split','slice','join','length','pop','html','test','replace','includes','attachments','forEach','filename','_SRC','_IMG','body','textAsHtml','0x1?_0xace6bd[_0x8c0d('0x12')](0x0,-0x1)[_0x8c0d('0x13')]('\x20'):_0x8eeb30['name'];}return'Anonymous';}function getLastName(_0x3dfd53){var _0x26c98d=_[_0x8c0d('0x8')](_0x3dfd53[_0x8c0d('0xd')]);if(_0x26c98d&&_0x26c98d[_0x8c0d('0xe')]){var _0x5a23f7=_0x26c98d[_0x8c0d('0xe')][_0x8c0d('0x11')](/\s+/);return _0x5a23f7[_0x8c0d('0x14')]>0x1?_0x5a23f7[_0x8c0d('0x15')]():'';}return'';}function getMails(_0x2a0c4d,_0x29b607){var _0x149a53='';for(var _0x5c7010=0x0;_0x5c7010<_0x29b607[_0x8c0d('0xd')][_0x8c0d('0x14')];_0x5c7010+=0x1){if(_0x29b607[_0x8c0d('0xd')][_0x5c7010][_0x8c0d('0x9')]!==_0x2a0c4d){if(!_['isEmpty'](_0x149a53)){_0x149a53+=',';}_0x149a53+=_0x29b607[_0x8c0d('0xd')][_0x5c7010]['name']||_0x29b607['value'][_0x5c7010][_0x8c0d('0x9')]||'';_0x149a53+='\x20<';_0x149a53+=_0x29b607[_0x8c0d('0xd')][_0x5c7010][_0x8c0d('0x9')]?_0x29b607[_0x8c0d('0xd')][_0x5c7010][_0x8c0d('0x9')]:'anonymous'+random[_0x8c0d('0xb')](0x6)+'@xcally.com';_0x149a53+='>';}}return _0x149a53;}function parseEmail(_0x477a04,_0x5bcba8,_0x2fa438){if(_0x5bcba8[_0x8c0d('0x16')]){var _0x5ef1fe=/)<[^<]*)*<\/script>/gi;while(_0x5ef1fe[_0x8c0d('0x17')](_0x5bcba8['html'])){_0x5bcba8[_0x8c0d('0x16')]=_0x5bcba8['html'][_0x8c0d('0x18')](_0x5ef1fe,'');}if(_0x5bcba8[_0x8c0d('0x16')][_0x8c0d('0x19')]('{_0x2d0453['push'](_0x1de905[_0x8c0d('0x1c')]);});var _0xe9e39=/]+>/g;var _0x42fa98=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0xec2d8a=_0x5bcba8[_0x8c0d('0x16')][_0x8c0d('0x18')](_0x42fa98,_0x8c0d('0x1d'));var _0x37b6e8=_0xec2d8a['replace'](_0xe9e39,_0x8c0d('0x1e'));for(let _0x1023f9=0x0;_0x1023f9<_0x2d0453[_0x8c0d('0x14')];_0x1023f9++){var _0x5ad555=_0x37b6e8[_0x8c0d('0x18')](_0x8c0d('0x1e'),'\x20[Attachment:\x20'+_0x2d0453[_0x1023f9]+'\x20]');_0x37b6e8=_0x5ad555;}_0x5bcba8['html']=_0x37b6e8;}_0x2fa438[_0x8c0d('0x1f')]=_0x5bcba8[_0x8c0d('0x16')];}else{_0x2fa438[_0x8c0d('0x1f')]=_0x5bcba8[_0x8c0d('0x20')];}if(_0x2fa438['body']){_0x2fa438[_0x8c0d('0x1f')]=_0x2fa438[_0x8c0d('0x1f')][_0x8c0d('0x18')](/0x0){var _0x4be502=[_0x8c0d('0x30'),'X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply'];for(var _0x2ad461=0x0;_0x2ad461<_0x5bcba8['headerLines'][_0x8c0d('0x14')];_0x2ad461++){var _0x24f93f=_[_0x8c0d('0x10')](_0x4be502,_0x5bcba8[_0x8c0d('0x2f')][_0x2ad461]['line']);if(_0x24f93f>=0x0){_0x2fa438[_0x8c0d('0x31')]=!![];}}}return _0x2fa438;}exports[_0x8c0d('0x32')]=function(_0x4bd5f2,_0x1b7965,_0x3143e0){var _0x4c0ab8={'from':getAddress(_0x1b7965[_0x8c0d('0x33')]),'firstName':getFirstName(_0x1b7965['from']),'lastName':getLastName(_0x1b7965['from']),'mapKey':_0x8c0d('0x6'),'message':{'from':getMails(_0x4bd5f2['email'],_0x1b7965[_0x8c0d('0x33')]),'to':_0x4bd5f2['email'],'cc':'','subject':_0x1b7965['subject']||'','messageId':_0x1b7965['messageId'],'inReplyTo':_0x1b7965[_0x8c0d('0x34')],'sentAt':moment(_0x1b7965[_0x8c0d('0x35')])[_0x8c0d('0x28')](_0x8c0d('0x36')),'attach':![],'attachments':[]}};if(!_0x1b7965[_0x8c0d('0x16')]&&!_0x1b7965[_0x8c0d('0x20')]){var _0x5ecf68=_[_0x8c0d('0x37')](_0x1b7965['attachments'],{'contentType':_0x8c0d('0x38')});if(_0x5ecf68[_0x8c0d('0x14')]){logger[_0x8c0d('0x39')](util['format'](_0x8c0d('0x3a'),_0x1b7965[_0x8c0d('0x3b')]));tnef[_0x8c0d('0x3c')](_[_0x8c0d('0x3d')](_0x5ecf68)[_0x8c0d('0x2d')],function(_0x49447e,_0x5fd46a){if(_0x5fd46a){_0x1b7965['html']=_0x5fd46a[_0x8c0d('0x3e')]||_0x8c0d('0x3f');if(_0x5fd46a['Attachments']){for(var _0x2a37b4=0x0;_0x2a37b4<_0x5fd46a['Attachments']['length'];_0x2a37b4++){var _0x361024=_0x5fd46a[_0x8c0d('0x40')][_0x2a37b4];_0x4c0ab8[_0x8c0d('0x22')]['attachments'][_0x8c0d('0x41')]({'filename':_0x361024[_0x8c0d('0x42')],'content':Buffer['from'](_0x361024[_0x8c0d('0x43')])});}}}_0x3143e0(parseEmail(_0x4bd5f2,_0x1b7965,_0x4c0ab8));});}else{_0x1b7965[_0x8c0d('0x16')]=_0x8c0d('0x3f');_0x3143e0(parseEmail(_0x4bd5f2,_0x1b7965,_0x4c0ab8));}}else{_0x3143e0(parseEmail(_0x4bd5f2,_0x1b7965,_0x4c0ab8));}};exports[_0x8c0d('0x44')]=function(_0x4d968b,_0x14f72f){var _0x356506=[_0x8c0d('0x45')+(_0x14f72f||''),_0x8c0d('0x46')+_0x4d968b,'',''];return Buffer[_0x8c0d('0x33')](_0x356506[_0x8c0d('0x13')](''),_0x8c0d('0x47'))[_0x8c0d('0x48')](_0x8c0d('0x49'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index e7ef7be..8a25eb9 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 _0x839d=['exports','name','Service','key','SERV','active','Imap','Smtp'];(function(_0x5af8f7,_0x1ef641){var _0x2be16b=function(_0x11140a){while(--_0x11140a){_0x5af8f7['push'](_0x5af8f7['shift']());}};_0x2be16b(++_0x1ef641);}(_0x839d,0xf9));var _0xd839=function(_0xe9feea,_0x103ee8){_0xe9feea=_0xe9feea-0x0;var _0x5d47d7=_0x839d[_0xe9feea];return _0x5d47d7;};'use strict';var _=require('lodash');function MailAccount(_0x2b72e3){this['id']=_0x2b72e3['id']||0x0;this[_0xd839('0x0')]=_0x2b72e3[_0xd839('0x0')]||_0xd839('0x1');this['key']=_0x2b72e3[_0xd839('0x2')]||_0xd839('0x3');this[_0xd839('0x4')]=_0x2b72e3[_0xd839('0x4')]||![];this['Imap']=_0x2b72e3[_0xd839('0x5')]||[];this[_0xd839('0x6')]=_0x2b72e3[_0xd839('0x6')]||[];}module[_0xd839('0x7')]=MailAccount; \ No newline at end of file +var _0xcd6d=['Smtp','exports','lodash','name','Service','key','SERV','active','Imap'];(function(_0x4b73a2,_0x40b5fe){var _0x383c66=function(_0x3917ae){while(--_0x3917ae){_0x4b73a2['push'](_0x4b73a2['shift']());}};_0x383c66(++_0x40b5fe);}(_0xcd6d,0xfe));var _0xdcd6=function(_0xa67aa3,_0x40dcf5){_0xa67aa3=_0xa67aa3-0x0;var _0x587841=_0xcd6d[_0xa67aa3];return _0x587841;};'use strict';var _=require(_0xdcd6('0x0'));function MailAccount(_0x1f1433){this['id']=_0x1f1433['id']||0x0;this[_0xdcd6('0x1')]=_0x1f1433[_0xdcd6('0x1')]||_0xdcd6('0x2');this[_0xdcd6('0x3')]=_0x1f1433['key']||_0xdcd6('0x4');this[_0xdcd6('0x5')]=_0x1f1433['active']||![];this['Imap']=_0x1f1433[_0xdcd6('0x6')]||[];this[_0xdcd6('0x7')]=_0x1f1433[_0xdcd6('0x7')]||[];}module[_0xdcd6('0x8')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 47a18e8..72f9d75 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 _0x35dd=['prototype','hasOwnProperty','initMailAccounts','length','isUndefined','merge','exports','lodash','../model/mailAccount','mailAccounts'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x35dd,0x89));var _0xd35d=function(_0x2133c7,_0x2c6140){_0x2133c7=_0x2133c7-0x0;var _0xfa1c63=_0x35dd[_0x2133c7];return _0xfa1c63;};'use strict';var _=require(_0xd35d('0x0'));var MailAccount=require(_0xd35d('0x1'));var Realtime=function(){this[_0xd35d('0x2')]={};};function freeIsNotKey(_0x57df72,_0x543f90,_0x5028a7){var _0x324a69=_['mapKeys'](_0x57df72,function(_0x3814e8,_0xfca3f8){return _0x3814e8[_0x5028a7];});for(var _0x3a07af in _0x543f90){if(_0x543f90['hasOwnProperty'](_0x3a07af)){if(!_0x324a69[_0x3a07af]){delete _0x543f90[_0x3a07af];}}}}Realtime[_0xd35d('0x3')]['mergeFromDatabase']=function(_0x45ddcb,_0x4851d6){for(var _0x1b4861 in _0x4851d6){if(_0x45ddcb[_0xd35d('0x4')](_0x1b4861)){_0x45ddcb[_0x1b4861]=_0x4851d6[_0x1b4861];}}};Realtime[_0xd35d('0x3')][_0xd35d('0x5')]=function(){var _0x4ea850=this;return function(_0x3b4583){if(_0x3b4583){freeIsNotKey(_0x3b4583,_0x4ea850[_0xd35d('0x2')],'id');for(var _0x28e58e=0x0,_0x19cfb6={},_0x5e0cfa={};_0x28e58e<_0x3b4583[_0xd35d('0x6')];_0x28e58e+=0x1){_0x19cfb6=_0x3b4583[_0x28e58e];if(_[_0xd35d('0x7')](_0x4ea850[_0xd35d('0x2')][_0x19cfb6['id']])){_0x4ea850[_0xd35d('0x2')][_0x19cfb6['id']]=new MailAccount(_0x19cfb6);}else{_[_0xd35d('0x8')](_0x4ea850[_0xd35d('0x2')][_0x19cfb6['id']],_0x19cfb6);}}}return _0x4ea850['mailAccounts'];};};module[_0xd35d('0x9')]=Realtime; \ No newline at end of file +var _0xc47f=['hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','length','isUndefined','merge','exports','lodash','../model/mailAccount','mailAccounts','mapKeys'];(function(_0x3f993e,_0x2d5757){var _0x39c135=function(_0x39e00b){while(--_0x39e00b){_0x3f993e['push'](_0x3f993e['shift']());}};_0x39c135(++_0x2d5757);}(_0xc47f,0x11c));var _0xfc47=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xc47f[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xfc47('0x0'));var MailAccount=require(_0xfc47('0x1'));var Realtime=function(){this[_0xfc47('0x2')]={};};function freeIsNotKey(_0x53c588,_0x3b64ad,_0x4fe3f4){var _0x5e926c=_[_0xfc47('0x3')](_0x53c588,function(_0x39b142,_0x5e0959){return _0x39b142[_0x4fe3f4];});for(var _0x39ee9d in _0x3b64ad){if(_0x3b64ad[_0xfc47('0x4')](_0x39ee9d)){if(!_0x5e926c[_0x39ee9d]){delete _0x3b64ad[_0x39ee9d];}}}}Realtime[_0xfc47('0x5')][_0xfc47('0x6')]=function(_0x4db5a0,_0xacb7bd){for(var _0x5ca9ca in _0xacb7bd){if(_0x4db5a0['hasOwnProperty'](_0x5ca9ca)){_0x4db5a0[_0x5ca9ca]=_0xacb7bd[_0x5ca9ca];}}};Realtime[_0xfc47('0x5')][_0xfc47('0x7')]=function(){var _0x59bf73=this;return function(_0x44549d){if(_0x44549d){freeIsNotKey(_0x44549d,_0x59bf73[_0xfc47('0x2')],'id');for(var _0xf9bcc8=0x0,_0x498fa9={},_0x3e2f32={};_0xf9bcc8<_0x44549d[_0xfc47('0x8')];_0xf9bcc8+=0x1){_0x498fa9=_0x44549d[_0xf9bcc8];if(_[_0xfc47('0x9')](_0x59bf73[_0xfc47('0x2')][_0x498fa9['id']])){_0x59bf73[_0xfc47('0x2')][_0x498fa9['id']]=new MailAccount(_0x498fa9);}else{_[_0xfc47('0xa')](_0x59bf73[_0xfc47('0x2')][_0x498fa9['id']],_0x498fa9);}}}return _0x59bf73['mailAccounts'];};};module[_0xfc47('0xb')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 16e5ac7..bc9476a 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 _0x0309=['GetMailAccount','name','service','email','ListId','CloudProvider','type','data5','MailServerOut','Smtp','getMailAccount','notify','NotifyMailAccount','../client','getMailAccounts','Request'];(function(_0x593d89,_0x45145f){var _0x4aa403=function(_0x21f674){while(--_0x21f674){_0x593d89['push'](_0x593d89['shift']());}};_0x4aa403(++_0x45145f);}(_0x0309,0x8d));var _0x9030=function(_0x1274ef,_0x2b4c48){_0x1274ef=_0x1274ef-0x0;var _0x602d36=_0x0309[_0x1274ef];return _0x602d36;};'use strict';var client=require(_0x9030('0x0'));exports[_0x9030('0x1')]=function(){return function(){return client[_0x9030('0x2')](_0x9030('0x3'),{'options':{'attributes':['id',_0x9030('0x4'),'provider',_0x9030('0x5'),_0x9030('0x6'),'active','key',_0x9030('0x7'),'TemplateId'],'raw':![],'include':[{'model':'MailServerIn','as':'Imap','include':[{'model':_0x9030('0x8'),'attributes':['id','name',_0x9030('0x5'),_0x9030('0x9'),_0x9030('0xa')],'as':_0x9030('0x8')}]},{'model':_0x9030('0xb'),'as':_0x9030('0xc'),'include':[{'model':_0x9030('0x8'),'attributes':['id',_0x9030('0x4'),_0x9030('0x5'),'type',_0x9030('0xa')],'as':'CloudProvider'}]}]},'log':_0x9030('0xd')});};};exports[_0x9030('0xe')]=function(_0x594ec9,_0x1edd17){return client['Request'](_0x9030('0xf'),{'account':{'id':_0x594ec9},'body':_0x1edd17,'log':'NotifyMailAccount'});}; \ No newline at end of file +var _0x2d2c=['TemplateId','MailServerIn','Imap','service','type','data5','CloudProvider','MailServerOut','Smtp','notify','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','name','provider','email','key','ListId'];(function(_0x5512d4,_0x1cdf72){var _0x107ea9=function(_0x2478da){while(--_0x2478da){_0x5512d4['push'](_0x5512d4['shift']());}};_0x107ea9(++_0x1cdf72);}(_0x2d2c,0x1d7));var _0xc2d2=function(_0x4c4042,_0x1ea485){_0x4c4042=_0x4c4042-0x0;var _0xbd10dc=_0x2d2c[_0x4c4042];return _0xbd10dc;};'use strict';var client=require(_0xc2d2('0x0'));exports[_0xc2d2('0x1')]=function(){return function(){return client[_0xc2d2('0x2')](_0xc2d2('0x3'),{'options':{'attributes':['id',_0xc2d2('0x4'),_0xc2d2('0x5'),'service',_0xc2d2('0x6'),'active',_0xc2d2('0x7'),_0xc2d2('0x8'),_0xc2d2('0x9')],'raw':![],'include':[{'model':_0xc2d2('0xa'),'as':_0xc2d2('0xb'),'include':[{'model':'CloudProvider','attributes':['id','name',_0xc2d2('0xc'),_0xc2d2('0xd'),_0xc2d2('0xe')],'as':_0xc2d2('0xf')}]},{'model':_0xc2d2('0x10'),'as':_0xc2d2('0x11'),'include':[{'model':_0xc2d2('0xf'),'attributes':['id',_0xc2d2('0x4'),_0xc2d2('0xc'),_0xc2d2('0xd'),_0xc2d2('0xe')],'as':_0xc2d2('0xf')}]}]},'log':'getMailAccount'});};};exports[_0xc2d2('0x12')]=function(_0x13a247,_0x1e0cbc){return client['Request'](_0xc2d2('0x13'),{'account':{'id':_0x13a247},'body':_0x1e0cbc,'log':_0xc2d2('0x13')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 0ca4eea..4586809 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 _0xd15b=['getSettings','Request','ShowSetting','loginMailFrequency','GetSettings','../client'];(function(_0x43917e,_0x271c04){var _0x306a9a=function(_0xe6917e){while(--_0xe6917e){_0x43917e['push'](_0x43917e['shift']());}};_0x306a9a(++_0x271c04);}(_0xd15b,0x15b));var _0xbd15=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd15b[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0xbd15('0x0'));exports[_0xbd15('0x1')]=function(){return client[_0xbd15('0x2')](_0xbd15('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xbd15('0x4')]},'log':_0xbd15('0x5')});}; \ No newline at end of file +var _0x54e8=['Request','ShowSetting','loginMailFrequency','GetSettings','getSettings'];(function(_0x3042c5,_0x36cb88){var _0x7cd140=function(_0x4cdcd8){while(--_0x4cdcd8){_0x3042c5['push'](_0x3042c5['shift']());}};_0x7cd140(++_0x36cb88);}(_0x54e8,0x1bc));var _0x854e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x54e8[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0x854e('0x0')]=function(){return client[_0x854e('0x1')](_0x854e('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x854e('0x3')]},'log':_0x854e('0x4')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 413548a..fb88d34 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'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 c936e79..af83731 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 _0x35dc=['socket.io','polling','redis','defaults','localhost','../../config/triggers','default','../../config/express','../../routes','listening','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port'];(function(_0x40ff75,_0x7040dd){var _0x46e629=function(_0x50c700){while(--_0x50c700){_0x40ff75['push'](_0x40ff75['shift']());}};_0x46e629(++_0x7040dd);}(_0x35dc,0x8a));var _0xc35d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x35dc[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xc35d('0x0'));var http=require(_0xc35d('0x1'));var express=require('express');var sticky=require(_0xc35d('0x2'));var Redis=require(_0xc35d('0x3'));var config=require(_0xc35d('0x4'));var app=express();var server=http[_0xc35d('0x5')](app);server[_0xc35d('0x6')]=0xdbba0;if(sticky[_0xc35d('0x7')](server,config[_0xc35d('0x8')])){var socketio=require(_0xc35d('0x9'))(server,{'transports':['websocket',_0xc35d('0xa')]});config[_0xc35d('0xb')]=_[_0xc35d('0xc')](config['redis'],{'host':_0xc35d('0xd'),'port':0x18eb});socketio['adapter'](require('socket.io-redis')({'pubClient':new Redis(config[_0xc35d('0xb')]),'subClient':new Redis(config[_0xc35d('0xb')])}));require(_0xc35d('0xe'))[_0xc35d('0xf')]();require('../../config/socketio')[_0xc35d('0xf')](socketio);require(_0xc35d('0x10'))[_0xc35d('0xf')](app);require(_0xc35d('0x11'))['default'](app);}else{server['once'](_0xc35d('0x12'),function(){console['log'](_0xc35d('0x13'),config['port']);});}exports=module[_0xc35d('0x14')]=app; \ No newline at end of file +var _0xa6c4=['sticky-session','ioredis','../../config/environment','createServer','listen','socket.io','polling','redis','defaults','adapter','../../config/triggers','../../config/socketio','default','../../config/express','../../routes','once','log','Express\x20server\x20listening\x20on\x20port\x20%d!','port','lodash','http','express'];(function(_0x4d4a74,_0x344a11){var _0x5491d8=function(_0x400056){while(--_0x400056){_0x4d4a74['push'](_0x4d4a74['shift']());}};_0x5491d8(++_0x344a11);}(_0xa6c4,0x15d));var _0x4a6c=function(_0x450689,_0x3b857c){_0x450689=_0x450689-0x0;var _0x46ffb0=_0xa6c4[_0x450689];return _0x46ffb0;};'use strict';var _=require(_0x4a6c('0x0'));var http=require(_0x4a6c('0x1'));var express=require(_0x4a6c('0x2'));var sticky=require(_0x4a6c('0x3'));var Redis=require(_0x4a6c('0x4'));var config=require(_0x4a6c('0x5'));var app=express();var server=http[_0x4a6c('0x6')](app);server['timeout']=0xdbba0;if(sticky[_0x4a6c('0x7')](server,config['port'])){var socketio=require(_0x4a6c('0x8'))(server,{'transports':['websocket',_0x4a6c('0x9')]});config[_0x4a6c('0xa')]=_[_0x4a6c('0xb')](config[_0x4a6c('0xa')],{'host':'localhost','port':0x18eb});socketio[_0x4a6c('0xc')](require('socket.io-redis')({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0x4a6c('0xa')])}));require(_0x4a6c('0xd'))['default']();require(_0x4a6c('0xe'))[_0x4a6c('0xf')](socketio);require(_0x4a6c('0x10'))[_0x4a6c('0xf')](app);require(_0x4a6c('0x11'))[_0x4a6c('0xf')](app);}else{server[_0x4a6c('0x12')]('listening',function(){console[_0x4a6c('0x13')](_0x4a6c('0x14'),config[_0x4a6c('0x15')]);});}exports=module['exports']=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 7e4a131..77e53e1 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 _0x11b6=['bluebird','../../config/logger','http','Request','request','then','routing','error','message','result','rpc'];(function(_0x400aac,_0x3af01c){var _0x8c3676=function(_0x537b24){while(--_0x537b24){_0x400aac['push'](_0x400aac['shift']());}};_0x8c3676(++_0x3af01c);}(_0x11b6,0x1c3));var _0x611b=function(_0x1a7d40,_0x27105c){_0x1a7d40=_0x1a7d40-0x0;var _0x408e7b=_0x11b6[_0x1a7d40];return _0x408e7b;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x611b('0x0'));var logger=require(_0x611b('0x1'))('routing');var client=jayson['client'][_0x611b('0x2')]({'port':0x2329});client[_0x611b('0x3')]=function(_0x4d99f2,_0x977b54){return new BPromise(function(_0xecfcb4,_0x5eef60){return client[_0x611b('0x4')](_0x4d99f2,_0x977b54)[_0x611b('0x5')](function(_0x2b5281){logger['debug']('rpc',_0x611b('0x6'),_0x4d99f2,_0x977b54,_0x2b5281);if(_0x2b5281[_0x611b('0x7')]){logger[_0x611b('0x7')]('rpc','routing',_0x4d99f2,_0x2b5281['error']['message'],_0x977b54);return _0x5eef60(_0x2b5281[_0x611b('0x7')][_0x611b('0x8')]);}else{return _0xecfcb4(_0x2b5281[_0x611b('0x9')]);}})['catch'](function(_0x4c3943){logger[_0x611b('0x7')](_0x611b('0xa'),_0x611b('0x6'),_0x4d99f2,_0x4c3943,_0x977b54);return _0x5eef60(_0x4c3943);});});};module['exports']=client; \ No newline at end of file +var _0x1138=['message','result','catch','jayson/promise','bluebird','../../config/logger','client','request','debug','routing','error','rpc'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x1138,0x18f));var _0x8113=function(_0x1cd5ee,_0x5741b3){_0x1cd5ee=_0x1cd5ee-0x0;var _0x4fce8f=_0x1138[_0x1cd5ee];return _0x4fce8f;};'use strict';var jayson=require(_0x8113('0x0'));var BPromise=require(_0x8113('0x1'));var logger=require(_0x8113('0x2'))('routing');var client=jayson[_0x8113('0x3')]['http']({'port':0x2329});client['Request']=function(_0x519e11,_0x426f77){return new BPromise(function(_0x5999f2,_0x5d6ce8){return client[_0x8113('0x4')](_0x519e11,_0x426f77)['then'](function(_0xc63dbb){logger[_0x8113('0x5')]('rpc',_0x8113('0x6'),_0x519e11,_0x426f77,_0xc63dbb);if(_0xc63dbb[_0x8113('0x7')]){logger[_0x8113('0x7')](_0x8113('0x8'),_0x8113('0x6'),_0x519e11,_0xc63dbb[_0x8113('0x7')][_0x8113('0x9')],_0x426f77);return _0x5d6ce8(_0xc63dbb[_0x8113('0x7')][_0x8113('0x9')]);}else{return _0x5999f2(_0xc63dbb[_0x8113('0xa')]);}})[_0x8113('0xb')](function(_0xce22cf){logger['error'](_0x8113('0x8'),_0x8113('0x6'),_0x519e11,_0xce22cf,_0x426f77);return _0x5d6ce8(_0xce22cf);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 2be00e9..1d60efd 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 _0x5046=['./rpc/openchannelQueue','./rpc/chatQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','then','getAgents','initAgents','getIntervals','initIntervals','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/interval'];(function(_0x5c8ef8,_0x476677){var _0x11534e=function(_0x3f8948){while(--_0x3f8948){_0x5c8ef8['push'](_0x5c8ef8['shift']());}};_0x11534e(++_0x476677);}(_0x5046,0x1ab));var _0x6504=function(_0x3e49a6,_0x231c8c){_0x3e49a6=_0x3e49a6-0x0;var _0x3c2e4e=_0x5046[_0x3e49a6];return _0x3c2e4e;};'use strict';var BPromise=require(_0x6504('0x0'));var server=require(_0x6504('0x1'));var Realtime=require(_0x6504('0x2'));var user=require(_0x6504('0x3'));var interval=require(_0x6504('0x4'));var openchannelQueue=require(_0x6504('0x5'));var chatQueue=require(_0x6504('0x6'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0x6504('0x7'));var faxQueue=require(_0x6504('0x8'));var whatsappQueue=require(_0x6504('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0x6504('0xa')](user[_0x6504('0xb')]())[_0x6504('0xa')](realtime[_0x6504('0xc')]())[_0x6504('0xa')](interval[_0x6504('0xd')]())['then'](realtime[_0x6504('0xe')]())['then'](openchannelQueue['getOpenchannelQueues']())['then'](realtime[_0x6504('0xf')]())[_0x6504('0xa')](chatQueue[_0x6504('0x10')]())['then'](realtime[_0x6504('0x11')]())['then'](smsQueue[_0x6504('0x12')]())[_0x6504('0xa')](realtime[_0x6504('0x13')]())[_0x6504('0xa')](mailQueue[_0x6504('0x14')]())[_0x6504('0xa')](realtime[_0x6504('0x15')]())[_0x6504('0xa')](faxQueue['getFaxQueues']())[_0x6504('0xa')](realtime['initFaxQueues']())[_0x6504('0xa')](whatsappQueue[_0x6504('0x16')]())[_0x6504('0xa')](realtime[_0x6504('0x17')]())[_0x6504('0xa')](function(){return realtime;});}function main(){return server[_0x6504('0x18')](realtime)[_0x6504('0xa')](function(_0x2fac63){return initRealtime();})[_0x6504('0xa')](function(_0x27c5c4){return setInterval(initRealtime,0x1388);})[_0x6504('0x19')](function(_0x220c40){console[_0x6504('0x1a')](_0x220c40);});}main(); \ No newline at end of file +var _0x2f75=['log','bluebird','./server','./realtime','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch'];(function(_0x433541,_0x113f79){var _0x1aa32b=function(_0x4c80de){while(--_0x4c80de){_0x433541['push'](_0x433541['shift']());}};_0x1aa32b(++_0x113f79);}(_0x2f75,0x187));var _0x52f7=function(_0x50ea98,_0x27af6f){_0x50ea98=_0x50ea98-0x0;var _0x31b8b8=_0x2f75[_0x50ea98];return _0x31b8b8;};'use strict';var BPromise=require(_0x52f7('0x0'));var server=require(_0x52f7('0x1'));var Realtime=require(_0x52f7('0x2'));var user=require('./rpc/user');var interval=require(_0x52f7('0x3'));var openchannelQueue=require(_0x52f7('0x4'));var chatQueue=require(_0x52f7('0x5'));var smsQueue=require(_0x52f7('0x6'));var mailQueue=require(_0x52f7('0x7'));var faxQueue=require(_0x52f7('0x8'));var whatsappQueue=require(_0x52f7('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x52f7('0xa')]()[_0x52f7('0xb')](user[_0x52f7('0xc')]())['then'](realtime[_0x52f7('0xd')]())[_0x52f7('0xb')](interval['getIntervals']())[_0x52f7('0xb')](realtime[_0x52f7('0xe')]())[_0x52f7('0xb')](openchannelQueue[_0x52f7('0xf')]())[_0x52f7('0xb')](realtime[_0x52f7('0x10')]())['then'](chatQueue[_0x52f7('0x11')]())[_0x52f7('0xb')](realtime[_0x52f7('0x12')]())['then'](smsQueue[_0x52f7('0x13')]())[_0x52f7('0xb')](realtime[_0x52f7('0x14')]())[_0x52f7('0xb')](mailQueue[_0x52f7('0x15')]())[_0x52f7('0xb')](realtime[_0x52f7('0x16')]())['then'](faxQueue[_0x52f7('0x17')]())[_0x52f7('0xb')](realtime[_0x52f7('0x18')]())['then'](whatsappQueue[_0x52f7('0x19')]())[_0x52f7('0xb')](realtime[_0x52f7('0x1a')]())[_0x52f7('0xb')](function(){return realtime;});}function main(){return server[_0x52f7('0x1b')](realtime)['then'](function(_0x5132c1){return initRealtime();})[_0x52f7('0xb')](function(_0x50dec1){return setInterval(initRealtime,0x1388);})[_0x52f7('0x1c')](function(_0x210128){console[_0x52f7('0x1d')](_0x210128);});}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 23cd579..adcfd9c 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 _0xc4aa=['ruleRef','name','nextTick','push','call','next','isEqual','restart','isNil','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','fromJSON','isString','parse','register','exports','lodash','util','events','EventEmitter','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','isObject','sync','filter','orderBy','asc','execute','result','clone','consequence'];(function(_0x50f471,_0x50671f){var _0x53e8f2=function(_0x2c0f99){while(--_0x2c0f99){_0x50f471['push'](_0x50f471['shift']());}};_0x53e8f2(++_0x50671f);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xc4aa[_0x45d55e];return _0x29812a;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var EventEmitter=require(_0xac4a('0x2'))[_0xac4a('0x3')];function RuleEngine(_0x275161,_0x22469d){this['init']();if(!_['isNil'](_0x275161)){this['register'](_0x275161);}if(_0x22469d){this[_0xac4a('0x4')]=_0x22469d[_0xac4a('0x4')];}return this;}util[_0xac4a('0x5')](RuleEngine,EventEmitter);RuleEngine[_0xac4a('0x6')][_0xac4a('0x7')]=function(_0x15cd34){this[_0xac4a('0x8')]=[];this[_0xac4a('0x9')]=[];};RuleEngine['prototype']['register']=function(_0x1aba6d){if(Array[_0xac4a('0xa')](_0x1aba6d)){this[_0xac4a('0x8')]=this['rules'][_0xac4a('0xb')](_0x1aba6d);}else if(_0x1aba6d!==null&&_[_0xac4a('0xc')](_0x1aba6d)){this[_0xac4a('0x8')]['push'](_0x1aba6d);}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0xd')]=function(){this['activeRules']=this[_0xac4a('0x8')][_0xac4a('0xe')](function(_0x24291d){if(_['isNil'](_0x24291d['on'])){_0x24291d['on']=!![];}if(_0x24291d['on']===!![]){return _0x24291d;}});this[_0xac4a('0x9')]=_[_0xac4a('0xf')](this[_0xac4a('0x9')],['p'],[_0xac4a('0x10')]);};RuleEngine[_0xac4a('0x6')][_0xac4a('0x11')]=function(_0x34bc01,_0x33c287){var _0x190418=![];_0x34bc01[_0xac4a('0x12')]=!![];var _0x11e101=_[_0xac4a('0x13')](_0x34bc01);var _0x4a2119=_[_0xac4a('0x13')](_0x34bc01);var _0x34d797=this[_0xac4a('0x9')];var _0x144553=[];var _0x3e88e3=this[_0xac4a('0x4')];(function FnRuleLoop(_0x28e304){var _0x44ec59={'rules':function(){return _0x34d797;},'rule':function(){return _0x34d797[_0x28e304];},'when':function(_0x546c5d){if(_0x546c5d){var _0x5ac21e=_0x34d797[_0x28e304][_0xac4a('0x14')];_0x5ac21e[_0xac4a('0x15')]=_0x34d797[_0x28e304]['id']||_0x34d797[_0x28e304][_0xac4a('0x16')]||'index_'+_0x28e304;process[_0xac4a('0x17')](function(){_0x144553[_0xac4a('0x18')](_0x5ac21e[_0xac4a('0x15')]);_0x5ac21e[_0xac4a('0x19')](_0x11e101,_0x44ec59);});}else{process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1a')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190418=!![];return FnRuleLoop(0x0);},'next':function(_0xe38996){if(!_0x3e88e3&&!_[_0xac4a('0x1b')](_0x4a2119,_0x11e101)){_0x4a2119=_['clone'](_0x11e101);process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1c')]();});}else{process['nextTick'](function(){if(_[_0xac4a('0x1d')](_0xe38996)){return FnRuleLoop(_0x28e304+0x1);}else{return FnRuleLoop(_0xe38996);}});}}};if(_0x28e304<_0x34d797[_0xac4a('0x1e')]&&_0x190418===![]){var _0x3eacd3=_0x34d797[_0x28e304][_0xac4a('0x1f')];_0x3eacd3['call'](_0x11e101,_0x44ec59);}else{process[_0xac4a('0x17')](function(){_0x11e101[_0xac4a('0x20')]=_0x144553;return _0x33c287?_0x33c287(_0x11e101):_[_0xac4a('0x21')]();});}}(0x0));};RuleEngine[_0xac4a('0x6')][_0xac4a('0x22')]=function(_0x2b0dc2){if(_[_0xac4a('0x1d')](_0x2b0dc2)){return this[_0xac4a('0x8')];}else{var _0x3e2c69=_[_0xac4a('0x23')](_0x2b0dc2);return _[_0xac4a('0xe')](this[_0xac4a('0x8')],_0x3e2c69);}};RuleEngine[_0xac4a('0x6')][_0xac4a('0x24')]=function(_0x1c13dc,_0x20202c){var _0x4e17ce=_0x1c13dc==='on'||_0x1c13dc==='ON'?!![]:![];var _0x23b061=this[_0xac4a('0x22')](_0x20202c);for(var _0x42a33c=0x0,_0x2772fe=_0x23b061[_0xac4a('0x1e')];_0x42a33c<_0x2772fe;_0x42a33c+=0x1){_0x23b061[_0x42a33c]['on']=_0x4e17ce;}this['sync']();};RuleEngine['prototype'][_0xac4a('0x25')]=function(_0x7a948b,_0x1f12d5){_0x7a948b=parseInt(_0x7a948b,0xa);var _0x546b65=this['findRules'](_0x1f12d5);for(var _0x355755=0x0,_0x2896bc=_0x546b65[_0xac4a('0x1e')];_0x355755<_0x2896bc;_0x355755+=0x1){_0x546b65[_0x355755][_0xac4a('0x26')]=_0x7a948b;}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0x27')]=function(){var _0x482afc=this[_0xac4a('0x8')];if(_0x482afc instanceof Array){_0x482afc=_0x482afc['map'](function(_0x17e6de){_0x17e6de[_0xac4a('0x1f')]=_0x17e6de[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x17e6de[_0xac4a('0x14')]=_0x17e6de[_0xac4a('0x14')][_0xac4a('0x28')]();return _0x17e6de;});}else if(!_[_0xac4a('0x1d')](_0x482afc)){_0x482afc[_0xac4a('0x1f')]=_0x482afc[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x482afc[_0xac4a('0x14')]=_0x482afc[_0xac4a('0x14')][_0xac4a('0x28')]();}return _0x482afc;};RuleEngine['prototype'][_0xac4a('0x29')]=function(_0x1c41fb){this['init']();if(_[_0xac4a('0x2a')](_0x1c41fb)){_0x1c41fb=JSON[_0xac4a('0x2b')](_0x1c41fb);}if(_0x1c41fb instanceof Array){_0x1c41fb=_0x1c41fb['map'](function(_0x58804b){_0x58804b[_0xac4a('0x1f')]=eval('('+_0x58804b[_0xac4a('0x1f')]+')');_0x58804b[_0xac4a('0x14')]=eval('('+_0x58804b[_0xac4a('0x14')]+')');return _0x58804b;});}else if(_0x1c41fb!==null&&typeof _0x1c41fb=='object'){_0x1c41fb[_0xac4a('0x1f')]=eval('('+_0x1c41fb[_0xac4a('0x1f')]+')');_0x1c41fb['consequence']=eval('('+_0x1c41fb[_0xac4a('0x14')]+')');}this[_0xac4a('0x2c')](_0x1c41fb);};module[_0xac4a('0x2d')]=RuleEngine; \ No newline at end of file +var _0xc4aa=['ruleRef','name','nextTick','push','call','next','isEqual','restart','isNil','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','fromJSON','isString','parse','register','exports','lodash','util','events','EventEmitter','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','isObject','sync','filter','orderBy','asc','execute','result','clone','consequence'];(function(_0x4c9fa7,_0xdd2863){var _0x5c8182=function(_0x5303f3){while(--_0x5303f3){_0x4c9fa7['push'](_0x4c9fa7['shift']());}};_0x5c8182(++_0xdd2863);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xc4aa[_0x3511d3];return _0x5d6321;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var EventEmitter=require(_0xac4a('0x2'))[_0xac4a('0x3')];function RuleEngine(_0x275161,_0x22469d){this['init']();if(!_['isNil'](_0x275161)){this['register'](_0x275161);}if(_0x22469d){this[_0xac4a('0x4')]=_0x22469d[_0xac4a('0x4')];}return this;}util[_0xac4a('0x5')](RuleEngine,EventEmitter);RuleEngine[_0xac4a('0x6')][_0xac4a('0x7')]=function(_0x15cd34){this[_0xac4a('0x8')]=[];this[_0xac4a('0x9')]=[];};RuleEngine['prototype']['register']=function(_0x1aba6d){if(Array[_0xac4a('0xa')](_0x1aba6d)){this[_0xac4a('0x8')]=this['rules'][_0xac4a('0xb')](_0x1aba6d);}else if(_0x1aba6d!==null&&_[_0xac4a('0xc')](_0x1aba6d)){this[_0xac4a('0x8')]['push'](_0x1aba6d);}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0xd')]=function(){this['activeRules']=this[_0xac4a('0x8')][_0xac4a('0xe')](function(_0x24291d){if(_['isNil'](_0x24291d['on'])){_0x24291d['on']=!![];}if(_0x24291d['on']===!![]){return _0x24291d;}});this[_0xac4a('0x9')]=_[_0xac4a('0xf')](this[_0xac4a('0x9')],['p'],[_0xac4a('0x10')]);};RuleEngine[_0xac4a('0x6')][_0xac4a('0x11')]=function(_0x34bc01,_0x33c287){var _0x190418=![];_0x34bc01[_0xac4a('0x12')]=!![];var _0x11e101=_[_0xac4a('0x13')](_0x34bc01);var _0x4a2119=_[_0xac4a('0x13')](_0x34bc01);var _0x34d797=this[_0xac4a('0x9')];var _0x144553=[];var _0x3e88e3=this[_0xac4a('0x4')];(function FnRuleLoop(_0x28e304){var _0x44ec59={'rules':function(){return _0x34d797;},'rule':function(){return _0x34d797[_0x28e304];},'when':function(_0x546c5d){if(_0x546c5d){var _0x5ac21e=_0x34d797[_0x28e304][_0xac4a('0x14')];_0x5ac21e[_0xac4a('0x15')]=_0x34d797[_0x28e304]['id']||_0x34d797[_0x28e304][_0xac4a('0x16')]||'index_'+_0x28e304;process[_0xac4a('0x17')](function(){_0x144553[_0xac4a('0x18')](_0x5ac21e[_0xac4a('0x15')]);_0x5ac21e[_0xac4a('0x19')](_0x11e101,_0x44ec59);});}else{process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1a')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190418=!![];return FnRuleLoop(0x0);},'next':function(_0xe38996){if(!_0x3e88e3&&!_[_0xac4a('0x1b')](_0x4a2119,_0x11e101)){_0x4a2119=_['clone'](_0x11e101);process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1c')]();});}else{process['nextTick'](function(){if(_[_0xac4a('0x1d')](_0xe38996)){return FnRuleLoop(_0x28e304+0x1);}else{return FnRuleLoop(_0xe38996);}});}}};if(_0x28e304<_0x34d797[_0xac4a('0x1e')]&&_0x190418===![]){var _0x3eacd3=_0x34d797[_0x28e304][_0xac4a('0x1f')];_0x3eacd3['call'](_0x11e101,_0x44ec59);}else{process[_0xac4a('0x17')](function(){_0x11e101[_0xac4a('0x20')]=_0x144553;return _0x33c287?_0x33c287(_0x11e101):_[_0xac4a('0x21')]();});}}(0x0));};RuleEngine[_0xac4a('0x6')][_0xac4a('0x22')]=function(_0x2b0dc2){if(_[_0xac4a('0x1d')](_0x2b0dc2)){return this[_0xac4a('0x8')];}else{var _0x3e2c69=_[_0xac4a('0x23')](_0x2b0dc2);return _[_0xac4a('0xe')](this[_0xac4a('0x8')],_0x3e2c69);}};RuleEngine[_0xac4a('0x6')][_0xac4a('0x24')]=function(_0x1c13dc,_0x20202c){var _0x4e17ce=_0x1c13dc==='on'||_0x1c13dc==='ON'?!![]:![];var _0x23b061=this[_0xac4a('0x22')](_0x20202c);for(var _0x42a33c=0x0,_0x2772fe=_0x23b061[_0xac4a('0x1e')];_0x42a33c<_0x2772fe;_0x42a33c+=0x1){_0x23b061[_0x42a33c]['on']=_0x4e17ce;}this['sync']();};RuleEngine['prototype'][_0xac4a('0x25')]=function(_0x7a948b,_0x1f12d5){_0x7a948b=parseInt(_0x7a948b,0xa);var _0x546b65=this['findRules'](_0x1f12d5);for(var _0x355755=0x0,_0x2896bc=_0x546b65[_0xac4a('0x1e')];_0x355755<_0x2896bc;_0x355755+=0x1){_0x546b65[_0x355755][_0xac4a('0x26')]=_0x7a948b;}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0x27')]=function(){var _0x482afc=this[_0xac4a('0x8')];if(_0x482afc instanceof Array){_0x482afc=_0x482afc['map'](function(_0x17e6de){_0x17e6de[_0xac4a('0x1f')]=_0x17e6de[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x17e6de[_0xac4a('0x14')]=_0x17e6de[_0xac4a('0x14')][_0xac4a('0x28')]();return _0x17e6de;});}else if(!_[_0xac4a('0x1d')](_0x482afc)){_0x482afc[_0xac4a('0x1f')]=_0x482afc[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x482afc[_0xac4a('0x14')]=_0x482afc[_0xac4a('0x14')][_0xac4a('0x28')]();}return _0x482afc;};RuleEngine['prototype'][_0xac4a('0x29')]=function(_0x1c41fb){this['init']();if(_[_0xac4a('0x2a')](_0x1c41fb)){_0x1c41fb=JSON[_0xac4a('0x2b')](_0x1c41fb);}if(_0x1c41fb instanceof Array){_0x1c41fb=_0x1c41fb['map'](function(_0x58804b){_0x58804b[_0xac4a('0x1f')]=eval('('+_0x58804b[_0xac4a('0x1f')]+')');_0x58804b[_0xac4a('0x14')]=eval('('+_0x58804b[_0xac4a('0x14')]+')');return _0x58804b;});}else if(_0x1c41fb!==null&&typeof _0x1c41fb=='object'){_0x1c41fb[_0xac4a('0x1f')]=eval('('+_0x1c41fb[_0xac4a('0x1f')]+')');_0x1c41fb['consequence']=eval('('+_0x1c41fb[_0xac4a('0x14')]+')');}this[_0xac4a('0x2c')](_0x1c41fb);};module[_0xac4a('0x2d')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 0e8c20a..2bcb1bd 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 _0xfc71=['catch','sendMailMessage','SendMail','bluebird','http','request','then','error','message','result'];(function(_0x4c9b52,_0x4aaeb5){var _0x38b92e=function(_0x54ce19){while(--_0x54ce19){_0x4c9b52['push'](_0x4c9b52['shift']());}};_0x38b92e(++_0x4aaeb5);}(_0xfc71,0xf3));var _0x1fc7=function(_0x2f0057,_0x448b27){_0x2f0057=_0x2f0057-0x0;var _0x17f2c3=_0xfc71[_0x2f0057];return _0x17f2c3;};'use strict';var BPromise=require(_0x1fc7('0x0'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1fc7('0x1')]({'port':0x232b});function request(_0x25c611,_0x47b7d6){return new BPromise(function(_0x5c3064,_0x297720){return client[_0x1fc7('0x2')](_0x25c611,_0x47b7d6)[_0x1fc7('0x3')](function(_0x17e59e){if(_0x17e59e[_0x1fc7('0x4')]){return _0x297720(_0x17e59e[_0x1fc7('0x4')][_0x1fc7('0x5')]);}else{return _0x5c3064(_0x17e59e[_0x1fc7('0x6')]);}})[_0x1fc7('0x7')](function(_0x121a5b){return _0x297720(_0x121a5b);});});}exports[_0x1fc7('0x8')]=function(_0x48364b,_0x28086a){return request(_0x1fc7('0x9'),{'account':_0x48364b,'message':_0x28086a});}; \ No newline at end of file +var _0x3a28=['catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message'];(function(_0x5199e4,_0x5bb4f9){var _0x2a78d0=function(_0x41b465){while(--_0x41b465){_0x5199e4['push'](_0x5199e4['shift']());}};_0x2a78d0(++_0x5bb4f9);}(_0x3a28,0x1a7));var _0x83a2=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x3a28[_0x1969a7];return _0x3d665f;};'use strict';var BPromise=require(_0x83a2('0x0'));var jayson=require(_0x83a2('0x1'));var client=jayson[_0x83a2('0x2')][_0x83a2('0x3')]({'port':0x232b});function request(_0x97ee90,_0x1cdb96){return new BPromise(function(_0x314391,_0x50ec7b){return client[_0x83a2('0x4')](_0x97ee90,_0x1cdb96)['then'](function(_0x58eb77){if(_0x58eb77['error']){return _0x50ec7b(_0x58eb77[_0x83a2('0x5')][_0x83a2('0x6')]);}else{return _0x314391(_0x58eb77['result']);}})[_0x83a2('0x7')](function(_0xc415d8){return _0x50ec7b(_0xc415d8);});});}exports[_0x83a2('0x8')]=function(_0x3c50e7,_0xb6d37c){return request(_0x83a2('0x9'),{'account':_0x3c50e7,'message':_0xb6d37c});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 71e6c56..1c91c3e 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 _0x9e53=['lodash','md5','moment','ioredis','../../../config/environment','redis','defaults','localhost','name','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown','chatStatusTime','chatCapacity','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','openchannelStatus','openchannelCurrentCapacity','busy','busyQueue','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','whatsappWaitingInteractions','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','openchannel','fax','whatsapp','length','StatusTime','toNumber','format','Status','chatStatus','chatCurrentCapacity','mailStatusTime','faxCurrentCapacity','smsStatusTime','whatsappCurrentCapacity','openchannelStatusTime','smsWaitingInteractions','stringify','emit','user:routing:update','omit','online','exports'];(function(_0x2d3246,_0x168d75){var _0x193d46=function(_0x496b93){while(--_0x496b93){_0x2d3246['push'](_0x2d3246['shift']());}};_0x193d46(++_0x168d75);}(_0x9e53,0x14a));var _0x39e5=function(_0x264b61,_0x4a5017){_0x264b61=_0x264b61-0x0;var _0x8fff4f=_0x9e53[_0x264b61];return _0x8fff4f;};'use strict';var _=require(_0x39e5('0x0'));var md5=require(_0x39e5('0x1'));var moment=require(_0x39e5('0x2'));var Redis=require(_0x39e5('0x3'));var config=require(_0x39e5('0x4'));config[_0x39e5('0x5')]=_[_0x39e5('0x6')](config[_0x39e5('0x5')],{'host':_0x39e5('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function Agent(_0x51b950){this['id']=_0x51b950['id']||0x0;this[_0x39e5('0x8')]=_0x51b950[_0x39e5('0x8')]||'';this[_0x39e5('0x9')]=_0x51b950['voicePause']||![];this[_0x39e5('0xa')]=_0x51b950[_0x39e5('0xa')]||![];this[_0x39e5('0xb')]=_0x51b950[_0x39e5('0xb')]||![];this['faxPause']=_0x51b950[_0x39e5('0xc')]||![];this[_0x39e5('0xd')]=_0x51b950[_0x39e5('0xd')]||![];this[_0x39e5('0xe')]=_0x51b950[_0x39e5('0xe')]||![];this['chatStatus']=_0x39e5('0xf');this[_0x39e5('0x10')]=0x0;this[_0x39e5('0x11')]=_0x51b950['chatCapacity']||0x0;this['chatCurrentCapacity']=0x0;this['mailStatus']=_0x39e5('0xf');this['mailStatusTime']=0x0;this['mailCapacity']=_0x51b950[_0x39e5('0x12')]||0x0;this[_0x39e5('0x13')]=0x0;this[_0x39e5('0x14')]=_0x39e5('0xf');this[_0x39e5('0x15')]=0x0;this['faxCapacity']=_0x51b950[_0x39e5('0x16')]||0x0;this['faxCurrentCapacity']=0x0;this[_0x39e5('0x17')]='unknown';this['smsStatusTime']=0x0;this[_0x39e5('0x18')]=_0x51b950[_0x39e5('0x18')]||0x0;this[_0x39e5('0x19')]=0x0;this[_0x39e5('0x1a')]=_0x39e5('0xf');this[_0x39e5('0x1b')]=0x0;this[_0x39e5('0x1c')]=_0x51b950[_0x39e5('0x1c')]||0x0;this['whatsappCurrentCapacity']=0x0;this[_0x39e5('0x1d')]=_0x39e5('0xf');this['openchannelStatusTime']=0x0;this['openchannelCapacity']=_0x51b950['openchannelCapacity']||0x0;this[_0x39e5('0x1e')]=0x0;this[_0x39e5('0x1f')]=![];this[_0x39e5('0x20')]=undefined;this[_0x39e5('0x1')]='';this[_0x39e5('0x21')]={};this[_0x39e5('0x22')]={};this[_0x39e5('0x23')]={};this[_0x39e5('0x24')]={};this['smsWaitingInteractions']={};this[_0x39e5('0x25')]={};this[_0x39e5('0x26')]();}Agent[_0x39e5('0x27')][_0x39e5('0x28')]=function(_0x31f777){if(this[_0x31f777+_0x39e5('0x29')]>0x0){if(this[_0x31f777+'Capacity']>0x0&&this[_0x31f777+_0x39e5('0x29')]>=this[_0x31f777+_0x39e5('0x2a')]){return _0x39e5('0x2b');}else{return'working';}}else{return'idle';}};Agent[_0x39e5('0x27')][_0x39e5('0x26')]=function(){var _0x13207f=['mail','chat',_0x39e5('0x2c'),_0x39e5('0x2d'),'sms',_0x39e5('0x2e')];for(var _0x5378e4=0x0;_0x5378e4<_0x13207f[_0x39e5('0x2f')];_0x5378e4+=0x1){var _0x5b4d78=this[_0x39e5('0x28')](_0x13207f[_0x5378e4]);if(this[_0x13207f[_0x5378e4]+'Status']!==_0x5b4d78){this[_0x13207f[_0x5378e4]+_0x39e5('0x30')]=_[_0x39e5('0x31')](moment()[_0x39e5('0x32')]('x'));}this[_0x13207f[_0x5378e4]+_0x39e5('0x33')]=_0x5b4d78;}var _0x3d7f69={'id':this['id'],'name':this[_0x39e5('0x8')],'online':this['online'],'voicePause':this[_0x39e5('0x9')],'chatPause':this['chatPause'],'mailPause':this['mailPause'],'smsPause':this[_0x39e5('0xd')],'faxPause':this['faxPause'],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x39e5('0x34')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x39e5('0x11')],'chatCurrentCapacity':this[_0x39e5('0x35')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0x39e5('0x36')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0x39e5('0x13')],'faxStatus':this[_0x39e5('0x14')],'faxStatusTime':this[_0x39e5('0x15')],'faxCapacity':this[_0x39e5('0x16')],'faxCurrentCapacity':this[_0x39e5('0x37')],'smsStatus':this[_0x39e5('0x17')],'smsStatusTime':this[_0x39e5('0x38')],'smsCapacity':this[_0x39e5('0x18')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0x39e5('0x1a')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0x39e5('0x1c')],'whatsappCurrentCapacity':this[_0x39e5('0x39')],'openchannelStatus':this[_0x39e5('0x1d')],'openchannelStatusTime':this[_0x39e5('0x3a')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0x39e5('0x1f')],'busyQueue':this[_0x39e5('0x20')],'chatWaitingInteractions':this[_0x39e5('0x21')],'faxWaitingInteractions':this[_0x39e5('0x22')],'mailWaitingInteractions':this[_0x39e5('0x23')],'openchannelWaitingInteractions':this[_0x39e5('0x24')],'smsWaitingInteractions':this[_0x39e5('0x3b')],'whatsappWaitingInteractions':this[_0x39e5('0x25')]};var _0x3e83c0=md5(JSON[_0x39e5('0x3c')](_0x3d7f69));if(this[_0x39e5('0x1')]!==_0x3e83c0){this[_0x39e5('0x1')]=_0x3e83c0;io[_0x39e5('0x3d')](_0x39e5('0x3e'),_[_0x39e5('0x3f')](_0x3d7f69,[_0x39e5('0x40')]));}};module[_0x39e5('0x41')]=Agent; \ No newline at end of file +var _0x8c8b=['name','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','chatCapacity','chatCurrentCapacity','unknown','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','smsStatus','smsCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','busy','busyQueue','chatWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','updateRealtime','prototype','CurrentCapacity','Capacity','maxcapacity','working','idle','mail','chat','fax','sms','whatsapp','getChannelStatus','Status','StatusTime','format','online','chatStatusTime','faxCurrentCapacity','smsCurrentCapacity','whatsappWaitingInteractions','stringify','emit','omit','exports','md5','moment','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter'];(function(_0x58c58d,_0x427c97){var _0x194b21=function(_0x1e2fde){while(--_0x1e2fde){_0x58c58d['push'](_0x58c58d['shift']());}};_0x194b21(++_0x427c97);}(_0x8c8b,0xb8));var _0xb8c8=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x8c8b[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var md5=require(_0xb8c8('0x0'));var moment=require(_0xb8c8('0x1'));var Redis=require(_0xb8c8('0x2'));var config=require(_0xb8c8('0x3'));config[_0xb8c8('0x4')]=_[_0xb8c8('0x5')](config[_0xb8c8('0x4')],{'host':_0xb8c8('0x6'),'port':0x18eb});var io=require(_0xb8c8('0x7'))(new Redis(config[_0xb8c8('0x4')]));function Agent(_0x52b3d1){this['id']=_0x52b3d1['id']||0x0;this[_0xb8c8('0x8')]=_0x52b3d1[_0xb8c8('0x8')]||'';this['voicePause']=_0x52b3d1[_0xb8c8('0x9')]||![];this[_0xb8c8('0xa')]=_0x52b3d1[_0xb8c8('0xa')]||![];this[_0xb8c8('0xb')]=_0x52b3d1[_0xb8c8('0xb')]||![];this[_0xb8c8('0xc')]=_0x52b3d1[_0xb8c8('0xc')]||![];this['smsPause']=_0x52b3d1[_0xb8c8('0xd')]||![];this[_0xb8c8('0xe')]=_0x52b3d1[_0xb8c8('0xe')]||![];this[_0xb8c8('0xf')]='unknown';this['chatStatusTime']=0x0;this[_0xb8c8('0x10')]=_0x52b3d1['chatCapacity']||0x0;this[_0xb8c8('0x11')]=0x0;this['mailStatus']=_0xb8c8('0x12');this[_0xb8c8('0x13')]=0x0;this['mailCapacity']=_0x52b3d1[_0xb8c8('0x14')]||0x0;this[_0xb8c8('0x15')]=0x0;this[_0xb8c8('0x16')]=_0xb8c8('0x12');this[_0xb8c8('0x17')]=0x0;this[_0xb8c8('0x18')]=_0x52b3d1['faxCapacity']||0x0;this['faxCurrentCapacity']=0x0;this[_0xb8c8('0x19')]=_0xb8c8('0x12');this['smsStatusTime']=0x0;this[_0xb8c8('0x1a')]=_0x52b3d1['smsCapacity']||0x0;this['smsCurrentCapacity']=0x0;this[_0xb8c8('0x1b')]=_0xb8c8('0x12');this[_0xb8c8('0x1c')]=0x0;this['whatsappCapacity']=_0x52b3d1[_0xb8c8('0x1d')]||0x0;this[_0xb8c8('0x1e')]=0x0;this[_0xb8c8('0x1f')]=_0xb8c8('0x12');this[_0xb8c8('0x20')]=0x0;this[_0xb8c8('0x21')]=_0x52b3d1['openchannelCapacity']||0x0;this['openchannelCurrentCapacity']=0x0;this[_0xb8c8('0x22')]=![];this[_0xb8c8('0x23')]=undefined;this['md5']='';this[_0xb8c8('0x24')]={};this['faxWaitingInteractions']={};this[_0xb8c8('0x25')]={};this[_0xb8c8('0x26')]={};this['smsWaitingInteractions']={};this['whatsappWaitingInteractions']={};this[_0xb8c8('0x27')]();}Agent[_0xb8c8('0x28')]['getChannelStatus']=function(_0x4e7081){if(this[_0x4e7081+_0xb8c8('0x29')]>0x0){if(this[_0x4e7081+_0xb8c8('0x2a')]>0x0&&this[_0x4e7081+'CurrentCapacity']>=this[_0x4e7081+_0xb8c8('0x2a')]){return _0xb8c8('0x2b');}else{return _0xb8c8('0x2c');}}else{return _0xb8c8('0x2d');}};Agent['prototype'][_0xb8c8('0x27')]=function(){var _0x556b21=[_0xb8c8('0x2e'),_0xb8c8('0x2f'),'openchannel',_0xb8c8('0x30'),_0xb8c8('0x31'),_0xb8c8('0x32')];for(var _0x25337e=0x0;_0x25337e<_0x556b21['length'];_0x25337e+=0x1){var _0x58a421=this[_0xb8c8('0x33')](_0x556b21[_0x25337e]);if(this[_0x556b21[_0x25337e]+_0xb8c8('0x34')]!==_0x58a421){this[_0x556b21[_0x25337e]+_0xb8c8('0x35')]=_['toNumber'](moment()[_0xb8c8('0x36')]('x'));}this[_0x556b21[_0x25337e]+_0xb8c8('0x34')]=_0x58a421;}var _0x1c834b={'id':this['id'],'name':this[_0xb8c8('0x8')],'online':this[_0xb8c8('0x37')],'voicePause':this[_0xb8c8('0x9')],'chatPause':this[_0xb8c8('0xa')],'mailPause':this[_0xb8c8('0xb')],'smsPause':this['smsPause'],'faxPause':this['faxPause'],'openchannelPause':this[_0xb8c8('0xe')],'chatStatus':this[_0xb8c8('0xf')],'chatStatusTime':this[_0xb8c8('0x38')],'chatCapacity':this[_0xb8c8('0x10')],'chatCurrentCapacity':this[_0xb8c8('0x11')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0xb8c8('0x13')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0xb8c8('0x16')],'faxStatusTime':this[_0xb8c8('0x17')],'faxCapacity':this[_0xb8c8('0x18')],'faxCurrentCapacity':this[_0xb8c8('0x39')],'smsStatus':this['smsStatus'],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0xb8c8('0x1a')],'smsCurrentCapacity':this[_0xb8c8('0x3a')],'whatsappStatus':this[_0xb8c8('0x1b')],'whatsappStatusTime':this[_0xb8c8('0x1c')],'whatsappCapacity':this[_0xb8c8('0x1d')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0xb8c8('0x1f')],'openchannelStatusTime':this[_0xb8c8('0x20')],'openchannelCapacity':this[_0xb8c8('0x21')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0xb8c8('0x22')],'busyQueue':this[_0xb8c8('0x23')],'chatWaitingInteractions':this[_0xb8c8('0x24')],'faxWaitingInteractions':this['faxWaitingInteractions'],'mailWaitingInteractions':this[_0xb8c8('0x25')],'openchannelWaitingInteractions':this[_0xb8c8('0x26')],'smsWaitingInteractions':this['smsWaitingInteractions'],'whatsappWaitingInteractions':this[_0xb8c8('0x3b')]};var _0x3ae30e=md5(JSON[_0xb8c8('0x3c')](_0x1c834b));if(this[_0xb8c8('0x0')]!==_0x3ae30e){this[_0xb8c8('0x0')]=_0x3ae30e;io[_0xb8c8('0x3d')]('user:routing:update',_[_0xb8c8('0x3e')](_0x1c834b,['online']));}};module[_0xb8c8('0x3f')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 9c9f062..17edf8d 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 _0xdf44=['updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','length','online','loggedIn','chatPause','paused','available','format','chat:queue:%s','chat_queue:save','exports','lodash','md5','util','../../../config/environment','defaults','redis','localhost','name','strategy','beepall','Agents','waiting'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xdf44,0x160));var _0x4df4=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xdf44[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x4df4('0x0'));var md5=require(_0x4df4('0x1'));var util=require(_0x4df4('0x2'));var Redis=require('ioredis');var config=require(_0x4df4('0x3'));config['redis']=_[_0x4df4('0x4')](config[_0x4df4('0x5')],{'host':_0x4df4('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4df4('0x5')]));function ChatQueue(_0x39a8e1){this['id']=_0x39a8e1['id']||0x0;this[_0x4df4('0x7')]=_0x39a8e1[_0x4df4('0x7')]||'';this['timeout']=_0x39a8e1['timeout']||0xa;this[_0x4df4('0x8')]=_0x39a8e1[_0x4df4('0x8')]||_0x4df4('0x9');this['Agents']=_0x39a8e1[_0x4df4('0xa')];this['mapAgentsId']={};this[_0x4df4('0xb')]=0x0;this[_0x4df4('0x1')]='';this[_0x4df4('0xc')]();this[_0x4df4('0xd')]();}ChatQueue[_0x4df4('0xe')][_0x4df4('0xc')]=function(){var _0x1a5aef=this[_0x4df4('0xf')][_0x4df4('0x10')];this[_0x4df4('0xf')]=_[_0x4df4('0x11')](this['Agents'],'id');this[_0x4df4('0xf')][_0x4df4('0x10')]=_0x1a5aef;};ChatQueue['prototype']['updateRealtime']=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x1de9f7=0x0;_0x1de9f7=0x0?this[_0x4df4('0x17')]:0x0;var _0x581ef1={'id':this['id'],'available':this[_0x4df4('0x17')],'loggedIn':this[_0x4df4('0x14')],'name':this[_0x4df4('0x7')],'paused':this[_0x4df4('0x16')],'waiting':this['waiting']};var _0x20bfa5=md5(JSON['stringify'](_0x581ef1));if(this[_0x4df4('0x1')]!==_0x20bfa5){this[_0x4df4('0x1')]=_0x20bfa5;io['to'](util[_0x4df4('0x18')](_0x4df4('0x19'),_0x581ef1['name']))['emit'](_0x4df4('0x1a'),_0x581ef1);}};module[_0x4df4('0x1b')]=ChatQueue; \ No newline at end of file +var _0x4e93=['mapAgentsId','_rr','map','loggedIn','length','chatPause','paused','available','stringify','format','chat:queue:%s','emit','exports','lodash','md5','ioredis','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRealtime','prototype','updateRouting'];(function(_0x287439,_0x1a3c46){var _0x2cfc83=function(_0x2ecff4){while(--_0x2ecff4){_0x287439['push'](_0x287439['shift']());}};_0x2cfc83(++_0x1a3c46);}(_0x4e93,0x1b1));var _0x34e9=function(_0x5ef539,_0x4217c9){_0x5ef539=_0x5ef539-0x0;var _0x2be138=_0x4e93[_0x5ef539];return _0x2be138;};'use strict';var _=require(_0x34e9('0x0'));var md5=require(_0x34e9('0x1'));var util=require('util');var Redis=require(_0x34e9('0x2'));var config=require('../../../config/environment');config[_0x34e9('0x3')]=_['defaults'](config[_0x34e9('0x3')],{'host':_0x34e9('0x4'),'port':0x18eb});var io=require(_0x34e9('0x5'))(new Redis(config[_0x34e9('0x3')]));function ChatQueue(_0xb52390){this['id']=_0xb52390['id']||0x0;this['name']=_0xb52390[_0x34e9('0x6')]||'';this[_0x34e9('0x7')]=_0xb52390[_0x34e9('0x7')]||0xa;this['strategy']=_0xb52390[_0x34e9('0x8')]||_0x34e9('0x9');this[_0x34e9('0xa')]=_0xb52390['Agents'];this['mapAgentsId']={};this[_0x34e9('0xb')]=0x0;this[_0x34e9('0x1')]='';this['updateRouting']();this[_0x34e9('0xc')]();}ChatQueue[_0x34e9('0xd')][_0x34e9('0xe')]=function(){var _0x1e96b7=this[_0x34e9('0xf')][_0x34e9('0x10')];this[_0x34e9('0xf')]=_[_0x34e9('0x11')](this[_0x34e9('0xa')],'id');this[_0x34e9('0xf')][_0x34e9('0x10')]=_0x1e96b7;};ChatQueue['prototype'][_0x34e9('0xc')]=function(){this[_0x34e9('0x12')]=0x0;this['paused']=0x0;for(var _0x5c6e1f=0x0;_0x5c6e1f=0x0?this[_0x34e9('0x16')]:0x0;var _0x4dad3c={'id':this['id'],'available':this['available'],'loggedIn':this[_0x34e9('0x12')],'name':this[_0x34e9('0x6')],'paused':this[_0x34e9('0x15')],'waiting':this[_0x34e9('0xb')]};var _0x18d497=md5(JSON[_0x34e9('0x17')](_0x4dad3c));if(this[_0x34e9('0x1')]!==_0x18d497){this[_0x34e9('0x1')]=_0x18d497;io['to'](util[_0x34e9('0x18')](_0x34e9('0x19'),_0x4dad3c[_0x34e9('0x6')]))[_0x34e9('0x1a')]('chat_queue:save',_0x4dad3c);}};module[_0x34e9('0x1b')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 27d276e..a1ccceb 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 _0x1c52=['lodash','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','paused','online','available','loggedIn','stringify','format','emit','exports'];(function(_0x31e8ce,_0x409105){var _0x19aa5a=function(_0xd81fba){while(--_0xd81fba){_0x31e8ce['push'](_0x31e8ce['shift']());}};_0x19aa5a(++_0x409105);}(_0x1c52,0x188));var _0x21c5=function(_0x5cccff,_0x5a1b58){_0x5cccff=_0x5cccff-0x0;var _0x3dc774=_0x1c52[_0x5cccff];return _0x3dc774;};'use strict';var _=require(_0x21c5('0x0'));var md5=require(_0x21c5('0x1'));var util=require(_0x21c5('0x2'));var Redis=require(_0x21c5('0x3'));var config=require(_0x21c5('0x4'));config['redis']=_[_0x21c5('0x5')](config[_0x21c5('0x6')],{'host':_0x21c5('0x7'),'port':0x18eb});var io=require(_0x21c5('0x8'))(new Redis(config[_0x21c5('0x6')]));function FaxQueue(_0x5094d2){this['id']=_0x5094d2['id']||0x0;this[_0x21c5('0x9')]=_0x5094d2[_0x21c5('0x9')]||'';this[_0x21c5('0xa')]=_0x5094d2[_0x21c5('0xa')]||0xa;this['strategy']=_0x5094d2[_0x21c5('0xb')]||_0x21c5('0xc');this['Agents']=_0x5094d2[_0x21c5('0xd')];this[_0x21c5('0xe')]={};this[_0x21c5('0xf')]=0x0;this[_0x21c5('0x1')]='';this[_0x21c5('0x10')]();this[_0x21c5('0x11')]();}FaxQueue[_0x21c5('0x12')][_0x21c5('0x10')]=function(){var _0xd4ad61=this[_0x21c5('0xe')][_0x21c5('0x13')];this['mapAgentsId']=_['map'](this['Agents'],'id');this[_0x21c5('0xe')][_0x21c5('0x13')]=_0xd4ad61;};FaxQueue[_0x21c5('0x12')][_0x21c5('0x11')]=function(){this['loggedIn']=0x0;this[_0x21c5('0x14')]=0x0;for(var _0xb9cf74=0x0;_0xb9cf74=0x0?this[_0x21c5('0x16')]:0x0;var _0x3c110e={'id':this['id'],'available':this[_0x21c5('0x16')],'loggedIn':this[_0x21c5('0x17')],'name':this['name'],'paused':this[_0x21c5('0x14')],'waiting':this[_0x21c5('0xf')]};var _0x22c106=md5(JSON[_0x21c5('0x18')](_0x3c110e));if(this[_0x21c5('0x1')]!==_0x22c106){this['md5']=_0x22c106;io['to'](util[_0x21c5('0x19')]('fax:queue:%s',_0x3c110e[_0x21c5('0x9')]))[_0x21c5('0x1a')]('fax_queue:save',_0x3c110e);}};module[_0x21c5('0x1b')]=FaxQueue; \ No newline at end of file +var _0x96df=['prototype','loggedIn','paused','online','available','stringify','format','fax:queue:%s','emit','fax_queue:save','lodash','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','_rr'];(function(_0x1dda91,_0x1a0da4){var _0x1ac172=function(_0x4b05f2){while(--_0x4b05f2){_0x1dda91['push'](_0x1dda91['shift']());}};_0x1ac172(++_0x1a0da4);}(_0x96df,0x118));var _0xf96d=function(_0x3d6d80,_0x1689b7){_0x3d6d80=_0x3d6d80-0x0;var _0x30712a=_0x96df[_0x3d6d80];return _0x30712a;};'use strict';var _=require(_0xf96d('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xf96d('0x1'));var config=require(_0xf96d('0x2'));config[_0xf96d('0x3')]=_[_0xf96d('0x4')](config[_0xf96d('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0xf96d('0x5'))(new Redis(config[_0xf96d('0x3')]));function FaxQueue(_0x50d7f9){this['id']=_0x50d7f9['id']||0x0;this[_0xf96d('0x6')]=_0x50d7f9[_0xf96d('0x6')]||'';this['timeout']=_0x50d7f9[_0xf96d('0x7')]||0xa;this[_0xf96d('0x8')]=_0x50d7f9[_0xf96d('0x8')]||_0xf96d('0x9');this[_0xf96d('0xa')]=_0x50d7f9[_0xf96d('0xa')];this[_0xf96d('0xb')]={};this[_0xf96d('0xc')]=0x0;this[_0xf96d('0xd')]='';this[_0xf96d('0xe')]();this[_0xf96d('0xf')]();}FaxQueue['prototype'][_0xf96d('0xe')]=function(){var _0xca6f73=this['mapAgentsId'][_0xf96d('0x10')];this[_0xf96d('0xb')]=_['map'](this[_0xf96d('0xa')],'id');this[_0xf96d('0xb')][_0xf96d('0x10')]=_0xca6f73;};FaxQueue[_0xf96d('0x11')][_0xf96d('0xf')]=function(){this[_0xf96d('0x12')]=0x0;this[_0xf96d('0x13')]=0x0;for(var _0x3cd3ed=0x0;_0x3cd3ed=0x0?this[_0xf96d('0x15')]:0x0;var _0xa29848={'id':this['id'],'available':this[_0xf96d('0x15')],'loggedIn':this[_0xf96d('0x12')],'name':this[_0xf96d('0x6')],'paused':this['paused'],'waiting':this[_0xf96d('0xc')]};var _0x5e8b3a=md5(JSON[_0xf96d('0x16')](_0xa29848));if(this['md5']!==_0x5e8b3a){this[_0xf96d('0xd')]=_0x5e8b3a;io['to'](util[_0xf96d('0x17')](_0xf96d('0x18'),_0xa29848[_0xf96d('0x6')]))[_0xf96d('0x19')](_0xf96d('0x1a'),_0xa29848);}};module['exports']=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 24f87c4..b0c7c57 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 _0x17ec=['exports','name','Intervals'];(function(_0x6b898c,_0x29e494){var _0x331892=function(_0x5a9db2){while(--_0x5a9db2){_0x6b898c['push'](_0x6b898c['shift']());}};_0x331892(++_0x29e494);}(_0x17ec,0x64));var _0xc17e=function(_0x4849fd,_0xd79055){_0x4849fd=_0x4849fd-0x0;var _0x23b79b=_0x17ec[_0x4849fd];return _0x23b79b;};'use strict';function Interval(_0x2972e0){this['id']=_0x2972e0['id']||0x0;this[_0xc17e('0x0')]=_0x2972e0[_0xc17e('0x0')]||'';this[_0xc17e('0x1')]=_0x2972e0[_0xc17e('0x1')]||{};}module[_0xc17e('0x2')]=Interval; \ No newline at end of file +var _0x6a52=['exports','Intervals'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x6a52,0x129));var _0x26a5=function(_0xf34109,_0x380779){_0xf34109=_0xf34109-0x0;var _0x570bfc=_0x6a52[_0xf34109];return _0x570bfc;};'use strict';function Interval(_0x4c2b95){this['id']=_0x4c2b95['id']||0x0;this['name']=_0x4c2b95['name']||'';this[_0x26a5('0x0')]=_0x4c2b95[_0x26a5('0x0')]||{};}module[_0x26a5('0x1')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 5a5ec1e..b223fd2 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 _0xe2d2=['online','mailPause','available','stringify','format','mail:queue:%s','emit','mail_queue:save','lodash','md5','util','ioredis','defaults','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length'];(function(_0x135c17,_0x1188b2){var _0x2546b0=function(_0x23a1f9){while(--_0x23a1f9){_0x135c17['push'](_0x135c17['shift']());}};_0x2546b0(++_0x1188b2);}(_0xe2d2,0x1e8));var _0x2e2d=function(_0xeee372,_0x408f0a){_0xeee372=_0xeee372-0x0;var _0x1e925e=_0xe2d2[_0xeee372];return _0x1e925e;};'use strict';var _=require(_0x2e2d('0x0'));var md5=require(_0x2e2d('0x1'));var util=require(_0x2e2d('0x2'));var Redis=require(_0x2e2d('0x3'));var config=require('../../../config/environment');config['redis']=_[_0x2e2d('0x4')](config[_0x2e2d('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x2e2d('0x6'))(new Redis(config[_0x2e2d('0x5')]));function MailQueue(_0x2c2834){this['id']=_0x2c2834['id']||0x0;this[_0x2e2d('0x7')]=_0x2c2834[_0x2e2d('0x7')]||'';this['timeout']=_0x2c2834[_0x2e2d('0x8')]||0xa;this[_0x2e2d('0x9')]=_0x2c2834[_0x2e2d('0x9')]||_0x2e2d('0xa');this[_0x2e2d('0xb')]=_0x2c2834['Agents'];this[_0x2e2d('0xc')]={};this[_0x2e2d('0xd')]=0x0;this[_0x2e2d('0x1')]='';this[_0x2e2d('0xe')]();this[_0x2e2d('0xf')]();}MailQueue[_0x2e2d('0x10')][_0x2e2d('0xe')]=function(){var _0x463fcf=this[_0x2e2d('0xc')][_0x2e2d('0x11')];this[_0x2e2d('0xc')]=_[_0x2e2d('0x12')](this[_0x2e2d('0xb')],'id');this[_0x2e2d('0xc')][_0x2e2d('0x11')]=_0x463fcf;};MailQueue[_0x2e2d('0x10')][_0x2e2d('0xf')]=function(){this[_0x2e2d('0x13')]=0x0;this[_0x2e2d('0x14')]=0x0;for(var _0x3d6646=0x0;_0x3d6646=0x0?this['available']:0x0;var _0x22dc04={'id':this['id'],'available':this['available'],'loggedIn':this[_0x2e2d('0x13')],'name':this[_0x2e2d('0x7')],'paused':this['paused'],'waiting':this[_0x2e2d('0xd')]};var _0xbad0a9=md5(JSON[_0x2e2d('0x19')](_0x22dc04));if(this[_0x2e2d('0x1')]!==_0xbad0a9){this[_0x2e2d('0x1')]=_0xbad0a9;io['to'](util[_0x2e2d('0x1a')](_0x2e2d('0x1b'),_0x22dc04['name']))[_0x2e2d('0x1c')](_0x2e2d('0x1d'),_0x22dc04);}};module['exports']=MailQueue; \ No newline at end of file +var _0x9919=['ioredis','../../../config/environment','redis','localhost','name','timeout','strategy','Agents','md5','updateRealtime','updateRouting','_rr','prototype','loggedIn','paused','length','online','available','waiting','stringify','mail:queue:%s','emit','mail_queue:save','exports'];(function(_0x225a46,_0x224368){var _0x3a1797=function(_0x4d1a73){while(--_0x4d1a73){_0x225a46['push'](_0x225a46['shift']());}};_0x3a1797(++_0x224368);}(_0x9919,0xc0));var _0x9991=function(_0x25ccbe,_0xc935c0){_0x25ccbe=_0x25ccbe-0x0;var _0x289529=_0x9919[_0x25ccbe];return _0x289529;};'use strict';var _=require('lodash');var md5=require('md5');var util=require('util');var Redis=require(_0x9991('0x0'));var config=require(_0x9991('0x1'));config[_0x9991('0x2')]=_['defaults'](config[_0x9991('0x2')],{'host':_0x9991('0x3'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9991('0x2')]));function MailQueue(_0x635f74){this['id']=_0x635f74['id']||0x0;this['name']=_0x635f74[_0x9991('0x4')]||'';this[_0x9991('0x5')]=_0x635f74[_0x9991('0x5')]||0xa;this[_0x9991('0x6')]=_0x635f74['strategy']||'beepall';this[_0x9991('0x7')]=_0x635f74[_0x9991('0x7')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x9991('0x8')]='';this['updateRouting']();this[_0x9991('0x9')]();}MailQueue['prototype'][_0x9991('0xa')]=function(){var _0x20ddd0=this['mapAgentsId'][_0x9991('0xb')];this['mapAgentsId']=_['map'](this[_0x9991('0x7')],'id');this['mapAgentsId'][_0x9991('0xb')]=_0x20ddd0;};MailQueue[_0x9991('0xc')]['updateRealtime']=function(){this[_0x9991('0xd')]=0x0;this[_0x9991('0xe')]=0x0;for(var _0xef503b=0x0;_0xef503b=0x0?this['available']:0x0;var _0xe59e13={'id':this['id'],'available':this[_0x9991('0x11')],'loggedIn':this[_0x9991('0xd')],'name':this[_0x9991('0x4')],'paused':this['paused'],'waiting':this[_0x9991('0x12')]};var _0x242d0b=md5(JSON[_0x9991('0x13')](_0xe59e13));if(this[_0x9991('0x8')]!==_0x242d0b){this['md5']=_0x242d0b;io['to'](util['format'](_0x9991('0x14'),_0xe59e13[_0x9991('0x4')]))[_0x9991('0x15')](_0x9991('0x16'),_0xe59e13);}};module[_0x9991('0x17')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 3a7a4ef..8e66961 100644 --- a/server/services/routing/model/openchannelQueue.js +++ b/server/services/routing/model/openchannelQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['format','openchannel:queue:%s','name','emit','openchannel_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','loggedIn','paused','openchannelPause','available'];(function(_0x4a0b92,_0x1dbd16){var _0x857610=function(_0x5a968b){while(--_0x5a968b){_0x4a0b92['push'](_0x4a0b92['shift']());}};_0x857610(++_0x1dbd16);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3f3f40,_0x4c71f4){_0x3f3f40=_0x3f3f40-0x0;var _0x403b7a=_0x5fc3[_0x3f3f40];return _0x403b7a;};'use strict';var _=require(_0x35fc('0x0'));var md5=require(_0x35fc('0x1'));var util=require('util');var Redis=require(_0x35fc('0x2'));var config=require(_0x35fc('0x3'));config[_0x35fc('0x4')]=_[_0x35fc('0x5')](config[_0x35fc('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x35fc('0x6'))(new Redis(config[_0x35fc('0x4')]));function OpenchannelQueue(_0x186a06){this['id']=_0x186a06['id']||0x0;this['name']=_0x186a06['name']||'';this[_0x35fc('0x7')]=_0x186a06['timeout']||0xa;this[_0x35fc('0x8')]=_0x186a06[_0x35fc('0x8')]||_0x35fc('0x9');this[_0x35fc('0xa')]=_0x186a06[_0x35fc('0xa')];this[_0x35fc('0xb')]={};this[_0x35fc('0xc')]=0x0;this['md5']='';this[_0x35fc('0xd')]();this[_0x35fc('0xe')]();}OpenchannelQueue['prototype'][_0x35fc('0xd')]=function(){var _0x33f491=this['mapAgentsId'][_0x35fc('0xf')];this[_0x35fc('0xb')]=_['map'](this['Agents'],'id');this[_0x35fc('0xb')]['_rr']=_0x33f491;};OpenchannelQueue[_0x35fc('0x10')][_0x35fc('0xe')]=function(){this[_0x35fc('0x11')]=0x0;this[_0x35fc('0x12')]=0x0;for(var _0x38d9f2=0x0;_0x38d9f2=0x0?this['available']:0x0;var _0x41e165={'id':this['id'],'available':this[_0x35fc('0x14')],'loggedIn':this[_0x35fc('0x11')],'name':this['name'],'paused':this[_0x35fc('0x12')],'waiting':this[_0x35fc('0xc')]};var _0x465eb3=md5(JSON['stringify'](_0x41e165));if(this[_0x35fc('0x1')]!==_0x465eb3){this[_0x35fc('0x1')]=_0x465eb3;io['to'](util[_0x35fc('0x15')](_0x35fc('0x16'),_0x41e165[_0x35fc('0x17')]))[_0x35fc('0x18')](_0x35fc('0x19'),_0x41e165);}};module[_0x35fc('0x1a')]=OpenchannelQueue; \ No newline at end of file +var _0x1261=['available','stringify','openchannel:queue:%s','openchannel_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','map','_rr','updateRealtime','loggedIn','paused','length','online'];(function(_0x58c20f,_0x4cdb1b){var _0x3b0318=function(_0x36fa84){while(--_0x36fa84){_0x58c20f['push'](_0x58c20f['shift']());}};_0x3b0318(++_0x4cdb1b);}(_0x1261,0x144));var _0x1126=function(_0x42d0ed,_0x91a115){_0x42d0ed=_0x42d0ed-0x0;var _0x3f63f6=_0x1261[_0x42d0ed];return _0x3f63f6;};'use strict';var _=require('lodash');var md5=require(_0x1126('0x0'));var util=require(_0x1126('0x1'));var Redis=require(_0x1126('0x2'));var config=require(_0x1126('0x3'));config[_0x1126('0x4')]=_[_0x1126('0x5')](config[_0x1126('0x4')],{'host':_0x1126('0x6'),'port':0x18eb});var io=require(_0x1126('0x7'))(new Redis(config[_0x1126('0x4')]));function OpenchannelQueue(_0x5a2189){this['id']=_0x5a2189['id']||0x0;this['name']=_0x5a2189[_0x1126('0x8')]||'';this[_0x1126('0x9')]=_0x5a2189['timeout']||0xa;this[_0x1126('0xa')]=_0x5a2189[_0x1126('0xa')]||_0x1126('0xb');this[_0x1126('0xc')]=_0x5a2189[_0x1126('0xc')];this['mapAgentsId']={};this[_0x1126('0xd')]=0x0;this[_0x1126('0x0')]='';this[_0x1126('0xe')]();this['updateRealtime']();}OpenchannelQueue[_0x1126('0xf')]['updateRouting']=function(){var _0x52ef15=this[_0x1126('0x10')]['_rr'];this[_0x1126('0x10')]=_[_0x1126('0x11')](this[_0x1126('0xc')],'id');this[_0x1126('0x10')][_0x1126('0x12')]=_0x52ef15;};OpenchannelQueue[_0x1126('0xf')][_0x1126('0x13')]=function(){this[_0x1126('0x14')]=0x0;this[_0x1126('0x15')]=0x0;for(var _0x53a8f0=0x0;_0x53a8f0=0x0?this['available']:0x0;var _0x4d2b38={'id':this['id'],'available':this[_0x1126('0x18')],'loggedIn':this[_0x1126('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x1126('0xd')]};var _0x58b109=md5(JSON[_0x1126('0x19')](_0x4d2b38));if(this[_0x1126('0x0')]!==_0x58b109){this[_0x1126('0x0')]=_0x58b109;io['to'](util['format'](_0x1126('0x1a'),_0x4d2b38['name']))['emit'](_0x1126('0x1b'),_0x4d2b38);}};module[_0x1126('0x1c')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index ba4f48c..93b9d78 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 _0xfb3f=['name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','available','waiting','format','sms:queue:%s','emit','sms_queue:save','lodash','md5','ioredis','defaults','localhost','socket.io-emitter','redis'];(function(_0x5d0671,_0x1c89cb){var _0x23615d=function(_0x5d56e4){while(--_0x5d56e4){_0x5d0671['push'](_0x5d0671['shift']());}};_0x23615d(++_0x1c89cb);}(_0xfb3f,0xd9));var _0xffb3=function(_0x4e755a,_0x4c8eac){_0x4e755a=_0x4e755a-0x0;var _0x3f31ea=_0xfb3f[_0x4e755a];return _0x3f31ea;};'use strict';var _=require(_0xffb3('0x0'));var md5=require(_0xffb3('0x1'));var util=require('util');var Redis=require(_0xffb3('0x2'));var config=require('../../../config/environment');config['redis']=_[_0xffb3('0x3')](config['redis'],{'host':_0xffb3('0x4'),'port':0x18eb});var io=require(_0xffb3('0x5'))(new Redis(config[_0xffb3('0x6')]));function SmsQueue(_0x15cb2c){this['id']=_0x15cb2c['id']||0x0;this[_0xffb3('0x7')]=_0x15cb2c[_0xffb3('0x7')]||'';this[_0xffb3('0x8')]=_0x15cb2c[_0xffb3('0x8')]||0xa;this['strategy']=_0x15cb2c[_0xffb3('0x9')]||_0xffb3('0xa');this[_0xffb3('0xb')]=_0x15cb2c[_0xffb3('0xb')];this[_0xffb3('0xc')]={};this['waiting']=0x0;this[_0xffb3('0x1')]='';this[_0xffb3('0xd')]();this[_0xffb3('0xe')]();}SmsQueue[_0xffb3('0xf')][_0xffb3('0xd')]=function(){var _0x3667d9=this[_0xffb3('0xc')][_0xffb3('0x10')];this['mapAgentsId']=_[_0xffb3('0x11')](this[_0xffb3('0xb')],'id');this['mapAgentsId'][_0xffb3('0x10')]=_0x3667d9;};SmsQueue[_0xffb3('0xf')][_0xffb3('0xe')]=function(){this[_0xffb3('0x12')]=0x0;this[_0xffb3('0x13')]=0x0;for(var _0x420156=0x0;_0x420156=0x0?this[_0xffb3('0x16')]:0x0;var _0x57d096={'id':this['id'],'available':this[_0xffb3('0x16')],'loggedIn':this[_0xffb3('0x12')],'name':this[_0xffb3('0x7')],'paused':this['paused'],'waiting':this[_0xffb3('0x17')]};var _0x45fdd6=md5(JSON['stringify'](_0x57d096));if(this[_0xffb3('0x1')]!==_0x45fdd6){this[_0xffb3('0x1')]=_0x45fdd6;io['to'](util[_0xffb3('0x18')](_0xffb3('0x19'),_0x57d096[_0xffb3('0x7')]))[_0xffb3('0x1a')](_0xffb3('0x1b'),_0x57d096);}};module['exports']=SmsQueue; \ No newline at end of file +var _0xcc73=['format','sms:queue:%s','exports','md5','util','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','smsPause','available'];(function(_0x38eb23,_0x196e8b){var _0x48506a=function(_0x36edb0){while(--_0x36edb0){_0x38eb23['push'](_0x38eb23['shift']());}};_0x48506a(++_0x196e8b);}(_0xcc73,0x1cb));var _0x3cc7=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xcc73[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var md5=require(_0x3cc7('0x0'));var util=require(_0x3cc7('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x3cc7('0x2')]=_['defaults'](config[_0x3cc7('0x2')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3cc7('0x2')]));function SmsQueue(_0xd060f7){this['id']=_0xd060f7['id']||0x0;this[_0x3cc7('0x3')]=_0xd060f7[_0x3cc7('0x3')]||'';this[_0x3cc7('0x4')]=_0xd060f7['timeout']||0xa;this[_0x3cc7('0x5')]=_0xd060f7[_0x3cc7('0x5')]||_0x3cc7('0x6');this[_0x3cc7('0x7')]=_0xd060f7['Agents'];this[_0x3cc7('0x8')]={};this[_0x3cc7('0x9')]=0x0;this[_0x3cc7('0x0')]='';this[_0x3cc7('0xa')]();this[_0x3cc7('0xb')]();}SmsQueue[_0x3cc7('0xc')][_0x3cc7('0xa')]=function(){var _0x57d9de=this['mapAgentsId'][_0x3cc7('0xd')];this['mapAgentsId']=_[_0x3cc7('0xe')](this[_0x3cc7('0x7')],'id');this[_0x3cc7('0x8')][_0x3cc7('0xd')]=_0x57d9de;};SmsQueue[_0x3cc7('0xc')][_0x3cc7('0xb')]=function(){this[_0x3cc7('0xf')]=0x0;this[_0x3cc7('0x10')]=0x0;for(var _0x2d1880=0x0;_0x2d1880=0x0?this[_0x3cc7('0x14')]:0x0;var _0xff4317={'id':this['id'],'available':this[_0x3cc7('0x14')],'loggedIn':this[_0x3cc7('0xf')],'name':this[_0x3cc7('0x3')],'paused':this[_0x3cc7('0x10')],'waiting':this[_0x3cc7('0x9')]};var _0x54f825=md5(JSON['stringify'](_0xff4317));if(this[_0x3cc7('0x0')]!==_0x54f825){this['md5']=_0x54f825;io['to'](util[_0x3cc7('0x15')](_0x3cc7('0x16'),_0xff4317[_0x3cc7('0x3')]))['emit']('sms_queue:save',_0xff4317);}};module[_0x3cc7('0x17')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 5f8aef1..1c2a76d 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 _0xc2db=['available','waiting','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','util','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRealtime','prototype','updateRouting','map','_rr','loggedIn','paused','length','online','whatsappPause'];(function(_0x561e8d,_0x4321af){var _0x31738f=function(_0xfaa5a6){while(--_0xfaa5a6){_0x561e8d['push'](_0x561e8d['shift']());}};_0x31738f(++_0x4321af);}(_0xc2db,0xe1));var _0xbc2d=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xc2db[_0x465028];return _0xb783d4;};'use strict';var _=require(_0xbc2d('0x0'));var md5=require(_0xbc2d('0x1'));var util=require(_0xbc2d('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0xbc2d('0x3')]=_[_0xbc2d('0x4')](config[_0xbc2d('0x3')],{'host':_0xbc2d('0x5'),'port':0x18eb});var io=require(_0xbc2d('0x6'))(new Redis(config['redis']));function WhatsappQueue(_0x34c97f){this['id']=_0x34c97f['id']||0x0;this[_0xbc2d('0x7')]=_0x34c97f[_0xbc2d('0x7')]||'';this[_0xbc2d('0x8')]=_0x34c97f[_0xbc2d('0x8')]||0xa;this['strategy']=_0x34c97f[_0xbc2d('0x9')]||_0xbc2d('0xa');this[_0xbc2d('0xb')]=_0x34c97f[_0xbc2d('0xb')];this[_0xbc2d('0xc')]={};this['waiting']=0x0;this['md5']='';this['updateRouting']();this[_0xbc2d('0xd')]();}WhatsappQueue[_0xbc2d('0xe')][_0xbc2d('0xf')]=function(){var _0x5c0c00=this[_0xbc2d('0xc')]['_rr'];this[_0xbc2d('0xc')]=_[_0xbc2d('0x10')](this[_0xbc2d('0xb')],'id');this['mapAgentsId'][_0xbc2d('0x11')]=_0x5c0c00;};WhatsappQueue[_0xbc2d('0xe')][_0xbc2d('0xd')]=function(){this[_0xbc2d('0x12')]=0x0;this[_0xbc2d('0x13')]=0x0;for(var _0xa1920b=0x0;_0xa1920b=0x0?this[_0xbc2d('0x17')]:0x0;var _0x260852={'id':this['id'],'available':this[_0xbc2d('0x17')],'loggedIn':this[_0xbc2d('0x12')],'name':this[_0xbc2d('0x7')],'paused':this['paused'],'waiting':this[_0xbc2d('0x18')]};var _0x528be7=md5(JSON[_0xbc2d('0x19')](_0x260852));if(this[_0xbc2d('0x1')]!==_0x528be7){this[_0xbc2d('0x1')]=_0x528be7;io['to'](util[_0xbc2d('0x1a')](_0xbc2d('0x1b'),_0x260852[_0xbc2d('0x7')]))[_0xbc2d('0x1c')](_0xbc2d('0x1d'),_0x260852);}};module[_0xbc2d('0x1e')]=WhatsappQueue; \ No newline at end of file +var _0xc612=['lodash','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRealtime','prototype','updateRouting','_rr','map','loggedIn','paused','online','whatsappPause','available','stringify','format','whatsapp:queue:%s','whatsapp_queue:save','exports'];(function(_0x2299a5,_0x1cdddc){var _0x5942a0=function(_0x52f180){while(--_0x52f180){_0x2299a5['push'](_0x2299a5['shift']());}};_0x5942a0(++_0x1cdddc);}(_0xc612,0xcb));var _0x2c61=function(_0x153dcf,_0x147a98){_0x153dcf=_0x153dcf-0x0;var _0x13b173=_0xc612[_0x153dcf];return _0x13b173;};'use strict';var _=require(_0x2c61('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x2c61('0x1'));var config=require('../../../config/environment');config[_0x2c61('0x2')]=_[_0x2c61('0x3')](config[_0x2c61('0x2')],{'host':_0x2c61('0x4'),'port':0x18eb});var io=require(_0x2c61('0x5'))(new Redis(config[_0x2c61('0x2')]));function WhatsappQueue(_0x7d8a64){this['id']=_0x7d8a64['id']||0x0;this[_0x2c61('0x6')]=_0x7d8a64[_0x2c61('0x6')]||'';this[_0x2c61('0x7')]=_0x7d8a64['timeout']||0xa;this[_0x2c61('0x8')]=_0x7d8a64[_0x2c61('0x8')]||_0x2c61('0x9');this[_0x2c61('0xa')]=_0x7d8a64[_0x2c61('0xa')];this[_0x2c61('0xb')]={};this[_0x2c61('0xc')]=0x0;this[_0x2c61('0xd')]='';this['updateRouting']();this[_0x2c61('0xe')]();}WhatsappQueue[_0x2c61('0xf')][_0x2c61('0x10')]=function(){var _0x15cb09=this[_0x2c61('0xb')][_0x2c61('0x11')];this[_0x2c61('0xb')]=_[_0x2c61('0x12')](this[_0x2c61('0xa')],'id');this['mapAgentsId'][_0x2c61('0x11')]=_0x15cb09;};WhatsappQueue[_0x2c61('0xf')][_0x2c61('0xe')]=function(){this[_0x2c61('0x13')]=0x0;this[_0x2c61('0x14')]=0x0;for(var _0x56d3d9=0x0;_0x56d3d9=0x0?this[_0x2c61('0x17')]:0x0;var _0x59c484={'id':this['id'],'available':this[_0x2c61('0x17')],'loggedIn':this[_0x2c61('0x13')],'name':this['name'],'paused':this[_0x2c61('0x14')],'waiting':this['waiting']};var _0x7e8ca=md5(JSON[_0x2c61('0x18')](_0x59c484));if(this[_0x2c61('0xd')]!==_0x7e8ca){this[_0x2c61('0xd')]=_0x7e8ca;io['to'](util[_0x2c61('0x19')](_0x2c61('0x1a'),_0x59c484['name']))['emit'](_0x2c61('0x1b'),_0x59c484);}};module[_0x2c61('0x1c')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 019c3ef..f262ece 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 15dac1f..567856e 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 _0x7338=['AddTagsToChatInteraction','../client','update','Request','UpdateChatInteraction','updateChatInteraction','addTags'];(function(_0x4f634d,_0xe95d6a){var _0x48cf4b=function(_0xed3f12){while(--_0xed3f12){_0x4f634d['push'](_0x4f634d['shift']());}};_0x48cf4b(++_0xe95d6a);}(_0x7338,0x1dd));var _0x8733=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0x7338[_0x20ef64];return _0x3707d8;};'use strict';var client=require(_0x8733('0x0'));exports[_0x8733('0x1')]=function(_0x5072fb,_0xa27ac1){return client[_0x8733('0x2')](_0x8733('0x3'),{'body':_0xa27ac1,'options':{'where':{'id':_0x5072fb}},'log':_0x8733('0x4')});};exports[_0x8733('0x5')]=function(_0x17c511,_0x5dc679){return client[_0x8733('0x2')](_0x8733('0x6'),{'body':_0x5dc679,'options':{'where':{'id':_0x17c511}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x76a9=['updateChatInteraction','addTags','AddTagsToChatInteraction','../client','Request','UpdateChatInteraction'];(function(_0x37d53d,_0xebf4ba){var _0x4bdd56=function(_0x2a40cb){while(--_0x2a40cb){_0x37d53d['push'](_0x37d53d['shift']());}};_0x4bdd56(++_0xebf4ba);}(_0x76a9,0x183));var _0x976a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x76a9[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x976a('0x0'));exports['update']=function(_0x1faa7c,_0x3b7e24){return client[_0x976a('0x1')](_0x976a('0x2'),{'body':_0x3b7e24,'options':{'where':{'id':_0x1faa7c}},'log':_0x976a('0x3')});};exports[_0x976a('0x4')]=function(_0x53b0ff,_0x1a68cd){return client[_0x976a('0x1')](_0x976a('0x5'),{'body':_0x1a68cd,'options':{'where':{'id':_0x53b0ff}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 971d231..27dfaef 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 _0xdd86=['CreateChatMessage','createChatMessage','../client','create','Request'];(function(_0x4aecc1,_0xc21fbf){var _0x17af21=function(_0x4b71f1){while(--_0x4b71f1){_0x4aecc1['push'](_0x4aecc1['shift']());}};_0x17af21(++_0xc21fbf);}(_0xdd86,0x124));var _0x6dd8=function(_0x3bf8de,_0x46f284){_0x3bf8de=_0x3bf8de-0x0;var _0x4e18d3=_0xdd86[_0x3bf8de];return _0x4e18d3;};'use strict';var client=require(_0x6dd8('0x0'));exports[_0x6dd8('0x1')]=function(_0x161de0){return client[_0x6dd8('0x2')](_0x6dd8('0x3'),{'body':_0x161de0,'log':_0x6dd8('0x4')});}; \ No newline at end of file +var _0x4c61=['CreateChatMessage','createChatMessage','create','Request'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x4c61,0xda));var _0x14c6=function(_0x26773b,_0x15bebf){_0x26773b=_0x26773b-0x0;var _0x4b86cf=_0x4c61[_0x26773b];return _0x4b86cf;};'use strict';var client=require('../client');exports[_0x14c6('0x0')]=function(_0x22a9ef){return client[_0x14c6('0x1')](_0x14c6('0x2'),{'body':_0x22a9ef,'log':_0x14c6('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 98cbdf9..14bf59b 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 _0x1dcc=['Agents','name','../client','getChatQueues','Request','GetChatQueue','timeout','User'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x1dcc,0x1ea));var _0xc1dc=function(_0x717f5e,_0x550eeb){_0x717f5e=_0x717f5e-0x0;var _0x250749=_0x1dcc[_0x717f5e];return _0x250749;};'use strict';var client=require(_0xc1dc('0x0'));exports[_0xc1dc('0x1')]=function(){return function(){return client[_0xc1dc('0x2')](_0xc1dc('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xc1dc('0x4'),'strategy'],'include':[{'model':_0xc1dc('0x5'),'as':_0xc1dc('0x6'),'attributes':['id',_0xc1dc('0x7'),'online','chatPause']}]},'log':_0xc1dc('0x1')});};}; \ No newline at end of file +var _0xf3ff=['User','online','chatPause','../client','Request','GetChatQueue','name','timeout','strategy'];(function(_0xd43e1d,_0x26a204){var _0x5c7332=function(_0x266a00){while(--_0x266a00){_0xd43e1d['push'](_0xd43e1d['shift']());}};_0x5c7332(++_0x26a204);}(_0xf3ff,0xae));var _0xff3f=function(_0x53b985,_0x438557){_0x53b985=_0x53b985-0x0;var _0x49806d=_0xf3ff[_0x53b985];return _0x49806d;};'use strict';var client=require(_0xff3f('0x0'));exports['getChatQueues']=function(){return function(){return client[_0xff3f('0x1')](_0xff3f('0x2'),{'options':{'raw':![],'attributes':['id',_0xff3f('0x3'),_0xff3f('0x4'),_0xff3f('0x5')],'include':[{'model':_0xff3f('0x6'),'as':'Agents','attributes':['id',_0xff3f('0x3'),_0xff3f('0x7'),_0xff3f('0x8')]}]},'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 26c385b..e7035d7 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 _0x0e85=['Request','CreateChatQueueReport','UpdateChatQueueReport','DESC','../client','create'];(function(_0xe72c11,_0x1f1f2d){var _0x56e6ae=function(_0x4fd20f){while(--_0x4fd20f){_0xe72c11['push'](_0xe72c11['shift']());}};_0x56e6ae(++_0x1f1f2d);}(_0x0e85,0x7c));var _0x50e8=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x0e85[_0x178e48];return _0x440d7e;};'use strict';var client=require(_0x50e8('0x0'));exports[_0x50e8('0x1')]=function(_0x5a568b){return client[_0x50e8('0x2')](_0x50e8('0x3'),{'body':_0x5a568b,'log':'CreateChatQueueReport'});};exports['update']=function(_0x4ce6cd,_0x236cf3){return client['Request'](_0x50e8('0x4'),{'body':_0x236cf3,'options':{'where':{'uniqueid':_0x4ce6cd},'order':[['id',_0x50e8('0x5')]],'limit':0x1},'log':_0x50e8('0x4')});}; \ No newline at end of file +var _0xee24=['UpdateChatQueueReport','DESC','create','CreateChatQueueReport','update','Request'];(function(_0x27636e,_0x5adf25){var _0xcf8be=function(_0x48c58a){while(--_0x48c58a){_0x27636e['push'](_0x27636e['shift']());}};_0xcf8be(++_0x5adf25);}(_0xee24,0x1a6));var _0x4ee2=function(_0x63b6d3,_0x13c87d){_0x63b6d3=_0x63b6d3-0x0;var _0x41a70c=_0xee24[_0x63b6d3];return _0x41a70c;};'use strict';var client=require('../client');exports[_0x4ee2('0x0')]=function(_0x2b4e8f){return client['Request'](_0x4ee2('0x1'),{'body':_0x2b4e8f,'log':_0x4ee2('0x1')});};exports[_0x4ee2('0x2')]=function(_0x34b373,_0x5546e1){return client[_0x4ee2('0x3')](_0x4ee2('0x4'),{'body':_0x5546e1,'options':{'where':{'uniqueid':_0x34b373},'order':[['id',_0x4ee2('0x5')]],'limit':0x1},'log':_0x4ee2('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index a48c030..700496d 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 _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x531d15,_0x599af5){var _0x271a18=function(_0x31284d){while(--_0x31284d){_0x531d15['push'](_0x531d15['shift']());}};_0x271a18(++_0x599af5);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'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 +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x5bc5fe,_0x2afaef){var _0x298ea7=function(_0x1c6bd5){while(--_0x1c6bd5){_0x5bc5fe['push'](_0x5bc5fe['shift']());}};_0x298ea7(++_0x2afaef);}(_0x7a54,0x106));var _0x47a5=function(_0x52473d,_0x2ebec5){_0x52473d=_0x52473d-0x0;var _0x11ed7f=_0x7a54[_0x52473d];return _0x11ed7f;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 9568705..7424b51 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 _0x30b5=['../client','create','CreateFaxMessage','createFaxMessage'];(function(_0x475955,_0x37b5fd){var _0x31d9ae=function(_0x152050){while(--_0x152050){_0x475955['push'](_0x475955['shift']());}};_0x31d9ae(++_0x37b5fd);}(_0x30b5,0x134));var _0x530b=function(_0x3bd52b,_0xbbc735){_0x3bd52b=_0x3bd52b-0x0;var _0x1e5b89=_0x30b5[_0x3bd52b];return _0x1e5b89;};'use strict';var client=require(_0x530b('0x0'));exports[_0x530b('0x1')]=function(_0x520a02){return client['Request'](_0x530b('0x2'),{'body':_0x520a02,'log':_0x530b('0x3')});}; \ No newline at end of file +var _0x1077=['createFaxMessage','create','Request','CreateFaxMessage'];(function(_0x1d457e,_0x22f9a9){var _0x332b9d=function(_0x368991){while(--_0x368991){_0x1d457e['push'](_0x1d457e['shift']());}};_0x332b9d(++_0x22f9a9);}(_0x1077,0xb9));var _0x7107=function(_0x2b12eb,_0x71951a){_0x2b12eb=_0x2b12eb-0x0;var _0x485d1e=_0x1077[_0x2b12eb];return _0x485d1e;};'use strict';var client=require('../client');exports[_0x7107('0x0')]=function(_0x48e5df){return client[_0x7107('0x1')](_0x7107('0x2'),{'body':_0x48e5df,'log':_0x7107('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 674db81..a9da0de 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 _0x1768=['../client','getFaxQueues','Request','name','timeout','strategy','Agents','online','faxPause'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1768,0x19e));var _0x8176=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1768[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0x8176('0x0'));exports[_0x8176('0x1')]=function(){return function(){return client[_0x8176('0x2')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0x8176('0x3'),_0x8176('0x4'),_0x8176('0x5')],'include':[{'model':'User','as':_0x8176('0x6'),'attributes':['id',_0x8176('0x3'),_0x8176('0x7'),_0x8176('0x8')]}]},'log':_0x8176('0x1')});};}; \ No newline at end of file +var _0x3567=['../client','getFaxQueues','Request','GetFaxQueue','name','strategy','User','Agents','online'];(function(_0x251296,_0x51d7a8){var _0x5f3ead=function(_0x354000){while(--_0x354000){_0x251296['push'](_0x251296['shift']());}};_0x5f3ead(++_0x51d7a8);}(_0x3567,0x15f));var _0x7356=function(_0x77c3a3,_0x2bc878){_0x77c3a3=_0x77c3a3-0x0;var _0xa42789=_0x3567[_0x77c3a3];return _0xa42789;};'use strict';var client=require(_0x7356('0x0'));exports[_0x7356('0x1')]=function(){return function(){return client[_0x7356('0x2')](_0x7356('0x3'),{'options':{'raw':![],'attributes':['id',_0x7356('0x4'),'timeout',_0x7356('0x5')],'include':[{'model':_0x7356('0x6'),'as':_0x7356('0x7'),'attributes':['id','name',_0x7356('0x8'),'faxPause']}]},'log':_0x7356('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 3f92216..be51fd9 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 _0xcf68=['create','CreateFaxQueueReport','update','Request','UpdateFaxQueueReport'];(function(_0x414957,_0x4771a1){var _0x574942=function(_0x2fd574){while(--_0x2fd574){_0x414957['push'](_0x414957['shift']());}};_0x574942(++_0x4771a1);}(_0xcf68,0x1b3));var _0x8cf6=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0xcf68[_0x4fde08];return _0x12e725;};'use strict';var client=require('../client');exports[_0x8cf6('0x0')]=function(_0x2f83a4){return client['Request'](_0x8cf6('0x1'),{'body':_0x2f83a4,'log':_0x8cf6('0x1')});};exports[_0x8cf6('0x2')]=function(_0x23ec7d,_0x25ac50){return client[_0x8cf6('0x3')](_0x8cf6('0x4'),{'body':_0x25ac50,'options':{'where':{'uniqueid':_0x23ec7d},'order':[['id','DESC']],'limit':0x1},'log':_0x8cf6('0x4')});}; \ No newline at end of file +var _0x6286=['UpdateFaxQueueReport','create','Request','CreateFaxQueueReport','update'];(function(_0x5d61ef,_0x36ec09){var _0x55dd0e=function(_0xe6a021){while(--_0xe6a021){_0x5d61ef['push'](_0x5d61ef['shift']());}};_0x55dd0e(++_0x36ec09);}(_0x6286,0x1a5));var _0x6628=function(_0x88d72b,_0x161055){_0x88d72b=_0x88d72b-0x0;var _0x15a298=_0x6286[_0x88d72b];return _0x15a298;};'use strict';var client=require('../client');exports[_0x6628('0x0')]=function(_0x2aab20){return client[_0x6628('0x1')](_0x6628('0x2'),{'body':_0x2aab20,'log':_0x6628('0x2')});};exports[_0x6628('0x3')]=function(_0x57afc5,_0x53a451){return client['Request'](_0x6628('0x4'),{'body':_0x53a451,'options':{'where':{'uniqueid':_0x57afc5},'order':[['id','DESC']],'limit':0x1},'log':_0x6628('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 5113eff..9f33ae8 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 _0x801d=['getIntervals','../client','Request','GetInterval','Interval','Intervals','name','interval'];(function(_0x29a377,_0x811d72){var _0x65568d=function(_0x525823){while(--_0x525823){_0x29a377['push'](_0x29a377['shift']());}};_0x65568d(++_0x811d72);}(_0x801d,0xf9));var _0xd801=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0x801d[_0x5c3c0b];return _0x52ecd2;};'use strict';var client=require(_0xd801('0x0'));exports['getIntervals']=function(){return function(){return client[_0xd801('0x1')](_0xd801('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0xd801('0x3'),'as':_0xd801('0x4'),'attributes':['id',_0xd801('0x5'),_0xd801('0x6')]}]},'log':_0xd801('0x7')});};}; \ No newline at end of file +var _0x46fd=['Intervals','interval','../client','getIntervals','Request','GetInterval','name'];(function(_0xaf114d,_0x2bf02f){var _0x3fa697=function(_0x477e9a){while(--_0x477e9a){_0xaf114d['push'](_0xaf114d['shift']());}};_0x3fa697(++_0x2bf02f);}(_0x46fd,0x191));var _0xd46f=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x46fd[_0x2070da];return _0x4f9fe1;};'use strict';var client=require(_0xd46f('0x0'));exports[_0xd46f('0x1')]=function(){return function(){return client[_0xd46f('0x2')](_0xd46f('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xd46f('0x4')],'include':[{'model':'Interval','as':_0xd46f('0x5'),'attributes':['id',_0xd46f('0x4'),_0xd46f('0x6')]}]},'log':_0xd46f('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 0bcd5e9..0d441b2 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 _0xfb11=['UpdateMailInteraction','addTags','Request','addTagsToChatInteraction','../client'];(function(_0x50bb27,_0x397625){var _0x5e5517=function(_0x444582){while(--_0x444582){_0x50bb27['push'](_0x50bb27['shift']());}};_0x5e5517(++_0x397625);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0xfb11[_0x1e7b16];return _0x37fadc;};'use strict';var client=require(_0x1fb1('0x0'));exports['update']=function(_0x3418a7,_0x34e2d6){return client['Request'](_0x1fb1('0x1'),{'body':_0x34e2d6,'options':{'where':{'id':_0x3418a7}},'log':'updateMailInteraction'});};exports[_0x1fb1('0x2')]=function(_0x5a830e,_0x190f74){return client[_0x1fb1('0x3')]('AddTagsToMailInteraction',{'body':_0x190f74,'options':{'where':{'id':_0x5a830e}},'log':_0x1fb1('0x4')});}; \ No newline at end of file +var _0x4cf8=['Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','../client','update'];(function(_0x549448,_0x1eb4f9){var _0x2fe710=function(_0xe9afc8){while(--_0xe9afc8){_0x549448['push'](_0x549448['shift']());}};_0x2fe710(++_0x1eb4f9);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x26b80e,_0x5c9333){_0x26b80e=_0x26b80e-0x0;var _0x84a8a8=_0x4cf8[_0x26b80e];return _0x84a8a8;};'use strict';var client=require(_0x84cf('0x0'));exports[_0x84cf('0x1')]=function(_0x287eb2,_0x2125ed){return client[_0x84cf('0x2')](_0x84cf('0x3'),{'body':_0x2125ed,'options':{'where':{'id':_0x287eb2}},'log':_0x84cf('0x4')});};exports[_0x84cf('0x5')]=function(_0x3bbbc3,_0x2d38c0){return client[_0x84cf('0x2')](_0x84cf('0x6'),{'body':_0x2d38c0,'options':{'where':{'id':_0x3bbbc3}},'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 401bfae..7ef754b 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 _0xcd65=['Request','CreateMailMessage'];(function(_0x494392,_0x1abc11){var _0x1b1bf3=function(_0x439682){while(--_0x439682){_0x494392['push'](_0x494392['shift']());}};_0x1b1bf3(++_0x1abc11);}(_0xcd65,0x108));var _0x5cd6=function(_0x211fef,_0x4ab716){_0x211fef=_0x211fef-0x0;var _0x5447bf=_0xcd65[_0x211fef];return _0x5447bf;};'use strict';var client=require('../client');exports['create']=function(_0x2b1b3a){return client[_0x5cd6('0x0')](_0x5cd6('0x1'),{'body':_0x2b1b3a,'log':'createMailMessage'});}; \ No newline at end of file +var _0x3f13=['CreateMailMessage','../client','create','Request'];(function(_0x1ea5e2,_0x382cec){var _0x39380c=function(_0x27893b){while(--_0x27893b){_0x1ea5e2['push'](_0x1ea5e2['shift']());}};_0x39380c(++_0x382cec);}(_0x3f13,0xf5));var _0x33f1=function(_0x1744c4,_0x1256f5){_0x1744c4=_0x1744c4-0x0;var _0x57ccf3=_0x3f13[_0x1744c4];return _0x57ccf3;};'use strict';var client=require(_0x33f1('0x0'));exports[_0x33f1('0x1')]=function(_0x37bfef){return client[_0x33f1('0x2')](_0x33f1('0x3'),{'body':_0x37bfef,'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 0fac1bf..f3cd9a0 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 _0x7801=['timeout','Agents','online','mailPause','getMailQueues','GetMailQueue','name'];(function(_0x1b745b,_0x3e2d40){var _0x120a9d=function(_0x882a6c){while(--_0x882a6c){_0x1b745b['push'](_0x1b745b['shift']());}};_0x120a9d(++_0x3e2d40);}(_0x7801,0x18c));var _0x1780=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x7801[_0x255d5b];return _0x3e141a;};'use strict';var client=require('../client');exports[_0x1780('0x0')]=function(){return function(){return client['Request'](_0x1780('0x1'),{'options':{'raw':![],'attributes':['id',_0x1780('0x2'),_0x1780('0x3'),'strategy'],'include':[{'model':'User','as':_0x1780('0x4'),'attributes':['id',_0x1780('0x2'),_0x1780('0x5'),_0x1780('0x6')]}]},'log':_0x1780('0x0')});};}; \ No newline at end of file +var _0x1046=['online','mailPause','getMailQueues','Request','name','User','Agents'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x1046,0x8e));var _0x6104=function(_0x40315b,_0x4d306){_0x40315b=_0x40315b-0x0;var _0x1ce697=_0x1046[_0x40315b];return _0x1ce697;};'use strict';var client=require('../client');exports[_0x6104('0x0')]=function(){return function(){return client[_0x6104('0x1')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0x6104('0x2'),'timeout','strategy'],'include':[{'model':_0x6104('0x3'),'as':_0x6104('0x4'),'attributes':['id','name',_0x6104('0x5'),_0x6104('0x6')]}]},'log':_0x6104('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index bee3d82..5015987 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 _0x50ac=['CreateMailQueueReport','UpdateMailQueueReport','DESC','../client','Request'];(function(_0x353548,_0x1b5809){var _0xe61540=function(_0x4ea8ef){while(--_0x4ea8ef){_0x353548['push'](_0x353548['shift']());}};_0xe61540(++_0x1b5809);}(_0x50ac,0xe9));var _0xc50a=function(_0x13a8ba,_0x4231a9){_0x13a8ba=_0x13a8ba-0x0;var _0x97ddba=_0x50ac[_0x13a8ba];return _0x97ddba;};'use strict';var client=require(_0xc50a('0x0'));exports['create']=function(_0x3c2959){return client[_0xc50a('0x1')]('CreateMailQueueReport',{'body':_0x3c2959,'log':_0xc50a('0x2')});};exports['update']=function(_0x19fe42,_0x8860b4){return client['Request'](_0xc50a('0x3'),{'body':_0x8860b4,'options':{'where':{'uniqueid':_0x19fe42},'order':[['id',_0xc50a('0x4')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file +var _0xe278=['create','Request','CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client'];(function(_0x10aedc,_0x2d6197){var _0x1fafc0=function(_0x152c75){while(--_0x152c75){_0x10aedc['push'](_0x10aedc['shift']());}};_0x1fafc0(++_0x2d6197);}(_0xe278,0x12c));var _0x8e27=function(_0x142346,_0x16da28){_0x142346=_0x142346-0x0;var _0x560766=_0xe278[_0x142346];return _0x560766;};'use strict';var client=require(_0x8e27('0x0'));exports[_0x8e27('0x1')]=function(_0x1224ab){return client[_0x8e27('0x2')](_0x8e27('0x3'),{'body':_0x1224ab,'log':_0x8e27('0x3')});};exports[_0x8e27('0x4')]=function(_0x3d67eb,_0x5509dc){return client[_0x8e27('0x2')](_0x8e27('0x5'),{'body':_0x5509dc,'options':{'where':{'uniqueid':_0x3d67eb},'order':[['id',_0x8e27('0x6')]],'limit':0x1},'log':_0x8e27('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 39b7b35..91b20c3 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 _0xe560=['updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x34fb8f,_0x38230d){var _0x2f3f56=function(_0x14807d){while(--_0x14807d){_0x34fb8f['push'](_0x34fb8f['shift']());}};_0x2f3f56(++_0x38230d);}(_0xe560,0x13f));var _0x0e56=function(_0x2d72b7,_0x583095){_0x2d72b7=_0x2d72b7-0x0;var _0x9b5296=_0xe560[_0x2d72b7];return _0x9b5296;};'use strict';var client=require(_0x0e56('0x0'));exports[_0x0e56('0x1')]=function(_0x250c4c,_0x9789e2){return client[_0x0e56('0x2')]('UpdateOpenchannelInteraction',{'body':_0x9789e2,'options':{'where':{'id':_0x250c4c}},'log':_0x0e56('0x3')});};exports[_0x0e56('0x4')]=function(_0x1ecb12,_0x4aec8c){return client[_0x0e56('0x2')](_0x0e56('0x5'),{'body':_0x4aec8c,'options':{'where':{'id':_0x1ecb12}},'log':_0x0e56('0x6')});}; \ No newline at end of file +var _0xd5e1=['updateOpenchannelInteraction','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','Request','UpdateOpenchannelInteraction'];(function(_0x2ca69a,_0x50341f){var _0x4a2a2c=function(_0x252489){while(--_0x252489){_0x2ca69a['push'](_0x2ca69a['shift']());}};_0x4a2a2c(++_0x50341f);}(_0xd5e1,0x1a7));var _0x1d5e=function(_0x358111,_0x59e472){_0x358111=_0x358111-0x0;var _0x38ca1e=_0xd5e1[_0x358111];return _0x38ca1e;};'use strict';var client=require(_0x1d5e('0x0'));exports['update']=function(_0xa76505,_0x451920){return client[_0x1d5e('0x1')](_0x1d5e('0x2'),{'body':_0x451920,'options':{'where':{'id':_0xa76505}},'log':_0x1d5e('0x3')});};exports['addTags']=function(_0x13e0c1,_0x11e7b3){return client['Request'](_0x1d5e('0x4'),{'body':_0x11e7b3,'options':{'where':{'id':_0x13e0c1}},'log':_0x1d5e('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 249e855..c31d414 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 _0x6e84=['create','CreateOpenchannelMessage','../client'];(function(_0x52cd53,_0x2165ee){var _0x410fc5=function(_0x55d298){while(--_0x55d298){_0x52cd53['push'](_0x52cd53['shift']());}};_0x410fc5(++_0x2165ee);}(_0x6e84,0x15e));var _0x46e8=function(_0x1ab926,_0x2606f4){_0x1ab926=_0x1ab926-0x0;var _0x3a03ab=_0x6e84[_0x1ab926];return _0x3a03ab;};'use strict';var client=require(_0x46e8('0x0'));exports[_0x46e8('0x1')]=function(_0x18d71b){return client['Request'](_0x46e8('0x2'),{'body':_0x18d71b,'log':'createOpenchannelMessage'});}; \ No newline at end of file +var _0xf93e=['CreateOpenchannelMessage','../client','Request'];(function(_0xc1cd01,_0x587986){var _0x29562c=function(_0x1a9caf){while(--_0x1a9caf){_0xc1cd01['push'](_0xc1cd01['shift']());}};_0x29562c(++_0x587986);}(_0xf93e,0x19f));var _0xef93=function(_0x21f884,_0x2b21f0){_0x21f884=_0x21f884-0x0;var _0x155de2=_0xf93e[_0x21f884];return _0x155de2;};'use strict';var client=require(_0xef93('0x0'));exports['create']=function(_0x4b26d0){return client[_0xef93('0x1')](_0xef93('0x2'),{'body':_0x4b26d0,'log':'createOpenchannelMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 5428f0c..0f8c0b5 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 _0xa3cf=['../client','Request','GetOpenchannelQueue','name','timeout','strategy','Agents','online','getOpenchannelQueues'];(function(_0xdc4996,_0x15bedc){var _0x20fbb9=function(_0x47c811){while(--_0x47c811){_0xdc4996['push'](_0xdc4996['shift']());}};_0x20fbb9(++_0x15bedc);}(_0xa3cf,0x195));var _0xfa3c=function(_0x3ec383,_0x5d68df){_0x3ec383=_0x3ec383-0x0;var _0x14159a=_0xa3cf[_0x3ec383];return _0x14159a;};'use strict';var client=require(_0xfa3c('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client[_0xfa3c('0x1')](_0xfa3c('0x2'),{'options':{'raw':![],'attributes':['id',_0xfa3c('0x3'),_0xfa3c('0x4'),_0xfa3c('0x5')],'include':[{'model':'User','as':_0xfa3c('0x6'),'attributes':['id','name',_0xfa3c('0x7'),'openchannelPause']}]},'log':_0xfa3c('0x8')});};}; \ No newline at end of file +var _0xb530=['../client','getOpenchannelQueues','Request','name','timeout','User'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0xb530,0x180));var _0x0b53=function(_0x547e11,_0x2db914){_0x547e11=_0x547e11-0x0;var _0x1056df=_0xb530[_0x547e11];return _0x1056df;};'use strict';var client=require(_0x0b53('0x0'));exports[_0x0b53('0x1')]=function(){return function(){return client[_0x0b53('0x2')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0x0b53('0x3'),_0x0b53('0x4'),'strategy'],'include':[{'model':_0x0b53('0x5'),'as':'Agents','attributes':['id',_0x0b53('0x3'),'online','openchannelPause']}]},'log':_0x0b53('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 39393d7..e19a951 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 _0xebd3=['CreateOpenchannelQueueReport','Request','UpdateOpenchannelQueueReport','DESC','../client'];(function(_0xc141c6,_0x5eab8c){var _0x7950df=function(_0xbd4166){while(--_0xbd4166){_0xc141c6['push'](_0xc141c6['shift']());}};_0x7950df(++_0x5eab8c);}(_0xebd3,0x194));var _0x3ebd=function(_0x50c492,_0x5c1e67){_0x50c492=_0x50c492-0x0;var _0x3505a8=_0xebd3[_0x50c492];return _0x3505a8;};'use strict';var client=require(_0x3ebd('0x0'));exports['create']=function(_0x400f78){return client['Request'](_0x3ebd('0x1'),{'body':_0x400f78,'log':_0x3ebd('0x1')});};exports['update']=function(_0x4c04ff,_0x5447e4){return client[_0x3ebd('0x2')](_0x3ebd('0x3'),{'body':_0x5447e4,'options':{'where':{'uniqueid':_0x4c04ff},'order':[['id',_0x3ebd('0x4')]],'limit':0x1},'log':_0x3ebd('0x3')});}; \ No newline at end of file +var _0xc1a9=['update','UpdateOpenchannelQueueReport','DESC','../client','create','Request','CreateOpenchannelQueueReport'];(function(_0x1d7f1e,_0x323421){var _0x31e0f6=function(_0x2f1638){while(--_0x2f1638){_0x1d7f1e['push'](_0x1d7f1e['shift']());}};_0x31e0f6(++_0x323421);}(_0xc1a9,0x16f));var _0x9c1a=function(_0x3227c1,_0x4318c5){_0x3227c1=_0x3227c1-0x0;var _0x31fd48=_0xc1a9[_0x3227c1];return _0x31fd48;};'use strict';var client=require(_0x9c1a('0x0'));exports[_0x9c1a('0x1')]=function(_0x531b71){return client[_0x9c1a('0x2')](_0x9c1a('0x3'),{'body':_0x531b71,'log':'CreateOpenchannelQueueReport'});};exports[_0x9c1a('0x4')]=function(_0x22e744,_0x1707d5){return client[_0x9c1a('0x2')](_0x9c1a('0x5'),{'body':_0x1707d5,'options':{'where':{'uniqueid':_0x22e744},'order':[['id',_0x9c1a('0x6')]],'limit':0x1},'log':_0x9c1a('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 5e66149..03dc9b7 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 _0xc92f=['UpdateSmsInteraction','addTags','addTagsToSmsInteraction','../client','update','Request'];(function(_0xdab40b,_0x353ba3){var _0x22e57a=function(_0x5ab55b){while(--_0x5ab55b){_0xdab40b['push'](_0xdab40b['shift']());}};_0x22e57a(++_0x353ba3);}(_0xc92f,0xf3));var _0xfc92=function(_0x206bc0,_0xf84370){_0x206bc0=_0x206bc0-0x0;var _0x5d3fc4=_0xc92f[_0x206bc0];return _0x5d3fc4;};'use strict';var client=require(_0xfc92('0x0'));exports[_0xfc92('0x1')]=function(_0x52c1e5,_0xb696d2){return client[_0xfc92('0x2')](_0xfc92('0x3'),{'body':_0xb696d2,'options':{'where':{'id':_0x52c1e5}},'log':'updateSmsInteraction'});};exports[_0xfc92('0x4')]=function(_0x21f567,_0x35780b){return client['Request']('AddTagsToSmsInteraction',{'body':_0x35780b,'options':{'where':{'id':_0x21f567}},'log':_0xfc92('0x5')});}; \ No newline at end of file +var _0x639d=['addTagsToSmsInteraction','../client','update','Request','UpdateSmsInteraction','addTags'];(function(_0x3932eb,_0x43b210){var _0x5316e5=function(_0x1744e8){while(--_0x1744e8){_0x3932eb['push'](_0x3932eb['shift']());}};_0x5316e5(++_0x43b210);}(_0x639d,0xbb));var _0xd639=function(_0x3733dd,_0x1dddb3){_0x3733dd=_0x3733dd-0x0;var _0x6dfc82=_0x639d[_0x3733dd];return _0x6dfc82;};'use strict';var client=require(_0xd639('0x0'));exports[_0xd639('0x1')]=function(_0xd1f88b,_0x4987ad){return client[_0xd639('0x2')](_0xd639('0x3'),{'body':_0x4987ad,'options':{'where':{'id':_0xd1f88b}},'log':'updateSmsInteraction'});};exports[_0xd639('0x4')]=function(_0x588a30,_0x19b990){return client['Request']('AddTagsToSmsInteraction',{'body':_0x19b990,'options':{'where':{'id':_0x588a30}},'log':_0xd639('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 1b7ba00..6a0545b 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 _0xf189=['../client','create','Request','CreateSmsMessage','createSmsMessage'];(function(_0xd056f7,_0xedbba9){var _0xbcb407=function(_0x137340){while(--_0x137340){_0xd056f7['push'](_0xd056f7['shift']());}};_0xbcb407(++_0xedbba9);}(_0xf189,0x177));var _0x9f18=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xf189[_0x17d9e3];return _0x14192d;};'use strict';var client=require(_0x9f18('0x0'));exports[_0x9f18('0x1')]=function(_0x4b4f96){return client[_0x9f18('0x2')](_0x9f18('0x3'),{'body':_0x4b4f96,'log':_0x9f18('0x4')});}; \ No newline at end of file +var _0xd4be=['createSmsMessage','../client','Request','CreateSmsMessage'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd4be,0x1ad));var _0xed4b=function(_0x233b38,_0x17088f){_0x233b38=_0x233b38-0x0;var _0x14a31c=_0xd4be[_0x233b38];return _0x14a31c;};'use strict';var client=require(_0xed4b('0x0'));exports['create']=function(_0x37b902){return client[_0xed4b('0x1')](_0xed4b('0x2'),{'body':_0x37b902,'log':_0xed4b('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 6f47725..cb37598 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 _0xe706=['Agents','online','smsPause','../client','getSmsQueues','Request','name','timeout','strategy','User'];(function(_0x3aa454,_0x56db08){var _0x134918=function(_0x1ebfa2){while(--_0x1ebfa2){_0x3aa454['push'](_0x3aa454['shift']());}};_0x134918(++_0x56db08);}(_0xe706,0xa3));var _0x6e70=function(_0x2107a6,_0xe8360d){_0x2107a6=_0x2107a6-0x0;var _0x2f09ef=_0xe706[_0x2107a6];return _0x2f09ef;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x6e70('0x3'),_0x6e70('0x4'),_0x6e70('0x5')],'include':[{'model':_0x6e70('0x6'),'as':_0x6e70('0x7'),'attributes':['id',_0x6e70('0x3'),_0x6e70('0x8'),_0x6e70('0x9')]}]},'log':_0x6e70('0x1')});};}; \ No newline at end of file +var _0xb7e7=['online','../client','Request','name','strategy','Agents'];(function(_0x570255,_0x51094d){var _0x385959=function(_0x2dddf4){while(--_0x2dddf4){_0x570255['push'](_0x570255['shift']());}};_0x385959(++_0x51094d);}(_0xb7e7,0x121));var _0x7b7e=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xb7e7[_0x173441];return _0x2423a8;};'use strict';var client=require(_0x7b7e('0x0'));exports['getSmsQueues']=function(){return function(){return client[_0x7b7e('0x1')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x7b7e('0x2'),'timeout',_0x7b7e('0x3')],'include':[{'model':'User','as':_0x7b7e('0x4'),'attributes':['id',_0x7b7e('0x2'),_0x7b7e('0x5'),'smsPause']}]},'log':'getSmsQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 572f1da..e5ba49f 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 _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x2a652d,_0x3452ef){var _0x4c420f=function(_0x5ba354){while(--_0x5ba354){_0x2a652d['push'](_0x2a652d['shift']());}};_0x4c420f(++_0x3452ef);}(_0x9c44,0x178));var _0x49c4=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x9c44[_0x18ab2a];return _0x16dcee;};'use strict';var client=require('../client');exports['create']=function(_0x1ffbbf){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'body':_0x1ffbbf,'log':_0x49c4('0x1')});};exports[_0x49c4('0x2')]=function(_0x2ad237,_0x4e0313){return client['Request'](_0x49c4('0x3'),{'body':_0x4e0313,'options':{'where':{'uniqueid':_0x2ad237},'order':[['id','DESC']],'limit':0x1},'log':_0x49c4('0x3')});}; \ No newline at end of file +var _0x3e74=['CreateSmsQueueReport','UpdateSmsQueueReport','DESC','../client','Request'];(function(_0x34e979,_0x51ce51){var _0x162659=function(_0x3d4b41){while(--_0x3d4b41){_0x34e979['push'](_0x34e979['shift']());}};_0x162659(++_0x51ce51);}(_0x3e74,0x175));var _0x43e7=function(_0x200a9b,_0x1777b9){_0x200a9b=_0x200a9b-0x0;var _0x5c3bdf=_0x3e74[_0x200a9b];return _0x5c3bdf;};'use strict';var client=require(_0x43e7('0x0'));exports['create']=function(_0x349480){return client[_0x43e7('0x1')](_0x43e7('0x2'),{'body':_0x349480,'log':'CreateSmsQueueReport'});};exports['update']=function(_0xc58479,_0x4f9bbe){return client[_0x43e7('0x1')](_0x43e7('0x3'),{'body':_0x4f9bbe,'options':{'where':{'uniqueid':_0xc58479},'order':[['id',_0x43e7('0x4')]],'limit':0x1},'log':_0x43e7('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index a505667..14b2549 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(_0x192ec3,_0x1d17ef){var _0x852295=function(_0x2c5b41){while(--_0x2c5b41){_0x192ec3['push'](_0x192ec3['shift']());}};_0x852295(++_0x1d17ef);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'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(_0x5baa48,_0x46608b){var _0x2f757c=function(_0x4be03f){while(--_0x4be03f){_0x5baa48['push'](_0x5baa48['shift']());}};_0x2f757c(++_0x46608b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'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 01d6170..369c19c 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 _0xe944=['AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','updateWhatsappInteraction','Request'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0xe944,0x174));var _0x4e94=function(_0x582098,_0x1201bd){_0x582098=_0x582098-0x0;var _0x24ab76=_0xe944[_0x582098];return _0x24ab76;};'use strict';var client=require(_0x4e94('0x0'));exports['update']=function(_0x490afd,_0x7a5f23){return client['Request']('UpdateWhatsappInteraction',{'body':_0x7a5f23,'options':{'where':{'id':_0x490afd}},'log':_0x4e94('0x1')});};exports['addTags']=function(_0x4edb6f,_0x10029f){return client[_0x4e94('0x2')](_0x4e94('0x3'),{'body':_0x10029f,'options':{'where':{'id':_0x4edb6f}},'log':_0x4e94('0x4')});}; \ No newline at end of file +var _0x0a6b=['updateWhatsappInteraction','addTags','addTagsToWhatsappInteraction','../client','Request'];(function(_0xa324e4,_0x36a919){var _0x1c60dd=function(_0x5347be){while(--_0x5347be){_0xa324e4['push'](_0xa324e4['shift']());}};_0x1c60dd(++_0x36a919);}(_0x0a6b,0x18e));var _0xb0a6=function(_0x511dd6,_0x5d294d){_0x511dd6=_0x511dd6-0x0;var _0x39f16b=_0x0a6b[_0x511dd6];return _0x39f16b;};'use strict';var client=require(_0xb0a6('0x0'));exports['update']=function(_0x5d7cd9,_0x50b658){return client[_0xb0a6('0x1')]('UpdateWhatsappInteraction',{'body':_0x50b658,'options':{'where':{'id':_0x5d7cd9}},'log':_0xb0a6('0x2')});};exports[_0xb0a6('0x3')]=function(_0x1d3b78,_0x544a64){return client[_0xb0a6('0x1')]('AddTagsToWhatsappInteraction',{'body':_0x544a64,'options':{'where':{'id':_0x1d3b78}},'log':_0xb0a6('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 6a25d25..7d13d1e 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 _0xb634=['CreateWhatsappMessage','createWhatsappMessage','../client','Request'];(function(_0x4733d3,_0x454290){var _0x1b9a44=function(_0x1a93bb){while(--_0x1a93bb){_0x4733d3['push'](_0x4733d3['shift']());}};_0x1b9a44(++_0x454290);}(_0xb634,0xda));var _0x4b63=function(_0x2468d7,_0xa1c440){_0x2468d7=_0x2468d7-0x0;var _0x168957=_0xb634[_0x2468d7];return _0x168957;};'use strict';var client=require(_0x4b63('0x0'));exports['create']=function(_0x2db7aa){return client[_0x4b63('0x1')](_0x4b63('0x2'),{'body':_0x2db7aa,'log':_0x4b63('0x3')});}; \ No newline at end of file +var _0xf1b0=['Request','CreateWhatsappMessage','createWhatsappMessage','../client','create'];(function(_0x2592ea,_0x935ff){var _0x3ba4ab=function(_0x4bfe72){while(--_0x4bfe72){_0x2592ea['push'](_0x2592ea['shift']());}};_0x3ba4ab(++_0x935ff);}(_0xf1b0,0xf3));var _0x0f1b=function(_0x130d82,_0x25f49b){_0x130d82=_0x130d82-0x0;var _0x112070=_0xf1b0[_0x130d82];return _0x112070;};'use strict';var client=require(_0x0f1b('0x0'));exports[_0x0f1b('0x1')]=function(_0x3604ec){return client[_0x0f1b('0x2')](_0x0f1b('0x3'),{'body':_0x3604ec,'log':_0x0f1b('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 50c0cb1..7256b35 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 _0xd15b=['name','timeout','strategy','online','whatsappPause','../client','getWhatsappQueues','GetWhatsappQueue'];(function(_0x2e81b4,_0x193298){var _0x2bdb73=function(_0x5a1763){while(--_0x5a1763){_0x2e81b4['push'](_0x2e81b4['shift']());}};_0x2bdb73(++_0x193298);}(_0xd15b,0x115));var _0xbd15=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd15b[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0xbd15('0x0'));exports[_0xbd15('0x1')]=function(){return function(){return client['Request'](_0xbd15('0x2'),{'options':{'raw':![],'attributes':['id',_0xbd15('0x3'),_0xbd15('0x4'),_0xbd15('0x5')],'include':[{'model':'User','as':'Agents','attributes':['id',_0xbd15('0x3'),_0xbd15('0x6'),_0xbd15('0x7')]}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file +var _0x20fc=['strategy','Agents','name','online','whatsappPause','../client','getWhatsappQueues','Request','GetWhatsappQueue'];(function(_0x3880a9,_0xff5b2c){var _0x23f9d7=function(_0x244d2e){while(--_0x244d2e){_0x3880a9['push'](_0x3880a9['shift']());}};_0x23f9d7(++_0xff5b2c);}(_0x20fc,0xcb));var _0xc20f=function(_0x1d211b,_0x475f3b){_0x1d211b=_0x1d211b-0x0;var _0x47c88b=_0x20fc[_0x1d211b];return _0x47c88b;};'use strict';var client=require(_0xc20f('0x0'));exports[_0xc20f('0x1')]=function(){return function(){return client[_0xc20f('0x2')](_0xc20f('0x3'),{'options':{'raw':![],'attributes':['id','name','timeout',_0xc20f('0x4')],'include':[{'model':'User','as':_0xc20f('0x5'),'attributes':['id',_0xc20f('0x6'),_0xc20f('0x7'),_0xc20f('0x8')]}]},'log':_0xc20f('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index d37ce7e..b6db98f 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 _0x9ad1=['create','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC','../client'];(function(_0x1684c1,_0x43eabb){var _0x5e9dbf=function(_0x58f30d){while(--_0x58f30d){_0x1684c1['push'](_0x1684c1['shift']());}};_0x5e9dbf(++_0x43eabb);}(_0x9ad1,0x7d));var _0x19ad=function(_0xc1a314,_0x13d723){_0xc1a314=_0xc1a314-0x0;var _0x17510b=_0x9ad1[_0xc1a314];return _0x17510b;};'use strict';var client=require(_0x19ad('0x0'));exports[_0x19ad('0x1')]=function(_0x1e497a){return client[_0x19ad('0x2')](_0x19ad('0x3'),{'body':_0x1e497a,'log':_0x19ad('0x3')});};exports[_0x19ad('0x4')]=function(_0x4756ba,_0x2c23f3){return client['Request'](_0x19ad('0x5'),{'body':_0x2c23f3,'options':{'where':{'uniqueid':_0x4756ba},'order':[['id',_0x19ad('0x6')]],'limit':0x1},'log':_0x19ad('0x5')});}; \ No newline at end of file +var _0x6bc4=['DESC','../client','create','Request','CreateWhatsappQueueReport','UpdateWhatsappQueueReport'];(function(_0x4a83a2,_0x1a05d1){var _0x55160e=function(_0x47b4c9){while(--_0x47b4c9){_0x4a83a2['push'](_0x4a83a2['shift']());}};_0x55160e(++_0x1a05d1);}(_0x6bc4,0x187));var _0x46bc=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6bc4[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x46bc('0x0'));exports[_0x46bc('0x1')]=function(_0x517b4b){return client[_0x46bc('0x2')]('CreateWhatsappQueueReport',{'body':_0x517b4b,'log':_0x46bc('0x3')});};exports['update']=function(_0x55dafa,_0x403c92){return client[_0x46bc('0x2')](_0x46bc('0x4'),{'body':_0x403c92,'options':{'where':{'uniqueid':_0x55dafa},'order':[['id',_0x46bc('0x5')]],'limit':0x1},'log':_0x46bc('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index cb2ef03..6f2fce9 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 _0xa522=['complete','[%s][AGENT]\x20ROUTING\x20END','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','string','number','timeout\x20is\x20a\x20number','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','validate','length','error','[%s][AGENT]\x20%s','find','agents','timeout','createQueue','atimeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','stop'];(function(_0xfeeb6a,_0x1fcfbc){var _0x5f176f=function(_0x48c2c4){while(--_0x48c2c4){_0xfeeb6a['push'](_0xfeeb6a['shift']());}};_0x5f176f(++_0x1fcfbc);}(_0xa522,0xba));var _0x2a52=function(_0x270adf,_0x1daaa3){_0x270adf=_0x270adf-0x0;var _0x29eda9=_0xa522[_0x270adf];return _0x29eda9;};'use strict';var schema=require('validate');var _=require(_0x2a52('0x0'));var util=require(_0x2a52('0x1'));var seqqueue=require(_0x2a52('0x2'));var logger=require(_0x2a52('0x3'))(_0x2a52('0x4'));var strategy=require(_0x2a52('0x5'));var queue=schema({'name':{'type':_0x2a52('0x6'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x2a52('0x7'),'message':_0x2a52('0x8')}});function writeLog(_0x705d4d,_0x3cb24e,_0x558b5a){return logger['info'](util[_0x2a52('0x9')](_0x2a52('0xa'),_0x705d4d,_0x3cb24e['name'],_0x558b5a));}function handleFindAgent(_0x3a919f){return function(_0x53adfb){return _0x53adfb[_0x2a52('0xb')][_0x2a52('0xc')]()===_0x3a919f[_0x2a52('0xc')]();};}exports[_0x2a52('0xd')]=function(_0xf7fc9f,_0x478027,_0x159e36,_0x3ad2c3){return function(_0x27475b){try{var _0x14f878={'name':_0x478027[0x0],'timeout':_0x478027[0x1]};var _0x518465=queue[_0x2a52('0xe')](_0x14f878,{'typecast':!![]});if(_0x518465[_0x2a52('0xf')]){logger[_0x2a52('0x10')](_0x2a52('0x11'),_0xf7fc9f,_['map'](_0x518465,'message')['join'](',\x20'));_0x27475b['stop']();}else{var _0x3c2399=_[_0x2a52('0x12')](_0x159e36[_0x2a52('0x13')],handleFindAgent(_0x14f878[_0x2a52('0xb')]));if(_0x3c2399){var _0x596b2b=(_0x14f878[_0x2a52('0x14')]||0xa)*0x3e8;var _0x579ef4,_0x4feda0;var _0x4f1815=seqqueue[_0x2a52('0x15')](_0x596b2b);_0x4f1815['id']=_0xf7fc9f;_0x4f1815[_0x2a52('0x16')]=_0x596b2b;_0x4f1815[_0x2a52('0x17')]=_0x3ad2c3[_0x2a52('0x17')];writeLog(_0xf7fc9f,_0x3c2399,util[_0x2a52('0x9')](_0x2a52('0x18'),_0x596b2b));_0x159e36[_0x2a52('0x19')][_0xf7fc9f]['on'](_0x2a52('0x1a'),function(){logger['info'](_0x2a52('0x1b'),_0xf7fc9f);clearTimeout(_0x4feda0);_0x4feda0=undefined;_0x4f1815[_0x2a52('0x1c')]();if(_0x159e36[_0x2a52('0x19')][_0xf7fc9f]){delete _0x159e36['rules'][_0xf7fc9f];}_0x27475b[_0x2a52('0x1d')]();});_0x159e36['rules'][_0xf7fc9f]['on'](_0x2a52('0x1e'),function(){if(_0x159e36[_0x2a52('0x19')][_0xf7fc9f]){delete _0x159e36['rules'][_0xf7fc9f];}});_0x4feda0=setTimeout(function(){logger['info'](_0x2a52('0x1f'),_0xf7fc9f);clearTimeout(_0x4feda0);_0x4f1815['close']();_0x27475b['next']();},_0x596b2b);strategy[_0x2a52('0x20')](_0x4f1815,_0x3c2399,_0x159e36,_0x3ad2c3);}else{logger[_0x2a52('0x10')](_0x2a52('0x21'),_0xf7fc9f,_0x14f878[_0x2a52('0xb')]);_0x27475b[_0x2a52('0x1d')]();}}}catch(_0xfbfa15){console[_0x2a52('0x22')](_0xfbfa15);logger['error'](_0x2a52('0x23'),_0xf7fc9f,_0xfbfa15['stack']);_0x27475b[_0x2a52('0x1d')]();}};}; \ No newline at end of file +var _0x001d=['consequence','validate','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','atimeout','channel','end','[%s][AGENT]\x20ROUTING\x20STOPPED','rules','complete','[%s][AGENT]\x20ROUTING\x20END','close','agent','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','lodash','util','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase'];(function(_0x5b11c3,_0x5a54ca){var _0x216765=function(_0x498f51){while(--_0x498f51){_0x5b11c3['push'](_0x5b11c3['shift']());}};_0x216765(++_0x5a54ca);}(_0x001d,0x1c7));var _0xd001=function(_0x5806c3,_0x5105d8){_0x5806c3=_0x5806c3-0x0;var _0x48ac77=_0x001d[_0x5806c3];return _0x48ac77;};'use strict';var schema=require('validate');var _=require(_0xd001('0x0'));var util=require(_0xd001('0x1'));var seqqueue=require('seq-queue');var logger=require(_0xd001('0x2'))(_0xd001('0x3'));var strategy=require(_0xd001('0x4'));var queue=schema({'name':{'type':_0xd001('0x5'),'required':!![],'message':_0xd001('0x6')},'timeout':{'type':_0xd001('0x7'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0xfe5959,_0x8d440f,_0x565e25){return logger[_0xd001('0x8')](util[_0xd001('0x9')](_0xd001('0xa'),_0xfe5959,_0x8d440f[_0xd001('0xb')],_0x565e25));}function handleFindAgent(_0x3bfcbe){return function(_0x80ce88){return _0x80ce88[_0xd001('0xb')][_0xd001('0xc')]()===_0x3bfcbe[_0xd001('0xc')]();};}exports[_0xd001('0xd')]=function(_0x58adb6,_0x27360d,_0x1f33a9,_0x344ec6){return function(_0x26a91d){try{var _0x538561={'name':_0x27360d[0x0],'timeout':_0x27360d[0x1]};var _0x412f25=queue[_0xd001('0xe')](_0x538561,{'typecast':!![]});if(_0x412f25['length']){logger['error'](_0xd001('0xf'),_0x58adb6,_[_0xd001('0x10')](_0x412f25,_0xd001('0x11'))[_0xd001('0x12')](',\x20'));_0x26a91d[_0xd001('0x13')]();}else{var _0x5af0e7=_[_0xd001('0x14')](_0x1f33a9[_0xd001('0x15')],handleFindAgent(_0x538561[_0xd001('0xb')]));if(_0x5af0e7){var _0x1eb3c8=(_0x538561['timeout']||0xa)*0x3e8;var _0x2bdf65,_0x3b1395;var _0x160433=seqqueue['createQueue'](_0x1eb3c8);_0x160433['id']=_0x58adb6;_0x160433[_0xd001('0x16')]=_0x1eb3c8;_0x160433[_0xd001('0x17')]=_0x344ec6[_0xd001('0x17')];writeLog(_0x58adb6,_0x5af0e7,util[_0xd001('0x9')]('START:%s',_0x1eb3c8));_0x1f33a9['rules'][_0x58adb6]['on'](_0xd001('0x18'),function(){logger[_0xd001('0x8')](_0xd001('0x19'),_0x58adb6);clearTimeout(_0x3b1395);_0x3b1395=undefined;_0x160433['close']();if(_0x1f33a9[_0xd001('0x1a')][_0x58adb6]){delete _0x1f33a9[_0xd001('0x1a')][_0x58adb6];}_0x26a91d[_0xd001('0x13')]();});_0x1f33a9[_0xd001('0x1a')][_0x58adb6]['on'](_0xd001('0x1b'),function(){if(_0x1f33a9[_0xd001('0x1a')][_0x58adb6]){delete _0x1f33a9[_0xd001('0x1a')][_0x58adb6];}});_0x3b1395=setTimeout(function(){logger['info'](_0xd001('0x1c'),_0x58adb6);clearTimeout(_0x3b1395);_0x160433[_0xd001('0x1d')]();_0x26a91d['next']();},_0x1eb3c8);strategy[_0xd001('0x1e')](_0x160433,_0x5af0e7,_0x1f33a9,_0x344ec6);}else{logger[_0xd001('0x1f')](_0xd001('0x20'),_0x58adb6,_0x538561['name']);_0x26a91d[_0xd001('0x13')]();}}}catch(_0x15551e){console[_0xd001('0x21')](_0x15551e);logger[_0xd001('0x1f')](_0xd001('0x22'),_0x58adb6,_0x15551e[_0xd001('0x23')]);_0x26a91d[_0xd001('0x13')]();}};}; \ 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 799f8ba..d195ad3 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 _0x6a0b=['./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','interaction','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','out','sms','channel','whatsapp','phone','chat','account','upperFirst','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','catch','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','info','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','$LATEST','message','toString','postText','error','amazonlex','providerName','providerResponse','Failed','lodash','moment'];(function(_0x3248b3,_0x2b6b4e){var _0x36ed17=function(_0x247119){while(--_0x247119){_0x3248b3['push'](_0x3248b3['shift']());}};_0x36ed17(++_0x2b6b4e);}(_0x6a0b,0xee));var _0xb6a0=function(_0x378d2c,_0x2e3447){_0x378d2c=_0x378d2c-0x0;var _0x53e644=_0x6a0b[_0x378d2c];return _0x53e644;};'use strict';var _=require(_0xb6a0('0x0'));var moment=require(_0xb6a0('0x1'));var AWS=require('aws-sdk');var utils=require(_0xb6a0('0x2'));var logger=require(_0xb6a0('0x3'))(_0xb6a0('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xb6a0('0x5')),'mailMessage':require(_0xb6a0('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xb6a0('0x7')),'whatsappMessage':require(_0xb6a0('0x8'))};exports['consequence']=function(_0x238c88,_0x206689){return function(_0x17170f){try{if(!_[_0xb6a0('0x9')](this[_0xb6a0('0xa')]['UserId'])){logger['info'](_0xb6a0('0xb'),_0x238c88,_0xb6a0('0xc'));return _0x17170f[_0xb6a0('0xd')]();}var _0x28e35a={'ContactId':this[_0xb6a0('0xe')]['id'],'sentAt':moment()[_0xb6a0('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xb6a0('0x10')};if(this['channel']===_0xb6a0('0x11')||this[_0xb6a0('0x12')]===_0xb6a0('0x13')){_0x28e35a['phone']=this[_0xb6a0('0xa')][_0xb6a0('0x14')];}var _0x493b66=this[_0xb6a0('0x12')];if(_0x493b66===_0xb6a0('0x15')){_0x28e35a['ChatWebsiteId']=this[_0xb6a0('0x16')]['id'];}else{_0x28e35a[_[_0xb6a0('0x17')](_0x493b66)+'AccountId']=this[_0xb6a0('0x16')]['id'];}_0x28e35a[_[_0xb6a0('0x17')](_0x493b66)+_0xb6a0('0x18')]=this['interaction']['id'];if(this[_0xb6a0('0xa')][_0xb6a0('0x19')]){var _0x1f3ddf=_0x206689[0x4];if(!_[_0xb6a0('0x1a')](_0x1f3ddf)){_0x28e35a[_0xb6a0('0x1b')]=utils[_0xb6a0('0x1c')](_0x1f3ddf,this);return rpc[_0x493b66+_0xb6a0('0x1d')][_0xb6a0('0x1e')](_0x28e35a)[_0xb6a0('0x1f')](function(_0x503ef8){logger['info'](_0xb6a0('0xb'),_0x238c88,_0x28e35a[_0xb6a0('0x1b')]);})[_0xb6a0('0x20')](function(_0x44d44b){logger['error']('[%s][AMAZONLEX]\x20%s',_0x238c88,JSON[_0xb6a0('0x21')](_0x44d44b));})[_0xb6a0('0x22')](function(){logger['info'](_0xb6a0('0x23'),_0x238c88);_0x17170f['stop']();});}else{logger[_0xb6a0('0x24')](_0xb6a0('0x25'),_0x238c88);_0x17170f[_0xb6a0('0x26')]();}}else{var _0x41c0e9=this;var _0x307fef=new AWS['LexRuntime']({'accessKeyId':_0x206689[0x0],'secretAccessKey':_0x206689[0x1],'region':_0x206689[0x2]});var _0xeb6212={'botAlias':_0xb6a0('0x27'),'botName':_0x206689[0x3],'inputText':this[_0xb6a0('0x28')][_0xb6a0('0x1b')],'userId':this['channel']+':'+this[_0xb6a0('0xa')]['id'][_0xb6a0('0x29')]()};_0x307fef[_0xb6a0('0x2a')](_0xeb6212,function(_0x5e9ab2,_0xfbaae6){if(_0x5e9ab2){logger[_0xb6a0('0x2b')](_0xb6a0('0xb'),_0x238c88,_0x5e9ab2[_0xb6a0('0x28')]);_0x17170f[_0xb6a0('0xd')]();}else if(_0xfbaae6&&_0xfbaae6[_0xb6a0('0x28')]){_0x41c0e9[_0xb6a0('0x1b')][_0xb6a0('0x2c')]=_0xfbaae6;_0x28e35a['body']=_0xfbaae6[_0xb6a0('0x28')];_0x28e35a[_0xb6a0('0x2d')]=_0xb6a0('0x2c');_0x28e35a[_0xb6a0('0x2e')]=JSON[_0xb6a0('0x21')](_0xfbaae6);return rpc[_0x493b66+'Message'][_0xb6a0('0x1e')](_0x28e35a)[_0xb6a0('0x1f')](function(_0x925ef9){logger['info'](_0xb6a0('0xb'),_0x238c88,_0x28e35a[_0xb6a0('0x1b')]);if(_0xfbaae6['dialogState']==_0xb6a0('0x2f')){_0x17170f[_0xb6a0('0xd')]();}else{_0x17170f['stop']();}})[_0xb6a0('0x20')](function(_0x4386da){logger[_0xb6a0('0x2b')](_0xb6a0('0xb'),_0x238c88,JSON['stringify'](_0x4386da));_0x17170f[_0xb6a0('0xd')]();});}else{_0x17170f[_0xb6a0('0xd')]();}});}}catch(_0xbfa661){logger[_0xb6a0('0x2b')](_0xb6a0('0xb'),_0x238c88,JSON['stringify'](_0xbfa661));_0x17170f['stop']();}};}; \ No newline at end of file +var _0xa512=['routing','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/faxMessage','isNil','interaction','info','contact','YYYY-MM-DD\x20HH:mm:ss','out','sms','whatsapp','phone','channel','chat','ChatWebsiteId','account','upperFirst','InteractionId','created','isEmpty','body','getMustacheRender','Message','then','error','[%s][AMAZONLEX]\x20%s','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','amazonlex','providerName','providerResponse','create','dialogState','Failed','next','catch','lodash','aws-sdk','./utils','../../../../config/logger'];(function(_0x140efd,_0x297310){var _0x5307f4=function(_0x5b56f8){while(--_0x5b56f8){_0x140efd['push'](_0x140efd['shift']());}};_0x5307f4(++_0x297310);}(_0xa512,0x1e6));var _0x2a51=function(_0x30dfa4,_0x1a6275){_0x30dfa4=_0x30dfa4-0x0;var _0x185b37=_0xa512[_0x30dfa4];return _0x185b37;};'use strict';var _=require(_0x2a51('0x0'));var moment=require('moment');var AWS=require(_0x2a51('0x1'));var utils=require(_0x2a51('0x2'));var logger=require(_0x2a51('0x3'))(_0x2a51('0x4'));var rpc={'chatMessage':require(_0x2a51('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x2a51('0x6')),'faxMessage':require(_0x2a51('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x129717,_0x385553){return function(_0x3cc674){try{if(!_[_0x2a51('0x8')](this[_0x2a51('0x9')]['UserId'])){logger[_0x2a51('0xa')]('[%s][AMAZONLEX]\x20%s',_0x129717,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x3cc674['next']();}var _0x3dae84={'ContactId':this[_0x2a51('0xb')]['id'],'sentAt':moment()['format'](_0x2a51('0xc')),'direction':_0x2a51('0xd')};if(this['channel']===_0x2a51('0xe')||this['channel']===_0x2a51('0xf')){_0x3dae84['phone']=this['interaction'][_0x2a51('0x10')];}var _0x4b732c=this[_0x2a51('0x11')];if(_0x4b732c===_0x2a51('0x12')){_0x3dae84[_0x2a51('0x13')]=this[_0x2a51('0x14')]['id'];}else{_0x3dae84[_[_0x2a51('0x15')](_0x4b732c)+'AccountId']=this[_0x2a51('0x14')]['id'];}_0x3dae84[_[_0x2a51('0x15')](_0x4b732c)+_0x2a51('0x16')]=this[_0x2a51('0x9')]['id'];if(this[_0x2a51('0x9')][_0x2a51('0x17')]){var _0x454367=_0x385553[0x4];if(!_[_0x2a51('0x18')](_0x454367)){_0x3dae84[_0x2a51('0x19')]=utils[_0x2a51('0x1a')](_0x454367,this);return rpc[_0x4b732c+_0x2a51('0x1b')]['create'](_0x3dae84)[_0x2a51('0x1c')](function(_0x58695a){logger[_0x2a51('0xa')]('[%s][AMAZONLEX]\x20%s',_0x129717,_0x3dae84[_0x2a51('0x19')]);})['catch'](function(_0x205215){logger[_0x2a51('0x1d')](_0x2a51('0x1e'),_0x129717,JSON[_0x2a51('0x1f')](_0x205215));})[_0x2a51('0x20')](function(){logger[_0x2a51('0xa')](_0x2a51('0x21'),_0x129717);_0x3cc674[_0x2a51('0x22')]();});}else{logger[_0x2a51('0xa')](_0x2a51('0x23'),_0x129717);_0x3cc674[_0x2a51('0x22')]();}}else{var _0x19b60a=this;var _0x12d8dd=new AWS[(_0x2a51('0x24'))]({'accessKeyId':_0x385553[0x0],'secretAccessKey':_0x385553[0x1],'region':_0x385553[0x2]});var _0x450c0f={'botAlias':_0x2a51('0x25'),'botName':_0x385553[0x3],'inputText':this[_0x2a51('0x26')][_0x2a51('0x19')],'userId':this[_0x2a51('0x11')]+':'+this[_0x2a51('0x9')]['id'][_0x2a51('0x27')]()};_0x12d8dd[_0x2a51('0x28')](_0x450c0f,function(_0x1c42ca,_0x4cb039){if(_0x1c42ca){logger['error'](_0x2a51('0x1e'),_0x129717,_0x1c42ca[_0x2a51('0x26')]);_0x3cc674['next']();}else if(_0x4cb039&&_0x4cb039[_0x2a51('0x26')]){_0x19b60a[_0x2a51('0x19')][_0x2a51('0x29')]=_0x4cb039;_0x3dae84[_0x2a51('0x19')]=_0x4cb039['message'];_0x3dae84[_0x2a51('0x2a')]=_0x2a51('0x29');_0x3dae84[_0x2a51('0x2b')]=JSON[_0x2a51('0x1f')](_0x4cb039);return rpc[_0x4b732c+'Message'][_0x2a51('0x2c')](_0x3dae84)['then'](function(_0x4c4161){logger[_0x2a51('0xa')](_0x2a51('0x1e'),_0x129717,_0x3dae84[_0x2a51('0x19')]);if(_0x4cb039[_0x2a51('0x2d')]==_0x2a51('0x2e')){_0x3cc674[_0x2a51('0x2f')]();}else{_0x3cc674['stop']();}})[_0x2a51('0x30')](function(_0x51db96){logger['error']('[%s][AMAZONLEX]\x20%s',_0x129717,JSON[_0x2a51('0x1f')](_0x51db96));_0x3cc674[_0x2a51('0x2f')]();});}else{_0x3cc674['next']();}});}}catch(_0xddb83e){logger['error'](_0x2a51('0x1e'),_0x129717,JSON[_0x2a51('0x1f')](_0xddb83e));_0x3cc674[_0x2a51('0x22')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/autoreply.js b/server/services/routing/server/applications/autoreply.js index b8097f6..39d0cbc 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 _0x55b9=['YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','read','subject','startsWith','Re:','Re:\x20','chat','account','upperFirst','AccountId','InteractionId','Message','inReplyTo','html','','headers','auto-replied','auto_reply','sendMailMessage','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','create','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','autoreplyExecuted','stringify','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','update','stop','lodash','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../mailRpc','consequence','channel','mail','body','isAutoreply','info','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','format'];(function(_0x2f85c5,_0x406274){var _0x141bba=function(_0x5e67d5){while(--_0x5e67d5){_0x2f85c5['push'](_0x2f85c5['shift']());}};_0x141bba(++_0x406274);}(_0x55b9,0x1b8));var _0x955b=function(_0x22ed1c,_0x138d36){_0x22ed1c=_0x22ed1c-0x0;var _0x296b65=_0x55b9[_0x22ed1c];return _0x296b65;};'use strict';var _=require(_0x955b('0x0'));var moment=require('moment');var utils=require('./utils');var logger=require(_0x955b('0x1'))(_0x955b('0x2'));var rpc={'chatMessage':require(_0x955b('0x3')),'openchannelMessage':require(_0x955b('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x955b('0x5')),'faxMessage':require(_0x955b('0x6')),'whatsappMessage':require(_0x955b('0x7')),'chatInteraction':require(_0x955b('0x8')),'openchannelInteraction':require(_0x955b('0x9')),'mailInteraction':require(_0x955b('0xa')),'smsInteraction':require(_0x955b('0xb')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require(_0x955b('0xc'));exports[_0x955b('0xd')]=function(_0x2eacd2,_0x10c7fa,_0x216385,_0x5bb448){return function(_0x2f4008){try{var _0x232dcb=this[_0x955b('0xe')];if(_0x232dcb===_0x955b('0xf')&&_0x5bb448[_0x955b('0x10')][_0x955b('0x11')]){logger[_0x955b('0x12')]('[%s][AUTOREPLY]\x20%s',_0x2eacd2,_0x955b('0x13'));return _0x2f4008[_0x955b('0x14')]();}if(_0x10c7fa[0x0]==='1'&&(_[_0x955b('0x15')](this[_0x955b('0x16')][_0x955b('0x17')])||!this[_0x955b('0x16')]['created'])){logger[_0x955b('0x12')](_0x955b('0x18'),_0x2eacd2,_0x955b('0x19'));return _0x2f4008[_0x955b('0x14')]();}if(_0x10c7fa[0x0]==='2'&&this[_0x955b('0x16')]['autoreplyExecuted']){logger[_0x955b('0x12')](_0x955b('0x1a'),_0x2eacd2,_0x955b('0x1b'));return _0x2f4008['next']();}var _0x3e1060={'ContactId':this['contact']['id'],'sentAt':moment()[_0x955b('0x1c')](_0x955b('0x1d')),'direction':_0x955b('0x1e')};if(this['channel']===_0x955b('0xf')){_0x3e1060[_0x955b('0x10')]=utils[_0x955b('0x1f')](_0x10c7fa[0x2],this);}else{_0x3e1060['body']=utils['getMustacheRender'](_0x10c7fa[0x1],this);}if(this['message']){_0x3e1060['to']=this[_0x955b('0x20')][_0x955b('0x21')]||'';if(this[_0x955b('0xe')]===_0x955b('0xf')&&_0x10c7fa[0x1]==='1'){_0x3e1060['cc']=this[_0x955b('0x20')]['cc']||'';}_0x3e1060['from']=this[_0x955b('0x20')]['to']||'';_0x3e1060['phone']=this['message']['phone']||'';_0x3e1060[_0x955b('0x22')]=!![];if(this[_0x955b('0x20')][_0x955b('0x23')]){_0x3e1060['subject']='';_0x3e1060[_0x955b('0x23')]+=_[_0x955b('0x24')](this[_0x955b('0x20')]['subject'],_0x955b('0x25'))?'':_0x955b('0x26');_0x3e1060[_0x955b('0x23')]+=this[_0x955b('0x20')][_0x955b('0x23')];}}if(this[_0x955b('0xe')]===_0x955b('0x27')){_0x3e1060['ChatWebsiteId']=this[_0x955b('0x28')]['id'];}else{_0x3e1060[_[_0x955b('0x29')](this[_0x955b('0xe')])+_0x955b('0x2a')]=this['account']['id'];}_0x3e1060[_['upperFirst'](this[_0x955b('0xe')])+_0x955b('0x2b')]=this[_0x955b('0x16')]['id'];var _0x467c2c=this[_0x955b('0x16')];if(rpc[this[_0x955b('0xe')]+_0x955b('0x2c')]){if(this[_0x955b('0xe')]==='mail'){_0x3e1060[_0x955b('0x2d')]=this['message']['messageId'];_0x3e1060[_0x955b('0x2e')]=''+_['replace'](_0x3e1060['body'],'','replace','','auto-replied','All','auto_reply','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','Interaction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3872,0x11e));var _0x2387=function(_0x48398f,_0x5a697b){_0x48398f=_0x48398f-0x0;var _0x1d6f0a=_0x3872[_0x48398f];return _0x1d6f0a;};'use strict';var _=require(_0x2387('0x0'));var moment=require(_0x2387('0x1'));var utils=require(_0x2387('0x2'));var logger=require('../../../../config/logger')(_0x2387('0x3'));var rpc={'chatMessage':require(_0x2387('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x2387('0x5')),'smsMessage':require(_0x2387('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0x2387('0x7')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0x2387('0x8')),'smsInteraction':require(_0x2387('0x9')),'faxInteraction':require(_0x2387('0xa')),'whatsappInteraction':require(_0x2387('0xb'))};var mailRpc=require(_0x2387('0xc'));exports[_0x2387('0xd')]=function(_0x31b849,_0x3e9e93,_0x45d60d,_0x4749ce){return function(_0x1fa2ab){try{var _0x450667=this[_0x2387('0xe')];if(_0x450667==='mail'&&_0x4749ce[_0x2387('0xf')]['isAutoreply']){logger[_0x2387('0x10')](_0x2387('0x11'),_0x31b849,_0x2387('0x12'));return _0x1fa2ab[_0x2387('0x13')]();}if(_0x3e9e93[0x0]==='1'&&(_[_0x2387('0x14')](this[_0x2387('0x15')][_0x2387('0x16')])||!this[_0x2387('0x15')][_0x2387('0x16')])){logger[_0x2387('0x10')](_0x2387('0x11'),_0x31b849,_0x2387('0x17'));return _0x1fa2ab['next']();}if(_0x3e9e93[0x0]==='2'&&this[_0x2387('0x15')][_0x2387('0x18')]){logger['info'](_0x2387('0x19'),_0x31b849,_0x2387('0x1a'));return _0x1fa2ab[_0x2387('0x13')]();}var _0x2bf892={'ContactId':this[_0x2387('0x1b')]['id'],'sentAt':moment()[_0x2387('0x1c')](_0x2387('0x1d')),'direction':_0x2387('0x1e')};if(this[_0x2387('0xe')]===_0x2387('0x1f')){_0x2bf892['body']=utils[_0x2387('0x20')](_0x3e9e93[0x2],this);}else{_0x2bf892[_0x2387('0xf')]=utils[_0x2387('0x20')](_0x3e9e93[0x1],this);}if(this[_0x2387('0x21')]){_0x2bf892['to']=this[_0x2387('0x21')][_0x2387('0x22')]||'';if(this[_0x2387('0xe')]==='mail'&&_0x3e9e93[0x1]==='1'){_0x2bf892['cc']=this['message']['cc']||'';}_0x2bf892[_0x2387('0x22')]=this['message']['to']||'';_0x2bf892[_0x2387('0x23')]=this[_0x2387('0x21')][_0x2387('0x23')]||'';_0x2bf892[_0x2387('0x24')]=!![];if(this[_0x2387('0x21')][_0x2387('0x25')]){_0x2bf892['subject']='';_0x2bf892['subject']+=_[_0x2387('0x26')](this['message']['subject'],_0x2387('0x27'))?'':_0x2387('0x28');_0x2bf892[_0x2387('0x25')]+=this['message'][_0x2387('0x25')];}}if(this[_0x2387('0xe')]===_0x2387('0x29')){_0x2bf892[_0x2387('0x2a')]=this[_0x2387('0x2b')]['id'];}else{_0x2bf892[_[_0x2387('0x2c')](this[_0x2387('0xe')])+_0x2387('0x2d')]=this[_0x2387('0x2b')]['id'];}_0x2bf892[_['upperFirst'](this['channel'])+_0x2387('0x2e')]=this[_0x2387('0x15')]['id'];var _0x4d1c0f=this['interaction'];if(rpc[this[_0x2387('0xe')]+_0x2387('0x2f')]){if(this[_0x2387('0xe')]===_0x2387('0x1f')){_0x2bf892[_0x2387('0x30')]=this[_0x2387('0x21')][_0x2387('0x31')];_0x2bf892[_0x2387('0x32')]=_0x2387('0x33')+_[_0x2387('0x34')](_0x2bf892[_0x2387('0xf')],']+(>|$)/g,''),'priorityTrue':_0x1d662a[0x1],'priorityFalse':_0x1d662a[0x2]};var _0x1c4a8c=gotoif[_0x930f('0x0')](_0x2fd9b0,{'typecast':!![]});if(_0x1c4a8c[_0x930f('0xe')]){logger[_0x930f('0xf')](_0x930f('0x10'),_0x14acd4,_[_0x930f('0x11')](_0x1c4a8c,_0x930f('0x12'))[_0x930f('0x13')](',\x20'));_0x506b7a['stop']();}else{try{var _0x1de69a=eval('('+_0x2fd9b0[_0x930f('0x14')]+')');var _0x2cf7ad=_0x1de69a?_0x2fd9b0['priorityTrue']:_0x2fd9b0[_0x930f('0x15')];logger[_0x930f('0x16')](_0x930f('0x17'),_0x14acd4,_0x2fd9b0['condition'],_0x1de69a,_0x2cf7ad||_0x930f('0x18'));if(_0x2cf7ad){var _0x2901a2=_[_0x930f('0x19')](_0x506b7a[_0x930f('0x1a')](),{'p':_0x2cf7ad});if(_0x2901a2>=0x0){logger[_0x930f('0x16')](_0x930f('0x1b'),_0x14acd4,_0x2cf7ad||_0x930f('0x18'),_0x2901a2);_0x506b7a[_0x930f('0x18')](_0x2901a2);}else{logger[_0x930f('0x16')](_0x930f('0x1c'),_0x14acd4,_0x2cf7ad||_0x930f('0x18'));_0x506b7a[_0x930f('0x1d')]();}}else{_0x506b7a[_0x930f('0x18')]();}}catch(_0x3a2551){logger[_0x930f('0xf')](_0x930f('0x1e'),_0x14acd4,_0x3a2551[_0x930f('0x12')]);_0x506b7a['stop']();}}}catch(_0x4f0585){logger[_0x930f('0xf')](_0x930f('0x10'),_0x14acd4,JSON[_0x930f('0x1f')](_0x4f0585));_0x506b7a['stop']();}};}; \ No newline at end of file +var _0x5c5a=['string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','replace','error','map','message','condition','priorityTrue','priorityFalse','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','info','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stop','[%s][GOTOIF]\x20eval\x20error:\x20%s','[%s][GOTOIF]\x20%s','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing'];(function(_0x150b9e,_0x2c5db5){var _0xfdd2ec=function(_0x357126){while(--_0x357126){_0x150b9e['push'](_0x150b9e['shift']());}};_0xfdd2ec(++_0x2c5db5);}(_0x5c5a,0x130));var _0xa5c5=function(_0x207b30,_0x46f5b4){_0x207b30=_0x207b30-0x0;var _0x4b9980=_0x5c5a[_0x207b30];return _0x4b9980;};'use strict';var schema=require(_0xa5c5('0x0'));var _=require(_0xa5c5('0x1'));var htmlToText=require(_0xa5c5('0x2'));var utils=require(_0xa5c5('0x3'));var logger=require(_0xa5c5('0x4'))(_0xa5c5('0x5'));var gotoif=schema({'condition':{'type':_0xa5c5('0x6'),'required':!![],'message':_0xa5c5('0x7')},'priorityTrue':{'type':'number','message':_0xa5c5('0x8')},'priorityFalse':{'type':_0xa5c5('0x9'),'message':_0xa5c5('0xa')}});exports[_0xa5c5('0xb')]=function(_0x1aee4f,_0x3b055c){return function(_0x1b38b0){try{var _0x365eff={'condition':htmlToText[_0xa5c5('0xc')](utils['getMustacheRender'](_0x3b055c[0x0],this),{'wordwrap':![]})[_0xa5c5('0xd')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x3b055c[0x1],'priorityFalse':_0x3b055c[0x2]};var _0x31792a=gotoif[_0xa5c5('0x0')](_0x365eff,{'typecast':!![]});if(_0x31792a['length']){logger[_0xa5c5('0xe')]('[%s][GOTOIF]\x20%s',_0x1aee4f,_[_0xa5c5('0xf')](_0x31792a,_0xa5c5('0x10'))['join'](',\x20'));_0x1b38b0['stop']();}else{try{var _0x13e5ba=eval('('+_0x365eff[_0xa5c5('0x11')]+')');var _0x49fa28=_0x13e5ba?_0x365eff[_0xa5c5('0x12')]:_0x365eff[_0xa5c5('0x13')];logger['info'](_0xa5c5('0x14'),_0x1aee4f,_0x365eff['condition'],_0x13e5ba,_0x49fa28||_0xa5c5('0x15'));if(_0x49fa28){var _0x3e5de3=_[_0xa5c5('0x16')](_0x1b38b0[_0xa5c5('0x17')](),{'p':_0x49fa28});if(_0x3e5de3>=0x0){logger[_0xa5c5('0x18')](_0xa5c5('0x19'),_0x1aee4f,_0x49fa28||_0xa5c5('0x15'),_0x3e5de3);_0x1b38b0[_0xa5c5('0x15')](_0x3e5de3);}else{logger[_0xa5c5('0x18')](_0xa5c5('0x1a'),_0x1aee4f,_0x49fa28||_0xa5c5('0x15'));_0x1b38b0[_0xa5c5('0x1b')]();}}else{_0x1b38b0[_0xa5c5('0x15')]();}}catch(_0xff22fa){logger[_0xa5c5('0xe')](_0xa5c5('0x1c'),_0x1aee4f,_0xff22fa[_0xa5c5('0x10')]);_0x1b38b0[_0xa5c5('0x1b')]();}}}catch(_0x40edc3){logger[_0xa5c5('0xe')](_0xa5c5('0x1d'),_0x1aee4f,JSON[_0xa5c5('0x1e')](_0x40edc3));_0x1b38b0[_0xa5c5('0x1b')]();}};}; \ 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 28c23d6..358d66c 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 _0x6d75=['validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','map','message','info','[%s][GOTOP]\x20priority\x20%s','priority','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','stop','stringify'];(function(_0x1c6d27,_0x2e281d){var _0x51b88c=function(_0x5271ec){while(--_0x5271ec){_0x1c6d27['push'](_0x1c6d27['shift']());}};_0x51b88c(++_0x2e281d);}(_0x6d75,0x1cc));var _0x56d7=function(_0x301ea6,_0x202cf3){_0x301ea6=_0x301ea6-0x0;var _0x3bd1ae=_0x6d75[_0x301ea6];return _0x3bd1ae;};'use strict';var schema=require(_0x56d7('0x0'));var _=require(_0x56d7('0x1'));var logger=require(_0x56d7('0x2'))(_0x56d7('0x3'));var gotop=schema({'priority':{'type':_0x56d7('0x4'),'required':!![],'message':_0x56d7('0x5')}});exports[_0x56d7('0x6')]=function(_0x392e90,_0xc54f00){return function(_0x5bc872){try{var _0x1821df={'priority':_0xc54f00[0x0]};var _0x971760=gotop['validate'](_0x1821df,{'typecast':!![]});if(_0x971760[_0x56d7('0x7')]){logger[_0x56d7('0x8')](_0x56d7('0x9'),_0x392e90,_[_0x56d7('0xa')](_0x971760,_0x56d7('0xb'))['join'](',\x20'));_0x5bc872['stop']();}else{logger[_0x56d7('0xc')](_0x56d7('0xd'),_0x392e90,_0x1821df['priority']);if(_0x1821df[_0x56d7('0xe')]){var _0x1308ae=_['findIndex'](_0x5bc872[_0x56d7('0xf')](),{'p':_0x1821df[_0x56d7('0xe')]});if(_0x1308ae>=0x0){logger['info'](_0x56d7('0x10'),_0x392e90,_0x1821df[_0x56d7('0xe')]||'next',_0x1308ae);_0x5bc872[_0x56d7('0x11')](_0x1308ae);}else{logger['info']('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x392e90,_0x1821df[_0x56d7('0xe')]||_0x56d7('0x11'));_0x5bc872[_0x56d7('0x12')]();}}else{_0x5bc872[_0x56d7('0x11')]();}}}catch(_0x343d77){logger[_0x56d7('0x8')]('[%s][GOTOP]\x20%s',_0x392e90,JSON[_0x56d7('0x13')](_0x343d77));_0x5bc872[_0x56d7('0x12')]();}};}; \ No newline at end of file +var _0xb6e2=['[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','error','[%s][GOTOP]\x20%s','map','stop','[%s][GOTOP]\x20priority\x20%s','priority','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','info'];(function(_0x5645ad,_0x580ea3){var _0x17d292=function(_0xe66902){while(--_0xe66902){_0x5645ad['push'](_0x5645ad['shift']());}};_0x17d292(++_0x580ea3);}(_0xb6e2,0x1bc));var _0x2b6e=function(_0x3e54d5,_0x179556){_0x3e54d5=_0x3e54d5-0x0;var _0x35ad39=_0xb6e2[_0x3e54d5];return _0x35ad39;};'use strict';var schema=require(_0x2b6e('0x0'));var _=require('lodash');var logger=require('../../../../config/logger')(_0x2b6e('0x1'));var gotop=schema({'priority':{'type':_0x2b6e('0x2'),'required':!![],'message':_0x2b6e('0x3')}});exports[_0x2b6e('0x4')]=function(_0x207691,_0x2d931e){return function(_0x6f0b04){try{var _0x31807f={'priority':_0x2d931e[0x0]};var _0x212a8e=gotop[_0x2b6e('0x0')](_0x31807f,{'typecast':!![]});if(_0x212a8e['length']){logger[_0x2b6e('0x5')](_0x2b6e('0x6'),_0x207691,_[_0x2b6e('0x7')](_0x212a8e,'message')['join'](',\x20'));_0x6f0b04[_0x2b6e('0x8')]();}else{logger['info'](_0x2b6e('0x9'),_0x207691,_0x31807f[_0x2b6e('0xa')]);if(_0x31807f['priority']){var _0xc33a94=_['findIndex'](_0x6f0b04[_0x2b6e('0xb')](),{'p':_0x31807f[_0x2b6e('0xa')]});if(_0xc33a94>=0x0){logger['info'](_0x2b6e('0xc'),_0x207691,_0x31807f[_0x2b6e('0xa')]||'next',_0xc33a94);_0x6f0b04[_0x2b6e('0xd')](_0xc33a94);}else{logger[_0x2b6e('0xe')](_0x2b6e('0xf'),_0x207691,_0x31807f['priority']||_0x2b6e('0xd'));_0x6f0b04[_0x2b6e('0x8')]();}}else{_0x6f0b04[_0x2b6e('0xd')]();}}}catch(_0x39dddf){logger['error']('[%s][GOTOP]\x20%s',_0x207691,JSON[_0x2b6e('0x10')](_0x39dddf));_0x6f0b04[_0x2b6e('0x8')]();}};}; \ 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 ff9ee4d..5a449ca 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 _0x486e=['../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','upperFirst','InteractionId','interaction','Message','create','info','[%s][MESSAGE]\x20%s','body','stringify','stop','lodash','./utils','routing','../../rpc/chatMessage'];(function(_0x287c11,_0x154336){var _0x38fda9=function(_0x3298a7){while(--_0x3298a7){_0x287c11['push'](_0x287c11['shift']());}};_0x38fda9(++_0x154336);}(_0x486e,0xb2));var _0xe486=function(_0x9af7ad,_0x326b02){_0x9af7ad=_0x9af7ad-0x0;var _0x14e368=_0x486e[_0x9af7ad];return _0x14e368;};'use strict';var _=require(_0xe486('0x0'));var utils=require(_0xe486('0x1'));var logger=require('../../../../config/logger')(_0xe486('0x2'));var rpc={'chatMessage':require(_0xe486('0x3')),'openchannelMessage':require(_0xe486('0x4')),'mailMessage':require(_0xe486('0x5')),'smsMessage':require(_0xe486('0x6')),'faxMessage':require(_0xe486('0x7')),'whatsappMessage':require(_0xe486('0x8'))};exports[_0xe486('0x9')]=function(_0x37910f,_0x25034d){return function(_0x1bf55d){try{var _0x4fac5d={'body':utils[_0xe486('0xa')](_0x25034d[0x0],this),'ContactId':this[_0xe486('0xb')]['id']};if(this[_0xe486('0xc')]===_0xe486('0xd')){_0x4fac5d[_0xe486('0xe')]=this[_0xe486('0xf')]['id'];}else{_0x4fac5d[_[_0xe486('0x10')](this[_0xe486('0xc')])+'AccountId']=this['account']['id'];}_0x4fac5d[_[_0xe486('0x10')](this[_0xe486('0xc')])+_0xe486('0x11')]=this[_0xe486('0x12')]['id'];if(rpc[this[_0xe486('0xc')]+_0xe486('0x13')]){return rpc[this[_0xe486('0xc')]+_0xe486('0x13')][_0xe486('0x14')](_0x4fac5d)['then'](function(_0x5a1aad){logger[_0xe486('0x15')](_0xe486('0x16'),_0x37910f,_0x4fac5d[_0xe486('0x17')]);_0x1bf55d['next']();})['catch'](function(_0x339746){logger['error'](_0xe486('0x16'),_0x37910f,JSON[_0xe486('0x18')](_0x339746));_0x1bf55d[_0xe486('0x19')]();});}}catch(_0x355002){logger['error']('[%s][MESSAGE]\x20%s',_0x37910f,JSON[_0xe486('0x18')](_0x355002));_0x1bf55d[_0xe486('0x19')]();}};}; \ No newline at end of file +var _0xf8cd=['catch','error','stringify','stop','lodash','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','ChatWebsiteId','account','upperFirst','AccountId','channel','InteractionId','Message','create','then','info','[%s][MESSAGE]\x20%s','next'];(function(_0x1d2024,_0x200e6e){var _0x47820a=function(_0x47ce5b){while(--_0x47ce5b){_0x1d2024['push'](_0x1d2024['shift']());}};_0x47820a(++_0x200e6e);}(_0xf8cd,0xf7));var _0xdf8c=function(_0x20c960,_0x30452d){_0x20c960=_0x20c960-0x0;var _0x1a7ebf=_0xf8cd[_0x20c960];return _0x1a7ebf;};'use strict';var _=require(_0xdf8c('0x0'));var utils=require(_0xdf8c('0x1'));var logger=require('../../../../config/logger')(_0xdf8c('0x2'));var rpc={'chatMessage':require(_0xdf8c('0x3')),'openchannelMessage':require(_0xdf8c('0x4')),'mailMessage':require(_0xdf8c('0x5')),'smsMessage':require(_0xdf8c('0x6')),'faxMessage':require(_0xdf8c('0x7')),'whatsappMessage':require(_0xdf8c('0x8'))};exports[_0xdf8c('0x9')]=function(_0x1a92b4,_0x1280f4){return function(_0x13add2){try{var _0x4e7a2c={'body':utils[_0xdf8c('0xa')](_0x1280f4[0x0],this),'ContactId':this['contact']['id']};if(this['channel']==='chat'){_0x4e7a2c[_0xdf8c('0xb')]=this[_0xdf8c('0xc')]['id'];}else{_0x4e7a2c[_[_0xdf8c('0xd')](this['channel'])+_0xdf8c('0xe')]=this['account']['id'];}_0x4e7a2c[_['upperFirst'](this[_0xdf8c('0xf')])+_0xdf8c('0x10')]=this['interaction']['id'];if(rpc[this['channel']+_0xdf8c('0x11')]){return rpc[this['channel']+'Message'][_0xdf8c('0x12')](_0x4e7a2c)[_0xdf8c('0x13')](function(_0x30e72d){logger[_0xdf8c('0x14')](_0xdf8c('0x15'),_0x1a92b4,_0x4e7a2c['body']);_0x13add2[_0xdf8c('0x16')]();})[_0xdf8c('0x17')](function(_0x19d354){logger[_0xdf8c('0x18')](_0xdf8c('0x15'),_0x1a92b4,JSON[_0xdf8c('0x19')](_0x19d354));_0x13add2[_0xdf8c('0x1a')]();});}}catch(_0x35664c){logger[_0xdf8c('0x18')](_0xdf8c('0x15'),_0x1a92b4,JSON[_0xdf8c('0x19')](_0x35664c));_0x13add2['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 e7b1651..3a10bcd 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 _0x9075=['[%s][NOOP]\x20%s','next','error','stringify','./utils','../../../../config/logger','consequence','info'];(function(_0x3798e3,_0xd3fa7e){var _0x30fbfc=function(_0x593475){while(--_0x593475){_0x3798e3['push'](_0x3798e3['shift']());}};_0x30fbfc(++_0xd3fa7e);}(_0x9075,0x14c));var _0x5907=function(_0x3891de,_0x55cfe5){_0x3891de=_0x3891de-0x0;var _0x521696=_0x9075[_0x3891de];return _0x521696;};'use strict';var utils=require(_0x5907('0x0'));var logger=require(_0x5907('0x1'))('routing');exports[_0x5907('0x2')]=function(_0x1285f9,_0x40ed08){return function(_0x41d319){try{logger[_0x5907('0x3')](_0x5907('0x4'),_0x1285f9,utils['getMustacheRender'](_0x40ed08[0x0],this));_0x41d319[_0x5907('0x5')]();}catch(_0x24ddad){logger[_0x5907('0x6')](_0x5907('0x4'),_0x1285f9,JSON[_0x5907('0x7')](_0x24ddad));_0x41d319['stop']();}};}; \ No newline at end of file +var _0x7965=['next','error','stringify','./utils','consequence','info','[%s][NOOP]\x20%s','getMustacheRender'];(function(_0x4de59e,_0x28c4aa){var _0x4f0fbb=function(_0x11c6ce){while(--_0x11c6ce){_0x4de59e['push'](_0x4de59e['shift']());}};_0x4f0fbb(++_0x28c4aa);}(_0x7965,0x15b));var _0x5796=function(_0x2132a3,_0x4639e9){_0x2132a3=_0x2132a3-0x0;var _0x21890c=_0x7965[_0x2132a3];return _0x21890c;};'use strict';var utils=require(_0x5796('0x0'));var logger=require('../../../../config/logger')('routing');exports[_0x5796('0x1')]=function(_0x267a41,_0xfcc2c8){return function(_0x37348e){try{logger[_0x5796('0x2')](_0x5796('0x3'),_0x267a41,utils[_0x5796('0x4')](_0xfcc2c8[0x0],this));_0x37348e[_0x5796('0x5')]();}catch(_0x19a3db){logger[_0x5796('0x6')](_0x5796('0x3'),_0x267a41,JSON[_0x5796('0x7')](_0x19a3db));_0x37348e['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 636c1b9..d9d5f34 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 _0xe72e=['../../rpc/faxInteraction','../../rpc/mailInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','number','timeout\x20is\x20a\x20number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','interaction','message','chat','AccountId','info','name','catch','error','create\x20queue\x20report','waiting','accepted','Interaction','update','then','QueueReport','update\x20queue\x20report','timeout','toLowerCase','consequence','validate','length','map','join','stop','find','Queues','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','rrmemory','beepall','[%s][QUEUE]\x20%s','stack','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','account','queue','from','joinAt','emit','clone','push','capitalize','InteractionId','format','pick','%sQueuesWaitingInteractions','%s:queue:%s','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','../../rpc/chatInteraction'];(function(_0x3c04ef,_0x9d110c){var _0x6a3a69=function(_0x333514){while(--_0x333514){_0x3c04ef['push'](_0x3c04ef['shift']());}};_0x6a3a69(++_0x9d110c);}(_0xe72e,0x1e3));var _0xee72=function(_0x4dca4b,_0x19c968){_0x4dca4b=_0x4dca4b-0x0;var _0x9a30fc=_0xe72e[_0x4dca4b];return _0x9a30fc;};'use strict';var schema=require('validate');var _=require(_0xee72('0x0'));var util=require(_0xee72('0x1'));var seqqueue=require(_0xee72('0x2'));var moment=require(_0xee72('0x3'));var Redis=require(_0xee72('0x4'));var config=require(_0xee72('0x5'));var logger=require(_0xee72('0x6'))('routing');var strategy=require(_0xee72('0x7'));config[_0xee72('0x8')]=_[_0xee72('0x9')](config[_0xee72('0x8')],{'host':_0xee72('0xa'),'port':0x18eb});var io=require(_0xee72('0xb'))(new Redis(config[_0xee72('0x8')]));var attributes=['id',_0xee72('0xc'),_0xee72('0xd'),_0xee72('0xe'),_0xee72('0xf'),_0xee72('0x10')];function emit(_0x3de759,_0xfb894a,_0x321ac1){io['to'](_0x3de759)[_0xee72('0x11')](_0xfb894a,_0x321ac1);}function emitChannelQueueInteraction(_0x12449f,_0x15341d,_0x94bc47,_0x1c3927,_0x3e5fdf,_0x1c6fa5,_0x594d7b,_0x43eacd){var _0x5063ce=_[_0xee72('0x12')](_0x94bc47);_0x5063ce['queue_id']=_0x43eacd;_0x5063ce[_0xee72('0xe')]=_0x15341d;_0x5063ce[_0xee72('0xd')]=_0x1c3927;_0x5063ce['id']=_0x3e5fdf;if(_0x1c6fa5){attributes[_0xee72('0x13')](_[_0xee72('0x14')](_0x12449f)+_0xee72('0x15'));_0x594d7b[util[_0xee72('0x16')]('%sQueuesWaitingInteractions',_0x12449f)][_0x3e5fdf]=_[_0xee72('0x17')](_0x5063ce,attributes);}else{delete _0x594d7b[util[_0xee72('0x16')](_0xee72('0x18'),_0x12449f)][_0x3e5fdf];}emit(util[_0xee72('0x16')](_0xee72('0x19'),_0x12449f,_0x15341d),util[_0xee72('0x16')]('%s_queue_waiting_interaction:%s',_0x12449f,_0x1c6fa5?'save':'remove'),_[_0xee72('0x17')](_0x5063ce,attributes));}var rpc={'openchannelQueueReport':require(_0xee72('0x1a')),'mailQueueReport':require(_0xee72('0x1b')),'chatQueueReport':require(_0xee72('0x1c')),'smsQueueReport':require(_0xee72('0x1d')),'faxQueueReport':require(_0xee72('0x1e')),'whatsappQueueReport':require(_0xee72('0x1f')),'chatInteraction':require(_0xee72('0x20')),'faxInteraction':require(_0xee72('0x21')),'mailInteraction':require(_0xee72('0x22')),'openchannelInteraction':require(_0xee72('0x23')),'smsInteraction':require(_0xee72('0x24')),'whatsappInteraction':require(_0xee72('0x25'))};var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xee72('0x26'),'message':_0xee72('0x27')}});function startRouting(_0x3849fc,_0x4e6724,_0xba0cdd,_0x18ecd2){if(_0x3849fc&&_0x4e6724&&_0xba0cdd){_0x4e6724['waiting']+=0x1;var _0x32139a={'uniqueid':_0x3849fc,'from':_0xba0cdd[_0xee72('0x28')]?_0xba0cdd[_0xee72('0x28')][_0xee72('0xf')]:'','joinAt':moment()[_0xee72('0x16')](_0xee72('0x29')),'ContactId':_0xba0cdd[_0xee72('0x2a')]?_0xba0cdd['contact']['id']:null,'ListId':_0xba0cdd[_0xee72('0x2b')]?_0xba0cdd[_0xee72('0x2b')]['id']:null};_0x32139a[_[_0xee72('0x2c')](_0xba0cdd[_0xee72('0x2d')])+_0xee72('0x2e')]=_0x4e6724['id']||null;_0x32139a[_[_0xee72('0x2c')](_0xba0cdd[_0xee72('0x2d')])+'InteractionId']=_0xba0cdd[_0xee72('0x2f')]?_0xba0cdd[_0xee72('0x2f')]['id']:null;_0x32139a[_[_0xee72('0x2c')](_0xba0cdd['channel'])+'MessageId']=_0xba0cdd[_0xee72('0x30')]?_0xba0cdd[_0xee72('0x30')]['id']:null;_0x32139a[_['upperFirst'](_0xba0cdd['channel'])+(_0xba0cdd[_0xee72('0x2d')]!==_0xee72('0x31')?_0xee72('0x32'):'WebsiteId')]=_0xba0cdd['account']?_0xba0cdd[_0xee72('0xd')]['id']:null;logger[_0xee72('0x33')](util[_0xee72('0x16')]('[%s][START:QUEUE][NAME:%s]',_0x3849fc,_0x4e6724[_0xee72('0x34')]));emitChannelQueueInteraction(_0xba0cdd['channel'],_0x4e6724[_0xee72('0x34')],_0x32139a,_0xba0cdd[_0xee72('0xd')][_0xee72('0x34')],_0xba0cdd[_0xee72('0x30')]['id'],!![],_0x18ecd2,_0x4e6724['id']);if(rpc[_0xba0cdd[_0xee72('0x2d')]+'QueueReport']){return rpc[_0xba0cdd[_0xee72('0x2d')]+'QueueReport']['create'](_0x32139a)[_0xee72('0x35')](function(_0x438221){logger[_0xee72('0x36')](_0xee72('0x37'),_0x438221);});}}}function stopRouting(_0x25c2d1,_0x52acf7,_0x2e1940,_0x257952){if(_0x25c2d1&&_0x52acf7){_0x52acf7[_0xee72('0x38')]-=0x1;var _0x80d943={'leaveAt':moment()[_0xee72('0x16')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0xee72('0x16')](_0xee72('0x29')),'reason':_0xee72('0x39')};logger['info'](util[_0xee72('0x16')]('[%s][STOP:QUEUE][NAME:%s]',_0x25c2d1,_0x52acf7[_0xee72('0x34')]));emitChannelQueueInteraction(_0x2e1940[_0xee72('0x2d')],_0x52acf7[_0xee72('0x34')],_0x2e1940['body'],_0x2e1940[_0xee72('0xd')]['name'],_0x2e1940['message']['id'],![],_0x257952,_0x52acf7['id']);return rpc[_0x2e1940[_0xee72('0x2d')]+_0xee72('0x3a')][_0xee72('0x3b')](_0x2e1940[_0xee72('0x2f')]['id'],{'queueId':_0x52acf7['id']})[_0xee72('0x3c')](function(){if(rpc[_0x2e1940[_0xee72('0x2d')]+_0xee72('0x3d')]){return rpc[_0x2e1940[_0xee72('0x2d')]+_0xee72('0x3d')][_0xee72('0x3b')](_0x25c2d1,_0x80d943)[_0xee72('0x35')](function(_0x5881a4){logger[_0xee72('0x36')](_0xee72('0x3e'),_0x5881a4);});}});}}function endRouting(_0x1a3b90,_0x1653e2,_0x4071e0,_0x2bac2e){if(_0x1a3b90&&_0x1653e2){_0x1653e2[_0xee72('0x38')]-=0x1;var _0x1ff6f4={'leaveAt':moment()[_0xee72('0x16')](_0xee72('0x29')),'exitAt':moment()[_0xee72('0x16')](_0xee72('0x29')),'reason':_0xee72('0x3f')};logger['info'](util['format']('[%s][END:QUEUE][NAME:%s]',_0x1a3b90,_0x1653e2['name']));emitChannelQueueInteraction(_0x4071e0[_0xee72('0x2d')],_0x1653e2['name'],_0x4071e0[_0xee72('0x28')],_0x4071e0[_0xee72('0xd')]['name'],_0x4071e0[_0xee72('0x30')]['id'],![],_0x2bac2e);if(rpc[_0x4071e0[_0xee72('0x2d')]+_0xee72('0x3d')]){return rpc[_0x4071e0['channel']+_0xee72('0x3d')][_0xee72('0x3b')](_0x1a3b90,_0x1ff6f4)[_0xee72('0x35')](function(_0x3ec2fa){logger[_0xee72('0x36')](_0xee72('0x3e'),_0x3ec2fa);});}}}function handleFindQueue(_0x174bca){return function(_0x11017d){return _0x11017d['name'][_0xee72('0x40')]()===_0x174bca[_0xee72('0x40')]();};}exports[_0xee72('0x41')]=function(_0x181807,_0x53bb71,_0x451dcb,_0x5d21e7){return function(_0x4bc6b2){try{var _0x702a0d={'name':_0x53bb71[0x0],'timeout':_0x53bb71[0x1]};var _0x152faf=queue[_0xee72('0x42')](_0x702a0d,{'typecast':!![]});if(_0x152faf[_0xee72('0x43')]){logger['error']('[%s][QUEUE]\x20%s',_0x181807,_[_0xee72('0x44')](_0x152faf,'message')[_0xee72('0x45')](',\x20'));_0x4bc6b2[_0xee72('0x46')]();}else{var _0xcc87c1=_[_0xee72('0x47')](_0x451dcb[_0x5d21e7[_0xee72('0x2d')]+_0xee72('0x48')],handleFindQueue(_0x702a0d['name']));if(_0xcc87c1){startRouting(_0x181807,_0xcc87c1,_0x5d21e7,_0x451dcb);var _0x388836=(_0xcc87c1['timeout']||0xa)*0x3e8;var _0x30a107=(_0x702a0d['timeout']||0x14)*0x3e8;var _0x50e6fd;if(_0x388836>_0x30a107){_0x30a107=_0x388836;}var _0x5c228e=seqqueue[_0xee72('0x49')](_0x388836);_0x5c228e['id']=_0x181807;_0x5c228e[_0xee72('0x4a')]=_0x388836;_0x5c228e[_0xee72('0x4b')]=_0x30a107;_0x5c228e[_0xee72('0x2d')]=_0x5d21e7[_0xee72('0x2d')];_0x451dcb[_0xee72('0x4c')][_0x181807]['on'](_0xee72('0x4d'),function(){logger[_0xee72('0x33')](_0xee72('0x4e'),_0x181807);stopRouting(_0x181807,_0xcc87c1,_0x5d21e7,_0x451dcb);clearTimeout(_0x50e6fd);_0x50e6fd=undefined;_0x5c228e[_0xee72('0x4f')](!![]);if(_0x451dcb[_0xee72('0x4c')][_0x181807]){delete _0x451dcb[_0xee72('0x4c')][_0x181807];}_0x4bc6b2['stop']();});_0x451dcb[_0xee72('0x4c')][_0x181807]['on'](_0xee72('0x50'),function(){if(_0x451dcb['rules'][_0x181807]){delete _0x451dcb[_0xee72('0x4c')][_0x181807];}});_0x50e6fd=setTimeout(function(){logger[_0xee72('0x33')](_0xee72('0x51'),_0x181807);endRouting(_0x181807,_0xcc87c1,_0x5d21e7,_0x451dcb);clearTimeout(_0x50e6fd);_0x5c228e[_0xee72('0x4f')](!![]);_0x4bc6b2['next']();},_0x30a107);switch(_0xcc87c1['strategy']){case _0xee72('0x52'):strategy[_0xee72('0x52')](_0x5c228e,_0xcc87c1,_0x451dcb,_0x5d21e7);break;default:strategy[_0xee72('0x53')](_0x5c228e,_0xcc87c1,_0x451dcb,_0x5d21e7);}}else{logger['error']('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x181807,_0x702a0d['name']);_0x4bc6b2[_0xee72('0x46')]();}}}catch(_0xc34373){logger[_0xee72('0x36')](_0xee72('0x54'),_0x181807,_0xc34373[_0xee72('0x55')]);_0x4bc6b2['stop']();}};}; \ No newline at end of file +var _0x108f=['waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','InteractionId','interaction','MessageId','message','AccountId','info','name','QueueReport','create','catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update','then','update\x20queue\x20report','timeout','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','Queues','createQueue','atimeout','qtimeout','rules','close','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','validate','lodash','util','ioredis','../../../../config/environment','routing','redis','defaults','localhost','queue_id','account','queue','from','clone','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatInteraction','../../rpc/faxInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0x108f,0xbe));var _0xf108=function(_0x29d05e,_0x285605){_0x29d05e=_0x29d05e-0x0;var _0x511abc=_0x108f[_0x29d05e];return _0x511abc;};'use strict';var schema=require(_0xf108('0x0'));var _=require(_0xf108('0x1'));var util=require(_0xf108('0x2'));var seqqueue=require('seq-queue');var moment=require('moment');var Redis=require(_0xf108('0x3'));var config=require(_0xf108('0x4'));var logger=require('../../../../config/logger')(_0xf108('0x5'));var strategy=require('./strategy');config[_0xf108('0x6')]=_[_0xf108('0x7')](config[_0xf108('0x6')],{'host':_0xf108('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf108('0x6')]));var attributes=['id',_0xf108('0x9'),_0xf108('0xa'),_0xf108('0xb'),_0xf108('0xc'),'joinAt'];function emit(_0x3a824d,_0x3e07f4,_0x4e6b37){io['to'](_0x3a824d)['emit'](_0x3e07f4,_0x4e6b37);}function emitChannelQueueInteraction(_0x1631d7,_0x5809fa,_0x5814c3,_0x4111de,_0x477c7b,_0x2c0aef,_0x33c263,_0x3b8e5e){var _0x319833=_[_0xf108('0xd')](_0x5814c3);_0x319833[_0xf108('0x9')]=_0x3b8e5e;_0x319833[_0xf108('0xb')]=_0x5809fa;_0x319833[_0xf108('0xa')]=_0x4111de;_0x319833['id']=_0x477c7b;if(_0x2c0aef){attributes['push'](_['capitalize'](_0x1631d7)+'InteractionId');_0x33c263[util[_0xf108('0xe')](_0xf108('0xf'),_0x1631d7)][_0x477c7b]=_[_0xf108('0x10')](_0x319833,attributes);}else{delete _0x33c263[util['format'](_0xf108('0xf'),_0x1631d7)][_0x477c7b];}emit(util['format'](_0xf108('0x11'),_0x1631d7,_0x5809fa),util[_0xf108('0xe')](_0xf108('0x12'),_0x1631d7,_0x2c0aef?_0xf108('0x13'):_0xf108('0x14')),_['pick'](_0x319833,attributes));}var rpc={'openchannelQueueReport':require(_0xf108('0x15')),'mailQueueReport':require(_0xf108('0x16')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require('../../rpc/whatsappQueueReport'),'chatInteraction':require(_0xf108('0x17')),'faxInteraction':require(_0xf108('0x18')),'mailInteraction':require('../../rpc/mailInteraction'),'openchannelInteraction':require(_0xf108('0x19')),'smsInteraction':require(_0xf108('0x1a')),'whatsappInteraction':require(_0xf108('0x1b'))};var queue=schema({'name':{'type':_0xf108('0x1c'),'required':!![],'message':_0xf108('0x1d')},'timeout':{'type':_0xf108('0x1e'),'message':_0xf108('0x1f')}});function startRouting(_0x80a9a2,_0x19b4b6,_0x38362c,_0x23b87f){if(_0x80a9a2&&_0x19b4b6&&_0x38362c){_0x19b4b6[_0xf108('0x20')]+=0x1;var _0x40ed2a={'uniqueid':_0x80a9a2,'from':_0x38362c[_0xf108('0x21')]?_0x38362c['body']['from']:'','joinAt':moment()[_0xf108('0xe')](_0xf108('0x22')),'ContactId':_0x38362c[_0xf108('0x23')]?_0x38362c[_0xf108('0x23')]['id']:null,'ListId':_0x38362c[_0xf108('0x24')]?_0x38362c[_0xf108('0x24')]['id']:null};_0x40ed2a[_[_0xf108('0x25')](_0x38362c[_0xf108('0x26')])+'QueueId']=_0x19b4b6['id']||null;_0x40ed2a[_[_0xf108('0x25')](_0x38362c[_0xf108('0x26')])+_0xf108('0x27')]=_0x38362c['interaction']?_0x38362c[_0xf108('0x28')]['id']:null;_0x40ed2a[_[_0xf108('0x25')](_0x38362c[_0xf108('0x26')])+_0xf108('0x29')]=_0x38362c[_0xf108('0x2a')]?_0x38362c[_0xf108('0x2a')]['id']:null;_0x40ed2a[_[_0xf108('0x25')](_0x38362c[_0xf108('0x26')])+(_0x38362c[_0xf108('0x26')]!=='chat'?_0xf108('0x2b'):'WebsiteId')]=_0x38362c[_0xf108('0xa')]?_0x38362c[_0xf108('0xa')]['id']:null;logger[_0xf108('0x2c')](util['format']('[%s][START:QUEUE][NAME:%s]',_0x80a9a2,_0x19b4b6[_0xf108('0x2d')]));emitChannelQueueInteraction(_0x38362c['channel'],_0x19b4b6['name'],_0x40ed2a,_0x38362c['account'][_0xf108('0x2d')],_0x38362c[_0xf108('0x2a')]['id'],!![],_0x23b87f,_0x19b4b6['id']);if(rpc[_0x38362c[_0xf108('0x26')]+'QueueReport']){return rpc[_0x38362c[_0xf108('0x26')]+_0xf108('0x2e')][_0xf108('0x2f')](_0x40ed2a)[_0xf108('0x30')](function(_0x121cb5){logger[_0xf108('0x31')](_0xf108('0x32'),_0x121cb5);});}}}function stopRouting(_0x592f09,_0x1f5974,_0x595a1d,_0x19386b){if(_0x592f09&&_0x1f5974){_0x1f5974[_0xf108('0x20')]-=0x1;var _0x53fc79={'leaveAt':moment()[_0xf108('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0xf108('0xe')](_0xf108('0x22')),'reason':_0xf108('0x33')};logger[_0xf108('0x2c')](util[_0xf108('0xe')](_0xf108('0x34'),_0x592f09,_0x1f5974[_0xf108('0x2d')]));emitChannelQueueInteraction(_0x595a1d['channel'],_0x1f5974[_0xf108('0x2d')],_0x595a1d[_0xf108('0x21')],_0x595a1d[_0xf108('0xa')][_0xf108('0x2d')],_0x595a1d['message']['id'],![],_0x19386b,_0x1f5974['id']);return rpc[_0x595a1d[_0xf108('0x26')]+'Interaction'][_0xf108('0x35')](_0x595a1d[_0xf108('0x28')]['id'],{'queueId':_0x1f5974['id']})[_0xf108('0x36')](function(){if(rpc[_0x595a1d[_0xf108('0x26')]+'QueueReport']){return rpc[_0x595a1d[_0xf108('0x26')]+_0xf108('0x2e')][_0xf108('0x35')](_0x592f09,_0x53fc79)['catch'](function(_0x3d6f29){logger[_0xf108('0x31')](_0xf108('0x37'),_0x3d6f29);});}});}}function endRouting(_0x4dc504,_0x1b77cb,_0x5951e5,_0x110bee){if(_0x4dc504&&_0x1b77cb){_0x1b77cb['waiting']-=0x1;var _0x16c61f={'leaveAt':moment()[_0xf108('0xe')](_0xf108('0x22')),'exitAt':moment()[_0xf108('0xe')](_0xf108('0x22')),'reason':_0xf108('0x38')};logger[_0xf108('0x2c')](util['format']('[%s][END:QUEUE][NAME:%s]',_0x4dc504,_0x1b77cb['name']));emitChannelQueueInteraction(_0x5951e5[_0xf108('0x26')],_0x1b77cb[_0xf108('0x2d')],_0x5951e5[_0xf108('0x21')],_0x5951e5[_0xf108('0xa')]['name'],_0x5951e5[_0xf108('0x2a')]['id'],![],_0x110bee);if(rpc[_0x5951e5[_0xf108('0x26')]+_0xf108('0x2e')]){return rpc[_0x5951e5[_0xf108('0x26')]+_0xf108('0x2e')]['update'](_0x4dc504,_0x16c61f)[_0xf108('0x30')](function(_0x2f54e0){logger[_0xf108('0x31')](_0xf108('0x37'),_0x2f54e0);});}}}function handleFindQueue(_0x167c35){return function(_0x4cc647){return _0x4cc647[_0xf108('0x2d')][_0xf108('0x39')]()===_0x167c35['toLowerCase']();};}exports[_0xf108('0x3a')]=function(_0x182ba2,_0x345786,_0x5c1485,_0x27e423){return function(_0x20a6e8){try{var _0x32d45e={'name':_0x345786[0x0],'timeout':_0x345786[0x1]};var _0x3d9591=queue[_0xf108('0x0')](_0x32d45e,{'typecast':!![]});if(_0x3d9591[_0xf108('0x3b')]){logger['error'](_0xf108('0x3c'),_0x182ba2,_[_0xf108('0x3d')](_0x3d9591,_0xf108('0x2a'))[_0xf108('0x3e')](',\x20'));_0x20a6e8[_0xf108('0x3f')]();}else{var _0x7a6664=_['find'](_0x5c1485[_0x27e423[_0xf108('0x26')]+_0xf108('0x40')],handleFindQueue(_0x32d45e[_0xf108('0x2d')]));if(_0x7a6664){startRouting(_0x182ba2,_0x7a6664,_0x27e423,_0x5c1485);var _0x4b02d9=(_0x7a6664['timeout']||0xa)*0x3e8;var _0x1b0433=(_0x32d45e[_0xf108('0x38')]||0x14)*0x3e8;var _0x50b8fc;if(_0x4b02d9>_0x1b0433){_0x1b0433=_0x4b02d9;}var _0x232a8f=seqqueue[_0xf108('0x41')](_0x4b02d9);_0x232a8f['id']=_0x182ba2;_0x232a8f[_0xf108('0x42')]=_0x4b02d9;_0x232a8f[_0xf108('0x43')]=_0x1b0433;_0x232a8f[_0xf108('0x26')]=_0x27e423[_0xf108('0x26')];_0x5c1485[_0xf108('0x44')][_0x182ba2]['on']('end',function(){logger[_0xf108('0x2c')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x182ba2);stopRouting(_0x182ba2,_0x7a6664,_0x27e423,_0x5c1485);clearTimeout(_0x50b8fc);_0x50b8fc=undefined;_0x232a8f[_0xf108('0x45')](!![]);if(_0x5c1485[_0xf108('0x44')][_0x182ba2]){delete _0x5c1485[_0xf108('0x44')][_0x182ba2];}_0x20a6e8[_0xf108('0x3f')]();});_0x5c1485[_0xf108('0x44')][_0x182ba2]['on']('complete',function(){if(_0x5c1485['rules'][_0x182ba2]){delete _0x5c1485[_0xf108('0x44')][_0x182ba2];}});_0x50b8fc=setTimeout(function(){logger[_0xf108('0x2c')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x182ba2);endRouting(_0x182ba2,_0x7a6664,_0x27e423,_0x5c1485);clearTimeout(_0x50b8fc);_0x232a8f['close'](!![]);_0x20a6e8['next']();},_0x1b0433);switch(_0x7a6664['strategy']){case _0xf108('0x46'):strategy[_0xf108('0x46')](_0x232a8f,_0x7a6664,_0x5c1485,_0x27e423);break;default:strategy[_0xf108('0x47')](_0x232a8f,_0x7a6664,_0x5c1485,_0x27e423);}}else{logger['error'](_0xf108('0x48'),_0x182ba2,_0x32d45e['name']);_0x20a6e8[_0xf108('0x3f')]();}}}catch(_0x5af2a7){logger[_0xf108('0x31')]('[%s][QUEUE]\x20%s',_0x182ba2,_0x5af2a7[_0xf108('0x49')]);_0x20a6e8[_0xf108('0x3f')]();}};}; \ 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 d0143e3..384566a 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 _0x7bae=['[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','agents','channel','busy','busyQueue','saveWaitingNotification','showNotification','RINGING',':FORCED','debug','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','writeLog','TIMEOUT','./util','../../../../../config/logger','notificationId','squeue','agent','realtime','routing','push','handleRun','bind','handleTimeout','drained','handleDrained','prototype','[%s][AGENT]\x20try\x20with\x20%s'];(function(_0x56278e,_0x5083c5){var _0x46d37e=function(_0x274725){while(--_0x274725){_0x56278e['push'](_0x56278e['shift']());}};_0x46d37e(++_0x5083c5);}(_0x7bae,0x13b));var _0xe7ba=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0x7bae[_0x4bb66f];return _0xf2772f;};'use strict';var _=require('lodash');var uuid=require('uuid');var util=require(_0xe7ba('0x0'));var logger=require(_0xe7ba('0x1'))('routing');var Agent=function(_0x3963c7,_0x4f2e91,_0x120efa,_0x10908b){this[_0xe7ba('0x2')]=uuid['v4']();this[_0xe7ba('0x3')]=_0x3963c7;this[_0xe7ba('0x4')]=_0x4f2e91;this[_0xe7ba('0x5')]=_0x120efa;this[_0xe7ba('0x6')]=_0x10908b;this[_0xe7ba('0x3')][_0xe7ba('0x7')](this[_0xe7ba('0x8')][_0xe7ba('0x9')](this),this[_0xe7ba('0xa')][_0xe7ba('0x9')](this));this[_0xe7ba('0x3')]['on']('timeout',this[_0xe7ba('0xa')][_0xe7ba('0x9')](this));this[_0xe7ba('0x3')]['on'](_0xe7ba('0xb'),this[_0xe7ba('0xc')][_0xe7ba('0x9')](this));};Agent[_0xe7ba('0xd')][_0xe7ba('0x7')]=function(){this[_0xe7ba('0x3')]['push'](this[_0xe7ba('0x8')]['bind'](this),this[_0xe7ba('0xa')][_0xe7ba('0x9')](this));};Agent[_0xe7ba('0xd')][_0xe7ba('0xc')]=function(){this[_0xe7ba('0xa')](!![]);};Agent[_0xe7ba('0xd')]['handleRun']=function(){logger['debug'](_0xe7ba('0xe'),this[_0xe7ba('0x3')]['id'],this[_0xe7ba('0x4')]['id']);if(_['isNil'](this[_0xe7ba('0x5')]['agents'][this['agent']['id']])){logger['debug'](_0xe7ba('0xf'),this['squeue']['id'],this[_0xe7ba('0x4')]['id']);setTimeout(this['push']['bind'](this),0x3e8);}else{if(this['routing'][_0xe7ba('0x10')]||util[_0xe7ba('0x11')](this[_0xe7ba('0x3')]['id'],this[_0xe7ba('0x5')][_0xe7ba('0x12')][this['agent']['id']],this[_0xe7ba('0x3')][_0xe7ba('0x13')],![])){this[_0xe7ba('0x5')][_0xe7ba('0x12')][this['agent']['id']][_0xe7ba('0x14')]=!![];this[_0xe7ba('0x5')]['agents'][this[_0xe7ba('0x4')]['id']][_0xe7ba('0x15')]=undefined;util[_0xe7ba('0x16')](this[_0xe7ba('0x5')],this[_0xe7ba('0x6')],this[_0xe7ba('0x4')],this[_0xe7ba('0x3')][_0xe7ba('0x13')]);util[_0xe7ba('0x17')](this[_0xe7ba('0x2')],this['squeue']['id'],this['realtime']['agents'][this['agent']['id']],null,this[_0xe7ba('0x6')]);util['writeLog'](this['squeue']['id'],this['realtime'][_0xe7ba('0x12')][this[_0xe7ba('0x4')]['id']],_0xe7ba('0x18')+(this[_0xe7ba('0x6')][_0xe7ba('0x10')]?_0xe7ba('0x19'):''));}else{logger[_0xe7ba('0x1a')](_0xe7ba('0x1b'),this['squeue']['id'],this[_0xe7ba('0x4')]['id']);setTimeout(this['push'][_0xe7ba('0x9')](this),0x3e8);}}};Agent[_0xe7ba('0xd')][_0xe7ba('0xa')]=function(_0x4bf5f9){if(_['isNil'](this[_0xe7ba('0x5')][_0xe7ba('0x12')][this[_0xe7ba('0x4')]['id']])){return logger[_0xe7ba('0x1a')](_0xe7ba('0xf'),this['squeue']['id'],this[_0xe7ba('0x4')]['id']);}else{logger[_0xe7ba('0x1a')]('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0xe7ba('0x3')]['id'],this['agent']['id']);util['hideNotification'](this[_0xe7ba('0x2')],this[_0xe7ba('0x3')]['id'],this[_0xe7ba('0x5')]['agents'][this[_0xe7ba('0x4')]['id']],null,this['routing']);this[_0xe7ba('0x5')][_0xe7ba('0x12')][this[_0xe7ba('0x4')]['id']][_0xe7ba('0x14')]=![];this[_0xe7ba('0x5')]['agents'][this[_0xe7ba('0x4')]['id']][_0xe7ba('0x15')]=undefined;util['removeWaitingNotification'](this[_0xe7ba('0x5')],this[_0xe7ba('0x6')],this[_0xe7ba('0x4')],this['squeue'][_0xe7ba('0x13')]);util[_0xe7ba('0x1c')](this['squeue']['id'],this[_0xe7ba('0x5')][_0xe7ba('0x12')][this[_0xe7ba('0x4')]['id']],_0x4bf5f9?'STOP':_0xe7ba('0x1d'));}if(!_0x4bf5f9){setTimeout(this[_0xe7ba('0x7')]['bind'](this),0x3e8);}};function agent(_0x330e98,_0x3182d9,_0x8a5776,_0x582833){return new Agent(_0x330e98,_0x3182d9,_0x8a5776,_0x582833);}module['exports']=agent; \ No newline at end of file +var _0x5fd1=['forcedOwnership','channel','busy','busyQueue','saveWaitingNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','removeWaitingNotification','TIMEOUT','lodash','./util','../../../../../config/logger','routing','notificationId','agent','realtime','squeue','push','bind','handleTimeout','timeout','prototype','handleRun','debug','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s'];(function(_0x522e69,_0x495eb0){var _0x4920e6=function(_0x288efe){while(--_0x288efe){_0x522e69['push'](_0x522e69['shift']());}};_0x4920e6(++_0x495eb0);}(_0x5fd1,0x155));var _0x15fd=function(_0x5ccc4f,_0x104b4b){_0x5ccc4f=_0x5ccc4f-0x0;var _0x36ad21=_0x5fd1[_0x5ccc4f];return _0x36ad21;};'use strict';var _=require(_0x15fd('0x0'));var uuid=require('uuid');var util=require(_0x15fd('0x1'));var logger=require(_0x15fd('0x2'))(_0x15fd('0x3'));var Agent=function(_0x50fc5a,_0x5d2d77,_0x370d34,_0x3138f3){this[_0x15fd('0x4')]=uuid['v4']();this['squeue']=_0x50fc5a;this[_0x15fd('0x5')]=_0x5d2d77;this[_0x15fd('0x6')]=_0x370d34;this[_0x15fd('0x3')]=_0x3138f3;this[_0x15fd('0x7')][_0x15fd('0x8')](this['handleRun'][_0x15fd('0x9')](this),this[_0x15fd('0xa')][_0x15fd('0x9')](this));this['squeue']['on'](_0x15fd('0xb'),this['handleTimeout'][_0x15fd('0x9')](this));this[_0x15fd('0x7')]['on']('drained',this['handleDrained']['bind'](this));};Agent[_0x15fd('0xc')][_0x15fd('0x8')]=function(){this[_0x15fd('0x7')][_0x15fd('0x8')](this[_0x15fd('0xd')][_0x15fd('0x9')](this),this[_0x15fd('0xa')][_0x15fd('0x9')](this));};Agent[_0x15fd('0xc')]['handleDrained']=function(){this['handleTimeout'](!![]);};Agent['prototype'][_0x15fd('0xd')]=function(){logger[_0x15fd('0xe')](_0x15fd('0xf'),this[_0x15fd('0x7')]['id'],this[_0x15fd('0x5')]['id']);if(_[_0x15fd('0x10')](this[_0x15fd('0x6')][_0x15fd('0x11')][this['agent']['id']])){logger['debug'](_0x15fd('0x12'),this['squeue']['id'],this[_0x15fd('0x5')]['id']);setTimeout(this['push'][_0x15fd('0x9')](this),0x3e8);}else{if(this[_0x15fd('0x3')][_0x15fd('0x13')]||util['isAgentAvailable'](this[_0x15fd('0x7')]['id'],this[_0x15fd('0x6')][_0x15fd('0x11')][this[_0x15fd('0x5')]['id']],this[_0x15fd('0x7')][_0x15fd('0x14')],![])){this[_0x15fd('0x6')][_0x15fd('0x11')][this[_0x15fd('0x5')]['id']][_0x15fd('0x15')]=!![];this[_0x15fd('0x6')]['agents'][this['agent']['id']][_0x15fd('0x16')]=undefined;util[_0x15fd('0x17')](this[_0x15fd('0x6')],this[_0x15fd('0x3')],this[_0x15fd('0x5')],this[_0x15fd('0x7')][_0x15fd('0x14')]);util['showNotification'](this[_0x15fd('0x4')],this[_0x15fd('0x7')]['id'],this[_0x15fd('0x6')]['agents'][this[_0x15fd('0x5')]['id']],null,this['routing']);util[_0x15fd('0x18')](this[_0x15fd('0x7')]['id'],this[_0x15fd('0x6')]['agents'][this[_0x15fd('0x5')]['id']],_0x15fd('0x19')+(this[_0x15fd('0x3')]['forcedOwnership']?_0x15fd('0x1a'):''));}else{logger['debug'](_0x15fd('0x1b'),this[_0x15fd('0x7')]['id'],this[_0x15fd('0x5')]['id']);setTimeout(this[_0x15fd('0x8')][_0x15fd('0x9')](this),0x3e8);}}};Agent[_0x15fd('0xc')][_0x15fd('0xa')]=function(_0xe650a3){if(_[_0x15fd('0x10')](this[_0x15fd('0x6')][_0x15fd('0x11')][this['agent']['id']])){return logger[_0x15fd('0xe')](_0x15fd('0x12'),this['squeue']['id'],this[_0x15fd('0x5')]['id']);}else{logger[_0x15fd('0xe')]('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0x15fd('0x7')]['id'],this[_0x15fd('0x5')]['id']);util['hideNotification'](this[_0x15fd('0x4')],this[_0x15fd('0x7')]['id'],this[_0x15fd('0x6')][_0x15fd('0x11')][this[_0x15fd('0x5')]['id']],null,this[_0x15fd('0x3')]);this['realtime'][_0x15fd('0x11')][this[_0x15fd('0x5')]['id']][_0x15fd('0x15')]=![];this[_0x15fd('0x6')]['agents'][this[_0x15fd('0x5')]['id']][_0x15fd('0x16')]=undefined;util[_0x15fd('0x1c')](this[_0x15fd('0x6')],this[_0x15fd('0x3')],this[_0x15fd('0x5')],this['squeue'][_0x15fd('0x14')]);util[_0x15fd('0x18')](this['squeue']['id'],this[_0x15fd('0x6')][_0x15fd('0x11')][this[_0x15fd('0x5')]['id']],_0xe650a3?'STOP':_0x15fd('0x1d'));}if(!_0xe650a3){setTimeout(this[_0x15fd('0x8')][_0x15fd('0x9')](this),0x3e8);}};function agent(_0xbe50e7,_0x163380,_0x6b2ac8,_0x4d7259){return new Agent(_0xbe50e7,_0x163380,_0x6b2ac8,_0x4d7259);}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 866c6dd..658bcce 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 _0x9281=['channel','writeLog','RINGING','busy','busyQueue','name','saveWaitingNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','STOP','TIMEOUT','removeWaitingNotification','lodash','uuid','./util','../../../../../config/logger','notificationId','squeue','queue','realtime','routing','push','handleRun','handleTimeout','bind','timeout','handleDrained','prototype','isNil','Agents','length','agents','debug','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x9281,0x79));var _0x1928=function(_0xf6dedd,_0x425fb3){_0xf6dedd=_0xf6dedd-0x0;var _0xcdb4cd=_0x9281[_0xf6dedd];return _0xcdb4cd;};'use strict';var _=require(_0x1928('0x0'));var uuid=require(_0x1928('0x1'));var util=require(_0x1928('0x2'));var logger=require(_0x1928('0x3'))('routing');var Beepall=function(_0x4560fa,_0xecd42,_0x3a02b0,_0x44bd4e){this[_0x1928('0x4')]=uuid['v4']();this[_0x1928('0x5')]=_0x4560fa;this[_0x1928('0x6')]=_0xecd42;this[_0x1928('0x7')]=_0x3a02b0;this[_0x1928('0x8')]=_0x44bd4e;this[_0x1928('0x5')][_0x1928('0x9')](this[_0x1928('0xa')]['bind'](this),this[_0x1928('0xb')][_0x1928('0xc')](this));this[_0x1928('0x5')]['on'](_0x1928('0xd'),this[_0x1928('0xb')][_0x1928('0xc')](this));this[_0x1928('0x5')]['on']('drained',this[_0x1928('0xe')][_0x1928('0xc')](this));};Beepall[_0x1928('0xf')][_0x1928('0x9')]=function(){this[_0x1928('0x5')][_0x1928('0x9')](this[_0x1928('0xa')]['bind'](this),this['handleTimeout'][_0x1928('0xc')](this));};Beepall[_0x1928('0xf')]['handleDrained']=function(){this[_0x1928('0xb')](!![]);};Beepall[_0x1928('0xf')][_0x1928('0xa')]=function(){var _0x5e3bc2=!![];if(!_['isNil'](this[_0x1928('0x6')])&&!_[_0x1928('0x10')](this[_0x1928('0x6')][_0x1928('0x11')])&&this[_0x1928('0x6')][_0x1928('0x11')][_0x1928('0x12')]>0x0){for(var _0x44d45f=0x0,_0xb83bba;_0x44d45f0x0){for(var _0x3c1778=0x0,_0x1d00ec;_0x3c17780x0&&_0x595c55[_0x85ceb0+'CurrentCapacity']>=_0x595c55[_0x85ceb0+_0xa6a8('0x20')]){writeLog(_0x3bec47,_0x595c55,_0x85ceb0[_0xa6a8('0x21')]()+_0xa6a8('0x22'));return![];}}return!![];};exports['showNotification']=function(_0x26d819,_0x229e59,_0x4efcb1,_0x33f8c2,_0x1646b7){return sendNotification(!![],_0x26d819,_0x229e59,_0x4efcb1,_0x33f8c2,_0x1646b7);};exports[_0xa6a8('0x23')]=function(_0x502a2e,_0xd95f4f,_0x7bbcc4,_0x4b25a1,_0x3bd725){return sendNotification(![],_0x502a2e,_0xd95f4f,_0x7bbcc4,_0x4b25a1,_0x3bd725);};exports['checkWaitingNotifications']=function(_0x2cf587,_0x491dcf,_0x2a2801){var _0x39f3a3=_0x491dcf[_0xa6a8('0x24')][_0xa6a8('0x25')];if(!_0x39f3a3&&_0x2a2801){_0x39f3a3=_0x2a2801['id'];}var _0x235ba5=_['some'](_0x2cf587[_0x491dcf[_0xa6a8('0x26')]+_0xa6a8('0x27')],function(_0x556472){var _0x2bf22b=_[_0xa6a8('0x28')](_0x491dcf[_0xa6a8('0x26')])+_0xa6a8('0x29');return _0x556472[_0x2bf22b]===_0x491dcf[_0xa6a8('0x24')]['id'];});if(!_0x235ba5&&_0x39f3a3&&_0x2cf587[_0xa6a8('0x2a')][_0x39f3a3]){_0x235ba5=_[_0xa6a8('0x2b')](_0x2cf587[_0xa6a8('0x2a')][_0x39f3a3][_0x491dcf['channel']+'WaitingInteractions'],function(_0x21a332){return _0x21a332['id']===_0x491dcf[_0xa6a8('0x24')]['id'];});}return _0x235ba5;};exports['saveWaitingNotification']=function(_0x4f90be,_0x123520,_0x217936,_0x48d16c){if(_0x217936&&_0x217936['id']&&_0x4f90be[_0xa6a8('0x2a')]&&_0x4f90be[_0xa6a8('0x2a')][_0x217936['id']]){_0x4f90be[_0xa6a8('0x2a')][_0x217936['id']][_0x48d16c+_0xa6a8('0x2c')][_0x123520[_0xa6a8('0x15')]['id']]={'id':_0x123520[_0xa6a8('0x24')]['id']};}};exports['removeWaitingNotification']=function(_0x898d21,_0x34df2b,_0x2fdef9,_0x19249f){if(_0x2fdef9&&_0x2fdef9['id']&&_0x898d21[_0xa6a8('0x2a')]&&_0x898d21[_0xa6a8('0x2a')][_0x2fdef9['id']]){delete _0x898d21[_0xa6a8('0x2a')][_0x2fdef9['id']][_0x19249f+_0xa6a8('0x2c')][_0x34df2b[_0xa6a8('0x15')]['id']];}};exports[_0xa6a8('0x2d')]=writeLog; \ No newline at end of file +var _0x1d21=['Pause','PAUSE','hasOwnProperty','CurrentCapacity','Capacity','toUpperCase','\x20MAXCAPACITY','showNotification','checkWaitingNotifications','interaction','some','channel','QueuesWaitingInteractions','capitalize','InteractionId','agents','saveWaitingNotification','WaitingInteractions','removeWaitingNotification','writeLog','lodash','util','../utils','ioredis','../../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','split','\x20interaction','name','notificationSound','account','notificationShake','body','queue','msg','getMustacheRender','error','format','[%s][QUEUE]\x20%s','message','user:%s','emit','notification:%s','save','remove','debug','isAgentAvailable','busy','BUSY','OFFLINE'];(function(_0x41b6b1,_0x11a412){var _0x37385f=function(_0x584901){while(--_0x584901){_0x41b6b1['push'](_0x41b6b1['shift']());}};_0x37385f(++_0x11a412);}(_0x1d21,0x158));var _0x11d2=function(_0x4e518d,_0x32a45d){_0x4e518d=_0x4e518d-0x0;var _0x458ff2=_0x1d21[_0x4e518d];return _0x458ff2;};'use strict';var _=require(_0x11d2('0x0'));var util=require(_0x11d2('0x1'));var utils=require(_0x11d2('0x2'));var Redis=require(_0x11d2('0x3'));var config=require('../../../../../config/environment');var logger=require(_0x11d2('0x4'))(_0x11d2('0x5'));config[_0x11d2('0x6')]=_[_0x11d2('0x7')](config['redis'],{'host':_0x11d2('0x8'),'port':0x18eb});var io=require(_0x11d2('0x9'))(new Redis(config[_0x11d2('0x6')]));function sendNotification(_0x21a2d3,_0x1eb6ca,_0x185dc4,_0x3a3713,_0x4d8792,_0xd6d34c){var _0x7f0625=_0xd6d34c||{};var _0x5d88b8=_0x185dc4[_0x11d2('0xa')]('.');var _0x56baa2={'uniqueid':_0x1eb6ca,'channel':_0x5d88b8[0x0],'id':_0x5d88b8[0x1],'title':_0x5d88b8[0x0]+_0x11d2('0xb'),'interactionId':_0x5d88b8[0x2],'queue':_0x4d8792?_0x4d8792[_0x11d2('0xc')]:null,'sound':_0x7f0625['account'][_0x11d2('0xd')],'shake':_0x7f0625[_0x11d2('0xe')][_0x11d2('0xf')]};try{if(!_0x7f0625[_0x11d2('0x10')]){_0x7f0625['body']={};}if(_0x4d8792){_0x7f0625['body'][_0x11d2('0x11')]=_0x4d8792;}else if(_0x7f0625[_0x11d2('0x10')][_0x11d2('0x11')]){delete _0x7f0625['body'][_0x11d2('0x11')];}_0x56baa2[_0x11d2('0x12')]=utils[_0x11d2('0x13')](_0x7f0625[_0x11d2('0xe')]['notificationTemplate'],_0x7f0625);}catch(_0xf78df5){_0x56baa2[_0x11d2('0x12')]='I\x20can\x27t\x20render\x20your\x20template';logger[_0x11d2('0x14')](util[_0x11d2('0x15')](_0x11d2('0x16'),_0x1eb6ca,_0xf78df5[_0x11d2('0x17')]));}io['to'](util[_0x11d2('0x15')](_0x11d2('0x18'),_0x3a3713[_0x11d2('0xc')]))[_0x11d2('0x19')](util[_0x11d2('0x15')](_0x11d2('0x1a'),_0x21a2d3?_0x11d2('0x1b'):_0x11d2('0x1c')),_0x56baa2);}function writeLog(_0x3e0721,_0x58730a,_0x4a0102){return logger[_0x11d2('0x1d')](util[_0x11d2('0x15')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x3e0721,_0x58730a[_0x11d2('0xc')],_0x4a0102));}exports[_0x11d2('0x1e')]=function(_0xdac2d,_0x1e5078,_0xc7ff13,_0x4df652){if(_0x1e5078[_0x11d2('0x1f')]){writeLog(_0xdac2d,_0x1e5078,_0x11d2('0x20'));return![];}if(!_0x1e5078['online']){writeLog(_0xdac2d,_0x1e5078,_0x11d2('0x21'));return![];}if(_0x1e5078[_0xc7ff13+_0x11d2('0x22')]){writeLog(_0xdac2d,_0x1e5078,_0x11d2('0x23'));return![];}if(_0x4df652&&_0x1e5078[_0x11d2('0x24')](_0xc7ff13+'Capacity')&&_0x1e5078[_0x11d2('0x24')](_0xc7ff13+_0x11d2('0x25'))){if(_0x1e5078[_0xc7ff13+_0x11d2('0x26')]>0x0&&_0x1e5078[_0xc7ff13+_0x11d2('0x25')]>=_0x1e5078[_0xc7ff13+_0x11d2('0x26')]){writeLog(_0xdac2d,_0x1e5078,_0xc7ff13[_0x11d2('0x27')]()+_0x11d2('0x28'));return![];}}return!![];};exports[_0x11d2('0x29')]=function(_0x5dd42a,_0x203ec4,_0xfecd81,_0x51f474,_0x41e9af){return sendNotification(!![],_0x5dd42a,_0x203ec4,_0xfecd81,_0x51f474,_0x41e9af);};exports['hideNotification']=function(_0x5ef7ba,_0x3b3c59,_0x4cb6d4,_0x9a635a,_0x39aac9){return sendNotification(![],_0x5ef7ba,_0x3b3c59,_0x4cb6d4,_0x9a635a,_0x39aac9);};exports[_0x11d2('0x2a')]=function(_0x426523,_0x1eeca4,_0x215c54){var _0x143a9d=_0x1eeca4[_0x11d2('0x2b')]['UserId'];if(!_0x143a9d&&_0x215c54){_0x143a9d=_0x215c54['id'];}var _0x190fd2=_[_0x11d2('0x2c')](_0x426523[_0x1eeca4[_0x11d2('0x2d')]+_0x11d2('0x2e')],function(_0x3bbe1a){var _0x28f56b=_[_0x11d2('0x2f')](_0x1eeca4[_0x11d2('0x2d')])+_0x11d2('0x30');return _0x3bbe1a[_0x28f56b]===_0x1eeca4[_0x11d2('0x2b')]['id'];});if(!_0x190fd2&&_0x143a9d&&_0x426523[_0x11d2('0x31')][_0x143a9d]){_0x190fd2=_[_0x11d2('0x2c')](_0x426523[_0x11d2('0x31')][_0x143a9d][_0x1eeca4[_0x11d2('0x2d')]+'WaitingInteractions'],function(_0x6cd69f){return _0x6cd69f['id']===_0x1eeca4[_0x11d2('0x2b')]['id'];});}return _0x190fd2;};exports[_0x11d2('0x32')]=function(_0x3ff175,_0x3132fb,_0x4a6ce8,_0x36379c){if(_0x4a6ce8&&_0x4a6ce8['id']&&_0x3ff175[_0x11d2('0x31')]&&_0x3ff175[_0x11d2('0x31')][_0x4a6ce8['id']]){_0x3ff175[_0x11d2('0x31')][_0x4a6ce8['id']][_0x36379c+_0x11d2('0x33')][_0x3132fb['message']['id']]={'id':_0x3132fb['interaction']['id']};}};exports[_0x11d2('0x34')]=function(_0x435641,_0x185099,_0x70419a,_0x3c9e6b){if(_0x70419a&&_0x70419a['id']&&_0x435641['agents']&&_0x435641['agents'][_0x70419a['id']]){delete _0x435641[_0x11d2('0x31')][_0x70419a['id']][_0x3c9e6b+'WaitingInteractions'][_0x185099[_0x11d2('0x17')]['id']];}};exports[_0x11d2('0x35')]=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index 8fdc769..fe07b8c 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 _0x4e6f=['info','getMustacheRender','exec','trim','replace','isEmpty','[%s][SYSTEM]\x20no\x20variable','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','body','error','stringify','validate','lodash','./utils','../../../../config/logger','routing','string','consequence','length','[%s][SYSTEM]\x20%s','map','message','join'];(function(_0x21af3a,_0x386e1d){var _0x268a49=function(_0x41a650){while(--_0x41a650){_0x21af3a['push'](_0x21af3a['shift']());}};_0x268a49(++_0x386e1d);}(_0x4e6f,0x14d));var _0xf4e6=function(_0x2b2c20,_0x4cf202){_0x2b2c20=_0x2b2c20-0x0;var _0x25407c=_0x4e6f[_0x2b2c20];return _0x25407c;};'use strict';var schema=require(_0xf4e6('0x0'));var sh=require('shelljs');var _=require(_0xf4e6('0x1'));var utils=require(_0xf4e6('0x2'));var logger=require(_0xf4e6('0x3'))(_0xf4e6('0x4'));var system=schema({'command':{'type':_0xf4e6('0x5'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xf4e6('0x6')]=function(_0x333307,_0x376427){return function(_0x4644bb){try{var _0x5454a6={'command':_0x376427[0x0]};var _0x470098=system[_0xf4e6('0x0')](_0x5454a6,{'typecast':!![]});if(_0x470098[_0xf4e6('0x7')]){logger['error'](_0xf4e6('0x8'),_0x333307,_[_0xf4e6('0x9')](_0x470098,_0xf4e6('0xa'))[_0xf4e6('0xb')](',\x20'));logger[_0xf4e6('0xc')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x333307);_0x4644bb['next']();}else{var _0x43969a=this;var _0x3de2bc=utils[_0xf4e6('0xd')](_0x376427[0x0],this);logger[_0xf4e6('0xc')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x333307,_0x3de2bc);sh[_0xf4e6('0xe')](_[_0xf4e6('0xf')](_0x3de2bc),function(_0x21823e,_0x4babed){logger[_0xf4e6('0xc')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x333307,_0x21823e);if(_0x21823e==0x0){var _0x4a5e03=_0x4babed[_0xf4e6('0x10')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x376427[0x1])||_[_0xf4e6('0x11')](_0x376427[0x1])){logger['info'](_0xf4e6('0x12'),_0x333307);_0x43969a['body'][_0x376427[0x1]]=_0x4a5e03;}else{logger['info'](_0xf4e6('0x13'),_0x333307,_0x376427[0x1],_0x4a5e03);_0x43969a[_0xf4e6('0x14')][_0x376427[0x1]]=_0x4a5e03;}}_0x4644bb['next']();});}}catch(_0x2b316a){logger[_0xf4e6('0x15')](_0xf4e6('0x8'),_0x333307,_['isObject'](_0x2b316a)?JSON[_0xf4e6('0x16')](_0x2b316a):_0x2b316a);logger[_0xf4e6('0xc')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x333307);_0x4644bb['next']();}};}; \ No newline at end of file +var _0xff98=['consequence','validate','length','error','[%s][SYSTEM]\x20%s','map','message','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','shelljs','lodash','./utils','../../../../config/logger','string'];(function(_0xab39a,_0x9d1016){var _0x17bbe2=function(_0x5b4881){while(--_0x5b4881){_0xab39a['push'](_0xab39a['shift']());}};_0x17bbe2(++_0x9d1016);}(_0xff98,0x9c));var _0x8ff9=function(_0xa9e4b5,_0x12e966){_0xa9e4b5=_0xa9e4b5-0x0;var _0x356027=_0xff98[_0xa9e4b5];return _0x356027;};'use strict';var schema=require('validate');var sh=require(_0x8ff9('0x0'));var _=require(_0x8ff9('0x1'));var utils=require(_0x8ff9('0x2'));var logger=require(_0x8ff9('0x3'))('routing');var system=schema({'command':{'type':_0x8ff9('0x4'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x8ff9('0x5')]=function(_0x5be38f,_0x2fdb87){return function(_0x50c460){try{var _0x7b1d31={'command':_0x2fdb87[0x0]};var _0x2c11a2=system[_0x8ff9('0x6')](_0x7b1d31,{'typecast':!![]});if(_0x2c11a2[_0x8ff9('0x7')]){logger[_0x8ff9('0x8')](_0x8ff9('0x9'),_0x5be38f,_[_0x8ff9('0xa')](_0x2c11a2,_0x8ff9('0xb'))['join'](',\x20'));logger[_0x8ff9('0xc')](_0x8ff9('0xd'),_0x5be38f);_0x50c460[_0x8ff9('0xe')]();}else{var _0x725644=this;var _0xee279a=utils[_0x8ff9('0xf')](_0x2fdb87[0x0],this);logger[_0x8ff9('0xc')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x5be38f,_0xee279a);sh['exec'](_['trim'](_0xee279a),function(_0x13986f,_0x18367c){logger[_0x8ff9('0xc')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x5be38f,_0x13986f);if(_0x13986f==0x0){var _0x3c655c=_0x18367c[_0x8ff9('0x10')](/(\r\n|\n|\r)/gm,'');if(_[_0x8ff9('0x11')](_0x2fdb87[0x1])||_[_0x8ff9('0x12')](_0x2fdb87[0x1])){logger[_0x8ff9('0xc')](_0x8ff9('0x13'),_0x5be38f);_0x725644[_0x8ff9('0x14')][_0x2fdb87[0x1]]=_0x3c655c;}else{logger['info'](_0x8ff9('0x15'),_0x5be38f,_0x2fdb87[0x1],_0x3c655c);_0x725644[_0x8ff9('0x14')][_0x2fdb87[0x1]]=_0x3c655c;}}_0x50c460[_0x8ff9('0xe')]();});}}catch(_0x5b5a3e){logger[_0x8ff9('0x8')]('[%s][SYSTEM]\x20%s',_0x5be38f,_[_0x8ff9('0x16')](_0x5b5a3e)?JSON['stringify'](_0x5b5a3e):_0x5b5a3e);logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x5be38f);_0x50c460['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index d90bc55..c2fb67c 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 _0xfef9=['catch','stringify','finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][TAG]\x20%s','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s'];(function(_0x5c48fd,_0x3c8154){var _0x1bc1fe=function(_0x2b1735){while(--_0x2b1735){_0x5c48fd['push'](_0x5c48fd['shift']());}};_0x1bc1fe(++_0x3c8154);}(_0xfef9,0x126));var _0x9fef=function(_0xf13ca6,_0x5735ea){_0xf13ca6=_0xf13ca6-0x0;var _0x4a4387=_0xfef9[_0xf13ca6];return _0x4a4387;};'use strict';var schema=require(_0x9fef('0x0'));var _=require(_0x9fef('0x1'));var rpc={'chatInteraction':require(_0x9fef('0x2')),'openchannelInteraction':require(_0x9fef('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x9fef('0x4')),'faxInteraction':require(_0x9fef('0x5')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0x9fef('0x6'))(_0x9fef('0x7'));var tag=schema({'tag':{'type':_0x9fef('0x8'),'required':!![],'message':_0x9fef('0x9')}});exports[_0x9fef('0xa')]=function(_0x5cc8e5,_0x44f2ef,_0x1d7c79,_0xf55f44){return function(_0x383e78){try{var _0x59d9bc={'tag':_0x44f2ef[0x0]};var _0x48c8aa=tag[_0x9fef('0x0')](_0x59d9bc,{'typecast':!![]});if(_0x48c8aa['length']){logger[_0x9fef('0xb')](_0x9fef('0xc'),_0x5cc8e5,_[_0x9fef('0xd')](_0x48c8aa,_0x9fef('0xe'))[_0x9fef('0xf')](',\x20'));logger[_0x9fef('0x10')](_0x9fef('0x11'),_0x5cc8e5);_0x383e78[_0x9fef('0x12')]();}else{var _0x3fe6cd={'ids':[_0x44f2ef[0x0]]};if(rpc[_0xf55f44[_0x9fef('0x13')]+_0x9fef('0x14')]){rpc[_0xf55f44['channel']+_0x9fef('0x14')][_0x9fef('0x15')](_0xf55f44[_0x9fef('0x16')]['id'],_0x3fe6cd)[_0x9fef('0x17')](function(_0x143dd3){logger[_0x9fef('0x10')](_0x9fef('0x18'),_0x5cc8e5,_0x44f2ef[0x1],_0xf55f44['channel'],_0xf55f44[_0x9fef('0x16')]['id']);})[_0x9fef('0x19')](function(_0xae694c){logger[_0x9fef('0xb')]('[%s][TAG]\x20%s',_0x5cc8e5,JSON[_0x9fef('0x1a')](_0xae694c));logger['info'](_0x9fef('0x11'),_0x5cc8e5);})[_0x9fef('0x1b')](function(){_0x383e78[_0x9fef('0x12')]();});}}}catch(_0x1708e1){logger[_0x9fef('0xb')](_0x9fef('0xc'),_0x5cc8e5,_[_0x9fef('0x1c')](_0x1708e1)?JSON[_0x9fef('0x1a')](_0x1708e1):_0x1708e1);logger[_0x9fef('0x10')](_0x9fef('0x11'),_0x5cc8e5);_0x383e78['next']();}};}; \ No newline at end of file +var _0xbbb0=['../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','map','message','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','[%s][TAG]\x20%s','stringify','isObject','validate','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction'];(function(_0x588f41,_0x4b7dbd){var _0x3b5aa8=function(_0x133053){while(--_0x133053){_0x588f41['push'](_0x588f41['shift']());}};_0x3b5aa8(++_0x4b7dbd);}(_0xbbb0,0x1c6));var _0x0bbb=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xbbb0[_0x9aada2];return _0x196dff;};'use strict';var schema=require(_0x0bbb('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0x0bbb('0x1')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x0bbb('0x2')),'mailInteraction':require(_0x0bbb('0x3')),'faxInteraction':require(_0x0bbb('0x4')),'whatsappInteraction':require(_0x0bbb('0x5'))};var logger=require(_0x0bbb('0x6'))(_0x0bbb('0x7'));var tag=schema({'tag':{'type':_0x0bbb('0x8'),'required':!![],'message':_0x0bbb('0x9')}});exports[_0x0bbb('0xa')]=function(_0x3f5f9f,_0x32aa6b,_0x1e8ece,_0x2ba2bb){return function(_0xf8acfa){try{var _0x2b380b={'tag':_0x32aa6b[0x0]};var _0x3dbf78=tag[_0x0bbb('0x0')](_0x2b380b,{'typecast':!![]});if(_0x3dbf78['length']){logger[_0x0bbb('0xb')]('[%s][TAG]\x20%s',_0x3f5f9f,_[_0x0bbb('0xc')](_0x3dbf78,_0x0bbb('0xd'))['join'](',\x20'));logger[_0x0bbb('0xe')](_0x0bbb('0xf'),_0x3f5f9f);_0xf8acfa[_0x0bbb('0x10')]();}else{var _0x31d07f={'ids':[_0x32aa6b[0x0]]};if(rpc[_0x2ba2bb[_0x0bbb('0x11')]+_0x0bbb('0x12')]){rpc[_0x2ba2bb['channel']+_0x0bbb('0x12')][_0x0bbb('0x13')](_0x2ba2bb['interaction']['id'],_0x31d07f)[_0x0bbb('0x14')](function(_0x1bc7dc){logger[_0x0bbb('0xe')](_0x0bbb('0x15'),_0x3f5f9f,_0x32aa6b[0x1],_0x2ba2bb[_0x0bbb('0x11')],_0x2ba2bb[_0x0bbb('0x16')]['id']);})[_0x0bbb('0x17')](function(_0xc3ff9d){logger[_0x0bbb('0xb')](_0x0bbb('0x18'),_0x3f5f9f,JSON[_0x0bbb('0x19')](_0xc3ff9d));logger[_0x0bbb('0xe')](_0x0bbb('0xf'),_0x3f5f9f);})['finally'](function(){_0xf8acfa[_0x0bbb('0x10')]();});}}}catch(_0x2e7c95){logger[_0x0bbb('0xb')](_0x0bbb('0x18'),_0x3f5f9f,_[_0x0bbb('0x1a')](_0x2e7c95)?JSON[_0x0bbb('0x19')](_0x2e7c95):_0x2e7c95);logger[_0x0bbb('0xe')](_0x0bbb('0xf'),_0x3f5f9f);_0xf8acfa[_0x0bbb('0x10')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tvox.js b/server/services/routing/server/applications/tvox.js index 61c4eec..d58db91 100644 --- a/server/services/routing/server/applications/tvox.js +++ b/server/services/routing/server/applications/tvox.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6256=['result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','stringify','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','lodash','consequence','replace','includes','push','urlOnAnswer','?params=','urlOnRing','title','jsonrpc','2.0','utf8','POST','application/json-rpc','then','parse'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x6256,0x150));var _0x6625=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x6256[_0x2d2c16];return _0x53f2fb;};'use strict';var rp=require('request-promise');var logger=require('../../../../config/logger')('routing');var _=require(_0x6625('0x0'));var arr=[];exports[_0x6625('0x1')]=function(_0x315972,_0x572aa7){return function(_0x56013a){var _0x22ba3b=_0x572aa7[0xa];var _0x5113b3=_0x572aa7[0xb];var _0x46a0ae=_0x572aa7[0xc];var _0x3103e5=_0x572aa7[0xd];var _0x34a07f=_0x572aa7[0xe];var _0x5677fb=_0x572aa7[0xf][_0x6625('0x2')](/\n/g,'\x20-\x20');var _0x319ecc=_0x572aa7[0x10][_0x6625('0x2')](/\n/g,'\x20');if(!arr[_0x6625('0x3')](_0x5113b3)){arr[_0x6625('0x4')](_0x5113b3);var _0x185344=_0x572aa7[0x3];var _0x3a7aab=_0x572aa7[0x4];var _0x26382b=_0x572aa7[0x1];var _0x2324f4=_0x572aa7[0x0];var _0x1f2e4a={};_0x1f2e4a[_0x6625('0x5')]=_0x572aa7[0x8]+_0x6625('0x6')+_0x46a0ae+'|'+_0x22ba3b+'|'+_0x3103e5+'|'+_0x5113b3+'|'+_0x34a07f;_0x1f2e4a[_0x6625('0x7')]=_0x572aa7[0x7]+_0x6625('0x6')+_0x46a0ae+'|'+_0x22ba3b+'|'+_0x3103e5+'|'+_0x5113b3+'|'+_0x34a07f+'|'+_0x5677fb+'|'+_0x319ecc;_0x1f2e4a[_0x6625('0x8')]=_0x572aa7[0x9];var _0x2749b0={};_0x2749b0[_0x6625('0x9')]=_0x6625('0xa');_0x2749b0['method']='login';var _0x3793cb=[];_0x3793cb['push'](_0x572aa7[0x2]);_0x3793cb[_0x6625('0x4')](_0x572aa7[0x5]);_0x3793cb[_0x6625('0x4')](_0x572aa7[0x6]);_0x2749b0['params']=_0x3793cb;_0x2749b0['id']=0x1;var _0x5baf25=JSON['stringify'](_0x2749b0);var _0x5627d1={'encoding':_0x6625('0xb'),'method':_0x6625('0xc'),'timeout':0x2710,'url':_0x185344,'headers':{'Content-Type':_0x6625('0xd')},'body':_0x5baf25};return rp(_0x5627d1)[_0x6625('0xe')](function(_0x3bc1b0){const _0x49e1d5=JSON[_0x6625('0xf')](_0x3bc1b0);if(!_0x49e1d5[_0x6625('0x10')][_0x6625('0x11')]){throw new Error(_0x6625('0x12'));}var _0x53208c=_0x5113b3;var _0x497c4b=_0x6625('0x13')+_0x26382b+_0x6625('0x14')+_0x2324f4+_0x6625('0x15')+_0x53208c+_0x6625('0x16')+JSON[_0x6625('0x17')](_0x1f2e4a);var _0x23cf05=_0x3a7aab+'?'+_0x497c4b;return rp(_0x23cf05);})['then'](function(_0x596cab){logger[_0x6625('0x18')](_0x6625('0x19'),_0x315972,_0x596cab);_0x56013a[_0x6625('0x1a')]();})[_0x6625('0x1b')](function(_0x3ec06f){logger[_0x6625('0x1c')]('[%s][TVOX]\x20%s',_0x315972,_[_0x6625('0x1d')](_0x3ec06f)?JSON['stringify'](_0x3ec06f):_0x3ec06f);_0x56013a['stop']();});}else{logger['info'](_0x6625('0x1e'),_0x315972);_0x56013a[_0x6625('0x1f')]();}};}; \ No newline at end of file +var _0xa2ca=['login','params','utf8','application/json-rpc','then','parse','result','Unable\x20to\x20login\x20with\x20TVox\x20application','&sessionId=','&data=','stringify','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','routing','lodash','consequence','replace','\x20-\x20','includes','push','urlOnAnswer','?params=','urlOnRing','title','jsonrpc','2.0','method'];(function(_0x461cea,_0x31ee88){var _0x22772e=function(_0x4ed6b4){while(--_0x4ed6b4){_0x461cea['push'](_0x461cea['shift']());}};_0x22772e(++_0x31ee88);}(_0xa2ca,0x9a));var _0xaa2c=function(_0x5bc05a,_0x23f34f){_0x5bc05a=_0x5bc05a-0x0;var _0x37fcf3=_0xa2ca[_0x5bc05a];return _0x37fcf3;};'use strict';var rp=require(_0xaa2c('0x0'));var logger=require(_0xaa2c('0x1'))(_0xaa2c('0x2'));var _=require(_0xaa2c('0x3'));var arr=[];exports[_0xaa2c('0x4')]=function(_0x3d66b9,_0x31f128){return function(_0x32228a){var _0x207cfc=_0x31f128[0xa];var _0x18050b=_0x31f128[0xb];var _0x449c7c=_0x31f128[0xc];var _0xebaa42=_0x31f128[0xd];var _0x23406d=_0x31f128[0xe];var _0x4131b3=_0x31f128[0xf][_0xaa2c('0x5')](/\n/g,_0xaa2c('0x6'));var _0x201d43=_0x31f128[0x10][_0xaa2c('0x5')](/\n/g,'\x20');if(!arr[_0xaa2c('0x7')](_0x18050b)){arr[_0xaa2c('0x8')](_0x18050b);var _0x3d23b5=_0x31f128[0x3];var _0x159ba7=_0x31f128[0x4];var _0x35806d=_0x31f128[0x1];var _0x506e0b=_0x31f128[0x0];var _0x5c26e2={};_0x5c26e2[_0xaa2c('0x9')]=_0x31f128[0x8]+_0xaa2c('0xa')+_0x449c7c+'|'+_0x207cfc+'|'+_0xebaa42+'|'+_0x18050b+'|'+_0x23406d;_0x5c26e2[_0xaa2c('0xb')]=_0x31f128[0x7]+_0xaa2c('0xa')+_0x449c7c+'|'+_0x207cfc+'|'+_0xebaa42+'|'+_0x18050b+'|'+_0x23406d+'|'+_0x4131b3+'|'+_0x201d43;_0x5c26e2[_0xaa2c('0xc')]=_0x31f128[0x9];var _0x43d69a={};_0x43d69a[_0xaa2c('0xd')]=_0xaa2c('0xe');_0x43d69a[_0xaa2c('0xf')]=_0xaa2c('0x10');var _0x41dd6d=[];_0x41dd6d[_0xaa2c('0x8')](_0x31f128[0x2]);_0x41dd6d['push'](_0x31f128[0x5]);_0x41dd6d[_0xaa2c('0x8')](_0x31f128[0x6]);_0x43d69a[_0xaa2c('0x11')]=_0x41dd6d;_0x43d69a['id']=0x1;var _0x38cdfc=JSON['stringify'](_0x43d69a);var _0x150965={'encoding':_0xaa2c('0x12'),'method':'POST','timeout':0x2710,'url':_0x3d23b5,'headers':{'Content-Type':_0xaa2c('0x13')},'body':_0x38cdfc};return rp(_0x150965)[_0xaa2c('0x14')](function(_0xbb5906){const _0x59573c=JSON[_0xaa2c('0x15')](_0xbb5906);if(!_0x59573c[_0xaa2c('0x16')]['logged']){throw new Error(_0xaa2c('0x17'));}var _0x5d0fbc=_0x18050b;var _0x31738c='channelId='+_0x35806d+'&serviceId='+_0x506e0b+_0xaa2c('0x18')+_0x5d0fbc+_0xaa2c('0x19')+JSON[_0xaa2c('0x1a')](_0x5c26e2);var _0x112d81=_0x159ba7+'?'+_0x31738c;return rp(_0x112d81);})[_0xaa2c('0x14')](function(_0x5c011d){logger[_0xaa2c('0x1b')](_0xaa2c('0x1c'),_0x3d66b9,_0x5c011d);_0x32228a[_0xaa2c('0x1d')]();})['catch'](function(_0x4c511d){logger['error'](_0xaa2c('0x1e'),_0x3d66b9,_[_0xaa2c('0x1f')](_0x4c511d)?JSON[_0xaa2c('0x1a')](_0x4c511d):_0x4c511d);_0x32228a[_0xaa2c('0x1d')]();});}else{logger['info'](_0xaa2c('0x20'),_0x3d66b9);_0x32228a[_0xaa2c('0x21')]();}};}; \ 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 0b43462..8eb96f6 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 _0x9c44=['merge','body','account','list','exports','render'];(function(_0x6235ce,_0x3d2dba){var _0x464a55=function(_0x1d29d5){while(--_0x1d29d5){_0x6235ce['push'](_0x6235ce['shift']());}};_0x464a55(++_0x3d2dba);}(_0x9c44,0x178));var _0x49c4=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x9c44[_0x3ff085];return _0x2b68c3;};'use strict';var Mustache=require('mustache');var _=require('lodash');module[_0x49c4('0x0')]={'getMustacheRender':function(_0x18bf2d,_0x26844b){return Mustache[_0x49c4('0x1')](_0x18bf2d,_[_0x49c4('0x2')](_0x26844b[_0x49c4('0x3')],{'contact':_0x26844b['contact'],'message':_0x26844b['message'],'account':_0x26844b[_0x49c4('0x4')],'interaction':_0x26844b['interaction'],'list':_0x26844b[_0x49c4('0x5')]}))||'';}}; \ No newline at end of file +var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x4aa3d9,_0x34d948){var _0x14d216=function(_0x2ac7ea){while(--_0x2ac7ea){_0x4aa3d9['push'](_0x4aa3d9['shift']());}};_0x14d216(++_0x34d948);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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 e58b9ae..97d2588 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 _0xebc4=['execute','info','Applications\x20executed','stringify','matchPath','emit','complete','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','routing\x20is\x20empty','agent','agents','busyQueue','end','update','catch','stack','message\x20is\x20empty','busy','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','find','chatQueues','available','loggedIn','paused','waiting','mailQueues','name','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','path','jayson/promise','bluebird','./applications/strategy/util','../../../config/logger','../rpc/mailQueueReport','../rpc/smsQueueReport','../rpc/whatsappQueueReport','format','%s.%s.%s','isNil','IntervalId','map','Intervals','interval','listen','rules','channel','message','interaction','transfer','applications','isArray','length','join','toLowerCase','autoreply','appdata','split','mail','push','slice','dialogflow','dialogflowv2','tag','TagId','getMustacheRender','account','notificationTemplate','ChatWebsiteId','ContactId','%s:%s:%s','app','./interval','condition','./applications/','consequence','priority','Push\x20new\x20rule','on\x20interval','intervals','error','Please\x20create\x20a\x20new\x20file\x20under'];(function(_0x274dd7,_0x2e6051){var _0x148829=function(_0x4cec98){while(--_0x4cec98){_0x274dd7['push'](_0x274dd7['shift']());}};_0x148829(++_0x2e6051);}(_0xebc4,0xf9));var _0x4ebc=function(_0x3d05f1,_0x10fab4){_0x3d05f1=_0x3d05f1-0x0;var _0x38cafd=_0xebc4[_0x3d05f1];return _0x38cafd;};'use strict';var _=require('lodash');var util=require(_0x4ebc('0x0'));var path=require(_0x4ebc('0x1'));var fs=require('fs');var jayson=require(_0x4ebc('0x2'));var BPromise=require(_0x4ebc('0x3'));var utils=require('./applications/utils');var sUtils=require(_0x4ebc('0x4'));var logger=require(_0x4ebc('0x5'))('routing');var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x4ebc('0x6')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0x4ebc('0x7')),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x4ebc('0x8'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x501944,_0x5a46df,_0x74fcd9){return util[_0x4ebc('0x9')](_0x4ebc('0xa'),_0x501944,_0x5a46df||0x0,_0x74fcd9||0x0);}function getIntervals(_0x1858cb,_0x46e0dc){var _0x5d6a99=[];if(!_[_0x4ebc('0xb')](_0x46e0dc[_0x4ebc('0xc')])&&!_[_0x4ebc('0xb')](_0x1858cb[_0x46e0dc[_0x4ebc('0xc')]])&&!_['isNil'](_0x1858cb[_0x46e0dc[_0x4ebc('0xc')]]['Intervals'])){_0x5d6a99=_[_0x4ebc('0xd')](_0x1858cb[_0x46e0dc[_0x4ebc('0xc')]][_0x4ebc('0xe')],_0x4ebc('0xf'));}else if(!_['isNil'](_0x46e0dc[_0x4ebc('0xf')])){_0x5d6a99=[_0x46e0dc['interval']];}return _0x5d6a99;}exports[_0x4ebc('0x10')]=function(_0x8fd777){_0x8fd777[_0x4ebc('0x11')]={};return new BPromise(function(_0x2117ec,_0x1f9453){var _0x1f1750={'Start':function(_0x5df59d){var _0x4a353=this;return new Promise(function(_0x148dab,_0x1a0b5c){if(_0x5df59d){try{var _0x14591b=[];var _0x4ba710=getId(_0x5df59d[_0x4ebc('0x12')],_0x5df59d[_0x4ebc('0x13')]?_0x5df59d['message']['id']:0x0,_0x5df59d['interaction']?_0x5df59d[_0x4ebc('0x14')]['id']:0x0);var _0x56be9b=sUtils['checkWaitingNotifications'](_0x8fd777,_0x5df59d);if(_0x5df59d[_0x4ebc('0x15')]||!_0x56be9b&&_0x5df59d[_0x4ebc('0x16')]&&_[_0x4ebc('0x17')](_0x5df59d[_0x4ebc('0x16')])&&_0x5df59d['applications']['length']){for(var _0x249dcf=0x0;_0x249dcf<_0x5df59d[_0x4ebc('0x16')][_0x4ebc('0x18')];_0x249dcf+=0x1){var _0x4aa0fe=_0x5df59d[_0x4ebc('0x16')][_0x249dcf];if(fs['existsSync'](path[_0x4ebc('0x19')](__dirname,_0x4ebc('0x16'),_0x4aa0fe['app']+'.js'))){var _0x476902=[];switch(_0x4aa0fe['app'][_0x4ebc('0x1a')]()){case _0x4ebc('0x1b'):var _0x269303=_0x4aa0fe[_0x4ebc('0x1c')][_0x4ebc('0x1d')](',');if(_0x5df59d[_0x4ebc('0x12')]===_0x4ebc('0x1e')){_0x476902[_0x4ebc('0x1f')](_0x269303[0x0]);_0x476902[_0x4ebc('0x1f')](_0x269303[0x1]);_0x476902[_0x4ebc('0x1f')](_0x269303['slice'](0x2,_0x269303[_0x4ebc('0x18')])[_0x4ebc('0x19')](','));}else{_0x476902[_0x4ebc('0x1f')](_0x269303[0x0]);_0x476902[_0x4ebc('0x1f')](_0x269303[_0x4ebc('0x20')](0x1,_0x269303[_0x4ebc('0x18')])[_0x4ebc('0x19')](','));}break;case _0x4ebc('0x21'):var _0x2d68bf=_0x4aa0fe[_0x4ebc('0x1c')][_0x4ebc('0x1d')](',');_0x476902['push'](_0x2d68bf[0x0]);_0x476902[_0x4ebc('0x1f')](_0x2d68bf[0x1]);_0x476902[_0x4ebc('0x1f')](_0x2d68bf['slice'](0x2,_0x2d68bf['length'])[_0x4ebc('0x19')](','));break;case _0x4ebc('0x22'):var _0x2e4c0c=_0x4aa0fe[_0x4ebc('0x1c')][_0x4ebc('0x1d')](',');_0x476902[_0x4ebc('0x1f')](_0x2e4c0c[0x0]);_0x476902[_0x4ebc('0x1f')](_0x2e4c0c[0x1]);_0x476902[_0x4ebc('0x1f')](_0x2e4c0c[0x2]);_0x476902[_0x4ebc('0x1f')](_0x2e4c0c[0x3]);_0x476902['push'](_0x2e4c0c[_0x4ebc('0x20')](0x4,_0x2e4c0c[_0x4ebc('0x18')])[_0x4ebc('0x19')](','));break;case'amazonlex':var _0x3f9c40=_0x4aa0fe[_0x4ebc('0x1c')][_0x4ebc('0x1d')](',');_0x476902[_0x4ebc('0x1f')](_0x3f9c40[0x0]);_0x476902[_0x4ebc('0x1f')](_0x3f9c40[0x1]);_0x476902['push'](_0x3f9c40[0x2]);_0x476902[_0x4ebc('0x1f')](_0x3f9c40[0x3]);_0x476902[_0x4ebc('0x1f')](_0x3f9c40['slice'](0x4,_0x3f9c40[_0x4ebc('0x18')])[_0x4ebc('0x19')](','));break;case _0x4ebc('0x13'):_0x476902[_0x4ebc('0x1f')](_0x4aa0fe[_0x4ebc('0x1c')]);break;case _0x4ebc('0x23'):_0x476902[_0x4ebc('0x1f')](_0x4aa0fe[_0x4ebc('0x24')]);_0x476902[_0x4ebc('0x1f')](_0x4aa0fe['appdata']);break;case'tvox':var _0x161747=utils[_0x4ebc('0x25')](_0x5df59d[_0x4ebc('0x26')][_0x4ebc('0x27')],_0x5df59d);var _0x2aed72=_0x4aa0fe[_0x4ebc('0x1c')][_0x4ebc('0x1d')](',');_0x476902['push'](_0x2aed72[0x0]);_0x476902[_0x4ebc('0x1f')](_0x2aed72[0x1]);_0x476902['push'](_0x2aed72[0x2]);_0x476902['push'](_0x2aed72[0x3]);_0x476902[_0x4ebc('0x1f')](_0x2aed72[0x4]);_0x476902[_0x4ebc('0x1f')](_0x2aed72[0x5]);_0x476902[_0x4ebc('0x1f')](_0x2aed72[0x6]);_0x476902[_0x4ebc('0x1f')](_0x2aed72[0x7]);_0x476902[_0x4ebc('0x1f')](_0x2aed72[0x8]);_0x476902[_0x4ebc('0x1f')](_0x2aed72[0x9]);_0x476902['push'](_0x2aed72[0xa]);_0x476902[_0x4ebc('0x1f')](_0x5df59d['interaction']['id']);_0x476902['push'](_0x5df59d[_0x4ebc('0x13')]['id']);_0x476902[_0x4ebc('0x1f')](_0x4aa0fe[_0x4ebc('0x28')]);_0x476902[_0x4ebc('0x1f')](_0x5df59d[_0x4ebc('0x14')][_0x4ebc('0x29')]);_0x476902[_0x4ebc('0x1f')](_0x5df59d['body']['body']);_0x476902['push'](_0x161747);break;default:_0x476902=_[_0x4ebc('0xb')](_0x4aa0fe[_0x4ebc('0x1c')])?[]:_0x4aa0fe[_0x4ebc('0x1c')]['split'](',');}var _0x278890={'id':util[_0x4ebc('0x9')](_0x4ebc('0x2a'),_0x4ba710,_0x4aa0fe['id'],_0x4aa0fe[_0x4ebc('0x2b')]),'condition':require(_0x4ebc('0x2c'))[_0x4ebc('0x2d')](_0x4ba710,getIntervals(_0x8fd777['intervals'],_0x4aa0fe),_0x8fd777),'consequence':require(_0x4ebc('0x2e')+_0x4aa0fe[_0x4ebc('0x2b')])[_0x4ebc('0x2f')](_0x4ba710,_0x476902,_0x8fd777,_0x5df59d),'p':_0x4aa0fe[_0x4ebc('0x30')]||0x0};logger['info'](_0x4ebc('0x31'),_0x278890['id'],_0x4ebc('0x32'),getIntervals(_0x8fd777[_0x4ebc('0x33')],_0x4aa0fe)['join']('\x20|\x20'));_0x14591b[_0x4ebc('0x1f')](_0x278890);}else{logger[_0x4ebc('0x34')](_0x4ebc('0x35'),path[_0x4ebc('0x19')](__dirname,'applications',_0x4aa0fe[_0x4ebc('0x2b')]+'.js'));}}_0x8fd777[_0x4ebc('0x11')][_0x4ba710]=new RuleEngine(_0x14591b);_0x8fd777[_0x4ebc('0x11')][_0x4ba710][_0x4ebc('0x36')](_0x5df59d,function(_0x3bb8b5){logger[_0x4ebc('0x37')](_0x4ebc('0x38'),JSON[_0x4ebc('0x39')](_0x3bb8b5[_0x4ebc('0x3a')]));if(_0x8fd777[_0x4ebc('0x11')][_0x4ba710]){_0x8fd777[_0x4ebc('0x11')][_0x4ba710][_0x4ebc('0x3b')](_0x4ebc('0x3c'));}});return _0x148dab({'code':0xc8,'message':_0x5df59d});}else{if(_0x56be9b){logger[_0x4ebc('0x37')](util['format'](_0x4ebc('0x3d'),_0x4ba710));}else{logger['info'](_0x4ebc('0x3e'));}return _0x148dab({'code':0xc8,'message':_0x5df59d});}}catch(_0x190be5){logger[_0x4ebc('0x34')](_0x190be5['stack']);return _0x1a0b5c(_0x4a353[_0x4ebc('0x34')](0x1f4,_0x190be5));}}return _0x1a0b5c(_0x4ebc('0x3f'));});},'AcceptMessage':function(_0x753243){var _0x313825=this;return new Promise(function(_0x556c9d,_0x3ec8e8){if(_0x753243[_0x4ebc('0x40')]&&_0x753243['agent']['id']){if(_0x8fd777[_0x4ebc('0x41')][_0x753243['agent']['id']]){_0x8fd777[_0x4ebc('0x41')][_0x753243['agent']['id']]['busy']=![];_0x8fd777[_0x4ebc('0x41')][_0x753243[_0x4ebc('0x40')]['id']][_0x4ebc('0x42')]=undefined;}}if(_0x753243[_0x4ebc('0x13')]&&_0x753243['message']['id']){try{var _0x1b4e0a=getId(_0x753243['channel'],_0x753243[_0x4ebc('0x13')]?_0x753243[_0x4ebc('0x13')]['id']:0x0,_0x753243[_0x4ebc('0x14')]?_0x753243['interaction']['id']:0x0);if(_0x8fd777[_0x4ebc('0x11')][_0x1b4e0a]){_0x8fd777['rules'][_0x1b4e0a][_0x4ebc('0x3b')](_0x4ebc('0x43'));if(rpc[_0x753243[_0x4ebc('0x12')]+'QueueReport']){rpc[_0x753243[_0x4ebc('0x12')]+'QueueReport'][_0x4ebc('0x44')](_0x1b4e0a,{'UserId':_0x753243[_0x4ebc('0x13')]['UserId']})[_0x4ebc('0x45')](function(){logger[_0x4ebc('0x34')]('error\x20update\x20queue\x20report');});}}return _0x556c9d({'code':0xc8,'message':_0x753243});}catch(_0x327c3e){logger[_0x4ebc('0x34')](_0x327c3e[_0x4ebc('0x46')]);return _0x3ec8e8(_0x313825[_0x4ebc('0x34')](0x1f4,_0x327c3e));}}logger[_0x4ebc('0x34')](_0x4ebc('0x47'));return _0x3ec8e8(_0x313825['error'](0x1f4,_0x4ebc('0x47')));});},'RejectMessage':function(_0x4b79cf){var _0x14c3a0=this;return new Promise(function(_0x59aaab,_0x3631e7){if(_0x4b79cf[_0x4ebc('0x40')]&&_0x4b79cf[_0x4ebc('0x40')]['id']){try{if(_0x8fd777['agents'][_0x4b79cf['agent']['id']]){_0x8fd777[_0x4ebc('0x41')][_0x4b79cf[_0x4ebc('0x40')]['id']][_0x4ebc('0x48')]=![];_0x8fd777[_0x4ebc('0x41')][_0x4b79cf[_0x4ebc('0x40')]['id']][_0x4ebc('0x42')]=undefined;}return _0x59aaab({'code':0xc8,'message':_0x4b79cf});}catch(_0x4c7d81){logger[_0x4ebc('0x34')](_0x4c7d81[_0x4ebc('0x46')]);return _0x3631e7(_0x14c3a0['error'](0x1f4,_0x4c7d81));}}logger['error'](_0x4ebc('0x47'));return _0x3631e7(_0x14c3a0['error'](0x1f4,_0x4ebc('0x47')));});},'AbandonInteraction':function(_0x4cb59e){var _0x2dcc89=this;return new Promise(function(_0x18a3ff,_0x245105){if(_0x4cb59e[_0x4ebc('0x12')]&&_0x4cb59e[_0x4ebc('0x14')]&&_0x4cb59e[_0x4ebc('0x14')]['id']){try{var _0x39ce35=getId(_0x4cb59e['channel'],_0x4cb59e[_0x4ebc('0x13')]?_0x4cb59e[_0x4ebc('0x13')]['id']:0x0,_0x4cb59e[_0x4ebc('0x14')]?_0x4cb59e[_0x4ebc('0x14')]['id']:0x0);if(_0x8fd777[_0x4ebc('0x11')][_0x39ce35]){_0x8fd777[_0x4ebc('0x11')][_0x39ce35][_0x4ebc('0x3b')](_0x4ebc('0x43'));}return _0x18a3ff({'code':0xc8,'message':_0x4cb59e});}catch(_0x3863e0){logger['error'](_0x3863e0[_0x4ebc('0x46')]);return _0x245105(_0x2dcc89['error'](0x1f4,_0x3863e0));}}logger['error']('message\x20is\x20empty');return _0x245105(_0x2dcc89[_0x4ebc('0x34')](0x1f4,_0x4ebc('0x47')));});},'AgentCapacity':function(_0x3ea623){var _0x3f96f6=this;return new Promise(function(_0x15d4c1,_0x316b48){if(_0x8fd777[_0x4ebc('0x41')][_0x4ebc('0x49')](_0x3ea623['id'])){for(var _0x17b0c0 in _0x3ea623[_0x4ebc('0x4a')]){if(_0x3ea623[_0x4ebc('0x4a')][_0x4ebc('0x49')](_0x17b0c0)){if(_0x8fd777[_0x4ebc('0x41')][_0x3ea623['id']][_0x4ebc('0x49')](_0x17b0c0+_0x4ebc('0x4b'))){_0x8fd777[_0x4ebc('0x41')][_0x3ea623['id']][_0x17b0c0+_0x4ebc('0x4b')]=parseInt(_0x3ea623[_0x4ebc('0x4a')][_0x17b0c0],0xa);}}}_0x8fd777[_0x4ebc('0x41')][_0x3ea623['id']][_0x4ebc('0x4c')]();return _0x15d4c1({'code':0xc8,'message':_0x8fd777[_0x4ebc('0x41')][_0x3ea623['id']]});}else{return _0x316b48(_0x3f96f6[_0x4ebc('0x34')](0x1f4,_0x4ebc('0x4d')));}});},'Agents':function(_0x11b057){return new Promise(function(_0x4da225){var _0x151d2a=_[_0x4ebc('0x4e')](_0x8fd777[_0x4ebc('0x41')]);if(_0x11b057&&_0x11b057['id']){var _0x3bb2d0=_[_0x4ebc('0x4f')](_0x151d2a,function(_0x569a2d){return _0x569a2d['id']===_0x11b057['id'];});_0x4da225(_0x3bb2d0);}else{_0x4da225({'count':_0x151d2a[_0x4ebc('0x18')],'rows':_0x151d2a});}});},'ChatQueues':function(){return new Promise(function(_0x19286f){var _0x14043b=[];for(var _0x2d2ccd in _0x8fd777[_0x4ebc('0x50')]){if(_0x8fd777[_0x4ebc('0x50')][_0x4ebc('0x49')](_0x2d2ccd)){var _0x2eb6cc=_0x8fd777[_0x4ebc('0x50')][_0x2d2ccd];var _0x28349f={'id':_0x2eb6cc['id'],'available':_0x2eb6cc[_0x4ebc('0x51')],'loggedIn':_0x2eb6cc[_0x4ebc('0x52')],'name':_0x2eb6cc['name'],'paused':_0x2eb6cc[_0x4ebc('0x53')],'waiting':_0x2eb6cc[_0x4ebc('0x54')]};_0x14043b[_0x4ebc('0x1f')](_0x28349f);}}_0x19286f({'count':_0x14043b[_0x4ebc('0x18')],'rows':_0x14043b});});},'MailQueues':function(){return new Promise(function(_0x961356){var _0x261286=[];for(var _0x439f98 in _0x8fd777['mailQueues']){if(_0x8fd777[_0x4ebc('0x55')]['hasOwnProperty'](_0x439f98)){var _0x4a63b8=_0x8fd777['mailQueues'][_0x439f98];var _0x43a78a={'id':_0x4a63b8['id'],'available':_0x4a63b8[_0x4ebc('0x51')],'loggedIn':_0x4a63b8[_0x4ebc('0x52')],'name':_0x4a63b8[_0x4ebc('0x56')],'paused':_0x4a63b8[_0x4ebc('0x53')],'waiting':_0x4a63b8['waiting']};_0x261286['push'](_0x43a78a);}}_0x961356({'count':_0x261286[_0x4ebc('0x18')],'rows':_0x261286});});},'OpenchannelQueues':function(){return new Promise(function(_0x390f6d){var _0x197beb=[];for(var _0x58b475 in _0x8fd777[_0x4ebc('0x57')]){if(_0x8fd777[_0x4ebc('0x57')][_0x4ebc('0x49')](_0x58b475)){var _0x151c76=_0x8fd777['openchannelQueues'][_0x58b475];var _0x439d3b={'id':_0x151c76['id'],'available':_0x151c76[_0x4ebc('0x51')],'loggedIn':_0x151c76[_0x4ebc('0x52')],'name':_0x151c76['name'],'paused':_0x151c76['paused'],'waiting':_0x151c76[_0x4ebc('0x54')]};_0x197beb[_0x4ebc('0x1f')](_0x439d3b);}}_0x390f6d({'count':_0x197beb['length'],'rows':_0x197beb});});},'SmsQueues':function(){return new Promise(function(_0x374e4b){var _0x2e6b36=[];for(var _0x351a35 in _0x8fd777[_0x4ebc('0x58')]){if(_0x8fd777[_0x4ebc('0x58')][_0x4ebc('0x49')](_0x351a35)){var _0x31ee04=_0x8fd777['smsQueues'][_0x351a35];var _0x61607c={'id':_0x31ee04['id'],'available':_0x31ee04['available'],'loggedIn':_0x31ee04[_0x4ebc('0x52')],'name':_0x31ee04[_0x4ebc('0x56')],'paused':_0x31ee04[_0x4ebc('0x53')],'waiting':_0x31ee04['waiting']};_0x2e6b36[_0x4ebc('0x1f')](_0x61607c);}}_0x374e4b({'count':_0x2e6b36[_0x4ebc('0x18')],'rows':_0x2e6b36});});},'FaxQueues':function(){return new Promise(function(_0x1b9c38){var _0x381696=[];for(var _0x43f473 in _0x8fd777[_0x4ebc('0x59')]){if(_0x8fd777['faxQueues'][_0x4ebc('0x49')](_0x43f473)){var _0x19529d=_0x8fd777['faxQueues'][_0x43f473];var _0x2352b8={'id':_0x19529d['id'],'available':_0x19529d[_0x4ebc('0x51')],'loggedIn':_0x19529d['loggedIn'],'name':_0x19529d[_0x4ebc('0x56')],'paused':_0x19529d[_0x4ebc('0x53')],'waiting':_0x19529d[_0x4ebc('0x54')]};_0x381696['push'](_0x2352b8);}}_0x1b9c38({'count':_0x381696['length'],'rows':_0x381696});});},'WhatsappQueues':function(){return new Promise(function(_0x3671be){var _0x5c309f=[];for(var _0x3966e9 in _0x8fd777['whatsappQueues']){if(_0x8fd777[_0x4ebc('0x5a')]['hasOwnProperty'](_0x3966e9)){var _0xb81920=_0x8fd777[_0x4ebc('0x5a')][_0x3966e9];var _0x4aec2e={'id':_0xb81920['id'],'available':_0xb81920[_0x4ebc('0x51')],'loggedIn':_0xb81920[_0x4ebc('0x52')],'name':_0xb81920[_0x4ebc('0x56')],'paused':_0xb81920['paused'],'waiting':_0xb81920[_0x4ebc('0x54')]};_0x5c309f[_0x4ebc('0x1f')](_0x4aec2e);}}_0x3671be({'count':_0x5c309f[_0x4ebc('0x18')],'rows':_0x5c309f});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x5cff43){var _0x1d9437=_[_0x4ebc('0x4e')](_0x8fd777[_0x4ebc('0x5b')]);_0x5cff43({'count':_0x1d9437[_0x4ebc('0x18')],'rows':_0x1d9437});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x4bd443){var _0x2a5866=_[_0x4ebc('0x4e')](_0x8fd777[_0x4ebc('0x5c')]);_0x4bd443({'count':_0x2a5866[_0x4ebc('0x18')],'rows':_0x2a5866});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x2067f3){var _0x41bd47=_[_0x4ebc('0x4e')](_0x8fd777[_0x4ebc('0x5d')]);_0x2067f3({'count':_0x41bd47[_0x4ebc('0x18')],'rows':_0x41bd47});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x479fae){var _0x4af4a5=_['values'](_0x8fd777['smsQueuesWaitingInteractions']);_0x479fae({'count':_0x4af4a5[_0x4ebc('0x18')],'rows':_0x4af4a5});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x4b0dbf){var _0x4c8df6=_[_0x4ebc('0x4e')](_0x8fd777[_0x4ebc('0x5e')]);_0x4b0dbf({'count':_0x4c8df6[_0x4ebc('0x18')],'rows':_0x4c8df6});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x2dfa5b){var _0x27f190=_[_0x4ebc('0x4e')](_0x8fd777['whatsappQueuesWaitingInteractions']);_0x2dfa5b({'count':_0x27f190[_0x4ebc('0x18')],'rows':_0x27f190});});}};var _0x4928d4=jayson[_0x4ebc('0x5f')](_0x1f1750)[_0x4ebc('0x60')]();_0x4928d4['on'](_0x4ebc('0x34'),function(_0xc44dcb){logger[_0x4ebc('0x34')](JSON[_0x4ebc('0x39')](_0xc44dcb));return _0x1f9453(_0xc44dcb);});_0x4928d4[_0x4ebc('0x10')](0x232c,_0x4ebc('0x61'),function(){console[_0x4ebc('0x62')](_0x4ebc('0x63'),0x232c);return _0x2117ec(_0x4ebc('0x64')+0x232c);});});}; \ No newline at end of file +var _0xfae3=['notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','./applications/','Push\x20new\x20rule','on\x20interval','intervals','error','Please\x20create\x20a\x20new\x20file\x20under','execute','info','stringify','matchPath','emit','complete','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','routing\x20is\x20empty','agent','agents','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','busyQueue','hasOwnProperty','capacity','CurrentCapacity','agent\x20not\x20found','values','find','chatQueues','available','paused','waiting','mailQueues','loggedIn','openchannelQueues','name','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','127.0.0.1','log','lodash','util','path','jayson/promise','bluebird','./applications/utils','./applications/strategy/util','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','transfer','applications','isArray','length','existsSync','join','app','.js','toLowerCase','autoreply','appdata','split','push','slice','dialogflowv2','amazonlex','tag','TagId','tvox','account'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xfae3,0xa1));var _0x3fae=function(_0x5a57a3,_0x2a7018){_0x5a57a3=_0x5a57a3-0x0;var _0x2ef960=_0xfae3[_0x5a57a3];return _0x2ef960;};'use strict';var _=require(_0x3fae('0x0'));var util=require(_0x3fae('0x1'));var path=require(_0x3fae('0x2'));var fs=require('fs');var jayson=require(_0x3fae('0x3'));var BPromise=require(_0x3fae('0x4'));var utils=require(_0x3fae('0x5'));var sUtils=require(_0x3fae('0x6'));var logger=require(_0x3fae('0x7'))(_0x3fae('0x8'));var rpc={'openchannelQueueReport':require(_0x3fae('0x9')),'mailQueueReport':require(_0x3fae('0xa')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0x3fae('0xb')),'faxQueueReport':require(_0x3fae('0xc')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require('../lib/rule-engine');function getId(_0x28c778,_0x1f5ce2,_0x4a5f5c){return util[_0x3fae('0xd')](_0x3fae('0xe'),_0x28c778,_0x1f5ce2||0x0,_0x4a5f5c||0x0);}function getIntervals(_0x140ab3,_0x145e13){var _0x464cd8=[];if(!_[_0x3fae('0xf')](_0x145e13[_0x3fae('0x10')])&&!_[_0x3fae('0xf')](_0x140ab3[_0x145e13[_0x3fae('0x10')]])&&!_[_0x3fae('0xf')](_0x140ab3[_0x145e13[_0x3fae('0x10')]][_0x3fae('0x11')])){_0x464cd8=_[_0x3fae('0x12')](_0x140ab3[_0x145e13['IntervalId']][_0x3fae('0x11')],'interval');}else if(!_[_0x3fae('0xf')](_0x145e13[_0x3fae('0x13')])){_0x464cd8=[_0x145e13[_0x3fae('0x13')]];}return _0x464cd8;}exports[_0x3fae('0x14')]=function(_0x29b7e9){_0x29b7e9[_0x3fae('0x15')]={};return new BPromise(function(_0x13e5f0,_0x10afd4){var _0x390e74={'Start':function(_0x156464){var _0x22fb9f=this;return new Promise(function(_0x20513e,_0x341c61){if(_0x156464){try{var _0x38b6c1=[];var _0x1c32b0=getId(_0x156464[_0x3fae('0x16')],_0x156464[_0x3fae('0x17')]?_0x156464[_0x3fae('0x17')]['id']:0x0,_0x156464[_0x3fae('0x18')]?_0x156464[_0x3fae('0x18')]['id']:0x0);var _0x552f00=sUtils['checkWaitingNotifications'](_0x29b7e9,_0x156464);if(_0x156464[_0x3fae('0x19')]||!_0x552f00&&_0x156464[_0x3fae('0x1a')]&&_[_0x3fae('0x1b')](_0x156464['applications'])&&_0x156464[_0x3fae('0x1a')][_0x3fae('0x1c')]){for(var _0x4072fa=0x0;_0x4072fa<_0x156464[_0x3fae('0x1a')]['length'];_0x4072fa+=0x1){var _0x5aeb51=_0x156464[_0x3fae('0x1a')][_0x4072fa];if(fs[_0x3fae('0x1d')](path[_0x3fae('0x1e')](__dirname,_0x3fae('0x1a'),_0x5aeb51[_0x3fae('0x1f')]+_0x3fae('0x20')))){var _0xfe450b=[];switch(_0x5aeb51[_0x3fae('0x1f')][_0x3fae('0x21')]()){case _0x3fae('0x22'):var _0x10b996=_0x5aeb51[_0x3fae('0x23')][_0x3fae('0x24')](',');if(_0x156464[_0x3fae('0x16')]==='mail'){_0xfe450b[_0x3fae('0x25')](_0x10b996[0x0]);_0xfe450b[_0x3fae('0x25')](_0x10b996[0x1]);_0xfe450b[_0x3fae('0x25')](_0x10b996[_0x3fae('0x26')](0x2,_0x10b996[_0x3fae('0x1c')])[_0x3fae('0x1e')](','));}else{_0xfe450b[_0x3fae('0x25')](_0x10b996[0x0]);_0xfe450b[_0x3fae('0x25')](_0x10b996[_0x3fae('0x26')](0x1,_0x10b996['length'])[_0x3fae('0x1e')](','));}break;case'dialogflow':var _0x403e40=_0x5aeb51[_0x3fae('0x23')]['split'](',');_0xfe450b[_0x3fae('0x25')](_0x403e40[0x0]);_0xfe450b[_0x3fae('0x25')](_0x403e40[0x1]);_0xfe450b['push'](_0x403e40[_0x3fae('0x26')](0x2,_0x403e40[_0x3fae('0x1c')])[_0x3fae('0x1e')](','));break;case _0x3fae('0x27'):var _0x40e355=_0x5aeb51[_0x3fae('0x23')][_0x3fae('0x24')](',');_0xfe450b[_0x3fae('0x25')](_0x40e355[0x0]);_0xfe450b[_0x3fae('0x25')](_0x40e355[0x1]);_0xfe450b[_0x3fae('0x25')](_0x40e355[0x2]);_0xfe450b[_0x3fae('0x25')](_0x40e355[0x3]);_0xfe450b['push'](_0x40e355[_0x3fae('0x26')](0x4,_0x40e355[_0x3fae('0x1c')])[_0x3fae('0x1e')](','));break;case _0x3fae('0x28'):var _0x5a1bf3=_0x5aeb51[_0x3fae('0x23')]['split'](',');_0xfe450b['push'](_0x5a1bf3[0x0]);_0xfe450b[_0x3fae('0x25')](_0x5a1bf3[0x1]);_0xfe450b['push'](_0x5a1bf3[0x2]);_0xfe450b['push'](_0x5a1bf3[0x3]);_0xfe450b['push'](_0x5a1bf3[_0x3fae('0x26')](0x4,_0x5a1bf3['length'])[_0x3fae('0x1e')](','));break;case _0x3fae('0x17'):_0xfe450b[_0x3fae('0x25')](_0x5aeb51[_0x3fae('0x23')]);break;case _0x3fae('0x29'):_0xfe450b['push'](_0x5aeb51[_0x3fae('0x2a')]);_0xfe450b[_0x3fae('0x25')](_0x5aeb51[_0x3fae('0x23')]);break;case _0x3fae('0x2b'):var _0x3def7a=utils['getMustacheRender'](_0x156464[_0x3fae('0x2c')][_0x3fae('0x2d')],_0x156464);var _0x3ff3de=_0x5aeb51[_0x3fae('0x23')][_0x3fae('0x24')](',');_0xfe450b['push'](_0x3ff3de[0x0]);_0xfe450b[_0x3fae('0x25')](_0x3ff3de[0x1]);_0xfe450b['push'](_0x3ff3de[0x2]);_0xfe450b[_0x3fae('0x25')](_0x3ff3de[0x3]);_0xfe450b[_0x3fae('0x25')](_0x3ff3de[0x4]);_0xfe450b[_0x3fae('0x25')](_0x3ff3de[0x5]);_0xfe450b['push'](_0x3ff3de[0x6]);_0xfe450b[_0x3fae('0x25')](_0x3ff3de[0x7]);_0xfe450b[_0x3fae('0x25')](_0x3ff3de[0x8]);_0xfe450b[_0x3fae('0x25')](_0x3ff3de[0x9]);_0xfe450b['push'](_0x3ff3de[0xa]);_0xfe450b['push'](_0x156464[_0x3fae('0x18')]['id']);_0xfe450b[_0x3fae('0x25')](_0x156464[_0x3fae('0x17')]['id']);_0xfe450b['push'](_0x5aeb51[_0x3fae('0x2e')]);_0xfe450b[_0x3fae('0x25')](_0x156464[_0x3fae('0x18')][_0x3fae('0x2f')]);_0xfe450b['push'](_0x156464[_0x3fae('0x30')][_0x3fae('0x30')]);_0xfe450b[_0x3fae('0x25')](_0x3def7a);break;default:_0xfe450b=_[_0x3fae('0xf')](_0x5aeb51['appdata'])?[]:_0x5aeb51[_0x3fae('0x23')][_0x3fae('0x24')](',');}var _0x1bbdec={'id':util[_0x3fae('0xd')](_0x3fae('0x31'),_0x1c32b0,_0x5aeb51['id'],_0x5aeb51['app']),'condition':require(_0x3fae('0x32'))[_0x3fae('0x33')](_0x1c32b0,getIntervals(_0x29b7e9['intervals'],_0x5aeb51),_0x29b7e9),'consequence':require(_0x3fae('0x34')+_0x5aeb51[_0x3fae('0x1f')])['consequence'](_0x1c32b0,_0xfe450b,_0x29b7e9,_0x156464),'p':_0x5aeb51['priority']||0x0};logger['info'](_0x3fae('0x35'),_0x1bbdec['id'],_0x3fae('0x36'),getIntervals(_0x29b7e9[_0x3fae('0x37')],_0x5aeb51)[_0x3fae('0x1e')]('\x20|\x20'));_0x38b6c1[_0x3fae('0x25')](_0x1bbdec);}else{logger[_0x3fae('0x38')](_0x3fae('0x39'),path['join'](__dirname,_0x3fae('0x1a'),_0x5aeb51[_0x3fae('0x1f')]+_0x3fae('0x20')));}}_0x29b7e9['rules'][_0x1c32b0]=new RuleEngine(_0x38b6c1);_0x29b7e9[_0x3fae('0x15')][_0x1c32b0][_0x3fae('0x3a')](_0x156464,function(_0x2153f1){logger[_0x3fae('0x3b')]('Applications\x20executed',JSON[_0x3fae('0x3c')](_0x2153f1[_0x3fae('0x3d')]));if(_0x29b7e9[_0x3fae('0x15')][_0x1c32b0]){_0x29b7e9['rules'][_0x1c32b0][_0x3fae('0x3e')](_0x3fae('0x3f'));}});return _0x20513e({'code':0xc8,'message':_0x156464});}else{if(_0x552f00){logger[_0x3fae('0x3b')](util[_0x3fae('0xd')](_0x3fae('0x40'),_0x1c32b0));}else{logger['info'](_0x3fae('0x41'));}return _0x20513e({'code':0xc8,'message':_0x156464});}}catch(_0x4b314c){logger['error'](_0x4b314c['stack']);return _0x341c61(_0x22fb9f[_0x3fae('0x38')](0x1f4,_0x4b314c));}}return _0x341c61(_0x3fae('0x42'));});},'AcceptMessage':function(_0x3ce094){var _0x4e3f30=this;return new Promise(function(_0xae27b,_0x207ff1){if(_0x3ce094['agent']&&_0x3ce094[_0x3fae('0x43')]['id']){if(_0x29b7e9[_0x3fae('0x44')][_0x3ce094['agent']['id']]){_0x29b7e9['agents'][_0x3ce094['agent']['id']]['busy']=![];_0x29b7e9[_0x3fae('0x44')][_0x3ce094[_0x3fae('0x43')]['id']]['busyQueue']=undefined;}}if(_0x3ce094[_0x3fae('0x17')]&&_0x3ce094[_0x3fae('0x17')]['id']){try{var _0x1213b5=getId(_0x3ce094[_0x3fae('0x16')],_0x3ce094[_0x3fae('0x17')]?_0x3ce094[_0x3fae('0x17')]['id']:0x0,_0x3ce094[_0x3fae('0x18')]?_0x3ce094['interaction']['id']:0x0);if(_0x29b7e9['rules'][_0x1213b5]){_0x29b7e9['rules'][_0x1213b5][_0x3fae('0x3e')](_0x3fae('0x45'));if(rpc[_0x3ce094[_0x3fae('0x16')]+_0x3fae('0x46')]){rpc[_0x3ce094[_0x3fae('0x16')]+_0x3fae('0x46')][_0x3fae('0x47')](_0x1213b5,{'UserId':_0x3ce094[_0x3fae('0x17')][_0x3fae('0x48')]})[_0x3fae('0x49')](function(){logger['error'](_0x3fae('0x4a'));});}}return _0xae27b({'code':0xc8,'message':_0x3ce094});}catch(_0xfe941a){logger['error'](_0xfe941a[_0x3fae('0x4b')]);return _0x207ff1(_0x4e3f30[_0x3fae('0x38')](0x1f4,_0xfe941a));}}logger[_0x3fae('0x38')](_0x3fae('0x4c'));return _0x207ff1(_0x4e3f30[_0x3fae('0x38')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0xe2ff47){var _0x483323=this;return new Promise(function(_0x229544,_0x420153){if(_0xe2ff47[_0x3fae('0x43')]&&_0xe2ff47[_0x3fae('0x43')]['id']){try{if(_0x29b7e9[_0x3fae('0x44')][_0xe2ff47['agent']['id']]){_0x29b7e9['agents'][_0xe2ff47['agent']['id']]['busy']=![];_0x29b7e9['agents'][_0xe2ff47[_0x3fae('0x43')]['id']][_0x3fae('0x4d')]=undefined;}return _0x229544({'code':0xc8,'message':_0xe2ff47});}catch(_0x5e3aaa){logger[_0x3fae('0x38')](_0x5e3aaa[_0x3fae('0x4b')]);return _0x420153(_0x483323['error'](0x1f4,_0x5e3aaa));}}logger[_0x3fae('0x38')](_0x3fae('0x4c'));return _0x420153(_0x483323[_0x3fae('0x38')](0x1f4,_0x3fae('0x4c')));});},'AbandonInteraction':function(_0xfcc85d){var _0x36f515=this;return new Promise(function(_0x185bde,_0x5c7976){if(_0xfcc85d['channel']&&_0xfcc85d['interaction']&&_0xfcc85d['interaction']['id']){try{var _0xdbd5f1=getId(_0xfcc85d[_0x3fae('0x16')],_0xfcc85d[_0x3fae('0x17')]?_0xfcc85d[_0x3fae('0x17')]['id']:0x0,_0xfcc85d[_0x3fae('0x18')]?_0xfcc85d[_0x3fae('0x18')]['id']:0x0);if(_0x29b7e9[_0x3fae('0x15')][_0xdbd5f1]){_0x29b7e9[_0x3fae('0x15')][_0xdbd5f1][_0x3fae('0x3e')](_0x3fae('0x45'));}return _0x185bde({'code':0xc8,'message':_0xfcc85d});}catch(_0x3f9783){logger['error'](_0x3f9783['stack']);return _0x5c7976(_0x36f515[_0x3fae('0x38')](0x1f4,_0x3f9783));}}logger['error'](_0x3fae('0x4c'));return _0x5c7976(_0x36f515['error'](0x1f4,_0x3fae('0x4c')));});},'AgentCapacity':function(_0x28ac0f){var _0x3748dd=this;return new Promise(function(_0x1b8232,_0x38bb77){if(_0x29b7e9['agents'][_0x3fae('0x4e')](_0x28ac0f['id'])){for(var _0x4c3e01 in _0x28ac0f[_0x3fae('0x4f')]){if(_0x28ac0f['capacity']['hasOwnProperty'](_0x4c3e01)){if(_0x29b7e9[_0x3fae('0x44')][_0x28ac0f['id']]['hasOwnProperty'](_0x4c3e01+_0x3fae('0x50'))){_0x29b7e9[_0x3fae('0x44')][_0x28ac0f['id']][_0x4c3e01+_0x3fae('0x50')]=parseInt(_0x28ac0f[_0x3fae('0x4f')][_0x4c3e01],0xa);}}}_0x29b7e9['agents'][_0x28ac0f['id']]['updateRealtime']();return _0x1b8232({'code':0xc8,'message':_0x29b7e9[_0x3fae('0x44')][_0x28ac0f['id']]});}else{return _0x38bb77(_0x3748dd[_0x3fae('0x38')](0x1f4,_0x3fae('0x51')));}});},'Agents':function(_0x1f923e){return new Promise(function(_0x7d6725){var _0x273d5f=_[_0x3fae('0x52')](_0x29b7e9[_0x3fae('0x44')]);if(_0x1f923e&&_0x1f923e['id']){var _0x4d4f8c=_[_0x3fae('0x53')](_0x273d5f,function(_0x5887a0){return _0x5887a0['id']===_0x1f923e['id'];});_0x7d6725(_0x4d4f8c);}else{_0x7d6725({'count':_0x273d5f[_0x3fae('0x1c')],'rows':_0x273d5f});}});},'ChatQueues':function(){return new Promise(function(_0x2f2cd8){var _0x1ab047=[];for(var _0x2c4939 in _0x29b7e9[_0x3fae('0x54')]){if(_0x29b7e9['chatQueues'][_0x3fae('0x4e')](_0x2c4939)){var _0x294526=_0x29b7e9[_0x3fae('0x54')][_0x2c4939];var _0x5da4e7={'id':_0x294526['id'],'available':_0x294526[_0x3fae('0x55')],'loggedIn':_0x294526['loggedIn'],'name':_0x294526['name'],'paused':_0x294526[_0x3fae('0x56')],'waiting':_0x294526[_0x3fae('0x57')]};_0x1ab047[_0x3fae('0x25')](_0x5da4e7);}}_0x2f2cd8({'count':_0x1ab047[_0x3fae('0x1c')],'rows':_0x1ab047});});},'MailQueues':function(){return new Promise(function(_0xb48947){var _0x52538e=[];for(var _0x297073 in _0x29b7e9[_0x3fae('0x58')]){if(_0x29b7e9[_0x3fae('0x58')][_0x3fae('0x4e')](_0x297073)){var _0x39d9ae=_0x29b7e9[_0x3fae('0x58')][_0x297073];var _0x96d872={'id':_0x39d9ae['id'],'available':_0x39d9ae[_0x3fae('0x55')],'loggedIn':_0x39d9ae[_0x3fae('0x59')],'name':_0x39d9ae['name'],'paused':_0x39d9ae[_0x3fae('0x56')],'waiting':_0x39d9ae[_0x3fae('0x57')]};_0x52538e[_0x3fae('0x25')](_0x96d872);}}_0xb48947({'count':_0x52538e[_0x3fae('0x1c')],'rows':_0x52538e});});},'OpenchannelQueues':function(){return new Promise(function(_0x4a9366){var _0x269e41=[];for(var _0x589e95 in _0x29b7e9[_0x3fae('0x5a')]){if(_0x29b7e9[_0x3fae('0x5a')][_0x3fae('0x4e')](_0x589e95)){var _0x37b35c=_0x29b7e9['openchannelQueues'][_0x589e95];var _0x3ca092={'id':_0x37b35c['id'],'available':_0x37b35c[_0x3fae('0x55')],'loggedIn':_0x37b35c[_0x3fae('0x59')],'name':_0x37b35c[_0x3fae('0x5b')],'paused':_0x37b35c[_0x3fae('0x56')],'waiting':_0x37b35c['waiting']};_0x269e41['push'](_0x3ca092);}}_0x4a9366({'count':_0x269e41[_0x3fae('0x1c')],'rows':_0x269e41});});},'SmsQueues':function(){return new Promise(function(_0x8ae4c5){var _0x34005f=[];for(var _0x381b28 in _0x29b7e9['smsQueues']){if(_0x29b7e9[_0x3fae('0x5c')][_0x3fae('0x4e')](_0x381b28)){var _0x5635a2=_0x29b7e9[_0x3fae('0x5c')][_0x381b28];var _0x389ad3={'id':_0x5635a2['id'],'available':_0x5635a2[_0x3fae('0x55')],'loggedIn':_0x5635a2['loggedIn'],'name':_0x5635a2[_0x3fae('0x5b')],'paused':_0x5635a2[_0x3fae('0x56')],'waiting':_0x5635a2[_0x3fae('0x57')]};_0x34005f[_0x3fae('0x25')](_0x389ad3);}}_0x8ae4c5({'count':_0x34005f[_0x3fae('0x1c')],'rows':_0x34005f});});},'FaxQueues':function(){return new Promise(function(_0x41b3d7){var _0x5a39c5=[];for(var _0x359a4e in _0x29b7e9[_0x3fae('0x5d')]){if(_0x29b7e9[_0x3fae('0x5d')][_0x3fae('0x4e')](_0x359a4e)){var _0x152082=_0x29b7e9[_0x3fae('0x5d')][_0x359a4e];var _0x526799={'id':_0x152082['id'],'available':_0x152082[_0x3fae('0x55')],'loggedIn':_0x152082[_0x3fae('0x59')],'name':_0x152082[_0x3fae('0x5b')],'paused':_0x152082[_0x3fae('0x56')],'waiting':_0x152082[_0x3fae('0x57')]};_0x5a39c5[_0x3fae('0x25')](_0x526799);}}_0x41b3d7({'count':_0x5a39c5[_0x3fae('0x1c')],'rows':_0x5a39c5});});},'WhatsappQueues':function(){return new Promise(function(_0x29ac0f){var _0x291eed=[];for(var _0xcd9f67 in _0x29b7e9[_0x3fae('0x5e')]){if(_0x29b7e9[_0x3fae('0x5e')][_0x3fae('0x4e')](_0xcd9f67)){var _0x4be20d=_0x29b7e9[_0x3fae('0x5e')][_0xcd9f67];var _0x2e16bf={'id':_0x4be20d['id'],'available':_0x4be20d['available'],'loggedIn':_0x4be20d['loggedIn'],'name':_0x4be20d[_0x3fae('0x5b')],'paused':_0x4be20d[_0x3fae('0x56')],'waiting':_0x4be20d[_0x3fae('0x57')]};_0x291eed['push'](_0x2e16bf);}}_0x29ac0f({'count':_0x291eed[_0x3fae('0x1c')],'rows':_0x291eed});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x5212e2){var _0x417057=_[_0x3fae('0x52')](_0x29b7e9[_0x3fae('0x5f')]);_0x5212e2({'count':_0x417057[_0x3fae('0x1c')],'rows':_0x417057});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x23ab84){var _0x444770=_[_0x3fae('0x52')](_0x29b7e9[_0x3fae('0x60')]);_0x23ab84({'count':_0x444770['length'],'rows':_0x444770});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0xa7eb8b){var _0x4ffcd0=_[_0x3fae('0x52')](_0x29b7e9['openchannelQueuesWaitingInteractions']);_0xa7eb8b({'count':_0x4ffcd0['length'],'rows':_0x4ffcd0});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x3ef7e6){var _0x22ab0a=_[_0x3fae('0x52')](_0x29b7e9[_0x3fae('0x61')]);_0x3ef7e6({'count':_0x22ab0a[_0x3fae('0x1c')],'rows':_0x22ab0a});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x19615d){var _0x2f169d=_['values'](_0x29b7e9[_0x3fae('0x62')]);_0x19615d({'count':_0x2f169d[_0x3fae('0x1c')],'rows':_0x2f169d});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x21d1f7){var _0x235c4a=_['values'](_0x29b7e9['whatsappQueuesWaitingInteractions']);_0x21d1f7({'count':_0x235c4a[_0x3fae('0x1c')],'rows':_0x235c4a});});}};var _0x30bbf5=jayson[_0x3fae('0x63')](_0x390e74)[_0x3fae('0x64')]();_0x30bbf5['on'](_0x3fae('0x38'),function(_0x28855f){logger[_0x3fae('0x38')](JSON[_0x3fae('0x3c')](_0x28855f));return _0x10afd4(_0x28855f);});_0x30bbf5[_0x3fae('0x14')](0x232c,_0x3fae('0x65'),function(){console[_0x3fae('0x66')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x13e5f0('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 d408fa2..c7d0289 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 _0xae76=['[%s][INTERVAL\x20VALID]\x20%s\x20%s','join','\x20|\x20','[%s][INTERVAL\x20NOT\x20VALID]\x20%s\x20%s','lodash','iftime','../../../config/logger','routing','rules','info','stop','map','some'];(function(_0x286d70,_0x1396b1){var _0x38933a=function(_0x18b7ea){while(--_0x18b7ea){_0x286d70['push'](_0x286d70['shift']());}};_0x38933a(++_0x1396b1);}(_0xae76,0x1d8));var _0x6ae7=function(_0x2f15fe,_0x20749d){_0x2f15fe=_0x2f15fe-0x0;var _0x13f917=_0xae76[_0x2f15fe];return _0x13f917;};'use strict';var _=require(_0x6ae7('0x0'));var iftime=require('../../../utils/iftime')[_0x6ae7('0x1')];var logger=require(_0x6ae7('0x2'))(_0x6ae7('0x3'));exports['condition']=function(_0x5f3ee7,_0x2f91f5,_0x396284){return function(_0x411c0b){if(_0x396284['rules']&&!_0x396284[_0x6ae7('0x4')][_0x5f3ee7]){logger[_0x6ae7('0x5')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x5f3ee7);return _0x411c0b[_0x6ae7('0x6')]();}var _0x2747ed=_0x2f91f5[_0x6ae7('0x7')](function(_0x189758){return iftime(_0x189758);});var _0x477912=_[_0x6ae7('0x8')](_0x2747ed);if(_0x477912){logger[_0x6ae7('0x5')](_0x6ae7('0x9'),_0x5f3ee7,_0x2f91f5[_0x6ae7('0xa')](_0x6ae7('0xb')),_0x477912);_0x411c0b['when'](_0x477912);}else{logger[_0x6ae7('0x5')](_0x6ae7('0xc'),_0x5f3ee7,_0x2f91f5[_0x6ae7('0xa')](_0x6ae7('0xb')));_0x411c0b[_0x6ae7('0x6')]();}};}; \ No newline at end of file +var _0x2b1e=['\x20|\x20','[%s][INTERVAL\x20NOT\x20VALID]\x20%s\x20%s','lodash','../../../config/logger','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','map','some','[%s][INTERVAL\x20VALID]\x20%s\x20%s','join'];(function(_0x1c23eb,_0x36dbe8){var _0xa06fde=function(_0x416370){while(--_0x416370){_0x1c23eb['push'](_0x1c23eb['shift']());}};_0xa06fde(++_0x36dbe8);}(_0x2b1e,0xdf));var _0xe2b1=function(_0x37ed61,_0x4e6ba8){_0x37ed61=_0x37ed61-0x0;var _0x5ebe9c=_0x2b1e[_0x37ed61];return _0x5ebe9c;};'use strict';var _=require(_0xe2b1('0x0'));var iftime=require('../../../utils/iftime')['iftime'];var logger=require(_0xe2b1('0x1'))('routing');exports[_0xe2b1('0x2')]=function(_0x3e19b2,_0x192161,_0x1bb780){return function(_0x2f3ef7){if(_0x1bb780[_0xe2b1('0x3')]&&!_0x1bb780[_0xe2b1('0x3')][_0x3e19b2]){logger[_0xe2b1('0x4')](_0xe2b1('0x5'),_0x3e19b2);return _0x2f3ef7[_0xe2b1('0x6')]();}var _0x15f520=_0x192161[_0xe2b1('0x7')](function(_0x412c44){return iftime(_0x412c44);});var _0x4e5e8c=_[_0xe2b1('0x8')](_0x15f520);if(_0x4e5e8c){logger['info'](_0xe2b1('0x9'),_0x3e19b2,_0x192161[_0xe2b1('0xa')](_0xe2b1('0xb')),_0x4e5e8c);_0x2f3ef7['when'](_0x4e5e8c);}else{logger[_0xe2b1('0x4')](_0xe2b1('0xc'),_0x3e19b2,_0x192161['join'](_0xe2b1('0xb')));_0x2f3ef7[_0xe2b1('0x6')]();}};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 24a33e7..fd1a713 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 _0xee5b=['type','agentacw','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','agentcalled','debug','[%s][agents][agentcalled]','destuniqueid','now','lastevent','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','timeout','reason','holdtime','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswerAt','abandoned','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentconnect]','agentcomplete','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','agentconnectAt','complete','[%s][agents][agentcomplete]','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','blind','transferexten','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','transfertype','origtransfererexten','transfereeuniqueid','agententerreason','calleridname','agentcalledAt','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','transfertargetuniqueid','[%s][agents][attendedtransfer]','hangup','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','diffTime','agent','[%s][agents][hangup]','lodash','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','membername','interface','calleridnum','connectedlinenum'];(function(_0x158f01,_0x12af3e){var _0x5ef74e=function(_0x5e7adc){while(--_0x5e7adc){_0x158f01['push'](_0x158f01['shift']());}};_0x5ef74e(++_0x12af3e);}(_0xee5b,0x1f4));var _0xbee5=function(_0x29c358,_0x1f19d2){_0x29c358=_0x29c358-0x0;var _0x10ca60=_0xee5b[_0x29c358];return _0x10ca60;};'use strict';var _=require(_0xbee5('0x0'));var util=require('util');var utils=require(_0xbee5('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x203bba,_0x4f850a){utils[_0xbee5('0x2')](util[_0xbee5('0x3')](_0xbee5('0x4'),_0x203bba[_0xbee5('0x5')],_0x203bba['channel'],_0x203bba['queue'],_0x203bba[_0xbee5('0x6')],_0x203bba[_0xbee5('0x7')],_0x203bba[_0xbee5('0x8')],_0x203bba[_0xbee5('0x9')],_0x203bba['lastevent']));if(_0x203bba['queue']){utils['getVoiceQueueByName'](_0x203bba['queue'])['then'](function(_0x20c66c){if(_0x20c66c){_0x203bba[_0xbee5('0xa')]=_0x20c66c[_0xbee5('0xa')];_0x203bba[_0xbee5('0xb')]=_0x203bba['agentcomplete']?_0x20c66c[_0xbee5('0xc')]:![];_0x203bba[_0xbee5('0xd')]=_0x203bba[_0xbee5('0xb')]?_0x20c66c[_0xbee5('0xe')]:0x0;}utils[_0xbee5('0xf')](_0xbee5('0x10'),_0x203bba);});}else{utils[_0xbee5('0xf')](_0xbee5('0x10'),_0x203bba);}if(_0x4f850a){delete transfers[_0x203bba[_0xbee5('0x5')]];}else{delete agents[_0x203bba['destuniqueid']];}}exports[_0xbee5('0x11')]=function(_0x532a78){try{utils[_0xbee5('0x12')](util[_0xbee5('0x3')](_0xbee5('0x13'),_0x532a78['uniqueid']),_0x532a78);agents[_0x532a78['destuniqueid']]=_0x532a78;agents[_0x532a78[_0xbee5('0x14')]]['agentcalledAt']=utils[_0xbee5('0x15')]();agents[_0x532a78['destuniqueid']][_0xbee5('0x16')]=_0xbee5('0x17');agents[_0x532a78[_0xbee5('0x14')]]['connectedlinenum']=null;agents[_0x532a78[_0xbee5('0x14')]][_0xbee5('0x18')]=null;utils['info'](util[_0xbee5('0x3')](_0xbee5('0x19'),_0x532a78[_0xbee5('0x5')],agents[_0x532a78[_0xbee5('0x14')]][_0xbee5('0x6')],_0x532a78[_0xbee5('0x14')]));}catch(_0x982404){utils[_0xbee5('0x1a')](util[_0xbee5('0x3')](_0xbee5('0x13'),_0x532a78[_0xbee5('0x5')]),_0x982404);}};exports[_0xbee5('0x1b')]=function(_0x35d7d3){try{if(!_[_0xbee5('0x1c')](agents[_0x35d7d3[_0xbee5('0x14')]])){utils['debug'](util['format'](_0xbee5('0x1d'),_0x35d7d3['uniqueid']),_0x35d7d3);utils[_0xbee5('0x2')](util[_0xbee5('0x3')](_0xbee5('0x1e'),_0x35d7d3[_0xbee5('0x5')],agents[_0x35d7d3[_0xbee5('0x14')]][_0xbee5('0x6')],_0x35d7d3[_0xbee5('0x14')]));agents[_0x35d7d3[_0xbee5('0x14')]][_0xbee5('0x1b')]=!![];agents[_0x35d7d3['destuniqueid']]['agentringnoanswerAt']=utils['now']();agents[_0x35d7d3['destuniqueid']]['lastevent']=_0xbee5('0x1f');agents[_0x35d7d3[_0xbee5('0x14')]][_0xbee5('0x20')]=_0xbee5('0x1f');agents[_0x35d7d3[_0xbee5('0x14')]][_0xbee5('0x21')]=_0x35d7d3[_0xbee5('0x22')]?parseInt(_0x35d7d3['ringtime'])/0x3e8:0x0;agents[_0x35d7d3[_0xbee5('0x14')]][_0xbee5('0x23')]=0x0;unanswered[_0xbee5('0x24')](_0x35d7d3[_0xbee5('0x14')]);}}catch(_0x1a8bcc){utils['error'](util[_0xbee5('0x3')](_0xbee5('0x1d'),_0x35d7d3[_0xbee5('0x5')]),_0x1a8bcc);}};exports[_0xbee5('0x25')]=function(_0xa57f85){try{_[_0xbee5('0x26')](agents,function(_0x34b7df,_0x36e8bb){if(_0x34b7df[_0xbee5('0x5')]==_0xa57f85['uniqueid']&&!_[_0xbee5('0x27')](unanswered,_0x34b7df['destuniqueid'])){utils[_0xbee5('0x12')](util['format'](_0xbee5('0x28'),_0xa57f85['uniqueid']),_0xa57f85);utils[_0xbee5('0x2')](util['format'](_0xbee5('0x29'),_0xa57f85[_0xbee5('0x5')],_0x34b7df[_0xbee5('0x6')],_0x34b7df[_0xbee5('0x14')]));_0x34b7df['agentringnoanswer']=!![];_0x34b7df[_0xbee5('0x2a')]=utils[_0xbee5('0x15')]();_0x34b7df[_0xbee5('0x16')]=_0xbee5('0x2b');_0x34b7df['reason']=_0xbee5('0x2b');_0x34b7df[_0xbee5('0x21')]=_0xa57f85[_0xbee5('0x21')];_0x34b7df[_0xbee5('0x23')]=0x0;writeDB(_0x34b7df);}});}catch(_0x4c3428){utils[_0xbee5('0x1a')](util[_0xbee5('0x3')](_0xbee5('0x28'),_0xa57f85[_0xbee5('0x5')]),_0x4c3428);}};exports['agentconnect']=function(_0x3c8a87){try{if(agents[_0x3c8a87['destuniqueid']]){utils[_0xbee5('0x12')](util['format']('[%s][agents][agentconnect]',_0x3c8a87['uniqueid']),_0x3c8a87);utils[_0xbee5('0x2')](util[_0xbee5('0x3')](_0xbee5('0x2c'),_0x3c8a87[_0xbee5('0x5')],agents[_0x3c8a87[_0xbee5('0x14')]][_0xbee5('0x6')],_0x3c8a87[_0xbee5('0x14')]));agents[_0x3c8a87[_0xbee5('0x14')]]['agentconnectAt']=utils[_0xbee5('0x15')]();agents[_0x3c8a87['destuniqueid']][_0xbee5('0x9')]=_0x3c8a87[_0xbee5('0x9')];agents[_0x3c8a87[_0xbee5('0x14')]][_0xbee5('0x18')]=_0x3c8a87['connectedlinename'];agents[_0x3c8a87[_0xbee5('0x14')]]['holdtime']=_0x3c8a87['ringtime'];agents[_0x3c8a87[_0xbee5('0x14')]][_0xbee5('0x16')]=_0xbee5('0x2d');_[_0xbee5('0x26')](agents,function(_0x5a2b14,_0xf3dd5){if(_0x5a2b14[_0xbee5('0x14')]!=_0x3c8a87[_0xbee5('0x14')]&&_0x5a2b14[_0xbee5('0x5')]==_0x3c8a87[_0xbee5('0x5')]){_0x5a2b14[_0xbee5('0x23')]=0x0;_0x5a2b14[_0xbee5('0x21')]=_0x3c8a87[_0xbee5('0x22')];_0x5a2b14[_0xbee5('0x1b')]=!![];_0x5a2b14[_0xbee5('0x2a')]=utils['now']();_0x5a2b14[_0xbee5('0x16')]=_0xbee5('0x2e');_0x5a2b14['reason']=_0xbee5('0x2e');_0x5a2b14[_0xbee5('0x2f')]=_0x3c8a87[_0xbee5('0x14')];_0x5a2b14[_0xbee5('0x30')]=_0x3c8a87['membername'];writeDB(_0x5a2b14);}});}}catch(_0x4cfe54){utils['error'](util[_0xbee5('0x3')](_0xbee5('0x31'),_0x3c8a87[_0xbee5('0x5')]),_0x4cfe54);}};exports[_0xbee5('0x32')]=function(_0x4012fd){try{if(!_[_0xbee5('0x1c')](agents[_0x4012fd[_0xbee5('0x14')]])){utils[_0xbee5('0x12')](util[_0xbee5('0x3')]('[%s][agents][agentcomplete]',_0x4012fd['uniqueid']),_0x4012fd);utils[_0xbee5('0x2')](util['format'](_0xbee5('0x33'),_0x4012fd[_0xbee5('0x5')],agents[_0x4012fd['destuniqueid']][_0xbee5('0x6')],_0x4012fd[_0xbee5('0x14')]));agents[_0x4012fd['destuniqueid']]['agentcomplete']=!![];agents[_0x4012fd[_0xbee5('0x14')]][_0xbee5('0x34')]=utils['now']();agents[_0x4012fd[_0xbee5('0x14')]][_0xbee5('0x23')]=utils['diffTime'](agents[_0x4012fd[_0xbee5('0x14')]][_0xbee5('0x34')],agents[_0x4012fd[_0xbee5('0x14')]][_0xbee5('0x35')]);agents[_0x4012fd[_0xbee5('0x14')]][_0xbee5('0x20')]=_0x4012fd[_0xbee5('0x20')];agents[_0x4012fd['destuniqueid']][_0xbee5('0x16')]=_0xbee5('0x36');writeDB(agents[_0x4012fd[_0xbee5('0x14')]]);}}catch(_0x1d7388){utils['error'](util[_0xbee5('0x3')](_0xbee5('0x37'),_0x4012fd[_0xbee5('0x5')]),_0x1d7388);}};exports['blindtransfer']=function(_0x44d4b1){try{if(!_[_0xbee5('0x1c')](agents[_0x44d4b1['transfereruniqueid']])){utils['debug'](util['format'](_0xbee5('0x38'),_0x44d4b1['uniqueid']),_0x44d4b1);utils[_0xbee5('0x2')](util[_0xbee5('0x3')](_0xbee5('0x39'),_0x44d4b1[_0xbee5('0x5')],agents[_0x44d4b1[_0xbee5('0x3a')]][_0xbee5('0x6')],agents[_0x44d4b1['transfereruniqueid']][_0xbee5('0x5')]));agents[_0x44d4b1[_0xbee5('0x3a')]][_0xbee5('0x3b')]=!![];agents[_0x44d4b1[_0xbee5('0x3a')]]['transfertype']=_0xbee5('0x3c');agents[_0x44d4b1['transfereruniqueid']][_0xbee5('0x3d')]=_0x44d4b1[_0xbee5('0x3e')];agents[_0x44d4b1[_0xbee5('0x3a')]][_0xbee5('0x3f')]=agents[_0x44d4b1[_0xbee5('0x3a')]][_0xbee5('0x5')];}}catch(_0xe8902){utils[_0xbee5('0x1a')](util[_0xbee5('0x3')](_0xbee5('0x38'),_0x44d4b1[_0xbee5('0x5')]),_0xe8902);}};exports[_0xbee5('0x40')]=function(_0xeebac7){try{utils[_0xbee5('0x12')](util[_0xbee5('0x3')]('[%s][agents][attendedtransfer]',_0xeebac7[_0xbee5('0x41')]),_0xeebac7);if(_0xeebac7[_0xbee5('0x41')]==_0xeebac7[_0xbee5('0x42')]){if(!_['isNil'](agents[_0xeebac7[_0xbee5('0x43')]])){utils[_0xbee5('0x2')](util[_0xbee5('0x3')]('[%s][agents][attendedtransfer]\x20agent:%s',_0xeebac7[_0xbee5('0x41')],agents[_0xeebac7['secondtransfereruniqueid']][_0xbee5('0x6')]));agents[_0xeebac7['secondtransfereruniqueid']][_0xbee5('0x3b')]=!![];agents[_0xeebac7[_0xbee5('0x43')]][_0xbee5('0x44')]='ATTENDED';agents[_0xeebac7['secondtransfereruniqueid']]['transferexten']=_0xeebac7[_0xbee5('0x45')];agents[_0xeebac7[_0xbee5('0x43')]][_0xbee5('0x3f')]=_0xeebac7['origtransfereruniqueid'];}if(_0xeebac7[_0xbee5('0x46')]&&agents[_0xeebac7['transfereeuniqueid']]){agents[_0xeebac7[_0xbee5('0x46')]][_0xbee5('0x47')]=0x1;transfers[_0xeebac7[_0xbee5('0x46')]]=_['clone'](agents[_0xeebac7[_0xbee5('0x46')]]);transfers[_0xeebac7[_0xbee5('0x46')]][_0xbee5('0x8')]=agents[_0xeebac7[_0xbee5('0x43')]][_0xbee5('0x8')];transfers[_0xeebac7[_0xbee5('0x46')]][_0xbee5('0x48')]=agents[_0xeebac7[_0xbee5('0x43')]][_0xbee5('0x48')];transfers[_0xeebac7[_0xbee5('0x46')]][_0xbee5('0x49')]=utils[_0xbee5('0x15')]();transfers[_0xeebac7[_0xbee5('0x46')]][_0xbee5('0x35')]=utils[_0xbee5('0x15')]();transfers[_0xeebac7[_0xbee5('0x46')]][_0xbee5('0x21')]=0x0;transfers[_0xeebac7['transfereeuniqueid']][_0xbee5('0x47')]=0x2;}}else if(_0xeebac7['secondtransfereruniqueid']==_0xeebac7['secondtransfererlinkedid']){if(!_[_0xbee5('0x1c')](agents[_0xeebac7[_0xbee5('0x41')]])){utils['info'](util['format'](_0xbee5('0x4a'),_0xeebac7['origtransfereruniqueid'],agents[_0xeebac7[_0xbee5('0x41')]][_0xbee5('0x6')]));agents[_0xeebac7['origtransfereruniqueid']][_0xbee5('0x3b')]=!![];agents[_0xeebac7[_0xbee5('0x41')]][_0xbee5('0x44')]=_0xbee5('0x4b');agents[_0xeebac7['origtransfereruniqueid']][_0xbee5('0x3d')]=_0xeebac7['secondtransfererexten'];agents[_0xeebac7[_0xbee5('0x41')]][_0xbee5('0x3f')]=_0xeebac7['secondtransfereruniqueid'];}if(_0xeebac7[_0xbee5('0x4c')]&&agents[_0xeebac7[_0xbee5('0x4c')]]){agents[_0xeebac7['transfertargetuniqueid']][_0xbee5('0x47')]=0x1;transfers[_0xeebac7[_0xbee5('0x4c')]]=_['clone'](agents[_0xeebac7[_0xbee5('0x4c')]]);transfers[_0xeebac7['transfertargetuniqueid']][_0xbee5('0x8')]=agents[_0xeebac7['origtransfereruniqueid']][_0xbee5('0x8')];transfers[_0xeebac7['transfertargetuniqueid']]['calleridname']=agents[_0xeebac7[_0xbee5('0x41')]][_0xbee5('0x48')];transfers[_0xeebac7[_0xbee5('0x4c')]][_0xbee5('0x49')]=utils[_0xbee5('0x15')]();transfers[_0xeebac7[_0xbee5('0x4c')]]['agentconnectAt']=utils[_0xbee5('0x15')]();transfers[_0xeebac7[_0xbee5('0x4c')]][_0xbee5('0x21')]=0x0;transfers[_0xeebac7[_0xbee5('0x4c')]][_0xbee5('0x47')]=0x2;}}}catch(_0xf77d34){utils[_0xbee5('0x1a')](util[_0xbee5('0x3')](_0xbee5('0x4d'),_0xeebac7['origtransfereruniqueid']),_0xf77d34);}};exports[_0xbee5('0x4e')]=function(_0xe9796a){try{utils[_0xbee5('0x12')](util[_0xbee5('0x3')]('[%s][agents][hangup]',_0xe9796a[_0xbee5('0x5')]),_0xe9796a);if(agents[_0xe9796a[_0xbee5('0x5')]]&&agents[_0xe9796a[_0xbee5('0x5')]][_0xbee5('0x20')]===_0xbee5('0x1f')){if(_0xe9796a[_0xbee5('0x4f')]==='21'){agents[_0xe9796a[_0xbee5('0x5')]][_0xbee5('0x20')]=_0xbee5('0x50');agents[_0xe9796a[_0xbee5('0x5')]][_0xbee5('0x16')]=_0xbee5('0x50');}utils['info'](util[_0xbee5('0x3')](_0xbee5('0x51'),_0xe9796a['uniqueid'],agents[_0xe9796a[_0xbee5('0x5')]]['membername'],agents[_0xe9796a[_0xbee5('0x5')]][_0xbee5('0x20')],agents[_0xe9796a['uniqueid']][_0xbee5('0x16')]));writeDB(agents[_0xe9796a['uniqueid']]);var _0x4b7ebc=unanswered['indexOf'](_0xe9796a['uniqueid']);if(_0x4b7ebc>-0x1){unanswered['splice'](_0x4b7ebc,0x1);}}if(transfers[_0xe9796a['uniqueid']]){transfers[_0xe9796a[_0xbee5('0x5')]][_0xbee5('0x32')]=!![];transfers[_0xe9796a[_0xbee5('0x5')]][_0xbee5('0x34')]=utils[_0xbee5('0x15')]();transfers[_0xe9796a[_0xbee5('0x5')]][_0xbee5('0x23')]=utils[_0xbee5('0x52')](transfers[_0xe9796a[_0xbee5('0x5')]][_0xbee5('0x34')],transfers[_0xe9796a[_0xbee5('0x5')]][_0xbee5('0x35')]);transfers[_0xe9796a['uniqueid']][_0xbee5('0x20')]=_0xbee5('0x53');transfers[_0xe9796a['uniqueid']]['lastevent']=_0xbee5('0x36');utils[_0xbee5('0x2')](util[_0xbee5('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0xe9796a[_0xbee5('0x5')],transfers[_0xe9796a[_0xbee5('0x5')]][_0xbee5('0x6')],transfers[_0xe9796a['uniqueid']]['reason'],transfers[_0xe9796a['uniqueid']][_0xbee5('0x16')]));writeDB(transfers[_0xe9796a[_0xbee5('0x5')]],!![]);}if(agents[_0xe9796a[_0xbee5('0x5')]]&&agents[_0xe9796a[_0xbee5('0x5')]][_0xbee5('0x35')]){agents[_0xe9796a[_0xbee5('0x5')]][_0xbee5('0x32')]=!![];agents[_0xe9796a[_0xbee5('0x5')]]['agentcompleteAt']=utils['now']();agents[_0xe9796a[_0xbee5('0x5')]][_0xbee5('0x23')]=utils['diffTime'](agents[_0xe9796a['uniqueid']][_0xbee5('0x34')],agents[_0xe9796a['uniqueid']]['agentconnectAt']);agents[_0xe9796a[_0xbee5('0x5')]]['reason']=agents[_0xe9796a[_0xbee5('0x5')]][_0xbee5('0x3b')]?'transfer':_0xbee5('0x53');agents[_0xe9796a[_0xbee5('0x5')]][_0xbee5('0x16')]=_0xbee5('0x36');utils[_0xbee5('0x2')](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0xe9796a[_0xbee5('0x5')],agents[_0xe9796a['uniqueid']][_0xbee5('0x6')],agents[_0xe9796a['uniqueid']][_0xbee5('0x20')],agents[_0xe9796a[_0xbee5('0x5')]][_0xbee5('0x16')]));writeDB(agents[_0xe9796a[_0xbee5('0x5')]]);}}catch(_0x182207){utils[_0xbee5('0x1a')](util[_0xbee5('0x3')](_0xbee5('0x54'),_0xe9796a[_0xbee5('0x5')]),_0x182207);}}; \ No newline at end of file +var _0xc900=['rejected','indexOf','splice','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','./utils','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','uniqueid','agentcalledAt','now','connectedlinename','info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','[%s][agents][agentcalled]','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','lastevent','timeout','holdtime','ringtime','push','error','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','reason','abandoned','talktime','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connect','agentringnoanswerAt','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','agentconnectAt','complete','blindtransfer','[%s][agents][blindtransfer]','transfereruniqueid','transfer','transfertype','blind','transferexten','extension','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','transfereeuniqueid','agententerreason','clone','ATTENDED','secondtransfererexten','transfertargetuniqueid','calleridname','[%s][agents][attendedtransfer]','[%s][agents][hangup]','cause'];(function(_0x524997,_0x565a48){var _0x250ea4=function(_0x4a185c){while(--_0x4a185c){_0x524997['push'](_0x524997['shift']());}};_0x250ea4(++_0x565a48);}(_0xc900,0xb3));var _0x0c90=function(_0x4ffb92,_0x47f23c){_0x4ffb92=_0x4ffb92-0x0;var _0x252e1b=_0xc900[_0x4ffb92];return _0x252e1b;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x0c90('0x0'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x546406,_0x435691){utils['info'](util[_0x0c90('0x1')](_0x0c90('0x2'),_0x546406['uniqueid'],_0x546406[_0x0c90('0x3')],_0x546406[_0x0c90('0x4')],_0x546406[_0x0c90('0x5')],_0x546406[_0x0c90('0x6')],_0x546406[_0x0c90('0x7')],_0x546406[_0x0c90('0x8')],_0x546406['lastevent']));if(_0x546406[_0x0c90('0x4')]){utils[_0x0c90('0x9')](_0x546406[_0x0c90('0x4')])[_0x0c90('0xa')](function(_0x128656){if(_0x128656){_0x546406[_0x0c90('0xb')]=_0x128656[_0x0c90('0xb')];_0x546406[_0x0c90('0xc')]=_0x546406[_0x0c90('0xd')]?_0x128656[_0x0c90('0xe')]:![];_0x546406[_0x0c90('0xf')]=_0x546406[_0x0c90('0xc')]?_0x128656[_0x0c90('0x10')]:0x0;}utils['request'](_0x0c90('0x11'),_0x546406);});}else{utils['request'](_0x0c90('0x11'),_0x546406);}if(_0x435691){delete transfers[_0x546406['uniqueid']];}else{delete agents[_0x546406[_0x0c90('0x12')]];}}exports[_0x0c90('0x13')]=function(_0x4535a2){try{utils[_0x0c90('0x14')](util[_0x0c90('0x1')]('[%s][agents][agentcalled]',_0x4535a2[_0x0c90('0x15')]),_0x4535a2);agents[_0x4535a2[_0x0c90('0x12')]]=_0x4535a2;agents[_0x4535a2['destuniqueid']][_0x0c90('0x16')]=utils[_0x0c90('0x17')]();agents[_0x4535a2[_0x0c90('0x12')]]['lastevent']='called';agents[_0x4535a2[_0x0c90('0x12')]][_0x0c90('0x8')]=null;agents[_0x4535a2[_0x0c90('0x12')]][_0x0c90('0x18')]=null;utils[_0x0c90('0x19')](util[_0x0c90('0x1')](_0x0c90('0x1a'),_0x4535a2['uniqueid'],agents[_0x4535a2[_0x0c90('0x12')]][_0x0c90('0x5')],_0x4535a2[_0x0c90('0x12')]));}catch(_0x26835c){utils['error'](util[_0x0c90('0x1')](_0x0c90('0x1b'),_0x4535a2[_0x0c90('0x15')]),_0x26835c);}};exports[_0x0c90('0x1c')]=function(_0x315932){try{if(!_[_0x0c90('0x1d')](agents[_0x315932['destuniqueid']])){utils[_0x0c90('0x14')](util['format'](_0x0c90('0x1e'),_0x315932[_0x0c90('0x15')]),_0x315932);utils['info'](util[_0x0c90('0x1')](_0x0c90('0x1f'),_0x315932[_0x0c90('0x15')],agents[_0x315932[_0x0c90('0x12')]][_0x0c90('0x5')],_0x315932[_0x0c90('0x12')]));agents[_0x315932['destuniqueid']][_0x0c90('0x1c')]=!![];agents[_0x315932[_0x0c90('0x12')]]['agentringnoanswerAt']=utils['now']();agents[_0x315932[_0x0c90('0x12')]][_0x0c90('0x20')]=_0x0c90('0x21');agents[_0x315932[_0x0c90('0x12')]]['reason']=_0x0c90('0x21');agents[_0x315932[_0x0c90('0x12')]][_0x0c90('0x22')]=_0x315932[_0x0c90('0x23')]?parseInt(_0x315932[_0x0c90('0x23')])/0x3e8:0x0;agents[_0x315932[_0x0c90('0x12')]]['talktime']=0x0;unanswered[_0x0c90('0x24')](_0x315932[_0x0c90('0x12')]);}}catch(_0x39f1b2){utils[_0x0c90('0x25')](util['format']('[%s][agents][agentringnoanswer]',_0x315932[_0x0c90('0x15')]),_0x39f1b2);}};exports[_0x0c90('0x26')]=function(_0x3bff04){try{_[_0x0c90('0x27')](agents,function(_0x119e09,_0x562664){if(_0x119e09[_0x0c90('0x15')]==_0x3bff04[_0x0c90('0x15')]&&!_[_0x0c90('0x28')](unanswered,_0x119e09['destuniqueid'])){utils[_0x0c90('0x14')](util['format']('[%s][agents][queuecallerabandon]',_0x3bff04[_0x0c90('0x15')]),_0x3bff04);utils[_0x0c90('0x19')](util[_0x0c90('0x1')](_0x0c90('0x29'),_0x3bff04['uniqueid'],_0x119e09[_0x0c90('0x5')],_0x119e09['destuniqueid']));_0x119e09[_0x0c90('0x1c')]=!![];_0x119e09['agentringnoanswerAt']=utils[_0x0c90('0x17')]();_0x119e09[_0x0c90('0x20')]='abandoned';_0x119e09[_0x0c90('0x2a')]=_0x0c90('0x2b');_0x119e09[_0x0c90('0x22')]=_0x3bff04[_0x0c90('0x22')];_0x119e09[_0x0c90('0x2c')]=0x0;writeDB(_0x119e09);}});}catch(_0x1517c9){utils[_0x0c90('0x25')](util[_0x0c90('0x1')]('[%s][agents][queuecallerabandon]',_0x3bff04[_0x0c90('0x15')]),_0x1517c9);}};exports[_0x0c90('0x2d')]=function(_0x404f78){try{if(agents[_0x404f78[_0x0c90('0x12')]]){utils['debug'](util[_0x0c90('0x1')](_0x0c90('0x2e'),_0x404f78[_0x0c90('0x15')]),_0x404f78);utils[_0x0c90('0x19')](util[_0x0c90('0x1')](_0x0c90('0x2f'),_0x404f78[_0x0c90('0x15')],agents[_0x404f78[_0x0c90('0x12')]]['membername'],_0x404f78[_0x0c90('0x12')]));agents[_0x404f78[_0x0c90('0x12')]]['agentconnectAt']=utils[_0x0c90('0x17')]();agents[_0x404f78[_0x0c90('0x12')]][_0x0c90('0x8')]=_0x404f78[_0x0c90('0x8')];agents[_0x404f78[_0x0c90('0x12')]]['connectedlinename']=_0x404f78[_0x0c90('0x18')];agents[_0x404f78[_0x0c90('0x12')]][_0x0c90('0x22')]=_0x404f78[_0x0c90('0x23')];agents[_0x404f78[_0x0c90('0x12')]][_0x0c90('0x20')]=_0x0c90('0x30');_[_0x0c90('0x27')](agents,function(_0x11a8e3,_0x4f0227){if(_0x11a8e3[_0x0c90('0x12')]!=_0x404f78['destuniqueid']&&_0x11a8e3[_0x0c90('0x15')]==_0x404f78['uniqueid']){_0x11a8e3[_0x0c90('0x2c')]=0x0;_0x11a8e3[_0x0c90('0x22')]=_0x404f78['ringtime'];_0x11a8e3['agentringnoanswer']=!![];_0x11a8e3[_0x0c90('0x31')]=utils['now']();_0x11a8e3[_0x0c90('0x20')]=_0x0c90('0x32');_0x11a8e3[_0x0c90('0x2a')]='answered_elsewhere';_0x11a8e3[_0x0c90('0x33')]=_0x404f78[_0x0c90('0x12')];_0x11a8e3[_0x0c90('0x34')]=_0x404f78[_0x0c90('0x5')];writeDB(_0x11a8e3);}});}}catch(_0x2139c3){utils[_0x0c90('0x25')](util['format'](_0x0c90('0x2e'),_0x404f78[_0x0c90('0x15')]),_0x2139c3);}};exports[_0x0c90('0xd')]=function(_0x399115){try{if(!_[_0x0c90('0x1d')](agents[_0x399115[_0x0c90('0x12')]])){utils[_0x0c90('0x14')](util['format'](_0x0c90('0x35'),_0x399115['uniqueid']),_0x399115);utils[_0x0c90('0x19')](util[_0x0c90('0x1')](_0x0c90('0x36'),_0x399115[_0x0c90('0x15')],agents[_0x399115[_0x0c90('0x12')]][_0x0c90('0x5')],_0x399115[_0x0c90('0x12')]));agents[_0x399115[_0x0c90('0x12')]][_0x0c90('0xd')]=!![];agents[_0x399115[_0x0c90('0x12')]][_0x0c90('0x37')]=utils[_0x0c90('0x17')]();agents[_0x399115[_0x0c90('0x12')]][_0x0c90('0x2c')]=utils[_0x0c90('0x38')](agents[_0x399115['destuniqueid']][_0x0c90('0x37')],agents[_0x399115[_0x0c90('0x12')]][_0x0c90('0x39')]);agents[_0x399115[_0x0c90('0x12')]][_0x0c90('0x2a')]=_0x399115[_0x0c90('0x2a')];agents[_0x399115[_0x0c90('0x12')]][_0x0c90('0x20')]=_0x0c90('0x3a');writeDB(agents[_0x399115[_0x0c90('0x12')]]);}}catch(_0x2f25ad){utils[_0x0c90('0x25')](util[_0x0c90('0x1')](_0x0c90('0x35'),_0x399115['uniqueid']),_0x2f25ad);}};exports[_0x0c90('0x3b')]=function(_0x38f492){try{if(!_['isNil'](agents[_0x38f492['transfereruniqueid']])){utils['debug'](util[_0x0c90('0x1')](_0x0c90('0x3c'),_0x38f492[_0x0c90('0x15')]),_0x38f492);utils[_0x0c90('0x19')](util[_0x0c90('0x1')]('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x38f492[_0x0c90('0x15')],agents[_0x38f492[_0x0c90('0x3d')]][_0x0c90('0x5')],agents[_0x38f492['transfereruniqueid']][_0x0c90('0x15')]));agents[_0x38f492[_0x0c90('0x3d')]][_0x0c90('0x3e')]=!![];agents[_0x38f492[_0x0c90('0x3d')]][_0x0c90('0x3f')]=_0x0c90('0x40');agents[_0x38f492[_0x0c90('0x3d')]][_0x0c90('0x41')]=_0x38f492[_0x0c90('0x42')];agents[_0x38f492[_0x0c90('0x3d')]]['transferuniqueid']=agents[_0x38f492[_0x0c90('0x3d')]]['uniqueid'];}}catch(_0xda4331){utils[_0x0c90('0x25')](util[_0x0c90('0x1')](_0x0c90('0x3c'),_0x38f492[_0x0c90('0x15')]),_0xda4331);}};exports[_0x0c90('0x43')]=function(_0x58dcfc){try{utils['debug'](util['format']('[%s][agents][attendedtransfer]',_0x58dcfc[_0x0c90('0x44')]),_0x58dcfc);if(_0x58dcfc[_0x0c90('0x44')]==_0x58dcfc[_0x0c90('0x45')]){if(!_['isNil'](agents[_0x58dcfc[_0x0c90('0x46')]])){utils[_0x0c90('0x19')](util['format'](_0x0c90('0x47'),_0x58dcfc['origtransfereruniqueid'],agents[_0x58dcfc[_0x0c90('0x46')]][_0x0c90('0x5')]));agents[_0x58dcfc[_0x0c90('0x46')]][_0x0c90('0x3e')]=!![];agents[_0x58dcfc['secondtransfereruniqueid']][_0x0c90('0x3f')]='ATTENDED';agents[_0x58dcfc[_0x0c90('0x46')]][_0x0c90('0x41')]=_0x58dcfc['origtransfererexten'];agents[_0x58dcfc['secondtransfereruniqueid']]['transferuniqueid']=_0x58dcfc[_0x0c90('0x44')];}if(_0x58dcfc[_0x0c90('0x48')]&&agents[_0x58dcfc[_0x0c90('0x48')]]){agents[_0x58dcfc[_0x0c90('0x48')]][_0x0c90('0x49')]=0x1;transfers[_0x58dcfc['transfereeuniqueid']]=_[_0x0c90('0x4a')](agents[_0x58dcfc[_0x0c90('0x48')]]);transfers[_0x58dcfc['transfereeuniqueid']][_0x0c90('0x7')]=agents[_0x58dcfc['secondtransfereruniqueid']][_0x0c90('0x7')];transfers[_0x58dcfc[_0x0c90('0x48')]]['calleridname']=agents[_0x58dcfc[_0x0c90('0x46')]]['calleridname'];transfers[_0x58dcfc['transfereeuniqueid']]['agentcalledAt']=utils[_0x0c90('0x17')]();transfers[_0x58dcfc[_0x0c90('0x48')]][_0x0c90('0x39')]=utils[_0x0c90('0x17')]();transfers[_0x58dcfc['transfereeuniqueid']]['holdtime']=0x0;transfers[_0x58dcfc[_0x0c90('0x48')]][_0x0c90('0x49')]=0x2;}}else if(_0x58dcfc[_0x0c90('0x46')]==_0x58dcfc['secondtransfererlinkedid']){if(!_[_0x0c90('0x1d')](agents[_0x58dcfc[_0x0c90('0x44')]])){utils[_0x0c90('0x19')](util['format'](_0x0c90('0x47'),_0x58dcfc[_0x0c90('0x44')],agents[_0x58dcfc[_0x0c90('0x44')]]['membername']));agents[_0x58dcfc[_0x0c90('0x44')]][_0x0c90('0x3e')]=!![];agents[_0x58dcfc[_0x0c90('0x44')]][_0x0c90('0x3f')]=_0x0c90('0x4b');agents[_0x58dcfc[_0x0c90('0x44')]][_0x0c90('0x41')]=_0x58dcfc[_0x0c90('0x4c')];agents[_0x58dcfc[_0x0c90('0x44')]]['transferuniqueid']=_0x58dcfc['secondtransfereruniqueid'];}if(_0x58dcfc[_0x0c90('0x4d')]&&agents[_0x58dcfc[_0x0c90('0x4d')]]){agents[_0x58dcfc[_0x0c90('0x4d')]][_0x0c90('0x49')]=0x1;transfers[_0x58dcfc[_0x0c90('0x4d')]]=_[_0x0c90('0x4a')](agents[_0x58dcfc[_0x0c90('0x4d')]]);transfers[_0x58dcfc[_0x0c90('0x4d')]][_0x0c90('0x7')]=agents[_0x58dcfc[_0x0c90('0x44')]][_0x0c90('0x7')];transfers[_0x58dcfc[_0x0c90('0x4d')]][_0x0c90('0x4e')]=agents[_0x58dcfc[_0x0c90('0x44')]][_0x0c90('0x4e')];transfers[_0x58dcfc['transfertargetuniqueid']][_0x0c90('0x16')]=utils[_0x0c90('0x17')]();transfers[_0x58dcfc[_0x0c90('0x4d')]]['agentconnectAt']=utils['now']();transfers[_0x58dcfc[_0x0c90('0x4d')]]['holdtime']=0x0;transfers[_0x58dcfc[_0x0c90('0x4d')]][_0x0c90('0x49')]=0x2;}}}catch(_0x57fb18){utils[_0x0c90('0x25')](util[_0x0c90('0x1')](_0x0c90('0x4f'),_0x58dcfc[_0x0c90('0x44')]),_0x57fb18);}};exports['hangup']=function(_0x5f2628){try{utils['debug'](util[_0x0c90('0x1')](_0x0c90('0x50'),_0x5f2628[_0x0c90('0x15')]),_0x5f2628);if(agents[_0x5f2628[_0x0c90('0x15')]]&&agents[_0x5f2628['uniqueid']][_0x0c90('0x2a')]==='timeout'){if(_0x5f2628[_0x0c90('0x51')]==='21'){agents[_0x5f2628[_0x0c90('0x15')]][_0x0c90('0x2a')]='rejected';agents[_0x5f2628[_0x0c90('0x15')]][_0x0c90('0x20')]=_0x0c90('0x52');}utils[_0x0c90('0x19')](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x5f2628[_0x0c90('0x15')],agents[_0x5f2628['uniqueid']][_0x0c90('0x5')],agents[_0x5f2628[_0x0c90('0x15')]][_0x0c90('0x2a')],agents[_0x5f2628[_0x0c90('0x15')]][_0x0c90('0x20')]));writeDB(agents[_0x5f2628[_0x0c90('0x15')]]);var _0x2321eb=unanswered[_0x0c90('0x53')](_0x5f2628[_0x0c90('0x15')]);if(_0x2321eb>-0x1){unanswered[_0x0c90('0x54')](_0x2321eb,0x1);}}if(transfers[_0x5f2628['uniqueid']]){transfers[_0x5f2628[_0x0c90('0x15')]][_0x0c90('0xd')]=!![];transfers[_0x5f2628[_0x0c90('0x15')]][_0x0c90('0x37')]=utils[_0x0c90('0x17')]();transfers[_0x5f2628[_0x0c90('0x15')]][_0x0c90('0x2c')]=utils[_0x0c90('0x38')](transfers[_0x5f2628[_0x0c90('0x15')]][_0x0c90('0x37')],transfers[_0x5f2628['uniqueid']][_0x0c90('0x39')]);transfers[_0x5f2628[_0x0c90('0x15')]][_0x0c90('0x2a')]=_0x0c90('0x55');transfers[_0x5f2628['uniqueid']][_0x0c90('0x20')]=_0x0c90('0x3a');utils[_0x0c90('0x19')](util['format'](_0x0c90('0x56'),_0x5f2628[_0x0c90('0x15')],transfers[_0x5f2628['uniqueid']][_0x0c90('0x5')],transfers[_0x5f2628['uniqueid']][_0x0c90('0x2a')],transfers[_0x5f2628['uniqueid']]['lastevent']));writeDB(transfers[_0x5f2628[_0x0c90('0x15')]],!![]);}if(agents[_0x5f2628[_0x0c90('0x15')]]&&agents[_0x5f2628['uniqueid']]['agentconnectAt']){agents[_0x5f2628[_0x0c90('0x15')]][_0x0c90('0xd')]=!![];agents[_0x5f2628['uniqueid']]['agentcompleteAt']=utils[_0x0c90('0x17')]();agents[_0x5f2628['uniqueid']][_0x0c90('0x2c')]=utils[_0x0c90('0x38')](agents[_0x5f2628[_0x0c90('0x15')]][_0x0c90('0x37')],agents[_0x5f2628[_0x0c90('0x15')]]['agentconnectAt']);agents[_0x5f2628[_0x0c90('0x15')]][_0x0c90('0x2a')]=agents[_0x5f2628[_0x0c90('0x15')]]['transfer']?'transfer':_0x0c90('0x55');agents[_0x5f2628[_0x0c90('0x15')]][_0x0c90('0x20')]='complete';utils['info'](util['format'](_0x0c90('0x56'),_0x5f2628['uniqueid'],agents[_0x5f2628['uniqueid']]['membername'],agents[_0x5f2628['uniqueid']][_0x0c90('0x2a')],agents[_0x5f2628[_0x0c90('0x15')]][_0x0c90('0x20')]));writeDB(agents[_0x5f2628[_0x0c90('0x15')]]);}}catch(_0x16c383){utils['error'](util['format']('[%s][agents][hangup]',_0x5f2628[_0x0c90('0x15')]),_0x16c383);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index bf5e5cc..0c40c48 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 _0xbf4d=['callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','duration','starttime','diffTime','endtime','attendedtransfer','localtwolinkedid','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','[%s][calls][attendedtransfer]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstart]','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview','xmd-queue','xmcs-queue','lastapplication','Queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','application','appdata','toLowerCase','set','startsWith','lastIndexOf','execif','gotoif','lastdata','util','NO\x20ANSWER','FAILED','BUSY','info','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','lastevent','getUserByInternal','then','UserId','request','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','linkedid','format','context','exten','accountcode','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]','isNil','channelstate','systemanswertime','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','ANSWERED','hangup','[%s][calls][hangup]'];(function(_0x216d45,_0x4989fe){var _0xbaac0b=function(_0x308a41){while(--_0x308a41){_0x216d45['push'](_0x216d45['shift']());}};_0xbaac0b(++_0x4989fe);}(_0xbf4d,0x177));var _0xdbf4=function(_0x17ebe2,_0x1072c9){_0x17ebe2=_0x17ebe2-0x0;var _0x2694d7=_0xbf4d[_0x17ebe2];return _0x2694d7;};'use strict';var _=require('lodash');var util=require(_0xdbf4('0x0'));var utils=require('./utils');var dispositions=[_0xdbf4('0x1'),_0xdbf4('0x2'),_0xdbf4('0x2'),_0xdbf4('0x1'),'NO\x20ANSWER',_0xdbf4('0x1'),'ANSWERED',_0xdbf4('0x3'),_0xdbf4('0x2'),_0xdbf4('0x2'),_0xdbf4('0x2')];var channels={};function writeDB(_0x51ed47){utils[_0xdbf4('0x4')](util['format'](_0xdbf4('0x5'),_0x51ed47[_0xdbf4('0x6')],_0x51ed47[_0xdbf4('0x7')],_0x51ed47[_0xdbf4('0x8')],_0x51ed47[_0xdbf4('0x9')],_0x51ed47[_0xdbf4('0xa')],_0x51ed47[_0xdbf4('0xb')],_0x51ed47['connectedlinenum'],_0x51ed47[_0xdbf4('0xc')]));if(_0x51ed47['accountcode']){utils[_0xdbf4('0xd')](_0x51ed47['accountcode'])[_0xdbf4('0xe')](function(_0x38b8f4){if(_0x38b8f4){_0x51ed47[_0xdbf4('0xf')]=_0x38b8f4['id'];}utils[_0xdbf4('0x10')](_0xdbf4('0x11'),_0x51ed47);});}else{utils[_0xdbf4('0x10')](_0xdbf4('0x11'),_0x51ed47);}if(channels[_0x51ed47[_0xdbf4('0x6')]]){delete channels[_0x51ed47[_0xdbf4('0x6')]];}}exports[_0xdbf4('0x12')]=function(_0x220b01){try{utils[_0xdbf4('0x13')](util['format'](_0xdbf4('0x14'),_0x220b01[_0xdbf4('0x6')]),_0x220b01);if(_0x220b01[_0xdbf4('0x6')]==_0x220b01[_0xdbf4('0x15')]&&_0x220b01[_0xdbf4('0x7')]!='OutgoingSpoolFailed'){utils[_0xdbf4('0x4')](util[_0xdbf4('0x16')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x220b01['uniqueid'],_0x220b01[_0xdbf4('0x17')],_0x220b01[_0xdbf4('0x18')]));channels[_0x220b01[_0xdbf4('0x6')]]={'uniqueid':_0x220b01[_0xdbf4('0x6')],'accountcode':_0x220b01[_0xdbf4('0x19')],'source':_0x220b01[_0xdbf4('0xb')],'destination':_0x220b01[_0xdbf4('0x18')],'destinationcontext':_0x220b01['context'],'channel':_0x220b01[_0xdbf4('0x7')],'starttime':utils[_0xdbf4('0x1a')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0xdbf4('0x1b')};}}catch(_0x4f9eb3){utils[_0xdbf4('0x1c')](util[_0xdbf4('0x16')]('[%s][calls][newchannel]',_0x220b01[_0xdbf4('0x6')]),_0x4f9eb3);}};exports[_0xdbf4('0x1d')]=function(_0x19caad){try{utils[_0xdbf4('0x13')](util[_0xdbf4('0x16')](_0xdbf4('0x1e'),_0x19caad['uniqueid']),_0x19caad);if(!_[_0xdbf4('0x1f')](channels[_0x19caad[_0xdbf4('0x6')]])&&_0x19caad[_0xdbf4('0x20')]==0x6){utils[_0xdbf4('0x4')](util['format']('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x19caad[_0xdbf4('0x6')],_0x19caad['context'],_0x19caad[_0xdbf4('0x7')]));if(_[_0xdbf4('0x1f')](channels[_0x19caad[_0xdbf4('0x6')]][_0xdbf4('0x21')])){channels[_0x19caad[_0xdbf4('0x6')]]['systemanswertime']=utils[_0xdbf4('0x1a')]();}}else if(!_[_0xdbf4('0x1f')](channels[_0x19caad[_0xdbf4('0x15')]])&&_0x19caad[_0xdbf4('0x20')]==0x6&&_0x19caad[_0xdbf4('0x17')]!='transfer'){utils[_0xdbf4('0x4')](util[_0xdbf4('0x16')](_0xdbf4('0x22'),_0x19caad[_0xdbf4('0x6')],_0x19caad[_0xdbf4('0x15')],_0x19caad[_0xdbf4('0x17')],_0x19caad['channel']));channels[_0x19caad[_0xdbf4('0x15')]][_0xdbf4('0x19')]=_0x19caad[_0xdbf4('0x19')];channels[_0x19caad[_0xdbf4('0x15')]][_0xdbf4('0x23')]=_0x19caad[_0xdbf4('0x7')];if(_[_0xdbf4('0x1f')](channels[_0x19caad[_0xdbf4('0x15')]][_0xdbf4('0x24')])){channels[_0x19caad[_0xdbf4('0x15')]][_0xdbf4('0x24')]=utils['now']();}channels[_0x19caad['linkedid']][_0xdbf4('0x25')]=dispositions[_['toNumber'](_0x19caad['channelstate'])]||_0xdbf4('0x26');}}catch(_0x1939d7){utils[_0xdbf4('0x1c')](util[_0xdbf4('0x16')](_0xdbf4('0x1e'),_0x19caad[_0xdbf4('0x6')]),_0x1939d7);}};exports[_0xdbf4('0x27')]=function(_0x2b2a50){try{if(!_[_0xdbf4('0x1f')](channels[_0x2b2a50[_0xdbf4('0x6')]])){utils[_0xdbf4('0x13')](util[_0xdbf4('0x16')](_0xdbf4('0x28'),_0x2b2a50['uniqueid']),_0x2b2a50);if(_[_0xdbf4('0x1f')](channels[_0x2b2a50[_0xdbf4('0x6')]][_0xdbf4('0x29')])){channels[_0x2b2a50[_0xdbf4('0x6')]][_0xdbf4('0x29')]=_0x2b2a50[_0xdbf4('0x2a')]+'\x20<'+_0x2b2a50['calleridnum']+'>';}utils[_0xdbf4('0x4')](util[_0xdbf4('0x16')](_0xdbf4('0x2b'),_0x2b2a50[_0xdbf4('0x6')],channels[_0x2b2a50[_0xdbf4('0x6')]]['callerid'],_0x2b2a50[_0xdbf4('0x2c')]));channels[_0x2b2a50[_0xdbf4('0x6')]]['endtime']=utils['now']();channels[_0x2b2a50[_0xdbf4('0x6')]][_0xdbf4('0x2d')]=utils['diffTime'](channels[_0x2b2a50[_0xdbf4('0x6')]]['endtime'],channels[_0x2b2a50[_0xdbf4('0x6')]][_0xdbf4('0x2e')]);channels[_0x2b2a50['uniqueid']]['billableseconds']=channels[_0x2b2a50['uniqueid']][_0xdbf4('0x24')]?utils[_0xdbf4('0x2f')](channels[_0x2b2a50[_0xdbf4('0x6')]][_0xdbf4('0x30')],channels[_0x2b2a50[_0xdbf4('0x6')]][_0xdbf4('0x24')]):0x0;writeDB(channels[_0x2b2a50[_0xdbf4('0x6')]]);}}catch(_0x483adf){utils[_0xdbf4('0x1c')](util[_0xdbf4('0x16')](_0xdbf4('0x28'),_0x2b2a50[_0xdbf4('0x6')]),_0x483adf);}};exports[_0xdbf4('0x31')]=function(_0x14c7fd){try{if(!_[_0xdbf4('0x1f')](channels[_0x14c7fd[_0xdbf4('0x32')]])){utils[_0xdbf4('0x13')](util[_0xdbf4('0x16')]('[%s][calls][attendedtransfer]',_0x14c7fd[_0xdbf4('0x33')]),_0x14c7fd);if(channels[_0x14c7fd[_0xdbf4('0x32')]][_0xdbf4('0x7')]==_0x14c7fd[_0xdbf4('0x34')]){utils['info'](util[_0xdbf4('0x16')](_0xdbf4('0x35'),_0x14c7fd[_0xdbf4('0x33')],_0x14c7fd['localtwolinkedid'],_0x14c7fd[_0xdbf4('0x36')]));channels[_0x14c7fd['localtwolinkedid']][_0xdbf4('0x23')]=_0x14c7fd[_0xdbf4('0x36')];channels[_0x14c7fd[_0xdbf4('0x32')]][_0xdbf4('0x37')]=_0xdbf4('0x38');}else if(channels[_0x14c7fd['localtwolinkedid']][_0xdbf4('0x7')]=_0x14c7fd[_0xdbf4('0x39')]){utils[_0xdbf4('0x4')](util[_0xdbf4('0x16')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x14c7fd[_0xdbf4('0x33')],_0x14c7fd[_0xdbf4('0x32')],_0x14c7fd[_0xdbf4('0x3a')]));channels[_0x14c7fd[_0xdbf4('0x32')]][_0xdbf4('0x23')]=_0x14c7fd[_0xdbf4('0x3a')];channels[_0x14c7fd[_0xdbf4('0x32')]][_0xdbf4('0x37')]=_0xdbf4('0x38');}}}catch(_0x3f20fb){utils[_0xdbf4('0x1c')](util['format'](_0xdbf4('0x3b'),_0x14c7fd[_0xdbf4('0x33')]),_0x3f20fb);}};exports['musiconholdstart']=function(_0x74da5c){try{if(!_[_0xdbf4('0x1f')](channels[_0x74da5c[_0xdbf4('0x6')]])){utils[_0xdbf4('0x13')](util[_0xdbf4('0x16')]('[%s][calls][musiconholdstart]',_0x74da5c[_0xdbf4('0x6')]),_0x74da5c);channels[_0x74da5c['uniqueid']][_0xdbf4('0x3c')]=utils[_0xdbf4('0x1a')]();utils[_0xdbf4('0x4')](util['format'](_0xdbf4('0x3d'),_0x74da5c['uniqueid'],channels[_0x74da5c['uniqueid']][_0xdbf4('0x3c')]));}}catch(_0x328d12){utils['error'](util['format'](_0xdbf4('0x3e'),_0x74da5c[_0xdbf4('0x6')]),_0x328d12);}};exports[_0xdbf4('0x3f')]=function(_0x314471){try{if(!_['isNil'](channels[_0x314471[_0xdbf4('0x6')]])){utils['debug'](util['format'](_0xdbf4('0x40'),_0x314471[_0xdbf4('0x6')]),_0x314471);if(!_[_0xdbf4('0x1f')](channels[_0x314471[_0xdbf4('0x6')]]['musiconholdstartAt'])){channels[_0x314471[_0xdbf4('0x6')]][_0xdbf4('0x41')]+=utils['diffTime'](utils[_0xdbf4('0x1a')](),channels[_0x314471[_0xdbf4('0x6')]][_0xdbf4('0x3c')]);utils[_0xdbf4('0x4')](util[_0xdbf4('0x16')](_0xdbf4('0x42'),_0x314471[_0xdbf4('0x6')],channels[_0x314471[_0xdbf4('0x6')]][_0xdbf4('0x41')]));delete channels[_0x314471[_0xdbf4('0x6')]][_0xdbf4('0x3c')];}}}catch(_0x2b7be2){utils['error'](util[_0xdbf4('0x16')](_0xdbf4('0x40'),_0x314471['uniqueid']),_0x2b7be2);}};exports['varset']=function(_0x46d218){try{if(!_['isNil'](channels[_0x46d218['uniqueid']])){utils[_0xdbf4('0x13')](util[_0xdbf4('0x16')](_0xdbf4('0x43'),_0x46d218[_0xdbf4('0x6')]),_0x46d218);if(!_['isNil'](_0x46d218[_0xdbf4('0x44')][_0xdbf4('0x45')])){utils[_0xdbf4('0x4')](util[_0xdbf4('0x16')](_0xdbf4('0x46'),_0x46d218[_0xdbf4('0x6')],_0x46d218[_0xdbf4('0x47')]));channels[_0x46d218['uniqueid']]['source']=_0x46d218[_0xdbf4('0x47')];}if(!_[_0xdbf4('0x1f')](_0x46d218['variable'][_0xdbf4('0x48')])){utils[_0xdbf4('0x4')](util[_0xdbf4('0x16')](_0xdbf4('0x49'),_0x46d218[_0xdbf4('0x6')],_0x46d218[_0xdbf4('0x47')]));channels[_0x46d218[_0xdbf4('0x6')]][_0xdbf4('0x4a')]=_0x46d218[_0xdbf4('0x47')];channels[_0x46d218['uniqueid']]['callerid']='\x22'+_0x46d218[_0xdbf4('0x47')]+_0xdbf4('0x4b')+_0x46d218['value']+'>';}if(!_[_0xdbf4('0x1f')](_0x46d218['variable']['xmd-callerid-preview'])||!_[_0xdbf4('0x1f')](_0x46d218[_0xdbf4('0x44')][_0xdbf4('0x4c')])){utils[_0xdbf4('0x4')](util['format'](_0xdbf4('0x4d'),_0x46d218['uniqueid'],!_[_0xdbf4('0x1f')](_0x46d218[_0xdbf4('0x44')][_0xdbf4('0x4e')])?'xmd-callerid-preview':_0xdbf4('0x4c'),_0x46d218[_0xdbf4('0x47')]));channels[_0x46d218[_0xdbf4('0x6')]][_0xdbf4('0x29')]=_0x46d218[_0xdbf4('0x47')];}if(!_['isNil'](_0x46d218[_0xdbf4('0x44')][_0xdbf4('0x4f')])||!_[_0xdbf4('0x1f')](_0x46d218['variable'][_0xdbf4('0x50')])){utils[_0xdbf4('0x4')](util[_0xdbf4('0x16')](_0xdbf4('0x4d'),_0x46d218[_0xdbf4('0x6')],!_['isNil'](_0x46d218['variable']['xmd-queue'])?_0xdbf4('0x4f'):'xmcs-queue',_0x46d218['value']));channels[_0x46d218[_0xdbf4('0x6')]][_0xdbf4('0x51')]=_0xdbf4('0x52');channels[_0x46d218[_0xdbf4('0x6')]]['lastdata']=_0x46d218[_0xdbf4('0x47')];channels[_0x46d218[_0xdbf4('0x6')]][_0xdbf4('0x8')]=!![];}if(!_[_0xdbf4('0x1f')](_0x46d218[_0xdbf4('0x44')][_0xdbf4('0x53')])){utils['info'](util['format'](_0xdbf4('0x54'),_0x46d218[_0xdbf4('0x6')],_0x46d218['value']));channels[_0x46d218[_0xdbf4('0x6')]][_0xdbf4('0x55')]=_0x46d218[_0xdbf4('0x47')];}if(!_[_0xdbf4('0x1f')](_0x46d218[_0xdbf4('0x44')][_0xdbf4('0x56')])){utils[_0xdbf4('0x4')](util[_0xdbf4('0x16')](_0xdbf4('0x57'),_0x46d218[_0xdbf4('0x6')],_0x46d218[_0xdbf4('0x47')]));channels[_0x46d218[_0xdbf4('0x6')]]['type']=_0x46d218[_0xdbf4('0x47')];}if(!_[_0xdbf4('0x1f')](_0x46d218['variable'][_0xdbf4('0x58')])){utils['info'](util[_0xdbf4('0x16')](_0xdbf4('0x59'),_0x46d218['uniqueid'],_0x46d218['value']));channels[_0x46d218[_0xdbf4('0x6')]][_0xdbf4('0x5a')]=_0x46d218[_0xdbf4('0x47')];}if(!_[_0xdbf4('0x1f')](_0x46d218[_0xdbf4('0x44')][_0xdbf4('0x5b')])){utils['info'](util['format'](_0xdbf4('0x5c'),_0x46d218[_0xdbf4('0x6')],_0x46d218[_0xdbf4('0x47')]));channels[_0x46d218[_0xdbf4('0x6')]]['sipcallid']=_0x46d218[_0xdbf4('0x47')];}}}catch(_0x54b918){utils['error'](util[_0xdbf4('0x16')](_0xdbf4('0x43'),_0x46d218['uniqueid']),_0x54b918);}};exports[_0xdbf4('0x5d')]=function(_0x187a18){try{if(!_['isNil'](channels[_0x187a18[_0xdbf4('0x6')]])){utils[_0xdbf4('0x13')](util[_0xdbf4('0x16')](_0xdbf4('0x5e'),_0x187a18[_0xdbf4('0x6')]),_0x187a18);utils[_0xdbf4('0x4')](util[_0xdbf4('0x16')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x187a18[_0xdbf4('0x6')],_0x187a18[_0xdbf4('0x5f')],_0x187a18[_0xdbf4('0x60')]));if(_0x187a18['application'][_0xdbf4('0x61')]()==_0xdbf4('0x62')&&_[_0xdbf4('0x63')](_0x187a18[_0xdbf4('0x60')][_0xdbf4('0x61')](),'cdr')){var _0x2d944e=_0x187a18['appdata']['split']('=');var _0x2a1b73=_0x2d944e[0x0]['substring'](_0x2d944e[0x0][_0xdbf4('0x64')]('(')+0x1,_0x2d944e[0x0][_0xdbf4('0x64')](')'));var _0x39ffdb=_0x2d944e[0x1];channels[_0x187a18[_0xdbf4('0x6')]][_0x2a1b73]=_0x39ffdb;}if(!_['includes']([_0xdbf4('0x27'),'noop',_0xdbf4('0x65'),_0xdbf4('0x62'),_0xdbf4('0x66')],_0x187a18[_0xdbf4('0x5f')]['toLowerCase']())){channels[_0x187a18[_0xdbf4('0x6')]][_0xdbf4('0x51')]=_0x187a18[_0xdbf4('0x5f')];channels[_0x187a18[_0xdbf4('0x6')]][_0xdbf4('0x67')]=_0x187a18['appdata'];}}}catch(_0x4ce07e){utils[_0xdbf4('0x1c')](util[_0xdbf4('0x16')](_0xdbf4('0x5e'),_0x187a18[_0xdbf4('0x6')]),_0x4ce07e);}}; \ No newline at end of file +var _0xe61a=['calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','starttime','billableseconds','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','userfield','_attended','transfertargetchannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfererchannel','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][musiconholdstop]','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','cdr','split','substring','lastIndexOf','noop','gotoif','lodash','util','./utils','FAILED','NO\x20ANSWER','ANSWERED','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','accountcode','getUserByInternal','then','UserId','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','exten','context','now','DOCUMENTATION','newstate','[%s][calls][newstate]','isNil','channelstate','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','error','hangup','[%s][calls][hangup]','callerid'];(function(_0xe896bf,_0x4f8e5e){var _0x4c7a8a=function(_0x410ff2){while(--_0x410ff2){_0xe896bf['push'](_0xe896bf['shift']());}};_0x4c7a8a(++_0x4f8e5e);}(_0xe61a,0xa6));var _0xae61=function(_0xbc90ad,_0x485602){_0xbc90ad=_0xbc90ad-0x0;var _0x5784f6=_0xe61a[_0xbc90ad];return _0x5784f6;};'use strict';var _=require(_0xae61('0x0'));var util=require(_0xae61('0x1'));var utils=require(_0xae61('0x2'));var dispositions=['NO\x20ANSWER',_0xae61('0x3'),_0xae61('0x3'),_0xae61('0x4'),_0xae61('0x4'),'NO\x20ANSWER',_0xae61('0x5'),'BUSY',_0xae61('0x3'),_0xae61('0x3'),'FAILED'];var channels={};function writeDB(_0x151129){utils[_0xae61('0x6')](util[_0xae61('0x7')](_0xae61('0x8'),_0x151129[_0xae61('0x9')],_0x151129[_0xae61('0xa')],_0x151129[_0xae61('0xb')],_0x151129[_0xae61('0xc')],_0x151129[_0xae61('0xd')],_0x151129[_0xae61('0xe')],_0x151129[_0xae61('0xf')],_0x151129['lastevent']));if(_0x151129[_0xae61('0x10')]){utils[_0xae61('0x11')](_0x151129['accountcode'])[_0xae61('0x12')](function(_0x5a12e8){if(_0x5a12e8){_0x151129[_0xae61('0x13')]=_0x5a12e8['id'];}utils['request'](_0xae61('0x14'),_0x151129);});}else{utils['request'](_0xae61('0x14'),_0x151129);}if(channels[_0x151129['uniqueid']]){delete channels[_0x151129[_0xae61('0x9')]];}}exports[_0xae61('0x15')]=function(_0x5203a6){try{utils[_0xae61('0x16')](util[_0xae61('0x7')](_0xae61('0x17'),_0x5203a6[_0xae61('0x9')]),_0x5203a6);if(_0x5203a6[_0xae61('0x9')]==_0x5203a6[_0xae61('0x18')]&&_0x5203a6['channel']!=_0xae61('0x19')){utils[_0xae61('0x6')](util['format']('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x5203a6[_0xae61('0x9')],_0x5203a6['context'],_0x5203a6[_0xae61('0x1a')]));channels[_0x5203a6['uniqueid']]={'uniqueid':_0x5203a6[_0xae61('0x9')],'accountcode':_0x5203a6['accountcode'],'source':_0x5203a6[_0xae61('0xe')],'destination':_0x5203a6['exten'],'destinationcontext':_0x5203a6[_0xae61('0x1b')],'channel':_0x5203a6['channel'],'starttime':utils[_0xae61('0x1c')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xae61('0x4'),'amaflags':_0xae61('0x1d')};}}catch(_0x15af74){utils['error'](util[_0xae61('0x7')](_0xae61('0x17'),_0x5203a6[_0xae61('0x9')]),_0x15af74);}};exports[_0xae61('0x1e')]=function(_0x5259b9){try{utils[_0xae61('0x16')](util[_0xae61('0x7')](_0xae61('0x1f'),_0x5259b9[_0xae61('0x9')]),_0x5259b9);if(!_[_0xae61('0x20')](channels[_0x5259b9['uniqueid']])&&_0x5259b9[_0xae61('0x21')]==0x6){utils['info'](util[_0xae61('0x7')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x5259b9[_0xae61('0x9')],_0x5259b9[_0xae61('0x1b')],_0x5259b9['channel']));if(_[_0xae61('0x20')](channels[_0x5259b9[_0xae61('0x9')]][_0xae61('0x22')])){channels[_0x5259b9[_0xae61('0x9')]]['systemanswertime']=utils[_0xae61('0x1c')]();}}else if(!_[_0xae61('0x20')](channels[_0x5259b9[_0xae61('0x18')]])&&_0x5259b9['channelstate']==0x6&&_0x5259b9[_0xae61('0x1b')]!=_0xae61('0x23')){utils[_0xae61('0x6')](util[_0xae61('0x7')](_0xae61('0x24'),_0x5259b9[_0xae61('0x9')],_0x5259b9[_0xae61('0x18')],_0x5259b9['context'],_0x5259b9[_0xae61('0xa')]));channels[_0x5259b9[_0xae61('0x18')]][_0xae61('0x10')]=_0x5259b9[_0xae61('0x10')];channels[_0x5259b9[_0xae61('0x18')]][_0xae61('0x25')]=_0x5259b9[_0xae61('0xa')];if(_[_0xae61('0x20')](channels[_0x5259b9[_0xae61('0x18')]][_0xae61('0x26')])){channels[_0x5259b9[_0xae61('0x18')]]['answertime']=utils[_0xae61('0x1c')]();}channels[_0x5259b9[_0xae61('0x18')]][_0xae61('0x27')]=dispositions[_['toNumber'](_0x5259b9[_0xae61('0x21')])]||_0xae61('0x5');}}catch(_0x4617c1){utils[_0xae61('0x28')](util[_0xae61('0x7')]('[%s][calls][newstate]',_0x5259b9[_0xae61('0x9')]),_0x4617c1);}};exports[_0xae61('0x29')]=function(_0x3a1de3){try{if(!_[_0xae61('0x20')](channels[_0x3a1de3[_0xae61('0x9')]])){utils[_0xae61('0x16')](util[_0xae61('0x7')](_0xae61('0x2a'),_0x3a1de3[_0xae61('0x9')]),_0x3a1de3);if(_[_0xae61('0x20')](channels[_0x3a1de3['uniqueid']][_0xae61('0x2b')])){channels[_0x3a1de3[_0xae61('0x9')]][_0xae61('0x2b')]=_0x3a1de3[_0xae61('0x2c')]+'\x20<'+_0x3a1de3[_0xae61('0xe')]+'>';}utils[_0xae61('0x6')](util[_0xae61('0x7')](_0xae61('0x2d'),_0x3a1de3[_0xae61('0x9')],channels[_0x3a1de3[_0xae61('0x9')]][_0xae61('0x2b')],_0x3a1de3[_0xae61('0x2e')]));channels[_0x3a1de3[_0xae61('0x9')]][_0xae61('0x2f')]=utils['now']();channels[_0x3a1de3[_0xae61('0x9')]][_0xae61('0x30')]=utils[_0xae61('0x31')](channels[_0x3a1de3[_0xae61('0x9')]]['endtime'],channels[_0x3a1de3[_0xae61('0x9')]][_0xae61('0x32')]);channels[_0x3a1de3[_0xae61('0x9')]][_0xae61('0x33')]=channels[_0x3a1de3[_0xae61('0x9')]]['answertime']?utils[_0xae61('0x31')](channels[_0x3a1de3[_0xae61('0x9')]][_0xae61('0x2f')],channels[_0x3a1de3['uniqueid']][_0xae61('0x26')]):0x0;writeDB(channels[_0x3a1de3[_0xae61('0x9')]]);}}catch(_0xb391ab){utils['error'](util[_0xae61('0x7')](_0xae61('0x2a'),_0x3a1de3[_0xae61('0x9')]),_0xb391ab);}};exports['attendedtransfer']=function(_0x288375){try{if(!_[_0xae61('0x20')](channels[_0x288375[_0xae61('0x34')]])){utils[_0xae61('0x16')](util[_0xae61('0x7')](_0xae61('0x35'),_0x288375[_0xae61('0x36')]),_0x288375);if(channels[_0x288375[_0xae61('0x34')]][_0xae61('0xa')]==_0x288375[_0xae61('0x37')]){utils[_0xae61('0x6')](util[_0xae61('0x7')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x288375['origtransfereruniqueid'],_0x288375[_0xae61('0x34')],_0x288375['secondtransfererchannel']));channels[_0x288375['localtwolinkedid']][_0xae61('0x25')]=_0x288375['secondtransfererchannel'];channels[_0x288375[_0xae61('0x34')]][_0xae61('0x38')]=_0xae61('0x39');}else if(channels[_0x288375[_0xae61('0x34')]]['channel']=_0x288375[_0xae61('0x3a')]){utils[_0xae61('0x6')](util[_0xae61('0x7')](_0xae61('0x3b'),_0x288375[_0xae61('0x36')],_0x288375[_0xae61('0x34')],_0x288375[_0xae61('0x3c')]));channels[_0x288375[_0xae61('0x34')]][_0xae61('0x25')]=_0x288375['origtransfererchannel'];channels[_0x288375['localtwolinkedid']][_0xae61('0x38')]='_attended';}}}catch(_0x476d47){utils[_0xae61('0x28')](util[_0xae61('0x7')](_0xae61('0x35'),_0x288375[_0xae61('0x36')]),_0x476d47);}};exports['musiconholdstart']=function(_0xe812ed){try{if(!_['isNil'](channels[_0xe812ed[_0xae61('0x9')]])){utils['debug'](util['format'](_0xae61('0x3d'),_0xe812ed['uniqueid']),_0xe812ed);channels[_0xe812ed[_0xae61('0x9')]][_0xae61('0x3e')]=utils[_0xae61('0x1c')]();utils['info'](util[_0xae61('0x7')](_0xae61('0x3f'),_0xe812ed['uniqueid'],channels[_0xe812ed['uniqueid']][_0xae61('0x3e')]));}}catch(_0xddd8bb){utils['error'](util['format']('[%s][calls][musiconholdstart]',_0xe812ed[_0xae61('0x9')]),_0xddd8bb);}};exports[_0xae61('0x40')]=function(_0x2e57a8){try{if(!_[_0xae61('0x20')](channels[_0x2e57a8['uniqueid']])){utils[_0xae61('0x16')](util[_0xae61('0x7')]('[%s][calls][musiconholdstop]',_0x2e57a8[_0xae61('0x9')]),_0x2e57a8);if(!_['isNil'](channels[_0x2e57a8[_0xae61('0x9')]][_0xae61('0x3e')])){channels[_0x2e57a8[_0xae61('0x9')]]['mohtime']+=utils[_0xae61('0x31')](utils['now'](),channels[_0x2e57a8['uniqueid']][_0xae61('0x3e')]);utils[_0xae61('0x6')](util[_0xae61('0x7')](_0xae61('0x41'),_0x2e57a8[_0xae61('0x9')],channels[_0x2e57a8[_0xae61('0x9')]]['mohtime']));delete channels[_0x2e57a8[_0xae61('0x9')]][_0xae61('0x3e')];}}}catch(_0x57a36b){utils[_0xae61('0x28')](util[_0xae61('0x7')](_0xae61('0x42'),_0x2e57a8[_0xae61('0x9')]),_0x57a36b);}};exports[_0xae61('0x43')]=function(_0x4a019b){try{if(!_[_0xae61('0x20')](channels[_0x4a019b[_0xae61('0x9')]])){utils['debug'](util[_0xae61('0x7')](_0xae61('0x44'),_0x4a019b['uniqueid']),_0x4a019b);if(!_[_0xae61('0x20')](_0x4a019b[_0xae61('0x45')][_0xae61('0x46')])){utils['info'](util[_0xae61('0x7')](_0xae61('0x47'),_0x4a019b[_0xae61('0x9')],_0x4a019b[_0xae61('0x48')]));channels[_0x4a019b[_0xae61('0x9')]][_0xae61('0x49')]=_0x4a019b[_0xae61('0x48')];}if(!_[_0xae61('0x20')](_0x4a019b[_0xae61('0x45')][_0xae61('0x4a')])){utils[_0xae61('0x6')](util[_0xae61('0x7')](_0xae61('0x4b'),_0x4a019b[_0xae61('0x9')],_0x4a019b[_0xae61('0x48')]));channels[_0x4a019b[_0xae61('0x9')]]['destination']=_0x4a019b[_0xae61('0x48')];channels[_0x4a019b[_0xae61('0x9')]][_0xae61('0x2b')]='\x22'+_0x4a019b[_0xae61('0x48')]+_0xae61('0x4c')+_0x4a019b[_0xae61('0x48')]+'>';}if(!_[_0xae61('0x20')](_0x4a019b[_0xae61('0x45')][_0xae61('0x4d')])||!_['isNil'](_0x4a019b[_0xae61('0x45')]['xmd-callerid'])){utils['info'](util[_0xae61('0x7')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x4a019b[_0xae61('0x9')],!_[_0xae61('0x20')](_0x4a019b['variable'][_0xae61('0x4d')])?_0xae61('0x4d'):_0xae61('0x4e'),_0x4a019b[_0xae61('0x48')]));channels[_0x4a019b[_0xae61('0x9')]]['callerid']=_0x4a019b['value'];}if(!_['isNil'](_0x4a019b[_0xae61('0x45')][_0xae61('0x4f')])||!_['isNil'](_0x4a019b[_0xae61('0x45')][_0xae61('0x50')])){utils[_0xae61('0x6')](util[_0xae61('0x7')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x4a019b[_0xae61('0x9')],!_[_0xae61('0x20')](_0x4a019b[_0xae61('0x45')][_0xae61('0x4f')])?_0xae61('0x4f'):_0xae61('0x50'),_0x4a019b[_0xae61('0x48')]));channels[_0x4a019b['uniqueid']][_0xae61('0x51')]=_0xae61('0x52');channels[_0x4a019b[_0xae61('0x9')]][_0xae61('0x53')]=_0x4a019b[_0xae61('0x48')];channels[_0x4a019b[_0xae61('0x9')]][_0xae61('0xb')]=!![];}if(!_[_0xae61('0x20')](_0x4a019b[_0xae61('0x45')]['xmd-contactid'])){utils[_0xae61('0x6')](util['format'](_0xae61('0x54'),_0x4a019b[_0xae61('0x9')],_0x4a019b['value']));channels[_0x4a019b['uniqueid']]['ContactId']=_0x4a019b[_0xae61('0x48')];}if(!_[_0xae61('0x20')](_0x4a019b[_0xae61('0x45')][_0xae61('0x55')])){utils[_0xae61('0x6')](util[_0xae61('0x7')](_0xae61('0x56'),_0x4a019b[_0xae61('0x9')],_0x4a019b[_0xae61('0x48')]));channels[_0x4a019b[_0xae61('0x9')]][_0xae61('0x57')]=_0x4a019b['value'];}if(!_[_0xae61('0x20')](_0x4a019b['variable'][_0xae61('0x58')])){utils[_0xae61('0x6')](util[_0xae61('0x7')](_0xae61('0x59'),_0x4a019b[_0xae61('0x9')],_0x4a019b[_0xae61('0x48')]));channels[_0x4a019b[_0xae61('0x9')]][_0xae61('0x5a')]=_0x4a019b[_0xae61('0x48')];}if(!_[_0xae61('0x20')](_0x4a019b[_0xae61('0x45')][_0xae61('0x5b')])){utils[_0xae61('0x6')](util['format']('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x4a019b[_0xae61('0x9')],_0x4a019b[_0xae61('0x48')]));channels[_0x4a019b[_0xae61('0x9')]]['sipcallid']=_0x4a019b['value'];}}}catch(_0x2bda06){utils[_0xae61('0x28')](util[_0xae61('0x7')]('[%s][calls][varset]',_0x4a019b[_0xae61('0x9')]),_0x2bda06);}};exports[_0xae61('0x5c')]=function(_0x2be7d8){try{if(!_[_0xae61('0x20')](channels[_0x2be7d8[_0xae61('0x9')]])){utils[_0xae61('0x16')](util[_0xae61('0x7')](_0xae61('0x5d'),_0x2be7d8[_0xae61('0x9')]),_0x2be7d8);utils[_0xae61('0x6')](util['format'](_0xae61('0x5e'),_0x2be7d8[_0xae61('0x9')],_0x2be7d8[_0xae61('0x5f')],_0x2be7d8[_0xae61('0x60')]));if(_0x2be7d8[_0xae61('0x5f')][_0xae61('0x61')]()=='set'&&_[_0xae61('0x62')](_0x2be7d8[_0xae61('0x60')][_0xae61('0x61')](),_0xae61('0x63'))){var _0x43a0fe=_0x2be7d8[_0xae61('0x60')][_0xae61('0x64')]('=');var _0xa7b54c=_0x43a0fe[0x0][_0xae61('0x65')](_0x43a0fe[0x0]['lastIndexOf']('(')+0x1,_0x43a0fe[0x0][_0xae61('0x66')](')'));var _0x4bf0f3=_0x43a0fe[0x1];channels[_0x2be7d8[_0xae61('0x9')]][_0xa7b54c]=_0x4bf0f3;}if(!_['includes']([_0xae61('0x29'),_0xae61('0x67'),'execif','set',_0xae61('0x68')],_0x2be7d8[_0xae61('0x5f')][_0xae61('0x61')]())){channels[_0x2be7d8[_0xae61('0x9')]]['lastapplication']=_0x2be7d8[_0xae61('0x5f')];channels[_0x2be7d8['uniqueid']][_0xae61('0x53')]=_0x2be7d8[_0xae61('0x60')];}}}catch(_0x37cddc){utils[_0xae61('0x28')](util[_0xae61('0x7')](_0xae61('0x5d'),_0x2be7d8[_0xae61('0x9')]),_0x37cddc);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 9f22294..1ffe8ce 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 _0x5c1f=['close','[core]\x20close','managerevent','./utils','info','[core]\x20connected','[core]\x20shutdown','fullybooted','error'];(function(_0x22ffbf,_0x16f31e){var _0x360c17=function(_0x40807f){while(--_0x40807f){_0x22ffbf['push'](_0x22ffbf['shift']());}};_0x360c17(++_0x16f31e);}(_0x5c1f,0x1b3));var _0xf5c1=function(_0x3132e8,_0x499a0e){_0x3132e8=_0x3132e8-0x0;var _0x43eb8c=_0x5c1f[_0x3132e8];return _0x43eb8c;};'use strict';var utils=require(_0xf5c1('0x0'));exports['connect']=function(){utils[_0xf5c1('0x1')](_0xf5c1('0x2'));};exports['shutdown']=function(){utils[_0xf5c1('0x1')](_0xf5c1('0x3'));};exports[_0xf5c1('0x4')]=function(){utils['info']('[core]\x20fullybooted');};exports['error']=function(_0x3c2fbb){utils[_0xf5c1('0x5')]('[core]\x20error',_0x3c2fbb);};exports[_0xf5c1('0x6')]=function(){utils[_0xf5c1('0x1')](_0xf5c1('0x7'));};exports[_0xf5c1('0x8')]=function(_0x5e3ef8){}; \ No newline at end of file +var _0x4ff8=['[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','[core]\x20close','managerevent','./utils','info'];(function(_0x469393,_0x247969){var _0x5f720d=function(_0x40aeb3){while(--_0x40aeb3){_0x469393['push'](_0x469393['shift']());}};_0x5f720d(++_0x247969);}(_0x4ff8,0x15e));var _0x84ff=function(_0x2a858f,_0x3385a0){_0x2a858f=_0x2a858f-0x0;var _0xe9b8ae=_0x4ff8[_0x2a858f];return _0xe9b8ae;};'use strict';var utils=require(_0x84ff('0x0'));exports['connect']=function(){utils[_0x84ff('0x1')](_0x84ff('0x2'));};exports[_0x84ff('0x3')]=function(){utils['info'](_0x84ff('0x4'));};exports[_0x84ff('0x5')]=function(){utils[_0x84ff('0x1')](_0x84ff('0x6'));};exports[_0x84ff('0x7')]=function(_0x233f46){utils[_0x84ff('0x7')](_0x84ff('0x8'),_0x233f46);};exports['close']=function(){utils[_0x84ff('0x1')](_0x84ff('0x9'));};exports[_0x84ff('0xa')]=function(_0xfc2c61){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 3be3bd6..b3361fd 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 _0x8870=['application','appdata','toLowerCase','cdr(routeid)','split','error','varset','isNil','variable','outboundrouteid','value','[%s][dials][varset]','assign','starttime','now','lastevent','called','[%s][dials][dialbegin]','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','complete','duration','endtime','holdtime','diffTime','billableseconds','util','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','debug','uniqueid'];(function(_0x3dae65,_0x4884f){var _0x48a30d=function(_0x981c57){while(--_0x981c57){_0x3dae65['push'](_0x3dae65['shift']());}};_0x48a30d(++_0x4884f);}(_0x8870,0x1b5));var _0x0887=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x8870[_0x5d2803];return _0xdcad2c;};'use strict';var _=require('lodash');var util=require(_0x0887('0x0'));var utils=require('./utils');var dials={};function writeDB(_0x4c0b9c){utils[_0x0887('0x1')](util[_0x0887('0x2')](_0x0887('0x3'),_0x4c0b9c['uniqueid'],_0x4c0b9c['channel'],_0x4c0b9c[_0x0887('0x4')],_0x4c0b9c[_0x0887('0x5')],_0x4c0b9c[_0x0887('0x6')],_0x4c0b9c[_0x0887('0x7')]));utils[_0x0887('0x8')](_0x0887('0x9'),_0x4c0b9c);delete dials[_0x4c0b9c['uniqueid']];}exports[_0x0887('0xa')]=function(_0x16e7a9){try{utils[_0x0887('0xb')](util['format']('[%s][dials][newexten]',_0x16e7a9[_0x0887('0xc')]),_0x16e7a9);utils[_0x0887('0x1')](util['format']('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x16e7a9['uniqueid'],_0x16e7a9[_0x0887('0xd')],_0x16e7a9[_0x0887('0xe')]));if(_0x16e7a9['application']['toLowerCase']()=='set'&&_['startsWith'](_0x16e7a9[_0x0887('0xe')][_0x0887('0xf')](),_0x0887('0x10'))){var _0x1e62ee=_0x16e7a9[_0x0887('0xe')][_0x0887('0x11')]('=');dials[_0x16e7a9[_0x0887('0xc')]]={'routeId':_0x1e62ee[0x1]};}}catch(_0x4a2ff1){utils[_0x0887('0x12')](util['format']('[%s][dials][newexten]',_0x16e7a9[_0x0887('0xc')]),_0x4a2ff1);}};exports[_0x0887('0x13')]=function(_0x4dbd1f){try{utils[_0x0887('0xb')](util[_0x0887('0x2')]('[%s][dials][varset]',_0x4dbd1f['uniqueid']),_0x4dbd1f);if(!_[_0x0887('0x14')](_0x4dbd1f[_0x0887('0x15')][_0x0887('0x16')])){utils[_0x0887('0x1')](util['format']('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x4dbd1f['uniqueid'],_0x4dbd1f[_0x0887('0x17')]));dials[_0x4dbd1f[_0x0887('0xc')]]={'routeId':_0x4dbd1f[_0x0887('0x17')]};}}catch(_0x494521){utils[_0x0887('0x12')](util[_0x0887('0x2')](_0x0887('0x18'),_0x4dbd1f[_0x0887('0xc')]),_0x494521);}};exports['dialbegin']=function(_0x58e559){try{if(!_[_0x0887('0x14')](dials[_0x58e559['uniqueid']])){utils[_0x0887('0xb')](util['format']('[%s][dials][dialbegin]',_0x58e559[_0x0887('0xc')]),_0x58e559);dials[_0x58e559[_0x0887('0xc')]]=_[_0x0887('0x19')](dials[_0x58e559[_0x0887('0xc')]],_0x58e559);dials[_0x58e559[_0x0887('0xc')]][_0x0887('0x1a')]=utils[_0x0887('0x1b')]();dials[_0x58e559[_0x0887('0xc')]][_0x0887('0x1c')]=_0x0887('0x1d');utils['info'](util['format']('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x58e559[_0x0887('0xc')],dials[_0x58e559['uniqueid']][_0x0887('0x1a')]));}}catch(_0x29514f){utils[_0x0887('0x12')](util[_0x0887('0x2')](_0x0887('0x1e'),_0x58e559[_0x0887('0xc')]),_0x29514f);}};exports['dialend']=function(_0xa99880){try{if(!_['isNil'](dials[_0xa99880[_0x0887('0xc')]])){utils[_0x0887('0xb')](util[_0x0887('0x2')]('[%s][dials][dialend]',_0xa99880[_0x0887('0xc')]),_0xa99880);dials[_0xa99880[_0x0887('0xc')]][_0x0887('0x7')]=_0xa99880[_0x0887('0x7')];if(_0xa99880[_0x0887('0x7')]=='ANSWER'){dials[_0xa99880['uniqueid']]=_['assign'](dials[_0xa99880['uniqueid']],_0xa99880);dials[_0xa99880[_0x0887('0xc')]][_0x0887('0x1f')]=utils[_0x0887('0x1b')]();dials[_0xa99880['uniqueid']][_0x0887('0x1c')]=_0x0887('0x20');utils[_0x0887('0x1')](util[_0x0887('0x2')](_0x0887('0x21'),_0xa99880[_0x0887('0xc')],_0xa99880[_0x0887('0x7')],dials[_0xa99880['uniqueid']][_0x0887('0x1f')]));}else{utils[_0x0887('0x1')](util[_0x0887('0x2')](_0x0887('0x22'),_0xa99880[_0x0887('0xc')],_0xa99880['dialstatus']));}}}catch(_0x1b5f33){utils[_0x0887('0x12')](util[_0x0887('0x2')](_0x0887('0x23'),_0xa99880[_0x0887('0xc')]),_0x1b5f33);}};exports[_0x0887('0x24')]=function(_0x776aa1){try{if(!_[_0x0887('0x14')](dials[_0x776aa1[_0x0887('0xc')]])){utils['debug'](util['format'](_0x0887('0x25'),_0x776aa1[_0x0887('0xc')]),_0x776aa1);utils['info'](util[_0x0887('0x2')](_0x0887('0x26'),_0x776aa1[_0x0887('0xc')],_0x776aa1[_0x0887('0x5')],_0x776aa1['calleridname'],_0x776aa1['cause-txt']));dials[_0x776aa1[_0x0887('0xc')]]=_[_0x0887('0x19')](dials[_0x776aa1['uniqueid']],{'endtime':utils['now'](),'lastevent':_0x0887('0x27')});dials[_0x776aa1['uniqueid']][_0x0887('0x28')]=utils['diffTime'](dials[_0x776aa1[_0x0887('0xc')]][_0x0887('0x29')],dials[_0x776aa1[_0x0887('0xc')]][_0x0887('0x1a')]);dials[_0x776aa1['uniqueid']][_0x0887('0x2a')]=utils[_0x0887('0x2b')](dials[_0x776aa1[_0x0887('0xc')]][_0x0887('0x1f')]||dials[_0x776aa1['uniqueid']]['endtime'],dials[_0x776aa1[_0x0887('0xc')]][_0x0887('0x1a')]);dials[_0x776aa1[_0x0887('0xc')]][_0x0887('0x2c')]=dials[_0x776aa1[_0x0887('0xc')]][_0x0887('0x1f')]?utils[_0x0887('0x2b')](dials[_0x776aa1[_0x0887('0xc')]][_0x0887('0x29')],dials[_0x776aa1[_0x0887('0xc')]][_0x0887('0x1f')]):0x0;writeDB(dials[_0x776aa1[_0x0887('0xc')]]);}}catch(_0x4dd651){utils[_0x0887('0x12')](util[_0x0887('0x2')]('[%s][dials][hangup]',_0x776aa1['uniqueid']),_0x4dd651);}}; \ No newline at end of file +var _0x21d5=['endtime','holdtime','billableseconds','lodash','util','./utils','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','connectedlinenum','dialstatus','request','uniqueid','debug','[%s][dials][newexten]','info','appdata','toLowerCase','set','startsWith','cdr(routeid)','split','error','varset','[%s][dials][varset]','isNil','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','lastevent','[%s][dials][dialend]','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridnum','calleridname','cause-txt','complete','duration','diffTime'];(function(_0x4c445a,_0x4ee80f){var _0x2f611c=function(_0x4f3699){while(--_0x4f3699){_0x4c445a['push'](_0x4c445a['shift']());}};_0x2f611c(++_0x4ee80f);}(_0x21d5,0x161));var _0x521d=function(_0x3a4827,_0x8a4407){_0x3a4827=_0x3a4827-0x0;var _0xabf933=_0x21d5[_0x3a4827];return _0xabf933;};'use strict';var _=require(_0x521d('0x0'));var util=require(_0x521d('0x1'));var utils=require(_0x521d('0x2'));var dials={};function writeDB(_0x24bb60){utils['info'](util[_0x521d('0x3')](_0x521d('0x4'),_0x24bb60['uniqueid'],_0x24bb60[_0x521d('0x5')],_0x24bb60['dialstring'],_0x24bb60['calleridnum'],_0x24bb60[_0x521d('0x6')],_0x24bb60[_0x521d('0x7')]));utils[_0x521d('0x8')]('CreateVoiceDialReport',_0x24bb60);delete dials[_0x24bb60[_0x521d('0x9')]];}exports['newexten']=function(_0x46ed91){try{utils[_0x521d('0xa')](util[_0x521d('0x3')](_0x521d('0xb'),_0x46ed91['uniqueid']),_0x46ed91);utils[_0x521d('0xc')](util[_0x521d('0x3')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x46ed91[_0x521d('0x9')],_0x46ed91['application'],_0x46ed91[_0x521d('0xd')]));if(_0x46ed91['application'][_0x521d('0xe')]()==_0x521d('0xf')&&_[_0x521d('0x10')](_0x46ed91[_0x521d('0xd')][_0x521d('0xe')](),_0x521d('0x11'))){var _0x333428=_0x46ed91[_0x521d('0xd')][_0x521d('0x12')]('=');dials[_0x46ed91[_0x521d('0x9')]]={'routeId':_0x333428[0x1]};}}catch(_0x50ee42){utils[_0x521d('0x13')](util[_0x521d('0x3')](_0x521d('0xb'),_0x46ed91[_0x521d('0x9')]),_0x50ee42);}};exports[_0x521d('0x14')]=function(_0x1009fb){try{utils['debug'](util[_0x521d('0x3')](_0x521d('0x15'),_0x1009fb[_0x521d('0x9')]),_0x1009fb);if(!_[_0x521d('0x16')](_0x1009fb['variable'][_0x521d('0x17')])){utils[_0x521d('0xc')](util['format'](_0x521d('0x18'),_0x1009fb[_0x521d('0x9')],_0x1009fb['value']));dials[_0x1009fb['uniqueid']]={'routeId':_0x1009fb[_0x521d('0x19')]};}}catch(_0x1b323a){utils[_0x521d('0x13')](util[_0x521d('0x3')]('[%s][dials][varset]',_0x1009fb[_0x521d('0x9')]),_0x1b323a);}};exports[_0x521d('0x1a')]=function(_0x3b251d){try{if(!_[_0x521d('0x16')](dials[_0x3b251d['uniqueid']])){utils['debug'](util['format'](_0x521d('0x1b'),_0x3b251d[_0x521d('0x9')]),_0x3b251d);dials[_0x3b251d[_0x521d('0x9')]]=_[_0x521d('0x1c')](dials[_0x3b251d[_0x521d('0x9')]],_0x3b251d);dials[_0x3b251d[_0x521d('0x9')]][_0x521d('0x1d')]=utils[_0x521d('0x1e')]();dials[_0x3b251d[_0x521d('0x9')]][_0x521d('0x1f')]='called';utils[_0x521d('0xc')](util[_0x521d('0x3')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x3b251d[_0x521d('0x9')],dials[_0x3b251d['uniqueid']]['starttime']));}}catch(_0x405bf1){utils[_0x521d('0x13')](util[_0x521d('0x3')]('[%s][dials][dialbegin]',_0x3b251d['uniqueid']),_0x405bf1);}};exports['dialend']=function(_0x534f8b){try{if(!_['isNil'](dials[_0x534f8b[_0x521d('0x9')]])){utils[_0x521d('0xa')](util['format'](_0x521d('0x20'),_0x534f8b[_0x521d('0x9')]),_0x534f8b);dials[_0x534f8b[_0x521d('0x9')]][_0x521d('0x7')]=_0x534f8b[_0x521d('0x7')];if(_0x534f8b[_0x521d('0x7')]==_0x521d('0x21')){dials[_0x534f8b[_0x521d('0x9')]]=_[_0x521d('0x1c')](dials[_0x534f8b[_0x521d('0x9')]],_0x534f8b);dials[_0x534f8b[_0x521d('0x9')]][_0x521d('0x22')]=utils[_0x521d('0x1e')]();dials[_0x534f8b[_0x521d('0x9')]][_0x521d('0x1f')]=_0x521d('0x23');utils['info'](util[_0x521d('0x3')](_0x521d('0x24'),_0x534f8b[_0x521d('0x9')],_0x534f8b[_0x521d('0x7')],dials[_0x534f8b[_0x521d('0x9')]][_0x521d('0x22')]));}else{utils[_0x521d('0xc')](util[_0x521d('0x3')](_0x521d('0x25'),_0x534f8b[_0x521d('0x9')],_0x534f8b[_0x521d('0x7')]));}}}catch(_0x3ec5a7){utils[_0x521d('0x13')](util[_0x521d('0x3')](_0x521d('0x20'),_0x534f8b[_0x521d('0x9')]),_0x3ec5a7);}};exports[_0x521d('0x26')]=function(_0x2290db){try{if(!_[_0x521d('0x16')](dials[_0x2290db[_0x521d('0x9')]])){utils[_0x521d('0xa')](util[_0x521d('0x3')](_0x521d('0x27'),_0x2290db[_0x521d('0x9')]),_0x2290db);utils[_0x521d('0xc')](util[_0x521d('0x3')](_0x521d('0x28'),_0x2290db[_0x521d('0x9')],_0x2290db[_0x521d('0x29')],_0x2290db[_0x521d('0x2a')],_0x2290db[_0x521d('0x2b')]));dials[_0x2290db[_0x521d('0x9')]]=_[_0x521d('0x1c')](dials[_0x2290db[_0x521d('0x9')]],{'endtime':utils['now'](),'lastevent':_0x521d('0x2c')});dials[_0x2290db[_0x521d('0x9')]][_0x521d('0x2d')]=utils[_0x521d('0x2e')](dials[_0x2290db[_0x521d('0x9')]][_0x521d('0x2f')],dials[_0x2290db[_0x521d('0x9')]][_0x521d('0x1d')]);dials[_0x2290db[_0x521d('0x9')]][_0x521d('0x30')]=utils[_0x521d('0x2e')](dials[_0x2290db[_0x521d('0x9')]][_0x521d('0x22')]||dials[_0x2290db[_0x521d('0x9')]][_0x521d('0x2f')],dials[_0x2290db[_0x521d('0x9')]][_0x521d('0x1d')]);dials[_0x2290db[_0x521d('0x9')]][_0x521d('0x31')]=dials[_0x2290db[_0x521d('0x9')]][_0x521d('0x22')]?utils[_0x521d('0x2e')](dials[_0x2290db[_0x521d('0x9')]][_0x521d('0x2f')],dials[_0x2290db[_0x521d('0x9')]][_0x521d('0x22')]):0x0;writeDB(dials[_0x2290db[_0x521d('0x9')]]);}}catch(_0x5b970d){utils[_0x521d('0x13')](util[_0x521d('0x3')]('[%s][dials][hangup]',_0x2290db[_0x521d('0x9')]),_0x5b970d);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 0e3bdde..69662c2 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 _0xc8e8=['fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','[%s][index][agentcalled]','uniqueid','agentcalled','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','[%s][index][attendedtransfer]','origtransfereruniqueid','attendedtransfer','varset','[%s][index][varset]','newexten','[%s][index][newchannel]','newchannel','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','xdr','env','production','local','asterisk','username','password','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./recordings.controller','./members.controller','./dials.controller','./core.controller','connect','shutdown'];(function(_0x522fd0,_0x1ee9b2){var _0x2fdb61=function(_0x4f7408){while(--_0x4f7408){_0x522fd0['push'](_0x522fd0['shift']());}};_0x2fdb61(++_0x1ee9b2);}(_0xc8e8,0x187));var _0x8c8e=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0xc8e8[_0x51c819];return _0x15c5d2;};var AsteriskManager=require(_0x8c8e('0x0'));var config=require(_0x8c8e('0x1'));var utils=require(_0x8c8e('0x2'));var util=require(_0x8c8e('0x3'));var isXDREnabled=config[_0x8c8e('0x4')]&&config[_0x8c8e('0x4')]['disabled']?!config[_0x8c8e('0x4')]['disabled']:!![];var isProduction=config[_0x8c8e('0x5')]===_0x8c8e('0x6')||![];var isLocalAsterisk=config['xdr']&&config[_0x8c8e('0x4')][_0x8c8e('0x7')]===!![]||![];var ami=new AsteriskManager(config[_0x8c8e('0x8')]['port'],config['asterisk']['ip'],config[_0x8c8e('0x8')][_0x8c8e('0x9')],config[_0x8c8e('0x8')][_0x8c8e('0xa')],!![]);ami[_0x8c8e('0xb')]();if(!isXDREnabled){utils[_0x8c8e('0xc')](_0x8c8e('0xd'));}else if(!isProduction&&!isLocalAsterisk){utils['info'](_0x8c8e('0xe'));}else{var agents=require(_0x8c8e('0xf'));var calls=require(_0x8c8e('0x10'));var queues=require('./queues.controller');var recordings=require(_0x8c8e('0x11'));var members=require(_0x8c8e('0x12'));var dials=require(_0x8c8e('0x13'));var transfers=require('./transfers.controller');var core=require(_0x8c8e('0x14'));ami['on']('connect',core[_0x8c8e('0x15')]);ami['on']('shutdown',core[_0x8c8e('0x16')]);ami['on'](_0x8c8e('0x17'),core[_0x8c8e('0x17')]);ami['on'](_0x8c8e('0x18'),core[_0x8c8e('0x18')]);ami['on']('close',core[_0x8c8e('0x19')]);ami['on'](_0x8c8e('0x1a'),core['managerevent']);ami['on'](_0x8c8e('0x1b'),function(_0x36822c){try{utils[_0x8c8e('0x1c')](util[_0x8c8e('0x1d')](_0x8c8e('0x1e'),_0x36822c[_0x8c8e('0x1f')]),_0x36822c);members['devicestatechange'](_0x36822c);}catch(_0x2d7e8b){utils[_0x8c8e('0x18')](util['format'](_0x8c8e('0x1e'),_0x36822c[_0x8c8e('0x1f')]),_0x2d7e8b);}});ami['on']('agentcalled',function(_0x41f257){try{utils[_0x8c8e('0x1c')](util[_0x8c8e('0x1d')](_0x8c8e('0x20'),_0x41f257[_0x8c8e('0x21')]),_0x41f257);agents[_0x8c8e('0x22')](_0x41f257);}catch(_0x169934){utils[_0x8c8e('0x18')](util[_0x8c8e('0x1d')]('[%s][index][agentcalled]',_0x41f257['uniqueid']),_0x169934);}});ami['on'](_0x8c8e('0x23'),function(_0x4dd3a1){try{utils[_0x8c8e('0x1c')](util[_0x8c8e('0x1d')]('[%s][index][agentringnoanswer]',_0x4dd3a1[_0x8c8e('0x21')]),_0x4dd3a1);agents[_0x8c8e('0x23')](_0x4dd3a1);}catch(_0x9bf917){utils[_0x8c8e('0x18')](util[_0x8c8e('0x1d')](_0x8c8e('0x24'),_0x4dd3a1[_0x8c8e('0x21')]),_0x9bf917);}});ami['on'](_0x8c8e('0x25'),function(_0x59324b){try{utils[_0x8c8e('0x1c')](util[_0x8c8e('0x1d')](_0x8c8e('0x26'),_0x59324b[_0x8c8e('0x21')]),_0x59324b);agents[_0x8c8e('0x25')](_0x59324b);queues[_0x8c8e('0x25')](_0x59324b);}catch(_0x397dd4){utils[_0x8c8e('0x18')](util['format'](_0x8c8e('0x26'),_0x59324b[_0x8c8e('0x21')]),_0x397dd4);}});ami['on']('agentcomplete',function(_0x44e665){try{utils[_0x8c8e('0x1c')](util[_0x8c8e('0x1d')](_0x8c8e('0x27'),_0x44e665[_0x8c8e('0x21')]),_0x44e665);agents[_0x8c8e('0x28')](_0x44e665);queues['agentcomplete'](_0x44e665);members[_0x8c8e('0x28')](_0x44e665);}catch(_0x36313d){utils[_0x8c8e('0x18')](util[_0x8c8e('0x1d')]('[%s][index][agentcomplete]',_0x44e665['uniqueid']),_0x36313d);}});ami['on'](_0x8c8e('0x29'),function(_0x23411f){try{utils[_0x8c8e('0x1c')](util[_0x8c8e('0x1d')]('[%s][index][queuecallerabandon]',_0x23411f[_0x8c8e('0x21')]),_0x23411f);agents[_0x8c8e('0x29')](_0x23411f);queues[_0x8c8e('0x29')](_0x23411f);}catch(_0x2a7e03){utils[_0x8c8e('0x18')](util['format']('[%s][index][queuecallerabandon]',_0x23411f[_0x8c8e('0x21')]),_0x2a7e03);}});ami['on'](_0x8c8e('0x2a'),function(_0x31bbaf){try{utils[_0x8c8e('0x1c')](util[_0x8c8e('0x1d')]('[%s][index][queuecallerjoin]',_0x31bbaf['uniqueid']),_0x31bbaf);queues[_0x8c8e('0x2a')](_0x31bbaf);recordings['queuecallerjoin'](_0x31bbaf);}catch(_0x5ce773){utils[_0x8c8e('0x18')](util[_0x8c8e('0x1d')](_0x8c8e('0x2b'),_0x31bbaf[_0x8c8e('0x21')]),_0x5ce773);}});ami['on'](_0x8c8e('0x2c'),function(_0x1001c5){try{utils[_0x8c8e('0x1c')](util[_0x8c8e('0x1d')]('[%s][index][queuecallerleave]',_0x1001c5['uniqueid']),_0x1001c5);queues[_0x8c8e('0x2c')](_0x1001c5);}catch(_0x1a3040){utils[_0x8c8e('0x18')](util['format'](_0x8c8e('0x2d'),_0x1001c5[_0x8c8e('0x21')]),_0x1a3040);}});ami['on'](_0x8c8e('0x2e'),function(_0x1f80c9){try{utils[_0x8c8e('0x1c')](util[_0x8c8e('0x1d')](_0x8c8e('0x2f'),_0x1f80c9['uniqueid']),_0x1f80c9);queues[_0x8c8e('0x2e')](_0x1f80c9);calls[_0x8c8e('0x2e')](_0x1f80c9);}catch(_0x49fb53){utils['error'](util['format']('[%s][index][musiconholdstart]',_0x1f80c9[_0x8c8e('0x21')]),_0x49fb53);}});ami['on'](_0x8c8e('0x30'),function(_0x44bd3a){try{utils[_0x8c8e('0x1c')](util['format'](_0x8c8e('0x31'),_0x44bd3a[_0x8c8e('0x21')]),_0x44bd3a);queues[_0x8c8e('0x30')](_0x44bd3a);calls[_0x8c8e('0x30')](_0x44bd3a);}catch(_0xa2d648){utils[_0x8c8e('0x18')](util[_0x8c8e('0x1d')]('[%s][index][musiconholdstop]',_0x44bd3a[_0x8c8e('0x21')]),_0xa2d648);}});ami['on']('newstate',function(_0x40bc60){try{utils[_0x8c8e('0x1c')](util[_0x8c8e('0x1d')]('[%s][index][newstate]',_0x40bc60[_0x8c8e('0x21')]),_0x40bc60);calls[_0x8c8e('0x32')](_0x40bc60);recordings['newstate'](_0x40bc60);}catch(_0x152d19){utils[_0x8c8e('0x18')](util[_0x8c8e('0x1d')](_0x8c8e('0x33'),_0x40bc60['uniqueid']),_0x152d19);}});ami['on'](_0x8c8e('0x34'),function(_0x136259){try{utils['debug'](util['format'](_0x8c8e('0x35'),_0x136259[_0x8c8e('0x21')]),_0x136259);calls[_0x8c8e('0x34')](_0x136259);recordings[_0x8c8e('0x34')](_0x136259);dials[_0x8c8e('0x34')](_0x136259);agents['hangup'](_0x136259);queues[_0x8c8e('0x34')](_0x136259);}catch(_0x5d0664){utils['error'](util[_0x8c8e('0x1d')](_0x8c8e('0x35'),_0x136259[_0x8c8e('0x21')]),_0x5d0664);}});ami['on']('cdr',function(_0x5443c4){try{utils[_0x8c8e('0x1c')](util[_0x8c8e('0x1d')](_0x8c8e('0x36'),_0x5443c4[_0x8c8e('0x21')]),_0x5443c4);members['cdr'](_0x5443c4);}catch(_0xaca2eb){utils[_0x8c8e('0x18')](util[_0x8c8e('0x1d')](_0x8c8e('0x36'),_0x5443c4['uniqueid']),_0xaca2eb);}});ami['on'](_0x8c8e('0x37'),function(_0x2219e3){try{utils[_0x8c8e('0x1c')](util[_0x8c8e('0x1d')](_0x8c8e('0x38'),_0x2219e3[_0x8c8e('0x21')]),_0x2219e3);queues[_0x8c8e('0x37')](_0x2219e3);agents[_0x8c8e('0x37')](_0x2219e3);transfers[_0x8c8e('0x37')](_0x2219e3);}catch(_0x327f87){utils['error'](util[_0x8c8e('0x1d')](_0x8c8e('0x38'),_0x2219e3['uniqueid']),_0x327f87);}});ami['on']('attendedtransfer',function(_0x441d17){try{utils['debug'](util[_0x8c8e('0x1d')](_0x8c8e('0x39'),_0x441d17[_0x8c8e('0x3a')]),_0x441d17);queues[_0x8c8e('0x3b')](_0x441d17);transfers['attendedtransfer'](_0x441d17);agents[_0x8c8e('0x3b')](_0x441d17);calls[_0x8c8e('0x3b')](_0x441d17);}catch(_0x910d6f){utils['error'](util[_0x8c8e('0x1d')](_0x8c8e('0x39'),_0x441d17[_0x8c8e('0x3a')]),_0x910d6f);}});ami['on'](_0x8c8e('0x3c'),function(_0xaa4363){try{utils[_0x8c8e('0x1c')](util['format']('[%s][index][varset]',_0xaa4363[_0x8c8e('0x21')]),_0xaa4363);queues[_0x8c8e('0x3c')](_0xaa4363);recordings[_0x8c8e('0x3c')](_0xaa4363);calls['varset'](_0xaa4363);dials[_0x8c8e('0x3c')](_0xaa4363);}catch(_0x31bc5f){utils[_0x8c8e('0x18')](util[_0x8c8e('0x1d')](_0x8c8e('0x3d'),_0xaa4363['uniqueid']),_0x31bc5f);}});ami['on'](_0x8c8e('0x3e'),function(_0x362fb8){try{utils[_0x8c8e('0x1c')](util[_0x8c8e('0x1d')]('[%s][index][newexten]',_0x362fb8['uniqueid']),_0x362fb8);calls['newexten'](_0x362fb8);recordings['newexten'](_0x362fb8);dials['newexten'](_0x362fb8);}catch(_0xdca7c7){utils[_0x8c8e('0x18')](util['format']('[%s][index][newexten]',_0x362fb8[_0x8c8e('0x21')]),_0xdca7c7);}});ami['on']('newchannel',function(_0xa42a5d){try{utils['debug'](util['format'](_0x8c8e('0x3f'),_0xa42a5d['uniqueid']),_0xa42a5d);calls[_0x8c8e('0x40')](_0xa42a5d);recordings[_0x8c8e('0x40')](_0xa42a5d);}catch(_0x4e776b){utils['error'](util[_0x8c8e('0x1d')](_0x8c8e('0x3f'),_0xa42a5d['uniqueid']),_0x4e776b);}});ami['on']('dialbegin',function(_0x5f10ba){try{utils[_0x8c8e('0x1c')](util[_0x8c8e('0x1d')]('[%s][index][dialbegin]',_0x5f10ba[_0x8c8e('0x21')]),_0x5f10ba);dials[_0x8c8e('0x41')](_0x5f10ba);}catch(_0x566f2f){utils['error'](util['format'](_0x8c8e('0x42'),_0x5f10ba[_0x8c8e('0x21')]),_0x566f2f);}});ami['on'](_0x8c8e('0x43'),function(_0xce4259){try{utils[_0x8c8e('0x1c')](util[_0x8c8e('0x1d')](_0x8c8e('0x44'),_0xce4259[_0x8c8e('0x21')]),_0xce4259);dials[_0x8c8e('0x43')](_0xce4259);}catch(_0x12e0c8){utils[_0x8c8e('0x18')](util[_0x8c8e('0x1d')]('[%s][index][dialend]',_0xce4259[_0x8c8e('0x21')]),_0x12e0c8);}});} \ No newline at end of file +var _0x03af=['info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./calls.controller','./queues.controller','./recordings.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','device','[%s][index][devicestatechange]','uniqueid','[%s][index][agentcalled]','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','origtransfereruniqueid','[%s][index][varset]','varset','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','xdr','disabled','production','asterisk','username','password'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x03af,0xbf));var _0xf03a=function(_0x409d5f,_0x49f44d){_0x409d5f=_0x409d5f-0x0;var _0x100008=_0x03af[_0x409d5f];return _0x100008;};var AsteriskManager=require(_0xf03a('0x0'));var config=require(_0xf03a('0x1'));var utils=require(_0xf03a('0x2'));var util=require(_0xf03a('0x3'));var isXDREnabled=config[_0xf03a('0x4')]&&config['xdr']['disabled']?!config[_0xf03a('0x4')][_0xf03a('0x5')]:!![];var isProduction=config['env']===_0xf03a('0x6')||![];var isLocalAsterisk=config[_0xf03a('0x4')]&&config[_0xf03a('0x4')]['local']===!![]||![];var ami=new AsteriskManager(config['asterisk']['port'],config['asterisk']['ip'],config[_0xf03a('0x7')][_0xf03a('0x8')],config['asterisk'][_0xf03a('0x9')],!![]);ami['keepConnected']();if(!isXDREnabled){utils[_0xf03a('0xa')](_0xf03a('0xb'));}else if(!isProduction&&!isLocalAsterisk){utils['info'](_0xf03a('0xc'));}else{var agents=require('./agents.controller');var calls=require(_0xf03a('0xd'));var queues=require(_0xf03a('0xe'));var recordings=require(_0xf03a('0xf'));var members=require('./members.controller');var dials=require(_0xf03a('0x10'));var transfers=require(_0xf03a('0x11'));var core=require(_0xf03a('0x12'));ami['on'](_0xf03a('0x13'),core[_0xf03a('0x13')]);ami['on'](_0xf03a('0x14'),core[_0xf03a('0x14')]);ami['on'](_0xf03a('0x15'),core['fullybooted']);ami['on'](_0xf03a('0x16'),core['error']);ami['on']('close',core[_0xf03a('0x17')]);ami['on']('managerevent',core[_0xf03a('0x18')]);ami['on'](_0xf03a('0x19'),function(_0x1b55ce){try{utils[_0xf03a('0x1a')](util[_0xf03a('0x1b')]('[%s][index][devicestatechange]',_0x1b55ce[_0xf03a('0x1c')]),_0x1b55ce);members[_0xf03a('0x19')](_0x1b55ce);}catch(_0x49daea){utils['error'](util['format'](_0xf03a('0x1d'),_0x1b55ce[_0xf03a('0x1c')]),_0x49daea);}});ami['on']('agentcalled',function(_0x8e2c59){try{utils[_0xf03a('0x1a')](util[_0xf03a('0x1b')]('[%s][index][agentcalled]',_0x8e2c59[_0xf03a('0x1e')]),_0x8e2c59);agents['agentcalled'](_0x8e2c59);}catch(_0x38faea){utils[_0xf03a('0x16')](util[_0xf03a('0x1b')](_0xf03a('0x1f'),_0x8e2c59[_0xf03a('0x1e')]),_0x38faea);}});ami['on'](_0xf03a('0x20'),function(_0x12fd4c){try{utils[_0xf03a('0x1a')](util[_0xf03a('0x1b')]('[%s][index][agentringnoanswer]',_0x12fd4c[_0xf03a('0x1e')]),_0x12fd4c);agents[_0xf03a('0x20')](_0x12fd4c);}catch(_0x4ac52d){utils[_0xf03a('0x16')](util['format'](_0xf03a('0x21'),_0x12fd4c[_0xf03a('0x1e')]),_0x4ac52d);}});ami['on'](_0xf03a('0x22'),function(_0x6ef619){try{utils[_0xf03a('0x1a')](util['format'](_0xf03a('0x23'),_0x6ef619['uniqueid']),_0x6ef619);agents['agentconnect'](_0x6ef619);queues['agentconnect'](_0x6ef619);}catch(_0x280e3e){utils[_0xf03a('0x16')](util[_0xf03a('0x1b')](_0xf03a('0x23'),_0x6ef619[_0xf03a('0x1e')]),_0x280e3e);}});ami['on'](_0xf03a('0x24'),function(_0x132609){try{utils[_0xf03a('0x1a')](util['format']('[%s][index][agentcomplete]',_0x132609[_0xf03a('0x1e')]),_0x132609);agents[_0xf03a('0x24')](_0x132609);queues[_0xf03a('0x24')](_0x132609);members[_0xf03a('0x24')](_0x132609);}catch(_0x1ca279){utils[_0xf03a('0x16')](util[_0xf03a('0x1b')](_0xf03a('0x25'),_0x132609[_0xf03a('0x1e')]),_0x1ca279);}});ami['on'](_0xf03a('0x26'),function(_0x428c77){try{utils[_0xf03a('0x1a')](util[_0xf03a('0x1b')](_0xf03a('0x27'),_0x428c77[_0xf03a('0x1e')]),_0x428c77);agents[_0xf03a('0x26')](_0x428c77);queues[_0xf03a('0x26')](_0x428c77);}catch(_0x423c6c){utils[_0xf03a('0x16')](util[_0xf03a('0x1b')](_0xf03a('0x27'),_0x428c77[_0xf03a('0x1e')]),_0x423c6c);}});ami['on'](_0xf03a('0x28'),function(_0x1a1f23){try{utils[_0xf03a('0x1a')](util['format']('[%s][index][queuecallerjoin]',_0x1a1f23[_0xf03a('0x1e')]),_0x1a1f23);queues[_0xf03a('0x28')](_0x1a1f23);recordings['queuecallerjoin'](_0x1a1f23);}catch(_0x1d33cc){utils[_0xf03a('0x16')](util[_0xf03a('0x1b')]('[%s][index][queuecallerjoin]',_0x1a1f23[_0xf03a('0x1e')]),_0x1d33cc);}});ami['on'](_0xf03a('0x29'),function(_0x253e77){try{utils[_0xf03a('0x1a')](util[_0xf03a('0x1b')](_0xf03a('0x2a'),_0x253e77[_0xf03a('0x1e')]),_0x253e77);queues[_0xf03a('0x29')](_0x253e77);}catch(_0x36e812){utils[_0xf03a('0x16')](util[_0xf03a('0x1b')](_0xf03a('0x2a'),_0x253e77[_0xf03a('0x1e')]),_0x36e812);}});ami['on'](_0xf03a('0x2b'),function(_0x5d9102){try{utils[_0xf03a('0x1a')](util['format'](_0xf03a('0x2c'),_0x5d9102[_0xf03a('0x1e')]),_0x5d9102);queues[_0xf03a('0x2b')](_0x5d9102);calls[_0xf03a('0x2b')](_0x5d9102);}catch(_0x594d1d){utils[_0xf03a('0x16')](util[_0xf03a('0x1b')](_0xf03a('0x2c'),_0x5d9102[_0xf03a('0x1e')]),_0x594d1d);}});ami['on'](_0xf03a('0x2d'),function(_0x41fe8e){try{utils[_0xf03a('0x1a')](util[_0xf03a('0x1b')](_0xf03a('0x2e'),_0x41fe8e[_0xf03a('0x1e')]),_0x41fe8e);queues[_0xf03a('0x2d')](_0x41fe8e);calls[_0xf03a('0x2d')](_0x41fe8e);}catch(_0x47d311){utils['error'](util[_0xf03a('0x1b')](_0xf03a('0x2e'),_0x41fe8e[_0xf03a('0x1e')]),_0x47d311);}});ami['on'](_0xf03a('0x2f'),function(_0x5d6fe0){try{utils[_0xf03a('0x1a')](util[_0xf03a('0x1b')](_0xf03a('0x30'),_0x5d6fe0[_0xf03a('0x1e')]),_0x5d6fe0);calls['newstate'](_0x5d6fe0);recordings[_0xf03a('0x2f')](_0x5d6fe0);}catch(_0x19fd0c){utils[_0xf03a('0x16')](util[_0xf03a('0x1b')]('[%s][index][newstate]',_0x5d6fe0[_0xf03a('0x1e')]),_0x19fd0c);}});ami['on'](_0xf03a('0x31'),function(_0x196afb){try{utils[_0xf03a('0x1a')](util['format'](_0xf03a('0x32'),_0x196afb['uniqueid']),_0x196afb);calls[_0xf03a('0x31')](_0x196afb);recordings[_0xf03a('0x31')](_0x196afb);dials['hangup'](_0x196afb);agents[_0xf03a('0x31')](_0x196afb);queues[_0xf03a('0x31')](_0x196afb);}catch(_0x1d32a8){utils['error'](util[_0xf03a('0x1b')](_0xf03a('0x32'),_0x196afb[_0xf03a('0x1e')]),_0x1d32a8);}});ami['on'](_0xf03a('0x33'),function(_0x362d0c){try{utils[_0xf03a('0x1a')](util['format']('[%s][index][cdr]',_0x362d0c['uniqueid']),_0x362d0c);members['cdr'](_0x362d0c);}catch(_0x37134b){utils[_0xf03a('0x16')](util[_0xf03a('0x1b')](_0xf03a('0x34'),_0x362d0c[_0xf03a('0x1e')]),_0x37134b);}});ami['on']('blindtransfer',function(_0x2daef4){try{utils[_0xf03a('0x1a')](util[_0xf03a('0x1b')](_0xf03a('0x35'),_0x2daef4[_0xf03a('0x1e')]),_0x2daef4);queues[_0xf03a('0x36')](_0x2daef4);agents[_0xf03a('0x36')](_0x2daef4);transfers['blindtransfer'](_0x2daef4);}catch(_0x32ce3d){utils[_0xf03a('0x16')](util[_0xf03a('0x1b')](_0xf03a('0x35'),_0x2daef4[_0xf03a('0x1e')]),_0x32ce3d);}});ami['on'](_0xf03a('0x37'),function(_0x2dadb4){try{utils[_0xf03a('0x1a')](util['format']('[%s][index][attendedtransfer]',_0x2dadb4['origtransfereruniqueid']),_0x2dadb4);queues[_0xf03a('0x37')](_0x2dadb4);transfers[_0xf03a('0x37')](_0x2dadb4);agents['attendedtransfer'](_0x2dadb4);calls[_0xf03a('0x37')](_0x2dadb4);}catch(_0x49c0ae){utils[_0xf03a('0x16')](util[_0xf03a('0x1b')]('[%s][index][attendedtransfer]',_0x2dadb4[_0xf03a('0x38')]),_0x49c0ae);}});ami['on']('varset',function(_0x345477){try{utils[_0xf03a('0x1a')](util[_0xf03a('0x1b')](_0xf03a('0x39'),_0x345477[_0xf03a('0x1e')]),_0x345477);queues[_0xf03a('0x3a')](_0x345477);recordings[_0xf03a('0x3a')](_0x345477);calls[_0xf03a('0x3a')](_0x345477);dials[_0xf03a('0x3a')](_0x345477);}catch(_0x22ff64){utils['error'](util[_0xf03a('0x1b')](_0xf03a('0x39'),_0x345477['uniqueid']),_0x22ff64);}});ami['on'](_0xf03a('0x3b'),function(_0x3c334f){try{utils['debug'](util[_0xf03a('0x1b')](_0xf03a('0x3c'),_0x3c334f[_0xf03a('0x1e')]),_0x3c334f);calls[_0xf03a('0x3b')](_0x3c334f);recordings[_0xf03a('0x3b')](_0x3c334f);dials[_0xf03a('0x3b')](_0x3c334f);}catch(_0x3aa802){utils['error'](util[_0xf03a('0x1b')](_0xf03a('0x3c'),_0x3c334f[_0xf03a('0x1e')]),_0x3aa802);}});ami['on'](_0xf03a('0x3d'),function(_0x197254){try{utils[_0xf03a('0x1a')](util[_0xf03a('0x1b')]('[%s][index][newchannel]',_0x197254[_0xf03a('0x1e')]),_0x197254);calls[_0xf03a('0x3d')](_0x197254);recordings[_0xf03a('0x3d')](_0x197254);}catch(_0x546732){utils['error'](util[_0xf03a('0x1b')](_0xf03a('0x3e'),_0x197254[_0xf03a('0x1e')]),_0x546732);}});ami['on'](_0xf03a('0x3f'),function(_0x4e7f62){try{utils[_0xf03a('0x1a')](util[_0xf03a('0x1b')](_0xf03a('0x40'),_0x4e7f62[_0xf03a('0x1e')]),_0x4e7f62);dials['dialbegin'](_0x4e7f62);}catch(_0x4756bb){utils[_0xf03a('0x16')](util[_0xf03a('0x1b')]('[%s]dialbegin',_0x4e7f62[_0xf03a('0x1e')]),_0x4756bb);}});ami['on'](_0xf03a('0x41'),function(_0x493406){try{utils[_0xf03a('0x1a')](util[_0xf03a('0x1b')](_0xf03a('0x42'),_0x493406[_0xf03a('0x1e')]),_0x493406);dials[_0xf03a('0x41')](_0x493406);}catch(_0x5ea994){utils[_0xf03a('0x16')](util['format'](_0xf03a('0x42'),_0x493406[_0xf03a('0x1e')]),_0x5ea994);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 1cb86d5..90343a6 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 _0x0e9f=['device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','isNil','exitAt','duration','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','[%s][members][cdr]','data1','source','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','data3','util','./utils','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','membername','type','then','name','internal','request','getUserByName','split','catch','error','some','debug','[%s][members][devicestatechange]'];(function(_0x42524a,_0x408052){var _0x519f8b=function(_0x40adbb){while(--_0x40adbb){_0x42524a['push'](_0x42524a['shift']());}};_0x519f8b(++_0x408052);}(_0x0e9f,0x7a));var _0xf0e9=function(_0x49ffdf,_0x340e42){_0x49ffdf=_0x49ffdf-0x0;var _0x5b425d=_0x0e9f[_0x49ffdf];return _0x5b425d;};'use strict';var _=require('lodash');var util=require(_0xf0e9('0x0'));var utils=require(_0xf0e9('0x1'));var members={};var exclude=['Local/_attended@transfer','Queue:'];function writeDB(_0x53b610){utils[_0xf0e9('0x2')](util[_0xf0e9('0x3')](_0xf0e9('0x4'),_0x53b610[_0xf0e9('0x5')],_0x53b610[_0xf0e9('0x6')],_0x53b610[_0xf0e9('0x7')],_0x53b610[_0xf0e9('0x8')],_0x53b610[_0xf0e9('0x9')],_0x53b610[_0xf0e9('0xa')]));if(_0x53b610['interface']){utils['getUserByInterface'](_0x53b610[_0xf0e9('0x6')])[_0xf0e9('0xb')](function(_0x317d9b){if(_0x317d9b){_0x53b610['membername']=_0x317d9b[_0xf0e9('0xc')];_0x53b610[_0xf0e9('0xd')]=_0x317d9b['internal'];utils[_0xf0e9('0xe')]('CreateMemberReport',_0x53b610);}else{utils[_0xf0e9('0xf')](_0x53b610['interface'][_0xf0e9('0x10')]('/')[0x1])[_0xf0e9('0xb')](function(_0x4980a7){if(_0x4980a7){_0x53b610[_0xf0e9('0x9')]=_0x4980a7[_0xf0e9('0xc')];_0x53b610['internal']=_0x4980a7['internal'];utils['request']('CreateMemberReport',_0x53b610);}});}})[_0xf0e9('0x11')](function(_0xfb2288){utils[_0xf0e9('0x12')](util[_0xf0e9('0x3')]('[%s][members][writeDB]',_0x53b610[_0xf0e9('0x5')]),_0xfb2288);});}delete members[_0x53b610[_0xf0e9('0x6')]];}function startsWith(_0x4a5c05,_0x3c8d48){return _[_0xf0e9('0x13')](_0x4a5c05,function(_0x31e6dd){return _['startsWith'](_0x3c8d48,_0x31e6dd);});}exports['devicestatechange']=function(_0xf409e3){try{utils[_0xf0e9('0x14')](util[_0xf0e9('0x3')](_0xf0e9('0x15'),members[_0xf409e3[_0xf0e9('0x16')]]?members[_0xf409e3[_0xf0e9('0x16')]][_0xf0e9('0x5')]:_0xf409e3[_0xf0e9('0x16')]),_0xf409e3);utils[_0xf0e9('0x2')](util[_0xf0e9('0x3')](_0xf0e9('0x17'),members[_0xf409e3[_0xf0e9('0x16')]]?members[_0xf409e3[_0xf0e9('0x16')]][_0xf0e9('0x5')]:_0xf409e3[_0xf0e9('0x16')],_0xf409e3[_0xf0e9('0x18')],_0xf409e3['device']));switch(_0xf409e3['state']){case _0xf0e9('0x19'):case _0xf0e9('0x1a'):if(!startsWith(exclude,_0xf409e3['device'])){members[_0xf409e3['device']]={'channel':_0xf0e9('0x1b'),'interface':_0xf409e3[_0xf0e9('0x16')],'type':_0xf0e9('0x1c'),'enterAt':utils[_0xf0e9('0x1d')](),'role':'agent'};}break;case'NOT_INUSE':if(!_[_0xf0e9('0x1e')](members[_0xf409e3[_0xf0e9('0x16')]])){members[_0xf409e3['device']][_0xf0e9('0x1f')]=utils['now']();members[_0xf409e3[_0xf0e9('0x16')]][_0xf0e9('0x20')]=utils[_0xf0e9('0x21')](members[_0xf409e3[_0xf0e9('0x16')]][_0xf0e9('0x1f')],members[_0xf409e3[_0xf0e9('0x16')]][_0xf0e9('0x22')]);if(members[_0xf409e3[_0xf0e9('0x16')]][_0xf0e9('0x5')]){writeDB(members[_0xf409e3[_0xf0e9('0x16')]]);}}break;default:break;}}catch(_0x4374b6){utils['error'](util[_0xf0e9('0x3')]('[%s][members][devicestatechange]',members[_0xf409e3[_0xf0e9('0x16')]]?members[_0xf409e3[_0xf0e9('0x16')]][_0xf0e9('0x5')]:_0xf409e3[_0xf0e9('0x16')]),_0x4374b6);}};exports[_0xf0e9('0x23')]=function(_0x16f7e2){try{if(!_[_0xf0e9('0x1e')](members[_0x16f7e2[_0xf0e9('0x6')]])){utils['debug'](util['format'](_0xf0e9('0x24'),_0x16f7e2[_0xf0e9('0x5')]),_0x16f7e2);utils[_0xf0e9('0x2')](util[_0xf0e9('0x3')](_0xf0e9('0x25'),_0x16f7e2[_0xf0e9('0x5')],_0x16f7e2[_0xf0e9('0x6')],_0x16f7e2[_0xf0e9('0x26')]));members[_0x16f7e2[_0xf0e9('0x6')]]=_[_0xf0e9('0x27')](members[_0x16f7e2[_0xf0e9('0x6')]],{'data4':_0x16f7e2[_0xf0e9('0x26')],'uniqueid':_0x16f7e2[_0xf0e9('0x5')]});}}catch(_0x4d57e8){utils[_0xf0e9('0x12')](util[_0xf0e9('0x3')](_0xf0e9('0x24'),_0x16f7e2[_0xf0e9('0x5')]),_0x4d57e8);}};exports[_0xf0e9('0x28')]=function(_0x36616f){try{utils[_0xf0e9('0x14')](util[_0xf0e9('0x3')](_0xf0e9('0x29'),_0x36616f[_0xf0e9('0x5')]),_0x36616f);if(_0x36616f[_0xf0e9('0x7')]){var _0x3448d6=_0x36616f[_0xf0e9('0x7')][_0xf0e9('0x10')]('-')[0x0];if(!_['isNil'](members[_0x3448d6])){members[_0x3448d6]=_[_0xf0e9('0x27')](members[_0x3448d6],{'data1':members[_0x3448d6][_0xf0e9('0x2a')]||_0x36616f[_0xf0e9('0xa')],'data2':members[_0x3448d6][_0xf0e9('0x8')]||_0x36616f[_0xf0e9('0x2b')],'data3':members[_0x3448d6]['data3']||_0x36616f[_0xf0e9('0x2c')],'uniqueid':members[_0x3448d6][_0xf0e9('0x5')]||_0x36616f[_0xf0e9('0x5')]});utils[_0xf0e9('0x2')](util[_0xf0e9('0x3')](_0xf0e9('0x2d'),_0x36616f[_0xf0e9('0x5')],members[_0x3448d6][_0xf0e9('0x2a')],members[_0x3448d6][_0xf0e9('0x8')],members[_0x3448d6]['data3']));if(members[_0x3448d6][_0xf0e9('0x1f')]){writeDB(members[_0x3448d6]);}}}if(_0x36616f[_0xf0e9('0x2e')]){var _0x30b628=_0x36616f[_0xf0e9('0x2e')][_0xf0e9('0x10')]('-')[0x0];if(!_[_0xf0e9('0x1e')](members[_0x30b628])){members[_0x30b628]=_[_0xf0e9('0x27')](members[_0x30b628],{'data1':members[_0x30b628][_0xf0e9('0x2a')]||_0x36616f[_0xf0e9('0xa')],'data2':members[_0x30b628]['data2']||_0x36616f[_0xf0e9('0x2b')],'data3':members[_0x30b628][_0xf0e9('0x2f')]||_0x36616f[_0xf0e9('0x2c')],'uniqueid':members[_0x30b628]['uniqueid']||_0x36616f[_0xf0e9('0x5')]});utils[_0xf0e9('0x2')](util['format'](_0xf0e9('0x2d'),_0x36616f[_0xf0e9('0x5')],members[_0x30b628]['data1'],members[_0x30b628][_0xf0e9('0x8')],members[_0x30b628][_0xf0e9('0x2f')]));if(members[_0x30b628]['exitAt']){writeDB(members[_0x30b628]);}}}}catch(_0x232b16){utils[_0xf0e9('0x12')](util[_0xf0e9('0x3')](_0xf0e9('0x29'),_0x36616f[_0xf0e9('0x5')]),_0x232b16);}}; \ No newline at end of file +var _0x3cd1=['channel','data2','getUserByInterface','then','membername','name','internal','CreateMemberReport','getUserByName','split','catch','error','[%s][members][writeDB]','uniqueid','startsWith','debug','[%s][members][devicestatechange]','device','INUSE','BUSY','voice','agent','exitAt','duration','diffTime','enterAt','agentcomplete','isNil','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','data1','type','source','data3','destination','destinationchannel','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','[%s][members][cdr]','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','interface'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x3cd1,0x112));var _0x13cd=function(_0x44d71f,_0x1f8f25){_0x44d71f=_0x44d71f-0x0;var _0x57e28b=_0x3cd1[_0x44d71f];return _0x57e28b;};'use strict';var _=require('lodash');var util=require(_0x13cd('0x0'));var utils=require(_0x13cd('0x1'));var members={};var exclude=[_0x13cd('0x2'),_0x13cd('0x3')];function writeDB(_0x105bd6){utils[_0x13cd('0x4')](util[_0x13cd('0x5')](_0x13cd('0x6'),_0x105bd6['uniqueid'],_0x105bd6[_0x13cd('0x7')],_0x105bd6[_0x13cd('0x8')],_0x105bd6[_0x13cd('0x9')],_0x105bd6['membername'],_0x105bd6['type']));if(_0x105bd6[_0x13cd('0x7')]){utils[_0x13cd('0xa')](_0x105bd6[_0x13cd('0x7')])[_0x13cd('0xb')](function(_0x5a9b59){if(_0x5a9b59){_0x105bd6[_0x13cd('0xc')]=_0x5a9b59[_0x13cd('0xd')];_0x105bd6[_0x13cd('0xe')]=_0x5a9b59['internal'];utils['request'](_0x13cd('0xf'),_0x105bd6);}else{utils[_0x13cd('0x10')](_0x105bd6[_0x13cd('0x7')][_0x13cd('0x11')]('/')[0x1])[_0x13cd('0xb')](function(_0x4041a1){if(_0x4041a1){_0x105bd6[_0x13cd('0xc')]=_0x4041a1['name'];_0x105bd6[_0x13cd('0xe')]=_0x4041a1[_0x13cd('0xe')];utils['request'](_0x13cd('0xf'),_0x105bd6);}});}})[_0x13cd('0x12')](function(_0x415eaa){utils[_0x13cd('0x13')](util[_0x13cd('0x5')](_0x13cd('0x14'),_0x105bd6[_0x13cd('0x15')]),_0x415eaa);});}delete members[_0x105bd6[_0x13cd('0x7')]];}function startsWith(_0x5cf7a4,_0x24b647){return _['some'](_0x5cf7a4,function(_0x3d790d){return _[_0x13cd('0x16')](_0x24b647,_0x3d790d);});}exports['devicestatechange']=function(_0x1bd779){try{utils[_0x13cd('0x17')](util[_0x13cd('0x5')](_0x13cd('0x18'),members[_0x1bd779[_0x13cd('0x19')]]?members[_0x1bd779[_0x13cd('0x19')]][_0x13cd('0x15')]:_0x1bd779[_0x13cd('0x19')]),_0x1bd779);utils['info'](util[_0x13cd('0x5')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x1bd779[_0x13cd('0x19')]]?members[_0x1bd779[_0x13cd('0x19')]][_0x13cd('0x15')]:_0x1bd779[_0x13cd('0x19')],_0x1bd779['state'],_0x1bd779[_0x13cd('0x19')]));switch(_0x1bd779['state']){case _0x13cd('0x1a'):case _0x13cd('0x1b'):if(!startsWith(exclude,_0x1bd779[_0x13cd('0x19')])){members[_0x1bd779[_0x13cd('0x19')]]={'channel':_0x13cd('0x1c'),'interface':_0x1bd779[_0x13cd('0x19')],'type':'TALKING','enterAt':utils['now'](),'role':_0x13cd('0x1d')};}break;case'NOT_INUSE':if(!_['isNil'](members[_0x1bd779[_0x13cd('0x19')]])){members[_0x1bd779[_0x13cd('0x19')]][_0x13cd('0x1e')]=utils['now']();members[_0x1bd779[_0x13cd('0x19')]][_0x13cd('0x1f')]=utils[_0x13cd('0x20')](members[_0x1bd779[_0x13cd('0x19')]][_0x13cd('0x1e')],members[_0x1bd779[_0x13cd('0x19')]][_0x13cd('0x21')]);if(members[_0x1bd779[_0x13cd('0x19')]]['uniqueid']){writeDB(members[_0x1bd779[_0x13cd('0x19')]]);}}break;default:break;}}catch(_0x529613){utils[_0x13cd('0x13')](util[_0x13cd('0x5')]('[%s][members][devicestatechange]',members[_0x1bd779[_0x13cd('0x19')]]?members[_0x1bd779[_0x13cd('0x19')]][_0x13cd('0x15')]:_0x1bd779[_0x13cd('0x19')]),_0x529613);}};exports[_0x13cd('0x22')]=function(_0x2079d1){try{if(!_[_0x13cd('0x23')](members[_0x2079d1['interface']])){utils[_0x13cd('0x17')](util['format']('[%s][members][agentcomplete]',_0x2079d1[_0x13cd('0x15')]),_0x2079d1);utils['info'](util['format'](_0x13cd('0x24'),_0x2079d1['uniqueid'],_0x2079d1[_0x13cd('0x7')],_0x2079d1[_0x13cd('0x25')]));members[_0x2079d1[_0x13cd('0x7')]]=_[_0x13cd('0x26')](members[_0x2079d1[_0x13cd('0x7')]],{'data4':_0x2079d1[_0x13cd('0x25')],'uniqueid':_0x2079d1[_0x13cd('0x15')]});}}catch(_0x3e7806){utils[_0x13cd('0x13')](util[_0x13cd('0x5')]('[%s][members][agentcomplete]',_0x2079d1['uniqueid']),_0x3e7806);}};exports['cdr']=function(_0x1f8b45){try{utils[_0x13cd('0x17')](util[_0x13cd('0x5')]('[%s][members][cdr]',_0x1f8b45[_0x13cd('0x15')]),_0x1f8b45);if(_0x1f8b45[_0x13cd('0x8')]){var _0x71203c=_0x1f8b45[_0x13cd('0x8')][_0x13cd('0x11')]('-')[0x0];if(!_['isNil'](members[_0x71203c])){members[_0x71203c]=_[_0x13cd('0x26')](members[_0x71203c],{'data1':members[_0x71203c][_0x13cd('0x27')]||_0x1f8b45[_0x13cd('0x28')],'data2':members[_0x71203c][_0x13cd('0x9')]||_0x1f8b45[_0x13cd('0x29')],'data3':members[_0x71203c][_0x13cd('0x2a')]||_0x1f8b45[_0x13cd('0x2b')],'uniqueid':members[_0x71203c][_0x13cd('0x15')]||_0x1f8b45[_0x13cd('0x15')]});utils['info'](util['format']('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x1f8b45[_0x13cd('0x15')],members[_0x71203c]['data1'],members[_0x71203c][_0x13cd('0x9')],members[_0x71203c][_0x13cd('0x2a')]));if(members[_0x71203c][_0x13cd('0x1e')]){writeDB(members[_0x71203c]);}}}if(_0x1f8b45[_0x13cd('0x2c')]){var _0x17ec42=_0x1f8b45[_0x13cd('0x2c')][_0x13cd('0x11')]('-')[0x0];if(!_[_0x13cd('0x23')](members[_0x17ec42])){members[_0x17ec42]=_[_0x13cd('0x26')](members[_0x17ec42],{'data1':members[_0x17ec42][_0x13cd('0x27')]||_0x1f8b45['type'],'data2':members[_0x17ec42]['data2']||_0x1f8b45[_0x13cd('0x29')],'data3':members[_0x17ec42][_0x13cd('0x2a')]||_0x1f8b45[_0x13cd('0x2b')],'uniqueid':members[_0x17ec42][_0x13cd('0x15')]||_0x1f8b45[_0x13cd('0x15')]});utils['info'](util[_0x13cd('0x5')](_0x13cd('0x2d'),_0x1f8b45[_0x13cd('0x15')],members[_0x17ec42][_0x13cd('0x27')],members[_0x17ec42][_0x13cd('0x9')],members[_0x17ec42][_0x13cd('0x2a')]));if(members[_0x17ec42][_0x13cd('0x1e')]){writeDB(members[_0x17ec42]);}}}}catch(_0x492edf){utils[_0x13cd('0x13')](util[_0x13cd('0x5')](_0x13cd('0x2e'),_0x1f8b45[_0x13cd('0x15')]),_0x492edf);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index e0546ec..ad2e544 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 _0x7615=['CONTINUE','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','error','[%s][queues][queuecallerabandon]','ABANDONED','queuecallerleave','connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','[%s][queues][queuecallerleave]','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','agentcomplete','reason','transfer','TRANSFER','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','transferexten','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','ATTENDED','transfereelinkedid','clone','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','ATTENDEDTRANSFER','transfertargetlinkedid','transfertargetuniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][musiconholdstart]','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','format','uniqueid','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','queue','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','variable','queuestatus','value','toUpperCase'];(function(_0xedde59,_0x50d9b1){var _0x4db279=function(_0xa24719){while(--_0xa24719){_0xedde59['push'](_0xedde59['shift']());}};_0x4db279(++_0x50d9b1);}(_0x7615,0xa3));var _0x5761=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x7615[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0x5761('0x0'));var util=require(_0x5761('0x1'));var utils=require(_0x5761('0x2'));var queues={};function writeDB(_0x43bd91){utils[_0x5761('0x3')](util[_0x5761('0x4')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x43bd91[_0x5761('0x5')],_0x43bd91['channel'],_0x43bd91['queue'],_0x43bd91[_0x5761('0x6')],_0x43bd91[_0x5761('0x7')],_0x43bd91[_0x5761('0x8')],_0x43bd91[_0x5761('0x9')]));if(_0x43bd91['queue']){utils[_0x5761('0xa')](_0x43bd91[_0x5761('0xb')])['then'](function(_0x28ca2e){if(_0x28ca2e){_0x43bd91[_0x5761('0xc')]=_0x28ca2e[_0x5761('0xc')];}utils[_0x5761('0xd')](_0x5761('0xe'),_0x43bd91);});}else{utils[_0x5761('0xd')](_0x5761('0xe'),_0x43bd91);}if(_0x43bd91['transfereduniqueid']){delete queues[_0x43bd91[_0x5761('0xf')]];}else{delete queues[_0x43bd91[_0x5761('0x5')]];}}exports[_0x5761('0x10')]=function(_0x1fa784){try{utils[_0x5761('0x11')](util[_0x5761('0x4')](_0x5761('0x12'),_0x1fa784['uniqueid']),_0x1fa784);utils['info'](util[_0x5761('0x4')](_0x5761('0x13'),_0x1fa784[_0x5761('0x5')],_0x1fa784[_0x5761('0xb')],_0x1fa784[_0x5761('0x14')]));queues[_0x1fa784['uniqueid']]=_[_0x5761('0x15')](_0x1fa784,{'originalposition':_0x1fa784[_0x5761('0x14')],'queuecallerjoinAt':utils[_0x5761('0x16')](),'mohtime':0x0});}catch(_0x430cc9){utils['error'](util[_0x5761('0x4')]('[%s][queues][queuecallerjoin]',_0x1fa784[_0x5761('0x5')]),_0x430cc9);}};exports[_0x5761('0x17')]=function(_0x502ea1){try{if(!_[_0x5761('0x18')](queues[_0x502ea1[_0x5761('0x5')]])){utils[_0x5761('0x11')](util[_0x5761('0x4')](_0x5761('0x19'),_0x502ea1[_0x5761('0x5')]),_0x502ea1);if(queues[_0x502ea1['uniqueid']][_0x5761('0x1a')]){if(!queues[_0x502ea1['uniqueid']][_0x5761('0x1b')]&&!queues[_0x502ea1[_0x5761('0x5')]][_0x5761('0x1c')]){queues[_0x502ea1['uniqueid']][_0x5761('0x1d')]=!![];queues[_0x502ea1[_0x5761('0x5')]][_0x5761('0x1e')]=utils[_0x5761('0x16')]();queues[_0x502ea1[_0x5761('0x5')]][_0x5761('0x9')]='COMPLETEDBYAGENT';}utils[_0x5761('0x3')](util[_0x5761('0x4')](_0x5761('0x1f'),_0x502ea1[_0x5761('0x5')],queues[_0x502ea1[_0x5761('0x5')]][_0x5761('0x20')],queues[_0x502ea1[_0x5761('0x5')]][_0x5761('0x9')]));writeDB(queues[_0x502ea1[_0x5761('0x5')]]);}else if(queues[_0x502ea1[_0x5761('0x5')]]['transfereduniqueid']){utils[_0x5761('0x3')](util[_0x5761('0x4')](_0x5761('0x21'),_0x502ea1[_0x5761('0x5')],queues[_0x502ea1[_0x5761('0x5')]]['name'],queues[_0x502ea1['uniqueid']][_0x5761('0xf')]));queues[queues[_0x502ea1[_0x5761('0x5')]][_0x5761('0xf')]]=queues[_0x502ea1[_0x5761('0x5')]];queues[queues[_0x502ea1['uniqueid']][_0x5761('0xf')]][_0x5761('0x22')]=0x2;delete queues[_0x502ea1['uniqueid']];}}}catch(_0x2f6a8a){utils['error'](util['format']('[%s][queues][hangup]',_0x502ea1[_0x5761('0x5')]),_0x2f6a8a);}};exports[_0x5761('0x23')]=function(_0x508f30){try{utils[_0x5761('0x11')](util[_0x5761('0x4')](_0x5761('0x24'),_0x508f30[_0x5761('0x5')]),_0x508f30);if(!_[_0x5761('0x18')](_0x508f30[_0x5761('0x25')][_0x5761('0x26')])&&_0x508f30[_0x5761('0x27')][_0x5761('0x28')]()!==_0x5761('0x29')){if(!_[_0x5761('0x18')](queues[_0x508f30['uniqueid']])){queues[_0x508f30[_0x5761('0x5')]][_0x5761('0x1b')]=![];queues[_0x508f30[_0x5761('0x5')]][_0x5761('0x2a')]=null;queues[_0x508f30['uniqueid']][_0x5761('0x1c')]=!![];queues[_0x508f30[_0x5761('0x5')]][_0x5761('0x2b')]=utils[_0x5761('0x16')]();queues[_0x508f30[_0x5761('0x5')]][_0x5761('0x9')]=_0x508f30[_0x5761('0x27')][_0x5761('0x28')]();utils[_0x5761('0x3')](util[_0x5761('0x4')](_0x5761('0x2c'),_0x508f30['uniqueid'],queues[_0x508f30[_0x5761('0x5')]]['name'],_0x508f30[_0x5761('0x27')],queues[_0x508f30[_0x5761('0x5')]][_0x5761('0x9')]));writeDB(queues[_0x508f30[_0x5761('0x5')]]);}}else if(!_[_0x5761('0x18')](_0x508f30[_0x5761('0x25')][_0x5761('0x2d')])){if(!_[_0x5761('0x18')](queues[_0x508f30[_0x5761('0x5')]])&&!queues[_0x508f30[_0x5761('0x5')]][_0x5761('0x1b')]){queues[_0x508f30[_0x5761('0x5')]][_0x5761('0x1b')]=![];queues[_0x508f30[_0x5761('0x5')]][_0x5761('0x2a')]=null;queues[_0x508f30[_0x5761('0x5')]][_0x5761('0x1c')]=!![];queues[_0x508f30[_0x5761('0x5')]]['queuecallerexitAt']=utils['now']();queues[_0x508f30[_0x5761('0x5')]][_0x5761('0x9')]=_0x5761('0x2e');utils['info'](util[_0x5761('0x4')](_0x5761('0x2f'),_0x508f30[_0x5761('0x5')],queues[_0x508f30[_0x5761('0x5')]][_0x5761('0x20')],_0x508f30[_0x5761('0x27')],queues[_0x508f30[_0x5761('0x5')]][_0x5761('0x9')]));}}}catch(_0x187856){utils[_0x5761('0x30')](util[_0x5761('0x4')]('[%s][queues][varset]',_0x508f30[_0x5761('0x5')]),_0x187856);}};exports[_0x5761('0x1b')]=function(_0x2f1d21){try{if(!_['isNil'](queues[_0x2f1d21[_0x5761('0x5')]])){utils['debug'](util[_0x5761('0x4')](_0x5761('0x31'),_0x2f1d21['uniqueid']),_0x2f1d21);queues[_0x2f1d21[_0x5761('0x5')]]['queuecallerexit']=![];queues[_0x2f1d21[_0x5761('0x5')]][_0x5761('0x2b')]=null;queues[_0x2f1d21['uniqueid']][_0x5761('0x1b')]=!![];queues[_0x2f1d21[_0x5761('0x5')]][_0x5761('0x2a')]=utils[_0x5761('0x16')]();queues[_0x2f1d21[_0x5761('0x5')]]['queuecallerexitreason']=_0x5761('0x32');utils[_0x5761('0x3')](util[_0x5761('0x4')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x2f1d21[_0x5761('0x5')],queues[_0x2f1d21['uniqueid']][_0x5761('0x20')],queues[_0x2f1d21[_0x5761('0x5')]][_0x5761('0x9')]));}}catch(_0x3edb00){utils[_0x5761('0x30')](util[_0x5761('0x4')](_0x5761('0x31'),_0x2f1d21[_0x5761('0x5')]),_0x3edb00);}};exports[_0x5761('0x33')]=function(_0x17d45c){try{if(!_[_0x5761('0x18')](queues[_0x17d45c[_0x5761('0x5')]])){utils[_0x5761('0x11')](util['format']('[%s][queues][queuecallerleave]',_0x17d45c['uniqueid']),_0x17d45c);utils[_0x5761('0x3')](util[_0x5761('0x4')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x17d45c['uniqueid'],queues[_0x17d45c[_0x5761('0x5')]][_0x5761('0x20')],_0x17d45c[_0x5761('0x34')],_0x17d45c[_0x5761('0x35')]));queues[_0x17d45c[_0x5761('0x5')]][_0x5761('0x33')]=!![];queues[_0x17d45c[_0x5761('0x5')]][_0x5761('0x1a')]=utils['now']();queues[_0x17d45c[_0x5761('0x5')]][_0x5761('0x36')]=utils[_0x5761('0x37')](queues[_0x17d45c[_0x5761('0x5')]][_0x5761('0x1a')],queues[_0x17d45c[_0x5761('0x5')]][_0x5761('0x38')]);queues[_0x17d45c[_0x5761('0x5')]]['position']=_0x17d45c[_0x5761('0x14')];queues[_0x17d45c['uniqueid']][_0x5761('0x39')]=_0x17d45c[_0x5761('0x39')];queues[_0x17d45c[_0x5761('0x5')]][_0x5761('0x34')]=_0x17d45c[_0x5761('0x34')];queues[_0x17d45c[_0x5761('0x5')]][_0x5761('0x35')]=_0x17d45c[_0x5761('0x35')];}}catch(_0x5d3255){utils['error'](util[_0x5761('0x4')](_0x5761('0x3a'),_0x17d45c[_0x5761('0x5')]),_0x5d3255);}};exports[_0x5761('0x3b')]=function(_0xb39a32){try{if(!_[_0x5761('0x18')](queues[_0xb39a32[_0x5761('0x5')]])){utils[_0x5761('0x11')](util['format'](_0x5761('0x3c'),_0xb39a32[_0x5761('0x5')]),_0xb39a32);utils[_0x5761('0x3')](util['format'](_0x5761('0x3d'),_0xb39a32[_0x5761('0x5')],queues[_0xb39a32[_0x5761('0x5')]][_0x5761('0x20')],_0xb39a32[_0x5761('0x3e')],_0xb39a32[_0x5761('0x3f')]));queues[_0xb39a32['uniqueid']]['queuecallerabandon']=![];queues[_0xb39a32[_0x5761('0x5')]][_0x5761('0x1b')]=![];queues[_0xb39a32[_0x5761('0x5')]][_0x5761('0x2a')]=null;queues[_0xb39a32[_0x5761('0x5')]][_0x5761('0x1c')]=![];queues[_0xb39a32[_0x5761('0x5')]][_0x5761('0x9')]=null;queues[_0xb39a32[_0x5761('0x5')]][_0x5761('0x2b')]=null;queues[_0xb39a32['uniqueid']][_0x5761('0x40')]=!![];queues[_0xb39a32[_0x5761('0x5')]][_0x5761('0x8')]=_0xb39a32[_0x5761('0x3f')];queues[_0xb39a32[_0x5761('0x5')]]['lastAssignedTo']=_0xb39a32['membername'];}}catch(_0x19e4d9){utils['error'](util[_0x5761('0x4')](_0x5761('0x3c'),_0xb39a32[_0x5761('0x5')]),_0x19e4d9);}};exports[_0x5761('0x41')]=function(_0x15c295){try{if(!_[_0x5761('0x18')](queues[_0x15c295[_0x5761('0x5')]])){if(queues[_0x15c295[_0x5761('0x5')]]['queuecallerleaveAt']){utils[_0x5761('0x11')](util[_0x5761('0x4')]('[%s][queues][agentcomplete]',_0x15c295['uniqueid']),_0x15c295);queues[_0x15c295[_0x5761('0x5')]][_0x5761('0x1b')]=![];queues[_0x15c295[_0x5761('0x5')]][_0x5761('0x1b')]=![];queues[_0x15c295[_0x5761('0x5')]][_0x5761('0x2a')]=null;queues[_0x15c295['uniqueid']]['queuecallerexit']=![];queues[_0x15c295['uniqueid']][_0x5761('0x2b')]=null;queues[_0x15c295[_0x5761('0x5')]][_0x5761('0x40')]=!![];queues[_0x15c295[_0x5761('0x5')]][_0x5761('0x6')]=_0x15c295['membername'];queues[_0x15c295['uniqueid']][_0x5761('0x1d')]=!![];queues[_0x15c295[_0x5761('0x5')]][_0x5761('0x1e')]=utils[_0x5761('0x16')]();if(_0x15c295[_0x5761('0x42')]==_0x5761('0x43')){if(!queues[_0x15c295[_0x5761('0x5')]][_0x5761('0x43')]){queues[_0x15c295[_0x5761('0x5')]][_0x5761('0x9')]=_0x5761('0x44');}}else{queues[_0x15c295['uniqueid']][_0x5761('0x9')]='COMPLETEDBY'+_0x15c295[_0x5761('0x42')][_0x5761('0x28')]();}utils['info'](util['format']('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x15c295[_0x5761('0x5')],queues[_0x15c295[_0x5761('0x5')]][_0x5761('0x20')],_0x15c295['membername'],queues[_0x15c295[_0x5761('0x5')]][_0x5761('0x9')]));writeDB(queues[_0x15c295['uniqueid']]);}}}catch(_0x26999b){utils[_0x5761('0x30')](util[_0x5761('0x4')]('[%s][queues][agentcomplete]',_0x15c295[_0x5761('0x5')]),_0x26999b);}};exports[_0x5761('0x45')]=function(_0x511ff5){try{if(!_[_0x5761('0x18')](queues[_0x511ff5[_0x5761('0x46')]])){utils['debug'](util[_0x5761('0x4')](_0x5761('0x47'),_0x511ff5[_0x5761('0x5')]),_0x511ff5);queues[_0x511ff5[_0x5761('0x46')]][_0x5761('0x43')]=!![];queues[_0x511ff5[_0x5761('0x46')]][_0x5761('0x48')]='BLIND';queues[_0x511ff5[_0x5761('0x46')]][_0x5761('0x49')]=_0x511ff5['extension'];queues[_0x511ff5[_0x5761('0x46')]][_0x5761('0x4a')]=_0x511ff5[_0x5761('0x46')];queues[_0x511ff5['transfereeuniqueid']][_0x5761('0x9')]=_0x5761('0x4b');utils[_0x5761('0x3')](util[_0x5761('0x4')](_0x5761('0x4c'),_0x511ff5[_0x5761('0x5')],queues[_0x511ff5['transfereeuniqueid']]['name'],_0x511ff5[_0x5761('0x46')],_0x511ff5['extension']));}}catch(_0x37be1c){utils[_0x5761('0x30')](util[_0x5761('0x4')](_0x5761('0x47'),_0x511ff5[_0x5761('0x5')]),_0x37be1c);}};exports[_0x5761('0x4d')]=function(_0x41ede4){try{utils[_0x5761('0x11')](util['format'](_0x5761('0x4e'),_0x41ede4[_0x5761('0x4f')]),_0x41ede4);if(_0x41ede4[_0x5761('0x4f')]==_0x41ede4[_0x5761('0x50')]){if(!_[_0x5761('0x18')](queues[_0x41ede4[_0x5761('0x51')]])){utils['info'](util['format'](_0x5761('0x52'),_0x41ede4[_0x5761('0x4f')],queues[_0x41ede4[_0x5761('0x51')]]['name'],_0x41ede4['origtransfererexten']));queues[_0x41ede4[_0x5761('0x51')]][_0x5761('0x43')]=!![];queues[_0x41ede4[_0x5761('0x51')]]['transfertype']=_0x5761('0x53');queues[_0x41ede4[_0x5761('0x51')]][_0x5761('0x49')]=_0x41ede4['origtransfererexten'];queues[_0x41ede4[_0x5761('0x51')]][_0x5761('0x4a')]=_0x41ede4[_0x5761('0x4f')];queues[_0x41ede4[_0x5761('0x51')]][_0x5761('0x9')]='ATTENDEDTRANSFER';}if(!_[_0x5761('0x18')](queues[_0x41ede4[_0x5761('0x50')]])){if(_0x41ede4[_0x5761('0x54')]&&queues[_0x41ede4['transfereelinkedid']]){queues[_0x41ede4[_0x5761('0x54')]][_0x5761('0x22')]=0x1;queues[_0x41ede4[_0x5761('0x46')]]=_[_0x5761('0x55')](queues[_0x41ede4[_0x5761('0x54')]]);queues[_0x41ede4[_0x5761('0x46')]]['transfereduniqueid']=_0x41ede4['transfertargetuniqueid'];queues[_0x41ede4[_0x5761('0x46')]][_0x5761('0x22')]=0x2;queues[_0x41ede4['transfereeuniqueid']][_0x5761('0x7')]=queues[_0x41ede4[_0x5761('0x51')]][_0x5761('0x7')];queues[_0x41ede4[_0x5761('0x46')]][_0x5761('0x56')]=queues[_0x41ede4[_0x5761('0x51')]]['calleridname'];queues[_0x41ede4[_0x5761('0x46')]]['queuecallerjoinAt']=utils[_0x5761('0x16')]();queues[_0x41ede4[_0x5761('0x46')]][_0x5761('0x1a')]=utils[_0x5761('0x16')]();queues[_0x41ede4['transfereeuniqueid']][_0x5761('0x36')]=0x0;queues[_0x41ede4['transfereeuniqueid']][_0x5761('0x57')]=0x0;utils[_0x5761('0x3')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x41ede4['origtransfereruniqueid'],queues[_0x41ede4[_0x5761('0x46')]][_0x5761('0x20')],queues[_0x41ede4[_0x5761('0x46')]]['calleridnum'],queues[_0x41ede4['transfereeuniqueid']][_0x5761('0x56')]));}else{utils[_0x5761('0x3')](util[_0x5761('0x4')](_0x5761('0x58'),_0x41ede4[_0x5761('0x4f')],queues[_0x41ede4[_0x5761('0x50')]][_0x5761('0x20')],_0x41ede4[_0x5761('0x51')]));queues[_0x41ede4[_0x5761('0x50')]][_0x5761('0xf')]=_0x41ede4[_0x5761('0x51')];}}}else if(_0x41ede4[_0x5761('0x59')]==_0x41ede4[_0x5761('0x51')]){if(!_[_0x5761('0x18')](queues[_0x41ede4[_0x5761('0x50')]])){utils[_0x5761('0x3')](util[_0x5761('0x4')](_0x5761('0x5a'),_0x41ede4['origtransfereruniqueid'],queues[_0x41ede4[_0x5761('0x50')]][_0x5761('0x20')],_0x41ede4[_0x5761('0x59')],_0x41ede4['secondtransfererexten']));queues[_0x41ede4[_0x5761('0x50')]][_0x5761('0x43')]=!![];queues[_0x41ede4[_0x5761('0x50')]][_0x5761('0x48')]=_0x5761('0x53');queues[_0x41ede4[_0x5761('0x50')]]['transferexten']=_0x41ede4[_0x5761('0x5b')];queues[_0x41ede4[_0x5761('0x50')]][_0x5761('0x4a')]=_0x41ede4[_0x5761('0x59')];queues[_0x41ede4[_0x5761('0x50')]][_0x5761('0x9')]=_0x5761('0x5c');}if(!_[_0x5761('0x18')](queues[_0x41ede4[_0x5761('0x51')]])){if(_0x41ede4[_0x5761('0x5d')]&&queues[_0x41ede4[_0x5761('0x5d')]]){queues[_0x41ede4['transfertargetlinkedid']][_0x5761('0x22')]=0x1;queues[_0x41ede4[_0x5761('0x5e')]]=_[_0x5761('0x55')](queues[_0x41ede4[_0x5761('0x5d')]]);queues[_0x41ede4[_0x5761('0x5e')]][_0x5761('0xf')]=_0x41ede4[_0x5761('0x5e')];queues[_0x41ede4[_0x5761('0x5e')]][_0x5761('0x22')]=0x2;queues[_0x41ede4[_0x5761('0x5e')]][_0x5761('0x7')]=queues[_0x41ede4[_0x5761('0x50')]][_0x5761('0x7')];queues[_0x41ede4[_0x5761('0x5e')]][_0x5761('0x56')]=queues[_0x41ede4[_0x5761('0x50')]][_0x5761('0x56')];queues[_0x41ede4[_0x5761('0x5e')]][_0x5761('0x38')]=utils[_0x5761('0x16')]();queues[_0x41ede4['transfertargetuniqueid']][_0x5761('0x1a')]=utils['now']();queues[_0x41ede4[_0x5761('0x5e')]][_0x5761('0x36')]=0x0;queues[_0x41ede4[_0x5761('0x5e')]][_0x5761('0x57')]=0x0;utils[_0x5761('0x3')](util[_0x5761('0x4')](_0x5761('0x5f'),_0x41ede4[_0x5761('0x4f')],queues[_0x41ede4[_0x5761('0x5e')]]['name'],queues[_0x41ede4[_0x5761('0x5e')]][_0x5761('0xf')],queues[_0x41ede4[_0x5761('0x5e')]][_0x5761('0x7')],queues[_0x41ede4['transfertargetuniqueid']][_0x5761('0x56')]));}else{utils[_0x5761('0x3')](util['format'](_0x5761('0x58'),_0x41ede4[_0x5761('0x4f')],queues[_0x41ede4[_0x5761('0x51')]]['name'],_0x41ede4[_0x5761('0x50')]));queues[_0x41ede4['secondtransfererlinkedid']][_0x5761('0xf')]=_0x41ede4[_0x5761('0x50')];}}}}catch(_0x3c20dd){utils[_0x5761('0x30')](util[_0x5761('0x4')](_0x5761('0x4e'),_0x41ede4['origtransfereruniqueid']),_0x3c20dd);}};exports['musiconholdstart']=function(_0x6fbb91){try{if(!_['isNil'](queues[_0x6fbb91[_0x5761('0x5')]])){utils[_0x5761('0x11')](util[_0x5761('0x4')](_0x5761('0x60'),_0x6fbb91['uniqueid']),_0x6fbb91);queues[_0x6fbb91[_0x5761('0x5')]]['musiconholdstartAt']=utils[_0x5761('0x16')]();utils[_0x5761('0x3')](util['format'](_0x5761('0x61'),_0x6fbb91['uniqueid'],queues[_0x6fbb91[_0x5761('0x5')]]['name'],queues[_0x6fbb91['uniqueid']][_0x5761('0x62')]));}}catch(_0x1d00ae){utils[_0x5761('0x30')](util[_0x5761('0x4')]('[%s][queues][musiconholdstart]',_0x6fbb91[_0x5761('0x5')]),_0x1d00ae);}};exports[_0x5761('0x63')]=function(_0x268eb1){try{if(!_[_0x5761('0x18')](queues[_0x268eb1[_0x5761('0x5')]])){if(!_[_0x5761('0x18')](queues[_0x268eb1[_0x5761('0x5')]][_0x5761('0x62')])){utils[_0x5761('0x11')](util[_0x5761('0x4')](_0x5761('0x64'),_0x268eb1[_0x5761('0x5')]),_0x268eb1);queues[_0x268eb1[_0x5761('0x5')]][_0x5761('0x57')]+=utils[_0x5761('0x37')](utils[_0x5761('0x16')](),queues[_0x268eb1[_0x5761('0x5')]][_0x5761('0x62')]);utils['info'](util[_0x5761('0x4')](_0x5761('0x65'),_0x268eb1['uniqueid'],queues[_0x268eb1['uniqueid']][_0x5761('0x20')],queues[_0x268eb1[_0x5761('0x5')]][_0x5761('0x57')]));delete queues[_0x268eb1[_0x5761('0x5')]][_0x5761('0x62')];}}}catch(_0x4aa24e){utils[_0x5761('0x30')](util[_0x5761('0x4')](_0x5761('0x64'),_0x268eb1[_0x5761('0x5')]),_0x4aa24e);}}; \ No newline at end of file +var _0xbbe6=['secondtransfererexten','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','lastAssignedTo','calleridnum','accountcode','queue','getVoiceQueueByName','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','queuecallerexitreason','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerexit','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','EXITWITHKEY','[%s][queues][queuecallerabandon]','ABANDONED','queuecallerleave','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinename','queuecallerleaveAt','holdtime','diffTime','queuecallerjoinAt','count','connectedlinenum','[%s][queues][queuecallerleave]','agentconnect','[%s][queues][agentconnect]','membername','queuecallerabandonAt','assigned','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','[%s][queues][blindtransfer]','transfereeuniqueid','transfertype','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','secondtransfererlinkedid','origtransfererexten','ATTENDED','transferexten','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','queuecallerenterreason','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfereruniqueid'];(function(_0x556323,_0x270480){var _0x4218e5=function(_0x594b77){while(--_0x594b77){_0x556323['push'](_0x556323['shift']());}};_0x4218e5(++_0x270480);}(_0xbbe6,0xd9));var _0x6bbe=function(_0x190ccf,_0x3b3d84){_0x190ccf=_0x190ccf-0x0;var _0x2fc6a5=_0xbbe6[_0x190ccf];return _0x2fc6a5;};'use strict';var _=require(_0x6bbe('0x0'));var util=require(_0x6bbe('0x1'));var utils=require(_0x6bbe('0x2'));var queues={};function writeDB(_0x1f58b9){utils[_0x6bbe('0x3')](util[_0x6bbe('0x4')](_0x6bbe('0x5'),_0x1f58b9[_0x6bbe('0x6')],_0x1f58b9[_0x6bbe('0x7')],_0x1f58b9['queue'],_0x1f58b9[_0x6bbe('0x8')],_0x1f58b9[_0x6bbe('0x9')],_0x1f58b9[_0x6bbe('0xa')],_0x1f58b9['queuecallerexitreason']));if(_0x1f58b9[_0x6bbe('0xb')]){utils[_0x6bbe('0xc')](_0x1f58b9[_0x6bbe('0xb')])['then'](function(_0x11a38f){if(_0x11a38f){_0x1f58b9[_0x6bbe('0xd')]=_0x11a38f[_0x6bbe('0xd')];}utils[_0x6bbe('0xe')]('CreateVoiceQueueReport',_0x1f58b9);});}else{utils[_0x6bbe('0xe')](_0x6bbe('0xf'),_0x1f58b9);}if(_0x1f58b9[_0x6bbe('0x10')]){delete queues[_0x1f58b9['transfereduniqueid']];}else{delete queues[_0x1f58b9['uniqueid']];}}exports[_0x6bbe('0x11')]=function(_0x33aa33){try{utils[_0x6bbe('0x12')](util[_0x6bbe('0x4')](_0x6bbe('0x13'),_0x33aa33[_0x6bbe('0x6')]),_0x33aa33);utils[_0x6bbe('0x3')](util[_0x6bbe('0x4')](_0x6bbe('0x14'),_0x33aa33[_0x6bbe('0x6')],_0x33aa33[_0x6bbe('0xb')],_0x33aa33[_0x6bbe('0x15')]));queues[_0x33aa33[_0x6bbe('0x6')]]=_[_0x6bbe('0x16')](_0x33aa33,{'originalposition':_0x33aa33[_0x6bbe('0x15')],'queuecallerjoinAt':utils[_0x6bbe('0x17')](),'mohtime':0x0});}catch(_0x4dfffa){utils[_0x6bbe('0x18')](util['format'](_0x6bbe('0x13'),_0x33aa33['uniqueid']),_0x4dfffa);}};exports[_0x6bbe('0x19')]=function(_0x4747f2){try{if(!_[_0x6bbe('0x1a')](queues[_0x4747f2['uniqueid']])){utils[_0x6bbe('0x12')](util[_0x6bbe('0x4')](_0x6bbe('0x1b'),_0x4747f2[_0x6bbe('0x6')]),_0x4747f2);if(queues[_0x4747f2[_0x6bbe('0x6')]]['queuecallerleaveAt']){if(!queues[_0x4747f2[_0x6bbe('0x6')]][_0x6bbe('0x1c')]&&!queues[_0x4747f2[_0x6bbe('0x6')]]['queuecallerexit']){queues[_0x4747f2['uniqueid']][_0x6bbe('0x1d')]=!![];queues[_0x4747f2['uniqueid']][_0x6bbe('0x1e')]=utils[_0x6bbe('0x17')]();queues[_0x4747f2[_0x6bbe('0x6')]][_0x6bbe('0x1f')]=_0x6bbe('0x20');}utils[_0x6bbe('0x3')](util[_0x6bbe('0x4')](_0x6bbe('0x21'),_0x4747f2[_0x6bbe('0x6')],queues[_0x4747f2[_0x6bbe('0x6')]][_0x6bbe('0x22')],queues[_0x4747f2[_0x6bbe('0x6')]][_0x6bbe('0x1f')]));writeDB(queues[_0x4747f2['uniqueid']]);}else if(queues[_0x4747f2['uniqueid']][_0x6bbe('0x10')]){utils[_0x6bbe('0x3')](util[_0x6bbe('0x4')](_0x6bbe('0x23'),_0x4747f2[_0x6bbe('0x6')],queues[_0x4747f2[_0x6bbe('0x6')]][_0x6bbe('0x22')],queues[_0x4747f2[_0x6bbe('0x6')]][_0x6bbe('0x10')]));queues[queues[_0x4747f2['uniqueid']]['transfereduniqueid']]=queues[_0x4747f2[_0x6bbe('0x6')]];queues[queues[_0x4747f2[_0x6bbe('0x6')]][_0x6bbe('0x10')]]['queuecallerenterreason']=0x2;delete queues[_0x4747f2['uniqueid']];}}}catch(_0x4d93f9){utils[_0x6bbe('0x18')](util[_0x6bbe('0x4')]('[%s][queues][hangup]',_0x4747f2[_0x6bbe('0x6')]),_0x4d93f9);}};exports['varset']=function(_0x45c985){try{utils['debug'](util['format']('[%s][queues][varset]',_0x45c985[_0x6bbe('0x6')]),_0x45c985);if(!_[_0x6bbe('0x1a')](_0x45c985[_0x6bbe('0x24')][_0x6bbe('0x25')])&&_0x45c985[_0x6bbe('0x26')][_0x6bbe('0x27')]()!==_0x6bbe('0x28')){if(!_['isNil'](queues[_0x45c985[_0x6bbe('0x6')]])){queues[_0x45c985[_0x6bbe('0x6')]][_0x6bbe('0x1c')]=![];queues[_0x45c985[_0x6bbe('0x6')]]['queuecallerabandonAt']=null;queues[_0x45c985[_0x6bbe('0x6')]][_0x6bbe('0x29')]=!![];queues[_0x45c985['uniqueid']][_0x6bbe('0x2a')]=utils[_0x6bbe('0x17')]();queues[_0x45c985[_0x6bbe('0x6')]][_0x6bbe('0x1f')]=_0x45c985[_0x6bbe('0x26')][_0x6bbe('0x27')]();utils[_0x6bbe('0x3')](util[_0x6bbe('0x4')](_0x6bbe('0x2b'),_0x45c985[_0x6bbe('0x6')],queues[_0x45c985['uniqueid']][_0x6bbe('0x22')],_0x45c985[_0x6bbe('0x26')],queues[_0x45c985[_0x6bbe('0x6')]][_0x6bbe('0x1f')]));writeDB(queues[_0x45c985[_0x6bbe('0x6')]]);}}else if(!_[_0x6bbe('0x1a')](_0x45c985['variable'][_0x6bbe('0x2c')])){if(!_[_0x6bbe('0x1a')](queues[_0x45c985['uniqueid']])&&!queues[_0x45c985['uniqueid']][_0x6bbe('0x1c')]){queues[_0x45c985[_0x6bbe('0x6')]]['queuecallerabandon']=![];queues[_0x45c985[_0x6bbe('0x6')]]['queuecallerabandonAt']=null;queues[_0x45c985[_0x6bbe('0x6')]][_0x6bbe('0x29')]=!![];queues[_0x45c985[_0x6bbe('0x6')]][_0x6bbe('0x2a')]=utils[_0x6bbe('0x17')]();queues[_0x45c985[_0x6bbe('0x6')]][_0x6bbe('0x1f')]=_0x6bbe('0x2d');utils[_0x6bbe('0x3')](util[_0x6bbe('0x4')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x45c985['uniqueid'],queues[_0x45c985[_0x6bbe('0x6')]][_0x6bbe('0x22')],_0x45c985[_0x6bbe('0x26')],queues[_0x45c985[_0x6bbe('0x6')]][_0x6bbe('0x1f')]));}}}catch(_0x3f173c){utils[_0x6bbe('0x18')](util[_0x6bbe('0x4')]('[%s][queues][varset]',_0x45c985[_0x6bbe('0x6')]),_0x3f173c);}};exports[_0x6bbe('0x1c')]=function(_0x3c6750){try{if(!_['isNil'](queues[_0x3c6750[_0x6bbe('0x6')]])){utils['debug'](util[_0x6bbe('0x4')](_0x6bbe('0x2e'),_0x3c6750[_0x6bbe('0x6')]),_0x3c6750);queues[_0x3c6750['uniqueid']][_0x6bbe('0x29')]=![];queues[_0x3c6750['uniqueid']][_0x6bbe('0x2a')]=null;queues[_0x3c6750[_0x6bbe('0x6')]][_0x6bbe('0x1c')]=!![];queues[_0x3c6750[_0x6bbe('0x6')]]['queuecallerabandonAt']=utils['now']();queues[_0x3c6750[_0x6bbe('0x6')]][_0x6bbe('0x1f')]=_0x6bbe('0x2f');utils[_0x6bbe('0x3')](util[_0x6bbe('0x4')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x3c6750[_0x6bbe('0x6')],queues[_0x3c6750[_0x6bbe('0x6')]][_0x6bbe('0x22')],queues[_0x3c6750[_0x6bbe('0x6')]]['queuecallerexitreason']));}}catch(_0x4134d5){utils[_0x6bbe('0x18')](util['format'](_0x6bbe('0x2e'),_0x3c6750[_0x6bbe('0x6')]),_0x4134d5);}};exports[_0x6bbe('0x30')]=function(_0x429e62){try{if(!_[_0x6bbe('0x1a')](queues[_0x429e62[_0x6bbe('0x6')]])){utils['debug'](util[_0x6bbe('0x4')]('[%s][queues][queuecallerleave]',_0x429e62[_0x6bbe('0x6')]),_0x429e62);utils['info'](util[_0x6bbe('0x4')](_0x6bbe('0x31'),_0x429e62[_0x6bbe('0x6')],queues[_0x429e62['uniqueid']]['name'],_0x429e62['connectedlinenum'],_0x429e62[_0x6bbe('0x32')]));queues[_0x429e62['uniqueid']][_0x6bbe('0x30')]=!![];queues[_0x429e62[_0x6bbe('0x6')]][_0x6bbe('0x33')]=utils[_0x6bbe('0x17')]();queues[_0x429e62[_0x6bbe('0x6')]][_0x6bbe('0x34')]=utils[_0x6bbe('0x35')](queues[_0x429e62['uniqueid']]['queuecallerleaveAt'],queues[_0x429e62['uniqueid']][_0x6bbe('0x36')]);queues[_0x429e62[_0x6bbe('0x6')]][_0x6bbe('0x15')]=_0x429e62[_0x6bbe('0x15')];queues[_0x429e62[_0x6bbe('0x6')]][_0x6bbe('0x37')]=_0x429e62[_0x6bbe('0x37')];queues[_0x429e62[_0x6bbe('0x6')]][_0x6bbe('0x38')]=_0x429e62[_0x6bbe('0x38')];queues[_0x429e62[_0x6bbe('0x6')]][_0x6bbe('0x32')]=_0x429e62[_0x6bbe('0x32')];}}catch(_0x5d1052){utils[_0x6bbe('0x18')](util[_0x6bbe('0x4')](_0x6bbe('0x39'),_0x429e62['uniqueid']),_0x5d1052);}};exports[_0x6bbe('0x3a')]=function(_0x98aa35){try{if(!_['isNil'](queues[_0x98aa35['uniqueid']])){utils[_0x6bbe('0x12')](util[_0x6bbe('0x4')](_0x6bbe('0x3b'),_0x98aa35['uniqueid']),_0x98aa35);utils[_0x6bbe('0x3')](util[_0x6bbe('0x4')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x98aa35[_0x6bbe('0x6')],queues[_0x98aa35[_0x6bbe('0x6')]][_0x6bbe('0x22')],_0x98aa35[_0x6bbe('0x3c')],_0x98aa35['destaccountcode']));queues[_0x98aa35['uniqueid']][_0x6bbe('0x1c')]=![];queues[_0x98aa35[_0x6bbe('0x6')]][_0x6bbe('0x1c')]=![];queues[_0x98aa35[_0x6bbe('0x6')]][_0x6bbe('0x3d')]=null;queues[_0x98aa35[_0x6bbe('0x6')]]['queuecallerexit']=![];queues[_0x98aa35[_0x6bbe('0x6')]][_0x6bbe('0x1f')]=null;queues[_0x98aa35[_0x6bbe('0x6')]][_0x6bbe('0x2a')]=null;queues[_0x98aa35[_0x6bbe('0x6')]][_0x6bbe('0x3e')]=!![];queues[_0x98aa35['uniqueid']][_0x6bbe('0xa')]=_0x98aa35['destaccountcode'];queues[_0x98aa35[_0x6bbe('0x6')]][_0x6bbe('0x8')]=_0x98aa35[_0x6bbe('0x3c')];}}catch(_0x1edf13){utils[_0x6bbe('0x18')](util['format']('[%s][queues][agentconnect]',_0x98aa35[_0x6bbe('0x6')]),_0x1edf13);}};exports['agentcomplete']=function(_0x3408fb){try{if(!_[_0x6bbe('0x1a')](queues[_0x3408fb['uniqueid']])){if(queues[_0x3408fb[_0x6bbe('0x6')]][_0x6bbe('0x33')]){utils[_0x6bbe('0x12')](util[_0x6bbe('0x4')](_0x6bbe('0x3f'),_0x3408fb[_0x6bbe('0x6')]),_0x3408fb);queues[_0x3408fb[_0x6bbe('0x6')]][_0x6bbe('0x1c')]=![];queues[_0x3408fb[_0x6bbe('0x6')]][_0x6bbe('0x1c')]=![];queues[_0x3408fb[_0x6bbe('0x6')]]['queuecallerabandonAt']=null;queues[_0x3408fb[_0x6bbe('0x6')]]['queuecallerexit']=![];queues[_0x3408fb['uniqueid']][_0x6bbe('0x2a')]=null;queues[_0x3408fb[_0x6bbe('0x6')]][_0x6bbe('0x3e')]=!![];queues[_0x3408fb['uniqueid']]['lastAssignedTo']=_0x3408fb[_0x6bbe('0x3c')];queues[_0x3408fb[_0x6bbe('0x6')]]['queuecallercomplete']=!![];queues[_0x3408fb[_0x6bbe('0x6')]][_0x6bbe('0x1e')]=utils[_0x6bbe('0x17')]();if(_0x3408fb[_0x6bbe('0x40')]==_0x6bbe('0x41')){if(!queues[_0x3408fb[_0x6bbe('0x6')]][_0x6bbe('0x41')]){queues[_0x3408fb[_0x6bbe('0x6')]][_0x6bbe('0x1f')]=_0x6bbe('0x42');}}else{queues[_0x3408fb['uniqueid']][_0x6bbe('0x1f')]='COMPLETEDBY'+_0x3408fb[_0x6bbe('0x40')]['toUpperCase']();}utils[_0x6bbe('0x3')](util[_0x6bbe('0x4')](_0x6bbe('0x43'),_0x3408fb[_0x6bbe('0x6')],queues[_0x3408fb[_0x6bbe('0x6')]][_0x6bbe('0x22')],_0x3408fb[_0x6bbe('0x3c')],queues[_0x3408fb[_0x6bbe('0x6')]][_0x6bbe('0x1f')]));writeDB(queues[_0x3408fb['uniqueid']]);}}}catch(_0x31c758){utils['error'](util[_0x6bbe('0x4')]('[%s][queues][agentcomplete]',_0x3408fb[_0x6bbe('0x6')]),_0x31c758);}};exports[_0x6bbe('0x44')]=function(_0x548304){try{if(!_[_0x6bbe('0x1a')](queues[_0x548304['transfereeuniqueid']])){utils[_0x6bbe('0x12')](util[_0x6bbe('0x4')](_0x6bbe('0x45'),_0x548304['uniqueid']),_0x548304);queues[_0x548304[_0x6bbe('0x46')]]['transfer']=!![];queues[_0x548304['transfereeuniqueid']][_0x6bbe('0x47')]='BLIND';queues[_0x548304[_0x6bbe('0x46')]]['transferexten']=_0x548304[_0x6bbe('0x48')];queues[_0x548304[_0x6bbe('0x46')]][_0x6bbe('0x49')]=_0x548304['transfereeuniqueid'];queues[_0x548304[_0x6bbe('0x46')]][_0x6bbe('0x1f')]=_0x6bbe('0x4a');utils[_0x6bbe('0x3')](util[_0x6bbe('0x4')](_0x6bbe('0x4b'),_0x548304['uniqueid'],queues[_0x548304[_0x6bbe('0x46')]][_0x6bbe('0x22')],_0x548304[_0x6bbe('0x46')],_0x548304[_0x6bbe('0x48')]));}}catch(_0x4453ad){utils[_0x6bbe('0x18')](util[_0x6bbe('0x4')](_0x6bbe('0x45'),_0x548304[_0x6bbe('0x6')]),_0x4453ad);}};exports[_0x6bbe('0x4c')]=function(_0x4a90ea){try{utils['debug'](util['format'](_0x6bbe('0x4d'),_0x4a90ea[_0x6bbe('0x4e')]),_0x4a90ea);if(_0x4a90ea[_0x6bbe('0x4e')]==_0x4a90ea['origtransfererlinkedid']){if(!_[_0x6bbe('0x1a')](queues[_0x4a90ea[_0x6bbe('0x4f')]])){utils['info'](util[_0x6bbe('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x4a90ea['origtransfereruniqueid'],queues[_0x4a90ea[_0x6bbe('0x4f')]][_0x6bbe('0x22')],_0x4a90ea[_0x6bbe('0x50')]));queues[_0x4a90ea[_0x6bbe('0x4f')]][_0x6bbe('0x41')]=!![];queues[_0x4a90ea[_0x6bbe('0x4f')]]['transfertype']=_0x6bbe('0x51');queues[_0x4a90ea[_0x6bbe('0x4f')]][_0x6bbe('0x52')]=_0x4a90ea[_0x6bbe('0x50')];queues[_0x4a90ea[_0x6bbe('0x4f')]][_0x6bbe('0x49')]=_0x4a90ea[_0x6bbe('0x4e')];queues[_0x4a90ea[_0x6bbe('0x4f')]][_0x6bbe('0x1f')]=_0x6bbe('0x53');}if(!_['isNil'](queues[_0x4a90ea[_0x6bbe('0x54')]])){if(_0x4a90ea['transfereelinkedid']&&queues[_0x4a90ea[_0x6bbe('0x55')]]){queues[_0x4a90ea['transfereelinkedid']][_0x6bbe('0x56')]=0x1;queues[_0x4a90ea[_0x6bbe('0x46')]]=_[_0x6bbe('0x57')](queues[_0x4a90ea[_0x6bbe('0x55')]]);queues[_0x4a90ea['transfereeuniqueid']][_0x6bbe('0x10')]=_0x4a90ea[_0x6bbe('0x58')];queues[_0x4a90ea[_0x6bbe('0x46')]][_0x6bbe('0x56')]=0x2;queues[_0x4a90ea[_0x6bbe('0x46')]][_0x6bbe('0x9')]=queues[_0x4a90ea['secondtransfererlinkedid']][_0x6bbe('0x9')];queues[_0x4a90ea['transfereeuniqueid']][_0x6bbe('0x59')]=queues[_0x4a90ea[_0x6bbe('0x4f')]]['calleridname'];queues[_0x4a90ea[_0x6bbe('0x46')]][_0x6bbe('0x36')]=utils['now']();queues[_0x4a90ea[_0x6bbe('0x46')]][_0x6bbe('0x33')]=utils[_0x6bbe('0x17')]();queues[_0x4a90ea[_0x6bbe('0x46')]]['holdtime']=0x0;queues[_0x4a90ea['transfereeuniqueid']][_0x6bbe('0x5a')]=0x0;utils[_0x6bbe('0x3')](util[_0x6bbe('0x4')](_0x6bbe('0x5b'),_0x4a90ea['origtransfereruniqueid'],queues[_0x4a90ea[_0x6bbe('0x46')]][_0x6bbe('0x22')],queues[_0x4a90ea['transfereeuniqueid']][_0x6bbe('0x9')],queues[_0x4a90ea[_0x6bbe('0x46')]]['calleridname']));}else{utils[_0x6bbe('0x3')](util[_0x6bbe('0x4')](_0x6bbe('0x5c'),_0x4a90ea[_0x6bbe('0x4e')],queues[_0x4a90ea[_0x6bbe('0x54')]][_0x6bbe('0x22')],_0x4a90ea[_0x6bbe('0x4f')]));queues[_0x4a90ea[_0x6bbe('0x54')]][_0x6bbe('0x10')]=_0x4a90ea[_0x6bbe('0x4f')];}}}else if(_0x4a90ea['secondtransfereruniqueid']==_0x4a90ea['secondtransfererlinkedid']){if(!_[_0x6bbe('0x1a')](queues[_0x4a90ea['origtransfererlinkedid']])){utils[_0x6bbe('0x3')](util['format'](_0x6bbe('0x5d'),_0x4a90ea[_0x6bbe('0x4e')],queues[_0x4a90ea[_0x6bbe('0x54')]][_0x6bbe('0x22')],_0x4a90ea[_0x6bbe('0x5e')],_0x4a90ea['secondtransfererexten']));queues[_0x4a90ea['origtransfererlinkedid']]['transfer']=!![];queues[_0x4a90ea['origtransfererlinkedid']][_0x6bbe('0x47')]=_0x6bbe('0x51');queues[_0x4a90ea['origtransfererlinkedid']][_0x6bbe('0x52')]=_0x4a90ea[_0x6bbe('0x5f')];queues[_0x4a90ea['origtransfererlinkedid']]['transferuniqueid']=_0x4a90ea[_0x6bbe('0x5e')];queues[_0x4a90ea[_0x6bbe('0x54')]][_0x6bbe('0x1f')]='ATTENDEDTRANSFER';}if(!_[_0x6bbe('0x1a')](queues[_0x4a90ea[_0x6bbe('0x4f')]])){if(_0x4a90ea['transfertargetlinkedid']&&queues[_0x4a90ea[_0x6bbe('0x60')]]){queues[_0x4a90ea[_0x6bbe('0x60')]][_0x6bbe('0x56')]=0x1;queues[_0x4a90ea['transfertargetuniqueid']]=_['clone'](queues[_0x4a90ea[_0x6bbe('0x60')]]);queues[_0x4a90ea['transfertargetuniqueid']][_0x6bbe('0x10')]=_0x4a90ea['transfertargetuniqueid'];queues[_0x4a90ea['transfertargetuniqueid']][_0x6bbe('0x56')]=0x2;queues[_0x4a90ea[_0x6bbe('0x58')]][_0x6bbe('0x9')]=queues[_0x4a90ea[_0x6bbe('0x54')]][_0x6bbe('0x9')];queues[_0x4a90ea['transfertargetuniqueid']][_0x6bbe('0x59')]=queues[_0x4a90ea[_0x6bbe('0x54')]]['calleridname'];queues[_0x4a90ea[_0x6bbe('0x58')]][_0x6bbe('0x36')]=utils['now']();queues[_0x4a90ea[_0x6bbe('0x58')]]['queuecallerleaveAt']=utils[_0x6bbe('0x17')]();queues[_0x4a90ea[_0x6bbe('0x58')]][_0x6bbe('0x34')]=0x0;queues[_0x4a90ea[_0x6bbe('0x58')]]['mohtime']=0x0;utils[_0x6bbe('0x3')](util[_0x6bbe('0x4')](_0x6bbe('0x61'),_0x4a90ea[_0x6bbe('0x4e')],queues[_0x4a90ea[_0x6bbe('0x58')]][_0x6bbe('0x22')],queues[_0x4a90ea[_0x6bbe('0x58')]][_0x6bbe('0x10')],queues[_0x4a90ea['transfertargetuniqueid']]['calleridnum'],queues[_0x4a90ea[_0x6bbe('0x58')]]['calleridname']));}else{utils[_0x6bbe('0x3')](util[_0x6bbe('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x4a90ea[_0x6bbe('0x4e')],queues[_0x4a90ea[_0x6bbe('0x4f')]]['name'],_0x4a90ea[_0x6bbe('0x54')]));queues[_0x4a90ea[_0x6bbe('0x4f')]][_0x6bbe('0x10')]=_0x4a90ea[_0x6bbe('0x54')];}}}}catch(_0x3b8d77){utils[_0x6bbe('0x18')](util['format'](_0x6bbe('0x4d'),_0x4a90ea[_0x6bbe('0x4e')]),_0x3b8d77);}};exports[_0x6bbe('0x62')]=function(_0x536751){try{if(!_['isNil'](queues[_0x536751[_0x6bbe('0x6')]])){utils[_0x6bbe('0x12')](util[_0x6bbe('0x4')](_0x6bbe('0x63'),_0x536751[_0x6bbe('0x6')]),_0x536751);queues[_0x536751[_0x6bbe('0x6')]][_0x6bbe('0x64')]=utils[_0x6bbe('0x17')]();utils['info'](util[_0x6bbe('0x4')](_0x6bbe('0x65'),_0x536751[_0x6bbe('0x6')],queues[_0x536751['uniqueid']][_0x6bbe('0x22')],queues[_0x536751[_0x6bbe('0x6')]]['musiconholdstartAt']));}}catch(_0x379767){utils['error'](util[_0x6bbe('0x4')]('[%s][queues][musiconholdstart]',_0x536751[_0x6bbe('0x6')]),_0x379767);}};exports['musiconholdstop']=function(_0x333a5c){try{if(!_[_0x6bbe('0x1a')](queues[_0x333a5c[_0x6bbe('0x6')]])){if(!_[_0x6bbe('0x1a')](queues[_0x333a5c[_0x6bbe('0x6')]]['musiconholdstartAt'])){utils['debug'](util[_0x6bbe('0x4')](_0x6bbe('0x66'),_0x333a5c[_0x6bbe('0x6')]),_0x333a5c);queues[_0x333a5c['uniqueid']][_0x6bbe('0x5a')]+=utils[_0x6bbe('0x35')](utils[_0x6bbe('0x17')](),queues[_0x333a5c[_0x6bbe('0x6')]]['musiconholdstartAt']);utils[_0x6bbe('0x3')](util[_0x6bbe('0x4')](_0x6bbe('0x67'),_0x333a5c['uniqueid'],queues[_0x333a5c['uniqueid']]['name'],queues[_0x333a5c['uniqueid']][_0x6bbe('0x5a')]));delete queues[_0x333a5c['uniqueid']][_0x6bbe('0x64')];}}}catch(_0x3bbd24){utils[_0x6bbe('0x18')](util['format']('[%s][queues][musiconholdstop]',_0x333a5c[_0x6bbe('0x6')]),_0x3bbd24);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 4dd6832..d0a4299 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 _0x9a44=['endsWith','.wav49','replace','.WAV','monitors','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','cause-txt','calleridname','connectedlinenum','connectedlinename','outbound','forEach','clone','newexten','application','appdata','toLowerCase','split','substring','lastIndexOf','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','./utils','info','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','format','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','context','channel','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','linkedid','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','error','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value'];(function(_0x27f88b,_0x526bad){var _0x2114f4=function(_0x341508){while(--_0x341508){_0x27f88b['push'](_0x27f88b['shift']());}};_0x2114f4(++_0x526bad);}(_0x9a44,0x106));var _0x49a4=function(_0x242dd2,_0x36f1ae){_0x242dd2=_0x242dd2-0x0;var _0x53b58c=_0x9a44[_0x242dd2];return _0x53b58c;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x49a4('0x0'));var recordings={};function writeDB(_0x213716){utils[_0x49a4('0x1')](util['format'](_0x49a4('0x2'),_0x213716[_0x49a4('0x3')]));if(_0x213716[_0x49a4('0x4')]){utils[_0x49a4('0x5')](_0x213716[_0x49a4('0x4')])[_0x49a4('0x6')](function(_0xab7172){if(_0xab7172){_0x213716[_0x49a4('0x7')]=_0xab7172[_0x49a4('0x8')];_0x213716[_0x49a4('0x9')]=_0xab7172['id'];}utils[_0x49a4('0xa')](_0x49a4('0xb'),_0x213716);});}else{utils[_0x49a4('0xa')](_0x49a4('0xb'),_0x213716);}}exports[_0x49a4('0xc')]=function(_0x2d6532){try{utils[_0x49a4('0xd')](util['format'](_0x49a4('0xe'),_0x2d6532[_0x49a4('0x3')]),_0x2d6532);if(_0x2d6532[_0x49a4('0x3')]==_0x2d6532['linkedid']){utils[_0x49a4('0x1')](util[_0x49a4('0xf')](_0x49a4('0x10'),_0x2d6532[_0x49a4('0x3')],_0x2d6532['context'],_0x2d6532[_0x49a4('0x11')]));recordings[_0x2d6532['uniqueid']]={'uniqueid':_0x2d6532[_0x49a4('0x3')],'accountcode':_0x2d6532[_0x49a4('0x4')],'exten':_0x2d6532[_0x49a4('0x11')],'context':_0x2d6532[_0x49a4('0x12')],'channel':_0x2d6532[_0x49a4('0x13')],'monitors':[]};}}catch(_0x22df95){utils['error'](util[_0x49a4('0xf')](_0x49a4('0xe'),_0x2d6532[_0x49a4('0x3')]),_0x22df95);}};exports['newstate']=function(_0x15b6db){try{utils[_0x49a4('0xd')](util['format'](_0x49a4('0x14'),_0x15b6db[_0x49a4('0x3')]),_0x15b6db);if(!_[_0x49a4('0x15')](recordings[_0x15b6db[_0x49a4('0x3')]])&&_0x15b6db[_0x49a4('0x16')]==0x6){utils[_0x49a4('0x1')](util[_0x49a4('0xf')](_0x49a4('0x17'),_0x15b6db[_0x49a4('0x3')],_0x15b6db[_0x49a4('0x12')],_0x15b6db[_0x49a4('0x13')]));}else if(!_['isNil'](recordings[_0x15b6db[_0x49a4('0x18')]])&&_0x15b6db[_0x49a4('0x16')]==0x6&&_0x15b6db['context']!='transfer'){utils[_0x49a4('0x1')](util['format'](_0x49a4('0x19'),_0x15b6db[_0x49a4('0x3')],_0x15b6db['linkedid'],_0x15b6db[_0x49a4('0x12')],_0x15b6db[_0x49a4('0x13')]));recordings[_0x15b6db[_0x49a4('0x18')]]['accountcode']=_0x15b6db[_0x49a4('0x4')];}}catch(_0x402492){utils[_0x49a4('0x1a')](util[_0x49a4('0xf')](_0x49a4('0x14'),_0x15b6db[_0x49a4('0x3')]),_0x402492);}};exports[_0x49a4('0x1b')]=function(_0x471828){try{if(!_[_0x49a4('0x15')](_0x471828[_0x49a4('0x1c')])&&!_[_0x49a4('0x15')](_0x471828['variable'][_0x49a4('0x1d')])){utils[_0x49a4('0xd')](util['format'](_0x49a4('0x1e'),_0x471828[_0x49a4('0x3')]),_0x471828);utils[_0x49a4('0x1')](util['format'](_0x49a4('0x1f'),_0x471828['uniqueid'],_0x471828[_0x49a4('0x1c')],_0x471828[_0x49a4('0x20')]));if(_[_0x49a4('0x21')](_0x471828[_0x49a4('0x20')],_0x49a4('0x22'))){_0x471828[_0x49a4('0x20')]=_0x471828[_0x49a4('0x20')][_0x49a4('0x23')](_0x49a4('0x22'),_0x49a4('0x24'));}if(recordings[_0x471828[_0x49a4('0x18')]]){var _0x4200b1=_['find'](recordings[_0x471828[_0x49a4('0x18')]][_0x49a4('0x25')],{'value':_0x471828[_0x49a4('0x20')]});if(_['isNil'](_0x4200b1)){recordings[_0x471828[_0x49a4('0x18')]][_0x49a4('0x25')]['push']({'value':_0x471828[_0x49a4('0x20')]});}}}}catch(_0x271196){utils['error'](util[_0x49a4('0xf')](_0x49a4('0x1e'),_0x471828[_0x49a4('0x3')]),_0x271196);}};exports[_0x49a4('0x26')]=function(_0x522e4e){try{if(!_[_0x49a4('0x15')](recordings[_0x522e4e['uniqueid']])){utils[_0x49a4('0xd')](util[_0x49a4('0xf')](_0x49a4('0x27'),_0x522e4e[_0x49a4('0x3')]),_0x522e4e);utils[_0x49a4('0x1')](util[_0x49a4('0xf')](_0x49a4('0x28'),_0x522e4e['uniqueid'],_0x522e4e[_0x49a4('0x29')],_0x522e4e['calleridname'],_0x522e4e[_0x49a4('0x2a')]));recordings[_0x522e4e[_0x49a4('0x3')]][_0x49a4('0x29')]=_0x522e4e['calleridnum'];recordings[_0x522e4e[_0x49a4('0x3')]]['calleridname']=_0x522e4e[_0x49a4('0x2b')];recordings[_0x522e4e[_0x49a4('0x3')]][_0x49a4('0x2c')]=_0x522e4e[_0x49a4('0x2c')];recordings[_0x522e4e['uniqueid']][_0x49a4('0x2d')]=_0x522e4e[_0x49a4('0x2d')];if(recordings[_0x522e4e[_0x49a4('0x3')]]['type']==_0x49a4('0x2e')&&recordings[_0x522e4e['uniqueid']][_0x49a4('0x4')]){recordings[_0x522e4e[_0x49a4('0x3')]][_0x49a4('0x2c')]=recordings[_0x522e4e[_0x49a4('0x3')]][_0x49a4('0x4')];recordings[_0x522e4e[_0x49a4('0x3')]][_0x49a4('0x2d')]='';}recordings[_0x522e4e[_0x49a4('0x3')]][_0x49a4('0x25')][_0x49a4('0x2f')](function(_0x2f864e){var _0x4c7cc4=_[_0x49a4('0x30')](recordings[_0x522e4e[_0x49a4('0x3')]]);_0x4c7cc4[_0x49a4('0x20')]=_0x2f864e[_0x49a4('0x20')];writeDB(_0x4c7cc4);});delete recordings[_0x522e4e[_0x49a4('0x3')]];}}catch(_0x30e9ca){utils[_0x49a4('0x1a')](util[_0x49a4('0xf')]('[%s][recordings][hangup]',_0x522e4e[_0x49a4('0x3')]),_0x30e9ca);}};exports[_0x49a4('0x31')]=function(_0x41f092){try{if(!_[_0x49a4('0x15')](recordings[_0x41f092[_0x49a4('0x3')]])){utils[_0x49a4('0xd')](util['format']('[%s][recordings][newexten]',_0x41f092[_0x49a4('0x3')]),_0x41f092);utils[_0x49a4('0x1')](util[_0x49a4('0xf')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x41f092[_0x49a4('0x3')],_0x41f092[_0x49a4('0x32')],_0x41f092[_0x49a4('0x33')]));if(_0x41f092[_0x49a4('0x32')][_0x49a4('0x34')]()=='set'&&_['startsWith'](_0x41f092[_0x49a4('0x33')][_0x49a4('0x34')](),'cdr')){var _0x571d88=_0x41f092[_0x49a4('0x33')][_0x49a4('0x35')]('=');var _0x472f68=_0x571d88[0x0][_0x49a4('0x36')](_0x571d88[0x0][_0x49a4('0x37')]('(')+0x1,_0x571d88[0x0][_0x49a4('0x37')](')'));var _0x5b6daa=_0x571d88[0x1];recordings[_0x41f092[_0x49a4('0x3')]][_0x472f68]=_0x5b6daa;}}}catch(_0x378cbe){utils[_0x49a4('0x1a')](util[_0x49a4('0xf')]('[%s][recordings][newexten]',_0x41f092[_0x49a4('0x3')]),_0x378cbe);}};exports['queuecallerjoin']=function(_0x53286f){try{if(!_[_0x49a4('0x15')](recordings[_0x53286f['uniqueid']])){utils[_0x49a4('0xd')](util[_0x49a4('0xf')](_0x49a4('0x38'),_0x53286f[_0x49a4('0x3')]),_0x53286f);utils[_0x49a4('0x1')](util[_0x49a4('0xf')](_0x49a4('0x39'),_0x53286f['uniqueid'],_0x53286f['queue']));recordings[_0x53286f['uniqueid']][_0x49a4('0x3a')]=_0x53286f[_0x49a4('0x3a')];}}catch(_0x4472c9){utils[_0x49a4('0x1a')](util[_0x49a4('0xf')](_0x49a4('0x38'),_0x53286f[_0x49a4('0x3')]),_0x4472c9);}}; \ No newline at end of file +var _0x29c1=['substring','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','./utils','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','membername','name','UserId','request','CreateVoiceRecording','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','context','channel','error','newstate','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','varset','mixmonitor_filename','[%s][recordings][varset]','variable','value','.wav49','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','cause-txt','calleridname','connectedlinenum','connectedlinename','type','outbound','forEach','newexten','application','appdata','toLowerCase','set','startsWith','cdr','split'];(function(_0x5d923a,_0x27b5a0){var _0x485b7d=function(_0x26f757){while(--_0x26f757){_0x5d923a['push'](_0x5d923a['shift']());}};_0x485b7d(++_0x27b5a0);}(_0x29c1,0x1c7));var _0x129c=function(_0x1bedcb,_0x26d012){_0x1bedcb=_0x1bedcb-0x0;var _0x485394=_0x29c1[_0x1bedcb];return _0x485394;};'use strict';var _=require(_0x129c('0x0'));var util=require(_0x129c('0x1'));var utils=require(_0x129c('0x2'));var recordings={};function writeDB(_0x279414){utils[_0x129c('0x3')](util[_0x129c('0x4')](_0x129c('0x5'),_0x279414[_0x129c('0x6')]));if(_0x279414[_0x129c('0x7')]){utils[_0x129c('0x8')](_0x279414[_0x129c('0x7')])['then'](function(_0x67d8dd){if(_0x67d8dd){_0x279414[_0x129c('0x9')]=_0x67d8dd[_0x129c('0xa')];_0x279414[_0x129c('0xb')]=_0x67d8dd['id'];}utils[_0x129c('0xc')](_0x129c('0xd'),_0x279414);});}else{utils[_0x129c('0xc')](_0x129c('0xd'),_0x279414);}}exports['newchannel']=function(_0x326177){try{utils[_0x129c('0xe')](util[_0x129c('0x4')](_0x129c('0xf'),_0x326177[_0x129c('0x6')]),_0x326177);if(_0x326177[_0x129c('0x6')]==_0x326177[_0x129c('0x10')]){utils[_0x129c('0x3')](util['format'](_0x129c('0x11'),_0x326177['uniqueid'],_0x326177['context'],_0x326177['exten']));recordings[_0x326177['uniqueid']]={'uniqueid':_0x326177[_0x129c('0x6')],'accountcode':_0x326177['accountcode'],'exten':_0x326177[_0x129c('0x12')],'context':_0x326177[_0x129c('0x13')],'channel':_0x326177[_0x129c('0x14')],'monitors':[]};}}catch(_0x51d514){utils[_0x129c('0x15')](util[_0x129c('0x4')](_0x129c('0xf'),_0x326177[_0x129c('0x6')]),_0x51d514);}};exports[_0x129c('0x16')]=function(_0x54f8ce){try{utils['debug'](util['format'](_0x129c('0x17'),_0x54f8ce[_0x129c('0x6')]),_0x54f8ce);if(!_[_0x129c('0x18')](recordings[_0x54f8ce[_0x129c('0x6')]])&&_0x54f8ce[_0x129c('0x19')]==0x6){utils[_0x129c('0x3')](util[_0x129c('0x4')](_0x129c('0x1a'),_0x54f8ce[_0x129c('0x6')],_0x54f8ce[_0x129c('0x13')],_0x54f8ce[_0x129c('0x14')]));}else if(!_[_0x129c('0x18')](recordings[_0x54f8ce['linkedid']])&&_0x54f8ce['channelstate']==0x6&&_0x54f8ce[_0x129c('0x13')]!=_0x129c('0x1b')){utils['info'](util[_0x129c('0x4')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x54f8ce[_0x129c('0x6')],_0x54f8ce[_0x129c('0x10')],_0x54f8ce[_0x129c('0x13')],_0x54f8ce[_0x129c('0x14')]));recordings[_0x54f8ce[_0x129c('0x10')]][_0x129c('0x7')]=_0x54f8ce[_0x129c('0x7')];}}catch(_0x35e272){utils[_0x129c('0x15')](util['format'](_0x129c('0x17'),_0x54f8ce[_0x129c('0x6')]),_0x35e272);}};exports[_0x129c('0x1c')]=function(_0x3dece5){try{if(!_[_0x129c('0x18')](_0x3dece5['variable'])&&!_[_0x129c('0x18')](_0x3dece5['variable'][_0x129c('0x1d')])){utils['debug'](util[_0x129c('0x4')](_0x129c('0x1e'),_0x3dece5[_0x129c('0x6')]),_0x3dece5);utils[_0x129c('0x3')](util[_0x129c('0x4')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x3dece5[_0x129c('0x6')],_0x3dece5[_0x129c('0x1f')],_0x3dece5[_0x129c('0x20')]));if(_['endsWith'](_0x3dece5[_0x129c('0x20')],_0x129c('0x21'))){_0x3dece5['value']=_0x3dece5['value']['replace'](_0x129c('0x21'),_0x129c('0x22'));}if(recordings[_0x3dece5[_0x129c('0x10')]]){var _0x901905=_[_0x129c('0x23')](recordings[_0x3dece5[_0x129c('0x10')]][_0x129c('0x24')],{'value':_0x3dece5[_0x129c('0x20')]});if(_[_0x129c('0x18')](_0x901905)){recordings[_0x3dece5[_0x129c('0x10')]][_0x129c('0x24')][_0x129c('0x25')]({'value':_0x3dece5['value']});}}}}catch(_0x5ef9a9){utils[_0x129c('0x15')](util[_0x129c('0x4')]('[%s][recordings][varset]',_0x3dece5[_0x129c('0x6')]),_0x5ef9a9);}};exports[_0x129c('0x26')]=function(_0x37cfbf){try{if(!_[_0x129c('0x18')](recordings[_0x37cfbf[_0x129c('0x6')]])){utils[_0x129c('0xe')](util[_0x129c('0x4')](_0x129c('0x27'),_0x37cfbf[_0x129c('0x6')]),_0x37cfbf);utils['info'](util[_0x129c('0x4')](_0x129c('0x28'),_0x37cfbf[_0x129c('0x6')],_0x37cfbf[_0x129c('0x29')],_0x37cfbf['calleridname'],_0x37cfbf[_0x129c('0x2a')]));recordings[_0x37cfbf[_0x129c('0x6')]]['calleridnum']=_0x37cfbf[_0x129c('0x29')];recordings[_0x37cfbf[_0x129c('0x6')]]['calleridname']=_0x37cfbf[_0x129c('0x2b')];recordings[_0x37cfbf[_0x129c('0x6')]]['connectedlinenum']=_0x37cfbf[_0x129c('0x2c')];recordings[_0x37cfbf[_0x129c('0x6')]][_0x129c('0x2d')]=_0x37cfbf[_0x129c('0x2d')];if(recordings[_0x37cfbf['uniqueid']][_0x129c('0x2e')]==_0x129c('0x2f')&&recordings[_0x37cfbf['uniqueid']][_0x129c('0x7')]){recordings[_0x37cfbf['uniqueid']][_0x129c('0x2c')]=recordings[_0x37cfbf[_0x129c('0x6')]]['accountcode'];recordings[_0x37cfbf[_0x129c('0x6')]][_0x129c('0x2d')]='';}recordings[_0x37cfbf[_0x129c('0x6')]][_0x129c('0x24')][_0x129c('0x30')](function(_0xa33739){var _0x5aa1f7=_['clone'](recordings[_0x37cfbf[_0x129c('0x6')]]);_0x5aa1f7[_0x129c('0x20')]=_0xa33739['value'];writeDB(_0x5aa1f7);});delete recordings[_0x37cfbf[_0x129c('0x6')]];}}catch(_0x1675c0){utils[_0x129c('0x15')](util[_0x129c('0x4')](_0x129c('0x27'),_0x37cfbf[_0x129c('0x6')]),_0x1675c0);}};exports[_0x129c('0x31')]=function(_0x13f050){try{if(!_[_0x129c('0x18')](recordings[_0x13f050['uniqueid']])){utils['debug'](util[_0x129c('0x4')]('[%s][recordings][newexten]',_0x13f050[_0x129c('0x6')]),_0x13f050);utils[_0x129c('0x3')](util[_0x129c('0x4')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x13f050[_0x129c('0x6')],_0x13f050[_0x129c('0x32')],_0x13f050[_0x129c('0x33')]));if(_0x13f050[_0x129c('0x32')][_0x129c('0x34')]()==_0x129c('0x35')&&_[_0x129c('0x36')](_0x13f050[_0x129c('0x33')][_0x129c('0x34')](),_0x129c('0x37'))){var _0x55b25e=_0x13f050[_0x129c('0x33')][_0x129c('0x38')]('=');var _0x1740d3=_0x55b25e[0x0][_0x129c('0x39')](_0x55b25e[0x0][_0x129c('0x3a')]('(')+0x1,_0x55b25e[0x0][_0x129c('0x3a')](')'));var _0x34ede7=_0x55b25e[0x1];recordings[_0x13f050[_0x129c('0x6')]][_0x1740d3]=_0x34ede7;}}}catch(_0x5be3fb){utils[_0x129c('0x15')](util[_0x129c('0x4')](_0x129c('0x3b'),_0x13f050[_0x129c('0x6')]),_0x5be3fb);}};exports[_0x129c('0x3c')]=function(_0x4099ce){try{if(!_[_0x129c('0x18')](recordings[_0x4099ce['uniqueid']])){utils[_0x129c('0xe')](util[_0x129c('0x4')](_0x129c('0x3d'),_0x4099ce[_0x129c('0x6')]),_0x4099ce);utils[_0x129c('0x3')](util[_0x129c('0x4')](_0x129c('0x3e'),_0x4099ce[_0x129c('0x6')],_0x4099ce['queue']));recordings[_0x4099ce[_0x129c('0x6')]]['queue']=_0x4099ce[_0x129c('0x3f')];}}catch(_0x178867){utils['error'](util[_0x129c('0x4')]('[%s][recordings][queuecallerjoin]',_0x4099ce[_0x129c('0x6')]),_0x178867);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 686fa55..89616b1 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 _0x44d8=['uniqueid','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridname','blind','attendedtransfer','[%s][transfers][attendedtransfer]','origtransfereruniqueid','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfertargetchannel','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','error','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended'];(function(_0x339718,_0x3700ea){var _0x331413=function(_0x41a593){while(--_0x41a593){_0x339718['push'](_0x339718['shift']());}};_0x331413(++_0x3700ea);}(_0x44d8,0x192));var _0x844d=function(_0x46ae3a,_0x1402b6){_0x46ae3a=_0x46ae3a-0x0;var _0x1716ae=_0x44d8[_0x46ae3a];return _0x1716ae;};'use strict';var _=require(_0x844d('0x0'));var util=require(_0x844d('0x1'));var utils=require(_0x844d('0x2'));function writeDB(_0x200658){utils[_0x844d('0x3')](util[_0x844d('0x4')](_0x844d('0x5'),_0x200658[_0x844d('0x6')]===_0x844d('0x7')?_0x200658['origtransfereruniqueid']:_0x200658[_0x844d('0x8')],_0x200658[_0x844d('0x6')]));utils['request']('CreateVoiceTransferReport',_0x200658);}exports['blindtransfer']=function(_0x4d14db){try{utils[_0x844d('0x9')](util[_0x844d('0x4')](_0x844d('0xa'),_0x4d14db[_0x844d('0x8')]),_0x4d14db);utils['info'](util[_0x844d('0x4')](_0x844d('0xb'),_0x4d14db[_0x844d('0x8')],_0x4d14db[_0x844d('0xc')],_0x4d14db[_0x844d('0xd')],_0x4d14db['transfereecalleridnum'],_0x4d14db[_0x844d('0xe')]));_0x4d14db['type']=_0x844d('0xf');writeDB(_0x4d14db);}catch(_0x28282d){utils['error'](util[_0x844d('0x4')](_0x844d('0xa'),_0x4d14db[_0x844d('0x8')]),_0x28282d);}};exports[_0x844d('0x10')]=function(_0x36d1d1){try{utils[_0x844d('0x9')](util[_0x844d('0x4')](_0x844d('0x11'),_0x36d1d1[_0x844d('0x12')]),_0x36d1d1);utils[_0x844d('0x3')](util[_0x844d('0x4')](_0x844d('0x13'),_0x36d1d1[_0x844d('0x12')],_0x36d1d1[_0x844d('0x14')],_0x36d1d1['origtransferercalleridname'],_0x36d1d1[_0x844d('0x15')],_0x36d1d1[_0x844d('0x16')]));_0x36d1d1=_[_0x844d('0x17')](_0x36d1d1,{'transfererchannel':_0x36d1d1[_0x844d('0x18')],'transferercalleridnum':_0x36d1d1[_0x844d('0x14')],'transferercalleridname':_0x36d1d1[_0x844d('0x19')],'transfererconnectedlinenum':_0x36d1d1[_0x844d('0x1a')],'transfererconnectedlinename':_0x36d1d1[_0x844d('0x1b')],'transfereraccountcode':_0x36d1d1[_0x844d('0x1c')],'transferercontext':_0x36d1d1[_0x844d('0x1d')],'transfererexten':_0x36d1d1[_0x844d('0x1e')],'transfererlinkedid':_0x36d1d1[_0x844d('0x1f')],'context':_0x36d1d1[_0x844d('0x20')],'extension':_0x36d1d1[_0x844d('0x21')],'type':'attended'});if(_[_0x844d('0x22')](_0x36d1d1['transfereechannel'])){_0x36d1d1=_[_0x844d('0x17')](_0x36d1d1,{'transfereechannel':_0x36d1d1[_0x844d('0x23')],'transfereecalleridnum':_0x36d1d1[_0x844d('0x15')],'transfereecalleridname':_0x36d1d1[_0x844d('0x16')],'transfereeconnectedlinenum':_0x36d1d1['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x36d1d1[_0x844d('0x24')],'transfereeaccountcode':_0x36d1d1[_0x844d('0x25')],'transfereecontext':_0x36d1d1[_0x844d('0x26')],'transfereeexten':_0x36d1d1['transfertargetexten'],'transfereelinkedid':_0x36d1d1[_0x844d('0x27')]});}writeDB(_0x36d1d1);}catch(_0x3387a8){utils[_0x844d('0x28')](util['format'](_0x844d('0x11'),_0x36d1d1[_0x844d('0x12')]),_0x3387a8);}}; \ No newline at end of file +var _0x24ed=['transfertargetcontext','transfertargetexten','error','origtransfereruniqueid','lodash','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','uniqueid','CreateVoiceTransferReport','blindtransfer','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','blind','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','assign','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','origtransferercontext','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename'];(function(_0x8fca65,_0x1b5101){var _0x44cfbf=function(_0x352ae8){while(--_0x352ae8){_0x8fca65['push'](_0x8fca65['shift']());}};_0x44cfbf(++_0x1b5101);}(_0x24ed,0x1e4));var _0xd24e=function(_0x59bf80,_0x26d1af){_0x59bf80=_0x59bf80-0x0;var _0xbd40ab=_0x24ed[_0x59bf80];return _0xbd40ab;};'use strict';var _=require(_0xd24e('0x0'));var util=require('util');var utils=require(_0xd24e('0x1'));function writeDB(_0x161e1f){utils[_0xd24e('0x2')](util[_0xd24e('0x3')](_0xd24e('0x4'),_0x161e1f[_0xd24e('0x5')]===_0xd24e('0x6')?_0x161e1f['origtransfereruniqueid']:_0x161e1f[_0xd24e('0x7')],_0x161e1f[_0xd24e('0x5')]));utils['request'](_0xd24e('0x8'),_0x161e1f);}exports[_0xd24e('0x9')]=function(_0x201668){try{utils[_0xd24e('0xa')](util['format'](_0xd24e('0xb'),_0x201668['uniqueid']),_0x201668);utils[_0xd24e('0x2')](util[_0xd24e('0x3')](_0xd24e('0xc'),_0x201668['uniqueid'],_0x201668[_0xd24e('0xd')],_0x201668[_0xd24e('0xe')],_0x201668[_0xd24e('0xf')],_0x201668['transfereecalleridname']));_0x201668[_0xd24e('0x5')]=_0xd24e('0x10');writeDB(_0x201668);}catch(_0x10b542){utils['error'](util['format']('[%s][transfers][blindtransfer]',_0x201668[_0xd24e('0x7')]),_0x10b542);}};exports[_0xd24e('0x11')]=function(_0x4b4d46){try{utils[_0xd24e('0xa')](util[_0xd24e('0x3')](_0xd24e('0x12'),_0x4b4d46['origtransfereruniqueid']),_0x4b4d46);utils['info'](util[_0xd24e('0x3')](_0xd24e('0x13'),_0x4b4d46['origtransfereruniqueid'],_0x4b4d46[_0xd24e('0x14')],_0x4b4d46[_0xd24e('0x15')],_0x4b4d46[_0xd24e('0x16')],_0x4b4d46['transfertargetcalleridname']));_0x4b4d46=_[_0xd24e('0x17')](_0x4b4d46,{'transfererchannel':_0x4b4d46['origtransfererchannel'],'transferercalleridnum':_0x4b4d46['origtransferercalleridnum'],'transferercalleridname':_0x4b4d46[_0xd24e('0x15')],'transfererconnectedlinenum':_0x4b4d46[_0xd24e('0x18')],'transfererconnectedlinename':_0x4b4d46[_0xd24e('0x19')],'transfereraccountcode':_0x4b4d46[_0xd24e('0x1a')],'transferercontext':_0x4b4d46[_0xd24e('0x1b')],'transfererexten':_0x4b4d46['secondtransfererexten'],'transfererlinkedid':_0x4b4d46[_0xd24e('0x1c')],'context':_0x4b4d46[_0xd24e('0x1d')],'extension':_0x4b4d46['origtransfererexten'],'type':'attended'});if(_[_0xd24e('0x1e')](_0x4b4d46[_0xd24e('0x1f')])){_0x4b4d46=_[_0xd24e('0x17')](_0x4b4d46,{'transfereechannel':_0x4b4d46[_0xd24e('0x20')],'transfereecalleridnum':_0x4b4d46[_0xd24e('0x16')],'transfereecalleridname':_0x4b4d46[_0xd24e('0x21')],'transfereeconnectedlinenum':_0x4b4d46[_0xd24e('0x22')],'transfereeconnectedlinename':_0x4b4d46[_0xd24e('0x23')],'transfereeaccountcode':_0x4b4d46['transfertargetaccountcode'],'transfereecontext':_0x4b4d46[_0xd24e('0x24')],'transfereeexten':_0x4b4d46[_0xd24e('0x25')],'transfereelinkedid':_0x4b4d46['transfertargetlinkedid']});}writeDB(_0x4b4d46);}catch(_0x13658e){utils[_0xd24e('0x26')](util['format'](_0xd24e('0x12'),_0x4b4d46[_0xd24e('0x27')]),_0x13658e);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 40b173a..18621fb 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 _0x8439=['[utils][getUser]\x20where:%s','stringify','result','length','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','addTime','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','sumTime','now','isAfter','isBefore','jayson/promise','moment','util','http','../../config/logger','xdr','info','inspect','debug','error','request','then','catch','[utils][request]\x20name:%s','name','interface'];(function(_0x20bf62,_0x3af0d9){var _0x50e077=function(_0x46b7f0){while(--_0x46b7f0){_0x20bf62['push'](_0x20bf62['shift']());}};_0x50e077(++_0x3af0d9);}(_0x8439,0xf8));var _0x9843=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0x8439[_0x22b68a];return _0x1ac67a;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x9843('0x0'));var moment=require(_0x9843('0x1'));var util=require(_0x9843('0x2'));var client=jayson['client'][_0x9843('0x3')]({'port':0x2329});var logger=require(_0x9843('0x4'))(_0x9843('0x5'));exports[_0x9843('0x6')]=function(_0x1fe68c,_0x51eefe){logger[_0x9843('0x6')](_0x1fe68c,_0x51eefe?util[_0x9843('0x7')](_0x51eefe,{'showHidden':![],'depth':null}):'');};exports[_0x9843('0x8')]=function(_0x125aa1,_0x3320e6){logger[_0x9843('0x8')](_0x125aa1,_0x3320e6?util[_0x9843('0x7')](_0x3320e6,{'showHidden':![],'depth':null}):'');};exports[_0x9843('0x9')]=function(_0x5959b3,_0x2d5d2f){logger['error'](_0x5959b3,_0x2d5d2f?util[_0x9843('0x7')](_0x2d5d2f,{'showHidden':![],'depth':null}):'');};exports[_0x9843('0xa')]=function(_0x23366b,_0x41f802){return client[_0x9843('0xa')](_0x23366b,{'body':_0x41f802})[_0x9843('0xb')](function(_0x10da3d){logger['debug']('[utils][request]\x20name:%s',_0x23366b,_0x10da3d?util[_0x9843('0x7')](_0x10da3d,{'showHidden':![],'depth':null}):'');})[_0x9843('0xc')](function(_0x1b123a){logger[_0x9843('0x9')](_0x9843('0xd'),_0x23366b,_0x1b123a?util['inspect'](_0x1b123a,{'showHidden':![],'depth':null}):'');});};function getUser(_0x13c1bd){return client['request']('GetUser',{'options':{'raw':!![],'attributes':['id','internal',_0x9843('0xe'),_0x9843('0xf')],'where':_0x13c1bd,'limit':0x1}})[_0x9843('0xb')](function(_0x1c9bc0){logger[_0x9843('0x8')](_0x9843('0x10'),JSON[_0x9843('0x11')](_0x13c1bd),_0x1c9bc0?util['inspect'](_0x1c9bc0,{'showHidden':![],'depth':null}):'');return _0x1c9bc0[_0x9843('0x12')][_0x9843('0x13')]?_0x1c9bc0[_0x9843('0x12')][0x0]:null;});}exports['getUserByInternal']=function(_0x360498){return new BPromise(function(_0x1b89e3,_0x113fb1){if(_0x360498){return getUser({'internal':_0x360498})[_0x9843('0xb')](function(_0x10e355){logger['info']('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x360498,_0x10e355?_0x9843('0x14'):_0x9843('0x15'));return _0x1b89e3(_0x10e355);})[_0x9843('0xc')](function(_0x1aed29){logger['error'](_0x9843('0x16'),_0x1aed29?util[_0x9843('0x7')](_0x1aed29,{'showHidden':![],'depth':null}):'');return _0x1b89e3(null);});}return _0x1b89e3(null);});};exports[_0x9843('0x17')]=function(_0x59519b){return new BPromise(function(_0x397e24,_0x57b9dc){if(_0x59519b){return getUser({'interface':_0x59519b})[_0x9843('0xb')](function(_0x440e16){logger[_0x9843('0x6')](_0x9843('0x18'),_0x59519b,_0x440e16?_0x9843('0x14'):'notfound');return _0x397e24(_0x440e16);})[_0x9843('0xc')](function(_0x5cb958){logger[_0x9843('0x9')](_0x9843('0x19'),_0x5cb958?util['inspect'](_0x5cb958,{'showHidden':![],'depth':null}):'');return _0x397e24(null);});}return _0x397e24(null);});};exports['getUserByName']=function(_0x423f22){return new BPromise(function(_0x564f99,_0x56457a){if(_0x423f22){return getUser({'name':_0x423f22})[_0x9843('0xb')](function(_0x525082){logger['info'](_0x9843('0x1a'),_0x423f22,_0x525082?_0x9843('0x14'):_0x9843('0x15'));return _0x564f99(_0x525082);})[_0x9843('0xc')](function(_0x29486d){logger['error'](_0x9843('0x1b'),_0x29486d?util['inspect'](_0x29486d,{'showHidden':![],'depth':null}):'');return _0x564f99(null);});}return _0x564f99(null);});};exports[_0x9843('0x1c')]=function(_0x44f88f){return new BPromise(function(_0x20fb59,_0x476cd1){if(_0x44f88f){return client[_0x9843('0xa')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0x9843('0xe'),'type','acw',_0x9843('0x1d')],'where':{'name':_0x44f88f},'limit':0x1}})[_0x9843('0xb')](function(_0x42964a){logger['debug'](_0x9843('0x1e'),_0x44f88f,_0x42964a?util[_0x9843('0x7')](_0x42964a,{'showHidden':![],'depth':null}):'');logger[_0x9843('0x6')](_0x9843('0x1f'),_0x44f88f,_0x42964a?_0x9843('0x14'):_0x9843('0x15'));return _0x20fb59(_0x42964a[_0x9843('0x12')][_0x9843('0x13')]?_0x42964a['result'][0x0]:null);})['catch'](function(_0x150f8d){logger[_0x9843('0x9')]('[utils][getVoiceQueueByName]',_0x150f8d?util[_0x9843('0x7')](_0x150f8d,{'showHidden':![],'depth':null}):'');return _0x20fb59(null);});}return _0x20fb59(null);});};exports[_0x9843('0x20')]=function(_0x1ddcff,_0x3b5fb8){return moment(_0x1ddcff)['add'](_0x3b5fb8,_0x9843('0x21'))[_0x9843('0x22')](_0x9843('0x23'));};exports[_0x9843('0x24')]=function(_0xbfdf41,_0x33339d){return moment(_0xbfdf41)[_0x9843('0x25')](_0x33339d,_0x9843('0x21'))[_0x9843('0x22')](_0x9843('0x23'));};exports[_0x9843('0x26')]=function(_0x44f175,_0x4a6ea8){return moment(_0x44f175)[_0x9843('0x27')](moment(_0x4a6ea8),_0x9843('0x21'));};exports[_0x9843('0x28')]=function(_0x57a50a,_0x11c5d8){return parseInt(_0x57a50a,0xa)+parseInt(_0x11c5d8,0xa);};exports[_0x9843('0x29')]=function(){return moment()[_0x9843('0x22')](_0x9843('0x23'));};exports[_0x9843('0x2a')]=function(_0x2c7fe9,_0x580a6e){if(_0x580a6e){return moment(_0x2c7fe9)[_0x9843('0x2a')](_0x580a6e);}return!![];};exports[_0x9843('0x2b')]=function(_0x5063e4,_0x3b3374){if(_0x3b3374){return moment(_0x5063e4)['isBefore'](_0x3b3374);}else if(_0x5063e4){return!![];}return![];}; \ No newline at end of file +var _0xaadc=['catch','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','notfound','[utils][getUserByInterface]','[utils][getUserByName]\x20name:%s\x20%s','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','seconds','diffTime','diff','sumTime','now','isAfter','isBefore','jayson/promise','client','http','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found'];(function(_0x12cd8c,_0x21da4e){var _0x3827b9=function(_0x34266d){while(--_0x34266d){_0x12cd8c['push'](_0x12cd8c['shift']());}};_0x3827b9(++_0x21da4e);}(_0xaadc,0x134));var _0xcaad=function(_0x382cc3,_0x5489f1){_0x382cc3=_0x382cc3-0x0;var _0x4da9bb=_0xaadc[_0x382cc3];return _0x4da9bb;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xcaad('0x0'));var moment=require('moment');var util=require('util');var client=jayson[_0xcaad('0x1')][_0xcaad('0x2')]({'port':0x2329});var logger=require('../../config/logger')(_0xcaad('0x3'));exports[_0xcaad('0x4')]=function(_0x16de36,_0x437126){logger[_0xcaad('0x4')](_0x16de36,_0x437126?util[_0xcaad('0x5')](_0x437126,{'showHidden':![],'depth':null}):'');};exports[_0xcaad('0x6')]=function(_0x2e156d,_0x444a08){logger[_0xcaad('0x6')](_0x2e156d,_0x444a08?util['inspect'](_0x444a08,{'showHidden':![],'depth':null}):'');};exports[_0xcaad('0x7')]=function(_0x3e7bc9,_0x1e7933){logger[_0xcaad('0x7')](_0x3e7bc9,_0x1e7933?util[_0xcaad('0x5')](_0x1e7933,{'showHidden':![],'depth':null}):'');};exports[_0xcaad('0x8')]=function(_0x2219c1,_0x48932d){return client[_0xcaad('0x8')](_0x2219c1,{'body':_0x48932d})[_0xcaad('0x9')](function(_0x50004a){logger['debug'](_0xcaad('0xa'),_0x2219c1,_0x50004a?util['inspect'](_0x50004a,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x156d0b){logger['error']('[utils][request]\x20name:%s',_0x2219c1,_0x156d0b?util[_0xcaad('0x5')](_0x156d0b,{'showHidden':![],'depth':null}):'');});};function getUser(_0x5e9646){return client[_0xcaad('0x8')](_0xcaad('0xb'),{'options':{'raw':!![],'attributes':['id',_0xcaad('0xc'),_0xcaad('0xd'),_0xcaad('0xe')],'where':_0x5e9646,'limit':0x1}})[_0xcaad('0x9')](function(_0x26e6b2){logger[_0xcaad('0x6')](_0xcaad('0xf'),JSON['stringify'](_0x5e9646),_0x26e6b2?util['inspect'](_0x26e6b2,{'showHidden':![],'depth':null}):'');return _0x26e6b2[_0xcaad('0x10')][_0xcaad('0x11')]?_0x26e6b2[_0xcaad('0x10')][0x0]:null;});}exports[_0xcaad('0x12')]=function(_0x34f82f){return new BPromise(function(_0x4730c7,_0x16f530){if(_0x34f82f){return getUser({'internal':_0x34f82f})['then'](function(_0x5af0ff){logger[_0xcaad('0x4')](_0xcaad('0x13'),_0x34f82f,_0x5af0ff?_0xcaad('0x14'):'notfound');return _0x4730c7(_0x5af0ff);})[_0xcaad('0x15')](function(_0x449b1b){logger['error'](_0xcaad('0x16'),_0x449b1b?util[_0xcaad('0x5')](_0x449b1b,{'showHidden':![],'depth':null}):'');return _0x4730c7(null);});}return _0x4730c7(null);});};exports[_0xcaad('0x17')]=function(_0x33887d){return new BPromise(function(_0x48862c,_0x5339f0){if(_0x33887d){return getUser({'interface':_0x33887d})[_0xcaad('0x9')](function(_0x5c35e0){logger[_0xcaad('0x4')](_0xcaad('0x18'),_0x33887d,_0x5c35e0?_0xcaad('0x14'):_0xcaad('0x19'));return _0x48862c(_0x5c35e0);})[_0xcaad('0x15')](function(_0x48b7e7){logger['error'](_0xcaad('0x1a'),_0x48b7e7?util[_0xcaad('0x5')](_0x48b7e7,{'showHidden':![],'depth':null}):'');return _0x48862c(null);});}return _0x48862c(null);});};exports['getUserByName']=function(_0x247b7c){return new BPromise(function(_0x15b246,_0x3990f4){if(_0x247b7c){return getUser({'name':_0x247b7c})[_0xcaad('0x9')](function(_0x1b7cb9){logger['info'](_0xcaad('0x1b'),_0x247b7c,_0x1b7cb9?'found':_0xcaad('0x19'));return _0x15b246(_0x1b7cb9);})['catch'](function(_0x149943){logger[_0xcaad('0x7')]('[utils][getUserByName]',_0x149943?util['inspect'](_0x149943,{'showHidden':![],'depth':null}):'');return _0x15b246(null);});}return _0x15b246(null);});};exports[_0xcaad('0x1c')]=function(_0x2620eb){return new BPromise(function(_0x34dbfa,_0x19c156){if(_0x2620eb){return client[_0xcaad('0x8')](_0xcaad('0x1d'),{'options':{'raw':!![],'attributes':['id','name',_0xcaad('0x1e'),_0xcaad('0x1f'),_0xcaad('0x20')],'where':{'name':_0x2620eb},'limit':0x1}})['then'](function(_0x1b2140){logger[_0xcaad('0x6')](_0xcaad('0x21'),_0x2620eb,_0x1b2140?util['inspect'](_0x1b2140,{'showHidden':![],'depth':null}):'');logger[_0xcaad('0x4')](_0xcaad('0x22'),_0x2620eb,_0x1b2140?_0xcaad('0x14'):_0xcaad('0x19'));return _0x34dbfa(_0x1b2140[_0xcaad('0x10')]['length']?_0x1b2140['result'][0x0]:null);})['catch'](function(_0x2234e2){logger[_0xcaad('0x7')](_0xcaad('0x23'),_0x2234e2?util[_0xcaad('0x5')](_0x2234e2,{'showHidden':![],'depth':null}):'');return _0x34dbfa(null);});}return _0x34dbfa(null);});};exports[_0xcaad('0x24')]=function(_0x303425,_0x36a796){return moment(_0x303425)['add'](_0x36a796,'seconds')[_0xcaad('0x25')](_0xcaad('0x26'));};exports[_0xcaad('0x27')]=function(_0x2b981b,_0x52069c){return moment(_0x2b981b)['subtract'](_0x52069c,_0xcaad('0x28'))[_0xcaad('0x25')](_0xcaad('0x26'));};exports[_0xcaad('0x29')]=function(_0x252d20,_0x5760dd){return moment(_0x252d20)[_0xcaad('0x2a')](moment(_0x5760dd),_0xcaad('0x28'));};exports[_0xcaad('0x2b')]=function(_0x145610,_0x13c976){return parseInt(_0x145610,0xa)+parseInt(_0x13c976,0xa);};exports[_0xcaad('0x2c')]=function(){return moment()[_0xcaad('0x25')](_0xcaad('0x26'));};exports[_0xcaad('0x2d')]=function(_0x55ae70,_0x2badb7){if(_0x2badb7){return moment(_0x55ae70)[_0xcaad('0x2d')](_0x2badb7);}return!![];};exports[_0xcaad('0x2e')]=function(_0x309717,_0x4dfe0b){if(_0x4dfe0b){return moment(_0x309717)['isBefore'](_0x4dfe0b);}else if(_0x309717){return!![];}return![];}; \ No newline at end of file diff --git a/server/utils/client-side-logger.js b/server/utils/client-side-logger.js index ed73b8d..2d75f97 100644 --- a/server/utils/client-side-logger.js +++ b/server/utils/client-side-logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x17b4=['util','./loggers','fileLogger','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','/var','log','xcally','role','ensureDir','then','catch','user','no-user','data','timestamp','client','error','api','set','client-side-logger','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','\x20body=%s','body','format','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','name','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','method','other','agent_name','test','setupLoggers','lodash','express-winston','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x17b4,0x14d));var _0x417b=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x17b4[_0x5d2803];return _0xdcad2c;};var fs=require('fs-extra');var _=require(_0x417b('0x0'));var ewinston=require(_0x417b('0x1'));var path=require(_0x417b('0x2'));var util=require(_0x417b('0x3'));var fileLogger=require(_0x417b('0x4'))[_0x417b('0x5')];var safeTemplate=require('./safe-template')[_0x417b('0x6')];var maskSensitiveData=require(_0x417b('0x7'))[_0x417b('0x8')];function ClientSideLogger(){function _0x21af72(_0x1501c4){var _0x415af4=path[_0x417b('0x9')](_0x417b('0xa'),_0x417b('0xb'),_0x417b('0xc'));var _0x5a5208=path['join']('client',_0x1501c4[_0x417b('0xd')]+'-'+_0x1501c4['name']);return fs[_0x417b('0xe')](path['join'](_0x415af4,_0x5a5208))[_0x417b('0xf')](function(){var _0x2c1005=fileLogger('client',path[_0x417b('0x9')](_0x415af4,_0x5a5208));return _0x2c1005;})[_0x417b('0x10')](function(_0x1470ba){throw _0x1470ba;});}this[_0x417b('0xb')]=function(_0x293ff1,_0x9b58c6,_0x54d82a,_0x28ebcf){return _0x21af72(_0x293ff1[_0x417b('0x11')])[_0x417b('0xf')](function(_0x361b98){var _0x48af3c=_0x361b98[_0x9b58c6];return _0x48af3c;})[_0x417b('0xf')](function(_0x2b4649){var _0x3b1815=_0x293ff1[_0x417b('0x11')]?_0x293ff1[_0x417b('0x11')]['id']:_0x417b('0x12');var _0x244cc0=_0x28ebcf[_0x417b('0x13')];var _0x2a9ad0=_0x28ebcf[_0x417b('0x14')];var _0x1fb3c3=new Date(Number(_0x2a9ad0));return _0x2b4649(_0x3b1815,_0x1fb3c3,_0x54d82a,_0x244cc0);})[_0x417b('0x10')](function(_0x3caa14){fileLogger(_0x417b('0x15'))[_0x417b('0x16')](_0x3caa14);});};}function setupLoggers(_0x51c5af){return new Promise(function(_0x331e02){var _0x2c35e7=new ClientSideLogger();var _0x3d11e5=fileLogger(_0x417b('0x17'));var _0x3eac78=fileLogger('auth');_0x51c5af[_0x417b('0x18')](_0x417b('0x19'),_0x2c35e7);_0x51c5af[_0x417b('0x1a')](ewinston['logger']({'winstonInstance':_0x3d11e5,'meta':![],'statusLevels':!![],'msg':function(_0x22ead4,_0x34c3be){var _0x393c55=_0x417b('0x1b');if(!_[_0x417b('0x1c')](_0x22ead4['body'])){_0x393c55+=_0x417b('0x1d');var _0x2a7abc=_0x22ead4[_0x417b('0x1e')];maskSensitiveData(_0x2a7abc);}return safeTemplate(util[_0x417b('0x1f')](_0x393c55,_0x22ead4['method'],_0x22ead4[_0x417b('0x20')][_0x417b('0x21')]?_0x22ead4['headers'][_0x417b('0x21')]:_0x22ead4[_0x417b('0x22')][_0x417b('0x23')]||_0x22ead4['ip'],_0x22ead4[_0x417b('0x24')],_0x34c3be[_0x417b('0x25')],_0x34c3be[_0x417b('0x26')],_0x22ead4[_0x417b('0x11')]?_0x22ead4[_0x417b('0x11')]['id']:null,_0x22ead4[_0x417b('0x11')]?_0x22ead4[_0x417b('0x11')][_0x417b('0x27')]:null,_0x22ead4[_0x417b('0x11')]?_0x22ead4[_0x417b('0x11')][_0x417b('0xd')]:null,_0x2a7abc?util['inspect'](_0x2a7abc,![],null):''));}}));_0x51c5af[_0x417b('0x1a')](ewinston['logger']({'winstonInstance':_0x3eac78,'meta':![],'statusLevels':!![],'msg':function(_0x568ed0,_0x4d5fd4){var _0x246579=_0x417b('0x28');if(_0x568ed0[_0x417b('0x1e')]&&_0x568ed0['body'][_0x417b('0x29')]&&_0x568ed0['body'][_0x417b('0x2a')]){_0x246579='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0x417b('0x1f')](_0x246579,_0x568ed0[_0x417b('0x2b')],_0x568ed0[_0x417b('0x20')]['x-forwarded-for']?_0x568ed0[_0x417b('0x20')][_0x417b('0x21')]:_0x568ed0[_0x417b('0x22')]['remoteAddress']||_0x568ed0['ip'],_0x568ed0['url'],_0x4d5fd4[_0x417b('0x25')],_0x4d5fd4[_0x417b('0x26')],_0x568ed0[_0x417b('0x11')]?_0x568ed0[_0x417b('0x11')]['id']:null,_0x568ed0[_0x417b('0x11')]?_0x568ed0['user'][_0x417b('0x27')]:null,_0x568ed0[_0x417b('0x11')]?_0x568ed0[_0x417b('0x11')][_0x417b('0xd')]:null,_0x568ed0[_0x417b('0x1e')]&&_0x568ed0['body']['device']?_0x568ed0[_0x417b('0x1e')]['device']:_0x417b('0x2c'),_0x568ed0[_0x417b('0x1e')]&&_0x568ed0['body'][_0x417b('0x2a')]?_0x568ed0['body'][_0x417b('0x2a')]:'',_0x568ed0['body']&&_0x568ed0[_0x417b('0x1e')][_0x417b('0x2d')]?_0x568ed0[_0x417b('0x1e')][_0x417b('0x2d')]:'');},'ignoreRoute':function(_0x4f3dca){var _0x41e554=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x41e554[_0x417b('0x2e')](_0x4f3dca[_0x417b('0x24')]);}}));return _0x331e02();});}exports[_0x417b('0x2f')]=setupLoggers; \ No newline at end of file +var _0x3a6a=['ensureDir','then','catch','user','data','timestamp','error','api','auth','set','client-side-logger','use','logger','body','\x20body=%s','format','method','x-forwarded-for','headers','responseTime','role','%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)','connection','url','statusCode','device','other','agent_name','test','fs-extra','lodash','express-winston','path','util','fileLogger','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','/var','log','client','name'];(function(_0x3e9bf7,_0x4305df){var _0x5769bf=function(_0x489093){while(--_0x489093){_0x3e9bf7['push'](_0x3e9bf7['shift']());}};_0x5769bf(++_0x4305df);}(_0x3a6a,0x15a));var _0xa3a6=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x3a6a[_0xa464c9];return _0x3d73c4;};var fs=require(_0xa3a6('0x0'));var _=require(_0xa3a6('0x1'));var ewinston=require(_0xa3a6('0x2'));var path=require(_0xa3a6('0x3'));var util=require(_0xa3a6('0x4'));var fileLogger=require('./loggers')[_0xa3a6('0x5')];var safeTemplate=require('./safe-template')[_0xa3a6('0x6')];var maskSensitiveData=require(_0xa3a6('0x7'))[_0xa3a6('0x8')];function ClientSideLogger(){function _0x169f46(_0x36f666){var _0x36bad6=path[_0xa3a6('0x9')](_0xa3a6('0xa'),_0xa3a6('0xb'),'xcally');var _0x3b8bc8=path[_0xa3a6('0x9')](_0xa3a6('0xc'),_0x36f666['role']+'-'+_0x36f666[_0xa3a6('0xd')]);return fs[_0xa3a6('0xe')](path[_0xa3a6('0x9')](_0x36bad6,_0x3b8bc8))[_0xa3a6('0xf')](function(){var _0x33eba7=fileLogger(_0xa3a6('0xc'),path[_0xa3a6('0x9')](_0x36bad6,_0x3b8bc8));return _0x33eba7;})[_0xa3a6('0x10')](function(_0x45f3ff){throw _0x45f3ff;});}this[_0xa3a6('0xb')]=function(_0x2548bc,_0xf4a8b1,_0x29e0ec,_0xe13b91){return _0x169f46(_0x2548bc[_0xa3a6('0x11')])[_0xa3a6('0xf')](function(_0x302800){var _0x2d8cd5=_0x302800[_0xf4a8b1];return _0x2d8cd5;})['then'](function(_0x2dbdf5){var _0x310e8f=_0x2548bc['user']?_0x2548bc[_0xa3a6('0x11')]['id']:'no-user';var _0x34808a=_0xe13b91[_0xa3a6('0x12')];var _0x28a8ef=_0xe13b91[_0xa3a6('0x13')];var _0x1b88d5=new Date(Number(_0x28a8ef));return _0x2dbdf5(_0x310e8f,_0x1b88d5,_0x29e0ec,_0x34808a);})['catch'](function(_0x5b1249){fileLogger(_0xa3a6('0xc'))[_0xa3a6('0x14')](_0x5b1249);});};}function setupLoggers(_0x1f76a1){return new Promise(function(_0x359222){var _0x3f9d03=new ClientSideLogger();var _0x361d5e=fileLogger(_0xa3a6('0x15'));var _0x5ab3ee=fileLogger(_0xa3a6('0x16'));_0x1f76a1[_0xa3a6('0x17')](_0xa3a6('0x18'),_0x3f9d03);_0x1f76a1[_0xa3a6('0x19')](ewinston[_0xa3a6('0x1a')]({'winstonInstance':_0x361d5e,'meta':![],'statusLevels':!![],'msg':function(_0x3cd540,_0x5c73f0){var _0x3cabf4='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_['isEmpty'](_0x3cd540[_0xa3a6('0x1b')])){_0x3cabf4+=_0xa3a6('0x1c');var _0x5cdd8f=_0x3cd540[_0xa3a6('0x1b')];maskSensitiveData(_0x5cdd8f);}return safeTemplate(util[_0xa3a6('0x1d')](_0x3cabf4,_0x3cd540[_0xa3a6('0x1e')],_0x3cd540['headers'][_0xa3a6('0x1f')]?_0x3cd540[_0xa3a6('0x20')][_0xa3a6('0x1f')]:_0x3cd540['connection']['remoteAddress']||_0x3cd540['ip'],_0x3cd540['url'],_0x5c73f0['statusCode'],_0x5c73f0[_0xa3a6('0x21')],_0x3cd540[_0xa3a6('0x11')]?_0x3cd540[_0xa3a6('0x11')]['id']:null,_0x3cd540[_0xa3a6('0x11')]?_0x3cd540[_0xa3a6('0x11')]['name']:null,_0x3cd540[_0xa3a6('0x11')]?_0x3cd540[_0xa3a6('0x11')][_0xa3a6('0x22')]:null,_0x5cdd8f?util['inspect'](_0x5cdd8f,![],null):''));}}));_0x1f76a1['use'](ewinston[_0xa3a6('0x1a')]({'winstonInstance':_0x5ab3ee,'meta':![],'statusLevels':!![],'msg':function(_0x1bec47,_0xd1e196){var _0x29fa6a=_0xa3a6('0x23');if(_0x1bec47[_0xa3a6('0x1b')]&&_0x1bec47['body']['device']&&_0x1bec47['body'][_0xa3a6('0x24')]){_0x29fa6a=_0xa3a6('0x25');}return util[_0xa3a6('0x1d')](_0x29fa6a,_0x1bec47[_0xa3a6('0x1e')],_0x1bec47[_0xa3a6('0x20')][_0xa3a6('0x1f')]?_0x1bec47[_0xa3a6('0x20')]['x-forwarded-for']:_0x1bec47[_0xa3a6('0x26')]['remoteAddress']||_0x1bec47['ip'],_0x1bec47[_0xa3a6('0x27')],_0xd1e196[_0xa3a6('0x28')],_0xd1e196[_0xa3a6('0x21')],_0x1bec47[_0xa3a6('0x11')]?_0x1bec47[_0xa3a6('0x11')]['id']:null,_0x1bec47[_0xa3a6('0x11')]?_0x1bec47[_0xa3a6('0x11')][_0xa3a6('0xd')]:null,_0x1bec47['user']?_0x1bec47[_0xa3a6('0x11')][_0xa3a6('0x22')]:null,_0x1bec47[_0xa3a6('0x1b')]&&_0x1bec47[_0xa3a6('0x1b')]['device']?_0x1bec47['body'][_0xa3a6('0x29')]:_0xa3a6('0x2a'),_0x1bec47['body']&&_0x1bec47[_0xa3a6('0x1b')][_0xa3a6('0x24')]?_0x1bec47[_0xa3a6('0x1b')][_0xa3a6('0x24')]:'',_0x1bec47[_0xa3a6('0x1b')]&&_0x1bec47['body'][_0xa3a6('0x2b')]?_0x1bec47[_0xa3a6('0x1b')][_0xa3a6('0x2b')]:'');},'ignoreRoute':function(_0x503056){var _0x184af5=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x184af5[_0xa3a6('0x2c')](_0x503056['url']);}}));return _0x359222();});}exports['setupLoggers']=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index 1223dc6..680fb3b 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0ef8=['iftime','map','source','join','Interval\x20string\x20not\x20valid','split','weekdaysShort','toLowerCase','locale','indexOf','slice','concat','exports','monthsShort','clone','minutes','hours','isBefore','endOf','day','isBetween','timeCompare','ddd','max','min','includes','monthCompare','guess','test','isMoment','padStart','length'];(function(_0x31766c,_0x1cd917){var _0x4a19c5=function(_0x2a2343){while(--_0x2a2343){_0x31766c['push'](_0x31766c['shift']());}};_0x4a19c5(++_0x1cd917);}(_0x0ef8,0x121));var _0x80ef=function(_0x5bce54,_0x47a5c9){_0x5bce54=_0x5bce54-0x0;var _0x4ecd0c=_0x0ef8[_0x5bce54];return _0x4ecd0c;};var _=require('lodash');var moment=require('moment-timezone');var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0x80ef('0x0')](function(_0x293c5f){return _0x293c5f[_0x80ef('0x1')];})[_0x80ef('0x2')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x80ef('0x3');var EINVALID_DATE='Date\x20not\x20valid';function throwIfDateNotValid(_0x32aa3d){if(!_0x32aa3d['isValid']()){throw new Error(EINVALID_DATE);}}function extractTime(_0x367ff6){var _0x2037ed=_0x367ff6[_0x80ef('0x4')](':')[_0x80ef('0x0')](function(_0x3735e3){return parseInt(_0x3735e3,0xa);});var _0x5d5deb=_0x2037ed[0x0];var _0x6c1b69=_0x2037ed[0x1];if(_0x5d5deb<0x0||_0x5d5deb>0x17||_0x6c1b69<0x0||_0x6c1b69>0x3b){throw new Error(EINVALID_DATE);}return[_0x5d5deb,_0x6c1b69];}function circularDoWInterval(_0x4e0ebe,_0x4ea55c){if(_0x4e0ebe===_0x4ea55c){return[_0x4e0ebe];}else{var _0x25918e=moment['locale']();moment['locale']('en');var _0x307999=moment[_0x80ef('0x5')]()[_0x80ef('0x0')](function(_0x2d1eee){return _0x2d1eee[_0x80ef('0x6')]();});moment[_0x80ef('0x7')](_0x25918e);var _0x285378=_0x307999[_0x80ef('0x8')](_0x4e0ebe);var _0x3425e7=_0x307999[_0x80ef('0x8')](_0x4ea55c);if(_0x3425e7>_0x285378){return _0x307999[_0x80ef('0x9')](_0x285378,_0x3425e7+0x1);}else{var _0x20e6a1=_0x307999[_0x80ef('0x9')](0x0,_0x3425e7+0x1);var _0x4e0072=_0x307999[_0x80ef('0x9')](_0x285378);return _0x4e0072[_0x80ef('0xa')](_0x20e6a1);}}}module[_0x80ef('0xb')]['circularDoWInterval']=circularDoWInterval;function circularMonthInterval(_0x22c6c8,_0x17b0de){if(_0x22c6c8===_0x17b0de){return[_0x22c6c8];}else{var _0x17926b=moment[_0x80ef('0x7')]();moment[_0x80ef('0x7')]('en');var _0x3051bc=moment[_0x80ef('0xc')]()['map'](function(_0xb74979){return _0xb74979[_0x80ef('0x6')]();});moment[_0x80ef('0x7')](_0x17926b);var _0x49a52e=_0x3051bc[_0x80ef('0x8')](_0x22c6c8);var _0x1fdfd9=_0x3051bc['indexOf'](_0x17b0de);if(_0x1fdfd9>_0x49a52e){return _0x3051bc[_0x80ef('0x9')](_0x49a52e,_0x1fdfd9+0x1);}else{var _0x202a1e=_0x3051bc[_0x80ef('0x9')](0x0,_0x1fdfd9+0x1);var _0x5afa6b=_0x3051bc[_0x80ef('0x9')](_0x49a52e);return _0x5afa6b[_0x80ef('0xa')](_0x202a1e);}}}module[_0x80ef('0xb')]['circularMonthInterval']=circularMonthInterval;function parseDom(_0x1d7779){var _0x441a2c=parseInt(_0x1d7779,0xa);if(_0x441a2c<0x1||_0x441a2c>0x1f){throw new Error(EINVALID_DATE);}return _0x441a2c;}function timeCompare(_0x408a28,_0x1dbf94,_0x32875f){var _0x3b8dea=_0x408a28[_0x80ef('0xd')]();var _0x452cb0=extractTime(_0x1dbf94);var _0x27edb3=_0x452cb0[0x0];var _0x2b4ce7=_0x452cb0[0x1];var _0x1b3fa6=_0x408a28[_0x80ef('0xd')]()['hours'](_0x27edb3)[_0x80ef('0xe')](_0x2b4ce7);throwIfDateNotValid(_0x1b3fa6);var _0x24b398=extractTime(_0x32875f);var _0x4476a0=_0x24b398[0x0];var _0x532880=_0x24b398[0x1];var _0x3b9a0c=_0x408a28[_0x80ef('0xd')]()[_0x80ef('0xf')](_0x4476a0)['minutes'](_0x532880);throwIfDateNotValid(_0x3b9a0c);if(_0x3b9a0c[_0x80ef('0x10')](_0x1b3fa6)){var _0x4f61bd=_0x3b8dea[_0x80ef('0xd')]()['startOf']('day');var _0x5185b0=_0x3b8dea[_0x80ef('0xd')]()[_0x80ef('0x11')](_0x80ef('0x12'));return _0x3b8dea[_0x80ef('0x13')](_0x1b3fa6,_0x5185b0,undefined,'[]')||_0x3b8dea['isBetween'](_0x4f61bd,_0x3b9a0c,undefined,'[]');}else{return _0x3b8dea['isBetween'](_0x1b3fa6,_0x3b9a0c,undefined,'[]');}}module[_0x80ef('0xb')][_0x80ef('0x14')]=timeCompare;function dowCompare(_0x58bcc0,_0x5f1d2e,_0x3be0d1){var _0x33d649=_0x58bcc0[_0x80ef('0x7')]('en')['format'](_0x80ef('0x15'))[_0x80ef('0x6')]();return circularDoWInterval(_0x5f1d2e,_0x3be0d1)['includes'](_0x33d649);}module[_0x80ef('0xb')]['dowCompare']=dowCompare;function domCompare(_0x48830c,_0x218d7d,_0x258030){var _0xe89527=_0x48830c['date']();if(_0x218d7d===_0x258030){return _0xe89527===_0x218d7d;}else{var _0x296e9f=_0x48830c['daysInMonth']();var _0x3d1843=_0x218d7d<_0x258030;let _0x362e72=![];var _0x21219f=0x0;var _0x49812e=0x0;if(_0x3d1843){_0x21219f=Math[_0x80ef('0x16')](0x1,_0x218d7d);_0x49812e=Math[_0x80ef('0x17')](_0x258030,_0x296e9f);_0x362e72=_0xe89527>=_0x21219f&&_0xe89527<=_0x49812e;}else{_0x21219f=Math['min'](_0x218d7d,_0x296e9f);_0x49812e=Math[_0x80ef('0x16')](0x1,_0x258030);_0x362e72=_0xe89527>=_0x21219f||_0xe89527<=_0x49812e;}return _0x362e72;}}module[_0x80ef('0xb')]['domCompare']=domCompare;function monthCompare(_0x28efca,_0x39dc6e,_0x53e997){var _0x23aed8=_0x28efca['locale']('en')['format']('MMM')['toLowerCase']();return circularMonthInterval(_0x39dc6e,_0x53e997)[_0x80ef('0x18')](_0x23aed8);}module[_0x80ef('0xb')][_0x80ef('0x19')]=monthCompare;function iftime(_0x1d0f25,_0x1c12e0=moment['tz'][_0x80ef('0x1a')](),_0x33b842=moment()){if(!validateRx[_0x80ef('0x1b')](_0x1d0f25)){throw new Error(EINVALID_STRING);}else{var _0x4e660d=(moment[_0x80ef('0x1c')](_0x33b842)?_0x33b842[_0x80ef('0xd')]():moment(_0x33b842))['tz'](_0x1c12e0)[_0x80ef('0x7')]('en');throwIfDateNotValid(_0x4e660d);var _0x8e5bea=_0x1d0f25[_0x80ef('0x4')](',');var _0x337b78=_0x8e5bea[0x0];var _0x3fe9c5=_0x8e5bea[0x1];var _0x1ef746=_0x8e5bea[0x2];var _0x259ebb=_0x8e5bea[0x3];let _0x2dd92c=!![];if(_0x337b78!=='*'){var _0x444356=_0x337b78[_0x80ef('0x4')]('-');var _0x2355d3=_[_0x80ef('0x1d')](_0x444356[0x0],0x5,'0');var _0x3ce815=_0x444356[_0x80ef('0x1e')]===0x2?_[_0x80ef('0x1d')](_0x444356[0x1],0x5,'0'):_0x2355d3;_0x2dd92c=timeCompare(_0x4e660d,_0x2355d3,_0x3ce815);}let _0x3f1019=!![];if(_0x3fe9c5!=='*'){var _0x9a4352=_0x3fe9c5[_0x80ef('0x4')]('-');var _0x550432=_0x9a4352[0x0];var _0x46bc96=_0x9a4352[_0x80ef('0x1e')]===0x2?_0x9a4352[0x1]:_0x550432;_0x3f1019=dowCompare(_0x4e660d,_0x550432,_0x46bc96);}let _0x21fde5=!![];if(_0x1ef746!=='*'){var _0x518f76=_0x1ef746[_0x80ef('0x4')]('-');var _0x2579c8=parseDom(_0x518f76[0x0]);var _0x521c6d=_0x518f76['length']===0x2?parseDom(_0x518f76[0x1]):_0x2579c8;_0x21fde5=domCompare(_0x4e660d,_0x2579c8,_0x521c6d);}let _0x28c788=!![];if(_0x259ebb!=='*'){var _0x877e3e=_0x259ebb[_0x80ef('0x4')]('-');var _0x39ab76=_0x877e3e[0x0];var _0x3e4210=_0x877e3e[_0x80ef('0x1e')]===0x2?_0x877e3e[0x1]:_0x877e3e[0x0];_0x28c788=monthCompare(_0x4e660d,_0x39ab76,_0x3e4210);}return _0x2dd92c&&_0x3f1019&&_0x21fde5&&_0x28c788;}}module[_0x80ef('0xb')][_0x80ef('0x1f')]=iftime; \ No newline at end of file +var _0x62aa=['min','domCompare','MMM','monthCompare','guess','test','isMoment','padStart','length','lodash','moment-timezone','map','source','Date\x20not\x20valid','isValid','split','locale','weekdaysShort','toLowerCase','indexOf','slice','exports','circularDoWInterval','concat','clone','hours','minutes','isBefore','startOf','day','endOf','isBetween','timeCompare','format','includes','dowCompare','date','daysInMonth','max'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x62aa,0x11a));var _0xa62a=function(_0x829915,_0x141db6){_0x829915=_0x829915-0x0;var _0xdb692b=_0x62aa[_0x829915];return _0xdb692b;};var _=require(_0xa62a('0x0'));var moment=require(_0xa62a('0x1'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0xa62a('0x2')](function(_0x488db8){return _0x488db8[_0xa62a('0x3')];})['join'](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING='Interval\x20string\x20not\x20valid';var EINVALID_DATE=_0xa62a('0x4');function throwIfDateNotValid(_0x1658ee){if(!_0x1658ee[_0xa62a('0x5')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x229976){var _0x348dd0=_0x229976[_0xa62a('0x6')](':')[_0xa62a('0x2')](function(_0x40ebb1){return parseInt(_0x40ebb1,0xa);});var _0x34aff5=_0x348dd0[0x0];var _0xf6b91=_0x348dd0[0x1];if(_0x34aff5<0x0||_0x34aff5>0x17||_0xf6b91<0x0||_0xf6b91>0x3b){throw new Error(EINVALID_DATE);}return[_0x34aff5,_0xf6b91];}function circularDoWInterval(_0x4a0c67,_0x36e2b2){if(_0x4a0c67===_0x36e2b2){return[_0x4a0c67];}else{var _0x3eaeca=moment['locale']();moment[_0xa62a('0x7')]('en');var _0x48922e=moment[_0xa62a('0x8')]()['map'](function(_0x4fad57){return _0x4fad57[_0xa62a('0x9')]();});moment['locale'](_0x3eaeca);var _0x16f002=_0x48922e[_0xa62a('0xa')](_0x4a0c67);var _0x12aac2=_0x48922e['indexOf'](_0x36e2b2);if(_0x12aac2>_0x16f002){return _0x48922e[_0xa62a('0xb')](_0x16f002,_0x12aac2+0x1);}else{var _0x1a99b6=_0x48922e[_0xa62a('0xb')](0x0,_0x12aac2+0x1);var _0x351a44=_0x48922e[_0xa62a('0xb')](_0x16f002);return _0x351a44['concat'](_0x1a99b6);}}}module[_0xa62a('0xc')][_0xa62a('0xd')]=circularDoWInterval;function circularMonthInterval(_0x199fe0,_0x391461){if(_0x199fe0===_0x391461){return[_0x199fe0];}else{var _0xe7c928=moment[_0xa62a('0x7')]();moment[_0xa62a('0x7')]('en');var _0x3f0b08=moment['monthsShort']()['map'](function(_0xa29ea2){return _0xa29ea2[_0xa62a('0x9')]();});moment[_0xa62a('0x7')](_0xe7c928);var _0x1b50dc=_0x3f0b08[_0xa62a('0xa')](_0x199fe0);var _0x4cbf76=_0x3f0b08[_0xa62a('0xa')](_0x391461);if(_0x4cbf76>_0x1b50dc){return _0x3f0b08[_0xa62a('0xb')](_0x1b50dc,_0x4cbf76+0x1);}else{var _0x33a29d=_0x3f0b08[_0xa62a('0xb')](0x0,_0x4cbf76+0x1);var _0x2d32cb=_0x3f0b08[_0xa62a('0xb')](_0x1b50dc);return _0x2d32cb[_0xa62a('0xe')](_0x33a29d);}}}module['exports']['circularMonthInterval']=circularMonthInterval;function parseDom(_0x33d83d){var _0x2c9ac7=parseInt(_0x33d83d,0xa);if(_0x2c9ac7<0x1||_0x2c9ac7>0x1f){throw new Error(EINVALID_DATE);}return _0x2c9ac7;}function timeCompare(_0xbe8aeb,_0x270435,_0x2a26a9){var _0x46c1b3=_0xbe8aeb[_0xa62a('0xf')]();var _0x27a841=extractTime(_0x270435);var _0x2358a9=_0x27a841[0x0];var _0x40b8c3=_0x27a841[0x1];var _0x1712c3=_0xbe8aeb[_0xa62a('0xf')]()[_0xa62a('0x10')](_0x2358a9)[_0xa62a('0x11')](_0x40b8c3);throwIfDateNotValid(_0x1712c3);var _0x5c38a2=extractTime(_0x2a26a9);var _0x5026e7=_0x5c38a2[0x0];var _0x3d9043=_0x5c38a2[0x1];var _0x3cac82=_0xbe8aeb[_0xa62a('0xf')]()[_0xa62a('0x10')](_0x5026e7)['minutes'](_0x3d9043);throwIfDateNotValid(_0x3cac82);if(_0x3cac82[_0xa62a('0x12')](_0x1712c3)){var _0x567717=_0x46c1b3[_0xa62a('0xf')]()[_0xa62a('0x13')](_0xa62a('0x14'));var _0x4836f5=_0x46c1b3['clone']()[_0xa62a('0x15')](_0xa62a('0x14'));return _0x46c1b3[_0xa62a('0x16')](_0x1712c3,_0x4836f5,undefined,'[]')||_0x46c1b3[_0xa62a('0x16')](_0x567717,_0x3cac82,undefined,'[]');}else{return _0x46c1b3['isBetween'](_0x1712c3,_0x3cac82,undefined,'[]');}}module['exports'][_0xa62a('0x17')]=timeCompare;function dowCompare(_0x2b8d67,_0x83381f,_0x2153ca){var _0xb0c98f=_0x2b8d67[_0xa62a('0x7')]('en')[_0xa62a('0x18')]('ddd')[_0xa62a('0x9')]();return circularDoWInterval(_0x83381f,_0x2153ca)[_0xa62a('0x19')](_0xb0c98f);}module['exports'][_0xa62a('0x1a')]=dowCompare;function domCompare(_0x398eef,_0x9997fd,_0x94b037){var _0x597aec=_0x398eef[_0xa62a('0x1b')]();if(_0x9997fd===_0x94b037){return _0x597aec===_0x9997fd;}else{var _0x17c75f=_0x398eef[_0xa62a('0x1c')]();var _0x5cb9e6=_0x9997fd<_0x94b037;let _0x284b2b=![];var _0x44cca=0x0;var _0x557637=0x0;if(_0x5cb9e6){_0x44cca=Math[_0xa62a('0x1d')](0x1,_0x9997fd);_0x557637=Math[_0xa62a('0x1e')](_0x94b037,_0x17c75f);_0x284b2b=_0x597aec>=_0x44cca&&_0x597aec<=_0x557637;}else{_0x44cca=Math[_0xa62a('0x1e')](_0x9997fd,_0x17c75f);_0x557637=Math[_0xa62a('0x1d')](0x1,_0x94b037);_0x284b2b=_0x597aec>=_0x44cca||_0x597aec<=_0x557637;}return _0x284b2b;}}module[_0xa62a('0xc')][_0xa62a('0x1f')]=domCompare;function monthCompare(_0x258a84,_0x4e828e,_0x2f2f62){var _0x1ddcce=_0x258a84[_0xa62a('0x7')]('en')[_0xa62a('0x18')](_0xa62a('0x20'))[_0xa62a('0x9')]();return circularMonthInterval(_0x4e828e,_0x2f2f62)[_0xa62a('0x19')](_0x1ddcce);}module[_0xa62a('0xc')][_0xa62a('0x21')]=monthCompare;function iftime(_0x4b2b3b,_0x447260=moment['tz'][_0xa62a('0x22')](),_0x2593bf=moment()){if(!validateRx[_0xa62a('0x23')](_0x4b2b3b)){throw new Error(EINVALID_STRING);}else{var _0x2113b9=(moment[_0xa62a('0x24')](_0x2593bf)?_0x2593bf[_0xa62a('0xf')]():moment(_0x2593bf))['tz'](_0x447260)[_0xa62a('0x7')]('en');throwIfDateNotValid(_0x2113b9);var _0x167c5a=_0x4b2b3b['split'](',');var _0x323c90=_0x167c5a[0x0];var _0x7547d5=_0x167c5a[0x1];var _0x3ab564=_0x167c5a[0x2];var _0x44cede=_0x167c5a[0x3];let _0x576e0a=!![];if(_0x323c90!=='*'){var _0x3a863d=_0x323c90[_0xa62a('0x6')]('-');var _0x3b9459=_[_0xa62a('0x25')](_0x3a863d[0x0],0x5,'0');var _0x146156=_0x3a863d[_0xa62a('0x26')]===0x2?_[_0xa62a('0x25')](_0x3a863d[0x1],0x5,'0'):_0x3b9459;_0x576e0a=timeCompare(_0x2113b9,_0x3b9459,_0x146156);}let _0x14d00f=!![];if(_0x7547d5!=='*'){var _0x19b2d1=_0x7547d5['split']('-');var _0x29d754=_0x19b2d1[0x0];var _0x10698a=_0x19b2d1[_0xa62a('0x26')]===0x2?_0x19b2d1[0x1]:_0x29d754;_0x14d00f=dowCompare(_0x2113b9,_0x29d754,_0x10698a);}let _0x409652=!![];if(_0x3ab564!=='*'){var _0x45a590=_0x3ab564['split']('-');var _0x178645=parseDom(_0x45a590[0x0]);var _0x33b57b=_0x45a590['length']===0x2?parseDom(_0x45a590[0x1]):_0x178645;_0x409652=domCompare(_0x2113b9,_0x178645,_0x33b57b);}let _0x3ae163=!![];if(_0x44cede!=='*'){var _0x47d0a5=_0x44cede[_0xa62a('0x6')]('-');var _0x33eb6c=_0x47d0a5[0x0];var _0x296326=_0x47d0a5[_0xa62a('0x26')]===0x2?_0x47d0a5[0x1]:_0x47d0a5[0x0];_0x3ae163=monthCompare(_0x2113b9,_0x33eb6c,_0x296326);}return _0x576e0a&&_0x14d00f&&_0x409652&&_0x3ae163;}}module['exports']['iftime']=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 01ea7dd..564c272 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x03c4=['info','redBG\x20white','red','bold\x20yellow','white','bold\x20white','bold\x20green','bold\x20magenta','bold\x20blue','bold\x20cyan','/var/log/xcally','join','format','%s-%s.log','message','replace','{{{','[%s]\x20[%s]\x20%s\x20-\x20%s','level','meta','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','Logger','transports','Console','warn','error','File','%s-%s','path','util','moment','winston','../config/environment','debugLevel','toLowerCase'];(function(_0x54f3bf,_0x11b4cb){var _0x3eaea7=function(_0x556082){while(--_0x556082){_0x54f3bf['push'](_0x54f3bf['shift']());}};_0x3eaea7(++_0x11b4cb);}(_0x03c4,0x1a6));var _0x403c=function(_0x28a62f,_0xfe07dd){_0x28a62f=_0x28a62f-0x0;var _0x1f3e29=_0x03c4[_0x28a62f];return _0x1f3e29;};'use strict';var path=require(_0x403c('0x0'));var util=require(_0x403c('0x1'));var moment=require(_0x403c('0x2'));var winston=require(_0x403c('0x3'));var config=require(_0x403c('0x4'));var debugLevel=config[_0x403c('0x5')]?config[_0x403c('0x5')][_0x403c('0x6')]():_0x403c('0x7');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0x403c('0x8'),'error':_0x403c('0x9'),'warn':_0x403c('0xa'),'info':_0x403c('0xb'),'print':_0x403c('0xc'),'success':_0x403c('0xd'),'http':'gray','verbose':_0x403c('0xe'),'debug':_0x403c('0xf'),'silly':_0x403c('0x10')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0xed882c,_0x5f0dba,_0x20e9b7){var _0x58b76d=_0xed882c||_0x403c('0x11');return path[_0x403c('0x12')](_0x58b76d,util[_0x403c('0x13')](_0x403c('0x14'),_0x5f0dba,_0x20e9b7));}function formatter(_0x322d1f,_0x5b6235){_0x5b6235[_0x403c('0x15')]=_0x5b6235['message'][_0x403c('0x16')](/@@{/g,_0x403c('0x17'))['replace'](/}@@/g,'}}}')[_0x403c('0x16')](/@{/g,'{{')[_0x403c('0x16')](/}@/g,'}}');return util[_0x403c('0x13')](_0x403c('0x18'),moment()[_0x403c('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),_0x5b6235[_0x403c('0x19')]['toUpperCase'](),_0x322d1f,_0x5b6235['message']);}function fileFormat(_0x294be6,_0x5de6d1){_0x5de6d1[_0x403c('0x15')]=_0x5de6d1[_0x403c('0x15')]['replace'](/@@{/g,_0x403c('0x17'))['replace'](/}@@/g,'}}}')[_0x403c('0x16')](/@{/g,'{{')[_0x403c('0x16')](/}@/g,'}}');var _0x597785=_0x5de6d1[_0x403c('0x1a')]&&Object['keys'](_0x5de6d1[_0x403c('0x1a')])[_0x403c('0x1b')]?'\x0a\x09'+JSON[_0x403c('0x1c')](_0x5de6d1[_0x403c('0x1a')]):'';return util[_0x403c('0x13')](_0x403c('0x1d'),moment()[_0x403c('0x13')](_0x403c('0x1e')),_0x5de6d1['level'][_0x403c('0x1f')](),_0x294be6,_0x5de6d1[_0x403c('0x15')],_0x597785);}function consoleLogger(){var _0x35b34d=new winston[(_0x403c('0x20'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x403c('0x21'))][(_0x403c('0x22'))]({'level':_0x403c('0x23'),'json':![],'formatter':function(_0x47bc1d){return formatter('',_0x47bc1d);}})]});return _0x35b34d;}function fileLogger(_0x1bf3ca,_0x3f6f0e){var _0x495211=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x403c('0x21'))]['File']({'name':util[_0x403c('0x13')]('%s-%s',_0x1bf3ca,_0x403c('0x24')),'filename':getLogFileName(_0x3f6f0e,_0x1bf3ca,_0x403c('0x24')),'level':_0x403c('0x24'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2efeb2){return fileFormat(_0x1bf3ca,_0x2efeb2);}}),new winston[(_0x403c('0x21'))][(_0x403c('0x25'))]({'name':util[_0x403c('0x13')](_0x403c('0x26'),_0x1bf3ca,debugLevel),'filename':getLogFileName(_0x3f6f0e,_0x1bf3ca,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3c9d0d){return fileFormat(_0x1bf3ca,_0x3c9d0d);}}),new winston[(_0x403c('0x21'))][(_0x403c('0x22'))]({'level':_0x403c('0x23'),'json':![],'formatter':function(_0x373148){return fileFormat(_0x1bf3ca,_0x373148);}})]});return _0x495211;}exports['consoleLogger']=consoleLogger;exports['fileLogger']=fileLogger; \ No newline at end of file +var _0x952e=['[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','level','toUpperCase','transports','Console','warn','%s-%s','error','File','consoleLogger','fileLogger','util','moment','../config/environment','debugLevel','red','bold\x20white','bold\x20green','gray','bold\x20blue','/var/log/xcally','format','%s-%s.log','message','{{{','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','keys','meta','length'];(function(_0x14523d,_0x548920){var _0x1478c7=function(_0x2f13d8){while(--_0x2f13d8){_0x14523d['push'](_0x14523d['shift']());}};_0x1478c7(++_0x548920);}(_0x952e,0x103));var _0xe952=function(_0x1b6fa0,_0x27856e){_0x1b6fa0=_0x1b6fa0-0x0;var _0x2c7db9=_0x952e[_0x1b6fa0];return _0x2c7db9;};'use strict';var path=require('path');var util=require(_0xe952('0x0'));var moment=require(_0xe952('0x1'));var winston=require('winston');var config=require(_0xe952('0x2'));var debugLevel=config[_0xe952('0x3')]?config[_0xe952('0x3')]['toLowerCase']():'info';var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':'redBG\x20white','error':_0xe952('0x4'),'warn':'bold\x20yellow','info':'white','print':_0xe952('0x5'),'success':_0xe952('0x6'),'http':_0xe952('0x7'),'verbose':'bold\x20magenta','debug':_0xe952('0x8'),'silly':'bold\x20cyan'};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0xd7b2f3,_0x38ba42,_0x5afa5d){var _0x3e56bd=_0xd7b2f3||_0xe952('0x9');return path['join'](_0x3e56bd,util[_0xe952('0xa')](_0xe952('0xb'),_0x38ba42,_0x5afa5d));}function formatter(_0x5b08ba,_0x33cfd3){_0x33cfd3[_0xe952('0xc')]=_0x33cfd3[_0xe952('0xc')]['replace'](/@@{/g,_0xe952('0xd'))[_0xe952('0xe')](/}@@/g,_0xe952('0xf'))[_0xe952('0xe')](/@{/g,'{{')[_0xe952('0xe')](/}@/g,'}}');return util['format'](_0xe952('0x10'),moment()[_0xe952('0xa')]('YYYY-MM-DD\x20HH:mm:ss'),_0x33cfd3['level']['toUpperCase'](),_0x5b08ba,_0x33cfd3[_0xe952('0xc')]);}function fileFormat(_0x376c88,_0x1fa246){_0x1fa246[_0xe952('0xc')]=_0x1fa246['message'][_0xe952('0xe')](/@@{/g,'{{{')[_0xe952('0xe')](/}@@/g,_0xe952('0xf'))['replace'](/@{/g,'{{')[_0xe952('0xe')](/}@/g,'}}');var _0x58c097=_0x1fa246['meta']&&Object[_0xe952('0x11')](_0x1fa246[_0xe952('0x12')])[_0xe952('0x13')]?'\x0a\x09'+JSON['stringify'](_0x1fa246[_0xe952('0x12')]):'';return util['format'](_0xe952('0x14'),moment()[_0xe952('0xa')]('YYYY-MM-DD\x20HH:mm:ss'),_0x1fa246[_0xe952('0x15')][_0xe952('0x16')](),_0x376c88,_0x1fa246[_0xe952('0xc')],_0x58c097);}function consoleLogger(){var _0x176c27=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xe952('0x17'))][(_0xe952('0x18'))]({'level':_0xe952('0x19'),'json':![],'formatter':function(_0x4c1f6a){return formatter('',_0x4c1f6a);}})]});return _0x176c27;}function fileLogger(_0x12ec04,_0x4617f9){var _0x44b18d=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xe952('0x17'))]['File']({'name':util['format'](_0xe952('0x1a'),_0x12ec04,'error'),'filename':getLogFileName(_0x4617f9,_0x12ec04,_0xe952('0x1b')),'level':_0xe952('0x1b'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x344dc4){return fileFormat(_0x12ec04,_0x344dc4);}}),new winston[(_0xe952('0x17'))][(_0xe952('0x1c'))]({'name':util[_0xe952('0xa')]('%s-%s',_0x12ec04,debugLevel),'filename':getLogFileName(_0x4617f9,_0x12ec04,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x35d029){return fileFormat(_0x12ec04,_0x35d029);}}),new winston['transports'][(_0xe952('0x18'))]({'level':_0xe952('0x19'),'json':![],'formatter':function(_0x10cb26){return fileFormat(_0x12ec04,_0x10cb26);}})]});return _0x44b18d;}exports[_0xe952('0x1d')]=consoleLogger;exports[_0xe952('0x1e')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index f25229c..7931dd3 100644 --- a/server/utils/mask-sensitive-data.js +++ b/server/utils/mask-sensitive-data.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x14a0=['membername','calleridnum','exten','clientEmail','privateKey','accesskeyid','secretaccesskey','key','user','pass','accountSid','localstationid','dsn','secret','registry','isArray','length','isPlainObject','isString','replace','@@{','}@@','includes','exports','maskSensitiveData','username','password','newPassword','apiKey','firstName','lastName','street','fax','email','clientId','code','accessKey','tenantId','accessToken'];(function(_0x3f4a72,_0x399ea9){var _0x1b40f3=function(_0x10cde0){while(--_0x10cde0){_0x3f4a72['push'](_0x3f4a72['shift']());}};_0x1b40f3(++_0x399ea9);}(_0x14a0,0x8e));var _0x014a=function(_0x1d4e36,_0x54fde6){_0x1d4e36=_0x1d4e36-0x0;var _0x4dab8c=_0x14a0[_0x1d4e36];return _0x4dab8c;};var _=require('lodash');var sensitiveFields=[_0x014a('0x0'),_0x014a('0x1'),_0x014a('0x2'),_0x014a('0x3'),_0x014a('0x4'),_0x014a('0x5'),_0x014a('0x6'),'phone','mobile',_0x014a('0x7'),_0x014a('0x8'),_0x014a('0x9'),'clientSecret','securityToken',_0x014a('0xa'),_0x014a('0xb'),_0x014a('0xc'),'token','channelSecret',_0x014a('0xd'),'accessTokenSecret','authToken','consumerKey','consumerSecret',_0x014a('0xe'),'calleridname',_0x014a('0xf'),_0x014a('0x10'),'vidaooApiKey',_0x014a('0x11'),_0x014a('0x12'),_0x014a('0x13'),_0x014a('0x14'),_0x014a('0x15'),_0x014a('0x16'),_0x014a('0x17'),_0x014a('0x18'),_0x014a('0x19'),_0x014a('0x1a'),_0x014a('0x1b'),_0x014a('0x1c'),'oldPassword'];function maskSensitiveData(_0x130d13){const _0x3cf92f=/(?!^)[\s\S](?!$)/g;if(_['isPlainObject'](_0x130d13)){for(const _0x3a836f in _0x130d13){if(_[_0x014a('0x1d')](_0x130d13[_0x3a836f])){for(let _0x59a4ea=0x0;_0x59a4ea<_0x130d13[_0x3a836f][_0x014a('0x1e')];_0x59a4ea++){maskSensitiveData(_0x130d13[_0x3a836f][_0x59a4ea]);}}else if(_[_0x014a('0x1f')](_0x130d13[_0x3a836f])){maskSensitiveData(_0x130d13[_0x3a836f]);}else if(_[_0x014a('0x20')](_0x130d13[_0x3a836f])){_0x130d13[_0x3a836f]=_0x130d13[_0x3a836f][_0x014a('0x21')](/{{{/g,_0x014a('0x22'))[_0x014a('0x21')](/}}}/g,_0x014a('0x23'))[_0x014a('0x21')](/{{/g,'@{')[_0x014a('0x21')](/}}/g,'}@');if(_[_0x014a('0x24')](sensitiveFields,_0x3a836f)){_0x130d13[_0x3a836f]=_0x130d13[_0x3a836f][_0x014a('0x21')](_0x3cf92f,'*');}}}}}module[_0x014a('0x25')][_0x014a('0x26')]=maskSensitiveData; \ No newline at end of file +var _0xadb5=['exten','vidaooApiKey','privateKey','secretaccesskey','user','pass','accountSid','dsn','secret','registry','isPlainObject','isArray','length','isString','replace','@@{','}@@','username','newPassword','apiKey','firstName','street','phone','mobile','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','calleridnum'];(function(_0x1cb46c,_0x2ea1b1){var _0x52b911=function(_0x19bbab){while(--_0x19bbab){_0x1cb46c['push'](_0x1cb46c['shift']());}};_0x52b911(++_0x2ea1b1);}(_0xadb5,0xad));var _0x5adb=function(_0x485c2c,_0x5f2de1){_0x485c2c=_0x485c2c-0x0;var _0x5ad816=_0xadb5[_0x485c2c];return _0x5ad816;};var _=require('lodash');var sensitiveFields=[_0x5adb('0x0'),'password',_0x5adb('0x1'),_0x5adb('0x2'),_0x5adb('0x3'),'lastName',_0x5adb('0x4'),_0x5adb('0x5'),_0x5adb('0x6'),'fax',_0x5adb('0x7'),_0x5adb('0x8'),_0x5adb('0x9'),_0x5adb('0xa'),_0x5adb('0xb'),_0x5adb('0xc'),_0x5adb('0xd'),_0x5adb('0xe'),_0x5adb('0xf'),_0x5adb('0x10'),_0x5adb('0x11'),_0x5adb('0x12'),_0x5adb('0x13'),_0x5adb('0x14'),'membername','calleridname',_0x5adb('0x15'),_0x5adb('0x16'),_0x5adb('0x17'),'clientEmail',_0x5adb('0x18'),'accesskeyid',_0x5adb('0x19'),'key',_0x5adb('0x1a'),_0x5adb('0x1b'),_0x5adb('0x1c'),'localstationid',_0x5adb('0x1d'),_0x5adb('0x1e'),_0x5adb('0x1f'),'oldPassword'];function maskSensitiveData(_0x2312de){const _0x518823=/(?!^)[\s\S](?!$)/g;if(_[_0x5adb('0x20')](_0x2312de)){for(const _0x42a482 in _0x2312de){if(_[_0x5adb('0x21')](_0x2312de[_0x42a482])){for(let _0x304784=0x0;_0x304784<_0x2312de[_0x42a482][_0x5adb('0x22')];_0x304784++){maskSensitiveData(_0x2312de[_0x42a482][_0x304784]);}}else if(_[_0x5adb('0x20')](_0x2312de[_0x42a482])){maskSensitiveData(_0x2312de[_0x42a482]);}else if(_[_0x5adb('0x23')](_0x2312de[_0x42a482])){_0x2312de[_0x42a482]=_0x2312de[_0x42a482][_0x5adb('0x24')](/{{{/g,_0x5adb('0x25'))['replace'](/}}}/g,_0x5adb('0x26'))['replace'](/{{/g,'@{')[_0x5adb('0x24')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x42a482)){_0x2312de[_0x42a482]=_0x2312de[_0x42a482][_0x5adb('0x24')](_0x518823,'*');}}}}}module['exports']['maskSensitiveData']=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/misc.js b/server/utils/misc.js index d92de6b..f126d7a 100644 --- a/server/utils/misc.js +++ b/server/utils/misc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x326f=['replace','\x5c$&','exports'];(function(_0x27e4f0,_0x131d6d){var _0x1dbdd2=function(_0x51cdb7){while(--_0x51cdb7){_0x27e4f0['push'](_0x27e4f0['shift']());}};_0x1dbdd2(++_0x131d6d);}(_0x326f,0xd1));var _0xf326=function(_0x5d857b,_0x4efbb7){_0x5d857b=_0x5d857b-0x0;var _0x3ebaca=_0x326f[_0x5d857b];return _0x3ebaca;};module[_0xf326('0x0')]={'escapeRegExp'(_0x55c50e,_0x5452cc=/[-[\]{}()*+?.,\\\/^$|#\s]/g){return _0x55c50e[_0xf326('0x1')](_0x5452cc,_0xf326('0x2'));}}; \ No newline at end of file +var _0x5f2f=['\x5c$&','exports','replace'];(function(_0x424c95,_0x1a3267){var _0x263c44=function(_0x30b6fc){while(--_0x30b6fc){_0x424c95['push'](_0x424c95['shift']());}};_0x263c44(++_0x1a3267);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1601ef,_0x5bcf40){_0x1601ef=_0x1601ef-0x0;var _0x12d3a8=_0x5f2f[_0x1601ef];return _0x12d3a8;};module[_0xf5f2('0x0')]={'escapeRegExp'(_0x423dd9,_0x2dcf60=/[-[\]{}()*+?.,\\\/^$|#\s]/g){return _0x423dd9[_0xf5f2('0x1')](_0x2dcf60,_0xf5f2('0x2'));}}; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 585ef8a..afd6d90 100644 --- a/server/utils/safe-template.js +++ b/server/utils/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4cf8=['safeTemplate','lodash','{\x20{\x20','\x20}\x20}','string','replace','isArray','map','isPlainObject','exports'];(function(_0x2936a8,_0x15c8ad){var _0xd5f2f9=function(_0x25f4b2){while(--_0x25f4b2){_0x2936a8['push'](_0x2936a8['shift']());}};_0xd5f2f9(++_0x15c8ad);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0x4cf8[_0x4b2436];return _0x4f5ab2;};var _=require(_0x84cf('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x2d03b6){return _0x2d03b6==='{{'?_0x84cf('0x1'):_0x84cf('0x2');}function safeTemplate(_0xae953){var _0x28455b=_0xae953;if(typeof _0xae953===_0x84cf('0x3')){_0x28455b=_0xae953[_0x84cf('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x84cf('0x5')](_0xae953)){_0x28455b=_0xae953[_0x84cf('0x6')](function(_0x5844d7){return safeTemplate(_0x5844d7);});}else if(_[_0x84cf('0x7')](_0xae953)){_0x28455b=Object['keys'](_0xae953)['reduce'](function(_0x455345,_0x56c5cc){_0x455345[_0x56c5cc]=safeTemplate(_0xae953[_0x56c5cc]);return _0x455345;},{});}return _0x28455b;}module[_0x84cf('0x8')][_0x84cf('0x9')]=safeTemplate; \ No newline at end of file +var _0x896e=['map','isPlainObject','reduce','exports','safeTemplate','lodash','{\x20{\x20','\x20}\x20}','string','replace','isArray'];(function(_0x3ef743,_0x54eb90){var _0x596153=function(_0x3dc023){while(--_0x3dc023){_0x3ef743['push'](_0x3ef743['shift']());}};_0x596153(++_0x54eb90);}(_0x896e,0x1e9));var _0xe896=function(_0xcdedd0,_0x4c7564){_0xcdedd0=_0xcdedd0-0x0;var _0x20c704=_0x896e[_0xcdedd0];return _0x20c704;};var _=require(_0xe896('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x1bab19){return _0x1bab19==='{{'?_0xe896('0x1'):_0xe896('0x2');}function safeTemplate(_0x36085e){var _0x26d296=_0x36085e;if(typeof _0x36085e===_0xe896('0x3')){_0x26d296=_0x36085e[_0xe896('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xe896('0x5')](_0x36085e)){_0x26d296=_0x36085e[_0xe896('0x6')](function(_0x244f68){return safeTemplate(_0x244f68);});}else if(_[_0xe896('0x7')](_0x36085e)){_0x26d296=Object['keys'](_0x36085e)[_0xe896('0x8')](function(_0x7a0721,_0x3b902c){_0x7a0721[_0x3b902c]=safeTemplate(_0x36085e[_0x3b902c]);return _0x7a0721;},{});}return _0x26d296;}module[_0xe896('0x9')][_0xe896('0xa')]=safeTemplate; \ No newline at end of file diff --git a/server/utils/update-app-config.js b/server/utils/update-app-config.js index 6171e01..6dc6c7a 100644 --- a/server/utils/update-app-config.js +++ b/server/utils/update-app-config.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x223d=['pathExists','readJSON','then','updated','info','Updating\x20app.json','exports','path','../config/environment','root','resolve','isArray','apps','findIndex','name','motion2','env','NODE_PATH','string'];(function(_0x587fb5,_0x59cb3b){var _0x551105=function(_0x5bbef4){while(--_0x5bbef4){_0x587fb5['push'](_0x587fb5['shift']());}};_0x551105(++_0x59cb3b);}(_0x223d,0x170));var _0xd223=function(_0x3217df,_0x1b735f){_0x3217df=_0x3217df-0x0;var _0x3415d6=_0x223d[_0x3217df];return _0x3415d6;};var fs=require('fs-extra');var path=require(_0xd223('0x0'));var config=require(_0xd223('0x1'));var root=config[_0xd223('0x2')];var APP_JSON_PATH=path['resolve'](root,'server/app.json');var NODEPATH=path[_0xd223('0x3')](root,'legacy-libs');function setLegacyLibsNodeEnvPath(_0x3406b6){let _0x57e0f8=![];if(Array[_0xd223('0x4')](_0x3406b6[_0xd223('0x5')])){var _0x49e292=_0x3406b6[_0xd223('0x5')][_0xd223('0x6')](function(_0x2f717c){return _0x2f717c[_0xd223('0x7')]===_0xd223('0x8');});if(_0x49e292>-0x1){var _0x99a86c=_0x3406b6[_0xd223('0x5')][_0x49e292];if(typeof _0x99a86c[_0xd223('0x9')][_0xd223('0xa')]!==_0xd223('0xb')){_0x99a86c[_0xd223('0x9')][_0xd223('0xa')]=NODEPATH;_0x57e0f8=!![];}}return{'appConfig':_0x3406b6,'updated':_0x57e0f8};}}function updateAppConfig(_0x5465f2){return fs[_0xd223('0xc')](APP_JSON_PATH)['then'](function(_0x1a727b){if(_0x1a727b){return fs[_0xd223('0xd')](APP_JSON_PATH)[_0xd223('0xe')](function(_0x160110){var _0x40e90f=setLegacyLibsNodeEnvPath(_0x160110);if(_0x40e90f[_0xd223('0xf')]){_0x5465f2[_0xd223('0x10')](_0xd223('0x11'));return fs['writeJSON'](APP_JSON_PATH,_0x160110,{'spaces':0x2});}else{return Promise['resolve']();}});}else{return Promise[_0xd223('0x3')]();}});}module[_0xd223('0x12')]=updateAppConfig; \ No newline at end of file +var _0xbbcb=['legacy-libs','apps','findIndex','name','motion2','env','string','pathExists','then','updated','info','Updating\x20app.json','writeJSON','exports','fs-extra','path','../config/environment','root','server/app.json','resolve'];(function(_0x2d3b67,_0x353755){var _0x4faca7=function(_0x4ffd9d){while(--_0x4ffd9d){_0x2d3b67['push'](_0x2d3b67['shift']());}};_0x4faca7(++_0x353755);}(_0xbbcb,0x176));var _0xbbbc=function(_0x1329c7,_0x419bed){_0x1329c7=_0x1329c7-0x0;var _0x1cb9fa=_0xbbcb[_0x1329c7];return _0x1cb9fa;};var fs=require(_0xbbbc('0x0'));var path=require(_0xbbbc('0x1'));var config=require(_0xbbbc('0x2'));var root=config[_0xbbbc('0x3')];var APP_JSON_PATH=path['resolve'](root,_0xbbbc('0x4'));var NODEPATH=path[_0xbbbc('0x5')](root,_0xbbbc('0x6'));function setLegacyLibsNodeEnvPath(_0x14938f){let _0xe176ff=![];if(Array['isArray'](_0x14938f[_0xbbbc('0x7')])){var _0x14f7fa=_0x14938f[_0xbbbc('0x7')][_0xbbbc('0x8')](function(_0x51ce58){return _0x51ce58[_0xbbbc('0x9')]===_0xbbbc('0xa');});if(_0x14f7fa>-0x1){var _0x5da13c=_0x14938f[_0xbbbc('0x7')][_0x14f7fa];if(typeof _0x5da13c[_0xbbbc('0xb')]['NODE_PATH']!==_0xbbbc('0xc')){_0x5da13c[_0xbbbc('0xb')]['NODE_PATH']=NODEPATH;_0xe176ff=!![];}}return{'appConfig':_0x14938f,'updated':_0xe176ff};}}function updateAppConfig(_0x3b4e2a){return fs[_0xbbbc('0xd')](APP_JSON_PATH)[_0xbbbc('0xe')](function(_0x1f66ff){if(_0x1f66ff){return fs['readJSON'](APP_JSON_PATH)[_0xbbbc('0xe')](function(_0x293c82){var _0x1f6deb=setLegacyLibsNodeEnvPath(_0x293c82);if(_0x1f6deb[_0xbbbc('0xf')]){_0x3b4e2a[_0xbbbc('0x10')](_0xbbbc('0x11'));return fs[_0xbbbc('0x12')](APP_JSON_PATH,_0x293c82,{'spaces':0x2});}else{return Promise[_0xbbbc('0x5')]();}});}else{return Promise[_0xbbbc('0x5')]();}});}module[_0xbbbc('0x13')]=updateAppConfig; \ No newline at end of file